diff --git a/Assets/01.Scenes/04.TycoonTest.unity b/Assets/01.Scenes/04.TycoonTest.unity index df6b0374f..85b136dcf 100644 --- a/Assets/01.Scenes/04.TycoonTest.unity +++ b/Assets/01.Scenes/04.TycoonTest.unity @@ -12525,7 +12525,7 @@ PrefabInstance: objectReference: {fileID: 0} - target: {fileID: 5897095096647521783, guid: 598703e13192d2b49b23165079e69838, type: 3} propertyPath: m_Name - value: Frying + value: Fryer objectReference: {fileID: 0} m_RemovedComponents: [] m_RemovedGameObjects: [] diff --git a/Assets/02.Scripts/DDD/Prop/Furniture/Frying.cs b/Assets/02.Scripts/DDD/Prop/Furniture/Fryer.cs similarity index 91% rename from Assets/02.Scripts/DDD/Prop/Furniture/Frying.cs rename to Assets/02.Scripts/DDD/Prop/Furniture/Fryer.cs index 5356513bd..bd8e3862b 100644 --- a/Assets/02.Scripts/DDD/Prop/Furniture/Frying.cs +++ b/Assets/02.Scripts/DDD/Prop/Furniture/Fryer.cs @@ -1,5 +1,4 @@ using System; -using System.Collections; using System.Threading.Tasks; using DDD.ScriptableObjects; using Sirenix.OdinInspector; @@ -8,7 +7,7 @@ using UnityEngine; namespace DDD.Tycoons { [Serializable] - public class Frying : InteractionFurniture + public class Fryer : InteractionFurniture { [SerializeField] private AnimationController _animationController; @@ -48,7 +47,7 @@ namespace DDD.Tycoons base.Interaction(); GameManager.Instance.CurrentTycoonPlayer.IsCookingFried = true; - //_animationController.SetAnimationParameter(IsEnabledHash, true); + _animationController.SetAnimationParameter(IsEnabledHash, true); } public override void CancelInteraction() @@ -56,7 +55,7 @@ namespace DDD.Tycoons base.CancelInteraction(); GameManager.Instance.CurrentTycoonPlayer.IsCookingFried = false; - //_animationController.SetAnimationParameter(IsEnabledHash, false); + _animationController.SetAnimationParameter(IsEnabledHash, false); } public override bool CanInteraction() diff --git a/Assets/02.Scripts/DDD/Prop/Furniture/Frying.cs.meta b/Assets/02.Scripts/DDD/Prop/Furniture/Fryer.cs.meta similarity index 100% rename from Assets/02.Scripts/DDD/Prop/Furniture/Frying.cs.meta rename to Assets/02.Scripts/DDD/Prop/Furniture/Fryer.cs.meta diff --git a/Assets/03.Images/DDD/Props/Furnitures/Fryer.png b/Assets/03.Images/DDD/Props/Furnitures/Fryer.png new file mode 100644 index 000000000..8bd42e2c5 Binary files /dev/null and b/Assets/03.Images/DDD/Props/Furnitures/Fryer.png differ diff --git a/Assets/03.Images/DDD/Props/Furnitures/Fryer.png.meta b/Assets/03.Images/DDD/Props/Furnitures/Fryer.png.meta new file mode 100644 index 000000000..76b2fc749 --- /dev/null +++ b/Assets/03.Images/DDD/Props/Furnitures/Fryer.png.meta @@ -0,0 +1,436 @@ +fileFormatVersion: 2 +guid: ad7ebdf45034c174a8dca56f94af3cbf +TextureImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 13 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + sRGBTexture: 1 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + flipGreenChannel: 0 + isReadable: 0 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + vTOnly: 0 + ignoreMipmapLimit: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: 1 + aniso: 1 + mipBias: 0 + wrapU: 1 + wrapV: 1 + wrapW: 0 + nPOTScale: 0 + lightmap: 0 + compressionQuality: 50 + spriteMode: 2 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 1024 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 + alphaIsTransparency: 1 + spriteTessellationDetail: -1 + textureType: 8 + textureShape: 1 + singleChannelComponent: 0 + flipbookRows: 1 + flipbookColumns: 1 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + ignorePngGamma: 0 + applyGammaDecoding: 0 + swizzle: 50462976 + cookieLightType: 0 + platformSettings: + - serializedVersion: 4 + buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + ignorePlatformSupport: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 4 + buildTarget: iOS + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + ignorePlatformSupport: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 4 + buildTarget: Android + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + ignorePlatformSupport: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 4 + buildTarget: Standalone + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + ignorePlatformSupport: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 4 + buildTarget: WindowsStoreApps + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + ignorePlatformSupport: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + spriteSheet: + serializedVersion: 2 + sprites: + - serializedVersion: 2 + name: Fryer_0 + rect: + serializedVersion: 2 + x: 0 + y: 3072 + width: 1024 + height: 1024 + alignment: 7 + pivot: {x: 0.5, y: 0} + border: {x: 0, y: 0, z: 0, w: 0} + customData: + outline: [] + physicsShape: [] + tessellationDetail: 0 + bones: [] + spriteID: dff27372983395d46a0894e28392995d + internalID: -1081119610 + vertices: [] + indices: + edges: [] + weights: [] + - serializedVersion: 2 + name: Fryer_1 + rect: + serializedVersion: 2 + x: 1024 + y: 3072 + width: 1024 + height: 1024 + alignment: 7 + pivot: {x: 0.5, y: 0} + border: {x: 0, y: 0, z: 0, w: 0} + customData: + outline: [] + physicsShape: [] + tessellationDetail: 0 + bones: [] + spriteID: c316489f62fecac489965dd0815c4a91 + internalID: 811674218 + vertices: [] + indices: + edges: [] + weights: [] + - serializedVersion: 2 + name: Fryer_2 + rect: + serializedVersion: 2 + x: 2048 + y: 3072 + width: 1024 + height: 1024 + alignment: 7 + pivot: {x: 0.5, y: 0} + border: {x: 0, y: 0, z: 0, w: 0} + customData: + outline: [] + physicsShape: [] + tessellationDetail: 0 + bones: [] + spriteID: e10c8e61c1ebf504eaaf555f1d9aabad + internalID: -2057609827 + vertices: [] + indices: + edges: [] + weights: [] + - serializedVersion: 2 + name: Fryer_3 + rect: + serializedVersion: 2 + x: 3072 + y: 3072 + width: 1024 + height: 1024 + alignment: 7 + pivot: {x: 0.5, y: 0} + border: {x: 0, y: 0, z: 0, w: 0} + customData: + outline: [] + physicsShape: [] + tessellationDetail: 0 + bones: [] + spriteID: 61f7764a7bfda4e459b9fcf3fd16475d + internalID: -659907489 + vertices: [] + indices: + edges: [] + weights: [] + - serializedVersion: 2 + name: Fryer_4 + rect: + serializedVersion: 2 + x: 0 + y: 2048 + width: 1024 + height: 1024 + alignment: 7 + pivot: {x: 0.5, y: 0} + border: {x: 0, y: 0, z: 0, w: 0} + customData: + outline: [] + physicsShape: [] + tessellationDetail: 0 + bones: [] + spriteID: 98ca4882df339b1439773ead55f330c7 + internalID: 905636842 + vertices: [] + indices: + edges: [] + weights: [] + - serializedVersion: 2 + name: Fryer_5 + rect: + serializedVersion: 2 + x: 1024 + y: 2048 + width: 1024 + height: 1024 + alignment: 7 + pivot: {x: 0.5, y: 0} + border: {x: 0, y: 0, z: 0, w: 0} + customData: + outline: [] + physicsShape: [] + tessellationDetail: 0 + bones: [] + spriteID: 9d9fbec498166cb4291ccbf4ee5a474f + internalID: -751557288 + vertices: [] + indices: + edges: [] + weights: [] + - serializedVersion: 2 + name: Fryer_6 + rect: + serializedVersion: 2 + x: 2048 + y: 2048 + width: 1024 + height: 1024 + alignment: 7 + pivot: {x: 0.5, y: 0} + border: {x: 0, y: 0, z: 0, w: 0} + customData: + outline: [] + physicsShape: [] + tessellationDetail: 0 + bones: [] + spriteID: 08ff0e91d4a8fc34ea61a9427ec7037c + internalID: 33043708 + vertices: [] + indices: + edges: [] + weights: [] + - serializedVersion: 2 + name: Fryer_7 + rect: + serializedVersion: 2 + x: 3072 + y: 2048 + width: 1024 + height: 1024 + alignment: 7 + pivot: {x: 0.5, y: 0} + border: {x: 0, y: 0, z: 0, w: 0} + customData: + outline: [] + physicsShape: [] + tessellationDetail: 0 + bones: [] + spriteID: 390f5900254335b489ba3245e6d5416d + internalID: -661027381 + vertices: [] + indices: + edges: [] + weights: [] + - serializedVersion: 2 + name: Fryer_8 + rect: + serializedVersion: 2 + x: 0 + y: 1024 + width: 1024 + height: 1024 + alignment: 7 + pivot: {x: 0.5, y: 0} + border: {x: 0, y: 0, z: 0, w: 0} + customData: + outline: [] + physicsShape: [] + tessellationDetail: 0 + bones: [] + spriteID: 2c6209b9135e3ce459d97d2307b9460d + internalID: 87770818 + vertices: [] + indices: + edges: [] + weights: [] + - serializedVersion: 2 + name: Fryer_9 + rect: + serializedVersion: 2 + x: 1024 + y: 1024 + width: 1024 + height: 1024 + alignment: 7 + pivot: {x: 0.5, y: 0} + border: {x: 0, y: 0, z: 0, w: 0} + customData: + outline: [] + physicsShape: [] + tessellationDetail: 0 + bones: [] + spriteID: c674be2efb8de1047bdf44e4bc4a958e + internalID: 467582811 + vertices: [] + indices: + edges: [] + weights: [] + - serializedVersion: 2 + name: Fryer_10 + rect: + serializedVersion: 2 + x: 2048 + y: 1024 + width: 1024 + height: 1024 + alignment: 7 + pivot: {x: 0.5, y: 0} + border: {x: 0, y: 0, z: 0, w: 0} + customData: + outline: [] + physicsShape: [] + tessellationDetail: 0 + bones: [] + spriteID: 4cd437964e627bd4289791cd398a9cde + internalID: -2022067527 + vertices: [] + indices: + edges: [] + weights: [] + - serializedVersion: 2 + name: Fryer_11 + rect: + serializedVersion: 2 + x: 3072 + y: 1024 + width: 1024 + height: 1024 + alignment: 7 + pivot: {x: 0.5, y: 0} + border: {x: 0, y: 0, z: 0, w: 0} + customData: + outline: [] + physicsShape: [] + tessellationDetail: 0 + bones: [] + spriteID: f4e85e23f66e7f5408d6789c29a3f6ce + internalID: -1750461218 + vertices: [] + indices: + edges: [] + weights: [] + outline: [] + customData: + physicsShape: [] + bones: [] + spriteID: 41fccc7e998d4fc45ab78d7e6b7d5675 + internalID: 0 + vertices: [] + indices: + edges: [] + weights: [] + secondaryTextures: [] + spriteCustomMetadata: + entries: [] + nameFileIdTable: + Fryer_0: -1081119610 + Fryer_1: 811674218 + Fryer_10: -2022067527 + Fryer_11: -1750461218 + Fryer_12: -79201897 + Fryer_13: -76414174 + Fryer_14: 339160895 + Fryer_15: 1749652605 + Fryer_2: -2057609827 + Fryer_3: -659907489 + Fryer_4: 905636842 + Fryer_5: -751557288 + Fryer_6: 33043708 + Fryer_7: -661027381 + Fryer_8: 87770818 + Fryer_9: 467582811 + mipmapLimitGroupName: + pSDRemoveMatte: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/03.Images/DDD/Props/Furnitures/Frying.png b/Assets/03.Images/DDD/Props/Furnitures/Old/Frying.png similarity index 100% rename from Assets/03.Images/DDD/Props/Furnitures/Frying.png rename to Assets/03.Images/DDD/Props/Furnitures/Old/Frying.png diff --git a/Assets/03.Images/DDD/Props/Furnitures/Frying.png.meta b/Assets/03.Images/DDD/Props/Furnitures/Old/Frying.png.meta similarity index 100% rename from Assets/03.Images/DDD/Props/Furnitures/Frying.png.meta rename to Assets/03.Images/DDD/Props/Furnitures/Old/Frying.png.meta diff --git a/Assets/03.Images/DDD/Props/Furnitures/Stove.png b/Assets/03.Images/DDD/Props/Furnitures/Old/Stove.png similarity index 100% rename from Assets/03.Images/DDD/Props/Furnitures/Stove.png rename to Assets/03.Images/DDD/Props/Furnitures/Old/Stove.png diff --git a/Assets/03.Images/DDD/Props/Furnitures/Stove.png.meta b/Assets/03.Images/DDD/Props/Furnitures/Old/Stove.png.meta similarity index 100% rename from Assets/03.Images/DDD/Props/Furnitures/Stove.png.meta rename to Assets/03.Images/DDD/Props/Furnitures/Old/Stove.png.meta diff --git a/Assets/04.Materials/AllInLit.mat b/Assets/04.Materials/AllInLit.mat new file mode 100644 index 000000000..d67a6abb7 --- /dev/null +++ b/Assets/04.Materials/AllInLit.mat @@ -0,0 +1,375 @@ +%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: AllInLit + m_Shader: {fileID: 4800000, guid: 86ce7e600deb17e429b8be445bb652f7, type: 3} + m_Parent: {fileID: 0} + m_ModifiedSerializedProperties: 0 + m_ValidKeywords: + - OUTBASE8DIR_ON + m_InvalidKeywords: + - _OUTLINEENABLED_ON + - _OUTLINEMODE_SOLID + - _OUTLINEPOSITION_INSIDE_UNDER_SPRITE + - _OUTLINESHAPE_CONTOUR + - _TILEMODE_STRETCH + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: + - MOTIONVECTORS + m_LockedProperties: + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _BaseMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _BumpMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ColorRampTex: + m_Texture: {fileID: 2800000, guid: 279657edc397ece4b8029c727adf6ddc, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ColorRampTexGradient: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ColorSwapTex: + 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} + - _DistortTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + 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} + - _FadeBurnTex: + m_Texture: {fileID: 2800000, guid: 677cca399782dea41aedc1d292ecb67d, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _FadeTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _FrameTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _GlowTex: + 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} + - _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} + - _OutlineDistortTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OutlineTex: + m_Texture: {fileID: 2800000, guid: 74087f6d03f233e4a8a142fa01f9e5cf, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OverlayTex: + m_Texture: {fileID: 2800000, guid: 677cca399782dea41aedc1d292ecb67d, type: 3} + 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} + - _ShineMask: + 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} + - 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: + - _AddPrecomputedVelocity: 0 + - _Alpha: 1 + - _AlphaClip: 0 + - _AlphaCutoffValue: 0.25 + - _AlphaOutlineBlend: 1 + - _AlphaOutlineGlow: 100 + - _AlphaOutlineMinAlpha: 0.5 + - _AlphaOutlinePower: 1 + - _AlphaRoundThreshold: 0.5 + - _AlphaThreshold: 0 + - _AlphaToMask: 0 + - _Angle: 45 + - _BillboardY: 0 + - _Blend: 0 + - _BlendModePreserveSpecular: 1 + - _BlurHD: 0 + - _BlurIntensity: 10 + - _Brightness: 0 + - _BumpScale: 1 + - _ChromAberrAlpha: 0.4 + - _ChromAberrAmount: 1 + - _ClearCoatMask: 0 + - _ClearCoatSmoothness: 0 + - _ClipUvDown: 0 + - _ClipUvLeft: 0 + - _ClipUvRight: 0 + - _ClipUvUp: 0 + - _ColorChangeLuminosity: 0 + - _ColorChangeTolerance: 0.25 + - _ColorChangeTolerance2: 0.25 + - _ColorChangeTolerance3: 0.25 + - _ColorRampBlend: 1 + - _ColorRampLuminosity: 0 + - _ColorRampOutline: 0 + - _ColorSwapBlend: 1 + - _ColorSwapBlueLuminosity: 0.5 + - _ColorSwapGreenLuminosity: 0.5 + - _ColorSwapRedLuminosity: 0.5 + - _ConnectedAlpha: 0 + - _Contrast: 1 + - _Cull: 2 + - _CullingOption: 0 + - _Cutoff: 0.5 + - _DetailAlbedoMapScale: 1 + - _DetailNormalMapScale: 1 + - _DistortAmount: 0.5 + - _DistortTexXSpeed: 5 + - _DistortTexYSpeed: 5 + - _DstBlend: 0 + - _DstBlendAlpha: 0 + - _EditorDrawers: 6 + - _EnvironmentReflections: 1 + - _FadeAmount: -0.1 + - _FadeBurnGlow: 2 + - _FadeBurnTransition: 0.075 + - _FadeBurnWidth: 0.025 + - _FishEyeUvAmount: 0.35 + - _FlickerAlpha: 0 + - _FlickerFreq: 0.2 + - _FlickerPercent: 0.05 + - _GhostBlend: 1 + - _GhostColorBoost: 1 + - _GhostTransparency: 0 + - _GlitchAmount: 3 + - _GlitchSize: 1 + - _GlossMapScale: 0 + - _Glossiness: 0 + - _GlossyReflections: 0 + - _Glow: 10 + - _GlowGlobal: 1 + - _GradBlend: 1 + - _GradBoostX: 1.2 + - _GradBoostY: 1.2 + - _GradIsRadial: 0 + - _GrassManualAnim: 1 + - _GrassManualToggle: 0 + - _GrassRadialBend: 0.1 + - _GrassSpeed: 2 + - _GrassWind: 20 + - _GreyscaleBlend: 1 + - _GreyscaleLuminosity: 0 + - _GreyscaleOutline: 0 + - _HandDrawnAmount: 10 + - _HandDrawnSpeed: 5 + - _HitEffectBlend: 1 + - _HitEffectGlow: 5 + - _HologramBlend: 1 + - _HologramMaxAlpha: 0.75 + - _HologramMinAlpha: 0.1 + - _HologramStripesAmount: 0.1 + - _HologramStripesSpeed: 4.5 + - _HologramUnmodAmount: 0 + - _HsvBright: 1 + - _HsvSaturation: 1 + - _HsvShift: 180 + - _InnerOutlineAlpha: 1 + - _InnerOutlineGlow: 4 + - _InnerOutlineThickness: 1 + - _MaxXUV: 1 + - _MaxYUV: 1 + - _Metallic: 0 + - _MinXUV: 0 + - _MinYUV: 0 + - _MotionBlurAngle: 0.1 + - _MotionBlurDist: 1.25 + - _MyDstMode: 10 + - _MySrcMode: 5 + - _NegativeAmount: 1 + - _NormalStrength: 1 + - _OcclusionStrength: 1 + - _OffsetUvX: 0 + - _OffsetUvY: 0 + - _OnlyInnerOutline: 0 + - _OnlyOutline: 0 + - _OutlineAlpha: 1 + - _OutlineDistortAmount: 0.5 + - _OutlineDistortTexXSpeed: 5 + - _OutlineDistortTexYSpeed: 5 + - _OutlineEnabled: 1 + - _OutlineGlow: 1 + - _OutlineMode: 0 + - _OutlinePixelWidth: 1 + - _OutlinePosition: 0 + - _OutlineShape: 0 + - _OutlineTexXSpeed: 10 + - _OutlineTexYSpeed: 0 + - _OutlineWidth: 0.061 + - _OverlayBlend: 1 + - _OverlayGlow: 1 + - _OverlayTextureScrollXSpeed: 0.25 + - _OverlayTextureScrollYSpeed: 0.25 + - _Parallax: 0.005 + - _PinchUvAmount: 0.35 + - _PixelateSize: 32 + - _PosterizeGamma: 0.75 + - _PosterizeNumColors: 8 + - _PosterizeOutline: 0 + - _QueueControl: -1 + - _QueueOffset: 0 + - _RadialClip: 45 + - _RadialClip2: 0 + - _RadialStartAngle: 90 + - _RandomSeed: 0 + - _ReceiveShadows: 1 + - _RectSize: 1 + - _RotateUvAmount: 0 + - _RoundWaveSpeed: 2 + - _RoundWaveStrength: 0.7 + - _ShadowAlpha: 0.5 + - _ShadowX: 0.1 + - _ShadowY: -0.05 + - _ShakeUvSpeed: 2.5 + - _ShakeUvX: 1.5 + - _ShakeUvY: 1 + - _ShineGlow: 1 + - _ShineLocation: 0.5 + - _ShineRotate: 0 + - _ShineWidth: 0.1 + - _Smoothness: 0.5 + - _SmoothnessTextureChannel: 0 + - _SpecularHighlights: 1 + - _SrcBlend: 1 + - _SrcBlendAlpha: 1 + - _Surface: 0 + - _TextureScrollXSpeed: 1 + - _TextureScrollYSpeed: 0 + - _Thickness: 10 + - _TileMode: 0 + - _TwistUvAmount: 1 + - _TwistUvPosX: 0.5 + - _TwistUvPosY: 0.5 + - _TwistUvRadius: 0.75 + - _WarpScale: 0.5 + - _WarpSpeed: 8 + - _WarpStrength: 0.025 + - _WaveAmount: 7 + - _WaveSpeed: 10 + - _WaveStrength: 7.5 + - _WaveX: 0 + - _WaveY: 0.5 + - _Weight: 0.5 + - _WorkflowMode: 1 + - _ZTestMode: 4 + - _ZWrite: 1 + - _ZoomUvAmount: 0.5 + m_Colors: + - _AlphaOutlineColor: {r: 1, g: 1, b: 1, a: 1} + - _BaseColor: {r: 1, g: 1, b: 1, a: 1} + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _ColorChangeNewCol: {r: 1, g: 1, b: 0, a: 1} + - _ColorChangeNewCol2: {r: 1, g: 1, b: 0, a: 1} + - _ColorChangeNewCol3: {r: 1, g: 1, b: 0, a: 1} + - _ColorChangeTarget: {r: 1, g: 0, b: 0, a: 1} + - _ColorChangeTarget2: {r: 1, g: 0, b: 0, a: 1} + - _ColorChangeTarget3: {r: 1, g: 0, b: 0, a: 1} + - _ColorSwapBlue: {r: 1, g: 1, b: 1, a: 1} + - _ColorSwapGreen: {r: 1, g: 1, b: 1, a: 1} + - _ColorSwapRed: {r: 1, g: 1, b: 1, a: 1} + - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} + - _FadeBurnColor: {r: 1, g: 1, b: 0, a: 1} + - _GlowColor: {r: 1, g: 1, b: 1, a: 1} + - _GradBotLeftCol: {r: 0, g: 0, b: 1, a: 1} + - _GradBotRightCol: {r: 0, g: 1, b: 0, a: 1} + - _GradTopLeftCol: {r: 1, g: 0, b: 0, a: 1} + - _GradTopRightCol: {r: 1, g: 1, b: 0, a: 1} + - _GradientOutline1: {r: 1, g: 1, b: 1, a: 1} + - _GradientOutline2: {r: 1, g: 1, b: 1, a: 1} + - _GreyscaleTintColor: {r: 1, g: 1, b: 1, a: 1} + - _HitEffectColor: {r: 1, g: 1, b: 1, a: 1} + - _HologramStripeColor: {r: 0, g: 1, b: 1, a: 1} + - _ImageOutline: {r: 1, g: 1, b: 1, a: 1} + - _InnerOutlineColor: {r: 1, g: 0, b: 0, a: 1} + - _OutlineColor: {r: 1, g: 1, b: 1, a: 1} + - _OverlayColor: {r: 1, g: 1, b: 1, a: 1} + - _ShadowColor: {r: 0, g: 0, b: 0, a: 1} + - _ShineColor: {r: 1, g: 1, b: 1, a: 1} + - _SolidOutline: {r: 1, g: 1, b: 1, a: 1} + - _SpecColor: {r: 0.19999996, g: 0.19999996, b: 0.19999996, a: 1} + m_BuildTextureStacks: [] + m_AllowLocking: 1 +--- !u!114 &1170120351188718897 +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: 9 diff --git a/Assets/04.Materials/AllInLit.mat.meta b/Assets/04.Materials/AllInLit.mat.meta new file mode 100644 index 000000000..af928a65b --- /dev/null +++ b/Assets/04.Materials/AllInLit.mat.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: ea65a4f4d4cf44146bf6fd32906d6da4 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 2100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/04.Materials/AllInUnlit.mat b/Assets/04.Materials/AllInUnlit.mat new file mode 100644 index 000000000..335391323 --- /dev/null +++ b/Assets/04.Materials/AllInUnlit.mat @@ -0,0 +1,369 @@ +%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: AllInUnlit + m_Shader: {fileID: 4800000, guid: a36b7719ff0465b42ab1407d67672c5f, type: 3} + m_Parent: {fileID: 0} + m_ModifiedSerializedProperties: 0 + m_ValidKeywords: + - OUTBASE8DIR_ON + m_InvalidKeywords: + - _OUTLINEENABLED_ON + - _OUTLINEMODE_SOLID + - _OUTLINEPOSITION_INSIDE_UNDER_SPRITE + - _OUTLINESHAPE_CONTOUR + - _TILEMODE_STRETCH + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: + - MOTIONVECTORS + m_LockedProperties: + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _BaseMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _BumpMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ColorRampTex: + m_Texture: {fileID: 2800000, guid: 279657edc397ece4b8029c727adf6ddc, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ColorRampTexGradient: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ColorSwapTex: + 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} + - _DistortTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + 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} + - _FadeBurnTex: + m_Texture: {fileID: 2800000, guid: 677cca399782dea41aedc1d292ecb67d, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _FadeTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _FrameTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _GlowTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MainTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MetallicGlossMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OcclusionMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OutlineDistortTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OutlineTex: + m_Texture: {fileID: 2800000, guid: 74087f6d03f233e4a8a142fa01f9e5cf, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OverlayTex: + m_Texture: {fileID: 2800000, guid: 677cca399782dea41aedc1d292ecb67d, type: 3} + 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} + - _ShineMask: + 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} + - 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: + - _AddPrecomputedVelocity: 0 + - _Alpha: 1 + - _AlphaClip: 0 + - _AlphaCutoffValue: 0.25 + - _AlphaOutlineBlend: 1 + - _AlphaOutlineGlow: 100 + - _AlphaOutlineMinAlpha: 0.5 + - _AlphaOutlinePower: 1 + - _AlphaRoundThreshold: 0.5 + - _AlphaThreshold: 0 + - _AlphaToMask: 0 + - _Angle: 45 + - _BillboardY: 0 + - _Blend: 0 + - _BlendModePreserveSpecular: 1 + - _BlurHD: 0 + - _BlurIntensity: 10 + - _Brightness: 0 + - _BumpScale: 1 + - _ChromAberrAlpha: 0.4 + - _ChromAberrAmount: 1 + - _ClearCoatMask: 0 + - _ClearCoatSmoothness: 0 + - _ClipUvDown: 0 + - _ClipUvLeft: 0 + - _ClipUvRight: 0 + - _ClipUvUp: 0 + - _ColorChangeLuminosity: 0 + - _ColorChangeTolerance: 0.25 + - _ColorChangeTolerance2: 0.25 + - _ColorChangeTolerance3: 0.25 + - _ColorRampBlend: 1 + - _ColorRampLuminosity: 0 + - _ColorRampOutline: 0 + - _ColorSwapBlend: 1 + - _ColorSwapBlueLuminosity: 0.5 + - _ColorSwapGreenLuminosity: 0.5 + - _ColorSwapRedLuminosity: 0.5 + - _ConnectedAlpha: 0 + - _Contrast: 1 + - _Cull: 2 + - _CullingOption: 0 + - _Cutoff: 0.5 + - _DetailAlbedoMapScale: 1 + - _DetailNormalMapScale: 1 + - _DistortAmount: 0.5 + - _DistortTexXSpeed: 5 + - _DistortTexYSpeed: 5 + - _DstBlend: 0 + - _DstBlendAlpha: 0 + - _EditorDrawers: 6 + - _EnvironmentReflections: 1 + - _FadeAmount: -0.1 + - _FadeBurnGlow: 2 + - _FadeBurnTransition: 0.075 + - _FadeBurnWidth: 0.025 + - _FishEyeUvAmount: 0.35 + - _FlickerAlpha: 0 + - _FlickerFreq: 0.2 + - _FlickerPercent: 0.05 + - _GhostBlend: 1 + - _GhostColorBoost: 1 + - _GhostTransparency: 0 + - _GlitchAmount: 3 + - _GlitchSize: 1 + - _GlossMapScale: 0 + - _Glossiness: 0 + - _GlossyReflections: 0 + - _Glow: 10 + - _GlowGlobal: 1 + - _GradBlend: 1 + - _GradBoostX: 1.2 + - _GradBoostY: 1.2 + - _GradIsRadial: 0 + - _GrassManualAnim: 1 + - _GrassManualToggle: 0 + - _GrassRadialBend: 0.1 + - _GrassSpeed: 2 + - _GrassWind: 20 + - _GreyscaleBlend: 1 + - _GreyscaleLuminosity: 0 + - _GreyscaleOutline: 0 + - _HandDrawnAmount: 10 + - _HandDrawnSpeed: 5 + - _HitEffectBlend: 1 + - _HitEffectGlow: 5 + - _HologramBlend: 1 + - _HologramMaxAlpha: 0.75 + - _HologramMinAlpha: 0.1 + - _HologramStripesAmount: 0.1 + - _HologramStripesSpeed: 4.5 + - _HologramUnmodAmount: 0 + - _HsvBright: 1 + - _HsvSaturation: 1 + - _HsvShift: 180 + - _InnerOutlineAlpha: 1 + - _InnerOutlineGlow: 4 + - _InnerOutlineThickness: 1 + - _MaxXUV: 1 + - _MaxYUV: 1 + - _Metallic: 0 + - _MinXUV: 0 + - _MinYUV: 0 + - _MotionBlurAngle: 0.1 + - _MotionBlurDist: 1.25 + - _MyDstMode: 10 + - _MySrcMode: 5 + - _NegativeAmount: 1 + - _OcclusionStrength: 1 + - _OffsetUvX: 0 + - _OffsetUvY: 0 + - _OnlyInnerOutline: 0 + - _OnlyOutline: 0 + - _OutlineAlpha: 1 + - _OutlineDistortAmount: 0.5 + - _OutlineDistortTexXSpeed: 5 + - _OutlineDistortTexYSpeed: 5 + - _OutlineEnabled: 1 + - _OutlineGlow: 1 + - _OutlineMode: 0 + - _OutlinePixelWidth: 1 + - _OutlinePosition: 0 + - _OutlineShape: 0 + - _OutlineTexXSpeed: 10 + - _OutlineTexYSpeed: 0 + - _OutlineWidth: 0.061 + - _OverlayBlend: 1 + - _OverlayGlow: 1 + - _OverlayTextureScrollXSpeed: 0.25 + - _OverlayTextureScrollYSpeed: 0.25 + - _Parallax: 0.005 + - _PinchUvAmount: 0.35 + - _PixelateSize: 32 + - _PosterizeGamma: 0.75 + - _PosterizeNumColors: 8 + - _PosterizeOutline: 0 + - _QueueOffset: 0 + - _RadialClip: 45 + - _RadialClip2: 0 + - _RadialStartAngle: 90 + - _RandomSeed: 0 + - _ReceiveShadows: 1 + - _RectSize: 1 + - _RotateUvAmount: 0 + - _RoundWaveSpeed: 2 + - _RoundWaveStrength: 0.7 + - _ShadowAlpha: 0.5 + - _ShadowX: 0.1 + - _ShadowY: -0.05 + - _ShakeUvSpeed: 2.5 + - _ShakeUvX: 1.5 + - _ShakeUvY: 1 + - _ShineGlow: 1 + - _ShineLocation: 0.5 + - _ShineRotate: 0 + - _ShineWidth: 0.1 + - _Smoothness: 0.5 + - _SmoothnessTextureChannel: 0 + - _SpecularHighlights: 1 + - _SrcBlend: 1 + - _SrcBlendAlpha: 1 + - _Surface: 0 + - _TextureScrollXSpeed: 1 + - _TextureScrollYSpeed: 0 + - _Thickness: 10 + - _TileMode: 0 + - _TwistUvAmount: 1 + - _TwistUvPosX: 0.5 + - _TwistUvPosY: 0.5 + - _TwistUvRadius: 0.75 + - _WarpScale: 0.5 + - _WarpSpeed: 8 + - _WarpStrength: 0.025 + - _WaveAmount: 7 + - _WaveSpeed: 10 + - _WaveStrength: 7.5 + - _WaveX: 0 + - _WaveY: 0.5 + - _Weight: 0.5 + - _WorkflowMode: 1 + - _ZTestMode: 4 + - _ZWrite: 1 + - _ZoomUvAmount: 0.5 + m_Colors: + - _AlphaOutlineColor: {r: 1, g: 1, b: 1, a: 1} + - _BaseColor: {r: 1, g: 1, b: 1, a: 1} + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _ColorChangeNewCol: {r: 1, g: 1, b: 0, a: 1} + - _ColorChangeNewCol2: {r: 1, g: 1, b: 0, a: 1} + - _ColorChangeNewCol3: {r: 1, g: 1, b: 0, a: 1} + - _ColorChangeTarget: {r: 1, g: 0, b: 0, a: 1} + - _ColorChangeTarget2: {r: 1, g: 0, b: 0, a: 1} + - _ColorChangeTarget3: {r: 1, g: 0, b: 0, a: 1} + - _ColorSwapBlue: {r: 1, g: 1, b: 1, a: 1} + - _ColorSwapGreen: {r: 1, g: 1, b: 1, a: 1} + - _ColorSwapRed: {r: 1, g: 1, b: 1, a: 1} + - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} + - _FadeBurnColor: {r: 1, g: 1, b: 0, a: 1} + - _GlowColor: {r: 1, g: 1, b: 1, a: 1} + - _GradBotLeftCol: {r: 0, g: 0, b: 1, a: 1} + - _GradBotRightCol: {r: 0, g: 1, b: 0, a: 1} + - _GradTopLeftCol: {r: 1, g: 0, b: 0, a: 1} + - _GradTopRightCol: {r: 1, g: 1, b: 0, a: 1} + - _GradientOutline1: {r: 1, g: 1, b: 1, a: 1} + - _GradientOutline2: {r: 1, g: 1, b: 1, a: 1} + - _GreyscaleTintColor: {r: 1, g: 1, b: 1, a: 1} + - _HitEffectColor: {r: 1, g: 1, b: 1, a: 1} + - _HologramStripeColor: {r: 0, g: 1, b: 1, a: 1} + - _ImageOutline: {r: 1, g: 1, b: 1, a: 1} + - _InnerOutlineColor: {r: 1, g: 0, b: 0, a: 1} + - _OutlineColor: {r: 1, g: 1, b: 1, a: 1} + - _OverlayColor: {r: 1, g: 1, b: 1, a: 1} + - _ShadowColor: {r: 0, g: 0, b: 0, a: 1} + - _ShineColor: {r: 1, g: 1, b: 1, a: 1} + - _SolidOutline: {r: 1, g: 1, b: 1, a: 1} + - _SpecColor: {r: 0.19999996, g: 0.19999996, b: 0.19999996, a: 1} + m_BuildTextureStacks: [] + m_AllowLocking: 1 +--- !u!114 &1170120351188718897 +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: 9 diff --git a/Assets/04.Materials/AllInUnlit.mat.meta b/Assets/04.Materials/AllInUnlit.mat.meta new file mode 100644 index 000000000..eea3264e0 --- /dev/null +++ b/Assets/04.Materials/AllInUnlit.mat.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: baa361dc875394f4f88b97e95e603fc1 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 2100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/05.Prefabs/DDD/Props/Furnitures/Frying.prefab b/Assets/05.Prefabs/DDD/Props/Furnitures/Fryer.prefab similarity index 89% rename from Assets/05.Prefabs/DDD/Props/Furnitures/Frying.prefab rename to Assets/05.Prefabs/DDD/Props/Furnitures/Fryer.prefab index 7a15924fd..b23cde0b3 100644 --- a/Assets/05.Prefabs/DDD/Props/Furnitures/Frying.prefab +++ b/Assets/05.Prefabs/DDD/Props/Furnitures/Fryer.prefab @@ -1,92 +1,5 @@ %YAML 1.1 %TAG !u! tag:unity3d.com,2011: ---- !u!1 &904834590552260540 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 878784801995173279} - - component: {fileID: 7812599628565694550} - m_Layer: 8 - m_Name: Cookware - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!4 &878784801995173279 -Transform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 904834590552260540} - serializedVersion: 2 - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 0, y: 0.42, z: -0.001} - m_LocalScale: {x: 1, y: 1, z: 1} - m_ConstrainProportionsScale: 0 - m_Children: [] - m_Father: {fileID: 203741387490724426} - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!212 &7812599628565694550 -SpriteRenderer: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 904834590552260540} - m_Enabled: 1 - m_CastShadows: 0 - m_ReceiveShadows: 0 - m_DynamicOccludee: 1 - m_StaticShadowCaster: 0 - m_MotionVectors: 1 - m_LightProbeUsage: 1 - m_ReflectionProbeUsage: 1 - m_RayTracingMode: 0 - m_RayTraceProcedural: 0 - m_RayTracingAccelStructBuildFlagsOverride: 0 - m_RayTracingAccelStructBuildFlags: 1 - m_SmallMeshCulling: 1 - m_RenderingLayerMask: 1 - m_RendererPriority: 0 - m_Materials: - - {fileID: 2100000, guid: 470021da37a3b244ab004fb80b151574, type: 2} - m_StaticBatchInfo: - firstSubMesh: 0 - subMeshCount: 0 - m_StaticBatchRoot: {fileID: 0} - m_ProbeAnchor: {fileID: 0} - m_LightProbeVolumeOverride: {fileID: 0} - m_ScaleInLightmap: 1 - m_ReceiveGI: 1 - m_PreserveUVs: 0 - m_IgnoreNormalsForChartDetection: 0 - m_ImportantGI: 0 - m_StitchLightmapSeams: 1 - m_SelectedEditorRenderState: 0 - m_MinimumChartSize: 4 - m_AutoUVMaxDistance: 0.5 - m_AutoUVMaxAngle: 89 - m_LightmapParameters: {fileID: 0} - m_SortingLayerID: 0 - m_SortingLayer: 0 - m_SortingOrder: 0 - m_Sprite: {fileID: 21300000, guid: 1f55d027553a0b34b9e4047dc6379290, type: 3} - m_Color: {r: 1, g: 1, b: 1, a: 1} - m_FlipX: 0 - m_FlipY: 0 - m_DrawMode: 0 - m_Size: {x: 1, y: 1} - m_AdaptiveModeThreshold: 0.5 - m_SpriteTileMode: 0 - m_WasSpriteAssigned: 1 - m_MaskInteraction: 0 - m_SpriteSortPoint: 0 --- !u!1 &7262344677490078713 GameObject: m_ObjectHideFlags: 0 @@ -421,7 +334,7 @@ PrefabInstance: - target: {fileID: 3580758810857167321, guid: 3f9f846a7f237924e97c9acf370d991d, type: 3} propertyPath: m_Sprite value: - objectReference: {fileID: 21300000, guid: 4866aa98c43955d4db085ce70d6a7a2a, type: 3} + objectReference: {fileID: -1081119610, guid: ad7ebdf45034c174a8dca56f94af3cbf, type: 3} - target: {fileID: 3580758810857167321, guid: 3f9f846a7f237924e97c9acf370d991d, type: 3} propertyPath: m_SortingOrder value: 1 @@ -436,7 +349,7 @@ PrefabInstance: objectReference: {fileID: 2100000, guid: 470021da37a3b244ab004fb80b151574, type: 2} - target: {fileID: 3764902268943045601, guid: 3f9f846a7f237924e97c9acf370d991d, type: 3} propertyPath: m_Name - value: Frying + value: Fryer objectReference: {fileID: 0} - target: {fileID: 3779548209033231211, guid: 3f9f846a7f237924e97c9acf370d991d, type: 3} propertyPath: m_Enabled @@ -537,7 +450,7 @@ PrefabInstance: - target: {fileID: 9047629830516719732, guid: 3f9f846a7f237924e97c9acf370d991d, type: 3} propertyPath: m_Sprite value: - objectReference: {fileID: 21300000, guid: 4866aa98c43955d4db085ce70d6a7a2a, type: 3} + objectReference: {fileID: -1081119610, guid: ad7ebdf45034c174a8dca56f94af3cbf, type: 3} - target: {fileID: 9047629830516719732, guid: 3f9f846a7f237924e97c9acf370d991d, type: 3} propertyPath: m_WasSpriteAssigned value: 1 @@ -545,9 +458,6 @@ PrefabInstance: m_RemovedComponents: [] m_RemovedGameObjects: [] m_AddedGameObjects: - - targetCorrespondingSourceObject: {fileID: 7438534416270888028, guid: 3f9f846a7f237924e97c9acf370d991d, type: 3} - insertIndex: -1 - addedObject: {fileID: 878784801995173279} - targetCorrespondingSourceObject: {fileID: 7438534416270888028, guid: 3f9f846a7f237924e97c9acf370d991d, type: 3} insertIndex: -1 addedObject: {fileID: 5698148491695555804} @@ -561,12 +471,45 @@ PrefabInstance: - targetCorrespondingSourceObject: {fileID: 3764902268943045601, guid: 3f9f846a7f237924e97c9acf370d991d, type: 3} insertIndex: -1 addedObject: {fileID: 3041087974964075065} + - targetCorrespondingSourceObject: {fileID: 3764902268943045601, guid: 3f9f846a7f237924e97c9acf370d991d, type: 3} + insertIndex: -1 + addedObject: {fileID: 6186400953195947533} + - targetCorrespondingSourceObject: {fileID: 7835622629792856689, guid: 3f9f846a7f237924e97c9acf370d991d, type: 3} + insertIndex: -1 + addedObject: {fileID: 2345124465306229552} m_SourcePrefab: {fileID: 100100000, guid: 3f9f846a7f237924e97c9acf370d991d, type: 3} --- !u!4 &203741387490724426 stripped Transform: m_CorrespondingSourceObject: {fileID: 7438534416270888028, guid: 3f9f846a7f237924e97c9acf370d991d, type: 3} m_PrefabInstance: {fileID: 7343451337687172630} m_PrefabAsset: {fileID: 0} +--- !u!1 &672328621937310823 stripped +GameObject: + m_CorrespondingSourceObject: {fileID: 7835622629792856689, guid: 3f9f846a7f237924e97c9acf370d991d, type: 3} + m_PrefabInstance: {fileID: 7343451337687172630} + m_PrefabAsset: {fileID: 0} +--- !u!95 &2345124465306229552 +Animator: + serializedVersion: 7 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 672328621937310823} + m_Enabled: 1 + m_Avatar: {fileID: 0} + m_Controller: {fileID: 9100000, guid: 1b72183d4dde5de46b48332478d47cc3, type: 2} + m_CullingMode: 0 + m_UpdateMode: 0 + m_ApplyRootMotion: 0 + m_LinearVelocityBlending: 0 + m_StabilizeFeet: 0 + m_AnimatePhysics: 0 + m_WarningMessage: + m_HasTransformHierarchy: 1 + m_AllowConstantClipSamplingOptimization: 1 + m_KeepAnimatorStateOnDisable: 0 + m_WriteDefaultValuesOnDisable: 0 --- !u!1 &5897095096647521783 stripped GameObject: m_CorrespondingSourceObject: {fileID: 3764902268943045601, guid: 3f9f846a7f237924e97c9acf370d991d, type: 3} @@ -588,14 +531,28 @@ MonoBehaviour: k__BackingField: {fileID: 6077686033771388879} k__BackingField: {fileID: 6533109861150454071} k__BackingField: {fileID: 2100000, guid: 9db92b3ac1f276e42ae7d7bcfbbca549, type: 2} - k__BackingField: {fileID: 0} k__BackingField: 1 k__BackingField: 0.8 - k__BackingField: "\uD504\uB77C\uC774 \uC791\uB3D9" + k__BackingField: "\uD280\uAE40\uAE30 \uC791\uB3D9" EnableHoldingInteraction: 1 PlayerHoldingTime: 1 IsOpened: 0 - _animationController: {fileID: 0} + _animationController: {fileID: 6186400953195947533} + _enableColor: {r: 1, g: 1, b: 1, a: 1} + _disableColor: {r: 0.5, g: 0.5, b: 0.5, a: 1} +--- !u!114 &6186400953195947533 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5897095096647521783} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 17488a2bea6f4126a7877ce5d934f865, type: 3} + m_Name: + m_EditorClassIdentifier: + _animator: {fileID: 2345124465306229552} --- !u!4 &5927803667513949971 stripped Transform: m_CorrespondingSourceObject: {fileID: 4011269187381704965, guid: 3f9f846a7f237924e97c9acf370d991d, type: 3} diff --git a/Assets/05.Prefabs/DDD/Props/Furnitures/Frying.prefab.meta b/Assets/05.Prefabs/DDD/Props/Furnitures/Fryer.prefab.meta similarity index 100% rename from Assets/05.Prefabs/DDD/Props/Furnitures/Frying.prefab.meta rename to Assets/05.Prefabs/DDD/Props/Furnitures/Fryer.prefab.meta diff --git a/Assets/07.Animations/DDD/Props/Fryer.meta b/Assets/07.Animations/DDD/Props/Fryer.meta new file mode 100644 index 000000000..20e0a034f --- /dev/null +++ b/Assets/07.Animations/DDD/Props/Fryer.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 3cd49e155378efc40a0517011e994dd4 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/07.Animations/DDD/Props/Fryer/Enable.anim b/Assets/07.Animations/DDD/Props/Fryer/Enable.anim new file mode 100644 index 000000000..3031f753d --- /dev/null +++ b/Assets/07.Animations/DDD/Props/Fryer/Enable.anim @@ -0,0 +1,84 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!74 &7400000 +AnimationClip: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: Enable + serializedVersion: 7 + m_Legacy: 0 + m_Compressed: 0 + m_UseHighQualityCurve: 1 + m_RotationCurves: [] + m_CompressedRotationCurves: [] + m_EulerCurves: [] + m_PositionCurves: [] + m_ScaleCurves: [] + m_FloatCurves: [] + m_PPtrCurves: + - serializedVersion: 2 + curve: + - time: 0 + value: {fileID: -1081119610, guid: ad7ebdf45034c174a8dca56f94af3cbf, type: 3} + - time: 0.016666668 + value: {fileID: 811674218, guid: ad7ebdf45034c174a8dca56f94af3cbf, type: 3} + - time: 0.033333335 + value: {fileID: -2057609827, guid: ad7ebdf45034c174a8dca56f94af3cbf, type: 3} + - time: 0.05 + value: {fileID: -659907489, guid: ad7ebdf45034c174a8dca56f94af3cbf, type: 3} + - time: 0.06666667 + value: {fileID: -659907489, guid: ad7ebdf45034c174a8dca56f94af3cbf, type: 3} + attribute: m_Sprite + path: + classID: 212 + script: {fileID: 0} + flags: 2 + m_SampleRate: 60 + m_WrapMode: 0 + m_Bounds: + m_Center: {x: 0, y: 0, z: 0} + m_Extent: {x: 0, y: 0, z: 0} + m_ClipBindingConstant: + genericBindings: + - serializedVersion: 2 + path: 0 + attribute: 0 + script: {fileID: 0} + typeID: 212 + customType: 23 + isPPtrCurve: 1 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + pptrCurveMapping: + - {fileID: -1081119610, guid: ad7ebdf45034c174a8dca56f94af3cbf, type: 3} + - {fileID: 811674218, guid: ad7ebdf45034c174a8dca56f94af3cbf, type: 3} + - {fileID: -2057609827, guid: ad7ebdf45034c174a8dca56f94af3cbf, type: 3} + - {fileID: -659907489, guid: ad7ebdf45034c174a8dca56f94af3cbf, type: 3} + - {fileID: -659907489, guid: ad7ebdf45034c174a8dca56f94af3cbf, type: 3} + m_AnimationClipSettings: + serializedVersion: 2 + m_AdditiveReferencePoseClip: {fileID: 0} + m_AdditiveReferencePoseTime: 0 + m_StartTime: 0 + m_StopTime: 0.083333336 + m_OrientationOffsetY: 0 + m_Level: 0 + m_CycleOffset: 0 + m_HasAdditiveReferencePose: 0 + m_LoopTime: 0 + m_LoopBlend: 0 + m_LoopBlendOrientation: 0 + m_LoopBlendPositionY: 0 + m_LoopBlendPositionXZ: 0 + m_KeepOriginalOrientation: 0 + m_KeepOriginalPositionY: 1 + m_KeepOriginalPositionXZ: 0 + m_HeightFromFeet: 0 + m_Mirror: 0 + m_EditorCurves: [] + m_EulerEditorCurves: [] + m_HasGenericRootTransform: 0 + m_HasMotionFloatCurves: 0 + m_Events: [] diff --git a/Assets/07.Animations/DDD/Props/Fryer/Enable.anim.meta b/Assets/07.Animations/DDD/Props/Fryer/Enable.anim.meta new file mode 100644 index 000000000..8d3ad9b71 --- /dev/null +++ b/Assets/07.Animations/DDD/Props/Fryer/Enable.anim.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 49eedc65d676b294d826e01e5db322b3 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 7400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/07.Animations/DDD/Props/Fryer/EnableLoop.anim b/Assets/07.Animations/DDD/Props/Fryer/EnableLoop.anim new file mode 100644 index 000000000..7e88440e8 --- /dev/null +++ b/Assets/07.Animations/DDD/Props/Fryer/EnableLoop.anim @@ -0,0 +1,96 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!74 &7400000 +AnimationClip: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: EnableLoop + serializedVersion: 7 + m_Legacy: 0 + m_Compressed: 0 + m_UseHighQualityCurve: 1 + m_RotationCurves: [] + m_CompressedRotationCurves: [] + m_EulerCurves: [] + m_PositionCurves: [] + m_ScaleCurves: [] + m_FloatCurves: [] + m_PPtrCurves: + - serializedVersion: 2 + curve: + - time: 0 + value: {fileID: 905636842, guid: ad7ebdf45034c174a8dca56f94af3cbf, type: 3} + - time: 0.016666668 + value: {fileID: -751557288, guid: ad7ebdf45034c174a8dca56f94af3cbf, type: 3} + - time: 0.033333335 + value: {fileID: 33043708, guid: ad7ebdf45034c174a8dca56f94af3cbf, type: 3} + - time: 0.05 + value: {fileID: -661027381, guid: ad7ebdf45034c174a8dca56f94af3cbf, type: 3} + - time: 0.06666667 + value: {fileID: 87770818, guid: ad7ebdf45034c174a8dca56f94af3cbf, type: 3} + - time: 0.083333336 + value: {fileID: 467582811, guid: ad7ebdf45034c174a8dca56f94af3cbf, type: 3} + - time: 0.1 + value: {fileID: -2022067527, guid: ad7ebdf45034c174a8dca56f94af3cbf, type: 3} + - time: 0.11666667 + value: {fileID: -1750461218, guid: ad7ebdf45034c174a8dca56f94af3cbf, type: 3} + - time: 0.13333334 + value: {fileID: -1750461218, guid: ad7ebdf45034c174a8dca56f94af3cbf, type: 3} + attribute: m_Sprite + path: + classID: 212 + script: {fileID: 0} + flags: 2 + m_SampleRate: 60 + m_WrapMode: 0 + m_Bounds: + m_Center: {x: 0, y: 0, z: 0} + m_Extent: {x: 0, y: 0, z: 0} + m_ClipBindingConstant: + genericBindings: + - serializedVersion: 2 + path: 0 + attribute: 0 + script: {fileID: 0} + typeID: 212 + customType: 23 + isPPtrCurve: 1 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + pptrCurveMapping: + - {fileID: 905636842, guid: ad7ebdf45034c174a8dca56f94af3cbf, type: 3} + - {fileID: -751557288, guid: ad7ebdf45034c174a8dca56f94af3cbf, type: 3} + - {fileID: 33043708, guid: ad7ebdf45034c174a8dca56f94af3cbf, type: 3} + - {fileID: -661027381, guid: ad7ebdf45034c174a8dca56f94af3cbf, type: 3} + - {fileID: 87770818, guid: ad7ebdf45034c174a8dca56f94af3cbf, type: 3} + - {fileID: 467582811, guid: ad7ebdf45034c174a8dca56f94af3cbf, type: 3} + - {fileID: -2022067527, guid: ad7ebdf45034c174a8dca56f94af3cbf, type: 3} + - {fileID: -1750461218, guid: ad7ebdf45034c174a8dca56f94af3cbf, type: 3} + - {fileID: -1750461218, guid: ad7ebdf45034c174a8dca56f94af3cbf, type: 3} + m_AnimationClipSettings: + serializedVersion: 2 + m_AdditiveReferencePoseClip: {fileID: 0} + m_AdditiveReferencePoseTime: 0 + m_StartTime: 0 + m_StopTime: 0.15 + m_OrientationOffsetY: 0 + m_Level: 0 + m_CycleOffset: 0 + m_HasAdditiveReferencePose: 0 + m_LoopTime: 1 + m_LoopBlend: 0 + m_LoopBlendOrientation: 0 + m_LoopBlendPositionY: 0 + m_LoopBlendPositionXZ: 0 + m_KeepOriginalOrientation: 0 + m_KeepOriginalPositionY: 1 + m_KeepOriginalPositionXZ: 0 + m_HeightFromFeet: 0 + m_Mirror: 0 + m_EditorCurves: [] + m_EulerEditorCurves: [] + m_HasGenericRootTransform: 0 + m_HasMotionFloatCurves: 0 + m_Events: [] diff --git a/Assets/07.Animations/DDD/Props/Fryer/EnableLoop.anim.meta b/Assets/07.Animations/DDD/Props/Fryer/EnableLoop.anim.meta new file mode 100644 index 000000000..46854f2e3 --- /dev/null +++ b/Assets/07.Animations/DDD/Props/Fryer/EnableLoop.anim.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 4223476e7aaef4a48ae2c21a5fa2ba63 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 7400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/07.Animations/DDD/Props/Fryer/Fryer.controller b/Assets/07.Animations/DDD/Props/Fryer/Fryer.controller new file mode 100644 index 000000000..735214991 --- /dev/null +++ b/Assets/07.Animations/DDD/Props/Fryer/Fryer.controller @@ -0,0 +1,237 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1101 &-4567197947987476589 +AnimatorStateTransition: + m_ObjectHideFlags: 1 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: + m_Conditions: + - m_ConditionMode: 2 + m_ConditionEvent: isEnabled + m_EventTreshold: 0 + m_DstStateMachine: {fileID: 0} + m_DstState: {fileID: -394681787255094018} + m_Solo: 0 + m_Mute: 0 + m_IsExit: 0 + serializedVersion: 3 + m_TransitionDuration: 0 + m_TransitionOffset: 0 + m_ExitTime: 0.75 + m_HasExitTime: 0 + m_HasFixedDuration: 0 + m_InterruptionSource: 0 + m_OrderedInterruption: 1 + m_CanTransitionToSelf: 1 +--- !u!1101 &-3808396921568587056 +AnimatorStateTransition: + m_ObjectHideFlags: 1 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: + m_Conditions: + - m_ConditionMode: 2 + m_ConditionEvent: isEnabled + m_EventTreshold: 0 + m_DstStateMachine: {fileID: 0} + m_DstState: {fileID: -394681787255094018} + m_Solo: 0 + m_Mute: 0 + m_IsExit: 0 + serializedVersion: 3 + m_TransitionDuration: 0 + m_TransitionOffset: 0 + m_ExitTime: 0.75 + m_HasExitTime: 0 + m_HasFixedDuration: 0 + m_InterruptionSource: 0 + m_OrderedInterruption: 1 + m_CanTransitionToSelf: 1 +--- !u!1107 &-3453450983545692084 +AnimatorStateMachine: + serializedVersion: 6 + m_ObjectHideFlags: 1 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: Base Layer + m_ChildStates: + - serializedVersion: 1 + m_State: {fileID: -394681787255094018} + m_Position: {x: 290, y: 110, z: 0} + - serializedVersion: 1 + m_State: {fileID: 4562428363273719187} + m_Position: {x: 290, y: 220, z: 0} + - serializedVersion: 1 + m_State: {fileID: -151681170214641229} + m_Position: {x: 530, y: 220, z: 0} + m_ChildStateMachines: [] + m_AnyStateTransitions: [] + m_EntryTransitions: [] + m_StateMachineTransitions: {} + m_StateMachineBehaviours: [] + m_AnyStatePosition: {x: 50, y: 20, z: 0} + m_EntryPosition: {x: 50, y: 120, z: 0} + m_ExitPosition: {x: 800, y: 120, z: 0} + m_ParentStateMachinePosition: {x: 800, y: 20, z: 0} + m_DefaultState: {fileID: -394681787255094018} +--- !u!1101 &-2011751207543961222 +AnimatorStateTransition: + m_ObjectHideFlags: 1 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: + m_Conditions: + - m_ConditionMode: 1 + m_ConditionEvent: isEnabled + m_EventTreshold: 0 + m_DstStateMachine: {fileID: 0} + m_DstState: {fileID: 4562428363273719187} + m_Solo: 0 + m_Mute: 0 + m_IsExit: 0 + serializedVersion: 3 + m_TransitionDuration: 0 + m_TransitionOffset: 0 + m_ExitTime: 0 + m_HasExitTime: 0 + m_HasFixedDuration: 0 + m_InterruptionSource: 0 + m_OrderedInterruption: 1 + m_CanTransitionToSelf: 1 +--- !u!1102 &-394681787255094018 +AnimatorState: + serializedVersion: 6 + m_ObjectHideFlags: 1 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: Idle + m_Speed: 1 + m_CycleOffset: 0 + m_Transitions: + - {fileID: -2011751207543961222} + m_StateMachineBehaviours: [] + m_Position: {x: 50, y: 50, z: 0} + m_IKOnFeet: 0 + m_WriteDefaultValues: 1 + m_Mirror: 0 + m_SpeedParameterActive: 0 + m_MirrorParameterActive: 0 + m_CycleOffsetParameterActive: 0 + m_TimeParameterActive: 0 + m_Motion: {fileID: 7400000, guid: afcf8da1036d1c848914eac141bdfb6a, type: 2} + m_Tag: + m_SpeedParameter: + m_MirrorParameter: + m_CycleOffsetParameter: + m_TimeParameter: +--- !u!1102 &-151681170214641229 +AnimatorState: + serializedVersion: 6 + m_ObjectHideFlags: 1 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: EnableLoop + m_Speed: 1 + m_CycleOffset: 0 + m_Transitions: + - {fileID: -4567197947987476589} + m_StateMachineBehaviours: [] + m_Position: {x: 50, y: 50, z: 0} + m_IKOnFeet: 0 + m_WriteDefaultValues: 1 + m_Mirror: 0 + m_SpeedParameterActive: 0 + m_MirrorParameterActive: 0 + m_CycleOffsetParameterActive: 0 + m_TimeParameterActive: 0 + m_Motion: {fileID: 7400000, guid: 4223476e7aaef4a48ae2c21a5fa2ba63, type: 2} + m_Tag: + m_SpeedParameter: + m_MirrorParameter: + m_CycleOffsetParameter: + m_TimeParameter: +--- !u!91 &9100000 +AnimatorController: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: Fryer + serializedVersion: 5 + m_AnimatorParameters: + - m_Name: isEnabled + m_Type: 4 + m_DefaultFloat: 0 + m_DefaultInt: 0 + m_DefaultBool: 0 + m_Controller: {fileID: 9100000} + m_AnimatorLayers: + - serializedVersion: 5 + m_Name: Base Layer + m_StateMachine: {fileID: -3453450983545692084} + m_Mask: {fileID: 0} + m_Motions: [] + m_Behaviours: [] + m_BlendingMode: 0 + m_SyncedLayerIndex: -1 + m_DefaultWeight: 0 + m_IKPass: 0 + m_SyncedLayerAffectsTiming: 0 + m_Controller: {fileID: 9100000} +--- !u!1101 &4370837794190476119 +AnimatorStateTransition: + m_ObjectHideFlags: 1 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: + m_Conditions: [] + m_DstStateMachine: {fileID: 0} + m_DstState: {fileID: -151681170214641229} + m_Solo: 0 + m_Mute: 0 + m_IsExit: 0 + serializedVersion: 3 + m_TransitionDuration: 0 + m_TransitionOffset: 0 + m_ExitTime: 0 + m_HasExitTime: 1 + m_HasFixedDuration: 1 + m_InterruptionSource: 0 + m_OrderedInterruption: 1 + m_CanTransitionToSelf: 1 +--- !u!1102 &4562428363273719187 +AnimatorState: + serializedVersion: 6 + m_ObjectHideFlags: 1 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: Enable + m_Speed: 1 + m_CycleOffset: 0 + m_Transitions: + - {fileID: 4370837794190476119} + - {fileID: -3808396921568587056} + m_StateMachineBehaviours: [] + m_Position: {x: 50, y: 50, z: 0} + m_IKOnFeet: 0 + m_WriteDefaultValues: 1 + m_Mirror: 0 + m_SpeedParameterActive: 0 + m_MirrorParameterActive: 0 + m_CycleOffsetParameterActive: 0 + m_TimeParameterActive: 0 + m_Motion: {fileID: 7400000, guid: 49eedc65d676b294d826e01e5db322b3, type: 2} + m_Tag: + m_SpeedParameter: + m_MirrorParameter: + m_CycleOffsetParameter: + m_TimeParameter: diff --git a/Assets/07.Animations/DDD/Props/Fryer/Fryer.controller.meta b/Assets/07.Animations/DDD/Props/Fryer/Fryer.controller.meta new file mode 100644 index 000000000..d4f030c6c --- /dev/null +++ b/Assets/07.Animations/DDD/Props/Fryer/Fryer.controller.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 1b72183d4dde5de46b48332478d47cc3 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 9100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/07.Animations/DDD/Props/Fryer/Idle.anim b/Assets/07.Animations/DDD/Props/Fryer/Idle.anim new file mode 100644 index 000000000..2326f2ed9 --- /dev/null +++ b/Assets/07.Animations/DDD/Props/Fryer/Idle.anim @@ -0,0 +1,72 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!74 &7400000 +AnimationClip: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: Idle + serializedVersion: 7 + m_Legacy: 0 + m_Compressed: 0 + m_UseHighQualityCurve: 1 + m_RotationCurves: [] + m_CompressedRotationCurves: [] + m_EulerCurves: [] + m_PositionCurves: [] + m_ScaleCurves: [] + m_FloatCurves: [] + m_PPtrCurves: + - serializedVersion: 2 + curve: + - time: 0 + value: {fileID: -1081119610, guid: ad7ebdf45034c174a8dca56f94af3cbf, type: 3} + attribute: m_Sprite + path: + classID: 212 + script: {fileID: 0} + flags: 2 + m_SampleRate: 60 + m_WrapMode: 0 + m_Bounds: + m_Center: {x: 0, y: 0, z: 0} + m_Extent: {x: 0, y: 0, z: 0} + m_ClipBindingConstant: + genericBindings: + - serializedVersion: 2 + path: 0 + attribute: 0 + script: {fileID: 0} + typeID: 212 + customType: 23 + isPPtrCurve: 1 + isIntCurve: 0 + isSerializeReferenceCurve: 0 + pptrCurveMapping: + - {fileID: -1081119610, guid: ad7ebdf45034c174a8dca56f94af3cbf, type: 3} + m_AnimationClipSettings: + serializedVersion: 2 + m_AdditiveReferencePoseClip: {fileID: 0} + m_AdditiveReferencePoseTime: 0 + m_StartTime: 0 + m_StopTime: 0.016666668 + m_OrientationOffsetY: 0 + m_Level: 0 + m_CycleOffset: 0 + m_HasAdditiveReferencePose: 0 + m_LoopTime: 0 + m_LoopBlend: 0 + m_LoopBlendOrientation: 0 + m_LoopBlendPositionY: 0 + m_LoopBlendPositionXZ: 0 + m_KeepOriginalOrientation: 0 + m_KeepOriginalPositionY: 1 + m_KeepOriginalPositionXZ: 0 + m_HeightFromFeet: 0 + m_Mirror: 0 + m_EditorCurves: [] + m_EulerEditorCurves: [] + m_HasGenericRootTransform: 0 + m_HasMotionFloatCurves: 0 + m_Events: [] diff --git a/Assets/07.Animations/DDD/Props/Fryer/Idle.anim.meta b/Assets/07.Animations/DDD/Props/Fryer/Idle.anim.meta new file mode 100644 index 000000000..cc34cc404 --- /dev/null +++ b/Assets/07.Animations/DDD/Props/Fryer/Idle.anim.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: afcf8da1036d1c848914eac141bdfb6a +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 7400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/AllIn1SpriteShader.meta b/Assets/Plugins/AllIn1SpriteShader.meta new file mode 100644 index 000000000..0c820cca1 --- /dev/null +++ b/Assets/Plugins/AllIn1SpriteShader.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: eb9e4001ea5d9284887e390e0e23f4a4 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/AllIn1SpriteShader/!Start_Here.txt b/Assets/Plugins/AllIn1SpriteShader/!Start_Here.txt new file mode 100644 index 000000000..4e3b03fa7 --- /dev/null +++ b/Assets/Plugins/AllIn1SpriteShader/!Start_Here.txt @@ -0,0 +1,19 @@ +Hi there! Thanks for purchasing the asset, I really hope you enjoy it and that it helps you take your projects to the next level :D + +If this is your first time using the asset reading the First Steps section of the Documentation PDF or watching this quick overview video is the best place to start: +https://youtu.be/ThvqkJ5q-gk +You will learn the basic workflow in a matter of minutes. And then, to learn all the asset can do you can proceed to read the rest of the Documentation or to watch all the other video tutorials. + +The asset is mainly targeted to be used in sprites and UI. But it can be used anywhere. Many creative users also use the asset in Meshes and VFX materials. +That being said I just made a new specialized asset for VFX. It's a spiritual successor to this asset but made with VFX creation in mind. +It has an awesome shader, more than 50 ready to use example prefabs, a huge asset library, editor tools and more. +Get it here with a HUGE DISCOUNT for owning this asset: https://assetstore.unity.com/packages/vfx/all-in-1-vfx-toolkit-206665 + + +I’m always open for questions, feedback and suggestions. The best way to contact me is by email. Please don’t write questions in the Unity Forums, Youtube videos, Twitter or wherever else since I will probably miss them. +I always reply much faster (in 24h or less) by email. +When reaching out please attach your invoice number too and make sure you have read the Documentation PDF or watched the equivalent video playlist linked in the PDF. +The email address is: seasidegamestudios@gmail.com + +If you like the asset please make sure to drop a review on the Asset Store page. It helps out a ton: +https://assetstore.unity.com/packages/vfx/shaders/all-in-1-sprite-shader-156513 \ No newline at end of file diff --git a/Assets/Plugins/AllIn1SpriteShader/!Start_Here.txt.meta b/Assets/Plugins/AllIn1SpriteShader/!Start_Here.txt.meta new file mode 100644 index 000000000..5b89f2aa4 --- /dev/null +++ b/Assets/Plugins/AllIn1SpriteShader/!Start_Here.txt.meta @@ -0,0 +1,14 @@ +fileFormatVersion: 2 +guid: 40da9e3a3b0e50c4599a7abc58b8598e +TextScriptImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 156513 + packageName: All In 1 Sprite Shader + packageVersion: 4.25 + assetPath: Assets/Plugins/AllIn1SpriteShader/!Start_Here.txt + uploadId: 708810 diff --git a/Assets/Plugins/AllIn1SpriteShader/AllIn1SpriteShaderAssembly.asmdef b/Assets/Plugins/AllIn1SpriteShader/AllIn1SpriteShaderAssembly.asmdef new file mode 100644 index 000000000..b6ca44237 --- /dev/null +++ b/Assets/Plugins/AllIn1SpriteShader/AllIn1SpriteShaderAssembly.asmdef @@ -0,0 +1,15 @@ +{ + "name": "AllIn1SpriteShaderAssembly", + "references": [ + "GUID:7ab3663edede26740845931880bf22af" + ], + "includePlatforms": [], + "excludePlatforms": [], + "allowUnsafeCode": false, + "overrideReferences": false, + "precompiledReferences": [], + "autoReferenced": true, + "defineConstraints": [], + "versionDefines": [], + "noEngineReferences": false +} \ No newline at end of file diff --git a/Assets/Plugins/AllIn1SpriteShader/AllIn1SpriteShaderAssembly.asmdef.meta b/Assets/Plugins/AllIn1SpriteShader/AllIn1SpriteShaderAssembly.asmdef.meta new file mode 100644 index 000000000..4306ea734 --- /dev/null +++ b/Assets/Plugins/AllIn1SpriteShader/AllIn1SpriteShaderAssembly.asmdef.meta @@ -0,0 +1,14 @@ +fileFormatVersion: 2 +guid: 91de482a0a233614ab5962ea5f6c24ee +AssemblyDefinitionImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 156513 + packageName: All In 1 Sprite Shader + packageVersion: 4.25 + assetPath: Assets/Plugins/AllIn1SpriteShader/AllIn1SpriteShaderAssembly.asmdef + uploadId: 708810 diff --git a/Assets/Plugins/AllIn1SpriteShader/Demo.meta b/Assets/Plugins/AllIn1SpriteShader/Demo.meta new file mode 100644 index 000000000..d4fbf7095 --- /dev/null +++ b/Assets/Plugins/AllIn1SpriteShader/Demo.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 8547c35f10eb6ad4697607cdde60ad3c +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/AllIn1SpriteShader/Demo/Animation.meta b/Assets/Plugins/AllIn1SpriteShader/Demo/Animation.meta new file mode 100644 index 000000000..821043709 --- /dev/null +++ b/Assets/Plugins/AllIn1SpriteShader/Demo/Animation.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 5dda08a101e9e6f4eb3bc2eaac144b3f +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/AllIn1SpriteShader/Demo/Animation/Alpha Cutoff.controller b/Assets/Plugins/AllIn1SpriteShader/Demo/Animation/Alpha Cutoff.controller new file mode 100644 index 000000000..adf4799a2 --- /dev/null +++ b/Assets/Plugins/AllIn1SpriteShader/Demo/Animation/Alpha Cutoff.controller @@ -0,0 +1,72 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!91 &9100000 +AnimatorController: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: Alpha Cutoff + serializedVersion: 5 + m_AnimatorParameters: [] + m_AnimatorLayers: + - serializedVersion: 5 + m_Name: Base Layer + m_StateMachine: {fileID: 6467778131688425141} + m_Mask: {fileID: 0} + m_Motions: [] + m_Behaviours: [] + m_BlendingMode: 0 + m_SyncedLayerIndex: -1 + m_DefaultWeight: 0 + m_IKPass: 0 + m_SyncedLayerAffectsTiming: 0 + m_Controller: {fileID: 9100000} +--- !u!1102 &3664986056586936730 +AnimatorState: + serializedVersion: 5 + m_ObjectHideFlags: 1 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: AlphaCutoff + m_Speed: 1 + m_CycleOffset: 0 + m_Transitions: [] + m_StateMachineBehaviours: [] + m_Position: {x: 50, y: 50, z: 0} + m_IKOnFeet: 0 + m_WriteDefaultValues: 1 + m_Mirror: 0 + m_SpeedParameterActive: 0 + m_MirrorParameterActive: 0 + m_CycleOffsetParameterActive: 0 + m_TimeParameterActive: 0 + m_Motion: {fileID: 7400000, guid: 2b4fb9dc8c60f4149a1699d21550ad74, type: 2} + m_Tag: + m_SpeedParameter: + m_MirrorParameter: + m_CycleOffsetParameter: + m_TimeParameter: +--- !u!1107 &6467778131688425141 +AnimatorStateMachine: + serializedVersion: 5 + m_ObjectHideFlags: 1 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: Base Layer + m_ChildStates: + - serializedVersion: 1 + m_State: {fileID: 3664986056586936730} + m_Position: {x: 200, y: 0, z: 0} + m_ChildStateMachines: [] + m_AnyStateTransitions: [] + m_EntryTransitions: [] + m_StateMachineTransitions: {} + m_StateMachineBehaviours: [] + m_AnyStatePosition: {x: 50, y: 20, z: 0} + m_EntryPosition: {x: 50, y: 120, z: 0} + m_ExitPosition: {x: 800, y: 120, z: 0} + m_ParentStateMachinePosition: {x: 800, y: 20, z: 0} + m_DefaultState: {fileID: 3664986056586936730} diff --git a/Assets/Plugins/AllIn1SpriteShader/Demo/Animation/Alpha Cutoff.controller.meta b/Assets/Plugins/AllIn1SpriteShader/Demo/Animation/Alpha Cutoff.controller.meta new file mode 100644 index 000000000..0e3884c19 --- /dev/null +++ b/Assets/Plugins/AllIn1SpriteShader/Demo/Animation/Alpha Cutoff.controller.meta @@ -0,0 +1,15 @@ +fileFormatVersion: 2 +guid: d7d72c9f17b0ebe4e908dab552b82c45 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 9100000 + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 156513 + packageName: All In 1 Sprite Shader + packageVersion: 4.25 + assetPath: Assets/Plugins/AllIn1SpriteShader/Demo/Animation/Alpha Cutoff.controller + uploadId: 708810 diff --git a/Assets/Plugins/AllIn1SpriteShader/Demo/Animation/AlphaCutoff.anim b/Assets/Plugins/AllIn1SpriteShader/Demo/Animation/AlphaCutoff.anim new file mode 100644 index 000000000..626c019aa --- /dev/null +++ b/Assets/Plugins/AllIn1SpriteShader/Demo/Animation/AlphaCutoff.anim @@ -0,0 +1,134 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!74 &7400000 +AnimationClip: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: AlphaCutoff + serializedVersion: 6 + m_Legacy: 0 + m_Compressed: 0 + m_UseHighQualityCurve: 1 + m_RotationCurves: [] + m_CompressedRotationCurves: [] + m_EulerCurves: [] + m_PositionCurves: [] + m_ScaleCurves: [] + m_FloatCurves: + - curve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 0.33333334 + value: 0.98 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 0.6666667 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + attribute: material._AlphaCutoffValue + path: + classID: 212 + script: {fileID: 0} + m_PPtrCurves: [] + m_SampleRate: 60 + m_WrapMode: 0 + m_Bounds: + m_Center: {x: 0, y: 0, z: 0} + m_Extent: {x: 0, y: 0, z: 0} + m_ClipBindingConstant: + genericBindings: + - serializedVersion: 2 + path: 0 + attribute: 2296261589 + script: {fileID: 0} + typeID: 212 + customType: 22 + isPPtrCurve: 0 + pptrCurveMapping: [] + m_AnimationClipSettings: + serializedVersion: 2 + m_AdditiveReferencePoseClip: {fileID: 0} + m_AdditiveReferencePoseTime: 0 + m_StartTime: 0 + m_StopTime: 0.6666667 + m_OrientationOffsetY: 0 + m_Level: 0 + m_CycleOffset: 0 + m_HasAdditiveReferencePose: 0 + m_LoopTime: 1 + m_LoopBlend: 0 + m_LoopBlendOrientation: 0 + m_LoopBlendPositionY: 0 + m_LoopBlendPositionXZ: 0 + m_KeepOriginalOrientation: 0 + m_KeepOriginalPositionY: 1 + m_KeepOriginalPositionXZ: 0 + m_HeightFromFeet: 0 + m_Mirror: 0 + m_EditorCurves: + - curve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 0.33333334 + value: 0.98 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 0.6666667 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + attribute: material._AlphaCutoffValue + path: + classID: 212 + script: {fileID: 0} + m_EulerEditorCurves: [] + m_HasGenericRootTransform: 0 + m_HasMotionFloatCurves: 0 + m_Events: [] diff --git a/Assets/Plugins/AllIn1SpriteShader/Demo/Animation/AlphaCutoff.anim.meta b/Assets/Plugins/AllIn1SpriteShader/Demo/Animation/AlphaCutoff.anim.meta new file mode 100644 index 000000000..823d3c728 --- /dev/null +++ b/Assets/Plugins/AllIn1SpriteShader/Demo/Animation/AlphaCutoff.anim.meta @@ -0,0 +1,15 @@ +fileFormatVersion: 2 +guid: 2b4fb9dc8c60f4149a1699d21550ad74 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 7400000 + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 156513 + packageName: All In 1 Sprite Shader + packageVersion: 4.25 + assetPath: Assets/Plugins/AllIn1SpriteShader/Demo/Animation/AlphaCutoff.anim + uploadId: 708810 diff --git a/Assets/Plugins/AllIn1SpriteShader/Demo/Animation/AtlasSpriteBoy.controller b/Assets/Plugins/AllIn1SpriteShader/Demo/Animation/AtlasSpriteBoy.controller new file mode 100644 index 000000000..b8bf9af4e --- /dev/null +++ b/Assets/Plugins/AllIn1SpriteShader/Demo/Animation/AtlasSpriteBoy.controller @@ -0,0 +1,72 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1102 &-7096875646415134801 +AnimatorState: + serializedVersion: 5 + m_ObjectHideFlags: 1 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: ShinyBoy + m_Speed: 1 + m_CycleOffset: 0 + m_Transitions: [] + m_StateMachineBehaviours: [] + m_Position: {x: 50, y: 50, z: 0} + m_IKOnFeet: 0 + m_WriteDefaultValues: 1 + m_Mirror: 0 + m_SpeedParameterActive: 0 + m_MirrorParameterActive: 0 + m_CycleOffsetParameterActive: 0 + m_TimeParameterActive: 0 + m_Motion: {fileID: 7400000, guid: 025b58e8824357d47bc58c069785117d, type: 2} + m_Tag: + m_SpeedParameter: + m_MirrorParameter: + m_CycleOffsetParameter: + m_TimeParameter: +--- !u!91 &9100000 +AnimatorController: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: AtlasSpriteBoy + serializedVersion: 5 + m_AnimatorParameters: [] + m_AnimatorLayers: + - serializedVersion: 5 + m_Name: Base Layer + m_StateMachine: {fileID: 4058490066961251321} + m_Mask: {fileID: 0} + m_Motions: [] + m_Behaviours: [] + m_BlendingMode: 0 + m_SyncedLayerIndex: -1 + m_DefaultWeight: 0 + m_IKPass: 0 + m_SyncedLayerAffectsTiming: 0 + m_Controller: {fileID: 9100000} +--- !u!1107 &4058490066961251321 +AnimatorStateMachine: + serializedVersion: 5 + m_ObjectHideFlags: 1 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: Base Layer + m_ChildStates: + - serializedVersion: 1 + m_State: {fileID: -7096875646415134801} + m_Position: {x: 260, y: 60, z: 0} + m_ChildStateMachines: [] + m_AnyStateTransitions: [] + m_EntryTransitions: [] + m_StateMachineTransitions: {} + m_StateMachineBehaviours: [] + m_AnyStatePosition: {x: 50, y: 20, z: 0} + m_EntryPosition: {x: 50, y: 120, z: 0} + m_ExitPosition: {x: 800, y: 120, z: 0} + m_ParentStateMachinePosition: {x: 800, y: 20, z: 0} + m_DefaultState: {fileID: -7096875646415134801} diff --git a/Assets/Plugins/AllIn1SpriteShader/Demo/Animation/AtlasSpriteBoy.controller.meta b/Assets/Plugins/AllIn1SpriteShader/Demo/Animation/AtlasSpriteBoy.controller.meta new file mode 100644 index 000000000..5cec9c921 --- /dev/null +++ b/Assets/Plugins/AllIn1SpriteShader/Demo/Animation/AtlasSpriteBoy.controller.meta @@ -0,0 +1,15 @@ +fileFormatVersion: 2 +guid: 8652a2e9bd26fdf45b91d4e790b17cb1 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 9100000 + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 156513 + packageName: All In 1 Sprite Shader + packageVersion: 4.25 + assetPath: Assets/Plugins/AllIn1SpriteShader/Demo/Animation/AtlasSpriteBoy.controller + uploadId: 708810 diff --git a/Assets/Plugins/AllIn1SpriteShader/Demo/Animation/Blur.anim b/Assets/Plugins/AllIn1SpriteShader/Demo/Animation/Blur.anim new file mode 100644 index 000000000..344bd58a2 --- /dev/null +++ b/Assets/Plugins/AllIn1SpriteShader/Demo/Animation/Blur.anim @@ -0,0 +1,134 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!74 &7400000 +AnimationClip: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: Blur + serializedVersion: 6 + m_Legacy: 0 + m_Compressed: 0 + m_UseHighQualityCurve: 1 + m_RotationCurves: [] + m_CompressedRotationCurves: [] + m_EulerCurves: [] + m_PositionCurves: [] + m_ScaleCurves: [] + m_FloatCurves: + - curve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 0.33333334 + value: 18.3 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 0.6666667 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + attribute: material._BlurIntensity + path: + classID: 212 + script: {fileID: 0} + m_PPtrCurves: [] + m_SampleRate: 60 + m_WrapMode: 0 + m_Bounds: + m_Center: {x: 0, y: 0, z: 0} + m_Extent: {x: 0, y: 0, z: 0} + m_ClipBindingConstant: + genericBindings: + - serializedVersion: 2 + path: 0 + attribute: 2150532686 + script: {fileID: 0} + typeID: 212 + customType: 22 + isPPtrCurve: 0 + pptrCurveMapping: [] + m_AnimationClipSettings: + serializedVersion: 2 + m_AdditiveReferencePoseClip: {fileID: 0} + m_AdditiveReferencePoseTime: 0 + m_StartTime: 0 + m_StopTime: 0.6666667 + m_OrientationOffsetY: 0 + m_Level: 0 + m_CycleOffset: 0 + m_HasAdditiveReferencePose: 0 + m_LoopTime: 1 + m_LoopBlend: 0 + m_LoopBlendOrientation: 0 + m_LoopBlendPositionY: 0 + m_LoopBlendPositionXZ: 0 + m_KeepOriginalOrientation: 0 + m_KeepOriginalPositionY: 1 + m_KeepOriginalPositionXZ: 0 + m_HeightFromFeet: 0 + m_Mirror: 0 + m_EditorCurves: + - curve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 0.33333334 + value: 18.3 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 0.6666667 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + attribute: material._BlurIntensity + path: + classID: 212 + script: {fileID: 0} + m_EulerEditorCurves: [] + m_HasGenericRootTransform: 0 + m_HasMotionFloatCurves: 0 + m_Events: [] diff --git a/Assets/Plugins/AllIn1SpriteShader/Demo/Animation/Blur.anim.meta b/Assets/Plugins/AllIn1SpriteShader/Demo/Animation/Blur.anim.meta new file mode 100644 index 000000000..e801bba7f --- /dev/null +++ b/Assets/Plugins/AllIn1SpriteShader/Demo/Animation/Blur.anim.meta @@ -0,0 +1,15 @@ +fileFormatVersion: 2 +guid: c5d41ccefede6154f8ae605173ef7ff2 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 7400000 + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 156513 + packageName: All In 1 Sprite Shader + packageVersion: 4.25 + assetPath: Assets/Plugins/AllIn1SpriteShader/Demo/Animation/Blur.anim + uploadId: 708810 diff --git a/Assets/Plugins/AllIn1SpriteShader/Demo/Animation/Blur.controller b/Assets/Plugins/AllIn1SpriteShader/Demo/Animation/Blur.controller new file mode 100644 index 000000000..5e68654b2 --- /dev/null +++ b/Assets/Plugins/AllIn1SpriteShader/Demo/Animation/Blur.controller @@ -0,0 +1,72 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1107 &-8834132420444968739 +AnimatorStateMachine: + serializedVersion: 5 + m_ObjectHideFlags: 1 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: Base Layer + m_ChildStates: + - serializedVersion: 1 + m_State: {fileID: 7853909571706163922} + m_Position: {x: 200, y: 0, z: 0} + m_ChildStateMachines: [] + m_AnyStateTransitions: [] + m_EntryTransitions: [] + m_StateMachineTransitions: {} + m_StateMachineBehaviours: [] + m_AnyStatePosition: {x: 50, y: 20, z: 0} + m_EntryPosition: {x: 50, y: 120, z: 0} + m_ExitPosition: {x: 800, y: 120, z: 0} + m_ParentStateMachinePosition: {x: 800, y: 20, z: 0} + m_DefaultState: {fileID: 7853909571706163922} +--- !u!91 &9100000 +AnimatorController: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: Blur + serializedVersion: 5 + m_AnimatorParameters: [] + m_AnimatorLayers: + - serializedVersion: 5 + m_Name: Base Layer + m_StateMachine: {fileID: -8834132420444968739} + m_Mask: {fileID: 0} + m_Motions: [] + m_Behaviours: [] + m_BlendingMode: 0 + m_SyncedLayerIndex: -1 + m_DefaultWeight: 0 + m_IKPass: 0 + m_SyncedLayerAffectsTiming: 0 + m_Controller: {fileID: 9100000} +--- !u!1102 &7853909571706163922 +AnimatorState: + serializedVersion: 5 + m_ObjectHideFlags: 1 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: Blur + m_Speed: 1 + m_CycleOffset: 0 + m_Transitions: [] + m_StateMachineBehaviours: [] + m_Position: {x: 50, y: 50, z: 0} + m_IKOnFeet: 0 + m_WriteDefaultValues: 1 + m_Mirror: 0 + m_SpeedParameterActive: 0 + m_MirrorParameterActive: 0 + m_CycleOffsetParameterActive: 0 + m_TimeParameterActive: 0 + m_Motion: {fileID: 7400000, guid: c5d41ccefede6154f8ae605173ef7ff2, type: 2} + m_Tag: + m_SpeedParameter: + m_MirrorParameter: + m_CycleOffsetParameter: + m_TimeParameter: diff --git a/Assets/Plugins/AllIn1SpriteShader/Demo/Animation/Blur.controller.meta b/Assets/Plugins/AllIn1SpriteShader/Demo/Animation/Blur.controller.meta new file mode 100644 index 000000000..f4dd550de --- /dev/null +++ b/Assets/Plugins/AllIn1SpriteShader/Demo/Animation/Blur.controller.meta @@ -0,0 +1,15 @@ +fileFormatVersion: 2 +guid: 4d13c3a68decb714e80835bb34f348f3 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 9100000 + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 156513 + packageName: All In 1 Sprite Shader + packageVersion: 4.25 + assetPath: Assets/Plugins/AllIn1SpriteShader/Demo/Animation/Blur.controller + uploadId: 708810 diff --git a/Assets/Plugins/AllIn1SpriteShader/Demo/Animation/Burn.anim b/Assets/Plugins/AllIn1SpriteShader/Demo/Animation/Burn.anim new file mode 100644 index 000000000..2150839b2 --- /dev/null +++ b/Assets/Plugins/AllIn1SpriteShader/Demo/Animation/Burn.anim @@ -0,0 +1,233 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!74 &7400000 +AnimationClip: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: Burn + serializedVersion: 6 + m_Legacy: 0 + m_Compressed: 0 + m_UseHighQualityCurve: 1 + m_RotationCurves: [] + m_CompressedRotationCurves: [] + m_EulerCurves: [] + m_PositionCurves: [] + m_ScaleCurves: [] + m_FloatCurves: + - curve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 0.1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 0.26666668 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 0.43333334 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + attribute: material._HitEffectBlend + path: + classID: 212 + script: {fileID: 0} + - curve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: -0.1 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 0.1 + value: 0 + inSlope: 0.36363637 + outSlope: 0.36363637 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1.1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + attribute: material._FadeAmount + path: + classID: 212 + script: {fileID: 0} + m_PPtrCurves: [] + m_SampleRate: 60 + m_WrapMode: 0 + m_Bounds: + m_Center: {x: 0, y: 0, z: 0} + m_Extent: {x: 0, y: 0, z: 0} + m_ClipBindingConstant: + genericBindings: + - serializedVersion: 2 + path: 0 + attribute: 2333048903 + script: {fileID: 0} + typeID: 212 + customType: 22 + isPPtrCurve: 0 + - serializedVersion: 2 + path: 0 + attribute: 2375902170 + script: {fileID: 0} + typeID: 212 + customType: 22 + isPPtrCurve: 0 + pptrCurveMapping: [] + m_AnimationClipSettings: + serializedVersion: 2 + m_AdditiveReferencePoseClip: {fileID: 0} + m_AdditiveReferencePoseTime: 0 + m_StartTime: 0 + m_StopTime: 1.1 + m_OrientationOffsetY: 0 + m_Level: 0 + m_CycleOffset: 0 + m_HasAdditiveReferencePose: 0 + m_LoopTime: 1 + m_LoopBlend: 0 + m_LoopBlendOrientation: 0 + m_LoopBlendPositionY: 0 + m_LoopBlendPositionXZ: 0 + m_KeepOriginalOrientation: 0 + m_KeepOriginalPositionY: 1 + m_KeepOriginalPositionXZ: 0 + m_HeightFromFeet: 0 + m_Mirror: 0 + m_EditorCurves: + - curve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 0.1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 0.26666668 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 0.43333334 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + attribute: material._HitEffectBlend + path: + classID: 212 + script: {fileID: 0} + - curve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: -0.1 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 0.1 + value: 0 + inSlope: 0.36363637 + outSlope: 0.36363637 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1.1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + attribute: material._FadeAmount + path: + classID: 212 + script: {fileID: 0} + m_EulerEditorCurves: [] + m_HasGenericRootTransform: 0 + m_HasMotionFloatCurves: 0 + m_Events: [] diff --git a/Assets/Plugins/AllIn1SpriteShader/Demo/Animation/Burn.anim.meta b/Assets/Plugins/AllIn1SpriteShader/Demo/Animation/Burn.anim.meta new file mode 100644 index 000000000..e8006ce90 --- /dev/null +++ b/Assets/Plugins/AllIn1SpriteShader/Demo/Animation/Burn.anim.meta @@ -0,0 +1,15 @@ +fileFormatVersion: 2 +guid: d67d27ddcf1126d4189d14140cc10cbc +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 7400000 + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 156513 + packageName: All In 1 Sprite Shader + packageVersion: 4.25 + assetPath: Assets/Plugins/AllIn1SpriteShader/Demo/Animation/Burn.anim + uploadId: 708810 diff --git a/Assets/Plugins/AllIn1SpriteShader/Demo/Animation/Burn.controller b/Assets/Plugins/AllIn1SpriteShader/Demo/Animation/Burn.controller new file mode 100644 index 000000000..a503dda1b --- /dev/null +++ b/Assets/Plugins/AllIn1SpriteShader/Demo/Animation/Burn.controller @@ -0,0 +1,72 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!91 &9100000 +AnimatorController: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: Burn + serializedVersion: 5 + m_AnimatorParameters: [] + m_AnimatorLayers: + - serializedVersion: 5 + m_Name: Base Layer + m_StateMachine: {fileID: 5582001109422249166} + m_Mask: {fileID: 0} + m_Motions: [] + m_Behaviours: [] + m_BlendingMode: 0 + m_SyncedLayerIndex: -1 + m_DefaultWeight: 0 + m_IKPass: 0 + m_SyncedLayerAffectsTiming: 0 + m_Controller: {fileID: 9100000} +--- !u!1102 &3750917721442123826 +AnimatorState: + serializedVersion: 5 + m_ObjectHideFlags: 1 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: Burn + m_Speed: 1 + m_CycleOffset: 0 + m_Transitions: [] + m_StateMachineBehaviours: [] + m_Position: {x: 50, y: 50, z: 0} + m_IKOnFeet: 0 + m_WriteDefaultValues: 1 + m_Mirror: 0 + m_SpeedParameterActive: 0 + m_MirrorParameterActive: 0 + m_CycleOffsetParameterActive: 0 + m_TimeParameterActive: 0 + m_Motion: {fileID: 7400000, guid: d67d27ddcf1126d4189d14140cc10cbc, type: 2} + m_Tag: + m_SpeedParameter: + m_MirrorParameter: + m_CycleOffsetParameter: + m_TimeParameter: +--- !u!1107 &5582001109422249166 +AnimatorStateMachine: + serializedVersion: 5 + m_ObjectHideFlags: 1 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: Base Layer + m_ChildStates: + - serializedVersion: 1 + m_State: {fileID: 3750917721442123826} + m_Position: {x: 200, y: 0, z: 0} + m_ChildStateMachines: [] + m_AnyStateTransitions: [] + m_EntryTransitions: [] + m_StateMachineTransitions: {} + m_StateMachineBehaviours: [] + m_AnyStatePosition: {x: 50, y: 20, z: 0} + m_EntryPosition: {x: 50, y: 120, z: 0} + m_ExitPosition: {x: 800, y: 120, z: 0} + m_ParentStateMachinePosition: {x: 800, y: 20, z: 0} + m_DefaultState: {fileID: 3750917721442123826} diff --git a/Assets/Plugins/AllIn1SpriteShader/Demo/Animation/Burn.controller.meta b/Assets/Plugins/AllIn1SpriteShader/Demo/Animation/Burn.controller.meta new file mode 100644 index 000000000..04ebcc38b --- /dev/null +++ b/Assets/Plugins/AllIn1SpriteShader/Demo/Animation/Burn.controller.meta @@ -0,0 +1,15 @@ +fileFormatVersion: 2 +guid: 9d3bba413d0ce9244b743d634f8d3c27 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 9100000 + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 156513 + packageName: All In 1 Sprite Shader + packageVersion: 4.25 + assetPath: Assets/Plugins/AllIn1SpriteShader/Demo/Animation/Burn.controller + uploadId: 708810 diff --git a/Assets/Plugins/AllIn1SpriteShader/Demo/Animation/BurningSoldier.anim b/Assets/Plugins/AllIn1SpriteShader/Demo/Animation/BurningSoldier.anim new file mode 100644 index 000000000..0ca7c2218 --- /dev/null +++ b/Assets/Plugins/AllIn1SpriteShader/Demo/Animation/BurningSoldier.anim @@ -0,0 +1,332 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!74 &7400000 +AnimationClip: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: BurningSoldier + serializedVersion: 6 + m_Legacy: 0 + m_Compressed: 0 + m_UseHighQualityCurve: 1 + m_RotationCurves: [] + m_CompressedRotationCurves: [] + m_EulerCurves: [] + m_PositionCurves: [] + m_ScaleCurves: [] + m_FloatCurves: + - curve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 30 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 0.16666667 + value: 24.4 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 0.33333334 + value: 35.1 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 0.5 + value: 15.9 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 0.6666667 + value: 30.6 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 0.8333333 + value: 26.1 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 41.3 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1.1666666 + value: 31.1 + inSlope: -56.699993 + outSlope: -56.699993 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1.3333334 + value: 22.4 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1.5 + value: 31 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1.6666666 + value: 27.5 + inSlope: -41.999996 + outSlope: -41.999996 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1.8333334 + value: 16.8 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 2 + value: 34.6 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 2.1666667 + value: 30 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + attribute: material._Glow + path: Burn + classID: 212 + script: {fileID: 0} + m_PPtrCurves: [] + m_SampleRate: 60 + m_WrapMode: 0 + m_Bounds: + m_Center: {x: 0, y: 0, z: 0} + m_Extent: {x: 0, y: 0, z: 0} + m_ClipBindingConstant: + genericBindings: + - serializedVersion: 2 + path: 4116755002 + attribute: 2271964720 + script: {fileID: 0} + typeID: 212 + customType: 22 + isPPtrCurve: 0 + pptrCurveMapping: [] + m_AnimationClipSettings: + serializedVersion: 2 + m_AdditiveReferencePoseClip: {fileID: 0} + m_AdditiveReferencePoseTime: 0 + m_StartTime: 0 + m_StopTime: 2.1666667 + m_OrientationOffsetY: 0 + m_Level: 0 + m_CycleOffset: 0 + m_HasAdditiveReferencePose: 0 + m_LoopTime: 1 + m_LoopBlend: 0 + m_LoopBlendOrientation: 0 + m_LoopBlendPositionY: 0 + m_LoopBlendPositionXZ: 0 + m_KeepOriginalOrientation: 0 + m_KeepOriginalPositionY: 1 + m_KeepOriginalPositionXZ: 0 + m_HeightFromFeet: 0 + m_Mirror: 0 + m_EditorCurves: + - curve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 30 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 0.16666667 + value: 24.4 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 0.33333334 + value: 35.1 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 0.5 + value: 15.9 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 0.6666667 + value: 30.6 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 0.8333333 + value: 26.1 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 41.3 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1.1666666 + value: 31.1 + inSlope: -56.699993 + outSlope: -56.699993 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1.3333334 + value: 22.4 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1.5 + value: 31 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1.6666666 + value: 27.5 + inSlope: -41.999996 + outSlope: -41.999996 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1.8333334 + value: 16.8 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 2 + value: 34.6 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 2.1666667 + value: 30 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + attribute: material._Glow + path: Burn + classID: 212 + script: {fileID: 0} + m_EulerEditorCurves: [] + m_HasGenericRootTransform: 0 + m_HasMotionFloatCurves: 0 + m_Events: [] diff --git a/Assets/Plugins/AllIn1SpriteShader/Demo/Animation/BurningSoldier.anim.meta b/Assets/Plugins/AllIn1SpriteShader/Demo/Animation/BurningSoldier.anim.meta new file mode 100644 index 000000000..6b045e64a --- /dev/null +++ b/Assets/Plugins/AllIn1SpriteShader/Demo/Animation/BurningSoldier.anim.meta @@ -0,0 +1,15 @@ +fileFormatVersion: 2 +guid: 3f0612e16135f2c4896bf79e439c17b8 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 7400000 + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 156513 + packageName: All In 1 Sprite Shader + packageVersion: 4.25 + assetPath: Assets/Plugins/AllIn1SpriteShader/Demo/Animation/BurningSoldier.anim + uploadId: 708810 diff --git a/Assets/Plugins/AllIn1SpriteShader/Demo/Animation/BurningSoldier.controller b/Assets/Plugins/AllIn1SpriteShader/Demo/Animation/BurningSoldier.controller new file mode 100644 index 000000000..f9a584bde --- /dev/null +++ b/Assets/Plugins/AllIn1SpriteShader/Demo/Animation/BurningSoldier.controller @@ -0,0 +1,72 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!91 &9100000 +AnimatorController: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: BurningSoldier + serializedVersion: 5 + m_AnimatorParameters: [] + m_AnimatorLayers: + - serializedVersion: 5 + m_Name: Base Layer + m_StateMachine: {fileID: 8782918891389931882} + m_Mask: {fileID: 0} + m_Motions: [] + m_Behaviours: [] + m_BlendingMode: 0 + m_SyncedLayerIndex: -1 + m_DefaultWeight: 0 + m_IKPass: 0 + m_SyncedLayerAffectsTiming: 0 + m_Controller: {fileID: 9100000} +--- !u!1107 &8782918891389931882 +AnimatorStateMachine: + serializedVersion: 5 + m_ObjectHideFlags: 1 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: Base Layer + m_ChildStates: + - serializedVersion: 1 + m_State: {fileID: 9025100736644353693} + m_Position: {x: 200, y: 0, z: 0} + m_ChildStateMachines: [] + m_AnyStateTransitions: [] + m_EntryTransitions: [] + m_StateMachineTransitions: {} + m_StateMachineBehaviours: [] + m_AnyStatePosition: {x: 50, y: 20, z: 0} + m_EntryPosition: {x: 50, y: 120, z: 0} + m_ExitPosition: {x: 800, y: 120, z: 0} + m_ParentStateMachinePosition: {x: 800, y: 20, z: 0} + m_DefaultState: {fileID: 9025100736644353693} +--- !u!1102 &9025100736644353693 +AnimatorState: + serializedVersion: 5 + m_ObjectHideFlags: 1 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: BurningSoldier + m_Speed: 1 + m_CycleOffset: 0 + m_Transitions: [] + m_StateMachineBehaviours: [] + m_Position: {x: 50, y: 50, z: 0} + m_IKOnFeet: 0 + m_WriteDefaultValues: 1 + m_Mirror: 0 + m_SpeedParameterActive: 0 + m_MirrorParameterActive: 0 + m_CycleOffsetParameterActive: 0 + m_TimeParameterActive: 0 + m_Motion: {fileID: 7400000, guid: 3f0612e16135f2c4896bf79e439c17b8, type: 2} + m_Tag: + m_SpeedParameter: + m_MirrorParameter: + m_CycleOffsetParameter: + m_TimeParameter: diff --git a/Assets/Plugins/AllIn1SpriteShader/Demo/Animation/BurningSoldier.controller.meta b/Assets/Plugins/AllIn1SpriteShader/Demo/Animation/BurningSoldier.controller.meta new file mode 100644 index 000000000..0245386ab --- /dev/null +++ b/Assets/Plugins/AllIn1SpriteShader/Demo/Animation/BurningSoldier.controller.meta @@ -0,0 +1,15 @@ +fileFormatVersion: 2 +guid: 5f3b82f530c24dd48961a1d428ed91d8 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 9100000 + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 156513 + packageName: All In 1 Sprite Shader + packageVersion: 4.25 + assetPath: Assets/Plugins/AllIn1SpriteShader/Demo/Animation/BurningSoldier.controller + uploadId: 708810 diff --git a/Assets/Plugins/AllIn1SpriteShader/Demo/Animation/CrazyPattern.anim b/Assets/Plugins/AllIn1SpriteShader/Demo/Animation/CrazyPattern.anim new file mode 100644 index 000000000..0f3ea0444 --- /dev/null +++ b/Assets/Plugins/AllIn1SpriteShader/Demo/Animation/CrazyPattern.anim @@ -0,0 +1,395 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!74 &7400000 +AnimationClip: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: CrazyPattern + serializedVersion: 6 + m_Legacy: 0 + m_Compressed: 0 + m_UseHighQualityCurve: 1 + m_RotationCurves: [] + m_CompressedRotationCurves: [] + m_EulerCurves: [] + m_PositionCurves: [] + m_ScaleCurves: [] + m_FloatCurves: + - curve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 0.41666666 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 0.8333333 + value: 3.1416 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1.25 + value: 3.1416 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1.6666666 + value: 3.1416 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 2.0833333 + value: 3.1416 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 2.5 + value: 6.28 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + attribute: material._RotateUvAmount + path: + classID: 212 + script: {fileID: 0} + - curve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 0.41666666 + value: 0.5 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 0.8333333 + value: 0.5 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1.25 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1.6666666 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 2.0833333 + value: 0.5 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 2.5 + value: 0.5 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 2.9166667 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 3.3333333 + value: 0.00908789 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + attribute: material._PinchUvAmount + path: + classID: 212 + script: {fileID: 0} + m_PPtrCurves: [] + m_SampleRate: 60 + m_WrapMode: 0 + m_Bounds: + m_Center: {x: 0, y: 0, z: 0} + m_Extent: {x: 0, y: 0, z: 0} + m_ClipBindingConstant: + genericBindings: + - serializedVersion: 2 + path: 0 + attribute: 2278947341 + script: {fileID: 0} + typeID: 212 + customType: 22 + isPPtrCurve: 0 + - serializedVersion: 2 + path: 0 + attribute: 2301463249 + script: {fileID: 0} + typeID: 212 + customType: 22 + isPPtrCurve: 0 + pptrCurveMapping: [] + m_AnimationClipSettings: + serializedVersion: 2 + m_AdditiveReferencePoseClip: {fileID: 0} + m_AdditiveReferencePoseTime: 0 + m_StartTime: 0 + m_StopTime: 3.3333333 + m_OrientationOffsetY: 0 + m_Level: 0 + m_CycleOffset: 0 + m_HasAdditiveReferencePose: 0 + m_LoopTime: 1 + m_LoopBlend: 0 + m_LoopBlendOrientation: 0 + m_LoopBlendPositionY: 0 + m_LoopBlendPositionXZ: 0 + m_KeepOriginalOrientation: 0 + m_KeepOriginalPositionY: 1 + m_KeepOriginalPositionXZ: 0 + m_HeightFromFeet: 0 + m_Mirror: 0 + m_EditorCurves: + - curve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 0.41666666 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 0.8333333 + value: 3.1416 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1.25 + value: 3.1416 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1.6666666 + value: 3.1416 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 2.0833333 + value: 3.1416 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 2.5 + value: 6.28 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + attribute: material._RotateUvAmount + path: + classID: 212 + script: {fileID: 0} + - curve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 0.41666666 + value: 0.5 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 0.8333333 + value: 0.5 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1.25 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1.6666666 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 2.0833333 + value: 0.5 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 2.5 + value: 0.5 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 2.9166667 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 3.3333333 + value: 0.00908789 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + attribute: material._PinchUvAmount + path: + classID: 212 + script: {fileID: 0} + m_EulerEditorCurves: [] + m_HasGenericRootTransform: 0 + m_HasMotionFloatCurves: 0 + m_Events: [] diff --git a/Assets/Plugins/AllIn1SpriteShader/Demo/Animation/CrazyPattern.anim.meta b/Assets/Plugins/AllIn1SpriteShader/Demo/Animation/CrazyPattern.anim.meta new file mode 100644 index 000000000..d61d85a69 --- /dev/null +++ b/Assets/Plugins/AllIn1SpriteShader/Demo/Animation/CrazyPattern.anim.meta @@ -0,0 +1,15 @@ +fileFormatVersion: 2 +guid: ad92dfbcd615b014a935ff2405b31f9d +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 7400000 + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 156513 + packageName: All In 1 Sprite Shader + packageVersion: 4.25 + assetPath: Assets/Plugins/AllIn1SpriteShader/Demo/Animation/CrazyPattern.anim + uploadId: 708810 diff --git a/Assets/Plugins/AllIn1SpriteShader/Demo/Animation/CrazyPattern.controller b/Assets/Plugins/AllIn1SpriteShader/Demo/Animation/CrazyPattern.controller new file mode 100644 index 000000000..4bb3001c0 --- /dev/null +++ b/Assets/Plugins/AllIn1SpriteShader/Demo/Animation/CrazyPattern.controller @@ -0,0 +1,72 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!91 &9100000 +AnimatorController: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: CrazyPattern + serializedVersion: 5 + m_AnimatorParameters: [] + m_AnimatorLayers: + - serializedVersion: 5 + m_Name: Base Layer + m_StateMachine: {fileID: 1107734427540884016} + m_Mask: {fileID: 0} + m_Motions: [] + m_Behaviours: [] + m_BlendingMode: 0 + m_SyncedLayerIndex: -1 + m_DefaultWeight: 0 + m_IKPass: 0 + m_SyncedLayerAffectsTiming: 0 + m_Controller: {fileID: 9100000} +--- !u!1102 &1102331061419599162 +AnimatorState: + serializedVersion: 5 + m_ObjectHideFlags: 1 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: CrazyPattern + m_Speed: 1 + m_CycleOffset: 0 + m_Transitions: [] + m_StateMachineBehaviours: [] + m_Position: {x: 50, y: 50, z: 0} + m_IKOnFeet: 0 + m_WriteDefaultValues: 1 + m_Mirror: 0 + m_SpeedParameterActive: 0 + m_MirrorParameterActive: 0 + m_CycleOffsetParameterActive: 0 + m_TimeParameterActive: 0 + m_Motion: {fileID: 7400000, guid: ad92dfbcd615b014a935ff2405b31f9d, type: 2} + m_Tag: + m_SpeedParameter: + m_MirrorParameter: + m_CycleOffsetParameter: + m_TimeParameter: +--- !u!1107 &1107734427540884016 +AnimatorStateMachine: + serializedVersion: 5 + m_ObjectHideFlags: 1 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: Base Layer + m_ChildStates: + - serializedVersion: 1 + m_State: {fileID: 1102331061419599162} + m_Position: {x: 200, y: 0, z: 0} + m_ChildStateMachines: [] + m_AnyStateTransitions: [] + m_EntryTransitions: [] + m_StateMachineTransitions: {} + m_StateMachineBehaviours: [] + m_AnyStatePosition: {x: 50, y: 20, z: 0} + m_EntryPosition: {x: 50, y: 120, z: 0} + m_ExitPosition: {x: 800, y: 120, z: 0} + m_ParentStateMachinePosition: {x: 800, y: 20, z: 0} + m_DefaultState: {fileID: 1102331061419599162} diff --git a/Assets/Plugins/AllIn1SpriteShader/Demo/Animation/CrazyPattern.controller.meta b/Assets/Plugins/AllIn1SpriteShader/Demo/Animation/CrazyPattern.controller.meta new file mode 100644 index 000000000..91711e186 --- /dev/null +++ b/Assets/Plugins/AllIn1SpriteShader/Demo/Animation/CrazyPattern.controller.meta @@ -0,0 +1,15 @@ +fileFormatVersion: 2 +guid: f994ff75b3f33ae46af22e6462b4606a +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 9100000 + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 156513 + packageName: All In 1 Sprite Shader + packageVersion: 4.25 + assetPath: Assets/Plugins/AllIn1SpriteShader/Demo/Animation/CrazyPattern.controller + uploadId: 708810 diff --git a/Assets/Plugins/AllIn1SpriteShader/Demo/Animation/CustomGradient.anim b/Assets/Plugins/AllIn1SpriteShader/Demo/Animation/CustomGradient.anim new file mode 100644 index 000000000..eeb47fbb8 --- /dev/null +++ b/Assets/Plugins/AllIn1SpriteShader/Demo/Animation/CustomGradient.anim @@ -0,0 +1,134 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!74 &7400000 +AnimationClip: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: CustomGradient + serializedVersion: 6 + m_Legacy: 0 + m_Compressed: 0 + m_UseHighQualityCurve: 1 + m_RotationCurves: [] + m_CompressedRotationCurves: [] + m_EulerCurves: [] + m_PositionCurves: [] + m_ScaleCurves: [] + m_FloatCurves: + - curve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: -0.52 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 0.75 + value: 0.52 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1.5 + value: -0.52 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + attribute: material._ColorRampLuminosity + path: + classID: 212 + script: {fileID: 0} + m_PPtrCurves: [] + m_SampleRate: 60 + m_WrapMode: 0 + m_Bounds: + m_Center: {x: 0, y: 0, z: 0} + m_Extent: {x: 0, y: 0, z: 0} + m_ClipBindingConstant: + genericBindings: + - serializedVersion: 2 + path: 0 + attribute: 2233840366 + script: {fileID: 0} + typeID: 212 + customType: 22 + isPPtrCurve: 0 + pptrCurveMapping: [] + m_AnimationClipSettings: + serializedVersion: 2 + m_AdditiveReferencePoseClip: {fileID: 0} + m_AdditiveReferencePoseTime: 0 + m_StartTime: 0 + m_StopTime: 1.5 + m_OrientationOffsetY: 0 + m_Level: 0 + m_CycleOffset: 0 + m_HasAdditiveReferencePose: 0 + m_LoopTime: 1 + m_LoopBlend: 0 + m_LoopBlendOrientation: 0 + m_LoopBlendPositionY: 0 + m_LoopBlendPositionXZ: 0 + m_KeepOriginalOrientation: 0 + m_KeepOriginalPositionY: 1 + m_KeepOriginalPositionXZ: 0 + m_HeightFromFeet: 0 + m_Mirror: 0 + m_EditorCurves: + - curve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: -0.52 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 0.75 + value: 0.52 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1.5 + value: -0.52 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + attribute: material._ColorRampLuminosity + path: + classID: 212 + script: {fileID: 0} + m_EulerEditorCurves: [] + m_HasGenericRootTransform: 0 + m_HasMotionFloatCurves: 0 + m_Events: [] diff --git a/Assets/Plugins/AllIn1SpriteShader/Demo/Animation/CustomGradient.anim.meta b/Assets/Plugins/AllIn1SpriteShader/Demo/Animation/CustomGradient.anim.meta new file mode 100644 index 000000000..5b7f0d683 --- /dev/null +++ b/Assets/Plugins/AllIn1SpriteShader/Demo/Animation/CustomGradient.anim.meta @@ -0,0 +1,15 @@ +fileFormatVersion: 2 +guid: 7f6e7a4a06cb0ed46bed4c808d5ef0fc +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 7400000 + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 156513 + packageName: All In 1 Sprite Shader + packageVersion: 4.25 + assetPath: Assets/Plugins/AllIn1SpriteShader/Demo/Animation/CustomGradient.anim + uploadId: 708810 diff --git a/Assets/Plugins/AllIn1SpriteShader/Demo/Animation/CustomGradient.controller b/Assets/Plugins/AllIn1SpriteShader/Demo/Animation/CustomGradient.controller new file mode 100644 index 000000000..e6f3cc1a1 --- /dev/null +++ b/Assets/Plugins/AllIn1SpriteShader/Demo/Animation/CustomGradient.controller @@ -0,0 +1,72 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!91 &9100000 +AnimatorController: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: CustomGradient + serializedVersion: 5 + m_AnimatorParameters: [] + m_AnimatorLayers: + - serializedVersion: 5 + m_Name: Base Layer + m_StateMachine: {fileID: 1107173670123172324} + m_Mask: {fileID: 0} + m_Motions: [] + m_Behaviours: [] + m_BlendingMode: 0 + m_SyncedLayerIndex: -1 + m_DefaultWeight: 0 + m_IKPass: 0 + m_SyncedLayerAffectsTiming: 0 + m_Controller: {fileID: 9100000} +--- !u!1102 &1102237943875058834 +AnimatorState: + serializedVersion: 5 + m_ObjectHideFlags: 1 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: CustomGradient + m_Speed: 1 + m_CycleOffset: 0 + m_Transitions: [] + m_StateMachineBehaviours: [] + m_Position: {x: 50, y: 50, z: 0} + m_IKOnFeet: 0 + m_WriteDefaultValues: 1 + m_Mirror: 0 + m_SpeedParameterActive: 0 + m_MirrorParameterActive: 0 + m_CycleOffsetParameterActive: 0 + m_TimeParameterActive: 0 + m_Motion: {fileID: 7400000, guid: 7f6e7a4a06cb0ed46bed4c808d5ef0fc, type: 2} + m_Tag: + m_SpeedParameter: + m_MirrorParameter: + m_CycleOffsetParameter: + m_TimeParameter: +--- !u!1107 &1107173670123172324 +AnimatorStateMachine: + serializedVersion: 5 + m_ObjectHideFlags: 1 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: Base Layer + m_ChildStates: + - serializedVersion: 1 + m_State: {fileID: 1102237943875058834} + m_Position: {x: 384, y: 73, z: 0} + m_ChildStateMachines: [] + m_AnyStateTransitions: [] + m_EntryTransitions: [] + m_StateMachineTransitions: {} + m_StateMachineBehaviours: [] + m_AnyStatePosition: {x: 50, y: 20, z: 0} + m_EntryPosition: {x: 50, y: 120, z: 0} + m_ExitPosition: {x: 800, y: 120, z: 0} + m_ParentStateMachinePosition: {x: 800, y: 20, z: 0} + m_DefaultState: {fileID: 1102237943875058834} diff --git a/Assets/Plugins/AllIn1SpriteShader/Demo/Animation/CustomGradient.controller.meta b/Assets/Plugins/AllIn1SpriteShader/Demo/Animation/CustomGradient.controller.meta new file mode 100644 index 000000000..5e455cc66 --- /dev/null +++ b/Assets/Plugins/AllIn1SpriteShader/Demo/Animation/CustomGradient.controller.meta @@ -0,0 +1,15 @@ +fileFormatVersion: 2 +guid: edeeb31731bec5f4092bbc3bbff03e91 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 9100000 + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 156513 + packageName: All In 1 Sprite Shader + packageVersion: 4.25 + assetPath: Assets/Plugins/AllIn1SpriteShader/Demo/Animation/CustomGradient.controller + uploadId: 708810 diff --git a/Assets/Plugins/AllIn1SpriteShader/Demo/Animation/Fade.anim b/Assets/Plugins/AllIn1SpriteShader/Demo/Animation/Fade.anim new file mode 100644 index 000000000..fe67793c9 --- /dev/null +++ b/Assets/Plugins/AllIn1SpriteShader/Demo/Animation/Fade.anim @@ -0,0 +1,251 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!74 &7400000 +AnimationClip: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: Fade + serializedVersion: 6 + m_Legacy: 0 + m_Compressed: 0 + m_UseHighQualityCurve: 1 + m_RotationCurves: [] + m_CompressedRotationCurves: [] + m_EulerCurves: [] + m_PositionCurves: [] + m_ScaleCurves: [] + m_FloatCurves: + - curve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 0.16666667 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 0.6666667 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 0.9166667 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + attribute: material._FadeAmount + path: + classID: 212 + script: {fileID: 0} + - curve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 0.16666667 + value: 13.5 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + attribute: material._FadeBurnGlow + path: + classID: 212 + script: {fileID: 0} + m_PPtrCurves: [] + m_SampleRate: 60 + m_WrapMode: 0 + m_Bounds: + m_Center: {x: 0, y: 0, z: 0} + m_Extent: {x: 0, y: 0, z: 0} + m_ClipBindingConstant: + genericBindings: + - serializedVersion: 2 + path: 0 + attribute: 2375902170 + script: {fileID: 0} + typeID: 212 + customType: 22 + isPPtrCurve: 0 + - serializedVersion: 2 + path: 0 + attribute: 2407006466 + script: {fileID: 0} + typeID: 212 + customType: 22 + isPPtrCurve: 0 + pptrCurveMapping: [] + m_AnimationClipSettings: + serializedVersion: 2 + m_AdditiveReferencePoseClip: {fileID: 0} + m_AdditiveReferencePoseTime: 0 + m_StartTime: 0 + m_StopTime: 1 + m_OrientationOffsetY: 0 + m_Level: 0 + m_CycleOffset: 0 + m_HasAdditiveReferencePose: 0 + m_LoopTime: 1 + m_LoopBlend: 0 + m_LoopBlendOrientation: 0 + m_LoopBlendPositionY: 0 + m_LoopBlendPositionXZ: 0 + m_KeepOriginalOrientation: 0 + m_KeepOriginalPositionY: 1 + m_KeepOriginalPositionXZ: 0 + m_HeightFromFeet: 0 + m_Mirror: 0 + m_EditorCurves: + - curve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 0.16666667 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 0.6666667 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 0.9166667 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + attribute: material._FadeAmount + path: + classID: 212 + script: {fileID: 0} + - curve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 0.16666667 + value: 13.5 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + attribute: material._FadeBurnGlow + path: + classID: 212 + script: {fileID: 0} + m_EulerEditorCurves: [] + m_HasGenericRootTransform: 0 + m_HasMotionFloatCurves: 0 + m_Events: [] diff --git a/Assets/Plugins/AllIn1SpriteShader/Demo/Animation/Fade.anim.meta b/Assets/Plugins/AllIn1SpriteShader/Demo/Animation/Fade.anim.meta new file mode 100644 index 000000000..35edaf74c --- /dev/null +++ b/Assets/Plugins/AllIn1SpriteShader/Demo/Animation/Fade.anim.meta @@ -0,0 +1,15 @@ +fileFormatVersion: 2 +guid: e6ea2b9990f282841809c38407852410 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 7400000 + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 156513 + packageName: All In 1 Sprite Shader + packageVersion: 4.25 + assetPath: Assets/Plugins/AllIn1SpriteShader/Demo/Animation/Fade.anim + uploadId: 708810 diff --git a/Assets/Plugins/AllIn1SpriteShader/Demo/Animation/Fade.controller b/Assets/Plugins/AllIn1SpriteShader/Demo/Animation/Fade.controller new file mode 100644 index 000000000..ed6316acc --- /dev/null +++ b/Assets/Plugins/AllIn1SpriteShader/Demo/Animation/Fade.controller @@ -0,0 +1,72 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!91 &9100000 +AnimatorController: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: Fade + serializedVersion: 5 + m_AnimatorParameters: [] + m_AnimatorLayers: + - serializedVersion: 5 + m_Name: Base Layer + m_StateMachine: {fileID: 5715813001965171755} + m_Mask: {fileID: 0} + m_Motions: [] + m_Behaviours: [] + m_BlendingMode: 0 + m_SyncedLayerIndex: -1 + m_DefaultWeight: 0 + m_IKPass: 0 + m_SyncedLayerAffectsTiming: 0 + m_Controller: {fileID: 9100000} +--- !u!1102 &335997213937709296 +AnimatorState: + serializedVersion: 6 + m_ObjectHideFlags: 1 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: Fade + m_Speed: 0.25 + m_CycleOffset: 0 + m_Transitions: [] + m_StateMachineBehaviours: [] + m_Position: {x: 50, y: 50, z: 0} + m_IKOnFeet: 0 + m_WriteDefaultValues: 1 + m_Mirror: 0 + m_SpeedParameterActive: 0 + m_MirrorParameterActive: 0 + m_CycleOffsetParameterActive: 0 + m_TimeParameterActive: 0 + m_Motion: {fileID: 7400000, guid: e6ea2b9990f282841809c38407852410, type: 2} + m_Tag: + m_SpeedParameter: + m_MirrorParameter: + m_CycleOffsetParameter: + m_TimeParameter: +--- !u!1107 &5715813001965171755 +AnimatorStateMachine: + serializedVersion: 6 + m_ObjectHideFlags: 1 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: Base Layer + m_ChildStates: + - serializedVersion: 1 + m_State: {fileID: 335997213937709296} + m_Position: {x: 252, y: 48, z: 0} + m_ChildStateMachines: [] + m_AnyStateTransitions: [] + m_EntryTransitions: [] + m_StateMachineTransitions: {} + m_StateMachineBehaviours: [] + m_AnyStatePosition: {x: 50, y: 20, z: 0} + m_EntryPosition: {x: 50, y: 120, z: 0} + m_ExitPosition: {x: 800, y: 120, z: 0} + m_ParentStateMachinePosition: {x: 800, y: 20, z: 0} + m_DefaultState: {fileID: 335997213937709296} diff --git a/Assets/Plugins/AllIn1SpriteShader/Demo/Animation/Fade.controller.meta b/Assets/Plugins/AllIn1SpriteShader/Demo/Animation/Fade.controller.meta new file mode 100644 index 000000000..cbe778ef9 --- /dev/null +++ b/Assets/Plugins/AllIn1SpriteShader/Demo/Animation/Fade.controller.meta @@ -0,0 +1,15 @@ +fileFormatVersion: 2 +guid: 2025469cc6b8be543a1b93993e746b75 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 9100000 + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 156513 + packageName: All In 1 Sprite Shader + packageVersion: 4.25 + assetPath: Assets/Plugins/AllIn1SpriteShader/Demo/Animation/Fade.controller + uploadId: 708810 diff --git a/Assets/Plugins/AllIn1SpriteShader/Demo/Animation/Fill Amount 1.controller b/Assets/Plugins/AllIn1SpriteShader/Demo/Animation/Fill Amount 1.controller new file mode 100644 index 000000000..5fd23330b --- /dev/null +++ b/Assets/Plugins/AllIn1SpriteShader/Demo/Animation/Fill Amount 1.controller @@ -0,0 +1,147 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1102 &-7387446859746230137 +AnimatorState: + serializedVersion: 5 + m_ObjectHideFlags: 3 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: TeleportReverse + m_Speed: -1 + m_CycleOffset: 0 + m_Transitions: + - {fileID: -7156134355841481533} + m_StateMachineBehaviours: [] + m_Position: {x: 50, y: 50, z: 0} + m_IKOnFeet: 0 + m_WriteDefaultValues: 1 + m_Mirror: 0 + m_SpeedParameterActive: 0 + m_MirrorParameterActive: 0 + m_CycleOffsetParameterActive: 0 + m_TimeParameterActive: 0 + m_Motion: {fileID: 7400000, guid: d55cd89bba47b6c4dbfe242daad46b9e, type: 2} + m_Tag: + m_SpeedParameter: + m_MirrorParameter: + m_CycleOffsetParameter: + m_TimeParameter: +--- !u!1107 &-7264864826306982476 +AnimatorStateMachine: + serializedVersion: 5 + m_ObjectHideFlags: 1 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: Base Layer + m_ChildStates: + - serializedVersion: 1 + m_State: {fileID: 542486197727019260} + m_Position: {x: 290, y: 110, z: 0} + - serializedVersion: 1 + m_State: {fileID: -7387446859746230137} + m_Position: {x: 290, y: 20, z: 0} + m_ChildStateMachines: [] + m_AnyStateTransitions: [] + m_EntryTransitions: [] + m_StateMachineTransitions: {} + m_StateMachineBehaviours: [] + m_AnyStatePosition: {x: 50, y: 20, z: 0} + m_EntryPosition: {x: 50, y: 120, z: 0} + m_ExitPosition: {x: 800, y: 120, z: 0} + m_ParentStateMachinePosition: {x: 800, y: 20, z: 0} + m_DefaultState: {fileID: 542486197727019260} +--- !u!1101 &-7156134355841481533 +AnimatorStateTransition: + m_ObjectHideFlags: 1 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: + m_Conditions: [] + m_DstStateMachine: {fileID: 0} + m_DstState: {fileID: 542486197727019260} + m_Solo: 0 + m_Mute: 0 + m_IsExit: 0 + serializedVersion: 3 + m_TransitionDuration: 0 + m_TransitionOffset: 0 + m_ExitTime: 1 + m_HasExitTime: 1 + m_HasFixedDuration: 1 + m_InterruptionSource: 0 + m_OrderedInterruption: 1 + m_CanTransitionToSelf: 1 +--- !u!1101 &-6218460184888794421 +AnimatorStateTransition: + m_ObjectHideFlags: 1 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: + m_Conditions: [] + m_DstStateMachine: {fileID: 0} + m_DstState: {fileID: -7387446859746230137} + m_Solo: 0 + m_Mute: 0 + m_IsExit: 0 + serializedVersion: 3 + m_TransitionDuration: 0 + m_TransitionOffset: 0 + m_ExitTime: 1 + m_HasExitTime: 1 + m_HasFixedDuration: 1 + m_InterruptionSource: 0 + m_OrderedInterruption: 1 + m_CanTransitionToSelf: 1 +--- !u!91 &9100000 +AnimatorController: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: Fill Amount 1 + serializedVersion: 5 + m_AnimatorParameters: [] + m_AnimatorLayers: + - serializedVersion: 5 + m_Name: Base Layer + m_StateMachine: {fileID: -7264864826306982476} + m_Mask: {fileID: 0} + m_Motions: [] + m_Behaviours: [] + m_BlendingMode: 0 + m_SyncedLayerIndex: -1 + m_DefaultWeight: 0 + m_IKPass: 0 + m_SyncedLayerAffectsTiming: 0 + m_Controller: {fileID: 9100000} +--- !u!1102 &542486197727019260 +AnimatorState: + serializedVersion: 5 + m_ObjectHideFlags: 1 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: Teleport + m_Speed: 1 + m_CycleOffset: 0 + m_Transitions: + - {fileID: -6218460184888794421} + m_StateMachineBehaviours: [] + m_Position: {x: 50, y: 50, z: 0} + m_IKOnFeet: 0 + m_WriteDefaultValues: 1 + m_Mirror: 0 + m_SpeedParameterActive: 0 + m_MirrorParameterActive: 0 + m_CycleOffsetParameterActive: 0 + m_TimeParameterActive: 0 + m_Motion: {fileID: 7400000, guid: d55cd89bba47b6c4dbfe242daad46b9e, type: 2} + m_Tag: + m_SpeedParameter: + m_MirrorParameter: + m_CycleOffsetParameter: + m_TimeParameter: diff --git a/Assets/Plugins/AllIn1SpriteShader/Demo/Animation/Fill Amount 1.controller.meta b/Assets/Plugins/AllIn1SpriteShader/Demo/Animation/Fill Amount 1.controller.meta new file mode 100644 index 000000000..8336b1f46 --- /dev/null +++ b/Assets/Plugins/AllIn1SpriteShader/Demo/Animation/Fill Amount 1.controller.meta @@ -0,0 +1,15 @@ +fileFormatVersion: 2 +guid: 2cd3280111dab4e41ba2dd630db17ca4 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 9100000 + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 156513 + packageName: All In 1 Sprite Shader + packageVersion: 4.25 + assetPath: Assets/Plugins/AllIn1SpriteShader/Demo/Animation/Fill Amount 1.controller + uploadId: 708810 diff --git a/Assets/Plugins/AllIn1SpriteShader/Demo/Animation/Fill Amount.controller b/Assets/Plugins/AllIn1SpriteShader/Demo/Animation/Fill Amount.controller new file mode 100644 index 000000000..4199ee3b6 --- /dev/null +++ b/Assets/Plugins/AllIn1SpriteShader/Demo/Animation/Fill Amount.controller @@ -0,0 +1,72 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1102 &-8956218147619503351 +AnimatorState: + serializedVersion: 5 + m_ObjectHideFlags: 1 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: FillAmount + m_Speed: 1 + m_CycleOffset: 0 + m_Transitions: [] + m_StateMachineBehaviours: [] + m_Position: {x: 50, y: 50, z: 0} + m_IKOnFeet: 0 + m_WriteDefaultValues: 1 + m_Mirror: 0 + m_SpeedParameterActive: 0 + m_MirrorParameterActive: 0 + m_CycleOffsetParameterActive: 0 + m_TimeParameterActive: 0 + m_Motion: {fileID: 7400000, guid: 96ea5fb127ca6e34e8f61e91018c6e1b, type: 2} + m_Tag: + m_SpeedParameter: + m_MirrorParameter: + m_CycleOffsetParameter: + m_TimeParameter: +--- !u!1107 &-2648066226161793259 +AnimatorStateMachine: + serializedVersion: 5 + m_ObjectHideFlags: 1 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: Base Layer + m_ChildStates: + - serializedVersion: 1 + m_State: {fileID: -8956218147619503351} + m_Position: {x: 260, y: 60, z: 0} + m_ChildStateMachines: [] + m_AnyStateTransitions: [] + m_EntryTransitions: [] + m_StateMachineTransitions: {} + m_StateMachineBehaviours: [] + m_AnyStatePosition: {x: 50, y: 20, z: 0} + m_EntryPosition: {x: 50, y: 120, z: 0} + m_ExitPosition: {x: 800, y: 120, z: 0} + m_ParentStateMachinePosition: {x: 800, y: 20, z: 0} + m_DefaultState: {fileID: -8956218147619503351} +--- !u!91 &9100000 +AnimatorController: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: Fill Amount + serializedVersion: 5 + m_AnimatorParameters: [] + m_AnimatorLayers: + - serializedVersion: 5 + m_Name: Base Layer + m_StateMachine: {fileID: -2648066226161793259} + m_Mask: {fileID: 0} + m_Motions: [] + m_Behaviours: [] + m_BlendingMode: 0 + m_SyncedLayerIndex: -1 + m_DefaultWeight: 0 + m_IKPass: 0 + m_SyncedLayerAffectsTiming: 0 + m_Controller: {fileID: 9100000} diff --git a/Assets/Plugins/AllIn1SpriteShader/Demo/Animation/Fill Amount.controller.meta b/Assets/Plugins/AllIn1SpriteShader/Demo/Animation/Fill Amount.controller.meta new file mode 100644 index 000000000..f9dfb69e8 --- /dev/null +++ b/Assets/Plugins/AllIn1SpriteShader/Demo/Animation/Fill Amount.controller.meta @@ -0,0 +1,15 @@ +fileFormatVersion: 2 +guid: 6078cf4809fc6174f90700135dcf328f +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 9100000 + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 156513 + packageName: All In 1 Sprite Shader + packageVersion: 4.25 + assetPath: Assets/Plugins/AllIn1SpriteShader/Demo/Animation/Fill Amount.controller + uploadId: 708810 diff --git a/Assets/Plugins/AllIn1SpriteShader/Demo/Animation/FillAmount.anim b/Assets/Plugins/AllIn1SpriteShader/Demo/Animation/FillAmount.anim new file mode 100644 index 000000000..57c80d1da --- /dev/null +++ b/Assets/Plugins/AllIn1SpriteShader/Demo/Animation/FillAmount.anim @@ -0,0 +1,134 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!74 &7400000 +AnimationClip: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: FillAmount + serializedVersion: 6 + m_Legacy: 0 + m_Compressed: 0 + m_UseHighQualityCurve: 1 + m_RotationCurves: [] + m_CompressedRotationCurves: [] + m_EulerCurves: [] + m_PositionCurves: [] + m_ScaleCurves: [] + m_FloatCurves: + - curve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 0.44444445 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 0.8888889 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + attribute: material._ClipUvRight + path: + classID: 212 + script: {fileID: 0} + m_PPtrCurves: [] + m_SampleRate: 45 + m_WrapMode: 0 + m_Bounds: + m_Center: {x: 0, y: 0, z: 0} + m_Extent: {x: 0, y: 0, z: 0} + m_ClipBindingConstant: + genericBindings: + - serializedVersion: 2 + path: 0 + attribute: 2187639724 + script: {fileID: 0} + typeID: 212 + customType: 22 + isPPtrCurve: 0 + pptrCurveMapping: [] + m_AnimationClipSettings: + serializedVersion: 2 + m_AdditiveReferencePoseClip: {fileID: 0} + m_AdditiveReferencePoseTime: 0 + m_StartTime: 0 + m_StopTime: 0.8888889 + m_OrientationOffsetY: 0 + m_Level: 0 + m_CycleOffset: 0 + m_HasAdditiveReferencePose: 0 + m_LoopTime: 1 + m_LoopBlend: 0 + m_LoopBlendOrientation: 0 + m_LoopBlendPositionY: 0 + m_LoopBlendPositionXZ: 0 + m_KeepOriginalOrientation: 0 + m_KeepOriginalPositionY: 1 + m_KeepOriginalPositionXZ: 0 + m_HeightFromFeet: 0 + m_Mirror: 0 + m_EditorCurves: + - curve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 0.44444445 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 0.8888889 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + attribute: material._ClipUvRight + path: + classID: 212 + script: {fileID: 0} + m_EulerEditorCurves: [] + m_HasGenericRootTransform: 0 + m_HasMotionFloatCurves: 0 + m_Events: [] diff --git a/Assets/Plugins/AllIn1SpriteShader/Demo/Animation/FillAmount.anim.meta b/Assets/Plugins/AllIn1SpriteShader/Demo/Animation/FillAmount.anim.meta new file mode 100644 index 000000000..ccb446a2d --- /dev/null +++ b/Assets/Plugins/AllIn1SpriteShader/Demo/Animation/FillAmount.anim.meta @@ -0,0 +1,15 @@ +fileFormatVersion: 2 +guid: 96ea5fb127ca6e34e8f61e91018c6e1b +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 7400000 + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 156513 + packageName: All In 1 Sprite Shader + packageVersion: 4.25 + assetPath: Assets/Plugins/AllIn1SpriteShader/Demo/Animation/FillAmount.anim + uploadId: 708810 diff --git a/Assets/Plugins/AllIn1SpriteShader/Demo/Animation/Fish Eye.controller b/Assets/Plugins/AllIn1SpriteShader/Demo/Animation/Fish Eye.controller new file mode 100644 index 000000000..1f6111482 --- /dev/null +++ b/Assets/Plugins/AllIn1SpriteShader/Demo/Animation/Fish Eye.controller @@ -0,0 +1,101 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1107 &-1965812634030799034 +AnimatorStateMachine: + serializedVersion: 5 + m_ObjectHideFlags: 1 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: Base Layer + m_ChildStates: + - serializedVersion: 1 + m_State: {fileID: 7173216993388856439} + m_Position: {x: 200, y: 0, z: 0} + - serializedVersion: 1 + m_State: {fileID: 1102029001882399030} + m_Position: {x: 235, y: 65, z: 0} + m_ChildStateMachines: [] + m_AnyStateTransitions: [] + m_EntryTransitions: [] + m_StateMachineTransitions: {} + m_StateMachineBehaviours: [] + m_AnyStatePosition: {x: 50, y: 20, z: 0} + m_EntryPosition: {x: 50, y: 120, z: 0} + m_ExitPosition: {x: 800, y: 120, z: 0} + m_ParentStateMachinePosition: {x: 800, y: 20, z: 0} + m_DefaultState: {fileID: 7173216993388856439} +--- !u!91 &9100000 +AnimatorController: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: Fish Eye + serializedVersion: 5 + m_AnimatorParameters: [] + m_AnimatorLayers: + - serializedVersion: 5 + m_Name: Base Layer + m_StateMachine: {fileID: -1965812634030799034} + m_Mask: {fileID: 0} + m_Motions: [] + m_Behaviours: [] + m_BlendingMode: 0 + m_SyncedLayerIndex: -1 + m_DefaultWeight: 0 + m_IKPass: 0 + m_SyncedLayerAffectsTiming: 0 + m_Controller: {fileID: 9100000} +--- !u!1102 &1102029001882399030 +AnimatorState: + serializedVersion: 5 + m_ObjectHideFlags: 1 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: CustomGradient + m_Speed: 1 + m_CycleOffset: 0 + m_Transitions: [] + m_StateMachineBehaviours: [] + m_Position: {x: 50, y: 50, z: 0} + m_IKOnFeet: 0 + m_WriteDefaultValues: 1 + m_Mirror: 0 + m_SpeedParameterActive: 0 + m_MirrorParameterActive: 0 + m_CycleOffsetParameterActive: 0 + m_TimeParameterActive: 0 + m_Motion: {fileID: 7400000, guid: 7f6e7a4a06cb0ed46bed4c808d5ef0fc, type: 2} + m_Tag: + m_SpeedParameter: + m_MirrorParameter: + m_CycleOffsetParameter: + m_TimeParameter: +--- !u!1102 &7173216993388856439 +AnimatorState: + serializedVersion: 5 + m_ObjectHideFlags: 1 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: Hallucination + m_Speed: 1 + m_CycleOffset: 0 + m_Transitions: [] + m_StateMachineBehaviours: [] + m_Position: {x: 50, y: 50, z: 0} + m_IKOnFeet: 0 + m_WriteDefaultValues: 1 + m_Mirror: 0 + m_SpeedParameterActive: 0 + m_MirrorParameterActive: 0 + m_CycleOffsetParameterActive: 0 + m_TimeParameterActive: 0 + m_Motion: {fileID: 7400000, guid: 8186e6a2d59204e4283c29e5abfedb85, type: 2} + m_Tag: + m_SpeedParameter: + m_MirrorParameter: + m_CycleOffsetParameter: + m_TimeParameter: diff --git a/Assets/Plugins/AllIn1SpriteShader/Demo/Animation/Fish Eye.controller.meta b/Assets/Plugins/AllIn1SpriteShader/Demo/Animation/Fish Eye.controller.meta new file mode 100644 index 000000000..2c88f5395 --- /dev/null +++ b/Assets/Plugins/AllIn1SpriteShader/Demo/Animation/Fish Eye.controller.meta @@ -0,0 +1,15 @@ +fileFormatVersion: 2 +guid: 009a1cbada3894e4387ecb3a8a39e335 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 9100000 + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 156513 + packageName: All In 1 Sprite Shader + packageVersion: 4.25 + assetPath: Assets/Plugins/AllIn1SpriteShader/Demo/Animation/Fish Eye.controller + uploadId: 708810 diff --git a/Assets/Plugins/AllIn1SpriteShader/Demo/Animation/Frame.controller b/Assets/Plugins/AllIn1SpriteShader/Demo/Animation/Frame.controller new file mode 100644 index 000000000..87ba4681a --- /dev/null +++ b/Assets/Plugins/AllIn1SpriteShader/Demo/Animation/Frame.controller @@ -0,0 +1,72 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1102 &-9028953883465965845 +AnimatorState: + serializedVersion: 5 + m_ObjectHideFlags: 1 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: hpBar + m_Speed: 1 + m_CycleOffset: 0 + m_Transitions: [] + m_StateMachineBehaviours: [] + m_Position: {x: 50, y: 50, z: 0} + m_IKOnFeet: 0 + m_WriteDefaultValues: 1 + m_Mirror: 0 + m_SpeedParameterActive: 0 + m_MirrorParameterActive: 0 + m_CycleOffsetParameterActive: 0 + m_TimeParameterActive: 0 + m_Motion: {fileID: 7400000, guid: 6183fddabf104ce47abe341327074864, type: 2} + m_Tag: + m_SpeedParameter: + m_MirrorParameter: + m_CycleOffsetParameter: + m_TimeParameter: +--- !u!1107 &-8663805930458218728 +AnimatorStateMachine: + serializedVersion: 5 + m_ObjectHideFlags: 1 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: Base Layer + m_ChildStates: + - serializedVersion: 1 + m_State: {fileID: -9028953883465965845} + m_Position: {x: 200, y: 0, z: 0} + m_ChildStateMachines: [] + m_AnyStateTransitions: [] + m_EntryTransitions: [] + m_StateMachineTransitions: {} + m_StateMachineBehaviours: [] + m_AnyStatePosition: {x: 50, y: 20, z: 0} + m_EntryPosition: {x: 50, y: 120, z: 0} + m_ExitPosition: {x: 800, y: 120, z: 0} + m_ParentStateMachinePosition: {x: 800, y: 20, z: 0} + m_DefaultState: {fileID: -9028953883465965845} +--- !u!91 &9100000 +AnimatorController: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: Frame + serializedVersion: 5 + m_AnimatorParameters: [] + m_AnimatorLayers: + - serializedVersion: 5 + m_Name: Base Layer + m_StateMachine: {fileID: -8663805930458218728} + m_Mask: {fileID: 0} + m_Motions: [] + m_Behaviours: [] + m_BlendingMode: 0 + m_SyncedLayerIndex: -1 + m_DefaultWeight: 0 + m_IKPass: 0 + m_SyncedLayerAffectsTiming: 0 + m_Controller: {fileID: 9100000} diff --git a/Assets/Plugins/AllIn1SpriteShader/Demo/Animation/Frame.controller.meta b/Assets/Plugins/AllIn1SpriteShader/Demo/Animation/Frame.controller.meta new file mode 100644 index 000000000..ac01961f5 --- /dev/null +++ b/Assets/Plugins/AllIn1SpriteShader/Demo/Animation/Frame.controller.meta @@ -0,0 +1,15 @@ +fileFormatVersion: 2 +guid: f36bce3b3e7e3c5488117e16e426deb5 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 9100000 + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 156513 + packageName: All In 1 Sprite Shader + packageVersion: 4.25 + assetPath: Assets/Plugins/AllIn1SpriteShader/Demo/Animation/Frame.controller + uploadId: 708810 diff --git a/Assets/Plugins/AllIn1SpriteShader/Demo/Animation/Hallucination.anim b/Assets/Plugins/AllIn1SpriteShader/Demo/Animation/Hallucination.anim new file mode 100644 index 000000000..71da56f2c --- /dev/null +++ b/Assets/Plugins/AllIn1SpriteShader/Demo/Animation/Hallucination.anim @@ -0,0 +1,134 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!74 &7400000 +AnimationClip: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: Hallucination + serializedVersion: 6 + m_Legacy: 0 + m_Compressed: 0 + m_UseHighQualityCurve: 1 + m_RotationCurves: [] + m_CompressedRotationCurves: [] + m_EulerCurves: [] + m_PositionCurves: [] + m_ScaleCurves: [] + m_FloatCurves: + - curve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 0.7777778 + value: 360 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1.5555556 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + attribute: material._HsvShift + path: + classID: 212 + script: {fileID: 0} + m_PPtrCurves: [] + m_SampleRate: 45 + m_WrapMode: 0 + m_Bounds: + m_Center: {x: 0, y: 0, z: 0} + m_Extent: {x: 0, y: 0, z: 0} + m_ClipBindingConstant: + genericBindings: + - serializedVersion: 2 + path: 0 + attribute: 2206827623 + script: {fileID: 0} + typeID: 212 + customType: 22 + isPPtrCurve: 0 + pptrCurveMapping: [] + m_AnimationClipSettings: + serializedVersion: 2 + m_AdditiveReferencePoseClip: {fileID: 0} + m_AdditiveReferencePoseTime: 0 + m_StartTime: 0 + m_StopTime: 1.5555556 + m_OrientationOffsetY: 0 + m_Level: 0 + m_CycleOffset: 0 + m_HasAdditiveReferencePose: 0 + m_LoopTime: 1 + m_LoopBlend: 0 + m_LoopBlendOrientation: 0 + m_LoopBlendPositionY: 0 + m_LoopBlendPositionXZ: 0 + m_KeepOriginalOrientation: 0 + m_KeepOriginalPositionY: 1 + m_KeepOriginalPositionXZ: 0 + m_HeightFromFeet: 0 + m_Mirror: 0 + m_EditorCurves: + - curve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 0.7777778 + value: 360 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1.5555556 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + attribute: material._HsvShift + path: + classID: 212 + script: {fileID: 0} + m_EulerEditorCurves: [] + m_HasGenericRootTransform: 0 + m_HasMotionFloatCurves: 0 + m_Events: [] diff --git a/Assets/Plugins/AllIn1SpriteShader/Demo/Animation/Hallucination.anim.meta b/Assets/Plugins/AllIn1SpriteShader/Demo/Animation/Hallucination.anim.meta new file mode 100644 index 000000000..f3bc08fed --- /dev/null +++ b/Assets/Plugins/AllIn1SpriteShader/Demo/Animation/Hallucination.anim.meta @@ -0,0 +1,15 @@ +fileFormatVersion: 2 +guid: 8186e6a2d59204e4283c29e5abfedb85 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 7400000 + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 156513 + packageName: All In 1 Sprite Shader + packageVersion: 4.25 + assetPath: Assets/Plugins/AllIn1SpriteShader/Demo/Animation/Hallucination.anim + uploadId: 708810 diff --git a/Assets/Plugins/AllIn1SpriteShader/Demo/Animation/Hit Effect 1.controller b/Assets/Plugins/AllIn1SpriteShader/Demo/Animation/Hit Effect 1.controller new file mode 100644 index 000000000..4a6490eb7 --- /dev/null +++ b/Assets/Plugins/AllIn1SpriteShader/Demo/Animation/Hit Effect 1.controller @@ -0,0 +1,72 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1107 &-3029259370103312344 +AnimatorStateMachine: + serializedVersion: 5 + m_ObjectHideFlags: 1 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: Base Layer + m_ChildStates: + - serializedVersion: 1 + m_State: {fileID: 1169743166369495606} + m_Position: {x: 200, y: 0, z: 0} + m_ChildStateMachines: [] + m_AnyStateTransitions: [] + m_EntryTransitions: [] + m_StateMachineTransitions: {} + m_StateMachineBehaviours: [] + m_AnyStatePosition: {x: 50, y: 20, z: 0} + m_EntryPosition: {x: 50, y: 120, z: 0} + m_ExitPosition: {x: 800, y: 120, z: 0} + m_ParentStateMachinePosition: {x: 800, y: 20, z: 0} + m_DefaultState: {fileID: 1169743166369495606} +--- !u!91 &9100000 +AnimatorController: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: Hit Effect 1 + serializedVersion: 5 + m_AnimatorParameters: [] + m_AnimatorLayers: + - serializedVersion: 5 + m_Name: Base Layer + m_StateMachine: {fileID: -3029259370103312344} + m_Mask: {fileID: 0} + m_Motions: [] + m_Behaviours: [] + m_BlendingMode: 0 + m_SyncedLayerIndex: -1 + m_DefaultWeight: 0 + m_IKPass: 0 + m_SyncedLayerAffectsTiming: 0 + m_Controller: {fileID: 9100000} +--- !u!1102 &1169743166369495606 +AnimatorState: + serializedVersion: 5 + m_ObjectHideFlags: 1 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: Rotate + m_Speed: 1 + m_CycleOffset: 0 + m_Transitions: [] + m_StateMachineBehaviours: [] + m_Position: {x: 50, y: 50, z: 0} + m_IKOnFeet: 0 + m_WriteDefaultValues: 1 + m_Mirror: 0 + m_SpeedParameterActive: 0 + m_MirrorParameterActive: 0 + m_CycleOffsetParameterActive: 0 + m_TimeParameterActive: 0 + m_Motion: {fileID: 7400000, guid: a3c9d77a6b2549c4d8ae31057eca0fc9, type: 2} + m_Tag: + m_SpeedParameter: + m_MirrorParameter: + m_CycleOffsetParameter: + m_TimeParameter: diff --git a/Assets/Plugins/AllIn1SpriteShader/Demo/Animation/Hit Effect 1.controller.meta b/Assets/Plugins/AllIn1SpriteShader/Demo/Animation/Hit Effect 1.controller.meta new file mode 100644 index 000000000..1a4068d22 --- /dev/null +++ b/Assets/Plugins/AllIn1SpriteShader/Demo/Animation/Hit Effect 1.controller.meta @@ -0,0 +1,15 @@ +fileFormatVersion: 2 +guid: 1cc6e3c6540cce34bb2f509398f90917 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 9100000 + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 156513 + packageName: All In 1 Sprite Shader + packageVersion: 4.25 + assetPath: Assets/Plugins/AllIn1SpriteShader/Demo/Animation/Hit Effect 1.controller + uploadId: 708810 diff --git a/Assets/Plugins/AllIn1SpriteShader/Demo/Animation/Hit Effect.controller b/Assets/Plugins/AllIn1SpriteShader/Demo/Animation/Hit Effect.controller new file mode 100644 index 000000000..61fc3e399 --- /dev/null +++ b/Assets/Plugins/AllIn1SpriteShader/Demo/Animation/Hit Effect.controller @@ -0,0 +1,72 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1102 &-5913550154835270090 +AnimatorState: + serializedVersion: 5 + m_ObjectHideFlags: 1 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: HitEffect + m_Speed: 1 + m_CycleOffset: 0 + m_Transitions: [] + m_StateMachineBehaviours: [] + m_Position: {x: 50, y: 50, z: 0} + m_IKOnFeet: 0 + m_WriteDefaultValues: 1 + m_Mirror: 0 + m_SpeedParameterActive: 0 + m_MirrorParameterActive: 0 + m_CycleOffsetParameterActive: 0 + m_TimeParameterActive: 0 + m_Motion: {fileID: 7400000, guid: 769de38e4feb31b429ee5eb7b5bece71, type: 2} + m_Tag: + m_SpeedParameter: + m_MirrorParameter: + m_CycleOffsetParameter: + m_TimeParameter: +--- !u!91 &9100000 +AnimatorController: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: Hit Effect + serializedVersion: 5 + m_AnimatorParameters: [] + m_AnimatorLayers: + - serializedVersion: 5 + m_Name: Base Layer + m_StateMachine: {fileID: 4195058999054830920} + m_Mask: {fileID: 0} + m_Motions: [] + m_Behaviours: [] + m_BlendingMode: 0 + m_SyncedLayerIndex: -1 + m_DefaultWeight: 0 + m_IKPass: 0 + m_SyncedLayerAffectsTiming: 0 + m_Controller: {fileID: 9100000} +--- !u!1107 &4195058999054830920 +AnimatorStateMachine: + serializedVersion: 5 + m_ObjectHideFlags: 1 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: Base Layer + m_ChildStates: + - serializedVersion: 1 + m_State: {fileID: -5913550154835270090} + m_Position: {x: 200, y: 0, z: 0} + m_ChildStateMachines: [] + m_AnyStateTransitions: [] + m_EntryTransitions: [] + m_StateMachineTransitions: {} + m_StateMachineBehaviours: [] + m_AnyStatePosition: {x: 50, y: 20, z: 0} + m_EntryPosition: {x: 50, y: 120, z: 0} + m_ExitPosition: {x: 800, y: 120, z: 0} + m_ParentStateMachinePosition: {x: 800, y: 20, z: 0} + m_DefaultState: {fileID: -5913550154835270090} diff --git a/Assets/Plugins/AllIn1SpriteShader/Demo/Animation/Hit Effect.controller.meta b/Assets/Plugins/AllIn1SpriteShader/Demo/Animation/Hit Effect.controller.meta new file mode 100644 index 000000000..5b78f4513 --- /dev/null +++ b/Assets/Plugins/AllIn1SpriteShader/Demo/Animation/Hit Effect.controller.meta @@ -0,0 +1,15 @@ +fileFormatVersion: 2 +guid: c6e411a605ec50345a36bbab9d3cc722 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 9100000 + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 156513 + packageName: All In 1 Sprite Shader + packageVersion: 4.25 + assetPath: Assets/Plugins/AllIn1SpriteShader/Demo/Animation/Hit Effect.controller + uploadId: 708810 diff --git a/Assets/Plugins/AllIn1SpriteShader/Demo/Animation/HitEffect.anim b/Assets/Plugins/AllIn1SpriteShader/Demo/Animation/HitEffect.anim new file mode 100644 index 000000000..c3316c026 --- /dev/null +++ b/Assets/Plugins/AllIn1SpriteShader/Demo/Animation/HitEffect.anim @@ -0,0 +1,134 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!74 &7400000 +AnimationClip: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: HitEffect + serializedVersion: 6 + m_Legacy: 0 + m_Compressed: 0 + m_UseHighQualityCurve: 1 + m_RotationCurves: [] + m_CompressedRotationCurves: [] + m_EulerCurves: [] + m_PositionCurves: [] + m_ScaleCurves: [] + m_FloatCurves: + - curve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 0.33333334 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 0.6666667 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + attribute: material._HitEffectBlend + path: + classID: 212 + script: {fileID: 0} + m_PPtrCurves: [] + m_SampleRate: 60 + m_WrapMode: 0 + m_Bounds: + m_Center: {x: 0, y: 0, z: 0} + m_Extent: {x: 0, y: 0, z: 0} + m_ClipBindingConstant: + genericBindings: + - serializedVersion: 2 + path: 0 + attribute: 2333048903 + script: {fileID: 0} + typeID: 212 + customType: 22 + isPPtrCurve: 0 + pptrCurveMapping: [] + m_AnimationClipSettings: + serializedVersion: 2 + m_AdditiveReferencePoseClip: {fileID: 0} + m_AdditiveReferencePoseTime: 0 + m_StartTime: 0 + m_StopTime: 0.6666667 + m_OrientationOffsetY: 0 + m_Level: 0 + m_CycleOffset: 0 + m_HasAdditiveReferencePose: 0 + m_LoopTime: 1 + m_LoopBlend: 0 + m_LoopBlendOrientation: 0 + m_LoopBlendPositionY: 0 + m_LoopBlendPositionXZ: 0 + m_KeepOriginalOrientation: 0 + m_KeepOriginalPositionY: 1 + m_KeepOriginalPositionXZ: 0 + m_HeightFromFeet: 0 + m_Mirror: 0 + m_EditorCurves: + - curve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 0.33333334 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 0.6666667 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + attribute: material._HitEffectBlend + path: + classID: 212 + script: {fileID: 0} + m_EulerEditorCurves: [] + m_HasGenericRootTransform: 0 + m_HasMotionFloatCurves: 0 + m_Events: [] diff --git a/Assets/Plugins/AllIn1SpriteShader/Demo/Animation/HitEffect.anim.meta b/Assets/Plugins/AllIn1SpriteShader/Demo/Animation/HitEffect.anim.meta new file mode 100644 index 000000000..51391cef4 --- /dev/null +++ b/Assets/Plugins/AllIn1SpriteShader/Demo/Animation/HitEffect.anim.meta @@ -0,0 +1,15 @@ +fileFormatVersion: 2 +guid: 769de38e4feb31b429ee5eb7b5bece71 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 7400000 + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 156513 + packageName: All In 1 Sprite Shader + packageVersion: 4.25 + assetPath: Assets/Plugins/AllIn1SpriteShader/Demo/Animation/HitEffect.anim + uploadId: 708810 diff --git a/Assets/Plugins/AllIn1SpriteShader/Demo/Animation/Hologram.anim b/Assets/Plugins/AllIn1SpriteShader/Demo/Animation/Hologram.anim new file mode 100644 index 000000000..9c6607c01 --- /dev/null +++ b/Assets/Plugins/AllIn1SpriteShader/Demo/Animation/Hologram.anim @@ -0,0 +1,323 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!74 &7400000 +AnimationClip: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: Hologram + serializedVersion: 6 + m_Legacy: 0 + m_Compressed: 0 + m_UseHighQualityCurve: 1 + m_RotationCurves: [] + m_CompressedRotationCurves: [] + m_EulerCurves: [] + m_PositionCurves: [] + m_ScaleCurves: [] + m_FloatCurves: + - curve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 0.33333334 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 0.5 + value: 0.613 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 0.6666667 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1.3333334 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1.45 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1.5833334 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + attribute: material._ChromAberrAmount + path: + classID: 212 + script: {fileID: 0} + - curve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0.4 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 0.5 + value: 0.359 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1.3333334 + value: 0.359 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1.45 + value: 0.35901853 + inSlope: 0.0002965927 + outSlope: 0.0002965927 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1.5833334 + value: 0.37623176 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + attribute: material._ChromAberrAlpha + path: + classID: 212 + script: {fileID: 0} + m_PPtrCurves: [] + m_SampleRate: 60 + m_WrapMode: 0 + m_Bounds: + m_Center: {x: 0, y: 0, z: 0} + m_Extent: {x: 0, y: 0, z: 0} + m_ClipBindingConstant: + genericBindings: + - serializedVersion: 2 + path: 0 + attribute: 2187965785 + script: {fileID: 0} + typeID: 212 + customType: 22 + isPPtrCurve: 0 + - serializedVersion: 2 + path: 0 + attribute: 2229035585 + script: {fileID: 0} + typeID: 212 + customType: 22 + isPPtrCurve: 0 + pptrCurveMapping: [] + m_AnimationClipSettings: + serializedVersion: 2 + m_AdditiveReferencePoseClip: {fileID: 0} + m_AdditiveReferencePoseTime: 0 + m_StartTime: 0 + m_StopTime: 1.5833334 + m_OrientationOffsetY: 0 + m_Level: 0 + m_CycleOffset: 0 + m_HasAdditiveReferencePose: 0 + m_LoopTime: 1 + m_LoopBlend: 0 + m_LoopBlendOrientation: 0 + m_LoopBlendPositionY: 0 + m_LoopBlendPositionXZ: 0 + m_KeepOriginalOrientation: 0 + m_KeepOriginalPositionY: 1 + m_KeepOriginalPositionXZ: 0 + m_HeightFromFeet: 0 + m_Mirror: 0 + m_EditorCurves: + - curve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 0.33333334 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 0.5 + value: 0.613 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 0.6666667 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1.3333334 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1.45 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1.5833334 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + attribute: material._ChromAberrAmount + path: + classID: 212 + script: {fileID: 0} + - curve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0.4 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 0.5 + value: 0.359 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1.3333334 + value: 0.359 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1.45 + value: 0.35901853 + inSlope: 0.0002965927 + outSlope: 0.0002965927 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1.5833334 + value: 0.37623176 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + attribute: material._ChromAberrAlpha + path: + classID: 212 + script: {fileID: 0} + m_EulerEditorCurves: [] + m_HasGenericRootTransform: 0 + m_HasMotionFloatCurves: 0 + m_Events: [] diff --git a/Assets/Plugins/AllIn1SpriteShader/Demo/Animation/Hologram.anim.meta b/Assets/Plugins/AllIn1SpriteShader/Demo/Animation/Hologram.anim.meta new file mode 100644 index 000000000..e982fcdc5 --- /dev/null +++ b/Assets/Plugins/AllIn1SpriteShader/Demo/Animation/Hologram.anim.meta @@ -0,0 +1,15 @@ +fileFormatVersion: 2 +guid: 2d06614560bbcda488c23b8708ff4c49 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 7400000 + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 156513 + packageName: All In 1 Sprite Shader + packageVersion: 4.25 + assetPath: Assets/Plugins/AllIn1SpriteShader/Demo/Animation/Hologram.anim + uploadId: 708810 diff --git a/Assets/Plugins/AllIn1SpriteShader/Demo/Animation/IceSoldier.anim b/Assets/Plugins/AllIn1SpriteShader/Demo/Animation/IceSoldier.anim new file mode 100644 index 000000000..a9ac44955 --- /dev/null +++ b/Assets/Plugins/AllIn1SpriteShader/Demo/Animation/IceSoldier.anim @@ -0,0 +1,278 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!74 &7400000 +AnimationClip: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: IceSoldier + serializedVersion: 6 + m_Legacy: 0 + m_Compressed: 0 + m_UseHighQualityCurve: 1 + m_RotationCurves: [] + m_CompressedRotationCurves: [] + m_EulerCurves: [] + m_PositionCurves: [] + m_ScaleCurves: [] + m_FloatCurves: + - curve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1.6 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 0.16666667 + value: 0.6 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 3 + value: 0.6 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + attribute: material._Glow + path: Ice + classID: 212 + script: {fileID: 0} + - curve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: -0.1 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 2.75 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + attribute: material._FadeAmount + path: Ice + classID: 212 + script: {fileID: 0} + - curve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: Infinity + outSlope: Infinity + tangentMode: 103 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: Infinity + outSlope: Infinity + tangentMode: 103 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + - serializedVersion: 3 + time: 3 + value: 0 + inSlope: Infinity + outSlope: Infinity + tangentMode: 103 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + attribute: m_IsActive + path: SnowFlakesPS + classID: 1 + script: {fileID: 0} + m_PPtrCurves: [] + m_SampleRate: 60 + m_WrapMode: 0 + m_Bounds: + m_Center: {x: 0, y: 0, z: 0} + m_Extent: {x: 0, y: 0, z: 0} + m_ClipBindingConstant: + genericBindings: + - serializedVersion: 2 + path: 4077044462 + attribute: 2271964720 + script: {fileID: 0} + typeID: 212 + customType: 22 + isPPtrCurve: 0 + - serializedVersion: 2 + path: 4077044462 + attribute: 2375902170 + script: {fileID: 0} + typeID: 212 + customType: 22 + isPPtrCurve: 0 + - serializedVersion: 2 + path: 444922166 + attribute: 2086281974 + script: {fileID: 0} + typeID: 1 + customType: 0 + isPPtrCurve: 0 + pptrCurveMapping: [] + m_AnimationClipSettings: + serializedVersion: 2 + m_AdditiveReferencePoseClip: {fileID: 0} + m_AdditiveReferencePoseTime: 0 + m_StartTime: 0 + m_StopTime: 3 + m_OrientationOffsetY: 0 + m_Level: 0 + m_CycleOffset: 0 + m_HasAdditiveReferencePose: 0 + m_LoopTime: 1 + m_LoopBlend: 0 + m_LoopBlendOrientation: 0 + m_LoopBlendPositionY: 0 + m_LoopBlendPositionXZ: 0 + m_KeepOriginalOrientation: 0 + m_KeepOriginalPositionY: 1 + m_KeepOriginalPositionXZ: 0 + m_HeightFromFeet: 0 + m_Mirror: 0 + m_EditorCurves: + - curve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1.6 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 0.16666667 + value: 0.6 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 3 + value: 0.6 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + attribute: material._Glow + path: Ice + classID: 212 + script: {fileID: 0} + - curve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: -0.1 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 2.75 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + attribute: material._FadeAmount + path: Ice + classID: 212 + script: {fileID: 0} + - curve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: Infinity + outSlope: Infinity + tangentMode: 103 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: Infinity + outSlope: Infinity + tangentMode: 103 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + - serializedVersion: 3 + time: 3 + value: 0 + inSlope: Infinity + outSlope: Infinity + tangentMode: 103 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + attribute: m_IsActive + path: SnowFlakesPS + classID: 1 + script: {fileID: 0} + m_EulerEditorCurves: [] + m_HasGenericRootTransform: 0 + m_HasMotionFloatCurves: 0 + m_Events: [] diff --git a/Assets/Plugins/AllIn1SpriteShader/Demo/Animation/IceSoldier.anim.meta b/Assets/Plugins/AllIn1SpriteShader/Demo/Animation/IceSoldier.anim.meta new file mode 100644 index 000000000..f99f40b04 --- /dev/null +++ b/Assets/Plugins/AllIn1SpriteShader/Demo/Animation/IceSoldier.anim.meta @@ -0,0 +1,15 @@ +fileFormatVersion: 2 +guid: f8f2d0809b870954c850e5004e9b4f67 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 7400000 + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 156513 + packageName: All In 1 Sprite Shader + packageVersion: 4.25 + assetPath: Assets/Plugins/AllIn1SpriteShader/Demo/Animation/IceSoldier.anim + uploadId: 708810 diff --git a/Assets/Plugins/AllIn1SpriteShader/Demo/Animation/IceSoldier.controller b/Assets/Plugins/AllIn1SpriteShader/Demo/Animation/IceSoldier.controller new file mode 100644 index 000000000..302853e1f --- /dev/null +++ b/Assets/Plugins/AllIn1SpriteShader/Demo/Animation/IceSoldier.controller @@ -0,0 +1,72 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1107 &-1136635573635380662 +AnimatorStateMachine: + serializedVersion: 5 + m_ObjectHideFlags: 1 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: Base Layer + m_ChildStates: + - serializedVersion: 1 + m_State: {fileID: 7920773727163540604} + m_Position: {x: 200, y: 0, z: 0} + m_ChildStateMachines: [] + m_AnyStateTransitions: [] + m_EntryTransitions: [] + m_StateMachineTransitions: {} + m_StateMachineBehaviours: [] + m_AnyStatePosition: {x: 50, y: 20, z: 0} + m_EntryPosition: {x: 50, y: 120, z: 0} + m_ExitPosition: {x: 800, y: 120, z: 0} + m_ParentStateMachinePosition: {x: 800, y: 20, z: 0} + m_DefaultState: {fileID: 7920773727163540604} +--- !u!91 &9100000 +AnimatorController: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: IceSoldier + serializedVersion: 5 + m_AnimatorParameters: [] + m_AnimatorLayers: + - serializedVersion: 5 + m_Name: Base Layer + m_StateMachine: {fileID: -1136635573635380662} + m_Mask: {fileID: 0} + m_Motions: [] + m_Behaviours: [] + m_BlendingMode: 0 + m_SyncedLayerIndex: -1 + m_DefaultWeight: 0 + m_IKPass: 0 + m_SyncedLayerAffectsTiming: 0 + m_Controller: {fileID: 9100000} +--- !u!1102 &7920773727163540604 +AnimatorState: + serializedVersion: 5 + m_ObjectHideFlags: 1 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: IceSoldier + m_Speed: 1 + m_CycleOffset: 0 + m_Transitions: [] + m_StateMachineBehaviours: [] + m_Position: {x: 50, y: 50, z: 0} + m_IKOnFeet: 0 + m_WriteDefaultValues: 1 + m_Mirror: 0 + m_SpeedParameterActive: 0 + m_MirrorParameterActive: 0 + m_CycleOffsetParameterActive: 0 + m_TimeParameterActive: 0 + m_Motion: {fileID: 7400000, guid: f8f2d0809b870954c850e5004e9b4f67, type: 2} + m_Tag: + m_SpeedParameter: + m_MirrorParameter: + m_CycleOffsetParameter: + m_TimeParameter: diff --git a/Assets/Plugins/AllIn1SpriteShader/Demo/Animation/IceSoldier.controller.meta b/Assets/Plugins/AllIn1SpriteShader/Demo/Animation/IceSoldier.controller.meta new file mode 100644 index 000000000..4743a7270 --- /dev/null +++ b/Assets/Plugins/AllIn1SpriteShader/Demo/Animation/IceSoldier.controller.meta @@ -0,0 +1,15 @@ +fileFormatVersion: 2 +guid: c2df20f2d12e21b46bacd5dfa839b92e +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 9100000 + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 156513 + packageName: All In 1 Sprite Shader + packageVersion: 4.25 + assetPath: Assets/Plugins/AllIn1SpriteShader/Demo/Animation/IceSoldier.controller + uploadId: 708810 diff --git a/Assets/Plugins/AllIn1SpriteShader/Demo/Animation/Impact.controller b/Assets/Plugins/AllIn1SpriteShader/Demo/Animation/Impact.controller new file mode 100644 index 000000000..4dd9e9ea7 --- /dev/null +++ b/Assets/Plugins/AllIn1SpriteShader/Demo/Animation/Impact.controller @@ -0,0 +1,72 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!91 &9100000 +AnimatorController: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: Impact + serializedVersion: 5 + m_AnimatorParameters: [] + m_AnimatorLayers: + - serializedVersion: 5 + m_Name: Base Layer + m_StateMachine: {fileID: 2011205658823687596} + m_Mask: {fileID: 0} + m_Motions: [] + m_Behaviours: [] + m_BlendingMode: 0 + m_SyncedLayerIndex: -1 + m_DefaultWeight: 0 + m_IKPass: 0 + m_SyncedLayerAffectsTiming: 0 + m_Controller: {fileID: 9100000} +--- !u!1107 &2011205658823687596 +AnimatorStateMachine: + serializedVersion: 5 + m_ObjectHideFlags: 1 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: Base Layer + m_ChildStates: + - serializedVersion: 1 + m_State: {fileID: 2695582658214874718} + m_Position: {x: 200, y: 0, z: 0} + m_ChildStateMachines: [] + m_AnyStateTransitions: [] + m_EntryTransitions: [] + m_StateMachineTransitions: {} + m_StateMachineBehaviours: [] + m_AnyStatePosition: {x: 50, y: 20, z: 0} + m_EntryPosition: {x: 50, y: 120, z: 0} + m_ExitPosition: {x: 800, y: 120, z: 0} + m_ParentStateMachinePosition: {x: 800, y: 20, z: 0} + m_DefaultState: {fileID: 2695582658214874718} +--- !u!1102 &2695582658214874718 +AnimatorState: + serializedVersion: 5 + m_ObjectHideFlags: 1 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: Impact1 + m_Speed: 1 + m_CycleOffset: 0 + m_Transitions: [] + m_StateMachineBehaviours: [] + m_Position: {x: 50, y: 50, z: 0} + m_IKOnFeet: 0 + m_WriteDefaultValues: 1 + m_Mirror: 0 + m_SpeedParameterActive: 0 + m_MirrorParameterActive: 0 + m_CycleOffsetParameterActive: 0 + m_TimeParameterActive: 0 + m_Motion: {fileID: 7400000, guid: b4a017fddcef25548ad4089f01c9da55, type: 2} + m_Tag: + m_SpeedParameter: + m_MirrorParameter: + m_CycleOffsetParameter: + m_TimeParameter: diff --git a/Assets/Plugins/AllIn1SpriteShader/Demo/Animation/Impact.controller.meta b/Assets/Plugins/AllIn1SpriteShader/Demo/Animation/Impact.controller.meta new file mode 100644 index 000000000..edac2a769 --- /dev/null +++ b/Assets/Plugins/AllIn1SpriteShader/Demo/Animation/Impact.controller.meta @@ -0,0 +1,15 @@ +fileFormatVersion: 2 +guid: a1097444efe6cb54f86e2955982c0fe1 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 9100000 + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 156513 + packageName: All In 1 Sprite Shader + packageVersion: 4.25 + assetPath: Assets/Plugins/AllIn1SpriteShader/Demo/Animation/Impact.controller + uploadId: 708810 diff --git a/Assets/Plugins/AllIn1SpriteShader/Demo/Animation/Impact1.anim b/Assets/Plugins/AllIn1SpriteShader/Demo/Animation/Impact1.anim new file mode 100644 index 000000000..3c766ec6c --- /dev/null +++ b/Assets/Plugins/AllIn1SpriteShader/Demo/Animation/Impact1.anim @@ -0,0 +1,737 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!74 &7400000 +AnimationClip: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: Impact1 + serializedVersion: 6 + m_Legacy: 0 + m_Compressed: 0 + m_UseHighQualityCurve: 1 + m_RotationCurves: [] + m_CompressedRotationCurves: [] + m_EulerCurves: [] + m_PositionCurves: [] + m_ScaleCurves: [] + m_FloatCurves: + - curve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 0.5 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 0.51666665 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 0.5833333 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + attribute: material._ChromAberrAmount + path: + classID: 212 + script: {fileID: 0} + - curve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 0.5 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 0.51666665 + value: 0.245 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 0.5833333 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + attribute: material._FishEyeUvAmount + path: + classID: 212 + script: {fileID: 0} + - curve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 0.5 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 0.51666665 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 0.5833333 + value: 0.155 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + attribute: material._PinchUvAmount + path: + classID: 212 + script: {fileID: 0} + - curve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 0.5 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 0.51666665 + value: 0.2 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + attribute: material._HitEffectBlend + path: + classID: 212 + script: {fileID: 0} + - curve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 0.51666665 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + attribute: material._HitEffectColor.r + path: + classID: 212 + script: {fileID: 0} + - curve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0.9980566 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 0.51666665 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + attribute: material._HitEffectColor.g + path: + classID: 212 + script: {fileID: 0} + - curve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0.9381551 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 0.51666665 + value: 0.3443396 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + attribute: material._HitEffectColor.b + path: + classID: 212 + script: {fileID: 0} + - curve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 0.51666665 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + attribute: material._HitEffectColor.a + path: + classID: 212 + script: {fileID: 0} + m_PPtrCurves: [] + m_SampleRate: 60 + m_WrapMode: 0 + m_Bounds: + m_Center: {x: 0, y: 0, z: 0} + m_Extent: {x: 0, y: 0, z: 0} + m_ClipBindingConstant: + genericBindings: + - serializedVersion: 2 + path: 0 + attribute: 2187965785 + script: {fileID: 0} + typeID: 212 + customType: 22 + isPPtrCurve: 0 + - serializedVersion: 2 + path: 0 + attribute: 2296652321 + script: {fileID: 0} + typeID: 212 + customType: 22 + isPPtrCurve: 0 + - serializedVersion: 2 + path: 0 + attribute: 2301463249 + script: {fileID: 0} + typeID: 212 + customType: 22 + isPPtrCurve: 0 + - serializedVersion: 2 + path: 0 + attribute: 2333048903 + script: {fileID: 0} + typeID: 212 + customType: 22 + isPPtrCurve: 0 + - serializedVersion: 2 + path: 0 + attribute: 1455733126 + script: {fileID: 0} + typeID: 212 + customType: 22 + isPPtrCurve: 0 + - serializedVersion: 2 + path: 0 + attribute: 1724168582 + script: {fileID: 0} + typeID: 212 + customType: 22 + isPPtrCurve: 0 + - serializedVersion: 2 + path: 0 + attribute: 1187297670 + script: {fileID: 0} + typeID: 212 + customType: 22 + isPPtrCurve: 0 + - serializedVersion: 2 + path: 0 + attribute: 1992604038 + script: {fileID: 0} + typeID: 212 + customType: 22 + isPPtrCurve: 0 + pptrCurveMapping: [] + m_AnimationClipSettings: + serializedVersion: 2 + m_AdditiveReferencePoseClip: {fileID: 0} + m_AdditiveReferencePoseTime: 0 + m_StartTime: 0 + m_StopTime: 1 + m_OrientationOffsetY: 0 + m_Level: 0 + m_CycleOffset: 0 + m_HasAdditiveReferencePose: 0 + m_LoopTime: 1 + m_LoopBlend: 0 + m_LoopBlendOrientation: 0 + m_LoopBlendPositionY: 0 + m_LoopBlendPositionXZ: 0 + m_KeepOriginalOrientation: 0 + m_KeepOriginalPositionY: 1 + m_KeepOriginalPositionXZ: 0 + m_HeightFromFeet: 0 + m_Mirror: 0 + m_EditorCurves: + - curve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 0.5 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 0.51666665 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 0.5833333 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + attribute: material._ChromAberrAmount + path: + classID: 212 + script: {fileID: 0} + - curve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 0.5 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 0.51666665 + value: 0.245 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 0.5833333 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + attribute: material._FishEyeUvAmount + path: + classID: 212 + script: {fileID: 0} + - curve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 0.5 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 0.51666665 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 0.5833333 + value: 0.155 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + attribute: material._PinchUvAmount + path: + classID: 212 + script: {fileID: 0} + - curve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 0.5 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 0.51666665 + value: 0.2 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + attribute: material._HitEffectBlend + path: + classID: 212 + script: {fileID: 0} + - curve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 0.51666665 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + attribute: material._HitEffectColor.r + path: + classID: 212 + script: {fileID: 0} + - curve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0.9980566 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 0.51666665 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + attribute: material._HitEffectColor.g + path: + classID: 212 + script: {fileID: 0} + - curve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0.9381551 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 0.51666665 + value: 0.3443396 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + attribute: material._HitEffectColor.b + path: + classID: 212 + script: {fileID: 0} + - curve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 0.51666665 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + attribute: material._HitEffectColor.a + path: + classID: 212 + script: {fileID: 0} + m_EulerEditorCurves: [] + m_HasGenericRootTransform: 0 + m_HasMotionFloatCurves: 0 + m_Events: [] diff --git a/Assets/Plugins/AllIn1SpriteShader/Demo/Animation/Impact1.anim.meta b/Assets/Plugins/AllIn1SpriteShader/Demo/Animation/Impact1.anim.meta new file mode 100644 index 000000000..7e973918e --- /dev/null +++ b/Assets/Plugins/AllIn1SpriteShader/Demo/Animation/Impact1.anim.meta @@ -0,0 +1,15 @@ +fileFormatVersion: 2 +guid: b4a017fddcef25548ad4089f01c9da55 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 7400000 + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 156513 + packageName: All In 1 Sprite Shader + packageVersion: 4.25 + assetPath: Assets/Plugins/AllIn1SpriteShader/Demo/Animation/Impact1.anim + uploadId: 708810 diff --git a/Assets/Plugins/AllIn1SpriteShader/Demo/Animation/MotionBlur.anim b/Assets/Plugins/AllIn1SpriteShader/Demo/Animation/MotionBlur.anim new file mode 100644 index 000000000..3e5e8a382 --- /dev/null +++ b/Assets/Plugins/AllIn1SpriteShader/Demo/Animation/MotionBlur.anim @@ -0,0 +1,322 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!74 &7400000 +AnimationClip: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: MotionBlur + serializedVersion: 6 + m_Legacy: 0 + m_Compressed: 0 + m_UseHighQualityCurve: 1 + m_RotationCurves: [] + m_CompressedRotationCurves: [] + m_EulerCurves: [] + m_PositionCurves: + - curve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: {x: -2.59, y: 0, z: 0} + inSlope: {x: 0, y: 0, z: 0} + outSlope: {x: 0, y: 0, z: 0} + tangentMode: 0 + weightedMode: 0 + inWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334} + outWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334} + - serializedVersion: 3 + time: 0.33333334 + value: {x: -2.59, y: 0, z: 0} + inSlope: {x: -0, y: 0, z: 0} + outSlope: {x: 13.684616, y: 0, z: 0} + tangentMode: 0 + weightedMode: 0 + inWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334} + outWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334} + - serializedVersion: 3 + time: 0.76666665 + value: {x: 3.34, y: 0, z: 0} + inSlope: {x: 13.684616, y: 0, z: 0} + outSlope: {x: -7.803249, y: 0, z: 0} + tangentMode: 0 + weightedMode: 0 + inWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334} + outWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334} + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + path: + m_ScaleCurves: [] + m_FloatCurves: + - curve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 0.33333334 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 0.35 + value: 2.43 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 0.6666667 + value: 2.33 + inSlope: -0.9600014 + outSlope: -0.9600014 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 0.76666665 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + attribute: material._MotionBlurDist + path: + classID: 212 + script: {fileID: 0} + m_PPtrCurves: [] + m_SampleRate: 60 + m_WrapMode: 0 + m_Bounds: + m_Center: {x: 0, y: 0, z: 0} + m_Extent: {x: 0, y: 0, z: 0} + m_ClipBindingConstant: + genericBindings: + - serializedVersion: 2 + path: 0 + attribute: 1 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + - serializedVersion: 2 + path: 0 + attribute: 2244204413 + script: {fileID: 0} + typeID: 212 + customType: 22 + isPPtrCurve: 0 + pptrCurveMapping: [] + m_AnimationClipSettings: + serializedVersion: 2 + m_AdditiveReferencePoseClip: {fileID: 0} + m_AdditiveReferencePoseTime: 0 + m_StartTime: 0 + m_StopTime: 0.76666665 + m_OrientationOffsetY: 0 + m_Level: 0 + m_CycleOffset: 0 + m_HasAdditiveReferencePose: 0 + m_LoopTime: 1 + m_LoopBlend: 0 + m_LoopBlendOrientation: 0 + m_LoopBlendPositionY: 0 + m_LoopBlendPositionXZ: 0 + m_KeepOriginalOrientation: 0 + m_KeepOriginalPositionY: 1 + m_KeepOriginalPositionXZ: 0 + m_HeightFromFeet: 0 + m_Mirror: 0 + m_EditorCurves: + - curve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: -2.59 + inSlope: 0 + outSlope: 0 + tangentMode: 69 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 0.33333334 + value: -2.59 + inSlope: -0 + outSlope: 13.684616 + tangentMode: 69 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 0.76666665 + value: 3.34 + inSlope: 13.684616 + outSlope: -7.803249 + tangentMode: 69 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + attribute: m_LocalPosition.x + path: + classID: 4 + script: {fileID: 0} + - curve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 0.33333334 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 0.76666665 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + attribute: m_LocalPosition.y + path: + classID: 4 + script: {fileID: 0} + - curve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 0.33333334 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 0.76666665 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + attribute: m_LocalPosition.z + path: + classID: 4 + script: {fileID: 0} + - curve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 0.33333334 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 0.35 + value: 2.43 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 0.6666667 + value: 2.33 + inSlope: -0.9600014 + outSlope: -0.9600014 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 0.76666665 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + attribute: material._MotionBlurDist + path: + classID: 212 + script: {fileID: 0} + m_EulerEditorCurves: [] + m_HasGenericRootTransform: 1 + m_HasMotionFloatCurves: 0 + m_Events: [] diff --git a/Assets/Plugins/AllIn1SpriteShader/Demo/Animation/MotionBlur.anim.meta b/Assets/Plugins/AllIn1SpriteShader/Demo/Animation/MotionBlur.anim.meta new file mode 100644 index 000000000..efeb5fcab --- /dev/null +++ b/Assets/Plugins/AllIn1SpriteShader/Demo/Animation/MotionBlur.anim.meta @@ -0,0 +1,15 @@ +fileFormatVersion: 2 +guid: e618782845320624bb758db2d2b9bf0e +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 7400000 + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 156513 + packageName: All In 1 Sprite Shader + packageVersion: 4.25 + assetPath: Assets/Plugins/AllIn1SpriteShader/Demo/Animation/MotionBlur.anim + uploadId: 708810 diff --git a/Assets/Plugins/AllIn1SpriteShader/Demo/Animation/Offset.anim b/Assets/Plugins/AllIn1SpriteShader/Demo/Animation/Offset.anim new file mode 100644 index 000000000..1387133d4 --- /dev/null +++ b/Assets/Plugins/AllIn1SpriteShader/Demo/Animation/Offset.anim @@ -0,0 +1,134 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!74 &7400000 +AnimationClip: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: Offset + serializedVersion: 6 + m_Legacy: 0 + m_Compressed: 0 + m_UseHighQualityCurve: 1 + m_RotationCurves: [] + m_CompressedRotationCurves: [] + m_EulerCurves: [] + m_PositionCurves: [] + m_ScaleCurves: [] + m_FloatCurves: + - curve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0.104 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 0.33333334 + value: -0.104 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 0.6666667 + value: 0.104 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + attribute: material._OffsetUvX + path: + classID: 212 + script: {fileID: 0} + m_PPtrCurves: [] + m_SampleRate: 60 + m_WrapMode: 0 + m_Bounds: + m_Center: {x: 0, y: 0, z: 0} + m_Extent: {x: 0, y: 0, z: 0} + m_ClipBindingConstant: + genericBindings: + - serializedVersion: 2 + path: 0 + attribute: 2328359666 + script: {fileID: 0} + typeID: 212 + customType: 22 + isPPtrCurve: 0 + pptrCurveMapping: [] + m_AnimationClipSettings: + serializedVersion: 2 + m_AdditiveReferencePoseClip: {fileID: 0} + m_AdditiveReferencePoseTime: 0 + m_StartTime: 0 + m_StopTime: 0.6666667 + m_OrientationOffsetY: 0 + m_Level: 0 + m_CycleOffset: 0 + m_HasAdditiveReferencePose: 0 + m_LoopTime: 1 + m_LoopBlend: 0 + m_LoopBlendOrientation: 0 + m_LoopBlendPositionY: 0 + m_LoopBlendPositionXZ: 0 + m_KeepOriginalOrientation: 0 + m_KeepOriginalPositionY: 1 + m_KeepOriginalPositionXZ: 0 + m_HeightFromFeet: 0 + m_Mirror: 0 + m_EditorCurves: + - curve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0.104 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 0.33333334 + value: -0.104 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 0.6666667 + value: 0.104 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + attribute: material._OffsetUvX + path: + classID: 212 + script: {fileID: 0} + m_EulerEditorCurves: [] + m_HasGenericRootTransform: 0 + m_HasMotionFloatCurves: 0 + m_Events: [] diff --git a/Assets/Plugins/AllIn1SpriteShader/Demo/Animation/Offset.anim.meta b/Assets/Plugins/AllIn1SpriteShader/Demo/Animation/Offset.anim.meta new file mode 100644 index 000000000..c0c00ba4a --- /dev/null +++ b/Assets/Plugins/AllIn1SpriteShader/Demo/Animation/Offset.anim.meta @@ -0,0 +1,15 @@ +fileFormatVersion: 2 +guid: cfa3188cad768364993a043c85b5add0 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 7400000 + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 156513 + packageName: All In 1 Sprite Shader + packageVersion: 4.25 + assetPath: Assets/Plugins/AllIn1SpriteShader/Demo/Animation/Offset.anim + uploadId: 708810 diff --git a/Assets/Plugins/AllIn1SpriteShader/Demo/Animation/Offset.controller b/Assets/Plugins/AllIn1SpriteShader/Demo/Animation/Offset.controller new file mode 100644 index 000000000..b9a8d8d00 --- /dev/null +++ b/Assets/Plugins/AllIn1SpriteShader/Demo/Animation/Offset.controller @@ -0,0 +1,72 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1102 &-5873563199590618010 +AnimatorState: + serializedVersion: 5 + m_ObjectHideFlags: 1 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: Offset + m_Speed: 1 + m_CycleOffset: 0 + m_Transitions: [] + m_StateMachineBehaviours: [] + m_Position: {x: 50, y: 50, z: 0} + m_IKOnFeet: 0 + m_WriteDefaultValues: 1 + m_Mirror: 0 + m_SpeedParameterActive: 0 + m_MirrorParameterActive: 0 + m_CycleOffsetParameterActive: 0 + m_TimeParameterActive: 0 + m_Motion: {fileID: 7400000, guid: cfa3188cad768364993a043c85b5add0, type: 2} + m_Tag: + m_SpeedParameter: + m_MirrorParameter: + m_CycleOffsetParameter: + m_TimeParameter: +--- !u!91 &9100000 +AnimatorController: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: Offset + serializedVersion: 5 + m_AnimatorParameters: [] + m_AnimatorLayers: + - serializedVersion: 5 + m_Name: Base Layer + m_StateMachine: {fileID: 5176085075958421900} + m_Mask: {fileID: 0} + m_Motions: [] + m_Behaviours: [] + m_BlendingMode: 0 + m_SyncedLayerIndex: -1 + m_DefaultWeight: 0 + m_IKPass: 0 + m_SyncedLayerAffectsTiming: 0 + m_Controller: {fileID: 9100000} +--- !u!1107 &5176085075958421900 +AnimatorStateMachine: + serializedVersion: 5 + m_ObjectHideFlags: 1 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: Base Layer + m_ChildStates: + - serializedVersion: 1 + m_State: {fileID: -5873563199590618010} + m_Position: {x: 200, y: 0, z: 0} + m_ChildStateMachines: [] + m_AnyStateTransitions: [] + m_EntryTransitions: [] + m_StateMachineTransitions: {} + m_StateMachineBehaviours: [] + m_AnyStatePosition: {x: 50, y: 20, z: 0} + m_EntryPosition: {x: 50, y: 120, z: 0} + m_ExitPosition: {x: 800, y: 120, z: 0} + m_ParentStateMachinePosition: {x: 800, y: 20, z: 0} + m_DefaultState: {fileID: -5873563199590618010} diff --git a/Assets/Plugins/AllIn1SpriteShader/Demo/Animation/Offset.controller.meta b/Assets/Plugins/AllIn1SpriteShader/Demo/Animation/Offset.controller.meta new file mode 100644 index 000000000..314030df6 --- /dev/null +++ b/Assets/Plugins/AllIn1SpriteShader/Demo/Animation/Offset.controller.meta @@ -0,0 +1,15 @@ +fileFormatVersion: 2 +guid: 63273b05c4774384b85a146feb6df4d3 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 9100000 + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 156513 + packageName: All In 1 Sprite Shader + packageVersion: 4.25 + assetPath: Assets/Plugins/AllIn1SpriteShader/Demo/Animation/Offset.controller + uploadId: 708810 diff --git a/Assets/Plugins/AllIn1SpriteShader/Demo/Animation/Original.controller b/Assets/Plugins/AllIn1SpriteShader/Demo/Animation/Original.controller new file mode 100644 index 000000000..8b7510795 --- /dev/null +++ b/Assets/Plugins/AllIn1SpriteShader/Demo/Animation/Original.controller @@ -0,0 +1,72 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1107 &-7075512637821731064 +AnimatorStateMachine: + serializedVersion: 5 + m_ObjectHideFlags: 1 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: Base Layer + m_ChildStates: + - serializedVersion: 1 + m_State: {fileID: -2683493651811674534} + m_Position: {x: 200, y: 0, z: 0} + m_ChildStateMachines: [] + m_AnyStateTransitions: [] + m_EntryTransitions: [] + m_StateMachineTransitions: {} + m_StateMachineBehaviours: [] + m_AnyStatePosition: {x: 50, y: 20, z: 0} + m_EntryPosition: {x: 50, y: 120, z: 0} + m_ExitPosition: {x: 800, y: 120, z: 0} + m_ParentStateMachinePosition: {x: 800, y: 20, z: 0} + m_DefaultState: {fileID: -2683493651811674534} +--- !u!1102 &-2683493651811674534 +AnimatorState: + serializedVersion: 5 + m_ObjectHideFlags: 1 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: Hologram + m_Speed: 1 + m_CycleOffset: 0 + m_Transitions: [] + m_StateMachineBehaviours: [] + m_Position: {x: 50, y: 50, z: 0} + m_IKOnFeet: 0 + m_WriteDefaultValues: 1 + m_Mirror: 0 + m_SpeedParameterActive: 0 + m_MirrorParameterActive: 0 + m_CycleOffsetParameterActive: 0 + m_TimeParameterActive: 0 + m_Motion: {fileID: 7400000, guid: 2d06614560bbcda488c23b8708ff4c49, type: 2} + m_Tag: + m_SpeedParameter: + m_MirrorParameter: + m_CycleOffsetParameter: + m_TimeParameter: +--- !u!91 &9100000 +AnimatorController: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: Original + serializedVersion: 5 + m_AnimatorParameters: [] + m_AnimatorLayers: + - serializedVersion: 5 + m_Name: Base Layer + m_StateMachine: {fileID: -7075512637821731064} + m_Mask: {fileID: 0} + m_Motions: [] + m_Behaviours: [] + m_BlendingMode: 0 + m_SyncedLayerIndex: -1 + m_DefaultWeight: 0 + m_IKPass: 0 + m_SyncedLayerAffectsTiming: 0 + m_Controller: {fileID: 9100000} diff --git a/Assets/Plugins/AllIn1SpriteShader/Demo/Animation/Original.controller.meta b/Assets/Plugins/AllIn1SpriteShader/Demo/Animation/Original.controller.meta new file mode 100644 index 000000000..ce174f4cd --- /dev/null +++ b/Assets/Plugins/AllIn1SpriteShader/Demo/Animation/Original.controller.meta @@ -0,0 +1,15 @@ +fileFormatVersion: 2 +guid: ad5ae64e9a03a1a40889385b2d0f2b89 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 9100000 + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 156513 + packageName: All In 1 Sprite Shader + packageVersion: 4.25 + assetPath: Assets/Plugins/AllIn1SpriteShader/Demo/Animation/Original.controller + uploadId: 708810 diff --git a/Assets/Plugins/AllIn1SpriteShader/Demo/Animation/Posterize.anim b/Assets/Plugins/AllIn1SpriteShader/Demo/Animation/Posterize.anim new file mode 100644 index 000000000..7309422aa --- /dev/null +++ b/Assets/Plugins/AllIn1SpriteShader/Demo/Animation/Posterize.anim @@ -0,0 +1,134 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!74 &7400000 +AnimationClip: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: Posterize + serializedVersion: 6 + m_Legacy: 0 + m_Compressed: 0 + m_UseHighQualityCurve: 1 + m_RotationCurves: [] + m_CompressedRotationCurves: [] + m_EulerCurves: [] + m_PositionCurves: [] + m_ScaleCurves: [] + m_FloatCurves: + - curve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 6 + inSlope: 0 + outSlope: 8 + tangentMode: 69 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 0.5 + value: 10 + inSlope: 8 + outSlope: -8 + tangentMode: 69 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 6 + inSlope: -8 + outSlope: 0 + tangentMode: 69 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + attribute: material._PosterizeNumColors + path: + classID: 212 + script: {fileID: 0} + m_PPtrCurves: [] + m_SampleRate: 60 + m_WrapMode: 0 + m_Bounds: + m_Center: {x: 0, y: 0, z: 0} + m_Extent: {x: 0, y: 0, z: 0} + m_ClipBindingConstant: + genericBindings: + - serializedVersion: 2 + path: 0 + attribute: 2351287835 + script: {fileID: 0} + typeID: 212 + customType: 22 + isPPtrCurve: 0 + pptrCurveMapping: [] + m_AnimationClipSettings: + serializedVersion: 2 + m_AdditiveReferencePoseClip: {fileID: 0} + m_AdditiveReferencePoseTime: 0 + m_StartTime: 0 + m_StopTime: 1 + m_OrientationOffsetY: 0 + m_Level: 0 + m_CycleOffset: 0 + m_HasAdditiveReferencePose: 0 + m_LoopTime: 1 + m_LoopBlend: 0 + m_LoopBlendOrientation: 0 + m_LoopBlendPositionY: 0 + m_LoopBlendPositionXZ: 0 + m_KeepOriginalOrientation: 0 + m_KeepOriginalPositionY: 1 + m_KeepOriginalPositionXZ: 0 + m_HeightFromFeet: 0 + m_Mirror: 0 + m_EditorCurves: + - curve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 6 + inSlope: 0 + outSlope: 8 + tangentMode: 69 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 0.5 + value: 10 + inSlope: 8 + outSlope: -8 + tangentMode: 69 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 6 + inSlope: -8 + outSlope: 0 + tangentMode: 69 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + attribute: material._PosterizeNumColors + path: + classID: 212 + script: {fileID: 0} + m_EulerEditorCurves: [] + m_HasGenericRootTransform: 0 + m_HasMotionFloatCurves: 0 + m_Events: [] diff --git a/Assets/Plugins/AllIn1SpriteShader/Demo/Animation/Posterize.anim.meta b/Assets/Plugins/AllIn1SpriteShader/Demo/Animation/Posterize.anim.meta new file mode 100644 index 000000000..583a9733b --- /dev/null +++ b/Assets/Plugins/AllIn1SpriteShader/Demo/Animation/Posterize.anim.meta @@ -0,0 +1,15 @@ +fileFormatVersion: 2 +guid: 82ee3808b395730498f393a00662e41a +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 7400000 + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 156513 + packageName: All In 1 Sprite Shader + packageVersion: 4.25 + assetPath: Assets/Plugins/AllIn1SpriteShader/Demo/Animation/Posterize.anim + uploadId: 708810 diff --git a/Assets/Plugins/AllIn1SpriteShader/Demo/Animation/Posterize.controller b/Assets/Plugins/AllIn1SpriteShader/Demo/Animation/Posterize.controller new file mode 100644 index 000000000..027f689ff --- /dev/null +++ b/Assets/Plugins/AllIn1SpriteShader/Demo/Animation/Posterize.controller @@ -0,0 +1,72 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1107 &-8832860468942279513 +AnimatorStateMachine: + serializedVersion: 5 + m_ObjectHideFlags: 1 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: Base Layer + m_ChildStates: + - serializedVersion: 1 + m_State: {fileID: -5881428344133791977} + m_Position: {x: 200, y: 0, z: 0} + m_ChildStateMachines: [] + m_AnyStateTransitions: [] + m_EntryTransitions: [] + m_StateMachineTransitions: {} + m_StateMachineBehaviours: [] + m_AnyStatePosition: {x: 50, y: 20, z: 0} + m_EntryPosition: {x: 50, y: 120, z: 0} + m_ExitPosition: {x: 800, y: 120, z: 0} + m_ParentStateMachinePosition: {x: 800, y: 20, z: 0} + m_DefaultState: {fileID: -5881428344133791977} +--- !u!1102 &-5881428344133791977 +AnimatorState: + serializedVersion: 5 + m_ObjectHideFlags: 1 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: Posterize + m_Speed: 1 + m_CycleOffset: 0 + m_Transitions: [] + m_StateMachineBehaviours: [] + m_Position: {x: 50, y: 50, z: 0} + m_IKOnFeet: 0 + m_WriteDefaultValues: 1 + m_Mirror: 0 + m_SpeedParameterActive: 0 + m_MirrorParameterActive: 0 + m_CycleOffsetParameterActive: 0 + m_TimeParameterActive: 0 + m_Motion: {fileID: 7400000, guid: 82ee3808b395730498f393a00662e41a, type: 2} + m_Tag: + m_SpeedParameter: + m_MirrorParameter: + m_CycleOffsetParameter: + m_TimeParameter: +--- !u!91 &9100000 +AnimatorController: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: Posterize + serializedVersion: 5 + m_AnimatorParameters: [] + m_AnimatorLayers: + - serializedVersion: 5 + m_Name: Base Layer + m_StateMachine: {fileID: -8832860468942279513} + m_Mask: {fileID: 0} + m_Motions: [] + m_Behaviours: [] + m_BlendingMode: 0 + m_SyncedLayerIndex: -1 + m_DefaultWeight: 0 + m_IKPass: 0 + m_SyncedLayerAffectsTiming: 0 + m_Controller: {fileID: 9100000} diff --git a/Assets/Plugins/AllIn1SpriteShader/Demo/Animation/Posterize.controller.meta b/Assets/Plugins/AllIn1SpriteShader/Demo/Animation/Posterize.controller.meta new file mode 100644 index 000000000..b93f31ca0 --- /dev/null +++ b/Assets/Plugins/AllIn1SpriteShader/Demo/Animation/Posterize.controller.meta @@ -0,0 +1,15 @@ +fileFormatVersion: 2 +guid: e25fb0db751a59a43bb4bd01628feb7e +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 9100000 + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 156513 + packageName: All In 1 Sprite Shader + packageVersion: 4.25 + assetPath: Assets/Plugins/AllIn1SpriteShader/Demo/Animation/Posterize.controller + uploadId: 708810 diff --git a/Assets/Plugins/AllIn1SpriteShader/Demo/Animation/RadialFillAmount.anim b/Assets/Plugins/AllIn1SpriteShader/Demo/Animation/RadialFillAmount.anim new file mode 100644 index 000000000..1929a1fa8 --- /dev/null +++ b/Assets/Plugins/AllIn1SpriteShader/Demo/Animation/RadialFillAmount.anim @@ -0,0 +1,134 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!74 &7400000 +AnimationClip: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: RadialFillAmount + serializedVersion: 6 + m_Legacy: 0 + m_Compressed: 0 + m_UseHighQualityCurve: 1 + m_RotationCurves: [] + m_CompressedRotationCurves: [] + m_EulerCurves: [] + m_PositionCurves: [] + m_ScaleCurves: [] + m_FloatCurves: + - curve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 360 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 0.5 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 360 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + attribute: material._RadialClip2 + path: + classID: 212 + script: {fileID: 0} + m_PPtrCurves: [] + m_SampleRate: 60 + m_WrapMode: 0 + m_Bounds: + m_Center: {x: 0, y: 0, z: 0} + m_Extent: {x: 0, y: 0, z: 0} + m_ClipBindingConstant: + genericBindings: + - serializedVersion: 2 + path: 0 + attribute: 2304530698 + script: {fileID: 0} + typeID: 212 + customType: 22 + isPPtrCurve: 0 + pptrCurveMapping: [] + m_AnimationClipSettings: + serializedVersion: 2 + m_AdditiveReferencePoseClip: {fileID: 0} + m_AdditiveReferencePoseTime: 0 + m_StartTime: 0 + m_StopTime: 1 + m_OrientationOffsetY: 0 + m_Level: 0 + m_CycleOffset: 0 + m_HasAdditiveReferencePose: 0 + m_LoopTime: 1 + m_LoopBlend: 0 + m_LoopBlendOrientation: 0 + m_LoopBlendPositionY: 0 + m_LoopBlendPositionXZ: 0 + m_KeepOriginalOrientation: 0 + m_KeepOriginalPositionY: 1 + m_KeepOriginalPositionXZ: 0 + m_HeightFromFeet: 0 + m_Mirror: 0 + m_EditorCurves: + - curve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 360 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 0.5 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 360 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + attribute: material._RadialClip2 + path: + classID: 212 + script: {fileID: 0} + m_EulerEditorCurves: [] + m_HasGenericRootTransform: 0 + m_HasMotionFloatCurves: 0 + m_Events: [] diff --git a/Assets/Plugins/AllIn1SpriteShader/Demo/Animation/RadialFillAmount.anim.meta b/Assets/Plugins/AllIn1SpriteShader/Demo/Animation/RadialFillAmount.anim.meta new file mode 100644 index 000000000..9992651a4 --- /dev/null +++ b/Assets/Plugins/AllIn1SpriteShader/Demo/Animation/RadialFillAmount.anim.meta @@ -0,0 +1,15 @@ +fileFormatVersion: 2 +guid: fee541ce475b5ae4c9d0ddad66e4d464 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 7400000 + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 156513 + packageName: All In 1 Sprite Shader + packageVersion: 4.25 + assetPath: Assets/Plugins/AllIn1SpriteShader/Demo/Animation/RadialFillAmount.anim + uploadId: 708810 diff --git a/Assets/Plugins/AllIn1SpriteShader/Demo/Animation/RadialFillAmount.controller b/Assets/Plugins/AllIn1SpriteShader/Demo/Animation/RadialFillAmount.controller new file mode 100644 index 000000000..35fbd00ab --- /dev/null +++ b/Assets/Plugins/AllIn1SpriteShader/Demo/Animation/RadialFillAmount.controller @@ -0,0 +1,72 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1107 &-2648066226161793259 +AnimatorStateMachine: + serializedVersion: 5 + m_ObjectHideFlags: 1 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: Base Layer + m_ChildStates: + - serializedVersion: 1 + m_State: {fileID: 1102919259890989908} + m_Position: {x: 200, y: 0, z: 0} + m_ChildStateMachines: [] + m_AnyStateTransitions: [] + m_EntryTransitions: [] + m_StateMachineTransitions: {} + m_StateMachineBehaviours: [] + m_AnyStatePosition: {x: 50, y: 20, z: 0} + m_EntryPosition: {x: 50, y: 120, z: 0} + m_ExitPosition: {x: 800, y: 120, z: 0} + m_ParentStateMachinePosition: {x: 800, y: 20, z: 0} + m_DefaultState: {fileID: 1102919259890989908} +--- !u!91 &9100000 +AnimatorController: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: RadialFillAmount + serializedVersion: 5 + m_AnimatorParameters: [] + m_AnimatorLayers: + - serializedVersion: 5 + m_Name: Base Layer + m_StateMachine: {fileID: -2648066226161793259} + m_Mask: {fileID: 0} + m_Motions: [] + m_Behaviours: [] + m_BlendingMode: 0 + m_SyncedLayerIndex: -1 + m_DefaultWeight: 0 + m_IKPass: 0 + m_SyncedLayerAffectsTiming: 0 + m_Controller: {fileID: 9100000} +--- !u!1102 &1102919259890989908 +AnimatorState: + serializedVersion: 5 + m_ObjectHideFlags: 1 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: RadialFillAmount + m_Speed: 1 + m_CycleOffset: 0 + m_Transitions: [] + m_StateMachineBehaviours: [] + m_Position: {x: 50, y: 50, z: 0} + m_IKOnFeet: 0 + m_WriteDefaultValues: 1 + m_Mirror: 0 + m_SpeedParameterActive: 0 + m_MirrorParameterActive: 0 + m_CycleOffsetParameterActive: 0 + m_TimeParameterActive: 0 + m_Motion: {fileID: 7400000, guid: fee541ce475b5ae4c9d0ddad66e4d464, type: 2} + m_Tag: + m_SpeedParameter: + m_MirrorParameter: + m_CycleOffsetParameter: + m_TimeParameter: diff --git a/Assets/Plugins/AllIn1SpriteShader/Demo/Animation/RadialFillAmount.controller.meta b/Assets/Plugins/AllIn1SpriteShader/Demo/Animation/RadialFillAmount.controller.meta new file mode 100644 index 000000000..28eb5bf42 --- /dev/null +++ b/Assets/Plugins/AllIn1SpriteShader/Demo/Animation/RadialFillAmount.controller.meta @@ -0,0 +1,15 @@ +fileFormatVersion: 2 +guid: f325edee1e9fb044eb0d87aad6d3ece0 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 9100000 + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 156513 + packageName: All In 1 Sprite Shader + packageVersion: 4.25 + assetPath: Assets/Plugins/AllIn1SpriteShader/Demo/Animation/RadialFillAmount.controller + uploadId: 708810 diff --git a/Assets/Plugins/AllIn1SpriteShader/Demo/Animation/Rotate.anim b/Assets/Plugins/AllIn1SpriteShader/Demo/Animation/Rotate.anim new file mode 100644 index 000000000..573f40ea0 --- /dev/null +++ b/Assets/Plugins/AllIn1SpriteShader/Demo/Animation/Rotate.anim @@ -0,0 +1,116 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!74 &7400000 +AnimationClip: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: Rotate + serializedVersion: 6 + m_Legacy: 0 + m_Compressed: 0 + m_UseHighQualityCurve: 1 + m_RotationCurves: [] + m_CompressedRotationCurves: [] + m_EulerCurves: [] + m_PositionCurves: [] + m_ScaleCurves: [] + m_FloatCurves: + - curve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 18.84 + tangentMode: 69 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 0.33333334 + value: 6.28 + inSlope: 18.84 + outSlope: 0 + tangentMode: 69 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + attribute: material._RotateUvAmount + path: + classID: 212 + script: {fileID: 0} + m_PPtrCurves: [] + m_SampleRate: 60 + m_WrapMode: 0 + m_Bounds: + m_Center: {x: 0, y: 0, z: 0} + m_Extent: {x: 0, y: 0, z: 0} + m_ClipBindingConstant: + genericBindings: + - serializedVersion: 2 + path: 0 + attribute: 2278947341 + script: {fileID: 0} + typeID: 212 + customType: 22 + isPPtrCurve: 0 + pptrCurveMapping: [] + m_AnimationClipSettings: + serializedVersion: 2 + m_AdditiveReferencePoseClip: {fileID: 0} + m_AdditiveReferencePoseTime: 0 + m_StartTime: 0 + m_StopTime: 0.33333334 + m_OrientationOffsetY: 0 + m_Level: 0 + m_CycleOffset: 0 + m_HasAdditiveReferencePose: 0 + m_LoopTime: 1 + m_LoopBlend: 0 + m_LoopBlendOrientation: 0 + m_LoopBlendPositionY: 0 + m_LoopBlendPositionXZ: 0 + m_KeepOriginalOrientation: 0 + m_KeepOriginalPositionY: 1 + m_KeepOriginalPositionXZ: 0 + m_HeightFromFeet: 0 + m_Mirror: 0 + m_EditorCurves: + - curve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 18.84 + tangentMode: 69 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 0.33333334 + value: 6.28 + inSlope: 18.84 + outSlope: 0 + tangentMode: 69 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + attribute: material._RotateUvAmount + path: + classID: 212 + script: {fileID: 0} + m_EulerEditorCurves: [] + m_HasGenericRootTransform: 0 + m_HasMotionFloatCurves: 0 + m_Events: [] diff --git a/Assets/Plugins/AllIn1SpriteShader/Demo/Animation/Rotate.anim.meta b/Assets/Plugins/AllIn1SpriteShader/Demo/Animation/Rotate.anim.meta new file mode 100644 index 000000000..5986d07bf --- /dev/null +++ b/Assets/Plugins/AllIn1SpriteShader/Demo/Animation/Rotate.anim.meta @@ -0,0 +1,15 @@ +fileFormatVersion: 2 +guid: a3c9d77a6b2549c4d8ae31057eca0fc9 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 7400000 + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 156513 + packageName: All In 1 Sprite Shader + packageVersion: 4.25 + assetPath: Assets/Plugins/AllIn1SpriteShader/Demo/Animation/Rotate.anim + uploadId: 708810 diff --git a/Assets/Plugins/AllIn1SpriteShader/Demo/Animation/Rotate.controller b/Assets/Plugins/AllIn1SpriteShader/Demo/Animation/Rotate.controller new file mode 100644 index 000000000..2c5a9e247 --- /dev/null +++ b/Assets/Plugins/AllIn1SpriteShader/Demo/Animation/Rotate.controller @@ -0,0 +1,72 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1102 &-3120651885421920482 +AnimatorState: + serializedVersion: 5 + m_ObjectHideFlags: 1 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: Rotate + m_Speed: 1 + m_CycleOffset: 0 + m_Transitions: [] + m_StateMachineBehaviours: [] + m_Position: {x: 50, y: 50, z: 0} + m_IKOnFeet: 0 + m_WriteDefaultValues: 1 + m_Mirror: 0 + m_SpeedParameterActive: 0 + m_MirrorParameterActive: 0 + m_CycleOffsetParameterActive: 0 + m_TimeParameterActive: 0 + m_Motion: {fileID: 7400000, guid: a3c9d77a6b2549c4d8ae31057eca0fc9, type: 2} + m_Tag: + m_SpeedParameter: + m_MirrorParameter: + m_CycleOffsetParameter: + m_TimeParameter: +--- !u!91 &9100000 +AnimatorController: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: Rotate + serializedVersion: 5 + m_AnimatorParameters: [] + m_AnimatorLayers: + - serializedVersion: 5 + m_Name: Base Layer + m_StateMachine: {fileID: 2449547186783014002} + m_Mask: {fileID: 0} + m_Motions: [] + m_Behaviours: [] + m_BlendingMode: 0 + m_SyncedLayerIndex: -1 + m_DefaultWeight: 0 + m_IKPass: 0 + m_SyncedLayerAffectsTiming: 0 + m_Controller: {fileID: 9100000} +--- !u!1107 &2449547186783014002 +AnimatorStateMachine: + serializedVersion: 5 + m_ObjectHideFlags: 1 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: Base Layer + m_ChildStates: + - serializedVersion: 1 + m_State: {fileID: -3120651885421920482} + m_Position: {x: 200, y: 0, z: 0} + m_ChildStateMachines: [] + m_AnyStateTransitions: [] + m_EntryTransitions: [] + m_StateMachineTransitions: {} + m_StateMachineBehaviours: [] + m_AnyStatePosition: {x: 50, y: 20, z: 0} + m_EntryPosition: {x: 50, y: 120, z: 0} + m_ExitPosition: {x: 800, y: 120, z: 0} + m_ParentStateMachinePosition: {x: 800, y: 20, z: 0} + m_DefaultState: {fileID: -3120651885421920482} diff --git a/Assets/Plugins/AllIn1SpriteShader/Demo/Animation/Rotate.controller.meta b/Assets/Plugins/AllIn1SpriteShader/Demo/Animation/Rotate.controller.meta new file mode 100644 index 000000000..030d08a35 --- /dev/null +++ b/Assets/Plugins/AllIn1SpriteShader/Demo/Animation/Rotate.controller.meta @@ -0,0 +1,15 @@ +fileFormatVersion: 2 +guid: 1243dd8a666ff6b4787a02084a5170d1 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 9100000 + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 156513 + packageName: All In 1 Sprite Shader + packageVersion: 4.25 + assetPath: Assets/Plugins/AllIn1SpriteShader/Demo/Animation/Rotate.controller + uploadId: 708810 diff --git a/Assets/Plugins/AllIn1SpriteShader/Demo/Animation/ScreenHit.anim b/Assets/Plugins/AllIn1SpriteShader/Demo/Animation/ScreenHit.anim new file mode 100644 index 000000000..3c95cfe1a --- /dev/null +++ b/Assets/Plugins/AllIn1SpriteShader/Demo/Animation/ScreenHit.anim @@ -0,0 +1,134 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!74 &7400000 +AnimationClip: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: ScreenHit + serializedVersion: 6 + m_Legacy: 0 + m_Compressed: 0 + m_UseHighQualityCurve: 1 + m_RotationCurves: [] + m_CompressedRotationCurves: [] + m_EulerCurves: [] + m_PositionCurves: [] + m_ScaleCurves: [] + m_FloatCurves: + - curve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 0.6 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + attribute: material._Alpha + path: HitSprite + classID: 212 + script: {fileID: 0} + m_PPtrCurves: [] + m_SampleRate: 60 + m_WrapMode: 0 + m_Bounds: + m_Center: {x: 0, y: 0, z: 0} + m_Extent: {x: 0, y: 0, z: 0} + m_ClipBindingConstant: + genericBindings: + - serializedVersion: 2 + path: 3618885906 + attribute: 2333735666 + script: {fileID: 0} + typeID: 212 + customType: 22 + isPPtrCurve: 0 + pptrCurveMapping: [] + m_AnimationClipSettings: + serializedVersion: 2 + m_AdditiveReferencePoseClip: {fileID: 0} + m_AdditiveReferencePoseTime: 0 + m_StartTime: 0 + m_StopTime: 1 + m_OrientationOffsetY: 0 + m_Level: 0 + m_CycleOffset: 0 + m_HasAdditiveReferencePose: 0 + m_LoopTime: 1 + m_LoopBlend: 0 + m_LoopBlendOrientation: 0 + m_LoopBlendPositionY: 0 + m_LoopBlendPositionXZ: 0 + m_KeepOriginalOrientation: 0 + m_KeepOriginalPositionY: 1 + m_KeepOriginalPositionXZ: 0 + m_HeightFromFeet: 0 + m_Mirror: 0 + m_EditorCurves: + - curve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 0.6 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + attribute: material._Alpha + path: HitSprite + classID: 212 + script: {fileID: 0} + m_EulerEditorCurves: [] + m_HasGenericRootTransform: 0 + m_HasMotionFloatCurves: 0 + m_Events: [] diff --git a/Assets/Plugins/AllIn1SpriteShader/Demo/Animation/ScreenHit.anim.meta b/Assets/Plugins/AllIn1SpriteShader/Demo/Animation/ScreenHit.anim.meta new file mode 100644 index 000000000..160aded65 --- /dev/null +++ b/Assets/Plugins/AllIn1SpriteShader/Demo/Animation/ScreenHit.anim.meta @@ -0,0 +1,15 @@ +fileFormatVersion: 2 +guid: 0f35df6c475fd3a47a801523e733c87a +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 7400000 + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 156513 + packageName: All In 1 Sprite Shader + packageVersion: 4.25 + assetPath: Assets/Plugins/AllIn1SpriteShader/Demo/Animation/ScreenHit.anim + uploadId: 708810 diff --git a/Assets/Plugins/AllIn1SpriteShader/Demo/Animation/ScreenHit.controller b/Assets/Plugins/AllIn1SpriteShader/Demo/Animation/ScreenHit.controller new file mode 100644 index 000000000..216b7f707 --- /dev/null +++ b/Assets/Plugins/AllIn1SpriteShader/Demo/Animation/ScreenHit.controller @@ -0,0 +1,72 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1102 &-5761580113761073130 +AnimatorState: + serializedVersion: 5 + m_ObjectHideFlags: 1 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: ScreenHit + m_Speed: 1 + m_CycleOffset: 0 + m_Transitions: [] + m_StateMachineBehaviours: [] + m_Position: {x: 50, y: 50, z: 0} + m_IKOnFeet: 0 + m_WriteDefaultValues: 1 + m_Mirror: 0 + m_SpeedParameterActive: 0 + m_MirrorParameterActive: 0 + m_CycleOffsetParameterActive: 0 + m_TimeParameterActive: 0 + m_Motion: {fileID: 7400000, guid: 0f35df6c475fd3a47a801523e733c87a, type: 2} + m_Tag: + m_SpeedParameter: + m_MirrorParameter: + m_CycleOffsetParameter: + m_TimeParameter: +--- !u!91 &9100000 +AnimatorController: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: ScreenHit + serializedVersion: 5 + m_AnimatorParameters: [] + m_AnimatorLayers: + - serializedVersion: 5 + m_Name: Base Layer + m_StateMachine: {fileID: 4855511007839786432} + m_Mask: {fileID: 0} + m_Motions: [] + m_Behaviours: [] + m_BlendingMode: 0 + m_SyncedLayerIndex: -1 + m_DefaultWeight: 0 + m_IKPass: 0 + m_SyncedLayerAffectsTiming: 0 + m_Controller: {fileID: 9100000} +--- !u!1107 &4855511007839786432 +AnimatorStateMachine: + serializedVersion: 5 + m_ObjectHideFlags: 1 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: Base Layer + m_ChildStates: + - serializedVersion: 1 + m_State: {fileID: -5761580113761073130} + m_Position: {x: 216, y: 48, z: 0} + m_ChildStateMachines: [] + m_AnyStateTransitions: [] + m_EntryTransitions: [] + m_StateMachineTransitions: {} + m_StateMachineBehaviours: [] + m_AnyStatePosition: {x: 50, y: 20, z: 0} + m_EntryPosition: {x: 50, y: 120, z: 0} + m_ExitPosition: {x: 800, y: 120, z: 0} + m_ParentStateMachinePosition: {x: 800, y: 20, z: 0} + m_DefaultState: {fileID: -5761580113761073130} diff --git a/Assets/Plugins/AllIn1SpriteShader/Demo/Animation/ScreenHit.controller.meta b/Assets/Plugins/AllIn1SpriteShader/Demo/Animation/ScreenHit.controller.meta new file mode 100644 index 000000000..09c47c937 --- /dev/null +++ b/Assets/Plugins/AllIn1SpriteShader/Demo/Animation/ScreenHit.controller.meta @@ -0,0 +1,15 @@ +fileFormatVersion: 2 +guid: 1220612ba20667d46a6e8356073b69b0 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 9100000 + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 156513 + packageName: All In 1 Sprite Shader + packageVersion: 4.25 + assetPath: Assets/Plugins/AllIn1SpriteShader/Demo/Animation/ScreenHit.controller + uploadId: 708810 diff --git a/Assets/Plugins/AllIn1SpriteShader/Demo/Animation/Shield Soldier.controller b/Assets/Plugins/AllIn1SpriteShader/Demo/Animation/Shield Soldier.controller new file mode 100644 index 000000000..b386d6856 --- /dev/null +++ b/Assets/Plugins/AllIn1SpriteShader/Demo/Animation/Shield Soldier.controller @@ -0,0 +1,72 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1107 &-4642615002787253909 +AnimatorStateMachine: + serializedVersion: 5 + m_ObjectHideFlags: 1 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: Base Layer + m_ChildStates: + - serializedVersion: 1 + m_State: {fileID: 392135796101470953} + m_Position: {x: 200, y: 0, z: 0} + m_ChildStateMachines: [] + m_AnyStateTransitions: [] + m_EntryTransitions: [] + m_StateMachineTransitions: {} + m_StateMachineBehaviours: [] + m_AnyStatePosition: {x: 50, y: 20, z: 0} + m_EntryPosition: {x: 50, y: 120, z: 0} + m_ExitPosition: {x: 800, y: 120, z: 0} + m_ParentStateMachinePosition: {x: 800, y: 20, z: 0} + m_DefaultState: {fileID: 392135796101470953} +--- !u!91 &9100000 +AnimatorController: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: Shield Soldier + serializedVersion: 5 + m_AnimatorParameters: [] + m_AnimatorLayers: + - serializedVersion: 5 + m_Name: Base Layer + m_StateMachine: {fileID: -4642615002787253909} + m_Mask: {fileID: 0} + m_Motions: [] + m_Behaviours: [] + m_BlendingMode: 0 + m_SyncedLayerIndex: -1 + m_DefaultWeight: 0 + m_IKPass: 0 + m_SyncedLayerAffectsTiming: 0 + m_Controller: {fileID: 9100000} +--- !u!1102 &392135796101470953 +AnimatorState: + serializedVersion: 5 + m_ObjectHideFlags: 1 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: ShieldSparksPS + m_Speed: 1 + m_CycleOffset: 0 + m_Transitions: [] + m_StateMachineBehaviours: [] + m_Position: {x: 50, y: 50, z: 0} + m_IKOnFeet: 0 + m_WriteDefaultValues: 1 + m_Mirror: 0 + m_SpeedParameterActive: 0 + m_MirrorParameterActive: 0 + m_CycleOffsetParameterActive: 0 + m_TimeParameterActive: 0 + m_Motion: {fileID: 7400000, guid: 4f4343d48a0bd474fa2c4abc51d18cc1, type: 2} + m_Tag: + m_SpeedParameter: + m_MirrorParameter: + m_CycleOffsetParameter: + m_TimeParameter: diff --git a/Assets/Plugins/AllIn1SpriteShader/Demo/Animation/Shield Soldier.controller.meta b/Assets/Plugins/AllIn1SpriteShader/Demo/Animation/Shield Soldier.controller.meta new file mode 100644 index 000000000..1dee31936 --- /dev/null +++ b/Assets/Plugins/AllIn1SpriteShader/Demo/Animation/Shield Soldier.controller.meta @@ -0,0 +1,15 @@ +fileFormatVersion: 2 +guid: 48122208e82681f45a0f7dda84aa301f +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 9100000 + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 156513 + packageName: All In 1 Sprite Shader + packageVersion: 4.25 + assetPath: Assets/Plugins/AllIn1SpriteShader/Demo/Animation/Shield Soldier.controller + uploadId: 708810 diff --git a/Assets/Plugins/AllIn1SpriteShader/Demo/Animation/ShieldSparksPS.anim b/Assets/Plugins/AllIn1SpriteShader/Demo/Animation/ShieldSparksPS.anim new file mode 100644 index 000000000..d40b8a5ad --- /dev/null +++ b/Assets/Plugins/AllIn1SpriteShader/Demo/Animation/ShieldSparksPS.anim @@ -0,0 +1,601 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!74 &7400000 +AnimationClip: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: ShieldSparksPS + serializedVersion: 6 + m_Legacy: 0 + m_Compressed: 0 + m_UseHighQualityCurve: 1 + m_RotationCurves: [] + m_CompressedRotationCurves: [] + m_EulerCurves: [] + m_PositionCurves: + - curve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: {x: -0.058, y: -1.801, z: -0.1} + inSlope: {x: 0, y: 0, z: 0} + outSlope: {x: 0, y: 0, z: 0} + tangentMode: 0 + weightedMode: 0 + inWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334} + outWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334} + - serializedVersion: 3 + time: 0.5 + value: {x: -0.058, y: 1.878, z: -0.1} + inSlope: {x: 0, y: 0, z: 0} + outSlope: {x: 0, y: 0, z: 0} + tangentMode: 0 + weightedMode: 0 + inWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334} + outWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334} + - serializedVersion: 3 + time: 0.53333336 + value: {x: -0.058, y: 1.878, z: -0.1} + inSlope: {x: 0, y: 0, z: 0} + outSlope: {x: 0, y: 0, z: 0} + tangentMode: 0 + weightedMode: 0 + inWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334} + outWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334} + - serializedVersion: 3 + time: 1.4833333 + value: {x: -0.058, y: 1.8665462, z: -0.1} + inSlope: {x: 0, y: -0.0022222255, z: 0} + outSlope: {x: 0, y: -0.0022222255, z: 0} + tangentMode: 0 + weightedMode: 0 + inWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334} + outWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334} + - serializedVersion: 3 + time: 1.5 + value: {x: -0.058, y: 1.8660091, z: -0.1} + inSlope: {x: 0, y: -0.004157712, z: 0} + outSlope: {x: 0, y: -0.004157712, z: 0} + tangentMode: 0 + weightedMode: 0 + inWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334} + outWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334} + - serializedVersion: 3 + time: 2 + value: {x: -0.058, y: -1.78, z: -0.1} + inSlope: {x: 0, y: 0, z: 0} + outSlope: {x: 0, y: 0, z: 0} + tangentMode: 0 + weightedMode: 0 + inWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334} + outWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334} + - serializedVersion: 3 + time: 2.5 + value: {x: -0.058, y: 1.8660091, z: -0.1} + inSlope: {x: 0, y: 0, z: 0} + outSlope: {x: 0, y: 0, z: 0} + tangentMode: 0 + weightedMode: 0 + inWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334} + outWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334} + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + path: ShieldSparksPS + m_ScaleCurves: [] + m_FloatCurves: + - curve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 0.5 + value: -0.1 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1.5 + value: -0.1 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 2 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + attribute: material._FadeAmount + path: Shield + classID: 212 + script: {fileID: 0} + - curve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 30 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 0.5 + value: 30 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 0.53333336 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1.4833333 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1.5 + value: 30 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 2 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 2.5 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + attribute: EmissionModule.rateOverTime.scalar + path: ShieldSparksPS + classID: 198 + script: {fileID: 0} + m_PPtrCurves: [] + m_SampleRate: 60 + m_WrapMode: 0 + m_Bounds: + m_Center: {x: 0, y: 0, z: 0} + m_Extent: {x: 0, y: 0, z: 0} + m_ClipBindingConstant: + genericBindings: + - serializedVersion: 2 + path: 88045128 + attribute: 1 + script: {fileID: 0} + typeID: 4 + customType: 0 + isPPtrCurve: 0 + - serializedVersion: 2 + path: 423614430 + attribute: 2375902170 + script: {fileID: 0} + typeID: 212 + customType: 22 + isPPtrCurve: 0 + - serializedVersion: 2 + path: 88045128 + attribute: 2883525743 + script: {fileID: 0} + typeID: 198 + customType: 27 + isPPtrCurve: 0 + pptrCurveMapping: [] + m_AnimationClipSettings: + serializedVersion: 2 + m_AdditiveReferencePoseClip: {fileID: 0} + m_AdditiveReferencePoseTime: 0 + m_StartTime: 0 + m_StopTime: 2.5 + m_OrientationOffsetY: 0 + m_Level: 0 + m_CycleOffset: 0 + m_HasAdditiveReferencePose: 0 + m_LoopTime: 1 + m_LoopBlend: 0 + m_LoopBlendOrientation: 0 + m_LoopBlendPositionY: 0 + m_LoopBlendPositionXZ: 0 + m_KeepOriginalOrientation: 0 + m_KeepOriginalPositionY: 1 + m_KeepOriginalPositionXZ: 0 + m_HeightFromFeet: 0 + m_Mirror: 0 + m_EditorCurves: + - curve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 0.5 + value: -0.1 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1.5 + value: -0.1 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 2 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + attribute: material._FadeAmount + path: Shield + classID: 212 + script: {fileID: 0} + - curve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: -0.058 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 0.5 + value: -0.058 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 0.53333336 + value: -0.058 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1.4833333 + value: -0.058 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1.5 + value: -0.058 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 2 + value: -0.058 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 2.5 + value: -0.058 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + attribute: m_LocalPosition.x + path: ShieldSparksPS + classID: 4 + script: {fileID: 0} + - curve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: -1.801 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 0.5 + value: 1.878 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 0.53333336 + value: 1.878 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1.4833333 + value: 1.8665462 + inSlope: -0.0022222255 + outSlope: -0.0022222255 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1.5 + value: 1.8660091 + inSlope: -0.004157712 + outSlope: -0.004157712 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 2 + value: -1.78 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 2.5 + value: 1.8660091 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + attribute: m_LocalPosition.y + path: ShieldSparksPS + classID: 4 + script: {fileID: 0} + - curve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: -0.1 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 0.5 + value: -0.1 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 0.53333336 + value: -0.1 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1.4833333 + value: -0.1 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1.5 + value: -0.1 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 2 + value: -0.1 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 2.5 + value: -0.1 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + attribute: m_LocalPosition.z + path: ShieldSparksPS + classID: 4 + script: {fileID: 0} + - curve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 30 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 0.5 + value: 30 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 0.53333336 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1.4833333 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1.5 + value: 30 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 2 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 2.5 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + attribute: EmissionModule.rateOverTime.scalar + path: ShieldSparksPS + classID: 198 + script: {fileID: 0} + m_EulerEditorCurves: [] + m_HasGenericRootTransform: 0 + m_HasMotionFloatCurves: 0 + m_Events: [] diff --git a/Assets/Plugins/AllIn1SpriteShader/Demo/Animation/ShieldSparksPS.anim.meta b/Assets/Plugins/AllIn1SpriteShader/Demo/Animation/ShieldSparksPS.anim.meta new file mode 100644 index 000000000..a1656fa47 --- /dev/null +++ b/Assets/Plugins/AllIn1SpriteShader/Demo/Animation/ShieldSparksPS.anim.meta @@ -0,0 +1,15 @@ +fileFormatVersion: 2 +guid: 4f4343d48a0bd474fa2c4abc51d18cc1 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 7400000 + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 156513 + packageName: All In 1 Sprite Shader + packageVersion: 4.25 + assetPath: Assets/Plugins/AllIn1SpriteShader/Demo/Animation/ShieldSparksPS.anim + uploadId: 708810 diff --git a/Assets/Plugins/AllIn1SpriteShader/Demo/Animation/Shine.anim b/Assets/Plugins/AllIn1SpriteShader/Demo/Animation/Shine.anim new file mode 100644 index 000000000..756ae3523 --- /dev/null +++ b/Assets/Plugins/AllIn1SpriteShader/Demo/Animation/Shine.anim @@ -0,0 +1,152 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!74 &7400000 +AnimationClip: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: Shine + serializedVersion: 6 + m_Legacy: 0 + m_Compressed: 0 + m_UseHighQualityCurve: 1 + m_RotationCurves: [] + m_CompressedRotationCurves: [] + m_EulerCurves: [] + m_PositionCurves: [] + m_ScaleCurves: [] + m_FloatCurves: + - curve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 0.6666667 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 0.8333333 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1.5 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + attribute: material._ShineLocation + path: + classID: 212 + script: {fileID: 0} + m_PPtrCurves: [] + m_SampleRate: 60 + m_WrapMode: 0 + m_Bounds: + m_Center: {x: 0, y: 0, z: 0} + m_Extent: {x: 0, y: 0, z: 0} + m_ClipBindingConstant: + genericBindings: + - serializedVersion: 2 + path: 0 + attribute: 2326997892 + script: {fileID: 0} + typeID: 212 + customType: 22 + isPPtrCurve: 0 + pptrCurveMapping: [] + m_AnimationClipSettings: + serializedVersion: 2 + m_AdditiveReferencePoseClip: {fileID: 0} + m_AdditiveReferencePoseTime: 0 + m_StartTime: 0 + m_StopTime: 1.5 + m_OrientationOffsetY: 0 + m_Level: 0 + m_CycleOffset: 0 + m_HasAdditiveReferencePose: 0 + m_LoopTime: 1 + m_LoopBlend: 0 + m_LoopBlendOrientation: 0 + m_LoopBlendPositionY: 0 + m_LoopBlendPositionXZ: 0 + m_KeepOriginalOrientation: 0 + m_KeepOriginalPositionY: 1 + m_KeepOriginalPositionXZ: 0 + m_HeightFromFeet: 0 + m_Mirror: 0 + m_EditorCurves: + - curve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 0.6666667 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 0.8333333 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1.5 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + attribute: material._ShineLocation + path: + classID: 212 + script: {fileID: 0} + m_EulerEditorCurves: [] + m_HasGenericRootTransform: 0 + m_HasMotionFloatCurves: 0 + m_Events: [] diff --git a/Assets/Plugins/AllIn1SpriteShader/Demo/Animation/Shine.anim.meta b/Assets/Plugins/AllIn1SpriteShader/Demo/Animation/Shine.anim.meta new file mode 100644 index 000000000..675f70b9c --- /dev/null +++ b/Assets/Plugins/AllIn1SpriteShader/Demo/Animation/Shine.anim.meta @@ -0,0 +1,15 @@ +fileFormatVersion: 2 +guid: a5367530cc5998b4ea48fb27bde9ad47 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 7400000 + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 156513 + packageName: All In 1 Sprite Shader + packageVersion: 4.25 + assetPath: Assets/Plugins/AllIn1SpriteShader/Demo/Animation/Shine.anim + uploadId: 708810 diff --git a/Assets/Plugins/AllIn1SpriteShader/Demo/Animation/Shine.controller b/Assets/Plugins/AllIn1SpriteShader/Demo/Animation/Shine.controller new file mode 100644 index 000000000..e6abbcc05 --- /dev/null +++ b/Assets/Plugins/AllIn1SpriteShader/Demo/Animation/Shine.controller @@ -0,0 +1,72 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1107 &-8306752329881989475 +AnimatorStateMachine: + serializedVersion: 5 + m_ObjectHideFlags: 1 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: Base Layer + m_ChildStates: + - serializedVersion: 1 + m_State: {fileID: 7241695106506440127} + m_Position: {x: 280, y: 80, z: 0} + m_ChildStateMachines: [] + m_AnyStateTransitions: [] + m_EntryTransitions: [] + m_StateMachineTransitions: {} + m_StateMachineBehaviours: [] + m_AnyStatePosition: {x: 50, y: 20, z: 0} + m_EntryPosition: {x: 50, y: 120, z: 0} + m_ExitPosition: {x: 800, y: 120, z: 0} + m_ParentStateMachinePosition: {x: 800, y: 20, z: 0} + m_DefaultState: {fileID: 7241695106506440127} +--- !u!91 &9100000 +AnimatorController: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: Shine + serializedVersion: 5 + m_AnimatorParameters: [] + m_AnimatorLayers: + - serializedVersion: 5 + m_Name: Base Layer + m_StateMachine: {fileID: -8306752329881989475} + m_Mask: {fileID: 0} + m_Motions: [] + m_Behaviours: [] + m_BlendingMode: 0 + m_SyncedLayerIndex: -1 + m_DefaultWeight: 0 + m_IKPass: 0 + m_SyncedLayerAffectsTiming: 0 + m_Controller: {fileID: 9100000} +--- !u!1102 &7241695106506440127 +AnimatorState: + serializedVersion: 5 + m_ObjectHideFlags: 1 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: Shine + m_Speed: 1 + m_CycleOffset: 0 + m_Transitions: [] + m_StateMachineBehaviours: [] + m_Position: {x: 50, y: 50, z: 0} + m_IKOnFeet: 0 + m_WriteDefaultValues: 1 + m_Mirror: 0 + m_SpeedParameterActive: 0 + m_MirrorParameterActive: 0 + m_CycleOffsetParameterActive: 0 + m_TimeParameterActive: 0 + m_Motion: {fileID: 7400000, guid: a5367530cc5998b4ea48fb27bde9ad47, type: 2} + m_Tag: + m_SpeedParameter: + m_MirrorParameter: + m_CycleOffsetParameter: + m_TimeParameter: diff --git a/Assets/Plugins/AllIn1SpriteShader/Demo/Animation/Shine.controller.meta b/Assets/Plugins/AllIn1SpriteShader/Demo/Animation/Shine.controller.meta new file mode 100644 index 000000000..bf37f4682 --- /dev/null +++ b/Assets/Plugins/AllIn1SpriteShader/Demo/Animation/Shine.controller.meta @@ -0,0 +1,15 @@ +fileFormatVersion: 2 +guid: 1b6613bf9b3fea94380070ae23178552 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 9100000 + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 156513 + packageName: All In 1 Sprite Shader + packageVersion: 4.25 + assetPath: Assets/Plugins/AllIn1SpriteShader/Demo/Animation/Shine.controller + uploadId: 708810 diff --git a/Assets/Plugins/AllIn1SpriteShader/Demo/Animation/ShinyBoy.anim b/Assets/Plugins/AllIn1SpriteShader/Demo/Animation/ShinyBoy.anim new file mode 100644 index 000000000..7057cf50b --- /dev/null +++ b/Assets/Plugins/AllIn1SpriteShader/Demo/Animation/ShinyBoy.anim @@ -0,0 +1,179 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!74 &7400000 +AnimationClip: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: ShinyBoy + serializedVersion: 6 + m_Legacy: 0 + m_Compressed: 0 + m_UseHighQualityCurve: 1 + m_RotationCurves: [] + m_CompressedRotationCurves: [] + m_EulerCurves: [] + m_PositionCurves: [] + m_ScaleCurves: [] + m_FloatCurves: + - curve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 360 + tangentMode: 69 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 360 + inSlope: 360 + outSlope: 0 + tangentMode: 69 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + attribute: material._HsvShift + path: + classID: 212 + script: {fileID: 0} + - curve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + attribute: material._ShineLocation + path: + classID: 212 + script: {fileID: 0} + m_PPtrCurves: [] + m_SampleRate: 30 + m_WrapMode: 0 + m_Bounds: + m_Center: {x: 0, y: 0, z: 0} + m_Extent: {x: 0, y: 0, z: 0} + m_ClipBindingConstant: + genericBindings: + - serializedVersion: 2 + path: 0 + attribute: 2206827623 + script: {fileID: 0} + typeID: 212 + customType: 22 + isPPtrCurve: 0 + - serializedVersion: 2 + path: 0 + attribute: 2326997892 + script: {fileID: 0} + typeID: 212 + customType: 22 + isPPtrCurve: 0 + pptrCurveMapping: [] + m_AnimationClipSettings: + serializedVersion: 2 + m_AdditiveReferencePoseClip: {fileID: 0} + m_AdditiveReferencePoseTime: 0 + m_StartTime: 0 + m_StopTime: 1 + m_OrientationOffsetY: 0 + m_Level: 0 + m_CycleOffset: 0 + m_HasAdditiveReferencePose: 0 + m_LoopTime: 1 + m_LoopBlend: 0 + m_LoopBlendOrientation: 0 + m_LoopBlendPositionY: 0 + m_LoopBlendPositionXZ: 0 + m_KeepOriginalOrientation: 0 + m_KeepOriginalPositionY: 1 + m_KeepOriginalPositionXZ: 0 + m_HeightFromFeet: 0 + m_Mirror: 0 + m_EditorCurves: + - curve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 360 + tangentMode: 69 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 360 + inSlope: 360 + outSlope: 0 + tangentMode: 69 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + attribute: material._HsvShift + path: + classID: 212 + script: {fileID: 0} + - curve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + attribute: material._ShineLocation + path: + classID: 212 + script: {fileID: 0} + m_EulerEditorCurves: [] + m_HasGenericRootTransform: 0 + m_HasMotionFloatCurves: 0 + m_Events: [] diff --git a/Assets/Plugins/AllIn1SpriteShader/Demo/Animation/ShinyBoy.anim.meta b/Assets/Plugins/AllIn1SpriteShader/Demo/Animation/ShinyBoy.anim.meta new file mode 100644 index 000000000..682b74923 --- /dev/null +++ b/Assets/Plugins/AllIn1SpriteShader/Demo/Animation/ShinyBoy.anim.meta @@ -0,0 +1,15 @@ +fileFormatVersion: 2 +guid: 025b58e8824357d47bc58c069785117d +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 7400000 + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 156513 + packageName: All In 1 Sprite Shader + packageVersion: 4.25 + assetPath: Assets/Plugins/AllIn1SpriteShader/Demo/Animation/ShinyBoy.anim + uploadId: 708810 diff --git a/Assets/Plugins/AllIn1SpriteShader/Demo/Animation/Soldier.controller b/Assets/Plugins/AllIn1SpriteShader/Demo/Animation/Soldier.controller new file mode 100644 index 000000000..618363fb8 --- /dev/null +++ b/Assets/Plugins/AllIn1SpriteShader/Demo/Animation/Soldier.controller @@ -0,0 +1,72 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1107 &-7618782969959717699 +AnimatorStateMachine: + serializedVersion: 5 + m_ObjectHideFlags: 1 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: Base Layer + m_ChildStates: + - serializedVersion: 1 + m_State: {fileID: -4193363627458388406} + m_Position: {x: 200, y: 0, z: 0} + m_ChildStateMachines: [] + m_AnyStateTransitions: [] + m_EntryTransitions: [] + m_StateMachineTransitions: {} + m_StateMachineBehaviours: [] + m_AnyStatePosition: {x: 50, y: 20, z: 0} + m_EntryPosition: {x: 50, y: 120, z: 0} + m_ExitPosition: {x: 800, y: 120, z: 0} + m_ParentStateMachinePosition: {x: 800, y: 20, z: 0} + m_DefaultState: {fileID: -4193363627458388406} +--- !u!1102 &-4193363627458388406 +AnimatorState: + serializedVersion: 5 + m_ObjectHideFlags: 1 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: SoldierRun + m_Speed: 1 + m_CycleOffset: 0 + m_Transitions: [] + m_StateMachineBehaviours: [] + m_Position: {x: 50, y: 50, z: 0} + m_IKOnFeet: 0 + m_WriteDefaultValues: 1 + m_Mirror: 0 + m_SpeedParameterActive: 0 + m_MirrorParameterActive: 0 + m_CycleOffsetParameterActive: 0 + m_TimeParameterActive: 0 + m_Motion: {fileID: 7400000, guid: f66460fd2ad94fc48953b837ae43d577, type: 2} + m_Tag: + m_SpeedParameter: + m_MirrorParameter: + m_CycleOffsetParameter: + m_TimeParameter: +--- !u!91 &9100000 +AnimatorController: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: Soldier + serializedVersion: 5 + m_AnimatorParameters: [] + m_AnimatorLayers: + - serializedVersion: 5 + m_Name: Base Layer + m_StateMachine: {fileID: -7618782969959717699} + m_Mask: {fileID: 0} + m_Motions: [] + m_Behaviours: [] + m_BlendingMode: 0 + m_SyncedLayerIndex: -1 + m_DefaultWeight: 0 + m_IKPass: 0 + m_SyncedLayerAffectsTiming: 0 + m_Controller: {fileID: 9100000} diff --git a/Assets/Plugins/AllIn1SpriteShader/Demo/Animation/Soldier.controller.meta b/Assets/Plugins/AllIn1SpriteShader/Demo/Animation/Soldier.controller.meta new file mode 100644 index 000000000..0151a8785 --- /dev/null +++ b/Assets/Plugins/AllIn1SpriteShader/Demo/Animation/Soldier.controller.meta @@ -0,0 +1,15 @@ +fileFormatVersion: 2 +guid: 2f06abfb8d5c7014299913ef4dbc450d +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 9100000 + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 156513 + packageName: All In 1 Sprite Shader + packageVersion: 4.25 + assetPath: Assets/Plugins/AllIn1SpriteShader/Demo/Animation/Soldier.controller + uploadId: 708810 diff --git a/Assets/Plugins/AllIn1SpriteShader/Demo/Animation/SoldierRun.anim b/Assets/Plugins/AllIn1SpriteShader/Demo/Animation/SoldierRun.anim new file mode 100644 index 000000000..6c1a89f6d --- /dev/null +++ b/Assets/Plugins/AllIn1SpriteShader/Demo/Animation/SoldierRun.anim @@ -0,0 +1,458 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!74 &7400000 +AnimationClip: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: SoldierRun + serializedVersion: 6 + m_Legacy: 0 + m_Compressed: 0 + m_UseHighQualityCurve: 1 + m_RotationCurves: [] + m_CompressedRotationCurves: [] + m_EulerCurves: [] + m_PositionCurves: [] + m_ScaleCurves: [] + m_FloatCurves: + - curve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 0.083333336 + value: -0.075 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 0.16666667 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + attribute: material._OffsetUvY + path: + classID: 212 + script: {fileID: 0} + - curve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 0.083333336 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 0.16666667 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + attribute: material._MainTex_ST.x + path: + classID: 212 + script: {fileID: 0} + - curve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1.1 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 0.083333336 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 0.16666667 + value: 1.1 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + attribute: material._MainTex_ST.y + path: + classID: 212 + script: {fileID: 0} + - curve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 0.083333336 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 0.16666667 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + attribute: material._MainTex_ST.z + path: + classID: 212 + script: {fileID: 0} + - curve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 0.083333336 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 0.16666667 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + attribute: material._MainTex_ST.w + path: + classID: 212 + script: {fileID: 0} + m_PPtrCurves: [] + m_SampleRate: 60 + m_WrapMode: 0 + m_Bounds: + m_Center: {x: 0, y: 0, z: 0} + m_Extent: {x: 0, y: 0, z: 0} + m_ClipBindingConstant: + genericBindings: + - serializedVersion: 2 + path: 0 + attribute: 2378220132 + script: {fileID: 0} + typeID: 212 + customType: 22 + isPPtrCurve: 0 + - serializedVersion: 2 + path: 0 + attribute: 377931145 + script: {fileID: 0} + typeID: 212 + customType: 22 + isPPtrCurve: 0 + - serializedVersion: 2 + path: 0 + attribute: 109495689 + script: {fileID: 0} + typeID: 212 + customType: 22 + isPPtrCurve: 0 + - serializedVersion: 2 + path: 0 + attribute: 646366601 + script: {fileID: 0} + typeID: 212 + customType: 22 + isPPtrCurve: 0 + - serializedVersion: 2 + path: 0 + attribute: 914802057 + script: {fileID: 0} + typeID: 212 + customType: 22 + isPPtrCurve: 0 + pptrCurveMapping: [] + m_AnimationClipSettings: + serializedVersion: 2 + m_AdditiveReferencePoseClip: {fileID: 0} + m_AdditiveReferencePoseTime: 0 + m_StartTime: 0 + m_StopTime: 0.16666667 + m_OrientationOffsetY: 0 + m_Level: 0 + m_CycleOffset: 0 + m_HasAdditiveReferencePose: 0 + m_LoopTime: 1 + m_LoopBlend: 0 + m_LoopBlendOrientation: 0 + m_LoopBlendPositionY: 0 + m_LoopBlendPositionXZ: 0 + m_KeepOriginalOrientation: 0 + m_KeepOriginalPositionY: 1 + m_KeepOriginalPositionXZ: 0 + m_HeightFromFeet: 0 + m_Mirror: 0 + m_EditorCurves: + - curve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 0.083333336 + value: -0.075 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 0.16666667 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + attribute: material._OffsetUvY + path: + classID: 212 + script: {fileID: 0} + - curve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 0.083333336 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 0.16666667 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + attribute: material._MainTex_ST.x + path: + classID: 212 + script: {fileID: 0} + - curve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1.1 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 0.083333336 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 0.16666667 + value: 1.1 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + attribute: material._MainTex_ST.y + path: + classID: 212 + script: {fileID: 0} + - curve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 0.083333336 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 0.16666667 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + attribute: material._MainTex_ST.z + path: + classID: 212 + script: {fileID: 0} + - curve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 0.083333336 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 0.16666667 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + attribute: material._MainTex_ST.w + path: + classID: 212 + script: {fileID: 0} + m_EulerEditorCurves: [] + m_HasGenericRootTransform: 0 + m_HasMotionFloatCurves: 0 + m_Events: [] diff --git a/Assets/Plugins/AllIn1SpriteShader/Demo/Animation/SoldierRun.anim.meta b/Assets/Plugins/AllIn1SpriteShader/Demo/Animation/SoldierRun.anim.meta new file mode 100644 index 000000000..d196ea453 --- /dev/null +++ b/Assets/Plugins/AllIn1SpriteShader/Demo/Animation/SoldierRun.anim.meta @@ -0,0 +1,15 @@ +fileFormatVersion: 2 +guid: f66460fd2ad94fc48953b837ae43d577 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 7400000 + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 156513 + packageName: All In 1 Sprite Shader + packageVersion: 4.25 + assetPath: Assets/Plugins/AllIn1SpriteShader/Demo/Animation/SoldierRun.anim + uploadId: 708810 diff --git a/Assets/Plugins/AllIn1SpriteShader/Demo/Animation/Sprite.controller b/Assets/Plugins/AllIn1SpriteShader/Demo/Animation/Sprite.controller new file mode 100644 index 000000000..a5687d37e --- /dev/null +++ b/Assets/Plugins/AllIn1SpriteShader/Demo/Animation/Sprite.controller @@ -0,0 +1,72 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1102 &-3627288444216986430 +AnimatorState: + serializedVersion: 5 + m_ObjectHideFlags: 1 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: MotionBlur + m_Speed: 1 + m_CycleOffset: 0 + m_Transitions: [] + m_StateMachineBehaviours: [] + m_Position: {x: 50, y: 50, z: 0} + m_IKOnFeet: 0 + m_WriteDefaultValues: 1 + m_Mirror: 0 + m_SpeedParameterActive: 0 + m_MirrorParameterActive: 0 + m_CycleOffsetParameterActive: 0 + m_TimeParameterActive: 0 + m_Motion: {fileID: 7400000, guid: e618782845320624bb758db2d2b9bf0e, type: 2} + m_Tag: + m_SpeedParameter: + m_MirrorParameter: + m_CycleOffsetParameter: + m_TimeParameter: +--- !u!1107 &-2709104361246388160 +AnimatorStateMachine: + serializedVersion: 5 + m_ObjectHideFlags: 1 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: Base Layer + m_ChildStates: + - serializedVersion: 1 + m_State: {fileID: -3627288444216986430} + m_Position: {x: 200, y: 0, z: 0} + m_ChildStateMachines: [] + m_AnyStateTransitions: [] + m_EntryTransitions: [] + m_StateMachineTransitions: {} + m_StateMachineBehaviours: [] + m_AnyStatePosition: {x: 50, y: 20, z: 0} + m_EntryPosition: {x: 50, y: 120, z: 0} + m_ExitPosition: {x: 800, y: 120, z: 0} + m_ParentStateMachinePosition: {x: 800, y: 20, z: 0} + m_DefaultState: {fileID: -3627288444216986430} +--- !u!91 &9100000 +AnimatorController: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: Sprite + serializedVersion: 5 + m_AnimatorParameters: [] + m_AnimatorLayers: + - serializedVersion: 5 + m_Name: Base Layer + m_StateMachine: {fileID: -2709104361246388160} + m_Mask: {fileID: 0} + m_Motions: [] + m_Behaviours: [] + m_BlendingMode: 0 + m_SyncedLayerIndex: -1 + m_DefaultWeight: 0 + m_IKPass: 0 + m_SyncedLayerAffectsTiming: 0 + m_Controller: {fileID: 9100000} diff --git a/Assets/Plugins/AllIn1SpriteShader/Demo/Animation/Sprite.controller.meta b/Assets/Plugins/AllIn1SpriteShader/Demo/Animation/Sprite.controller.meta new file mode 100644 index 000000000..f83320e5f --- /dev/null +++ b/Assets/Plugins/AllIn1SpriteShader/Demo/Animation/Sprite.controller.meta @@ -0,0 +1,15 @@ +fileFormatVersion: 2 +guid: 33212171a9274b947914d32a914af1a3 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 9100000 + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 156513 + packageName: All In 1 Sprite Shader + packageVersion: 4.25 + assetPath: Assets/Plugins/AllIn1SpriteShader/Demo/Animation/Sprite.controller + uploadId: 708810 diff --git a/Assets/Plugins/AllIn1SpriteShader/Demo/Animation/Teleport.anim b/Assets/Plugins/AllIn1SpriteShader/Demo/Animation/Teleport.anim new file mode 100644 index 000000000..80b911b70 --- /dev/null +++ b/Assets/Plugins/AllIn1SpriteShader/Demo/Animation/Teleport.anim @@ -0,0 +1,215 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!74 &7400000 +AnimationClip: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: Teleport + serializedVersion: 6 + m_Legacy: 0 + m_Compressed: 0 + m_UseHighQualityCurve: 1 + m_RotationCurves: [] + m_CompressedRotationCurves: [] + m_EulerCurves: [] + m_PositionCurves: [] + m_ScaleCurves: [] + m_FloatCurves: + - curve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0.5 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 0.5 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 0.85 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + attribute: material._PinchUvAmount + path: + classID: 212 + script: {fileID: 0} + - curve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 0.6 + value: -0.1 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 0.85 + value: -0.1 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + attribute: material._FadeAmount + path: + classID: 212 + script: {fileID: 0} + m_PPtrCurves: [] + m_SampleRate: 100 + m_WrapMode: 0 + m_Bounds: + m_Center: {x: 0, y: 0, z: 0} + m_Extent: {x: 0, y: 0, z: 0} + m_ClipBindingConstant: + genericBindings: + - serializedVersion: 2 + path: 0 + attribute: 2301463249 + script: {fileID: 0} + typeID: 212 + customType: 22 + isPPtrCurve: 0 + - serializedVersion: 2 + path: 0 + attribute: 2375902170 + script: {fileID: 0} + typeID: 212 + customType: 22 + isPPtrCurve: 0 + pptrCurveMapping: [] + m_AnimationClipSettings: + serializedVersion: 2 + m_AdditiveReferencePoseClip: {fileID: 0} + m_AdditiveReferencePoseTime: 0 + m_StartTime: 0 + m_StopTime: 0.85 + m_OrientationOffsetY: 0 + m_Level: 0 + m_CycleOffset: 0 + m_HasAdditiveReferencePose: 0 + m_LoopTime: 1 + m_LoopBlend: 0 + m_LoopBlendOrientation: 0 + m_LoopBlendPositionY: 0 + m_LoopBlendPositionXZ: 0 + m_KeepOriginalOrientation: 0 + m_KeepOriginalPositionY: 1 + m_KeepOriginalPositionXZ: 0 + m_HeightFromFeet: 0 + m_Mirror: 0 + m_EditorCurves: + - curve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0.5 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 0.5 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 0.85 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + attribute: material._PinchUvAmount + path: + classID: 212 + script: {fileID: 0} + - curve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 0.6 + value: -0.1 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 0.85 + value: -0.1 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + attribute: material._FadeAmount + path: + classID: 212 + script: {fileID: 0} + m_EulerEditorCurves: [] + m_HasGenericRootTransform: 0 + m_HasMotionFloatCurves: 0 + m_Events: [] diff --git a/Assets/Plugins/AllIn1SpriteShader/Demo/Animation/Teleport.anim.meta b/Assets/Plugins/AllIn1SpriteShader/Demo/Animation/Teleport.anim.meta new file mode 100644 index 000000000..6adeba276 --- /dev/null +++ b/Assets/Plugins/AllIn1SpriteShader/Demo/Animation/Teleport.anim.meta @@ -0,0 +1,15 @@ +fileFormatVersion: 2 +guid: d55cd89bba47b6c4dbfe242daad46b9e +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 7400000 + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 156513 + packageName: All In 1 Sprite Shader + packageVersion: 4.25 + assetPath: Assets/Plugins/AllIn1SpriteShader/Demo/Animation/Teleport.anim + uploadId: 708810 diff --git a/Assets/Plugins/AllIn1SpriteShader/Demo/Animation/Twist 1.controller b/Assets/Plugins/AllIn1SpriteShader/Demo/Animation/Twist 1.controller new file mode 100644 index 000000000..b4206560e --- /dev/null +++ b/Assets/Plugins/AllIn1SpriteShader/Demo/Animation/Twist 1.controller @@ -0,0 +1,147 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1102 &-7822484566270033091 +AnimatorState: + serializedVersion: 5 + m_ObjectHideFlags: 3 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: TwistDisappearInverse + m_Speed: -1 + m_CycleOffset: 0 + m_Transitions: + - {fileID: 4044203229998360206} + m_StateMachineBehaviours: [] + m_Position: {x: 50, y: 50, z: 0} + m_IKOnFeet: 0 + m_WriteDefaultValues: 1 + m_Mirror: 0 + m_SpeedParameterActive: 0 + m_MirrorParameterActive: 0 + m_CycleOffsetParameterActive: 0 + m_TimeParameterActive: 0 + m_Motion: {fileID: 7400000, guid: 0b970b1c29876434a90d1b416c2a79da, type: 2} + m_Tag: + m_SpeedParameter: + m_MirrorParameter: + m_CycleOffsetParameter: + m_TimeParameter: +--- !u!1101 &-5714200180160972232 +AnimatorStateTransition: + m_ObjectHideFlags: 1 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: + m_Conditions: [] + m_DstStateMachine: {fileID: 0} + m_DstState: {fileID: -7822484566270033091} + m_Solo: 0 + m_Mute: 0 + m_IsExit: 0 + serializedVersion: 3 + m_TransitionDuration: 0 + m_TransitionOffset: 0 + m_ExitTime: 1 + m_HasExitTime: 1 + m_HasFixedDuration: 1 + m_InterruptionSource: 0 + m_OrderedInterruption: 1 + m_CanTransitionToSelf: 1 +--- !u!1102 &-2059169651024962981 +AnimatorState: + serializedVersion: 5 + m_ObjectHideFlags: 1 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: TwistDisappear + m_Speed: 1 + m_CycleOffset: 0 + m_Transitions: + - {fileID: -5714200180160972232} + m_StateMachineBehaviours: [] + m_Position: {x: 50, y: 50, z: 0} + m_IKOnFeet: 0 + m_WriteDefaultValues: 1 + m_Mirror: 0 + m_SpeedParameterActive: 0 + m_MirrorParameterActive: 0 + m_CycleOffsetParameterActive: 0 + m_TimeParameterActive: 0 + m_Motion: {fileID: 7400000, guid: 0b970b1c29876434a90d1b416c2a79da, type: 2} + m_Tag: + m_SpeedParameter: + m_MirrorParameter: + m_CycleOffsetParameter: + m_TimeParameter: +--- !u!91 &9100000 +AnimatorController: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: Twist 1 + serializedVersion: 5 + m_AnimatorParameters: [] + m_AnimatorLayers: + - serializedVersion: 5 + m_Name: Base Layer + m_StateMachine: {fileID: 7170545140116765573} + m_Mask: {fileID: 0} + m_Motions: [] + m_Behaviours: [] + m_BlendingMode: 0 + m_SyncedLayerIndex: -1 + m_DefaultWeight: 0 + m_IKPass: 0 + m_SyncedLayerAffectsTiming: 0 + m_Controller: {fileID: 9100000} +--- !u!1101 &4044203229998360206 +AnimatorStateTransition: + m_ObjectHideFlags: 1 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: + m_Conditions: [] + m_DstStateMachine: {fileID: 0} + m_DstState: {fileID: -2059169651024962981} + m_Solo: 0 + m_Mute: 0 + m_IsExit: 0 + serializedVersion: 3 + m_TransitionDuration: 0 + m_TransitionOffset: 0 + m_ExitTime: 1 + m_HasExitTime: 1 + m_HasFixedDuration: 1 + m_InterruptionSource: 0 + m_OrderedInterruption: 1 + m_CanTransitionToSelf: 1 +--- !u!1107 &7170545140116765573 +AnimatorStateMachine: + serializedVersion: 5 + m_ObjectHideFlags: 1 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: Base Layer + m_ChildStates: + - serializedVersion: 1 + m_State: {fileID: -2059169651024962981} + m_Position: {x: 330, y: 100, z: 0} + - serializedVersion: 1 + m_State: {fileID: -7822484566270033091} + m_Position: {x: 330, y: 30, z: 0} + m_ChildStateMachines: [] + m_AnyStateTransitions: [] + m_EntryTransitions: [] + m_StateMachineTransitions: {} + m_StateMachineBehaviours: [] + m_AnyStatePosition: {x: 50, y: 20, z: 0} + m_EntryPosition: {x: 50, y: 120, z: 0} + m_ExitPosition: {x: 800, y: 120, z: 0} + m_ParentStateMachinePosition: {x: 800, y: 20, z: 0} + m_DefaultState: {fileID: -2059169651024962981} diff --git a/Assets/Plugins/AllIn1SpriteShader/Demo/Animation/Twist 1.controller.meta b/Assets/Plugins/AllIn1SpriteShader/Demo/Animation/Twist 1.controller.meta new file mode 100644 index 000000000..8f5be19e0 --- /dev/null +++ b/Assets/Plugins/AllIn1SpriteShader/Demo/Animation/Twist 1.controller.meta @@ -0,0 +1,15 @@ +fileFormatVersion: 2 +guid: fe198228e3a49df4b966ab214ec9cde5 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 9100000 + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 156513 + packageName: All In 1 Sprite Shader + packageVersion: 4.25 + assetPath: Assets/Plugins/AllIn1SpriteShader/Demo/Animation/Twist 1.controller + uploadId: 708810 diff --git a/Assets/Plugins/AllIn1SpriteShader/Demo/Animation/Twist.anim b/Assets/Plugins/AllIn1SpriteShader/Demo/Animation/Twist.anim new file mode 100644 index 000000000..5b4946eed --- /dev/null +++ b/Assets/Plugins/AllIn1SpriteShader/Demo/Animation/Twist.anim @@ -0,0 +1,134 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!74 &7400000 +AnimationClip: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: Twist + serializedVersion: 6 + m_Legacy: 0 + m_Compressed: 0 + m_UseHighQualityCurve: 1 + m_RotationCurves: [] + m_CompressedRotationCurves: [] + m_EulerCurves: [] + m_PositionCurves: [] + m_ScaleCurves: [] + m_FloatCurves: + - curve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 0.5 + value: 1.56 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + attribute: material._TwistUvAmount + path: + classID: 212 + script: {fileID: 0} + m_PPtrCurves: [] + m_SampleRate: 40 + m_WrapMode: 0 + m_Bounds: + m_Center: {x: 0, y: 0, z: 0} + m_Extent: {x: 0, y: 0, z: 0} + m_ClipBindingConstant: + genericBindings: + - serializedVersion: 2 + path: 0 + attribute: 2296183723 + script: {fileID: 0} + typeID: 212 + customType: 22 + isPPtrCurve: 0 + pptrCurveMapping: [] + m_AnimationClipSettings: + serializedVersion: 2 + m_AdditiveReferencePoseClip: {fileID: 0} + m_AdditiveReferencePoseTime: 0 + m_StartTime: 0 + m_StopTime: 1 + m_OrientationOffsetY: 0 + m_Level: 0 + m_CycleOffset: 0 + m_HasAdditiveReferencePose: 0 + m_LoopTime: 1 + m_LoopBlend: 0 + m_LoopBlendOrientation: 0 + m_LoopBlendPositionY: 0 + m_LoopBlendPositionXZ: 0 + m_KeepOriginalOrientation: 0 + m_KeepOriginalPositionY: 1 + m_KeepOriginalPositionXZ: 0 + m_HeightFromFeet: 0 + m_Mirror: 0 + m_EditorCurves: + - curve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 0.5 + value: 1.56 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + attribute: material._TwistUvAmount + path: + classID: 212 + script: {fileID: 0} + m_EulerEditorCurves: [] + m_HasGenericRootTransform: 0 + m_HasMotionFloatCurves: 0 + m_Events: [] diff --git a/Assets/Plugins/AllIn1SpriteShader/Demo/Animation/Twist.anim.meta b/Assets/Plugins/AllIn1SpriteShader/Demo/Animation/Twist.anim.meta new file mode 100644 index 000000000..0e16bd977 --- /dev/null +++ b/Assets/Plugins/AllIn1SpriteShader/Demo/Animation/Twist.anim.meta @@ -0,0 +1,15 @@ +fileFormatVersion: 2 +guid: 4d7af8b9ba927a74ca451c409cb63239 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 7400000 + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 156513 + packageName: All In 1 Sprite Shader + packageVersion: 4.25 + assetPath: Assets/Plugins/AllIn1SpriteShader/Demo/Animation/Twist.anim + uploadId: 708810 diff --git a/Assets/Plugins/AllIn1SpriteShader/Demo/Animation/Twist.controller b/Assets/Plugins/AllIn1SpriteShader/Demo/Animation/Twist.controller new file mode 100644 index 000000000..0f365ff2f --- /dev/null +++ b/Assets/Plugins/AllIn1SpriteShader/Demo/Animation/Twist.controller @@ -0,0 +1,72 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1107 &-94178637910970603 +AnimatorStateMachine: + serializedVersion: 5 + m_ObjectHideFlags: 1 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: Base Layer + m_ChildStates: + - serializedVersion: 1 + m_State: {fileID: 7878794423122388568} + m_Position: {x: 200, y: 0, z: 0} + m_ChildStateMachines: [] + m_AnyStateTransitions: [] + m_EntryTransitions: [] + m_StateMachineTransitions: {} + m_StateMachineBehaviours: [] + m_AnyStatePosition: {x: 50, y: 20, z: 0} + m_EntryPosition: {x: 50, y: 120, z: 0} + m_ExitPosition: {x: 800, y: 120, z: 0} + m_ParentStateMachinePosition: {x: 800, y: 20, z: 0} + m_DefaultState: {fileID: 7878794423122388568} +--- !u!91 &9100000 +AnimatorController: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: Twist + serializedVersion: 5 + m_AnimatorParameters: [] + m_AnimatorLayers: + - serializedVersion: 5 + m_Name: Base Layer + m_StateMachine: {fileID: -94178637910970603} + m_Mask: {fileID: 0} + m_Motions: [] + m_Behaviours: [] + m_BlendingMode: 0 + m_SyncedLayerIndex: -1 + m_DefaultWeight: 0 + m_IKPass: 0 + m_SyncedLayerAffectsTiming: 0 + m_Controller: {fileID: 9100000} +--- !u!1102 &7878794423122388568 +AnimatorState: + serializedVersion: 5 + m_ObjectHideFlags: 1 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: Twist + m_Speed: 1 + m_CycleOffset: 0 + m_Transitions: [] + m_StateMachineBehaviours: [] + m_Position: {x: 50, y: 50, z: 0} + m_IKOnFeet: 0 + m_WriteDefaultValues: 1 + m_Mirror: 0 + m_SpeedParameterActive: 0 + m_MirrorParameterActive: 0 + m_CycleOffsetParameterActive: 0 + m_TimeParameterActive: 0 + m_Motion: {fileID: 7400000, guid: 4d7af8b9ba927a74ca451c409cb63239, type: 2} + m_Tag: + m_SpeedParameter: + m_MirrorParameter: + m_CycleOffsetParameter: + m_TimeParameter: diff --git a/Assets/Plugins/AllIn1SpriteShader/Demo/Animation/Twist.controller.meta b/Assets/Plugins/AllIn1SpriteShader/Demo/Animation/Twist.controller.meta new file mode 100644 index 000000000..945ead57f --- /dev/null +++ b/Assets/Plugins/AllIn1SpriteShader/Demo/Animation/Twist.controller.meta @@ -0,0 +1,15 @@ +fileFormatVersion: 2 +guid: ed827ed402dcef3458313b21158b5c7c +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 9100000 + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 156513 + packageName: All In 1 Sprite Shader + packageVersion: 4.25 + assetPath: Assets/Plugins/AllIn1SpriteShader/Demo/Animation/Twist.controller + uploadId: 708810 diff --git a/Assets/Plugins/AllIn1SpriteShader/Demo/Animation/TwistDisappear.anim b/Assets/Plugins/AllIn1SpriteShader/Demo/Animation/TwistDisappear.anim new file mode 100644 index 000000000..f546044d9 --- /dev/null +++ b/Assets/Plugins/AllIn1SpriteShader/Demo/Animation/TwistDisappear.anim @@ -0,0 +1,647 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!74 &7400000 +AnimationClip: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: TwistDisappear + serializedVersion: 6 + m_Legacy: 0 + m_Compressed: 0 + m_UseHighQualityCurve: 1 + m_RotationCurves: [] + m_CompressedRotationCurves: [] + m_EulerCurves: [] + m_PositionCurves: [] + m_ScaleCurves: [] + m_FloatCurves: + - curve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 0.41666666 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1.1666666 + value: 6.28 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1.4833333 + value: 6.28 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + attribute: material._RotateUvAmount + path: + classID: 212 + script: {fileID: 0} + - curve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 0.41666666 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1.1666666 + value: 1.58 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1.4833333 + value: 1.58 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + attribute: material._TwistUvAmount + path: + classID: 212 + script: {fileID: 0} + - curve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 0.41666666 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1.1666666 + value: 0.5 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1.4833333 + value: 0.5 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + attribute: material._PinchUvAmount + path: + classID: 212 + script: {fileID: 0} + - curve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 0.41666666 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1.1666666 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1.4833333 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + attribute: material._Alpha + path: + classID: 212 + script: {fileID: 0} + - curve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 0.41666666 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1.1666666 + value: 5 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1.4833333 + value: 5 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + attribute: material._Glow + path: + classID: 212 + script: {fileID: 0} + - curve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 0.41666666 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1.1666666 + value: 360 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1.4833333 + value: 360 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + attribute: material._HsvShift + path: + classID: 212 + script: {fileID: 0} + m_PPtrCurves: [] + m_SampleRate: 60 + m_WrapMode: 0 + m_Bounds: + m_Center: {x: 0, y: 0, z: 0} + m_Extent: {x: 0, y: 0, z: 0} + m_ClipBindingConstant: + genericBindings: + - serializedVersion: 2 + path: 0 + attribute: 2278947341 + script: {fileID: 0} + typeID: 212 + customType: 22 + isPPtrCurve: 0 + - serializedVersion: 2 + path: 0 + attribute: 2296183723 + script: {fileID: 0} + typeID: 212 + customType: 22 + isPPtrCurve: 0 + - serializedVersion: 2 + path: 0 + attribute: 2301463249 + script: {fileID: 0} + typeID: 212 + customType: 22 + isPPtrCurve: 0 + - serializedVersion: 2 + path: 0 + attribute: 2333735666 + script: {fileID: 0} + typeID: 212 + customType: 22 + isPPtrCurve: 0 + - serializedVersion: 2 + path: 0 + attribute: 2271964720 + script: {fileID: 0} + typeID: 212 + customType: 22 + isPPtrCurve: 0 + - serializedVersion: 2 + path: 0 + attribute: 2206827623 + script: {fileID: 0} + typeID: 212 + customType: 22 + isPPtrCurve: 0 + pptrCurveMapping: [] + m_AnimationClipSettings: + serializedVersion: 2 + m_AdditiveReferencePoseClip: {fileID: 0} + m_AdditiveReferencePoseTime: 0 + m_StartTime: 0 + m_StopTime: 1.4833333 + m_OrientationOffsetY: 0 + m_Level: 0 + m_CycleOffset: 0 + m_HasAdditiveReferencePose: 0 + m_LoopTime: 1 + m_LoopBlend: 0 + m_LoopBlendOrientation: 0 + m_LoopBlendPositionY: 0 + m_LoopBlendPositionXZ: 0 + m_KeepOriginalOrientation: 0 + m_KeepOriginalPositionY: 1 + m_KeepOriginalPositionXZ: 0 + m_HeightFromFeet: 0 + m_Mirror: 0 + m_EditorCurves: + - curve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 0.41666666 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1.1666666 + value: 6.28 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1.4833333 + value: 6.28 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + attribute: material._RotateUvAmount + path: + classID: 212 + script: {fileID: 0} + - curve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 0.41666666 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1.1666666 + value: 1.58 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1.4833333 + value: 1.58 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + attribute: material._TwistUvAmount + path: + classID: 212 + script: {fileID: 0} + - curve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 0.41666666 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1.1666666 + value: 0.5 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1.4833333 + value: 0.5 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + attribute: material._PinchUvAmount + path: + classID: 212 + script: {fileID: 0} + - curve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 0.41666666 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1.1666666 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1.4833333 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + attribute: material._Alpha + path: + classID: 212 + script: {fileID: 0} + - curve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 0.41666666 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1.1666666 + value: 5 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1.4833333 + value: 5 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + attribute: material._Glow + path: + classID: 212 + script: {fileID: 0} + - curve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 0.41666666 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1.1666666 + value: 360 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1.4833333 + value: 360 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + attribute: material._HsvShift + path: + classID: 212 + script: {fileID: 0} + m_EulerEditorCurves: [] + m_HasGenericRootTransform: 0 + m_HasMotionFloatCurves: 0 + m_Events: [] diff --git a/Assets/Plugins/AllIn1SpriteShader/Demo/Animation/TwistDisappear.anim.meta b/Assets/Plugins/AllIn1SpriteShader/Demo/Animation/TwistDisappear.anim.meta new file mode 100644 index 000000000..bea6d9ca1 --- /dev/null +++ b/Assets/Plugins/AllIn1SpriteShader/Demo/Animation/TwistDisappear.anim.meta @@ -0,0 +1,15 @@ +fileFormatVersion: 2 +guid: 0b970b1c29876434a90d1b416c2a79da +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 7400000 + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 156513 + packageName: All In 1 Sprite Shader + packageVersion: 4.25 + assetPath: Assets/Plugins/AllIn1SpriteShader/Demo/Animation/TwistDisappear.anim + uploadId: 708810 diff --git a/Assets/Plugins/AllIn1SpriteShader/Demo/Animation/Zoom.anim b/Assets/Plugins/AllIn1SpriteShader/Demo/Animation/Zoom.anim new file mode 100644 index 000000000..3f8e6974b --- /dev/null +++ b/Assets/Plugins/AllIn1SpriteShader/Demo/Animation/Zoom.anim @@ -0,0 +1,134 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!74 &7400000 +AnimationClip: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: Zoom + serializedVersion: 6 + m_Legacy: 0 + m_Compressed: 0 + m_UseHighQualityCurve: 1 + m_RotationCurves: [] + m_CompressedRotationCurves: [] + m_EulerCurves: [] + m_PositionCurves: [] + m_ScaleCurves: [] + m_FloatCurves: + - curve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0.87 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 0.33333334 + value: 0.21 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 0.6666667 + value: 0.87 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + attribute: material._ZoomUvAmount + path: + classID: 212 + script: {fileID: 0} + m_PPtrCurves: [] + m_SampleRate: 60 + m_WrapMode: 0 + m_Bounds: + m_Center: {x: 0, y: 0, z: 0} + m_Extent: {x: 0, y: 0, z: 0} + m_ClipBindingConstant: + genericBindings: + - serializedVersion: 2 + path: 0 + attribute: 2208268607 + script: {fileID: 0} + typeID: 212 + customType: 22 + isPPtrCurve: 0 + pptrCurveMapping: [] + m_AnimationClipSettings: + serializedVersion: 2 + m_AdditiveReferencePoseClip: {fileID: 0} + m_AdditiveReferencePoseTime: 0 + m_StartTime: 0 + m_StopTime: 0.6666667 + m_OrientationOffsetY: 0 + m_Level: 0 + m_CycleOffset: 0 + m_HasAdditiveReferencePose: 0 + m_LoopTime: 1 + m_LoopBlend: 0 + m_LoopBlendOrientation: 0 + m_LoopBlendPositionY: 0 + m_LoopBlendPositionXZ: 0 + m_KeepOriginalOrientation: 0 + m_KeepOriginalPositionY: 1 + m_KeepOriginalPositionXZ: 0 + m_HeightFromFeet: 0 + m_Mirror: 0 + m_EditorCurves: + - curve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0.87 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 0.33333334 + value: 0.21 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 0.6666667 + value: 0.87 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + attribute: material._ZoomUvAmount + path: + classID: 212 + script: {fileID: 0} + m_EulerEditorCurves: [] + m_HasGenericRootTransform: 0 + m_HasMotionFloatCurves: 0 + m_Events: [] diff --git a/Assets/Plugins/AllIn1SpriteShader/Demo/Animation/Zoom.anim.meta b/Assets/Plugins/AllIn1SpriteShader/Demo/Animation/Zoom.anim.meta new file mode 100644 index 000000000..20f91279f --- /dev/null +++ b/Assets/Plugins/AllIn1SpriteShader/Demo/Animation/Zoom.anim.meta @@ -0,0 +1,15 @@ +fileFormatVersion: 2 +guid: 609d80679704fe540a7be47d8ddd8eef +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 7400000 + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 156513 + packageName: All In 1 Sprite Shader + packageVersion: 4.25 + assetPath: Assets/Plugins/AllIn1SpriteShader/Demo/Animation/Zoom.anim + uploadId: 708810 diff --git a/Assets/Plugins/AllIn1SpriteShader/Demo/Animation/Zoom.controller b/Assets/Plugins/AllIn1SpriteShader/Demo/Animation/Zoom.controller new file mode 100644 index 000000000..f2c1c042e --- /dev/null +++ b/Assets/Plugins/AllIn1SpriteShader/Demo/Animation/Zoom.controller @@ -0,0 +1,72 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1102 &-1086332058936838499 +AnimatorState: + serializedVersion: 5 + m_ObjectHideFlags: 1 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: Zoom + m_Speed: 1 + m_CycleOffset: 0 + m_Transitions: [] + m_StateMachineBehaviours: [] + m_Position: {x: 50, y: 50, z: 0} + m_IKOnFeet: 0 + m_WriteDefaultValues: 1 + m_Mirror: 0 + m_SpeedParameterActive: 0 + m_MirrorParameterActive: 0 + m_CycleOffsetParameterActive: 0 + m_TimeParameterActive: 0 + m_Motion: {fileID: 7400000, guid: 609d80679704fe540a7be47d8ddd8eef, type: 2} + m_Tag: + m_SpeedParameter: + m_MirrorParameter: + m_CycleOffsetParameter: + m_TimeParameter: +--- !u!91 &9100000 +AnimatorController: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: Zoom + serializedVersion: 5 + m_AnimatorParameters: [] + m_AnimatorLayers: + - serializedVersion: 5 + m_Name: Base Layer + m_StateMachine: {fileID: 8956640337037327091} + m_Mask: {fileID: 0} + m_Motions: [] + m_Behaviours: [] + m_BlendingMode: 0 + m_SyncedLayerIndex: -1 + m_DefaultWeight: 0 + m_IKPass: 0 + m_SyncedLayerAffectsTiming: 0 + m_Controller: {fileID: 9100000} +--- !u!1107 &8956640337037327091 +AnimatorStateMachine: + serializedVersion: 5 + m_ObjectHideFlags: 1 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: Base Layer + m_ChildStates: + - serializedVersion: 1 + m_State: {fileID: -1086332058936838499} + m_Position: {x: 200, y: 0, z: 0} + m_ChildStateMachines: [] + m_AnyStateTransitions: [] + m_EntryTransitions: [] + m_StateMachineTransitions: {} + m_StateMachineBehaviours: [] + m_AnyStatePosition: {x: 50, y: 20, z: 0} + m_EntryPosition: {x: 50, y: 120, z: 0} + m_ExitPosition: {x: 800, y: 120, z: 0} + m_ParentStateMachinePosition: {x: 800, y: 20, z: 0} + m_DefaultState: {fileID: -1086332058936838499} diff --git a/Assets/Plugins/AllIn1SpriteShader/Demo/Animation/Zoom.controller.meta b/Assets/Plugins/AllIn1SpriteShader/Demo/Animation/Zoom.controller.meta new file mode 100644 index 000000000..28dec4164 --- /dev/null +++ b/Assets/Plugins/AllIn1SpriteShader/Demo/Animation/Zoom.controller.meta @@ -0,0 +1,15 @@ +fileFormatVersion: 2 +guid: f63147b3bd9ae6949be2ad05c6679dd5 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 9100000 + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 156513 + packageName: All In 1 Sprite Shader + packageVersion: 4.25 + assetPath: Assets/Plugins/AllIn1SpriteShader/Demo/Animation/Zoom.controller + uploadId: 708810 diff --git a/Assets/Plugins/AllIn1SpriteShader/Demo/Animation/hpBar.anim b/Assets/Plugins/AllIn1SpriteShader/Demo/Animation/hpBar.anim new file mode 100644 index 000000000..f1eb29eab --- /dev/null +++ b/Assets/Plugins/AllIn1SpriteShader/Demo/Animation/hpBar.anim @@ -0,0 +1,134 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!74 &7400000 +AnimationClip: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: hpBar + serializedVersion: 6 + m_Legacy: 0 + m_Compressed: 0 + m_UseHighQualityCurve: 1 + m_RotationCurves: [] + m_CompressedRotationCurves: [] + m_EulerCurves: [] + m_PositionCurves: [] + m_ScaleCurves: [] + m_FloatCurves: + - curve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 0.5 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + attribute: material._ClipUvRight + path: Front + classID: 212 + script: {fileID: 0} + m_PPtrCurves: [] + m_SampleRate: 60 + m_WrapMode: 0 + m_Bounds: + m_Center: {x: 0, y: 0, z: 0} + m_Extent: {x: 0, y: 0, z: 0} + m_ClipBindingConstant: + genericBindings: + - serializedVersion: 2 + path: 1060785650 + attribute: 2187639724 + script: {fileID: 0} + typeID: 212 + customType: 22 + isPPtrCurve: 0 + pptrCurveMapping: [] + m_AnimationClipSettings: + serializedVersion: 2 + m_AdditiveReferencePoseClip: {fileID: 0} + m_AdditiveReferencePoseTime: 0 + m_StartTime: 0 + m_StopTime: 1 + m_OrientationOffsetY: 0 + m_Level: 0 + m_CycleOffset: 0 + m_HasAdditiveReferencePose: 0 + m_LoopTime: 1 + m_LoopBlend: 0 + m_LoopBlendOrientation: 0 + m_LoopBlendPositionY: 0 + m_LoopBlendPositionXZ: 0 + m_KeepOriginalOrientation: 0 + m_KeepOriginalPositionY: 1 + m_KeepOriginalPositionXZ: 0 + m_HeightFromFeet: 0 + m_Mirror: 0 + m_EditorCurves: + - curve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 0.5 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 136 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + attribute: material._ClipUvRight + path: Front + classID: 212 + script: {fileID: 0} + m_EulerEditorCurves: [] + m_HasGenericRootTransform: 0 + m_HasMotionFloatCurves: 0 + m_Events: [] diff --git a/Assets/Plugins/AllIn1SpriteShader/Demo/Animation/hpBar.anim.meta b/Assets/Plugins/AllIn1SpriteShader/Demo/Animation/hpBar.anim.meta new file mode 100644 index 000000000..a51aec7c5 --- /dev/null +++ b/Assets/Plugins/AllIn1SpriteShader/Demo/Animation/hpBar.anim.meta @@ -0,0 +1,15 @@ +fileFormatVersion: 2 +guid: 6183fddabf104ce47abe341327074864 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 7400000 + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 156513 + packageName: All In 1 Sprite Shader + packageVersion: 4.25 + assetPath: Assets/Plugins/AllIn1SpriteShader/Demo/Animation/hpBar.anim + uploadId: 708810 diff --git a/Assets/Plugins/AllIn1SpriteShader/Demo/Demo.unity b/Assets/Plugins/AllIn1SpriteShader/Demo/Demo.unity new file mode 100644 index 000000000..d67e0bbef --- /dev/null +++ b/Assets/Plugins/AllIn1SpriteShader/Demo/Demo.unity @@ -0,0 +1,56947 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!29 &1 +OcclusionCullingSettings: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_OcclusionBakeSettings: + smallestOccluder: 5 + smallestHole: 0.25 + backfaceThreshold: 100 + m_SceneGUID: 00000000000000000000000000000000 + m_OcclusionCullingData: {fileID: 0} +--- !u!104 &2 +RenderSettings: + m_ObjectHideFlags: 0 + serializedVersion: 9 + m_Fog: 0 + m_FogColor: {r: 0.5, g: 0.5, b: 0.5, a: 1} + m_FogMode: 3 + m_FogDensity: 0.01 + m_LinearFogStart: 0 + m_LinearFogEnd: 300 + m_AmbientSkyColor: {r: 0.212, g: 0.227, b: 0.259, a: 1} + m_AmbientEquatorColor: {r: 0.114, g: 0.125, b: 0.133, a: 1} + m_AmbientGroundColor: {r: 0.047, g: 0.043, b: 0.035, a: 1} + m_AmbientIntensity: 1 + m_AmbientMode: 3 + m_SubtractiveShadowColor: {r: 0.42, g: 0.478, b: 0.627, a: 1} + m_SkyboxMaterial: {fileID: 0} + m_HaloStrength: 0.5 + m_FlareStrength: 1 + m_FlareFadeSpeed: 3 + m_HaloTexture: {fileID: 0} + m_SpotCookie: {fileID: 10001, guid: 0000000000000000e000000000000000, type: 0} + m_DefaultReflectionMode: 0 + m_DefaultReflectionResolution: 128 + m_ReflectionBounces: 1 + m_ReflectionIntensity: 1 + m_CustomReflection: {fileID: 0} + m_Sun: {fileID: 0} + m_IndirectSpecularColor: {r: 0, g: 0, b: 0, a: 1} + m_UseRadianceAmbientProbe: 0 +--- !u!157 &3 +LightmapSettings: + m_ObjectHideFlags: 0 + serializedVersion: 11 + m_GIWorkflowMode: 1 + m_GISettings: + serializedVersion: 2 + m_BounceScale: 1 + m_IndirectOutputScale: 1 + m_AlbedoBoost: 1 + m_EnvironmentLightingMode: 0 + m_EnableBakedLightmaps: 0 + m_EnableRealtimeLightmaps: 0 + m_LightmapEditorSettings: + serializedVersion: 12 + m_Resolution: 2 + m_BakeResolution: 40 + m_AtlasSize: 1024 + m_AO: 0 + m_AOMaxDistance: 1 + m_CompAOExponent: 1 + m_CompAOExponentDirect: 0 + m_ExtractAmbientOcclusion: 0 + m_Padding: 2 + m_LightmapParameters: {fileID: 0} + m_LightmapsBakeMode: 1 + m_TextureCompression: 1 + m_FinalGather: 0 + m_FinalGatherFiltering: 1 + m_FinalGatherRayCount: 256 + m_ReflectionCompression: 2 + m_MixedBakeMode: 2 + m_BakeBackend: 1 + m_PVRSampling: 1 + m_PVRDirectSampleCount: 32 + m_PVRSampleCount: 512 + m_PVRBounces: 2 + m_PVREnvironmentSampleCount: 512 + m_PVREnvironmentReferencePointCount: 2048 + m_PVRFilteringMode: 2 + m_PVRDenoiserTypeDirect: 0 + m_PVRDenoiserTypeIndirect: 0 + m_PVRDenoiserTypeAO: 0 + m_PVRFilterTypeDirect: 0 + m_PVRFilterTypeIndirect: 0 + m_PVRFilterTypeAO: 0 + m_PVREnvironmentMIS: 0 + m_PVRCulling: 1 + m_PVRFilteringGaussRadiusDirect: 1 + m_PVRFilteringGaussRadiusIndirect: 5 + m_PVRFilteringGaussRadiusAO: 2 + m_PVRFilteringAtrousPositionSigmaDirect: 0.5 + m_PVRFilteringAtrousPositionSigmaIndirect: 2 + m_PVRFilteringAtrousPositionSigmaAO: 1 + m_ExportTrainingData: 0 + m_TrainingDataDestination: TrainingData + m_LightProbeSampleCountMultiplier: 4 + m_LightingDataAsset: {fileID: 0} + m_UseShadowmask: 1 +--- !u!196 &4 +NavMeshSettings: + serializedVersion: 2 + m_ObjectHideFlags: 0 + m_BuildSettings: + serializedVersion: 2 + agentTypeID: 0 + agentRadius: 0.5 + agentHeight: 2 + agentSlope: 45 + agentClimb: 0.4 + ledgeDropHeight: 0 + maxJumpAcrossDistance: 0 + minRegionArea: 2 + manualCellSize: 0 + cellSize: 0.16666667 + manualTileSize: 0 + tileSize: 256 + accuratePlacement: 0 + debug: + m_Flags: 0 + m_NavMeshData: {fileID: 0} +--- !u!21 &7746739 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: AllIn1SpriteShader/AllIn1SpriteShader + m_Shader: {fileID: 4800000, guid: a36b7719ff0465b42ab1407d67672c5f, type: 3} + m_ShaderKeywords: ETC1_EXTERNAL_ALPHA OUTBASE8DIR_ON OUTBASE_ON _OUTLINE8DIRECTIONS_ON + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _ColorRampTex: + m_Texture: {fileID: 2800000, guid: 279657edc397ece4b8029c727adf6ddc, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ColorRampTexGradient: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ColorSwapTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DistortTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _FadeBurnTex: + m_Texture: {fileID: 2800000, guid: 32e8df0008bebe746b1681a71c61f31c, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _FadeTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _GlowTex: + 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} + - _OutlineDistortTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OutlineTex: + m_Texture: {fileID: 2800000, guid: 74087f6d03f233e4a8a142fa01f9e5cf, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OverlayTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ShineMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - _Alpha: 1 + - _AlphaCutoffValue: 0.25 + - _AlphaOutlineBlend: 1 + - _AlphaOutlineGlow: 5 + - _AlphaOutlineMinAlpha: 0 + - _AlphaOutlinePower: 1 + - _AlphaRoundThreshold: 0.5 + - _BillboardY: 0 + - _BlurHD: 0 + - _BlurIntensity: 10 + - _Brightness: 0 + - _ChromAberrAlpha: 0.4 + - _ChromAberrAmount: 1 + - _ClipUvDown: 1 + - _ClipUvLeft: 1 + - _ClipUvRight: 1 + - _ClipUvUp: 1 + - _ColorChangeLuminosity: 0 + - _ColorChangeTolerance: 0.25 + - _ColorChangeTolerance2: 0.25 + - _ColorChangeTolerance3: 0.25 + - _ColorRampBlend: 1 + - _ColorRampLuminosity: 0 + - _ColorRampOutline: 0 + - _ColorSwapBlend: 1 + - _ColorSwapBlueLuminosity: 0.5 + - _ColorSwapGreenLuminosity: 0.5 + - _ColorSwapRedLuminosity: 0.5 + - _Contrast: 1 + - _CullingOption: 0 + - _DistortAmount: 0.5 + - _DistortTexXSpeed: 5 + - _DistortTexYSpeed: 5 + - _EditorDrawers: 6 + - _FadeAmount: -0.1 + - _FadeBurnGlow: 2 + - _FadeBurnTransition: 0.075 + - _FadeBurnWidth: 0.025 + - _FishEyeUvAmount: 0.35 + - _FlickerAlpha: 0 + - _FlickerFreq: 0.2 + - _FlickerPercent: 0.05 + - _GhostBlend: 1 + - _GhostColorBoost: 1 + - _GhostTransparency: 0 + - _GlitchAmount: 3 + - _GlitchSize: 1 + - _Glow: 10 + - _GlowGlobal: 1 + - _GlowTexUsed: 0 + - _GradBlend: 1 + - _GradBoostX: 1.2 + - _GradBoostY: 1.2 + - _GradIsRadial: 0 + - _GrassManualAnim: 1 + - _GrassManualToggle: 0 + - _GrassRadialBend: 0.25 + - _GrassSpeed: 2 + - _GrassWind: 20 + - _GreyscaleBlend: 1 + - _GreyscaleLuminosity: 0 + - _GreyscaleOutline: 0 + - _HandDrawnAmount: 10 + - _HandDrawnSpeed: 5 + - _HitEffectBlend: 1 + - _HitEffectGlow: 5 + - _HologramBlend: 1 + - _HologramFlickerAlpha: 0 + - _HologramFlickerFreq: 0.2 + - _HologramFlickerPercent: 0.05 + - _HologramMaxAlpha: 1 + - _HologramMinAlpha: 0 + - _HologramStripesAlpha: 0.4 + - _HologramStripesAmount: 50 + - _HologramStripesFill: 0.4 + - _HologramStripesLuminosity: 1 + - _HologramStripesSpeed: 5 + - _HologramUnmodAmount: 0.4 + - _HsvBright: 1 + - _HsvSaturation: 1 + - _HsvShift: 180 + - _InnerOutlineAlpha: 1 + - _InnerOutlineGlow: 1 + - _InnerOutlineThickness: 1 + - _MaxXUV: 1 + - _MaxYUV: 1 + - _MinXUV: 0 + - _MinYUV: 0 + - _MotionBlurAngle: 0.1 + - _MotionBlurDist: 1.25 + - _MyDstMode: 10 + - _MySrcMode: 5 + - _NegativeAmount: 1 + - _OffsetUvX: 0 + - _OffsetUvY: 0 + - _OnlyInnerOutline: 0 + - _OnlyOutline: 0 + - _Outline8Directions: 1 + - _OutlineAlpha: 1 + - _OutlineDistortAmount: 0.5 + - _OutlineDistortTexXSpeed: 5 + - _OutlineDistortTexYSpeed: 5 + - _OutlineDistortToggle: 0 + - _OutlineGlow: 1.5 + - _OutlineIsPixel: 0 + - _OutlinePixelWidth: 1 + - _OutlineTexGrey: 0 + - _OutlineTexToggle: 0 + - _OutlineTexXSpeed: 10 + - _OutlineTexYSpeed: 0 + - _OutlineWidth: 0.016 + - _OverlayBlend: 1 + - _OverlayGlow: 1 + - _OverlayTextureScrollXSpeed: 0.25 + - _OverlayTextureScrollYSpeed: 0.25 + - _PinchUvAmount: 0.35 + - _PixelateSize: 32 + - _PosterizeGamma: 0.75 + - _PosterizeNumColors: 8 + - _PosterizeOutline: 0 + - _RadialClip: 45 + - _RadialClip2: 0 + - _RadialClipAngle: 90 + - _RadialClipArc1: 45 + - _RadialClipArc2: 0 + - _RadialStartAngle: 90 + - _RandomSeed: 0 + - _RectSize: 1 + - _RotateUvAmount: 0 + - _RoundWaveSpeed: 2 + - _RoundWaveStrength: 0.7 + - _ShadowAlpha: 0.5 + - _ShadowX: 0.1 + - _ShadowY: -0.05 + - _ShakeUvSpeed: 2.5 + - _ShakeUvX: 1.5 + - _ShakeUvY: 1 + - _ShineGlow: 1 + - _ShineLocation: 0.5 + - _ShineRotate: 0 + - _ShineWidth: 0.1 + - _TextureScrollXSpeed: 1 + - _TextureScrollYSpeed: 0 + - _TwistUvAmount: 1 + - _TwistUvPosX: 0.5 + - _TwistUvPosY: 0.5 + - _TwistUvRadius: 0.75 + - _WarpScale: 0.5 + - _WarpSpeed: 8 + - _WarpStrength: 0.025 + - _WaveAmount: 7 + - _WaveSpeed: 10 + - _WaveStrength: 7.5 + - _WaveX: 0 + - _WaveY: 0.5 + - _ZTestMode: 4 + - _ZWrite: 0 + - _ZoomUvAmount: 0.5 + m_Colors: + - ColorSwapRed: {r: 1, g: 1, b: 1, a: 1} + - _AlphaOutlineColor: {r: 1, g: 1, b: 1, a: 1} + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _ColorChangeNewCol: {r: 1, g: 1, b: 0, a: 1} + - _ColorChangeNewCol2: {r: 1, g: 1, b: 0, a: 1} + - _ColorChangeNewCol3: {r: 1, g: 1, b: 0, a: 1} + - _ColorChangeTarget: {r: 1, g: 0, b: 0, a: 1} + - _ColorChangeTarget2: {r: 1, g: 0, b: 0, a: 1} + - _ColorChangeTarget3: {r: 1, g: 0, b: 0, a: 1} + - _ColorSwapBlue: {r: 1, g: 1, b: 1, a: 1} + - _ColorSwapGreen: {r: 1, g: 1, b: 1, a: 1} + - _ColorSwapRed: {r: 1, g: 1, b: 1, a: 1} + - _FadeBurnColor: {r: 1, g: 1, b: 0, a: 1} + - _GlowColor: {r: 1, g: 1, b: 1, a: 1} + - _GradBotLeftCol: {r: 0, g: 0, b: 1, a: 1} + - _GradBotRightCol: {r: 0, g: 0, b: 1, a: 1} + - _GradTopLeftCol: {r: 1, g: 0, b: 0, a: 1} + - _GradTopRightCol: {r: 1, g: 0, b: 0, a: 1} + - _GreyscaleTintColor: {r: 1, g: 1, b: 1, a: 1} + - _HitEffectColor: {r: 1, g: 1, b: 1, a: 1} + - _HologramStripeColor: {r: 1, g: 1, b: 1, a: 1} + - _InnerOutlineColor: {r: 1, g: 0, b: 0, a: 1} + - _OutlineColor: {r: 1, g: 1, b: 1, a: 1} + - _OverlayColor: {r: 1, g: 1, b: 1, a: 1} + - _ShadowColor: {r: 0, g: 0, b: 0, a: 1} + - _ShineColor: {r: 1, g: 1, b: 1, a: 1} +--- !u!1 &14374124 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 14374125} + - component: {fileID: 14374127} + - component: {fileID: 14374126} + m_Layer: 0 + m_Name: Title + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &14374125 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 14374124} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: -2.51, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 290590332} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!102 &14374126 +TextMesh: + serializedVersion: 3 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 14374124} + m_Text: Regular Outline + m_OffsetZ: -1.5 + m_CharacterSize: 0.075 + m_LineSpacing: 1 + m_Anchor: 4 + m_Alignment: 0 + m_TabSize: 4 + m_FontSize: 100 + m_FontStyle: 0 + m_RichText: 1 + m_Font: {fileID: 12800000, guid: a4e6a5491519adb45919dc87eff28e55, type: 3} + m_Color: + serializedVersion: 2 + rgba: 4294967295 +--- !u!23 &14374127 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 14374124} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 10100, guid: 0000000000000000e000000000000000, type: 0} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!1 &42135249 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 42135250} + - component: {fileID: 42135253} + - component: {fileID: 42135252} + m_Layer: 0 + m_Name: SpookySoldier + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &42135250 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 42135249} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 250, y: 0, z: 0} + m_LocalScale: {x: 0.80276, y: 0.80276, z: 0.80276} + m_Children: + - {fileID: 437846756} + - {fileID: 2099543392} + m_Father: {fileID: 1563905016} + m_RootOrder: 25 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &42135252 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 42135249} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 98b644315d7a92842b89e04f55c48e02, type: 3} + m_Name: + m_EditorClassIdentifier: +--- !u!212 &42135253 +SpriteRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 42135249} + m_Enabled: 1 + m_CastShadows: 0 + m_ReceiveShadows: 0 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 753155718} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 0 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_Sprite: {fileID: 21300000, guid: 519dafacd208bb64c83d5124be03b09d, type: 3} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_FlipX: 0 + m_FlipY: 0 + m_DrawMode: 0 + m_Size: {x: 5.12, y: 5.12} + m_AdaptiveModeThreshold: 0.5 + m_SpriteTileMode: 0 + m_WasSpriteAssigned: 1 + m_MaskInteraction: 0 + m_SpriteSortPoint: 0 +--- !u!1 &42378786 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 42378787} + - component: {fileID: 42378789} + - component: {fileID: 42378788} + m_Layer: 0 + m_Name: Animated + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 0 +--- !u!4 &42378787 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 42378786} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: -3.57, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 368348656} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!102 &42378788 +TextMesh: + serializedVersion: 3 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 42378786} + m_Text: (Has Animation) + m_OffsetZ: -1.5 + m_CharacterSize: 0.075 + m_LineSpacing: 1 + m_Anchor: 4 + m_Alignment: 0 + m_TabSize: 4 + m_FontSize: 100 + m_FontStyle: 0 + m_RichText: 1 + m_Font: {fileID: 12800000, guid: a4e6a5491519adb45919dc87eff28e55, type: 3} + m_Color: + serializedVersion: 2 + rgba: 4294967295 +--- !u!23 &42378789 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 42378786} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: a4e6a5491519adb45919dc87eff28e55, type: 3} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!1 &47460683 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 47460684} + - component: {fileID: 47460687} + - component: {fileID: 47460686} + - component: {fileID: 47460688} + m_Layer: 0 + m_Name: Colors + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &47460684 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 47460683} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 100, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 1022452601} + - {fileID: 588736392} + m_Father: {fileID: 1563905016} + m_RootOrder: 10 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &47460686 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 47460683} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 98b644315d7a92842b89e04f55c48e02, type: 3} + m_Name: + m_EditorClassIdentifier: +--- !u!212 &47460687 +SpriteRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 47460683} + m_Enabled: 1 + m_CastShadows: 0 + m_ReceiveShadows: 0 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: 473fd0e814452c4488d6794c3f24dff1, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 0 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_Sprite: {fileID: 21300000, guid: 519dafacd208bb64c83d5124be03b09d, type: 3} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_FlipX: 0 + m_FlipY: 0 + m_DrawMode: 0 + m_Size: {x: 5.12, y: 5.12} + m_AdaptiveModeThreshold: 0.5 + m_SpriteTileMode: 0 + m_WasSpriteAssigned: 1 + m_MaskInteraction: 0 + m_SpriteSortPoint: 0 +--- !u!114 &47460688 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 47460683} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 384dba07353e1f242b467b6857a1e3d4, type: 3} + m_Name: + m_EditorClassIdentifier: + numericPropertyName: _HsvShift + scrollSpeed: 500 + applyModulo: 1 + modulo: 360 + mat: {fileID: 0} +--- !u!1 &55667222 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 4825911116503289154} + - component: {fileID: 55667224} + - component: {fileID: 55667225} + m_Layer: 0 + m_Name: Original + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!212 &55667224 +SpriteRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 55667222} + m_Enabled: 1 + m_CastShadows: 0 + m_ReceiveShadows: 0 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 1257475202} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 0 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_Sprite: {fileID: 21300000, guid: 519dafacd208bb64c83d5124be03b09d, type: 3} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_FlipX: 0 + m_FlipY: 0 + m_DrawMode: 0 + m_Size: {x: 5.12, y: 5.12} + m_AdaptiveModeThreshold: 0.5 + m_SpriteTileMode: 0 + m_WasSpriteAssigned: 1 + m_MaskInteraction: 0 + m_SpriteSortPoint: 0 +--- !u!114 &55667225 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 55667222} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 98b644315d7a92842b89e04f55c48e02, type: 3} + m_Name: + m_EditorClassIdentifier: +--- !u!1 &56751282 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 56751283} + - component: {fileID: 56751286} + - component: {fileID: 56751285} + m_Layer: 0 + m_Name: Original + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &56751283 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 56751282} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 124843813} + - {fileID: 646019452} + m_Father: {fileID: 1351315063} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &56751285 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 56751282} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 98b644315d7a92842b89e04f55c48e02, type: 3} + m_Name: + m_EditorClassIdentifier: +--- !u!212 &56751286 +SpriteRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 56751282} + m_Enabled: 1 + m_CastShadows: 0 + m_ReceiveShadows: 0 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 1735095770} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 0 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_Sprite: {fileID: 21300000, guid: 519dafacd208bb64c83d5124be03b09d, type: 3} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_FlipX: 0 + m_FlipY: 0 + m_DrawMode: 0 + m_Size: {x: 5.12, y: 5.12} + m_AdaptiveModeThreshold: 0.5 + m_SpriteTileMode: 0 + m_WasSpriteAssigned: 1 + m_MaskInteraction: 0 + m_SpriteSortPoint: 0 +--- !u!1 &69675090 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 69675091} + - component: {fileID: 69675093} + - component: {fileID: 69675092} + m_Layer: 0 + m_Name: Title + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &69675091 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 69675090} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: -2.51, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 353408739} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!102 &69675092 +TextMesh: + serializedVersion: 3 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 69675090} + m_Text: Hallucination + m_OffsetZ: -1.5 + m_CharacterSize: 0.075 + m_LineSpacing: 1 + m_Anchor: 4 + m_Alignment: 0 + m_TabSize: 4 + m_FontSize: 100 + m_FontStyle: 0 + m_RichText: 1 + m_Font: {fileID: 12800000, guid: a4e6a5491519adb45919dc87eff28e55, type: 3} + m_Color: + serializedVersion: 2 + rgba: 4294967295 +--- !u!23 &69675093 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 69675090} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 10100, guid: 0000000000000000e000000000000000, type: 0} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!21 &70619476 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: AllIn1SpriteShader/AllIn1SpriteShader + m_Shader: {fileID: 4800000, guid: a36b7719ff0465b42ab1407d67672c5f, type: 3} + m_ShaderKeywords: ALPHACUTOFF_ON ETC1_EXTERNAL_ALPHA OUTBASE8DIR_ON PIXELATE_ON + _OUTLINE8DIRECTIONS_ON + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _ColorRampTex: + m_Texture: {fileID: 2800000, guid: 279657edc397ece4b8029c727adf6ddc, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ColorRampTexGradient: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ColorSwapTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DistortTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _FadeBurnTex: + m_Texture: {fileID: 2800000, guid: 32e8df0008bebe746b1681a71c61f31c, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _FadeTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _GlowTex: + 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} + - _OutlineDistortTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OutlineTex: + m_Texture: {fileID: 2800000, guid: 74087f6d03f233e4a8a142fa01f9e5cf, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OverlayTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ShineMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - _Alpha: 1 + - _AlphaCutoffValue: 0.904 + - _AlphaOutlineBlend: 1 + - _AlphaOutlineGlow: 5 + - _AlphaOutlineMinAlpha: 0 + - _AlphaOutlinePower: 1 + - _AlphaRoundThreshold: 0.5 + - _BillboardY: 0 + - _BlurHD: 0 + - _BlurIntensity: 10 + - _Brightness: 0 + - _ChromAberrAlpha: 0.4 + - _ChromAberrAmount: 1 + - _ClipUvDown: 1 + - _ClipUvLeft: 1 + - _ClipUvRight: 1 + - _ClipUvUp: 1 + - _ColorChangeLuminosity: 0 + - _ColorChangeTolerance: 0.25 + - _ColorChangeTolerance2: 0.25 + - _ColorChangeTolerance3: 0.25 + - _ColorRampBlend: 1 + - _ColorRampLuminosity: 0 + - _ColorRampOutline: 0 + - _ColorSwapBlend: 1 + - _ColorSwapBlueLuminosity: 0.5 + - _ColorSwapGreenLuminosity: 0.5 + - _ColorSwapRedLuminosity: 0.5 + - _Contrast: 1 + - _CullingOption: 0 + - _DistortAmount: 0.5 + - _DistortTexXSpeed: 5 + - _DistortTexYSpeed: 5 + - _EditorDrawers: 6 + - _FadeAmount: -0.1 + - _FadeBurnGlow: 2 + - _FadeBurnTransition: 0.075 + - _FadeBurnWidth: 0.025 + - _FishEyeUvAmount: 0.35 + - _FlickerAlpha: 0 + - _FlickerFreq: 0.2 + - _FlickerPercent: 0.05 + - _GhostBlend: 1 + - _GhostColorBoost: 1 + - _GhostTransparency: 0 + - _GlitchAmount: 3 + - _GlitchSize: 1 + - _Glow: 10 + - _GlowGlobal: 1 + - _GlowTexUsed: 0 + - _GradBlend: 1 + - _GradBoostX: 1.2 + - _GradBoostY: 1.2 + - _GradIsRadial: 0 + - _GrassManualAnim: 1 + - _GrassManualToggle: 0 + - _GrassRadialBend: 0.25 + - _GrassSpeed: 2 + - _GrassWind: 20 + - _GreyscaleBlend: 1 + - _GreyscaleLuminosity: 0 + - _GreyscaleOutline: 0 + - _HandDrawnAmount: 10 + - _HandDrawnSpeed: 5 + - _HitEffectBlend: 1 + - _HitEffectGlow: 5 + - _HologramBlend: 1 + - _HologramFlickerAlpha: 0 + - _HologramFlickerFreq: 0.2 + - _HologramMaxAlpha: 1 + - _HologramMinAlpha: 0 + - _HologramStripesAlpha: 0.4 + - _HologramStripesAmount: 50 + - _HologramStripesFill: 0.4 + - _HologramStripesLuminosity: 1 + - _HologramStripesSpeed: 5 + - _HologramUnmodAmount: 0.4 + - _HsvBright: 1 + - _HsvSaturation: 1 + - _HsvShift: 180 + - _InnerOutlineAlpha: 1 + - _InnerOutlineGlow: 1 + - _InnerOutlineThickness: 1 + - _MaxXUV: 1 + - _MaxYUV: 1 + - _MinXUV: 0 + - _MinYUV: 0 + - _MotionBlurAngle: 0.1 + - _MotionBlurDist: 1.25 + - _MyDstMode: 10 + - _MySrcMode: 5 + - _NegativeAmount: 1 + - _OffsetUvX: 0 + - _OffsetUvY: 0 + - _OnlyInnerOutline: 0 + - _OnlyOutline: 0 + - _Outline8Directions: 1 + - _OutlineAlpha: 1 + - _OutlineDistortAmount: 0.5 + - _OutlineDistortTexXSpeed: 5 + - _OutlineDistortTexYSpeed: 5 + - _OutlineDistortToggle: 0 + - _OutlineGlow: 1.5 + - _OutlineIsPixel: 0 + - _OutlinePixelWidth: 1 + - _OutlineTexGrey: 0 + - _OutlineTexToggle: 0 + - _OutlineTexXSpeed: 10 + - _OutlineTexYSpeed: 0 + - _OutlineWidth: 0.0159 + - _OverlayBlend: 1 + - _OverlayGlow: 1 + - _OverlayTextureScrollXSpeed: 0.25 + - _OverlayTextureScrollYSpeed: 0.25 + - _PinchUvAmount: 0.35 + - _PixelateSize: 70 + - _PosterizeGamma: 0.75 + - _PosterizeNumColors: 8 + - _PosterizeOutline: 0 + - _RadialClip: 0 + - _RadialClip2: 45 + - _RadialClipAngle: 90 + - _RadialClipArc1: 45 + - _RadialClipArc2: 0 + - _RadialStartAngle: 90 + - _RandomSeed: 0 + - _RectSize: 1 + - _RotateUvAmount: 0 + - _RoundWaveSpeed: 2 + - _RoundWaveStrength: 0.7 + - _ShadowAlpha: 0.5 + - _ShadowX: 0.1 + - _ShadowY: -0.05 + - _ShakeUvSpeed: 2.5 + - _ShakeUvX: 1.5 + - _ShakeUvY: 1 + - _ShineGlow: 1 + - _ShineLocation: 0.5 + - _ShineRotate: 0 + - _ShineWidth: 0.1 + - _TextureScrollXSpeed: 1 + - _TextureScrollYSpeed: 0 + - _TwistUvAmount: 1 + - _TwistUvPosX: 0.5 + - _TwistUvPosY: 0.5 + - _TwistUvRadius: 0.75 + - _WarpScale: 0.5 + - _WarpSpeed: 8 + - _WarpStrength: 0.025 + - _WaveAmount: 7 + - _WaveSpeed: 10 + - _WaveStrength: 7.5 + - _WaveX: 0 + - _WaveY: 0.5 + - _ZTestMode: 4 + - _ZWrite: 0 + - _ZoomUvAmount: 0.5 + m_Colors: + - ColorSwapRed: {r: 1, g: 1, b: 1, a: 1} + - _AlphaOutlineColor: {r: 1, g: 1, b: 1, a: 1} + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _ColorChangeNewCol: {r: 1, g: 1, b: 0, a: 1} + - _ColorChangeNewCol2: {r: 1, g: 1, b: 0, a: 1} + - _ColorChangeNewCol3: {r: 1, g: 1, b: 0, a: 1} + - _ColorChangeTarget: {r: 1, g: 0, b: 0, a: 1} + - _ColorChangeTarget2: {r: 1, g: 0, b: 0, a: 1} + - _ColorChangeTarget3: {r: 1, g: 0, b: 0, a: 1} + - _ColorSwapBlue: {r: 1, g: 1, b: 1, a: 1} + - _ColorSwapGreen: {r: 1, g: 1, b: 1, a: 1} + - _ColorSwapRed: {r: 1, g: 1, b: 1, a: 1} + - _FadeBurnColor: {r: 1, g: 1, b: 0, a: 1} + - _GlowColor: {r: 1, g: 1, b: 1, a: 1} + - _GradBotLeftCol: {r: 0, g: 0, b: 1, a: 1} + - _GradBotRightCol: {r: 0, g: 0, b: 1, a: 1} + - _GradTopLeftCol: {r: 1, g: 0, b: 0, a: 1} + - _GradTopRightCol: {r: 1, g: 0, b: 0, a: 1} + - _GreyscaleTintColor: {r: 1, g: 1, b: 1, a: 1} + - _HitEffectColor: {r: 1, g: 1, b: 1, a: 1} + - _HologramStripeColor: {r: 1, g: 1, b: 1, a: 1} + - _InnerOutlineColor: {r: 1, g: 0, b: 0, a: 1} + - _OutlineColor: {r: 1, g: 1, b: 1, a: 1} + - _OverlayColor: {r: 1, g: 1, b: 1, a: 1} + - _ShadowColor: {r: 0, g: 0, b: 0, a: 1} + - _ShineColor: {r: 1, g: 1, b: 1, a: 1} +--- !u!21 &72928926 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: AllIn1SpriteShader/AllIn1SpriteShader + m_Shader: {fileID: 4800000, guid: a36b7719ff0465b42ab1407d67672c5f, type: 3} + m_ShaderKeywords: ETC1_EXTERNAL_ALPHA HOLOGRAM_ON + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _ColorRampTex: + m_Texture: {fileID: 2800000, guid: 279657edc397ece4b8029c727adf6ddc, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ColorRampTexGradient: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ColorSwapTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DistortTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _FadeBurnTex: + m_Texture: {fileID: 2800000, guid: 32e8df0008bebe746b1681a71c61f31c, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _FadeTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _GlowTex: + 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} + - _OutlineDistortTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OutlineTex: + m_Texture: {fileID: 2800000, guid: 74087f6d03f233e4a8a142fa01f9e5cf, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OverlayTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ShineMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - _Alpha: 1 + - _AlphaCutoffValue: 0.25 + - _AlphaOutlineBlend: 1 + - _AlphaOutlineGlow: 5 + - _AlphaOutlineMinAlpha: 0 + - _AlphaOutlinePower: 1 + - _AlphaRoundThreshold: 0.5 + - _BillboardY: 0 + - _BlurHD: 0 + - _BlurIntensity: 10 + - _Brightness: 0 + - _ChromAberrAlpha: 0.4 + - _ChromAberrAmount: 1 + - _ClipUvDown: 1 + - _ClipUvLeft: 1 + - _ClipUvRight: 1 + - _ClipUvUp: 1 + - _ColorChangeLuminosity: 0 + - _ColorChangeTolerance: 0.25 + - _ColorChangeTolerance2: 0.25 + - _ColorChangeTolerance3: 0.25 + - _ColorRampBlend: 1 + - _ColorRampLuminosity: 0 + - _ColorRampOutline: 0 + - _ColorSwapBlend: 1 + - _ColorSwapBlueLuminosity: 0.5 + - _ColorSwapGreenLuminosity: 0.5 + - _ColorSwapRedLuminosity: 0.5 + - _Contrast: 1 + - _CullingOption: 0 + - _DistortAmount: 0.5 + - _DistortTexXSpeed: 5 + - _DistortTexYSpeed: 5 + - _EditorDrawers: 6 + - _FadeAmount: -0.1 + - _FadeBurnGlow: 2 + - _FadeBurnTransition: 0.075 + - _FadeBurnWidth: 0.025 + - _FishEyeUvAmount: 0.35 + - _FlickerAlpha: 0 + - _FlickerFreq: 0.2 + - _FlickerPercent: 0.05 + - _GhostBlend: 1 + - _GhostColorBoost: 1 + - _GhostTransparency: 0 + - _GlitchAmount: 3 + - _GlitchSize: 1 + - _Glow: 10 + - _GlowGlobal: 1 + - _GlowTexUsed: 0 + - _GradBlend: 1 + - _GradBoostX: 1.2 + - _GradBoostY: 1.2 + - _GradIsRadial: 0 + - _GrassManualAnim: 1 + - _GrassManualToggle: 0 + - _GrassRadialBend: 0.1 + - _GrassSpeed: 2 + - _GrassWind: 20 + - _GreyscaleBlend: 1 + - _GreyscaleLuminosity: 0 + - _GreyscaleOutline: 0 + - _HandDrawnAmount: 10 + - _HandDrawnSpeed: 5 + - _HitEffectBlend: 1 + - _HitEffectGlow: 5 + - _HologramBlend: 1 + - _HologramFlickerAlpha: 0 + - _HologramFlickerFreq: 0.2 + - _HologramFlickerPercent: 0.05 + - _HologramMaxAlpha: 1.2 + - _HologramMinAlpha: 0.142 + - _HologramStripesAlpha: 0.4 + - _HologramStripesAmount: 0.085 + - _HologramStripesFill: 0.4 + - _HologramStripesLuminosity: 1 + - _HologramStripesSpeed: 7 + - _HologramUnmodAmount: 0 + - _HsvBright: 1 + - _HsvSaturation: 1 + - _HsvShift: 180 + - _InnerOutlineAlpha: 1 + - _InnerOutlineGlow: 1 + - _InnerOutlineThickness: 1 + - _MaxXUV: 1 + - _MaxYUV: 1 + - _MinXUV: 0 + - _MinYUV: 0 + - _MotionBlurAngle: 0.1 + - _MotionBlurDist: 1.25 + - _MyDstMode: 10 + - _MySrcMode: 5 + - _NegativeAmount: 1 + - _OffsetUvX: 0 + - _OffsetUvY: 0 + - _OnlyInnerOutline: 0 + - _OnlyOutline: 0 + - _Outline8Directions: 0 + - _OutlineAlpha: 1 + - _OutlineDistortAmount: 0.5 + - _OutlineDistortTexXSpeed: 5 + - _OutlineDistortTexYSpeed: 5 + - _OutlineDistortToggle: 0 + - _OutlineGlow: 1.5 + - _OutlineIsPixel: 0 + - _OutlinePixelWidth: 1 + - _OutlineTexGrey: 0 + - _OutlineTexToggle: 0 + - _OutlineTexXSpeed: 10 + - _OutlineTexYSpeed: 0 + - _OutlineWidth: 0.004 + - _OverlayBlend: 1 + - _OverlayGlow: 1 + - _OverlayTextureScrollXSpeed: 0.25 + - _OverlayTextureScrollYSpeed: 0.25 + - _PinchUvAmount: 0.35 + - _PixelateSize: 32 + - _PosterizeGamma: 0.75 + - _PosterizeNumColors: 8 + - _PosterizeOutline: 0 + - _RadialClip: 45 + - _RadialClip2: 0 + - _RadialClipAngle: 90 + - _RadialClipArc1: 45 + - _RadialClipArc2: 0 + - _RadialStartAngle: 90 + - _RandomSeed: 0 + - _RectSize: 1 + - _RotateUvAmount: 0 + - _RoundWaveSpeed: 2 + - _RoundWaveStrength: 0.7 + - _ShadowAlpha: 0.5 + - _ShadowX: 0.1 + - _ShadowY: -0.05 + - _ShakeUvSpeed: 2.5 + - _ShakeUvX: 1.5 + - _ShakeUvY: 1 + - _ShineGlow: 1 + - _ShineLocation: 0.5 + - _ShineRotate: 0 + - _ShineWidth: 0.1 + - _TextureScrollXSpeed: 1 + - _TextureScrollYSpeed: 0 + - _TwistUvAmount: 1 + - _TwistUvPosX: 0.5 + - _TwistUvPosY: 0.5 + - _TwistUvRadius: 0.75 + - _WarpScale: 0.5 + - _WarpSpeed: 8 + - _WarpStrength: 0.025 + - _WaveAmount: 7 + - _WaveSpeed: 10 + - _WaveStrength: 7.5 + - _WaveX: 0 + - _WaveY: 0.5 + - _ZTestMode: 4 + - _ZWrite: 0 + - _ZoomUvAmount: 0.5 + m_Colors: + - ColorSwapRed: {r: 1, g: 1, b: 1, a: 1} + - _AlphaOutlineColor: {r: 1, g: 1, b: 1, a: 1} + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _ColorChangeNewCol: {r: 1, g: 1, b: 0, a: 1} + - _ColorChangeNewCol2: {r: 1, g: 1, b: 0, a: 1} + - _ColorChangeNewCol3: {r: 1, g: 1, b: 0, a: 1} + - _ColorChangeTarget: {r: 1, g: 0, b: 0, a: 1} + - _ColorChangeTarget2: {r: 1, g: 0, b: 0, a: 1} + - _ColorChangeTarget3: {r: 1, g: 0, b: 0, a: 1} + - _ColorSwapBlue: {r: 1, g: 1, b: 1, a: 1} + - _ColorSwapGreen: {r: 1, g: 1, b: 1, a: 1} + - _ColorSwapRed: {r: 1, g: 1, b: 1, a: 1} + - _FadeBurnColor: {r: 1, g: 1, b: 0, a: 1} + - _GlowColor: {r: 1, g: 1, b: 1, a: 1} + - _GradBotLeftCol: {r: 0, g: 0, b: 1, a: 1} + - _GradBotRightCol: {r: 0, g: 0, b: 1, a: 1} + - _GradTopLeftCol: {r: 1, g: 0, b: 0, a: 1} + - _GradTopRightCol: {r: 1, g: 0, b: 0, a: 1} + - _GreyscaleTintColor: {r: 1, g: 1, b: 1, a: 1} + - _HitEffectColor: {r: 1, g: 1, b: 1, a: 1} + - _HologramStripeColor: {r: 0, g: 0.27421054, b: 0.38679248, a: 1} + - _InnerOutlineColor: {r: 1, g: 0, b: 0, a: 1} + - _OutlineColor: {r: 1, g: 1, b: 1, a: 1} + - _OverlayColor: {r: 1, g: 1, b: 1, a: 1} + - _ShadowColor: {r: 0, g: 0, b: 0, a: 1} + - _ShineColor: {r: 1, g: 1, b: 1, a: 1} +--- !u!21 &73084414 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: AllIn1SpriteShader/AllIn1SpriteShader + m_Shader: {fileID: 4800000, guid: a36b7719ff0465b42ab1407d67672c5f, type: 3} + m_ShaderKeywords: ETC1_EXTERNAL_ALPHA HSV_ON + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _ColorRampTex: + m_Texture: {fileID: 2800000, guid: 279657edc397ece4b8029c727adf6ddc, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ColorRampTexGradient: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ColorSwapTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DistortTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _FadeBurnTex: + m_Texture: {fileID: 2800000, guid: 677cca399782dea41aedc1d292ecb67d, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _FadeTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _GlowTex: + 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} + - _OutlineDistortTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OutlineTex: + m_Texture: {fileID: 2800000, guid: 74087f6d03f233e4a8a142fa01f9e5cf, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OverlayTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ShineMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - _Alpha: 1 + - _AlphaCutoffValue: 0.25 + - _AlphaOutlineBlend: 1 + - _AlphaOutlineGlow: 5 + - _AlphaOutlineMinAlpha: 0 + - _AlphaOutlinePower: 1 + - _AlphaRoundThreshold: 0.5 + - _BillboardY: 0 + - _BlurHD: 0 + - _BlurIntensity: 10 + - _Brightness: 0 + - _ChromAberrAlpha: 0.4 + - _ChromAberrAmount: 1 + - _ClipUvDown: 0 + - _ClipUvLeft: 0 + - _ClipUvRight: 0 + - _ClipUvUp: 0 + - _ColorChangeLuminosity: 0 + - _ColorChangeTolerance: 0.25 + - _ColorChangeTolerance2: 0.25 + - _ColorChangeTolerance3: 0.25 + - _ColorRampBlend: 1 + - _ColorRampLuminosity: 0 + - _ColorRampOutline: 0 + - _ColorSwapBlend: 1 + - _ColorSwapBlueLuminosity: 0.5 + - _ColorSwapGreenLuminosity: 0.5 + - _ColorSwapRedLuminosity: 0.5 + - _Contrast: 1 + - _CullingOption: 0 + - _DistortAmount: 0.5 + - _DistortTexXSpeed: 5 + - _DistortTexYSpeed: 5 + - _EditorDrawers: 6 + - _FadeAmount: -0.1 + - _FadeBurnGlow: 2 + - _FadeBurnTransition: 0.075 + - _FadeBurnWidth: 0.025 + - _FishEyeUvAmount: 0.35 + - _FlickerAlpha: 0 + - _FlickerFreq: 0.2 + - _FlickerPercent: 0.05 + - _GhostBlend: 1 + - _GhostColorBoost: 1 + - _GhostTransparency: 0 + - _GlitchAmount: 3 + - _GlitchSize: 1 + - _Glow: 10 + - _GlowGlobal: 1 + - _GlowTexUsed: 0 + - _GradBlend: 1 + - _GradBoostX: 1.2 + - _GradBoostY: 1.2 + - _GradIsRadial: 0 + - _GrassManualAnim: 1 + - _GrassManualToggle: 0 + - _GrassRadialBend: 0.1 + - _GrassSpeed: 2 + - _GrassWind: 20 + - _GreyscaleBlend: 1 + - _GreyscaleLuminosity: 0 + - _GreyscaleOutline: 0 + - _HandDrawnAmount: 10 + - _HandDrawnSpeed: 5 + - _HitEffectBlend: 1 + - _HitEffectGlow: 5 + - _HologramBlend: 1 + - _HologramMaxAlpha: 1 + - _HologramMinAlpha: 0 + - _HologramStripesAlpha: 0.4 + - _HologramStripesAmount: 50 + - _HologramStripesFill: 0.4 + - _HologramStripesLuminosity: 1 + - _HologramStripesSpeed: 5 + - _HologramUnmodAmount: 0.4 + - _HsvBright: 1 + - _HsvSaturation: 1.5 + - _HsvShift: 180 + - _InnerOutlineAlpha: 1 + - _InnerOutlineGlow: 1 + - _InnerOutlineThickness: 1 + - _MaxXUV: 1 + - _MaxYUV: 1 + - _MinXUV: 0 + - _MinYUV: 0 + - _MotionBlurAngle: 0.1 + - _MotionBlurDist: 1.25 + - _MyDstMode: 10 + - _MySrcMode: 5 + - _NegativeAmount: 1 + - _OffsetUvX: 0 + - _OffsetUvY: 0 + - _OnlyInnerOutline: 0 + - _OnlyOutline: 0 + - _Outline8Directions: 0 + - _OutlineAlpha: 1 + - _OutlineDistortAmount: 0.5 + - _OutlineDistortTexXSpeed: 5 + - _OutlineDistortTexYSpeed: 5 + - _OutlineDistortToggle: 0 + - _OutlineGlow: 1.5 + - _OutlineIsPixel: 0 + - _OutlinePixelWidth: 1 + - _OutlineTexGrey: 0 + - _OutlineTexToggle: 0 + - _OutlineTexXSpeed: 10 + - _OutlineTexYSpeed: 0 + - _OutlineWidth: 0.004 + - _OverlayBlend: 1 + - _OverlayGlow: 1 + - _OverlayTextureScrollXSpeed: 0.25 + - _OverlayTextureScrollYSpeed: 0.25 + - _PinchUvAmount: 0.35 + - _PixelateSize: 32 + - _PosterizeGamma: 0.75 + - _PosterizeNumColors: 8 + - _PosterizeOutline: 0 + - _RadialClipAngle: 90 + - _RadialClipArc1: 45 + - _RadialClipArc2: 0 + - _RandomSeed: 0 + - _RectSize: 1 + - _RotateUvAmount: 0 + - _RoundWaveSpeed: 2 + - _RoundWaveStrength: 0.7 + - _ShadowAlpha: 0.5 + - _ShadowX: 0.1 + - _ShadowY: -0.05 + - _ShakeUvSpeed: 2.5 + - _ShakeUvX: 1.5 + - _ShakeUvY: 1 + - _ShineGlow: 1 + - _ShineLocation: 0.5 + - _ShineRotate: 0 + - _ShineWidth: 0.1 + - _TextureScrollXSpeed: 1 + - _TextureScrollYSpeed: 0 + - _TwistUvAmount: 1 + - _TwistUvPosX: 0.5 + - _TwistUvPosY: 0.5 + - _TwistUvRadius: 0.75 + - _WarpScale: 0.5 + - _WarpSpeed: 8 + - _WarpStrength: 0.025 + - _WaveAmount: 7 + - _WaveSpeed: 10 + - _WaveStrength: 7.5 + - _WaveX: 0 + - _WaveY: 0.5 + - _ZTestMode: 4 + - _ZWrite: 0 + - _ZoomUvAmount: 0.5 + m_Colors: + - ColorSwapRed: {r: 1, g: 1, b: 1, a: 1} + - _AlphaOutlineColor: {r: 1, g: 1, b: 1, a: 1} + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _ColorChangeNewCol: {r: 1, g: 1, b: 0, a: 1} + - _ColorChangeNewCol2: {r: 1, g: 1, b: 0, a: 1} + - _ColorChangeNewCol3: {r: 1, g: 1, b: 0, a: 1} + - _ColorChangeTarget: {r: 1, g: 0, b: 0, a: 1} + - _ColorChangeTarget2: {r: 1, g: 0, b: 0, a: 1} + - _ColorChangeTarget3: {r: 1, g: 0, b: 0, a: 1} + - _ColorSwapBlue: {r: 1, g: 1, b: 1, a: 1} + - _ColorSwapGreen: {r: 1, g: 1, b: 1, a: 1} + - _ColorSwapRed: {r: 1, g: 1, b: 1, a: 1} + - _FadeBurnColor: {r: 1, g: 1, b: 0, a: 1} + - _GlowColor: {r: 1, g: 1, b: 1, a: 1} + - _GradBotLeftCol: {r: 0, g: 0, b: 1, a: 1} + - _GradBotRightCol: {r: 0, g: 0, b: 1, a: 1} + - _GradTopLeftCol: {r: 1, g: 0, b: 0, a: 1} + - _GradTopRightCol: {r: 1, g: 0, b: 0, a: 1} + - _GreyscaleTintColor: {r: 1, g: 1, b: 1, a: 1} + - _HitEffectColor: {r: 1, g: 1, b: 1, a: 1} + - _HologramStripeColor: {r: 1, g: 1, b: 1, a: 1} + - _InnerOutlineColor: {r: 1, g: 0, b: 0, a: 1} + - _OutlineColor: {r: 1, g: 1, b: 1, a: 1} + - _OverlayColor: {r: 1, g: 1, b: 1, a: 1} + - _ShadowColor: {r: 0, g: 0, b: 0, a: 1} + - _ShineColor: {r: 1, g: 1, b: 1, a: 1} +--- !u!21 &85408337 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: AllIn1SpriteShader/AllIn1SpriteShader + m_Shader: {fileID: 4800000, guid: a36b7719ff0465b42ab1407d67672c5f, type: 3} + m_ShaderKeywords: BLUR_ON ETC1_EXTERNAL_ALPHA + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _ColorRampTex: + m_Texture: {fileID: 2800000, guid: 279657edc397ece4b8029c727adf6ddc, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ColorRampTexGradient: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ColorSwapTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DistortTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _FadeBurnTex: + m_Texture: {fileID: 2800000, guid: 677cca399782dea41aedc1d292ecb67d, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _FadeTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _GlowTex: + 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} + - _OutlineDistortTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OutlineTex: + m_Texture: {fileID: 2800000, guid: 74087f6d03f233e4a8a142fa01f9e5cf, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OverlayTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ShineMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - _Alpha: 1 + - _AlphaCutoffValue: 0.25 + - _AlphaOutlineBlend: 1 + - _AlphaOutlineGlow: 5 + - _AlphaOutlineMinAlpha: 0 + - _AlphaOutlinePower: 1 + - _AlphaRoundThreshold: 0.5 + - _BillboardY: 0 + - _BlurHD: 0 + - _BlurIntensity: 10 + - _Brightness: 0 + - _ChromAberrAlpha: 0.4 + - _ChromAberrAmount: 1 + - _ClipUvDown: 0 + - _ClipUvLeft: 0 + - _ClipUvRight: 0 + - _ClipUvUp: 0 + - _ColorChangeLuminosity: 0 + - _ColorChangeTolerance: 0.25 + - _ColorChangeTolerance2: 0.25 + - _ColorChangeTolerance3: 0.25 + - _ColorRampBlend: 1 + - _ColorRampLuminosity: 0 + - _ColorRampOutline: 0 + - _ColorSwapBlend: 1 + - _ColorSwapBlueLuminosity: 0.5 + - _ColorSwapGreenLuminosity: 0.5 + - _ColorSwapRedLuminosity: 0.5 + - _Contrast: 1 + - _CullingOption: 0 + - _DistortAmount: 0.5 + - _DistortTexXSpeed: 5 + - _DistortTexYSpeed: 5 + - _EditorDrawers: 6 + - _FadeAmount: -0.1 + - _FadeBurnGlow: 2 + - _FadeBurnTransition: 0.075 + - _FadeBurnWidth: 0.025 + - _FishEyeUvAmount: 0.35 + - _FlickerAlpha: 0 + - _FlickerFreq: 0.2 + - _FlickerPercent: 0.05 + - _GhostBlend: 1 + - _GhostColorBoost: 1 + - _GhostTransparency: 0 + - _GlitchAmount: 3 + - _GlitchSize: 1 + - _Glow: 10 + - _GlowGlobal: 1 + - _GlowTexUsed: 0 + - _GradBlend: 1 + - _GradBoostX: 1.2 + - _GradBoostY: 1.2 + - _GradIsRadial: 0 + - _GrassManualAnim: 1 + - _GrassManualToggle: 0 + - _GrassRadialBend: 0.25 + - _GrassSpeed: 2 + - _GrassWind: 20 + - _GreyscaleBlend: 1 + - _GreyscaleLuminosity: 0 + - _GreyscaleOutline: 0 + - _HandDrawnAmount: 10 + - _HandDrawnSpeed: 5 + - _HitEffectBlend: 1 + - _HitEffectGlow: 5 + - _HologramBlend: 1 + - _HologramFlickerAlpha: 0 + - _HologramFlickerFreq: 0.2 + - _HologramMaxAlpha: 1 + - _HologramMinAlpha: 0 + - _HologramStripesAlpha: 0.4 + - _HologramStripesAmount: 50 + - _HologramStripesFill: 0.4 + - _HologramStripesLuminosity: 1 + - _HologramStripesSpeed: 5 + - _HologramUnmodAmount: 0.4 + - _HsvBright: 1 + - _HsvSaturation: 1 + - _HsvShift: 180 + - _InnerOutlineAlpha: 1 + - _InnerOutlineGlow: 1 + - _InnerOutlineThickness: 1 + - _MaxXUV: 1 + - _MaxYUV: 1 + - _MinXUV: 0 + - _MinYUV: 0 + - _MotionBlurAngle: 0.1 + - _MotionBlurDist: 1.25 + - _MyDstMode: 10 + - _MySrcMode: 5 + - _NegativeAmount: 1 + - _OffsetUvX: 0 + - _OffsetUvY: 0 + - _OnlyInnerOutline: 0 + - _OnlyOutline: 0 + - _Outline8Directions: 0 + - _OutlineAlpha: 1 + - _OutlineDistortAmount: 0.5 + - _OutlineDistortTexXSpeed: 5 + - _OutlineDistortTexYSpeed: 5 + - _OutlineDistortToggle: 0 + - _OutlineGlow: 1.5 + - _OutlineIsPixel: 0 + - _OutlinePixelWidth: 1 + - _OutlineTexGrey: 0 + - _OutlineTexToggle: 0 + - _OutlineTexXSpeed: 10 + - _OutlineTexYSpeed: 0 + - _OutlineWidth: 0.004 + - _OverlayBlend: 1 + - _OverlayGlow: 1 + - _OverlayTextureScrollXSpeed: 0.25 + - _OverlayTextureScrollYSpeed: 0.25 + - _PinchUvAmount: 0.35 + - _PixelateSize: 32 + - _PosterizeGamma: 0.75 + - _PosterizeNumColors: 8 + - _PosterizeOutline: 0 + - _RadialClip: 0 + - _RadialClip2: 45 + - _RadialClipAngle: 90 + - _RadialClipArc1: 45 + - _RadialClipArc2: 0 + - _RadialStartAngle: 90 + - _RandomSeed: 0 + - _RectSize: 1 + - _RotateUvAmount: 0 + - _RoundWaveSpeed: 2 + - _RoundWaveStrength: 0.7 + - _ShadowAlpha: 0.5 + - _ShadowX: 0.1 + - _ShadowY: -0.05 + - _ShakeUvSpeed: 2.5 + - _ShakeUvX: 1.5 + - _ShakeUvY: 1 + - _ShineGlow: 1 + - _ShineLocation: 0.5 + - _ShineRotate: 0 + - _ShineWidth: 0.1 + - _TextureScrollXSpeed: 1 + - _TextureScrollYSpeed: 0 + - _TwistUvAmount: 1 + - _TwistUvPosX: 0.5 + - _TwistUvPosY: 0.5 + - _TwistUvRadius: 0.75 + - _WarpScale: 0.5 + - _WarpSpeed: 8 + - _WarpStrength: 0.025 + - _WaveAmount: 7 + - _WaveSpeed: 10 + - _WaveStrength: 7.5 + - _WaveX: 0 + - _WaveY: 0.5 + - _ZTestMode: 4 + - _ZWrite: 0 + - _ZoomUvAmount: 0.5 + m_Colors: + - ColorSwapRed: {r: 1, g: 1, b: 1, a: 1} + - _AlphaOutlineColor: {r: 1, g: 1, b: 1, a: 1} + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _ColorChangeNewCol: {r: 1, g: 1, b: 0, a: 1} + - _ColorChangeNewCol2: {r: 1, g: 1, b: 0, a: 1} + - _ColorChangeNewCol3: {r: 1, g: 1, b: 0, a: 1} + - _ColorChangeTarget: {r: 1, g: 0, b: 0, a: 1} + - _ColorChangeTarget2: {r: 1, g: 0, b: 0, a: 1} + - _ColorChangeTarget3: {r: 1, g: 0, b: 0, a: 1} + - _ColorSwapBlue: {r: 1, g: 1, b: 1, a: 1} + - _ColorSwapGreen: {r: 1, g: 1, b: 1, a: 1} + - _ColorSwapRed: {r: 1, g: 1, b: 1, a: 1} + - _FadeBurnColor: {r: 1, g: 1, b: 0, a: 1} + - _GlowColor: {r: 1, g: 1, b: 1, a: 1} + - _GradBotLeftCol: {r: 0, g: 0, b: 1, a: 1} + - _GradBotRightCol: {r: 0, g: 0, b: 1, a: 1} + - _GradTopLeftCol: {r: 1, g: 0, b: 0, a: 1} + - _GradTopRightCol: {r: 1, g: 0, b: 0, a: 1} + - _GreyscaleTintColor: {r: 1, g: 1, b: 1, a: 1} + - _HitEffectColor: {r: 1, g: 1, b: 1, a: 1} + - _HologramStripeColor: {r: 1, g: 1, b: 1, a: 1} + - _InnerOutlineColor: {r: 1, g: 0, b: 0, a: 1} + - _OutlineColor: {r: 1, g: 1, b: 1, a: 1} + - _OverlayColor: {r: 1, g: 1, b: 1, a: 1} + - _ShadowColor: {r: 0, g: 0, b: 0, a: 1} + - _ShineColor: {r: 1, g: 1, b: 1, a: 1} +--- !u!21 &87388692 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: AllIn1SpriteShader/AllIn1SpriteShader + m_Shader: {fileID: 4800000, guid: a36b7719ff0465b42ab1407d67672c5f, type: 3} + m_ShaderKeywords: ETC1_EXTERNAL_ALPHA POLARUV_ON + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _ColorRampTex: + m_Texture: {fileID: 2800000, guid: 279657edc397ece4b8029c727adf6ddc, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ColorRampTexGradient: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ColorSwapTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DistortTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _FadeBurnTex: + m_Texture: {fileID: 2800000, guid: 32e8df0008bebe746b1681a71c61f31c, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _FadeTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _GlowTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MainTex: + m_Texture: {fileID: 0} + m_Scale: {x: 4, y: 4} + m_Offset: {x: 0, y: 0} + - _OutlineDistortTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OutlineTex: + m_Texture: {fileID: 2800000, guid: 74087f6d03f233e4a8a142fa01f9e5cf, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OverlayTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ShineMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - _Alpha: 1 + - _AlphaCutoffValue: 0.25 + - _AlphaOutlineBlend: 1 + - _AlphaOutlineGlow: 5 + - _AlphaOutlineMinAlpha: 0 + - _AlphaOutlinePower: 1 + - _AlphaRoundThreshold: 0.5 + - _BillboardY: 0 + - _BlurHD: 0 + - _BlurIntensity: 10 + - _Brightness: 0 + - _ChromAberrAlpha: 0.4 + - _ChromAberrAmount: 1 + - _ClipUvDown: 1 + - _ClipUvLeft: 1 + - _ClipUvRight: 1 + - _ClipUvUp: 1 + - _ColorChangeLuminosity: 0 + - _ColorChangeTolerance: 0.25 + - _ColorChangeTolerance2: 0.25 + - _ColorChangeTolerance3: 0.25 + - _ColorRampBlend: 1 + - _ColorRampLuminosity: 0 + - _ColorRampOutline: 0 + - _ColorSwapBlend: 1 + - _ColorSwapBlueLuminosity: 0.5 + - _ColorSwapGreenLuminosity: 0.5 + - _ColorSwapRedLuminosity: 0.5 + - _Contrast: 1 + - _CullingOption: 0 + - _DistortAmount: 0.5 + - _DistortTexXSpeed: 5 + - _DistortTexYSpeed: 5 + - _EditorDrawers: 6 + - _FadeAmount: -0.1 + - _FadeBurnGlow: 2 + - _FadeBurnTransition: 0.075 + - _FadeBurnWidth: 0.025 + - _FishEyeUvAmount: 0.35 + - _FlickerAlpha: 0 + - _FlickerFreq: 0.2 + - _FlickerPercent: 0.05 + - _GhostBlend: 1 + - _GhostColorBoost: 1 + - _GhostTransparency: 0 + - _GlitchAmount: 3 + - _GlitchSize: 1 + - _Glow: 10 + - _GlowGlobal: 1 + - _GlowTexUsed: 0 + - _GradBlend: 1 + - _GradBoostX: 1.2 + - _GradBoostY: 1.2 + - _GradIsRadial: 0 + - _GrassManualAnim: 1 + - _GrassManualToggle: 0 + - _GrassRadialBend: 0.25 + - _GrassSpeed: 2 + - _GrassWind: 20 + - _GreyscaleBlend: 1 + - _GreyscaleLuminosity: 0 + - _GreyscaleOutline: 0 + - _HandDrawnAmount: 10 + - _HandDrawnSpeed: 5 + - _HitEffectBlend: 1 + - _HitEffectGlow: 5 + - _HologramBlend: 1 + - _HologramFlickerAlpha: 0 + - _HologramFlickerFreq: 0.2 + - _HologramFlickerPercent: 0.05 + - _HologramMaxAlpha: 1 + - _HologramMinAlpha: 0 + - _HologramStripesAlpha: 0.4 + - _HologramStripesAmount: 50 + - _HologramStripesFill: 0.4 + - _HologramStripesLuminosity: 1 + - _HologramStripesSpeed: 5 + - _HologramUnmodAmount: 0.4 + - _HsvBright: 1 + - _HsvSaturation: 1 + - _HsvShift: 180 + - _InnerOutlineAlpha: 1 + - _InnerOutlineGlow: 1 + - _InnerOutlineThickness: 1 + - _MaxXUV: 1 + - _MaxYUV: 1 + - _MinXUV: 0 + - _MinYUV: 0 + - _MotionBlurAngle: 0.1 + - _MotionBlurDist: 1.25 + - _MyDstMode: 10 + - _MySrcMode: 5 + - _NegativeAmount: 1 + - _OffsetUvX: 0 + - _OffsetUvY: 0 + - _OnlyInnerOutline: 0 + - _OnlyOutline: 0 + - _Outline8Directions: 0 + - _OutlineAlpha: 1 + - _OutlineDistortAmount: 0.5 + - _OutlineDistortTexXSpeed: 5 + - _OutlineDistortTexYSpeed: 5 + - _OutlineDistortToggle: 0 + - _OutlineGlow: 1.5 + - _OutlineIsPixel: 0 + - _OutlinePixelWidth: 1 + - _OutlineTexGrey: 0 + - _OutlineTexToggle: 0 + - _OutlineTexXSpeed: 10 + - _OutlineTexYSpeed: 0 + - _OutlineWidth: 0.004 + - _OverlayBlend: 1 + - _OverlayGlow: 1 + - _OverlayTextureScrollXSpeed: 0.25 + - _OverlayTextureScrollYSpeed: 0.25 + - _PinchUvAmount: 0.35 + - _PixelateSize: 32 + - _PosterizeGamma: 0.75 + - _PosterizeNumColors: 8 + - _PosterizeOutline: 0 + - _RadialClipAngle: 90 + - _RadialClipArc1: 45 + - _RadialClipArc2: 0 + - _RandomSeed: 0 + - _RectSize: 1 + - _RotateUvAmount: 0 + - _RoundWaveSpeed: 2 + - _RoundWaveStrength: 0.7 + - _ShadowAlpha: 0.5 + - _ShadowX: 0.1 + - _ShadowY: -0.05 + - _ShakeUvSpeed: 2.5 + - _ShakeUvX: 1.5 + - _ShakeUvY: 1 + - _ShineGlow: 1 + - _ShineLocation: 0.5 + - _ShineRotate: 0 + - _ShineWidth: 0.1 + - _TextureScrollXSpeed: 1 + - _TextureScrollYSpeed: 0 + - _TwistUvAmount: 1 + - _TwistUvPosX: 0.5 + - _TwistUvPosY: 0.5 + - _TwistUvRadius: 0.75 + - _WarpScale: 0.5 + - _WarpSpeed: 8 + - _WarpStrength: 0.025 + - _WaveAmount: 7 + - _WaveSpeed: 10 + - _WaveStrength: 7.5 + - _WaveX: 0 + - _WaveY: 0.5 + - _ZTestMode: 4 + - _ZWrite: 0 + - _ZoomUvAmount: 0.5 + m_Colors: + - ColorSwapRed: {r: 1, g: 1, b: 1, a: 1} + - _AlphaOutlineColor: {r: 1, g: 1, b: 1, a: 1} + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _ColorChangeNewCol: {r: 1, g: 1, b: 0, a: 1} + - _ColorChangeNewCol2: {r: 1, g: 1, b: 0, a: 1} + - _ColorChangeNewCol3: {r: 1, g: 1, b: 0, a: 1} + - _ColorChangeTarget: {r: 1, g: 0, b: 0, a: 1} + - _ColorChangeTarget2: {r: 1, g: 0, b: 0, a: 1} + - _ColorChangeTarget3: {r: 1, g: 0, b: 0, a: 1} + - _ColorSwapBlue: {r: 1, g: 1, b: 1, a: 1} + - _ColorSwapGreen: {r: 1, g: 1, b: 1, a: 1} + - _ColorSwapRed: {r: 1, g: 1, b: 1, a: 1} + - _FadeBurnColor: {r: 1, g: 1, b: 0, a: 1} + - _GlowColor: {r: 1, g: 1, b: 1, a: 1} + - _GradBotLeftCol: {r: 0, g: 0, b: 1, a: 1} + - _GradBotRightCol: {r: 0, g: 0, b: 1, a: 1} + - _GradTopLeftCol: {r: 1, g: 0, b: 0, a: 1} + - _GradTopRightCol: {r: 1, g: 0, b: 0, a: 1} + - _GreyscaleTintColor: {r: 1, g: 1, b: 1, a: 1} + - _HitEffectColor: {r: 1, g: 1, b: 1, a: 1} + - _HologramStripeColor: {r: 1, g: 1, b: 1, a: 1} + - _InnerOutlineColor: {r: 1, g: 0, b: 0, a: 1} + - _OutlineColor: {r: 1, g: 1, b: 1, a: 1} + - _OverlayColor: {r: 1, g: 1, b: 1, a: 1} + - _ShadowColor: {r: 0, g: 0, b: 0, a: 1} + - _ShineColor: {r: 1, g: 1, b: 1, a: 1} +--- !u!1 &98126757 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 98126758} + - component: {fileID: 98126760} + - component: {fileID: 98126759} + m_Layer: 0 + m_Name: Title + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &98126758 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 98126757} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: -3.1267126, z: 0} + m_LocalScale: {x: 1.2457023, y: 1.2457023, z: 1.2457023} + m_Children: [] + m_Father: {fileID: 407134450} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!102 &98126759 +TextMesh: + serializedVersion: 3 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 98126757} + m_Text: Doodle + m_OffsetZ: -1.5 + m_CharacterSize: 0.075 + m_LineSpacing: 1 + m_Anchor: 4 + m_Alignment: 0 + m_TabSize: 4 + m_FontSize: 100 + m_FontStyle: 0 + m_RichText: 1 + m_Font: {fileID: 12800000, guid: a4e6a5491519adb45919dc87eff28e55, type: 3} + m_Color: + serializedVersion: 2 + rgba: 4294967295 +--- !u!23 &98126760 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 98126757} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 10100, guid: 0000000000000000e000000000000000, type: 0} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!1 &98690188 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 98690189} + - component: {fileID: 98690191} + - component: {fileID: 98690190} + m_Layer: 0 + m_Name: Title + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &98690189 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 98690188} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: -2.51, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 1111461197} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!102 &98690190 +TextMesh: + serializedVersion: 3 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 98690188} + m_Text: Pinch + m_OffsetZ: -1.5 + m_CharacterSize: 0.075 + m_LineSpacing: 1 + m_Anchor: 4 + m_Alignment: 0 + m_TabSize: 4 + m_FontSize: 100 + m_FontStyle: 0 + m_RichText: 1 + m_Font: {fileID: 12800000, guid: a4e6a5491519adb45919dc87eff28e55, type: 3} + m_Color: + serializedVersion: 2 + rgba: 4294967295 +--- !u!23 &98690191 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 98690188} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 10100, guid: 0000000000000000e000000000000000, type: 0} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!1 &102412576 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 102412577} + - component: {fileID: 102412578} + m_Layer: 0 + m_Name: Magic Tornado + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &102412577 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 102412576} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 210, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 582549648} + - {fileID: 799318216} + - {fileID: 1454273602} + - {fileID: 595980604} + - {fileID: 1586363708} + m_Father: {fileID: 1563905016} + m_RootOrder: 21 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &102412578 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 102412576} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 98b644315d7a92842b89e04f55c48e02, type: 3} + m_Name: + m_EditorClassIdentifier: +--- !u!21 &108846146 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: AllIn1SpriteShader/AllIn1SpriteShader + m_Shader: {fileID: 4800000, guid: a36b7719ff0465b42ab1407d67672c5f, type: 3} + m_ShaderKeywords: COLORSWAP_ON ETC1_EXTERNAL_ALPHA + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _ColorRampTex: + m_Texture: {fileID: 2800000, guid: 279657edc397ece4b8029c727adf6ddc, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ColorRampTexGradient: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ColorSwapTex: + m_Texture: {fileID: 2800000, guid: 065da6c7b90ca904dab9cbc6b415fd19, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DistortTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _FadeBurnTex: + m_Texture: {fileID: 2800000, guid: 32e8df0008bebe746b1681a71c61f31c, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _FadeTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _GlowTex: + 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} + - _OutlineDistortTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OutlineTex: + m_Texture: {fileID: 2800000, guid: 74087f6d03f233e4a8a142fa01f9e5cf, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OverlayTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ShineMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - _Alpha: 1 + - _AlphaCutoffValue: 0.25 + - _AlphaOutlineBlend: 1 + - _AlphaOutlineGlow: 5 + - _AlphaOutlineMinAlpha: 0 + - _AlphaOutlinePower: 1 + - _AlphaRoundThreshold: 0.5 + - _BillboardY: 0 + - _BlurHD: 0 + - _BlurIntensity: 10 + - _Brightness: 0 + - _ChromAberrAlpha: 0.4 + - _ChromAberrAmount: 1 + - _ClipUvDown: 1 + - _ClipUvLeft: 1 + - _ClipUvRight: 1 + - _ClipUvUp: 1 + - _ColorChangeLuminosity: 0 + - _ColorChangeTolerance: 0.25 + - _ColorChangeTolerance2: 0.25 + - _ColorChangeTolerance3: 0.25 + - _ColorRampBlend: 1 + - _ColorRampLuminosity: 0 + - _ColorRampOutline: 0 + - _ColorSwapBlend: 1 + - _ColorSwapBlueLuminosity: 0.5 + - _ColorSwapGreenLuminosity: 0.09 + - _ColorSwapRedLuminosity: 0.604 + - _Contrast: 1 + - _CullingOption: 0 + - _DistortAmount: 0.5 + - _DistortTexXSpeed: 5 + - _DistortTexYSpeed: 5 + - _EditorDrawers: 6 + - _FadeAmount: -0.1 + - _FadeBurnGlow: 2 + - _FadeBurnTransition: 0.075 + - _FadeBurnWidth: 0.025 + - _FishEyeUvAmount: 0.35 + - _FlickerAlpha: 0 + - _FlickerFreq: 0.2 + - _FlickerPercent: 0.05 + - _GhostBlend: 1 + - _GhostColorBoost: 1 + - _GhostTransparency: 0 + - _GlitchAmount: 3 + - _GlitchSize: 1 + - _Glow: 10 + - _GlowGlobal: 1 + - _GlowTexUsed: 0 + - _GradBlend: 1 + - _GradBoostX: 1.2 + - _GradBoostY: 1.2 + - _GradIsRadial: 0 + - _GrassManualAnim: 1 + - _GrassManualToggle: 0 + - _GrassRadialBend: 0.25 + - _GrassSpeed: 2 + - _GrassWind: 20 + - _GreyscaleBlend: 1 + - _GreyscaleLuminosity: 0 + - _GreyscaleOutline: 0 + - _HandDrawnAmount: 10 + - _HandDrawnSpeed: 5 + - _HitEffectBlend: 1 + - _HitEffectGlow: 5 + - _HologramBlend: 1 + - _HologramFlickerAlpha: 0 + - _HologramFlickerFreq: 0.2 + - _HologramFlickerPercent: 0.05 + - _HologramMaxAlpha: 1 + - _HologramMinAlpha: 0 + - _HologramStripesAlpha: 0.4 + - _HologramStripesAmount: 50 + - _HologramStripesFill: 0.4 + - _HologramStripesLuminosity: 1 + - _HologramStripesSpeed: 5 + - _HologramUnmodAmount: 0.4 + - _HsvBright: 1 + - _HsvSaturation: 1 + - _HsvShift: 180 + - _InnerOutlineAlpha: 1 + - _InnerOutlineGlow: 1 + - _InnerOutlineThickness: 1 + - _MaxXUV: 1 + - _MaxYUV: 1 + - _MinXUV: 0 + - _MinYUV: 0 + - _MotionBlurAngle: 0.1 + - _MotionBlurDist: 1.25 + - _MyDstMode: 10 + - _MySrcMode: 5 + - _NegativeAmount: 1 + - _OffsetUvX: 0 + - _OffsetUvY: 0 + - _OnlyInnerOutline: 0 + - _OnlyOutline: 0 + - _Outline8Directions: 0 + - _OutlineAlpha: 1 + - _OutlineDistortAmount: 0.5 + - _OutlineDistortTexXSpeed: 5 + - _OutlineDistortTexYSpeed: 5 + - _OutlineDistortToggle: 0 + - _OutlineGlow: 1.5 + - _OutlineIsPixel: 0 + - _OutlinePixelWidth: 1 + - _OutlineTexGrey: 0 + - _OutlineTexToggle: 0 + - _OutlineTexXSpeed: 10 + - _OutlineTexYSpeed: 0 + - _OutlineWidth: 0.004 + - _OverlayBlend: 1 + - _OverlayGlow: 1 + - _OverlayTextureScrollXSpeed: 0.25 + - _OverlayTextureScrollYSpeed: 0.25 + - _PinchUvAmount: 0.35 + - _PixelateSize: 32 + - _PosterizeGamma: 0.75 + - _PosterizeNumColors: 8 + - _PosterizeOutline: 0 + - _RadialClip: 0 + - _RadialClip2: 45 + - _RadialClipAngle: 90 + - _RadialClipArc1: 45 + - _RadialClipArc2: 0 + - _RadialStartAngle: 90 + - _RandomSeed: 0 + - _RectSize: 1 + - _RotateUvAmount: 0 + - _RoundWaveSpeed: 2 + - _RoundWaveStrength: 0.7 + - _ShadowAlpha: 0.5 + - _ShadowX: 0.1 + - _ShadowY: -0.05 + - _ShakeUvSpeed: 2.5 + - _ShakeUvX: 1.5 + - _ShakeUvY: 1 + - _ShineGlow: 1 + - _ShineLocation: 0.5 + - _ShineRotate: 0 + - _ShineWidth: 0.1 + - _TextureScrollXSpeed: 1 + - _TextureScrollYSpeed: 0 + - _TwistUvAmount: 1 + - _TwistUvPosX: 0.5 + - _TwistUvPosY: 0.5 + - _TwistUvRadius: 0.75 + - _WarpScale: 0.5 + - _WarpSpeed: 8 + - _WarpStrength: 0.025 + - _WaveAmount: 7 + - _WaveSpeed: 10 + - _WaveStrength: 7.5 + - _WaveX: 0 + - _WaveY: 0.5 + - _ZTestMode: 4 + - _ZWrite: 0 + - _ZoomUvAmount: 0.5 + m_Colors: + - ColorSwapRed: {r: 1, g: 1, b: 1, a: 1} + - _AlphaOutlineColor: {r: 1, g: 1, b: 1, a: 1} + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _ColorChangeNewCol: {r: 1, g: 1, b: 0, a: 1} + - _ColorChangeNewCol2: {r: 1, g: 1, b: 0, a: 1} + - _ColorChangeNewCol3: {r: 1, g: 1, b: 0, a: 1} + - _ColorChangeTarget: {r: 1, g: 0, b: 0, a: 1} + - _ColorChangeTarget2: {r: 1, g: 0, b: 0, a: 1} + - _ColorChangeTarget3: {r: 1, g: 0, b: 0, a: 1} + - _ColorSwapBlue: {r: 1, g: 1, b: 1, a: 1} + - _ColorSwapGreen: {r: 1, g: 0, b: 0, a: 1} + - _ColorSwapRed: {r: 0, g: 0.5643088, b: 0.8396226, a: 1} + - _FadeBurnColor: {r: 1, g: 1, b: 0, a: 1} + - _GlowColor: {r: 1, g: 1, b: 1, a: 1} + - _GradBotLeftCol: {r: 0, g: 0, b: 1, a: 1} + - _GradBotRightCol: {r: 0, g: 0, b: 1, a: 1} + - _GradTopLeftCol: {r: 1, g: 0, b: 0, a: 1} + - _GradTopRightCol: {r: 1, g: 0, b: 0, a: 1} + - _GreyscaleTintColor: {r: 1, g: 1, b: 1, a: 1} + - _HitEffectColor: {r: 1, g: 1, b: 1, a: 1} + - _HologramStripeColor: {r: 1, g: 1, b: 1, a: 1} + - _InnerOutlineColor: {r: 1, g: 0, b: 0, a: 1} + - _OutlineColor: {r: 1, g: 1, b: 1, a: 1} + - _OverlayColor: {r: 1, g: 1, b: 1, a: 1} + - _ShadowColor: {r: 0, g: 0, b: 0, a: 1} + - _ShineColor: {r: 1, g: 1, b: 1, a: 1} +--- !u!21 &111852238 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: AllIn1SpriteShader/AllIn1SpriteShader + m_Shader: {fileID: 4800000, guid: a36b7719ff0465b42ab1407d67672c5f, type: 3} + m_ShaderKeywords: ETC1_EXTERNAL_ALPHA GRADIENT_ON + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _ColorRampTex: + m_Texture: {fileID: 2800000, guid: 279657edc397ece4b8029c727adf6ddc, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ColorRampTexGradient: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ColorSwapTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DistortTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _FadeBurnTex: + m_Texture: {fileID: 2800000, guid: 32e8df0008bebe746b1681a71c61f31c, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _FadeTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _GlowTex: + 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} + - _OutlineDistortTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OutlineTex: + m_Texture: {fileID: 2800000, guid: 74087f6d03f233e4a8a142fa01f9e5cf, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OverlayTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ShineMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - _Alpha: 1 + - _AlphaCutoffValue: 0.25 + - _AlphaOutlineBlend: 1 + - _AlphaOutlineGlow: 5 + - _AlphaOutlineMinAlpha: 0 + - _AlphaOutlinePower: 1 + - _AlphaRoundThreshold: 0.5 + - _BillboardY: 0 + - _BlurHD: 0 + - _BlurIntensity: 10 + - _Brightness: 0 + - _ChromAberrAlpha: 0.4 + - _ChromAberrAmount: 1 + - _ClipUvDown: 1 + - _ClipUvLeft: 1 + - _ClipUvRight: 1 + - _ClipUvUp: 1 + - _ColorChangeLuminosity: 0 + - _ColorChangeTolerance: 0.25 + - _ColorChangeTolerance2: 0.25 + - _ColorChangeTolerance3: 0.25 + - _ColorRampBlend: 1 + - _ColorRampLuminosity: 0 + - _ColorRampOutline: 0 + - _ColorSwapBlend: 1 + - _ColorSwapBlueLuminosity: 0.5 + - _ColorSwapGreenLuminosity: 0.5 + - _ColorSwapRedLuminosity: 0.5 + - _Contrast: 1 + - _CullingOption: 0 + - _DistortAmount: 0.5 + - _DistortTexXSpeed: 5 + - _DistortTexYSpeed: 5 + - _EditorDrawers: 6 + - _FadeAmount: -0.1 + - _FadeBurnGlow: 2 + - _FadeBurnTransition: 0.075 + - _FadeBurnWidth: 0.025 + - _FishEyeUvAmount: 0.35 + - _FlickerAlpha: 0 + - _FlickerFreq: 0.2 + - _FlickerPercent: 0.05 + - _GhostBlend: 1 + - _GhostColorBoost: 1 + - _GhostTransparency: 0 + - _GlitchAmount: 3 + - _GlitchSize: 1 + - _Glow: 10 + - _GlowGlobal: 1 + - _GlowTexUsed: 0 + - _GradBlend: 0.858 + - _GradBoostX: 1.2 + - _GradBoostY: 1.2 + - _GradIsRadial: 0 + - _GrassManualAnim: 1 + - _GrassManualToggle: 0 + - _GrassRadialBend: 0.25 + - _GrassSpeed: 2 + - _GrassWind: 20 + - _GreyscaleBlend: 1 + - _GreyscaleLuminosity: 0 + - _GreyscaleOutline: 0 + - _HandDrawnAmount: 10 + - _HandDrawnSpeed: 5 + - _HitEffectBlend: 1 + - _HitEffectGlow: 5 + - _HologramBlend: 1 + - _HologramFlickerAlpha: 0 + - _HologramFlickerFreq: 0.2 + - _HologramFlickerPercent: 0.05 + - _HologramMaxAlpha: 1 + - _HologramMinAlpha: 0 + - _HologramStripesAlpha: 0.4 + - _HologramStripesAmount: 50 + - _HologramStripesFill: 0.4 + - _HologramStripesLuminosity: 1 + - _HologramStripesSpeed: 5 + - _HologramUnmodAmount: 0.4 + - _HsvBright: 1 + - _HsvSaturation: 1 + - _HsvShift: 180 + - _InnerOutlineAlpha: 1 + - _InnerOutlineGlow: 1 + - _InnerOutlineThickness: 1 + - _MaxXUV: 1 + - _MaxYUV: 1 + - _MinXUV: 0 + - _MinYUV: 0 + - _MotionBlurAngle: 0.1 + - _MotionBlurDist: 1.25 + - _MyDstMode: 10 + - _MySrcMode: 5 + - _NegativeAmount: 1 + - _OffsetUvX: 0 + - _OffsetUvY: 0 + - _OnlyInnerOutline: 0 + - _OnlyOutline: 0 + - _Outline8Directions: 0 + - _OutlineAlpha: 1 + - _OutlineDistortAmount: 0.5 + - _OutlineDistortTexXSpeed: 5 + - _OutlineDistortTexYSpeed: 5 + - _OutlineDistortToggle: 0 + - _OutlineGlow: 1.5 + - _OutlineIsPixel: 0 + - _OutlinePixelWidth: 1 + - _OutlineTexGrey: 0 + - _OutlineTexToggle: 0 + - _OutlineTexXSpeed: 10 + - _OutlineTexYSpeed: 0 + - _OutlineWidth: 0.004 + - _OverlayBlend: 1 + - _OverlayGlow: 1 + - _OverlayTextureScrollXSpeed: 0.25 + - _OverlayTextureScrollYSpeed: 0.25 + - _PinchUvAmount: 0.35 + - _PixelateSize: 32 + - _PosterizeGamma: 0.75 + - _PosterizeNumColors: 8 + - _PosterizeOutline: 0 + - _RadialClip: 0 + - _RadialClip2: 45 + - _RadialClipAngle: 90 + - _RadialClipArc1: 45 + - _RadialClipArc2: 0 + - _RadialStartAngle: 90 + - _RandomSeed: 0 + - _RectSize: 1 + - _RotateUvAmount: 0 + - _RoundWaveSpeed: 2 + - _RoundWaveStrength: 0.7 + - _ShadowAlpha: 0.5 + - _ShadowX: 0.1 + - _ShadowY: -0.05 + - _ShakeUvSpeed: 2.5 + - _ShakeUvX: 1.5 + - _ShakeUvY: 1 + - _ShineGlow: 1 + - _ShineLocation: 0.5 + - _ShineRotate: 0 + - _ShineWidth: 0.1 + - _TextureScrollXSpeed: 1 + - _TextureScrollYSpeed: 0 + - _TwistUvAmount: 1 + - _TwistUvPosX: 0.5 + - _TwistUvPosY: 0.5 + - _TwistUvRadius: 0.75 + - _WarpScale: 0.5 + - _WarpSpeed: 8 + - _WarpStrength: 0.025 + - _WaveAmount: 7 + - _WaveSpeed: 10 + - _WaveStrength: 7.5 + - _WaveX: 0 + - _WaveY: 0.5 + - _ZTestMode: 4 + - _ZWrite: 0 + - _ZoomUvAmount: 0.5 + m_Colors: + - ColorSwapRed: {r: 1, g: 1, b: 1, a: 1} + - _AlphaOutlineColor: {r: 1, g: 1, b: 1, a: 1} + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _ColorChangeNewCol: {r: 1, g: 1, b: 0, a: 1} + - _ColorChangeNewCol2: {r: 1, g: 1, b: 0, a: 1} + - _ColorChangeNewCol3: {r: 1, g: 1, b: 0, a: 1} + - _ColorChangeTarget: {r: 1, g: 0, b: 0, a: 1} + - _ColorChangeTarget2: {r: 1, g: 0, b: 0, a: 1} + - _ColorChangeTarget3: {r: 1, g: 0, b: 0, a: 1} + - _ColorSwapBlue: {r: 1, g: 1, b: 1, a: 1} + - _ColorSwapGreen: {r: 1, g: 1, b: 1, a: 1} + - _ColorSwapRed: {r: 1, g: 1, b: 1, a: 1} + - _FadeBurnColor: {r: 1, g: 1, b: 0, a: 1} + - _GlowColor: {r: 1, g: 1, b: 1, a: 1} + - _GradBotLeftCol: {r: 0, g: 0, b: 1, a: 1} + - _GradBotRightCol: {r: 0, g: 0, b: 1, a: 1} + - _GradTopLeftCol: {r: 1, g: 0, b: 0, a: 1} + - _GradTopRightCol: {r: 1, g: 0, b: 0, a: 1} + - _GreyscaleTintColor: {r: 1, g: 1, b: 1, a: 1} + - _HitEffectColor: {r: 1, g: 1, b: 1, a: 1} + - _HologramStripeColor: {r: 1, g: 1, b: 1, a: 1} + - _InnerOutlineColor: {r: 1, g: 0, b: 0, a: 1} + - _OutlineColor: {r: 1, g: 1, b: 1, a: 1} + - _OverlayColor: {r: 1, g: 1, b: 1, a: 1} + - _ShadowColor: {r: 0, g: 0, b: 0, a: 1} + - _ShineColor: {r: 1, g: 1, b: 1, a: 1} +--- !u!1 &114782626 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 114782627} + - component: {fileID: 114782629} + - component: {fileID: 114782628} + m_Layer: 0 + m_Name: Animated + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 0 +--- !u!4 &114782627 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 114782626} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: -4.447157, z: 0} + m_LocalScale: {x: 1.2457023, y: 1.2457023, z: 1.2457023} + m_Children: [] + m_Father: {fileID: 499272004} + m_RootOrder: 2 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!102 &114782628 +TextMesh: + serializedVersion: 3 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 114782626} + m_Text: (Has Animation) + m_OffsetZ: -1.5 + m_CharacterSize: 0.075 + m_LineSpacing: 1 + m_Anchor: 4 + m_Alignment: 0 + m_TabSize: 4 + m_FontSize: 100 + m_FontStyle: 0 + m_RichText: 1 + m_Font: {fileID: 12800000, guid: a4e6a5491519adb45919dc87eff28e55, type: 3} + m_Color: + serializedVersion: 2 + rgba: 4294967295 +--- !u!23 &114782629 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 114782626} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: a4e6a5491519adb45919dc87eff28e55, type: 3} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!1 &124794630 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 124794631} + - component: {fileID: 124794633} + - component: {fileID: 124794632} + m_Layer: 0 + m_Name: Title + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &124794631 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 124794630} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: -2.51, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 950130248} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!102 &124794632 +TextMesh: + serializedVersion: 3 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 124794630} + m_Text: Grass + m_OffsetZ: -1.5 + m_CharacterSize: 0.075 + m_LineSpacing: 1 + m_Anchor: 4 + m_Alignment: 0 + m_TabSize: 4 + m_FontSize: 100 + m_FontStyle: 0 + m_RichText: 1 + m_Font: {fileID: 12800000, guid: a4e6a5491519adb45919dc87eff28e55, type: 3} + m_Color: + serializedVersion: 2 + rgba: 4294967295 +--- !u!23 &124794633 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 124794630} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 10100, guid: 0000000000000000e000000000000000, type: 0} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!1 &124843812 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 124843813} + - component: {fileID: 124843815} + - component: {fileID: 124843814} + m_Layer: 0 + m_Name: Title + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &124843813 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 124843812} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: -2.51, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 56751283} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!102 &124843814 +TextMesh: + serializedVersion: 3 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 124843812} + m_Text: Original Sprite + m_OffsetZ: -1.5 + m_CharacterSize: 0.075 + m_LineSpacing: 1 + m_Anchor: 4 + m_Alignment: 0 + m_TabSize: 4 + m_FontSize: 100 + m_FontStyle: 0 + m_RichText: 1 + m_Font: {fileID: 12800000, guid: a4e6a5491519adb45919dc87eff28e55, type: 3} + m_Color: + serializedVersion: 2 + rgba: 4294967295 +--- !u!23 &124843815 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 124843812} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 10100, guid: 0000000000000000e000000000000000, type: 0} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!1 &133362205 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 133362206} + - component: {fileID: 133362208} + - component: {fileID: 133362207} + m_Layer: 0 + m_Name: Title + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &133362206 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 133362205} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: -2.51, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 746759203} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!102 &133362207 +TextMesh: + serializedVersion: 3 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 133362205} + m_Text: Hit Effect + m_OffsetZ: -1.5 + m_CharacterSize: 0.075 + m_LineSpacing: 1 + m_Anchor: 4 + m_Alignment: 0 + m_TabSize: 4 + m_FontSize: 100 + m_FontStyle: 0 + m_RichText: 1 + m_Font: {fileID: 12800000, guid: a4e6a5491519adb45919dc87eff28e55, type: 3} + m_Color: + serializedVersion: 2 + rgba: 4294967295 +--- !u!23 &133362208 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 133362205} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 10100, guid: 0000000000000000e000000000000000, type: 0} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!1 &136921168 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 136921169} + - component: {fileID: 136921171} + - component: {fileID: 136921170} + m_Layer: 0 + m_Name: Animated + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 0 +--- !u!4 &136921169 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 136921168} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: -3.57, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 1120052622} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!102 &136921170 +TextMesh: + serializedVersion: 3 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 136921168} + m_Text: (Has Animation) + m_OffsetZ: -1.5 + m_CharacterSize: 0.075 + m_LineSpacing: 1 + m_Anchor: 4 + m_Alignment: 0 + m_TabSize: 4 + m_FontSize: 100 + m_FontStyle: 0 + m_RichText: 1 + m_Font: {fileID: 12800000, guid: a4e6a5491519adb45919dc87eff28e55, type: 3} + m_Color: + serializedVersion: 2 + rgba: 4294967295 +--- !u!23 &136921171 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 136921168} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: a4e6a5491519adb45919dc87eff28e55, type: 3} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!21 &139334897 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: AllIn1SpriteShader/AllIn1SpriteShader + m_Shader: {fileID: 4800000, guid: a36b7719ff0465b42ab1407d67672c5f, type: 3} + m_ShaderKeywords: CLIPPING_ON ETC1_EXTERNAL_ALPHA ROTATEUV_ON + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _ColorRampTex: + m_Texture: {fileID: 2800000, guid: 279657edc397ece4b8029c727adf6ddc, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ColorRampTexGradient: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ColorSwapTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DistortTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _FadeBurnTex: + m_Texture: {fileID: 2800000, guid: 32e8df0008bebe746b1681a71c61f31c, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _FadeTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _GlowTex: + 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} + - _OutlineDistortTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OutlineTex: + m_Texture: {fileID: 2800000, guid: 74087f6d03f233e4a8a142fa01f9e5cf, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OverlayTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ShineMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - _Alpha: 1 + - _AlphaCutoffValue: 0.25 + - _AlphaOutlineBlend: 1 + - _AlphaOutlineGlow: 5 + - _AlphaOutlineMinAlpha: 0 + - _AlphaOutlinePower: 1 + - _AlphaRoundThreshold: 0.5 + - _BillboardY: 0 + - _BlurHD: 0 + - _BlurIntensity: 10 + - _Brightness: 0 + - _ChromAberrAlpha: 0.4 + - _ChromAberrAmount: 1 + - _ClipUvDown: 0.1 + - _ClipUvLeft: 0.1 + - _ClipUvRight: 0.1 + - _ClipUvUp: 0.1 + - _ColorChangeLuminosity: 0 + - _ColorChangeTolerance: 0.25 + - _ColorChangeTolerance2: 0.25 + - _ColorChangeTolerance3: 0.25 + - _ColorRampBlend: 1 + - _ColorRampLuminosity: 0 + - _ColorRampOutline: 0 + - _ColorSwapBlend: 1 + - _ColorSwapBlueLuminosity: 0.5 + - _ColorSwapGreenLuminosity: 0.5 + - _ColorSwapRedLuminosity: 0.5 + - _Contrast: 1 + - _CullingOption: 0 + - _DistortAmount: 0.5 + - _DistortTexXSpeed: 5 + - _DistortTexYSpeed: 5 + - _EditorDrawers: 6 + - _FadeAmount: -0.1 + - _FadeBurnGlow: 2 + - _FadeBurnTransition: 0.075 + - _FadeBurnWidth: 0.025 + - _FishEyeUvAmount: 0.35 + - _FlickerAlpha: 0 + - _FlickerFreq: 0.2 + - _FlickerPercent: 0.05 + - _GhostBlend: 1 + - _GhostColorBoost: 1 + - _GhostTransparency: 0 + - _GlitchAmount: 3 + - _GlitchSize: 1 + - _Glow: 10 + - _GlowGlobal: 1 + - _GlowTexUsed: 0 + - _GradBlend: 1 + - _GradBoostX: 1.2 + - _GradBoostY: 1.2 + - _GradIsRadial: 0 + - _GrassManualAnim: 1 + - _GrassManualToggle: 0 + - _GrassRadialBend: 0.25 + - _GrassSpeed: 2 + - _GrassWind: 20 + - _GreyscaleBlend: 1 + - _GreyscaleLuminosity: 0 + - _GreyscaleOutline: 0 + - _HandDrawnAmount: 10 + - _HandDrawnSpeed: 5 + - _HitEffectBlend: 1 + - _HitEffectGlow: 5 + - _HologramBlend: 1 + - _HologramFlickerAlpha: 0 + - _HologramFlickerFreq: 0.2 + - _HologramMaxAlpha: 1 + - _HologramMinAlpha: 0 + - _HologramStripesAlpha: 0.4 + - _HologramStripesAmount: 50 + - _HologramStripesFill: 0.4 + - _HologramStripesLuminosity: 1 + - _HologramStripesSpeed: 5 + - _HologramUnmodAmount: 0.4 + - _HsvBright: 1 + - _HsvSaturation: 1 + - _HsvShift: 180 + - _InnerOutlineAlpha: 1 + - _InnerOutlineGlow: 1 + - _InnerOutlineThickness: 1 + - _MaxXUV: 1 + - _MaxYUV: 1 + - _MinXUV: 0 + - _MinYUV: 0 + - _MotionBlurAngle: 0.1 + - _MotionBlurDist: 1.25 + - _MyDstMode: 10 + - _MySrcMode: 5 + - _NegativeAmount: 1 + - _OffsetUvX: 0 + - _OffsetUvY: 0 + - _OnlyInnerOutline: 0 + - _OnlyOutline: 0 + - _Outline8Directions: 0 + - _OutlineAlpha: 1 + - _OutlineDistortAmount: 0.5 + - _OutlineDistortTexXSpeed: 5 + - _OutlineDistortTexYSpeed: 5 + - _OutlineDistortToggle: 0 + - _OutlineGlow: 1.5 + - _OutlineIsPixel: 0 + - _OutlinePixelWidth: 1 + - _OutlineTexGrey: 0 + - _OutlineTexToggle: 0 + - _OutlineTexXSpeed: 10 + - _OutlineTexYSpeed: 0 + - _OutlineWidth: 0.004 + - _OverlayBlend: 1 + - _OverlayGlow: 1 + - _OverlayTextureScrollXSpeed: 0.25 + - _OverlayTextureScrollYSpeed: 0.25 + - _PinchUvAmount: 0.35 + - _PixelateSize: 32 + - _PosterizeGamma: 0.75 + - _PosterizeNumColors: 8 + - _PosterizeOutline: 0 + - _RadialClip: 0 + - _RadialClip2: 45 + - _RadialClipAngle: 90 + - _RadialClipArc1: 45 + - _RadialClipArc2: 0 + - _RadialStartAngle: 90 + - _RandomSeed: 0 + - _RectSize: 1 + - _RotateUvAmount: 2.66 + - _RoundWaveSpeed: 2 + - _RoundWaveStrength: 0.7 + - _ShadowAlpha: 0.5 + - _ShadowX: 0.1 + - _ShadowY: -0.05 + - _ShakeUvSpeed: 2.5 + - _ShakeUvX: 1.5 + - _ShakeUvY: 1 + - _ShineGlow: 1 + - _ShineLocation: 0.5 + - _ShineRotate: 0 + - _ShineWidth: 0.1 + - _TextureScrollXSpeed: 1 + - _TextureScrollYSpeed: 0 + - _TwistUvAmount: 1 + - _TwistUvPosX: 0.5 + - _TwistUvPosY: 0.5 + - _TwistUvRadius: 0.75 + - _WarpScale: 0.5 + - _WarpSpeed: 8 + - _WarpStrength: 0.025 + - _WaveAmount: 7 + - _WaveSpeed: 10 + - _WaveStrength: 7.5 + - _WaveX: 0 + - _WaveY: 0.5 + - _ZTestMode: 4 + - _ZWrite: 0 + - _ZoomUvAmount: 0.5 + m_Colors: + - ColorSwapRed: {r: 1, g: 1, b: 1, a: 1} + - _AlphaOutlineColor: {r: 1, g: 1, b: 1, a: 1} + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _ColorChangeNewCol: {r: 1, g: 1, b: 0, a: 1} + - _ColorChangeNewCol2: {r: 1, g: 1, b: 0, a: 1} + - _ColorChangeNewCol3: {r: 1, g: 1, b: 0, a: 1} + - _ColorChangeTarget: {r: 1, g: 0, b: 0, a: 1} + - _ColorChangeTarget2: {r: 1, g: 0, b: 0, a: 1} + - _ColorChangeTarget3: {r: 1, g: 0, b: 0, a: 1} + - _ColorSwapBlue: {r: 1, g: 1, b: 1, a: 1} + - _ColorSwapGreen: {r: 1, g: 1, b: 1, a: 1} + - _ColorSwapRed: {r: 1, g: 1, b: 1, a: 1} + - _FadeBurnColor: {r: 1, g: 1, b: 0, a: 1} + - _GlowColor: {r: 1, g: 1, b: 1, a: 1} + - _GradBotLeftCol: {r: 0, g: 0, b: 1, a: 1} + - _GradBotRightCol: {r: 0, g: 0, b: 1, a: 1} + - _GradTopLeftCol: {r: 1, g: 0, b: 0, a: 1} + - _GradTopRightCol: {r: 1, g: 0, b: 0, a: 1} + - _GreyscaleTintColor: {r: 1, g: 1, b: 1, a: 1} + - _HitEffectColor: {r: 1, g: 1, b: 1, a: 1} + - _HologramStripeColor: {r: 1, g: 1, b: 1, a: 1} + - _InnerOutlineColor: {r: 1, g: 0, b: 0, a: 1} + - _OutlineColor: {r: 1, g: 1, b: 1, a: 1} + - _OverlayColor: {r: 1, g: 1, b: 1, a: 1} + - _ShadowColor: {r: 0, g: 0, b: 0, a: 1} + - _ShineColor: {r: 1, g: 1, b: 1, a: 1} +--- !u!1 &144455307 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 144455308} + - component: {fileID: 144455310} + - component: {fileID: 144455309} + m_Layer: 0 + m_Name: Title + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &144455308 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 144455307} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: -3.1267126, z: 0} + m_LocalScale: {x: 1.2457023, y: 1.2457023, z: 1.2457023} + m_Children: [] + m_Father: {fileID: 642204093} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!102 &144455309 +TextMesh: + serializedVersion: 3 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 144455307} + m_Text: Screen Hit + m_OffsetZ: -1.5 + m_CharacterSize: 0.075 + m_LineSpacing: 1 + m_Anchor: 4 + m_Alignment: 0 + m_TabSize: 4 + m_FontSize: 100 + m_FontStyle: 0 + m_RichText: 1 + m_Font: {fileID: 12800000, guid: a4e6a5491519adb45919dc87eff28e55, type: 3} + m_Color: + serializedVersion: 2 + rgba: 4294967295 +--- !u!23 &144455310 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 144455307} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 10100, guid: 0000000000000000e000000000000000, type: 0} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!21 &150333392 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: AllIn1SpriteShader/AllIn1SpriteShader + m_Shader: {fileID: 4800000, guid: a36b7719ff0465b42ab1407d67672c5f, type: 3} + m_ShaderKeywords: ETC1_EXTERNAL_ALPHA GHOST_ON + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _ColorRampTex: + m_Texture: {fileID: 2800000, guid: 279657edc397ece4b8029c727adf6ddc, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ColorRampTexGradient: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ColorSwapTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DistortTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _FadeBurnTex: + m_Texture: {fileID: 2800000, guid: 32e8df0008bebe746b1681a71c61f31c, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _FadeTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _GlowTex: + 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} + - _OutlineDistortTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OutlineTex: + m_Texture: {fileID: 2800000, guid: 74087f6d03f233e4a8a142fa01f9e5cf, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OverlayTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ShineMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - _Alpha: 1 + - _AlphaCutoffValue: 0.25 + - _AlphaOutlineBlend: 1 + - _AlphaOutlineGlow: 5 + - _AlphaOutlineMinAlpha: 0 + - _AlphaOutlinePower: 1 + - _AlphaRoundThreshold: 0.5 + - _BillboardY: 0 + - _BlurHD: 0 + - _BlurIntensity: 10 + - _Brightness: 0 + - _ChromAberrAlpha: 0.4 + - _ChromAberrAmount: 1 + - _ClipUvDown: 1 + - _ClipUvLeft: 1 + - _ClipUvRight: 1 + - _ClipUvUp: 1 + - _ColorChangeLuminosity: 0 + - _ColorChangeTolerance: 0.25 + - _ColorChangeTolerance2: 0.25 + - _ColorChangeTolerance3: 0.25 + - _ColorRampBlend: 1 + - _ColorRampLuminosity: 0 + - _ColorRampOutline: 0 + - _ColorSwapBlend: 1 + - _ColorSwapBlueLuminosity: 0.5 + - _ColorSwapGreenLuminosity: 0.5 + - _ColorSwapRedLuminosity: 0.5 + - _Contrast: 1 + - _CullingOption: 0 + - _DistortAmount: 0.5 + - _DistortTexXSpeed: 5 + - _DistortTexYSpeed: 5 + - _EditorDrawers: 6 + - _FadeAmount: -0.1 + - _FadeBurnGlow: 2 + - _FadeBurnTransition: 0.075 + - _FadeBurnWidth: 0.025 + - _FishEyeUvAmount: 0.35 + - _FlickerAlpha: 0 + - _FlickerFreq: 0.2 + - _FlickerPercent: 0.05 + - _GhostBlend: 1 + - _GhostColorBoost: 1.41 + - _GhostTransparency: 0 + - _GlitchAmount: 3 + - _GlitchSize: 1 + - _Glow: 10 + - _GlowGlobal: 1 + - _GlowTexUsed: 0 + - _GradBlend: 1 + - _GradBoostX: 1.2 + - _GradBoostY: 1.2 + - _GradIsRadial: 0 + - _GrassManualAnim: 1 + - _GrassManualToggle: 0 + - _GrassRadialBend: 0.25 + - _GrassSpeed: 2 + - _GrassWind: 20 + - _GreyscaleBlend: 1 + - _GreyscaleLuminosity: 0 + - _GreyscaleOutline: 0 + - _HandDrawnAmount: 10 + - _HandDrawnSpeed: 5 + - _HitEffectBlend: 1 + - _HitEffectGlow: 5 + - _HologramBlend: 1 + - _HologramFlickerAlpha: 0 + - _HologramFlickerFreq: 0.2 + - _HologramFlickerPercent: 0.05 + - _HologramMaxAlpha: 1 + - _HologramMinAlpha: 0 + - _HologramStripesAlpha: 0.4 + - _HologramStripesAmount: 50 + - _HologramStripesFill: 0.4 + - _HologramStripesLuminosity: 1 + - _HologramStripesSpeed: 5 + - _HologramUnmodAmount: 0.4 + - _HsvBright: 1 + - _HsvSaturation: 1 + - _HsvShift: 180 + - _InnerOutlineAlpha: 1 + - _InnerOutlineGlow: 1 + - _InnerOutlineThickness: 1 + - _MaxXUV: 1 + - _MaxYUV: 1 + - _MinXUV: 0 + - _MinYUV: 0 + - _MotionBlurAngle: 0.1 + - _MotionBlurDist: 1.25 + - _MyDstMode: 10 + - _MySrcMode: 5 + - _NegativeAmount: 1 + - _OffsetUvX: 0 + - _OffsetUvY: 0 + - _OnlyInnerOutline: 0 + - _OnlyOutline: 0 + - _Outline8Directions: 0 + - _OutlineAlpha: 1 + - _OutlineDistortAmount: 0.5 + - _OutlineDistortTexXSpeed: 5 + - _OutlineDistortTexYSpeed: 5 + - _OutlineDistortToggle: 0 + - _OutlineGlow: 1.5 + - _OutlineIsPixel: 0 + - _OutlinePixelWidth: 1 + - _OutlineTexGrey: 0 + - _OutlineTexToggle: 0 + - _OutlineTexXSpeed: 10 + - _OutlineTexYSpeed: 0 + - _OutlineWidth: 0.004 + - _OverlayBlend: 1 + - _OverlayGlow: 1 + - _OverlayTextureScrollXSpeed: 0.25 + - _OverlayTextureScrollYSpeed: 0.25 + - _PinchUvAmount: 0.35 + - _PixelateSize: 32 + - _PosterizeGamma: 0.75 + - _PosterizeNumColors: 8 + - _PosterizeOutline: 0 + - _RadialClip: 45 + - _RadialClip2: 0 + - _RadialClipAngle: 90 + - _RadialClipArc1: 45 + - _RadialClipArc2: 0 + - _RadialStartAngle: 90 + - _RandomSeed: 0 + - _RectSize: 1 + - _RotateUvAmount: 0 + - _RoundWaveSpeed: 2 + - _RoundWaveStrength: 0.7 + - _ShadowAlpha: 0.5 + - _ShadowX: 0.1 + - _ShadowY: -0.05 + - _ShakeUvSpeed: 2.5 + - _ShakeUvX: 1.5 + - _ShakeUvY: 1 + - _ShineGlow: 1 + - _ShineLocation: 0.5 + - _ShineRotate: 0 + - _ShineWidth: 0.1 + - _TextureScrollXSpeed: 1 + - _TextureScrollYSpeed: 0 + - _TwistUvAmount: 1 + - _TwistUvPosX: 0.5 + - _TwistUvPosY: 0.5 + - _TwistUvRadius: 0.75 + - _WarpScale: 0.5 + - _WarpSpeed: 8 + - _WarpStrength: 0.025 + - _WaveAmount: 7 + - _WaveSpeed: 10 + - _WaveStrength: 7.5 + - _WaveX: 0 + - _WaveY: 0.5 + - _ZTestMode: 4 + - _ZWrite: 0 + - _ZoomUvAmount: 0.5 + m_Colors: + - ColorSwapRed: {r: 1, g: 1, b: 1, a: 1} + - _AlphaOutlineColor: {r: 1, g: 1, b: 1, a: 1} + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _ColorChangeNewCol: {r: 1, g: 1, b: 0, a: 1} + - _ColorChangeNewCol2: {r: 1, g: 1, b: 0, a: 1} + - _ColorChangeNewCol3: {r: 1, g: 1, b: 0, a: 1} + - _ColorChangeTarget: {r: 1, g: 0, b: 0, a: 1} + - _ColorChangeTarget2: {r: 1, g: 0, b: 0, a: 1} + - _ColorChangeTarget3: {r: 1, g: 0, b: 0, a: 1} + - _ColorSwapBlue: {r: 1, g: 1, b: 1, a: 1} + - _ColorSwapGreen: {r: 1, g: 1, b: 1, a: 1} + - _ColorSwapRed: {r: 1, g: 1, b: 1, a: 1} + - _FadeBurnColor: {r: 1, g: 1, b: 0, a: 1} + - _GlowColor: {r: 1, g: 1, b: 1, a: 1} + - _GradBotLeftCol: {r: 0, g: 0, b: 1, a: 1} + - _GradBotRightCol: {r: 0, g: 0, b: 1, a: 1} + - _GradTopLeftCol: {r: 1, g: 0, b: 0, a: 1} + - _GradTopRightCol: {r: 1, g: 0, b: 0, a: 1} + - _GreyscaleTintColor: {r: 1, g: 1, b: 1, a: 1} + - _HitEffectColor: {r: 1, g: 1, b: 1, a: 1} + - _HologramStripeColor: {r: 1, g: 1, b: 1, a: 1} + - _InnerOutlineColor: {r: 1, g: 0, b: 0, a: 1} + - _OutlineColor: {r: 1, g: 1, b: 1, a: 1} + - _OverlayColor: {r: 1, g: 1, b: 1, a: 1} + - _ShadowColor: {r: 0, g: 0, b: 0, a: 1} + - _ShineColor: {r: 1, g: 1, b: 1, a: 1} +--- !u!1 &152938703 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 152938704} + - component: {fileID: 152938706} + - component: {fileID: 152938705} + m_Layer: 0 + m_Name: Animated + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 0 +--- !u!4 &152938704 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 152938703} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: -3.57, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 1875180451} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!102 &152938705 +TextMesh: + serializedVersion: 3 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 152938703} + m_Text: (Has Animation) + m_OffsetZ: -1.5 + m_CharacterSize: 0.075 + m_LineSpacing: 1 + m_Anchor: 4 + m_Alignment: 0 + m_TabSize: 4 + m_FontSize: 100 + m_FontStyle: 0 + m_RichText: 1 + m_Font: {fileID: 12800000, guid: a4e6a5491519adb45919dc87eff28e55, type: 3} + m_Color: + serializedVersion: 2 + rgba: 4294967295 +--- !u!23 &152938706 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 152938703} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: a4e6a5491519adb45919dc87eff28e55, type: 3} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!1 &154474730 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 154474731} + - component: {fileID: 154474733} + - component: {fileID: 154474732} + m_Layer: 5 + m_Name: Controls + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &154474731 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 154474730} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 564363701} + m_RootOrder: 3 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0.5, y: 0} + m_AnchorMax: {x: 0.5, y: 0} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 1734.6, y: 127.8} + m_Pivot: {x: 0.5, y: 0} +--- !u!114 &154474732 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 154474730} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 5f7201a12d95ffc409449d95f23cf332, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_FontData: + m_Font: {fileID: 12800000, guid: a4e6a5491519adb45919dc87eff28e55, type: 3} + m_FontSize: 56 + m_FontStyle: 0 + m_BestFit: 1 + m_MinSize: 0 + m_MaxSize: 79 + m_Alignment: 4 + m_AlignByGeometry: 0 + m_RichText: 1 + m_HorizontalOverflow: 1 + m_VerticalOverflow: 1 + m_LineSpacing: 1 + m_Text: 'Controls: Use WASD or Arrow Keys to move around' +--- !u!222 &154474733 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 154474730} + m_CullTransparentMesh: 0 +--- !u!1 &156196756 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 156196757} + - component: {fileID: 156196759} + - component: {fileID: 156196758} + m_Layer: 0 + m_Name: Animated + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 0 +--- !u!4 &156196757 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 156196756} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: -3.57, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 361311995} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!102 &156196758 +TextMesh: + serializedVersion: 3 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 156196756} + m_Text: (Has Animation) + m_OffsetZ: -1.5 + m_CharacterSize: 0.075 + m_LineSpacing: 1 + m_Anchor: 4 + m_Alignment: 0 + m_TabSize: 4 + m_FontSize: 100 + m_FontStyle: 0 + m_RichText: 1 + m_Font: {fileID: 12800000, guid: a4e6a5491519adb45919dc87eff28e55, type: 3} + m_Color: + serializedVersion: 2 + rgba: 4294967295 +--- !u!23 &156196759 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 156196756} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: a4e6a5491519adb45919dc87eff28e55, type: 3} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!1 &164406718 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 164406719} + - component: {fileID: 164406721} + - component: {fileID: 164406720} + m_Layer: 0 + m_Name: Title + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &164406719 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 164406718} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: -2.51, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 1901854650} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!102 &164406720 +TextMesh: + serializedVersion: 3 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 164406718} + m_Text: Offset + m_OffsetZ: -1.5 + m_CharacterSize: 0.075 + m_LineSpacing: 1 + m_Anchor: 4 + m_Alignment: 0 + m_TabSize: 4 + m_FontSize: 100 + m_FontStyle: 0 + m_RichText: 1 + m_Font: {fileID: 12800000, guid: a4e6a5491519adb45919dc87eff28e55, type: 3} + m_Color: + serializedVersion: 2 + rgba: 4294967295 +--- !u!23 &164406721 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 164406718} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 10100, guid: 0000000000000000e000000000000000, type: 0} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!1 &166039412 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 166039413} + - component: {fileID: 166039415} + m_Layer: 0 + m_Name: Round Wave + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &166039413 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 166039412} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 40, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 1688633194} + - {fileID: 1100636068} + - {fileID: 924727831} + m_Father: {fileID: 1351315063} + m_RootOrder: 4 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &166039415 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 166039412} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 98b644315d7a92842b89e04f55c48e02, type: 3} + m_Name: + m_EditorClassIdentifier: +--- !u!1 &168046140 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 168046141} + - component: {fileID: 168046143} + - component: {fileID: 168046142} + m_Layer: 0 + m_Name: Title + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &168046141 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 168046140} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: -2.51, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 420059981} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!102 &168046142 +TextMesh: + serializedVersion: 3 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 168046140} + m_Text: Shadow + m_OffsetZ: -1.5 + m_CharacterSize: 0.075 + m_LineSpacing: 1 + m_Anchor: 4 + m_Alignment: 0 + m_TabSize: 4 + m_FontSize: 100 + m_FontStyle: 0 + m_RichText: 1 + m_Font: {fileID: 12800000, guid: a4e6a5491519adb45919dc87eff28e55, type: 3} + m_Color: + serializedVersion: 2 + rgba: 4294967295 +--- !u!23 &168046143 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 168046140} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 10100, guid: 0000000000000000e000000000000000, type: 0} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!21 &183278329 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: AllIn1SpriteShader/AllIn1SpriteShader + m_Shader: {fileID: 4800000, guid: a36b7719ff0465b42ab1407d67672c5f, type: 3} + m_ShaderKeywords: ETC1_EXTERNAL_ALPHA WIND_ON + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _ColorRampTex: + m_Texture: {fileID: 2800000, guid: 279657edc397ece4b8029c727adf6ddc, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ColorRampTexGradient: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ColorSwapTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DistortTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _FadeBurnTex: + m_Texture: {fileID: 2800000, guid: 32e8df0008bebe746b1681a71c61f31c, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _FadeTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 0.5, y: 0.5} + m_Offset: {x: 0, y: 0} + - _GlowTex: + 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} + - _OutlineDistortTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OutlineTex: + m_Texture: {fileID: 2800000, guid: 74087f6d03f233e4a8a142fa01f9e5cf, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OverlayTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ShineMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - _Alpha: 1 + - _AlphaCutoffValue: 0.25 + - _AlphaOutlineBlend: 1 + - _AlphaOutlineGlow: 5 + - _AlphaOutlineMinAlpha: 0 + - _AlphaOutlinePower: 1 + - _AlphaRoundThreshold: 0.5 + - _BillboardY: 0 + - _BlurHD: 0 + - _BlurIntensity: 10 + - _Brightness: 0 + - _ChromAberrAlpha: 0.4 + - _ChromAberrAmount: 1 + - _ClipUvDown: 1 + - _ClipUvLeft: 1 + - _ClipUvRight: 1 + - _ClipUvUp: 1 + - _ColorChangeLuminosity: 0 + - _ColorChangeTolerance: 0.25 + - _ColorChangeTolerance2: 0.25 + - _ColorChangeTolerance3: 0.25 + - _ColorRampBlend: 1 + - _ColorRampLuminosity: 0 + - _ColorRampOutline: 0 + - _ColorSwapBlend: 1 + - _ColorSwapBlueLuminosity: 0.5 + - _ColorSwapGreenLuminosity: 0.5 + - _ColorSwapRedLuminosity: 0.5 + - _Contrast: 1 + - _CullingOption: 0 + - _DistortAmount: 0.5 + - _DistortTexXSpeed: 5 + - _DistortTexYSpeed: 5 + - _EditorDrawers: 6 + - _FadeAmount: 0.437 + - _FadeBurnGlow: 6.6 + - _FadeBurnTransition: 0.075 + - _FadeBurnWidth: 0.025 + - _FishEyeUvAmount: 0.35 + - _FlickerAlpha: 0 + - _FlickerFreq: 0.2 + - _FlickerPercent: 0.05 + - _GhostBlend: 1 + - _GhostColorBoost: 1 + - _GhostTransparency: 0 + - _GlitchAmount: 3 + - _GlitchSize: 1 + - _Glow: 10 + - _GlowGlobal: 1 + - _GlowTexUsed: 0 + - _GradBlend: 1 + - _GradBoostX: 1.2 + - _GradBoostY: 1.2 + - _GradIsRadial: 0 + - _GrassManualAnim: 1 + - _GrassManualToggle: 0 + - _GrassRadialBend: 0.1 + - _GrassSpeed: 6.9 + - _GrassWind: 14.7 + - _GreyscaleBlend: 1 + - _GreyscaleLuminosity: 0 + - _GreyscaleOutline: 0 + - _HandDrawnAmount: 10 + - _HandDrawnSpeed: 5 + - _HitEffectBlend: 1 + - _HitEffectGlow: 5 + - _HologramBlend: 1 + - _HologramFlickerAlpha: 0 + - _HologramFlickerFreq: 0.2 + - _HologramFlickerPercent: 0.05 + - _HologramMaxAlpha: 1 + - _HologramMinAlpha: 0 + - _HologramStripesAlpha: 0.4 + - _HologramStripesAmount: 50 + - _HologramStripesFill: 0.4 + - _HologramStripesLuminosity: 1 + - _HologramStripesSpeed: 5 + - _HologramUnmodAmount: 0.4 + - _HsvBright: 1 + - _HsvSaturation: 1 + - _HsvShift: 180 + - _InnerOutlineAlpha: 1 + - _InnerOutlineGlow: 1 + - _InnerOutlineThickness: 1 + - _MaxXUV: 1 + - _MaxYUV: 1 + - _MinXUV: 0 + - _MinYUV: 0 + - _MotionBlurAngle: 0.1 + - _MotionBlurDist: 1.25 + - _MyDstMode: 10 + - _MySrcMode: 5 + - _NegativeAmount: 1 + - _OffsetUvX: 0 + - _OffsetUvY: 0 + - _OnlyInnerOutline: 0 + - _OnlyOutline: 0 + - _Outline8Directions: 0 + - _OutlineAlpha: 1 + - _OutlineDistortAmount: 0.5 + - _OutlineDistortTexXSpeed: 5 + - _OutlineDistortTexYSpeed: 5 + - _OutlineDistortToggle: 0 + - _OutlineGlow: 1.5 + - _OutlineIsPixel: 0 + - _OutlinePixelWidth: 1 + - _OutlineTexGrey: 0 + - _OutlineTexToggle: 0 + - _OutlineTexXSpeed: 10 + - _OutlineTexYSpeed: 0 + - _OutlineWidth: 0.004 + - _OverlayBlend: 1 + - _OverlayGlow: 1 + - _OverlayTextureScrollXSpeed: 0.25 + - _OverlayTextureScrollYSpeed: 0.25 + - _PinchUvAmount: 0.35 + - _PixelateSize: 32 + - _PosterizeGamma: 0.75 + - _PosterizeNumColors: 8 + - _PosterizeOutline: 0 + - _RadialClip: 45 + - _RadialClip2: 0 + - _RadialClipAngle: 90 + - _RadialClipArc1: 45 + - _RadialClipArc2: 0 + - _RadialStartAngle: 90 + - _RandomSeed: 0 + - _RectSize: 1 + - _RotateUvAmount: 0 + - _RoundWaveSpeed: 2 + - _RoundWaveStrength: 0.7 + - _ShadowAlpha: 0.5 + - _ShadowX: 0.1 + - _ShadowY: -0.05 + - _ShakeUvSpeed: 2.5 + - _ShakeUvX: 1.5 + - _ShakeUvY: 1 + - _ShineGlow: 1 + - _ShineLocation: 0.5 + - _ShineRotate: 0 + - _ShineWidth: 0.1 + - _TextureScrollXSpeed: 1 + - _TextureScrollYSpeed: 0 + - _TwistUvAmount: 1 + - _TwistUvPosX: 0.5 + - _TwistUvPosY: 0.5 + - _TwistUvRadius: 0.75 + - _WarpScale: 0.5 + - _WarpSpeed: 8 + - _WarpStrength: 0.025 + - _WaveAmount: 7 + - _WaveSpeed: 10 + - _WaveStrength: 7.5 + - _WaveX: 0 + - _WaveY: 0.5 + - _ZTestMode: 4 + - _ZWrite: 0 + - _ZoomUvAmount: 0.5 + m_Colors: + - ColorSwapRed: {r: 1, g: 1, b: 1, a: 1} + - _AlphaOutlineColor: {r: 1, g: 1, b: 1, a: 1} + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _ColorChangeNewCol: {r: 1, g: 1, b: 0, a: 1} + - _ColorChangeNewCol2: {r: 1, g: 1, b: 0, a: 1} + - _ColorChangeNewCol3: {r: 1, g: 1, b: 0, a: 1} + - _ColorChangeTarget: {r: 1, g: 0, b: 0, a: 1} + - _ColorChangeTarget2: {r: 1, g: 0, b: 0, a: 1} + - _ColorChangeTarget3: {r: 1, g: 0, b: 0, a: 1} + - _ColorSwapBlue: {r: 1, g: 1, b: 1, a: 1} + - _ColorSwapGreen: {r: 1, g: 1, b: 1, a: 1} + - _ColorSwapRed: {r: 1, g: 1, b: 1, a: 1} + - _FadeBurnColor: {r: 1, g: 1, b: 0, a: 1} + - _GlowColor: {r: 1, g: 1, b: 1, a: 1} + - _GradBotLeftCol: {r: 0, g: 0, b: 1, a: 1} + - _GradBotRightCol: {r: 0, g: 0, b: 1, a: 1} + - _GradTopLeftCol: {r: 1, g: 0, b: 0, a: 1} + - _GradTopRightCol: {r: 1, g: 0, b: 0, a: 1} + - _GreyscaleTintColor: {r: 1, g: 1, b: 1, a: 1} + - _HitEffectColor: {r: 1, g: 1, b: 1, a: 1} + - _HologramStripeColor: {r: 1, g: 1, b: 1, a: 1} + - _InnerOutlineColor: {r: 1, g: 0, b: 0, a: 1} + - _OutlineColor: {r: 1, g: 1, b: 1, a: 1} + - _OverlayColor: {r: 1, g: 1, b: 1, a: 1} + - _ShadowColor: {r: 0, g: 0, b: 0, a: 1} + - _ShineColor: {r: 1, g: 1, b: 1, a: 1} +--- !u!21 &195375977 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: AllIn1SpriteShader/AllIn1SpriteShader + m_Shader: {fileID: 4800000, guid: a36b7719ff0465b42ab1407d67672c5f, type: 3} + m_ShaderKeywords: ETC1_EXTERNAL_ALPHA FADE_ON OUTBASE8DIR_ON PINCH_ON _OUTLINE8DIRECTIONS_ON + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _ColorRampTex: + m_Texture: {fileID: 2800000, guid: 279657edc397ece4b8029c727adf6ddc, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ColorRampTexGradient: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ColorSwapTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DistortTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _FadeBurnTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _FadeTex: + m_Texture: {fileID: 2800000, guid: dbaa905cec0d2b944b5d1ebdbc3ceb1e, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _GlowTex: + 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} + - _OutlineDistortTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OutlineTex: + m_Texture: {fileID: 2800000, guid: 74087f6d03f233e4a8a142fa01f9e5cf, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OverlayTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ShineMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - _Alpha: 1 + - _AlphaCutoffValue: 0.25 + - _AlphaOutlineBlend: 1 + - _AlphaOutlineGlow: 5 + - _AlphaOutlineMinAlpha: 0 + - _AlphaOutlinePower: 1 + - _AlphaRoundThreshold: 0.5 + - _BillboardY: 0 + - _BlurHD: 0 + - _BlurIntensity: 10 + - _Brightness: 0 + - _ChromAberrAlpha: 0.4 + - _ChromAberrAmount: 1 + - _ClipUvDown: 1 + - _ClipUvLeft: 1 + - _ClipUvRight: 1 + - _ClipUvUp: 1 + - _ColorChangeLuminosity: 0 + - _ColorChangeTolerance: 0.25 + - _ColorChangeTolerance2: 0.25 + - _ColorChangeTolerance3: 0.25 + - _ColorRampBlend: 1 + - _ColorRampLuminosity: 0 + - _ColorRampOutline: 0 + - _ColorSwapBlend: 1 + - _ColorSwapBlueLuminosity: 0.5 + - _ColorSwapGreenLuminosity: 0.5 + - _ColorSwapRedLuminosity: 0.5 + - _Contrast: 1 + - _CullingOption: 0 + - _DistortAmount: 0.5 + - _DistortTexXSpeed: 5 + - _DistortTexYSpeed: 5 + - _EditorDrawers: 6 + - _FadeAmount: 0.391 + - _FadeBurnGlow: 1.9 + - _FadeBurnTransition: 0.274 + - _FadeBurnWidth: 0.07 + - _FishEyeUvAmount: 0.35 + - _FlickerAlpha: 0 + - _FlickerFreq: 0.2 + - _FlickerPercent: 0.05 + - _GhostBlend: 1 + - _GhostColorBoost: 1 + - _GhostTransparency: 0 + - _GlitchAmount: 3 + - _GlitchSize: 1 + - _Glow: 10 + - _GlowGlobal: 1 + - _GlowTexUsed: 0 + - _GradBlend: 1 + - _GradBoostX: 1.2 + - _GradBoostY: 1.2 + - _GradIsRadial: 0 + - _GrassManualAnim: 1 + - _GrassManualToggle: 0 + - _GrassRadialBend: 0.25 + - _GrassSpeed: 2 + - _GrassWind: 20 + - _GreyscaleBlend: 1 + - _GreyscaleLuminosity: 0 + - _GreyscaleOutline: 0 + - _HandDrawnAmount: 10 + - _HandDrawnSpeed: 5 + - _HitEffectBlend: 1 + - _HitEffectGlow: 5 + - _HologramBlend: 1 + - _HologramFlickerAlpha: 0 + - _HologramFlickerFreq: 0.2 + - _HologramFlickerPercent: 0.05 + - _HologramMaxAlpha: 1 + - _HologramMinAlpha: 0 + - _HologramStripesAlpha: 0.4 + - _HologramStripesAmount: 50 + - _HologramStripesFill: 0.4 + - _HologramStripesLuminosity: 1 + - _HologramStripesSpeed: 5 + - _HologramUnmodAmount: 0.4 + - _HsvBright: 1 + - _HsvSaturation: 1 + - _HsvShift: 180 + - _InnerOutlineAlpha: 1 + - _InnerOutlineGlow: 1 + - _InnerOutlineThickness: 1 + - _MaxXUV: 1 + - _MaxYUV: 1 + - _MinXUV: 0 + - _MinYUV: 0 + - _MotionBlurAngle: 0.1 + - _MotionBlurDist: 1.25 + - _MyDstMode: 10 + - _MySrcMode: 5 + - _NegativeAmount: 1 + - _OffsetUvX: 0 + - _OffsetUvY: 0 + - _OnlyInnerOutline: 0 + - _OnlyOutline: 0 + - _Outline8Directions: 1 + - _OutlineAlpha: 1 + - _OutlineDistortAmount: 0.5 + - _OutlineDistortTexXSpeed: 5 + - _OutlineDistortTexYSpeed: 5 + - _OutlineDistortToggle: 0 + - _OutlineGlow: 1 + - _OutlineIsPixel: 0 + - _OutlinePixelWidth: 1 + - _OutlineTexGrey: 0 + - _OutlineTexToggle: 0 + - _OutlineTexXSpeed: 10 + - _OutlineTexYSpeed: 0 + - _OutlineWidth: 0.0141 + - _OverlayBlend: 1 + - _OverlayGlow: 1 + - _OverlayTextureScrollXSpeed: 0.25 + - _OverlayTextureScrollYSpeed: 0.25 + - _PinchUvAmount: 0 + - _PixelateSize: 32 + - _PosterizeGamma: 0.75 + - _PosterizeNumColors: 8 + - _PosterizeOutline: 0 + - _RadialClip: 0 + - _RadialClip2: 45 + - _RadialClipAngle: 90 + - _RadialClipArc1: 45 + - _RadialClipArc2: 0 + - _RadialStartAngle: 90 + - _RandomSeed: 0 + - _RectSize: 1 + - _RotateUvAmount: 0 + - _RoundWaveSpeed: 2 + - _RoundWaveStrength: 0.7 + - _ShadowAlpha: 0.5 + - _ShadowX: 0.1 + - _ShadowY: -0.05 + - _ShakeUvSpeed: 2.5 + - _ShakeUvX: 1.5 + - _ShakeUvY: 1 + - _ShineGlow: 1 + - _ShineLocation: 0.5 + - _ShineRotate: 0 + - _ShineWidth: 0.1 + - _TextureScrollXSpeed: 1 + - _TextureScrollYSpeed: 0 + - _TwistUvAmount: 1 + - _TwistUvPosX: 0.5 + - _TwistUvPosY: 0.5 + - _TwistUvRadius: 0.75 + - _WarpScale: 0.5 + - _WarpSpeed: 8 + - _WarpStrength: 0.025 + - _WaveAmount: 7 + - _WaveSpeed: 10 + - _WaveStrength: 7.5 + - _WaveX: 0 + - _WaveY: 0.5 + - _ZTestMode: 4 + - _ZWrite: 0 + - _ZoomUvAmount: 0.5 + m_Colors: + - ColorSwapRed: {r: 1, g: 1, b: 1, a: 1} + - _AlphaOutlineColor: {r: 1, g: 1, b: 1, a: 1} + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _ColorChangeNewCol: {r: 1, g: 1, b: 0, a: 1} + - _ColorChangeNewCol2: {r: 1, g: 1, b: 0, a: 1} + - _ColorChangeNewCol3: {r: 1, g: 1, b: 0, a: 1} + - _ColorChangeTarget: {r: 1, g: 0, b: 0, a: 1} + - _ColorChangeTarget2: {r: 1, g: 0, b: 0, a: 1} + - _ColorChangeTarget3: {r: 1, g: 0, b: 0, a: 1} + - _ColorSwapBlue: {r: 1, g: 1, b: 1, a: 1} + - _ColorSwapGreen: {r: 1, g: 1, b: 1, a: 1} + - _ColorSwapRed: {r: 1, g: 1, b: 1, a: 1} + - _FadeBurnColor: {r: 0, g: 0.9400835, b: 1, a: 1} + - _GlowColor: {r: 1, g: 1, b: 1, a: 1} + - _GradBotLeftCol: {r: 0, g: 0, b: 1, a: 1} + - _GradBotRightCol: {r: 0, g: 0, b: 1, a: 1} + - _GradTopLeftCol: {r: 1, g: 0, b: 0, a: 1} + - _GradTopRightCol: {r: 1, g: 0, b: 0, a: 1} + - _GreyscaleTintColor: {r: 1, g: 1, b: 1, a: 1} + - _HitEffectColor: {r: 1, g: 1, b: 1, a: 1} + - _HologramStripeColor: {r: 1, g: 1, b: 1, a: 1} + - _InnerOutlineColor: {r: 1, g: 0, b: 0, a: 1} + - _OutlineColor: {r: 0, g: 0.94117653, b: 1, a: 1} + - _OverlayColor: {r: 1, g: 1, b: 1, a: 1} + - _ShadowColor: {r: 0, g: 0, b: 0, a: 1} + - _ShineColor: {r: 1, g: 1, b: 1, a: 1} +--- !u!21 &208665463 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: AllIn1SpriteShader/AllIn1SpriteShader + m_Shader: {fileID: 4800000, guid: a36b7719ff0465b42ab1407d67672c5f, type: 3} + m_ShaderKeywords: ETC1_EXTERNAL_ALPHA WAVEUV_ON + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _ColorRampTex: + m_Texture: {fileID: 2800000, guid: 279657edc397ece4b8029c727adf6ddc, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ColorRampTexGradient: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ColorSwapTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DistortTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _FadeBurnTex: + m_Texture: {fileID: 2800000, guid: 32e8df0008bebe746b1681a71c61f31c, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _FadeTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _GlowTex: + 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} + - _OutlineDistortTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OutlineTex: + m_Texture: {fileID: 2800000, guid: 74087f6d03f233e4a8a142fa01f9e5cf, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OverlayTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ShineMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - _Alpha: 1 + - _AlphaCutoffValue: 0.25 + - _AlphaOutlineBlend: 1 + - _AlphaOutlineGlow: 5 + - _AlphaOutlineMinAlpha: 0 + - _AlphaOutlinePower: 1 + - _AlphaRoundThreshold: 0.5 + - _BillboardY: 0 + - _BlurHD: 0 + - _BlurIntensity: 10 + - _Brightness: 0 + - _ChromAberrAlpha: 0.4 + - _ChromAberrAmount: 1 + - _ClipUvDown: 1 + - _ClipUvLeft: 1 + - _ClipUvRight: 1 + - _ClipUvUp: 1 + - _ColorChangeLuminosity: 0 + - _ColorChangeTolerance: 0.25 + - _ColorChangeTolerance2: 0.25 + - _ColorChangeTolerance3: 0.25 + - _ColorRampBlend: 1 + - _ColorRampLuminosity: 0 + - _ColorRampOutline: 0 + - _ColorSwapBlend: 1 + - _ColorSwapBlueLuminosity: 0.5 + - _ColorSwapGreenLuminosity: 0.5 + - _ColorSwapRedLuminosity: 0.5 + - _Contrast: 1 + - _CullingOption: 0 + - _DistortAmount: 0.5 + - _DistortTexXSpeed: 5 + - _DistortTexYSpeed: 5 + - _EditorDrawers: 6 + - _FadeAmount: -0.1 + - _FadeBurnGlow: 2 + - _FadeBurnTransition: 0.075 + - _FadeBurnWidth: 0.025 + - _FishEyeUvAmount: 0.35 + - _FlickerAlpha: 0 + - _FlickerFreq: 0.2 + - _FlickerPercent: 0.05 + - _GhostBlend: 1 + - _GhostColorBoost: 1 + - _GhostTransparency: 0 + - _GlitchAmount: 3 + - _GlitchSize: 1 + - _Glow: 10 + - _GlowGlobal: 1 + - _GlowTexUsed: 0 + - _GradBlend: 1 + - _GradBoostX: 1.2 + - _GradBoostY: 1.2 + - _GradIsRadial: 0 + - _GrassManualAnim: 1 + - _GrassManualToggle: 0 + - _GrassRadialBend: 0.25 + - _GrassSpeed: 2 + - _GrassWind: 20 + - _GreyscaleBlend: 1 + - _GreyscaleLuminosity: 0 + - _GreyscaleOutline: 0 + - _HandDrawnAmount: 10 + - _HandDrawnSpeed: 5 + - _HitEffectBlend: 1 + - _HitEffectGlow: 5 + - _HologramBlend: 1 + - _HologramFlickerAlpha: 0 + - _HologramFlickerFreq: 0.2 + - _HologramFlickerPercent: 0.05 + - _HologramMaxAlpha: 1 + - _HologramMinAlpha: 0 + - _HologramStripesAlpha: 0.4 + - _HologramStripesAmount: 50 + - _HologramStripesFill: 0.4 + - _HologramStripesLuminosity: 1 + - _HologramStripesSpeed: 5 + - _HologramUnmodAmount: 0.4 + - _HsvBright: 1 + - _HsvSaturation: 1 + - _HsvShift: 180 + - _InnerOutlineAlpha: 1 + - _InnerOutlineGlow: 1 + - _InnerOutlineThickness: 1 + - _MaxXUV: 1 + - _MaxYUV: 1 + - _MinXUV: 0 + - _MinYUV: 0 + - _MotionBlurAngle: 0.1 + - _MotionBlurDist: 1.25 + - _MyDstMode: 10 + - _MySrcMode: 5 + - _NegativeAmount: 1 + - _OffsetUvX: 0 + - _OffsetUvY: 0 + - _OnlyInnerOutline: 0 + - _OnlyOutline: 0 + - _Outline8Directions: 0 + - _OutlineAlpha: 1 + - _OutlineDistortAmount: 0.5 + - _OutlineDistortTexXSpeed: 5 + - _OutlineDistortTexYSpeed: 5 + - _OutlineDistortToggle: 0 + - _OutlineGlow: 1.5 + - _OutlineIsPixel: 0 + - _OutlinePixelWidth: 1 + - _OutlineTexGrey: 0 + - _OutlineTexToggle: 0 + - _OutlineTexXSpeed: 10 + - _OutlineTexYSpeed: 0 + - _OutlineWidth: 0.004 + - _OverlayBlend: 1 + - _OverlayGlow: 1 + - _OverlayTextureScrollXSpeed: 0.25 + - _OverlayTextureScrollYSpeed: 0.25 + - _PinchUvAmount: 0.35 + - _PixelateSize: 32 + - _PosterizeGamma: 0.75 + - _PosterizeNumColors: 8 + - _PosterizeOutline: 0 + - _RadialClip: 45 + - _RadialClip2: 0 + - _RadialClipAngle: 90 + - _RadialClipArc1: 45 + - _RadialClipArc2: 0 + - _RadialStartAngle: 90 + - _RandomSeed: 0 + - _RectSize: 1 + - _RotateUvAmount: 0 + - _RoundWaveSpeed: 2 + - _RoundWaveStrength: 0.7 + - _ShadowAlpha: 0.5 + - _ShadowX: 0.1 + - _ShadowY: -0.05 + - _ShakeUvSpeed: 2.5 + - _ShakeUvX: 1.5 + - _ShakeUvY: 1 + - _ShineGlow: 1 + - _ShineLocation: 0.5 + - _ShineRotate: 0 + - _ShineWidth: 0.1 + - _TextureScrollXSpeed: 1 + - _TextureScrollYSpeed: 0 + - _TwistUvAmount: 1 + - _TwistUvPosX: 0.5 + - _TwistUvPosY: 0.5 + - _TwistUvRadius: 0.75 + - _WarpScale: 0.5 + - _WarpSpeed: 8 + - _WarpStrength: 0.025 + - _WaveAmount: 7 + - _WaveSpeed: 11.71 + - _WaveStrength: 11.52 + - _WaveX: 0 + - _WaveY: 0.5 + - _ZTestMode: 4 + - _ZWrite: 0 + - _ZoomUvAmount: 0.5 + m_Colors: + - ColorSwapRed: {r: 1, g: 1, b: 1, a: 1} + - _AlphaOutlineColor: {r: 1, g: 1, b: 1, a: 1} + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _ColorChangeNewCol: {r: 1, g: 1, b: 0, a: 1} + - _ColorChangeNewCol2: {r: 1, g: 1, b: 0, a: 1} + - _ColorChangeNewCol3: {r: 1, g: 1, b: 0, a: 1} + - _ColorChangeTarget: {r: 1, g: 0, b: 0, a: 1} + - _ColorChangeTarget2: {r: 1, g: 0, b: 0, a: 1} + - _ColorChangeTarget3: {r: 1, g: 0, b: 0, a: 1} + - _ColorSwapBlue: {r: 1, g: 1, b: 1, a: 1} + - _ColorSwapGreen: {r: 1, g: 1, b: 1, a: 1} + - _ColorSwapRed: {r: 1, g: 1, b: 1, a: 1} + - _FadeBurnColor: {r: 1, g: 1, b: 0, a: 1} + - _GlowColor: {r: 1, g: 1, b: 1, a: 1} + - _GradBotLeftCol: {r: 0, g: 0, b: 1, a: 1} + - _GradBotRightCol: {r: 0, g: 0, b: 1, a: 1} + - _GradTopLeftCol: {r: 1, g: 0, b: 0, a: 1} + - _GradTopRightCol: {r: 1, g: 0, b: 0, a: 1} + - _GreyscaleTintColor: {r: 1, g: 1, b: 1, a: 1} + - _HitEffectColor: {r: 1, g: 1, b: 1, a: 1} + - _HologramStripeColor: {r: 1, g: 1, b: 1, a: 1} + - _InnerOutlineColor: {r: 1, g: 0, b: 0, a: 1} + - _OutlineColor: {r: 1, g: 1, b: 1, a: 1} + - _OverlayColor: {r: 1, g: 1, b: 1, a: 1} + - _ShadowColor: {r: 0, g: 0, b: 0, a: 1} + - _ShineColor: {r: 1, g: 1, b: 1, a: 1} +--- !u!21 &212554433 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: AllIn1SpriteShader/AllIn1SpriteShader + m_Shader: {fileID: 4800000, guid: a36b7719ff0465b42ab1407d67672c5f, type: 3} + m_ShaderKeywords: CLIPPING_ON ETC1_EXTERNAL_ALPHA WAVEUV_ON WIND_ON + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _ColorRampTex: + m_Texture: {fileID: 2800000, guid: 279657edc397ece4b8029c727adf6ddc, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ColorRampTexGradient: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ColorSwapTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DistortTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _FadeBurnTex: + m_Texture: {fileID: 2800000, guid: 677cca399782dea41aedc1d292ecb67d, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _FadeTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _GlowTex: + 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} + - _OutlineDistortTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OutlineTex: + m_Texture: {fileID: 2800000, guid: 74087f6d03f233e4a8a142fa01f9e5cf, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OverlayTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ShineMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - _Alpha: 1 + - _AlphaCutoffValue: 0.25 + - _AlphaOutlineBlend: 1 + - _AlphaOutlineGlow: 5 + - _AlphaOutlineMinAlpha: 0 + - _AlphaOutlinePower: 1 + - _AlphaRoundThreshold: 0.5 + - _BillboardY: 0 + - _BlurHD: 0 + - _BlurIntensity: 10 + - _Brightness: 0 + - _ChromAberrAlpha: 0.4 + - _ChromAberrAmount: 1 + - _ClipUvDown: 0 + - _ClipUvLeft: 0 + - _ClipUvRight: 0 + - _ClipUvUp: 0.1 + - _ColorChangeLuminosity: 0 + - _ColorChangeTolerance: 0.25 + - _ColorChangeTolerance2: 0.25 + - _ColorChangeTolerance3: 0.25 + - _ColorRampBlend: 1 + - _ColorRampLuminosity: 0 + - _ColorRampOutline: 0 + - _ColorSwapBlend: 1 + - _ColorSwapBlueLuminosity: 0.5 + - _ColorSwapGreenLuminosity: 0.5 + - _ColorSwapRedLuminosity: 0.5 + - _Contrast: 1 + - _CullingOption: 0 + - _DistortAmount: 0.5 + - _DistortTexXSpeed: 5 + - _DistortTexYSpeed: 5 + - _EditorDrawers: 6 + - _FadeAmount: -0.1 + - _FadeBurnGlow: 2 + - _FadeBurnTransition: 0.075 + - _FadeBurnWidth: 0.025 + - _FishEyeUvAmount: 0.35 + - _FlickerAlpha: 0 + - _FlickerFreq: 0.2 + - _FlickerPercent: 0.05 + - _GhostBlend: 1 + - _GhostColorBoost: 1 + - _GhostTransparency: 0 + - _GlitchAmount: 3 + - _GlitchSize: 1 + - _Glow: 10 + - _GlowGlobal: 1 + - _GlowTexUsed: 0 + - _GradBlend: 1 + - _GradBoostX: 1.2 + - _GradBoostY: 1.2 + - _GradIsRadial: 0 + - _GrassManualAnim: 1 + - _GrassManualToggle: 0 + - _GrassRadialBend: 0.1 + - _GrassSpeed: 1.5 + - _GrassWind: 1.9 + - _GreyscaleBlend: 1 + - _GreyscaleLuminosity: 0 + - _GreyscaleOutline: 0 + - _HandDrawnAmount: 10 + - _HandDrawnSpeed: 5 + - _HitEffectBlend: 1 + - _HitEffectGlow: 5 + - _HologramBlend: 1 + - _HologramMaxAlpha: 1 + - _HologramMinAlpha: 0 + - _HologramStripesAlpha: 0.4 + - _HologramStripesAmount: 50 + - _HologramStripesFill: 0.4 + - _HologramStripesLuminosity: 1 + - _HologramStripesSpeed: 5 + - _HologramUnmodAmount: 0.4 + - _HsvBright: 1 + - _HsvSaturation: 1 + - _HsvShift: 180 + - _InnerOutlineAlpha: 1 + - _InnerOutlineGlow: 1 + - _InnerOutlineThickness: 1 + - _MaxXUV: 1 + - _MaxYUV: 1 + - _MinXUV: 0 + - _MinYUV: 0 + - _MotionBlurAngle: 0.1 + - _MotionBlurDist: 1.25 + - _MyDstMode: 10 + - _MySrcMode: 5 + - _NegativeAmount: 1 + - _OffsetUvX: 0 + - _OffsetUvY: 0 + - _OnlyInnerOutline: 0 + - _OnlyOutline: 0 + - _Outline8Directions: 0 + - _OutlineAlpha: 1 + - _OutlineDistortAmount: 0.5 + - _OutlineDistortTexXSpeed: 5 + - _OutlineDistortTexYSpeed: 5 + - _OutlineDistortToggle: 0 + - _OutlineGlow: 1.5 + - _OutlineIsPixel: 0 + - _OutlinePixelWidth: 1 + - _OutlineTexGrey: 0 + - _OutlineTexToggle: 0 + - _OutlineTexXSpeed: 10 + - _OutlineTexYSpeed: 0 + - _OutlineWidth: 0.004 + - _OverlayBlend: 1 + - _OverlayGlow: 1 + - _OverlayTextureScrollXSpeed: 0.25 + - _OverlayTextureScrollYSpeed: 0.25 + - _PinchUvAmount: 0.35 + - _PixelateSize: 32 + - _PosterizeGamma: 0.75 + - _PosterizeNumColors: 8 + - _PosterizeOutline: 0 + - _RadialClipAngle: 90 + - _RadialClipArc1: 45 + - _RadialClipArc2: 0 + - _RandomSeed: 0 + - _RectSize: 1 + - _RotateUvAmount: 0 + - _RoundWaveSpeed: 2 + - _RoundWaveStrength: 0.7 + - _ShadowAlpha: 0.5 + - _ShadowX: 0.1 + - _ShadowY: -0.05 + - _ShakeUvSpeed: 2.5 + - _ShakeUvX: 1.5 + - _ShakeUvY: 1 + - _ShineGlow: 1 + - _ShineLocation: 0.5 + - _ShineRotate: 0 + - _ShineWidth: 0.1 + - _TextureScrollXSpeed: 1 + - _TextureScrollYSpeed: 0 + - _TwistUvAmount: 1 + - _TwistUvPosX: 0.5 + - _TwistUvPosY: 0.5 + - _TwistUvRadius: 0.75 + - _WarpScale: 0.5 + - _WarpSpeed: 8 + - _WarpStrength: 0.025 + - _WaveAmount: 1.5 + - _WaveSpeed: 6.7 + - _WaveStrength: 7.5 + - _WaveX: 0 + - _WaveY: 0.5 + - _ZTestMode: 4 + - _ZWrite: 0 + - _ZoomUvAmount: 0.5 + m_Colors: + - ColorSwapRed: {r: 1, g: 1, b: 1, a: 1} + - _AlphaOutlineColor: {r: 1, g: 1, b: 1, a: 1} + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _ColorChangeNewCol: {r: 1, g: 1, b: 0, a: 1} + - _ColorChangeNewCol2: {r: 1, g: 1, b: 0, a: 1} + - _ColorChangeNewCol3: {r: 1, g: 1, b: 0, a: 1} + - _ColorChangeTarget: {r: 1, g: 0, b: 0, a: 1} + - _ColorChangeTarget2: {r: 1, g: 0, b: 0, a: 1} + - _ColorChangeTarget3: {r: 1, g: 0, b: 0, a: 1} + - _ColorSwapBlue: {r: 1, g: 1, b: 1, a: 1} + - _ColorSwapGreen: {r: 1, g: 1, b: 1, a: 1} + - _ColorSwapRed: {r: 1, g: 1, b: 1, a: 1} + - _FadeBurnColor: {r: 1, g: 1, b: 0, a: 1} + - _GlowColor: {r: 1, g: 1, b: 1, a: 1} + - _GradBotLeftCol: {r: 0, g: 0, b: 1, a: 1} + - _GradBotRightCol: {r: 0, g: 0, b: 1, a: 1} + - _GradTopLeftCol: {r: 1, g: 0, b: 0, a: 1} + - _GradTopRightCol: {r: 1, g: 0, b: 0, a: 1} + - _GreyscaleTintColor: {r: 1, g: 1, b: 1, a: 1} + - _HitEffectColor: {r: 1, g: 1, b: 1, a: 1} + - _HologramStripeColor: {r: 1, g: 1, b: 1, a: 1} + - _InnerOutlineColor: {r: 1, g: 0, b: 0, a: 1} + - _OutlineColor: {r: 1, g: 1, b: 1, a: 1} + - _OverlayColor: {r: 1, g: 1, b: 1, a: 1} + - _ShadowColor: {r: 0, g: 0, b: 0, a: 1} + - _ShineColor: {r: 1, g: 1, b: 1, a: 1} +--- !u!21 &217718272 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: AllIn1SpriteShader/AllIn1SpriteShader + m_Shader: {fileID: 4800000, guid: a36b7719ff0465b42ab1407d67672c5f, type: 3} + m_ShaderKeywords: CHANGECOLOR2_ON CHANGECOLOR3_ON COLORSWAP_ON ETC1_EXTERNAL_ALPHA + GLOWTEX_ON GRADIENT2COL_ON GRADIENT_ON OUTBASE8DIR_ON _GLOWTEXUSED_ON _OUTLINE8DIRECTIONS_ON + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _ColorRampTex: + m_Texture: {fileID: 2800000, guid: 279657edc397ece4b8029c727adf6ddc, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ColorRampTexGradient: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ColorSwapTex: + m_Texture: {fileID: 2800000, guid: 065da6c7b90ca904dab9cbc6b415fd19, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DistortTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _FadeBurnTex: + m_Texture: {fileID: 2800000, guid: 677cca399782dea41aedc1d292ecb67d, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _FadeTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _GlowTex: + m_Texture: {fileID: 2800000, guid: 4abae6e7a5c534a4c8e95edf12a7d0c9, type: 3} + 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} + - _OutlineDistortTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OutlineTex: + m_Texture: {fileID: 2800000, guid: 74087f6d03f233e4a8a142fa01f9e5cf, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OverlayTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ShineMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - _Alpha: 1 + - _AlphaCutoffValue: 0.25 + - _AlphaOutlineBlend: 1 + - _AlphaOutlineGlow: 5 + - _AlphaOutlineMinAlpha: 0 + - _AlphaOutlinePower: 1 + - _AlphaRoundThreshold: 0.5 + - _BillboardY: 0 + - _BlurHD: 0 + - _BlurIntensity: 10 + - _Brightness: 0 + - _ChromAberrAlpha: 0.4 + - _ChromAberrAmount: 1 + - _ClipUvDown: 0 + - _ClipUvLeft: 0 + - _ClipUvRight: 0 + - _ClipUvUp: 0 + - _ColorChangeLuminosity: 0 + - _ColorChangeTolerance: 0.25 + - _ColorChangeTolerance2: 0.25 + - _ColorChangeTolerance3: 0.25 + - _ColorRampBlend: 1 + - _ColorRampLuminosity: 0 + - _ColorRampOutline: 0 + - _ColorSwapBlend: 1 + - _ColorSwapBlueLuminosity: 0.5 + - _ColorSwapGreenLuminosity: 0.28 + - _ColorSwapRedLuminosity: 0.481 + - _Contrast: 3.29 + - _CullingOption: 0 + - _DistortAmount: 0.5 + - _DistortTexXSpeed: 5 + - _DistortTexYSpeed: 5 + - _EditorDrawers: 6 + - _FadeAmount: -0.1 + - _FadeBurnGlow: 2 + - _FadeBurnTransition: 0.075 + - _FadeBurnWidth: 0.025 + - _FishEyeUvAmount: 0.35 + - _FlickerAlpha: 0 + - _FlickerFreq: 0.2 + - _FlickerPercent: 0.05 + - _GhostBlend: 1 + - _GhostColorBoost: 1 + - _GhostTransparency: 0 + - _GlitchAmount: 3 + - _GlitchSize: 1 + - _Glow: 0 + - _GlowGlobal: 1 + - _GlowTexUsed: 1 + - _GradBlend: 1 + - _GradBoostX: 1.2 + - _GradBoostY: 1.2 + - _GradIsRadial: 0 + - _GrassManualAnim: 1 + - _GrassManualToggle: 0 + - _GrassRadialBend: 0.4 + - _GrassSpeed: 2 + - _GrassWind: 20 + - _GreyscaleBlend: 1 + - _GreyscaleLuminosity: 0 + - _GreyscaleOutline: 0 + - _HandDrawnAmount: 10 + - _HandDrawnSpeed: 5 + - _HitEffectBlend: 1 + - _HitEffectGlow: 5 + - _HologramBlend: 1 + - _HologramMaxAlpha: 0.75 + - _HologramMinAlpha: 0.1 + - _HologramStripesAmount: 0.1 + - _HologramStripesSpeed: 4.5 + - _HologramUnmodAmount: 0 + - _HsvBright: 1 + - _HsvSaturation: 1 + - _HsvShift: 180 + - _InnerOutlineAlpha: 1 + - _InnerOutlineGlow: 6 + - _InnerOutlineThickness: 1.31 + - _MaxXUV: 0.97509766 + - _MaxYUV: 0.9902344 + - _MinXUV: 0.68408203 + - _MinYUV: 0.6455078 + - _MotionBlurAngle: 0.1 + - _MotionBlurDist: 1.25 + - _MyDstMode: 10 + - _MySrcMode: 5 + - _NegativeAmount: 1 + - _OffsetUvX: 0 + - _OffsetUvY: 0 + - _OnlyInnerOutline: 0 + - _OnlyOutline: 0 + - _Outline8Directions: 1 + - _OutlineAlpha: 1 + - _OutlineDistortAmount: 0.5 + - _OutlineDistortTexXSpeed: 5 + - _OutlineDistortTexYSpeed: 5 + - _OutlineDistortToggle: 0 + - _OutlineGlow: 5.1 + - _OutlineIsPixel: 0 + - _OutlinePixelWidth: 1 + - _OutlineTexGrey: 0 + - _OutlineTexToggle: 0 + - _OutlineTexXSpeed: 10 + - _OutlineTexYSpeed: 0 + - _OutlineWidth: 0.0321 + - _OverlayBlend: 1 + - _OverlayGlow: 1 + - _OverlayTextureScrollXSpeed: 0.25 + - _OverlayTextureScrollYSpeed: 0.25 + - _PinchUvAmount: 0.059 + - _PixelateSize: 32 + - _PosterizeGamma: 0.75 + - _PosterizeNumColors: 8 + - _PosterizeOutline: 0 + - _RadialClip: 45 + - _RadialClip2: 0 + - _RadialClipAngle: 90 + - _RadialClipArc1: 45 + - _RadialClipArc2: 0 + - _RadialStartAngle: 90 + - _RandomSeed: 0 + - _RectSize: 1 + - _RotateUvAmount: 0 + - _RoundWaveSpeed: 0.1 + - _RoundWaveStrength: 0.014 + - _ShadowAlpha: 0.5 + - _ShadowX: 0.1 + - _ShadowY: -0.05 + - _ShakeUvSpeed: 2.5 + - _ShakeUvX: 1.5 + - _ShakeUvY: 1 + - _ShineGlow: 1 + - _ShineLocation: 0.5 + - _ShineRotate: 0 + - _ShineWidth: 0.1 + - _TextureScrollXSpeed: 1 + - _TextureScrollYSpeed: 0 + - _TwistUvAmount: 0.1 + - _TwistUvPosX: 0.5 + - _TwistUvPosY: 0.5 + - _TwistUvRadius: 0.75 + - _WarpScale: 0.5 + - _WarpSpeed: 8 + - _WarpStrength: 0.025 + - _WaveAmount: 7.4 + - _WaveSpeed: 11.1 + - _WaveStrength: 16.4 + - _WaveX: 0.496 + - _WaveY: 0.5 + - _ZTestMode: 4 + - _ZWrite: 0 + - _ZoomUvAmount: 0.5 + m_Colors: + - _AlphaOutlineColor: {r: 1, g: 1, b: 1, a: 1} + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _ColorChangeNewCol: {r: 1, g: 1, b: 0, a: 1} + - _ColorChangeNewCol2: {r: 1, g: 1, b: 0, a: 1} + - _ColorChangeNewCol3: {r: 1, g: 1, b: 0, a: 1} + - _ColorChangeTarget: {r: 1, g: 0, b: 0, a: 1} + - _ColorChangeTarget2: {r: 1, g: 0, b: 0, a: 1} + - _ColorChangeTarget3: {r: 1, g: 0, b: 0, a: 1} + - _ColorSwapBlue: {r: 0.9716981, g: 0.1283375, b: 0.46596614, a: 1} + - _ColorSwapGreen: {r: 3.0196679, g: 1.6945816, b: 0, a: 1} + - _ColorSwapRed: {r: 0.24279101, g: 0.56585985, b: 0.8301887, a: 1} + - _FadeBurnColor: {r: 1, g: 1, b: 0, a: 1} + - _GlowColor: {r: 0.98823535, g: 0.6392157, b: 0.6117647, a: 1} + - _GradBotLeftCol: {r: 0.16037738, g: 0.16037738, b: 0.16037738, a: 1} + - _GradBotRightCol: {r: 0, g: 0, b: 1, a: 1} + - _GradTopLeftCol: {r: 0.103773594, g: 0.103773594, b: 0.103773594, a: 1} + - _GradTopRightCol: {r: 1, g: 0, b: 0, a: 1} + - _GreyscaleTintColor: {r: 1, g: 1, b: 1, a: 1} + - _HitEffectColor: {r: 1, g: 1, b: 1, a: 1} + - _HologramStripeColor: {r: 0, g: 1, b: 1, a: 1} + - _InnerOutlineColor: {r: 0.9811321, g: 0.29619083, b: 0.7939467, a: 1} + - _OutlineColor: {r: 0.5896226, g: 0.1792453, b: 1, a: 1} + - _OverlayColor: {r: 1, g: 1, b: 1, a: 1} + - _ShadowColor: {r: 0, g: 0, b: 0, a: 1} + - _ShineColor: {r: 1, g: 1, b: 1, a: 1} +--- !u!1 &242385328 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 242385329} + - component: {fileID: 242385332} + m_Layer: 0 + m_Name: Water + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &242385329 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 242385328} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 160, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 928177173} + - {fileID: 942262413} + - {fileID: 1673476643} + - {fileID: 1949787730} + m_Father: {fileID: 1563905016} + m_RootOrder: 16 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &242385332 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 242385328} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 98b644315d7a92842b89e04f55c48e02, type: 3} + m_Name: + m_EditorClassIdentifier: +--- !u!1 &242658909 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 242658910} + - component: {fileID: 242658912} + - component: {fileID: 242658911} + m_Layer: 0 + m_Name: Animated + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 0 +--- !u!4 &242658910 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 242658909} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: -4.447157, z: 0} + m_LocalScale: {x: 1.2457023, y: 1.2457023, z: 1.2457023} + m_Children: [] + m_Father: {fileID: 2096881075} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!102 &242658911 +TextMesh: + serializedVersion: 3 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 242658909} + m_Text: (Has Animation) + m_OffsetZ: -1.5 + m_CharacterSize: 0.075 + m_LineSpacing: 1 + m_Anchor: 4 + m_Alignment: 0 + m_TabSize: 4 + m_FontSize: 100 + m_FontStyle: 0 + m_RichText: 1 + m_Font: {fileID: 12800000, guid: a4e6a5491519adb45919dc87eff28e55, type: 3} + m_Color: + serializedVersion: 2 + rgba: 4294967295 +--- !u!23 &242658912 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 242658909} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: a4e6a5491519adb45919dc87eff28e55, type: 3} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!1 &245082890 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 245082891} + - component: {fileID: 245082893} + - component: {fileID: 245082892} + m_Layer: 0 + m_Name: Animated + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 0 +--- !u!4 &245082891 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 245082890} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: -4.447157, z: 0} + m_LocalScale: {x: 1.2457023, y: 1.2457023, z: 1.2457023} + m_Children: [] + m_Father: {fileID: 642204093} + m_RootOrder: 2 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!102 &245082892 +TextMesh: + serializedVersion: 3 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 245082890} + m_Text: (Has Animation) + m_OffsetZ: -1.5 + m_CharacterSize: 0.075 + m_LineSpacing: 1 + m_Anchor: 4 + m_Alignment: 0 + m_TabSize: 4 + m_FontSize: 100 + m_FontStyle: 0 + m_RichText: 1 + m_Font: {fileID: 12800000, guid: a4e6a5491519adb45919dc87eff28e55, type: 3} + m_Color: + serializedVersion: 2 + rgba: 4294967295 +--- !u!23 &245082893 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 245082890} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: a4e6a5491519adb45919dc87eff28e55, type: 3} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!1 &252177635 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 252177636} + - component: {fileID: 252177639} + - component: {fileID: 252177638} + m_Layer: 0 + m_Name: Gameboy + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &252177636 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 252177635} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 20, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 605528100} + - {fileID: 2004669564} + m_Father: {fileID: 1563905016} + m_RootOrder: 2 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &252177638 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 252177635} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 98b644315d7a92842b89e04f55c48e02, type: 3} + m_Name: + m_EditorClassIdentifier: +--- !u!212 &252177639 +SpriteRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 252177635} + m_Enabled: 1 + m_CastShadows: 0 + m_ReceiveShadows: 0 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 288262069} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 0 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_Sprite: {fileID: 21300000, guid: 519dafacd208bb64c83d5124be03b09d, type: 3} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_FlipX: 0 + m_FlipY: 0 + m_DrawMode: 0 + m_Size: {x: 5.12, y: 5.12} + m_AdaptiveModeThreshold: 0.5 + m_SpriteTileMode: 0 + m_WasSpriteAssigned: 1 + m_MaskInteraction: 0 + m_SpriteSortPoint: 0 +--- !u!1 &266318147 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 266318148} + - component: {fileID: 266318150} + - component: {fileID: 266318149} + m_Layer: 0 + m_Name: HitSprite + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &266318148 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 266318147} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 227.2355, y: 122.83, z: 122.83} + m_Children: [] + m_Father: {fileID: 642204093} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &266318149 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 266318147} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: ee158225ee1e59f4791627785501d950, type: 3} + m_Name: + m_EditorClassIdentifier: + currentShaderType: 4 + normalStrength: 5 + normalSmoothing: 1 + computingNormal: 0 +--- !u!212 &266318150 +SpriteRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 266318147} + m_Enabled: 1 + m_CastShadows: 0 + m_ReceiveShadows: 0 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 1956560312} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 0 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_Sprite: {fileID: 21300000, guid: 839adabbc5de26041bac66450214a831, type: 3} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_FlipX: 0 + m_FlipY: 0 + m_DrawMode: 0 + m_Size: {x: 0.04, y: 0.04} + m_AdaptiveModeThreshold: 0.5 + m_SpriteTileMode: 0 + m_WasSpriteAssigned: 1 + m_MaskInteraction: 0 + m_SpriteSortPoint: 0 +--- !u!1 &269805653 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 269805654} + - component: {fileID: 269805656} + - component: {fileID: 269805655} + m_Layer: 0 + m_Name: Back + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &269805654 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 269805653} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: -0.01} + m_LocalScale: {x: 0.9196, y: 0.65, z: 1} + m_Children: [] + m_Father: {fileID: 540070583} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &269805655 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 269805653} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: ee158225ee1e59f4791627785501d950, type: 3} + m_Name: + m_EditorClassIdentifier: + currentShaderType: 4 + normalStrength: 5 + normalSmoothing: 1 + computingNormal: 0 +--- !u!212 &269805656 +SpriteRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 269805653} + m_Enabled: 1 + m_CastShadows: 0 + m_ReceiveShadows: 0 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 1024727761} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 0 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_Sprite: {fileID: 21300000, guid: fab06e0be9375cc4d823efa71629885c, type: 3} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_FlipX: 0 + m_FlipY: 0 + m_DrawMode: 0 + m_Size: {x: 1, y: 1} + m_AdaptiveModeThreshold: 0.5 + m_SpriteTileMode: 0 + m_WasSpriteAssigned: 1 + m_MaskInteraction: 0 + m_SpriteSortPoint: 0 +--- !u!1 &275948669 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 275948670} + - component: {fileID: 275948672} + - component: {fileID: 275948671} + m_Layer: 0 + m_Name: Title + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &275948670 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 275948669} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: -2.51, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 485976056} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!102 &275948671 +TextMesh: + serializedVersion: 3 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 275948669} + m_Text: Glitch + m_OffsetZ: -1.5 + m_CharacterSize: 0.075 + m_LineSpacing: 1 + m_Anchor: 4 + m_Alignment: 0 + m_TabSize: 4 + m_FontSize: 100 + m_FontStyle: 0 + m_RichText: 1 + m_Font: {fileID: 12800000, guid: a4e6a5491519adb45919dc87eff28e55, type: 3} + m_Color: + serializedVersion: 2 + rgba: 4294967295 +--- !u!23 &275948672 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 275948669} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 10100, guid: 0000000000000000e000000000000000, type: 0} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!21 &288262069 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: AllIn1SpriteShader/AllIn1SpriteShader + m_Shader: {fileID: 4800000, guid: a36b7719ff0465b42ab1407d67672c5f, type: 3} + m_ShaderKeywords: COLORRAMP_ON ETC1_EXTERNAL_ALPHA GLOWTEX_ON OUTBASE8DIR_ON OUTBASE_ON + PIXELATE_ON _GLOWTEXUSED_ON _OUTLINE8DIRECTIONS_ON + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _ColorRampTex: + m_Texture: {fileID: 2800000, guid: 285a35f6ccf7b1a44b6c198e96105173, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ColorRampTexGradient: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ColorSwapTex: + m_Texture: {fileID: 2800000, guid: 065da6c7b90ca904dab9cbc6b415fd19, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DistortTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _FadeBurnTex: + m_Texture: {fileID: 2800000, guid: 32e8df0008bebe746b1681a71c61f31c, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _FadeTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 0.5, y: 0.5} + m_Offset: {x: 0, y: 0} + - _GlowTex: + m_Texture: {fileID: 2800000, guid: 8608ef90f91271745a17f7210fe1e7db, type: 3} + 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} + - _OutlineDistortTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OutlineTex: + m_Texture: {fileID: 2800000, guid: 74087f6d03f233e4a8a142fa01f9e5cf, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OverlayTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ShineMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - _Alpha: 1 + - _AlphaCutoffValue: 0 + - _AlphaOutlineBlend: 1 + - _AlphaOutlineGlow: 5 + - _AlphaOutlineMinAlpha: 0 + - _AlphaOutlinePower: 1 + - _AlphaRoundThreshold: 0.531 + - _BillboardY: 0 + - _BlurHD: 0 + - _BlurIntensity: 10 + - _Brightness: 0 + - _ChromAberrAlpha: 0.4 + - _ChromAberrAmount: 1 + - _ClipUvDown: 1 + - _ClipUvLeft: 1 + - _ClipUvRight: 1 + - _ClipUvUp: 1 + - _ColorChangeLuminosity: 0 + - _ColorChangeTolerance: 0.25 + - _ColorChangeTolerance2: 0.25 + - _ColorChangeTolerance3: 0.25 + - _ColorRampBlend: 1 + - _ColorRampLuminosity: 0 + - _ColorRampOutline: 0 + - _ColorSwapBlend: 1 + - _ColorSwapBlueLuminosity: 0.75 + - _ColorSwapGreenLuminosity: 0.264 + - _ColorSwapRedLuminosity: 0.75 + - _Contrast: 1 + - _CullingOption: 0 + - _DistortAmount: 0.5 + - _DistortTexXSpeed: 5 + - _DistortTexYSpeed: 5 + - _EditorDrawers: 6 + - _FadeAmount: 0.437 + - _FadeBurnGlow: 6.6 + - _FadeBurnTransition: 0.075 + - _FadeBurnWidth: 0.025 + - _FishEyeUvAmount: 0.35 + - _FlickerAlpha: 0 + - _FlickerFreq: 0.2 + - _FlickerPercent: 0.05 + - _GhostBlend: 1 + - _GhostColorBoost: 1 + - _GhostTransparency: 0 + - _GlitchAmount: 3 + - _GlitchSize: 1 + - _Glow: 2.5 + - _GlowGlobal: 1 + - _GlowTexUsed: 1 + - _GradBlend: 1 + - _GradBoostX: 1.2 + - _GradBoostY: 1.2 + - _GradIsRadial: 0 + - _GrassManualAnim: 1 + - _GrassManualToggle: 0 + - _GrassRadialBend: 0.25 + - _GrassSpeed: 6.9 + - _GrassWind: 20 + - _GreyscaleBlend: 1 + - _GreyscaleLuminosity: 0 + - _GreyscaleOutline: 0 + - _HandDrawnAmount: 10 + - _HandDrawnSpeed: 5 + - _HitEffectBlend: 1 + - _HitEffectGlow: 5 + - _HologramBlend: 1 + - _HologramFlickerAlpha: 0 + - _HologramFlickerFreq: 0.2 + - _HologramFlickerPercent: 0.05 + - _HologramMaxAlpha: 1 + - _HologramMinAlpha: 0 + - _HologramStripesAlpha: 0.4 + - _HologramStripesAmount: 50 + - _HologramStripesFill: 0.4 + - _HologramStripesLuminosity: 1 + - _HologramStripesSpeed: 5 + - _HologramUnmodAmount: 0.4 + - _HsvBright: 1 + - _HsvSaturation: 1 + - _HsvShift: 180 + - _InnerOutlineAlpha: 1 + - _InnerOutlineGlow: 1 + - _InnerOutlineThickness: 1 + - _MaxXUV: 1 + - _MaxYUV: 1 + - _MinXUV: 0 + - _MinYUV: 0 + - _MotionBlurAngle: 0.1 + - _MotionBlurDist: 1.25 + - _MyDstMode: 10 + - _MySrcMode: 5 + - _NegativeAmount: 1 + - _OffsetUvX: 0 + - _OffsetUvY: 0 + - _OnlyInnerOutline: 0 + - _OnlyOutline: 0 + - _Outline8Directions: 1 + - _OutlineAlpha: 1 + - _OutlineDistortAmount: 0.5 + - _OutlineDistortTexXSpeed: 5 + - _OutlineDistortTexYSpeed: 5 + - _OutlineDistortToggle: 0 + - _OutlineGlow: 1.5 + - _OutlineIsPixel: 0 + - _OutlinePixelWidth: 1 + - _OutlineTexGrey: 0 + - _OutlineTexToggle: 0 + - _OutlineTexXSpeed: 10 + - _OutlineTexYSpeed: 0 + - _OutlineWidth: 0.0539 + - _OverlayBlend: 1 + - _OverlayGlow: 1 + - _OverlayTextureScrollXSpeed: 0.25 + - _OverlayTextureScrollYSpeed: 0.25 + - _PinchUvAmount: 0.35 + - _PixelateSize: 40 + - _PosterizeGamma: 0.75 + - _PosterizeNumColors: 8 + - _PosterizeOutline: 0 + - _RadialClipAngle: 90 + - _RadialClipArc1: 45 + - _RadialClipArc2: 0 + - _RandomSeed: 0 + - _RectSize: 1 + - _RotateUvAmount: 0 + - _RoundWaveSpeed: 2 + - _RoundWaveStrength: 0.7 + - _ShadowAlpha: 0.5 + - _ShadowX: 0.1 + - _ShadowY: -0.05 + - _ShakeUvSpeed: 1.61 + - _ShakeUvX: 1.5 + - _ShakeUvY: 1 + - _ShineGlow: 1 + - _ShineLocation: 0.5 + - _ShineRotate: 0 + - _ShineWidth: 0.1 + - _TextureScrollXSpeed: 1 + - _TextureScrollYSpeed: 0 + - _TwistUvAmount: 1 + - _TwistUvPosX: 0.5 + - _TwistUvPosY: 0.5 + - _TwistUvRadius: 0.75 + - _WarpScale: 0.5 + - _WarpSpeed: 8 + - _WarpStrength: 0.025 + - _WaveAmount: 7 + - _WaveSpeed: 10 + - _WaveStrength: 7.5 + - _WaveX: 0 + - _WaveY: 0.5 + - _ZTestMode: 4 + - _ZWrite: 0 + - _ZoomUvAmount: 0.5 + m_Colors: + - ColorSwapRed: {r: 1, g: 1, b: 1, a: 1} + - _AlphaOutlineColor: {r: 1, g: 1, b: 1, a: 1} + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _ColorChangeNewCol: {r: 1, g: 1, b: 0, a: 1} + - _ColorChangeNewCol2: {r: 1, g: 1, b: 0, a: 1} + - _ColorChangeNewCol3: {r: 1, g: 1, b: 0, a: 1} + - _ColorChangeTarget: {r: 1, g: 0, b: 0, a: 1} + - _ColorChangeTarget2: {r: 1, g: 0, b: 0, a: 1} + - _ColorChangeTarget3: {r: 1, g: 0, b: 0, a: 1} + - _ColorSwapBlue: {r: 0.41037738, g: 0.5180799, b: 1, a: 1} + - _ColorSwapGreen: {r: 0, g: 1, b: 0.96124196, a: 1} + - _ColorSwapRed: {r: 0.9528302, g: 0.783215, b: 0, a: 1} + - _FadeBurnColor: {r: 1, g: 1, b: 0, a: 1} + - _GlowColor: {r: 1, g: 1, b: 1, a: 1} + - _GradBotLeftCol: {r: 0, g: 0, b: 1, a: 1} + - _GradBotRightCol: {r: 0, g: 0, b: 1, a: 1} + - _GradTopLeftCol: {r: 1, g: 0, b: 0, a: 1} + - _GradTopRightCol: {r: 1, g: 0, b: 0, a: 1} + - _GreyscaleTintColor: {r: 1, g: 1, b: 1, a: 1} + - _HitEffectColor: {r: 1, g: 1, b: 1, a: 1} + - _HologramStripeColor: {r: 1, g: 1, b: 1, a: 1} + - _InnerOutlineColor: {r: 1, g: 0, b: 0, a: 1} + - _OutlineColor: {r: 1, g: 1, b: 1, a: 1} + - _OverlayColor: {r: 1, g: 1, b: 1, a: 1} + - _ShadowColor: {r: 0, g: 0, b: 0, a: 1} + - _ShineColor: {r: 1, g: 1, b: 1, a: 1} +--- !u!4 &290590332 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 290590333} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 30, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 14374125} + - {fileID: 1511231070} + m_Father: {fileID: 2036092933} + m_RootOrder: 3 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &290590333 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 290590332} + - component: {fileID: 290590335} + - component: {fileID: 290590336} + m_Layer: 0 + m_Name: Outline1 + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!212 &290590335 +SpriteRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 290590333} + m_Enabled: 1 + m_CastShadows: 0 + m_ReceiveShadows: 0 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 7746739} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 0 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_Sprite: {fileID: 21300000, guid: 519dafacd208bb64c83d5124be03b09d, type: 3} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_FlipX: 0 + m_FlipY: 0 + m_DrawMode: 0 + m_Size: {x: 5.12, y: 5.12} + m_AdaptiveModeThreshold: 0.5 + m_SpriteTileMode: 0 + m_WasSpriteAssigned: 1 + m_MaskInteraction: 0 + m_SpriteSortPoint: 0 +--- !u!114 &290590336 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 290590333} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 98b644315d7a92842b89e04f55c48e02, type: 3} + m_Name: + m_EditorClassIdentifier: +--- !u!1 &294421775 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 294421776} + - component: {fileID: 294421778} + - component: {fileID: 294421777} + m_Layer: 0 + m_Name: Title + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &294421776 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 294421775} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: -2.51, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 1229041066} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!102 &294421777 +TextMesh: + serializedVersion: 3 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 294421775} + m_Text: HueShift + m_OffsetZ: -1.5 + m_CharacterSize: 0.075 + m_LineSpacing: 1 + m_Anchor: 4 + m_Alignment: 0 + m_TabSize: 4 + m_FontSize: 100 + m_FontStyle: 0 + m_RichText: 1 + m_Font: {fileID: 12800000, guid: a4e6a5491519adb45919dc87eff28e55, type: 3} + m_Color: + serializedVersion: 2 + rgba: 4294967295 +--- !u!23 &294421778 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 294421775} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 10100, guid: 0000000000000000e000000000000000, type: 0} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!1 &297942434 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 297942435} + - component: {fileID: 297942437} + - component: {fileID: 297942436} + m_Layer: 0 + m_Name: Animated + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 0 +--- !u!4 &297942435 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 297942434} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: -3.57, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 1123731223} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!102 &297942436 +TextMesh: + serializedVersion: 3 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 297942434} + m_Text: (Has Animation) + m_OffsetZ: -1.5 + m_CharacterSize: 0.075 + m_LineSpacing: 1 + m_Anchor: 4 + m_Alignment: 0 + m_TabSize: 4 + m_FontSize: 100 + m_FontStyle: 0 + m_RichText: 1 + m_Font: {fileID: 12800000, guid: a4e6a5491519adb45919dc87eff28e55, type: 3} + m_Color: + serializedVersion: 2 + rgba: 4294967295 +--- !u!23 &297942437 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 297942434} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: a4e6a5491519adb45919dc87eff28e55, type: 3} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!1 &298142066 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 298142067} + - component: {fileID: 298142069} + - component: {fileID: 298142068} + m_Layer: 0 + m_Name: Animated + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &298142067 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 298142066} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: -3.57, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 939106332} + m_RootOrder: 2 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!102 &298142068 +TextMesh: + serializedVersion: 3 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 298142066} + m_Text: (Has Animation) + m_OffsetZ: -1.5 + m_CharacterSize: 0.075 + m_LineSpacing: 1 + m_Anchor: 4 + m_Alignment: 0 + m_TabSize: 4 + m_FontSize: 100 + m_FontStyle: 0 + m_RichText: 1 + m_Font: {fileID: 12800000, guid: a4e6a5491519adb45919dc87eff28e55, type: 3} + m_Color: + serializedVersion: 2 + rgba: 4294967295 +--- !u!23 &298142069 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 298142066} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 10100, guid: 0000000000000000e000000000000000, type: 0} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!1 &298228098 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 298228099} + - component: {fileID: 298228101} + - component: {fileID: 298228100} + m_Layer: 0 + m_Name: Animated + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 0 +--- !u!4 &298228099 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 298228098} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: -3.57, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 1374997139} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!102 &298228100 +TextMesh: + serializedVersion: 3 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 298228098} + m_Text: (Has Animation) + m_OffsetZ: -1.5 + m_CharacterSize: 0.075 + m_LineSpacing: 1 + m_Anchor: 4 + m_Alignment: 0 + m_TabSize: 4 + m_FontSize: 100 + m_FontStyle: 0 + m_RichText: 1 + m_Font: {fileID: 12800000, guid: a4e6a5491519adb45919dc87eff28e55, type: 3} + m_Color: + serializedVersion: 2 + rgba: 4294967295 +--- !u!23 &298228101 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 298228098} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: a4e6a5491519adb45919dc87eff28e55, type: 3} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!21 &302907434 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: AllIn1SpriteShader/AllIn1SpriteShader + m_Shader: {fileID: 4800000, guid: a36b7719ff0465b42ab1407d67672c5f, type: 3} + m_ShaderKeywords: ETC1_EXTERNAL_ALPHA POSTERIZE_ON + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _ColorRampTex: + m_Texture: {fileID: 2800000, guid: 279657edc397ece4b8029c727adf6ddc, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ColorRampTexGradient: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ColorSwapTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DistortTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _FadeBurnTex: + m_Texture: {fileID: 2800000, guid: 32e8df0008bebe746b1681a71c61f31c, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _FadeTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _GlowTex: + 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} + - _OutlineDistortTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OutlineTex: + m_Texture: {fileID: 2800000, guid: 74087f6d03f233e4a8a142fa01f9e5cf, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OverlayTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ShineMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - _Alpha: 1 + - _AlphaCutoffValue: 0.25 + - _AlphaOutlineBlend: 1 + - _AlphaOutlineGlow: 5 + - _AlphaOutlineMinAlpha: 0 + - _AlphaOutlinePower: 1 + - _AlphaRoundThreshold: 0.5 + - _BillboardY: 0 + - _BlurHD: 0 + - _BlurIntensity: 10 + - _Brightness: 0 + - _ChromAberrAlpha: 0.4 + - _ChromAberrAmount: 1 + - _ClipUvDown: 1 + - _ClipUvLeft: 1 + - _ClipUvRight: 1 + - _ClipUvUp: 1 + - _ColorChangeLuminosity: 0 + - _ColorChangeTolerance: 0.25 + - _ColorChangeTolerance2: 0.25 + - _ColorChangeTolerance3: 0.25 + - _ColorRampBlend: 1 + - _ColorRampLuminosity: 0 + - _ColorRampOutline: 0 + - _ColorSwapBlend: 1 + - _ColorSwapBlueLuminosity: 0.5 + - _ColorSwapGreenLuminosity: 0.5 + - _ColorSwapRedLuminosity: 0.5 + - _Contrast: 1 + - _CullingOption: 0 + - _DistortAmount: 0.5 + - _DistortTexXSpeed: 5 + - _DistortTexYSpeed: 5 + - _EditorDrawers: 6 + - _FadeAmount: -0.1 + - _FadeBurnGlow: 2 + - _FadeBurnTransition: 0.075 + - _FadeBurnWidth: 0.025 + - _FishEyeUvAmount: 0.35 + - _FlickerAlpha: 0 + - _FlickerFreq: 0.2 + - _FlickerPercent: 0.05 + - _GhostBlend: 1 + - _GhostColorBoost: 1 + - _GhostTransparency: 0 + - _GlitchAmount: 3 + - _GlitchSize: 1 + - _Glow: 10 + - _GlowGlobal: 1 + - _GlowTexUsed: 0 + - _GradBlend: 1 + - _GradBoostX: 1.2 + - _GradBoostY: 1.2 + - _GradIsRadial: 0 + - _GrassManualAnim: 1 + - _GrassManualToggle: 0 + - _GrassRadialBend: 0.25 + - _GrassSpeed: 2 + - _GrassWind: 20 + - _GreyscaleBlend: 1 + - _GreyscaleLuminosity: 0 + - _GreyscaleOutline: 0 + - _HandDrawnAmount: 10 + - _HandDrawnSpeed: 5 + - _HitEffectBlend: 1 + - _HitEffectGlow: 5 + - _HologramBlend: 1 + - _HologramFlickerAlpha: 0 + - _HologramFlickerFreq: 0.2 + - _HologramFlickerPercent: 0.05 + - _HologramMaxAlpha: 1 + - _HologramMinAlpha: 0 + - _HologramStripesAlpha: 0.4 + - _HologramStripesAmount: 50 + - _HologramStripesFill: 0.4 + - _HologramStripesLuminosity: 1 + - _HologramStripesSpeed: 5 + - _HologramUnmodAmount: 0.4 + - _HsvBright: 1 + - _HsvSaturation: 1 + - _HsvShift: 180 + - _InnerOutlineAlpha: 1 + - _InnerOutlineGlow: 1 + - _InnerOutlineThickness: 1 + - _MaxXUV: 1 + - _MaxYUV: 1 + - _MinXUV: 0 + - _MinYUV: 0 + - _MotionBlurAngle: 0.1 + - _MotionBlurDist: 1.25 + - _MyDstMode: 10 + - _MySrcMode: 5 + - _NegativeAmount: 1 + - _OffsetUvX: 0 + - _OffsetUvY: 0 + - _OnlyInnerOutline: 0 + - _OnlyOutline: 0 + - _Outline8Directions: 0 + - _OutlineAlpha: 1 + - _OutlineDistortAmount: 0.5 + - _OutlineDistortTexXSpeed: 5 + - _OutlineDistortTexYSpeed: 5 + - _OutlineDistortToggle: 0 + - _OutlineGlow: 1.5 + - _OutlineIsPixel: 0 + - _OutlinePixelWidth: 1 + - _OutlineTexGrey: 0 + - _OutlineTexToggle: 0 + - _OutlineTexXSpeed: 10 + - _OutlineTexYSpeed: 0 + - _OutlineWidth: 0.004 + - _OverlayBlend: 1 + - _OverlayGlow: 1 + - _OverlayTextureScrollXSpeed: 0.25 + - _OverlayTextureScrollYSpeed: 0.25 + - _PinchUvAmount: 0.35 + - _PixelateSize: 32 + - _PosterizeGamma: 0.75 + - _PosterizeNumColors: 8 + - _PosterizeOutline: 0 + - _RadialClip: 0 + - _RadialClip2: 45 + - _RadialClipAngle: 90 + - _RadialClipArc1: 45 + - _RadialClipArc2: 0 + - _RadialStartAngle: 90 + - _RandomSeed: 0 + - _RectSize: 1 + - _RotateUvAmount: 0 + - _RoundWaveSpeed: 2 + - _RoundWaveStrength: 0.7 + - _ShadowAlpha: 0.5 + - _ShadowX: 0.1 + - _ShadowY: -0.05 + - _ShakeUvSpeed: 2.5 + - _ShakeUvX: 1.5 + - _ShakeUvY: 1 + - _ShineGlow: 1 + - _ShineLocation: 0.5 + - _ShineRotate: 0 + - _ShineWidth: 0.1 + - _TextureScrollXSpeed: 1 + - _TextureScrollYSpeed: 0 + - _TwistUvAmount: 1 + - _TwistUvPosX: 0.5 + - _TwistUvPosY: 0.5 + - _TwistUvRadius: 0.75 + - _WarpScale: 0.5 + - _WarpSpeed: 8 + - _WarpStrength: 0.025 + - _WaveAmount: 7 + - _WaveSpeed: 10 + - _WaveStrength: 7.5 + - _WaveX: 0 + - _WaveY: 0.5 + - _ZTestMode: 4 + - _ZWrite: 0 + - _ZoomUvAmount: 0.5 + m_Colors: + - ColorSwapRed: {r: 1, g: 1, b: 1, a: 1} + - _AlphaOutlineColor: {r: 1, g: 1, b: 1, a: 1} + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _ColorChangeNewCol: {r: 1, g: 1, b: 0, a: 1} + - _ColorChangeNewCol2: {r: 1, g: 1, b: 0, a: 1} + - _ColorChangeNewCol3: {r: 1, g: 1, b: 0, a: 1} + - _ColorChangeTarget: {r: 1, g: 0, b: 0, a: 1} + - _ColorChangeTarget2: {r: 1, g: 0, b: 0, a: 1} + - _ColorChangeTarget3: {r: 1, g: 0, b: 0, a: 1} + - _ColorSwapBlue: {r: 1, g: 1, b: 1, a: 1} + - _ColorSwapGreen: {r: 1, g: 1, b: 1, a: 1} + - _ColorSwapRed: {r: 1, g: 1, b: 1, a: 1} + - _FadeBurnColor: {r: 1, g: 1, b: 0, a: 1} + - _GlowColor: {r: 1, g: 1, b: 1, a: 1} + - _GradBotLeftCol: {r: 0, g: 0, b: 1, a: 1} + - _GradBotRightCol: {r: 0, g: 0, b: 1, a: 1} + - _GradTopLeftCol: {r: 1, g: 0, b: 0, a: 1} + - _GradTopRightCol: {r: 1, g: 0, b: 0, a: 1} + - _GreyscaleTintColor: {r: 1, g: 1, b: 1, a: 1} + - _HitEffectColor: {r: 1, g: 1, b: 1, a: 1} + - _HologramStripeColor: {r: 1, g: 1, b: 1, a: 1} + - _InnerOutlineColor: {r: 1, g: 0, b: 0, a: 1} + - _OutlineColor: {r: 1, g: 1, b: 1, a: 1} + - _OverlayColor: {r: 1, g: 1, b: 1, a: 1} + - _ShadowColor: {r: 0, g: 0, b: 0, a: 1} + - _ShineColor: {r: 1, g: 1, b: 1, a: 1} +--- !u!1 &305999440 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 305999441} + - component: {fileID: 305999443} + - component: {fileID: 305999442} + m_Layer: 0 + m_Name: Title + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &305999441 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 305999440} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: -2.51, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 972134371} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!102 &305999442 +TextMesh: + serializedVersion: 3 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 305999440} + m_Text: Distortion + m_OffsetZ: -1.5 + m_CharacterSize: 0.075 + m_LineSpacing: 1 + m_Anchor: 4 + m_Alignment: 0 + m_TabSize: 4 + m_FontSize: 100 + m_FontStyle: 0 + m_RichText: 1 + m_Font: {fileID: 12800000, guid: a4e6a5491519adb45919dc87eff28e55, type: 3} + m_Color: + serializedVersion: 2 + rgba: 4294967295 +--- !u!23 &305999443 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 305999440} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 10100, guid: 0000000000000000e000000000000000, type: 0} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!1 &312669277 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 312669278} + - component: {fileID: 312669281} + - component: {fileID: 312669280} + m_Layer: 0 + m_Name: AlphaOutline + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &312669278 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 312669277} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 60, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 1438024880} + - {fileID: 706131457} + m_Father: {fileID: 2036092933} + m_RootOrder: 6 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &312669280 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 312669277} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 98b644315d7a92842b89e04f55c48e02, type: 3} + m_Name: + m_EditorClassIdentifier: +--- !u!212 &312669281 +SpriteRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 312669277} + m_Enabled: 1 + m_CastShadows: 0 + m_ReceiveShadows: 0 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2076240280} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 0 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_Sprite: {fileID: 21300000, guid: 519dafacd208bb64c83d5124be03b09d, type: 3} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_FlipX: 0 + m_FlipY: 0 + m_DrawMode: 0 + m_Size: {x: 5.12, y: 5.12} + m_AdaptiveModeThreshold: 0.5 + m_SpriteTileMode: 0 + m_WasSpriteAssigned: 1 + m_MaskInteraction: 0 + m_SpriteSortPoint: 0 +--- !u!21 &313393139 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: AllIn1SpriteShader/AllIn1SpriteShader + m_Shader: {fileID: 4800000, guid: a36b7719ff0465b42ab1407d67672c5f, type: 3} + m_ShaderKeywords: ETC1_EXTERNAL_ALPHA OUTBASE8DIR_ON OUTBASE_ON OUTTEX_ON _OUTLINE8DIRECTIONS_ON + _OUTLINETEXTOGGLE_ON + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _ColorRampTex: + m_Texture: {fileID: 2800000, guid: 279657edc397ece4b8029c727adf6ddc, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ColorRampTexGradient: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ColorSwapTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DistortTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _FadeBurnTex: + m_Texture: {fileID: 2800000, guid: 32e8df0008bebe746b1681a71c61f31c, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _FadeTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _GlowTex: + 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} + - _OutlineDistortTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OutlineTex: + m_Texture: {fileID: 2800000, guid: 74087f6d03f233e4a8a142fa01f9e5cf, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OverlayTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ShineMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - _Alpha: 1 + - _AlphaCutoffValue: 0.25 + - _AlphaOutlineBlend: 1 + - _AlphaOutlineGlow: 5 + - _AlphaOutlineMinAlpha: 0 + - _AlphaOutlinePower: 1 + - _AlphaRoundThreshold: 0.5 + - _BillboardY: 0 + - _BlurHD: 0 + - _BlurIntensity: 10 + - _Brightness: 0 + - _ChromAberrAlpha: 0.4 + - _ChromAberrAmount: 1 + - _ClipUvDown: 1 + - _ClipUvLeft: 1 + - _ClipUvRight: 1 + - _ClipUvUp: 1 + - _ColorChangeLuminosity: 0 + - _ColorChangeTolerance: 0.25 + - _ColorChangeTolerance2: 0.25 + - _ColorChangeTolerance3: 0.25 + - _ColorRampBlend: 1 + - _ColorRampLuminosity: 0 + - _ColorRampOutline: 0 + - _ColorSwapBlend: 1 + - _ColorSwapBlueLuminosity: 0.5 + - _ColorSwapGreenLuminosity: 0.5 + - _ColorSwapRedLuminosity: 0.5 + - _Contrast: 1 + - _CullingOption: 0 + - _DistortAmount: 0.5 + - _DistortTexXSpeed: 5 + - _DistortTexYSpeed: 5 + - _EditorDrawers: 6 + - _FadeAmount: -0.1 + - _FadeBurnGlow: 2 + - _FadeBurnTransition: 0.075 + - _FadeBurnWidth: 0.025 + - _FishEyeUvAmount: 0.35 + - _FlickerAlpha: 0 + - _FlickerFreq: 0.2 + - _FlickerPercent: 0.05 + - _GhostBlend: 1 + - _GhostColorBoost: 1 + - _GhostTransparency: 0 + - _GlitchAmount: 3 + - _GlitchSize: 1 + - _Glow: 10 + - _GlowGlobal: 1 + - _GlowTexUsed: 0 + - _GradBlend: 1 + - _GradBoostX: 1.2 + - _GradBoostY: 1.2 + - _GradIsRadial: 0 + - _GrassManualAnim: 1 + - _GrassManualToggle: 0 + - _GrassRadialBend: 0.25 + - _GrassSpeed: 2 + - _GrassWind: 20 + - _GreyscaleBlend: 1 + - _GreyscaleLuminosity: 0 + - _GreyscaleOutline: 0 + - _HandDrawnAmount: 10 + - _HandDrawnSpeed: 5 + - _HitEffectBlend: 1 + - _HitEffectGlow: 5 + - _HologramBlend: 1 + - _HologramFlickerAlpha: 0 + - _HologramFlickerFreq: 0.2 + - _HologramFlickerPercent: 0.05 + - _HologramMaxAlpha: 1 + - _HologramMinAlpha: 0 + - _HologramStripesAlpha: 0.4 + - _HologramStripesAmount: 50 + - _HologramStripesFill: 0.4 + - _HologramStripesLuminosity: 1 + - _HologramStripesSpeed: 5 + - _HologramUnmodAmount: 0.4 + - _HsvBright: 1 + - _HsvSaturation: 1 + - _HsvShift: 180 + - _InnerOutlineAlpha: 1 + - _InnerOutlineGlow: 1 + - _InnerOutlineThickness: 1 + - _MaxXUV: 1 + - _MaxYUV: 1 + - _MinXUV: 0 + - _MinYUV: 0 + - _MotionBlurAngle: 0.1 + - _MotionBlurDist: 1.25 + - _MyDstMode: 10 + - _MySrcMode: 5 + - _NegativeAmount: 1 + - _OffsetUvX: 0 + - _OffsetUvY: 0 + - _OnlyInnerOutline: 0 + - _OnlyOutline: 0 + - _Outline8Directions: 1 + - _OutlineAlpha: 1 + - _OutlineDistortAmount: 0.5 + - _OutlineDistortTexXSpeed: 5 + - _OutlineDistortTexYSpeed: 5 + - _OutlineDistortToggle: 0 + - _OutlineGlow: 1.5 + - _OutlineIsPixel: 0 + - _OutlinePixelWidth: 1 + - _OutlineTexGrey: 0 + - _OutlineTexToggle: 1 + - _OutlineTexXSpeed: 10 + - _OutlineTexYSpeed: 0 + - _OutlineWidth: 0.011 + - _OverlayBlend: 1 + - _OverlayGlow: 1 + - _OverlayTextureScrollXSpeed: 0.25 + - _OverlayTextureScrollYSpeed: 0.25 + - _PinchUvAmount: 0.35 + - _PixelateSize: 32 + - _PosterizeGamma: 0.75 + - _PosterizeNumColors: 8 + - _PosterizeOutline: 0 + - _RadialClip: 45 + - _RadialClip2: 0 + - _RadialClipAngle: 90 + - _RadialClipArc1: 45 + - _RadialClipArc2: 0 + - _RadialStartAngle: 90 + - _RandomSeed: 0 + - _RectSize: 1 + - _RotateUvAmount: 0 + - _RoundWaveSpeed: 2 + - _RoundWaveStrength: 0.7 + - _ShadowAlpha: 0.5 + - _ShadowX: 0.1 + - _ShadowY: -0.05 + - _ShakeUvSpeed: 2.5 + - _ShakeUvX: 1.5 + - _ShakeUvY: 1 + - _ShineGlow: 1 + - _ShineLocation: 0.5 + - _ShineRotate: 0 + - _ShineWidth: 0.1 + - _TextureScrollXSpeed: 1 + - _TextureScrollYSpeed: 0 + - _TwistUvAmount: 1 + - _TwistUvPosX: 0.5 + - _TwistUvPosY: 0.5 + - _TwistUvRadius: 0.75 + - _WarpScale: 0.5 + - _WarpSpeed: 8 + - _WarpStrength: 0.025 + - _WaveAmount: 7 + - _WaveSpeed: 10 + - _WaveStrength: 7.5 + - _WaveX: 0 + - _WaveY: 0.5 + - _ZTestMode: 4 + - _ZWrite: 0 + - _ZoomUvAmount: 0.5 + m_Colors: + - ColorSwapRed: {r: 1, g: 1, b: 1, a: 1} + - _AlphaOutlineColor: {r: 1, g: 1, b: 1, a: 1} + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _ColorChangeNewCol: {r: 1, g: 1, b: 0, a: 1} + - _ColorChangeNewCol2: {r: 1, g: 1, b: 0, a: 1} + - _ColorChangeNewCol3: {r: 1, g: 1, b: 0, a: 1} + - _ColorChangeTarget: {r: 1, g: 0, b: 0, a: 1} + - _ColorChangeTarget2: {r: 1, g: 0, b: 0, a: 1} + - _ColorChangeTarget3: {r: 1, g: 0, b: 0, a: 1} + - _ColorSwapBlue: {r: 1, g: 1, b: 1, a: 1} + - _ColorSwapGreen: {r: 1, g: 1, b: 1, a: 1} + - _ColorSwapRed: {r: 1, g: 1, b: 1, a: 1} + - _FadeBurnColor: {r: 1, g: 1, b: 0, a: 1} + - _GlowColor: {r: 1, g: 1, b: 1, a: 1} + - _GradBotLeftCol: {r: 0, g: 0, b: 1, a: 1} + - _GradBotRightCol: {r: 0, g: 0, b: 1, a: 1} + - _GradTopLeftCol: {r: 1, g: 0, b: 0, a: 1} + - _GradTopRightCol: {r: 1, g: 0, b: 0, a: 1} + - _GreyscaleTintColor: {r: 1, g: 1, b: 1, a: 1} + - _HitEffectColor: {r: 1, g: 1, b: 1, a: 1} + - _HologramStripeColor: {r: 1, g: 1, b: 1, a: 1} + - _InnerOutlineColor: {r: 1, g: 0, b: 0, a: 1} + - _OutlineColor: {r: 1, g: 1, b: 1, a: 1} + - _OverlayColor: {r: 1, g: 1, b: 1, a: 1} + - _ShadowColor: {r: 0, g: 0, b: 0, a: 1} + - _ShineColor: {r: 1, g: 1, b: 1, a: 1} +--- !u!1 &316406007 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 316406008} + - component: {fileID: 316406010} + - component: {fileID: 316406009} + m_Layer: 0 + m_Name: Title + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &316406008 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 316406007} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: -2.51, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 597182738} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!102 &316406009 +TextMesh: + serializedVersion: 3 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 316406007} + m_Text: Color Ramp + m_OffsetZ: -1.5 + m_CharacterSize: 0.075 + m_LineSpacing: 1 + m_Anchor: 4 + m_Alignment: 0 + m_TabSize: 4 + m_FontSize: 100 + m_FontStyle: 0 + m_RichText: 1 + m_Font: {fileID: 12800000, guid: a4e6a5491519adb45919dc87eff28e55, type: 3} + m_Color: + serializedVersion: 2 + rgba: 4294967295 +--- !u!23 &316406010 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 316406007} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 10100, guid: 0000000000000000e000000000000000, type: 0} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!1 &316897174 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 316897175} + - component: {fileID: 316897177} + - component: {fileID: 316897176} + m_Layer: 0 + m_Name: Title + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &316897175 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 316897174} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: -2.51, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 1286689243} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!102 &316897176 +TextMesh: + serializedVersion: 3 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 316897174} + m_Text: Hologram + m_OffsetZ: -1.5 + m_CharacterSize: 0.075 + m_LineSpacing: 1 + m_Anchor: 4 + m_Alignment: 0 + m_TabSize: 4 + m_FontSize: 100 + m_FontStyle: 0 + m_RichText: 1 + m_Font: {fileID: 12800000, guid: a4e6a5491519adb45919dc87eff28e55, type: 3} + m_Color: + serializedVersion: 2 + rgba: 4294967295 +--- !u!23 &316897177 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 316897174} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 10100, guid: 0000000000000000e000000000000000, type: 0} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!1 &317082044 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 317082045} + - component: {fileID: 317082047} + - component: {fileID: 317082046} + m_Layer: 0 + m_Name: Animated + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 0 +--- !u!4 &317082045 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 317082044} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: -3.57, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 586081879} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!102 &317082046 +TextMesh: + serializedVersion: 3 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 317082044} + m_Text: (Has Animation) + m_OffsetZ: -1.5 + m_CharacterSize: 0.075 + m_LineSpacing: 1 + m_Anchor: 4 + m_Alignment: 0 + m_TabSize: 4 + m_FontSize: 100 + m_FontStyle: 0 + m_RichText: 1 + m_Font: {fileID: 12800000, guid: a4e6a5491519adb45919dc87eff28e55, type: 3} + m_Color: + serializedVersion: 2 + rgba: 4294967295 +--- !u!23 &317082047 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 317082044} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: a4e6a5491519adb45919dc87eff28e55, type: 3} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!1 &322195377 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 322195378} + - component: {fileID: 322195380} + - component: {fileID: 322195379} + m_Layer: 0 + m_Name: Animated + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 0 +--- !u!4 &322195378 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 322195377} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: -3.57, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 1028271463} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!102 &322195379 +TextMesh: + serializedVersion: 3 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 322195377} + m_Text: (Has Animation) + m_OffsetZ: -1.5 + m_CharacterSize: 0.075 + m_LineSpacing: 1 + m_Anchor: 4 + m_Alignment: 0 + m_TabSize: 4 + m_FontSize: 100 + m_FontStyle: 0 + m_RichText: 1 + m_Font: {fileID: 12800000, guid: a4e6a5491519adb45919dc87eff28e55, type: 3} + m_Color: + serializedVersion: 2 + rgba: 4294967295 +--- !u!23 &322195380 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 322195377} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: a4e6a5491519adb45919dc87eff28e55, type: 3} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!21 &323921624 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: AllIn1SpriteShader/AllIn1SpriteShader + m_Shader: {fileID: 4800000, guid: a36b7719ff0465b42ab1407d67672c5f, type: 3} + m_ShaderKeywords: CLIPPING_ON ETC1_EXTERNAL_ALPHA + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _ColorRampTex: + m_Texture: {fileID: 2800000, guid: 279657edc397ece4b8029c727adf6ddc, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ColorRampTexGradient: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ColorSwapTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DistortTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _FadeBurnTex: + m_Texture: {fileID: 2800000, guid: 32e8df0008bebe746b1681a71c61f31c, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _FadeTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _GlowTex: + 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} + - _OutlineDistortTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OutlineTex: + m_Texture: {fileID: 2800000, guid: 74087f6d03f233e4a8a142fa01f9e5cf, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OverlayTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ShineMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - _Alpha: 1 + - _AlphaCutoffValue: 0.25 + - _AlphaOutlineBlend: 1 + - _AlphaOutlineGlow: 5 + - _AlphaOutlineMinAlpha: 0 + - _AlphaOutlinePower: 1 + - _AlphaRoundThreshold: 0.5 + - _BillboardY: 0 + - _BlurHD: 0 + - _BlurIntensity: 10 + - _Brightness: 0 + - _ChromAberrAlpha: 0.4 + - _ChromAberrAmount: 1 + - _ClipUvDown: 0 + - _ClipUvLeft: 0 + - _ClipUvRight: 0.394 + - _ClipUvUp: 0 + - _ColorChangeLuminosity: 0 + - _ColorChangeTolerance: 0.25 + - _ColorChangeTolerance2: 0.25 + - _ColorChangeTolerance3: 0.25 + - _ColorRampBlend: 1 + - _ColorRampLuminosity: 0 + - _ColorRampOutline: 0 + - _ColorSwapBlend: 1 + - _ColorSwapBlueLuminosity: 0.5 + - _ColorSwapGreenLuminosity: 0.5 + - _ColorSwapRedLuminosity: 0.5 + - _Contrast: 1 + - _CullingOption: 0 + - _DistortAmount: 0.5 + - _DistortTexXSpeed: 5 + - _DistortTexYSpeed: 5 + - _EditorDrawers: 6 + - _FadeAmount: -0.1 + - _FadeBurnGlow: 2 + - _FadeBurnTransition: 0.075 + - _FadeBurnWidth: 0.025 + - _FishEyeUvAmount: 0.35 + - _FlickerAlpha: 0 + - _FlickerFreq: 0.2 + - _FlickerPercent: 0.05 + - _GhostBlend: 1 + - _GhostColorBoost: 1 + - _GhostTransparency: 0 + - _GlitchAmount: 3 + - _GlitchSize: 1 + - _Glow: 10 + - _GlowGlobal: 1 + - _GlowTexUsed: 0 + - _GradBlend: 1 + - _GradBoostX: 1.2 + - _GradBoostY: 1.2 + - _GradIsRadial: 0 + - _GrassManualAnim: 1 + - _GrassManualToggle: 0 + - _GrassRadialBend: 0.25 + - _GrassSpeed: 2 + - _GrassWind: 20 + - _GreyscaleBlend: 1 + - _GreyscaleLuminosity: 0 + - _GreyscaleOutline: 0 + - _HandDrawnAmount: 10 + - _HandDrawnSpeed: 5 + - _HitEffectBlend: 1 + - _HitEffectGlow: 5 + - _HologramBlend: 1 + - _HologramFlickerAlpha: 0 + - _HologramFlickerFreq: 0.2 + - _HologramMaxAlpha: 1 + - _HologramMinAlpha: 0 + - _HologramStripesAlpha: 0.4 + - _HologramStripesAmount: 50 + - _HologramStripesFill: 0.4 + - _HologramStripesLuminosity: 1 + - _HologramStripesSpeed: 5 + - _HologramUnmodAmount: 0.4 + - _HsvBright: 1 + - _HsvSaturation: 1 + - _HsvShift: 180 + - _InnerOutlineAlpha: 1 + - _InnerOutlineGlow: 1 + - _InnerOutlineThickness: 1 + - _MaxXUV: 1 + - _MaxYUV: 1 + - _MinXUV: 0 + - _MinYUV: 0 + - _MotionBlurAngle: 0.1 + - _MotionBlurDist: 1.25 + - _MyDstMode: 10 + - _MySrcMode: 5 + - _NegativeAmount: 1 + - _OffsetUvX: 0 + - _OffsetUvY: 0 + - _OnlyInnerOutline: 0 + - _OnlyOutline: 0 + - _Outline8Directions: 0 + - _OutlineAlpha: 1 + - _OutlineDistortAmount: 0.5 + - _OutlineDistortTexXSpeed: 5 + - _OutlineDistortTexYSpeed: 5 + - _OutlineDistortToggle: 0 + - _OutlineGlow: 1.5 + - _OutlineIsPixel: 0 + - _OutlinePixelWidth: 1 + - _OutlineTexGrey: 0 + - _OutlineTexToggle: 0 + - _OutlineTexXSpeed: 10 + - _OutlineTexYSpeed: 0 + - _OutlineWidth: 0.004 + - _OverlayBlend: 1 + - _OverlayGlow: 1 + - _OverlayTextureScrollXSpeed: 0.25 + - _OverlayTextureScrollYSpeed: 0.25 + - _PinchUvAmount: 0.35 + - _PixelateSize: 32 + - _PosterizeGamma: 0.75 + - _PosterizeNumColors: 8 + - _PosterizeOutline: 0 + - _RadialClip: 45 + - _RadialClip2: 45 + - _RadialClipAngle: 90 + - _RadialClipArc1: 45 + - _RadialClipArc2: 0 + - _RadialStartAngle: 90 + - _RandomSeed: 0 + - _RectSize: 1 + - _RotateUvAmount: 0 + - _RoundWaveSpeed: 2 + - _RoundWaveStrength: 0.7 + - _ShadowAlpha: 0.5 + - _ShadowX: 0.1 + - _ShadowY: -0.05 + - _ShakeUvSpeed: 2.5 + - _ShakeUvX: 1.5 + - _ShakeUvY: 1 + - _ShineGlow: 1 + - _ShineLocation: 0.5 + - _ShineRotate: 0 + - _ShineWidth: 0.1 + - _TextureScrollXSpeed: 1 + - _TextureScrollYSpeed: 0 + - _TwistUvAmount: 1 + - _TwistUvPosX: 0.5 + - _TwistUvPosY: 0.5 + - _TwistUvRadius: 0.75 + - _WarpScale: 0.5 + - _WarpSpeed: 8 + - _WarpStrength: 0.025 + - _WaveAmount: 7 + - _WaveSpeed: 10 + - _WaveStrength: 7.5 + - _WaveX: 0 + - _WaveY: 0.5 + - _ZTestMode: 4 + - _ZWrite: 0 + - _ZoomUvAmount: 0.5 + m_Colors: + - ColorSwapRed: {r: 1, g: 1, b: 1, a: 1} + - _AlphaOutlineColor: {r: 1, g: 1, b: 1, a: 1} + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _ColorChangeNewCol: {r: 1, g: 1, b: 0, a: 1} + - _ColorChangeNewCol2: {r: 1, g: 1, b: 0, a: 1} + - _ColorChangeNewCol3: {r: 1, g: 1, b: 0, a: 1} + - _ColorChangeTarget: {r: 1, g: 0, b: 0, a: 1} + - _ColorChangeTarget2: {r: 1, g: 0, b: 0, a: 1} + - _ColorChangeTarget3: {r: 1, g: 0, b: 0, a: 1} + - _ColorSwapBlue: {r: 1, g: 1, b: 1, a: 1} + - _ColorSwapGreen: {r: 1, g: 1, b: 1, a: 1} + - _ColorSwapRed: {r: 1, g: 1, b: 1, a: 1} + - _FadeBurnColor: {r: 1, g: 1, b: 0, a: 1} + - _GlowColor: {r: 1, g: 1, b: 1, a: 1} + - _GradBotLeftCol: {r: 0, g: 0, b: 1, a: 1} + - _GradBotRightCol: {r: 0, g: 0, b: 1, a: 1} + - _GradTopLeftCol: {r: 1, g: 0, b: 0, a: 1} + - _GradTopRightCol: {r: 1, g: 0, b: 0, a: 1} + - _GreyscaleTintColor: {r: 1, g: 1, b: 1, a: 1} + - _HitEffectColor: {r: 1, g: 1, b: 1, a: 1} + - _HologramStripeColor: {r: 1, g: 1, b: 1, a: 1} + - _InnerOutlineColor: {r: 1, g: 0, b: 0, a: 1} + - _OutlineColor: {r: 1, g: 1, b: 1, a: 1} + - _OverlayColor: {r: 1, g: 1, b: 1, a: 1} + - _ShadowColor: {r: 0, g: 0, b: 0, a: 1} + - _ShineColor: {r: 1, g: 1, b: 1, a: 1} +--- !u!1 &326244154 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 326244155} + - component: {fileID: 326244157} + - component: {fileID: 326244156} + m_Layer: 0 + m_Name: Obstacle + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &326244155 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 326244154} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: -0.74, z: -0.025} + m_LocalScale: {x: 0.14763856, y: 0.40729, z: 0.40729} + m_Children: [] + m_Father: {fileID: 1478122371} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &326244156 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 326244154} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: ee158225ee1e59f4791627785501d950, type: 3} + m_Name: + m_EditorClassIdentifier: + currentShaderType: 4 + normalStrength: 5 + normalSmoothing: 1 + computingNormal: 0 +--- !u!212 &326244157 +SpriteRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 326244154} + m_Enabled: 1 + m_CastShadows: 0 + m_ReceiveShadows: 0 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 212554433} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 0 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_Sprite: {fileID: 21300000, guid: cf7e1f6ebb800154db2b215cba9330ee, type: 3} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_FlipX: 0 + m_FlipY: 0 + m_DrawMode: 0 + m_Size: {x: 5.12, y: 5.12} + m_AdaptiveModeThreshold: 0.5 + m_SpriteTileMode: 0 + m_WasSpriteAssigned: 1 + m_MaskInteraction: 0 + m_SpriteSortPoint: 0 +--- !u!21 &327735240 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: AllIn1SpriteShader/AllIn1SpriteShader + m_Shader: {fileID: 4800000, guid: a36b7719ff0465b42ab1407d67672c5f, type: 3} + m_ShaderKeywords: BLUR_ON CLIPPING_ON CUSTOMBLENDING_ON DISTORT_ON ETC1_EXTERNAL_ALPHA + GLOW_ON WAVEUV_ON WIND_ON + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _ColorRampTex: + m_Texture: {fileID: 2800000, guid: 279657edc397ece4b8029c727adf6ddc, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ColorRampTexGradient: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ColorSwapTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DistortTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _FadeBurnTex: + m_Texture: {fileID: 2800000, guid: 677cca399782dea41aedc1d292ecb67d, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _FadeTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _GlowTex: + 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} + - _OutlineDistortTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OutlineTex: + m_Texture: {fileID: 2800000, guid: 74087f6d03f233e4a8a142fa01f9e5cf, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OverlayTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ShineMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - _Alpha: 1 + - _AlphaCutoffValue: 0.25 + - _AlphaOutlineBlend: 1 + - _AlphaOutlineGlow: 5 + - _AlphaOutlineMinAlpha: 0 + - _AlphaOutlinePower: 1 + - _AlphaRoundThreshold: 0.5 + - _BillboardY: 0 + - _BlurHD: 0 + - _BlurIntensity: 100 + - _Brightness: 0 + - _ChromAberrAlpha: 0.4 + - _ChromAberrAmount: 1 + - _ClipUvDown: 0 + - _ClipUvLeft: 0.03 + - _ClipUvRight: 0 + - _ClipUvUp: 0.042 + - _ColorChangeLuminosity: 0 + - _ColorChangeTolerance: 0.25 + - _ColorChangeTolerance2: 0.25 + - _ColorChangeTolerance3: 0.25 + - _ColorRampBlend: 1 + - _ColorRampLuminosity: 0 + - _ColorRampOutline: 0 + - _ColorSwapBlend: 1 + - _ColorSwapBlueLuminosity: 0.5 + - _ColorSwapGreenLuminosity: 0.5 + - _ColorSwapRedLuminosity: 0.5 + - _Contrast: 1 + - _CullingOption: 0 + - _DistortAmount: 0.81 + - _DistortTexXSpeed: -1 + - _DistortTexYSpeed: -5.9 + - _EditorDrawers: 6 + - _FadeAmount: -0.1 + - _FadeBurnGlow: 2 + - _FadeBurnTransition: 0.075 + - _FadeBurnWidth: 0.025 + - _FishEyeUvAmount: 0.35 + - _FlickerAlpha: 0 + - _FlickerFreq: 0.2 + - _FlickerPercent: 0.05 + - _GhostBlend: 1 + - _GhostColorBoost: 1 + - _GhostTransparency: 0 + - _GlitchAmount: 3 + - _GlitchSize: 1 + - _Glow: 7.7 + - _GlowGlobal: 1 + - _GlowTexUsed: 0 + - _GradBlend: 1 + - _GradBoostX: 1.2 + - _GradBoostY: 1.2 + - _GradIsRadial: 0 + - _GrassManualAnim: 1 + - _GrassManualToggle: 0 + - _GrassRadialBend: 0.25 + - _GrassSpeed: 5.7 + - _GrassWind: 5.2 + - _GreyscaleBlend: 1 + - _GreyscaleLuminosity: 0 + - _GreyscaleOutline: 0 + - _HandDrawnAmount: 10 + - _HandDrawnSpeed: 5 + - _HitEffectBlend: 1 + - _HitEffectGlow: 5 + - _HologramBlend: 1 + - _HologramMaxAlpha: 0.75 + - _HologramMinAlpha: 0.1 + - _HologramStripesAmount: 0.1 + - _HologramStripesSpeed: 4.5 + - _HologramUnmodAmount: 0 + - _HsvBright: 1 + - _HsvSaturation: 1 + - _HsvShift: 180 + - _InnerOutlineAlpha: 1 + - _InnerOutlineGlow: 1 + - _InnerOutlineThickness: 1 + - _MaxXUV: 1 + - _MaxYUV: 1 + - _MinXUV: 0 + - _MinYUV: 0 + - _MotionBlurAngle: 0.1 + - _MotionBlurDist: 1.25 + - _MyDstMode: 10 + - _MySrcMode: 5 + - _NegativeAmount: 1 + - _OffsetUvX: 0 + - _OffsetUvY: 0 + - _OnlyInnerOutline: 0 + - _OnlyOutline: 0 + - _Outline8Directions: 0 + - _OutlineAlpha: 1 + - _OutlineDistortAmount: 0.5 + - _OutlineDistortTexXSpeed: 5 + - _OutlineDistortTexYSpeed: 5 + - _OutlineDistortToggle: 0 + - _OutlineGlow: 1.5 + - _OutlineIsPixel: 0 + - _OutlinePixelWidth: 1 + - _OutlineTexGrey: 0 + - _OutlineTexToggle: 0 + - _OutlineTexXSpeed: 10 + - _OutlineTexYSpeed: 0 + - _OutlineWidth: 0.004 + - _OverlayBlend: 1 + - _OverlayGlow: 1 + - _OverlayTextureScrollXSpeed: 0.25 + - _OverlayTextureScrollYSpeed: 0.25 + - _PinchUvAmount: 0.35 + - _PixelateSize: 32 + - _PosterizeGamma: 0.75 + - _PosterizeNumColors: 8 + - _PosterizeOutline: 0 + - _RadialClipAngle: 90 + - _RadialClipArc1: 45 + - _RadialClipArc2: 0 + - _RandomSeed: 0 + - _RectSize: 1 + - _RotateUvAmount: 0 + - _RoundWaveSpeed: 2 + - _RoundWaveStrength: 0.7 + - _ShadowAlpha: 0.5 + - _ShadowX: 0.1 + - _ShadowY: -0.05 + - _ShakeUvSpeed: 2.5 + - _ShakeUvX: 1.5 + - _ShakeUvY: 1 + - _ShineGlow: 1 + - _ShineLocation: 0.5 + - _ShineRotate: 0 + - _ShineWidth: 0.1 + - _TextureScrollXSpeed: 1 + - _TextureScrollYSpeed: 0 + - _TwistUvAmount: 1 + - _TwistUvPosX: 0.5 + - _TwistUvPosY: 0.5 + - _TwistUvRadius: 0.75 + - _WarpScale: 0.5 + - _WarpSpeed: 8 + - _WarpStrength: 0.025 + - _WaveAmount: 7 + - _WaveSpeed: 10 + - _WaveStrength: 7.5 + - _WaveX: 0 + - _WaveY: 0.5 + - _ZTestMode: 4 + - _ZWrite: 0 + - _ZoomUvAmount: 0.5 + m_Colors: + - ColorSwapRed: {r: 1, g: 1, b: 1, a: 1} + - _AlphaOutlineColor: {r: 1, g: 1, b: 1, a: 1} + - _Color: {r: 1, g: 0.6775423, b: 0, a: 1} + - _ColorChangeNewCol: {r: 1, g: 1, b: 0, a: 1} + - _ColorChangeNewCol2: {r: 1, g: 1, b: 0, a: 1} + - _ColorChangeNewCol3: {r: 1, g: 1, b: 0, a: 1} + - _ColorChangeTarget: {r: 1, g: 0, b: 0, a: 1} + - _ColorChangeTarget2: {r: 1, g: 0, b: 0, a: 1} + - _ColorChangeTarget3: {r: 1, g: 0, b: 0, a: 1} + - _ColorSwapBlue: {r: 1, g: 1, b: 1, a: 1} + - _ColorSwapGreen: {r: 1, g: 1, b: 1, a: 1} + - _ColorSwapRed: {r: 1, g: 1, b: 1, a: 1} + - _FadeBurnColor: {r: 1, g: 1, b: 0, a: 1} + - _GlowColor: {r: 1, g: 0.047169805, b: 0.07456907, a: 1} + - _GradBotLeftCol: {r: 0, g: 0, b: 1, a: 1} + - _GradBotRightCol: {r: 0, g: 0, b: 1, a: 1} + - _GradTopLeftCol: {r: 1, g: 0, b: 0, a: 1} + - _GradTopRightCol: {r: 1, g: 0, b: 0, a: 1} + - _GreyscaleTintColor: {r: 1, g: 1, b: 1, a: 1} + - _HitEffectColor: {r: 1, g: 1, b: 1, a: 1} + - _HologramStripeColor: {r: 0, g: 1, b: 1, a: 1} + - _InnerOutlineColor: {r: 1, g: 0, b: 0, a: 1} + - _OutlineColor: {r: 1, g: 1, b: 1, a: 1} + - _OverlayColor: {r: 1, g: 1, b: 1, a: 1} + - _ShadowColor: {r: 0, g: 0, b: 0, a: 1} + - _ShineColor: {r: 1, g: 1, b: 1, a: 1} +--- !u!1 &337231024 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 337231025} + - component: {fileID: 337231027} + - component: {fileID: 337231026} + m_Layer: 0 + m_Name: Animated + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &337231025 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 337231024} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: -3.57, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 2082220742} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!102 &337231026 +TextMesh: + serializedVersion: 3 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 337231024} + m_Text: (Has Animation) + m_OffsetZ: -1.5 + m_CharacterSize: 0.075 + m_LineSpacing: 1 + m_Anchor: 4 + m_Alignment: 0 + m_TabSize: 4 + m_FontSize: 100 + m_FontStyle: 0 + m_RichText: 1 + m_Font: {fileID: 12800000, guid: a4e6a5491519adb45919dc87eff28e55, type: 3} + m_Color: + serializedVersion: 2 + rgba: 4294967295 +--- !u!23 &337231027 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 337231024} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 10100, guid: 0000000000000000e000000000000000, type: 0} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!1 &352221783 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 352221784} + - component: {fileID: 352221786} + - component: {fileID: 352221785} + m_Layer: 0 + m_Name: Animated + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 0 +--- !u!4 &352221784 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 352221783} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: -3.57, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 1434614528} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!102 &352221785 +TextMesh: + serializedVersion: 3 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 352221783} + m_Text: (Has Animation) + m_OffsetZ: -1.5 + m_CharacterSize: 0.075 + m_LineSpacing: 1 + m_Anchor: 4 + m_Alignment: 0 + m_TabSize: 4 + m_FontSize: 100 + m_FontStyle: 0 + m_RichText: 1 + m_Font: {fileID: 12800000, guid: a4e6a5491519adb45919dc87eff28e55, type: 3} + m_Color: + serializedVersion: 2 + rgba: 4294967295 +--- !u!23 &352221786 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 352221783} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: a4e6a5491519adb45919dc87eff28e55, type: 3} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!1 &353408738 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 353408739} + - component: {fileID: 353408742} + - component: {fileID: 353408741} + - component: {fileID: 353408743} + m_Layer: 0 + m_Name: Hallucination + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &353408739 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 353408738} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 110, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 69675091} + - {fileID: 684127073} + m_Father: {fileID: 1563905016} + m_RootOrder: 11 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &353408741 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 353408738} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 98b644315d7a92842b89e04f55c48e02, type: 3} + m_Name: + m_EditorClassIdentifier: +--- !u!212 &353408742 +SpriteRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 353408738} + m_Enabled: 1 + m_CastShadows: 0 + m_ReceiveShadows: 0 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2054684528} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 0 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_Sprite: {fileID: 21300000, guid: 519dafacd208bb64c83d5124be03b09d, type: 3} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_FlipX: 0 + m_FlipY: 0 + m_DrawMode: 0 + m_Size: {x: 5.12, y: 5.12} + m_AdaptiveModeThreshold: 0.5 + m_SpriteTileMode: 0 + m_WasSpriteAssigned: 1 + m_MaskInteraction: 0 + m_SpriteSortPoint: 0 +--- !u!95 &353408743 +Animator: + serializedVersion: 3 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 353408738} + m_Enabled: 1 + m_Avatar: {fileID: 0} + m_Controller: {fileID: 9100000, guid: 009a1cbada3894e4387ecb3a8a39e335, type: 2} + m_CullingMode: 0 + m_UpdateMode: 0 + m_ApplyRootMotion: 0 + m_LinearVelocityBlending: 0 + m_WarningMessage: + m_HasTransformHierarchy: 1 + m_AllowConstantClipSamplingOptimization: 1 + m_KeepAnimatorControllerStateOnDisable: 0 +--- !u!1 &355247222 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 355247223} + - component: {fileID: 355247225} + - component: {fileID: 355247224} + m_Layer: 0 + m_Name: Title + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &355247223 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 355247222} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: -2.51, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 1123731223} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!102 &355247224 +TextMesh: + serializedVersion: 3 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 355247222} + m_Text: Overlay Texture + m_OffsetZ: -1.5 + m_CharacterSize: 0.075 + m_LineSpacing: 1 + m_Anchor: 4 + m_Alignment: 0 + m_TabSize: 4 + m_FontSize: 100 + m_FontStyle: 0 + m_RichText: 1 + m_Font: {fileID: 12800000, guid: a4e6a5491519adb45919dc87eff28e55, type: 3} + m_Color: + serializedVersion: 2 + rgba: 4294967295 +--- !u!23 &355247225 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 355247222} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 10100, guid: 0000000000000000e000000000000000, type: 0} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!1 &356332865 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 356332866} + - component: {fileID: 356332869} + - component: {fileID: 356332868} + - component: {fileID: 356332867} + m_Layer: 5 + m_Name: Background + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &356332866 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 356332865} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 564363701} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &356332867 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 356332865} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: ee158225ee1e59f4791627785501d950, type: 3} + m_Name: + m_EditorClassIdentifier: + currentShaderType: 4 + normalStrength: 5 + normalSmoothing: 1 + computingNormal: 0 +--- !u!114 &356332868 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 356332865} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 1774554235} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 0 + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_Sprite: {fileID: 0} + m_Type: 0 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 + m_UseSpriteMesh: 0 + m_PixelsPerUnitMultiplier: 1 +--- !u!222 &356332869 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 356332865} + m_CullTransparentMesh: 0 +--- !u!1 &357954208 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 357954209} + - component: {fileID: 357954212} + - component: {fileID: 357954211} + m_Layer: 0 + m_Name: TwistedFace + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &357954209 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 357954208} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 260, y: 0, z: 0} + m_LocalScale: {x: 0.80276, y: 0.80276, z: 0.80276} + m_Children: + - {fileID: 2008035789} + - {fileID: 1869989730} + m_Father: {fileID: 1563905016} + m_RootOrder: 26 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &357954211 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 357954208} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 98b644315d7a92842b89e04f55c48e02, type: 3} + m_Name: + m_EditorClassIdentifier: +--- !u!212 &357954212 +SpriteRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 357954208} + m_Enabled: 1 + m_CastShadows: 0 + m_ReceiveShadows: 0 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 1349909629} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 0 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_Sprite: {fileID: 21300000, guid: 519dafacd208bb64c83d5124be03b09d, type: 3} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_FlipX: 0 + m_FlipY: 0 + m_DrawMode: 0 + m_Size: {x: 5.12, y: 5.12} + m_AdaptiveModeThreshold: 0.5 + m_SpriteTileMode: 0 + m_WasSpriteAssigned: 1 + m_MaskInteraction: 0 + m_SpriteSortPoint: 0 +--- !u!1 &361311994 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 361311995} + - component: {fileID: 361311998} + - component: {fileID: 361311997} + m_Layer: 0 + m_Name: Wind + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &361311995 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 361311994} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 20, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 2076635524} + - {fileID: 156196757} + m_Father: {fileID: 1351315063} + m_RootOrder: 2 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &361311997 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 361311994} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 98b644315d7a92842b89e04f55c48e02, type: 3} + m_Name: + m_EditorClassIdentifier: +--- !u!212 &361311998 +SpriteRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 361311994} + m_Enabled: 1 + m_CastShadows: 0 + m_ReceiveShadows: 0 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 183278329} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 0 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_Sprite: {fileID: 21300000, guid: 519dafacd208bb64c83d5124be03b09d, type: 3} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_FlipX: 0 + m_FlipY: 0 + m_DrawMode: 0 + m_Size: {x: 5.12, y: 5.12} + m_AdaptiveModeThreshold: 0.5 + m_SpriteTileMode: 0 + m_WasSpriteAssigned: 1 + m_MaskInteraction: 0 + m_SpriteSortPoint: 0 +--- !u!1 &367923810 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 367923811} + - component: {fileID: 367923813} + - component: {fileID: 367923812} + m_Layer: 0 + m_Name: Animated + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &367923811 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 367923810} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: -3.57, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 1050471976} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!102 &367923812 +TextMesh: + serializedVersion: 3 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 367923810} + m_Text: (Has Animation) + m_OffsetZ: -1.5 + m_CharacterSize: 0.075 + m_LineSpacing: 1 + m_Anchor: 4 + m_Alignment: 0 + m_TabSize: 4 + m_FontSize: 100 + m_FontStyle: 0 + m_RichText: 1 + m_Font: {fileID: 12800000, guid: a4e6a5491519adb45919dc87eff28e55, type: 3} + m_Color: + serializedVersion: 2 + rgba: 4294967295 +--- !u!23 &367923813 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 367923810} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 10100, guid: 0000000000000000e000000000000000, type: 0} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!1 &368348655 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 368348656} + - component: {fileID: 368348658} + - component: {fileID: 368348659} + m_Layer: 0 + m_Name: Ghost + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &368348656 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 368348655} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 220, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 1471800765} + - {fileID: 42378787} + m_Father: {fileID: 2036092933} + m_RootOrder: 22 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!212 &368348658 +SpriteRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 368348655} + m_Enabled: 1 + m_CastShadows: 0 + m_ReceiveShadows: 0 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 150333392} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 0 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_Sprite: {fileID: 21300000, guid: 519dafacd208bb64c83d5124be03b09d, type: 3} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_FlipX: 0 + m_FlipY: 0 + m_DrawMode: 0 + m_Size: {x: 5.12, y: 5.12} + m_AdaptiveModeThreshold: 0.5 + m_SpriteTileMode: 0 + m_WasSpriteAssigned: 1 + m_MaskInteraction: 0 + m_SpriteSortPoint: 0 +--- !u!114 &368348659 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 368348655} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 98b644315d7a92842b89e04f55c48e02, type: 3} + m_Name: + m_EditorClassIdentifier: +--- !u!1 &376742881 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 376742882} + - component: {fileID: 376742884} + - component: {fileID: 376742883} + m_Layer: 0 + m_Name: Animated + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 0 +--- !u!4 &376742882 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 376742881} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: -3.57, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 1813870144} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!102 &376742883 +TextMesh: + serializedVersion: 3 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 376742881} + m_Text: (Has Animation) + m_OffsetZ: -1.5 + m_CharacterSize: 0.075 + m_LineSpacing: 1 + m_Anchor: 4 + m_Alignment: 0 + m_TabSize: 4 + m_FontSize: 100 + m_FontStyle: 0 + m_RichText: 1 + m_Font: {fileID: 12800000, guid: a4e6a5491519adb45919dc87eff28e55, type: 3} + m_Color: + serializedVersion: 2 + rgba: 4294967295 +--- !u!23 &376742884 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 376742881} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: a4e6a5491519adb45919dc87eff28e55, type: 3} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!1 &396641005 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 396641006} + - component: {fileID: 396641008} + - component: {fileID: 396641007} + m_Layer: 0 + m_Name: Title + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &396641006 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 396641005} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: -2.51, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 1934762264} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!102 &396641007 +TextMesh: + serializedVersion: 3 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 396641005} + m_Text: Burn + m_OffsetZ: -1.5 + m_CharacterSize: 0.075 + m_LineSpacing: 1 + m_Anchor: 4 + m_Alignment: 0 + m_TabSize: 4 + m_FontSize: 100 + m_FontStyle: 0 + m_RichText: 1 + m_Font: {fileID: 12800000, guid: a4e6a5491519adb45919dc87eff28e55, type: 3} + m_Color: + serializedVersion: 2 + rgba: 4294967295 +--- !u!23 &396641008 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 396641005} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 10100, guid: 0000000000000000e000000000000000, type: 0} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!1 &401883083 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 401883084} + - component: {fileID: 401883086} + - component: {fileID: 401883085} + m_Layer: 0 + m_Name: Title + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &401883084 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 401883083} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: -2.51, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 471382084} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!102 &401883085 +TextMesh: + serializedVersion: 3 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 401883083} + m_Text: Inner Outline + m_OffsetZ: -1.5 + m_CharacterSize: 0.075 + m_LineSpacing: 1 + m_Anchor: 4 + m_Alignment: 0 + m_TabSize: 4 + m_FontSize: 100 + m_FontStyle: 0 + m_RichText: 1 + m_Font: {fileID: 12800000, guid: a4e6a5491519adb45919dc87eff28e55, type: 3} + m_Color: + serializedVersion: 2 + rgba: 4294967295 +--- !u!23 &401883086 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 401883083} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 10100, guid: 0000000000000000e000000000000000, type: 0} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!1 &407134449 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 407134450} + - component: {fileID: 407134453} + - component: {fileID: 407134452} + - component: {fileID: 407134451} + m_Layer: 0 + m_Name: Doodle + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &407134450 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 407134449} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 230, y: 0, z: 0} + m_LocalScale: {x: 0.80276, y: 0.80276, z: 0.80276} + m_Children: + - {fileID: 98126758} + - {fileID: 415056644} + m_Father: {fileID: 1563905016} + m_RootOrder: 23 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &407134451 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 407134449} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: ee158225ee1e59f4791627785501d950, type: 3} + m_Name: + m_EditorClassIdentifier: + currentShaderType: 4 + normalStrength: 5 + normalSmoothing: 1 + computingNormal: 0 +--- !u!212 &407134452 +SpriteRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 407134449} + m_Enabled: 1 + m_CastShadows: 0 + m_ReceiveShadows: 0 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 1459191230} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 0 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_Sprite: {fileID: 21300000, guid: 73d3cc63327012249b4f98eb9289311d, type: 3} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_FlipX: 0 + m_FlipY: 0 + m_DrawMode: 0 + m_Size: {x: 5.12, y: 5.12} + m_AdaptiveModeThreshold: 0.5 + m_SpriteTileMode: 0 + m_WasSpriteAssigned: 1 + m_MaskInteraction: 0 + m_SpriteSortPoint: 0 +--- !u!114 &407134453 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 407134449} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 98b644315d7a92842b89e04f55c48e02, type: 3} + m_Name: + m_EditorClassIdentifier: +--- !u!1 &409423830 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 409423831} + - component: {fileID: 409423832} + m_Layer: 0 + m_Name: Mask + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &409423831 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 409423830} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 3.2125397, y: 4.672785, z: 4.672785} + m_Children: [] + m_Father: {fileID: 1756331349} + m_RootOrder: 2 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!331 &409423832 +SpriteMask: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 409423830} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 10758, guid: 0000000000000000f000000000000000, type: 0} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_Sprite: {fileID: 21300000, guid: 4b40fc0f65c85f14fbc9c7c5f40ca686, type: 3} + m_MaskAlphaCutoff: 0.2 + m_FrontSortingLayerID: 0 + m_BackSortingLayerID: 0 + m_FrontSortingLayer: 0 + m_BackSortingLayer: 0 + m_FrontSortingOrder: 0 + m_BackSortingOrder: 0 + m_IsCustomRangeActive: 0 + m_SpriteSortPoint: 0 +--- !u!1 &415056643 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 415056644} + - component: {fileID: 415056646} + - component: {fileID: 415056645} + m_Layer: 0 + m_Name: Animated + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 0 +--- !u!4 &415056644 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 415056643} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: -4.447157, z: 0} + m_LocalScale: {x: 1.2457023, y: 1.2457023, z: 1.2457023} + m_Children: [] + m_Father: {fileID: 407134450} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!102 &415056645 +TextMesh: + serializedVersion: 3 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 415056643} + m_Text: (Has Animation) + m_OffsetZ: -1.5 + m_CharacterSize: 0.075 + m_LineSpacing: 1 + m_Anchor: 4 + m_Alignment: 0 + m_TabSize: 4 + m_FontSize: 100 + m_FontStyle: 0 + m_RichText: 1 + m_Font: {fileID: 12800000, guid: a4e6a5491519adb45919dc87eff28e55, type: 3} + m_Color: + serializedVersion: 2 + rgba: 4294967295 +--- !u!23 &415056646 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 415056643} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: a4e6a5491519adb45919dc87eff28e55, type: 3} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!4 &419407226 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 419407227} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 40, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 849687025} + - {fileID: 846281939} + m_Father: {fileID: 2036092933} + m_RootOrder: 4 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &419407227 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 419407226} + - component: {fileID: 419407229} + - component: {fileID: 419407230} + m_Layer: 0 + m_Name: Outline2 + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!212 &419407229 +SpriteRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 419407227} + m_Enabled: 1 + m_CastShadows: 0 + m_ReceiveShadows: 0 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 313393139} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 0 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_Sprite: {fileID: 21300000, guid: 519dafacd208bb64c83d5124be03b09d, type: 3} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_FlipX: 0 + m_FlipY: 0 + m_DrawMode: 0 + m_Size: {x: 5.12, y: 5.12} + m_AdaptiveModeThreshold: 0.5 + m_SpriteTileMode: 0 + m_WasSpriteAssigned: 1 + m_MaskInteraction: 0 + m_SpriteSortPoint: 0 +--- !u!114 &419407230 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 419407227} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 98b644315d7a92842b89e04f55c48e02, type: 3} + m_Name: + m_EditorClassIdentifier: +--- !u!1 &419511669 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 419511670} + - component: {fileID: 419511672} + - component: {fileID: 419511671} + m_Layer: 0 + m_Name: Animated + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 0 +--- !u!4 &419511670 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 419511669} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: -4.447157, z: 0} + m_LocalScale: {x: 1.2457023, y: 1.2457023, z: 1.2457023} + m_Children: [] + m_Father: {fileID: 584220654} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!102 &419511671 +TextMesh: + serializedVersion: 3 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 419511669} + m_Text: (Has Animation) + m_OffsetZ: -1.5 + m_CharacterSize: 0.075 + m_LineSpacing: 1 + m_Anchor: 4 + m_Alignment: 0 + m_TabSize: 4 + m_FontSize: 100 + m_FontStyle: 0 + m_RichText: 1 + m_Font: {fileID: 12800000, guid: a4e6a5491519adb45919dc87eff28e55, type: 3} + m_Color: + serializedVersion: 2 + rgba: 4294967295 +--- !u!23 &419511672 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 419511669} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: a4e6a5491519adb45919dc87eff28e55, type: 3} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!1 &420059980 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 420059981} + - component: {fileID: 420059983} + - component: {fileID: 420059984} + m_Layer: 0 + m_Name: Shadow + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &420059981 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 420059980} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 270, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 168046141} + - {fileID: 820886078} + m_Father: {fileID: 2036092933} + m_RootOrder: 27 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!212 &420059983 +SpriteRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 420059980} + m_Enabled: 1 + m_CastShadows: 0 + m_ReceiveShadows: 0 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 1105303541} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 0 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_Sprite: {fileID: 21300000, guid: 519dafacd208bb64c83d5124be03b09d, type: 3} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_FlipX: 0 + m_FlipY: 0 + m_DrawMode: 0 + m_Size: {x: 5.12, y: 5.12} + m_AdaptiveModeThreshold: 0.5 + m_SpriteTileMode: 0 + m_WasSpriteAssigned: 1 + m_MaskInteraction: 0 + m_SpriteSortPoint: 0 +--- !u!114 &420059984 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 420059980} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 98b644315d7a92842b89e04f55c48e02, type: 3} + m_Name: + m_EditorClassIdentifier: +--- !u!1 &427761888 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 427761889} + - component: {fileID: 427761891} + - component: {fileID: 427761890} + m_Layer: 0 + m_Name: Animated + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 0 +--- !u!4 &427761889 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 427761888} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: -3.57, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 1931308735} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!102 &427761890 +TextMesh: + serializedVersion: 3 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 427761888} + m_Text: (Has Animation) + m_OffsetZ: -1.5 + m_CharacterSize: 0.075 + m_LineSpacing: 1 + m_Anchor: 4 + m_Alignment: 0 + m_TabSize: 4 + m_FontSize: 100 + m_FontStyle: 0 + m_RichText: 1 + m_Font: {fileID: 12800000, guid: a4e6a5491519adb45919dc87eff28e55, type: 3} + m_Color: + serializedVersion: 2 + rgba: 4294967295 +--- !u!23 &427761891 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 427761888} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: a4e6a5491519adb45919dc87eff28e55, type: 3} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!21 &430987701 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: AllIn1SpriteShader/AllIn1SpriteShader + m_Shader: {fileID: 4800000, guid: a36b7719ff0465b42ab1407d67672c5f, type: 3} + m_ShaderKeywords: BLUR_ON ETC1_EXTERNAL_ALPHA HITEFFECT_ON OUTBASE8DIR_ON _OUTLINE8DIRECTIONS_ON + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _ColorRampTex: + m_Texture: {fileID: 2800000, guid: 279657edc397ece4b8029c727adf6ddc, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ColorRampTexGradient: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ColorSwapTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DistortTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _FadeBurnTex: + m_Texture: {fileID: 2800000, guid: 677cca399782dea41aedc1d292ecb67d, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _FadeTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _GlowTex: + 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} + - _OutlineDistortTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OutlineTex: + m_Texture: {fileID: 2800000, guid: 74087f6d03f233e4a8a142fa01f9e5cf, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OverlayTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ShineMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - _Alpha: 1 + - _AlphaCutoffValue: 0.25 + - _AlphaOutlineBlend: 1 + - _AlphaOutlineGlow: 5 + - _AlphaOutlineMinAlpha: 0 + - _AlphaOutlinePower: 1 + - _AlphaRoundThreshold: 0.5 + - _BillboardY: 0 + - _BlurHD: 0 + - _BlurIntensity: 10 + - _Brightness: 0 + - _ChromAberrAlpha: 0.4 + - _ChromAberrAmount: 1 + - _ClipUvDown: 0 + - _ClipUvLeft: 0 + - _ClipUvRight: 0 + - _ClipUvUp: 0 + - _ColorChangeLuminosity: 0 + - _ColorChangeTolerance: 0.25 + - _ColorChangeTolerance2: 0.25 + - _ColorChangeTolerance3: 0.25 + - _ColorRampBlend: 1 + - _ColorRampLuminosity: 0 + - _ColorRampOutline: 0 + - _ColorSwapBlend: 1 + - _ColorSwapBlueLuminosity: 0.5 + - _ColorSwapGreenLuminosity: 0.5 + - _ColorSwapRedLuminosity: 0.5 + - _Contrast: 1 + - _CullingOption: 0 + - _DistortAmount: 0.5 + - _DistortTexXSpeed: 5 + - _DistortTexYSpeed: 5 + - _EditorDrawers: 6 + - _FadeAmount: -0.1 + - _FadeBurnGlow: 2 + - _FadeBurnTransition: 0.075 + - _FadeBurnWidth: 0.025 + - _FishEyeUvAmount: 0.35 + - _FlickerAlpha: 0 + - _FlickerFreq: 0.2 + - _FlickerPercent: 0.05 + - _GhostBlend: 1 + - _GhostColorBoost: 1 + - _GhostTransparency: 0 + - _GlitchAmount: 3 + - _GlitchSize: 1 + - _Glow: 10 + - _GlowGlobal: 1 + - _GlowTexUsed: 0 + - _GradBlend: 1 + - _GradBoostX: 1.2 + - _GradBoostY: 1.2 + - _GradIsRadial: 0 + - _GrassManualAnim: 1 + - _GrassManualToggle: 0 + - _GrassRadialBend: 0.1 + - _GrassSpeed: 2 + - _GrassWind: 20 + - _GreyscaleBlend: 1 + - _GreyscaleLuminosity: 0 + - _GreyscaleOutline: 0 + - _HandDrawnAmount: 10 + - _HandDrawnSpeed: 5 + - _HitEffectBlend: 1 + - _HitEffectGlow: 6.8 + - _HologramBlend: 1 + - _HologramMaxAlpha: 0.75 + - _HologramMinAlpha: 0.1 + - _HologramStripesAmount: 0.1 + - _HologramStripesSpeed: 4.5 + - _HologramUnmodAmount: 0 + - _HsvBright: 1 + - _HsvSaturation: 1 + - _HsvShift: 193 + - _InnerOutlineAlpha: 1 + - _InnerOutlineGlow: 1 + - _InnerOutlineThickness: 1 + - _MaxXUV: 1 + - _MaxYUV: 1 + - _MinXUV: 0 + - _MinYUV: 0 + - _MotionBlurAngle: 0.1 + - _MotionBlurDist: 1.25 + - _MyDstMode: 10 + - _MySrcMode: 5 + - _NegativeAmount: 1 + - _OffsetUvX: 0 + - _OffsetUvY: 0 + - _OnlyInnerOutline: 0 + - _OnlyOutline: 0 + - _Outline8Directions: 1 + - _OutlineAlpha: 1 + - _OutlineDistortAmount: 0.5 + - _OutlineDistortTexXSpeed: 5 + - _OutlineDistortTexYSpeed: 5 + - _OutlineDistortToggle: 0 + - _OutlineGlow: 1.5 + - _OutlineIsPixel: 0 + - _OutlinePixelWidth: 1 + - _OutlineTexGrey: 0 + - _OutlineTexToggle: 0 + - _OutlineTexXSpeed: 10 + - _OutlineTexYSpeed: 0 + - _OutlineWidth: 0.091 + - _OverlayBlend: 1 + - _OverlayGlow: 1 + - _OverlayTextureScrollXSpeed: 0.25 + - _OverlayTextureScrollYSpeed: 0.25 + - _PinchUvAmount: 0.35 + - _PixelateSize: 32 + - _PosterizeGamma: 0.75 + - _PosterizeNumColors: 8 + - _PosterizeOutline: 0 + - _RadialClip: 45 + - _RadialClip2: 0 + - _RadialClipAngle: 90 + - _RadialClipArc1: 45 + - _RadialClipArc2: 0 + - _RadialStartAngle: 90 + - _RandomSeed: 0 + - _RectSize: 1 + - _RotateUvAmount: 0 + - _RoundWaveSpeed: 2 + - _RoundWaveStrength: 0.7 + - _ShadowAlpha: 0.5 + - _ShadowX: 0.1 + - _ShadowY: -0.05 + - _ShakeUvSpeed: 2.5 + - _ShakeUvX: 1.5 + - _ShakeUvY: 1 + - _ShineGlow: 1 + - _ShineLocation: 0.5 + - _ShineRotate: 0 + - _ShineWidth: 0.1 + - _TextureScrollXSpeed: 1 + - _TextureScrollYSpeed: 0 + - _TwistUvAmount: 1 + - _TwistUvPosX: 0.5 + - _TwistUvPosY: 0.5 + - _TwistUvRadius: 0.75 + - _WarpScale: 0.5 + - _WarpSpeed: 8 + - _WarpStrength: 0.025 + - _WaveAmount: 7 + - _WaveSpeed: 10 + - _WaveStrength: 7.5 + - _WaveX: 0 + - _WaveY: 0.5 + - _ZTestMode: 4 + - _ZWrite: 0 + - _ZoomUvAmount: 0.5 + m_Colors: + - ColorSwapRed: {r: 1, g: 1, b: 1, a: 1} + - _AlphaOutlineColor: {r: 1, g: 1, b: 1, a: 1} + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _ColorChangeNewCol: {r: 1, g: 1, b: 0, a: 1} + - _ColorChangeNewCol2: {r: 1, g: 1, b: 0, a: 1} + - _ColorChangeNewCol3: {r: 1, g: 1, b: 0, a: 1} + - _ColorChangeTarget: {r: 1, g: 0, b: 0, a: 1} + - _ColorChangeTarget2: {r: 1, g: 0, b: 0, a: 1} + - _ColorChangeTarget3: {r: 1, g: 0, b: 0, a: 1} + - _ColorSwapBlue: {r: 1, g: 1, b: 1, a: 1} + - _ColorSwapGreen: {r: 1, g: 1, b: 1, a: 1} + - _ColorSwapRed: {r: 1, g: 1, b: 1, a: 1} + - _FadeBurnColor: {r: 1, g: 1, b: 0, a: 1} + - _GlowColor: {r: 1, g: 1, b: 1, a: 1} + - _GradBotLeftCol: {r: 0, g: 0, b: 1, a: 1} + - _GradBotRightCol: {r: 0, g: 0, b: 1, a: 1} + - _GradTopLeftCol: {r: 1, g: 0, b: 0, a: 1} + - _GradTopRightCol: {r: 1, g: 0, b: 0, a: 1} + - _GreyscaleTintColor: {r: 1, g: 1, b: 1, a: 1} + - _HitEffectColor: {r: 0.46328974, g: 0, b: 1, a: 1} + - _HologramStripeColor: {r: 0, g: 1, b: 1, a: 1} + - _InnerOutlineColor: {r: 1, g: 0, b: 0, a: 1} + - _OutlineColor: {r: 1, g: 1, b: 1, a: 1} + - _OverlayColor: {r: 1, g: 1, b: 1, a: 1} + - _ShadowColor: {r: 0, g: 0, b: 0, a: 1} + - _ShineColor: {r: 1, g: 1, b: 1, a: 1} +--- !u!1 &435111025 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 435111026} + - component: {fileID: 435111028} + - component: {fileID: 435111027} + m_Layer: 0 + m_Name: Outline3 + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &435111026 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 435111025} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: -0.11, y: -0.66, z: 0.05} + m_LocalScale: {x: 1.0657709, y: 1.0657709, z: 1.0657709} + m_Children: [] + m_Father: {fileID: 1415143267} + m_RootOrder: 5 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &435111027 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 435111025} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: ee158225ee1e59f4791627785501d950, type: 3} + m_Name: + m_EditorClassIdentifier: + currentShaderType: 4 + normalStrength: 5 + normalSmoothing: 1 + computingNormal: 0 +--- !u!212 &435111028 +SpriteRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 435111025} + m_Enabled: 1 + m_CastShadows: 0 + m_ReceiveShadows: 0 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: 2fff2435ee99439438c463e2ce768283, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 0 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_Sprite: {fileID: 21300000, guid: 519dafacd208bb64c83d5124be03b09d, type: 3} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_FlipX: 0 + m_FlipY: 0 + m_DrawMode: 0 + m_Size: {x: 5.12, y: 5.12} + m_AdaptiveModeThreshold: 0.5 + m_SpriteTileMode: 0 + m_WasSpriteAssigned: 1 + m_MaskInteraction: 0 + m_SpriteSortPoint: 0 +--- !u!1 &437846755 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 437846756} + - component: {fileID: 437846758} + - component: {fileID: 437846757} + m_Layer: 0 + m_Name: Title + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &437846756 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 437846755} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: -3.1267126, z: 0} + m_LocalScale: {x: 1.2457023, y: 1.2457023, z: 1.2457023} + m_Children: [] + m_Father: {fileID: 42135250} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!102 &437846757 +TextMesh: + serializedVersion: 3 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 437846755} + m_Text: Spooky Soldier + m_OffsetZ: -1.5 + m_CharacterSize: 0.075 + m_LineSpacing: 1 + m_Anchor: 4 + m_Alignment: 0 + m_TabSize: 4 + m_FontSize: 100 + m_FontStyle: 0 + m_RichText: 1 + m_Font: {fileID: 12800000, guid: a4e6a5491519adb45919dc87eff28e55, type: 3} + m_Color: + serializedVersion: 2 + rgba: 4294967295 +--- !u!23 &437846758 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 437846755} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 10100, guid: 0000000000000000e000000000000000, type: 0} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!1 &443722313 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 443722314} + - component: {fileID: 443722316} + - component: {fileID: 443722315} + m_Layer: 0 + m_Name: Title + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &443722314 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 443722313} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: -2.51, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 1931308735} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!102 &443722315 +TextMesh: + serializedVersion: 3 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 443722313} + m_Text: Color Swap + m_OffsetZ: -1.5 + m_CharacterSize: 0.075 + m_LineSpacing: 1 + m_Anchor: 4 + m_Alignment: 0 + m_TabSize: 4 + m_FontSize: 100 + m_FontStyle: 0 + m_RichText: 1 + m_Font: {fileID: 12800000, guid: a4e6a5491519adb45919dc87eff28e55, type: 3} + m_Color: + serializedVersion: 2 + rgba: 4294967295 +--- !u!23 &443722316 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 443722313} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 10100, guid: 0000000000000000e000000000000000, type: 0} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!1 &443772010 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 443772011} + - component: {fileID: 443772014} + - component: {fileID: 443772013} + m_Layer: 0 + m_Name: Texture Scroll + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &443772011 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 443772010} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 80, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 1618143722} + - {fileID: 1939042051} + m_Father: {fileID: 1351315063} + m_RootOrder: 8 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &443772013 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 443772010} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 98b644315d7a92842b89e04f55c48e02, type: 3} + m_Name: + m_EditorClassIdentifier: +--- !u!212 &443772014 +SpriteRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 443772010} + m_Enabled: 1 + m_CastShadows: 0 + m_ReceiveShadows: 0 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 1230234141} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 0 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_Sprite: {fileID: 21300000, guid: 519dafacd208bb64c83d5124be03b09d, type: 3} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_FlipX: 0 + m_FlipY: 0 + m_DrawMode: 0 + m_Size: {x: 5.12, y: 5.12} + m_AdaptiveModeThreshold: 0.5 + m_SpriteTileMode: 0 + m_WasSpriteAssigned: 1 + m_MaskInteraction: 0 + m_SpriteSortPoint: 0 +--- !u!1 &450696183 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 450696184} + - component: {fileID: 450696188} + - component: {fileID: 450696185} + - component: {fileID: 450696187} + m_Layer: 0 + m_Name: Procedural Soldier + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &450696184 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 450696183} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 290, y: 0, z: 0} + m_LocalScale: {x: 0.80276, y: 0.80276, z: 0.80276} + m_Children: + - {fileID: 1727216260} + - {fileID: 746778958} + m_Father: {fileID: 1563905016} + m_RootOrder: 29 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &450696185 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 450696183} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 4ef3964599ee48c4ea5a4ecf012ed949, type: 3} + m_Name: + m_EditorClassIdentifier: +--- !u!114 &450696187 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 450696183} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 98b644315d7a92842b89e04f55c48e02, type: 3} + m_Name: + m_EditorClassIdentifier: +--- !u!212 &450696188 +SpriteRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 450696183} + m_Enabled: 1 + m_CastShadows: 0 + m_ReceiveShadows: 0 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2066467196} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 0 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_Sprite: {fileID: 21300000, guid: 519dafacd208bb64c83d5124be03b09d, type: 3} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_FlipX: 0 + m_FlipY: 0 + m_DrawMode: 0 + m_Size: {x: 5.12, y: 5.12} + m_AdaptiveModeThreshold: 0.5 + m_SpriteTileMode: 0 + m_WasSpriteAssigned: 1 + m_MaskInteraction: 0 + m_SpriteSortPoint: 0 +--- !u!21 &453643567 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: AllIn1SpriteShader/AllIn1SpriteShader + m_Shader: {fileID: 4800000, guid: a36b7719ff0465b42ab1407d67672c5f, type: 3} + m_ShaderKeywords: ETC1_EXTERNAL_ALPHA ONLYOUTLINE_ON OUTBASE8DIR_ON OUTBASE_ON + _ONLYOUTLINE_ON _OUTLINE8DIRECTIONS_ON + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _ColorRampTex: + m_Texture: {fileID: 2800000, guid: 279657edc397ece4b8029c727adf6ddc, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ColorRampTexGradient: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ColorSwapTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DistortTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _FadeBurnTex: + m_Texture: {fileID: 2800000, guid: 677cca399782dea41aedc1d292ecb67d, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _FadeTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _GlowTex: + 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} + - _OutlineDistortTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OutlineTex: + m_Texture: {fileID: 2800000, guid: 74087f6d03f233e4a8a142fa01f9e5cf, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OverlayTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ShineMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - _Alpha: 1 + - _AlphaCutoffValue: 0.25 + - _AlphaOutlineBlend: 1 + - _AlphaOutlineGlow: 5 + - _AlphaOutlineMinAlpha: 0 + - _AlphaOutlinePower: 1 + - _AlphaRoundThreshold: 0.5 + - _BillboardY: 0 + - _BlurHD: 0 + - _BlurIntensity: 10 + - _Brightness: 0 + - _ChromAberrAlpha: 0.4 + - _ChromAberrAmount: 1 + - _ClipUvDown: 0 + - _ClipUvLeft: 0 + - _ClipUvRight: 0 + - _ClipUvUp: 0 + - _ColorChangeLuminosity: 0 + - _ColorChangeTolerance: 0.25 + - _ColorChangeTolerance2: 0.25 + - _ColorChangeTolerance3: 0.25 + - _ColorRampBlend: 1 + - _ColorRampLuminosity: 0 + - _ColorRampOutline: 0 + - _ColorSwapBlend: 1 + - _ColorSwapBlueLuminosity: 0.5 + - _ColorSwapGreenLuminosity: 0.5 + - _ColorSwapRedLuminosity: 0.5 + - _Contrast: 1 + - _CullingOption: 0 + - _DistortAmount: 0.5 + - _DistortTexXSpeed: 5 + - _DistortTexYSpeed: 5 + - _EditorDrawers: 6 + - _FadeAmount: -0.1 + - _FadeBurnGlow: 2 + - _FadeBurnTransition: 0.075 + - _FadeBurnWidth: 0.025 + - _FishEyeUvAmount: 0.35 + - _FlickerAlpha: 0 + - _FlickerFreq: 0.2 + - _FlickerPercent: 0.05 + - _GhostBlend: 1 + - _GhostColorBoost: 1 + - _GhostTransparency: 0 + - _GlitchAmount: 3 + - _GlitchSize: 1 + - _Glow: 10 + - _GlowGlobal: 1 + - _GlowTexUsed: 0 + - _GradBlend: 1 + - _GradBoostX: 1.2 + - _GradBoostY: 1.2 + - _GradIsRadial: 0 + - _GrassManualAnim: 1 + - _GrassManualToggle: 0 + - _GrassRadialBend: 0.1 + - _GrassSpeed: 2 + - _GrassWind: 20 + - _GreyscaleBlend: 1 + - _GreyscaleLuminosity: 0 + - _GreyscaleOutline: 0 + - _HandDrawnAmount: 10 + - _HandDrawnSpeed: 5 + - _HitEffectBlend: 1 + - _HitEffectGlow: 5 + - _HologramBlend: 1 + - _HologramMaxAlpha: 1 + - _HologramMinAlpha: 0 + - _HologramStripesAlpha: 0.4 + - _HologramStripesAmount: 50 + - _HologramStripesFill: 0.4 + - _HologramStripesLuminosity: 1 + - _HologramStripesSpeed: 5 + - _HologramUnmodAmount: 0.4 + - _HsvBright: 1 + - _HsvSaturation: 1 + - _HsvShift: 180 + - _InnerOutlineAlpha: 1 + - _InnerOutlineGlow: 1 + - _InnerOutlineThickness: 1 + - _MaxXUV: 1 + - _MaxYUV: 1 + - _MinXUV: 0 + - _MinYUV: 0 + - _MotionBlurAngle: 0.1 + - _MotionBlurDist: 1.25 + - _MyDstMode: 10 + - _MySrcMode: 5 + - _NegativeAmount: 1 + - _OffsetUvX: 0 + - _OffsetUvY: 0 + - _OnlyInnerOutline: 0 + - _OnlyOutline: 1 + - _Outline8Directions: 1 + - _OutlineAlpha: 1 + - _OutlineDistortAmount: 0.5 + - _OutlineDistortTexXSpeed: 5 + - _OutlineDistortTexYSpeed: 5 + - _OutlineDistortToggle: 0 + - _OutlineGlow: 1.5 + - _OutlineIsPixel: 0 + - _OutlinePixelWidth: 1 + - _OutlineTexGrey: 0 + - _OutlineTexToggle: 0 + - _OutlineTexXSpeed: 10 + - _OutlineTexYSpeed: 0 + - _OutlineWidth: 0.012 + - _OverlayBlend: 1 + - _OverlayGlow: 1 + - _OverlayTextureScrollXSpeed: 0.25 + - _OverlayTextureScrollYSpeed: 0.25 + - _PinchUvAmount: 0.35 + - _PixelateSize: 32 + - _PosterizeGamma: 0.75 + - _PosterizeNumColors: 8 + - _PosterizeOutline: 0 + - _RadialClipAngle: 90 + - _RadialClipArc1: 45 + - _RadialClipArc2: 0 + - _RandomSeed: 0 + - _RectSize: 1 + - _RotateUvAmount: 0 + - _RoundWaveSpeed: 2 + - _RoundWaveStrength: 0.7 + - _ShadowAlpha: 0.5 + - _ShadowX: 0.1 + - _ShadowY: -0.05 + - _ShakeUvSpeed: 2.5 + - _ShakeUvX: 1.5 + - _ShakeUvY: 1 + - _ShineGlow: 1 + - _ShineLocation: 0.5 + - _ShineRotate: 0 + - _ShineWidth: 0.1 + - _TextureScrollXSpeed: 1 + - _TextureScrollYSpeed: 0 + - _TwistUvAmount: 1 + - _TwistUvPosX: 0.5 + - _TwistUvPosY: 0.5 + - _TwistUvRadius: 0.75 + - _WarpScale: 0.5 + - _WarpSpeed: 8 + - _WarpStrength: 0.025 + - _WaveAmount: 7 + - _WaveSpeed: 10 + - _WaveStrength: 7.5 + - _WaveX: 0 + - _WaveY: 0.5 + - _ZTestMode: 4 + - _ZWrite: 0 + - _ZoomUvAmount: 0.5 + m_Colors: + - ColorSwapRed: {r: 1, g: 1, b: 1, a: 1} + - _AlphaOutlineColor: {r: 1, g: 1, b: 1, a: 1} + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _ColorChangeNewCol: {r: 1, g: 1, b: 0, a: 1} + - _ColorChangeNewCol2: {r: 1, g: 1, b: 0, a: 1} + - _ColorChangeNewCol3: {r: 1, g: 1, b: 0, a: 1} + - _ColorChangeTarget: {r: 1, g: 0, b: 0, a: 1} + - _ColorChangeTarget2: {r: 1, g: 0, b: 0, a: 1} + - _ColorChangeTarget3: {r: 1, g: 0, b: 0, a: 1} + - _ColorSwapBlue: {r: 1, g: 1, b: 1, a: 1} + - _ColorSwapGreen: {r: 1, g: 1, b: 1, a: 1} + - _ColorSwapRed: {r: 1, g: 1, b: 1, a: 1} + - _FadeBurnColor: {r: 1, g: 1, b: 0, a: 1} + - _GlowColor: {r: 1, g: 1, b: 1, a: 1} + - _GradBotLeftCol: {r: 0, g: 0, b: 1, a: 1} + - _GradBotRightCol: {r: 0, g: 0, b: 1, a: 1} + - _GradTopLeftCol: {r: 1, g: 0, b: 0, a: 1} + - _GradTopRightCol: {r: 1, g: 0, b: 0, a: 1} + - _GreyscaleTintColor: {r: 1, g: 1, b: 1, a: 1} + - _HitEffectColor: {r: 1, g: 1, b: 1, a: 1} + - _HologramStripeColor: {r: 1, g: 1, b: 1, a: 1} + - _InnerOutlineColor: {r: 1, g: 0, b: 0, a: 1} + - _OutlineColor: {r: 1, g: 1, b: 1, a: 1} + - _OverlayColor: {r: 1, g: 1, b: 1, a: 1} + - _ShadowColor: {r: 0, g: 0, b: 0, a: 1} + - _ShineColor: {r: 1, g: 1, b: 1, a: 1} +--- !u!1 &453652827 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 453652828} + - component: {fileID: 453652830} + - component: {fileID: 453652829} + m_Layer: 0 + m_Name: Title + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &453652828 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 453652827} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: -2.51, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 1613686741} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!102 &453652829 +TextMesh: + serializedVersion: 3 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 453652827} + m_Text: Fade + m_OffsetZ: -1.5 + m_CharacterSize: 0.075 + m_LineSpacing: 1 + m_Anchor: 4 + m_Alignment: 0 + m_TabSize: 4 + m_FontSize: 100 + m_FontStyle: 0 + m_RichText: 1 + m_Font: {fileID: 12800000, guid: a4e6a5491519adb45919dc87eff28e55, type: 3} + m_Color: + serializedVersion: 2 + rgba: 4294967295 +--- !u!23 &453652830 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 453652827} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 10100, guid: 0000000000000000e000000000000000, type: 0} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!21 &465147594 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: AllIn1SpriteShader/AllIn1SpriteShader + m_Shader: {fileID: 4800000, guid: a36b7719ff0465b42ab1407d67672c5f, type: 3} + m_ShaderKeywords: ETC1_EXTERNAL_ALPHA GRADIENT_ON RADIALGRADIENT_ON _GRADISRADIAL_ON + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _ColorRampTex: + m_Texture: {fileID: 2800000, guid: 279657edc397ece4b8029c727adf6ddc, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ColorRampTexGradient: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ColorSwapTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DistortTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _FadeBurnTex: + m_Texture: {fileID: 2800000, guid: 32e8df0008bebe746b1681a71c61f31c, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _FadeTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _GlowTex: + 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} + - _OutlineDistortTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OutlineTex: + m_Texture: {fileID: 2800000, guid: 74087f6d03f233e4a8a142fa01f9e5cf, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OverlayTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ShineMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - _Alpha: 1 + - _AlphaCutoffValue: 0.25 + - _AlphaOutlineBlend: 1 + - _AlphaOutlineGlow: 5 + - _AlphaOutlineMinAlpha: 0 + - _AlphaOutlinePower: 1 + - _AlphaRoundThreshold: 0.5 + - _BillboardY: 0 + - _BlurHD: 0 + - _BlurIntensity: 10 + - _Brightness: 0 + - _ChromAberrAlpha: 0.4 + - _ChromAberrAmount: 1 + - _ClipUvDown: 1 + - _ClipUvLeft: 1 + - _ClipUvRight: 1 + - _ClipUvUp: 1 + - _ColorChangeLuminosity: 0 + - _ColorChangeTolerance: 0.25 + - _ColorChangeTolerance2: 0.25 + - _ColorChangeTolerance3: 0.25 + - _ColorRampBlend: 1 + - _ColorRampLuminosity: 0 + - _ColorRampOutline: 0 + - _ColorSwapBlend: 1 + - _ColorSwapBlueLuminosity: 0.5 + - _ColorSwapGreenLuminosity: 0.5 + - _ColorSwapRedLuminosity: 0.5 + - _Contrast: 1 + - _CullingOption: 0 + - _DistortAmount: 0.5 + - _DistortTexXSpeed: 5 + - _DistortTexYSpeed: 5 + - _EditorDrawers: 6 + - _FadeAmount: -0.1 + - _FadeBurnGlow: 2 + - _FadeBurnTransition: 0.075 + - _FadeBurnWidth: 0.025 + - _FishEyeUvAmount: 0.35 + - _FlickerAlpha: 0 + - _FlickerFreq: 0.2 + - _FlickerPercent: 0.05 + - _GhostBlend: 1 + - _GhostColorBoost: 1 + - _GhostTransparency: 0 + - _GlitchAmount: 3 + - _GlitchSize: 1 + - _Glow: 10 + - _GlowGlobal: 1 + - _GlowTexUsed: 0 + - _GradBlend: 0.876 + - _GradBoostX: 0.98 + - _GradBoostY: 1.2 + - _GradIsRadial: 1 + - _GrassManualAnim: 1 + - _GrassManualToggle: 0 + - _GrassRadialBend: 0.25 + - _GrassSpeed: 2 + - _GrassWind: 20 + - _GreyscaleBlend: 1 + - _GreyscaleLuminosity: 0 + - _GreyscaleOutline: 0 + - _HandDrawnAmount: 10 + - _HandDrawnSpeed: 5 + - _HitEffectBlend: 1 + - _HitEffectGlow: 5 + - _HologramBlend: 1 + - _HologramFlickerAlpha: 0 + - _HologramFlickerFreq: 0.2 + - _HologramFlickerPercent: 0.05 + - _HologramMaxAlpha: 1 + - _HologramMinAlpha: 0 + - _HologramStripesAlpha: 0.4 + - _HologramStripesAmount: 50 + - _HologramStripesFill: 0.4 + - _HologramStripesLuminosity: 1 + - _HologramStripesSpeed: 5 + - _HologramUnmodAmount: 0.4 + - _HsvBright: 1 + - _HsvSaturation: 1 + - _HsvShift: 180 + - _InnerOutlineAlpha: 1 + - _InnerOutlineGlow: 1 + - _InnerOutlineThickness: 1 + - _MaxXUV: 1 + - _MaxYUV: 1 + - _MinXUV: 0 + - _MinYUV: 0 + - _MotionBlurAngle: 0.1 + - _MotionBlurDist: 1.25 + - _MyDstMode: 10 + - _MySrcMode: 5 + - _NegativeAmount: 1 + - _OffsetUvX: 0 + - _OffsetUvY: 0 + - _OnlyInnerOutline: 0 + - _OnlyOutline: 0 + - _Outline8Directions: 0 + - _OutlineAlpha: 1 + - _OutlineDistortAmount: 0.5 + - _OutlineDistortTexXSpeed: 5 + - _OutlineDistortTexYSpeed: 5 + - _OutlineDistortToggle: 0 + - _OutlineGlow: 1.5 + - _OutlineIsPixel: 0 + - _OutlinePixelWidth: 1 + - _OutlineTexGrey: 0 + - _OutlineTexToggle: 0 + - _OutlineTexXSpeed: 10 + - _OutlineTexYSpeed: 0 + - _OutlineWidth: 0.004 + - _OverlayBlend: 1 + - _OverlayGlow: 1 + - _OverlayTextureScrollXSpeed: 0.25 + - _OverlayTextureScrollYSpeed: 0.25 + - _PinchUvAmount: 0.35 + - _PixelateSize: 32 + - _PosterizeGamma: 0.75 + - _PosterizeNumColors: 8 + - _PosterizeOutline: 0 + - _RadialClip: 0 + - _RadialClip2: 45 + - _RadialClipAngle: 90 + - _RadialClipArc1: 45 + - _RadialClipArc2: 0 + - _RadialStartAngle: 90 + - _RandomSeed: 0 + - _RectSize: 1 + - _RotateUvAmount: 0 + - _RoundWaveSpeed: 2 + - _RoundWaveStrength: 0.7 + - _ShadowAlpha: 0.5 + - _ShadowX: 0.1 + - _ShadowY: -0.05 + - _ShakeUvSpeed: 2.5 + - _ShakeUvX: 1.5 + - _ShakeUvY: 1 + - _ShineGlow: 1 + - _ShineLocation: 0.5 + - _ShineRotate: 0 + - _ShineWidth: 0.1 + - _TextureScrollXSpeed: 1 + - _TextureScrollYSpeed: 0 + - _TwistUvAmount: 1 + - _TwistUvPosX: 0.5 + - _TwistUvPosY: 0.5 + - _TwistUvRadius: 0.75 + - _WarpScale: 0.5 + - _WarpSpeed: 8 + - _WarpStrength: 0.025 + - _WaveAmount: 7 + - _WaveSpeed: 10 + - _WaveStrength: 7.5 + - _WaveX: 0 + - _WaveY: 0.5 + - _ZTestMode: 4 + - _ZWrite: 0 + - _ZoomUvAmount: 0.5 + m_Colors: + - ColorSwapRed: {r: 1, g: 1, b: 1, a: 1} + - _AlphaOutlineColor: {r: 1, g: 1, b: 1, a: 1} + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _ColorChangeNewCol: {r: 1, g: 1, b: 0, a: 1} + - _ColorChangeNewCol2: {r: 1, g: 1, b: 0, a: 1} + - _ColorChangeNewCol3: {r: 1, g: 1, b: 0, a: 1} + - _ColorChangeTarget: {r: 1, g: 0, b: 0, a: 1} + - _ColorChangeTarget2: {r: 1, g: 0, b: 0, a: 1} + - _ColorChangeTarget3: {r: 1, g: 0, b: 0, a: 1} + - _ColorSwapBlue: {r: 1, g: 1, b: 1, a: 1} + - _ColorSwapGreen: {r: 1, g: 1, b: 1, a: 1} + - _ColorSwapRed: {r: 1, g: 1, b: 1, a: 1} + - _FadeBurnColor: {r: 1, g: 1, b: 0, a: 1} + - _GlowColor: {r: 1, g: 1, b: 1, a: 1} + - _GradBotLeftCol: {r: 0, g: 0.28235295, b: 0.05495002, a: 1} + - _GradBotRightCol: {r: 0, g: 0, b: 1, a: 1} + - _GradTopLeftCol: {r: 0.9940848, g: 1, b: 0.3679245, a: 1} + - _GradTopRightCol: {r: 1, g: 0, b: 0, a: 1} + - _GreyscaleTintColor: {r: 1, g: 1, b: 1, a: 1} + - _HitEffectColor: {r: 1, g: 1, b: 1, a: 1} + - _HologramStripeColor: {r: 1, g: 1, b: 1, a: 1} + - _InnerOutlineColor: {r: 1, g: 0, b: 0, a: 1} + - _OutlineColor: {r: 1, g: 1, b: 1, a: 1} + - _OverlayColor: {r: 1, g: 1, b: 1, a: 1} + - _ShadowColor: {r: 0, g: 0, b: 0, a: 1} + - _ShineColor: {r: 1, g: 1, b: 1, a: 1} +--- !u!21 &469847421 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: AllIn1SpriteShader/AllIn1SpriteShader + m_Shader: {fileID: 4800000, guid: a36b7719ff0465b42ab1407d67672c5f, type: 3} + m_ShaderKeywords: DOODLE_ON ETC1_EXTERNAL_ALPHA GLOWTEX_ON _GLOWTEXUSED_ON + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _ColorRampTex: + m_Texture: {fileID: 2800000, guid: 279657edc397ece4b8029c727adf6ddc, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ColorRampTexGradient: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ColorSwapTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DistortTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _FadeBurnTex: + m_Texture: {fileID: 2800000, guid: 32e8df0008bebe746b1681a71c61f31c, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _FadeTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _GlowTex: + m_Texture: {fileID: 2800000, guid: 8608ef90f91271745a17f7210fe1e7db, type: 3} + 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} + - _OutlineDistortTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OutlineTex: + m_Texture: {fileID: 2800000, guid: 74087f6d03f233e4a8a142fa01f9e5cf, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OverlayTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ShineMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - _Alpha: 1 + - _AlphaCutoffValue: 0.25 + - _AlphaOutlineBlend: 1 + - _AlphaOutlineGlow: 5 + - _AlphaOutlineMinAlpha: 0 + - _AlphaOutlinePower: 1 + - _AlphaRoundThreshold: 0.5 + - _BillboardY: 0 + - _BlurHD: 0 + - _BlurIntensity: 10 + - _Brightness: 0 + - _ChromAberrAlpha: 0.4 + - _ChromAberrAmount: 1 + - _ClipUvDown: 1 + - _ClipUvLeft: 1 + - _ClipUvRight: 1 + - _ClipUvUp: 1 + - _ColorChangeLuminosity: 0 + - _ColorChangeTolerance: 0.25 + - _ColorChangeTolerance2: 0.25 + - _ColorChangeTolerance3: 0.25 + - _ColorRampBlend: 1 + - _ColorRampLuminosity: 0 + - _ColorRampOutline: 0 + - _ColorSwapBlend: 1 + - _ColorSwapBlueLuminosity: 0.5 + - _ColorSwapGreenLuminosity: 0.5 + - _ColorSwapRedLuminosity: 0.5 + - _Contrast: 1 + - _CullingOption: 0 + - _DistortAmount: 0.5 + - _DistortTexXSpeed: 5 + - _DistortTexYSpeed: 5 + - _EditorDrawers: 6 + - _FadeAmount: -0.1 + - _FadeBurnGlow: 2 + - _FadeBurnTransition: 0.075 + - _FadeBurnWidth: 0.025 + - _FishEyeUvAmount: 0.35 + - _FlickerAlpha: 0 + - _FlickerFreq: 0.2 + - _FlickerPercent: 0.05 + - _GhostBlend: 1 + - _GhostColorBoost: 1 + - _GhostTransparency: 0 + - _GlitchAmount: 3 + - _GlitchSize: 1 + - _Glow: 3.3 + - _GlowGlobal: 1 + - _GlowTexUsed: 1 + - _GradBlend: 1 + - _GradBoostX: 1.2 + - _GradBoostY: 1.2 + - _GradIsRadial: 0 + - _GrassManualAnim: 1 + - _GrassManualToggle: 0 + - _GrassRadialBend: 0.25 + - _GrassSpeed: 2 + - _GrassWind: 20 + - _GreyscaleBlend: 1 + - _GreyscaleLuminosity: 0 + - _GreyscaleOutline: 0 + - _HandDrawnAmount: 12.82 + - _HandDrawnSpeed: 5 + - _HitEffectBlend: 1 + - _HitEffectGlow: 5 + - _HologramBlend: 1 + - _HologramFlickerAlpha: 0 + - _HologramFlickerFreq: 0.2 + - _HologramFlickerPercent: 0.05 + - _HologramMaxAlpha: 1 + - _HologramMinAlpha: 0 + - _HologramStripesAlpha: 0.4 + - _HologramStripesAmount: 50 + - _HologramStripesFill: 0.4 + - _HologramStripesLuminosity: 1 + - _HologramStripesSpeed: 5 + - _HologramUnmodAmount: 0.4 + - _HsvBright: 1 + - _HsvSaturation: 1 + - _HsvShift: 180 + - _InnerOutlineAlpha: 1 + - _InnerOutlineGlow: 1 + - _InnerOutlineThickness: 1 + - _MaxXUV: 1 + - _MaxYUV: 1 + - _MinXUV: 0 + - _MinYUV: 0 + - _MotionBlurAngle: 0.1 + - _MotionBlurDist: 1.25 + - _MyDstMode: 10 + - _MySrcMode: 5 + - _NegativeAmount: 1 + - _OffsetUvX: 0 + - _OffsetUvY: 0 + - _OnlyInnerOutline: 0 + - _OnlyOutline: 0 + - _Outline8Directions: 0 + - _OutlineAlpha: 1 + - _OutlineDistortAmount: 0.5 + - _OutlineDistortTexXSpeed: 5 + - _OutlineDistortTexYSpeed: 5 + - _OutlineDistortToggle: 0 + - _OutlineGlow: 1.5 + - _OutlineIsPixel: 0 + - _OutlinePixelWidth: 1 + - _OutlineTexGrey: 0 + - _OutlineTexToggle: 0 + - _OutlineTexXSpeed: 10 + - _OutlineTexYSpeed: 0 + - _OutlineWidth: 0.004 + - _OverlayBlend: 1 + - _OverlayGlow: 1 + - _OverlayTextureScrollXSpeed: 0.25 + - _OverlayTextureScrollYSpeed: 0.25 + - _PinchUvAmount: 0.35 + - _PixelateSize: 32 + - _PosterizeGamma: 0.75 + - _PosterizeNumColors: 8 + - _PosterizeOutline: 0 + - _RadialClip: 45 + - _RadialClip2: 0 + - _RadialClipAngle: 90 + - _RadialClipArc1: 45 + - _RadialClipArc2: 0 + - _RadialStartAngle: 90 + - _RandomSeed: 0 + - _RectSize: 1 + - _RotateUvAmount: 0 + - _RoundWaveSpeed: 2 + - _RoundWaveStrength: 0.7 + - _ShadowAlpha: 0.5 + - _ShadowX: 0.1 + - _ShadowY: -0.05 + - _ShakeUvSpeed: 2.5 + - _ShakeUvX: 1.5 + - _ShakeUvY: 1 + - _ShineGlow: 1 + - _ShineLocation: 0.5 + - _ShineRotate: 0 + - _ShineWidth: 0.1 + - _TextureScrollXSpeed: 1 + - _TextureScrollYSpeed: 0 + - _TwistUvAmount: 1 + - _TwistUvPosX: 0.5 + - _TwistUvPosY: 0.5 + - _TwistUvRadius: 0.75 + - _WarpScale: 0.5 + - _WarpSpeed: 8 + - _WarpStrength: 0.025 + - _WaveAmount: 7 + - _WaveSpeed: 10 + - _WaveStrength: 7.5 + - _WaveX: 0 + - _WaveY: 0.5 + - _ZTestMode: 4 + - _ZWrite: 0 + - _ZoomUvAmount: 0.5 + m_Colors: + - ColorSwapRed: {r: 1, g: 1, b: 1, a: 1} + - _AlphaOutlineColor: {r: 1, g: 1, b: 1, a: 1} + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _ColorChangeNewCol: {r: 1, g: 1, b: 0, a: 1} + - _ColorChangeNewCol2: {r: 1, g: 1, b: 0, a: 1} + - _ColorChangeNewCol3: {r: 1, g: 1, b: 0, a: 1} + - _ColorChangeTarget: {r: 1, g: 0, b: 0, a: 1} + - _ColorChangeTarget2: {r: 1, g: 0, b: 0, a: 1} + - _ColorChangeTarget3: {r: 1, g: 0, b: 0, a: 1} + - _ColorSwapBlue: {r: 1, g: 1, b: 1, a: 1} + - _ColorSwapGreen: {r: 1, g: 1, b: 1, a: 1} + - _ColorSwapRed: {r: 1, g: 1, b: 1, a: 1} + - _FadeBurnColor: {r: 1, g: 1, b: 0, a: 1} + - _GlowColor: {r: 1, g: 0.7193959, b: 0.1273585, a: 1} + - _GradBotLeftCol: {r: 0, g: 0, b: 1, a: 1} + - _GradBotRightCol: {r: 0, g: 0, b: 1, a: 1} + - _GradTopLeftCol: {r: 1, g: 0, b: 0, a: 1} + - _GradTopRightCol: {r: 1, g: 0, b: 0, a: 1} + - _GreyscaleTintColor: {r: 1, g: 1, b: 1, a: 1} + - _HitEffectColor: {r: 1, g: 1, b: 1, a: 1} + - _HologramStripeColor: {r: 1, g: 1, b: 1, a: 1} + - _InnerOutlineColor: {r: 1, g: 0, b: 0, a: 1} + - _OutlineColor: {r: 1, g: 1, b: 1, a: 1} + - _OverlayColor: {r: 1, g: 1, b: 1, a: 1} + - _ShadowColor: {r: 0, g: 0, b: 0, a: 1} + - _ShineColor: {r: 1, g: 1, b: 1, a: 1} +--- !u!1 &471382083 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 471382084} + - component: {fileID: 471382086} + - component: {fileID: 471382087} + m_Layer: 0 + m_Name: Inner Outline + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &471382084 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 471382083} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 70, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 401883084} + - {fileID: 720867420} + m_Father: {fileID: 2036092933} + m_RootOrder: 7 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!212 &471382086 +SpriteRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 471382083} + m_Enabled: 1 + m_CastShadows: 0 + m_ReceiveShadows: 0 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 537809413} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 0 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_Sprite: {fileID: 21300000, guid: 519dafacd208bb64c83d5124be03b09d, type: 3} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_FlipX: 0 + m_FlipY: 0 + m_DrawMode: 0 + m_Size: {x: 5.12, y: 5.12} + m_AdaptiveModeThreshold: 0.5 + m_SpriteTileMode: 0 + m_WasSpriteAssigned: 1 + m_MaskInteraction: 0 + m_SpriteSortPoint: 0 +--- !u!114 &471382087 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 471382083} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 98b644315d7a92842b89e04f55c48e02, type: 3} + m_Name: + m_EditorClassIdentifier: +--- !u!1 &482750998 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 482750999} + - component: {fileID: 482751001} + - component: {fileID: 482751000} + m_Layer: 0 + m_Name: Animated + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 0 +--- !u!4 &482750999 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 482750998} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: -3.57, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 1478122371} + m_RootOrder: 3 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!102 &482751000 +TextMesh: + serializedVersion: 3 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 482750998} + m_Text: (Has Animation) + m_OffsetZ: -1.5 + m_CharacterSize: 0.075 + m_LineSpacing: 1 + m_Anchor: 4 + m_Alignment: 0 + m_TabSize: 4 + m_FontSize: 100 + m_FontStyle: 0 + m_RichText: 1 + m_Font: {fileID: 12800000, guid: a4e6a5491519adb45919dc87eff28e55, type: 3} + m_Color: + serializedVersion: 2 + rgba: 4294967295 +--- !u!23 &482751001 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 482750998} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: a4e6a5491519adb45919dc87eff28e55, type: 3} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!1 &485976055 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 485976056} + - component: {fileID: 485976058} + - component: {fileID: 485976059} + m_Layer: 0 + m_Name: Glitch + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &485976056 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 485976055} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 250, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 275948670} + - {fileID: 566664014} + m_Father: {fileID: 2036092933} + m_RootOrder: 25 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!212 &485976058 +SpriteRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 485976055} + m_Enabled: 1 + m_CastShadows: 0 + m_ReceiveShadows: 0 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 1181865632} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 0 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_Sprite: {fileID: 21300000, guid: 519dafacd208bb64c83d5124be03b09d, type: 3} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_FlipX: 0 + m_FlipY: 0 + m_DrawMode: 0 + m_Size: {x: 5.12, y: 5.12} + m_AdaptiveModeThreshold: 0.5 + m_SpriteTileMode: 0 + m_WasSpriteAssigned: 1 + m_MaskInteraction: 0 + m_SpriteSortPoint: 0 +--- !u!114 &485976059 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 485976055} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 98b644315d7a92842b89e04f55c48e02, type: 3} + m_Name: + m_EditorClassIdentifier: +--- !u!1 &487308174 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 487308175} + - component: {fileID: 487308177} + - component: {fileID: 487308176} + m_Layer: 0 + m_Name: Title + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &487308175 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 487308174} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: -2.51, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 1329663900} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!102 &487308176 +TextMesh: + serializedVersion: 3 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 487308174} + m_Text: Poolar Coords + m_OffsetZ: -1.5 + m_CharacterSize: 0.075 + m_LineSpacing: 1 + m_Anchor: 4 + m_Alignment: 0 + m_TabSize: 4 + m_FontSize: 100 + m_FontStyle: 0 + m_RichText: 1 + m_Font: {fileID: 12800000, guid: a4e6a5491519adb45919dc87eff28e55, type: 3} + m_Color: + serializedVersion: 2 + rgba: 4294967295 +--- !u!23 &487308177 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 487308174} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 10100, guid: 0000000000000000e000000000000000, type: 0} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!1 &489557968 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 489557969} + - component: {fileID: 489557971} + - component: {fileID: 489557970} + m_Layer: 0 + m_Name: Animated + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 0 +--- !u!4 &489557969 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 489557968} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: -3.57, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 1675838108} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!102 &489557970 +TextMesh: + serializedVersion: 3 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 489557968} + m_Text: (Has Animation) + m_OffsetZ: -1.5 + m_CharacterSize: 0.075 + m_LineSpacing: 1 + m_Anchor: 4 + m_Alignment: 0 + m_TabSize: 4 + m_FontSize: 100 + m_FontStyle: 0 + m_RichText: 1 + m_Font: {fileID: 12800000, guid: a4e6a5491519adb45919dc87eff28e55, type: 3} + m_Color: + serializedVersion: 2 + rgba: 4294967295 +--- !u!23 &489557971 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 489557968} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: a4e6a5491519adb45919dc87eff28e55, type: 3} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!1 &499272003 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 499272004} + - component: {fileID: 499272007} + - component: {fileID: 499272006} + m_Layer: 0 + m_Name: BlurredOutline + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &499272004 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 499272003} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 270, y: 0, z: 0} + m_LocalScale: {x: 0.80276, y: 0.80276, z: 0.80276} + m_Children: + - {fileID: 1916465496} + - {fileID: 2064997618} + - {fileID: 114782627} + m_Father: {fileID: 1563905016} + m_RootOrder: 27 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &499272006 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 499272003} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 98b644315d7a92842b89e04f55c48e02, type: 3} + m_Name: + m_EditorClassIdentifier: +--- !u!212 &499272007 +SpriteRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 499272003} + m_Enabled: 1 + m_CastShadows: 0 + m_ReceiveShadows: 0 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 1439702669} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 0 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_Sprite: {fileID: 21300000, guid: 519dafacd208bb64c83d5124be03b09d, type: 3} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_FlipX: 0 + m_FlipY: 0 + m_DrawMode: 0 + m_Size: {x: 5.12, y: 5.12} + m_AdaptiveModeThreshold: 0.5 + m_SpriteTileMode: 0 + m_WasSpriteAssigned: 1 + m_MaskInteraction: 0 + m_SpriteSortPoint: 0 +--- !u!1 &499438416 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 499438417} + - component: {fileID: 499438419} + - component: {fileID: 499438418} + m_Layer: 0 + m_Name: Title + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &499438417 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 499438416} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: -2.51, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 1986728942} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!102 &499438418 +TextMesh: + serializedVersion: 3 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 499438416} + m_Text: Zoom + m_OffsetZ: -1.5 + m_CharacterSize: 0.075 + m_LineSpacing: 1 + m_Anchor: 4 + m_Alignment: 0 + m_TabSize: 4 + m_FontSize: 100 + m_FontStyle: 0 + m_RichText: 1 + m_Font: {fileID: 12800000, guid: a4e6a5491519adb45919dc87eff28e55, type: 3} + m_Color: + serializedVersion: 2 + rgba: 4294967295 +--- !u!23 &499438419 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 499438416} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 10100, guid: 0000000000000000e000000000000000, type: 0} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!1 &510732447 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 510732448} + - component: {fileID: 510732450} + - component: {fileID: 510732449} + m_Layer: 0 + m_Name: Animated + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 0 +--- !u!4 &510732448 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 510732447} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: -3.57, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 1073973762} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!102 &510732449 +TextMesh: + serializedVersion: 3 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 510732447} + m_Text: (Has Animation) + m_OffsetZ: -1.5 + m_CharacterSize: 0.075 + m_LineSpacing: 1 + m_Anchor: 4 + m_Alignment: 0 + m_TabSize: 4 + m_FontSize: 100 + m_FontStyle: 0 + m_RichText: 1 + m_Font: {fileID: 12800000, guid: a4e6a5491519adb45919dc87eff28e55, type: 3} + m_Color: + serializedVersion: 2 + rgba: 4294967295 +--- !u!23 &510732450 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 510732447} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: a4e6a5491519adb45919dc87eff28e55, type: 3} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!1 &511167260 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 511167261} + - component: {fileID: 511167265} + - component: {fileID: 511167264} + - component: {fileID: 511167262} + - component: {fileID: 511167266} + m_Layer: 0 + m_Name: IceSoldier + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &511167261 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 511167260} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 350, y: 0, z: 0} + m_LocalScale: {x: 0.80276, y: 0.80276, z: 0.80276} + m_Children: + - {fileID: 711155183} + - {fileID: 1078196207} + - {fileID: 1527473307} + - {fileID: 1884970177} + m_Father: {fileID: 1563905016} + m_RootOrder: 35 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!331 &511167262 +SpriteMask: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 511167260} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 10758, guid: 0000000000000000f000000000000000, type: 0} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_Sprite: {fileID: 21300000, guid: 519dafacd208bb64c83d5124be03b09d, type: 3} + m_MaskAlphaCutoff: 0.2 + m_FrontSortingLayerID: 0 + m_BackSortingLayerID: 0 + m_FrontSortingLayer: 0 + m_BackSortingLayer: 0 + m_FrontSortingOrder: 0 + m_BackSortingOrder: 0 + m_IsCustomRangeActive: 0 + m_SpriteSortPoint: 0 +--- !u!114 &511167264 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 511167260} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 98b644315d7a92842b89e04f55c48e02, type: 3} + m_Name: + m_EditorClassIdentifier: +--- !u!212 &511167265 +SpriteRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 511167260} + m_Enabled: 1 + m_CastShadows: 0 + m_ReceiveShadows: 0 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: d27799974f79b894196aeeef8bac53af, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 0 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_Sprite: {fileID: 21300000, guid: 519dafacd208bb64c83d5124be03b09d, type: 3} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_FlipX: 0 + m_FlipY: 0 + m_DrawMode: 0 + m_Size: {x: 5.12, y: 5.12} + m_AdaptiveModeThreshold: 0.5 + m_SpriteTileMode: 0 + m_WasSpriteAssigned: 1 + m_MaskInteraction: 0 + m_SpriteSortPoint: 0 +--- !u!95 &511167266 +Animator: + serializedVersion: 3 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 511167260} + m_Enabled: 1 + m_Avatar: {fileID: 0} + m_Controller: {fileID: 9100000, guid: c2df20f2d12e21b46bacd5dfa839b92e, type: 2} + m_CullingMode: 0 + m_UpdateMode: 0 + m_ApplyRootMotion: 0 + m_LinearVelocityBlending: 0 + m_WarningMessage: + m_HasTransformHierarchy: 1 + m_AllowConstantClipSamplingOptimization: 1 + m_KeepAnimatorControllerStateOnDisable: 0 +--- !u!1 &520963777 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 520963778} + - component: {fileID: 520963780} + - component: {fileID: 520963779} + m_Layer: 0 + m_Name: Title + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &520963778 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 520963777} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: -2.51, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 1875180451} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!102 &520963779 +TextMesh: + serializedVersion: 3 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 520963777} + m_Text: Teleport + m_OffsetZ: -1.5 + m_CharacterSize: 0.075 + m_LineSpacing: 1 + m_Anchor: 4 + m_Alignment: 0 + m_TabSize: 4 + m_FontSize: 100 + m_FontStyle: 0 + m_RichText: 1 + m_Font: {fileID: 12800000, guid: a4e6a5491519adb45919dc87eff28e55, type: 3} + m_Color: + serializedVersion: 2 + rgba: 4294967295 +--- !u!23 &520963780 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 520963777} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 10100, guid: 0000000000000000e000000000000000, type: 0} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!1 &535274221 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 535274222} + - component: {fileID: 535274224} + - component: {fileID: 535274223} + m_Layer: 5 + m_Name: ExpositorTitleOutline + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &535274222 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 535274221} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 1005972827} + m_Father: {fileID: 564363701} + m_RootOrder: 2 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0.5, y: 1} + m_AnchorMax: {x: 0.5, y: 1} + m_AnchoredPosition: {x: 0, y: -87} + m_SizeDelta: {x: 160, y: 121.23} + m_Pivot: {x: 0.5, y: 1} +--- !u!114 &535274223 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 535274221} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 5f7201a12d95ffc409449d95f23cf332, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 0, g: 0, b: 0, a: 1} + m_RaycastTarget: 0 + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_FontData: + m_Font: {fileID: 12800000, guid: a4e6a5491519adb45919dc87eff28e55, type: 3} + m_FontSize: 123 + m_FontStyle: 0 + m_BestFit: 0 + m_MinSize: 10 + m_MaxSize: 123 + m_Alignment: 4 + m_AlignByGeometry: 0 + m_RichText: 1 + m_HorizontalOverflow: 1 + m_VerticalOverflow: 1 + m_LineSpacing: 1 + m_Text: Color Effects +--- !u!222 &535274224 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 535274221} + m_CullTransparentMesh: 0 +--- !u!21 &537809413 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: AllIn1SpriteShader/AllIn1SpriteShader + m_Shader: {fileID: 4800000, guid: a36b7719ff0465b42ab1407d67672c5f, type: 3} + m_ShaderKeywords: ETC1_EXTERNAL_ALPHA INNEROUTLINE_ON + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _ColorRampTex: + m_Texture: {fileID: 2800000, guid: 279657edc397ece4b8029c727adf6ddc, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ColorRampTexGradient: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ColorSwapTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DistortTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _FadeBurnTex: + m_Texture: {fileID: 2800000, guid: 32e8df0008bebe746b1681a71c61f31c, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _FadeTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _GlowTex: + 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} + - _OutlineDistortTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OutlineTex: + m_Texture: {fileID: 2800000, guid: 74087f6d03f233e4a8a142fa01f9e5cf, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OverlayTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ShineMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - _Alpha: 1 + - _AlphaCutoffValue: 0.25 + - _AlphaOutlineBlend: 1 + - _AlphaOutlineGlow: 5 + - _AlphaOutlineMinAlpha: 0 + - _AlphaOutlinePower: 1 + - _AlphaRoundThreshold: 0.5 + - _BillboardY: 0 + - _BlurHD: 0 + - _BlurIntensity: 10 + - _Brightness: 0 + - _ChromAberrAlpha: 0.4 + - _ChromAberrAmount: 1 + - _ClipUvDown: 1 + - _ClipUvLeft: 1 + - _ClipUvRight: 1 + - _ClipUvUp: 1 + - _ColorChangeLuminosity: 0 + - _ColorChangeTolerance: 0.25 + - _ColorChangeTolerance2: 0.25 + - _ColorChangeTolerance3: 0.25 + - _ColorRampBlend: 1 + - _ColorRampLuminosity: 0 + - _ColorRampOutline: 0 + - _ColorSwapBlend: 1 + - _ColorSwapBlueLuminosity: 0.5 + - _ColorSwapGreenLuminosity: 0.5 + - _ColorSwapRedLuminosity: 0.5 + - _Contrast: 1 + - _CullingOption: 0 + - _DistortAmount: 0.5 + - _DistortTexXSpeed: 5 + - _DistortTexYSpeed: 5 + - _EditorDrawers: 6 + - _FadeAmount: -0.1 + - _FadeBurnGlow: 2 + - _FadeBurnTransition: 0.075 + - _FadeBurnWidth: 0.025 + - _FishEyeUvAmount: 0.35 + - _FlickerAlpha: 0 + - _FlickerFreq: 0.2 + - _FlickerPercent: 0.05 + - _GhostBlend: 1 + - _GhostColorBoost: 1 + - _GhostTransparency: 0 + - _GlitchAmount: 3 + - _GlitchSize: 1 + - _Glow: 10 + - _GlowGlobal: 1 + - _GlowTexUsed: 0 + - _GradBlend: 1 + - _GradBoostX: 1.2 + - _GradBoostY: 1.2 + - _GradIsRadial: 0 + - _GrassManualAnim: 1 + - _GrassManualToggle: 0 + - _GrassRadialBend: 0.1 + - _GrassSpeed: 2 + - _GrassWind: 20 + - _GreyscaleBlend: 1 + - _GreyscaleLuminosity: 0 + - _GreyscaleOutline: 0 + - _HandDrawnAmount: 10 + - _HandDrawnSpeed: 5 + - _HitEffectBlend: 1 + - _HitEffectGlow: 5 + - _HologramBlend: 1 + - _HologramFlickerAlpha: 0 + - _HologramFlickerFreq: 0.2 + - _HologramFlickerPercent: 0.05 + - _HologramMaxAlpha: 1 + - _HologramMinAlpha: 0 + - _HologramStripesAlpha: 0.4 + - _HologramStripesAmount: 50 + - _HologramStripesFill: 0.4 + - _HologramStripesLuminosity: 1 + - _HologramStripesSpeed: 5 + - _HologramUnmodAmount: 0.4 + - _HsvBright: 1 + - _HsvSaturation: 1 + - _HsvShift: 180 + - _InnerOutlineAlpha: 1 + - _InnerOutlineGlow: 10 + - _InnerOutlineThickness: 2.01 + - _MaxXUV: 1 + - _MaxYUV: 1 + - _MinXUV: 0 + - _MinYUV: 0 + - _MotionBlurAngle: 0.1 + - _MotionBlurDist: 1.25 + - _MyDstMode: 10 + - _MySrcMode: 5 + - _NegativeAmount: 1 + - _OffsetUvX: 0 + - _OffsetUvY: 0 + - _OnlyInnerOutline: 0 + - _OnlyOutline: 0 + - _Outline8Directions: 0 + - _OutlineAlpha: 1 + - _OutlineDistortAmount: 0.5 + - _OutlineDistortTexXSpeed: 5 + - _OutlineDistortTexYSpeed: 5 + - _OutlineDistortToggle: 0 + - _OutlineGlow: 1.5 + - _OutlineIsPixel: 0 + - _OutlinePixelWidth: 1 + - _OutlineTexGrey: 0 + - _OutlineTexToggle: 0 + - _OutlineTexXSpeed: 10 + - _OutlineTexYSpeed: 0 + - _OutlineWidth: 0.004 + - _OverlayBlend: 1 + - _OverlayGlow: 1 + - _OverlayTextureScrollXSpeed: 0.25 + - _OverlayTextureScrollYSpeed: 0.25 + - _PinchUvAmount: 0.35 + - _PixelateSize: 32 + - _PosterizeGamma: 0.75 + - _PosterizeNumColors: 8 + - _PosterizeOutline: 0 + - _RadialClip: 0 + - _RadialClip2: 45 + - _RadialClipAngle: 90 + - _RadialClipArc1: 45 + - _RadialClipArc2: 0 + - _RadialStartAngle: 90 + - _RandomSeed: 0 + - _RectSize: 1 + - _RotateUvAmount: 0 + - _RoundWaveSpeed: 2 + - _RoundWaveStrength: 0.7 + - _ShadowAlpha: 0.5 + - _ShadowX: 0.1 + - _ShadowY: -0.05 + - _ShakeUvSpeed: 2.5 + - _ShakeUvX: 1.5 + - _ShakeUvY: 1 + - _ShineGlow: 1 + - _ShineLocation: 0.5 + - _ShineRotate: 0 + - _ShineWidth: 0.1 + - _TextureScrollXSpeed: 1 + - _TextureScrollYSpeed: 0 + - _TwistUvAmount: 1 + - _TwistUvPosX: 0.5 + - _TwistUvPosY: 0.5 + - _TwistUvRadius: 0.75 + - _WarpScale: 0.5 + - _WarpSpeed: 8 + - _WarpStrength: 0.025 + - _WaveAmount: 7 + - _WaveSpeed: 10 + - _WaveStrength: 7.5 + - _WaveX: 0 + - _WaveY: 0.5 + - _ZTestMode: 4 + - _ZWrite: 0 + - _ZoomUvAmount: 0.5 + m_Colors: + - ColorSwapRed: {r: 1, g: 1, b: 1, a: 1} + - _AlphaOutlineColor: {r: 1, g: 1, b: 1, a: 1} + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _ColorChangeNewCol: {r: 1, g: 1, b: 0, a: 1} + - _ColorChangeNewCol2: {r: 1, g: 1, b: 0, a: 1} + - _ColorChangeNewCol3: {r: 1, g: 1, b: 0, a: 1} + - _ColorChangeTarget: {r: 1, g: 0, b: 0, a: 1} + - _ColorChangeTarget2: {r: 1, g: 0, b: 0, a: 1} + - _ColorChangeTarget3: {r: 1, g: 0, b: 0, a: 1} + - _ColorSwapBlue: {r: 1, g: 1, b: 1, a: 1} + - _ColorSwapGreen: {r: 1, g: 1, b: 1, a: 1} + - _ColorSwapRed: {r: 1, g: 1, b: 1, a: 1} + - _FadeBurnColor: {r: 1, g: 1, b: 0, a: 1} + - _GlowColor: {r: 1, g: 1, b: 1, a: 1} + - _GradBotLeftCol: {r: 0, g: 0, b: 1, a: 1} + - _GradBotRightCol: {r: 0, g: 0, b: 1, a: 1} + - _GradTopLeftCol: {r: 1, g: 0, b: 0, a: 1} + - _GradTopRightCol: {r: 1, g: 0, b: 0, a: 1} + - _GreyscaleTintColor: {r: 1, g: 1, b: 1, a: 1} + - _HitEffectColor: {r: 1, g: 1, b: 1, a: 1} + - _HologramStripeColor: {r: 1, g: 1, b: 1, a: 1} + - _InnerOutlineColor: {r: 1, g: 0.2028302, b: 0.9452239, a: 1} + - _OutlineColor: {r: 1, g: 1, b: 1, a: 1} + - _OverlayColor: {r: 1, g: 1, b: 1, a: 1} + - _ShadowColor: {r: 0, g: 0, b: 0, a: 1} + - _ShineColor: {r: 1, g: 1, b: 1, a: 1} +--- !u!1 &540070582 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 540070583} + - component: {fileID: 540070586} + - component: {fileID: 540070585} + - component: {fileID: 540070584} + m_Layer: 0 + m_Name: Frame + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &540070583 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 540070582} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 6.839, y: 1.962, z: 1} + m_Children: + - {fileID: 269805654} + - {fileID: 1120672005} + m_Father: {fileID: 1211354477} + m_RootOrder: 2 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!95 &540070584 +Animator: + serializedVersion: 3 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 540070582} + m_Enabled: 1 + m_Avatar: {fileID: 0} + m_Controller: {fileID: 9100000, guid: f36bce3b3e7e3c5488117e16e426deb5, type: 2} + m_CullingMode: 0 + m_UpdateMode: 0 + m_ApplyRootMotion: 0 + m_LinearVelocityBlending: 0 + m_WarningMessage: + m_HasTransformHierarchy: 1 + m_AllowConstantClipSamplingOptimization: 1 + m_KeepAnimatorControllerStateOnDisable: 0 +--- !u!114 &540070585 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 540070582} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: ee158225ee1e59f4791627785501d950, type: 3} + m_Name: + m_EditorClassIdentifier: + currentShaderType: 4 + normalStrength: 5 + normalSmoothing: 1 + computingNormal: 0 +--- !u!212 &540070586 +SpriteRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 540070582} + m_Enabled: 1 + m_CastShadows: 0 + m_ReceiveShadows: 0 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 1537019967} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 0 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_Sprite: {fileID: 21300000, guid: fab06e0be9375cc4d823efa71629885c, type: 3} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_FlipX: 0 + m_FlipY: 0 + m_DrawMode: 0 + m_Size: {x: 1, y: 1} + m_AdaptiveModeThreshold: 0.5 + m_SpriteTileMode: 0 + m_WasSpriteAssigned: 1 + m_MaskInteraction: 0 + m_SpriteSortPoint: 0 +--- !u!21 &540543599 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: AllIn1SpriteShader/AllIn1SpriteShader + m_Shader: {fileID: 4800000, guid: a36b7719ff0465b42ab1407d67672c5f, type: 3} + m_ShaderKeywords: DISTORT_ON GLOW_ON WAVEUV_ON + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _ColorRampTex: + m_Texture: {fileID: 2800000, guid: 279657edc397ece4b8029c727adf6ddc, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ColorRampTexGradient: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ColorSwapTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DistortTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 0.5, y: 0.5} + m_Offset: {x: 0, y: 0} + - _FadeBurnTex: + m_Texture: {fileID: 2800000, guid: 677cca399782dea41aedc1d292ecb67d, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _FadeTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _GlowTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MainTex: + m_Texture: {fileID: 2800000, guid: 7f33f36658f399a44be84455bcd911b1, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OutlineDistortTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OutlineTex: + m_Texture: {fileID: 2800000, guid: 74087f6d03f233e4a8a142fa01f9e5cf, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OverlayTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ShineMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - _Alpha: 1 + - _AlphaCutoffValue: 0.25 + - _AlphaOutlineBlend: 1 + - _AlphaOutlineGlow: 5 + - _AlphaOutlineMinAlpha: 0 + - _AlphaOutlinePower: 1 + - _AlphaRoundThreshold: 0.5 + - _BillboardY: 0 + - _BlurHD: 0 + - _BlurIntensity: 10 + - _Brightness: 0 + - _ChromAberrAlpha: 0.4 + - _ChromAberrAmount: 1 + - _ClipUvDown: 0 + - _ClipUvLeft: 0 + - _ClipUvRight: 0 + - _ClipUvUp: 0 + - _ColorChangeLuminosity: 0 + - _ColorChangeTolerance: 0.25 + - _ColorChangeTolerance2: 0.25 + - _ColorChangeTolerance3: 0.25 + - _ColorRampBlend: 1 + - _ColorRampLuminosity: 0 + - _ColorRampOutline: 0 + - _ColorSwapBlend: 1 + - _ColorSwapBlueLuminosity: 0.5 + - _ColorSwapGreenLuminosity: 0.5 + - _ColorSwapRedLuminosity: 0.5 + - _Contrast: 1 + - _CullingOption: 0 + - _DistortAmount: 0.5 + - _DistortTexXSpeed: 2 + - _DistortTexYSpeed: 2 + - _EditorDrawers: 6 + - _FadeAmount: -0.1 + - _FadeBurnGlow: 2 + - _FadeBurnTransition: 0.075 + - _FadeBurnWidth: 0.025 + - _FishEyeUvAmount: 0.35 + - _FlickerAlpha: 0 + - _FlickerFreq: 0.2 + - _FlickerPercent: 0.05 + - _GhostBlend: 1 + - _GhostColorBoost: 1 + - _GhostTransparency: 0 + - _GlitchAmount: 3 + - _GlitchSize: 1 + - _Glow: 4.4 + - _GlowGlobal: 1 + - _GlowTexUsed: 0 + - _GradBlend: 1 + - _GradBoostX: 1.2 + - _GradBoostY: 1.2 + - _GradIsRadial: 0 + - _GrassManualAnim: 1 + - _GrassManualToggle: 0 + - _GrassRadialBend: 0.1 + - _GrassSpeed: 2 + - _GrassWind: 20 + - _GreyscaleBlend: 1 + - _GreyscaleLuminosity: 0 + - _GreyscaleOutline: 0 + - _HandDrawnAmount: 10 + - _HandDrawnSpeed: 5 + - _HitEffectBlend: 1 + - _HitEffectGlow: 5 + - _HologramBlend: 1 + - _HologramMaxAlpha: 0.75 + - _HologramMinAlpha: 0.1 + - _HologramStripesAmount: 0.1 + - _HologramStripesSpeed: 4.5 + - _HologramUnmodAmount: 0 + - _HsvBright: 1 + - _HsvSaturation: 1 + - _HsvShift: 180 + - _InnerOutlineAlpha: 1 + - _InnerOutlineGlow: 1 + - _InnerOutlineThickness: 1 + - _MaxXUV: 1 + - _MaxYUV: 1 + - _MinXUV: 0 + - _MinYUV: 0 + - _MotionBlurAngle: 0.1 + - _MotionBlurDist: 1.25 + - _MyDstMode: 10 + - _MySrcMode: 5 + - _NegativeAmount: 1 + - _OffsetUvX: 0 + - _OffsetUvY: 0 + - _OnlyInnerOutline: 0 + - _OnlyOutline: 0 + - _Outline8Directions: 0 + - _OutlineAlpha: 1 + - _OutlineDistortAmount: 0.5 + - _OutlineDistortTexXSpeed: 5 + - _OutlineDistortTexYSpeed: 5 + - _OutlineDistortToggle: 0 + - _OutlineGlow: 1.5 + - _OutlineIsPixel: 0 + - _OutlinePixelWidth: 1 + - _OutlineTexGrey: 0 + - _OutlineTexToggle: 0 + - _OutlineTexXSpeed: 10 + - _OutlineTexYSpeed: 0 + - _OutlineWidth: 0.004 + - _OverlayBlend: 1 + - _OverlayGlow: 1 + - _OverlayTextureScrollXSpeed: 0.25 + - _OverlayTextureScrollYSpeed: 0.25 + - _PinchUvAmount: 0.35 + - _PixelateSize: 32 + - _PosterizeGamma: 0.75 + - _PosterizeNumColors: 8 + - _PosterizeOutline: 0 + - _RadialClip: 45 + - _RadialClip2: 45 + - _RadialClipAngle: 90 + - _RadialClipArc1: 45 + - _RadialClipArc2: 0 + - _RadialStartAngle: 90 + - _RandomSeed: 0 + - _RectSize: 1 + - _RotateUvAmount: 0 + - _RoundWaveSpeed: 2 + - _RoundWaveStrength: 0.7 + - _ShadowAlpha: 0.5 + - _ShadowX: 0.1 + - _ShadowY: -0.05 + - _ShakeUvSpeed: 2.5 + - _ShakeUvX: 1.5 + - _ShakeUvY: 1 + - _ShineGlow: 1 + - _ShineLocation: 0.5 + - _ShineRotate: 0 + - _ShineWidth: 0.1 + - _TextureScrollXSpeed: 1 + - _TextureScrollYSpeed: 0 + - _TwistUvAmount: 1 + - _TwistUvPosX: 0.5 + - _TwistUvPosY: 0.5 + - _TwistUvRadius: 0.75 + - _WarpScale: 0.5 + - _WarpSpeed: 8 + - _WarpStrength: 0.025 + - _WaveAmount: 7 + - _WaveSpeed: 10 + - _WaveStrength: 7.5 + - _WaveX: 0.5 + - _WaveY: 0.5 + - _ZTestMode: 4 + - _ZWrite: 0 + - _ZoomUvAmount: 0.5 + m_Colors: + - ColorSwapRed: {r: 1, g: 1, b: 1, a: 1} + - _AlphaOutlineColor: {r: 1, g: 1, b: 1, a: 1} + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _ColorChangeNewCol: {r: 1, g: 1, b: 0, a: 1} + - _ColorChangeNewCol2: {r: 1, g: 1, b: 0, a: 1} + - _ColorChangeNewCol3: {r: 1, g: 1, b: 0, a: 1} + - _ColorChangeTarget: {r: 1, g: 0, b: 0, a: 1} + - _ColorChangeTarget2: {r: 1, g: 0, b: 0, a: 1} + - _ColorChangeTarget3: {r: 1, g: 0, b: 0, a: 1} + - _ColorSwapBlue: {r: 1, g: 1, b: 1, a: 1} + - _ColorSwapGreen: {r: 1, g: 1, b: 1, a: 1} + - _ColorSwapRed: {r: 1, g: 1, b: 1, a: 1} + - _FadeBurnColor: {r: 1, g: 1, b: 0, a: 1} + - _GlowColor: {r: 1, g: 1, b: 1, a: 1} + - _GradBotLeftCol: {r: 0, g: 0, b: 1, a: 1} + - _GradBotRightCol: {r: 0, g: 0, b: 1, a: 1} + - _GradTopLeftCol: {r: 1, g: 0, b: 0, a: 1} + - _GradTopRightCol: {r: 1, g: 0, b: 0, a: 1} + - _GreyscaleTintColor: {r: 1, g: 1, b: 1, a: 1} + - _HitEffectColor: {r: 1, g: 1, b: 1, a: 1} + - _HologramStripeColor: {r: 0, g: 1, b: 1, a: 1} + - _InnerOutlineColor: {r: 1, g: 0, b: 0, a: 1} + - _OutlineColor: {r: 1, g: 1, b: 1, a: 1} + - _OverlayColor: {r: 1, g: 1, b: 1, a: 1} + - _ShadowColor: {r: 0, g: 0, b: 0, a: 1} + - _ShineColor: {r: 1, g: 1, b: 1, a: 1} +--- !u!1 &540549268 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 540549269} + - component: {fileID: 540549273} + - component: {fileID: 540549272} + - component: {fileID: 540549270} + m_Layer: 0 + m_Name: RadialFillAmount + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &540549269 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 540549268} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 70, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 718105016} + - {fileID: 1843941480} + m_Father: {fileID: 1351315063} + m_RootOrder: 7 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!95 &540549270 +Animator: + serializedVersion: 3 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 540549268} + m_Enabled: 1 + m_Avatar: {fileID: 0} + m_Controller: {fileID: 9100000, guid: f325edee1e9fb044eb0d87aad6d3ece0, type: 2} + m_CullingMode: 0 + m_UpdateMode: 0 + m_ApplyRootMotion: 0 + m_LinearVelocityBlending: 0 + m_WarningMessage: + m_HasTransformHierarchy: 1 + m_AllowConstantClipSamplingOptimization: 1 + m_KeepAnimatorControllerStateOnDisable: 0 +--- !u!114 &540549272 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 540549268} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 98b644315d7a92842b89e04f55c48e02, type: 3} + m_Name: + m_EditorClassIdentifier: +--- !u!212 &540549273 +SpriteRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 540549268} + m_Enabled: 1 + m_CastShadows: 0 + m_ReceiveShadows: 0 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 1118634257} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 0 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_Sprite: {fileID: 21300000, guid: 519dafacd208bb64c83d5124be03b09d, type: 3} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_FlipX: 0 + m_FlipY: 0 + m_DrawMode: 0 + m_Size: {x: 5.12, y: 5.12} + m_AdaptiveModeThreshold: 0.5 + m_SpriteTileMode: 0 + m_WasSpriteAssigned: 1 + m_MaskInteraction: 0 + m_SpriteSortPoint: 0 +--- !u!1 &545525088 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 545525089} + - component: {fileID: 545525091} + - component: {fileID: 545525090} + m_Layer: 0 + m_Name: Animated + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &545525089 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 545525088} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: -3.57, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 597182738} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!102 &545525090 +TextMesh: + serializedVersion: 3 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 545525088} + m_Text: (Gradient Property) + m_OffsetZ: -1.5 + m_CharacterSize: 0.075 + m_LineSpacing: 1 + m_Anchor: 4 + m_Alignment: 0 + m_TabSize: 4 + m_FontSize: 100 + m_FontStyle: 0 + m_RichText: 1 + m_Font: {fileID: 12800000, guid: a4e6a5491519adb45919dc87eff28e55, type: 3} + m_Color: + serializedVersion: 2 + rgba: 4294967295 +--- !u!23 &545525091 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 545525088} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 10100, guid: 0000000000000000e000000000000000, type: 0} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!1 &548255499 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 548255500} + - component: {fileID: 548255504} + - component: {fileID: 548255503} + - component: {fileID: 548255501} + m_Layer: 0 + m_Name: Shine + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &548255500 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 548255499} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 280, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 668913776} + - {fileID: 582865293} + m_Father: {fileID: 2036092933} + m_RootOrder: 28 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!95 &548255501 +Animator: + serializedVersion: 3 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 548255499} + m_Enabled: 1 + m_Avatar: {fileID: 0} + m_Controller: {fileID: 9100000, guid: 1b6613bf9b3fea94380070ae23178552, type: 2} + m_CullingMode: 0 + m_UpdateMode: 0 + m_ApplyRootMotion: 0 + m_LinearVelocityBlending: 0 + m_WarningMessage: + m_HasTransformHierarchy: 1 + m_AllowConstantClipSamplingOptimization: 1 + m_KeepAnimatorControllerStateOnDisable: 0 +--- !u!114 &548255503 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 548255499} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 98b644315d7a92842b89e04f55c48e02, type: 3} + m_Name: + m_EditorClassIdentifier: +--- !u!212 &548255504 +SpriteRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 548255499} + m_Enabled: 1 + m_CastShadows: 0 + m_ReceiveShadows: 0 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2136425119} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 0 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_Sprite: {fileID: 21300000, guid: 519dafacd208bb64c83d5124be03b09d, type: 3} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_FlipX: 0 + m_FlipY: 0 + m_DrawMode: 0 + m_Size: {x: 5.12, y: 5.12} + m_AdaptiveModeThreshold: 0.5 + m_SpriteTileMode: 0 + m_WasSpriteAssigned: 1 + m_MaskInteraction: 0 + m_SpriteSortPoint: 0 +--- !u!1 &550220620 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 550220621} + - component: {fileID: 550220623} + - component: {fileID: 550220622} + m_Layer: 0 + m_Name: Animated + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &550220621 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 550220620} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: -3.5699997, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 1756331349} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!102 &550220622 +TextMesh: + serializedVersion: 3 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 550220620} + m_Text: (Has Sprite Mask) + m_OffsetZ: -1.5 + m_CharacterSize: 0.075 + m_LineSpacing: 1 + m_Anchor: 4 + m_Alignment: 0 + m_TabSize: 4 + m_FontSize: 100 + m_FontStyle: 0 + m_RichText: 1 + m_Font: {fileID: 12800000, guid: a4e6a5491519adb45919dc87eff28e55, type: 3} + m_Color: + serializedVersion: 2 + rgba: 4294967295 +--- !u!23 &550220623 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 550220620} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 10100, guid: 0000000000000000e000000000000000, type: 0} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!1 &556503703 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 556503704} + - component: {fileID: 556503706} + - component: {fileID: 556503705} + m_Layer: 0 + m_Name: Animated + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 0 +--- !u!4 &556503704 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 556503703} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: -3.57, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 1923390774} + m_RootOrder: 2 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!102 &556503705 +TextMesh: + serializedVersion: 3 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 556503703} + m_Text: (Has Animation) + m_OffsetZ: -1.5 + m_CharacterSize: 0.075 + m_LineSpacing: 1 + m_Anchor: 4 + m_Alignment: 0 + m_TabSize: 4 + m_FontSize: 100 + m_FontStyle: 0 + m_RichText: 1 + m_Font: {fileID: 12800000, guid: a4e6a5491519adb45919dc87eff28e55, type: 3} + m_Color: + serializedVersion: 2 + rgba: 4294967295 +--- !u!23 &556503706 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 556503703} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: a4e6a5491519adb45919dc87eff28e55, type: 3} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!1 &564363697 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 564363701} + - component: {fileID: 564363700} + - component: {fileID: 564363699} + - component: {fileID: 564363698} + m_Layer: 5 + m_Name: Canvas + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!114 &564363698 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 564363697} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: dc42784cf147c0c48a680349fa168899, type: 3} + m_Name: + m_EditorClassIdentifier: + m_IgnoreReversedGraphics: 1 + m_BlockingObjects: 0 + m_BlockingMask: + serializedVersion: 2 + m_Bits: 4294967295 +--- !u!114 &564363699 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 564363697} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 0cd44c1031e13a943bb63640046fad76, type: 3} + m_Name: + m_EditorClassIdentifier: + m_UiScaleMode: 1 + m_ReferencePixelsPerUnit: 100 + m_ScaleFactor: 1 + m_ReferenceResolution: {x: 1920, y: 1080} + m_ScreenMatchMode: 0 + m_MatchWidthOrHeight: 0 + m_PhysicalUnit: 3 + m_FallbackScreenDPI: 96 + m_DefaultSpriteDPI: 96 + m_DynamicPixelsPerUnit: 1 +--- !u!223 &564363700 +Canvas: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 564363697} + m_Enabled: 1 + serializedVersion: 3 + m_RenderMode: 1 + m_Camera: {fileID: 999529079} + m_PlaneDistance: 100 + m_PixelPerfect: 0 + m_ReceivesEvents: 1 + m_OverrideSorting: 0 + m_OverridePixelPerfect: 0 + m_SortingBucketNormalizedSize: 0 + m_AdditionalShaderChannelsFlag: 0 + m_SortingLayerID: 0 + m_SortingOrder: -1 + m_TargetDisplay: 0 +--- !u!224 &564363701 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 564363697} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 0, y: 0, z: 0} + m_Children: + - {fileID: 356332866} + - {fileID: 1302433542} + - {fileID: 535274222} + - {fileID: 154474731} + m_Father: {fileID: 0} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 0, y: 0} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} + m_Pivot: {x: 0, y: 0} +--- !u!1 &566664013 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 566664014} + - component: {fileID: 566664016} + - component: {fileID: 566664015} + m_Layer: 0 + m_Name: Animated + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 0 +--- !u!4 &566664014 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 566664013} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: -3.57, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 485976056} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!102 &566664015 +TextMesh: + serializedVersion: 3 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 566664013} + m_Text: (Has Animation) + m_OffsetZ: -1.5 + m_CharacterSize: 0.075 + m_LineSpacing: 1 + m_Anchor: 4 + m_Alignment: 0 + m_TabSize: 4 + m_FontSize: 100 + m_FontStyle: 0 + m_RichText: 1 + m_Font: {fileID: 12800000, guid: a4e6a5491519adb45919dc87eff28e55, type: 3} + m_Color: + serializedVersion: 2 + rgba: 4294967295 +--- !u!23 &566664016 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 566664013} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: a4e6a5491519adb45919dc87eff28e55, type: 3} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!21 &581202604 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: AllIn1SpriteShader/AllIn1SpriteShader + m_Shader: {fileID: 4800000, guid: a36b7719ff0465b42ab1407d67672c5f, type: 3} + m_ShaderKeywords: COLORRAMP_ON ETC1_EXTERNAL_ALPHA + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _ColorRampTex: + m_Texture: {fileID: 2800000, guid: 279657edc397ece4b8029c727adf6ddc, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ColorRampTexGradient: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ColorSwapTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DistortTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _FadeBurnTex: + m_Texture: {fileID: 2800000, guid: 32e8df0008bebe746b1681a71c61f31c, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _FadeTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _GlowTex: + 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} + - _OutlineDistortTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OutlineTex: + m_Texture: {fileID: 2800000, guid: 74087f6d03f233e4a8a142fa01f9e5cf, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OverlayTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ShineMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - _Alpha: 1 + - _AlphaCutoffValue: 0.25 + - _AlphaOutlineBlend: 1 + - _AlphaOutlineGlow: 5 + - _AlphaOutlineMinAlpha: 0 + - _AlphaOutlinePower: 1 + - _AlphaRoundThreshold: 0.5 + - _BillboardY: 0 + - _BlurHD: 0 + - _BlurIntensity: 10 + - _Brightness: 0 + - _ChromAberrAlpha: 0.4 + - _ChromAberrAmount: 1 + - _ClipUvDown: 1 + - _ClipUvLeft: 1 + - _ClipUvRight: 1 + - _ClipUvUp: 1 + - _ColorChangeLuminosity: 0 + - _ColorChangeTolerance: 0.25 + - _ColorChangeTolerance2: 0.25 + - _ColorChangeTolerance3: 0.25 + - _ColorRampBlend: 1 + - _ColorRampLuminosity: 0 + - _ColorRampOutline: 0 + - _ColorSwapBlend: 1 + - _ColorSwapBlueLuminosity: 0.5 + - _ColorSwapGreenLuminosity: 0.5 + - _ColorSwapRedLuminosity: 0.5 + - _Contrast: 1 + - _CullingOption: 0 + - _DistortAmount: 0.5 + - _DistortTexXSpeed: 5 + - _DistortTexYSpeed: 5 + - _EditorDrawers: 6 + - _FadeAmount: -0.1 + - _FadeBurnGlow: 2 + - _FadeBurnTransition: 0.075 + - _FadeBurnWidth: 0.025 + - _FishEyeUvAmount: 0.35 + - _FlickerAlpha: 0 + - _FlickerFreq: 0.2 + - _FlickerPercent: 0.05 + - _GhostBlend: 1 + - _GhostColorBoost: 1 + - _GhostTransparency: 0 + - _GlitchAmount: 3 + - _GlitchSize: 1 + - _Glow: 10 + - _GlowGlobal: 1 + - _GlowTexUsed: 0 + - _GradBlend: 1 + - _GradBoostX: 1.2 + - _GradBoostY: 1.2 + - _GradIsRadial: 0 + - _GrassManualAnim: 1 + - _GrassManualToggle: 0 + - _GrassRadialBend: 0.25 + - _GrassSpeed: 2 + - _GrassWind: 20 + - _GreyscaleBlend: 1 + - _GreyscaleLuminosity: 0 + - _GreyscaleOutline: 0 + - _HandDrawnAmount: 10 + - _HandDrawnSpeed: 5 + - _HitEffectBlend: 1 + - _HitEffectGlow: 5 + - _HologramBlend: 1 + - _HologramFlickerAlpha: 0 + - _HologramFlickerFreq: 0.2 + - _HologramFlickerPercent: 0.05 + - _HologramMaxAlpha: 1 + - _HologramMinAlpha: 0 + - _HologramStripesAlpha: 0.4 + - _HologramStripesAmount: 50 + - _HologramStripesFill: 0.4 + - _HologramStripesLuminosity: 1 + - _HologramStripesSpeed: 5 + - _HologramUnmodAmount: 0.4 + - _HsvBright: 1 + - _HsvSaturation: 1 + - _HsvShift: 180 + - _InnerOutlineAlpha: 1 + - _InnerOutlineGlow: 1 + - _InnerOutlineThickness: 1 + - _MaxXUV: 1 + - _MaxYUV: 1 + - _MinXUV: 0 + - _MinYUV: 0 + - _MotionBlurAngle: 0.1 + - _MotionBlurDist: 1.25 + - _MyDstMode: 10 + - _MySrcMode: 5 + - _NegativeAmount: 1 + - _OffsetUvX: 0 + - _OffsetUvY: 0 + - _OnlyInnerOutline: 0 + - _OnlyOutline: 0 + - _Outline8Directions: 0 + - _OutlineAlpha: 1 + - _OutlineDistortAmount: 0.5 + - _OutlineDistortTexXSpeed: 5 + - _OutlineDistortTexYSpeed: 5 + - _OutlineDistortToggle: 0 + - _OutlineGlow: 1.5 + - _OutlineIsPixel: 0 + - _OutlinePixelWidth: 1 + - _OutlineTexGrey: 0 + - _OutlineTexToggle: 0 + - _OutlineTexXSpeed: 10 + - _OutlineTexYSpeed: 0 + - _OutlineWidth: 0.004 + - _OverlayBlend: 1 + - _OverlayGlow: 1 + - _OverlayTextureScrollXSpeed: 0.25 + - _OverlayTextureScrollYSpeed: 0.25 + - _PinchUvAmount: 0.35 + - _PixelateSize: 32 + - _PosterizeGamma: 0.75 + - _PosterizeNumColors: 8 + - _PosterizeOutline: 0 + - _RadialClip: 45 + - _RadialClip2: 0 + - _RadialClipAngle: 90 + - _RadialClipArc1: 45 + - _RadialClipArc2: 0 + - _RadialStartAngle: 90 + - _RandomSeed: 0 + - _RectSize: 1 + - _RotateUvAmount: 0 + - _RoundWaveSpeed: 2 + - _RoundWaveStrength: 0.7 + - _ShadowAlpha: 0.5 + - _ShadowX: 0.1 + - _ShadowY: -0.05 + - _ShakeUvSpeed: 2.5 + - _ShakeUvX: 1.5 + - _ShakeUvY: 1 + - _ShineGlow: 1 + - _ShineLocation: 0.5 + - _ShineRotate: 0 + - _ShineWidth: 0.1 + - _TextureScrollXSpeed: 1 + - _TextureScrollYSpeed: 0 + - _TwistUvAmount: 1 + - _TwistUvPosX: 0.5 + - _TwistUvPosY: 0.5 + - _TwistUvRadius: 0.75 + - _WarpScale: 0.5 + - _WarpSpeed: 8 + - _WarpStrength: 0.025 + - _WaveAmount: 7 + - _WaveSpeed: 10 + - _WaveStrength: 7.5 + - _WaveX: 0 + - _WaveY: 0.5 + - _ZTestMode: 4 + - _ZWrite: 0 + - _ZoomUvAmount: 0.5 + m_Colors: + - ColorSwapRed: {r: 1, g: 1, b: 1, a: 1} + - _AlphaOutlineColor: {r: 1, g: 1, b: 1, a: 1} + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _ColorChangeNewCol: {r: 1, g: 1, b: 0, a: 1} + - _ColorChangeNewCol2: {r: 1, g: 1, b: 0, a: 1} + - _ColorChangeNewCol3: {r: 1, g: 1, b: 0, a: 1} + - _ColorChangeTarget: {r: 1, g: 0, b: 0, a: 1} + - _ColorChangeTarget2: {r: 1, g: 0, b: 0, a: 1} + - _ColorChangeTarget3: {r: 1, g: 0, b: 0, a: 1} + - _ColorSwapBlue: {r: 1, g: 1, b: 1, a: 1} + - _ColorSwapGreen: {r: 1, g: 1, b: 1, a: 1} + - _ColorSwapRed: {r: 1, g: 1, b: 1, a: 1} + - _FadeBurnColor: {r: 1, g: 1, b: 0, a: 1} + - _GlowColor: {r: 1, g: 1, b: 1, a: 1} + - _GradBotLeftCol: {r: 0, g: 0, b: 1, a: 1} + - _GradBotRightCol: {r: 0, g: 0, b: 1, a: 1} + - _GradTopLeftCol: {r: 1, g: 0, b: 0, a: 1} + - _GradTopRightCol: {r: 1, g: 0, b: 0, a: 1} + - _GreyscaleTintColor: {r: 1, g: 1, b: 1, a: 1} + - _HitEffectColor: {r: 1, g: 1, b: 1, a: 1} + - _HologramStripeColor: {r: 1, g: 1, b: 1, a: 1} + - _InnerOutlineColor: {r: 1, g: 0, b: 0, a: 1} + - _OutlineColor: {r: 1, g: 1, b: 1, a: 1} + - _OverlayColor: {r: 1, g: 1, b: 1, a: 1} + - _ShadowColor: {r: 0, g: 0, b: 0, a: 1} + - _ShineColor: {r: 1, g: 1, b: 1, a: 1} +--- !u!1 &582549647 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 582549648} + - component: {fileID: 582549650} + - component: {fileID: 582549649} + - component: {fileID: 582549651} + m_Layer: 0 + m_Name: FireBack + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &582549648 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 582549647} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1.5838726, y: 1.5838726, z: 1.5838726} + m_Children: [] + m_Father: {fileID: 102412577} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &582549649 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 582549647} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: ee158225ee1e59f4791627785501d950, type: 3} + m_Name: + m_EditorClassIdentifier: + currentShaderType: 4 + normalStrength: 5 + normalSmoothing: 1 + computingNormal: 0 +--- !u!212 &582549650 +SpriteRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 582549647} + m_Enabled: 1 + m_CastShadows: 0 + m_ReceiveShadows: 0 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: 1c2c3a51f881cb443906a57116cf56fe, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 0 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_Sprite: {fileID: 21300000, guid: 2ea3ea54c499d314f957e0a47dc11c9c, type: 3} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_FlipX: 0 + m_FlipY: 0 + m_DrawMode: 0 + m_Size: {x: 5.12, y: 5.12} + m_AdaptiveModeThreshold: 0.5 + m_SpriteTileMode: 0 + m_WasSpriteAssigned: 1 + m_MaskInteraction: 0 + m_SpriteSortPoint: 0 +--- !u!114 &582549651 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 582549647} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 384dba07353e1f242b467b6857a1e3d4, type: 3} + m_Name: + m_EditorClassIdentifier: + numericPropertyName: _RotateUvAmount + scrollSpeed: 5 + applyModulo: 1 + modulo: 6.28 + mat: {fileID: 0} +--- !u!1 &582865292 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 582865293} + - component: {fileID: 582865295} + - component: {fileID: 582865294} + m_Layer: 0 + m_Name: Animated + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &582865293 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 582865292} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: -3.57, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 548255500} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!102 &582865294 +TextMesh: + serializedVersion: 3 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 582865292} + m_Text: (Has Animation) + m_OffsetZ: -1.5 + m_CharacterSize: 0.075 + m_LineSpacing: 1 + m_Anchor: 4 + m_Alignment: 0 + m_TabSize: 4 + m_FontSize: 100 + m_FontStyle: 0 + m_RichText: 1 + m_Font: {fileID: 12800000, guid: a4e6a5491519adb45919dc87eff28e55, type: 3} + m_Color: + serializedVersion: 2 + rgba: 4294967295 +--- !u!23 &582865295 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 582865292} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 10100, guid: 0000000000000000e000000000000000, type: 0} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!1 &584220653 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 584220654} + - component: {fileID: 584220657} + - component: {fileID: 584220656} + m_Layer: 0 + m_Name: Thermal Vision + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &584220654 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 584220653} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 320, y: 0, z: 0} + m_LocalScale: {x: 0.80276, y: 0.80276, z: 0.80276} + m_Children: + - {fileID: 1464450239} + - {fileID: 419511670} + m_Father: {fileID: 1563905016} + m_RootOrder: 32 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &584220656 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 584220653} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 98b644315d7a92842b89e04f55c48e02, type: 3} + m_Name: + m_EditorClassIdentifier: +--- !u!212 &584220657 +SpriteRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 584220653} + m_Enabled: 1 + m_CastShadows: 0 + m_ReceiveShadows: 0 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 1065071623} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 0 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_Sprite: {fileID: 21300000, guid: 519dafacd208bb64c83d5124be03b09d, type: 3} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_FlipX: 0 + m_FlipY: 0 + m_DrawMode: 0 + m_Size: {x: 5.12, y: 5.12} + m_AdaptiveModeThreshold: 0.5 + m_SpriteTileMode: 0 + m_WasSpriteAssigned: 1 + m_MaskInteraction: 0 + m_SpriteSortPoint: 0 +--- !u!1 &586081878 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 586081879} + - component: {fileID: 586081881} + - component: {fileID: 586081882} + m_Layer: 0 + m_Name: Greyscale + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &586081879 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 586081878} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 180, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 1880243540} + - {fileID: 317082045} + m_Father: {fileID: 2036092933} + m_RootOrder: 18 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!212 &586081881 +SpriteRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 586081878} + m_Enabled: 1 + m_CastShadows: 0 + m_ReceiveShadows: 0 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 665239746} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 0 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_Sprite: {fileID: 21300000, guid: 519dafacd208bb64c83d5124be03b09d, type: 3} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_FlipX: 0 + m_FlipY: 0 + m_DrawMode: 0 + m_Size: {x: 5.12, y: 5.12} + m_AdaptiveModeThreshold: 0.5 + m_SpriteTileMode: 0 + m_WasSpriteAssigned: 1 + m_MaskInteraction: 0 + m_SpriteSortPoint: 0 +--- !u!114 &586081882 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 586081878} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 98b644315d7a92842b89e04f55c48e02, type: 3} + m_Name: + m_EditorClassIdentifier: +--- !u!1 &588736391 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 588736392} + - component: {fileID: 588736394} + - component: {fileID: 588736393} + m_Layer: 0 + m_Name: Animated + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 0 +--- !u!4 &588736392 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 588736391} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: -3.57, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 47460684} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!102 &588736393 +TextMesh: + serializedVersion: 3 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 588736391} + m_Text: (Has Animation) + m_OffsetZ: -1.5 + m_CharacterSize: 0.075 + m_LineSpacing: 1 + m_Anchor: 4 + m_Alignment: 0 + m_TabSize: 4 + m_FontSize: 100 + m_FontStyle: 0 + m_RichText: 1 + m_Font: {fileID: 12800000, guid: a4e6a5491519adb45919dc87eff28e55, type: 3} + m_Color: + serializedVersion: 2 + rgba: 4294967295 +--- !u!23 &588736394 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 588736391} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: a4e6a5491519adb45919dc87eff28e55, type: 3} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!1 &595151376 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 595151377} + - component: {fileID: 595151378} + m_Layer: 0 + m_Name: Pattern + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &595151377 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 595151376} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 120, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 5952972451371321220} + - {fileID: 834551331} + - {fileID: 2117073028} + m_Father: {fileID: 1563905016} + m_RootOrder: 12 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &595151378 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 595151376} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 98b644315d7a92842b89e04f55c48e02, type: 3} + m_Name: + m_EditorClassIdentifier: +--- !u!1 &595980603 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 595980604} + - component: {fileID: 595980606} + - component: {fileID: 595980605} + m_Layer: 0 + m_Name: Title + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &595980604 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 595980603} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: -2.51, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 102412577} + m_RootOrder: 3 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!102 &595980605 +TextMesh: + serializedVersion: 3 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 595980603} + m_Text: Magic Tornado + m_OffsetZ: -1.5 + m_CharacterSize: 0.075 + m_LineSpacing: 1 + m_Anchor: 4 + m_Alignment: 0 + m_TabSize: 4 + m_FontSize: 100 + m_FontStyle: 0 + m_RichText: 1 + m_Font: {fileID: 12800000, guid: a4e6a5491519adb45919dc87eff28e55, type: 3} + m_Color: + serializedVersion: 2 + rgba: 4294967295 +--- !u!23 &595980606 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 595980603} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 10100, guid: 0000000000000000e000000000000000, type: 0} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!1 &597182737 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 597182738} + - component: {fileID: 597182741} + - component: {fileID: 597182740} + m_Layer: 0 + m_Name: Color Ramp Gradient + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &597182738 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 597182737} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 140, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 316406008} + - {fileID: 545525089} + m_Father: {fileID: 2036092933} + m_RootOrder: 14 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &597182740 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 597182737} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 98b644315d7a92842b89e04f55c48e02, type: 3} + m_Name: + m_EditorClassIdentifier: +--- !u!212 &597182741 +SpriteRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 597182737} + m_Enabled: 1 + m_CastShadows: 0 + m_ReceiveShadows: 0 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: 1c07bf10ccbd5c643b7a3d99b400a745, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 0 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_Sprite: {fileID: 21300000, guid: 519dafacd208bb64c83d5124be03b09d, type: 3} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_FlipX: 0 + m_FlipY: 0 + m_DrawMode: 0 + m_Size: {x: 5.12, y: 5.12} + m_AdaptiveModeThreshold: 0.5 + m_SpriteTileMode: 0 + m_WasSpriteAssigned: 1 + m_MaskInteraction: 0 + m_SpriteSortPoint: 0 +--- !u!1 &601434482 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 601434483} + - component: {fileID: 601434485} + - component: {fileID: 601434484} + m_Layer: 0 + m_Name: Title + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &601434483 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 601434482} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: -2.51, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 1350115731} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!102 &601434484 +TextMesh: + serializedVersion: 3 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 601434482} + m_Text: Evil Marine + m_OffsetZ: -1.5 + m_CharacterSize: 0.075 + m_LineSpacing: 1 + m_Anchor: 4 + m_Alignment: 0 + m_TabSize: 4 + m_FontSize: 100 + m_FontStyle: 0 + m_RichText: 1 + m_Font: {fileID: 12800000, guid: a4e6a5491519adb45919dc87eff28e55, type: 3} + m_Color: + serializedVersion: 2 + rgba: 4294967295 +--- !u!23 &601434485 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 601434482} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 10100, guid: 0000000000000000e000000000000000, type: 0} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!1 &605528099 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 605528100} + - component: {fileID: 605528102} + - component: {fileID: 605528101} + m_Layer: 0 + m_Name: Title + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &605528100 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 605528099} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: -2.51, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 252177636} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!102 &605528101 +TextMesh: + serializedVersion: 3 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 605528099} + m_Text: Gameboy + m_OffsetZ: -1.5 + m_CharacterSize: 0.075 + m_LineSpacing: 1 + m_Anchor: 4 + m_Alignment: 0 + m_TabSize: 4 + m_FontSize: 100 + m_FontStyle: 0 + m_RichText: 1 + m_Font: {fileID: 12800000, guid: a4e6a5491519adb45919dc87eff28e55, type: 3} + m_Color: + serializedVersion: 2 + rgba: 4294967295 +--- !u!23 &605528102 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 605528099} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 10100, guid: 0000000000000000e000000000000000, type: 0} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!1 &608638372 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 608638373} + - component: {fileID: 608638375} + - component: {fileID: 608638374} + m_Layer: 0 + m_Name: Title + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &608638373 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 608638372} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: -2.51, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 1675838108} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!102 &608638374 +TextMesh: + serializedVersion: 3 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 608638372} + m_Text: Army + m_OffsetZ: -1.5 + m_CharacterSize: 0.075 + m_LineSpacing: 1 + m_Anchor: 4 + m_Alignment: 0 + m_TabSize: 4 + m_FontSize: 100 + m_FontStyle: 0 + m_RichText: 1 + m_Font: {fileID: 12800000, guid: a4e6a5491519adb45919dc87eff28e55, type: 3} + m_Color: + serializedVersion: 2 + rgba: 4294967295 +--- !u!23 &608638375 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 608638372} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 10100, guid: 0000000000000000e000000000000000, type: 0} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!21 &611714447 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: AllIn1SpriteShader/AllIn1SpriteShader + m_Shader: {fileID: 4800000, guid: a36b7719ff0465b42ab1407d67672c5f, type: 3} + m_ShaderKeywords: CLIPPING_ON COLORRAMP_ON ETC1_EXTERNAL_ALPHA OFFSETUV_ON OUTBASE8DIR_ON + OUTBASE_ON _OUTLINE8DIRECTIONS_ON + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _ColorRampTex: + m_Texture: {fileID: 2800000, guid: 359431ef2af87794198688f7c632c1e3, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ColorRampTexGradient: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ColorSwapTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DistortTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _FadeBurnTex: + m_Texture: {fileID: 2800000, guid: 32e8df0008bebe746b1681a71c61f31c, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _FadeTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _GlowTex: + 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} + - _OutlineDistortTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OutlineTex: + m_Texture: {fileID: 2800000, guid: 74087f6d03f233e4a8a142fa01f9e5cf, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OverlayTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ShineMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - _Alpha: 1 + - _AlphaCutoffValue: 0.25 + - _AlphaOutlineBlend: 1 + - _AlphaOutlineGlow: 5 + - _AlphaOutlineMinAlpha: 0 + - _AlphaOutlinePower: 1 + - _AlphaRoundThreshold: 0.5 + - _BillboardY: 0 + - _BlurHD: 0 + - _BlurIntensity: 10 + - _Brightness: 0 + - _ChromAberrAlpha: 0.4 + - _ChromAberrAmount: 1 + - _ClipUvDown: 0 + - _ClipUvLeft: 0 + - _ClipUvRight: 0 + - _ClipUvUp: 0.04 + - _ColorChangeLuminosity: 0 + - _ColorChangeTolerance: 0.25 + - _ColorChangeTolerance2: 0.25 + - _ColorChangeTolerance3: 0.25 + - _ColorRampBlend: 1 + - _ColorRampLuminosity: 0 + - _ColorRampOutline: 0 + - _ColorSwapBlend: 1 + - _ColorSwapBlueLuminosity: 0.5 + - _ColorSwapGreenLuminosity: 0.5 + - _ColorSwapRedLuminosity: 0.5 + - _Contrast: 1 + - _CullingOption: 0 + - _DistortAmount: 0.5 + - _DistortTexXSpeed: 5 + - _DistortTexYSpeed: 5 + - _EditorDrawers: 6 + - _FadeAmount: -0.1 + - _FadeBurnGlow: 2 + - _FadeBurnTransition: 0.075 + - _FadeBurnWidth: 0.025 + - _FishEyeUvAmount: 0.35 + - _FlickerAlpha: 0 + - _FlickerFreq: 0.2 + - _FlickerPercent: 0.05 + - _GhostBlend: 1 + - _GhostColorBoost: 1 + - _GhostTransparency: 0 + - _GlitchAmount: 3 + - _GlitchSize: 1 + - _Glow: 10 + - _GlowGlobal: 1 + - _GlowTexUsed: 0 + - _GradBlend: 1 + - _GradBoostX: 1.2 + - _GradBoostY: 1.2 + - _GradIsRadial: 0 + - _GrassManualAnim: 1 + - _GrassManualToggle: 0 + - _GrassRadialBend: 0.25 + - _GrassSpeed: 2 + - _GrassWind: 20 + - _GreyscaleBlend: 1 + - _GreyscaleLuminosity: 0 + - _GreyscaleOutline: 0 + - _HandDrawnAmount: 10 + - _HandDrawnSpeed: 5 + - _HitEffectBlend: 1 + - _HitEffectGlow: 5 + - _HologramBlend: 1 + - _HologramFlickerAlpha: 0 + - _HologramFlickerFreq: 0.2 + - _HologramFlickerPercent: 0.05 + - _HologramMaxAlpha: 1 + - _HologramMinAlpha: 0 + - _HologramStripesAlpha: 0.4 + - _HologramStripesAmount: 50 + - _HologramStripesFill: 0.4 + - _HologramStripesLuminosity: 1 + - _HologramStripesSpeed: 5 + - _HologramUnmodAmount: 0.4 + - _HsvBright: 1 + - _HsvSaturation: 1 + - _HsvShift: 180 + - _InnerOutlineAlpha: 1 + - _InnerOutlineGlow: 1 + - _InnerOutlineThickness: 1 + - _MaxXUV: 1 + - _MaxYUV: 1 + - _MinXUV: 0 + - _MinYUV: 0 + - _MotionBlurAngle: 0.1 + - _MotionBlurDist: 1.25 + - _MyDstMode: 10 + - _MySrcMode: 5 + - _NegativeAmount: 1 + - _OffsetUvX: 0 + - _OffsetUvY: 0 + - _OnlyInnerOutline: 0 + - _OnlyOutline: 0 + - _Outline8Directions: 1 + - _OutlineAlpha: 1 + - _OutlineDistortAmount: 0.5 + - _OutlineDistortTexXSpeed: 5 + - _OutlineDistortTexYSpeed: 5 + - _OutlineDistortToggle: 0 + - _OutlineGlow: 1.5 + - _OutlineIsPixel: 0 + - _OutlinePixelWidth: 1 + - _OutlineTexGrey: 0 + - _OutlineTexToggle: 0 + - _OutlineTexXSpeed: 10 + - _OutlineTexYSpeed: 0 + - _OutlineWidth: 0.0156 + - _OverlayBlend: 1 + - _OverlayGlow: 1 + - _OverlayTextureScrollXSpeed: 0.25 + - _OverlayTextureScrollYSpeed: 0.25 + - _PinchUvAmount: 0 + - _PixelateSize: 32 + - _PosterizeGamma: 0.75 + - _PosterizeNumColors: 8 + - _PosterizeOutline: 0 + - _RadialClip: 0 + - _RadialClip2: 45 + - _RadialClipAngle: 90 + - _RadialClipArc1: 45 + - _RadialClipArc2: 0 + - _RadialStartAngle: 90 + - _RandomSeed: 0 + - _RectSize: 1 + - _RotateUvAmount: 0 + - _RoundWaveSpeed: 2 + - _RoundWaveStrength: 0.7 + - _ShadowAlpha: 0.5 + - _ShadowX: 0.1 + - _ShadowY: -0.05 + - _ShakeUvSpeed: 2.5 + - _ShakeUvX: 1.5 + - _ShakeUvY: 1 + - _ShineGlow: 1 + - _ShineLocation: 0.5 + - _ShineRotate: 0 + - _ShineWidth: 0.1 + - _TextureScrollXSpeed: 1 + - _TextureScrollYSpeed: 0 + - _TwistUvAmount: 1 + - _TwistUvPosX: 0.5 + - _TwistUvPosY: 0.5 + - _TwistUvRadius: 0.75 + - _WarpScale: 0.5 + - _WarpSpeed: 8 + - _WarpStrength: 0.025 + - _WaveAmount: 7 + - _WaveSpeed: 10 + - _WaveStrength: 7.5 + - _WaveX: 0 + - _WaveY: 0.5 + - _ZTestMode: 4 + - _ZWrite: 0 + - _ZoomUvAmount: 0.5 + m_Colors: + - ColorSwapRed: {r: 1, g: 1, b: 1, a: 1} + - _AlphaOutlineColor: {r: 1, g: 1, b: 1, a: 1} + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _ColorChangeNewCol: {r: 1, g: 1, b: 0, a: 1} + - _ColorChangeNewCol2: {r: 1, g: 1, b: 0, a: 1} + - _ColorChangeNewCol3: {r: 1, g: 1, b: 0, a: 1} + - _ColorChangeTarget: {r: 1, g: 0, b: 0, a: 1} + - _ColorChangeTarget2: {r: 1, g: 0, b: 0, a: 1} + - _ColorChangeTarget3: {r: 1, g: 0, b: 0, a: 1} + - _ColorSwapBlue: {r: 1, g: 1, b: 1, a: 1} + - _ColorSwapGreen: {r: 1, g: 1, b: 1, a: 1} + - _ColorSwapRed: {r: 1, g: 1, b: 1, a: 1} + - _FadeBurnColor: {r: 1, g: 1, b: 0, a: 1} + - _GlowColor: {r: 1, g: 1, b: 1, a: 1} + - _GradBotLeftCol: {r: 0, g: 0, b: 1, a: 1} + - _GradBotRightCol: {r: 0, g: 0, b: 1, a: 1} + - _GradTopLeftCol: {r: 1, g: 0, b: 0, a: 1} + - _GradTopRightCol: {r: 1, g: 0, b: 0, a: 1} + - _GreyscaleTintColor: {r: 1, g: 1, b: 1, a: 1} + - _HitEffectColor: {r: 1, g: 1, b: 1, a: 1} + - _HologramStripeColor: {r: 1, g: 1, b: 1, a: 1} + - _InnerOutlineColor: {r: 1, g: 0, b: 0, a: 1} + - _OutlineColor: {r: 1, g: 1, b: 1, a: 1} + - _OverlayColor: {r: 1, g: 1, b: 1, a: 1} + - _ShadowColor: {r: 0, g: 0, b: 0, a: 1} + - _ShineColor: {r: 1, g: 1, b: 1, a: 1} +--- !u!1 &624559470 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 624559471} + - component: {fileID: 624559473} + - component: {fileID: 624559472} + m_Layer: 0 + m_Name: Title + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &624559471 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 624559470} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: -2.51, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 984096428} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!102 &624559472 +TextMesh: + serializedVersion: 3 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 624559470} + m_Text: 'Gradient + +' + m_OffsetZ: -1.5 + m_CharacterSize: 0.075 + m_LineSpacing: 1 + m_Anchor: 4 + m_Alignment: 0 + m_TabSize: 4 + m_FontSize: 100 + m_FontStyle: 0 + m_RichText: 1 + m_Font: {fileID: 12800000, guid: a4e6a5491519adb45919dc87eff28e55, type: 3} + m_Color: + serializedVersion: 2 + rgba: 4294967295 +--- !u!23 &624559473 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 624559470} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 10100, guid: 0000000000000000e000000000000000, type: 0} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!21 &639189023 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: AllIn1SpriteShader/AllIn1SpriteShader + m_Shader: {fileID: 4800000, guid: a36b7719ff0465b42ab1407d67672c5f, type: 3} + m_ShaderKeywords: ETC1_EXTERNAL_ALPHA FADE_ON GLOWTEX_ON HITEFFECT_ON OUTBASE8DIR_ON + OUTBASE_ON _GLOWTEXUSED_ON _OUTLINE8DIRECTIONS_ON + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _ColorRampTex: + m_Texture: {fileID: 2800000, guid: 279657edc397ece4b8029c727adf6ddc, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ColorRampTexGradient: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ColorSwapTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DistortTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _FadeBurnTex: + m_Texture: {fileID: 2800000, guid: 677cca399782dea41aedc1d292ecb67d, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _FadeTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 0.5, y: 0.5} + m_Offset: {x: 0, y: 0} + - _GlowTex: + m_Texture: {fileID: 2800000, guid: 8608ef90f91271745a17f7210fe1e7db, type: 3} + 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} + - _OutlineDistortTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OutlineTex: + m_Texture: {fileID: 2800000, guid: 74087f6d03f233e4a8a142fa01f9e5cf, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OverlayTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ShineMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - _Alpha: 1 + - _AlphaCutoffValue: 0.25 + - _AlphaOutlineBlend: 1 + - _AlphaOutlineGlow: 5 + - _AlphaOutlineMinAlpha: 0 + - _AlphaOutlinePower: 1 + - _AlphaRoundThreshold: 0.5 + - _BillboardY: 0 + - _BlurHD: 0 + - _BlurIntensity: 10 + - _Brightness: 0 + - _ChromAberrAlpha: 0.4 + - _ChromAberrAmount: 1 + - _ClipUvDown: 1 + - _ClipUvLeft: 1 + - _ClipUvRight: 1 + - _ClipUvUp: 1 + - _ColorChangeLuminosity: 0 + - _ColorChangeTolerance: 0.25 + - _ColorChangeTolerance2: 0.25 + - _ColorChangeTolerance3: 0.25 + - _ColorRampBlend: 1 + - _ColorRampLuminosity: 0 + - _ColorRampOutline: 0 + - _ColorSwapBlend: 1 + - _ColorSwapBlueLuminosity: 0.5 + - _ColorSwapGreenLuminosity: 0.5 + - _ColorSwapRedLuminosity: 0.5 + - _Contrast: 1 + - _CullingOption: 0 + - _DistortAmount: 0.5 + - _DistortTexXSpeed: 5 + - _DistortTexYSpeed: 5 + - _EditorDrawers: 6 + - _FadeAmount: 0.415 + - _FadeBurnGlow: 15 + - _FadeBurnTransition: 0.105 + - _FadeBurnWidth: 0.026 + - _FishEyeUvAmount: 0.35 + - _FlickerAlpha: 0 + - _FlickerFreq: 0.2 + - _FlickerPercent: 0.05 + - _GhostBlend: 1 + - _GhostColorBoost: 1 + - _GhostTransparency: 0 + - _GlitchAmount: 3 + - _GlitchSize: 1 + - _Glow: 3.3 + - _GlowGlobal: 1 + - _GlowTexUsed: 1 + - _GradBlend: 1 + - _GradBoostX: 1.2 + - _GradBoostY: 1.2 + - _GradIsRadial: 0 + - _GrassManualAnim: 1 + - _GrassManualToggle: 0 + - _GrassRadialBend: 0.25 + - _GrassSpeed: 2 + - _GrassWind: 20 + - _GreyscaleBlend: 1 + - _GreyscaleLuminosity: 0 + - _GreyscaleOutline: 0 + - _HandDrawnAmount: 12.82 + - _HandDrawnSpeed: 5 + - _HitEffectBlend: 0 + - _HitEffectGlow: 10.6 + - _HologramBlend: 1 + - _HologramFlickerAlpha: 0 + - _HologramFlickerFreq: 0.2 + - _HologramFlickerPercent: 0.05 + - _HologramMaxAlpha: 1 + - _HologramMinAlpha: 0 + - _HologramStripesAlpha: 0.4 + - _HologramStripesAmount: 50 + - _HologramStripesFill: 0.4 + - _HologramStripesLuminosity: 1 + - _HologramStripesSpeed: 5 + - _HologramUnmodAmount: 0.4 + - _HsvBright: 1 + - _HsvSaturation: 1 + - _HsvShift: 180 + - _InnerOutlineAlpha: 1 + - _InnerOutlineGlow: 1 + - _InnerOutlineThickness: 1 + - _MaxXUV: 1 + - _MaxYUV: 1 + - _MinXUV: 0 + - _MinYUV: 0 + - _MotionBlurAngle: 0.1 + - _MotionBlurDist: 1.25 + - _MyDstMode: 10 + - _MySrcMode: 5 + - _NegativeAmount: 1 + - _OffsetUvX: 0 + - _OffsetUvY: 0 + - _OnlyInnerOutline: 0 + - _OnlyOutline: 0 + - _Outline8Directions: 1 + - _OutlineAlpha: 1 + - _OutlineDistortAmount: 0.5 + - _OutlineDistortTexXSpeed: 5 + - _OutlineDistortTexYSpeed: 5 + - _OutlineDistortToggle: 0 + - _OutlineGlow: 9.8 + - _OutlineIsPixel: 0 + - _OutlinePixelWidth: 1 + - _OutlineTexGrey: 0 + - _OutlineTexToggle: 0 + - _OutlineTexXSpeed: 10 + - _OutlineTexYSpeed: 0 + - _OutlineWidth: 0.011 + - _OverlayBlend: 1 + - _OverlayGlow: 1 + - _OverlayTextureScrollXSpeed: 0.25 + - _OverlayTextureScrollYSpeed: 0.25 + - _PinchUvAmount: 0.35 + - _PixelateSize: 32 + - _PosterizeGamma: 0.75 + - _PosterizeNumColors: 8 + - _PosterizeOutline: 0 + - _RadialClip: 0 + - _RadialClip2: 45 + - _RadialClipAngle: 90 + - _RadialClipArc1: 45 + - _RadialClipArc2: 0 + - _RadialStartAngle: 90 + - _RandomSeed: 0 + - _RectSize: 1 + - _RotateUvAmount: 0 + - _RoundWaveSpeed: 2 + - _RoundWaveStrength: 0.7 + - _ShadowAlpha: 0.5 + - _ShadowX: 0.1 + - _ShadowY: 0 + - _ShakeUvSpeed: 2.5 + - _ShakeUvX: 1.5 + - _ShakeUvY: 1 + - _ShineGlow: 1 + - _ShineLocation: 0.5 + - _ShineRotate: 0 + - _ShineWidth: 0.1 + - _TextureScrollXSpeed: 1 + - _TextureScrollYSpeed: 0 + - _TwistUvAmount: 1 + - _TwistUvPosX: 0.5 + - _TwistUvPosY: 0.5 + - _TwistUvRadius: 0.75 + - _WarpScale: 0.5 + - _WarpSpeed: 8 + - _WarpStrength: 0.025 + - _WaveAmount: 7 + - _WaveSpeed: 10 + - _WaveStrength: 7.5 + - _WaveX: 0 + - _WaveY: 0.5 + - _ZTestMode: 4 + - _ZWrite: 0 + - _ZoomUvAmount: 0.5 + m_Colors: + - ColorSwapRed: {r: 1, g: 1, b: 1, a: 1} + - _AlphaOutlineColor: {r: 1, g: 1, b: 1, a: 1} + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _ColorChangeNewCol: {r: 1, g: 1, b: 0, a: 1} + - _ColorChangeNewCol2: {r: 1, g: 1, b: 0, a: 1} + - _ColorChangeNewCol3: {r: 1, g: 1, b: 0, a: 1} + - _ColorChangeTarget: {r: 1, g: 0, b: 0, a: 1} + - _ColorChangeTarget2: {r: 1, g: 0, b: 0, a: 1} + - _ColorChangeTarget3: {r: 1, g: 0, b: 0, a: 1} + - _ColorSwapBlue: {r: 1, g: 1, b: 1, a: 1} + - _ColorSwapGreen: {r: 1, g: 1, b: 1, a: 1} + - _ColorSwapRed: {r: 1, g: 1, b: 1, a: 1} + - _FadeBurnColor: {r: 1, g: 0.6053487, b: 0, a: 1} + - _GlowColor: {r: 1, g: 0.7193959, b: 0.1273585, a: 1} + - _GradBotLeftCol: {r: 0, g: 0, b: 1, a: 1} + - _GradBotRightCol: {r: 0, g: 0, b: 1, a: 1} + - _GradTopLeftCol: {r: 1, g: 0, b: 0, a: 1} + - _GradTopRightCol: {r: 1, g: 0, b: 0, a: 1} + - _GreyscaleTintColor: {r: 1, g: 1, b: 1, a: 1} + - _HitEffectColor: {r: 0.9622642, g: 0.10987086, b: 0, a: 1} + - _HologramStripeColor: {r: 1, g: 1, b: 1, a: 1} + - _InnerOutlineColor: {r: 1, g: 0, b: 0, a: 1} + - _OutlineColor: {r: 1, g: 0.10969916, b: 0, a: 1} + - _OverlayColor: {r: 1, g: 1, b: 1, a: 1} + - _ShadowColor: {r: 0, g: 0, b: 0, a: 1} + - _ShineColor: {r: 1, g: 1, b: 1, a: 1} +--- !u!1 &642204092 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 642204093} + - component: {fileID: 642204094} + - component: {fileID: 642204095} + m_Layer: 0 + m_Name: ScreenHit + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &642204093 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 642204092} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 200, y: 0, z: 0} + m_LocalScale: {x: 0.80276, y: 0.80276, z: 0.80276} + m_Children: + - {fileID: 266318148} + - {fileID: 144455308} + - {fileID: 245082891} + m_Father: {fileID: 1563905016} + m_RootOrder: 20 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &642204094 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 642204092} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 98b644315d7a92842b89e04f55c48e02, type: 3} + m_Name: + m_EditorClassIdentifier: +--- !u!95 &642204095 +Animator: + serializedVersion: 3 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 642204092} + m_Enabled: 1 + m_Avatar: {fileID: 0} + m_Controller: {fileID: 9100000, guid: 1220612ba20667d46a6e8356073b69b0, type: 2} + m_CullingMode: 0 + m_UpdateMode: 0 + m_ApplyRootMotion: 0 + m_LinearVelocityBlending: 0 + m_WarningMessage: + m_HasTransformHierarchy: 1 + m_AllowConstantClipSamplingOptimization: 1 + m_KeepAnimatorControllerStateOnDisable: 0 +--- !u!1 &644371591 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 644371592} + - component: {fileID: 644371594} + - component: {fileID: 644371593} + m_Layer: 0 + m_Name: Title + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &644371592 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 644371591} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: -2.51, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 1778749804} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!102 &644371593 +TextMesh: + serializedVersion: 3 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 644371591} + m_Text: Hand Drawn + m_OffsetZ: -1.5 + m_CharacterSize: 0.075 + m_LineSpacing: 1 + m_Anchor: 4 + m_Alignment: 0 + m_TabSize: 4 + m_FontSize: 100 + m_FontStyle: 0 + m_RichText: 1 + m_Font: {fileID: 12800000, guid: a4e6a5491519adb45919dc87eff28e55, type: 3} + m_Color: + serializedVersion: 2 + rgba: 4294967295 +--- !u!23 &644371594 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 644371591} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 10100, guid: 0000000000000000e000000000000000, type: 0} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!1 &646019451 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 646019452} + - component: {fileID: 646019454} + - component: {fileID: 646019453} + m_Layer: 0 + m_Name: Animated + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 0 +--- !u!4 &646019452 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 646019451} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: -3.57, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 56751283} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!102 &646019453 +TextMesh: + serializedVersion: 3 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 646019451} + m_Text: (Has Animation) + m_OffsetZ: -1.5 + m_CharacterSize: 0.075 + m_LineSpacing: 1 + m_Anchor: 4 + m_Alignment: 0 + m_TabSize: 4 + m_FontSize: 100 + m_FontStyle: 0 + m_RichText: 1 + m_Font: {fileID: 12800000, guid: a4e6a5491519adb45919dc87eff28e55, type: 3} + m_Color: + serializedVersion: 2 + rgba: 4294967295 +--- !u!23 &646019454 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 646019451} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: a4e6a5491519adb45919dc87eff28e55, type: 3} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!21 &653496752 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: AllIn1SpriteShader/AllIn1SpriteShader + m_Shader: {fileID: 4800000, guid: a36b7719ff0465b42ab1407d67672c5f, type: 3} + m_ShaderKeywords: ETC1_EXTERNAL_ALPHA MOTIONBLUR_ON + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _ColorRampTex: + m_Texture: {fileID: 2800000, guid: 279657edc397ece4b8029c727adf6ddc, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ColorRampTexGradient: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ColorSwapTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DistortTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _FadeBurnTex: + m_Texture: {fileID: 2800000, guid: 677cca399782dea41aedc1d292ecb67d, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _FadeTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _GlowTex: + 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} + - _OutlineDistortTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OutlineTex: + m_Texture: {fileID: 2800000, guid: 74087f6d03f233e4a8a142fa01f9e5cf, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OverlayTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ShineMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - _Alpha: 1 + - _AlphaCutoffValue: 0.25 + - _AlphaOutlineBlend: 1 + - _AlphaOutlineGlow: 5 + - _AlphaOutlineMinAlpha: 0 + - _AlphaOutlinePower: 1 + - _AlphaRoundThreshold: 0.5 + - _BillboardY: 0 + - _BlurHD: 0 + - _BlurIntensity: 10 + - _Brightness: 0 + - _ChromAberrAlpha: 0.4 + - _ChromAberrAmount: 1 + - _ClipUvDown: 0 + - _ClipUvLeft: 0 + - _ClipUvRight: 0 + - _ClipUvUp: 0 + - _ColorChangeLuminosity: 0 + - _ColorChangeTolerance: 0.25 + - _ColorChangeTolerance2: 0.25 + - _ColorChangeTolerance3: 0.25 + - _ColorRampBlend: 1 + - _ColorRampLuminosity: 0 + - _ColorRampOutline: 0 + - _ColorSwapBlend: 1 + - _ColorSwapBlueLuminosity: 0.5 + - _ColorSwapGreenLuminosity: 0.5 + - _ColorSwapRedLuminosity: 0.5 + - _Contrast: 1 + - _CullingOption: 0 + - _DistortAmount: 0.5 + - _DistortTexXSpeed: 5 + - _DistortTexYSpeed: 5 + - _EditorDrawers: 6 + - _FadeAmount: -0.1 + - _FadeBurnGlow: 2 + - _FadeBurnTransition: 0.075 + - _FadeBurnWidth: 0.025 + - _FishEyeUvAmount: 0.35 + - _FlickerAlpha: 0 + - _FlickerFreq: 0.2 + - _FlickerPercent: 0.05 + - _GhostBlend: 1 + - _GhostColorBoost: 1 + - _GhostTransparency: 0 + - _GlitchAmount: 3 + - _GlitchSize: 1 + - _Glow: 10 + - _GlowGlobal: 1 + - _GlowTexUsed: 0 + - _GradBlend: 1 + - _GradBoostX: 1.2 + - _GradBoostY: 1.2 + - _GradIsRadial: 0 + - _GrassManualAnim: 1 + - _GrassManualToggle: 0 + - _GrassRadialBend: 0.25 + - _GrassSpeed: 2 + - _GrassWind: 20 + - _GreyscaleBlend: 1 + - _GreyscaleLuminosity: 0 + - _GreyscaleOutline: 0 + - _HandDrawnAmount: 10 + - _HandDrawnSpeed: 5 + - _HitEffectBlend: 1 + - _HitEffectGlow: 5 + - _HologramBlend: 1 + - _HologramFlickerAlpha: 0 + - _HologramFlickerFreq: 0.2 + - _HologramMaxAlpha: 1 + - _HologramMinAlpha: 0 + - _HologramStripesAlpha: 0.4 + - _HologramStripesAmount: 50 + - _HologramStripesFill: 0.4 + - _HologramStripesLuminosity: 1 + - _HologramStripesSpeed: 5 + - _HologramUnmodAmount: 0.4 + - _HsvBright: 1 + - _HsvSaturation: 1 + - _HsvShift: 180 + - _InnerOutlineAlpha: 1 + - _InnerOutlineGlow: 1 + - _InnerOutlineThickness: 1 + - _MaxXUV: 1 + - _MaxYUV: 1 + - _MinXUV: 0 + - _MinYUV: 0 + - _MotionBlurAngle: 0.345 + - _MotionBlurDist: -1.44 + - _MyDstMode: 10 + - _MySrcMode: 5 + - _NegativeAmount: 1 + - _OffsetUvX: 0 + - _OffsetUvY: 0 + - _OnlyInnerOutline: 0 + - _OnlyOutline: 0 + - _Outline8Directions: 0 + - _OutlineAlpha: 1 + - _OutlineDistortAmount: 0.5 + - _OutlineDistortTexXSpeed: 5 + - _OutlineDistortTexYSpeed: 5 + - _OutlineDistortToggle: 0 + - _OutlineGlow: 1.5 + - _OutlineIsPixel: 0 + - _OutlinePixelWidth: 1 + - _OutlineTexGrey: 0 + - _OutlineTexToggle: 0 + - _OutlineTexXSpeed: 10 + - _OutlineTexYSpeed: 0 + - _OutlineWidth: 0.004 + - _OverlayBlend: 1 + - _OverlayGlow: 1 + - _OverlayTextureScrollXSpeed: 0.25 + - _OverlayTextureScrollYSpeed: 0.25 + - _PinchUvAmount: 0.35 + - _PixelateSize: 32 + - _PosterizeGamma: 0.75 + - _PosterizeNumColors: 8 + - _PosterizeOutline: 0 + - _RadialClip: 0 + - _RadialClip2: 45 + - _RadialClipAngle: 90 + - _RadialClipArc1: 45 + - _RadialClipArc2: 0 + - _RadialStartAngle: 90 + - _RandomSeed: 0 + - _RectSize: 1 + - _RotateUvAmount: 0 + - _RoundWaveSpeed: 2 + - _RoundWaveStrength: 0.7 + - _ShadowAlpha: 0.5 + - _ShadowX: 0.1 + - _ShadowY: -0.05 + - _ShakeUvSpeed: 2.5 + - _ShakeUvX: 1.5 + - _ShakeUvY: 1 + - _ShineGlow: 1 + - _ShineLocation: 0.5 + - _ShineRotate: 0 + - _ShineWidth: 0.1 + - _TextureScrollXSpeed: 1 + - _TextureScrollYSpeed: 0 + - _TwistUvAmount: 1 + - _TwistUvPosX: 0.5 + - _TwistUvPosY: 0.5 + - _TwistUvRadius: 0.75 + - _WarpScale: 0.5 + - _WarpSpeed: 8 + - _WarpStrength: 0.025 + - _WaveAmount: 7 + - _WaveSpeed: 10 + - _WaveStrength: 7.5 + - _WaveX: 0 + - _WaveY: 0.5 + - _ZTestMode: 4 + - _ZWrite: 0 + - _ZoomUvAmount: 0.5 + m_Colors: + - ColorSwapRed: {r: 1, g: 1, b: 1, a: 1} + - _AlphaOutlineColor: {r: 1, g: 1, b: 1, a: 1} + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _ColorChangeNewCol: {r: 1, g: 1, b: 0, a: 1} + - _ColorChangeNewCol2: {r: 1, g: 1, b: 0, a: 1} + - _ColorChangeNewCol3: {r: 1, g: 1, b: 0, a: 1} + - _ColorChangeTarget: {r: 1, g: 0, b: 0, a: 1} + - _ColorChangeTarget2: {r: 1, g: 0, b: 0, a: 1} + - _ColorChangeTarget3: {r: 1, g: 0, b: 0, a: 1} + - _ColorSwapBlue: {r: 1, g: 1, b: 1, a: 1} + - _ColorSwapGreen: {r: 1, g: 1, b: 1, a: 1} + - _ColorSwapRed: {r: 1, g: 1, b: 1, a: 1} + - _FadeBurnColor: {r: 1, g: 1, b: 0, a: 1} + - _GlowColor: {r: 1, g: 1, b: 1, a: 1} + - _GradBotLeftCol: {r: 0, g: 0, b: 1, a: 1} + - _GradBotRightCol: {r: 0, g: 0, b: 1, a: 1} + - _GradTopLeftCol: {r: 1, g: 0, b: 0, a: 1} + - _GradTopRightCol: {r: 1, g: 0, b: 0, a: 1} + - _GreyscaleTintColor: {r: 1, g: 1, b: 1, a: 1} + - _HitEffectColor: {r: 1, g: 1, b: 1, a: 1} + - _HologramStripeColor: {r: 1, g: 1, b: 1, a: 1} + - _InnerOutlineColor: {r: 1, g: 0, b: 0, a: 1} + - _OutlineColor: {r: 1, g: 1, b: 1, a: 1} + - _OverlayColor: {r: 1, g: 1, b: 1, a: 1} + - _ShadowColor: {r: 0, g: 0, b: 0, a: 1} + - _ShineColor: {r: 1, g: 1, b: 1, a: 1} +--- !u!21 &665239746 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: AllIn1SpriteShader/AllIn1SpriteShader + m_Shader: {fileID: 4800000, guid: a36b7719ff0465b42ab1407d67672c5f, type: 3} + m_ShaderKeywords: ETC1_EXTERNAL_ALPHA GREYSCALE_ON + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _ColorRampTex: + m_Texture: {fileID: 2800000, guid: 279657edc397ece4b8029c727adf6ddc, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ColorRampTexGradient: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ColorSwapTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DistortTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _FadeBurnTex: + m_Texture: {fileID: 2800000, guid: 32e8df0008bebe746b1681a71c61f31c, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _FadeTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _GlowTex: + 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} + - _OutlineDistortTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OutlineTex: + m_Texture: {fileID: 2800000, guid: 74087f6d03f233e4a8a142fa01f9e5cf, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OverlayTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ShineMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - _Alpha: 1 + - _AlphaCutoffValue: 0.25 + - _AlphaOutlineBlend: 1 + - _AlphaOutlineGlow: 5 + - _AlphaOutlineMinAlpha: 0 + - _AlphaOutlinePower: 1 + - _AlphaRoundThreshold: 0.5 + - _BillboardY: 0 + - _BlurHD: 0 + - _BlurIntensity: 10 + - _Brightness: 0 + - _ChromAberrAlpha: 0.4 + - _ChromAberrAmount: 1 + - _ClipUvDown: 1 + - _ClipUvLeft: 1 + - _ClipUvRight: 1 + - _ClipUvUp: 1 + - _ColorChangeLuminosity: 0 + - _ColorChangeTolerance: 0.25 + - _ColorChangeTolerance2: 0.25 + - _ColorChangeTolerance3: 0.25 + - _ColorRampBlend: 1 + - _ColorRampLuminosity: 0 + - _ColorRampOutline: 0 + - _ColorSwapBlend: 1 + - _ColorSwapBlueLuminosity: 0.5 + - _ColorSwapGreenLuminosity: 0.5 + - _ColorSwapRedLuminosity: 0.5 + - _Contrast: 1 + - _CullingOption: 0 + - _DistortAmount: 0.5 + - _DistortTexXSpeed: 5 + - _DistortTexYSpeed: 5 + - _EditorDrawers: 6 + - _FadeAmount: -0.1 + - _FadeBurnGlow: 2 + - _FadeBurnTransition: 0.075 + - _FadeBurnWidth: 0.025 + - _FishEyeUvAmount: 0.35 + - _FlickerAlpha: 0 + - _FlickerFreq: 0.2 + - _FlickerPercent: 0.05 + - _GhostBlend: 1 + - _GhostColorBoost: 1 + - _GhostTransparency: 0 + - _GlitchAmount: 3 + - _GlitchSize: 1 + - _Glow: 10 + - _GlowGlobal: 1 + - _GlowTexUsed: 0 + - _GradBlend: 1 + - _GradBoostX: 1.2 + - _GradBoostY: 1.2 + - _GradIsRadial: 0 + - _GrassManualAnim: 1 + - _GrassManualToggle: 0 + - _GrassRadialBend: 0.25 + - _GrassSpeed: 2 + - _GrassWind: 20 + - _GreyscaleBlend: 1 + - _GreyscaleLuminosity: 0.097 + - _GreyscaleOutline: 0 + - _HandDrawnAmount: 10 + - _HandDrawnSpeed: 5 + - _HitEffectBlend: 1 + - _HitEffectGlow: 5 + - _HologramBlend: 1 + - _HologramFlickerAlpha: 0 + - _HologramFlickerFreq: 0.2 + - _HologramFlickerPercent: 0.05 + - _HologramMaxAlpha: 1 + - _HologramMinAlpha: 0 + - _HologramStripesAlpha: 0.4 + - _HologramStripesAmount: 50 + - _HologramStripesFill: 0.4 + - _HologramStripesLuminosity: 1 + - _HologramStripesSpeed: 5 + - _HologramUnmodAmount: 0.4 + - _HsvBright: 1 + - _HsvSaturation: 1 + - _HsvShift: 180 + - _InnerOutlineAlpha: 1 + - _InnerOutlineGlow: 1 + - _InnerOutlineThickness: 1 + - _MaxXUV: 1 + - _MaxYUV: 1 + - _MinXUV: 0 + - _MinYUV: 0 + - _MotionBlurAngle: 0.1 + - _MotionBlurDist: 1.25 + - _MyDstMode: 10 + - _MySrcMode: 5 + - _NegativeAmount: 1 + - _OffsetUvX: 0 + - _OffsetUvY: 0 + - _OnlyInnerOutline: 0 + - _OnlyOutline: 0 + - _Outline8Directions: 0 + - _OutlineAlpha: 1 + - _OutlineDistortAmount: 0.5 + - _OutlineDistortTexXSpeed: 5 + - _OutlineDistortTexYSpeed: 5 + - _OutlineDistortToggle: 0 + - _OutlineGlow: 1.5 + - _OutlineIsPixel: 0 + - _OutlinePixelWidth: 1 + - _OutlineTexGrey: 0 + - _OutlineTexToggle: 0 + - _OutlineTexXSpeed: 10 + - _OutlineTexYSpeed: 0 + - _OutlineWidth: 0.004 + - _OverlayBlend: 1 + - _OverlayGlow: 1 + - _OverlayTextureScrollXSpeed: 0.25 + - _OverlayTextureScrollYSpeed: 0.25 + - _PinchUvAmount: 0.35 + - _PixelateSize: 32 + - _PosterizeGamma: 0.75 + - _PosterizeNumColors: 8 + - _PosterizeOutline: 0 + - _RadialClip: 45 + - _RadialClip2: 0 + - _RadialClipAngle: 90 + - _RadialClipArc1: 45 + - _RadialClipArc2: 0 + - _RadialStartAngle: 90 + - _RandomSeed: 0 + - _RectSize: 1 + - _RotateUvAmount: 0 + - _RoundWaveSpeed: 2 + - _RoundWaveStrength: 0.7 + - _ShadowAlpha: 0.5 + - _ShadowX: 0.1 + - _ShadowY: -0.05 + - _ShakeUvSpeed: 2.5 + - _ShakeUvX: 1.5 + - _ShakeUvY: 1 + - _ShineGlow: 1 + - _ShineLocation: 0.5 + - _ShineRotate: 0 + - _ShineWidth: 0.1 + - _TextureScrollXSpeed: 1 + - _TextureScrollYSpeed: 0 + - _TwistUvAmount: 1 + - _TwistUvPosX: 0.5 + - _TwistUvPosY: 0.5 + - _TwistUvRadius: 0.75 + - _WarpScale: 0.5 + - _WarpSpeed: 8 + - _WarpStrength: 0.025 + - _WaveAmount: 7 + - _WaveSpeed: 10 + - _WaveStrength: 7.5 + - _WaveX: 0 + - _WaveY: 0.5 + - _ZTestMode: 4 + - _ZWrite: 0 + - _ZoomUvAmount: 0.5 + m_Colors: + - ColorSwapRed: {r: 1, g: 1, b: 1, a: 1} + - _AlphaOutlineColor: {r: 1, g: 1, b: 1, a: 1} + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _ColorChangeNewCol: {r: 1, g: 1, b: 0, a: 1} + - _ColorChangeNewCol2: {r: 1, g: 1, b: 0, a: 1} + - _ColorChangeNewCol3: {r: 1, g: 1, b: 0, a: 1} + - _ColorChangeTarget: {r: 1, g: 0, b: 0, a: 1} + - _ColorChangeTarget2: {r: 1, g: 0, b: 0, a: 1} + - _ColorChangeTarget3: {r: 1, g: 0, b: 0, a: 1} + - _ColorSwapBlue: {r: 1, g: 1, b: 1, a: 1} + - _ColorSwapGreen: {r: 1, g: 1, b: 1, a: 1} + - _ColorSwapRed: {r: 1, g: 1, b: 1, a: 1} + - _FadeBurnColor: {r: 1, g: 1, b: 0, a: 1} + - _GlowColor: {r: 1, g: 1, b: 1, a: 1} + - _GradBotLeftCol: {r: 0, g: 0, b: 1, a: 1} + - _GradBotRightCol: {r: 0, g: 0, b: 1, a: 1} + - _GradTopLeftCol: {r: 1, g: 0, b: 0, a: 1} + - _GradTopRightCol: {r: 1, g: 0, b: 0, a: 1} + - _GreyscaleTintColor: {r: 1, g: 1, b: 1, a: 1} + - _HitEffectColor: {r: 1, g: 1, b: 1, a: 1} + - _HologramStripeColor: {r: 1, g: 1, b: 1, a: 1} + - _InnerOutlineColor: {r: 1, g: 0, b: 0, a: 1} + - _OutlineColor: {r: 1, g: 1, b: 1, a: 1} + - _OverlayColor: {r: 1, g: 1, b: 1, a: 1} + - _ShadowColor: {r: 0, g: 0, b: 0, a: 1} + - _ShineColor: {r: 1, g: 1, b: 1, a: 1} +--- !u!1 &668913775 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 668913776} + - component: {fileID: 668913778} + - component: {fileID: 668913777} + m_Layer: 0 + m_Name: Title + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &668913776 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 668913775} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: -2.51, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 548255500} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!102 &668913777 +TextMesh: + serializedVersion: 3 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 668913775} + m_Text: Shine + m_OffsetZ: -1.5 + m_CharacterSize: 0.075 + m_LineSpacing: 1 + m_Anchor: 4 + m_Alignment: 0 + m_TabSize: 4 + m_FontSize: 100 + m_FontStyle: 0 + m_RichText: 1 + m_Font: {fileID: 12800000, guid: a4e6a5491519adb45919dc87eff28e55, type: 3} + m_Color: + serializedVersion: 2 + rgba: 4294967295 +--- !u!23 &668913778 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 668913775} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 10100, guid: 0000000000000000e000000000000000, type: 0} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!1 &671117225 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 671117226} + - component: {fileID: 671117230} + - component: {fileID: 671117229} + - component: {fileID: 671117228} + - component: {fileID: 671117227} + m_Layer: 0 + m_Name: Sprite + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &671117226 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 671117225} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 939106332} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!95 &671117227 +Animator: + serializedVersion: 3 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 671117225} + m_Enabled: 1 + m_Avatar: {fileID: 0} + m_Controller: {fileID: 9100000, guid: 33212171a9274b947914d32a914af1a3, type: 2} + m_CullingMode: 0 + m_UpdateMode: 0 + m_ApplyRootMotion: 0 + m_LinearVelocityBlending: 0 + m_WarningMessage: + m_HasTransformHierarchy: 1 + m_AllowConstantClipSamplingOptimization: 1 + m_KeepAnimatorControllerStateOnDisable: 0 +--- !u!114 &671117228 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 671117225} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: ee158225ee1e59f4791627785501d950, type: 3} + m_Name: + m_EditorClassIdentifier: + currentShaderType: 4 + normalStrength: 5 + normalSmoothing: 1 + computingNormal: 0 +--- !u!114 &671117229 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 671117225} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 98b644315d7a92842b89e04f55c48e02, type: 3} + m_Name: + m_EditorClassIdentifier: +--- !u!212 &671117230 +SpriteRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 671117225} + m_Enabled: 1 + m_CastShadows: 0 + m_ReceiveShadows: 0 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 653496752} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 0 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_Sprite: {fileID: 21300000, guid: 519dafacd208bb64c83d5124be03b09d, type: 3} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_FlipX: 0 + m_FlipY: 0 + m_DrawMode: 0 + m_Size: {x: 5.12, y: 5.12} + m_AdaptiveModeThreshold: 0.5 + m_SpriteTileMode: 0 + m_WasSpriteAssigned: 1 + m_MaskInteraction: 0 + m_SpriteSortPoint: 0 +--- !u!1 &682244416 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 682244417} + - component: {fileID: 682244419} + - component: {fileID: 682244418} + m_Layer: 0 + m_Name: FireFront + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &682244417 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 682244416} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: -0.56, z: -0.05} + m_LocalScale: {x: 0.4067901, y: 0.4067901, z: 0.4067901} + m_Children: [] + m_Father: {fileID: 1953432852} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &682244418 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 682244416} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: ee158225ee1e59f4791627785501d950, type: 3} + m_Name: + m_EditorClassIdentifier: + currentShaderType: 4 + normalStrength: 5 + normalSmoothing: 1 + computingNormal: 0 +--- !u!212 &682244419 +SpriteRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 682244416} + m_Enabled: 1 + m_CastShadows: 0 + m_ReceiveShadows: 0 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 327735240} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 0 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_Sprite: {fileID: 21300000, guid: bd6f48b4407043345b1a3a07df8c4d61, type: 3} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_FlipX: 0 + m_FlipY: 0 + m_DrawMode: 0 + m_Size: {x: 0.04, y: 0.04} + m_AdaptiveModeThreshold: 0.5 + m_SpriteTileMode: 0 + m_WasSpriteAssigned: 1 + m_MaskInteraction: 0 + m_SpriteSortPoint: 0 +--- !u!1 &684127072 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 684127073} + - component: {fileID: 684127075} + - component: {fileID: 684127074} + m_Layer: 0 + m_Name: Animated + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 0 +--- !u!4 &684127073 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 684127072} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: -3.57, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 353408739} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!102 &684127074 +TextMesh: + serializedVersion: 3 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 684127072} + m_Text: (Has Animation) + m_OffsetZ: -1.5 + m_CharacterSize: 0.075 + m_LineSpacing: 1 + m_Anchor: 4 + m_Alignment: 0 + m_TabSize: 4 + m_FontSize: 100 + m_FontStyle: 0 + m_RichText: 1 + m_Font: {fileID: 12800000, guid: a4e6a5491519adb45919dc87eff28e55, type: 3} + m_Color: + serializedVersion: 2 + rgba: 4294967295 +--- !u!23 &684127075 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 684127072} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: a4e6a5491519adb45919dc87eff28e55, type: 3} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!1 &684661038 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 684661039} + - component: {fileID: 684661041} + - component: {fileID: 684661040} + m_Layer: 0 + m_Name: Animated + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 0 +--- !u!4 &684661039 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 684661038} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: -3.57, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 766050008} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!102 &684661040 +TextMesh: + serializedVersion: 3 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 684661038} + m_Text: (Has Animation) + m_OffsetZ: -1.5 + m_CharacterSize: 0.075 + m_LineSpacing: 1 + m_Anchor: 4 + m_Alignment: 0 + m_TabSize: 4 + m_FontSize: 100 + m_FontStyle: 0 + m_RichText: 1 + m_Font: {fileID: 12800000, guid: a4e6a5491519adb45919dc87eff28e55, type: 3} + m_Color: + serializedVersion: 2 + rgba: 4294967295 +--- !u!23 &684661041 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 684661038} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: a4e6a5491519adb45919dc87eff28e55, type: 3} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!1 &694591669 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 694591670} + - component: {fileID: 694591673} + - component: {fileID: 694591671} + m_Layer: 0 + m_Name: Minimalist Soldier + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &694591670 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 694591669} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 300, y: 0, z: 0} + m_LocalScale: {x: 0.80276, y: 0.80276, z: 0.80276} + m_Children: + - {fileID: 1308471598} + - {fileID: 1466512396} + m_Father: {fileID: 1563905016} + m_RootOrder: 30 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &694591671 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 694591669} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 98b644315d7a92842b89e04f55c48e02, type: 3} + m_Name: + m_EditorClassIdentifier: +--- !u!212 &694591673 +SpriteRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 694591669} + m_Enabled: 1 + m_CastShadows: 0 + m_ReceiveShadows: 0 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 217718272} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 0 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_Sprite: {fileID: 21300000, guid: 519dafacd208bb64c83d5124be03b09d, type: 3} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_FlipX: 0 + m_FlipY: 0 + m_DrawMode: 0 + m_Size: {x: 5.12, y: 5.12} + m_AdaptiveModeThreshold: 0.5 + m_SpriteTileMode: 0 + m_WasSpriteAssigned: 1 + m_MaskInteraction: 0 + m_SpriteSortPoint: 0 +--- !u!1 &706131456 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 706131457} + - component: {fileID: 706131459} + - component: {fileID: 706131458} + m_Layer: 0 + m_Name: Animated + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 0 +--- !u!4 &706131457 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 706131456} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: -3.57, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 312669278} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!102 &706131458 +TextMesh: + serializedVersion: 3 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 706131456} + m_Text: (Has Animation) + m_OffsetZ: -1.5 + m_CharacterSize: 0.075 + m_LineSpacing: 1 + m_Anchor: 4 + m_Alignment: 0 + m_TabSize: 4 + m_FontSize: 100 + m_FontStyle: 0 + m_RichText: 1 + m_Font: {fileID: 12800000, guid: a4e6a5491519adb45919dc87eff28e55, type: 3} + m_Color: + serializedVersion: 2 + rgba: 4294967295 +--- !u!23 &706131459 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 706131456} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: a4e6a5491519adb45919dc87eff28e55, type: 3} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!1 &711155182 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 711155183} + - component: {fileID: 711155184} + m_Layer: 0 + m_Name: Ice + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &711155183 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 711155182} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0.0582, y: 0.0425, z: -0.1} + m_LocalScale: {x: 0.67673415, y: 0.7130322, z: 1} + m_Children: [] + m_Father: {fileID: 511167261} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!212 &711155184 +SpriteRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 711155182} + m_Enabled: 1 + m_CastShadows: 0 + m_ReceiveShadows: 0 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: e4599046180b0ac49b3df99ab01b3e27, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 0 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_Sprite: {fileID: 21300000, guid: 49cc75da86b2bb949b1235ad2a384f9b, type: 3} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_FlipX: 0 + m_FlipY: 0 + m_DrawMode: 0 + m_Size: {x: 5.12, y: 5.12} + m_AdaptiveModeThreshold: 0.5 + m_SpriteTileMode: 0 + m_WasSpriteAssigned: 1 + m_MaskInteraction: 1 + m_SpriteSortPoint: 0 +--- !u!1 &712974875 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 712974876} + - component: {fileID: 712974878} + - component: {fileID: 712974877} + m_Layer: 0 + m_Name: Animated + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &712974876 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 712974875} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: -3.57, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 1329663900} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!102 &712974877 +TextMesh: + serializedVersion: 3 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 712974875} + m_Text: (Texture is Tiled) + m_OffsetZ: -1.5 + m_CharacterSize: 0.075 + m_LineSpacing: 1 + m_Anchor: 4 + m_Alignment: 0 + m_TabSize: 4 + m_FontSize: 100 + m_FontStyle: 0 + m_RichText: 1 + m_Font: {fileID: 12800000, guid: a4e6a5491519adb45919dc87eff28e55, type: 3} + m_Color: + serializedVersion: 2 + rgba: 4294967295 +--- !u!23 &712974878 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 712974875} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 10100, guid: 0000000000000000e000000000000000, type: 0} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!1 &718105015 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 718105016} + - component: {fileID: 718105018} + - component: {fileID: 718105017} + m_Layer: 0 + m_Name: Title + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &718105016 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 718105015} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: -2.51, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 540549269} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!102 &718105017 +TextMesh: + serializedVersion: 3 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 718105015} + m_Text: Radial Fill Amount + m_OffsetZ: -1.5 + m_CharacterSize: 0.075 + m_LineSpacing: 1 + m_Anchor: 4 + m_Alignment: 0 + m_TabSize: 4 + m_FontSize: 100 + m_FontStyle: 0 + m_RichText: 1 + m_Font: {fileID: 12800000, guid: a4e6a5491519adb45919dc87eff28e55, type: 3} + m_Color: + serializedVersion: 2 + rgba: 4294967295 +--- !u!23 &718105018 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 718105015} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 10100, guid: 0000000000000000e000000000000000, type: 0} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!1 &720867419 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 720867420} + - component: {fileID: 720867422} + - component: {fileID: 720867421} + m_Layer: 0 + m_Name: Animated + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 0 +--- !u!4 &720867420 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 720867419} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: -3.57, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 471382084} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!102 &720867421 +TextMesh: + serializedVersion: 3 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 720867419} + m_Text: (Has Animation) + m_OffsetZ: -1.5 + m_CharacterSize: 0.075 + m_LineSpacing: 1 + m_Anchor: 4 + m_Alignment: 0 + m_TabSize: 4 + m_FontSize: 100 + m_FontStyle: 0 + m_RichText: 1 + m_Font: {fileID: 12800000, guid: a4e6a5491519adb45919dc87eff28e55, type: 3} + m_Color: + serializedVersion: 2 + rgba: 4294967295 +--- !u!23 &720867422 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 720867419} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: a4e6a5491519adb45919dc87eff28e55, type: 3} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!21 &727703726 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: AllIn1SpriteShader/AllIn1SpriteShader + m_Shader: {fileID: 4800000, guid: a36b7719ff0465b42ab1407d67672c5f, type: 3} + m_ShaderKeywords: BLUR_ON ETC1_EXTERNAL_ALPHA TEXTURESCROLL_ON + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _ColorRampTex: + m_Texture: {fileID: 2800000, guid: 279657edc397ece4b8029c727adf6ddc, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ColorRampTexGradient: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ColorSwapTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DistortTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _FadeBurnTex: + m_Texture: {fileID: 2800000, guid: 32e8df0008bebe746b1681a71c61f31c, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _FadeTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _GlowTex: + 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} + - _OutlineDistortTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OutlineTex: + m_Texture: {fileID: 2800000, guid: 74087f6d03f233e4a8a142fa01f9e5cf, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OverlayTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ShineMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - _Alpha: 1 + - _AlphaCutoffValue: 0.25 + - _AlphaOutlineBlend: 1 + - _AlphaOutlineGlow: 5 + - _AlphaOutlineMinAlpha: 0 + - _AlphaOutlinePower: 1 + - _AlphaRoundThreshold: 0.5 + - _BillboardY: 0 + - _BlurHD: 0 + - _BlurIntensity: 11.1 + - _Brightness: 0 + - _ChromAberrAlpha: 0.4 + - _ChromAberrAmount: 1 + - _ClipUvDown: 1 + - _ClipUvLeft: 1 + - _ClipUvRight: 1 + - _ClipUvUp: 1 + - _ColorChangeLuminosity: 0 + - _ColorChangeTolerance: 0.25 + - _ColorChangeTolerance2: 0.25 + - _ColorChangeTolerance3: 0.25 + - _ColorRampBlend: 1 + - _ColorRampLuminosity: 0 + - _ColorRampOutline: 0 + - _ColorSwapBlend: 1 + - _ColorSwapBlueLuminosity: 0.5 + - _ColorSwapGreenLuminosity: 0.5 + - _ColorSwapRedLuminosity: 0.5 + - _Contrast: 1 + - _CullingOption: 0 + - _DistortAmount: 0.5 + - _DistortTexXSpeed: 5 + - _DistortTexYSpeed: 5 + - _EditorDrawers: 6 + - _FadeAmount: -0.1 + - _FadeBurnGlow: 2 + - _FadeBurnTransition: 0.075 + - _FadeBurnWidth: 0.025 + - _FishEyeUvAmount: 0.35 + - _FlickerAlpha: 0 + - _FlickerFreq: 0.2 + - _FlickerPercent: 0.05 + - _GhostBlend: 1 + - _GhostColorBoost: 1 + - _GhostTransparency: 0 + - _GlitchAmount: 3 + - _GlitchSize: 1 + - _Glow: 10 + - _GlowGlobal: 1 + - _GlowTexUsed: 0 + - _GradBlend: 1 + - _GradBoostX: 1.2 + - _GradBoostY: 1.2 + - _GradIsRadial: 0 + - _GrassManualAnim: 1 + - _GrassManualToggle: 0 + - _GrassRadialBend: 0.25 + - _GrassSpeed: 2 + - _GrassWind: 20 + - _GreyscaleBlend: 1 + - _GreyscaleLuminosity: 0 + - _GreyscaleOutline: 0 + - _HandDrawnAmount: 10 + - _HandDrawnSpeed: 5 + - _HitEffectBlend: 1 + - _HitEffectGlow: 5 + - _HologramBlend: 1 + - _HologramFlickerAlpha: 0 + - _HologramFlickerFreq: 0.2 + - _HologramFlickerPercent: 0.05 + - _HologramMaxAlpha: 1 + - _HologramMinAlpha: 0 + - _HologramStripesAlpha: 0.4 + - _HologramStripesAmount: 50 + - _HologramStripesFill: 0.4 + - _HologramStripesLuminosity: 1 + - _HologramStripesSpeed: 5 + - _HologramUnmodAmount: 0.4 + - _HsvBright: 1 + - _HsvSaturation: 1 + - _HsvShift: 180 + - _InnerOutlineAlpha: 1 + - _InnerOutlineGlow: 1 + - _InnerOutlineThickness: 1 + - _MaxXUV: 1 + - _MaxYUV: 1 + - _MinXUV: 0 + - _MinYUV: 0 + - _MotionBlurAngle: 0.1 + - _MotionBlurDist: 1.25 + - _MyDstMode: 10 + - _MySrcMode: 5 + - _NegativeAmount: 1 + - _OffsetUvX: 0 + - _OffsetUvY: 0 + - _OnlyInnerOutline: 0 + - _OnlyOutline: 0 + - _Outline8Directions: 0 + - _OutlineAlpha: 1 + - _OutlineDistortAmount: 0.5 + - _OutlineDistortTexXSpeed: 5 + - _OutlineDistortTexYSpeed: 5 + - _OutlineDistortToggle: 0 + - _OutlineGlow: 1.5 + - _OutlineIsPixel: 0 + - _OutlinePixelWidth: 1 + - _OutlineTexGrey: 0 + - _OutlineTexToggle: 0 + - _OutlineTexXSpeed: 10 + - _OutlineTexYSpeed: 0 + - _OutlineWidth: 0.004 + - _OverlayBlend: 1 + - _OverlayGlow: 1 + - _OverlayTextureScrollXSpeed: 0.25 + - _OverlayTextureScrollYSpeed: 0.25 + - _PinchUvAmount: 0.35 + - _PixelateSize: 32 + - _PosterizeGamma: 0.75 + - _PosterizeNumColors: 8 + - _PosterizeOutline: 0 + - _RadialClip: 45 + - _RadialClip2: 0 + - _RadialClipAngle: 90 + - _RadialClipArc1: 45 + - _RadialClipArc2: 0 + - _RadialStartAngle: 90 + - _RandomSeed: 0 + - _RectSize: 1 + - _RotateUvAmount: 0 + - _RoundWaveSpeed: 2 + - _RoundWaveStrength: 0.7 + - _ShadowAlpha: 0.5 + - _ShadowX: 0.1 + - _ShadowY: -0.05 + - _ShakeUvSpeed: 2.5 + - _ShakeUvX: 1.5 + - _ShakeUvY: 1 + - _ShineGlow: 1 + - _ShineLocation: 0.5 + - _ShineRotate: 0 + - _ShineWidth: 0.1 + - _TextureScrollXSpeed: 0.5 + - _TextureScrollYSpeed: 0 + - _TwistUvAmount: 1 + - _TwistUvPosX: 0.5 + - _TwistUvPosY: 0.5 + - _TwistUvRadius: 0.75 + - _WarpScale: 0.5 + - _WarpSpeed: 8 + - _WarpStrength: 0.025 + - _WaveAmount: 7 + - _WaveSpeed: 10 + - _WaveStrength: 7.5 + - _WaveX: 0 + - _WaveY: 0.5 + - _ZTestMode: 4 + - _ZWrite: 0 + - _ZoomUvAmount: 0.5 + m_Colors: + - ColorSwapRed: {r: 1, g: 1, b: 1, a: 1} + - _AlphaOutlineColor: {r: 1, g: 1, b: 1, a: 1} + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _ColorChangeNewCol: {r: 1, g: 1, b: 0, a: 1} + - _ColorChangeNewCol2: {r: 1, g: 1, b: 0, a: 1} + - _ColorChangeNewCol3: {r: 1, g: 1, b: 0, a: 1} + - _ColorChangeTarget: {r: 1, g: 0, b: 0, a: 1} + - _ColorChangeTarget2: {r: 1, g: 0, b: 0, a: 1} + - _ColorChangeTarget3: {r: 1, g: 0, b: 0, a: 1} + - _ColorSwapBlue: {r: 1, g: 1, b: 1, a: 1} + - _ColorSwapGreen: {r: 1, g: 1, b: 1, a: 1} + - _ColorSwapRed: {r: 1, g: 1, b: 1, a: 1} + - _FadeBurnColor: {r: 1, g: 1, b: 0, a: 1} + - _GlowColor: {r: 1, g: 1, b: 1, a: 1} + - _GradBotLeftCol: {r: 0, g: 0, b: 1, a: 1} + - _GradBotRightCol: {r: 0, g: 0, b: 1, a: 1} + - _GradTopLeftCol: {r: 1, g: 0, b: 0, a: 1} + - _GradTopRightCol: {r: 1, g: 0, b: 0, a: 1} + - _GreyscaleTintColor: {r: 1, g: 1, b: 1, a: 1} + - _HitEffectColor: {r: 1, g: 1, b: 1, a: 1} + - _HologramStripeColor: {r: 1, g: 1, b: 1, a: 1} + - _InnerOutlineColor: {r: 1, g: 0, b: 0, a: 1} + - _OutlineColor: {r: 1, g: 1, b: 1, a: 1} + - _OverlayColor: {r: 1, g: 1, b: 1, a: 1} + - _ShadowColor: {r: 0, g: 0, b: 0, a: 1} + - _ShineColor: {r: 1, g: 1, b: 1, a: 1} +--- !u!1 &732186308 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 732186310} + - component: {fileID: 732186309} + m_Layer: 0 + m_Name: Expositors + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!114 &732186309 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 732186308} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: b549ed925b49d274c876184f60faabdf, type: 3} + m_Name: + m_EditorClassIdentifier: + expositors: + - {fileID: 2036092934} + - {fileID: 1351315062} + - {fileID: 1563905015} + expositorsTitle: {fileID: 1005972828} + expositorsTitleOutline: {fileID: 535274223} + expositorDistance: -75 + background: {fileID: 356332865} + colorLerpSpeed: 2.5 +--- !u!4 &732186310 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 732186308} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 2036092933} + - {fileID: 1351315063} + - {fileID: 1563905016} + m_Father: {fileID: 0} + m_RootOrder: 3 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &746759202 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 746759203} + - component: {fileID: 746759205} + - component: {fileID: 746759206} + - component: {fileID: 746759207} + m_Layer: 0 + m_Name: Hit Effect + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &746759203 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 746759202} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 150, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 133362206} + - {fileID: 1522371944} + m_Father: {fileID: 2036092933} + m_RootOrder: 15 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!212 &746759205 +SpriteRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 746759202} + m_Enabled: 1 + m_CastShadows: 0 + m_ReceiveShadows: 0 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 950928387} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 0 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_Sprite: {fileID: 21300000, guid: 519dafacd208bb64c83d5124be03b09d, type: 3} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_FlipX: 0 + m_FlipY: 0 + m_DrawMode: 0 + m_Size: {x: 5.12, y: 5.12} + m_AdaptiveModeThreshold: 0.5 + m_SpriteTileMode: 0 + m_WasSpriteAssigned: 1 + m_MaskInteraction: 0 + m_SpriteSortPoint: 0 +--- !u!114 &746759206 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 746759202} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 98b644315d7a92842b89e04f55c48e02, type: 3} + m_Name: + m_EditorClassIdentifier: +--- !u!95 &746759207 +Animator: + serializedVersion: 3 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 746759202} + m_Enabled: 1 + m_Avatar: {fileID: 0} + m_Controller: {fileID: 9100000, guid: c6e411a605ec50345a36bbab9d3cc722, type: 2} + m_CullingMode: 0 + m_UpdateMode: 0 + m_ApplyRootMotion: 0 + m_LinearVelocityBlending: 0 + m_WarningMessage: + m_HasTransformHierarchy: 1 + m_AllowConstantClipSamplingOptimization: 1 + m_KeepAnimatorControllerStateOnDisable: 0 +--- !u!1 &746778957 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 746778958} + - component: {fileID: 746778960} + - component: {fileID: 746778959} + m_Layer: 0 + m_Name: Animated + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 0 +--- !u!4 &746778958 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 746778957} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: -4.447157, z: 0} + m_LocalScale: {x: 1.2457023, y: 1.2457023, z: 1.2457023} + m_Children: [] + m_Father: {fileID: 450696184} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!102 &746778959 +TextMesh: + serializedVersion: 3 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 746778957} + m_Text: (Has Animation) + m_OffsetZ: -1.5 + m_CharacterSize: 0.075 + m_LineSpacing: 1 + m_Anchor: 4 + m_Alignment: 0 + m_TabSize: 4 + m_FontSize: 100 + m_FontStyle: 0 + m_RichText: 1 + m_Font: {fileID: 12800000, guid: a4e6a5491519adb45919dc87eff28e55, type: 3} + m_Color: + serializedVersion: 2 + rgba: 4294967295 +--- !u!23 &746778960 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 746778957} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: a4e6a5491519adb45919dc87eff28e55, type: 3} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!21 &753155718 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: AllIn1SpriteShader/AllIn1SpriteShader + m_Shader: {fileID: 4800000, guid: a36b7719ff0465b42ab1407d67672c5f, type: 3} + m_ShaderKeywords: CLIPPING_ON COLORSWAP_ON DISTORT_ON ETC1_EXTERNAL_ALPHA GLOWTEX_ON + GLOW_ON GREYSCALEOUTLINE_ON OUTBASE8DIR_ON OUTBASE_ON OUTDIST_ON OUTGREYTEXTURE_ON + OUTTEX_ON PINCH_ON ROUNDWAVEUV_ON ZOOMUV_ON _GLOWTEXUSED_ON _GREYSCALEOUTLINE_ON + _OUTLINE8DIRECTIONS_ON _OUTLINEDISTORTTOGGLE_ON _OUTLINETEXGREY_ON _OUTLINETEXTOGGLE_ON + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _ColorRampTex: + m_Texture: {fileID: 2800000, guid: 279657edc397ece4b8029c727adf6ddc, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ColorRampTexGradient: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ColorSwapTex: + m_Texture: {fileID: 2800000, guid: 065da6c7b90ca904dab9cbc6b415fd19, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DistortTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 0.1, y: 0.1} + m_Offset: {x: 0, y: 0} + - _FadeBurnTex: + m_Texture: {fileID: 2800000, guid: 677cca399782dea41aedc1d292ecb67d, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _FadeTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _GlowTex: + m_Texture: {fileID: 2800000, guid: 8608ef90f91271745a17f7210fe1e7db, type: 3} + 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} + - _OutlineDistortTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 0.5, y: 0.5} + m_Offset: {x: 0, y: 0} + - _OutlineTex: + m_Texture: {fileID: 2800000, guid: 677cca399782dea41aedc1d292ecb67d, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OverlayTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ShineMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - _Alpha: 0.65 + - _AlphaCutoffValue: 0.25 + - _AlphaOutlineBlend: 1 + - _AlphaOutlineGlow: 5 + - _AlphaOutlineMinAlpha: 0 + - _AlphaOutlinePower: 1 + - _AlphaRoundThreshold: 0.5 + - _BillboardY: 0 + - _BlurHD: 0 + - _BlurIntensity: 10 + - _Brightness: 0 + - _ChromAberrAlpha: 0.4 + - _ChromAberrAmount: 1 + - _ClipUvDown: 0.179 + - _ClipUvLeft: 0 + - _ClipUvRight: 0 + - _ClipUvUp: 0.086 + - _ColorChangeLuminosity: 0 + - _ColorChangeTolerance: 0.25 + - _ColorChangeTolerance2: 0.25 + - _ColorChangeTolerance3: 0.25 + - _ColorRampBlend: 1 + - _ColorRampLuminosity: 0.26 + - _ColorRampOutline: 0 + - _ColorSwapBlend: 1 + - _ColorSwapBlueLuminosity: 0.5 + - _ColorSwapGreenLuminosity: 0.28 + - _ColorSwapRedLuminosity: 0.5 + - _Contrast: 1 + - _CullingOption: 0 + - _DistortAmount: 0.2 + - _DistortTexXSpeed: 1 + - _DistortTexYSpeed: 1 + - _EditorDrawers: 6 + - _FadeAmount: 0.461 + - _FadeBurnGlow: 1 + - _FadeBurnTransition: 0.075 + - _FadeBurnWidth: 0.025 + - _FishEyeUvAmount: 0.35 + - _FlickerAlpha: 0 + - _FlickerFreq: 0.2 + - _FlickerPercent: 0.05 + - _GhostBlend: 1 + - _GhostColorBoost: 1.8 + - _GhostTransparency: 0 + - _GlitchAmount: 3 + - _GlitchSize: 1 + - _Glow: 14.3 + - _GlowGlobal: 1 + - _GlowTexUsed: 1 + - _GradBlend: 1 + - _GradBoostX: 1.2 + - _GradBoostY: 1.2 + - _GradIsRadial: 0 + - _GrassManualAnim: 1 + - _GrassManualToggle: 0 + - _GrassRadialBend: 0.1 + - _GrassSpeed: 2 + - _GrassWind: 20 + - _GreyscaleBlend: 1 + - _GreyscaleLuminosity: 0.27 + - _GreyscaleOutline: 1 + - _HandDrawnAmount: 10 + - _HandDrawnSpeed: 5 + - _HitEffectBlend: 1 + - _HitEffectGlow: 5 + - _HologramBlend: 1 + - _HologramMaxAlpha: 0.75 + - _HologramMinAlpha: 0.1 + - _HologramStripesAmount: 0.1 + - _HologramStripesSpeed: 4.5 + - _HologramUnmodAmount: 0 + - _HsvBright: 2 + - _HsvSaturation: 0.92 + - _HsvShift: 151 + - _InnerOutlineAlpha: 1 + - _InnerOutlineGlow: 6 + - _InnerOutlineThickness: 1.31 + - _MaxXUV: 1 + - _MaxYUV: 1 + - _MinXUV: 0 + - _MinYUV: 0 + - _MotionBlurAngle: 0.1 + - _MotionBlurDist: 1.25 + - _MyDstMode: 10 + - _MySrcMode: 5 + - _NegativeAmount: 1 + - _OffsetUvX: 0 + - _OffsetUvY: 0 + - _OnlyInnerOutline: 0 + - _OnlyOutline: 0 + - _Outline8Directions: 1 + - _OutlineAlpha: 1 + - _OutlineDistortAmount: 0.67 + - _OutlineDistortTexXSpeed: 0.2 + - _OutlineDistortTexYSpeed: -1 + - _OutlineDistortToggle: 1 + - _OutlineGlow: 15.7 + - _OutlineIsPixel: 0 + - _OutlinePixelWidth: 1 + - _OutlineTexGrey: 1 + - _OutlineTexToggle: 1 + - _OutlineTexXSpeed: 0.5 + - _OutlineTexYSpeed: -3.3 + - _OutlineWidth: 0 + - _OverlayBlend: 1 + - _OverlayGlow: 1 + - _OverlayTextureScrollXSpeed: 0.25 + - _OverlayTextureScrollYSpeed: 0.25 + - _PinchUvAmount: 0.118 + - _PixelateSize: 32 + - _PosterizeGamma: 0.75 + - _PosterizeNumColors: 8 + - _PosterizeOutline: 0 + - _RadialClip: 45 + - _RadialClip2: 0 + - _RadialClipAngle: 90 + - _RadialClipArc1: 45 + - _RadialClipArc2: 0 + - _RadialStartAngle: 90 + - _RandomSeed: 0 + - _RectSize: 1 + - _RotateUvAmount: 0 + - _RoundWaveSpeed: 0.38 + - _RoundWaveStrength: 0.063 + - _ShadowAlpha: 0.5 + - _ShadowX: 0.1 + - _ShadowY: -0.05 + - _ShakeUvSpeed: 2.5 + - _ShakeUvX: 1.5 + - _ShakeUvY: 1 + - _ShineGlow: 1 + - _ShineLocation: 0.5 + - _ShineRotate: 0 + - _ShineWidth: 0.1 + - _TextureScrollXSpeed: 1 + - _TextureScrollYSpeed: 0 + - _TwistUvAmount: 0.1 + - _TwistUvPosX: 0.5 + - _TwistUvPosY: 0.5 + - _TwistUvRadius: 0.75 + - _WarpScale: 0.5 + - _WarpSpeed: 8 + - _WarpStrength: 0.025 + - _WaveAmount: 7.5 + - _WaveSpeed: 9.4 + - _WaveStrength: 22.4 + - _WaveX: 0.106 + - _WaveY: 0.5 + - _ZTestMode: 4 + - _ZWrite: 0 + - _ZoomUvAmount: 0.92 + m_Colors: + - ColorSwapRed: {r: 1, g: 1, b: 1, a: 1} + - _AlphaOutlineColor: {r: 1, g: 1, b: 1, a: 1} + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _ColorChangeNewCol: {r: 1, g: 1, b: 0, a: 1} + - _ColorChangeNewCol2: {r: 1, g: 1, b: 0, a: 1} + - _ColorChangeNewCol3: {r: 1, g: 1, b: 0, a: 1} + - _ColorChangeTarget: {r: 1, g: 0, b: 0, a: 1} + - _ColorChangeTarget2: {r: 1, g: 0, b: 0, a: 1} + - _ColorChangeTarget3: {r: 1, g: 0, b: 0, a: 1} + - _ColorSwapBlue: {r: 0.6687399, g: 1, b: 0.2924528, a: 1} + - _ColorSwapGreen: {r: 1, g: 0.020314153, b: 0, a: 1} + - _ColorSwapRed: {r: 0, g: 0.46226418, b: 0.023657747, a: 1} + - _FadeBurnColor: {r: 1, g: 1, b: 0, a: 1} + - _GlowColor: {r: 0.49019608, g: 0.41710952, b: 0, a: 1} + - _GradBotLeftCol: {r: 0, g: 0, b: 1, a: 1} + - _GradBotRightCol: {r: 0, g: 0, b: 1, a: 1} + - _GradTopLeftCol: {r: 1, g: 0, b: 0, a: 1} + - _GradTopRightCol: {r: 1, g: 0, b: 0, a: 1} + - _GreyscaleTintColor: {r: 0.45882368, g: 1, b: 0, a: 1} + - _HitEffectColor: {r: 1, g: 1, b: 1, a: 1} + - _HologramStripeColor: {r: 0, g: 1, b: 1, a: 1} + - _InnerOutlineColor: {r: 0.9811321, g: 0.29619083, b: 0.7939467, a: 1} + - _OutlineColor: {r: 0.3073311, g: 1, b: 0, a: 1} + - _OverlayColor: {r: 1, g: 1, b: 1, a: 1} + - _ShadowColor: {r: 0, g: 0, b: 0, a: 1} + - _ShineColor: {r: 1, g: 1, b: 1, a: 1} +--- !u!1 &766050007 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 766050008} + - component: {fileID: 766050012} + - component: {fileID: 766050011} + - component: {fileID: 766050009} + m_Layer: 0 + m_Name: Gradient Scroll + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &766050008 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 766050007} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 90, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 1675907431} + - {fileID: 684661039} + m_Father: {fileID: 1563905016} + m_RootOrder: 9 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!95 &766050009 +Animator: + serializedVersion: 3 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 766050007} + m_Enabled: 1 + m_Avatar: {fileID: 0} + m_Controller: {fileID: 9100000, guid: edeeb31731bec5f4092bbc3bbff03e91, type: 2} + m_CullingMode: 0 + m_UpdateMode: 0 + m_ApplyRootMotion: 0 + m_LinearVelocityBlending: 0 + m_WarningMessage: + m_HasTransformHierarchy: 1 + m_AllowConstantClipSamplingOptimization: 1 + m_KeepAnimatorControllerStateOnDisable: 0 +--- !u!114 &766050011 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 766050007} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 98b644315d7a92842b89e04f55c48e02, type: 3} + m_Name: + m_EditorClassIdentifier: +--- !u!212 &766050012 +SpriteRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 766050007} + m_Enabled: 1 + m_CastShadows: 0 + m_ReceiveShadows: 0 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 946451345} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 0 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_Sprite: {fileID: 21300000, guid: 519dafacd208bb64c83d5124be03b09d, type: 3} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_FlipX: 0 + m_FlipY: 0 + m_DrawMode: 0 + m_Size: {x: 5.12, y: 5.12} + m_AdaptiveModeThreshold: 0.5 + m_SpriteTileMode: 0 + m_WasSpriteAssigned: 1 + m_MaskInteraction: 0 + m_SpriteSortPoint: 0 +--- !u!21 &772177650 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: AllIn1SpriteShader/AllIn1SpriteShader + m_Shader: {fileID: 4800000, guid: a36b7719ff0465b42ab1407d67672c5f, type: 3} + m_ShaderKeywords: ETC1_EXTERNAL_ALPHA FADE_ON + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _ColorRampTex: + m_Texture: {fileID: 2800000, guid: 279657edc397ece4b8029c727adf6ddc, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ColorRampTexGradient: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ColorSwapTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DistortTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _FadeBurnTex: + m_Texture: {fileID: 2800000, guid: 677cca399782dea41aedc1d292ecb67d, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _FadeTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 0.5, y: 0.5} + m_Offset: {x: 0, y: 0} + - _GlowTex: + 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} + - _OutlineDistortTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OutlineTex: + m_Texture: {fileID: 2800000, guid: 74087f6d03f233e4a8a142fa01f9e5cf, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OverlayTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ShineMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - _Alpha: 1 + - _AlphaCutoffValue: 0.25 + - _AlphaOutlineBlend: 1 + - _AlphaOutlineGlow: 5 + - _AlphaOutlineMinAlpha: 0 + - _AlphaOutlinePower: 1 + - _AlphaRoundThreshold: 0.5 + - _BillboardY: 0 + - _BlurHD: 0 + - _BlurIntensity: 10 + - _Brightness: 0 + - _ChromAberrAlpha: 0.4 + - _ChromAberrAmount: 1 + - _ClipUvDown: 1 + - _ClipUvLeft: 1 + - _ClipUvRight: 1 + - _ClipUvUp: 1 + - _ColorChangeLuminosity: 0 + - _ColorChangeTolerance: 0.25 + - _ColorChangeTolerance2: 0.25 + - _ColorChangeTolerance3: 0.25 + - _ColorRampBlend: 1 + - _ColorRampLuminosity: 0 + - _ColorRampOutline: 0 + - _ColorSwapBlend: 1 + - _ColorSwapBlueLuminosity: 0.5 + - _ColorSwapGreenLuminosity: 0.5 + - _ColorSwapRedLuminosity: 0.5 + - _Contrast: 1 + - _CullingOption: 0 + - _DistortAmount: 0.5 + - _DistortTexXSpeed: 5 + - _DistortTexYSpeed: 5 + - _EditorDrawers: 6 + - _FadeAmount: 0.437 + - _FadeBurnGlow: 13.5 + - _FadeBurnTransition: 0.075 + - _FadeBurnWidth: 0.025 + - _FishEyeUvAmount: 0.35 + - _FlickerAlpha: 0 + - _FlickerFreq: 0.2 + - _FlickerPercent: 0.05 + - _GhostBlend: 1 + - _GhostColorBoost: 1 + - _GhostTransparency: 0 + - _GlitchAmount: 3 + - _GlitchSize: 1 + - _Glow: 10 + - _GlowGlobal: 1 + - _GlowTexUsed: 0 + - _GradBlend: 1 + - _GradBoostX: 1.2 + - _GradBoostY: 1.2 + - _GradIsRadial: 0 + - _GrassManualAnim: 1 + - _GrassManualToggle: 0 + - _GrassRadialBend: 0.25 + - _GrassSpeed: 2 + - _GrassWind: 20 + - _GreyscaleBlend: 1 + - _GreyscaleLuminosity: 0 + - _GreyscaleOutline: 0 + - _HandDrawnAmount: 10 + - _HandDrawnSpeed: 5 + - _HitEffectBlend: 1 + - _HitEffectGlow: 5 + - _HologramBlend: 1 + - _HologramFlickerAlpha: 0 + - _HologramFlickerFreq: 0.2 + - _HologramFlickerPercent: 0.05 + - _HologramMaxAlpha: 1 + - _HologramMinAlpha: 0 + - _HologramStripesAlpha: 0.4 + - _HologramStripesAmount: 50 + - _HologramStripesFill: 0.4 + - _HologramStripesLuminosity: 1 + - _HologramStripesSpeed: 5 + - _HologramUnmodAmount: 0.4 + - _HsvBright: 1 + - _HsvSaturation: 1 + - _HsvShift: 180 + - _InnerOutlineAlpha: 1 + - _InnerOutlineGlow: 1 + - _InnerOutlineThickness: 1 + - _MaxXUV: 1 + - _MaxYUV: 1 + - _MinXUV: 0 + - _MinYUV: 0 + - _MotionBlurAngle: 0.1 + - _MotionBlurDist: 1.25 + - _MyDstMode: 10 + - _MySrcMode: 5 + - _NegativeAmount: 1 + - _OffsetUvX: 0 + - _OffsetUvY: 0 + - _OnlyInnerOutline: 0 + - _OnlyOutline: 0 + - _Outline8Directions: 0 + - _OutlineAlpha: 1 + - _OutlineDistortAmount: 0.5 + - _OutlineDistortTexXSpeed: 5 + - _OutlineDistortTexYSpeed: 5 + - _OutlineDistortToggle: 0 + - _OutlineGlow: 1.5 + - _OutlineIsPixel: 0 + - _OutlinePixelWidth: 1 + - _OutlineTexGrey: 0 + - _OutlineTexToggle: 0 + - _OutlineTexXSpeed: 10 + - _OutlineTexYSpeed: 0 + - _OutlineWidth: 0.004 + - _OverlayBlend: 1 + - _OverlayGlow: 1 + - _OverlayTextureScrollXSpeed: 0.25 + - _OverlayTextureScrollYSpeed: 0.25 + - _PinchUvAmount: 0.35 + - _PixelateSize: 32 + - _PosterizeGamma: 0.75 + - _PosterizeNumColors: 8 + - _PosterizeOutline: 0 + - _RadialClip: 0 + - _RadialClip2: 45 + - _RadialClipAngle: 90 + - _RadialClipArc1: 45 + - _RadialClipArc2: 0 + - _RadialStartAngle: 90 + - _RandomSeed: 0 + - _RectSize: 1 + - _RotateUvAmount: 0 + - _RoundWaveSpeed: 2 + - _RoundWaveStrength: 0.7 + - _ShadowAlpha: 0.5 + - _ShadowX: 0.1 + - _ShadowY: -0.05 + - _ShakeUvSpeed: 2.5 + - _ShakeUvX: 1.5 + - _ShakeUvY: 1 + - _ShineGlow: 1 + - _ShineLocation: 0.5 + - _ShineRotate: 0 + - _ShineWidth: 0.1 + - _TextureScrollXSpeed: 1 + - _TextureScrollYSpeed: 0 + - _TwistUvAmount: 1 + - _TwistUvPosX: 0.5 + - _TwistUvPosY: 0.5 + - _TwistUvRadius: 0.75 + - _WarpScale: 0.5 + - _WarpSpeed: 8 + - _WarpStrength: 0.025 + - _WaveAmount: 7 + - _WaveSpeed: 10 + - _WaveStrength: 7.5 + - _WaveX: 0 + - _WaveY: 0.5 + - _ZTestMode: 4 + - _ZWrite: 0 + - _ZoomUvAmount: 0.5 + m_Colors: + - ColorSwapRed: {r: 1, g: 1, b: 1, a: 1} + - _AlphaOutlineColor: {r: 1, g: 1, b: 1, a: 1} + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _ColorChangeNewCol: {r: 1, g: 1, b: 0, a: 1} + - _ColorChangeNewCol2: {r: 1, g: 1, b: 0, a: 1} + - _ColorChangeNewCol3: {r: 1, g: 1, b: 0, a: 1} + - _ColorChangeTarget: {r: 1, g: 0, b: 0, a: 1} + - _ColorChangeTarget2: {r: 1, g: 0, b: 0, a: 1} + - _ColorChangeTarget3: {r: 1, g: 0, b: 0, a: 1} + - _ColorSwapBlue: {r: 1, g: 1, b: 1, a: 1} + - _ColorSwapGreen: {r: 1, g: 1, b: 1, a: 1} + - _ColorSwapRed: {r: 1, g: 1, b: 1, a: 1} + - _FadeBurnColor: {r: 1, g: 1, b: 0, a: 1} + - _GlowColor: {r: 1, g: 1, b: 1, a: 1} + - _GradBotLeftCol: {r: 0, g: 0, b: 1, a: 1} + - _GradBotRightCol: {r: 0, g: 0, b: 1, a: 1} + - _GradTopLeftCol: {r: 1, g: 0, b: 0, a: 1} + - _GradTopRightCol: {r: 1, g: 0, b: 0, a: 1} + - _GreyscaleTintColor: {r: 1, g: 1, b: 1, a: 1} + - _HitEffectColor: {r: 1, g: 1, b: 1, a: 1} + - _HologramStripeColor: {r: 1, g: 1, b: 1, a: 1} + - _InnerOutlineColor: {r: 1, g: 0, b: 0, a: 1} + - _OutlineColor: {r: 1, g: 1, b: 1, a: 1} + - _OverlayColor: {r: 1, g: 1, b: 1, a: 1} + - _ShadowColor: {r: 0, g: 0, b: 0, a: 1} + - _ShineColor: {r: 1, g: 1, b: 1, a: 1} +--- !u!1 &778370415 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 778370416} + - component: {fileID: 778370418} + - component: {fileID: 778370417} + m_Layer: 0 + m_Name: Sprite2 + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &778370416 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 778370415} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 1.22, y: 0.82, z: -0.05} + m_LocalScale: {x: 1.0080961, y: 1.0080961, z: 1.0080961} + m_Children: [] + m_Father: {fileID: 1415143267} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &778370417 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 778370415} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: ee158225ee1e59f4791627785501d950, type: 3} + m_Name: + m_EditorClassIdentifier: + currentShaderType: 4 + normalStrength: 5 + normalSmoothing: 1 + computingNormal: 0 +--- !u!212 &778370418 +SpriteRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 778370415} + m_Enabled: 1 + m_CastShadows: 0 + m_ReceiveShadows: 0 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2128149943} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 0 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_Sprite: {fileID: 21300000, guid: 519dafacd208bb64c83d5124be03b09d, type: 3} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_FlipX: 0 + m_FlipY: 0 + m_DrawMode: 0 + m_Size: {x: 5.12, y: 5.12} + m_AdaptiveModeThreshold: 0.5 + m_SpriteTileMode: 0 + m_WasSpriteAssigned: 1 + m_MaskInteraction: 0 + m_SpriteSortPoint: 0 +--- !u!1 &786925990 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 786925991} + - component: {fileID: 786925994} + - component: {fileID: 786925993} + m_Layer: 0 + m_Name: Fish Eye + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &786925991 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 786925990} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 150, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 1302959054} + - {fileID: 1039947233} + m_Father: {fileID: 1351315063} + m_RootOrder: 15 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &786925993 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 786925990} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 98b644315d7a92842b89e04f55c48e02, type: 3} + m_Name: + m_EditorClassIdentifier: +--- !u!212 &786925994 +SpriteRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 786925990} + m_Enabled: 1 + m_CastShadows: 0 + m_ReceiveShadows: 0 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 1150284212} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 0 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_Sprite: {fileID: 21300000, guid: 519dafacd208bb64c83d5124be03b09d, type: 3} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_FlipX: 0 + m_FlipY: 0 + m_DrawMode: 0 + m_Size: {x: 5.12, y: 5.12} + m_AdaptiveModeThreshold: 0.5 + m_SpriteTileMode: 0 + m_WasSpriteAssigned: 1 + m_MaskInteraction: 0 + m_SpriteSortPoint: 0 +--- !u!1 &789390131 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 789390132} + - component: {fileID: 789390134} + - component: {fileID: 789390133} + m_Layer: 0 + m_Name: Animated + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 0 +--- !u!4 &789390132 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 789390131} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: -3.57, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 1350115731} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!102 &789390133 +TextMesh: + serializedVersion: 3 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 789390131} + m_Text: (Has Animation) + m_OffsetZ: -1.5 + m_CharacterSize: 0.075 + m_LineSpacing: 1 + m_Anchor: 4 + m_Alignment: 0 + m_TabSize: 4 + m_FontSize: 100 + m_FontStyle: 0 + m_RichText: 1 + m_Font: {fileID: 12800000, guid: a4e6a5491519adb45919dc87eff28e55, type: 3} + m_Color: + serializedVersion: 2 + rgba: 4294967295 +--- !u!23 &789390134 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 789390131} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: a4e6a5491519adb45919dc87eff28e55, type: 3} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!1 &793013507 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 793013508} + - component: {fileID: 793013510} + - component: {fileID: 793013509} + m_Layer: 0 + m_Name: Animated + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &793013508 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 793013507} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: -3.57, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 1119325822} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!102 &793013509 +TextMesh: + serializedVersion: 3 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 793013507} + m_Text: (Has Animation) + m_OffsetZ: -1.5 + m_CharacterSize: 0.075 + m_LineSpacing: 1 + m_Anchor: 4 + m_Alignment: 0 + m_TabSize: 4 + m_FontSize: 100 + m_FontStyle: 0 + m_RichText: 1 + m_Font: {fileID: 12800000, guid: a4e6a5491519adb45919dc87eff28e55, type: 3} + m_Color: + serializedVersion: 2 + rgba: 4294967295 +--- !u!23 &793013510 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 793013507} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 10100, guid: 0000000000000000e000000000000000, type: 0} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!1 &797006599 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 797006600} + - component: {fileID: 797006602} + - component: {fileID: 797006601} + m_Layer: 0 + m_Name: Title + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &797006600 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 797006599} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: -2.51, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 1028271463} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!102 &797006601 +TextMesh: + serializedVersion: 3 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 797006599} + m_Text: Pixelate + m_OffsetZ: -1.5 + m_CharacterSize: 0.075 + m_LineSpacing: 1 + m_Anchor: 4 + m_Alignment: 0 + m_TabSize: 4 + m_FontSize: 100 + m_FontStyle: 0 + m_RichText: 1 + m_Font: {fileID: 12800000, guid: a4e6a5491519adb45919dc87eff28e55, type: 3} + m_Color: + serializedVersion: 2 + rgba: 4294967295 +--- !u!23 &797006602 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 797006599} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 10100, guid: 0000000000000000e000000000000000, type: 0} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!1 &798161389 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 798161390} + - component: {fileID: 798161392} + - component: {fileID: 798161391} + m_Layer: 0 + m_Name: Animated + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 0 +--- !u!4 &798161390 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 798161389} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: -3.57, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 950130248} + m_RootOrder: 2 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!102 &798161391 +TextMesh: + serializedVersion: 3 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 798161389} + m_Text: (Has Animation) + m_OffsetZ: -1.5 + m_CharacterSize: 0.075 + m_LineSpacing: 1 + m_Anchor: 4 + m_Alignment: 0 + m_TabSize: 4 + m_FontSize: 100 + m_FontStyle: 0 + m_RichText: 1 + m_Font: {fileID: 12800000, guid: a4e6a5491519adb45919dc87eff28e55, type: 3} + m_Color: + serializedVersion: 2 + rgba: 4294967295 +--- !u!23 &798161392 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 798161389} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: a4e6a5491519adb45919dc87eff28e55, type: 3} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!1 &798901403 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 798901404} + - component: {fileID: 798901406} + - component: {fileID: 798901405} + m_Layer: 0 + m_Name: Flag + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &798901404 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 798901403} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 1.132, y: 0.846, z: 0.1} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 935289136} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &798901405 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 798901403} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: ee158225ee1e59f4791627785501d950, type: 3} + m_Name: + m_EditorClassIdentifier: + currentShaderType: 4 + normalStrength: 5 + normalSmoothing: 1 + computingNormal: 0 +--- !u!212 &798901406 +SpriteRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 798901403} + m_Enabled: 1 + m_CastShadows: 0 + m_ReceiveShadows: 0 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 208665463} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 0 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_Sprite: {fileID: 21300002, guid: adce45105552071409c959137cb5b670, type: 3} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_FlipX: 0 + m_FlipY: 0 + m_DrawMode: 0 + m_Size: {x: 2.18, y: 1.76} + m_AdaptiveModeThreshold: 0.5 + m_SpriteTileMode: 0 + m_WasSpriteAssigned: 1 + m_MaskInteraction: 0 + m_SpriteSortPoint: 0 +--- !u!1 &799318215 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 799318216} + - component: {fileID: 799318218} + - component: {fileID: 799318217} + - component: {fileID: 799318219} + m_Layer: 0 + m_Name: FireMid + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &799318216 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 799318215} + m_LocalRotation: {x: 0, y: 0, z: 0.7071068, w: 0.7071068} + m_LocalPosition: {x: 0, y: 0, z: -0.025} + m_LocalScale: {x: 1.0754969, y: 1.0754969, z: 1.0754969} + m_Children: [] + m_Father: {fileID: 102412577} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 90} +--- !u!114 &799318217 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 799318215} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: ee158225ee1e59f4791627785501d950, type: 3} + m_Name: + m_EditorClassIdentifier: + currentShaderType: 4 + normalStrength: 5 + normalSmoothing: 1 + computingNormal: 0 +--- !u!212 &799318218 +SpriteRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 799318215} + m_Enabled: 1 + m_CastShadows: 0 + m_ReceiveShadows: 0 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: 1c2c3a51f881cb443906a57116cf56fe, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 0 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_Sprite: {fileID: 21300000, guid: 2ea3ea54c499d314f957e0a47dc11c9c, type: 3} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_FlipX: 0 + m_FlipY: 0 + m_DrawMode: 0 + m_Size: {x: 0.04, y: 0.04} + m_AdaptiveModeThreshold: 0.5 + m_SpriteTileMode: 0 + m_WasSpriteAssigned: 1 + m_MaskInteraction: 0 + m_SpriteSortPoint: 0 +--- !u!114 &799318219 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 799318215} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 384dba07353e1f242b467b6857a1e3d4, type: 3} + m_Name: + m_EditorClassIdentifier: + numericPropertyName: _RotateUvAmount + scrollSpeed: 7.5 + applyModulo: 1 + modulo: 6.28 + mat: {fileID: 0} +--- !u!1 &816448198 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 816448199} + - component: {fileID: 816448201} + - component: {fileID: 816448200} + m_Layer: 0 + m_Name: Animated + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 0 +--- !u!4 &816448199 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 816448198} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: -3.57, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 1358020792} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!102 &816448200 +TextMesh: + serializedVersion: 3 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 816448198} + m_Text: (Has Animation) + m_OffsetZ: -1.5 + m_CharacterSize: 0.075 + m_LineSpacing: 1 + m_Anchor: 4 + m_Alignment: 0 + m_TabSize: 4 + m_FontSize: 100 + m_FontStyle: 0 + m_RichText: 1 + m_Font: {fileID: 12800000, guid: a4e6a5491519adb45919dc87eff28e55, type: 3} + m_Color: + serializedVersion: 2 + rgba: 4294967295 +--- !u!23 &816448201 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 816448198} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: a4e6a5491519adb45919dc87eff28e55, type: 3} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!21 &817315606 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: AllIn1SpriteShader/AllIn1SpriteShader + m_Shader: {fileID: 4800000, guid: a36b7719ff0465b42ab1407d67672c5f, type: 3} + m_ShaderKeywords: ETC1_EXTERNAL_ALPHA NEGATIVE_ON + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _ColorRampTex: + m_Texture: {fileID: 2800000, guid: 279657edc397ece4b8029c727adf6ddc, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ColorRampTexGradient: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ColorSwapTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DistortTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _FadeBurnTex: + m_Texture: {fileID: 2800000, guid: 32e8df0008bebe746b1681a71c61f31c, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _FadeTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _GlowTex: + 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} + - _OutlineDistortTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OutlineTex: + m_Texture: {fileID: 2800000, guid: 74087f6d03f233e4a8a142fa01f9e5cf, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OverlayTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ShineMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - _Alpha: 1 + - _AlphaCutoffValue: 0.25 + - _AlphaOutlineBlend: 1 + - _AlphaOutlineGlow: 5 + - _AlphaOutlineMinAlpha: 0 + - _AlphaOutlinePower: 1 + - _AlphaRoundThreshold: 0.5 + - _BillboardY: 0 + - _BlurHD: 0 + - _BlurIntensity: 10 + - _Brightness: 0 + - _ChromAberrAlpha: 0.4 + - _ChromAberrAmount: 1 + - _ClipUvDown: 1 + - _ClipUvLeft: 1 + - _ClipUvRight: 1 + - _ClipUvUp: 1 + - _ColorChangeLuminosity: 0 + - _ColorChangeTolerance: 0.25 + - _ColorChangeTolerance2: 0.25 + - _ColorChangeTolerance3: 0.25 + - _ColorRampBlend: 1 + - _ColorRampLuminosity: 0 + - _ColorRampOutline: 0 + - _ColorSwapBlend: 1 + - _ColorSwapBlueLuminosity: 0.5 + - _ColorSwapGreenLuminosity: 0.5 + - _ColorSwapRedLuminosity: 0.5 + - _Contrast: 1 + - _CullingOption: 0 + - _DistortAmount: 0.5 + - _DistortTexXSpeed: 5 + - _DistortTexYSpeed: 5 + - _EditorDrawers: 6 + - _FadeAmount: -0.1 + - _FadeBurnGlow: 2 + - _FadeBurnTransition: 0.075 + - _FadeBurnWidth: 0.025 + - _FishEyeUvAmount: 0.35 + - _FlickerAlpha: 0 + - _FlickerFreq: 0.2 + - _FlickerPercent: 0.05 + - _GhostBlend: 1 + - _GhostColorBoost: 1 + - _GhostTransparency: 0 + - _GlitchAmount: 3 + - _GlitchSize: 1 + - _Glow: 10 + - _GlowGlobal: 1 + - _GlowTexUsed: 0 + - _GradBlend: 1 + - _GradBoostX: 1.2 + - _GradBoostY: 1.2 + - _GradIsRadial: 0 + - _GrassManualAnim: 1 + - _GrassManualToggle: 0 + - _GrassRadialBend: 0.25 + - _GrassSpeed: 2 + - _GrassWind: 20 + - _GreyscaleBlend: 1 + - _GreyscaleLuminosity: 0 + - _GreyscaleOutline: 0 + - _HandDrawnAmount: 10 + - _HandDrawnSpeed: 5 + - _HitEffectBlend: 1 + - _HitEffectGlow: 5 + - _HologramBlend: 1 + - _HologramFlickerAlpha: 0 + - _HologramFlickerFreq: 0.2 + - _HologramFlickerPercent: 0.05 + - _HologramMaxAlpha: 1 + - _HologramMinAlpha: 0 + - _HologramStripesAlpha: 0.4 + - _HologramStripesAmount: 50 + - _HologramStripesFill: 0.4 + - _HologramStripesLuminosity: 1 + - _HologramStripesSpeed: 5 + - _HologramUnmodAmount: 0.4 + - _HsvBright: 1 + - _HsvSaturation: 1 + - _HsvShift: 180 + - _InnerOutlineAlpha: 1 + - _InnerOutlineGlow: 1 + - _InnerOutlineThickness: 1 + - _MaxXUV: 1 + - _MaxYUV: 1 + - _MinXUV: 0 + - _MinYUV: 0 + - _MotionBlurAngle: 0.1 + - _MotionBlurDist: 1.25 + - _MyDstMode: 10 + - _MySrcMode: 5 + - _NegativeAmount: 1 + - _OffsetUvX: 0 + - _OffsetUvY: 0 + - _OnlyInnerOutline: 0 + - _OnlyOutline: 0 + - _Outline8Directions: 0 + - _OutlineAlpha: 1 + - _OutlineDistortAmount: 0.5 + - _OutlineDistortTexXSpeed: 5 + - _OutlineDistortTexYSpeed: 5 + - _OutlineDistortToggle: 0 + - _OutlineGlow: 1.5 + - _OutlineIsPixel: 0 + - _OutlinePixelWidth: 1 + - _OutlineTexGrey: 0 + - _OutlineTexToggle: 0 + - _OutlineTexXSpeed: 10 + - _OutlineTexYSpeed: 0 + - _OutlineWidth: 0.004 + - _OverlayBlend: 1 + - _OverlayGlow: 1 + - _OverlayTextureScrollXSpeed: 0.25 + - _OverlayTextureScrollYSpeed: 0.25 + - _PinchUvAmount: 0.35 + - _PixelateSize: 32 + - _PosterizeGamma: 0.75 + - _PosterizeNumColors: 8 + - _PosterizeOutline: 0 + - _RadialClip: 45 + - _RadialClip2: 0 + - _RadialClipAngle: 90 + - _RadialClipArc1: 45 + - _RadialClipArc2: 0 + - _RadialStartAngle: 90 + - _RandomSeed: 0 + - _RectSize: 1 + - _RotateUvAmount: 0 + - _RoundWaveSpeed: 2 + - _RoundWaveStrength: 0.7 + - _ShadowAlpha: 0.5 + - _ShadowX: 0.1 + - _ShadowY: -0.05 + - _ShakeUvSpeed: 2.5 + - _ShakeUvX: 1.5 + - _ShakeUvY: 1 + - _ShineGlow: 1 + - _ShineLocation: 0.5 + - _ShineRotate: 0 + - _ShineWidth: 0.1 + - _TextureScrollXSpeed: 1 + - _TextureScrollYSpeed: 0 + - _TwistUvAmount: 1 + - _TwistUvPosX: 0.5 + - _TwistUvPosY: 0.5 + - _TwistUvRadius: 0.75 + - _WarpScale: 0.5 + - _WarpSpeed: 8 + - _WarpStrength: 0.025 + - _WaveAmount: 7 + - _WaveSpeed: 10 + - _WaveStrength: 7.5 + - _WaveX: 0 + - _WaveY: 0.5 + - _ZTestMode: 4 + - _ZWrite: 0 + - _ZoomUvAmount: 0.5 + m_Colors: + - ColorSwapRed: {r: 1, g: 1, b: 1, a: 1} + - _AlphaOutlineColor: {r: 1, g: 1, b: 1, a: 1} + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _ColorChangeNewCol: {r: 1, g: 1, b: 0, a: 1} + - _ColorChangeNewCol2: {r: 1, g: 1, b: 0, a: 1} + - _ColorChangeNewCol3: {r: 1, g: 1, b: 0, a: 1} + - _ColorChangeTarget: {r: 1, g: 0, b: 0, a: 1} + - _ColorChangeTarget2: {r: 1, g: 0, b: 0, a: 1} + - _ColorChangeTarget3: {r: 1, g: 0, b: 0, a: 1} + - _ColorSwapBlue: {r: 1, g: 1, b: 1, a: 1} + - _ColorSwapGreen: {r: 1, g: 1, b: 1, a: 1} + - _ColorSwapRed: {r: 1, g: 1, b: 1, a: 1} + - _FadeBurnColor: {r: 1, g: 1, b: 0, a: 1} + - _GlowColor: {r: 1, g: 1, b: 1, a: 1} + - _GradBotLeftCol: {r: 0, g: 0, b: 1, a: 1} + - _GradBotRightCol: {r: 0, g: 0, b: 1, a: 1} + - _GradTopLeftCol: {r: 1, g: 0, b: 0, a: 1} + - _GradTopRightCol: {r: 1, g: 0, b: 0, a: 1} + - _GreyscaleTintColor: {r: 1, g: 1, b: 1, a: 1} + - _HitEffectColor: {r: 1, g: 1, b: 1, a: 1} + - _HologramStripeColor: {r: 1, g: 1, b: 1, a: 1} + - _InnerOutlineColor: {r: 1, g: 0, b: 0, a: 1} + - _OutlineColor: {r: 1, g: 1, b: 1, a: 1} + - _OverlayColor: {r: 1, g: 1, b: 1, a: 1} + - _ShadowColor: {r: 0, g: 0, b: 0, a: 1} + - _ShineColor: {r: 1, g: 1, b: 1, a: 1} +--- !u!1 &820886077 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 820886078} + - component: {fileID: 820886080} + - component: {fileID: 820886079} + m_Layer: 0 + m_Name: Animated + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 0 +--- !u!4 &820886078 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 820886077} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: -3.57, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 420059981} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!102 &820886079 +TextMesh: + serializedVersion: 3 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 820886077} + m_Text: (Has Animation) + m_OffsetZ: -1.5 + m_CharacterSize: 0.075 + m_LineSpacing: 1 + m_Anchor: 4 + m_Alignment: 0 + m_TabSize: 4 + m_FontSize: 100 + m_FontStyle: 0 + m_RichText: 1 + m_Font: {fileID: 12800000, guid: a4e6a5491519adb45919dc87eff28e55, type: 3} + m_Color: + serializedVersion: 2 + rgba: 4294967295 +--- !u!23 &820886080 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 820886077} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: a4e6a5491519adb45919dc87eff28e55, type: 3} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!21 &822200767 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: AllIn1SpriteShader/AllIn1SpriteShader + m_Shader: {fileID: 4800000, guid: a36b7719ff0465b42ab1407d67672c5f, type: 3} + m_ShaderKeywords: ETC1_EXTERNAL_ALPHA FLICKER_ON + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _ColorRampTex: + m_Texture: {fileID: 2800000, guid: 279657edc397ece4b8029c727adf6ddc, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ColorRampTexGradient: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ColorSwapTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DistortTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _FadeBurnTex: + m_Texture: {fileID: 2800000, guid: 32e8df0008bebe746b1681a71c61f31c, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _FadeTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _GlowTex: + 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} + - _OutlineDistortTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OutlineTex: + m_Texture: {fileID: 2800000, guid: 74087f6d03f233e4a8a142fa01f9e5cf, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OverlayTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ShineMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - _Alpha: 1 + - _AlphaCutoffValue: 0.25 + - _AlphaOutlineBlend: 1 + - _AlphaOutlineGlow: 5 + - _AlphaOutlineMinAlpha: 0 + - _AlphaOutlinePower: 1 + - _AlphaRoundThreshold: 0.5 + - _BillboardY: 0 + - _BlurHD: 0 + - _BlurIntensity: 10 + - _Brightness: 0 + - _ChromAberrAlpha: 0.4 + - _ChromAberrAmount: 1 + - _ClipUvDown: 1 + - _ClipUvLeft: 1 + - _ClipUvRight: 1 + - _ClipUvUp: 1 + - _ColorChangeLuminosity: 0 + - _ColorChangeTolerance: 0.25 + - _ColorChangeTolerance2: 0.25 + - _ColorChangeTolerance3: 0.25 + - _ColorRampBlend: 1 + - _ColorRampLuminosity: 0 + - _ColorRampOutline: 0 + - _ColorSwapBlend: 1 + - _ColorSwapBlueLuminosity: 0.5 + - _ColorSwapGreenLuminosity: 0.5 + - _ColorSwapRedLuminosity: 0.5 + - _Contrast: 1 + - _CullingOption: 0 + - _DistortAmount: 0.5 + - _DistortTexXSpeed: 5 + - _DistortTexYSpeed: 5 + - _EditorDrawers: 6 + - _FadeAmount: -0.1 + - _FadeBurnGlow: 2 + - _FadeBurnTransition: 0.075 + - _FadeBurnWidth: 0.025 + - _FishEyeUvAmount: 0.35 + - _FlickerAlpha: 0.221 + - _FlickerFreq: 0.31 + - _FlickerPercent: 0.132 + - _GhostBlend: 1 + - _GhostColorBoost: 1 + - _GhostTransparency: 0 + - _GlitchAmount: 3 + - _GlitchSize: 1 + - _Glow: 10 + - _GlowGlobal: 1 + - _GlowTexUsed: 0 + - _GradBlend: 1 + - _GradBoostX: 1.2 + - _GradBoostY: 1.2 + - _GradIsRadial: 0 + - _GrassManualAnim: 1 + - _GrassManualToggle: 0 + - _GrassRadialBend: 0.1 + - _GrassSpeed: 2 + - _GrassWind: 20 + - _GreyscaleBlend: 1 + - _GreyscaleLuminosity: 0 + - _GreyscaleOutline: 0 + - _HandDrawnAmount: 10 + - _HandDrawnSpeed: 5 + - _HitEffectBlend: 1 + - _HitEffectGlow: 5 + - _HologramBlend: 1 + - _HologramFlickerAlpha: 0 + - _HologramFlickerFreq: 0.2 + - _HologramFlickerPercent: 0.05 + - _HologramMaxAlpha: 1 + - _HologramMinAlpha: 0 + - _HologramStripesAlpha: 0.4 + - _HologramStripesAmount: 50 + - _HologramStripesFill: 0.4 + - _HologramStripesLuminosity: 1 + - _HologramStripesSpeed: 5 + - _HologramUnmodAmount: 0.4 + - _HsvBright: 1 + - _HsvSaturation: 1 + - _HsvShift: 180 + - _InnerOutlineAlpha: 1 + - _InnerOutlineGlow: 1 + - _InnerOutlineThickness: 1 + - _MaxXUV: 1 + - _MaxYUV: 1 + - _MinXUV: 0 + - _MinYUV: 0 + - _MotionBlurAngle: 0.1 + - _MotionBlurDist: 1.25 + - _MyDstMode: 10 + - _MySrcMode: 5 + - _NegativeAmount: 1 + - _OffsetUvX: 0 + - _OffsetUvY: 0 + - _OnlyInnerOutline: 0 + - _OnlyOutline: 0 + - _Outline8Directions: 0 + - _OutlineAlpha: 1 + - _OutlineDistortAmount: 0.5 + - _OutlineDistortTexXSpeed: 5 + - _OutlineDistortTexYSpeed: 5 + - _OutlineDistortToggle: 0 + - _OutlineGlow: 1.5 + - _OutlineIsPixel: 0 + - _OutlinePixelWidth: 1 + - _OutlineTexGrey: 0 + - _OutlineTexToggle: 0 + - _OutlineTexXSpeed: 10 + - _OutlineTexYSpeed: 0 + - _OutlineWidth: 0.004 + - _OverlayBlend: 1 + - _OverlayGlow: 1 + - _OverlayTextureScrollXSpeed: 0.25 + - _OverlayTextureScrollYSpeed: 0.25 + - _PinchUvAmount: 0.35 + - _PixelateSize: 32 + - _PosterizeGamma: 0.75 + - _PosterizeNumColors: 8 + - _PosterizeOutline: 0 + - _RadialClip: 45 + - _RadialClip2: 0 + - _RadialClipAngle: 90 + - _RadialClipArc1: 45 + - _RadialClipArc2: 0 + - _RadialStartAngle: 90 + - _RandomSeed: 0 + - _RectSize: 1 + - _RotateUvAmount: 0 + - _RoundWaveSpeed: 2 + - _RoundWaveStrength: 0.7 + - _ShadowAlpha: 0.5 + - _ShadowX: 0.1 + - _ShadowY: -0.05 + - _ShakeUvSpeed: 2.5 + - _ShakeUvX: 1.5 + - _ShakeUvY: 1 + - _ShineGlow: 1 + - _ShineLocation: 0.5 + - _ShineRotate: 0 + - _ShineWidth: 0.1 + - _TextureScrollXSpeed: 1 + - _TextureScrollYSpeed: 0 + - _TwistUvAmount: 1 + - _TwistUvPosX: 0.5 + - _TwistUvPosY: 0.5 + - _TwistUvRadius: 0.75 + - _WarpScale: 0.5 + - _WarpSpeed: 8 + - _WarpStrength: 0.025 + - _WaveAmount: 7 + - _WaveSpeed: 10 + - _WaveStrength: 7.5 + - _WaveX: 0 + - _WaveY: 0.5 + - _ZTestMode: 4 + - _ZWrite: 0 + - _ZoomUvAmount: 0.5 + m_Colors: + - ColorSwapRed: {r: 1, g: 1, b: 1, a: 1} + - _AlphaOutlineColor: {r: 1, g: 1, b: 1, a: 1} + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _ColorChangeNewCol: {r: 1, g: 1, b: 0, a: 1} + - _ColorChangeNewCol2: {r: 1, g: 1, b: 0, a: 1} + - _ColorChangeNewCol3: {r: 1, g: 1, b: 0, a: 1} + - _ColorChangeTarget: {r: 1, g: 0, b: 0, a: 1} + - _ColorChangeTarget2: {r: 1, g: 0, b: 0, a: 1} + - _ColorChangeTarget3: {r: 1, g: 0, b: 0, a: 1} + - _ColorSwapBlue: {r: 1, g: 1, b: 1, a: 1} + - _ColorSwapGreen: {r: 1, g: 1, b: 1, a: 1} + - _ColorSwapRed: {r: 1, g: 1, b: 1, a: 1} + - _FadeBurnColor: {r: 1, g: 1, b: 0, a: 1} + - _GlowColor: {r: 1, g: 1, b: 1, a: 1} + - _GradBotLeftCol: {r: 0, g: 0, b: 1, a: 1} + - _GradBotRightCol: {r: 0, g: 0, b: 1, a: 1} + - _GradTopLeftCol: {r: 1, g: 0, b: 0, a: 1} + - _GradTopRightCol: {r: 1, g: 0, b: 0, a: 1} + - _GreyscaleTintColor: {r: 1, g: 1, b: 1, a: 1} + - _HitEffectColor: {r: 1, g: 1, b: 1, a: 1} + - _HologramStripeColor: {r: 1, g: 1, b: 1, a: 1} + - _InnerOutlineColor: {r: 1, g: 0, b: 0, a: 1} + - _OutlineColor: {r: 1, g: 1, b: 1, a: 1} + - _OverlayColor: {r: 1, g: 1, b: 1, a: 1} + - _ShadowColor: {r: 0, g: 0, b: 0, a: 1} + - _ShineColor: {r: 1, g: 1, b: 1, a: 1} +--- !u!1 &831340857 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 831340858} + - component: {fileID: 831340861} + - component: {fileID: 831340860} + - component: {fileID: 831340859} + m_Layer: 0 + m_Name: Aura + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &831340858 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 831340857} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0.05} + m_LocalScale: {x: 1.009596, y: 1.009596, z: 1.009596} + m_Children: [] + m_Father: {fileID: 982048496} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &831340859 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 831340857} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: ee158225ee1e59f4791627785501d950, type: 3} + m_Name: + m_EditorClassIdentifier: + currentShaderType: 4 + normalStrength: 5 + normalSmoothing: 1 + computingNormal: 0 +--- !u!114 &831340860 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 831340857} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 98b644315d7a92842b89e04f55c48e02, type: 3} + m_Name: + m_EditorClassIdentifier: +--- !u!212 &831340861 +SpriteRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 831340857} + m_Enabled: 1 + m_CastShadows: 0 + m_ReceiveShadows: 0 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 1774397170} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 0 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_Sprite: {fileID: 21300000, guid: 519dafacd208bb64c83d5124be03b09d, type: 3} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_FlipX: 0 + m_FlipY: 0 + m_DrawMode: 0 + m_Size: {x: 5.12, y: 5.12} + m_AdaptiveModeThreshold: 0.5 + m_SpriteTileMode: 0 + m_WasSpriteAssigned: 1 + m_MaskInteraction: 0 + m_SpriteSortPoint: 0 +--- !u!1 &834551330 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 834551331} + - component: {fileID: 834551333} + - component: {fileID: 834551332} + m_Layer: 0 + m_Name: Title + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &834551331 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 834551330} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: -2.51, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 595151377} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!102 &834551332 +TextMesh: + serializedVersion: 3 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 834551330} + m_Text: Pattern + m_OffsetZ: -1.5 + m_CharacterSize: 0.075 + m_LineSpacing: 1 + m_Anchor: 4 + m_Alignment: 0 + m_TabSize: 4 + m_FontSize: 100 + m_FontStyle: 0 + m_RichText: 1 + m_Font: {fileID: 12800000, guid: a4e6a5491519adb45919dc87eff28e55, type: 3} + m_Color: + serializedVersion: 2 + rgba: 4294967295 +--- !u!23 &834551333 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 834551330} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 10100, guid: 0000000000000000e000000000000000, type: 0} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!1 &844328744 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 844328745} + - component: {fileID: 844328747} + - component: {fileID: 844328746} + m_Layer: 0 + m_Name: Title + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &844328745 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 844328744} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: -2.51, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 1447921189} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!102 &844328746 +TextMesh: + serializedVersion: 3 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 844328744} + m_Text: Flicker + m_OffsetZ: -1.5 + m_CharacterSize: 0.075 + m_LineSpacing: 1 + m_Anchor: 4 + m_Alignment: 0 + m_TabSize: 4 + m_FontSize: 100 + m_FontStyle: 0 + m_RichText: 1 + m_Font: {fileID: 12800000, guid: a4e6a5491519adb45919dc87eff28e55, type: 3} + m_Color: + serializedVersion: 2 + rgba: 4294967295 +--- !u!23 &844328747 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 844328744} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 10100, guid: 0000000000000000e000000000000000, type: 0} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!1 &846281938 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 846281939} + - component: {fileID: 846281941} + - component: {fileID: 846281940} + m_Layer: 0 + m_Name: Animated + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 0 +--- !u!4 &846281939 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 846281938} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: -3.57, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 419407226} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!102 &846281940 +TextMesh: + serializedVersion: 3 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 846281938} + m_Text: (Has Animation) + m_OffsetZ: -1.5 + m_CharacterSize: 0.075 + m_LineSpacing: 1 + m_Anchor: 4 + m_Alignment: 0 + m_TabSize: 4 + m_FontSize: 100 + m_FontStyle: 0 + m_RichText: 1 + m_Font: {fileID: 12800000, guid: a4e6a5491519adb45919dc87eff28e55, type: 3} + m_Color: + serializedVersion: 2 + rgba: 4294967295 +--- !u!23 &846281941 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 846281938} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: a4e6a5491519adb45919dc87eff28e55, type: 3} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!1 &849687024 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 849687025} + - component: {fileID: 849687027} + - component: {fileID: 849687026} + m_Layer: 0 + m_Name: Title + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &849687025 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 849687024} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: -2.51, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 419407226} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!102 &849687026 +TextMesh: + serializedVersion: 3 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 849687024} + m_Text: Textured Outline + m_OffsetZ: -1.5 + m_CharacterSize: 0.075 + m_LineSpacing: 1 + m_Anchor: 4 + m_Alignment: 0 + m_TabSize: 4 + m_FontSize: 100 + m_FontStyle: 0 + m_RichText: 1 + m_Font: {fileID: 12800000, guid: a4e6a5491519adb45919dc87eff28e55, type: 3} + m_Color: + serializedVersion: 2 + rgba: 4294967295 +--- !u!23 &849687027 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 849687024} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 10100, guid: 0000000000000000e000000000000000, type: 0} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!1 &857099421 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 857099422} + - component: {fileID: 857099424} + - component: {fileID: 857099423} + m_Layer: 0 + m_Name: Animated + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 0 +--- !u!4 &857099422 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 857099421} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: -3.57, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 972134371} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!102 &857099423 +TextMesh: + serializedVersion: 3 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 857099421} + m_Text: (Has Animation) + m_OffsetZ: -1.5 + m_CharacterSize: 0.075 + m_LineSpacing: 1 + m_Anchor: 4 + m_Alignment: 0 + m_TabSize: 4 + m_FontSize: 100 + m_FontStyle: 0 + m_RichText: 1 + m_Font: {fileID: 12800000, guid: a4e6a5491519adb45919dc87eff28e55, type: 3} + m_Color: + serializedVersion: 2 + rgba: 4294967295 +--- !u!23 &857099424 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 857099421} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: a4e6a5491519adb45919dc87eff28e55, type: 3} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!1 &858113521 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 858113522} + - component: {fileID: 858113524} + - component: {fileID: 858113523} + m_Layer: 0 + m_Name: Title + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &858113522 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 858113521} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: -2.51, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 1813870144} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!102 &858113523 +TextMesh: + serializedVersion: 3 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 858113521} + m_Text: Chromatic Aberration + m_OffsetZ: -1.5 + m_CharacterSize: 0.075 + m_LineSpacing: 1 + m_Anchor: 4 + m_Alignment: 0 + m_TabSize: 4 + m_FontSize: 100 + m_FontStyle: 0 + m_RichText: 1 + m_Font: {fileID: 12800000, guid: a4e6a5491519adb45919dc87eff28e55, type: 3} + m_Color: + serializedVersion: 2 + rgba: 4294967295 +--- !u!23 &858113524 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 858113521} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 10100, guid: 0000000000000000e000000000000000, type: 0} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!1 &866812739 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 866812740} + - component: {fileID: 866812742} + - component: {fileID: 866812741} + m_Layer: 0 + m_Name: Title + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &866812740 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 866812739} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: -2.51, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 1120052622} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!102 &866812741 +TextMesh: + serializedVersion: 3 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 866812739} + m_Text: Glow + m_OffsetZ: -1.5 + m_CharacterSize: 0.075 + m_LineSpacing: 1 + m_Anchor: 4 + m_Alignment: 0 + m_TabSize: 4 + m_FontSize: 100 + m_FontStyle: 0 + m_RichText: 1 + m_Font: {fileID: 12800000, guid: a4e6a5491519adb45919dc87eff28e55, type: 3} + m_Color: + serializedVersion: 2 + rgba: 4294967295 +--- !u!23 &866812742 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 866812739} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 10100, guid: 0000000000000000e000000000000000, type: 0} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!1 &878272796 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 878272797} + - component: {fileID: 878272799} + - component: {fileID: 878272798} + m_Layer: 0 + m_Name: Title + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &878272797 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 878272796} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: -2.51, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 1767383824} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!102 &878272798 +TextMesh: + serializedVersion: 3 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 878272796} + m_Text: Blur + m_OffsetZ: -1.5 + m_CharacterSize: 0.075 + m_LineSpacing: 1 + m_Anchor: 4 + m_Alignment: 0 + m_TabSize: 4 + m_FontSize: 100 + m_FontStyle: 0 + m_RichText: 1 + m_Font: {fileID: 12800000, guid: a4e6a5491519adb45919dc87eff28e55, type: 3} + m_Color: + serializedVersion: 2 + rgba: 4294967295 +--- !u!23 &878272799 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 878272796} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 10100, guid: 0000000000000000e000000000000000, type: 0} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!21 &883004836 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: AllIn1SpriteShader/AllIn1SpriteShader + m_Shader: {fileID: 4800000, guid: a36b7719ff0465b42ab1407d67672c5f, type: 3} + m_ShaderKeywords: COLORSWAP_ON ETC1_EXTERNAL_ALPHA GLOWTEX_ON GLOW_ON OUTBASE8DIR_ON + OUTBASE_ON OUTDIST_ON OUTTEX_ON _GLOWTEXUSED_ON _OUTLINE8DIRECTIONS_ON _OUTLINEDISTORTTOGGLE_ON + _OUTLINETEXTOGGLE_ON + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _ColorRampTex: + m_Texture: {fileID: 2800000, guid: 279657edc397ece4b8029c727adf6ddc, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ColorRampTexGradient: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ColorSwapTex: + m_Texture: {fileID: 2800000, guid: 065da6c7b90ca904dab9cbc6b415fd19, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DistortTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _FadeBurnTex: + m_Texture: {fileID: 2800000, guid: 32e8df0008bebe746b1681a71c61f31c, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _FadeTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _GlowTex: + m_Texture: {fileID: 2800000, guid: 8608ef90f91271745a17f7210fe1e7db, type: 3} + 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} + - _OutlineDistortTex: + m_Texture: {fileID: 2800000, guid: f96aebb9bcd1e3b44bafbb23b1bdac88, type: 3} + m_Scale: {x: 3, y: 3} + m_Offset: {x: 0, y: 0} + - _OutlineTex: + m_Texture: {fileID: 2800000, guid: 677cca399782dea41aedc1d292ecb67d, type: 3} + m_Scale: {x: 1.5, y: 1.5} + m_Offset: {x: 0, y: 0} + - _OverlayTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ShineMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - _Alpha: 1 + - _AlphaCutoffValue: 0.25 + - _AlphaOutlineBlend: 1 + - _AlphaOutlineGlow: 5 + - _AlphaOutlineMinAlpha: 0 + - _AlphaOutlinePower: 1 + - _AlphaRoundThreshold: 0.5 + - _BillboardY: 0 + - _BlurHD: 0 + - _BlurIntensity: 10 + - _Brightness: 0 + - _ChromAberrAlpha: 0.4 + - _ChromAberrAmount: 1 + - _ClipUvDown: 1 + - _ClipUvLeft: 1 + - _ClipUvRight: 1 + - _ClipUvUp: 1 + - _ColorChangeLuminosity: 0 + - _ColorChangeTolerance: 0.25 + - _ColorChangeTolerance2: 0.25 + - _ColorChangeTolerance3: 0.25 + - _ColorRampBlend: 1 + - _ColorRampLuminosity: 0 + - _ColorRampOutline: 0 + - _ColorSwapBlend: 1 + - _ColorSwapBlueLuminosity: 0.5 + - _ColorSwapGreenLuminosity: 0.128 + - _ColorSwapRedLuminosity: 0.5 + - _Contrast: 1 + - _CullingOption: 0 + - _DistortAmount: 0.5 + - _DistortTexXSpeed: 5 + - _DistortTexYSpeed: 5 + - _EditorDrawers: 6 + - _FadeAmount: -0.1 + - _FadeBurnGlow: 2 + - _FadeBurnTransition: 0.075 + - _FadeBurnWidth: 0.025 + - _FishEyeUvAmount: 0.35 + - _FlickerAlpha: 0 + - _FlickerFreq: 0.2 + - _FlickerPercent: 0.05 + - _GhostBlend: 1 + - _GhostColorBoost: 1 + - _GhostTransparency: 0 + - _GlitchAmount: 3 + - _GlitchSize: 1 + - _Glow: 6.1 + - _GlowGlobal: 1 + - _GlowTexUsed: 1 + - _GradBlend: 1 + - _GradBoostX: 1.2 + - _GradBoostY: 1.2 + - _GradIsRadial: 0 + - _GrassManualAnim: 1 + - _GrassManualToggle: 0 + - _GrassRadialBend: 0.25 + - _GrassSpeed: 2 + - _GrassWind: 20 + - _GreyscaleBlend: 1 + - _GreyscaleLuminosity: 0 + - _GreyscaleOutline: 0 + - _HandDrawnAmount: 10 + - _HandDrawnSpeed: 5 + - _HitEffectBlend: 1 + - _HitEffectGlow: 5 + - _HologramBlend: 1 + - _HologramFlickerAlpha: 0 + - _HologramFlickerFreq: 0.2 + - _HologramFlickerPercent: 0.05 + - _HologramMaxAlpha: 1 + - _HologramMinAlpha: 0 + - _HologramStripesAlpha: 0.4 + - _HologramStripesAmount: 50 + - _HologramStripesFill: 0.4 + - _HologramStripesLuminosity: 1 + - _HologramStripesSpeed: 5 + - _HologramUnmodAmount: 0.4 + - _HsvBright: 1 + - _HsvSaturation: 1 + - _HsvShift: 180 + - _InnerOutlineAlpha: 1 + - _InnerOutlineGlow: 1 + - _InnerOutlineThickness: 1 + - _MaxXUV: 1 + - _MaxYUV: 1 + - _MinXUV: 0 + - _MinYUV: 0 + - _MotionBlurAngle: 0.1 + - _MotionBlurDist: 1.25 + - _MyDstMode: 10 + - _MySrcMode: 5 + - _NegativeAmount: 1 + - _OffsetUvX: 0 + - _OffsetUvY: 0 + - _OnlyInnerOutline: 0 + - _OnlyOutline: 0 + - _Outline8Directions: 1 + - _OutlineAlpha: 1 + - _OutlineDistortAmount: 0.05 + - _OutlineDistortTexXSpeed: 2 + - _OutlineDistortTexYSpeed: -14.6 + - _OutlineDistortToggle: 1 + - _OutlineGlow: 10.4 + - _OutlineIsPixel: 0 + - _OutlinePixelWidth: 1 + - _OutlineTexGrey: 0 + - _OutlineTexToggle: 1 + - _OutlineTexXSpeed: 1 + - _OutlineTexYSpeed: -4 + - _OutlineWidth: 0.031 + - _OverlayBlend: 1 + - _OverlayGlow: 1 + - _OverlayTextureScrollXSpeed: 0.25 + - _OverlayTextureScrollYSpeed: 0.25 + - _PinchUvAmount: 0.35 + - _PixelateSize: 32 + - _PosterizeGamma: 0.75 + - _PosterizeNumColors: 8 + - _PosterizeOutline: 0 + - _RadialClipAngle: 90 + - _RadialClipArc1: 45 + - _RadialClipArc2: 0 + - _RandomSeed: 0 + - _RectSize: 1 + - _RotateUvAmount: 0 + - _RoundWaveSpeed: 2 + - _RoundWaveStrength: 0.7 + - _ShadowAlpha: 0.5 + - _ShadowX: 0.1 + - _ShadowY: -0.05 + - _ShakeUvSpeed: 2.5 + - _ShakeUvX: 1.5 + - _ShakeUvY: 1 + - _ShineGlow: 1 + - _ShineLocation: 0.5 + - _ShineRotate: 0 + - _ShineWidth: 0.1 + - _TextureScrollXSpeed: 1 + - _TextureScrollYSpeed: 0 + - _TwistUvAmount: 1 + - _TwistUvPosX: 0.5 + - _TwistUvPosY: 0.5 + - _TwistUvRadius: 0.75 + - _WarpScale: 0.5 + - _WarpSpeed: 8 + - _WarpStrength: 0.025 + - _WaveAmount: 8.95 + - _WaveSpeed: 12.14 + - _WaveStrength: 18.77 + - _WaveX: 0 + - _WaveY: 0.5 + - _ZTestMode: 4 + - _ZWrite: 0 + - _ZoomUvAmount: 0.5 + m_Colors: + - ColorSwapRed: {r: 1, g: 1, b: 1, a: 1} + - _AlphaOutlineColor: {r: 1, g: 1, b: 1, a: 1} + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _ColorChangeNewCol: {r: 1, g: 1, b: 0, a: 1} + - _ColorChangeNewCol2: {r: 1, g: 1, b: 0, a: 1} + - _ColorChangeNewCol3: {r: 1, g: 1, b: 0, a: 1} + - _ColorChangeTarget: {r: 1, g: 0, b: 0, a: 1} + - _ColorChangeTarget2: {r: 1, g: 0, b: 0, a: 1} + - _ColorChangeTarget3: {r: 1, g: 0, b: 0, a: 1} + - _ColorSwapBlue: {r: 0.3490566, g: 0.3490566, b: 0.3490566, a: 1} + - _ColorSwapGreen: {r: 1, g: 0.11792451, b: 0.11792451, a: 1} + - _ColorSwapRed: {r: 0.6603774, g: 0.6603774, b: 0.6603774, a: 1} + - _FadeBurnColor: {r: 1, g: 1, b: 0, a: 1} + - _GlowColor: {r: 1, g: 0.11320752, b: 0.11320752, a: 1} + - _GradBotLeftCol: {r: 0, g: 0, b: 1, a: 1} + - _GradBotRightCol: {r: 0, g: 0, b: 1, a: 1} + - _GradTopLeftCol: {r: 1, g: 0, b: 0, a: 1} + - _GradTopRightCol: {r: 1, g: 0, b: 0, a: 1} + - _GreyscaleTintColor: {r: 1, g: 1, b: 1, a: 1} + - _HitEffectColor: {r: 1, g: 1, b: 1, a: 1} + - _HologramStripeColor: {r: 1, g: 1, b: 1, a: 1} + - _InnerOutlineColor: {r: 1, g: 0, b: 0, a: 1} + - _OutlineColor: {r: 1, g: 0.122641504, b: 0.122641504, a: 1} + - _OverlayColor: {r: 1, g: 1, b: 1, a: 1} + - _ShadowColor: {r: 0, g: 0, b: 0, a: 1} + - _ShineColor: {r: 1, g: 1, b: 1, a: 1} +--- !u!1 &892560182 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 892560183} + - component: {fileID: 892560185} + - component: {fileID: 892560184} + m_Layer: 0 + m_Name: Animated + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 0 +--- !u!4 &892560183 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 892560182} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: -3.57, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 1286689243} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!102 &892560184 +TextMesh: + serializedVersion: 3 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 892560182} + m_Text: (Has Animation) + m_OffsetZ: -1.5 + m_CharacterSize: 0.075 + m_LineSpacing: 1 + m_Anchor: 4 + m_Alignment: 0 + m_TabSize: 4 + m_FontSize: 100 + m_FontStyle: 0 + m_RichText: 1 + m_Font: {fileID: 12800000, guid: a4e6a5491519adb45919dc87eff28e55, type: 3} + m_Color: + serializedVersion: 2 + rgba: 4294967295 +--- !u!23 &892560185 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 892560182} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: a4e6a5491519adb45919dc87eff28e55, type: 3} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!1 &906963583 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 906963584} + - component: {fileID: 906963586} + - component: {fileID: 906963585} + m_Layer: 0 + m_Name: Animated + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 0 +--- !u!4 &906963584 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 906963583} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: -4.447157, z: 0} + m_LocalScale: {x: 1.2457023, y: 1.2457023, z: 1.2457023} + m_Children: [] + m_Father: {fileID: 982048496} + m_RootOrder: 2 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!102 &906963585 +TextMesh: + serializedVersion: 3 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 906963583} + m_Text: (Has Animation) + m_OffsetZ: -1.5 + m_CharacterSize: 0.075 + m_LineSpacing: 1 + m_Anchor: 4 + m_Alignment: 0 + m_TabSize: 4 + m_FontSize: 100 + m_FontStyle: 0 + m_RichText: 1 + m_Font: {fileID: 12800000, guid: a4e6a5491519adb45919dc87eff28e55, type: 3} + m_Color: + serializedVersion: 2 + rgba: 4294967295 +--- !u!23 &906963586 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 906963583} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: a4e6a5491519adb45919dc87eff28e55, type: 3} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!1 &912083091 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 912083092} + - component: {fileID: 912083094} + - component: {fileID: 912083093} + m_Layer: 0 + m_Name: Title + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &912083092 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 912083091} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: -2.51, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 1554650441} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!102 &912083093 +TextMesh: + serializedVersion: 3 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 912083091} + m_Text: Wave + m_OffsetZ: -1.5 + m_CharacterSize: 0.075 + m_LineSpacing: 1 + m_Anchor: 4 + m_Alignment: 0 + m_TabSize: 4 + m_FontSize: 100 + m_FontStyle: 0 + m_RichText: 1 + m_Font: {fileID: 12800000, guid: a4e6a5491519adb45919dc87eff28e55, type: 3} + m_Color: + serializedVersion: 2 + rgba: 4294967295 +--- !u!23 &912083094 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 912083091} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 10100, guid: 0000000000000000e000000000000000, type: 0} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!1 &913568438 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 913568439} + - component: {fileID: 913568441} + - component: {fileID: 913568440} + m_Layer: 0 + m_Name: Title + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &913568439 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 913568438} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: -2.51, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 1050471976} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!102 &913568440 +TextMesh: + serializedVersion: 3 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 913568438} + m_Text: Fill Amount + m_OffsetZ: -1.5 + m_CharacterSize: 0.075 + m_LineSpacing: 1 + m_Anchor: 4 + m_Alignment: 0 + m_TabSize: 4 + m_FontSize: 100 + m_FontStyle: 0 + m_RichText: 1 + m_Font: {fileID: 12800000, guid: a4e6a5491519adb45919dc87eff28e55, type: 3} + m_Color: + serializedVersion: 2 + rgba: 4294967295 +--- !u!23 &913568441 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 913568438} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 10100, guid: 0000000000000000e000000000000000, type: 0} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!21 &916295327 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: AllIn1SpriteShader/AllIn1SpriteShader + m_Shader: {fileID: 4800000, guid: a36b7719ff0465b42ab1407d67672c5f, type: 3} + m_ShaderKeywords: CHROMABERR_ON ETC1_EXTERNAL_ALPHA FISHEYE_ON HITEFFECT_ON OUTBASE8DIR_ON + OUTBASE_ON PINCH_ON _OUTLINE8DIRECTIONS_ON + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _ColorRampTex: + m_Texture: {fileID: 2800000, guid: 279657edc397ece4b8029c727adf6ddc, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ColorRampTexGradient: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ColorSwapTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DistortTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _FadeBurnTex: + m_Texture: {fileID: 2800000, guid: 32e8df0008bebe746b1681a71c61f31c, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _FadeTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _GlowTex: + 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} + - _OutlineDistortTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OutlineTex: + m_Texture: {fileID: 2800000, guid: 74087f6d03f233e4a8a142fa01f9e5cf, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OverlayTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ShineMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - _Alpha: 1 + - _AlphaCutoffValue: 0.25 + - _AlphaOutlineBlend: 1 + - _AlphaOutlineGlow: 5 + - _AlphaOutlineMinAlpha: 0 + - _AlphaOutlinePower: 1 + - _AlphaRoundThreshold: 0.5 + - _BillboardY: 0 + - _BlurHD: 0 + - _BlurIntensity: 10 + - _Brightness: 0 + - _ChromAberrAlpha: 0.249 + - _ChromAberrAmount: 0 + - _ClipUvDown: 1 + - _ClipUvLeft: 1 + - _ClipUvRight: 1 + - _ClipUvUp: 1 + - _ColorChangeLuminosity: 0 + - _ColorChangeTolerance: 0.25 + - _ColorChangeTolerance2: 0.25 + - _ColorChangeTolerance3: 0.25 + - _ColorRampBlend: 1 + - _ColorRampLuminosity: 0 + - _ColorRampOutline: 0 + - _ColorSwapBlend: 1 + - _ColorSwapBlueLuminosity: 0.5 + - _ColorSwapGreenLuminosity: 0.5 + - _ColorSwapRedLuminosity: 0.5 + - _Contrast: 1 + - _CullingOption: 0 + - _DistortAmount: 0.5 + - _DistortTexXSpeed: 5 + - _DistortTexYSpeed: 5 + - _EditorDrawers: 6 + - _FadeAmount: -0.1 + - _FadeBurnGlow: 2 + - _FadeBurnTransition: 0.075 + - _FadeBurnWidth: 0.025 + - _FishEyeUvAmount: 0 + - _FlickerAlpha: 0 + - _FlickerFreq: 0.2 + - _FlickerPercent: 0.05 + - _GhostBlend: 1 + - _GhostColorBoost: 1 + - _GhostTransparency: 0 + - _GlitchAmount: 3 + - _GlitchSize: 1 + - _Glow: 10 + - _GlowGlobal: 1 + - _GlowTexUsed: 0 + - _GradBlend: 1 + - _GradBoostX: 1.2 + - _GradBoostY: 1.2 + - _GradIsRadial: 0 + - _GrassManualAnim: 1 + - _GrassManualToggle: 0 + - _GrassRadialBend: 0.25 + - _GrassSpeed: 2 + - _GrassWind: 20 + - _GreyscaleBlend: 1 + - _GreyscaleLuminosity: 0 + - _GreyscaleOutline: 0 + - _HandDrawnAmount: 10 + - _HandDrawnSpeed: 5 + - _HitEffectBlend: 1 + - _HitEffectGlow: 5 + - _HologramBlend: 1 + - _HologramFlickerAlpha: 0 + - _HologramFlickerFreq: 0.2 + - _HologramFlickerPercent: 0.05 + - _HologramMaxAlpha: 1 + - _HologramMinAlpha: 0 + - _HologramStripesAlpha: 0.4 + - _HologramStripesAmount: 50 + - _HologramStripesFill: 0.4 + - _HologramStripesLuminosity: 1 + - _HologramStripesSpeed: 5 + - _HologramUnmodAmount: 0.4 + - _HsvBright: 1 + - _HsvSaturation: 1 + - _HsvShift: 224 + - _InnerOutlineAlpha: 1 + - _InnerOutlineGlow: 1 + - _InnerOutlineThickness: 1 + - _MaxXUV: 1 + - _MaxYUV: 1 + - _MinXUV: 0 + - _MinYUV: 0 + - _MotionBlurAngle: 0.1 + - _MotionBlurDist: 1.25 + - _MyDstMode: 10 + - _MySrcMode: 5 + - _NegativeAmount: 1 + - _OffsetUvX: 0 + - _OffsetUvY: 0 + - _OnlyInnerOutline: 0 + - _OnlyOutline: 0 + - _Outline8Directions: 1 + - _OutlineAlpha: 1 + - _OutlineDistortAmount: 0.5 + - _OutlineDistortTexXSpeed: 5 + - _OutlineDistortTexYSpeed: 5 + - _OutlineDistortToggle: 0 + - _OutlineGlow: 2 + - _OutlineIsPixel: 0 + - _OutlinePixelWidth: 1 + - _OutlineTexGrey: 0 + - _OutlineTexToggle: 0 + - _OutlineTexXSpeed: 10 + - _OutlineTexYSpeed: 0 + - _OutlineWidth: 0.0107 + - _OverlayBlend: 1 + - _OverlayGlow: 1 + - _OverlayTextureScrollXSpeed: 0.25 + - _OverlayTextureScrollYSpeed: 0.25 + - _PinchUvAmount: 0 + - _PixelateSize: 32 + - _PosterizeGamma: 0.75 + - _PosterizeNumColors: 8 + - _PosterizeOutline: 0 + - _RadialClip: 0 + - _RadialClip2: 45 + - _RadialClipAngle: 90 + - _RadialClipArc1: 45 + - _RadialClipArc2: 0 + - _RadialStartAngle: 90 + - _RandomSeed: 0 + - _RectSize: 1 + - _RotateUvAmount: 0 + - _RoundWaveSpeed: 2 + - _RoundWaveStrength: 0.7 + - _ShadowAlpha: 0.5 + - _ShadowX: 0.1 + - _ShadowY: -0.05 + - _ShakeUvSpeed: 2.5 + - _ShakeUvX: 1.5 + - _ShakeUvY: 1 + - _ShineGlow: 1 + - _ShineLocation: 0.5 + - _ShineRotate: 0 + - _ShineWidth: 0.1 + - _TextureScrollXSpeed: 1 + - _TextureScrollYSpeed: 0 + - _TwistUvAmount: 1 + - _TwistUvPosX: 0.5 + - _TwistUvPosY: 0.5 + - _TwistUvRadius: 0.75 + - _WarpScale: 0.5 + - _WarpSpeed: 8 + - _WarpStrength: 0.025 + - _WaveAmount: 7 + - _WaveSpeed: 10 + - _WaveStrength: 7.5 + - _WaveX: 0 + - _WaveY: 0.5 + - _ZTestMode: 4 + - _ZWrite: 0 + - _ZoomUvAmount: 0.5 + m_Colors: + - ColorSwapRed: {r: 1, g: 1, b: 1, a: 1} + - _AlphaOutlineColor: {r: 1, g: 1, b: 1, a: 1} + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _ColorChangeNewCol: {r: 1, g: 1, b: 0, a: 1} + - _ColorChangeNewCol2: {r: 1, g: 1, b: 0, a: 1} + - _ColorChangeNewCol3: {r: 1, g: 1, b: 0, a: 1} + - _ColorChangeTarget: {r: 1, g: 0, b: 0, a: 1} + - _ColorChangeTarget2: {r: 1, g: 0, b: 0, a: 1} + - _ColorChangeTarget3: {r: 1, g: 0, b: 0, a: 1} + - _ColorSwapBlue: {r: 1, g: 1, b: 1, a: 1} + - _ColorSwapGreen: {r: 1, g: 1, b: 1, a: 1} + - _ColorSwapRed: {r: 1, g: 1, b: 1, a: 1} + - _FadeBurnColor: {r: 1, g: 1, b: 0, a: 1} + - _GlowColor: {r: 1, g: 1, b: 1, a: 1} + - _GradBotLeftCol: {r: 0, g: 0, b: 1, a: 1} + - _GradBotRightCol: {r: 0, g: 0, b: 1, a: 1} + - _GradTopLeftCol: {r: 1, g: 0, b: 0, a: 1} + - _GradTopRightCol: {r: 1, g: 0, b: 0, a: 1} + - _GreyscaleTintColor: {r: 1, g: 1, b: 1, a: 1} + - _HitEffectColor: {r: 1, g: 1, b: 1, a: 1} + - _HologramStripeColor: {r: 1, g: 1, b: 1, a: 1} + - _InnerOutlineColor: {r: 1, g: 0, b: 0, a: 1} + - _OutlineColor: {r: 1, g: 0.9094448, b: 0, a: 1} + - _OverlayColor: {r: 1, g: 1, b: 1, a: 1} + - _ShadowColor: {r: 0, g: 0, b: 0, a: 1} + - _ShineColor: {r: 1, g: 1, b: 1, a: 1} +--- !u!1 &924727830 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 924727831} + - component: {fileID: 924727833} + - component: {fileID: 924727832} + m_Layer: 0 + m_Name: Animated + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 0 +--- !u!4 &924727831 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 924727830} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: -3.57, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 166039413} + m_RootOrder: 2 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!102 &924727832 +TextMesh: + serializedVersion: 3 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 924727830} + m_Text: (Has Animation) + m_OffsetZ: -1.5 + m_CharacterSize: 0.075 + m_LineSpacing: 1 + m_Anchor: 4 + m_Alignment: 0 + m_TabSize: 4 + m_FontSize: 100 + m_FontStyle: 0 + m_RichText: 1 + m_Font: {fileID: 12800000, guid: a4e6a5491519adb45919dc87eff28e55, type: 3} + m_Color: + serializedVersion: 2 + rgba: 4294967295 +--- !u!23 &924727833 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 924727830} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: a4e6a5491519adb45919dc87eff28e55, type: 3} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!1 &928177172 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 928177173} + - component: {fileID: 928177175} + - component: {fileID: 928177174} + m_Layer: 0 + m_Name: Title + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &928177173 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 928177172} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: -2.51, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 242385329} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!102 &928177174 +TextMesh: + serializedVersion: 3 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 928177172} + m_Text: Water + m_OffsetZ: -1.5 + m_CharacterSize: 0.075 + m_LineSpacing: 1 + m_Anchor: 4 + m_Alignment: 0 + m_TabSize: 4 + m_FontSize: 100 + m_FontStyle: 0 + m_RichText: 1 + m_Font: {fileID: 12800000, guid: a4e6a5491519adb45919dc87eff28e55, type: 3} + m_Color: + serializedVersion: 2 + rgba: 4294967295 +--- !u!23 &928177175 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 928177172} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 10100, guid: 0000000000000000e000000000000000, type: 0} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!1 &933861177 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 933861178} + - component: {fileID: 933861180} + - component: {fileID: 933861179} + m_Layer: 0 + m_Name: Animated + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 0 +--- !u!4 &933861178 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 933861177} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: -3.57, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 1554650441} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!102 &933861179 +TextMesh: + serializedVersion: 3 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 933861177} + m_Text: (Has Animation) + m_OffsetZ: -1.5 + m_CharacterSize: 0.075 + m_LineSpacing: 1 + m_Anchor: 4 + m_Alignment: 0 + m_TabSize: 4 + m_FontSize: 100 + m_FontStyle: 0 + m_RichText: 1 + m_Font: {fileID: 12800000, guid: a4e6a5491519adb45919dc87eff28e55, type: 3} + m_Color: + serializedVersion: 2 + rgba: 4294967295 +--- !u!23 &933861180 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 933861177} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: a4e6a5491519adb45919dc87eff28e55, type: 3} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!1 &935289135 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 935289136} + - component: {fileID: 935289137} + m_Layer: 0 + m_Name: FlagPole + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &935289136 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 935289135} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 798901404} + m_Father: {fileID: 1883979700} + m_RootOrder: 2 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!212 &935289137 +SpriteRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 935289135} + m_Enabled: 1 + m_CastShadows: 0 + m_ReceiveShadows: 0 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 10754, guid: 0000000000000000f000000000000000, type: 0} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 0 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_Sprite: {fileID: 21300000, guid: adce45105552071409c959137cb5b670, type: 3} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_FlipX: 0 + m_FlipY: 0 + m_DrawMode: 0 + m_Size: {x: 1.26, y: 4.34} + m_AdaptiveModeThreshold: 0.5 + m_SpriteTileMode: 0 + m_WasSpriteAssigned: 1 + m_MaskInteraction: 0 + m_SpriteSortPoint: 0 +--- !u!1 &939106331 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 939106332} + - component: {fileID: 939106333} + m_Layer: 0 + m_Name: MotionBlur + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &939106332 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 939106331} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 210, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 671117226} + - {fileID: 2023359958} + - {fileID: 298142067} + m_Father: {fileID: 2036092933} + m_RootOrder: 21 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &939106333 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 939106331} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 98b644315d7a92842b89e04f55c48e02, type: 3} + m_Name: + m_EditorClassIdentifier: +--- !u!1 &941567972 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 941567973} + - component: {fileID: 941567975} + - component: {fileID: 941567974} + m_Layer: 0 + m_Name: Animated + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 0 +--- !u!4 &941567973 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 941567972} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: -3.57, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 1313138820} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!102 &941567974 +TextMesh: + serializedVersion: 3 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 941567972} + m_Text: (Has Animation) + m_OffsetZ: -1.5 + m_CharacterSize: 0.075 + m_LineSpacing: 1 + m_Anchor: 4 + m_Alignment: 0 + m_TabSize: 4 + m_FontSize: 100 + m_FontStyle: 0 + m_RichText: 1 + m_Font: {fileID: 12800000, guid: a4e6a5491519adb45919dc87eff28e55, type: 3} + m_Color: + serializedVersion: 2 + rgba: 4294967295 +--- !u!23 &941567975 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 941567972} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: a4e6a5491519adb45919dc87eff28e55, type: 3} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!1 &942262412 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 942262413} + - component: {fileID: 942262415} + - component: {fileID: 942262414} + m_Layer: 0 + m_Name: Animated + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 0 +--- !u!4 &942262413 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 942262412} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: -3.57, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 242385329} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!102 &942262414 +TextMesh: + serializedVersion: 3 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 942262412} + m_Text: (Has Animation) + m_OffsetZ: -1.5 + m_CharacterSize: 0.075 + m_LineSpacing: 1 + m_Anchor: 4 + m_Alignment: 0 + m_TabSize: 4 + m_FontSize: 100 + m_FontStyle: 0 + m_RichText: 1 + m_Font: {fileID: 12800000, guid: a4e6a5491519adb45919dc87eff28e55, type: 3} + m_Color: + serializedVersion: 2 + rgba: 4294967295 +--- !u!23 &942262415 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 942262412} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: a4e6a5491519adb45919dc87eff28e55, type: 3} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!1 &944684572 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 944684573} + - component: {fileID: 944684575} + - component: {fileID: 944684576} + - component: {fileID: 944684577} + m_Layer: 0 + m_Name: Posterize + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &944684573 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 944684572} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 190, y: 0, z: 0} + m_LocalScale: {x: 0.80276, y: 0.80276, z: 0.80276} + m_Children: + - {fileID: 1357243700} + - {fileID: 1497593394} + m_Father: {fileID: 2036092933} + m_RootOrder: 19 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!212 &944684575 +SpriteRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 944684572} + m_Enabled: 1 + m_CastShadows: 0 + m_ReceiveShadows: 0 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 302907434} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 0 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_Sprite: {fileID: 21300000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_FlipX: 0 + m_FlipY: 0 + m_DrawMode: 0 + m_Size: {x: 5.12, y: 5.12} + m_AdaptiveModeThreshold: 0.5 + m_SpriteTileMode: 0 + m_WasSpriteAssigned: 1 + m_MaskInteraction: 0 + m_SpriteSortPoint: 0 +--- !u!114 &944684576 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 944684572} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 98b644315d7a92842b89e04f55c48e02, type: 3} + m_Name: + m_EditorClassIdentifier: +--- !u!95 &944684577 +Animator: + serializedVersion: 3 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 944684572} + m_Enabled: 1 + m_Avatar: {fileID: 0} + m_Controller: {fileID: 9100000, guid: e25fb0db751a59a43bb4bd01628feb7e, type: 2} + m_CullingMode: 0 + m_UpdateMode: 0 + m_ApplyRootMotion: 0 + m_LinearVelocityBlending: 0 + m_WarningMessage: + m_HasTransformHierarchy: 1 + m_AllowConstantClipSamplingOptimization: 1 + m_KeepAnimatorControllerStateOnDisable: 0 +--- !u!1 &945953420 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 945953421} + - component: {fileID: 945953423} + - component: {fileID: 945953422} + m_Layer: 0 + m_Name: Animated + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &945953421 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 945953420} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: -4.447157, z: 0} + m_LocalScale: {x: 1.2457023, y: 1.2457023, z: 1.2457023} + m_Children: [] + m_Father: {fileID: 1861014113} + m_RootOrder: 2 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!102 &945953422 +TextMesh: + serializedVersion: 3 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 945953420} + m_Text: (Has Sprite Mask) + m_OffsetZ: -1.5 + m_CharacterSize: 0.06 + m_LineSpacing: 1 + m_Anchor: 4 + m_Alignment: 0 + m_TabSize: 4 + m_FontSize: 100 + m_FontStyle: 0 + m_RichText: 1 + m_Font: {fileID: 12800000, guid: a4e6a5491519adb45919dc87eff28e55, type: 3} + m_Color: + serializedVersion: 2 + rgba: 4294967295 +--- !u!23 &945953423 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 945953420} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 10100, guid: 0000000000000000e000000000000000, type: 0} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!21 &946451345 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: AllIn1SpriteShader/AllIn1SpriteShader + m_Shader: {fileID: 4800000, guid: a36b7719ff0465b42ab1407d67672c5f, type: 3} + m_ShaderKeywords: COLORRAMP_ON ETC1_EXTERNAL_ALPHA FISHEYE_ON INNEROUTLINE_ON + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _ColorRampTex: + m_Texture: {fileID: 2800000, guid: 2eb26501acf862843a55a2e79af0c3c8, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ColorRampTexGradient: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ColorSwapTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DistortTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _FadeBurnTex: + m_Texture: {fileID: 2800000, guid: 677cca399782dea41aedc1d292ecb67d, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _FadeTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _GlowTex: + 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} + - _OutlineDistortTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OutlineTex: + m_Texture: {fileID: 2800000, guid: 74087f6d03f233e4a8a142fa01f9e5cf, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OverlayTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ShineMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - _Alpha: 1 + - _AlphaCutoffValue: 0.25 + - _AlphaOutlineBlend: 1 + - _AlphaOutlineGlow: 5 + - _AlphaOutlineMinAlpha: 0 + - _AlphaOutlinePower: 1 + - _AlphaRoundThreshold: 0.5 + - _BillboardY: 0 + - _BlurHD: 0 + - _BlurIntensity: 10 + - _Brightness: 0 + - _ChromAberrAlpha: 0.4 + - _ChromAberrAmount: 1 + - _ClipUvDown: 0 + - _ClipUvLeft: 0 + - _ClipUvRight: 0 + - _ClipUvUp: 0 + - _ColorChangeLuminosity: 0 + - _ColorChangeTolerance: 0.25 + - _ColorChangeTolerance2: 0.25 + - _ColorChangeTolerance3: 0.25 + - _ColorRampBlend: 1 + - _ColorRampLuminosity: 0.2 + - _ColorRampOutline: 0 + - _ColorSwapBlend: 1 + - _ColorSwapBlueLuminosity: 0.5 + - _ColorSwapGreenLuminosity: 0.5 + - _ColorSwapRedLuminosity: 0.5 + - _Contrast: 5.27 + - _CullingOption: 0 + - _DistortAmount: 0.5 + - _DistortTexXSpeed: 5 + - _DistortTexYSpeed: 5 + - _EditorDrawers: 6 + - _FadeAmount: -0.1 + - _FadeBurnGlow: 2 + - _FadeBurnTransition: 0.075 + - _FadeBurnWidth: 0.025 + - _FishEyeUvAmount: 0.252 + - _FlickerAlpha: 0 + - _FlickerFreq: 0.2 + - _FlickerPercent: 0.05 + - _GhostBlend: 1 + - _GhostColorBoost: 1 + - _GhostTransparency: 0 + - _GlitchAmount: 3 + - _GlitchSize: 1 + - _Glow: 10 + - _GlowGlobal: 1 + - _GlowTexUsed: 0 + - _GradBlend: 1 + - _GradBoostX: 1.2 + - _GradBoostY: 1.1 + - _GradIsRadial: 0 + - _GrassManualAnim: 1 + - _GrassManualToggle: 0 + - _GrassRadialBend: 0.25 + - _GrassSpeed: 2 + - _GrassWind: 20 + - _GreyscaleBlend: 1 + - _GreyscaleLuminosity: 0 + - _GreyscaleOutline: 0 + - _HandDrawnAmount: 10 + - _HandDrawnSpeed: 5 + - _HitEffectBlend: 1 + - _HitEffectGlow: 5 + - _HologramBlend: 1 + - _HologramMaxAlpha: 0.75 + - _HologramMinAlpha: 0.1 + - _HologramStripesAmount: 0.1 + - _HologramStripesSpeed: 4.5 + - _HologramUnmodAmount: 0 + - _HsvBright: 1 + - _HsvSaturation: 1 + - _HsvShift: 180 + - _InnerOutlineAlpha: 1 + - _InnerOutlineGlow: 250 + - _InnerOutlineThickness: 3 + - _MaxXUV: 1 + - _MaxYUV: 1 + - _MinXUV: 0 + - _MinYUV: 0 + - _MotionBlurAngle: 0.1 + - _MotionBlurDist: 1.25 + - _MyDstMode: 10 + - _MySrcMode: 5 + - _NegativeAmount: 1 + - _OffsetUvX: 0 + - _OffsetUvY: 0 + - _OnlyInnerOutline: 0 + - _OnlyOutline: 0 + - _Outline8Directions: 0 + - _OutlineAlpha: 1 + - _OutlineDistortAmount: 0.5 + - _OutlineDistortTexXSpeed: 5 + - _OutlineDistortTexYSpeed: 5 + - _OutlineDistortToggle: 0 + - _OutlineGlow: 1.5 + - _OutlineIsPixel: 0 + - _OutlinePixelWidth: 1 + - _OutlineTexGrey: 0 + - _OutlineTexToggle: 0 + - _OutlineTexXSpeed: 10 + - _OutlineTexYSpeed: 0 + - _OutlineWidth: 0.004 + - _OverlayBlend: 1 + - _OverlayGlow: 1 + - _OverlayTextureScrollXSpeed: 0.25 + - _OverlayTextureScrollYSpeed: 0.25 + - _PinchUvAmount: 0 + - _PixelateSize: 32 + - _PosterizeGamma: 0.75 + - _PosterizeNumColors: 8 + - _PosterizeOutline: 0 + - _RadialClip: 0 + - _RadialClip2: 45 + - _RadialClipAngle: 90 + - _RadialClipArc1: 45 + - _RadialClipArc2: 0 + - _RadialStartAngle: 90 + - _RandomSeed: 0 + - _RectSize: 1 + - _RotateUvAmount: 0 + - _RoundWaveSpeed: 2 + - _RoundWaveStrength: 0.7 + - _ShadowAlpha: 0.5 + - _ShadowX: 0.1 + - _ShadowY: -0.05 + - _ShakeUvSpeed: 2.5 + - _ShakeUvX: 1.5 + - _ShakeUvY: 1 + - _ShineGlow: 1 + - _ShineLocation: 0.5 + - _ShineRotate: 0 + - _ShineWidth: 0.1 + - _TextureScrollXSpeed: 1 + - _TextureScrollYSpeed: 0 + - _TwistUvAmount: 1.98 + - _TwistUvPosX: 0.5 + - _TwistUvPosY: 0.5 + - _TwistUvRadius: 0.75 + - _WarpScale: 0.5 + - _WarpSpeed: 8 + - _WarpStrength: 0.025 + - _WaveAmount: 7 + - _WaveSpeed: 10 + - _WaveStrength: 7.5 + - _WaveX: 0 + - _WaveY: 0.5 + - _ZTestMode: 4 + - _ZWrite: 0 + - _ZoomUvAmount: 0.5 + m_Colors: + - ColorSwapRed: {r: 1, g: 1, b: 1, a: 1} + - _AlphaOutlineColor: {r: 1, g: 1, b: 1, a: 1} + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _ColorChangeNewCol: {r: 1, g: 1, b: 0, a: 1} + - _ColorChangeNewCol2: {r: 1, g: 1, b: 0, a: 1} + - _ColorChangeNewCol3: {r: 1, g: 1, b: 0, a: 1} + - _ColorChangeTarget: {r: 1, g: 0, b: 0, a: 1} + - _ColorChangeTarget2: {r: 1, g: 0, b: 0, a: 1} + - _ColorChangeTarget3: {r: 1, g: 0, b: 0, a: 1} + - _ColorSwapBlue: {r: 1, g: 1, b: 1, a: 1} + - _ColorSwapGreen: {r: 1, g: 1, b: 1, a: 1} + - _ColorSwapRed: {r: 1, g: 1, b: 1, a: 1} + - _FadeBurnColor: {r: 1, g: 1, b: 0, a: 1} + - _GlowColor: {r: 1, g: 1, b: 1, a: 1} + - _GradBotLeftCol: {r: 0, g: 0, b: 0, a: 1} + - _GradBotRightCol: {r: 0, g: 0, b: 0, a: 1} + - _GradTopLeftCol: {r: 1, g: 1, b: 1, a: 1} + - _GradTopRightCol: {r: 1, g: 1, b: 1, a: 1} + - _GreyscaleTintColor: {r: 1, g: 1, b: 1, a: 1} + - _HitEffectColor: {r: 1, g: 1, b: 1, a: 1} + - _HologramStripeColor: {r: 0, g: 1, b: 1, a: 1} + - _InnerOutlineColor: {r: 0, g: 0, b: 0, a: 1} + - _OutlineColor: {r: 1, g: 1, b: 1, a: 1} + - _OverlayColor: {r: 1, g: 1, b: 1, a: 1} + - _ShadowColor: {r: 0, g: 0, b: 0, a: 1} + - _ShineColor: {r: 1, g: 1, b: 1, a: 1} +--- !u!1 &950130247 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 950130248} + - component: {fileID: 950130250} + m_Layer: 0 + m_Name: Grass + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &950130248 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 950130247} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 150, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 124794631} + - {fileID: 1023365940} + - {fileID: 798161390} + m_Father: {fileID: 1563905016} + m_RootOrder: 15 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &950130250 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 950130247} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 98b644315d7a92842b89e04f55c48e02, type: 3} + m_Name: + m_EditorClassIdentifier: +--- !u!21 &950928387 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: AllIn1SpriteShader/AllIn1SpriteShader + m_Shader: {fileID: 4800000, guid: a36b7719ff0465b42ab1407d67672c5f, type: 3} + m_ShaderKeywords: ETC1_EXTERNAL_ALPHA HITEFFECT_ON + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _ColorRampTex: + m_Texture: {fileID: 2800000, guid: 279657edc397ece4b8029c727adf6ddc, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ColorRampTexGradient: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ColorSwapTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DistortTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _FadeBurnTex: + m_Texture: {fileID: 2800000, guid: 32e8df0008bebe746b1681a71c61f31c, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _FadeTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _GlowTex: + 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} + - _OutlineDistortTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OutlineTex: + m_Texture: {fileID: 2800000, guid: 74087f6d03f233e4a8a142fa01f9e5cf, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OverlayTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ShineMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - _Alpha: 1 + - _AlphaCutoffValue: 0.25 + - _AlphaOutlineBlend: 1 + - _AlphaOutlineGlow: 5 + - _AlphaOutlineMinAlpha: 0 + - _AlphaOutlinePower: 1 + - _AlphaRoundThreshold: 0.5 + - _BillboardY: 0 + - _BlurHD: 0 + - _BlurIntensity: 10 + - _Brightness: 0 + - _ChromAberrAlpha: 0.4 + - _ChromAberrAmount: 1 + - _ClipUvDown: 1 + - _ClipUvLeft: 1 + - _ClipUvRight: 1 + - _ClipUvUp: 1 + - _ColorChangeLuminosity: 0 + - _ColorChangeTolerance: 0.25 + - _ColorChangeTolerance2: 0.25 + - _ColorChangeTolerance3: 0.25 + - _ColorRampBlend: 1 + - _ColorRampLuminosity: 0 + - _ColorRampOutline: 0 + - _ColorSwapBlend: 1 + - _ColorSwapBlueLuminosity: 0.5 + - _ColorSwapGreenLuminosity: 0.5 + - _ColorSwapRedLuminosity: 0.5 + - _Contrast: 1 + - _CullingOption: 0 + - _DistortAmount: 0.5 + - _DistortTexXSpeed: 5 + - _DistortTexYSpeed: 5 + - _EditorDrawers: 6 + - _FadeAmount: -0.1 + - _FadeBurnGlow: 2 + - _FadeBurnTransition: 0.075 + - _FadeBurnWidth: 0.025 + - _FishEyeUvAmount: 0.35 + - _FlickerAlpha: 0 + - _FlickerFreq: 0.2 + - _FlickerPercent: 0.05 + - _GhostBlend: 1 + - _GhostColorBoost: 1 + - _GhostTransparency: 0 + - _GlitchAmount: 3 + - _GlitchSize: 1 + - _Glow: 10 + - _GlowGlobal: 1 + - _GlowTexUsed: 0 + - _GradBlend: 1 + - _GradBoostX: 1.2 + - _GradBoostY: 1.2 + - _GradIsRadial: 0 + - _GrassManualAnim: 1 + - _GrassManualToggle: 0 + - _GrassRadialBend: 0.25 + - _GrassSpeed: 2 + - _GrassWind: 20 + - _GreyscaleBlend: 1 + - _GreyscaleLuminosity: 0 + - _GreyscaleOutline: 0 + - _HandDrawnAmount: 10 + - _HandDrawnSpeed: 5 + - _HitEffectBlend: 1 + - _HitEffectGlow: 10 + - _HologramBlend: 1 + - _HologramFlickerAlpha: 0 + - _HologramFlickerFreq: 0.2 + - _HologramFlickerPercent: 0.05 + - _HologramMaxAlpha: 1 + - _HologramMinAlpha: 0 + - _HologramStripesAlpha: 0.4 + - _HologramStripesAmount: 50 + - _HologramStripesFill: 0.4 + - _HologramStripesLuminosity: 1 + - _HologramStripesSpeed: 5 + - _HologramUnmodAmount: 0.4 + - _HsvBright: 1 + - _HsvSaturation: 1 + - _HsvShift: 180 + - _InnerOutlineAlpha: 1 + - _InnerOutlineGlow: 1 + - _InnerOutlineThickness: 1 + - _MaxXUV: 1 + - _MaxYUV: 1 + - _MinXUV: 0 + - _MinYUV: 0 + - _MotionBlurAngle: 0.1 + - _MotionBlurDist: 1.25 + - _MyDstMode: 10 + - _MySrcMode: 5 + - _NegativeAmount: 1 + - _OffsetUvX: 0 + - _OffsetUvY: 0 + - _OnlyInnerOutline: 0 + - _OnlyOutline: 0 + - _Outline8Directions: 0 + - _OutlineAlpha: 1 + - _OutlineDistortAmount: 0.5 + - _OutlineDistortTexXSpeed: 5 + - _OutlineDistortTexYSpeed: 5 + - _OutlineDistortToggle: 0 + - _OutlineGlow: 1.5 + - _OutlineIsPixel: 0 + - _OutlinePixelWidth: 1 + - _OutlineTexGrey: 0 + - _OutlineTexToggle: 0 + - _OutlineTexXSpeed: 10 + - _OutlineTexYSpeed: 0 + - _OutlineWidth: 0.004 + - _OverlayBlend: 1 + - _OverlayGlow: 1 + - _OverlayTextureScrollXSpeed: 0.25 + - _OverlayTextureScrollYSpeed: 0.25 + - _PinchUvAmount: 0.35 + - _PixelateSize: 32 + - _PosterizeGamma: 0.75 + - _PosterizeNumColors: 8 + - _PosterizeOutline: 0 + - _RadialClip: 0 + - _RadialClip2: 45 + - _RadialClipAngle: 90 + - _RadialClipArc1: 45 + - _RadialClipArc2: 0 + - _RadialStartAngle: 90 + - _RandomSeed: 0 + - _RectSize: 1 + - _RotateUvAmount: 0 + - _RoundWaveSpeed: 2 + - _RoundWaveStrength: 0.7 + - _ShadowAlpha: 0.5 + - _ShadowX: 0.1 + - _ShadowY: -0.05 + - _ShakeUvSpeed: 2.5 + - _ShakeUvX: 1.5 + - _ShakeUvY: 1 + - _ShineGlow: 1 + - _ShineLocation: 0.5 + - _ShineRotate: 0 + - _ShineWidth: 0.1 + - _TextureScrollXSpeed: 1 + - _TextureScrollYSpeed: 0 + - _TwistUvAmount: 1 + - _TwistUvPosX: 0.5 + - _TwistUvPosY: 0.5 + - _TwistUvRadius: 0.75 + - _WarpScale: 0.5 + - _WarpSpeed: 8 + - _WarpStrength: 0.025 + - _WaveAmount: 7 + - _WaveSpeed: 10 + - _WaveStrength: 7.5 + - _WaveX: 0 + - _WaveY: 0.5 + - _ZTestMode: 4 + - _ZWrite: 0 + - _ZoomUvAmount: 0.5 + m_Colors: + - ColorSwapRed: {r: 1, g: 1, b: 1, a: 1} + - _AlphaOutlineColor: {r: 1, g: 1, b: 1, a: 1} + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _ColorChangeNewCol: {r: 1, g: 1, b: 0, a: 1} + - _ColorChangeNewCol2: {r: 1, g: 1, b: 0, a: 1} + - _ColorChangeNewCol3: {r: 1, g: 1, b: 0, a: 1} + - _ColorChangeTarget: {r: 1, g: 0, b: 0, a: 1} + - _ColorChangeTarget2: {r: 1, g: 0, b: 0, a: 1} + - _ColorChangeTarget3: {r: 1, g: 0, b: 0, a: 1} + - _ColorSwapBlue: {r: 1, g: 1, b: 1, a: 1} + - _ColorSwapGreen: {r: 1, g: 1, b: 1, a: 1} + - _ColorSwapRed: {r: 1, g: 1, b: 1, a: 1} + - _FadeBurnColor: {r: 1, g: 1, b: 0, a: 1} + - _GlowColor: {r: 1, g: 1, b: 1, a: 1} + - _GradBotLeftCol: {r: 0, g: 0, b: 1, a: 1} + - _GradBotRightCol: {r: 0, g: 0, b: 1, a: 1} + - _GradTopLeftCol: {r: 1, g: 0, b: 0, a: 1} + - _GradTopRightCol: {r: 1, g: 0, b: 0, a: 1} + - _GreyscaleTintColor: {r: 1, g: 1, b: 1, a: 1} + - _HitEffectColor: {r: 1, g: 0.08018869, b: 0.08018869, a: 1} + - _HologramStripeColor: {r: 1, g: 1, b: 1, a: 1} + - _InnerOutlineColor: {r: 1, g: 0, b: 0, a: 1} + - _OutlineColor: {r: 1, g: 1, b: 1, a: 1} + - _OverlayColor: {r: 1, g: 1, b: 1, a: 1} + - _ShadowColor: {r: 0, g: 0, b: 0, a: 1} + - _ShineColor: {r: 1, g: 1, b: 1, a: 1} +--- !u!1 &972134370 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 972134371} + - component: {fileID: 972134374} + - component: {fileID: 972134373} + m_Layer: 0 + m_Name: Distortion + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &972134371 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 972134370} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 100, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 305999441} + - {fileID: 857099422} + m_Father: {fileID: 1351315063} + m_RootOrder: 10 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &972134373 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 972134370} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 98b644315d7a92842b89e04f55c48e02, type: 3} + m_Name: + m_EditorClassIdentifier: +--- !u!212 &972134374 +SpriteRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 972134370} + m_Enabled: 1 + m_CastShadows: 0 + m_ReceiveShadows: 0 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 1333622421} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 0 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_Sprite: {fileID: 21300000, guid: 519dafacd208bb64c83d5124be03b09d, type: 3} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_FlipX: 0 + m_FlipY: 0 + m_DrawMode: 0 + m_Size: {x: 5.12, y: 5.12} + m_AdaptiveModeThreshold: 0.5 + m_SpriteTileMode: 0 + m_WasSpriteAssigned: 1 + m_MaskInteraction: 0 + m_SpriteSortPoint: 0 +--- !u!1 &982048495 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 982048496} + - component: {fileID: 982048499} + - component: {fileID: 982048498} + m_Layer: 0 + m_Name: SuperSaiyan + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &982048496 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 982048495} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 310, y: 0, z: 0} + m_LocalScale: {x: 0.80276, y: 0.80276, z: 0.80276} + m_Children: + - {fileID: 831340858} + - {fileID: 1432462163} + - {fileID: 906963584} + m_Father: {fileID: 1563905016} + m_RootOrder: 31 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &982048498 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 982048495} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 98b644315d7a92842b89e04f55c48e02, type: 3} + m_Name: + m_EditorClassIdentifier: +--- !u!212 &982048499 +SpriteRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 982048495} + m_Enabled: 1 + m_CastShadows: 0 + m_ReceiveShadows: 0 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2023436102} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 0 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_Sprite: {fileID: 21300000, guid: 519dafacd208bb64c83d5124be03b09d, type: 3} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_FlipX: 0 + m_FlipY: 0 + m_DrawMode: 0 + m_Size: {x: 5.12, y: 5.12} + m_AdaptiveModeThreshold: 0.5 + m_SpriteTileMode: 0 + m_WasSpriteAssigned: 1 + m_MaskInteraction: 0 + m_SpriteSortPoint: 0 +--- !u!1 &984096427 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 984096428} + - component: {fileID: 984096430} + - component: {fileID: 984096431} + m_Layer: 0 + m_Name: Gradient + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &984096428 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 984096427} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 80, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 624559471} + - {fileID: 1418206287} + m_Father: {fileID: 2036092933} + m_RootOrder: 8 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!212 &984096430 +SpriteRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 984096427} + m_Enabled: 1 + m_CastShadows: 0 + m_ReceiveShadows: 0 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 111852238} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 0 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_Sprite: {fileID: 21300000, guid: 519dafacd208bb64c83d5124be03b09d, type: 3} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_FlipX: 0 + m_FlipY: 0 + m_DrawMode: 0 + m_Size: {x: 5.12, y: 5.12} + m_AdaptiveModeThreshold: 0.5 + m_SpriteTileMode: 0 + m_WasSpriteAssigned: 1 + m_MaskInteraction: 0 + m_SpriteSortPoint: 0 +--- !u!114 &984096431 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 984096427} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 98b644315d7a92842b89e04f55c48e02, type: 3} + m_Name: + m_EditorClassIdentifier: +--- !u!21 &984421900 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: AllIn1SpriteShader/AllIn1SpriteShader + m_Shader: {fileID: 4800000, guid: a36b7719ff0465b42ab1407d67672c5f, type: 3} + m_ShaderKeywords: ETC1_EXTERNAL_ALPHA ZOOMUV_ON + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _ColorRampTex: + m_Texture: {fileID: 2800000, guid: 279657edc397ece4b8029c727adf6ddc, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ColorRampTexGradient: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ColorSwapTex: + m_Texture: {fileID: 2800000, guid: 065da6c7b90ca904dab9cbc6b415fd19, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DistortTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _FadeBurnTex: + m_Texture: {fileID: 2800000, guid: 32e8df0008bebe746b1681a71c61f31c, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _FadeTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _GlowTex: + 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} + - _OutlineDistortTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OutlineTex: + m_Texture: {fileID: 2800000, guid: 74087f6d03f233e4a8a142fa01f9e5cf, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OverlayTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ShineMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - _Alpha: 1 + - _AlphaCutoffValue: 0.25 + - _AlphaOutlineBlend: 1 + - _AlphaOutlineGlow: 5 + - _AlphaOutlineMinAlpha: 0 + - _AlphaOutlinePower: 1 + - _AlphaRoundThreshold: 0.5 + - _BillboardY: 0 + - _BlurHD: 0 + - _BlurIntensity: 10 + - _Brightness: 0 + - _ChromAberrAlpha: 0.4 + - _ChromAberrAmount: 1 + - _ClipUvDown: 1 + - _ClipUvLeft: 1 + - _ClipUvRight: 1 + - _ClipUvUp: 1 + - _ColorChangeLuminosity: 0 + - _ColorChangeTolerance: 0.25 + - _ColorChangeTolerance2: 0.25 + - _ColorChangeTolerance3: 0.25 + - _ColorRampBlend: 1 + - _ColorRampLuminosity: 0 + - _ColorRampOutline: 0 + - _ColorSwapBlend: 1 + - _ColorSwapBlueLuminosity: 0.5 + - _ColorSwapGreenLuminosity: 0.09 + - _ColorSwapRedLuminosity: 0.604 + - _Contrast: 1 + - _CullingOption: 0 + - _DistortAmount: 0.5 + - _DistortTexXSpeed: 5 + - _DistortTexYSpeed: 5 + - _EditorDrawers: 6 + - _FadeAmount: -0.1 + - _FadeBurnGlow: 2 + - _FadeBurnTransition: 0.075 + - _FadeBurnWidth: 0.025 + - _FishEyeUvAmount: 0.35 + - _FlickerAlpha: 0 + - _FlickerFreq: 0.2 + - _FlickerPercent: 0.05 + - _GhostBlend: 1 + - _GhostColorBoost: 1 + - _GhostTransparency: 0 + - _GlitchAmount: 3 + - _GlitchSize: 1 + - _Glow: 10 + - _GlowGlobal: 1 + - _GlowTexUsed: 0 + - _GradBlend: 1 + - _GradBoostX: 1.2 + - _GradBoostY: 1.2 + - _GradIsRadial: 0 + - _GrassManualAnim: 1 + - _GrassManualToggle: 0 + - _GrassRadialBend: 0.25 + - _GrassSpeed: 2 + - _GrassWind: 20 + - _GreyscaleBlend: 1 + - _GreyscaleLuminosity: 0 + - _GreyscaleOutline: 0 + - _HandDrawnAmount: 10 + - _HandDrawnSpeed: 5 + - _HitEffectBlend: 1 + - _HitEffectGlow: 5 + - _HologramBlend: 1 + - _HologramFlickerAlpha: 0 + - _HologramFlickerFreq: 0.2 + - _HologramFlickerPercent: 0.05 + - _HologramMaxAlpha: 1 + - _HologramMinAlpha: 0 + - _HologramStripesAlpha: 0.4 + - _HologramStripesAmount: 50 + - _HologramStripesFill: 0.4 + - _HologramStripesLuminosity: 1 + - _HologramStripesSpeed: 5 + - _HologramUnmodAmount: 0.4 + - _HsvBright: 1 + - _HsvSaturation: 1 + - _HsvShift: 180 + - _InnerOutlineAlpha: 1 + - _InnerOutlineGlow: 1 + - _InnerOutlineThickness: 1 + - _MaxXUV: 1 + - _MaxYUV: 1 + - _MinXUV: 0 + - _MinYUV: 0 + - _MotionBlurAngle: 0.1 + - _MotionBlurDist: 1.25 + - _MyDstMode: 10 + - _MySrcMode: 5 + - _NegativeAmount: 1 + - _OffsetUvX: 0 + - _OffsetUvY: 0 + - _OnlyInnerOutline: 0 + - _OnlyOutline: 0 + - _Outline8Directions: 0 + - _OutlineAlpha: 1 + - _OutlineDistortAmount: 0.5 + - _OutlineDistortTexXSpeed: 5 + - _OutlineDistortTexYSpeed: 5 + - _OutlineDistortToggle: 0 + - _OutlineGlow: 1.5 + - _OutlineIsPixel: 0 + - _OutlinePixelWidth: 1 + - _OutlineTexGrey: 0 + - _OutlineTexToggle: 0 + - _OutlineTexXSpeed: 10 + - _OutlineTexYSpeed: 0 + - _OutlineWidth: 0.004 + - _OverlayBlend: 1 + - _OverlayGlow: 1 + - _OverlayTextureScrollXSpeed: 0.25 + - _OverlayTextureScrollYSpeed: 0.25 + - _PinchUvAmount: 0.35 + - _PixelateSize: 32 + - _PosterizeGamma: 0.75 + - _PosterizeNumColors: 8 + - _PosterizeOutline: 0 + - _RadialClip: 0 + - _RadialClip2: 45 + - _RadialClipAngle: 90 + - _RadialClipArc1: 45 + - _RadialClipArc2: 0 + - _RadialStartAngle: 90 + - _RandomSeed: 0 + - _RectSize: 1 + - _RotateUvAmount: 0 + - _RoundWaveSpeed: 2 + - _RoundWaveStrength: 0.7 + - _ShadowAlpha: 0.5 + - _ShadowX: 0.1 + - _ShadowY: -0.05 + - _ShakeUvSpeed: 2.5 + - _ShakeUvX: 1.5 + - _ShakeUvY: 1 + - _ShineGlow: 1 + - _ShineLocation: 0.5 + - _ShineRotate: 0 + - _ShineWidth: 0.1 + - _TextureScrollXSpeed: 1 + - _TextureScrollYSpeed: 0 + - _TwistUvAmount: 1 + - _TwistUvPosX: 0.5 + - _TwistUvPosY: 0.5 + - _TwistUvRadius: 0.75 + - _WarpScale: 0.5 + - _WarpSpeed: 8 + - _WarpStrength: 0.025 + - _WaveAmount: 7 + - _WaveSpeed: 10 + - _WaveStrength: 7.5 + - _WaveX: 0 + - _WaveY: 0.5 + - _ZTestMode: 4 + - _ZWrite: 0 + - _ZoomUvAmount: 0.5 + m_Colors: + - ColorSwapRed: {r: 1, g: 1, b: 1, a: 1} + - _AlphaOutlineColor: {r: 1, g: 1, b: 1, a: 1} + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _ColorChangeNewCol: {r: 1, g: 1, b: 0, a: 1} + - _ColorChangeNewCol2: {r: 1, g: 1, b: 0, a: 1} + - _ColorChangeNewCol3: {r: 1, g: 1, b: 0, a: 1} + - _ColorChangeTarget: {r: 1, g: 0, b: 0, a: 1} + - _ColorChangeTarget2: {r: 1, g: 0, b: 0, a: 1} + - _ColorChangeTarget3: {r: 1, g: 0, b: 0, a: 1} + - _ColorSwapBlue: {r: 1, g: 1, b: 1, a: 1} + - _ColorSwapGreen: {r: 1, g: 0, b: 0, a: 1} + - _ColorSwapRed: {r: 0, g: 0.5643088, b: 0.8396226, a: 1} + - _FadeBurnColor: {r: 1, g: 1, b: 0, a: 1} + - _GlowColor: {r: 1, g: 1, b: 1, a: 1} + - _GradBotLeftCol: {r: 0, g: 0, b: 1, a: 1} + - _GradBotRightCol: {r: 0, g: 0, b: 1, a: 1} + - _GradTopLeftCol: {r: 1, g: 0, b: 0, a: 1} + - _GradTopRightCol: {r: 1, g: 0, b: 0, a: 1} + - _GreyscaleTintColor: {r: 1, g: 1, b: 1, a: 1} + - _HitEffectColor: {r: 1, g: 1, b: 1, a: 1} + - _HologramStripeColor: {r: 1, g: 1, b: 1, a: 1} + - _InnerOutlineColor: {r: 1, g: 0, b: 0, a: 1} + - _OutlineColor: {r: 1, g: 1, b: 1, a: 1} + - _OverlayColor: {r: 1, g: 1, b: 1, a: 1} + - _ShadowColor: {r: 0, g: 0, b: 0, a: 1} + - _ShineColor: {r: 1, g: 1, b: 1, a: 1} +--- !u!1 &998349593 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 998349594} + - component: {fileID: 998349596} + - component: {fileID: 998349595} + m_Layer: 0 + m_Name: Title + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &998349594 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 998349593} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: -2.51, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 1358020792} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!102 &998349595 +TextMesh: + serializedVersion: 3 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 998349593} + m_Text: Warp + m_OffsetZ: -1.5 + m_CharacterSize: 0.075 + m_LineSpacing: 1 + m_Anchor: 4 + m_Alignment: 0 + m_TabSize: 4 + m_FontSize: 100 + m_FontStyle: 0 + m_RichText: 1 + m_Font: {fileID: 12800000, guid: a4e6a5491519adb45919dc87eff28e55, type: 3} + m_Color: + serializedVersion: 2 + rgba: 4294967295 +--- !u!23 &998349596 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 998349593} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 10100, guid: 0000000000000000e000000000000000, type: 0} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!21 &999359662 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: AllIn1SpriteShader/AllIn1SpriteShader + m_Shader: {fileID: 4800000, guid: a36b7719ff0465b42ab1407d67672c5f, type: 3} + m_ShaderKeywords: ETC1_EXTERNAL_ALPHA SHAKEUV_ON + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _ColorRampTex: + m_Texture: {fileID: 2800000, guid: 279657edc397ece4b8029c727adf6ddc, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ColorRampTexGradient: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ColorSwapTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DistortTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _FadeBurnTex: + m_Texture: {fileID: 2800000, guid: 32e8df0008bebe746b1681a71c61f31c, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _FadeTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _GlowTex: + 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} + - _OutlineDistortTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OutlineTex: + m_Texture: {fileID: 2800000, guid: 74087f6d03f233e4a8a142fa01f9e5cf, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OverlayTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ShineMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - _Alpha: 1 + - _AlphaCutoffValue: 0.25 + - _AlphaOutlineBlend: 1 + - _AlphaOutlineGlow: 5 + - _AlphaOutlineMinAlpha: 0 + - _AlphaOutlinePower: 1 + - _AlphaRoundThreshold: 0.5 + - _BillboardY: 0 + - _BlurHD: 0 + - _BlurIntensity: 10 + - _Brightness: 0 + - _ChromAberrAlpha: 0.4 + - _ChromAberrAmount: 1 + - _ClipUvDown: 1 + - _ClipUvLeft: 1 + - _ClipUvRight: 1 + - _ClipUvUp: 1 + - _ColorChangeLuminosity: 0 + - _ColorChangeTolerance: 0.25 + - _ColorChangeTolerance2: 0.25 + - _ColorChangeTolerance3: 0.25 + - _ColorRampBlend: 1 + - _ColorRampLuminosity: 0 + - _ColorRampOutline: 0 + - _ColorSwapBlend: 1 + - _ColorSwapBlueLuminosity: 0.5 + - _ColorSwapGreenLuminosity: 0.5 + - _ColorSwapRedLuminosity: 0.5 + - _Contrast: 1 + - _CullingOption: 0 + - _DistortAmount: 0.5 + - _DistortTexXSpeed: 5 + - _DistortTexYSpeed: 5 + - _EditorDrawers: 6 + - _FadeAmount: -0.1 + - _FadeBurnGlow: 2 + - _FadeBurnTransition: 0.075 + - _FadeBurnWidth: 0.025 + - _FishEyeUvAmount: 0.35 + - _FlickerAlpha: 0 + - _FlickerFreq: 0.2 + - _FlickerPercent: 0.05 + - _GhostBlend: 1 + - _GhostColorBoost: 1 + - _GhostTransparency: 0 + - _GlitchAmount: 3 + - _GlitchSize: 1 + - _Glow: 10 + - _GlowGlobal: 1 + - _GlowTexUsed: 0 + - _GradBlend: 1 + - _GradBoostX: 1.2 + - _GradBoostY: 1.2 + - _GradIsRadial: 0 + - _GrassManualAnim: 1 + - _GrassManualToggle: 0 + - _GrassRadialBend: 0.25 + - _GrassSpeed: 2 + - _GrassWind: 20 + - _GreyscaleBlend: 1 + - _GreyscaleLuminosity: 0 + - _GreyscaleOutline: 0 + - _HandDrawnAmount: 10 + - _HandDrawnSpeed: 5 + - _HitEffectBlend: 1 + - _HitEffectGlow: 5 + - _HologramBlend: 1 + - _HologramFlickerAlpha: 0 + - _HologramFlickerFreq: 0.2 + - _HologramFlickerPercent: 0.05 + - _HologramMaxAlpha: 1 + - _HologramMinAlpha: 0 + - _HologramStripesAlpha: 0.4 + - _HologramStripesAmount: 50 + - _HologramStripesFill: 0.4 + - _HologramStripesLuminosity: 1 + - _HologramStripesSpeed: 5 + - _HologramUnmodAmount: 0.4 + - _HsvBright: 1 + - _HsvSaturation: 1 + - _HsvShift: 180 + - _InnerOutlineAlpha: 1 + - _InnerOutlineGlow: 1 + - _InnerOutlineThickness: 1 + - _MaxXUV: 1 + - _MaxYUV: 1 + - _MinXUV: 0 + - _MinYUV: 0 + - _MotionBlurAngle: 0.1 + - _MotionBlurDist: 1.25 + - _MyDstMode: 10 + - _MySrcMode: 5 + - _NegativeAmount: 1 + - _OffsetUvX: 0 + - _OffsetUvY: 0 + - _OnlyInnerOutline: 0 + - _OnlyOutline: 0 + - _Outline8Directions: 0 + - _OutlineAlpha: 1 + - _OutlineDistortAmount: 0.5 + - _OutlineDistortTexXSpeed: 5 + - _OutlineDistortTexYSpeed: 5 + - _OutlineDistortToggle: 0 + - _OutlineGlow: 1.5 + - _OutlineIsPixel: 0 + - _OutlinePixelWidth: 1 + - _OutlineTexGrey: 0 + - _OutlineTexToggle: 0 + - _OutlineTexXSpeed: 10 + - _OutlineTexYSpeed: 0 + - _OutlineWidth: 0.004 + - _OverlayBlend: 1 + - _OverlayGlow: 1 + - _OverlayTextureScrollXSpeed: 0.25 + - _OverlayTextureScrollYSpeed: 0.25 + - _PinchUvAmount: 0.35 + - _PixelateSize: 32 + - _PosterizeGamma: 0.75 + - _PosterizeNumColors: 8 + - _PosterizeOutline: 0 + - _RadialClipAngle: 90 + - _RadialClipArc1: 45 + - _RadialClipArc2: 0 + - _RandomSeed: 0 + - _RectSize: 1 + - _RotateUvAmount: 0 + - _RoundWaveSpeed: 2 + - _RoundWaveStrength: 0.7 + - _ShadowAlpha: 0.5 + - _ShadowX: 0.1 + - _ShadowY: -0.05 + - _ShakeUvSpeed: 2.5 + - _ShakeUvX: 1.5 + - _ShakeUvY: 1 + - _ShineGlow: 1 + - _ShineLocation: 0.5 + - _ShineRotate: 0 + - _ShineWidth: 0.1 + - _TextureScrollXSpeed: 1 + - _TextureScrollYSpeed: 0 + - _TwistUvAmount: 1 + - _TwistUvPosX: 0.5 + - _TwistUvPosY: 0.5 + - _TwistUvRadius: 0.75 + - _WarpScale: 0.5 + - _WarpSpeed: 8 + - _WarpStrength: 0.025 + - _WaveAmount: 7 + - _WaveSpeed: 10 + - _WaveStrength: 7.5 + - _WaveX: 0 + - _WaveY: 0.5 + - _ZTestMode: 4 + - _ZWrite: 0 + - _ZoomUvAmount: 0.5 + m_Colors: + - ColorSwapRed: {r: 1, g: 1, b: 1, a: 1} + - _AlphaOutlineColor: {r: 1, g: 1, b: 1, a: 1} + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _ColorChangeNewCol: {r: 1, g: 1, b: 0, a: 1} + - _ColorChangeNewCol2: {r: 1, g: 1, b: 0, a: 1} + - _ColorChangeNewCol3: {r: 1, g: 1, b: 0, a: 1} + - _ColorChangeTarget: {r: 1, g: 0, b: 0, a: 1} + - _ColorChangeTarget2: {r: 1, g: 0, b: 0, a: 1} + - _ColorChangeTarget3: {r: 1, g: 0, b: 0, a: 1} + - _ColorSwapBlue: {r: 1, g: 1, b: 1, a: 1} + - _ColorSwapGreen: {r: 1, g: 1, b: 1, a: 1} + - _ColorSwapRed: {r: 1, g: 1, b: 1, a: 1} + - _FadeBurnColor: {r: 1, g: 1, b: 0, a: 1} + - _GlowColor: {r: 1, g: 1, b: 1, a: 1} + - _GradBotLeftCol: {r: 0, g: 0, b: 1, a: 1} + - _GradBotRightCol: {r: 0, g: 0, b: 1, a: 1} + - _GradTopLeftCol: {r: 1, g: 0, b: 0, a: 1} + - _GradTopRightCol: {r: 1, g: 0, b: 0, a: 1} + - _GreyscaleTintColor: {r: 1, g: 1, b: 1, a: 1} + - _HitEffectColor: {r: 1, g: 1, b: 1, a: 1} + - _HologramStripeColor: {r: 1, g: 1, b: 1, a: 1} + - _InnerOutlineColor: {r: 1, g: 0, b: 0, a: 1} + - _OutlineColor: {r: 1, g: 1, b: 1, a: 1} + - _OverlayColor: {r: 1, g: 1, b: 1, a: 1} + - _ShadowColor: {r: 0, g: 0, b: 0, a: 1} + - _ShineColor: {r: 1, g: 1, b: 1, a: 1} +--- !u!1 &999529076 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 999529080} + - component: {fileID: 999529079} + - component: {fileID: 999529077} + - component: {fileID: 999529081} + - component: {fileID: 999529078} + m_Layer: 4 + m_Name: Camera + m_TagString: MainCamera + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!114 &999529077 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 999529076} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: fcb2e887baa071545bad04c7b0e87cce, type: 3} + m_Name: + m_EditorClassIdentifier: + targetedItem: {fileID: 4825911116503289154} + demoController: {fileID: 732186309} + speed: 10 +--- !u!114 &999529078 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 999529076} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 8b9a305e18de0c04dbd257a21cd47087, type: 3} + m_Name: + m_EditorClassIdentifier: + sharedProfile: {fileID: 11400000, guid: c12f806a2a3ae954ebb1771c65441e4c, type: 2} + isGlobal: 1 + blendDistance: 0 + weight: 1 + priority: 0 +--- !u!20 &999529079 +Camera: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 999529076} + m_Enabled: 1 + serializedVersion: 2 + m_ClearFlags: 1 + m_BackGroundColor: {r: 0.19215687, g: 0.3019608, b: 0.4745098, a: 0} + m_projectionMatrixMode: 1 + m_GateFitMode: 2 + m_FOVAxisMode: 0 + m_SensorSize: {x: 36, y: 24} + m_LensShift: {x: 0, y: 0} + m_FocalLength: 50 + m_NormalizedViewPortRect: + serializedVersion: 2 + x: 0 + y: 0 + width: 1 + height: 1 + near clip plane: 0.3 + far clip plane: 1000 + field of view: 60 + orthographic: 0 + orthographic size: 5 + m_Depth: 0 + m_CullingMask: + serializedVersion: 2 + m_Bits: 4294967295 + m_RenderingPath: -1 + m_TargetTexture: {fileID: 0} + m_TargetDisplay: 0 + m_TargetEye: 3 + m_HDR: 1 + m_AllowMSAA: 1 + m_AllowDynamicResolution: 0 + m_ForceIntoRT: 1 + m_OcclusionCulling: 1 + m_StereoConvergence: 10 + m_StereoSeparation: 0.022 +--- !u!4 &999529080 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 999529076} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: -10} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &999529081 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 999529076} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 948f4100a11a5c24981795d21301da5c, type: 3} + m_Name: + m_EditorClassIdentifier: + volumeTrigger: {fileID: 999529080} + volumeLayer: + serializedVersion: 2 + m_Bits: 16 + stopNaNPropagation: 1 + finalBlitToCameraTarget: 0 + antialiasingMode: 0 + temporalAntialiasing: + jitterSpread: 0.75 + sharpness: 0.25 + stationaryBlending: 0.95 + motionBlending: 0.85 + subpixelMorphologicalAntialiasing: + quality: 2 + fastApproximateAntialiasing: + fastMode: 0 + keepAlpha: 0 + fog: + enabled: 1 + excludeSkybox: 1 + debugLayer: + lightMeter: + width: 512 + height: 256 + showCurves: 1 + histogram: + width: 512 + height: 256 + channel: 3 + waveform: + exposure: 0.12 + height: 256 + vectorscope: + size: 256 + exposure: 0.12 + overlaySettings: + linearDepth: 0 + motionColorIntensity: 4 + motionGridSize: 64 + colorBlindnessType: 0 + colorBlindnessStrength: 1 + m_Resources: {fileID: 11400000, guid: d82512f9c8e5d4a4d938b575d47f88d4, type: 2} + m_ShowToolkit: 0 + m_ShowCustomSorter: 0 + breakBeforeColorGrading: 0 + m_BeforeTransparentBundles: [] + m_BeforeStackBundles: [] + m_AfterStackBundles: [] +--- !u!1 &1005972826 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1005972827} + - component: {fileID: 1005972829} + - component: {fileID: 1005972828} + m_Layer: 5 + m_Name: ExpositorTitle + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &1005972827 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1005972826} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 535274222} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0.5, y: 0.5} + m_AnchorMax: {x: 0.5, y: 0.5} + m_AnchoredPosition: {x: 0, y: 9.384888} + m_SizeDelta: {x: 160, y: 121.23} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &1005972828 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1005972826} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 5f7201a12d95ffc409449d95f23cf332, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 0 + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_FontData: + m_Font: {fileID: 12800000, guid: d722354f9c8e9e643b5f30f00b5b20ea, type: 3} + m_FontSize: 123 + m_FontStyle: 0 + m_BestFit: 0 + m_MinSize: 10 + m_MaxSize: 123 + m_Alignment: 4 + m_AlignByGeometry: 0 + m_RichText: 1 + m_HorizontalOverflow: 1 + m_VerticalOverflow: 1 + m_LineSpacing: 1 + m_Text: Color Effects +--- !u!222 &1005972829 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1005972826} + m_CullTransparentMesh: 0 +--- !u!1 &1022452600 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1022452601} + - component: {fileID: 1022452603} + - component: {fileID: 1022452602} + m_Layer: 0 + m_Name: Title + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1022452601 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1022452600} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: -2.51, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 47460684} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!102 &1022452602 +TextMesh: + serializedVersion: 3 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1022452600} + m_Text: Colors + m_OffsetZ: -1.5 + m_CharacterSize: 0.075 + m_LineSpacing: 1 + m_Anchor: 4 + m_Alignment: 0 + m_TabSize: 4 + m_FontSize: 100 + m_FontStyle: 0 + m_RichText: 1 + m_Font: {fileID: 12800000, guid: a4e6a5491519adb45919dc87eff28e55, type: 3} + m_Color: + serializedVersion: 2 + rgba: 4294967295 +--- !u!23 &1022452603 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1022452600} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 10100, guid: 0000000000000000e000000000000000, type: 0} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!1 &1023365939 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1023365940} + - component: {fileID: 1023365942} + - component: {fileID: 1023365941} + m_Layer: 0 + m_Name: GrassSprite + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1023365940 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1023365939} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0.4, z: 0} + m_LocalScale: {x: 0.66693, y: 0.66693, z: 0.66693} + m_Children: [] + m_Father: {fileID: 950130248} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &1023365941 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1023365939} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: ee158225ee1e59f4791627785501d950, type: 3} + m_Name: + m_EditorClassIdentifier: + currentShaderType: 4 + normalStrength: 5 + normalSmoothing: 1 + computingNormal: 0 +--- !u!212 &1023365942 +SpriteRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1023365939} + m_Enabled: 1 + m_CastShadows: 0 + m_ReceiveShadows: 0 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 1820263336} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 0 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_Sprite: {fileID: 21300000, guid: cf7e1f6ebb800154db2b215cba9330ee, type: 3} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_FlipX: 0 + m_FlipY: 0 + m_DrawMode: 0 + m_Size: {x: 10.24, y: 3.06} + m_AdaptiveModeThreshold: 0.5 + m_SpriteTileMode: 0 + m_WasSpriteAssigned: 1 + m_MaskInteraction: 0 + m_SpriteSortPoint: 0 +--- !u!21 &1024727761 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: AllIn1SpriteShader/AllIn1SpriteShader + m_Shader: {fileID: 4800000, guid: a36b7719ff0465b42ab1407d67672c5f, type: 3} + m_ShaderKeywords: ETC1_EXTERNAL_ALPHA GLOW_ON GRADIENT_ON + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _ColorRampTex: + m_Texture: {fileID: 2800000, guid: 279657edc397ece4b8029c727adf6ddc, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ColorRampTexGradient: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ColorSwapTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DistortTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _FadeBurnTex: + m_Texture: {fileID: 2800000, guid: 32e8df0008bebe746b1681a71c61f31c, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _FadeTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _GlowTex: + 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} + - _OutlineDistortTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OutlineTex: + m_Texture: {fileID: 2800000, guid: 74087f6d03f233e4a8a142fa01f9e5cf, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OverlayTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ShineMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - _Alpha: 1 + - _AlphaCutoffValue: 0.25 + - _AlphaOutlineBlend: 1 + - _AlphaOutlineGlow: 5 + - _AlphaOutlineMinAlpha: 0 + - _AlphaOutlinePower: 1 + - _AlphaRoundThreshold: 0.5 + - _BillboardY: 0 + - _BlurHD: 0 + - _BlurIntensity: 10 + - _Brightness: 0 + - _ChromAberrAlpha: 0.4 + - _ChromAberrAmount: 1 + - _ClipUvDown: 1 + - _ClipUvLeft: 1 + - _ClipUvRight: 1 + - _ClipUvUp: 1 + - _ColorChangeLuminosity: 0 + - _ColorChangeTolerance: 0.25 + - _ColorChangeTolerance2: 0.25 + - _ColorChangeTolerance3: 0.25 + - _ColorRampBlend: 1 + - _ColorRampLuminosity: 0 + - _ColorRampOutline: 0 + - _ColorSwapBlend: 1 + - _ColorSwapBlueLuminosity: 0.5 + - _ColorSwapGreenLuminosity: 0.5 + - _ColorSwapRedLuminosity: 0.5 + - _Contrast: 1 + - _CullingOption: 0 + - _DistortAmount: 0.5 + - _DistortTexXSpeed: 5 + - _DistortTexYSpeed: 5 + - _EditorDrawers: 6 + - _FadeAmount: -0.1 + - _FadeBurnGlow: 2 + - _FadeBurnTransition: 0.075 + - _FadeBurnWidth: 0.025 + - _FishEyeUvAmount: 0.35 + - _FlickerAlpha: 0 + - _FlickerFreq: 0.2 + - _FlickerPercent: 0.05 + - _GhostBlend: 1 + - _GhostColorBoost: 1 + - _GhostTransparency: 0 + - _GlitchAmount: 3 + - _GlitchSize: 1 + - _Glow: 6.3 + - _GlowGlobal: 1 + - _GlowTexUsed: 0 + - _GradBlend: 1 + - _GradBoostX: 1.2 + - _GradBoostY: 1.2 + - _GradIsRadial: 0 + - _GrassManualAnim: 1 + - _GrassManualToggle: 0 + - _GrassRadialBend: 0.25 + - _GrassSpeed: 2 + - _GrassWind: 20 + - _GreyscaleBlend: 1 + - _GreyscaleLuminosity: 0 + - _GreyscaleOutline: 0 + - _HandDrawnAmount: 10 + - _HandDrawnSpeed: 5 + - _HitEffectBlend: 1 + - _HitEffectGlow: 5 + - _HologramBlend: 1 + - _HologramFlickerAlpha: 0 + - _HologramFlickerFreq: 0.2 + - _HologramFlickerPercent: 0.05 + - _HologramMaxAlpha: 1 + - _HologramMinAlpha: 0 + - _HologramStripesAlpha: 0.4 + - _HologramStripesAmount: 50 + - _HologramStripesFill: 0.4 + - _HologramStripesLuminosity: 1 + - _HologramStripesSpeed: 5 + - _HologramUnmodAmount: 0.4 + - _HsvBright: 1 + - _HsvSaturation: 1 + - _HsvShift: 180 + - _InnerOutlineAlpha: 1 + - _InnerOutlineGlow: 1 + - _InnerOutlineThickness: 1 + - _MaxXUV: 1 + - _MaxYUV: 1 + - _MinXUV: 0 + - _MinYUV: 0 + - _MotionBlurAngle: 0.1 + - _MotionBlurDist: 1.25 + - _MyDstMode: 10 + - _MySrcMode: 5 + - _NegativeAmount: 1 + - _OffsetUvX: 0 + - _OffsetUvY: 0 + - _OnlyInnerOutline: 0 + - _OnlyOutline: 0 + - _Outline8Directions: 0 + - _OutlineAlpha: 1 + - _OutlineDistortAmount: 0.5 + - _OutlineDistortTexXSpeed: 5 + - _OutlineDistortTexYSpeed: 5 + - _OutlineDistortToggle: 0 + - _OutlineGlow: 1.5 + - _OutlineIsPixel: 0 + - _OutlinePixelWidth: 1 + - _OutlineTexGrey: 0 + - _OutlineTexToggle: 0 + - _OutlineTexXSpeed: 10 + - _OutlineTexYSpeed: 0 + - _OutlineWidth: 0.004 + - _OverlayBlend: 1 + - _OverlayGlow: 1 + - _OverlayTextureScrollXSpeed: 0.25 + - _OverlayTextureScrollYSpeed: 0.25 + - _PinchUvAmount: 0.35 + - _PixelateSize: 32 + - _PosterizeGamma: 0.75 + - _PosterizeNumColors: 8 + - _PosterizeOutline: 0 + - _RadialClip: 45 + - _RadialClip2: 0 + - _RadialClipAngle: 90 + - _RadialClipArc1: 45 + - _RadialClipArc2: 0 + - _RadialStartAngle: 90 + - _RandomSeed: 0 + - _RectSize: 1 + - _RotateUvAmount: 0 + - _RoundWaveSpeed: 2 + - _RoundWaveStrength: 0.7 + - _ShadowAlpha: 0.5 + - _ShadowX: 0.1 + - _ShadowY: -0.05 + - _ShakeUvSpeed: 2.5 + - _ShakeUvX: 1.5 + - _ShakeUvY: 1 + - _ShineGlow: 1 + - _ShineLocation: 0.5 + - _ShineRotate: 0 + - _ShineWidth: 0.1 + - _TextureScrollXSpeed: 1 + - _TextureScrollYSpeed: 0 + - _TwistUvAmount: 1 + - _TwistUvPosX: 0.5 + - _TwistUvPosY: 0.5 + - _TwistUvRadius: 0.75 + - _WarpScale: 0.5 + - _WarpSpeed: 8 + - _WarpStrength: 0.025 + - _WaveAmount: 7 + - _WaveSpeed: 10 + - _WaveStrength: 7.5 + - _WaveX: 0 + - _WaveY: 0.5 + - _ZTestMode: 4 + - _ZWrite: 0 + - _ZoomUvAmount: 0.5 + m_Colors: + - ColorSwapRed: {r: 1, g: 1, b: 1, a: 1} + - _AlphaOutlineColor: {r: 1, g: 1, b: 1, a: 1} + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _ColorChangeNewCol: {r: 1, g: 1, b: 0, a: 1} + - _ColorChangeNewCol2: {r: 1, g: 1, b: 0, a: 1} + - _ColorChangeNewCol3: {r: 1, g: 1, b: 0, a: 1} + - _ColorChangeTarget: {r: 1, g: 0, b: 0, a: 1} + - _ColorChangeTarget2: {r: 1, g: 0, b: 0, a: 1} + - _ColorChangeTarget3: {r: 1, g: 0, b: 0, a: 1} + - _ColorSwapBlue: {r: 1, g: 1, b: 1, a: 1} + - _ColorSwapGreen: {r: 1, g: 1, b: 1, a: 1} + - _ColorSwapRed: {r: 1, g: 1, b: 1, a: 1} + - _FadeBurnColor: {r: 1, g: 1, b: 0, a: 1} + - _GlowColor: {r: 1, g: 1, b: 1, a: 1} + - _GradBotLeftCol: {r: 0.054901965, g: 0, b: 0.011764707, a: 1} + - _GradBotRightCol: {r: 0.05660379, g: 0, b: 0.013662981, a: 1} + - _GradTopLeftCol: {r: 1, g: 0, b: 0, a: 1} + - _GradTopRightCol: {r: 1, g: 0, b: 0, a: 1} + - _GreyscaleTintColor: {r: 1, g: 1, b: 1, a: 1} + - _HitEffectColor: {r: 1, g: 1, b: 1, a: 1} + - _HologramStripeColor: {r: 1, g: 1, b: 1, a: 1} + - _InnerOutlineColor: {r: 1, g: 0, b: 0, a: 1} + - _OutlineColor: {r: 1, g: 1, b: 1, a: 1} + - _OverlayColor: {r: 1, g: 1, b: 1, a: 1} + - _ShadowColor: {r: 0, g: 0, b: 0, a: 1} + - _ShineColor: {r: 1, g: 1, b: 1, a: 1} +--- !u!1 &1028271462 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1028271463} + - component: {fileID: 1028271465} + - component: {fileID: 1028271466} + m_Layer: 0 + m_Name: Pixelate + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1028271463 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1028271462} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 170, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 797006600} + - {fileID: 322195378} + m_Father: {fileID: 2036092933} + m_RootOrder: 17 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!212 &1028271465 +SpriteRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1028271462} + m_Enabled: 1 + m_CastShadows: 0 + m_ReceiveShadows: 0 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 1708657337} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 0 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_Sprite: {fileID: 21300000, guid: 519dafacd208bb64c83d5124be03b09d, type: 3} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_FlipX: 0 + m_FlipY: 0 + m_DrawMode: 0 + m_Size: {x: 5.12, y: 5.12} + m_AdaptiveModeThreshold: 0.5 + m_SpriteTileMode: 0 + m_WasSpriteAssigned: 1 + m_MaskInteraction: 0 + m_SpriteSortPoint: 0 +--- !u!114 &1028271466 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1028271462} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 98b644315d7a92842b89e04f55c48e02, type: 3} + m_Name: + m_EditorClassIdentifier: +--- !u!1 &1038353158 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1038353159} + - component: {fileID: 1038353162} + - component: {fileID: 1038353161} + - component: {fileID: 1038353163} + m_Layer: 0 + m_Name: Impact + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1038353159 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1038353158} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 70, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 1188655027} + - {fileID: 1282385917} + m_Father: {fileID: 1563905016} + m_RootOrder: 7 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &1038353161 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1038353158} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 98b644315d7a92842b89e04f55c48e02, type: 3} + m_Name: + m_EditorClassIdentifier: +--- !u!212 &1038353162 +SpriteRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1038353158} + m_Enabled: 1 + m_CastShadows: 0 + m_ReceiveShadows: 0 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 916295327} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 0 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_Sprite: {fileID: 21300000, guid: 519dafacd208bb64c83d5124be03b09d, type: 3} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_FlipX: 0 + m_FlipY: 0 + m_DrawMode: 0 + m_Size: {x: 5.12, y: 5.12} + m_AdaptiveModeThreshold: 0.5 + m_SpriteTileMode: 0 + m_WasSpriteAssigned: 1 + m_MaskInteraction: 0 + m_SpriteSortPoint: 0 +--- !u!95 &1038353163 +Animator: + serializedVersion: 3 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1038353158} + m_Enabled: 1 + m_Avatar: {fileID: 0} + m_Controller: {fileID: 9100000, guid: a1097444efe6cb54f86e2955982c0fe1, type: 2} + m_CullingMode: 0 + m_UpdateMode: 0 + m_ApplyRootMotion: 0 + m_LinearVelocityBlending: 0 + m_WarningMessage: + m_HasTransformHierarchy: 1 + m_AllowConstantClipSamplingOptimization: 1 + m_KeepAnimatorControllerStateOnDisable: 0 +--- !u!1 &1039947232 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1039947233} + - component: {fileID: 1039947235} + - component: {fileID: 1039947234} + m_Layer: 0 + m_Name: Animated + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 0 +--- !u!4 &1039947233 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1039947232} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: -3.57, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 786925991} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!102 &1039947234 +TextMesh: + serializedVersion: 3 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1039947232} + m_Text: (Has Animation) + m_OffsetZ: -1.5 + m_CharacterSize: 0.075 + m_LineSpacing: 1 + m_Anchor: 4 + m_Alignment: 0 + m_TabSize: 4 + m_FontSize: 100 + m_FontStyle: 0 + m_RichText: 1 + m_Font: {fileID: 12800000, guid: a4e6a5491519adb45919dc87eff28e55, type: 3} + m_Color: + serializedVersion: 2 + rgba: 4294967295 +--- !u!23 &1039947235 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1039947232} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: a4e6a5491519adb45919dc87eff28e55, type: 3} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!21 &1041891245 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: AllIn1SpriteShader/AllIn1SpriteShader + m_Shader: {fileID: 4800000, guid: a36b7719ff0465b42ab1407d67672c5f, type: 3} + m_ShaderKeywords: ETC1_EXTERNAL_ALPHA TWISTUV_ON + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _ColorRampTex: + m_Texture: {fileID: 2800000, guid: 279657edc397ece4b8029c727adf6ddc, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ColorRampTexGradient: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ColorSwapTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DistortTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _FadeBurnTex: + m_Texture: {fileID: 2800000, guid: 32e8df0008bebe746b1681a71c61f31c, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _FadeTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _GlowTex: + 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} + - _OutlineDistortTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OutlineTex: + m_Texture: {fileID: 2800000, guid: 74087f6d03f233e4a8a142fa01f9e5cf, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OverlayTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ShineMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - _Alpha: 1 + - _AlphaCutoffValue: 0.25 + - _AlphaOutlineBlend: 1 + - _AlphaOutlineGlow: 5 + - _AlphaOutlineMinAlpha: 0 + - _AlphaOutlinePower: 1 + - _AlphaRoundThreshold: 0.5 + - _BillboardY: 0 + - _BlurHD: 0 + - _BlurIntensity: 10 + - _Brightness: 0 + - _ChromAberrAlpha: 0.4 + - _ChromAberrAmount: 1 + - _ClipUvDown: 1 + - _ClipUvLeft: 1 + - _ClipUvRight: 1 + - _ClipUvUp: 1 + - _ColorChangeLuminosity: 0 + - _ColorChangeTolerance: 0.25 + - _ColorChangeTolerance2: 0.25 + - _ColorChangeTolerance3: 0.25 + - _ColorRampBlend: 1 + - _ColorRampLuminosity: 0 + - _ColorRampOutline: 0 + - _ColorSwapBlend: 1 + - _ColorSwapBlueLuminosity: 0.5 + - _ColorSwapGreenLuminosity: 0.5 + - _ColorSwapRedLuminosity: 0.5 + - _Contrast: 1 + - _CullingOption: 0 + - _DistortAmount: 0.5 + - _DistortTexXSpeed: 5 + - _DistortTexYSpeed: 5 + - _EditorDrawers: 6 + - _FadeAmount: -0.1 + - _FadeBurnGlow: 2 + - _FadeBurnTransition: 0.075 + - _FadeBurnWidth: 0.025 + - _FishEyeUvAmount: 0.35 + - _FlickerAlpha: 0 + - _FlickerFreq: 0.2 + - _FlickerPercent: 0.05 + - _GhostBlend: 1 + - _GhostColorBoost: 1 + - _GhostTransparency: 0 + - _GlitchAmount: 3 + - _GlitchSize: 1 + - _Glow: 10 + - _GlowGlobal: 1 + - _GlowTexUsed: 0 + - _GradBlend: 1 + - _GradBoostX: 1.2 + - _GradBoostY: 1.2 + - _GradIsRadial: 0 + - _GrassManualAnim: 1 + - _GrassManualToggle: 0 + - _GrassRadialBend: 0.25 + - _GrassSpeed: 2 + - _GrassWind: 20 + - _GreyscaleBlend: 1 + - _GreyscaleLuminosity: 0 + - _GreyscaleOutline: 0 + - _HandDrawnAmount: 10 + - _HandDrawnSpeed: 5 + - _HitEffectBlend: 1 + - _HitEffectGlow: 10 + - _HologramBlend: 1 + - _HologramFlickerAlpha: 0 + - _HologramFlickerFreq: 0.2 + - _HologramFlickerPercent: 0.05 + - _HologramMaxAlpha: 1 + - _HologramMinAlpha: 0 + - _HologramStripesAlpha: 0.4 + - _HologramStripesAmount: 50 + - _HologramStripesFill: 0.4 + - _HologramStripesLuminosity: 1 + - _HologramStripesSpeed: 5 + - _HologramUnmodAmount: 0.4 + - _HsvBright: 1 + - _HsvSaturation: 1 + - _HsvShift: 180 + - _InnerOutlineAlpha: 1 + - _InnerOutlineGlow: 1 + - _InnerOutlineThickness: 1 + - _MaxXUV: 1 + - _MaxYUV: 1 + - _MinXUV: 0 + - _MinYUV: 0 + - _MotionBlurAngle: 0.1 + - _MotionBlurDist: 1.25 + - _MyDstMode: 10 + - _MySrcMode: 5 + - _NegativeAmount: 1 + - _OffsetUvX: 0 + - _OffsetUvY: 0 + - _OnlyInnerOutline: 0 + - _OnlyOutline: 0 + - _Outline8Directions: 0 + - _OutlineAlpha: 1 + - _OutlineDistortAmount: 0.5 + - _OutlineDistortTexXSpeed: 5 + - _OutlineDistortTexYSpeed: 5 + - _OutlineDistortToggle: 0 + - _OutlineGlow: 1.5 + - _OutlineIsPixel: 0 + - _OutlinePixelWidth: 1 + - _OutlineTexGrey: 0 + - _OutlineTexToggle: 0 + - _OutlineTexXSpeed: 10 + - _OutlineTexYSpeed: 0 + - _OutlineWidth: 0.004 + - _OverlayBlend: 1 + - _OverlayGlow: 1 + - _OverlayTextureScrollXSpeed: 0.25 + - _OverlayTextureScrollYSpeed: 0.25 + - _PinchUvAmount: 0.35 + - _PixelateSize: 32 + - _PosterizeGamma: 0.75 + - _PosterizeNumColors: 8 + - _PosterizeOutline: 0 + - _RadialClip: 0 + - _RadialClip2: 45 + - _RadialClipAngle: 90 + - _RadialClipArc1: 45 + - _RadialClipArc2: 0 + - _RadialStartAngle: 90 + - _RandomSeed: 0 + - _RectSize: 1 + - _RotateUvAmount: 0 + - _RoundWaveSpeed: 2 + - _RoundWaveStrength: 0.7 + - _ShadowAlpha: 0.5 + - _ShadowX: 0.1 + - _ShadowY: -0.05 + - _ShakeUvSpeed: 2.5 + - _ShakeUvX: 1.5 + - _ShakeUvY: 1 + - _ShineGlow: 1 + - _ShineLocation: 0.5 + - _ShineRotate: 0 + - _ShineWidth: 0.1 + - _TextureScrollXSpeed: 1 + - _TextureScrollYSpeed: 0 + - _TwistUvAmount: 1 + - _TwistUvPosX: 0.5 + - _TwistUvPosY: 0.5 + - _TwistUvRadius: 0.75 + - _WarpScale: 0.5 + - _WarpSpeed: 8 + - _WarpStrength: 0.025 + - _WaveAmount: 7 + - _WaveSpeed: 10 + - _WaveStrength: 7.5 + - _WaveX: 0 + - _WaveY: 0.5 + - _ZTestMode: 4 + - _ZWrite: 0 + - _ZoomUvAmount: 0.5 + m_Colors: + - ColorSwapRed: {r: 1, g: 1, b: 1, a: 1} + - _AlphaOutlineColor: {r: 1, g: 1, b: 1, a: 1} + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _ColorChangeNewCol: {r: 1, g: 1, b: 0, a: 1} + - _ColorChangeNewCol2: {r: 1, g: 1, b: 0, a: 1} + - _ColorChangeNewCol3: {r: 1, g: 1, b: 0, a: 1} + - _ColorChangeTarget: {r: 1, g: 0, b: 0, a: 1} + - _ColorChangeTarget2: {r: 1, g: 0, b: 0, a: 1} + - _ColorChangeTarget3: {r: 1, g: 0, b: 0, a: 1} + - _ColorSwapBlue: {r: 1, g: 1, b: 1, a: 1} + - _ColorSwapGreen: {r: 1, g: 1, b: 1, a: 1} + - _ColorSwapRed: {r: 1, g: 1, b: 1, a: 1} + - _FadeBurnColor: {r: 1, g: 1, b: 0, a: 1} + - _GlowColor: {r: 1, g: 1, b: 1, a: 1} + - _GradBotLeftCol: {r: 0, g: 0, b: 1, a: 1} + - _GradBotRightCol: {r: 0, g: 0, b: 1, a: 1} + - _GradTopLeftCol: {r: 1, g: 0, b: 0, a: 1} + - _GradTopRightCol: {r: 1, g: 0, b: 0, a: 1} + - _GreyscaleTintColor: {r: 1, g: 1, b: 1, a: 1} + - _HitEffectColor: {r: 1, g: 0.08018869, b: 0.08018869, a: 1} + - _HologramStripeColor: {r: 1, g: 1, b: 1, a: 1} + - _InnerOutlineColor: {r: 1, g: 0, b: 0, a: 1} + - _OutlineColor: {r: 1, g: 1, b: 1, a: 1} + - _OverlayColor: {r: 1, g: 1, b: 1, a: 1} + - _ShadowColor: {r: 0, g: 0, b: 0, a: 1} + - _ShineColor: {r: 1, g: 1, b: 1, a: 1} +--- !u!21 &1045875747 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: AllIn1SpriteShader/AllIn1SpriteShader + m_Shader: {fileID: 4800000, guid: a36b7719ff0465b42ab1407d67672c5f, type: 3} + m_ShaderKeywords: COLORSWAP_ON ETC1_EXTERNAL_ALPHA GLOWTEX_ON INNEROUTLINE_ON OUTBASE8DIR_ON + OUTBASE_ON WAVEUV_ON _GLOWTEXUSED_ON _OUTLINE8DIRECTIONS_ON + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _ColorRampTex: + m_Texture: {fileID: 2800000, guid: 279657edc397ece4b8029c727adf6ddc, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ColorRampTexGradient: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ColorSwapTex: + m_Texture: {fileID: 2800000, guid: 065da6c7b90ca904dab9cbc6b415fd19, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DistortTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 0.1, y: 0.1} + m_Offset: {x: 0, y: 0} + - _FadeBurnTex: + m_Texture: {fileID: 2800000, guid: 677cca399782dea41aedc1d292ecb67d, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _FadeTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _GlowTex: + m_Texture: {fileID: 2800000, guid: 4abae6e7a5c534a4c8e95edf12a7d0c9, type: 3} + 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} + - _OutlineDistortTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OutlineTex: + m_Texture: {fileID: 2800000, guid: 74087f6d03f233e4a8a142fa01f9e5cf, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OverlayTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ShineMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - _Alpha: 1 + - _AlphaCutoffValue: 0.25 + - _AlphaOutlineBlend: 1 + - _AlphaOutlineGlow: 5 + - _AlphaOutlineMinAlpha: 0 + - _AlphaOutlinePower: 1 + - _AlphaRoundThreshold: 0.5 + - _BillboardY: 0 + - _BlurHD: 0 + - _BlurIntensity: 10 + - _Brightness: -0.01 + - _ChromAberrAlpha: 0.4 + - _ChromAberrAmount: 1 + - _ClipUvDown: 0 + - _ClipUvLeft: 0 + - _ClipUvRight: 0 + - _ClipUvUp: 0 + - _ColorChangeLuminosity: 0 + - _ColorChangeTolerance: 0.25 + - _ColorChangeTolerance2: 0.25 + - _ColorChangeTolerance3: 0.25 + - _ColorRampBlend: 1 + - _ColorRampLuminosity: 0 + - _ColorRampOutline: 0 + - _ColorSwapBlend: 1 + - _ColorSwapBlueLuminosity: 0.5 + - _ColorSwapGreenLuminosity: 0.28 + - _ColorSwapRedLuminosity: 0.5 + - _Contrast: 1.44 + - _CullingOption: 0 + - _DistortAmount: 0.2 + - _DistortTexXSpeed: 1 + - _DistortTexYSpeed: 1 + - _EditorDrawers: 6 + - _FadeAmount: -0.1 + - _FadeBurnGlow: 2 + - _FadeBurnTransition: 0.075 + - _FadeBurnWidth: 0.025 + - _FishEyeUvAmount: 0.35 + - _FlickerAlpha: 0 + - _FlickerFreq: 0.2 + - _FlickerPercent: 0.05 + - _GhostBlend: 1 + - _GhostColorBoost: 1 + - _GhostTransparency: 0 + - _GlitchAmount: 3 + - _GlitchSize: 1 + - _Glow: 0 + - _GlowGlobal: 1 + - _GlowTexUsed: 1 + - _GradBlend: 1 + - _GradBoostX: 1.2 + - _GradBoostY: 1.2 + - _GradIsRadial: 0 + - _GrassManualAnim: 1 + - _GrassManualToggle: 0 + - _GrassRadialBend: 0.25 + - _GrassSpeed: 2 + - _GrassWind: 20 + - _GreyscaleBlend: 1 + - _GreyscaleLuminosity: 0 + - _GreyscaleOutline: 0 + - _HandDrawnAmount: 10 + - _HandDrawnSpeed: 5 + - _HitEffectBlend: 1 + - _HitEffectGlow: 5 + - _HologramBlend: 1 + - _HologramMaxAlpha: 0.75 + - _HologramMinAlpha: 0.1 + - _HologramStripesAmount: 0.1 + - _HologramStripesSpeed: 4.5 + - _HologramUnmodAmount: 0 + - _HsvBright: 1 + - _HsvSaturation: 1 + - _HsvShift: 180 + - _InnerOutlineAlpha: 1 + - _InnerOutlineGlow: 6 + - _InnerOutlineThickness: 1.31 + - _MaxXUV: 1 + - _MaxYUV: 1 + - _MinXUV: 0 + - _MinYUV: 0 + - _MotionBlurAngle: 0.1 + - _MotionBlurDist: 1.25 + - _MyDstMode: 10 + - _MySrcMode: 5 + - _NegativeAmount: 1 + - _OffsetUvX: 0 + - _OffsetUvY: 0 + - _OnlyInnerOutline: 0 + - _OnlyOutline: 0 + - _Outline8Directions: 1 + - _OutlineAlpha: 1 + - _OutlineDistortAmount: 0.5 + - _OutlineDistortTexXSpeed: 5 + - _OutlineDistortTexYSpeed: 5 + - _OutlineDistortToggle: 0 + - _OutlineGlow: 5.1 + - _OutlineIsPixel: 0 + - _OutlinePixelWidth: 1 + - _OutlineTexGrey: 0 + - _OutlineTexToggle: 0 + - _OutlineTexXSpeed: 10 + - _OutlineTexYSpeed: 0 + - _OutlineWidth: 0.004 + - _OverlayBlend: 1 + - _OverlayGlow: 1 + - _OverlayTextureScrollXSpeed: 0.25 + - _OverlayTextureScrollYSpeed: 0.25 + - _PinchUvAmount: 0.096 + - _PixelateSize: 32 + - _PosterizeGamma: 0.75 + - _PosterizeNumColors: 8 + - _PosterizeOutline: 0 + - _RadialClip: 45 + - _RadialClip2: 0 + - _RadialClipAngle: 90 + - _RadialClipArc1: 45 + - _RadialClipArc2: 0 + - _RadialStartAngle: 90 + - _RandomSeed: 0 + - _RectSize: 1 + - _RotateUvAmount: 0 + - _RoundWaveSpeed: 0.38 + - _RoundWaveStrength: 0.063 + - _ShadowAlpha: 0.5 + - _ShadowX: 0.1 + - _ShadowY: -0.05 + - _ShakeUvSpeed: 2.5 + - _ShakeUvX: 1.5 + - _ShakeUvY: 1 + - _ShineGlow: 1 + - _ShineLocation: 0.5 + - _ShineRotate: 0 + - _ShineWidth: 0.1 + - _TextureScrollXSpeed: 1 + - _TextureScrollYSpeed: 0 + - _TwistUvAmount: 0.1 + - _TwistUvPosX: 0.5 + - _TwistUvPosY: 0.5 + - _TwistUvRadius: 0.75 + - _WarpScale: 0.5 + - _WarpSpeed: 8 + - _WarpStrength: 0.025 + - _WaveAmount: 7.8 + - _WaveSpeed: 9.4 + - _WaveStrength: 22.4 + - _WaveX: 0.5 + - _WaveY: 0.469 + - _ZTestMode: 4 + - _ZWrite: 0 + - _ZoomUvAmount: 0.92 + m_Colors: + - ColorSwapRed: {r: 1, g: 1, b: 1, a: 1} + - _AlphaOutlineColor: {r: 1, g: 1, b: 1, a: 1} + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _ColorChangeNewCol: {r: 1, g: 1, b: 0, a: 1} + - _ColorChangeNewCol2: {r: 1, g: 1, b: 0, a: 1} + - _ColorChangeNewCol3: {r: 1, g: 1, b: 0, a: 1} + - _ColorChangeTarget: {r: 1, g: 0, b: 0, a: 1} + - _ColorChangeTarget2: {r: 1, g: 0, b: 0, a: 1} + - _ColorChangeTarget3: {r: 1, g: 0, b: 0, a: 1} + - _ColorSwapBlue: {r: 0.6981132, g: 0.8099337, b: 1, a: 1} + - _ColorSwapGreen: {r: 0.98823535, g: 0.6392157, b: 0.6117647, a: 1} + - _ColorSwapRed: {r: 0.5176471, g: 0.63529414, b: 0.81568635, a: 1} + - _FadeBurnColor: {r: 1, g: 1, b: 0, a: 1} + - _GlowColor: {r: 0.98823535, g: 0.6392157, b: 0.6117647, a: 1} + - _GradBotLeftCol: {r: 0, g: 0, b: 1, a: 1} + - _GradBotRightCol: {r: 0, g: 0, b: 1, a: 1} + - _GradTopLeftCol: {r: 1, g: 0, b: 0, a: 1} + - _GradTopRightCol: {r: 1, g: 0, b: 0, a: 1} + - _GreyscaleTintColor: {r: 1, g: 1, b: 1, a: 1} + - _HitEffectColor: {r: 1, g: 1, b: 1, a: 1} + - _HologramStripeColor: {r: 0, g: 1, b: 1, a: 1} + - _InnerOutlineColor: {r: 0.9811321, g: 0.29619083, b: 0.7939467, a: 1} + - _OutlineColor: {r: 0.5896226, g: 0.1792453, b: 1, a: 1} + - _OverlayColor: {r: 1, g: 1, b: 1, a: 1} + - _ShadowColor: {r: 0, g: 0, b: 0, a: 1} + - _ShineColor: {r: 1, g: 1, b: 1, a: 1} +--- !u!1 &1050471975 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1050471976} + - component: {fileID: 1050471980} + - component: {fileID: 1050471979} + - component: {fileID: 1050471977} + m_Layer: 0 + m_Name: Fill Amount + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1050471976 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1050471975} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 60, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 913568439} + - {fileID: 367923811} + m_Father: {fileID: 1351315063} + m_RootOrder: 6 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!95 &1050471977 +Animator: + serializedVersion: 3 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1050471975} + m_Enabled: 1 + m_Avatar: {fileID: 0} + m_Controller: {fileID: 9100000, guid: 6078cf4809fc6174f90700135dcf328f, type: 2} + m_CullingMode: 0 + m_UpdateMode: 0 + m_ApplyRootMotion: 0 + m_LinearVelocityBlending: 0 + m_WarningMessage: + m_HasTransformHierarchy: 1 + m_AllowConstantClipSamplingOptimization: 1 + m_KeepAnimatorControllerStateOnDisable: 0 +--- !u!114 &1050471979 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1050471975} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 98b644315d7a92842b89e04f55c48e02, type: 3} + m_Name: + m_EditorClassIdentifier: +--- !u!212 &1050471980 +SpriteRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1050471975} + m_Enabled: 1 + m_CastShadows: 0 + m_ReceiveShadows: 0 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 323921624} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 0 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_Sprite: {fileID: 21300000, guid: 519dafacd208bb64c83d5124be03b09d, type: 3} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_FlipX: 0 + m_FlipY: 0 + m_DrawMode: 0 + m_Size: {x: 5.12, y: 5.12} + m_AdaptiveModeThreshold: 0.5 + m_SpriteTileMode: 0 + m_WasSpriteAssigned: 1 + m_MaskInteraction: 0 + m_SpriteSortPoint: 0 +--- !u!21 &1065071623 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: AllIn1SpriteShader/AllIn1SpriteShader + m_Shader: {fileID: 4800000, guid: a36b7719ff0465b42ab1407d67672c5f, type: 3} + m_ShaderKeywords: BLUR_ON COLORRAMP_ON ETC1_EXTERNAL_ALPHA GLOW_ON NEGATIVE_ON + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _ColorRampTex: + m_Texture: {fileID: 2800000, guid: 763e13699209a614b8800c76fc9dee48, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ColorRampTexGradient: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ColorSwapTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DistortTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _FadeBurnTex: + m_Texture: {fileID: 2800000, guid: 32e8df0008bebe746b1681a71c61f31c, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _FadeTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _GlowTex: + 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} + - _OutlineDistortTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OutlineTex: + m_Texture: {fileID: 2800000, guid: 74087f6d03f233e4a8a142fa01f9e5cf, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OverlayTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ShineMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - _Alpha: 1 + - _AlphaCutoffValue: 0.25 + - _AlphaOutlineBlend: 1 + - _AlphaOutlineGlow: 5 + - _AlphaOutlineMinAlpha: 0 + - _AlphaOutlinePower: 1 + - _AlphaRoundThreshold: 0.5 + - _BillboardY: 0 + - _BlurHD: 0 + - _BlurIntensity: 10 + - _Brightness: 0 + - _ChromAberrAlpha: 0.4 + - _ChromAberrAmount: 1 + - _ClipUvDown: 1 + - _ClipUvLeft: 1 + - _ClipUvRight: 1 + - _ClipUvUp: 1 + - _ColorChangeLuminosity: 0 + - _ColorChangeTolerance: 0.25 + - _ColorChangeTolerance2: 0.25 + - _ColorChangeTolerance3: 0.25 + - _ColorRampBlend: 1 + - _ColorRampLuminosity: -0.238 + - _ColorRampOutline: 0 + - _ColorSwapBlend: 1 + - _ColorSwapBlueLuminosity: 0.5 + - _ColorSwapGreenLuminosity: 0.5 + - _ColorSwapRedLuminosity: 0.5 + - _Contrast: 1 + - _CullingOption: 0 + - _DistortAmount: 0.5 + - _DistortTexXSpeed: 5 + - _DistortTexYSpeed: 5 + - _EditorDrawers: 6 + - _FadeAmount: -0.1 + - _FadeBurnGlow: 2 + - _FadeBurnTransition: 0.075 + - _FadeBurnWidth: 0.025 + - _FishEyeUvAmount: 0.35 + - _FlickerAlpha: 0 + - _FlickerFreq: 0.2 + - _FlickerPercent: 0.05 + - _GhostBlend: 1 + - _GhostColorBoost: 1 + - _GhostTransparency: 0 + - _GlitchAmount: 3 + - _GlitchSize: 1 + - _Glow: 0.5 + - _GlowGlobal: 1 + - _GlowTexUsed: 0 + - _GradBlend: 1 + - _GradBoostX: 1.2 + - _GradBoostY: 1.2 + - _GradIsRadial: 0 + - _GrassManualAnim: 1 + - _GrassManualToggle: 0 + - _GrassRadialBend: 0.1 + - _GrassSpeed: 2 + - _GrassWind: 20 + - _GreyscaleBlend: 1 + - _GreyscaleLuminosity: 0 + - _GreyscaleOutline: 0 + - _HandDrawnAmount: 10 + - _HandDrawnSpeed: 5 + - _HitEffectBlend: 1 + - _HitEffectGlow: 5 + - _HologramBlend: 1 + - _HologramFlickerAlpha: 0 + - _HologramFlickerFreq: 0.2 + - _HologramMaxAlpha: 1 + - _HologramMinAlpha: 0 + - _HologramStripesAlpha: 0.4 + - _HologramStripesAmount: 50 + - _HologramStripesFill: 0.4 + - _HologramStripesLuminosity: 1 + - _HologramStripesSpeed: 5 + - _HologramUnmodAmount: 0.4 + - _HsvBright: 1 + - _HsvSaturation: 1 + - _HsvShift: 180 + - _InnerOutlineAlpha: 1 + - _InnerOutlineGlow: 1 + - _InnerOutlineThickness: 1 + - _MaxXUV: 1 + - _MaxYUV: 1 + - _MinXUV: 0 + - _MinYUV: 0 + - _MotionBlurAngle: 0.1 + - _MotionBlurDist: 1.25 + - _MyDstMode: 10 + - _MySrcMode: 5 + - _NegativeAmount: 1 + - _OffsetUvX: 0 + - _OffsetUvY: 0 + - _OnlyInnerOutline: 0 + - _OnlyOutline: 0 + - _Outline8Directions: 0 + - _OutlineAlpha: 1 + - _OutlineDistortAmount: 0.5 + - _OutlineDistortTexXSpeed: 5 + - _OutlineDistortTexYSpeed: 5 + - _OutlineDistortToggle: 0 + - _OutlineGlow: 1.5 + - _OutlineIsPixel: 0 + - _OutlinePixelWidth: 1 + - _OutlineTexGrey: 0 + - _OutlineTexToggle: 0 + - _OutlineTexXSpeed: 10 + - _OutlineTexYSpeed: 0 + - _OutlineWidth: 0.004 + - _OverlayBlend: 1 + - _OverlayGlow: 1 + - _OverlayTextureScrollXSpeed: 0.25 + - _OverlayTextureScrollYSpeed: 0.25 + - _PinchUvAmount: 0.35 + - _PixelateSize: 32 + - _PosterizeGamma: 0.75 + - _PosterizeNumColors: 8 + - _PosterizeOutline: 0 + - _RadialClipAngle: 90 + - _RadialClipArc1: 45 + - _RadialClipArc2: 0 + - _RandomSeed: 0 + - _RectSize: 1 + - _RotateUvAmount: 0 + - _RoundWaveSpeed: 2 + - _RoundWaveStrength: 0.7 + - _ShadowAlpha: 0.5 + - _ShadowX: 0.1 + - _ShadowY: -0.05 + - _ShakeUvSpeed: 2.5 + - _ShakeUvX: 1.5 + - _ShakeUvY: 1 + - _ShineGlow: 1 + - _ShineLocation: 0.5 + - _ShineRotate: 0 + - _ShineWidth: 0.1 + - _TextureScrollXSpeed: 1 + - _TextureScrollYSpeed: 0 + - _TwistUvAmount: 1 + - _TwistUvPosX: 0.5 + - _TwistUvPosY: 0.5 + - _TwistUvRadius: 0.75 + - _WarpScale: 0.5 + - _WarpSpeed: 8 + - _WarpStrength: 0.025 + - _WaveAmount: 7 + - _WaveSpeed: 10 + - _WaveStrength: 7.5 + - _WaveX: 0 + - _WaveY: 0.5 + - _ZTestMode: 4 + - _ZWrite: 0 + - _ZoomUvAmount: 0.5 + m_Colors: + - ColorSwapRed: {r: 1, g: 1, b: 1, a: 1} + - _AlphaOutlineColor: {r: 1, g: 1, b: 1, a: 1} + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _ColorChangeNewCol: {r: 1, g: 1, b: 0, a: 1} + - _ColorChangeNewCol2: {r: 1, g: 1, b: 0, a: 1} + - _ColorChangeNewCol3: {r: 1, g: 1, b: 0, a: 1} + - _ColorChangeTarget: {r: 1, g: 0, b: 0, a: 1} + - _ColorChangeTarget2: {r: 1, g: 0, b: 0, a: 1} + - _ColorChangeTarget3: {r: 1, g: 0, b: 0, a: 1} + - _ColorSwapBlue: {r: 1, g: 1, b: 1, a: 1} + - _ColorSwapGreen: {r: 1, g: 1, b: 1, a: 1} + - _ColorSwapRed: {r: 1, g: 1, b: 1, a: 1} + - _FadeBurnColor: {r: 1, g: 1, b: 0, a: 1} + - _GlowColor: {r: 1, g: 1, b: 1, a: 1} + - _GradBotLeftCol: {r: 0, g: 0, b: 1, a: 1} + - _GradBotRightCol: {r: 0, g: 0, b: 1, a: 1} + - _GradTopLeftCol: {r: 1, g: 0, b: 0, a: 1} + - _GradTopRightCol: {r: 1, g: 0, b: 0, a: 1} + - _GreyscaleTintColor: {r: 1, g: 1, b: 1, a: 1} + - _HitEffectColor: {r: 1, g: 1, b: 1, a: 1} + - _HologramStripeColor: {r: 1, g: 1, b: 1, a: 1} + - _InnerOutlineColor: {r: 1, g: 0, b: 0, a: 1} + - _OutlineColor: {r: 1, g: 1, b: 1, a: 1} + - _OverlayColor: {r: 1, g: 1, b: 1, a: 1} + - _ShadowColor: {r: 0, g: 0, b: 0, a: 1} + - _ShineColor: {r: 1, g: 1, b: 1, a: 1} +--- !u!1 &1071386687 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1071386688} + - component: {fileID: 1071386690} + - component: {fileID: 1071386689} + m_Layer: 0 + m_Name: Title + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1071386688 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1071386687} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: -3.1267126, z: 0} + m_LocalScale: {x: 1.2457023, y: 1.2457023, z: 1.2457023} + m_Children: [] + m_Father: {fileID: 1227823621} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!102 &1071386689 +TextMesh: + serializedVersion: 3 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1071386687} + m_Text: Shake + m_OffsetZ: -1.5 + m_CharacterSize: 0.075 + m_LineSpacing: 1 + m_Anchor: 4 + m_Alignment: 0 + m_TabSize: 4 + m_FontSize: 100 + m_FontStyle: 0 + m_RichText: 1 + m_Font: {fileID: 12800000, guid: a4e6a5491519adb45919dc87eff28e55, type: 3} + m_Color: + serializedVersion: 2 + rgba: 4294967295 +--- !u!23 &1071386690 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1071386687} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 10100, guid: 0000000000000000e000000000000000, type: 0} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!1 &1073566155 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1073566156} + - component: {fileID: 1073566159} + - component: {fileID: 1073566158} + m_Layer: 0 + m_Name: Contrast + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1073566156 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1073566155} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 290, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 1462418353} + - {fileID: 1267243997} + m_Father: {fileID: 2036092933} + m_RootOrder: 29 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &1073566158 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1073566155} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 98b644315d7a92842b89e04f55c48e02, type: 3} + m_Name: + m_EditorClassIdentifier: +--- !u!212 &1073566159 +SpriteRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1073566155} + m_Enabled: 1 + m_CastShadows: 0 + m_ReceiveShadows: 0 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 1693197524} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 0 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_Sprite: {fileID: 21300000, guid: 519dafacd208bb64c83d5124be03b09d, type: 3} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_FlipX: 0 + m_FlipY: 0 + m_DrawMode: 0 + m_Size: {x: 5.12, y: 5.12} + m_AdaptiveModeThreshold: 0.5 + m_SpriteTileMode: 0 + m_WasSpriteAssigned: 1 + m_MaskInteraction: 0 + m_SpriteSortPoint: 0 +--- !u!4 &1073973762 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1073973763} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 50, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 1850969167} + - {fileID: 510732448} + m_Father: {fileID: 2036092933} + m_RootOrder: 5 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &1073973763 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1073973762} + - component: {fileID: 1073973765} + - component: {fileID: 1073973766} + m_Layer: 0 + m_Name: Outline3 + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!212 &1073973765 +SpriteRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1073973763} + m_Enabled: 1 + m_CastShadows: 0 + m_ReceiveShadows: 0 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 1129192189} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 0 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_Sprite: {fileID: 21300000, guid: 519dafacd208bb64c83d5124be03b09d, type: 3} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_FlipX: 0 + m_FlipY: 0 + m_DrawMode: 0 + m_Size: {x: 5.12, y: 5.12} + m_AdaptiveModeThreshold: 0.5 + m_SpriteTileMode: 0 + m_WasSpriteAssigned: 1 + m_MaskInteraction: 0 + m_SpriteSortPoint: 0 +--- !u!114 &1073973766 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1073973763} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 98b644315d7a92842b89e04f55c48e02, type: 3} + m_Name: + m_EditorClassIdentifier: +--- !u!21 &1078024312 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: AllIn1SpriteShader/AllIn1SpriteShader + m_Shader: {fileID: 4800000, guid: a36b7719ff0465b42ab1407d67672c5f, type: 3} + m_ShaderKeywords: ETC1_EXTERNAL_ALPHA INNEROUTLINE_ON ONLYINNEROUTLINE_ON OUTBASE8DIR_ON + OUTBASE_ON SHADOW_ON _ONLYINNEROUTLINE_ON _OUTLINE8DIRECTIONS_ON + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _ColorRampTex: + m_Texture: {fileID: 2800000, guid: 279657edc397ece4b8029c727adf6ddc, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ColorRampTexGradient: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ColorSwapTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DistortTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _FadeBurnTex: + m_Texture: {fileID: 2800000, guid: 677cca399782dea41aedc1d292ecb67d, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _FadeTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _GlowTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MainTex: + m_Texture: {fileID: 2800000, guid: 519dafacd208bb64c83d5124be03b09d, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OutlineDistortTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OutlineTex: + m_Texture: {fileID: 2800000, guid: 74087f6d03f233e4a8a142fa01f9e5cf, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OverlayTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ShineMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - _Alpha: 1 + - _AlphaCutoffValue: 0.25 + - _AlphaOutlineBlend: 1 + - _AlphaOutlineGlow: 5 + - _AlphaOutlineMinAlpha: 0 + - _AlphaOutlinePower: 1 + - _AlphaRoundThreshold: 0.5 + - _BillboardY: 0 + - _BlurHD: 0 + - _BlurIntensity: 10 + - _Brightness: 0 + - _ChromAberrAlpha: 0.4 + - _ChromAberrAmount: 1 + - _ClipUvDown: 0 + - _ClipUvLeft: 0 + - _ClipUvRight: 0 + - _ClipUvUp: 0 + - _ColorChangeLuminosity: 0 + - _ColorChangeTolerance: 0.25 + - _ColorChangeTolerance2: 0.25 + - _ColorChangeTolerance3: 0.25 + - _ColorRampBlend: 1 + - _ColorRampLuminosity: 0 + - _ColorRampOutline: 0 + - _ColorSwapBlend: 1 + - _ColorSwapBlueLuminosity: 0.5 + - _ColorSwapGreenLuminosity: 0.5 + - _ColorSwapRedLuminosity: 0.5 + - _Contrast: 1 + - _CullingOption: 0 + - _DistortAmount: 0.5 + - _DistortTexXSpeed: 5 + - _DistortTexYSpeed: 5 + - _EditorDrawers: 6 + - _FadeAmount: -0.1 + - _FadeBurnGlow: 2 + - _FadeBurnTransition: 0.075 + - _FadeBurnWidth: 0.025 + - _FishEyeUvAmount: 0.35 + - _FlickerAlpha: 0 + - _FlickerFreq: 0.2 + - _FlickerPercent: 0.05 + - _GhostBlend: 1 + - _GhostColorBoost: 1 + - _GhostTransparency: 0 + - _GlitchAmount: 3 + - _GlitchSize: 1 + - _Glow: 10 + - _GlowGlobal: 1 + - _GlowTexUsed: 0 + - _GradBlend: 1 + - _GradBoostX: 1.2 + - _GradBoostY: 1.2 + - _GradIsRadial: 0 + - _GrassManualAnim: 1 + - _GrassManualToggle: 0 + - _GrassRadialBend: 0.25 + - _GrassSpeed: 2 + - _GrassWind: 20 + - _GreyscaleBlend: 1 + - _GreyscaleLuminosity: 0 + - _GreyscaleOutline: 0 + - _HandDrawnAmount: 10 + - _HandDrawnSpeed: 5 + - _HitEffectBlend: 1 + - _HitEffectGlow: 5 + - _HologramBlend: 1 + - _HologramMaxAlpha: 0.75 + - _HologramMinAlpha: 0.1 + - _HologramStripesAmount: 0.1 + - _HologramStripesSpeed: 4.5 + - _HologramUnmodAmount: 0 + - _HsvBright: 1 + - _HsvSaturation: 1 + - _HsvShift: 180 + - _InnerOutlineAlpha: 1 + - _InnerOutlineGlow: 5 + - _InnerOutlineThickness: 1.6 + - _MaxXUV: 1 + - _MaxYUV: 1 + - _MinXUV: 0 + - _MinYUV: 0 + - _MotionBlurAngle: 0.1 + - _MotionBlurDist: 1.25 + - _MyDstMode: 10 + - _MySrcMode: 5 + - _NegativeAmount: 1 + - _OffsetUvX: 0 + - _OffsetUvY: 0 + - _OnlyInnerOutline: 1 + - _OnlyOutline: 0 + - _Outline8Directions: 1 + - _OutlineAlpha: 1 + - _OutlineDistortAmount: 0.5 + - _OutlineDistortTexXSpeed: 5 + - _OutlineDistortTexYSpeed: 5 + - _OutlineDistortToggle: 0 + - _OutlineGlow: 6.3 + - _OutlineIsPixel: 0 + - _OutlinePixelWidth: 1 + - _OutlineTexGrey: 0 + - _OutlineTexToggle: 0 + - _OutlineTexXSpeed: 10 + - _OutlineTexYSpeed: 0 + - _OutlineWidth: 0.01 + - _OverlayBlend: 1 + - _OverlayGlow: 1 + - _OverlayTextureScrollXSpeed: 0.25 + - _OverlayTextureScrollYSpeed: 0.25 + - _PinchUvAmount: 0.35 + - _PixelateSize: 32 + - _PosterizeGamma: 0.75 + - _PosterizeNumColors: 8 + - _PosterizeOutline: 0 + - _RadialClipAngle: 90 + - _RadialClipArc1: 45 + - _RadialClipArc2: 0 + - _RandomSeed: 0 + - _RectSize: 1 + - _RotateUvAmount: 0 + - _RoundWaveSpeed: 2 + - _RoundWaveStrength: 0.7 + - _ShadowAlpha: 1 + - _ShadowX: 0 + - _ShadowY: 0 + - _ShakeUvSpeed: 2.5 + - _ShakeUvX: 1.5 + - _ShakeUvY: 1 + - _ShineGlow: 1 + - _ShineLocation: 0.5 + - _ShineRotate: 0 + - _ShineWidth: 0.1 + - _TextureScrollXSpeed: 1 + - _TextureScrollYSpeed: 0 + - _TwistUvAmount: 1 + - _TwistUvPosX: 0.5 + - _TwistUvPosY: 0.5 + - _TwistUvRadius: 0.75 + - _WarpScale: 0.5 + - _WarpSpeed: 8 + - _WarpStrength: 0.025 + - _WaveAmount: 7 + - _WaveSpeed: 10 + - _WaveStrength: 7.5 + - _WaveX: 0 + - _WaveY: 0.5 + - _ZTestMode: 4 + - _ZWrite: 0 + - _ZoomUvAmount: 0.5 + m_Colors: + - ColorSwapRed: {r: 1, g: 1, b: 1, a: 1} + - _AlphaOutlineColor: {r: 1, g: 0.4811321, b: 0.4811321, a: 1} + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _ColorChangeNewCol: {r: 1, g: 1, b: 0, a: 1} + - _ColorChangeNewCol2: {r: 1, g: 1, b: 0, a: 1} + - _ColorChangeNewCol3: {r: 1, g: 1, b: 0, a: 1} + - _ColorChangeTarget: {r: 1, g: 0, b: 0, a: 1} + - _ColorChangeTarget2: {r: 1, g: 0, b: 0, a: 1} + - _ColorChangeTarget3: {r: 1, g: 0, b: 0, a: 1} + - _ColorSwapBlue: {r: 1, g: 1, b: 1, a: 1} + - _ColorSwapGreen: {r: 1, g: 1, b: 1, a: 1} + - _ColorSwapRed: {r: 1, g: 1, b: 1, a: 1} + - _FadeBurnColor: {r: 1, g: 1, b: 0, a: 1} + - _GlowColor: {r: 1, g: 1, b: 1, a: 1} + - _GradBotLeftCol: {r: 0, g: 0, b: 1, a: 1} + - _GradBotRightCol: {r: 0, g: 0, b: 1, a: 1} + - _GradTopLeftCol: {r: 1, g: 0, b: 0, a: 1} + - _GradTopRightCol: {r: 1, g: 0, b: 0, a: 1} + - _GreyscaleTintColor: {r: 1, g: 1, b: 1, a: 1} + - _HitEffectColor: {r: 1, g: 1, b: 1, a: 1} + - _HologramStripeColor: {r: 0, g: 1, b: 1, a: 1} + - _InnerOutlineColor: {r: 1, g: 0, b: 0, a: 1} + - _OutlineColor: {r: 1, g: 0, b: 0, a: 1} + - _OverlayColor: {r: 1, g: 1, b: 1, a: 1} + - _ShadowColor: {r: 0, g: 0, b: 0, a: 1} + - _ShineColor: {r: 1, g: 1, b: 1, a: 1} +--- !u!1 &1078196206 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1078196207} + - component: {fileID: 1078196209} + - component: {fileID: 1078196208} + m_Layer: 0 + m_Name: Title + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1078196207 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1078196206} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: -3.1267126, z: 0} + m_LocalScale: {x: 1.2457023, y: 1.2457023, z: 1.2457023} + m_Children: [] + m_Father: {fileID: 511167261} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!102 &1078196208 +TextMesh: + serializedVersion: 3 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1078196206} + m_Text: Ice Soldier + m_OffsetZ: -1.5 + m_CharacterSize: 0.075 + m_LineSpacing: 1 + m_Anchor: 4 + m_Alignment: 0 + m_TabSize: 4 + m_FontSize: 100 + m_FontStyle: 0 + m_RichText: 1 + m_Font: {fileID: 12800000, guid: a4e6a5491519adb45919dc87eff28e55, type: 3} + m_Color: + serializedVersion: 2 + rgba: 4294967295 +--- !u!23 &1078196209 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1078196206} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 10100, guid: 0000000000000000e000000000000000, type: 0} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!1 &1090919392 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1090919393} + - component: {fileID: 1090919395} + - component: {fileID: 1090919394} + m_Layer: 0 + m_Name: Animated + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1090919393 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1090919392} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: -3.57, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 1986728942} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!102 &1090919394 +TextMesh: + serializedVersion: 3 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1090919392} + m_Text: (Has Animation) + m_OffsetZ: -1.5 + m_CharacterSize: 0.075 + m_LineSpacing: 1 + m_Anchor: 4 + m_Alignment: 0 + m_TabSize: 4 + m_FontSize: 100 + m_FontStyle: 0 + m_RichText: 1 + m_Font: {fileID: 12800000, guid: a4e6a5491519adb45919dc87eff28e55, type: 3} + m_Color: + serializedVersion: 2 + rgba: 4294967295 +--- !u!23 &1090919395 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1090919392} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 10100, guid: 0000000000000000e000000000000000, type: 0} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!1 &1091797525 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1091797526} + - component: {fileID: 1091797528} + - component: {fileID: 1091797527} + m_Layer: 0 + m_Name: Title + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1091797526 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1091797525} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: -2.51, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 1953432852} + m_RootOrder: 2 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!102 &1091797527 +TextMesh: + serializedVersion: 3 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1091797525} + m_Text: Fire + m_OffsetZ: -1.5 + m_CharacterSize: 0.075 + m_LineSpacing: 1 + m_Anchor: 4 + m_Alignment: 0 + m_TabSize: 4 + m_FontSize: 100 + m_FontStyle: 0 + m_RichText: 1 + m_Font: {fileID: 12800000, guid: a4e6a5491519adb45919dc87eff28e55, type: 3} + m_Color: + serializedVersion: 2 + rgba: 4294967295 +--- !u!23 &1091797528 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1091797525} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 10100, guid: 0000000000000000e000000000000000, type: 0} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!1 &1097188549 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1097188550} + - component: {fileID: 1097188552} + - component: {fileID: 1097188551} + m_Layer: 0 + m_Name: Title + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1097188550 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1097188549} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: -3.1267126, z: 0} + m_LocalScale: {x: 1.2457023, y: 1.2457023, z: 1.2457023} + m_Children: [] + m_Father: {fileID: 1883979700} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!102 &1097188551 +TextMesh: + serializedVersion: 3 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1097188549} + m_Text: Flag + m_OffsetZ: -1.5 + m_CharacterSize: 0.075 + m_LineSpacing: 1 + m_Anchor: 4 + m_Alignment: 0 + m_TabSize: 4 + m_FontSize: 100 + m_FontStyle: 0 + m_RichText: 1 + m_Font: {fileID: 12800000, guid: a4e6a5491519adb45919dc87eff28e55, type: 3} + m_Color: + serializedVersion: 2 + rgba: 4294967295 +--- !u!23 &1097188552 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1097188549} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 10100, guid: 0000000000000000e000000000000000, type: 0} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!1 &1100636067 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1100636068} + - component: {fileID: 1100636070} + - component: {fileID: 1100636069} + m_Layer: 0 + m_Name: Title + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1100636068 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1100636067} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: -2.51, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 166039413} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!102 &1100636069 +TextMesh: + serializedVersion: 3 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1100636067} + m_Text: Round Wave + m_OffsetZ: -1.5 + m_CharacterSize: 0.075 + m_LineSpacing: 1 + m_Anchor: 4 + m_Alignment: 0 + m_TabSize: 4 + m_FontSize: 100 + m_FontStyle: 0 + m_RichText: 1 + m_Font: {fileID: 12800000, guid: a4e6a5491519adb45919dc87eff28e55, type: 3} + m_Color: + serializedVersion: 2 + rgba: 4294967295 +--- !u!23 &1100636070 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1100636067} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 10100, guid: 0000000000000000e000000000000000, type: 0} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!1 &1103527057 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1103527058} + - component: {fileID: 1103527060} + - component: {fileID: 1103527059} + m_Layer: 0 + m_Name: Title + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1103527058 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1103527057} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: -3.1267126, z: 0} + m_LocalScale: {x: 1.2457023, y: 1.2457023, z: 1.2457023} + m_Children: [] + m_Father: {fileID: 2096881075} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!102 &1103527059 +TextMesh: + serializedVersion: 3 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1103527057} + m_Text: Shiny Marine + m_OffsetZ: -1.5 + m_CharacterSize: 0.075 + m_LineSpacing: 1 + m_Anchor: 4 + m_Alignment: 0 + m_TabSize: 4 + m_FontSize: 100 + m_FontStyle: 0 + m_RichText: 1 + m_Font: {fileID: 12800000, guid: a4e6a5491519adb45919dc87eff28e55, type: 3} + m_Color: + serializedVersion: 2 + rgba: 4294967295 +--- !u!23 &1103527060 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1103527057} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 10100, guid: 0000000000000000e000000000000000, type: 0} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!21 &1105303541 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: AllIn1SpriteShader/AllIn1SpriteShader + m_Shader: {fileID: 4800000, guid: a36b7719ff0465b42ab1407d67672c5f, type: 3} + m_ShaderKeywords: ETC1_EXTERNAL_ALPHA SHADOW_ON + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _ColorRampTex: + m_Texture: {fileID: 2800000, guid: 279657edc397ece4b8029c727adf6ddc, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ColorRampTexGradient: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ColorSwapTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DistortTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _FadeBurnTex: + m_Texture: {fileID: 2800000, guid: 32e8df0008bebe746b1681a71c61f31c, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _FadeTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _GlowTex: + 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} + - _OutlineDistortTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OutlineTex: + m_Texture: {fileID: 2800000, guid: 74087f6d03f233e4a8a142fa01f9e5cf, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OverlayTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ShineMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - _Alpha: 1 + - _AlphaCutoffValue: 0.25 + - _AlphaOutlineBlend: 1 + - _AlphaOutlineGlow: 5 + - _AlphaOutlineMinAlpha: 0 + - _AlphaOutlinePower: 1 + - _AlphaRoundThreshold: 0.5 + - _BillboardY: 0 + - _BlurHD: 0 + - _BlurIntensity: 10 + - _Brightness: 0 + - _ChromAberrAlpha: 0.4 + - _ChromAberrAmount: 1 + - _ClipUvDown: 1 + - _ClipUvLeft: 1 + - _ClipUvRight: 1 + - _ClipUvUp: 1 + - _ColorChangeLuminosity: 0 + - _ColorChangeTolerance: 0.25 + - _ColorChangeTolerance2: 0.25 + - _ColorChangeTolerance3: 0.25 + - _ColorRampBlend: 1 + - _ColorRampLuminosity: 0 + - _ColorRampOutline: 0 + - _ColorSwapBlend: 1 + - _ColorSwapBlueLuminosity: 0.5 + - _ColorSwapGreenLuminosity: 0.5 + - _ColorSwapRedLuminosity: 0.5 + - _Contrast: 1 + - _CullingOption: 0 + - _DistortAmount: 0.5 + - _DistortTexXSpeed: 5 + - _DistortTexYSpeed: 5 + - _EditorDrawers: 6 + - _FadeAmount: -0.1 + - _FadeBurnGlow: 2 + - _FadeBurnTransition: 0.075 + - _FadeBurnWidth: 0.025 + - _FishEyeUvAmount: 0.35 + - _FlickerAlpha: 0 + - _FlickerFreq: 0.2 + - _FlickerPercent: 0.05 + - _GhostBlend: 1 + - _GhostColorBoost: 1 + - _GhostTransparency: 0 + - _GlitchAmount: 3 + - _GlitchSize: 1 + - _Glow: 10 + - _GlowGlobal: 1 + - _GlowTexUsed: 0 + - _GradBlend: 1 + - _GradBoostX: 1.2 + - _GradBoostY: 1.2 + - _GradIsRadial: 0 + - _GrassManualAnim: 1 + - _GrassManualToggle: 0 + - _GrassRadialBend: 0.1 + - _GrassSpeed: 2 + - _GrassWind: 20 + - _GreyscaleBlend: 1 + - _GreyscaleLuminosity: 0 + - _GreyscaleOutline: 0 + - _HandDrawnAmount: 10 + - _HandDrawnSpeed: 5 + - _HitEffectBlend: 1 + - _HitEffectGlow: 5 + - _HologramBlend: 1 + - _HologramFlickerAlpha: 0 + - _HologramFlickerFreq: 0.2 + - _HologramFlickerPercent: 0.05 + - _HologramMaxAlpha: 1 + - _HologramMinAlpha: 0 + - _HologramStripesAlpha: 0.4 + - _HologramStripesAmount: 50 + - _HologramStripesFill: 0.4 + - _HologramStripesLuminosity: 1 + - _HologramStripesSpeed: 5 + - _HologramUnmodAmount: 0.4 + - _HsvBright: 1 + - _HsvSaturation: 1 + - _HsvShift: 180 + - _InnerOutlineAlpha: 1 + - _InnerOutlineGlow: 1 + - _InnerOutlineThickness: 1 + - _MaxXUV: 1 + - _MaxYUV: 1 + - _MinXUV: 0 + - _MinYUV: 0 + - _MotionBlurAngle: 0.1 + - _MotionBlurDist: 1.25 + - _MyDstMode: 10 + - _MySrcMode: 5 + - _NegativeAmount: 1 + - _OffsetUvX: 0 + - _OffsetUvY: 0 + - _OnlyInnerOutline: 0 + - _OnlyOutline: 0 + - _Outline8Directions: 0 + - _OutlineAlpha: 1 + - _OutlineDistortAmount: 0.5 + - _OutlineDistortTexXSpeed: 5 + - _OutlineDistortTexYSpeed: 5 + - _OutlineDistortToggle: 0 + - _OutlineGlow: 1.5 + - _OutlineIsPixel: 0 + - _OutlinePixelWidth: 1 + - _OutlineTexGrey: 0 + - _OutlineTexToggle: 0 + - _OutlineTexXSpeed: 10 + - _OutlineTexYSpeed: 0 + - _OutlineWidth: 0.004 + - _OverlayBlend: 1 + - _OverlayGlow: 1 + - _OverlayTextureScrollXSpeed: 0.25 + - _OverlayTextureScrollYSpeed: 0.25 + - _PinchUvAmount: 0.35 + - _PixelateSize: 32 + - _PosterizeGamma: 0.75 + - _PosterizeNumColors: 8 + - _PosterizeOutline: 0 + - _RadialClip: 45 + - _RadialClip2: 0 + - _RadialClipAngle: 90 + - _RadialClipArc1: 45 + - _RadialClipArc2: 0 + - _RadialStartAngle: 90 + - _RandomSeed: 0 + - _RectSize: 1 + - _RotateUvAmount: 0 + - _RoundWaveSpeed: 2 + - _RoundWaveStrength: 0.7 + - _ShadowAlpha: 0.5 + - _ShadowX: 0.1 + - _ShadowY: -0.05 + - _ShakeUvSpeed: 2.5 + - _ShakeUvX: 1.5 + - _ShakeUvY: 1 + - _ShineGlow: 1 + - _ShineLocation: 0.5 + - _ShineRotate: 0 + - _ShineWidth: 0.1 + - _TextureScrollXSpeed: 1 + - _TextureScrollYSpeed: 0 + - _TwistUvAmount: 1 + - _TwistUvPosX: 0.5 + - _TwistUvPosY: 0.5 + - _TwistUvRadius: 0.75 + - _WarpScale: 0.5 + - _WarpSpeed: 8 + - _WarpStrength: 0.025 + - _WaveAmount: 7 + - _WaveSpeed: 10 + - _WaveStrength: 7.5 + - _WaveX: 0 + - _WaveY: 0.5 + - _ZTestMode: 4 + - _ZWrite: 0 + - _ZoomUvAmount: 0.5 + m_Colors: + - ColorSwapRed: {r: 1, g: 1, b: 1, a: 1} + - _AlphaOutlineColor: {r: 1, g: 1, b: 1, a: 1} + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _ColorChangeNewCol: {r: 1, g: 1, b: 0, a: 1} + - _ColorChangeNewCol2: {r: 1, g: 1, b: 0, a: 1} + - _ColorChangeNewCol3: {r: 1, g: 1, b: 0, a: 1} + - _ColorChangeTarget: {r: 1, g: 0, b: 0, a: 1} + - _ColorChangeTarget2: {r: 1, g: 0, b: 0, a: 1} + - _ColorChangeTarget3: {r: 1, g: 0, b: 0, a: 1} + - _ColorSwapBlue: {r: 1, g: 1, b: 1, a: 1} + - _ColorSwapGreen: {r: 1, g: 1, b: 1, a: 1} + - _ColorSwapRed: {r: 1, g: 1, b: 1, a: 1} + - _FadeBurnColor: {r: 1, g: 1, b: 0, a: 1} + - _GlowColor: {r: 1, g: 1, b: 1, a: 1} + - _GradBotLeftCol: {r: 0, g: 0, b: 1, a: 1} + - _GradBotRightCol: {r: 0, g: 0, b: 1, a: 1} + - _GradTopLeftCol: {r: 1, g: 0, b: 0, a: 1} + - _GradTopRightCol: {r: 1, g: 0, b: 0, a: 1} + - _GreyscaleTintColor: {r: 1, g: 1, b: 1, a: 1} + - _HitEffectColor: {r: 1, g: 1, b: 1, a: 1} + - _HologramStripeColor: {r: 1, g: 1, b: 1, a: 1} + - _InnerOutlineColor: {r: 1, g: 0, b: 0, a: 1} + - _OutlineColor: {r: 1, g: 1, b: 1, a: 1} + - _OverlayColor: {r: 1, g: 1, b: 1, a: 1} + - _ShadowColor: {r: 0, g: 0, b: 0, a: 1} + - _ShineColor: {r: 1, g: 1, b: 1, a: 1} +--- !u!1 &1111461196 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1111461197} + - component: {fileID: 1111461200} + - component: {fileID: 1111461199} + m_Layer: 0 + m_Name: Pinch + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1111461197 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1111461196} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 160, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 98690189} + - {fileID: 1325646928} + m_Father: {fileID: 1351315063} + m_RootOrder: 16 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &1111461199 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1111461196} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 98b644315d7a92842b89e04f55c48e02, type: 3} + m_Name: + m_EditorClassIdentifier: +--- !u!212 &1111461200 +SpriteRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1111461196} + m_Enabled: 1 + m_CastShadows: 0 + m_ReceiveShadows: 0 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 1863638619} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 0 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_Sprite: {fileID: 21300000, guid: 519dafacd208bb64c83d5124be03b09d, type: 3} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_FlipX: 0 + m_FlipY: 0 + m_DrawMode: 0 + m_Size: {x: 5.12, y: 5.12} + m_AdaptiveModeThreshold: 0.5 + m_SpriteTileMode: 0 + m_WasSpriteAssigned: 1 + m_MaskInteraction: 0 + m_SpriteSortPoint: 0 +--- !u!1 &1113550344 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1113550345} + - component: {fileID: 1113550347} + - component: {fileID: 1113550346} + - component: {fileID: 1113550348} + m_Layer: 0 + m_Name: Soldier + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1113550345 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1113550344} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: -0.549, z: -0.35} + m_LocalScale: {x: 0.62497, y: 0.62497, z: 0.62497} + m_Children: [] + m_Father: {fileID: 2035943844} + m_RootOrder: 2 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &1113550346 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1113550344} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: ee158225ee1e59f4791627785501d950, type: 3} + m_Name: + m_EditorClassIdentifier: + currentShaderType: 4 + normalStrength: 5 + normalSmoothing: 1 + computingNormal: 0 +--- !u!212 &1113550347 +SpriteRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1113550344} + m_Enabled: 1 + m_CastShadows: 0 + m_ReceiveShadows: 0 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 611714447} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 0 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_Sprite: {fileID: 21300000, guid: 519dafacd208bb64c83d5124be03b09d, type: 3} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_FlipX: 0 + m_FlipY: 0 + m_DrawMode: 0 + m_Size: {x: 5.12, y: 5.12} + m_AdaptiveModeThreshold: 0.5 + m_SpriteTileMode: 0 + m_WasSpriteAssigned: 1 + m_MaskInteraction: 0 + m_SpriteSortPoint: 0 +--- !u!95 &1113550348 +Animator: + serializedVersion: 3 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1113550344} + m_Enabled: 1 + m_Avatar: {fileID: 0} + m_Controller: {fileID: 9100000, guid: 2f06abfb8d5c7014299913ef4dbc450d, type: 2} + m_CullingMode: 0 + m_UpdateMode: 0 + m_ApplyRootMotion: 0 + m_LinearVelocityBlending: 0 + m_WarningMessage: + m_HasTransformHierarchy: 1 + m_AllowConstantClipSamplingOptimization: 1 + m_KeepAnimatorControllerStateOnDisable: 0 +--- !u!1 &1117637835 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1117637836} + - component: {fileID: 1117637838} + - component: {fileID: 1117637837} + m_Layer: 0 + m_Name: Title + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1117637836 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1117637835} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: -3.1267126, z: 0} + m_LocalScale: {x: 1.2457023, y: 1.2457023, z: 1.2457023} + m_Children: [] + m_Father: {fileID: 1528149039} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!102 &1117637837 +TextMesh: + serializedVersion: 3 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1117637835} + m_Text: 'Jelly Fish Soldier + +' + m_OffsetZ: -1.5 + m_CharacterSize: 0.075 + m_LineSpacing: 1 + m_Anchor: 4 + m_Alignment: 0 + m_TabSize: 4 + m_FontSize: 100 + m_FontStyle: 0 + m_RichText: 1 + m_Font: {fileID: 12800000, guid: a4e6a5491519adb45919dc87eff28e55, type: 3} + m_Color: + serializedVersion: 2 + rgba: 4294967295 +--- !u!23 &1117637838 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1117637835} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 10100, guid: 0000000000000000e000000000000000, type: 0} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!21 &1118634257 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: AllIn1SpriteShader/AllIn1SpriteShader + m_Shader: {fileID: 4800000, guid: a36b7719ff0465b42ab1407d67672c5f, type: 3} + m_ShaderKeywords: ETC1_EXTERNAL_ALPHA RADIALCLIPPING_ON + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: 3000 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _ColorRampTex: + m_Texture: {fileID: 2800000, guid: 279657edc397ece4b8029c727adf6ddc, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ColorRampTexGradient: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ColorSwapTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DistortTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _FadeBurnTex: + m_Texture: {fileID: 2800000, guid: 677cca399782dea41aedc1d292ecb67d, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _FadeTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _GlowTex: + 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} + - _OutlineDistortTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OutlineTex: + m_Texture: {fileID: 2800000, guid: 74087f6d03f233e4a8a142fa01f9e5cf, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OverlayTex: + m_Texture: {fileID: 2800000, guid: 677cca399782dea41aedc1d292ecb67d, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ShineMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - _Alpha: 1 + - _AlphaCutoffValue: 0.25 + - _AlphaOutlineBlend: 1 + - _AlphaOutlineGlow: 5 + - _AlphaOutlineMinAlpha: 0 + - _AlphaOutlinePower: 1 + - _AlphaRoundThreshold: 0.5 + - _BillboardY: 0 + - _BlurHD: 0 + - _BlurIntensity: 10 + - _Brightness: 0 + - _ChromAberrAlpha: 0.4 + - _ChromAberrAmount: 1 + - _ClipUvDown: 0 + - _ClipUvLeft: 0 + - _ClipUvRight: 0 + - _ClipUvUp: 0 + - _ColorChangeLuminosity: 0 + - _ColorChangeTolerance: 0.25 + - _ColorChangeTolerance2: 0.25 + - _ColorChangeTolerance3: 0.25 + - _ColorRampBlend: 1 + - _ColorRampLuminosity: 0 + - _ColorRampOutline: 0 + - _ColorSwapBlend: 1 + - _ColorSwapBlueLuminosity: 0.5 + - _ColorSwapGreenLuminosity: 0.5 + - _ColorSwapRedLuminosity: 0.5 + - _Contrast: 1 + - _CullingOption: 0 + - _DistortAmount: 0.5 + - _DistortTexXSpeed: 5 + - _DistortTexYSpeed: 5 + - _EditorDrawers: 6 + - _FadeAmount: -0.1 + - _FadeBurnGlow: 2 + - _FadeBurnTransition: 0.075 + - _FadeBurnWidth: 0.025 + - _FishEyeUvAmount: 0.35 + - _FlickerAlpha: 0 + - _FlickerFreq: 0.2 + - _FlickerPercent: 0.05 + - _GhostBlend: 1 + - _GhostColorBoost: 1 + - _GhostTransparency: 0 + - _GlitchAmount: 3 + - _GlitchSize: 1 + - _Glow: 10 + - _GlowGlobal: 1 + - _GradBlend: 1 + - _GradBoostX: 1.2 + - _GradBoostY: 1.2 + - _GradIsRadial: 0 + - _GrassManualAnim: 1 + - _GrassManualToggle: 0 + - _GrassRadialBend: 0.1 + - _GrassSpeed: 2 + - _GrassWind: 20 + - _GreyscaleBlend: 1 + - _GreyscaleLuminosity: 0 + - _GreyscaleOutline: 0 + - _HandDrawnAmount: 10 + - _HandDrawnSpeed: 5 + - _HitEffectBlend: 1 + - _HitEffectGlow: 5 + - _HologramBlend: 1 + - _HologramMaxAlpha: 0.75 + - _HologramMinAlpha: 0.1 + - _HologramStripesAmount: 0.1 + - _HologramStripesSpeed: 4.5 + - _HologramUnmodAmount: 0 + - _HsvBright: 1 + - _HsvSaturation: 1 + - _HsvShift: 180 + - _InnerOutlineAlpha: 1 + - _InnerOutlineGlow: 4 + - _InnerOutlineThickness: 1 + - _MaxXUV: 1 + - _MaxYUV: 1 + - _MinXUV: 0 + - _MinYUV: 0 + - _MotionBlurAngle: 0.1 + - _MotionBlurDist: 1.25 + - _MyDstMode: 10 + - _MySrcMode: 5 + - _NegativeAmount: 1 + - _OffsetUvX: 0 + - _OffsetUvY: 0 + - _OnlyInnerOutline: 0 + - _OnlyOutline: 0 + - _OutlineAlpha: 1 + - _OutlineDistortAmount: 0.5 + - _OutlineDistortTexXSpeed: 5 + - _OutlineDistortTexYSpeed: 5 + - _OutlineGlow: 1.5 + - _OutlinePixelWidth: 1 + - _OutlineTexXSpeed: 10 + - _OutlineTexYSpeed: 0 + - _OutlineWidth: 0.004 + - _OverlayBlend: 1 + - _OverlayGlow: 1 + - _OverlayTextureScrollXSpeed: 0.25 + - _OverlayTextureScrollYSpeed: 0.25 + - _PinchUvAmount: 0.35 + - _PixelateSize: 32 + - _PosterizeGamma: 0.75 + - _PosterizeNumColors: 8 + - _PosterizeOutline: 0 + - _RadialClip: 0 + - _RadialClip2: 45 + - _RadialClipAngle: 90 + - _RadialClipArc1: 0 + - _RadialClipArc2: 0 + - _RadialStartAngle: 90 + - _RandomSeed: 0 + - _RectSize: 1 + - _RotateUvAmount: 0 + - _RoundWaveSpeed: 2 + - _RoundWaveStrength: 0.7 + - _ShadowAlpha: 0.5 + - _ShadowX: 0.1 + - _ShadowY: -0.05 + - _ShakeUvSpeed: 2.5 + - _ShakeUvX: 1.5 + - _ShakeUvY: 1 + - _ShineGlow: 1 + - _ShineLocation: 0.5 + - _ShineRotate: 0 + - _ShineWidth: 0.1 + - _TextureScrollXSpeed: 1 + - _TextureScrollYSpeed: 0 + - _TwistUvAmount: 1 + - _TwistUvPosX: 0.5 + - _TwistUvPosY: 0.5 + - _TwistUvRadius: 0.75 + - _WarpScale: 0.5 + - _WarpSpeed: 8 + - _WarpStrength: 0.025 + - _WaveAmount: 7 + - _WaveSpeed: 10 + - _WaveStrength: 7.5 + - _WaveX: 0 + - _WaveY: 0.5 + - _ZTestMode: 4 + - _ZWrite: 0 + - _ZoomUvAmount: 0.5 + m_Colors: + - _AlphaOutlineColor: {r: 1, g: 1, b: 1, a: 1} + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _ColorChangeNewCol: {r: 1, g: 1, b: 0, a: 1} + - _ColorChangeNewCol2: {r: 1, g: 1, b: 0, a: 1} + - _ColorChangeNewCol3: {r: 1, g: 1, b: 0, a: 1} + - _ColorChangeTarget: {r: 1, g: 0, b: 0, a: 1} + - _ColorChangeTarget2: {r: 1, g: 0, b: 0, a: 1} + - _ColorChangeTarget3: {r: 1, g: 0, b: 0, a: 1} + - _ColorSwapBlue: {r: 1, g: 1, b: 1, a: 1} + - _ColorSwapGreen: {r: 1, g: 1, b: 1, a: 1} + - _ColorSwapRed: {r: 1, g: 1, b: 1, a: 1} + - _FadeBurnColor: {r: 1, g: 1, b: 0, a: 1} + - _GlowColor: {r: 1, g: 1, b: 1, a: 1} + - _GradBotLeftCol: {r: 0, g: 0, b: 1, a: 1} + - _GradBotRightCol: {r: 0, g: 1, b: 0, a: 1} + - _GradTopLeftCol: {r: 1, g: 0, b: 0, a: 1} + - _GradTopRightCol: {r: 1, g: 1, b: 0, a: 1} + - _GreyscaleTintColor: {r: 1, g: 1, b: 1, a: 1} + - _HitEffectColor: {r: 1, g: 1, b: 1, a: 1} + - _HologramStripeColor: {r: 0, g: 1, b: 1, a: 1} + - _InnerOutlineColor: {r: 1, g: 0, b: 0, a: 1} + - _OutlineColor: {r: 1, g: 1, b: 1, a: 1} + - _OverlayColor: {r: 1, g: 1, b: 1, a: 1} + - _ShadowColor: {r: 0, g: 0, b: 0, a: 1} + - _ShineColor: {r: 1, g: 1, b: 1, a: 1} +--- !u!1 &1119325821 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1119325822} + - component: {fileID: 1119325826} + - component: {fileID: 1119325825} + - component: {fileID: 1119325823} + m_Layer: 0 + m_Name: Twist + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1119325822 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1119325821} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 120, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 1697898091} + - {fileID: 793013508} + m_Father: {fileID: 1351315063} + m_RootOrder: 12 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!95 &1119325823 +Animator: + serializedVersion: 3 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1119325821} + m_Enabled: 1 + m_Avatar: {fileID: 0} + m_Controller: {fileID: 9100000, guid: ed827ed402dcef3458313b21158b5c7c, type: 2} + m_CullingMode: 0 + m_UpdateMode: 0 + m_ApplyRootMotion: 0 + m_LinearVelocityBlending: 0 + m_WarningMessage: + m_HasTransformHierarchy: 1 + m_AllowConstantClipSamplingOptimization: 1 + m_KeepAnimatorControllerStateOnDisable: 0 +--- !u!114 &1119325825 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1119325821} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 98b644315d7a92842b89e04f55c48e02, type: 3} + m_Name: + m_EditorClassIdentifier: +--- !u!212 &1119325826 +SpriteRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1119325821} + m_Enabled: 1 + m_CastShadows: 0 + m_ReceiveShadows: 0 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 1041891245} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 0 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_Sprite: {fileID: 21300000, guid: 519dafacd208bb64c83d5124be03b09d, type: 3} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_FlipX: 0 + m_FlipY: 0 + m_DrawMode: 0 + m_Size: {x: 5.12, y: 5.12} + m_AdaptiveModeThreshold: 0.5 + m_SpriteTileMode: 0 + m_WasSpriteAssigned: 1 + m_MaskInteraction: 0 + m_SpriteSortPoint: 0 +--- !u!4 &1120052622 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1120052623} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 10, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 866812740} + - {fileID: 136921169} + m_Father: {fileID: 2036092933} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &1120052623 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1120052622} + - component: {fileID: 1120052625} + - component: {fileID: 1120052626} + m_Layer: 0 + m_Name: Glow + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!212 &1120052625 +SpriteRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1120052623} + m_Enabled: 1 + m_CastShadows: 0 + m_ReceiveShadows: 0 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 1319594099} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 0 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_Sprite: {fileID: 21300000, guid: 519dafacd208bb64c83d5124be03b09d, type: 3} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_FlipX: 0 + m_FlipY: 0 + m_DrawMode: 0 + m_Size: {x: 5.12, y: 5.12} + m_AdaptiveModeThreshold: 0.5 + m_SpriteTileMode: 0 + m_WasSpriteAssigned: 1 + m_MaskInteraction: 0 + m_SpriteSortPoint: 0 +--- !u!114 &1120052626 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1120052623} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 98b644315d7a92842b89e04f55c48e02, type: 3} + m_Name: + m_EditorClassIdentifier: +--- !u!1 &1120672004 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1120672005} + - component: {fileID: 1120672007} + - component: {fileID: 1120672006} + m_Layer: 0 + m_Name: Front + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1120672005 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1120672004} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: -0.02} + m_LocalScale: {x: 0.9196, y: 0.65, z: 1} + m_Children: [] + m_Father: {fileID: 540070583} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &1120672006 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1120672004} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: ee158225ee1e59f4791627785501d950, type: 3} + m_Name: + m_EditorClassIdentifier: + currentShaderType: 4 + normalStrength: 5 + normalSmoothing: 1 + computingNormal: 0 +--- !u!212 &1120672007 +SpriteRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1120672004} + m_Enabled: 1 + m_CastShadows: 0 + m_ReceiveShadows: 0 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2067098021} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 0 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_Sprite: {fileID: 21300000, guid: fab06e0be9375cc4d823efa71629885c, type: 3} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_FlipX: 0 + m_FlipY: 0 + m_DrawMode: 0 + m_Size: {x: 1, y: 1} + m_AdaptiveModeThreshold: 0.5 + m_SpriteTileMode: 0 + m_WasSpriteAssigned: 1 + m_MaskInteraction: 0 + m_SpriteSortPoint: 0 +--- !u!1 &1123731222 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1123731223} + - component: {fileID: 1123731226} + - component: {fileID: 1123731225} + m_Layer: 0 + m_Name: Overlay Texture + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1123731223 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1123731222} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 300, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 355247223} + - {fileID: 297942435} + m_Father: {fileID: 2036092933} + m_RootOrder: 30 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &1123731225 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1123731222} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 98b644315d7a92842b89e04f55c48e02, type: 3} + m_Name: + m_EditorClassIdentifier: +--- !u!212 &1123731226 +SpriteRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1123731222} + m_Enabled: 1 + m_CastShadows: 0 + m_ReceiveShadows: 0 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 1936528753} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 0 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_Sprite: {fileID: 21300000, guid: 519dafacd208bb64c83d5124be03b09d, type: 3} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_FlipX: 0 + m_FlipY: 0 + m_DrawMode: 0 + m_Size: {x: 5.12, y: 5.12} + m_AdaptiveModeThreshold: 0.5 + m_SpriteTileMode: 0 + m_WasSpriteAssigned: 1 + m_MaskInteraction: 0 + m_SpriteSortPoint: 0 +--- !u!21 &1129192189 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: AllIn1SpriteShader/AllIn1SpriteShader + m_Shader: {fileID: 4800000, guid: a36b7719ff0465b42ab1407d67672c5f, type: 3} + m_ShaderKeywords: ETC1_EXTERNAL_ALPHA OUTBASE8DIR_ON OUTBASE_ON OUTDIST_ON OUTTEX_ON + _OUTLINE8DIRECTIONS_ON _OUTLINEDISTORTTOGGLE_ON _OUTLINETEXTOGGLE_ON + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _ColorRampTex: + m_Texture: {fileID: 2800000, guid: 279657edc397ece4b8029c727adf6ddc, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ColorRampTexGradient: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ColorSwapTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DistortTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _FadeBurnTex: + m_Texture: {fileID: 2800000, guid: 32e8df0008bebe746b1681a71c61f31c, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _FadeTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _GlowTex: + 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} + - _OutlineDistortTex: + m_Texture: {fileID: 2800000, guid: 806e236bc12668e4da974bb8f536d28f, type: 3} + m_Scale: {x: 0.5, y: 0.5} + m_Offset: {x: 0, y: 0} + - _OutlineTex: + m_Texture: {fileID: 2800000, guid: 677cca399782dea41aedc1d292ecb67d, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OverlayTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ShineMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - _Alpha: 1 + - _AlphaCutoffValue: 0.25 + - _AlphaOutlineBlend: 1 + - _AlphaOutlineGlow: 5 + - _AlphaOutlineMinAlpha: 0 + - _AlphaOutlinePower: 1 + - _AlphaRoundThreshold: 0.5 + - _BillboardY: 0 + - _BlurHD: 0 + - _BlurIntensity: 10 + - _Brightness: 0 + - _ChromAberrAlpha: 0.4 + - _ChromAberrAmount: 1 + - _ClipUvDown: 1 + - _ClipUvLeft: 1 + - _ClipUvRight: 1 + - _ClipUvUp: 1 + - _ColorChangeLuminosity: 0 + - _ColorChangeTolerance: 0.25 + - _ColorChangeTolerance2: 0.25 + - _ColorChangeTolerance3: 0.25 + - _ColorRampBlend: 1 + - _ColorRampLuminosity: 0 + - _ColorRampOutline: 0 + - _ColorSwapBlend: 1 + - _ColorSwapBlueLuminosity: 0.5 + - _ColorSwapGreenLuminosity: 0.5 + - _ColorSwapRedLuminosity: 0.5 + - _Contrast: 1 + - _CullingOption: 0 + - _DistortAmount: 0.5 + - _DistortTexXSpeed: 5 + - _DistortTexYSpeed: 5 + - _EditorDrawers: 6 + - _FadeAmount: -0.1 + - _FadeBurnGlow: 2 + - _FadeBurnTransition: 0.075 + - _FadeBurnWidth: 0.025 + - _FishEyeUvAmount: 0.35 + - _FlickerAlpha: 0 + - _FlickerFreq: 0.2 + - _FlickerPercent: 0.05 + - _GhostBlend: 1 + - _GhostColorBoost: 1 + - _GhostTransparency: 0 + - _GlitchAmount: 3 + - _GlitchSize: 1 + - _Glow: 10 + - _GlowGlobal: 1 + - _GlowTexUsed: 0 + - _GradBlend: 1 + - _GradBoostX: 1.2 + - _GradBoostY: 1.2 + - _GradIsRadial: 0 + - _GrassManualAnim: 1 + - _GrassManualToggle: 0 + - _GrassRadialBend: 0.25 + - _GrassSpeed: 2 + - _GrassWind: 20 + - _GreyscaleBlend: 1 + - _GreyscaleLuminosity: 0 + - _GreyscaleOutline: 0 + - _HandDrawnAmount: 10 + - _HandDrawnSpeed: 5 + - _HitEffectBlend: 1 + - _HitEffectGlow: 5 + - _HologramBlend: 1 + - _HologramFlickerAlpha: 0 + - _HologramFlickerFreq: 0.2 + - _HologramFlickerPercent: 0.05 + - _HologramMaxAlpha: 1 + - _HologramMinAlpha: 0 + - _HologramStripesAlpha: 0.4 + - _HologramStripesAmount: 50 + - _HologramStripesFill: 0.4 + - _HologramStripesLuminosity: 1 + - _HologramStripesSpeed: 5 + - _HologramUnmodAmount: 0.4 + - _HsvBright: 1 + - _HsvSaturation: 1 + - _HsvShift: 180 + - _InnerOutlineAlpha: 1 + - _InnerOutlineGlow: 1 + - _InnerOutlineThickness: 1 + - _MaxXUV: 1 + - _MaxYUV: 1 + - _MinXUV: 0 + - _MinYUV: 0 + - _MotionBlurAngle: 0.1 + - _MotionBlurDist: 1.25 + - _MyDstMode: 10 + - _MySrcMode: 5 + - _NegativeAmount: 1 + - _OffsetUvX: 0 + - _OffsetUvY: 0 + - _OnlyInnerOutline: 0 + - _OnlyOutline: 0 + - _Outline8Directions: 1 + - _OutlineAlpha: 1 + - _OutlineDistortAmount: 0.17 + - _OutlineDistortTexXSpeed: 2 + - _OutlineDistortTexYSpeed: -7 + - _OutlineDistortToggle: 1 + - _OutlineGlow: 6.4 + - _OutlineIsPixel: 0 + - _OutlinePixelWidth: 1 + - _OutlineTexGrey: 0 + - _OutlineTexToggle: 1 + - _OutlineTexXSpeed: 0 + - _OutlineTexYSpeed: -10 + - _OutlineWidth: 0.004 + - _OverlayBlend: 1 + - _OverlayGlow: 1 + - _OverlayTextureScrollXSpeed: 0.25 + - _OverlayTextureScrollYSpeed: 0.25 + - _PinchUvAmount: 0.35 + - _PixelateSize: 32 + - _PosterizeGamma: 0.75 + - _PosterizeNumColors: 8 + - _PosterizeOutline: 0 + - _RadialClip: 0 + - _RadialClip2: 45 + - _RadialClipAngle: 90 + - _RadialClipArc1: 45 + - _RadialClipArc2: 0 + - _RadialStartAngle: 90 + - _RandomSeed: 0 + - _RectSize: 1 + - _RotateUvAmount: 0 + - _RoundWaveSpeed: 2 + - _RoundWaveStrength: 0.7 + - _ShadowAlpha: 0.5 + - _ShadowX: 0.1 + - _ShadowY: -0.05 + - _ShakeUvSpeed: 2.5 + - _ShakeUvX: 1.5 + - _ShakeUvY: 1 + - _ShineGlow: 1 + - _ShineLocation: 0.5 + - _ShineRotate: 0 + - _ShineWidth: 0.1 + - _TextureScrollXSpeed: 1 + - _TextureScrollYSpeed: 0 + - _TwistUvAmount: 1 + - _TwistUvPosX: 0.5 + - _TwistUvPosY: 0.5 + - _TwistUvRadius: 0.75 + - _WarpScale: 0.5 + - _WarpSpeed: 8 + - _WarpStrength: 0.025 + - _WaveAmount: 7 + - _WaveSpeed: 10 + - _WaveStrength: 7.5 + - _WaveX: 0 + - _WaveY: 0.5 + - _ZTestMode: 4 + - _ZWrite: 0 + - _ZoomUvAmount: 0.5 + m_Colors: + - ColorSwapRed: {r: 1, g: 1, b: 1, a: 1} + - _AlphaOutlineColor: {r: 1, g: 1, b: 1, a: 1} + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _ColorChangeNewCol: {r: 1, g: 1, b: 0, a: 1} + - _ColorChangeNewCol2: {r: 1, g: 1, b: 0, a: 1} + - _ColorChangeNewCol3: {r: 1, g: 1, b: 0, a: 1} + - _ColorChangeTarget: {r: 1, g: 0, b: 0, a: 1} + - _ColorChangeTarget2: {r: 1, g: 0, b: 0, a: 1} + - _ColorChangeTarget3: {r: 1, g: 0, b: 0, a: 1} + - _ColorSwapBlue: {r: 1, g: 1, b: 1, a: 1} + - _ColorSwapGreen: {r: 1, g: 1, b: 1, a: 1} + - _ColorSwapRed: {r: 1, g: 1, b: 1, a: 1} + - _FadeBurnColor: {r: 1, g: 1, b: 0, a: 1} + - _GlowColor: {r: 1, g: 1, b: 1, a: 1} + - _GradBotLeftCol: {r: 0, g: 0, b: 1, a: 1} + - _GradBotRightCol: {r: 0, g: 0, b: 1, a: 1} + - _GradTopLeftCol: {r: 1, g: 0, b: 0, a: 1} + - _GradTopRightCol: {r: 1, g: 0, b: 0, a: 1} + - _GreyscaleTintColor: {r: 1, g: 1, b: 1, a: 1} + - _HitEffectColor: {r: 1, g: 1, b: 1, a: 1} + - _HologramStripeColor: {r: 1, g: 1, b: 1, a: 1} + - _InnerOutlineColor: {r: 1, g: 0, b: 0, a: 1} + - _OutlineColor: {r: 1, g: 1, b: 1, a: 1} + - _OverlayColor: {r: 1, g: 1, b: 1, a: 1} + - _ShadowColor: {r: 0, g: 0, b: 0, a: 1} + - _ShineColor: {r: 1, g: 1, b: 1, a: 1} +--- !u!1 &1146988137 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1146988138} + - component: {fileID: 1146988140} + - component: {fileID: 1146988139} + m_Layer: 0 + m_Name: Animated + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1146988138 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1146988137} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: -3.57, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 1988936578} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!102 &1146988139 +TextMesh: + serializedVersion: 3 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1146988137} + m_Text: (Texture) + m_OffsetZ: -1.5 + m_CharacterSize: 0.075 + m_LineSpacing: 1 + m_Anchor: 4 + m_Alignment: 0 + m_TabSize: 4 + m_FontSize: 100 + m_FontStyle: 0 + m_RichText: 1 + m_Font: {fileID: 12800000, guid: a4e6a5491519adb45919dc87eff28e55, type: 3} + m_Color: + serializedVersion: 2 + rgba: 4294967295 +--- !u!23 &1146988140 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1146988137} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 10100, guid: 0000000000000000e000000000000000, type: 0} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!21 &1150284212 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: AllIn1SpriteShader/AllIn1SpriteShader + m_Shader: {fileID: 4800000, guid: a36b7719ff0465b42ab1407d67672c5f, type: 3} + m_ShaderKeywords: ETC1_EXTERNAL_ALPHA FISHEYE_ON + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _ColorRampTex: + m_Texture: {fileID: 2800000, guid: 279657edc397ece4b8029c727adf6ddc, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ColorRampTexGradient: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ColorSwapTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DistortTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _FadeBurnTex: + m_Texture: {fileID: 2800000, guid: 32e8df0008bebe746b1681a71c61f31c, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _FadeTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _GlowTex: + 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} + - _OutlineDistortTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OutlineTex: + m_Texture: {fileID: 2800000, guid: 74087f6d03f233e4a8a142fa01f9e5cf, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OverlayTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ShineMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - _Alpha: 1 + - _AlphaCutoffValue: 0.25 + - _AlphaOutlineBlend: 1 + - _AlphaOutlineGlow: 5 + - _AlphaOutlineMinAlpha: 0 + - _AlphaOutlinePower: 1 + - _AlphaRoundThreshold: 0.5 + - _BillboardY: 0 + - _BlurHD: 0 + - _BlurIntensity: 10 + - _Brightness: 0 + - _ChromAberrAlpha: 0.4 + - _ChromAberrAmount: 1 + - _ClipUvDown: 1 + - _ClipUvLeft: 1 + - _ClipUvRight: 1 + - _ClipUvUp: 1 + - _ColorChangeLuminosity: 0 + - _ColorChangeTolerance: 0.25 + - _ColorChangeTolerance2: 0.25 + - _ColorChangeTolerance3: 0.25 + - _ColorRampBlend: 1 + - _ColorRampLuminosity: 0 + - _ColorRampOutline: 0 + - _ColorSwapBlend: 1 + - _ColorSwapBlueLuminosity: 0.5 + - _ColorSwapGreenLuminosity: 0.5 + - _ColorSwapRedLuminosity: 0.5 + - _Contrast: 1 + - _CullingOption: 0 + - _DistortAmount: 0.5 + - _DistortTexXSpeed: 5 + - _DistortTexYSpeed: 5 + - _EditorDrawers: 6 + - _FadeAmount: -0.1 + - _FadeBurnGlow: 2 + - _FadeBurnTransition: 0.075 + - _FadeBurnWidth: 0.025 + - _FishEyeUvAmount: 0.338 + - _FlickerAlpha: 0 + - _FlickerFreq: 0.2 + - _FlickerPercent: 0.05 + - _GhostBlend: 1 + - _GhostColorBoost: 1 + - _GhostTransparency: 0 + - _GlitchAmount: 3 + - _GlitchSize: 1 + - _Glow: 10 + - _GlowGlobal: 1 + - _GlowTexUsed: 0 + - _GradBlend: 1 + - _GradBoostX: 1.2 + - _GradBoostY: 1.2 + - _GradIsRadial: 0 + - _GrassManualAnim: 1 + - _GrassManualToggle: 0 + - _GrassRadialBend: 0.25 + - _GrassSpeed: 2 + - _GrassWind: 20 + - _GreyscaleBlend: 1 + - _GreyscaleLuminosity: 0 + - _GreyscaleOutline: 0 + - _HandDrawnAmount: 10 + - _HandDrawnSpeed: 5 + - _HitEffectBlend: 1 + - _HitEffectGlow: 5 + - _HologramBlend: 1 + - _HologramFlickerAlpha: 0 + - _HologramFlickerFreq: 0.2 + - _HologramFlickerPercent: 0.05 + - _HologramMaxAlpha: 1 + - _HologramMinAlpha: 0 + - _HologramStripesAlpha: 0.4 + - _HologramStripesAmount: 50 + - _HologramStripesFill: 0.4 + - _HologramStripesLuminosity: 1 + - _HologramStripesSpeed: 5 + - _HologramUnmodAmount: 0.4 + - _HsvBright: 1 + - _HsvSaturation: 1 + - _HsvShift: 180 + - _InnerOutlineAlpha: 1 + - _InnerOutlineGlow: 1 + - _InnerOutlineThickness: 1 + - _MaxXUV: 1 + - _MaxYUV: 1 + - _MinXUV: 0 + - _MinYUV: 0 + - _MotionBlurAngle: 0.1 + - _MotionBlurDist: 1.25 + - _MyDstMode: 10 + - _MySrcMode: 5 + - _NegativeAmount: 1 + - _OffsetUvX: 0 + - _OffsetUvY: 0 + - _OnlyInnerOutline: 0 + - _OnlyOutline: 0 + - _Outline8Directions: 0 + - _OutlineAlpha: 1 + - _OutlineDistortAmount: 0.5 + - _OutlineDistortTexXSpeed: 5 + - _OutlineDistortTexYSpeed: 5 + - _OutlineDistortToggle: 0 + - _OutlineGlow: 1.5 + - _OutlineIsPixel: 0 + - _OutlinePixelWidth: 1 + - _OutlineTexGrey: 0 + - _OutlineTexToggle: 0 + - _OutlineTexXSpeed: 10 + - _OutlineTexYSpeed: 0 + - _OutlineWidth: 0.004 + - _OverlayBlend: 1 + - _OverlayGlow: 1 + - _OverlayTextureScrollXSpeed: 0.25 + - _OverlayTextureScrollYSpeed: 0.25 + - _PinchUvAmount: 0.35 + - _PixelateSize: 32 + - _PosterizeGamma: 0.75 + - _PosterizeNumColors: 8 + - _PosterizeOutline: 0 + - _RadialClipAngle: 90 + - _RadialClipArc1: 45 + - _RadialClipArc2: 0 + - _RandomSeed: 0 + - _RectSize: 1 + - _RotateUvAmount: 0 + - _RoundWaveSpeed: 2 + - _RoundWaveStrength: 0.7 + - _ShadowAlpha: 0.5 + - _ShadowX: 0.1 + - _ShadowY: -0.05 + - _ShakeUvSpeed: 2.5 + - _ShakeUvX: 1.5 + - _ShakeUvY: 1 + - _ShineGlow: 1 + - _ShineLocation: 0.5 + - _ShineRotate: 0 + - _ShineWidth: 0.1 + - _TextureScrollXSpeed: 1 + - _TextureScrollYSpeed: 0 + - _TwistUvAmount: 1 + - _TwistUvPosX: 0.5 + - _TwistUvPosY: 0.5 + - _TwistUvRadius: 0.75 + - _WarpScale: 0.5 + - _WarpSpeed: 8 + - _WarpStrength: 0.025 + - _WaveAmount: 7 + - _WaveSpeed: 10 + - _WaveStrength: 7.5 + - _WaveX: 0 + - _WaveY: 0.5 + - _ZTestMode: 4 + - _ZWrite: 0 + - _ZoomUvAmount: 0.5 + m_Colors: + - ColorSwapRed: {r: 1, g: 1, b: 1, a: 1} + - _AlphaOutlineColor: {r: 1, g: 1, b: 1, a: 1} + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _ColorChangeNewCol: {r: 1, g: 1, b: 0, a: 1} + - _ColorChangeNewCol2: {r: 1, g: 1, b: 0, a: 1} + - _ColorChangeNewCol3: {r: 1, g: 1, b: 0, a: 1} + - _ColorChangeTarget: {r: 1, g: 0, b: 0, a: 1} + - _ColorChangeTarget2: {r: 1, g: 0, b: 0, a: 1} + - _ColorChangeTarget3: {r: 1, g: 0, b: 0, a: 1} + - _ColorSwapBlue: {r: 1, g: 1, b: 1, a: 1} + - _ColorSwapGreen: {r: 1, g: 1, b: 1, a: 1} + - _ColorSwapRed: {r: 1, g: 1, b: 1, a: 1} + - _FadeBurnColor: {r: 1, g: 1, b: 0, a: 1} + - _GlowColor: {r: 1, g: 1, b: 1, a: 1} + - _GradBotLeftCol: {r: 0, g: 0, b: 1, a: 1} + - _GradBotRightCol: {r: 0, g: 0, b: 1, a: 1} + - _GradTopLeftCol: {r: 1, g: 0, b: 0, a: 1} + - _GradTopRightCol: {r: 1, g: 0, b: 0, a: 1} + - _GreyscaleTintColor: {r: 1, g: 1, b: 1, a: 1} + - _HitEffectColor: {r: 1, g: 1, b: 1, a: 1} + - _HologramStripeColor: {r: 1, g: 1, b: 1, a: 1} + - _InnerOutlineColor: {r: 1, g: 0, b: 0, a: 1} + - _OutlineColor: {r: 1, g: 1, b: 1, a: 1} + - _OverlayColor: {r: 1, g: 1, b: 1, a: 1} + - _ShadowColor: {r: 0, g: 0, b: 0, a: 1} + - _ShineColor: {r: 1, g: 1, b: 1, a: 1} +--- !u!21 &1166912798 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: AllIn1SpriteShader/AllIn1SpriteShader + m_Shader: {fileID: 4800000, guid: a36b7719ff0465b42ab1407d67672c5f, type: 3} + m_ShaderKeywords: CHANGECOLOR_ON ETC1_EXTERNAL_ALPHA + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _ColorRampTex: + m_Texture: {fileID: 2800000, guid: 279657edc397ece4b8029c727adf6ddc, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ColorRampTexGradient: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ColorSwapTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DistortTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _FadeBurnTex: + m_Texture: {fileID: 2800000, guid: 32e8df0008bebe746b1681a71c61f31c, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _FadeTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _GlowTex: + 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} + - _OutlineDistortTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OutlineTex: + m_Texture: {fileID: 2800000, guid: 74087f6d03f233e4a8a142fa01f9e5cf, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OverlayTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ShineMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - _Alpha: 1 + - _AlphaCutoffValue: 0.25 + - _AlphaOutlineBlend: 1 + - _AlphaOutlineGlow: 5 + - _AlphaOutlineMinAlpha: 0 + - _AlphaOutlinePower: 1 + - _AlphaRoundThreshold: 0.5 + - _BillboardY: 0 + - _BlurHD: 0 + - _BlurIntensity: 10 + - _Brightness: 0 + - _ChromAberrAlpha: 0.4 + - _ChromAberrAmount: 1 + - _ClipUvDown: 1 + - _ClipUvLeft: 1 + - _ClipUvRight: 1 + - _ClipUvUp: 1 + - _ColorChangeLuminosity: 0.539 + - _ColorChangeTolerance: 0.75 + - _ColorChangeTolerance2: 0.25 + - _ColorChangeTolerance3: 0.25 + - _ColorRampBlend: 1 + - _ColorRampLuminosity: 0 + - _ColorRampOutline: 0 + - _ColorSwapBlend: 1 + - _ColorSwapBlueLuminosity: 0.5 + - _ColorSwapGreenLuminosity: 0.5 + - _ColorSwapRedLuminosity: 0.5 + - _Contrast: 1 + - _CullingOption: 0 + - _DistortAmount: 0.5 + - _DistortTexXSpeed: 5 + - _DistortTexYSpeed: 5 + - _EditorDrawers: 6 + - _FadeAmount: -0.1 + - _FadeBurnGlow: 2 + - _FadeBurnTransition: 0.075 + - _FadeBurnWidth: 0.025 + - _FishEyeUvAmount: 0.35 + - _FlickerAlpha: 0 + - _FlickerFreq: 0.2 + - _FlickerPercent: 0.05 + - _GhostBlend: 1 + - _GhostColorBoost: 1 + - _GhostTransparency: 0 + - _GlitchAmount: 3 + - _GlitchSize: 1 + - _Glow: 10 + - _GlowGlobal: 1 + - _GlowTexUsed: 0 + - _GradBlend: 1 + - _GradBoostX: 1.2 + - _GradBoostY: 1.2 + - _GradIsRadial: 0 + - _GrassManualAnim: 1 + - _GrassManualToggle: 0 + - _GrassRadialBend: 0.25 + - _GrassSpeed: 2 + - _GrassWind: 20 + - _GreyscaleBlend: 1 + - _GreyscaleLuminosity: 0 + - _GreyscaleOutline: 0 + - _HandDrawnAmount: 10 + - _HandDrawnSpeed: 5 + - _HitEffectBlend: 1 + - _HitEffectGlow: 5 + - _HologramBlend: 1 + - _HologramFlickerAlpha: 0 + - _HologramFlickerFreq: 0.2 + - _HologramMaxAlpha: 1 + - _HologramMinAlpha: 0 + - _HologramStripesAlpha: 0.4 + - _HologramStripesAmount: 50 + - _HologramStripesFill: 0.4 + - _HologramStripesLuminosity: 1 + - _HologramStripesSpeed: 5 + - _HologramUnmodAmount: 0.4 + - _HsvBright: 1 + - _HsvSaturation: 1 + - _HsvShift: 180 + - _InnerOutlineAlpha: 1 + - _InnerOutlineGlow: 1 + - _InnerOutlineThickness: 1 + - _MaxXUV: 1 + - _MaxYUV: 1 + - _MinXUV: 0 + - _MinYUV: 0 + - _MotionBlurAngle: 0.1 + - _MotionBlurDist: 1.25 + - _MyDstMode: 10 + - _MySrcMode: 5 + - _NegativeAmount: 1 + - _OffsetUvX: 0 + - _OffsetUvY: 0 + - _OnlyInnerOutline: 0 + - _OnlyOutline: 0 + - _Outline8Directions: 0 + - _OutlineAlpha: 1 + - _OutlineDistortAmount: 0.5 + - _OutlineDistortTexXSpeed: 5 + - _OutlineDistortTexYSpeed: 5 + - _OutlineDistortToggle: 0 + - _OutlineGlow: 1.5 + - _OutlineIsPixel: 0 + - _OutlinePixelWidth: 1 + - _OutlineTexGrey: 0 + - _OutlineTexToggle: 0 + - _OutlineTexXSpeed: 10 + - _OutlineTexYSpeed: 0 + - _OutlineWidth: 0.004 + - _OverlayBlend: 1 + - _OverlayGlow: 1 + - _OverlayTextureScrollXSpeed: 0.25 + - _OverlayTextureScrollYSpeed: 0.25 + - _PinchUvAmount: 0.35 + - _PixelateSize: 32 + - _PosterizeGamma: 0.75 + - _PosterizeNumColors: 8 + - _PosterizeOutline: 0 + - _RadialClip: 45 + - _RadialClip2: 0 + - _RadialClipAngle: 90 + - _RadialClipArc1: 45 + - _RadialClipArc2: 0 + - _RadialStartAngle: 90 + - _RandomSeed: 0 + - _RectSize: 1 + - _RotateUvAmount: 0 + - _RoundWaveSpeed: 2 + - _RoundWaveStrength: 0.7 + - _ShadowAlpha: 0.5 + - _ShadowX: 0.1 + - _ShadowY: -0.05 + - _ShakeUvSpeed: 2.5 + - _ShakeUvX: 1.5 + - _ShakeUvY: 1 + - _ShineGlow: 1 + - _ShineLocation: 0.5 + - _ShineRotate: 0 + - _ShineWidth: 0.1 + - _TextureScrollXSpeed: 1 + - _TextureScrollYSpeed: 0 + - _TwistUvAmount: 1 + - _TwistUvPosX: 0.5 + - _TwistUvPosY: 0.5 + - _TwistUvRadius: 0.75 + - _WarpScale: 0.5 + - _WarpSpeed: 8 + - _WarpStrength: 0.025 + - _WaveAmount: 7 + - _WaveSpeed: 10 + - _WaveStrength: 7.5 + - _WaveX: 0 + - _WaveY: 0.5 + - _ZTestMode: 4 + - _ZWrite: 0 + - _ZoomUvAmount: 0.5 + m_Colors: + - ColorSwapRed: {r: 1, g: 1, b: 1, a: 1} + - _AlphaOutlineColor: {r: 1, g: 1, b: 1, a: 1} + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _ColorChangeNewCol: {r: 1, g: 1, b: 0, a: 1} + - _ColorChangeNewCol2: {r: 1, g: 1, b: 0, a: 1} + - _ColorChangeNewCol3: {r: 1, g: 1, b: 0, a: 1} + - _ColorChangeTarget: {r: 0.70980394, g: 0.15686275, b: 0.2901961, a: 1} + - _ColorChangeTarget2: {r: 1, g: 0, b: 0, a: 1} + - _ColorChangeTarget3: {r: 1, g: 0, b: 0, a: 1} + - _ColorSwapBlue: {r: 1, g: 1, b: 1, a: 1} + - _ColorSwapGreen: {r: 1, g: 1, b: 1, a: 1} + - _ColorSwapRed: {r: 1, g: 1, b: 1, a: 1} + - _FadeBurnColor: {r: 1, g: 1, b: 0, a: 1} + - _GlowColor: {r: 1, g: 1, b: 1, a: 1} + - _GradBotLeftCol: {r: 0, g: 0, b: 1, a: 1} + - _GradBotRightCol: {r: 0, g: 0, b: 1, a: 1} + - _GradTopLeftCol: {r: 1, g: 0, b: 0, a: 1} + - _GradTopRightCol: {r: 1, g: 0, b: 0, a: 1} + - _GreyscaleTintColor: {r: 1, g: 1, b: 1, a: 1} + - _HitEffectColor: {r: 1, g: 1, b: 1, a: 1} + - _HologramStripeColor: {r: 1, g: 1, b: 1, a: 1} + - _InnerOutlineColor: {r: 1, g: 0, b: 0, a: 1} + - _OutlineColor: {r: 1, g: 1, b: 1, a: 1} + - _OverlayColor: {r: 1, g: 1, b: 1, a: 1} + - _ShadowColor: {r: 0, g: 0, b: 0, a: 1} + - _ShineColor: {r: 1, g: 1, b: 1, a: 1} +--- !u!21 &1181865632 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: AllIn1SpriteShader/AllIn1SpriteShader + m_Shader: {fileID: 4800000, guid: a36b7719ff0465b42ab1407d67672c5f, type: 3} + m_ShaderKeywords: ETC1_EXTERNAL_ALPHA GLITCH_ON + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _ColorRampTex: + m_Texture: {fileID: 2800000, guid: 279657edc397ece4b8029c727adf6ddc, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ColorRampTexGradient: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ColorSwapTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DistortTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _FadeBurnTex: + m_Texture: {fileID: 2800000, guid: 32e8df0008bebe746b1681a71c61f31c, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _FadeTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _GlowTex: + 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} + - _OutlineDistortTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OutlineTex: + m_Texture: {fileID: 2800000, guid: 74087f6d03f233e4a8a142fa01f9e5cf, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OverlayTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ShineMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - _Alpha: 1 + - _AlphaCutoffValue: 0.25 + - _AlphaOutlineBlend: 1 + - _AlphaOutlineGlow: 5 + - _AlphaOutlineMinAlpha: 0 + - _AlphaOutlinePower: 1 + - _AlphaRoundThreshold: 0.5 + - _BillboardY: 0 + - _BlurHD: 0 + - _BlurIntensity: 10 + - _Brightness: 0 + - _ChromAberrAlpha: 0.4 + - _ChromAberrAmount: 1 + - _ClipUvDown: 1 + - _ClipUvLeft: 1 + - _ClipUvRight: 1 + - _ClipUvUp: 1 + - _ColorChangeLuminosity: 0 + - _ColorChangeTolerance: 0.25 + - _ColorChangeTolerance2: 0.25 + - _ColorChangeTolerance3: 0.25 + - _ColorRampBlend: 1 + - _ColorRampLuminosity: 0 + - _ColorRampOutline: 0 + - _ColorSwapBlend: 1 + - _ColorSwapBlueLuminosity: 0.5 + - _ColorSwapGreenLuminosity: 0.5 + - _ColorSwapRedLuminosity: 0.5 + - _Contrast: 1 + - _CullingOption: 0 + - _DistortAmount: 0.5 + - _DistortTexXSpeed: 5 + - _DistortTexYSpeed: 5 + - _EditorDrawers: 6 + - _FadeAmount: -0.1 + - _FadeBurnGlow: 2 + - _FadeBurnTransition: 0.075 + - _FadeBurnWidth: 0.025 + - _FishEyeUvAmount: 0.35 + - _FlickerAlpha: 0 + - _FlickerFreq: 0.2 + - _FlickerPercent: 0.05 + - _GhostBlend: 1 + - _GhostColorBoost: 1 + - _GhostTransparency: 0 + - _GlitchAmount: 4 + - _GlitchSize: 1.23 + - _Glow: 10 + - _GlowGlobal: 1 + - _GlowTexUsed: 0 + - _GradBlend: 1 + - _GradBoostX: 1.2 + - _GradBoostY: 1.2 + - _GradIsRadial: 0 + - _GrassManualAnim: 1 + - _GrassManualToggle: 0 + - _GrassRadialBend: 0.1 + - _GrassSpeed: 2 + - _GrassWind: 20 + - _GreyscaleBlend: 1 + - _GreyscaleLuminosity: 0 + - _GreyscaleOutline: 0 + - _HandDrawnAmount: 10 + - _HandDrawnSpeed: 5 + - _HitEffectBlend: 1 + - _HitEffectGlow: 5 + - _HologramBlend: 1 + - _HologramFlickerAlpha: 0 + - _HologramFlickerFreq: 0.2 + - _HologramFlickerPercent: 0.05 + - _HologramMaxAlpha: 1 + - _HologramMinAlpha: 0 + - _HologramStripesAlpha: 0.4 + - _HologramStripesAmount: 50 + - _HologramStripesFill: 0.4 + - _HologramStripesLuminosity: 1 + - _HologramStripesSpeed: 5 + - _HologramUnmodAmount: 0.4 + - _HsvBright: 1 + - _HsvSaturation: 1 + - _HsvShift: 180 + - _InnerOutlineAlpha: 1 + - _InnerOutlineGlow: 1 + - _InnerOutlineThickness: 1 + - _MaxXUV: 1 + - _MaxYUV: 1 + - _MinXUV: 0 + - _MinYUV: 0 + - _MotionBlurAngle: 0.1 + - _MotionBlurDist: 1.25 + - _MyDstMode: 10 + - _MySrcMode: 5 + - _NegativeAmount: 1 + - _OffsetUvX: 0 + - _OffsetUvY: 0 + - _OnlyInnerOutline: 0 + - _OnlyOutline: 0 + - _Outline8Directions: 0 + - _OutlineAlpha: 1 + - _OutlineDistortAmount: 0.5 + - _OutlineDistortTexXSpeed: 5 + - _OutlineDistortTexYSpeed: 5 + - _OutlineDistortToggle: 0 + - _OutlineGlow: 1.5 + - _OutlineIsPixel: 0 + - _OutlinePixelWidth: 1 + - _OutlineTexGrey: 0 + - _OutlineTexToggle: 0 + - _OutlineTexXSpeed: 10 + - _OutlineTexYSpeed: 0 + - _OutlineWidth: 0.004 + - _OverlayBlend: 1 + - _OverlayGlow: 1 + - _OverlayTextureScrollXSpeed: 0.25 + - _OverlayTextureScrollYSpeed: 0.25 + - _PinchUvAmount: 0.35 + - _PixelateSize: 32 + - _PosterizeGamma: 0.75 + - _PosterizeNumColors: 8 + - _PosterizeOutline: 0 + - _RadialClip: 45 + - _RadialClip2: 0 + - _RadialClipAngle: 90 + - _RadialClipArc1: 45 + - _RadialClipArc2: 0 + - _RadialStartAngle: 90 + - _RandomSeed: 0 + - _RectSize: 1 + - _RotateUvAmount: 0 + - _RoundWaveSpeed: 2 + - _RoundWaveStrength: 0.7 + - _ShadowAlpha: 0.5 + - _ShadowX: 0.1 + - _ShadowY: -0.05 + - _ShakeUvSpeed: 2.5 + - _ShakeUvX: 1.5 + - _ShakeUvY: 1 + - _ShineGlow: 1 + - _ShineLocation: 0.5 + - _ShineRotate: 0 + - _ShineWidth: 0.1 + - _TextureScrollXSpeed: 1 + - _TextureScrollYSpeed: 0 + - _TwistUvAmount: 1 + - _TwistUvPosX: 0.5 + - _TwistUvPosY: 0.5 + - _TwistUvRadius: 0.75 + - _WarpScale: 0.5 + - _WarpSpeed: 8 + - _WarpStrength: 0.025 + - _WaveAmount: 7 + - _WaveSpeed: 10 + - _WaveStrength: 7.5 + - _WaveX: 0 + - _WaveY: 0.5 + - _ZTestMode: 4 + - _ZWrite: 0 + - _ZoomUvAmount: 0.5 + m_Colors: + - ColorSwapRed: {r: 1, g: 1, b: 1, a: 1} + - _AlphaOutlineColor: {r: 1, g: 1, b: 1, a: 1} + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _ColorChangeNewCol: {r: 1, g: 1, b: 0, a: 1} + - _ColorChangeNewCol2: {r: 1, g: 1, b: 0, a: 1} + - _ColorChangeNewCol3: {r: 1, g: 1, b: 0, a: 1} + - _ColorChangeTarget: {r: 1, g: 0, b: 0, a: 1} + - _ColorChangeTarget2: {r: 1, g: 0, b: 0, a: 1} + - _ColorChangeTarget3: {r: 1, g: 0, b: 0, a: 1} + - _ColorSwapBlue: {r: 1, g: 1, b: 1, a: 1} + - _ColorSwapGreen: {r: 1, g: 1, b: 1, a: 1} + - _ColorSwapRed: {r: 1, g: 1, b: 1, a: 1} + - _FadeBurnColor: {r: 1, g: 1, b: 0, a: 1} + - _GlowColor: {r: 1, g: 1, b: 1, a: 1} + - _GradBotLeftCol: {r: 0, g: 0, b: 1, a: 1} + - _GradBotRightCol: {r: 0, g: 0, b: 1, a: 1} + - _GradTopLeftCol: {r: 1, g: 0, b: 0, a: 1} + - _GradTopRightCol: {r: 1, g: 0, b: 0, a: 1} + - _GreyscaleTintColor: {r: 1, g: 1, b: 1, a: 1} + - _HitEffectColor: {r: 1, g: 1, b: 1, a: 1} + - _HologramStripeColor: {r: 1, g: 1, b: 1, a: 1} + - _InnerOutlineColor: {r: 1, g: 0, b: 0, a: 1} + - _OutlineColor: {r: 1, g: 1, b: 1, a: 1} + - _OverlayColor: {r: 1, g: 1, b: 1, a: 1} + - _ShadowColor: {r: 0, g: 0, b: 0, a: 1} + - _ShineColor: {r: 1, g: 1, b: 1, a: 1} +--- !u!1 &1183578089 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1183578090} + - component: {fileID: 1183578092} + - component: {fileID: 1183578091} + m_Layer: 0 + m_Name: Outline2 + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1183578090 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1183578089} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 1.22, y: 0.82, z: 0.05} + m_LocalScale: {x: 1.0080961, y: 1.0080961, z: 1.0080961} + m_Children: [] + m_Father: {fileID: 1415143267} + m_RootOrder: 4 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &1183578091 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1183578089} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: ee158225ee1e59f4791627785501d950, type: 3} + m_Name: + m_EditorClassIdentifier: + currentShaderType: 4 + normalStrength: 5 + normalSmoothing: 1 + computingNormal: 0 +--- !u!212 &1183578092 +SpriteRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1183578089} + m_Enabled: 1 + m_CastShadows: 0 + m_ReceiveShadows: 0 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: 2fff2435ee99439438c463e2ce768283, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 0 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_Sprite: {fileID: 21300000, guid: 519dafacd208bb64c83d5124be03b09d, type: 3} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_FlipX: 0 + m_FlipY: 0 + m_DrawMode: 0 + m_Size: {x: 5.12, y: 5.12} + m_AdaptiveModeThreshold: 0.5 + m_SpriteTileMode: 0 + m_WasSpriteAssigned: 1 + m_MaskInteraction: 0 + m_SpriteSortPoint: 0 +--- !u!1 &1188655026 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1188655027} + - component: {fileID: 1188655029} + - component: {fileID: 1188655028} + m_Layer: 0 + m_Name: Title + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1188655027 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1188655026} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: -2.51, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 1038353159} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!102 &1188655028 +TextMesh: + serializedVersion: 3 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1188655026} + m_Text: Impact + m_OffsetZ: -1.5 + m_CharacterSize: 0.075 + m_LineSpacing: 1 + m_Anchor: 4 + m_Alignment: 0 + m_TabSize: 4 + m_FontSize: 100 + m_FontStyle: 0 + m_RichText: 1 + m_Font: {fileID: 12800000, guid: a4e6a5491519adb45919dc87eff28e55, type: 3} + m_Color: + serializedVersion: 2 + rgba: 4294967295 +--- !u!23 &1188655029 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1188655026} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 10100, guid: 0000000000000000e000000000000000, type: 0} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!1 &1194409626 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1194409627} + - component: {fileID: 1194409629} + - component: {fileID: 1194409628} + m_Layer: 0 + m_Name: Animated + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 0 +--- !u!4 &1194409627 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1194409626} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: -3.57, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 2045252512} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!102 &1194409628 +TextMesh: + serializedVersion: 3 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1194409626} + m_Text: (Has Animation) + m_OffsetZ: -1.5 + m_CharacterSize: 0.075 + m_LineSpacing: 1 + m_Anchor: 4 + m_Alignment: 0 + m_TabSize: 4 + m_FontSize: 100 + m_FontStyle: 0 + m_RichText: 1 + m_Font: {fileID: 12800000, guid: a4e6a5491519adb45919dc87eff28e55, type: 3} + m_Color: + serializedVersion: 2 + rgba: 4294967295 +--- !u!23 &1194409629 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1194409626} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: a4e6a5491519adb45919dc87eff28e55, type: 3} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!21 &1195370958 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: AllIn1SpriteShader/AllIn1SpriteShader + m_Shader: {fileID: 4800000, guid: a36b7719ff0465b42ab1407d67672c5f, type: 3} + m_ShaderKeywords: DISTORT_ON ETC1_EXTERNAL_ALPHA GLOW_ON GREYSCALE_ON POLARUV_ON + POSTERIZE_ON TEXTURESCROLL_ON WAVEUV_ON + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _ColorRampTex: + m_Texture: {fileID: 2800000, guid: 279657edc397ece4b8029c727adf6ddc, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ColorRampTexGradient: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ColorSwapTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DistortTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 2, y: 2} + m_Offset: {x: 0, y: 0} + - _FadeBurnTex: + m_Texture: {fileID: 2800000, guid: 32e8df0008bebe746b1681a71c61f31c, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _FadeTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _GlowTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MainTex: + m_Texture: {fileID: 2800000, guid: 74087f6d03f233e4a8a142fa01f9e5cf, type: 3} + m_Scale: {x: 1, y: 4.5} + m_Offset: {x: 0, y: 0} + - _OutlineDistortTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OutlineTex: + m_Texture: {fileID: 2800000, guid: 74087f6d03f233e4a8a142fa01f9e5cf, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OverlayTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ShineMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - _Alpha: 1 + - _AlphaCutoffValue: 0.25 + - _AlphaOutlineBlend: 1 + - _AlphaOutlineGlow: 5 + - _AlphaOutlineMinAlpha: 0 + - _AlphaOutlinePower: 1 + - _AlphaRoundThreshold: 0.5 + - _BillboardY: 0 + - _BlurHD: 0 + - _BlurIntensity: 10 + - _Brightness: 0 + - _ChromAberrAlpha: 0.4 + - _ChromAberrAmount: 1 + - _ClipUvDown: 1 + - _ClipUvLeft: 1 + - _ClipUvRight: 1 + - _ClipUvUp: 1 + - _ColorChangeLuminosity: 0 + - _ColorChangeTolerance: 0.25 + - _ColorChangeTolerance2: 0.25 + - _ColorChangeTolerance3: 0.25 + - _ColorRampBlend: 1 + - _ColorRampLuminosity: 0 + - _ColorRampOutline: 0 + - _ColorSwapBlend: 1 + - _ColorSwapBlueLuminosity: 0.5 + - _ColorSwapGreenLuminosity: 0.5 + - _ColorSwapRedLuminosity: 0.5 + - _Contrast: 1 + - _CullingOption: 0 + - _DistortAmount: 1.167 + - _DistortTexXSpeed: 10 + - _DistortTexYSpeed: 10 + - _EditorDrawers: 6 + - _FadeAmount: -0.1 + - _FadeBurnGlow: 2 + - _FadeBurnTransition: 0.075 + - _FadeBurnWidth: 0.025 + - _FishEyeUvAmount: 0.35 + - _FlickerAlpha: 0 + - _FlickerFreq: 0.2 + - _FlickerPercent: 0.05 + - _GhostBlend: 1 + - _GhostColorBoost: 1 + - _GhostTransparency: 0 + - _GlitchAmount: 3 + - _GlitchSize: 1 + - _Glow: 1.5 + - _GlowGlobal: 1 + - _GlowTexUsed: 0 + - _GradBlend: 1 + - _GradBoostX: 1.2 + - _GradBoostY: 1.2 + - _GradIsRadial: 0 + - _GrassManualAnim: 1 + - _GrassManualToggle: 0 + - _GrassRadialBend: 0.25 + - _GrassSpeed: 2 + - _GrassWind: 20 + - _GreyscaleBlend: 1 + - _GreyscaleLuminosity: -0.119 + - _GreyscaleOutline: 0 + - _HandDrawnAmount: 12.7 + - _HandDrawnSpeed: 5 + - _HitEffectBlend: 1 + - _HitEffectGlow: 5 + - _HologramBlend: 1 + - _HologramFlickerAlpha: 0 + - _HologramFlickerFreq: 0.2 + - _HologramFlickerPercent: 0.05 + - _HologramMaxAlpha: 1 + - _HologramMinAlpha: 0 + - _HologramStripesAlpha: 0.4 + - _HologramStripesAmount: 50 + - _HologramStripesFill: 0.4 + - _HologramStripesLuminosity: 1 + - _HologramStripesSpeed: 5 + - _HologramUnmodAmount: 0.4 + - _HsvBright: 0.94 + - _HsvSaturation: 1.14 + - _HsvShift: 41 + - _InnerOutlineAlpha: 1 + - _InnerOutlineGlow: 1 + - _InnerOutlineThickness: 1 + - _MaxXUV: 1 + - _MaxYUV: 1 + - _MinXUV: 0 + - _MinYUV: 0 + - _MotionBlurAngle: 0.1 + - _MotionBlurDist: 1.25 + - _MyDstMode: 10 + - _MySrcMode: 5 + - _NegativeAmount: 1 + - _OffsetUvX: 0 + - _OffsetUvY: 0 + - _OnlyInnerOutline: 0 + - _OnlyOutline: 0 + - _Outline8Directions: 0 + - _OutlineAlpha: 1 + - _OutlineDistortAmount: 0.5 + - _OutlineDistortTexXSpeed: 5 + - _OutlineDistortTexYSpeed: 5 + - _OutlineDistortToggle: 0 + - _OutlineGlow: 1.5 + - _OutlineIsPixel: 0 + - _OutlinePixelWidth: 1 + - _OutlineTexGrey: 0 + - _OutlineTexToggle: 0 + - _OutlineTexXSpeed: 10 + - _OutlineTexYSpeed: 0 + - _OutlineWidth: 0.004 + - _OverlayBlend: 1 + - _OverlayGlow: 1 + - _OverlayTextureScrollXSpeed: 0.25 + - _OverlayTextureScrollYSpeed: 0.25 + - _PinchUvAmount: 0.35 + - _PixelateSize: 22 + - _PosterizeGamma: 0.75 + - _PosterizeNumColors: 9.9 + - _PosterizeOutline: 0 + - _RadialClip: 45 + - _RadialClip2: 0 + - _RadialClipAngle: 90 + - _RadialClipArc1: 45 + - _RadialClipArc2: 0 + - _RadialStartAngle: 90 + - _RandomSeed: 0 + - _RectSize: 1 + - _RotateUvAmount: 0 + - _RoundWaveSpeed: 2 + - _RoundWaveStrength: 0.7 + - _ShadowAlpha: 0.5 + - _ShadowX: 0.1 + - _ShadowY: -0.05 + - _ShakeUvSpeed: 0.1 + - _ShakeUvX: 0 + - _ShakeUvY: 5 + - _ShineGlow: 1 + - _ShineLocation: 0.5 + - _ShineRotate: 0 + - _ShineWidth: 0.1 + - _TextureScrollXSpeed: 0.17 + - _TextureScrollYSpeed: 1.47 + - _TwistUvAmount: 1 + - _TwistUvPosX: 0.5 + - _TwistUvPosY: 0.5 + - _TwistUvRadius: 0.75 + - _WarpScale: 0.5 + - _WarpSpeed: 8 + - _WarpStrength: 0.025 + - _WaveAmount: 18.68 + - _WaveSpeed: 19 + - _WaveStrength: 13.8 + - _WaveX: 0 + - _WaveY: 0.5 + - _ZTestMode: 4 + - _ZWrite: 0 + - _ZoomUvAmount: 0.5 + m_Colors: + - ColorSwapRed: {r: 1, g: 1, b: 1, a: 1} + - _AlphaOutlineColor: {r: 1, g: 1, b: 1, a: 1} + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _ColorChangeNewCol: {r: 1, g: 1, b: 0, a: 1} + - _ColorChangeNewCol2: {r: 1, g: 1, b: 0, a: 1} + - _ColorChangeNewCol3: {r: 1, g: 1, b: 0, a: 1} + - _ColorChangeTarget: {r: 1, g: 0, b: 0, a: 1} + - _ColorChangeTarget2: {r: 1, g: 0, b: 0, a: 1} + - _ColorChangeTarget3: {r: 1, g: 0, b: 0, a: 1} + - _ColorSwapBlue: {r: 1, g: 1, b: 1, a: 1} + - _ColorSwapGreen: {r: 1, g: 1, b: 1, a: 1} + - _ColorSwapRed: {r: 1, g: 1, b: 1, a: 1} + - _FadeBurnColor: {r: 1, g: 1, b: 0, a: 1} + - _GlowColor: {r: 1, g: 1, b: 1, a: 1} + - _GradBotLeftCol: {r: 0, g: 0, b: 1, a: 1} + - _GradBotRightCol: {r: 0, g: 0, b: 1, a: 1} + - _GradTopLeftCol: {r: 1, g: 0, b: 0, a: 1} + - _GradTopRightCol: {r: 1, g: 0, b: 0, a: 1} + - _GreyscaleTintColor: {r: 0.083333254, g: 1, b: 0, a: 1} + - _HitEffectColor: {r: 1, g: 1, b: 1, a: 1} + - _HologramStripeColor: {r: 1, g: 1, b: 1, a: 1} + - _InnerOutlineColor: {r: 1, g: 0, b: 0, a: 1} + - _OutlineColor: {r: 1, g: 1, b: 1, a: 1} + - _OverlayColor: {r: 1, g: 1, b: 1, a: 1} + - _ShadowColor: {r: 0, g: 0, b: 0, a: 1} + - _ShineColor: {r: 1, g: 1, b: 1, a: 1} +--- !u!21 &1201459352 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: AllIn1SpriteShader/AllIn1SpriteShader + m_Shader: {fileID: 4800000, guid: a36b7719ff0465b42ab1407d67672c5f, type: 3} + m_ShaderKeywords: BLUR_ON CLIPPING_ON CUSTOMBLENDING_ON DISTORT_ON ETC1_EXTERNAL_ALPHA + GLOW_ON WAVEUV_ON WIND_ON + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _ColorRampTex: + m_Texture: {fileID: 2800000, guid: 279657edc397ece4b8029c727adf6ddc, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ColorRampTexGradient: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ColorSwapTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DistortTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 0.5, y: 0.5} + m_Offset: {x: 0, y: 0} + - _FadeBurnTex: + m_Texture: {fileID: 2800000, guid: 677cca399782dea41aedc1d292ecb67d, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _FadeTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _GlowTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MainTex: + m_Texture: {fileID: 2800000, guid: dd5ae95e1fbf31c4ca76212884f5b8fc, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OutlineDistortTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OutlineTex: + m_Texture: {fileID: 2800000, guid: 74087f6d03f233e4a8a142fa01f9e5cf, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OverlayTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ShineMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - _Alpha: 1 + - _AlphaCutoffValue: 0.25 + - _AlphaOutlineBlend: 1 + - _AlphaOutlineGlow: 5 + - _AlphaOutlineMinAlpha: 0 + - _AlphaOutlinePower: 1 + - _AlphaRoundThreshold: 0.5 + - _BillboardY: 0 + - _BlurHD: 0 + - _BlurIntensity: 100 + - _Brightness: 0 + - _ChromAberrAlpha: 0.4 + - _ChromAberrAmount: 1 + - _ClipUvDown: 0 + - _ClipUvLeft: 0.03 + - _ClipUvRight: 0 + - _ClipUvUp: 0.042 + - _ColorChangeLuminosity: 0 + - _ColorChangeTolerance: 0.25 + - _ColorChangeTolerance2: 0.25 + - _ColorChangeTolerance3: 0.25 + - _ColorRampBlend: 1 + - _ColorRampLuminosity: 0 + - _ColorRampOutline: 0 + - _ColorSwapBlend: 1 + - _ColorSwapBlueLuminosity: 0.5 + - _ColorSwapGreenLuminosity: 0.5 + - _ColorSwapRedLuminosity: 0.5 + - _Contrast: 1 + - _CullingOption: 0 + - _DistortAmount: 0.81 + - _DistortTexXSpeed: -1 + - _DistortTexYSpeed: -5.9 + - _EditorDrawers: 6 + - _FadeAmount: -0.1 + - _FadeBurnGlow: 2 + - _FadeBurnTransition: 0.075 + - _FadeBurnWidth: 0.025 + - _FishEyeUvAmount: 0.35 + - _FlickerAlpha: 0 + - _FlickerFreq: 0.2 + - _FlickerPercent: 0.05 + - _GhostBlend: 1 + - _GhostColorBoost: 1 + - _GhostTransparency: 0 + - _GlitchAmount: 3 + - _GlitchSize: 1 + - _Glow: 14.3 + - _GlowGlobal: 1 + - _GlowTexUsed: 0 + - _GradBlend: 1 + - _GradBoostX: 1.2 + - _GradBoostY: 1.2 + - _GradIsRadial: 0 + - _GrassManualAnim: 1 + - _GrassManualToggle: 0 + - _GrassRadialBend: 0.25 + - _GrassSpeed: 9 + - _GrassWind: 5.8 + - _GreyscaleBlend: 1 + - _GreyscaleLuminosity: 0 + - _GreyscaleOutline: 0 + - _HandDrawnAmount: 10 + - _HandDrawnSpeed: 5 + - _HitEffectBlend: 1 + - _HitEffectGlow: 5 + - _HologramBlend: 1 + - _HologramMaxAlpha: 0.75 + - _HologramMinAlpha: 0.1 + - _HologramStripesAmount: 0.1 + - _HologramStripesSpeed: 4.5 + - _HologramUnmodAmount: 0 + - _HsvBright: 1 + - _HsvSaturation: 1 + - _HsvShift: 180 + - _InnerOutlineAlpha: 1 + - _InnerOutlineGlow: 1 + - _InnerOutlineThickness: 1 + - _MaxXUV: 1 + - _MaxYUV: 1 + - _MinXUV: 0 + - _MinYUV: 0 + - _MotionBlurAngle: 0.1 + - _MotionBlurDist: 1.25 + - _MyDstMode: 10 + - _MySrcMode: 5 + - _NegativeAmount: 1 + - _OffsetUvX: 0 + - _OffsetUvY: 0 + - _OnlyInnerOutline: 0 + - _OnlyOutline: 0 + - _Outline8Directions: 0 + - _OutlineAlpha: 1 + - _OutlineDistortAmount: 0.5 + - _OutlineDistortTexXSpeed: 5 + - _OutlineDistortTexYSpeed: 5 + - _OutlineDistortToggle: 0 + - _OutlineGlow: 1.5 + - _OutlineIsPixel: 0 + - _OutlinePixelWidth: 1 + - _OutlineTexGrey: 0 + - _OutlineTexToggle: 0 + - _OutlineTexXSpeed: 10 + - _OutlineTexYSpeed: 0 + - _OutlineWidth: 0.004 + - _OverlayBlend: 1 + - _OverlayGlow: 1 + - _OverlayTextureScrollXSpeed: 0.25 + - _OverlayTextureScrollYSpeed: 0.25 + - _PinchUvAmount: 0.35 + - _PixelateSize: 32 + - _PosterizeGamma: 0.75 + - _PosterizeNumColors: 8 + - _PosterizeOutline: 0 + - _RadialClipAngle: 90 + - _RadialClipArc1: 45 + - _RadialClipArc2: 0 + - _RandomSeed: 0 + - _RectSize: 1 + - _RotateUvAmount: 0 + - _RoundWaveSpeed: 2 + - _RoundWaveStrength: 0.7 + - _ShadowAlpha: 0.5 + - _ShadowX: 0.1 + - _ShadowY: -0.05 + - _ShakeUvSpeed: 2.5 + - _ShakeUvX: 1.5 + - _ShakeUvY: 1 + - _ShineGlow: 1 + - _ShineLocation: 0.5 + - _ShineRotate: 0 + - _ShineWidth: 0.1 + - _TextureScrollXSpeed: 1 + - _TextureScrollYSpeed: 0 + - _TwistUvAmount: 1 + - _TwistUvPosX: 0.5 + - _TwistUvPosY: 0.5 + - _TwistUvRadius: 0.75 + - _WarpScale: 0.5 + - _WarpSpeed: 8 + - _WarpStrength: 0.025 + - _WaveAmount: 7 + - _WaveSpeed: 10 + - _WaveStrength: 7.5 + - _WaveX: 0 + - _WaveY: 0.5 + - _ZTestMode: 4 + - _ZWrite: 0 + - _ZoomUvAmount: 0.5 + m_Colors: + - ColorSwapRed: {r: 1, g: 1, b: 1, a: 1} + - _AlphaOutlineColor: {r: 1, g: 1, b: 1, a: 1} + - _Color: {r: 0.4339623, g: 0.08552541, b: 0, a: 1} + - _ColorChangeNewCol: {r: 1, g: 1, b: 0, a: 1} + - _ColorChangeNewCol2: {r: 1, g: 1, b: 0, a: 1} + - _ColorChangeNewCol3: {r: 1, g: 1, b: 0, a: 1} + - _ColorChangeTarget: {r: 1, g: 0, b: 0, a: 1} + - _ColorChangeTarget2: {r: 1, g: 0, b: 0, a: 1} + - _ColorChangeTarget3: {r: 1, g: 0, b: 0, a: 1} + - _ColorSwapBlue: {r: 1, g: 1, b: 1, a: 1} + - _ColorSwapGreen: {r: 1, g: 1, b: 1, a: 1} + - _ColorSwapRed: {r: 1, g: 1, b: 1, a: 1} + - _FadeBurnColor: {r: 1, g: 1, b: 0, a: 1} + - _GlowColor: {r: 1, g: 0.30916578, b: 0.13207549, a: 1} + - _GradBotLeftCol: {r: 0, g: 0, b: 1, a: 1} + - _GradBotRightCol: {r: 0, g: 0, b: 1, a: 1} + - _GradTopLeftCol: {r: 1, g: 0, b: 0, a: 1} + - _GradTopRightCol: {r: 1, g: 0, b: 0, a: 1} + - _GreyscaleTintColor: {r: 1, g: 1, b: 1, a: 1} + - _HitEffectColor: {r: 1, g: 1, b: 1, a: 1} + - _HologramStripeColor: {r: 0, g: 1, b: 1, a: 1} + - _InnerOutlineColor: {r: 1, g: 0, b: 0, a: 1} + - _OutlineColor: {r: 1, g: 1, b: 1, a: 1} + - _OverlayColor: {r: 1, g: 1, b: 1, a: 1} + - _ShadowColor: {r: 0, g: 0, b: 0, a: 1} + - _ShineColor: {r: 1, g: 1, b: 1, a: 1} +--- !u!1 &1211354476 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1211354477} + - component: {fileID: 1211354479} + m_Layer: 0 + m_Name: HP Bar + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1211354477 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1211354476} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 180, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 1697295737} + - {fileID: 1404112919} + - {fileID: 540070583} + m_Father: {fileID: 1563905016} + m_RootOrder: 18 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &1211354479 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1211354476} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 98b644315d7a92842b89e04f55c48e02, type: 3} + m_Name: + m_EditorClassIdentifier: +--- !u!21 &1213636577 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: AllIn1SpriteShader/AllIn1SpriteShader + m_Shader: {fileID: 4800000, guid: a36b7719ff0465b42ab1407d67672c5f, type: 3} + m_ShaderKeywords: ETC1_EXTERNAL_ALPHA OUTBASE8DIR_ON ROUNDWAVEUV_ON _OUTLINE8DIRECTIONS_ON + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _ColorRampTex: + m_Texture: {fileID: 2800000, guid: 279657edc397ece4b8029c727adf6ddc, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ColorRampTexGradient: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ColorSwapTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DistortTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _FadeBurnTex: + m_Texture: {fileID: 2800000, guid: 32e8df0008bebe746b1681a71c61f31c, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _FadeTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _GlowTex: + 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} + - _OutlineDistortTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OutlineTex: + m_Texture: {fileID: 2800000, guid: 74087f6d03f233e4a8a142fa01f9e5cf, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OverlayTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ShineMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - _Alpha: 1 + - _AlphaCutoffValue: 0.25 + - _AlphaOutlineBlend: 1 + - _AlphaOutlineGlow: 5 + - _AlphaOutlineMinAlpha: 0 + - _AlphaOutlinePower: 1 + - _AlphaRoundThreshold: 0.5 + - _BillboardY: 0 + - _BlurHD: 0 + - _BlurIntensity: 10 + - _Brightness: 0 + - _ChromAberrAlpha: 0.4 + - _ChromAberrAmount: 1 + - _ClipUvDown: 1 + - _ClipUvLeft: 1 + - _ClipUvRight: 1 + - _ClipUvUp: 1 + - _ColorChangeLuminosity: 0 + - _ColorChangeTolerance: 0.25 + - _ColorChangeTolerance2: 0.25 + - _ColorChangeTolerance3: 0.25 + - _ColorRampBlend: 1 + - _ColorRampLuminosity: 0 + - _ColorRampOutline: 0 + - _ColorSwapBlend: 1 + - _ColorSwapBlueLuminosity: 0.5 + - _ColorSwapGreenLuminosity: 0.5 + - _ColorSwapRedLuminosity: 0.5 + - _Contrast: 1 + - _CullingOption: 0 + - _DistortAmount: 0.5 + - _DistortTexXSpeed: 5 + - _DistortTexYSpeed: 5 + - _EditorDrawers: 6 + - _FadeAmount: -0.1 + - _FadeBurnGlow: 2 + - _FadeBurnTransition: 0.075 + - _FadeBurnWidth: 0.025 + - _FishEyeUvAmount: 0.35 + - _FlickerAlpha: 0 + - _FlickerFreq: 0.2 + - _FlickerPercent: 0.05 + - _GhostBlend: 1 + - _GhostColorBoost: 1 + - _GhostTransparency: 0 + - _GlitchAmount: 3 + - _GlitchSize: 1 + - _Glow: 10 + - _GlowGlobal: 1 + - _GlowTexUsed: 0 + - _GradBlend: 1 + - _GradBoostX: 1.2 + - _GradBoostY: 1.2 + - _GradIsRadial: 0 + - _GrassManualAnim: 1 + - _GrassManualToggle: 0 + - _GrassRadialBend: 0.25 + - _GrassSpeed: 2 + - _GrassWind: 20 + - _GreyscaleBlend: 1 + - _GreyscaleLuminosity: 0 + - _GreyscaleOutline: 0 + - _HandDrawnAmount: 10 + - _HandDrawnSpeed: 5 + - _HitEffectBlend: 1 + - _HitEffectGlow: 5 + - _HologramBlend: 1 + - _HologramFlickerAlpha: 0 + - _HologramFlickerFreq: 0.2 + - _HologramFlickerPercent: 0.05 + - _HologramMaxAlpha: 1 + - _HologramMinAlpha: 0 + - _HologramStripesAlpha: 0.4 + - _HologramStripesAmount: 50 + - _HologramStripesFill: 0.4 + - _HologramStripesLuminosity: 1 + - _HologramStripesSpeed: 5 + - _HologramUnmodAmount: 0.4 + - _HsvBright: 1 + - _HsvSaturation: 1 + - _HsvShift: 180 + - _InnerOutlineAlpha: 1 + - _InnerOutlineGlow: 1 + - _InnerOutlineThickness: 1 + - _MaxXUV: 1 + - _MaxYUV: 1 + - _MinXUV: 0 + - _MinYUV: 0 + - _MotionBlurAngle: 0.1 + - _MotionBlurDist: 1.25 + - _MyDstMode: 10 + - _MySrcMode: 5 + - _NegativeAmount: 1 + - _OffsetUvX: 0 + - _OffsetUvY: 0 + - _OnlyInnerOutline: 0 + - _OnlyOutline: 0 + - _Outline8Directions: 1 + - _OutlineAlpha: 1 + - _OutlineDistortAmount: 0.5 + - _OutlineDistortTexXSpeed: 5 + - _OutlineDistortTexYSpeed: 5 + - _OutlineDistortToggle: 0 + - _OutlineGlow: 1.5 + - _OutlineIsPixel: 0 + - _OutlinePixelWidth: 1 + - _OutlineTexGrey: 0 + - _OutlineTexToggle: 0 + - _OutlineTexXSpeed: 10 + - _OutlineTexYSpeed: 0 + - _OutlineWidth: 0.0159 + - _OverlayBlend: 1 + - _OverlayGlow: 1 + - _OverlayTextureScrollXSpeed: 0.25 + - _OverlayTextureScrollYSpeed: 0.25 + - _PinchUvAmount: 0.35 + - _PixelateSize: 32 + - _PosterizeGamma: 0.75 + - _PosterizeNumColors: 8 + - _PosterizeOutline: 0 + - _RadialClip: 45 + - _RadialClip2: 0 + - _RadialClipAngle: 90 + - _RadialClipArc1: 45 + - _RadialClipArc2: 0 + - _RadialStartAngle: 90 + - _RandomSeed: 0 + - _RectSize: 1 + - _RotateUvAmount: 0 + - _RoundWaveSpeed: 2.82 + - _RoundWaveStrength: 0.421 + - _ShadowAlpha: 0.5 + - _ShadowX: 0.1 + - _ShadowY: -0.05 + - _ShakeUvSpeed: 2.5 + - _ShakeUvX: 1.5 + - _ShakeUvY: 1 + - _ShineGlow: 1 + - _ShineLocation: 0.5 + - _ShineRotate: 0 + - _ShineWidth: 0.1 + - _TextureScrollXSpeed: 1 + - _TextureScrollYSpeed: 0 + - _TwistUvAmount: 1 + - _TwistUvPosX: 0.5 + - _TwistUvPosY: 0.5 + - _TwistUvRadius: 0.75 + - _WarpScale: 0.5 + - _WarpSpeed: 8 + - _WarpStrength: 0.025 + - _WaveAmount: 8.95 + - _WaveSpeed: 12.14 + - _WaveStrength: 18.77 + - _WaveX: 0 + - _WaveY: 0.5 + - _ZTestMode: 4 + - _ZWrite: 0 + - _ZoomUvAmount: 0.5 + m_Colors: + - ColorSwapRed: {r: 1, g: 1, b: 1, a: 1} + - _AlphaOutlineColor: {r: 1, g: 1, b: 1, a: 1} + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _ColorChangeNewCol: {r: 1, g: 1, b: 0, a: 1} + - _ColorChangeNewCol2: {r: 1, g: 1, b: 0, a: 1} + - _ColorChangeNewCol3: {r: 1, g: 1, b: 0, a: 1} + - _ColorChangeTarget: {r: 1, g: 0, b: 0, a: 1} + - _ColorChangeTarget2: {r: 1, g: 0, b: 0, a: 1} + - _ColorChangeTarget3: {r: 1, g: 0, b: 0, a: 1} + - _ColorSwapBlue: {r: 1, g: 1, b: 1, a: 1} + - _ColorSwapGreen: {r: 1, g: 1, b: 1, a: 1} + - _ColorSwapRed: {r: 1, g: 1, b: 1, a: 1} + - _FadeBurnColor: {r: 1, g: 1, b: 0, a: 1} + - _GlowColor: {r: 1, g: 1, b: 1, a: 1} + - _GradBotLeftCol: {r: 0, g: 0, b: 1, a: 1} + - _GradBotRightCol: {r: 0, g: 0, b: 1, a: 1} + - _GradTopLeftCol: {r: 1, g: 0, b: 0, a: 1} + - _GradTopRightCol: {r: 1, g: 0, b: 0, a: 1} + - _GreyscaleTintColor: {r: 1, g: 1, b: 1, a: 1} + - _HitEffectColor: {r: 1, g: 1, b: 1, a: 1} + - _HologramStripeColor: {r: 1, g: 1, b: 1, a: 1} + - _InnerOutlineColor: {r: 1, g: 0, b: 0, a: 1} + - _OutlineColor: {r: 1, g: 1, b: 1, a: 1} + - _OverlayColor: {r: 1, g: 1, b: 1, a: 1} + - _ShadowColor: {r: 0, g: 0, b: 0, a: 1} + - _ShineColor: {r: 1, g: 1, b: 1, a: 1} +--- !u!1 &1227823620 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1227823621} + - component: {fileID: 1227823624} + - component: {fileID: 1227823623} + m_Layer: 0 + m_Name: Shake + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1227823621 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1227823620} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 170, y: 0, z: 0} + m_LocalScale: {x: 0.80276, y: 0.80276, z: 0.80276} + m_Children: + - {fileID: 1071386688} + - {fileID: 1484598037} + m_Father: {fileID: 1351315063} + m_RootOrder: 17 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &1227823623 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1227823620} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 98b644315d7a92842b89e04f55c48e02, type: 3} + m_Name: + m_EditorClassIdentifier: +--- !u!212 &1227823624 +SpriteRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1227823620} + m_Enabled: 1 + m_CastShadows: 0 + m_ReceiveShadows: 0 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 999359662} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 0 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_Sprite: {fileID: 21300000, guid: 519dafacd208bb64c83d5124be03b09d, type: 3} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_FlipX: 0 + m_FlipY: 0 + m_DrawMode: 0 + m_Size: {x: 5.12, y: 5.12} + m_AdaptiveModeThreshold: 0.5 + m_SpriteTileMode: 0 + m_WasSpriteAssigned: 1 + m_MaskInteraction: 0 + m_SpriteSortPoint: 0 +--- !u!1 &1229041065 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1229041066} + - component: {fileID: 1229041068} + - component: {fileID: 1229041069} + m_Layer: 0 + m_Name: HueShift + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1229041066 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1229041065} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 110, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 294421776} + - {fileID: 2065278700} + m_Father: {fileID: 2036092933} + m_RootOrder: 11 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!212 &1229041068 +SpriteRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1229041065} + m_Enabled: 1 + m_CastShadows: 0 + m_ReceiveShadows: 0 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2061184730} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 0 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_Sprite: {fileID: 21300000, guid: 519dafacd208bb64c83d5124be03b09d, type: 3} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_FlipX: 0 + m_FlipY: 0 + m_DrawMode: 0 + m_Size: {x: 5.12, y: 5.12} + m_AdaptiveModeThreshold: 0.5 + m_SpriteTileMode: 0 + m_WasSpriteAssigned: 1 + m_MaskInteraction: 0 + m_SpriteSortPoint: 0 +--- !u!114 &1229041069 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1229041065} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 98b644315d7a92842b89e04f55c48e02, type: 3} + m_Name: + m_EditorClassIdentifier: +--- !u!21 &1230234141 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: AllIn1SpriteShader/AllIn1SpriteShader + m_Shader: {fileID: 4800000, guid: a36b7719ff0465b42ab1407d67672c5f, type: 3} + m_ShaderKeywords: ETC1_EXTERNAL_ALPHA TEXTURESCROLL_ON + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _ColorRampTex: + m_Texture: {fileID: 2800000, guid: 279657edc397ece4b8029c727adf6ddc, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ColorRampTexGradient: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ColorSwapTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DistortTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _FadeBurnTex: + m_Texture: {fileID: 2800000, guid: 32e8df0008bebe746b1681a71c61f31c, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _FadeTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _GlowTex: + 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} + - _OutlineDistortTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OutlineTex: + m_Texture: {fileID: 2800000, guid: 74087f6d03f233e4a8a142fa01f9e5cf, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OverlayTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ShineMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - _Alpha: 1 + - _AlphaCutoffValue: 0.25 + - _AlphaOutlineBlend: 1 + - _AlphaOutlineGlow: 5 + - _AlphaOutlineMinAlpha: 0 + - _AlphaOutlinePower: 1 + - _AlphaRoundThreshold: 0.5 + - _BillboardY: 0 + - _BlurHD: 0 + - _BlurIntensity: 10 + - _Brightness: 0 + - _ChromAberrAlpha: 0.4 + - _ChromAberrAmount: 1 + - _ClipUvDown: 1 + - _ClipUvLeft: 1 + - _ClipUvRight: 1 + - _ClipUvUp: 1 + - _ColorChangeLuminosity: 0 + - _ColorChangeTolerance: 0.25 + - _ColorChangeTolerance2: 0.25 + - _ColorChangeTolerance3: 0.25 + - _ColorRampBlend: 1 + - _ColorRampLuminosity: 0 + - _ColorRampOutline: 0 + - _ColorSwapBlend: 1 + - _ColorSwapBlueLuminosity: 0.5 + - _ColorSwapGreenLuminosity: 0.5 + - _ColorSwapRedLuminosity: 0.5 + - _Contrast: 1 + - _CullingOption: 0 + - _DistortAmount: 0.5 + - _DistortTexXSpeed: 5 + - _DistortTexYSpeed: 5 + - _EditorDrawers: 6 + - _FadeAmount: -0.1 + - _FadeBurnGlow: 2 + - _FadeBurnTransition: 0.075 + - _FadeBurnWidth: 0.025 + - _FishEyeUvAmount: 0.35 + - _FlickerAlpha: 0 + - _FlickerFreq: 0.2 + - _FlickerPercent: 0.05 + - _GhostBlend: 1 + - _GhostColorBoost: 1 + - _GhostTransparency: 0 + - _GlitchAmount: 3 + - _GlitchSize: 1 + - _Glow: 10 + - _GlowGlobal: 1 + - _GlowTexUsed: 0 + - _GradBlend: 0.858 + - _GradBoostX: 1.2 + - _GradBoostY: 1.2 + - _GradIsRadial: 0 + - _GrassManualAnim: 1 + - _GrassManualToggle: 0 + - _GrassRadialBend: 0.25 + - _GrassSpeed: 2 + - _GrassWind: 20 + - _GreyscaleBlend: 1 + - _GreyscaleLuminosity: 0 + - _GreyscaleOutline: 0 + - _HandDrawnAmount: 10 + - _HandDrawnSpeed: 5 + - _HitEffectBlend: 1 + - _HitEffectGlow: 5 + - _HologramBlend: 1 + - _HologramFlickerAlpha: 0 + - _HologramFlickerFreq: 0.2 + - _HologramFlickerPercent: 0.05 + - _HologramMaxAlpha: 1 + - _HologramMinAlpha: 0 + - _HologramStripesAlpha: 0.4 + - _HologramStripesAmount: 50 + - _HologramStripesFill: 0.4 + - _HologramStripesLuminosity: 1 + - _HologramStripesSpeed: 5 + - _HologramUnmodAmount: 0.4 + - _HsvBright: 1 + - _HsvSaturation: 1 + - _HsvShift: 180 + - _InnerOutlineAlpha: 1 + - _InnerOutlineGlow: 1 + - _InnerOutlineThickness: 1 + - _MaxXUV: 1 + - _MaxYUV: 1 + - _MinXUV: 0 + - _MinYUV: 0 + - _MotionBlurAngle: 0.1 + - _MotionBlurDist: 1.25 + - _MyDstMode: 10 + - _MySrcMode: 5 + - _NegativeAmount: 1 + - _OffsetUvX: 0 + - _OffsetUvY: 0 + - _OnlyInnerOutline: 0 + - _OnlyOutline: 0 + - _Outline8Directions: 0 + - _OutlineAlpha: 1 + - _OutlineDistortAmount: 0.5 + - _OutlineDistortTexXSpeed: 5 + - _OutlineDistortTexYSpeed: 5 + - _OutlineDistortToggle: 0 + - _OutlineGlow: 1.5 + - _OutlineIsPixel: 0 + - _OutlinePixelWidth: 1 + - _OutlineTexGrey: 0 + - _OutlineTexToggle: 0 + - _OutlineTexXSpeed: 10 + - _OutlineTexYSpeed: 0 + - _OutlineWidth: 0.004 + - _OverlayBlend: 1 + - _OverlayGlow: 1 + - _OverlayTextureScrollXSpeed: 0.25 + - _OverlayTextureScrollYSpeed: 0.25 + - _PinchUvAmount: 0.35 + - _PixelateSize: 32 + - _PosterizeGamma: 0.75 + - _PosterizeNumColors: 8 + - _PosterizeOutline: 0 + - _RadialClip: 45 + - _RadialClip2: 45 + - _RadialClipAngle: 90 + - _RadialClipArc1: 45 + - _RadialClipArc2: 0 + - _RadialStartAngle: 90 + - _RandomSeed: 0 + - _RectSize: 1 + - _RotateUvAmount: 0 + - _RoundWaveSpeed: 2 + - _RoundWaveStrength: 0.7 + - _ShadowAlpha: 0.5 + - _ShadowX: 0.1 + - _ShadowY: -0.05 + - _ShakeUvSpeed: 2.5 + - _ShakeUvX: 1.5 + - _ShakeUvY: 1 + - _ShineGlow: 1 + - _ShineLocation: 0.5 + - _ShineRotate: 0 + - _ShineWidth: 0.1 + - _TextureScrollXSpeed: 1 + - _TextureScrollYSpeed: 0.84 + - _TwistUvAmount: 1 + - _TwistUvPosX: 0.5 + - _TwistUvPosY: 0.5 + - _TwistUvRadius: 0.75 + - _WarpScale: 0.5 + - _WarpSpeed: 8 + - _WarpStrength: 0.025 + - _WaveAmount: 7 + - _WaveSpeed: 10 + - _WaveStrength: 7.5 + - _WaveX: 0 + - _WaveY: 0.5 + - _ZTestMode: 4 + - _ZWrite: 0 + - _ZoomUvAmount: 0.5 + m_Colors: + - ColorSwapRed: {r: 1, g: 1, b: 1, a: 1} + - _AlphaOutlineColor: {r: 1, g: 1, b: 1, a: 1} + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _ColorChangeNewCol: {r: 1, g: 1, b: 0, a: 1} + - _ColorChangeNewCol2: {r: 1, g: 1, b: 0, a: 1} + - _ColorChangeNewCol3: {r: 1, g: 1, b: 0, a: 1} + - _ColorChangeTarget: {r: 1, g: 0, b: 0, a: 1} + - _ColorChangeTarget2: {r: 1, g: 0, b: 0, a: 1} + - _ColorChangeTarget3: {r: 1, g: 0, b: 0, a: 1} + - _ColorSwapBlue: {r: 1, g: 1, b: 1, a: 1} + - _ColorSwapGreen: {r: 1, g: 1, b: 1, a: 1} + - _ColorSwapRed: {r: 1, g: 1, b: 1, a: 1} + - _FadeBurnColor: {r: 1, g: 1, b: 0, a: 1} + - _GlowColor: {r: 1, g: 1, b: 1, a: 1} + - _GradBotLeftCol: {r: 0, g: 0, b: 1, a: 1} + - _GradBotRightCol: {r: 0, g: 0, b: 1, a: 1} + - _GradTopLeftCol: {r: 1, g: 0, b: 0, a: 1} + - _GradTopRightCol: {r: 1, g: 0, b: 0, a: 1} + - _GreyscaleTintColor: {r: 1, g: 1, b: 1, a: 1} + - _HitEffectColor: {r: 1, g: 1, b: 1, a: 1} + - _HologramStripeColor: {r: 1, g: 1, b: 1, a: 1} + - _InnerOutlineColor: {r: 1, g: 0, b: 0, a: 1} + - _OutlineColor: {r: 1, g: 1, b: 1, a: 1} + - _OverlayColor: {r: 1, g: 1, b: 1, a: 1} + - _ShadowColor: {r: 0, g: 0, b: 0, a: 1} + - _ShineColor: {r: 1, g: 1, b: 1, a: 1} +--- !u!1 &1254156827 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1254156828} + - component: {fileID: 1254156830} + - component: {fileID: 1254156829} + m_Layer: 0 + m_Name: Title + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1254156828 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1254156827} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: -2.51, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 1374997139} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!102 &1254156829 +TextMesh: + serializedVersion: 3 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1254156827} + m_Text: Double Outline + m_OffsetZ: -1.5 + m_CharacterSize: 0.075 + m_LineSpacing: 1 + m_Anchor: 4 + m_Alignment: 0 + m_TabSize: 4 + m_FontSize: 100 + m_FontStyle: 0 + m_RichText: 1 + m_Font: {fileID: 12800000, guid: a4e6a5491519adb45919dc87eff28e55, type: 3} + m_Color: + serializedVersion: 2 + rgba: 4294967295 +--- !u!23 &1254156830 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1254156827} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 10100, guid: 0000000000000000e000000000000000, type: 0} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!21 &1257475202 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: AllIn1SpriteShader/AllIn1SpriteShader + m_Shader: {fileID: 4800000, guid: a36b7719ff0465b42ab1407d67672c5f, type: 3} + m_ShaderKeywords: ETC1_EXTERNAL_ALPHA + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _ColorRampTex: + m_Texture: {fileID: 2800000, guid: 279657edc397ece4b8029c727adf6ddc, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ColorRampTexGradient: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ColorSwapTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DistortTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _FadeBurnTex: + m_Texture: {fileID: 2800000, guid: 32e8df0008bebe746b1681a71c61f31c, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _FadeTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _GlowTex: + 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} + - _OutlineDistortTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OutlineTex: + m_Texture: {fileID: 2800000, guid: 74087f6d03f233e4a8a142fa01f9e5cf, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OverlayTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ShineMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - _Alpha: 1 + - _AlphaCutoffValue: 0.25 + - _AlphaOutlineBlend: 1 + - _AlphaOutlineGlow: 5 + - _AlphaOutlineMinAlpha: 0 + - _AlphaOutlinePower: 1 + - _AlphaRoundThreshold: 0.5 + - _BillboardY: 0 + - _BlurHD: 0 + - _BlurIntensity: 10 + - _Brightness: 0 + - _ChromAberrAlpha: 0.4 + - _ChromAberrAmount: 1 + - _ClipUvDown: 1 + - _ClipUvLeft: 1 + - _ClipUvRight: 1 + - _ClipUvUp: 1 + - _ColorChangeLuminosity: 0 + - _ColorChangeTolerance: 0.25 + - _ColorChangeTolerance2: 0.25 + - _ColorChangeTolerance3: 0.25 + - _ColorRampBlend: 1 + - _ColorRampLuminosity: 0 + - _ColorRampOutline: 0 + - _ColorSwapBlend: 1 + - _ColorSwapBlueLuminosity: 0.5 + - _ColorSwapGreenLuminosity: 0.5 + - _ColorSwapRedLuminosity: 0.5 + - _Contrast: 1 + - _CullingOption: 0 + - _DistortAmount: 0.5 + - _DistortTexXSpeed: 5 + - _DistortTexYSpeed: 5 + - _EditorDrawers: 6 + - _FadeAmount: -0.1 + - _FadeBurnGlow: 2 + - _FadeBurnTransition: 0.075 + - _FadeBurnWidth: 0.025 + - _FishEyeUvAmount: 0.35 + - _FlickerAlpha: 0 + - _FlickerFreq: 0.2 + - _FlickerPercent: 0.05 + - _GhostBlend: 1 + - _GhostColorBoost: 1 + - _GhostTransparency: 0 + - _GlitchAmount: 3 + - _GlitchSize: 1 + - _Glow: 0 + - _GlowGlobal: 1 + - _GlowTexUsed: 0 + - _GradBlend: 1 + - _GradBoostX: 1.2 + - _GradBoostY: 1.2 + - _GradIsRadial: 0 + - _GrassManualAnim: 1 + - _GrassManualToggle: 0 + - _GrassRadialBend: 0.25 + - _GrassSpeed: 2 + - _GrassWind: 20 + - _GreyscaleBlend: 1 + - _GreyscaleLuminosity: 0 + - _GreyscaleOutline: 0 + - _HandDrawnAmount: 10 + - _HandDrawnSpeed: 5 + - _HitEffectBlend: 1 + - _HitEffectGlow: 5 + - _HologramBlend: 1 + - _HologramFlickerAlpha: 0 + - _HologramFlickerFreq: 0.2 + - _HologramFlickerPercent: 0.05 + - _HologramMaxAlpha: 1 + - _HologramMinAlpha: 0 + - _HologramStripesAlpha: 0.4 + - _HologramStripesAmount: 50 + - _HologramStripesFill: 0.4 + - _HologramStripesLuminosity: 1 + - _HologramStripesSpeed: 5 + - _HologramUnmodAmount: 0.4 + - _HsvBright: 1 + - _HsvSaturation: 1 + - _HsvShift: 180 + - _InnerOutlineAlpha: 1 + - _InnerOutlineGlow: 1 + - _InnerOutlineThickness: 1 + - _MaxXUV: 1 + - _MaxYUV: 1 + - _MinXUV: 0 + - _MinYUV: 0 + - _MotionBlurAngle: 0.1 + - _MotionBlurDist: 1.25 + - _MyDstMode: 10 + - _MySrcMode: 5 + - _NegativeAmount: 1 + - _OffsetUvX: 0 + - _OffsetUvY: 0 + - _OnlyInnerOutline: 0 + - _OnlyOutline: 0 + - _Outline8Directions: 0 + - _OutlineAlpha: 1 + - _OutlineDistortAmount: 0.5 + - _OutlineDistortTexXSpeed: 5 + - _OutlineDistortTexYSpeed: 5 + - _OutlineDistortToggle: 0 + - _OutlineGlow: 1.5 + - _OutlineIsPixel: 0 + - _OutlinePixelWidth: 1 + - _OutlineTexGrey: 0 + - _OutlineTexToggle: 0 + - _OutlineTexXSpeed: 10 + - _OutlineTexYSpeed: 0 + - _OutlineWidth: 0.004 + - _OverlayBlend: 1 + - _OverlayGlow: 1 + - _OverlayTextureScrollXSpeed: 0.25 + - _OverlayTextureScrollYSpeed: 0.25 + - _PinchUvAmount: 0.35 + - _PixelateSize: 32 + - _PosterizeGamma: 0.75 + - _PosterizeNumColors: 8 + - _PosterizeOutline: 0 + - _RadialClip: 45 + - _RadialClip2: 45 + - _RadialClipAngle: 90 + - _RadialClipArc1: 45 + - _RadialClipArc2: 0 + - _RadialStartAngle: 90 + - _RandomSeed: 0 + - _RectSize: 1 + - _RotateUvAmount: 0 + - _RoundWaveSpeed: 2 + - _RoundWaveStrength: 0.7 + - _ShadowAlpha: 0.5 + - _ShadowX: 0.1 + - _ShadowY: -0.05 + - _ShakeUvSpeed: 2.5 + - _ShakeUvX: 1.5 + - _ShakeUvY: 1 + - _ShineGlow: 1 + - _ShineLocation: 0.5 + - _ShineRotate: 0 + - _ShineWidth: 0.1 + - _TextureScrollXSpeed: 1 + - _TextureScrollYSpeed: 0 + - _TwistUvAmount: 1 + - _TwistUvPosX: 0.5 + - _TwistUvPosY: 0.5 + - _TwistUvRadius: 0.75 + - _WarpScale: 0.5 + - _WarpSpeed: 8 + - _WarpStrength: 0.025 + - _WaveAmount: 7 + - _WaveSpeed: 10 + - _WaveStrength: 7.5 + - _WaveX: 0 + - _WaveY: 0.5 + - _ZTestMode: 4 + - _ZWrite: 0 + - _ZoomUvAmount: 0.5 + m_Colors: + - ColorSwapRed: {r: 1, g: 1, b: 1, a: 1} + - _AlphaOutlineColor: {r: 1, g: 1, b: 1, a: 1} + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _ColorChangeNewCol: {r: 1, g: 1, b: 0, a: 1} + - _ColorChangeNewCol2: {r: 1, g: 1, b: 0, a: 1} + - _ColorChangeNewCol3: {r: 1, g: 1, b: 0, a: 1} + - _ColorChangeTarget: {r: 1, g: 0, b: 0, a: 1} + - _ColorChangeTarget2: {r: 1, g: 0, b: 0, a: 1} + - _ColorChangeTarget3: {r: 1, g: 0, b: 0, a: 1} + - _ColorSwapBlue: {r: 1, g: 1, b: 1, a: 1} + - _ColorSwapGreen: {r: 1, g: 1, b: 1, a: 1} + - _ColorSwapRed: {r: 1, g: 1, b: 1, a: 1} + - _FadeBurnColor: {r: 1, g: 1, b: 0, a: 1} + - _GlowColor: {r: 1, g: 1, b: 1, a: 1} + - _GradBotLeftCol: {r: 0, g: 0, b: 1, a: 1} + - _GradBotRightCol: {r: 0, g: 0, b: 1, a: 1} + - _GradTopLeftCol: {r: 1, g: 0, b: 0, a: 1} + - _GradTopRightCol: {r: 1, g: 0, b: 0, a: 1} + - _GreyscaleTintColor: {r: 1, g: 1, b: 1, a: 1} + - _HitEffectColor: {r: 1, g: 1, b: 1, a: 1} + - _HologramStripeColor: {r: 1, g: 1, b: 1, a: 1} + - _InnerOutlineColor: {r: 1, g: 0, b: 0, a: 1} + - _OutlineColor: {r: 1, g: 1, b: 1, a: 1} + - _OverlayColor: {r: 1, g: 1, b: 1, a: 1} + - _ShadowColor: {r: 0, g: 0, b: 0, a: 1} + - _ShineColor: {r: 1, g: 1, b: 1, a: 1} +--- !u!1 &1267243996 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1267243997} + - component: {fileID: 1267243999} + - component: {fileID: 1267243998} + m_Layer: 0 + m_Name: Animated + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 0 +--- !u!4 &1267243997 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1267243996} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: -3.57, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 1073566156} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!102 &1267243998 +TextMesh: + serializedVersion: 3 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1267243996} + m_Text: (Has Animation) + m_OffsetZ: -1.5 + m_CharacterSize: 0.075 + m_LineSpacing: 1 + m_Anchor: 4 + m_Alignment: 0 + m_TabSize: 4 + m_FontSize: 100 + m_FontStyle: 0 + m_RichText: 1 + m_Font: {fileID: 12800000, guid: a4e6a5491519adb45919dc87eff28e55, type: 3} + m_Color: + serializedVersion: 2 + rgba: 4294967295 +--- !u!23 &1267243999 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1267243996} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: a4e6a5491519adb45919dc87eff28e55, type: 3} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!1 &1282385916 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1282385917} + - component: {fileID: 1282385919} + - component: {fileID: 1282385918} + m_Layer: 0 + m_Name: Animated + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 0 +--- !u!4 &1282385917 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1282385916} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: -3.57, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 1038353159} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!102 &1282385918 +TextMesh: + serializedVersion: 3 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1282385916} + m_Text: (Texture is Tiled) + m_OffsetZ: -1.5 + m_CharacterSize: 0.075 + m_LineSpacing: 1 + m_Anchor: 4 + m_Alignment: 0 + m_TabSize: 4 + m_FontSize: 100 + m_FontStyle: 0 + m_RichText: 1 + m_Font: {fileID: 12800000, guid: a4e6a5491519adb45919dc87eff28e55, type: 3} + m_Color: + serializedVersion: 2 + rgba: 4294967295 +--- !u!23 &1282385919 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1282385916} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: a4e6a5491519adb45919dc87eff28e55, type: 3} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!21 &1283967498 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: AllIn1SpriteShader/AllIn1SpriteShader + m_Shader: {fileID: 4800000, guid: a36b7719ff0465b42ab1407d67672c5f, type: 3} + m_ShaderKeywords: ETC1_EXTERNAL_ALPHA GLOW_ON GRADIENT_ON HSV_ON OUTBASE8DIR_ON + OUTBASE_ON SHADOW_ON SHINE_ON _OUTLINE8DIRECTIONS_ON + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _ColorRampTex: + m_Texture: {fileID: 2800000, guid: 279657edc397ece4b8029c727adf6ddc, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ColorRampTexGradient: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ColorSwapTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DistortTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _FadeBurnTex: + m_Texture: {fileID: 2800000, guid: 32e8df0008bebe746b1681a71c61f31c, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _FadeTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _GlowTex: + 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} + - _OutlineDistortTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OutlineTex: + m_Texture: {fileID: 2800000, guid: 74087f6d03f233e4a8a142fa01f9e5cf, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OverlayTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ShineMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - _Alpha: 1 + - _AlphaCutoffValue: 0.25 + - _AlphaOutlineBlend: 1 + - _AlphaOutlineGlow: 5 + - _AlphaOutlineMinAlpha: 0 + - _AlphaOutlinePower: 1 + - _AlphaRoundThreshold: 0.5 + - _BillboardY: 0 + - _BlurHD: 0 + - _BlurIntensity: 10 + - _Brightness: 0 + - _ChromAberrAlpha: 0.4 + - _ChromAberrAmount: 1 + - _ClipUvDown: 1 + - _ClipUvLeft: 1 + - _ClipUvRight: 1 + - _ClipUvUp: 1 + - _ColorChangeLuminosity: 0.706 + - _ColorChangeTolerance: 0.25 + - _ColorChangeTolerance2: 0.25 + - _ColorChangeTolerance3: 0.25 + - _ColorRampBlend: 1 + - _ColorRampLuminosity: 0 + - _ColorRampOutline: 0 + - _ColorSwapBlend: 1 + - _ColorSwapBlueLuminosity: 0.5 + - _ColorSwapGreenLuminosity: 0.5 + - _ColorSwapRedLuminosity: 0.5 + - _Contrast: 1 + - _CullingOption: 0 + - _DistortAmount: 0.5 + - _DistortTexXSpeed: 5 + - _DistortTexYSpeed: 5 + - _EditorDrawers: 6 + - _FadeAmount: -0.1 + - _FadeBurnGlow: 2 + - _FadeBurnTransition: 0.075 + - _FadeBurnWidth: 0.025 + - _FishEyeUvAmount: 0.35 + - _FlickerAlpha: 0 + - _FlickerFreq: 0.2 + - _FlickerPercent: 0.05 + - _GhostBlend: 1 + - _GhostColorBoost: 1 + - _GhostTransparency: 0 + - _GlitchAmount: 3 + - _GlitchSize: 1 + - _Glow: 0.8 + - _GlowGlobal: 1 + - _GlowTexUsed: 0 + - _GradBlend: 0.411 + - _GradBoostX: 1.2 + - _GradBoostY: 1.2 + - _GradIsRadial: 0 + - _GrassManualAnim: 1 + - _GrassManualToggle: 0 + - _GrassRadialBend: 0.25 + - _GrassSpeed: 2 + - _GrassWind: 20 + - _GreyscaleBlend: 1 + - _GreyscaleLuminosity: 0 + - _GreyscaleOutline: 0 + - _HandDrawnAmount: 10 + - _HandDrawnSpeed: 5 + - _HitEffectBlend: 1 + - _HitEffectGlow: 5 + - _HologramBlend: 1 + - _HologramFlickerAlpha: 0 + - _HologramFlickerFreq: 0.2 + - _HologramMaxAlpha: 1 + - _HologramMinAlpha: 0 + - _HologramStripesAlpha: 0.4 + - _HologramStripesAmount: 50 + - _HologramStripesFill: 0.4 + - _HologramStripesLuminosity: 1 + - _HologramStripesSpeed: 5 + - _HologramUnmodAmount: 0.4 + - _HsvBright: 1 + - _HsvSaturation: 1 + - _HsvShift: 0 + - _InnerOutlineAlpha: 1 + - _InnerOutlineGlow: 1 + - _InnerOutlineThickness: 1 + - _MaxXUV: 1 + - _MaxYUV: 1 + - _MinXUV: 0 + - _MinYUV: 0 + - _MotionBlurAngle: 0.1 + - _MotionBlurDist: 1.25 + - _MyDstMode: 10 + - _MySrcMode: 5 + - _NegativeAmount: 1 + - _OffsetUvX: 0 + - _OffsetUvY: 0 + - _OnlyInnerOutline: 0 + - _OnlyOutline: 0 + - _Outline8Directions: 1 + - _OutlineAlpha: 1 + - _OutlineDistortAmount: 0.5 + - _OutlineDistortTexXSpeed: 5 + - _OutlineDistortTexYSpeed: 5 + - _OutlineDistortToggle: 0 + - _OutlineGlow: 1.5 + - _OutlineIsPixel: 0 + - _OutlinePixelWidth: 1 + - _OutlineTexGrey: 0 + - _OutlineTexToggle: 0 + - _OutlineTexXSpeed: 10 + - _OutlineTexYSpeed: 0 + - _OutlineWidth: 0.009 + - _OverlayBlend: 1 + - _OverlayGlow: 1 + - _OverlayTextureScrollXSpeed: 0.25 + - _OverlayTextureScrollYSpeed: 0.25 + - _PinchUvAmount: 0.35 + - _PixelateSize: 32 + - _PosterizeGamma: 0.75 + - _PosterizeNumColors: 8 + - _PosterizeOutline: 0 + - _RadialClip: 0 + - _RadialClip2: 45 + - _RadialClipAngle: 90 + - _RadialClipArc1: 45 + - _RadialClipArc2: 0 + - _RadialStartAngle: 90 + - _RandomSeed: 0 + - _RectSize: 1 + - _RotateUvAmount: 0 + - _RoundWaveSpeed: 2 + - _RoundWaveStrength: 0.7 + - _ShadowAlpha: 0.5 + - _ShadowX: 0.055 + - _ShadowY: 0.054 + - _ShakeUvSpeed: 2.5 + - _ShakeUvX: 1.5 + - _ShakeUvY: 1 + - _ShineGlow: 0.5 + - _ShineLocation: 0.481 + - _ShineRotate: 0 + - _ShineWidth: 0.084 + - _TextureScrollXSpeed: 1 + - _TextureScrollYSpeed: 0 + - _TwistUvAmount: 1 + - _TwistUvPosX: 0.5 + - _TwistUvPosY: 0.5 + - _TwistUvRadius: 0.75 + - _WarpScale: 0.5 + - _WarpSpeed: 8 + - _WarpStrength: 0.025 + - _WaveAmount: 7 + - _WaveSpeed: 10 + - _WaveStrength: 7.5 + - _WaveX: 0 + - _WaveY: 0.5 + - _ZTestMode: 4 + - _ZWrite: 0 + - _ZoomUvAmount: 0.5 + m_Colors: + - ColorSwapRed: {r: 1, g: 1, b: 1, a: 1} + - _AlphaOutlineColor: {r: 1, g: 1, b: 1, a: 1} + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _ColorChangeNewCol: {r: 1, g: 1, b: 0, a: 1} + - _ColorChangeNewCol2: {r: 1, g: 1, b: 0, a: 1} + - _ColorChangeNewCol3: {r: 1, g: 1, b: 0, a: 1} + - _ColorChangeTarget: {r: 0.25882354, g: 0.3647059, b: 0.19215688, a: 1} + - _ColorChangeTarget2: {r: 1, g: 0, b: 0, a: 1} + - _ColorChangeTarget3: {r: 1, g: 0, b: 0, a: 1} + - _ColorSwapBlue: {r: 1, g: 1, b: 1, a: 1} + - _ColorSwapGreen: {r: 1, g: 1, b: 1, a: 1} + - _ColorSwapRed: {r: 1, g: 1, b: 1, a: 1} + - _FadeBurnColor: {r: 1, g: 1, b: 0, a: 1} + - _GlowColor: {r: 1, g: 1, b: 1, a: 1} + - _GradBotLeftCol: {r: 0, g: 0, b: 1, a: 1} + - _GradBotRightCol: {r: 0, g: 0, b: 1, a: 1} + - _GradTopLeftCol: {r: 1, g: 0, b: 0, a: 1} + - _GradTopRightCol: {r: 1, g: 0, b: 0, a: 1} + - _GreyscaleTintColor: {r: 1, g: 1, b: 1, a: 1} + - _HitEffectColor: {r: 1, g: 1, b: 1, a: 1} + - _HologramStripeColor: {r: 1, g: 1, b: 1, a: 1} + - _InnerOutlineColor: {r: 1, g: 0, b: 0, a: 1} + - _OutlineColor: {r: 1, g: 1, b: 1, a: 1} + - _OverlayColor: {r: 1, g: 1, b: 1, a: 1} + - _ShadowColor: {r: 0, g: 0, b: 0, a: 1} + - _ShineColor: {r: 1, g: 1, b: 1, a: 1} +--- !u!1 &1286689242 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1286689243} + - component: {fileID: 1286689245} + - component: {fileID: 1286689246} + m_Layer: 0 + m_Name: Hologram + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1286689243 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1286689242} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 230, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 316897175} + - {fileID: 892560183} + m_Father: {fileID: 2036092933} + m_RootOrder: 23 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!212 &1286689245 +SpriteRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1286689242} + m_Enabled: 1 + m_CastShadows: 0 + m_ReceiveShadows: 0 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 72928926} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 0 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_Sprite: {fileID: 21300000, guid: 519dafacd208bb64c83d5124be03b09d, type: 3} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_FlipX: 0 + m_FlipY: 0 + m_DrawMode: 0 + m_Size: {x: 5.12, y: 5.12} + m_AdaptiveModeThreshold: 0.5 + m_SpriteTileMode: 0 + m_WasSpriteAssigned: 1 + m_MaskInteraction: 0 + m_SpriteSortPoint: 0 +--- !u!114 &1286689246 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1286689242} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 98b644315d7a92842b89e04f55c48e02, type: 3} + m_Name: + m_EditorClassIdentifier: +--- !u!1 &1302433541 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1302433542} + - component: {fileID: 1302433544} + - component: {fileID: 1302433543} + m_Layer: 5 + m_Name: Splotch + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &1302433542 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1302433541} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1.2053999, y: 1.066779, z: 1.148} + m_Children: [] + m_Father: {fileID: 564363701} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0.5, y: 1} + m_AnchorMax: {x: 0.5, y: 1} + m_AnchoredPosition: {x: 23, y: -40.450073} + m_SizeDelta: {x: 1288.9, y: 199.09998} + m_Pivot: {x: 0.5, y: 1} +--- !u!114 &1302433543 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1302433541} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 0 + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_Sprite: {fileID: 21300000, guid: 51caeab4d98b55046a9013cc2da7e427, type: 3} + m_Type: 0 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 + m_UseSpriteMesh: 0 + m_PixelsPerUnitMultiplier: 1 +--- !u!222 &1302433544 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1302433541} + m_CullTransparentMesh: 0 +--- !u!1 &1302959053 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1302959054} + - component: {fileID: 1302959056} + - component: {fileID: 1302959055} + m_Layer: 0 + m_Name: Title + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1302959054 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1302959053} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: -2.51, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 786925991} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!102 &1302959055 +TextMesh: + serializedVersion: 3 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1302959053} + m_Text: Fish Eye + m_OffsetZ: -1.5 + m_CharacterSize: 0.075 + m_LineSpacing: 1 + m_Anchor: 4 + m_Alignment: 0 + m_TabSize: 4 + m_FontSize: 100 + m_FontStyle: 0 + m_RichText: 1 + m_Font: {fileID: 12800000, guid: a4e6a5491519adb45919dc87eff28e55, type: 3} + m_Color: + serializedVersion: 2 + rgba: 4294967295 +--- !u!23 &1302959056 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1302959053} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 10100, guid: 0000000000000000e000000000000000, type: 0} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!1 &1308471597 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1308471598} + - component: {fileID: 1308471600} + - component: {fileID: 1308471599} + m_Layer: 0 + m_Name: Title + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1308471598 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1308471597} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: -3.1267126, z: 0} + m_LocalScale: {x: 1.2457023, y: 1.2457023, z: 1.2457023} + m_Children: [] + m_Father: {fileID: 694591670} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!102 &1308471599 +TextMesh: + serializedVersion: 3 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1308471597} + m_Text: Minimalist Soldier + m_OffsetZ: -1.5 + m_CharacterSize: 0.075 + m_LineSpacing: 1 + m_Anchor: 4 + m_Alignment: 0 + m_TabSize: 4 + m_FontSize: 100 + m_FontStyle: 0 + m_RichText: 1 + m_Font: {fileID: 12800000, guid: a4e6a5491519adb45919dc87eff28e55, type: 3} + m_Color: + serializedVersion: 2 + rgba: 4294967295 +--- !u!23 &1308471600 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1308471597} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 10100, guid: 0000000000000000e000000000000000, type: 0} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!1 &1313138819 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1313138820} + - component: {fileID: 1313138823} + - component: {fileID: 1313138822} + m_Layer: 0 + m_Name: Change 1 Color + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1313138820 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1313138819} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 120, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 1641593523} + - {fileID: 941567973} + m_Father: {fileID: 2036092933} + m_RootOrder: 12 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &1313138822 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1313138819} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 98b644315d7a92842b89e04f55c48e02, type: 3} + m_Name: + m_EditorClassIdentifier: +--- !u!212 &1313138823 +SpriteRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1313138819} + m_Enabled: 1 + m_CastShadows: 0 + m_ReceiveShadows: 0 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 1166912798} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 0 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_Sprite: {fileID: 21300000, guid: 519dafacd208bb64c83d5124be03b09d, type: 3} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_FlipX: 0 + m_FlipY: 0 + m_DrawMode: 0 + m_Size: {x: 5.12, y: 5.12} + m_AdaptiveModeThreshold: 0.5 + m_SpriteTileMode: 0 + m_WasSpriteAssigned: 1 + m_MaskInteraction: 0 + m_SpriteSortPoint: 0 +--- !u!21 &1319594099 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: AllIn1SpriteShader/AllIn1SpriteShader + m_Shader: {fileID: 4800000, guid: a36b7719ff0465b42ab1407d67672c5f, type: 3} + m_ShaderKeywords: ETC1_EXTERNAL_ALPHA GLOWTEX_ON GLOW_ON _GLOWTEXUSED_ON + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _ColorRampTex: + m_Texture: {fileID: 2800000, guid: 279657edc397ece4b8029c727adf6ddc, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ColorRampTexGradient: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ColorSwapTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DistortTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _FadeBurnTex: + m_Texture: {fileID: 2800000, guid: 32e8df0008bebe746b1681a71c61f31c, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _FadeTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _GlowTex: + m_Texture: {fileID: 2800000, guid: 8608ef90f91271745a17f7210fe1e7db, type: 3} + 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} + - _OutlineDistortTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OutlineTex: + m_Texture: {fileID: 2800000, guid: 74087f6d03f233e4a8a142fa01f9e5cf, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OverlayTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ShineMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - _Alpha: 1 + - _AlphaCutoffValue: 0.25 + - _AlphaOutlineBlend: 1 + - _AlphaOutlineGlow: 5 + - _AlphaOutlineMinAlpha: 0 + - _AlphaOutlinePower: 1 + - _AlphaRoundThreshold: 0.5 + - _BillboardY: 0 + - _BlurHD: 0 + - _BlurIntensity: 10 + - _Brightness: 0 + - _ChromAberrAlpha: 0.4 + - _ChromAberrAmount: 1 + - _ClipUvDown: 1 + - _ClipUvLeft: 1 + - _ClipUvRight: 1 + - _ClipUvUp: 1 + - _ColorChangeLuminosity: 0 + - _ColorChangeTolerance: 0.25 + - _ColorChangeTolerance2: 0.25 + - _ColorChangeTolerance3: 0.25 + - _ColorRampBlend: 1 + - _ColorRampLuminosity: 0 + - _ColorRampOutline: 0 + - _ColorSwapBlend: 1 + - _ColorSwapBlueLuminosity: 0.5 + - _ColorSwapGreenLuminosity: 0.5 + - _ColorSwapRedLuminosity: 0.5 + - _Contrast: 1 + - _CullingOption: 0 + - _DistortAmount: 0.5 + - _DistortTexXSpeed: 5 + - _DistortTexYSpeed: 5 + - _EditorDrawers: 6 + - _FadeAmount: -0.1 + - _FadeBurnGlow: 2 + - _FadeBurnTransition: 0.075 + - _FadeBurnWidth: 0.025 + - _FishEyeUvAmount: 0.35 + - _FlickerAlpha: 0 + - _FlickerFreq: 0.2 + - _FlickerPercent: 0.05 + - _GhostBlend: 1 + - _GhostColorBoost: 1 + - _GhostTransparency: 0 + - _GlitchAmount: 3 + - _GlitchSize: 1 + - _Glow: 7.5 + - _GlowGlobal: 1 + - _GlowTexUsed: 1 + - _GradBlend: 1 + - _GradBoostX: 1.2 + - _GradBoostY: 1.2 + - _GradIsRadial: 0 + - _GrassManualAnim: 1 + - _GrassManualToggle: 0 + - _GrassRadialBend: 0.25 + - _GrassSpeed: 2 + - _GrassWind: 20 + - _GreyscaleBlend: 1 + - _GreyscaleLuminosity: 0 + - _GreyscaleOutline: 0 + - _HandDrawnAmount: 10 + - _HandDrawnSpeed: 5 + - _HitEffectBlend: 1 + - _HitEffectGlow: 5 + - _HologramBlend: 1 + - _HologramFlickerAlpha: 0 + - _HologramFlickerFreq: 0.2 + - _HologramFlickerPercent: 0.05 + - _HologramMaxAlpha: 1 + - _HologramMinAlpha: 0 + - _HologramStripesAlpha: 0.4 + - _HologramStripesAmount: 50 + - _HologramStripesFill: 0.4 + - _HologramStripesLuminosity: 1 + - _HologramStripesSpeed: 5 + - _HologramUnmodAmount: 0.4 + - _HsvBright: 1 + - _HsvSaturation: 1 + - _HsvShift: 180 + - _InnerOutlineAlpha: 1 + - _InnerOutlineGlow: 1 + - _InnerOutlineThickness: 1 + - _MaxXUV: 1 + - _MaxYUV: 1 + - _MinXUV: 0 + - _MinYUV: 0 + - _MotionBlurAngle: 0.1 + - _MotionBlurDist: 1.25 + - _MyDstMode: 10 + - _MySrcMode: 5 + - _NegativeAmount: 1 + - _OffsetUvX: 0 + - _OffsetUvY: 0 + - _OnlyInnerOutline: 0 + - _OnlyOutline: 0 + - _Outline8Directions: 0 + - _OutlineAlpha: 1 + - _OutlineDistortAmount: 0.5 + - _OutlineDistortTexXSpeed: 5 + - _OutlineDistortTexYSpeed: 5 + - _OutlineDistortToggle: 0 + - _OutlineGlow: 1.5 + - _OutlineIsPixel: 0 + - _OutlinePixelWidth: 1 + - _OutlineTexGrey: 0 + - _OutlineTexToggle: 0 + - _OutlineTexXSpeed: 10 + - _OutlineTexYSpeed: 0 + - _OutlineWidth: 0.004 + - _OverlayBlend: 1 + - _OverlayGlow: 1 + - _OverlayTextureScrollXSpeed: 0.25 + - _OverlayTextureScrollYSpeed: 0.25 + - _PinchUvAmount: 0.35 + - _PixelateSize: 32 + - _PosterizeGamma: 0.75 + - _PosterizeNumColors: 8 + - _PosterizeOutline: 0 + - _RadialClip: 45 + - _RadialClip2: 45 + - _RadialClipAngle: 90 + - _RadialClipArc1: 45 + - _RadialClipArc2: 0 + - _RadialStartAngle: 90 + - _RandomSeed: 0 + - _RectSize: 1 + - _RotateUvAmount: 0 + - _RoundWaveSpeed: 2 + - _RoundWaveStrength: 0.7 + - _ShadowAlpha: 0.5 + - _ShadowX: 0.1 + - _ShadowY: -0.05 + - _ShakeUvSpeed: 2.5 + - _ShakeUvX: 1.5 + - _ShakeUvY: 1 + - _ShineGlow: 1 + - _ShineLocation: 0.5 + - _ShineRotate: 0 + - _ShineWidth: 0.1 + - _TextureScrollXSpeed: 1 + - _TextureScrollYSpeed: 0 + - _TwistUvAmount: 1 + - _TwistUvPosX: 0.5 + - _TwistUvPosY: 0.5 + - _TwistUvRadius: 0.75 + - _WarpScale: 0.5 + - _WarpSpeed: 8 + - _WarpStrength: 0.025 + - _WaveAmount: 7 + - _WaveSpeed: 10 + - _WaveStrength: 7.5 + - _WaveX: 0 + - _WaveY: 0.5 + - _ZTestMode: 4 + - _ZWrite: 0 + - _ZoomUvAmount: 0.5 + m_Colors: + - ColorSwapRed: {r: 1, g: 1, b: 1, a: 1} + - _AlphaOutlineColor: {r: 1, g: 1, b: 1, a: 1} + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _ColorChangeNewCol: {r: 1, g: 1, b: 0, a: 1} + - _ColorChangeNewCol2: {r: 1, g: 1, b: 0, a: 1} + - _ColorChangeNewCol3: {r: 1, g: 1, b: 0, a: 1} + - _ColorChangeTarget: {r: 1, g: 0, b: 0, a: 1} + - _ColorChangeTarget2: {r: 1, g: 0, b: 0, a: 1} + - _ColorChangeTarget3: {r: 1, g: 0, b: 0, a: 1} + - _ColorSwapBlue: {r: 1, g: 1, b: 1, a: 1} + - _ColorSwapGreen: {r: 1, g: 1, b: 1, a: 1} + - _ColorSwapRed: {r: 1, g: 1, b: 1, a: 1} + - _FadeBurnColor: {r: 1, g: 1, b: 0, a: 1} + - _GlowColor: {r: 1, g: 0.58530986, b: 0, a: 1} + - _GradBotLeftCol: {r: 0, g: 0, b: 1, a: 1} + - _GradBotRightCol: {r: 0, g: 0, b: 1, a: 1} + - _GradTopLeftCol: {r: 1, g: 0, b: 0, a: 1} + - _GradTopRightCol: {r: 1, g: 0, b: 0, a: 1} + - _GreyscaleTintColor: {r: 1, g: 1, b: 1, a: 1} + - _HitEffectColor: {r: 1, g: 1, b: 1, a: 1} + - _HologramStripeColor: {r: 1, g: 1, b: 1, a: 1} + - _InnerOutlineColor: {r: 1, g: 0, b: 0, a: 1} + - _OutlineColor: {r: 1, g: 1, b: 1, a: 1} + - _OverlayColor: {r: 1, g: 1, b: 1, a: 1} + - _ShadowColor: {r: 0, g: 0, b: 0, a: 1} + - _ShineColor: {r: 1, g: 1, b: 1, a: 1} +--- !u!1 &1325646927 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1325646928} + - component: {fileID: 1325646930} + - component: {fileID: 1325646929} + m_Layer: 0 + m_Name: Animated + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 0 +--- !u!4 &1325646928 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1325646927} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: -3.57, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 1111461197} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!102 &1325646929 +TextMesh: + serializedVersion: 3 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1325646927} + m_Text: (Has Animation) + m_OffsetZ: -1.5 + m_CharacterSize: 0.075 + m_LineSpacing: 1 + m_Anchor: 4 + m_Alignment: 0 + m_TabSize: 4 + m_FontSize: 100 + m_FontStyle: 0 + m_RichText: 1 + m_Font: {fileID: 12800000, guid: a4e6a5491519adb45919dc87eff28e55, type: 3} + m_Color: + serializedVersion: 2 + rgba: 4294967295 +--- !u!23 &1325646930 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1325646927} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: a4e6a5491519adb45919dc87eff28e55, type: 3} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!1 &1328027727 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1328027728} + - component: {fileID: 1328027730} + - component: {fileID: 1328027729} + m_Layer: 0 + m_Name: Animated + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1328027728 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1328027727} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: -3.57, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 1767383824} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!102 &1328027729 +TextMesh: + serializedVersion: 3 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1328027727} + m_Text: (Has Animation) + m_OffsetZ: -1.5 + m_CharacterSize: 0.075 + m_LineSpacing: 1 + m_Anchor: 4 + m_Alignment: 0 + m_TabSize: 4 + m_FontSize: 100 + m_FontStyle: 0 + m_RichText: 1 + m_Font: {fileID: 12800000, guid: a4e6a5491519adb45919dc87eff28e55, type: 3} + m_Color: + serializedVersion: 2 + rgba: 4294967295 +--- !u!23 &1328027730 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1328027727} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 10100, guid: 0000000000000000e000000000000000, type: 0} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!1 &1329663899 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1329663900} + - component: {fileID: 1329663903} + - component: {fileID: 1329663902} + m_Layer: 0 + m_Name: Poolar Coords + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1329663900 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1329663899} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 140, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 487308175} + - {fileID: 712974876} + m_Father: {fileID: 1351315063} + m_RootOrder: 14 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &1329663902 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1329663899} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 98b644315d7a92842b89e04f55c48e02, type: 3} + m_Name: + m_EditorClassIdentifier: +--- !u!212 &1329663903 +SpriteRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1329663899} + m_Enabled: 1 + m_CastShadows: 0 + m_ReceiveShadows: 0 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 87388692} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 0 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_Sprite: {fileID: 21300000, guid: 519dafacd208bb64c83d5124be03b09d, type: 3} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_FlipX: 0 + m_FlipY: 0 + m_DrawMode: 0 + m_Size: {x: 5.12, y: 5.12} + m_AdaptiveModeThreshold: 0.5 + m_SpriteTileMode: 0 + m_WasSpriteAssigned: 1 + m_MaskInteraction: 0 + m_SpriteSortPoint: 0 +--- !u!21 &1333622421 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: AllIn1SpriteShader/AllIn1SpriteShader + m_Shader: {fileID: 4800000, guid: a36b7719ff0465b42ab1407d67672c5f, type: 3} + m_ShaderKeywords: DISTORT_ON ETC1_EXTERNAL_ALPHA + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _ColorRampTex: + m_Texture: {fileID: 2800000, guid: 279657edc397ece4b8029c727adf6ddc, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ColorRampTexGradient: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ColorSwapTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DistortTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 0.5, y: 0.5} + m_Offset: {x: 0, y: 0} + - _FadeBurnTex: + m_Texture: {fileID: 2800000, guid: 32e8df0008bebe746b1681a71c61f31c, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _FadeTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _GlowTex: + 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} + - _OutlineDistortTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OutlineTex: + m_Texture: {fileID: 2800000, guid: 74087f6d03f233e4a8a142fa01f9e5cf, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OverlayTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ShineMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - _Alpha: 1 + - _AlphaCutoffValue: 0.25 + - _AlphaOutlineBlend: 1 + - _AlphaOutlineGlow: 5 + - _AlphaOutlineMinAlpha: 0 + - _AlphaOutlinePower: 1 + - _AlphaRoundThreshold: 0.5 + - _BillboardY: 0 + - _BlurHD: 0 + - _BlurIntensity: 10 + - _Brightness: 0 + - _ChromAberrAlpha: 0.4 + - _ChromAberrAmount: 1 + - _ClipUvDown: 1 + - _ClipUvLeft: 1 + - _ClipUvRight: 1 + - _ClipUvUp: 1 + - _ColorChangeLuminosity: 0 + - _ColorChangeTolerance: 0.25 + - _ColorChangeTolerance2: 0.25 + - _ColorChangeTolerance3: 0.25 + - _ColorRampBlend: 1 + - _ColorRampLuminosity: 0 + - _ColorRampOutline: 0 + - _ColorSwapBlend: 1 + - _ColorSwapBlueLuminosity: 0.5 + - _ColorSwapGreenLuminosity: 0.5 + - _ColorSwapRedLuminosity: 0.5 + - _Contrast: 1 + - _CullingOption: 0 + - _DistortAmount: 0.34 + - _DistortTexXSpeed: 5 + - _DistortTexYSpeed: 5 + - _EditorDrawers: 6 + - _FadeAmount: -0.1 + - _FadeBurnGlow: 2 + - _FadeBurnTransition: 0.075 + - _FadeBurnWidth: 0.025 + - _FishEyeUvAmount: 0.35 + - _FlickerAlpha: 0 + - _FlickerFreq: 0.2 + - _FlickerPercent: 0.05 + - _GhostBlend: 1 + - _GhostColorBoost: 1 + - _GhostTransparency: 0 + - _GlitchAmount: 3 + - _GlitchSize: 1 + - _Glow: 10 + - _GlowGlobal: 1 + - _GlowTexUsed: 0 + - _GradBlend: 1 + - _GradBoostX: 1.2 + - _GradBoostY: 1.2 + - _GradIsRadial: 0 + - _GrassManualAnim: 1 + - _GrassManualToggle: 0 + - _GrassRadialBend: 0.25 + - _GrassSpeed: 2 + - _GrassWind: 20 + - _GreyscaleBlend: 1 + - _GreyscaleLuminosity: 0 + - _GreyscaleOutline: 0 + - _HandDrawnAmount: 10 + - _HandDrawnSpeed: 5 + - _HitEffectBlend: 1 + - _HitEffectGlow: 5 + - _HologramBlend: 1 + - _HologramFlickerAlpha: 0 + - _HologramFlickerFreq: 0.2 + - _HologramFlickerPercent: 0.05 + - _HologramMaxAlpha: 1 + - _HologramMinAlpha: 0 + - _HologramStripesAlpha: 0.4 + - _HologramStripesAmount: 50 + - _HologramStripesFill: 0.4 + - _HologramStripesLuminosity: 1 + - _HologramStripesSpeed: 5 + - _HologramUnmodAmount: 0.4 + - _HsvBright: 1.03 + - _HsvSaturation: 1.262 + - _HsvShift: 251 + - _InnerOutlineAlpha: 1 + - _InnerOutlineGlow: 1 + - _InnerOutlineThickness: 1 + - _MaxXUV: 1 + - _MaxYUV: 1 + - _MinXUV: 0 + - _MinYUV: 0 + - _MotionBlurAngle: 0.1 + - _MotionBlurDist: 1.25 + - _MyDstMode: 10 + - _MySrcMode: 5 + - _NegativeAmount: 1 + - _OffsetUvX: 0 + - _OffsetUvY: 0 + - _OnlyInnerOutline: 0 + - _OnlyOutline: 0 + - _Outline8Directions: 0 + - _OutlineAlpha: 1 + - _OutlineDistortAmount: 0.5 + - _OutlineDistortTexXSpeed: 5 + - _OutlineDistortTexYSpeed: 5 + - _OutlineDistortToggle: 0 + - _OutlineGlow: 1.5 + - _OutlineIsPixel: 0 + - _OutlinePixelWidth: 1 + - _OutlineTexGrey: 0 + - _OutlineTexToggle: 0 + - _OutlineTexXSpeed: 10 + - _OutlineTexYSpeed: 0 + - _OutlineWidth: 0.004 + - _OverlayBlend: 1 + - _OverlayGlow: 1 + - _OverlayTextureScrollXSpeed: 0.25 + - _OverlayTextureScrollYSpeed: 0.25 + - _PinchUvAmount: 0.35 + - _PixelateSize: 32 + - _PosterizeGamma: 0.75 + - _PosterizeNumColors: 8 + - _PosterizeOutline: 0 + - _RadialClip: 45 + - _RadialClip2: 0 + - _RadialClipAngle: 90 + - _RadialClipArc1: 45 + - _RadialClipArc2: 0 + - _RadialStartAngle: 90 + - _RandomSeed: 0 + - _RectSize: 1 + - _RotateUvAmount: 0 + - _RoundWaveSpeed: 2 + - _RoundWaveStrength: 0.7 + - _ShadowAlpha: 0.5 + - _ShadowX: 0.1 + - _ShadowY: -0.05 + - _ShakeUvSpeed: 2.5 + - _ShakeUvX: 1.5 + - _ShakeUvY: 1 + - _ShineGlow: 1 + - _ShineLocation: 0.5 + - _ShineRotate: 0 + - _ShineWidth: 0.1 + - _TextureScrollXSpeed: 1 + - _TextureScrollYSpeed: 0 + - _TwistUvAmount: 1 + - _TwistUvPosX: 0.5 + - _TwistUvPosY: 0.5 + - _TwistUvRadius: 0.75 + - _WarpScale: 0.5 + - _WarpSpeed: 8 + - _WarpStrength: 0.025 + - _WaveAmount: 7 + - _WaveSpeed: 10 + - _WaveStrength: 7.5 + - _WaveX: 0 + - _WaveY: 0.5 + - _ZTestMode: 4 + - _ZWrite: 0 + - _ZoomUvAmount: 0.5 + m_Colors: + - ColorSwapRed: {r: 1, g: 1, b: 1, a: 1} + - _AlphaOutlineColor: {r: 1, g: 1, b: 1, a: 1} + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _ColorChangeNewCol: {r: 1, g: 1, b: 0, a: 1} + - _ColorChangeNewCol2: {r: 1, g: 1, b: 0, a: 1} + - _ColorChangeNewCol3: {r: 1, g: 1, b: 0, a: 1} + - _ColorChangeTarget: {r: 1, g: 0, b: 0, a: 1} + - _ColorChangeTarget2: {r: 1, g: 0, b: 0, a: 1} + - _ColorChangeTarget3: {r: 1, g: 0, b: 0, a: 1} + - _ColorSwapBlue: {r: 1, g: 1, b: 1, a: 1} + - _ColorSwapGreen: {r: 1, g: 1, b: 1, a: 1} + - _ColorSwapRed: {r: 1, g: 1, b: 1, a: 1} + - _FadeBurnColor: {r: 1, g: 1, b: 0, a: 1} + - _GlowColor: {r: 1, g: 1, b: 1, a: 1} + - _GradBotLeftCol: {r: 0, g: 0, b: 1, a: 1} + - _GradBotRightCol: {r: 0, g: 0, b: 1, a: 1} + - _GradTopLeftCol: {r: 1, g: 0, b: 0, a: 1} + - _GradTopRightCol: {r: 1, g: 0, b: 0, a: 1} + - _GreyscaleTintColor: {r: 1, g: 1, b: 1, a: 1} + - _HitEffectColor: {r: 1, g: 1, b: 1, a: 1} + - _HologramStripeColor: {r: 1, g: 1, b: 1, a: 1} + - _InnerOutlineColor: {r: 1, g: 0, b: 0, a: 1} + - _OutlineColor: {r: 1, g: 1, b: 1, a: 1} + - _OverlayColor: {r: 1, g: 1, b: 1, a: 1} + - _ShadowColor: {r: 0, g: 0, b: 0, a: 1} + - _ShineColor: {r: 1, g: 1, b: 1, a: 1} +--- !u!21 &1349909629 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: AllIn1SpriteShader/AllIn1SpriteShader + m_Shader: {fileID: 4800000, guid: a36b7719ff0465b42ab1407d67672c5f, type: 3} + m_ShaderKeywords: ETC1_EXTERNAL_ALPHA GLOWTEX_ON GLOW_ON GRADIENT_ON OUTBASE8DIR_ON + OUTBASE_ON SHADOW_ON TWISTUV_ON _GLOWTEXUSED_ON _OUTLINE8DIRECTIONS_ON + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _ColorRampTex: + m_Texture: {fileID: 2800000, guid: 285a35f6ccf7b1a44b6c198e96105173, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ColorRampTexGradient: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ColorSwapTex: + m_Texture: {fileID: 2800000, guid: 065da6c7b90ca904dab9cbc6b415fd19, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DistortTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _FadeBurnTex: + m_Texture: {fileID: 2800000, guid: 677cca399782dea41aedc1d292ecb67d, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _FadeTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _GlowTex: + m_Texture: {fileID: 2800000, guid: 8608ef90f91271745a17f7210fe1e7db, type: 3} + 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} + - _OutlineDistortTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OutlineTex: + m_Texture: {fileID: 2800000, guid: 54b37de4aa07caa4797254cf2351058f, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OverlayTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ShineMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - _Alpha: 1 + - _AlphaCutoffValue: 0.25 + - _AlphaOutlineBlend: 1 + - _AlphaOutlineGlow: 5 + - _AlphaOutlineMinAlpha: 0 + - _AlphaOutlinePower: 1 + - _AlphaRoundThreshold: 0.5 + - _BillboardY: 0 + - _BlurHD: 0 + - _BlurIntensity: 10 + - _Brightness: 0 + - _ChromAberrAlpha: 0.4 + - _ChromAberrAmount: 1 + - _ClipUvDown: 0 + - _ClipUvLeft: 0 + - _ClipUvRight: 0 + - _ClipUvUp: 0 + - _ColorChangeLuminosity: 0 + - _ColorChangeTolerance: 0.25 + - _ColorChangeTolerance2: 0.25 + - _ColorChangeTolerance3: 0.25 + - _ColorRampBlend: 1 + - _ColorRampLuminosity: 0 + - _ColorRampOutline: 0 + - _ColorSwapBlend: 1 + - _ColorSwapBlueLuminosity: 0.5 + - _ColorSwapGreenLuminosity: 0.933 + - _ColorSwapRedLuminosity: 0.5 + - _Contrast: 1 + - _CullingOption: 0 + - _DistortAmount: 0.5 + - _DistortTexXSpeed: 5 + - _DistortTexYSpeed: 5 + - _EditorDrawers: 6 + - _FadeAmount: -0.1 + - _FadeBurnGlow: 2 + - _FadeBurnTransition: 0.075 + - _FadeBurnWidth: 0.025 + - _FishEyeUvAmount: 0 + - _FlickerAlpha: 0 + - _FlickerFreq: 0.2 + - _FlickerPercent: 0.05 + - _GhostBlend: 1 + - _GhostColorBoost: 1 + - _GhostTransparency: 0 + - _GlitchAmount: 1.58 + - _GlitchSize: 1 + - _Glow: 18.4 + - _GlowGlobal: 1 + - _GlowTexUsed: 1 + - _GradBlend: 0.193 + - _GradBoostX: 1.2 + - _GradBoostY: 1.2 + - _GradIsRadial: 0 + - _GrassManualAnim: 1 + - _GrassManualToggle: 0 + - _GrassRadialBend: 0.1 + - _GrassSpeed: 2 + - _GrassWind: 20 + - _GreyscaleBlend: 1 + - _GreyscaleLuminosity: 0 + - _GreyscaleOutline: 0 + - _HandDrawnAmount: 10 + - _HandDrawnSpeed: 5 + - _HitEffectBlend: 1 + - _HitEffectGlow: 5 + - _HologramBlend: 1 + - _HologramFlickerAlpha: 0 + - _HologramFlickerFreq: 0.2 + - _HologramMaxAlpha: 1 + - _HologramMinAlpha: 0 + - _HologramStripesAlpha: 0.4 + - _HologramStripesAmount: 50 + - _HologramStripesFill: 0.4 + - _HologramStripesLuminosity: 1 + - _HologramStripesSpeed: 5 + - _HologramUnmodAmount: 0.4 + - _HsvBright: 1 + - _HsvSaturation: 1 + - _HsvShift: 180 + - _InnerOutlineAlpha: 1 + - _InnerOutlineGlow: 1 + - _InnerOutlineThickness: 3 + - _MaxXUV: 1 + - _MaxYUV: 1 + - _MinXUV: 0 + - _MinYUV: 0 + - _MotionBlurAngle: 0.1 + - _MotionBlurDist: 1.25 + - _MyDstMode: 10 + - _MySrcMode: 5 + - _NegativeAmount: 1 + - _OffsetUvX: 0 + - _OffsetUvY: 0 + - _OnlyInnerOutline: 0 + - _OnlyOutline: 0 + - _Outline8Directions: 1 + - _OutlineAlpha: 1 + - _OutlineDistortAmount: 0.5 + - _OutlineDistortTexXSpeed: 5 + - _OutlineDistortTexYSpeed: 5 + - _OutlineDistortToggle: 0 + - _OutlineGlow: 3.2 + - _OutlineIsPixel: 0 + - _OutlinePixelWidth: 1 + - _OutlineTexGrey: 0 + - _OutlineTexToggle: 0 + - _OutlineTexXSpeed: 10 + - _OutlineTexYSpeed: 0 + - _OutlineWidth: 0.0134 + - _OverlayBlend: 1 + - _OverlayGlow: 1 + - _OverlayTextureScrollXSpeed: 0.25 + - _OverlayTextureScrollYSpeed: 0.25 + - _PinchUvAmount: 0 + - _PixelateSize: 32 + - _PosterizeGamma: 0.75 + - _PosterizeNumColors: 8 + - _PosterizeOutline: 0 + - _RadialClip: 45 + - _RadialClip2: 0 + - _RadialClipAngle: 90 + - _RadialClipArc1: 45 + - _RadialClipArc2: 0 + - _RadialStartAngle: 90 + - _RandomSeed: 0 + - _RectSize: 1 + - _RotateUvAmount: 0 + - _RoundWaveSpeed: 2 + - _RoundWaveStrength: 0.7 + - _ShadowAlpha: 0.373 + - _ShadowX: 0.11 + - _ShadowY: 0.014 + - _ShakeUvSpeed: 2.5 + - _ShakeUvX: 1.5 + - _ShakeUvY: 1 + - _ShineGlow: 1 + - _ShineLocation: 0.5 + - _ShineRotate: 0 + - _ShineWidth: 0.1 + - _TextureScrollXSpeed: 1 + - _TextureScrollYSpeed: 0 + - _TwistUvAmount: 1.69 + - _TwistUvPosX: 0.555 + - _TwistUvPosY: 0.531 + - _TwistUvRadius: 0.18 + - _WarpScale: 0.5 + - _WarpSpeed: 8 + - _WarpStrength: 0.025 + - _WaveAmount: 7 + - _WaveSpeed: 10 + - _WaveStrength: 7.5 + - _WaveX: 0 + - _WaveY: 0.5 + - _ZTestMode: 4 + - _ZWrite: 0 + - _ZoomUvAmount: 0.5 + m_Colors: + - ColorSwapRed: {r: 1, g: 1, b: 1, a: 1} + - _AlphaOutlineColor: {r: 1, g: 1, b: 1, a: 1} + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _ColorChangeNewCol: {r: 1, g: 1, b: 0, a: 1} + - _ColorChangeNewCol2: {r: 1, g: 1, b: 0, a: 1} + - _ColorChangeNewCol3: {r: 1, g: 1, b: 0, a: 1} + - _ColorChangeTarget: {r: 1, g: 0, b: 0, a: 1} + - _ColorChangeTarget2: {r: 1, g: 0, b: 0, a: 1} + - _ColorChangeTarget3: {r: 1, g: 0, b: 0, a: 1} + - _ColorSwapBlue: {r: 0.043704987, g: 1, b: 0, a: 1} + - _ColorSwapGreen: {r: 1, g: 0.36473382, b: 0, a: 1} + - _ColorSwapRed: {r: 1, g: 1, b: 1, a: 1} + - _FadeBurnColor: {r: 1, g: 1, b: 0, a: 1} + - _GlowColor: {r: 1, g: 0.017440448, b: 0, a: 1} + - _GradBotLeftCol: {r: 0, g: 0, b: 1, a: 1} + - _GradBotRightCol: {r: 0, g: 0, b: 1, a: 1} + - _GradTopLeftCol: {r: 1, g: 0, b: 0, a: 1} + - _GradTopRightCol: {r: 1, g: 0, b: 0, a: 1} + - _GreyscaleTintColor: {r: 1, g: 1, b: 1, a: 1} + - _HitEffectColor: {r: 1, g: 1, b: 1, a: 1} + - _HologramStripeColor: {r: 1, g: 1, b: 1, a: 1} + - _InnerOutlineColor: {r: 1, g: 0.3975923, b: 0, a: 1} + - _OutlineColor: {r: 1, g: 0.5795412, b: 0.1273585, a: 1} + - _OverlayColor: {r: 1, g: 1, b: 1, a: 1} + - _ShadowColor: {r: 0, g: 0, b: 0, a: 1} + - _ShineColor: {r: 1, g: 1, b: 1, a: 1} +--- !u!1 &1350115730 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1350115731} + - component: {fileID: 1350115734} + - component: {fileID: 1350115733} + m_Layer: 0 + m_Name: Evil Marine + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1350115731 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1350115730} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 30, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 601434483} + - {fileID: 789390132} + m_Father: {fileID: 1563905016} + m_RootOrder: 3 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &1350115733 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1350115730} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 98b644315d7a92842b89e04f55c48e02, type: 3} + m_Name: + m_EditorClassIdentifier: +--- !u!212 &1350115734 +SpriteRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1350115730} + m_Enabled: 1 + m_CastShadows: 0 + m_ReceiveShadows: 0 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 883004836} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 0 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_Sprite: {fileID: 21300000, guid: 519dafacd208bb64c83d5124be03b09d, type: 3} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_FlipX: 0 + m_FlipY: 0 + m_DrawMode: 0 + m_Size: {x: 5.12, y: 5.12} + m_AdaptiveModeThreshold: 0.5 + m_SpriteTileMode: 0 + m_WasSpriteAssigned: 1 + m_MaskInteraction: 0 + m_SpriteSortPoint: 0 +--- !u!1 &1351315061 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1351315063} + - component: {fileID: 1351315062} + - component: {fileID: 1351315064} + m_Layer: 0 + m_Name: 2.UV Effefcts + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!114 &1351315062 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1351315061} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 6972382efdee4c642812251660f0c4bb, type: 3} + m_Name: + m_EditorClassIdentifier: + radius: 25 + rotateSpeed: 10 +--- !u!4 &1351315063 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1351315061} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: -15, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 56751283} + - {fileID: 1778749804} + - {fileID: 361311995} + - {fileID: 1554650441} + - {fileID: 166039413} + - {fileID: 1901854650} + - {fileID: 1050471976} + - {fileID: 540549269} + - {fileID: 443772011} + - {fileID: 1986728942} + - {fileID: 972134371} + - {fileID: 1358020792} + - {fileID: 1119325822} + - {fileID: 2082220742} + - {fileID: 1329663900} + - {fileID: 786925991} + - {fileID: 1111461197} + - {fileID: 1227823621} + m_Father: {fileID: 732186310} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &1351315064 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1351315061} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 681095680e77fad40a6dd907b8ba358b, type: 3} + m_Name: + m_EditorClassIdentifier: + paddingX: 10 +--- !u!1 &1355901850 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1355901851} + - component: {fileID: 1355901853} + - component: {fileID: 1355901852} + m_Layer: 0 + m_Name: Title + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1355901851 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1355901850} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: -2.51, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 1434614528} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!102 &1355901852 +TextMesh: + serializedVersion: 3 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1355901850} + m_Text: Negative + m_OffsetZ: -1.5 + m_CharacterSize: 0.075 + m_LineSpacing: 1 + m_Anchor: 4 + m_Alignment: 0 + m_TabSize: 4 + m_FontSize: 100 + m_FontStyle: 0 + m_RichText: 1 + m_Font: {fileID: 12800000, guid: a4e6a5491519adb45919dc87eff28e55, type: 3} + m_Color: + serializedVersion: 2 + rgba: 4294967295 +--- !u!23 &1355901853 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1355901850} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 10100, guid: 0000000000000000e000000000000000, type: 0} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!1 &1356966096 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1356966097} + - component: {fileID: 1356966099} + - component: {fileID: 1356966098} + m_Layer: 0 + m_Name: Animated + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 0 +--- !u!4 &1356966097 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1356966096} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: -3.57, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 4825911116503289154} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!102 &1356966098 +TextMesh: + serializedVersion: 3 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1356966096} + m_Text: (Has Animation) + m_OffsetZ: -1.5 + m_CharacterSize: 0.075 + m_LineSpacing: 1 + m_Anchor: 4 + m_Alignment: 0 + m_TabSize: 4 + m_FontSize: 100 + m_FontStyle: 0 + m_RichText: 1 + m_Font: {fileID: 12800000, guid: a4e6a5491519adb45919dc87eff28e55, type: 3} + m_Color: + serializedVersion: 2 + rgba: 4294967295 +--- !u!23 &1356966099 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1356966096} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: a4e6a5491519adb45919dc87eff28e55, type: 3} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!1 &1357243699 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1357243700} + - component: {fileID: 1357243702} + - component: {fileID: 1357243701} + m_Layer: 0 + m_Name: Title + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1357243700 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1357243699} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: -3.1267126, z: 0} + m_LocalScale: {x: 1.2457023, y: 1.2457023, z: 1.2457023} + m_Children: [] + m_Father: {fileID: 944684573} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!102 &1357243701 +TextMesh: + serializedVersion: 3 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1357243699} + m_Text: Posterize + m_OffsetZ: -1.5 + m_CharacterSize: 0.075 + m_LineSpacing: 1 + m_Anchor: 4 + m_Alignment: 0 + m_TabSize: 4 + m_FontSize: 100 + m_FontStyle: 0 + m_RichText: 1 + m_Font: {fileID: 12800000, guid: a4e6a5491519adb45919dc87eff28e55, type: 3} + m_Color: + serializedVersion: 2 + rgba: 4294967295 +--- !u!23 &1357243702 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1357243699} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 10100, guid: 0000000000000000e000000000000000, type: 0} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!1 &1358020791 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1358020792} + - component: {fileID: 1358020795} + - component: {fileID: 1358020794} + m_Layer: 0 + m_Name: Warp + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1358020792 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1358020791} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 110, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 998349594} + - {fileID: 816448199} + m_Father: {fileID: 1351315063} + m_RootOrder: 11 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &1358020794 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1358020791} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 98b644315d7a92842b89e04f55c48e02, type: 3} + m_Name: + m_EditorClassIdentifier: +--- !u!212 &1358020795 +SpriteRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1358020791} + m_Enabled: 1 + m_CastShadows: 0 + m_ReceiveShadows: 0 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 1769422912} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 0 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_Sprite: {fileID: 21300000, guid: 519dafacd208bb64c83d5124be03b09d, type: 3} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_FlipX: 0 + m_FlipY: 0 + m_DrawMode: 0 + m_Size: {x: 5.12, y: 5.12} + m_AdaptiveModeThreshold: 0.5 + m_SpriteTileMode: 0 + m_WasSpriteAssigned: 1 + m_MaskInteraction: 0 + m_SpriteSortPoint: 0 +--- !u!21 &1363957141 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: AllIn1SpriteShader/AllIn1SpriteShader + m_Shader: {fileID: 4800000, guid: a36b7719ff0465b42ab1407d67672c5f, type: 3} + m_ShaderKeywords: CHROMABERR_ON DOODLE_ON ETC1_EXTERNAL_ALPHA FLICKER_ON GLITCH_ON + GLOW_ON GREYSCALE_ON HOLOGRAM_ON OUTBASE8DIR_ON OUTBASE_ON _OUTLINE8DIRECTIONS_ON + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _ColorRampTex: + m_Texture: {fileID: 2800000, guid: 279657edc397ece4b8029c727adf6ddc, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ColorRampTexGradient: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ColorSwapTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DistortTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _FadeBurnTex: + m_Texture: {fileID: 2800000, guid: 32e8df0008bebe746b1681a71c61f31c, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _FadeTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _GlowTex: + 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} + - _OutlineDistortTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OutlineTex: + m_Texture: {fileID: 2800000, guid: 74087f6d03f233e4a8a142fa01f9e5cf, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OverlayTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ShineMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - _Alpha: 1 + - _AlphaCutoffValue: 0.25 + - _AlphaOutlineBlend: 1 + - _AlphaOutlineGlow: 5 + - _AlphaOutlineMinAlpha: 0 + - _AlphaOutlinePower: 1 + - _AlphaRoundThreshold: 0.5 + - _BillboardY: 0 + - _BlurHD: 0 + - _BlurIntensity: 10 + - _Brightness: 0 + - _ChromAberrAlpha: 0.356 + - _ChromAberrAmount: 0.366 + - _ClipUvDown: 1 + - _ClipUvLeft: 1 + - _ClipUvRight: 1 + - _ClipUvUp: 1 + - _ColorChangeLuminosity: 0 + - _ColorChangeTolerance: 0.25 + - _ColorChangeTolerance2: 0.25 + - _ColorChangeTolerance3: 0.25 + - _ColorRampBlend: 1 + - _ColorRampLuminosity: 0 + - _ColorRampOutline: 0 + - _ColorSwapBlend: 1 + - _ColorSwapBlueLuminosity: 0.5 + - _ColorSwapGreenLuminosity: 0.5 + - _ColorSwapRedLuminosity: 0.5 + - _Contrast: 1 + - _CullingOption: 0 + - _DistortAmount: 0.5 + - _DistortTexXSpeed: 5 + - _DistortTexYSpeed: 5 + - _EditorDrawers: 6 + - _FadeAmount: -0.1 + - _FadeBurnGlow: 2 + - _FadeBurnTransition: 0.075 + - _FadeBurnWidth: 0.025 + - _FishEyeUvAmount: 0 + - _FlickerAlpha: 0.4 + - _FlickerFreq: 0.2 + - _FlickerPercent: 0.1 + - _GhostBlend: 1 + - _GhostColorBoost: 1 + - _GhostTransparency: 0 + - _GlitchAmount: 6 + - _GlitchSize: 1.22 + - _Glow: 5.2 + - _GlowGlobal: 1 + - _GlowTexUsed: 0 + - _GradBlend: 1 + - _GradBoostX: 1.2 + - _GradBoostY: 1.2 + - _GradIsRadial: 0 + - _GrassManualAnim: 1 + - _GrassManualToggle: 0 + - _GrassRadialBend: 0.25 + - _GrassSpeed: 2 + - _GrassWind: 20 + - _GreyscaleBlend: 1 + - _GreyscaleLuminosity: 0 + - _GreyscaleOutline: 0 + - _HandDrawnAmount: 7.08 + - _HandDrawnSpeed: 5 + - _HitEffectBlend: 1 + - _HitEffectGlow: 5 + - _HologramBlend: 1 + - _HologramFlickerAlpha: 0 + - _HologramFlickerFreq: 0.2 + - _HologramFlickerPercent: 0.05 + - _HologramMaxAlpha: 2 + - _HologramMinAlpha: 0.167 + - _HologramStripesAlpha: 0.362 + - _HologramStripesAmount: 0.088 + - _HologramStripesFill: 0.334 + - _HologramStripesLuminosity: 1.26 + - _HologramStripesSpeed: 5 + - _HologramUnmodAmount: 0 + - _HsvBright: 1 + - _HsvSaturation: 1 + - _HsvShift: 180 + - _InnerOutlineAlpha: 1 + - _InnerOutlineGlow: 1 + - _InnerOutlineThickness: 1 + - _MaxXUV: 1 + - _MaxYUV: 1 + - _MinXUV: 0 + - _MinYUV: 0 + - _MotionBlurAngle: 0.1 + - _MotionBlurDist: 1.25 + - _MyDstMode: 10 + - _MySrcMode: 5 + - _NegativeAmount: 1 + - _OffsetUvX: 0 + - _OffsetUvY: 0 + - _OnlyInnerOutline: 0 + - _OnlyOutline: 0 + - _Outline8Directions: 1 + - _OutlineAlpha: 1 + - _OutlineDistortAmount: 0.5 + - _OutlineDistortTexXSpeed: 5 + - _OutlineDistortTexYSpeed: 5 + - _OutlineDistortToggle: 0 + - _OutlineGlow: 1 + - _OutlineIsPixel: 0 + - _OutlinePixelWidth: 1 + - _OutlineTexGrey: 0 + - _OutlineTexToggle: 0 + - _OutlineTexXSpeed: 10 + - _OutlineTexYSpeed: 0 + - _OutlineWidth: 0.03 + - _OverlayBlend: 1 + - _OverlayGlow: 1 + - _OverlayTextureScrollXSpeed: 0.25 + - _OverlayTextureScrollYSpeed: 0.25 + - _PinchUvAmount: 0.102 + - _PixelateSize: 32 + - _PosterizeGamma: 0.75 + - _PosterizeNumColors: 8 + - _PosterizeOutline: 0 + - _RadialClip: 0 + - _RadialClip2: 45 + - _RadialClipAngle: 90 + - _RadialClipArc1: 45 + - _RadialClipArc2: 0 + - _RadialStartAngle: 90 + - _RandomSeed: 0 + - _RectSize: 1 + - _RotateUvAmount: 0 + - _RoundWaveSpeed: 2 + - _RoundWaveStrength: 0.7 + - _ShadowAlpha: 0.5 + - _ShadowX: 0.1 + - _ShadowY: -0.05 + - _ShakeUvSpeed: 2.5 + - _ShakeUvX: 1.5 + - _ShakeUvY: 1 + - _ShineGlow: 1 + - _ShineLocation: 0.5 + - _ShineRotate: 0 + - _ShineWidth: 0.1 + - _TextureScrollXSpeed: 1 + - _TextureScrollYSpeed: 0 + - _TwistUvAmount: 1 + - _TwistUvPosX: 0.5 + - _TwistUvPosY: 0.5 + - _TwistUvRadius: 0.75 + - _WarpScale: 0.5 + - _WarpSpeed: 8 + - _WarpStrength: 0.025 + - _WaveAmount: 7 + - _WaveSpeed: 10 + - _WaveStrength: 7.5 + - _WaveX: 0 + - _WaveY: 0.5 + - _ZTestMode: 4 + - _ZWrite: 0 + - _ZoomUvAmount: 0.5 + m_Colors: + - ColorSwapRed: {r: 1, g: 1, b: 1, a: 1} + - _AlphaOutlineColor: {r: 1, g: 1, b: 1, a: 1} + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _ColorChangeNewCol: {r: 1, g: 1, b: 0, a: 1} + - _ColorChangeNewCol2: {r: 1, g: 1, b: 0, a: 1} + - _ColorChangeNewCol3: {r: 1, g: 1, b: 0, a: 1} + - _ColorChangeTarget: {r: 1, g: 0, b: 0, a: 1} + - _ColorChangeTarget2: {r: 1, g: 0, b: 0, a: 1} + - _ColorChangeTarget3: {r: 1, g: 0, b: 0, a: 1} + - _ColorSwapBlue: {r: 1, g: 1, b: 1, a: 1} + - _ColorSwapGreen: {r: 1, g: 1, b: 1, a: 1} + - _ColorSwapRed: {r: 1, g: 1, b: 1, a: 1} + - _FadeBurnColor: {r: 1, g: 1, b: 0, a: 1} + - _GlowColor: {r: 0, g: 0.09171247, b: 0.6698113, a: 1} + - _GradBotLeftCol: {r: 0, g: 0, b: 1, a: 1} + - _GradBotRightCol: {r: 0, g: 0, b: 1, a: 1} + - _GradTopLeftCol: {r: 1, g: 0, b: 0, a: 1} + - _GradTopRightCol: {r: 1, g: 0, b: 0, a: 1} + - _GreyscaleTintColor: {r: 0.4433962, g: 0.4433962, b: 0.4433962, a: 1} + - _HitEffectColor: {r: 1, g: 1, b: 1, a: 1} + - _HologramStripeColor: {r: 0, g: 0.2841599, b: 0.8490566, a: 1} + - _InnerOutlineColor: {r: 1, g: 0, b: 0, a: 1} + - _OutlineColor: {r: 0, g: 0.43268147, b: 0.67058825, a: 1} + - _OverlayColor: {r: 1, g: 1, b: 1, a: 1} + - _ShadowColor: {r: 0, g: 0, b: 0, a: 1} + - _ShineColor: {r: 1, g: 1, b: 1, a: 1} +--- !u!1 &1374997138 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1374997139} + - component: {fileID: 1374997143} + - component: {fileID: 1374997142} + m_Layer: 0 + m_Name: DoubleOutline + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1374997139 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1374997138} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 80, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 1254156828} + - {fileID: 298228099} + m_Father: {fileID: 1563905016} + m_RootOrder: 8 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &1374997142 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1374997138} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 98b644315d7a92842b89e04f55c48e02, type: 3} + m_Name: + m_EditorClassIdentifier: +--- !u!212 &1374997143 +SpriteRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1374997138} + m_Enabled: 1 + m_CastShadows: 0 + m_ReceiveShadows: 0 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 1078024312} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 0 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_Sprite: {fileID: 21300000, guid: 519dafacd208bb64c83d5124be03b09d, type: 3} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_FlipX: 0 + m_FlipY: 0 + m_DrawMode: 0 + m_Size: {x: 5.12, y: 5.12} + m_AdaptiveModeThreshold: 0.5 + m_SpriteTileMode: 0 + m_WasSpriteAssigned: 1 + m_MaskInteraction: 0 + m_SpriteSortPoint: 0 +--- !u!21 &1377307553 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: AllIn1SpriteShader/AllIn1SpriteShader + m_Shader: {fileID: 4800000, guid: a36b7719ff0465b42ab1407d67672c5f, type: 3} + m_ShaderKeywords: CHROMABERR_ON ETC1_EXTERNAL_ALPHA + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _ColorRampTex: + m_Texture: {fileID: 2800000, guid: 279657edc397ece4b8029c727adf6ddc, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ColorRampTexGradient: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ColorSwapTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DistortTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _FadeBurnTex: + m_Texture: {fileID: 2800000, guid: 32e8df0008bebe746b1681a71c61f31c, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _FadeTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _GlowTex: + 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} + - _OutlineDistortTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OutlineTex: + m_Texture: {fileID: 2800000, guid: 74087f6d03f233e4a8a142fa01f9e5cf, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OverlayTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ShineMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - _Alpha: 1 + - _AlphaCutoffValue: 0.25 + - _AlphaOutlineBlend: 1 + - _AlphaOutlineGlow: 5 + - _AlphaOutlineMinAlpha: 0 + - _AlphaOutlinePower: 1 + - _AlphaRoundThreshold: 0.5 + - _BillboardY: 0 + - _BlurHD: 0 + - _BlurIntensity: 10 + - _Brightness: 0 + - _ChromAberrAlpha: 0.259 + - _ChromAberrAmount: 0.504 + - _ClipUvDown: 1 + - _ClipUvLeft: 1 + - _ClipUvRight: 1 + - _ClipUvUp: 1 + - _ColorChangeLuminosity: 0 + - _ColorChangeTolerance: 0.25 + - _ColorChangeTolerance2: 0.25 + - _ColorChangeTolerance3: 0.25 + - _ColorRampBlend: 1 + - _ColorRampLuminosity: 0 + - _ColorRampOutline: 0 + - _ColorSwapBlend: 1 + - _ColorSwapBlueLuminosity: 0.5 + - _ColorSwapGreenLuminosity: 0.5 + - _ColorSwapRedLuminosity: 0.5 + - _Contrast: 1 + - _CullingOption: 0 + - _DistortAmount: 0.5 + - _DistortTexXSpeed: 5 + - _DistortTexYSpeed: 5 + - _EditorDrawers: 6 + - _FadeAmount: -0.1 + - _FadeBurnGlow: 2 + - _FadeBurnTransition: 0.075 + - _FadeBurnWidth: 0.025 + - _FishEyeUvAmount: 0.35 + - _FlickerAlpha: 0 + - _FlickerFreq: 0.2 + - _FlickerPercent: 0.05 + - _GhostBlend: 1 + - _GhostColorBoost: 1 + - _GhostTransparency: 0 + - _GlitchAmount: 3 + - _GlitchSize: 1 + - _Glow: 10 + - _GlowGlobal: 1 + - _GlowTexUsed: 0 + - _GradBlend: 1 + - _GradBoostX: 1.2 + - _GradBoostY: 1.2 + - _GradIsRadial: 0 + - _GrassManualAnim: 1 + - _GrassManualToggle: 0 + - _GrassRadialBend: 0.1 + - _GrassSpeed: 2 + - _GrassWind: 20 + - _GreyscaleBlend: 1 + - _GreyscaleLuminosity: 0 + - _GreyscaleOutline: 0 + - _HandDrawnAmount: 10 + - _HandDrawnSpeed: 5 + - _HitEffectBlend: 1 + - _HitEffectGlow: 5 + - _HologramBlend: 1 + - _HologramFlickerAlpha: 0 + - _HologramFlickerFreq: 0.2 + - _HologramFlickerPercent: 0.05 + - _HologramMaxAlpha: 1 + - _HologramMinAlpha: 0 + - _HologramStripesAlpha: 0.4 + - _HologramStripesAmount: 50 + - _HologramStripesFill: 0.4 + - _HologramStripesLuminosity: 1 + - _HologramStripesSpeed: 5 + - _HologramUnmodAmount: 0.4 + - _HsvBright: 1 + - _HsvSaturation: 1 + - _HsvShift: 180 + - _InnerOutlineAlpha: 1 + - _InnerOutlineGlow: 1 + - _InnerOutlineThickness: 1 + - _MaxXUV: 1 + - _MaxYUV: 1 + - _MinXUV: 0 + - _MinYUV: 0 + - _MotionBlurAngle: 0.1 + - _MotionBlurDist: 1.25 + - _MyDstMode: 10 + - _MySrcMode: 5 + - _NegativeAmount: 1 + - _OffsetUvX: 0 + - _OffsetUvY: 0 + - _OnlyInnerOutline: 0 + - _OnlyOutline: 0 + - _Outline8Directions: 0 + - _OutlineAlpha: 1 + - _OutlineDistortAmount: 0.5 + - _OutlineDistortTexXSpeed: 5 + - _OutlineDistortTexYSpeed: 5 + - _OutlineDistortToggle: 0 + - _OutlineGlow: 1.5 + - _OutlineIsPixel: 0 + - _OutlinePixelWidth: 1 + - _OutlineTexGrey: 0 + - _OutlineTexToggle: 0 + - _OutlineTexXSpeed: 10 + - _OutlineTexYSpeed: 0 + - _OutlineWidth: 0.004 + - _OverlayBlend: 1 + - _OverlayGlow: 1 + - _OverlayTextureScrollXSpeed: 0.25 + - _OverlayTextureScrollYSpeed: 0.25 + - _PinchUvAmount: 0.35 + - _PixelateSize: 32 + - _PosterizeGamma: 0.75 + - _PosterizeNumColors: 8 + - _PosterizeOutline: 0 + - _RadialClip: 45 + - _RadialClip2: 0 + - _RadialClipAngle: 90 + - _RadialClipArc1: 45 + - _RadialClipArc2: 0 + - _RadialStartAngle: 90 + - _RandomSeed: 0 + - _RectSize: 1 + - _RotateUvAmount: 0 + - _RoundWaveSpeed: 2 + - _RoundWaveStrength: 0.7 + - _ShadowAlpha: 0.5 + - _ShadowX: 0.1 + - _ShadowY: -0.05 + - _ShakeUvSpeed: 2.5 + - _ShakeUvX: 1.5 + - _ShakeUvY: 1 + - _ShineGlow: 1 + - _ShineLocation: 0.5 + - _ShineRotate: 0 + - _ShineWidth: 0.1 + - _TextureScrollXSpeed: 1 + - _TextureScrollYSpeed: 0 + - _TwistUvAmount: 1 + - _TwistUvPosX: 0.5 + - _TwistUvPosY: 0.5 + - _TwistUvRadius: 0.75 + - _WarpScale: 0.5 + - _WarpSpeed: 8 + - _WarpStrength: 0.025 + - _WaveAmount: 7 + - _WaveSpeed: 10 + - _WaveStrength: 7.5 + - _WaveX: 0 + - _WaveY: 0.5 + - _ZTestMode: 4 + - _ZWrite: 0 + - _ZoomUvAmount: 0.5 + m_Colors: + - ColorSwapRed: {r: 1, g: 1, b: 1, a: 1} + - _AlphaOutlineColor: {r: 1, g: 1, b: 1, a: 1} + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _ColorChangeNewCol: {r: 1, g: 1, b: 0, a: 1} + - _ColorChangeNewCol2: {r: 1, g: 1, b: 0, a: 1} + - _ColorChangeNewCol3: {r: 1, g: 1, b: 0, a: 1} + - _ColorChangeTarget: {r: 1, g: 0, b: 0, a: 1} + - _ColorChangeTarget2: {r: 1, g: 0, b: 0, a: 1} + - _ColorChangeTarget3: {r: 1, g: 0, b: 0, a: 1} + - _ColorSwapBlue: {r: 1, g: 1, b: 1, a: 1} + - _ColorSwapGreen: {r: 1, g: 1, b: 1, a: 1} + - _ColorSwapRed: {r: 1, g: 1, b: 1, a: 1} + - _FadeBurnColor: {r: 1, g: 1, b: 0, a: 1} + - _GlowColor: {r: 1, g: 1, b: 1, a: 1} + - _GradBotLeftCol: {r: 0, g: 0, b: 1, a: 1} + - _GradBotRightCol: {r: 0, g: 0, b: 1, a: 1} + - _GradTopLeftCol: {r: 1, g: 0, b: 0, a: 1} + - _GradTopRightCol: {r: 1, g: 0, b: 0, a: 1} + - _GreyscaleTintColor: {r: 1, g: 1, b: 1, a: 1} + - _HitEffectColor: {r: 1, g: 1, b: 1, a: 1} + - _HologramStripeColor: {r: 1, g: 1, b: 1, a: 1} + - _InnerOutlineColor: {r: 1, g: 0, b: 0, a: 1} + - _OutlineColor: {r: 1, g: 1, b: 1, a: 1} + - _OverlayColor: {r: 1, g: 1, b: 1, a: 1} + - _ShadowColor: {r: 0, g: 0, b: 0, a: 1} + - _ShineColor: {r: 1, g: 1, b: 1, a: 1} +--- !u!21 &1399293758 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: AllIn1SpriteShader/AllIn1SpriteShader + m_Shader: {fileID: 4800000, guid: a36b7719ff0465b42ab1407d67672c5f, type: 3} + m_ShaderKeywords: COLORRAMP_ON ETC1_EXTERNAL_ALPHA OUTBASE8DIR_ON OUTBASE_ON TEXTURESCROLL_ON + _OUTLINE8DIRECTIONS_ON + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _ColorRampTex: + m_Texture: {fileID: 2800000, guid: 279657edc397ece4b8029c727adf6ddc, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ColorRampTexGradient: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ColorSwapTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DistortTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _FadeBurnTex: + m_Texture: {fileID: 2800000, guid: 32e8df0008bebe746b1681a71c61f31c, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _FadeTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _GlowTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MainTex: + m_Texture: {fileID: 0} + m_Scale: {x: 4, y: 4} + m_Offset: {x: 0, y: 0} + - _OutlineDistortTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OutlineTex: + m_Texture: {fileID: 2800000, guid: 74087f6d03f233e4a8a142fa01f9e5cf, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OverlayTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ShineMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - _Alpha: 1 + - _AlphaCutoffValue: 0.25 + - _AlphaOutlineBlend: 1 + - _AlphaOutlineGlow: 5 + - _AlphaOutlineMinAlpha: 0 + - _AlphaOutlinePower: 1 + - _AlphaRoundThreshold: 0.5 + - _BillboardY: 0 + - _BlurHD: 0 + - _BlurIntensity: 10 + - _Brightness: 0 + - _ChromAberrAlpha: 0.4 + - _ChromAberrAmount: 1 + - _ClipUvDown: 1 + - _ClipUvLeft: 1 + - _ClipUvRight: 1 + - _ClipUvUp: 1 + - _ColorChangeLuminosity: 0 + - _ColorChangeTolerance: 0.25 + - _ColorChangeTolerance2: 0.25 + - _ColorChangeTolerance3: 0.25 + - _ColorRampBlend: 1 + - _ColorRampLuminosity: 0 + - _ColorRampOutline: 0 + - _ColorSwapBlend: 1 + - _ColorSwapBlueLuminosity: 0.5 + - _ColorSwapGreenLuminosity: 0.5 + - _ColorSwapRedLuminosity: 0.5 + - _Contrast: 1 + - _CullingOption: 0 + - _DistortAmount: 0.5 + - _DistortTexXSpeed: 5 + - _DistortTexYSpeed: 5 + - _EditorDrawers: 6 + - _FadeAmount: -0.1 + - _FadeBurnGlow: 2 + - _FadeBurnTransition: 0.075 + - _FadeBurnWidth: 0.025 + - _FishEyeUvAmount: 0.35 + - _FlickerAlpha: 0 + - _FlickerFreq: 0.2 + - _FlickerPercent: 0.05 + - _GhostBlend: 1 + - _GhostColorBoost: 1 + - _GhostTransparency: 0 + - _GlitchAmount: 3 + - _GlitchSize: 1 + - _Glow: 10 + - _GlowGlobal: 1 + - _GlowTexUsed: 0 + - _GradBlend: 1 + - _GradBoostX: 1.2 + - _GradBoostY: 1.2 + - _GradIsRadial: 0 + - _GrassManualAnim: 1 + - _GrassManualToggle: 0 + - _GrassRadialBend: 0.25 + - _GrassSpeed: 2 + - _GrassWind: 20 + - _GreyscaleBlend: 1 + - _GreyscaleLuminosity: 0 + - _GreyscaleOutline: 0 + - _HandDrawnAmount: 10 + - _HandDrawnSpeed: 5 + - _HitEffectBlend: 1 + - _HitEffectGlow: 5 + - _HologramBlend: 1 + - _HologramFlickerAlpha: 0 + - _HologramFlickerFreq: 0.2 + - _HologramFlickerPercent: 0.05 + - _HologramMaxAlpha: 1 + - _HologramMinAlpha: 0 + - _HologramStripesAlpha: 0.4 + - _HologramStripesAmount: 50 + - _HologramStripesFill: 0.4 + - _HologramStripesLuminosity: 1 + - _HologramStripesSpeed: 5 + - _HologramUnmodAmount: 0.4 + - _HsvBright: 1 + - _HsvSaturation: 1 + - _HsvShift: 180 + - _InnerOutlineAlpha: 1 + - _InnerOutlineGlow: 1 + - _InnerOutlineThickness: 1 + - _MaxXUV: 1 + - _MaxYUV: 1 + - _MinXUV: 0 + - _MinYUV: 0 + - _MotionBlurAngle: 0.1 + - _MotionBlurDist: 1.25 + - _MyDstMode: 10 + - _MySrcMode: 5 + - _NegativeAmount: 1 + - _OffsetUvX: 0 + - _OffsetUvY: 0 + - _OnlyInnerOutline: 0 + - _OnlyOutline: 0 + - _Outline8Directions: 1 + - _OutlineAlpha: 1 + - _OutlineDistortAmount: 0.5 + - _OutlineDistortTexXSpeed: 5 + - _OutlineDistortTexYSpeed: 5 + - _OutlineDistortToggle: 0 + - _OutlineGlow: 4.3 + - _OutlineIsPixel: 0 + - _OutlinePixelWidth: 1 + - _OutlineTexGrey: 0 + - _OutlineTexToggle: 0 + - _OutlineTexXSpeed: 10 + - _OutlineTexYSpeed: 0 + - _OutlineWidth: 0.041 + - _OverlayBlend: 1 + - _OverlayGlow: 1 + - _OverlayTextureScrollXSpeed: 0.25 + - _OverlayTextureScrollYSpeed: 0.25 + - _PinchUvAmount: 0.35 + - _PixelateSize: 32 + - _PosterizeGamma: 0.75 + - _PosterizeNumColors: 8 + - _PosterizeOutline: 0 + - _RadialClipAngle: 90 + - _RadialClipArc1: 45 + - _RadialClipArc2: 0 + - _RandomSeed: 0 + - _RectSize: 1 + - _RotateUvAmount: 0 + - _RoundWaveSpeed: 2 + - _RoundWaveStrength: 0.7 + - _ShadowAlpha: 0.5 + - _ShadowX: 0.1 + - _ShadowY: -0.05 + - _ShakeUvSpeed: 2.5 + - _ShakeUvX: 1.5 + - _ShakeUvY: 1 + - _ShineGlow: 1 + - _ShineLocation: 0.5 + - _ShineRotate: 0 + - _ShineWidth: 0.1 + - _TextureScrollXSpeed: -1 + - _TextureScrollYSpeed: 0 + - _TwistUvAmount: 1 + - _TwistUvPosX: 0.5 + - _TwistUvPosY: 0.5 + - _TwistUvRadius: 0.75 + - _WarpScale: 0.5 + - _WarpSpeed: 8 + - _WarpStrength: 0.025 + - _WaveAmount: 7 + - _WaveSpeed: 10 + - _WaveStrength: 7.5 + - _WaveX: 0 + - _WaveY: 0.5 + - _ZTestMode: 4 + - _ZWrite: 0 + - _ZoomUvAmount: 0.5 + m_Colors: + - ColorSwapRed: {r: 1, g: 1, b: 1, a: 1} + - _AlphaOutlineColor: {r: 1, g: 1, b: 1, a: 1} + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _ColorChangeNewCol: {r: 1, g: 1, b: 0, a: 1} + - _ColorChangeNewCol2: {r: 1, g: 1, b: 0, a: 1} + - _ColorChangeNewCol3: {r: 1, g: 1, b: 0, a: 1} + - _ColorChangeTarget: {r: 1, g: 0, b: 0, a: 1} + - _ColorChangeTarget2: {r: 1, g: 0, b: 0, a: 1} + - _ColorChangeTarget3: {r: 1, g: 0, b: 0, a: 1} + - _ColorSwapBlue: {r: 1, g: 1, b: 1, a: 1} + - _ColorSwapGreen: {r: 1, g: 1, b: 1, a: 1} + - _ColorSwapRed: {r: 1, g: 1, b: 1, a: 1} + - _FadeBurnColor: {r: 1, g: 1, b: 0, a: 1} + - _GlowColor: {r: 1, g: 1, b: 1, a: 1} + - _GradBotLeftCol: {r: 0, g: 0, b: 1, a: 1} + - _GradBotRightCol: {r: 0, g: 0, b: 1, a: 1} + - _GradTopLeftCol: {r: 1, g: 0, b: 0, a: 1} + - _GradTopRightCol: {r: 1, g: 0, b: 0, a: 1} + - _GreyscaleTintColor: {r: 1, g: 1, b: 1, a: 1} + - _HitEffectColor: {r: 1, g: 1, b: 1, a: 1} + - _HologramStripeColor: {r: 1, g: 1, b: 1, a: 1} + - _InnerOutlineColor: {r: 1, g: 0, b: 0, a: 1} + - _OutlineColor: {r: 1, g: 0.5309945, b: 0, a: 1} + - _OverlayColor: {r: 1, g: 1, b: 1, a: 1} + - _ShadowColor: {r: 0, g: 0, b: 0, a: 1} + - _ShineColor: {r: 1, g: 1, b: 1, a: 1} +--- !u!1 &1402107645 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1402107646} + - component: {fileID: 1402107648} + - component: {fileID: 1402107647} + m_Layer: 0 + m_Name: Sprite1 + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1402107646 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1402107645} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: -1.5, y: 0.82, z: 0} + m_LocalScale: {x: 1.0080961, y: 1.0080961, z: 1.0080961} + m_Children: [] + m_Father: {fileID: 1415143267} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &1402107647 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1402107645} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: ee158225ee1e59f4791627785501d950, type: 3} + m_Name: + m_EditorClassIdentifier: + currentShaderType: 4 + normalStrength: 5 + normalSmoothing: 1 + computingNormal: 0 +--- !u!212 &1402107648 +SpriteRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1402107645} + m_Enabled: 1 + m_CastShadows: 0 + m_ReceiveShadows: 0 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 73084414} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 0 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_Sprite: {fileID: 21300000, guid: 519dafacd208bb64c83d5124be03b09d, type: 3} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_FlipX: 1 + m_FlipY: 0 + m_DrawMode: 0 + m_Size: {x: 5.12, y: 5.12} + m_AdaptiveModeThreshold: 0.5 + m_SpriteTileMode: 0 + m_WasSpriteAssigned: 1 + m_MaskInteraction: 0 + m_SpriteSortPoint: 0 +--- !u!1 &1404112918 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1404112919} + - component: {fileID: 1404112921} + - component: {fileID: 1404112920} + m_Layer: 0 + m_Name: Animated + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 0 +--- !u!4 &1404112919 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1404112918} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: -3.57, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 1211354477} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!102 &1404112920 +TextMesh: + serializedVersion: 3 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1404112918} + m_Text: (Has Animation) + m_OffsetZ: -1.5 + m_CharacterSize: 0.075 + m_LineSpacing: 1 + m_Anchor: 4 + m_Alignment: 0 + m_TabSize: 4 + m_FontSize: 100 + m_FontStyle: 0 + m_RichText: 1 + m_Font: {fileID: 12800000, guid: a4e6a5491519adb45919dc87eff28e55, type: 3} + m_Color: + serializedVersion: 2 + rgba: 4294967295 +--- !u!23 &1404112921 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1404112918} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: a4e6a5491519adb45919dc87eff28e55, type: 3} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!1 &1415143266 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1415143267} + - component: {fileID: 1415143268} + m_Layer: 0 + m_Name: UnifiedOutline + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1415143267 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1415143266} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 330, y: 0, z: 0} + m_LocalScale: {x: 0.80276, y: 0.80276, z: 0.80276} + m_Children: + - {fileID: 1402107646} + - {fileID: 778370416} + - {fileID: 1521478960} + - {fileID: 1818617670} + - {fileID: 1183578090} + - {fileID: 435111026} + - {fileID: 1924503772} + - {fileID: 1728754561} + m_Father: {fileID: 1563905016} + m_RootOrder: 33 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &1415143268 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1415143266} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 98b644315d7a92842b89e04f55c48e02, type: 3} + m_Name: + m_EditorClassIdentifier: +--- !u!1 &1418206286 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1418206287} + - component: {fileID: 1418206289} + - component: {fileID: 1418206288} + m_Layer: 0 + m_Name: Animated + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 0 +--- !u!4 &1418206287 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1418206286} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: -3.57, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 984096428} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!102 &1418206288 +TextMesh: + serializedVersion: 3 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1418206286} + m_Text: (Has Animation) + m_OffsetZ: -1.5 + m_CharacterSize: 0.075 + m_LineSpacing: 1 + m_Anchor: 4 + m_Alignment: 0 + m_TabSize: 4 + m_FontSize: 100 + m_FontStyle: 0 + m_RichText: 1 + m_Font: {fileID: 12800000, guid: a4e6a5491519adb45919dc87eff28e55, type: 3} + m_Color: + serializedVersion: 2 + rgba: 4294967295 +--- !u!23 &1418206289 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1418206286} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: a4e6a5491519adb45919dc87eff28e55, type: 3} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!1 &1432462162 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1432462163} + - component: {fileID: 1432462165} + - component: {fileID: 1432462164} + m_Layer: 0 + m_Name: Title + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1432462163 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1432462162} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: -3.1267126, z: 0} + m_LocalScale: {x: 1.2457023, y: 1.2457023, z: 1.2457023} + m_Children: [] + m_Father: {fileID: 982048496} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!102 &1432462164 +TextMesh: + serializedVersion: 3 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1432462162} + m_Text: Super Saiyan + m_OffsetZ: -1.5 + m_CharacterSize: 0.075 + m_LineSpacing: 1 + m_Anchor: 4 + m_Alignment: 0 + m_TabSize: 4 + m_FontSize: 100 + m_FontStyle: 0 + m_RichText: 1 + m_Font: {fileID: 12800000, guid: a4e6a5491519adb45919dc87eff28e55, type: 3} + m_Color: + serializedVersion: 2 + rgba: 4294967295 +--- !u!23 &1432462165 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1432462162} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 10100, guid: 0000000000000000e000000000000000, type: 0} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!1 &1434614527 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1434614528} + - component: {fileID: 1434614530} + - component: {fileID: 1434614531} + m_Layer: 0 + m_Name: Negative + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1434614528 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1434614527} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 160, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 1355901851} + - {fileID: 352221784} + m_Father: {fileID: 2036092933} + m_RootOrder: 16 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!212 &1434614530 +SpriteRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1434614527} + m_Enabled: 1 + m_CastShadows: 0 + m_ReceiveShadows: 0 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 817315606} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 0 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_Sprite: {fileID: 21300000, guid: 519dafacd208bb64c83d5124be03b09d, type: 3} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_FlipX: 0 + m_FlipY: 0 + m_DrawMode: 0 + m_Size: {x: 5.12, y: 5.12} + m_AdaptiveModeThreshold: 0.5 + m_SpriteTileMode: 0 + m_WasSpriteAssigned: 1 + m_MaskInteraction: 0 + m_SpriteSortPoint: 0 +--- !u!114 &1434614531 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1434614527} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 98b644315d7a92842b89e04f55c48e02, type: 3} + m_Name: + m_EditorClassIdentifier: +--- !u!21 &1435312052 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: AllIn1SpriteShader/AllIn1SpriteShader + m_Shader: {fileID: 4800000, guid: a36b7719ff0465b42ab1407d67672c5f, type: 3} + m_ShaderKeywords: ETC1_EXTERNAL_ALPHA + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _ColorRampTex: + m_Texture: {fileID: 2800000, guid: 279657edc397ece4b8029c727adf6ddc, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ColorRampTexGradient: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ColorSwapTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DistortTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _FadeBurnTex: + m_Texture: {fileID: 2800000, guid: 677cca399782dea41aedc1d292ecb67d, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _FadeTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _GlowTex: + 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} + - _OutlineDistortTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OutlineTex: + m_Texture: {fileID: 2800000, guid: 74087f6d03f233e4a8a142fa01f9e5cf, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OverlayTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ShineMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - _Alpha: 1 + - _AlphaCutoffValue: 0.25 + - _AlphaOutlineBlend: 1 + - _AlphaOutlineGlow: 5 + - _AlphaOutlineMinAlpha: 0 + - _AlphaOutlinePower: 1 + - _AlphaRoundThreshold: 0.5 + - _BillboardY: 0 + - _BlurHD: 0 + - _BlurIntensity: 10 + - _Brightness: 0 + - _ChromAberrAlpha: 0.4 + - _ChromAberrAmount: 1 + - _ClipUvDown: 0 + - _ClipUvLeft: 0 + - _ClipUvRight: 0 + - _ClipUvUp: 0 + - _ColorChangeLuminosity: 0 + - _ColorChangeTolerance: 0.25 + - _ColorChangeTolerance2: 0.25 + - _ColorChangeTolerance3: 0.25 + - _ColorRampBlend: 1 + - _ColorRampLuminosity: 0 + - _ColorRampOutline: 0 + - _ColorSwapBlend: 1 + - _ColorSwapBlueLuminosity: 0.5 + - _ColorSwapGreenLuminosity: 0.5 + - _ColorSwapRedLuminosity: 0.5 + - _Contrast: 1 + - _CullingOption: 0 + - _DistortAmount: 0.5 + - _DistortTexXSpeed: 5 + - _DistortTexYSpeed: 5 + - _EditorDrawers: 6 + - _FadeAmount: -0.1 + - _FadeBurnGlow: 2 + - _FadeBurnTransition: 0.075 + - _FadeBurnWidth: 0.025 + - _FishEyeUvAmount: 0.35 + - _FlickerAlpha: 0 + - _FlickerFreq: 0.2 + - _FlickerPercent: 0.05 + - _GhostBlend: 1 + - _GhostColorBoost: 1 + - _GhostTransparency: 0 + - _GlitchAmount: 3 + - _GlitchSize: 1 + - _Glow: 10 + - _GlowGlobal: 1 + - _GlowTexUsed: 0 + - _GradBlend: 1 + - _GradBoostX: 1.2 + - _GradBoostY: 1.2 + - _GradIsRadial: 0 + - _GrassManualAnim: 1 + - _GrassManualToggle: 0 + - _GrassRadialBend: 0.1 + - _GrassSpeed: 2 + - _GrassWind: 20 + - _GreyscaleBlend: 1 + - _GreyscaleLuminosity: 0 + - _GreyscaleOutline: 0 + - _HandDrawnAmount: 10 + - _HandDrawnSpeed: 5 + - _HitEffectBlend: 1 + - _HitEffectGlow: 5 + - _HologramBlend: 1 + - _HologramMaxAlpha: 1 + - _HologramMinAlpha: 0 + - _HologramStripesAlpha: 0.4 + - _HologramStripesAmount: 50 + - _HologramStripesFill: 0.4 + - _HologramStripesLuminosity: 1 + - _HologramStripesSpeed: 5 + - _HologramUnmodAmount: 0.4 + - _HsvBright: 1 + - _HsvSaturation: 1 + - _HsvShift: 180 + - _InnerOutlineAlpha: 1 + - _InnerOutlineGlow: 1 + - _InnerOutlineThickness: 1 + - _MaxXUV: 1 + - _MaxYUV: 1 + - _MinXUV: 0 + - _MinYUV: 0 + - _MotionBlurAngle: 0.1 + - _MotionBlurDist: 1.25 + - _MyDstMode: 10 + - _MySrcMode: 5 + - _NegativeAmount: 1 + - _OffsetUvX: 0 + - _OffsetUvY: 0 + - _OnlyInnerOutline: 0 + - _OnlyOutline: 0 + - _Outline8Directions: 0 + - _OutlineAlpha: 1 + - _OutlineDistortAmount: 0.5 + - _OutlineDistortTexXSpeed: 5 + - _OutlineDistortTexYSpeed: 5 + - _OutlineDistortToggle: 0 + - _OutlineGlow: 1.5 + - _OutlineIsPixel: 0 + - _OutlinePixelWidth: 1 + - _OutlineTexGrey: 0 + - _OutlineTexToggle: 0 + - _OutlineTexXSpeed: 10 + - _OutlineTexYSpeed: 0 + - _OutlineWidth: 0.004 + - _OverlayBlend: 1 + - _OverlayGlow: 1 + - _OverlayTextureScrollXSpeed: 0.25 + - _OverlayTextureScrollYSpeed: 0.25 + - _PinchUvAmount: 0.35 + - _PixelateSize: 32 + - _PosterizeGamma: 0.75 + - _PosterizeNumColors: 8 + - _PosterizeOutline: 0 + - _RadialClip: 45 + - _RadialClip2: 0 + - _RadialClipAngle: 90 + - _RadialClipArc1: 45 + - _RadialClipArc2: 0 + - _RadialStartAngle: 90 + - _RandomSeed: 0 + - _RectSize: 1 + - _RotateUvAmount: 0 + - _RoundWaveSpeed: 2 + - _RoundWaveStrength: 0.7 + - _ShadowAlpha: 0.5 + - _ShadowX: 0.1 + - _ShadowY: -0.05 + - _ShakeUvSpeed: 2.5 + - _ShakeUvX: 1.5 + - _ShakeUvY: 1 + - _ShineGlow: 1 + - _ShineLocation: 0.5 + - _ShineRotate: 0 + - _ShineWidth: 0.1 + - _TextureScrollXSpeed: 1 + - _TextureScrollYSpeed: 0 + - _TwistUvAmount: 1 + - _TwistUvPosX: 0.5 + - _TwistUvPosY: 0.5 + - _TwistUvRadius: 0.75 + - _WarpScale: 0.5 + - _WarpSpeed: 8 + - _WarpStrength: 0.025 + - _WaveAmount: 7 + - _WaveSpeed: 10 + - _WaveStrength: 7.5 + - _WaveX: 0 + - _WaveY: 0.5 + - _ZTestMode: 4 + - _ZWrite: 0 + - _ZoomUvAmount: 0.5 + m_Colors: + - ColorSwapRed: {r: 1, g: 1, b: 1, a: 1} + - _AlphaOutlineColor: {r: 1, g: 1, b: 1, a: 1} + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _ColorChangeNewCol: {r: 1, g: 1, b: 0, a: 1} + - _ColorChangeNewCol2: {r: 1, g: 1, b: 0, a: 1} + - _ColorChangeNewCol3: {r: 1, g: 1, b: 0, a: 1} + - _ColorChangeTarget: {r: 1, g: 0, b: 0, a: 1} + - _ColorChangeTarget2: {r: 1, g: 0, b: 0, a: 1} + - _ColorChangeTarget3: {r: 1, g: 0, b: 0, a: 1} + - _ColorSwapBlue: {r: 1, g: 1, b: 1, a: 1} + - _ColorSwapGreen: {r: 1, g: 1, b: 1, a: 1} + - _ColorSwapRed: {r: 1, g: 1, b: 1, a: 1} + - _FadeBurnColor: {r: 1, g: 1, b: 0, a: 1} + - _GlowColor: {r: 1, g: 1, b: 1, a: 1} + - _GradBotLeftCol: {r: 0, g: 0, b: 1, a: 1} + - _GradBotRightCol: {r: 0, g: 0, b: 1, a: 1} + - _GradTopLeftCol: {r: 1, g: 0, b: 0, a: 1} + - _GradTopRightCol: {r: 1, g: 0, b: 0, a: 1} + - _GreyscaleTintColor: {r: 1, g: 1, b: 1, a: 1} + - _HitEffectColor: {r: 1, g: 1, b: 1, a: 1} + - _HologramStripeColor: {r: 1, g: 1, b: 1, a: 1} + - _InnerOutlineColor: {r: 1, g: 0, b: 0, a: 1} + - _OutlineColor: {r: 1, g: 1, b: 1, a: 1} + - _OverlayColor: {r: 1, g: 1, b: 1, a: 1} + - _ShadowColor: {r: 0, g: 0, b: 0, a: 1} + - _ShineColor: {r: 1, g: 1, b: 1, a: 1} +--- !u!1 &1438024879 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1438024880} + - component: {fileID: 1438024882} + - component: {fileID: 1438024881} + m_Layer: 0 + m_Name: Title + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1438024880 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1438024879} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: -2.51, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 312669278} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!102 &1438024881 +TextMesh: + serializedVersion: 3 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1438024879} + m_Text: AlphaOutline + m_OffsetZ: -1.5 + m_CharacterSize: 0.075 + m_LineSpacing: 1 + m_Anchor: 4 + m_Alignment: 0 + m_TabSize: 4 + m_FontSize: 100 + m_FontStyle: 0 + m_RichText: 1 + m_Font: {fileID: 12800000, guid: a4e6a5491519adb45919dc87eff28e55, type: 3} + m_Color: + serializedVersion: 2 + rgba: 4294967295 +--- !u!23 &1438024882 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1438024879} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 10100, guid: 0000000000000000e000000000000000, type: 0} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!21 &1439702669 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: AllIn1SpriteShader/AllIn1SpriteShader + m_Shader: {fileID: 4800000, guid: a36b7719ff0465b42ab1407d67672c5f, type: 3} + m_ShaderKeywords: ETC1_EXTERNAL_ALPHA HSV_ON + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _ColorRampTex: + m_Texture: {fileID: 2800000, guid: 279657edc397ece4b8029c727adf6ddc, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ColorRampTexGradient: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ColorSwapTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DistortTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _FadeBurnTex: + m_Texture: {fileID: 2800000, guid: 677cca399782dea41aedc1d292ecb67d, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _FadeTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _GlowTex: + 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} + - _OutlineDistortTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OutlineTex: + m_Texture: {fileID: 2800000, guid: 74087f6d03f233e4a8a142fa01f9e5cf, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OverlayTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ShineMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - _Alpha: 1 + - _AlphaCutoffValue: 0.25 + - _AlphaOutlineBlend: 1 + - _AlphaOutlineGlow: 27.6 + - _AlphaOutlineMinAlpha: 0 + - _AlphaOutlinePower: 1 + - _AlphaRoundThreshold: 0.5 + - _BillboardY: 0 + - _BlurHD: 0 + - _BlurIntensity: 10 + - _Brightness: 0 + - _ChromAberrAlpha: 0.4 + - _ChromAberrAmount: 1 + - _ClipUvDown: 0 + - _ClipUvLeft: 0 + - _ClipUvRight: 0 + - _ClipUvUp: 0 + - _ColorChangeLuminosity: 0 + - _ColorChangeTolerance: 0.25 + - _ColorChangeTolerance2: 0.25 + - _ColorChangeTolerance3: 0.25 + - _ColorRampBlend: 1 + - _ColorRampLuminosity: 0 + - _ColorRampOutline: 0 + - _ColorSwapBlend: 1 + - _ColorSwapBlueLuminosity: 0.5 + - _ColorSwapGreenLuminosity: 0.5 + - _ColorSwapRedLuminosity: 0.5 + - _Contrast: 1 + - _CullingOption: 0 + - _DistortAmount: 0.5 + - _DistortTexXSpeed: 5 + - _DistortTexYSpeed: 5 + - _EditorDrawers: 6 + - _FadeAmount: -0.1 + - _FadeBurnGlow: 2 + - _FadeBurnTransition: 0.075 + - _FadeBurnWidth: 0.025 + - _FishEyeUvAmount: 0.35 + - _FlickerAlpha: 0 + - _FlickerFreq: 0.2 + - _FlickerPercent: 0.05 + - _GhostBlend: 1 + - _GhostColorBoost: 1 + - _GhostTransparency: 0 + - _GlitchAmount: 3 + - _GlitchSize: 1 + - _Glow: 10 + - _GlowGlobal: 1 + - _GlowTexUsed: 0 + - _GradBlend: 1 + - _GradBoostX: 1.2 + - _GradBoostY: 1.2 + - _GradIsRadial: 0 + - _GrassManualAnim: 1 + - _GrassManualToggle: 0 + - _GrassRadialBend: 0.1 + - _GrassSpeed: 2 + - _GrassWind: 20 + - _GreyscaleBlend: 1 + - _GreyscaleLuminosity: 0 + - _GreyscaleOutline: 0 + - _HandDrawnAmount: 10 + - _HandDrawnSpeed: 5 + - _HitEffectBlend: 1 + - _HitEffectGlow: 5 + - _HologramBlend: 1 + - _HologramMaxAlpha: 0.75 + - _HologramMinAlpha: 0.1 + - _HologramStripesAmount: 0.1 + - _HologramStripesSpeed: 4.5 + - _HologramUnmodAmount: 0 + - _HsvBright: 1 + - _HsvSaturation: 1.66 + - _HsvShift: 69 + - _InnerOutlineAlpha: 1 + - _InnerOutlineGlow: 1 + - _InnerOutlineThickness: 1 + - _MaxXUV: 1 + - _MaxYUV: 1 + - _MinXUV: 0 + - _MinYUV: 0 + - _MotionBlurAngle: 0.1 + - _MotionBlurDist: 1.25 + - _MyDstMode: 10 + - _MySrcMode: 5 + - _NegativeAmount: 1 + - _OffsetUvX: 0 + - _OffsetUvY: 0 + - _OnlyInnerOutline: 0 + - _OnlyOutline: 0 + - _Outline8Directions: 0 + - _OutlineAlpha: 1 + - _OutlineDistortAmount: 0.5 + - _OutlineDistortTexXSpeed: 5 + - _OutlineDistortTexYSpeed: 5 + - _OutlineDistortToggle: 0 + - _OutlineGlow: 1.5 + - _OutlineIsPixel: 0 + - _OutlinePixelWidth: 1 + - _OutlineTexGrey: 0 + - _OutlineTexToggle: 0 + - _OutlineTexXSpeed: 10 + - _OutlineTexYSpeed: 0 + - _OutlineWidth: 0.004 + - _OverlayBlend: 1 + - _OverlayGlow: 1 + - _OverlayTextureScrollXSpeed: 0.25 + - _OverlayTextureScrollYSpeed: 0.25 + - _PinchUvAmount: 0.35 + - _PixelateSize: 32 + - _PosterizeGamma: 0.75 + - _PosterizeNumColors: 8 + - _PosterizeOutline: 0 + - _RadialClip: 45 + - _RadialClip2: 0 + - _RadialClipAngle: 90 + - _RadialClipArc1: 45 + - _RadialClipArc2: 0 + - _RadialStartAngle: 90 + - _RandomSeed: 0 + - _RectSize: 1 + - _RotateUvAmount: 0 + - _RoundWaveSpeed: 2 + - _RoundWaveStrength: 0.7 + - _ShadowAlpha: 0.5 + - _ShadowX: 0.1 + - _ShadowY: -0.05 + - _ShakeUvSpeed: 2.5 + - _ShakeUvX: 1.5 + - _ShakeUvY: 1 + - _ShineGlow: 1 + - _ShineLocation: 0.5 + - _ShineRotate: 0 + - _ShineWidth: 0.1 + - _TextureScrollXSpeed: 1 + - _TextureScrollYSpeed: 0 + - _TwistUvAmount: 1 + - _TwistUvPosX: 0.5 + - _TwistUvPosY: 0.5 + - _TwistUvRadius: 0.75 + - _WarpScale: 0.5 + - _WarpSpeed: 8 + - _WarpStrength: 0.025 + - _WaveAmount: 7 + - _WaveSpeed: 10 + - _WaveStrength: 7.5 + - _WaveX: 0 + - _WaveY: 0.5 + - _ZTestMode: 4 + - _ZWrite: 0 + - _ZoomUvAmount: 0.5 + m_Colors: + - ColorSwapRed: {r: 1, g: 1, b: 1, a: 1} + - _AlphaOutlineColor: {r: 1, g: 1, b: 1, a: 1} + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _ColorChangeNewCol: {r: 1, g: 1, b: 0, a: 1} + - _ColorChangeNewCol2: {r: 1, g: 1, b: 0, a: 1} + - _ColorChangeNewCol3: {r: 1, g: 1, b: 0, a: 1} + - _ColorChangeTarget: {r: 1, g: 0, b: 0, a: 1} + - _ColorChangeTarget2: {r: 1, g: 0, b: 0, a: 1} + - _ColorChangeTarget3: {r: 1, g: 0, b: 0, a: 1} + - _ColorSwapBlue: {r: 1, g: 1, b: 1, a: 1} + - _ColorSwapGreen: {r: 1, g: 1, b: 1, a: 1} + - _ColorSwapRed: {r: 1, g: 1, b: 1, a: 1} + - _FadeBurnColor: {r: 1, g: 1, b: 0, a: 1} + - _GlowColor: {r: 1, g: 1, b: 1, a: 1} + - _GradBotLeftCol: {r: 0, g: 0, b: 1, a: 1} + - _GradBotRightCol: {r: 0, g: 0, b: 1, a: 1} + - _GradTopLeftCol: {r: 1, g: 0, b: 0, a: 1} + - _GradTopRightCol: {r: 1, g: 0, b: 0, a: 1} + - _GreyscaleTintColor: {r: 1, g: 1, b: 1, a: 1} + - _HitEffectColor: {r: 1, g: 1, b: 1, a: 1} + - _HologramStripeColor: {r: 0, g: 1, b: 1, a: 1} + - _InnerOutlineColor: {r: 1, g: 0, b: 0, a: 1} + - _OutlineColor: {r: 1, g: 1, b: 1, a: 1} + - _OverlayColor: {r: 1, g: 1, b: 1, a: 1} + - _ShadowColor: {r: 0, g: 0, b: 0, a: 1} + - _ShineColor: {r: 1, g: 1, b: 1, a: 1} +--- !u!1 &1447921188 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1447921189} + - component: {fileID: 1447921191} + - component: {fileID: 1447921192} + m_Layer: 0 + m_Name: Flicker + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1447921189 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1447921188} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 260, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 844328745} + - {fileID: 1822267181} + m_Father: {fileID: 2036092933} + m_RootOrder: 26 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!212 &1447921191 +SpriteRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1447921188} + m_Enabled: 1 + m_CastShadows: 0 + m_ReceiveShadows: 0 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 822200767} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 0 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_Sprite: {fileID: 21300000, guid: 519dafacd208bb64c83d5124be03b09d, type: 3} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_FlipX: 0 + m_FlipY: 0 + m_DrawMode: 0 + m_Size: {x: 5.12, y: 5.12} + m_AdaptiveModeThreshold: 0.5 + m_SpriteTileMode: 0 + m_WasSpriteAssigned: 1 + m_MaskInteraction: 0 + m_SpriteSortPoint: 0 +--- !u!114 &1447921192 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1447921188} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 98b644315d7a92842b89e04f55c48e02, type: 3} + m_Name: + m_EditorClassIdentifier: +--- !u!1 &1450664985 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1450664986} + - component: {fileID: 1450664988} + - component: {fileID: 1450664987} + m_Layer: 0 + m_Name: Title + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1450664986 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1450664985} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: -2.51, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 1923390774} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!102 &1450664987 +TextMesh: + serializedVersion: 3 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1450664985} + m_Text: 'Radial Gradient + +' + m_OffsetZ: -1.5 + m_CharacterSize: 0.075 + m_LineSpacing: 1 + m_Anchor: 4 + m_Alignment: 0 + m_TabSize: 4 + m_FontSize: 100 + m_FontStyle: 0 + m_RichText: 1 + m_Font: {fileID: 12800000, guid: a4e6a5491519adb45919dc87eff28e55, type: 3} + m_Color: + serializedVersion: 2 + rgba: 4294967295 +--- !u!23 &1450664988 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1450664985} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 10100, guid: 0000000000000000e000000000000000, type: 0} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!1 &1454273601 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1454273602} + - component: {fileID: 1454273604} + - component: {fileID: 1454273603} + - component: {fileID: 1454273605} + m_Layer: 0 + m_Name: FireFront + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1454273602 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1454273601} + m_LocalRotation: {x: 0, y: 0, z: 1, w: 0} + m_LocalPosition: {x: 0, y: 0, z: -0.05} + m_LocalScale: {x: 0.66255665, y: 0.66255665, z: 0.66255665} + m_Children: [] + m_Father: {fileID: 102412577} + m_RootOrder: 2 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 180} +--- !u!114 &1454273603 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1454273601} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: ee158225ee1e59f4791627785501d950, type: 3} + m_Name: + m_EditorClassIdentifier: + currentShaderType: 4 + normalStrength: 5 + normalSmoothing: 1 + computingNormal: 0 +--- !u!212 &1454273604 +SpriteRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1454273601} + m_Enabled: 1 + m_CastShadows: 0 + m_ReceiveShadows: 0 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: 1c2c3a51f881cb443906a57116cf56fe, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 0 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_Sprite: {fileID: 21300000, guid: 2ea3ea54c499d314f957e0a47dc11c9c, type: 3} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_FlipX: 0 + m_FlipY: 0 + m_DrawMode: 0 + m_Size: {x: 0.04, y: 0.04} + m_AdaptiveModeThreshold: 0.5 + m_SpriteTileMode: 0 + m_WasSpriteAssigned: 1 + m_MaskInteraction: 0 + m_SpriteSortPoint: 0 +--- !u!114 &1454273605 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1454273601} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 384dba07353e1f242b467b6857a1e3d4, type: 3} + m_Name: + m_EditorClassIdentifier: + numericPropertyName: _RotateUvAmount + scrollSpeed: 10 + applyModulo: 1 + modulo: 6.28 + mat: {fileID: 0} +--- !u!21 &1459191230 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: AllIn1SpriteShader/AllIn1SpriteShader + m_Shader: {fileID: 4800000, guid: a36b7719ff0465b42ab1407d67672c5f, type: 3} + m_ShaderKeywords: ATLAS_ON CHANGECOLOR_ON DOODLE_ON ETC1_EXTERNAL_ALPHA OUTBASE8DIR_ON + OUTBASE_ON _OUTLINE8DIRECTIONS_ON + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _ColorRampTex: + m_Texture: {fileID: 2800000, guid: 279657edc397ece4b8029c727adf6ddc, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ColorRampTexGradient: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ColorSwapTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DistortTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _FadeBurnTex: + m_Texture: {fileID: 2800000, guid: 32e8df0008bebe746b1681a71c61f31c, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _FadeTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _GlowTex: + 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} + - _OutlineDistortTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OutlineTex: + m_Texture: {fileID: 2800000, guid: 74087f6d03f233e4a8a142fa01f9e5cf, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OverlayTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ShineMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - _Alpha: 1 + - _AlphaCutoffValue: 0.25 + - _AlphaOutlineBlend: 1 + - _AlphaOutlineGlow: 5 + - _AlphaOutlineMinAlpha: 0 + - _AlphaOutlinePower: 1 + - _AlphaRoundThreshold: 0.5 + - _BillboardY: 0 + - _BlurHD: 0 + - _BlurIntensity: 10 + - _Brightness: 0 + - _ChromAberrAlpha: 0.4 + - _ChromAberrAmount: 1 + - _ClipUvDown: 1 + - _ClipUvLeft: 1 + - _ClipUvRight: 1 + - _ClipUvUp: 1 + - _ColorChangeLuminosity: 0.706 + - _ColorChangeTolerance: 0.25 + - _ColorChangeTolerance2: 0.25 + - _ColorChangeTolerance3: 0.25 + - _ColorRampBlend: 1 + - _ColorRampLuminosity: 0 + - _ColorRampOutline: 0 + - _ColorSwapBlend: 1 + - _ColorSwapBlueLuminosity: 0.5 + - _ColorSwapGreenLuminosity: 0.5 + - _ColorSwapRedLuminosity: 0.5 + - _Contrast: 1 + - _CullingOption: 0 + - _DistortAmount: 0.5 + - _DistortTexXSpeed: 5 + - _DistortTexYSpeed: 5 + - _EditorDrawers: 6 + - _FadeAmount: -0.1 + - _FadeBurnGlow: 2 + - _FadeBurnTransition: 0.075 + - _FadeBurnWidth: 0.025 + - _FishEyeUvAmount: 0.35 + - _FlickerAlpha: 0 + - _FlickerFreq: 0.2 + - _FlickerPercent: 0.05 + - _GhostBlend: 1 + - _GhostColorBoost: 1 + - _GhostTransparency: 0 + - _GlitchAmount: 3 + - _GlitchSize: 1 + - _Glow: 10 + - _GlowGlobal: 1 + - _GlowTexUsed: 0 + - _GradBlend: 1 + - _GradBoostX: 1.2 + - _GradBoostY: 1.2 + - _GradIsRadial: 0 + - _GrassManualAnim: 1 + - _GrassManualToggle: 0 + - _GrassRadialBend: 0.25 + - _GrassSpeed: 2 + - _GrassWind: 20 + - _GreyscaleBlend: 1 + - _GreyscaleLuminosity: 0 + - _GreyscaleOutline: 0 + - _HandDrawnAmount: 6.6 + - _HandDrawnSpeed: 6.13 + - _HitEffectBlend: 1 + - _HitEffectGlow: 5 + - _HologramBlend: 1 + - _HologramFlickerAlpha: 0 + - _HologramFlickerFreq: 0.2 + - _HologramMaxAlpha: 1 + - _HologramMinAlpha: 0 + - _HologramStripesAlpha: 0.4 + - _HologramStripesAmount: 50 + - _HologramStripesFill: 0.4 + - _HologramStripesLuminosity: 1 + - _HologramStripesSpeed: 5 + - _HologramUnmodAmount: 0.4 + - _HsvBright: 1 + - _HsvSaturation: 1 + - _HsvShift: 180 + - _InnerOutlineAlpha: 1 + - _InnerOutlineGlow: 1 + - _InnerOutlineThickness: 1 + - _MaxXUV: 0.49902344 + - _MaxYUV: 0.95703125 + - _MinXUV: 0.068359375 + - _MinYUV: 0.48339844 + - _MotionBlurAngle: 0.1 + - _MotionBlurDist: 1.25 + - _MyDstMode: 10 + - _MySrcMode: 5 + - _NegativeAmount: 1 + - _OffsetUvX: 0 + - _OffsetUvY: 0 + - _OnlyInnerOutline: 0 + - _OnlyOutline: 0 + - _Outline8Directions: 1 + - _OutlineAlpha: 1 + - _OutlineDistortAmount: 0.5 + - _OutlineDistortTexXSpeed: 5 + - _OutlineDistortTexYSpeed: 5 + - _OutlineDistortToggle: 0 + - _OutlineGlow: 1.5 + - _OutlineIsPixel: 0 + - _OutlinePixelWidth: 1 + - _OutlineTexGrey: 0 + - _OutlineTexToggle: 0 + - _OutlineTexXSpeed: 10 + - _OutlineTexYSpeed: 0 + - _OutlineWidth: 0.016 + - _OverlayBlend: 1 + - _OverlayGlow: 1 + - _OverlayTextureScrollXSpeed: 0.25 + - _OverlayTextureScrollYSpeed: 0.25 + - _PinchUvAmount: 0.35 + - _PixelateSize: 32 + - _PosterizeGamma: 0.75 + - _PosterizeNumColors: 8 + - _PosterizeOutline: 0 + - _RadialClip: 45 + - _RadialClip2: 0 + - _RadialClipAngle: 90 + - _RadialClipArc1: 45 + - _RadialClipArc2: 0 + - _RadialStartAngle: 90 + - _RandomSeed: 0 + - _RectSize: 1 + - _RotateUvAmount: 0 + - _RoundWaveSpeed: 2 + - _RoundWaveStrength: 0.7 + - _ShadowAlpha: 0.5 + - _ShadowX: 0.1 + - _ShadowY: -0.05 + - _ShakeUvSpeed: 2.5 + - _ShakeUvX: 1.5 + - _ShakeUvY: 1 + - _ShineGlow: 1 + - _ShineLocation: 0.5 + - _ShineRotate: 0 + - _ShineWidth: 0.1 + - _TextureScrollXSpeed: 1 + - _TextureScrollYSpeed: 0 + - _TwistUvAmount: 1 + - _TwistUvPosX: 0.5 + - _TwistUvPosY: 0.5 + - _TwistUvRadius: 0.75 + - _WarpScale: 0.5 + - _WarpSpeed: 8 + - _WarpStrength: 0.025 + - _WaveAmount: 7 + - _WaveSpeed: 10 + - _WaveStrength: 7.5 + - _WaveX: 0 + - _WaveY: 0.5 + - _ZTestMode: 4 + - _ZWrite: 0 + - _ZoomUvAmount: 0.5 + m_Colors: + - ColorSwapRed: {r: 1, g: 1, b: 1, a: 1} + - _AlphaOutlineColor: {r: 1, g: 1, b: 1, a: 1} + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _ColorChangeNewCol: {r: 1, g: 1, b: 0, a: 1} + - _ColorChangeNewCol2: {r: 1, g: 1, b: 0, a: 1} + - _ColorChangeNewCol3: {r: 1, g: 1, b: 0, a: 1} + - _ColorChangeTarget: {r: 0.25882354, g: 0.3647059, b: 0.19215688, a: 1} + - _ColorChangeTarget2: {r: 1, g: 0, b: 0, a: 1} + - _ColorChangeTarget3: {r: 1, g: 0, b: 0, a: 1} + - _ColorSwapBlue: {r: 1, g: 1, b: 1, a: 1} + - _ColorSwapGreen: {r: 1, g: 1, b: 1, a: 1} + - _ColorSwapRed: {r: 1, g: 1, b: 1, a: 1} + - _FadeBurnColor: {r: 1, g: 1, b: 0, a: 1} + - _GlowColor: {r: 1, g: 1, b: 1, a: 1} + - _GradBotLeftCol: {r: 0, g: 0, b: 1, a: 1} + - _GradBotRightCol: {r: 0, g: 0, b: 1, a: 1} + - _GradTopLeftCol: {r: 1, g: 0, b: 0, a: 1} + - _GradTopRightCol: {r: 1, g: 0, b: 0, a: 1} + - _GreyscaleTintColor: {r: 1, g: 1, b: 1, a: 1} + - _HitEffectColor: {r: 1, g: 1, b: 1, a: 1} + - _HologramStripeColor: {r: 1, g: 1, b: 1, a: 1} + - _InnerOutlineColor: {r: 1, g: 0, b: 0, a: 1} + - _OutlineColor: {r: 0, g: 0, b: 0, a: 1} + - _OverlayColor: {r: 1, g: 1, b: 1, a: 1} + - _ShadowColor: {r: 0, g: 0, b: 0, a: 1} + - _ShineColor: {r: 1, g: 1, b: 1, a: 1} +--- !u!1 &1462418352 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1462418353} + - component: {fileID: 1462418355} + - component: {fileID: 1462418354} + m_Layer: 0 + m_Name: Title + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1462418353 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1462418352} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: -2.51, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 1073566156} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!102 &1462418354 +TextMesh: + serializedVersion: 3 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1462418352} + m_Text: Contrast + m_OffsetZ: -1.5 + m_CharacterSize: 0.075 + m_LineSpacing: 1 + m_Anchor: 4 + m_Alignment: 0 + m_TabSize: 4 + m_FontSize: 100 + m_FontStyle: 0 + m_RichText: 1 + m_Font: {fileID: 12800000, guid: a4e6a5491519adb45919dc87eff28e55, type: 3} + m_Color: + serializedVersion: 2 + rgba: 4294967295 +--- !u!23 &1462418355 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1462418352} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 10100, guid: 0000000000000000e000000000000000, type: 0} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!1 &1464450238 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1464450239} + - component: {fileID: 1464450241} + - component: {fileID: 1464450240} + m_Layer: 0 + m_Name: Title + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1464450239 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1464450238} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: -3.1267126, z: 0} + m_LocalScale: {x: 1.2457023, y: 1.2457023, z: 1.2457023} + m_Children: [] + m_Father: {fileID: 584220654} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!102 &1464450240 +TextMesh: + serializedVersion: 3 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1464450238} + m_Text: Thermal Vision + m_OffsetZ: -1.5 + m_CharacterSize: 0.075 + m_LineSpacing: 1 + m_Anchor: 4 + m_Alignment: 0 + m_TabSize: 4 + m_FontSize: 100 + m_FontStyle: 0 + m_RichText: 1 + m_Font: {fileID: 12800000, guid: a4e6a5491519adb45919dc87eff28e55, type: 3} + m_Color: + serializedVersion: 2 + rgba: 4294967295 +--- !u!23 &1464450241 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1464450238} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 10100, guid: 0000000000000000e000000000000000, type: 0} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!1 &1466512395 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1466512396} + - component: {fileID: 1466512398} + - component: {fileID: 1466512397} + m_Layer: 0 + m_Name: Animated + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 0 +--- !u!4 &1466512396 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1466512395} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: -4.447157, z: 0} + m_LocalScale: {x: 1.2457023, y: 1.2457023, z: 1.2457023} + m_Children: [] + m_Father: {fileID: 694591670} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!102 &1466512397 +TextMesh: + serializedVersion: 3 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1466512395} + m_Text: (Has Animation) + m_OffsetZ: -1.5 + m_CharacterSize: 0.075 + m_LineSpacing: 1 + m_Anchor: 4 + m_Alignment: 0 + m_TabSize: 4 + m_FontSize: 100 + m_FontStyle: 0 + m_RichText: 1 + m_Font: {fileID: 12800000, guid: a4e6a5491519adb45919dc87eff28e55, type: 3} + m_Color: + serializedVersion: 2 + rgba: 4294967295 +--- !u!23 &1466512398 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1466512395} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: a4e6a5491519adb45919dc87eff28e55, type: 3} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!1 &1471800764 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1471800765} + - component: {fileID: 1471800767} + - component: {fileID: 1471800766} + m_Layer: 0 + m_Name: Title + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1471800765 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1471800764} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: -2.51, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 368348656} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!102 &1471800766 +TextMesh: + serializedVersion: 3 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1471800764} + m_Text: Ghost + m_OffsetZ: -1.5 + m_CharacterSize: 0.075 + m_LineSpacing: 1 + m_Anchor: 4 + m_Alignment: 0 + m_TabSize: 4 + m_FontSize: 100 + m_FontStyle: 0 + m_RichText: 1 + m_Font: {fileID: 12800000, guid: a4e6a5491519adb45919dc87eff28e55, type: 3} + m_Color: + serializedVersion: 2 + rgba: 4294967295 +--- !u!23 &1471800767 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1471800764} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 10100, guid: 0000000000000000e000000000000000, type: 0} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!1 &1478122370 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1478122371} + - component: {fileID: 1478122374} + - component: {fileID: 1478122373} + m_Layer: 0 + m_Name: OutlineAlwaysVisible + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1478122371 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1478122370} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 370, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 2134460149} + - {fileID: 326244155} + - {fileID: 1848773095} + - {fileID: 482750999} + m_Father: {fileID: 1563905016} + m_RootOrder: 37 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &1478122373 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1478122370} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 98b644315d7a92842b89e04f55c48e02, type: 3} + m_Name: + m_EditorClassIdentifier: +--- !u!212 &1478122374 +SpriteRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1478122370} + m_Enabled: 1 + m_CastShadows: 0 + m_ReceiveShadows: 0 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 1435312052} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 0 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_Sprite: {fileID: 21300000, guid: 519dafacd208bb64c83d5124be03b09d, type: 3} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_FlipX: 0 + m_FlipY: 0 + m_DrawMode: 0 + m_Size: {x: 5.12, y: 5.12} + m_AdaptiveModeThreshold: 0.5 + m_SpriteTileMode: 0 + m_WasSpriteAssigned: 1 + m_MaskInteraction: 0 + m_SpriteSortPoint: 0 +--- !u!1 &1484598036 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1484598037} + - component: {fileID: 1484598039} + - component: {fileID: 1484598038} + m_Layer: 0 + m_Name: Animated + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 0 +--- !u!4 &1484598037 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1484598036} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: -4.447157, z: 0} + m_LocalScale: {x: 1.2457023, y: 1.2457023, z: 1.2457023} + m_Children: [] + m_Father: {fileID: 1227823621} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!102 &1484598038 +TextMesh: + serializedVersion: 3 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1484598036} + m_Text: (Has Animation) + m_OffsetZ: -1.5 + m_CharacterSize: 0.075 + m_LineSpacing: 1 + m_Anchor: 4 + m_Alignment: 0 + m_TabSize: 4 + m_FontSize: 100 + m_FontStyle: 0 + m_RichText: 1 + m_Font: {fileID: 12800000, guid: a4e6a5491519adb45919dc87eff28e55, type: 3} + m_Color: + serializedVersion: 2 + rgba: 4294967295 +--- !u!23 &1484598039 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1484598036} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: a4e6a5491519adb45919dc87eff28e55, type: 3} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!1 &1497593393 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1497593394} + - component: {fileID: 1497593396} + - component: {fileID: 1497593395} + m_Layer: 0 + m_Name: Animated + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1497593394 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1497593393} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: -4.447157, z: 0} + m_LocalScale: {x: 1.2457023, y: 1.2457023, z: 1.2457023} + m_Children: [] + m_Father: {fileID: 944684573} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!102 &1497593395 +TextMesh: + serializedVersion: 3 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1497593393} + m_Text: (Has Animation) + m_OffsetZ: -1.5 + m_CharacterSize: 0.075 + m_LineSpacing: 1 + m_Anchor: 4 + m_Alignment: 0 + m_TabSize: 4 + m_FontSize: 100 + m_FontStyle: 0 + m_RichText: 1 + m_Font: {fileID: 12800000, guid: a4e6a5491519adb45919dc87eff28e55, type: 3} + m_Color: + serializedVersion: 2 + rgba: 4294967295 +--- !u!23 &1497593396 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1497593393} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 10100, guid: 0000000000000000e000000000000000, type: 0} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!1 &1507269761 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1507269762} + - component: {fileID: 1507269766} + - component: {fileID: 1507269765} + - component: {fileID: 1507269763} + m_Layer: 0 + m_Name: Twist Disappear + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1507269762 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1507269761} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 50, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 1939573377} + m_Father: {fileID: 1563905016} + m_RootOrder: 5 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!95 &1507269763 +Animator: + serializedVersion: 3 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1507269761} + m_Enabled: 1 + m_Avatar: {fileID: 0} + m_Controller: {fileID: 9100000, guid: fe198228e3a49df4b966ab214ec9cde5, type: 2} + m_CullingMode: 0 + m_UpdateMode: 0 + m_ApplyRootMotion: 0 + m_LinearVelocityBlending: 0 + m_WarningMessage: + m_HasTransformHierarchy: 1 + m_AllowConstantClipSamplingOptimization: 1 + m_KeepAnimatorControllerStateOnDisable: 0 +--- !u!114 &1507269765 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1507269761} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 98b644315d7a92842b89e04f55c48e02, type: 3} + m_Name: + m_EditorClassIdentifier: +--- !u!212 &1507269766 +SpriteRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1507269761} + m_Enabled: 1 + m_CastShadows: 0 + m_ReceiveShadows: 0 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 1912112097} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 0 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_Sprite: {fileID: 21300000, guid: 519dafacd208bb64c83d5124be03b09d, type: 3} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_FlipX: 0 + m_FlipY: 0 + m_DrawMode: 0 + m_Size: {x: 5.12, y: 5.12} + m_AdaptiveModeThreshold: 0.5 + m_SpriteTileMode: 0 + m_WasSpriteAssigned: 1 + m_MaskInteraction: 0 + m_SpriteSortPoint: 0 +--- !u!1 &1510314497 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1510314498} + - component: {fileID: 1510314500} + - component: {fileID: 1510314499} + m_Layer: 0 + m_Name: Title + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1510314498 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1510314497} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: -2.51, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 1687594936} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!102 &1510314499 +TextMesh: + serializedVersion: 3 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1510314497} + m_Text: Alpha Cutoff + m_OffsetZ: -1.5 + m_CharacterSize: 0.075 + m_LineSpacing: 1 + m_Anchor: 4 + m_Alignment: 0 + m_TabSize: 4 + m_FontSize: 100 + m_FontStyle: 0 + m_RichText: 1 + m_Font: {fileID: 12800000, guid: a4e6a5491519adb45919dc87eff28e55, type: 3} + m_Color: + serializedVersion: 2 + rgba: 4294967295 +--- !u!23 &1510314500 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1510314497} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 10100, guid: 0000000000000000e000000000000000, type: 0} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!1 &1511231069 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1511231070} + - component: {fileID: 1511231072} + - component: {fileID: 1511231071} + m_Layer: 0 + m_Name: Animated + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 0 +--- !u!4 &1511231070 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1511231069} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: -3.57, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 290590332} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!102 &1511231071 +TextMesh: + serializedVersion: 3 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1511231069} + m_Text: (Has Animation) + m_OffsetZ: -1.5 + m_CharacterSize: 0.075 + m_LineSpacing: 1 + m_Anchor: 4 + m_Alignment: 0 + m_TabSize: 4 + m_FontSize: 100 + m_FontStyle: 0 + m_RichText: 1 + m_Font: {fileID: 12800000, guid: a4e6a5491519adb45919dc87eff28e55, type: 3} + m_Color: + serializedVersion: 2 + rgba: 4294967295 +--- !u!23 &1511231072 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1511231069} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: a4e6a5491519adb45919dc87eff28e55, type: 3} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!1 &1521478959 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1521478960} + - component: {fileID: 1521478962} + - component: {fileID: 1521478961} + m_Layer: 0 + m_Name: Sprite3 + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1521478960 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1521478959} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: -0.11, y: -0.66, z: -0.1} + m_LocalScale: {x: 1.0657709, y: 1.0657709, z: 1.0657709} + m_Children: [] + m_Father: {fileID: 1415143267} + m_RootOrder: 2 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &1521478961 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1521478959} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: ee158225ee1e59f4791627785501d950, type: 3} + m_Name: + m_EditorClassIdentifier: + currentShaderType: 4 + normalStrength: 5 + normalSmoothing: 1 + computingNormal: 0 +--- !u!212 &1521478962 +SpriteRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1521478959} + m_Enabled: 1 + m_CastShadows: 0 + m_ReceiveShadows: 0 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2007448611} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 0 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_Sprite: {fileID: 21300000, guid: 519dafacd208bb64c83d5124be03b09d, type: 3} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_FlipX: 0 + m_FlipY: 0 + m_DrawMode: 0 + m_Size: {x: 5.12, y: 5.12} + m_AdaptiveModeThreshold: 0.5 + m_SpriteTileMode: 0 + m_WasSpriteAssigned: 1 + m_MaskInteraction: 0 + m_SpriteSortPoint: 0 +--- !u!1 &1522371943 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1522371944} + - component: {fileID: 1522371946} + - component: {fileID: 1522371945} + m_Layer: 0 + m_Name: Animated + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1522371944 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1522371943} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: -3.57, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 746759203} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!102 &1522371945 +TextMesh: + serializedVersion: 3 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1522371943} + m_Text: (Has Animation) + m_OffsetZ: -1.5 + m_CharacterSize: 0.075 + m_LineSpacing: 1 + m_Anchor: 4 + m_Alignment: 0 + m_TabSize: 4 + m_FontSize: 100 + m_FontStyle: 0 + m_RichText: 1 + m_Font: {fileID: 12800000, guid: a4e6a5491519adb45919dc87eff28e55, type: 3} + m_Color: + serializedVersion: 2 + rgba: 4294967295 +--- !u!23 &1522371946 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1522371943} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 10100, guid: 0000000000000000e000000000000000, type: 0} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!1 &1523182284 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1523182285} + - component: {fileID: 1523182287} + - component: {fileID: 1523182286} + m_Layer: 0 + m_Name: Title + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1523182285 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1523182284} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: -3.1267126, z: 0} + m_LocalScale: {x: 1.2457023, y: 1.2457023, z: 1.2457023} + m_Children: [] + m_Father: {fileID: 1861014113} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!102 &1523182286 +TextMesh: + serializedVersion: 3 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1523182284} + m_Text: Burning Soldier + m_OffsetZ: -1.5 + m_CharacterSize: 0.075 + m_LineSpacing: 1 + m_Anchor: 4 + m_Alignment: 0 + m_TabSize: 4 + m_FontSize: 100 + m_FontStyle: 0 + m_RichText: 1 + m_Font: {fileID: 12800000, guid: a4e6a5491519adb45919dc87eff28e55, type: 3} + m_Color: + serializedVersion: 2 + rgba: 4294967295 +--- !u!23 &1523182287 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1523182284} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 10100, guid: 0000000000000000e000000000000000, type: 0} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!1 &1527473306 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1527473307} + - component: {fileID: 1527473309} + - component: {fileID: 1527473308} + m_Layer: 0 + m_Name: Animated + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1527473307 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1527473306} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: -4.447157, z: 0} + m_LocalScale: {x: 1.2457023, y: 1.2457023, z: 1.2457023} + m_Children: [] + m_Father: {fileID: 511167261} + m_RootOrder: 2 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!102 &1527473308 +TextMesh: + serializedVersion: 3 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1527473306} + m_Text: (Sprite Mask and Particles) + m_OffsetZ: -1.5 + m_CharacterSize: 0.05 + m_LineSpacing: 1 + m_Anchor: 4 + m_Alignment: 0 + m_TabSize: 4 + m_FontSize: 100 + m_FontStyle: 0 + m_RichText: 1 + m_Font: {fileID: 12800000, guid: a4e6a5491519adb45919dc87eff28e55, type: 3} + m_Color: + serializedVersion: 2 + rgba: 4294967295 +--- !u!23 &1527473309 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1527473306} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 10100, guid: 0000000000000000e000000000000000, type: 0} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!1 &1528149038 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1528149039} + - component: {fileID: 1528149042} + - component: {fileID: 1528149041} + m_Layer: 0 + m_Name: JellyFishSoldier + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1528149039 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1528149038} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 240, y: 0, z: 0} + m_LocalScale: {x: 0.80276, y: 0.80276, z: 0.80276} + m_Children: + - {fileID: 1117637836} + - {fileID: 1881847164} + m_Father: {fileID: 1563905016} + m_RootOrder: 24 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &1528149041 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1528149038} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 98b644315d7a92842b89e04f55c48e02, type: 3} + m_Name: + m_EditorClassIdentifier: +--- !u!212 &1528149042 +SpriteRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1528149038} + m_Enabled: 1 + m_CastShadows: 0 + m_ReceiveShadows: 0 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 1045875747} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 0 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_Sprite: {fileID: 21300000, guid: 519dafacd208bb64c83d5124be03b09d, type: 3} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_FlipX: 0 + m_FlipY: 0 + m_DrawMode: 0 + m_Size: {x: 5.12, y: 5.12} + m_AdaptiveModeThreshold: 0.5 + m_SpriteTileMode: 0 + m_WasSpriteAssigned: 1 + m_MaskInteraction: 0 + m_SpriteSortPoint: 0 +--- !u!21 &1537019967 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: AllIn1SpriteShader/AllIn1SpriteShader + m_Shader: {fileID: 4800000, guid: a36b7719ff0465b42ab1407d67672c5f, type: 3} + m_ShaderKeywords: ETC1_EXTERNAL_ALPHA GRADIENT_ON + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _ColorRampTex: + m_Texture: {fileID: 2800000, guid: 279657edc397ece4b8029c727adf6ddc, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ColorRampTexGradient: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ColorSwapTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DistortTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _FadeBurnTex: + m_Texture: {fileID: 2800000, guid: 32e8df0008bebe746b1681a71c61f31c, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _FadeTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _GlowTex: + 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} + - _OutlineDistortTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OutlineTex: + m_Texture: {fileID: 2800000, guid: 74087f6d03f233e4a8a142fa01f9e5cf, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OverlayTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ShineMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - _Alpha: 1 + - _AlphaCutoffValue: 0.25 + - _AlphaOutlineBlend: 1 + - _AlphaOutlineGlow: 5 + - _AlphaOutlineMinAlpha: 0 + - _AlphaOutlinePower: 1 + - _AlphaRoundThreshold: 0.5 + - _BillboardY: 0 + - _BlurHD: 0 + - _BlurIntensity: 10 + - _Brightness: 0 + - _ChromAberrAlpha: 0.4 + - _ChromAberrAmount: 1 + - _ClipUvDown: 1 + - _ClipUvLeft: 1 + - _ClipUvRight: 1 + - _ClipUvUp: 1 + - _ColorChangeLuminosity: 0 + - _ColorChangeTolerance: 0.25 + - _ColorChangeTolerance2: 0.25 + - _ColorChangeTolerance3: 0.25 + - _ColorRampBlend: 1 + - _ColorRampLuminosity: 0 + - _ColorRampOutline: 0 + - _ColorSwapBlend: 1 + - _ColorSwapBlueLuminosity: 0.5 + - _ColorSwapGreenLuminosity: 0.5 + - _ColorSwapRedLuminosity: 0.5 + - _Contrast: 1 + - _CullingOption: 0 + - _DistortAmount: 0.5 + - _DistortTexXSpeed: 5 + - _DistortTexYSpeed: 5 + - _EditorDrawers: 6 + - _FadeAmount: -0.1 + - _FadeBurnGlow: 2 + - _FadeBurnTransition: 0.075 + - _FadeBurnWidth: 0.025 + - _FishEyeUvAmount: 0.35 + - _FlickerAlpha: 0 + - _FlickerFreq: 0.2 + - _FlickerPercent: 0.05 + - _GhostBlend: 1 + - _GhostColorBoost: 1 + - _GhostTransparency: 0 + - _GlitchAmount: 3 + - _GlitchSize: 1 + - _Glow: 14.9 + - _GlowGlobal: 1 + - _GlowTexUsed: 0 + - _GradBlend: 1 + - _GradBoostX: 1.2 + - _GradBoostY: 1.2 + - _GradIsRadial: 0 + - _GrassManualAnim: 1 + - _GrassManualToggle: 0 + - _GrassRadialBend: 0.25 + - _GrassSpeed: 2 + - _GrassWind: 20 + - _GreyscaleBlend: 1 + - _GreyscaleLuminosity: 0 + - _GreyscaleOutline: 0 + - _HandDrawnAmount: 10 + - _HandDrawnSpeed: 5 + - _HitEffectBlend: 1 + - _HitEffectGlow: 5 + - _HologramBlend: 1 + - _HologramFlickerAlpha: 0 + - _HologramFlickerFreq: 0.2 + - _HologramFlickerPercent: 0.05 + - _HologramMaxAlpha: 1 + - _HologramMinAlpha: 0 + - _HologramStripesAlpha: 0.4 + - _HologramStripesAmount: 50 + - _HologramStripesFill: 0.4 + - _HologramStripesLuminosity: 1 + - _HologramStripesSpeed: 5 + - _HologramUnmodAmount: 0.4 + - _HsvBright: 1 + - _HsvSaturation: 1 + - _HsvShift: 180 + - _InnerOutlineAlpha: 1 + - _InnerOutlineGlow: 1 + - _InnerOutlineThickness: 0 + - _MaxXUV: 1 + - _MaxYUV: 1 + - _MinXUV: 0 + - _MinYUV: 0 + - _MotionBlurAngle: 0.1 + - _MotionBlurDist: 1.25 + - _MyDstMode: 10 + - _MySrcMode: 5 + - _NegativeAmount: 1 + - _OffsetUvX: 0 + - _OffsetUvY: 0 + - _OnlyInnerOutline: 0 + - _OnlyOutline: 0 + - _Outline8Directions: 0 + - _OutlineAlpha: 1 + - _OutlineDistortAmount: 0.5 + - _OutlineDistortTexXSpeed: 5 + - _OutlineDistortTexYSpeed: 5 + - _OutlineDistortToggle: 0 + - _OutlineGlow: 1.5 + - _OutlineIsPixel: 0 + - _OutlinePixelWidth: 1 + - _OutlineTexGrey: 0 + - _OutlineTexToggle: 0 + - _OutlineTexXSpeed: 10 + - _OutlineTexYSpeed: 0 + - _OutlineWidth: 0.004 + - _OverlayBlend: 1 + - _OverlayGlow: 1 + - _OverlayTextureScrollXSpeed: 0.25 + - _OverlayTextureScrollYSpeed: 0.25 + - _PinchUvAmount: 0.35 + - _PixelateSize: 32 + - _PosterizeGamma: 0.75 + - _PosterizeNumColors: 8 + - _PosterizeOutline: 0 + - _RadialClip: 45 + - _RadialClip2: 0 + - _RadialClipAngle: 90 + - _RadialClipArc1: 45 + - _RadialClipArc2: 0 + - _RadialStartAngle: 90 + - _RandomSeed: 0 + - _RectSize: 1 + - _RotateUvAmount: 0 + - _RoundWaveSpeed: 2 + - _RoundWaveStrength: 0.7 + - _ShadowAlpha: 0.5 + - _ShadowX: 0.1 + - _ShadowY: -0.05 + - _ShakeUvSpeed: 2.5 + - _ShakeUvX: 1.5 + - _ShakeUvY: 1 + - _ShineGlow: 1 + - _ShineLocation: 0.5 + - _ShineRotate: 0 + - _ShineWidth: 0.1 + - _TextureScrollXSpeed: 1 + - _TextureScrollYSpeed: 0 + - _TwistUvAmount: 1 + - _TwistUvPosX: 0.5 + - _TwistUvPosY: 0.5 + - _TwistUvRadius: 0.75 + - _WarpScale: 0.5 + - _WarpSpeed: 8 + - _WarpStrength: 0.025 + - _WaveAmount: 7 + - _WaveSpeed: 10 + - _WaveStrength: 7.5 + - _WaveX: 0 + - _WaveY: 0.5 + - _ZTestMode: 4 + - _ZWrite: 0 + - _ZoomUvAmount: 0.5 + m_Colors: + - ColorSwapRed: {r: 1, g: 1, b: 1, a: 1} + - _AlphaOutlineColor: {r: 1, g: 1, b: 1, a: 1} + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _ColorChangeNewCol: {r: 1, g: 1, b: 0, a: 1} + - _ColorChangeNewCol2: {r: 1, g: 1, b: 0, a: 1} + - _ColorChangeNewCol3: {r: 1, g: 1, b: 0, a: 1} + - _ColorChangeTarget: {r: 1, g: 0, b: 0, a: 1} + - _ColorChangeTarget2: {r: 1, g: 0, b: 0, a: 1} + - _ColorChangeTarget3: {r: 1, g: 0, b: 0, a: 1} + - _ColorSwapBlue: {r: 1, g: 1, b: 1, a: 1} + - _ColorSwapGreen: {r: 1, g: 1, b: 1, a: 1} + - _ColorSwapRed: {r: 1, g: 1, b: 1, a: 1} + - _FadeBurnColor: {r: 1, g: 1, b: 0, a: 1} + - _GlowColor: {r: 0.047169805, g: 0.047169805, b: 0.047169805, a: 1} + - _GradBotLeftCol: {r: 0.1792453, g: 0.1792453, b: 0.1792453, a: 1} + - _GradBotRightCol: {r: 0, g: 0, b: 0, a: 1} + - _GradTopLeftCol: {r: 0.754717, g: 0.754717, b: 0.754717, a: 1} + - _GradTopRightCol: {r: 0.3207547, g: 0.3197579, b: 0.3192417, a: 1} + - _GreyscaleTintColor: {r: 1, g: 1, b: 1, a: 1} + - _HitEffectColor: {r: 1, g: 1, b: 1, a: 1} + - _HologramStripeColor: {r: 1, g: 1, b: 1, a: 1} + - _InnerOutlineColor: {r: 1, g: 0, b: 0, a: 1} + - _OutlineColor: {r: 1, g: 1, b: 1, a: 1} + - _OverlayColor: {r: 1, g: 1, b: 1, a: 1} + - _ShadowColor: {r: 0, g: 0, b: 0, a: 1} + - _ShineColor: {r: 1, g: 1, b: 1, a: 1} +--- !u!1 &1554650440 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1554650441} + - component: {fileID: 1554650444} + - component: {fileID: 1554650443} + m_Layer: 0 + m_Name: Wave + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1554650441 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1554650440} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 30, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 912083092} + - {fileID: 933861178} + m_Father: {fileID: 1351315063} + m_RootOrder: 3 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &1554650443 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1554650440} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 98b644315d7a92842b89e04f55c48e02, type: 3} + m_Name: + m_EditorClassIdentifier: +--- !u!212 &1554650444 +SpriteRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1554650440} + m_Enabled: 1 + m_CastShadows: 0 + m_ReceiveShadows: 0 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 1984207367} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 0 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_Sprite: {fileID: 21300000, guid: 519dafacd208bb64c83d5124be03b09d, type: 3} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_FlipX: 0 + m_FlipY: 0 + m_DrawMode: 0 + m_Size: {x: 5.12, y: 5.12} + m_AdaptiveModeThreshold: 0.5 + m_SpriteTileMode: 0 + m_WasSpriteAssigned: 1 + m_MaskInteraction: 0 + m_SpriteSortPoint: 0 +--- !u!1 &1562540216 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1562540217} + - component: {fileID: 1562540219} + - component: {fileID: 1562540218} + m_Layer: 0 + m_Name: Animated + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1562540217 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1562540216} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: -3.57, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 1901854650} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!102 &1562540218 +TextMesh: + serializedVersion: 3 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1562540216} + m_Text: (Has Animation) + m_OffsetZ: -1.5 + m_CharacterSize: 0.075 + m_LineSpacing: 1 + m_Anchor: 4 + m_Alignment: 0 + m_TabSize: 4 + m_FontSize: 100 + m_FontStyle: 0 + m_RichText: 1 + m_Font: {fileID: 12800000, guid: a4e6a5491519adb45919dc87eff28e55, type: 3} + m_Color: + serializedVersion: 2 + rgba: 4294967295 +--- !u!23 &1562540219 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1562540216} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 10100, guid: 0000000000000000e000000000000000, type: 0} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!1 &1563905014 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1563905016} + - component: {fileID: 1563905015} + - component: {fileID: 1563905017} + m_Layer: 0 + m_Name: 3.Effect Combinations + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!114 &1563905015 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1563905014} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 6972382efdee4c642812251660f0c4bb, type: 3} + m_Name: + m_EditorClassIdentifier: + radius: 45 + rotateSpeed: 10 +--- !u!4 &1563905016 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1563905014} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: -30, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 1934762264} + - {fileID: 2045252512} + - {fileID: 252177636} + - {fileID: 1350115731} + - {fileID: 1875180451} + - {fileID: 1507269762} + - {fileID: 1675838108} + - {fileID: 1038353159} + - {fileID: 1374997139} + - {fileID: 766050008} + - {fileID: 47460684} + - {fileID: 353408739} + - {fileID: 595151377} + - {fileID: 2035943844} + - {fileID: 1756331349} + - {fileID: 950130248} + - {fileID: 242385329} + - {fileID: 1953432852} + - {fileID: 1211354477} + - {fileID: 1883979700} + - {fileID: 642204093} + - {fileID: 102412577} + - {fileID: 4005302481246734412} + - {fileID: 407134450} + - {fileID: 1528149039} + - {fileID: 42135250} + - {fileID: 357954209} + - {fileID: 499272004} + - {fileID: 2096881075} + - {fileID: 450696184} + - {fileID: 694591670} + - {fileID: 982048496} + - {fileID: 584220654} + - {fileID: 1415143267} + - {fileID: 1861014113} + - {fileID: 511167261} + - {fileID: 1893925001} + - {fileID: 1478122371} + m_Father: {fileID: 732186310} + m_RootOrder: 2 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &1563905017 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1563905014} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 681095680e77fad40a6dd907b8ba358b, type: 3} + m_Name: + m_EditorClassIdentifier: + paddingX: 10 +--- !u!1 &1571920278 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1571920279} + - component: {fileID: 1571920281} + - component: {fileID: 1571920280} + m_Layer: 0 + m_Name: Title + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1571920279 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1571920278} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: -2.51, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 4825911116503289154} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!102 &1571920280 +TextMesh: + serializedVersion: 3 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1571920278} + m_Text: Original Sprite + m_OffsetZ: -1.5 + m_CharacterSize: 0.075 + m_LineSpacing: 1 + m_Anchor: 4 + m_Alignment: 0 + m_TabSize: 4 + m_FontSize: 100 + m_FontStyle: 0 + m_RichText: 1 + m_Font: {fileID: 12800000, guid: a4e6a5491519adb45919dc87eff28e55, type: 3} + m_Color: + serializedVersion: 2 + rgba: 4294967295 +--- !u!23 &1571920281 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1571920278} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 10100, guid: 0000000000000000e000000000000000, type: 0} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!1 &1586363707 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1586363708} + - component: {fileID: 1586363710} + - component: {fileID: 1586363709} + m_Layer: 0 + m_Name: Animated + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 0 +--- !u!4 &1586363708 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1586363707} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: -3.57, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 102412577} + m_RootOrder: 4 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!102 &1586363709 +TextMesh: + serializedVersion: 3 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1586363707} + m_Text: (Has Animation) + m_OffsetZ: -1.5 + m_CharacterSize: 0.075 + m_LineSpacing: 1 + m_Anchor: 4 + m_Alignment: 0 + m_TabSize: 4 + m_FontSize: 100 + m_FontStyle: 0 + m_RichText: 1 + m_Font: {fileID: 12800000, guid: a4e6a5491519adb45919dc87eff28e55, type: 3} + m_Color: + serializedVersion: 2 + rgba: 4294967295 +--- !u!23 &1586363710 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1586363707} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: a4e6a5491519adb45919dc87eff28e55, type: 3} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!1 &1601051769 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1601051770} + - component: {fileID: 1601051772} + - component: {fileID: 1601051771} + m_Layer: 0 + m_Name: Animated + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 0 +--- !u!4 &1601051770 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1601051769} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: -3.57, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 1778749804} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!102 &1601051771 +TextMesh: + serializedVersion: 3 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1601051769} + m_Text: (Has Animation) + m_OffsetZ: -1.5 + m_CharacterSize: 0.075 + m_LineSpacing: 1 + m_Anchor: 4 + m_Alignment: 0 + m_TabSize: 4 + m_FontSize: 100 + m_FontStyle: 0 + m_RichText: 1 + m_Font: {fileID: 12800000, guid: a4e6a5491519adb45919dc87eff28e55, type: 3} + m_Color: + serializedVersion: 2 + rgba: 4294967295 +--- !u!23 &1601051772 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1601051769} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: a4e6a5491519adb45919dc87eff28e55, type: 3} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!21 &1605957010 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: AllIn1SpriteShader/AllIn1SpriteShader + m_Shader: {fileID: 4800000, guid: a36b7719ff0465b42ab1407d67672c5f, type: 3} + m_ShaderKeywords: ETC1_EXTERNAL_ALPHA OFFSETUV_ON OUTBASE8DIR_ON _OUTLINE8DIRECTIONS_ON + _OUTLINETEXTOGGLE_ON + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _ColorRampTex: + m_Texture: {fileID: 2800000, guid: 279657edc397ece4b8029c727adf6ddc, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ColorRampTexGradient: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ColorSwapTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DistortTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _FadeBurnTex: + m_Texture: {fileID: 2800000, guid: 32e8df0008bebe746b1681a71c61f31c, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _FadeTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _GlowTex: + 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} + - _OutlineDistortTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OutlineTex: + m_Texture: {fileID: 2800000, guid: 74087f6d03f233e4a8a142fa01f9e5cf, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OverlayTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ShineMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - _Alpha: 1 + - _AlphaCutoffValue: 0.25 + - _AlphaOutlineBlend: 1 + - _AlphaOutlineGlow: 5 + - _AlphaOutlineMinAlpha: 0 + - _AlphaOutlinePower: 1 + - _AlphaRoundThreshold: 0.5 + - _BillboardY: 0 + - _BlurHD: 0 + - _BlurIntensity: 10 + - _Brightness: 0 + - _ChromAberrAlpha: 0.4 + - _ChromAberrAmount: 1 + - _ClipUvDown: 1 + - _ClipUvLeft: 1 + - _ClipUvRight: 1 + - _ClipUvUp: 1 + - _ColorChangeLuminosity: 0 + - _ColorChangeTolerance: 0.25 + - _ColorChangeTolerance2: 0.25 + - _ColorChangeTolerance3: 0.25 + - _ColorRampBlend: 1 + - _ColorRampLuminosity: 0 + - _ColorRampOutline: 0 + - _ColorSwapBlend: 1 + - _ColorSwapBlueLuminosity: 0.5 + - _ColorSwapGreenLuminosity: 0.5 + - _ColorSwapRedLuminosity: 0.5 + - _Contrast: 1 + - _CullingOption: 0 + - _DistortAmount: 0.5 + - _DistortTexXSpeed: 5 + - _DistortTexYSpeed: 5 + - _EditorDrawers: 6 + - _FadeAmount: -0.1 + - _FadeBurnGlow: 2 + - _FadeBurnTransition: 0.075 + - _FadeBurnWidth: 0.025 + - _FishEyeUvAmount: 0.35 + - _FlickerAlpha: 0 + - _FlickerFreq: 0.2 + - _FlickerPercent: 0.05 + - _GhostBlend: 1 + - _GhostColorBoost: 1 + - _GhostTransparency: 0 + - _GlitchAmount: 3 + - _GlitchSize: 1 + - _Glow: 10 + - _GlowGlobal: 1 + - _GlowTexUsed: 0 + - _GradBlend: 1 + - _GradBoostX: 1.2 + - _GradBoostY: 1.2 + - _GradIsRadial: 0 + - _GrassManualAnim: 1 + - _GrassManualToggle: 0 + - _GrassRadialBend: 0.25 + - _GrassSpeed: 2 + - _GrassWind: 20 + - _GreyscaleBlend: 1 + - _GreyscaleLuminosity: 0 + - _GreyscaleOutline: 0 + - _HandDrawnAmount: 10 + - _HandDrawnSpeed: 5 + - _HitEffectBlend: 1 + - _HitEffectGlow: 5 + - _HologramBlend: 1 + - _HologramFlickerAlpha: 0 + - _HologramFlickerFreq: 0.2 + - _HologramFlickerPercent: 0.05 + - _HologramMaxAlpha: 1 + - _HologramMinAlpha: 0 + - _HologramStripesAlpha: 0.4 + - _HologramStripesAmount: 50 + - _HologramStripesFill: 0.4 + - _HologramStripesLuminosity: 1 + - _HologramStripesSpeed: 5 + - _HologramUnmodAmount: 0.4 + - _HsvBright: 1 + - _HsvSaturation: 1 + - _HsvShift: 180 + - _InnerOutlineAlpha: 1 + - _InnerOutlineGlow: 1 + - _InnerOutlineThickness: 1 + - _MaxXUV: 1 + - _MaxYUV: 1 + - _MinXUV: 0 + - _MinYUV: 0 + - _MotionBlurAngle: 0.1 + - _MotionBlurDist: 1.25 + - _MyDstMode: 10 + - _MySrcMode: 5 + - _NegativeAmount: 1 + - _OffsetUvX: 0 + - _OffsetUvY: 0 + - _OnlyInnerOutline: 0 + - _OnlyOutline: 0 + - _Outline8Directions: 1 + - _OutlineAlpha: 1 + - _OutlineDistortAmount: 0.5 + - _OutlineDistortTexXSpeed: 5 + - _OutlineDistortTexYSpeed: 5 + - _OutlineDistortToggle: 0 + - _OutlineGlow: 1.5 + - _OutlineIsPixel: 0 + - _OutlinePixelWidth: 1 + - _OutlineTexGrey: 0 + - _OutlineTexToggle: 1 + - _OutlineTexXSpeed: 10 + - _OutlineTexYSpeed: 0 + - _OutlineWidth: 0.0137 + - _OverlayBlend: 1 + - _OverlayGlow: 1 + - _OverlayTextureScrollXSpeed: 0.25 + - _OverlayTextureScrollYSpeed: 0.25 + - _PinchUvAmount: 0.35 + - _PixelateSize: 32 + - _PosterizeGamma: 0.75 + - _PosterizeNumColors: 8 + - _PosterizeOutline: 0 + - _RadialClip: 0 + - _RadialClip2: 45 + - _RadialClipAngle: 90 + - _RadialClipArc1: 45 + - _RadialClipArc2: 0 + - _RadialStartAngle: 90 + - _RandomSeed: 0 + - _RectSize: 1 + - _RotateUvAmount: 0 + - _RoundWaveSpeed: 2 + - _RoundWaveStrength: 0.7 + - _ShadowAlpha: 0.5 + - _ShadowX: 0.1 + - _ShadowY: -0.05 + - _ShakeUvSpeed: 2.5 + - _ShakeUvX: 1.5 + - _ShakeUvY: 1 + - _ShineGlow: 1 + - _ShineLocation: 0.5 + - _ShineRotate: 0 + - _ShineWidth: 0.1 + - _TextureScrollXSpeed: 1 + - _TextureScrollYSpeed: 0 + - _TwistUvAmount: 1 + - _TwistUvPosX: 0.5 + - _TwistUvPosY: 0.5 + - _TwistUvRadius: 0.75 + - _WarpScale: 0.5 + - _WarpSpeed: 8 + - _WarpStrength: 0.025 + - _WaveAmount: 7 + - _WaveSpeed: 10 + - _WaveStrength: 7.5 + - _WaveX: 0 + - _WaveY: 0.5 + - _ZTestMode: 4 + - _ZWrite: 0 + - _ZoomUvAmount: 0.5 + m_Colors: + - ColorSwapRed: {r: 1, g: 1, b: 1, a: 1} + - _AlphaOutlineColor: {r: 1, g: 1, b: 1, a: 1} + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _ColorChangeNewCol: {r: 1, g: 1, b: 0, a: 1} + - _ColorChangeNewCol2: {r: 1, g: 1, b: 0, a: 1} + - _ColorChangeNewCol3: {r: 1, g: 1, b: 0, a: 1} + - _ColorChangeTarget: {r: 1, g: 0, b: 0, a: 1} + - _ColorChangeTarget2: {r: 1, g: 0, b: 0, a: 1} + - _ColorChangeTarget3: {r: 1, g: 0, b: 0, a: 1} + - _ColorSwapBlue: {r: 1, g: 1, b: 1, a: 1} + - _ColorSwapGreen: {r: 1, g: 1, b: 1, a: 1} + - _ColorSwapRed: {r: 1, g: 1, b: 1, a: 1} + - _FadeBurnColor: {r: 1, g: 1, b: 0, a: 1} + - _GlowColor: {r: 1, g: 1, b: 1, a: 1} + - _GradBotLeftCol: {r: 0, g: 0, b: 1, a: 1} + - _GradBotRightCol: {r: 0, g: 0, b: 1, a: 1} + - _GradTopLeftCol: {r: 1, g: 0, b: 0, a: 1} + - _GradTopRightCol: {r: 1, g: 0, b: 0, a: 1} + - _GreyscaleTintColor: {r: 1, g: 1, b: 1, a: 1} + - _HitEffectColor: {r: 1, g: 1, b: 1, a: 1} + - _HologramStripeColor: {r: 1, g: 1, b: 1, a: 1} + - _InnerOutlineColor: {r: 1, g: 0, b: 0, a: 1} + - _OutlineColor: {r: 1, g: 1, b: 1, a: 1} + - _OverlayColor: {r: 1, g: 1, b: 1, a: 1} + - _ShadowColor: {r: 0, g: 0, b: 0, a: 1} + - _ShineColor: {r: 1, g: 1, b: 1, a: 1} +--- !u!4 &1613686741 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1613686742} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 20, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 453652828} + - {fileID: 1706778797} + m_Father: {fileID: 2036092933} + m_RootOrder: 2 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &1613686742 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1613686741} + - component: {fileID: 1613686744} + - component: {fileID: 1613686745} + - component: {fileID: 1613686746} + m_Layer: 0 + m_Name: Fade + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!212 &1613686744 +SpriteRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1613686742} + m_Enabled: 1 + m_CastShadows: 0 + m_ReceiveShadows: 0 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 772177650} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 0 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_Sprite: {fileID: 21300000, guid: 519dafacd208bb64c83d5124be03b09d, type: 3} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_FlipX: 0 + m_FlipY: 0 + m_DrawMode: 0 + m_Size: {x: 5.12, y: 5.12} + m_AdaptiveModeThreshold: 0.5 + m_SpriteTileMode: 0 + m_WasSpriteAssigned: 1 + m_MaskInteraction: 0 + m_SpriteSortPoint: 0 +--- !u!114 &1613686745 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1613686742} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 98b644315d7a92842b89e04f55c48e02, type: 3} + m_Name: + m_EditorClassIdentifier: +--- !u!95 &1613686746 +Animator: + serializedVersion: 3 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1613686742} + m_Enabled: 1 + m_Avatar: {fileID: 0} + m_Controller: {fileID: 9100000, guid: 2025469cc6b8be543a1b93993e746b75, type: 2} + m_CullingMode: 0 + m_UpdateMode: 0 + m_ApplyRootMotion: 0 + m_LinearVelocityBlending: 0 + m_WarningMessage: + m_HasTransformHierarchy: 1 + m_AllowConstantClipSamplingOptimization: 1 + m_KeepAnimatorControllerStateOnDisable: 0 +--- !u!1 &1618143721 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1618143722} + - component: {fileID: 1618143724} + - component: {fileID: 1618143723} + m_Layer: 0 + m_Name: Title + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1618143722 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1618143721} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: -2.51, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 443772011} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!102 &1618143723 +TextMesh: + serializedVersion: 3 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1618143721} + m_Text: Texture Scroll + m_OffsetZ: -1.5 + m_CharacterSize: 0.075 + m_LineSpacing: 1 + m_Anchor: 4 + m_Alignment: 0 + m_TabSize: 4 + m_FontSize: 100 + m_FontStyle: 0 + m_RichText: 1 + m_Font: {fileID: 12800000, guid: a4e6a5491519adb45919dc87eff28e55, type: 3} + m_Color: + serializedVersion: 2 + rgba: 4294967295 +--- !u!23 &1618143724 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1618143721} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 10100, guid: 0000000000000000e000000000000000, type: 0} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!1 &1641593522 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1641593523} + - component: {fileID: 1641593525} + - component: {fileID: 1641593524} + m_Layer: 0 + m_Name: Title + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1641593523 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1641593522} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: -2.51, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 1313138820} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!102 &1641593524 +TextMesh: + serializedVersion: 3 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1641593522} + m_Text: Change 1 Color + m_OffsetZ: -1.5 + m_CharacterSize: 0.075 + m_LineSpacing: 1 + m_Anchor: 4 + m_Alignment: 0 + m_TabSize: 4 + m_FontSize: 100 + m_FontStyle: 0 + m_RichText: 1 + m_Font: {fileID: 12800000, guid: a4e6a5491519adb45919dc87eff28e55, type: 3} + m_Color: + serializedVersion: 2 + rgba: 4294967295 +--- !u!23 &1641593525 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1641593522} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 10100, guid: 0000000000000000e000000000000000, type: 0} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!1 &1673476642 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1673476643} + - component: {fileID: 1673476645} + - component: {fileID: 1673476644} + m_Layer: 0 + m_Name: WaterSprite + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1673476643 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1673476642} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1.48, y: 1.48, z: 1.48} + m_Children: [] + m_Father: {fileID: 242385329} + m_RootOrder: 2 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &1673476644 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1673476642} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: ee158225ee1e59f4791627785501d950, type: 3} + m_Name: + m_EditorClassIdentifier: + currentShaderType: 4 + normalStrength: 5 + normalSmoothing: 1 + computingNormal: 0 +--- !u!212 &1673476645 +SpriteRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1673476642} + m_Enabled: 1 + m_CastShadows: 0 + m_ReceiveShadows: 0 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2105693144} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 0 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_Sprite: {fileID: 21300000, guid: bd3249e8aae01e748aaca0c062e2c19c, type: 3} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_FlipX: 0 + m_FlipY: 0 + m_DrawMode: 0 + m_Size: {x: 5.12, y: 5.12} + m_AdaptiveModeThreshold: 0.5 + m_SpriteTileMode: 0 + m_WasSpriteAssigned: 1 + m_MaskInteraction: 0 + m_SpriteSortPoint: 0 +--- !u!1 &1675838107 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1675838108} + - component: {fileID: 1675838112} + - component: {fileID: 1675838111} + m_Layer: 0 + m_Name: Army + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1675838108 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1675838107} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 60, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 608638373} + - {fileID: 489557969} + m_Father: {fileID: 1563905016} + m_RootOrder: 6 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &1675838111 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1675838107} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 98b644315d7a92842b89e04f55c48e02, type: 3} + m_Name: + m_EditorClassIdentifier: +--- !u!212 &1675838112 +SpriteRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1675838107} + m_Enabled: 1 + m_CastShadows: 0 + m_ReceiveShadows: 0 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 1399293758} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 0 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_Sprite: {fileID: 21300000, guid: 519dafacd208bb64c83d5124be03b09d, type: 3} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_FlipX: 0 + m_FlipY: 0 + m_DrawMode: 0 + m_Size: {x: 5.12, y: 5.12} + m_AdaptiveModeThreshold: 0.5 + m_SpriteTileMode: 0 + m_WasSpriteAssigned: 1 + m_MaskInteraction: 0 + m_SpriteSortPoint: 0 +--- !u!1 &1675907430 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1675907431} + - component: {fileID: 1675907433} + - component: {fileID: 1675907432} + m_Layer: 0 + m_Name: Title + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1675907431 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1675907430} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: -2.51, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 766050008} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!102 &1675907432 +TextMesh: + serializedVersion: 3 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1675907430} + m_Text: Gradient Scroll + m_OffsetZ: -1.5 + m_CharacterSize: 0.075 + m_LineSpacing: 1 + m_Anchor: 4 + m_Alignment: 0 + m_TabSize: 4 + m_FontSize: 100 + m_FontStyle: 0 + m_RichText: 1 + m_Font: {fileID: 12800000, guid: a4e6a5491519adb45919dc87eff28e55, type: 3} + m_Color: + serializedVersion: 2 + rgba: 4294967295 +--- !u!23 &1675907433 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1675907430} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 10100, guid: 0000000000000000e000000000000000, type: 0} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!1 &1687594935 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1687594936} + - component: {fileID: 1687594940} + - component: {fileID: 1687594939} + - component: {fileID: 1687594937} + m_Layer: 0 + m_Name: Alpha Cutoff + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1687594936 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1687594935} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 310, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 1510314498} + - {fileID: 2088187658} + m_Father: {fileID: 2036092933} + m_RootOrder: 31 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!95 &1687594937 +Animator: + serializedVersion: 3 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1687594935} + m_Enabled: 1 + m_Avatar: {fileID: 0} + m_Controller: {fileID: 9100000, guid: d7d72c9f17b0ebe4e908dab552b82c45, type: 2} + m_CullingMode: 0 + m_UpdateMode: 0 + m_ApplyRootMotion: 0 + m_LinearVelocityBlending: 0 + m_WarningMessage: + m_HasTransformHierarchy: 1 + m_AllowConstantClipSamplingOptimization: 1 + m_KeepAnimatorControllerStateOnDisable: 0 +--- !u!114 &1687594939 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1687594935} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 98b644315d7a92842b89e04f55c48e02, type: 3} + m_Name: + m_EditorClassIdentifier: +--- !u!212 &1687594940 +SpriteRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1687594935} + m_Enabled: 1 + m_CastShadows: 0 + m_ReceiveShadows: 0 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 70619476} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 0 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_Sprite: {fileID: 21300000, guid: 519dafacd208bb64c83d5124be03b09d, type: 3} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_FlipX: 0 + m_FlipY: 0 + m_DrawMode: 0 + m_Size: {x: 5.12, y: 5.12} + m_AdaptiveModeThreshold: 0.5 + m_SpriteTileMode: 0 + m_WasSpriteAssigned: 1 + m_MaskInteraction: 0 + m_SpriteSortPoint: 0 +--- !u!1 &1688633193 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1688633194} + - component: {fileID: 1688633196} + - component: {fileID: 1688633195} + m_Layer: 0 + m_Name: Sprite + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1688633194 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1688633193} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1.3336719, y: 1.333672, z: 1.3336719} + m_Children: [] + m_Father: {fileID: 166039413} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &1688633195 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1688633193} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: ee158225ee1e59f4791627785501d950, type: 3} + m_Name: + m_EditorClassIdentifier: + currentShaderType: 4 + normalStrength: 5 + normalSmoothing: 1 + computingNormal: 0 +--- !u!212 &1688633196 +SpriteRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1688633193} + m_Enabled: 1 + m_CastShadows: 0 + m_ReceiveShadows: 0 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 1213636577} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 0 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_Sprite: {fileID: 21300000, guid: bd3249e8aae01e748aaca0c062e2c19c, type: 3} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_FlipX: 0 + m_FlipY: 0 + m_DrawMode: 0 + m_Size: {x: 5.12, y: 5.12} + m_AdaptiveModeThreshold: 0.5 + m_SpriteTileMode: 0 + m_WasSpriteAssigned: 1 + m_MaskInteraction: 0 + m_SpriteSortPoint: 0 +--- !u!21 &1693197524 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: AllIn1SpriteShader/AllIn1SpriteShader + m_Shader: {fileID: 4800000, guid: a36b7719ff0465b42ab1407d67672c5f, type: 3} + m_ShaderKeywords: CONTRAST_ON ETC1_EXTERNAL_ALPHA + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _ColorRampTex: + m_Texture: {fileID: 2800000, guid: 279657edc397ece4b8029c727adf6ddc, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ColorRampTexGradient: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ColorSwapTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DistortTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _FadeBurnTex: + m_Texture: {fileID: 2800000, guid: 677cca399782dea41aedc1d292ecb67d, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _FadeTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _GlowTex: + 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} + - _OutlineDistortTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OutlineTex: + m_Texture: {fileID: 2800000, guid: 74087f6d03f233e4a8a142fa01f9e5cf, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OverlayTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ShineMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - _Alpha: 1 + - _AlphaCutoffValue: 0.25 + - _AlphaOutlineBlend: 1 + - _AlphaOutlineGlow: 5 + - _AlphaOutlineMinAlpha: 0 + - _AlphaOutlinePower: 1 + - _AlphaRoundThreshold: 0.5 + - _BillboardY: 0 + - _BlurHD: 0 + - _BlurIntensity: 10 + - _Brightness: -0.01 + - _ChromAberrAlpha: 0.4 + - _ChromAberrAmount: 1 + - _ClipUvDown: 0 + - _ClipUvLeft: 0 + - _ClipUvRight: 0 + - _ClipUvUp: 0 + - _ColorChangeLuminosity: 0 + - _ColorChangeTolerance: 0.25 + - _ColorChangeTolerance2: 0.25 + - _ColorChangeTolerance3: 0.25 + - _ColorRampBlend: 1 + - _ColorRampLuminosity: 0 + - _ColorRampOutline: 0 + - _ColorSwapBlend: 1 + - _ColorSwapBlueLuminosity: 0.5 + - _ColorSwapGreenLuminosity: 0.5 + - _ColorSwapRedLuminosity: 0.5 + - _Contrast: 6 + - _CullingOption: 0 + - _DistortAmount: 0.5 + - _DistortTexXSpeed: 5 + - _DistortTexYSpeed: 5 + - _EditorDrawers: 6 + - _FadeAmount: -0.1 + - _FadeBurnGlow: 2 + - _FadeBurnTransition: 0.075 + - _FadeBurnWidth: 0.025 + - _FishEyeUvAmount: 0.35 + - _FlickerAlpha: 0 + - _FlickerFreq: 0.2 + - _FlickerPercent: 0.05 + - _GhostBlend: 1 + - _GhostColorBoost: 1 + - _GhostTransparency: 0 + - _GlitchAmount: 3 + - _GlitchSize: 1 + - _Glow: 10 + - _GlowGlobal: 1 + - _GlowTexUsed: 0 + - _GradBlend: 1 + - _GradBoostX: 1.2 + - _GradBoostY: 1.2 + - _GradIsRadial: 0 + - _GrassManualAnim: 1 + - _GrassManualToggle: 0 + - _GrassRadialBend: 0.1 + - _GrassSpeed: 2 + - _GrassWind: 20 + - _GreyscaleBlend: 1 + - _GreyscaleLuminosity: 0 + - _GreyscaleOutline: 0 + - _HandDrawnAmount: 10 + - _HandDrawnSpeed: 5 + - _HitEffectBlend: 1 + - _HitEffectGlow: 5 + - _HologramBlend: 1 + - _HologramMaxAlpha: 0.75 + - _HologramMinAlpha: 0.1 + - _HologramStripesAmount: 0.1 + - _HologramStripesSpeed: 4.5 + - _HologramUnmodAmount: 0 + - _HsvBright: 1 + - _HsvSaturation: 1 + - _HsvShift: 180 + - _InnerOutlineAlpha: 1 + - _InnerOutlineGlow: 1 + - _InnerOutlineThickness: 1 + - _MaxXUV: 1 + - _MaxYUV: 1 + - _MinXUV: 0 + - _MinYUV: 0 + - _MotionBlurAngle: 0.1 + - _MotionBlurDist: 1.25 + - _MyDstMode: 10 + - _MySrcMode: 5 + - _NegativeAmount: 1 + - _OffsetUvX: 0 + - _OffsetUvY: 0 + - _OnlyInnerOutline: 0 + - _OnlyOutline: 0 + - _Outline8Directions: 0 + - _OutlineAlpha: 1 + - _OutlineDistortAmount: 0.5 + - _OutlineDistortTexXSpeed: 5 + - _OutlineDistortTexYSpeed: 5 + - _OutlineDistortToggle: 0 + - _OutlineGlow: 1.5 + - _OutlineIsPixel: 0 + - _OutlinePixelWidth: 1 + - _OutlineTexGrey: 0 + - _OutlineTexToggle: 0 + - _OutlineTexXSpeed: 10 + - _OutlineTexYSpeed: 0 + - _OutlineWidth: 0.004 + - _OverlayBlend: 1 + - _OverlayGlow: 1 + - _OverlayTextureScrollXSpeed: 0.25 + - _OverlayTextureScrollYSpeed: 0.25 + - _PinchUvAmount: 0.35 + - _PixelateSize: 32 + - _PosterizeGamma: 0.75 + - _PosterizeNumColors: 8 + - _PosterizeOutline: 0 + - _RadialClipAngle: 90 + - _RadialClipArc1: 45 + - _RadialClipArc2: 0 + - _RandomSeed: 0 + - _RectSize: 1 + - _RotateUvAmount: 0 + - _RoundWaveSpeed: 2 + - _RoundWaveStrength: 0.7 + - _ShadowAlpha: 0.5 + - _ShadowX: 0.1 + - _ShadowY: -0.05 + - _ShakeUvSpeed: 2.5 + - _ShakeUvX: 1.5 + - _ShakeUvY: 1 + - _ShineGlow: 1 + - _ShineLocation: 0.5 + - _ShineRotate: 0 + - _ShineWidth: 0.1 + - _TextureScrollXSpeed: 1 + - _TextureScrollYSpeed: 0 + - _TwistUvAmount: 1 + - _TwistUvPosX: 0.5 + - _TwistUvPosY: 0.5 + - _TwistUvRadius: 0.75 + - _WarpScale: 0.5 + - _WarpSpeed: 8 + - _WarpStrength: 0.025 + - _WaveAmount: 7 + - _WaveSpeed: 10 + - _WaveStrength: 7.5 + - _WaveX: 0 + - _WaveY: 0.5 + - _ZTestMode: 4 + - _ZWrite: 0 + - _ZoomUvAmount: 0.5 + m_Colors: + - ColorSwapRed: {r: 1, g: 1, b: 1, a: 1} + - _AlphaOutlineColor: {r: 1, g: 1, b: 1, a: 1} + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _ColorChangeNewCol: {r: 1, g: 1, b: 0, a: 1} + - _ColorChangeNewCol2: {r: 1, g: 1, b: 0, a: 1} + - _ColorChangeNewCol3: {r: 1, g: 1, b: 0, a: 1} + - _ColorChangeTarget: {r: 1, g: 0, b: 0, a: 1} + - _ColorChangeTarget2: {r: 1, g: 0, b: 0, a: 1} + - _ColorChangeTarget3: {r: 1, g: 0, b: 0, a: 1} + - _ColorSwapBlue: {r: 1, g: 1, b: 1, a: 1} + - _ColorSwapGreen: {r: 1, g: 1, b: 1, a: 1} + - _ColorSwapRed: {r: 1, g: 1, b: 1, a: 1} + - _FadeBurnColor: {r: 1, g: 1, b: 0, a: 1} + - _GlowColor: {r: 1, g: 1, b: 1, a: 1} + - _GradBotLeftCol: {r: 0, g: 0, b: 1, a: 1} + - _GradBotRightCol: {r: 0, g: 0, b: 1, a: 1} + - _GradTopLeftCol: {r: 1, g: 0, b: 0, a: 1} + - _GradTopRightCol: {r: 1, g: 0, b: 0, a: 1} + - _GreyscaleTintColor: {r: 1, g: 1, b: 1, a: 1} + - _HitEffectColor: {r: 1, g: 1, b: 1, a: 1} + - _HologramStripeColor: {r: 0, g: 1, b: 1, a: 1} + - _InnerOutlineColor: {r: 1, g: 0, b: 0, a: 1} + - _OutlineColor: {r: 1, g: 1, b: 1, a: 1} + - _OverlayColor: {r: 1, g: 1, b: 1, a: 1} + - _ShadowColor: {r: 0, g: 0, b: 0, a: 1} + - _ShineColor: {r: 1, g: 1, b: 1, a: 1} +--- !u!1 &1697295736 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1697295737} + - component: {fileID: 1697295739} + - component: {fileID: 1697295738} + m_Layer: 0 + m_Name: Title + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1697295737 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1697295736} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: -2.51, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 1211354477} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!102 &1697295738 +TextMesh: + serializedVersion: 3 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1697295736} + m_Text: HP Bar + m_OffsetZ: -1.5 + m_CharacterSize: 0.075 + m_LineSpacing: 1 + m_Anchor: 4 + m_Alignment: 0 + m_TabSize: 4 + m_FontSize: 100 + m_FontStyle: 0 + m_RichText: 1 + m_Font: {fileID: 12800000, guid: a4e6a5491519adb45919dc87eff28e55, type: 3} + m_Color: + serializedVersion: 2 + rgba: 4294967295 +--- !u!23 &1697295739 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1697295736} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 10100, guid: 0000000000000000e000000000000000, type: 0} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!1 &1697898090 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1697898091} + - component: {fileID: 1697898093} + - component: {fileID: 1697898092} + m_Layer: 0 + m_Name: Title + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1697898091 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1697898090} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: -2.51, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 1119325822} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!102 &1697898092 +TextMesh: + serializedVersion: 3 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1697898090} + m_Text: Twist + m_OffsetZ: -1.5 + m_CharacterSize: 0.075 + m_LineSpacing: 1 + m_Anchor: 4 + m_Alignment: 0 + m_TabSize: 4 + m_FontSize: 100 + m_FontStyle: 0 + m_RichText: 1 + m_Font: {fileID: 12800000, guid: a4e6a5491519adb45919dc87eff28e55, type: 3} + m_Color: + serializedVersion: 2 + rgba: 4294967295 +--- !u!23 &1697898093 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1697898090} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 10100, guid: 0000000000000000e000000000000000, type: 0} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!1 &1706778796 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1706778797} + - component: {fileID: 1706778799} + - component: {fileID: 1706778798} + m_Layer: 0 + m_Name: Animated + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1706778797 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1706778796} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: -3.57, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 1613686741} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!102 &1706778798 +TextMesh: + serializedVersion: 3 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1706778796} + m_Text: (Has Animation) + m_OffsetZ: -1.5 + m_CharacterSize: 0.075 + m_LineSpacing: 1 + m_Anchor: 4 + m_Alignment: 0 + m_TabSize: 4 + m_FontSize: 100 + m_FontStyle: 0 + m_RichText: 1 + m_Font: {fileID: 12800000, guid: a4e6a5491519adb45919dc87eff28e55, type: 3} + m_Color: + serializedVersion: 2 + rgba: 4294967295 +--- !u!23 &1706778799 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1706778796} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 10100, guid: 0000000000000000e000000000000000, type: 0} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!21 &1708657337 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: AllIn1SpriteShader/AllIn1SpriteShader + m_Shader: {fileID: 4800000, guid: a36b7719ff0465b42ab1407d67672c5f, type: 3} + m_ShaderKeywords: ALPHACUTOFF_ON ETC1_EXTERNAL_ALPHA PIXELATE_ON + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _ColorRampTex: + m_Texture: {fileID: 2800000, guid: 279657edc397ece4b8029c727adf6ddc, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ColorRampTexGradient: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ColorSwapTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DistortTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _FadeBurnTex: + m_Texture: {fileID: 2800000, guid: 32e8df0008bebe746b1681a71c61f31c, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _FadeTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _GlowTex: + 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} + - _OutlineDistortTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OutlineTex: + m_Texture: {fileID: 2800000, guid: 74087f6d03f233e4a8a142fa01f9e5cf, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OverlayTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ShineMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - _Alpha: 1 + - _AlphaCutoffValue: 0.458 + - _AlphaOutlineBlend: 1 + - _AlphaOutlineGlow: 5 + - _AlphaOutlineMinAlpha: 0 + - _AlphaOutlinePower: 1 + - _AlphaRoundThreshold: 0.5 + - _BillboardY: 0 + - _BlurHD: 0 + - _BlurIntensity: 10 + - _Brightness: 0 + - _ChromAberrAlpha: 0.4 + - _ChromAberrAmount: 1 + - _ClipUvDown: 1 + - _ClipUvLeft: 1 + - _ClipUvRight: 1 + - _ClipUvUp: 1 + - _ColorChangeLuminosity: 0 + - _ColorChangeTolerance: 0.25 + - _ColorChangeTolerance2: 0.25 + - _ColorChangeTolerance3: 0.25 + - _ColorRampBlend: 1 + - _ColorRampLuminosity: 0 + - _ColorRampOutline: 0 + - _ColorSwapBlend: 1 + - _ColorSwapBlueLuminosity: 0.5 + - _ColorSwapGreenLuminosity: 0.5 + - _ColorSwapRedLuminosity: 0.5 + - _Contrast: 1 + - _CullingOption: 0 + - _DistortAmount: 0.5 + - _DistortTexXSpeed: 5 + - _DistortTexYSpeed: 5 + - _EditorDrawers: 6 + - _FadeAmount: -0.1 + - _FadeBurnGlow: 2 + - _FadeBurnTransition: 0.075 + - _FadeBurnWidth: 0.025 + - _FishEyeUvAmount: 0.35 + - _FlickerAlpha: 0 + - _FlickerFreq: 0.2 + - _FlickerPercent: 0.05 + - _GhostBlend: 1 + - _GhostColorBoost: 1 + - _GhostTransparency: 0 + - _GlitchAmount: 3 + - _GlitchSize: 1 + - _Glow: 10 + - _GlowGlobal: 1 + - _GlowTexUsed: 0 + - _GradBlend: 1 + - _GradBoostX: 1.2 + - _GradBoostY: 1.2 + - _GradIsRadial: 0 + - _GrassManualAnim: 1 + - _GrassManualToggle: 0 + - _GrassRadialBend: 0.25 + - _GrassSpeed: 2 + - _GrassWind: 20 + - _GreyscaleBlend: 1 + - _GreyscaleLuminosity: 0 + - _GreyscaleOutline: 0 + - _HandDrawnAmount: 10 + - _HandDrawnSpeed: 5 + - _HitEffectBlend: 1 + - _HitEffectGlow: 5 + - _HologramBlend: 1 + - _HologramFlickerAlpha: 0 + - _HologramFlickerFreq: 0.2 + - _HologramFlickerPercent: 0.05 + - _HologramMaxAlpha: 1 + - _HologramMinAlpha: 0 + - _HologramStripesAlpha: 0.4 + - _HologramStripesAmount: 50 + - _HologramStripesFill: 0.4 + - _HologramStripesLuminosity: 1 + - _HologramStripesSpeed: 5 + - _HologramUnmodAmount: 0.4 + - _HsvBright: 1 + - _HsvSaturation: 1 + - _HsvShift: 180 + - _InnerOutlineAlpha: 1 + - _InnerOutlineGlow: 1 + - _InnerOutlineThickness: 1 + - _MaxXUV: 1 + - _MaxYUV: 1 + - _MinXUV: 0 + - _MinYUV: 0 + - _MotionBlurAngle: 0.1 + - _MotionBlurDist: 1.25 + - _MyDstMode: 10 + - _MySrcMode: 5 + - _NegativeAmount: 1 + - _OffsetUvX: 0 + - _OffsetUvY: 0 + - _OnlyInnerOutline: 0 + - _OnlyOutline: 0 + - _Outline8Directions: 0 + - _OutlineAlpha: 1 + - _OutlineDistortAmount: 0.5 + - _OutlineDistortTexXSpeed: 5 + - _OutlineDistortTexYSpeed: 5 + - _OutlineDistortToggle: 0 + - _OutlineGlow: 1.5 + - _OutlineIsPixel: 0 + - _OutlinePixelWidth: 1 + - _OutlineTexGrey: 0 + - _OutlineTexToggle: 0 + - _OutlineTexXSpeed: 10 + - _OutlineTexYSpeed: 0 + - _OutlineWidth: 0.004 + - _OverlayBlend: 1 + - _OverlayGlow: 1 + - _OverlayTextureScrollXSpeed: 0.25 + - _OverlayTextureScrollYSpeed: 0.25 + - _PinchUvAmount: 0.35 + - _PixelateSize: 32 + - _PosterizeGamma: 0.75 + - _PosterizeNumColors: 8 + - _PosterizeOutline: 0 + - _RadialClip: 45 + - _RadialClip2: 0 + - _RadialClipAngle: 90 + - _RadialClipArc1: 45 + - _RadialClipArc2: 0 + - _RadialStartAngle: 90 + - _RandomSeed: 0 + - _RectSize: 1 + - _RotateUvAmount: 0 + - _RoundWaveSpeed: 2 + - _RoundWaveStrength: 0.7 + - _ShadowAlpha: 0.5 + - _ShadowX: 0.1 + - _ShadowY: -0.05 + - _ShakeUvSpeed: 2.5 + - _ShakeUvX: 1.5 + - _ShakeUvY: 1 + - _ShineGlow: 1 + - _ShineLocation: 0.5 + - _ShineRotate: 0 + - _ShineWidth: 0.1 + - _TextureScrollXSpeed: 1 + - _TextureScrollYSpeed: 0 + - _TwistUvAmount: 1 + - _TwistUvPosX: 0.5 + - _TwistUvPosY: 0.5 + - _TwistUvRadius: 0.75 + - _WarpScale: 0.5 + - _WarpSpeed: 8 + - _WarpStrength: 0.025 + - _WaveAmount: 7 + - _WaveSpeed: 10 + - _WaveStrength: 7.5 + - _WaveX: 0 + - _WaveY: 0.5 + - _ZTestMode: 4 + - _ZWrite: 0 + - _ZoomUvAmount: 0.5 + m_Colors: + - ColorSwapRed: {r: 1, g: 1, b: 1, a: 1} + - _AlphaOutlineColor: {r: 1, g: 1, b: 1, a: 1} + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _ColorChangeNewCol: {r: 1, g: 1, b: 0, a: 1} + - _ColorChangeNewCol2: {r: 1, g: 1, b: 0, a: 1} + - _ColorChangeNewCol3: {r: 1, g: 1, b: 0, a: 1} + - _ColorChangeTarget: {r: 1, g: 0, b: 0, a: 1} + - _ColorChangeTarget2: {r: 1, g: 0, b: 0, a: 1} + - _ColorChangeTarget3: {r: 1, g: 0, b: 0, a: 1} + - _ColorSwapBlue: {r: 1, g: 1, b: 1, a: 1} + - _ColorSwapGreen: {r: 1, g: 1, b: 1, a: 1} + - _ColorSwapRed: {r: 1, g: 1, b: 1, a: 1} + - _FadeBurnColor: {r: 1, g: 1, b: 0, a: 1} + - _GlowColor: {r: 1, g: 1, b: 1, a: 1} + - _GradBotLeftCol: {r: 0, g: 0, b: 1, a: 1} + - _GradBotRightCol: {r: 0, g: 0, b: 1, a: 1} + - _GradTopLeftCol: {r: 1, g: 0, b: 0, a: 1} + - _GradTopRightCol: {r: 1, g: 0, b: 0, a: 1} + - _GreyscaleTintColor: {r: 1, g: 1, b: 1, a: 1} + - _HitEffectColor: {r: 1, g: 1, b: 1, a: 1} + - _HologramStripeColor: {r: 1, g: 1, b: 1, a: 1} + - _InnerOutlineColor: {r: 1, g: 0, b: 0, a: 1} + - _OutlineColor: {r: 1, g: 1, b: 1, a: 1} + - _OverlayColor: {r: 1, g: 1, b: 1, a: 1} + - _ShadowColor: {r: 0, g: 0, b: 0, a: 1} + - _ShineColor: {r: 1, g: 1, b: 1, a: 1} +--- !u!1 &1723167442 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1723167445} + - component: {fileID: 1723167444} + - component: {fileID: 1723167443} + m_Layer: 0 + m_Name: EventSystem + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!114 &1723167443 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1723167442} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 4f231c4fb786f3946a6b90b886c48677, type: 3} + m_Name: + m_EditorClassIdentifier: + m_HorizontalAxis: Horizontal + m_VerticalAxis: Vertical + m_SubmitButton: Submit + m_CancelButton: Cancel + m_InputActionsPerSecond: 10 + m_RepeatDelay: 0.5 + m_ForceModuleActive: 0 +--- !u!114 &1723167444 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1723167442} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 76c392e42b5098c458856cdf6ecaaaa1, type: 3} + m_Name: + m_EditorClassIdentifier: + m_FirstSelected: {fileID: 0} + m_sendNavigationEvents: 1 + m_DragThreshold: 10 +--- !u!4 &1723167445 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1723167442} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 2 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &1724918723 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1724918724} + - component: {fileID: 1724918727} + - component: {fileID: 1724918726} + - component: {fileID: 1724918725} + m_Layer: 0 + m_Name: Sprite + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1724918724 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1724918723} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 80, y: 80, z: 1} + m_Children: [] + m_Father: {fileID: 1923390774} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &1724918725 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1724918723} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: ee158225ee1e59f4791627785501d950, type: 3} + m_Name: + m_EditorClassIdentifier: + currentShaderType: 4 + normalStrength: 5 + normalSmoothing: 1 + computingNormal: 0 +--- !u!114 &1724918726 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1724918723} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 98b644315d7a92842b89e04f55c48e02, type: 3} + m_Name: + m_EditorClassIdentifier: +--- !u!212 &1724918727 +SpriteRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1724918723} + m_Enabled: 1 + m_CastShadows: 0 + m_ReceiveShadows: 0 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 465147594} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 0 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_Sprite: {fileID: 21300000, guid: 839adabbc5de26041bac66450214a831, type: 3} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_FlipX: 0 + m_FlipY: 0 + m_DrawMode: 0 + m_Size: {x: 5.12, y: 5.12} + m_AdaptiveModeThreshold: 0.5 + m_SpriteTileMode: 0 + m_WasSpriteAssigned: 1 + m_MaskInteraction: 0 + m_SpriteSortPoint: 0 +--- !u!1 &1727216259 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1727216260} + - component: {fileID: 1727216262} + - component: {fileID: 1727216261} + m_Layer: 0 + m_Name: Title + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1727216260 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1727216259} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: -3.1267126, z: 0} + m_LocalScale: {x: 1.2457023, y: 1.2457023, z: 1.2457023} + m_Children: [] + m_Father: {fileID: 450696184} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!102 &1727216261 +TextMesh: + serializedVersion: 3 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1727216259} + m_Text: Procedural Soldier + m_OffsetZ: -1.5 + m_CharacterSize: 0.075 + m_LineSpacing: 1 + m_Anchor: 4 + m_Alignment: 0 + m_TabSize: 4 + m_FontSize: 100 + m_FontStyle: 0 + m_RichText: 1 + m_Font: {fileID: 12800000, guid: a4e6a5491519adb45919dc87eff28e55, type: 3} + m_Color: + serializedVersion: 2 + rgba: 4294967295 +--- !u!23 &1727216262 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1727216259} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 10100, guid: 0000000000000000e000000000000000, type: 0} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!1 &1728754560 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1728754561} + - component: {fileID: 1728754563} + - component: {fileID: 1728754562} + m_Layer: 0 + m_Name: Animated + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 0 +--- !u!4 &1728754561 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1728754560} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: -4.447157, z: 0} + m_LocalScale: {x: 1.2457023, y: 1.2457023, z: 1.2457023} + m_Children: [] + m_Father: {fileID: 1415143267} + m_RootOrder: 7 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!102 &1728754562 +TextMesh: + serializedVersion: 3 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1728754560} + m_Text: (Has Animation) + m_OffsetZ: -1.5 + m_CharacterSize: 0.075 + m_LineSpacing: 1 + m_Anchor: 4 + m_Alignment: 0 + m_TabSize: 4 + m_FontSize: 100 + m_FontStyle: 0 + m_RichText: 1 + m_Font: {fileID: 12800000, guid: a4e6a5491519adb45919dc87eff28e55, type: 3} + m_Color: + serializedVersion: 2 + rgba: 4294967295 +--- !u!23 &1728754563 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1728754560} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: a4e6a5491519adb45919dc87eff28e55, type: 3} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!1 &1734593091 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1734593092} + - component: {fileID: 1734593093} + m_Layer: 0 + m_Name: Burn + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1734593092 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1734593091} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0.0582, y: 0.0425, z: -0.1} + m_LocalScale: {x: 0.67673415, y: 0.7130322, z: 1} + m_Children: [] + m_Father: {fileID: 1861014113} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!212 &1734593093 +SpriteRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1734593091} + m_Enabled: 1 + m_CastShadows: 0 + m_ReceiveShadows: 0 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: a186aad8f5f9dd04d910c7e3174834c0, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 0 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_Sprite: {fileID: 21300000, guid: be304275dbf36014ca9828884588ac47, type: 3} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_FlipX: 0 + m_FlipY: 0 + m_DrawMode: 0 + m_Size: {x: 5.12, y: 5.12} + m_AdaptiveModeThreshold: 0.5 + m_SpriteTileMode: 0 + m_WasSpriteAssigned: 1 + m_MaskInteraction: 1 + m_SpriteSortPoint: 0 +--- !u!21 &1735095770 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: AllIn1SpriteShader/AllIn1SpriteShader + m_Shader: {fileID: 4800000, guid: a36b7719ff0465b42ab1407d67672c5f, type: 3} + m_ShaderKeywords: ETC1_EXTERNAL_ALPHA + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _ColorRampTex: + m_Texture: {fileID: 2800000, guid: 279657edc397ece4b8029c727adf6ddc, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ColorRampTexGradient: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ColorSwapTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DistortTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _FadeBurnTex: + m_Texture: {fileID: 2800000, guid: 32e8df0008bebe746b1681a71c61f31c, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _FadeTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _GlowTex: + 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} + - _OutlineDistortTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OutlineTex: + m_Texture: {fileID: 2800000, guid: 74087f6d03f233e4a8a142fa01f9e5cf, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OverlayTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ShineMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - _Alpha: 1 + - _AlphaCutoffValue: 0.25 + - _AlphaOutlineBlend: 1 + - _AlphaOutlineGlow: 5 + - _AlphaOutlineMinAlpha: 0 + - _AlphaOutlinePower: 1 + - _AlphaRoundThreshold: 0.5 + - _BillboardY: 0 + - _BlurHD: 0 + - _BlurIntensity: 10 + - _Brightness: 0 + - _ChromAberrAlpha: 0.4 + - _ChromAberrAmount: 1 + - _ClipUvDown: 1 + - _ClipUvLeft: 1 + - _ClipUvRight: 1 + - _ClipUvUp: 1 + - _ColorChangeLuminosity: 0 + - _ColorChangeTolerance: 0.25 + - _ColorChangeTolerance2: 0.25 + - _ColorChangeTolerance3: 0.25 + - _ColorRampBlend: 1 + - _ColorRampLuminosity: 0 + - _ColorRampOutline: 0 + - _ColorSwapBlend: 1 + - _ColorSwapBlueLuminosity: 0.5 + - _ColorSwapGreenLuminosity: 0.5 + - _ColorSwapRedLuminosity: 0.5 + - _Contrast: 1 + - _CullingOption: 0 + - _DistortAmount: 0.5 + - _DistortTexXSpeed: 5 + - _DistortTexYSpeed: 5 + - _EditorDrawers: 6 + - _FadeAmount: -0.1 + - _FadeBurnGlow: 2 + - _FadeBurnTransition: 0.075 + - _FadeBurnWidth: 0.025 + - _FishEyeUvAmount: 0.35 + - _FlickerAlpha: 0 + - _FlickerFreq: 0.2 + - _FlickerPercent: 0.05 + - _GhostBlend: 1 + - _GhostColorBoost: 1 + - _GhostTransparency: 0 + - _GlitchAmount: 3 + - _GlitchSize: 1 + - _Glow: 0 + - _GlowGlobal: 1 + - _GlowTexUsed: 0 + - _GradBlend: 1 + - _GradBoostX: 1.2 + - _GradBoostY: 1.2 + - _GradIsRadial: 0 + - _GrassManualAnim: 1 + - _GrassManualToggle: 0 + - _GrassRadialBend: 0.25 + - _GrassSpeed: 2 + - _GrassWind: 20 + - _GreyscaleBlend: 1 + - _GreyscaleLuminosity: 0 + - _GreyscaleOutline: 0 + - _HandDrawnAmount: 10 + - _HandDrawnSpeed: 5 + - _HitEffectBlend: 1 + - _HitEffectGlow: 5 + - _HologramBlend: 1 + - _HologramFlickerAlpha: 0 + - _HologramFlickerFreq: 0.2 + - _HologramFlickerPercent: 0.05 + - _HologramMaxAlpha: 1 + - _HologramMinAlpha: 0 + - _HologramStripesAlpha: 0.4 + - _HologramStripesAmount: 50 + - _HologramStripesFill: 0.4 + - _HologramStripesLuminosity: 1 + - _HologramStripesSpeed: 5 + - _HologramUnmodAmount: 0.4 + - _HsvBright: 1 + - _HsvSaturation: 1 + - _HsvShift: 180 + - _InnerOutlineAlpha: 1 + - _InnerOutlineGlow: 1 + - _InnerOutlineThickness: 1 + - _MaxXUV: 1 + - _MaxYUV: 1 + - _MinXUV: 0 + - _MinYUV: 0 + - _MotionBlurAngle: 0.1 + - _MotionBlurDist: 1.25 + - _MyDstMode: 10 + - _MySrcMode: 5 + - _NegativeAmount: 1 + - _OffsetUvX: 0 + - _OffsetUvY: 0 + - _OnlyInnerOutline: 0 + - _OnlyOutline: 0 + - _Outline8Directions: 0 + - _OutlineAlpha: 1 + - _OutlineDistortAmount: 0.5 + - _OutlineDistortTexXSpeed: 5 + - _OutlineDistortTexYSpeed: 5 + - _OutlineDistortToggle: 0 + - _OutlineGlow: 1.5 + - _OutlineIsPixel: 0 + - _OutlinePixelWidth: 1 + - _OutlineTexGrey: 0 + - _OutlineTexToggle: 0 + - _OutlineTexXSpeed: 10 + - _OutlineTexYSpeed: 0 + - _OutlineWidth: 0.004 + - _OverlayBlend: 1 + - _OverlayGlow: 1 + - _OverlayTextureScrollXSpeed: 0.25 + - _OverlayTextureScrollYSpeed: 0.25 + - _PinchUvAmount: 0.35 + - _PixelateSize: 32 + - _PosterizeGamma: 0.75 + - _PosterizeNumColors: 8 + - _PosterizeOutline: 0 + - _RadialClip: 45 + - _RadialClip2: 0 + - _RadialClipAngle: 90 + - _RadialClipArc1: 45 + - _RadialClipArc2: 0 + - _RadialStartAngle: 90 + - _RandomSeed: 0 + - _RectSize: 1 + - _RotateUvAmount: 0 + - _RoundWaveSpeed: 2 + - _RoundWaveStrength: 0.7 + - _ShadowAlpha: 0.5 + - _ShadowX: 0.1 + - _ShadowY: -0.05 + - _ShakeUvSpeed: 2.5 + - _ShakeUvX: 1.5 + - _ShakeUvY: 1 + - _ShineGlow: 1 + - _ShineLocation: 0.5 + - _ShineRotate: 0 + - _ShineWidth: 0.1 + - _TextureScrollXSpeed: 1 + - _TextureScrollYSpeed: 0 + - _TwistUvAmount: 1 + - _TwistUvPosX: 0.5 + - _TwistUvPosY: 0.5 + - _TwistUvRadius: 0.75 + - _WarpScale: 0.5 + - _WarpSpeed: 8 + - _WarpStrength: 0.025 + - _WaveAmount: 7 + - _WaveSpeed: 10 + - _WaveStrength: 7.5 + - _WaveX: 0 + - _WaveY: 0.5 + - _ZTestMode: 4 + - _ZWrite: 0 + - _ZoomUvAmount: 0.5 + m_Colors: + - ColorSwapRed: {r: 1, g: 1, b: 1, a: 1} + - _AlphaOutlineColor: {r: 1, g: 1, b: 1, a: 1} + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _ColorChangeNewCol: {r: 1, g: 1, b: 0, a: 1} + - _ColorChangeNewCol2: {r: 1, g: 1, b: 0, a: 1} + - _ColorChangeNewCol3: {r: 1, g: 1, b: 0, a: 1} + - _ColorChangeTarget: {r: 1, g: 0, b: 0, a: 1} + - _ColorChangeTarget2: {r: 1, g: 0, b: 0, a: 1} + - _ColorChangeTarget3: {r: 1, g: 0, b: 0, a: 1} + - _ColorSwapBlue: {r: 1, g: 1, b: 1, a: 1} + - _ColorSwapGreen: {r: 1, g: 1, b: 1, a: 1} + - _ColorSwapRed: {r: 1, g: 1, b: 1, a: 1} + - _FadeBurnColor: {r: 1, g: 1, b: 0, a: 1} + - _GlowColor: {r: 1, g: 1, b: 1, a: 1} + - _GradBotLeftCol: {r: 0, g: 0, b: 1, a: 1} + - _GradBotRightCol: {r: 0, g: 0, b: 1, a: 1} + - _GradTopLeftCol: {r: 1, g: 0, b: 0, a: 1} + - _GradTopRightCol: {r: 1, g: 0, b: 0, a: 1} + - _GreyscaleTintColor: {r: 1, g: 1, b: 1, a: 1} + - _HitEffectColor: {r: 1, g: 1, b: 1, a: 1} + - _HologramStripeColor: {r: 1, g: 1, b: 1, a: 1} + - _InnerOutlineColor: {r: 1, g: 0, b: 0, a: 1} + - _OutlineColor: {r: 1, g: 1, b: 1, a: 1} + - _OverlayColor: {r: 1, g: 1, b: 1, a: 1} + - _ShadowColor: {r: 0, g: 0, b: 0, a: 1} + - _ShineColor: {r: 1, g: 1, b: 1, a: 1} +--- !u!1 &1749643254 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1749643255} + - component: {fileID: 1749643257} + - component: {fileID: 1749643256} + m_Layer: 0 + m_Name: Animated + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 0 +--- !u!4 &1749643255 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1749643254} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: -3.57, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 1953432852} + m_RootOrder: 3 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!102 &1749643256 +TextMesh: + serializedVersion: 3 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1749643254} + m_Text: (Has Animation) + m_OffsetZ: -1.5 + m_CharacterSize: 0.075 + m_LineSpacing: 1 + m_Anchor: 4 + m_Alignment: 0 + m_TabSize: 4 + m_FontSize: 100 + m_FontStyle: 0 + m_RichText: 1 + m_Font: {fileID: 12800000, guid: a4e6a5491519adb45919dc87eff28e55, type: 3} + m_Color: + serializedVersion: 2 + rgba: 4294967295 +--- !u!23 &1749643257 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1749643254} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: a4e6a5491519adb45919dc87eff28e55, type: 3} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!1 &1755864201 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1755864202} + - component: {fileID: 1755864204} + - component: {fileID: 1755864203} + m_Layer: 0 + m_Name: Animated + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 0 +--- !u!4 &1755864202 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1755864201} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: -4.447157, z: 0} + m_LocalScale: {x: 1.2457023, y: 1.2457023, z: 1.2457023} + m_Children: [] + m_Father: {fileID: 1883979700} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!102 &1755864203 +TextMesh: + serializedVersion: 3 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1755864201} + m_Text: (Has Animation) + m_OffsetZ: -1.5 + m_CharacterSize: 0.075 + m_LineSpacing: 1 + m_Anchor: 4 + m_Alignment: 0 + m_TabSize: 4 + m_FontSize: 100 + m_FontStyle: 0 + m_RichText: 1 + m_Font: {fileID: 12800000, guid: a4e6a5491519adb45919dc87eff28e55, type: 3} + m_Color: + serializedVersion: 2 + rgba: 4294967295 +--- !u!23 &1755864204 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1755864201} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: a4e6a5491519adb45919dc87eff28e55, type: 3} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!1 &1756331348 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1756331349} + - component: {fileID: 1756331353} + - component: {fileID: 1756331352} + m_Layer: 0 + m_Name: Portal + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1756331349 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1756331348} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 140, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 1858630623} + - {fileID: 550220621} + - {fileID: 409423831} + m_Father: {fileID: 1563905016} + m_RootOrder: 14 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &1756331352 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1756331348} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 98b644315d7a92842b89e04f55c48e02, type: 3} + m_Name: + m_EditorClassIdentifier: +--- !u!212 &1756331353 +SpriteRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1756331348} + m_Enabled: 1 + m_CastShadows: 0 + m_ReceiveShadows: 0 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 1195370958} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 0 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_Sprite: {fileID: 21300000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_FlipX: 0 + m_FlipY: 0 + m_DrawMode: 0 + m_Size: {x: 5.12, y: 5.12} + m_AdaptiveModeThreshold: 0.5 + m_SpriteTileMode: 0 + m_WasSpriteAssigned: 1 + m_MaskInteraction: 1 + m_SpriteSortPoint: 0 +--- !u!1 &1767383823 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1767383824} + - component: {fileID: 1767383826} + - component: {fileID: 1767383827} + - component: {fileID: 1767383828} + m_Layer: 0 + m_Name: Blur + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1767383824 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1767383823} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 200, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 878272797} + - {fileID: 1328027728} + m_Father: {fileID: 2036092933} + m_RootOrder: 20 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!212 &1767383826 +SpriteRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1767383823} + m_Enabled: 1 + m_CastShadows: 0 + m_ReceiveShadows: 0 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 85408337} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 0 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_Sprite: {fileID: 21300000, guid: 519dafacd208bb64c83d5124be03b09d, type: 3} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_FlipX: 0 + m_FlipY: 0 + m_DrawMode: 0 + m_Size: {x: 5.12, y: 5.12} + m_AdaptiveModeThreshold: 0.5 + m_SpriteTileMode: 0 + m_WasSpriteAssigned: 1 + m_MaskInteraction: 0 + m_SpriteSortPoint: 0 +--- !u!114 &1767383827 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1767383823} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 98b644315d7a92842b89e04f55c48e02, type: 3} + m_Name: + m_EditorClassIdentifier: +--- !u!95 &1767383828 +Animator: + serializedVersion: 3 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1767383823} + m_Enabled: 1 + m_Avatar: {fileID: 0} + m_Controller: {fileID: 9100000, guid: 4d13c3a68decb714e80835bb34f348f3, type: 2} + m_CullingMode: 0 + m_UpdateMode: 0 + m_ApplyRootMotion: 0 + m_LinearVelocityBlending: 0 + m_WarningMessage: + m_HasTransformHierarchy: 1 + m_AllowConstantClipSamplingOptimization: 1 + m_KeepAnimatorControllerStateOnDisable: 0 +--- !u!21 &1769422912 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: AllIn1SpriteShader/AllIn1SpriteShader + m_Shader: {fileID: 4800000, guid: a36b7719ff0465b42ab1407d67672c5f, type: 3} + m_ShaderKeywords: ETC1_EXTERNAL_ALPHA WARP_ON + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: 3000 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _ColorRampTex: + m_Texture: {fileID: 2800000, guid: 279657edc397ece4b8029c727adf6ddc, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ColorRampTexGradient: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ColorSwapTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DistortTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _FadeBurnTex: + m_Texture: {fileID: 2800000, guid: 677cca399782dea41aedc1d292ecb67d, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _FadeTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _GlowTex: + 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} + - _OutlineDistortTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OutlineTex: + m_Texture: {fileID: 2800000, guid: 74087f6d03f233e4a8a142fa01f9e5cf, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OverlayTex: + m_Texture: {fileID: 2800000, guid: 677cca399782dea41aedc1d292ecb67d, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ShineMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - _Alpha: 1 + - _AlphaCutoffValue: 0.25 + - _AlphaOutlineBlend: 1 + - _AlphaOutlineGlow: 5 + - _AlphaOutlineMinAlpha: 0 + - _AlphaOutlinePower: 1 + - _AlphaRoundThreshold: 0.5 + - _BillboardY: 0 + - _BlurHD: 0 + - _BlurIntensity: 10 + - _Brightness: 0 + - _ChromAberrAlpha: 0.4 + - _ChromAberrAmount: 1 + - _ClipUvDown: 0 + - _ClipUvLeft: 0 + - _ClipUvRight: 0 + - _ClipUvUp: 0 + - _ColorChangeLuminosity: 0 + - _ColorChangeTolerance: 0.25 + - _ColorChangeTolerance2: 0.25 + - _ColorChangeTolerance3: 0.25 + - _ColorRampBlend: 1 + - _ColorRampLuminosity: 0 + - _ColorRampOutline: 0 + - _ColorSwapBlend: 1 + - _ColorSwapBlueLuminosity: 0.5 + - _ColorSwapGreenLuminosity: 0.5 + - _ColorSwapRedLuminosity: 0.5 + - _Contrast: 1 + - _CullingOption: 0 + - _DistortAmount: 0.5 + - _DistortTexXSpeed: 5 + - _DistortTexYSpeed: 5 + - _EditorDrawers: 6 + - _FadeAmount: -0.1 + - _FadeBurnGlow: 2 + - _FadeBurnTransition: 0.075 + - _FadeBurnWidth: 0.025 + - _FishEyeUvAmount: 0.35 + - _FlickerAlpha: 0 + - _FlickerFreq: 0.2 + - _FlickerPercent: 0.05 + - _GhostBlend: 1 + - _GhostColorBoost: 1 + - _GhostTransparency: 0 + - _GlitchAmount: 3 + - _GlitchSize: 1 + - _Glow: 10 + - _GlowGlobal: 1 + - _GradBlend: 1 + - _GradBoostX: 1.2 + - _GradBoostY: 1.2 + - _GradIsRadial: 0 + - _GrassManualAnim: 1 + - _GrassManualToggle: 0 + - _GrassRadialBend: 0.1 + - _GrassSpeed: 2 + - _GrassWind: 20 + - _GreyscaleBlend: 1 + - _GreyscaleLuminosity: 0 + - _GreyscaleOutline: 0 + - _HandDrawnAmount: 10 + - _HandDrawnSpeed: 5 + - _HitEffectBlend: 1 + - _HitEffectGlow: 5 + - _HologramBlend: 1 + - _HologramMaxAlpha: 0.75 + - _HologramMinAlpha: 0.1 + - _HologramStripesAmount: 0.1 + - _HologramStripesSpeed: 4.5 + - _HologramUnmodAmount: 0 + - _HsvBright: 1 + - _HsvSaturation: 1 + - _HsvShift: 180 + - _InnerOutlineAlpha: 1 + - _InnerOutlineGlow: 4 + - _InnerOutlineThickness: 1 + - _MaxXUV: 1 + - _MaxYUV: 1 + - _MinXUV: 0 + - _MinYUV: 0 + - _MotionBlurAngle: 0.1 + - _MotionBlurDist: 1.25 + - _MyDstMode: 10 + - _MySrcMode: 5 + - _NegativeAmount: 1 + - _OffsetUvX: 0 + - _OffsetUvY: 0 + - _OnlyInnerOutline: 0 + - _OnlyOutline: 0 + - _OutlineAlpha: 1 + - _OutlineDistortAmount: 0.5 + - _OutlineDistortTexXSpeed: 5 + - _OutlineDistortTexYSpeed: 5 + - _OutlineGlow: 1.5 + - _OutlinePixelWidth: 1 + - _OutlineTexXSpeed: 10 + - _OutlineTexYSpeed: 0 + - _OutlineWidth: 0.004 + - _OverlayBlend: 1 + - _OverlayGlow: 1 + - _OverlayTextureScrollXSpeed: 0.25 + - _OverlayTextureScrollYSpeed: 0.25 + - _PinchUvAmount: 0.35 + - _PixelateSize: 32 + - _PosterizeGamma: 0.75 + - _PosterizeNumColors: 8 + - _PosterizeOutline: 0 + - _RadialClip: 45 + - _RadialClip2: 0 + - _RadialClipAngle: 90 + - _RadialClipArc1: 45 + - _RadialClipArc2: 0 + - _RadialStartAngle: 90 + - _RandomSeed: 0 + - _RectSize: 1 + - _RotateUvAmount: 0 + - _RoundWaveSpeed: 2 + - _RoundWaveStrength: 0.7 + - _ShadowAlpha: 0.5 + - _ShadowX: 0.1 + - _ShadowY: -0.05 + - _ShakeUvSpeed: 2.5 + - _ShakeUvX: 1.5 + - _ShakeUvY: 1 + - _ShineGlow: 1 + - _ShineLocation: 0.5 + - _ShineRotate: 0 + - _ShineWidth: 0.1 + - _TextureScrollXSpeed: 1 + - _TextureScrollYSpeed: 0 + - _TwistUvAmount: 1 + - _TwistUvPosX: 0.5 + - _TwistUvPosY: 0.5 + - _TwistUvRadius: 0.75 + - _WarpScale: 0.51 + - _WarpSpeed: 10.9 + - _WarpStrength: 0.0211 + - _WaveAmount: 7 + - _WaveSpeed: 10 + - _WaveStrength: 7.5 + - _WaveX: 0 + - _WaveY: 0.5 + - _ZTestMode: 4 + - _ZWrite: 0 + - _ZoomUvAmount: 0.5 + m_Colors: + - _AlphaOutlineColor: {r: 1, g: 1, b: 1, a: 1} + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _ColorChangeNewCol: {r: 1, g: 1, b: 0, a: 1} + - _ColorChangeNewCol2: {r: 1, g: 1, b: 0, a: 1} + - _ColorChangeNewCol3: {r: 1, g: 1, b: 0, a: 1} + - _ColorChangeTarget: {r: 1, g: 0, b: 0, a: 1} + - _ColorChangeTarget2: {r: 1, g: 0, b: 0, a: 1} + - _ColorChangeTarget3: {r: 1, g: 0, b: 0, a: 1} + - _ColorSwapBlue: {r: 1, g: 1, b: 1, a: 1} + - _ColorSwapGreen: {r: 1, g: 1, b: 1, a: 1} + - _ColorSwapRed: {r: 1, g: 1, b: 1, a: 1} + - _FadeBurnColor: {r: 1, g: 1, b: 0, a: 1} + - _GlowColor: {r: 1, g: 1, b: 1, a: 1} + - _GradBotLeftCol: {r: 0, g: 0, b: 1, a: 1} + - _GradBotRightCol: {r: 0, g: 1, b: 0, a: 1} + - _GradTopLeftCol: {r: 1, g: 0, b: 0, a: 1} + - _GradTopRightCol: {r: 1, g: 1, b: 0, a: 1} + - _GreyscaleTintColor: {r: 1, g: 1, b: 1, a: 1} + - _HitEffectColor: {r: 1, g: 1, b: 1, a: 1} + - _HologramStripeColor: {r: 0, g: 1, b: 1, a: 1} + - _InnerOutlineColor: {r: 1, g: 0, b: 0, a: 1} + - _OutlineColor: {r: 1, g: 1, b: 1, a: 1} + - _OverlayColor: {r: 1, g: 1, b: 1, a: 1} + - _ShadowColor: {r: 0, g: 0, b: 0, a: 1} + - _ShineColor: {r: 1, g: 1, b: 1, a: 1} +--- !u!21 &1774397170 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: AllIn1SpriteShader/AllIn1SpriteShader + m_Shader: {fileID: 4800000, guid: a36b7719ff0465b42ab1407d67672c5f, type: 3} + m_ShaderKeywords: BLUR_ON DISTORT_ON ETC1_EXTERNAL_ALPHA FADE_ON HITEFFECT_ON OUTBASE8DIR_ON + _OUTLINE8DIRECTIONS_ON + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _ColorRampTex: + m_Texture: {fileID: 2800000, guid: 279657edc397ece4b8029c727adf6ddc, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ColorRampTexGradient: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ColorSwapTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DistortTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _FadeBurnTex: + m_Texture: {fileID: 2800000, guid: 677cca399782dea41aedc1d292ecb67d, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _FadeTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _GlowTex: + 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} + - _OutlineDistortTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OutlineTex: + m_Texture: {fileID: 2800000, guid: 74087f6d03f233e4a8a142fa01f9e5cf, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OverlayTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ShineMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - _Alpha: 1 + - _AlphaCutoffValue: 0.25 + - _AlphaOutlineBlend: 1 + - _AlphaOutlineGlow: 5 + - _AlphaOutlineMinAlpha: 0 + - _AlphaOutlinePower: 1 + - _AlphaRoundThreshold: 0.5 + - _BillboardY: 0 + - _BlurHD: 0 + - _BlurIntensity: 100 + - _Brightness: 0 + - _ChromAberrAlpha: 0.4 + - _ChromAberrAmount: 1 + - _ClipUvDown: 0 + - _ClipUvLeft: 0 + - _ClipUvRight: 0 + - _ClipUvUp: 0 + - _ColorChangeLuminosity: 0 + - _ColorChangeTolerance: 0.25 + - _ColorChangeTolerance2: 0.25 + - _ColorChangeTolerance3: 0.25 + - _ColorRampBlend: 1 + - _ColorRampLuminosity: 0 + - _ColorRampOutline: 0 + - _ColorSwapBlend: 1 + - _ColorSwapBlueLuminosity: 0.5 + - _ColorSwapGreenLuminosity: 0.5 + - _ColorSwapRedLuminosity: 0.5 + - _Contrast: 1 + - _CullingOption: 0 + - _DistortAmount: 0.93 + - _DistortTexXSpeed: -1 + - _DistortTexYSpeed: -11.6 + - _EditorDrawers: 6 + - _FadeAmount: 0.29 + - _FadeBurnGlow: 2 + - _FadeBurnTransition: 0.075 + - _FadeBurnWidth: 0.025 + - _FishEyeUvAmount: 0.35 + - _FlickerAlpha: 0 + - _FlickerFreq: 0.2 + - _FlickerPercent: 0.05 + - _GhostBlend: 1 + - _GhostColorBoost: 1 + - _GhostTransparency: 0 + - _GlitchAmount: 3 + - _GlitchSize: 1 + - _Glow: 10 + - _GlowGlobal: 1 + - _GlowTexUsed: 0 + - _GradBlend: 1 + - _GradBoostX: 1.2 + - _GradBoostY: 1.2 + - _GradIsRadial: 0 + - _GrassManualAnim: 1 + - _GrassManualToggle: 0 + - _GrassRadialBend: 0.1 + - _GrassSpeed: 2 + - _GrassWind: 20 + - _GreyscaleBlend: 1 + - _GreyscaleLuminosity: 0 + - _GreyscaleOutline: 0 + - _HandDrawnAmount: 10 + - _HandDrawnSpeed: 5 + - _HitEffectBlend: 1 + - _HitEffectGlow: 6.8 + - _HologramBlend: 1 + - _HologramMaxAlpha: 0.75 + - _HologramMinAlpha: 0.1 + - _HologramStripesAmount: 0.1 + - _HologramStripesSpeed: 4.5 + - _HologramUnmodAmount: 0 + - _HsvBright: 1 + - _HsvSaturation: 1 + - _HsvShift: 193 + - _InnerOutlineAlpha: 1 + - _InnerOutlineGlow: 1 + - _InnerOutlineThickness: 1 + - _MaxXUV: 1 + - _MaxYUV: 1 + - _MinXUV: 0 + - _MinYUV: 0 + - _MotionBlurAngle: 0.1 + - _MotionBlurDist: 1.25 + - _MyDstMode: 10 + - _MySrcMode: 5 + - _NegativeAmount: 1 + - _OffsetUvX: 0 + - _OffsetUvY: 0 + - _OnlyInnerOutline: 0 + - _OnlyOutline: 0 + - _Outline8Directions: 1 + - _OutlineAlpha: 1 + - _OutlineDistortAmount: 0.5 + - _OutlineDistortTexXSpeed: 5 + - _OutlineDistortTexYSpeed: 5 + - _OutlineDistortToggle: 0 + - _OutlineGlow: 1.5 + - _OutlineIsPixel: 0 + - _OutlinePixelWidth: 1 + - _OutlineTexGrey: 0 + - _OutlineTexToggle: 0 + - _OutlineTexXSpeed: 10 + - _OutlineTexYSpeed: 0 + - _OutlineWidth: 0.091 + - _OverlayBlend: 1 + - _OverlayGlow: 1 + - _OverlayTextureScrollXSpeed: 0.25 + - _OverlayTextureScrollYSpeed: 0.25 + - _PinchUvAmount: 0.35 + - _PixelateSize: 32 + - _PosterizeGamma: 0.75 + - _PosterizeNumColors: 8 + - _PosterizeOutline: 0 + - _RadialClip: 45 + - _RadialClip2: 0 + - _RadialClipAngle: 90 + - _RadialClipArc1: 45 + - _RadialClipArc2: 0 + - _RadialStartAngle: 90 + - _RandomSeed: 0 + - _RectSize: 1 + - _RotateUvAmount: 0 + - _RoundWaveSpeed: 2 + - _RoundWaveStrength: 0.7 + - _ShadowAlpha: 0.5 + - _ShadowX: 0.1 + - _ShadowY: -0.05 + - _ShakeUvSpeed: 2.5 + - _ShakeUvX: 1.5 + - _ShakeUvY: 1 + - _ShineGlow: 1 + - _ShineLocation: 0.5 + - _ShineRotate: 0 + - _ShineWidth: 0.1 + - _TextureScrollXSpeed: 1 + - _TextureScrollYSpeed: 0 + - _TwistUvAmount: 1 + - _TwistUvPosX: 0.5 + - _TwistUvPosY: 0.5 + - _TwistUvRadius: 0.75 + - _WarpScale: 0.5 + - _WarpSpeed: 8 + - _WarpStrength: 0.025 + - _WaveAmount: 7 + - _WaveSpeed: 10 + - _WaveStrength: 7.5 + - _WaveX: 0 + - _WaveY: 0.5 + - _ZTestMode: 4 + - _ZWrite: 0 + - _ZoomUvAmount: 0.5 + m_Colors: + - ColorSwapRed: {r: 1, g: 1, b: 1, a: 1} + - _AlphaOutlineColor: {r: 1, g: 1, b: 1, a: 1} + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _ColorChangeNewCol: {r: 1, g: 1, b: 0, a: 1} + - _ColorChangeNewCol2: {r: 1, g: 1, b: 0, a: 1} + - _ColorChangeNewCol3: {r: 1, g: 1, b: 0, a: 1} + - _ColorChangeTarget: {r: 1, g: 0, b: 0, a: 1} + - _ColorChangeTarget2: {r: 1, g: 0, b: 0, a: 1} + - _ColorChangeTarget3: {r: 1, g: 0, b: 0, a: 1} + - _ColorSwapBlue: {r: 1, g: 1, b: 1, a: 1} + - _ColorSwapGreen: {r: 1, g: 1, b: 1, a: 1} + - _ColorSwapRed: {r: 1, g: 1, b: 1, a: 1} + - _FadeBurnColor: {r: 1, g: 1, b: 1, a: 1} + - _GlowColor: {r: 1, g: 1, b: 1, a: 1} + - _GradBotLeftCol: {r: 0, g: 0, b: 1, a: 1} + - _GradBotRightCol: {r: 0, g: 0, b: 1, a: 1} + - _GradTopLeftCol: {r: 1, g: 0, b: 0, a: 1} + - _GradTopRightCol: {r: 1, g: 0, b: 0, a: 1} + - _GreyscaleTintColor: {r: 1, g: 1, b: 1, a: 1} + - _HitEffectColor: {r: 0, g: 1, b: 0.979686, a: 1} + - _HologramStripeColor: {r: 0, g: 1, b: 1, a: 1} + - _InnerOutlineColor: {r: 1, g: 0, b: 0, a: 1} + - _OutlineColor: {r: 1, g: 1, b: 1, a: 1} + - _OverlayColor: {r: 1, g: 1, b: 1, a: 1} + - _ShadowColor: {r: 0, g: 0, b: 0, a: 1} + - _ShineColor: {r: 1, g: 1, b: 1, a: 1} +--- !u!21 &1774554235 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: AllIn1SpriteShader/AllIn1SpriteShader + m_Shader: {fileID: 4800000, guid: a36b7719ff0465b42ab1407d67672c5f, type: 3} + m_ShaderKeywords: GRADIENT_ON + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _ColorRampTex: + m_Texture: {fileID: 2800000, guid: 279657edc397ece4b8029c727adf6ddc, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ColorRampTexGradient: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ColorSwapTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DistortTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _FadeBurnTex: + m_Texture: {fileID: 2800000, guid: 32e8df0008bebe746b1681a71c61f31c, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _FadeTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _GlowTex: + 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} + - _OutlineDistortTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OutlineTex: + m_Texture: {fileID: 2800000, guid: 74087f6d03f233e4a8a142fa01f9e5cf, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OverlayTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ShineMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - _Alpha: 1 + - _AlphaCutoffValue: 0.25 + - _AlphaOutlineBlend: 1 + - _AlphaOutlineGlow: 5 + - _AlphaOutlineMinAlpha: 0 + - _AlphaOutlinePower: 1 + - _AlphaRoundThreshold: 0.5 + - _BillboardY: 0 + - _BlurHD: 0 + - _BlurIntensity: 10 + - _Brightness: 0 + - _ChromAberrAlpha: 0.4 + - _ChromAberrAmount: 1 + - _ClipUvDown: 1 + - _ClipUvLeft: 1 + - _ClipUvRight: 1 + - _ClipUvUp: 1 + - _ColorChangeLuminosity: 0 + - _ColorChangeTolerance: 0.25 + - _ColorChangeTolerance2: 0.25 + - _ColorChangeTolerance3: 0.25 + - _ColorRampBlend: 1 + - _ColorRampLuminosity: 0 + - _ColorRampOutline: 0 + - _ColorSwapBlend: 1 + - _ColorSwapBlueLuminosity: 0.5 + - _ColorSwapGreenLuminosity: 0.5 + - _ColorSwapRedLuminosity: 0.5 + - _Contrast: 1 + - _CullingOption: 0 + - _DistortAmount: 0.5 + - _DistortTexXSpeed: 5 + - _DistortTexYSpeed: 5 + - _EditorDrawers: 6 + - _FadeAmount: -0.1 + - _FadeBurnGlow: 2 + - _FadeBurnTransition: 0.075 + - _FadeBurnWidth: 0.025 + - _FishEyeUvAmount: 0.35 + - _FlickerAlpha: 0 + - _FlickerFreq: 0.2 + - _FlickerPercent: 0.05 + - _GhostBlend: 1 + - _GhostColorBoost: 1 + - _GhostTransparency: 0 + - _GlitchAmount: 3 + - _GlitchSize: 1 + - _Glow: 10 + - _GlowGlobal: 1 + - _GlowTexUsed: 0 + - _GradBlend: 1 + - _GradBoostX: 1.2 + - _GradBoostY: 1.2 + - _GradIsRadial: 0 + - _GrassManualAnim: 1 + - _GrassManualToggle: 0 + - _GrassRadialBend: 0.25 + - _GrassSpeed: 2 + - _GrassWind: 20 + - _GreyscaleBlend: 1 + - _GreyscaleLuminosity: 0 + - _GreyscaleOutline: 0 + - _HandDrawnAmount: 10 + - _HandDrawnSpeed: 5 + - _HitEffectBlend: 1 + - _HitEffectGlow: 5 + - _HologramBlend: 1 + - _HologramFlickerAlpha: 0 + - _HologramFlickerFreq: 0.2 + - _HologramFlickerPercent: 0.05 + - _HologramMaxAlpha: 1 + - _HologramMinAlpha: 0 + - _HologramStripesAlpha: 0.4 + - _HologramStripesAmount: 50 + - _HologramStripesFill: 0.4 + - _HologramStripesLuminosity: 1 + - _HologramStripesSpeed: 5 + - _HologramUnmodAmount: 0.4 + - _HsvBright: 1 + - _HsvSaturation: 1 + - _HsvShift: 180 + - _InnerOutlineAlpha: 1 + - _InnerOutlineGlow: 1 + - _InnerOutlineThickness: 1 + - _MaxXUV: 1 + - _MaxYUV: 1 + - _MinXUV: 0 + - _MinYUV: 0 + - _MotionBlurAngle: 0.1 + - _MotionBlurDist: 1.25 + - _MyDstMode: 10 + - _MySrcMode: 5 + - _NegativeAmount: 1 + - _OffsetUvX: 0 + - _OffsetUvY: 0 + - _OnlyInnerOutline: 0 + - _OnlyOutline: 0 + - _Outline8Directions: 0 + - _OutlineAlpha: 1 + - _OutlineDistortAmount: 0.5 + - _OutlineDistortTexXSpeed: 5 + - _OutlineDistortTexYSpeed: 5 + - _OutlineDistortToggle: 0 + - _OutlineGlow: 1.5 + - _OutlineIsPixel: 0 + - _OutlinePixelWidth: 1 + - _OutlineTexGrey: 0 + - _OutlineTexToggle: 0 + - _OutlineTexXSpeed: 10 + - _OutlineTexYSpeed: 0 + - _OutlineWidth: 0.004 + - _OverlayBlend: 1 + - _OverlayGlow: 1 + - _OverlayTextureScrollXSpeed: 0.25 + - _OverlayTextureScrollYSpeed: 0.25 + - _PinchUvAmount: 0.35 + - _PixelateSize: 32 + - _PosterizeGamma: 0.75 + - _PosterizeNumColors: 8 + - _PosterizeOutline: 0 + - _RadialClip: 45 + - _RadialClip2: 45 + - _RadialClipAngle: 90 + - _RadialClipArc1: 45 + - _RadialClipArc2: 0 + - _RadialStartAngle: 90 + - _RandomSeed: 0 + - _RectSize: 1 + - _RotateUvAmount: 0 + - _RoundWaveSpeed: 2 + - _RoundWaveStrength: 0.7 + - _ShadowAlpha: 0.5 + - _ShadowX: 0.1 + - _ShadowY: -0.05 + - _ShakeUvSpeed: 2.5 + - _ShakeUvX: 1.5 + - _ShakeUvY: 1 + - _ShineGlow: 1 + - _ShineLocation: 0.5 + - _ShineRotate: 0 + - _ShineWidth: 0.1 + - _TextureScrollXSpeed: 1 + - _TextureScrollYSpeed: 0 + - _TwistUvAmount: 1 + - _TwistUvPosX: 0.5 + - _TwistUvPosY: 0.5 + - _TwistUvRadius: 0.75 + - _WarpScale: 0.5 + - _WarpSpeed: 8 + - _WarpStrength: 0.025 + - _WaveAmount: 7 + - _WaveSpeed: 10 + - _WaveStrength: 7.5 + - _WaveX: 0 + - _WaveY: 0.5 + - _ZTestMode: 4 + - _ZWrite: 0 + - _ZoomUvAmount: 0.5 + m_Colors: + - ColorSwapRed: {r: 1, g: 1, b: 1, a: 1} + - _AlphaOutlineColor: {r: 1, g: 1, b: 1, a: 1} + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _ColorChangeNewCol: {r: 1, g: 1, b: 0, a: 1} + - _ColorChangeNewCol2: {r: 1, g: 1, b: 0, a: 1} + - _ColorChangeNewCol3: {r: 1, g: 1, b: 0, a: 1} + - _ColorChangeTarget: {r: 1, g: 0, b: 0, a: 1} + - _ColorChangeTarget2: {r: 1, g: 0, b: 0, a: 1} + - _ColorChangeTarget3: {r: 1, g: 0, b: 0, a: 1} + - _ColorSwapBlue: {r: 1, g: 1, b: 1, a: 1} + - _ColorSwapGreen: {r: 1, g: 1, b: 1, a: 1} + - _ColorSwapRed: {r: 1, g: 1, b: 1, a: 1} + - _FadeBurnColor: {r: 1, g: 1, b: 0, a: 1} + - _GlowColor: {r: 1, g: 1, b: 1, a: 1} + - _GradBotLeftCol: {r: 0, g: 0.8407619, b: 1, a: 1} + - _GradBotRightCol: {r: 0, g: 0.83921576, b: 1, a: 1} + - _GradTopLeftCol: {r: 0, g: 0.13740095, b: 0.4627451, a: 1} + - _GradTopRightCol: {r: 0, g: 0.14242734, b: 0.46226418, a: 1} + - _GreyscaleTintColor: {r: 1, g: 1, b: 1, a: 1} + - _HitEffectColor: {r: 1, g: 1, b: 1, a: 1} + - _HologramStripeColor: {r: 1, g: 1, b: 1, a: 1} + - _InnerOutlineColor: {r: 1, g: 0, b: 0, a: 1} + - _OutlineColor: {r: 1, g: 1, b: 1, a: 1} + - _OverlayColor: {r: 1, g: 1, b: 1, a: 1} + - _ShadowColor: {r: 0, g: 0, b: 0, a: 1} + - _ShineColor: {r: 1, g: 1, b: 1, a: 1} +--- !u!1 &1778749803 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1778749804} + - component: {fileID: 1778749807} + - component: {fileID: 1778749806} + m_Layer: 0 + m_Name: Hand Drawn + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1778749804 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1778749803} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 10, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 644371592} + - {fileID: 1601051770} + m_Father: {fileID: 1351315063} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &1778749806 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1778749803} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 98b644315d7a92842b89e04f55c48e02, type: 3} + m_Name: + m_EditorClassIdentifier: +--- !u!212 &1778749807 +SpriteRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1778749803} + m_Enabled: 1 + m_CastShadows: 0 + m_ReceiveShadows: 0 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 469847421} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 0 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_Sprite: {fileID: 21300000, guid: 519dafacd208bb64c83d5124be03b09d, type: 3} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_FlipX: 0 + m_FlipY: 0 + m_DrawMode: 0 + m_Size: {x: 5.12, y: 5.12} + m_AdaptiveModeThreshold: 0.5 + m_SpriteTileMode: 0 + m_WasSpriteAssigned: 1 + m_MaskInteraction: 0 + m_SpriteSortPoint: 0 +--- !u!1 &1797106725 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1797106726} + - component: {fileID: 1797106728} + - component: {fileID: 1797106727} + m_Layer: 0 + m_Name: FireBack + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1797106726 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1797106725} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 0.7405772, y: 0.7405772, z: 0.7405772} + m_Children: [] + m_Father: {fileID: 1953432852} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &1797106727 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1797106725} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: ee158225ee1e59f4791627785501d950, type: 3} + m_Name: + m_EditorClassIdentifier: + currentShaderType: 4 + normalStrength: 5 + normalSmoothing: 1 + computingNormal: 0 +--- !u!212 &1797106728 +SpriteRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1797106725} + m_Enabled: 1 + m_CastShadows: 0 + m_ReceiveShadows: 0 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 1201459352} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 0 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_Sprite: {fileID: 21300000, guid: bd6f48b4407043345b1a3a07df8c4d61, type: 3} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_FlipX: 0 + m_FlipY: 0 + m_DrawMode: 0 + m_Size: {x: 5.12, y: 5.12} + m_AdaptiveModeThreshold: 0.5 + m_SpriteTileMode: 0 + m_WasSpriteAssigned: 1 + m_MaskInteraction: 0 + m_SpriteSortPoint: 0 +--- !u!1 &1809913716 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1809913717} + - component: {fileID: 1809913719} + - component: {fileID: 1809913718} + m_Layer: 0 + m_Name: Animated + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 0 +--- !u!4 &1809913717 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1809913716} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: -3.57, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 2035943844} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!102 &1809913718 +TextMesh: + serializedVersion: 3 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1809913716} + m_Text: (Has Animation) + m_OffsetZ: -1.5 + m_CharacterSize: 0.075 + m_LineSpacing: 1 + m_Anchor: 4 + m_Alignment: 0 + m_TabSize: 4 + m_FontSize: 100 + m_FontStyle: 0 + m_RichText: 1 + m_Font: {fileID: 12800000, guid: a4e6a5491519adb45919dc87eff28e55, type: 3} + m_Color: + serializedVersion: 2 + rgba: 4294967295 +--- !u!23 &1809913719 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1809913716} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: a4e6a5491519adb45919dc87eff28e55, type: 3} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!1 &1813870143 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1813870144} + - component: {fileID: 1813870146} + - component: {fileID: 1813870147} + m_Layer: 0 + m_Name: Chromatic Aberration + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1813870144 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1813870143} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 240, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 858113522} + - {fileID: 376742882} + m_Father: {fileID: 2036092933} + m_RootOrder: 24 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!212 &1813870146 +SpriteRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1813870143} + m_Enabled: 1 + m_CastShadows: 0 + m_ReceiveShadows: 0 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 1377307553} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 0 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_Sprite: {fileID: 21300000, guid: 519dafacd208bb64c83d5124be03b09d, type: 3} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_FlipX: 0 + m_FlipY: 0 + m_DrawMode: 0 + m_Size: {x: 5.12, y: 5.12} + m_AdaptiveModeThreshold: 0.5 + m_SpriteTileMode: 0 + m_WasSpriteAssigned: 1 + m_MaskInteraction: 0 + m_SpriteSortPoint: 0 +--- !u!114 &1813870147 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1813870143} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 98b644315d7a92842b89e04f55c48e02, type: 3} + m_Name: + m_EditorClassIdentifier: +--- !u!21 &1814697822 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: AllIn1SpriteShader/AllIn1SpriteShader + m_Shader: {fileID: 4800000, guid: a36b7719ff0465b42ab1407d67672c5f, type: 3} + m_ShaderKeywords: BLUR_ON COLORRAMP_ON ETC1_EXTERNAL_ALPHA GLOWTEX_ON GLOW_ON HOLOGRAM_ON + HSV_ON PINCH_ON ROTATEUV_ON _GLOWTEXUSED_ON + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _ColorRampTex: + m_Texture: {fileID: 2800000, guid: 763e13699209a614b8800c76fc9dee48, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ColorRampTexGradient: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ColorSwapTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DistortTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _FadeBurnTex: + m_Texture: {fileID: 2800000, guid: 677cca399782dea41aedc1d292ecb67d, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _FadeTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _GlowTex: + m_Texture: {fileID: 2800000, guid: 81687001a52d8024fb3706ba7619ad4b, type: 3} + 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} + - _OutlineDistortTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OutlineTex: + m_Texture: {fileID: 2800000, guid: 74087f6d03f233e4a8a142fa01f9e5cf, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OverlayTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ShineMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - _Alpha: 1 + - _AlphaCutoffValue: 0.25 + - _AlphaOutlineBlend: 1 + - _AlphaOutlineGlow: 5 + - _AlphaOutlineMinAlpha: 0 + - _AlphaOutlinePower: 1 + - _AlphaRoundThreshold: 0.5 + - _BillboardY: 0 + - _BlurHD: 0 + - _BlurIntensity: 5.1 + - _Brightness: 0 + - _ChromAberrAlpha: 0.461 + - _ChromAberrAmount: 1 + - _ClipUvDown: 0 + - _ClipUvLeft: 0 + - _ClipUvRight: 0 + - _ClipUvUp: 0 + - _ColorChangeLuminosity: 0 + - _ColorChangeTolerance: 0.25 + - _ColorChangeTolerance2: 0.25 + - _ColorChangeTolerance3: 0.25 + - _ColorRampBlend: 1 + - _ColorRampLuminosity: -0.21 + - _ColorRampOutline: 0 + - _ColorSwapBlend: 1 + - _ColorSwapBlueLuminosity: 0.5 + - _ColorSwapGreenLuminosity: 0.5 + - _ColorSwapRedLuminosity: 0.5 + - _Contrast: 1 + - _CullingOption: 0 + - _DistortAmount: 0.5 + - _DistortTexXSpeed: 5 + - _DistortTexYSpeed: 5 + - _EditorDrawers: 6 + - _FadeAmount: -0.1 + - _FadeBurnGlow: 2 + - _FadeBurnTransition: 0.075 + - _FadeBurnWidth: 0.025 + - _FishEyeUvAmount: 0 + - _FlickerAlpha: 0 + - _FlickerFreq: 0.2 + - _FlickerPercent: 0.05 + - _GhostBlend: 1 + - _GhostColorBoost: 1 + - _GhostTransparency: 0 + - _GlitchAmount: 7.4 + - _GlitchSize: 2.57 + - _Glow: 3.9 + - _GlowGlobal: 1 + - _GlowTexUsed: 1 + - _GradBlend: 1 + - _GradBoostX: 1.2 + - _GradBoostY: 1.2 + - _GradIsRadial: 0 + - _GrassManualAnim: 1 + - _GrassManualToggle: 0 + - _GrassRadialBend: 0.25 + - _GrassSpeed: 2 + - _GrassWind: 20 + - _GreyscaleBlend: 1 + - _GreyscaleLuminosity: 0 + - _GreyscaleOutline: 0 + - _HandDrawnAmount: 10 + - _HandDrawnSpeed: 5 + - _HitEffectBlend: 1 + - _HitEffectGlow: 5 + - _HologramBlend: 1 + - _HologramMaxAlpha: 1 + - _HologramMinAlpha: 0.651 + - _HologramStripesAmount: 0.124 + - _HologramStripesSpeed: 2.8 + - _HologramUnmodAmount: 0 + - _HsvBright: 1.07 + - _HsvSaturation: 1.86 + - _HsvShift: 360 + - _InnerOutlineAlpha: 1 + - _InnerOutlineGlow: 1 + - _InnerOutlineThickness: 1 + - _MaxXUV: 1 + - _MaxYUV: 1 + - _MinXUV: 0 + - _MinYUV: 0 + - _MotionBlurAngle: 0.1 + - _MotionBlurDist: 1.25 + - _MyDstMode: 10 + - _MySrcMode: 5 + - _NegativeAmount: 1 + - _OffsetUvX: 0 + - _OffsetUvY: 0 + - _OnlyInnerOutline: 0 + - _OnlyOutline: 0 + - _Outline8Directions: 0 + - _OutlineAlpha: 1 + - _OutlineDistortAmount: 0.5 + - _OutlineDistortTexXSpeed: 5 + - _OutlineDistortTexYSpeed: 5 + - _OutlineDistortToggle: 0 + - _OutlineGlow: 1.5 + - _OutlineIsPixel: 0 + - _OutlinePixelWidth: 1 + - _OutlineTexGrey: 0 + - _OutlineTexToggle: 0 + - _OutlineTexXSpeed: 10 + - _OutlineTexYSpeed: 0 + - _OutlineWidth: 0.004 + - _OverlayBlend: 1 + - _OverlayGlow: 1 + - _OverlayTextureScrollXSpeed: 0.25 + - _OverlayTextureScrollYSpeed: 0.25 + - _PinchUvAmount: 0 + - _PixelateSize: 32 + - _PosterizeGamma: 0.75 + - _PosterizeNumColors: 8 + - _PosterizeOutline: 0 + - _RadialClip: 0 + - _RadialClip2: 45 + - _RadialClipAngle: 90 + - _RadialClipArc1: 45 + - _RadialClipArc2: 0 + - _RadialStartAngle: 90 + - _RandomSeed: 0 + - _RectSize: 1 + - _RotateUvAmount: 6.28 + - _RoundWaveSpeed: 2 + - _RoundWaveStrength: 0.7 + - _ShadowAlpha: 0.5 + - _ShadowX: 0.1 + - _ShadowY: -0.05 + - _ShakeUvSpeed: 2.5 + - _ShakeUvX: 1.5 + - _ShakeUvY: 1 + - _ShineGlow: 1 + - _ShineLocation: 0.5 + - _ShineRotate: 0 + - _ShineWidth: 0.1 + - _TextureScrollXSpeed: 1 + - _TextureScrollYSpeed: 0 + - _TwistUvAmount: 1 + - _TwistUvPosX: 0.5 + - _TwistUvPosY: 0.5 + - _TwistUvRadius: 0.75 + - _WarpScale: 0.5 + - _WarpSpeed: 8 + - _WarpStrength: 0.025 + - _WaveAmount: 7 + - _WaveSpeed: 10 + - _WaveStrength: 7.5 + - _WaveX: 0 + - _WaveY: 0.5 + - _ZTestMode: 4 + - _ZWrite: 0 + - _ZoomUvAmount: 0.5 + m_Colors: + - ColorSwapRed: {r: 1, g: 1, b: 1, a: 1} + - _AlphaOutlineColor: {r: 1, g: 1, b: 1, a: 1} + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _ColorChangeNewCol: {r: 1, g: 1, b: 0, a: 1} + - _ColorChangeNewCol2: {r: 1, g: 1, b: 0, a: 1} + - _ColorChangeNewCol3: {r: 1, g: 1, b: 0, a: 1} + - _ColorChangeTarget: {r: 1, g: 0, b: 0, a: 1} + - _ColorChangeTarget2: {r: 1, g: 0, b: 0, a: 1} + - _ColorChangeTarget3: {r: 1, g: 0, b: 0, a: 1} + - _ColorSwapBlue: {r: 1, g: 1, b: 1, a: 1} + - _ColorSwapGreen: {r: 1, g: 1, b: 1, a: 1} + - _ColorSwapRed: {r: 1, g: 1, b: 1, a: 1} + - _FadeBurnColor: {r: 1, g: 1, b: 0, a: 1} + - _GlowColor: {r: 1, g: 1, b: 1, a: 1} + - _GradBotLeftCol: {r: 0, g: 0, b: 1, a: 1} + - _GradBotRightCol: {r: 0, g: 0, b: 1, a: 1} + - _GradTopLeftCol: {r: 1, g: 0, b: 0, a: 1} + - _GradTopRightCol: {r: 1, g: 0, b: 0, a: 1} + - _GreyscaleTintColor: {r: 1, g: 1, b: 1, a: 1} + - _HitEffectColor: {r: 1, g: 1, b: 1, a: 1} + - _HologramStripeColor: {r: 1, g: 1, b: 1, a: 1} + - _InnerOutlineColor: {r: 1, g: 0, b: 0, a: 1} + - _OutlineColor: {r: 1, g: 1, b: 1, a: 1} + - _OverlayColor: {r: 1, g: 1, b: 1, a: 1} + - _ShadowColor: {r: 0, g: 0, b: 0, a: 1} + - _ShineColor: {r: 1, g: 1, b: 1, a: 1} +--- !u!1 &1818617669 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1818617670} + - component: {fileID: 1818617672} + - component: {fileID: 1818617671} + m_Layer: 0 + m_Name: Outline1 + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1818617670 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1818617669} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: -1.5, y: 0.82, z: 0.05} + m_LocalScale: {x: 1.0080961, y: 1.0080961, z: 1.0080961} + m_Children: [] + m_Father: {fileID: 1415143267} + m_RootOrder: 3 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &1818617671 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1818617669} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: ee158225ee1e59f4791627785501d950, type: 3} + m_Name: + m_EditorClassIdentifier: + currentShaderType: 4 + normalStrength: 5 + normalSmoothing: 1 + computingNormal: 0 +--- !u!212 &1818617672 +SpriteRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1818617669} + m_Enabled: 1 + m_CastShadows: 0 + m_ReceiveShadows: 0 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: 2fff2435ee99439438c463e2ce768283, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 0 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_Sprite: {fileID: 21300000, guid: 519dafacd208bb64c83d5124be03b09d, type: 3} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_FlipX: 1 + m_FlipY: 0 + m_DrawMode: 0 + m_Size: {x: 5.12, y: 5.12} + m_AdaptiveModeThreshold: 0.5 + m_SpriteTileMode: 0 + m_WasSpriteAssigned: 1 + m_MaskInteraction: 0 + m_SpriteSortPoint: 0 +--- !u!21 &1820263336 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: AllIn1SpriteShader/AllIn1SpriteShader + m_Shader: {fileID: 4800000, guid: a36b7719ff0465b42ab1407d67672c5f, type: 3} + m_ShaderKeywords: CLIPPING_ON ETC1_EXTERNAL_ALPHA WAVEUV_ON WIND_ON + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _ColorRampTex: + m_Texture: {fileID: 2800000, guid: 279657edc397ece4b8029c727adf6ddc, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ColorRampTexGradient: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ColorSwapTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DistortTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _FadeBurnTex: + m_Texture: {fileID: 2800000, guid: 32e8df0008bebe746b1681a71c61f31c, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _FadeTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _GlowTex: + 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} + - _OutlineDistortTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OutlineTex: + m_Texture: {fileID: 2800000, guid: 74087f6d03f233e4a8a142fa01f9e5cf, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OverlayTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ShineMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - _Alpha: 1 + - _AlphaCutoffValue: 0.25 + - _AlphaOutlineBlend: 1 + - _AlphaOutlineGlow: 5 + - _AlphaOutlineMinAlpha: 0 + - _AlphaOutlinePower: 1 + - _AlphaRoundThreshold: 0.5 + - _BillboardY: 0 + - _BlurHD: 0 + - _BlurIntensity: 10 + - _Brightness: 0 + - _ChromAberrAlpha: 0.4 + - _ChromAberrAmount: 1 + - _ClipUvDown: 0 + - _ClipUvLeft: 0.35 + - _ClipUvRight: 0.35 + - _ClipUvUp: 0.06 + - _ColorChangeLuminosity: 0 + - _ColorChangeTolerance: 0.25 + - _ColorChangeTolerance2: 0.25 + - _ColorChangeTolerance3: 0.25 + - _ColorRampBlend: 1 + - _ColorRampLuminosity: 0 + - _ColorRampOutline: 0 + - _ColorSwapBlend: 1 + - _ColorSwapBlueLuminosity: 0.5 + - _ColorSwapGreenLuminosity: 0.5 + - _ColorSwapRedLuminosity: 0.5 + - _Contrast: 1 + - _CullingOption: 0 + - _DistortAmount: 0.5 + - _DistortTexXSpeed: 5 + - _DistortTexYSpeed: 5 + - _EditorDrawers: 6 + - _FadeAmount: -0.1 + - _FadeBurnGlow: 2 + - _FadeBurnTransition: 0.075 + - _FadeBurnWidth: 0.025 + - _FishEyeUvAmount: 0.35 + - _FlickerAlpha: 0 + - _FlickerFreq: 0.2 + - _FlickerPercent: 0.05 + - _GhostBlend: 1 + - _GhostColorBoost: 1 + - _GhostTransparency: 0 + - _GlitchAmount: 3 + - _GlitchSize: 1 + - _Glow: 10 + - _GlowGlobal: 1 + - _GlowTexUsed: 0 + - _GradBlend: 1 + - _GradBoostX: 1.2 + - _GradBoostY: 1.2 + - _GradIsRadial: 0 + - _GrassManualAnim: 1 + - _GrassManualToggle: 0 + - _GrassRadialBend: 0.02 + - _GrassSpeed: 2 + - _GrassWind: 2 + - _GreyscaleBlend: 1 + - _GreyscaleLuminosity: 0 + - _GreyscaleOutline: 0 + - _HandDrawnAmount: 10 + - _HandDrawnSpeed: 5 + - _HitEffectBlend: 1 + - _HitEffectGlow: 5 + - _HologramBlend: 1 + - _HologramFlickerAlpha: 0 + - _HologramFlickerFreq: 0.2 + - _HologramFlickerPercent: 0.05 + - _HologramMaxAlpha: 1 + - _HologramMinAlpha: 0 + - _HologramStripesAlpha: 0.4 + - _HologramStripesAmount: 50 + - _HologramStripesFill: 0.4 + - _HologramStripesLuminosity: 1 + - _HologramStripesSpeed: 5 + - _HologramUnmodAmount: 0.4 + - _HsvBright: 1 + - _HsvSaturation: 1 + - _HsvShift: 180 + - _InnerOutlineAlpha: 1 + - _InnerOutlineGlow: 1 + - _InnerOutlineThickness: 1 + - _MaxXUV: 1 + - _MaxYUV: 1 + - _MinXUV: 0 + - _MinYUV: 0 + - _MotionBlurAngle: 0.1 + - _MotionBlurDist: 1.25 + - _MyDstMode: 10 + - _MySrcMode: 5 + - _NegativeAmount: 1 + - _OffsetUvX: 0 + - _OffsetUvY: 0 + - _OnlyInnerOutline: 0 + - _OnlyOutline: 0 + - _Outline8Directions: 0 + - _OutlineAlpha: 1 + - _OutlineDistortAmount: 0.5 + - _OutlineDistortTexXSpeed: 5 + - _OutlineDistortTexYSpeed: 5 + - _OutlineDistortToggle: 0 + - _OutlineGlow: 1.5 + - _OutlineIsPixel: 0 + - _OutlinePixelWidth: 1 + - _OutlineTexGrey: 0 + - _OutlineTexToggle: 0 + - _OutlineTexXSpeed: 10 + - _OutlineTexYSpeed: 0 + - _OutlineWidth: 0.004 + - _OverlayBlend: 1 + - _OverlayGlow: 1 + - _OverlayTextureScrollXSpeed: 0.25 + - _OverlayTextureScrollYSpeed: 0.25 + - _PinchUvAmount: 0.35 + - _PixelateSize: 32 + - _PosterizeGamma: 0.75 + - _PosterizeNumColors: 8 + - _PosterizeOutline: 0 + - _RadialClipAngle: 90 + - _RadialClipArc1: 45 + - _RadialClipArc2: 0 + - _RandomSeed: 0 + - _RectSize: 1 + - _RotateUvAmount: 0 + - _RoundWaveSpeed: 2 + - _RoundWaveStrength: 0.7 + - _ShadowAlpha: 0.5 + - _ShadowX: 0.1 + - _ShadowY: -0.05 + - _ShakeUvSpeed: 2.5 + - _ShakeUvX: 1.5 + - _ShakeUvY: 1 + - _ShineGlow: 1 + - _ShineLocation: 0.5 + - _ShineRotate: 0 + - _ShineWidth: 0.1 + - _TextureScrollXSpeed: 1 + - _TextureScrollYSpeed: 0 + - _TwistUvAmount: 1 + - _TwistUvPosX: 0.5 + - _TwistUvPosY: 0.5 + - _TwistUvRadius: 0.75 + - _WarpScale: 0.5 + - _WarpSpeed: 8 + - _WarpStrength: 0.025 + - _WaveAmount: 5.67 + - _WaveSpeed: 2 + - _WaveStrength: 2.32 + - _WaveX: 0 + - _WaveY: 0.5 + - _ZTestMode: 4 + - _ZWrite: 0 + - _ZoomUvAmount: 0.5 + m_Colors: + - ColorSwapRed: {r: 1, g: 1, b: 1, a: 1} + - _AlphaOutlineColor: {r: 1, g: 1, b: 1, a: 1} + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _ColorChangeNewCol: {r: 1, g: 1, b: 0, a: 1} + - _ColorChangeNewCol2: {r: 1, g: 1, b: 0, a: 1} + - _ColorChangeNewCol3: {r: 1, g: 1, b: 0, a: 1} + - _ColorChangeTarget: {r: 1, g: 0, b: 0, a: 1} + - _ColorChangeTarget2: {r: 1, g: 0, b: 0, a: 1} + - _ColorChangeTarget3: {r: 1, g: 0, b: 0, a: 1} + - _ColorSwapBlue: {r: 1, g: 1, b: 1, a: 1} + - _ColorSwapGreen: {r: 1, g: 1, b: 1, a: 1} + - _ColorSwapRed: {r: 1, g: 1, b: 1, a: 1} + - _FadeBurnColor: {r: 1, g: 1, b: 0, a: 1} + - _GlowColor: {r: 1, g: 1, b: 1, a: 1} + - _GradBotLeftCol: {r: 0, g: 0, b: 1, a: 1} + - _GradBotRightCol: {r: 0, g: 0, b: 1, a: 1} + - _GradTopLeftCol: {r: 1, g: 0, b: 0, a: 1} + - _GradTopRightCol: {r: 1, g: 0, b: 0, a: 1} + - _GreyscaleTintColor: {r: 1, g: 1, b: 1, a: 1} + - _HitEffectColor: {r: 1, g: 1, b: 1, a: 1} + - _HologramStripeColor: {r: 1, g: 1, b: 1, a: 1} + - _InnerOutlineColor: {r: 1, g: 0, b: 0, a: 1} + - _OutlineColor: {r: 1, g: 1, b: 1, a: 1} + - _OverlayColor: {r: 1, g: 1, b: 1, a: 1} + - _ShadowColor: {r: 0, g: 0, b: 0, a: 1} + - _ShineColor: {r: 1, g: 1, b: 1, a: 1} +--- !u!1 &1822267180 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1822267181} + - component: {fileID: 1822267183} + - component: {fileID: 1822267182} + m_Layer: 0 + m_Name: Animated + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 0 +--- !u!4 &1822267181 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1822267180} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: -3.57, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 1447921189} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!102 &1822267182 +TextMesh: + serializedVersion: 3 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1822267180} + m_Text: (Has Animation) + m_OffsetZ: -1.5 + m_CharacterSize: 0.075 + m_LineSpacing: 1 + m_Anchor: 4 + m_Alignment: 0 + m_TabSize: 4 + m_FontSize: 100 + m_FontStyle: 0 + m_RichText: 1 + m_Font: {fileID: 12800000, guid: a4e6a5491519adb45919dc87eff28e55, type: 3} + m_Color: + serializedVersion: 2 + rgba: 4294967295 +--- !u!23 &1822267183 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1822267180} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: a4e6a5491519adb45919dc87eff28e55, type: 3} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!1 &1828174012 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1828174013} + - component: {fileID: 1828174015} + - component: {fileID: 1828174014} + m_Layer: 0 + m_Name: Title + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1828174013 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1828174012} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: -2.51, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 2082220742} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!102 &1828174014 +TextMesh: + serializedVersion: 3 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1828174012} + m_Text: Rotate + m_OffsetZ: -1.5 + m_CharacterSize: 0.075 + m_LineSpacing: 1 + m_Anchor: 4 + m_Alignment: 0 + m_TabSize: 4 + m_FontSize: 100 + m_FontStyle: 0 + m_RichText: 1 + m_Font: {fileID: 12800000, guid: a4e6a5491519adb45919dc87eff28e55, type: 3} + m_Color: + serializedVersion: 2 + rgba: 4294967295 +--- !u!23 &1828174015 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1828174012} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 10100, guid: 0000000000000000e000000000000000, type: 0} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!1 &1843941479 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1843941480} + - component: {fileID: 1843941482} + - component: {fileID: 1843941481} + m_Layer: 0 + m_Name: Animated + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1843941480 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1843941479} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: -3.57, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 540549269} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!102 &1843941481 +TextMesh: + serializedVersion: 3 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1843941479} + m_Text: (Has Animation) + m_OffsetZ: -1.5 + m_CharacterSize: 0.075 + m_LineSpacing: 1 + m_Anchor: 4 + m_Alignment: 0 + m_TabSize: 4 + m_FontSize: 100 + m_FontStyle: 0 + m_RichText: 1 + m_Font: {fileID: 12800000, guid: a4e6a5491519adb45919dc87eff28e55, type: 3} + m_Color: + serializedVersion: 2 + rgba: 4294967295 +--- !u!23 &1843941482 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1843941479} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 10100, guid: 0000000000000000e000000000000000, type: 0} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!1 &1848773094 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1848773095} + - component: {fileID: 1848773097} + - component: {fileID: 1848773096} + m_Layer: 0 + m_Name: Title + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1848773095 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1848773094} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: -2.51, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 1478122371} + m_RootOrder: 2 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!102 &1848773096 +TextMesh: + serializedVersion: 3 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1848773094} + m_Text: Outline Always Visible + m_OffsetZ: -1.5 + m_CharacterSize: 0.075 + m_LineSpacing: 1 + m_Anchor: 4 + m_Alignment: 0 + m_TabSize: 4 + m_FontSize: 100 + m_FontStyle: 0 + m_RichText: 1 + m_Font: {fileID: 12800000, guid: a4e6a5491519adb45919dc87eff28e55, type: 3} + m_Color: + serializedVersion: 2 + rgba: 4294967295 +--- !u!23 &1848773097 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1848773094} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 10100, guid: 0000000000000000e000000000000000, type: 0} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!1 &1850969166 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1850969167} + - component: {fileID: 1850969169} + - component: {fileID: 1850969168} + m_Layer: 0 + m_Name: Title + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1850969167 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1850969166} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: -2.51, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 1073973762} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!102 &1850969168 +TextMesh: + serializedVersion: 3 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1850969166} + m_Text: Distorted Outline + m_OffsetZ: -1.5 + m_CharacterSize: 0.075 + m_LineSpacing: 1 + m_Anchor: 4 + m_Alignment: 0 + m_TabSize: 4 + m_FontSize: 100 + m_FontStyle: 0 + m_RichText: 1 + m_Font: {fileID: 12800000, guid: a4e6a5491519adb45919dc87eff28e55, type: 3} + m_Color: + serializedVersion: 2 + rgba: 4294967295 +--- !u!23 &1850969169 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1850969166} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 10100, guid: 0000000000000000e000000000000000, type: 0} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!1 &1858630622 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1858630623} + - component: {fileID: 1858630625} + - component: {fileID: 1858630624} + m_Layer: 0 + m_Name: Title + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1858630623 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1858630622} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: -2.51, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 1756331349} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!102 &1858630624 +TextMesh: + serializedVersion: 3 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1858630622} + m_Text: Portal + m_OffsetZ: -1.5 + m_CharacterSize: 0.075 + m_LineSpacing: 1 + m_Anchor: 4 + m_Alignment: 0 + m_TabSize: 4 + m_FontSize: 100 + m_FontStyle: 0 + m_RichText: 1 + m_Font: {fileID: 12800000, guid: a4e6a5491519adb45919dc87eff28e55, type: 3} + m_Color: + serializedVersion: 2 + rgba: 4294967295 +--- !u!23 &1858630625 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1858630622} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 10100, guid: 0000000000000000e000000000000000, type: 0} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!1 &1861014112 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1861014113} + - component: {fileID: 1861014117} + - component: {fileID: 1861014116} + - component: {fileID: 1861014114} + - component: {fileID: 1861014118} + m_Layer: 0 + m_Name: BurningSoldier + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1861014113 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1861014112} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 340, y: 0, z: 0} + m_LocalScale: {x: 0.80276, y: 0.80276, z: 0.80276} + m_Children: + - {fileID: 1734593092} + - {fileID: 1523182285} + - {fileID: 945953421} + m_Father: {fileID: 1563905016} + m_RootOrder: 34 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!331 &1861014114 +SpriteMask: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1861014112} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 10758, guid: 0000000000000000f000000000000000, type: 0} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_Sprite: {fileID: 21300000, guid: 519dafacd208bb64c83d5124be03b09d, type: 3} + m_MaskAlphaCutoff: 0.2 + m_FrontSortingLayerID: 0 + m_BackSortingLayerID: 0 + m_FrontSortingLayer: 0 + m_BackSortingLayer: 0 + m_FrontSortingOrder: 0 + m_BackSortingOrder: 0 + m_IsCustomRangeActive: 0 + m_SpriteSortPoint: 0 +--- !u!114 &1861014116 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1861014112} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 98b644315d7a92842b89e04f55c48e02, type: 3} + m_Name: + m_EditorClassIdentifier: +--- !u!212 &1861014117 +SpriteRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1861014112} + m_Enabled: 1 + m_CastShadows: 0 + m_ReceiveShadows: 0 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: cd0693e274874cc4f8ffd67a41ebe801, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 0 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_Sprite: {fileID: 21300000, guid: 519dafacd208bb64c83d5124be03b09d, type: 3} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_FlipX: 0 + m_FlipY: 0 + m_DrawMode: 0 + m_Size: {x: 5.12, y: 5.12} + m_AdaptiveModeThreshold: 0.5 + m_SpriteTileMode: 0 + m_WasSpriteAssigned: 1 + m_MaskInteraction: 0 + m_SpriteSortPoint: 0 +--- !u!95 &1861014118 +Animator: + serializedVersion: 3 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1861014112} + m_Enabled: 1 + m_Avatar: {fileID: 0} + m_Controller: {fileID: 9100000, guid: 5f3b82f530c24dd48961a1d428ed91d8, type: 2} + m_CullingMode: 0 + m_UpdateMode: 0 + m_ApplyRootMotion: 0 + m_LinearVelocityBlending: 0 + m_WarningMessage: + m_HasTransformHierarchy: 1 + m_AllowConstantClipSamplingOptimization: 1 + m_KeepAnimatorControllerStateOnDisable: 0 +--- !u!21 &1863638619 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: AllIn1SpriteShader/AllIn1SpriteShader + m_Shader: {fileID: 4800000, guid: a36b7719ff0465b42ab1407d67672c5f, type: 3} + m_ShaderKeywords: ETC1_EXTERNAL_ALPHA PINCH_ON + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _ColorRampTex: + m_Texture: {fileID: 2800000, guid: 279657edc397ece4b8029c727adf6ddc, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ColorRampTexGradient: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ColorSwapTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DistortTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _FadeBurnTex: + m_Texture: {fileID: 2800000, guid: 32e8df0008bebe746b1681a71c61f31c, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _FadeTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _GlowTex: + 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} + - _OutlineDistortTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OutlineTex: + m_Texture: {fileID: 2800000, guid: 74087f6d03f233e4a8a142fa01f9e5cf, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OverlayTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ShineMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - _Alpha: 1 + - _AlphaCutoffValue: 0.25 + - _AlphaOutlineBlend: 1 + - _AlphaOutlineGlow: 5 + - _AlphaOutlineMinAlpha: 0 + - _AlphaOutlinePower: 1 + - _AlphaRoundThreshold: 0.5 + - _BillboardY: 0 + - _BlurHD: 0 + - _BlurIntensity: 10 + - _Brightness: 0 + - _ChromAberrAlpha: 0.4 + - _ChromAberrAmount: 1 + - _ClipUvDown: 1 + - _ClipUvLeft: 1 + - _ClipUvRight: 1 + - _ClipUvUp: 1 + - _ColorChangeLuminosity: 0 + - _ColorChangeTolerance: 0.25 + - _ColorChangeTolerance2: 0.25 + - _ColorChangeTolerance3: 0.25 + - _ColorRampBlend: 1 + - _ColorRampLuminosity: 0 + - _ColorRampOutline: 0 + - _ColorSwapBlend: 1 + - _ColorSwapBlueLuminosity: 0.5 + - _ColorSwapGreenLuminosity: 0.5 + - _ColorSwapRedLuminosity: 0.5 + - _Contrast: 1 + - _CullingOption: 0 + - _DistortAmount: 0.5 + - _DistortTexXSpeed: 5 + - _DistortTexYSpeed: 5 + - _EditorDrawers: 6 + - _FadeAmount: -0.1 + - _FadeBurnGlow: 2 + - _FadeBurnTransition: 0.075 + - _FadeBurnWidth: 0.025 + - _FishEyeUvAmount: 0.35 + - _FlickerAlpha: 0 + - _FlickerFreq: 0.2 + - _FlickerPercent: 0.05 + - _GhostBlend: 1 + - _GhostColorBoost: 1 + - _GhostTransparency: 0 + - _GlitchAmount: 3 + - _GlitchSize: 1 + - _Glow: 10 + - _GlowGlobal: 1 + - _GlowTexUsed: 0 + - _GradBlend: 1 + - _GradBoostX: 1.2 + - _GradBoostY: 1.2 + - _GradIsRadial: 0 + - _GrassManualAnim: 1 + - _GrassManualToggle: 0 + - _GrassRadialBend: 0.25 + - _GrassSpeed: 2 + - _GrassWind: 20 + - _GreyscaleBlend: 1 + - _GreyscaleLuminosity: 0.097 + - _GreyscaleOutline: 0 + - _HandDrawnAmount: 10 + - _HandDrawnSpeed: 5 + - _HitEffectBlend: 1 + - _HitEffectGlow: 5 + - _HologramBlend: 1 + - _HologramFlickerAlpha: 0 + - _HologramFlickerFreq: 0.2 + - _HologramFlickerPercent: 0.05 + - _HologramMaxAlpha: 1 + - _HologramMinAlpha: 0 + - _HologramStripesAlpha: 0.4 + - _HologramStripesAmount: 50 + - _HologramStripesFill: 0.4 + - _HologramStripesLuminosity: 1 + - _HologramStripesSpeed: 5 + - _HologramUnmodAmount: 0.4 + - _HsvBright: 1 + - _HsvSaturation: 1 + - _HsvShift: 180 + - _InnerOutlineAlpha: 1 + - _InnerOutlineGlow: 1 + - _InnerOutlineThickness: 1 + - _MaxXUV: 1 + - _MaxYUV: 1 + - _MinXUV: 0 + - _MinYUV: 0 + - _MotionBlurAngle: 0.1 + - _MotionBlurDist: 1.25 + - _MyDstMode: 10 + - _MySrcMode: 5 + - _NegativeAmount: 1 + - _OffsetUvX: 0 + - _OffsetUvY: 0 + - _OnlyInnerOutline: 0 + - _OnlyOutline: 0 + - _Outline8Directions: 0 + - _OutlineAlpha: 1 + - _OutlineDistortAmount: 0.5 + - _OutlineDistortTexXSpeed: 5 + - _OutlineDistortTexYSpeed: 5 + - _OutlineDistortToggle: 0 + - _OutlineGlow: 1.5 + - _OutlineIsPixel: 0 + - _OutlinePixelWidth: 1 + - _OutlineTexGrey: 0 + - _OutlineTexToggle: 0 + - _OutlineTexXSpeed: 10 + - _OutlineTexYSpeed: 0 + - _OutlineWidth: 0.004 + - _OverlayBlend: 1 + - _OverlayGlow: 1 + - _OverlayTextureScrollXSpeed: 0.25 + - _OverlayTextureScrollYSpeed: 0.25 + - _PinchUvAmount: 0.1 + - _PixelateSize: 32 + - _PosterizeGamma: 0.75 + - _PosterizeNumColors: 8 + - _PosterizeOutline: 0 + - _RadialClipAngle: 90 + - _RadialClipArc1: 45 + - _RadialClipArc2: 0 + - _RandomSeed: 0 + - _RectSize: 1 + - _RotateUvAmount: 0 + - _RoundWaveSpeed: 2 + - _RoundWaveStrength: 0.7 + - _ShadowAlpha: 0.5 + - _ShadowX: 0.1 + - _ShadowY: -0.05 + - _ShakeUvSpeed: 2.5 + - _ShakeUvX: 1.5 + - _ShakeUvY: 1 + - _ShineGlow: 1 + - _ShineLocation: 0.5 + - _ShineRotate: 0 + - _ShineWidth: 0.1 + - _TextureScrollXSpeed: 1 + - _TextureScrollYSpeed: 0 + - _TwistUvAmount: 1 + - _TwistUvPosX: 0.5 + - _TwistUvPosY: 0.5 + - _TwistUvRadius: 0.75 + - _WarpScale: 0.5 + - _WarpSpeed: 8 + - _WarpStrength: 0.025 + - _WaveAmount: 7 + - _WaveSpeed: 10 + - _WaveStrength: 7.5 + - _WaveX: 0 + - _WaveY: 0.5 + - _ZTestMode: 4 + - _ZWrite: 0 + - _ZoomUvAmount: 0.5 + m_Colors: + - ColorSwapRed: {r: 1, g: 1, b: 1, a: 1} + - _AlphaOutlineColor: {r: 1, g: 1, b: 1, a: 1} + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _ColorChangeNewCol: {r: 1, g: 1, b: 0, a: 1} + - _ColorChangeNewCol2: {r: 1, g: 1, b: 0, a: 1} + - _ColorChangeNewCol3: {r: 1, g: 1, b: 0, a: 1} + - _ColorChangeTarget: {r: 1, g: 0, b: 0, a: 1} + - _ColorChangeTarget2: {r: 1, g: 0, b: 0, a: 1} + - _ColorChangeTarget3: {r: 1, g: 0, b: 0, a: 1} + - _ColorSwapBlue: {r: 1, g: 1, b: 1, a: 1} + - _ColorSwapGreen: {r: 1, g: 1, b: 1, a: 1} + - _ColorSwapRed: {r: 1, g: 1, b: 1, a: 1} + - _FadeBurnColor: {r: 1, g: 1, b: 0, a: 1} + - _GlowColor: {r: 1, g: 1, b: 1, a: 1} + - _GradBotLeftCol: {r: 0, g: 0, b: 1, a: 1} + - _GradBotRightCol: {r: 0, g: 0, b: 1, a: 1} + - _GradTopLeftCol: {r: 1, g: 0, b: 0, a: 1} + - _GradTopRightCol: {r: 1, g: 0, b: 0, a: 1} + - _GreyscaleTintColor: {r: 1, g: 1, b: 1, a: 1} + - _HitEffectColor: {r: 1, g: 1, b: 1, a: 1} + - _HologramStripeColor: {r: 1, g: 1, b: 1, a: 1} + - _InnerOutlineColor: {r: 1, g: 0, b: 0, a: 1} + - _OutlineColor: {r: 1, g: 1, b: 1, a: 1} + - _OverlayColor: {r: 1, g: 1, b: 1, a: 1} + - _ShadowColor: {r: 0, g: 0, b: 0, a: 1} + - _ShineColor: {r: 1, g: 1, b: 1, a: 1} +--- !u!1 &1868383713 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1868383714} + - component: {fileID: 1868383716} + - component: {fileID: 1868383715} + m_Layer: 0 + m_Name: Title + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1868383714 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1868383713} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: -2.51, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 1988936578} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!102 &1868383715 +TextMesh: + serializedVersion: 3 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1868383713} + m_Text: Color Ramp + m_OffsetZ: -1.5 + m_CharacterSize: 0.075 + m_LineSpacing: 1 + m_Anchor: 4 + m_Alignment: 0 + m_TabSize: 4 + m_FontSize: 100 + m_FontStyle: 0 + m_RichText: 1 + m_Font: {fileID: 12800000, guid: a4e6a5491519adb45919dc87eff28e55, type: 3} + m_Color: + serializedVersion: 2 + rgba: 4294967295 +--- !u!23 &1868383716 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1868383713} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 10100, guid: 0000000000000000e000000000000000, type: 0} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!1 &1869989729 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1869989730} + - component: {fileID: 1869989732} + - component: {fileID: 1869989731} + m_Layer: 0 + m_Name: Animated + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 0 +--- !u!4 &1869989730 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1869989729} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: -4.447157, z: 0} + m_LocalScale: {x: 1.2457023, y: 1.2457023, z: 1.2457023} + m_Children: [] + m_Father: {fileID: 357954209} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!102 &1869989731 +TextMesh: + serializedVersion: 3 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1869989729} + m_Text: (Has Animation) + m_OffsetZ: -1.5 + m_CharacterSize: 0.075 + m_LineSpacing: 1 + m_Anchor: 4 + m_Alignment: 0 + m_TabSize: 4 + m_FontSize: 100 + m_FontStyle: 0 + m_RichText: 1 + m_Font: {fileID: 12800000, guid: a4e6a5491519adb45919dc87eff28e55, type: 3} + m_Color: + serializedVersion: 2 + rgba: 4294967295 +--- !u!23 &1869989732 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1869989729} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: a4e6a5491519adb45919dc87eff28e55, type: 3} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!1 &1875180450 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1875180451} + - component: {fileID: 1875180455} + - component: {fileID: 1875180454} + - component: {fileID: 1875180452} + m_Layer: 0 + m_Name: Teleport + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1875180451 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1875180450} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 40, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 520963778} + - {fileID: 152938704} + m_Father: {fileID: 1563905016} + m_RootOrder: 4 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!95 &1875180452 +Animator: + serializedVersion: 3 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1875180450} + m_Enabled: 1 + m_Avatar: {fileID: 0} + m_Controller: {fileID: 9100000, guid: 2cd3280111dab4e41ba2dd630db17ca4, type: 2} + m_CullingMode: 0 + m_UpdateMode: 0 + m_ApplyRootMotion: 0 + m_LinearVelocityBlending: 0 + m_WarningMessage: + m_HasTransformHierarchy: 1 + m_AllowConstantClipSamplingOptimization: 1 + m_KeepAnimatorControllerStateOnDisable: 0 +--- !u!114 &1875180454 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1875180450} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 98b644315d7a92842b89e04f55c48e02, type: 3} + m_Name: + m_EditorClassIdentifier: +--- !u!212 &1875180455 +SpriteRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1875180450} + m_Enabled: 1 + m_CastShadows: 0 + m_ReceiveShadows: 0 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 195375977} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 0 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_Sprite: {fileID: 21300000, guid: 519dafacd208bb64c83d5124be03b09d, type: 3} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_FlipX: 0 + m_FlipY: 0 + m_DrawMode: 0 + m_Size: {x: 5.12, y: 5.12} + m_AdaptiveModeThreshold: 0.5 + m_SpriteTileMode: 0 + m_WasSpriteAssigned: 1 + m_MaskInteraction: 0 + m_SpriteSortPoint: 0 +--- !u!1 &1880243539 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1880243540} + - component: {fileID: 1880243542} + - component: {fileID: 1880243541} + m_Layer: 0 + m_Name: Title + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1880243540 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1880243539} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: -2.51, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 586081879} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!102 &1880243541 +TextMesh: + serializedVersion: 3 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1880243539} + m_Text: Greyscale + m_OffsetZ: -1.5 + m_CharacterSize: 0.075 + m_LineSpacing: 1 + m_Anchor: 4 + m_Alignment: 0 + m_TabSize: 4 + m_FontSize: 100 + m_FontStyle: 0 + m_RichText: 1 + m_Font: {fileID: 12800000, guid: a4e6a5491519adb45919dc87eff28e55, type: 3} + m_Color: + serializedVersion: 2 + rgba: 4294967295 +--- !u!23 &1880243542 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1880243539} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 10100, guid: 0000000000000000e000000000000000, type: 0} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!1 &1881847163 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1881847164} + - component: {fileID: 1881847166} + - component: {fileID: 1881847165} + m_Layer: 0 + m_Name: Animated + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 0 +--- !u!4 &1881847164 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1881847163} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: -4.447157, z: 0} + m_LocalScale: {x: 1.2457023, y: 1.2457023, z: 1.2457023} + m_Children: [] + m_Father: {fileID: 1528149039} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!102 &1881847165 +TextMesh: + serializedVersion: 3 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1881847163} + m_Text: (Has Animation) + m_OffsetZ: -1.5 + m_CharacterSize: 0.075 + m_LineSpacing: 1 + m_Anchor: 4 + m_Alignment: 0 + m_TabSize: 4 + m_FontSize: 100 + m_FontStyle: 0 + m_RichText: 1 + m_Font: {fileID: 12800000, guid: a4e6a5491519adb45919dc87eff28e55, type: 3} + m_Color: + serializedVersion: 2 + rgba: 4294967295 +--- !u!23 &1881847166 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1881847163} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: a4e6a5491519adb45919dc87eff28e55, type: 3} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!1 &1883979699 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1883979700} + - component: {fileID: 1883979702} + m_Layer: 0 + m_Name: Flag + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1883979700 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1883979699} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 190, y: 0, z: 0} + m_LocalScale: {x: 0.80276, y: 0.80276, z: 0.80276} + m_Children: + - {fileID: 1097188550} + - {fileID: 1755864202} + - {fileID: 935289136} + m_Father: {fileID: 1563905016} + m_RootOrder: 19 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &1883979702 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1883979699} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 98b644315d7a92842b89e04f55c48e02, type: 3} + m_Name: + m_EditorClassIdentifier: +--- !u!1 &1884970176 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1884970177} + - component: {fileID: 1884970179} + - component: {fileID: 1884970178} + m_Layer: 0 + m_Name: SnowFlakesPS + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 0 +--- !u!4 &1884970177 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1884970176} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: -0.02, z: -0.2} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 511167261} + m_RootOrder: 3 + m_LocalEulerAnglesHint: {x: -90, y: 0, z: 0} +--- !u!199 &1884970178 +ParticleSystemRenderer: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1884970176} + m_Enabled: 1 + m_CastShadows: 0 + m_ReceiveShadows: 0 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 0 + m_ReflectionProbeUsage: 0 + m_RayTracingMode: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: aae53a69b285d6f4aad0e6953245bc7d, type: 2} + - {fileID: 0} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_RenderMode: 0 + m_SortMode: 0 + m_MinParticleSize: 0 + m_MaxParticleSize: 0.5 + m_CameraVelocityScale: 0 + m_VelocityScale: 0 + m_LengthScale: 2 + m_SortingFudge: 0 + m_NormalDirection: 1 + m_ShadowBias: 0 + m_RenderAlignment: 0 + m_Pivot: {x: 0, y: 0, z: 0} + m_Flip: {x: 0, y: 0, z: 0} + m_UseCustomVertexStreams: 0 + m_EnableGPUInstancing: 1 + m_ApplyActiveColorSpace: 1 + m_AllowRoll: 1 + m_VertexStreams: 00010304 + m_Mesh: {fileID: 0} + m_Mesh1: {fileID: 0} + m_Mesh2: {fileID: 0} + m_Mesh3: {fileID: 0} + m_MaskInteraction: 0 +--- !u!198 &1884970179 +ParticleSystem: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1884970176} + serializedVersion: 6 + lengthInSec: 1 + simulationSpeed: 1 + stopAction: 0 + cullingMode: 0 + ringBufferMode: 0 + ringBufferLoopRange: {x: 0, y: 1} + looping: 1 + prewarm: 0 + playOnAwake: 1 + useUnscaledTime: 0 + autoRandomSeed: 1 + useRigidbodyForVelocity: 1 + startDelay: + serializedVersion: 2 + minMaxState: 0 + scalar: 0.05 + minScalar: 0 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + moveWithTransform: 0 + moveWithCustomTransform: {fileID: 0} + scalingMode: 1 + randomSeed: 0 + InitialModule: + serializedVersion: 3 + enabled: 1 + startLifetime: + serializedVersion: 2 + minMaxState: 0 + scalar: 1 + minScalar: 5 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + startSpeed: + serializedVersion: 2 + minMaxState: 3 + scalar: 1 + minScalar: 0 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + startColor: + serializedVersion: 2 + minMaxState: 0 + minColor: {r: 1, g: 1, b: 1, a: 1} + maxColor: {r: 1, g: 1, b: 1, a: 1} + maxGradient: + serializedVersion: 2 + key0: {r: 1, g: 1, b: 1, a: 1} + key1: {r: 1, g: 1, b: 1, a: 1} + key2: {r: 0, g: 0, b: 0, a: 0} + key3: {r: 0, g: 0, b: 0, a: 0} + key4: {r: 0, g: 0, b: 0, a: 0} + key5: {r: 0, g: 0, b: 0, a: 0} + key6: {r: 0, g: 0, b: 0, a: 0} + key7: {r: 0, g: 0, b: 0, a: 0} + ctime0: 0 + ctime1: 65535 + ctime2: 0 + ctime3: 0 + ctime4: 0 + ctime5: 0 + ctime6: 0 + ctime7: 0 + atime0: 0 + atime1: 65535 + atime2: 0 + atime3: 0 + atime4: 0 + atime5: 0 + atime6: 0 + atime7: 0 + m_Mode: 0 + m_NumColorKeys: 2 + m_NumAlphaKeys: 2 + minGradient: + serializedVersion: 2 + key0: {r: 1, g: 1, b: 1, a: 1} + key1: {r: 1, g: 1, b: 1, a: 1} + key2: {r: 0, g: 0, b: 0, a: 0} + key3: {r: 0, g: 0, b: 0, a: 0} + key4: {r: 0, g: 0, b: 0, a: 0} + key5: {r: 0, g: 0, b: 0, a: 0} + key6: {r: 0, g: 0, b: 0, a: 0} + key7: {r: 0, g: 0, b: 0, a: 0} + ctime0: 0 + ctime1: 65535 + ctime2: 0 + ctime3: 0 + ctime4: 0 + ctime5: 0 + ctime6: 0 + ctime7: 0 + atime0: 0 + atime1: 65535 + atime2: 0 + atime3: 0 + atime4: 0 + atime5: 0 + atime6: 0 + atime7: 0 + m_Mode: 0 + m_NumColorKeys: 2 + m_NumAlphaKeys: 2 + startSize: + serializedVersion: 2 + minMaxState: 3 + scalar: 0.75 + minScalar: 0.2 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + startSizeY: + serializedVersion: 2 + minMaxState: 3 + scalar: 1 + minScalar: 1 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + startSizeZ: + serializedVersion: 2 + minMaxState: 3 + scalar: 1 + minScalar: 1 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + startRotationX: + serializedVersion: 2 + minMaxState: 3 + scalar: 0 + minScalar: 0 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + startRotationY: + serializedVersion: 2 + minMaxState: 3 + scalar: 0 + minScalar: 0 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + startRotation: + serializedVersion: 2 + minMaxState: 3 + scalar: 6.283185 + minScalar: 0 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + randomizeRotationDirection: 0 + maxNumParticles: 1000 + size3D: 0 + rotation3D: 0 + gravityModifier: + serializedVersion: 2 + minMaxState: 0 + scalar: 0 + minScalar: 0 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + ShapeModule: + serializedVersion: 6 + enabled: 1 + type: 10 + angle: 25 + length: 5 + boxThickness: {x: 0, y: 0, z: 0} + radiusThickness: 1 + donutRadius: 0.2 + m_Position: {x: 0, y: 0, z: 0} + m_Rotation: {x: 0, y: 0, z: 0} + m_Scale: {x: 1, y: 1, z: 1} + placementMode: 0 + m_MeshMaterialIndex: 0 + m_MeshNormalOffset: 0 + m_MeshSpawn: + mode: 0 + spread: 0 + speed: + serializedVersion: 2 + minMaxState: 0 + scalar: 1 + minScalar: 1 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + m_Mesh: {fileID: 0} + m_MeshRenderer: {fileID: 0} + m_SkinnedMeshRenderer: {fileID: 0} + m_Sprite: {fileID: 0} + m_SpriteRenderer: {fileID: 0} + m_UseMeshMaterialIndex: 0 + m_UseMeshColors: 1 + alignToDirection: 0 + m_Texture: {fileID: 0} + m_TextureClipChannel: 3 + m_TextureClipThreshold: 0 + m_TextureUVChannel: 0 + m_TextureColorAffectsParticles: 1 + m_TextureAlphaAffectsParticles: 1 + m_TextureBilinearFiltering: 0 + randomDirectionAmount: 0 + sphericalDirectionAmount: 0 + randomPositionAmount: 0 + radius: + value: 1.5 + mode: 0 + spread: 0 + speed: + serializedVersion: 2 + minMaxState: 0 + scalar: 1 + minScalar: 1 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + arc: + value: 360 + mode: 0 + spread: 0 + speed: + serializedVersion: 2 + minMaxState: 0 + scalar: 1 + minScalar: 1 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + EmissionModule: + enabled: 1 + serializedVersion: 4 + rateOverTime: + serializedVersion: 2 + minMaxState: 0 + scalar: 0 + minScalar: 10 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + rateOverDistance: + serializedVersion: 2 + minMaxState: 0 + scalar: 0 + minScalar: 0 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + m_BurstCount: 1 + m_Bursts: + - serializedVersion: 2 + time: 0 + countCurve: + serializedVersion: 2 + minMaxState: 0 + scalar: 15 + minScalar: 30 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + cycleCount: 1 + repeatInterval: 0.01 + probability: 1 + SizeModule: + enabled: 1 + curve: + serializedVersion: 2 + minMaxState: 1 + scalar: 1 + minScalar: 1 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 15.478566 + outSlope: 15.478566 + tangentMode: 34 + weightedMode: 0 + inWeight: 0 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 0.061415076 + value: 0.9506173 + inSlope: 0.28985757 + outSlope: 0.28985757 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.24300326 + - serializedVersion: 3 + time: 0.6683 + value: 0.8456783 + inSlope: -1.3612208 + outSlope: -1.3612208 + tangentMode: 34 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: -2.5495274 + outSlope: -2.5495274 + tangentMode: 34 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + y: + serializedVersion: 2 + minMaxState: 1 + scalar: 1 + minScalar: 1 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 1 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 1 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + z: + serializedVersion: 2 + minMaxState: 1 + scalar: 1 + minScalar: 1 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 1 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 1 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + separateAxes: 0 + RotationModule: + enabled: 0 + x: + serializedVersion: 2 + minMaxState: 0 + scalar: 0 + minScalar: 0 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + y: + serializedVersion: 2 + minMaxState: 0 + scalar: 0 + minScalar: 0 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + curve: + serializedVersion: 2 + minMaxState: 0 + scalar: 0.7853982 + minScalar: 0.7853982 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + separateAxes: 0 + ColorModule: + enabled: 1 + gradient: + serializedVersion: 2 + minMaxState: 1 + minColor: {r: 1, g: 1, b: 1, a: 1} + maxColor: {r: 1, g: 1, b: 1, a: 1} + maxGradient: + serializedVersion: 2 + key0: {r: 1, g: 1, b: 1, a: 1} + key1: {r: 1, g: 1, b: 1, a: 1} + key2: {r: 0, g: 0, b: 0, a: 0} + key3: {r: 0, g: 0, b: 0, a: 0} + key4: {r: 0, g: 0, b: 0, a: 0} + key5: {r: 0, g: 0, b: 0, a: 0} + key6: {r: 0, g: 0, b: 0, a: 0} + key7: {r: 0, g: 0, b: 0, a: 0} + ctime0: 0 + ctime1: 65535 + ctime2: 0 + ctime3: 0 + ctime4: 0 + ctime5: 0 + ctime6: 0 + ctime7: 0 + atime0: 0 + atime1: 23708 + atime2: 65535 + atime3: 0 + atime4: 0 + atime5: 0 + atime6: 0 + atime7: 0 + m_Mode: 0 + m_NumColorKeys: 2 + m_NumAlphaKeys: 3 + minGradient: + serializedVersion: 2 + key0: {r: 1, g: 1, b: 1, a: 1} + key1: {r: 1, g: 1, b: 1, a: 1} + key2: {r: 0, g: 0, b: 0, a: 0} + key3: {r: 0, g: 0, b: 0, a: 0} + key4: {r: 0, g: 0, b: 0, a: 0} + key5: {r: 0, g: 0, b: 0, a: 0} + key6: {r: 0, g: 0, b: 0, a: 0} + key7: {r: 0, g: 0, b: 0, a: 0} + ctime0: 0 + ctime1: 65535 + ctime2: 0 + ctime3: 0 + ctime4: 0 + ctime5: 0 + ctime6: 0 + ctime7: 0 + atime0: 0 + atime1: 65535 + atime2: 0 + atime3: 0 + atime4: 0 + atime5: 0 + atime6: 0 + atime7: 0 + m_Mode: 0 + m_NumColorKeys: 2 + m_NumAlphaKeys: 2 + UVModule: + serializedVersion: 2 + enabled: 0 + mode: 0 + timeMode: 0 + fps: 30 + frameOverTime: + serializedVersion: 2 + minMaxState: 1 + scalar: 0.9999 + minScalar: 0.9999 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 1 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 1 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + startFrame: + serializedVersion: 2 + minMaxState: 0 + scalar: 0 + minScalar: 0 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + speedRange: {x: 0, y: 1} + tilesX: 1 + tilesY: 1 + animationType: 0 + rowIndex: 0 + cycles: 1 + uvChannelMask: -1 + rowMode: 1 + sprites: + - sprite: {fileID: 0} + flipU: 0 + flipV: 0 + VelocityModule: + enabled: 0 + x: + serializedVersion: 2 + minMaxState: 0 + scalar: 0 + minScalar: 0 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + y: + serializedVersion: 2 + minMaxState: 0 + scalar: 0 + minScalar: 0 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + z: + serializedVersion: 2 + minMaxState: 0 + scalar: 0 + minScalar: 0 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + orbitalX: + serializedVersion: 2 + minMaxState: 0 + scalar: 0 + minScalar: 0 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + orbitalY: + serializedVersion: 2 + minMaxState: 0 + scalar: 0 + minScalar: 0 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + orbitalZ: + serializedVersion: 2 + minMaxState: 0 + scalar: 0 + minScalar: 0 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + orbitalOffsetX: + serializedVersion: 2 + minMaxState: 0 + scalar: 0 + minScalar: 0 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + orbitalOffsetY: + serializedVersion: 2 + minMaxState: 0 + scalar: 0 + minScalar: 0 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + orbitalOffsetZ: + serializedVersion: 2 + minMaxState: 0 + scalar: 0 + minScalar: 0 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + radial: + serializedVersion: 2 + minMaxState: 0 + scalar: 0 + minScalar: 0 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + speedModifier: + serializedVersion: 2 + minMaxState: 0 + scalar: 1 + minScalar: 1 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + inWorldSpace: 0 + InheritVelocityModule: + enabled: 0 + m_Mode: 0 + m_Curve: + serializedVersion: 2 + minMaxState: 0 + scalar: 0 + minScalar: 0 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + ForceModule: + enabled: 0 + x: + serializedVersion: 2 + minMaxState: 0 + scalar: 0 + minScalar: 0 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + y: + serializedVersion: 2 + minMaxState: 0 + scalar: 0 + minScalar: 0 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + z: + serializedVersion: 2 + minMaxState: 0 + scalar: 0 + minScalar: 0 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + inWorldSpace: 0 + randomizePerFrame: 0 + ExternalForcesModule: + serializedVersion: 2 + enabled: 0 + multiplierCurve: + serializedVersion: 2 + minMaxState: 0 + scalar: 1 + minScalar: 1 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + influenceFilter: 0 + influenceMask: + serializedVersion: 2 + m_Bits: 4294967295 + influenceList: [] + ClampVelocityModule: + enabled: 0 + x: + serializedVersion: 2 + minMaxState: 0 + scalar: 1 + minScalar: 1 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + y: + serializedVersion: 2 + minMaxState: 0 + scalar: 1 + minScalar: 1 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + z: + serializedVersion: 2 + minMaxState: 0 + scalar: 1 + minScalar: 1 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + magnitude: + serializedVersion: 2 + minMaxState: 0 + scalar: 1 + minScalar: 1 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + separateAxis: 0 + inWorldSpace: 0 + multiplyDragByParticleSize: 1 + multiplyDragByParticleVelocity: 1 + dampen: 0 + drag: + serializedVersion: 2 + minMaxState: 0 + scalar: 0 + minScalar: 0 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + NoiseModule: + enabled: 0 + strength: + serializedVersion: 2 + minMaxState: 0 + scalar: 1 + minScalar: 1 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + strengthY: + serializedVersion: 2 + minMaxState: 0 + scalar: 1 + minScalar: 1 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + strengthZ: + serializedVersion: 2 + minMaxState: 0 + scalar: 1 + minScalar: 1 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + separateAxes: 0 + frequency: 0.5 + damping: 1 + octaves: 1 + octaveMultiplier: 0.5 + octaveScale: 2 + quality: 2 + scrollSpeed: + serializedVersion: 2 + minMaxState: 0 + scalar: 0 + minScalar: 0 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + remap: + serializedVersion: 2 + minMaxState: 1 + scalar: 1 + minScalar: 1 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 1 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 1 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + remapY: + serializedVersion: 2 + minMaxState: 1 + scalar: 1 + minScalar: 1 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 1 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 1 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + remapZ: + serializedVersion: 2 + minMaxState: 1 + scalar: 1 + minScalar: 1 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 1 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 1 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + remapEnabled: 0 + positionAmount: + serializedVersion: 2 + minMaxState: 0 + scalar: 1 + minScalar: 1 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + rotationAmount: + serializedVersion: 2 + minMaxState: 0 + scalar: 0 + minScalar: 0 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + sizeAmount: + serializedVersion: 2 + minMaxState: 0 + scalar: 0 + minScalar: 0 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + SizeBySpeedModule: + enabled: 0 + curve: + serializedVersion: 2 + minMaxState: 1 + scalar: 1 + minScalar: 1 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 1 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 1 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + y: + serializedVersion: 2 + minMaxState: 1 + scalar: 1 + minScalar: 1 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 1 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 1 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + z: + serializedVersion: 2 + minMaxState: 1 + scalar: 1 + minScalar: 1 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 1 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 1 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + range: {x: 0, y: 1} + separateAxes: 0 + RotationBySpeedModule: + enabled: 0 + x: + serializedVersion: 2 + minMaxState: 0 + scalar: 0 + minScalar: 0 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + y: + serializedVersion: 2 + minMaxState: 0 + scalar: 0 + minScalar: 0 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + curve: + serializedVersion: 2 + minMaxState: 0 + scalar: 0.7853982 + minScalar: 0.7853982 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + separateAxes: 0 + range: {x: 0, y: 1} + ColorBySpeedModule: + enabled: 0 + gradient: + serializedVersion: 2 + minMaxState: 1 + minColor: {r: 1, g: 1, b: 1, a: 1} + maxColor: {r: 1, g: 1, b: 1, a: 1} + maxGradient: + serializedVersion: 2 + key0: {r: 1, g: 1, b: 1, a: 1} + key1: {r: 1, g: 1, b: 1, a: 1} + key2: {r: 0, g: 0, b: 0, a: 0} + key3: {r: 0, g: 0, b: 0, a: 0} + key4: {r: 0, g: 0, b: 0, a: 0} + key5: {r: 0, g: 0, b: 0, a: 0} + key6: {r: 0, g: 0, b: 0, a: 0} + key7: {r: 0, g: 0, b: 0, a: 0} + ctime0: 0 + ctime1: 65535 + ctime2: 0 + ctime3: 0 + ctime4: 0 + ctime5: 0 + ctime6: 0 + ctime7: 0 + atime0: 0 + atime1: 65535 + atime2: 0 + atime3: 0 + atime4: 0 + atime5: 0 + atime6: 0 + atime7: 0 + m_Mode: 0 + m_NumColorKeys: 2 + m_NumAlphaKeys: 2 + minGradient: + serializedVersion: 2 + key0: {r: 1, g: 1, b: 1, a: 1} + key1: {r: 1, g: 1, b: 1, a: 1} + key2: {r: 0, g: 0, b: 0, a: 0} + key3: {r: 0, g: 0, b: 0, a: 0} + key4: {r: 0, g: 0, b: 0, a: 0} + key5: {r: 0, g: 0, b: 0, a: 0} + key6: {r: 0, g: 0, b: 0, a: 0} + key7: {r: 0, g: 0, b: 0, a: 0} + ctime0: 0 + ctime1: 65535 + ctime2: 0 + ctime3: 0 + ctime4: 0 + ctime5: 0 + ctime6: 0 + ctime7: 0 + atime0: 0 + atime1: 65535 + atime2: 0 + atime3: 0 + atime4: 0 + atime5: 0 + atime6: 0 + atime7: 0 + m_Mode: 0 + m_NumColorKeys: 2 + m_NumAlphaKeys: 2 + range: {x: 0, y: 1} + CollisionModule: + enabled: 0 + serializedVersion: 3 + type: 0 + collisionMode: 0 + colliderForce: 0 + multiplyColliderForceByParticleSize: 0 + multiplyColliderForceByParticleSpeed: 0 + multiplyColliderForceByCollisionAngle: 1 + plane0: {fileID: 0} + plane1: {fileID: 0} + plane2: {fileID: 0} + plane3: {fileID: 0} + plane4: {fileID: 0} + plane5: {fileID: 0} + m_Dampen: + serializedVersion: 2 + minMaxState: 0 + scalar: 0 + minScalar: 0 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + m_Bounce: + serializedVersion: 2 + minMaxState: 0 + scalar: 1 + minScalar: 1 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + m_EnergyLossOnCollision: + serializedVersion: 2 + minMaxState: 0 + scalar: 0 + minScalar: 0 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minKillSpeed: 0 + maxKillSpeed: 10000 + radiusScale: 1 + collidesWith: + serializedVersion: 2 + m_Bits: 4294967295 + maxCollisionShapes: 256 + quality: 0 + voxelSize: 0.5 + collisionMessages: 0 + collidesWithDynamic: 1 + interiorCollisions: 0 + TriggerModule: + enabled: 0 + collisionShape0: {fileID: 0} + collisionShape1: {fileID: 0} + collisionShape2: {fileID: 0} + collisionShape3: {fileID: 0} + collisionShape4: {fileID: 0} + collisionShape5: {fileID: 0} + inside: 1 + outside: 0 + enter: 0 + exit: 0 + radiusScale: 1 + SubModule: + serializedVersion: 2 + enabled: 0 + subEmitters: + - serializedVersion: 3 + emitter: {fileID: 0} + type: 0 + properties: 0 + emitProbability: 1 + LightsModule: + enabled: 0 + ratio: 0 + light: {fileID: 0} + randomDistribution: 1 + color: 1 + range: 1 + intensity: 1 + rangeCurve: + serializedVersion: 2 + minMaxState: 0 + scalar: 1 + minScalar: 1 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + intensityCurve: + serializedVersion: 2 + minMaxState: 0 + scalar: 1 + minScalar: 1 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + maxLights: 20 + TrailModule: + enabled: 0 + mode: 0 + ratio: 1 + lifetime: + serializedVersion: 2 + minMaxState: 0 + scalar: 1 + minScalar: 1 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minVertexDistance: 0.2 + textureMode: 0 + ribbonCount: 1 + shadowBias: 0.5 + worldSpace: 0 + dieWithParticles: 1 + sizeAffectsWidth: 1 + sizeAffectsLifetime: 0 + inheritParticleColor: 1 + generateLightingData: 0 + splitSubEmitterRibbons: 0 + attachRibbonsToTransform: 0 + colorOverLifetime: + serializedVersion: 2 + minMaxState: 0 + minColor: {r: 1, g: 1, b: 1, a: 1} + maxColor: {r: 1, g: 1, b: 1, a: 1} + maxGradient: + serializedVersion: 2 + key0: {r: 1, g: 1, b: 1, a: 1} + key1: {r: 1, g: 1, b: 1, a: 1} + key2: {r: 0, g: 0, b: 0, a: 0} + key3: {r: 0, g: 0, b: 0, a: 0} + key4: {r: 0, g: 0, b: 0, a: 0} + key5: {r: 0, g: 0, b: 0, a: 0} + key6: {r: 0, g: 0, b: 0, a: 0} + key7: {r: 0, g: 0, b: 0, a: 0} + ctime0: 0 + ctime1: 65535 + ctime2: 0 + ctime3: 0 + ctime4: 0 + ctime5: 0 + ctime6: 0 + ctime7: 0 + atime0: 0 + atime1: 65535 + atime2: 0 + atime3: 0 + atime4: 0 + atime5: 0 + atime6: 0 + atime7: 0 + m_Mode: 0 + m_NumColorKeys: 2 + m_NumAlphaKeys: 2 + minGradient: + serializedVersion: 2 + key0: {r: 1, g: 1, b: 1, a: 1} + key1: {r: 1, g: 1, b: 1, a: 1} + key2: {r: 0, g: 0, b: 0, a: 0} + key3: {r: 0, g: 0, b: 0, a: 0} + key4: {r: 0, g: 0, b: 0, a: 0} + key5: {r: 0, g: 0, b: 0, a: 0} + key6: {r: 0, g: 0, b: 0, a: 0} + key7: {r: 0, g: 0, b: 0, a: 0} + ctime0: 0 + ctime1: 65535 + ctime2: 0 + ctime3: 0 + ctime4: 0 + ctime5: 0 + ctime6: 0 + ctime7: 0 + atime0: 0 + atime1: 65535 + atime2: 0 + atime3: 0 + atime4: 0 + atime5: 0 + atime6: 0 + atime7: 0 + m_Mode: 0 + m_NumColorKeys: 2 + m_NumAlphaKeys: 2 + widthOverTrail: + serializedVersion: 2 + minMaxState: 0 + scalar: 1 + minScalar: 1 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + colorOverTrail: + serializedVersion: 2 + minMaxState: 0 + minColor: {r: 1, g: 1, b: 1, a: 1} + maxColor: {r: 1, g: 1, b: 1, a: 1} + maxGradient: + serializedVersion: 2 + key0: {r: 1, g: 1, b: 1, a: 1} + key1: {r: 1, g: 1, b: 1, a: 1} + key2: {r: 0, g: 0, b: 0, a: 0} + key3: {r: 0, g: 0, b: 0, a: 0} + key4: {r: 0, g: 0, b: 0, a: 0} + key5: {r: 0, g: 0, b: 0, a: 0} + key6: {r: 0, g: 0, b: 0, a: 0} + key7: {r: 0, g: 0, b: 0, a: 0} + ctime0: 0 + ctime1: 65535 + ctime2: 0 + ctime3: 0 + ctime4: 0 + ctime5: 0 + ctime6: 0 + ctime7: 0 + atime0: 0 + atime1: 65535 + atime2: 0 + atime3: 0 + atime4: 0 + atime5: 0 + atime6: 0 + atime7: 0 + m_Mode: 0 + m_NumColorKeys: 2 + m_NumAlphaKeys: 2 + minGradient: + serializedVersion: 2 + key0: {r: 1, g: 1, b: 1, a: 1} + key1: {r: 1, g: 1, b: 1, a: 1} + key2: {r: 0, g: 0, b: 0, a: 0} + key3: {r: 0, g: 0, b: 0, a: 0} + key4: {r: 0, g: 0, b: 0, a: 0} + key5: {r: 0, g: 0, b: 0, a: 0} + key6: {r: 0, g: 0, b: 0, a: 0} + key7: {r: 0, g: 0, b: 0, a: 0} + ctime0: 0 + ctime1: 65535 + ctime2: 0 + ctime3: 0 + ctime4: 0 + ctime5: 0 + ctime6: 0 + ctime7: 0 + atime0: 0 + atime1: 65535 + atime2: 0 + atime3: 0 + atime4: 0 + atime5: 0 + atime6: 0 + atime7: 0 + m_Mode: 0 + m_NumColorKeys: 2 + m_NumAlphaKeys: 2 + CustomDataModule: + enabled: 0 + mode0: 0 + vectorComponentCount0: 4 + color0: + serializedVersion: 2 + minMaxState: 0 + minColor: {r: 1, g: 1, b: 1, a: 1} + maxColor: {r: 1, g: 1, b: 1, a: 1} + maxGradient: + serializedVersion: 2 + key0: {r: 1, g: 1, b: 1, a: 1} + key1: {r: 1, g: 1, b: 1, a: 1} + key2: {r: 0, g: 0, b: 0, a: 0} + key3: {r: 0, g: 0, b: 0, a: 0} + key4: {r: 0, g: 0, b: 0, a: 0} + key5: {r: 0, g: 0, b: 0, a: 0} + key6: {r: 0, g: 0, b: 0, a: 0} + key7: {r: 0, g: 0, b: 0, a: 0} + ctime0: 0 + ctime1: 65535 + ctime2: 0 + ctime3: 0 + ctime4: 0 + ctime5: 0 + ctime6: 0 + ctime7: 0 + atime0: 0 + atime1: 65535 + atime2: 0 + atime3: 0 + atime4: 0 + atime5: 0 + atime6: 0 + atime7: 0 + m_Mode: 0 + m_NumColorKeys: 2 + m_NumAlphaKeys: 2 + minGradient: + serializedVersion: 2 + key0: {r: 1, g: 1, b: 1, a: 1} + key1: {r: 1, g: 1, b: 1, a: 1} + key2: {r: 0, g: 0, b: 0, a: 0} + key3: {r: 0, g: 0, b: 0, a: 0} + key4: {r: 0, g: 0, b: 0, a: 0} + key5: {r: 0, g: 0, b: 0, a: 0} + key6: {r: 0, g: 0, b: 0, a: 0} + key7: {r: 0, g: 0, b: 0, a: 0} + ctime0: 0 + ctime1: 65535 + ctime2: 0 + ctime3: 0 + ctime4: 0 + ctime5: 0 + ctime6: 0 + ctime7: 0 + atime0: 0 + atime1: 65535 + atime2: 0 + atime3: 0 + atime4: 0 + atime5: 0 + atime6: 0 + atime7: 0 + m_Mode: 0 + m_NumColorKeys: 2 + m_NumAlphaKeys: 2 + colorLabel0: Color + vector0_0: + serializedVersion: 2 + minMaxState: 0 + scalar: 0 + minScalar: 0 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + vectorLabel0_0: X + vector0_1: + serializedVersion: 2 + minMaxState: 0 + scalar: 0 + minScalar: 0 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + vectorLabel0_1: Y + vector0_2: + serializedVersion: 2 + minMaxState: 0 + scalar: 0 + minScalar: 0 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + vectorLabel0_2: Z + vector0_3: + serializedVersion: 2 + minMaxState: 0 + scalar: 0 + minScalar: 0 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + vectorLabel0_3: W + mode1: 0 + vectorComponentCount1: 4 + color1: + serializedVersion: 2 + minMaxState: 0 + minColor: {r: 1, g: 1, b: 1, a: 1} + maxColor: {r: 1, g: 1, b: 1, a: 1} + maxGradient: + serializedVersion: 2 + key0: {r: 1, g: 1, b: 1, a: 1} + key1: {r: 1, g: 1, b: 1, a: 1} + key2: {r: 0, g: 0, b: 0, a: 0} + key3: {r: 0, g: 0, b: 0, a: 0} + key4: {r: 0, g: 0, b: 0, a: 0} + key5: {r: 0, g: 0, b: 0, a: 0} + key6: {r: 0, g: 0, b: 0, a: 0} + key7: {r: 0, g: 0, b: 0, a: 0} + ctime0: 0 + ctime1: 65535 + ctime2: 0 + ctime3: 0 + ctime4: 0 + ctime5: 0 + ctime6: 0 + ctime7: 0 + atime0: 0 + atime1: 65535 + atime2: 0 + atime3: 0 + atime4: 0 + atime5: 0 + atime6: 0 + atime7: 0 + m_Mode: 0 + m_NumColorKeys: 2 + m_NumAlphaKeys: 2 + minGradient: + serializedVersion: 2 + key0: {r: 1, g: 1, b: 1, a: 1} + key1: {r: 1, g: 1, b: 1, a: 1} + key2: {r: 0, g: 0, b: 0, a: 0} + key3: {r: 0, g: 0, b: 0, a: 0} + key4: {r: 0, g: 0, b: 0, a: 0} + key5: {r: 0, g: 0, b: 0, a: 0} + key6: {r: 0, g: 0, b: 0, a: 0} + key7: {r: 0, g: 0, b: 0, a: 0} + ctime0: 0 + ctime1: 65535 + ctime2: 0 + ctime3: 0 + ctime4: 0 + ctime5: 0 + ctime6: 0 + ctime7: 0 + atime0: 0 + atime1: 65535 + atime2: 0 + atime3: 0 + atime4: 0 + atime5: 0 + atime6: 0 + atime7: 0 + m_Mode: 0 + m_NumColorKeys: 2 + m_NumAlphaKeys: 2 + colorLabel1: Color + vector1_0: + serializedVersion: 2 + minMaxState: 0 + scalar: 0 + minScalar: 0 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + vectorLabel1_0: X + vector1_1: + serializedVersion: 2 + minMaxState: 0 + scalar: 0 + minScalar: 0 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + vectorLabel1_1: Y + vector1_2: + serializedVersion: 2 + minMaxState: 0 + scalar: 0 + minScalar: 0 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + vectorLabel1_2: Z + vector1_3: + serializedVersion: 2 + minMaxState: 0 + scalar: 0 + minScalar: 0 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + vectorLabel1_3: W +--- !u!1 &1888002956 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1888002957} + - component: {fileID: 1888002959} + - component: {fileID: 1888002958} + m_Layer: 0 + m_Name: Animated + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 0 +--- !u!4 &1888002957 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1888002956} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: -3.57, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 1934762264} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!102 &1888002958 +TextMesh: + serializedVersion: 3 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1888002956} + m_Text: (Has Animation) + m_OffsetZ: -1.5 + m_CharacterSize: 0.075 + m_LineSpacing: 1 + m_Anchor: 4 + m_Alignment: 0 + m_TabSize: 4 + m_FontSize: 100 + m_FontStyle: 0 + m_RichText: 1 + m_Font: {fileID: 12800000, guid: a4e6a5491519adb45919dc87eff28e55, type: 3} + m_Color: + serializedVersion: 2 + rgba: 4294967295 +--- !u!23 &1888002959 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1888002956} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: a4e6a5491519adb45919dc87eff28e55, type: 3} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!4 &1893925001 stripped +Transform: + m_CorrespondingSourceObject: {fileID: 3864259599682641153, guid: 11bf72cfca6ba93459ddeacea51fd0bd, + type: 3} + m_PrefabInstance: {fileID: 3864259598862589320} + m_PrefabAsset: {fileID: 0} +--- !u!1 &1901854649 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1901854650} + - component: {fileID: 1901854654} + - component: {fileID: 1901854653} + - component: {fileID: 1901854651} + m_Layer: 0 + m_Name: Offset + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1901854650 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1901854649} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 50, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 164406719} + - {fileID: 1562540217} + m_Father: {fileID: 1351315063} + m_RootOrder: 5 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!95 &1901854651 +Animator: + serializedVersion: 3 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1901854649} + m_Enabled: 1 + m_Avatar: {fileID: 0} + m_Controller: {fileID: 9100000, guid: 63273b05c4774384b85a146feb6df4d3, type: 2} + m_CullingMode: 0 + m_UpdateMode: 0 + m_ApplyRootMotion: 0 + m_LinearVelocityBlending: 0 + m_WarningMessage: + m_HasTransformHierarchy: 1 + m_AllowConstantClipSamplingOptimization: 1 + m_KeepAnimatorControllerStateOnDisable: 0 +--- !u!114 &1901854653 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1901854649} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 98b644315d7a92842b89e04f55c48e02, type: 3} + m_Name: + m_EditorClassIdentifier: +--- !u!212 &1901854654 +SpriteRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1901854649} + m_Enabled: 1 + m_CastShadows: 0 + m_ReceiveShadows: 0 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 1605957010} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 0 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_Sprite: {fileID: 21300000, guid: 519dafacd208bb64c83d5124be03b09d, type: 3} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_FlipX: 0 + m_FlipY: 0 + m_DrawMode: 0 + m_Size: {x: 5.12, y: 5.12} + m_AdaptiveModeThreshold: 0.5 + m_SpriteTileMode: 0 + m_WasSpriteAssigned: 1 + m_MaskInteraction: 0 + m_SpriteSortPoint: 0 +--- !u!21 &1912112097 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: AllIn1SpriteShader/AllIn1SpriteShader + m_Shader: {fileID: 4800000, guid: a36b7719ff0465b42ab1407d67672c5f, type: 3} + m_ShaderKeywords: CLIPPING_ON ETC1_EXTERNAL_ALPHA GLOW_ON HSV_ON PINCH_ON ROTATEUV_ON + TWISTUV_ON + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _ColorRampTex: + m_Texture: {fileID: 2800000, guid: 279657edc397ece4b8029c727adf6ddc, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ColorRampTexGradient: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ColorSwapTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DistortTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _FadeBurnTex: + m_Texture: {fileID: 2800000, guid: 32e8df0008bebe746b1681a71c61f31c, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _FadeTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _GlowTex: + 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} + - _OutlineDistortTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OutlineTex: + m_Texture: {fileID: 2800000, guid: 74087f6d03f233e4a8a142fa01f9e5cf, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OverlayTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ShineMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - _Alpha: 1 + - _AlphaCutoffValue: 0.25 + - _AlphaOutlineBlend: 1 + - _AlphaOutlineGlow: 5 + - _AlphaOutlineMinAlpha: 0 + - _AlphaOutlinePower: 1 + - _AlphaRoundThreshold: 0.5 + - _BillboardY: 0 + - _BlurHD: 0 + - _BlurIntensity: 10 + - _Brightness: 0 + - _ChromAberrAlpha: 0.4 + - _ChromAberrAmount: 1 + - _ClipUvDown: 0.05 + - _ClipUvLeft: 0.05 + - _ClipUvRight: 0.05 + - _ClipUvUp: 0.05 + - _ColorChangeLuminosity: 0 + - _ColorChangeTolerance: 0.25 + - _ColorChangeTolerance2: 0.25 + - _ColorChangeTolerance3: 0.25 + - _ColorRampBlend: 1 + - _ColorRampLuminosity: 0 + - _ColorRampOutline: 0 + - _ColorSwapBlend: 1 + - _ColorSwapBlueLuminosity: 0.5 + - _ColorSwapGreenLuminosity: 0.5 + - _ColorSwapRedLuminosity: 0.5 + - _Contrast: 1 + - _CullingOption: 0 + - _DistortAmount: 0.5 + - _DistortTexXSpeed: 5 + - _DistortTexYSpeed: 5 + - _EditorDrawers: 6 + - _FadeAmount: -0.1 + - _FadeBurnGlow: 2 + - _FadeBurnTransition: 0.075 + - _FadeBurnWidth: 0.025 + - _FishEyeUvAmount: 0.35 + - _FlickerAlpha: 0 + - _FlickerFreq: 0.2 + - _FlickerPercent: 0.05 + - _GhostBlend: 1 + - _GhostColorBoost: 1 + - _GhostTransparency: 0 + - _GlitchAmount: 3 + - _GlitchSize: 1 + - _Glow: 0 + - _GlowGlobal: 1 + - _GlowTexUsed: 0 + - _GradBlend: 1 + - _GradBoostX: 1.2 + - _GradBoostY: 1.2 + - _GradIsRadial: 0 + - _GrassManualAnim: 1 + - _GrassManualToggle: 0 + - _GrassRadialBend: 0.25 + - _GrassSpeed: 2 + - _GrassWind: 20 + - _GreyscaleBlend: 1 + - _GreyscaleLuminosity: 0 + - _GreyscaleOutline: 0 + - _HandDrawnAmount: 10 + - _HandDrawnSpeed: 5 + - _HitEffectBlend: 1 + - _HitEffectGlow: 5 + - _HologramBlend: 1 + - _HologramFlickerAlpha: 0 + - _HologramFlickerFreq: 0.2 + - _HologramFlickerPercent: 0.05 + - _HologramMaxAlpha: 1 + - _HologramMinAlpha: 0 + - _HologramStripesAlpha: 0.4 + - _HologramStripesAmount: 50 + - _HologramStripesFill: 0.4 + - _HologramStripesLuminosity: 1 + - _HologramStripesSpeed: 5 + - _HologramUnmodAmount: 0.4 + - _HsvBright: 1 + - _HsvSaturation: 1 + - _HsvShift: 0 + - _InnerOutlineAlpha: 1 + - _InnerOutlineGlow: 1 + - _InnerOutlineThickness: 1 + - _MaxXUV: 1 + - _MaxYUV: 1 + - _MinXUV: 0 + - _MinYUV: 0 + - _MotionBlurAngle: 0.1 + - _MotionBlurDist: 1.25 + - _MyDstMode: 10 + - _MySrcMode: 5 + - _NegativeAmount: 1 + - _OffsetUvX: 0 + - _OffsetUvY: 0 + - _OnlyInnerOutline: 0 + - _OnlyOutline: 0 + - _Outline8Directions: 0 + - _OutlineAlpha: 1 + - _OutlineDistortAmount: 0.5 + - _OutlineDistortTexXSpeed: 5 + - _OutlineDistortTexYSpeed: 5 + - _OutlineDistortToggle: 0 + - _OutlineGlow: 1.5 + - _OutlineIsPixel: 0 + - _OutlinePixelWidth: 1 + - _OutlineTexGrey: 0 + - _OutlineTexToggle: 0 + - _OutlineTexXSpeed: 10 + - _OutlineTexYSpeed: 0 + - _OutlineWidth: 0.004 + - _OverlayBlend: 1 + - _OverlayGlow: 1 + - _OverlayTextureScrollXSpeed: 0.25 + - _OverlayTextureScrollYSpeed: 0.25 + - _PinchUvAmount: 0.35 + - _PixelateSize: 32 + - _PosterizeGamma: 0.75 + - _PosterizeNumColors: 8 + - _PosterizeOutline: 0 + - _RadialClip: 0 + - _RadialClip2: 45 + - _RadialClipAngle: 90 + - _RadialClipArc1: 45 + - _RadialClipArc2: 0 + - _RadialStartAngle: 90 + - _RandomSeed: 0 + - _RectSize: 1 + - _RotateUvAmount: 0 + - _RoundWaveSpeed: 2 + - _RoundWaveStrength: 0.7 + - _ShadowAlpha: 0.5 + - _ShadowX: 0.1 + - _ShadowY: -0.05 + - _ShakeUvSpeed: 2.5 + - _ShakeUvX: 1.5 + - _ShakeUvY: 1 + - _ShineGlow: 1 + - _ShineLocation: 0.5 + - _ShineRotate: 0 + - _ShineWidth: 0.1 + - _TextureScrollXSpeed: 1 + - _TextureScrollYSpeed: 0 + - _TwistUvAmount: 0.62 + - _TwistUvPosX: 0.5 + - _TwistUvPosY: 0.5 + - _TwistUvRadius: 0.75 + - _WarpScale: 0.5 + - _WarpSpeed: 8 + - _WarpStrength: 0.025 + - _WaveAmount: 7 + - _WaveSpeed: 10 + - _WaveStrength: 7.5 + - _WaveX: 0 + - _WaveY: 0.5 + - _ZTestMode: 4 + - _ZWrite: 0 + - _ZoomUvAmount: 0.5 + m_Colors: + - ColorSwapRed: {r: 1, g: 1, b: 1, a: 1} + - _AlphaOutlineColor: {r: 1, g: 1, b: 1, a: 1} + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _ColorChangeNewCol: {r: 1, g: 1, b: 0, a: 1} + - _ColorChangeNewCol2: {r: 1, g: 1, b: 0, a: 1} + - _ColorChangeNewCol3: {r: 1, g: 1, b: 0, a: 1} + - _ColorChangeTarget: {r: 1, g: 0, b: 0, a: 1} + - _ColorChangeTarget2: {r: 1, g: 0, b: 0, a: 1} + - _ColorChangeTarget3: {r: 1, g: 0, b: 0, a: 1} + - _ColorSwapBlue: {r: 1, g: 1, b: 1, a: 1} + - _ColorSwapGreen: {r: 1, g: 1, b: 1, a: 1} + - _ColorSwapRed: {r: 1, g: 1, b: 1, a: 1} + - _FadeBurnColor: {r: 1, g: 1, b: 0, a: 1} + - _GlowColor: {r: 1, g: 1, b: 1, a: 1} + - _GradBotLeftCol: {r: 0, g: 0, b: 1, a: 1} + - _GradBotRightCol: {r: 0, g: 0, b: 1, a: 1} + - _GradTopLeftCol: {r: 1, g: 0, b: 0, a: 1} + - _GradTopRightCol: {r: 1, g: 0, b: 0, a: 1} + - _GreyscaleTintColor: {r: 1, g: 1, b: 1, a: 1} + - _HitEffectColor: {r: 1, g: 1, b: 1, a: 1} + - _HologramStripeColor: {r: 1, g: 1, b: 1, a: 1} + - _InnerOutlineColor: {r: 1, g: 0, b: 0, a: 1} + - _OutlineColor: {r: 1, g: 1, b: 1, a: 1} + - _OverlayColor: {r: 1, g: 1, b: 1, a: 1} + - _ShadowColor: {r: 0, g: 0, b: 0, a: 1} + - _ShineColor: {r: 1, g: 1, b: 1, a: 1} +--- !u!1 &1916465495 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1916465496} + - component: {fileID: 1916465499} + - component: {fileID: 1916465498} + - component: {fileID: 1916465497} + m_Layer: 0 + m_Name: BlurredOutline + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1916465496 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1916465495} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0.05} + m_LocalScale: {x: 1.009596, y: 1.009596, z: 1.009596} + m_Children: [] + m_Father: {fileID: 499272004} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &1916465497 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1916465495} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: ee158225ee1e59f4791627785501d950, type: 3} + m_Name: + m_EditorClassIdentifier: + currentShaderType: 4 + normalStrength: 5 + normalSmoothing: 1 + computingNormal: 0 +--- !u!114 &1916465498 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1916465495} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 98b644315d7a92842b89e04f55c48e02, type: 3} + m_Name: + m_EditorClassIdentifier: +--- !u!212 &1916465499 +SpriteRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1916465495} + m_Enabled: 1 + m_CastShadows: 0 + m_ReceiveShadows: 0 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 430987701} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 0 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_Sprite: {fileID: 21300000, guid: 519dafacd208bb64c83d5124be03b09d, type: 3} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_FlipX: 0 + m_FlipY: 0 + m_DrawMode: 0 + m_Size: {x: 5.12, y: 5.12} + m_AdaptiveModeThreshold: 0.5 + m_SpriteTileMode: 0 + m_WasSpriteAssigned: 1 + m_MaskInteraction: 0 + m_SpriteSortPoint: 0 +--- !u!1 &1923390773 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1923390774} + - component: {fileID: 1923390776} + m_Layer: 0 + m_Name: RadialGradient + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1923390774 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1923390773} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 90, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 1724918724} + - {fileID: 1450664986} + - {fileID: 556503704} + m_Father: {fileID: 2036092933} + m_RootOrder: 9 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &1923390776 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1923390773} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 98b644315d7a92842b89e04f55c48e02, type: 3} + m_Name: + m_EditorClassIdentifier: +--- !u!1 &1924503771 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1924503772} + - component: {fileID: 1924503774} + - component: {fileID: 1924503773} + m_Layer: 0 + m_Name: Title + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1924503772 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1924503771} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: -3.1267126, z: 0} + m_LocalScale: {x: 1.2457023, y: 1.2457023, z: 1.2457023} + m_Children: [] + m_Father: {fileID: 1415143267} + m_RootOrder: 6 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!102 &1924503773 +TextMesh: + serializedVersion: 3 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1924503771} + m_Text: Unified Outline + m_OffsetZ: -1.5 + m_CharacterSize: 0.075 + m_LineSpacing: 1 + m_Anchor: 4 + m_Alignment: 0 + m_TabSize: 4 + m_FontSize: 100 + m_FontStyle: 0 + m_RichText: 1 + m_Font: {fileID: 12800000, guid: a4e6a5491519adb45919dc87eff28e55, type: 3} + m_Color: + serializedVersion: 2 + rgba: 4294967295 +--- !u!23 &1924503774 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1924503771} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 10100, guid: 0000000000000000e000000000000000, type: 0} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!1 &1931308734 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1931308735} + - component: {fileID: 1931308737} + - component: {fileID: 1931308738} + m_Layer: 0 + m_Name: Color Swap + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1931308735 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1931308734} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 100, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 443722314} + - {fileID: 427761889} + m_Father: {fileID: 2036092933} + m_RootOrder: 10 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!212 &1931308737 +SpriteRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1931308734} + m_Enabled: 1 + m_CastShadows: 0 + m_ReceiveShadows: 0 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 108846146} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 0 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_Sprite: {fileID: 21300000, guid: 519dafacd208bb64c83d5124be03b09d, type: 3} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_FlipX: 0 + m_FlipY: 0 + m_DrawMode: 0 + m_Size: {x: 5.12, y: 5.12} + m_AdaptiveModeThreshold: 0.5 + m_SpriteTileMode: 0 + m_WasSpriteAssigned: 1 + m_MaskInteraction: 0 + m_SpriteSortPoint: 0 +--- !u!114 &1931308738 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1931308734} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 98b644315d7a92842b89e04f55c48e02, type: 3} + m_Name: + m_EditorClassIdentifier: +--- !u!1 &1934762263 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1934762264} + - component: {fileID: 1934762267} + - component: {fileID: 1934762266} + - component: {fileID: 1934762268} + m_Layer: 0 + m_Name: Burn + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1934762264 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1934762263} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 396641006} + - {fileID: 1888002957} + m_Father: {fileID: 1563905016} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &1934762266 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1934762263} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 98b644315d7a92842b89e04f55c48e02, type: 3} + m_Name: + m_EditorClassIdentifier: +--- !u!212 &1934762267 +SpriteRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1934762263} + m_Enabled: 1 + m_CastShadows: 0 + m_ReceiveShadows: 0 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 639189023} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 0 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_Sprite: {fileID: 21300000, guid: 519dafacd208bb64c83d5124be03b09d, type: 3} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_FlipX: 0 + m_FlipY: 0 + m_DrawMode: 0 + m_Size: {x: 5.12, y: 5.12} + m_AdaptiveModeThreshold: 0.5 + m_SpriteTileMode: 0 + m_WasSpriteAssigned: 1 + m_MaskInteraction: 0 + m_SpriteSortPoint: 0 +--- !u!95 &1934762268 +Animator: + serializedVersion: 3 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1934762263} + m_Enabled: 1 + m_Avatar: {fileID: 0} + m_Controller: {fileID: 9100000, guid: 9d3bba413d0ce9244b743d634f8d3c27, type: 2} + m_CullingMode: 0 + m_UpdateMode: 0 + m_ApplyRootMotion: 0 + m_LinearVelocityBlending: 0 + m_WarningMessage: + m_HasTransformHierarchy: 1 + m_AllowConstantClipSamplingOptimization: 1 + m_KeepAnimatorControllerStateOnDisable: 0 +--- !u!21 &1936528753 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: AllIn1SpriteShader/AllIn1SpriteShader + m_Shader: {fileID: 4800000, guid: a36b7719ff0465b42ab1407d67672c5f, type: 3} + m_ShaderKeywords: ETC1_EXTERNAL_ALPHA OVERLAY_ON + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _ColorRampTex: + m_Texture: {fileID: 2800000, guid: 279657edc397ece4b8029c727adf6ddc, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ColorRampTexGradient: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ColorSwapTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DistortTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _FadeBurnTex: + m_Texture: {fileID: 2800000, guid: 677cca399782dea41aedc1d292ecb67d, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _FadeTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _GlowTex: + 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} + - _OutlineDistortTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OutlineTex: + m_Texture: {fileID: 2800000, guid: 74087f6d03f233e4a8a142fa01f9e5cf, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OverlayTex: + m_Texture: {fileID: 2800000, guid: 677cca399782dea41aedc1d292ecb67d, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ShineMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - _Alpha: 1 + - _AlphaCutoffValue: 0.25 + - _AlphaOutlineBlend: 1 + - _AlphaOutlineGlow: 5 + - _AlphaOutlineMinAlpha: 0 + - _AlphaOutlinePower: 1 + - _AlphaRoundThreshold: 0.5 + - _BillboardY: 0 + - _BlurHD: 0 + - _BlurIntensity: 10 + - _Brightness: 0 + - _ChromAberrAlpha: 0.4 + - _ChromAberrAmount: 1 + - _ClipUvDown: 0 + - _ClipUvLeft: 0 + - _ClipUvRight: 0 + - _ClipUvUp: 0 + - _ColorChangeLuminosity: 0 + - _ColorChangeTolerance: 0.25 + - _ColorChangeTolerance2: 0.25 + - _ColorChangeTolerance3: 0.25 + - _ColorRampBlend: 1 + - _ColorRampLuminosity: 0 + - _ColorRampOutline: 0 + - _ColorSwapBlend: 1 + - _ColorSwapBlueLuminosity: 0.5 + - _ColorSwapGreenLuminosity: 0.5 + - _ColorSwapRedLuminosity: 0.5 + - _Contrast: 1 + - _CullingOption: 0 + - _DistortAmount: 0.5 + - _DistortTexXSpeed: 5 + - _DistortTexYSpeed: 5 + - _EditorDrawers: 6 + - _FadeAmount: -0.1 + - _FadeBurnGlow: 2 + - _FadeBurnTransition: 0.075 + - _FadeBurnWidth: 0.025 + - _FishEyeUvAmount: 0.35 + - _FlickerAlpha: 0 + - _FlickerFreq: 0.2 + - _FlickerPercent: 0.05 + - _GhostBlend: 1 + - _GhostColorBoost: 1 + - _GhostTransparency: 0 + - _GlitchAmount: 3 + - _GlitchSize: 1 + - _Glow: 10 + - _GlowGlobal: 1 + - _GlowTexUsed: 0 + - _GradBlend: 1 + - _GradBoostX: 1.2 + - _GradBoostY: 1.2 + - _GradIsRadial: 0 + - _GrassManualAnim: 1 + - _GrassManualToggle: 0 + - _GrassRadialBend: 0.1 + - _GrassSpeed: 2 + - _GrassWind: 20 + - _GreyscaleBlend: 1 + - _GreyscaleLuminosity: 0 + - _GreyscaleOutline: 0 + - _HandDrawnAmount: 10 + - _HandDrawnSpeed: 5 + - _HitEffectBlend: 1 + - _HitEffectGlow: 5 + - _HologramBlend: 1 + - _HologramMaxAlpha: 0.75 + - _HologramMinAlpha: 0.1 + - _HologramStripesAmount: 0.1 + - _HologramStripesSpeed: 4.5 + - _HologramUnmodAmount: 0 + - _HsvBright: 1 + - _HsvSaturation: 1 + - _HsvShift: 180 + - _InnerOutlineAlpha: 1 + - _InnerOutlineGlow: 4 + - _InnerOutlineThickness: 1 + - _MaxXUV: 1 + - _MaxYUV: 1 + - _MinXUV: 0 + - _MinYUV: 0 + - _MotionBlurAngle: 0.1 + - _MotionBlurDist: 1.25 + - _MyDstMode: 10 + - _MySrcMode: 5 + - _NegativeAmount: 1 + - _OffsetUvX: 0 + - _OffsetUvY: 0 + - _OnlyInnerOutline: 0 + - _OnlyOutline: 0 + - _Outline8Directions: 0 + - _OutlineAlpha: 1 + - _OutlineDistortAmount: 0.5 + - _OutlineDistortTexXSpeed: 5 + - _OutlineDistortTexYSpeed: 5 + - _OutlineDistortToggle: 0 + - _OutlineGlow: 1.5 + - _OutlineIsPixel: 0 + - _OutlinePixelWidth: 1 + - _OutlineTexGrey: 0 + - _OutlineTexToggle: 0 + - _OutlineTexXSpeed: 10 + - _OutlineTexYSpeed: 0 + - _OutlineWidth: 0.004 + - _OverlayBlend: 0.413 + - _OverlayGlow: 1.8 + - _OverlayTextureScrollXSpeed: 0.25 + - _OverlayTextureScrollYSpeed: 0.25 + - _PinchUvAmount: 0.35 + - _PixelateSize: 32 + - _PosterizeGamma: 0.75 + - _PosterizeNumColors: 8 + - _PosterizeOutline: 0 + - _RadialClip: 45 + - _RadialClip2: 0 + - _RadialClipAngle: 90 + - _RadialClipArc1: 45 + - _RadialClipArc2: 0 + - _RadialStartAngle: 90 + - _RandomSeed: 0 + - _RectSize: 1 + - _RotateUvAmount: 0 + - _RoundWaveSpeed: 2 + - _RoundWaveStrength: 0.7 + - _ShadowAlpha: 0.5 + - _ShadowX: 0.1 + - _ShadowY: -0.05 + - _ShakeUvSpeed: 2.5 + - _ShakeUvX: 1.5 + - _ShakeUvY: 1 + - _ShineGlow: 1 + - _ShineLocation: 0.5 + - _ShineRotate: 0 + - _ShineWidth: 0.1 + - _TextureScrollXSpeed: 1 + - _TextureScrollYSpeed: 0 + - _TwistUvAmount: 1 + - _TwistUvPosX: 0.5 + - _TwistUvPosY: 0.5 + - _TwistUvRadius: 0.75 + - _WarpScale: 0.5 + - _WarpSpeed: 8 + - _WarpStrength: 0.025 + - _WaveAmount: 7 + - _WaveSpeed: 10 + - _WaveStrength: 7.5 + - _WaveX: 0 + - _WaveY: 0.5 + - _ZTestMode: 4 + - _ZWrite: 0 + - _ZoomUvAmount: 0.5 + m_Colors: + - _AlphaOutlineColor: {r: 1, g: 1, b: 1, a: 1} + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _ColorChangeNewCol: {r: 1, g: 1, b: 0, a: 1} + - _ColorChangeNewCol2: {r: 1, g: 1, b: 0, a: 1} + - _ColorChangeNewCol3: {r: 1, g: 1, b: 0, a: 1} + - _ColorChangeTarget: {r: 1, g: 0, b: 0, a: 1} + - _ColorChangeTarget2: {r: 1, g: 0, b: 0, a: 1} + - _ColorChangeTarget3: {r: 1, g: 0, b: 0, a: 1} + - _ColorSwapBlue: {r: 1, g: 1, b: 1, a: 1} + - _ColorSwapGreen: {r: 1, g: 1, b: 1, a: 1} + - _ColorSwapRed: {r: 1, g: 1, b: 1, a: 1} + - _FadeBurnColor: {r: 1, g: 1, b: 0, a: 1} + - _GlowColor: {r: 1, g: 1, b: 1, a: 1} + - _GradBotLeftCol: {r: 0, g: 0, b: 1, a: 1} + - _GradBotRightCol: {r: 0, g: 0, b: 1, a: 1} + - _GradTopLeftCol: {r: 1, g: 0, b: 0, a: 1} + - _GradTopRightCol: {r: 1, g: 0, b: 0, a: 1} + - _GreyscaleTintColor: {r: 1, g: 1, b: 1, a: 1} + - _HitEffectColor: {r: 1, g: 1, b: 1, a: 1} + - _HologramStripeColor: {r: 0, g: 1, b: 1, a: 1} + - _InnerOutlineColor: {r: 1, g: 0, b: 0, a: 1} + - _OutlineColor: {r: 1, g: 1, b: 1, a: 1} + - _OverlayColor: {r: 1, g: 1, b: 1, a: 1} + - _ShadowColor: {r: 0, g: 0, b: 0, a: 1} + - _ShineColor: {r: 1, g: 1, b: 1, a: 1} +--- !u!1 &1937897984 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1937897985} + - component: {fileID: 1937897987} + - component: {fileID: 1937897986} + m_Layer: 0 + m_Name: Title + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1937897985 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1937897984} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: -2.51, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 2035943844} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!102 &1937897986 +TextMesh: + serializedVersion: 3 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1937897984} + m_Text: Blurred Back + m_OffsetZ: -1.5 + m_CharacterSize: 0.075 + m_LineSpacing: 1 + m_Anchor: 4 + m_Alignment: 0 + m_TabSize: 4 + m_FontSize: 100 + m_FontStyle: 0 + m_RichText: 1 + m_Font: {fileID: 12800000, guid: a4e6a5491519adb45919dc87eff28e55, type: 3} + m_Color: + serializedVersion: 2 + rgba: 4294967295 +--- !u!23 &1937897987 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1937897984} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 10100, guid: 0000000000000000e000000000000000, type: 0} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!1 &1939042050 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1939042051} + - component: {fileID: 1939042053} + - component: {fileID: 1939042052} + m_Layer: 0 + m_Name: Animated + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 0 +--- !u!4 &1939042051 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1939042050} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: -3.57, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 443772011} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!102 &1939042052 +TextMesh: + serializedVersion: 3 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1939042050} + m_Text: (Has Animation) + m_OffsetZ: -1.5 + m_CharacterSize: 0.075 + m_LineSpacing: 1 + m_Anchor: 4 + m_Alignment: 0 + m_TabSize: 4 + m_FontSize: 100 + m_FontStyle: 0 + m_RichText: 1 + m_Font: {fileID: 12800000, guid: a4e6a5491519adb45919dc87eff28e55, type: 3} + m_Color: + serializedVersion: 2 + rgba: 4294967295 +--- !u!23 &1939042053 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1939042050} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: a4e6a5491519adb45919dc87eff28e55, type: 3} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!1 &1939573376 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1939573377} + - component: {fileID: 1939573379} + - component: {fileID: 1939573378} + m_Layer: 0 + m_Name: Title + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1939573377 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1939573376} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: -2.51, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 1507269762} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!102 &1939573378 +TextMesh: + serializedVersion: 3 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1939573376} + m_Text: Twist Disappear + m_OffsetZ: -1.5 + m_CharacterSize: 0.075 + m_LineSpacing: 1 + m_Anchor: 4 + m_Alignment: 0 + m_TabSize: 4 + m_FontSize: 100 + m_FontStyle: 0 + m_RichText: 1 + m_Font: {fileID: 12800000, guid: a4e6a5491519adb45919dc87eff28e55, type: 3} + m_Color: + serializedVersion: 2 + rgba: 4294967295 +--- !u!23 &1939573379 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1939573376} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 10100, guid: 0000000000000000e000000000000000, type: 0} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!1 &1949787729 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1949787730} + - component: {fileID: 1949787731} + m_Layer: 0 + m_Name: BackFrame + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1949787730 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1949787729} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0.05} + m_LocalScale: {x: 95.922, y: 95.922, z: 95.922} + m_Children: [] + m_Father: {fileID: 242385329} + m_RootOrder: 3 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!212 &1949787731 +SpriteRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1949787729} + m_Enabled: 1 + m_CastShadows: 0 + m_ReceiveShadows: 0 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 10754, guid: 0000000000000000f000000000000000, type: 0} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 0 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_Sprite: {fileID: 21300000, guid: 839adabbc5de26041bac66450214a831, type: 3} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_FlipX: 0 + m_FlipY: 0 + m_DrawMode: 0 + m_Size: {x: 0.04, y: 0.04} + m_AdaptiveModeThreshold: 0.5 + m_SpriteTileMode: 0 + m_WasSpriteAssigned: 1 + m_MaskInteraction: 0 + m_SpriteSortPoint: 0 +--- !u!1 &1953432851 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1953432852} + - component: {fileID: 1953432853} + m_Layer: 0 + m_Name: Fire + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1953432852 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1953432851} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 170, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 1797106726} + - {fileID: 682244417} + - {fileID: 1091797526} + - {fileID: 1749643255} + m_Father: {fileID: 1563905016} + m_RootOrder: 17 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &1953432853 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1953432851} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 98b644315d7a92842b89e04f55c48e02, type: 3} + m_Name: + m_EditorClassIdentifier: +--- !u!21 &1956560312 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: AllIn1SpriteShader/AllIn1SpriteShader + m_Shader: {fileID: 4800000, guid: a36b7719ff0465b42ab1407d67672c5f, type: 3} + m_ShaderKeywords: ETC1_EXTERNAL_ALPHA GLOW_ON GRADIENT_ON RADIALGRADIENT_ON _GRADISRADIAL_ON + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _ColorRampTex: + m_Texture: {fileID: 2800000, guid: 279657edc397ece4b8029c727adf6ddc, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ColorRampTexGradient: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ColorSwapTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DistortTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _FadeBurnTex: + m_Texture: {fileID: 2800000, guid: 677cca399782dea41aedc1d292ecb67d, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _FadeTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _GlowTex: + 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} + - _OutlineDistortTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OutlineTex: + m_Texture: {fileID: 2800000, guid: 74087f6d03f233e4a8a142fa01f9e5cf, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OverlayTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ShineMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - _Alpha: 0.741 + - _AlphaCutoffValue: 0.25 + - _AlphaOutlineBlend: 1 + - _AlphaOutlineGlow: 5 + - _AlphaOutlineMinAlpha: 0 + - _AlphaOutlinePower: 1 + - _AlphaRoundThreshold: 0.5 + - _BillboardY: 0 + - _BlurHD: 0 + - _BlurIntensity: 10 + - _Brightness: 0 + - _ChromAberrAlpha: 0.4 + - _ChromAberrAmount: 1 + - _ClipUvDown: 0 + - _ClipUvLeft: 0 + - _ClipUvRight: 0 + - _ClipUvUp: 0 + - _ColorChangeLuminosity: 0 + - _ColorChangeTolerance: 0.25 + - _ColorChangeTolerance2: 0.25 + - _ColorChangeTolerance3: 0.25 + - _ColorRampBlend: 1 + - _ColorRampLuminosity: 0 + - _ColorRampOutline: 0 + - _ColorSwapBlend: 1 + - _ColorSwapBlueLuminosity: 0.5 + - _ColorSwapGreenLuminosity: 0.5 + - _ColorSwapRedLuminosity: 0.5 + - _Contrast: 1 + - _CullingOption: 0 + - _DistortAmount: 0.5 + - _DistortTexXSpeed: 5 + - _DistortTexYSpeed: 5 + - _EditorDrawers: 6 + - _FadeAmount: -0.1 + - _FadeBurnGlow: 2 + - _FadeBurnTransition: 0.075 + - _FadeBurnWidth: 0.025 + - _FishEyeUvAmount: 0.35 + - _FlickerAlpha: 0 + - _FlickerFreq: 0.2 + - _FlickerPercent: 0.05 + - _GhostBlend: 1 + - _GhostColorBoost: 1 + - _GhostTransparency: 0 + - _GlitchAmount: 3 + - _GlitchSize: 1 + - _Glow: 5.3 + - _GlowGlobal: 1 + - _GlowTexUsed: 0 + - _GradBlend: 1 + - _GradBoostX: 1.3 + - _GradBoostY: 1.2 + - _GradIsRadial: 1 + - _GrassManualAnim: 1 + - _GrassManualToggle: 0 + - _GrassRadialBend: 0.25 + - _GrassSpeed: 2 + - _GrassWind: 20 + - _GreyscaleBlend: 1 + - _GreyscaleLuminosity: 0 + - _GreyscaleOutline: 0 + - _HandDrawnAmount: 10 + - _HandDrawnSpeed: 5 + - _HitEffectBlend: 1 + - _HitEffectGlow: 5 + - _HologramBlend: 1 + - _HologramMaxAlpha: 0.75 + - _HologramMinAlpha: 0.1 + - _HologramStripesAmount: 0.1 + - _HologramStripesSpeed: 4.5 + - _HologramUnmodAmount: 0 + - _HsvBright: 1 + - _HsvSaturation: 1 + - _HsvShift: 180 + - _InnerOutlineAlpha: 1 + - _InnerOutlineGlow: 1 + - _InnerOutlineThickness: 1 + - _MaxXUV: 1 + - _MaxYUV: 1 + - _MinXUV: 0 + - _MinYUV: 0 + - _MotionBlurAngle: 0.1 + - _MotionBlurDist: 1.25 + - _MyDstMode: 10 + - _MySrcMode: 5 + - _NegativeAmount: 1 + - _OffsetUvX: 0 + - _OffsetUvY: 0 + - _OnlyInnerOutline: 0 + - _OnlyOutline: 0 + - _Outline8Directions: 0 + - _OutlineAlpha: 1 + - _OutlineDistortAmount: 0.5 + - _OutlineDistortTexXSpeed: 5 + - _OutlineDistortTexYSpeed: 5 + - _OutlineDistortToggle: 0 + - _OutlineGlow: 1.5 + - _OutlineIsPixel: 0 + - _OutlinePixelWidth: 1 + - _OutlineTexGrey: 0 + - _OutlineTexToggle: 0 + - _OutlineTexXSpeed: 10 + - _OutlineTexYSpeed: 0 + - _OutlineWidth: 0.004 + - _OverlayBlend: 1 + - _OverlayGlow: 1 + - _OverlayTextureScrollXSpeed: 0.25 + - _OverlayTextureScrollYSpeed: 0.25 + - _PinchUvAmount: 0.35 + - _PixelateSize: 32 + - _PosterizeGamma: 0.75 + - _PosterizeNumColors: 8 + - _PosterizeOutline: 0 + - _RadialClip: 0 + - _RadialClip2: 45 + - _RadialClipAngle: 90 + - _RadialClipArc1: 45 + - _RadialClipArc2: 0 + - _RadialStartAngle: 90 + - _RandomSeed: 0 + - _RectSize: 1 + - _RotateUvAmount: 0 + - _RoundWaveSpeed: 2 + - _RoundWaveStrength: 0.7 + - _ShadowAlpha: 0.5 + - _ShadowX: 0.1 + - _ShadowY: -0.05 + - _ShakeUvSpeed: 2.5 + - _ShakeUvX: 1.5 + - _ShakeUvY: 1 + - _ShineGlow: 1 + - _ShineLocation: 0.5 + - _ShineRotate: 0 + - _ShineWidth: 0.1 + - _TextureScrollXSpeed: 1 + - _TextureScrollYSpeed: 0 + - _TwistUvAmount: 1 + - _TwistUvPosX: 0.5 + - _TwistUvPosY: 0.5 + - _TwistUvRadius: 0.75 + - _WarpScale: 0.5 + - _WarpSpeed: 8 + - _WarpStrength: 0.025 + - _WaveAmount: 7 + - _WaveSpeed: 10 + - _WaveStrength: 7.5 + - _WaveX: 0 + - _WaveY: 0.5 + - _ZTestMode: 4 + - _ZWrite: 0 + - _ZoomUvAmount: 0.5 + m_Colors: + - ColorSwapRed: {r: 1, g: 1, b: 1, a: 1} + - _AlphaOutlineColor: {r: 1, g: 1, b: 1, a: 1} + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _ColorChangeNewCol: {r: 1, g: 1, b: 0, a: 1} + - _ColorChangeNewCol2: {r: 1, g: 1, b: 0, a: 1} + - _ColorChangeNewCol3: {r: 1, g: 1, b: 0, a: 1} + - _ColorChangeTarget: {r: 1, g: 0, b: 0, a: 1} + - _ColorChangeTarget2: {r: 1, g: 0, b: 0, a: 1} + - _ColorChangeTarget3: {r: 1, g: 0, b: 0, a: 1} + - _ColorSwapBlue: {r: 1, g: 1, b: 1, a: 1} + - _ColorSwapGreen: {r: 1, g: 1, b: 1, a: 1} + - _ColorSwapRed: {r: 1, g: 1, b: 1, a: 1} + - _FadeBurnColor: {r: 1, g: 1, b: 0, a: 1} + - _GlowColor: {r: 1, g: 1, b: 1, a: 1} + - _GradBotLeftCol: {r: 0.9686275, g: 0.03137255, b: 0.03137255, a: 0} + - _GradBotRightCol: {r: 0, g: 0, b: 1, a: 1} + - _GradTopLeftCol: {r: 1, g: 0, b: 0, a: 1} + - _GradTopRightCol: {r: 1, g: 0, b: 0, a: 1} + - _GreyscaleTintColor: {r: 1, g: 1, b: 1, a: 1} + - _HitEffectColor: {r: 1, g: 1, b: 1, a: 1} + - _HologramStripeColor: {r: 0, g: 1, b: 1, a: 1} + - _InnerOutlineColor: {r: 1, g: 0, b: 0, a: 1} + - _OutlineColor: {r: 1, g: 1, b: 1, a: 1} + - _OverlayColor: {r: 1, g: 1, b: 1, a: 1} + - _ShadowColor: {r: 0, g: 0, b: 0, a: 1} + - _ShineColor: {r: 1, g: 1, b: 1, a: 1} +--- !u!21 &1984207367 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: AllIn1SpriteShader/AllIn1SpriteShader + m_Shader: {fileID: 4800000, guid: a36b7719ff0465b42ab1407d67672c5f, type: 3} + m_ShaderKeywords: ETC1_EXTERNAL_ALPHA OUTBASE8DIR_ON WAVEUV_ON _OUTLINE8DIRECTIONS_ON + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _ColorRampTex: + m_Texture: {fileID: 2800000, guid: 279657edc397ece4b8029c727adf6ddc, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ColorRampTexGradient: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ColorSwapTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DistortTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _FadeBurnTex: + m_Texture: {fileID: 2800000, guid: 32e8df0008bebe746b1681a71c61f31c, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _FadeTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _GlowTex: + 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} + - _OutlineDistortTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OutlineTex: + m_Texture: {fileID: 2800000, guid: 74087f6d03f233e4a8a142fa01f9e5cf, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OverlayTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ShineMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - _Alpha: 1 + - _AlphaCutoffValue: 0.25 + - _AlphaOutlineBlend: 1 + - _AlphaOutlineGlow: 5 + - _AlphaOutlineMinAlpha: 0 + - _AlphaOutlinePower: 1 + - _AlphaRoundThreshold: 0.5 + - _BillboardY: 0 + - _BlurHD: 0 + - _BlurIntensity: 10 + - _Brightness: 0 + - _ChromAberrAlpha: 0.4 + - _ChromAberrAmount: 1 + - _ClipUvDown: 1 + - _ClipUvLeft: 1 + - _ClipUvRight: 1 + - _ClipUvUp: 1 + - _ColorChangeLuminosity: 0 + - _ColorChangeTolerance: 0.25 + - _ColorChangeTolerance2: 0.25 + - _ColorChangeTolerance3: 0.25 + - _ColorRampBlend: 1 + - _ColorRampLuminosity: 0 + - _ColorRampOutline: 0 + - _ColorSwapBlend: 1 + - _ColorSwapBlueLuminosity: 0.5 + - _ColorSwapGreenLuminosity: 0.5 + - _ColorSwapRedLuminosity: 0.5 + - _Contrast: 1 + - _CullingOption: 0 + - _DistortAmount: 0.5 + - _DistortTexXSpeed: 5 + - _DistortTexYSpeed: 5 + - _EditorDrawers: 6 + - _FadeAmount: -0.1 + - _FadeBurnGlow: 2 + - _FadeBurnTransition: 0.075 + - _FadeBurnWidth: 0.025 + - _FishEyeUvAmount: 0.35 + - _FlickerAlpha: 0 + - _FlickerFreq: 0.2 + - _FlickerPercent: 0.05 + - _GhostBlend: 1 + - _GhostColorBoost: 1 + - _GhostTransparency: 0 + - _GlitchAmount: 3 + - _GlitchSize: 1 + - _Glow: 10 + - _GlowGlobal: 1 + - _GlowTexUsed: 0 + - _GradBlend: 1 + - _GradBoostX: 1.2 + - _GradBoostY: 1.2 + - _GradIsRadial: 0 + - _GrassManualAnim: 1 + - _GrassManualToggle: 0 + - _GrassRadialBend: 0.25 + - _GrassSpeed: 2 + - _GrassWind: 20 + - _GreyscaleBlend: 1 + - _GreyscaleLuminosity: 0 + - _GreyscaleOutline: 0 + - _HandDrawnAmount: 10 + - _HandDrawnSpeed: 5 + - _HitEffectBlend: 1 + - _HitEffectGlow: 5 + - _HologramBlend: 1 + - _HologramFlickerAlpha: 0 + - _HologramFlickerFreq: 0.2 + - _HologramFlickerPercent: 0.05 + - _HologramMaxAlpha: 1 + - _HologramMinAlpha: 0 + - _HologramStripesAlpha: 0.4 + - _HologramStripesAmount: 50 + - _HologramStripesFill: 0.4 + - _HologramStripesLuminosity: 1 + - _HologramStripesSpeed: 5 + - _HologramUnmodAmount: 0.4 + - _HsvBright: 1 + - _HsvSaturation: 1 + - _HsvShift: 180 + - _InnerOutlineAlpha: 1 + - _InnerOutlineGlow: 1 + - _InnerOutlineThickness: 1 + - _MaxXUV: 1 + - _MaxYUV: 1 + - _MinXUV: 0 + - _MinYUV: 0 + - _MotionBlurAngle: 0.1 + - _MotionBlurDist: 1.25 + - _MyDstMode: 10 + - _MySrcMode: 5 + - _NegativeAmount: 1 + - _OffsetUvX: 0 + - _OffsetUvY: 0 + - _OnlyInnerOutline: 0 + - _OnlyOutline: 0 + - _Outline8Directions: 1 + - _OutlineAlpha: 1 + - _OutlineDistortAmount: 0.5 + - _OutlineDistortTexXSpeed: 5 + - _OutlineDistortTexYSpeed: 5 + - _OutlineDistortToggle: 0 + - _OutlineGlow: 1.5 + - _OutlineIsPixel: 0 + - _OutlinePixelWidth: 1 + - _OutlineTexGrey: 0 + - _OutlineTexToggle: 0 + - _OutlineTexXSpeed: 10 + - _OutlineTexYSpeed: 0 + - _OutlineWidth: 0.0159 + - _OverlayBlend: 1 + - _OverlayGlow: 1 + - _OverlayTextureScrollXSpeed: 0.25 + - _OverlayTextureScrollYSpeed: 0.25 + - _PinchUvAmount: 0.35 + - _PixelateSize: 32 + - _PosterizeGamma: 0.75 + - _PosterizeNumColors: 8 + - _PosterizeOutline: 0 + - _RadialClip: 45 + - _RadialClip2: 0 + - _RadialClipAngle: 90 + - _RadialClipArc1: 45 + - _RadialClipArc2: 0 + - _RadialStartAngle: 90 + - _RandomSeed: 0 + - _RectSize: 1 + - _RotateUvAmount: 0 + - _RoundWaveSpeed: 2 + - _RoundWaveStrength: 0.7 + - _ShadowAlpha: 0.5 + - _ShadowX: 0.1 + - _ShadowY: -0.05 + - _ShakeUvSpeed: 2.5 + - _ShakeUvX: 1.5 + - _ShakeUvY: 1 + - _ShineGlow: 1 + - _ShineLocation: 0.5 + - _ShineRotate: 0 + - _ShineWidth: 0.1 + - _TextureScrollXSpeed: 1 + - _TextureScrollYSpeed: 0 + - _TwistUvAmount: 1 + - _TwistUvPosX: 0.5 + - _TwistUvPosY: 0.5 + - _TwistUvRadius: 0.75 + - _WarpScale: 0.5 + - _WarpSpeed: 8 + - _WarpStrength: 0.025 + - _WaveAmount: 8.95 + - _WaveSpeed: 12.14 + - _WaveStrength: 18.77 + - _WaveX: 0 + - _WaveY: 0.5 + - _ZTestMode: 4 + - _ZWrite: 0 + - _ZoomUvAmount: 0.5 + m_Colors: + - ColorSwapRed: {r: 1, g: 1, b: 1, a: 1} + - _AlphaOutlineColor: {r: 1, g: 1, b: 1, a: 1} + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _ColorChangeNewCol: {r: 1, g: 1, b: 0, a: 1} + - _ColorChangeNewCol2: {r: 1, g: 1, b: 0, a: 1} + - _ColorChangeNewCol3: {r: 1, g: 1, b: 0, a: 1} + - _ColorChangeTarget: {r: 1, g: 0, b: 0, a: 1} + - _ColorChangeTarget2: {r: 1, g: 0, b: 0, a: 1} + - _ColorChangeTarget3: {r: 1, g: 0, b: 0, a: 1} + - _ColorSwapBlue: {r: 1, g: 1, b: 1, a: 1} + - _ColorSwapGreen: {r: 1, g: 1, b: 1, a: 1} + - _ColorSwapRed: {r: 1, g: 1, b: 1, a: 1} + - _FadeBurnColor: {r: 1, g: 1, b: 0, a: 1} + - _GlowColor: {r: 1, g: 1, b: 1, a: 1} + - _GradBotLeftCol: {r: 0, g: 0, b: 1, a: 1} + - _GradBotRightCol: {r: 0, g: 0, b: 1, a: 1} + - _GradTopLeftCol: {r: 1, g: 0, b: 0, a: 1} + - _GradTopRightCol: {r: 1, g: 0, b: 0, a: 1} + - _GreyscaleTintColor: {r: 1, g: 1, b: 1, a: 1} + - _HitEffectColor: {r: 1, g: 1, b: 1, a: 1} + - _HologramStripeColor: {r: 1, g: 1, b: 1, a: 1} + - _InnerOutlineColor: {r: 1, g: 0, b: 0, a: 1} + - _OutlineColor: {r: 1, g: 1, b: 1, a: 1} + - _OverlayColor: {r: 1, g: 1, b: 1, a: 1} + - _ShadowColor: {r: 0, g: 0, b: 0, a: 1} + - _ShineColor: {r: 1, g: 1, b: 1, a: 1} +--- !u!1 &1986728941 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1986728942} + - component: {fileID: 1986728946} + - component: {fileID: 1986728945} + - component: {fileID: 1986728943} + m_Layer: 0 + m_Name: Zoom + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1986728942 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1986728941} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 90, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 499438417} + - {fileID: 1090919393} + m_Father: {fileID: 1351315063} + m_RootOrder: 9 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!95 &1986728943 +Animator: + serializedVersion: 3 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1986728941} + m_Enabled: 1 + m_Avatar: {fileID: 0} + m_Controller: {fileID: 9100000, guid: f63147b3bd9ae6949be2ad05c6679dd5, type: 2} + m_CullingMode: 0 + m_UpdateMode: 0 + m_ApplyRootMotion: 0 + m_LinearVelocityBlending: 0 + m_WarningMessage: + m_HasTransformHierarchy: 1 + m_AllowConstantClipSamplingOptimization: 1 + m_KeepAnimatorControllerStateOnDisable: 0 +--- !u!114 &1986728945 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1986728941} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 98b644315d7a92842b89e04f55c48e02, type: 3} + m_Name: + m_EditorClassIdentifier: +--- !u!212 &1986728946 +SpriteRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1986728941} + m_Enabled: 1 + m_CastShadows: 0 + m_ReceiveShadows: 0 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 984421900} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 0 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_Sprite: {fileID: 21300000, guid: 519dafacd208bb64c83d5124be03b09d, type: 3} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_FlipX: 0 + m_FlipY: 0 + m_DrawMode: 0 + m_Size: {x: 5.12, y: 5.12} + m_AdaptiveModeThreshold: 0.5 + m_SpriteTileMode: 0 + m_WasSpriteAssigned: 1 + m_MaskInteraction: 0 + m_SpriteSortPoint: 0 +--- !u!1 &1988936577 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1988936578} + - component: {fileID: 1988936580} + - component: {fileID: 1988936581} + m_Layer: 0 + m_Name: Color Ramp + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1988936578 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1988936577} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 130, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 1868383714} + - {fileID: 1146988138} + m_Father: {fileID: 2036092933} + m_RootOrder: 13 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!212 &1988936580 +SpriteRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1988936577} + m_Enabled: 1 + m_CastShadows: 0 + m_ReceiveShadows: 0 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 581202604} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 0 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_Sprite: {fileID: 21300000, guid: 519dafacd208bb64c83d5124be03b09d, type: 3} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_FlipX: 0 + m_FlipY: 0 + m_DrawMode: 0 + m_Size: {x: 5.12, y: 5.12} + m_AdaptiveModeThreshold: 0.5 + m_SpriteTileMode: 0 + m_WasSpriteAssigned: 1 + m_MaskInteraction: 0 + m_SpriteSortPoint: 0 +--- !u!114 &1988936581 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1988936577} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 98b644315d7a92842b89e04f55c48e02, type: 3} + m_Name: + m_EditorClassIdentifier: +--- !u!1 &2004669563 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 2004669564} + - component: {fileID: 2004669566} + - component: {fileID: 2004669565} + m_Layer: 0 + m_Name: Animated + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 0 +--- !u!4 &2004669564 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2004669563} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: -3.57, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 252177636} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!102 &2004669565 +TextMesh: + serializedVersion: 3 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2004669563} + m_Text: (Has Animation) + m_OffsetZ: -1.5 + m_CharacterSize: 0.075 + m_LineSpacing: 1 + m_Anchor: 4 + m_Alignment: 0 + m_TabSize: 4 + m_FontSize: 100 + m_FontStyle: 0 + m_RichText: 1 + m_Font: {fileID: 12800000, guid: a4e6a5491519adb45919dc87eff28e55, type: 3} + m_Color: + serializedVersion: 2 + rgba: 4294967295 +--- !u!23 &2004669566 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2004669563} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: a4e6a5491519adb45919dc87eff28e55, type: 3} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!21 &2007448611 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: AllIn1SpriteShader/AllIn1SpriteShader + m_Shader: {fileID: 4800000, guid: a36b7719ff0465b42ab1407d67672c5f, type: 3} + m_ShaderKeywords: ETC1_EXTERNAL_ALPHA HSV_ON + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _ColorRampTex: + m_Texture: {fileID: 2800000, guid: 279657edc397ece4b8029c727adf6ddc, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ColorRampTexGradient: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ColorSwapTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DistortTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _FadeBurnTex: + m_Texture: {fileID: 2800000, guid: 677cca399782dea41aedc1d292ecb67d, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _FadeTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _GlowTex: + 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} + - _OutlineDistortTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OutlineTex: + m_Texture: {fileID: 2800000, guid: 74087f6d03f233e4a8a142fa01f9e5cf, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OverlayTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ShineMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - _Alpha: 1 + - _AlphaCutoffValue: 0.25 + - _AlphaOutlineBlend: 1 + - _AlphaOutlineGlow: 5 + - _AlphaOutlineMinAlpha: 0 + - _AlphaOutlinePower: 1 + - _AlphaRoundThreshold: 0.5 + - _BillboardY: 0 + - _BlurHD: 0 + - _BlurIntensity: 10 + - _Brightness: 0 + - _ChromAberrAlpha: 0.4 + - _ChromAberrAmount: 1 + - _ClipUvDown: 0 + - _ClipUvLeft: 0 + - _ClipUvRight: 0 + - _ClipUvUp: 0 + - _ColorChangeLuminosity: 0 + - _ColorChangeTolerance: 0.25 + - _ColorChangeTolerance2: 0.25 + - _ColorChangeTolerance3: 0.25 + - _ColorRampBlend: 1 + - _ColorRampLuminosity: 0 + - _ColorRampOutline: 0 + - _ColorSwapBlend: 1 + - _ColorSwapBlueLuminosity: 0.5 + - _ColorSwapGreenLuminosity: 0.5 + - _ColorSwapRedLuminosity: 0.5 + - _Contrast: 1 + - _CullingOption: 0 + - _DistortAmount: 0.5 + - _DistortTexXSpeed: 5 + - _DistortTexYSpeed: 5 + - _EditorDrawers: 6 + - _FadeAmount: -0.1 + - _FadeBurnGlow: 2 + - _FadeBurnTransition: 0.075 + - _FadeBurnWidth: 0.025 + - _FishEyeUvAmount: 0.35 + - _FlickerAlpha: 0 + - _FlickerFreq: 0.2 + - _FlickerPercent: 0.05 + - _GhostBlend: 1 + - _GhostColorBoost: 1 + - _GhostTransparency: 0 + - _GlitchAmount: 3 + - _GlitchSize: 1 + - _Glow: 10 + - _GlowGlobal: 1 + - _GlowTexUsed: 0 + - _GradBlend: 1 + - _GradBoostX: 1.2 + - _GradBoostY: 1.2 + - _GradIsRadial: 0 + - _GrassManualAnim: 1 + - _GrassManualToggle: 0 + - _GrassRadialBend: 0.1 + - _GrassSpeed: 2 + - _GrassWind: 20 + - _GreyscaleBlend: 1 + - _GreyscaleLuminosity: 0 + - _GreyscaleOutline: 0 + - _HandDrawnAmount: 10 + - _HandDrawnSpeed: 5 + - _HitEffectBlend: 1 + - _HitEffectGlow: 5 + - _HologramBlend: 1 + - _HologramMaxAlpha: 1 + - _HologramMinAlpha: 0 + - _HologramStripesAlpha: 0.4 + - _HologramStripesAmount: 50 + - _HologramStripesFill: 0.4 + - _HologramStripesLuminosity: 1 + - _HologramStripesSpeed: 5 + - _HologramUnmodAmount: 0.4 + - _HsvBright: 1 + - _HsvSaturation: 1.86 + - _HsvShift: 322 + - _InnerOutlineAlpha: 1 + - _InnerOutlineGlow: 1 + - _InnerOutlineThickness: 1 + - _MaxXUV: 1 + - _MaxYUV: 1 + - _MinXUV: 0 + - _MinYUV: 0 + - _MotionBlurAngle: 0.1 + - _MotionBlurDist: 1.25 + - _MyDstMode: 10 + - _MySrcMode: 5 + - _NegativeAmount: 1 + - _OffsetUvX: 0 + - _OffsetUvY: 0 + - _OnlyInnerOutline: 0 + - _OnlyOutline: 0 + - _Outline8Directions: 0 + - _OutlineAlpha: 1 + - _OutlineDistortAmount: 0.5 + - _OutlineDistortTexXSpeed: 5 + - _OutlineDistortTexYSpeed: 5 + - _OutlineDistortToggle: 0 + - _OutlineGlow: 1.5 + - _OutlineIsPixel: 0 + - _OutlinePixelWidth: 1 + - _OutlineTexGrey: 0 + - _OutlineTexToggle: 0 + - _OutlineTexXSpeed: 10 + - _OutlineTexYSpeed: 0 + - _OutlineWidth: 0.004 + - _OverlayBlend: 1 + - _OverlayGlow: 1 + - _OverlayTextureScrollXSpeed: 0.25 + - _OverlayTextureScrollYSpeed: 0.25 + - _PinchUvAmount: 0.35 + - _PixelateSize: 32 + - _PosterizeGamma: 0.75 + - _PosterizeNumColors: 8 + - _PosterizeOutline: 0 + - _RadialClipAngle: 90 + - _RadialClipArc1: 45 + - _RadialClipArc2: 0 + - _RandomSeed: 0 + - _RectSize: 1 + - _RotateUvAmount: 0 + - _RoundWaveSpeed: 2 + - _RoundWaveStrength: 0.7 + - _ShadowAlpha: 0.5 + - _ShadowX: 0.1 + - _ShadowY: -0.05 + - _ShakeUvSpeed: 2.5 + - _ShakeUvX: 1.5 + - _ShakeUvY: 1 + - _ShineGlow: 1 + - _ShineLocation: 0.5 + - _ShineRotate: 0 + - _ShineWidth: 0.1 + - _TextureScrollXSpeed: 1 + - _TextureScrollYSpeed: 0 + - _TwistUvAmount: 1 + - _TwistUvPosX: 0.5 + - _TwistUvPosY: 0.5 + - _TwistUvRadius: 0.75 + - _WarpScale: 0.5 + - _WarpSpeed: 8 + - _WarpStrength: 0.025 + - _WaveAmount: 7 + - _WaveSpeed: 10 + - _WaveStrength: 7.5 + - _WaveX: 0 + - _WaveY: 0.5 + - _ZTestMode: 4 + - _ZWrite: 0 + - _ZoomUvAmount: 0.5 + m_Colors: + - ColorSwapRed: {r: 1, g: 1, b: 1, a: 1} + - _AlphaOutlineColor: {r: 1, g: 1, b: 1, a: 1} + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _ColorChangeNewCol: {r: 1, g: 1, b: 0, a: 1} + - _ColorChangeNewCol2: {r: 1, g: 1, b: 0, a: 1} + - _ColorChangeNewCol3: {r: 1, g: 1, b: 0, a: 1} + - _ColorChangeTarget: {r: 1, g: 0, b: 0, a: 1} + - _ColorChangeTarget2: {r: 1, g: 0, b: 0, a: 1} + - _ColorChangeTarget3: {r: 1, g: 0, b: 0, a: 1} + - _ColorSwapBlue: {r: 1, g: 1, b: 1, a: 1} + - _ColorSwapGreen: {r: 1, g: 1, b: 1, a: 1} + - _ColorSwapRed: {r: 1, g: 1, b: 1, a: 1} + - _FadeBurnColor: {r: 1, g: 1, b: 0, a: 1} + - _GlowColor: {r: 1, g: 1, b: 1, a: 1} + - _GradBotLeftCol: {r: 0, g: 0, b: 1, a: 1} + - _GradBotRightCol: {r: 0, g: 0, b: 1, a: 1} + - _GradTopLeftCol: {r: 1, g: 0, b: 0, a: 1} + - _GradTopRightCol: {r: 1, g: 0, b: 0, a: 1} + - _GreyscaleTintColor: {r: 1, g: 1, b: 1, a: 1} + - _HitEffectColor: {r: 1, g: 1, b: 1, a: 1} + - _HologramStripeColor: {r: 1, g: 1, b: 1, a: 1} + - _InnerOutlineColor: {r: 1, g: 0, b: 0, a: 1} + - _OutlineColor: {r: 1, g: 1, b: 1, a: 1} + - _OverlayColor: {r: 1, g: 1, b: 1, a: 1} + - _ShadowColor: {r: 0, g: 0, b: 0, a: 1} + - _ShineColor: {r: 1, g: 1, b: 1, a: 1} +--- !u!1 &2008035788 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 2008035789} + - component: {fileID: 2008035791} + - component: {fileID: 2008035790} + m_Layer: 0 + m_Name: Title + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &2008035789 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2008035788} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: -3.1267126, z: 0} + m_LocalScale: {x: 1.2457023, y: 1.2457023, z: 1.2457023} + m_Children: [] + m_Father: {fileID: 357954209} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!102 &2008035790 +TextMesh: + serializedVersion: 3 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2008035788} + m_Text: Twisted Face + m_OffsetZ: -1.5 + m_CharacterSize: 0.075 + m_LineSpacing: 1 + m_Anchor: 4 + m_Alignment: 0 + m_TabSize: 4 + m_FontSize: 100 + m_FontStyle: 0 + m_RichText: 1 + m_Font: {fileID: 12800000, guid: a4e6a5491519adb45919dc87eff28e55, type: 3} + m_Color: + serializedVersion: 2 + rgba: 4294967295 +--- !u!23 &2008035791 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2008035788} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 10100, guid: 0000000000000000e000000000000000, type: 0} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!1 &2018750311 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 2018750312} + - component: {fileID: 2018750314} + - component: {fileID: 2018750313} + m_Layer: 0 + m_Name: Title + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &2018750312 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2018750311} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: -2.51, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 2045252512} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!102 &2018750313 +TextMesh: + serializedVersion: 3 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2018750311} + m_Text: Hologram + m_OffsetZ: -1.5 + m_CharacterSize: 0.075 + m_LineSpacing: 1 + m_Anchor: 4 + m_Alignment: 0 + m_TabSize: 4 + m_FontSize: 100 + m_FontStyle: 0 + m_RichText: 1 + m_Font: {fileID: 12800000, guid: a4e6a5491519adb45919dc87eff28e55, type: 3} + m_Color: + serializedVersion: 2 + rgba: 4294967295 +--- !u!23 &2018750314 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2018750311} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 10100, guid: 0000000000000000e000000000000000, type: 0} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!1 &2023359957 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 2023359958} + - component: {fileID: 2023359960} + - component: {fileID: 2023359959} + m_Layer: 0 + m_Name: Title + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &2023359958 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2023359957} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: -2.51, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 939106332} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!102 &2023359959 +TextMesh: + serializedVersion: 3 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2023359957} + m_Text: Motion Blur + m_OffsetZ: -1.5 + m_CharacterSize: 0.075 + m_LineSpacing: 1 + m_Anchor: 4 + m_Alignment: 0 + m_TabSize: 4 + m_FontSize: 100 + m_FontStyle: 0 + m_RichText: 1 + m_Font: {fileID: 12800000, guid: a4e6a5491519adb45919dc87eff28e55, type: 3} + m_Color: + serializedVersion: 2 + rgba: 4294967295 +--- !u!23 &2023359960 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2023359957} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 10100, guid: 0000000000000000e000000000000000, type: 0} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!21 &2023436102 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: AllIn1SpriteShader/AllIn1SpriteShader + m_Shader: {fileID: 4800000, guid: a36b7719ff0465b42ab1407d67672c5f, type: 3} + m_ShaderKeywords: COLORSWAP_ON ETC1_EXTERNAL_ALPHA GLOWTEX_ON GLOW_ON _GLOWTEXUSED_ON + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _ColorRampTex: + m_Texture: {fileID: 2800000, guid: 279657edc397ece4b8029c727adf6ddc, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ColorRampTexGradient: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ColorSwapTex: + m_Texture: {fileID: 2800000, guid: 065da6c7b90ca904dab9cbc6b415fd19, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DistortTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _FadeBurnTex: + m_Texture: {fileID: 2800000, guid: 677cca399782dea41aedc1d292ecb67d, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _FadeTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _GlowTex: + m_Texture: {fileID: 2800000, guid: 3d311990b7c2c59478bacea537a60a53, type: 3} + 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} + - _OutlineDistortTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OutlineTex: + m_Texture: {fileID: 2800000, guid: 74087f6d03f233e4a8a142fa01f9e5cf, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OverlayTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ShineMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - _Alpha: 1 + - _AlphaCutoffValue: 0.25 + - _AlphaOutlineBlend: 1 + - _AlphaOutlineGlow: 5 + - _AlphaOutlineMinAlpha: 0 + - _AlphaOutlinePower: 1 + - _AlphaRoundThreshold: 0.5 + - _BillboardY: 0 + - _BlurHD: 0 + - _BlurIntensity: 10 + - _Brightness: 0 + - _ChromAberrAlpha: 0.4 + - _ChromAberrAmount: 1 + - _ClipUvDown: 0 + - _ClipUvLeft: 0 + - _ClipUvRight: 0 + - _ClipUvUp: 0 + - _ColorChangeLuminosity: 0 + - _ColorChangeTolerance: 0.25 + - _ColorChangeTolerance2: 0.25 + - _ColorChangeTolerance3: 0.25 + - _ColorRampBlend: 1 + - _ColorRampLuminosity: 0 + - _ColorRampOutline: 0 + - _ColorSwapBlend: 1 + - _ColorSwapBlueLuminosity: 0.5 + - _ColorSwapGreenLuminosity: 0.163 + - _ColorSwapRedLuminosity: 0.5 + - _Contrast: 1 + - _CullingOption: 0 + - _DistortAmount: 0.5 + - _DistortTexXSpeed: 5 + - _DistortTexYSpeed: 5 + - _EditorDrawers: 6 + - _FadeAmount: -0.1 + - _FadeBurnGlow: 2 + - _FadeBurnTransition: 0.075 + - _FadeBurnWidth: 0.025 + - _FishEyeUvAmount: 0.35 + - _FlickerAlpha: 0 + - _FlickerFreq: 0.2 + - _FlickerPercent: 0.05 + - _GhostBlend: 1 + - _GhostColorBoost: 1 + - _GhostTransparency: 0 + - _GlitchAmount: 3 + - _GlitchSize: 1 + - _Glow: 4.1 + - _GlowGlobal: 1 + - _GlowTexUsed: 1 + - _GradBlend: 1 + - _GradBoostX: 1.2 + - _GradBoostY: 1.2 + - _GradIsRadial: 0 + - _GrassManualAnim: 1 + - _GrassManualToggle: 0 + - _GrassRadialBend: 0.1 + - _GrassSpeed: 2 + - _GrassWind: 20 + - _GreyscaleBlend: 1 + - _GreyscaleLuminosity: 0 + - _GreyscaleOutline: 0 + - _HandDrawnAmount: 10 + - _HandDrawnSpeed: 5 + - _HitEffectBlend: 1 + - _HitEffectGlow: 5 + - _HologramBlend: 1 + - _HologramMaxAlpha: 0.75 + - _HologramMinAlpha: 0.1 + - _HologramStripesAmount: 0.1 + - _HologramStripesSpeed: 4.5 + - _HologramUnmodAmount: 0 + - _HsvBright: 1 + - _HsvSaturation: 1.66 + - _HsvShift: 180 + - _InnerOutlineAlpha: 1 + - _InnerOutlineGlow: 1 + - _InnerOutlineThickness: 1 + - _MaxXUV: 1 + - _MaxYUV: 1 + - _MinXUV: 0 + - _MinYUV: 0 + - _MotionBlurAngle: 0.1 + - _MotionBlurDist: 1.25 + - _MyDstMode: 10 + - _MySrcMode: 5 + - _NegativeAmount: 1 + - _OffsetUvX: 0 + - _OffsetUvY: 0 + - _OnlyInnerOutline: 0 + - _OnlyOutline: 0 + - _Outline8Directions: 0 + - _OutlineAlpha: 1 + - _OutlineDistortAmount: 0.5 + - _OutlineDistortTexXSpeed: 5 + - _OutlineDistortTexYSpeed: 5 + - _OutlineDistortToggle: 0 + - _OutlineGlow: 1.5 + - _OutlineIsPixel: 0 + - _OutlinePixelWidth: 1 + - _OutlineTexGrey: 0 + - _OutlineTexToggle: 0 + - _OutlineTexXSpeed: 10 + - _OutlineTexYSpeed: 0 + - _OutlineWidth: 0.004 + - _OverlayBlend: 1 + - _OverlayGlow: 1 + - _OverlayTextureScrollXSpeed: 0.25 + - _OverlayTextureScrollYSpeed: 0.25 + - _PinchUvAmount: 0.35 + - _PixelateSize: 32 + - _PosterizeGamma: 0.75 + - _PosterizeNumColors: 8 + - _PosterizeOutline: 0 + - _RadialClip: 45 + - _RadialClip2: 0 + - _RadialClipAngle: 90 + - _RadialClipArc1: 45 + - _RadialClipArc2: 0 + - _RadialStartAngle: 90 + - _RandomSeed: 0 + - _RectSize: 1 + - _RotateUvAmount: 0 + - _RoundWaveSpeed: 2 + - _RoundWaveStrength: 0.7 + - _ShadowAlpha: 0.5 + - _ShadowX: 0.1 + - _ShadowY: -0.05 + - _ShakeUvSpeed: 2.5 + - _ShakeUvX: 1.5 + - _ShakeUvY: 1 + - _ShineGlow: 1 + - _ShineLocation: 0.5 + - _ShineRotate: 0 + - _ShineWidth: 0.1 + - _TextureScrollXSpeed: 1 + - _TextureScrollYSpeed: 0 + - _TwistUvAmount: 1 + - _TwistUvPosX: 0.5 + - _TwistUvPosY: 0.5 + - _TwistUvRadius: 0.75 + - _WarpScale: 0.5 + - _WarpSpeed: 8 + - _WarpStrength: 0.025 + - _WaveAmount: 7 + - _WaveSpeed: 10 + - _WaveStrength: 7.5 + - _WaveX: 0 + - _WaveY: 0.5 + - _ZTestMode: 4 + - _ZWrite: 0 + - _ZoomUvAmount: 0.5 + m_Colors: + - ColorSwapRed: {r: 1, g: 1, b: 1, a: 1} + - _AlphaOutlineColor: {r: 1, g: 1, b: 1, a: 1} + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _ColorChangeNewCol: {r: 1, g: 1, b: 0, a: 1} + - _ColorChangeNewCol2: {r: 1, g: 1, b: 0, a: 1} + - _ColorChangeNewCol3: {r: 1, g: 1, b: 0, a: 1} + - _ColorChangeTarget: {r: 1, g: 0, b: 0, a: 1} + - _ColorChangeTarget2: {r: 1, g: 0, b: 0, a: 1} + - _ColorChangeTarget3: {r: 1, g: 0, b: 0, a: 1} + - _ColorSwapBlue: {r: 1, g: 0.6144985, b: 0, a: 1} + - _ColorSwapGreen: {r: 0, g: 0.57254905, b: 1.7176471, a: 1} + - _ColorSwapRed: {r: 1, g: 0.9806782, b: 0, a: 1} + - _FadeBurnColor: {r: 1, g: 1, b: 0, a: 1} + - _GlowColor: {r: 1, g: 0.59364164, b: 0, a: 1} + - _GradBotLeftCol: {r: 0, g: 0, b: 1, a: 1} + - _GradBotRightCol: {r: 0, g: 0, b: 1, a: 1} + - _GradTopLeftCol: {r: 1, g: 0, b: 0, a: 1} + - _GradTopRightCol: {r: 1, g: 0, b: 0, a: 1} + - _GreyscaleTintColor: {r: 1, g: 1, b: 1, a: 1} + - _HitEffectColor: {r: 1, g: 1, b: 1, a: 1} + - _HologramStripeColor: {r: 0, g: 1, b: 1, a: 1} + - _InnerOutlineColor: {r: 1, g: 0, b: 0, a: 1} + - _OutlineColor: {r: 1, g: 1, b: 1, a: 1} + - _OverlayColor: {r: 1, g: 1, b: 1, a: 1} + - _ShadowColor: {r: 0, g: 0, b: 0, a: 1} + - _ShineColor: {r: 1, g: 1, b: 1, a: 1} +--- !u!1 &2035943843 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 2035943844} + - component: {fileID: 2035943847} + - component: {fileID: 2035943846} + m_Layer: 0 + m_Name: Blurred Back + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &2035943844 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2035943843} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 130, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 1937897985} + - {fileID: 1809913717} + - {fileID: 1113550345} + m_Father: {fileID: 1563905016} + m_RootOrder: 13 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &2035943846 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2035943843} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 98b644315d7a92842b89e04f55c48e02, type: 3} + m_Name: + m_EditorClassIdentifier: +--- !u!212 &2035943847 +SpriteRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2035943843} + m_Enabled: 1 + m_CastShadows: 0 + m_ReceiveShadows: 0 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 727703726} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 0 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_Sprite: {fileID: 21300000, guid: 758ac31a9bff9ac4181f54de54a6ecb7, type: 3} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_FlipX: 0 + m_FlipY: 0 + m_DrawMode: 0 + m_Size: {x: 12.8, y: 6.4} + m_AdaptiveModeThreshold: 0.5 + m_SpriteTileMode: 0 + m_WasSpriteAssigned: 1 + m_MaskInteraction: 0 + m_SpriteSortPoint: 0 +--- !u!1 &2036092932 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 2036092933} + - component: {fileID: 2036092934} + - component: {fileID: 2036092935} + m_Layer: 0 + m_Name: 1.Color Effects + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &2036092933 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2036092932} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 4825911116503289154} + - {fileID: 1120052622} + - {fileID: 1613686741} + - {fileID: 290590332} + - {fileID: 419407226} + - {fileID: 1073973762} + - {fileID: 312669278} + - {fileID: 471382084} + - {fileID: 984096428} + - {fileID: 1923390774} + - {fileID: 1931308735} + - {fileID: 1229041066} + - {fileID: 1313138820} + - {fileID: 1988936578} + - {fileID: 597182738} + - {fileID: 746759203} + - {fileID: 1434614528} + - {fileID: 1028271463} + - {fileID: 586081879} + - {fileID: 944684573} + - {fileID: 1767383824} + - {fileID: 939106332} + - {fileID: 368348656} + - {fileID: 1286689243} + - {fileID: 1813870144} + - {fileID: 485976056} + - {fileID: 1447921189} + - {fileID: 420059981} + - {fileID: 548255500} + - {fileID: 1073566156} + - {fileID: 1123731223} + - {fileID: 1687594936} + m_Father: {fileID: 732186310} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &2036092934 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2036092932} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 6972382efdee4c642812251660f0c4bb, type: 3} + m_Name: + m_EditorClassIdentifier: + radius: 40 + rotateSpeed: 10 +--- !u!114 &2036092935 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2036092932} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 681095680e77fad40a6dd907b8ba358b, type: 3} + m_Name: + m_EditorClassIdentifier: + paddingX: 10 +--- !u!1 &2045252511 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 2045252512} + - component: {fileID: 2045252515} + - component: {fileID: 2045252514} + - component: {fileID: 2045252516} + m_Layer: 0 + m_Name: Hologram + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &2045252512 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2045252511} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 10, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 2018750312} + - {fileID: 1194409627} + m_Father: {fileID: 1563905016} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &2045252514 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2045252511} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 98b644315d7a92842b89e04f55c48e02, type: 3} + m_Name: + m_EditorClassIdentifier: +--- !u!212 &2045252515 +SpriteRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2045252511} + m_Enabled: 1 + m_CastShadows: 0 + m_ReceiveShadows: 0 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 1363957141} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 0 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_Sprite: {fileID: 21300000, guid: 519dafacd208bb64c83d5124be03b09d, type: 3} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_FlipX: 0 + m_FlipY: 0 + m_DrawMode: 0 + m_Size: {x: 5.12, y: 5.12} + m_AdaptiveModeThreshold: 0.5 + m_SpriteTileMode: 0 + m_WasSpriteAssigned: 1 + m_MaskInteraction: 0 + m_SpriteSortPoint: 0 +--- !u!95 &2045252516 +Animator: + serializedVersion: 3 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2045252511} + m_Enabled: 1 + m_Avatar: {fileID: 0} + m_Controller: {fileID: 9100000, guid: ad5ae64e9a03a1a40889385b2d0f2b89, type: 2} + m_CullingMode: 0 + m_UpdateMode: 0 + m_ApplyRootMotion: 0 + m_LinearVelocityBlending: 0 + m_WarningMessage: + m_HasTransformHierarchy: 1 + m_AllowConstantClipSamplingOptimization: 1 + m_KeepAnimatorControllerStateOnDisable: 0 +--- !u!21 &2054684528 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: AllIn1SpriteShader/AllIn1SpriteShader + m_Shader: {fileID: 4800000, guid: a36b7719ff0465b42ab1407d67672c5f, type: 3} + m_ShaderKeywords: ETC1_EXTERNAL_ALPHA GLOW_ON HSV_ON OUTBASE8DIR_ON OUTBASE_ON + OUTTEX_ON POLARUV_ON TEXTURESCROLL_ON _OUTLINE8DIRECTIONS_ON _OUTLINETEXTOGGLE_ON + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _ColorRampTex: + m_Texture: {fileID: 2800000, guid: 279657edc397ece4b8029c727adf6ddc, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ColorRampTexGradient: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ColorSwapTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DistortTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _FadeBurnTex: + m_Texture: {fileID: 2800000, guid: 32e8df0008bebe746b1681a71c61f31c, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _FadeTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _GlowTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MainTex: + m_Texture: {fileID: 0} + m_Scale: {x: 3, y: 3} + m_Offset: {x: 0, y: 0} + - _OutlineDistortTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OutlineTex: + m_Texture: {fileID: 2800000, guid: 74087f6d03f233e4a8a142fa01f9e5cf, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OverlayTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ShineMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - _Alpha: 1 + - _AlphaCutoffValue: 0.25 + - _AlphaOutlineBlend: 1 + - _AlphaOutlineGlow: 5 + - _AlphaOutlineMinAlpha: 0 + - _AlphaOutlinePower: 1 + - _AlphaRoundThreshold: 0.5 + - _BillboardY: 0 + - _BlurHD: 0 + - _BlurIntensity: 10 + - _Brightness: 0 + - _ChromAberrAlpha: 0.4 + - _ChromAberrAmount: 1 + - _ClipUvDown: 1 + - _ClipUvLeft: 1 + - _ClipUvRight: 1 + - _ClipUvUp: 1 + - _ColorChangeLuminosity: 0 + - _ColorChangeTolerance: 0.25 + - _ColorChangeTolerance2: 0.25 + - _ColorChangeTolerance3: 0.25 + - _ColorRampBlend: 1 + - _ColorRampLuminosity: 0 + - _ColorRampOutline: 0 + - _ColorSwapBlend: 1 + - _ColorSwapBlueLuminosity: 0.5 + - _ColorSwapGreenLuminosity: 0.5 + - _ColorSwapRedLuminosity: 0.5 + - _Contrast: 1 + - _CullingOption: 0 + - _DistortAmount: 0.5 + - _DistortTexXSpeed: 5 + - _DistortTexYSpeed: 5 + - _EditorDrawers: 6 + - _FadeAmount: -0.1 + - _FadeBurnGlow: 2 + - _FadeBurnTransition: 0.075 + - _FadeBurnWidth: 0.025 + - _FishEyeUvAmount: 0.35 + - _FlickerAlpha: 0 + - _FlickerFreq: 0.2 + - _FlickerPercent: 0.05 + - _GhostBlend: 1 + - _GhostColorBoost: 1 + - _GhostTransparency: 0 + - _GlitchAmount: 3 + - _GlitchSize: 1 + - _Glow: 1.2 + - _GlowGlobal: 1 + - _GlowTexUsed: 0 + - _GradBlend: 0.465 + - _GradBoostX: 1.2 + - _GradBoostY: 1.2 + - _GradIsRadial: 0 + - _GrassManualAnim: 1 + - _GrassManualToggle: 0 + - _GrassRadialBend: 0.25 + - _GrassSpeed: 2 + - _GrassWind: 20 + - _GreyscaleBlend: 1 + - _GreyscaleLuminosity: 0 + - _GreyscaleOutline: 0 + - _HandDrawnAmount: 10 + - _HandDrawnSpeed: 5 + - _HitEffectBlend: 1 + - _HitEffectGlow: 5 + - _HologramBlend: 1 + - _HologramFlickerAlpha: 0 + - _HologramFlickerFreq: 0.2 + - _HologramFlickerPercent: 0.05 + - _HologramMaxAlpha: 1 + - _HologramMinAlpha: 0 + - _HologramStripesAlpha: 0.4 + - _HologramStripesAmount: 50 + - _HologramStripesFill: 0.4 + - _HologramStripesLuminosity: 1 + - _HologramStripesSpeed: 5 + - _HologramUnmodAmount: 0.4 + - _HsvBright: 1 + - _HsvSaturation: 1 + - _HsvShift: 0 + - _InnerOutlineAlpha: 1 + - _InnerOutlineGlow: 1 + - _InnerOutlineThickness: 1 + - _MaxXUV: 1 + - _MaxYUV: 1 + - _MinXUV: 0 + - _MinYUV: 0 + - _MotionBlurAngle: 0.1 + - _MotionBlurDist: 1.25 + - _MyDstMode: 10 + - _MySrcMode: 5 + - _NegativeAmount: 1 + - _OffsetUvX: 0 + - _OffsetUvY: 0 + - _OnlyInnerOutline: 0 + - _OnlyOutline: 0 + - _Outline8Directions: 1 + - _OutlineAlpha: 1 + - _OutlineDistortAmount: 0.5 + - _OutlineDistortTexXSpeed: 5 + - _OutlineDistortTexYSpeed: 5 + - _OutlineDistortToggle: 0 + - _OutlineGlow: 1.5 + - _OutlineIsPixel: 0 + - _OutlinePixelWidth: 1 + - _OutlineTexGrey: 0 + - _OutlineTexToggle: 1 + - _OutlineTexXSpeed: 10 + - _OutlineTexYSpeed: 0 + - _OutlineWidth: 0.0204 + - _OverlayBlend: 1 + - _OverlayGlow: 1 + - _OverlayTextureScrollXSpeed: 0.25 + - _OverlayTextureScrollYSpeed: 0.25 + - _PinchUvAmount: 0.35 + - _PixelateSize: 32 + - _PosterizeGamma: 0.75 + - _PosterizeNumColors: 8 + - _PosterizeOutline: 0 + - _RadialClip: 0 + - _RadialClip2: 45 + - _RadialClipAngle: 90 + - _RadialClipArc1: 45 + - _RadialClipArc2: 0 + - _RadialStartAngle: 90 + - _RandomSeed: 0 + - _RectSize: 1 + - _RotateUvAmount: 0 + - _RoundWaveSpeed: 2 + - _RoundWaveStrength: 0.7 + - _ShadowAlpha: 0.5 + - _ShadowX: 0.1 + - _ShadowY: -0.05 + - _ShakeUvSpeed: 2.5 + - _ShakeUvX: 1.5 + - _ShakeUvY: 1 + - _ShineGlow: 1 + - _ShineLocation: 0.5 + - _ShineRotate: 0 + - _ShineWidth: 0.1 + - _TextureScrollXSpeed: 1 + - _TextureScrollYSpeed: 1.13 + - _TwistUvAmount: 1 + - _TwistUvPosX: 0.5 + - _TwistUvPosY: 0.5 + - _TwistUvRadius: 0.75 + - _WarpScale: 0.5 + - _WarpSpeed: 8 + - _WarpStrength: 0.025 + - _WaveAmount: 7 + - _WaveSpeed: 10 + - _WaveStrength: 7.5 + - _WaveX: 0 + - _WaveY: 0.5 + - _ZTestMode: 4 + - _ZWrite: 0 + - _ZoomUvAmount: 0.5 + m_Colors: + - ColorSwapRed: {r: 1, g: 1, b: 1, a: 1} + - _AlphaOutlineColor: {r: 1, g: 1, b: 1, a: 1} + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _ColorChangeNewCol: {r: 1, g: 1, b: 0, a: 1} + - _ColorChangeNewCol2: {r: 1, g: 1, b: 0, a: 1} + - _ColorChangeNewCol3: {r: 1, g: 1, b: 0, a: 1} + - _ColorChangeTarget: {r: 1, g: 0, b: 0, a: 1} + - _ColorChangeTarget2: {r: 1, g: 0, b: 0, a: 1} + - _ColorChangeTarget3: {r: 1, g: 0, b: 0, a: 1} + - _ColorSwapBlue: {r: 1, g: 1, b: 1, a: 1} + - _ColorSwapGreen: {r: 1, g: 1, b: 1, a: 1} + - _ColorSwapRed: {r: 1, g: 1, b: 1, a: 1} + - _FadeBurnColor: {r: 1, g: 1, b: 0, a: 1} + - _GlowColor: {r: 1, g: 1, b: 1, a: 1} + - _GradBotLeftCol: {r: 0, g: 0, b: 1, a: 1} + - _GradBotRightCol: {r: 0, g: 0, b: 1, a: 1} + - _GradTopLeftCol: {r: 1, g: 0, b: 0, a: 1} + - _GradTopRightCol: {r: 1, g: 0, b: 0, a: 1} + - _GreyscaleTintColor: {r: 1, g: 1, b: 1, a: 1} + - _HitEffectColor: {r: 1, g: 1, b: 1, a: 1} + - _HologramStripeColor: {r: 1, g: 1, b: 1, a: 1} + - _InnerOutlineColor: {r: 1, g: 0, b: 0, a: 1} + - _OutlineColor: {r: 1, g: 1, b: 1, a: 1} + - _OverlayColor: {r: 1, g: 1, b: 1, a: 1} + - _ShadowColor: {r: 0, g: 0, b: 0, a: 1} + - _ShineColor: {r: 1, g: 1, b: 1, a: 1} +--- !u!21 &2061184730 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: AllIn1SpriteShader/AllIn1SpriteShader + m_Shader: {fileID: 4800000, guid: a36b7719ff0465b42ab1407d67672c5f, type: 3} + m_ShaderKeywords: ETC1_EXTERNAL_ALPHA HSV_ON + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _ColorRampTex: + m_Texture: {fileID: 2800000, guid: 279657edc397ece4b8029c727adf6ddc, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ColorRampTexGradient: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ColorSwapTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DistortTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _FadeBurnTex: + m_Texture: {fileID: 2800000, guid: 32e8df0008bebe746b1681a71c61f31c, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _FadeTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _GlowTex: + 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} + - _OutlineDistortTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OutlineTex: + m_Texture: {fileID: 2800000, guid: 74087f6d03f233e4a8a142fa01f9e5cf, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OverlayTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ShineMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - _Alpha: 1 + - _AlphaCutoffValue: 0.25 + - _AlphaOutlineBlend: 1 + - _AlphaOutlineGlow: 5 + - _AlphaOutlineMinAlpha: 0 + - _AlphaOutlinePower: 1 + - _AlphaRoundThreshold: 0.5 + - _BillboardY: 0 + - _BlurHD: 0 + - _BlurIntensity: 10 + - _Brightness: 0 + - _ChromAberrAlpha: 0.4 + - _ChromAberrAmount: 1 + - _ClipUvDown: 1 + - _ClipUvLeft: 1 + - _ClipUvRight: 1 + - _ClipUvUp: 1 + - _ColorChangeLuminosity: 0 + - _ColorChangeTolerance: 0.25 + - _ColorChangeTolerance2: 0.25 + - _ColorChangeTolerance3: 0.25 + - _ColorRampBlend: 1 + - _ColorRampLuminosity: 0 + - _ColorRampOutline: 0 + - _ColorSwapBlend: 1 + - _ColorSwapBlueLuminosity: 0.5 + - _ColorSwapGreenLuminosity: 0.5 + - _ColorSwapRedLuminosity: 0.5 + - _Contrast: 1 + - _CullingOption: 0 + - _DistortAmount: 0.5 + - _DistortTexXSpeed: 5 + - _DistortTexYSpeed: 5 + - _EditorDrawers: 6 + - _FadeAmount: -0.1 + - _FadeBurnGlow: 2 + - _FadeBurnTransition: 0.075 + - _FadeBurnWidth: 0.025 + - _FishEyeUvAmount: 0.35 + - _FlickerAlpha: 0 + - _FlickerFreq: 0.2 + - _FlickerPercent: 0.05 + - _GhostBlend: 1 + - _GhostColorBoost: 1 + - _GhostTransparency: 0 + - _GlitchAmount: 3 + - _GlitchSize: 1 + - _Glow: 10 + - _GlowGlobal: 1 + - _GlowTexUsed: 0 + - _GradBlend: 1 + - _GradBoostX: 1.2 + - _GradBoostY: 1.2 + - _GradIsRadial: 0 + - _GrassManualAnim: 1 + - _GrassManualToggle: 0 + - _GrassRadialBend: 0.25 + - _GrassSpeed: 2 + - _GrassWind: 20 + - _GreyscaleBlend: 1 + - _GreyscaleLuminosity: 0 + - _GreyscaleOutline: 0 + - _HandDrawnAmount: 10 + - _HandDrawnSpeed: 5 + - _HitEffectBlend: 1 + - _HitEffectGlow: 5 + - _HologramBlend: 1 + - _HologramFlickerAlpha: 0 + - _HologramFlickerFreq: 0.2 + - _HologramFlickerPercent: 0.05 + - _HologramMaxAlpha: 1 + - _HologramMinAlpha: 0 + - _HologramStripesAlpha: 0.4 + - _HologramStripesAmount: 50 + - _HologramStripesFill: 0.4 + - _HologramStripesLuminosity: 1 + - _HologramStripesSpeed: 5 + - _HologramUnmodAmount: 0.4 + - _HsvBright: 1.03 + - _HsvSaturation: 1.262 + - _HsvShift: 251 + - _InnerOutlineAlpha: 1 + - _InnerOutlineGlow: 1 + - _InnerOutlineThickness: 1 + - _MaxXUV: 1 + - _MaxYUV: 1 + - _MinXUV: 0 + - _MinYUV: 0 + - _MotionBlurAngle: 0.1 + - _MotionBlurDist: 1.25 + - _MyDstMode: 10 + - _MySrcMode: 5 + - _NegativeAmount: 1 + - _OffsetUvX: 0 + - _OffsetUvY: 0 + - _OnlyInnerOutline: 0 + - _OnlyOutline: 0 + - _Outline8Directions: 0 + - _OutlineAlpha: 1 + - _OutlineDistortAmount: 0.5 + - _OutlineDistortTexXSpeed: 5 + - _OutlineDistortTexYSpeed: 5 + - _OutlineDistortToggle: 0 + - _OutlineGlow: 1.5 + - _OutlineIsPixel: 0 + - _OutlinePixelWidth: 1 + - _OutlineTexGrey: 0 + - _OutlineTexToggle: 0 + - _OutlineTexXSpeed: 10 + - _OutlineTexYSpeed: 0 + - _OutlineWidth: 0.004 + - _OverlayBlend: 1 + - _OverlayGlow: 1 + - _OverlayTextureScrollXSpeed: 0.25 + - _OverlayTextureScrollYSpeed: 0.25 + - _PinchUvAmount: 0.35 + - _PixelateSize: 32 + - _PosterizeGamma: 0.75 + - _PosterizeNumColors: 8 + - _PosterizeOutline: 0 + - _RadialClipAngle: 90 + - _RadialClipArc1: 45 + - _RadialClipArc2: 0 + - _RandomSeed: 0 + - _RectSize: 1 + - _RotateUvAmount: 0 + - _RoundWaveSpeed: 2 + - _RoundWaveStrength: 0.7 + - _ShadowAlpha: 0.5 + - _ShadowX: 0.1 + - _ShadowY: -0.05 + - _ShakeUvSpeed: 2.5 + - _ShakeUvX: 1.5 + - _ShakeUvY: 1 + - _ShineGlow: 1 + - _ShineLocation: 0.5 + - _ShineRotate: 0 + - _ShineWidth: 0.1 + - _TextureScrollXSpeed: 1 + - _TextureScrollYSpeed: 0 + - _TwistUvAmount: 1 + - _TwistUvPosX: 0.5 + - _TwistUvPosY: 0.5 + - _TwistUvRadius: 0.75 + - _WarpScale: 0.5 + - _WarpSpeed: 8 + - _WarpStrength: 0.025 + - _WaveAmount: 7 + - _WaveSpeed: 10 + - _WaveStrength: 7.5 + - _WaveX: 0 + - _WaveY: 0.5 + - _ZTestMode: 4 + - _ZWrite: 0 + - _ZoomUvAmount: 0.5 + m_Colors: + - ColorSwapRed: {r: 1, g: 1, b: 1, a: 1} + - _AlphaOutlineColor: {r: 1, g: 1, b: 1, a: 1} + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _ColorChangeNewCol: {r: 1, g: 1, b: 0, a: 1} + - _ColorChangeNewCol2: {r: 1, g: 1, b: 0, a: 1} + - _ColorChangeNewCol3: {r: 1, g: 1, b: 0, a: 1} + - _ColorChangeTarget: {r: 1, g: 0, b: 0, a: 1} + - _ColorChangeTarget2: {r: 1, g: 0, b: 0, a: 1} + - _ColorChangeTarget3: {r: 1, g: 0, b: 0, a: 1} + - _ColorSwapBlue: {r: 1, g: 1, b: 1, a: 1} + - _ColorSwapGreen: {r: 1, g: 1, b: 1, a: 1} + - _ColorSwapRed: {r: 1, g: 1, b: 1, a: 1} + - _FadeBurnColor: {r: 1, g: 1, b: 0, a: 1} + - _GlowColor: {r: 1, g: 1, b: 1, a: 1} + - _GradBotLeftCol: {r: 0, g: 0, b: 1, a: 1} + - _GradBotRightCol: {r: 0, g: 0, b: 1, a: 1} + - _GradTopLeftCol: {r: 1, g: 0, b: 0, a: 1} + - _GradTopRightCol: {r: 1, g: 0, b: 0, a: 1} + - _GreyscaleTintColor: {r: 1, g: 1, b: 1, a: 1} + - _HitEffectColor: {r: 1, g: 1, b: 1, a: 1} + - _HologramStripeColor: {r: 1, g: 1, b: 1, a: 1} + - _InnerOutlineColor: {r: 1, g: 0, b: 0, a: 1} + - _OutlineColor: {r: 1, g: 1, b: 1, a: 1} + - _OverlayColor: {r: 1, g: 1, b: 1, a: 1} + - _ShadowColor: {r: 0, g: 0, b: 0, a: 1} + - _ShineColor: {r: 1, g: 1, b: 1, a: 1} +--- !u!1 &2064997617 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 2064997618} + - component: {fileID: 2064997620} + - component: {fileID: 2064997619} + m_Layer: 0 + m_Name: Title + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &2064997618 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2064997617} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: -3.1267126, z: 0} + m_LocalScale: {x: 1.2457023, y: 1.2457023, z: 1.2457023} + m_Children: [] + m_Father: {fileID: 499272004} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!102 &2064997619 +TextMesh: + serializedVersion: 3 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2064997617} + m_Text: Blurred Outline + m_OffsetZ: -1.5 + m_CharacterSize: 0.075 + m_LineSpacing: 1 + m_Anchor: 4 + m_Alignment: 0 + m_TabSize: 4 + m_FontSize: 100 + m_FontStyle: 0 + m_RichText: 1 + m_Font: {fileID: 12800000, guid: a4e6a5491519adb45919dc87eff28e55, type: 3} + m_Color: + serializedVersion: 2 + rgba: 4294967295 +--- !u!23 &2064997620 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2064997617} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 10100, guid: 0000000000000000e000000000000000, type: 0} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!1 &2065278699 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 2065278700} + - component: {fileID: 2065278702} + - component: {fileID: 2065278701} + m_Layer: 0 + m_Name: Animated + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 0 +--- !u!4 &2065278700 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2065278699} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: -3.57, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 1229041066} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!102 &2065278701 +TextMesh: + serializedVersion: 3 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2065278699} + m_Text: (Has Animation) + m_OffsetZ: -1.5 + m_CharacterSize: 0.075 + m_LineSpacing: 1 + m_Anchor: 4 + m_Alignment: 0 + m_TabSize: 4 + m_FontSize: 100 + m_FontStyle: 0 + m_RichText: 1 + m_Font: {fileID: 12800000, guid: a4e6a5491519adb45919dc87eff28e55, type: 3} + m_Color: + serializedVersion: 2 + rgba: 4294967295 +--- !u!23 &2065278702 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2065278699} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: a4e6a5491519adb45919dc87eff28e55, type: 3} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!21 &2066467196 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: AllIn1SpriteShader/AllIn1SpriteShader + m_Shader: {fileID: 4800000, guid: a36b7719ff0465b42ab1407d67672c5f, type: 3} + m_ShaderKeywords: COLORSWAP_ON ETC1_EXTERNAL_ALPHA OUTBASE8DIR_ON OUTBASE_ON _OUTLINE8DIRECTIONS_ON + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _ColorRampTex: + m_Texture: {fileID: 2800000, guid: 279657edc397ece4b8029c727adf6ddc, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ColorRampTexGradient: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ColorSwapTex: + m_Texture: {fileID: 2800000, guid: 065da6c7b90ca904dab9cbc6b415fd19, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DistortTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _FadeBurnTex: + m_Texture: {fileID: 2800000, guid: 32e8df0008bebe746b1681a71c61f31c, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _FadeTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _GlowTex: + 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} + - _OutlineDistortTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OutlineTex: + m_Texture: {fileID: 2800000, guid: 74087f6d03f233e4a8a142fa01f9e5cf, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OverlayTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ShineMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - _Alpha: 1 + - _AlphaCutoffValue: 0.25 + - _AlphaOutlineBlend: 1 + - _AlphaOutlineGlow: 5 + - _AlphaOutlineMinAlpha: 0 + - _AlphaOutlinePower: 1 + - _AlphaRoundThreshold: 0.5 + - _BillboardY: 0 + - _BlurHD: 0 + - _BlurIntensity: 10 + - _Brightness: 0 + - _ChromAberrAlpha: 0.4 + - _ChromAberrAmount: 1 + - _ClipUvDown: 1 + - _ClipUvLeft: 1 + - _ClipUvRight: 1 + - _ClipUvUp: 1 + - _ColorChangeLuminosity: 0 + - _ColorChangeTolerance: 0.25 + - _ColorChangeTolerance2: 0.25 + - _ColorChangeTolerance3: 0.25 + - _ColorRampBlend: 1 + - _ColorRampLuminosity: 0 + - _ColorRampOutline: 0 + - _ColorSwapBlend: 1 + - _ColorSwapBlueLuminosity: 0.5 + - _ColorSwapGreenLuminosity: 0.2 + - _ColorSwapRedLuminosity: 0.5 + - _Contrast: 1 + - _CullingOption: 0 + - _DistortAmount: 0.5 + - _DistortTexXSpeed: 5 + - _DistortTexYSpeed: 5 + - _EditorDrawers: 6 + - _FadeAmount: -0.1 + - _FadeBurnGlow: 2 + - _FadeBurnTransition: 0.075 + - _FadeBurnWidth: 0.025 + - _FishEyeUvAmount: 0.35 + - _FlickerAlpha: 0 + - _FlickerFreq: 0.2 + - _FlickerPercent: 0.05 + - _GhostBlend: 1 + - _GhostColorBoost: 1 + - _GhostTransparency: 0 + - _GlitchAmount: 3 + - _GlitchSize: 1 + - _Glow: 10 + - _GlowGlobal: 1 + - _GlowTexUsed: 0 + - _GradBlend: 1 + - _GradBoostX: 1.2 + - _GradBoostY: 1.2 + - _GradIsRadial: 0 + - _GrassManualAnim: 1 + - _GrassManualToggle: 0 + - _GrassRadialBend: 0.1 + - _GrassSpeed: 2 + - _GrassWind: 20 + - _GreyscaleBlend: 1 + - _GreyscaleLuminosity: 0 + - _GreyscaleOutline: 0 + - _HandDrawnAmount: 10 + - _HandDrawnSpeed: 5 + - _HitEffectBlend: 1 + - _HitEffectGlow: 5 + - _HologramBlend: 1 + - _HologramFlickerAlpha: 0 + - _HologramFlickerFreq: 0.2 + - _HologramFlickerPercent: 0.05 + - _HologramMaxAlpha: 1 + - _HologramMinAlpha: 0 + - _HologramStripesAlpha: 0.4 + - _HologramStripesAmount: 50 + - _HologramStripesFill: 0.4 + - _HologramStripesLuminosity: 1 + - _HologramStripesSpeed: 5 + - _HologramUnmodAmount: 0.4 + - _HsvBright: 1 + - _HsvSaturation: 1 + - _HsvShift: 180 + - _InnerOutlineAlpha: 1 + - _InnerOutlineGlow: 1 + - _InnerOutlineThickness: 1 + - _MaxXUV: 1 + - _MaxYUV: 1 + - _MinXUV: 0 + - _MinYUV: 0 + - _MotionBlurAngle: 0.1 + - _MotionBlurDist: 1.25 + - _MyDstMode: 10 + - _MySrcMode: 5 + - _NegativeAmount: 1 + - _OffsetUvX: 0 + - _OffsetUvY: 0 + - _OnlyInnerOutline: 0 + - _OnlyOutline: 0 + - _Outline8Directions: 1 + - _OutlineAlpha: 1 + - _OutlineDistortAmount: 0.5 + - _OutlineDistortTexXSpeed: 5 + - _OutlineDistortTexYSpeed: 5 + - _OutlineDistortToggle: 0 + - _OutlineGlow: 1.5 + - _OutlineIsPixel: 0 + - _OutlinePixelWidth: 1 + - _OutlineTexGrey: 0 + - _OutlineTexToggle: 0 + - _OutlineTexXSpeed: 10 + - _OutlineTexYSpeed: 0 + - _OutlineWidth: 0.02 + - _OverlayBlend: 1 + - _OverlayGlow: 1 + - _OverlayTextureScrollXSpeed: 0.25 + - _OverlayTextureScrollYSpeed: 0.25 + - _PinchUvAmount: 0.35 + - _PixelateSize: 32 + - _PosterizeGamma: 0.75 + - _PosterizeNumColors: 8 + - _PosterizeOutline: 0 + - _RadialClip: 45 + - _RadialClip2: 0 + - _RadialClipAngle: 90 + - _RadialClipArc1: 45 + - _RadialClipArc2: 0 + - _RadialStartAngle: 90 + - _RandomSeed: 0 + - _RectSize: 1 + - _RotateUvAmount: 0 + - _RoundWaveSpeed: 2 + - _RoundWaveStrength: 0.7 + - _ShadowAlpha: 0.5 + - _ShadowX: 0.1 + - _ShadowY: -0.05 + - _ShakeUvSpeed: 2.5 + - _ShakeUvX: 1.5 + - _ShakeUvY: 1 + - _ShineGlow: 1 + - _ShineLocation: 0.5 + - _ShineRotate: 0 + - _ShineWidth: 0.1 + - _TextureScrollXSpeed: 1 + - _TextureScrollYSpeed: 0 + - _TwistUvAmount: 1 + - _TwistUvPosX: 0.5 + - _TwistUvPosY: 0.5 + - _TwistUvRadius: 0.75 + - _WarpScale: 0.5 + - _WarpSpeed: 8 + - _WarpStrength: 0.025 + - _WaveAmount: 7 + - _WaveSpeed: 10 + - _WaveStrength: 7.5 + - _WaveX: 0 + - _WaveY: 0.5 + - _ZTestMode: 4 + - _ZWrite: 0 + - _ZoomUvAmount: 0.5 + m_Colors: + - ColorSwapRed: {r: 1, g: 0, b: 0, a: 1} + - _AlphaOutlineColor: {r: 1, g: 1, b: 1, a: 1} + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _ColorChangeNewCol: {r: 1, g: 1, b: 0, a: 1} + - _ColorChangeNewCol2: {r: 1, g: 1, b: 0, a: 1} + - _ColorChangeNewCol3: {r: 1, g: 1, b: 0, a: 1} + - _ColorChangeTarget: {r: 1, g: 0, b: 0, a: 1} + - _ColorChangeTarget2: {r: 1, g: 0, b: 0, a: 1} + - _ColorChangeTarget3: {r: 1, g: 0, b: 0, a: 1} + - _ColorSwapBlue: {r: 1, g: 1, b: 1, a: 1} + - _ColorSwapGreen: {r: 1, g: 1, b: 1, a: 1} + - _ColorSwapRed: {r: 1, g: 1, b: 1, a: 1} + - _FadeBurnColor: {r: 1, g: 1, b: 0, a: 1} + - _GlowColor: {r: 1, g: 1, b: 1, a: 1} + - _GradBotLeftCol: {r: 0, g: 0, b: 1, a: 1} + - _GradBotRightCol: {r: 0, g: 0, b: 1, a: 1} + - _GradTopLeftCol: {r: 1, g: 0, b: 0, a: 1} + - _GradTopRightCol: {r: 1, g: 0, b: 0, a: 1} + - _GreyscaleTintColor: {r: 1, g: 1, b: 1, a: 1} + - _HitEffectColor: {r: 1, g: 1, b: 1, a: 1} + - _HologramStripeColor: {r: 1, g: 1, b: 1, a: 1} + - _InnerOutlineColor: {r: 1, g: 0, b: 0, a: 1} + - _OutlineColor: {r: 1, g: 1, b: 1, a: 1} + - _OverlayColor: {r: 1, g: 1, b: 1, a: 1} + - _ShadowColor: {r: 0, g: 0, b: 0, a: 1} + - _ShineColor: {r: 1, g: 1, b: 1, a: 1} +--- !u!21 &2067098021 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: AllIn1SpriteShader/AllIn1SpriteShader + m_Shader: {fileID: 4800000, guid: a36b7719ff0465b42ab1407d67672c5f, type: 3} + m_ShaderKeywords: CLIPPING_ON ETC1_EXTERNAL_ALPHA GRADIENT_ON + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _ColorRampTex: + m_Texture: {fileID: 2800000, guid: 279657edc397ece4b8029c727adf6ddc, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ColorRampTexGradient: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ColorSwapTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DistortTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _FadeBurnTex: + m_Texture: {fileID: 2800000, guid: 32e8df0008bebe746b1681a71c61f31c, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _FadeTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _GlowTex: + 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} + - _OutlineDistortTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OutlineTex: + m_Texture: {fileID: 2800000, guid: 74087f6d03f233e4a8a142fa01f9e5cf, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OverlayTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ShineMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - _Alpha: 1 + - _AlphaCutoffValue: 0.25 + - _AlphaOutlineBlend: 1 + - _AlphaOutlineGlow: 5 + - _AlphaOutlineMinAlpha: 0 + - _AlphaOutlinePower: 1 + - _AlphaRoundThreshold: 0.5 + - _BillboardY: 0 + - _BlurHD: 0 + - _BlurIntensity: 10 + - _Brightness: 0 + - _ChromAberrAlpha: 0.4 + - _ChromAberrAmount: 1 + - _ClipUvDown: 0 + - _ClipUvLeft: 0 + - _ClipUvRight: 1 + - _ClipUvUp: 0 + - _ColorChangeLuminosity: 0 + - _ColorChangeTolerance: 0.25 + - _ColorChangeTolerance2: 0.25 + - _ColorChangeTolerance3: 0.25 + - _ColorRampBlend: 1 + - _ColorRampLuminosity: 0 + - _ColorRampOutline: 0 + - _ColorSwapBlend: 1 + - _ColorSwapBlueLuminosity: 0.5 + - _ColorSwapGreenLuminosity: 0.5 + - _ColorSwapRedLuminosity: 0.5 + - _Contrast: 1 + - _CullingOption: 0 + - _DistortAmount: 0.5 + - _DistortTexXSpeed: 5 + - _DistortTexYSpeed: 5 + - _EditorDrawers: 6 + - _FadeAmount: -0.1 + - _FadeBurnGlow: 2 + - _FadeBurnTransition: 0.075 + - _FadeBurnWidth: 0.025 + - _FishEyeUvAmount: 0.35 + - _FlickerAlpha: 0 + - _FlickerFreq: 0.2 + - _FlickerPercent: 0.05 + - _GhostBlend: 1 + - _GhostColorBoost: 1 + - _GhostTransparency: 0 + - _GlitchAmount: 3 + - _GlitchSize: 1 + - _Glow: 10 + - _GlowGlobal: 1 + - _GlowTexUsed: 0 + - _GradBlend: 1 + - _GradBoostX: 1.2 + - _GradBoostY: 1.2 + - _GradIsRadial: 0 + - _GrassManualAnim: 1 + - _GrassManualToggle: 0 + - _GrassRadialBend: 0.25 + - _GrassSpeed: 2 + - _GrassWind: 20 + - _GreyscaleBlend: 1 + - _GreyscaleLuminosity: 0 + - _GreyscaleOutline: 0 + - _HandDrawnAmount: 10 + - _HandDrawnSpeed: 5 + - _HitEffectBlend: 1 + - _HitEffectGlow: 5 + - _HologramBlend: 1 + - _HologramFlickerAlpha: 0 + - _HologramFlickerFreq: 0.2 + - _HologramFlickerPercent: 0.05 + - _HologramMaxAlpha: 1 + - _HologramMinAlpha: 0 + - _HologramStripesAlpha: 0.4 + - _HologramStripesAmount: 50 + - _HologramStripesFill: 0.4 + - _HologramStripesLuminosity: 1 + - _HologramStripesSpeed: 5 + - _HologramUnmodAmount: 0.4 + - _HsvBright: 1 + - _HsvSaturation: 1 + - _HsvShift: 180 + - _InnerOutlineAlpha: 1 + - _InnerOutlineGlow: 1 + - _InnerOutlineThickness: 1 + - _MaxXUV: 1 + - _MaxYUV: 1 + - _MinXUV: 0 + - _MinYUV: 0 + - _MotionBlurAngle: 0.1 + - _MotionBlurDist: 1.25 + - _MyDstMode: 10 + - _MySrcMode: 5 + - _NegativeAmount: 1 + - _OffsetUvX: 0 + - _OffsetUvY: 0 + - _OnlyInnerOutline: 0 + - _OnlyOutline: 0 + - _Outline8Directions: 0 + - _OutlineAlpha: 1 + - _OutlineDistortAmount: 0.5 + - _OutlineDistortTexXSpeed: 5 + - _OutlineDistortTexYSpeed: 5 + - _OutlineDistortToggle: 0 + - _OutlineGlow: 1.5 + - _OutlineIsPixel: 0 + - _OutlinePixelWidth: 1 + - _OutlineTexGrey: 0 + - _OutlineTexToggle: 0 + - _OutlineTexXSpeed: 10 + - _OutlineTexYSpeed: 0 + - _OutlineWidth: 0.004 + - _OverlayBlend: 1 + - _OverlayGlow: 1 + - _OverlayTextureScrollXSpeed: 0.25 + - _OverlayTextureScrollYSpeed: 0.25 + - _PinchUvAmount: 0.35 + - _PixelateSize: 32 + - _PosterizeGamma: 0.75 + - _PosterizeNumColors: 8 + - _PosterizeOutline: 0 + - _RadialClip: 0 + - _RadialClip2: 45 + - _RadialClipAngle: 90 + - _RadialClipArc1: 45 + - _RadialClipArc2: 0 + - _RadialStartAngle: 90 + - _RandomSeed: 0 + - _RectSize: 1 + - _RotateUvAmount: 0 + - _RoundWaveSpeed: 2 + - _RoundWaveStrength: 0.7 + - _ShadowAlpha: 0.5 + - _ShadowX: 0.1 + - _ShadowY: -0.05 + - _ShakeUvSpeed: 2.5 + - _ShakeUvX: 1.5 + - _ShakeUvY: 1 + - _ShineGlow: 1 + - _ShineLocation: 0.5 + - _ShineRotate: 0 + - _ShineWidth: 0.1 + - _TextureScrollXSpeed: 1 + - _TextureScrollYSpeed: 0 + - _TwistUvAmount: 1 + - _TwistUvPosX: 0.5 + - _TwistUvPosY: 0.5 + - _TwistUvRadius: 0.75 + - _WarpScale: 0.5 + - _WarpSpeed: 8 + - _WarpStrength: 0.025 + - _WaveAmount: 7 + - _WaveSpeed: 10 + - _WaveStrength: 7.5 + - _WaveX: 0 + - _WaveY: 0.5 + - _ZTestMode: 4 + - _ZWrite: 0 + - _ZoomUvAmount: 0.5 + m_Colors: + - ColorSwapRed: {r: 1, g: 1, b: 1, a: 1} + - _AlphaOutlineColor: {r: 1, g: 1, b: 1, a: 1} + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _ColorChangeNewCol: {r: 1, g: 1, b: 0, a: 1} + - _ColorChangeNewCol2: {r: 1, g: 1, b: 0, a: 1} + - _ColorChangeNewCol3: {r: 1, g: 1, b: 0, a: 1} + - _ColorChangeTarget: {r: 1, g: 0, b: 0, a: 1} + - _ColorChangeTarget2: {r: 1, g: 0, b: 0, a: 1} + - _ColorChangeTarget3: {r: 1, g: 0, b: 0, a: 1} + - _ColorSwapBlue: {r: 1, g: 1, b: 1, a: 1} + - _ColorSwapGreen: {r: 1, g: 1, b: 1, a: 1} + - _ColorSwapRed: {r: 1, g: 1, b: 1, a: 1} + - _FadeBurnColor: {r: 1, g: 1, b: 0, a: 1} + - _GlowColor: {r: 1, g: 1, b: 1, a: 1} + - _GradBotLeftCol: {r: 0.023718417, g: 0.38679248, b: 0.023718417, a: 1} + - _GradBotRightCol: {r: 0.019607844, g: 0.34117648, b: 0.019607844, a: 1} + - _GradTopLeftCol: {r: 0.16907978, g: 1, b: 0, a: 1} + - _GradTopRightCol: {r: 0.16862746, g: 1, b: 0, a: 1} + - _GreyscaleTintColor: {r: 1, g: 1, b: 1, a: 1} + - _HitEffectColor: {r: 1, g: 1, b: 1, a: 1} + - _HologramStripeColor: {r: 1, g: 1, b: 1, a: 1} + - _InnerOutlineColor: {r: 1, g: 0, b: 0, a: 1} + - _OutlineColor: {r: 1, g: 1, b: 1, a: 1} + - _OverlayColor: {r: 1, g: 1, b: 1, a: 1} + - _ShadowColor: {r: 0, g: 0, b: 0, a: 1} + - _ShineColor: {r: 1, g: 1, b: 1, a: 1} +--- !u!21 &2076240280 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: AllIn1SpriteShader/AllIn1SpriteShader + m_Shader: {fileID: 4800000, guid: a36b7719ff0465b42ab1407d67672c5f, type: 3} + m_ShaderKeywords: ALPHAOUTLINE_ON ETC1_EXTERNAL_ALPHA + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _ColorRampTex: + m_Texture: {fileID: 2800000, guid: 279657edc397ece4b8029c727adf6ddc, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ColorRampTexGradient: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ColorSwapTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DistortTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _FadeBurnTex: + m_Texture: {fileID: 2800000, guid: 677cca399782dea41aedc1d292ecb67d, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _FadeTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _GlowTex: + 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} + - _OutlineDistortTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OutlineTex: + m_Texture: {fileID: 2800000, guid: 74087f6d03f233e4a8a142fa01f9e5cf, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OverlayTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ShineMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - _Alpha: 1 + - _AlphaCutoffValue: 0.25 + - _AlphaOutlineBlend: 1 + - _AlphaOutlineGlow: 33.7 + - _AlphaOutlineMinAlpha: 0 + - _AlphaOutlinePower: 1 + - _AlphaRoundThreshold: 0.5 + - _BillboardY: 0 + - _BlurHD: 0 + - _BlurIntensity: 10 + - _Brightness: 0 + - _ChromAberrAlpha: 0.4 + - _ChromAberrAmount: 1 + - _ClipUvDown: 0 + - _ClipUvLeft: 0 + - _ClipUvRight: 0 + - _ClipUvUp: 0 + - _ColorChangeLuminosity: 0 + - _ColorChangeTolerance: 0.25 + - _ColorChangeTolerance2: 0.25 + - _ColorChangeTolerance3: 0.25 + - _ColorRampBlend: 1 + - _ColorRampLuminosity: 0 + - _ColorRampOutline: 0 + - _ColorSwapBlend: 1 + - _ColorSwapBlueLuminosity: 0.5 + - _ColorSwapGreenLuminosity: 0.5 + - _ColorSwapRedLuminosity: 0.5 + - _Contrast: 1 + - _CullingOption: 0 + - _DistortAmount: 0.5 + - _DistortTexXSpeed: 5 + - _DistortTexYSpeed: 5 + - _EditorDrawers: 6 + - _FadeAmount: -0.1 + - _FadeBurnGlow: 2 + - _FadeBurnTransition: 0.075 + - _FadeBurnWidth: 0.025 + - _FishEyeUvAmount: 0.35 + - _FlickerAlpha: 0 + - _FlickerFreq: 0.2 + - _FlickerPercent: 0.05 + - _GhostBlend: 1 + - _GhostColorBoost: 1 + - _GhostTransparency: 0 + - _GlitchAmount: 3 + - _GlitchSize: 1 + - _Glow: 10 + - _GlowGlobal: 1 + - _GlowTexUsed: 0 + - _GradBlend: 1 + - _GradBoostX: 1.2 + - _GradBoostY: 1.2 + - _GradIsRadial: 0 + - _GrassManualAnim: 1 + - _GrassManualToggle: 0 + - _GrassRadialBend: 0.1 + - _GrassSpeed: 2 + - _GrassWind: 20 + - _GreyscaleBlend: 1 + - _GreyscaleLuminosity: 0 + - _GreyscaleOutline: 0 + - _HandDrawnAmount: 10 + - _HandDrawnSpeed: 5 + - _HitEffectBlend: 1 + - _HitEffectGlow: 5 + - _HologramBlend: 1 + - _HologramMaxAlpha: 0.75 + - _HologramMinAlpha: 0.1 + - _HologramStripesAmount: 0.1 + - _HologramStripesSpeed: 4.5 + - _HologramUnmodAmount: 0 + - _HsvBright: 1 + - _HsvSaturation: 1 + - _HsvShift: 180 + - _InnerOutlineAlpha: 1 + - _InnerOutlineGlow: 4 + - _InnerOutlineThickness: 1 + - _MaxXUV: 1 + - _MaxYUV: 1 + - _MinXUV: 0 + - _MinYUV: 0 + - _MotionBlurAngle: 0.1 + - _MotionBlurDist: 1.25 + - _MyDstMode: 10 + - _MySrcMode: 5 + - _NegativeAmount: 1 + - _OffsetUvX: 0 + - _OffsetUvY: 0 + - _OnlyInnerOutline: 0 + - _OnlyOutline: 0 + - _Outline8Directions: 0 + - _OutlineAlpha: 1 + - _OutlineDistortAmount: 0.5 + - _OutlineDistortTexXSpeed: 5 + - _OutlineDistortTexYSpeed: 5 + - _OutlineDistortToggle: 0 + - _OutlineGlow: 1.5 + - _OutlineIsPixel: 0 + - _OutlinePixelWidth: 1 + - _OutlineTexGrey: 0 + - _OutlineTexToggle: 0 + - _OutlineTexXSpeed: 10 + - _OutlineTexYSpeed: 0 + - _OutlineWidth: 0.004 + - _OverlayBlend: 1 + - _OverlayGlow: 1 + - _OverlayTextureScrollXSpeed: 0.25 + - _OverlayTextureScrollYSpeed: 0.25 + - _PinchUvAmount: 0.35 + - _PixelateSize: 32 + - _PosterizeGamma: 0.75 + - _PosterizeNumColors: 8 + - _PosterizeOutline: 0 + - _RadialClip: 0 + - _RadialClip2: 45 + - _RadialClipAngle: 90 + - _RadialClipArc1: 45 + - _RadialClipArc2: 0 + - _RadialStartAngle: 90 + - _RandomSeed: 0 + - _RectSize: 1 + - _RotateUvAmount: 0 + - _RoundWaveSpeed: 2 + - _RoundWaveStrength: 0.7 + - _ShadowAlpha: 0.5 + - _ShadowX: 0.1 + - _ShadowY: -0.05 + - _ShakeUvSpeed: 2.5 + - _ShakeUvX: 1.5 + - _ShakeUvY: 1 + - _ShineGlow: 1 + - _ShineLocation: 0.5 + - _ShineRotate: 0 + - _ShineWidth: 0.1 + - _TextureScrollXSpeed: 1 + - _TextureScrollYSpeed: 0 + - _TwistUvAmount: 1 + - _TwistUvPosX: 0.5 + - _TwistUvPosY: 0.5 + - _TwistUvRadius: 0.75 + - _WarpScale: 0.5 + - _WarpSpeed: 8 + - _WarpStrength: 0.025 + - _WaveAmount: 7 + - _WaveSpeed: 10 + - _WaveStrength: 7.5 + - _WaveX: 0 + - _WaveY: 0.5 + - _ZTestMode: 4 + - _ZWrite: 0 + - _ZoomUvAmount: 0.5 + m_Colors: + - _AlphaOutlineColor: {r: 0.96902657, g: 1, b: 0, a: 1} + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _ColorChangeNewCol: {r: 1, g: 1, b: 0, a: 1} + - _ColorChangeNewCol2: {r: 1, g: 1, b: 0, a: 1} + - _ColorChangeNewCol3: {r: 1, g: 1, b: 0, a: 1} + - _ColorChangeTarget: {r: 1, g: 0, b: 0, a: 1} + - _ColorChangeTarget2: {r: 1, g: 0, b: 0, a: 1} + - _ColorChangeTarget3: {r: 1, g: 0, b: 0, a: 1} + - _ColorSwapBlue: {r: 1, g: 1, b: 1, a: 1} + - _ColorSwapGreen: {r: 1, g: 1, b: 1, a: 1} + - _ColorSwapRed: {r: 1, g: 1, b: 1, a: 1} + - _FadeBurnColor: {r: 1, g: 1, b: 0, a: 1} + - _GlowColor: {r: 1, g: 1, b: 1, a: 1} + - _GradBotLeftCol: {r: 0, g: 0, b: 1, a: 1} + - _GradBotRightCol: {r: 0, g: 0, b: 1, a: 1} + - _GradTopLeftCol: {r: 1, g: 0, b: 0, a: 1} + - _GradTopRightCol: {r: 1, g: 0, b: 0, a: 1} + - _GreyscaleTintColor: {r: 1, g: 1, b: 1, a: 1} + - _HitEffectColor: {r: 1, g: 1, b: 1, a: 1} + - _HologramStripeColor: {r: 0, g: 1, b: 1, a: 1} + - _InnerOutlineColor: {r: 1, g: 0, b: 0, a: 1} + - _OutlineColor: {r: 1, g: 1, b: 1, a: 1} + - _OverlayColor: {r: 1, g: 1, b: 1, a: 1} + - _ShadowColor: {r: 0, g: 0, b: 0, a: 1} + - _ShineColor: {r: 1, g: 1, b: 1, a: 1} +--- !u!1 &2076635523 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 2076635524} + - component: {fileID: 2076635526} + - component: {fileID: 2076635525} + m_Layer: 0 + m_Name: Title + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &2076635524 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2076635523} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: -2.51, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 361311995} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!102 &2076635525 +TextMesh: + serializedVersion: 3 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2076635523} + m_Text: Wind + m_OffsetZ: -1.5 + m_CharacterSize: 0.075 + m_LineSpacing: 1 + m_Anchor: 4 + m_Alignment: 0 + m_TabSize: 4 + m_FontSize: 100 + m_FontStyle: 0 + m_RichText: 1 + m_Font: {fileID: 12800000, guid: a4e6a5491519adb45919dc87eff28e55, type: 3} + m_Color: + serializedVersion: 2 + rgba: 4294967295 +--- !u!23 &2076635526 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2076635523} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 10100, guid: 0000000000000000e000000000000000, type: 0} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!1 &2082220741 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 2082220742} + - component: {fileID: 2082220746} + - component: {fileID: 2082220745} + - component: {fileID: 2082220743} + m_Layer: 0 + m_Name: Rotate + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &2082220742 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2082220741} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 130, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 1828174013} + - {fileID: 337231025} + m_Father: {fileID: 1351315063} + m_RootOrder: 13 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!95 &2082220743 +Animator: + serializedVersion: 3 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2082220741} + m_Enabled: 1 + m_Avatar: {fileID: 0} + m_Controller: {fileID: 9100000, guid: 1243dd8a666ff6b4787a02084a5170d1, type: 2} + m_CullingMode: 0 + m_UpdateMode: 0 + m_ApplyRootMotion: 0 + m_LinearVelocityBlending: 0 + m_WarningMessage: + m_HasTransformHierarchy: 1 + m_AllowConstantClipSamplingOptimization: 1 + m_KeepAnimatorControllerStateOnDisable: 0 +--- !u!114 &2082220745 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2082220741} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 98b644315d7a92842b89e04f55c48e02, type: 3} + m_Name: + m_EditorClassIdentifier: +--- !u!212 &2082220746 +SpriteRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2082220741} + m_Enabled: 1 + m_CastShadows: 0 + m_ReceiveShadows: 0 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 139334897} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 0 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_Sprite: {fileID: 21300000, guid: 519dafacd208bb64c83d5124be03b09d, type: 3} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_FlipX: 0 + m_FlipY: 0 + m_DrawMode: 0 + m_Size: {x: 5.12, y: 5.12} + m_AdaptiveModeThreshold: 0.5 + m_SpriteTileMode: 0 + m_WasSpriteAssigned: 1 + m_MaskInteraction: 0 + m_SpriteSortPoint: 0 +--- !u!1 &2088187657 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 2088187658} + - component: {fileID: 2088187660} + - component: {fileID: 2088187659} + m_Layer: 0 + m_Name: Animated + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &2088187658 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2088187657} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: -3.57, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 1687594936} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!102 &2088187659 +TextMesh: + serializedVersion: 3 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2088187657} + m_Text: (Has Animation) + m_OffsetZ: -1.5 + m_CharacterSize: 0.075 + m_LineSpacing: 1 + m_Anchor: 4 + m_Alignment: 0 + m_TabSize: 4 + m_FontSize: 100 + m_FontStyle: 0 + m_RichText: 1 + m_Font: {fileID: 12800000, guid: a4e6a5491519adb45919dc87eff28e55, type: 3} + m_Color: + serializedVersion: 2 + rgba: 4294967295 +--- !u!23 &2088187660 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2088187657} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 10100, guid: 0000000000000000e000000000000000, type: 0} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!1 &2096881074 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 2096881075} + - component: {fileID: 2096881080} + - component: {fileID: 2096881079} + - component: {fileID: 2096881076} + m_Layer: 0 + m_Name: ShinyMarine + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &2096881075 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2096881074} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 280, y: 0, z: 0} + m_LocalScale: {x: 0.80276, y: 0.80276, z: 0.80276} + m_Children: + - {fileID: 1103527058} + - {fileID: 242658910} + m_Father: {fileID: 1563905016} + m_RootOrder: 28 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!95 &2096881076 +Animator: + serializedVersion: 3 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2096881074} + m_Enabled: 1 + m_Avatar: {fileID: 0} + m_Controller: {fileID: 9100000, guid: 8652a2e9bd26fdf45b91d4e790b17cb1, type: 2} + m_CullingMode: 0 + m_UpdateMode: 0 + m_ApplyRootMotion: 0 + m_LinearVelocityBlending: 0 + m_WarningMessage: + m_HasTransformHierarchy: 1 + m_AllowConstantClipSamplingOptimization: 1 + m_KeepAnimatorControllerStateOnDisable: 0 +--- !u!212 &2096881079 +SpriteRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2096881074} + m_Enabled: 1 + m_CastShadows: 0 + m_ReceiveShadows: 0 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 1283967498} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 0 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_Sprite: {fileID: 21300000, guid: 519dafacd208bb64c83d5124be03b09d, type: 3} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_FlipX: 0 + m_FlipY: 0 + m_DrawMode: 0 + m_Size: {x: 5.12, y: 5.12} + m_AdaptiveModeThreshold: 0.5 + m_SpriteTileMode: 0 + m_WasSpriteAssigned: 1 + m_MaskInteraction: 0 + m_SpriteSortPoint: 0 +--- !u!114 &2096881080 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2096881074} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 98b644315d7a92842b89e04f55c48e02, type: 3} + m_Name: + m_EditorClassIdentifier: +--- !u!1 &2099543391 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 2099543392} + - component: {fileID: 2099543394} + - component: {fileID: 2099543393} + m_Layer: 0 + m_Name: Animated + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 0 +--- !u!4 &2099543392 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2099543391} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: -4.447157, z: 0} + m_LocalScale: {x: 1.2457023, y: 1.2457023, z: 1.2457023} + m_Children: [] + m_Father: {fileID: 42135250} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!102 &2099543393 +TextMesh: + serializedVersion: 3 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2099543391} + m_Text: (Has Animation) + m_OffsetZ: -1.5 + m_CharacterSize: 0.075 + m_LineSpacing: 1 + m_Anchor: 4 + m_Alignment: 0 + m_TabSize: 4 + m_FontSize: 100 + m_FontStyle: 0 + m_RichText: 1 + m_Font: {fileID: 12800000, guid: a4e6a5491519adb45919dc87eff28e55, type: 3} + m_Color: + serializedVersion: 2 + rgba: 4294967295 +--- !u!23 &2099543394 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2099543391} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: a4e6a5491519adb45919dc87eff28e55, type: 3} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!21 &2105693144 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: AllIn1SpriteShader/AllIn1SpriteShader + m_Shader: {fileID: 4800000, guid: a36b7719ff0465b42ab1407d67672c5f, type: 3} + m_ShaderKeywords: DISTORT_ON ETC1_EXTERNAL_ALPHA HSV_ON TEXTURESCROLL_ON WAVEUV_ON + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _ColorRampTex: + m_Texture: {fileID: 2800000, guid: 279657edc397ece4b8029c727adf6ddc, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ColorRampTexGradient: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ColorSwapTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DistortTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _FadeBurnTex: + m_Texture: {fileID: 2800000, guid: 677cca399782dea41aedc1d292ecb67d, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _FadeTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _GlowTex: + 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} + - _OutlineDistortTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OutlineTex: + m_Texture: {fileID: 2800000, guid: 74087f6d03f233e4a8a142fa01f9e5cf, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OverlayTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ShineMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - _Alpha: 1 + - _AlphaCutoffValue: 0.25 + - _AlphaOutlineBlend: 1 + - _AlphaOutlineGlow: 5 + - _AlphaOutlineMinAlpha: 0 + - _AlphaOutlinePower: 1 + - _AlphaRoundThreshold: 0.5 + - _BillboardY: 0 + - _BlurHD: 0 + - _BlurIntensity: 10 + - _Brightness: 0 + - _ChromAberrAlpha: 0.4 + - _ChromAberrAmount: 1 + - _ClipUvDown: 0 + - _ClipUvLeft: 0 + - _ClipUvRight: 0 + - _ClipUvUp: 0 + - _ColorChangeLuminosity: 0 + - _ColorChangeTolerance: 0.25 + - _ColorChangeTolerance2: 0.25 + - _ColorChangeTolerance3: 0.25 + - _ColorRampBlend: 1 + - _ColorRampLuminosity: 0 + - _ColorRampOutline: 0 + - _ColorSwapBlend: 1 + - _ColorSwapBlueLuminosity: 0.5 + - _ColorSwapGreenLuminosity: 0.5 + - _ColorSwapRedLuminosity: 0.5 + - _Contrast: 1 + - _CullingOption: 0 + - _DistortAmount: 0.25 + - _DistortTexXSpeed: 3 + - _DistortTexYSpeed: 5 + - _EditorDrawers: 6 + - _FadeAmount: -0.1 + - _FadeBurnGlow: 2 + - _FadeBurnTransition: 0.075 + - _FadeBurnWidth: 0.025 + - _FishEyeUvAmount: 0.35 + - _FlickerAlpha: 0 + - _FlickerFreq: 0.2 + - _FlickerPercent: 0.05 + - _GhostBlend: 1 + - _GhostColorBoost: 1 + - _GhostTransparency: 0 + - _GlitchAmount: 3 + - _GlitchSize: 1 + - _Glow: 10 + - _GlowGlobal: 1 + - _GlowTexUsed: 0 + - _GradBlend: 1 + - _GradBoostX: 1.2 + - _GradBoostY: 1.2 + - _GradIsRadial: 0 + - _GrassManualAnim: 1 + - _GrassManualToggle: 0 + - _GrassRadialBend: 0.25 + - _GrassSpeed: 2 + - _GrassWind: 20 + - _GreyscaleBlend: 1 + - _GreyscaleLuminosity: 0 + - _GreyscaleOutline: 0 + - _HandDrawnAmount: 10 + - _HandDrawnSpeed: 5 + - _HitEffectBlend: 1 + - _HitEffectGlow: 5 + - _HologramBlend: 1 + - _HologramFlickerAlpha: 0 + - _HologramFlickerFreq: 0.2 + - _HologramMaxAlpha: 1 + - _HologramMinAlpha: 0 + - _HologramStripesAlpha: 0.4 + - _HologramStripesAmount: 50 + - _HologramStripesFill: 0.4 + - _HologramStripesLuminosity: 1 + - _HologramStripesSpeed: 5 + - _HologramUnmodAmount: 0.4 + - _HsvBright: 1.24 + - _HsvSaturation: 1.68 + - _HsvShift: 313 + - _InnerOutlineAlpha: 1 + - _InnerOutlineGlow: 1 + - _InnerOutlineThickness: 1 + - _MaxXUV: 1 + - _MaxYUV: 1 + - _MinXUV: 0 + - _MinYUV: 0 + - _MotionBlurAngle: 0.1 + - _MotionBlurDist: 1.25 + - _MyDstMode: 10 + - _MySrcMode: 5 + - _NegativeAmount: 1 + - _OffsetUvX: 0 + - _OffsetUvY: 0 + - _OnlyInnerOutline: 0 + - _OnlyOutline: 0 + - _Outline8Directions: 0 + - _OutlineAlpha: 1 + - _OutlineDistortAmount: 0.5 + - _OutlineDistortTexXSpeed: 5 + - _OutlineDistortTexYSpeed: 5 + - _OutlineDistortToggle: 0 + - _OutlineGlow: 1.5 + - _OutlineIsPixel: 0 + - _OutlinePixelWidth: 1 + - _OutlineTexGrey: 0 + - _OutlineTexToggle: 0 + - _OutlineTexXSpeed: 10 + - _OutlineTexYSpeed: 0 + - _OutlineWidth: 0.004 + - _OverlayBlend: 1 + - _OverlayGlow: 1 + - _OverlayTextureScrollXSpeed: 0.25 + - _OverlayTextureScrollYSpeed: 0.25 + - _PinchUvAmount: 0.35 + - _PixelateSize: 32 + - _PosterizeGamma: 0.75 + - _PosterizeNumColors: 8 + - _PosterizeOutline: 0 + - _RadialClipAngle: 90 + - _RadialClipArc1: 45 + - _RadialClipArc2: 0 + - _RandomSeed: 0 + - _RectSize: 1 + - _RotateUvAmount: 0 + - _RoundWaveSpeed: 2 + - _RoundWaveStrength: 0.7 + - _ShadowAlpha: 0.5 + - _ShadowX: 0.1 + - _ShadowY: -0.05 + - _ShakeUvSpeed: 2.5 + - _ShakeUvX: 1.5 + - _ShakeUvY: 1 + - _ShineGlow: 1 + - _ShineLocation: 0.5 + - _ShineRotate: 0 + - _ShineWidth: 0.1 + - _TextureScrollXSpeed: -0.25 + - _TextureScrollYSpeed: 0.05 + - _TwistUvAmount: 1 + - _TwistUvPosX: 0.5 + - _TwistUvPosY: 0.5 + - _TwistUvRadius: 0.75 + - _WarpScale: 0.5 + - _WarpSpeed: 8 + - _WarpStrength: 0.025 + - _WaveAmount: 13.5 + - _WaveSpeed: 12.7 + - _WaveStrength: 13.4 + - _WaveX: 0 + - _WaveY: 0.5 + - _ZTestMode: 4 + - _ZWrite: 0 + - _ZoomUvAmount: 0.5 + m_Colors: + - ColorSwapRed: {r: 1, g: 1, b: 1, a: 1} + - _AlphaOutlineColor: {r: 1, g: 1, b: 1, a: 1} + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _ColorChangeNewCol: {r: 1, g: 1, b: 0, a: 1} + - _ColorChangeNewCol2: {r: 1, g: 1, b: 0, a: 1} + - _ColorChangeNewCol3: {r: 1, g: 1, b: 0, a: 1} + - _ColorChangeTarget: {r: 1, g: 0, b: 0, a: 1} + - _ColorChangeTarget2: {r: 1, g: 0, b: 0, a: 1} + - _ColorChangeTarget3: {r: 1, g: 0, b: 0, a: 1} + - _ColorSwapBlue: {r: 1, g: 1, b: 1, a: 1} + - _ColorSwapGreen: {r: 1, g: 1, b: 1, a: 1} + - _ColorSwapRed: {r: 1, g: 1, b: 1, a: 1} + - _FadeBurnColor: {r: 1, g: 1, b: 0, a: 1} + - _GlowColor: {r: 1, g: 1, b: 1, a: 1} + - _GradBotLeftCol: {r: 0, g: 0, b: 1, a: 1} + - _GradBotRightCol: {r: 0, g: 0, b: 1, a: 1} + - _GradTopLeftCol: {r: 1, g: 0, b: 0, a: 1} + - _GradTopRightCol: {r: 1, g: 0, b: 0, a: 1} + - _GreyscaleTintColor: {r: 1, g: 1, b: 1, a: 1} + - _HitEffectColor: {r: 1, g: 1, b: 1, a: 1} + - _HologramStripeColor: {r: 1, g: 1, b: 1, a: 1} + - _InnerOutlineColor: {r: 1, g: 0, b: 0, a: 1} + - _OutlineColor: {r: 1, g: 1, b: 1, a: 1} + - _OverlayColor: {r: 1, g: 1, b: 1, a: 1} + - _ShadowColor: {r: 0, g: 0, b: 0, a: 1} + - _ShineColor: {r: 1, g: 1, b: 1, a: 1} +--- !u!1 &2117073027 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 2117073028} + - component: {fileID: 2117073030} + - component: {fileID: 2117073029} + m_Layer: 0 + m_Name: Animated + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 0 +--- !u!4 &2117073028 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2117073027} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: -3.57, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 595151377} + m_RootOrder: 2 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!102 &2117073029 +TextMesh: + serializedVersion: 3 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2117073027} + m_Text: (Has Animation) + m_OffsetZ: -1.5 + m_CharacterSize: 0.075 + m_LineSpacing: 1 + m_Anchor: 4 + m_Alignment: 0 + m_TabSize: 4 + m_FontSize: 100 + m_FontStyle: 0 + m_RichText: 1 + m_Font: {fileID: 12800000, guid: a4e6a5491519adb45919dc87eff28e55, type: 3} + m_Color: + serializedVersion: 2 + rgba: 4294967295 +--- !u!23 &2117073030 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2117073027} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: a4e6a5491519adb45919dc87eff28e55, type: 3} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!21 &2128149943 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: AllIn1SpriteShader/AllIn1SpriteShader + m_Shader: {fileID: 4800000, guid: a36b7719ff0465b42ab1407d67672c5f, type: 3} + m_ShaderKeywords: ETC1_EXTERNAL_ALPHA HSV_ON + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _ColorRampTex: + m_Texture: {fileID: 2800000, guid: 279657edc397ece4b8029c727adf6ddc, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ColorRampTexGradient: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ColorSwapTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DistortTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _FadeBurnTex: + m_Texture: {fileID: 2800000, guid: 677cca399782dea41aedc1d292ecb67d, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _FadeTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _GlowTex: + 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} + - _OutlineDistortTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OutlineTex: + m_Texture: {fileID: 2800000, guid: 74087f6d03f233e4a8a142fa01f9e5cf, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OverlayTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ShineMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - _Alpha: 1 + - _AlphaCutoffValue: 0.25 + - _AlphaOutlineBlend: 1 + - _AlphaOutlineGlow: 5 + - _AlphaOutlineMinAlpha: 0 + - _AlphaOutlinePower: 1 + - _AlphaRoundThreshold: 0.5 + - _BillboardY: 0 + - _BlurHD: 0 + - _BlurIntensity: 10 + - _Brightness: 0 + - _ChromAberrAlpha: 0.4 + - _ChromAberrAmount: 1 + - _ClipUvDown: 0 + - _ClipUvLeft: 0 + - _ClipUvRight: 0 + - _ClipUvUp: 0 + - _ColorChangeLuminosity: 0 + - _ColorChangeTolerance: 0.25 + - _ColorChangeTolerance2: 0.25 + - _ColorChangeTolerance3: 0.25 + - _ColorRampBlend: 1 + - _ColorRampLuminosity: 0 + - _ColorRampOutline: 0 + - _ColorSwapBlend: 1 + - _ColorSwapBlueLuminosity: 0.5 + - _ColorSwapGreenLuminosity: 0.5 + - _ColorSwapRedLuminosity: 0.5 + - _Contrast: 1 + - _CullingOption: 0 + - _DistortAmount: 0.5 + - _DistortTexXSpeed: 5 + - _DistortTexYSpeed: 5 + - _EditorDrawers: 6 + - _FadeAmount: -0.1 + - _FadeBurnGlow: 2 + - _FadeBurnTransition: 0.075 + - _FadeBurnWidth: 0.025 + - _FishEyeUvAmount: 0.35 + - _FlickerAlpha: 0 + - _FlickerFreq: 0.2 + - _FlickerPercent: 0.05 + - _GhostBlend: 1 + - _GhostColorBoost: 1 + - _GhostTransparency: 0 + - _GlitchAmount: 3 + - _GlitchSize: 1 + - _Glow: 10 + - _GlowGlobal: 1 + - _GlowTexUsed: 0 + - _GradBlend: 1 + - _GradBoostX: 1.2 + - _GradBoostY: 1.2 + - _GradIsRadial: 0 + - _GrassManualAnim: 1 + - _GrassManualToggle: 0 + - _GrassRadialBend: 0.1 + - _GrassSpeed: 2 + - _GrassWind: 20 + - _GreyscaleBlend: 1 + - _GreyscaleLuminosity: 0 + - _GreyscaleOutline: 0 + - _HandDrawnAmount: 10 + - _HandDrawnSpeed: 5 + - _HitEffectBlend: 1 + - _HitEffectGlow: 5 + - _HologramBlend: 1 + - _HologramMaxAlpha: 1 + - _HologramMinAlpha: 0 + - _HologramStripesAlpha: 0.4 + - _HologramStripesAmount: 50 + - _HologramStripesFill: 0.4 + - _HologramStripesLuminosity: 1 + - _HologramStripesSpeed: 5 + - _HologramUnmodAmount: 0.4 + - _HsvBright: 0.74 + - _HsvSaturation: 1.5 + - _HsvShift: 81 + - _InnerOutlineAlpha: 1 + - _InnerOutlineGlow: 1 + - _InnerOutlineThickness: 1 + - _MaxXUV: 1 + - _MaxYUV: 1 + - _MinXUV: 0 + - _MinYUV: 0 + - _MotionBlurAngle: 0.1 + - _MotionBlurDist: 1.25 + - _MyDstMode: 10 + - _MySrcMode: 5 + - _NegativeAmount: 1 + - _OffsetUvX: 0 + - _OffsetUvY: 0 + - _OnlyInnerOutline: 0 + - _OnlyOutline: 0 + - _Outline8Directions: 0 + - _OutlineAlpha: 1 + - _OutlineDistortAmount: 0.5 + - _OutlineDistortTexXSpeed: 5 + - _OutlineDistortTexYSpeed: 5 + - _OutlineDistortToggle: 0 + - _OutlineGlow: 1.5 + - _OutlineIsPixel: 0 + - _OutlinePixelWidth: 1 + - _OutlineTexGrey: 0 + - _OutlineTexToggle: 0 + - _OutlineTexXSpeed: 10 + - _OutlineTexYSpeed: 0 + - _OutlineWidth: 0.004 + - _OverlayBlend: 1 + - _OverlayGlow: 1 + - _OverlayTextureScrollXSpeed: 0.25 + - _OverlayTextureScrollYSpeed: 0.25 + - _PinchUvAmount: 0.35 + - _PixelateSize: 32 + - _PosterizeGamma: 0.75 + - _PosterizeNumColors: 8 + - _PosterizeOutline: 0 + - _RadialClipAngle: 90 + - _RadialClipArc1: 45 + - _RadialClipArc2: 0 + - _RandomSeed: 0 + - _RectSize: 1 + - _RotateUvAmount: 0 + - _RoundWaveSpeed: 2 + - _RoundWaveStrength: 0.7 + - _ShadowAlpha: 0.5 + - _ShadowX: 0.1 + - _ShadowY: -0.05 + - _ShakeUvSpeed: 2.5 + - _ShakeUvX: 1.5 + - _ShakeUvY: 1 + - _ShineGlow: 1 + - _ShineLocation: 0.5 + - _ShineRotate: 0 + - _ShineWidth: 0.1 + - _TextureScrollXSpeed: 1 + - _TextureScrollYSpeed: 0 + - _TwistUvAmount: 1 + - _TwistUvPosX: 0.5 + - _TwistUvPosY: 0.5 + - _TwistUvRadius: 0.75 + - _WarpScale: 0.5 + - _WarpSpeed: 8 + - _WarpStrength: 0.025 + - _WaveAmount: 7 + - _WaveSpeed: 10 + - _WaveStrength: 7.5 + - _WaveX: 0 + - _WaveY: 0.5 + - _ZTestMode: 4 + - _ZWrite: 0 + - _ZoomUvAmount: 0.5 + m_Colors: + - ColorSwapRed: {r: 1, g: 1, b: 1, a: 1} + - _AlphaOutlineColor: {r: 1, g: 1, b: 1, a: 1} + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _ColorChangeNewCol: {r: 1, g: 1, b: 0, a: 1} + - _ColorChangeNewCol2: {r: 1, g: 1, b: 0, a: 1} + - _ColorChangeNewCol3: {r: 1, g: 1, b: 0, a: 1} + - _ColorChangeTarget: {r: 1, g: 0, b: 0, a: 1} + - _ColorChangeTarget2: {r: 1, g: 0, b: 0, a: 1} + - _ColorChangeTarget3: {r: 1, g: 0, b: 0, a: 1} + - _ColorSwapBlue: {r: 1, g: 1, b: 1, a: 1} + - _ColorSwapGreen: {r: 1, g: 1, b: 1, a: 1} + - _ColorSwapRed: {r: 1, g: 1, b: 1, a: 1} + - _FadeBurnColor: {r: 1, g: 1, b: 0, a: 1} + - _GlowColor: {r: 1, g: 1, b: 1, a: 1} + - _GradBotLeftCol: {r: 0, g: 0, b: 1, a: 1} + - _GradBotRightCol: {r: 0, g: 0, b: 1, a: 1} + - _GradTopLeftCol: {r: 1, g: 0, b: 0, a: 1} + - _GradTopRightCol: {r: 1, g: 0, b: 0, a: 1} + - _GreyscaleTintColor: {r: 1, g: 1, b: 1, a: 1} + - _HitEffectColor: {r: 1, g: 1, b: 1, a: 1} + - _HologramStripeColor: {r: 1, g: 1, b: 1, a: 1} + - _InnerOutlineColor: {r: 1, g: 0, b: 0, a: 1} + - _OutlineColor: {r: 1, g: 1, b: 1, a: 1} + - _OverlayColor: {r: 1, g: 1, b: 1, a: 1} + - _ShadowColor: {r: 0, g: 0, b: 0, a: 1} + - _ShineColor: {r: 1, g: 1, b: 1, a: 1} +--- !u!1 &2134460148 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 2134460149} + - component: {fileID: 2134460151} + - component: {fileID: 2134460150} + m_Layer: 0 + m_Name: Outline + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &2134460149 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2134460148} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: -0.05} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 1478122371} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &2134460150 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2134460148} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: ee158225ee1e59f4791627785501d950, type: 3} + m_Name: + m_EditorClassIdentifier: + currentShaderType: 4 + normalStrength: 5 + normalSmoothing: 1 + computingNormal: 0 +--- !u!212 &2134460151 +SpriteRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2134460148} + m_Enabled: 1 + m_CastShadows: 0 + m_ReceiveShadows: 0 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 453643567} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 0 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_Sprite: {fileID: 21300000, guid: 519dafacd208bb64c83d5124be03b09d, type: 3} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_FlipX: 0 + m_FlipY: 0 + m_DrawMode: 0 + m_Size: {x: 5.12, y: 5.12} + m_AdaptiveModeThreshold: 0.5 + m_SpriteTileMode: 0 + m_WasSpriteAssigned: 1 + m_MaskInteraction: 0 + m_SpriteSortPoint: 0 +--- !u!21 &2136425119 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: AllIn1SpriteShader/AllIn1SpriteShader + m_Shader: {fileID: 4800000, guid: a36b7719ff0465b42ab1407d67672c5f, type: 3} + m_ShaderKeywords: ETC1_EXTERNAL_ALPHA SHINE_ON + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _ColorRampTex: + m_Texture: {fileID: 2800000, guid: 279657edc397ece4b8029c727adf6ddc, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ColorRampTexGradient: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ColorSwapTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DistortTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _FadeBurnTex: + m_Texture: {fileID: 2800000, guid: 677cca399782dea41aedc1d292ecb67d, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _FadeTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _GlowTex: + 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} + - _OutlineDistortTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OutlineTex: + m_Texture: {fileID: 2800000, guid: 74087f6d03f233e4a8a142fa01f9e5cf, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OverlayTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ShineMask: + m_Texture: {fileID: 0} + m_Scale: {x: 2.15, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - _Alpha: 1 + - _AlphaCutoffValue: 0.25 + - _AlphaOutlineBlend: 1 + - _AlphaOutlineGlow: 5 + - _AlphaOutlineMinAlpha: 0 + - _AlphaOutlinePower: 1 + - _AlphaRoundThreshold: 0.5 + - _BillboardY: 0 + - _BlurHD: 0 + - _BlurIntensity: 10 + - _Brightness: 0 + - _ChromAberrAlpha: 0.4 + - _ChromAberrAmount: 1 + - _ClipUvDown: 0 + - _ClipUvLeft: 0 + - _ClipUvRight: 0 + - _ClipUvUp: 0 + - _ColorChangeLuminosity: 0 + - _ColorChangeTolerance: 0.25 + - _ColorChangeTolerance2: 0.25 + - _ColorChangeTolerance3: 0.25 + - _ColorRampBlend: 1 + - _ColorRampLuminosity: 0 + - _ColorRampOutline: 0 + - _ColorSwapBlend: 1 + - _ColorSwapBlueLuminosity: 0.5 + - _ColorSwapGreenLuminosity: 0.5 + - _ColorSwapRedLuminosity: 0.5 + - _Contrast: 1 + - _CullingOption: 0 + - _DistortAmount: 0.5 + - _DistortTexXSpeed: 5 + - _DistortTexYSpeed: 5 + - _EditorDrawers: 6 + - _FadeAmount: -0.1 + - _FadeBurnGlow: 2 + - _FadeBurnTransition: 0.075 + - _FadeBurnWidth: 0.025 + - _FishEyeUvAmount: 0.35 + - _FlickerAlpha: 0 + - _FlickerFreq: 0.2 + - _FlickerPercent: 0.05 + - _GhostBlend: 1 + - _GhostColorBoost: 1 + - _GhostTransparency: 0 + - _GlitchAmount: 3 + - _GlitchSize: 1 + - _Glow: 10 + - _GlowGlobal: 1 + - _GlowTexUsed: 0 + - _GradBlend: 1 + - _GradBoostX: 1.2 + - _GradBoostY: 1.2 + - _GradIsRadial: 0 + - _GrassManualAnim: 1 + - _GrassManualToggle: 0 + - _GrassRadialBend: 0.25 + - _GrassSpeed: 2 + - _GrassWind: 20 + - _GreyscaleBlend: 1 + - _GreyscaleLuminosity: 0 + - _GreyscaleOutline: 0 + - _HandDrawnAmount: 10 + - _HandDrawnSpeed: 5 + - _HitEffectBlend: 1 + - _HitEffectGlow: 5 + - _HologramBlend: 1 + - _HologramMaxAlpha: 1 + - _HologramMinAlpha: 0 + - _HologramStripesAlpha: 0.4 + - _HologramStripesAmount: 50 + - _HologramStripesFill: 0.4 + - _HologramStripesLuminosity: 1 + - _HologramStripesSpeed: 5 + - _HologramUnmodAmount: 0.4 + - _HsvBright: 1 + - _HsvSaturation: 1 + - _HsvShift: 180 + - _InnerOutlineAlpha: 1 + - _InnerOutlineGlow: 1 + - _InnerOutlineThickness: 1 + - _MaxXUV: 1 + - _MaxYUV: 1 + - _MinXUV: 0 + - _MinYUV: 0 + - _MotionBlurAngle: 0.1 + - _MotionBlurDist: 1.25 + - _MyDstMode: 10 + - _MySrcMode: 5 + - _NegativeAmount: 1 + - _OffsetUvX: 0 + - _OffsetUvY: 0 + - _OnlyInnerOutline: 0 + - _OnlyOutline: 0 + - _Outline8Directions: 0 + - _OutlineAlpha: 1 + - _OutlineDistortAmount: 0.5 + - _OutlineDistortTexXSpeed: 5 + - _OutlineDistortTexYSpeed: 5 + - _OutlineDistortToggle: 0 + - _OutlineGlow: 1.5 + - _OutlineIsPixel: 0 + - _OutlinePixelWidth: 1 + - _OutlineTexGrey: 0 + - _OutlineTexToggle: 0 + - _OutlineTexXSpeed: 10 + - _OutlineTexYSpeed: 0 + - _OutlineWidth: 0.004 + - _OverlayBlend: 1 + - _OverlayGlow: 1 + - _OverlayTextureScrollXSpeed: 0.25 + - _OverlayTextureScrollYSpeed: 0.25 + - _PinchUvAmount: 0.35 + - _PixelateSize: 32 + - _PosterizeGamma: 0.75 + - _PosterizeNumColors: 8 + - _PosterizeOutline: 0 + - _RadialClip: 0 + - _RadialClip2: 45 + - _RadialClipAngle: 90 + - _RadialClipArc1: 45 + - _RadialClipArc2: 0 + - _RadialStartAngle: 90 + - _RandomSeed: 0 + - _RectSize: 1 + - _RotateUvAmount: 0 + - _RoundWaveSpeed: 2 + - _RoundWaveStrength: 0.7 + - _ShadowAlpha: 0.5 + - _ShadowX: 0.1 + - _ShadowY: -0.05 + - _ShakeUvSpeed: 2.5 + - _ShakeUvX: 1.5 + - _ShakeUvY: 1 + - _ShineGlow: 0.8 + - _ShineLocation: 0.49 + - _ShineRotate: 0 + - _ShineWidth: 0.119 + - _TextureScrollXSpeed: 1 + - _TextureScrollYSpeed: 0 + - _TwistUvAmount: 1 + - _TwistUvPosX: 0.5 + - _TwistUvPosY: 0.5 + - _TwistUvRadius: 0.75 + - _WarpScale: 0.5 + - _WarpSpeed: 8 + - _WarpStrength: 0.025 + - _WaveAmount: 7 + - _WaveSpeed: 10 + - _WaveStrength: 7.5 + - _WaveX: 0 + - _WaveY: 0.5 + - _ZTestMode: 4 + - _ZWrite: 0 + - _ZoomUvAmount: 0.5 + m_Colors: + - ColorSwapRed: {r: 1, g: 1, b: 1, a: 1} + - _AlphaOutlineColor: {r: 1, g: 1, b: 1, a: 1} + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _ColorChangeNewCol: {r: 1, g: 1, b: 0, a: 1} + - _ColorChangeNewCol2: {r: 1, g: 1, b: 0, a: 1} + - _ColorChangeNewCol3: {r: 1, g: 1, b: 0, a: 1} + - _ColorChangeTarget: {r: 1, g: 0, b: 0, a: 1} + - _ColorChangeTarget2: {r: 1, g: 0, b: 0, a: 1} + - _ColorChangeTarget3: {r: 1, g: 0, b: 0, a: 1} + - _ColorSwapBlue: {r: 1, g: 1, b: 1, a: 1} + - _ColorSwapGreen: {r: 1, g: 1, b: 1, a: 1} + - _ColorSwapRed: {r: 1, g: 1, b: 1, a: 1} + - _FadeBurnColor: {r: 1, g: 1, b: 0, a: 1} + - _GlowColor: {r: 1, g: 1, b: 1, a: 1} + - _GradBotLeftCol: {r: 0, g: 0, b: 1, a: 1} + - _GradBotRightCol: {r: 0, g: 0, b: 1, a: 1} + - _GradTopLeftCol: {r: 1, g: 0, b: 0, a: 1} + - _GradTopRightCol: {r: 1, g: 0, b: 0, a: 1} + - _GreyscaleTintColor: {r: 1, g: 1, b: 1, a: 1} + - _HitEffectColor: {r: 1, g: 1, b: 1, a: 1} + - _HologramStripeColor: {r: 1, g: 1, b: 1, a: 1} + - _InnerOutlineColor: {r: 1, g: 0, b: 0, a: 1} + - _OutlineColor: {r: 1, g: 1, b: 1, a: 1} + - _OverlayColor: {r: 1, g: 1, b: 1, a: 1} + - _ShadowColor: {r: 0, g: 0, b: 0, a: 1} + - _ShineColor: {r: 1, g: 1, b: 1, a: 1} +--- !u!1001 &3864259598862589320 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + m_TransformParent: {fileID: 1563905016} + m_Modifications: + - target: {fileID: 3864259599682641152, guid: 11bf72cfca6ba93459ddeacea51fd0bd, + type: 3} + propertyPath: m_Name + value: Shield Soldier Demo + objectReference: {fileID: 0} + - target: {fileID: 3864259599682641153, guid: 11bf72cfca6ba93459ddeacea51fd0bd, + type: 3} + propertyPath: m_RootOrder + value: 36 + objectReference: {fileID: 0} + - target: {fileID: 3864259599682641153, guid: 11bf72cfca6ba93459ddeacea51fd0bd, + type: 3} + propertyPath: m_LocalPosition.x + value: 360 + objectReference: {fileID: 0} + - target: {fileID: 3864259599682641153, guid: 11bf72cfca6ba93459ddeacea51fd0bd, + type: 3} + propertyPath: m_LocalPosition.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 3864259599682641153, guid: 11bf72cfca6ba93459ddeacea51fd0bd, + type: 3} + propertyPath: m_LocalPosition.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 3864259599682641153, guid: 11bf72cfca6ba93459ddeacea51fd0bd, + type: 3} + propertyPath: m_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 3864259599682641153, guid: 11bf72cfca6ba93459ddeacea51fd0bd, + type: 3} + propertyPath: m_LocalRotation.x + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 3864259599682641153, guid: 11bf72cfca6ba93459ddeacea51fd0bd, + type: 3} + propertyPath: m_LocalRotation.y + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 3864259599682641153, guid: 11bf72cfca6ba93459ddeacea51fd0bd, + type: 3} + propertyPath: m_LocalRotation.z + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 3864259599682641153, guid: 11bf72cfca6ba93459ddeacea51fd0bd, + type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 3864259599682641153, guid: 11bf72cfca6ba93459ddeacea51fd0bd, + type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 3864259599682641153, guid: 11bf72cfca6ba93459ddeacea51fd0bd, + type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: 11bf72cfca6ba93459ddeacea51fd0bd, type: 3} +--- !u!4 &4005302481246734412 stripped +Transform: + m_CorrespondingSourceObject: {fileID: 7935039278937507618, guid: 161eac4f3ec2ef344ae473e275658ecf, + type: 3} + m_PrefabInstance: {fileID: 6452353472261279598} + m_PrefabAsset: {fileID: 0} +--- !u!4 &4825911116503289154 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 55667222} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 1571920279} + - {fileID: 1356966097} + m_Father: {fileID: 2036092933} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &5952972451371321216 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5952972451371321217} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 384dba07353e1f242b467b6857a1e3d4, type: 3} + m_Name: + m_EditorClassIdentifier: + numericPropertyName: _HsvShift + scrollSpeed: 0.1 + applyModulo: 1 + modulo: 360 + mat: {fileID: 0} +--- !u!1 &5952972451371321217 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 5952972451371321220} + - component: {fileID: 5952972451371321221} + - component: {fileID: 5952972451371321218} + - component: {fileID: 5952972451371321219} + - component: {fileID: 5952972451371321216} + m_Layer: 0 + m_Name: Pattern + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!114 &5952972451371321218 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5952972451371321217} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: ee158225ee1e59f4791627785501d950, type: 3} + m_Name: + m_EditorClassIdentifier: + currentShaderType: 4 + normalStrength: 5 + normalSmoothing: 1 + computingNormal: 0 +--- !u!95 &5952972451371321219 +Animator: + serializedVersion: 3 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5952972451371321217} + m_Enabled: 1 + m_Avatar: {fileID: 0} + m_Controller: {fileID: 9100000, guid: f994ff75b3f33ae46af22e6462b4606a, type: 2} + m_CullingMode: 0 + m_UpdateMode: 0 + m_ApplyRootMotion: 0 + m_LinearVelocityBlending: 0 + m_WarningMessage: + m_HasTransformHierarchy: 1 + m_AllowConstantClipSamplingOptimization: 1 + m_KeepAnimatorControllerStateOnDisable: 0 +--- !u!4 &5952972451371321220 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5952972451371321217} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 595151377} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!212 &5952972451371321221 +SpriteRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5952972451371321217} + m_Enabled: 1 + m_CastShadows: 0 + m_ReceiveShadows: 0 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 1814697822} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 0 + m_SelectedEditorRenderState: 0 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_Sprite: {fileID: 21300000, guid: 2f5c9cbfde2d0384bb53189b0d0f06d8, type: 3} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_FlipX: 0 + m_FlipY: 0 + m_DrawMode: 2 + m_Size: {x: 5, y: 5} + m_AdaptiveModeThreshold: 0.5 + m_SpriteTileMode: 0 + m_WasSpriteAssigned: 1 + m_MaskInteraction: 0 + m_SpriteSortPoint: 0 +--- !u!1001 &6452353472261279598 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + m_TransformParent: {fileID: 1563905016} + m_Modifications: + - target: {fileID: 7935039278937507617, guid: 161eac4f3ec2ef344ae473e275658ecf, + type: 3} + propertyPath: m_Name + value: Particle System Demo + objectReference: {fileID: 0} + - target: {fileID: 7935039278937507618, guid: 161eac4f3ec2ef344ae473e275658ecf, + type: 3} + propertyPath: m_RootOrder + value: 22 + objectReference: {fileID: 0} + - target: {fileID: 7935039278937507618, guid: 161eac4f3ec2ef344ae473e275658ecf, + type: 3} + propertyPath: m_LocalPosition.x + value: 220 + objectReference: {fileID: 0} + - target: {fileID: 7935039278937507618, guid: 161eac4f3ec2ef344ae473e275658ecf, + type: 3} + propertyPath: m_LocalPosition.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 7935039278937507618, guid: 161eac4f3ec2ef344ae473e275658ecf, + type: 3} + propertyPath: m_LocalPosition.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 7935039278937507618, guid: 161eac4f3ec2ef344ae473e275658ecf, + type: 3} + propertyPath: m_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 7935039278937507618, guid: 161eac4f3ec2ef344ae473e275658ecf, + type: 3} + propertyPath: m_LocalRotation.x + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 7935039278937507618, guid: 161eac4f3ec2ef344ae473e275658ecf, + type: 3} + propertyPath: m_LocalRotation.y + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 7935039278937507618, guid: 161eac4f3ec2ef344ae473e275658ecf, + type: 3} + propertyPath: m_LocalRotation.z + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 7935039278937507618, guid: 161eac4f3ec2ef344ae473e275658ecf, + type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 7935039278937507618, guid: 161eac4f3ec2ef344ae473e275658ecf, + type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 7935039278937507618, guid: 161eac4f3ec2ef344ae473e275658ecf, + type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 7935039279205550812, guid: 161eac4f3ec2ef344ae473e275658ecf, + type: 3} + propertyPath: m_Materials.Array.data[0] + value: + objectReference: {fileID: 540543599} + m_RemovedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: 161eac4f3ec2ef344ae473e275658ecf, type: 3} diff --git a/Assets/Plugins/AllIn1SpriteShader/Demo/Demo.unity.meta b/Assets/Plugins/AllIn1SpriteShader/Demo/Demo.unity.meta new file mode 100644 index 000000000..bcf9a4234 --- /dev/null +++ b/Assets/Plugins/AllIn1SpriteShader/Demo/Demo.unity.meta @@ -0,0 +1,14 @@ +fileFormatVersion: 2 +guid: aa7236836849adb4285d82814f472ea5 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 156513 + packageName: All In 1 Sprite Shader + packageVersion: 4.25 + assetPath: Assets/Plugins/AllIn1SpriteShader/Demo/Demo.unity + uploadId: 708810 diff --git a/Assets/Plugins/AllIn1SpriteShader/Demo/Demo2.unity b/Assets/Plugins/AllIn1SpriteShader/Demo/Demo2.unity new file mode 100644 index 000000000..c1c7c56fe --- /dev/null +++ b/Assets/Plugins/AllIn1SpriteShader/Demo/Demo2.unity @@ -0,0 +1,9421 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!29 &1 +OcclusionCullingSettings: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_OcclusionBakeSettings: + smallestOccluder: 5 + smallestHole: 0.25 + backfaceThreshold: 100 + m_SceneGUID: 00000000000000000000000000000000 + m_OcclusionCullingData: {fileID: 0} +--- !u!104 &2 +RenderSettings: + m_ObjectHideFlags: 0 + serializedVersion: 9 + m_Fog: 0 + m_FogColor: {r: 0.5, g: 0.5, b: 0.5, a: 1} + m_FogMode: 3 + m_FogDensity: 0.01 + m_LinearFogStart: 0 + m_LinearFogEnd: 300 + m_AmbientSkyColor: {r: 0.212, g: 0.227, b: 0.259, a: 1} + m_AmbientEquatorColor: {r: 0.114, g: 0.125, b: 0.133, a: 1} + m_AmbientGroundColor: {r: 0.047, g: 0.043, b: 0.035, a: 1} + m_AmbientIntensity: 1 + m_AmbientMode: 3 + m_SubtractiveShadowColor: {r: 0.42, g: 0.478, b: 0.627, a: 1} + m_SkyboxMaterial: {fileID: 0} + m_HaloStrength: 0.5 + m_FlareStrength: 1 + m_FlareFadeSpeed: 3 + m_HaloTexture: {fileID: 0} + m_SpotCookie: {fileID: 10001, guid: 0000000000000000e000000000000000, type: 0} + m_DefaultReflectionMode: 0 + m_DefaultReflectionResolution: 128 + m_ReflectionBounces: 1 + m_ReflectionIntensity: 1 + m_CustomReflection: {fileID: 0} + m_Sun: {fileID: 0} + m_IndirectSpecularColor: {r: 0, g: 0, b: 0, a: 1} + m_UseRadianceAmbientProbe: 0 +--- !u!157 &3 +LightmapSettings: + m_ObjectHideFlags: 0 + serializedVersion: 11 + m_GIWorkflowMode: 1 + m_GISettings: + serializedVersion: 2 + m_BounceScale: 1 + m_IndirectOutputScale: 1 + m_AlbedoBoost: 1 + m_EnvironmentLightingMode: 0 + m_EnableBakedLightmaps: 0 + m_EnableRealtimeLightmaps: 0 + m_LightmapEditorSettings: + serializedVersion: 10 + m_Resolution: 2 + m_BakeResolution: 40 + m_AtlasSize: 1024 + m_AO: 0 + m_AOMaxDistance: 1 + m_CompAOExponent: 1 + m_CompAOExponentDirect: 0 + m_Padding: 2 + m_LightmapParameters: {fileID: 0} + m_LightmapsBakeMode: 1 + m_TextureCompression: 1 + m_FinalGather: 0 + m_FinalGatherFiltering: 1 + m_FinalGatherRayCount: 256 + m_ReflectionCompression: 2 + m_MixedBakeMode: 2 + m_BakeBackend: 1 + m_PVRSampling: 1 + m_PVRDirectSampleCount: 32 + m_PVRSampleCount: 512 + m_PVRBounces: 2 + m_PVRFilterTypeDirect: 0 + m_PVRFilterTypeIndirect: 0 + m_PVRFilterTypeAO: 0 + m_PVRFilteringMode: 1 + m_PVRCulling: 1 + m_PVRFilteringGaussRadiusDirect: 1 + m_PVRFilteringGaussRadiusIndirect: 5 + m_PVRFilteringGaussRadiusAO: 2 + m_PVRFilteringAtrousPositionSigmaDirect: 0.5 + m_PVRFilteringAtrousPositionSigmaIndirect: 2 + m_PVRFilteringAtrousPositionSigmaAO: 1 + m_ShowResolutionOverlay: 1 + m_LightingDataAsset: {fileID: 0} + m_UseShadowmask: 1 +--- !u!196 &4 +NavMeshSettings: + serializedVersion: 2 + m_ObjectHideFlags: 0 + m_BuildSettings: + serializedVersion: 2 + agentTypeID: 0 + agentRadius: 0.5 + agentHeight: 2 + agentSlope: 45 + agentClimb: 0.4 + ledgeDropHeight: 0 + maxJumpAcrossDistance: 0 + minRegionArea: 2 + manualCellSize: 0 + cellSize: 0.16666667 + manualTileSize: 0 + tileSize: 256 + accuratePlacement: 0 + debug: + m_Flags: 0 + m_NavMeshData: {fileID: 0} +--- !u!1 &22377052 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 22377056} + - component: {fileID: 22377055} + - component: {fileID: 22377054} + - component: {fileID: 22377053} + m_Layer: 0 + m_Name: Pinch + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!114 &22377053 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 22377052} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: ee158225ee1e59f4791627785501d950, type: 3} + m_Name: + m_EditorClassIdentifier: + shaderTypes: 4 + normalStrenght: 5 + normalSmoothing: 1 + computingNormal: 0 +--- !u!114 &22377054 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 22377052} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 98b644315d7a92842b89e04f55c48e02, type: 3} + m_Name: + m_EditorClassIdentifier: +--- !u!212 &22377055 +SpriteRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 22377052} + m_Enabled: 1 + m_CastShadows: 0 + m_ReceiveShadows: 0 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 429931735} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 0 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_Sprite: {fileID: 21300000, guid: 519dafacd208bb64c83d5124be03b09d, type: 3} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_FlipX: 0 + m_FlipY: 0 + m_DrawMode: 0 + m_Size: {x: 5.12, y: 5.12} + m_AdaptiveModeThreshold: 0.5 + m_SpriteTileMode: 0 + m_WasSpriteAssigned: 1 + m_MaskInteraction: 0 + m_SpriteSortPoint: 0 +--- !u!4 &22377056 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 22377052} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: -15.4, y: -5.51, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 298946312} + m_RootOrder: 5 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &56751282 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 56751283} + - component: {fileID: 56751286} + - component: {fileID: 56751285} + - component: {fileID: 56751284} + m_Layer: 0 + m_Name: Watery + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &56751283 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 56751282} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: -19.67, y: -5.2, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 298946312} + m_RootOrder: 9 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &56751284 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 56751282} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: ee158225ee1e59f4791627785501d950, type: 3} + m_Name: + m_EditorClassIdentifier: + shaderTypes: 4 + normalStrenght: 5 + normalSmoothing: 1 + computingNormal: 0 +--- !u!114 &56751285 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 56751282} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 98b644315d7a92842b89e04f55c48e02, type: 3} + m_Name: + m_EditorClassIdentifier: +--- !u!212 &56751286 +SpriteRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 56751282} + m_Enabled: 1 + m_CastShadows: 0 + m_ReceiveShadows: 0 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 1455058978} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 0 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_Sprite: {fileID: 21300000, guid: 519dafacd208bb64c83d5124be03b09d, type: 3} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_FlipX: 0 + m_FlipY: 0 + m_DrawMode: 0 + m_Size: {x: 5.12, y: 5.12} + m_AdaptiveModeThreshold: 0.5 + m_SpriteTileMode: 0 + m_WasSpriteAssigned: 1 + m_MaskInteraction: 0 + m_SpriteSortPoint: 0 +--- !u!21 &173818797 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: AllIn1SpriteShader/AllIn1SpriteShader + m_Shader: {fileID: 4800000, guid: a36b7719ff0465b42ab1407d67672c5f, type: 3} + m_ShaderKeywords: ETC1_EXTERNAL_ALPHA GLOWTEX_ON GLOW_ON OUTBASE8DIR_ON OUTBASE_ON + TWISTUV_ON _GLOWTEXUSED_ON _OUTLINE8DIRECTIONS_ON + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _ColorRampTex: + m_Texture: {fileID: 2800000, guid: 279657edc397ece4b8029c727adf6ddc, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ColorSwapTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DistortTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _FadeBurnTex: + m_Texture: {fileID: 2800000, guid: 32e8df0008bebe746b1681a71c61f31c, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _FadeTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _GlowTex: + m_Texture: {fileID: 2800000, guid: 8608ef90f91271745a17f7210fe1e7db, type: 3} + 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} + - _OutlineDistortTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OutlineTex: + m_Texture: {fileID: 2800000, guid: 74087f6d03f233e4a8a142fa01f9e5cf, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ShineMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - _Alpha: 1 + - _AlphaCutoffValue: 0.25 + - _AlphaRoundThreshold: 0.5 + - _BillboardY: 0 + - _BlurHD: 0 + - _BlurIntensity: 10 + - _ChromAberrAlpha: 0.4 + - _ChromAberrAmount: 1 + - _ClipUvDown: 0.95 + - _ClipUvLeft: 1 + - _ClipUvRight: 1 + - _ClipUvUp: 0.95 + - _ColorChangeLuminosity: 0 + - _ColorChangeTolerance: 0.25 + - _ColorRampLuminosity: 0 + - _ColorRampOutline: 0 + - _ColorSwapBlueLuminosity: 0.5 + - _ColorSwapGreenLuminosity: 0.5 + - _ColorSwapRedLuminosity: 0.5 + - _DistortAmount: 0.5 + - _DistortTexXSpeed: 5 + - _DistortTexYSpeed: 5 + - _FadeAmount: -0.1 + - _FadeBurnGlow: 2 + - _FadeBurnTransition: 0.075 + - _FadeBurnWidth: 0.025 + - _FishEyeUvAmount: 0.35 + - _FlickerAlpha: 0 + - _FlickerFreq: 0.2 + - _FlickerPercent: 0.05 + - _GhostColorBoost: 1 + - _GhostTransparency: 0 + - _GlitchAmount: 3 + - _GlitchSize: 1 + - _Glow: 17.1 + - _GlowTexUsed: 1 + - _GradBlend: 1 + - _GradBoostX: 1.2 + - _GradBoostY: 1.2 + - _GradIsRadial: 0 + - _GrassManualAnim: 1 + - _GrassManualToggle: 0 + - _GrassRadialBend: 0.1 + - _GrassSpeed: 2 + - _GrassWind: 20 + - _GreyscaleLuminosity: 0 + - _GreyscaleOutline: 0 + - _HandDrawnAmount: 10 + - _HandDrawnSpeed: 5 + - _HitEffectBlend: 1 + - _HitEffectGlow: 5 + - _HologramFlickerAlpha: 0 + - _HologramFlickerFreq: 0.2 + - _HologramFlickerPercent: 0.05 + - _HologramMaxAlpha: 1 + - _HologramMinAlpha: 0 + - _HologramStripesAlpha: 0.4 + - _HologramStripesAmount: 50 + - _HologramStripesFill: 0.4 + - _HologramStripesLuminosity: 1 + - _HologramStripesSpeed: 5 + - _HologramUnmodAmount: 0.4 + - _HsvBright: 1 + - _HsvSaturation: 1 + - _HsvShift: 14 + - _InnerOutlineAlpha: 1 + - _InnerOutlineGlow: 1 + - _InnerOutlineThickness: 1 + - _MaxXUV: 1 + - _MaxYUV: 1 + - _MinXUV: 0 + - _MinYUV: 0 + - _MotionBlurAngle: 0.1 + - _MotionBlurDist: 1.25 + - _MyDstMode: 10 + - _MySrcMode: 5 + - _NegativeAmount: 1 + - _OffsetUvX: 0 + - _OffsetUvY: 0 + - _OnlyInnerOutline: 0 + - _OnlyOutline: 0 + - _Outline8Directions: 1 + - _OutlineAlpha: 1 + - _OutlineDistortAmount: 0.5 + - _OutlineDistortTexXSpeed: 5 + - _OutlineDistortTexYSpeed: 5 + - _OutlineDistortToggle: 0 + - _OutlineGlow: 1.5 + - _OutlineIsPixel: 0 + - _OutlinePixelWidth: 1 + - _OutlineTexGrey: 0 + - _OutlineTexToggle: 0 + - _OutlineTexXSpeed: 10 + - _OutlineTexYSpeed: 0 + - _OutlineWidth: 0.028 + - _PinchUvAmount: 0.251 + - _PixelateSize: 60 + - _PosterizeGamma: 0.75 + - _PosterizeNumColors: 8 + - _PosterizeOutline: 0 + - _RandomSeed: 0 + - _RectSize: 1 + - _RotateUvAmount: 0 + - _RoundWaveSpeed: 2 + - _RoundWaveStrength: 0.7 + - _ShadowAlpha: 0.5 + - _ShadowX: 0.1 + - _ShadowY: -0.05 + - _ShakeUvSpeed: 2.5 + - _ShakeUvX: 1.5 + - _ShakeUvY: 1 + - _ShineGlow: 1 + - _ShineLocation: 0.5 + - _ShineRotate: 0 + - _ShineWidth: 0.1 + - _TextureScrollXSpeed: 1 + - _TextureScrollYSpeed: 0 + - _TwistUvAmount: 1.41 + - _TwistUvPosX: 0.558 + - _TwistUvPosY: 0.503 + - _TwistUvRadius: 0.2 + - _WaveAmount: 7 + - _WaveSpeed: 10 + - _WaveStrength: 7.5 + - _WaveX: 0 + - _WaveY: 0.5 + - _ZTestMode: 4 + - _ZWrite: 0 + - _ZoomUvAmount: 0.5 + m_Colors: + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _ColorChangeNewCol: {r: 1, g: 1, b: 0, a: 1} + - _ColorChangeTarget: {r: 1, g: 0, b: 0, a: 1} + - _ColorSwapBlue: {r: 1, g: 1, b: 1, a: 1} + - _ColorSwapGreen: {r: 1, g: 1, b: 1, a: 1} + - _ColorSwapRed: {r: 1, g: 1, b: 1, a: 1} + - _FadeBurnColor: {r: 1, g: 1, b: 0, a: 1} + - _GlowColor: {r: 1, g: 0, b: 0, a: 1} + - _GradBotLeftCol: {r: 0, g: 0, b: 1, a: 1} + - _GradBotRightCol: {r: 0, g: 0, b: 1, a: 1} + - _GradTopLeftCol: {r: 1, g: 0, b: 0, a: 1} + - _GradTopRightCol: {r: 1, g: 0, b: 0, a: 1} + - _GreyscaleTintColor: {r: 1, g: 1, b: 1, a: 1} + - _HitEffectColor: {r: 1, g: 1, b: 1, a: 1} + - _HologramStripeColor: {r: 1, g: 1, b: 1, a: 1} + - _InnerOutlineColor: {r: 1, g: 0, b: 0, a: 1} + - _OutlineColor: {r: 1, g: 0.7877358, b: 0.7877358, a: 1} + - _ShadowColor: {r: 0, g: 0, b: 0, a: 1} + - _ShineColor: {r: 1, g: 1, b: 1, a: 1} +--- !u!1 &252177635 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 252177636} + - component: {fileID: 252177639} + - component: {fileID: 252177638} + - component: {fileID: 252177637} + m_Layer: 0 + m_Name: Gameboy + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &252177636 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 252177635} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: -15.49, y: -0.19999897, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 298946312} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &252177637 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 252177635} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: ee158225ee1e59f4791627785501d950, type: 3} + m_Name: + m_EditorClassIdentifier: + shaderTypes: 0 + normalStrenght: 5 + normalSmoothing: 1 + computingNormal: 0 +--- !u!114 &252177638 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 252177635} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 98b644315d7a92842b89e04f55c48e02, type: 3} + m_Name: + m_EditorClassIdentifier: +--- !u!212 &252177639 +SpriteRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 252177635} + m_Enabled: 1 + m_CastShadows: 0 + m_ReceiveShadows: 0 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 1807806170} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 0 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_Sprite: {fileID: 21300000, guid: 519dafacd208bb64c83d5124be03b09d, type: 3} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_FlipX: 0 + m_FlipY: 0 + m_DrawMode: 0 + m_Size: {x: 5.12, y: 5.12} + m_AdaptiveModeThreshold: 0.5 + m_SpriteTileMode: 0 + m_WasSpriteAssigned: 1 + m_MaskInteraction: 0 + m_SpriteSortPoint: 0 +--- !u!4 &290590332 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 290590333} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 4.5100007, y: 4.8000007, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 298946312} + m_RootOrder: 13 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &290590333 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 290590332} + - component: {fileID: 290590335} + - component: {fileID: 290590336} + - component: {fileID: 290590334} + m_Layer: 0 + m_Name: Outline1 + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!114 &290590334 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 290590333} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: ee158225ee1e59f4791627785501d950, type: 3} + m_Name: + m_EditorClassIdentifier: + shaderTypes: 4 + normalStrenght: 5 + normalSmoothing: 1 + computingNormal: 0 +--- !u!212 &290590335 +SpriteRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 290590333} + m_Enabled: 1 + m_CastShadows: 0 + m_ReceiveShadows: 0 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 1847541096} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 0 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_Sprite: {fileID: 21300000, guid: 519dafacd208bb64c83d5124be03b09d, type: 3} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_FlipX: 0 + m_FlipY: 0 + m_DrawMode: 0 + m_Size: {x: 5.12, y: 5.12} + m_AdaptiveModeThreshold: 0.5 + m_SpriteTileMode: 0 + m_WasSpriteAssigned: 1 + m_MaskInteraction: 0 + m_SpriteSortPoint: 0 +--- !u!114 &290590336 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 290590333} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 98b644315d7a92842b89e04f55c48e02, type: 3} + m_Name: + m_EditorClassIdentifier: +--- !u!1 &298946310 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 298946312} + - component: {fileID: 298946311} + m_Layer: 0 + m_Name: AutoScroll + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!114 &298946311 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 298946310} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: cc188be2d64e8d041aed6f375d92c463, type: 3} + m_Name: + m_EditorClassIdentifier: + totalTime: 12 + sceneDescription: {fileID: 2008890716} +--- !u!4 &298946312 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 298946310} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 2.7768, y: 2.7768, z: 2.7768} + m_Children: + - {fileID: 252177636} + - {fileID: 786925991} + - {fileID: 984096428} + - {fileID: 520228356} + - {fileID: 1119325822} + - {fileID: 22377056} + - {fileID: 1931308735} + - {fileID: 1073973762} + - {fileID: 1229041066} + - {fileID: 56751283} + - {fileID: 1988936578} + - {fileID: 353408739} + - {fileID: 746759203} + - {fileID: 290590332} + - {fileID: 2045252512} + - {fileID: 1434614528} + - {fileID: 368348656} + - {fileID: 1934762264} + - {fileID: 519649707} + - {fileID: 1350115731} + - {fileID: 1675838108} + - {fileID: 1875180451} + - {fileID: 1507269762} + - {fileID: 1038353159} + - {fileID: 471382084} + - {fileID: 938057646} + - {fileID: 1927382521} + m_Father: {fileID: 0} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!21 &352855906 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: AllIn1SpriteShader/AllIn1SpriteShader + m_Shader: {fileID: 4800000, guid: a36b7719ff0465b42ab1407d67672c5f, type: 3} + m_ShaderKeywords: COLORRAMP_ON ETC1_EXTERNAL_ALPHA FISHEYE_ON POSTERIZE_ON + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _ColorRampTex: + m_Texture: {fileID: 2800000, guid: a9058d3dd9b9dd14cbc6b16db7859653, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ColorSwapTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DistortTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _FadeBurnTex: + m_Texture: {fileID: 2800000, guid: 32e8df0008bebe746b1681a71c61f31c, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _FadeTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _GlowTex: + 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} + - _OutlineDistortTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OutlineTex: + m_Texture: {fileID: 2800000, guid: 74087f6d03f233e4a8a142fa01f9e5cf, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ShineMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - _Alpha: 1 + - _AlphaCutoffValue: 0.25 + - _AlphaRoundThreshold: 0.5 + - _BillboardY: 0 + - _BlurHD: 0 + - _BlurIntensity: 10 + - _ChromAberrAlpha: 0.4 + - _ChromAberrAmount: 1 + - _ClipUvDown: 1 + - _ClipUvLeft: 1 + - _ClipUvRight: 1 + - _ClipUvUp: 1 + - _ColorChangeLuminosity: 0 + - _ColorChangeTolerance: 0.25 + - _ColorRampLuminosity: 0 + - _ColorRampOutline: 0 + - _ColorSwapBlueLuminosity: 0.5 + - _ColorSwapGreenLuminosity: 0.5 + - _ColorSwapRedLuminosity: 0.5 + - _DistortAmount: 0.5 + - _DistortTexXSpeed: 5 + - _DistortTexYSpeed: 5 + - _FadeAmount: -0.1 + - _FadeBurnGlow: 2 + - _FadeBurnTransition: 0.075 + - _FadeBurnWidth: 0.025 + - _FishEyeUvAmount: 0.35 + - _FlickerAlpha: 0 + - _FlickerFreq: 0.2 + - _FlickerPercent: 0.05 + - _GhostColorBoost: 1 + - _GhostTransparency: 0 + - _GlitchAmount: 3 + - _GlitchSize: 1 + - _Glow: 10 + - _GlowTexUsed: 0 + - _GradBlend: 1 + - _GradBoostX: 1.2 + - _GradBoostY: 1.2 + - _GradIsRadial: 0 + - _GrassManualAnim: 1 + - _GrassManualToggle: 0 + - _GrassRadialBend: 0.1 + - _GrassSpeed: 2 + - _GrassWind: 20 + - _GreyscaleLuminosity: 0 + - _GreyscaleOutline: 0 + - _HandDrawnAmount: 10 + - _HandDrawnSpeed: 5 + - _HitEffectBlend: 1 + - _HitEffectGlow: 5 + - _HologramFlickerAlpha: 0 + - _HologramFlickerFreq: 0.2 + - _HologramFlickerPercent: 0.05 + - _HologramMaxAlpha: 1 + - _HologramMinAlpha: 0 + - _HologramStripesAlpha: 0.4 + - _HologramStripesAmount: 50 + - _HologramStripesFill: 0.4 + - _HologramStripesLuminosity: 1 + - _HologramStripesSpeed: 5 + - _HologramUnmodAmount: 0.4 + - _HsvBright: 1 + - _HsvSaturation: 1 + - _HsvShift: 180 + - _InnerOutlineAlpha: 1 + - _InnerOutlineGlow: 1 + - _InnerOutlineThickness: 1 + - _MaxXUV: 1 + - _MaxYUV: 1 + - _MinXUV: 0 + - _MinYUV: 0 + - _MotionBlurAngle: 0.1 + - _MotionBlurDist: 1.25 + - _MyDstMode: 10 + - _MySrcMode: 5 + - _NegativeAmount: 1 + - _OffsetUvX: 0 + - _OffsetUvY: 0 + - _OnlyInnerOutline: 0 + - _OnlyOutline: 0 + - _Outline8Directions: 0 + - _OutlineAlpha: 1 + - _OutlineDistortAmount: 0.5 + - _OutlineDistortTexXSpeed: 5 + - _OutlineDistortTexYSpeed: 5 + - _OutlineDistortToggle: 0 + - _OutlineGlow: 1.5 + - _OutlineIsPixel: 0 + - _OutlinePixelWidth: 1 + - _OutlineTexGrey: 0 + - _OutlineTexToggle: 0 + - _OutlineTexXSpeed: 10 + - _OutlineTexYSpeed: 0 + - _OutlineWidth: 0.004 + - _PinchUvAmount: 0.35 + - _PixelateSize: 32 + - _PosterizeGamma: 0.75 + - _PosterizeNumColors: 8 + - _PosterizeOutline: 0 + - _RandomSeed: 0 + - _RectSize: 1 + - _RotateUvAmount: 0 + - _RoundWaveSpeed: 2 + - _RoundWaveStrength: 0.7 + - _ShadowAlpha: 0.5 + - _ShadowX: 0.1 + - _ShadowY: -0.05 + - _ShakeUvSpeed: 2.5 + - _ShakeUvX: 1.5 + - _ShakeUvY: 1 + - _ShineGlow: 1 + - _ShineLocation: 0.5 + - _ShineRotate: 0 + - _ShineWidth: 0.1 + - _TextureScrollXSpeed: 1 + - _TextureScrollYSpeed: 0 + - _TwistUvAmount: 1 + - _TwistUvPosX: 0.5 + - _TwistUvPosY: 0.5 + - _TwistUvRadius: 0.75 + - _WaveAmount: 7 + - _WaveSpeed: 10 + - _WaveStrength: 7.5 + - _WaveX: 0 + - _WaveY: 0.5 + - _ZTestMode: 4 + - _ZWrite: 0 + - _ZoomUvAmount: 0.5 + m_Colors: + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _ColorChangeNewCol: {r: 1, g: 1, b: 0, a: 1} + - _ColorChangeTarget: {r: 1, g: 0, b: 0, a: 1} + - _ColorSwapBlue: {r: 1, g: 1, b: 1, a: 1} + - _ColorSwapGreen: {r: 1, g: 1, b: 1, a: 1} + - _ColorSwapRed: {r: 1, g: 1, b: 1, a: 1} + - _FadeBurnColor: {r: 1, g: 1, b: 0, a: 1} + - _GlowColor: {r: 1, g: 1, b: 1, a: 1} + - _GradBotLeftCol: {r: 0, g: 0, b: 1, a: 1} + - _GradBotRightCol: {r: 0, g: 0, b: 1, a: 1} + - _GradTopLeftCol: {r: 1, g: 0, b: 0, a: 1} + - _GradTopRightCol: {r: 1, g: 0, b: 0, a: 1} + - _GreyscaleTintColor: {r: 1, g: 1, b: 1, a: 1} + - _HitEffectColor: {r: 1, g: 1, b: 1, a: 1} + - _HologramStripeColor: {r: 1, g: 1, b: 1, a: 1} + - _InnerOutlineColor: {r: 1, g: 0, b: 0, a: 1} + - _OutlineColor: {r: 1, g: 1, b: 1, a: 1} + - _ShadowColor: {r: 0, g: 0, b: 0, a: 1} + - _ShineColor: {r: 1, g: 1, b: 1, a: 1} +--- !u!1 &353408738 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 353408739} + - component: {fileID: 353408742} + - component: {fileID: 353408741} + - component: {fileID: 353408740} + m_Layer: 0 + m_Name: Hallucination + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &353408739 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 353408738} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 9.51, y: -0.19999897, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 298946312} + m_RootOrder: 11 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &353408740 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 353408738} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: ee158225ee1e59f4791627785501d950, type: 3} + m_Name: + m_EditorClassIdentifier: + shaderTypes: 4 + normalStrenght: 5 + normalSmoothing: 1 + computingNormal: 0 +--- !u!114 &353408741 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 353408738} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 98b644315d7a92842b89e04f55c48e02, type: 3} + m_Name: + m_EditorClassIdentifier: +--- !u!212 &353408742 +SpriteRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 353408738} + m_Enabled: 1 + m_CastShadows: 0 + m_ReceiveShadows: 0 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 832006925} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 0 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_Sprite: {fileID: 21300000, guid: 519dafacd208bb64c83d5124be03b09d, type: 3} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_FlipX: 0 + m_FlipY: 0 + m_DrawMode: 0 + m_Size: {x: 5.12, y: 5.12} + m_AdaptiveModeThreshold: 0.5 + m_SpriteTileMode: 0 + m_WasSpriteAssigned: 1 + m_MaskInteraction: 0 + m_SpriteSortPoint: 0 +--- !u!1 &356332865 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 356332866} + - component: {fileID: 356332869} + - component: {fileID: 356332868} + - component: {fileID: 356332867} + m_Layer: 5 + m_Name: Background + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &356332866 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 356332865} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 564363701} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &356332867 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 356332865} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: ee158225ee1e59f4791627785501d950, type: 3} + m_Name: + m_EditorClassIdentifier: + shaderTypes: 0 + normalStrenght: 5 + normalSmoothing: 1 + computingNormal: 0 +--- !u!114 &356332868 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 356332865} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: -765806418, guid: f70555f144d8491a825f0804e09c671c, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 478667331} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_Sprite: {fileID: 0} + m_Type: 0 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 + m_UseSpriteMesh: 0 +--- !u!222 &356332869 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 356332865} + m_CullTransparentMesh: 0 +--- !u!1 &368348655 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 368348656} + - component: {fileID: 368348658} + - component: {fileID: 368348659} + - component: {fileID: 368348657} + m_Layer: 0 + m_Name: Ghost + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &368348656 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 368348655} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 20.410002, y: -5.1999993, z: 0} + m_LocalScale: {x: 0.78757, y: 0.78757, z: 0.78757} + m_Children: [] + m_Father: {fileID: 298946312} + m_RootOrder: 16 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &368348657 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 368348655} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: ee158225ee1e59f4791627785501d950, type: 3} + m_Name: + m_EditorClassIdentifier: + shaderTypes: 4 + normalStrenght: 5 + normalSmoothing: 1 + computingNormal: 0 +--- !u!212 &368348658 +SpriteRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 368348655} + m_Enabled: 1 + m_CastShadows: 0 + m_ReceiveShadows: 0 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 426087588} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 0 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_Sprite: {fileID: 21300000, guid: 519dafacd208bb64c83d5124be03b09d, type: 3} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_FlipX: 0 + m_FlipY: 0 + m_DrawMode: 0 + m_Size: {x: 5.12, y: 5.12} + m_AdaptiveModeThreshold: 0.5 + m_SpriteTileMode: 0 + m_WasSpriteAssigned: 1 + m_MaskInteraction: 0 + m_SpriteSortPoint: 0 +--- !u!114 &368348659 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 368348655} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 98b644315d7a92842b89e04f55c48e02, type: 3} + m_Name: + m_EditorClassIdentifier: +--- !u!21 &423033871 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: AllIn1SpriteShader/AllIn1SpriteShader + m_Shader: {fileID: 4800000, guid: a36b7719ff0465b42ab1407d67672c5f, type: 3} + m_ShaderKeywords: ETC1_EXTERNAL_ALPHA FADE_ON OUTBASE8DIR_ON PINCH_ON _OUTLINE8DIRECTIONS_ON + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _ColorRampTex: + m_Texture: {fileID: 2800000, guid: 279657edc397ece4b8029c727adf6ddc, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ColorSwapTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DistortTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _FadeBurnTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _FadeTex: + m_Texture: {fileID: 2800000, guid: dbaa905cec0d2b944b5d1ebdbc3ceb1e, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _GlowTex: + 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} + - _OutlineDistortTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OutlineTex: + m_Texture: {fileID: 2800000, guid: 74087f6d03f233e4a8a142fa01f9e5cf, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ShineMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - _Alpha: 1 + - _AlphaCutoffValue: 0.25 + - _AlphaRoundThreshold: 0.5 + - _BillboardY: 0 + - _BlurHD: 0 + - _BlurIntensity: 10 + - _ChromAberrAlpha: 0.4 + - _ChromAberrAmount: 1 + - _ClipUvDown: 1 + - _ClipUvLeft: 1 + - _ClipUvRight: 1 + - _ClipUvUp: 1 + - _ColorChangeLuminosity: 0 + - _ColorChangeTolerance: 0.25 + - _ColorRampLuminosity: 0 + - _ColorRampOutline: 0 + - _ColorSwapBlueLuminosity: 0.5 + - _ColorSwapGreenLuminosity: 0.5 + - _ColorSwapRedLuminosity: 0.5 + - _DistortAmount: 0.5 + - _DistortTexXSpeed: 5 + - _DistortTexYSpeed: 5 + - _FadeAmount: 0.25 + - _FadeBurnGlow: 1.9 + - _FadeBurnTransition: 0.274 + - _FadeBurnWidth: 0.07 + - _FishEyeUvAmount: 0.35 + - _FlickerAlpha: 0 + - _FlickerFreq: 0.2 + - _FlickerPercent: 0.05 + - _GhostColorBoost: 1 + - _GhostTransparency: 0 + - _GlitchAmount: 3 + - _GlitchSize: 1 + - _Glow: 10 + - _GlowTexUsed: 0 + - _GradBlend: 1 + - _GradBoostX: 1.2 + - _GradBoostY: 1.2 + - _GradIsRadial: 0 + - _GrassManualAnim: 1 + - _GrassManualToggle: 0 + - _GrassRadialBend: 0.1 + - _GrassSpeed: 2 + - _GrassWind: 20 + - _GreyscaleLuminosity: 0 + - _GreyscaleOutline: 0 + - _HandDrawnAmount: 10 + - _HandDrawnSpeed: 5 + - _HitEffectBlend: 1 + - _HitEffectGlow: 5 + - _HologramFlickerAlpha: 0 + - _HologramFlickerFreq: 0.2 + - _HologramFlickerPercent: 0.05 + - _HologramMaxAlpha: 1 + - _HologramMinAlpha: 0 + - _HologramStripesAlpha: 0.4 + - _HologramStripesAmount: 50 + - _HologramStripesFill: 0.4 + - _HologramStripesLuminosity: 1 + - _HologramStripesSpeed: 5 + - _HologramUnmodAmount: 0.4 + - _HsvBright: 1 + - _HsvSaturation: 1 + - _HsvShift: 180 + - _InnerOutlineAlpha: 1 + - _InnerOutlineGlow: 1 + - _InnerOutlineThickness: 1 + - _MaxXUV: 1 + - _MaxYUV: 1 + - _MinXUV: 0 + - _MinYUV: 0 + - _MotionBlurAngle: 0.1 + - _MotionBlurDist: 1.25 + - _MyDstMode: 10 + - _MySrcMode: 5 + - _NegativeAmount: 1 + - _OffsetUvX: 0 + - _OffsetUvY: 0 + - _OnlyInnerOutline: 0 + - _OnlyOutline: 0 + - _Outline8Directions: 1 + - _OutlineAlpha: 1 + - _OutlineDistortAmount: 0.5 + - _OutlineDistortTexXSpeed: 5 + - _OutlineDistortTexYSpeed: 5 + - _OutlineDistortToggle: 0 + - _OutlineGlow: 1 + - _OutlineIsPixel: 0 + - _OutlinePixelWidth: 1 + - _OutlineTexGrey: 0 + - _OutlineTexToggle: 0 + - _OutlineTexXSpeed: 10 + - _OutlineTexYSpeed: 0 + - _OutlineWidth: 0.0141 + - _PinchUvAmount: 0 + - _PixelateSize: 32 + - _PosterizeGamma: 0.75 + - _PosterizeNumColors: 8 + - _PosterizeOutline: 0 + - _RandomSeed: 0 + - _RectSize: 1 + - _RotateUvAmount: 0 + - _RoundWaveSpeed: 2 + - _RoundWaveStrength: 0.7 + - _ShadowAlpha: 0.5 + - _ShadowX: 0.1 + - _ShadowY: -0.05 + - _ShakeUvSpeed: 2.5 + - _ShakeUvX: 1.5 + - _ShakeUvY: 1 + - _ShineGlow: 1 + - _ShineLocation: 0.5 + - _ShineRotate: 0 + - _ShineWidth: 0.1 + - _TextureScrollXSpeed: 1 + - _TextureScrollYSpeed: 0 + - _TwistUvAmount: 1 + - _TwistUvPosX: 0.5 + - _TwistUvPosY: 0.5 + - _TwistUvRadius: 0.75 + - _WaveAmount: 7 + - _WaveSpeed: 10 + - _WaveStrength: 7.5 + - _WaveX: 0 + - _WaveY: 0.5 + - _ZTestMode: 4 + - _ZWrite: 0 + - _ZoomUvAmount: 0.5 + m_Colors: + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _ColorChangeNewCol: {r: 1, g: 1, b: 0, a: 1} + - _ColorChangeTarget: {r: 1, g: 0, b: 0, a: 1} + - _ColorSwapBlue: {r: 1, g: 1, b: 1, a: 1} + - _ColorSwapGreen: {r: 1, g: 1, b: 1, a: 1} + - _ColorSwapRed: {r: 1, g: 1, b: 1, a: 1} + - _FadeBurnColor: {r: 0, g: 0.9400835, b: 1, a: 1} + - _GlowColor: {r: 1, g: 1, b: 1, a: 1} + - _GradBotLeftCol: {r: 0, g: 0, b: 1, a: 1} + - _GradBotRightCol: {r: 0, g: 0, b: 1, a: 1} + - _GradTopLeftCol: {r: 1, g: 0, b: 0, a: 1} + - _GradTopRightCol: {r: 1, g: 0, b: 0, a: 1} + - _GreyscaleTintColor: {r: 1, g: 1, b: 1, a: 1} + - _HitEffectColor: {r: 1, g: 1, b: 1, a: 1} + - _HologramStripeColor: {r: 1, g: 1, b: 1, a: 1} + - _InnerOutlineColor: {r: 1, g: 0, b: 0, a: 1} + - _OutlineColor: {r: 0, g: 0.94117653, b: 1, a: 1} + - _ShadowColor: {r: 0, g: 0, b: 0, a: 1} + - _ShineColor: {r: 1, g: 1, b: 1, a: 1} +--- !u!21 &426087588 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: AllIn1SpriteShader/AllIn1SpriteShader + m_Shader: {fileID: 4800000, guid: a36b7719ff0465b42ab1407d67672c5f, type: 3} + m_ShaderKeywords: DOODLE_ON ETC1_EXTERNAL_ALPHA FISHEYE_ON GHOST_ON WAVEUV_ON + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _ColorRampTex: + m_Texture: {fileID: 2800000, guid: 279657edc397ece4b8029c727adf6ddc, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ColorSwapTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DistortTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _FadeBurnTex: + m_Texture: {fileID: 2800000, guid: 32e8df0008bebe746b1681a71c61f31c, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _FadeTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _GlowTex: + 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} + - _OutlineDistortTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OutlineTex: + m_Texture: {fileID: 2800000, guid: 74087f6d03f233e4a8a142fa01f9e5cf, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ShineMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - _Alpha: 1 + - _AlphaCutoffValue: 0.25 + - _AlphaRoundThreshold: 0.5 + - _BillboardY: 0 + - _BlurHD: 0 + - _BlurIntensity: 10 + - _ChromAberrAlpha: 0.4 + - _ChromAberrAmount: 1 + - _ClipUvDown: 1 + - _ClipUvLeft: 1 + - _ClipUvRight: 1 + - _ClipUvUp: 1 + - _ColorChangeLuminosity: 0 + - _ColorChangeTolerance: 0.25 + - _ColorRampLuminosity: 0 + - _ColorRampOutline: 0 + - _ColorSwapBlueLuminosity: 0.5 + - _ColorSwapGreenLuminosity: 0.5 + - _ColorSwapRedLuminosity: 0.5 + - _DistortAmount: 0.5 + - _DistortTexXSpeed: 5 + - _DistortTexYSpeed: 5 + - _FadeAmount: -0.1 + - _FadeBurnGlow: 2 + - _FadeBurnTransition: 0.075 + - _FadeBurnWidth: 0.025 + - _FishEyeUvAmount: 0.296 + - _FlickerAlpha: 0 + - _FlickerFreq: 0.2 + - _FlickerPercent: 0.05 + - _GhostColorBoost: 1.41 + - _GhostTransparency: 0 + - _GlitchAmount: 3 + - _GlitchSize: 1 + - _Glow: 10 + - _GlowTexUsed: 0 + - _GradBlend: 1 + - _GradBoostX: 1.2 + - _GradBoostY: 1.2 + - _GradIsRadial: 0 + - _GrassManualAnim: 1 + - _GrassManualToggle: 0 + - _GrassRadialBend: 0.1 + - _GrassSpeed: 2 + - _GrassWind: 20 + - _GreyscaleLuminosity: 0 + - _GreyscaleOutline: 0 + - _HandDrawnAmount: 10 + - _HandDrawnSpeed: 5 + - _HitEffectBlend: 1 + - _HitEffectGlow: 5 + - _HologramFlickerAlpha: 0 + - _HologramFlickerFreq: 0.2 + - _HologramFlickerPercent: 0.05 + - _HologramMaxAlpha: 1 + - _HologramMinAlpha: 0 + - _HologramStripesAlpha: 0.4 + - _HologramStripesAmount: 50 + - _HologramStripesFill: 0.4 + - _HologramStripesLuminosity: 1 + - _HologramStripesSpeed: 5 + - _HologramUnmodAmount: 0.4 + - _HsvBright: 1 + - _HsvSaturation: 1 + - _HsvShift: 180 + - _InnerOutlineAlpha: 1 + - _InnerOutlineGlow: 1 + - _InnerOutlineThickness: 1 + - _MaxXUV: 1 + - _MaxYUV: 1 + - _MinXUV: 0 + - _MinYUV: 0 + - _MotionBlurAngle: 0.1 + - _MotionBlurDist: 1.25 + - _MyDstMode: 10 + - _MySrcMode: 5 + - _NegativeAmount: 1 + - _OffsetUvX: 0 + - _OffsetUvY: 0 + - _OnlyInnerOutline: 0 + - _OnlyOutline: 0 + - _Outline8Directions: 0 + - _OutlineAlpha: 1 + - _OutlineDistortAmount: 0.5 + - _OutlineDistortTexXSpeed: 5 + - _OutlineDistortTexYSpeed: 5 + - _OutlineDistortToggle: 0 + - _OutlineGlow: 1.5 + - _OutlineIsPixel: 0 + - _OutlinePixelWidth: 1 + - _OutlineTexGrey: 0 + - _OutlineTexToggle: 0 + - _OutlineTexXSpeed: 10 + - _OutlineTexYSpeed: 0 + - _OutlineWidth: 0.004 + - _PinchUvAmount: 0.35 + - _PixelateSize: 32 + - _PosterizeGamma: 0.75 + - _PosterizeNumColors: 8 + - _PosterizeOutline: 0 + - _RandomSeed: 0 + - _RectSize: 1 + - _RotateUvAmount: 0 + - _RoundWaveSpeed: 2 + - _RoundWaveStrength: 0.7 + - _ShadowAlpha: 0.5 + - _ShadowX: 0.1 + - _ShadowY: -0.05 + - _ShakeUvSpeed: 2.5 + - _ShakeUvX: 1.5 + - _ShakeUvY: 1 + - _ShineGlow: 1 + - _ShineLocation: 0.5 + - _ShineRotate: 0 + - _ShineWidth: 0.1 + - _TextureScrollXSpeed: 1 + - _TextureScrollYSpeed: 0 + - _TwistUvAmount: 1 + - _TwistUvPosX: 0.5 + - _TwistUvPosY: 0.5 + - _TwistUvRadius: 0.75 + - _WaveAmount: 7 + - _WaveSpeed: 10 + - _WaveStrength: 7.5 + - _WaveX: 0 + - _WaveY: 0.5 + - _ZTestMode: 4 + - _ZWrite: 0 + - _ZoomUvAmount: 0.5 + m_Colors: + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _ColorChangeNewCol: {r: 1, g: 1, b: 0, a: 1} + - _ColorChangeTarget: {r: 1, g: 0, b: 0, a: 1} + - _ColorSwapBlue: {r: 1, g: 1, b: 1, a: 1} + - _ColorSwapGreen: {r: 1, g: 1, b: 1, a: 1} + - _ColorSwapRed: {r: 1, g: 1, b: 1, a: 1} + - _FadeBurnColor: {r: 1, g: 1, b: 0, a: 1} + - _GlowColor: {r: 1, g: 1, b: 1, a: 1} + - _GradBotLeftCol: {r: 0, g: 0, b: 1, a: 1} + - _GradBotRightCol: {r: 0, g: 0, b: 1, a: 1} + - _GradTopLeftCol: {r: 1, g: 0, b: 0, a: 1} + - _GradTopRightCol: {r: 1, g: 0, b: 0, a: 1} + - _GreyscaleTintColor: {r: 1, g: 1, b: 1, a: 1} + - _HitEffectColor: {r: 1, g: 1, b: 1, a: 1} + - _HologramStripeColor: {r: 1, g: 1, b: 1, a: 1} + - _InnerOutlineColor: {r: 1, g: 0, b: 0, a: 1} + - _OutlineColor: {r: 1, g: 1, b: 1, a: 1} + - _ShadowColor: {r: 0, g: 0, b: 0, a: 1} + - _ShineColor: {r: 1, g: 1, b: 1, a: 1} +--- !u!21 &429931735 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: AllIn1SpriteShader/AllIn1SpriteShader + m_Shader: {fileID: 4800000, guid: a36b7719ff0465b42ab1407d67672c5f, type: 3} + m_ShaderKeywords: COLORRAMP_ON ETC1_EXTERNAL_ALPHA HSV_ON OUTBASE8DIR_ON OUTBASE_ON + OUTTEX_ON PINCH_ON _OUTLINE8DIRECTIONS_ON _OUTLINETEXTOGGLE_ON + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _ColorRampTex: + m_Texture: {fileID: 2800000, guid: b3cfc9bf16a1cfa4ab153965dff63ad3, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ColorSwapTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DistortTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _FadeBurnTex: + m_Texture: {fileID: 2800000, guid: 32e8df0008bebe746b1681a71c61f31c, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _FadeTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _GlowTex: + 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} + - _OutlineDistortTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OutlineTex: + m_Texture: {fileID: 2800000, guid: 74087f6d03f233e4a8a142fa01f9e5cf, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ShineMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - _Alpha: 1 + - _AlphaCutoffValue: 0.25 + - _AlphaRoundThreshold: 0.5 + - _BillboardY: 0 + - _BlurHD: 0 + - _BlurIntensity: 10 + - _ChromAberrAlpha: 0.4 + - _ChromAberrAmount: 1 + - _ClipUvDown: 1 + - _ClipUvLeft: 1 + - _ClipUvRight: 1 + - _ClipUvUp: 1 + - _ColorChangeLuminosity: 0 + - _ColorChangeTolerance: 0.25 + - _ColorRampLuminosity: 0 + - _ColorRampOutline: 0 + - _ColorSwapBlueLuminosity: 0.5 + - _ColorSwapGreenLuminosity: 0.5 + - _ColorSwapRedLuminosity: 0.5 + - _DistortAmount: 1.205 + - _DistortTexXSpeed: 5 + - _DistortTexYSpeed: 5 + - _FadeAmount: -0.1 + - _FadeBurnGlow: 2 + - _FadeBurnTransition: 0.075 + - _FadeBurnWidth: 0.025 + - _FishEyeUvAmount: 0.35 + - _FlickerAlpha: 0 + - _FlickerFreq: 0.2 + - _FlickerPercent: 0.05 + - _GhostColorBoost: 1 + - _GhostTransparency: 0 + - _GlitchAmount: 3 + - _GlitchSize: 1 + - _Glow: 0 + - _GlowTexUsed: 0 + - _GradBlend: 1 + - _GradBoostX: 1.2 + - _GradBoostY: 1.2 + - _GradIsRadial: 0 + - _GrassManualAnim: 1 + - _GrassManualToggle: 0 + - _GrassRadialBend: 0.1 + - _GrassSpeed: 2 + - _GrassWind: 20 + - _GreyscaleLuminosity: 0 + - _GreyscaleOutline: 0 + - _HandDrawnAmount: 10 + - _HandDrawnSpeed: 5 + - _HitEffectBlend: 1 + - _HitEffectGlow: 5 + - _HologramFlickerAlpha: 0 + - _HologramFlickerFreq: 0.2 + - _HologramFlickerPercent: 0.05 + - _HologramMaxAlpha: 1 + - _HologramMinAlpha: 0 + - _HologramStripesAlpha: 0.4 + - _HologramStripesAmount: 50 + - _HologramStripesFill: 0.4 + - _HologramStripesLuminosity: 1 + - _HologramStripesSpeed: 5 + - _HologramUnmodAmount: 0.4 + - _HsvBright: 1.12 + - _HsvSaturation: 1.76 + - _HsvShift: 189 + - _InnerOutlineAlpha: 1 + - _InnerOutlineGlow: 1 + - _InnerOutlineThickness: 1 + - _MaxXUV: 1 + - _MaxYUV: 1 + - _MinXUV: 0 + - _MinYUV: 0 + - _MotionBlurAngle: 0.1 + - _MotionBlurDist: 1.25 + - _MyDstMode: 10 + - _MySrcMode: 5 + - _NegativeAmount: 1 + - _OffsetUvX: 0 + - _OffsetUvY: 0 + - _OnlyInnerOutline: 0 + - _OnlyOutline: 0 + - _Outline8Directions: 1 + - _OutlineAlpha: 1 + - _OutlineDistortAmount: 0.5 + - _OutlineDistortTexXSpeed: 5 + - _OutlineDistortTexYSpeed: 5 + - _OutlineDistortToggle: 0 + - _OutlineGlow: 1.8 + - _OutlineIsPixel: 0 + - _OutlinePixelWidth: 1 + - _OutlineTexGrey: 0 + - _OutlineTexToggle: 1 + - _OutlineTexXSpeed: 10 + - _OutlineTexYSpeed: 0 + - _OutlineWidth: 0.03 + - _PinchUvAmount: 0.148 + - _PixelateSize: 32 + - _PosterizeGamma: 0.75 + - _PosterizeNumColors: 8 + - _PosterizeOutline: 0 + - _RandomSeed: 0 + - _RectSize: 1 + - _RotateUvAmount: 0 + - _RoundWaveSpeed: 2 + - _RoundWaveStrength: 0.7 + - _ShadowAlpha: 0.5 + - _ShadowX: 0.1 + - _ShadowY: -0.05 + - _ShakeUvSpeed: 2.5 + - _ShakeUvX: 1.5 + - _ShakeUvY: 1 + - _ShineGlow: 1 + - _ShineLocation: 0.5 + - _ShineRotate: 0 + - _ShineWidth: 0.1 + - _TextureScrollXSpeed: 1 + - _TextureScrollYSpeed: 0 + - _TwistUvAmount: 1 + - _TwistUvPosX: 0.5 + - _TwistUvPosY: 0.5 + - _TwistUvRadius: 0.75 + - _WaveAmount: 7 + - _WaveSpeed: 10 + - _WaveStrength: 7.5 + - _WaveX: 0 + - _WaveY: 0.5 + - _ZTestMode: 4 + - _ZWrite: 0 + - _ZoomUvAmount: 0.5 + m_Colors: + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _ColorChangeNewCol: {r: 1, g: 1, b: 0, a: 1} + - _ColorChangeTarget: {r: 1, g: 0, b: 0, a: 1} + - _ColorSwapBlue: {r: 1, g: 1, b: 1, a: 1} + - _ColorSwapGreen: {r: 1, g: 1, b: 1, a: 1} + - _ColorSwapRed: {r: 1, g: 1, b: 1, a: 1} + - _FadeBurnColor: {r: 1, g: 1, b: 0, a: 1} + - _GlowColor: {r: 1, g: 1, b: 1, a: 1} + - _GradBotLeftCol: {r: 0, g: 0, b: 1, a: 1} + - _GradBotRightCol: {r: 0, g: 0, b: 1, a: 1} + - _GradTopLeftCol: {r: 1, g: 0, b: 0, a: 1} + - _GradTopRightCol: {r: 1, g: 0, b: 0, a: 1} + - _GreyscaleTintColor: {r: 0, g: 0.80679727, b: 1, a: 1} + - _HitEffectColor: {r: 1, g: 1, b: 1, a: 1} + - _HologramStripeColor: {r: 1, g: 1, b: 1, a: 1} + - _InnerOutlineColor: {r: 1, g: 0, b: 0, a: 1} + - _OutlineColor: {r: 1, g: 1, b: 1, a: 1} + - _ShadowColor: {r: 0, g: 0, b: 0, a: 1} + - _ShineColor: {r: 1, g: 1, b: 1, a: 1} +--- !u!1 &471382083 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 471382084} + - component: {fileID: 471382086} + - component: {fileID: 471382087} + - component: {fileID: 471382085} + m_Layer: 0 + m_Name: Inner Outline + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &471382084 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 471382083} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 4.2400002, y: -5.1999993, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 298946312} + m_RootOrder: 24 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &471382085 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 471382083} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: ee158225ee1e59f4791627785501d950, type: 3} + m_Name: + m_EditorClassIdentifier: + shaderTypes: 4 + normalStrenght: 5 + normalSmoothing: 1 + computingNormal: 0 +--- !u!212 &471382086 +SpriteRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 471382083} + m_Enabled: 1 + m_CastShadows: 0 + m_ReceiveShadows: 0 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 1691765423} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 0 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_Sprite: {fileID: 21300000, guid: 519dafacd208bb64c83d5124be03b09d, type: 3} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_FlipX: 0 + m_FlipY: 0 + m_DrawMode: 0 + m_Size: {x: 5.12, y: 5.12} + m_AdaptiveModeThreshold: 0.5 + m_SpriteTileMode: 0 + m_WasSpriteAssigned: 1 + m_MaskInteraction: 0 + m_SpriteSortPoint: 0 +--- !u!114 &471382087 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 471382083} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 98b644315d7a92842b89e04f55c48e02, type: 3} + m_Name: + m_EditorClassIdentifier: +--- !u!21 &478667331 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: AllIn1SpriteShader/AllIn1SpriteShader + m_Shader: {fileID: 4800000, guid: a36b7719ff0465b42ab1407d67672c5f, type: 3} + m_ShaderKeywords: GRADIENT_ON + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _ColorRampTex: + m_Texture: {fileID: 2800000, guid: 279657edc397ece4b8029c727adf6ddc, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ColorSwapTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DistortTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _FadeBurnTex: + m_Texture: {fileID: 2800000, guid: 32e8df0008bebe746b1681a71c61f31c, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _FadeTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _GlowTex: + 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} + - _OutlineDistortTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OutlineTex: + m_Texture: {fileID: 2800000, guid: 74087f6d03f233e4a8a142fa01f9e5cf, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ShineMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - _Alpha: 1 + - _AlphaCutoffValue: 0.25 + - _AlphaRoundThreshold: 0.5 + - _BillboardY: 0 + - _BlurHD: 0 + - _BlurIntensity: 10 + - _ChromAberrAlpha: 0.4 + - _ChromAberrAmount: 1 + - _ClipUvDown: 1 + - _ClipUvLeft: 1 + - _ClipUvRight: 1 + - _ClipUvUp: 1 + - _ColorChangeLuminosity: 0 + - _ColorChangeTolerance: 0.25 + - _ColorRampLuminosity: 0 + - _ColorRampOutline: 0 + - _ColorSwapBlueLuminosity: 0.5 + - _ColorSwapGreenLuminosity: 0.5 + - _ColorSwapRedLuminosity: 0.5 + - _DistortAmount: 0.5 + - _DistortTexXSpeed: 5 + - _DistortTexYSpeed: 5 + - _FadeAmount: -0.1 + - _FadeBurnGlow: 2 + - _FadeBurnTransition: 0.075 + - _FadeBurnWidth: 0.025 + - _FishEyeUvAmount: 0.35 + - _FlickerAlpha: 0 + - _FlickerFreq: 0.2 + - _FlickerPercent: 0.05 + - _GhostColorBoost: 1 + - _GhostTransparency: 0 + - _GlitchAmount: 3 + - _GlitchSize: 1 + - _Glow: 10 + - _GlowTexUsed: 0 + - _GradBlend: 1 + - _GradBoostX: 1.2 + - _GradBoostY: 1.2 + - _GradIsRadial: 0 + - _GrassManualAnim: 1 + - _GrassManualToggle: 0 + - _GrassRadialBend: 0.1 + - _GrassSpeed: 2 + - _GrassWind: 20 + - _GreyscaleLuminosity: 0 + - _GreyscaleOutline: 0 + - _HandDrawnAmount: 10 + - _HandDrawnSpeed: 5 + - _HitEffectBlend: 1 + - _HitEffectGlow: 5 + - _HologramFlickerAlpha: 0 + - _HologramFlickerFreq: 0.2 + - _HologramFlickerPercent: 0.05 + - _HologramMaxAlpha: 1 + - _HologramMinAlpha: 0 + - _HologramStripesAlpha: 0.4 + - _HologramStripesAmount: 50 + - _HologramStripesFill: 0.4 + - _HologramStripesLuminosity: 1 + - _HologramStripesSpeed: 5 + - _HologramUnmodAmount: 0.4 + - _HsvBright: 1 + - _HsvSaturation: 1 + - _HsvShift: 180 + - _InnerOutlineAlpha: 1 + - _InnerOutlineGlow: 1 + - _InnerOutlineThickness: 1 + - _MaxXUV: 1 + - _MaxYUV: 1 + - _MinXUV: 0 + - _MinYUV: 0 + - _MotionBlurAngle: 0.1 + - _MotionBlurDist: 1.25 + - _MyDstMode: 10 + - _MySrcMode: 5 + - _NegativeAmount: 1 + - _OffsetUvX: 0 + - _OffsetUvY: 0 + - _OnlyInnerOutline: 0 + - _OnlyOutline: 0 + - _Outline8Directions: 0 + - _OutlineAlpha: 1 + - _OutlineDistortAmount: 0.5 + - _OutlineDistortTexXSpeed: 5 + - _OutlineDistortTexYSpeed: 5 + - _OutlineDistortToggle: 0 + - _OutlineGlow: 1.5 + - _OutlineIsPixel: 0 + - _OutlinePixelWidth: 1 + - _OutlineTexGrey: 0 + - _OutlineTexToggle: 0 + - _OutlineTexXSpeed: 10 + - _OutlineTexYSpeed: 0 + - _OutlineWidth: 0.004 + - _PinchUvAmount: 0.35 + - _PixelateSize: 32 + - _PosterizeGamma: 0.75 + - _PosterizeNumColors: 8 + - _PosterizeOutline: 0 + - _RandomSeed: 0 + - _RectSize: 1 + - _RotateUvAmount: 0 + - _RoundWaveSpeed: 2 + - _RoundWaveStrength: 0.7 + - _ShadowAlpha: 0.5 + - _ShadowX: 0.1 + - _ShadowY: -0.05 + - _ShakeUvSpeed: 2.5 + - _ShakeUvX: 1.5 + - _ShakeUvY: 1 + - _ShineGlow: 1 + - _ShineLocation: 0.5 + - _ShineRotate: 0 + - _ShineWidth: 0.1 + - _TextureScrollXSpeed: 1 + - _TextureScrollYSpeed: 0 + - _TwistUvAmount: 1 + - _TwistUvPosX: 0.5 + - _TwistUvPosY: 0.5 + - _TwistUvRadius: 0.75 + - _WaveAmount: 7 + - _WaveSpeed: 10 + - _WaveStrength: 7.5 + - _WaveX: 0 + - _WaveY: 0.5 + - _ZTestMode: 4 + - _ZWrite: 0 + - _ZoomUvAmount: 0.5 + m_Colors: + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _ColorChangeNewCol: {r: 1, g: 1, b: 0, a: 1} + - _ColorChangeTarget: {r: 1, g: 0, b: 0, a: 1} + - _ColorSwapBlue: {r: 1, g: 1, b: 1, a: 1} + - _ColorSwapGreen: {r: 1, g: 1, b: 1, a: 1} + - _ColorSwapRed: {r: 1, g: 1, b: 1, a: 1} + - _FadeBurnColor: {r: 1, g: 1, b: 0, a: 1} + - _GlowColor: {r: 1, g: 1, b: 1, a: 1} + - _GradBotLeftCol: {r: 1, g: 0.27058828, b: 0.38275164, a: 1} + - _GradBotRightCol: {r: 0.8392157, g: 0, b: 0.026374353, a: 1} + - _GradTopLeftCol: {r: 0.99806374, g: 1, b: 0.4669811, a: 1} + - _GradTopRightCol: {r: 1, g: 0.66190153, b: 0.25098038, a: 1} + - _GreyscaleTintColor: {r: 1, g: 1, b: 1, a: 1} + - _HitEffectColor: {r: 1, g: 1, b: 1, a: 1} + - _HologramStripeColor: {r: 1, g: 1, b: 1, a: 1} + - _InnerOutlineColor: {r: 1, g: 0, b: 0, a: 1} + - _OutlineColor: {r: 1, g: 1, b: 1, a: 1} + - _ShadowColor: {r: 0, g: 0, b: 0, a: 1} + - _ShineColor: {r: 1, g: 1, b: 1, a: 1} +--- !u!1 &519649706 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 519649707} + - component: {fileID: 519649710} + - component: {fileID: 519649709} + - component: {fileID: 519649708} + m_Layer: 0 + m_Name: Rotated + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &519649707 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 519649706} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: -10.49, y: -5.1999993, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 298946312} + m_RootOrder: 18 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &519649708 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 519649706} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: ee158225ee1e59f4791627785501d950, type: 3} + m_Name: + m_EditorClassIdentifier: + shaderTypes: 4 + normalStrenght: 5 + normalSmoothing: 1 + computingNormal: 0 +--- !u!114 &519649709 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 519649706} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 98b644315d7a92842b89e04f55c48e02, type: 3} + m_Name: + m_EditorClassIdentifier: +--- !u!212 &519649710 +SpriteRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 519649706} + m_Enabled: 1 + m_CastShadows: 0 + m_ReceiveShadows: 0 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 868009891} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 0 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_Sprite: {fileID: 21300000, guid: 519dafacd208bb64c83d5124be03b09d, type: 3} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_FlipX: 0 + m_FlipY: 0 + m_DrawMode: 0 + m_Size: {x: 5.12, y: 5.12} + m_AdaptiveModeThreshold: 0.5 + m_SpriteTileMode: 0 + m_WasSpriteAssigned: 1 + m_MaskInteraction: 0 + m_SpriteSortPoint: 0 +--- !u!1 &520228355 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 520228356} + - component: {fileID: 520228359} + - component: {fileID: 520228358} + - component: {fileID: 520228357} + m_Layer: 0 + m_Name: Thermal Vision + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &520228356 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 520228355} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 20.000002, y: 4.8000007, z: 0} + m_LocalScale: {x: 0.80276, y: 0.80276, z: 0.80276} + m_Children: [] + m_Father: {fileID: 298946312} + m_RootOrder: 3 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &520228357 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 520228355} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: ee158225ee1e59f4791627785501d950, type: 3} + m_Name: + m_EditorClassIdentifier: + shaderTypes: 4 + normalStrenght: 5 + normalSmoothing: 1 + computingNormal: 0 +--- !u!114 &520228358 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 520228355} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 98b644315d7a92842b89e04f55c48e02, type: 3} + m_Name: + m_EditorClassIdentifier: +--- !u!212 &520228359 +SpriteRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 520228355} + m_Enabled: 1 + m_CastShadows: 0 + m_ReceiveShadows: 0 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 1713942152} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 0 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_Sprite: {fileID: 21300000, guid: 519dafacd208bb64c83d5124be03b09d, type: 3} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_FlipX: 0 + m_FlipY: 0 + m_DrawMode: 0 + m_Size: {x: 5.12, y: 5.12} + m_AdaptiveModeThreshold: 0.5 + m_SpriteTileMode: 0 + m_WasSpriteAssigned: 1 + m_MaskInteraction: 0 + m_SpriteSortPoint: 0 +--- !u!1 &564363697 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 564363701} + - component: {fileID: 564363700} + - component: {fileID: 564363699} + - component: {fileID: 564363698} + m_Layer: 5 + m_Name: Canvas + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!114 &564363698 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 564363697} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 1301386320, guid: f70555f144d8491a825f0804e09c671c, type: 3} + m_Name: + m_EditorClassIdentifier: + m_IgnoreReversedGraphics: 1 + m_BlockingObjects: 0 + m_BlockingMask: + serializedVersion: 2 + m_Bits: 4294967295 +--- !u!114 &564363699 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 564363697} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 1980459831, guid: f70555f144d8491a825f0804e09c671c, type: 3} + m_Name: + m_EditorClassIdentifier: + m_UiScaleMode: 1 + m_ReferencePixelsPerUnit: 100 + m_ScaleFactor: 1 + m_ReferenceResolution: {x: 1920, y: 1080} + m_ScreenMatchMode: 0 + m_MatchWidthOrHeight: 0 + m_PhysicalUnit: 3 + m_FallbackScreenDPI: 96 + m_DefaultSpriteDPI: 96 + m_DynamicPixelsPerUnit: 1 +--- !u!223 &564363700 +Canvas: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 564363697} + m_Enabled: 1 + serializedVersion: 3 + m_RenderMode: 1 + m_Camera: {fileID: 1239183347} + m_PlaneDistance: 100 + m_PixelPerfect: 0 + m_ReceivesEvents: 1 + m_OverrideSorting: 0 + m_OverridePixelPerfect: 0 + m_SortingBucketNormalizedSize: 0 + m_AdditionalShaderChannelsFlag: 0 + m_SortingLayerID: 0 + m_SortingOrder: 0 + m_TargetDisplay: 0 +--- !u!224 &564363701 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 564363697} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 0, y: 0, z: 0} + m_Children: + - {fileID: 356332866} + - {fileID: 2008890717} + m_Father: {fileID: 0} + m_RootOrder: 2 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 0, y: 0} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} + m_Pivot: {x: 0, y: 0} +--- !u!21 &689553382 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: AllIn1SpriteShader/AllIn1SpriteShader + m_Shader: {fileID: 4800000, guid: a36b7719ff0465b42ab1407d67672c5f, type: 3} + m_ShaderKeywords: DOODLE_ON ETC1_EXTERNAL_ALPHA HSV_ON + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _ColorRampTex: + m_Texture: {fileID: 2800000, guid: 279657edc397ece4b8029c727adf6ddc, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ColorSwapTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DistortTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _FadeBurnTex: + m_Texture: {fileID: 2800000, guid: 32e8df0008bebe746b1681a71c61f31c, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _FadeTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _GlowTex: + 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} + - _OutlineDistortTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OutlineTex: + m_Texture: {fileID: 2800000, guid: 74087f6d03f233e4a8a142fa01f9e5cf, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ShineMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - _Alpha: 1 + - _AlphaCutoffValue: 0.25 + - _AlphaRoundThreshold: 0.5 + - _BillboardY: 0 + - _BlurHD: 0 + - _BlurIntensity: 10 + - _ChromAberrAlpha: 0.4 + - _ChromAberrAmount: 1 + - _ClipUvDown: 1 + - _ClipUvLeft: 1 + - _ClipUvRight: 1 + - _ClipUvUp: 1 + - _ColorChangeLuminosity: 0 + - _ColorChangeTolerance: 0.25 + - _ColorRampLuminosity: 0 + - _ColorRampOutline: 0 + - _ColorSwapBlueLuminosity: 0.5 + - _ColorSwapGreenLuminosity: 0.5 + - _ColorSwapRedLuminosity: 0.5 + - _DistortAmount: 0.5 + - _DistortTexXSpeed: 5 + - _DistortTexYSpeed: 5 + - _FadeAmount: -0.1 + - _FadeBurnGlow: 2 + - _FadeBurnTransition: 0.075 + - _FadeBurnWidth: 0.025 + - _FishEyeUvAmount: 0.35 + - _FlickerAlpha: 0 + - _FlickerFreq: 0.2 + - _FlickerPercent: 0.05 + - _GhostColorBoost: 1 + - _GhostTransparency: 0 + - _GlitchAmount: 3 + - _GlitchSize: 1 + - _Glow: 10 + - _GlowTexUsed: 0 + - _GradBlend: 1 + - _GradBoostX: 1.2 + - _GradBoostY: 1.2 + - _GradIsRadial: 0 + - _GrassManualAnim: 1 + - _GrassManualToggle: 0 + - _GrassRadialBend: 0.1 + - _GrassSpeed: 2 + - _GrassWind: 20 + - _GreyscaleLuminosity: 0 + - _GreyscaleOutline: 0 + - _HandDrawnAmount: 10 + - _HandDrawnSpeed: 5 + - _HitEffectBlend: 1 + - _HitEffectGlow: 5 + - _HologramFlickerAlpha: 0 + - _HologramFlickerFreq: 0.2 + - _HologramFlickerPercent: 0.05 + - _HologramMaxAlpha: 1 + - _HologramMinAlpha: 0 + - _HologramStripesAlpha: 0.4 + - _HologramStripesAmount: 50 + - _HologramStripesFill: 0.4 + - _HologramStripesLuminosity: 1 + - _HologramStripesSpeed: 5 + - _HologramUnmodAmount: 0.4 + - _HsvBright: 1.03 + - _HsvSaturation: 1.262 + - _HsvShift: 251 + - _InnerOutlineAlpha: 1 + - _InnerOutlineGlow: 1 + - _InnerOutlineThickness: 1 + - _MaxXUV: 1 + - _MaxYUV: 1 + - _MinXUV: 0 + - _MinYUV: 0 + - _MotionBlurAngle: 0.1 + - _MotionBlurDist: 1.25 + - _MyDstMode: 10 + - _MySrcMode: 5 + - _NegativeAmount: 1 + - _OffsetUvX: 0 + - _OffsetUvY: 0 + - _OnlyInnerOutline: 0 + - _OnlyOutline: 0 + - _Outline8Directions: 0 + - _OutlineAlpha: 1 + - _OutlineDistortAmount: 0.5 + - _OutlineDistortTexXSpeed: 5 + - _OutlineDistortTexYSpeed: 5 + - _OutlineDistortToggle: 0 + - _OutlineGlow: 1.5 + - _OutlineIsPixel: 0 + - _OutlinePixelWidth: 1 + - _OutlineTexGrey: 0 + - _OutlineTexToggle: 0 + - _OutlineTexXSpeed: 10 + - _OutlineTexYSpeed: 0 + - _OutlineWidth: 0.004 + - _PinchUvAmount: 0.35 + - _PixelateSize: 32 + - _PosterizeGamma: 0.75 + - _PosterizeNumColors: 8 + - _PosterizeOutline: 0 + - _RandomSeed: 0 + - _RectSize: 1 + - _RotateUvAmount: 0 + - _RoundWaveSpeed: 2 + - _RoundWaveStrength: 0.7 + - _ShadowAlpha: 0.5 + - _ShadowX: 0.1 + - _ShadowY: -0.05 + - _ShakeUvSpeed: 2.5 + - _ShakeUvX: 1.5 + - _ShakeUvY: 1 + - _ShineGlow: 1 + - _ShineLocation: 0.5 + - _ShineRotate: 0 + - _ShineWidth: 0.1 + - _TextureScrollXSpeed: 1 + - _TextureScrollYSpeed: 0 + - _TwistUvAmount: 1 + - _TwistUvPosX: 0.5 + - _TwistUvPosY: 0.5 + - _TwistUvRadius: 0.75 + - _WaveAmount: 7 + - _WaveSpeed: 10 + - _WaveStrength: 7.5 + - _WaveX: 0 + - _WaveY: 0.5 + - _ZTestMode: 4 + - _ZWrite: 0 + - _ZoomUvAmount: 0.5 + m_Colors: + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _ColorChangeNewCol: {r: 1, g: 1, b: 0, a: 1} + - _ColorChangeTarget: {r: 1, g: 0, b: 0, a: 1} + - _ColorSwapBlue: {r: 1, g: 1, b: 1, a: 1} + - _ColorSwapGreen: {r: 1, g: 1, b: 1, a: 1} + - _ColorSwapRed: {r: 1, g: 1, b: 1, a: 1} + - _FadeBurnColor: {r: 1, g: 1, b: 0, a: 1} + - _GlowColor: {r: 1, g: 1, b: 1, a: 1} + - _GradBotLeftCol: {r: 0, g: 0, b: 1, a: 1} + - _GradBotRightCol: {r: 0, g: 0, b: 1, a: 1} + - _GradTopLeftCol: {r: 1, g: 0, b: 0, a: 1} + - _GradTopRightCol: {r: 1, g: 0, b: 0, a: 1} + - _GreyscaleTintColor: {r: 1, g: 1, b: 1, a: 1} + - _HitEffectColor: {r: 1, g: 1, b: 1, a: 1} + - _HologramStripeColor: {r: 1, g: 1, b: 1, a: 1} + - _InnerOutlineColor: {r: 1, g: 0, b: 0, a: 1} + - _OutlineColor: {r: 1, g: 1, b: 1, a: 1} + - _ShadowColor: {r: 0, g: 0, b: 0, a: 1} + - _ShineColor: {r: 1, g: 1, b: 1, a: 1} +--- !u!21 &694833596 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: AllIn1SpriteShader/AllIn1SpriteShader + m_Shader: {fileID: 4800000, guid: a36b7719ff0465b42ab1407d67672c5f, type: 3} + m_ShaderKeywords: COLORSWAP_ON ETC1_EXTERNAL_ALPHA OUTBASE8DIR_ON OUTBASE_ON OUTDIST_ON + OUTTEX_ON _OUTLINE8DIRECTIONS_ON _OUTLINEDISTORTTOGGLE_ON _OUTLINETEXTOGGLE_ON + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _ColorRampTex: + m_Texture: {fileID: 2800000, guid: 279657edc397ece4b8029c727adf6ddc, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ColorSwapTex: + m_Texture: {fileID: 2800000, guid: 065da6c7b90ca904dab9cbc6b415fd19, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DistortTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _FadeBurnTex: + m_Texture: {fileID: 2800000, guid: 32e8df0008bebe746b1681a71c61f31c, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _FadeTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _GlowTex: + 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} + - _OutlineDistortTex: + m_Texture: {fileID: 2800000, guid: 806e236bc12668e4da974bb8f536d28f, type: 3} + m_Scale: {x: 0.5, y: 0.5} + m_Offset: {x: 0, y: 0} + - _OutlineTex: + m_Texture: {fileID: 2800000, guid: 677cca399782dea41aedc1d292ecb67d, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ShineMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - _Alpha: 1 + - _AlphaCutoffValue: 0.25 + - _AlphaRoundThreshold: 0.5 + - _BillboardY: 0 + - _BlurHD: 0 + - _BlurIntensity: 10 + - _ChromAberrAlpha: 0.4 + - _ChromAberrAmount: 1 + - _ClipUvDown: 1 + - _ClipUvLeft: 1 + - _ClipUvRight: 1 + - _ClipUvUp: 1 + - _ColorChangeLuminosity: 0 + - _ColorChangeTolerance: 0.25 + - _ColorRampLuminosity: 0 + - _ColorRampOutline: 0 + - _ColorSwapBlueLuminosity: 0.444 + - _ColorSwapGreenLuminosity: 0.255 + - _ColorSwapRedLuminosity: 0.5 + - _DistortAmount: 0.5 + - _DistortTexXSpeed: 5 + - _DistortTexYSpeed: 5 + - _FadeAmount: -0.1 + - _FadeBurnGlow: 2 + - _FadeBurnTransition: 0.075 + - _FadeBurnWidth: 0.025 + - _FishEyeUvAmount: 0.35 + - _FlickerAlpha: 0 + - _FlickerFreq: 0.2 + - _FlickerPercent: 0.05 + - _GhostColorBoost: 1 + - _GhostTransparency: 0 + - _GlitchAmount: 3 + - _GlitchSize: 1 + - _Glow: 10 + - _GlowTexUsed: 0 + - _GradBlend: 1 + - _GradBoostX: 1.2 + - _GradBoostY: 1.2 + - _GradIsRadial: 0 + - _GrassManualAnim: 1 + - _GrassManualToggle: 0 + - _GrassRadialBend: 0.1 + - _GrassSpeed: 2 + - _GrassWind: 20 + - _GreyscaleLuminosity: 0 + - _GreyscaleOutline: 0 + - _HandDrawnAmount: 10 + - _HandDrawnSpeed: 5 + - _HitEffectBlend: 1 + - _HitEffectGlow: 5 + - _HologramFlickerAlpha: 0 + - _HologramFlickerFreq: 0.2 + - _HologramFlickerPercent: 0.05 + - _HologramMaxAlpha: 1 + - _HologramMinAlpha: 0 + - _HologramStripesAlpha: 0.4 + - _HologramStripesAmount: 50 + - _HologramStripesFill: 0.4 + - _HologramStripesLuminosity: 1 + - _HologramStripesSpeed: 5 + - _HologramUnmodAmount: 0.4 + - _HsvBright: 1 + - _HsvSaturation: 1 + - _HsvShift: 180 + - _InnerOutlineAlpha: 1 + - _InnerOutlineGlow: 1 + - _InnerOutlineThickness: 1 + - _MaxXUV: 1 + - _MaxYUV: 1 + - _MinXUV: 0 + - _MinYUV: 0 + - _MotionBlurAngle: 0.1 + - _MotionBlurDist: 1.25 + - _MyDstMode: 10 + - _MySrcMode: 5 + - _NegativeAmount: 1 + - _OffsetUvX: 0 + - _OffsetUvY: 0 + - _OnlyInnerOutline: 0 + - _OnlyOutline: 0 + - _Outline8Directions: 1 + - _OutlineAlpha: 1 + - _OutlineDistortAmount: 0.281 + - _OutlineDistortTexXSpeed: 5 + - _OutlineDistortTexYSpeed: 5 + - _OutlineDistortToggle: 1 + - _OutlineGlow: 4 + - _OutlineIsPixel: 0 + - _OutlinePixelWidth: 1 + - _OutlineTexGrey: 0 + - _OutlineTexToggle: 1 + - _OutlineTexXSpeed: 0 + - _OutlineTexYSpeed: -10 + - _OutlineWidth: 0.0063 + - _PinchUvAmount: 0.35 + - _PixelateSize: 32 + - _PosterizeGamma: 0.75 + - _PosterizeNumColors: 8 + - _PosterizeOutline: 0 + - _RandomSeed: 0 + - _RectSize: 1 + - _RotateUvAmount: 0 + - _RoundWaveSpeed: 2 + - _RoundWaveStrength: 0.7 + - _ShadowAlpha: 0.5 + - _ShadowX: 0.1 + - _ShadowY: -0.05 + - _ShakeUvSpeed: 2.5 + - _ShakeUvX: 1.5 + - _ShakeUvY: 1 + - _ShineGlow: 1 + - _ShineLocation: 0.5 + - _ShineRotate: 0 + - _ShineWidth: 0.1 + - _TextureScrollXSpeed: 1 + - _TextureScrollYSpeed: 0 + - _TwistUvAmount: 1 + - _TwistUvPosX: 0.5 + - _TwistUvPosY: 0.5 + - _TwistUvRadius: 0.75 + - _WaveAmount: 7 + - _WaveSpeed: 10 + - _WaveStrength: 7.5 + - _WaveX: 0 + - _WaveY: 0.5 + - _ZTestMode: 4 + - _ZWrite: 0 + - _ZoomUvAmount: 0.5 + m_Colors: + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _ColorChangeNewCol: {r: 1, g: 1, b: 0, a: 1} + - _ColorChangeTarget: {r: 1, g: 0, b: 0, a: 1} + - _ColorSwapBlue: {r: 1, g: 0.15566039, b: 0.15566039, a: 1} + - _ColorSwapGreen: {r: 1, g: 0.9654912, b: 0, a: 1} + - _ColorSwapRed: {r: 1, g: 0.40227598, b: 0, a: 1} + - _FadeBurnColor: {r: 1, g: 1, b: 0, a: 1} + - _GlowColor: {r: 1, g: 1, b: 1, a: 1} + - _GradBotLeftCol: {r: 0, g: 0, b: 1, a: 1} + - _GradBotRightCol: {r: 0, g: 0, b: 1, a: 1} + - _GradTopLeftCol: {r: 1, g: 0, b: 0, a: 1} + - _GradTopRightCol: {r: 1, g: 0, b: 0, a: 1} + - _GreyscaleTintColor: {r: 1, g: 1, b: 1, a: 1} + - _HitEffectColor: {r: 1, g: 1, b: 1, a: 1} + - _HologramStripeColor: {r: 1, g: 1, b: 1, a: 1} + - _InnerOutlineColor: {r: 1, g: 0, b: 0, a: 1} + - _OutlineColor: {r: 1, g: 1, b: 1, a: 1} + - _ShadowColor: {r: 0, g: 0, b: 0, a: 1} + - _ShineColor: {r: 1, g: 1, b: 1, a: 1} +--- !u!21 &707407687 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: AllIn1SpriteShader/AllIn1SpriteShader + m_Shader: {fileID: 4800000, guid: a36b7719ff0465b42ab1407d67672c5f, type: 3} + m_ShaderKeywords: ETC1_EXTERNAL_ALPHA FADE_ON OUTBASE8DIR_ON OUTBASE_ON _OUTLINE8DIRECTIONS_ON + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _ColorRampTex: + m_Texture: {fileID: 2800000, guid: 279657edc397ece4b8029c727adf6ddc, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ColorSwapTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DistortTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _FadeBurnTex: + m_Texture: {fileID: 2800000, guid: f6a047a86109d084997a9cf4f0a2e5b0, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _FadeTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _GlowTex: + 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} + - _OutlineDistortTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OutlineTex: + m_Texture: {fileID: 2800000, guid: 74087f6d03f233e4a8a142fa01f9e5cf, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ShineMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - _Alpha: 1 + - _AlphaCutoffValue: 0.25 + - _AlphaRoundThreshold: 0.5 + - _BillboardY: 0 + - _BlurHD: 0 + - _BlurIntensity: 10 + - _ChromAberrAlpha: 0.4 + - _ChromAberrAmount: 0.94 + - _ClipUvDown: 1 + - _ClipUvLeft: 1 + - _ClipUvRight: 1 + - _ClipUvUp: 1 + - _ColorChangeLuminosity: 0 + - _ColorChangeTolerance: 0.25 + - _ColorRampLuminosity: 0 + - _ColorRampOutline: 0 + - _ColorSwapBlueLuminosity: 0.5 + - _ColorSwapGreenLuminosity: 0.5 + - _ColorSwapRedLuminosity: 0.5 + - _DistortAmount: 0.1 + - _DistortTexXSpeed: 5 + - _DistortTexYSpeed: 5 + - _FadeAmount: 0.442 + - _FadeBurnGlow: 10.3 + - _FadeBurnTransition: 0.058 + - _FadeBurnWidth: 0.051 + - _FishEyeUvAmount: 0 + - _FlickerAlpha: 0.4 + - _FlickerFreq: 0.2 + - _FlickerPercent: 0.1 + - _GhostColorBoost: 1 + - _GhostTransparency: 0 + - _GlitchAmount: 8.47 + - _GlitchSize: 1 + - _Glow: 0.2 + - _GlowTexUsed: 0 + - _GradBlend: 1 + - _GradBoostX: 1.2 + - _GradBoostY: 1.2 + - _GradIsRadial: 0 + - _GrassManualAnim: 1 + - _GrassManualToggle: 0 + - _GrassRadialBend: 0.1 + - _GrassSpeed: 2 + - _GrassWind: 20 + - _GreyscaleLuminosity: 0 + - _GreyscaleOutline: 0 + - _HandDrawnAmount: 7.08 + - _HandDrawnSpeed: 5 + - _HitEffectBlend: 1 + - _HitEffectGlow: 5 + - _HologramFlickerAlpha: 0 + - _HologramFlickerFreq: 0.2 + - _HologramFlickerPercent: 0.05 + - _HologramMaxAlpha: 1 + - _HologramMinAlpha: 0 + - _HologramStripesAlpha: 0.362 + - _HologramStripesAmount: 50 + - _HologramStripesFill: 0.334 + - _HologramStripesLuminosity: 1.26 + - _HologramStripesSpeed: 3.19 + - _HologramUnmodAmount: 0.4 + - _HsvBright: 1 + - _HsvSaturation: 1 + - _HsvShift: 180 + - _InnerOutlineAlpha: 1 + - _InnerOutlineGlow: 1 + - _InnerOutlineThickness: 1 + - _MaxXUV: 1 + - _MaxYUV: 1 + - _MinXUV: 0 + - _MinYUV: 0 + - _MotionBlurAngle: 0.1 + - _MotionBlurDist: 1.25 + - _MyDstMode: 10 + - _MySrcMode: 5 + - _NegativeAmount: 1 + - _OffsetUvX: 0 + - _OffsetUvY: 0 + - _OnlyInnerOutline: 0 + - _OnlyOutline: 0 + - _Outline8Directions: 1 + - _OutlineAlpha: 1 + - _OutlineDistortAmount: 0.5 + - _OutlineDistortTexXSpeed: 5 + - _OutlineDistortTexYSpeed: 5 + - _OutlineDistortToggle: 0 + - _OutlineGlow: 7 + - _OutlineIsPixel: 0 + - _OutlinePixelWidth: 1 + - _OutlineTexGrey: 0 + - _OutlineTexToggle: 0 + - _OutlineTexXSpeed: 10 + - _OutlineTexYSpeed: 0 + - _OutlineWidth: 0.009 + - _PinchUvAmount: 0.102 + - _PixelateSize: 32 + - _PosterizeGamma: 0.75 + - _PosterizeNumColors: 8 + - _PosterizeOutline: 0 + - _RandomSeed: 0 + - _RectSize: 1 + - _RotateUvAmount: 0 + - _RoundWaveSpeed: 2 + - _RoundWaveStrength: 0.7 + - _ShadowAlpha: 0.5 + - _ShadowX: 0.1 + - _ShadowY: -0.05 + - _ShakeUvSpeed: 2.5 + - _ShakeUvX: 1.5 + - _ShakeUvY: 1 + - _ShineGlow: 1 + - _ShineLocation: 0.5 + - _ShineRotate: 0 + - _ShineWidth: 0.1 + - _TextureScrollXSpeed: 1 + - _TextureScrollYSpeed: 0 + - _TwistUvAmount: 1 + - _TwistUvPosX: 0.5 + - _TwistUvPosY: 0.5 + - _TwistUvRadius: 0.75 + - _WaveAmount: 7 + - _WaveSpeed: 10 + - _WaveStrength: 7.5 + - _WaveX: 0 + - _WaveY: 0.5 + - _ZTestMode: 4 + - _ZWrite: 0 + - _ZoomUvAmount: 0.5 + m_Colors: + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _ColorChangeNewCol: {r: 1, g: 1, b: 0, a: 1} + - _ColorChangeTarget: {r: 1, g: 0, b: 0, a: 1} + - _ColorSwapBlue: {r: 1, g: 1, b: 1, a: 1} + - _ColorSwapGreen: {r: 1, g: 1, b: 1, a: 1} + - _ColorSwapRed: {r: 1, g: 1, b: 1, a: 1} + - _FadeBurnColor: {r: 0.004856825, g: 1, b: 0, a: 1} + - _GlowColor: {r: 0.034784317, g: 1, b: 0, a: 1} + - _GradBotLeftCol: {r: 0, g: 0, b: 1, a: 1} + - _GradBotRightCol: {r: 0, g: 0, b: 1, a: 1} + - _GradTopLeftCol: {r: 1, g: 0, b: 0, a: 1} + - _GradTopRightCol: {r: 1, g: 0, b: 0, a: 1} + - _GreyscaleTintColor: {r: 0.4433962, g: 0.4433962, b: 0.4433962, a: 1} + - _HitEffectColor: {r: 1, g: 1, b: 1, a: 1} + - _HologramStripeColor: {r: 1, g: 1, b: 1, a: 1} + - _InnerOutlineColor: {r: 1, g: 0, b: 0, a: 1} + - _OutlineColor: {r: 0, g: 0.5754717, b: 0.09929707, a: 1} + - _ShadowColor: {r: 0, g: 0, b: 0, a: 1} + - _ShineColor: {r: 1, g: 1, b: 1, a: 1} +--- !u!1 &746759202 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 746759203} + - component: {fileID: 746759205} + - component: {fileID: 746759206} + - component: {fileID: 746759204} + m_Layer: 0 + m_Name: Hit Effect + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &746759203 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 746759202} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: -5.4899993, y: 4.8000007, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 298946312} + m_RootOrder: 12 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &746759204 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 746759202} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: ee158225ee1e59f4791627785501d950, type: 3} + m_Name: + m_EditorClassIdentifier: + shaderTypes: 4 + normalStrenght: 5 + normalSmoothing: 1 + computingNormal: 0 +--- !u!212 &746759205 +SpriteRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 746759202} + m_Enabled: 1 + m_CastShadows: 0 + m_ReceiveShadows: 0 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2033235221} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 0 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_Sprite: {fileID: 21300000, guid: 519dafacd208bb64c83d5124be03b09d, type: 3} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_FlipX: 0 + m_FlipY: 0 + m_DrawMode: 0 + m_Size: {x: 5.12, y: 5.12} + m_AdaptiveModeThreshold: 0.5 + m_SpriteTileMode: 0 + m_WasSpriteAssigned: 1 + m_MaskInteraction: 0 + m_SpriteSortPoint: 0 +--- !u!114 &746759206 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 746759202} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 98b644315d7a92842b89e04f55c48e02, type: 3} + m_Name: + m_EditorClassIdentifier: +--- !u!1 &786925990 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 786925991} + - component: {fileID: 786925994} + - component: {fileID: 786925993} + - component: {fileID: 786925992} + m_Layer: 0 + m_Name: Fish Eye + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &786925991 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 786925990} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 15.209999, y: -5.1999993, z: 0} + m_LocalScale: {x: 0.89757, y: 0.89757, z: 0.89757} + m_Children: [] + m_Father: {fileID: 298946312} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &786925992 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 786925990} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: ee158225ee1e59f4791627785501d950, type: 3} + m_Name: + m_EditorClassIdentifier: + shaderTypes: 4 + normalStrenght: 5 + normalSmoothing: 1 + computingNormal: 0 +--- !u!114 &786925993 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 786925990} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 98b644315d7a92842b89e04f55c48e02, type: 3} + m_Name: + m_EditorClassIdentifier: +--- !u!212 &786925994 +SpriteRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 786925990} + m_Enabled: 1 + m_CastShadows: 0 + m_ReceiveShadows: 0 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 352855906} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 0 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_Sprite: {fileID: 21300000, guid: 519dafacd208bb64c83d5124be03b09d, type: 3} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_FlipX: 0 + m_FlipY: 0 + m_DrawMode: 0 + m_Size: {x: 5.12, y: 5.12} + m_AdaptiveModeThreshold: 0.5 + m_SpriteTileMode: 0 + m_WasSpriteAssigned: 1 + m_MaskInteraction: 0 + m_SpriteSortPoint: 0 +--- !u!21 &832006925 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: AllIn1SpriteShader/AllIn1SpriteShader + m_Shader: {fileID: 4800000, guid: a36b7719ff0465b42ab1407d67672c5f, type: 3} + m_ShaderKeywords: ETC1_EXTERNAL_ALPHA GLOW_ON HSV_ON OUTBASE8DIR_ON OUTBASE_ON OUTTEX_ON + POLARUV_ON TEXTURESCROLL_ON _OUTLINE8DIRECTIONS_ON _OUTLINETEXTOGGLE_ON + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _ColorRampTex: + m_Texture: {fileID: 2800000, guid: 279657edc397ece4b8029c727adf6ddc, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ColorSwapTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DistortTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _FadeBurnTex: + m_Texture: {fileID: 2800000, guid: 32e8df0008bebe746b1681a71c61f31c, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _FadeTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _GlowTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MainTex: + m_Texture: {fileID: 0} + m_Scale: {x: 3, y: 3} + m_Offset: {x: 0, y: 0} + - _OutlineDistortTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OutlineTex: + m_Texture: {fileID: 2800000, guid: 74087f6d03f233e4a8a142fa01f9e5cf, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ShineMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - _Alpha: 1 + - _AlphaCutoffValue: 0.25 + - _AlphaRoundThreshold: 0.5 + - _BillboardY: 0 + - _BlurHD: 0 + - _BlurIntensity: 10 + - _ChromAberrAlpha: 0.4 + - _ChromAberrAmount: 1 + - _ClipUvDown: 1 + - _ClipUvLeft: 1 + - _ClipUvRight: 1 + - _ClipUvUp: 1 + - _ColorChangeLuminosity: 0 + - _ColorChangeTolerance: 0.25 + - _ColorRampLuminosity: 0 + - _ColorRampOutline: 0 + - _ColorSwapBlueLuminosity: 0.5 + - _ColorSwapGreenLuminosity: 0.5 + - _ColorSwapRedLuminosity: 0.5 + - _DistortAmount: 0.5 + - _DistortTexXSpeed: 5 + - _DistortTexYSpeed: 5 + - _FadeAmount: -0.1 + - _FadeBurnGlow: 2 + - _FadeBurnTransition: 0.075 + - _FadeBurnWidth: 0.025 + - _FishEyeUvAmount: 0.35 + - _FlickerAlpha: 0 + - _FlickerFreq: 0.2 + - _FlickerPercent: 0.05 + - _GhostColorBoost: 1 + - _GhostTransparency: 0 + - _GlitchAmount: 3 + - _GlitchSize: 1 + - _Glow: 1.2 + - _GlowTexUsed: 0 + - _GradBlend: 0.465 + - _GradBoostX: 1.2 + - _GradBoostY: 1.2 + - _GradIsRadial: 0 + - _GrassManualAnim: 1 + - _GrassManualToggle: 0 + - _GrassRadialBend: 0.1 + - _GrassSpeed: 2 + - _GrassWind: 20 + - _GreyscaleLuminosity: 0 + - _GreyscaleOutline: 0 + - _HandDrawnAmount: 10 + - _HandDrawnSpeed: 5 + - _HitEffectBlend: 1 + - _HitEffectGlow: 5 + - _HologramFlickerAlpha: 0 + - _HologramFlickerFreq: 0.2 + - _HologramFlickerPercent: 0.05 + - _HologramMaxAlpha: 1 + - _HologramMinAlpha: 0 + - _HologramStripesAlpha: 0.4 + - _HologramStripesAmount: 50 + - _HologramStripesFill: 0.4 + - _HologramStripesLuminosity: 1 + - _HologramStripesSpeed: 5 + - _HologramUnmodAmount: 0.4 + - _HsvBright: 1 + - _HsvSaturation: 1 + - _HsvShift: 0 + - _InnerOutlineAlpha: 1 + - _InnerOutlineGlow: 1 + - _InnerOutlineThickness: 1 + - _MaxXUV: 1 + - _MaxYUV: 1 + - _MinXUV: 0 + - _MinYUV: 0 + - _MotionBlurAngle: 0.1 + - _MotionBlurDist: 1.25 + - _MyDstMode: 10 + - _MySrcMode: 5 + - _NegativeAmount: 1 + - _OffsetUvX: 0 + - _OffsetUvY: 0 + - _OnlyInnerOutline: 0 + - _OnlyOutline: 0 + - _Outline8Directions: 1 + - _OutlineAlpha: 1 + - _OutlineDistortAmount: 0.5 + - _OutlineDistortTexXSpeed: 5 + - _OutlineDistortTexYSpeed: 5 + - _OutlineDistortToggle: 0 + - _OutlineGlow: 1.5 + - _OutlineIsPixel: 0 + - _OutlinePixelWidth: 1 + - _OutlineTexGrey: 0 + - _OutlineTexToggle: 1 + - _OutlineTexXSpeed: 10 + - _OutlineTexYSpeed: 0 + - _OutlineWidth: 0.0204 + - _PinchUvAmount: 0.35 + - _PixelateSize: 32 + - _PosterizeGamma: 0.75 + - _PosterizeNumColors: 8 + - _PosterizeOutline: 0 + - _RandomSeed: 0 + - _RectSize: 1 + - _RotateUvAmount: 0 + - _RoundWaveSpeed: 2 + - _RoundWaveStrength: 0.7 + - _ShadowAlpha: 0.5 + - _ShadowX: 0.1 + - _ShadowY: -0.05 + - _ShakeUvSpeed: 2.5 + - _ShakeUvX: 1.5 + - _ShakeUvY: 1 + - _ShineGlow: 1 + - _ShineLocation: 0.5 + - _ShineRotate: 0 + - _ShineWidth: 0.1 + - _TextureScrollXSpeed: 1 + - _TextureScrollYSpeed: 1.13 + - _TwistUvAmount: 1 + - _TwistUvPosX: 0.5 + - _TwistUvPosY: 0.5 + - _TwistUvRadius: 0.75 + - _WaveAmount: 7 + - _WaveSpeed: 10 + - _WaveStrength: 7.5 + - _WaveX: 0 + - _WaveY: 0.5 + - _ZTestMode: 4 + - _ZWrite: 0 + - _ZoomUvAmount: 0.5 + m_Colors: + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _ColorChangeNewCol: {r: 1, g: 1, b: 0, a: 1} + - _ColorChangeTarget: {r: 1, g: 0, b: 0, a: 1} + - _ColorSwapBlue: {r: 1, g: 1, b: 1, a: 1} + - _ColorSwapGreen: {r: 1, g: 1, b: 1, a: 1} + - _ColorSwapRed: {r: 1, g: 1, b: 1, a: 1} + - _FadeBurnColor: {r: 1, g: 1, b: 0, a: 1} + - _GlowColor: {r: 1, g: 1, b: 1, a: 1} + - _GradBotLeftCol: {r: 0, g: 0, b: 1, a: 1} + - _GradBotRightCol: {r: 0, g: 0, b: 1, a: 1} + - _GradTopLeftCol: {r: 1, g: 0, b: 0, a: 1} + - _GradTopRightCol: {r: 1, g: 0, b: 0, a: 1} + - _GreyscaleTintColor: {r: 1, g: 1, b: 1, a: 1} + - _HitEffectColor: {r: 1, g: 1, b: 1, a: 1} + - _HologramStripeColor: {r: 1, g: 1, b: 1, a: 1} + - _InnerOutlineColor: {r: 1, g: 0, b: 0, a: 1} + - _OutlineColor: {r: 1, g: 1, b: 1, a: 1} + - _ShadowColor: {r: 0, g: 0, b: 0, a: 1} + - _ShineColor: {r: 1, g: 1, b: 1, a: 1} +--- !u!21 &868009891 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: AllIn1SpriteShader/AllIn1SpriteShader + m_Shader: {fileID: 4800000, guid: a36b7719ff0465b42ab1407d67672c5f, type: 3} + m_ShaderKeywords: COLORRAMP_ON ETC1_EXTERNAL_ALPHA GLITCH_ON HSV_ON ROTATEUV_ON + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _ColorRampTex: + m_Texture: {fileID: 2800000, guid: 763e13699209a614b8800c76fc9dee48, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ColorSwapTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DistortTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _FadeBurnTex: + m_Texture: {fileID: 2800000, guid: 32e8df0008bebe746b1681a71c61f31c, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _FadeTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _GlowTex: + 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} + - _OutlineDistortTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OutlineTex: + m_Texture: {fileID: 2800000, guid: 74087f6d03f233e4a8a142fa01f9e5cf, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ShineMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - _Alpha: 1 + - _AlphaCutoffValue: 0.25 + - _AlphaRoundThreshold: 0.5 + - _BillboardY: 0 + - _BlurHD: 0 + - _BlurIntensity: 10 + - _ChromAberrAlpha: 0.4 + - _ChromAberrAmount: 1 + - _ClipUvDown: 1 + - _ClipUvLeft: 1 + - _ClipUvRight: 1 + - _ClipUvUp: 1 + - _ColorChangeLuminosity: 0 + - _ColorChangeTolerance: 0.25 + - _ColorRampLuminosity: 0 + - _ColorRampOutline: 0 + - _ColorSwapBlueLuminosity: 0.5 + - _ColorSwapGreenLuminosity: 0.5 + - _ColorSwapRedLuminosity: 0.5 + - _DistortAmount: 0.5 + - _DistortTexXSpeed: 5 + - _DistortTexYSpeed: 5 + - _FadeAmount: -0.1 + - _FadeBurnGlow: 2 + - _FadeBurnTransition: 0.075 + - _FadeBurnWidth: 0.025 + - _FishEyeUvAmount: 0.35 + - _FlickerAlpha: 0 + - _FlickerFreq: 0.2 + - _FlickerPercent: 0.05 + - _GhostColorBoost: 1 + - _GhostTransparency: 0 + - _GlitchAmount: 10.6 + - _GlitchSize: 1 + - _Glow: 10 + - _GlowTexUsed: 0 + - _GradBlend: 1 + - _GradBoostX: 1.2 + - _GradBoostY: 1.2 + - _GradIsRadial: 0 + - _GrassManualAnim: 1 + - _GrassManualToggle: 0 + - _GrassRadialBend: 0.1 + - _GrassSpeed: 2 + - _GrassWind: 20 + - _GreyscaleLuminosity: 0 + - _GreyscaleOutline: 0 + - _HandDrawnAmount: 10 + - _HandDrawnSpeed: 5 + - _HitEffectBlend: 1 + - _HitEffectGlow: 5 + - _HologramFlickerAlpha: 0 + - _HologramFlickerFreq: 0.2 + - _HologramFlickerPercent: 0.05 + - _HologramMaxAlpha: 1 + - _HologramMinAlpha: 0 + - _HologramStripesAlpha: 0.4 + - _HologramStripesAmount: 50 + - _HologramStripesFill: 0.4 + - _HologramStripesLuminosity: 1 + - _HologramStripesSpeed: 5 + - _HologramUnmodAmount: 0.4 + - _HsvBright: 1.15 + - _HsvSaturation: 1.33 + - _HsvShift: 114 + - _InnerOutlineAlpha: 1 + - _InnerOutlineGlow: 1 + - _InnerOutlineThickness: 1 + - _MaxXUV: 1 + - _MaxYUV: 1 + - _MinXUV: 0 + - _MinYUV: 0 + - _MotionBlurAngle: 0.1 + - _MotionBlurDist: 1.25 + - _MyDstMode: 10 + - _MySrcMode: 5 + - _NegativeAmount: 1 + - _OffsetUvX: 0 + - _OffsetUvY: 0 + - _OnlyInnerOutline: 0 + - _OnlyOutline: 0 + - _Outline8Directions: 0 + - _OutlineAlpha: 1 + - _OutlineDistortAmount: 0.5 + - _OutlineDistortTexXSpeed: 5 + - _OutlineDistortTexYSpeed: 5 + - _OutlineDistortToggle: 0 + - _OutlineGlow: 1.5 + - _OutlineIsPixel: 0 + - _OutlinePixelWidth: 1 + - _OutlineTexGrey: 0 + - _OutlineTexToggle: 0 + - _OutlineTexXSpeed: 10 + - _OutlineTexYSpeed: 0 + - _OutlineWidth: 0.004 + - _PinchUvAmount: 0.35 + - _PixelateSize: 32 + - _PosterizeGamma: 0.75 + - _PosterizeNumColors: 8 + - _PosterizeOutline: 0 + - _RandomSeed: 0 + - _RectSize: 1 + - _RotateUvAmount: 3.14 + - _RoundWaveSpeed: 2 + - _RoundWaveStrength: 0.7 + - _ShadowAlpha: 0.5 + - _ShadowX: 0.1 + - _ShadowY: -0.05 + - _ShakeUvSpeed: 2.5 + - _ShakeUvX: 1.5 + - _ShakeUvY: 1 + - _ShineGlow: 1 + - _ShineLocation: 0.5 + - _ShineRotate: 0 + - _ShineWidth: 0.1 + - _TextureScrollXSpeed: 1 + - _TextureScrollYSpeed: 0 + - _TwistUvAmount: 1 + - _TwistUvPosX: 0.5 + - _TwistUvPosY: 0.5 + - _TwistUvRadius: 0.75 + - _WaveAmount: 7 + - _WaveSpeed: 10 + - _WaveStrength: 7.5 + - _WaveX: 0 + - _WaveY: 0.5 + - _ZTestMode: 4 + - _ZWrite: 0 + - _ZoomUvAmount: 0.5 + m_Colors: + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _ColorChangeNewCol: {r: 1, g: 1, b: 0, a: 1} + - _ColorChangeTarget: {r: 1, g: 0, b: 0, a: 1} + - _ColorSwapBlue: {r: 1, g: 1, b: 1, a: 1} + - _ColorSwapGreen: {r: 1, g: 1, b: 1, a: 1} + - _ColorSwapRed: {r: 1, g: 1, b: 1, a: 1} + - _FadeBurnColor: {r: 1, g: 1, b: 0, a: 1} + - _GlowColor: {r: 1, g: 1, b: 1, a: 1} + - _GradBotLeftCol: {r: 0, g: 0, b: 1, a: 1} + - _GradBotRightCol: {r: 0, g: 0, b: 1, a: 1} + - _GradTopLeftCol: {r: 1, g: 0, b: 0, a: 1} + - _GradTopRightCol: {r: 1, g: 0, b: 0, a: 1} + - _GreyscaleTintColor: {r: 1, g: 1, b: 1, a: 1} + - _HitEffectColor: {r: 1, g: 1, b: 1, a: 1} + - _HologramStripeColor: {r: 1, g: 1, b: 1, a: 1} + - _InnerOutlineColor: {r: 1, g: 0, b: 0, a: 1} + - _OutlineColor: {r: 1, g: 1, b: 1, a: 1} + - _ShadowColor: {r: 0, g: 0, b: 0, a: 1} + - _ShineColor: {r: 1, g: 1, b: 1, a: 1} +--- !u!21 &876267714 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: AllIn1SpriteShader/AllIn1SpriteShader + m_Shader: {fileID: 4800000, guid: a36b7719ff0465b42ab1407d67672c5f, type: 3} + m_ShaderKeywords: COLORRAMP_ON ETC1_EXTERNAL_ALPHA OUTBASE8DIR_ON OUTBASE_ON TEXTURESCROLL_ON + _OUTLINE8DIRECTIONS_ON + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _ColorRampTex: + m_Texture: {fileID: 2800000, guid: 279657edc397ece4b8029c727adf6ddc, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ColorSwapTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DistortTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _FadeBurnTex: + m_Texture: {fileID: 2800000, guid: 32e8df0008bebe746b1681a71c61f31c, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _FadeTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _GlowTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MainTex: + m_Texture: {fileID: 0} + m_Scale: {x: 4, y: 4} + m_Offset: {x: 0, y: 0} + - _OutlineDistortTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OutlineTex: + m_Texture: {fileID: 2800000, guid: 74087f6d03f233e4a8a142fa01f9e5cf, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ShineMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - _Alpha: 1 + - _AlphaCutoffValue: 0.25 + - _AlphaRoundThreshold: 0.5 + - _BillboardY: 0 + - _BlurHD: 0 + - _BlurIntensity: 10 + - _ChromAberrAlpha: 0.4 + - _ChromAberrAmount: 1 + - _ClipUvDown: 1 + - _ClipUvLeft: 1 + - _ClipUvRight: 1 + - _ClipUvUp: 1 + - _ColorChangeLuminosity: 0 + - _ColorChangeTolerance: 0.25 + - _ColorRampLuminosity: 0 + - _ColorRampOutline: 0 + - _ColorSwapBlueLuminosity: 0.5 + - _ColorSwapGreenLuminosity: 0.5 + - _ColorSwapRedLuminosity: 0.5 + - _DistortAmount: 0.5 + - _DistortTexXSpeed: 5 + - _DistortTexYSpeed: 5 + - _FadeAmount: -0.1 + - _FadeBurnGlow: 2 + - _FadeBurnTransition: 0.075 + - _FadeBurnWidth: 0.025 + - _FishEyeUvAmount: 0.35 + - _FlickerAlpha: 0 + - _FlickerFreq: 0.2 + - _FlickerPercent: 0.05 + - _GhostColorBoost: 1 + - _GhostTransparency: 0 + - _GlitchAmount: 3 + - _GlitchSize: 1 + - _Glow: 10 + - _GlowTexUsed: 0 + - _GradBlend: 1 + - _GradBoostX: 1.2 + - _GradBoostY: 1.2 + - _GradIsRadial: 0 + - _GrassManualAnim: 1 + - _GrassManualToggle: 0 + - _GrassRadialBend: 0.1 + - _GrassSpeed: 2 + - _GrassWind: 20 + - _GreyscaleLuminosity: 0 + - _GreyscaleOutline: 0 + - _HandDrawnAmount: 10 + - _HandDrawnSpeed: 5 + - _HitEffectBlend: 1 + - _HitEffectGlow: 5 + - _HologramFlickerAlpha: 0 + - _HologramFlickerFreq: 0.2 + - _HologramFlickerPercent: 0.05 + - _HologramMaxAlpha: 1 + - _HologramMinAlpha: 0 + - _HologramStripesAlpha: 0.4 + - _HologramStripesAmount: 50 + - _HologramStripesFill: 0.4 + - _HologramStripesLuminosity: 1 + - _HologramStripesSpeed: 5 + - _HologramUnmodAmount: 0.4 + - _HsvBright: 1 + - _HsvSaturation: 1 + - _HsvShift: 180 + - _InnerOutlineAlpha: 1 + - _InnerOutlineGlow: 1 + - _InnerOutlineThickness: 1 + - _MaxXUV: 1 + - _MaxYUV: 1 + - _MinXUV: 0 + - _MinYUV: 0 + - _MotionBlurAngle: 0.1 + - _MotionBlurDist: 1.25 + - _MyDstMode: 10 + - _MySrcMode: 5 + - _NegativeAmount: 1 + - _OffsetUvX: 0 + - _OffsetUvY: 0 + - _OnlyInnerOutline: 0 + - _OnlyOutline: 0 + - _Outline8Directions: 1 + - _OutlineAlpha: 1 + - _OutlineDistortAmount: 0.5 + - _OutlineDistortTexXSpeed: 5 + - _OutlineDistortTexYSpeed: 5 + - _OutlineDistortToggle: 0 + - _OutlineGlow: 4.3 + - _OutlineIsPixel: 0 + - _OutlinePixelWidth: 1 + - _OutlineTexGrey: 0 + - _OutlineTexToggle: 0 + - _OutlineTexXSpeed: 10 + - _OutlineTexYSpeed: 0 + - _OutlineWidth: 0.03 + - _PinchUvAmount: 0.35 + - _PixelateSize: 32 + - _PosterizeGamma: 0.75 + - _PosterizeNumColors: 8 + - _PosterizeOutline: 0 + - _RandomSeed: 0 + - _RectSize: 1 + - _RotateUvAmount: 0 + - _RoundWaveSpeed: 2 + - _RoundWaveStrength: 0.7 + - _ShadowAlpha: 0.5 + - _ShadowX: 0.1 + - _ShadowY: -0.05 + - _ShakeUvSpeed: 2.5 + - _ShakeUvX: 1.5 + - _ShakeUvY: 1 + - _ShineGlow: 1 + - _ShineLocation: 0.5 + - _ShineRotate: 0 + - _ShineWidth: 0.1 + - _TextureScrollXSpeed: -1 + - _TextureScrollYSpeed: 0 + - _TwistUvAmount: 1 + - _TwistUvPosX: 0.5 + - _TwistUvPosY: 0.5 + - _TwistUvRadius: 0.75 + - _WaveAmount: 7 + - _WaveSpeed: 10 + - _WaveStrength: 7.5 + - _WaveX: 0 + - _WaveY: 0.5 + - _ZTestMode: 4 + - _ZWrite: 0 + - _ZoomUvAmount: 0.5 + m_Colors: + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _ColorChangeNewCol: {r: 1, g: 1, b: 0, a: 1} + - _ColorChangeTarget: {r: 1, g: 0, b: 0, a: 1} + - _ColorSwapBlue: {r: 1, g: 1, b: 1, a: 1} + - _ColorSwapGreen: {r: 1, g: 1, b: 1, a: 1} + - _ColorSwapRed: {r: 1, g: 1, b: 1, a: 1} + - _FadeBurnColor: {r: 1, g: 1, b: 0, a: 1} + - _GlowColor: {r: 1, g: 1, b: 1, a: 1} + - _GradBotLeftCol: {r: 0, g: 0, b: 1, a: 1} + - _GradBotRightCol: {r: 0, g: 0, b: 1, a: 1} + - _GradTopLeftCol: {r: 1, g: 0, b: 0, a: 1} + - _GradTopRightCol: {r: 1, g: 0, b: 0, a: 1} + - _GreyscaleTintColor: {r: 1, g: 1, b: 1, a: 1} + - _HitEffectColor: {r: 1, g: 1, b: 1, a: 1} + - _HologramStripeColor: {r: 1, g: 1, b: 1, a: 1} + - _InnerOutlineColor: {r: 1, g: 0, b: 0, a: 1} + - _OutlineColor: {r: 1, g: 0.5309945, b: 0, a: 1} + - _ShadowColor: {r: 0, g: 0, b: 0, a: 1} + - _ShineColor: {r: 1, g: 1, b: 1, a: 1} +--- !u!1 &938057642 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 938057646} + - component: {fileID: 938057645} + - component: {fileID: 938057644} + - component: {fileID: 938057643} + m_Layer: 0 + m_Name: NegativeGlow + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!114 &938057643 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 938057642} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: ee158225ee1e59f4791627785501d950, type: 3} + m_Name: + m_EditorClassIdentifier: + shaderTypes: 4 + normalStrenght: 5 + normalSmoothing: 1 + computingNormal: 0 +--- !u!114 &938057644 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 938057642} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 98b644315d7a92842b89e04f55c48e02, type: 3} + m_Name: + m_EditorClassIdentifier: +--- !u!212 &938057645 +SpriteRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 938057642} + m_Enabled: 1 + m_CastShadows: 0 + m_ReceiveShadows: 0 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 1809645131} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 0 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_Sprite: {fileID: 21300000, guid: 519dafacd208bb64c83d5124be03b09d, type: 3} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_FlipX: 0 + m_FlipY: 0 + m_DrawMode: 0 + m_Size: {x: 5.12, y: 5.12} + m_AdaptiveModeThreshold: 0.5 + m_SpriteTileMode: 0 + m_WasSpriteAssigned: 1 + m_MaskInteraction: 0 + m_SpriteSortPoint: 0 +--- !u!4 &938057646 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 938057642} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 20.37, y: -0.19999897, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 298946312} + m_RootOrder: 25 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!21 &967204686 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: AllIn1SpriteShader/AllIn1SpriteShader + m_Shader: {fileID: 4800000, guid: a36b7719ff0465b42ab1407d67672c5f, type: 3} + m_ShaderKeywords: COLORSWAP_ON ETC1_EXTERNAL_ALPHA + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _ColorRampTex: + m_Texture: {fileID: 2800000, guid: 279657edc397ece4b8029c727adf6ddc, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ColorSwapTex: + m_Texture: {fileID: 2800000, guid: 065da6c7b90ca904dab9cbc6b415fd19, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DistortTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _FadeBurnTex: + m_Texture: {fileID: 2800000, guid: 32e8df0008bebe746b1681a71c61f31c, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _FadeTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _GlowTex: + 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} + - _OutlineDistortTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OutlineTex: + m_Texture: {fileID: 2800000, guid: 74087f6d03f233e4a8a142fa01f9e5cf, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ShineMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - _Alpha: 1 + - _AlphaCutoffValue: 0.25 + - _AlphaRoundThreshold: 0.5 + - _BillboardY: 0 + - _BlurHD: 0 + - _BlurIntensity: 10 + - _ChromAberrAlpha: 0.4 + - _ChromAberrAmount: 1 + - _ClipUvDown: 1 + - _ClipUvLeft: 1 + - _ClipUvRight: 1 + - _ClipUvUp: 1 + - _ColorChangeLuminosity: 0 + - _ColorChangeTolerance: 0.25 + - _ColorRampLuminosity: 0 + - _ColorRampOutline: 0 + - _ColorSwapBlueLuminosity: 0.5 + - _ColorSwapGreenLuminosity: 0.09 + - _ColorSwapRedLuminosity: 0.604 + - _DistortAmount: 0.5 + - _DistortTexXSpeed: 5 + - _DistortTexYSpeed: 5 + - _FadeAmount: -0.1 + - _FadeBurnGlow: 2 + - _FadeBurnTransition: 0.075 + - _FadeBurnWidth: 0.025 + - _FishEyeUvAmount: 0.35 + - _FlickerAlpha: 0 + - _FlickerFreq: 0.2 + - _FlickerPercent: 0.05 + - _GhostColorBoost: 1 + - _GhostTransparency: 0 + - _GlitchAmount: 3 + - _GlitchSize: 1 + - _Glow: 10 + - _GlowTexUsed: 0 + - _GradBlend: 1 + - _GradBoostX: 1.2 + - _GradBoostY: 1.2 + - _GradIsRadial: 0 + - _GrassManualAnim: 1 + - _GrassManualToggle: 0 + - _GrassRadialBend: 0.1 + - _GrassSpeed: 2 + - _GrassWind: 20 + - _GreyscaleLuminosity: 0 + - _GreyscaleOutline: 0 + - _HandDrawnAmount: 10 + - _HandDrawnSpeed: 5 + - _HitEffectBlend: 1 + - _HitEffectGlow: 5 + - _HologramFlickerAlpha: 0 + - _HologramFlickerFreq: 0.2 + - _HologramFlickerPercent: 0.05 + - _HologramMaxAlpha: 1 + - _HologramMinAlpha: 0 + - _HologramStripesAlpha: 0.4 + - _HologramStripesAmount: 50 + - _HologramStripesFill: 0.4 + - _HologramStripesLuminosity: 1 + - _HologramStripesSpeed: 5 + - _HologramUnmodAmount: 0.4 + - _HsvBright: 1 + - _HsvSaturation: 1 + - _HsvShift: 180 + - _InnerOutlineAlpha: 1 + - _InnerOutlineGlow: 1 + - _InnerOutlineThickness: 1 + - _MaxXUV: 1 + - _MaxYUV: 1 + - _MinXUV: 0 + - _MinYUV: 0 + - _MotionBlurAngle: 0.1 + - _MotionBlurDist: 1.25 + - _MyDstMode: 10 + - _MySrcMode: 5 + - _NegativeAmount: 1 + - _OffsetUvX: 0 + - _OffsetUvY: 0 + - _OnlyInnerOutline: 0 + - _OnlyOutline: 0 + - _Outline8Directions: 0 + - _OutlineAlpha: 1 + - _OutlineDistortAmount: 0.5 + - _OutlineDistortTexXSpeed: 5 + - _OutlineDistortTexYSpeed: 5 + - _OutlineDistortToggle: 0 + - _OutlineGlow: 1.5 + - _OutlineIsPixel: 0 + - _OutlinePixelWidth: 1 + - _OutlineTexGrey: 0 + - _OutlineTexToggle: 0 + - _OutlineTexXSpeed: 10 + - _OutlineTexYSpeed: 0 + - _OutlineWidth: 0.004 + - _PinchUvAmount: 0.35 + - _PixelateSize: 32 + - _PosterizeGamma: 0.75 + - _PosterizeNumColors: 8 + - _PosterizeOutline: 0 + - _RandomSeed: 0 + - _RectSize: 1 + - _RotateUvAmount: 0 + - _RoundWaveSpeed: 2 + - _RoundWaveStrength: 0.7 + - _ShadowAlpha: 0.5 + - _ShadowX: 0.1 + - _ShadowY: -0.05 + - _ShakeUvSpeed: 2.5 + - _ShakeUvX: 1.5 + - _ShakeUvY: 1 + - _ShineGlow: 1 + - _ShineLocation: 0.5 + - _ShineRotate: 0 + - _ShineWidth: 0.1 + - _TextureScrollXSpeed: 1 + - _TextureScrollYSpeed: 0 + - _TwistUvAmount: 1 + - _TwistUvPosX: 0.5 + - _TwistUvPosY: 0.5 + - _TwistUvRadius: 0.75 + - _WaveAmount: 7 + - _WaveSpeed: 10 + - _WaveStrength: 7.5 + - _WaveX: 0 + - _WaveY: 0.5 + - _ZTestMode: 4 + - _ZWrite: 0 + - _ZoomUvAmount: 0.5 + m_Colors: + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _ColorChangeNewCol: {r: 1, g: 1, b: 0, a: 1} + - _ColorChangeTarget: {r: 1, g: 0, b: 0, a: 1} + - _ColorSwapBlue: {r: 1, g: 1, b: 1, a: 1} + - _ColorSwapGreen: {r: 1, g: 0, b: 0, a: 1} + - _ColorSwapRed: {r: 0, g: 0.5643088, b: 0.8396226, a: 1} + - _FadeBurnColor: {r: 1, g: 1, b: 0, a: 1} + - _GlowColor: {r: 1, g: 1, b: 1, a: 1} + - _GradBotLeftCol: {r: 0, g: 0, b: 1, a: 1} + - _GradBotRightCol: {r: 0, g: 0, b: 1, a: 1} + - _GradTopLeftCol: {r: 1, g: 0, b: 0, a: 1} + - _GradTopRightCol: {r: 1, g: 0, b: 0, a: 1} + - _GreyscaleTintColor: {r: 1, g: 1, b: 1, a: 1} + - _HitEffectColor: {r: 1, g: 1, b: 1, a: 1} + - _HologramStripeColor: {r: 1, g: 1, b: 1, a: 1} + - _InnerOutlineColor: {r: 1, g: 0, b: 0, a: 1} + - _OutlineColor: {r: 1, g: 1, b: 1, a: 1} + - _ShadowColor: {r: 0, g: 0, b: 0, a: 1} + - _ShineColor: {r: 1, g: 1, b: 1, a: 1} +--- !u!1 &984096427 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 984096428} + - component: {fileID: 984096430} + - component: {fileID: 984096431} + - component: {fileID: 984096429} + m_Layer: 0 + m_Name: Gradient + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &984096428 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 984096427} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: -0.4899993, y: -0.19999897, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 298946312} + m_RootOrder: 2 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &984096429 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 984096427} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: ee158225ee1e59f4791627785501d950, type: 3} + m_Name: + m_EditorClassIdentifier: + shaderTypes: 4 + normalStrenght: 5 + normalSmoothing: 1 + computingNormal: 0 +--- !u!212 &984096430 +SpriteRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 984096427} + m_Enabled: 1 + m_CastShadows: 0 + m_ReceiveShadows: 0 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 1899749361} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 0 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_Sprite: {fileID: 21300000, guid: 519dafacd208bb64c83d5124be03b09d, type: 3} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_FlipX: 0 + m_FlipY: 0 + m_DrawMode: 0 + m_Size: {x: 5.12, y: 5.12} + m_AdaptiveModeThreshold: 0.5 + m_SpriteTileMode: 0 + m_WasSpriteAssigned: 1 + m_MaskInteraction: 0 + m_SpriteSortPoint: 0 +--- !u!114 &984096431 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 984096427} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 98b644315d7a92842b89e04f55c48e02, type: 3} + m_Name: + m_EditorClassIdentifier: +--- !u!21 &1027409867 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: AllIn1SpriteShader/AllIn1SpriteShader + m_Shader: {fileID: 4800000, guid: a36b7719ff0465b42ab1407d67672c5f, type: 3} + m_ShaderKeywords: DOODLE_ON ETC1_EXTERNAL_ALPHA FISHEYE_ON GLOW_ON GREYSCALE_ON + TWISTUV_ON WAVEUV_ON WIND_ON + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _ColorRampTex: + m_Texture: {fileID: 2800000, guid: 279657edc397ece4b8029c727adf6ddc, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ColorSwapTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DistortTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _FadeBurnTex: + m_Texture: {fileID: 2800000, guid: 32e8df0008bebe746b1681a71c61f31c, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _FadeTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _GlowTex: + 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} + - _OutlineDistortTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OutlineTex: + m_Texture: {fileID: 2800000, guid: 74087f6d03f233e4a8a142fa01f9e5cf, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ShineMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - _Alpha: 1 + - _AlphaCutoffValue: 0.25 + - _AlphaRoundThreshold: 0.5 + - _BillboardY: 0 + - _BlurHD: 0 + - _BlurIntensity: 10 + - _ChromAberrAlpha: 0.4 + - _ChromAberrAmount: 1 + - _ClipUvDown: 1 + - _ClipUvLeft: 0.95 + - _ClipUvRight: 0.95 + - _ClipUvUp: 0.95 + - _ColorChangeLuminosity: 0 + - _ColorChangeTolerance: 0.25 + - _ColorRampLuminosity: 0 + - _ColorRampOutline: 0 + - _ColorSwapBlueLuminosity: 0.5 + - _ColorSwapGreenLuminosity: 0.5 + - _ColorSwapRedLuminosity: 0.5 + - _DistortAmount: 0.5 + - _DistortTexXSpeed: 5 + - _DistortTexYSpeed: 5 + - _FadeAmount: -0.1 + - _FadeBurnGlow: 2 + - _FadeBurnTransition: 0.075 + - _FadeBurnWidth: 0.025 + - _FishEyeUvAmount: 0.061 + - _FlickerAlpha: 0 + - _FlickerFreq: 0.2 + - _FlickerPercent: 0.05 + - _GhostColorBoost: 1 + - _GhostTransparency: 0 + - _GlitchAmount: 3 + - _GlitchSize: 1 + - _Glow: 1.5 + - _GlowTexUsed: 0 + - _GradBlend: 1 + - _GradBoostX: 1.2 + - _GradBoostY: 1.2 + - _GradIsRadial: 0 + - _GrassManualAnim: 1 + - _GrassManualToggle: 0 + - _GrassRadialBend: 0.1 + - _GrassSpeed: 2 + - _GrassWind: 20 + - _GreyscaleLuminosity: -0.08 + - _GreyscaleOutline: 0 + - _HandDrawnAmount: 10 + - _HandDrawnSpeed: 5 + - _HitEffectBlend: 1 + - _HitEffectGlow: 10 + - _HologramFlickerAlpha: 0 + - _HologramFlickerFreq: 0.2 + - _HologramFlickerPercent: 0.05 + - _HologramMaxAlpha: 1 + - _HologramMinAlpha: 0 + - _HologramStripesAlpha: 0.4 + - _HologramStripesAmount: 50 + - _HologramStripesFill: 0.4 + - _HologramStripesLuminosity: 1 + - _HologramStripesSpeed: 5 + - _HologramUnmodAmount: 0.4 + - _HsvBright: 1 + - _HsvSaturation: 1 + - _HsvShift: 180 + - _InnerOutlineAlpha: 1 + - _InnerOutlineGlow: 1 + - _InnerOutlineThickness: 1 + - _MaxXUV: 1 + - _MaxYUV: 1 + - _MinXUV: 0 + - _MinYUV: 0 + - _MotionBlurAngle: 0.1 + - _MotionBlurDist: 1.25 + - _MyDstMode: 10 + - _MySrcMode: 5 + - _NegativeAmount: 1 + - _OffsetUvX: 0 + - _OffsetUvY: 0 + - _OnlyInnerOutline: 0 + - _OnlyOutline: 0 + - _Outline8Directions: 0 + - _OutlineAlpha: 1 + - _OutlineDistortAmount: 0.5 + - _OutlineDistortTexXSpeed: 5 + - _OutlineDistortTexYSpeed: 5 + - _OutlineDistortToggle: 0 + - _OutlineGlow: 1.5 + - _OutlineIsPixel: 0 + - _OutlinePixelWidth: 1 + - _OutlineTexGrey: 0 + - _OutlineTexToggle: 0 + - _OutlineTexXSpeed: 10 + - _OutlineTexYSpeed: 0 + - _OutlineWidth: 0.004 + - _PinchUvAmount: 0 + - _PixelateSize: 32 + - _PosterizeGamma: 0.75 + - _PosterizeNumColors: 8 + - _PosterizeOutline: 0 + - _RandomSeed: 0 + - _RectSize: 1 + - _RotateUvAmount: 0 + - _RoundWaveSpeed: 2 + - _RoundWaveStrength: 0.7 + - _ShadowAlpha: 0.5 + - _ShadowX: 0.1 + - _ShadowY: -0.05 + - _ShakeUvSpeed: 2.5 + - _ShakeUvX: 1.5 + - _ShakeUvY: 1 + - _ShineGlow: 1 + - _ShineLocation: 0.5 + - _ShineRotate: 0 + - _ShineWidth: 0.1 + - _TextureScrollXSpeed: 1 + - _TextureScrollYSpeed: 0 + - _TwistUvAmount: 0.1 + - _TwistUvPosX: 0.5 + - _TwistUvPosY: 0.5 + - _TwistUvRadius: 0.75 + - _WaveAmount: 7 + - _WaveSpeed: 10 + - _WaveStrength: 7.5 + - _WaveX: 0 + - _WaveY: 0.5 + - _ZTestMode: 4 + - _ZWrite: 0 + - _ZoomUvAmount: 0.5 + m_Colors: + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _ColorChangeNewCol: {r: 1, g: 1, b: 0, a: 1} + - _ColorChangeTarget: {r: 1, g: 0, b: 0, a: 1} + - _ColorSwapBlue: {r: 1, g: 1, b: 1, a: 1} + - _ColorSwapGreen: {r: 1, g: 1, b: 1, a: 1} + - _ColorSwapRed: {r: 1, g: 1, b: 1, a: 1} + - _FadeBurnColor: {r: 1, g: 1, b: 0, a: 1} + - _GlowColor: {r: 1, g: 1, b: 1, a: 1} + - _GradBotLeftCol: {r: 0, g: 0, b: 1, a: 1} + - _GradBotRightCol: {r: 0, g: 0, b: 1, a: 1} + - _GradTopLeftCol: {r: 1, g: 0, b: 0, a: 1} + - _GradTopRightCol: {r: 1, g: 0, b: 0, a: 1} + - _GreyscaleTintColor: {r: 1, g: 0.9780377, b: 0, a: 1} + - _HitEffectColor: {r: 1, g: 0.08018869, b: 0.08018869, a: 1} + - _HologramStripeColor: {r: 1, g: 1, b: 1, a: 1} + - _InnerOutlineColor: {r: 1, g: 0, b: 0, a: 1} + - _OutlineColor: {r: 1, g: 1, b: 1, a: 1} + - _ShadowColor: {r: 0, g: 0, b: 0, a: 1} + - _ShineColor: {r: 1, g: 1, b: 1, a: 1} +--- !u!1 &1038353158 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1038353159} + - component: {fileID: 1038353162} + - component: {fileID: 1038353161} + - component: {fileID: 1038353160} + m_Layer: 0 + m_Name: Impact + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1038353159 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1038353158} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: -20.269999, y: -0.19999897, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 298946312} + m_RootOrder: 23 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &1038353160 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1038353158} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: ee158225ee1e59f4791627785501d950, type: 3} + m_Name: + m_EditorClassIdentifier: + shaderTypes: 4 + normalStrenght: 5 + normalSmoothing: 1 + computingNormal: 0 +--- !u!114 &1038353161 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1038353158} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 98b644315d7a92842b89e04f55c48e02, type: 3} + m_Name: + m_EditorClassIdentifier: +--- !u!212 &1038353162 +SpriteRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1038353158} + m_Enabled: 1 + m_CastShadows: 0 + m_ReceiveShadows: 0 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 1450236711} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 0 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_Sprite: {fileID: 21300000, guid: 519dafacd208bb64c83d5124be03b09d, type: 3} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_FlipX: 0 + m_FlipY: 0 + m_DrawMode: 0 + m_Size: {x: 5.12, y: 5.12} + m_AdaptiveModeThreshold: 0.5 + m_SpriteTileMode: 0 + m_WasSpriteAssigned: 1 + m_MaskInteraction: 0 + m_SpriteSortPoint: 0 +--- !u!21 &1072076325 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: AllIn1SpriteShader/AllIn1SpriteShader + m_Shader: {fileID: 4800000, guid: a36b7719ff0465b42ab1407d67672c5f, type: 3} + m_ShaderKeywords: COLORSWAP_ON ETC1_EXTERNAL_ALPHA GLOWTEX_ON GLOW_ON OUTBASE8DIR_ON + OUTBASE_ON OUTDIST_ON OUTTEX_ON _GLOWTEXUSED_ON _OUTLINE8DIRECTIONS_ON _OUTLINEDISTORTTOGGLE_ON + _OUTLINETEXTOGGLE_ON + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _ColorRampTex: + m_Texture: {fileID: 2800000, guid: 279657edc397ece4b8029c727adf6ddc, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ColorSwapTex: + m_Texture: {fileID: 2800000, guid: 065da6c7b90ca904dab9cbc6b415fd19, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DistortTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _FadeBurnTex: + m_Texture: {fileID: 2800000, guid: 32e8df0008bebe746b1681a71c61f31c, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _FadeTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _GlowTex: + m_Texture: {fileID: 2800000, guid: 8608ef90f91271745a17f7210fe1e7db, type: 3} + 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} + - _OutlineDistortTex: + m_Texture: {fileID: 2800000, guid: f96aebb9bcd1e3b44bafbb23b1bdac88, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OutlineTex: + m_Texture: {fileID: 2800000, guid: 677cca399782dea41aedc1d292ecb67d, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ShineMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - _Alpha: 1 + - _AlphaCutoffValue: 0.25 + - _AlphaRoundThreshold: 0.5 + - _BillboardY: 0 + - _BlurHD: 0 + - _BlurIntensity: 10 + - _ChromAberrAlpha: 0.4 + - _ChromAberrAmount: 1 + - _ClipUvDown: 1 + - _ClipUvLeft: 1 + - _ClipUvRight: 1 + - _ClipUvUp: 1 + - _ColorChangeLuminosity: 0 + - _ColorChangeTolerance: 0.25 + - _ColorRampLuminosity: 0 + - _ColorRampOutline: 0 + - _ColorSwapBlueLuminosity: 0.5 + - _ColorSwapGreenLuminosity: 0.128 + - _ColorSwapRedLuminosity: 0.5 + - _DistortAmount: 0.5 + - _DistortTexXSpeed: 5 + - _DistortTexYSpeed: 5 + - _FadeAmount: -0.1 + - _FadeBurnGlow: 2 + - _FadeBurnTransition: 0.075 + - _FadeBurnWidth: 0.025 + - _FishEyeUvAmount: 0.35 + - _FlickerAlpha: 0 + - _FlickerFreq: 0.2 + - _FlickerPercent: 0.05 + - _GhostColorBoost: 1 + - _GhostTransparency: 0 + - _GlitchAmount: 3 + - _GlitchSize: 1 + - _Glow: 6.1 + - _GlowTexUsed: 1 + - _GradBlend: 1 + - _GradBoostX: 1.2 + - _GradBoostY: 1.2 + - _GradIsRadial: 0 + - _GrassManualAnim: 1 + - _GrassManualToggle: 0 + - _GrassRadialBend: 0.1 + - _GrassSpeed: 2 + - _GrassWind: 20 + - _GreyscaleLuminosity: 0 + - _GreyscaleOutline: 0 + - _HandDrawnAmount: 10 + - _HandDrawnSpeed: 5 + - _HitEffectBlend: 1 + - _HitEffectGlow: 5 + - _HologramFlickerAlpha: 0 + - _HologramFlickerFreq: 0.2 + - _HologramFlickerPercent: 0.05 + - _HologramMaxAlpha: 1 + - _HologramMinAlpha: 0 + - _HologramStripesAlpha: 0.4 + - _HologramStripesAmount: 50 + - _HologramStripesFill: 0.4 + - _HologramStripesLuminosity: 1 + - _HologramStripesSpeed: 5 + - _HologramUnmodAmount: 0.4 + - _HsvBright: 1 + - _HsvSaturation: 1 + - _HsvShift: 180 + - _InnerOutlineAlpha: 1 + - _InnerOutlineGlow: 1 + - _InnerOutlineThickness: 1 + - _MaxXUV: 1 + - _MaxYUV: 1 + - _MinXUV: 0 + - _MinYUV: 0 + - _MotionBlurAngle: 0.1 + - _MotionBlurDist: 1.25 + - _MyDstMode: 10 + - _MySrcMode: 5 + - _NegativeAmount: 1 + - _OffsetUvX: 0 + - _OffsetUvY: 0 + - _OnlyInnerOutline: 0 + - _OnlyOutline: 0 + - _Outline8Directions: 1 + - _OutlineAlpha: 1 + - _OutlineDistortAmount: 0.125 + - _OutlineDistortTexXSpeed: 0 + - _OutlineDistortTexYSpeed: -4 + - _OutlineDistortToggle: 1 + - _OutlineGlow: 11 + - _OutlineIsPixel: 0 + - _OutlinePixelWidth: 1 + - _OutlineTexGrey: 0 + - _OutlineTexToggle: 1 + - _OutlineTexXSpeed: 1 + - _OutlineTexYSpeed: -5 + - _OutlineWidth: 0.0172 + - _PinchUvAmount: 0.35 + - _PixelateSize: 32 + - _PosterizeGamma: 0.75 + - _PosterizeNumColors: 8 + - _PosterizeOutline: 0 + - _RandomSeed: 0 + - _RectSize: 1 + - _RotateUvAmount: 0 + - _RoundWaveSpeed: 2 + - _RoundWaveStrength: 0.7 + - _ShadowAlpha: 0.5 + - _ShadowX: 0.1 + - _ShadowY: -0.05 + - _ShakeUvSpeed: 2.5 + - _ShakeUvX: 1.5 + - _ShakeUvY: 1 + - _ShineGlow: 1 + - _ShineLocation: 0.5 + - _ShineRotate: 0 + - _ShineWidth: 0.1 + - _TextureScrollXSpeed: 1 + - _TextureScrollYSpeed: 0 + - _TwistUvAmount: 1 + - _TwistUvPosX: 0.5 + - _TwistUvPosY: 0.5 + - _TwistUvRadius: 0.75 + - _WaveAmount: 8.95 + - _WaveSpeed: 12.14 + - _WaveStrength: 18.77 + - _WaveX: 0 + - _WaveY: 0.5 + - _ZTestMode: 4 + - _ZWrite: 0 + - _ZoomUvAmount: 0.5 + m_Colors: + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _ColorChangeNewCol: {r: 1, g: 1, b: 0, a: 1} + - _ColorChangeTarget: {r: 1, g: 0, b: 0, a: 1} + - _ColorSwapBlue: {r: 0.3490566, g: 0.3490566, b: 0.3490566, a: 1} + - _ColorSwapGreen: {r: 1, g: 0.11792451, b: 0.11792451, a: 1} + - _ColorSwapRed: {r: 0.6603774, g: 0.6603774, b: 0.6603774, a: 1} + - _FadeBurnColor: {r: 1, g: 1, b: 0, a: 1} + - _GlowColor: {r: 0.990566, g: 0.1448469, b: 0.1448469, a: 1} + - _GradBotLeftCol: {r: 0, g: 0, b: 1, a: 1} + - _GradBotRightCol: {r: 0, g: 0, b: 1, a: 1} + - _GradTopLeftCol: {r: 1, g: 0, b: 0, a: 1} + - _GradTopRightCol: {r: 1, g: 0, b: 0, a: 1} + - _GreyscaleTintColor: {r: 1, g: 1, b: 1, a: 1} + - _HitEffectColor: {r: 1, g: 1, b: 1, a: 1} + - _HologramStripeColor: {r: 1, g: 1, b: 1, a: 1} + - _InnerOutlineColor: {r: 1, g: 0, b: 0, a: 1} + - _OutlineColor: {r: 1, g: 0, b: 0, a: 1} + - _ShadowColor: {r: 0, g: 0, b: 0, a: 1} + - _ShineColor: {r: 1, g: 1, b: 1, a: 1} +--- !u!4 &1073973762 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1073973763} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 4.5100007, y: -0.19999897, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 298946312} + m_RootOrder: 7 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &1073973763 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1073973762} + - component: {fileID: 1073973765} + - component: {fileID: 1073973766} + - component: {fileID: 1073973764} + m_Layer: 0 + m_Name: Outline3 + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!114 &1073973764 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1073973763} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: ee158225ee1e59f4791627785501d950, type: 3} + m_Name: + m_EditorClassIdentifier: + shaderTypes: 0 + normalStrenght: 5 + normalSmoothing: 1 + computingNormal: 0 +--- !u!212 &1073973765 +SpriteRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1073973763} + m_Enabled: 1 + m_CastShadows: 0 + m_ReceiveShadows: 0 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 694833596} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 0 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_Sprite: {fileID: 21300000, guid: 519dafacd208bb64c83d5124be03b09d, type: 3} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_FlipX: 0 + m_FlipY: 0 + m_DrawMode: 0 + m_Size: {x: 5.12, y: 5.12} + m_AdaptiveModeThreshold: 0.5 + m_SpriteTileMode: 0 + m_WasSpriteAssigned: 1 + m_MaskInteraction: 0 + m_SpriteSortPoint: 0 +--- !u!114 &1073973766 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1073973763} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 98b644315d7a92842b89e04f55c48e02, type: 3} + m_Name: + m_EditorClassIdentifier: +--- !u!1 &1119325821 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1119325822} + - component: {fileID: 1119325826} + - component: {fileID: 1119325825} + - component: {fileID: 1119325824} + m_Layer: 0 + m_Name: Twist + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1119325822 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1119325821} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 15.269999, y: -0.19999897, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 298946312} + m_RootOrder: 4 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &1119325824 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1119325821} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: ee158225ee1e59f4791627785501d950, type: 3} + m_Name: + m_EditorClassIdentifier: + shaderTypes: 4 + normalStrenght: 5 + normalSmoothing: 1 + computingNormal: 0 +--- !u!114 &1119325825 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1119325821} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 98b644315d7a92842b89e04f55c48e02, type: 3} + m_Name: + m_EditorClassIdentifier: +--- !u!212 &1119325826 +SpriteRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1119325821} + m_Enabled: 1 + m_CastShadows: 0 + m_ReceiveShadows: 0 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 1027409867} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 0 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_Sprite: {fileID: 21300000, guid: 519dafacd208bb64c83d5124be03b09d, type: 3} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_FlipX: 0 + m_FlipY: 0 + m_DrawMode: 0 + m_Size: {x: 5.12, y: 5.12} + m_AdaptiveModeThreshold: 0.5 + m_SpriteTileMode: 0 + m_WasSpriteAssigned: 1 + m_MaskInteraction: 0 + m_SpriteSortPoint: 0 +--- !u!1 &1229041065 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1229041066} + - component: {fileID: 1229041068} + - component: {fileID: 1229041069} + - component: {fileID: 1229041067} + m_Layer: 0 + m_Name: HueShift + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1229041066 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1229041065} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: -15.49, y: 4.8000007, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 298946312} + m_RootOrder: 8 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &1229041067 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1229041065} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: ee158225ee1e59f4791627785501d950, type: 3} + m_Name: + m_EditorClassIdentifier: + shaderTypes: 4 + normalStrenght: 5 + normalSmoothing: 1 + computingNormal: 0 +--- !u!212 &1229041068 +SpriteRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1229041065} + m_Enabled: 1 + m_CastShadows: 0 + m_ReceiveShadows: 0 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 689553382} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 0 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_Sprite: {fileID: 21300000, guid: 519dafacd208bb64c83d5124be03b09d, type: 3} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_FlipX: 0 + m_FlipY: 0 + m_DrawMode: 0 + m_Size: {x: 5.12, y: 5.12} + m_AdaptiveModeThreshold: 0.5 + m_SpriteTileMode: 0 + m_WasSpriteAssigned: 1 + m_MaskInteraction: 0 + m_SpriteSortPoint: 0 +--- !u!114 &1229041069 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1229041065} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 98b644315d7a92842b89e04f55c48e02, type: 3} + m_Name: + m_EditorClassIdentifier: +--- !u!1 &1239183345 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1239183348} + - component: {fileID: 1239183347} + - component: {fileID: 1239183346} + - component: {fileID: 1239183350} + - component: {fileID: 1239183349} + m_Layer: 4 + m_Name: Main Camera + m_TagString: MainCamera + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!81 &1239183346 +AudioListener: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1239183345} + m_Enabled: 1 +--- !u!20 &1239183347 +Camera: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1239183345} + m_Enabled: 1 + serializedVersion: 2 + m_ClearFlags: 1 + m_BackGroundColor: {r: 0.2924528, g: 0.2924528, b: 0.2924528, a: 0} + m_projectionMatrixMode: 1 + m_SensorSize: {x: 36, y: 24} + m_LensShift: {x: 0, y: 0} + m_GateFitMode: 2 + m_FocalLength: 50 + m_NormalizedViewPortRect: + serializedVersion: 2 + x: 0 + y: 0 + width: 1 + height: 1 + near clip plane: 0.3 + far clip plane: 1000 + field of view: 125 + orthographic: 0 + orthographic size: 5 + m_Depth: -1 + m_CullingMask: + serializedVersion: 2 + m_Bits: 4294967295 + m_RenderingPath: -1 + m_TargetTexture: {fileID: 0} + m_TargetDisplay: 0 + m_TargetEye: 3 + m_HDR: 1 + m_AllowMSAA: 1 + m_AllowDynamicResolution: 0 + m_ForceIntoRT: 1 + m_OcclusionCulling: 1 + m_StereoConvergence: 10 + m_StereoSeparation: 0.022 +--- !u!4 &1239183348 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1239183345} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: -20} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &1239183349 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1239183345} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 8b9a305e18de0c04dbd257a21cd47087, type: 3} + m_Name: + m_EditorClassIdentifier: + sharedProfile: {fileID: 11400000, guid: c12f806a2a3ae954ebb1771c65441e4c, type: 2} + isGlobal: 1 + blendDistance: 0 + weight: 1 + priority: 0 +--- !u!114 &1239183350 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1239183345} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 948f4100a11a5c24981795d21301da5c, type: 3} + m_Name: + m_EditorClassIdentifier: + volumeTrigger: {fileID: 1239183348} + volumeLayer: + serializedVersion: 2 + m_Bits: 16 + stopNaNPropagation: 1 + finalBlitToCameraTarget: 1 + antialiasingMode: 0 + temporalAntialiasing: + jitterSpread: 0.75 + sharpness: 0.25 + stationaryBlending: 0.95 + motionBlending: 0.85 + subpixelMorphologicalAntialiasing: + quality: 2 + fastApproximateAntialiasing: + fastMode: 0 + keepAlpha: 0 + fog: + enabled: 1 + excludeSkybox: 1 + debugLayer: + lightMeter: + width: 512 + height: 256 + showCurves: 1 + histogram: + width: 512 + height: 256 + channel: 3 + waveform: + exposure: 0.12 + height: 256 + vectorscope: + size: 256 + exposure: 0.12 + overlaySettings: + linearDepth: 0 + motionColorIntensity: 4 + motionGridSize: 64 + colorBlindnessType: 0 + colorBlindnessStrength: 1 + m_Resources: {fileID: 11400000, guid: d82512f9c8e5d4a4d938b575d47f88d4, type: 2} + m_ShowToolkit: 0 + m_ShowCustomSorter: 0 + breakBeforeColorGrading: 0 + m_BeforeTransparentBundles: [] + m_BeforeStackBundles: [] + m_AfterStackBundles: [] +--- !u!1 &1350115730 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1350115731} + - component: {fileID: 1350115734} + - component: {fileID: 1350115733} + - component: {fileID: 1350115732} + m_Layer: 0 + m_Name: Evil Marine + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1350115731 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1350115730} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: -10.49, y: -0.19999897, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 298946312} + m_RootOrder: 19 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &1350115732 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1350115730} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: ee158225ee1e59f4791627785501d950, type: 3} + m_Name: + m_EditorClassIdentifier: + shaderTypes: 0 + normalStrenght: 5 + normalSmoothing: 1 + computingNormal: 0 +--- !u!114 &1350115733 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1350115730} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 98b644315d7a92842b89e04f55c48e02, type: 3} + m_Name: + m_EditorClassIdentifier: +--- !u!212 &1350115734 +SpriteRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1350115730} + m_Enabled: 1 + m_CastShadows: 0 + m_ReceiveShadows: 0 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 1072076325} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 0 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_Sprite: {fileID: 21300000, guid: 519dafacd208bb64c83d5124be03b09d, type: 3} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_FlipX: 0 + m_FlipY: 0 + m_DrawMode: 0 + m_Size: {x: 5.12, y: 5.12} + m_AdaptiveModeThreshold: 0.5 + m_SpriteTileMode: 0 + m_WasSpriteAssigned: 1 + m_MaskInteraction: 0 + m_SpriteSortPoint: 0 +--- !u!21 &1433877713 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: AllIn1SpriteShader/AllIn1SpriteShader + m_Shader: {fileID: 4800000, guid: a36b7719ff0465b42ab1407d67672c5f, type: 3} + m_ShaderKeywords: CHROMABERR_ON DOODLE_ON ETC1_EXTERNAL_ALPHA FLICKER_ON GLITCH_ON + GLOW_ON GREYSCALE_ON HOLOGRAM_ON OUTBASE8DIR_ON OUTBASE_ON _OUTLINE8DIRECTIONS_ON + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _ColorRampTex: + m_Texture: {fileID: 2800000, guid: 279657edc397ece4b8029c727adf6ddc, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ColorSwapTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DistortTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _FadeBurnTex: + m_Texture: {fileID: 2800000, guid: 32e8df0008bebe746b1681a71c61f31c, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _FadeTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _GlowTex: + 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} + - _OutlineDistortTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OutlineTex: + m_Texture: {fileID: 2800000, guid: 74087f6d03f233e4a8a142fa01f9e5cf, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ShineMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - _Alpha: 1 + - _AlphaCutoffValue: 0.25 + - _AlphaRoundThreshold: 0.5 + - _BillboardY: 0 + - _BlurHD: 0 + - _BlurIntensity: 10 + - _ChromAberrAlpha: 0.4 + - _ChromAberrAmount: 0 + - _ClipUvDown: 1 + - _ClipUvLeft: 1 + - _ClipUvRight: 1 + - _ClipUvUp: 1 + - _ColorChangeLuminosity: 0 + - _ColorChangeTolerance: 0.25 + - _ColorRampLuminosity: 0 + - _ColorRampOutline: 0 + - _ColorSwapBlueLuminosity: 0.5 + - _ColorSwapGreenLuminosity: 0.5 + - _ColorSwapRedLuminosity: 0.5 + - _DistortAmount: 0.5 + - _DistortTexXSpeed: 5 + - _DistortTexYSpeed: 5 + - _FadeAmount: -0.1 + - _FadeBurnGlow: 2 + - _FadeBurnTransition: 0.075 + - _FadeBurnWidth: 0.025 + - _FishEyeUvAmount: 0 + - _FlickerAlpha: 0.4 + - _FlickerFreq: 0.2 + - _FlickerPercent: 0.1 + - _GhostColorBoost: 1 + - _GhostTransparency: 0 + - _GlitchAmount: 8.47 + - _GlitchSize: 1 + - _Glow: 5.2 + - _GlowTexUsed: 0 + - _GradBlend: 1 + - _GradBoostX: 1.2 + - _GradBoostY: 1.2 + - _GradIsRadial: 0 + - _GrassManualAnim: 1 + - _GrassManualToggle: 0 + - _GrassRadialBend: 0.1 + - _GrassSpeed: 2 + - _GrassWind: 20 + - _GreyscaleLuminosity: 0 + - _GreyscaleOutline: 0 + - _HandDrawnAmount: 7.08 + - _HandDrawnSpeed: 5 + - _HitEffectBlend: 1 + - _HitEffectGlow: 5 + - _HologramFlickerAlpha: 0 + - _HologramFlickerFreq: 0.2 + - _HologramFlickerPercent: 0.05 + - _HologramMaxAlpha: 1.4 + - _HologramMinAlpha: 0.43 + - _HologramStripesAlpha: 0.362 + - _HologramStripesAmount: 0.071 + - _HologramStripesFill: 0.334 + - _HologramStripesLuminosity: 1.26 + - _HologramStripesSpeed: 3.19 + - _HologramUnmodAmount: 0 + - _HsvBright: 1 + - _HsvSaturation: 1 + - _HsvShift: 180 + - _InnerOutlineAlpha: 1 + - _InnerOutlineGlow: 1 + - _InnerOutlineThickness: 1 + - _MaxXUV: 1 + - _MaxYUV: 1 + - _MinXUV: 0 + - _MinYUV: 0 + - _MotionBlurAngle: 0.1 + - _MotionBlurDist: 1.25 + - _MyDstMode: 10 + - _MySrcMode: 5 + - _NegativeAmount: 1 + - _OffsetUvX: 0 + - _OffsetUvY: 0 + - _OnlyInnerOutline: 0 + - _OnlyOutline: 0 + - _Outline8Directions: 1 + - _OutlineAlpha: 1 + - _OutlineDistortAmount: 0.5 + - _OutlineDistortTexXSpeed: 5 + - _OutlineDistortTexYSpeed: 5 + - _OutlineDistortToggle: 0 + - _OutlineGlow: 1 + - _OutlineIsPixel: 0 + - _OutlinePixelWidth: 1 + - _OutlineTexGrey: 0 + - _OutlineTexToggle: 0 + - _OutlineTexXSpeed: 10 + - _OutlineTexYSpeed: 0 + - _OutlineWidth: 0.035 + - _PinchUvAmount: 0.102 + - _PixelateSize: 32 + - _PosterizeGamma: 0.75 + - _PosterizeNumColors: 8 + - _PosterizeOutline: 0 + - _RandomSeed: 0 + - _RectSize: 1 + - _RotateUvAmount: 0 + - _RoundWaveSpeed: 2 + - _RoundWaveStrength: 0.7 + - _ShadowAlpha: 0.5 + - _ShadowX: 0.1 + - _ShadowY: -0.05 + - _ShakeUvSpeed: 2.5 + - _ShakeUvX: 1.5 + - _ShakeUvY: 1 + - _ShineGlow: 1 + - _ShineLocation: 0.5 + - _ShineRotate: 0 + - _ShineWidth: 0.1 + - _TextureScrollXSpeed: 1 + - _TextureScrollYSpeed: 0 + - _TwistUvAmount: 1 + - _TwistUvPosX: 0.5 + - _TwistUvPosY: 0.5 + - _TwistUvRadius: 0.75 + - _WaveAmount: 7 + - _WaveSpeed: 10 + - _WaveStrength: 7.5 + - _WaveX: 0 + - _WaveY: 0.5 + - _ZTestMode: 4 + - _ZWrite: 0 + - _ZoomUvAmount: 0.5 + m_Colors: + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _ColorChangeNewCol: {r: 1, g: 1, b: 0, a: 1} + - _ColorChangeTarget: {r: 1, g: 0, b: 0, a: 1} + - _ColorSwapBlue: {r: 1, g: 1, b: 1, a: 1} + - _ColorSwapGreen: {r: 1, g: 1, b: 1, a: 1} + - _ColorSwapRed: {r: 1, g: 1, b: 1, a: 1} + - _FadeBurnColor: {r: 1, g: 1, b: 0, a: 1} + - _GlowColor: {r: 0, g: 0.09171247, b: 0.6698113, a: 1} + - _GradBotLeftCol: {r: 0, g: 0, b: 1, a: 1} + - _GradBotRightCol: {r: 0, g: 0, b: 1, a: 1} + - _GradTopLeftCol: {r: 1, g: 0, b: 0, a: 1} + - _GradTopRightCol: {r: 1, g: 0, b: 0, a: 1} + - _GreyscaleTintColor: {r: 0.4433962, g: 0.4433962, b: 0.4433962, a: 1} + - _HitEffectColor: {r: 1, g: 1, b: 1, a: 1} + - _HologramStripeColor: {r: 0, g: 0.67701864, b: 1, a: 1} + - _InnerOutlineColor: {r: 1, g: 0, b: 0, a: 1} + - _OutlineColor: {r: 0, g: 0.43268147, b: 0.67058825, a: 1} + - _ShadowColor: {r: 0, g: 0, b: 0, a: 1} + - _ShineColor: {r: 1, g: 1, b: 1, a: 1} +--- !u!1 &1434614527 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1434614528} + - component: {fileID: 1434614530} + - component: {fileID: 1434614531} + - component: {fileID: 1434614529} + m_Layer: 0 + m_Name: Negative + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1434614528 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1434614527} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: -0.4899993, y: 4.8000007, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 298946312} + m_RootOrder: 15 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &1434614529 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1434614527} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: ee158225ee1e59f4791627785501d950, type: 3} + m_Name: + m_EditorClassIdentifier: + shaderTypes: 4 + normalStrenght: 5 + normalSmoothing: 1 + computingNormal: 0 +--- !u!212 &1434614530 +SpriteRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1434614527} + m_Enabled: 1 + m_CastShadows: 0 + m_ReceiveShadows: 0 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 1889875392} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 0 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_Sprite: {fileID: 21300000, guid: 519dafacd208bb64c83d5124be03b09d, type: 3} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_FlipX: 0 + m_FlipY: 0 + m_DrawMode: 0 + m_Size: {x: 5.12, y: 5.12} + m_AdaptiveModeThreshold: 0.5 + m_SpriteTileMode: 0 + m_WasSpriteAssigned: 1 + m_MaskInteraction: 0 + m_SpriteSortPoint: 0 +--- !u!114 &1434614531 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1434614527} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 98b644315d7a92842b89e04f55c48e02, type: 3} + m_Name: + m_EditorClassIdentifier: +--- !u!21 &1450236711 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: AllIn1SpriteShader/AllIn1SpriteShader + m_Shader: {fileID: 4800000, guid: a36b7719ff0465b42ab1407d67672c5f, type: 3} + m_ShaderKeywords: CHROMABERR_ON ETC1_EXTERNAL_ALPHA FISHEYE_ON HITEFFECT_ON OUTBASE8DIR_ON + OUTBASE_ON PINCH_ON _OUTLINE8DIRECTIONS_ON + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _ColorRampTex: + m_Texture: {fileID: 2800000, guid: 279657edc397ece4b8029c727adf6ddc, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ColorSwapTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DistortTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _FadeBurnTex: + m_Texture: {fileID: 2800000, guid: 32e8df0008bebe746b1681a71c61f31c, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _FadeTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _GlowTex: + 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} + - _OutlineDistortTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OutlineTex: + m_Texture: {fileID: 2800000, guid: 74087f6d03f233e4a8a142fa01f9e5cf, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ShineMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - _Alpha: 1 + - _AlphaCutoffValue: 0.25 + - _AlphaRoundThreshold: 0.5 + - _BillboardY: 0 + - _BlurHD: 0 + - _BlurIntensity: 10 + - _ChromAberrAlpha: 0.249 + - _ChromAberrAmount: 0.563 + - _ClipUvDown: 1 + - _ClipUvLeft: 1 + - _ClipUvRight: 1 + - _ClipUvUp: 1 + - _ColorChangeLuminosity: 0 + - _ColorChangeTolerance: 0.25 + - _ColorRampLuminosity: 0 + - _ColorRampOutline: 0 + - _ColorSwapBlueLuminosity: 0.5 + - _ColorSwapGreenLuminosity: 0.5 + - _ColorSwapRedLuminosity: 0.5 + - _DistortAmount: 0.5 + - _DistortTexXSpeed: 5 + - _DistortTexYSpeed: 5 + - _FadeAmount: -0.1 + - _FadeBurnGlow: 2 + - _FadeBurnTransition: 0.075 + - _FadeBurnWidth: 0.025 + - _FishEyeUvAmount: 0 + - _FlickerAlpha: 0 + - _FlickerFreq: 0.2 + - _FlickerPercent: 0.05 + - _GhostColorBoost: 1 + - _GhostTransparency: 0 + - _GlitchAmount: 3 + - _GlitchSize: 1 + - _Glow: 10 + - _GlowTexUsed: 0 + - _GradBlend: 1 + - _GradBoostX: 1.2 + - _GradBoostY: 1.2 + - _GradIsRadial: 0 + - _GrassManualAnim: 1 + - _GrassManualToggle: 0 + - _GrassRadialBend: 0.1 + - _GrassSpeed: 2 + - _GrassWind: 20 + - _GreyscaleLuminosity: 0 + - _GreyscaleOutline: 0 + - _HandDrawnAmount: 10 + - _HandDrawnSpeed: 5 + - _HitEffectBlend: 0 + - _HitEffectGlow: 5 + - _HologramFlickerAlpha: 0 + - _HologramFlickerFreq: 0.2 + - _HologramFlickerPercent: 0.05 + - _HologramMaxAlpha: 1 + - _HologramMinAlpha: 0 + - _HologramStripesAlpha: 0.4 + - _HologramStripesAmount: 50 + - _HologramStripesFill: 0.4 + - _HologramStripesLuminosity: 1 + - _HologramStripesSpeed: 5 + - _HologramUnmodAmount: 0.4 + - _HsvBright: 1 + - _HsvSaturation: 1 + - _HsvShift: 224 + - _InnerOutlineAlpha: 1 + - _InnerOutlineGlow: 1 + - _InnerOutlineThickness: 1 + - _MaxXUV: 1 + - _MaxYUV: 1 + - _MinXUV: 0 + - _MinYUV: 0 + - _MotionBlurAngle: 0.1 + - _MotionBlurDist: 1.25 + - _MyDstMode: 10 + - _MySrcMode: 5 + - _NegativeAmount: 1 + - _OffsetUvX: 0 + - _OffsetUvY: 0 + - _OnlyInnerOutline: 0 + - _OnlyOutline: 0 + - _Outline8Directions: 1 + - _OutlineAlpha: 1 + - _OutlineDistortAmount: 0.5 + - _OutlineDistortTexXSpeed: 5 + - _OutlineDistortTexYSpeed: 5 + - _OutlineDistortToggle: 0 + - _OutlineGlow: 2 + - _OutlineIsPixel: 0 + - _OutlinePixelWidth: 1 + - _OutlineTexGrey: 0 + - _OutlineTexToggle: 0 + - _OutlineTexXSpeed: 10 + - _OutlineTexYSpeed: 0 + - _OutlineWidth: 0.021 + - _PinchUvAmount: 0.075 + - _PixelateSize: 32 + - _PosterizeGamma: 0.75 + - _PosterizeNumColors: 8 + - _PosterizeOutline: 0 + - _RandomSeed: 0 + - _RectSize: 1 + - _RotateUvAmount: 0 + - _RoundWaveSpeed: 2 + - _RoundWaveStrength: 0.7 + - _ShadowAlpha: 0.5 + - _ShadowX: 0.1 + - _ShadowY: -0.05 + - _ShakeUvSpeed: 2.5 + - _ShakeUvX: 1.5 + - _ShakeUvY: 1 + - _ShineGlow: 1 + - _ShineLocation: 0.5 + - _ShineRotate: 0 + - _ShineWidth: 0.1 + - _TextureScrollXSpeed: 1 + - _TextureScrollYSpeed: 0 + - _TwistUvAmount: 1 + - _TwistUvPosX: 0.5 + - _TwistUvPosY: 0.5 + - _TwistUvRadius: 0.75 + - _WaveAmount: 7 + - _WaveSpeed: 10 + - _WaveStrength: 7.5 + - _WaveX: 0 + - _WaveY: 0.5 + - _ZTestMode: 4 + - _ZWrite: 0 + - _ZoomUvAmount: 0.5 + m_Colors: + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _ColorChangeNewCol: {r: 1, g: 1, b: 0, a: 1} + - _ColorChangeTarget: {r: 1, g: 0, b: 0, a: 1} + - _ColorSwapBlue: {r: 1, g: 1, b: 1, a: 1} + - _ColorSwapGreen: {r: 1, g: 1, b: 1, a: 1} + - _ColorSwapRed: {r: 1, g: 1, b: 1, a: 1} + - _FadeBurnColor: {r: 1, g: 1, b: 0, a: 1} + - _GlowColor: {r: 1, g: 1, b: 1, a: 1} + - _GradBotLeftCol: {r: 0, g: 0, b: 1, a: 1} + - _GradBotRightCol: {r: 0, g: 0, b: 1, a: 1} + - _GradTopLeftCol: {r: 1, g: 0, b: 0, a: 1} + - _GradTopRightCol: {r: 1, g: 0, b: 0, a: 1} + - _GreyscaleTintColor: {r: 1, g: 1, b: 1, a: 1} + - _HitEffectColor: {r: 1, g: 1, b: 1, a: 1} + - _HologramStripeColor: {r: 1, g: 1, b: 1, a: 1} + - _InnerOutlineColor: {r: 1, g: 0, b: 0, a: 1} + - _OutlineColor: {r: 1, g: 0.9094448, b: 0, a: 1} + - _ShadowColor: {r: 0, g: 0, b: 0, a: 1} + - _ShineColor: {r: 1, g: 1, b: 1, a: 1} +--- !u!21 &1455058978 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: AllIn1SpriteShader/AllIn1SpriteShader + m_Shader: {fileID: 4800000, guid: a36b7719ff0465b42ab1407d67672c5f, type: 3} + m_ShaderKeywords: DISTORT_ON ETC1_EXTERNAL_ALPHA FLICKER_ON GREYSCALE_ON HOLOGRAM_ON + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _ColorRampTex: + m_Texture: {fileID: 2800000, guid: 279657edc397ece4b8029c727adf6ddc, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ColorSwapTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DistortTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _FadeBurnTex: + m_Texture: {fileID: 2800000, guid: 32e8df0008bebe746b1681a71c61f31c, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _FadeTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _GlowTex: + 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} + - _OutlineDistortTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OutlineTex: + m_Texture: {fileID: 2800000, guid: 74087f6d03f233e4a8a142fa01f9e5cf, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ShineMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - _Alpha: 1 + - _AlphaCutoffValue: 0.25 + - _AlphaRoundThreshold: 0.5 + - _BillboardY: 0 + - _BlurHD: 0 + - _BlurIntensity: 10 + - _ChromAberrAlpha: 0.4 + - _ChromAberrAmount: 1 + - _ClipUvDown: 1 + - _ClipUvLeft: 1 + - _ClipUvRight: 1 + - _ClipUvUp: 1 + - _ColorChangeLuminosity: 0 + - _ColorChangeTolerance: 0.25 + - _ColorRampLuminosity: 0 + - _ColorRampOutline: 0 + - _ColorSwapBlueLuminosity: 0.5 + - _ColorSwapGreenLuminosity: 0.5 + - _ColorSwapRedLuminosity: 0.5 + - _DistortAmount: 0.4 + - _DistortTexXSpeed: 5 + - _DistortTexYSpeed: 5 + - _FadeAmount: -0.1 + - _FadeBurnGlow: 2 + - _FadeBurnTransition: 0.075 + - _FadeBurnWidth: 0.025 + - _FishEyeUvAmount: 0.35 + - _FlickerAlpha: 0 + - _FlickerFreq: 0.2 + - _FlickerPercent: 0.05 + - _GhostColorBoost: 1 + - _GhostTransparency: 0 + - _GlitchAmount: 3 + - _GlitchSize: 1 + - _Glow: 0 + - _GlowTexUsed: 0 + - _GradBlend: 1 + - _GradBoostX: 1.2 + - _GradBoostY: 1.2 + - _GradIsRadial: 0 + - _GrassManualAnim: 1 + - _GrassManualToggle: 0 + - _GrassRadialBend: 0.1 + - _GrassSpeed: 2 + - _GrassWind: 20 + - _GreyscaleLuminosity: 0 + - _GreyscaleOutline: 0 + - _HandDrawnAmount: 10 + - _HandDrawnSpeed: 5 + - _HitEffectBlend: 1 + - _HitEffectGlow: 5 + - _HologramFlickerAlpha: 0 + - _HologramFlickerFreq: 0.2 + - _HologramFlickerPercent: 0.05 + - _HologramMaxAlpha: 2.24 + - _HologramMinAlpha: 0.284 + - _HologramStripesAlpha: 0.815 + - _HologramStripesAmount: 0.087 + - _HologramStripesFill: 0.4 + - _HologramStripesLuminosity: 0.62 + - _HologramStripesSpeed: 4.26 + - _HologramUnmodAmount: 0.061 + - _HsvBright: 1 + - _HsvSaturation: 1 + - _HsvShift: 180 + - _InnerOutlineAlpha: 1 + - _InnerOutlineGlow: 1 + - _InnerOutlineThickness: 1 + - _MaxXUV: 1 + - _MaxYUV: 1 + - _MinXUV: 0 + - _MinYUV: 0 + - _MotionBlurAngle: 0.1 + - _MotionBlurDist: 1.25 + - _MyDstMode: 10 + - _MySrcMode: 5 + - _NegativeAmount: 1 + - _OffsetUvX: 0 + - _OffsetUvY: 0 + - _OnlyInnerOutline: 0 + - _OnlyOutline: 0 + - _Outline8Directions: 0 + - _OutlineAlpha: 1 + - _OutlineDistortAmount: 0.5 + - _OutlineDistortTexXSpeed: 5 + - _OutlineDistortTexYSpeed: 5 + - _OutlineDistortToggle: 0 + - _OutlineGlow: 1.5 + - _OutlineIsPixel: 0 + - _OutlinePixelWidth: 1 + - _OutlineTexGrey: 0 + - _OutlineTexToggle: 0 + - _OutlineTexXSpeed: 10 + - _OutlineTexYSpeed: 0 + - _OutlineWidth: 0.004 + - _PinchUvAmount: 0.35 + - _PixelateSize: 32 + - _PosterizeGamma: 0.75 + - _PosterizeNumColors: 8 + - _PosterizeOutline: 0 + - _RandomSeed: 0 + - _RectSize: 1 + - _RotateUvAmount: 0 + - _RoundWaveSpeed: 2 + - _RoundWaveStrength: 0.7 + - _ShadowAlpha: 0.5 + - _ShadowX: 0.1 + - _ShadowY: -0.05 + - _ShakeUvSpeed: 2.5 + - _ShakeUvX: 1.5 + - _ShakeUvY: 1 + - _ShineGlow: 1 + - _ShineLocation: 0.5 + - _ShineRotate: 0 + - _ShineWidth: 0.1 + - _TextureScrollXSpeed: 1 + - _TextureScrollYSpeed: 0 + - _TwistUvAmount: 1 + - _TwistUvPosX: 0.5 + - _TwistUvPosY: 0.5 + - _TwistUvRadius: 0.75 + - _WaveAmount: 7 + - _WaveSpeed: 10 + - _WaveStrength: 7.5 + - _WaveX: 0 + - _WaveY: 0.5 + - _ZTestMode: 4 + - _ZWrite: 0 + - _ZoomUvAmount: 0.5 + m_Colors: + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _ColorChangeNewCol: {r: 1, g: 1, b: 0, a: 1} + - _ColorChangeTarget: {r: 1, g: 0, b: 0, a: 1} + - _ColorSwapBlue: {r: 1, g: 1, b: 1, a: 1} + - _ColorSwapGreen: {r: 1, g: 1, b: 1, a: 1} + - _ColorSwapRed: {r: 1, g: 1, b: 1, a: 1} + - _FadeBurnColor: {r: 1, g: 1, b: 0, a: 1} + - _GlowColor: {r: 1, g: 1, b: 1, a: 1} + - _GradBotLeftCol: {r: 0, g: 0, b: 1, a: 1} + - _GradBotRightCol: {r: 0, g: 0, b: 1, a: 1} + - _GradTopLeftCol: {r: 1, g: 0, b: 0, a: 1} + - _GradTopRightCol: {r: 1, g: 0, b: 0, a: 1} + - _GreyscaleTintColor: {r: 0, g: 0.80679727, b: 1, a: 1} + - _HitEffectColor: {r: 1, g: 1, b: 1, a: 1} + - _HologramStripeColor: {r: 0, g: 0.88246155, b: 1, a: 1} + - _InnerOutlineColor: {r: 1, g: 0, b: 0, a: 1} + - _OutlineColor: {r: 1, g: 1, b: 1, a: 1} + - _ShadowColor: {r: 0, g: 0, b: 0, a: 1} + - _ShineColor: {r: 1, g: 1, b: 1, a: 1} +--- !u!1 &1507269761 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1507269762} + - component: {fileID: 1507269766} + - component: {fileID: 1507269765} + - component: {fileID: 1507269764} + m_Layer: 0 + m_Name: TwistFace + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1507269762 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1507269761} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: -0.5999999, y: -5.1999993, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 298946312} + m_RootOrder: 22 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &1507269764 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1507269761} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: ee158225ee1e59f4791627785501d950, type: 3} + m_Name: + m_EditorClassIdentifier: + shaderTypes: 4 + normalStrenght: 5 + normalSmoothing: 1 + computingNormal: 0 +--- !u!114 &1507269765 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1507269761} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 98b644315d7a92842b89e04f55c48e02, type: 3} + m_Name: + m_EditorClassIdentifier: +--- !u!212 &1507269766 +SpriteRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1507269761} + m_Enabled: 1 + m_CastShadows: 0 + m_ReceiveShadows: 0 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 173818797} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 0 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_Sprite: {fileID: 21300000, guid: 519dafacd208bb64c83d5124be03b09d, type: 3} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_FlipX: 0 + m_FlipY: 0 + m_DrawMode: 0 + m_Size: {x: 5.12, y: 5.12} + m_AdaptiveModeThreshold: 0.5 + m_SpriteTileMode: 0 + m_WasSpriteAssigned: 1 + m_MaskInteraction: 0 + m_SpriteSortPoint: 0 +--- !u!1 &1675838107 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1675838108} + - component: {fileID: 1675838112} + - component: {fileID: 1675838111} + - component: {fileID: 1675838110} + m_Layer: 0 + m_Name: Army + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1675838108 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1675838107} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 9.359999, y: 4.8000007, z: 0} + m_LocalScale: {x: 0.88, y: 0.88, z: 0.88} + m_Children: [] + m_Father: {fileID: 298946312} + m_RootOrder: 20 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &1675838110 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1675838107} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: ee158225ee1e59f4791627785501d950, type: 3} + m_Name: + m_EditorClassIdentifier: + shaderTypes: 0 + normalStrenght: 5 + normalSmoothing: 1 + computingNormal: 0 +--- !u!114 &1675838111 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1675838107} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 98b644315d7a92842b89e04f55c48e02, type: 3} + m_Name: + m_EditorClassIdentifier: +--- !u!212 &1675838112 +SpriteRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1675838107} + m_Enabled: 1 + m_CastShadows: 0 + m_ReceiveShadows: 0 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 876267714} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 0 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_Sprite: {fileID: 21300000, guid: 519dafacd208bb64c83d5124be03b09d, type: 3} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_FlipX: 0 + m_FlipY: 0 + m_DrawMode: 0 + m_Size: {x: 5.12, y: 5.12} + m_AdaptiveModeThreshold: 0.5 + m_SpriteTileMode: 0 + m_WasSpriteAssigned: 1 + m_MaskInteraction: 0 + m_SpriteSortPoint: 0 +--- !u!21 &1691765423 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: AllIn1SpriteShader/AllIn1SpriteShader + m_Shader: {fileID: 4800000, guid: a36b7719ff0465b42ab1407d67672c5f, type: 3} + m_ShaderKeywords: ETC1_EXTERNAL_ALPHA INNEROUTLINE_ON + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _ColorRampTex: + m_Texture: {fileID: 2800000, guid: 279657edc397ece4b8029c727adf6ddc, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ColorSwapTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DistortTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _FadeBurnTex: + m_Texture: {fileID: 2800000, guid: 32e8df0008bebe746b1681a71c61f31c, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _FadeTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _GlowTex: + 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} + - _OutlineDistortTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OutlineTex: + m_Texture: {fileID: 2800000, guid: 74087f6d03f233e4a8a142fa01f9e5cf, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ShineMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - _Alpha: 1 + - _AlphaCutoffValue: 0.25 + - _AlphaRoundThreshold: 0.5 + - _BillboardY: 0 + - _BlurHD: 0 + - _BlurIntensity: 10 + - _ChromAberrAlpha: 0.4 + - _ChromAberrAmount: 1 + - _ClipUvDown: 1 + - _ClipUvLeft: 1 + - _ClipUvRight: 1 + - _ClipUvUp: 1 + - _ColorChangeLuminosity: 0 + - _ColorChangeTolerance: 0.25 + - _ColorRampLuminosity: 0 + - _ColorRampOutline: 0 + - _ColorSwapBlueLuminosity: 0.5 + - _ColorSwapGreenLuminosity: 0.5 + - _ColorSwapRedLuminosity: 0.5 + - _DistortAmount: 0.5 + - _DistortTexXSpeed: 5 + - _DistortTexYSpeed: 5 + - _FadeAmount: -0.1 + - _FadeBurnGlow: 2 + - _FadeBurnTransition: 0.075 + - _FadeBurnWidth: 0.025 + - _FishEyeUvAmount: 0.35 + - _FlickerAlpha: 0 + - _FlickerFreq: 0.2 + - _FlickerPercent: 0.05 + - _GhostColorBoost: 1 + - _GhostTransparency: 0 + - _GlitchAmount: 3 + - _GlitchSize: 1 + - _Glow: 10 + - _GlowTexUsed: 0 + - _GradBlend: 1 + - _GradBoostX: 1.2 + - _GradBoostY: 1.2 + - _GradIsRadial: 0 + - _GrassManualAnim: 1 + - _GrassManualToggle: 0 + - _GrassRadialBend: 0.1 + - _GrassSpeed: 2 + - _GrassWind: 20 + - _GreyscaleLuminosity: 0 + - _GreyscaleOutline: 0 + - _HandDrawnAmount: 10 + - _HandDrawnSpeed: 5 + - _HitEffectBlend: 1 + - _HitEffectGlow: 5 + - _HologramFlickerAlpha: 0 + - _HologramFlickerFreq: 0.2 + - _HologramFlickerPercent: 0.05 + - _HologramMaxAlpha: 1 + - _HologramMinAlpha: 0 + - _HologramStripesAlpha: 0.4 + - _HologramStripesAmount: 50 + - _HologramStripesFill: 0.4 + - _HologramStripesLuminosity: 1 + - _HologramStripesSpeed: 5 + - _HologramUnmodAmount: 0.4 + - _HsvBright: 1 + - _HsvSaturation: 1 + - _HsvShift: 180 + - _InnerOutlineAlpha: 1 + - _InnerOutlineGlow: 6.9 + - _InnerOutlineThickness: 3 + - _MaxXUV: 1 + - _MaxYUV: 1 + - _MinXUV: 0 + - _MinYUV: 0 + - _MotionBlurAngle: 0.1 + - _MotionBlurDist: 1.25 + - _MyDstMode: 10 + - _MySrcMode: 5 + - _NegativeAmount: 1 + - _OffsetUvX: 0 + - _OffsetUvY: 0 + - _OnlyInnerOutline: 0 + - _OnlyOutline: 0 + - _Outline8Directions: 0 + - _OutlineAlpha: 1 + - _OutlineDistortAmount: 0.5 + - _OutlineDistortTexXSpeed: 5 + - _OutlineDistortTexYSpeed: 5 + - _OutlineDistortToggle: 0 + - _OutlineGlow: 1.5 + - _OutlineIsPixel: 0 + - _OutlinePixelWidth: 1 + - _OutlineTexGrey: 0 + - _OutlineTexToggle: 0 + - _OutlineTexXSpeed: 10 + - _OutlineTexYSpeed: 0 + - _OutlineWidth: 0.004 + - _PinchUvAmount: 0.35 + - _PixelateSize: 32 + - _PosterizeGamma: 0.75 + - _PosterizeNumColors: 8 + - _PosterizeOutline: 0 + - _RandomSeed: 0 + - _RectSize: 1 + - _RotateUvAmount: 0 + - _RoundWaveSpeed: 2 + - _RoundWaveStrength: 0.7 + - _ShadowAlpha: 0.5 + - _ShadowX: 0.1 + - _ShadowY: -0.05 + - _ShakeUvSpeed: 2.5 + - _ShakeUvX: 1.5 + - _ShakeUvY: 1 + - _ShineGlow: 1 + - _ShineLocation: 0.5 + - _ShineRotate: 0 + - _ShineWidth: 0.1 + - _TextureScrollXSpeed: 1 + - _TextureScrollYSpeed: 0 + - _TwistUvAmount: 1 + - _TwistUvPosX: 0.5 + - _TwistUvPosY: 0.5 + - _TwistUvRadius: 0.75 + - _WaveAmount: 7 + - _WaveSpeed: 10 + - _WaveStrength: 7.5 + - _WaveX: 0 + - _WaveY: 0.5 + - _ZTestMode: 4 + - _ZWrite: 0 + - _ZoomUvAmount: 0.5 + m_Colors: + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _ColorChangeNewCol: {r: 1, g: 1, b: 0, a: 1} + - _ColorChangeTarget: {r: 1, g: 0, b: 0, a: 1} + - _ColorSwapBlue: {r: 1, g: 1, b: 1, a: 1} + - _ColorSwapGreen: {r: 1, g: 1, b: 1, a: 1} + - _ColorSwapRed: {r: 1, g: 1, b: 1, a: 1} + - _FadeBurnColor: {r: 1, g: 1, b: 0, a: 1} + - _GlowColor: {r: 1, g: 1, b: 1, a: 1} + - _GradBotLeftCol: {r: 0, g: 0, b: 1, a: 1} + - _GradBotRightCol: {r: 0, g: 0, b: 1, a: 1} + - _GradTopLeftCol: {r: 1, g: 0, b: 0, a: 1} + - _GradTopRightCol: {r: 1, g: 0, b: 0, a: 1} + - _GreyscaleTintColor: {r: 1, g: 1, b: 1, a: 1} + - _HitEffectColor: {r: 1, g: 1, b: 1, a: 1} + - _HologramStripeColor: {r: 1, g: 1, b: 1, a: 1} + - _InnerOutlineColor: {r: 1, g: 0.2028302, b: 0.9452239, a: 1} + - _OutlineColor: {r: 1, g: 1, b: 1, a: 1} + - _ShadowColor: {r: 0, g: 0, b: 0, a: 1} + - _ShineColor: {r: 1, g: 1, b: 1, a: 1} +--- !u!21 &1713942152 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: AllIn1SpriteShader/AllIn1SpriteShader + m_Shader: {fileID: 4800000, guid: a36b7719ff0465b42ab1407d67672c5f, type: 3} + m_ShaderKeywords: BLUR_ON COLORRAMP_ON ETC1_EXTERNAL_ALPHA GLOW_ON NEGATIVE_ON + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _ColorRampTex: + m_Texture: {fileID: 2800000, guid: 763e13699209a614b8800c76fc9dee48, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ColorSwapTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DistortTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _FadeBurnTex: + m_Texture: {fileID: 2800000, guid: 32e8df0008bebe746b1681a71c61f31c, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _FadeTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _GlowTex: + 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} + - _OutlineDistortTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OutlineTex: + m_Texture: {fileID: 2800000, guid: 74087f6d03f233e4a8a142fa01f9e5cf, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ShineMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - _Alpha: 1 + - _AlphaCutoffValue: 0.25 + - _AlphaRoundThreshold: 0.5 + - _BillboardY: 0 + - _BlurHD: 0 + - _BlurIntensity: 10 + - _ChromAberrAlpha: 0.4 + - _ChromAberrAmount: 1 + - _ClipUvDown: 1 + - _ClipUvLeft: 1 + - _ClipUvRight: 1 + - _ClipUvUp: 1 + - _ColorChangeLuminosity: 0 + - _ColorChangeTolerance: 0.25 + - _ColorRampLuminosity: -0.238 + - _ColorRampOutline: 0 + - _ColorSwapBlueLuminosity: 0.5 + - _ColorSwapGreenLuminosity: 0.5 + - _ColorSwapRedLuminosity: 0.5 + - _DistortAmount: 0.5 + - _DistortTexXSpeed: 5 + - _DistortTexYSpeed: 5 + - _FadeAmount: -0.1 + - _FadeBurnGlow: 2 + - _FadeBurnTransition: 0.075 + - _FadeBurnWidth: 0.025 + - _FishEyeUvAmount: 0.35 + - _FlickerAlpha: 0 + - _FlickerFreq: 0.2 + - _FlickerPercent: 0.05 + - _GhostColorBoost: 1 + - _GhostTransparency: 0 + - _GlitchAmount: 3 + - _GlitchSize: 1 + - _Glow: 0.5 + - _GlowTexUsed: 0 + - _GradBlend: 1 + - _GradBoostX: 1.2 + - _GradBoostY: 1.2 + - _GradIsRadial: 0 + - _GrassManualAnim: 1 + - _GrassManualToggle: 0 + - _GrassRadialBend: 0.1 + - _GrassSpeed: 2 + - _GrassWind: 20 + - _GreyscaleLuminosity: 0 + - _GreyscaleOutline: 0 + - _HandDrawnAmount: 10 + - _HandDrawnSpeed: 5 + - _HitEffectBlend: 1 + - _HitEffectGlow: 5 + - _HologramFlickerAlpha: 0 + - _HologramFlickerFreq: 0.2 + - _HologramMaxAlpha: 1 + - _HologramMinAlpha: 0 + - _HologramStripesAlpha: 0.4 + - _HologramStripesAmount: 50 + - _HologramStripesFill: 0.4 + - _HologramStripesLuminosity: 1 + - _HologramStripesSpeed: 5 + - _HologramUnmodAmount: 0.4 + - _HsvBright: 1 + - _HsvSaturation: 1 + - _HsvShift: 180 + - _InnerOutlineAlpha: 1 + - _InnerOutlineGlow: 1 + - _InnerOutlineThickness: 1 + - _MaxXUV: 1 + - _MaxYUV: 1 + - _MinXUV: 0 + - _MinYUV: 0 + - _MotionBlurAngle: 0.1 + - _MotionBlurDist: 1.25 + - _MyDstMode: 10 + - _MySrcMode: 5 + - _NegativeAmount: 1 + - _OffsetUvX: 0 + - _OffsetUvY: 0 + - _OnlyInnerOutline: 0 + - _OnlyOutline: 0 + - _Outline8Directions: 0 + - _OutlineAlpha: 1 + - _OutlineDistortAmount: 0.5 + - _OutlineDistortTexXSpeed: 5 + - _OutlineDistortTexYSpeed: 5 + - _OutlineDistortToggle: 0 + - _OutlineGlow: 1.5 + - _OutlineIsPixel: 0 + - _OutlinePixelWidth: 1 + - _OutlineTexGrey: 0 + - _OutlineTexToggle: 0 + - _OutlineTexXSpeed: 10 + - _OutlineTexYSpeed: 0 + - _OutlineWidth: 0.004 + - _PinchUvAmount: 0.35 + - _PixelateSize: 32 + - _PosterizeGamma: 0.75 + - _PosterizeNumColors: 8 + - _PosterizeOutline: 0 + - _RandomSeed: 0 + - _RectSize: 1 + - _RotateUvAmount: 0 + - _RoundWaveSpeed: 2 + - _RoundWaveStrength: 0.7 + - _ShadowAlpha: 0.5 + - _ShadowX: 0.1 + - _ShadowY: -0.05 + - _ShakeUvSpeed: 2.5 + - _ShakeUvX: 1.5 + - _ShakeUvY: 1 + - _ShineGlow: 1 + - _ShineLocation: 0.5 + - _ShineRotate: 0 + - _ShineWidth: 0.1 + - _TextureScrollXSpeed: 1 + - _TextureScrollYSpeed: 0 + - _TwistUvAmount: 1 + - _TwistUvPosX: 0.5 + - _TwistUvPosY: 0.5 + - _TwistUvRadius: 0.75 + - _WaveAmount: 7 + - _WaveSpeed: 10 + - _WaveStrength: 7.5 + - _WaveX: 0 + - _WaveY: 0.5 + - _ZTestMode: 4 + - _ZWrite: 0 + - _ZoomUvAmount: 0.5 + m_Colors: + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _ColorChangeNewCol: {r: 1, g: 1, b: 0, a: 1} + - _ColorChangeTarget: {r: 1, g: 0, b: 0, a: 1} + - _ColorSwapBlue: {r: 1, g: 1, b: 1, a: 1} + - _ColorSwapGreen: {r: 1, g: 1, b: 1, a: 1} + - _ColorSwapRed: {r: 1, g: 1, b: 1, a: 1} + - _FadeBurnColor: {r: 1, g: 1, b: 0, a: 1} + - _GlowColor: {r: 1, g: 1, b: 1, a: 1} + - _GradBotLeftCol: {r: 0, g: 0, b: 1, a: 1} + - _GradBotRightCol: {r: 0, g: 0, b: 1, a: 1} + - _GradTopLeftCol: {r: 1, g: 0, b: 0, a: 1} + - _GradTopRightCol: {r: 1, g: 0, b: 0, a: 1} + - _GreyscaleTintColor: {r: 1, g: 1, b: 1, a: 1} + - _HitEffectColor: {r: 1, g: 1, b: 1, a: 1} + - _HologramStripeColor: {r: 1, g: 1, b: 1, a: 1} + - _InnerOutlineColor: {r: 1, g: 0, b: 0, a: 1} + - _OutlineColor: {r: 1, g: 1, b: 1, a: 1} + - _ShadowColor: {r: 0, g: 0, b: 0, a: 1} + - _ShineColor: {r: 1, g: 1, b: 1, a: 1} +--- !u!21 &1789615841 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: AllIn1SpriteShader/AllIn1SpriteShader + m_Shader: {fileID: 4800000, guid: a36b7719ff0465b42ab1407d67672c5f, type: 3} + m_ShaderKeywords: COLORRAMP_ON ETC1_EXTERNAL_ALPHA OUTBASE8DIR_ON OUTBASE_ON RADIALGRADIENT_ON + _GRADISRADIAL_ON _OUTLINE8DIRECTIONS_ON + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _ColorRampTex: + m_Texture: {fileID: 2800000, guid: 763e13699209a614b8800c76fc9dee48, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ColorSwapTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DistortTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _FadeBurnTex: + m_Texture: {fileID: 2800000, guid: 32e8df0008bebe746b1681a71c61f31c, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _FadeTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _GlowTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MainTex: + m_Texture: {fileID: 0} + m_Scale: {x: 2, y: 2} + m_Offset: {x: 0, y: 0} + - _OutlineDistortTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OutlineTex: + m_Texture: {fileID: 2800000, guid: 74087f6d03f233e4a8a142fa01f9e5cf, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ShineMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - _Alpha: 1 + - _AlphaCutoffValue: 0.25 + - _AlphaRoundThreshold: 0.5 + - _BillboardY: 0 + - _BlurHD: 0 + - _BlurIntensity: 10 + - _ChromAberrAlpha: 0.4 + - _ChromAberrAmount: 1 + - _ClipUvDown: 1 + - _ClipUvLeft: 1 + - _ClipUvRight: 1 + - _ClipUvUp: 1 + - _ColorChangeLuminosity: 0 + - _ColorChangeTolerance: 0.25 + - _ColorRampLuminosity: 0 + - _ColorRampOutline: 0 + - _ColorSwapBlueLuminosity: 0.5 + - _ColorSwapGreenLuminosity: 0.5 + - _ColorSwapRedLuminosity: 0.5 + - _DistortAmount: 0.5 + - _DistortTexXSpeed: 5 + - _DistortTexYSpeed: 5 + - _FadeAmount: -0.1 + - _FadeBurnGlow: 2 + - _FadeBurnTransition: 0.075 + - _FadeBurnWidth: 0.025 + - _FishEyeUvAmount: 0.35 + - _FlickerAlpha: 0 + - _FlickerFreq: 0.2 + - _FlickerPercent: 0.05 + - _GhostColorBoost: 1 + - _GhostTransparency: 0 + - _GlitchAmount: 3 + - _GlitchSize: 1 + - _Glow: 10 + - _GlowTexUsed: 0 + - _GradBlend: 0 + - _GradBoostX: 0.77 + - _GradBoostY: 1.2 + - _GradIsRadial: 1 + - _GrassManualAnim: 1 + - _GrassManualToggle: 0 + - _GrassRadialBend: 0.1 + - _GrassSpeed: 2 + - _GrassWind: 20 + - _GreyscaleLuminosity: 0 + - _GreyscaleOutline: 0 + - _HandDrawnAmount: 10 + - _HandDrawnSpeed: 5 + - _HitEffectBlend: 1 + - _HitEffectGlow: 5 + - _HologramFlickerAlpha: 0 + - _HologramFlickerFreq: 0.2 + - _HologramFlickerPercent: 0.05 + - _HologramMaxAlpha: 1 + - _HologramMinAlpha: 0 + - _HologramStripesAlpha: 0.4 + - _HologramStripesAmount: 50 + - _HologramStripesFill: 0.4 + - _HologramStripesLuminosity: 1 + - _HologramStripesSpeed: 5 + - _HologramUnmodAmount: 0.4 + - _HsvBright: 1 + - _HsvSaturation: 1 + - _HsvShift: 15 + - _InnerOutlineAlpha: 1 + - _InnerOutlineGlow: 1 + - _InnerOutlineThickness: 1 + - _MaxXUV: 1 + - _MaxYUV: 1 + - _MinXUV: 0 + - _MinYUV: 0 + - _MotionBlurAngle: 0.1 + - _MotionBlurDist: 1.25 + - _MyDstMode: 10 + - _MySrcMode: 5 + - _NegativeAmount: 1 + - _OffsetUvX: 0 + - _OffsetUvY: 0 + - _OnlyInnerOutline: 0 + - _OnlyOutline: 0 + - _Outline8Directions: 1 + - _OutlineAlpha: 1 + - _OutlineDistortAmount: 0.5 + - _OutlineDistortTexXSpeed: 5 + - _OutlineDistortTexYSpeed: 5 + - _OutlineDistortToggle: 0 + - _OutlineGlow: 1.5 + - _OutlineIsPixel: 0 + - _OutlinePixelWidth: 1 + - _OutlineTexGrey: 0 + - _OutlineTexToggle: 0 + - _OutlineTexXSpeed: 10 + - _OutlineTexYSpeed: 0 + - _OutlineWidth: 0.035 + - _PinchUvAmount: 0.35 + - _PixelateSize: 32 + - _PosterizeGamma: 0.75 + - _PosterizeNumColors: 8 + - _PosterizeOutline: 0 + - _RandomSeed: 0 + - _RectSize: 1 + - _RotateUvAmount: 0 + - _RoundWaveSpeed: 2 + - _RoundWaveStrength: 0.7 + - _ShadowAlpha: 0.5 + - _ShadowX: 0.1 + - _ShadowY: -0.05 + - _ShakeUvSpeed: 2.5 + - _ShakeUvX: 1.5 + - _ShakeUvY: 1 + - _ShineGlow: 1 + - _ShineLocation: 0.5 + - _ShineRotate: 0 + - _ShineWidth: 0.1 + - _TextureScrollXSpeed: 1 + - _TextureScrollYSpeed: 0 + - _TwistUvAmount: 1 + - _TwistUvPosX: 0.5 + - _TwistUvPosY: 0.5 + - _TwistUvRadius: 0.75 + - _WaveAmount: 7 + - _WaveSpeed: 10 + - _WaveStrength: 7.5 + - _WaveX: 0 + - _WaveY: 0.5 + - _ZTestMode: 4 + - _ZWrite: 0 + - _ZoomUvAmount: 0.5 + m_Colors: + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _ColorChangeNewCol: {r: 1, g: 1, b: 0, a: 1} + - _ColorChangeTarget: {r: 1, g: 0, b: 0, a: 1} + - _ColorSwapBlue: {r: 1, g: 1, b: 1, a: 1} + - _ColorSwapGreen: {r: 1, g: 1, b: 1, a: 1} + - _ColorSwapRed: {r: 1, g: 1, b: 1, a: 1} + - _FadeBurnColor: {r: 1, g: 1, b: 0, a: 1} + - _GlowColor: {r: 1, g: 1, b: 1, a: 1} + - _GradBotLeftCol: {r: 0, g: 0, b: 1, a: 1} + - _GradBotRightCol: {r: 0, g: 0, b: 1, a: 1} + - _GradTopLeftCol: {r: 1, g: 0, b: 0, a: 1} + - _GradTopRightCol: {r: 1, g: 0, b: 0, a: 1} + - _GreyscaleTintColor: {r: 1, g: 1, b: 1, a: 1} + - _HitEffectColor: {r: 1, g: 1, b: 1, a: 1} + - _HologramStripeColor: {r: 1, g: 1, b: 1, a: 1} + - _InnerOutlineColor: {r: 1, g: 0, b: 0, a: 1} + - _OutlineColor: {r: 1, g: 1, b: 1, a: 1} + - _ShadowColor: {r: 0, g: 0, b: 0, a: 1} + - _ShineColor: {r: 1, g: 1, b: 1, a: 1} +--- !u!21 &1807806170 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: AllIn1SpriteShader/AllIn1SpriteShader + m_Shader: {fileID: 4800000, guid: a36b7719ff0465b42ab1407d67672c5f, type: 3} + m_ShaderKeywords: COLORRAMP_ON ETC1_EXTERNAL_ALPHA GLOWTEX_ON OUTBASE8DIR_ON OUTBASE_ON + PIXELATE_ON _GLOWTEXUSED_ON _OUTLINE8DIRECTIONS_ON + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _ColorRampTex: + m_Texture: {fileID: 2800000, guid: 285a35f6ccf7b1a44b6c198e96105173, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ColorSwapTex: + m_Texture: {fileID: 2800000, guid: 065da6c7b90ca904dab9cbc6b415fd19, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DistortTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _FadeBurnTex: + m_Texture: {fileID: 2800000, guid: 32e8df0008bebe746b1681a71c61f31c, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _FadeTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 0.5, y: 0.5} + m_Offset: {x: 0, y: 0} + - _GlowTex: + m_Texture: {fileID: 2800000, guid: 8608ef90f91271745a17f7210fe1e7db, type: 3} + 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} + - _OutlineDistortTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OutlineTex: + m_Texture: {fileID: 2800000, guid: 74087f6d03f233e4a8a142fa01f9e5cf, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ShineMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - _Alpha: 1 + - _AlphaCutoffValue: 0.975 + - _AlphaRoundThreshold: 0.5 + - _BillboardY: 0 + - _BlurHD: 0 + - _BlurIntensity: 10 + - _ChromAberrAlpha: 0.4 + - _ChromAberrAmount: 1 + - _ClipUvDown: 1 + - _ClipUvLeft: 1 + - _ClipUvRight: 1 + - _ClipUvUp: 1 + - _ColorChangeLuminosity: 0 + - _ColorChangeTolerance: 0.25 + - _ColorRampLuminosity: 0 + - _ColorRampOutline: 0 + - _ColorSwapBlueLuminosity: 0.75 + - _ColorSwapGreenLuminosity: 0.264 + - _ColorSwapRedLuminosity: 0.75 + - _DistortAmount: 0.5 + - _DistortTexXSpeed: 5 + - _DistortTexYSpeed: 5 + - _FadeAmount: 0.437 + - _FadeBurnGlow: 6.6 + - _FadeBurnTransition: 0.075 + - _FadeBurnWidth: 0.025 + - _FishEyeUvAmount: 0.35 + - _FlickerAlpha: 0 + - _FlickerFreq: 0.2 + - _FlickerPercent: 0.05 + - _GhostColorBoost: 1 + - _GhostTransparency: 0 + - _GlitchAmount: 3 + - _GlitchSize: 1 + - _Glow: 2.5 + - _GlowTexUsed: 1 + - _GradBlend: 1 + - _GradBoostX: 1.2 + - _GradBoostY: 1.2 + - _GradIsRadial: 0 + - _GrassManualAnim: 1 + - _GrassManualToggle: 0 + - _GrassRadialBend: 0.1 + - _GrassSpeed: 6.9 + - _GrassWind: 20 + - _GreyscaleLuminosity: 0 + - _GreyscaleOutline: 0 + - _HandDrawnAmount: 10 + - _HandDrawnSpeed: 5 + - _HitEffectBlend: 1 + - _HitEffectGlow: 5 + - _HologramFlickerAlpha: 0 + - _HologramFlickerFreq: 0.2 + - _HologramFlickerPercent: 0.05 + - _HologramMaxAlpha: 1 + - _HologramMinAlpha: 0 + - _HologramStripesAlpha: 0.4 + - _HologramStripesAmount: 50 + - _HologramStripesFill: 0.4 + - _HologramStripesLuminosity: 1 + - _HologramStripesSpeed: 5 + - _HologramUnmodAmount: 0.4 + - _HsvBright: 1 + - _HsvSaturation: 1 + - _HsvShift: 180 + - _InnerOutlineAlpha: 1 + - _InnerOutlineGlow: 1 + - _InnerOutlineThickness: 1 + - _MaxXUV: 1 + - _MaxYUV: 1 + - _MinXUV: 0 + - _MinYUV: 0 + - _MotionBlurAngle: 0.1 + - _MotionBlurDist: 1.25 + - _MyDstMode: 10 + - _MySrcMode: 5 + - _NegativeAmount: 1 + - _OffsetUvX: 0 + - _OffsetUvY: 0 + - _OnlyInnerOutline: 0 + - _OnlyOutline: 0 + - _Outline8Directions: 1 + - _OutlineAlpha: 1 + - _OutlineDistortAmount: 0.5 + - _OutlineDistortTexXSpeed: 5 + - _OutlineDistortTexYSpeed: 5 + - _OutlineDistortToggle: 0 + - _OutlineGlow: 1.5 + - _OutlineIsPixel: 0 + - _OutlinePixelWidth: 1 + - _OutlineTexGrey: 0 + - _OutlineTexToggle: 0 + - _OutlineTexXSpeed: 10 + - _OutlineTexYSpeed: 0 + - _OutlineWidth: 0.0539 + - _PinchUvAmount: 0.35 + - _PixelateSize: 40 + - _PosterizeGamma: 0.75 + - _PosterizeNumColors: 8 + - _PosterizeOutline: 0 + - _RandomSeed: 0 + - _RectSize: 1 + - _RotateUvAmount: 0 + - _RoundWaveSpeed: 2 + - _RoundWaveStrength: 0.7 + - _ShadowAlpha: 0.5 + - _ShadowX: 0.1 + - _ShadowY: -0.05 + - _ShakeUvSpeed: 1.61 + - _ShakeUvX: 1.5 + - _ShakeUvY: 1 + - _ShineGlow: 1 + - _ShineLocation: 0.5 + - _ShineRotate: 0 + - _ShineWidth: 0.1 + - _TextureScrollXSpeed: 1 + - _TextureScrollYSpeed: 0 + - _TwistUvAmount: 1 + - _TwistUvPosX: 0.5 + - _TwistUvPosY: 0.5 + - _TwistUvRadius: 0.75 + - _WaveAmount: 7 + - _WaveSpeed: 10 + - _WaveStrength: 7.5 + - _WaveX: 0 + - _WaveY: 0.5 + - _ZTestMode: 4 + - _ZWrite: 0 + - _ZoomUvAmount: 0.5 + m_Colors: + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _ColorChangeNewCol: {r: 1, g: 1, b: 0, a: 1} + - _ColorChangeTarget: {r: 1, g: 0, b: 0, a: 1} + - _ColorSwapBlue: {r: 0.41037738, g: 0.5180799, b: 1, a: 1} + - _ColorSwapGreen: {r: 0, g: 1, b: 0.96124196, a: 1} + - _ColorSwapRed: {r: 0.9528302, g: 0.783215, b: 0, a: 1} + - _FadeBurnColor: {r: 1, g: 1, b: 0, a: 1} + - _GlowColor: {r: 1, g: 1, b: 1, a: 1} + - _GradBotLeftCol: {r: 0, g: 0, b: 1, a: 1} + - _GradBotRightCol: {r: 0, g: 0, b: 1, a: 1} + - _GradTopLeftCol: {r: 1, g: 0, b: 0, a: 1} + - _GradTopRightCol: {r: 1, g: 0, b: 0, a: 1} + - _GreyscaleTintColor: {r: 1, g: 1, b: 1, a: 1} + - _HitEffectColor: {r: 1, g: 1, b: 1, a: 1} + - _HologramStripeColor: {r: 1, g: 1, b: 1, a: 1} + - _InnerOutlineColor: {r: 1, g: 0, b: 0, a: 1} + - _OutlineColor: {r: 1, g: 1, b: 1, a: 1} + - _ShadowColor: {r: 0, g: 0, b: 0, a: 1} + - _ShineColor: {r: 1, g: 1, b: 1, a: 1} +--- !u!21 &1809645131 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: AllIn1SpriteShader/AllIn1SpriteShader + m_Shader: {fileID: 4800000, guid: a36b7719ff0465b42ab1407d67672c5f, type: 3} + m_ShaderKeywords: ETC1_EXTERNAL_ALPHA GLOWTEX_ON GLOW_ON GREYSCALE_ON OUTBASE8DIR_ON + OUTBASE_ON _GLOWTEXUSED_ON _OUTLINE8DIRECTIONS_ON + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _ColorRampTex: + m_Texture: {fileID: 2800000, guid: 279657edc397ece4b8029c727adf6ddc, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ColorSwapTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DistortTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _FadeBurnTex: + m_Texture: {fileID: 2800000, guid: 32e8df0008bebe746b1681a71c61f31c, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _FadeTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _GlowTex: + m_Texture: {fileID: 2800000, guid: 8608ef90f91271745a17f7210fe1e7db, type: 3} + 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} + - _OutlineDistortTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OutlineTex: + m_Texture: {fileID: 2800000, guid: 74087f6d03f233e4a8a142fa01f9e5cf, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ShineMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - _Alpha: 1 + - _AlphaCutoffValue: 0.25 + - _AlphaRoundThreshold: 0.5 + - _BillboardY: 0 + - _BlurHD: 0 + - _BlurIntensity: 10 + - _ChromAberrAlpha: 0.4 + - _ChromAberrAmount: 1 + - _ClipUvDown: 1 + - _ClipUvLeft: 1 + - _ClipUvRight: 1 + - _ClipUvUp: 1 + - _ColorChangeLuminosity: 0 + - _ColorChangeTolerance: 0.25 + - _ColorRampLuminosity: 0 + - _ColorRampOutline: 0 + - _ColorSwapBlueLuminosity: 0.5 + - _ColorSwapGreenLuminosity: 0.5 + - _ColorSwapRedLuminosity: 0.5 + - _DistortAmount: 0.5 + - _DistortTexXSpeed: 5 + - _DistortTexYSpeed: 5 + - _FadeAmount: -0.1 + - _FadeBurnGlow: 2 + - _FadeBurnTransition: 0.075 + - _FadeBurnWidth: 0.025 + - _FishEyeUvAmount: 0.35 + - _FlickerAlpha: 0 + - _FlickerFreq: 0.2 + - _FlickerPercent: 0.05 + - _GhostColorBoost: 1 + - _GhostTransparency: 0 + - _GlitchAmount: 3 + - _GlitchSize: 1 + - _Glow: 5.6 + - _GlowTexUsed: 1 + - _GradBlend: 1 + - _GradBoostX: 1.2 + - _GradBoostY: 1.2 + - _GradIsRadial: 0 + - _GrassManualAnim: 1 + - _GrassManualToggle: 0 + - _GrassRadialBend: 0.1 + - _GrassSpeed: 2 + - _GrassWind: 20 + - _GreyscaleLuminosity: 0 + - _GreyscaleOutline: 0 + - _HandDrawnAmount: 10 + - _HandDrawnSpeed: 5 + - _HitEffectBlend: 1 + - _HitEffectGlow: 5 + - _HologramFlickerAlpha: 0 + - _HologramFlickerFreq: 0.2 + - _HologramFlickerPercent: 0.05 + - _HologramMaxAlpha: 1 + - _HologramMinAlpha: 0 + - _HologramStripesAlpha: 0.4 + - _HologramStripesAmount: 50 + - _HologramStripesFill: 0.4 + - _HologramStripesLuminosity: 1 + - _HologramStripesSpeed: 5 + - _HologramUnmodAmount: 0.4 + - _HsvBright: 1 + - _HsvSaturation: 1 + - _HsvShift: 180 + - _InnerOutlineAlpha: 1 + - _InnerOutlineGlow: 1 + - _InnerOutlineThickness: 1 + - _MaxXUV: 1 + - _MaxYUV: 1 + - _MinXUV: 0 + - _MinYUV: 0 + - _MotionBlurAngle: 0.1 + - _MotionBlurDist: 1.25 + - _MyDstMode: 10 + - _MySrcMode: 5 + - _NegativeAmount: 1 + - _OffsetUvX: 0 + - _OffsetUvY: 0 + - _OnlyInnerOutline: 0 + - _OnlyOutline: 0 + - _Outline8Directions: 1 + - _OutlineAlpha: 1 + - _OutlineDistortAmount: 0.5 + - _OutlineDistortTexXSpeed: 5 + - _OutlineDistortTexYSpeed: 5 + - _OutlineDistortToggle: 0 + - _OutlineGlow: 1 + - _OutlineIsPixel: 0 + - _OutlinePixelWidth: 1 + - _OutlineTexGrey: 0 + - _OutlineTexToggle: 0 + - _OutlineTexXSpeed: 10 + - _OutlineTexYSpeed: 0 + - _OutlineWidth: 0.008 + - _PinchUvAmount: 0.35 + - _PixelateSize: 32 + - _PosterizeGamma: 0.75 + - _PosterizeNumColors: 8 + - _PosterizeOutline: 0 + - _RandomSeed: 0 + - _RectSize: 1 + - _RotateUvAmount: 0 + - _RoundWaveSpeed: 2 + - _RoundWaveStrength: 0.7 + - _ShadowAlpha: 0.5 + - _ShadowX: 0.1 + - _ShadowY: -0.05 + - _ShakeUvSpeed: 2.5 + - _ShakeUvX: 1.5 + - _ShakeUvY: 1 + - _ShineGlow: 1 + - _ShineLocation: 0.5 + - _ShineRotate: 0 + - _ShineWidth: 0.1 + - _TextureScrollXSpeed: 1 + - _TextureScrollYSpeed: 0 + - _TwistUvAmount: 1 + - _TwistUvPosX: 0.5 + - _TwistUvPosY: 0.5 + - _TwistUvRadius: 0.75 + - _WaveAmount: 7 + - _WaveSpeed: 10 + - _WaveStrength: 7.5 + - _WaveX: 0 + - _WaveY: 0.5 + - _ZTestMode: 4 + - _ZWrite: 0 + - _ZoomUvAmount: 0.5 + m_Colors: + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _ColorChangeNewCol: {r: 1, g: 1, b: 0, a: 1} + - _ColorChangeTarget: {r: 1, g: 0, b: 0, a: 1} + - _ColorSwapBlue: {r: 1, g: 1, b: 1, a: 1} + - _ColorSwapGreen: {r: 1, g: 1, b: 1, a: 1} + - _ColorSwapRed: {r: 1, g: 1, b: 1, a: 1} + - _FadeBurnColor: {r: 1, g: 1, b: 0, a: 1} + - _GlowColor: {r: 1, g: 1, b: 1, a: 1} + - _GradBotLeftCol: {r: 0, g: 0, b: 1, a: 1} + - _GradBotRightCol: {r: 0, g: 0, b: 1, a: 1} + - _GradTopLeftCol: {r: 1, g: 0, b: 0, a: 1} + - _GradTopRightCol: {r: 1, g: 0, b: 0, a: 1} + - _GreyscaleTintColor: {r: 1, g: 1, b: 1, a: 1} + - _HitEffectColor: {r: 1, g: 1, b: 1, a: 1} + - _HologramStripeColor: {r: 1, g: 1, b: 1, a: 1} + - _InnerOutlineColor: {r: 1, g: 0, b: 0, a: 1} + - _OutlineColor: {r: 0, g: 0.13536787, b: 1, a: 1} + - _ShadowColor: {r: 0, g: 0, b: 0, a: 1} + - _ShineColor: {r: 1, g: 1, b: 1, a: 1} +--- !u!21 &1847541096 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: AllIn1SpriteShader/AllIn1SpriteShader + m_Shader: {fileID: 4800000, guid: a36b7719ff0465b42ab1407d67672c5f, type: 3} + m_ShaderKeywords: BLUR_ON ETC1_EXTERNAL_ALPHA GREYSCALE_ON OUTBASE8DIR_ON WIND_ON + _OUTLINE8DIRECTIONS_ON + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _ColorRampTex: + m_Texture: {fileID: 2800000, guid: 279657edc397ece4b8029c727adf6ddc, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ColorSwapTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DistortTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _FadeBurnTex: + m_Texture: {fileID: 2800000, guid: 32e8df0008bebe746b1681a71c61f31c, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _FadeTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _GlowTex: + 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} + - _OutlineDistortTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OutlineTex: + m_Texture: {fileID: 2800000, guid: 74087f6d03f233e4a8a142fa01f9e5cf, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ShineMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - _Alpha: 1 + - _AlphaCutoffValue: 0.25 + - _AlphaRoundThreshold: 0.5 + - _BillboardY: 0 + - _BlurHD: 0 + - _BlurIntensity: 10 + - _ChromAberrAlpha: 0.4 + - _ChromAberrAmount: 1 + - _ClipUvDown: 1 + - _ClipUvLeft: 1 + - _ClipUvRight: 1 + - _ClipUvUp: 1 + - _ColorChangeLuminosity: 0 + - _ColorChangeTolerance: 0.25 + - _ColorRampLuminosity: 0 + - _ColorRampOutline: 0 + - _ColorSwapBlueLuminosity: 0.5 + - _ColorSwapGreenLuminosity: 0.5 + - _ColorSwapRedLuminosity: 0.5 + - _DistortAmount: 0.5 + - _DistortTexXSpeed: 5 + - _DistortTexYSpeed: 5 + - _FadeAmount: -0.1 + - _FadeBurnGlow: 2 + - _FadeBurnTransition: 0.075 + - _FadeBurnWidth: 0.025 + - _FishEyeUvAmount: 0.35 + - _FlickerAlpha: 0 + - _FlickerFreq: 0.2 + - _FlickerPercent: 0.05 + - _GhostColorBoost: 1 + - _GhostTransparency: 0 + - _GlitchAmount: 3 + - _GlitchSize: 1 + - _Glow: 10 + - _GlowTexUsed: 0 + - _GradBlend: 1 + - _GradBoostX: 1.2 + - _GradBoostY: 1.2 + - _GradIsRadial: 0 + - _GrassManualAnim: 1 + - _GrassManualToggle: 0 + - _GrassRadialBend: 0.1 + - _GrassSpeed: 8 + - _GrassWind: 20 + - _GreyscaleLuminosity: 0 + - _GreyscaleOutline: 0 + - _HandDrawnAmount: 10 + - _HandDrawnSpeed: 5 + - _HitEffectBlend: 1 + - _HitEffectGlow: 5 + - _HologramFlickerAlpha: 0 + - _HologramFlickerFreq: 0.2 + - _HologramFlickerPercent: 0.05 + - _HologramMaxAlpha: 1 + - _HologramMinAlpha: 0 + - _HologramStripesAlpha: 0.4 + - _HologramStripesAmount: 50 + - _HologramStripesFill: 0.4 + - _HologramStripesLuminosity: 1 + - _HologramStripesSpeed: 5 + - _HologramUnmodAmount: 0.4 + - _HsvBright: 1 + - _HsvSaturation: 1 + - _HsvShift: 180 + - _InnerOutlineAlpha: 1 + - _InnerOutlineGlow: 1 + - _InnerOutlineThickness: 1 + - _MaxXUV: 1 + - _MaxYUV: 1 + - _MinXUV: 0 + - _MinYUV: 0 + - _MotionBlurAngle: 0.1 + - _MotionBlurDist: 1.25 + - _MyDstMode: 10 + - _MySrcMode: 5 + - _NegativeAmount: 1 + - _OffsetUvX: 0 + - _OffsetUvY: 0 + - _OnlyInnerOutline: 0 + - _OnlyOutline: 0 + - _Outline8Directions: 1 + - _OutlineAlpha: 1 + - _OutlineDistortAmount: 0.5 + - _OutlineDistortTexXSpeed: 5 + - _OutlineDistortTexYSpeed: 5 + - _OutlineDistortToggle: 0 + - _OutlineGlow: 1.5 + - _OutlineIsPixel: 0 + - _OutlinePixelWidth: 1 + - _OutlineTexGrey: 0 + - _OutlineTexToggle: 0 + - _OutlineTexXSpeed: 10 + - _OutlineTexYSpeed: 0 + - _OutlineWidth: 0.0159 + - _PinchUvAmount: 0.35 + - _PixelateSize: 32 + - _PosterizeGamma: 0.75 + - _PosterizeNumColors: 8 + - _PosterizeOutline: 0 + - _RandomSeed: 0 + - _RectSize: 1 + - _RotateUvAmount: 0 + - _RoundWaveSpeed: 2 + - _RoundWaveStrength: 0.7 + - _ShadowAlpha: 0.5 + - _ShadowX: 0.1 + - _ShadowY: -0.05 + - _ShakeUvSpeed: 2.5 + - _ShakeUvX: 1.5 + - _ShakeUvY: 1 + - _ShineGlow: 1 + - _ShineLocation: 0.5 + - _ShineRotate: 0 + - _ShineWidth: 0.1 + - _TextureScrollXSpeed: 1 + - _TextureScrollYSpeed: 0 + - _TwistUvAmount: 1 + - _TwistUvPosX: 0.5 + - _TwistUvPosY: 0.5 + - _TwistUvRadius: 0.75 + - _WaveAmount: 7 + - _WaveSpeed: 10 + - _WaveStrength: 7.5 + - _WaveX: 0 + - _WaveY: 0.5 + - _ZTestMode: 4 + - _ZWrite: 0 + - _ZoomUvAmount: 0.5 + m_Colors: + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _ColorChangeNewCol: {r: 1, g: 1, b: 0, a: 1} + - _ColorChangeTarget: {r: 1, g: 0, b: 0, a: 1} + - _ColorSwapBlue: {r: 1, g: 1, b: 1, a: 1} + - _ColorSwapGreen: {r: 1, g: 1, b: 1, a: 1} + - _ColorSwapRed: {r: 1, g: 1, b: 1, a: 1} + - _FadeBurnColor: {r: 1, g: 1, b: 0, a: 1} + - _GlowColor: {r: 1, g: 1, b: 1, a: 1} + - _GradBotLeftCol: {r: 0, g: 0, b: 1, a: 1} + - _GradBotRightCol: {r: 0, g: 0, b: 1, a: 1} + - _GradTopLeftCol: {r: 1, g: 0, b: 0, a: 1} + - _GradTopRightCol: {r: 1, g: 0, b: 0, a: 1} + - _GreyscaleTintColor: {r: 0, g: 0.745283, b: 0.044833504, a: 1} + - _HitEffectColor: {r: 1, g: 1, b: 1, a: 1} + - _HologramStripeColor: {r: 1, g: 1, b: 1, a: 1} + - _InnerOutlineColor: {r: 1, g: 0, b: 0, a: 1} + - _OutlineColor: {r: 1, g: 1, b: 1, a: 1} + - _ShadowColor: {r: 0, g: 0, b: 0, a: 1} + - _ShineColor: {r: 1, g: 1, b: 1, a: 1} +--- !u!1 &1875180450 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1875180451} + - component: {fileID: 1875180455} + - component: {fileID: 1875180454} + - component: {fileID: 1875180453} + m_Layer: 0 + m_Name: Teleport + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1875180451 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1875180450} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: -5.4899993, y: -0.19999897, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 298946312} + m_RootOrder: 21 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &1875180453 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1875180450} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: ee158225ee1e59f4791627785501d950, type: 3} + m_Name: + m_EditorClassIdentifier: + shaderTypes: 4 + normalStrenght: 5 + normalSmoothing: 1 + computingNormal: 0 +--- !u!114 &1875180454 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1875180450} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 98b644315d7a92842b89e04f55c48e02, type: 3} + m_Name: + m_EditorClassIdentifier: +--- !u!212 &1875180455 +SpriteRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1875180450} + m_Enabled: 1 + m_CastShadows: 0 + m_ReceiveShadows: 0 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 423033871} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 0 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_Sprite: {fileID: 21300000, guid: 519dafacd208bb64c83d5124be03b09d, type: 3} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_FlipX: 0 + m_FlipY: 0 + m_DrawMode: 0 + m_Size: {x: 5.12, y: 5.12} + m_AdaptiveModeThreshold: 0.5 + m_SpriteTileMode: 0 + m_WasSpriteAssigned: 1 + m_MaskInteraction: 0 + m_SpriteSortPoint: 0 +--- !u!21 &1889875392 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: AllIn1SpriteShader/AllIn1SpriteShader + m_Shader: {fileID: 4800000, guid: a36b7719ff0465b42ab1407d67672c5f, type: 3} + m_ShaderKeywords: ETC1_EXTERNAL_ALPHA NEGATIVE_ON SHAKEUV_ON + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _ColorRampTex: + m_Texture: {fileID: 2800000, guid: 279657edc397ece4b8029c727adf6ddc, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ColorSwapTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DistortTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _FadeBurnTex: + m_Texture: {fileID: 2800000, guid: 32e8df0008bebe746b1681a71c61f31c, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _FadeTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _GlowTex: + 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} + - _OutlineDistortTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OutlineTex: + m_Texture: {fileID: 2800000, guid: 74087f6d03f233e4a8a142fa01f9e5cf, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ShineMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - _Alpha: 1 + - _AlphaCutoffValue: 0.25 + - _AlphaRoundThreshold: 0.5 + - _BillboardY: 0 + - _BlurHD: 0 + - _BlurIntensity: 10 + - _ChromAberrAlpha: 0.4 + - _ChromAberrAmount: 1 + - _ClipUvDown: 1 + - _ClipUvLeft: 1 + - _ClipUvRight: 1 + - _ClipUvUp: 1 + - _ColorChangeLuminosity: 0 + - _ColorChangeTolerance: 0.25 + - _ColorRampLuminosity: 0 + - _ColorRampOutline: 0 + - _ColorSwapBlueLuminosity: 0.5 + - _ColorSwapGreenLuminosity: 0.5 + - _ColorSwapRedLuminosity: 0.5 + - _DistortAmount: 0.5 + - _DistortTexXSpeed: 5 + - _DistortTexYSpeed: 5 + - _FadeAmount: -0.1 + - _FadeBurnGlow: 2 + - _FadeBurnTransition: 0.075 + - _FadeBurnWidth: 0.025 + - _FishEyeUvAmount: 0.35 + - _FlickerAlpha: 0 + - _FlickerFreq: 0.2 + - _FlickerPercent: 0.05 + - _GhostColorBoost: 1 + - _GhostTransparency: 0 + - _GlitchAmount: 3 + - _GlitchSize: 1 + - _Glow: 10 + - _GlowTexUsed: 0 + - _GradBlend: 1 + - _GradBoostX: 1.2 + - _GradBoostY: 1.2 + - _GradIsRadial: 0 + - _GrassManualAnim: 1 + - _GrassManualToggle: 0 + - _GrassRadialBend: 0.1 + - _GrassSpeed: 2 + - _GrassWind: 20 + - _GreyscaleLuminosity: 0 + - _GreyscaleOutline: 0 + - _HandDrawnAmount: 10 + - _HandDrawnSpeed: 5 + - _HitEffectBlend: 1 + - _HitEffectGlow: 5 + - _HologramFlickerAlpha: 0 + - _HologramFlickerFreq: 0.2 + - _HologramFlickerPercent: 0.05 + - _HologramMaxAlpha: 1 + - _HologramMinAlpha: 0 + - _HologramStripesAlpha: 0.4 + - _HologramStripesAmount: 50 + - _HologramStripesFill: 0.4 + - _HologramStripesLuminosity: 1 + - _HologramStripesSpeed: 5 + - _HologramUnmodAmount: 0.4 + - _HsvBright: 1 + - _HsvSaturation: 1 + - _HsvShift: 180 + - _InnerOutlineAlpha: 1 + - _InnerOutlineGlow: 1 + - _InnerOutlineThickness: 1 + - _MaxXUV: 1 + - _MaxYUV: 1 + - _MinXUV: 0 + - _MinYUV: 0 + - _MotionBlurAngle: 0.1 + - _MotionBlurDist: 1.25 + - _MyDstMode: 10 + - _MySrcMode: 5 + - _NegativeAmount: 1 + - _OffsetUvX: 0 + - _OffsetUvY: 0 + - _OnlyInnerOutline: 0 + - _OnlyOutline: 0 + - _Outline8Directions: 0 + - _OutlineAlpha: 1 + - _OutlineDistortAmount: 0.5 + - _OutlineDistortTexXSpeed: 5 + - _OutlineDistortTexYSpeed: 5 + - _OutlineDistortToggle: 0 + - _OutlineGlow: 1.5 + - _OutlineIsPixel: 0 + - _OutlinePixelWidth: 1 + - _OutlineTexGrey: 0 + - _OutlineTexToggle: 0 + - _OutlineTexXSpeed: 10 + - _OutlineTexYSpeed: 0 + - _OutlineWidth: 0.004 + - _PinchUvAmount: 0.35 + - _PixelateSize: 32 + - _PosterizeGamma: 0.75 + - _PosterizeNumColors: 8 + - _PosterizeOutline: 0 + - _RandomSeed: 0 + - _RectSize: 1 + - _RotateUvAmount: 0 + - _RoundWaveSpeed: 2 + - _RoundWaveStrength: 0.7 + - _ShadowAlpha: 0.5 + - _ShadowX: 0.1 + - _ShadowY: -0.05 + - _ShakeUvSpeed: 1.5 + - _ShakeUvX: 1.5 + - _ShakeUvY: 1 + - _ShineGlow: 1 + - _ShineLocation: 0.5 + - _ShineRotate: 0 + - _ShineWidth: 0.1 + - _TextureScrollXSpeed: 1 + - _TextureScrollYSpeed: 0 + - _TwistUvAmount: 1 + - _TwistUvPosX: 0.5 + - _TwistUvPosY: 0.5 + - _TwistUvRadius: 0.75 + - _WaveAmount: 7 + - _WaveSpeed: 10 + - _WaveStrength: 7.5 + - _WaveX: 0 + - _WaveY: 0.5 + - _ZTestMode: 4 + - _ZWrite: 0 + - _ZoomUvAmount: 0.5 + m_Colors: + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _ColorChangeNewCol: {r: 1, g: 1, b: 0, a: 1} + - _ColorChangeTarget: {r: 1, g: 0, b: 0, a: 1} + - _ColorSwapBlue: {r: 1, g: 1, b: 1, a: 1} + - _ColorSwapGreen: {r: 1, g: 1, b: 1, a: 1} + - _ColorSwapRed: {r: 1, g: 1, b: 1, a: 1} + - _FadeBurnColor: {r: 1, g: 1, b: 0, a: 1} + - _GlowColor: {r: 1, g: 1, b: 1, a: 1} + - _GradBotLeftCol: {r: 0, g: 0, b: 1, a: 1} + - _GradBotRightCol: {r: 0, g: 0, b: 1, a: 1} + - _GradTopLeftCol: {r: 1, g: 0, b: 0, a: 1} + - _GradTopRightCol: {r: 1, g: 0, b: 0, a: 1} + - _GreyscaleTintColor: {r: 1, g: 1, b: 1, a: 1} + - _HitEffectColor: {r: 1, g: 1, b: 1, a: 1} + - _HologramStripeColor: {r: 1, g: 1, b: 1, a: 1} + - _InnerOutlineColor: {r: 1, g: 0, b: 0, a: 1} + - _OutlineColor: {r: 1, g: 1, b: 1, a: 1} + - _ShadowColor: {r: 0, g: 0, b: 0, a: 1} + - _ShineColor: {r: 1, g: 1, b: 1, a: 1} +--- !u!21 &1899749361 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: AllIn1SpriteShader/AllIn1SpriteShader + m_Shader: {fileID: 4800000, guid: a36b7719ff0465b42ab1407d67672c5f, type: 3} + m_ShaderKeywords: ETC1_EXTERNAL_ALPHA GRADIENT_ON SHADOW_ON + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _ColorRampTex: + m_Texture: {fileID: 2800000, guid: 279657edc397ece4b8029c727adf6ddc, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ColorSwapTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DistortTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _FadeBurnTex: + m_Texture: {fileID: 2800000, guid: 32e8df0008bebe746b1681a71c61f31c, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _FadeTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _GlowTex: + 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} + - _OutlineDistortTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OutlineTex: + m_Texture: {fileID: 2800000, guid: 74087f6d03f233e4a8a142fa01f9e5cf, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ShineMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - _Alpha: 1 + - _AlphaCutoffValue: 0.25 + - _AlphaRoundThreshold: 0.5 + - _BillboardY: 0 + - _BlurHD: 0 + - _BlurIntensity: 10 + - _ChromAberrAlpha: 0.4 + - _ChromAberrAmount: 1 + - _ClipUvDown: 1 + - _ClipUvLeft: 1 + - _ClipUvRight: 1 + - _ClipUvUp: 1 + - _ColorChangeLuminosity: 0 + - _ColorChangeTolerance: 0.25 + - _ColorRampLuminosity: 0 + - _ColorRampOutline: 0 + - _ColorSwapBlueLuminosity: 0.5 + - _ColorSwapGreenLuminosity: 0.5 + - _ColorSwapRedLuminosity: 0.5 + - _DistortAmount: 0.5 + - _DistortTexXSpeed: 5 + - _DistortTexYSpeed: 5 + - _FadeAmount: -0.1 + - _FadeBurnGlow: 2 + - _FadeBurnTransition: 0.075 + - _FadeBurnWidth: 0.025 + - _FishEyeUvAmount: 0.35 + - _FlickerAlpha: 0 + - _FlickerFreq: 0.2 + - _FlickerPercent: 0.05 + - _GhostColorBoost: 1 + - _GhostTransparency: 0 + - _GlitchAmount: 3 + - _GlitchSize: 1 + - _Glow: 10 + - _GlowTexUsed: 0 + - _GradBlend: 0.858 + - _GradBoostX: 1.2 + - _GradBoostY: 1.2 + - _GradIsRadial: 0 + - _GrassManualAnim: 1 + - _GrassManualToggle: 0 + - _GrassRadialBend: 0.1 + - _GrassSpeed: 2 + - _GrassWind: 20 + - _GreyscaleLuminosity: 0 + - _GreyscaleOutline: 0 + - _HandDrawnAmount: 10 + - _HandDrawnSpeed: 5 + - _HitEffectBlend: 1 + - _HitEffectGlow: 5 + - _HologramFlickerAlpha: 0 + - _HologramFlickerFreq: 0.2 + - _HologramFlickerPercent: 0.05 + - _HologramMaxAlpha: 1 + - _HologramMinAlpha: 0 + - _HologramStripesAlpha: 0.4 + - _HologramStripesAmount: 50 + - _HologramStripesFill: 0.4 + - _HologramStripesLuminosity: 1 + - _HologramStripesSpeed: 5 + - _HologramUnmodAmount: 0.4 + - _HsvBright: 1 + - _HsvSaturation: 1 + - _HsvShift: 180 + - _InnerOutlineAlpha: 1 + - _InnerOutlineGlow: 1 + - _InnerOutlineThickness: 1 + - _MaxXUV: 1 + - _MaxYUV: 1 + - _MinXUV: 0 + - _MinYUV: 0 + - _MotionBlurAngle: 0.1 + - _MotionBlurDist: 1.25 + - _MyDstMode: 10 + - _MySrcMode: 5 + - _NegativeAmount: 1 + - _OffsetUvX: 0 + - _OffsetUvY: 0 + - _OnlyInnerOutline: 0 + - _OnlyOutline: 0 + - _Outline8Directions: 0 + - _OutlineAlpha: 1 + - _OutlineDistortAmount: 0.5 + - _OutlineDistortTexXSpeed: 5 + - _OutlineDistortTexYSpeed: 5 + - _OutlineDistortToggle: 0 + - _OutlineGlow: 1.5 + - _OutlineIsPixel: 0 + - _OutlinePixelWidth: 1 + - _OutlineTexGrey: 0 + - _OutlineTexToggle: 0 + - _OutlineTexXSpeed: 10 + - _OutlineTexYSpeed: 0 + - _OutlineWidth: 0.004 + - _PinchUvAmount: 0.35 + - _PixelateSize: 32 + - _PosterizeGamma: 0.75 + - _PosterizeNumColors: 8 + - _PosterizeOutline: 0 + - _RandomSeed: 0 + - _RectSize: 1 + - _RotateUvAmount: 0 + - _RoundWaveSpeed: 2 + - _RoundWaveStrength: 0.7 + - _ShadowAlpha: 0.5 + - _ShadowX: 0.155 + - _ShadowY: -0.081 + - _ShakeUvSpeed: 2.5 + - _ShakeUvX: 1.5 + - _ShakeUvY: 1 + - _ShineGlow: 1 + - _ShineLocation: 0.5 + - _ShineRotate: 0 + - _ShineWidth: 0.1 + - _TextureScrollXSpeed: 1 + - _TextureScrollYSpeed: 0 + - _TwistUvAmount: 1 + - _TwistUvPosX: 0.5 + - _TwistUvPosY: 0.5 + - _TwistUvRadius: 0.75 + - _WaveAmount: 7 + - _WaveSpeed: 10 + - _WaveStrength: 7.5 + - _WaveX: 0 + - _WaveY: 0.5 + - _ZTestMode: 4 + - _ZWrite: 0 + - _ZoomUvAmount: 0.5 + m_Colors: + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _ColorChangeNewCol: {r: 1, g: 1, b: 0, a: 1} + - _ColorChangeTarget: {r: 1, g: 0, b: 0, a: 1} + - _ColorSwapBlue: {r: 1, g: 1, b: 1, a: 1} + - _ColorSwapGreen: {r: 1, g: 1, b: 1, a: 1} + - _ColorSwapRed: {r: 1, g: 1, b: 1, a: 1} + - _FadeBurnColor: {r: 1, g: 1, b: 0, a: 1} + - _GlowColor: {r: 1, g: 1, b: 1, a: 1} + - _GradBotLeftCol: {r: 0, g: 0, b: 1, a: 1} + - _GradBotRightCol: {r: 0, g: 0, b: 1, a: 1} + - _GradTopLeftCol: {r: 1, g: 0, b: 0, a: 1} + - _GradTopRightCol: {r: 1, g: 0, b: 0, a: 1} + - _GreyscaleTintColor: {r: 1, g: 1, b: 1, a: 1} + - _HitEffectColor: {r: 1, g: 1, b: 1, a: 1} + - _HologramStripeColor: {r: 1, g: 1, b: 1, a: 1} + - _InnerOutlineColor: {r: 1, g: 0, b: 0, a: 1} + - _OutlineColor: {r: 1, g: 1, b: 1, a: 1} + - _ShadowColor: {r: 0, g: 0, b: 0, a: 1} + - _ShineColor: {r: 1, g: 1, b: 1, a: 1} +--- !u!1 &1927382520 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1927382521} + - component: {fileID: 1927382525} + - component: {fileID: 1927382524} + - component: {fileID: 1927382523} + m_Layer: 0 + m_Name: Toxic + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1927382521 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1927382520} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 9.689999, y: -5.1999993, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 298946312} + m_RootOrder: 26 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &1927382523 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1927382520} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: ee158225ee1e59f4791627785501d950, type: 3} + m_Name: + m_EditorClassIdentifier: + shaderTypes: 4 + normalStrenght: 5 + normalSmoothing: 1 + computingNormal: 0 +--- !u!114 &1927382524 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1927382520} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 98b644315d7a92842b89e04f55c48e02, type: 3} + m_Name: + m_EditorClassIdentifier: +--- !u!212 &1927382525 +SpriteRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1927382520} + m_Enabled: 1 + m_CastShadows: 0 + m_ReceiveShadows: 0 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 707407687} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 0 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_Sprite: {fileID: 21300000, guid: 519dafacd208bb64c83d5124be03b09d, type: 3} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_FlipX: 0 + m_FlipY: 0 + m_DrawMode: 0 + m_Size: {x: 5.12, y: 5.12} + m_AdaptiveModeThreshold: 0.5 + m_SpriteTileMode: 0 + m_WasSpriteAssigned: 1 + m_MaskInteraction: 0 + m_SpriteSortPoint: 0 +--- !u!1 &1931308734 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1931308735} + - component: {fileID: 1931308737} + - component: {fileID: 1931308738} + - component: {fileID: 1931308736} + m_Layer: 0 + m_Name: Color Swap + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1931308735 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1931308734} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: -20.49, y: 4.8000007, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 298946312} + m_RootOrder: 6 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &1931308736 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1931308734} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: ee158225ee1e59f4791627785501d950, type: 3} + m_Name: + m_EditorClassIdentifier: + shaderTypes: 4 + normalStrenght: 5 + normalSmoothing: 1 + computingNormal: 0 +--- !u!212 &1931308737 +SpriteRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1931308734} + m_Enabled: 1 + m_CastShadows: 0 + m_ReceiveShadows: 0 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 967204686} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 0 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_Sprite: {fileID: 21300000, guid: 519dafacd208bb64c83d5124be03b09d, type: 3} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_FlipX: 0 + m_FlipY: 0 + m_DrawMode: 0 + m_Size: {x: 5.12, y: 5.12} + m_AdaptiveModeThreshold: 0.5 + m_SpriteTileMode: 0 + m_WasSpriteAssigned: 1 + m_MaskInteraction: 0 + m_SpriteSortPoint: 0 +--- !u!114 &1931308738 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1931308734} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 98b644315d7a92842b89e04f55c48e02, type: 3} + m_Name: + m_EditorClassIdentifier: +--- !u!1 &1934762263 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1934762264} + - component: {fileID: 1934762267} + - component: {fileID: 1934762266} + - component: {fileID: 1934762265} + m_Layer: 0 + m_Name: Burn + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1934762264 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1934762263} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: -5.7000003, y: -5.1999993, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 298946312} + m_RootOrder: 17 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &1934762265 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1934762263} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: ee158225ee1e59f4791627785501d950, type: 3} + m_Name: + m_EditorClassIdentifier: + shaderTypes: 4 + normalStrenght: 5 + normalSmoothing: 1 + computingNormal: 0 +--- !u!114 &1934762266 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1934762263} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 98b644315d7a92842b89e04f55c48e02, type: 3} + m_Name: + m_EditorClassIdentifier: +--- !u!212 &1934762267 +SpriteRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1934762263} + m_Enabled: 1 + m_CastShadows: 0 + m_ReceiveShadows: 0 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2144125442} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 0 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_Sprite: {fileID: 21300000, guid: 519dafacd208bb64c83d5124be03b09d, type: 3} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_FlipX: 0 + m_FlipY: 0 + m_DrawMode: 0 + m_Size: {x: 5.12, y: 5.12} + m_AdaptiveModeThreshold: 0.5 + m_SpriteTileMode: 0 + m_WasSpriteAssigned: 1 + m_MaskInteraction: 0 + m_SpriteSortPoint: 0 +--- !u!1 &1988936577 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1988936578} + - component: {fileID: 1988936580} + - component: {fileID: 1988936581} + - component: {fileID: 1988936579} + m_Layer: 0 + m_Name: Color Ramp + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1988936578 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1988936577} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: -10.49, y: 4.8000007, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 298946312} + m_RootOrder: 10 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &1988936579 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1988936577} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: ee158225ee1e59f4791627785501d950, type: 3} + m_Name: + m_EditorClassIdentifier: + shaderTypes: 0 + normalStrenght: 5 + normalSmoothing: 1 + computingNormal: 0 +--- !u!212 &1988936580 +SpriteRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1988936577} + m_Enabled: 1 + m_CastShadows: 0 + m_ReceiveShadows: 0 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 1789615841} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 0 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_Sprite: {fileID: 21300000, guid: 519dafacd208bb64c83d5124be03b09d, type: 3} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_FlipX: 0 + m_FlipY: 0 + m_DrawMode: 0 + m_Size: {x: 5.12, y: 5.12} + m_AdaptiveModeThreshold: 0.5 + m_SpriteTileMode: 0 + m_WasSpriteAssigned: 1 + m_MaskInteraction: 0 + m_SpriteSortPoint: 0 +--- !u!114 &1988936581 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1988936577} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 98b644315d7a92842b89e04f55c48e02, type: 3} + m_Name: + m_EditorClassIdentifier: +--- !u!1 &2008890716 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 2008890717} + - component: {fileID: 2008890719} + - component: {fileID: 2008890718} + m_Layer: 5 + m_Name: SceneDescription + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &2008890717 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2008890716} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 564363701} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0.5, y: 0.5} + m_AnchorMax: {x: 0.5, y: 0.5} + m_AnchoredPosition: {x: 0, y: -400} + m_SizeDelta: {x: 1433.1, y: 111.5} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &2008890718 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2008890716} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 708705254, guid: f70555f144d8491a825f0804e09c671c, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_FontData: + m_Font: {fileID: 12800000, guid: a4e6a5491519adb45919dc87eff28e55, type: 3} + m_FontSize: 98 + m_FontStyle: 0 + m_BestFit: 0 + m_MinSize: 10 + m_MaxSize: 225 + m_Alignment: 4 + m_AlignByGeometry: 0 + m_RichText: 1 + m_HorizontalOverflow: 0 + m_VerticalOverflow: 1 + m_LineSpacing: 1 + m_Text: Effects will automatically scroll when in playmode +--- !u!222 &2008890719 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2008890716} + m_CullTransparentMesh: 0 +--- !u!21 &2033235221 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: AllIn1SpriteShader/AllIn1SpriteShader + m_Shader: {fileID: 4800000, guid: a36b7719ff0465b42ab1407d67672c5f, type: 3} + m_ShaderKeywords: ETC1_EXTERNAL_ALPHA HITEFFECT_ON + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _ColorRampTex: + m_Texture: {fileID: 2800000, guid: 279657edc397ece4b8029c727adf6ddc, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ColorSwapTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DistortTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _FadeBurnTex: + m_Texture: {fileID: 2800000, guid: 32e8df0008bebe746b1681a71c61f31c, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _FadeTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _GlowTex: + 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} + - _OutlineDistortTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OutlineTex: + m_Texture: {fileID: 2800000, guid: 74087f6d03f233e4a8a142fa01f9e5cf, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ShineMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - _Alpha: 1 + - _AlphaCutoffValue: 0.25 + - _AlphaRoundThreshold: 0.5 + - _BillboardY: 0 + - _BlurHD: 0 + - _BlurIntensity: 10 + - _ChromAberrAlpha: 0.4 + - _ChromAberrAmount: 1 + - _ClipUvDown: 1 + - _ClipUvLeft: 1 + - _ClipUvRight: 1 + - _ClipUvUp: 1 + - _ColorChangeLuminosity: 0 + - _ColorChangeTolerance: 0.25 + - _ColorRampLuminosity: 0 + - _ColorRampOutline: 0 + - _ColorSwapBlueLuminosity: 0.5 + - _ColorSwapGreenLuminosity: 0.5 + - _ColorSwapRedLuminosity: 0.5 + - _DistortAmount: 0.5 + - _DistortTexXSpeed: 5 + - _DistortTexYSpeed: 5 + - _FadeAmount: -0.1 + - _FadeBurnGlow: 2 + - _FadeBurnTransition: 0.075 + - _FadeBurnWidth: 0.025 + - _FishEyeUvAmount: 0.35 + - _FlickerAlpha: 0 + - _FlickerFreq: 0.2 + - _FlickerPercent: 0.05 + - _GhostColorBoost: 1 + - _GhostTransparency: 0 + - _GlitchAmount: 3 + - _GlitchSize: 1 + - _Glow: 10 + - _GlowTexUsed: 0 + - _GradBlend: 1 + - _GradBoostX: 1.2 + - _GradBoostY: 1.2 + - _GradIsRadial: 0 + - _GrassManualAnim: 1 + - _GrassManualToggle: 0 + - _GrassRadialBend: 0.1 + - _GrassSpeed: 2 + - _GrassWind: 20 + - _GreyscaleLuminosity: 0 + - _GreyscaleOutline: 0 + - _HandDrawnAmount: 10 + - _HandDrawnSpeed: 5 + - _HitEffectBlend: 0.379 + - _HitEffectGlow: 11 + - _HologramFlickerAlpha: 0 + - _HologramFlickerFreq: 0.2 + - _HologramFlickerPercent: 0.05 + - _HologramMaxAlpha: 1 + - _HologramMinAlpha: 0 + - _HologramStripesAlpha: 0.4 + - _HologramStripesAmount: 50 + - _HologramStripesFill: 0.4 + - _HologramStripesLuminosity: 1 + - _HologramStripesSpeed: 5 + - _HologramUnmodAmount: 0.4 + - _HsvBright: 1 + - _HsvSaturation: 1 + - _HsvShift: 180 + - _InnerOutlineAlpha: 1 + - _InnerOutlineGlow: 1 + - _InnerOutlineThickness: 1 + - _MaxXUV: 1 + - _MaxYUV: 1 + - _MinXUV: 0 + - _MinYUV: 0 + - _MotionBlurAngle: 0.1 + - _MotionBlurDist: 1.25 + - _MyDstMode: 10 + - _MySrcMode: 5 + - _NegativeAmount: 1 + - _OffsetUvX: 0 + - _OffsetUvY: 0 + - _OnlyInnerOutline: 0 + - _OnlyOutline: 0 + - _Outline8Directions: 0 + - _OutlineAlpha: 1 + - _OutlineDistortAmount: 0.5 + - _OutlineDistortTexXSpeed: 5 + - _OutlineDistortTexYSpeed: 5 + - _OutlineDistortToggle: 0 + - _OutlineGlow: 1.5 + - _OutlineIsPixel: 0 + - _OutlinePixelWidth: 1 + - _OutlineTexGrey: 0 + - _OutlineTexToggle: 0 + - _OutlineTexXSpeed: 10 + - _OutlineTexYSpeed: 0 + - _OutlineWidth: 0.004 + - _PinchUvAmount: 0.35 + - _PixelateSize: 32 + - _PosterizeGamma: 0.75 + - _PosterizeNumColors: 8 + - _PosterizeOutline: 0 + - _RandomSeed: 0 + - _RectSize: 1 + - _RotateUvAmount: 0 + - _RoundWaveSpeed: 2 + - _RoundWaveStrength: 0.7 + - _ShadowAlpha: 0.5 + - _ShadowX: 0.1 + - _ShadowY: -0.05 + - _ShakeUvSpeed: 2.5 + - _ShakeUvX: 1.5 + - _ShakeUvY: 1 + - _ShineGlow: 1 + - _ShineLocation: 0.5 + - _ShineRotate: 0 + - _ShineWidth: 0.1 + - _TextureScrollXSpeed: 1 + - _TextureScrollYSpeed: 0 + - _TwistUvAmount: 1 + - _TwistUvPosX: 0.5 + - _TwistUvPosY: 0.5 + - _TwistUvRadius: 0.75 + - _WaveAmount: 7 + - _WaveSpeed: 10 + - _WaveStrength: 7.5 + - _WaveX: 0 + - _WaveY: 0.5 + - _ZTestMode: 4 + - _ZWrite: 0 + - _ZoomUvAmount: 0.5 + m_Colors: + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _ColorChangeNewCol: {r: 1, g: 1, b: 0, a: 1} + - _ColorChangeTarget: {r: 1, g: 0, b: 0, a: 1} + - _ColorSwapBlue: {r: 1, g: 1, b: 1, a: 1} + - _ColorSwapGreen: {r: 1, g: 1, b: 1, a: 1} + - _ColorSwapRed: {r: 1, g: 1, b: 1, a: 1} + - _FadeBurnColor: {r: 1, g: 1, b: 0, a: 1} + - _GlowColor: {r: 1, g: 1, b: 1, a: 1} + - _GradBotLeftCol: {r: 0, g: 0, b: 1, a: 1} + - _GradBotRightCol: {r: 0, g: 0, b: 1, a: 1} + - _GradTopLeftCol: {r: 1, g: 0, b: 0, a: 1} + - _GradTopRightCol: {r: 1, g: 0, b: 0, a: 1} + - _GreyscaleTintColor: {r: 1, g: 1, b: 1, a: 1} + - _HitEffectColor: {r: 0, g: 0.7054799, b: 0.8207547, a: 1} + - _HologramStripeColor: {r: 1, g: 1, b: 1, a: 1} + - _InnerOutlineColor: {r: 1, g: 0, b: 0, a: 1} + - _OutlineColor: {r: 1, g: 1, b: 1, a: 1} + - _ShadowColor: {r: 0, g: 0, b: 0, a: 1} + - _ShineColor: {r: 1, g: 1, b: 1, a: 1} +--- !u!1 &2045252511 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 2045252512} + - component: {fileID: 2045252515} + - component: {fileID: 2045252514} + - component: {fileID: 2045252513} + m_Layer: 0 + m_Name: Hologram + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &2045252512 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2045252511} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 14.51, y: 4.8000007, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 298946312} + m_RootOrder: 14 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &2045252513 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2045252511} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: ee158225ee1e59f4791627785501d950, type: 3} + m_Name: + m_EditorClassIdentifier: + shaderTypes: 0 + normalStrenght: 5 + normalSmoothing: 1 + computingNormal: 0 +--- !u!114 &2045252514 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2045252511} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 98b644315d7a92842b89e04f55c48e02, type: 3} + m_Name: + m_EditorClassIdentifier: +--- !u!212 &2045252515 +SpriteRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2045252511} + m_Enabled: 1 + m_CastShadows: 0 + m_ReceiveShadows: 0 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 1433877713} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 0 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_Sprite: {fileID: 21300000, guid: 519dafacd208bb64c83d5124be03b09d, type: 3} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_FlipX: 0 + m_FlipY: 0 + m_DrawMode: 0 + m_Size: {x: 5.12, y: 5.12} + m_AdaptiveModeThreshold: 0.5 + m_SpriteTileMode: 0 + m_WasSpriteAssigned: 1 + m_MaskInteraction: 0 + m_SpriteSortPoint: 0 +--- !u!21 &2144125442 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: AllIn1SpriteShader/AllIn1SpriteShader + m_Shader: {fileID: 4800000, guid: a36b7719ff0465b42ab1407d67672c5f, type: 3} + m_ShaderKeywords: ETC1_EXTERNAL_ALPHA FADE_ON GLOWTEX_ON HITEFFECT_ON _GLOWTEXUSED_ON + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _ColorRampTex: + m_Texture: {fileID: 2800000, guid: 279657edc397ece4b8029c727adf6ddc, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ColorSwapTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DistortTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _FadeBurnTex: + m_Texture: {fileID: 2800000, guid: 32e8df0008bebe746b1681a71c61f31c, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _FadeTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 0.5, y: 0.5} + m_Offset: {x: 0, y: 0} + - _GlowTex: + m_Texture: {fileID: 2800000, guid: 8608ef90f91271745a17f7210fe1e7db, type: 3} + 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} + - _OutlineDistortTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OutlineTex: + m_Texture: {fileID: 2800000, guid: 74087f6d03f233e4a8a142fa01f9e5cf, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ShineMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - _Alpha: 1 + - _AlphaCutoffValue: 0.25 + - _AlphaRoundThreshold: 0.5 + - _BillboardY: 0 + - _BlurHD: 0 + - _BlurIntensity: 10 + - _ChromAberrAlpha: 0.4 + - _ChromAberrAmount: 1 + - _ClipUvDown: 1 + - _ClipUvLeft: 1 + - _ClipUvRight: 1 + - _ClipUvUp: 1 + - _ColorChangeLuminosity: 0 + - _ColorChangeTolerance: 0.25 + - _ColorRampLuminosity: 0 + - _ColorRampOutline: 0 + - _ColorSwapBlueLuminosity: 0.5 + - _ColorSwapGreenLuminosity: 0.5 + - _ColorSwapRedLuminosity: 0.5 + - _DistortAmount: 0.5 + - _DistortTexXSpeed: 5 + - _DistortTexYSpeed: 5 + - _FadeAmount: 0.415 + - _FadeBurnGlow: 15 + - _FadeBurnTransition: 0.105 + - _FadeBurnWidth: 0.026 + - _FishEyeUvAmount: 0.35 + - _FlickerAlpha: 0 + - _FlickerFreq: 0.2 + - _FlickerPercent: 0.05 + - _GhostColorBoost: 1 + - _GhostTransparency: 0 + - _GlitchAmount: 3 + - _GlitchSize: 1 + - _Glow: 3.3 + - _GlowTexUsed: 1 + - _GradBlend: 1 + - _GradBoostX: 1.2 + - _GradBoostY: 1.2 + - _GradIsRadial: 0 + - _GrassManualAnim: 1 + - _GrassManualToggle: 0 + - _GrassRadialBend: 0.1 + - _GrassSpeed: 2 + - _GrassWind: 20 + - _GreyscaleLuminosity: 0 + - _GreyscaleOutline: 0 + - _HandDrawnAmount: 12.82 + - _HandDrawnSpeed: 5 + - _HitEffectBlend: 0 + - _HitEffectGlow: 10.6 + - _HologramFlickerAlpha: 0 + - _HologramFlickerFreq: 0.2 + - _HologramFlickerPercent: 0.05 + - _HologramMaxAlpha: 1 + - _HologramMinAlpha: 0 + - _HologramStripesAlpha: 0.4 + - _HologramStripesAmount: 50 + - _HologramStripesFill: 0.4 + - _HologramStripesLuminosity: 1 + - _HologramStripesSpeed: 5 + - _HologramUnmodAmount: 0.4 + - _HsvBright: 1 + - _HsvSaturation: 1 + - _HsvShift: 180 + - _InnerOutlineAlpha: 1 + - _InnerOutlineGlow: 1 + - _InnerOutlineThickness: 1 + - _MaxXUV: 1 + - _MaxYUV: 1 + - _MinXUV: 0 + - _MinYUV: 0 + - _MotionBlurAngle: 0.1 + - _MotionBlurDist: 1.25 + - _MyDstMode: 10 + - _MySrcMode: 5 + - _NegativeAmount: 1 + - _OffsetUvX: 0 + - _OffsetUvY: 0 + - _OnlyInnerOutline: 0 + - _OnlyOutline: 0 + - _Outline8Directions: 0 + - _OutlineAlpha: 1 + - _OutlineDistortAmount: 0.5 + - _OutlineDistortTexXSpeed: 5 + - _OutlineDistortTexYSpeed: 5 + - _OutlineDistortToggle: 0 + - _OutlineGlow: 1.5 + - _OutlineIsPixel: 0 + - _OutlinePixelWidth: 1 + - _OutlineTexGrey: 0 + - _OutlineTexToggle: 0 + - _OutlineTexXSpeed: 10 + - _OutlineTexYSpeed: 0 + - _OutlineWidth: 0.004 + - _PinchUvAmount: 0.35 + - _PixelateSize: 32 + - _PosterizeGamma: 0.75 + - _PosterizeNumColors: 8 + - _PosterizeOutline: 0 + - _RandomSeed: 0 + - _RectSize: 1 + - _RotateUvAmount: 0 + - _RoundWaveSpeed: 2 + - _RoundWaveStrength: 0.7 + - _ShadowAlpha: 0.5 + - _ShadowX: 0.1 + - _ShadowY: 0 + - _ShakeUvSpeed: 2.5 + - _ShakeUvX: 1.5 + - _ShakeUvY: 1 + - _ShineGlow: 1 + - _ShineLocation: 0.5 + - _ShineRotate: 0 + - _ShineWidth: 0.1 + - _TextureScrollXSpeed: 1 + - _TextureScrollYSpeed: 0 + - _TwistUvAmount: 1 + - _TwistUvPosX: 0.5 + - _TwistUvPosY: 0.5 + - _TwistUvRadius: 0.75 + - _WaveAmount: 7 + - _WaveSpeed: 10 + - _WaveStrength: 7.5 + - _WaveX: 0 + - _WaveY: 0.5 + - _ZTestMode: 4 + - _ZWrite: 0 + - _ZoomUvAmount: 0.5 + m_Colors: + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _ColorChangeNewCol: {r: 1, g: 1, b: 0, a: 1} + - _ColorChangeTarget: {r: 1, g: 0, b: 0, a: 1} + - _ColorSwapBlue: {r: 1, g: 1, b: 1, a: 1} + - _ColorSwapGreen: {r: 1, g: 1, b: 1, a: 1} + - _ColorSwapRed: {r: 1, g: 1, b: 1, a: 1} + - _FadeBurnColor: {r: 1, g: 0.6053487, b: 0, a: 1} + - _GlowColor: {r: 1, g: 0.7193959, b: 0.1273585, a: 1} + - _GradBotLeftCol: {r: 0, g: 0, b: 1, a: 1} + - _GradBotRightCol: {r: 0, g: 0, b: 1, a: 1} + - _GradTopLeftCol: {r: 1, g: 0, b: 0, a: 1} + - _GradTopRightCol: {r: 1, g: 0, b: 0, a: 1} + - _GreyscaleTintColor: {r: 1, g: 1, b: 1, a: 1} + - _HitEffectColor: {r: 0.9622642, g: 0.10987086, b: 0, a: 1} + - _HologramStripeColor: {r: 1, g: 1, b: 1, a: 1} + - _InnerOutlineColor: {r: 1, g: 0, b: 0, a: 1} + - _OutlineColor: {r: 1, g: 1, b: 1, a: 1} + - _ShadowColor: {r: 0, g: 0, b: 0, a: 1} + - _ShineColor: {r: 1, g: 1, b: 1, a: 1} diff --git a/Assets/Plugins/AllIn1SpriteShader/Demo/Demo2.unity.meta b/Assets/Plugins/AllIn1SpriteShader/Demo/Demo2.unity.meta new file mode 100644 index 000000000..c4b7634af --- /dev/null +++ b/Assets/Plugins/AllIn1SpriteShader/Demo/Demo2.unity.meta @@ -0,0 +1,14 @@ +fileFormatVersion: 2 +guid: 63119d9cc000fdf4b96768c82b7d49b3 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 156513 + packageName: All In 1 Sprite Shader + packageVersion: 4.25 + assetPath: Assets/Plugins/AllIn1SpriteShader/Demo/Demo2.unity + uploadId: 708810 diff --git a/Assets/Plugins/AllIn1SpriteShader/Demo/DemoLitShader.unity b/Assets/Plugins/AllIn1SpriteShader/Demo/DemoLitShader.unity new file mode 100644 index 000000000..c0b8813c8 --- /dev/null +++ b/Assets/Plugins/AllIn1SpriteShader/Demo/DemoLitShader.unity @@ -0,0 +1,1115 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!29 &1 +OcclusionCullingSettings: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_OcclusionBakeSettings: + smallestOccluder: 5 + smallestHole: 0.25 + backfaceThreshold: 100 + m_SceneGUID: 00000000000000000000000000000000 + m_OcclusionCullingData: {fileID: 0} +--- !u!104 &2 +RenderSettings: + m_ObjectHideFlags: 0 + serializedVersion: 9 + m_Fog: 1 + m_FogColor: {r: 0.35287845, g: 0.39309406, b: 0.5019608, a: 1} + m_FogMode: 3 + m_FogDensity: 0.03 + m_LinearFogStart: 0 + m_LinearFogEnd: 300 + m_AmbientSkyColor: {r: 0.212, g: 0.227, b: 0.259, a: 1} + m_AmbientEquatorColor: {r: 0.114, g: 0.125, b: 0.133, a: 1} + m_AmbientGroundColor: {r: 0.047, g: 0.043, b: 0.035, a: 1} + m_AmbientIntensity: 1 + m_AmbientMode: 0 + m_SubtractiveShadowColor: {r: 0.42, g: 0.478, b: 0.627, a: 1} + m_SkyboxMaterial: {fileID: 10304, guid: 0000000000000000f000000000000000, type: 0} + m_HaloStrength: 0.5 + m_FlareStrength: 1 + m_FlareFadeSpeed: 3 + m_HaloTexture: {fileID: 0} + m_SpotCookie: {fileID: 10001, guid: 0000000000000000e000000000000000, type: 0} + m_DefaultReflectionMode: 0 + m_DefaultReflectionResolution: 128 + m_ReflectionBounces: 1 + m_ReflectionIntensity: 1 + m_CustomReflection: {fileID: 0} + m_Sun: {fileID: 0} + m_IndirectSpecularColor: {r: 0, g: 0, b: 0, a: 1} + m_UseRadianceAmbientProbe: 0 +--- !u!157 &3 +LightmapSettings: + m_ObjectHideFlags: 0 + serializedVersion: 11 + m_GIWorkflowMode: 1 + m_GISettings: + serializedVersion: 2 + m_BounceScale: 1 + m_IndirectOutputScale: 1 + m_AlbedoBoost: 1 + m_EnvironmentLightingMode: 0 + m_EnableBakedLightmaps: 1 + m_EnableRealtimeLightmaps: 0 + m_LightmapEditorSettings: + serializedVersion: 12 + m_Resolution: 2 + m_BakeResolution: 40 + m_AtlasSize: 1024 + m_AO: 0 + m_AOMaxDistance: 1 + m_CompAOExponent: 1 + m_CompAOExponentDirect: 0 + m_ExtractAmbientOcclusion: 0 + m_Padding: 2 + m_LightmapParameters: {fileID: 0} + m_LightmapsBakeMode: 1 + m_TextureCompression: 1 + m_FinalGather: 0 + m_FinalGatherFiltering: 1 + m_FinalGatherRayCount: 256 + m_ReflectionCompression: 2 + m_MixedBakeMode: 2 + m_BakeBackend: 1 + m_PVRSampling: 1 + m_PVRDirectSampleCount: 32 + m_PVRSampleCount: 512 + m_PVRBounces: 2 + m_PVREnvironmentSampleCount: 256 + m_PVREnvironmentReferencePointCount: 2048 + m_PVRFilteringMode: 1 + m_PVRDenoiserTypeDirect: 1 + m_PVRDenoiserTypeIndirect: 1 + m_PVRDenoiserTypeAO: 1 + m_PVRFilterTypeDirect: 0 + m_PVRFilterTypeIndirect: 0 + m_PVRFilterTypeAO: 0 + m_PVREnvironmentMIS: 1 + m_PVRCulling: 1 + m_PVRFilteringGaussRadiusDirect: 1 + m_PVRFilteringGaussRadiusIndirect: 5 + m_PVRFilteringGaussRadiusAO: 2 + m_PVRFilteringAtrousPositionSigmaDirect: 0.5 + m_PVRFilteringAtrousPositionSigmaIndirect: 2 + m_PVRFilteringAtrousPositionSigmaAO: 1 + m_ExportTrainingData: 0 + m_TrainingDataDestination: TrainingData + m_LightProbeSampleCountMultiplier: 4 + m_LightingDataAsset: {fileID: 0} + m_UseShadowmask: 1 +--- !u!196 &4 +NavMeshSettings: + serializedVersion: 2 + m_ObjectHideFlags: 0 + m_BuildSettings: + serializedVersion: 2 + agentTypeID: 0 + agentRadius: 0.5 + agentHeight: 2 + agentSlope: 45 + agentClimb: 0.4 + ledgeDropHeight: 0 + maxJumpAcrossDistance: 0 + minRegionArea: 2 + manualCellSize: 0 + cellSize: 0.16666667 + manualTileSize: 0 + tileSize: 256 + accuratePlacement: 0 + debug: + m_Flags: 0 + m_NavMeshData: {fileID: 0} +--- !u!1 &297631556 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 297631557} + - component: {fileID: 297631558} + m_Layer: 0 + m_Name: PointLights + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &297631557 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 297631556} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0.04} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 309637868} + - {fileID: 1340967441} + m_Father: {fileID: 0} + m_RootOrder: 2 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &297631558 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 297631556} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: f2560c72fbbcfe44195e240286d1d4e5, type: 3} + m_Name: + m_EditorClassIdentifier: + rotationSpeed: 45 + rotationAxis: {x: 0, y: 1, z: 0} + useLocalRotation: 0 +--- !u!1 &309637867 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 309637868} + - component: {fileID: 309637869} + m_Layer: 0 + m_Name: Point Light + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &309637868 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 309637867} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 2.32, z: -5} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 297631557} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!108 &309637869 +Light: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 309637867} + m_Enabled: 1 + serializedVersion: 10 + m_Type: 2 + m_Shape: 0 + m_Color: {r: 0, g: 1, b: 0.07846761, a: 1} + m_Intensity: 10 + m_Range: 7.89 + m_SpotAngle: 30 + m_InnerSpotAngle: 21.80208 + m_CookieSize: 10 + m_Shadows: + m_Type: 2 + m_Resolution: -1 + m_CustomResolution: -1 + m_Strength: 1 + m_Bias: 0.05 + m_NormalBias: 0.4 + m_NearPlane: 0.2 + m_CullingMatrixOverride: + e00: 1 + e01: 0 + e02: 0 + e03: 0 + e10: 0 + e11: 1 + e12: 0 + e13: 0 + e20: 0 + e21: 0 + e22: 1 + e23: 0 + e30: 0 + e31: 0 + e32: 0 + e33: 1 + m_UseCullingMatrixOverride: 0 + m_Cookie: {fileID: 0} + m_DrawHalo: 0 + m_Flare: {fileID: 0} + m_RenderMode: 0 + m_CullingMask: + serializedVersion: 2 + m_Bits: 4294967295 + m_RenderingLayerMask: 1 + m_Lightmapping: 4 + m_LightShadowCasterMode: 0 + m_AreaSize: {x: 1, y: 1} + m_BounceIntensity: 1 + m_ColorTemperature: 6570 + m_UseColorTemperature: 0 + m_BoundingSphereOverride: {x: 0, y: 0, z: 0, w: 0} + m_UseBoundingSphereOverride: 0 + m_ShadowRadius: 0 + m_ShadowAngle: 0 +--- !u!1 &831620395 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 831620397} + - component: {fileID: 831620396} + m_Layer: 0 + m_Name: Directional Light + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!108 &831620396 +Light: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 831620395} + m_Enabled: 1 + serializedVersion: 10 + m_Type: 1 + m_Shape: 0 + m_Color: {r: 1, g: 0.95686275, b: 0.8392157, a: 1} + m_Intensity: 1 + m_Range: 10 + m_SpotAngle: 30 + m_InnerSpotAngle: 21.80208 + m_CookieSize: 10 + m_Shadows: + m_Type: 2 + m_Resolution: -1 + m_CustomResolution: -1 + m_Strength: 1 + m_Bias: 0.05 + m_NormalBias: 0.4 + m_NearPlane: 0.2 + m_CullingMatrixOverride: + e00: 1 + e01: 0 + e02: 0 + e03: 0 + e10: 0 + e11: 1 + e12: 0 + e13: 0 + e20: 0 + e21: 0 + e22: 1 + e23: 0 + e30: 0 + e31: 0 + e32: 0 + e33: 1 + m_UseCullingMatrixOverride: 0 + m_Cookie: {fileID: 0} + m_DrawHalo: 0 + m_Flare: {fileID: 0} + m_RenderMode: 1 + m_CullingMask: + serializedVersion: 2 + m_Bits: 4294967295 + m_RenderingLayerMask: 1 + m_Lightmapping: 4 + m_LightShadowCasterMode: 0 + m_AreaSize: {x: 1, y: 1} + m_BounceIntensity: 1 + m_ColorTemperature: 6570 + m_UseColorTemperature: 0 + m_BoundingSphereOverride: {x: 0, y: 0, z: 0, w: 0} + m_UseBoundingSphereOverride: 0 + m_ShadowRadius: 0 + m_ShadowAngle: 0 +--- !u!4 &831620397 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 831620395} + m_LocalRotation: {x: 0.17450753, y: 0, z: 0, w: 0.98465586} + m_LocalPosition: {x: 0, y: 3, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 20.1, y: 0, z: 0} +--- !u!1 &1340967440 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1340967441} + - component: {fileID: 1340967442} + m_Layer: 0 + m_Name: Point Light (1) + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1340967441 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1340967440} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 2.32, z: 5} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 297631557} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!108 &1340967442 +Light: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1340967440} + m_Enabled: 1 + serializedVersion: 10 + m_Type: 2 + m_Shape: 0 + m_Color: {r: 1, g: 0, b: 0.0951767, a: 1} + m_Intensity: 10 + m_Range: 7.89 + m_SpotAngle: 30 + m_InnerSpotAngle: 21.80208 + m_CookieSize: 10 + m_Shadows: + m_Type: 2 + m_Resolution: -1 + m_CustomResolution: -1 + m_Strength: 1 + m_Bias: 0.05 + m_NormalBias: 0.4 + m_NearPlane: 0.2 + m_CullingMatrixOverride: + e00: 1 + e01: 0 + e02: 0 + e03: 0 + e10: 0 + e11: 1 + e12: 0 + e13: 0 + e20: 0 + e21: 0 + e22: 1 + e23: 0 + e30: 0 + e31: 0 + e32: 0 + e33: 1 + m_UseCullingMatrixOverride: 0 + m_Cookie: {fileID: 0} + m_DrawHalo: 0 + m_Flare: {fileID: 0} + m_RenderMode: 0 + m_CullingMask: + serializedVersion: 2 + m_Bits: 4294967295 + m_RenderingLayerMask: 1 + m_Lightmapping: 4 + m_LightShadowCasterMode: 0 + m_AreaSize: {x: 1, y: 1} + m_BounceIntensity: 1 + m_ColorTemperature: 6570 + m_UseColorTemperature: 0 + m_BoundingSphereOverride: {x: 0, y: 0, z: 0, w: 0} + m_UseBoundingSphereOverride: 0 + m_ShadowRadius: 0 + m_ShadowAngle: 0 +--- !u!1 &1376930971 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1376930974} + - component: {fileID: 1376930973} + - component: {fileID: 1376930972} + m_Layer: 0 + m_Name: Main Camera + m_TagString: MainCamera + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!81 &1376930972 +AudioListener: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1376930971} + m_Enabled: 1 +--- !u!20 &1376930973 +Camera: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1376930971} + m_Enabled: 1 + serializedVersion: 2 + m_ClearFlags: 1 + m_BackGroundColor: {r: 0.19215687, g: 0.3019608, b: 0.4745098, a: 0} + m_projectionMatrixMode: 1 + m_GateFitMode: 2 + m_FOVAxisMode: 0 + m_SensorSize: {x: 36, y: 24} + m_LensShift: {x: 0, y: 0} + m_FocalLength: 50 + m_NormalizedViewPortRect: + serializedVersion: 2 + x: 0 + y: 0 + width: 1 + height: 1 + near clip plane: 0.3 + far clip plane: 1000 + field of view: 60 + orthographic: 0 + orthographic size: 5 + m_Depth: -1 + m_CullingMask: + serializedVersion: 2 + m_Bits: 4294967295 + m_RenderingPath: -1 + m_TargetTexture: {fileID: 0} + m_TargetDisplay: 0 + m_TargetEye: 3 + m_HDR: 1 + m_AllowMSAA: 1 + m_AllowDynamicResolution: 0 + m_ForceIntoRT: 0 + m_OcclusionCulling: 1 + m_StereoConvergence: 10 + m_StereoSeparation: 0.022 +--- !u!4 &1376930974 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1376930971} + m_LocalRotation: {x: 0.27899113, y: 0, z: 0, w: 0.9602937} + m_LocalPosition: {x: 0, y: 8.36, z: -11.08} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 32.4, y: 0, z: 0} +--- !u!1 &4467823508200106856 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 4467823508200106859} + - component: {fileID: 4467823508200106858} + - component: {fileID: 4467823508200106860} + - component: {fileID: 4467823508200106857} + m_Layer: 0 + m_Name: 2DSprite1 + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!114 &4467823508200106857 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4467823508200106856} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: ee158225ee1e59f4791627785501d950, type: 3} + m_Name: + m_EditorClassIdentifier: + currentShaderType: 5 + normalStrength: 5 + normalSmoothing: 1 + computingNormal: 0 +--- !u!212 &4467823508200106858 +SpriteRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4467823508200106856} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 0 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: a6fac1ae6d53b7245ad918865e14c52e, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 0 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_Sprite: {fileID: 21300000, guid: 519dafacd208bb64c83d5124be03b09d, type: 3} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_FlipX: 0 + m_FlipY: 0 + m_DrawMode: 0 + m_Size: {x: 5.12, y: 5.12} + m_AdaptiveModeThreshold: 0.5 + m_SpriteTileMode: 0 + m_WasSpriteAssigned: 1 + m_MaskInteraction: 0 + m_SpriteSortPoint: 0 +--- !u!4 &4467823508200106859 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4467823508200106856} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 1.15, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 4467823508785041245} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!95 &4467823508200106860 +Animator: + serializedVersion: 3 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4467823508200106856} + m_Enabled: 1 + m_Avatar: {fileID: 0} + m_Controller: {fileID: 9100000, guid: ed827ed402dcef3458313b21158b5c7c, type: 2} + m_CullingMode: 0 + m_UpdateMode: 0 + m_ApplyRootMotion: 0 + m_LinearVelocityBlending: 0 + m_WarningMessage: + m_HasTransformHierarchy: 1 + m_AllowConstantClipSamplingOptimization: 1 + m_KeepAnimatorControllerStateOnDisable: 0 +--- !u!1 &4467823508418042096 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 4467823508418042098} + - component: {fileID: 4467823508418042097} + - component: {fileID: 4467823508418042099} + - component: {fileID: 4467823508418042100} + m_Layer: 0 + m_Name: 2DSprite3 + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!212 &4467823508418042097 +SpriteRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4467823508418042096} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 0 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: 23a4e6f17bbaf66479862eb488f28181, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 0 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_Sprite: {fileID: 21300000, guid: 519dafacd208bb64c83d5124be03b09d, type: 3} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_FlipX: 0 + m_FlipY: 0 + m_DrawMode: 0 + m_Size: {x: 5.12, y: 5.12} + m_AdaptiveModeThreshold: 0.5 + m_SpriteTileMode: 0 + m_WasSpriteAssigned: 1 + m_MaskInteraction: 0 + m_SpriteSortPoint: 0 +--- !u!4 &4467823508418042098 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4467823508418042096} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 6.6, y: 1.21, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 4467823508785041245} + m_RootOrder: 2 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!95 &4467823508418042099 +Animator: + serializedVersion: 3 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4467823508418042096} + m_Enabled: 1 + m_Avatar: {fileID: 0} + m_Controller: {fileID: 9100000, guid: 2025469cc6b8be543a1b93993e746b75, type: 2} + m_CullingMode: 0 + m_UpdateMode: 0 + m_ApplyRootMotion: 0 + m_LinearVelocityBlending: 0 + m_WarningMessage: + m_HasTransformHierarchy: 1 + m_AllowConstantClipSamplingOptimization: 1 + m_KeepAnimatorControllerStateOnDisable: 0 +--- !u!114 &4467823508418042100 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4467823508418042096} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: ee158225ee1e59f4791627785501d950, type: 3} + m_Name: + m_EditorClassIdentifier: + currentShaderType: 5 + normalStrength: 5 + normalSmoothing: 1 + computingNormal: 0 +--- !u!1 &4467823508785041244 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 4467823508785041245} + m_Layer: 0 + m_Name: LitSprites + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &4467823508785041245 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4467823508785041244} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 4467823508200106859} + - {fileID: 4467823509716073570} + - {fileID: 4467823508418042098} + m_Father: {fileID: 0} + m_RootOrder: 3 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &4467823509716073568 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 4467823509716073570} + - component: {fileID: 4467823509716073569} + - component: {fileID: 4467823509716073571} + m_Layer: 0 + m_Name: 2DSprite2 + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!212 &4467823509716073569 +SpriteRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4467823509716073568} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 0 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: c597a6bd515e47a429c79f272eb6762a, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 0 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_Sprite: {fileID: 21300000, guid: 519dafacd208bb64c83d5124be03b09d, type: 3} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_FlipX: 0 + m_FlipY: 0 + m_DrawMode: 0 + m_Size: {x: 5.12, y: 5.12} + m_AdaptiveModeThreshold: 0.5 + m_SpriteTileMode: 0 + m_WasSpriteAssigned: 1 + m_MaskInteraction: 0 + m_SpriteSortPoint: 0 +--- !u!4 &4467823509716073570 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4467823509716073568} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: -6.6, y: 1.33, z: 0} + m_LocalScale: {x: 1.8061016, y: 1.8061016, z: 1.8061016} + m_Children: [] + m_Father: {fileID: 4467823508785041245} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &4467823509716073571 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4467823509716073568} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: ee158225ee1e59f4791627785501d950, type: 3} + m_Name: + m_EditorClassIdentifier: + currentShaderType: 5 + normalStrength: 5 + normalSmoothing: 1 + computingNormal: 0 +--- !u!1 &6574949516878858562 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 6574949516878858574} + - component: {fileID: 6574949516878858575} + - component: {fileID: 6574949516878858572} + - component: {fileID: 6574949516878858573} + m_Layer: 0 + m_Name: Floor + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!23 &6574949516878858572 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 6574949516878858562} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: f967997c8b2ff004ebed845351a5449c, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!65 &6574949516878858573 +BoxCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 6574949516878858562} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + serializedVersion: 2 + m_Size: {x: 1, y: 1, z: 1} + m_Center: {x: 0, y: 0, z: 0} +--- !u!4 &6574949516878858574 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 6574949516878858562} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: -1, z: 0} + m_LocalScale: {x: 100, y: 1, z: 100} + m_Children: [] + m_Father: {fileID: 6574949518432501818} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!33 &6574949516878858575 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 6574949516878858562} + m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} +--- !u!4 &6574949517728517880 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 6574949517728517884} + m_LocalRotation: {x: 0.7071068, y: -0, z: -0, w: 0.7071068} + m_LocalPosition: {x: 0, y: -1, z: 27.9} + m_LocalScale: {x: 100, y: 1, z: 100} + m_Children: [] + m_Father: {fileID: 6574949518432501818} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 90, y: 0, z: 0} +--- !u!33 &6574949517728517881 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 6574949517728517884} + m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} +--- !u!1 &6574949517728517884 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 6574949517728517880} + - component: {fileID: 6574949517728517881} + - component: {fileID: 6574949517728517886} + - component: {fileID: 6574949517728517887} + m_Layer: 0 + m_Name: Wall + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!23 &6574949517728517886 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 6574949517728517884} + m_Enabled: 1 + m_CastShadows: 0 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: 38bc0196d341b5b4a9998eff3a9112b9, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!65 &6574949517728517887 +BoxCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 6574949517728517884} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + serializedVersion: 2 + m_Size: {x: 1, y: 1, z: 1} + m_Center: {x: 0, y: 0, z: 0} +--- !u!4 &6574949518432501818 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 6574949518432501819} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 6574949516878858574} + - {fileID: 6574949517728517880} + m_Father: {fileID: 0} + m_RootOrder: 4 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &6574949518432501819 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 6574949518432501818} + m_Layer: 0 + m_Name: Environment + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 diff --git a/Assets/Plugins/AllIn1SpriteShader/Demo/DemoLitShader.unity.meta b/Assets/Plugins/AllIn1SpriteShader/Demo/DemoLitShader.unity.meta new file mode 100644 index 000000000..ca5ce2cd3 --- /dev/null +++ b/Assets/Plugins/AllIn1SpriteShader/Demo/DemoLitShader.unity.meta @@ -0,0 +1,14 @@ +fileFormatVersion: 2 +guid: 86d599b29c3c772489a054510b3caf0c +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 156513 + packageName: All In 1 Sprite Shader + packageVersion: 4.25 + assetPath: Assets/Plugins/AllIn1SpriteShader/Demo/DemoLitShader.unity + uploadId: 708810 diff --git a/Assets/Plugins/AllIn1SpriteShader/Demo/Fonts.meta b/Assets/Plugins/AllIn1SpriteShader/Demo/Fonts.meta new file mode 100644 index 000000000..2f4081d02 --- /dev/null +++ b/Assets/Plugins/AllIn1SpriteShader/Demo/Fonts.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: c2e2455655940ed4ca1596166ba120ca +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/AllIn1SpriteShader/Demo/Fonts/CaviarDreams.ttf b/Assets/Plugins/AllIn1SpriteShader/Demo/Fonts/CaviarDreams.ttf new file mode 100644 index 000000000..852f4546d Binary files /dev/null and b/Assets/Plugins/AllIn1SpriteShader/Demo/Fonts/CaviarDreams.ttf differ diff --git a/Assets/Plugins/AllIn1SpriteShader/Demo/Fonts/CaviarDreams.ttf.meta b/Assets/Plugins/AllIn1SpriteShader/Demo/Fonts/CaviarDreams.ttf.meta new file mode 100644 index 000000000..da263d0c7 --- /dev/null +++ b/Assets/Plugins/AllIn1SpriteShader/Demo/Fonts/CaviarDreams.ttf.meta @@ -0,0 +1,29 @@ +fileFormatVersion: 2 +guid: 8125849ac2a1e6742b3cad98aa210e2d +TrueTypeFontImporter: + externalObjects: {} + serializedVersion: 4 + fontSize: 16 + forceTextureCase: -2 + characterSpacing: 0 + characterPadding: 1 + includeFontData: 1 + fontName: Caviar Dreams + fontNames: + - Caviar Dreams + fallbackFontReferences: [] + customCharacters: + fontRenderingMode: 0 + ascentCalculationMode: 1 + useLegacyBoundsCalculation: 0 + shouldRoundAdvanceValue: 1 + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 156513 + packageName: All In 1 Sprite Shader + packageVersion: 4.25 + assetPath: Assets/Plugins/AllIn1SpriteShader/Demo/Fonts/CaviarDreams.ttf + uploadId: 708810 diff --git a/Assets/Plugins/AllIn1SpriteShader/Demo/Fonts/CaviarDreams_Bold.ttf b/Assets/Plugins/AllIn1SpriteShader/Demo/Fonts/CaviarDreams_Bold.ttf new file mode 100644 index 000000000..0a3fe6dec Binary files /dev/null and b/Assets/Plugins/AllIn1SpriteShader/Demo/Fonts/CaviarDreams_Bold.ttf differ diff --git a/Assets/Plugins/AllIn1SpriteShader/Demo/Fonts/CaviarDreams_Bold.ttf.meta b/Assets/Plugins/AllIn1SpriteShader/Demo/Fonts/CaviarDreams_Bold.ttf.meta new file mode 100644 index 000000000..5a43bf3fa --- /dev/null +++ b/Assets/Plugins/AllIn1SpriteShader/Demo/Fonts/CaviarDreams_Bold.ttf.meta @@ -0,0 +1,30 @@ +fileFormatVersion: 2 +guid: 868b1fc2a144d3d459c5f34d64b52eb0 +TrueTypeFontImporter: + externalObjects: {} + serializedVersion: 4 + fontSize: 16 + forceTextureCase: -2 + characterSpacing: 0 + characterPadding: 1 + includeFontData: 1 + fontName: Caviar Dreams + fontNames: + - Caviar Dreams + fallbackFontReferences: + - {fileID: 12800000, guid: 8125849ac2a1e6742b3cad98aa210e2d, type: 3} + customCharacters: + fontRenderingMode: 0 + ascentCalculationMode: 1 + useLegacyBoundsCalculation: 0 + shouldRoundAdvanceValue: 1 + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 156513 + packageName: All In 1 Sprite Shader + packageVersion: 4.25 + assetPath: Assets/Plugins/AllIn1SpriteShader/Demo/Fonts/CaviarDreams_Bold.ttf + uploadId: 708810 diff --git a/Assets/Plugins/AllIn1SpriteShader/Demo/Fonts/PoetsenOne-Regular.ttf b/Assets/Plugins/AllIn1SpriteShader/Demo/Fonts/PoetsenOne-Regular.ttf new file mode 100644 index 000000000..a24f91dd5 Binary files /dev/null and b/Assets/Plugins/AllIn1SpriteShader/Demo/Fonts/PoetsenOne-Regular.ttf differ diff --git a/Assets/Plugins/AllIn1SpriteShader/Demo/Fonts/PoetsenOne-Regular.ttf.meta b/Assets/Plugins/AllIn1SpriteShader/Demo/Fonts/PoetsenOne-Regular.ttf.meta new file mode 100644 index 000000000..f929624c7 --- /dev/null +++ b/Assets/Plugins/AllIn1SpriteShader/Demo/Fonts/PoetsenOne-Regular.ttf.meta @@ -0,0 +1,29 @@ +fileFormatVersion: 2 +guid: d722354f9c8e9e643b5f30f00b5b20ea +TrueTypeFontImporter: + externalObjects: {} + serializedVersion: 4 + fontSize: 16 + forceTextureCase: -2 + characterSpacing: 0 + characterPadding: 1 + includeFontData: 1 + fontName: Poetsen One + fontNames: + - Poetsen One + fallbackFontReferences: [] + customCharacters: + fontRenderingMode: 0 + ascentCalculationMode: 1 + useLegacyBoundsCalculation: 0 + shouldRoundAdvanceValue: 1 + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 156513 + packageName: All In 1 Sprite Shader + packageVersion: 4.25 + assetPath: Assets/Plugins/AllIn1SpriteShader/Demo/Fonts/PoetsenOne-Regular.ttf + uploadId: 708810 diff --git a/Assets/Plugins/AllIn1SpriteShader/Demo/Materials.meta b/Assets/Plugins/AllIn1SpriteShader/Demo/Materials.meta new file mode 100644 index 000000000..53636436e --- /dev/null +++ b/Assets/Plugins/AllIn1SpriteShader/Demo/Materials.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: ddc21e094ffb34f4389bb47b77d54f47 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/AllIn1SpriteShader/Demo/Materials/Color Ramp Gradient.mat b/Assets/Plugins/AllIn1SpriteShader/Demo/Materials/Color Ramp Gradient.mat new file mode 100644 index 000000000..c63ee1227 --- /dev/null +++ b/Assets/Plugins/AllIn1SpriteShader/Demo/Materials/Color Ramp Gradient.mat @@ -0,0 +1,274 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!21 &2100000 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: Color Ramp Gradient + m_Shader: {fileID: 4800000, guid: a36b7719ff0465b42ab1407d67672c5f, type: 3} + m_ShaderKeywords: COLORRAMP_ON ETC1_EXTERNAL_ALPHA GRADIENTCOLORRAMP_ON + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _ColorRampTex: + m_Texture: {fileID: 2800000, guid: 279657edc397ece4b8029c727adf6ddc, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ColorRampTexGradient: + m_Texture: {fileID: 28596166879787490} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ColorSwapTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DistortTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _FadeBurnTex: + m_Texture: {fileID: 2800000, guid: 677cca399782dea41aedc1d292ecb67d, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _FadeTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _GlowTex: + 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} + - _OutlineDistortTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OutlineTex: + m_Texture: {fileID: 2800000, guid: 74087f6d03f233e4a8a142fa01f9e5cf, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OverlayTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ShineMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - _Alpha: 1 + - _AlphaCutoffValue: 0.25 + - _AlphaOutlineBlend: 1 + - _AlphaOutlineGlow: 5 + - _AlphaOutlineMinAlpha: 0 + - _AlphaOutlinePower: 1 + - _AlphaRoundThreshold: 0.5 + - _BillboardY: 0 + - _BlurHD: 0 + - _BlurIntensity: 10 + - _Brightness: 0 + - _ChromAberrAlpha: 0.4 + - _ChromAberrAmount: 1 + - _ClipUvDown: 0 + - _ClipUvLeft: 0 + - _ClipUvRight: 0 + - _ClipUvUp: 0 + - _ColorChangeLuminosity: 0 + - _ColorChangeTolerance: 0.25 + - _ColorChangeTolerance2: 0.25 + - _ColorChangeTolerance3: 0.25 + - _ColorRampBlend: 1 + - _ColorRampLuminosity: 0 + - _ColorRampOutline: 0 + - _ColorSwapBlend: 1 + - _ColorSwapBlueLuminosity: 0.5 + - _ColorSwapGreenLuminosity: 0.5 + - _ColorSwapRedLuminosity: 0.5 + - _Contrast: 1 + - _DistortAmount: 0.5 + - _DistortTexXSpeed: 5 + - _DistortTexYSpeed: 5 + - _FadeAmount: -0.1 + - _FadeBurnGlow: 2 + - _FadeBurnTransition: 0.075 + - _FadeBurnWidth: 0.025 + - _FishEyeUvAmount: 0.35 + - _FlickerAlpha: 0 + - _FlickerFreq: 0.2 + - _FlickerPercent: 0.05 + - _GhostBlend: 1 + - _GhostColorBoost: 1 + - _GhostTransparency: 0 + - _GlitchAmount: 3 + - _GlitchSize: 1 + - _Glow: 10 + - _GlowTexUsed: 0 + - _GradBlend: 1 + - _GradBoostX: 1.2 + - _GradBoostY: 1.2 + - _GradIsRadial: 0 + - _GrassManualAnim: 1 + - _GrassManualToggle: 0 + - _GrassRadialBend: 0.1 + - _GrassSpeed: 2 + - _GrassWind: 20 + - _GreyscaleBlend: 1 + - _GreyscaleLuminosity: 0 + - _GreyscaleOutline: 0 + - _HandDrawnAmount: 10 + - _HandDrawnSpeed: 5 + - _HitEffectBlend: 1 + - _HitEffectGlow: 5 + - _HologramBlend: 1 + - _HologramMaxAlpha: 0.75 + - _HologramMinAlpha: 0.1 + - _HologramStripesAmount: 0.1 + - _HologramStripesSpeed: 4.5 + - _HologramUnmodAmount: 0 + - _HsvBright: 1 + - _HsvSaturation: 1 + - _HsvShift: 180 + - _InnerOutlineAlpha: 1 + - _InnerOutlineGlow: 4 + - _InnerOutlineThickness: 1 + - _MaxXUV: 1 + - _MaxYUV: 1 + - _MinXUV: 0 + - _MinYUV: 0 + - _MotionBlurAngle: 0.1 + - _MotionBlurDist: 1.25 + - _MyDstMode: 10 + - _MySrcMode: 5 + - _NegativeAmount: 1 + - _OffsetUvX: 0 + - _OffsetUvY: 0 + - _OnlyInnerOutline: 0 + - _OnlyOutline: 0 + - _Outline8Directions: 0 + - _OutlineAlpha: 1 + - _OutlineDistortAmount: 0.5 + - _OutlineDistortTexXSpeed: 5 + - _OutlineDistortTexYSpeed: 5 + - _OutlineDistortToggle: 0 + - _OutlineGlow: 1.5 + - _OutlineIsPixel: 0 + - _OutlinePixelWidth: 1 + - _OutlineTexGrey: 0 + - _OutlineTexToggle: 0 + - _OutlineTexXSpeed: 10 + - _OutlineTexYSpeed: 0 + - _OutlineWidth: 0.004 + - _OverlayBlend: 1 + - _OverlayGlow: 1 + - _PinchUvAmount: 0.35 + - _PixelateSize: 32 + - _PosterizeGamma: 0.75 + - _PosterizeNumColors: 8 + - _PosterizeOutline: 0 + - _RandomSeed: 0 + - _RectSize: 1 + - _RotateUvAmount: 0 + - _RoundWaveSpeed: 2 + - _RoundWaveStrength: 0.7 + - _ShadowAlpha: 0.5 + - _ShadowX: 0.1 + - _ShadowY: -0.05 + - _ShakeUvSpeed: 2.5 + - _ShakeUvX: 1.5 + - _ShakeUvY: 1 + - _ShineGlow: 1 + - _ShineLocation: 0.5 + - _ShineRotate: 0 + - _ShineWidth: 0.1 + - _TextureScrollXSpeed: 1 + - _TextureScrollYSpeed: 0 + - _TwistUvAmount: 1 + - _TwistUvPosX: 0.5 + - _TwistUvPosY: 0.5 + - _TwistUvRadius: 0.75 + - _WaveAmount: 7 + - _WaveSpeed: 10 + - _WaveStrength: 7.5 + - _WaveX: 0 + - _WaveY: 0.5 + - _ZTestMode: 4 + - _ZWrite: 0 + - _ZoomUvAmount: 0.5 + m_Colors: + - _AlphaOutlineColor: {r: 1, g: 1, b: 1, a: 1} + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _ColorChangeNewCol: {r: 1, g: 1, b: 0, a: 1} + - _ColorChangeNewCol2: {r: 1, g: 1, b: 0, a: 1} + - _ColorChangeNewCol3: {r: 1, g: 1, b: 0, a: 1} + - _ColorChangeTarget: {r: 1, g: 0, b: 0, a: 1} + - _ColorChangeTarget2: {r: 1, g: 0, b: 0, a: 1} + - _ColorChangeTarget3: {r: 1, g: 0, b: 0, a: 1} + - _ColorSwapBlue: {r: 1, g: 1, b: 1, a: 1} + - _ColorSwapGreen: {r: 1, g: 1, b: 1, a: 1} + - _ColorSwapRed: {r: 1, g: 1, b: 1, a: 1} + - _FadeBurnColor: {r: 1, g: 1, b: 0, a: 1} + - _GlowColor: {r: 1, g: 1, b: 1, a: 1} + - _GradBotLeftCol: {r: 0, g: 0, b: 1, a: 1} + - _GradBotRightCol: {r: 0, g: 0, b: 1, a: 1} + - _GradTopLeftCol: {r: 1, g: 0, b: 0, a: 1} + - _GradTopRightCol: {r: 1, g: 0, b: 0, a: 1} + - _GreyscaleTintColor: {r: 1, g: 1, b: 1, a: 1} + - _HitEffectColor: {r: 1, g: 1, b: 1, a: 1} + - _HologramStripeColor: {r: 0, g: 1, b: 1, a: 1} + - _InnerOutlineColor: {r: 1, g: 0, b: 0, a: 1} + - _OutlineColor: {r: 1, g: 1, b: 1, a: 1} + - _OverlayColor: {r: 1, g: 1, b: 1, a: 1} + - _ShadowColor: {r: 0, g: 0, b: 0, a: 1} + - _ShineColor: {r: 1, g: 1, b: 1, a: 1} +--- !u!28 &28596166879787490 +Texture2D: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: z_ColorRampTexGradientTex{"mode":0,"colorKeys":[{"color":{"r":0.25045204162597659,"g":0.0,"b":1.0,"a":1.0},"time":0.0},{"color":{"r":1.0,"g":0.0,"b":0.3670511245727539,"a":1.0},"time":0.30406653881073},{"color":{"r":1.0,"g":0.8852795958518982,"b":0.49803924560546877,"a":1.0},"time":0.6081483364105225},{"color":{"r":1.0,"g":0.7620869874954224,"b":0.0,"a":1.0},"time":0.6730296611785889},{"color":{"r":1.0,"g":0.21687757968902589,"b":0.15294116735458375,"a":1.0},"time":0.921126127243042},{"color":{"r":1.0,"g":0.9718939661979675,"b":0.0,"a":1.0},"time":1.0}],"alphaKeys":[{"alpha":1.0,"time":0.0},{"alpha":1.0,"time":1.0}]} + m_ImageContentsHash: + serializedVersion: 2 + Hash: 00000000000000000000000000000000 + m_ForcedFallbackFormat: 4 + m_DownscaleFallback: 0 + serializedVersion: 2 + m_Width: 64 + m_Height: 1 + m_CompleteImageSize: 256 + m_TextureFormat: 4 + m_MipCount: 1 + m_IsReadable: 1 + m_StreamingMipmaps: 0 + m_StreamingMipmapsPriority: 0 + m_AlphaIsTransparency: 0 + m_ImageCount: 1 + m_TextureDimension: 2 + m_TextureSettings: + serializedVersion: 2 + m_FilterMode: 1 + m_Aniso: 1 + m_MipBias: 0 + m_WrapU: 1 + m_WrapV: 1 + m_WrapW: 1 + m_LightmapFormat: 0 + m_ColorSpace: 1 + image data: 256 + _typelessdata: 4000ffff4a00f7ff5400eeff5e00e6ff6800ddff7200d5ff7c00ccff8600c4ff9000bcff9a00b3ffa400abffae00a2ffb8009affc20091ffcc0089ffd60081ffe00078ffe90070fff30067fffd005fffff0a5fffff1661ffff2263ffff2d64ffff3966ffff4568ffff516affff5c6bffff686dffff746fffff8071ffff8c72ffff9774ffffa376ffffaf77ffffbb79ffffc67bffffd27dffffde7effffdc6affffd54bffffcd2cffffc50cffffbd01ffffb404ffffab06ffffa209ffff990bffff910effff8810ffff7f13ffff7615ffff6d18ffff641affff5b1dffff521fffff4922ffff4024ffff3827ffff5d1fffff8418ffffaa10ffffd108fffff800ff + m_StreamData: + offset: 0 + size: 0 + path: diff --git a/Assets/Plugins/AllIn1SpriteShader/Demo/Materials/Color Ramp Gradient.mat.meta b/Assets/Plugins/AllIn1SpriteShader/Demo/Materials/Color Ramp Gradient.mat.meta new file mode 100644 index 000000000..d61d130e9 --- /dev/null +++ b/Assets/Plugins/AllIn1SpriteShader/Demo/Materials/Color Ramp Gradient.mat.meta @@ -0,0 +1,15 @@ +fileFormatVersion: 2 +guid: 1c07bf10ccbd5c643b7a3d99b400a745 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 2100000 + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 156513 + packageName: All In 1 Sprite Shader + packageVersion: 4.25 + assetPath: Assets/Plugins/AllIn1SpriteShader/Demo/Materials/Color Ramp Gradient.mat + uploadId: 708810 diff --git a/Assets/Plugins/AllIn1SpriteShader/Demo/Materials/DemoGradient.mat b/Assets/Plugins/AllIn1SpriteShader/Demo/Materials/DemoGradient.mat new file mode 100644 index 000000000..d1162aed1 --- /dev/null +++ b/Assets/Plugins/AllIn1SpriteShader/Demo/Materials/DemoGradient.mat @@ -0,0 +1,275 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!21 &2100000 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: DemoGradient + m_Shader: {fileID: 4800000, guid: a36b7719ff0465b42ab1407d67672c5f, type: 3} + m_ShaderKeywords: ALPHAOUTLINE_ON COLORRAMP_ON ETC1_EXTERNAL_ALPHA GRADIENTCOLORRAMP_ON + HSV_ON OUTBASE8DIR_ON OUTBASE_ON _OUTLINE8DIRECTIONS_ON + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _ColorRampTex: + m_Texture: {fileID: 2800000, guid: 279657edc397ece4b8029c727adf6ddc, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ColorRampTexGradient: + m_Texture: {fileID: 28726713437276524} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ColorSwapTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DistortTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _FadeBurnTex: + m_Texture: {fileID: 2800000, guid: 677cca399782dea41aedc1d292ecb67d, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _FadeTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _GlowTex: + 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} + - _OutlineDistortTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OutlineTex: + m_Texture: {fileID: 2800000, guid: 74087f6d03f233e4a8a142fa01f9e5cf, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OverlayTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ShineMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - _Alpha: 1 + - _AlphaCutoffValue: 0.25 + - _AlphaOutlineBlend: 1 + - _AlphaOutlineGlow: 77.9 + - _AlphaOutlineMinAlpha: 0 + - _AlphaOutlinePower: 1 + - _AlphaRoundThreshold: 0.5 + - _BillboardY: 0 + - _BlurHD: 0 + - _BlurIntensity: 10 + - _Brightness: 0 + - _ChromAberrAlpha: 0.4 + - _ChromAberrAmount: 1 + - _ClipUvDown: 0 + - _ClipUvLeft: 0 + - _ClipUvRight: 0 + - _ClipUvUp: 0 + - _ColorChangeLuminosity: 0 + - _ColorChangeTolerance: 0.25 + - _ColorChangeTolerance2: 0.25 + - _ColorChangeTolerance3: 0.25 + - _ColorRampBlend: 1 + - _ColorRampLuminosity: 0 + - _ColorRampOutline: 0 + - _ColorSwapBlend: 1 + - _ColorSwapBlueLuminosity: 0.5 + - _ColorSwapGreenLuminosity: 0.5 + - _ColorSwapRedLuminosity: 0.5 + - _Contrast: 1 + - _DistortAmount: 0.5 + - _DistortTexXSpeed: 5 + - _DistortTexYSpeed: 5 + - _FadeAmount: -0.1 + - _FadeBurnGlow: 2 + - _FadeBurnTransition: 0.075 + - _FadeBurnWidth: 0.025 + - _FishEyeUvAmount: 0.35 + - _FlickerAlpha: 0 + - _FlickerFreq: 0.2 + - _FlickerPercent: 0.05 + - _GhostBlend: 0 + - _GhostColorBoost: 1 + - _GhostTransparency: 0 + - _GlitchAmount: 3 + - _GlitchSize: 1 + - _Glow: 10 + - _GlowTexUsed: 0 + - _GradBlend: 1 + - _GradBoostX: 1.2 + - _GradBoostY: 1.2 + - _GradIsRadial: 0 + - _GrassManualAnim: 1 + - _GrassManualToggle: 0 + - _GrassRadialBend: 0.1 + - _GrassSpeed: 2 + - _GrassWind: 20 + - _GreyscaleBlend: 1 + - _GreyscaleLuminosity: 0 + - _GreyscaleOutline: 0 + - _HandDrawnAmount: 12.2 + - _HandDrawnSpeed: 5 + - _HitEffectBlend: 1 + - _HitEffectGlow: 5 + - _HologramBlend: 1 + - _HologramMaxAlpha: 0.75 + - _HologramMinAlpha: 0.1 + - _HologramStripesAmount: 0.1 + - _HologramStripesSpeed: 4.5 + - _HologramUnmodAmount: 0 + - _HsvBright: 0.97 + - _HsvSaturation: 1.3 + - _HsvShift: 180 + - _InnerOutlineAlpha: 1 + - _InnerOutlineGlow: 4 + - _InnerOutlineThickness: 1 + - _MaxXUV: 1 + - _MaxYUV: 1 + - _MinXUV: 0 + - _MinYUV: 0 + - _MotionBlurAngle: 0.1 + - _MotionBlurDist: 1.25 + - _MyDstMode: 10 + - _MySrcMode: 5 + - _NegativeAmount: 1 + - _OffsetUvX: 0 + - _OffsetUvY: 0 + - _OnlyInnerOutline: 0 + - _OnlyOutline: 0 + - _Outline8Directions: 1 + - _OutlineAlpha: 1 + - _OutlineDistortAmount: 0.5 + - _OutlineDistortTexXSpeed: 5 + - _OutlineDistortTexYSpeed: 5 + - _OutlineDistortToggle: 0 + - _OutlineGlow: 6 + - _OutlineIsPixel: 0 + - _OutlinePixelWidth: 1 + - _OutlineTexGrey: 0 + - _OutlineTexToggle: 0 + - _OutlineTexXSpeed: 10 + - _OutlineTexYSpeed: 0 + - _OutlineWidth: 0.037 + - _OverlayBlend: 1 + - _OverlayGlow: 1 + - _PinchUvAmount: 0.35 + - _PixelateSize: 32 + - _PosterizeGamma: 0.75 + - _PosterizeNumColors: 8 + - _PosterizeOutline: 0 + - _RandomSeed: 0 + - _RectSize: 1 + - _RotateUvAmount: 0 + - _RoundWaveSpeed: 2 + - _RoundWaveStrength: 0.7 + - _ShadowAlpha: 0.5 + - _ShadowX: 0.1 + - _ShadowY: -0.05 + - _ShakeUvSpeed: 0.2 + - _ShakeUvX: 1.5 + - _ShakeUvY: 1 + - _ShineGlow: 1 + - _ShineLocation: 0.5 + - _ShineRotate: 0 + - _ShineWidth: 0.1 + - _TextureScrollXSpeed: 1 + - _TextureScrollYSpeed: 0 + - _TwistUvAmount: 1 + - _TwistUvPosX: 0.5 + - _TwistUvPosY: 0.5 + - _TwistUvRadius: 0.75 + - _WaveAmount: 7 + - _WaveSpeed: 10 + - _WaveStrength: 7.5 + - _WaveX: 0 + - _WaveY: 0.5 + - _ZTestMode: 4 + - _ZWrite: 0 + - _ZoomUvAmount: 0.5 + m_Colors: + - _AlphaOutlineColor: {r: 0.66800976, g: 0, b: 1, a: 1} + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _ColorChangeNewCol: {r: 1, g: 1, b: 0, a: 1} + - _ColorChangeNewCol2: {r: 1, g: 1, b: 0, a: 1} + - _ColorChangeNewCol3: {r: 1, g: 1, b: 0, a: 1} + - _ColorChangeTarget: {r: 0.7803922, g: 0.3137255, b: 0.94117653, a: 1} + - _ColorChangeTarget2: {r: 1, g: 0, b: 0, a: 1} + - _ColorChangeTarget3: {r: 1, g: 0, b: 0, a: 1} + - _ColorSwapBlue: {r: 1, g: 1, b: 1, a: 1} + - _ColorSwapGreen: {r: 1, g: 1, b: 1, a: 1} + - _ColorSwapRed: {r: 1, g: 1, b: 1, a: 1} + - _FadeBurnColor: {r: 1, g: 1, b: 0, a: 1} + - _GlowColor: {r: 1, g: 1, b: 1, a: 1} + - _GradBotLeftCol: {r: 0, g: 0, b: 1, a: 1} + - _GradBotRightCol: {r: 0, g: 0, b: 1, a: 1} + - _GradTopLeftCol: {r: 1, g: 0, b: 0, a: 1} + - _GradTopRightCol: {r: 1, g: 0, b: 0, a: 1} + - _GreyscaleTintColor: {r: 1, g: 1, b: 1, a: 1} + - _HitEffectColor: {r: 1, g: 1, b: 1, a: 1} + - _HologramStripeColor: {r: 0, g: 1, b: 1, a: 1} + - _InnerOutlineColor: {r: 1, g: 0, b: 0, a: 1} + - _OutlineColor: {r: 0, g: 0.6425381, b: 1, a: 1} + - _OverlayColor: {r: 1, g: 1, b: 1, a: 1} + - _ShadowColor: {r: 0, g: 0, b: 0, a: 1} + - _ShineColor: {r: 1, g: 1, b: 1, a: 1} +--- !u!28 &28726713437276524 +Texture2D: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: z_ColorRampTexGradientTex{"mode":0,"colorKeys":[{"color":{"r":0.0,"g":0.0815119743347168,"b":1.0,"a":1.0},"time":0.0},{"color":{"r":0.3421383202075958,"g":0.0,"b":0.6415094137191773,"a":1.0},"time":0.24681468307971955},{"color":{"r":0.778521716594696,"g":0.5283018946647644,"b":1.0,"a":1.0},"time":0.4923628568649292},{"color":{"r":1.0,"g":0.2666666507720947,"b":0.8437959551811218,"a":1.0},"time":0.7340962886810303},{"color":{"r":0.13333332538604737,"g":0.21844977140426637,"b":1.0,"a":1.0},"time":0.8664072751998901},{"color":{"r":0.0,"g":0.9796860218048096,"b":1.0,"a":1.0},"time":1.0}],"alphaKeys":[{"alpha":1.0,"time":0.0},{"alpha":1.0,"time":1.0}]} + m_ImageContentsHash: + serializedVersion: 2 + Hash: 00000000000000000000000000000000 + m_ForcedFallbackFormat: 4 + m_DownscaleFallback: 0 + serializedVersion: 2 + m_Width: 64 + m_Height: 1 + m_CompleteImageSize: 256 + m_TextureFormat: 4 + m_MipCount: 1 + m_IsReadable: 1 + m_StreamingMipmaps: 0 + m_StreamingMipmapsPriority: 0 + m_AlphaIsTransparency: 0 + m_ImageCount: 1 + m_TextureDimension: 2 + m_TextureSettings: + serializedVersion: 2 + m_FilterMode: 1 + m_Aniso: 1 + m_MipBias: 0 + m_WrapU: 1 + m_WrapV: 1 + m_WrapW: 1 + m_LightmapFormat: 0 + m_ColorSpace: 1 + image data: 256 + _typelessdata: 0015ffff0613f9ff0b12f3ff1111edff160fe7ff1c0ee2ff220ddcff270bd6ff2d0ad0ff3209caff3807c4ff3e06beff4305b8ff4903b3ff4f02adff5401a7ff5a04a6ff620dacff6915b2ff701eb8ff7727beff7e2fc4ff8638caff8d41d0ff944ad6ff9b52dbffa25be1ffaa64e7ffb16cedffb875f3ffbf7ef9ffc687ffffca82fcffce7efaffd27af7ffd575f5ffd971f2ffdd6defffe068edffe464eaffe85fe8ffec5be5ffef57e2fff352e0fff74eddfffa49dafffe45d8ffeb43dbffd141e0ffb640e4ff9c3ee9ff813deeff663cf3ff4c3af7ff3139fcff2041ffff1c58ffff186fffff1486ffff109effff0cb5ffff08ccffff04e3ffff00faffff + m_StreamData: + offset: 0 + size: 0 + path: diff --git a/Assets/Plugins/AllIn1SpriteShader/Demo/Materials/DemoGradient.mat.meta b/Assets/Plugins/AllIn1SpriteShader/Demo/Materials/DemoGradient.mat.meta new file mode 100644 index 000000000..dc0fd19a7 --- /dev/null +++ b/Assets/Plugins/AllIn1SpriteShader/Demo/Materials/DemoGradient.mat.meta @@ -0,0 +1,15 @@ +fileFormatVersion: 2 +guid: 473fd0e814452c4488d6794c3f24dff1 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 2100000 + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 156513 + packageName: All In 1 Sprite Shader + packageVersion: 4.25 + assetPath: Assets/Plugins/AllIn1SpriteShader/Demo/Materials/DemoGradient.mat + uploadId: 708810 diff --git a/Assets/Plugins/AllIn1SpriteShader/Demo/Materials/Fire.mat b/Assets/Plugins/AllIn1SpriteShader/Demo/Materials/Fire.mat new file mode 100644 index 000000000..2c377e9c1 --- /dev/null +++ b/Assets/Plugins/AllIn1SpriteShader/Demo/Materials/Fire.mat @@ -0,0 +1,188 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!21 &2100000 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: Fire + m_Shader: {fileID: 4800000, guid: a36b7719ff0465b42ab1407d67672c5f, type: 3} + m_ShaderKeywords: ETC1_EXTERNAL_ALPHA FADE_ON GLOWTEX_ON GLOW_ON _GLOWTEXUSED_ON + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _ColorRampTex: + m_Texture: {fileID: 2800000, guid: 279657edc397ece4b8029c727adf6ddc, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ColorSwapTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DistortTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _FadeBurnTex: + m_Texture: {fileID: 2800000, guid: 677cca399782dea41aedc1d292ecb67d, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _FadeTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _GlowTex: + m_Texture: {fileID: 2800000, guid: 487cb2374bc49b848a1f4577212201cc, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MainTex: + m_Texture: {fileID: 2800000, guid: be304275dbf36014ca9828884588ac47, type: 3} + m_Scale: {x: 0.6, y: 0.6} + m_Offset: {x: 0, y: 0} + - _OutlineDistortTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OutlineTex: + m_Texture: {fileID: 2800000, guid: 74087f6d03f233e4a8a142fa01f9e5cf, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - _Alpha: 0.488 + - _AlphaCutoffValue: 0.25 + - _BillboardY: 0 + - _BlurHD: 0 + - _BlurIntensity: 10 + - _ChromAberrAlpha: 0.4 + - _ChromAberrAmount: 1 + - _ClipUvDown: 0 + - _ClipUvLeft: 0 + - _ClipUvRight: 0 + - _ClipUvUp: 0 + - _ColorChangeLuminosity: 0 + - _ColorChangeTolerance: 0.25 + - _ColorRampLuminosity: 0 + - _ColorRampOutline: 0 + - _ColorSwapBlueLuminosity: 0.5 + - _ColorSwapGreenLuminosity: 0.5 + - _ColorSwapRedLuminosity: 0.5 + - _DistortAmount: 0.5 + - _DistortTexXSpeed: 5 + - _DistortTexYSpeed: 5 + - _FadeAmount: -0.1 + - _FadeBurnGlow: 2 + - _FadeBurnTransition: 0.075 + - _FadeBurnWidth: 0.025 + - _FishEyeUvAmount: 0.35 + - _FlickerAlpha: 0 + - _FlickerFreq: 0.2 + - _FlickerPercent: 0.05 + - _GhostColorBoost: 1 + - _GhostTransparency: 0 + - _GlitchAmount: 3 + - _Glow: 30 + - _GlowTexUsed: 1 + - _GradBlend: 1 + - _GrassManualAnim: 1 + - _GrassManualToggle: 0 + - _GrassSpeed: 2 + - _GrassWind: 20 + - _GreyscaleLuminosity: 0 + - _GreyscaleOutline: 0 + - _HandDrawnAmount: 10 + - _HandDrawnSpeed: 5 + - _HitEffectBlend: 1 + - _HitEffectGlow: 5 + - _HologramFlickerAlpha: 0 + - _HologramFlickerFreq: 0.2 + - _HologramStripesAlpha: 0.4 + - _HologramStripesAmount: 50 + - _HologramStripesFill: 0.4 + - _HologramStripesLuminosity: 1 + - _HologramStripesSpeed: 5 + - _HsvBright: 1 + - _HsvSaturation: 1 + - _HsvShift: 180 + - _InnerOutlineAlpha: 1 + - _InnerOutlineGlow: 1 + - _InnerOutlineThickness: 1 + - _MaxXUV: 1 + - _MaxYUV: 1 + - _MinXUV: 0 + - _MinYUV: 0 + - _MotionBlurAngle: 0.1 + - _MotionBlurDist: 1.25 + - _MyDstMode: 10 + - _MySrcMode: 5 + - _NegativeAmount: 1 + - _OffsetUvX: 0 + - _OffsetUvY: 0 + - _Outline8Directions: 0 + - _OutlineAlpha: 1 + - _OutlineDistortAmount: 0.5 + - _OutlineDistortTexXSpeed: 5 + - _OutlineDistortTexYSpeed: 5 + - _OutlineDistortToggle: 0 + - _OutlineGlow: 1.5 + - _OutlineIsPixel: 0 + - _OutlinePixelWidth: 1 + - _OutlineTexGrey: 0 + - _OutlineTexToggle: 0 + - _OutlineTexXSpeed: 10 + - _OutlineTexYSpeed: 0 + - _OutlineWidth: 0.004 + - _PinchUvAmount: 0.35 + - _PixelateSize: 32 + - _PosterizeGamma: 0.75 + - _PosterizeNumColors: 8 + - _PosterizeOutline: 0 + - _RandomSeed: 0 + - _RectSize: 1 + - _RotateUvAmount: 0 + - _RoundWaveSpeed: 2 + - _RoundWaveStrength: 0.7 + - _ShadowAlpha: 0.5 + - _ShadowX: 0.1 + - _ShadowY: -0.05 + - _ShakeUvSpeed: 2.5 + - _ShakeUvX: 1.5 + - _ShakeUvY: 1 + - _TextureScrollXSpeed: 0.1 + - _TextureScrollYSpeed: 0.1 + - _TwistUvAmount: 1 + - _TwistUvPosX: 0.5 + - _TwistUvPosY: 0.5 + - _TwistUvRadius: 0.75 + - _WaveAmount: 7 + - _WaveSpeed: 10 + - _WaveStrength: 7.5 + - _WaveX: 0 + - _WaveY: 0.5 + - _ZWrite: 0 + - _ZoomUvAmount: 0.5 + m_Colors: + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _ColorChangeNewCol: {r: 1, g: 1, b: 0, a: 1} + - _ColorChangeTarget: {r: 1, g: 0, b: 0, a: 1} + - _ColorSwapBlue: {r: 1, g: 1, b: 1, a: 1} + - _ColorSwapGreen: {r: 1, g: 1, b: 1, a: 1} + - _ColorSwapRed: {r: 1, g: 1, b: 1, a: 1} + - _FadeBurnColor: {r: 1, g: 1, b: 0, a: 1} + - _GlowColor: {r: 1, g: 0.5103101, b: 0, a: 1} + - _GradBotLeftCol: {r: 0, g: 0, b: 1, a: 1} + - _GradBotRightCol: {r: 0, g: 0, b: 1, a: 1} + - _GradTopLeftCol: {r: 1, g: 0, b: 0, a: 1} + - _GradTopRightCol: {r: 1, g: 0, b: 0, a: 1} + - _GreyscaleTintColor: {r: 1, g: 1, b: 1, a: 1} + - _HitEffectColor: {r: 1, g: 1, b: 1, a: 1} + - _InnerOutlineColor: {r: 1, g: 0, b: 0, a: 1} + - _OutlineColor: {r: 1, g: 1, b: 1, a: 1} + - _ShadowColor: {r: 0, g: 0, b: 0, a: 1} diff --git a/Assets/Plugins/AllIn1SpriteShader/Demo/Materials/Fire.mat.meta b/Assets/Plugins/AllIn1SpriteShader/Demo/Materials/Fire.mat.meta new file mode 100644 index 000000000..c840dace4 --- /dev/null +++ b/Assets/Plugins/AllIn1SpriteShader/Demo/Materials/Fire.mat.meta @@ -0,0 +1,15 @@ +fileFormatVersion: 2 +guid: a186aad8f5f9dd04d910c7e3174834c0 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 2100000 + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 156513 + packageName: All In 1 Sprite Shader + packageVersion: 4.25 + assetPath: Assets/Plugins/AllIn1SpriteShader/Demo/Materials/Fire.mat + uploadId: 708810 diff --git a/Assets/Plugins/AllIn1SpriteShader/Demo/Materials/FireSoldier.mat b/Assets/Plugins/AllIn1SpriteShader/Demo/Materials/FireSoldier.mat new file mode 100644 index 000000000..f1c827021 --- /dev/null +++ b/Assets/Plugins/AllIn1SpriteShader/Demo/Materials/FireSoldier.mat @@ -0,0 +1,189 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!21 &2100000 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: FireSoldier + m_Shader: {fileID: 4800000, guid: a36b7719ff0465b42ab1407d67672c5f, type: 3} + m_ShaderKeywords: ETC1_EXTERNAL_ALPHA GLOWTEX_ON OUTBASE8DIR_ON OUTBASE_ON _GLOWTEXUSED_ON + _OUTLINE8DIRECTIONS_ON + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _ColorRampTex: + m_Texture: {fileID: 2800000, guid: 279657edc397ece4b8029c727adf6ddc, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ColorSwapTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DistortTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _FadeBurnTex: + m_Texture: {fileID: 2800000, guid: 677cca399782dea41aedc1d292ecb67d, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _FadeTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _GlowTex: + m_Texture: {fileID: 2800000, guid: 8608ef90f91271745a17f7210fe1e7db, type: 3} + 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} + - _OutlineDistortTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OutlineTex: + m_Texture: {fileID: 2800000, guid: 74087f6d03f233e4a8a142fa01f9e5cf, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - _Alpha: 1 + - _AlphaCutoffValue: 0.25 + - _BillboardY: 0 + - _BlurHD: 0 + - _BlurIntensity: 10 + - _ChromAberrAlpha: 0.4 + - _ChromAberrAmount: 1 + - _ClipUvDown: 0 + - _ClipUvLeft: 0 + - _ClipUvRight: 0 + - _ClipUvUp: 0 + - _ColorChangeLuminosity: 0 + - _ColorChangeTolerance: 0.25 + - _ColorRampLuminosity: 0 + - _ColorRampOutline: 0 + - _ColorSwapBlueLuminosity: 0.5 + - _ColorSwapGreenLuminosity: 0.5 + - _ColorSwapRedLuminosity: 0.5 + - _DistortAmount: 0.5 + - _DistortTexXSpeed: 5 + - _DistortTexYSpeed: 5 + - _FadeAmount: -0.1 + - _FadeBurnGlow: 2 + - _FadeBurnTransition: 0.075 + - _FadeBurnWidth: 0.025 + - _FishEyeUvAmount: 0.35 + - _FlickerAlpha: 0 + - _FlickerFreq: 0.2 + - _FlickerPercent: 0.05 + - _GhostColorBoost: 1 + - _GhostTransparency: 0 + - _GlitchAmount: 3 + - _Glow: 8.5 + - _GlowTexUsed: 1 + - _GradBlend: 1 + - _GrassManualAnim: 1 + - _GrassManualToggle: 0 + - _GrassSpeed: 2 + - _GrassWind: 20 + - _GreyscaleLuminosity: 0 + - _GreyscaleOutline: 0 + - _HandDrawnAmount: 10 + - _HandDrawnSpeed: 5 + - _HitEffectBlend: 1 + - _HitEffectGlow: 5 + - _HologramFlickerAlpha: 0 + - _HologramFlickerFreq: 0.2 + - _HologramStripesAlpha: 0.4 + - _HologramStripesAmount: 50 + - _HologramStripesFill: 0.4 + - _HologramStripesLuminosity: 1 + - _HologramStripesSpeed: 5 + - _HsvBright: 1 + - _HsvSaturation: 2 + - _HsvShift: 151 + - _InnerOutlineAlpha: 1 + - _InnerOutlineGlow: 1 + - _InnerOutlineThickness: 1 + - _MaxXUV: 1 + - _MaxYUV: 1 + - _MinXUV: 0 + - _MinYUV: 0 + - _MotionBlurAngle: 0.1 + - _MotionBlurDist: 1.25 + - _MyDstMode: 10 + - _MySrcMode: 5 + - _NegativeAmount: 1 + - _OffsetUvX: 0 + - _OffsetUvY: 0 + - _Outline8Directions: 1 + - _OutlineAlpha: 1 + - _OutlineDistortAmount: 0.5 + - _OutlineDistortTexXSpeed: 5 + - _OutlineDistortTexYSpeed: 5 + - _OutlineDistortToggle: 0 + - _OutlineGlow: 5 + - _OutlineIsPixel: 0 + - _OutlinePixelWidth: 1 + - _OutlineTexGrey: 0 + - _OutlineTexToggle: 0 + - _OutlineTexXSpeed: 10 + - _OutlineTexYSpeed: 0 + - _OutlineWidth: 0.011 + - _PinchUvAmount: 0.35 + - _PixelateSize: 32 + - _PosterizeGamma: 0.75 + - _PosterizeNumColors: 8 + - _PosterizeOutline: 0 + - _RandomSeed: 0 + - _RectSize: 1 + - _RotateUvAmount: 0 + - _RoundWaveSpeed: 2 + - _RoundWaveStrength: 0.7 + - _ShadowAlpha: 0.5 + - _ShadowX: 0.1 + - _ShadowY: -0.05 + - _ShakeUvSpeed: 2.5 + - _ShakeUvX: 1.5 + - _ShakeUvY: 1 + - _TextureScrollXSpeed: 1 + - _TextureScrollYSpeed: 0 + - _TwistUvAmount: 1 + - _TwistUvPosX: 0.5 + - _TwistUvPosY: 0.5 + - _TwistUvRadius: 0.75 + - _WaveAmount: 7 + - _WaveSpeed: 10 + - _WaveStrength: 7.5 + - _WaveX: 0 + - _WaveY: 0.5 + - _ZWrite: 0 + - _ZoomUvAmount: 0.5 + m_Colors: + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _ColorChangeNewCol: {r: 1, g: 1, b: 0, a: 1} + - _ColorChangeTarget: {r: 1, g: 0, b: 0, a: 1} + - _ColorSwapBlue: {r: 1, g: 1, b: 1, a: 1} + - _ColorSwapGreen: {r: 1, g: 1, b: 1, a: 1} + - _ColorSwapRed: {r: 1, g: 1, b: 1, a: 1} + - _FadeBurnColor: {r: 1, g: 1, b: 0, a: 1} + - _GlowColor: {r: 1, g: 0.9703183, b: 0, a: 1} + - _GradBotLeftCol: {r: 0, g: 0, b: 1, a: 1} + - _GradBotRightCol: {r: 0, g: 0, b: 1, a: 1} + - _GradTopLeftCol: {r: 1, g: 0, b: 0, a: 1} + - _GradTopRightCol: {r: 1, g: 0, b: 0, a: 1} + - _GreyscaleTintColor: {r: 1, g: 1, b: 1, a: 1} + - _HitEffectColor: {r: 1, g: 1, b: 1, a: 1} + - _InnerOutlineColor: {r: 1, g: 0, b: 0, a: 1} + - _OutlineColor: {r: 1, g: 0.29168093, b: 0, a: 1} + - _ShadowColor: {r: 0, g: 0, b: 0, a: 1} diff --git a/Assets/Plugins/AllIn1SpriteShader/Demo/Materials/FireSoldier.mat.meta b/Assets/Plugins/AllIn1SpriteShader/Demo/Materials/FireSoldier.mat.meta new file mode 100644 index 000000000..793178401 --- /dev/null +++ b/Assets/Plugins/AllIn1SpriteShader/Demo/Materials/FireSoldier.mat.meta @@ -0,0 +1,15 @@ +fileFormatVersion: 2 +guid: cd0693e274874cc4f8ffd67a41ebe801 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 2100000 + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 156513 + packageName: All In 1 Sprite Shader + packageVersion: 4.25 + assetPath: Assets/Plugins/AllIn1SpriteShader/Demo/Materials/FireSoldier.mat + uploadId: 708810 diff --git a/Assets/Plugins/AllIn1SpriteShader/Demo/Materials/Ice.mat b/Assets/Plugins/AllIn1SpriteShader/Demo/Materials/Ice.mat new file mode 100644 index 000000000..19dda0651 --- /dev/null +++ b/Assets/Plugins/AllIn1SpriteShader/Demo/Materials/Ice.mat @@ -0,0 +1,188 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!21 &2100000 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: Ice + m_Shader: {fileID: 4800000, guid: a36b7719ff0465b42ab1407d67672c5f, type: 3} + m_ShaderKeywords: ETC1_EXTERNAL_ALPHA FADE_ON GLOW_ON + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _ColorRampTex: + m_Texture: {fileID: 2800000, guid: 279657edc397ece4b8029c727adf6ddc, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ColorSwapTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DistortTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _FadeBurnTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _FadeTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _GlowTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MainTex: + m_Texture: {fileID: 0} + m_Scale: {x: 0.5, y: 0.5} + m_Offset: {x: 0, y: 0} + - _OutlineDistortTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OutlineTex: + m_Texture: {fileID: 2800000, guid: 74087f6d03f233e4a8a142fa01f9e5cf, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - _Alpha: 0.55 + - _AlphaCutoffValue: 0.25 + - _BillboardY: 0 + - _BlurHD: 0 + - _BlurIntensity: 10 + - _ChromAberrAlpha: 0.4 + - _ChromAberrAmount: 1 + - _ClipUvDown: 0 + - _ClipUvLeft: 0 + - _ClipUvRight: 0 + - _ClipUvUp: 0 + - _ColorChangeLuminosity: 0 + - _ColorChangeTolerance: 0.25 + - _ColorRampLuminosity: 0 + - _ColorRampOutline: 0 + - _ColorSwapBlueLuminosity: 0.5 + - _ColorSwapGreenLuminosity: 0.5 + - _ColorSwapRedLuminosity: 0.5 + - _DistortAmount: 0.5 + - _DistortTexXSpeed: 5 + - _DistortTexYSpeed: 5 + - _FadeAmount: -0.1 + - _FadeBurnGlow: 1.5 + - _FadeBurnTransition: 0.075 + - _FadeBurnWidth: 0.056 + - _FishEyeUvAmount: 0.35 + - _FlickerAlpha: 0 + - _FlickerFreq: 0.2 + - _FlickerPercent: 0.05 + - _GhostColorBoost: 1 + - _GhostTransparency: 0 + - _GlitchAmount: 3 + - _Glow: 0.6 + - _GlowTexUsed: 0 + - _GradBlend: 1 + - _GrassManualAnim: 1 + - _GrassManualToggle: 0 + - _GrassSpeed: 2 + - _GrassWind: 20 + - _GreyscaleLuminosity: 0 + - _GreyscaleOutline: 0 + - _HandDrawnAmount: 10 + - _HandDrawnSpeed: 5 + - _HitEffectBlend: 1 + - _HitEffectGlow: 5 + - _HologramFlickerAlpha: 0 + - _HologramFlickerFreq: 0.2 + - _HologramStripesAlpha: 0.4 + - _HologramStripesAmount: 50 + - _HologramStripesFill: 0.4 + - _HologramStripesLuminosity: 1 + - _HologramStripesSpeed: 5 + - _HsvBright: 1 + - _HsvSaturation: 1 + - _HsvShift: 180 + - _InnerOutlineAlpha: 1 + - _InnerOutlineGlow: 1 + - _InnerOutlineThickness: 1 + - _MaxXUV: 1 + - _MaxYUV: 1 + - _MinXUV: 0 + - _MinYUV: 0 + - _MotionBlurAngle: 0.1 + - _MotionBlurDist: 1.25 + - _MyDstMode: 10 + - _MySrcMode: 5 + - _NegativeAmount: 1 + - _OffsetUvX: 0 + - _OffsetUvY: 0 + - _Outline8Directions: 0 + - _OutlineAlpha: 1 + - _OutlineDistortAmount: 0.5 + - _OutlineDistortTexXSpeed: 5 + - _OutlineDistortTexYSpeed: 5 + - _OutlineDistortToggle: 0 + - _OutlineGlow: 1.5 + - _OutlineIsPixel: 0 + - _OutlinePixelWidth: 1 + - _OutlineTexGrey: 0 + - _OutlineTexToggle: 0 + - _OutlineTexXSpeed: 10 + - _OutlineTexYSpeed: 0 + - _OutlineWidth: 0.004 + - _PinchUvAmount: 0.35 + - _PixelateSize: 32 + - _PosterizeGamma: 0.75 + - _PosterizeNumColors: 8 + - _PosterizeOutline: 0 + - _RandomSeed: 0 + - _RectSize: 1 + - _RotateUvAmount: 0 + - _RoundWaveSpeed: 2 + - _RoundWaveStrength: 0.7 + - _ShadowAlpha: 0.5 + - _ShadowX: 0.1 + - _ShadowY: -0.05 + - _ShakeUvSpeed: 2.5 + - _ShakeUvX: 1.5 + - _ShakeUvY: 1 + - _TextureScrollXSpeed: 1 + - _TextureScrollYSpeed: 0 + - _TwistUvAmount: 1 + - _TwistUvPosX: 0.5 + - _TwistUvPosY: 0.5 + - _TwistUvRadius: 0.75 + - _WaveAmount: 7 + - _WaveSpeed: 10 + - _WaveStrength: 7.5 + - _WaveX: 0 + - _WaveY: 0.5 + - _ZWrite: 0 + - _ZoomUvAmount: 0.5 + m_Colors: + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _ColorChangeNewCol: {r: 1, g: 1, b: 0, a: 1} + - _ColorChangeTarget: {r: 1, g: 0, b: 0, a: 1} + - _ColorSwapBlue: {r: 1, g: 1, b: 1, a: 1} + - _ColorSwapGreen: {r: 1, g: 1, b: 1, a: 1} + - _ColorSwapRed: {r: 1, g: 1, b: 1, a: 1} + - _FadeBurnColor: {r: 0, g: 0.9150943, b: 0.8972679, a: 1} + - _GlowColor: {r: 1, g: 1, b: 1, a: 1} + - _GradBotLeftCol: {r: 0, g: 0, b: 1, a: 1} + - _GradBotRightCol: {r: 0, g: 0, b: 1, a: 1} + - _GradTopLeftCol: {r: 1, g: 0, b: 0, a: 1} + - _GradTopRightCol: {r: 1, g: 0, b: 0, a: 1} + - _GreyscaleTintColor: {r: 1, g: 1, b: 1, a: 1} + - _HitEffectColor: {r: 1, g: 1, b: 1, a: 1} + - _InnerOutlineColor: {r: 1, g: 0, b: 0, a: 1} + - _OutlineColor: {r: 1, g: 1, b: 1, a: 1} + - _ShadowColor: {r: 0, g: 0, b: 0, a: 1} diff --git a/Assets/Plugins/AllIn1SpriteShader/Demo/Materials/Ice.mat.meta b/Assets/Plugins/AllIn1SpriteShader/Demo/Materials/Ice.mat.meta new file mode 100644 index 000000000..f2578e7bc --- /dev/null +++ b/Assets/Plugins/AllIn1SpriteShader/Demo/Materials/Ice.mat.meta @@ -0,0 +1,15 @@ +fileFormatVersion: 2 +guid: e4599046180b0ac49b3df99ab01b3e27 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 2100000 + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 156513 + packageName: All In 1 Sprite Shader + packageVersion: 4.25 + assetPath: Assets/Plugins/AllIn1SpriteShader/Demo/Materials/Ice.mat + uploadId: 708810 diff --git a/Assets/Plugins/AllIn1SpriteShader/Demo/Materials/IceSoldier.mat b/Assets/Plugins/AllIn1SpriteShader/Demo/Materials/IceSoldier.mat new file mode 100644 index 000000000..beb4473d0 --- /dev/null +++ b/Assets/Plugins/AllIn1SpriteShader/Demo/Materials/IceSoldier.mat @@ -0,0 +1,209 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!21 &2100000 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: IceSoldier + m_Shader: {fileID: 4800000, guid: a36b7719ff0465b42ab1407d67672c5f, type: 3} + m_ShaderKeywords: ETC1_EXTERNAL_ALPHA GLOWTEX_ON GLOW_ON HSV_ON OUTBASE8DIR_ON OUTBASE_ON + _GLOWTEXUSED_ON _OUTLINE8DIRECTIONS_ON + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _ColorRampTex: + m_Texture: {fileID: 2800000, guid: 279657edc397ece4b8029c727adf6ddc, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ColorSwapTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DistortTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _FadeBurnTex: + m_Texture: {fileID: 2800000, guid: 677cca399782dea41aedc1d292ecb67d, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _FadeTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _GlowTex: + m_Texture: {fileID: 2800000, guid: 8608ef90f91271745a17f7210fe1e7db, type: 3} + 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} + - _OutlineDistortTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OutlineTex: + m_Texture: {fileID: 2800000, guid: 74087f6d03f233e4a8a142fa01f9e5cf, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ShineMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - _Alpha: 1 + - _AlphaCutoffValue: 0.25 + - _BillboardY: 0 + - _BlurHD: 0 + - _BlurIntensity: 10 + - _ChromAberrAlpha: 0.4 + - _ChromAberrAmount: 1 + - _ClipUvDown: 0 + - _ClipUvLeft: 0 + - _ClipUvRight: 0 + - _ClipUvUp: 0 + - _ColorChangeLuminosity: 0 + - _ColorChangeTolerance: 0.25 + - _ColorRampLuminosity: 0 + - _ColorRampOutline: 0 + - _ColorSwapBlueLuminosity: 0.5 + - _ColorSwapGreenLuminosity: 0.5 + - _ColorSwapRedLuminosity: 0.5 + - _DistortAmount: 0.5 + - _DistortTexXSpeed: 5 + - _DistortTexYSpeed: 5 + - _FadeAmount: -0.1 + - _FadeBurnGlow: 2 + - _FadeBurnTransition: 0.075 + - _FadeBurnWidth: 0.025 + - _FishEyeUvAmount: 0.35 + - _FlickerAlpha: 0 + - _FlickerFreq: 0.2 + - _FlickerPercent: 0.05 + - _GhostColorBoost: 1 + - _GhostTransparency: 0 + - _GlitchAmount: 3 + - _GlitchSize: 1 + - _Glow: 4.5 + - _GlowTexUsed: 1 + - _GradBlend: 1 + - _GradBoostX: 1.2 + - _GradBoostY: 1.2 + - _GradIsRadial: 0 + - _GrassManualAnim: 1 + - _GrassManualToggle: 0 + - _GrassSpeed: 2 + - _GrassWind: 20 + - _GreyscaleLuminosity: 0 + - _GreyscaleOutline: 0 + - _HandDrawnAmount: 10 + - _HandDrawnSpeed: 5 + - _HitEffectBlend: 1 + - _HitEffectGlow: 5 + - _HologramFlickerAlpha: 0 + - _HologramFlickerFreq: 0.2 + - _HologramMaxAlpha: 0.75 + - _HologramMinAlpha: 0.1 + - _HologramStripesAlpha: 0.4 + - _HologramStripesAmount: 50 + - _HologramStripesFill: 0.4 + - _HologramStripesLuminosity: 1 + - _HologramStripesSpeed: 5 + - _HologramUnmodAmount: 0 + - _HsvBright: 1 + - _HsvSaturation: 1.62 + - _HsvShift: 271 + - _InnerOutlineAlpha: 1 + - _InnerOutlineGlow: 1 + - _InnerOutlineThickness: 1 + - _MaxXUV: 1 + - _MaxYUV: 1 + - _MinXUV: 0 + - _MinYUV: 0 + - _MotionBlurAngle: 0.1 + - _MotionBlurDist: 1.25 + - _MyDstMode: 10 + - _MySrcMode: 5 + - _NegativeAmount: 1 + - _OffsetUvX: 0 + - _OffsetUvY: 0 + - _OnlyInnerOutline: 0 + - _OnlyOutline: 0 + - _Outline8Directions: 1 + - _OutlineAlpha: 1 + - _OutlineDistortAmount: 0.5 + - _OutlineDistortTexXSpeed: 5 + - _OutlineDistortTexYSpeed: 5 + - _OutlineDistortToggle: 0 + - _OutlineGlow: 2.5 + - _OutlineIsPixel: 0 + - _OutlinePixelWidth: 1 + - _OutlineTexGrey: 0 + - _OutlineTexToggle: 0 + - _OutlineTexXSpeed: 10 + - _OutlineTexYSpeed: 0 + - _OutlineWidth: 0.018 + - _PinchUvAmount: 0.35 + - _PixelateSize: 32 + - _PosterizeGamma: 0.75 + - _PosterizeNumColors: 8 + - _PosterizeOutline: 0 + - _RandomSeed: 0 + - _RectSize: 1 + - _RotateUvAmount: 0 + - _RoundWaveSpeed: 2 + - _RoundWaveStrength: 0.7 + - _ShadowAlpha: 0.5 + - _ShadowX: 0.1 + - _ShadowY: -0.05 + - _ShakeUvSpeed: 2.5 + - _ShakeUvX: 1.5 + - _ShakeUvY: 1 + - _ShineGlow: 1 + - _ShineLocation: 0.5 + - _ShineRotate: 0 + - _ShineWidth: 0.1 + - _TextureScrollXSpeed: 1 + - _TextureScrollYSpeed: 0 + - _TwistUvAmount: 1 + - _TwistUvPosX: 0.5 + - _TwistUvPosY: 0.5 + - _TwistUvRadius: 0.75 + - _WaveAmount: 7 + - _WaveSpeed: 10 + - _WaveStrength: 7.5 + - _WaveX: 0 + - _WaveY: 0.5 + - _ZTestMode: 4 + - _ZWrite: 0 + - _ZoomUvAmount: 0.5 + m_Colors: + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _ColorChangeNewCol: {r: 1, g: 1, b: 0, a: 1} + - _ColorChangeTarget: {r: 1, g: 0, b: 0, a: 1} + - _ColorSwapBlue: {r: 1, g: 1, b: 1, a: 1} + - _ColorSwapGreen: {r: 1, g: 1, b: 1, a: 1} + - _ColorSwapRed: {r: 1, g: 1, b: 1, a: 1} + - _FadeBurnColor: {r: 1, g: 1, b: 0, a: 1} + - _GlowColor: {r: 0.09103775, g: 1, b: 0, a: 1} + - _GradBotLeftCol: {r: 0, g: 0, b: 1, a: 1} + - _GradBotRightCol: {r: 0, g: 0, b: 1, a: 1} + - _GradTopLeftCol: {r: 1, g: 0, b: 0, a: 1} + - _GradTopRightCol: {r: 1, g: 0, b: 0, a: 1} + - _GreyscaleTintColor: {r: 1, g: 1, b: 1, a: 1} + - _HitEffectColor: {r: 1, g: 1, b: 1, a: 1} + - _HologramStripeColor: {r: 0, g: 1, b: 1, a: 1} + - _InnerOutlineColor: {r: 1, g: 0, b: 0, a: 1} + - _OutlineColor: {r: 0.06866193, g: 1, b: 0, a: 1} + - _ShadowColor: {r: 0, g: 0, b: 0, a: 1} + - _ShineColor: {r: 1, g: 1, b: 1, a: 1} diff --git a/Assets/Plugins/AllIn1SpriteShader/Demo/Materials/IceSoldier.mat.meta b/Assets/Plugins/AllIn1SpriteShader/Demo/Materials/IceSoldier.mat.meta new file mode 100644 index 000000000..f88468713 --- /dev/null +++ b/Assets/Plugins/AllIn1SpriteShader/Demo/Materials/IceSoldier.mat.meta @@ -0,0 +1,15 @@ +fileFormatVersion: 2 +guid: d27799974f79b894196aeeef8bac53af +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 2100000 + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 156513 + packageName: All In 1 Sprite Shader + packageVersion: 4.25 + assetPath: Assets/Plugins/AllIn1SpriteShader/Demo/Materials/IceSoldier.mat + uploadId: 708810 diff --git a/Assets/Plugins/AllIn1SpriteShader/Demo/Materials/LitFloor.mat b/Assets/Plugins/AllIn1SpriteShader/Demo/Materials/LitFloor.mat new file mode 100644 index 000000000..35a99a0f4 --- /dev/null +++ b/Assets/Plugins/AllIn1SpriteShader/Demo/Materials/LitFloor.mat @@ -0,0 +1,292 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!21 &2100000 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: LitFloor + m_Shader: {fileID: 4800000, guid: 86ce7e600deb17e429b8be445bb652f7, type: 3} + m_ShaderKeywords: + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _BumpMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ColorRampTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ColorRampTexGradient: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ColorSwapTex: + 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} + - _DistortTex: + 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} + - _FadeBurnTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _FadeTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _GlowTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MainTex: + m_Texture: {fileID: 2800000, guid: fd279c0d74378ff48b61c27ffc8873eb, type: 3} + m_Scale: {x: 8, y: 8} + 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: 2800000, guid: 47c3680e2892fa44b80abb6447b1a619, 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} + - _OutlineDistortTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OutlineTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OverlayTex: + 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} + - _ShineMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - _Alpha: 1 + - _AlphaCutoffValue: 0.25 + - _AlphaOutlineBlend: 1 + - _AlphaOutlineGlow: 5 + - _AlphaOutlineMinAlpha: 0 + - _AlphaOutlinePower: 1 + - _AlphaRoundThreshold: 0.5 + - _BillboardY: 0 + - _BlurHD: 0 + - _BlurIntensity: 10 + - _Brightness: 0 + - _BumpScale: 1 + - _ChromAberrAlpha: 0.4 + - _ChromAberrAmount: 1 + - _ClipUvDown: 0 + - _ClipUvLeft: 0 + - _ClipUvRight: 0 + - _ClipUvUp: 0 + - _ColorChangeLuminosity: 0 + - _ColorChangeTolerance: 0.25 + - _ColorChangeTolerance2: 0.25 + - _ColorChangeTolerance3: 0.25 + - _ColorRampBlend: 1 + - _ColorRampLuminosity: 0 + - _ColorRampOutline: 0 + - _ColorSwapBlend: 1 + - _ColorSwapBlueLuminosity: 0.5 + - _ColorSwapGreenLuminosity: 0.5 + - _ColorSwapRedLuminosity: 0.5 + - _Contrast: 1 + - _CullingOption: 0 + - _Cutoff: 0.5 + - _DetailNormalMapScale: 1 + - _DistortAmount: 0.5 + - _DistortTexXSpeed: 5 + - _DistortTexYSpeed: 5 + - _DstBlend: 0 + - _EditorDrawers: 6 + - _FadeAmount: -0.1 + - _FadeBurnGlow: 2 + - _FadeBurnTransition: 0.075 + - _FadeBurnWidth: 0.025 + - _FishEyeUvAmount: 0.35 + - _FlickerAlpha: 0 + - _FlickerFreq: 0.2 + - _FlickerPercent: 0.05 + - _GhostBlend: 1 + - _GhostColorBoost: 1 + - _GhostTransparency: 0 + - _GlitchAmount: 3 + - _GlitchSize: 1 + - _GlossMapScale: 1 + - _Glossiness: 0.5 + - _GlossyReflections: 1 + - _Glow: 10 + - _GlowGlobal: 1 + - _GradBlend: 1 + - _GradBoostX: 1.2 + - _GradBoostY: 1.2 + - _GradIsRadial: 0 + - _GrassManualAnim: 1 + - _GrassManualToggle: 0 + - _GrassRadialBend: 0.1 + - _GrassSpeed: 2 + - _GrassWind: 20 + - _GreyscaleBlend: 1 + - _GreyscaleLuminosity: 0 + - _GreyscaleOutline: 0 + - _HandDrawnAmount: 10 + - _HandDrawnSpeed: 5 + - _HitEffectBlend: 1 + - _HitEffectGlow: 5 + - _HologramBlend: 1 + - _HologramMaxAlpha: 0.75 + - _HologramMinAlpha: 0.1 + - _HologramStripesAmount: 0.1 + - _HologramStripesSpeed: 4.5 + - _HologramUnmodAmount: 0 + - _HsvBright: 1 + - _HsvSaturation: 1 + - _HsvShift: 180 + - _InnerOutlineAlpha: 1 + - _InnerOutlineGlow: 4 + - _InnerOutlineThickness: 1 + - _MaxXUV: 1 + - _MaxYUV: 1 + - _Metallic: 0 + - _MinXUV: 0 + - _MinYUV: 0 + - _Mode: 0 + - _MotionBlurAngle: 0.1 + - _MotionBlurDist: 1.25 + - _MyDstMode: 10 + - _MySrcMode: 5 + - _NegativeAmount: 1 + - _NormalStrength: 2.86 + - _OcclusionStrength: 1 + - _OffsetUvX: 0 + - _OffsetUvY: 0 + - _OnlyInnerOutline: 0 + - _OnlyOutline: 0 + - _OutlineAlpha: 1 + - _OutlineDistortAmount: 0.5 + - _OutlineDistortTexXSpeed: 5 + - _OutlineDistortTexYSpeed: 5 + - _OutlineGlow: 1.5 + - _OutlinePixelWidth: 1 + - _OutlineTexXSpeed: 10 + - _OutlineTexYSpeed: 0 + - _OutlineWidth: 0.004 + - _OverlayBlend: 1 + - _OverlayGlow: 1 + - _OverlayTextureScrollXSpeed: 0.25 + - _OverlayTextureScrollYSpeed: 0.25 + - _Parallax: 0.02 + - _PinchUvAmount: 0.35 + - _PixelateSize: 32 + - _PosterizeGamma: 0.75 + - _PosterizeNumColors: 8 + - _PosterizeOutline: 0 + - _RadialClip: 45 + - _RadialClip2: 0 + - _RadialStartAngle: 90 + - _RandomSeed: 0 + - _RectSize: 1 + - _RotateUvAmount: 0 + - _RoundWaveSpeed: 2 + - _RoundWaveStrength: 0.7 + - _ShadowAlpha: 0.5 + - _ShadowX: 0.1 + - _ShadowY: -0.05 + - _ShakeUvSpeed: 2.5 + - _ShakeUvX: 1.5 + - _ShakeUvY: 1 + - _ShineGlow: 1 + - _ShineLocation: 0.5 + - _ShineRotate: 0 + - _ShineWidth: 0.1 + - _SmoothnessTextureChannel: 0 + - _SpecularHighlights: 1 + - _SrcBlend: 1 + - _TextureScrollXSpeed: 1 + - _TextureScrollYSpeed: 0 + - _TwistUvAmount: 1 + - _TwistUvPosX: 0.5 + - _TwistUvPosY: 0.5 + - _TwistUvRadius: 0.75 + - _UVSec: 0 + - _WarpScale: 0.5 + - _WarpSpeed: 8 + - _WarpStrength: 0.025 + - _WaveAmount: 7 + - _WaveSpeed: 10 + - _WaveStrength: 7.5 + - _WaveX: 0 + - _WaveY: 0.5 + - _ZTestMode: 4 + - _ZWrite: 1 + - _ZoomUvAmount: 0.5 + m_Colors: + - _AlphaOutlineColor: {r: 1, g: 1, b: 1, a: 1} + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _ColorChangeNewCol: {r: 1, g: 1, b: 0, a: 1} + - _ColorChangeNewCol2: {r: 1, g: 1, b: 0, a: 1} + - _ColorChangeNewCol3: {r: 1, g: 1, b: 0, a: 1} + - _ColorChangeTarget: {r: 1, g: 0, b: 0, a: 1} + - _ColorChangeTarget2: {r: 1, g: 0, b: 0, a: 1} + - _ColorChangeTarget3: {r: 1, g: 0, b: 0, a: 1} + - _ColorSwapBlue: {r: 1, g: 1, b: 1, a: 1} + - _ColorSwapGreen: {r: 1, g: 1, b: 1, a: 1} + - _ColorSwapRed: {r: 1, g: 1, b: 1, a: 1} + - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} + - _FadeBurnColor: {r: 1, g: 1, b: 0, a: 1} + - _GlowColor: {r: 1, g: 1, b: 1, a: 1} + - _GradBotLeftCol: {r: 0, g: 0, b: 1, a: 1} + - _GradBotRightCol: {r: 0, g: 1, b: 0, a: 1} + - _GradTopLeftCol: {r: 1, g: 0, b: 0, a: 1} + - _GradTopRightCol: {r: 1, g: 1, b: 0, a: 1} + - _GreyscaleTintColor: {r: 1, g: 1, b: 1, a: 1} + - _HitEffectColor: {r: 1, g: 1, b: 1, a: 1} + - _HologramStripeColor: {r: 0, g: 1, b: 1, a: 1} + - _InnerOutlineColor: {r: 1, g: 0, b: 0, a: 1} + - _OutlineColor: {r: 1, g: 1, b: 1, a: 1} + - _OverlayColor: {r: 1, g: 1, b: 1, a: 1} + - _ShadowColor: {r: 0, g: 0, b: 0, a: 1} + - _ShineColor: {r: 1, g: 1, b: 1, a: 1} diff --git a/Assets/Plugins/AllIn1SpriteShader/Demo/Materials/LitFloor.mat.meta b/Assets/Plugins/AllIn1SpriteShader/Demo/Materials/LitFloor.mat.meta new file mode 100644 index 000000000..edd80a4ca --- /dev/null +++ b/Assets/Plugins/AllIn1SpriteShader/Demo/Materials/LitFloor.mat.meta @@ -0,0 +1,15 @@ +fileFormatVersion: 2 +guid: f967997c8b2ff004ebed845351a5449c +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 2100000 + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 156513 + packageName: All In 1 Sprite Shader + packageVersion: 4.25 + assetPath: Assets/Plugins/AllIn1SpriteShader/Demo/Materials/LitFloor.mat + uploadId: 708810 diff --git a/Assets/Plugins/AllIn1SpriteShader/Demo/Materials/LitSprite1.mat b/Assets/Plugins/AllIn1SpriteShader/Demo/Materials/LitSprite1.mat new file mode 100644 index 000000000..645310607 --- /dev/null +++ b/Assets/Plugins/AllIn1SpriteShader/Demo/Materials/LitSprite1.mat @@ -0,0 +1,245 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!21 &2100000 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: LitSprite1 + m_Shader: {fileID: 4800000, guid: 86ce7e600deb17e429b8be445bb652f7, type: 3} + m_ShaderKeywords: COLORRAMP_ON ETC1_EXTERNAL_ALPHA HSV_ON INNEROUTLINE_ON NORMALMAP_ON + OUTBASE8DIR_ON OUTBASE_ON TWISTUV_ON + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _ColorRampTex: + m_Texture: {fileID: 2800000, guid: 7062336ff4b66994caa2ba23c8651342, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ColorRampTexGradient: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ColorSwapTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DistortTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _FadeBurnTex: + m_Texture: {fileID: 2800000, guid: 677cca399782dea41aedc1d292ecb67d, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _FadeTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _GlowTex: + 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} + - _NormalMap: + m_Texture: {fileID: 2800000, guid: 994e4deee74379d4c83bcf0f27585f73, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OutlineDistortTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OutlineTex: + m_Texture: {fileID: 2800000, guid: 74087f6d03f233e4a8a142fa01f9e5cf, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OverlayTex: + m_Texture: {fileID: 2800000, guid: 677cca399782dea41aedc1d292ecb67d, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ShineMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - _Alpha: 1 + - _AlphaCutoffValue: 0.25 + - _AlphaOutlineBlend: 1 + - _AlphaOutlineGlow: 5 + - _AlphaOutlineMinAlpha: 0 + - _AlphaOutlinePower: 1 + - _AlphaRoundThreshold: 0.5 + - _BillboardY: 0 + - _BlurHD: 0 + - _BlurIntensity: 10 + - _Brightness: 0 + - _ChromAberrAlpha: 0.4 + - _ChromAberrAmount: 1 + - _ClipUvDown: 0 + - _ClipUvLeft: 0 + - _ClipUvRight: 0 + - _ClipUvUp: 0 + - _ColorChangeLuminosity: 0 + - _ColorChangeTolerance: 0.25 + - _ColorChangeTolerance2: 0.25 + - _ColorChangeTolerance3: 0.25 + - _ColorRampBlend: 1 + - _ColorRampLuminosity: 0.051 + - _ColorRampOutline: 0 + - _ColorSwapBlend: 1 + - _ColorSwapBlueLuminosity: 0.5 + - _ColorSwapGreenLuminosity: 0.5 + - _ColorSwapRedLuminosity: 0.5 + - _Contrast: 1 + - _CullingOption: 0 + - _DistortAmount: 0.5 + - _DistortTexXSpeed: 5 + - _DistortTexYSpeed: 5 + - _EditorDrawers: 7 + - _FadeAmount: 0.169 + - _FadeBurnGlow: 2 + - _FadeBurnTransition: 0.075 + - _FadeBurnWidth: 0.025 + - _FishEyeUvAmount: 0.35 + - _FlickerAlpha: 0 + - _FlickerFreq: 0.2 + - _FlickerPercent: 0.05 + - _GhostBlend: 1 + - _GhostColorBoost: 1 + - _GhostTransparency: 0 + - _GlitchAmount: 3 + - _GlitchSize: 1 + - _Glow: 10 + - _GlowGlobal: 1 + - _GradBlend: 1 + - _GradBoostX: 1.2 + - _GradBoostY: 1.2 + - _GradIsRadial: 0 + - _GrassManualAnim: 1 + - _GrassManualToggle: 0 + - _GrassRadialBend: 0.1 + - _GrassSpeed: 2 + - _GrassWind: 20 + - _GreyscaleBlend: 1 + - _GreyscaleLuminosity: 0 + - _GreyscaleOutline: 0 + - _HandDrawnAmount: 13.02 + - _HandDrawnSpeed: 5 + - _HitEffectBlend: 1 + - _HitEffectGlow: 5 + - _HologramBlend: 1 + - _HologramMaxAlpha: 0.75 + - _HologramMinAlpha: 0.1 + - _HologramStripesAmount: 0.1 + - _HologramStripesSpeed: 4.5 + - _HologramUnmodAmount: 0 + - _HsvBright: 1 + - _HsvSaturation: 1.102 + - _HsvShift: 360 + - _InnerOutlineAlpha: 1 + - _InnerOutlineGlow: 4 + - _InnerOutlineThickness: 1 + - _MaxXUV: 1 + - _MaxYUV: 1 + - _MinXUV: 0 + - _MinYUV: 0 + - _MotionBlurAngle: 0.1 + - _MotionBlurDist: 1.25 + - _MyDstMode: 10 + - _MySrcMode: 5 + - _NegativeAmount: 1 + - _NormalStrength: 15 + - _OffsetUvX: 0 + - _OffsetUvY: 0 + - _OnlyInnerOutline: 0 + - _OnlyOutline: 0 + - _OutlineAlpha: 1 + - _OutlineDistortAmount: 0.5 + - _OutlineDistortTexXSpeed: 5 + - _OutlineDistortTexYSpeed: 5 + - _OutlineGlow: 100 + - _OutlinePixelWidth: 1 + - _OutlineTexXSpeed: 10 + - _OutlineTexYSpeed: 0 + - _OutlineWidth: 0.0232 + - _OverlayBlend: 1 + - _OverlayGlow: 1 + - _OverlayTextureScrollXSpeed: 0.25 + - _OverlayTextureScrollYSpeed: 0.25 + - _PinchUvAmount: 0.35 + - _PixelateSize: 32 + - _PosterizeGamma: 0.75 + - _PosterizeNumColors: 8 + - _PosterizeOutline: 0 + - _RadialClip: 45 + - _RadialClip2: 0 + - _RadialStartAngle: 90 + - _RandomSeed: 0 + - _RectSize: 1 + - _RotateUvAmount: 0 + - _RoundWaveSpeed: 2 + - _RoundWaveStrength: 0.7 + - _ShadowAlpha: 0.5 + - _ShadowX: 0.1 + - _ShadowY: -0.05 + - _ShakeUvSpeed: 2.5 + - _ShakeUvX: 1.5 + - _ShakeUvY: 1 + - _ShineGlow: 1 + - _ShineLocation: 0.5 + - _ShineRotate: 0 + - _ShineWidth: 0.1 + - _TextureScrollXSpeed: 1 + - _TextureScrollYSpeed: 0 + - _TwistUvAmount: 0.32 + - _TwistUvPosX: 0.5 + - _TwistUvPosY: 0.5 + - _TwistUvRadius: 0.75 + - _WarpScale: 0.5 + - _WarpSpeed: 8 + - _WarpStrength: 0.025 + - _WaveAmount: 7 + - _WaveSpeed: 10 + - _WaveStrength: 7.5 + - _WaveX: 0 + - _WaveY: 0.5 + - _ZTestMode: 4 + - _ZWrite: 1 + - _ZoomUvAmount: 0.5 + m_Colors: + - _AlphaOutlineColor: {r: 1, g: 1, b: 1, a: 1} + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _ColorChangeNewCol: {r: 1, g: 1, b: 0, a: 1} + - _ColorChangeNewCol2: {r: 1, g: 1, b: 0, a: 1} + - _ColorChangeNewCol3: {r: 1, g: 1, b: 0, a: 1} + - _ColorChangeTarget: {r: 1, g: 0, b: 0, a: 1} + - _ColorChangeTarget2: {r: 1, g: 0, b: 0, a: 1} + - _ColorChangeTarget3: {r: 1, g: 0, b: 0, a: 1} + - _ColorSwapBlue: {r: 1, g: 1, b: 1, a: 1} + - _ColorSwapGreen: {r: 1, g: 1, b: 1, a: 1} + - _ColorSwapRed: {r: 1, g: 1, b: 1, a: 1} + - _FadeBurnColor: {r: 1, g: 1, b: 0, a: 1} + - _GlowColor: {r: 1, g: 1, b: 1, a: 1} + - _GradBotLeftCol: {r: 0, g: 0, b: 1, a: 1} + - _GradBotRightCol: {r: 0, g: 1, b: 0, a: 1} + - _GradTopLeftCol: {r: 1, g: 0, b: 0, a: 1} + - _GradTopRightCol: {r: 1, g: 1, b: 0, a: 1} + - _GreyscaleTintColor: {r: 1, g: 1, b: 1, a: 1} + - _HitEffectColor: {r: 1, g: 1, b: 1, a: 1} + - _HologramStripeColor: {r: 0, g: 1, b: 1, a: 1} + - _InnerOutlineColor: {r: 1, g: 0, b: 0, a: 1} + - _OutlineColor: {r: 1, g: 1, b: 1, a: 1} + - _OverlayColor: {r: 1, g: 1, b: 1, a: 1} + - _ShadowColor: {r: 0, g: 0, b: 0, a: 1} + - _ShineColor: {r: 1, g: 1, b: 1, a: 1} diff --git a/Assets/Plugins/AllIn1SpriteShader/Demo/Materials/LitSprite1.mat.meta b/Assets/Plugins/AllIn1SpriteShader/Demo/Materials/LitSprite1.mat.meta new file mode 100644 index 000000000..a21020d87 --- /dev/null +++ b/Assets/Plugins/AllIn1SpriteShader/Demo/Materials/LitSprite1.mat.meta @@ -0,0 +1,15 @@ +fileFormatVersion: 2 +guid: a6fac1ae6d53b7245ad918865e14c52e +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 2100000 + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 156513 + packageName: All In 1 Sprite Shader + packageVersion: 4.25 + assetPath: Assets/Plugins/AllIn1SpriteShader/Demo/Materials/LitSprite1.mat + uploadId: 708810 diff --git a/Assets/Plugins/AllIn1SpriteShader/Demo/Materials/LitSprite2.mat b/Assets/Plugins/AllIn1SpriteShader/Demo/Materials/LitSprite2.mat new file mode 100644 index 000000000..982629dae --- /dev/null +++ b/Assets/Plugins/AllIn1SpriteShader/Demo/Materials/LitSprite2.mat @@ -0,0 +1,244 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!21 &2100000 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: LitSprite2 + m_Shader: {fileID: 4800000, guid: 86ce7e600deb17e429b8be445bb652f7, type: 3} + m_ShaderKeywords: DOODLE_ON ETC1_EXTERNAL_ALPHA HSV_ON NORMALMAP_ON PINCH_ON + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _ColorRampTex: + m_Texture: {fileID: 2800000, guid: 279657edc397ece4b8029c727adf6ddc, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ColorRampTexGradient: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ColorSwapTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DistortTex: + m_Texture: {fileID: 2800000, guid: fcb027caad6963b4a80539bbce0d10e9, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _FadeBurnTex: + m_Texture: {fileID: 2800000, guid: 677cca399782dea41aedc1d292ecb67d, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _FadeTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _GlowTex: + 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} + - _NormalMap: + m_Texture: {fileID: 2800000, guid: 994e4deee74379d4c83bcf0f27585f73, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OutlineDistortTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OutlineTex: + m_Texture: {fileID: 2800000, guid: 74087f6d03f233e4a8a142fa01f9e5cf, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OverlayTex: + m_Texture: {fileID: 2800000, guid: 677cca399782dea41aedc1d292ecb67d, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ShineMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - _Alpha: 1 + - _AlphaCutoffValue: 0.25 + - _AlphaOutlineBlend: 1 + - _AlphaOutlineGlow: 5 + - _AlphaOutlineMinAlpha: 0 + - _AlphaOutlinePower: 1 + - _AlphaRoundThreshold: 0.5 + - _BillboardY: 0 + - _BlurHD: 0 + - _BlurIntensity: 10 + - _Brightness: 0 + - _ChromAberrAlpha: 0.4 + - _ChromAberrAmount: 1 + - _ClipUvDown: 0 + - _ClipUvLeft: 0 + - _ClipUvRight: 0 + - _ClipUvUp: 0 + - _ColorChangeLuminosity: 0 + - _ColorChangeTolerance: 0.25 + - _ColorChangeTolerance2: 0.25 + - _ColorChangeTolerance3: 0.25 + - _ColorRampBlend: 1 + - _ColorRampLuminosity: 0 + - _ColorRampOutline: 0 + - _ColorSwapBlend: 1 + - _ColorSwapBlueLuminosity: 0.5 + - _ColorSwapGreenLuminosity: 0.5 + - _ColorSwapRedLuminosity: 0.5 + - _Contrast: 1 + - _CullingOption: 0 + - _DistortAmount: 0.184 + - _DistortTexXSpeed: 0 + - _DistortTexYSpeed: 0 + - _EditorDrawers: 7 + - _FadeAmount: 0.169 + - _FadeBurnGlow: 2 + - _FadeBurnTransition: 0.075 + - _FadeBurnWidth: 0.025 + - _FishEyeUvAmount: 0.35 + - _FlickerAlpha: 0 + - _FlickerFreq: 0.2 + - _FlickerPercent: 0.05 + - _GhostBlend: 1 + - _GhostColorBoost: 1 + - _GhostTransparency: 0 + - _GlitchAmount: 3 + - _GlitchSize: 1 + - _Glow: 10 + - _GlowGlobal: 1 + - _GradBlend: 1 + - _GradBoostX: 1.2 + - _GradBoostY: 1.2 + - _GradIsRadial: 0 + - _GrassManualAnim: 1 + - _GrassManualToggle: 0 + - _GrassRadialBend: 0.1 + - _GrassSpeed: 2 + - _GrassWind: 20 + - _GreyscaleBlend: 1 + - _GreyscaleLuminosity: 0 + - _GreyscaleOutline: 0 + - _HandDrawnAmount: 13.02 + - _HandDrawnSpeed: 5 + - _HitEffectBlend: 1 + - _HitEffectGlow: 5 + - _HologramBlend: 1 + - _HologramMaxAlpha: 0.75 + - _HologramMinAlpha: 0.1 + - _HologramStripesAmount: 0.1 + - _HologramStripesSpeed: 4.5 + - _HologramUnmodAmount: 0 + - _HsvBright: 1 + - _HsvSaturation: 1.213 + - _HsvShift: 221 + - _InnerOutlineAlpha: 1 + - _InnerOutlineGlow: 4 + - _InnerOutlineThickness: 1 + - _MaxXUV: 1 + - _MaxYUV: 1 + - _MinXUV: 0 + - _MinYUV: 0 + - _MotionBlurAngle: 0.1 + - _MotionBlurDist: 1.25 + - _MyDstMode: 10 + - _MySrcMode: 5 + - _NegativeAmount: 1 + - _NormalStrength: 10 + - _OffsetUvX: 0 + - _OffsetUvY: 0 + - _OnlyInnerOutline: 0 + - _OnlyOutline: 0 + - _OutlineAlpha: 1 + - _OutlineDistortAmount: 0.5 + - _OutlineDistortTexXSpeed: 5 + - _OutlineDistortTexYSpeed: 5 + - _OutlineGlow: 100 + - _OutlinePixelWidth: 1 + - _OutlineTexXSpeed: 10 + - _OutlineTexYSpeed: 0 + - _OutlineWidth: 0.0151 + - _OverlayBlend: 1 + - _OverlayGlow: 1 + - _OverlayTextureScrollXSpeed: 0.25 + - _OverlayTextureScrollYSpeed: 0.25 + - _PinchUvAmount: 0.139 + - _PixelateSize: 32 + - _PosterizeGamma: 0.75 + - _PosterizeNumColors: 8 + - _PosterizeOutline: 0 + - _RadialClip: 45 + - _RadialClip2: 0 + - _RadialStartAngle: 90 + - _RandomSeed: 0 + - _RectSize: 1 + - _RotateUvAmount: 0 + - _RoundWaveSpeed: 2 + - _RoundWaveStrength: 0.7 + - _ShadowAlpha: 0.5 + - _ShadowX: 0.1 + - _ShadowY: -0.05 + - _ShakeUvSpeed: 2.5 + - _ShakeUvX: 1.5 + - _ShakeUvY: 1 + - _ShineGlow: 1 + - _ShineLocation: 0.5 + - _ShineRotate: 0 + - _ShineWidth: 0.1 + - _TextureScrollXSpeed: 1 + - _TextureScrollYSpeed: 0 + - _TwistUvAmount: 0.42 + - _TwistUvPosX: 0.316 + - _TwistUvPosY: 0.755 + - _TwistUvRadius: 0.54 + - _WarpScale: 0.5 + - _WarpSpeed: 8 + - _WarpStrength: 0.025 + - _WaveAmount: 7 + - _WaveSpeed: 10 + - _WaveStrength: 7.5 + - _WaveX: 0 + - _WaveY: 0.5 + - _ZTestMode: 4 + - _ZWrite: 1 + - _ZoomUvAmount: 0.5 + m_Colors: + - _AlphaOutlineColor: {r: 1, g: 1, b: 1, a: 1} + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _ColorChangeNewCol: {r: 1, g: 1, b: 0, a: 1} + - _ColorChangeNewCol2: {r: 1, g: 1, b: 0, a: 1} + - _ColorChangeNewCol3: {r: 1, g: 1, b: 0, a: 1} + - _ColorChangeTarget: {r: 1, g: 0, b: 0, a: 1} + - _ColorChangeTarget2: {r: 1, g: 0, b: 0, a: 1} + - _ColorChangeTarget3: {r: 1, g: 0, b: 0, a: 1} + - _ColorSwapBlue: {r: 1, g: 1, b: 1, a: 1} + - _ColorSwapGreen: {r: 1, g: 1, b: 1, a: 1} + - _ColorSwapRed: {r: 1, g: 1, b: 1, a: 1} + - _FadeBurnColor: {r: 1, g: 1, b: 0, a: 1} + - _GlowColor: {r: 1, g: 1, b: 1, a: 1} + - _GradBotLeftCol: {r: 0, g: 0, b: 1, a: 1} + - _GradBotRightCol: {r: 0, g: 1, b: 0, a: 1} + - _GradTopLeftCol: {r: 1, g: 0, b: 0, a: 1} + - _GradTopRightCol: {r: 1, g: 1, b: 0, a: 1} + - _GreyscaleTintColor: {r: 1, g: 1, b: 1, a: 1} + - _HitEffectColor: {r: 1, g: 1, b: 1, a: 1} + - _HologramStripeColor: {r: 0, g: 1, b: 1, a: 1} + - _InnerOutlineColor: {r: 1, g: 0, b: 0, a: 1} + - _OutlineColor: {r: 1, g: 1, b: 1, a: 1} + - _OverlayColor: {r: 1, g: 1, b: 1, a: 1} + - _ShadowColor: {r: 0, g: 0, b: 0, a: 1} + - _ShineColor: {r: 1, g: 1, b: 1, a: 1} diff --git a/Assets/Plugins/AllIn1SpriteShader/Demo/Materials/LitSprite2.mat.meta b/Assets/Plugins/AllIn1SpriteShader/Demo/Materials/LitSprite2.mat.meta new file mode 100644 index 000000000..df313bd72 --- /dev/null +++ b/Assets/Plugins/AllIn1SpriteShader/Demo/Materials/LitSprite2.mat.meta @@ -0,0 +1,15 @@ +fileFormatVersion: 2 +guid: c597a6bd515e47a429c79f272eb6762a +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 2100000 + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 156513 + packageName: All In 1 Sprite Shader + packageVersion: 4.25 + assetPath: Assets/Plugins/AllIn1SpriteShader/Demo/Materials/LitSprite2.mat + uploadId: 708810 diff --git a/Assets/Plugins/AllIn1SpriteShader/Demo/Materials/LitSprite3.mat b/Assets/Plugins/AllIn1SpriteShader/Demo/Materials/LitSprite3.mat new file mode 100644 index 000000000..4517694d3 --- /dev/null +++ b/Assets/Plugins/AllIn1SpriteShader/Demo/Materials/LitSprite3.mat @@ -0,0 +1,245 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!21 &2100000 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: LitSprite3 + m_Shader: {fileID: 4800000, guid: 86ce7e600deb17e429b8be445bb652f7, type: 3} + m_ShaderKeywords: ETC1_EXTERNAL_ALPHA FADE_ON GRADIENT_ON NORMALMAP_ON RADIALGRADIENT_ON + _GRADISRADIAL_ON + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _ColorRampTex: + m_Texture: {fileID: 2800000, guid: 279657edc397ece4b8029c727adf6ddc, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ColorRampTexGradient: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ColorSwapTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DistortTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _FadeBurnTex: + m_Texture: {fileID: 2800000, guid: 677cca399782dea41aedc1d292ecb67d, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _FadeTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 0.3, y: 0.3} + m_Offset: {x: -0.16, y: 0.08} + - _GlowTex: + 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} + - _NormalMap: + m_Texture: {fileID: 2800000, guid: 994e4deee74379d4c83bcf0f27585f73, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OutlineDistortTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OutlineTex: + m_Texture: {fileID: 2800000, guid: 74087f6d03f233e4a8a142fa01f9e5cf, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OverlayTex: + m_Texture: {fileID: 2800000, guid: 677cca399782dea41aedc1d292ecb67d, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ShineMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - _Alpha: 1 + - _AlphaCutoffValue: 0.25 + - _AlphaOutlineBlend: 1 + - _AlphaOutlineGlow: 5 + - _AlphaOutlineMinAlpha: 0 + - _AlphaOutlinePower: 1 + - _AlphaRoundThreshold: 0.5 + - _BillboardY: 0 + - _BlurHD: 0 + - _BlurIntensity: 10 + - _Brightness: 0 + - _ChromAberrAlpha: 0.4 + - _ChromAberrAmount: 1 + - _ClipUvDown: 0 + - _ClipUvLeft: 0 + - _ClipUvRight: 0 + - _ClipUvUp: 0 + - _ColorChangeLuminosity: 0 + - _ColorChangeTolerance: 0.25 + - _ColorChangeTolerance2: 0.25 + - _ColorChangeTolerance3: 0.25 + - _ColorRampBlend: 1 + - _ColorRampLuminosity: 0 + - _ColorRampOutline: 0 + - _ColorSwapBlend: 1 + - _ColorSwapBlueLuminosity: 0.5 + - _ColorSwapGreenLuminosity: 0.5 + - _ColorSwapRedLuminosity: 0.5 + - _Contrast: 1 + - _CullingOption: 0 + - _DistortAmount: 0.5 + - _DistortTexXSpeed: 5 + - _DistortTexYSpeed: 5 + - _EditorDrawers: 7 + - _FadeAmount: 0.275 + - _FadeBurnGlow: 250 + - _FadeBurnTransition: 0.075 + - _FadeBurnWidth: 0.025 + - _FishEyeUvAmount: 0.35 + - _FlickerAlpha: 0 + - _FlickerFreq: 0.2 + - _FlickerPercent: 0.05 + - _GhostBlend: 1 + - _GhostColorBoost: 1 + - _GhostTransparency: 0 + - _GlitchAmount: 3 + - _GlitchSize: 1 + - _Glow: 10 + - _GlowGlobal: 1 + - _GradBlend: 0.609 + - _GradBoostX: 1.02 + - _GradBoostY: 1.2 + - _GradIsRadial: 1 + - _GrassManualAnim: 1 + - _GrassManualToggle: 0 + - _GrassRadialBend: 0.1 + - _GrassSpeed: 2 + - _GrassWind: 20 + - _GreyscaleBlend: 1 + - _GreyscaleLuminosity: 0 + - _GreyscaleOutline: 0 + - _HandDrawnAmount: 13.02 + - _HandDrawnSpeed: 5 + - _HitEffectBlend: 1 + - _HitEffectGlow: 5 + - _HologramBlend: 1 + - _HologramMaxAlpha: 0.75 + - _HologramMinAlpha: 0.1 + - _HologramStripesAmount: 0.1 + - _HologramStripesSpeed: 4.5 + - _HologramUnmodAmount: 0 + - _HsvBright: 1 + - _HsvSaturation: 1.213 + - _HsvShift: 221 + - _InnerOutlineAlpha: 1 + - _InnerOutlineGlow: 4 + - _InnerOutlineThickness: 1 + - _MaxXUV: 1 + - _MaxYUV: 1 + - _MinXUV: 0 + - _MinYUV: 0 + - _MotionBlurAngle: 0.1 + - _MotionBlurDist: 1.25 + - _MyDstMode: 10 + - _MySrcMode: 5 + - _NegativeAmount: 1 + - _NormalStrength: 10 + - _OffsetUvX: 0 + - _OffsetUvY: 0 + - _OnlyInnerOutline: 0 + - _OnlyOutline: 0 + - _OutlineAlpha: 1 + - _OutlineDistortAmount: 0.5 + - _OutlineDistortTexXSpeed: 5 + - _OutlineDistortTexYSpeed: 5 + - _OutlineGlow: 100 + - _OutlinePixelWidth: 1 + - _OutlineTexXSpeed: 10 + - _OutlineTexYSpeed: 0 + - _OutlineWidth: 0.0151 + - _OverlayBlend: 1 + - _OverlayGlow: 1 + - _OverlayTextureScrollXSpeed: 0.25 + - _OverlayTextureScrollYSpeed: 0.25 + - _PinchUvAmount: 0.35 + - _PixelateSize: 32 + - _PosterizeGamma: 0.75 + - _PosterizeNumColors: 8 + - _PosterizeOutline: 0 + - _RadialClip: 45 + - _RadialClip2: 0 + - _RadialStartAngle: 90 + - _RandomSeed: 0 + - _RectSize: 1 + - _RotateUvAmount: 0 + - _RoundWaveSpeed: 2 + - _RoundWaveStrength: 0.7 + - _ShadowAlpha: 0.5 + - _ShadowX: 0.1 + - _ShadowY: -0.05 + - _ShakeUvSpeed: 2.5 + - _ShakeUvX: 1.5 + - _ShakeUvY: 1 + - _ShineGlow: 1 + - _ShineLocation: 0.5 + - _ShineRotate: 0 + - _ShineWidth: 0.1 + - _TextureScrollXSpeed: 1 + - _TextureScrollYSpeed: 0 + - _TwistUvAmount: 1 + - _TwistUvPosX: 0.5 + - _TwistUvPosY: 0.5 + - _TwistUvRadius: 0.75 + - _WarpScale: 0.5 + - _WarpSpeed: 8 + - _WarpStrength: 0.025 + - _WaveAmount: 7.9 + - _WaveSpeed: 10 + - _WaveStrength: 18.5 + - _WaveX: 0 + - _WaveY: 0.5 + - _ZTestMode: 4 + - _ZWrite: 1 + - _ZoomUvAmount: 0.5 + m_Colors: + - _AlphaOutlineColor: {r: 1, g: 1, b: 1, a: 1} + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _ColorChangeNewCol: {r: 1, g: 1, b: 0, a: 1} + - _ColorChangeNewCol2: {r: 1, g: 1, b: 0, a: 1} + - _ColorChangeNewCol3: {r: 1, g: 1, b: 0, a: 1} + - _ColorChangeTarget: {r: 1, g: 0, b: 0, a: 1} + - _ColorChangeTarget2: {r: 1, g: 0, b: 0, a: 1} + - _ColorChangeTarget3: {r: 1, g: 0, b: 0, a: 1} + - _ColorSwapBlue: {r: 1, g: 1, b: 1, a: 1} + - _ColorSwapGreen: {r: 1, g: 1, b: 1, a: 1} + - _ColorSwapRed: {r: 1, g: 1, b: 1, a: 1} + - _FadeBurnColor: {r: 1, g: 1, b: 0, a: 1} + - _GlowColor: {r: 1, g: 1, b: 1, a: 1} + - _GradBotLeftCol: {r: 1, g: 0, b: 0.6043663, a: 1} + - _GradBotRightCol: {r: 0, g: 1, b: 0, a: 1} + - _GradTopLeftCol: {r: 0.044267416, g: 1, b: 0, a: 1} + - _GradTopRightCol: {r: 1, g: 1, b: 0, a: 1} + - _GreyscaleTintColor: {r: 1, g: 1, b: 1, a: 1} + - _HitEffectColor: {r: 1, g: 1, b: 1, a: 1} + - _HologramStripeColor: {r: 0, g: 1, b: 1, a: 1} + - _InnerOutlineColor: {r: 1, g: 0, b: 0, a: 1} + - _OutlineColor: {r: 1, g: 1, b: 1, a: 1} + - _OverlayColor: {r: 1, g: 1, b: 1, a: 1} + - _ShadowColor: {r: 0, g: 0, b: 0, a: 1} + - _ShineColor: {r: 1, g: 1, b: 1, a: 1} diff --git a/Assets/Plugins/AllIn1SpriteShader/Demo/Materials/LitSprite3.mat.meta b/Assets/Plugins/AllIn1SpriteShader/Demo/Materials/LitSprite3.mat.meta new file mode 100644 index 000000000..18943c41c --- /dev/null +++ b/Assets/Plugins/AllIn1SpriteShader/Demo/Materials/LitSprite3.mat.meta @@ -0,0 +1,15 @@ +fileFormatVersion: 2 +guid: 23a4e6f17bbaf66479862eb488f28181 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 2100000 + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 156513 + packageName: All In 1 Sprite Shader + packageVersion: 4.25 + assetPath: Assets/Plugins/AllIn1SpriteShader/Demo/Materials/LitSprite3.mat + uploadId: 708810 diff --git a/Assets/Plugins/AllIn1SpriteShader/Demo/Materials/LitWall.mat b/Assets/Plugins/AllIn1SpriteShader/Demo/Materials/LitWall.mat new file mode 100644 index 000000000..5997999a1 --- /dev/null +++ b/Assets/Plugins/AllIn1SpriteShader/Demo/Materials/LitWall.mat @@ -0,0 +1,292 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!21 &2100000 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: LitWall + m_Shader: {fileID: 4800000, guid: 86ce7e600deb17e429b8be445bb652f7, type: 3} + m_ShaderKeywords: + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _BumpMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ColorRampTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ColorRampTexGradient: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ColorSwapTex: + 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} + - _DistortTex: + 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} + - _FadeBurnTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _FadeTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _GlowTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MainTex: + m_Texture: {fileID: 2800000, guid: c6ad7b22efb776c448982ca631b16f73, type: 3} + m_Scale: {x: 5, y: 5} + 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: 2800000, guid: fdff8a56ae2c830478b84c6807aa0408, 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} + - _OutlineDistortTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OutlineTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OverlayTex: + 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} + - _ShineMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - _Alpha: 1 + - _AlphaCutoffValue: 0.25 + - _AlphaOutlineBlend: 1 + - _AlphaOutlineGlow: 5 + - _AlphaOutlineMinAlpha: 0 + - _AlphaOutlinePower: 1 + - _AlphaRoundThreshold: 0.5 + - _BillboardY: 0 + - _BlurHD: 0 + - _BlurIntensity: 10 + - _Brightness: 0 + - _BumpScale: 1 + - _ChromAberrAlpha: 0.4 + - _ChromAberrAmount: 1 + - _ClipUvDown: 0 + - _ClipUvLeft: 0 + - _ClipUvRight: 0 + - _ClipUvUp: 0 + - _ColorChangeLuminosity: 0 + - _ColorChangeTolerance: 0.25 + - _ColorChangeTolerance2: 0.25 + - _ColorChangeTolerance3: 0.25 + - _ColorRampBlend: 1 + - _ColorRampLuminosity: 0 + - _ColorRampOutline: 0 + - _ColorSwapBlend: 1 + - _ColorSwapBlueLuminosity: 0.5 + - _ColorSwapGreenLuminosity: 0.5 + - _ColorSwapRedLuminosity: 0.5 + - _Contrast: 1 + - _CullingOption: 0 + - _Cutoff: 0.5 + - _DetailNormalMapScale: 1 + - _DistortAmount: 0.5 + - _DistortTexXSpeed: 5 + - _DistortTexYSpeed: 5 + - _DstBlend: 0 + - _EditorDrawers: 6 + - _FadeAmount: -0.1 + - _FadeBurnGlow: 2 + - _FadeBurnTransition: 0.075 + - _FadeBurnWidth: 0.025 + - _FishEyeUvAmount: 0.35 + - _FlickerAlpha: 0 + - _FlickerFreq: 0.2 + - _FlickerPercent: 0.05 + - _GhostBlend: 1 + - _GhostColorBoost: 1 + - _GhostTransparency: 0 + - _GlitchAmount: 3 + - _GlitchSize: 1 + - _GlossMapScale: 1 + - _Glossiness: 0.5 + - _GlossyReflections: 1 + - _Glow: 10 + - _GlowGlobal: 1 + - _GradBlend: 1 + - _GradBoostX: 1.2 + - _GradBoostY: 1.2 + - _GradIsRadial: 0 + - _GrassManualAnim: 1 + - _GrassManualToggle: 0 + - _GrassRadialBend: 0.1 + - _GrassSpeed: 2 + - _GrassWind: 20 + - _GreyscaleBlend: 1 + - _GreyscaleLuminosity: 0 + - _GreyscaleOutline: 0 + - _HandDrawnAmount: 10 + - _HandDrawnSpeed: 5 + - _HitEffectBlend: 1 + - _HitEffectGlow: 5 + - _HologramBlend: 1 + - _HologramMaxAlpha: 0.75 + - _HologramMinAlpha: 0.1 + - _HologramStripesAmount: 0.1 + - _HologramStripesSpeed: 4.5 + - _HologramUnmodAmount: 0 + - _HsvBright: 1 + - _HsvSaturation: 1 + - _HsvShift: 180 + - _InnerOutlineAlpha: 1 + - _InnerOutlineGlow: 4 + - _InnerOutlineThickness: 1 + - _MaxXUV: 1 + - _MaxYUV: 1 + - _Metallic: 0 + - _MinXUV: 0 + - _MinYUV: 0 + - _Mode: 0 + - _MotionBlurAngle: 0.1 + - _MotionBlurDist: 1.25 + - _MyDstMode: 10 + - _MySrcMode: 5 + - _NegativeAmount: 1 + - _NormalStrength: 5 + - _OcclusionStrength: 1 + - _OffsetUvX: 0 + - _OffsetUvY: 0 + - _OnlyInnerOutline: 0 + - _OnlyOutline: 0 + - _OutlineAlpha: 1 + - _OutlineDistortAmount: 0.5 + - _OutlineDistortTexXSpeed: 5 + - _OutlineDistortTexYSpeed: 5 + - _OutlineGlow: 1.5 + - _OutlinePixelWidth: 1 + - _OutlineTexXSpeed: 10 + - _OutlineTexYSpeed: 0 + - _OutlineWidth: 0.004 + - _OverlayBlend: 1 + - _OverlayGlow: 1 + - _OverlayTextureScrollXSpeed: 0.25 + - _OverlayTextureScrollYSpeed: 0.25 + - _Parallax: 0.02 + - _PinchUvAmount: 0.35 + - _PixelateSize: 32 + - _PosterizeGamma: 0.75 + - _PosterizeNumColors: 8 + - _PosterizeOutline: 0 + - _RadialClip: 45 + - _RadialClip2: 0 + - _RadialStartAngle: 90 + - _RandomSeed: 0 + - _RectSize: 1 + - _RotateUvAmount: 0 + - _RoundWaveSpeed: 2 + - _RoundWaveStrength: 0.7 + - _ShadowAlpha: 0.5 + - _ShadowX: 0.1 + - _ShadowY: -0.05 + - _ShakeUvSpeed: 2.5 + - _ShakeUvX: 1.5 + - _ShakeUvY: 1 + - _ShineGlow: 1 + - _ShineLocation: 0.5 + - _ShineRotate: 0 + - _ShineWidth: 0.1 + - _SmoothnessTextureChannel: 0 + - _SpecularHighlights: 1 + - _SrcBlend: 1 + - _TextureScrollXSpeed: 1 + - _TextureScrollYSpeed: 0 + - _TwistUvAmount: 1 + - _TwistUvPosX: 0.5 + - _TwistUvPosY: 0.5 + - _TwistUvRadius: 0.75 + - _UVSec: 0 + - _WarpScale: 0.5 + - _WarpSpeed: 8 + - _WarpStrength: 0.025 + - _WaveAmount: 7 + - _WaveSpeed: 10 + - _WaveStrength: 7.5 + - _WaveX: 0 + - _WaveY: 0.5 + - _ZTestMode: 4 + - _ZWrite: 1 + - _ZoomUvAmount: 0.5 + m_Colors: + - _AlphaOutlineColor: {r: 1, g: 1, b: 1, a: 1} + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _ColorChangeNewCol: {r: 1, g: 1, b: 0, a: 1} + - _ColorChangeNewCol2: {r: 1, g: 1, b: 0, a: 1} + - _ColorChangeNewCol3: {r: 1, g: 1, b: 0, a: 1} + - _ColorChangeTarget: {r: 1, g: 0, b: 0, a: 1} + - _ColorChangeTarget2: {r: 1, g: 0, b: 0, a: 1} + - _ColorChangeTarget3: {r: 1, g: 0, b: 0, a: 1} + - _ColorSwapBlue: {r: 1, g: 1, b: 1, a: 1} + - _ColorSwapGreen: {r: 1, g: 1, b: 1, a: 1} + - _ColorSwapRed: {r: 1, g: 1, b: 1, a: 1} + - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} + - _FadeBurnColor: {r: 1, g: 1, b: 0, a: 1} + - _GlowColor: {r: 1, g: 1, b: 1, a: 1} + - _GradBotLeftCol: {r: 0, g: 0, b: 1, a: 1} + - _GradBotRightCol: {r: 0, g: 1, b: 0, a: 1} + - _GradTopLeftCol: {r: 1, g: 0, b: 0, a: 1} + - _GradTopRightCol: {r: 1, g: 1, b: 0, a: 1} + - _GreyscaleTintColor: {r: 1, g: 1, b: 1, a: 1} + - _HitEffectColor: {r: 1, g: 1, b: 1, a: 1} + - _HologramStripeColor: {r: 0, g: 1, b: 1, a: 1} + - _InnerOutlineColor: {r: 1, g: 0, b: 0, a: 1} + - _OutlineColor: {r: 1, g: 1, b: 1, a: 1} + - _OverlayColor: {r: 1, g: 1, b: 1, a: 1} + - _ShadowColor: {r: 0, g: 0, b: 0, a: 1} + - _ShineColor: {r: 1, g: 1, b: 1, a: 1} diff --git a/Assets/Plugins/AllIn1SpriteShader/Demo/Materials/LitWall.mat.meta b/Assets/Plugins/AllIn1SpriteShader/Demo/Materials/LitWall.mat.meta new file mode 100644 index 000000000..00098932b --- /dev/null +++ b/Assets/Plugins/AllIn1SpriteShader/Demo/Materials/LitWall.mat.meta @@ -0,0 +1,15 @@ +fileFormatVersion: 2 +guid: 38bc0196d341b5b4a9998eff3a9112b9 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 2100000 + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 156513 + packageName: All In 1 Sprite Shader + packageVersion: 4.25 + assetPath: Assets/Plugins/AllIn1SpriteShader/Demo/Materials/LitWall.mat + uploadId: 708810 diff --git a/Assets/Plugins/AllIn1SpriteShader/Demo/Materials/MagicRing.mat b/Assets/Plugins/AllIn1SpriteShader/Demo/Materials/MagicRing.mat new file mode 100644 index 000000000..9135e846a --- /dev/null +++ b/Assets/Plugins/AllIn1SpriteShader/Demo/Materials/MagicRing.mat @@ -0,0 +1,238 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!21 &2100000 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: MagicRing + m_Shader: {fileID: 4800000, guid: a36b7719ff0465b42ab1407d67672c5f, type: 3} + m_ShaderKeywords: BLUR_ON DISTORT_ON ETC1_EXTERNAL_ALPHA GLOW_ON OUTBASE8DIR_ON + OUTBASEPIXELPERF_ON OUTBASE_ON PINCH_ON RADIALGRADIENT_ON ROTATEUV_ON TWISTUV_ON + WAVEUV_ON _GRADISRADIAL_ON _OUTLINE8DIRECTIONS_ON _OUTLINEISPIXEL_ON + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _ColorRampTex: + m_Texture: {fileID: 2800000, guid: 279657edc397ece4b8029c727adf6ddc, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ColorRampTexGradient: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ColorSwapTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DistortTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 0.5, y: 0.5} + m_Offset: {x: 0, y: 0} + - _FadeBurnTex: + m_Texture: {fileID: 2800000, guid: 677cca399782dea41aedc1d292ecb67d, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _FadeTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _GlowTex: + 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} + - _OutlineDistortTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OutlineTex: + m_Texture: {fileID: 2800000, guid: 74087f6d03f233e4a8a142fa01f9e5cf, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OverlayTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ShineMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - _Alpha: 0.9 + - _AlphaCutoffValue: 0.25 + - _AlphaOutlineBlend: 1 + - _AlphaOutlineGlow: 5 + - _AlphaOutlineMinAlpha: 0 + - _AlphaOutlinePower: 1 + - _AlphaRoundThreshold: 0.5 + - _BillboardY: 0 + - _BlurHD: 0 + - _BlurIntensity: 100 + - _Brightness: 0 + - _ChromAberrAlpha: 0.4 + - _ChromAberrAmount: 1 + - _ClipUvDown: 0 + - _ClipUvLeft: 0 + - _ClipUvRight: 0 + - _ClipUvUp: 0 + - _ColorChangeLuminosity: 0 + - _ColorChangeTolerance: 0.25 + - _ColorChangeTolerance2: 0.25 + - _ColorChangeTolerance3: 0.25 + - _ColorRampBlend: 1 + - _ColorRampLuminosity: 1 + - _ColorRampOutline: 0 + - _ColorSwapBlend: 1 + - _ColorSwapBlueLuminosity: 0.5 + - _ColorSwapGreenLuminosity: 0.5 + - _ColorSwapRedLuminosity: 0.5 + - _Contrast: 1 + - _CullingOption: 0 + - _DistortAmount: 0.79 + - _DistortTexXSpeed: -1 + - _DistortTexYSpeed: -10 + - _FadeAmount: -0.1 + - _FadeBurnGlow: 2 + - _FadeBurnTransition: 0.075 + - _FadeBurnWidth: 0.025 + - _FishEyeUvAmount: 0.35 + - _FlickerAlpha: 0 + - _FlickerFreq: 0.2 + - _FlickerPercent: 0.05 + - _GhostBlend: 1 + - _GhostColorBoost: 0 + - _GhostTransparency: 0.017 + - _GlitchAmount: 20 + - _GlitchSize: 4.51 + - _Glow: 33.6 + - _GlowGlobal: 1 + - _GlowTexUsed: 0 + - _GradBlend: 1 + - _GradBoostX: 5 + - _GradBoostY: 1.2 + - _GradIsRadial: 1 + - _GrassManualAnim: 1 + - _GrassManualToggle: 0 + - _GrassRadialBend: 0.1 + - _GrassSpeed: 2 + - _GrassWind: 20 + - _GreyscaleBlend: 1 + - _GreyscaleLuminosity: 0 + - _GreyscaleOutline: 0 + - _HandDrawnAmount: 10 + - _HandDrawnSpeed: 5 + - _HitEffectBlend: 1 + - _HitEffectGlow: 5 + - _HologramBlend: 1 + - _HologramMaxAlpha: 0.75 + - _HologramMinAlpha: 0.1 + - _HologramStripesAmount: 0.1 + - _HologramStripesSpeed: 4.5 + - _HologramUnmodAmount: 0 + - _HsvBright: 2 + - _HsvSaturation: 2 + - _HsvShift: 360 + - _InnerOutlineAlpha: 1 + - _InnerOutlineGlow: 250 + - _InnerOutlineThickness: 3 + - _MaxXUV: 1 + - _MaxYUV: 1 + - _MinXUV: 0 + - _MinYUV: 0 + - _MotionBlurAngle: -1 + - _MotionBlurDist: 3 + - _MyDstMode: 10 + - _MySrcMode: 5 + - _NegativeAmount: 1 + - _OffsetUvX: 0 + - _OffsetUvY: 0 + - _OnlyInnerOutline: 0 + - _OnlyOutline: 0 + - _Outline8Directions: 1 + - _OutlineAlpha: 0.306 + - _OutlineDistortAmount: 0.5 + - _OutlineDistortTexXSpeed: 5 + - _OutlineDistortTexYSpeed: 5 + - _OutlineDistortToggle: 0 + - _OutlineGlow: 1 + - _OutlineIsPixel: 1 + - _OutlinePixelWidth: 1 + - _OutlineTexGrey: 0 + - _OutlineTexToggle: 0 + - _OutlineTexXSpeed: 10 + - _OutlineTexYSpeed: 0 + - _OutlineWidth: 0 + - _OverlayBlend: 1 + - _OverlayGlow: 1 + - _PinchUvAmount: 0 + - _PixelateSize: 20 + - _PosterizeGamma: 0.75 + - _PosterizeNumColors: 8 + - _PosterizeOutline: 0 + - _RandomSeed: 0 + - _RectSize: 1 + - _RotateUvAmount: 6.28 + - _RoundWaveSpeed: 2 + - _RoundWaveStrength: 0.7 + - _ShadowAlpha: 0.5 + - _ShadowX: 0.1 + - _ShadowY: -0.05 + - _ShakeUvSpeed: 2.5 + - _ShakeUvX: 1.5 + - _ShakeUvY: 1 + - _ShineGlow: 71.6 + - _ShineLocation: 0.5 + - _ShineRotate: 1.28 + - _ShineWidth: 0.1 + - _TextureScrollXSpeed: 1 + - _TextureScrollYSpeed: 0 + - _TwistUvAmount: 0.47 + - _TwistUvPosX: 0.5 + - _TwistUvPosY: 0.5 + - _TwistUvRadius: 0.91 + - _WaveAmount: 7 + - _WaveSpeed: 10 + - _WaveStrength: 7.5 + - _WaveX: 0 + - _WaveY: 0.5 + - _ZTestMode: 4 + - _ZWrite: 0 + - _ZoomUvAmount: 1.95 + m_Colors: + - _AlphaOutlineColor: {r: 1, g: 1, b: 1, a: 1} + - _Color: {r: 1, g: 0.9044944, b: 0, a: 1} + - _ColorChangeNewCol: {r: 1, g: 1, b: 0, a: 1} + - _ColorChangeNewCol2: {r: 1, g: 1, b: 0, a: 1} + - _ColorChangeNewCol3: {r: 1, g: 1, b: 0, a: 1} + - _ColorChangeTarget: {r: 1, g: 0, b: 0, a: 1} + - _ColorChangeTarget2: {r: 1, g: 0, b: 0, a: 1} + - _ColorChangeTarget3: {r: 1, g: 0, b: 0, a: 1} + - _ColorSwapBlue: {r: 1, g: 1, b: 1, a: 1} + - _ColorSwapGreen: {r: 1, g: 1, b: 1, a: 1} + - _ColorSwapRed: {r: 1, g: 1, b: 1, a: 1} + - _FadeBurnColor: {r: 1, g: 1, b: 0, a: 1} + - _GlowColor: {r: 0.4339623, g: 0.30433717, b: 0, a: 1} + - _GradBotLeftCol: {r: 0, g: 0, b: 1, a: 1} + - _GradBotRightCol: {r: 0, g: 0, b: 1, a: 1} + - _GradTopLeftCol: {r: 1, g: 0, b: 0, a: 1} + - _GradTopRightCol: {r: 1, g: 0, b: 0, a: 1} + - _GreyscaleTintColor: {r: 1, g: 1, b: 1, a: 1} + - _HitEffectColor: {r: 1, g: 1, b: 1, a: 1} + - _HologramStripeColor: {r: 0, g: 1, b: 1, a: 1} + - _InnerOutlineColor: {r: 1, g: 0, b: 0, a: 1} + - _OutlineColor: {r: 1, g: 0.7998638, b: 0, a: 1} + - _OverlayColor: {r: 1, g: 1, b: 1, a: 1} + - _ShadowColor: {r: 0, g: 0, b: 0, a: 1} + - _ShineColor: {r: 1, g: 1, b: 1, a: 1} diff --git a/Assets/Plugins/AllIn1SpriteShader/Demo/Materials/MagicRing.mat.meta b/Assets/Plugins/AllIn1SpriteShader/Demo/Materials/MagicRing.mat.meta new file mode 100644 index 000000000..457e8c0b6 --- /dev/null +++ b/Assets/Plugins/AllIn1SpriteShader/Demo/Materials/MagicRing.mat.meta @@ -0,0 +1,15 @@ +fileFormatVersion: 2 +guid: 1c2c3a51f881cb443906a57116cf56fe +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 2100000 + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 156513 + packageName: All In 1 Sprite Shader + packageVersion: 4.25 + assetPath: Assets/Plugins/AllIn1SpriteShader/Demo/Materials/MagicRing.mat + uploadId: 708810 diff --git a/Assets/Plugins/AllIn1SpriteShader/Demo/Materials/Outline1.mat b/Assets/Plugins/AllIn1SpriteShader/Demo/Materials/Outline1.mat new file mode 100644 index 000000000..e57919439 --- /dev/null +++ b/Assets/Plugins/AllIn1SpriteShader/Demo/Materials/Outline1.mat @@ -0,0 +1,188 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!21 &2100000 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: Outline1 + m_Shader: {fileID: 4800000, guid: a36b7719ff0465b42ab1407d67672c5f, type: 3} + m_ShaderKeywords: ETC1_EXTERNAL_ALPHA OUTBASE8DIR_ON OUTBASE_ON _OUTLINE8DIRECTIONS_ON + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _ColorRampTex: + m_Texture: {fileID: 2800000, guid: 279657edc397ece4b8029c727adf6ddc, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ColorSwapTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DistortTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _FadeBurnTex: + m_Texture: {fileID: 2800000, guid: 677cca399782dea41aedc1d292ecb67d, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _FadeTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _GlowTex: + 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} + - _OutlineDistortTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OutlineTex: + m_Texture: {fileID: 2800000, guid: 74087f6d03f233e4a8a142fa01f9e5cf, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - _Alpha: 1 + - _AlphaCutoffValue: 0.25 + - _BillboardY: 0 + - _BlurHD: 0 + - _BlurIntensity: 10 + - _ChromAberrAlpha: 0.4 + - _ChromAberrAmount: 1 + - _ClipUvDown: 0 + - _ClipUvLeft: 0 + - _ClipUvRight: 0 + - _ClipUvUp: 0 + - _ColorChangeLuminosity: 0 + - _ColorChangeTolerance: 0.25 + - _ColorRampLuminosity: 0 + - _ColorRampOutline: 0 + - _ColorSwapBlueLuminosity: 0.5 + - _ColorSwapGreenLuminosity: 0.5 + - _ColorSwapRedLuminosity: 0.5 + - _DistortAmount: 0.5 + - _DistortTexXSpeed: 5 + - _DistortTexYSpeed: 5 + - _FadeAmount: -0.1 + - _FadeBurnGlow: 2 + - _FadeBurnTransition: 0.075 + - _FadeBurnWidth: 0.025 + - _FishEyeUvAmount: 0.35 + - _FlickerAlpha: 0 + - _FlickerFreq: 0.2 + - _FlickerPercent: 0.05 + - _GhostColorBoost: 1 + - _GhostTransparency: 0 + - _GlitchAmount: 3 + - _Glow: 10 + - _GlowTexUsed: 0 + - _GradBlend: 1 + - _GrassManualAnim: 1 + - _GrassManualToggle: 0 + - _GrassSpeed: 2 + - _GrassWind: 20 + - _GreyscaleLuminosity: 0 + - _GreyscaleOutline: 0 + - _HandDrawnAmount: 10 + - _HandDrawnSpeed: 5 + - _HitEffectBlend: 1 + - _HitEffectGlow: 5 + - _HologramStripesAlpha: 0.4 + - _HologramStripesAmount: 50 + - _HologramStripesFill: 0.4 + - _HologramStripesLuminosity: 1 + - _HologramStripesSpeed: 5 + - _HsvBright: 1 + - _HsvSaturation: 1 + - _HsvShift: 180 + - _InnerOutlineAlpha: 1 + - _InnerOutlineGlow: 1 + - _InnerOutlineThickness: 1 + - _MaxXUV: 1 + - _MaxYUV: 1 + - _MinXUV: 0 + - _MinYUV: 0 + - _MotionBlurAngle: 0.1 + - _MotionBlurDist: 1.25 + - _MyDstMode: 10 + - _MySrcMode: 5 + - _NegativeAmount: 1 + - _OffsetUvX: 0 + - _OffsetUvY: 0 + - _OnlyInnerOutline: 0 + - _OnlyOutline: 0 + - _Outline8Directions: 1 + - _OutlineAlpha: 1 + - _OutlineDistortAmount: 0.5 + - _OutlineDistortTexXSpeed: 5 + - _OutlineDistortTexYSpeed: 5 + - _OutlineDistortToggle: 0 + - _OutlineGlow: 3 + - _OutlineIsPixel: 0 + - _OutlinePixelWidth: 1 + - _OutlineTexGrey: 0 + - _OutlineTexToggle: 0 + - _OutlineTexXSpeed: 10 + - _OutlineTexYSpeed: 0 + - _OutlineWidth: 0.025 + - _PinchUvAmount: 0.35 + - _PixelateSize: 32 + - _PosterizeGamma: 0.75 + - _PosterizeNumColors: 8 + - _PosterizeOutline: 0 + - _RandomSeed: 0 + - _RectSize: 1 + - _RotateUvAmount: 0 + - _RoundWaveSpeed: 2 + - _RoundWaveStrength: 0.7 + - _ShadowAlpha: 0.5 + - _ShadowX: 0.1 + - _ShadowY: -0.05 + - _ShakeUvSpeed: 2.5 + - _ShakeUvX: 1.5 + - _ShakeUvY: 1 + - _TextureScrollXSpeed: 1 + - _TextureScrollYSpeed: 0 + - _TwistUvAmount: 1 + - _TwistUvPosX: 0.5 + - _TwistUvPosY: 0.5 + - _TwistUvRadius: 0.75 + - _WaveAmount: 7 + - _WaveSpeed: 10 + - _WaveStrength: 7.5 + - _WaveX: 0 + - _WaveY: 0.5 + - _ZWrite: 0 + - _ZoomUvAmount: 0.5 + m_Colors: + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _ColorChangeNewCol: {r: 1, g: 1, b: 0, a: 1} + - _ColorChangeTarget: {r: 1, g: 0, b: 0, a: 1} + - _ColorSwapBlue: {r: 1, g: 1, b: 1, a: 1} + - _ColorSwapGreen: {r: 1, g: 1, b: 1, a: 1} + - _ColorSwapRed: {r: 1, g: 1, b: 1, a: 1} + - _FadeBurnColor: {r: 1, g: 1, b: 0, a: 1} + - _GlowColor: {r: 1, g: 1, b: 1, a: 1} + - _GradBotLeftCol: {r: 0, g: 0, b: 1, a: 1} + - _GradBotRightCol: {r: 0, g: 0, b: 1, a: 1} + - _GradTopLeftCol: {r: 1, g: 0, b: 0, a: 1} + - _GradTopRightCol: {r: 1, g: 0, b: 0, a: 1} + - _GreyscaleTintColor: {r: 1, g: 1, b: 1, a: 1} + - _HitEffectColor: {r: 1, g: 1, b: 1, a: 1} + - _InnerOutlineColor: {r: 1, g: 0, b: 0, a: 1} + - _OutlineColor: {r: 1, g: 1, b: 1, a: 1} + - _ShadowColor: {r: 0, g: 0, b: 0, a: 1} diff --git a/Assets/Plugins/AllIn1SpriteShader/Demo/Materials/Outline1.mat.meta b/Assets/Plugins/AllIn1SpriteShader/Demo/Materials/Outline1.mat.meta new file mode 100644 index 000000000..d717cb640 --- /dev/null +++ b/Assets/Plugins/AllIn1SpriteShader/Demo/Materials/Outline1.mat.meta @@ -0,0 +1,15 @@ +fileFormatVersion: 2 +guid: 2fff2435ee99439438c463e2ce768283 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 2100000 + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 156513 + packageName: All In 1 Sprite Shader + packageVersion: 4.25 + assetPath: Assets/Plugins/AllIn1SpriteShader/Demo/Materials/Outline1.mat + uploadId: 708810 diff --git a/Assets/Plugins/AllIn1SpriteShader/Demo/Materials/Shield.mat b/Assets/Plugins/AllIn1SpriteShader/Demo/Materials/Shield.mat new file mode 100644 index 000000000..488ea8d81 --- /dev/null +++ b/Assets/Plugins/AllIn1SpriteShader/Demo/Materials/Shield.mat @@ -0,0 +1,189 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!21 &2100000 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: Shield + m_Shader: {fileID: 4800000, guid: a36b7719ff0465b42ab1407d67672c5f, type: 3} + m_ShaderKeywords: BLURISHD_ON ETC1_EXTERNAL_ALPHA FADE_ON FLICKER_ON GLOWTEX_ON + GLOW_ON PIXELATE_ON TEXTURESCROLL_ON WAVEUV_ON _BLURHD_ON _GLOWTEXUSED_ON + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _ColorRampTex: + m_Texture: {fileID: 2800000, guid: 279657edc397ece4b8029c727adf6ddc, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ColorSwapTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DistortTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _FadeBurnTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _FadeTex: + m_Texture: {fileID: 2800000, guid: dbaa905cec0d2b944b5d1ebdbc3ceb1e, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _GlowTex: + m_Texture: {fileID: 2800000, guid: 81687001a52d8024fb3706ba7619ad4b, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MainTex: + m_Texture: {fileID: 2800000, guid: 2f5c9cbfde2d0384bb53189b0d0f06d8, type: 3} + m_Scale: {x: 1.5, y: 1.5} + m_Offset: {x: 0, y: 0} + - _OutlineDistortTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OutlineTex: + m_Texture: {fileID: 2800000, guid: 74087f6d03f233e4a8a142fa01f9e5cf, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - _Alpha: 0.332 + - _AlphaCutoffValue: 0.25 + - _BillboardY: 0 + - _BlurHD: 1 + - _BlurIntensity: 13.7 + - _ChromAberrAlpha: 0.4 + - _ChromAberrAmount: 1 + - _ClipUvDown: 0 + - _ClipUvLeft: 0 + - _ClipUvRight: 0 + - _ClipUvUp: 0 + - _ColorChangeLuminosity: 0 + - _ColorChangeTolerance: 0.25 + - _ColorRampLuminosity: 0 + - _ColorRampOutline: 0 + - _ColorSwapBlueLuminosity: 0.5 + - _ColorSwapGreenLuminosity: 0.5 + - _ColorSwapRedLuminosity: 0.5 + - _DistortAmount: 0.5 + - _DistortTexXSpeed: 5 + - _DistortTexYSpeed: 5 + - _FadeAmount: -0.1 + - _FadeBurnGlow: 5.7 + - _FadeBurnTransition: 0.095 + - _FadeBurnWidth: 0 + - _FishEyeUvAmount: 0.35 + - _FlickerAlpha: 0.888 + - _FlickerFreq: 0.2 + - _FlickerPercent: 0.05 + - _GhostColorBoost: 1 + - _GhostTransparency: 0 + - _GlitchAmount: 3.4 + - _Glow: 10 + - _GlowTexUsed: 1 + - _GradBlend: 1 + - _GrassManualAnim: 1 + - _GrassManualToggle: 0 + - _GrassSpeed: 2 + - _GrassWind: 20 + - _GreyscaleLuminosity: 0 + - _GreyscaleOutline: 0 + - _HandDrawnAmount: 10 + - _HandDrawnSpeed: 5 + - _HitEffectBlend: 1 + - _HitEffectGlow: 5 + - _HologramFlickerAlpha: 0 + - _HologramFlickerFreq: 0.2 + - _HologramStripesAlpha: 0.4 + - _HologramStripesAmount: 35.7 + - _HologramStripesFill: 0.27 + - _HologramStripesLuminosity: 1 + - _HologramStripesSpeed: 5 + - _HsvBright: 1 + - _HsvSaturation: 1 + - _HsvShift: 0 + - _InnerOutlineAlpha: 1 + - _InnerOutlineGlow: 1 + - _InnerOutlineThickness: 1 + - _MaxXUV: 1 + - _MaxYUV: 1 + - _MinXUV: 0 + - _MinYUV: 0 + - _MotionBlurAngle: 0.1 + - _MotionBlurDist: 1.25 + - _MyDstMode: 10 + - _MySrcMode: 5 + - _NegativeAmount: 1 + - _OffsetUvX: 0 + - _OffsetUvY: 0 + - _Outline8Directions: 0 + - _OutlineAlpha: 1 + - _OutlineDistortAmount: 0.5 + - _OutlineDistortTexXSpeed: 5 + - _OutlineDistortTexYSpeed: 5 + - _OutlineDistortToggle: 0 + - _OutlineGlow: 1.5 + - _OutlineIsPixel: 0 + - _OutlinePixelWidth: 1 + - _OutlineTexGrey: 0 + - _OutlineTexToggle: 0 + - _OutlineTexXSpeed: 10 + - _OutlineTexYSpeed: 0 + - _OutlineWidth: 0.014 + - _PinchUvAmount: 0.35 + - _PixelateSize: 66 + - _PosterizeGamma: 0.75 + - _PosterizeNumColors: 8 + - _PosterizeOutline: 0 + - _RandomSeed: 0 + - _RectSize: 1 + - _RotateUvAmount: 0 + - _RoundWaveSpeed: 2 + - _RoundWaveStrength: 0.7 + - _ShadowAlpha: 0.5 + - _ShadowX: 0.1 + - _ShadowY: -0.05 + - _ShakeUvSpeed: 2.5 + - _ShakeUvX: 1.5 + - _ShakeUvY: 1 + - _TextureScrollXSpeed: 0.24 + - _TextureScrollYSpeed: 0.31 + - _TwistUvAmount: 0.46 + - _TwistUvPosX: 0.5 + - _TwistUvPosY: 0.5 + - _TwistUvRadius: 0.75 + - _WaveAmount: 15 + - _WaveSpeed: 24.7 + - _WaveStrength: 7.5 + - _WaveX: 0 + - _WaveY: 0.5 + - _ZWrite: 0 + - _ZoomUvAmount: 0.5 + m_Colors: + - _Color: {r: 0, g: 0.9805136, b: 1, a: 1} + - _ColorChangeNewCol: {r: 1, g: 1, b: 0, a: 1} + - _ColorChangeTarget: {r: 1, g: 0, b: 0, a: 1} + - _ColorSwapBlue: {r: 1, g: 1, b: 1, a: 1} + - _ColorSwapGreen: {r: 1, g: 1, b: 1, a: 1} + - _ColorSwapRed: {r: 1, g: 1, b: 1, a: 1} + - _FadeBurnColor: {r: 1, g: 1, b: 1, a: 1} + - _GlowColor: {r: 0, g: 0.98090506, b: 1, a: 1} + - _GradBotLeftCol: {r: 0, g: 0, b: 1, a: 1} + - _GradBotRightCol: {r: 0, g: 0, b: 1, a: 1} + - _GradTopLeftCol: {r: 1, g: 0, b: 0, a: 1} + - _GradTopRightCol: {r: 1, g: 0, b: 0, a: 1} + - _GreyscaleTintColor: {r: 1, g: 1, b: 1, a: 1} + - _HitEffectColor: {r: 1, g: 1, b: 1, a: 1} + - _InnerOutlineColor: {r: 1, g: 0, b: 0, a: 1} + - _OutlineColor: {r: 0, g: 1, b: 0.9378109, a: 1} + - _ShadowColor: {r: 0, g: 0, b: 0, a: 1} diff --git a/Assets/Plugins/AllIn1SpriteShader/Demo/Materials/Shield.mat.meta b/Assets/Plugins/AllIn1SpriteShader/Demo/Materials/Shield.mat.meta new file mode 100644 index 000000000..53d1253c1 --- /dev/null +++ b/Assets/Plugins/AllIn1SpriteShader/Demo/Materials/Shield.mat.meta @@ -0,0 +1,15 @@ +fileFormatVersion: 2 +guid: 4396a2d1265c9414e810fdf77d8238b5 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 2100000 + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 156513 + packageName: All In 1 Sprite Shader + packageVersion: 4.25 + assetPath: Assets/Plugins/AllIn1SpriteShader/Demo/Materials/Shield.mat + uploadId: 708810 diff --git a/Assets/Plugins/AllIn1SpriteShader/Demo/Materials/ShieldSoldier.mat b/Assets/Plugins/AllIn1SpriteShader/Demo/Materials/ShieldSoldier.mat new file mode 100644 index 000000000..bbb61d376 --- /dev/null +++ b/Assets/Plugins/AllIn1SpriteShader/Demo/Materials/ShieldSoldier.mat @@ -0,0 +1,209 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!21 &2100000 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: ShieldSoldier + m_Shader: {fileID: 4800000, guid: a36b7719ff0465b42ab1407d67672c5f, type: 3} + m_ShaderKeywords: ETC1_EXTERNAL_ALPHA GLOWTEX_ON HSV_ON OUTBASE8DIR_ON OUTBASE_ON + _GLOWTEXUSED_ON _OUTLINE8DIRECTIONS_ON + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _ColorRampTex: + m_Texture: {fileID: 2800000, guid: 279657edc397ece4b8029c727adf6ddc, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ColorSwapTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DistortTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _FadeBurnTex: + m_Texture: {fileID: 2800000, guid: 677cca399782dea41aedc1d292ecb67d, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _FadeTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _GlowTex: + m_Texture: {fileID: 2800000, guid: 8608ef90f91271745a17f7210fe1e7db, type: 3} + 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} + - _OutlineDistortTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OutlineTex: + m_Texture: {fileID: 2800000, guid: 74087f6d03f233e4a8a142fa01f9e5cf, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ShineMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - _Alpha: 1 + - _AlphaCutoffValue: 0.25 + - _BillboardY: 0 + - _BlurHD: 0 + - _BlurIntensity: 10 + - _ChromAberrAlpha: 0.4 + - _ChromAberrAmount: 1 + - _ClipUvDown: 0 + - _ClipUvLeft: 0 + - _ClipUvRight: 0 + - _ClipUvUp: 0 + - _ColorChangeLuminosity: 0 + - _ColorChangeTolerance: 0.25 + - _ColorRampLuminosity: 0 + - _ColorRampOutline: 0 + - _ColorSwapBlueLuminosity: 0.5 + - _ColorSwapGreenLuminosity: 0.5 + - _ColorSwapRedLuminosity: 0.5 + - _DistortAmount: 0.5 + - _DistortTexXSpeed: 5 + - _DistortTexYSpeed: 5 + - _FadeAmount: -0.1 + - _FadeBurnGlow: 2 + - _FadeBurnTransition: 0.075 + - _FadeBurnWidth: 0.025 + - _FishEyeUvAmount: 0.35 + - _FlickerAlpha: 0 + - _FlickerFreq: 0.2 + - _FlickerPercent: 0.05 + - _GhostColorBoost: 1 + - _GhostTransparency: 0 + - _GlitchAmount: 20 + - _GlitchSize: 1 + - _Glow: 6.9 + - _GlowTexUsed: 1 + - _GradBlend: 1 + - _GradBoostX: 1.2 + - _GradBoostY: 1.2 + - _GradIsRadial: 0 + - _GrassManualAnim: 1 + - _GrassManualToggle: 0 + - _GrassSpeed: 2 + - _GrassWind: 20 + - _GreyscaleLuminosity: 0 + - _GreyscaleOutline: 0 + - _HandDrawnAmount: 10 + - _HandDrawnSpeed: 5 + - _HitEffectBlend: 1 + - _HitEffectGlow: 5 + - _HologramFlickerAlpha: 0 + - _HologramFlickerFreq: 0.2 + - _HologramMaxAlpha: 0.75 + - _HologramMinAlpha: 0.1 + - _HologramStripesAlpha: 0.4 + - _HologramStripesAmount: 50 + - _HologramStripesFill: 0.4 + - _HologramStripesLuminosity: 1 + - _HologramStripesSpeed: 5 + - _HologramUnmodAmount: 0 + - _HsvBright: 1 + - _HsvSaturation: 2 + - _HsvShift: 163 + - _InnerOutlineAlpha: 1 + - _InnerOutlineGlow: 1 + - _InnerOutlineThickness: 1 + - _MaxXUV: 1 + - _MaxYUV: 1 + - _MinXUV: 0 + - _MinYUV: 0 + - _MotionBlurAngle: 0.1 + - _MotionBlurDist: 1.25 + - _MyDstMode: 10 + - _MySrcMode: 5 + - _NegativeAmount: 1 + - _OffsetUvX: 0 + - _OffsetUvY: 0 + - _OnlyInnerOutline: 0 + - _OnlyOutline: 0 + - _Outline8Directions: 1 + - _OutlineAlpha: 1 + - _OutlineDistortAmount: 0.5 + - _OutlineDistortTexXSpeed: 5 + - _OutlineDistortTexYSpeed: 5 + - _OutlineDistortToggle: 0 + - _OutlineGlow: 3 + - _OutlineIsPixel: 0 + - _OutlinePixelWidth: 1 + - _OutlineTexGrey: 0 + - _OutlineTexToggle: 0 + - _OutlineTexXSpeed: 10 + - _OutlineTexYSpeed: 0 + - _OutlineWidth: 0.011 + - _PinchUvAmount: 0.35 + - _PixelateSize: 32 + - _PosterizeGamma: 0.75 + - _PosterizeNumColors: 8 + - _PosterizeOutline: 0 + - _RandomSeed: 0 + - _RectSize: 1 + - _RotateUvAmount: 0 + - _RoundWaveSpeed: 2 + - _RoundWaveStrength: 0.7 + - _ShadowAlpha: 0.5 + - _ShadowX: 0.1 + - _ShadowY: -0.05 + - _ShakeUvSpeed: 2.5 + - _ShakeUvX: 1.5 + - _ShakeUvY: 1 + - _ShineGlow: 1 + - _ShineLocation: 0.5 + - _ShineRotate: 0 + - _ShineWidth: 0.1 + - _TextureScrollXSpeed: 1 + - _TextureScrollYSpeed: 0 + - _TwistUvAmount: 1 + - _TwistUvPosX: 0.5 + - _TwistUvPosY: 0.5 + - _TwistUvRadius: 0.75 + - _WaveAmount: 7 + - _WaveSpeed: 10 + - _WaveStrength: 7.5 + - _WaveX: 0 + - _WaveY: 0.5 + - _ZTestMode: 4 + - _ZWrite: 0 + - _ZoomUvAmount: 0.5 + m_Colors: + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _ColorChangeNewCol: {r: 1, g: 1, b: 0, a: 1} + - _ColorChangeTarget: {r: 1, g: 0, b: 0, a: 1} + - _ColorSwapBlue: {r: 1, g: 1, b: 1, a: 1} + - _ColorSwapGreen: {r: 1, g: 1, b: 1, a: 1} + - _ColorSwapRed: {r: 1, g: 1, b: 1, a: 1} + - _FadeBurnColor: {r: 1, g: 1, b: 0, a: 1} + - _GlowColor: {r: 0, g: 0.23854972, b: 0.2924528, a: 1} + - _GradBotLeftCol: {r: 0, g: 0, b: 1, a: 1} + - _GradBotRightCol: {r: 0, g: 0, b: 1, a: 1} + - _GradTopLeftCol: {r: 1, g: 0, b: 0, a: 1} + - _GradTopRightCol: {r: 1, g: 0, b: 0, a: 1} + - _GreyscaleTintColor: {r: 1, g: 1, b: 1, a: 1} + - _HitEffectColor: {r: 1, g: 1, b: 1, a: 1} + - _HologramStripeColor: {r: 0, g: 1, b: 1, a: 1} + - _InnerOutlineColor: {r: 1, g: 0, b: 0, a: 1} + - _OutlineColor: {r: 0, g: 0.33333334, b: 0.6666667, a: 1} + - _ShadowColor: {r: 0, g: 0, b: 0, a: 1} + - _ShineColor: {r: 1, g: 1, b: 1, a: 1} diff --git a/Assets/Plugins/AllIn1SpriteShader/Demo/Materials/ShieldSoldier.mat.meta b/Assets/Plugins/AllIn1SpriteShader/Demo/Materials/ShieldSoldier.mat.meta new file mode 100644 index 000000000..b4e13259a --- /dev/null +++ b/Assets/Plugins/AllIn1SpriteShader/Demo/Materials/ShieldSoldier.mat.meta @@ -0,0 +1,15 @@ +fileFormatVersion: 2 +guid: 8a80b25e622f6c84aac445df7e206085 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 2100000 + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 156513 + packageName: All In 1 Sprite Shader + packageVersion: 4.25 + assetPath: Assets/Plugins/AllIn1SpriteShader/Demo/Materials/ShieldSoldier.mat + uploadId: 708810 diff --git a/Assets/Plugins/AllIn1SpriteShader/Demo/Materials/SnowFlake.mat b/Assets/Plugins/AllIn1SpriteShader/Demo/Materials/SnowFlake.mat new file mode 100644 index 000000000..1a6e5447a --- /dev/null +++ b/Assets/Plugins/AllIn1SpriteShader/Demo/Materials/SnowFlake.mat @@ -0,0 +1,85 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!21 &2100000 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: SnowFlake + m_Shader: {fileID: 10753, guid: 0000000000000000f000000000000000, type: 0} + m_ShaderKeywords: + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _AlphaTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _BumpMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailAlbedoMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailNormalMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _EmissionMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MainTex: + m_Texture: {fileID: 2800000, guid: ab4465ab72ca5544da8e8dd1110b6973, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MetallicGlossMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OcclusionMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ParallaxMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - PixelSnap: 0 + - _BumpScale: 1 + - _Cutoff: 0.5 + - _DetailNormalMapScale: 1 + - _DstBlend: 0 + - _EnableExternalAlpha: 0 + - _GlossMapScale: 1 + - _Glossiness: 0.5 + - _GlossyReflections: 1 + - _Metallic: 0 + - _Mode: 0 + - _OcclusionStrength: 1 + - _Parallax: 0.02 + - _SmoothnessTextureChannel: 0 + - _SpecularHighlights: 1 + - _SrcBlend: 1 + - _UVSec: 0 + - _ZWrite: 1 + m_Colors: + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} + - _Flip: {r: 1, g: 1, b: 1, a: 1} + - _RendererColor: {r: 1, g: 1, b: 1, a: 1} diff --git a/Assets/Plugins/AllIn1SpriteShader/Demo/Materials/SnowFlake.mat.meta b/Assets/Plugins/AllIn1SpriteShader/Demo/Materials/SnowFlake.mat.meta new file mode 100644 index 000000000..ed6e6360c --- /dev/null +++ b/Assets/Plugins/AllIn1SpriteShader/Demo/Materials/SnowFlake.mat.meta @@ -0,0 +1,15 @@ +fileFormatVersion: 2 +guid: aae53a69b285d6f4aad0e6953245bc7d +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 2100000 + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 156513 + packageName: All In 1 Sprite Shader + packageVersion: 4.25 + assetPath: Assets/Plugins/AllIn1SpriteShader/Demo/Materials/SnowFlake.mat + uploadId: 708810 diff --git a/Assets/Plugins/AllIn1SpriteShader/Demo/Materials/Sparks.mat b/Assets/Plugins/AllIn1SpriteShader/Demo/Materials/Sparks.mat new file mode 100644 index 000000000..7e0fe78f0 --- /dev/null +++ b/Assets/Plugins/AllIn1SpriteShader/Demo/Materials/Sparks.mat @@ -0,0 +1,85 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!21 &2100000 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: Sparks + m_Shader: {fileID: 10753, guid: 0000000000000000f000000000000000, type: 0} + m_ShaderKeywords: + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _AlphaTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _BumpMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailAlbedoMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailNormalMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _EmissionMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MainTex: + m_Texture: {fileID: 2800000, guid: b382c41f6a534374390fe6d5e6e82ca8, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MetallicGlossMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OcclusionMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ParallaxMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - PixelSnap: 0 + - _BumpScale: 1 + - _Cutoff: 0.5 + - _DetailNormalMapScale: 1 + - _DstBlend: 0 + - _EnableExternalAlpha: 0 + - _GlossMapScale: 1 + - _Glossiness: 0.5 + - _GlossyReflections: 1 + - _Metallic: 0 + - _Mode: 0 + - _OcclusionStrength: 1 + - _Parallax: 0.02 + - _SmoothnessTextureChannel: 0 + - _SpecularHighlights: 1 + - _SrcBlend: 1 + - _UVSec: 0 + - _ZWrite: 1 + m_Colors: + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} + - _Flip: {r: 1, g: 1, b: 1, a: 1} + - _RendererColor: {r: 1, g: 1, b: 1, a: 1} diff --git a/Assets/Plugins/AllIn1SpriteShader/Demo/Materials/Sparks.mat.meta b/Assets/Plugins/AllIn1SpriteShader/Demo/Materials/Sparks.mat.meta new file mode 100644 index 000000000..6961f39a5 --- /dev/null +++ b/Assets/Plugins/AllIn1SpriteShader/Demo/Materials/Sparks.mat.meta @@ -0,0 +1,15 @@ +fileFormatVersion: 2 +guid: e2fd28a60d223ba4cb25e286da19b13a +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 2100000 + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 156513 + packageName: All In 1 Sprite Shader + packageVersion: 4.25 + assetPath: Assets/Plugins/AllIn1SpriteShader/Demo/Materials/Sparks.mat + uploadId: 708810 diff --git a/Assets/Plugins/AllIn1SpriteShader/Demo/PostProcessProfiles.meta b/Assets/Plugins/AllIn1SpriteShader/Demo/PostProcessProfiles.meta new file mode 100644 index 000000000..96e83daea --- /dev/null +++ b/Assets/Plugins/AllIn1SpriteShader/Demo/PostProcessProfiles.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: fb1e0660363295c4db411edfff6675eb +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/AllIn1SpriteShader/Demo/PostProcessProfiles/AllIn1PostProcessing.asset b/Assets/Plugins/AllIn1SpriteShader/Demo/PostProcessProfiles/AllIn1PostProcessing.asset new file mode 100644 index 000000000..7e842f855 --- /dev/null +++ b/Assets/Plugins/AllIn1SpriteShader/Demo/PostProcessProfiles/AllIn1PostProcessing.asset @@ -0,0 +1,108 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &-5917241030525834870 +MonoBehaviour: + m_ObjectHideFlags: 3 + 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: 48a79b01ea5641d4aa6daa2e23605641, type: 3} + m_Name: Bloom + m_EditorClassIdentifier: + active: 1 + enabled: + overrideState: 1 + value: 1 + intensity: + overrideState: 1 + value: 4 + threshold: + overrideState: 1 + value: 1.5 + softKnee: + overrideState: 1 + value: 1 + clamp: + overrideState: 1 + value: 65472 + diffusion: + overrideState: 1 + value: 4.95 + anamorphicRatio: + overrideState: 1 + value: 1 + color: + overrideState: 1 + value: {r: 1, g: 1, b: 1, a: 1} + fastMode: + overrideState: 1 + value: 0 + dirtTexture: + overrideState: 0 + value: {fileID: 0} + defaultState: 1 + dirtIntensity: + overrideState: 0 + value: 0 +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 8e6292b2c06870d4495f009f912b9600, type: 3} + m_Name: AllIn1PostProcessing + m_EditorClassIdentifier: + settings: + - {fileID: 56827712184524892} + - {fileID: -5917241030525834870} +--- !u!114 &56827712184524892 +MonoBehaviour: + m_ObjectHideFlags: 3 + 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: 40b924e2dad56384a8df2a1e111bb675, type: 3} + m_Name: Vignette + m_EditorClassIdentifier: + active: 1 + enabled: + overrideState: 1 + value: 1 + mode: + overrideState: 1 + value: 0 + color: + overrideState: 1 + value: {r: 0, g: 0, b: 0, a: 1} + center: + overrideState: 1 + value: {x: 0.5, y: 0.5} + intensity: + overrideState: 1 + value: 0.409 + smoothness: + overrideState: 1 + value: 0.779 + roundness: + overrideState: 1 + value: 0.8 + rounded: + overrideState: 1 + value: 0 + mask: + overrideState: 0 + value: {fileID: 0} + defaultState: 1 + opacity: + overrideState: 0 + value: 1 diff --git a/Assets/Plugins/AllIn1SpriteShader/Demo/PostProcessProfiles/AllIn1PostProcessing.asset.meta b/Assets/Plugins/AllIn1SpriteShader/Demo/PostProcessProfiles/AllIn1PostProcessing.asset.meta new file mode 100644 index 000000000..a1ece6c15 --- /dev/null +++ b/Assets/Plugins/AllIn1SpriteShader/Demo/PostProcessProfiles/AllIn1PostProcessing.asset.meta @@ -0,0 +1,15 @@ +fileFormatVersion: 2 +guid: c12f806a2a3ae954ebb1771c65441e4c +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 156513 + packageName: All In 1 Sprite Shader + packageVersion: 4.25 + assetPath: Assets/Plugins/AllIn1SpriteShader/Demo/PostProcessProfiles/AllIn1PostProcessing.asset + uploadId: 708810 diff --git a/Assets/Plugins/AllIn1SpriteShader/Demo/Prefabs.meta b/Assets/Plugins/AllIn1SpriteShader/Demo/Prefabs.meta new file mode 100644 index 000000000..628bd2fa7 --- /dev/null +++ b/Assets/Plugins/AllIn1SpriteShader/Demo/Prefabs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 1393ecda48f2f88439763bd3d4a263ac +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/AllIn1SpriteShader/Demo/Prefabs/Particle System Demo.prefab b/Assets/Plugins/AllIn1SpriteShader/Demo/Prefabs/Particle System Demo.prefab new file mode 100644 index 000000000..797575772 --- /dev/null +++ b/Assets/Plugins/AllIn1SpriteShader/Demo/Prefabs/Particle System Demo.prefab @@ -0,0 +1,5005 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1 &7935039278030221704 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 7935039278030221705} + - component: {fileID: 7935039278030221707} + - component: {fileID: 7935039278030221706} + m_Layer: 0 + m_Name: Title + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &7935039278030221705 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7935039278030221704} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: -2.51, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 7935039278937507618} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!23 &7935039278030221707 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7935039278030221704} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: a4e6a5491519adb45919dc87eff28e55, type: 3} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!102 &7935039278030221706 +TextMesh: + serializedVersion: 3 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7935039278030221704} + m_Text: Particle System + m_OffsetZ: -1.5 + m_CharacterSize: 0.075 + m_LineSpacing: 1 + m_Anchor: 4 + m_Alignment: 0 + m_TabSize: 4 + m_FontSize: 100 + m_FontStyle: 0 + m_RichText: 1 + m_Font: {fileID: 12800000, guid: a4e6a5491519adb45919dc87eff28e55, type: 3} + m_Color: + serializedVersion: 2 + rgba: 4294967295 +--- !u!1 &7935039278937507617 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 7935039278937507618} + - component: {fileID: 7935039278937507619} + m_Layer: 0 + m_Name: Particle System Demo + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &7935039278937507618 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7935039278937507617} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 220, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 7935039279205550810} + - {fileID: 7935039278030221705} + - {fileID: 7935039279796415622} + m_Father: {fileID: 0} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &7935039278937507619 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7935039278937507617} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 98b644315d7a92842b89e04f55c48e02, type: 3} + m_Name: + m_EditorClassIdentifier: +--- !u!1 &7935039279205550809 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 7935039279205550810} + - component: {fileID: 7935039279205550813} + - component: {fileID: 7935039279205550812} + - component: {fileID: 7935039279205550811} + m_Layer: 0 + m_Name: MagicSmokePs + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &7935039279205550810 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7935039279205550809} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 2.4465578, y: 2.4465578, z: 2.4465578} + m_Children: [] + m_Father: {fileID: 7935039278937507618} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: -90, y: 0, z: 0} +--- !u!198 &7935039279205550813 +ParticleSystem: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7935039279205550809} + serializedVersion: 6 + lengthInSec: 2 + simulationSpeed: 1 + stopAction: 0 + cullingMode: 0 + ringBufferMode: 0 + ringBufferLoopRange: {x: 0, y: 1} + looping: 1 + prewarm: 0 + playOnAwake: 1 + useUnscaledTime: 0 + autoRandomSeed: 1 + useRigidbodyForVelocity: 1 + startDelay: + serializedVersion: 2 + minMaxState: 0 + scalar: 0 + minScalar: 0 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + moveWithTransform: 0 + moveWithCustomTransform: {fileID: 0} + scalingMode: 1 + randomSeed: 0 + InitialModule: + serializedVersion: 3 + enabled: 1 + startLifetime: + serializedVersion: 2 + minMaxState: 0 + scalar: 2 + minScalar: 5 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + startSpeed: + serializedVersion: 2 + minMaxState: 0 + scalar: 0 + minScalar: 5 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + startColor: + serializedVersion: 2 + minMaxState: 2 + minColor: {r: 0.40085083, g: 0.254717, b: 1, a: 1} + maxColor: {r: 0.42329824, g: 0, b: 0.754717, a: 1} + maxGradient: + serializedVersion: 2 + key0: {r: 1, g: 1, b: 1, a: 1} + key1: {r: 1, g: 1, b: 1, a: 1} + key2: {r: 0, g: 0, b: 0, a: 0} + key3: {r: 0, g: 0, b: 0, a: 0} + key4: {r: 0, g: 0, b: 0, a: 0} + key5: {r: 0, g: 0, b: 0, a: 0} + key6: {r: 0, g: 0, b: 0, a: 0} + key7: {r: 0, g: 0, b: 0, a: 0} + ctime0: 0 + ctime1: 65535 + ctime2: 0 + ctime3: 0 + ctime4: 0 + ctime5: 0 + ctime6: 0 + ctime7: 0 + atime0: 0 + atime1: 65535 + atime2: 0 + atime3: 0 + atime4: 0 + atime5: 0 + atime6: 0 + atime7: 0 + m_Mode: 0 + m_NumColorKeys: 2 + m_NumAlphaKeys: 2 + minGradient: + serializedVersion: 2 + key0: {r: 1, g: 1, b: 1, a: 1} + key1: {r: 1, g: 1, b: 1, a: 1} + key2: {r: 0, g: 0, b: 0, a: 0} + key3: {r: 0, g: 0, b: 0, a: 0} + key4: {r: 0, g: 0, b: 0, a: 0} + key5: {r: 0, g: 0, b: 0, a: 0} + key6: {r: 0, g: 0, b: 0, a: 0} + key7: {r: 0, g: 0, b: 0, a: 0} + ctime0: 0 + ctime1: 65535 + ctime2: 0 + ctime3: 0 + ctime4: 0 + ctime5: 0 + ctime6: 0 + ctime7: 0 + atime0: 0 + atime1: 65535 + atime2: 0 + atime3: 0 + atime4: 0 + atime5: 0 + atime6: 0 + atime7: 0 + m_Mode: 0 + m_NumColorKeys: 2 + m_NumAlphaKeys: 2 + startSize: + serializedVersion: 2 + minMaxState: 3 + scalar: 5.5 + minScalar: 1 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + startSizeY: + serializedVersion: 2 + minMaxState: 3 + scalar: 1 + minScalar: 1 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + startSizeZ: + serializedVersion: 2 + minMaxState: 3 + scalar: 1 + minScalar: 1 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + startRotationX: + serializedVersion: 2 + minMaxState: 3 + scalar: 0 + minScalar: 0 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + startRotationY: + serializedVersion: 2 + minMaxState: 3 + scalar: 0 + minScalar: 0 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + startRotation: + serializedVersion: 2 + minMaxState: 3 + scalar: 6.283185 + minScalar: 0 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + randomizeRotationDirection: 0 + maxNumParticles: 1000 + size3D: 0 + rotation3D: 0 + gravityModifier: + serializedVersion: 2 + minMaxState: 0 + scalar: 0 + minScalar: 0 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + ShapeModule: + serializedVersion: 6 + enabled: 1 + type: 10 + angle: 25 + length: 5 + boxThickness: {x: 0, y: 0, z: 0} + radiusThickness: 1 + donutRadius: 0.2 + m_Position: {x: 0, y: 0, z: 0} + m_Rotation: {x: 0, y: 0, z: 0} + m_Scale: {x: 1, y: 1, z: 1} + placementMode: 0 + m_MeshMaterialIndex: 0 + m_MeshNormalOffset: 0 + m_MeshSpawn: + mode: 0 + spread: 0 + speed: + serializedVersion: 2 + minMaxState: 0 + scalar: 1 + minScalar: 1 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + m_Mesh: {fileID: 0} + m_MeshRenderer: {fileID: 0} + m_SkinnedMeshRenderer: {fileID: 0} + m_Sprite: {fileID: 0} + m_SpriteRenderer: {fileID: 0} + m_UseMeshMaterialIndex: 0 + m_UseMeshColors: 1 + alignToDirection: 0 + m_Texture: {fileID: 0} + m_TextureClipChannel: 3 + m_TextureClipThreshold: 0 + m_TextureUVChannel: 0 + m_TextureColorAffectsParticles: 1 + m_TextureAlphaAffectsParticles: 1 + m_TextureBilinearFiltering: 0 + randomDirectionAmount: 0 + sphericalDirectionAmount: 0 + randomPositionAmount: 0 + radius: + value: 0.13 + mode: 0 + spread: 0 + speed: + serializedVersion: 2 + minMaxState: 0 + scalar: 1 + minScalar: 1 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + arc: + value: 360 + mode: 0 + spread: 0 + speed: + serializedVersion: 2 + minMaxState: 0 + scalar: 1 + minScalar: 1 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + EmissionModule: + enabled: 1 + serializedVersion: 4 + rateOverTime: + serializedVersion: 2 + minMaxState: 0 + scalar: 10 + minScalar: 10 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + rateOverDistance: + serializedVersion: 2 + minMaxState: 0 + scalar: 0 + minScalar: 0 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + m_BurstCount: 0 + m_Bursts: [] + SizeModule: + enabled: 1 + curve: + serializedVersion: 2 + minMaxState: 1 + scalar: 1 + minScalar: 1 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 1 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 1 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + y: + serializedVersion: 2 + minMaxState: 1 + scalar: 1 + minScalar: 1 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 1 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 1 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + z: + serializedVersion: 2 + minMaxState: 1 + scalar: 1 + minScalar: 1 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 1 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 1 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + separateAxes: 0 + RotationModule: + enabled: 1 + x: + serializedVersion: 2 + minMaxState: 3 + scalar: 0 + minScalar: 0 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + y: + serializedVersion: 2 + minMaxState: 3 + scalar: 0 + minScalar: 0 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + curve: + serializedVersion: 2 + minMaxState: 3 + scalar: 2.6179938 + minScalar: -2.6179938 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + separateAxes: 0 + ColorModule: + enabled: 1 + gradient: + serializedVersion: 2 + minMaxState: 1 + minColor: {r: 1, g: 1, b: 1, a: 1} + maxColor: {r: 1, g: 1, b: 1, a: 1} + maxGradient: + serializedVersion: 2 + key0: {r: 1, g: 1, b: 1, a: 0} + key1: {r: 1, g: 1, b: 1, a: 1} + key2: {r: 0, g: 0, b: 0, a: 0} + key3: {r: 0, g: 0, b: 0, a: 0} + key4: {r: 0, g: 0, b: 0, a: 0} + key5: {r: 0, g: 0, b: 0, a: 0} + key6: {r: 0, g: 0, b: 0, a: 0} + key7: {r: 0, g: 0, b: 0, a: 0} + ctime0: 0 + ctime1: 65535 + ctime2: 0 + ctime3: 0 + ctime4: 0 + ctime5: 0 + ctime6: 0 + ctime7: 0 + atime0: 0 + atime1: 31552 + atime2: 65535 + atime3: 65535 + atime4: 0 + atime5: 0 + atime6: 0 + atime7: 0 + m_Mode: 0 + m_NumColorKeys: 2 + m_NumAlphaKeys: 3 + minGradient: + serializedVersion: 2 + key0: {r: 1, g: 1, b: 1, a: 1} + key1: {r: 1, g: 1, b: 1, a: 1} + key2: {r: 0, g: 0, b: 0, a: 0} + key3: {r: 0, g: 0, b: 0, a: 0} + key4: {r: 0, g: 0, b: 0, a: 0} + key5: {r: 0, g: 0, b: 0, a: 0} + key6: {r: 0, g: 0, b: 0, a: 0} + key7: {r: 0, g: 0, b: 0, a: 0} + ctime0: 0 + ctime1: 65535 + ctime2: 0 + ctime3: 0 + ctime4: 0 + ctime5: 0 + ctime6: 0 + ctime7: 0 + atime0: 0 + atime1: 65535 + atime2: 0 + atime3: 0 + atime4: 0 + atime5: 0 + atime6: 0 + atime7: 0 + m_Mode: 0 + m_NumColorKeys: 2 + m_NumAlphaKeys: 2 + UVModule: + serializedVersion: 2 + enabled: 0 + mode: 0 + timeMode: 0 + fps: 30 + frameOverTime: + serializedVersion: 2 + minMaxState: 1 + scalar: 0.9999 + minScalar: 0.9999 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 1 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 1 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + startFrame: + serializedVersion: 2 + minMaxState: 0 + scalar: 0 + minScalar: 0 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + speedRange: {x: 0, y: 1} + tilesX: 1 + tilesY: 1 + animationType: 0 + rowIndex: 0 + cycles: 1 + uvChannelMask: -1 + rowMode: 1 + sprites: + - sprite: {fileID: 0} + flipU: 0 + flipV: 0 + VelocityModule: + enabled: 0 + x: + serializedVersion: 2 + minMaxState: 0 + scalar: 0 + minScalar: 0 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + y: + serializedVersion: 2 + minMaxState: 0 + scalar: 0 + minScalar: 0 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + z: + serializedVersion: 2 + minMaxState: 0 + scalar: 0 + minScalar: 0 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + orbitalX: + serializedVersion: 2 + minMaxState: 0 + scalar: 0 + minScalar: 0 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + orbitalY: + serializedVersion: 2 + minMaxState: 0 + scalar: 0 + minScalar: 0 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + orbitalZ: + serializedVersion: 2 + minMaxState: 0 + scalar: 0 + minScalar: 0 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + orbitalOffsetX: + serializedVersion: 2 + minMaxState: 0 + scalar: 0 + minScalar: 0 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + orbitalOffsetY: + serializedVersion: 2 + minMaxState: 0 + scalar: 0 + minScalar: 0 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + orbitalOffsetZ: + serializedVersion: 2 + minMaxState: 0 + scalar: 0 + minScalar: 0 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + radial: + serializedVersion: 2 + minMaxState: 0 + scalar: 0 + minScalar: 0 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + speedModifier: + serializedVersion: 2 + minMaxState: 0 + scalar: 1 + minScalar: 1 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + inWorldSpace: 0 + InheritVelocityModule: + enabled: 0 + m_Mode: 0 + m_Curve: + serializedVersion: 2 + minMaxState: 0 + scalar: 0 + minScalar: 0 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + ForceModule: + enabled: 0 + x: + serializedVersion: 2 + minMaxState: 0 + scalar: 0 + minScalar: 0 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + y: + serializedVersion: 2 + minMaxState: 0 + scalar: 0 + minScalar: 0 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + z: + serializedVersion: 2 + minMaxState: 0 + scalar: 0 + minScalar: 0 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + inWorldSpace: 0 + randomizePerFrame: 0 + ExternalForcesModule: + serializedVersion: 2 + enabled: 0 + multiplierCurve: + serializedVersion: 2 + minMaxState: 0 + scalar: 1 + minScalar: 1 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + influenceFilter: 0 + influenceMask: + serializedVersion: 2 + m_Bits: 4294967295 + influenceList: [] + ClampVelocityModule: + enabled: 0 + x: + serializedVersion: 2 + minMaxState: 0 + scalar: 1 + minScalar: 1 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + y: + serializedVersion: 2 + minMaxState: 0 + scalar: 1 + minScalar: 1 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + z: + serializedVersion: 2 + minMaxState: 0 + scalar: 1 + minScalar: 1 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + magnitude: + serializedVersion: 2 + minMaxState: 0 + scalar: 1 + minScalar: 1 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + separateAxis: 0 + inWorldSpace: 0 + multiplyDragByParticleSize: 1 + multiplyDragByParticleVelocity: 1 + dampen: 0 + drag: + serializedVersion: 2 + minMaxState: 0 + scalar: 0 + minScalar: 0 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + NoiseModule: + enabled: 0 + strength: + serializedVersion: 2 + minMaxState: 0 + scalar: 1 + minScalar: 1 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + strengthY: + serializedVersion: 2 + minMaxState: 0 + scalar: 1 + minScalar: 1 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + strengthZ: + serializedVersion: 2 + minMaxState: 0 + scalar: 1 + minScalar: 1 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + separateAxes: 0 + frequency: 0.5 + damping: 1 + octaves: 1 + octaveMultiplier: 0.5 + octaveScale: 2 + quality: 2 + scrollSpeed: + serializedVersion: 2 + minMaxState: 0 + scalar: 0 + minScalar: 0 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + remap: + serializedVersion: 2 + minMaxState: 1 + scalar: 1 + minScalar: 1 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 1 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 1 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + remapY: + serializedVersion: 2 + minMaxState: 1 + scalar: 1 + minScalar: 1 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 1 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 1 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + remapZ: + serializedVersion: 2 + minMaxState: 1 + scalar: 1 + minScalar: 1 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 1 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 1 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + remapEnabled: 0 + positionAmount: + serializedVersion: 2 + minMaxState: 0 + scalar: 1 + minScalar: 1 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + rotationAmount: + serializedVersion: 2 + minMaxState: 0 + scalar: 0 + minScalar: 0 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + sizeAmount: + serializedVersion: 2 + minMaxState: 0 + scalar: 0 + minScalar: 0 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + SizeBySpeedModule: + enabled: 0 + curve: + serializedVersion: 2 + minMaxState: 1 + scalar: 1 + minScalar: 1 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 1 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 1 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + y: + serializedVersion: 2 + minMaxState: 1 + scalar: 1 + minScalar: 1 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 1 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 1 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + z: + serializedVersion: 2 + minMaxState: 1 + scalar: 1 + minScalar: 1 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 1 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 1 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + range: {x: 0, y: 1} + separateAxes: 0 + RotationBySpeedModule: + enabled: 0 + x: + serializedVersion: 2 + minMaxState: 0 + scalar: 0 + minScalar: 0 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + y: + serializedVersion: 2 + minMaxState: 0 + scalar: 0 + minScalar: 0 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + curve: + serializedVersion: 2 + minMaxState: 0 + scalar: 0.7853982 + minScalar: 0.7853982 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + separateAxes: 0 + range: {x: 0, y: 1} + ColorBySpeedModule: + enabled: 0 + gradient: + serializedVersion: 2 + minMaxState: 1 + minColor: {r: 1, g: 1, b: 1, a: 1} + maxColor: {r: 1, g: 1, b: 1, a: 1} + maxGradient: + serializedVersion: 2 + key0: {r: 1, g: 1, b: 1, a: 1} + key1: {r: 1, g: 1, b: 1, a: 1} + key2: {r: 0, g: 0, b: 0, a: 0} + key3: {r: 0, g: 0, b: 0, a: 0} + key4: {r: 0, g: 0, b: 0, a: 0} + key5: {r: 0, g: 0, b: 0, a: 0} + key6: {r: 0, g: 0, b: 0, a: 0} + key7: {r: 0, g: 0, b: 0, a: 0} + ctime0: 0 + ctime1: 65535 + ctime2: 0 + ctime3: 0 + ctime4: 0 + ctime5: 0 + ctime6: 0 + ctime7: 0 + atime0: 0 + atime1: 65535 + atime2: 0 + atime3: 0 + atime4: 0 + atime5: 0 + atime6: 0 + atime7: 0 + m_Mode: 0 + m_NumColorKeys: 2 + m_NumAlphaKeys: 2 + minGradient: + serializedVersion: 2 + key0: {r: 1, g: 1, b: 1, a: 1} + key1: {r: 1, g: 1, b: 1, a: 1} + key2: {r: 0, g: 0, b: 0, a: 0} + key3: {r: 0, g: 0, b: 0, a: 0} + key4: {r: 0, g: 0, b: 0, a: 0} + key5: {r: 0, g: 0, b: 0, a: 0} + key6: {r: 0, g: 0, b: 0, a: 0} + key7: {r: 0, g: 0, b: 0, a: 0} + ctime0: 0 + ctime1: 65535 + ctime2: 0 + ctime3: 0 + ctime4: 0 + ctime5: 0 + ctime6: 0 + ctime7: 0 + atime0: 0 + atime1: 65535 + atime2: 0 + atime3: 0 + atime4: 0 + atime5: 0 + atime6: 0 + atime7: 0 + m_Mode: 0 + m_NumColorKeys: 2 + m_NumAlphaKeys: 2 + range: {x: 0, y: 1} + CollisionModule: + enabled: 0 + serializedVersion: 3 + type: 0 + collisionMode: 0 + colliderForce: 0 + multiplyColliderForceByParticleSize: 0 + multiplyColliderForceByParticleSpeed: 0 + multiplyColliderForceByCollisionAngle: 1 + plane0: {fileID: 0} + plane1: {fileID: 0} + plane2: {fileID: 0} + plane3: {fileID: 0} + plane4: {fileID: 0} + plane5: {fileID: 0} + m_Dampen: + serializedVersion: 2 + minMaxState: 0 + scalar: 0 + minScalar: 0 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + m_Bounce: + serializedVersion: 2 + minMaxState: 0 + scalar: 1 + minScalar: 1 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + m_EnergyLossOnCollision: + serializedVersion: 2 + minMaxState: 0 + scalar: 0 + minScalar: 0 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minKillSpeed: 0 + maxKillSpeed: 10000 + radiusScale: 1 + collidesWith: + serializedVersion: 2 + m_Bits: 4294967295 + maxCollisionShapes: 256 + quality: 0 + voxelSize: 0.5 + collisionMessages: 0 + collidesWithDynamic: 1 + interiorCollisions: 0 + TriggerModule: + enabled: 0 + collisionShape0: {fileID: 0} + collisionShape1: {fileID: 0} + collisionShape2: {fileID: 0} + collisionShape3: {fileID: 0} + collisionShape4: {fileID: 0} + collisionShape5: {fileID: 0} + inside: 1 + outside: 0 + enter: 0 + exit: 0 + radiusScale: 1 + SubModule: + serializedVersion: 2 + enabled: 0 + subEmitters: + - serializedVersion: 3 + emitter: {fileID: 0} + type: 0 + properties: 0 + emitProbability: 1 + LightsModule: + enabled: 0 + ratio: 0 + light: {fileID: 0} + randomDistribution: 1 + color: 1 + range: 1 + intensity: 1 + rangeCurve: + serializedVersion: 2 + minMaxState: 0 + scalar: 1 + minScalar: 1 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + intensityCurve: + serializedVersion: 2 + minMaxState: 0 + scalar: 1 + minScalar: 1 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + maxLights: 20 + TrailModule: + enabled: 0 + mode: 0 + ratio: 1 + lifetime: + serializedVersion: 2 + minMaxState: 0 + scalar: 1 + minScalar: 1 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minVertexDistance: 0.2 + textureMode: 0 + ribbonCount: 1 + shadowBias: 0.5 + worldSpace: 0 + dieWithParticles: 1 + sizeAffectsWidth: 1 + sizeAffectsLifetime: 0 + inheritParticleColor: 1 + generateLightingData: 0 + splitSubEmitterRibbons: 0 + attachRibbonsToTransform: 0 + colorOverLifetime: + serializedVersion: 2 + minMaxState: 0 + minColor: {r: 1, g: 1, b: 1, a: 1} + maxColor: {r: 1, g: 1, b: 1, a: 1} + maxGradient: + serializedVersion: 2 + key0: {r: 1, g: 1, b: 1, a: 1} + key1: {r: 1, g: 1, b: 1, a: 1} + key2: {r: 0, g: 0, b: 0, a: 0} + key3: {r: 0, g: 0, b: 0, a: 0} + key4: {r: 0, g: 0, b: 0, a: 0} + key5: {r: 0, g: 0, b: 0, a: 0} + key6: {r: 0, g: 0, b: 0, a: 0} + key7: {r: 0, g: 0, b: 0, a: 0} + ctime0: 0 + ctime1: 65535 + ctime2: 0 + ctime3: 0 + ctime4: 0 + ctime5: 0 + ctime6: 0 + ctime7: 0 + atime0: 0 + atime1: 65535 + atime2: 0 + atime3: 0 + atime4: 0 + atime5: 0 + atime6: 0 + atime7: 0 + m_Mode: 0 + m_NumColorKeys: 2 + m_NumAlphaKeys: 2 + minGradient: + serializedVersion: 2 + key0: {r: 1, g: 1, b: 1, a: 1} + key1: {r: 1, g: 1, b: 1, a: 1} + key2: {r: 0, g: 0, b: 0, a: 0} + key3: {r: 0, g: 0, b: 0, a: 0} + key4: {r: 0, g: 0, b: 0, a: 0} + key5: {r: 0, g: 0, b: 0, a: 0} + key6: {r: 0, g: 0, b: 0, a: 0} + key7: {r: 0, g: 0, b: 0, a: 0} + ctime0: 0 + ctime1: 65535 + ctime2: 0 + ctime3: 0 + ctime4: 0 + ctime5: 0 + ctime6: 0 + ctime7: 0 + atime0: 0 + atime1: 65535 + atime2: 0 + atime3: 0 + atime4: 0 + atime5: 0 + atime6: 0 + atime7: 0 + m_Mode: 0 + m_NumColorKeys: 2 + m_NumAlphaKeys: 2 + widthOverTrail: + serializedVersion: 2 + minMaxState: 0 + scalar: 1 + minScalar: 1 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + colorOverTrail: + serializedVersion: 2 + minMaxState: 0 + minColor: {r: 1, g: 1, b: 1, a: 1} + maxColor: {r: 1, g: 1, b: 1, a: 1} + maxGradient: + serializedVersion: 2 + key0: {r: 1, g: 1, b: 1, a: 1} + key1: {r: 1, g: 1, b: 1, a: 1} + key2: {r: 0, g: 0, b: 0, a: 0} + key3: {r: 0, g: 0, b: 0, a: 0} + key4: {r: 0, g: 0, b: 0, a: 0} + key5: {r: 0, g: 0, b: 0, a: 0} + key6: {r: 0, g: 0, b: 0, a: 0} + key7: {r: 0, g: 0, b: 0, a: 0} + ctime0: 0 + ctime1: 65535 + ctime2: 0 + ctime3: 0 + ctime4: 0 + ctime5: 0 + ctime6: 0 + ctime7: 0 + atime0: 0 + atime1: 65535 + atime2: 0 + atime3: 0 + atime4: 0 + atime5: 0 + atime6: 0 + atime7: 0 + m_Mode: 0 + m_NumColorKeys: 2 + m_NumAlphaKeys: 2 + minGradient: + serializedVersion: 2 + key0: {r: 1, g: 1, b: 1, a: 1} + key1: {r: 1, g: 1, b: 1, a: 1} + key2: {r: 0, g: 0, b: 0, a: 0} + key3: {r: 0, g: 0, b: 0, a: 0} + key4: {r: 0, g: 0, b: 0, a: 0} + key5: {r: 0, g: 0, b: 0, a: 0} + key6: {r: 0, g: 0, b: 0, a: 0} + key7: {r: 0, g: 0, b: 0, a: 0} + ctime0: 0 + ctime1: 65535 + ctime2: 0 + ctime3: 0 + ctime4: 0 + ctime5: 0 + ctime6: 0 + ctime7: 0 + atime0: 0 + atime1: 65535 + atime2: 0 + atime3: 0 + atime4: 0 + atime5: 0 + atime6: 0 + atime7: 0 + m_Mode: 0 + m_NumColorKeys: 2 + m_NumAlphaKeys: 2 + CustomDataModule: + enabled: 0 + mode0: 0 + vectorComponentCount0: 4 + color0: + serializedVersion: 2 + minMaxState: 0 + minColor: {r: 1, g: 1, b: 1, a: 1} + maxColor: {r: 1, g: 1, b: 1, a: 1} + maxGradient: + serializedVersion: 2 + key0: {r: 1, g: 1, b: 1, a: 1} + key1: {r: 1, g: 1, b: 1, a: 1} + key2: {r: 0, g: 0, b: 0, a: 0} + key3: {r: 0, g: 0, b: 0, a: 0} + key4: {r: 0, g: 0, b: 0, a: 0} + key5: {r: 0, g: 0, b: 0, a: 0} + key6: {r: 0, g: 0, b: 0, a: 0} + key7: {r: 0, g: 0, b: 0, a: 0} + ctime0: 0 + ctime1: 65535 + ctime2: 0 + ctime3: 0 + ctime4: 0 + ctime5: 0 + ctime6: 0 + ctime7: 0 + atime0: 0 + atime1: 65535 + atime2: 0 + atime3: 0 + atime4: 0 + atime5: 0 + atime6: 0 + atime7: 0 + m_Mode: 0 + m_NumColorKeys: 2 + m_NumAlphaKeys: 2 + minGradient: + serializedVersion: 2 + key0: {r: 1, g: 1, b: 1, a: 1} + key1: {r: 1, g: 1, b: 1, a: 1} + key2: {r: 0, g: 0, b: 0, a: 0} + key3: {r: 0, g: 0, b: 0, a: 0} + key4: {r: 0, g: 0, b: 0, a: 0} + key5: {r: 0, g: 0, b: 0, a: 0} + key6: {r: 0, g: 0, b: 0, a: 0} + key7: {r: 0, g: 0, b: 0, a: 0} + ctime0: 0 + ctime1: 65535 + ctime2: 0 + ctime3: 0 + ctime4: 0 + ctime5: 0 + ctime6: 0 + ctime7: 0 + atime0: 0 + atime1: 65535 + atime2: 0 + atime3: 0 + atime4: 0 + atime5: 0 + atime6: 0 + atime7: 0 + m_Mode: 0 + m_NumColorKeys: 2 + m_NumAlphaKeys: 2 + colorLabel0: Color + vector0_0: + serializedVersion: 2 + minMaxState: 0 + scalar: 0 + minScalar: 0 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + vectorLabel0_0: X + vector0_1: + serializedVersion: 2 + minMaxState: 0 + scalar: 0 + minScalar: 0 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + vectorLabel0_1: Y + vector0_2: + serializedVersion: 2 + minMaxState: 0 + scalar: 0 + minScalar: 0 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + vectorLabel0_2: Z + vector0_3: + serializedVersion: 2 + minMaxState: 0 + scalar: 0 + minScalar: 0 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + vectorLabel0_3: W + mode1: 0 + vectorComponentCount1: 4 + color1: + serializedVersion: 2 + minMaxState: 0 + minColor: {r: 1, g: 1, b: 1, a: 1} + maxColor: {r: 1, g: 1, b: 1, a: 1} + maxGradient: + serializedVersion: 2 + key0: {r: 1, g: 1, b: 1, a: 1} + key1: {r: 1, g: 1, b: 1, a: 1} + key2: {r: 0, g: 0, b: 0, a: 0} + key3: {r: 0, g: 0, b: 0, a: 0} + key4: {r: 0, g: 0, b: 0, a: 0} + key5: {r: 0, g: 0, b: 0, a: 0} + key6: {r: 0, g: 0, b: 0, a: 0} + key7: {r: 0, g: 0, b: 0, a: 0} + ctime0: 0 + ctime1: 65535 + ctime2: 0 + ctime3: 0 + ctime4: 0 + ctime5: 0 + ctime6: 0 + ctime7: 0 + atime0: 0 + atime1: 65535 + atime2: 0 + atime3: 0 + atime4: 0 + atime5: 0 + atime6: 0 + atime7: 0 + m_Mode: 0 + m_NumColorKeys: 2 + m_NumAlphaKeys: 2 + minGradient: + serializedVersion: 2 + key0: {r: 1, g: 1, b: 1, a: 1} + key1: {r: 1, g: 1, b: 1, a: 1} + key2: {r: 0, g: 0, b: 0, a: 0} + key3: {r: 0, g: 0, b: 0, a: 0} + key4: {r: 0, g: 0, b: 0, a: 0} + key5: {r: 0, g: 0, b: 0, a: 0} + key6: {r: 0, g: 0, b: 0, a: 0} + key7: {r: 0, g: 0, b: 0, a: 0} + ctime0: 0 + ctime1: 65535 + ctime2: 0 + ctime3: 0 + ctime4: 0 + ctime5: 0 + ctime6: 0 + ctime7: 0 + atime0: 0 + atime1: 65535 + atime2: 0 + atime3: 0 + atime4: 0 + atime5: 0 + atime6: 0 + atime7: 0 + m_Mode: 0 + m_NumColorKeys: 2 + m_NumAlphaKeys: 2 + colorLabel1: Color + vector1_0: + serializedVersion: 2 + minMaxState: 0 + scalar: 0 + minScalar: 0 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + vectorLabel1_0: X + vector1_1: + serializedVersion: 2 + minMaxState: 0 + scalar: 0 + minScalar: 0 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + vectorLabel1_1: Y + vector1_2: + serializedVersion: 2 + minMaxState: 0 + scalar: 0 + minScalar: 0 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + vectorLabel1_2: Z + vector1_3: + serializedVersion: 2 + minMaxState: 0 + scalar: 0 + minScalar: 0 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + vectorLabel1_3: W +--- !u!199 &7935039279205550812 +ParticleSystemRenderer: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7935039279205550809} + m_Enabled: 1 + m_CastShadows: 0 + m_ReceiveShadows: 0 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 0 + m_ReflectionProbeUsage: 0 + m_RayTracingMode: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 0} + - {fileID: 0} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_RenderMode: 0 + m_SortMode: 3 + m_MinParticleSize: 0 + m_MaxParticleSize: 0.5 + m_CameraVelocityScale: 0 + m_VelocityScale: 0 + m_LengthScale: 2 + m_SortingFudge: 0 + m_NormalDirection: 1 + m_ShadowBias: 0 + m_RenderAlignment: 0 + m_Pivot: {x: 0, y: 0, z: 0} + m_Flip: {x: 0, y: 0, z: 0} + m_UseCustomVertexStreams: 0 + m_EnableGPUInstancing: 1 + m_ApplyActiveColorSpace: 1 + m_AllowRoll: 1 + m_VertexStreams: 00010304 + m_Mesh: {fileID: 0} + m_Mesh1: {fileID: 0} + m_Mesh2: {fileID: 0} + m_Mesh3: {fileID: 0} + m_MaskInteraction: 0 +--- !u!114 &7935039279205550811 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7935039279205550809} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: ee158225ee1e59f4791627785501d950, type: 3} + m_Name: + m_EditorClassIdentifier: + shaderTypes: 0 + normalStrength: 5 + normalSmoothing: 1 + computingNormal: 0 +--- !u!1 &7935039279796415621 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 7935039279796415622} + - component: {fileID: 7935039279796415672} + - component: {fileID: 7935039279796415623} + m_Layer: 0 + m_Name: Animated + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 0 +--- !u!4 &7935039279796415622 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7935039279796415621} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: -3.57, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 7935039278937507618} + m_RootOrder: 2 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!23 &7935039279796415672 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7935039279796415621} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: a4e6a5491519adb45919dc87eff28e55, type: 3} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!102 &7935039279796415623 +TextMesh: + serializedVersion: 3 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7935039279796415621} + m_Text: (Has Animation) + m_OffsetZ: -1.5 + m_CharacterSize: 0.075 + m_LineSpacing: 1 + m_Anchor: 4 + m_Alignment: 0 + m_TabSize: 4 + m_FontSize: 100 + m_FontStyle: 0 + m_RichText: 1 + m_Font: {fileID: 12800000, guid: a4e6a5491519adb45919dc87eff28e55, type: 3} + m_Color: + serializedVersion: 2 + rgba: 4294967295 diff --git a/Assets/Plugins/AllIn1SpriteShader/Demo/Prefabs/Particle System Demo.prefab.meta b/Assets/Plugins/AllIn1SpriteShader/Demo/Prefabs/Particle System Demo.prefab.meta new file mode 100644 index 000000000..fd7d80086 --- /dev/null +++ b/Assets/Plugins/AllIn1SpriteShader/Demo/Prefabs/Particle System Demo.prefab.meta @@ -0,0 +1,14 @@ +fileFormatVersion: 2 +guid: 161eac4f3ec2ef344ae473e275658ecf +PrefabImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 156513 + packageName: All In 1 Sprite Shader + packageVersion: 4.25 + assetPath: Assets/Plugins/AllIn1SpriteShader/Demo/Prefabs/Particle System Demo.prefab + uploadId: 708810 diff --git a/Assets/Plugins/AllIn1SpriteShader/Demo/Prefabs/Shield Soldier Demo.prefab b/Assets/Plugins/AllIn1SpriteShader/Demo/Prefabs/Shield Soldier Demo.prefab new file mode 100644 index 000000000..ba7cbad03 --- /dev/null +++ b/Assets/Plugins/AllIn1SpriteShader/Demo/Prefabs/Shield Soldier Demo.prefab @@ -0,0 +1,5267 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1 &3864259598328230473 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 3864259598328230474} + - component: {fileID: 3864259598328230476} + - component: {fileID: 3864259598328230475} + m_Layer: 0 + m_Name: Title + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &3864259598328230474 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3864259598328230473} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: -3.1267126, z: 0} + m_LocalScale: {x: 1.2457023, y: 1.2457023, z: 1.2457023} + m_Children: [] + m_Father: {fileID: 3864259599682641153} + m_RootOrder: 2 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!23 &3864259598328230476 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3864259598328230473} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: a4e6a5491519adb45919dc87eff28e55, type: 3} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!102 &3864259598328230475 +TextMesh: + serializedVersion: 3 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3864259598328230473} + m_Text: Shield Soldier + m_OffsetZ: -1.5 + m_CharacterSize: 0.075 + m_LineSpacing: 1 + m_Anchor: 4 + m_Alignment: 0 + m_TabSize: 4 + m_FontSize: 100 + m_FontStyle: 0 + m_RichText: 1 + m_Font: {fileID: 12800000, guid: a4e6a5491519adb45919dc87eff28e55, type: 3} + m_Color: + serializedVersion: 2 + rgba: 4294967295 +--- !u!1 &3864259598540621426 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 3864259598540621427} + - component: {fileID: 3864259598540621429} + - component: {fileID: 3864259598540621428} + m_Layer: 0 + m_Name: Animated + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &3864259598540621427 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3864259598540621426} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: -4.447157, z: 0} + m_LocalScale: {x: 1.2457023, y: 1.2457023, z: 1.2457023} + m_Children: [] + m_Father: {fileID: 3864259599682641153} + m_RootOrder: 3 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!23 &3864259598540621429 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3864259598540621426} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: a4e6a5491519adb45919dc87eff28e55, type: 3} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!102 &3864259598540621428 +TextMesh: + serializedVersion: 3 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3864259598540621426} + m_Text: (Sprite Mask and Particles) + m_OffsetZ: -1.5 + m_CharacterSize: 0.05 + m_LineSpacing: 1 + m_Anchor: 4 + m_Alignment: 0 + m_TabSize: 4 + m_FontSize: 100 + m_FontStyle: 0 + m_RichText: 1 + m_Font: {fileID: 12800000, guid: a4e6a5491519adb45919dc87eff28e55, type: 3} + m_Color: + serializedVersion: 2 + rgba: 4294967295 +--- !u!1 &3864259599192371921 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 3864259599192371922} + - component: {fileID: 3864259599192371923} + m_Layer: 0 + m_Name: Shield + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &3864259599192371922 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3864259599192371921} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0.0582, y: 0.0478, z: -0.1} + m_LocalScale: {x: 1.3402556, y: 1.4230473, z: 1} + m_Children: [] + m_Father: {fileID: 3864259599682641153} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!212 &3864259599192371923 +SpriteRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3864259599192371921} + m_Enabled: 1 + m_CastShadows: 0 + m_ReceiveShadows: 0 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: 4396a2d1265c9414e810fdf77d8238b5, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 0 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_Sprite: {fileID: 21300000, guid: 2f5c9cbfde2d0384bb53189b0d0f06d8, type: 3} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_FlipX: 0 + m_FlipY: 0 + m_DrawMode: 0 + m_Size: {x: 5.12, y: 5.12} + m_AdaptiveModeThreshold: 0.5 + m_SpriteTileMode: 0 + m_WasSpriteAssigned: 1 + m_MaskInteraction: 1 + m_SpriteSortPoint: 0 +--- !u!1 &3864259599213150330 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 3864259599213150331} + - component: {fileID: 3864259599213150333} + - component: {fileID: 3864259599213150332} + m_Layer: 0 + m_Name: ShieldSparksPS + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &3864259599213150331 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3864259599213150330} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: -0.058, y: 0.038, z: -0.1} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 3864259599682641153} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: -90, y: 0, z: 0} +--- !u!198 &3864259599213150333 +ParticleSystem: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3864259599213150330} + serializedVersion: 6 + lengthInSec: 1 + simulationSpeed: 1 + stopAction: 0 + cullingMode: 0 + ringBufferMode: 0 + ringBufferLoopRange: {x: 0, y: 1} + looping: 1 + prewarm: 0 + playOnAwake: 1 + useUnscaledTime: 0 + autoRandomSeed: 1 + useRigidbodyForVelocity: 1 + startDelay: + serializedVersion: 2 + minMaxState: 0 + scalar: 0 + minScalar: 0 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + moveWithTransform: 1 + moveWithCustomTransform: {fileID: 0} + scalingMode: 1 + randomSeed: 0 + InitialModule: + serializedVersion: 3 + enabled: 1 + startLifetime: + serializedVersion: 2 + minMaxState: 0 + scalar: 0.75 + minScalar: 5 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + startSpeed: + serializedVersion: 2 + minMaxState: 3 + scalar: 0.2 + minScalar: 0 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + startColor: + serializedVersion: 2 + minMaxState: 2 + minColor: {r: 0.009433985, g: 1, b: 0.9403363, a: 1} + maxColor: {r: 1, g: 1, b: 1, a: 1} + maxGradient: + serializedVersion: 2 + key0: {r: 1, g: 1, b: 1, a: 1} + key1: {r: 1, g: 1, b: 1, a: 1} + key2: {r: 0, g: 0, b: 0, a: 0} + key3: {r: 0, g: 0, b: 0, a: 0} + key4: {r: 0, g: 0, b: 0, a: 0} + key5: {r: 0, g: 0, b: 0, a: 0} + key6: {r: 0, g: 0, b: 0, a: 0} + key7: {r: 0, g: 0, b: 0, a: 0} + ctime0: 0 + ctime1: 65535 + ctime2: 0 + ctime3: 0 + ctime4: 0 + ctime5: 0 + ctime6: 0 + ctime7: 0 + atime0: 0 + atime1: 65535 + atime2: 0 + atime3: 0 + atime4: 0 + atime5: 0 + atime6: 0 + atime7: 0 + m_Mode: 0 + m_NumColorKeys: 2 + m_NumAlphaKeys: 2 + minGradient: + serializedVersion: 2 + key0: {r: 1, g: 1, b: 1, a: 1} + key1: {r: 1, g: 1, b: 1, a: 1} + key2: {r: 0, g: 0, b: 0, a: 0} + key3: {r: 0, g: 0, b: 0, a: 0} + key4: {r: 0, g: 0, b: 0, a: 0} + key5: {r: 0, g: 0, b: 0, a: 0} + key6: {r: 0, g: 0, b: 0, a: 0} + key7: {r: 0, g: 0, b: 0, a: 0} + ctime0: 0 + ctime1: 65535 + ctime2: 0 + ctime3: 0 + ctime4: 0 + ctime5: 0 + ctime6: 0 + ctime7: 0 + atime0: 0 + atime1: 65535 + atime2: 0 + atime3: 0 + atime4: 0 + atime5: 0 + atime6: 0 + atime7: 0 + m_Mode: 0 + m_NumColorKeys: 2 + m_NumAlphaKeys: 2 + startSize: + serializedVersion: 2 + minMaxState: 3 + scalar: 1 + minScalar: 0.1 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + startSizeY: + serializedVersion: 2 + minMaxState: 3 + scalar: 1 + minScalar: 1 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + startSizeZ: + serializedVersion: 2 + minMaxState: 3 + scalar: 1 + minScalar: 1 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + startRotationX: + serializedVersion: 2 + minMaxState: 3 + scalar: 0 + minScalar: 0 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + startRotationY: + serializedVersion: 2 + minMaxState: 3 + scalar: 0 + minScalar: 0 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + startRotation: + serializedVersion: 2 + minMaxState: 3 + scalar: 6.283185 + minScalar: 0 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + randomizeRotationDirection: 0 + maxNumParticles: 1000 + size3D: 0 + rotation3D: 0 + gravityModifier: + serializedVersion: 2 + minMaxState: 0 + scalar: 0 + minScalar: 0 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + ShapeModule: + serializedVersion: 6 + enabled: 1 + type: 12 + angle: 25 + length: 5 + boxThickness: {x: 0, y: 0, z: 0} + radiusThickness: 1 + donutRadius: 0.2 + m_Position: {x: 0, y: 0, z: 0} + m_Rotation: {x: 0, y: 0, z: 0} + m_Scale: {x: 1, y: 1, z: 1} + placementMode: 0 + m_MeshMaterialIndex: 0 + m_MeshNormalOffset: 0 + m_MeshSpawn: + mode: 0 + spread: 0 + speed: + serializedVersion: 2 + minMaxState: 0 + scalar: 1 + minScalar: 1 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + m_Mesh: {fileID: 0} + m_MeshRenderer: {fileID: 0} + m_SkinnedMeshRenderer: {fileID: 0} + m_Sprite: {fileID: 0} + m_SpriteRenderer: {fileID: 0} + m_UseMeshMaterialIndex: 0 + m_UseMeshColors: 1 + alignToDirection: 0 + m_Texture: {fileID: 0} + m_TextureClipChannel: 3 + m_TextureClipThreshold: 0 + m_TextureUVChannel: 0 + m_TextureColorAffectsParticles: 1 + m_TextureAlphaAffectsParticles: 1 + m_TextureBilinearFiltering: 0 + randomDirectionAmount: 0 + sphericalDirectionAmount: 0 + randomPositionAmount: 0 + radius: + value: 1.23 + mode: 0 + spread: 0 + speed: + serializedVersion: 2 + minMaxState: 0 + scalar: 1 + minScalar: 1 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + arc: + value: 360 + mode: 0 + spread: 0 + speed: + serializedVersion: 2 + minMaxState: 0 + scalar: 1 + minScalar: 1 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + EmissionModule: + enabled: 1 + serializedVersion: 4 + rateOverTime: + serializedVersion: 2 + minMaxState: 0 + scalar: 30 + minScalar: 10 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + rateOverDistance: + serializedVersion: 2 + minMaxState: 0 + scalar: 0 + minScalar: 0 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + m_BurstCount: 1 + m_Bursts: + - serializedVersion: 2 + time: 0 + countCurve: + serializedVersion: 2 + minMaxState: 0 + scalar: 0 + minScalar: 30 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + cycleCount: 1 + repeatInterval: 0.01 + probability: 1 + SizeModule: + enabled: 1 + curve: + serializedVersion: 2 + minMaxState: 1 + scalar: 1 + minScalar: 1 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 15.478566 + outSlope: 15.478566 + tangentMode: 34 + weightedMode: 0 + inWeight: 0 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 0.061415076 + value: 0.9506173 + inSlope: 0.28985757 + outSlope: 0.28985757 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.24300326 + - serializedVersion: 3 + time: 0.6683 + value: 0.8456783 + inSlope: -1.3612208 + outSlope: -1.3612208 + tangentMode: 34 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: -2.5495274 + outSlope: -2.5495274 + tangentMode: 34 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + y: + serializedVersion: 2 + minMaxState: 1 + scalar: 1 + minScalar: 1 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 1 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 1 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + z: + serializedVersion: 2 + minMaxState: 1 + scalar: 1 + minScalar: 1 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 1 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 1 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + separateAxes: 0 + RotationModule: + enabled: 0 + x: + serializedVersion: 2 + minMaxState: 0 + scalar: 0 + minScalar: 0 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + y: + serializedVersion: 2 + minMaxState: 0 + scalar: 0 + minScalar: 0 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + curve: + serializedVersion: 2 + minMaxState: 0 + scalar: 0.7853982 + minScalar: 0.7853982 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + separateAxes: 0 + ColorModule: + enabled: 1 + gradient: + serializedVersion: 2 + minMaxState: 1 + minColor: {r: 1, g: 1, b: 1, a: 1} + maxColor: {r: 1, g: 1, b: 1, a: 1} + maxGradient: + serializedVersion: 2 + key0: {r: 1, g: 1, b: 1, a: 1} + key1: {r: 1, g: 1, b: 1, a: 1} + key2: {r: 0, g: 0, b: 0, a: 0} + key3: {r: 0, g: 0, b: 0, a: 0} + key4: {r: 0, g: 0, b: 0, a: 0} + key5: {r: 0, g: 0, b: 0, a: 0} + key6: {r: 0, g: 0, b: 0, a: 0} + key7: {r: 0, g: 0, b: 0, a: 0} + ctime0: 0 + ctime1: 65535 + ctime2: 0 + ctime3: 0 + ctime4: 0 + ctime5: 0 + ctime6: 0 + ctime7: 0 + atime0: 0 + atime1: 23708 + atime2: 65535 + atime3: 0 + atime4: 0 + atime5: 0 + atime6: 0 + atime7: 0 + m_Mode: 0 + m_NumColorKeys: 2 + m_NumAlphaKeys: 3 + minGradient: + serializedVersion: 2 + key0: {r: 1, g: 1, b: 1, a: 1} + key1: {r: 1, g: 1, b: 1, a: 1} + key2: {r: 0, g: 0, b: 0, a: 0} + key3: {r: 0, g: 0, b: 0, a: 0} + key4: {r: 0, g: 0, b: 0, a: 0} + key5: {r: 0, g: 0, b: 0, a: 0} + key6: {r: 0, g: 0, b: 0, a: 0} + key7: {r: 0, g: 0, b: 0, a: 0} + ctime0: 0 + ctime1: 65535 + ctime2: 0 + ctime3: 0 + ctime4: 0 + ctime5: 0 + ctime6: 0 + ctime7: 0 + atime0: 0 + atime1: 65535 + atime2: 0 + atime3: 0 + atime4: 0 + atime5: 0 + atime6: 0 + atime7: 0 + m_Mode: 0 + m_NumColorKeys: 2 + m_NumAlphaKeys: 2 + UVModule: + serializedVersion: 2 + enabled: 0 + mode: 0 + timeMode: 0 + fps: 30 + frameOverTime: + serializedVersion: 2 + minMaxState: 1 + scalar: 0.9999 + minScalar: 0.9999 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 1 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 1 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + startFrame: + serializedVersion: 2 + minMaxState: 0 + scalar: 0 + minScalar: 0 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + speedRange: {x: 0, y: 1} + tilesX: 1 + tilesY: 1 + animationType: 0 + rowIndex: 0 + cycles: 1 + uvChannelMask: -1 + rowMode: 1 + sprites: + - sprite: {fileID: 0} + flipU: 0 + flipV: 0 + VelocityModule: + enabled: 0 + x: + serializedVersion: 2 + minMaxState: 0 + scalar: 0 + minScalar: 0 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + y: + serializedVersion: 2 + minMaxState: 0 + scalar: 0 + minScalar: 0 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + z: + serializedVersion: 2 + minMaxState: 0 + scalar: 0 + minScalar: 0 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + orbitalX: + serializedVersion: 2 + minMaxState: 0 + scalar: 0 + minScalar: 0 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + orbitalY: + serializedVersion: 2 + minMaxState: 0 + scalar: 0 + minScalar: 0 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + orbitalZ: + serializedVersion: 2 + minMaxState: 0 + scalar: 0 + minScalar: 0 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + orbitalOffsetX: + serializedVersion: 2 + minMaxState: 0 + scalar: 0 + minScalar: 0 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + orbitalOffsetY: + serializedVersion: 2 + minMaxState: 0 + scalar: 0 + minScalar: 0 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + orbitalOffsetZ: + serializedVersion: 2 + minMaxState: 0 + scalar: 0 + minScalar: 0 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + radial: + serializedVersion: 2 + minMaxState: 0 + scalar: 0 + minScalar: 0 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + speedModifier: + serializedVersion: 2 + minMaxState: 0 + scalar: 1 + minScalar: 1 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + inWorldSpace: 0 + InheritVelocityModule: + enabled: 0 + m_Mode: 0 + m_Curve: + serializedVersion: 2 + minMaxState: 0 + scalar: 0 + minScalar: 0 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + ForceModule: + enabled: 0 + x: + serializedVersion: 2 + minMaxState: 0 + scalar: 0 + minScalar: 0 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + y: + serializedVersion: 2 + minMaxState: 0 + scalar: 0 + minScalar: 0 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + z: + serializedVersion: 2 + minMaxState: 0 + scalar: 0 + minScalar: 0 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + inWorldSpace: 0 + randomizePerFrame: 0 + ExternalForcesModule: + serializedVersion: 2 + enabled: 0 + multiplierCurve: + serializedVersion: 2 + minMaxState: 0 + scalar: 1 + minScalar: 1 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + influenceFilter: 0 + influenceMask: + serializedVersion: 2 + m_Bits: 4294967295 + influenceList: [] + ClampVelocityModule: + enabled: 0 + x: + serializedVersion: 2 + minMaxState: 0 + scalar: 1 + minScalar: 1 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + y: + serializedVersion: 2 + minMaxState: 0 + scalar: 1 + minScalar: 1 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + z: + serializedVersion: 2 + minMaxState: 0 + scalar: 1 + minScalar: 1 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + magnitude: + serializedVersion: 2 + minMaxState: 0 + scalar: 1 + minScalar: 1 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + separateAxis: 0 + inWorldSpace: 0 + multiplyDragByParticleSize: 1 + multiplyDragByParticleVelocity: 1 + dampen: 0 + drag: + serializedVersion: 2 + minMaxState: 0 + scalar: 0 + minScalar: 0 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + NoiseModule: + enabled: 0 + strength: + serializedVersion: 2 + minMaxState: 0 + scalar: 1 + minScalar: 1 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + strengthY: + serializedVersion: 2 + minMaxState: 0 + scalar: 1 + minScalar: 1 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + strengthZ: + serializedVersion: 2 + minMaxState: 0 + scalar: 1 + minScalar: 1 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + separateAxes: 0 + frequency: 0.5 + damping: 1 + octaves: 1 + octaveMultiplier: 0.5 + octaveScale: 2 + quality: 2 + scrollSpeed: + serializedVersion: 2 + minMaxState: 0 + scalar: 0 + minScalar: 0 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + remap: + serializedVersion: 2 + minMaxState: 1 + scalar: 1 + minScalar: 1 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 1 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 1 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + remapY: + serializedVersion: 2 + minMaxState: 1 + scalar: 1 + minScalar: 1 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 1 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 1 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + remapZ: + serializedVersion: 2 + minMaxState: 1 + scalar: 1 + minScalar: 1 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 1 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 1 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + remapEnabled: 0 + positionAmount: + serializedVersion: 2 + minMaxState: 0 + scalar: 1 + minScalar: 1 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + rotationAmount: + serializedVersion: 2 + minMaxState: 0 + scalar: 0 + minScalar: 0 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + sizeAmount: + serializedVersion: 2 + minMaxState: 0 + scalar: 0 + minScalar: 0 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + SizeBySpeedModule: + enabled: 0 + curve: + serializedVersion: 2 + minMaxState: 1 + scalar: 1 + minScalar: 1 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 1 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 1 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + y: + serializedVersion: 2 + minMaxState: 1 + scalar: 1 + minScalar: 1 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 1 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 1 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + z: + serializedVersion: 2 + minMaxState: 1 + scalar: 1 + minScalar: 1 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 1 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 1 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + range: {x: 0, y: 1} + separateAxes: 0 + RotationBySpeedModule: + enabled: 0 + x: + serializedVersion: 2 + minMaxState: 0 + scalar: 0 + minScalar: 0 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + y: + serializedVersion: 2 + minMaxState: 0 + scalar: 0 + minScalar: 0 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + curve: + serializedVersion: 2 + minMaxState: 0 + scalar: 0.7853982 + minScalar: 0.7853982 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + separateAxes: 0 + range: {x: 0, y: 1} + ColorBySpeedModule: + enabled: 0 + gradient: + serializedVersion: 2 + minMaxState: 1 + minColor: {r: 1, g: 1, b: 1, a: 1} + maxColor: {r: 1, g: 1, b: 1, a: 1} + maxGradient: + serializedVersion: 2 + key0: {r: 1, g: 1, b: 1, a: 1} + key1: {r: 1, g: 1, b: 1, a: 1} + key2: {r: 0, g: 0, b: 0, a: 0} + key3: {r: 0, g: 0, b: 0, a: 0} + key4: {r: 0, g: 0, b: 0, a: 0} + key5: {r: 0, g: 0, b: 0, a: 0} + key6: {r: 0, g: 0, b: 0, a: 0} + key7: {r: 0, g: 0, b: 0, a: 0} + ctime0: 0 + ctime1: 65535 + ctime2: 0 + ctime3: 0 + ctime4: 0 + ctime5: 0 + ctime6: 0 + ctime7: 0 + atime0: 0 + atime1: 65535 + atime2: 0 + atime3: 0 + atime4: 0 + atime5: 0 + atime6: 0 + atime7: 0 + m_Mode: 0 + m_NumColorKeys: 2 + m_NumAlphaKeys: 2 + minGradient: + serializedVersion: 2 + key0: {r: 1, g: 1, b: 1, a: 1} + key1: {r: 1, g: 1, b: 1, a: 1} + key2: {r: 0, g: 0, b: 0, a: 0} + key3: {r: 0, g: 0, b: 0, a: 0} + key4: {r: 0, g: 0, b: 0, a: 0} + key5: {r: 0, g: 0, b: 0, a: 0} + key6: {r: 0, g: 0, b: 0, a: 0} + key7: {r: 0, g: 0, b: 0, a: 0} + ctime0: 0 + ctime1: 65535 + ctime2: 0 + ctime3: 0 + ctime4: 0 + ctime5: 0 + ctime6: 0 + ctime7: 0 + atime0: 0 + atime1: 65535 + atime2: 0 + atime3: 0 + atime4: 0 + atime5: 0 + atime6: 0 + atime7: 0 + m_Mode: 0 + m_NumColorKeys: 2 + m_NumAlphaKeys: 2 + range: {x: 0, y: 1} + CollisionModule: + enabled: 0 + serializedVersion: 3 + type: 0 + collisionMode: 0 + colliderForce: 0 + multiplyColliderForceByParticleSize: 0 + multiplyColliderForceByParticleSpeed: 0 + multiplyColliderForceByCollisionAngle: 1 + plane0: {fileID: 0} + plane1: {fileID: 0} + plane2: {fileID: 0} + plane3: {fileID: 0} + plane4: {fileID: 0} + plane5: {fileID: 0} + m_Dampen: + serializedVersion: 2 + minMaxState: 0 + scalar: 0 + minScalar: 0 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + m_Bounce: + serializedVersion: 2 + minMaxState: 0 + scalar: 1 + minScalar: 1 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + m_EnergyLossOnCollision: + serializedVersion: 2 + minMaxState: 0 + scalar: 0 + minScalar: 0 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minKillSpeed: 0 + maxKillSpeed: 10000 + radiusScale: 1 + collidesWith: + serializedVersion: 2 + m_Bits: 4294967295 + maxCollisionShapes: 256 + quality: 0 + voxelSize: 0.5 + collisionMessages: 0 + collidesWithDynamic: 1 + interiorCollisions: 0 + TriggerModule: + enabled: 0 + collisionShape0: {fileID: 0} + collisionShape1: {fileID: 0} + collisionShape2: {fileID: 0} + collisionShape3: {fileID: 0} + collisionShape4: {fileID: 0} + collisionShape5: {fileID: 0} + inside: 1 + outside: 0 + enter: 0 + exit: 0 + radiusScale: 1 + SubModule: + serializedVersion: 2 + enabled: 0 + subEmitters: + - serializedVersion: 3 + emitter: {fileID: 0} + type: 0 + properties: 0 + emitProbability: 1 + LightsModule: + enabled: 0 + ratio: 0 + light: {fileID: 0} + randomDistribution: 1 + color: 1 + range: 1 + intensity: 1 + rangeCurve: + serializedVersion: 2 + minMaxState: 0 + scalar: 1 + minScalar: 1 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + intensityCurve: + serializedVersion: 2 + minMaxState: 0 + scalar: 1 + minScalar: 1 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + maxLights: 20 + TrailModule: + enabled: 0 + mode: 0 + ratio: 1 + lifetime: + serializedVersion: 2 + minMaxState: 0 + scalar: 1 + minScalar: 1 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minVertexDistance: 0.2 + textureMode: 0 + ribbonCount: 1 + shadowBias: 0.5 + worldSpace: 0 + dieWithParticles: 1 + sizeAffectsWidth: 1 + sizeAffectsLifetime: 0 + inheritParticleColor: 1 + generateLightingData: 0 + splitSubEmitterRibbons: 0 + attachRibbonsToTransform: 0 + colorOverLifetime: + serializedVersion: 2 + minMaxState: 0 + minColor: {r: 1, g: 1, b: 1, a: 1} + maxColor: {r: 1, g: 1, b: 1, a: 1} + maxGradient: + serializedVersion: 2 + key0: {r: 1, g: 1, b: 1, a: 1} + key1: {r: 1, g: 1, b: 1, a: 1} + key2: {r: 0, g: 0, b: 0, a: 0} + key3: {r: 0, g: 0, b: 0, a: 0} + key4: {r: 0, g: 0, b: 0, a: 0} + key5: {r: 0, g: 0, b: 0, a: 0} + key6: {r: 0, g: 0, b: 0, a: 0} + key7: {r: 0, g: 0, b: 0, a: 0} + ctime0: 0 + ctime1: 65535 + ctime2: 0 + ctime3: 0 + ctime4: 0 + ctime5: 0 + ctime6: 0 + ctime7: 0 + atime0: 0 + atime1: 65535 + atime2: 0 + atime3: 0 + atime4: 0 + atime5: 0 + atime6: 0 + atime7: 0 + m_Mode: 0 + m_NumColorKeys: 2 + m_NumAlphaKeys: 2 + minGradient: + serializedVersion: 2 + key0: {r: 1, g: 1, b: 1, a: 1} + key1: {r: 1, g: 1, b: 1, a: 1} + key2: {r: 0, g: 0, b: 0, a: 0} + key3: {r: 0, g: 0, b: 0, a: 0} + key4: {r: 0, g: 0, b: 0, a: 0} + key5: {r: 0, g: 0, b: 0, a: 0} + key6: {r: 0, g: 0, b: 0, a: 0} + key7: {r: 0, g: 0, b: 0, a: 0} + ctime0: 0 + ctime1: 65535 + ctime2: 0 + ctime3: 0 + ctime4: 0 + ctime5: 0 + ctime6: 0 + ctime7: 0 + atime0: 0 + atime1: 65535 + atime2: 0 + atime3: 0 + atime4: 0 + atime5: 0 + atime6: 0 + atime7: 0 + m_Mode: 0 + m_NumColorKeys: 2 + m_NumAlphaKeys: 2 + widthOverTrail: + serializedVersion: 2 + minMaxState: 0 + scalar: 1 + minScalar: 1 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + colorOverTrail: + serializedVersion: 2 + minMaxState: 0 + minColor: {r: 1, g: 1, b: 1, a: 1} + maxColor: {r: 1, g: 1, b: 1, a: 1} + maxGradient: + serializedVersion: 2 + key0: {r: 1, g: 1, b: 1, a: 1} + key1: {r: 1, g: 1, b: 1, a: 1} + key2: {r: 0, g: 0, b: 0, a: 0} + key3: {r: 0, g: 0, b: 0, a: 0} + key4: {r: 0, g: 0, b: 0, a: 0} + key5: {r: 0, g: 0, b: 0, a: 0} + key6: {r: 0, g: 0, b: 0, a: 0} + key7: {r: 0, g: 0, b: 0, a: 0} + ctime0: 0 + ctime1: 65535 + ctime2: 0 + ctime3: 0 + ctime4: 0 + ctime5: 0 + ctime6: 0 + ctime7: 0 + atime0: 0 + atime1: 65535 + atime2: 0 + atime3: 0 + atime4: 0 + atime5: 0 + atime6: 0 + atime7: 0 + m_Mode: 0 + m_NumColorKeys: 2 + m_NumAlphaKeys: 2 + minGradient: + serializedVersion: 2 + key0: {r: 1, g: 1, b: 1, a: 1} + key1: {r: 1, g: 1, b: 1, a: 1} + key2: {r: 0, g: 0, b: 0, a: 0} + key3: {r: 0, g: 0, b: 0, a: 0} + key4: {r: 0, g: 0, b: 0, a: 0} + key5: {r: 0, g: 0, b: 0, a: 0} + key6: {r: 0, g: 0, b: 0, a: 0} + key7: {r: 0, g: 0, b: 0, a: 0} + ctime0: 0 + ctime1: 65535 + ctime2: 0 + ctime3: 0 + ctime4: 0 + ctime5: 0 + ctime6: 0 + ctime7: 0 + atime0: 0 + atime1: 65535 + atime2: 0 + atime3: 0 + atime4: 0 + atime5: 0 + atime6: 0 + atime7: 0 + m_Mode: 0 + m_NumColorKeys: 2 + m_NumAlphaKeys: 2 + CustomDataModule: + enabled: 0 + mode0: 0 + vectorComponentCount0: 4 + color0: + serializedVersion: 2 + minMaxState: 0 + minColor: {r: 1, g: 1, b: 1, a: 1} + maxColor: {r: 1, g: 1, b: 1, a: 1} + maxGradient: + serializedVersion: 2 + key0: {r: 1, g: 1, b: 1, a: 1} + key1: {r: 1, g: 1, b: 1, a: 1} + key2: {r: 0, g: 0, b: 0, a: 0} + key3: {r: 0, g: 0, b: 0, a: 0} + key4: {r: 0, g: 0, b: 0, a: 0} + key5: {r: 0, g: 0, b: 0, a: 0} + key6: {r: 0, g: 0, b: 0, a: 0} + key7: {r: 0, g: 0, b: 0, a: 0} + ctime0: 0 + ctime1: 65535 + ctime2: 0 + ctime3: 0 + ctime4: 0 + ctime5: 0 + ctime6: 0 + ctime7: 0 + atime0: 0 + atime1: 65535 + atime2: 0 + atime3: 0 + atime4: 0 + atime5: 0 + atime6: 0 + atime7: 0 + m_Mode: 0 + m_NumColorKeys: 2 + m_NumAlphaKeys: 2 + minGradient: + serializedVersion: 2 + key0: {r: 1, g: 1, b: 1, a: 1} + key1: {r: 1, g: 1, b: 1, a: 1} + key2: {r: 0, g: 0, b: 0, a: 0} + key3: {r: 0, g: 0, b: 0, a: 0} + key4: {r: 0, g: 0, b: 0, a: 0} + key5: {r: 0, g: 0, b: 0, a: 0} + key6: {r: 0, g: 0, b: 0, a: 0} + key7: {r: 0, g: 0, b: 0, a: 0} + ctime0: 0 + ctime1: 65535 + ctime2: 0 + ctime3: 0 + ctime4: 0 + ctime5: 0 + ctime6: 0 + ctime7: 0 + atime0: 0 + atime1: 65535 + atime2: 0 + atime3: 0 + atime4: 0 + atime5: 0 + atime6: 0 + atime7: 0 + m_Mode: 0 + m_NumColorKeys: 2 + m_NumAlphaKeys: 2 + colorLabel0: Color + vector0_0: + serializedVersion: 2 + minMaxState: 0 + scalar: 0 + minScalar: 0 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + vectorLabel0_0: X + vector0_1: + serializedVersion: 2 + minMaxState: 0 + scalar: 0 + minScalar: 0 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + vectorLabel0_1: Y + vector0_2: + serializedVersion: 2 + minMaxState: 0 + scalar: 0 + minScalar: 0 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + vectorLabel0_2: Z + vector0_3: + serializedVersion: 2 + minMaxState: 0 + scalar: 0 + minScalar: 0 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + vectorLabel0_3: W + mode1: 0 + vectorComponentCount1: 4 + color1: + serializedVersion: 2 + minMaxState: 0 + minColor: {r: 1, g: 1, b: 1, a: 1} + maxColor: {r: 1, g: 1, b: 1, a: 1} + maxGradient: + serializedVersion: 2 + key0: {r: 1, g: 1, b: 1, a: 1} + key1: {r: 1, g: 1, b: 1, a: 1} + key2: {r: 0, g: 0, b: 0, a: 0} + key3: {r: 0, g: 0, b: 0, a: 0} + key4: {r: 0, g: 0, b: 0, a: 0} + key5: {r: 0, g: 0, b: 0, a: 0} + key6: {r: 0, g: 0, b: 0, a: 0} + key7: {r: 0, g: 0, b: 0, a: 0} + ctime0: 0 + ctime1: 65535 + ctime2: 0 + ctime3: 0 + ctime4: 0 + ctime5: 0 + ctime6: 0 + ctime7: 0 + atime0: 0 + atime1: 65535 + atime2: 0 + atime3: 0 + atime4: 0 + atime5: 0 + atime6: 0 + atime7: 0 + m_Mode: 0 + m_NumColorKeys: 2 + m_NumAlphaKeys: 2 + minGradient: + serializedVersion: 2 + key0: {r: 1, g: 1, b: 1, a: 1} + key1: {r: 1, g: 1, b: 1, a: 1} + key2: {r: 0, g: 0, b: 0, a: 0} + key3: {r: 0, g: 0, b: 0, a: 0} + key4: {r: 0, g: 0, b: 0, a: 0} + key5: {r: 0, g: 0, b: 0, a: 0} + key6: {r: 0, g: 0, b: 0, a: 0} + key7: {r: 0, g: 0, b: 0, a: 0} + ctime0: 0 + ctime1: 65535 + ctime2: 0 + ctime3: 0 + ctime4: 0 + ctime5: 0 + ctime6: 0 + ctime7: 0 + atime0: 0 + atime1: 65535 + atime2: 0 + atime3: 0 + atime4: 0 + atime5: 0 + atime6: 0 + atime7: 0 + m_Mode: 0 + m_NumColorKeys: 2 + m_NumAlphaKeys: 2 + colorLabel1: Color + vector1_0: + serializedVersion: 2 + minMaxState: 0 + scalar: 0 + minScalar: 0 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + vectorLabel1_0: X + vector1_1: + serializedVersion: 2 + minMaxState: 0 + scalar: 0 + minScalar: 0 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + vectorLabel1_1: Y + vector1_2: + serializedVersion: 2 + minMaxState: 0 + scalar: 0 + minScalar: 0 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + vectorLabel1_2: Z + vector1_3: + serializedVersion: 2 + minMaxState: 0 + scalar: 0 + minScalar: 0 + maxCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + minCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + - serializedVersion: 3 + time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + vectorLabel1_3: W +--- !u!199 &3864259599213150332 +ParticleSystemRenderer: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3864259599213150330} + m_Enabled: 1 + m_CastShadows: 0 + m_ReceiveShadows: 0 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 0 + m_ReflectionProbeUsage: 0 + m_RayTracingMode: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: e2fd28a60d223ba4cb25e286da19b13a, type: 2} + - {fileID: 0} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_RenderMode: 0 + m_SortMode: 0 + m_MinParticleSize: 0 + m_MaxParticleSize: 0.5 + m_CameraVelocityScale: 0 + m_VelocityScale: 0 + m_LengthScale: 2 + m_SortingFudge: 0 + m_NormalDirection: 1 + m_ShadowBias: 0 + m_RenderAlignment: 0 + m_Pivot: {x: 0, y: 0, z: 0} + m_Flip: {x: 0, y: 0, z: 0} + m_UseCustomVertexStreams: 0 + m_EnableGPUInstancing: 1 + m_ApplyActiveColorSpace: 1 + m_AllowRoll: 1 + m_VertexStreams: 00010304 + m_Mesh: {fileID: 0} + m_Mesh1: {fileID: 0} + m_Mesh2: {fileID: 0} + m_Mesh3: {fileID: 0} + m_MaskInteraction: 0 +--- !u!1 &3864259599682641152 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 3864259599682641153} + - component: {fileID: 3864259599682641158} + - component: {fileID: 3864259599682641157} + - component: {fileID: 3864259599682641155} + - component: {fileID: 3864259599682641154} + m_Layer: 0 + m_Name: Shield Soldier Demo + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &3864259599682641153 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3864259599682641152} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 360, y: 0, z: 0} + m_LocalScale: {x: 0.80276, y: 0.80276, z: 0.80276} + m_Children: + - {fileID: 3864259599192371922} + - {fileID: 3864259599213150331} + - {fileID: 3864259598328230474} + - {fileID: 3864259598540621427} + m_Father: {fileID: 0} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!212 &3864259599682641158 +SpriteRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3864259599682641152} + m_Enabled: 1 + m_CastShadows: 0 + m_ReceiveShadows: 0 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: 8a80b25e622f6c84aac445df7e206085, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 0 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_Sprite: {fileID: 21300000, guid: 519dafacd208bb64c83d5124be03b09d, type: 3} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_FlipX: 0 + m_FlipY: 0 + m_DrawMode: 0 + m_Size: {x: 5.12, y: 5.12} + m_AdaptiveModeThreshold: 0.5 + m_SpriteTileMode: 0 + m_WasSpriteAssigned: 1 + m_MaskInteraction: 0 + m_SpriteSortPoint: 0 +--- !u!114 &3864259599682641157 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3864259599682641152} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 98b644315d7a92842b89e04f55c48e02, type: 3} + m_Name: + m_EditorClassIdentifier: +--- !u!331 &3864259599682641155 +SpriteMask: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3864259599682641152} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 10758, guid: 0000000000000000f000000000000000, type: 0} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_Sprite: {fileID: 21300000, guid: 519dafacd208bb64c83d5124be03b09d, type: 3} + m_MaskAlphaCutoff: 0.2 + m_FrontSortingLayerID: 0 + m_BackSortingLayerID: 0 + m_FrontSortingLayer: 0 + m_BackSortingLayer: 0 + m_FrontSortingOrder: 0 + m_BackSortingOrder: 0 + m_IsCustomRangeActive: 0 + m_SpriteSortPoint: 0 +--- !u!95 &3864259599682641154 +Animator: + serializedVersion: 3 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3864259599682641152} + m_Enabled: 1 + m_Avatar: {fileID: 0} + m_Controller: {fileID: 9100000, guid: 48122208e82681f45a0f7dda84aa301f, type: 2} + m_CullingMode: 0 + m_UpdateMode: 0 + m_ApplyRootMotion: 0 + m_LinearVelocityBlending: 0 + m_WarningMessage: + m_HasTransformHierarchy: 1 + m_AllowConstantClipSamplingOptimization: 1 + m_KeepAnimatorControllerStateOnDisable: 0 diff --git a/Assets/Plugins/AllIn1SpriteShader/Demo/Prefabs/Shield Soldier Demo.prefab.meta b/Assets/Plugins/AllIn1SpriteShader/Demo/Prefabs/Shield Soldier Demo.prefab.meta new file mode 100644 index 000000000..23dea9daa --- /dev/null +++ b/Assets/Plugins/AllIn1SpriteShader/Demo/Prefabs/Shield Soldier Demo.prefab.meta @@ -0,0 +1,14 @@ +fileFormatVersion: 2 +guid: 11bf72cfca6ba93459ddeacea51fd0bd +PrefabImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 156513 + packageName: All In 1 Sprite Shader + packageVersion: 4.25 + assetPath: Assets/Plugins/AllIn1SpriteShader/Demo/Prefabs/Shield Soldier Demo.prefab + uploadId: 708810 diff --git a/Assets/Plugins/AllIn1SpriteShader/Demo/Scripts.meta b/Assets/Plugins/AllIn1SpriteShader/Demo/Scripts.meta new file mode 100644 index 000000000..e9a26c4b7 --- /dev/null +++ b/Assets/Plugins/AllIn1SpriteShader/Demo/Scripts.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: d00a14e1119cac04092102f8e78ad652 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/AllIn1SpriteShader/Demo/Scripts/All1ShaderDemoController.cs b/Assets/Plugins/AllIn1SpriteShader/Demo/Scripts/All1ShaderDemoController.cs new file mode 100644 index 000000000..6baacdf34 --- /dev/null +++ b/Assets/Plugins/AllIn1SpriteShader/Demo/Scripts/All1ShaderDemoController.cs @@ -0,0 +1,86 @@ +using UnityEngine; +using UnityEngine.UI; + +namespace AllIn1SpriteShader +{ + public class All1ShaderDemoController : MonoBehaviour + { + [SerializeField] private DemoCircleExpositor[] expositors = null; + [SerializeField] private Text expositorsTitle = null, expositorsTitleOutline = null; + public float expositorDistance; + + private int currExpositor; + + [SerializeField] private GameObject background = null; + private Material backgroundMat; + [SerializeField] private float colorLerpSpeed = 0; + private Color[] targetColors; + private Color[] currentColors; + + void Start() + { + currExpositor = 0; + SetExpositorText(); + + for (int i = 0; i < expositors.Length; i++) expositors[i].transform.position = new Vector3(0, expositorDistance * i, 0); + + backgroundMat = background.GetComponent().material; + targetColors = new Color[4]; + targetColors[0] = backgroundMat.GetColor("_GradTopLeftCol"); + targetColors[1] = backgroundMat.GetColor("_GradTopRightCol"); + targetColors[2] = backgroundMat.GetColor("_GradBotLeftCol"); + targetColors[3] = backgroundMat.GetColor("_GradBotRightCol"); + currentColors = targetColors.Clone() as Color[]; + } + + void Update() + { + GetInput(); + + currentColors[0] = Color.Lerp(currentColors[0], targetColors[(0 + currExpositor) % targetColors.Length], colorLerpSpeed * Time.deltaTime); + currentColors[1] = Color.Lerp(currentColors[1], targetColors[(1 + currExpositor) % targetColors.Length], colorLerpSpeed * Time.deltaTime); + currentColors[2] = Color.Lerp(currentColors[2], targetColors[(2 + currExpositor) % targetColors.Length], colorLerpSpeed * Time.deltaTime); + currentColors[3] = Color.Lerp(currentColors[3], targetColors[(3 + currExpositor) % targetColors.Length], colorLerpSpeed * Time.deltaTime); + backgroundMat.SetColor("_GradTopLeftCol", currentColors[0]); + backgroundMat.SetColor("_GradTopRightCol", currentColors[1]); + backgroundMat.SetColor("_GradBotLeftCol", currentColors[2]); + backgroundMat.SetColor("_GradBotRightCol", currentColors[3]); + } + + private void GetInput() + { + if (Input.GetKeyDown(KeyCode.LeftArrow) || Input.GetKeyDown(KeyCode.A)) + { + expositors[currExpositor].ChangeTarget(-1); + } + else if (Input.GetKeyDown(KeyCode.RightArrow) || Input.GetKeyDown(KeyCode.D)) + { + expositors[currExpositor].ChangeTarget(1); + } + else if (Input.GetKeyDown(KeyCode.UpArrow) || Input.GetKeyDown(KeyCode.W)) + { + ChangeExpositor(-1); + } + else if (Input.GetKeyDown(KeyCode.DownArrow) || Input.GetKeyDown(KeyCode.S)) + { + ChangeExpositor(1); + } + } + + private void ChangeExpositor(int offset) + { + currExpositor += offset; + if (currExpositor > expositors.Length - 1) currExpositor = 0; + else if (currExpositor < 0) currExpositor = expositors.Length - 1; + SetExpositorText(); + } + + private void SetExpositorText() + { + expositorsTitle.text = expositors[currExpositor].name; + expositorsTitleOutline.text = expositors[currExpositor].name; + } + + public int GetCurrExpositor() { return currExpositor; } + } +} \ No newline at end of file diff --git a/Assets/Plugins/AllIn1SpriteShader/Demo/Scripts/All1ShaderDemoController.cs.meta b/Assets/Plugins/AllIn1SpriteShader/Demo/Scripts/All1ShaderDemoController.cs.meta new file mode 100644 index 000000000..0589e1ac3 --- /dev/null +++ b/Assets/Plugins/AllIn1SpriteShader/Demo/Scripts/All1ShaderDemoController.cs.meta @@ -0,0 +1,18 @@ +fileFormatVersion: 2 +guid: b549ed925b49d274c876184f60faabdf +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 156513 + packageName: All In 1 Sprite Shader + packageVersion: 4.25 + assetPath: Assets/Plugins/AllIn1SpriteShader/Demo/Scripts/All1ShaderDemoController.cs + uploadId: 708810 diff --git a/Assets/Plugins/AllIn1SpriteShader/Demo/Scripts/All1TextureOffsetOverTIme.cs b/Assets/Plugins/AllIn1SpriteShader/Demo/Scripts/All1TextureOffsetOverTIme.cs new file mode 100644 index 000000000..61138c119 --- /dev/null +++ b/Assets/Plugins/AllIn1SpriteShader/Demo/Scripts/All1TextureOffsetOverTIme.cs @@ -0,0 +1,57 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; +using UnityEngine.UI; + +namespace AllIn1SpriteShader +{ + public class All1TextureOffsetOverTime : MonoBehaviour + { + [SerializeField] private string texturePropertyName = "_MainTex"; + [SerializeField] private Vector2 offsetSpeed = Vector2.zero; + + [SerializeField, Header("If missing will search object Sprite Renderer or UI Image")] + private Material mat; + + private int textureShaderId; + private Vector2 currOffset = Vector2.zero; + + private void Start() + { + //Get material if missing + if (mat == null) + { + SpriteRenderer sr = GetComponent(); + if (sr != null) mat = sr.material; + else + { + Image i = GetComponent(); + if (i != null) mat = i.material; + } + } + + //Show error message if material or textureName property error + //Otherwise cache shader property ID + if (mat == null) DestroyComponentAndLogError(gameObject.name + " has no valid Material, deleting All1TextureOffsetOverTIme component"); + else + { + if (mat.HasProperty(texturePropertyName)) textureShaderId = Shader.PropertyToID(texturePropertyName); + else DestroyComponentAndLogError(gameObject.name + "'s Material doesn't have a " + texturePropertyName + " property"); + } + } + + public void Update() + { + //Update currOffset and update shader property + currOffset.x += offsetSpeed.x * Time.deltaTime; + currOffset.y += offsetSpeed.y * Time.deltaTime; + mat.SetTextureOffset(textureShaderId, currOffset); + } + + private void DestroyComponentAndLogError(string logError) + { + Debug.LogError(logError); + Destroy(this); + } + } +} \ No newline at end of file diff --git a/Assets/Plugins/AllIn1SpriteShader/Demo/Scripts/All1TextureOffsetOverTIme.cs.meta b/Assets/Plugins/AllIn1SpriteShader/Demo/Scripts/All1TextureOffsetOverTIme.cs.meta new file mode 100644 index 000000000..ce49585a5 --- /dev/null +++ b/Assets/Plugins/AllIn1SpriteShader/Demo/Scripts/All1TextureOffsetOverTIme.cs.meta @@ -0,0 +1,18 @@ +fileFormatVersion: 2 +guid: f3804424ee2f162418d9294faf7ba055 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 156513 + packageName: All In 1 Sprite Shader + packageVersion: 4.25 + assetPath: Assets/Plugins/AllIn1SpriteShader/Demo/Scripts/All1TextureOffsetOverTIme.cs + uploadId: 708810 diff --git a/Assets/Plugins/AllIn1SpriteShader/Demo/Scripts/AllIn1AutoRotate.cs b/Assets/Plugins/AllIn1SpriteShader/Demo/Scripts/AllIn1AutoRotate.cs new file mode 100644 index 000000000..a231d85d1 --- /dev/null +++ b/Assets/Plugins/AllIn1SpriteShader/Demo/Scripts/AllIn1AutoRotate.cs @@ -0,0 +1,16 @@ +using UnityEngine; + +namespace AllIn1SpriteShader.Demo.Scripts +{ + public class AllIn1AutoRotate : MonoBehaviour + { + [SerializeField] private float rotationSpeed = 30f; + [SerializeField] private Vector3 rotationAxis = Vector3.up; + [SerializeField] private bool useLocalRotation; + + private void Update() + { + transform.Rotate(rotationAxis * (rotationSpeed * Time.deltaTime), useLocalRotation ? Space.Self : Space.World); + } + } +} \ No newline at end of file diff --git a/Assets/Plugins/AllIn1SpriteShader/Demo/Scripts/AllIn1AutoRotate.cs.meta b/Assets/Plugins/AllIn1SpriteShader/Demo/Scripts/AllIn1AutoRotate.cs.meta new file mode 100644 index 000000000..75fc3cd75 --- /dev/null +++ b/Assets/Plugins/AllIn1SpriteShader/Demo/Scripts/AllIn1AutoRotate.cs.meta @@ -0,0 +1,18 @@ +fileFormatVersion: 2 +guid: f2560c72fbbcfe44195e240286d1d4e5 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 156513 + packageName: All In 1 Sprite Shader + packageVersion: 4.25 + assetPath: Assets/Plugins/AllIn1SpriteShader/Demo/Scripts/AllIn1AutoRotate.cs + uploadId: 708810 diff --git a/Assets/Plugins/AllIn1SpriteShader/Demo/Scripts/AllIn1ScrollProperty.cs b/Assets/Plugins/AllIn1SpriteShader/Demo/Scripts/AllIn1ScrollProperty.cs new file mode 100644 index 000000000..d98f8e7f6 --- /dev/null +++ b/Assets/Plugins/AllIn1SpriteShader/Demo/Scripts/AllIn1ScrollProperty.cs @@ -0,0 +1,62 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; +using UnityEngine.UI; + +namespace AllIn1SpriteShader +{ + public class AllIn1ScrollProperty : MonoBehaviour + { + [SerializeField] private string numericPropertyName = "_RotateUvAmount"; + [SerializeField] private float scrollSpeed = 0f; + + [Space, SerializeField] private bool applyModulo = false; + [SerializeField] private float modulo = 1f; + + [Space, SerializeField, Header("If missing will search object Sprite Renderer or UI Image")] + private Material mat; + + private int propertyShaderID; + private float currValue; + + public void Start() + { + //Get material if missing + if (mat == null) + { + SpriteRenderer sr = GetComponent(); + if (sr != null) mat = sr.material; + else + { + Image i = GetComponent(); + if (i != null) mat = i.material; + } + } + + //Show error message if material or numericPropertyName property error + //Otherwise cache shader property ID + if (mat == null) DestroyComponentAndLogError(gameObject.name + " has no valid Material, deleting All1TextureOffsetOverTIme component"); + else + { + if (mat.HasProperty(numericPropertyName)) propertyShaderID = Shader.PropertyToID(numericPropertyName); + else DestroyComponentAndLogError(gameObject.name + "'s Material doesn't have a " + numericPropertyName + " property"); + + currValue = mat.GetFloat(propertyShaderID); + } + } + + private void Update() + { + //Update currOffset and update shader property + currValue += scrollSpeed * Time.deltaTime; + if (applyModulo) currValue %= modulo; + mat.SetFloat(propertyShaderID, currValue); + } + + private void DestroyComponentAndLogError(string logError) + { + Debug.LogError(logError); + Destroy(this); + } + } +} \ No newline at end of file diff --git a/Assets/Plugins/AllIn1SpriteShader/Demo/Scripts/AllIn1ScrollProperty.cs.meta b/Assets/Plugins/AllIn1SpriteShader/Demo/Scripts/AllIn1ScrollProperty.cs.meta new file mode 100644 index 000000000..5d167d827 --- /dev/null +++ b/Assets/Plugins/AllIn1SpriteShader/Demo/Scripts/AllIn1ScrollProperty.cs.meta @@ -0,0 +1,18 @@ +fileFormatVersion: 2 +guid: 384dba07353e1f242b467b6857a1e3d4 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 156513 + packageName: All In 1 Sprite Shader + packageVersion: 4.25 + assetPath: Assets/Plugins/AllIn1SpriteShader/Demo/Scripts/AllIn1ScrollProperty.cs + uploadId: 708810 diff --git a/Assets/Plugins/AllIn1SpriteShader/Demo/Scripts/Demo2AutoScroll.cs b/Assets/Plugins/AllIn1SpriteShader/Demo/Scripts/Demo2AutoScroll.cs new file mode 100644 index 000000000..165b5f64f --- /dev/null +++ b/Assets/Plugins/AllIn1SpriteShader/Demo/Scripts/Demo2AutoScroll.cs @@ -0,0 +1,49 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +namespace AllIn1SpriteShader +{ + public class Demo2AutoScroll : MonoBehaviour + { + private Transform[] children; + public float totalTime; + public GameObject sceneDescription = null; + + void Start() + { + sceneDescription.SetActive(false); + Camera.main.fieldOfView = 60f; + children = GetComponentsInChildren(); + for (int i = 0; i < children.Length; i++) + { + if (children[i].gameObject != gameObject) + { + children[i].gameObject.SetActive(false); + children[i].localPosition = Vector3.zero; + } + } + + totalTime = totalTime / (float)children.Length; + + StartCoroutine(ScrollElements()); + } + + IEnumerator ScrollElements() + { + int i = 0; + while (true) + { + if (children[i].gameObject == gameObject) + { + i = (i + 1) % children.Length; + continue; + } + children[i].gameObject.SetActive(true); + yield return new WaitForSeconds(totalTime); + children[i].gameObject.SetActive(false); + i = (i + 1) % children.Length; + } + } + } +} \ No newline at end of file diff --git a/Assets/Plugins/AllIn1SpriteShader/Demo/Scripts/Demo2AutoScroll.cs.meta b/Assets/Plugins/AllIn1SpriteShader/Demo/Scripts/Demo2AutoScroll.cs.meta new file mode 100644 index 000000000..e8109e7f2 --- /dev/null +++ b/Assets/Plugins/AllIn1SpriteShader/Demo/Scripts/Demo2AutoScroll.cs.meta @@ -0,0 +1,18 @@ +fileFormatVersion: 2 +guid: cc188be2d64e8d041aed6f375d92c463 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 156513 + packageName: All In 1 Sprite Shader + packageVersion: 4.25 + assetPath: Assets/Plugins/AllIn1SpriteShader/Demo/Scripts/Demo2AutoScroll.cs + uploadId: 708810 diff --git a/Assets/Plugins/AllIn1SpriteShader/Demo/Scripts/DemoCamera.cs b/Assets/Plugins/AllIn1SpriteShader/Demo/Scripts/DemoCamera.cs new file mode 100644 index 000000000..35fe11439 --- /dev/null +++ b/Assets/Plugins/AllIn1SpriteShader/Demo/Scripts/DemoCamera.cs @@ -0,0 +1,36 @@ +using System.Collections; +using UnityEngine; + +namespace AllIn1SpriteShader +{ + public class DemoCamera : MonoBehaviour + { + [SerializeField] private Transform targetedItem = null; + [SerializeField] private All1ShaderDemoController demoController = null; + [SerializeField] private float speed = 0; + private Vector3 offset; + private Vector3 target; + private bool canUpdate = false; + + void Awake() + { + offset = transform.position - targetedItem.position; + StartCoroutine(SetCamAfterStart()); + } + + private void Update() + { + if (!canUpdate) return; + target.y = demoController.GetCurrExpositor() * demoController.expositorDistance; + transform.position = Vector3.Lerp(transform.position, target, speed * Time.deltaTime); + } + + IEnumerator SetCamAfterStart() + { + yield return null; + transform.position = targetedItem.position + offset; + target = transform.position; + canUpdate = true; + } + } +} \ No newline at end of file diff --git a/Assets/Plugins/AllIn1SpriteShader/Demo/Scripts/DemoCamera.cs.meta b/Assets/Plugins/AllIn1SpriteShader/Demo/Scripts/DemoCamera.cs.meta new file mode 100644 index 000000000..7869f48ee --- /dev/null +++ b/Assets/Plugins/AllIn1SpriteShader/Demo/Scripts/DemoCamera.cs.meta @@ -0,0 +1,18 @@ +fileFormatVersion: 2 +guid: fcb2e887baa071545bad04c7b0e87cce +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 156513 + packageName: All In 1 Sprite Shader + packageVersion: 4.25 + assetPath: Assets/Plugins/AllIn1SpriteShader/Demo/Scripts/DemoCamera.cs + uploadId: 708810 diff --git a/Assets/Plugins/AllIn1SpriteShader/Demo/Scripts/DemoCircleExpositor.cs b/Assets/Plugins/AllIn1SpriteShader/Demo/Scripts/DemoCircleExpositor.cs new file mode 100644 index 000000000..3fa399f68 --- /dev/null +++ b/Assets/Plugins/AllIn1SpriteShader/Demo/Scripts/DemoCircleExpositor.cs @@ -0,0 +1,54 @@ +using UnityEngine; + +namespace AllIn1SpriteShader +{ + public class DemoCircleExpositor : MonoBehaviour + { + [SerializeField] private float radius = 40f; + [SerializeField] private float rotateSpeed = 10f; + + private float zOffset = 0f; + private Transform[] items; + private int count = 0; + private int currentTarget = 0; + private float offsetRotation, iniY; + private Quaternion dummyRotation; + + void Start() + { + dummyRotation = transform.rotation; + iniY = transform.position.y; + + items = new Transform[transform.childCount]; + foreach (Transform child in transform) + { + items[count] = child; + count++; + } + + offsetRotation = 360.0f / count; + for (int i = 0; i < count; i++) + { + float angle = i * Mathf.PI * 2f / count; + Vector3 newPos = new Vector3(Mathf.Sin(angle) * radius, iniY, -Mathf.Cos(angle) * radius); + items[i].position = newPos; + } + + zOffset = radius - 40f; + transform.position = new Vector3(transform.position.x, transform.position.y, zOffset); + } + + private void Update() + { + transform.rotation = Quaternion.Slerp(transform.rotation, dummyRotation, rotateSpeed * Time.deltaTime); + } + + public void ChangeTarget(int offset) + { + currentTarget += offset; + if (currentTarget > items.Length - 1) currentTarget = 0; + else if (currentTarget < 0) currentTarget = items.Length - 1; + dummyRotation *= Quaternion.Euler(Vector3.up * (offset * offsetRotation)); + } + } +} \ No newline at end of file diff --git a/Assets/Plugins/AllIn1SpriteShader/Demo/Scripts/DemoCircleExpositor.cs.meta b/Assets/Plugins/AllIn1SpriteShader/Demo/Scripts/DemoCircleExpositor.cs.meta new file mode 100644 index 000000000..0a119b327 --- /dev/null +++ b/Assets/Plugins/AllIn1SpriteShader/Demo/Scripts/DemoCircleExpositor.cs.meta @@ -0,0 +1,18 @@ +fileFormatVersion: 2 +guid: 6972382efdee4c642812251660f0c4bb +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 156513 + packageName: All In 1 Sprite Shader + packageVersion: 4.25 + assetPath: Assets/Plugins/AllIn1SpriteShader/Demo/Scripts/DemoCircleExpositor.cs + uploadId: 708810 diff --git a/Assets/Plugins/AllIn1SpriteShader/Demo/Scripts/DemoItem.cs b/Assets/Plugins/AllIn1SpriteShader/Demo/Scripts/DemoItem.cs new file mode 100644 index 000000000..95a88bfee --- /dev/null +++ b/Assets/Plugins/AllIn1SpriteShader/Demo/Scripts/DemoItem.cs @@ -0,0 +1,14 @@ +using UnityEngine; + +namespace AllIn1SpriteShader +{ + public class DemoItem : MonoBehaviour + { + static readonly Vector3 lookAtZ = new Vector3(0, 0, 1); + + void Update() + { + transform.LookAt(transform.position + lookAtZ); + } + } +} \ No newline at end of file diff --git a/Assets/Plugins/AllIn1SpriteShader/Demo/Scripts/DemoItem.cs.meta b/Assets/Plugins/AllIn1SpriteShader/Demo/Scripts/DemoItem.cs.meta new file mode 100644 index 000000000..ed43efab4 --- /dev/null +++ b/Assets/Plugins/AllIn1SpriteShader/Demo/Scripts/DemoItem.cs.meta @@ -0,0 +1,18 @@ +fileFormatVersion: 2 +guid: 98b644315d7a92842b89e04f55c48e02 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 156513 + packageName: All In 1 Sprite Shader + packageVersion: 4.25 + assetPath: Assets/Plugins/AllIn1SpriteShader/Demo/Scripts/DemoItem.cs + uploadId: 708810 diff --git a/Assets/Plugins/AllIn1SpriteShader/Demo/Scripts/DemoRandomColorSwap.cs b/Assets/Plugins/AllIn1SpriteShader/Demo/Scripts/DemoRandomColorSwap.cs new file mode 100644 index 000000000..afa8d7b2a --- /dev/null +++ b/Assets/Plugins/AllIn1SpriteShader/Demo/Scripts/DemoRandomColorSwap.cs @@ -0,0 +1,39 @@ +using UnityEngine; + +namespace AllIn1SpriteShader +{ + public class DemoRandomColorSwap : MonoBehaviour + { + private Material mat; + private readonly int colorSwapRed = Shader.PropertyToID("_ColorSwapRed"); + private readonly int colorSwapGreen = Shader.PropertyToID("_ColorSwapGreen"); + private readonly int colorSwapBlue = Shader.PropertyToID("_ColorSwapBlue"); + + void Start() + { + SpriteRenderer sr = GetComponent(); + if (sr != null) + { + mat = GetComponent().material; + if (mat != null) InvokeRepeating(nameof(NewColor), 0.0f, 0.6f); + else + { + Debug.LogError("No material found"); + Destroy(this); + } + } + } + + private void NewColor() + { + mat.SetColor(colorSwapRed, GenerateColor()); + mat.SetColor(colorSwapGreen, GenerateColor()); + mat.SetColor(colorSwapBlue, GenerateColor()); + } + + private Color GenerateColor() + { + return new Color(Random.Range(0f, 1f), Random.Range(0f, 1f), Random.Range(0f, 1f), 1f); + } + } +} \ No newline at end of file diff --git a/Assets/Plugins/AllIn1SpriteShader/Demo/Scripts/DemoRandomColorSwap.cs.meta b/Assets/Plugins/AllIn1SpriteShader/Demo/Scripts/DemoRandomColorSwap.cs.meta new file mode 100644 index 000000000..b27cf0b52 --- /dev/null +++ b/Assets/Plugins/AllIn1SpriteShader/Demo/Scripts/DemoRandomColorSwap.cs.meta @@ -0,0 +1,18 @@ +fileFormatVersion: 2 +guid: 4ef3964599ee48c4ea5a4ecf012ed949 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 156513 + packageName: All In 1 Sprite Shader + packageVersion: 4.25 + assetPath: Assets/Plugins/AllIn1SpriteShader/Demo/Scripts/DemoRandomColorSwap.cs + uploadId: 708810 diff --git a/Assets/Plugins/AllIn1SpriteShader/Demo/Scripts/DemoRepositionExpositor.cs b/Assets/Plugins/AllIn1SpriteShader/Demo/Scripts/DemoRepositionExpositor.cs new file mode 100644 index 000000000..b26becf8f --- /dev/null +++ b/Assets/Plugins/AllIn1SpriteShader/Demo/Scripts/DemoRepositionExpositor.cs @@ -0,0 +1,24 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +namespace AllIn1SpriteShader +{ + public class DemoRepositionExpositor : MonoBehaviour + { + [SerializeField] private float paddingX = 10f; + + [ContextMenu("RepositionExpositor")] + private void RepositionExpositor() + { + int i = 0; + Vector3 tempLocalPos = Vector3.zero; + foreach (Transform child in transform) + { + tempLocalPos.x = i * paddingX; + child.localPosition = tempLocalPos; + i++; + } + } + } +} \ No newline at end of file diff --git a/Assets/Plugins/AllIn1SpriteShader/Demo/Scripts/DemoRepositionExpositor.cs.meta b/Assets/Plugins/AllIn1SpriteShader/Demo/Scripts/DemoRepositionExpositor.cs.meta new file mode 100644 index 000000000..930687560 --- /dev/null +++ b/Assets/Plugins/AllIn1SpriteShader/Demo/Scripts/DemoRepositionExpositor.cs.meta @@ -0,0 +1,18 @@ +fileFormatVersion: 2 +guid: 681095680e77fad40a6dd907b8ba358b +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 156513 + packageName: All In 1 Sprite Shader + packageVersion: 4.25 + assetPath: Assets/Plugins/AllIn1SpriteShader/Demo/Scripts/DemoRepositionExpositor.cs + uploadId: 708810 diff --git a/Assets/Plugins/AllIn1SpriteShader/Demo/Textures.meta b/Assets/Plugins/AllIn1SpriteShader/Demo/Textures.meta new file mode 100644 index 000000000..690e5f765 --- /dev/null +++ b/Assets/Plugins/AllIn1SpriteShader/Demo/Textures.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 2079251647b8b824abecc812d174a9f3 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/AllIn1SpriteShader/Demo/Textures/BoyGirl.png b/Assets/Plugins/AllIn1SpriteShader/Demo/Textures/BoyGirl.png new file mode 100644 index 000000000..342ffd3ce Binary files /dev/null and b/Assets/Plugins/AllIn1SpriteShader/Demo/Textures/BoyGirl.png differ diff --git a/Assets/Plugins/AllIn1SpriteShader/Demo/Textures/BoyGirl.png.meta b/Assets/Plugins/AllIn1SpriteShader/Demo/Textures/BoyGirl.png.meta new file mode 100644 index 000000000..2e6bfa606 --- /dev/null +++ b/Assets/Plugins/AllIn1SpriteShader/Demo/Textures/BoyGirl.png.meta @@ -0,0 +1,204 @@ +fileFormatVersion: 2 +guid: 07103c52b3aaeca4da8a83361edd059f +TextureImporter: + internalIDToNameTable: + - first: + 213: 21300000 + second: Boy + - first: + 213: 21300002 + second: Girl + externalObjects: {} + serializedVersion: 12 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + sRGBTexture: 1 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + vTOnly: 0 + ignoreMasterTextureLimit: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: 1 + aniso: 1 + mipBias: 0 + wrapU: 0 + wrapV: 0 + wrapW: 0 + nPOTScale: 0 + lightmap: 0 + compressionQuality: 50 + spriteMode: 2 + spriteExtrude: 1 + spriteMeshType: 0 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 100 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 + alphaIsTransparency: 1 + spriteTessellationDetail: -1 + textureType: 8 + textureShape: 1 + singleChannelComponent: 0 + flipbookRows: 1 + flipbookColumns: 1 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + ignorePngGamma: 0 + applyGammaDecoding: 1 + cookieLightType: 1 + platformSettings: + - serializedVersion: 3 + buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 1 + - serializedVersion: 3 + buildTarget: Standalone + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 1 + - serializedVersion: 3 + buildTarget: iPhone + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 1 + - serializedVersion: 3 + buildTarget: Android + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 1 + - serializedVersion: 3 + buildTarget: WebGL + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 1 + spriteSheet: + serializedVersion: 2 + sprites: + - serializedVersion: 2 + name: Boy + rect: + serializedVersion: 2 + x: 3 + y: 495 + width: 566 + height: 485 + alignment: 0 + pivot: {x: 0.5, y: 0.5} + border: {x: 0, y: 0, z: 0, w: 0} + outline: [] + physicsShape: [] + tessellationDetail: 0 + bones: [] + spriteID: 6b3b5448e2e55624aa5325fede49615b + internalID: 21300000 + vertices: [] + indices: + edges: [] + weights: [] + - serializedVersion: 2 + name: Girl + rect: + serializedVersion: 2 + x: 526 + y: 34 + width: 486 + height: 484 + alignment: 0 + pivot: {x: 0.5, y: 0.5} + border: {x: 0, y: 0, z: 0, w: 0} + outline: [] + physicsShape: [] + tessellationDetail: 0 + bones: [] + spriteID: d759c9ac7a1ec634cbff17145cdcce9e + internalID: 21300002 + vertices: [] + indices: + edges: [] + weights: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: 396e3acf790e9eb478ef7901a27a3a08 + internalID: 0 + vertices: [] + indices: + edges: [] + weights: [] + secondaryTextures: [] + nameFileIdTable: + Boy: 21300000 + Girl: 21300002 + spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 156513 + packageName: All In 1 Sprite Shader + packageVersion: 4.25 + assetPath: Assets/Plugins/AllIn1SpriteShader/Demo/Textures/BoyGirl.png + uploadId: 708810 diff --git a/Assets/Plugins/AllIn1SpriteShader/Demo/Textures/Circle.png b/Assets/Plugins/AllIn1SpriteShader/Demo/Textures/Circle.png new file mode 100644 index 000000000..8eb1b1ecc Binary files /dev/null and b/Assets/Plugins/AllIn1SpriteShader/Demo/Textures/Circle.png differ diff --git a/Assets/Plugins/AllIn1SpriteShader/Demo/Textures/Circle.png.meta b/Assets/Plugins/AllIn1SpriteShader/Demo/Textures/Circle.png.meta new file mode 100644 index 000000000..a5a184f1c --- /dev/null +++ b/Assets/Plugins/AllIn1SpriteShader/Demo/Textures/Circle.png.meta @@ -0,0 +1,353 @@ +fileFormatVersion: 2 +guid: 4b40fc0f65c85f14fbc9c7c5f40ca686 +TextureImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 10 + mipmaps: + mipMapMode: 0 + enableMipMap: 1 + sRGBTexture: 1 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: 0 + aniso: 1 + mipBias: 0 + wrapU: 0 + wrapV: 0 + wrapW: 0 + nPOTScale: 0 + lightmap: 0 + compressionQuality: 50 + spriteMode: 3 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 4 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 + alphaIsTransparency: 0 + spriteTessellationDetail: -1 + textureType: 8 + textureShape: 1 + singleChannelComponent: 0 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + platformSettings: + - serializedVersion: 2 + buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: 4 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: + - - {x: 0, y: 2} + - {x: -0.09813535, y: 1.9975909} + - {x: -0.19603428, y: 1.9903694} + - {x: -0.29346094, y: 1.978353} + - {x: -0.39018065, y: 1.9615705} + - {x: -0.4859604, y: 1.9400625} + - {x: -0.5805693, y: 1.9138807} + - {x: -0.67377967, y: 1.8830881} + - {x: -0.76536685, y: 1.8477591} + - {x: -0.8551101, y: 1.8079786} + - {x: -0.9427934, y: 1.7638426} + - {x: -1.0282055, y: 1.7154572} + - {x: -1.1111405, y: 1.6629392} + - {x: -1.1913986, y: 1.606415} + - {x: -1.2687867, y: 1.5460209} + - {x: -1.343118, y: 1.4819021} + - {x: -1.4142137, y: 1.4142134} + - {x: -1.4819024, y: 1.3431177} + - {x: -1.5460211, y: 1.2687864} + - {x: -1.6064153, y: 1.1913984} + - {x: -1.6629394, y: 1.1111403} + - {x: -1.7154574, y: 1.0282052} + - {x: -1.7638427, y: 0.94279313} + - {x: -1.8079787, y: 0.8551098} + - {x: -1.8477592, y: 0.76536644} + - {x: -1.8830884, y: 0.6737792} + - {x: -1.9138808, y: 0.5805688} + - {x: -1.9400626, y: 0.48595977} + - {x: -1.9615707, y: 0.39018002} + - {x: -1.9783531, y: 0.29346028} + - {x: -1.9903696, y: 0.19603357} + - {x: -1.9975909, y: 0.098134585} + - {x: -2, y: -0.0000008026785} + - {x: -1.9975909, y: -0.09813619} + - {x: -1.9903693, y: -0.19603516} + - {x: -1.9783529, y: -0.29346186} + - {x: -1.9615704, y: -0.3901816} + - {x: -1.9400623, y: -0.48596132} + - {x: -1.9138803, y: -0.58057034} + - {x: -1.8830878, y: -0.67378074} + - {x: -1.8477587, y: -0.7653679} + - {x: -1.8079782, y: -0.855111} + - {x: -1.7638422, y: -0.9427941} + - {x: -1.715457, y: -1.028206} + - {x: -1.6629391, y: -1.1111407} + - {x: -1.606415, y: -1.1913987} + - {x: -1.546021, y: -1.2687865} + - {x: -1.4819025, y: -1.3431177} + - {x: -1.4142139, y: -1.4142132} + - {x: -1.3431184, y: -1.4819018} + - {x: -1.2687873, y: -1.5460204} + - {x: -1.1913995, y: -1.6064144} + - {x: -1.1111416, y: -1.6629385} + - {x: -1.0282067, y: -1.7154565} + - {x: -0.9427949, y: -1.7638417} + - {x: -0.85511184, y: -1.8079778} + - {x: -0.76536876, y: -1.8477583} + - {x: -0.6737818, y: -1.8830874} + - {x: -0.5805717, y: -1.91388} + - {x: -0.48596293, y: -1.9400618} + - {x: -0.39018345, y: -1.96157} + - {x: -0.29346398, y: -1.9783525} + - {x: -0.1960375, y: -1.9903691} + - {x: -0.09813879, y: -1.9975908} + - {x: -0.0000036398517, y: -2} + - {x: 0.098131515, y: -1.9975911} + - {x: 0.19603026, y: -1.9903698} + - {x: 0.29345676, y: -1.9783536} + - {x: 0.3901763, y: -1.9615715} + - {x: 0.48595586, y: -1.9400636} + - {x: 0.58056474, y: -1.913882} + - {x: 0.67377496, y: -1.8830898} + - {x: 0.765362, y: -1.847761} + - {x: 0.8551053, y: -1.8079809} + - {x: 0.94278854, y: -1.7638452} + - {x: 1.0282005, y: -1.7154602} + - {x: 1.1111355, y: -1.6629425} + - {x: 1.1913936, y: -1.6064187} + - {x: 1.2687817, y: -1.5460249} + - {x: 1.3431131, y: -1.4819067} + - {x: 1.4142088, y: -1.4142184} + - {x: 1.4818976, y: -1.3431231} + - {x: 1.5460167, y: -1.2687918} + - {x: 1.6064112, y: -1.1914037} + - {x: 1.6629357, y: -1.1111456} + - {x: 1.7154542, y: -1.0282105} + - {x: 1.7638398, y: -0.94279844} + - {x: 1.8079762, y: -0.855115} + - {x: 1.8477571, y: -0.76537156} + - {x: 1.8830866, y: -0.6737842} + - {x: 1.9138794, y: -0.5805737} + - {x: 1.9400615, y: -0.48596448} + - {x: 1.9615698, y: -0.39018452} + - {x: 1.9783524, y: -0.29346457} + - {x: 1.9903691, y: -0.19603767} + - {x: 1.9975908, y: -0.09813846} + - {x: 2, y: -0.0000028371733} + - {x: 1.997591, y: 0.0981328} + - {x: 1.9903697, y: 0.19603202} + - {x: 1.9783533, y: 0.29345897} + - {x: 1.9615709, y: 0.39017895} + - {x: 1.9400629, y: 0.48595896} + - {x: 1.9138811, y: 0.58056825} + - {x: 1.8830885, y: 0.6737789} + - {x: 1.8477592, y: 0.7653663} + - {x: 1.8079787, y: 0.8551099} + - {x: 1.7638426, y: 0.9427934} + - {x: 1.7154571, y: 1.0282056} + - {x: 1.662939, y: 1.1111408} + - {x: 1.6064146, y: 1.1913992} + - {x: 1.5460203, y: 1.2687874} + - {x: 1.4819014, y: 1.3431189} + - {x: 1.4142125, y: 1.4142147} + - {x: 1.3431165, y: 1.4819036} + - {x: 1.2687849, y: 1.5460223} + - {x: 1.1913966, y: 1.6064166} + - {x: 1.1111382, y: 1.6629407} + - {x: 1.0282029, y: 1.7154588} + - {x: 0.94279057, y: 1.7638441} + - {x: 0.85510695, y: 1.8079801} + - {x: 0.76536334, y: 1.8477606} + - {x: 0.67377585, y: 1.8830895} + - {x: 0.58056515, y: 1.9138819} + - {x: 0.48595583, y: 1.9400636} + - {x: 0.3901758, y: 1.9615716} + - {x: 0.29345578, y: 1.9783537} + - {x: 0.1960288, y: 1.99037} + - {x: 0.09812956, y: 1.9975911} + physicsShape: + - - {x: 0, y: 2} + - {x: -0.09813535, y: 1.9975909} + - {x: -0.19603428, y: 1.9903694} + - {x: -0.29346094, y: 1.978353} + - {x: -0.39018065, y: 1.9615705} + - {x: -0.4859604, y: 1.9400625} + - {x: -0.5805693, y: 1.9138807} + - {x: -0.67377967, y: 1.8830881} + - {x: -0.76536685, y: 1.8477591} + - {x: -0.8551101, y: 1.8079786} + - {x: -0.9427934, y: 1.7638426} + - {x: -1.0282055, y: 1.7154572} + - {x: -1.1111405, y: 1.6629392} + - {x: -1.1913986, y: 1.606415} + - {x: -1.2687867, y: 1.5460209} + - {x: -1.343118, y: 1.4819021} + - {x: -1.4142137, y: 1.4142134} + - {x: -1.4819024, y: 1.3431177} + - {x: -1.5460211, y: 1.2687864} + - {x: -1.6064153, y: 1.1913984} + - {x: -1.6629394, y: 1.1111403} + - {x: -1.7154574, y: 1.0282052} + - {x: -1.7638427, y: 0.94279313} + - {x: -1.8079787, y: 0.8551098} + - {x: -1.8477592, y: 0.76536644} + - {x: -1.8830884, y: 0.6737792} + - {x: -1.9138808, y: 0.5805688} + - {x: -1.9400626, y: 0.48595977} + - {x: -1.9615707, y: 0.39018002} + - {x: -1.9783531, y: 0.29346028} + - {x: -1.9903696, y: 0.19603357} + - {x: -1.9975909, y: 0.098134585} + - {x: -2, y: -0.0000008026785} + - {x: -1.9975909, y: -0.09813619} + - {x: -1.9903693, y: -0.19603516} + - {x: -1.9783529, y: -0.29346186} + - {x: -1.9615704, y: -0.3901816} + - {x: -1.9400623, y: -0.48596132} + - {x: -1.9138803, y: -0.58057034} + - {x: -1.8830878, y: -0.67378074} + - {x: -1.8477587, y: -0.7653679} + - {x: -1.8079782, y: -0.855111} + - {x: -1.7638422, y: -0.9427941} + - {x: -1.715457, y: -1.028206} + - {x: -1.6629391, y: -1.1111407} + - {x: -1.606415, y: -1.1913987} + - {x: -1.546021, y: -1.2687865} + - {x: -1.4819025, y: -1.3431177} + - {x: -1.4142139, y: -1.4142132} + - {x: -1.3431184, y: -1.4819018} + - {x: -1.2687873, y: -1.5460204} + - {x: -1.1913995, y: -1.6064144} + - {x: -1.1111416, y: -1.6629385} + - {x: -1.0282067, y: -1.7154565} + - {x: -0.9427949, y: -1.7638417} + - {x: -0.85511184, y: -1.8079778} + - {x: -0.76536876, y: -1.8477583} + - {x: -0.6737818, y: -1.8830874} + - {x: -0.5805717, y: -1.91388} + - {x: -0.48596293, y: -1.9400618} + - {x: -0.39018345, y: -1.96157} + - {x: -0.29346398, y: -1.9783525} + - {x: -0.1960375, y: -1.9903691} + - {x: -0.09813879, y: -1.9975908} + - {x: -0.0000036398517, y: -2} + - {x: 0.098131515, y: -1.9975911} + - {x: 0.19603026, y: -1.9903698} + - {x: 0.29345676, y: -1.9783536} + - {x: 0.3901763, y: -1.9615715} + - {x: 0.48595586, y: -1.9400636} + - {x: 0.58056474, y: -1.913882} + - {x: 0.67377496, y: -1.8830898} + - {x: 0.765362, y: -1.847761} + - {x: 0.8551053, y: -1.8079809} + - {x: 0.94278854, y: -1.7638452} + - {x: 1.0282005, y: -1.7154602} + - {x: 1.1111355, y: -1.6629425} + - {x: 1.1913936, y: -1.6064187} + - {x: 1.2687817, y: -1.5460249} + - {x: 1.3431131, y: -1.4819067} + - {x: 1.4142088, y: -1.4142184} + - {x: 1.4818976, y: -1.3431231} + - {x: 1.5460167, y: -1.2687918} + - {x: 1.6064112, y: -1.1914037} + - {x: 1.6629357, y: -1.1111456} + - {x: 1.7154542, y: -1.0282105} + - {x: 1.7638398, y: -0.94279844} + - {x: 1.8079762, y: -0.855115} + - {x: 1.8477571, y: -0.76537156} + - {x: 1.8830866, y: -0.6737842} + - {x: 1.9138794, y: -0.5805737} + - {x: 1.9400615, y: -0.48596448} + - {x: 1.9615698, y: -0.39018452} + - {x: 1.9783524, y: -0.29346457} + - {x: 1.9903691, y: -0.19603767} + - {x: 1.9975908, y: -0.09813846} + - {x: 2, y: -0.0000028371733} + - {x: 1.997591, y: 0.0981328} + - {x: 1.9903697, y: 0.19603202} + - {x: 1.9783533, y: 0.29345897} + - {x: 1.9615709, y: 0.39017895} + - {x: 1.9400629, y: 0.48595896} + - {x: 1.9138811, y: 0.58056825} + - {x: 1.8830885, y: 0.6737789} + - {x: 1.8477592, y: 0.7653663} + - {x: 1.8079787, y: 0.8551099} + - {x: 1.7638426, y: 0.9427934} + - {x: 1.7154571, y: 1.0282056} + - {x: 1.662939, y: 1.1111408} + - {x: 1.6064146, y: 1.1913992} + - {x: 1.5460203, y: 1.2687874} + - {x: 1.4819014, y: 1.3431189} + - {x: 1.4142125, y: 1.4142147} + - {x: 1.3431165, y: 1.4819036} + - {x: 1.2687849, y: 1.5460223} + - {x: 1.1913966, y: 1.6064166} + - {x: 1.1111382, y: 1.6629407} + - {x: 1.0282029, y: 1.7154588} + - {x: 0.94279057, y: 1.7638441} + - {x: 0.85510695, y: 1.8079801} + - {x: 0.76536334, y: 1.8477606} + - {x: 0.67377585, y: 1.8830895} + - {x: 0.58056515, y: 1.9138819} + - {x: 0.48595583, y: 1.9400636} + - {x: 0.3901758, y: 1.9615716} + - {x: 0.29345578, y: 1.9783537} + - {x: 0.1960288, y: 1.99037} + - {x: 0.09812956, y: 1.9975911} + bones: [] + spriteID: 9a5d93fd276093242b4d07bd28b8611a + internalID: 0 + vertices: [] + indices: + edges: [] + weights: [] + secondaryTextures: [] + spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 156513 + packageName: All In 1 Sprite Shader + packageVersion: 4.25 + assetPath: Assets/Plugins/AllIn1SpriteShader/Demo/Textures/Circle.png + uploadId: 708810 diff --git a/Assets/Plugins/AllIn1SpriteShader/Demo/Textures/IceTexture.png b/Assets/Plugins/AllIn1SpriteShader/Demo/Textures/IceTexture.png new file mode 100644 index 000000000..612786888 Binary files /dev/null and b/Assets/Plugins/AllIn1SpriteShader/Demo/Textures/IceTexture.png differ diff --git a/Assets/Plugins/AllIn1SpriteShader/Demo/Textures/IceTexture.png.meta b/Assets/Plugins/AllIn1SpriteShader/Demo/Textures/IceTexture.png.meta new file mode 100644 index 000000000..42b535f49 --- /dev/null +++ b/Assets/Plugins/AllIn1SpriteShader/Demo/Textures/IceTexture.png.meta @@ -0,0 +1,97 @@ +fileFormatVersion: 2 +guid: 49cc75da86b2bb949b1235ad2a384f9b +TextureImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 10 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + sRGBTexture: 1 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: -1 + aniso: -1 + mipBias: -100 + wrapU: 1 + wrapV: 1 + wrapW: 1 + nPOTScale: 0 + lightmap: 0 + compressionQuality: 50 + spriteMode: 1 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 100 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 + alphaIsTransparency: 1 + spriteTessellationDetail: -1 + textureType: 8 + textureShape: 1 + singleChannelComponent: 0 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + platformSettings: + - serializedVersion: 2 + buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: 47b0447a9c1f42444a0656dca4167218 + internalID: 0 + vertices: [] + indices: + edges: [] + weights: [] + secondaryTextures: [] + spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 156513 + packageName: All In 1 Sprite Shader + packageVersion: 4.25 + assetPath: Assets/Plugins/AllIn1SpriteShader/Demo/Textures/IceTexture.png + uploadId: 708810 diff --git a/Assets/Plugins/AllIn1SpriteShader/Demo/Textures/Magic1.png b/Assets/Plugins/AllIn1SpriteShader/Demo/Textures/Magic1.png new file mode 100644 index 000000000..73a14c682 Binary files /dev/null and b/Assets/Plugins/AllIn1SpriteShader/Demo/Textures/Magic1.png differ diff --git a/Assets/Plugins/AllIn1SpriteShader/Demo/Textures/Magic1.png.meta b/Assets/Plugins/AllIn1SpriteShader/Demo/Textures/Magic1.png.meta new file mode 100644 index 000000000..c1ecf87c1 --- /dev/null +++ b/Assets/Plugins/AllIn1SpriteShader/Demo/Textures/Magic1.png.meta @@ -0,0 +1,95 @@ +fileFormatVersion: 2 +guid: 7f33f36658f399a44be84455bcd911b1 +TextureImporter: + fileIDToRecycleName: {} + externalObjects: {} + serializedVersion: 9 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + sRGBTexture: 1 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: -1 + aniso: -1 + mipBias: -100 + wrapU: 1 + wrapV: 1 + wrapW: 1 + nPOTScale: 0 + lightmap: 0 + compressionQuality: 50 + spriteMode: 1 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 100 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 + alphaIsTransparency: 1 + spriteTessellationDetail: -1 + textureType: 8 + textureShape: 1 + singleChannelComponent: 0 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + platformSettings: + - serializedVersion: 2 + buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: 4ac03ff046060d047baa00b1ec42dcf2 + vertices: [] + indices: + edges: [] + weights: [] + spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 156513 + packageName: All In 1 Sprite Shader + packageVersion: 4.25 + assetPath: Assets/Plugins/AllIn1SpriteShader/Demo/Textures/Magic1.png + uploadId: 708810 diff --git a/Assets/Plugins/AllIn1SpriteShader/Demo/Textures/Magic2.png b/Assets/Plugins/AllIn1SpriteShader/Demo/Textures/Magic2.png new file mode 100644 index 000000000..c14ef28d6 Binary files /dev/null and b/Assets/Plugins/AllIn1SpriteShader/Demo/Textures/Magic2.png differ diff --git a/Assets/Plugins/AllIn1SpriteShader/Demo/Textures/Magic2.png.meta b/Assets/Plugins/AllIn1SpriteShader/Demo/Textures/Magic2.png.meta new file mode 100644 index 000000000..5799759d7 --- /dev/null +++ b/Assets/Plugins/AllIn1SpriteShader/Demo/Textures/Magic2.png.meta @@ -0,0 +1,128 @@ +fileFormatVersion: 2 +guid: 2ea3ea54c499d314f957e0a47dc11c9c +TextureImporter: + fileIDToRecycleName: {} + externalObjects: {} + serializedVersion: 9 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + sRGBTexture: 1 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: -1 + aniso: -1 + mipBias: -100 + wrapU: 1 + wrapV: 1 + wrapW: 1 + nPOTScale: 0 + lightmap: 0 + compressionQuality: 50 + spriteMode: 1 + spriteExtrude: 1 + spriteMeshType: 0 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 100 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 2 + alphaIsTransparency: 1 + spriteTessellationDetail: -1 + textureType: 8 + textureShape: 1 + singleChannelComponent: 0 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + platformSettings: + - serializedVersion: 2 + buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + - serializedVersion: 2 + buildTarget: Standalone + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + - serializedVersion: 2 + buildTarget: Android + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + - serializedVersion: 2 + buildTarget: WebGL + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: af5c8d9995b9cee40bde0cdd45bcd67c + vertices: [] + indices: + edges: [] + weights: [] + spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 156513 + packageName: All In 1 Sprite Shader + packageVersion: 4.25 + assetPath: Assets/Plugins/AllIn1SpriteShader/Demo/Textures/Magic2.png + uploadId: 708810 diff --git a/Assets/Plugins/AllIn1SpriteShader/Demo/Textures/RockTexture.png b/Assets/Plugins/AllIn1SpriteShader/Demo/Textures/RockTexture.png new file mode 100644 index 000000000..321d6c0d0 Binary files /dev/null and b/Assets/Plugins/AllIn1SpriteShader/Demo/Textures/RockTexture.png differ diff --git a/Assets/Plugins/AllIn1SpriteShader/Demo/Textures/RockTexture.png.meta b/Assets/Plugins/AllIn1SpriteShader/Demo/Textures/RockTexture.png.meta new file mode 100644 index 000000000..d1820a8b5 --- /dev/null +++ b/Assets/Plugins/AllIn1SpriteShader/Demo/Textures/RockTexture.png.meta @@ -0,0 +1,130 @@ +fileFormatVersion: 2 +guid: c6ad7b22efb776c448982ca631b16f73 +TextureImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 12 + mipmaps: + mipMapMode: 0 + enableMipMap: 1 + sRGBTexture: 1 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + vTOnly: 0 + ignoreMasterTextureLimit: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: 1 + aniso: 1 + mipBias: 0 + wrapU: 0 + wrapV: 0 + wrapW: 0 + nPOTScale: 1 + lightmap: 0 + compressionQuality: 50 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 100 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 + alphaIsTransparency: 0 + spriteTessellationDetail: -1 + textureType: 0 + textureShape: 1 + singleChannelComponent: 0 + flipbookRows: 1 + flipbookColumns: 1 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + ignorePngGamma: 0 + applyGammaDecoding: 0 + cookieLightType: 0 + platformSettings: + - serializedVersion: 3 + buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Standalone + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: WebGL + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: + internalID: 0 + vertices: [] + indices: + edges: [] + weights: [] + secondaryTextures: [] + nameFileIdTable: {} + spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 156513 + packageName: All In 1 Sprite Shader + packageVersion: 4.25 + assetPath: Assets/Plugins/AllIn1SpriteShader/Demo/Textures/RockTexture.png + uploadId: 708810 diff --git a/Assets/Plugins/AllIn1SpriteShader/Demo/Textures/RockTextureNormal.png b/Assets/Plugins/AllIn1SpriteShader/Demo/Textures/RockTextureNormal.png new file mode 100644 index 000000000..4fa037cd1 Binary files /dev/null and b/Assets/Plugins/AllIn1SpriteShader/Demo/Textures/RockTextureNormal.png differ diff --git a/Assets/Plugins/AllIn1SpriteShader/Demo/Textures/RockTextureNormal.png.meta b/Assets/Plugins/AllIn1SpriteShader/Demo/Textures/RockTextureNormal.png.meta new file mode 100644 index 000000000..421101ab4 --- /dev/null +++ b/Assets/Plugins/AllIn1SpriteShader/Demo/Textures/RockTextureNormal.png.meta @@ -0,0 +1,130 @@ +fileFormatVersion: 2 +guid: fdff8a56ae2c830478b84c6807aa0408 +TextureImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 12 + mipmaps: + mipMapMode: 0 + enableMipMap: 1 + sRGBTexture: 0 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + vTOnly: 0 + ignoreMasterTextureLimit: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: 1 + aniso: 1 + mipBias: 0 + wrapU: 0 + wrapV: 0 + wrapW: 0 + nPOTScale: 1 + lightmap: 0 + compressionQuality: 50 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 100 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 + alphaIsTransparency: 0 + spriteTessellationDetail: -1 + textureType: 1 + textureShape: 1 + singleChannelComponent: 0 + flipbookRows: 1 + flipbookColumns: 1 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + ignorePngGamma: 0 + applyGammaDecoding: 0 + cookieLightType: 0 + platformSettings: + - serializedVersion: 3 + buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Standalone + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: WebGL + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: + internalID: 0 + vertices: [] + indices: + edges: [] + weights: [] + secondaryTextures: [] + nameFileIdTable: {} + spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 156513 + packageName: All In 1 Sprite Shader + packageVersion: 4.25 + assetPath: Assets/Plugins/AllIn1SpriteShader/Demo/Textures/RockTextureNormal.png + uploadId: 708810 diff --git a/Assets/Plugins/AllIn1SpriteShader/Demo/Textures/Square.png b/Assets/Plugins/AllIn1SpriteShader/Demo/Textures/Square.png new file mode 100644 index 000000000..8eb1b1ecc Binary files /dev/null and b/Assets/Plugins/AllIn1SpriteShader/Demo/Textures/Square.png differ diff --git a/Assets/Plugins/AllIn1SpriteShader/Demo/Textures/Square.png.meta b/Assets/Plugins/AllIn1SpriteShader/Demo/Textures/Square.png.meta new file mode 100644 index 000000000..57830d16d --- /dev/null +++ b/Assets/Plugins/AllIn1SpriteShader/Demo/Textures/Square.png.meta @@ -0,0 +1,105 @@ +fileFormatVersion: 2 +guid: fab06e0be9375cc4d823efa71629885c +TextureImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 10 + mipmaps: + mipMapMode: 0 + enableMipMap: 1 + sRGBTexture: 1 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: 0 + aniso: 1 + mipBias: 0 + wrapU: 0 + wrapV: 0 + wrapW: 0 + nPOTScale: 0 + lightmap: 0 + compressionQuality: 50 + spriteMode: 3 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 4 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 + alphaIsTransparency: 0 + spriteTessellationDetail: -1 + textureType: 8 + textureShape: 1 + singleChannelComponent: 0 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + platformSettings: + - serializedVersion: 2 + buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: 4 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: + - - {x: -2, y: -2} + - {x: -2, y: 2} + - {x: 2, y: 2} + - {x: 2, y: -2} + physicsShape: + - - {x: -2, y: -2} + - {x: -2, y: 2} + - {x: 2, y: 2} + - {x: 2, y: -2} + bones: [] + spriteID: a6651eff1c5cc3945bb789d5017c08a6 + internalID: 0 + vertices: [] + indices: + edges: [] + weights: [] + secondaryTextures: [] + spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 156513 + packageName: All In 1 Sprite Shader + packageVersion: 4.25 + assetPath: Assets/Plugins/AllIn1SpriteShader/Demo/Textures/Square.png + uploadId: 708810 diff --git a/Assets/Plugins/AllIn1SpriteShader/Demo/Textures/WoodTexture.png b/Assets/Plugins/AllIn1SpriteShader/Demo/Textures/WoodTexture.png new file mode 100644 index 000000000..af0123ff8 Binary files /dev/null and b/Assets/Plugins/AllIn1SpriteShader/Demo/Textures/WoodTexture.png differ diff --git a/Assets/Plugins/AllIn1SpriteShader/Demo/Textures/WoodTexture.png.meta b/Assets/Plugins/AllIn1SpriteShader/Demo/Textures/WoodTexture.png.meta new file mode 100644 index 000000000..da36bb1ba --- /dev/null +++ b/Assets/Plugins/AllIn1SpriteShader/Demo/Textures/WoodTexture.png.meta @@ -0,0 +1,130 @@ +fileFormatVersion: 2 +guid: fd279c0d74378ff48b61c27ffc8873eb +TextureImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 12 + mipmaps: + mipMapMode: 0 + enableMipMap: 1 + sRGBTexture: 1 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + vTOnly: 0 + ignoreMasterTextureLimit: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: 1 + aniso: 1 + mipBias: 0 + wrapU: 0 + wrapV: 0 + wrapW: 0 + nPOTScale: 1 + lightmap: 0 + compressionQuality: 50 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 100 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 + alphaIsTransparency: 0 + spriteTessellationDetail: -1 + textureType: 0 + textureShape: 1 + singleChannelComponent: 0 + flipbookRows: 1 + flipbookColumns: 1 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + ignorePngGamma: 0 + applyGammaDecoding: 0 + cookieLightType: 0 + platformSettings: + - serializedVersion: 3 + buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Standalone + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: WebGL + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: + internalID: 0 + vertices: [] + indices: + edges: [] + weights: [] + secondaryTextures: [] + nameFileIdTable: {} + spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 156513 + packageName: All In 1 Sprite Shader + packageVersion: 4.25 + assetPath: Assets/Plugins/AllIn1SpriteShader/Demo/Textures/WoodTexture.png + uploadId: 708810 diff --git a/Assets/Plugins/AllIn1SpriteShader/Demo/Textures/WoodTextureNormal.png b/Assets/Plugins/AllIn1SpriteShader/Demo/Textures/WoodTextureNormal.png new file mode 100644 index 000000000..b9716d19f Binary files /dev/null and b/Assets/Plugins/AllIn1SpriteShader/Demo/Textures/WoodTextureNormal.png differ diff --git a/Assets/Plugins/AllIn1SpriteShader/Demo/Textures/WoodTextureNormal.png.meta b/Assets/Plugins/AllIn1SpriteShader/Demo/Textures/WoodTextureNormal.png.meta new file mode 100644 index 000000000..18b1f8e10 --- /dev/null +++ b/Assets/Plugins/AllIn1SpriteShader/Demo/Textures/WoodTextureNormal.png.meta @@ -0,0 +1,130 @@ +fileFormatVersion: 2 +guid: 47c3680e2892fa44b80abb6447b1a619 +TextureImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 12 + mipmaps: + mipMapMode: 0 + enableMipMap: 1 + sRGBTexture: 0 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + vTOnly: 0 + ignoreMasterTextureLimit: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: 1 + aniso: 1 + mipBias: 0 + wrapU: 0 + wrapV: 0 + wrapW: 0 + nPOTScale: 1 + lightmap: 0 + compressionQuality: 50 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 100 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 + alphaIsTransparency: 0 + spriteTessellationDetail: -1 + textureType: 1 + textureShape: 1 + singleChannelComponent: 0 + flipbookRows: 1 + flipbookColumns: 1 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + ignorePngGamma: 0 + applyGammaDecoding: 0 + cookieLightType: 0 + platformSettings: + - serializedVersion: 3 + buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Standalone + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: WebGL + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: + internalID: 0 + vertices: [] + indices: + edges: [] + weights: [] + secondaryTextures: [] + nameFileIdTable: {} + spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 156513 + packageName: All In 1 Sprite Shader + packageVersion: 4.25 + assetPath: Assets/Plugins/AllIn1SpriteShader/Demo/Textures/WoodTextureNormal.png + uploadId: 708810 diff --git a/Assets/Plugins/AllIn1SpriteShader/Demo/Textures/backMountain.png b/Assets/Plugins/AllIn1SpriteShader/Demo/Textures/backMountain.png new file mode 100644 index 000000000..4ff3facd3 Binary files /dev/null and b/Assets/Plugins/AllIn1SpriteShader/Demo/Textures/backMountain.png differ diff --git a/Assets/Plugins/AllIn1SpriteShader/Demo/Textures/backMountain.png.meta b/Assets/Plugins/AllIn1SpriteShader/Demo/Textures/backMountain.png.meta new file mode 100644 index 000000000..279a0c771 --- /dev/null +++ b/Assets/Plugins/AllIn1SpriteShader/Demo/Textures/backMountain.png.meta @@ -0,0 +1,141 @@ +fileFormatVersion: 2 +guid: 758ac31a9bff9ac4181f54de54a6ecb7 +TextureImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 10 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + sRGBTexture: 1 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: -1 + aniso: -1 + mipBias: -100 + wrapU: 0 + wrapV: 0 + wrapW: 0 + nPOTScale: 0 + lightmap: 0 + compressionQuality: 50 + spriteMode: 1 + spriteExtrude: 1 + spriteMeshType: 0 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 150 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 + alphaIsTransparency: 1 + spriteTessellationDetail: -1 + textureType: 8 + textureShape: 1 + singleChannelComponent: 0 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + platformSettings: + - serializedVersion: 2 + buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + - serializedVersion: 2 + buildTarget: Standalone + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + - serializedVersion: 2 + buildTarget: iPhone + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + - serializedVersion: 2 + buildTarget: Android + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + - serializedVersion: 2 + buildTarget: WebGL + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: 00ec50f99942acb49b4119afac5cab4c + internalID: 0 + vertices: [] + indices: + edges: [] + weights: [] + secondaryTextures: [] + spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 156513 + packageName: All In 1 Sprite Shader + packageVersion: 4.25 + assetPath: Assets/Plugins/AllIn1SpriteShader/Demo/Textures/backMountain.png + uploadId: 708810 diff --git a/Assets/Plugins/AllIn1SpriteShader/Demo/Textures/coals.png b/Assets/Plugins/AllIn1SpriteShader/Demo/Textures/coals.png new file mode 100644 index 000000000..2f041b926 Binary files /dev/null and b/Assets/Plugins/AllIn1SpriteShader/Demo/Textures/coals.png differ diff --git a/Assets/Plugins/AllIn1SpriteShader/Demo/Textures/coals.png.meta b/Assets/Plugins/AllIn1SpriteShader/Demo/Textures/coals.png.meta new file mode 100644 index 000000000..f982746eb --- /dev/null +++ b/Assets/Plugins/AllIn1SpriteShader/Demo/Textures/coals.png.meta @@ -0,0 +1,130 @@ +fileFormatVersion: 2 +guid: be304275dbf36014ca9828884588ac47 +TextureImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 10 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + sRGBTexture: 1 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: -1 + aniso: -1 + mipBias: -100 + wrapU: 0 + wrapV: 0 + wrapW: 0 + nPOTScale: 0 + lightmap: 0 + compressionQuality: 50 + spriteMode: 1 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 100 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 + alphaIsTransparency: 1 + spriteTessellationDetail: -1 + textureType: 8 + textureShape: 1 + singleChannelComponent: 0 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + platformSettings: + - serializedVersion: 2 + buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + - serializedVersion: 2 + buildTarget: Standalone + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + - serializedVersion: 2 + buildTarget: Android + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + - serializedVersion: 2 + buildTarget: WebGL + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: d8ea15f629e486e4f8c115ff7f00f1b4 + internalID: 0 + vertices: [] + indices: + edges: [] + weights: [] + secondaryTextures: [] + spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 156513 + packageName: All In 1 Sprite Shader + packageVersion: 4.25 + assetPath: Assets/Plugins/AllIn1SpriteShader/Demo/Textures/coals.png + uploadId: 708810 diff --git a/Assets/Plugins/AllIn1SpriteShader/Demo/Textures/coalsEmissive.png b/Assets/Plugins/AllIn1SpriteShader/Demo/Textures/coalsEmissive.png new file mode 100644 index 000000000..9657e9efd Binary files /dev/null and b/Assets/Plugins/AllIn1SpriteShader/Demo/Textures/coalsEmissive.png differ diff --git a/Assets/Plugins/AllIn1SpriteShader/Demo/Textures/coalsEmissive.png.meta b/Assets/Plugins/AllIn1SpriteShader/Demo/Textures/coalsEmissive.png.meta new file mode 100644 index 000000000..2db841e95 --- /dev/null +++ b/Assets/Plugins/AllIn1SpriteShader/Demo/Textures/coalsEmissive.png.meta @@ -0,0 +1,130 @@ +fileFormatVersion: 2 +guid: 487cb2374bc49b848a1f4577212201cc +TextureImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 10 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + sRGBTexture: 1 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: -1 + aniso: -1 + mipBias: -100 + wrapU: 0 + wrapV: 0 + wrapW: 0 + nPOTScale: 0 + lightmap: 0 + compressionQuality: 50 + spriteMode: 1 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 100 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 + alphaIsTransparency: 1 + spriteTessellationDetail: -1 + textureType: 8 + textureShape: 1 + singleChannelComponent: 0 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + platformSettings: + - serializedVersion: 2 + buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + - serializedVersion: 2 + buildTarget: Standalone + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + - serializedVersion: 2 + buildTarget: Android + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + - serializedVersion: 2 + buildTarget: WebGL + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: bfb7e5498e23b9d418474e1af6babf32 + internalID: 0 + vertices: [] + indices: + edges: [] + weights: [] + secondaryTextures: [] + spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 156513 + packageName: All In 1 Sprite Shader + packageVersion: 4.25 + assetPath: Assets/Plugins/AllIn1SpriteShader/Demo/Textures/coalsEmissive.png + uploadId: 708810 diff --git a/Assets/Plugins/AllIn1SpriteShader/Demo/Textures/flag.png b/Assets/Plugins/AllIn1SpriteShader/Demo/Textures/flag.png new file mode 100644 index 000000000..050a00183 Binary files /dev/null and b/Assets/Plugins/AllIn1SpriteShader/Demo/Textures/flag.png differ diff --git a/Assets/Plugins/AllIn1SpriteShader/Demo/Textures/flag.png.meta b/Assets/Plugins/AllIn1SpriteShader/Demo/Textures/flag.png.meta new file mode 100644 index 000000000..610b68685 --- /dev/null +++ b/Assets/Plugins/AllIn1SpriteShader/Demo/Textures/flag.png.meta @@ -0,0 +1,204 @@ +fileFormatVersion: 2 +guid: adce45105552071409c959137cb5b670 +TextureImporter: + internalIDToNameTable: + - first: + 213: 21300000 + second: flag_0 + - first: + 213: 21300002 + second: flag_1 + externalObjects: {} + serializedVersion: 12 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + sRGBTexture: 1 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + vTOnly: 0 + ignoreMasterTextureLimit: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: 1 + aniso: 1 + mipBias: 0 + wrapU: 1 + wrapV: 1 + wrapW: 1 + nPOTScale: 0 + lightmap: 0 + compressionQuality: 50 + spriteMode: 2 + spriteExtrude: 1 + spriteMeshType: 0 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 50 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 + alphaIsTransparency: 1 + spriteTessellationDetail: -1 + textureType: 8 + textureShape: 1 + singleChannelComponent: 0 + flipbookRows: 1 + flipbookColumns: 1 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + ignorePngGamma: 0 + applyGammaDecoding: 1 + cookieLightType: 1 + platformSettings: + - serializedVersion: 3 + buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 1 + - serializedVersion: 3 + buildTarget: Standalone + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 1 + - serializedVersion: 3 + buildTarget: iPhone + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 1 + - serializedVersion: 3 + buildTarget: Android + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 1 + - serializedVersion: 3 + buildTarget: WebGL + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 1 + spriteSheet: + serializedVersion: 2 + sprites: + - serializedVersion: 2 + name: flag_0 + rect: + serializedVersion: 2 + x: 0 + y: 0 + width: 63 + height: 217 + alignment: 0 + pivot: {x: 0, y: 0} + border: {x: 0, y: 0, z: 0, w: 0} + outline: [] + physicsShape: [] + tessellationDetail: 0 + bones: [] + spriteID: 02305410000000000800000000000000 + internalID: 21300000 + vertices: [] + indices: + edges: [] + weights: [] + - serializedVersion: 2 + name: flag_1 + rect: + serializedVersion: 2 + x: 94 + y: 103 + width: 109 + height: 88 + alignment: 0 + pivot: {x: 0, y: 0} + border: {x: 0, y: 0, z: 0, w: 0} + outline: [] + physicsShape: [] + tessellationDetail: 0 + bones: [] + spriteID: 22305410000000000800000000000000 + internalID: 21300002 + vertices: [] + indices: + edges: [] + weights: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: + internalID: 0 + vertices: [] + indices: + edges: [] + weights: [] + secondaryTextures: [] + nameFileIdTable: + flag_0: 21300000 + flag_1: 21300002 + spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 156513 + packageName: All In 1 Sprite Shader + packageVersion: 4.25 + assetPath: Assets/Plugins/AllIn1SpriteShader/Demo/Textures/flag.png + uploadId: 708810 diff --git a/Assets/Plugins/AllIn1SpriteShader/Demo/Textures/flameShape.png b/Assets/Plugins/AllIn1SpriteShader/Demo/Textures/flameShape.png new file mode 100644 index 000000000..ede75d012 Binary files /dev/null and b/Assets/Plugins/AllIn1SpriteShader/Demo/Textures/flameShape.png differ diff --git a/Assets/Plugins/AllIn1SpriteShader/Demo/Textures/flameShape.png.meta b/Assets/Plugins/AllIn1SpriteShader/Demo/Textures/flameShape.png.meta new file mode 100644 index 000000000..b1ad8cfd2 --- /dev/null +++ b/Assets/Plugins/AllIn1SpriteShader/Demo/Textures/flameShape.png.meta @@ -0,0 +1,130 @@ +fileFormatVersion: 2 +guid: bd6f48b4407043345b1a3a07df8c4d61 +TextureImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 10 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + sRGBTexture: 1 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: -1 + aniso: -1 + mipBias: -100 + wrapU: 0 + wrapV: 0 + wrapW: 0 + nPOTScale: 0 + lightmap: 0 + compressionQuality: 50 + spriteMode: 1 + spriteExtrude: 1 + spriteMeshType: 0 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 100 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 + alphaIsTransparency: 1 + spriteTessellationDetail: -1 + textureType: 8 + textureShape: 1 + singleChannelComponent: 0 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + platformSettings: + - serializedVersion: 2 + buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + - serializedVersion: 2 + buildTarget: Standalone + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + - serializedVersion: 2 + buildTarget: Android + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + - serializedVersion: 2 + buildTarget: WebGL + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: fbcc62d8a76faef47aa92538608d3b3a + internalID: 0 + vertices: [] + indices: + edges: [] + weights: [] + secondaryTextures: [] + spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 156513 + packageName: All In 1 Sprite Shader + packageVersion: 4.25 + assetPath: Assets/Plugins/AllIn1SpriteShader/Demo/Textures/flameShape.png + uploadId: 708810 diff --git a/Assets/Plugins/AllIn1SpriteShader/Demo/Textures/grass.png b/Assets/Plugins/AllIn1SpriteShader/Demo/Textures/grass.png new file mode 100644 index 000000000..0551124f9 Binary files /dev/null and b/Assets/Plugins/AllIn1SpriteShader/Demo/Textures/grass.png differ diff --git a/Assets/Plugins/AllIn1SpriteShader/Demo/Textures/grass.png.meta b/Assets/Plugins/AllIn1SpriteShader/Demo/Textures/grass.png.meta new file mode 100644 index 000000000..733f34a0b --- /dev/null +++ b/Assets/Plugins/AllIn1SpriteShader/Demo/Textures/grass.png.meta @@ -0,0 +1,141 @@ +fileFormatVersion: 2 +guid: cf7e1f6ebb800154db2b215cba9330ee +TextureImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 10 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + sRGBTexture: 1 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: -1 + aniso: -1 + mipBias: -100 + wrapU: 0 + wrapV: 0 + wrapW: 0 + nPOTScale: 0 + lightmap: 0 + compressionQuality: 50 + spriteMode: 1 + spriteExtrude: 1 + spriteMeshType: 0 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 100 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 + alphaIsTransparency: 1 + spriteTessellationDetail: -1 + textureType: 8 + textureShape: 1 + singleChannelComponent: 0 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + platformSettings: + - serializedVersion: 2 + buildTarget: DefaultTexturePlatform + maxTextureSize: 4096 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 0 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + - serializedVersion: 2 + buildTarget: Standalone + maxTextureSize: 4096 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 0 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + - serializedVersion: 2 + buildTarget: iPhone + maxTextureSize: 4096 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 0 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + - serializedVersion: 2 + buildTarget: Android + maxTextureSize: 4096 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 0 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + - serializedVersion: 2 + buildTarget: WebGL + maxTextureSize: 4096 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 0 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: a7ab056890d43d6478c408756e97f7cf + internalID: 0 + vertices: [] + indices: + edges: [] + weights: [] + secondaryTextures: [] + spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 156513 + packageName: All In 1 Sprite Shader + packageVersion: 4.25 + assetPath: Assets/Plugins/AllIn1SpriteShader/Demo/Textures/grass.png + uploadId: 708810 diff --git a/Assets/Plugins/AllIn1SpriteShader/Demo/Textures/shield.png b/Assets/Plugins/AllIn1SpriteShader/Demo/Textures/shield.png new file mode 100644 index 000000000..385c3b5e1 Binary files /dev/null and b/Assets/Plugins/AllIn1SpriteShader/Demo/Textures/shield.png differ diff --git a/Assets/Plugins/AllIn1SpriteShader/Demo/Textures/shield.png.meta b/Assets/Plugins/AllIn1SpriteShader/Demo/Textures/shield.png.meta new file mode 100644 index 000000000..4a90a007d --- /dev/null +++ b/Assets/Plugins/AllIn1SpriteShader/Demo/Textures/shield.png.meta @@ -0,0 +1,130 @@ +fileFormatVersion: 2 +guid: 2f5c9cbfde2d0384bb53189b0d0f06d8 +TextureImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 10 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + sRGBTexture: 1 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: -1 + aniso: -1 + mipBias: -100 + wrapU: 0 + wrapV: 0 + wrapW: 0 + nPOTScale: 0 + lightmap: 0 + compressionQuality: 50 + spriteMode: 1 + spriteExtrude: 1 + spriteMeshType: 0 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 100 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 + alphaIsTransparency: 1 + spriteTessellationDetail: -1 + textureType: 8 + textureShape: 1 + singleChannelComponent: 0 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + platformSettings: + - serializedVersion: 2 + buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + - serializedVersion: 2 + buildTarget: Standalone + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + - serializedVersion: 2 + buildTarget: Android + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + - serializedVersion: 2 + buildTarget: WebGL + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: 7f8abd90ff7053b4cabb4381c9c4ebe7 + internalID: 0 + vertices: [] + indices: + edges: [] + weights: [] + secondaryTextures: [] + spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 156513 + packageName: All In 1 Sprite Shader + packageVersion: 4.25 + assetPath: Assets/Plugins/AllIn1SpriteShader/Demo/Textures/shield.png + uploadId: 708810 diff --git a/Assets/Plugins/AllIn1SpriteShader/Demo/Textures/shieldGlow.png b/Assets/Plugins/AllIn1SpriteShader/Demo/Textures/shieldGlow.png new file mode 100644 index 000000000..5610b57ec Binary files /dev/null and b/Assets/Plugins/AllIn1SpriteShader/Demo/Textures/shieldGlow.png differ diff --git a/Assets/Plugins/AllIn1SpriteShader/Demo/Textures/shieldGlow.png.meta b/Assets/Plugins/AllIn1SpriteShader/Demo/Textures/shieldGlow.png.meta new file mode 100644 index 000000000..c7e112f22 --- /dev/null +++ b/Assets/Plugins/AllIn1SpriteShader/Demo/Textures/shieldGlow.png.meta @@ -0,0 +1,130 @@ +fileFormatVersion: 2 +guid: 81687001a52d8024fb3706ba7619ad4b +TextureImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 10 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + sRGBTexture: 1 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: -1 + aniso: -1 + mipBias: -100 + wrapU: 0 + wrapV: 0 + wrapW: 0 + nPOTScale: 0 + lightmap: 0 + compressionQuality: 50 + spriteMode: 1 + spriteExtrude: 1 + spriteMeshType: 0 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 100 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 + alphaIsTransparency: 1 + spriteTessellationDetail: -1 + textureType: 8 + textureShape: 1 + singleChannelComponent: 0 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + platformSettings: + - serializedVersion: 2 + buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + - serializedVersion: 2 + buildTarget: Standalone + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + - serializedVersion: 2 + buildTarget: Android + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + - serializedVersion: 2 + buildTarget: WebGL + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: 09f38e087cda7674aadf332d14971ac4 + internalID: 0 + vertices: [] + indices: + edges: [] + weights: [] + secondaryTextures: [] + spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 156513 + packageName: All In 1 Sprite Shader + packageVersion: 4.25 + assetPath: Assets/Plugins/AllIn1SpriteShader/Demo/Textures/shieldGlow.png + uploadId: 708810 diff --git a/Assets/Plugins/AllIn1SpriteShader/Demo/Textures/snowFlake.png b/Assets/Plugins/AllIn1SpriteShader/Demo/Textures/snowFlake.png new file mode 100644 index 000000000..7d8449907 Binary files /dev/null and b/Assets/Plugins/AllIn1SpriteShader/Demo/Textures/snowFlake.png differ diff --git a/Assets/Plugins/AllIn1SpriteShader/Demo/Textures/snowFlake.png.meta b/Assets/Plugins/AllIn1SpriteShader/Demo/Textures/snowFlake.png.meta new file mode 100644 index 000000000..e697b6c83 --- /dev/null +++ b/Assets/Plugins/AllIn1SpriteShader/Demo/Textures/snowFlake.png.meta @@ -0,0 +1,97 @@ +fileFormatVersion: 2 +guid: ab4465ab72ca5544da8e8dd1110b6973 +TextureImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 10 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + sRGBTexture: 1 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: -1 + aniso: -1 + mipBias: -100 + wrapU: 1 + wrapV: 1 + wrapW: 1 + nPOTScale: 0 + lightmap: 0 + compressionQuality: 50 + spriteMode: 1 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 100 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 + alphaIsTransparency: 1 + spriteTessellationDetail: -1 + textureType: 8 + textureShape: 1 + singleChannelComponent: 0 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + platformSettings: + - serializedVersion: 2 + buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: e56be7ecdc13c4f4eb4bb8416c9ae7f7 + internalID: 0 + vertices: [] + indices: + edges: [] + weights: [] + secondaryTextures: [] + spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 156513 + packageName: All In 1 Sprite Shader + packageVersion: 4.25 + assetPath: Assets/Plugins/AllIn1SpriteShader/Demo/Textures/snowFlake.png + uploadId: 708810 diff --git a/Assets/Plugins/AllIn1SpriteShader/Demo/Textures/spaceSoldier.png b/Assets/Plugins/AllIn1SpriteShader/Demo/Textures/spaceSoldier.png new file mode 100644 index 000000000..90f68b6e0 Binary files /dev/null and b/Assets/Plugins/AllIn1SpriteShader/Demo/Textures/spaceSoldier.png differ diff --git a/Assets/Plugins/AllIn1SpriteShader/Demo/Textures/spaceSoldier.png.meta b/Assets/Plugins/AllIn1SpriteShader/Demo/Textures/spaceSoldier.png.meta new file mode 100644 index 000000000..275fae230 --- /dev/null +++ b/Assets/Plugins/AllIn1SpriteShader/Demo/Textures/spaceSoldier.png.meta @@ -0,0 +1,176 @@ +fileFormatVersion: 2 +guid: 519dafacd208bb64c83d5124be03b09d +TextureImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 12 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + sRGBTexture: 1 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 1 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + vTOnly: 0 + ignoreMasterTextureLimit: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: 1 + aniso: 1 + mipBias: 0 + wrapU: 0 + wrapV: 0 + wrapW: 0 + nPOTScale: 0 + lightmap: 0 + compressionQuality: 50 + spriteMode: 1 + spriteExtrude: 1 + spriteMeshType: 0 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 100 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 + alphaIsTransparency: 1 + spriteTessellationDetail: -1 + textureType: 8 + textureShape: 1 + singleChannelComponent: 0 + flipbookRows: 1 + flipbookColumns: 1 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + ignorePngGamma: 0 + applyGammaDecoding: 1 + cookieLightType: 1 + platformSettings: + - serializedVersion: 3 + buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 1 + - serializedVersion: 3 + buildTarget: Standalone + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 1 + - serializedVersion: 3 + buildTarget: iPhone + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 1 + - serializedVersion: 3 + buildTarget: Android + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 1 + - serializedVersion: 3 + buildTarget: WebGL + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 1 + spriteSheet: + serializedVersion: 2 + sprites: + - serializedVersion: 2 + name: spaceSoldier_0 + rect: + serializedVersion: 2 + x: 90 + y: 78 + width: 343 + height: 365 + alignment: 0 + pivot: {x: 0, y: 0} + border: {x: 0, y: 0, z: 0, w: 0} + outline: [] + physicsShape: [] + tessellationDetail: 0 + bones: [] + spriteID: 3ff258c9fcbbf944588103ed4f2d80bc + internalID: -7390147391288916661 + vertices: [] + indices: + edges: [] + weights: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: 7a4cf885a6f9c7248896d6d365331dbf + internalID: 0 + vertices: [] + indices: + edges: [] + weights: [] + secondaryTextures: [] + nameFileIdTable: + spaceSoldier_0: -7390147391288916661 + spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 156513 + packageName: All In 1 Sprite Shader + packageVersion: 4.25 + assetPath: Assets/Plugins/AllIn1SpriteShader/Demo/Textures/spaceSoldier.png + uploadId: 708810 diff --git a/Assets/Plugins/AllIn1SpriteShader/Demo/Textures/spaceSoldierColorSwap.png b/Assets/Plugins/AllIn1SpriteShader/Demo/Textures/spaceSoldierColorSwap.png new file mode 100644 index 000000000..596e35afd Binary files /dev/null and b/Assets/Plugins/AllIn1SpriteShader/Demo/Textures/spaceSoldierColorSwap.png differ diff --git a/Assets/Plugins/AllIn1SpriteShader/Demo/Textures/spaceSoldierColorSwap.png.meta b/Assets/Plugins/AllIn1SpriteShader/Demo/Textures/spaceSoldierColorSwap.png.meta new file mode 100644 index 000000000..5a18c0494 --- /dev/null +++ b/Assets/Plugins/AllIn1SpriteShader/Demo/Textures/spaceSoldierColorSwap.png.meta @@ -0,0 +1,141 @@ +fileFormatVersion: 2 +guid: 065da6c7b90ca904dab9cbc6b415fd19 +TextureImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 10 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + sRGBTexture: 1 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: -1 + aniso: -1 + mipBias: -100 + wrapU: 0 + wrapV: 0 + wrapW: 0 + nPOTScale: 0 + lightmap: 0 + compressionQuality: 50 + spriteMode: 1 + spriteExtrude: 1 + spriteMeshType: 0 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 100 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 + alphaIsTransparency: 1 + spriteTessellationDetail: -1 + textureType: 8 + textureShape: 1 + singleChannelComponent: 0 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + platformSettings: + - serializedVersion: 2 + buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + - serializedVersion: 2 + buildTarget: Standalone + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + - serializedVersion: 2 + buildTarget: iPhone + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + - serializedVersion: 2 + buildTarget: Android + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + - serializedVersion: 2 + buildTarget: WebGL + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: 481e92f540418f34584627b3c56549ce + internalID: 0 + vertices: [] + indices: + edges: [] + weights: [] + secondaryTextures: [] + spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 156513 + packageName: All In 1 Sprite Shader + packageVersion: 4.25 + assetPath: Assets/Plugins/AllIn1SpriteShader/Demo/Textures/spaceSoldierColorSwap.png + uploadId: 708810 diff --git a/Assets/Plugins/AllIn1SpriteShader/Demo/Textures/spaceSoldierGlow.png b/Assets/Plugins/AllIn1SpriteShader/Demo/Textures/spaceSoldierGlow.png new file mode 100644 index 000000000..491624c17 Binary files /dev/null and b/Assets/Plugins/AllIn1SpriteShader/Demo/Textures/spaceSoldierGlow.png differ diff --git a/Assets/Plugins/AllIn1SpriteShader/Demo/Textures/spaceSoldierGlow.png.meta b/Assets/Plugins/AllIn1SpriteShader/Demo/Textures/spaceSoldierGlow.png.meta new file mode 100644 index 000000000..b7e49d794 --- /dev/null +++ b/Assets/Plugins/AllIn1SpriteShader/Demo/Textures/spaceSoldierGlow.png.meta @@ -0,0 +1,141 @@ +fileFormatVersion: 2 +guid: 8608ef90f91271745a17f7210fe1e7db +TextureImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 10 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + sRGBTexture: 1 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: 0 + aniso: -1 + mipBias: -100 + wrapU: 0 + wrapV: 0 + wrapW: 0 + nPOTScale: 0 + lightmap: 0 + compressionQuality: 50 + spriteMode: 1 + spriteExtrude: 1 + spriteMeshType: 0 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 100 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 + alphaIsTransparency: 1 + spriteTessellationDetail: -1 + textureType: 8 + textureShape: 1 + singleChannelComponent: 0 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + platformSettings: + - serializedVersion: 2 + buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + - serializedVersion: 2 + buildTarget: Standalone + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + - serializedVersion: 2 + buildTarget: iPhone + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + - serializedVersion: 2 + buildTarget: Android + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + - serializedVersion: 2 + buildTarget: WebGL + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: 4d8dce05bf843a6418e48e1088ee3234 + internalID: 0 + vertices: [] + indices: + edges: [] + weights: [] + secondaryTextures: [] + spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 156513 + packageName: All In 1 Sprite Shader + packageVersion: 4.25 + assetPath: Assets/Plugins/AllIn1SpriteShader/Demo/Textures/spaceSoldierGlow.png + uploadId: 708810 diff --git a/Assets/Plugins/AllIn1SpriteShader/Demo/Textures/spaceSoldierHelmetTopMask.png b/Assets/Plugins/AllIn1SpriteShader/Demo/Textures/spaceSoldierHelmetTopMask.png new file mode 100644 index 000000000..e067a6f0b Binary files /dev/null and b/Assets/Plugins/AllIn1SpriteShader/Demo/Textures/spaceSoldierHelmetTopMask.png differ diff --git a/Assets/Plugins/AllIn1SpriteShader/Demo/Textures/spaceSoldierHelmetTopMask.png.meta b/Assets/Plugins/AllIn1SpriteShader/Demo/Textures/spaceSoldierHelmetTopMask.png.meta new file mode 100644 index 000000000..d7e7489ff --- /dev/null +++ b/Assets/Plugins/AllIn1SpriteShader/Demo/Textures/spaceSoldierHelmetTopMask.png.meta @@ -0,0 +1,97 @@ +fileFormatVersion: 2 +guid: 3d311990b7c2c59478bacea537a60a53 +TextureImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 10 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + sRGBTexture: 1 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: -1 + aniso: -1 + mipBias: -100 + wrapU: 1 + wrapV: 1 + wrapW: 1 + nPOTScale: 0 + lightmap: 0 + compressionQuality: 50 + spriteMode: 1 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 100 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 + alphaIsTransparency: 1 + spriteTessellationDetail: -1 + textureType: 8 + textureShape: 1 + singleChannelComponent: 0 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + platformSettings: + - serializedVersion: 2 + buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: f3d4f7c1ae047ba4b94a0e777a486bab + internalID: 0 + vertices: [] + indices: + edges: [] + weights: [] + secondaryTextures: [] + spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 156513 + packageName: All In 1 Sprite Shader + packageVersion: 4.25 + assetPath: Assets/Plugins/AllIn1SpriteShader/Demo/Textures/spaceSoldierHelmetTopMask.png + uploadId: 708810 diff --git a/Assets/Plugins/AllIn1SpriteShader/Demo/Textures/spaceSoldierNormal.png b/Assets/Plugins/AllIn1SpriteShader/Demo/Textures/spaceSoldierNormal.png new file mode 100644 index 000000000..12292a676 Binary files /dev/null and b/Assets/Plugins/AllIn1SpriteShader/Demo/Textures/spaceSoldierNormal.png differ diff --git a/Assets/Plugins/AllIn1SpriteShader/Demo/Textures/spaceSoldierNormal.png.meta b/Assets/Plugins/AllIn1SpriteShader/Demo/Textures/spaceSoldierNormal.png.meta new file mode 100644 index 000000000..dbbff6c89 --- /dev/null +++ b/Assets/Plugins/AllIn1SpriteShader/Demo/Textures/spaceSoldierNormal.png.meta @@ -0,0 +1,119 @@ +fileFormatVersion: 2 +guid: 994e4deee74379d4c83bcf0f27585f73 +TextureImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 10 + mipmaps: + mipMapMode: 0 + enableMipMap: 1 + sRGBTexture: 0 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: -1 + aniso: -1 + mipBias: -100 + wrapU: 1 + wrapV: 1 + wrapW: 1 + nPOTScale: 0 + lightmap: 0 + compressionQuality: 50 + spriteMode: 1 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 100 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 + alphaIsTransparency: 0 + spriteTessellationDetail: -1 + textureType: 1 + textureShape: 1 + singleChannelComponent: 0 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + platformSettings: + - serializedVersion: 2 + buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + - serializedVersion: 2 + buildTarget: Standalone + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + - serializedVersion: 2 + buildTarget: WebGL + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: 1483eb4f6241cec44b70c2198a1733c7 + internalID: 0 + vertices: [] + indices: + edges: [] + weights: [] + secondaryTextures: [] + spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 156513 + packageName: All In 1 Sprite Shader + packageVersion: 4.25 + assetPath: Assets/Plugins/AllIn1SpriteShader/Demo/Textures/spaceSoldierNormal.png + uploadId: 708810 diff --git a/Assets/Plugins/AllIn1SpriteShader/Demo/Textures/spark.png b/Assets/Plugins/AllIn1SpriteShader/Demo/Textures/spark.png new file mode 100644 index 000000000..ae4c5acd6 Binary files /dev/null and b/Assets/Plugins/AllIn1SpriteShader/Demo/Textures/spark.png differ diff --git a/Assets/Plugins/AllIn1SpriteShader/Demo/Textures/spark.png.meta b/Assets/Plugins/AllIn1SpriteShader/Demo/Textures/spark.png.meta new file mode 100644 index 000000000..6f9590615 --- /dev/null +++ b/Assets/Plugins/AllIn1SpriteShader/Demo/Textures/spark.png.meta @@ -0,0 +1,97 @@ +fileFormatVersion: 2 +guid: 48bde3d73ebadd04783e0c4cb7276007 +TextureImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 10 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + sRGBTexture: 1 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: -1 + aniso: -1 + mipBias: -100 + wrapU: 1 + wrapV: 1 + wrapW: 1 + nPOTScale: 0 + lightmap: 0 + compressionQuality: 50 + spriteMode: 1 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 100 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 + alphaIsTransparency: 1 + spriteTessellationDetail: -1 + textureType: 8 + textureShape: 1 + singleChannelComponent: 0 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + platformSettings: + - serializedVersion: 2 + buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: 1d800d516dfd14b47a3e68d573c77319 + internalID: 0 + vertices: [] + indices: + edges: [] + weights: [] + secondaryTextures: [] + spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 156513 + packageName: All In 1 Sprite Shader + packageVersion: 4.25 + assetPath: Assets/Plugins/AllIn1SpriteShader/Demo/Textures/spark.png + uploadId: 708810 diff --git a/Assets/Plugins/AllIn1SpriteShader/Demo/Textures/splotch.png b/Assets/Plugins/AllIn1SpriteShader/Demo/Textures/splotch.png new file mode 100644 index 000000000..9d3ac45fe Binary files /dev/null and b/Assets/Plugins/AllIn1SpriteShader/Demo/Textures/splotch.png differ diff --git a/Assets/Plugins/AllIn1SpriteShader/Demo/Textures/splotch.png.meta b/Assets/Plugins/AllIn1SpriteShader/Demo/Textures/splotch.png.meta new file mode 100644 index 000000000..c429a75a3 --- /dev/null +++ b/Assets/Plugins/AllIn1SpriteShader/Demo/Textures/splotch.png.meta @@ -0,0 +1,97 @@ +fileFormatVersion: 2 +guid: 51caeab4d98b55046a9013cc2da7e427 +TextureImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 10 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + sRGBTexture: 1 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: -1 + aniso: -1 + mipBias: -100 + wrapU: 1 + wrapV: 1 + wrapW: 1 + nPOTScale: 0 + lightmap: 0 + compressionQuality: 50 + spriteMode: 1 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 100 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 + alphaIsTransparency: 1 + spriteTessellationDetail: -1 + textureType: 8 + textureShape: 1 + singleChannelComponent: 0 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + platformSettings: + - serializedVersion: 2 + buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: 107ae09ce492f7745be900c7e931a59d + internalID: 0 + vertices: [] + indices: + edges: [] + weights: [] + secondaryTextures: [] + spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 156513 + packageName: All In 1 Sprite Shader + packageVersion: 4.25 + assetPath: Assets/Plugins/AllIn1SpriteShader/Demo/Textures/splotch.png + uploadId: 708810 diff --git a/Assets/Plugins/AllIn1SpriteShader/Demo/Textures/sunDoodle.png b/Assets/Plugins/AllIn1SpriteShader/Demo/Textures/sunDoodle.png new file mode 100644 index 000000000..dd97caf0f Binary files /dev/null and b/Assets/Plugins/AllIn1SpriteShader/Demo/Textures/sunDoodle.png differ diff --git a/Assets/Plugins/AllIn1SpriteShader/Demo/Textures/sunDoodle.png.meta b/Assets/Plugins/AllIn1SpriteShader/Demo/Textures/sunDoodle.png.meta new file mode 100644 index 000000000..f622b4b6b --- /dev/null +++ b/Assets/Plugins/AllIn1SpriteShader/Demo/Textures/sunDoodle.png.meta @@ -0,0 +1,130 @@ +fileFormatVersion: 2 +guid: 73d3cc63327012249b4f98eb9289311d +TextureImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 10 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + sRGBTexture: 1 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: -1 + aniso: -1 + mipBias: -100 + wrapU: 1 + wrapV: 1 + wrapW: 1 + nPOTScale: 0 + lightmap: 0 + compressionQuality: 50 + spriteMode: 1 + spriteExtrude: 1 + spriteMeshType: 0 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 100 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 + alphaIsTransparency: 1 + spriteTessellationDetail: -1 + textureType: 8 + textureShape: 1 + singleChannelComponent: 0 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + platformSettings: + - serializedVersion: 2 + buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + - serializedVersion: 2 + buildTarget: Standalone + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + - serializedVersion: 2 + buildTarget: Android + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + - serializedVersion: 2 + buildTarget: WebGL + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: 8332df90c7094ac47862f6375f5366fe + internalID: 0 + vertices: [] + indices: + edges: [] + weights: [] + secondaryTextures: [] + spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 156513 + packageName: All In 1 Sprite Shader + packageVersion: 4.25 + assetPath: Assets/Plugins/AllIn1SpriteShader/Demo/Textures/sunDoodle.png + uploadId: 708810 diff --git a/Assets/Plugins/AllIn1SpriteShader/Demo/Textures/water.png b/Assets/Plugins/AllIn1SpriteShader/Demo/Textures/water.png new file mode 100644 index 000000000..d7cbe5fb6 Binary files /dev/null and b/Assets/Plugins/AllIn1SpriteShader/Demo/Textures/water.png differ diff --git a/Assets/Plugins/AllIn1SpriteShader/Demo/Textures/water.png.meta b/Assets/Plugins/AllIn1SpriteShader/Demo/Textures/water.png.meta new file mode 100644 index 000000000..bd7fcfbb3 --- /dev/null +++ b/Assets/Plugins/AllIn1SpriteShader/Demo/Textures/water.png.meta @@ -0,0 +1,141 @@ +fileFormatVersion: 2 +guid: bd3249e8aae01e748aaca0c062e2c19c +TextureImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 10 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + sRGBTexture: 1 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: -1 + aniso: -1 + mipBias: -100 + wrapU: 0 + wrapV: 0 + wrapW: 0 + nPOTScale: 0 + lightmap: 0 + compressionQuality: 50 + spriteMode: 1 + spriteExtrude: 1 + spriteMeshType: 0 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 100 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 + alphaIsTransparency: 1 + spriteTessellationDetail: -1 + textureType: 8 + textureShape: 1 + singleChannelComponent: 0 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + platformSettings: + - serializedVersion: 2 + buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + - serializedVersion: 2 + buildTarget: Standalone + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + - serializedVersion: 2 + buildTarget: iPhone + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + - serializedVersion: 2 + buildTarget: Android + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + - serializedVersion: 2 + buildTarget: WebGL + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: 119475dc3468b4a47b838a35c5bfa22b + internalID: 0 + vertices: [] + indices: + edges: [] + weights: [] + secondaryTextures: [] + spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 156513 + packageName: All In 1 Sprite Shader + packageVersion: 4.25 + assetPath: Assets/Plugins/AllIn1SpriteShader/Demo/Textures/water.png + uploadId: 708810 diff --git a/Assets/Plugins/AllIn1SpriteShader/Documentation.pdf b/Assets/Plugins/AllIn1SpriteShader/Documentation.pdf new file mode 100644 index 000000000..26c564c5f Binary files /dev/null and b/Assets/Plugins/AllIn1SpriteShader/Documentation.pdf differ diff --git a/Assets/Plugins/AllIn1SpriteShader/Documentation.pdf.meta b/Assets/Plugins/AllIn1SpriteShader/Documentation.pdf.meta new file mode 100644 index 000000000..4d8729942 --- /dev/null +++ b/Assets/Plugins/AllIn1SpriteShader/Documentation.pdf.meta @@ -0,0 +1,14 @@ +fileFormatVersion: 2 +guid: 593198a96eec1d74c8549e7b54168503 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 156513 + packageName: All In 1 Sprite Shader + packageVersion: 4.25 + assetPath: Assets/Plugins/AllIn1SpriteShader/Documentation.pdf + uploadId: 708810 diff --git a/Assets/Plugins/AllIn1SpriteShader/Materials.meta b/Assets/Plugins/AllIn1SpriteShader/Materials.meta new file mode 100644 index 000000000..2637c87c3 --- /dev/null +++ b/Assets/Plugins/AllIn1SpriteShader/Materials.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 345f2705e87e7424683ef2bd17d38c26 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/AllIn1SpriteShader/Materials/EmptyMaterial.mat b/Assets/Plugins/AllIn1SpriteShader/Materials/EmptyMaterial.mat new file mode 100644 index 000000000..6b63a79dd --- /dev/null +++ b/Assets/Plugins/AllIn1SpriteShader/Materials/EmptyMaterial.mat @@ -0,0 +1,178 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!21 &2100000 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: EmptyMaterial + m_Shader: {fileID: 4800000, guid: a36b7719ff0465b42ab1407d67672c5f, type: 3} + m_ShaderKeywords: ETC1_EXTERNAL_ALPHA + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _ColorRampTex: + m_Texture: {fileID: 2800000, guid: 279657edc397ece4b8029c727adf6ddc, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ColorSwapTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DistortTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _FadeBurnTex: + m_Texture: {fileID: 2800000, guid: 32e8df0008bebe746b1681a71c61f31c, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _FadeTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _GlowTex: + 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} + - _OutlineDistortTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OutlineTex: + m_Texture: {fileID: 2800000, guid: 74087f6d03f233e4a8a142fa01f9e5cf, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - _Alpha: 1 + - _AlphaCutoffValue: 0.25 + - _BlurHD: 0 + - _BlurIntensity: 10 + - _ChromAberrAlpha: 0.4 + - _ChromAberrAmount: 1 + - _ClipUvDown: 1 + - _ClipUvLeft: 1 + - _ClipUvRight: 1 + - _ClipUvUp: 1 + - _ColorChangeLuminosity: 0 + - _ColorChangeTolerance: 0.25 + - _ColorRampLuminosity: 0 + - _ColorRampOutline: 0 + - _ColorSwapBlueLuminosity: 0.5 + - _ColorSwapGreenLuminosity: 0.5 + - _ColorSwapRedLuminosity: 0.5 + - _DistortAmount: 0.5 + - _DistortTexXSpeed: 5 + - _DistortTexYSpeed: 5 + - _FadeAmount: -0.1 + - _FadeBurnGlow: 2 + - _FadeBurnTransition: 0.075 + - _FadeBurnWidth: 0.025 + - _FishEyeUvAmount: 0.35 + - _FlickerAlpha: 0 + - _FlickerFreq: 0.2 + - _FlickerPercent: 0.05 + - _GhostColorBoost: 1 + - _GhostTransparency: 0 + - _GlitchAmount: 3 + - _Glow: 0 + - _GlowTexUsed: 0 + - _GradBlend: 1 + - _GrassManualAnim: 1 + - _GrassManualToggle: 0 + - _GrassSpeed: 2 + - _GrassWind: 20 + - _GreyscaleLuminosity: 0 + - _GreyscaleOutline: 0 + - _HandDrawnAmount: 10 + - _HandDrawnSpeed: 5 + - _HitEffectBlend: 1 + - _HitEffectGlow: 5 + - _HologramFlickerAlpha: 0 + - _HologramFlickerFreq: 0.2 + - _HologramFlickerPercent: 0.05 + - _HologramStripesAlpha: 0.4 + - _HologramStripesAmount: 50 + - _HologramStripesFill: 0.4 + - _HologramStripesLuminosity: 1 + - _HologramStripesSpeed: 5 + - _HsvBright: 1 + - _HsvSaturation: 1 + - _HsvShift: 180 + - _InnerOutlineAlpha: 1 + - _InnerOutlineGlow: 1 + - _InnerOutlineThickness: 1 + - _MotionBlurAngle: 0.1 + - _MotionBlurDist: 1.25 + - _NegativeAmount: 1 + - _OffsetUvX: 0 + - _OffsetUvY: 0 + - _Outline8Directions: 0 + - _OutlineAlpha: 1 + - _OutlineDistortAmount: 0.5 + - _OutlineDistortTexXSpeed: 5 + - _OutlineDistortTexYSpeed: 5 + - _OutlineDistortToggle: 0 + - _OutlineGlow: 1.5 + - _OutlineIsPixel: 0 + - _OutlinePixelWidth: 1 + - _OutlineTexGrey: 0 + - _OutlineTexToggle: 0 + - _OutlineTexXSpeed: 10 + - _OutlineTexYSpeed: 0 + - _OutlineWidth: 0.004 + - _PinchUvAmount: 0.35 + - _PixelateSize: 32 + - _PosterizeGamma: 0.75 + - _PosterizeNumColors: 8 + - _PosterizeOutline: 0 + - _RectSize: 1 + - _RotateUvAmount: 0 + - _ShadowAlpha: 0.5 + - _ShadowX: 0.1 + - _ShadowY: -0.05 + - _ShakeUvSpeed: 2.5 + - _ShakeUvX: 1.5 + - _ShakeUvY: 1 + - _TextureScrollXSpeed: 1 + - _TextureScrollYSpeed: 0 + - _TwistUvAmount: 1 + - _TwistUvPosX: 0.5 + - _TwistUvPosY: 0.5 + - _TwistUvRadius: 0.75 + - _WaveAmount: 7 + - _WaveSpeed: 10 + - _WaveStrength: 7.5 + - _WaveX: 0 + - _WaveY: 0.5 + - _ZoomUvAmount: 0.5 + m_Colors: + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _ColorChangeNewCol: {r: 1, g: 1, b: 0, a: 1} + - _ColorChangeTarget: {r: 1, g: 0, b: 0, a: 1} + - _ColorSwapBlue: {r: 1, g: 1, b: 1, a: 1} + - _ColorSwapGreen: {r: 1, g: 1, b: 1, a: 1} + - _ColorSwapRed: {r: 1, g: 1, b: 1, a: 1} + - _FadeBurnColor: {r: 1, g: 1, b: 0, a: 1} + - _GlowColor: {r: 1, g: 1, b: 1, a: 1} + - _GradBotLeftCol: {r: 0, g: 0, b: 1, a: 1} + - _GradBotRightCol: {r: 0, g: 0, b: 1, a: 1} + - _GradTopLeftCol: {r: 1, g: 0, b: 0, a: 1} + - _GradTopRightCol: {r: 1, g: 0, b: 0, a: 1} + - _GreyscaleTintColor: {r: 1, g: 1, b: 1, a: 1} + - _HitEffectColor: {r: 1, g: 1, b: 1, a: 1} + - _InnerOutlineColor: {r: 1, g: 0, b: 0, a: 1} + - _OutlineColor: {r: 1, g: 1, b: 1, a: 1} + - _ShadowColor: {r: 0, g: 0, b: 0, a: 1} diff --git a/Assets/Plugins/AllIn1SpriteShader/Materials/EmptyMaterial.mat.meta b/Assets/Plugins/AllIn1SpriteShader/Materials/EmptyMaterial.mat.meta new file mode 100644 index 000000000..d3261729f --- /dev/null +++ b/Assets/Plugins/AllIn1SpriteShader/Materials/EmptyMaterial.mat.meta @@ -0,0 +1,15 @@ +fileFormatVersion: 2 +guid: cc460e5b1c6c0bd498b44195a0c3da99 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 2100000 + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 156513 + packageName: All In 1 Sprite Shader + packageVersion: 4.25 + assetPath: Assets/Plugins/AllIn1SpriteShader/Materials/EmptyMaterial.mat + uploadId: 708810 diff --git a/Assets/Plugins/AllIn1SpriteShader/Materials/ScaledTIme.mat b/Assets/Plugins/AllIn1SpriteShader/Materials/ScaledTIme.mat new file mode 100644 index 000000000..5698c93c9 --- /dev/null +++ b/Assets/Plugins/AllIn1SpriteShader/Materials/ScaledTIme.mat @@ -0,0 +1,210 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!21 &2100000 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: ScaledTIme + m_Shader: {fileID: 4800000, guid: f3622b3ac1631ea409b0f5811034f3a9, type: 3} + m_ShaderKeywords: ETC1_EXTERNAL_ALPHA + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _ColorRampTex: + m_Texture: {fileID: 2800000, guid: 279657edc397ece4b8029c727adf6ddc, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ColorSwapTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DistortTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _FadeBurnTex: + m_Texture: {fileID: 2800000, guid: 677cca399782dea41aedc1d292ecb67d, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _FadeTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _GlowTex: + 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} + - _OutlineDistortTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OutlineTex: + m_Texture: {fileID: 2800000, guid: 74087f6d03f233e4a8a142fa01f9e5cf, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ShineMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - _Alpha: 1 + - _AlphaCutoffValue: 0.25 + - _AlphaRoundThreshold: 0.5 + - _BillboardY: 0 + - _BlurHD: 0 + - _BlurIntensity: 10 + - _ChromAberrAlpha: 0.4 + - _ChromAberrAmount: 1 + - _ClipUvDown: 1 + - _ClipUvLeft: 1 + - _ClipUvRight: 1 + - _ClipUvUp: 1 + - _ColorChangeLuminosity: 0 + - _ColorChangeTolerance: 0.25 + - _ColorRampLuminosity: 0 + - _ColorRampOutline: 0 + - _ColorSwapBlueLuminosity: 0.5 + - _ColorSwapGreenLuminosity: 0.5 + - _ColorSwapRedLuminosity: 0.5 + - _DistortAmount: 0.5 + - _DistortTexXSpeed: 5 + - _DistortTexYSpeed: 5 + - _FadeAmount: -0.1 + - _FadeBurnGlow: 2 + - _FadeBurnTransition: 0.075 + - _FadeBurnWidth: 0.025 + - _FishEyeUvAmount: 0.35 + - _FlickerAlpha: 0 + - _FlickerFreq: 0.2 + - _FlickerPercent: 0.05 + - _GhostColorBoost: 1 + - _GhostTransparency: 0 + - _GlitchAmount: 3 + - _GlitchSize: 1 + - _Glow: 0 + - _GlowTexUsed: 0 + - _GradBlend: 1 + - _GradBoostX: 1.2 + - _GradBoostY: 1.2 + - _GradIsRadial: 0 + - _GrassManualAnim: 1 + - _GrassManualToggle: 0 + - _GrassSpeed: 2 + - _GrassWind: 20 + - _GreyscaleLuminosity: 0 + - _GreyscaleOutline: 0 + - _HandDrawnAmount: 10 + - _HandDrawnSpeed: 5 + - _HitEffectBlend: 1 + - _HitEffectGlow: 5 + - _HologramFlickerAlpha: 0 + - _HologramFlickerFreq: 0.2 + - _HologramFlickerPercent: 0.05 + - _HologramMaxAlpha: 1 + - _HologramMinAlpha: 0 + - _HologramStripesAlpha: 0.4 + - _HologramStripesAmount: 50 + - _HologramStripesFill: 0.4 + - _HologramStripesLuminosity: 1 + - _HologramStripesSpeed: 5 + - _HologramUnmodAmount: 0.4 + - _HsvBright: 1 + - _HsvSaturation: 1 + - _HsvShift: 180 + - _InnerOutlineAlpha: 1 + - _InnerOutlineGlow: 1 + - _InnerOutlineThickness: 1 + - _MaxXUV: 1 + - _MaxYUV: 1 + - _MinXUV: 0 + - _MinYUV: 0 + - _MotionBlurAngle: 0.1 + - _MotionBlurDist: 1.25 + - _MyDstMode: 10 + - _MySrcMode: 5 + - _NegativeAmount: 1 + - _OffsetUvX: 0 + - _OffsetUvY: 0 + - _OnlyInnerOutline: 0 + - _OnlyOutline: 0 + - _Outline8Directions: 0 + - _OutlineAlpha: 1 + - _OutlineDistortAmount: 0.5 + - _OutlineDistortTexXSpeed: 5 + - _OutlineDistortTexYSpeed: 5 + - _OutlineDistortToggle: 0 + - _OutlineGlow: 1.5 + - _OutlineIsPixel: 0 + - _OutlinePixelWidth: 1 + - _OutlineTexGrey: 0 + - _OutlineTexToggle: 0 + - _OutlineTexXSpeed: 10 + - _OutlineTexYSpeed: 0 + - _OutlineWidth: 0.004 + - _PinchUvAmount: 0.35 + - _PixelateSize: 32 + - _PosterizeGamma: 0.75 + - _PosterizeNumColors: 8 + - _PosterizeOutline: 0 + - _RandomSeed: 0 + - _RectSize: 1 + - _RotateUvAmount: 0 + - _RoundWaveSpeed: 2 + - _RoundWaveStrength: 0.7 + - _ShadowAlpha: 0.5 + - _ShadowX: 0.1 + - _ShadowY: -0.05 + - _ShakeUvSpeed: 2.5 + - _ShakeUvX: 1.5 + - _ShakeUvY: 1 + - _ShineGlow: 1 + - _ShineLocation: 0.5 + - _ShineRotate: 0 + - _ShineWidth: 0.1 + - _TextureScrollXSpeed: 1 + - _TextureScrollYSpeed: 0 + - _TwistUvAmount: 1 + - _TwistUvPosX: 0.5 + - _TwistUvPosY: 0.5 + - _TwistUvRadius: 0.75 + - _WaveAmount: 7 + - _WaveSpeed: 10 + - _WaveStrength: 7.5 + - _WaveX: 0 + - _WaveY: 0.5 + - _ZTestMode: 4 + - _ZWrite: 0 + - _ZoomUvAmount: 0.5 + m_Colors: + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _ColorChangeNewCol: {r: 1, g: 1, b: 0, a: 1} + - _ColorChangeTarget: {r: 1, g: 0, b: 0, a: 1} + - _ColorSwapBlue: {r: 1, g: 1, b: 1, a: 1} + - _ColorSwapGreen: {r: 1, g: 1, b: 1, a: 1} + - _ColorSwapRed: {r: 1, g: 1, b: 1, a: 1} + - _FadeBurnColor: {r: 1, g: 1, b: 0, a: 1} + - _GlowColor: {r: 1, g: 1, b: 1, a: 1} + - _GradBotLeftCol: {r: 0, g: 0, b: 1, a: 1} + - _GradBotRightCol: {r: 0, g: 0, b: 1, a: 1} + - _GradTopLeftCol: {r: 1, g: 0, b: 0, a: 1} + - _GradTopRightCol: {r: 1, g: 0, b: 0, a: 1} + - _GreyscaleTintColor: {r: 1, g: 1, b: 1, a: 1} + - _HitEffectColor: {r: 1, g: 1, b: 1, a: 1} + - _HologramStripeColor: {r: 0, g: 1, b: 1, a: 1} + - _InnerOutlineColor: {r: 1, g: 0, b: 0, a: 1} + - _OutlineColor: {r: 1, g: 1, b: 1, a: 1} + - _ShadowColor: {r: 0, g: 0, b: 0, a: 1} + - _ShineColor: {r: 1, g: 1, b: 1, a: 1} diff --git a/Assets/Plugins/AllIn1SpriteShader/Materials/ScaledTIme.mat.meta b/Assets/Plugins/AllIn1SpriteShader/Materials/ScaledTIme.mat.meta new file mode 100644 index 000000000..9caaa18d4 --- /dev/null +++ b/Assets/Plugins/AllIn1SpriteShader/Materials/ScaledTIme.mat.meta @@ -0,0 +1,15 @@ +fileFormatVersion: 2 +guid: 3241ea466d4f8334898daf420de4026b +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 2100000 + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 156513 + packageName: All In 1 Sprite Shader + packageVersion: 4.25 + assetPath: Assets/Plugins/AllIn1SpriteShader/Materials/ScaledTIme.mat + uploadId: 708810 diff --git a/Assets/Plugins/AllIn1SpriteShader/Materials/UIStencil.mat b/Assets/Plugins/AllIn1SpriteShader/Materials/UIStencil.mat new file mode 100644 index 000000000..bf67988ca --- /dev/null +++ b/Assets/Plugins/AllIn1SpriteShader/Materials/UIStencil.mat @@ -0,0 +1,177 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!21 &2100000 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: UIStencil + m_Shader: {fileID: 4800000, guid: a53f4bb29f3644b43b5075c6dcfecb32, type: 3} + m_ShaderKeywords: + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _ColorRampTex: + m_Texture: {fileID: 2800000, guid: 279657edc397ece4b8029c727adf6ddc, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ColorSwapTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DistortTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _FadeBurnTex: + m_Texture: {fileID: 2800000, guid: 677cca399782dea41aedc1d292ecb67d, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _FadeTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _GlowTex: + 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} + - _OutlineDistortTex: + m_Texture: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OutlineTex: + m_Texture: {fileID: 2800000, guid: 74087f6d03f233e4a8a142fa01f9e5cf, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - _Alpha: 1 + - _AlphaCutoffValue: 0.25 + - _BlurHD: 0 + - _BlurIntensity: 10 + - _ChromAberrAlpha: 0.4 + - _ChromAberrAmount: 1 + - _ClipUvDown: 0 + - _ClipUvLeft: 0 + - _ClipUvRight: 0 + - _ClipUvUp: 0 + - _ColorChangeLuminosity: 0 + - _ColorChangeTolerance: 0.25 + - _ColorRampLuminosity: 0 + - _ColorRampOutline: 0 + - _ColorSwapBlueLuminosity: 0.5 + - _ColorSwapGreenLuminosity: 0.5 + - _ColorSwapRedLuminosity: 0.5 + - _DistortAmount: 0.5 + - _DistortTexXSpeed: 5 + - _DistortTexYSpeed: 5 + - _FadeAmount: -0.1 + - _FadeBurnGlow: 2 + - _FadeBurnTransition: 0.075 + - _FadeBurnWidth: 0.025 + - _FishEyeUvAmount: 0.35 + - _FlickerAlpha: 0 + - _FlickerFreq: 0.2 + - _FlickerPercent: 0.05 + - _GhostColorBoost: 1 + - _GhostTransparency: 0 + - _GlitchAmount: 3 + - _Glow: 10 + - _GlowTexUsed: 0 + - _GradBlend: 1 + - _GrassManualAnim: 1 + - _GrassManualToggle: 0 + - _GrassSpeed: 2 + - _GrassWind: 20 + - _GreyscaleLuminosity: 0 + - _GreyscaleOutline: 0 + - _HandDrawnAmount: 10 + - _HandDrawnSpeed: 5 + - _HitEffectBlend: 1 + - _HitEffectGlow: 5 + - _HologramFlickerAlpha: 0 + - _HologramFlickerFreq: 0.2 + - _HologramStripesAlpha: 0.4 + - _HologramStripesAmount: 50 + - _HologramStripesFill: 0.4 + - _HologramStripesLuminosity: 1 + - _HologramStripesSpeed: 5 + - _HsvBright: 1 + - _HsvSaturation: 1 + - _HsvShift: 180 + - _InnerOutlineAlpha: 1 + - _InnerOutlineGlow: 1 + - _InnerOutlineThickness: 1 + - _MotionBlurAngle: 0.1 + - _MotionBlurDist: 1.25 + - _NegativeAmount: 1 + - _OffsetUvX: 0 + - _OffsetUvY: 0 + - _Outline8Directions: 0 + - _OutlineAlpha: 1 + - _OutlineDistortAmount: 0.5 + - _OutlineDistortTexXSpeed: 5 + - _OutlineDistortTexYSpeed: 5 + - _OutlineDistortToggle: 0 + - _OutlineGlow: 1.5 + - _OutlineIsPixel: 0 + - _OutlinePixelWidth: 1 + - _OutlineTexGrey: 0 + - _OutlineTexToggle: 0 + - _OutlineTexXSpeed: 10 + - _OutlineTexYSpeed: 0 + - _OutlineWidth: 0.004 + - _PinchUvAmount: 0.35 + - _PixelateSize: 32 + - _PosterizeGamma: 0.75 + - _PosterizeNumColors: 8 + - _PosterizeOutline: 0 + - _RectSize: 1 + - _RotateUvAmount: 0 + - _ShadowAlpha: 0.5 + - _ShadowX: 0.1 + - _ShadowY: -0.05 + - _ShakeUvSpeed: 2.5 + - _ShakeUvX: 1.5 + - _ShakeUvY: 1 + - _TextureScrollXSpeed: 1 + - _TextureScrollYSpeed: 0 + - _TwistUvAmount: 1 + - _TwistUvPosX: 0.5 + - _TwistUvPosY: 0.5 + - _TwistUvRadius: 0.75 + - _WaveAmount: 7 + - _WaveSpeed: 10 + - _WaveStrength: 7.5 + - _WaveX: 0 + - _WaveY: 0.5 + - _ZoomUvAmount: 0.5 + m_Colors: + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _ColorChangeNewCol: {r: 1, g: 1, b: 0, a: 1} + - _ColorChangeTarget: {r: 1, g: 0, b: 0, a: 1} + - _ColorSwapBlue: {r: 1, g: 1, b: 1, a: 1} + - _ColorSwapGreen: {r: 1, g: 1, b: 1, a: 1} + - _ColorSwapRed: {r: 1, g: 1, b: 1, a: 1} + - _FadeBurnColor: {r: 1, g: 1, b: 0, a: 1} + - _GlowColor: {r: 1, g: 1, b: 1, a: 1} + - _GradBotLeftCol: {r: 0, g: 0, b: 1, a: 1} + - _GradBotRightCol: {r: 0, g: 0, b: 1, a: 1} + - _GradTopLeftCol: {r: 1, g: 0, b: 0, a: 1} + - _GradTopRightCol: {r: 1, g: 0, b: 0, a: 1} + - _GreyscaleTintColor: {r: 1, g: 1, b: 1, a: 1} + - _HitEffectColor: {r: 1, g: 1, b: 1, a: 1} + - _InnerOutlineColor: {r: 1, g: 0, b: 0, a: 1} + - _OutlineColor: {r: 1, g: 1, b: 1, a: 1} + - _ShadowColor: {r: 0, g: 0, b: 0, a: 1} diff --git a/Assets/Plugins/AllIn1SpriteShader/Materials/UIStencil.mat.meta b/Assets/Plugins/AllIn1SpriteShader/Materials/UIStencil.mat.meta new file mode 100644 index 000000000..caa1b3590 --- /dev/null +++ b/Assets/Plugins/AllIn1SpriteShader/Materials/UIStencil.mat.meta @@ -0,0 +1,15 @@ +fileFormatVersion: 2 +guid: 7ef34f26b8117334c8ecd9c27a45e2c6 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 2100000 + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 156513 + packageName: All In 1 Sprite Shader + packageVersion: 4.25 + assetPath: Assets/Plugins/AllIn1SpriteShader/Materials/UIStencil.mat + uploadId: 708810 diff --git a/Assets/Plugins/AllIn1SpriteShader/Scripts.meta b/Assets/Plugins/AllIn1SpriteShader/Scripts.meta new file mode 100644 index 000000000..25e7f5c24 --- /dev/null +++ b/Assets/Plugins/AllIn1SpriteShader/Scripts.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 4e5ef1ce32696cd4c8ddbe3e0e172819 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/AllIn1SpriteShader/Scripts/All1CreateUnifiedOutline.cs b/Assets/Plugins/AllIn1SpriteShader/Scripts/All1CreateUnifiedOutline.cs new file mode 100644 index 000000000..6ecf90ba7 --- /dev/null +++ b/Assets/Plugins/AllIn1SpriteShader/Scripts/All1CreateUnifiedOutline.cs @@ -0,0 +1,96 @@ +using System.Collections.Generic; +using UnityEngine; +using UnityEngine.UI; +#if UNITY_EDITOR +using UnityEditor; +#endif + +namespace AllIn1SpriteShader +{ + [ExecuteInEditMode] + public class All1CreateUnifiedOutline : MonoBehaviour + { + [SerializeField] private Material outlineMaterial = null; + [SerializeField] private Transform outlineParentTransform = null; + + [Space] + [Header("Only needed if Sprite (ignored if UI)")] + [SerializeField] private int duplicateOrderInLayer = -100; + [SerializeField] private string duplicateSortingLayer = "Default"; + + [Space] + [Header("This operation will delete the component")] + [SerializeField] private bool createUnifiedOutline; + + void Update() + { + if (createUnifiedOutline) + { + if (outlineMaterial == null) + { + createUnifiedOutline = false; + MissingMaterial(); + return; + } + + List children = new List(); + GetAllChildren(transform, ref children); + foreach (Transform t in children) CreateOutlineSpriteDuplicate(t.gameObject); + CreateOutlineSpriteDuplicate(gameObject); + + DestroyImmediate(this); + } + } + + private void CreateOutlineSpriteDuplicate(GameObject target) + { + bool objectIsUi = false; + SpriteRenderer ownSr = target.GetComponent(); + Image ownImage = target.GetComponent(); + if (ownSr != null) objectIsUi = false; + else if (ownImage != null) objectIsUi = true; + else if (ownSr == null && ownImage == null && !transform.Equals(outlineParentTransform)) return; + + GameObject objDuplicate = new GameObject(); + objDuplicate.name = target.name + "Outline"; + objDuplicate.transform.position = target.transform.position; + objDuplicate.transform.rotation = target.transform.rotation; + objDuplicate.transform.localScale = target.transform.lossyScale; + if (outlineParentTransform == null) objDuplicate.transform.parent = target.transform; + else objDuplicate.transform.parent = outlineParentTransform; + + if (!objectIsUi) + { + SpriteRenderer sr = objDuplicate.AddComponent(); + sr.sprite = ownSr.sprite; + sr.sortingOrder = duplicateOrderInLayer; + sr.sortingLayerName = duplicateSortingLayer; + sr.material = outlineMaterial; + sr.flipX = ownSr.flipX; + sr.flipY = ownSr.flipY; + } + else + { + Image image = objDuplicate.AddComponent(); + image.sprite = ownImage.sprite; + image.material = outlineMaterial; + } + } + + private void MissingMaterial() + { +#if UNITY_EDITOR + EditorUtility.DisplayDialog("Missing Material", "Please assign a Material For New Duplicate and try again", "Ok"); +#endif + } + + private void GetAllChildren(Transform parent, ref List transforms) + { + foreach (Transform child in parent) + { + transforms.Add(child); + GetAllChildren(child, ref transforms); + } + } + } +} \ No newline at end of file diff --git a/Assets/Plugins/AllIn1SpriteShader/Scripts/All1CreateUnifiedOutline.cs.meta b/Assets/Plugins/AllIn1SpriteShader/Scripts/All1CreateUnifiedOutline.cs.meta new file mode 100644 index 000000000..dd17852c3 --- /dev/null +++ b/Assets/Plugins/AllIn1SpriteShader/Scripts/All1CreateUnifiedOutline.cs.meta @@ -0,0 +1,18 @@ +fileFormatVersion: 2 +guid: 264cca4d0f5bbb54eb9de18ca54d1506 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 156513 + packageName: All In 1 Sprite Shader + packageVersion: 4.25 + assetPath: Assets/Plugins/AllIn1SpriteShader/Scripts/All1CreateUnifiedOutline.cs + uploadId: 708810 diff --git a/Assets/Plugins/AllIn1SpriteShader/Scripts/AllIn1Shader.cs b/Assets/Plugins/AllIn1SpriteShader/Scripts/AllIn1Shader.cs new file mode 100644 index 000000000..35e0ef392 --- /dev/null +++ b/Assets/Plugins/AllIn1SpriteShader/Scripts/AllIn1Shader.cs @@ -0,0 +1,814 @@ +using System.Collections.Generic; +using System.IO; +using UnityEditor; +using UnityEngine; +using UnityEngine.Tilemaps; +using UnityEngine.UI; +#if UNITY_EDITOR +using UnityEditor.SceneManagement; +#endif + +namespace AllIn1SpriteShader +{ + [ExecuteInEditMode] + [DisallowMultipleComponent] + [AddComponentMenu("AllIn1SpriteShader/AddAllIn1Shader")] + public class AllIn1Shader : MonoBehaviour + { + public enum ShaderTypes + { + Default = 0, + ScaledTime = 1, + MaskedUI = 2, + Urp2dRenderer = 3, + Lit = 5, + Invalid = 4, + } + public ShaderTypes currentShaderType = ShaderTypes.Invalid; + + private Material currMaterial, prevMaterial; + private bool matAssigned = false, destroyed = false; + private enum AfterSetAction { Clear, CopyMaterial, Reset}; + + [Range(1f, 20f)] public float normalStrength = 5f; + [Range(0f, 3f)] public int normalSmoothing = 1; + [HideInInspector] public bool computingNormal = false; + +#if UNITY_EDITOR + private static float timeLastReload = -1f; + private void Start() + { + if(timeLastReload < 0) timeLastReload = Time.time; + } + + private void Update() + { + if (matAssigned || Application.isPlaying || !gameObject.activeSelf) return; + Renderer sr = GetComponent(); + if (sr != null) + { + if (sr.sharedMaterial == null) + { + CleanMaterial(); + MakeNewMaterial(true); + } + if (sr.sharedMaterial.name.Contains("Default")) MakeNewMaterial(true); + else matAssigned = true; + } + else + { + Graphic img = GetComponent(); + if (img != null) + { + if (img.material.name.Contains("Default")) MakeNewMaterial(true); + else matAssigned = true; + } + } + } +#endif + + private void MakeNewMaterial(bool getShaderTypeFromPrefs, string shaderName = "AllIn1SpriteShader") + { + bool operationSuccessful = SetMaterial(AfterSetAction.Clear, getShaderTypeFromPrefs, shaderName); + #if UNITY_EDITOR + if(operationSuccessful) AllIn1ShaderWindow.ShowSceneViewNotification("AllIn1SpriteShader: Material Created and Assigned"); + #endif + } + + public bool MakeCopy() + { + return SetMaterial(AfterSetAction.CopyMaterial, false, GetStringFromShaderType()); + } + + private void ResetAllProperties(bool getShaderTypeFromPrefs, string shaderName) + { + SetMaterial(AfterSetAction.Reset, getShaderTypeFromPrefs, shaderName); + } + + private string GetStringFromShaderType() + { + currentShaderType = ShaderTypes.Default; + if(currentShaderType == ShaderTypes.Default) return"AllIn1SpriteShader"; + else if(currentShaderType == ShaderTypes.ScaledTime) return"AllIn1SpriteShaderScaledTime"; + else if(currentShaderType == ShaderTypes.MaskedUI) return"AllIn1SpriteShaderUiMask"; + else if(currentShaderType == ShaderTypes.Urp2dRenderer) return"AllIn1Urp2dRenderer"; + else if(currentShaderType == ShaderTypes.Lit) return"AllIn1SpriteShaderLit"; + else return "AllIn1SpriteShader"; + } + + private bool SetMaterial(AfterSetAction action, bool getShaderTypeFromPrefs, string shaderName) + { + #if UNITY_EDITOR + Shader allIn1Shader = AllIn1ShaderWindow.FindShader(shaderName); + if (getShaderTypeFromPrefs) + { + int shaderVariant = PlayerPrefs.GetInt("allIn1DefaultShader"); + currentShaderType = (ShaderTypes)shaderVariant; + if (shaderVariant == 1) allIn1Shader = AllIn1ShaderWindow.FindShader("AllIn1SpriteShaderScaledTime"); + else if (shaderVariant == 2) allIn1Shader = AllIn1ShaderWindow.FindShader("AllIn1SpriteShaderUiMask"); + else if (shaderVariant == 3) allIn1Shader = AllIn1ShaderWindow.FindShader("AllIn1Urp2dRenderer"); + else if (shaderVariant == 5) allIn1Shader = AllIn1ShaderWindow.FindShader("AllIn1SpriteShaderLit"); + } + + if (!Application.isPlaying && Application.isEditor && allIn1Shader != null) + { + bool rendererExists = false; + Renderer sr = GetComponent(); + if (sr != null) + { + rendererExists = true; + int renderingQueue = 3000; + if(action == AfterSetAction.CopyMaterial) renderingQueue = GetComponent().sharedMaterial.renderQueue; + prevMaterial = new Material(GetComponent().sharedMaterial); + currMaterial = new Material(allIn1Shader); + currMaterial.renderQueue = renderingQueue; + GetComponent().sharedMaterial = currMaterial; + GetComponent().sharedMaterial.hideFlags = HideFlags.None; + matAssigned = true; + + DoAfterSetAction(action); + } + else + { + Graphic img = GetComponent(); + if (img != null) + { + rendererExists = true; + int renderingQueue = 3000; + if(action == AfterSetAction.CopyMaterial) renderingQueue = img.material.renderQueue; + prevMaterial = new Material(img.material); + currMaterial = new Material(allIn1Shader); + currMaterial.renderQueue = renderingQueue; + img.material = currMaterial; + img.material.hideFlags = HideFlags.None; + matAssigned = true; + DoAfterSetAction(action); + } + } + if (!rendererExists) + { + MissingRenderer(); + return false; + } + else + { + SetSceneDirty(); + return true; + } + } + else if (allIn1Shader == null) + { + #if UNITY_EDITOR + string logErrorMessage = "Make sure all AllIn1SpriteShader shader variants are present. Maybe delete the asset and download it again?"; + Debug.LogError(logErrorMessage); + AllIn1ShaderWindow.ShowSceneViewNotification(logErrorMessage); + #endif + return false; + } + #endif + return false; + } + + private void DoAfterSetAction(AfterSetAction action) + { + switch (action) + { + case AfterSetAction.Clear: + ClearAllKeywords(); + break; + case AfterSetAction.CopyMaterial: + currMaterial.CopyPropertiesFromMaterial(prevMaterial); + break; + } + } + + public bool TryCreateNew() + { + bool rendererExists = false; + Renderer sr = GetComponent(); + if (sr != null) + { + rendererExists = true; + if (sr != null && sr.sharedMaterial != null && sr.sharedMaterial.name.Contains("AllIn1")) + { + ResetAllProperties(false, GetStringFromShaderType()); + ClearAllKeywords(); + } + else + { + CleanMaterial(); + MakeNewMaterial(false, GetStringFromShaderType()); + } + } + else + { + Graphic img = GetComponent(); + if (img != null) + { + rendererExists = true; + if (img.material.name.Contains("AllIn1")) + { + ResetAllProperties(false, GetStringFromShaderType()); + ClearAllKeywords(); + } + else MakeNewMaterial(false, GetStringFromShaderType()); + } + } + if (!rendererExists) + { + MissingRenderer(); + } + SetSceneDirty(); + return rendererExists; + } + + public void ClearAllKeywords() + { + SetKeyword("RECTSIZE_ON"); + SetKeyword("OFFSETUV_ON"); + SetKeyword("CLIPPING_ON"); + SetKeyword("POLARUV_ON"); + SetKeyword("TWISTUV_ON"); + SetKeyword("ROTATEUV_ON"); + SetKeyword("FISHEYE_ON"); + SetKeyword("PINCH_ON"); + SetKeyword("SHAKEUV_ON"); + SetKeyword("WAVEUV_ON"); + SetKeyword("ROUNDWAVEUV_ON"); + SetKeyword("DOODLE_ON"); + SetKeyword("ZOOMUV_ON"); + SetKeyword("FADE_ON"); + SetKeyword("TEXTURESCROLL_ON"); + SetKeyword("GLOW_ON"); + SetKeyword("OUTBASE_ON"); + SetKeyword("ONLYOUTLINE_ON"); + SetKeyword("OUTTEX_ON"); + SetKeyword("OUTDIST_ON"); + SetKeyword("DISTORT_ON"); + SetKeyword("WIND_ON"); + SetKeyword("GRADIENT_ON"); + SetKeyword("GRADIENT2COL_ON"); + SetKeyword("RADIALGRADIENT_ON"); + SetKeyword("COLORSWAP_ON"); + SetKeyword("HSV_ON"); + SetKeyword("HITEFFECT_ON"); + SetKeyword("PIXELATE_ON"); + SetKeyword("NEGATIVE_ON"); + SetKeyword("GRADIENTCOLORRAMP_ON"); + SetKeyword("COLORRAMP_ON"); + SetKeyword("GREYSCALE_ON"); + SetKeyword("POSTERIZE_ON"); + SetKeyword("BLUR_ON"); + SetKeyword("MOTIONBLUR_ON"); + SetKeyword("GHOST_ON"); + SetKeyword("ALPHAOUTLINE_ON"); + SetKeyword("INNEROUTLINE_ON"); + SetKeyword("ONLYINNEROUTLINE_ON"); + SetKeyword("HOLOGRAM_ON"); + SetKeyword("CHROMABERR_ON"); + SetKeyword("GLITCH_ON"); + SetKeyword("FLICKER_ON"); + SetKeyword("SHADOW_ON"); + SetKeyword("SHINE_ON"); + SetKeyword("CONTRAST_ON"); + SetKeyword("OVERLAY_ON"); + SetKeyword("OVERLAYMULT_ON"); + SetKeyword("ALPHACUTOFF_ON"); + SetKeyword("ALPHAROUND_ON"); + SetKeyword("CHANGECOLOR_ON"); + SetKeyword("CHANGECOLOR2_ON"); + SetKeyword("CHANGECOLOR3_ON"); + SetKeyword("FOG_ON"); + SetSceneDirty(); + } + + private void SetKeyword(string keyword, bool state = false) + { + if (destroyed) return; + if (currMaterial == null) + { + FindCurrMaterial(); + if (currMaterial == null) + { + MissingRenderer(); + return; + } + } + if (!state) currMaterial.DisableKeyword(keyword); + else currMaterial.EnableKeyword(keyword); + } + + private void FindCurrMaterial() + { + Renderer sr = GetComponent(); + if (sr != null) + { + currMaterial = GetComponent().sharedMaterial; + matAssigned = true; + } + else + { + Graphic img = GetComponent(); + if (img != null) + { + currMaterial = img.material; + matAssigned = true; + } + } + } + + public void CleanMaterial() + { + Renderer sr = GetComponent(); + if (sr != null) + { + sr.sharedMaterial = new Material(Shader.Find("Sprites/Default")); + matAssigned = false; + } + else + { + Graphic img = GetComponent(); + if (img != null) + { + img.material = new Material(Shader.Find("Sprites/Default")); + matAssigned = false; + } + } + SetSceneDirty(); + } + + public bool SaveMaterial() + { +#if UNITY_EDITOR + string sameMaterialPath = AllIn1ShaderWindow.GetMaterialSavePath(); + sameMaterialPath += "/"; + if (!System.IO.Directory.Exists(sameMaterialPath)) + { + EditorUtility.DisplayDialog("The desired Material Save Path doesn't exist", + "Go to Window -> AllIn1ShaderWindow and set a valid folder", "Ok"); + return false; + } + sameMaterialPath += gameObject.name; + string fullPath = sameMaterialPath + ".mat"; + if (System.IO.File.Exists(fullPath)) + { + SaveMaterialWithOtherName(sameMaterialPath); + } + else DoSaving(fullPath); + SetSceneDirty(); + return true; +#else + return false; +#endif + } + private void SaveMaterialWithOtherName(string path, int i = 1) + { + int number = i; + string newPath = path + "_" + number.ToString(); + string fullPath = newPath + ".mat"; + if (System.IO.File.Exists(fullPath)) + { + number++; + SaveMaterialWithOtherName(path, number); + } + else + { + DoSaving(fullPath); + } + } + + private void DoSaving(string fileName) + { +#if UNITY_EDITOR + bool rendererExists = false; + Renderer sr = GetComponent(); + Material matToSave = null; + Material createdMat = null; + if (sr != null) + { + rendererExists = true; + matToSave = sr.sharedMaterial; + } + else + { + Graphic img = GetComponent(); + if (img != null) + { + rendererExists = true; + matToSave = img.material; + } + } + if (!rendererExists) + { + MissingRenderer(); + return; + } + else + { + createdMat = new Material(matToSave); + currMaterial = createdMat; + AssetDatabase.CreateAsset(createdMat, fileName); + Debug.Log(fileName + " has been saved!"); + EditorGUIUtility.PingObject(AssetDatabase.LoadAssetAtPath(fileName, typeof(Material))); + } + if (sr != null) + { + sr.material = createdMat; + } + else + { + Graphic img = GetComponent(); + img.material = createdMat; + } +#endif + } + + public void SetSceneDirty() + { +#if UNITY_EDITOR + if (!Application.isPlaying) EditorSceneManager.MarkAllScenesDirty(); + + //If you get an error here please delete the code block below + #if UNITY_2021_2_OR_NEWER + var prefabStage = UnityEditor.SceneManagement.PrefabStageUtility.GetCurrentPrefabStage(); + #else + var prefabStage = UnityEditor.Experimental.SceneManagement.PrefabStageUtility.GetCurrentPrefabStage(); + #endif + if (prefabStage != null) EditorSceneManager.MarkSceneDirty(prefabStage.scene); + //Until here +#endif + } + + private void MissingRenderer() + { +#if UNITY_EDITOR + EditorUtility.DisplayDialog("Missing Renderer", "This GameObject (" + + gameObject.name + ") has no Renderer or UI Image component. This AllIn1Shader component will be removed.", "Ok"); + destroyed = true; + DestroyImmediate(this); +#endif + } + + public bool ToggleSetAtlasUvs(bool activate) + { + bool success = false; + SetAtlasUvs atlasUvs = GetComponent(); + if (activate) + { + if (atlasUvs == null) atlasUvs = gameObject.AddComponent(); + if (atlasUvs != null) success = atlasUvs.GetAndSetUVs(); + if(success) SetKeyword("ATLAS_ON", true); + } + else + { + if (atlasUvs != null) + { + atlasUvs.ResetAtlasUvs(); + DestroyImmediate(atlasUvs); + success = true; + } + else + { + #if UNITY_EDITOR + EditorUtility.DisplayDialog("Missing Atlas Uv Setup", "This GameObject (" + gameObject.name + ") has no Atlas Uv Setup.", "Ok"); + #endif + return false; + } + SetKeyword("ATLAS_ON", false); + } + SetSceneDirty(); + return success; + } + + public bool ApplyMaterialToHierarchy() + { + Renderer sr = GetComponent(); + Graphic image = GetComponent(); + Material matToApply = null; + if (sr != null) matToApply = sr.sharedMaterial; + else if (image != null) + { + matToApply = image.material; + } + else + { + MissingRenderer(); + return false; + } + + List children = new List(); + GetAllChildren(transform, ref children); + bool hasPerformedOperation = false; + foreach (Transform t in children) + { + sr = t.gameObject.GetComponent(); + if (sr != null) sr.material = matToApply; + else + { + image = t.gameObject.GetComponent(); + if (image != null) image.material = matToApply; + } + hasPerformedOperation = true; + } + + return hasPerformedOperation; + } + + public void CheckIfValidTarget() + { + Renderer sr = GetComponent(); + Graphic image = GetComponent(); + if (sr == null && image == null) MissingRenderer(); + } + + private void GetAllChildren(Transform parent, ref List transforms) + { + foreach (Transform child in parent) + { + transforms.Add(child); + GetAllChildren(child, ref transforms); + } + } + + public bool RenderToImage() + { +#if UNITY_EDITOR + if (currMaterial == null) + { + FindCurrMaterial(); + if (currMaterial == null) + { + MissingRenderer(); + return false; + } + } + Texture tex = currMaterial.GetTexture("_MainTex"); + if(tex != null) + { + bool success = RenderAndSaveTexture(currMaterial, tex); + if(!success) return false; + } + else + { + SpriteRenderer sr = GetComponent(); + Graphic i = GetComponent(); + if (sr != null && sr.sprite != null && sr.sprite.texture != null) tex = sr.sprite.texture; + else if (i != null && i.mainTexture != null) tex = i.mainTexture; + + if(tex != null) + { + bool success = RenderAndSaveTexture(currMaterial, tex); + if(!success) return false; + } + else{ + EditorUtility.DisplayDialog("No valid target texture found", "All In 1 Shader component couldn't find a valid Main Texture in this GameObject (" + + gameObject.name + "). This means that the material you are using has no Main Texture or that the texture couldn't be reached through the Renderer component you are using." + + " Please make sure to have a valid Main Texture in the Material or Renderer/Graphic component", "Ok"); + return false; + } + } + return true; +#else + return false; +#endif + } + + private bool RenderAndSaveTexture(Material targetMaterial, Texture targetTexture) + { +#if UNITY_EDITOR + float scaleSlider = 1; + if (PlayerPrefs.HasKey("All1ShaderRenderImagesScale")) scaleSlider = PlayerPrefs.GetFloat("All1ShaderRenderImagesScale"); + RenderTexture renderTarget = new RenderTexture((int)(targetTexture.width * scaleSlider), (int)(targetTexture.height * scaleSlider), 0, RenderTextureFormat.ARGB32); + Graphics.Blit(targetTexture, renderTarget, targetMaterial); + Texture2D reaultTex = new Texture2D(renderTarget.width, renderTarget.height, TextureFormat.ARGB32, false); + reaultTex.ReadPixels(new Rect(0, 0, renderTarget.width, renderTarget.height), 0, 0); + reaultTex.Apply(); + + string path = AllIn1ShaderWindow.GetRenderImageSavePath(); + path += "/"; + if (!System.IO.Directory.Exists(path)) + { + EditorUtility.DisplayDialog("The desired Material to Image Save Path doesn't exist", + "Go to Window -> AllIn1ShaderWindow and set a valid folder", "Ok"); + return false; + } + string fullPath = path + gameObject.name + ".png"; + if (System.IO.File.Exists(fullPath)) fullPath = GetNewValidPath(path + gameObject.name); + string pingPath = fullPath; + + string fileName = fullPath.Replace(path, ""); + fileName = fileName.Replace(".png", ""); + fullPath = EditorUtility.SaveFilePanel("Save Render Image", path, fileName, "png"); + if(string.IsNullOrEmpty(fullPath)) + { + Debug.Log("Save operation was cancelled or no valid path was selected."); + return false; + } + + byte[] bytes = reaultTex.EncodeToPNG(); + File.WriteAllBytes(fullPath, bytes); + AssetDatabase.ImportAsset(subPath); + AssetDatabase.Refresh(); + DestroyImmediate(reaultTex); + EditorGUIUtility.PingObject(AssetDatabase.LoadAssetAtPath(pingPath, typeof(Texture))); + Debug.Log("Render Image saved to: " + fullPath + " with scale: " + scaleSlider + " (it can be changed in Window -> AllIn1ShaderWindow)"); + return true; +#else + return false; +#endif + + } + + private string GetNewValidPath(string path, int i = 1) + { + int number = i; + string newPath = path + "_" + number.ToString(); + string fullPath = newPath + ".png"; + if (System.IO.File.Exists(fullPath)) + { + number++; + fullPath = GetNewValidPath(path, number); + } + return fullPath; + } + + #region normalMapCreator + protected virtual void OnEnable() + { +#if UNITY_EDITOR + EditorApplication.update += OnEditorUpdate; +#endif + } + + protected virtual void OnDisable() + { +#if UNITY_EDITOR + EditorApplication.update -= OnEditorUpdate; +#endif + } + + bool needToWait; + int waitingCycles; + int timesWeWaited; + protected virtual void OnEditorUpdate() + { + if (computingNormal) + { + if (needToWait) + { + waitingCycles++; + if (waitingCycles > 5) + { + needToWait = false; + timesWeWaited++; + } + } + else + { + if (timesWeWaited == 1) SetNewNormalTexture2(); + if (timesWeWaited == 2) SetNewNormalTexture3(); + if (timesWeWaited == 3) SetNewNormalTexture4(); + needToWait = true; + } + } + } + + SpriteRenderer normalMapSr; + Renderer normalMapRenderer; + bool isSpriteRenderer; + public void CreateAndAssignNormalMap() + { +#if UNITY_EDITOR + if (GetComponent() != null) + { + EditorUtility.DisplayDialog("This is a tilemap", "This feature isn't supported on Tilemap Renderers." + + " Add a secondary normal map texture instead (you can create a Normal Map in the asset Window)", "Ok"); + return; + } + + normalMapSr = GetComponent(); + normalMapRenderer = GetComponent(); + Debug.LogError($"NORMALMAP_ON: {normalMapRenderer.sharedMaterial.IsKeywordEnabled("NORMALMAP_ON")} -t:{Time.time}"); + if (normalMapSr != null) + { + isSpriteRenderer = true; + SetNewNormalTexture(); + if(!normalMapSr.sharedMaterial.IsKeywordEnabled("NORMALMAP_ON")) normalMapSr.sharedMaterial.EnableKeyword("NORMALMAP_ON"); + } + else if (normalMapRenderer != null) + { + isSpriteRenderer = false; + SetNewNormalTexture(); + if(!normalMapRenderer.sharedMaterial.IsKeywordEnabled("NORMALMAP_ON")) normalMapRenderer.sharedMaterial.EnableKeyword("NORMALMAP_ON"); + } + else + { + if (GetComponent() != null) + { + EditorUtility.DisplayDialog("This is a UI element", "This GameObject (" + + gameObject.name + ") is a UI element. UI elements probably shouldn't have a normal map. Why are you using the light shader variant?", "Ok"); + } + else + { + MissingRenderer(); + } + return; + } +#endif + } + + string path; + private void SetNewNormalTexture() + { +#if UNITY_EDITOR + path = AllIn1ShaderWindow.GetNormalMapSavePath(); + path += "/"; + if (!System.IO.Directory.Exists(path)) + { + EditorUtility.DisplayDialog("The desired folder doesn't exist", + "Go to Window -> AllIn1ShaderWindow and set a valid folder", "Ok"); + return; + } +#else + computingNormal = false; + return; +#endif + + computingNormal = true; + needToWait = true; + waitingCycles = 0; + timesWeWaited = 0; + } + +#if UNITY_EDITOR + TextureImporter importer; + Texture2D mainTex2D; +#endif + private void SetNewNormalTexture2() + { +#if UNITY_EDITOR + if (!isSpriteRenderer) + { + mainTex2D = (Texture2D)normalMapRenderer.sharedMaterial.GetTexture("_MainTex"); + importer = AssetImporter.GetAtPath(AssetDatabase.GetAssetPath(mainTex2D)) as TextureImporter; + } + else importer = AssetImporter.GetAtPath(AssetDatabase.GetAssetPath(normalMapSr.sprite)) as TextureImporter; + + importer.isReadable = true; + importer.SaveAndReimport(); +#endif + } + + string subPath; + private void SetNewNormalTexture3() + { +#if UNITY_EDITOR + Texture2D normalM = null; + if(isSpriteRenderer) normalM = AllIn1ShaderWindow.CreateNormalMap(normalMapSr.sprite.texture, normalStrength, normalSmoothing); + else normalM = AllIn1ShaderWindow.CreateNormalMap(mainTex2D, normalStrength, normalSmoothing); + + byte[] bytes = normalM.EncodeToPNG(); + + path += gameObject.name; + subPath = path + ".png"; + string dataPath = Application.dataPath; + dataPath = dataPath.Replace("/Assets", "/"); + string fullPath = dataPath + subPath; + + File.WriteAllBytes(fullPath, bytes); + AssetDatabase.ImportAsset(subPath); + AssetDatabase.Refresh(); + DestroyImmediate(normalM); +#endif + } + + private void SetNewNormalTexture4() + { +#if UNITY_EDITOR + importer = AssetImporter.GetAtPath(subPath) as TextureImporter; + importer.filterMode = FilterMode.Bilinear; + importer.textureType = TextureImporterType.NormalMap; + importer.wrapMode = TextureWrapMode.Repeat; + importer.SaveAndReimport(); + + if (currMaterial == null) + { + FindCurrMaterial(); + if (currMaterial == null) + { + MissingRenderer(); + return; + } + } + Texture2D normalTex = (Texture2D)AssetDatabase.LoadAssetAtPath(subPath, typeof(Texture2D)); + currMaterial.SetTexture("_NormalMap", normalTex); + + Debug.Log("Normal texture saved to: " + subPath); + EditorGUIUtility.PingObject(AssetDatabase.LoadAssetAtPath(subPath, typeof(Texture))); + + computingNormal = false; +#endif + } + #endregion + } +} \ No newline at end of file diff --git a/Assets/Plugins/AllIn1SpriteShader/Scripts/AllIn1Shader.cs.meta b/Assets/Plugins/AllIn1SpriteShader/Scripts/AllIn1Shader.cs.meta new file mode 100644 index 000000000..ae18adbd6 --- /dev/null +++ b/Assets/Plugins/AllIn1SpriteShader/Scripts/AllIn1Shader.cs.meta @@ -0,0 +1,18 @@ +fileFormatVersion: 2 +guid: ee158225ee1e59f4791627785501d950 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 156513 + packageName: All In 1 Sprite Shader + packageVersion: 4.25 + assetPath: Assets/Plugins/AllIn1SpriteShader/Scripts/AllIn1Shader.cs + uploadId: 708810 diff --git a/Assets/Plugins/AllIn1SpriteShader/Scripts/AllIn1ShaderWindow.cs b/Assets/Plugins/AllIn1SpriteShader/Scripts/AllIn1ShaderWindow.cs new file mode 100644 index 000000000..5cb9092f9 --- /dev/null +++ b/Assets/Plugins/AllIn1SpriteShader/Scripts/AllIn1ShaderWindow.cs @@ -0,0 +1,692 @@ +#if UNITY_EDITOR +using System.IO; +using UnityEditor; +using UnityEngine; +using ShaderType = AllIn1SpriteShader.AllIn1Shader.ShaderTypes; + +namespace AllIn1SpriteShader +{ + public class AllIn1ShaderWindow : EditorWindow + { + private const string versionString = "4.2"; + [MenuItem("Tools/AllIn1/SpriteShaderWindow")] + public static void ShowAllIn1ShaderWindowWindow() + { + GetWindow("All In 1 Shader Window"); + } + + public static readonly string CUSTOM_EDITOR_HEADER = "AllIn1SpriteShaderEditorImage"; + private static string basePath = "Assets/Plugins/AllIn1SpriteShader"; + public static readonly string materialsSavesRelativePath = "/Materials"; + public static readonly string renderImagesSavesRelativePath = "/Textures"; + public static readonly string normalMapSavesRelativePath = "/Textures/NormalMaps"; + public static readonly string gradientSavesRelativePath = "/Textures/GradientTextures"; + + public Vector2 scrollPosition = Vector2.zero; + private Texture2D imageInspector; + private DefaultAsset materialTargetFolder = null; + private GUIStyle style, bigLabel = new GUIStyle(), titleStyle = new GUIStyle(); + private const int bigFontSize = 16; + + AllIn1Shader.ShaderTypes shaderTypes = AllIn1Shader.ShaderTypes.Default; + bool showUrpWarning = false; + double warningTime = 0f; + + private Texture2D targetNormalImage; + private float normalStrength = 5f; + private int normalSmoothing = 1; + private int isComputingNormals = 0; + + private enum TextureSizes + { + _2 = 2, + _4 = 4, + _8 = 8, + _16 = 16, + _32 = 32, + _64 = 64, + _128 = 128, + _256 = 256, + _512 = 512, + _1024 = 1024, + _2048 = 2048 + } + private TextureSizes textureSizes = TextureSizes._128; + [SerializeField] private Gradient gradient = new Gradient(); + private FilterMode gradientFiltering = FilterMode.Bilinear; + + private enum ImageType + { + ShowImage, + HideInComponent, + HideEverywhere + } + private ImageType imageType; + + private void OnGUI() + { + style = new GUIStyle(EditorStyles.helpBox); + style.margin = new RectOffset(0, 0, 0, 0); + bigLabel = new GUIStyle(EditorStyles.boldLabel); + bigLabel.fontSize = bigFontSize; + titleStyle.alignment = TextAnchor.MiddleLeft; + + using (var scrollView = new EditorGUILayout.ScrollViewScope(scrollPosition, GUILayout.Width(position.width), GUILayout.Height(position.height))) + { + scrollPosition = scrollView.scrollPosition; + + ShowImageAndSetImageEditorPref(); + + ShowAssetImageOptionsToggle(); + + DefaultAssetShader(); + + DrawLine(Color.grey, 1, 3); + GUILayout.Label("Material Save Path", bigLabel); + GUILayout.Space(20); + GUILayout.Label("Select the folder where new Materials will be saved when the Save Material To Folder button of the asset component is pressed", EditorStyles.boldLabel); + HandleSaveFolderEditorPref("All1ShaderMaterials", basePath + materialsSavesRelativePath, "Material"); + + DrawLine(Color.grey, 1, 3); + GUILayout.Label("Render Material to Image Save Path", bigLabel); + GUILayout.Space(20); + EditorGUILayout.BeginHorizontal(); + { + float scaleSlider = 1; + if (PlayerPrefs.HasKey("All1ShaderRenderImagesScale")) scaleSlider = PlayerPrefs.GetFloat("All1ShaderRenderImagesScale"); + GUILayout.Label("Rendered Image Texture Scale", GUILayout.MaxWidth(190)); + scaleSlider = EditorGUILayout.Slider(scaleSlider, 0.2f, 5f, GUILayout.MaxWidth(200)); + if (GUILayout.Button("Default Value", GUILayout.MaxWidth(100))) PlayerPrefs.SetFloat("All1ShaderRenderImagesScale", 1f); + else PlayerPrefs.SetFloat("All1ShaderRenderImagesScale", scaleSlider); + } + EditorGUILayout.EndVertical(); + GUILayout.Label("Select the folder where new Images will be saved when the Render Material To Image button of the asset component is pressed", EditorStyles.boldLabel); + HandleSaveFolderEditorPref("All1ShaderRenderImages", basePath + renderImagesSavesRelativePath, "Images"); + + DrawLine(Color.grey, 1, 3); + NormalMapCreator(); + + DrawLine(Color.grey, 1, 3); + GradientCreator(); + + DrawLine(Color.grey, 1, 3); + GUILayout.Space(10); + SceneNotificationsToggle(); + + DrawLine(Color.grey, 1, 3); + GUILayout.Space(10); + RefreshLitShader(); + + GUILayout.Space(10); + DrawLine(Color.grey, 1, 3); + GUILayout.Label("Current asset version is " + versionString, EditorStyles.boldLabel); + } + } + + private void ShowImageAndSetImageEditorPref() + { + if(!EditorPrefs.HasKey("allIn1ImageConfig")) + { + EditorPrefs.SetInt("allIn1ImageConfig", (int) ImageType.ShowImage); + } + + imageType = (ImageType) EditorPrefs.GetInt("allIn1ImageConfig"); + if(imageType == ImageType.HideEverywhere) return; + switch(imageType) + { + case ImageType.ShowImage: + case ImageType.HideInComponent: + if(imageInspector == null) imageInspector = GetInspectorImage(); + break; + } + + if(imageInspector) + { + Rect rect = EditorGUILayout.GetControlRect(GUILayout.Height(50)); + GUI.DrawTexture(rect, imageInspector, ScaleMode.ScaleToFit, true); + } + DrawLine(Color.grey, 1, 3); + } + + public static Texture2D GetInspectorImage() => GetImage(CUSTOM_EDITOR_HEADER); + + private static Texture2D GetImage(string textureName) + { + string[] guids = AssetDatabase.FindAssets($"{textureName} t:texture"); + if(guids.Length > 0) + { + string path = AssetDatabase.GUIDToAssetPath(guids[0]); + return AssetDatabase.LoadAssetAtPath(path); + } + return null; + } + + private void ShowAssetImageOptionsToggle() + { + GUILayout.Label("Asset Image Display Options", bigLabel); + GUILayout.Space(20); + + int previousImageType = (int) imageType; + imageType = (ImageType) EditorGUILayout.EnumPopup(imageType, GUILayout.MaxWidth(200)); + if((int) imageType != previousImageType) EditorPrefs.SetInt("allIn1ImageConfig", (int) imageType); + + DrawLine(Color.grey, 1, 3); + } + + private void DefaultAssetShader() + { + GUILayout.Label("Default Asset Shader", bigLabel); + GUILayout.Space(20); + GUILayout.Label("This is the shader variant that will be assigned by default to Sprites and UI Images when the asset component is added", EditorStyles.boldLabel); + + bool isUrp = false; + Shader temp = FindShader("AllIn1Urp2dRenderer"); + if (temp != null) isUrp = true; + + shaderTypes = (AllIn1Shader.ShaderTypes)PlayerPrefs.GetInt("allIn1DefaultShader"); + int previousShaderType = (int)shaderTypes; + shaderTypes = (AllIn1Shader.ShaderTypes)EditorGUILayout.EnumPopup(shaderTypes, GUILayout.MaxWidth(200)); + + if (previousShaderType != (int)shaderTypes) + { + if (!isUrp && shaderTypes == AllIn1Shader.ShaderTypes.Urp2dRenderer) + { + showUrpWarning = true; + warningTime = EditorApplication.timeSinceStartup + 5; + } + else + { + PlayerPrefs.SetInt("allIn1DefaultShader", (int)shaderTypes); + showUrpWarning = false; + } + } + + if (warningTime < EditorApplication.timeSinceStartup) showUrpWarning = false; + if (isUrp) showUrpWarning = false; + if (!isUrp && !showUrpWarning && shaderTypes == AllIn1Shader.ShaderTypes.Urp2dRenderer) + { + showUrpWarning = true; + warningTime = EditorApplication.timeSinceStartup + 5; + shaderTypes = AllIn1Shader.ShaderTypes.Default; + PlayerPrefs.SetInt("allIn1DefaultShader", (int)shaderTypes); + } + + if (showUrpWarning) EditorGUILayout.HelpBox( + "You can't set the URP 2D Renderer variant since you didn't import the URP package available in the asset root folder (SEE DOCUMENTATION)", + MessageType.Error, + true); + } + + private void NormalMapCreator() + { + GUILayout.Label("Normal Map Creator", bigLabel); + + GUILayout.Space(20); + GUILayout.Label("Select the folder where new Normal Maps will be saved when the Create Normal Map button of the asset component is pressed (URP only)", EditorStyles.boldLabel); + HandleSaveFolderEditorPref("All1ShaderNormals", basePath + normalMapSavesRelativePath, "Normal Maps"); + + GUILayout.Space(20); + GUILayout.Label("Assign a sprite you want to create a normal map from. Choose the normal map settings and press the 'Create And Save Normal Map' button", EditorStyles.boldLabel); + targetNormalImage = (Texture2D)EditorGUILayout.ObjectField("Target Image", targetNormalImage, typeof(Texture2D), false, GUILayout.MaxWidth(225)); + + EditorGUILayout.BeginHorizontal(); + { + GUILayout.Label("Normal Strength:", GUILayout.MaxWidth(150)); + normalStrength = EditorGUILayout.Slider(normalStrength, 1f, 20f, GUILayout.MaxWidth(400)); + } + EditorGUILayout.EndHorizontal(); + + EditorGUILayout.BeginHorizontal(); + { + GUILayout.Label("Normal Smoothing:", GUILayout.MaxWidth(150)); + normalSmoothing = EditorGUILayout.IntSlider(normalSmoothing, 0, 3, GUILayout.MaxWidth(400)); + } + EditorGUILayout.EndHorizontal(); + + if (isComputingNormals == 0) + { + if (targetNormalImage != null) + { + if (GUILayout.Button("Create And Save Normal Map")) + { + isComputingNormals = 1; + return; + } + } + else + { + GUILayout.Label("Add a Target Image to use this feature", EditorStyles.boldLabel); + } + } + else + { + GUILayout.Label("Normal Map is currently being created, be patient", EditorStyles.boldLabel, GUILayout.Height(40)); + Repaint(); + isComputingNormals++; + if (isComputingNormals > 5) + { + string assetPath = AssetDatabase.GetAssetPath(targetNormalImage); + var tImporter = AssetImporter.GetAtPath(assetPath) as TextureImporter; + if (tImporter != null) + { + tImporter.isReadable = true; + tImporter.SaveAndReimport(); + } + + Texture2D normalToSave = CreateNormalMap(targetNormalImage, normalStrength, normalSmoothing); + + string prefSavedPath = PlayerPrefs.GetString("All1ShaderNormals") + "/"; + string path = prefSavedPath + "NormalMap.png"; + if(System.IO.File.Exists(path)) path = GetNewValidPath(path); + string texName = path.Replace(prefSavedPath, ""); + + path = EditorUtility.SaveFilePanel("Save texture as PNG", prefSavedPath, texName, "png"); + //If you are reading this you might have encountered an error in Unity 2022 Mac builds, if that's the case comment the line above and uncomment the line below + //path = prefSavedPath + texName + ".png"; + + if (path.Length != 0) + { + byte[] pngData = normalToSave.EncodeToPNG(); + if (pngData != null) File.WriteAllBytes(path, pngData); + AssetDatabase.Refresh(); + + if (path.IndexOf("Assets/") >= 0) + { + string subPath = path.Substring(path.IndexOf("Assets/")); + TextureImporter importer = AssetImporter.GetAtPath(subPath) as TextureImporter; + if (importer != null) + { + Debug.Log("Normal Map saved inside the project: " + subPath); + importer.filterMode = FilterMode.Bilinear; + importer.textureType = TextureImporterType.NormalMap; + importer.wrapMode = TextureWrapMode.Repeat; + importer.SaveAndReimport(); + EditorGUIUtility.PingObject(AssetDatabase.LoadAssetAtPath(subPath, typeof(Texture))); + } + } + else Debug.Log("Normal Map saved outside the project: " + path); + } + isComputingNormals = 0; + } + } + GUILayout.Label("*This process will freeze the editor for some seconds, larger images will take longer", EditorStyles.boldLabel); + } + + private void HandleSaveFolderEditorPref(string keyName, string defaultPath, string logsFeatureName) + { + if (!PlayerPrefs.HasKey(keyName)) PlayerPrefs.SetString(keyName, defaultPath); + materialTargetFolder = (DefaultAsset)AssetDatabase.LoadAssetAtPath(PlayerPrefs.GetString(keyName), typeof(DefaultAsset)); + if (materialTargetFolder == null) + { + PlayerPrefs.SetString(keyName, defaultPath); + materialTargetFolder = (DefaultAsset)AssetDatabase.LoadAssetAtPath(PlayerPrefs.GetString(keyName), typeof(DefaultAsset)); + if (materialTargetFolder == null) + { + materialTargetFolder = (DefaultAsset)AssetDatabase.LoadAssetAtPath("Assets/", typeof(DefaultAsset)); + if(materialTargetFolder == null) + { + EditorGUILayout.BeginHorizontal(GUILayout.MaxWidth(600)); + EditorGUILayout.HelpBox("Folder is invalid, please select a valid one", MessageType.Error, true); + EditorGUILayout.EndHorizontal(); + } + else PlayerPrefs.SetString("Assets/", defaultPath); + } + } + materialTargetFolder = (DefaultAsset)EditorGUILayout.ObjectField("New " + logsFeatureName + " Folder", + materialTargetFolder, typeof(DefaultAsset), false, GUILayout.MaxWidth(500)); + + if (materialTargetFolder != null && IsAssetAFolder(materialTargetFolder)) + { + string path = AssetDatabase.GetAssetPath(materialTargetFolder); + PlayerPrefs.SetString(keyName, path); + EditorGUILayout.BeginHorizontal(GUILayout.MaxWidth(600)); + EditorGUILayout.HelpBox("Valid folder! " + logsFeatureName + " save path: " + path, MessageType.Info); + EditorGUILayout.EndHorizontal(); + } + else + { + EditorGUILayout.BeginHorizontal(GUILayout.MaxWidth(600)); + EditorGUILayout.HelpBox("Select the new " + logsFeatureName + " Folder", MessageType.Warning, true); + EditorGUILayout.EndHorizontal(); + } + } + + private void GradientCreator() + { + GUILayout.Label("Gradient Creator", bigLabel); + GUILayout.Space(20); + GUILayout.Label("This feature can be used to create textures for the Color Ramp Effect", EditorStyles.boldLabel); + + EditorGUILayout.GradientField("Gradient", gradient, GUILayout.Height(25), GUILayout.MaxWidth(500)); + + EditorGUILayout.BeginHorizontal(); + { + GUILayout.Label("Texture Size:", GUILayout.MaxWidth(145)); + textureSizes = (TextureSizes)EditorGUILayout.EnumPopup(textureSizes, GUILayout.MaxWidth(200)); + } + EditorGUILayout.EndHorizontal(); + + int textureSize = (int)textureSizes; + Texture2D gradTex = new Texture2D(textureSize, 1, TextureFormat.RGBA32, false); + for (int i = 0; i < textureSize; i++) gradTex.SetPixel(i, 0, gradient.Evaluate((float)i / (float)textureSize)); + gradTex.Apply(); + + GUILayout.Space(20); + GUILayout.Label("Select the folder where new Gradient Textures will be saved", EditorStyles.boldLabel); + HandleSaveFolderEditorPref("All1ShaderGradients", basePath + gradientSavesRelativePath, "Gradient"); + + string prefSavedPath = PlayerPrefs.GetString("All1ShaderGradients") + "/"; + if (Directory.Exists(prefSavedPath)) + { + EditorGUILayout.BeginHorizontal(); + { + GUILayout.Label("Gradient Texture Filtering: ", GUILayout.MaxWidth(170)); + gradientFiltering = (FilterMode)EditorGUILayout.EnumPopup(gradientFiltering, GUILayout.MaxWidth(200)); + } + EditorGUILayout.EndHorizontal(); + + if (GUILayout.Button("Save Gradient Texture", GUILayout.MaxWidth(500))) + { + string path = prefSavedPath + "ColorGradient.png"; + if(System.IO.File.Exists(path)) path = GetNewValidPath(path); + string texName = path.Replace(prefSavedPath, ""); + + path = EditorUtility.SaveFilePanel("Save texture as PNG", prefSavedPath, texName, "png"); + if (path.Length != 0) + { + byte[] pngData = gradTex.EncodeToPNG(); + if (pngData != null) File.WriteAllBytes(path, pngData); + AssetDatabase.Refresh(); + + if (path.IndexOf("Assets/") >= 0) + { + string subPath = path.Substring(path.IndexOf("Assets/")); + TextureImporter importer = AssetImporter.GetAtPath(subPath) as TextureImporter; + if (importer != null) + { + Debug.Log("Gradient saved inside the project: " + subPath); + importer.filterMode = gradientFiltering; + importer.SaveAndReimport(); + EditorGUIUtility.PingObject(AssetDatabase.LoadAssetAtPath(subPath, typeof(Texture))); + } + } + else Debug.Log("Gradient saved outside the project: " + path); + } + } + } + } + + private static bool IsAssetAFolder(Object obj) + { + string path = ""; + + if (obj == null) return false; + + path = AssetDatabase.GetAssetPath(obj.GetInstanceID()); + + if (path.Length > 0) + { + if (Directory.Exists(path)) return true; + else return false; + } + return false; + } + + private static string GetNewValidPath(string path, string extension = ".png", int i = 1) + { + int number = i; + path = path.Replace(extension, ""); + string newPath = path + "_" + number.ToString(); + string fullPath = newPath + extension; + if(File.Exists(fullPath)) + { + number++; + fullPath = GetNewValidPath(path, extension, number); + } + + return fullPath; + } + + private void DrawLine(Color color, int thickness = 2, int padding = 10) + { + Rect r = EditorGUILayout.GetControlRect(GUILayout.Height(padding + thickness)); + r.height = thickness; + r.y += (padding / 2); + r.x -= 2; + r.width += 6; + EditorGUI.DrawRect(r, color); + } + + public static Texture2D CreateNormalMap(Texture2D t, float normalMult = 5f, int normalSmooth = 0) + { + int width = t.width; + int height = t.height; + Color[] sourcePixels = t.GetPixels(); + Color[] resultPixels = new Color[width * height]; + Vector3 vScale = new Vector3(0.3333f, 0.3333f, 0.3333f); + + for(int y = 0; y < height; y++) + { + for(int x = 0; x < width; x++) + { + int index = x + y * width; + Vector3 cSampleNegXNegY = GetPixelClamped(sourcePixels, x - 1, y - 1, width, height); + Vector3 cSampleZerXNegY = GetPixelClamped(sourcePixels, x, y - 1, width, height); + Vector3 cSamplePosXNegY = GetPixelClamped(sourcePixels, x + 1, y - 1, width, height); + Vector3 cSampleNegXZerY = GetPixelClamped(sourcePixels, x - 1, y, width, height); + Vector3 cSamplePosXZerY = GetPixelClamped(sourcePixels, x + 1, y, width, height); + Vector3 cSampleNegXPosY = GetPixelClamped(sourcePixels, x - 1, y + 1, width, height); + Vector3 cSampleZerXPosY = GetPixelClamped(sourcePixels, x, y + 1, width, height); + Vector3 cSamplePosXPosY = GetPixelClamped(sourcePixels, x + 1, y + 1, width, height); + + float fSampleNegXNegY = Vector3.Dot(cSampleNegXNegY, vScale); + float fSampleZerXNegY = Vector3.Dot(cSampleZerXNegY, vScale); + float fSamplePosXNegY = Vector3.Dot(cSamplePosXNegY, vScale); + float fSampleNegXZerY = Vector3.Dot(cSampleNegXZerY, vScale); + float fSamplePosXZerY = Vector3.Dot(cSamplePosXZerY, vScale); + float fSampleNegXPosY = Vector3.Dot(cSampleNegXPosY, vScale); + float fSampleZerXPosY = Vector3.Dot(cSampleZerXPosY, vScale); + float fSamplePosXPosY = Vector3.Dot(cSamplePosXPosY, vScale); + + float edgeX = (fSampleNegXNegY - fSamplePosXNegY) * 0.25f + (fSampleNegXZerY - fSamplePosXZerY) * 0.5f + (fSampleNegXPosY - fSamplePosXPosY) * 0.25f; + float edgeY = (fSampleNegXNegY - fSampleNegXPosY) * 0.25f + (fSampleZerXNegY - fSampleZerXPosY) * 0.5f + (fSamplePosXNegY - fSamplePosXPosY) * 0.25f; + + Vector2 vEdge = new Vector2(edgeX, edgeY) * normalMult; + Vector3 norm = new Vector3(vEdge.x, vEdge.y, 1.0f).normalized; + resultPixels[index] = new Color(norm.x * 0.5f + 0.5f, norm.y * 0.5f + 0.5f, norm.z * 0.5f + 0.5f, 1); + } + } + + if(normalSmooth > 0) + { + resultPixels = SmoothNormals(resultPixels, width, height, normalSmooth); + } + + Texture2D texNormal = new Texture2D(width, height, TextureFormat.RGB24, false, false); + texNormal.SetPixels(resultPixels); + texNormal.Apply(); + return texNormal; + } + + private static Vector3 GetPixelClamped(Color[] pixels, int x, int y, int width, int height) + { + x = Mathf.Clamp(x, 0, width - 1); + y = Mathf.Clamp(y, 0, height - 1); + Color c = pixels[x + y * width]; + return new Vector3(c.r, c.g, c.b); + } + + private static Color[] SmoothNormals(Color[] pixels, int width, int height, int normalSmooth) + { + Color[] smoothedPixels = new Color[pixels.Length]; + float step = 0.00390625f * normalSmooth; + + for(int y = 0; y < height; y++) + { + for(int x = 0; x < width; x++) + { + float pixelsToAverage = 0.0f; + Color c = pixels[x + y * width]; + pixelsToAverage++; + + for(int offsetY = -normalSmooth; offsetY <= normalSmooth; offsetY++) + { + for(int offsetX = -normalSmooth; offsetX <= normalSmooth; offsetX++) + { + if(offsetX == 0 && offsetY == 0) continue; + + int sampleX = Mathf.Clamp(x + offsetX, 0, width - 1); + int sampleY = Mathf.Clamp(y + offsetY, 0, height - 1); + + c += pixels[sampleX + sampleY * width]; + pixelsToAverage++; + } + } + + smoothedPixels[x + y * width] = c / pixelsToAverage; + } + } + + return smoothedPixels; + } + + [MenuItem("Assets/Create/AllIn1Shader Materials/CreateDefaultMaterial")] + public static void CreateDefaultMaterial() + { + CreateMaterial("AllIn1SpriteShader"); + } + + [MenuItem("Assets/Create/AllIn1Shader Materials/CreateScaledTimeMaterial")] + public static void CreateScaledTimeMaterial() + { + CreateMaterial("AllIn1SpriteShaderScaledTime"); + } + + [MenuItem("Assets/Create/AllIn1Shader Materials/CreateUiMaskMaterial")] + public static void CreateUiMaskMaterial() + { + CreateMaterial("AllIn1SpriteShaderUiMask"); + } + + private static void CreateMaterial(string shaderName) + { + string selectedPath = AssetDatabase.GetAssetPath(Selection.activeObject); + + if(!string.IsNullOrEmpty(selectedPath) && Directory.Exists(selectedPath)) + { + Material material = new Material(FindShader(shaderName)); + string fullPath = selectedPath + "/Mat-" + shaderName + ".mat"; + if(File.Exists(fullPath)) fullPath = GetNewValidPath(fullPath, ".mat"); + AssetDatabase.CreateAsset(material, fullPath); + AssetDatabase.Refresh(); + } + else + { + Debug.LogWarning("Please select a valid folder in the Project Window."); + } + } + + private void OnEnable() => GetBasePath(); + + private static void GetBasePath() + { + string[] guids = AssetDatabase.FindAssets("t:folder AllIn1SpriteShader"); + if(guids.Length > 0) + { + basePath = AssetDatabase.GUIDToAssetPath(guids[0]); + } + else + { + Debug.LogError("AllIn1SpriteShader folder not found in the project."); + basePath = "Assets/Plugins/AllIn1SpriteShader"; + } + } + + public static string GetMaterialSavePath() + { + if(!PlayerPrefs.HasKey("All1ShaderMaterials")) + { + GetBasePath(); + return basePath + materialsSavesRelativePath; + } + return PlayerPrefs.GetString("All1ShaderMaterials"); + } + + public static string GetRenderImageSavePath() + { + if(!PlayerPrefs.HasKey("All1ShaderRenderImages")) + { + GetBasePath(); + return basePath + renderImagesSavesRelativePath; + } + return PlayerPrefs.GetString("All1ShaderRenderImages"); + } + + public static string GetNormalMapSavePath() + { + if(!PlayerPrefs.HasKey("All1ShaderNormals")) + { + GetBasePath(); + return basePath + normalMapSavesRelativePath; + } + return PlayerPrefs.GetString("All1ShaderNormals"); + } + + private void SceneNotificationsToggle() + { + float previousLabelWidth = EditorGUIUtility.labelWidth; + EditorGUIUtility.labelWidth = 200f; + bool areNotificationsEnabled = EditorPrefs.GetInt("DisplaySceneViewNotifications", 1) == 1; + areNotificationsEnabled = EditorGUILayout.Toggle("Display Scene View Notifications", areNotificationsEnabled); + EditorPrefs.SetInt("DisplaySceneViewNotifications", areNotificationsEnabled ? 1 : 0); + EditorGUIUtility.labelWidth = previousLabelWidth; + } + + private static void RefreshLitShader() + { + GUILayout.Label("Force the Lit Shader to be reconfigured"); + GUILayout.Label("If you are getting some error or have changed the render pipeline press the button below"); + if (GUILayout.Button("Refresh Lit Shader", GUILayout.MaxWidth(500f))) + { + AllIn1ShaderImporter.ForceReimport(); + } + } + + public static void SceneViewNotificationAndLog(string message) + { + Debug.Log(message); + ShowSceneViewNotification(message); + } + + public static void ShowSceneViewNotification(string message) + { + bool showNotification = EditorPrefs.GetInt("DisplaySceneViewNotifications", 1) == 1; + if(!showNotification) return; + + GUIContent content = new GUIContent(message); + #if UNITY_2019_1_OR_NEWER + SceneView.lastActiveSceneView.ShowNotification(content, 1.5f); + #else + SceneView.lastActiveSceneView.ShowNotification(content); + #endif + } + + public static Shader FindShader(string shaderName) + { + string[] guids = AssetDatabase.FindAssets($"{shaderName} t:shader"); + foreach(string guid in guids) + { + string path = AssetDatabase.GUIDToAssetPath(guid); + Shader shader = AssetDatabase.LoadAssetAtPath(path); + if(shader != null) + { + string fullShaderName = shader.name; + string actualShaderName = fullShaderName.Substring(fullShaderName.LastIndexOf('/') + 1); + if(actualShaderName.Equals(shaderName)) return shader; + } + } + return null; + } + } +} +#endif \ No newline at end of file diff --git a/Assets/Plugins/AllIn1SpriteShader/Scripts/AllIn1ShaderWindow.cs.meta b/Assets/Plugins/AllIn1SpriteShader/Scripts/AllIn1ShaderWindow.cs.meta new file mode 100644 index 000000000..b5b961faa --- /dev/null +++ b/Assets/Plugins/AllIn1SpriteShader/Scripts/AllIn1ShaderWindow.cs.meta @@ -0,0 +1,18 @@ +fileFormatVersion: 2 +guid: b642652081667ab4fad9f2579fec0e51 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 156513 + packageName: All In 1 Sprite Shader + packageVersion: 4.25 + assetPath: Assets/Plugins/AllIn1SpriteShader/Scripts/AllIn1ShaderWindow.cs + uploadId: 708810 diff --git a/Assets/Plugins/AllIn1SpriteShader/Scripts/Editor.meta b/Assets/Plugins/AllIn1SpriteShader/Scripts/Editor.meta new file mode 100644 index 000000000..4d7651e60 --- /dev/null +++ b/Assets/Plugins/AllIn1SpriteShader/Scripts/Editor.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 88005189a0eaefe4aa34961fe0208e26 +folderAsset: yes +timeCreated: 1464994693 +licenseType: Store +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/AllIn1SpriteShader/Scripts/Editor/AllIn1ShaderGradientDrawer.cs b/Assets/Plugins/AllIn1SpriteShader/Scripts/Editor/AllIn1ShaderGradientDrawer.cs new file mode 100644 index 000000000..8cd33e522 --- /dev/null +++ b/Assets/Plugins/AllIn1SpriteShader/Scripts/Editor/AllIn1ShaderGradientDrawer.cs @@ -0,0 +1,282 @@ +#if UNITY_EDITOR +using System; +using System.Linq; +using System.Reflection; +using UnityEditor; +using UnityEngine; +using Object = UnityEngine.Object; + +namespace AllIn1SpriteShader +{ + public class AllIn1ShaderGradientDrawer : MaterialPropertyDrawer + { + private int resolution; + private Texture2D textureAsset; + private static MethodInfo reinitializeMethod; + private static MethodInfo resizeMethod; + + public AllIn1ShaderGradientDrawer() + { + resolution = 64; + } + + public AllIn1ShaderGradientDrawer(float res) + { + resolution = (int)res; + } + + private static bool IsPropertyTypeSuitable(MaterialProperty prop) + { + return prop.type == MaterialProperty.PropType.Texture; + } + + private string TextureName(MaterialProperty prop) => $"z{prop.name}Tex"; + private string OldName(MaterialProperty prop) => $"{prop.name}Tex"; + + public override void OnGUI(Rect position, MaterialProperty prop, GUIContent label, MaterialEditor editor) + { + if (!IsPropertyTypeSuitable(prop)) + { + EditorGUI.HelpBox(position, $"[Gradient] used on non-texture property \"{prop.name}\"", MessageType.Error); + return; + } + + if (!AssetDatabase.Contains(prop.targets.FirstOrDefault())) + { + EditorGUI.HelpBox(position, "Save Material To Folder to use this effect. Or use the regular Color Ramp instead", MessageType.Error); + return; + } + + string textureName = TextureName(prop); + string oldTextureName = OldName(prop); + + Gradient currentGradient = null; + if (prop.targets.Length == 1) + { + Material target = (Material)prop.targets[0]; + string path = AssetDatabase.GetAssetPath(target); + textureAsset = GetTexture(path, textureName, oldTextureName); + if (textureAsset != null) currentGradient = DecodeGradient(prop, textureAsset.name); + if (currentGradient == null) currentGradient = new Gradient() { }; + + EditorGUI.showMixedValue = false; + } + else + { + EditorGUI.showMixedValue = true; + } + + using (EditorGUI.ChangeCheckScope changeScope = new EditorGUI.ChangeCheckScope()) + { + currentGradient = EditorGUILayout.GradientField(label, currentGradient, GUILayout.Height(15)); + + if (changeScope.changed) + { + string encodedGradient = EncodeGradient(currentGradient); + string fullAssetName = textureName + encodedGradient; + foreach (Object target in prop.targets) + { + if (!AssetDatabase.Contains(target)) continue; + + string path = AssetDatabase.GetAssetPath(target); + Texture2D textureAsset = GetTexture(path, textureName, oldTextureName); + Undo.RecordObject(textureAsset, "Change Material Gradient"); + textureAsset.name = fullAssetName; + BakeGradient(currentGradient, textureAsset); + EditorUtility.SetDirty(textureAsset); + + Material material = (Material)target; + material.SetTexture(prop.name, textureAsset); + } + } + } + EditorGUI.showMixedValue = false; + } + + private Texture2D GetTexture(string path, string name, string possibleOldName) + { + textureAsset = GetTextureAsset(path, name); + if(textureAsset == null) + { + textureAsset = GetTextureAsset(path, possibleOldName); + if(textureAsset != null) + { + textureAsset.name = textureAsset.name.Replace(possibleOldName, name); + EditorUtility.SetDirty(textureAsset); + } + } + if (textureAsset == null) CreateTexture(path, name); + if(textureAsset.width != resolution) + { + ResizeTexture(textureAsset, resolution, 1); + EditorUtility.SetDirty(textureAsset); + AssetDatabase.SaveAssets(); + } + return textureAsset; + } + + private void ResizeTexture(Texture2D texture, int width, int height) + { + if(reinitializeMethod == null && resizeMethod == null) + { + reinitializeMethod = typeof(Texture2D).GetMethod("Reinitialize", new[] { typeof(int), typeof(int) }); + if(reinitializeMethod == null) resizeMethod = typeof(Texture2D).GetMethod("Resize", new[] { typeof(int), typeof(int) }); + } + + if(reinitializeMethod != null) reinitializeMethod.Invoke(texture, new object[] { width, height }); + else if(resizeMethod != null) resizeMethod.Invoke(texture, new object[] { width, height }); + } + + private void CreateTexture(string path, string name = "unnamed texture") + { + textureAsset = new Texture2D(resolution, 1, TextureFormat.RGBA32, false); + textureAsset.wrapMode = TextureWrapMode.Clamp; + textureAsset.filterMode = FilterMode.Bilinear; + textureAsset.name = name; + AssetDatabase.AddObjectToAsset(textureAsset, path); + AssetDatabase.Refresh(); + } + + private string EncodeGradient(Gradient gradient) + { + if (gradient == null) return null; + return JsonUtility.ToJson(new GradientRepresentation(gradient)); + } + + private Gradient DecodeGradient(MaterialProperty prop, string name) + { + string json = name.Substring(TextureName(prop).Length); + try + { + return JsonUtility.FromJson(json).ToGradient(); + } + catch (Exception) + { + return null; + } + } + + private Texture2D GetTextureAsset(string path, string name) + { + return AssetDatabase.LoadAllAssetsAtPath(path).FirstOrDefault(asset => asset.name.StartsWith(name)) as Texture2D; + } + + private void BakeGradient(Gradient gradient, Texture2D texture) + { + if (gradient == null) return; + for (int x = 0; x < texture.width; x++) + { + Color color = gradient.Evaluate((float)x / (texture.width - 1)); + for (int y = 0; y < texture.height; y++) texture.SetPixel(x, y, color); + } + texture.Apply(); + } + + [MenuItem("Assets/AllIn1Shader Gradients/Remove All Gradient Textures")] + static void RemoveAllSubassets() + { + foreach(Object asset in Selection.GetFiltered(SelectionMode.Assets)) + { + string path = AssetDatabase.GetAssetPath(asset); + AssetDatabase.ImportAsset(path); + foreach(Object subAsset in AssetDatabase.LoadAllAssetRepresentationsAtPath(path)) + { + Object.DestroyImmediate(subAsset, true); + } + AssetDatabase.ImportAsset(path); + } + } + + class GradientRepresentation + { + public GradientMode mode; + public ColorKey[] colorKeys; + public AlphaKey[] alphaKeys; + + public GradientRepresentation() { } + + public GradientRepresentation(Gradient source) + { + FromGradient(source); + } + + private void FromGradient(Gradient source) + { + mode = source.mode; + colorKeys = source.colorKeys.Select(key => new ColorKey(key)).ToArray(); + alphaKeys = source.alphaKeys.Select(key => new AlphaKey(key)).ToArray(); + } + + private void ToGradient(Gradient gradient) + { + gradient.mode = mode; + gradient.colorKeys = colorKeys.Select(key => key.ToGradientKey()).ToArray(); + gradient.alphaKeys = alphaKeys.Select(key => key.ToGradientKey()).ToArray(); + } + + public Gradient ToGradient() + { + Gradient gradient = new Gradient(); + ToGradient(gradient); + return gradient; + } + + [Serializable] + public struct ColorKey + { + public Color color; + public float time; + + public ColorKey(GradientColorKey source) + { + color = default; + time = default; + FromGradientKey(source); + } + + public void FromGradientKey(GradientColorKey source) + { + color = source.color; + time = source.time; + } + + public GradientColorKey ToGradientKey() + { + GradientColorKey key; + key.color = color; + key.time = time; + return key; + } + } + + [Serializable] + public struct AlphaKey + { + public float alpha; + public float time; + + public AlphaKey(GradientAlphaKey source) + { + alpha = default; + time = default; + FromGradientKey(source); + } + + public void FromGradientKey(GradientAlphaKey source) + { + alpha = source.alpha; + time = source.time; + } + + public GradientAlphaKey ToGradientKey() + { + GradientAlphaKey key; + key.alpha = alpha; + key.time = time; + return key; + } + } + } + } +} +#endif \ No newline at end of file diff --git a/Assets/Plugins/AllIn1SpriteShader/Scripts/Editor/AllIn1ShaderGradientDrawer.cs.meta b/Assets/Plugins/AllIn1SpriteShader/Scripts/Editor/AllIn1ShaderGradientDrawer.cs.meta new file mode 100644 index 000000000..eba29a30f --- /dev/null +++ b/Assets/Plugins/AllIn1SpriteShader/Scripts/Editor/AllIn1ShaderGradientDrawer.cs.meta @@ -0,0 +1,18 @@ +fileFormatVersion: 2 +guid: c51263ea47edd3641a26e5f242925bcf +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 156513 + packageName: All In 1 Sprite Shader + packageVersion: 4.25 + assetPath: Assets/Plugins/AllIn1SpriteShader/Scripts/Editor/AllIn1ShaderGradientDrawer.cs + uploadId: 708810 diff --git a/Assets/Plugins/AllIn1SpriteShader/Scripts/Editor/AllIn1ShaderImporter.cs b/Assets/Plugins/AllIn1SpriteShader/Scripts/Editor/AllIn1ShaderImporter.cs new file mode 100644 index 000000000..c3c9401bf --- /dev/null +++ b/Assets/Plugins/AllIn1SpriteShader/Scripts/Editor/AllIn1ShaderImporter.cs @@ -0,0 +1,206 @@ +#if UNITY_EDITOR +using System; +using System.IO; +using UnityEditor; +using UnityEngine; +using UnityEngine.Rendering; + +[InitializeOnLoad] +public static class AllIn1ShaderImporter +{ + public enum UnityVersion + { + NONE = 0, + UNITY_2019 = 1, + UNITY_2020 = 2, + UNITY_2021 = 3, + UNITY_2022 = 4, + UNITY_6 = 5, + } + + public enum RenderPipeline + { + NONE = -1, + BIRP = 0, + URP = 1, + HDRP = 2, + } + + private const string LIT_SHADER_PIPELINE_KEY = "AllIn1SpriteShader_LitShader_RenderPipeline"; + private const string LIT_SHADER_UNITY_VERSION_KEY = "AllIn1SpriteShader_LitShader_UnityVersion"; + private const string LIT_SHADER_FIRST_TIME_PROJECT = "AllIn1SpriteShader_LitShader_FirstTimeProject"; + + private const string LIT_SHADER_PATH = "../../Shaders/AllIn1SpriteShaderLit.shader"; + + private const string SHADER_PATH_STANDARD = "../../Shaders/LitShaders/AllIn1SpriteShaderLit_BetterShader_Standard.txt"; + + private const string SHADER_PATH_URP_2019 = "../../Shaders/LitShaders/AllIn1SpriteShaderLit_BetterShader_URP2019.txt"; + private const string SHADER_PATH_HDRP_2019 = "../../Shaders/LitShaders/AllIn1SpriteShaderLit_HDRP2019.txt"; + + private const string SHADER_PATH_URP_2020 = "../../Shaders/LitShaders/AllIn1SpriteShaderLit_BetterShader_URP2020.txt"; + private const string SHADER_PATH_HDRP_2020 = "../../Shaders/LitShaders/AllIn1SpriteShaderLit_BetterShader_HDRP2020.txt"; + + private const string SHADER_PATH_URP_2021 = "../../Shaders/LitShaders/AllIn1SpriteShaderLit_BetterShader_URP2021.txt"; + private const string SHADER_PATH_HDRP_2021 = "../../Shaders/LitShaders/AllIn1SpriteShaderLit_BetterShader_HDRP2021.txt"; + + private const string SHADER_PATH_URP_2022 = "../../Shaders/LitShaders/AllIn1SpriteShaderLit_BetterShader_URP2022.txt"; + private const string SHADER_PATH_HDRP_2022 = "../../Shaders/LitShaders/AllIn1SpriteShaderLit_BetterShader_HDRP2022.txt"; + + private const string SHADER_PATH_URP_2023 = "../../Shaders/LitShaders/AllIn1SpriteShaderLit_BetterShader_URP2023.txt"; + private const string SHADER_PATH_HDRP_2023 = "../../Shaders/LitShaders/AllIn1SpriteShaderLit_BetterShader_HDRP2023.txt"; + + static AllIn1ShaderImporter() + { + EditorApplication.quitting += Quit; + + ConfigureShader(); + } + + private static void Quit() + { + EditorPrefs.DeleteKey(LIT_SHADER_FIRST_TIME_PROJECT); + } + + private static void ConfigureShader() + { + RenderPipelineChecker.RefreshData(); + + string shaderPath = string.Empty; + + UnityVersion unityVersion = GetUnityVersion(); + RenderPipeline renderPipeline = GetRenderPipeline(); + + if (renderPipeline == RenderPipeline.HDRP) + { + switch (unityVersion) + { + case UnityVersion.UNITY_2019: + shaderPath = SHADER_PATH_HDRP_2019; + break; + case UnityVersion.UNITY_2020: + shaderPath = SHADER_PATH_HDRP_2020; + break; + case UnityVersion.UNITY_2021: + shaderPath = SHADER_PATH_HDRP_2021; + break; + case UnityVersion.UNITY_2022: + shaderPath = SHADER_PATH_HDRP_2022; + break; + case UnityVersion.UNITY_6: + shaderPath = SHADER_PATH_HDRP_2023; + break; + + } + } + else if (renderPipeline == RenderPipeline.URP) + { + switch (unityVersion) + { + case UnityVersion.UNITY_2019: + shaderPath = SHADER_PATH_URP_2019; + break; + case UnityVersion.UNITY_2020: + shaderPath = SHADER_PATH_URP_2020; + break; + case UnityVersion.UNITY_2021: + shaderPath = SHADER_PATH_URP_2021; + break; + case UnityVersion.UNITY_2022: + shaderPath = SHADER_PATH_URP_2022; + break; + case UnityVersion.UNITY_6: + shaderPath = SHADER_PATH_URP_2023; + break; + } + } + else + { + shaderPath = SHADER_PATH_STANDARD; + } + + RenderPipeline lastRenderPipeline = (RenderPipeline)EditorPrefs.GetInt(LIT_SHADER_PIPELINE_KEY, -1); + UnityVersion lastUnityVersion = (UnityVersion)EditorPrefs.GetInt(LIT_SHADER_UNITY_VERSION_KEY, 0); + int firstTimeProject = EditorPrefs.GetInt(LIT_SHADER_FIRST_TIME_PROJECT, -1); + + if (lastRenderPipeline != renderPipeline || lastUnityVersion != unityVersion || firstTimeProject != 1) + { + EditorPrefs.SetInt(LIT_SHADER_PIPELINE_KEY, (int)renderPipeline); + EditorPrefs.SetInt(LIT_SHADER_UNITY_VERSION_KEY, (int)unityVersion); + EditorPrefs.SetInt(LIT_SHADER_FIRST_TIME_PROJECT, 1); + + try + { + var currentFileGUID = AssetDatabase.FindAssets($"t:Script {nameof(AllIn1ShaderImporter)}")[0]; + string currentFolder = Path.GetDirectoryName(AssetDatabase.GUIDToAssetPath(currentFileGUID)); + + string newShaderStr = File.ReadAllText(Path.Combine(currentFolder, shaderPath)); + newShaderStr = newShaderStr.Replace("Shader \"AllIn1SpriteShader/AllIn1SpriteShaderLit_BetterShader\"", "Shader \"AllIn1SpriteShader/AllIn1SpriteShaderLit\""); + + File.WriteAllText(Path.Combine(currentFolder, LIT_SHADER_PATH), newShaderStr); + + AssetDatabase.SaveAssets(); + AssetDatabase.Refresh(); + } + catch (Exception e) + { + Debug.LogError("Shader not found: " + e); + } + } + } + + private static UnityVersion GetUnityVersion() + { + UnityVersion res = UnityVersion.NONE; + + string unityVersion = Application.unityVersion; + + if (unityVersion.Contains("2019")) + { + res = UnityVersion.UNITY_2019; + } + else if (unityVersion.Contains("2020")) + { + res = UnityVersion.UNITY_2020; + } + else if (unityVersion.Contains("2021")) + { + res = UnityVersion.UNITY_2021; + } + else if (unityVersion.Contains("2022")) + { + res = UnityVersion.UNITY_2022; + } + else if (unityVersion.Contains("6000")) + { + res = UnityVersion.UNITY_6; + } + + return res; + } + + private static RenderPipeline GetRenderPipeline() + { + RenderPipeline res = RenderPipeline.BIRP; + + if (RenderPipelineChecker.IsURP) + { + res = RenderPipeline.URP; + } + else if (RenderPipelineChecker.IsHDRP) + { + res = RenderPipeline.HDRP; + } + + return res; + } + + public static void ForceReimport() + { + EditorPrefs.DeleteKey(LIT_SHADER_PIPELINE_KEY); + EditorPrefs.DeleteKey(LIT_SHADER_UNITY_VERSION_KEY); + EditorPrefs.DeleteKey(LIT_SHADER_FIRST_TIME_PROJECT); + + ConfigureShader(); + } +} +#endif \ No newline at end of file diff --git a/Assets/Plugins/AllIn1SpriteShader/Scripts/Editor/AllIn1ShaderImporter.cs.meta b/Assets/Plugins/AllIn1SpriteShader/Scripts/Editor/AllIn1ShaderImporter.cs.meta new file mode 100644 index 000000000..ac300a8bf --- /dev/null +++ b/Assets/Plugins/AllIn1SpriteShader/Scripts/Editor/AllIn1ShaderImporter.cs.meta @@ -0,0 +1,18 @@ +fileFormatVersion: 2 +guid: aa9d501412652444c8b5b573248c31be +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 156513 + packageName: All In 1 Sprite Shader + packageVersion: 4.25 + assetPath: Assets/Plugins/AllIn1SpriteShader/Scripts/Editor/AllIn1ShaderImporter.cs + uploadId: 708810 diff --git a/Assets/Plugins/AllIn1SpriteShader/Scripts/Editor/AllIn1ShaderScriptEditor.cs b/Assets/Plugins/AllIn1SpriteShader/Scripts/Editor/AllIn1ShaderScriptEditor.cs new file mode 100644 index 000000000..b21c02678 --- /dev/null +++ b/Assets/Plugins/AllIn1SpriteShader/Scripts/Editor/AllIn1ShaderScriptEditor.cs @@ -0,0 +1,324 @@ +#if UNITY_EDITOR +using UnityEditor; +using UnityEngine; +using UnityEngine.UI; +using ShaderType = AllIn1SpriteShader.AllIn1Shader.ShaderTypes; + +namespace AllIn1SpriteShader +{ + [CustomEditor(typeof(AllIn1Shader)), CanEditMultipleObjects] + public class AllIn1ShaderScriptEditor : UnityEditor.Editor + { + private bool showUrpWarning = false; + private double warningTime = 0f; + private SerializedProperty m_NormalStrength, m_NormalSmoothing; + private Texture2D imageInspector; + + private enum ImageType + { + ShowImage, + HideInComponent, + HideEverywhere + } + private ImageType imageType; + + private void OnEnable() + { + m_NormalStrength = serializedObject.FindProperty("normalStrength"); + m_NormalSmoothing = serializedObject.FindProperty("normalSmoothing"); + } + + public override void OnInspectorGUI() + { + ChooseAndDisplayAssetImage(); + + AllIn1Shader myScript = (AllIn1Shader)target; + + SetCurrentShaderType(myScript); + + if (GUILayout.Button("Deactivate All Effects")) + { + for (int i = 0; i < targets.Length; i++) ((AllIn1Shader)targets[i]).ClearAllKeywords(); + AllIn1ShaderWindow.ShowSceneViewNotification("AllIn1SpriteShader: Deactivated All Effects"); + } + + if (GUILayout.Button("New Clean Material")) + { + bool successOperation = true; + for (int i = 0; i < targets.Length; i++) + { + successOperation &= ((AllIn1Shader)targets[i]).TryCreateNew(); + } + if(successOperation) AllIn1ShaderWindow.ShowSceneViewNotification("AllIn1SpriteShader: Clean Material"); + } + + + if (GUILayout.Button("Create New Material With Same Properties (SEE DOC)")) + { + bool successOperation = true; + for (int i = 0; i < targets.Length; i++) + { + successOperation &= ((AllIn1Shader)targets[i]).MakeCopy(); + } + if(successOperation) AllIn1ShaderWindow.ShowSceneViewNotification("AllIn1SpriteShader: Copy Created"); + } + + if (GUILayout.Button("Save Material To Folder (SEE DOC)")) + { + bool successOperation = true; + for(int i = 0; i < targets.Length; i++) + { + successOperation &= ((AllIn1Shader) targets[i]).SaveMaterial(); + } + if(successOperation) AllIn1ShaderWindow.ShowSceneViewNotification("AllIn1SpriteShader: Material Saved"); + } + + if (GUILayout.Button("Apply Material To All Children")) + { + bool successOperation = true; + for(int i = 0; i < targets.Length; i++) + { + successOperation &= ((AllIn1Shader) targets[i]).ApplyMaterialToHierarchy(); + } + if(successOperation) AllIn1ShaderWindow.ShowSceneViewNotification("AllIn1SpriteShader: Material Applied To Children"); + else EditorUtility.DisplayDialog("No children found", "All In 1 Shader component couldn't find any children to this GameObject (" + targets[0].name + ")", "Ok"); + } + + if (myScript.currentShaderType != AllIn1Shader.ShaderTypes.Urp2dRenderer) + { + if (GUILayout.Button("Render Material To Image")) + { + bool successOperation = true; + for(int i = 0; i < targets.Length; i++) + { + successOperation &= ((AllIn1Shader) targets[i]).RenderToImage(); + } + if(successOperation) AllIn1ShaderWindow.ShowSceneViewNotification("AllIn1SpriteShader: Material Rendered To Image"); + } + } + + bool isUrp = false; + Shader temp = AllIn1ShaderWindow.FindShader("AllIn1Urp2dRenderer"); + if (temp != null) isUrp = true; + EditorGUILayout.BeginHorizontal(); + { + GUILayout.Label("Change Shader Variant:", GUILayout.MaxWidth(140)); + int previousShaderType = (int)myScript.currentShaderType; + myScript.currentShaderType = (AllIn1Shader.ShaderTypes)EditorGUILayout.EnumPopup(myScript.currentShaderType); + if (previousShaderType != (int)myScript.currentShaderType) + { + for (int i = 0; i < targets.Length; i++) ((AllIn1Shader)targets[i]).CheckIfValidTarget(); + if (myScript == null) return; + if (isUrp || myScript.currentShaderType != AllIn1Shader.ShaderTypes.Urp2dRenderer) + { + AllIn1ShaderWindow.SceneViewNotificationAndLog(myScript.gameObject.name + " shader variant has been changed to: " + myScript.currentShaderType); + myScript.SetSceneDirty(); + + Renderer sr = myScript.GetComponent(); + if (sr != null) + { + if (sr.sharedMaterial != null) + { + int renderingQueue = sr.sharedMaterial.renderQueue; + if (myScript.currentShaderType == AllIn1Shader.ShaderTypes.Default) sr.sharedMaterial.shader = AllIn1ShaderWindow.FindShader("AllIn1SpriteShader"); + else if (myScript.currentShaderType == AllIn1Shader.ShaderTypes.ScaledTime) sr.sharedMaterial.shader = AllIn1ShaderWindow.FindShader("AllIn1SpriteShaderScaledTime"); + else if (myScript.currentShaderType == AllIn1Shader.ShaderTypes.MaskedUI) sr.sharedMaterial.shader = AllIn1ShaderWindow.FindShader("AllIn1SpriteShaderUiMask"); + else if (myScript.currentShaderType == AllIn1Shader.ShaderTypes.Urp2dRenderer) sr.sharedMaterial.shader = AllIn1ShaderWindow.FindShader("AllIn1Urp2dRenderer"); + else if (myScript.currentShaderType == AllIn1Shader.ShaderTypes.Lit) sr.sharedMaterial.shader = AllIn1ShaderWindow.FindShader("AllIn1SpriteShaderLit"); + else SetCurrentShaderType(myScript); + sr.sharedMaterial.renderQueue = renderingQueue; + + if (myScript.currentShaderType == AllIn1Shader.ShaderTypes.Lit) + { + sr.sharedMaterial.SetFloat("_ZWrite", 1.0f); + sr.shadowCastingMode = UnityEngine.Rendering.ShadowCastingMode.On; + sr.receiveShadows = true; + sr.sharedMaterial.renderQueue = 2000; + } + else + { + sr.sharedMaterial.SetFloat("_ZWrite", 0f); + sr.shadowCastingMode = UnityEngine.Rendering.ShadowCastingMode.Off; + sr.receiveShadows = false; + sr.sharedMaterial.renderQueue = 3000; + } + } + } + else + { + Graphic img = myScript.GetComponent(); + if (img != null && img.material != null) + { + int renderingQueue = img.material.renderQueue; + if (myScript.currentShaderType == AllIn1Shader.ShaderTypes.Default) img.material.shader = AllIn1ShaderWindow.FindShader("AllIn1SpriteShader"); + else if (myScript.currentShaderType == AllIn1Shader.ShaderTypes.ScaledTime) img.material.shader = AllIn1ShaderWindow.FindShader("AllIn1SpriteShaderScaledTime"); + else if (myScript.currentShaderType == AllIn1Shader.ShaderTypes.MaskedUI) img.material.shader = AllIn1ShaderWindow.FindShader("AllIn1SpriteShaderUiMask"); + else if (myScript.currentShaderType == AllIn1Shader.ShaderTypes.Urp2dRenderer) img.material.shader = AllIn1ShaderWindow.FindShader("AllIn1Urp2dRenderer"); + else if (myScript.currentShaderType == AllIn1Shader.ShaderTypes.Lit) img.material.shader = AllIn1ShaderWindow.FindShader("AllIn1SpriteShaderLit"); + else SetCurrentShaderType(myScript); + img.material.renderQueue = renderingQueue; + } + } + } + else if(!isUrp && myScript.currentShaderType == AllIn1Shader.ShaderTypes.Urp2dRenderer) + { + myScript.currentShaderType = (AllIn1Shader.ShaderTypes) previousShaderType; + showUrpWarning = true; + warningTime = EditorApplication.timeSinceStartup + 5; + } + } + } + EditorGUILayout.EndHorizontal(); + + if (warningTime < EditorApplication.timeSinceStartup) showUrpWarning = false; + if (isUrp) showUrpWarning = false; + if (showUrpWarning) EditorGUILayout.HelpBox( + "You can't set the URP 2D Renderer variant since you didn't import the URP package available in the asset root folder (SEE DOCUMENTATION)", + MessageType.Error, + true); + + if ((isUrp && myScript.currentShaderType == AllIn1Shader.ShaderTypes.Urp2dRenderer) || myScript.currentShaderType == AllIn1Shader.ShaderTypes.Lit) + { + EditorGUILayout.Space(); + DrawLine(Color.grey, 1, 3); + EditorGUILayout.Space(); + + if (GUILayout.Button("Create And Add Normal Map")) + { + for (int i = 0; i < targets.Length; i++) ((AllIn1Shader)targets[i]).CreateAndAssignNormalMap(); + AllIn1ShaderWindow.ShowSceneViewNotification("AllIn1SpriteShader: Creating Normal Map"); + + } + serializedObject.Update(); + EditorGUILayout.PropertyField(m_NormalStrength, new GUIContent("Normal Strength"), GUILayout.Height(20)); + EditorGUILayout.PropertyField(m_NormalSmoothing, new GUIContent("Normal Blur"), GUILayout.Height(20)); + if (myScript.computingNormal) + { + EditorGUILayout.LabelField("Normal Map is currently being created, be patient", EditorStyles.boldLabel, GUILayout.Height(40)); + } + serializedObject.ApplyModifiedProperties(); + + EditorGUILayout.Space(); + } + + DrawLine(Color.grey, 1, 3); + EditorGUILayout.Space(); + + if (GUILayout.Button("Sprite Atlas Auto Setup")) + { + bool successOperation = true; + for(int i = 0; i < targets.Length; i++) + { + successOperation &= ((AllIn1Shader) targets[i]).ToggleSetAtlasUvs(true); + } + if(successOperation) AllIn1ShaderWindow.ShowSceneViewNotification("AllIn1SpriteShader: Sprite Atlas Auto Setup"); + } + if (GUILayout.Button("Remove Sprite Atlas Configuration")) + { + bool successOperation = true; + for(int i = 0; i < targets.Length; i++) + { + successOperation &= ((AllIn1Shader) targets[i]).ToggleSetAtlasUvs(false); + } + if(successOperation) AllIn1ShaderWindow.ShowSceneViewNotification("AllIn1SpriteShader: Remove Sprite Atlas Configuration"); + } + +#if LETAI_TRUESHADOW + if (myScript.GetComponent() && !myScript.GetComponent()) + { + EditorGUILayout.Space(); + DrawLine(Color.grey, 1, 3); + if (GUILayout.Button("Add True Shadow Compatibility")) + { + myScript.gameObject.AddComponent(); + myScript.SetSceneDirty(); + } + } +#endif + + EditorGUILayout.Space(); + DrawLine(Color.grey, 1, 3); + + if(GUILayout.Button("Remove Component")) + { + for(int i = targets.Length - 1; i >= 0; i--) + { + DestroyImmediate(targets[i] as AllIn1Shader); + ((AllIn1Shader)targets[i]).SetSceneDirty(); + } + AllIn1ShaderWindow.ShowSceneViewNotification("AllIn1SpriteShader: Component Removed"); + } + + if (GUILayout.Button("REMOVE COMPONENT AND MATERIAL")) + { + for (int i = 0; i < targets.Length; i++) + { + ((AllIn1Shader)targets[i]).CleanMaterial(); + } + for (int i = targets.Length - 1; i >= 0; i--) + { + DestroyImmediate(targets[i] as AllIn1Shader); + } + AllIn1ShaderWindow.ShowSceneViewNotification("AllIn1SpriteShader: Component And Material Removed"); + } + } + + private void ChooseAndDisplayAssetImage() + { + if(!EditorPrefs.HasKey("allIn1ImageConfig")) + { + EditorPrefs.SetInt("allIn1ImageConfig", (int) ImageType.ShowImage); + } + + imageType = (ImageType) EditorPrefs.GetInt("allIn1ImageConfig"); + switch(imageType) + { + case ImageType.ShowImage: + case ImageType.HideInComponent: + if(imageInspector == null) imageInspector = AllIn1ShaderWindow.GetInspectorImage(); + break; + } + + if(imageInspector && imageType != ImageType.HideInComponent && imageType != ImageType.HideEverywhere && imageInspector) + { + Rect rect = EditorGUILayout.GetControlRect(GUILayout.Height(40)); + GUI.DrawTexture(rect, imageInspector, ScaleMode.ScaleToFit, true); + } + } + + private void SetCurrentShaderType(AllIn1Shader myScript) + { + string shaderName = ""; + Renderer sr = myScript.GetComponent(); + if (sr != null) + { + if(sr.sharedMaterial == null) return; + shaderName = sr.sharedMaterial.shader.name; + } + else + { + Graphic img = myScript.GetComponent(); + if(img.material == null) return; + if (img != null) shaderName = img.material.shader.name; + } + shaderName = shaderName.Replace("AllIn1SpriteShader/", ""); + + if (shaderName.Equals("AllIn1SpriteShader")) myScript.currentShaderType = AllIn1Shader.ShaderTypes.Default; + else if (shaderName.Equals("AllIn1SpriteShaderScaledTime")) myScript.currentShaderType = AllIn1Shader.ShaderTypes.ScaledTime; + else if (shaderName.Equals("AllIn1SpriteShaderUiMask")) myScript.currentShaderType = AllIn1Shader.ShaderTypes.MaskedUI; + else if (shaderName.Equals("AllIn1Urp2dRenderer")) myScript.currentShaderType = AllIn1Shader.ShaderTypes.Urp2dRenderer; + else if(shaderName.Equals("AllIn1SpriteShaderLit")) myScript.currentShaderType = AllIn1Shader.ShaderTypes.Lit; + } + + private void DrawLine(Color color, int thickness = 2, int padding = 10) + { + Rect r = EditorGUILayout.GetControlRect(GUILayout.Height(padding + thickness)); + r.height = thickness; + r.y += (padding / 2); + r.x -= 2; + r.width += 6; + EditorGUI.DrawRect(r, color); + } + } +} +#endif \ No newline at end of file diff --git a/Assets/Plugins/AllIn1SpriteShader/Scripts/Editor/AllIn1ShaderScriptEditor.cs.meta b/Assets/Plugins/AllIn1SpriteShader/Scripts/Editor/AllIn1ShaderScriptEditor.cs.meta new file mode 100644 index 000000000..db35c310f --- /dev/null +++ b/Assets/Plugins/AllIn1SpriteShader/Scripts/Editor/AllIn1ShaderScriptEditor.cs.meta @@ -0,0 +1,18 @@ +fileFormatVersion: 2 +guid: 78232fc1cf0e9c445a36b7bf7fc49fdb +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 156513 + packageName: All In 1 Sprite Shader + packageVersion: 4.25 + assetPath: Assets/Plugins/AllIn1SpriteShader/Scripts/Editor/AllIn1ShaderScriptEditor.cs + uploadId: 708810 diff --git a/Assets/Plugins/AllIn1SpriteShader/Scripts/Editor/AllIn1SpriteShaderLitMaterialInspector.cs b/Assets/Plugins/AllIn1SpriteShader/Scripts/Editor/AllIn1SpriteShaderLitMaterialInspector.cs new file mode 100644 index 000000000..8e1871d7a --- /dev/null +++ b/Assets/Plugins/AllIn1SpriteShader/Scripts/Editor/AllIn1SpriteShaderLitMaterialInspector.cs @@ -0,0 +1,829 @@ +#if UNITY_EDITOR +using System.Linq; +using UnityEditor; +using UnityEditor.SceneManagement; +using UnityEngine; +using UnityEngine.Rendering; + +[CanEditMultipleObjects] +public class AllIn1SpriteShaderLitMaterialInspector : ShaderGUI +{ + private Material targetMat; + private BlendMode srcMode, dstMode; + private CompareFunction zTestMode = CompareFunction.LessEqual; + private CullMode cullMode; + + private GUIStyle propertiesStyle, bigLabelStyle, smallLabelStyle, toggleButtonStyle; + private const int bigFontSize = 16, smallFontSize = 11; + private string[] oldKeyWords; + private int effectCount = 1; + private Material originalMaterialCopy; + private MaterialEditor matEditor; + private MaterialProperty[] matProperties; + private uint[] materialDrawers = new uint[] { 1, 2, 4 }; + bool[] currEnabledDrawers; + private const uint advancedConfigDrawer = 0; + private const uint colorFxShapeDrawer = 1; + private const uint uvFxShapeDrawer = 2; + + + + public override void OnGUI(MaterialEditor materialEditor, MaterialProperty[] properties) + { + matEditor = materialEditor; + matProperties = properties; + targetMat = materialEditor.target as Material; + effectCount = 1; + oldKeyWords = targetMat.shaderKeywords; + propertiesStyle = new GUIStyle(EditorStyles.helpBox); + propertiesStyle.margin = new RectOffset(0, 0, 0, 0); + bigLabelStyle = new GUIStyle(EditorStyles.boldLabel); + bigLabelStyle.fontSize = bigFontSize; + smallLabelStyle = new GUIStyle(EditorStyles.boldLabel); + smallLabelStyle.fontSize = smallFontSize; + toggleButtonStyle = new GUIStyle(GUI.skin.button) { alignment = TextAnchor.MiddleCenter, richText = true }; + currEnabledDrawers = new bool[materialDrawers.Length]; + uint iniDrawers = (uint)ShaderGUI.FindProperty("_EditorDrawers", matProperties).floatValue; + for(int i = 0; i < materialDrawers.Length; i++) currEnabledDrawers[i] = (materialDrawers[i] & iniDrawers) > 0; + + GUILayout.Label("General Properties", bigLabelStyle); + DrawProperty(0); + DrawProperty(1); + //DrawProperty(2); + DrawProperty(70); + + currEnabledDrawers[advancedConfigDrawer] = GUILayout.Toggle(currEnabledDrawers[advancedConfigDrawer], new GUIContent("Show Advanced Configuration"), toggleButtonStyle); + if(currEnabledDrawers[advancedConfigDrawer]) + { + + EditorGUILayout.BeginVertical(propertiesStyle); + Culling(); + DrawLine(Color.grey, 1, 3); + ZTest(); + DrawLine(Color.grey, 1, 3); + ZWrite(); + DrawLine(Color.grey, 1, 3); + Billboard("Billboard active", "BILBOARD_ON"); + DrawLine(Color.grey, 1, 3); + SpriteAtlas("Sprite inside an atlas?", "ATLAS_ON"); + DrawLine(Color.grey, 1, 3); + materialEditor.EnableInstancingField(); + DrawLine(Color.grey, 1, 3); + materialEditor.RenderQueueField(); + EditorGUILayout.EndVertical(); + } + + EditorGUILayout.Separator(); + DrawLine(Color.grey, 1, 3); + GUILayout.Label("Light Effect", bigLabelStyle); + GenericEffect("Normal Map", "NORMALMAP_ON", 180, 181); + + EditorGUILayout.Separator(); + DrawLine(Color.grey, 1, 3); + GUILayout.Label("Color Effects", bigLabelStyle); + + currEnabledDrawers[colorFxShapeDrawer] = GUILayout.Toggle(currEnabledDrawers[colorFxShapeDrawer], new GUIContent("Show Color Effects"), toggleButtonStyle); + if(currEnabledDrawers[colorFxShapeDrawer]) + { + Glow("Glow", "GLOW_ON"); + GenericEffect("Fade", "FADE_ON", 7, 13); + Outline("Outline", "OUTBASE_ON"); + GenericEffect("Alpha Outline", "ALPHAOUTLINE_ON", 26, 30, true, "A more performant but less flexible outline"); + InnerOutline("Inner Outline", "INNEROUTLINE_ON", 66, 69); + Gradient("Gradient & Radial Gradient", "GRADIENT_ON"); + GenericEffect("Color Swap", "COLORSWAP_ON", 36, 42, true, "You will need a mask texture (see Documentation)", new int[] { 154 }); + GenericEffect("Hue Shift", "HSV_ON", 43, 45); + ColorChange("Change 1 Color", "CHANGECOLOR_ON"); + ColorRamp("Color Ramp", "COLORRAMP_ON"); + GenericEffect("Hit Effect", "HITEFFECT_ON", 46, 48); + GenericEffect("Negative", "NEGATIVE_ON", 49, 49); + GenericEffect("Pixelate", "PIXELATE_ON", 50, 50, true, "Looks bad with distorition effects"); + GreyScale("GreyScale", "GREYSCALE_ON"); + Posterize("Posterize", "POSTERIZE_ON"); + Blur("Blur", "BLUR_ON"); + GenericEffect("Motion Blur", "MOTIONBLUR_ON", 62, 63); + GenericEffect("Ghost", "GHOST_ON", 64, 65, true, "This effect will not affect the outline", new int[] { 157 }); + GenericEffect("Hologram", "HOLOGRAM_ON", 73, 77, true, null, new int[] { 140, 158 }); + GenericEffect("Chromatic Aberration", "CHROMABERR_ON", 78, 79); + GenericEffect("Glitch", "GLITCH_ON", 80, 80, true, null, new int[] { 139 }); + GenericEffect("Flicker", "FLICKER_ON", 81, 83); + GenericEffect("Shadow", "SHADOW_ON", 84, 87); + GenericEffect("Shine", "SHINE_ON", 133, 138); + GenericEffect("Contrast & Brightness", "CONTRAST_ON", 152, 153); + Overlay("Overlay Texture", "OVERLAY_ON"); + } + + DrawLine(Color.grey, 1, 3); + GUILayout.Label("UV Effects", bigLabelStyle); + + currEnabledDrawers[uvFxShapeDrawer] = GUILayout.Toggle(currEnabledDrawers[uvFxShapeDrawer], new GUIContent("Show Alpha Effects"), toggleButtonStyle); + if(currEnabledDrawers[uvFxShapeDrawer]) + { + GenericEffect("Hand Drawn", "DOODLE_ON", 88, 89); + Grass("Grass Movement / Wind", "WIND_ON"); + GenericEffect("Wave", "WAVEUV_ON", 94, 98); + GenericEffect("Round Wave", "ROUNDWAVEUV_ON", 127, 128); + GenericEffect("Rect Size (Enable wireframe to see result)", "RECTSIZE_ON", 99, 99, true, "Only on single sprites spritesheets NOT supported"); + GenericEffect("Offset", "OFFSETUV_ON", 100, 101); + GenericEffect("Clipping / Fill Amount", "CLIPPING_ON", 102, 105); + GenericEffect("Radial Clipping / Radial Fill", "RADIALCLIPPING_ON", 164, 166); + GenericEffect("Texture Scroll", "TEXTURESCROLL_ON", 106, 107, true, "Set Texture Wrap Mode to Repeat"); + GenericEffect("Zoom", "ZOOMUV_ON", 108, 108); + GenericEffect("Distortion", "DISTORT_ON", 109, 112); + GenericEffect("Warp Distortion", "WARP_ON", 167, 169); + GenericEffect("Twist", "TWISTUV_ON", 113, 116); + GenericEffect("Rotate", "ROTATEUV_ON", 117, 117, true, "_Tip_ Use Clipping effect to avoid possible undesired parts"); + GenericEffect("Polar Coordinates (Tile texture for good results)", "POLARUV_ON", -1, -1); + GenericEffect("Fish Eye", "FISHEYE_ON", 118, 118); + GenericEffect("Pinch", "PINCH_ON", 119, 119); + GenericEffect("Shake", "SHAKEUV_ON", 120, 122); + } + + SetAndSaveEnabledDrawers(iniDrawers); + } + + private void SetAndSaveEnabledDrawers(uint iniDrawers) + { + uint currDrawers = 0; + for(int i = 0; i < currEnabledDrawers.Length; i++) + { + if(currEnabledDrawers[i]) currDrawers |= materialDrawers[i]; + } + + if(iniDrawers != currDrawers) ShaderGUI.FindProperty("_EditorDrawers", matProperties).floatValue = currDrawers; + } + + private void Blending() + { + MaterialProperty srcM = ShaderGUI.FindProperty("_MySrcMode", matProperties); + MaterialProperty dstM = ShaderGUI.FindProperty("_MyDstMode", matProperties); + if(srcM.floatValue == 0 && dstM.floatValue == 0) + { + srcM.floatValue = 5; + dstM.floatValue = 10; + } + + GUILayout.Label("This doesn't make much sense in a lit shader", smallLabelStyle); + if(GUILayout.Button("Back To Default Blending")) + { + srcM.floatValue = 5; + dstM.floatValue = 10; + targetMat.DisableKeyword("PREMULTIPLYALPHA_ON"); + } + + srcMode = (BlendMode)srcM.floatValue; + dstMode = (BlendMode)dstM.floatValue; + srcMode = (BlendMode)EditorGUILayout.EnumPopup("SrcMode", srcMode); + dstMode = (BlendMode)EditorGUILayout.EnumPopup("DstMode", dstMode); + srcM.floatValue = (float)(srcMode); + dstM.floatValue = (float)(dstMode); + + bool ini = oldKeyWords.Contains("PREMULTIPLYALPHA_ON"); + bool toggle = EditorGUILayout.Toggle("Premultiply Alpha?", ini); + if(ini != toggle) Save(); + if(toggle) targetMat.EnableKeyword("PREMULTIPLYALPHA_ON"); + else targetMat.DisableKeyword("PREMULTIPLYALPHA_ON"); + } + + private void Billboard(string inspector, string keyword) + { + bool toggle = oldKeyWords.Contains(keyword); + bool ini = toggle; + + GUIContent effectNameLabel = new GUIContent(); + effectNameLabel.tooltip = keyword + " (C#)"; + effectNameLabel.text = inspector; + toggle = GUILayout.Toggle(toggle, effectNameLabel); + + if(ini != toggle) Save(); + if(toggle) + { + targetMat.EnableKeyword(keyword); + GUILayout.Label("Don't use this feature on UI elements!", smallLabelStyle); + DrawProperty(129, true); + MaterialProperty billboardY = matProperties[129]; + if(billboardY.floatValue == 1) targetMat.EnableKeyword("BILBOARDY_ON"); + else targetMat.DisableKeyword("BILBOARDY_ON"); + } + else targetMat.DisableKeyword(keyword); + } + + private void ZWrite() + { + MaterialProperty zWrite = ShaderGUI.FindProperty("_ZWrite", matProperties); + bool toggle = zWrite.floatValue > 0.9f ? true : false; + EditorGUILayout.BeginHorizontal(); + { + float tempValue = zWrite.floatValue; + toggle = GUILayout.Toggle(toggle, new GUIContent("Enable Z Write")); + if(toggle) zWrite.floatValue = 1.0f; + else zWrite.floatValue = 0.0f; + if(tempValue != zWrite.floatValue && !Application.isPlaying) Save(); + } + EditorGUILayout.EndHorizontal(); + } + + private void ZTest() + { + MaterialProperty zTestM = ShaderGUI.FindProperty("_ZTestMode", matProperties); + float tempValue = zTestM.floatValue; + zTestMode = (UnityEngine.Rendering.CompareFunction)zTestM.floatValue; + zTestMode = (UnityEngine.Rendering.CompareFunction)EditorGUILayout.EnumPopup("Z TestMode", zTestMode); + zTestM.floatValue = (float)(zTestMode); + if(tempValue != zTestM.floatValue && !Application.isPlaying) Save(); + } + + private void Culling() + { + MaterialProperty cullO = ShaderGUI.FindProperty("_CullingOption", matProperties);; + float tempValue = cullO.floatValue; + cullMode = (UnityEngine.Rendering.CullMode)cullO.floatValue; + cullMode = (UnityEngine.Rendering.CullMode)EditorGUILayout.EnumPopup("Culling Mode", cullMode); + cullO.floatValue = (float)(cullMode); + if(tempValue != cullO.floatValue && !Application.isPlaying) Save(); + } + + private void SpriteAtlas(string inspector, string keyword) + { + bool toggle = oldKeyWords.Contains(keyword); + bool ini = toggle; + toggle = GUILayout.Toggle(toggle, inspector); + if(ini != toggle) Save(); + if(toggle) + { + targetMat.EnableKeyword(keyword); + EditorGUILayout.BeginVertical(propertiesStyle); + { + GUILayout.Label("Make sure SpriteAtlasUV component is added \n " + + "*Check documentation if unsure what this does or how it works", smallLabelStyle); + } + EditorGUILayout.EndVertical(); + } + else targetMat.DisableKeyword(keyword); + } + + private void Outline(string inspector, string keyword) + { + bool toggle = oldKeyWords.Contains(keyword); + bool ini = toggle; + + GUIContent effectNameLabel = new GUIContent(); + effectNameLabel.tooltip = keyword + " (C#)"; + effectNameLabel.text = effectCount + ".Outline"; + toggle = EditorGUILayout.BeginToggleGroup(effectNameLabel, toggle); + + effectCount++; + if(ini != toggle) Save(); + if(toggle) + { + targetMat.EnableKeyword("OUTBASE_ON"); + EditorGUILayout.BeginVertical(propertiesStyle); + { + DrawProperty(14); + DrawProperty(15); + DrawProperty(16); + DrawEffectSubKeywordToggle("Outline High Resolution?", "OUTBASE8DIR_ON"); + + DrawLine(Color.grey, 1, 3); + bool outlinePixelPerf = DrawEffectSubKeywordToggle("Outline is Pixel Perfect?", "OUTBASEPIXELPERF_ON"); + if(outlinePixelPerf) DrawProperty(18); + else DrawProperty(17); + + DrawLine(Color.grey, 1, 3); + bool outlineTexture = DrawEffectSubKeywordToggle("Outline uses texture?", "OUTTEX_ON"); + if(outlineTexture) + { + DrawProperty(19); + DrawProperty(20); + DrawProperty(21); + } + + DrawLine(Color.grey, 1, 3); + bool outlineDistort = DrawEffectSubKeywordToggle("Outline uses distortion?", "OUTDIST_ON"); + if(outlineDistort) + { + DrawProperty(22); + DrawProperty(23); + DrawProperty(24); + DrawProperty(25); + } + + DrawLine(Color.grey, 1, 3); + DrawEffectSubKeywordToggle("Only render outline?", "ONLYOUTLINE_ON"); + } + EditorGUILayout.EndVertical(); + } + else targetMat.DisableKeyword("OUTBASE_ON"); + + EditorGUILayout.EndToggleGroup(); + } + + private void GenericEffect(string inspector, string keyword, int first, int last, bool effectCounter = true, string preMessage = null, int[] extraProperties = null, bool boldToggleLetters = true) + { + bool toggle = oldKeyWords.Contains(keyword); + bool ini = toggle; + + GUIContent effectNameLabel = new GUIContent(); + effectNameLabel.tooltip = keyword + " (C#)"; + if(effectCounter) + { + effectNameLabel.text = effectCount + "." + inspector; + effectCount++; + } + else effectNameLabel.text = inspector; + if(boldToggleLetters) toggle = EditorGUILayout.BeginToggleGroup(effectNameLabel, toggle); + else toggle = GUILayout.Toggle(toggle, effectNameLabel); + + if(ini != toggle) Save(); + if(toggle) + { + targetMat.EnableKeyword(keyword); + if(first > 0) + { + EditorGUILayout.BeginVertical(propertiesStyle); + { + if(preMessage != null) GUILayout.Label(preMessage, smallLabelStyle); + for(int i = first; i <= last; i++) DrawProperty(i); + if(extraProperties != null) + foreach(int i in extraProperties) + DrawProperty(i); + } + EditorGUILayout.EndVertical(); + } + } + else targetMat.DisableKeyword(keyword); + + if(boldToggleLetters) EditorGUILayout.EndToggleGroup(); + } + + private void Glow(string inspector, string keyword) + { + bool toggle = oldKeyWords.Contains(keyword); + bool ini = toggle; + + GUIContent effectNameLabel = new GUIContent(); + effectNameLabel.tooltip = keyword + " (C#)"; + effectNameLabel.text = effectCount + "." + inspector; + toggle = EditorGUILayout.BeginToggleGroup(effectNameLabel, toggle); + + effectCount++; + if(ini != toggle) Save(); + if(toggle) + { + targetMat.EnableKeyword("GLOW_ON"); + EditorGUILayout.BeginVertical(propertiesStyle); + { + bool useGlowTex = DrawEffectSubKeywordToggle("Use Glow Texture?", "GLOWTEX_ON"); + if(useGlowTex) DrawProperty(6); + + DrawProperty(3); + DrawProperty(4); + DrawProperty(5, true); + } + EditorGUILayout.EndVertical(); + } + else targetMat.DisableKeyword("GLOW_ON"); + + EditorGUILayout.EndToggleGroup(); + } + + private void ColorRamp(string inspector, string keyword) + { + bool toggle = oldKeyWords.Contains(keyword); + bool ini = toggle; + + GUIContent effectNameLabel = new GUIContent(); + effectNameLabel.tooltip = keyword + " (C#)"; + effectNameLabel.text = effectCount + "." + inspector; + toggle = EditorGUILayout.BeginToggleGroup(effectNameLabel, toggle); + + effectCount++; + if(ini != toggle) Save(); + if(toggle) + { + targetMat.EnableKeyword("COLORRAMP_ON"); + EditorGUILayout.BeginVertical(propertiesStyle); + { + bool useEditableGradient = false; + if(AssetDatabase.Contains(targetMat)) + { + useEditableGradient = oldKeyWords.Contains("GRADIENTCOLORRAMP_ON"); + bool gradientTex = useEditableGradient; + gradientTex = GUILayout.Toggle(gradientTex, new GUIContent("Use Editable Gradient?")); + if(useEditableGradient != gradientTex) + { + Save(); + if(gradientTex) + { + useEditableGradient = true; + targetMat.EnableKeyword("GRADIENTCOLORRAMP_ON"); + } + else targetMat.DisableKeyword("GRADIENTCOLORRAMP_ON"); + } + + if(useEditableGradient) matEditor.ShaderProperty(matProperties[159], matProperties[159].displayName); + } + else GUILayout.Label("*Save to folder to allow for dynamic Gradient property", smallLabelStyle); + + if(!useEditableGradient) DrawProperty(51); + + DrawProperty(52); + DrawProperty(53, true); + MaterialProperty colorRampOut = matProperties[53]; + if(colorRampOut.floatValue == 1) targetMat.EnableKeyword("COLORRAMPOUTLINE_ON"); + else targetMat.DisableKeyword("COLORRAMPOUTLINE_ON"); + DrawProperty(155); + } + EditorGUILayout.EndVertical(); + } + else targetMat.DisableKeyword("COLORRAMP_ON"); + + EditorGUILayout.EndToggleGroup(); + } + + private void ColorChange(string inspector, string keyword) + { + bool toggle = oldKeyWords.Contains(keyword); + bool ini = toggle; + + GUIContent effectNameLabel = new GUIContent(); + effectNameLabel.tooltip = keyword + " (C#)"; + effectNameLabel.text = effectCount + "." + inspector; + toggle = EditorGUILayout.BeginToggleGroup(effectNameLabel, toggle); + + effectCount++; + if(ini != toggle) Save(); + if(toggle) + { + targetMat.EnableKeyword("CHANGECOLOR_ON"); + EditorGUILayout.BeginVertical(propertiesStyle); + { + for(int i = 123; i < 127; i++) DrawProperty(i); + + DrawLine(Color.grey, 1, 3); + ini = oldKeyWords.Contains("CHANGECOLOR2_ON"); + bool toggle2 = ini; + toggle2 = EditorGUILayout.Toggle("Use Color 2", ini); + if(ini != toggle2) Save(); + if(toggle2) + { + targetMat.EnableKeyword("CHANGECOLOR2_ON"); + for(int i = 146; i < 149; i++) DrawProperty(i); + } + else targetMat.DisableKeyword("CHANGECOLOR2_ON"); + + DrawLine(Color.grey, 1, 3); + ini = oldKeyWords.Contains("CHANGECOLOR3_ON"); + toggle2 = ini; + toggle2 = EditorGUILayout.Toggle("Use Color 3", toggle2); + if(ini != toggle2) Save(); + if(toggle2) + { + targetMat.EnableKeyword("CHANGECOLOR3_ON"); + for(int i = 149; i < 152; i++) DrawProperty(i); + } + else targetMat.DisableKeyword("CHANGECOLOR3_ON"); + } + EditorGUILayout.EndVertical(); + } + else targetMat.DisableKeyword("CHANGECOLOR_ON"); + + EditorGUILayout.EndToggleGroup(); + } + + private void GreyScale(string inspector, string keyword) + { + bool toggle = oldKeyWords.Contains(keyword); + bool ini = toggle; + + GUIContent effectNameLabel = new GUIContent(); + effectNameLabel.tooltip = keyword + " (C#)"; + effectNameLabel.text = effectCount + "." + inspector; + toggle = EditorGUILayout.BeginToggleGroup(effectNameLabel, toggle); + + effectCount++; + if(ini != toggle) Save(); + if(toggle) + { + targetMat.EnableKeyword("GREYSCALE_ON"); + EditorGUILayout.BeginVertical(propertiesStyle); + { + DrawProperty(54); + DrawProperty(56); + DrawProperty(55, true); + MaterialProperty greyScaleOut = matProperties[55]; + if(greyScaleOut.floatValue == 1) targetMat.EnableKeyword("GREYSCALEOUTLINE_ON"); + else targetMat.DisableKeyword("GREYSCALEOUTLINE_ON"); + DrawProperty(156); + } + EditorGUILayout.EndVertical(); + } + else targetMat.DisableKeyword("GREYSCALE_ON"); + + EditorGUILayout.EndToggleGroup(); + } + + private void Posterize(string inspector, string keyword) + { + bool toggle = oldKeyWords.Contains(keyword); + bool ini = toggle; + + GUIContent effectNameLabel = new GUIContent(); + effectNameLabel.tooltip = keyword + " (C#)"; + effectNameLabel.text = effectCount + "." + inspector; + toggle = EditorGUILayout.BeginToggleGroup(effectNameLabel, toggle); + + effectCount++; + if(ini != toggle) Save(); + if(toggle) + { + targetMat.EnableKeyword("POSTERIZE_ON"); + EditorGUILayout.BeginVertical(propertiesStyle); + { + DrawProperty(57); + DrawProperty(58); + DrawProperty(59, true); + MaterialProperty posterizeOut = matProperties[59]; + if(posterizeOut.floatValue == 1) targetMat.EnableKeyword("POSTERIZEOUTLINE_ON"); + else targetMat.DisableKeyword("POSTERIZEOUTLINE_ON"); + } + EditorGUILayout.EndVertical(); + } + else targetMat.DisableKeyword("POSTERIZE_ON"); + + EditorGUILayout.EndToggleGroup(); + } + + private void Blur(string inspector, string keyword) + { + bool toggle = oldKeyWords.Contains(keyword); + bool ini = toggle; + + GUIContent effectNameLabel = new GUIContent(); + effectNameLabel.tooltip = keyword + " (C#)"; + effectNameLabel.text = effectCount + "." + inspector; + toggle = EditorGUILayout.BeginToggleGroup(effectNameLabel, toggle); + + effectCount++; + if(ini != toggle) Save(); + if(toggle) + { + targetMat.EnableKeyword("BLUR_ON"); + EditorGUILayout.BeginVertical(propertiesStyle); + { + GUILayout.Label("This effect will not affect the outline", smallLabelStyle); + DrawProperty(60); + DrawProperty(61, true); + MaterialProperty blurIsHd = matProperties[61]; + if(blurIsHd.floatValue == 1) targetMat.EnableKeyword("BLURISHD_ON"); + else targetMat.DisableKeyword("BLURISHD_ON"); + } + EditorGUILayout.EndVertical(); + } + else targetMat.DisableKeyword("BLUR_ON"); + + EditorGUILayout.EndToggleGroup(); + } + + private void Grass(string inspector, string keyword) + { + bool toggle = oldKeyWords.Contains(keyword); + bool ini = toggle; + + GUIContent effectNameLabel = new GUIContent(); + effectNameLabel.tooltip = keyword + " (C#)"; + effectNameLabel.text = effectCount + "." + inspector; + toggle = EditorGUILayout.BeginToggleGroup(effectNameLabel, toggle); + + effectCount++; + if(ini != toggle) Save(); + if(toggle) + { + targetMat.EnableKeyword("WIND_ON"); + EditorGUILayout.BeginVertical(propertiesStyle); + { + DrawProperty(90); + DrawProperty(91); + DrawProperty(145); + DrawProperty(92); + DrawProperty(93, true); + MaterialProperty grassManual = matProperties[92]; + if(grassManual.floatValue == 1) targetMat.EnableKeyword("MANUALWIND_ON"); + else targetMat.DisableKeyword("MANUALWIND_ON"); + } + EditorGUILayout.EndVertical(); + } + else targetMat.DisableKeyword("WIND_ON"); + + EditorGUILayout.EndToggleGroup(); + } + + private void InnerOutline(string inspector, string keyword, int first, int last) + { + bool toggle = oldKeyWords.Contains(keyword); + bool ini = toggle; + + GUIContent effectNameLabel = new GUIContent(); + effectNameLabel.tooltip = keyword + " (C#)"; + effectNameLabel.text = effectCount + "." + inspector; + toggle = EditorGUILayout.BeginToggleGroup(effectNameLabel, toggle); + + effectCount++; + if(ini != toggle) Save(); + if(toggle) + { + targetMat.EnableKeyword(keyword); + if(first > 0) + { + EditorGUILayout.BeginVertical(propertiesStyle); + { + for(int i = first; i <= last; i++) DrawProperty(i); + + EditorGUILayout.Separator(); + DrawProperty(72, true); + MaterialProperty onlyInOutline = matProperties[72]; + if(onlyInOutline.floatValue == 1) targetMat.EnableKeyword("ONLYINNEROUTLINE_ON"); + else targetMat.DisableKeyword("ONLYINNEROUTLINE_ON"); + } + EditorGUILayout.EndVertical(); + } + } + else targetMat.DisableKeyword(keyword); + + EditorGUILayout.EndToggleGroup(); + } + + private void Gradient(string inspector, string keyword) + { + bool toggle = oldKeyWords.Contains(keyword); + bool ini = toggle; + + GUIContent effectNameLabel = new GUIContent(); + effectNameLabel.tooltip = keyword + " (C#)"; + effectNameLabel.text = effectCount + "." + inspector; + toggle = EditorGUILayout.BeginToggleGroup(effectNameLabel, toggle); + + effectCount++; + if(ini != toggle) Save(); + if(toggle) + { + targetMat.EnableKeyword(keyword); + + EditorGUILayout.BeginVertical(propertiesStyle); + { + DrawProperty(143, true); + MaterialProperty gradIsRadial = matProperties[143]; + if(gradIsRadial.floatValue == 1) + { + targetMat.EnableKeyword("RADIALGRADIENT_ON"); + DrawProperty(31); + DrawProperty(32); + DrawProperty(34); + DrawProperty(141); + } + else + { + targetMat.DisableKeyword("RADIALGRADIENT_ON"); + bool simpleGradient = oldKeyWords.Contains("GRADIENT2COL_ON"); + bool simpleGradToggle = EditorGUILayout.Toggle("2 Color Gradient?", simpleGradient); + if(simpleGradient && !simpleGradToggle) targetMat.DisableKeyword("GRADIENT2COL_ON"); + else if(!simpleGradient && simpleGradToggle) targetMat.EnableKeyword("GRADIENT2COL_ON"); + DrawProperty(31); + DrawProperty(32); + if(!simpleGradToggle) DrawProperty(33); + DrawProperty(34); + if(!simpleGradToggle) DrawProperty(35); + if(!simpleGradToggle) DrawProperty(141); + DrawProperty(142); + } + } + EditorGUILayout.EndVertical(); + } + else targetMat.DisableKeyword(keyword); + + EditorGUILayout.EndToggleGroup(); + } + + private void Overlay(string inspector, string keyword) + { + bool toggle = oldKeyWords.Contains(keyword); + bool ini = toggle; + + GUIContent effectNameLabel = new GUIContent(); + effectNameLabel.tooltip = keyword + " (C#)"; + effectNameLabel.text = effectCount + "." + inspector; + toggle = EditorGUILayout.BeginToggleGroup(effectNameLabel, toggle); + + effectCount++; + if(ini != toggle) Save(); + if(toggle) + { + targetMat.EnableKeyword(keyword); + EditorGUILayout.BeginVertical(propertiesStyle); + { + bool multModeOn = oldKeyWords.Contains("OVERLAYMULT_ON"); + bool isMultMode = multModeOn; + isMultMode = GUILayout.Toggle(isMultMode, new GUIContent("Is overlay multiplicative?")); + if(multModeOn != isMultMode) + { + Save(); + if(isMultMode) + { + multModeOn = true; + targetMat.EnableKeyword("OVERLAYMULT_ON"); + } + else targetMat.DisableKeyword("OVERLAYMULT_ON"); + } + + if(multModeOn) GUILayout.Label("Overlay is set to multiplicative mode", smallLabelStyle); + else GUILayout.Label("Overlay is set to additive mode", smallLabelStyle); + + for(int i = 160; i <= 163; i++) DrawProperty(i); + for(int i = 170; i <= 171; i++) DrawProperty(i); + } + EditorGUILayout.EndVertical(); + } + else targetMat.DisableKeyword(keyword); + + EditorGUILayout.EndToggleGroup(); + } + + private void DrawProperty(int index, bool noReset = false) + { + MaterialProperty targetProperty = matProperties[index]; + + EditorGUILayout.BeginHorizontal(); + { + GUIContent propertyLabel = new GUIContent(); + propertyLabel.text = targetProperty.displayName; + propertyLabel.tooltip = targetProperty.name + " (C#)"; + + matEditor.ShaderProperty(targetProperty, propertyLabel); + + if(!noReset) + { + GUIContent resetButtonLabel = new GUIContent(); + resetButtonLabel.text = "R"; + resetButtonLabel.tooltip = "Resets to default value"; + if(GUILayout.Button(resetButtonLabel, GUILayout.Width(20))) ResetProperty(targetProperty); + } + } + EditorGUILayout.EndHorizontal(); + } + + private void ResetProperty(MaterialProperty targetProperty) + { + if(originalMaterialCopy == null) originalMaterialCopy = new Material(targetMat.shader); + if(targetProperty.type == MaterialProperty.PropType.Float || targetProperty.type == MaterialProperty.PropType.Range) + { + targetProperty.floatValue = originalMaterialCopy.GetFloat(targetProperty.name); + } + else if(targetProperty.type == MaterialProperty.PropType.Vector) + { + targetProperty.vectorValue = originalMaterialCopy.GetVector(targetProperty.name); + } + else if(targetProperty.type == MaterialProperty.PropType.Color) + { + targetProperty.colorValue = originalMaterialCopy.GetColor(targetProperty.name); + } + else if(targetProperty.type == MaterialProperty.PropType.Texture) + { + targetProperty.textureValue = originalMaterialCopy.GetTexture(targetProperty.name); + } + } + + private bool DrawEffectSubKeywordToggle(string inspector, string keyword, bool setCustomConfigAfter = false) + { + GUIContent propertyLabel = new GUIContent(); + propertyLabel.text = inspector; + propertyLabel.tooltip = keyword + " (C#)"; + + bool ini = oldKeyWords.Contains(keyword); + bool toggle = ini; + toggle = GUILayout.Toggle(toggle, propertyLabel); + if(ini != toggle) + { + if(toggle) targetMat.EnableKeyword(keyword); + else targetMat.DisableKeyword(keyword); + } + + return toggle; + } + + private void Save() + { + if(!Application.isPlaying) EditorSceneManager.MarkSceneDirty(EditorSceneManager.GetActiveScene()); + EditorUtility.SetDirty(targetMat); + } + + private void DrawLine(Color color, int thickness = 2, int padding = 10) + { + Rect r = EditorGUILayout.GetControlRect(GUILayout.Height(padding + thickness)); + r.height = thickness; + r.y += (padding / 2); + r.x -= 2; + r.width += 6; + EditorGUI.DrawRect(r, color); + } +} +#endif \ No newline at end of file diff --git a/Assets/Plugins/AllIn1SpriteShader/Scripts/Editor/AllIn1SpriteShaderLitMaterialInspector.cs.meta b/Assets/Plugins/AllIn1SpriteShader/Scripts/Editor/AllIn1SpriteShaderLitMaterialInspector.cs.meta new file mode 100644 index 000000000..a954e1617 --- /dev/null +++ b/Assets/Plugins/AllIn1SpriteShader/Scripts/Editor/AllIn1SpriteShaderLitMaterialInspector.cs.meta @@ -0,0 +1,18 @@ +fileFormatVersion: 2 +guid: 58a451704eab27348bd5177152dc656f +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 156513 + packageName: All In 1 Sprite Shader + packageVersion: 4.25 + assetPath: Assets/Plugins/AllIn1SpriteShader/Scripts/Editor/AllIn1SpriteShaderLitMaterialInspector.cs + uploadId: 708810 diff --git a/Assets/Plugins/AllIn1SpriteShader/Scripts/Editor/AllIn1SpriteShaderMaterialInspector.cs b/Assets/Plugins/AllIn1SpriteShader/Scripts/Editor/AllIn1SpriteShaderMaterialInspector.cs new file mode 100644 index 000000000..2c2c04473 --- /dev/null +++ b/Assets/Plugins/AllIn1SpriteShader/Scripts/Editor/AllIn1SpriteShaderMaterialInspector.cs @@ -0,0 +1,828 @@ +#if UNITY_EDITOR +using System.Linq; +using UnityEditor; +using UnityEditor.SceneManagement; +using UnityEngine; +using UnityEngine.Rendering; + +[CanEditMultipleObjects] +public class AllIn1SpriteShaderMaterialInspector : ShaderGUI +{ + private Material targetMat; + private BlendMode srcMode, dstMode; + private CompareFunction zTestMode = CompareFunction.LessEqual; + private CullMode cullMode; + + private GUIStyle propertiesStyle, bigLabelStyle, smallLabelStyle, toggleButtonStyle; + private const int bigFontSize = 16, smallFontSize = 11; + private string[] oldKeyWords; + private int effectCount = 1; + private Material originalMaterialCopy; + private MaterialEditor matEditor; + private MaterialProperty[] matProperties; + private uint[] materialDrawers = new uint[] { 1, 2, 4 }; + bool[] currEnabledDrawers; + private const uint advancedConfigDrawer = 0; + private const uint colorFxShapeDrawer = 1; + private const uint uvFxShapeDrawer = 2; + + public override void OnGUI(MaterialEditor materialEditor, MaterialProperty[] properties) + { + matEditor = materialEditor; + matProperties = properties; + targetMat = materialEditor.target as Material; + effectCount = 1; + oldKeyWords = targetMat.shaderKeywords; + propertiesStyle = new GUIStyle(EditorStyles.helpBox); + propertiesStyle.margin = new RectOffset(0, 0, 0, 0); + bigLabelStyle = new GUIStyle(EditorStyles.boldLabel); + bigLabelStyle.fontSize = bigFontSize; + smallLabelStyle = new GUIStyle(EditorStyles.boldLabel); + smallLabelStyle.fontSize = smallFontSize; + toggleButtonStyle = new GUIStyle(GUI.skin.button) { alignment = TextAnchor.MiddleCenter, richText = true }; + currEnabledDrawers = new bool[materialDrawers.Length]; + uint iniDrawers = (uint)ShaderGUI.FindProperty("_EditorDrawers", matProperties).floatValue; + for(int i = 0; i < materialDrawers.Length; i++) currEnabledDrawers[i] = (materialDrawers[i] & iniDrawers) > 0; + + GUILayout.Label("General Properties", bigLabelStyle); + DrawProperty(0); + DrawProperty(1); + DrawProperty(2); + + + currEnabledDrawers[advancedConfigDrawer] = GUILayout.Toggle(currEnabledDrawers[advancedConfigDrawer], new GUIContent("Show Advanced Configuration"), toggleButtonStyle); + if(currEnabledDrawers[advancedConfigDrawer]) + { + + EditorGUILayout.BeginVertical(propertiesStyle); + Blending(); + DrawLine(Color.grey, 1, 3); + Culling(); + DrawLine(Color.grey, 1, 3); + ZTest(); + DrawLine(Color.grey, 1, 3); + ZWrite(); + DrawLine(Color.grey, 1, 3); + GenericEffect("Unity Fog", "FOG_ON", -1, -1, false, boldToggleLetters: false); + DrawLine(Color.grey, 1, 3); + Billboard("Billboard active", "BILBOARD_ON"); + DrawLine(Color.grey, 1, 3); + SpriteAtlas("Sprite inside an atlas?", "ATLAS_ON"); + DrawLine(Color.grey, 1, 3); + materialEditor.EnableInstancingField(); + DrawLine(Color.grey, 1, 3); + materialEditor.RenderQueueField(); + EditorGUILayout.EndVertical(); + } + + EditorGUILayout.Separator(); + DrawLine(Color.grey, 1, 3); + GUILayout.Label("Color Effects", bigLabelStyle); + + currEnabledDrawers[colorFxShapeDrawer] = GUILayout.Toggle(currEnabledDrawers[colorFxShapeDrawer], new GUIContent("Show Color Effects"), toggleButtonStyle); + if(currEnabledDrawers[colorFxShapeDrawer]) + { + Glow("Glow", "GLOW_ON"); + GenericEffect("Fade", "FADE_ON", 7, 13); + Outline("Outline", "OUTBASE_ON"); + GenericEffect("Alpha Outline", "ALPHAOUTLINE_ON", 26, 30, true, "A more performant but less flexible outline"); + InnerOutline("Inner Outline", "INNEROUTLINE_ON", 66, 69); + Gradient("Gradient & Radial Gradient", "GRADIENT_ON"); + GenericEffect("Color Swap", "COLORSWAP_ON", 36, 42, true, "You will need a mask texture (see Documentation)", new int[] { 154 }); + GenericEffect("Hue Shift", "HSV_ON", 43, 45); + ColorChange("Change 1 Color", "CHANGECOLOR_ON"); + ColorRamp("Color Ramp", "COLORRAMP_ON"); + GenericEffect("Hit Effect", "HITEFFECT_ON", 46, 48); + GenericEffect("Negative", "NEGATIVE_ON", 49, 49); + GenericEffect("Pixelate", "PIXELATE_ON", 50, 50, true, "Looks bad with distorition effects"); + GreyScale("GreyScale", "GREYSCALE_ON"); + Posterize("Posterize", "POSTERIZE_ON"); + Blur("Blur", "BLUR_ON"); + GenericEffect("Motion Blur", "MOTIONBLUR_ON", 62, 63); + GenericEffect("Ghost", "GHOST_ON", 64, 65, true, "This effect will not affect the outline", new int[] { 157 }); + GenericEffect("Hologram", "HOLOGRAM_ON", 73, 77, true, null, new int[] { 140, 158 }); + GenericEffect("Chromatic Aberration", "CHROMABERR_ON", 78, 79); + GenericEffect("Glitch", "GLITCH_ON", 80, 80, true, null, new int[] { 139 }); + GenericEffect("Flicker", "FLICKER_ON", 81, 83); + GenericEffect("Shadow", "SHADOW_ON", 84, 87); + GenericEffect("Shine", "SHINE_ON", 133, 138); + GenericEffect("Contrast & Brightness", "CONTRAST_ON", 152, 153); + Overlay("Overlay Texture", "OVERLAY_ON"); + GenericEffect("Alpha Cutoff", "ALPHACUTOFF_ON", 70, 70); + GenericEffect("Alpha Round", "ALPHAROUND_ON", 144, 144); + } + + DrawLine(Color.grey, 1, 3); + GUILayout.Label("UV Effects", bigLabelStyle); + + currEnabledDrawers[uvFxShapeDrawer] = GUILayout.Toggle(currEnabledDrawers[uvFxShapeDrawer], new GUIContent("Show Alpha Effects"), toggleButtonStyle); + if(currEnabledDrawers[uvFxShapeDrawer]) + { + GenericEffect("Hand Drawn", "DOODLE_ON", 88, 89); + Grass("Grass Movement / Wind", "WIND_ON"); + GenericEffect("Wave", "WAVEUV_ON", 94, 98); + GenericEffect("Round Wave", "ROUNDWAVEUV_ON", 127, 128); + GenericEffect("Rect Size (Enable wireframe to see result)", "RECTSIZE_ON", 99, 99, true, "Only on single sprites spritesheets NOT supported"); + GenericEffect("Offset", "OFFSETUV_ON", 100, 101); + GenericEffect("Clipping / Fill Amount", "CLIPPING_ON", 102, 105); + GenericEffect("Radial Clipping / Radial Fill", "RADIALCLIPPING_ON", 164, 166); + GenericEffect("Texture Scroll", "TEXTURESCROLL_ON", 106, 107, true, "Set Texture Wrap Mode to Repeat"); + GenericEffect("Zoom", "ZOOMUV_ON", 108, 108); + GenericEffect("Distortion", "DISTORT_ON", 109, 112); + GenericEffect("Warp Distortion", "WARP_ON", 167, 169); + GenericEffect("Twist", "TWISTUV_ON", 113, 116); + GenericEffect("Rotate", "ROTATEUV_ON", 117, 117, true, "_Tip_ Use Clipping effect to avoid possible undesired parts"); + GenericEffect("Polar Coordinates (Tile texture for good results)", "POLARUV_ON", -1, -1); + GenericEffect("Fish Eye", "FISHEYE_ON", 118, 118); + GenericEffect("Pinch", "PINCH_ON", 119, 119); + GenericEffect("Shake", "SHAKEUV_ON", 120, 122); + } + + SetAndSaveEnabledDrawers(iniDrawers); + } + + private void SetAndSaveEnabledDrawers(uint iniDrawers) + { + uint currDrawers = 0; + for(int i = 0; i < currEnabledDrawers.Length; i++) + { + if(currEnabledDrawers[i]) currDrawers |= materialDrawers[i]; + } + + if(iniDrawers != currDrawers) ShaderGUI.FindProperty("_EditorDrawers", matProperties).floatValue = currDrawers; + } + + private void Blending() + { + MaterialProperty srcM = ShaderGUI.FindProperty("_MySrcMode", matProperties); + MaterialProperty dstM = ShaderGUI.FindProperty("_MyDstMode", matProperties); + if(srcM.floatValue == 0 && dstM.floatValue == 0) + { + srcM.floatValue = 5; + dstM.floatValue = 10; + } + + GUILayout.Label("Look for 'ShaderLab: Blending' if you don't know what this is", smallLabelStyle); + if(GUILayout.Button("Back To Default Blending")) + { + srcM.floatValue = 5; + dstM.floatValue = 10; + targetMat.DisableKeyword("PREMULTIPLYALPHA_ON"); + } + + srcMode = (BlendMode)srcM.floatValue; + dstMode = (BlendMode)dstM.floatValue; + srcMode = (BlendMode)EditorGUILayout.EnumPopup("SrcMode", srcMode); + dstMode = (BlendMode)EditorGUILayout.EnumPopup("DstMode", dstMode); + srcM.floatValue = (float)(srcMode); + dstM.floatValue = (float)(dstMode); + + bool ini = oldKeyWords.Contains("PREMULTIPLYALPHA_ON"); + bool toggle = EditorGUILayout.Toggle("Premultiply Alpha?", ini); + if(ini != toggle) Save(); + if(toggle) targetMat.EnableKeyword("PREMULTIPLYALPHA_ON"); + else targetMat.DisableKeyword("PREMULTIPLYALPHA_ON"); + } + + private void Billboard(string inspector, string keyword) + { + bool toggle = oldKeyWords.Contains(keyword); + bool ini = toggle; + + GUIContent effectNameLabel = new GUIContent(); + effectNameLabel.tooltip = keyword + " (C#)"; + effectNameLabel.text = inspector; + toggle = GUILayout.Toggle(toggle, effectNameLabel); + + if(ini != toggle) Save(); + if(toggle) + { + targetMat.EnableKeyword(keyword); + GUILayout.Label("Don't use this feature on UI elements!", smallLabelStyle); + DrawProperty(129, true); + MaterialProperty billboardY = matProperties[129]; + if(billboardY.floatValue == 1) targetMat.EnableKeyword("BILBOARDY_ON"); + else targetMat.DisableKeyword("BILBOARDY_ON"); + } + else targetMat.DisableKeyword(keyword); + } + + private void ZWrite() + { + MaterialProperty zWrite = ShaderGUI.FindProperty("_ZWrite", matProperties); + bool toggle = zWrite.floatValue > 0.9f ? true : false; + EditorGUILayout.BeginHorizontal(); + { + float tempValue = zWrite.floatValue; + toggle = GUILayout.Toggle(toggle, new GUIContent("Enable Z Write")); + if(toggle) zWrite.floatValue = 1.0f; + else zWrite.floatValue = 0.0f; + if(tempValue != zWrite.floatValue && !Application.isPlaying) Save(); + } + EditorGUILayout.EndHorizontal(); + } + + private void ZTest() + { + MaterialProperty zTestM = ShaderGUI.FindProperty("_ZTestMode", matProperties); + float tempValue = zTestM.floatValue; + zTestMode = (UnityEngine.Rendering.CompareFunction)zTestM.floatValue; + zTestMode = (UnityEngine.Rendering.CompareFunction)EditorGUILayout.EnumPopup("Z TestMode", zTestMode); + zTestM.floatValue = (float)(zTestMode); + if(tempValue != zTestM.floatValue && !Application.isPlaying) Save(); + } + + private void Culling() + { + MaterialProperty cullO = ShaderGUI.FindProperty("_CullingOption", matProperties);; + float tempValue = cullO.floatValue; + cullMode = (UnityEngine.Rendering.CullMode)cullO.floatValue; + cullMode = (UnityEngine.Rendering.CullMode)EditorGUILayout.EnumPopup("Culling Mode", cullMode); + cullO.floatValue = (float)(cullMode); + if(tempValue != cullO.floatValue && !Application.isPlaying) Save(); + } + + private void SpriteAtlas(string inspector, string keyword) + { + bool toggle = oldKeyWords.Contains(keyword); + bool ini = toggle; + toggle = GUILayout.Toggle(toggle, inspector); + if(ini != toggle) Save(); + if(toggle) + { + targetMat.EnableKeyword(keyword); + EditorGUILayout.BeginVertical(propertiesStyle); + { + GUILayout.Label("Make sure SpriteAtlasUV component is added \n " + + "*Check documentation if unsure what this does or how it works", smallLabelStyle); + } + EditorGUILayout.EndVertical(); + } + else targetMat.DisableKeyword(keyword); + } + + private void Outline(string inspector, string keyword) + { + bool toggle = oldKeyWords.Contains(keyword); + bool ini = toggle; + + GUIContent effectNameLabel = new GUIContent(); + effectNameLabel.tooltip = keyword + " (C#)"; + effectNameLabel.text = effectCount + ".Outline"; + toggle = EditorGUILayout.BeginToggleGroup(effectNameLabel, toggle); + + effectCount++; + if(ini != toggle) Save(); + if(toggle) + { + targetMat.EnableKeyword("OUTBASE_ON"); + EditorGUILayout.BeginVertical(propertiesStyle); + { + DrawProperty(14); + DrawProperty(15); + DrawProperty(16); + DrawEffectSubKeywordToggle("Outline High Resolution?", "OUTBASE8DIR_ON"); + + DrawLine(Color.grey, 1, 3); + bool outlinePixelPerf = DrawEffectSubKeywordToggle("Outline is Pixel Perfect?", "OUTBASEPIXELPERF_ON"); + if(outlinePixelPerf) DrawProperty(18); + else DrawProperty(17); + + DrawLine(Color.grey, 1, 3); + bool outlineTexture = DrawEffectSubKeywordToggle("Outline uses texture?", "OUTTEX_ON"); + if(outlineTexture) + { + DrawProperty(19); + DrawProperty(20); + DrawProperty(21); + } + + DrawLine(Color.grey, 1, 3); + bool outlineDistort = DrawEffectSubKeywordToggle("Outline uses distortion?", "OUTDIST_ON"); + if(outlineDistort) + { + DrawProperty(22); + DrawProperty(23); + DrawProperty(24); + DrawProperty(25); + } + + DrawLine(Color.grey, 1, 3); + DrawEffectSubKeywordToggle("Only render outline?", "ONLYOUTLINE_ON"); + } + EditorGUILayout.EndVertical(); + } + else targetMat.DisableKeyword("OUTBASE_ON"); + + EditorGUILayout.EndToggleGroup(); + } + + private void GenericEffect(string inspector, string keyword, int first, int last, bool effectCounter = true, string preMessage = null, int[] extraProperties = null, bool boldToggleLetters = true) + { + bool toggle = oldKeyWords.Contains(keyword); + bool ini = toggle; + + GUIContent effectNameLabel = new GUIContent(); + effectNameLabel.tooltip = keyword + " (C#)"; + if(effectCounter) + { + effectNameLabel.text = effectCount + "." + inspector; + effectCount++; + } + else effectNameLabel.text = inspector; + if(boldToggleLetters) toggle = EditorGUILayout.BeginToggleGroup(effectNameLabel, toggle); + else toggle = GUILayout.Toggle(toggle, effectNameLabel); + + if(ini != toggle) Save(); + if(toggle) + { + targetMat.EnableKeyword(keyword); + if(first > 0) + { + EditorGUILayout.BeginVertical(propertiesStyle); + { + if(preMessage != null) GUILayout.Label(preMessage, smallLabelStyle); + for(int i = first; i <= last; i++) DrawProperty(i); + if(extraProperties != null) + foreach(int i in extraProperties) + DrawProperty(i); + } + EditorGUILayout.EndVertical(); + } + } + else targetMat.DisableKeyword(keyword); + + if(boldToggleLetters) EditorGUILayout.EndToggleGroup(); + } + + private void Glow(string inspector, string keyword) + { + bool toggle = oldKeyWords.Contains(keyword); + bool ini = toggle; + + GUIContent effectNameLabel = new GUIContent(); + effectNameLabel.tooltip = keyword + " (C#)"; + effectNameLabel.text = effectCount + "." + inspector; + toggle = EditorGUILayout.BeginToggleGroup(effectNameLabel, toggle); + + effectCount++; + if(ini != toggle) Save(); + if(toggle) + { + targetMat.EnableKeyword("GLOW_ON"); + EditorGUILayout.BeginVertical(propertiesStyle); + { + bool useGlowTex = DrawEffectSubKeywordToggle("Use Glow Texture?", "GLOWTEX_ON"); + if(useGlowTex) DrawProperty(6); + + DrawProperty(3); + DrawProperty(4); + DrawProperty(5, true); + } + EditorGUILayout.EndVertical(); + } + else targetMat.DisableKeyword("GLOW_ON"); + + EditorGUILayout.EndToggleGroup(); + } + + private void ColorRamp(string inspector, string keyword) + { + bool toggle = oldKeyWords.Contains(keyword); + bool ini = toggle; + + GUIContent effectNameLabel = new GUIContent(); + effectNameLabel.tooltip = keyword + " (C#)"; + effectNameLabel.text = effectCount + "." + inspector; + toggle = EditorGUILayout.BeginToggleGroup(effectNameLabel, toggle); + + effectCount++; + if(ini != toggle) Save(); + if(toggle) + { + targetMat.EnableKeyword("COLORRAMP_ON"); + EditorGUILayout.BeginVertical(propertiesStyle); + { + bool useEditableGradient = false; + if(AssetDatabase.Contains(targetMat)) + { + useEditableGradient = oldKeyWords.Contains("GRADIENTCOLORRAMP_ON"); + bool gradientTex = useEditableGradient; + gradientTex = GUILayout.Toggle(gradientTex, new GUIContent("Use Editable Gradient?")); + if(useEditableGradient != gradientTex) + { + Save(); + if(gradientTex) + { + useEditableGradient = true; + targetMat.EnableKeyword("GRADIENTCOLORRAMP_ON"); + } + else targetMat.DisableKeyword("GRADIENTCOLORRAMP_ON"); + } + + if(useEditableGradient) matEditor.ShaderProperty(matProperties[159], matProperties[159].displayName); + } + else GUILayout.Label("*Save to folder to allow for dynamic Gradient property", smallLabelStyle); + + if(!useEditableGradient) DrawProperty(51); + + DrawProperty(52); + DrawProperty(53, true); + MaterialProperty colorRampOut = matProperties[53]; + if(colorRampOut.floatValue == 1) targetMat.EnableKeyword("COLORRAMPOUTLINE_ON"); + else targetMat.DisableKeyword("COLORRAMPOUTLINE_ON"); + DrawProperty(155); + } + EditorGUILayout.EndVertical(); + } + else targetMat.DisableKeyword("COLORRAMP_ON"); + + EditorGUILayout.EndToggleGroup(); + } + + private void ColorChange(string inspector, string keyword) + { + bool toggle = oldKeyWords.Contains(keyword); + bool ini = toggle; + + GUIContent effectNameLabel = new GUIContent(); + effectNameLabel.tooltip = keyword + " (C#)"; + effectNameLabel.text = effectCount + "." + inspector; + toggle = EditorGUILayout.BeginToggleGroup(effectNameLabel, toggle); + + effectCount++; + if(ini != toggle) Save(); + if(toggle) + { + targetMat.EnableKeyword("CHANGECOLOR_ON"); + EditorGUILayout.BeginVertical(propertiesStyle); + { + for(int i = 123; i < 127; i++) DrawProperty(i); + + DrawLine(Color.grey, 1, 3); + ini = oldKeyWords.Contains("CHANGECOLOR2_ON"); + bool toggle2 = ini; + toggle2 = EditorGUILayout.Toggle("Use Color 2", ini); + if(ini != toggle2) Save(); + if(toggle2) + { + targetMat.EnableKeyword("CHANGECOLOR2_ON"); + for(int i = 146; i < 149; i++) DrawProperty(i); + } + else targetMat.DisableKeyword("CHANGECOLOR2_ON"); + + DrawLine(Color.grey, 1, 3); + ini = oldKeyWords.Contains("CHANGECOLOR3_ON"); + toggle2 = ini; + toggle2 = EditorGUILayout.Toggle("Use Color 3", toggle2); + if(ini != toggle2) Save(); + if(toggle2) + { + targetMat.EnableKeyword("CHANGECOLOR3_ON"); + for(int i = 149; i < 152; i++) DrawProperty(i); + } + else targetMat.DisableKeyword("CHANGECOLOR3_ON"); + } + EditorGUILayout.EndVertical(); + } + else targetMat.DisableKeyword("CHANGECOLOR_ON"); + + EditorGUILayout.EndToggleGroup(); + } + + private void GreyScale(string inspector, string keyword) + { + bool toggle = oldKeyWords.Contains(keyword); + bool ini = toggle; + + GUIContent effectNameLabel = new GUIContent(); + effectNameLabel.tooltip = keyword + " (C#)"; + effectNameLabel.text = effectCount + "." + inspector; + toggle = EditorGUILayout.BeginToggleGroup(effectNameLabel, toggle); + + effectCount++; + if(ini != toggle) Save(); + if(toggle) + { + targetMat.EnableKeyword("GREYSCALE_ON"); + EditorGUILayout.BeginVertical(propertiesStyle); + { + DrawProperty(54); + DrawProperty(56); + DrawProperty(55, true); + MaterialProperty greyScaleOut = matProperties[55]; + if(greyScaleOut.floatValue == 1) targetMat.EnableKeyword("GREYSCALEOUTLINE_ON"); + else targetMat.DisableKeyword("GREYSCALEOUTLINE_ON"); + DrawProperty(156); + } + EditorGUILayout.EndVertical(); + } + else targetMat.DisableKeyword("GREYSCALE_ON"); + + EditorGUILayout.EndToggleGroup(); + } + + private void Posterize(string inspector, string keyword) + { + bool toggle = oldKeyWords.Contains(keyword); + bool ini = toggle; + + GUIContent effectNameLabel = new GUIContent(); + effectNameLabel.tooltip = keyword + " (C#)"; + effectNameLabel.text = effectCount + "." + inspector; + toggle = EditorGUILayout.BeginToggleGroup(effectNameLabel, toggle); + + effectCount++; + if(ini != toggle) Save(); + if(toggle) + { + targetMat.EnableKeyword("POSTERIZE_ON"); + EditorGUILayout.BeginVertical(propertiesStyle); + { + DrawProperty(57); + DrawProperty(58); + DrawProperty(59, true); + MaterialProperty posterizeOut = matProperties[59]; + if(posterizeOut.floatValue == 1) targetMat.EnableKeyword("POSTERIZEOUTLINE_ON"); + else targetMat.DisableKeyword("POSTERIZEOUTLINE_ON"); + } + EditorGUILayout.EndVertical(); + } + else targetMat.DisableKeyword("POSTERIZE_ON"); + + EditorGUILayout.EndToggleGroup(); + } + + private void Blur(string inspector, string keyword) + { + bool toggle = oldKeyWords.Contains(keyword); + bool ini = toggle; + + GUIContent effectNameLabel = new GUIContent(); + effectNameLabel.tooltip = keyword + " (C#)"; + effectNameLabel.text = effectCount + "." + inspector; + toggle = EditorGUILayout.BeginToggleGroup(effectNameLabel, toggle); + + effectCount++; + if(ini != toggle) Save(); + if(toggle) + { + targetMat.EnableKeyword("BLUR_ON"); + EditorGUILayout.BeginVertical(propertiesStyle); + { + GUILayout.Label("This effect will not affect the outline", smallLabelStyle); + DrawProperty(60); + DrawProperty(61, true); + MaterialProperty blurIsHd = matProperties[61]; + if(blurIsHd.floatValue == 1) targetMat.EnableKeyword("BLURISHD_ON"); + else targetMat.DisableKeyword("BLURISHD_ON"); + } + EditorGUILayout.EndVertical(); + } + else targetMat.DisableKeyword("BLUR_ON"); + + EditorGUILayout.EndToggleGroup(); + } + + private void Grass(string inspector, string keyword) + { + bool toggle = oldKeyWords.Contains(keyword); + bool ini = toggle; + + GUIContent effectNameLabel = new GUIContent(); + effectNameLabel.tooltip = keyword + " (C#)"; + effectNameLabel.text = effectCount + "." + inspector; + toggle = EditorGUILayout.BeginToggleGroup(effectNameLabel, toggle); + + effectCount++; + if(ini != toggle) Save(); + if(toggle) + { + targetMat.EnableKeyword("WIND_ON"); + EditorGUILayout.BeginVertical(propertiesStyle); + { + DrawProperty(90); + DrawProperty(91); + DrawProperty(145); + DrawProperty(92); + DrawProperty(93, true); + MaterialProperty grassManual = matProperties[92]; + if(grassManual.floatValue == 1) targetMat.EnableKeyword("MANUALWIND_ON"); + else targetMat.DisableKeyword("MANUALWIND_ON"); + } + EditorGUILayout.EndVertical(); + } + else targetMat.DisableKeyword("WIND_ON"); + + EditorGUILayout.EndToggleGroup(); + } + + private void InnerOutline(string inspector, string keyword, int first, int last) + { + bool toggle = oldKeyWords.Contains(keyword); + bool ini = toggle; + + GUIContent effectNameLabel = new GUIContent(); + effectNameLabel.tooltip = keyword + " (C#)"; + effectNameLabel.text = effectCount + "." + inspector; + toggle = EditorGUILayout.BeginToggleGroup(effectNameLabel, toggle); + + effectCount++; + if(ini != toggle) Save(); + if(toggle) + { + targetMat.EnableKeyword(keyword); + if(first > 0) + { + EditorGUILayout.BeginVertical(propertiesStyle); + { + for(int i = first; i <= last; i++) DrawProperty(i); + + EditorGUILayout.Separator(); + DrawProperty(72, true); + MaterialProperty onlyInOutline = matProperties[72]; + if(onlyInOutline.floatValue == 1) targetMat.EnableKeyword("ONLYINNEROUTLINE_ON"); + else targetMat.DisableKeyword("ONLYINNEROUTLINE_ON"); + } + EditorGUILayout.EndVertical(); + } + } + else targetMat.DisableKeyword(keyword); + + EditorGUILayout.EndToggleGroup(); + } + + private void Gradient(string inspector, string keyword) + { + bool toggle = oldKeyWords.Contains(keyword); + bool ini = toggle; + + GUIContent effectNameLabel = new GUIContent(); + effectNameLabel.tooltip = keyword + " (C#)"; + effectNameLabel.text = effectCount + "." + inspector; + toggle = EditorGUILayout.BeginToggleGroup(effectNameLabel, toggle); + + effectCount++; + if(ini != toggle) Save(); + if(toggle) + { + targetMat.EnableKeyword(keyword); + + EditorGUILayout.BeginVertical(propertiesStyle); + { + DrawProperty(143, true); + MaterialProperty gradIsRadial = matProperties[143]; + if(gradIsRadial.floatValue == 1) + { + targetMat.EnableKeyword("RADIALGRADIENT_ON"); + DrawProperty(31); + DrawProperty(32); + DrawProperty(34); + DrawProperty(141); + } + else + { + targetMat.DisableKeyword("RADIALGRADIENT_ON"); + bool simpleGradient = oldKeyWords.Contains("GRADIENT2COL_ON"); + bool simpleGradToggle = EditorGUILayout.Toggle("2 Color Gradient?", simpleGradient); + if(simpleGradient && !simpleGradToggle) targetMat.DisableKeyword("GRADIENT2COL_ON"); + else if(!simpleGradient && simpleGradToggle) targetMat.EnableKeyword("GRADIENT2COL_ON"); + DrawProperty(31); + DrawProperty(32); + if(!simpleGradToggle) DrawProperty(33); + DrawProperty(34); + if(!simpleGradToggle) DrawProperty(35); + if(!simpleGradToggle) DrawProperty(141); + DrawProperty(142); + } + } + EditorGUILayout.EndVertical(); + } + else targetMat.DisableKeyword(keyword); + + EditorGUILayout.EndToggleGroup(); + } + + private void Overlay(string inspector, string keyword) + { + bool toggle = oldKeyWords.Contains(keyword); + bool ini = toggle; + + GUIContent effectNameLabel = new GUIContent(); + effectNameLabel.tooltip = keyword + " (C#)"; + effectNameLabel.text = effectCount + "." + inspector; + toggle = EditorGUILayout.BeginToggleGroup(effectNameLabel, toggle); + + effectCount++; + if(ini != toggle) Save(); + if(toggle) + { + targetMat.EnableKeyword(keyword); + EditorGUILayout.BeginVertical(propertiesStyle); + { + bool multModeOn = oldKeyWords.Contains("OVERLAYMULT_ON"); + bool isMultMode = multModeOn; + isMultMode = GUILayout.Toggle(isMultMode, new GUIContent("Is overlay multiplicative?")); + if(multModeOn != isMultMode) + { + Save(); + if(isMultMode) + { + multModeOn = true; + targetMat.EnableKeyword("OVERLAYMULT_ON"); + } + else targetMat.DisableKeyword("OVERLAYMULT_ON"); + } + + if(multModeOn) GUILayout.Label("Overlay is set to multiplicative mode", smallLabelStyle); + else GUILayout.Label("Overlay is set to additive mode", smallLabelStyle); + + for(int i = 160; i <= 163; i++) DrawProperty(i); + for(int i = 170; i <= 171; i++) DrawProperty(i); + } + EditorGUILayout.EndVertical(); + } + else targetMat.DisableKeyword(keyword); + + EditorGUILayout.EndToggleGroup(); + } + + private void DrawProperty(int index, bool noReset = false) + { + MaterialProperty targetProperty = matProperties[index]; + + EditorGUILayout.BeginHorizontal(); + { + GUIContent propertyLabel = new GUIContent(); + propertyLabel.text = targetProperty.displayName; + propertyLabel.tooltip = targetProperty.name + " (C#)"; + + matEditor.ShaderProperty(targetProperty, propertyLabel); + + if(!noReset) + { + GUIContent resetButtonLabel = new GUIContent(); + resetButtonLabel.text = "R"; + resetButtonLabel.tooltip = "Resets to default value"; + if(GUILayout.Button(resetButtonLabel, GUILayout.Width(20))) ResetProperty(targetProperty); + } + } + EditorGUILayout.EndHorizontal(); + } + + private void ResetProperty(MaterialProperty targetProperty) + { + if(originalMaterialCopy == null) originalMaterialCopy = new Material(targetMat.shader); + if(targetProperty.type == MaterialProperty.PropType.Float || targetProperty.type == MaterialProperty.PropType.Range) + { + targetProperty.floatValue = originalMaterialCopy.GetFloat(targetProperty.name); + } + else if(targetProperty.type == MaterialProperty.PropType.Vector) + { + targetProperty.vectorValue = originalMaterialCopy.GetVector(targetProperty.name); + } + else if(targetProperty.type == MaterialProperty.PropType.Color) + { + targetProperty.colorValue = originalMaterialCopy.GetColor(targetProperty.name); + } + else if(targetProperty.type == MaterialProperty.PropType.Texture) + { + targetProperty.textureValue = originalMaterialCopy.GetTexture(targetProperty.name); + } + } + + private bool DrawEffectSubKeywordToggle(string inspector, string keyword, bool setCustomConfigAfter = false) + { + GUIContent propertyLabel = new GUIContent(); + propertyLabel.text = inspector; + propertyLabel.tooltip = keyword + " (C#)"; + + bool ini = oldKeyWords.Contains(keyword); + bool toggle = ini; + toggle = GUILayout.Toggle(toggle, propertyLabel); + if(ini != toggle) + { + if(toggle) targetMat.EnableKeyword(keyword); + else targetMat.DisableKeyword(keyword); + } + + return toggle; + } + + private void Save() + { + if(!Application.isPlaying) EditorSceneManager.MarkSceneDirty(EditorSceneManager.GetActiveScene()); + EditorUtility.SetDirty(targetMat); + } + + private void DrawLine(Color color, int thickness = 2, int padding = 10) + { + Rect r = EditorGUILayout.GetControlRect(GUILayout.Height(padding + thickness)); + r.height = thickness; + r.y += (padding / 2); + r.x -= 2; + r.width += 6; + EditorGUI.DrawRect(r, color); + } +} +#endif \ No newline at end of file diff --git a/Assets/Plugins/AllIn1SpriteShader/Scripts/Editor/AllIn1SpriteShaderMaterialInspector.cs.meta b/Assets/Plugins/AllIn1SpriteShader/Scripts/Editor/AllIn1SpriteShaderMaterialInspector.cs.meta new file mode 100644 index 000000000..3cd66d491 --- /dev/null +++ b/Assets/Plugins/AllIn1SpriteShader/Scripts/Editor/AllIn1SpriteShaderMaterialInspector.cs.meta @@ -0,0 +1,18 @@ +fileFormatVersion: 2 +guid: f42211545c188ae41b1e35cc1ce38187 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 156513 + packageName: All In 1 Sprite Shader + packageVersion: 4.25 + assetPath: Assets/Plugins/AllIn1SpriteShader/Scripts/Editor/AllIn1SpriteShaderMaterialInspector.cs + uploadId: 708810 diff --git a/Assets/Plugins/AllIn1SpriteShader/Scripts/Editor/AllIn1SpriteShaderUiMaskMaterialInspector.cs b/Assets/Plugins/AllIn1SpriteShader/Scripts/Editor/AllIn1SpriteShaderUiMaskMaterialInspector.cs new file mode 100644 index 000000000..89abddfc7 --- /dev/null +++ b/Assets/Plugins/AllIn1SpriteShader/Scripts/Editor/AllIn1SpriteShaderUiMaskMaterialInspector.cs @@ -0,0 +1,758 @@ +#if UNITY_EDITOR +using System.Linq; +using UnityEditor; +using UnityEditor.SceneManagement; +using UnityEngine; +using UnityEngine.Rendering; + +[CanEditMultipleObjects] +public class AllIn1SpriteShaderUiMaskMaterialInspector : ShaderGUI +{ + private Material targetMat; + private BlendMode srcMode, dstMode; + + private GUIStyle propertiesStyle, bigLabelStyle, smallLabelStyle, toggleButtonStyle; + private const int bigFontSize = 16, smallFontSize = 11; + private string[] oldKeyWords; + private int effectCount = 1; + private Material originalMaterialCopy; + private MaterialEditor matEditor; + private MaterialProperty[] matProperties; + private uint[] materialDrawers = new uint[] { 1, 2, 4 }; + bool[] currEnabledDrawers; + private const uint advancedConfigDrawer = 0; + private const uint colorFxShapeDrawer = 1; + private const uint uvFxShapeDrawer = 2; + + public override void OnGUI(MaterialEditor materialEditor, MaterialProperty[] properties) + { + matEditor = materialEditor; + matProperties = properties; + targetMat = materialEditor.target as Material; + effectCount = 1; + oldKeyWords = targetMat.shaderKeywords; + propertiesStyle = new GUIStyle(EditorStyles.helpBox); + propertiesStyle.margin = new RectOffset(0, 0, 0, 0); + bigLabelStyle = new GUIStyle(EditorStyles.boldLabel); + bigLabelStyle.fontSize = bigFontSize; + smallLabelStyle = new GUIStyle(EditorStyles.boldLabel); + smallLabelStyle.fontSize = smallFontSize; + toggleButtonStyle = new GUIStyle(GUI.skin.button) { alignment = TextAnchor.MiddleCenter, richText = true }; + currEnabledDrawers = new bool[materialDrawers.Length]; + uint iniDrawers = (uint)ShaderGUI.FindProperty("_EditorDrawers", matProperties).floatValue; + for(int i = 0; i < materialDrawers.Length; i++) currEnabledDrawers[i] = (materialDrawers[i] & iniDrawers) > 0; + + GUILayout.Label("General Properties", bigLabelStyle); + DrawProperty(0); + DrawProperty(1); + DrawProperty(2); + + + currEnabledDrawers[advancedConfigDrawer] = GUILayout.Toggle(currEnabledDrawers[advancedConfigDrawer], new GUIContent("Show Advanced Configuration"), toggleButtonStyle); + if(currEnabledDrawers[advancedConfigDrawer]) + { + + EditorGUILayout.BeginVertical(propertiesStyle); + Blending(); + DrawLine(Color.grey, 1, 3); + SpriteAtlas("Sprite inside an atlas?", "ATLAS_ON"); + DrawLine(Color.grey, 1, 3); + materialEditor.EnableInstancingField(); + DrawLine(Color.grey, 1, 3); + materialEditor.RenderQueueField(); + EditorGUILayout.EndVertical(); + } + + EditorGUILayout.Separator(); + DrawLine(Color.grey, 1, 3); + GUILayout.Label("Color Effects", bigLabelStyle); + + currEnabledDrawers[colorFxShapeDrawer] = GUILayout.Toggle(currEnabledDrawers[colorFxShapeDrawer], new GUIContent("Show Color Effects"), toggleButtonStyle); + if(currEnabledDrawers[colorFxShapeDrawer]) + { + Glow("Glow", "GLOW_ON"); + GenericEffect("Fade", "FADE_ON", 7, 13); + Outline("Outline", "OUTBASE_ON"); + GenericEffect("Alpha Outline", "ALPHAOUTLINE_ON", 26, 30, true, "A more performant but less flexible outline"); + InnerOutline("Inner Outline", "INNEROUTLINE_ON", 66, 69); + Gradient("Gradient & Radial Gradient", "GRADIENT_ON"); + GenericEffect("Color Swap", "COLORSWAP_ON", 36, 42, true, "You will need a mask texture (see Documentation)", new int[] { 154 }); + GenericEffect("Hue Shift", "HSV_ON", 43, 45); + ColorChange("Change 1 Color", "CHANGECOLOR_ON"); + ColorRamp("Color Ramp", "COLORRAMP_ON"); + GenericEffect("Hit Effect", "HITEFFECT_ON", 46, 48); + GenericEffect("Negative", "NEGATIVE_ON", 49, 49); + GenericEffect("Pixelate", "PIXELATE_ON", 50, 50, true, "Looks bad with distorition effects"); + GreyScale("GreyScale", "GREYSCALE_ON"); + Posterize("Posterize", "POSTERIZE_ON"); + Blur("Blur", "BLUR_ON"); + GenericEffect("Motion Blur", "MOTIONBLUR_ON", 62, 63); + GenericEffect("Ghost", "GHOST_ON", 64, 65, true, "This effect will not affect the outline", new int[] { 157 }); + GenericEffect("Hologram", "HOLOGRAM_ON", 73, 77, true, null, new int[] { 140, 158 }); + GenericEffect("Chromatic Aberration", "CHROMABERR_ON", 78, 79); + GenericEffect("Glitch", "GLITCH_ON", 80, 80, true, null, new int[] { 139 }); + GenericEffect("Flicker", "FLICKER_ON", 81, 83); + GenericEffect("Shadow", "SHADOW_ON", 84, 87); + GenericEffect("Shine", "SHINE_ON", 133, 138); + GenericEffect("Contrast & Brightness", "CONTRAST_ON", 152, 153); + Overlay("Overlay Texture", "OVERLAY_ON"); + GenericEffect("Alpha Cutoff", "ALPHACUTOFF_ON", 70, 70); + GenericEffect("Alpha Round", "ALPHAROUND_ON", 144, 144); + } + + DrawLine(Color.grey, 1, 3); + GUILayout.Label("UV Effects", bigLabelStyle); + + currEnabledDrawers[uvFxShapeDrawer] = GUILayout.Toggle(currEnabledDrawers[uvFxShapeDrawer], new GUIContent("Show Alpha Effects"), toggleButtonStyle); + if(currEnabledDrawers[uvFxShapeDrawer]) + { + GenericEffect("Hand Drawn", "DOODLE_ON", 88, 89); + Grass("Grass Movement / Wind", "WIND_ON"); + GenericEffect("Wave", "WAVEUV_ON", 94, 98); + GenericEffect("Round Wave", "ROUNDWAVEUV_ON", 127, 128); + GenericEffect("Rect Size (Enable wireframe to see result)", "RECTSIZE_ON", 99, 99, true, "Only on single sprites spritesheets NOT supported"); + GenericEffect("Offset", "OFFSETUV_ON", 100, 101); + GenericEffect("Clipping / Fill Amount", "CLIPPING_ON", 102, 105); + GenericEffect("Radial Clipping / Radial Fill", "RADIALCLIPPING_ON", 164, 166); + GenericEffect("Texture Scroll", "TEXTURESCROLL_ON", 106, 107, true, "Set Texture Wrap Mode to Repeat"); + GenericEffect("Zoom", "ZOOMUV_ON", 108, 108); + GenericEffect("Distortion", "DISTORT_ON", 109, 112); + GenericEffect("Warp Distortion", "WARP_ON", 167, 169); + GenericEffect("Twist", "TWISTUV_ON", 113, 116); + GenericEffect("Rotate", "ROTATEUV_ON", 117, 117, true, "_Tip_ Use Clipping effect to avoid possible undesired parts"); + GenericEffect("Polar Coordinates (Tile texture for good results)", "POLARUV_ON", -1, -1); + GenericEffect("Fish Eye", "FISHEYE_ON", 118, 118); + GenericEffect("Pinch", "PINCH_ON", 119, 119); + GenericEffect("Shake", "SHAKEUV_ON", 120, 122); + } + + SetAndSaveEnabledDrawers(iniDrawers); + } + + private void SetAndSaveEnabledDrawers(uint iniDrawers) + { + uint currDrawers = 0; + for(int i = 0; i < currEnabledDrawers.Length; i++) + { + if(currEnabledDrawers[i]) currDrawers |= materialDrawers[i]; + } + + if(iniDrawers != currDrawers) ShaderGUI.FindProperty("_EditorDrawers", matProperties).floatValue = currDrawers; + } + + private void Blending() + { + MaterialProperty srcM = ShaderGUI.FindProperty("_MySrcMode", matProperties); + MaterialProperty dstM = ShaderGUI.FindProperty("_MyDstMode", matProperties); + if(srcM.floatValue == 0 && dstM.floatValue == 0) + { + srcM.floatValue = 5; + dstM.floatValue = 10; + } + + GUILayout.Label("Look for 'ShaderLab: Blending' if you don't know what this is", smallLabelStyle); + if(GUILayout.Button("Back To Default Blending")) + { + srcM.floatValue = 5; + dstM.floatValue = 10; + targetMat.DisableKeyword("PREMULTIPLYALPHA_ON"); + } + + srcMode = (BlendMode)srcM.floatValue; + dstMode = (BlendMode)dstM.floatValue; + srcMode = (BlendMode)EditorGUILayout.EnumPopup("SrcMode", srcMode); + dstMode = (BlendMode)EditorGUILayout.EnumPopup("DstMode", dstMode); + srcM.floatValue = (float)(srcMode); + dstM.floatValue = (float)(dstMode); + + bool ini = oldKeyWords.Contains("PREMULTIPLYALPHA_ON"); + bool toggle = EditorGUILayout.Toggle("Premultiply Alpha?", ini); + if(ini != toggle) Save(); + if(toggle) targetMat.EnableKeyword("PREMULTIPLYALPHA_ON"); + else targetMat.DisableKeyword("PREMULTIPLYALPHA_ON"); + } + + private void SpriteAtlas(string inspector, string keyword) + { + bool toggle = oldKeyWords.Contains(keyword); + bool ini = toggle; + toggle = GUILayout.Toggle(toggle, inspector); + if(ini != toggle) Save(); + if(toggle) + { + targetMat.EnableKeyword(keyword); + EditorGUILayout.BeginVertical(propertiesStyle); + { + GUILayout.Label("Make sure SpriteAtlasUV component is added \n " + + "*Check documentation if unsure what this does or how it works", smallLabelStyle); + } + EditorGUILayout.EndVertical(); + } + else targetMat.DisableKeyword(keyword); + } + + private void Outline(string inspector, string keyword) + { + bool toggle = oldKeyWords.Contains(keyword); + bool ini = toggle; + + GUIContent effectNameLabel = new GUIContent(); + effectNameLabel.tooltip = keyword + " (C#)"; + effectNameLabel.text = effectCount + ".Outline"; + toggle = EditorGUILayout.BeginToggleGroup(effectNameLabel, toggle); + + effectCount++; + if(ini != toggle) Save(); + if(toggle) + { + targetMat.EnableKeyword("OUTBASE_ON"); + EditorGUILayout.BeginVertical(propertiesStyle); + { + DrawProperty(14); + DrawProperty(15); + DrawProperty(16); + DrawEffectSubKeywordToggle("Outline High Resolution?", "OUTBASE8DIR_ON"); + + DrawLine(Color.grey, 1, 3); + bool outlinePixelPerf = DrawEffectSubKeywordToggle("Outline is Pixel Perfect?", "OUTBASEPIXELPERF_ON"); + if(outlinePixelPerf) DrawProperty(18); + else DrawProperty(17); + + DrawLine(Color.grey, 1, 3); + bool outlineTexture = DrawEffectSubKeywordToggle("Outline uses texture?", "OUTTEX_ON"); + if(outlineTexture) + { + DrawProperty(19); + DrawProperty(20); + DrawProperty(21); + } + + DrawLine(Color.grey, 1, 3); + bool outlineDistort = DrawEffectSubKeywordToggle("Outline uses distortion?", "OUTDIST_ON"); + if(outlineDistort) + { + DrawProperty(22); + DrawProperty(23); + DrawProperty(24); + DrawProperty(25); + } + + DrawLine(Color.grey, 1, 3); + DrawEffectSubKeywordToggle("Only render outline?", "ONLYOUTLINE_ON"); + } + EditorGUILayout.EndVertical(); + } + else targetMat.DisableKeyword("OUTBASE_ON"); + + EditorGUILayout.EndToggleGroup(); + } + + private void GenericEffect(string inspector, string keyword, int first, int last, bool effectCounter = true, string preMessage = null, int[] extraProperties = null, bool boldToggleLetters = true) + { + bool toggle = oldKeyWords.Contains(keyword); + bool ini = toggle; + + GUIContent effectNameLabel = new GUIContent(); + effectNameLabel.tooltip = keyword + " (C#)"; + if(effectCounter) + { + effectNameLabel.text = effectCount + "." + inspector; + effectCount++; + } + else effectNameLabel.text = inspector; + if(boldToggleLetters) toggle = EditorGUILayout.BeginToggleGroup(effectNameLabel, toggle); + else toggle = GUILayout.Toggle(toggle, effectNameLabel); + + if(ini != toggle) Save(); + if(toggle) + { + targetMat.EnableKeyword(keyword); + if(first > 0) + { + EditorGUILayout.BeginVertical(propertiesStyle); + { + if(preMessage != null) GUILayout.Label(preMessage, smallLabelStyle); + for(int i = first; i <= last; i++) DrawProperty(i); + if(extraProperties != null) + foreach(int i in extraProperties) + DrawProperty(i); + } + EditorGUILayout.EndVertical(); + } + } + else targetMat.DisableKeyword(keyword); + + if(boldToggleLetters) EditorGUILayout.EndToggleGroup(); + } + + private void Glow(string inspector, string keyword) + { + bool toggle = oldKeyWords.Contains(keyword); + bool ini = toggle; + + GUIContent effectNameLabel = new GUIContent(); + effectNameLabel.tooltip = keyword + " (C#)"; + effectNameLabel.text = effectCount + "." + inspector; + toggle = EditorGUILayout.BeginToggleGroup(effectNameLabel, toggle); + + effectCount++; + if(ini != toggle) Save(); + if(toggle) + { + targetMat.EnableKeyword("GLOW_ON"); + EditorGUILayout.BeginVertical(propertiesStyle); + { + bool useGlowTex = DrawEffectSubKeywordToggle("Use Glow Texture?", "GLOWTEX_ON"); + if(useGlowTex) DrawProperty(6); + + DrawProperty(3); + DrawProperty(4); + DrawProperty(5, true); + } + EditorGUILayout.EndVertical(); + } + else targetMat.DisableKeyword("GLOW_ON"); + + EditorGUILayout.EndToggleGroup(); + } + + private void ColorRamp(string inspector, string keyword) + { + bool toggle = oldKeyWords.Contains(keyword); + bool ini = toggle; + + GUIContent effectNameLabel = new GUIContent(); + effectNameLabel.tooltip = keyword + " (C#)"; + effectNameLabel.text = effectCount + "." + inspector; + toggle = EditorGUILayout.BeginToggleGroup(effectNameLabel, toggle); + + effectCount++; + if(ini != toggle) Save(); + if(toggle) + { + targetMat.EnableKeyword("COLORRAMP_ON"); + EditorGUILayout.BeginVertical(propertiesStyle); + { + bool useEditableGradient = false; + if(AssetDatabase.Contains(targetMat)) + { + useEditableGradient = oldKeyWords.Contains("GRADIENTCOLORRAMP_ON"); + bool gradientTex = useEditableGradient; + gradientTex = GUILayout.Toggle(gradientTex, new GUIContent("Use Editable Gradient?")); + if(useEditableGradient != gradientTex) + { + Save(); + if(gradientTex) + { + useEditableGradient = true; + targetMat.EnableKeyword("GRADIENTCOLORRAMP_ON"); + } + else targetMat.DisableKeyword("GRADIENTCOLORRAMP_ON"); + } + + if(useEditableGradient) matEditor.ShaderProperty(matProperties[159], matProperties[159].displayName); + } + else GUILayout.Label("*Save to folder to allow for dynamic Gradient property", smallLabelStyle); + + if(!useEditableGradient) DrawProperty(51); + + DrawProperty(52); + DrawProperty(53, true); + MaterialProperty colorRampOut = matProperties[53]; + if(colorRampOut.floatValue == 1) targetMat.EnableKeyword("COLORRAMPOUTLINE_ON"); + else targetMat.DisableKeyword("COLORRAMPOUTLINE_ON"); + DrawProperty(155); + } + EditorGUILayout.EndVertical(); + } + else targetMat.DisableKeyword("COLORRAMP_ON"); + + EditorGUILayout.EndToggleGroup(); + } + + private void ColorChange(string inspector, string keyword) + { + bool toggle = oldKeyWords.Contains(keyword); + bool ini = toggle; + + GUIContent effectNameLabel = new GUIContent(); + effectNameLabel.tooltip = keyword + " (C#)"; + effectNameLabel.text = effectCount + "." + inspector; + toggle = EditorGUILayout.BeginToggleGroup(effectNameLabel, toggle); + + effectCount++; + if(ini != toggle) Save(); + if(toggle) + { + targetMat.EnableKeyword("CHANGECOLOR_ON"); + EditorGUILayout.BeginVertical(propertiesStyle); + { + for(int i = 123; i < 127; i++) DrawProperty(i); + + DrawLine(Color.grey, 1, 3); + ini = oldKeyWords.Contains("CHANGECOLOR2_ON"); + bool toggle2 = ini; + toggle2 = EditorGUILayout.Toggle("Use Color 2", ini); + if(ini != toggle2) Save(); + if(toggle2) + { + targetMat.EnableKeyword("CHANGECOLOR2_ON"); + for(int i = 146; i < 149; i++) DrawProperty(i); + } + else targetMat.DisableKeyword("CHANGECOLOR2_ON"); + + DrawLine(Color.grey, 1, 3); + ini = oldKeyWords.Contains("CHANGECOLOR3_ON"); + toggle2 = ini; + toggle2 = EditorGUILayout.Toggle("Use Color 3", toggle2); + if(ini != toggle2) Save(); + if(toggle2) + { + targetMat.EnableKeyword("CHANGECOLOR3_ON"); + for(int i = 149; i < 152; i++) DrawProperty(i); + } + else targetMat.DisableKeyword("CHANGECOLOR3_ON"); + } + EditorGUILayout.EndVertical(); + } + else targetMat.DisableKeyword("CHANGECOLOR_ON"); + + EditorGUILayout.EndToggleGroup(); + } + + private void GreyScale(string inspector, string keyword) + { + bool toggle = oldKeyWords.Contains(keyword); + bool ini = toggle; + + GUIContent effectNameLabel = new GUIContent(); + effectNameLabel.tooltip = keyword + " (C#)"; + effectNameLabel.text = effectCount + "." + inspector; + toggle = EditorGUILayout.BeginToggleGroup(effectNameLabel, toggle); + + effectCount++; + if(ini != toggle) Save(); + if(toggle) + { + targetMat.EnableKeyword("GREYSCALE_ON"); + EditorGUILayout.BeginVertical(propertiesStyle); + { + DrawProperty(54); + DrawProperty(56); + DrawProperty(55, true); + MaterialProperty greyScaleOut = matProperties[55]; + if(greyScaleOut.floatValue == 1) targetMat.EnableKeyword("GREYSCALEOUTLINE_ON"); + else targetMat.DisableKeyword("GREYSCALEOUTLINE_ON"); + DrawProperty(156); + } + EditorGUILayout.EndVertical(); + } + else targetMat.DisableKeyword("GREYSCALE_ON"); + + EditorGUILayout.EndToggleGroup(); + } + + private void Posterize(string inspector, string keyword) + { + bool toggle = oldKeyWords.Contains(keyword); + bool ini = toggle; + + GUIContent effectNameLabel = new GUIContent(); + effectNameLabel.tooltip = keyword + " (C#)"; + effectNameLabel.text = effectCount + "." + inspector; + toggle = EditorGUILayout.BeginToggleGroup(effectNameLabel, toggle); + + effectCount++; + if(ini != toggle) Save(); + if(toggle) + { + targetMat.EnableKeyword("POSTERIZE_ON"); + EditorGUILayout.BeginVertical(propertiesStyle); + { + DrawProperty(57); + DrawProperty(58); + DrawProperty(59, true); + MaterialProperty posterizeOut = matProperties[59]; + if(posterizeOut.floatValue == 1) targetMat.EnableKeyword("POSTERIZEOUTLINE_ON"); + else targetMat.DisableKeyword("POSTERIZEOUTLINE_ON"); + } + EditorGUILayout.EndVertical(); + } + else targetMat.DisableKeyword("POSTERIZE_ON"); + + EditorGUILayout.EndToggleGroup(); + } + + private void Blur(string inspector, string keyword) + { + bool toggle = oldKeyWords.Contains(keyword); + bool ini = toggle; + + GUIContent effectNameLabel = new GUIContent(); + effectNameLabel.tooltip = keyword + " (C#)"; + effectNameLabel.text = effectCount + "." + inspector; + toggle = EditorGUILayout.BeginToggleGroup(effectNameLabel, toggle); + + effectCount++; + if(ini != toggle) Save(); + if(toggle) + { + targetMat.EnableKeyword("BLUR_ON"); + EditorGUILayout.BeginVertical(propertiesStyle); + { + GUILayout.Label("This effect will not affect the outline", smallLabelStyle); + DrawProperty(60); + DrawProperty(61, true); + MaterialProperty blurIsHd = matProperties[61]; + if(blurIsHd.floatValue == 1) targetMat.EnableKeyword("BLURISHD_ON"); + else targetMat.DisableKeyword("BLURISHD_ON"); + } + EditorGUILayout.EndVertical(); + } + else targetMat.DisableKeyword("BLUR_ON"); + + EditorGUILayout.EndToggleGroup(); + } + + private void Grass(string inspector, string keyword) + { + bool toggle = oldKeyWords.Contains(keyword); + bool ini = toggle; + + GUIContent effectNameLabel = new GUIContent(); + effectNameLabel.tooltip = keyword + " (C#)"; + effectNameLabel.text = effectCount + "." + inspector; + toggle = EditorGUILayout.BeginToggleGroup(effectNameLabel, toggle); + + effectCount++; + if(ini != toggle) Save(); + if(toggle) + { + targetMat.EnableKeyword("WIND_ON"); + EditorGUILayout.BeginVertical(propertiesStyle); + { + DrawProperty(90); + DrawProperty(91); + DrawProperty(145); + DrawProperty(92); + DrawProperty(93, true); + MaterialProperty grassManual = matProperties[92]; + if(grassManual.floatValue == 1) targetMat.EnableKeyword("MANUALWIND_ON"); + else targetMat.DisableKeyword("MANUALWIND_ON"); + } + EditorGUILayout.EndVertical(); + } + else targetMat.DisableKeyword("WIND_ON"); + + EditorGUILayout.EndToggleGroup(); + } + + private void InnerOutline(string inspector, string keyword, int first, int last) + { + bool toggle = oldKeyWords.Contains(keyword); + bool ini = toggle; + + GUIContent effectNameLabel = new GUIContent(); + effectNameLabel.tooltip = keyword + " (C#)"; + effectNameLabel.text = effectCount + "." + inspector; + toggle = EditorGUILayout.BeginToggleGroup(effectNameLabel, toggle); + + effectCount++; + if(ini != toggle) Save(); + if(toggle) + { + targetMat.EnableKeyword(keyword); + if(first > 0) + { + EditorGUILayout.BeginVertical(propertiesStyle); + { + for(int i = first; i <= last; i++) DrawProperty(i); + + EditorGUILayout.Separator(); + DrawProperty(72, true); + MaterialProperty onlyInOutline = matProperties[72]; + if(onlyInOutline.floatValue == 1) targetMat.EnableKeyword("ONLYINNEROUTLINE_ON"); + else targetMat.DisableKeyword("ONLYINNEROUTLINE_ON"); + } + EditorGUILayout.EndVertical(); + } + } + else targetMat.DisableKeyword(keyword); + + EditorGUILayout.EndToggleGroup(); + } + + private void Gradient(string inspector, string keyword) + { + bool toggle = oldKeyWords.Contains(keyword); + bool ini = toggle; + + GUIContent effectNameLabel = new GUIContent(); + effectNameLabel.tooltip = keyword + " (C#)"; + effectNameLabel.text = effectCount + "." + inspector; + toggle = EditorGUILayout.BeginToggleGroup(effectNameLabel, toggle); + + effectCount++; + if(ini != toggle) Save(); + if(toggle) + { + targetMat.EnableKeyword(keyword); + + EditorGUILayout.BeginVertical(propertiesStyle); + { + DrawProperty(143, true); + MaterialProperty gradIsRadial = matProperties[143]; + if(gradIsRadial.floatValue == 1) + { + targetMat.EnableKeyword("RADIALGRADIENT_ON"); + DrawProperty(31); + DrawProperty(32); + DrawProperty(34); + DrawProperty(141); + } + else + { + targetMat.DisableKeyword("RADIALGRADIENT_ON"); + bool simpleGradient = oldKeyWords.Contains("GRADIENT2COL_ON"); + bool simpleGradToggle = EditorGUILayout.Toggle("2 Color Gradient?", simpleGradient); + if(simpleGradient && !simpleGradToggle) targetMat.DisableKeyword("GRADIENT2COL_ON"); + else if(!simpleGradient && simpleGradToggle) targetMat.EnableKeyword("GRADIENT2COL_ON"); + DrawProperty(31); + DrawProperty(32); + if(!simpleGradToggle) DrawProperty(33); + DrawProperty(34); + if(!simpleGradToggle) DrawProperty(35); + if(!simpleGradToggle) DrawProperty(141); + DrawProperty(142); + } + } + EditorGUILayout.EndVertical(); + } + else targetMat.DisableKeyword(keyword); + + EditorGUILayout.EndToggleGroup(); + } + + private void Overlay(string inspector, string keyword) + { + bool toggle = oldKeyWords.Contains(keyword); + bool ini = toggle; + + GUIContent effectNameLabel = new GUIContent(); + effectNameLabel.tooltip = keyword + " (C#)"; + effectNameLabel.text = effectCount + "." + inspector; + toggle = EditorGUILayout.BeginToggleGroup(effectNameLabel, toggle); + + effectCount++; + if(ini != toggle) Save(); + if(toggle) + { + targetMat.EnableKeyword(keyword); + EditorGUILayout.BeginVertical(propertiesStyle); + { + bool multModeOn = oldKeyWords.Contains("OVERLAYMULT_ON"); + bool isMultMode = multModeOn; + isMultMode = GUILayout.Toggle(isMultMode, new GUIContent("Is overlay multiplicative?")); + if(multModeOn != isMultMode) + { + Save(); + if(isMultMode) + { + multModeOn = true; + targetMat.EnableKeyword("OVERLAYMULT_ON"); + } + else targetMat.DisableKeyword("OVERLAYMULT_ON"); + } + + if(multModeOn) GUILayout.Label("Overlay is set to multiplicative mode", smallLabelStyle); + else GUILayout.Label("Overlay is set to additive mode", smallLabelStyle); + + for(int i = 160; i <= 163; i++) DrawProperty(i); + for(int i = 170; i <= 171; i++) DrawProperty(i); + } + EditorGUILayout.EndVertical(); + } + else targetMat.DisableKeyword(keyword); + + EditorGUILayout.EndToggleGroup(); + } + + private void DrawProperty(int index, bool noReset = false) + { + MaterialProperty targetProperty = matProperties[index]; + + EditorGUILayout.BeginHorizontal(); + { + GUIContent propertyLabel = new GUIContent(); + propertyLabel.text = targetProperty.displayName; + propertyLabel.tooltip = targetProperty.name + " (C#)"; + + matEditor.ShaderProperty(targetProperty, propertyLabel); + + if(!noReset) + { + GUIContent resetButtonLabel = new GUIContent(); + resetButtonLabel.text = "R"; + resetButtonLabel.tooltip = "Resets to default value"; + if(GUILayout.Button(resetButtonLabel, GUILayout.Width(20))) ResetProperty(targetProperty); + } + } + EditorGUILayout.EndHorizontal(); + } + + private void ResetProperty(MaterialProperty targetProperty) + { + if(originalMaterialCopy == null) originalMaterialCopy = new Material(targetMat.shader); + if(targetProperty.type == MaterialProperty.PropType.Float || targetProperty.type == MaterialProperty.PropType.Range) + { + targetProperty.floatValue = originalMaterialCopy.GetFloat(targetProperty.name); + } + else if(targetProperty.type == MaterialProperty.PropType.Vector) + { + targetProperty.vectorValue = originalMaterialCopy.GetVector(targetProperty.name); + } + else if(targetProperty.type == MaterialProperty.PropType.Color) + { + targetProperty.colorValue = originalMaterialCopy.GetColor(targetProperty.name); + } + else if(targetProperty.type == MaterialProperty.PropType.Texture) + { + targetProperty.textureValue = originalMaterialCopy.GetTexture(targetProperty.name); + } + } + + private bool DrawEffectSubKeywordToggle(string inspector, string keyword, bool setCustomConfigAfter = false) + { + GUIContent propertyLabel = new GUIContent(); + propertyLabel.text = inspector; + propertyLabel.tooltip = keyword + " (C#)"; + + bool ini = oldKeyWords.Contains(keyword); + bool toggle = ini; + toggle = GUILayout.Toggle(toggle, propertyLabel); + if(ini != toggle) + { + if(toggle) targetMat.EnableKeyword(keyword); + else targetMat.DisableKeyword(keyword); + } + + return toggle; + } + + private void Save() + { + if(!Application.isPlaying) EditorSceneManager.MarkSceneDirty(EditorSceneManager.GetActiveScene()); + EditorUtility.SetDirty(targetMat); + } + + private void DrawLine(Color color, int thickness = 2, int padding = 10) + { + Rect r = EditorGUILayout.GetControlRect(GUILayout.Height(padding + thickness)); + r.height = thickness; + r.y += (padding / 2); + r.x -= 2; + r.width += 6; + EditorGUI.DrawRect(r, color); + } +} +#endif \ No newline at end of file diff --git a/Assets/Plugins/AllIn1SpriteShader/Scripts/Editor/AllIn1SpriteShaderUiMaskMaterialInspector.cs.meta b/Assets/Plugins/AllIn1SpriteShader/Scripts/Editor/AllIn1SpriteShaderUiMaskMaterialInspector.cs.meta new file mode 100644 index 000000000..6fbfc067c --- /dev/null +++ b/Assets/Plugins/AllIn1SpriteShader/Scripts/Editor/AllIn1SpriteShaderUiMaskMaterialInspector.cs.meta @@ -0,0 +1,18 @@ +fileFormatVersion: 2 +guid: bcdb12210426bb34cb44a19ffb54132d +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 156513 + packageName: All In 1 Sprite Shader + packageVersion: 4.25 + assetPath: Assets/Plugins/AllIn1SpriteShader/Scripts/Editor/AllIn1SpriteShaderUiMaskMaterialInspector.cs + uploadId: 708810 diff --git a/Assets/Plugins/AllIn1SpriteShader/Scripts/Editor/RenderPipelineChecker.cs b/Assets/Plugins/AllIn1SpriteShader/Scripts/Editor/RenderPipelineChecker.cs new file mode 100644 index 000000000..fe97a06d0 --- /dev/null +++ b/Assets/Plugins/AllIn1SpriteShader/Scripts/Editor/RenderPipelineChecker.cs @@ -0,0 +1,74 @@ +////////////////////////////////////////////////////// +// Shader Packager +// Copyright (c) Jason Booth +////////////////////////////////////////////////////// + +using System; +using System.Linq; +using System.Reflection; +using System.Collections.Generic; +using UnityEditor; + +#if UNITY_2019_3_OR_NEWER + +// installs defines for render pipelines, so we can #if USING_HDRP and do stuff. Can't believe Unity doesn't provide this crap, they +// really go out of their way to make it hard to work across pipelines. + +public static class RenderPipelineChecker +{ + private const string HDRP_PACKAGE = "HDRenderPipelineAsset"; + private const string URP_PACKAGE = "UniversalRenderPipelineAsset"; + + public static bool IsHDRP + { + get; private set; + } + public static bool IsURP + { + get; private set; + } + public static bool IsStandardRP + { + get; private set; + } + + public static void RefreshData() + { + IsHDRP = DoesTypeExist(HDRP_PACKAGE); + IsURP = DoesTypeExist(URP_PACKAGE); + + if (!(IsHDRP || IsURP)) + { + IsStandardRP = true; + } + + } + + public static bool DoesTypeExist(string className) + { + var foundType = (from assembly in AppDomain.CurrentDomain.GetAssemblies() + from type in GetTypesSafe(assembly) + where type.Name == className + select type).FirstOrDefault(); + + return foundType != null; + } + + public static IEnumerable GetTypesSafe(System.Reflection.Assembly assembly) + { + Type[] types; + + try + { + types = assembly.GetTypes(); + } + catch (ReflectionTypeLoadException e) + { + types = e.Types; + } + + return types.Where(x => x != null); + } +} + +#endif \ No newline at end of file diff --git a/Assets/Plugins/AllIn1SpriteShader/Scripts/Editor/RenderPipelineChecker.cs.meta b/Assets/Plugins/AllIn1SpriteShader/Scripts/Editor/RenderPipelineChecker.cs.meta new file mode 100644 index 000000000..f4cb423f9 --- /dev/null +++ b/Assets/Plugins/AllIn1SpriteShader/Scripts/Editor/RenderPipelineChecker.cs.meta @@ -0,0 +1,18 @@ +fileFormatVersion: 2 +guid: 83ac30b66f3fe444189a98a9bb648c51 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 156513 + packageName: All In 1 Sprite Shader + packageVersion: 4.25 + assetPath: Assets/Plugins/AllIn1SpriteShader/Scripts/Editor/RenderPipelineChecker.cs + uploadId: 708810 diff --git a/Assets/Plugins/AllIn1SpriteShader/Scripts/RandomSeed.cs b/Assets/Plugins/AllIn1SpriteShader/Scripts/RandomSeed.cs new file mode 100644 index 000000000..e933c8be7 --- /dev/null +++ b/Assets/Plugins/AllIn1SpriteShader/Scripts/RandomSeed.cs @@ -0,0 +1,37 @@ +using UnityEngine; +using UnityEngine.UI; + +namespace AllIn1SpriteShader +{ + public class RandomSeed : MonoBehaviour + { + private readonly int randomSeedProperty = Shader.PropertyToID("_RandomSeed"); + private MaterialPropertyBlock propertyBlock; + + //If you want to randomize UI Images, you'll need to create different materials since materials are always shared + //This can be done at runtime with scripting or manually in the editor + private void Start() + { + Renderer renderer = GetComponent(); + if(renderer != null) + { + propertyBlock = new MaterialPropertyBlock(); + propertyBlock.SetFloat(randomSeedProperty, Random.Range(0f, 100f)); + renderer.SetPropertyBlock(propertyBlock); + } + else + { + Image image = GetComponent(); + if (image != null) + { + if (image.material != null) + { + image.material.SetFloat(randomSeedProperty, Random.Range(0, 1000f)); + } + else Debug.LogError("Missing Material on UI Image: " + gameObject.name); + } + else Debug.LogError("Missing Renderer or UI Image on: " + gameObject.name); + } + } + } +} \ No newline at end of file diff --git a/Assets/Plugins/AllIn1SpriteShader/Scripts/RandomSeed.cs.meta b/Assets/Plugins/AllIn1SpriteShader/Scripts/RandomSeed.cs.meta new file mode 100644 index 000000000..6e1e15660 --- /dev/null +++ b/Assets/Plugins/AllIn1SpriteShader/Scripts/RandomSeed.cs.meta @@ -0,0 +1,18 @@ +fileFormatVersion: 2 +guid: 6078fd4d3c5bd6f4087f8869458662dd +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 156513 + packageName: All In 1 Sprite Shader + packageVersion: 4.25 + assetPath: Assets/Plugins/AllIn1SpriteShader/Scripts/RandomSeed.cs + uploadId: 708810 diff --git a/Assets/Plugins/AllIn1SpriteShader/Scripts/SetAtlasUvs.cs b/Assets/Plugins/AllIn1SpriteShader/Scripts/SetAtlasUvs.cs new file mode 100644 index 000000000..25260a946 --- /dev/null +++ b/Assets/Plugins/AllIn1SpriteShader/Scripts/SetAtlasUvs.cs @@ -0,0 +1,179 @@ +using UnityEngine; +using UnityEngine.UI; +#if UNITY_EDITOR +using UnityEditor; +#endif + +namespace AllIn1SpriteShader +{ + [ExecuteInEditMode] + public class SetAtlasUvs : MonoBehaviour + { + [SerializeField] private bool updateEveryFrame = false; + [Tooltip("If using a Sprite Renderer it will use the material property instead of sharedMaterial"), SerializeField] private bool useMaterialInstanceIfPossible = false; + private Renderer render; + private SpriteRenderer spriteRender; + private Image uiImage; + private bool isUI = false; + private readonly int minXuv = Shader.PropertyToID("_MinXUV"); + private readonly int maxXuv = Shader.PropertyToID("_MaxXUV"); + private readonly int minYuv = Shader.PropertyToID("_MinYUV"); + private readonly int maxYuv = Shader.PropertyToID("_MaxYUV"); + + private void Start() + { + Setup(); + } + + private void Reset() + { + Setup(); + } + + private void Setup() + { + if (GetRendererReferencesIfNeeded()) GetAndSetUVs(); + if (!updateEveryFrame && Application.isPlaying && this != null) this.enabled = false; + } + + private void Update() + { + if (updateEveryFrame) + { + GetAndSetUVs(); + } + } + + public bool GetAndSetUVs() + { + if (!GetRendererReferencesIfNeeded()) return false; + + if (!isUI) + { + Sprite sprite = spriteRender.sprite; + Rect r = sprite.textureRect; + r.x /= sprite.texture.width; + r.width /= sprite.texture.width; + r.y /= sprite.texture.height; + r.height /= sprite.texture.height; + + if(useMaterialInstanceIfPossible && Application.isPlaying) + { + render.material.SetFloat(minXuv, r.xMin); + render.material.SetFloat(maxXuv, r.xMax); + render.material.SetFloat(minYuv, r.yMin); + render.material.SetFloat(maxYuv, r.yMax); + } + else + { + render.sharedMaterial.SetFloat(minXuv, r.xMin); + render.sharedMaterial.SetFloat(maxXuv, r.xMax); + render.sharedMaterial.SetFloat(minYuv, r.yMin); + render.sharedMaterial.SetFloat(maxYuv, r.yMax); + } + } + else + { + Rect r = uiImage.sprite.textureRect; + r.x /= uiImage.sprite.texture.width; + r.width /= uiImage.sprite.texture.width; + r.y /= uiImage.sprite.texture.height; + r.height /= uiImage.sprite.texture.height; + + uiImage.material.SetFloat(minXuv, r.xMin); + uiImage.material.SetFloat(maxXuv, r.xMax); + uiImage.material.SetFloat(minYuv, r.yMin); + uiImage.material.SetFloat(maxYuv, r.yMax); + } + + return true; + } + + public void ResetAtlasUvs() + { + if (!GetRendererReferencesIfNeeded()) return; + + if (!isUI) + { + if(useMaterialInstanceIfPossible && Application.isPlaying) + { + render.material.SetFloat(minXuv, 0f); + render.material.SetFloat(maxXuv, 1f); + render.material.SetFloat(minYuv, 0f); + render.material.SetFloat(maxYuv, 1f); + } + else + { + render.sharedMaterial.SetFloat(minXuv, 0f); + render.sharedMaterial.SetFloat(maxXuv, 1f); + render.sharedMaterial.SetFloat(minYuv, 0f); + render.sharedMaterial.SetFloat(maxYuv, 1f); + } + } + else + { + uiImage.material.SetFloat(minXuv, 0f); + uiImage.material.SetFloat(maxXuv, 1f); + uiImage.material.SetFloat(minYuv, 0f); + uiImage.material.SetFloat(maxYuv, 1f); + } + } + + public void UpdateEveryFrame(bool everyFrame) + { + updateEveryFrame = everyFrame; + } + + private bool GetRendererReferencesIfNeeded() + { + if (spriteRender == null) spriteRender = GetComponent(); + if (spriteRender != null) + { + if (spriteRender.sprite == null) + { + #if UNITY_EDITOR + EditorUtility.DisplayDialog("No sprite found", "The object: " + gameObject.name + ", has Sprite Renderer but no sprite", "Ok"); + #endif + DestroyImmediate(this); + return false; + } + if (render == null) render = GetComponent(); + isUI = false; + } + else + { + if (uiImage == null) + { + uiImage = GetComponent(); + if (uiImage != null) + { + #if UNITY_EDITOR + Debug.Log("You added the SetAtlasUv component to: " + gameObject.name + " that has a UI Image\n " + + "This SetAtlasUV component will only work properly on UI Images if each Image has a DIFFERENT material instance (See Documentation Sprite Atlases section for more info)"); + #endif + } + else + { + #if UNITY_EDITOR + EditorUtility.DisplayDialog("No Renderer or UI Graphic found", "This SetAtlasUV component will now get destroyed", "Ok"); + #endif + DestroyImmediate(this); + return false; + } + } + if (render == null) render = GetComponent(); + isUI = true; + } + + if (spriteRender == null && uiImage == null) + { + #if UNITY_EDITOR + EditorUtility.DisplayDialog("No Renderer or UI Graphic found", "This SetAtlasUV component will now get destroyed", "Ok"); + #endif + DestroyImmediate(this); + return false; + } + return true; + } + } +} \ No newline at end of file diff --git a/Assets/Plugins/AllIn1SpriteShader/Scripts/SetAtlasUvs.cs.meta b/Assets/Plugins/AllIn1SpriteShader/Scripts/SetAtlasUvs.cs.meta new file mode 100644 index 000000000..bee28c84d --- /dev/null +++ b/Assets/Plugins/AllIn1SpriteShader/Scripts/SetAtlasUvs.cs.meta @@ -0,0 +1,18 @@ +fileFormatVersion: 2 +guid: 1625263d85e5d554284989eb9052e863 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 156513 + packageName: All In 1 Sprite Shader + packageVersion: 4.25 + assetPath: Assets/Plugins/AllIn1SpriteShader/Scripts/SetAtlasUvs.cs + uploadId: 708810 diff --git a/Assets/Plugins/AllIn1SpriteShader/Scripts/SetGlobalTimeNew.cs b/Assets/Plugins/AllIn1SpriteShader/Scripts/SetGlobalTimeNew.cs new file mode 100644 index 000000000..a8ea13a19 --- /dev/null +++ b/Assets/Plugins/AllIn1SpriteShader/Scripts/SetGlobalTimeNew.cs @@ -0,0 +1,26 @@ +using UnityEngine; + +namespace AllIn1SpriteShader +{ + //This script is made with Unity version 2019 and onward in mind + //If you are in Unity 2018 or previous you probably want to use SetGlobalTimeUnity2018.cs instead + + //This script will pass in the Unscaled Time to the shader to animate the effects even when the game is paused + //Set shaders to Scaled Time variant and add this script to an active GameObject to see the results + //Video tutorial about it: https://youtu.be/7_BggIufV-w + [ExecuteInEditMode] + public class SetGlobalTimeNew : MonoBehaviour + { + int globalTime; + + void Start() + { + globalTime = Shader.PropertyToID("globalUnscaledTime"); + } + + void Update() + { + Shader.SetGlobalFloat(globalTime, Time.unscaledTime / 20f); + } + } +} \ No newline at end of file diff --git a/Assets/Plugins/AllIn1SpriteShader/Scripts/SetGlobalTimeNew.cs.meta b/Assets/Plugins/AllIn1SpriteShader/Scripts/SetGlobalTimeNew.cs.meta new file mode 100644 index 000000000..9377e40b1 --- /dev/null +++ b/Assets/Plugins/AllIn1SpriteShader/Scripts/SetGlobalTimeNew.cs.meta @@ -0,0 +1,18 @@ +fileFormatVersion: 2 +guid: c6c0770c7b77d3f45ab8c8d42b794c51 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 156513 + packageName: All In 1 Sprite Shader + packageVersion: 4.25 + assetPath: Assets/Plugins/AllIn1SpriteShader/Scripts/SetGlobalTimeNew.cs + uploadId: 708810 diff --git a/Assets/Plugins/AllIn1SpriteShader/Scripts/SetGlobalTimeUnity2018.cs b/Assets/Plugins/AllIn1SpriteShader/Scripts/SetGlobalTimeUnity2018.cs new file mode 100644 index 000000000..31578f5f5 --- /dev/null +++ b/Assets/Plugins/AllIn1SpriteShader/Scripts/SetGlobalTimeUnity2018.cs @@ -0,0 +1,26 @@ +using UnityEngine; + +namespace AllIn1SpriteShader +{ + //This script is made with Unity version 2018 and previous ones in mind + //If you are in Unity 2019 or onward you probably want to use SetGlobalTimeNew.cs instead + + //This script will pass in the Scaled Time to the shader so the effects stop being animated when the game is paused + //Set shaders to Scaled Time variant and add this script to an active GameObject to see the results + //Video tutorial about it: https://youtu.be/7_BggIufV-w + [ExecuteInEditMode] + public class SetGlobalTimeUnity2018 : MonoBehaviour + { + int globalTime; + + void Start() + { + globalTime = Shader.PropertyToID("globalUnscaledTime"); + } + + void Update() + { + Shader.SetGlobalFloat(globalTime, Time.time / 20f); + } + } +} \ No newline at end of file diff --git a/Assets/Plugins/AllIn1SpriteShader/Scripts/SetGlobalTimeUnity2018.cs.meta b/Assets/Plugins/AllIn1SpriteShader/Scripts/SetGlobalTimeUnity2018.cs.meta new file mode 100644 index 000000000..5fc2405c8 --- /dev/null +++ b/Assets/Plugins/AllIn1SpriteShader/Scripts/SetGlobalTimeUnity2018.cs.meta @@ -0,0 +1,18 @@ +fileFormatVersion: 2 +guid: ee7031a07aea7674fad9a0795b193f56 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 156513 + packageName: All In 1 Sprite Shader + packageVersion: 4.25 + assetPath: Assets/Plugins/AllIn1SpriteShader/Scripts/SetGlobalTimeUnity2018.cs + uploadId: 708810 diff --git a/Assets/Plugins/AllIn1SpriteShader/Scripts/Texture.meta b/Assets/Plugins/AllIn1SpriteShader/Scripts/Texture.meta new file mode 100644 index 000000000..e1631cb10 --- /dev/null +++ b/Assets/Plugins/AllIn1SpriteShader/Scripts/Texture.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 30ea7cd4d865fef46b7a1ea7e98943a1 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/AllIn1SpriteShader/Scripts/Texture/AllIn1SpriteShaderEditorImage.png b/Assets/Plugins/AllIn1SpriteShader/Scripts/Texture/AllIn1SpriteShaderEditorImage.png new file mode 100644 index 000000000..94f5ee43a Binary files /dev/null and b/Assets/Plugins/AllIn1SpriteShader/Scripts/Texture/AllIn1SpriteShaderEditorImage.png differ diff --git a/Assets/Plugins/AllIn1SpriteShader/Scripts/Texture/AllIn1SpriteShaderEditorImage.png.meta b/Assets/Plugins/AllIn1SpriteShader/Scripts/Texture/AllIn1SpriteShaderEditorImage.png.meta new file mode 100644 index 000000000..f9b1a5fb3 --- /dev/null +++ b/Assets/Plugins/AllIn1SpriteShader/Scripts/Texture/AllIn1SpriteShaderEditorImage.png.meta @@ -0,0 +1,99 @@ +fileFormatVersion: 2 +guid: 917b41800d6604d4e99bef50da598d65 +TextureImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 11 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + sRGBTexture: 1 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: -1 + aniso: -1 + mipBias: -100 + wrapU: 1 + wrapV: 1 + wrapW: 1 + nPOTScale: 0 + lightmap: 0 + compressionQuality: 50 + spriteMode: 1 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 100 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 + alphaIsTransparency: 1 + spriteTessellationDetail: -1 + textureType: 8 + textureShape: 1 + singleChannelComponent: 0 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + applyGammaDecoding: 1 + platformSettings: + - serializedVersion: 3 + buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 1 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: 692da10dc1b5aa741a39ec794b64c334 + internalID: 0 + vertices: [] + indices: + edges: [] + weights: [] + secondaryTextures: [] + spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 156513 + packageName: All In 1 Sprite Shader + packageVersion: 4.25 + assetPath: Assets/Plugins/AllIn1SpriteShader/Scripts/Texture/AllIn1SpriteShaderEditorImage.png + uploadId: 708810 diff --git a/Assets/Plugins/AllIn1SpriteShader/Scripts/TrueShadowCompatibility.cs b/Assets/Plugins/AllIn1SpriteShader/Scripts/TrueShadowCompatibility.cs new file mode 100644 index 000000000..c4c051d8c --- /dev/null +++ b/Assets/Plugins/AllIn1SpriteShader/Scripts/TrueShadowCompatibility.cs @@ -0,0 +1,39 @@ +#if LETAI_TRUESHADOW +using LeTai.TrueShadow; +using LeTai.TrueShadow.PluginInterfaces; +using UnityEngine; + +namespace AllIn1SpriteShader +{ + [ExecuteAlways] + public class TrueShadowCompatibility : MonoBehaviour, ITrueShadowCustomHashProvider + { + [Tooltip("Use with animated effects")] + public bool updateTrueShadowEveryFrame = false; + private TrueShadow shadow; + + public void UpdateTrueShadow() + { + if (!shadow) shadow = GetComponent(); + if (!shadow) return; + + UpdateTrueShadow(shadow); + } + + public static void UpdateTrueShadow(TrueShadow shadow) + { + shadow.CustomHash = Random.Range(int.MinValue, int.MaxValue); + } + + public void Update() + { + bool shouldDirty = updateTrueShadowEveryFrame; +#if UNITY_EDITOR + shouldDirty |= !Application.isPlaying; +#endif + if (shouldDirty) + UpdateTrueShadow(); + } + } +} +#endif \ No newline at end of file diff --git a/Assets/Plugins/AllIn1SpriteShader/Scripts/TrueShadowCompatibility.cs.meta b/Assets/Plugins/AllIn1SpriteShader/Scripts/TrueShadowCompatibility.cs.meta new file mode 100644 index 000000000..83ab1e1eb --- /dev/null +++ b/Assets/Plugins/AllIn1SpriteShader/Scripts/TrueShadowCompatibility.cs.meta @@ -0,0 +1,18 @@ +fileFormatVersion: 2 +guid: 279c59909b723da49b1f2cf62d25b06a +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 156513 + packageName: All In 1 Sprite Shader + packageVersion: 4.25 + assetPath: Assets/Plugins/AllIn1SpriteShader/Scripts/TrueShadowCompatibility.cs + uploadId: 708810 diff --git a/Assets/Plugins/AllIn1SpriteShader/Shaders.meta b/Assets/Plugins/AllIn1SpriteShader/Shaders.meta new file mode 100644 index 000000000..5d56747a6 --- /dev/null +++ b/Assets/Plugins/AllIn1SpriteShader/Shaders.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 42ce74ee1ab07574bbe2c76ca27d7c20 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/AllIn1SpriteShader/Shaders/AllIn1OneShaderFunctions.cginc b/Assets/Plugins/AllIn1SpriteShader/Shaders/AllIn1OneShaderFunctions.cginc new file mode 100644 index 000000000..06a1e55f6 --- /dev/null +++ b/Assets/Plugins/AllIn1SpriteShader/Shaders/AllIn1OneShaderFunctions.cginc @@ -0,0 +1,71 @@ +//Prevent Unity warnings that are not relevant for this shader------------------- +#pragma warning (disable : 3571) // pow(f, e) will not work for negative f, use abs(f) or conditionally handle negative values if you expect them +#pragma warning (disable : 4008) // floating point division by zero +#pragma warning (disable : 3206) // implicit truncation of vector type +//BLURS------------------------------------------------------------------------- +half4 Blur(half2 uv, sampler2D source, half Intensity) +{ + const half2 texelSize = 1.0 / _ScreenParams.xy; + const half4 color = tex2D(source, uv); + const half2 offset = Intensity * texelSize; + + half4 accumulatedColor = color; + half accumulatedWeight = 1.0; + for (int x = -1; x <= 1; x++) + { + for (int y = -1; y <= 1; y++) + { + const half2 sampleUV = uv + half2(x, y) * offset; + const half4 sampleColor = tex2D(source, sampleUV); + + accumulatedColor += sampleColor; + accumulatedWeight += 1.0; + } + } + + half4 blurredColor = accumulatedColor / accumulatedWeight; + return blurredColor; +} + +half BlurHD_G(half bhqp, half x) +{ + return exp(-(x * x) / (2.0 * bhqp * bhqp)); +} +half4 BlurHD(half2 uv, sampler2D source, half BlurAmount, half xScale, half yScale) +{ + int iterations = 16; + int halfIterations = iterations / 2; + half sigmaX = 0.1 + BlurAmount * 0.5; + half sigmaY = sigmaX; + half total = 0.0; + half4 ret = half4(0, 0, 0, 0); + for (int iy = 0; iy < iterations; ++iy) + { + half fy = BlurHD_G(sigmaY, half(iy) -half(halfIterations)); + half offsetY = half(iy - halfIterations) * 0.00390625 * xScale; + for (int ix = 0; ix < iterations; ++ix) + { + half fx = BlurHD_G(sigmaX, half(ix) - half(halfIterations)); + half offsetX = half(ix - halfIterations) * 0.00390625 * yScale; + total += fx * fy; + ret += tex2D(source, uv + half2(offsetX, offsetY)) * fx * fy; + } + } + return ret / total; +} +//----------------------------------------------------------------------- +half rand(half2 seed, half offset) { + return (frac(sin(dot(seed, half2(12.9898, 78.233))) * 43758.5453) + offset) % 1.0; +} + +half rand2(half2 seed, half offset) { + return (frac(sin(dot(seed * floor(50 + (_Time.x % 1.0) * 12.), half2(127.1, 311.7))) * 43758.5453123) + offset) % 1.0; +} + +half rand2CustomTime(half2 seed, half offset, half customTime) { + return (frac(sin(dot(seed * floor(50 + (customTime % 1.0) * 12.), half2(127.1, 311.7))) * 43758.5453123) + offset) % 1.0; +} +//----------------------------------------------------------------------- +half RemapFloat(half inValue, half inMin, half inMax, half outMin, half outMax){ + return outMin + (inValue - inMin) * (outMax - outMin) / (inMax - inMin); +} \ No newline at end of file diff --git a/Assets/Plugins/AllIn1SpriteShader/Shaders/AllIn1OneShaderFunctions.cginc.meta b/Assets/Plugins/AllIn1SpriteShader/Shaders/AllIn1OneShaderFunctions.cginc.meta new file mode 100644 index 000000000..0d3dd1b08 --- /dev/null +++ b/Assets/Plugins/AllIn1SpriteShader/Shaders/AllIn1OneShaderFunctions.cginc.meta @@ -0,0 +1,16 @@ +fileFormatVersion: 2 +guid: df06cdcb3555be745b54ff3003fa687e +ShaderImporter: + externalObjects: {} + defaultTextures: [] + nonModifiableTextures: [] + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 156513 + packageName: All In 1 Sprite Shader + packageVersion: 4.25 + assetPath: Assets/Plugins/AllIn1SpriteShader/Shaders/AllIn1OneShaderFunctions.cginc + uploadId: 708810 diff --git a/Assets/Plugins/AllIn1SpriteShader/Shaders/AllIn1SpriteShader.shader b/Assets/Plugins/AllIn1SpriteShader/Shaders/AllIn1SpriteShader.shader new file mode 100644 index 000000000..9aa8ba06b --- /dev/null +++ b/Assets/Plugins/AllIn1SpriteShader/Shaders/AllIn1SpriteShader.shader @@ -0,0 +1,1234 @@ +Shader "AllIn1SpriteShader/AllIn1SpriteShader" +{ + Properties + { + _MainTex ("Main Texture", 2D) = "white" {} //0 + _Color("Main Color", Color) = (1,1,1,1) //1 + _Alpha("General Alpha", Range(0,1)) = 1 //2 + + _GlowColor("Glow Color", Color) = (1,1,1,1) //3 + _Glow("Glow Color Intensity", Range(0,100)) = 10 //4 + _GlowGlobal("Global Glow Intensity", Range(1,100)) = 1 //5 + [NoScaleOffset] _GlowTex("Glow Texture", 2D) = "white" {} //6 + + _FadeTex("Fade Texture", 2D) = "white" {} //7 + _FadeAmount("Fade Amount", Range(-0.1,1)) = -0.1 //8 + _FadeBurnWidth("Fade Burn Width", Range(0,1)) = 0.025 //9 + _FadeBurnTransition("Burn Transition", Range(0.01,0.5)) = 0.075 //10 + _FadeBurnColor("Fade Burn Color", Color) = (1,1,0,1) //11 + _FadeBurnTex("Fade Burn Texture", 2D) = "white" {} //12 + _FadeBurnGlow("Fade Burn Glow", Range(1,250)) = 2//13 + + _OutlineColor("Outline Base Color", Color) = (1,1,1,1) //14 + _OutlineAlpha("Outline Base Alpha", Range(0,1)) = 1 //15 + _OutlineGlow("Outline Base Glow", Range(1,100)) = 1.5 //16 + _OutlineWidth("Outline Base Width", Range(0,0.2)) = 0.004 //17 + _OutlinePixelWidth("Outline Base Pixel Width", Int) = 1 //18 + + [Space] + _OutlineTex("Outline Texture", 2D) = "white" {} //19 + _OutlineTexXSpeed("Texture scroll speed X", Range(-50,50)) = 10 //20 + _OutlineTexYSpeed("Texture scroll speed Y", Range(-50,50)) = 0 //21 + + [Space] + _OutlineDistortTex("Outline Distortion Texture", 2D) = "white" {} //22 + _OutlineDistortAmount("Outline Distortion Amount", Range(0,2)) = 0.5 //23 + _OutlineDistortTexXSpeed("Distortion scroll speed X", Range(-50,50)) = 5 //24 + _OutlineDistortTexYSpeed("Distortion scroll speed Y", Range(-50,50)) = 5 //25 + + _AlphaOutlineColor("Color", Color) = (1, 1, 1, 1) //26 + _AlphaOutlineGlow("Outline Glow", Range(1,100)) = 5 //27 + _AlphaOutlinePower("Power", Range(0, 5)) = 1 // 28 + _AlphaOutlineMinAlpha("Min Alpha", Range(0, 1)) = 0 // 29 + _AlphaOutlineBlend("Blend", Range(0, 1)) = 1 // 30 + + _GradBlend("Gradient Blend", Range(0,1)) = 1 //31 + _GradTopLeftCol("Top Color", Color) = (1,0,0,1) //32 + _GradTopRightCol("Top Color 2", Color) = (1, 1, 0, 1) //33 + _GradBotLeftCol("Bot Color", Color) = (0,0,1,1) //34 + _GradBotRightCol("Bot Color 2", Color) = (0, 1, 0, 1) //35 + + [NoScaleOffset] _ColorSwapTex("Color Swap Texture", 2D) = "black" {} //36 + [HDR] _ColorSwapRed("Red Channel", Color) = (1,1,1,1) //37 + _ColorSwapRedLuminosity("Red luminosity", Range(-1,1)) = 0.5 //38 + [HDR] _ColorSwapGreen("Green Channel", Color) = (1,1,1,1) //39 + _ColorSwapGreenLuminosity("Green luminosity", Range(-1,1)) = 0.5 //40 + [HDR] _ColorSwapBlue("Blue Channel", Color) = (1,1,1,1) //41 + _ColorSwapBlueLuminosity("Blue luminosity", Range(-1,1)) = 0.5 //42 + + _HsvShift("Hue Shift", Range(0, 360)) = 180 //43 + _HsvSaturation("Saturation", Range(0, 2)) = 1 //44 + _HsvBright("Brightness", Range(0, 2)) = 1 //45 + + _HitEffectColor("Hit Effect Color", Color) = (1,1,1,1) //46 + _HitEffectGlow("Glow Intensity", Range(1,100)) = 5 //47 + [Space] + _HitEffectBlend("Hit Effect Blend", Range(0,1)) = 1 //48 + + _NegativeAmount("Negative Amount", Range(0, 1)) = 1 //49 + + _PixelateSize("Pixelate size", Range(4,512)) = 32 //50 + + [NoScaleOffset] _ColorRampTex("Color ramp Texture", 2D) = "white" {} //51 + _ColorRampLuminosity("Color ramp luminosity", Range(-1,1)) = 0 //52 + [Toggle()] _ColorRampOutline("Affects everything?", float) = 0 //53 + + _GreyscaleLuminosity("Greyscale luminosity", Range(-1,1)) = 0 //54 + [Toggle()] _GreyscaleOutline("Affects everything?", float) = 0 //55 + _GreyscaleTintColor("Greyscale Tint Color", Color) = (1,1,1,1) //56 + + _PosterizeNumColors("Number of Colors", Range(0,100)) = 8 //57 + _PosterizeGamma("Posterize Amount", Range(0.1,10)) = 0.75 //58 + [Toggle()] _PosterizeOutline("Affects everything?", float) = 0 //59 + + _BlurIntensity("Blur Intensity", Range(0,100)) = 10 //60 + [Toggle()] _BlurHD("Blur is Low Res?", float) = 0 //61 + + _MotionBlurAngle("Motion Blur Angle", Range(-1, 1)) = 0.1 //62 + _MotionBlurDist("Motion Blur Distance", Range(-3, 3)) = 1.25 //63 + + _GhostColorBoost("Ghost Color Boost", Range(0,5)) = 1 //64 + _GhostTransparency("Ghost Transparency", Range(0,1)) = 0 //65 + + _InnerOutlineColor("Inner Outline Color", Color) = (1,0,0,1) //66 + _InnerOutlineThickness("Outline Thickness", Range(0,3)) = 1 //67 + _InnerOutlineAlpha("Inner Outline Alpha", Range(0,1)) = 1 //68 + _InnerOutlineGlow("Inner Outline Glow", Range(1,250)) = 4 //69 + + _AlphaCutoffValue("Alpha cutoff value", Range(0, 1)) = 0.25 //70 + + [Toggle()] _OnlyOutline("Only render outline?", float) = 0 //71 + [Toggle()] _OnlyInnerOutline("Only render inner outline?", float) = 0 //72 + + _HologramStripesAmount("Stripes Amount", Range(0, 1)) = 0.1 //73 + _HologramUnmodAmount("Unchanged Amount", Range(0, 1)) = 0.0 //74 + _HologramStripesSpeed("Stripes Speed", Range(-20, 20)) = 4.5 //75 + _HologramMinAlpha("Min Alpha", Range(0, 1)) = 0.1 //76 + _HologramMaxAlpha("Max Alpha", Range(0, 100)) = 0.75 //77 + + _ChromAberrAmount("ChromAberr Amount", Range(0, 1)) = 1 //78 + _ChromAberrAlpha("ChromAberr Alpha", Range(0, 1)) = 0.4 //79 + + _GlitchAmount("Glitch Amount", Range(0, 20)) = 3 //80 + + _FlickerPercent("Flicker Percent", Range(0, 1)) = 0.05 //81 + _FlickerFreq("Flicker Frequency", Range(0, 5)) = 0.2 //82 + _FlickerAlpha("Flicker Alpha", Range(0, 1)) = 0 //83 + + _ShadowX("Shadow X Axis", Range(-0.5, 0.5)) = 0.1 //84 + _ShadowY("Shadow Y Axis", Range(-0.5, 0.5)) = -0.05 //85 + _ShadowAlpha("Shadow Alpha", Range(0, 1)) = 0.5 //86 + _ShadowColor("Shadow Color", Color) = (0, 0, 0, 1) //87 + + _HandDrawnAmount("Hand Drawn Amount", Range(0, 20)) = 10 //88 + _HandDrawnSpeed("Hand Drawn Speed", Range(1, 15)) = 5 //89 + + _GrassSpeed("Speed", Range(0,50)) = 2 //90 + _GrassWind("Bend amount", Range(0,50)) = 20 //91 + [Space] + [Toggle()] _GrassManualToggle("Manually animated?", float) = 0 //92 + _GrassManualAnim("Manual Anim Value", Range(-1,1)) = 1 //93 + + _WaveAmount("Wave Amount", Range(0, 25)) = 7 //94 + _WaveSpeed("Wave Speed", Range(0, 25)) = 10 //95 + _WaveStrength("Wave Strength", Range(0, 25)) = 7.5 //96 + _WaveX("Wave X Axis", Range(0, 1)) = 0 //97 + _WaveY("Wave Y Axis", Range(0, 1)) = 0.5 //98 + + _RectSize("Rect Size", Range(1, 4)) = 1 //99 + + _OffsetUvX("X axis", Range(-1, 1)) = 0 //100 + _OffsetUvY("Y axis", Range(-1, 1)) = 0 //101 + + _ClipUvLeft("Clipping Left", Range(0, 1)) = 0 //102 + _ClipUvRight("Clipping Right", Range(0, 1)) = 0 //103 + _ClipUvUp("Clipping Up", Range(0, 1)) = 0 //104 + _ClipUvDown("Clipping Down", Range(0, 1)) = 0 //105 + + _TextureScrollXSpeed("Speed X Axis", Range(-5, 5)) = 1 //106 + _TextureScrollYSpeed("Speed Y Axis", Range(-5, 5)) = 0 //107 + + _ZoomUvAmount("Zoom Amount", Range(0.1, 5)) = 0.5 //108 + + _DistortTex("Distortion Texture", 2D) = "white" {} //109 + _DistortAmount("Distortion Amount", Range(0,2)) = 0.5 //110 + _DistortTexXSpeed("Scroll speed X", Range(-50,50)) = 5 //111 + _DistortTexYSpeed("Scroll speed Y", Range(-50,50)) = 5 //112 + + _TwistUvAmount("Twist Amount", Range(0, 3.1416)) = 1 //113 + _TwistUvPosX("Twist Pos X Axis", Range(0, 1)) = 0.5 //114 + _TwistUvPosY("Twist Pos Y Axis", Range(0, 1)) = 0.5 //115 + _TwistUvRadius("Twist Radius", Range(0, 3)) = 0.75 //116 + + _RotateUvAmount("Rotate Angle(radians)", Range(0, 6.2831)) = 0 //117 + + _FishEyeUvAmount("Fish Eye Amount", Range(0, 0.5)) = 0.35 //118 + + _PinchUvAmount("Pinch Amount", Range(0, 0.5)) = 0.35 //119 + + _ShakeUvSpeed("Shake Speed", Range(0, 20)) = 2.5 //120 + _ShakeUvX("X Multiplier", Range(0, 5)) = 1.5 //121 + _ShakeUvY("Y Multiplier", Range(0, 5)) = 1 //122 + + _ColorChangeTolerance("Tolerance", Range(0, 1)) = 0.25 //123 + _ColorChangeTarget("Color to change", Color) = (1, 0, 0, 1) //124 + [HDR] _ColorChangeNewCol("New Color", Color) = (1, 1, 0, 1) //125 + _ColorChangeLuminosity("New Color Luminosity", Range(0, 1)) = 0.0 //126 + + _RoundWaveStrength("Wave Strength", Range(0, 1)) = 0.7 //127 + _RoundWaveSpeed("Wave Speed", Range(0, 5)) = 2 //128 + + [Toggle()] _BillboardY("Billboard on both axis?", float) = 0 //129 + _ZWrite ("Depth Write", Float) = 0.0 // 130 + + _MySrcMode ("SrcMode", Float) = 5 // 131 + _MyDstMode ("DstMode", Float) = 10 // 132 + + _ShineColor("Shine Color", Color) = (1,1,1,1) // 133 + _ShineLocation("Shine Location", Range(0,1)) = 0.5 // 134 + _ShineRotate("Rotate Angle(radians)", Range(0, 6.2831)) = 0 //135 + _ShineWidth("Shine Width", Range(0.05,1)) = 0.1 // 136 + _ShineGlow("Shine Glow", Range(0,100)) = 1 // 137 + [NoScaleOffset] _ShineMask("Shine Mask", 2D) = "white" {} // 138 + + _GlitchSize("Glitch Size", Range(0.25, 5)) = 1 //139 + _HologramStripeColor("Stripes Color", Color) = (0,1,1,1) //140 + _GradBoostX("Boost X axis", Range(0.1, 5)) = 1.2 //141 + _GradBoostY("Boost Y axis", Range(0.1, 5)) = 1.2 //142 + [Toggle()] _GradIsRadial("Radial Gradient?", float) = 0 //143 + _AlphaRoundThreshold("Round Threshold", Range(0.005, 1.0)) = 0.5 //144 + _GrassRadialBend("Radial Bend", Range(0.0, 5.0)) = 0.1 //145 + + _ColorChangeTolerance2("Tolerance 2", Range(0, 1)) = 0.25 //146 + _ColorChangeTarget2("Color to change 2", Color) = (1, 0, 0, 1) //147 + [HDR] _ColorChangeNewCol2("New Color 2", Color) = (1, 1, 0, 1) //148 + _ColorChangeTolerance3("Tolerance 3", Range(0, 1)) = 0.25 //149 + _ColorChangeTarget3("Color to change 3", Color) = (1, 0, 0, 1) //150 + [HDR] _ColorChangeNewCol3("New Color 3", Color) = (1, 1, 0, 1) //151 + + _Contrast ("Contrast", Range(0, 6)) = 1 // 152 + _Brightness ("Brightness", Range(-1, 1)) = 0 // 153 + + _ColorSwapBlend ("Color Swap Blend", Range(0, 1)) = 1 // 154 + _ColorRampBlend ("Color Ramp Blend", Range(0, 1)) = 1 // 155 + _GreyscaleBlend ("Greyscale Blend", Range(0, 1)) = 1 // 156 + _GhostBlend ("Ghost Blend", Range(0, 1)) = 1 // 157 + _HologramBlend ("Hologram Blend", Range(0, 1)) = 1 // 158 + + [AllIn1ShaderGradient] _ColorRampTexGradient("Color ramp Gradient", 2D) = "white" {} //159 + + _OverlayTex("Overlay Texture", 2D) = "white" {} //160 + _OverlayColor("Overlay Color", Color) = (1, 1, 1, 1) //161 + _OverlayGlow("Overlay Glow", Range(0,25)) = 1 // 162 + _OverlayBlend("Overlay Blend", Range(0, 1)) = 1 // 163 + + _RadialStartAngle("Radial Start Angle", Range(0, 360)) = 90 //164 + _RadialClip("Radial Clip", Range(0, 360)) = 45 //165 + _RadialClip2("Radial Clip 2", Range(0, 360)) = 0 //166 + + _WarpStrength("Warp Strength", Range(0, 0.1)) = 0.025 //167 + _WarpSpeed("Warp Speed", Range(0, 25)) = 8 //168 + _WarpScale("Warp Scale", Range(0.05, 3)) = 0.5 //169 + + _OverlayTextureScrollXSpeed("Speed X Axis", Range(-5, 5)) = 0.25 //170 + _OverlayTextureScrollYSpeed("Speed Y Axis", Range(-5, 5)) = 0.25 //171 + + _ZTestMode ("Z Test Mode", Float) = 4 + _CullingOption ("Culling Option", float) = 0 + + [HideInInspector] _MinXUV("_MinXUV", Range(0, 1)) = 0.0 + [HideInInspector] _MaxXUV("_MaxXUV", Range(0, 1)) = 1.0 + [HideInInspector] _MinYUV("_MinYUV", Range(0, 1)) = 0.0 + [HideInInspector] _MaxYUV("_MaxYUV", Range(0, 1)) = 1.0 + [HideInInspector] _RandomSeed("_MaxYUV", Range(0, 10000)) = 0.0 + _EditorDrawers("Editor Drawers", Int) = 6 + } + + SubShader + { + Tags { "Queue" = "Transparent" "CanUseSpriteAtlas" = "True" "IgnoreProjector" = "True" "RenderType" = "Transparent" "PreviewType" = "Plane" } + Blend [_MySrcMode] [_MyDstMode] + Cull [_CullingOption] + ZWrite [_ZWrite] + ZTest [_ZTestMode] + + Pass + { + CGPROGRAM + #pragma multi_compile_instancing + #pragma vertex vert + #pragma fragment frag + + #pragma shader_feature_local GLOW_ON + #pragma shader_feature_local FADE_ON + #pragma shader_feature_local OUTBASE_ON + #pragma shader_feature_local ONLYOUTLINE_ON + #pragma shader_feature_local GRADIENT_ON + #pragma shader_feature_local GRADIENT2COL_ON + #pragma shader_feature_local RADIALGRADIENT_ON + #pragma shader_feature_local COLORSWAP_ON + #pragma shader_feature_local HSV_ON + #pragma shader_feature_local CHANGECOLOR_ON + #pragma shader_feature_local CHANGECOLOR2_ON + #pragma shader_feature_local CHANGECOLOR3_ON + #pragma shader_feature_local COLORRAMP_ON + #pragma shader_feature_local GRADIENTCOLORRAMP_ON + #pragma shader_feature_local HITEFFECT_ON + #pragma shader_feature_local NEGATIVE_ON + #pragma shader_feature_local PIXELATE_ON + #pragma shader_feature_local GREYSCALE_ON + #pragma shader_feature_local POSTERIZE_ON + #pragma shader_feature_local BLUR_ON + #pragma shader_feature_local MOTIONBLUR_ON + #pragma shader_feature_local GHOST_ON + #pragma shader_feature_local ALPHAOUTLINE_ON + #pragma shader_feature_local INNEROUTLINE_ON + #pragma shader_feature_local ONLYINNEROUTLINE_ON + #pragma shader_feature_local HOLOGRAM_ON + #pragma shader_feature_local CHROMABERR_ON + #pragma shader_feature_local GLITCH_ON + #pragma shader_feature_local FLICKER_ON + #pragma shader_feature_local SHADOW_ON + #pragma shader_feature_local SHINE_ON + #pragma shader_feature_local CONTRAST_ON + #pragma shader_feature_local OVERLAY_ON + #pragma shader_feature_local OVERLAYMULT_ON + #pragma shader_feature_local ALPHACUTOFF_ON + #pragma shader_feature_local ALPHAROUND_ON + #pragma shader_feature_local DOODLE_ON + #pragma shader_feature_local WIND_ON + #pragma shader_feature_local WAVEUV_ON + #pragma shader_feature_local ROUNDWAVEUV_ON + #pragma shader_feature_local RECTSIZE_ON + #pragma shader_feature_local OFFSETUV_ON + #pragma shader_feature_local CLIPPING_ON + #pragma shader_feature_local RADIALCLIPPING_ON + #pragma shader_feature_local TEXTURESCROLL_ON + #pragma shader_feature_local ZOOMUV_ON + #pragma shader_feature_local DISTORT_ON + #pragma shader_feature_local WARP_ON + #pragma shader_feature_local TWISTUV_ON + #pragma shader_feature_local ROTATEUV_ON + #pragma shader_feature_local POLARUV_ON + #pragma shader_feature_local FISHEYE_ON + #pragma shader_feature_local PINCH_ON + #pragma shader_feature_local SHAKEUV_ON + + #pragma shader_feature_local GLOWTEX_ON + #pragma shader_feature_local OUTTEX_ON + #pragma shader_feature_local OUTDIST_ON + #pragma shader_feature_local OUTBASE8DIR_ON + #pragma shader_feature_local OUTBASEPIXELPERF_ON + #pragma shader_feature_local COLORRAMPOUTLINE_ON + #pragma shader_feature_local GREYSCALEOUTLINE_ON + #pragma shader_feature_local POSTERIZEOUTLINE_ON + #pragma shader_feature_local BLURISHD_ON + #pragma shader_feature_local MANUALWIND_ON + #pragma shader_feature ATLAS_ON + #pragma shader_feature PREMULTIPLYALPHA_ON + + #pragma shader_feature BILBOARD_ON + #pragma shader_feature BILBOARDY_ON + #pragma shader_feature FOG_ON + + #include "UnityCG.cginc" + #include "AllIn1OneShaderFunctions.cginc" + + #if FOG_ON + #pragma multi_compile_fog + #endif + + struct appdata + { + float4 vertex : POSITION; + float2 uv : TEXCOORD0; + half4 color : COLOR; + UNITY_VERTEX_INPUT_INSTANCE_ID + }; + + struct v2f + { + float2 uv : TEXCOORD0; + float4 vertex : SV_POSITION; + half4 color : COLOR; + #if OUTTEX_ON + half2 uvOutTex : TEXCOORD1; + #endif + #if OUTDIST_ON + half2 uvOutDistTex : TEXCOORD2; + #endif + #if DISTORT_ON + half2 uvDistTex : TEXCOORD3; + #endif + #if FOG_ON + UNITY_FOG_COORDS(4) + #endif + UNITY_VERTEX_INPUT_INSTANCE_ID + UNITY_VERTEX_OUTPUT_STEREO + }; + + sampler2D _MainTex; + half4 _MainTex_ST, _MainTex_TexelSize, _Color; + half _Alpha; + + #if ATLAS_ON + half _MinXUV, _MaxXUV, _MinYUV, _MaxYUV; + #endif + + #if RECTSIZE_ON + half _RectSize; + #endif + + #if OFFSETUV_ON + half _OffsetUvX, _OffsetUvY; + #endif + + #if CLIPPING_ON + half _ClipUvLeft, _ClipUvRight, _ClipUvUp, _ClipUvDown; + #endif + + #if RADIALCLIPPING_ON + half _RadialStartAngle, _RadialClip, _RadialClip2; + #endif + + #if TWISTUV_ON + half _TwistUvAmount, _TwistUvPosX, _TwistUvPosY, _TwistUvRadius; + #endif + + #if ROTATEUV_ON + half _RotateUvAmount; + #endif + + #if FISHEYE_ON + half _FishEyeUvAmount; + #endif + + #if PINCH_ON + half _PinchUvAmount; + #endif + + #if DOODLE_ON + half _HandDrawnAmount, _HandDrawnSpeed; + #endif + + #if SHAKEUV_ON + half _ShakeUvSpeed, _ShakeUvX, _ShakeUvY; + #endif + + #if WAVEUV_ON + float _WaveAmount, _WaveSpeed, _WaveStrength, _WaveX, _WaveY; + #endif + + #if ROUNDWAVEUV_ON + half _RoundWaveStrength, _RoundWaveSpeed; + #endif + + #if ZOOMUV_ON + half _ZoomUvAmount; + #endif + + #if FADE_ON + sampler2D _FadeTex, _FadeBurnTex; + half4 _FadeBurnColor, _FadeTex_ST, _FadeBurnTex_ST; + half _FadeAmount, _FadeBurnWidth, _FadeBurnTransition,_FadeBurnGlow; + #endif + + #if TEXTURESCROLL_ON + half _TextureScrollXSpeed, _TextureScrollYSpeed; + #endif + + #if GLOW_ON + sampler2D _GlowTex; + half4 _GlowColor; + half _Glow, _GlowGlobal; + #endif + + #if OUTBASE_ON + half4 _OutlineColor; + half _OutlineAlpha, _OutlineGlow, _OutlineWidth; + int _OutlinePixelWidth; + #endif + + #if OUTTEX_ON + sampler2D _OutlineTex; + half4 _OutlineTex_ST; + half _OutlineTexXSpeed, _OutlineTexYSpeed; + #endif + + #if OUTDIST_ON + sampler2D _OutlineDistortTex; + half4 _OutlineDistortTex_ST; + half _OutlineDistortTexXSpeed, _OutlineDistortTexYSpeed, _OutlineDistortAmount; + #endif + + #if DISTORT_ON + sampler2D _DistortTex; + half4 _DistortTex_ST; + half _DistortTexXSpeed, _DistortTexYSpeed, _DistortAmount; + #endif + + #if WARP_ON + half _WarpStrength, _WarpSpeed, _WarpScale; + #endif + + #if WIND_ON + half _GrassSpeed, _GrassWind, _GrassManualAnim, _GrassRadialBend; + #endif + + #if GRADIENT_ON + half _GradBlend, _GradBoostX, _GradBoostY; + half4 _GradTopRightCol, _GradTopLeftCol, _GradBotRightCol, _GradBotLeftCol; + #endif + + #if COLORSWAP_ON + sampler2D _ColorSwapTex; + half4 _ColorSwapRed, _ColorSwapGreen, _ColorSwapBlue; + half _ColorSwapRedLuminosity, _ColorSwapGreenLuminosity, _ColorSwapBlueLuminosity, _ColorSwapBlend; + #endif + + #if HSV_ON + half _HsvShift, _HsvSaturation, _HsvBright; + #endif + + #if HITEFFECT_ON + half4 _HitEffectColor; + half _HitEffectGlow, _HitEffectBlend; + #endif + + #if PIXELATE_ON + half _PixelateSize; + #endif + + #if NEGATIVE_ON + half _NegativeAmount; + #endif + + #if COLORRAMP_ON + sampler2D _ColorRampTex, _ColorRampTexGradient; + half _ColorRampLuminosity, _ColorRampBlend; + #endif + + #if GREYSCALE_ON + half _GreyscaleLuminosity, _GreyscaleBlend; + half4 _GreyscaleTintColor; + #endif + + #if POSTERIZE_ON + half _PosterizeNumColors, _PosterizeGamma; + #endif + + #if BLUR_ON + half _BlurIntensity; + #endif + + #if MOTIONBLUR_ON + half _MotionBlurAngle, _MotionBlurDist; + #endif + + #if GHOST_ON + half _GhostColorBoost, _GhostTransparency, _GhostBlend; + #endif + + #if ALPHAOUTLINE_ON + half _AlphaOutlineGlow, _AlphaOutlinePower, _AlphaOutlineMinAlpha, _AlphaOutlineBlend; + half4 _AlphaOutlineColor; + #endif + + #if INNEROUTLINE_ON + half _InnerOutlineThickness, _InnerOutlineAlpha, _InnerOutlineGlow; + half4 _InnerOutlineColor; + #endif + + #if HOLOGRAM_ON + half _HologramStripesAmount, _HologramMinAlpha, _HologramUnmodAmount, _HologramStripesSpeed, _HologramMaxAlpha, _HologramBlend; + half4 _HologramStripeColor; + #endif + + #if CHROMABERR_ON + half _ChromAberrAmount, _ChromAberrAlpha; + #endif + + #if GLITCH_ON + half _GlitchAmount, _GlitchSize; + #endif + + #if FLICKER_ON + half _FlickerFreq, _FlickerPercent, _FlickerAlpha; + #endif + + #if SHADOW_ON + half _ShadowX, _ShadowY, _ShadowAlpha; + half4 _ShadowColor; + #endif + + #if SHINE_ON + sampler2D _ShineMask; + half4 _ShineColor; + half _ShineLocation, _ShineRotate, _ShineWidth, _ShineGlow; + #endif + + #if ALPHACUTOFF_ON + half _AlphaCutoffValue; + #endif + + #if ALPHAROUND_ON + half _AlphaRoundThreshold; + #endif + + #if CHANGECOLOR_ON + half4 _ColorChangeNewCol, _ColorChangeTarget; + half _ColorChangeTolerance, _ColorChangeLuminosity; + #endif + #if CHANGECOLOR2_ON + half4 _ColorChangeNewCol2, _ColorChangeTarget2; + half _ColorChangeTolerance2; + #endif + #if CHANGECOLOR3_ON + half4 _ColorChangeNewCol3, _ColorChangeTarget3; + half _ColorChangeTolerance3; + #endif + + #if CONTRAST_ON + half _Contrast, _Brightness; + #endif + + #if OVERLAY_ON + sampler2D _OverlayTex; + half4 _OverlayTex_ST, _OverlayColor; + half _OverlayGlow, _OverlayBlend, _OverlayTextureScrollXSpeed, _OverlayTextureScrollYSpeed; + #endif + + UNITY_INSTANCING_BUFFER_START(Props) + UNITY_DEFINE_INSTANCED_PROP(float, _RandomSeed) + UNITY_INSTANCING_BUFFER_END(Props) + + v2f vert (appdata v) + { + #if RECTSIZE_ON + v.vertex.xyz += (v.vertex.xyz * (_RectSize - 1.0)); + #endif + + v2f o; + UNITY_SETUP_INSTANCE_ID(v); + UNITY_TRANSFER_INSTANCE_ID(v, o); + UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o); + + #if BILBOARD_ON + half3 camRight = mul((half3x3)unity_CameraToWorld, half3(1,0,0)); + half3 camUp = half3(0,1,0); + #if BILBOARDY_ON + camUp = mul((half3x3)unity_CameraToWorld, half3(0,1,0)); + #endif + half3 localPos = v.vertex.x * camRight + v.vertex.y * camUp; + o.vertex = UnityObjectToClipPos(half4(localPos, 1)); + #else + o.vertex = UnityObjectToClipPos(v.vertex); + #endif + o.uv = TRANSFORM_TEX(v.uv, _MainTex); + o.color = v.color; + + half2 center = half2(0.5, 0.5); + #if ATLAS_ON + center = half2((_MaxXUV + _MinXUV) / 2.0, (_MaxYUV + _MinYUV) / 2.0); + #endif + + #if POLARUV_ON + o.uv = v.uv - center; + #endif + + #if ROTATEUV_ON + half2 uvC = v.uv; + half cosAngle = cos(_RotateUvAmount); + half sinAngle = sin(_RotateUvAmount); + half2x2 rot = half2x2(cosAngle, -sinAngle, sinAngle, cosAngle); + uvC -= center; + o.uv = mul(rot, uvC); + o.uv += center; + #endif + + #if OUTTEX_ON + o.uvOutTex = TRANSFORM_TEX(v.uv, _OutlineTex); + #endif + + #if OUTDIST_ON + o.uvOutDistTex = TRANSFORM_TEX(v.uv, _OutlineDistortTex); + #endif + + #if DISTORT_ON + o.uvDistTex = TRANSFORM_TEX(v.uv, _DistortTex); + #endif + + #if FOG_ON + UNITY_TRANSFER_FOG(o,o.vertex); + #endif + + return o; + } + + half3 GetPixel(in int offsetX, in int offsetY, half2 uv, sampler2D tex) + { + return tex2D(tex, (uv + half2(offsetX * _MainTex_TexelSize.x, offsetY * _MainTex_TexelSize.y))).rgb; + } + + half4 frag (v2f i) : SV_Target + { + UNITY_SETUP_INSTANCE_ID(i); + UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX(i); + half randomSeed = UNITY_ACCESS_INSTANCED_PROP(Props, _RandomSeed); + + float2 uvRect = i.uv; + half2 center = half2(0.5, 0.5); + #if ATLAS_ON + center = half2((_MaxXUV + _MinXUV) / 2.0, (_MaxYUV + _MinYUV) / 2.0); + uvRect = half2((i.uv.x - _MinXUV) / (_MaxXUV - _MinXUV), (i.uv.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half2 centerTiled = half2(center.x * _MainTex_ST.x, center.y * _MainTex_ST.y); + + #if CLIPPING_ON + half2 tiledUv = half2(i.uv.x / _MainTex_ST.x, i.uv.y / _MainTex_ST.y); + #if ATLAS_ON + tiledUv = half2((tiledUv.x - _MinXUV) / (_MaxXUV - _MinXUV), (tiledUv.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + clip((1 - _ClipUvUp) - tiledUv.y); + clip(tiledUv.y - _ClipUvDown); + clip((1 - _ClipUvRight) - tiledUv.x); + clip(tiledUv.x - _ClipUvLeft); + #endif + + #if RADIALCLIPPING_ON + half2 tiledUv2 = half2(i.uv.x / _MainTex_ST.x, i.uv.y / _MainTex_ST.y); + #if ATLAS_ON + tiledUv2 = half2((tiledUv2.x - _MinXUV) / (_MaxXUV - _MinXUV), (tiledUv2.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half startAngle = _RadialStartAngle - _RadialClip; + half endAngle = _RadialStartAngle + _RadialClip2; + half offset0 = clamp(0, 360, startAngle + 360); + half offset360 = clamp(0, 360, endAngle - 360); + half2 atan2Coord = half2(lerp(-1, 1, tiledUv2.x), lerp(-1, 1, tiledUv2.y)); + half atanAngle = atan2(atan2Coord.y, atan2Coord.x) * 57.3; // angle in degrees + if(atanAngle < 0) atanAngle = 360 + atanAngle; + if(atanAngle >= startAngle && atanAngle <= endAngle) discard; + if(atanAngle <= offset360) discard; + if(atanAngle >= offset0) discard; + #endif + + #if TEXTURESCROLL_ON && ATLAS_ON + i.uv = half2(_MinXUV + ((_MaxXUV - _MinXUV) * (abs(((_Time.y + randomSeed) * _TextureScrollXSpeed) + uvRect.x) % 1)), + _MinYUV + ((_MaxYUV - _MinYUV) * (abs(((_Time.y + randomSeed) * _TextureScrollYSpeed) + uvRect.y) % 1))); + #endif + + #if OFFSETUV_ON + #if ATLAS_ON + i.uv = half2(_MinXUV + ((_MaxXUV - _MinXUV) * (abs((_OffsetUvX + uvRect.x) % 1))), + _MinYUV + ((_MaxYUV - _MinYUV) * (abs(_OffsetUvY + uvRect.y) % 1))); + #else + i.uv += half2(_OffsetUvX, _OffsetUvY); + #endif + #endif + + #if POLARUV_ON + i.uv = half2(atan2(i.uv.y, i.uv.x) / (2.0f * 3.141592653589f), length(i.uv)); + i.uv *= _MainTex_ST.xy; + #endif + + #if TWISTUV_ON + #if ATLAS_ON + _TwistUvPosX = ((_MaxXUV - _MinXUV) * _TwistUvPosX) + _MinXUV; + _TwistUvPosY = ((_MaxYUV - _MinYUV) * _TwistUvPosY) + _MinYUV; + #endif + half2 tempUv = i.uv - half2(_TwistUvPosX * _MainTex_ST.x, _TwistUvPosY * _MainTex_ST.y); + _TwistUvRadius *= (_MainTex_ST.x + _MainTex_ST.y) / 2; + half percent = (_TwistUvRadius - length(tempUv)) / _TwistUvRadius; + half theta = percent * percent * (2.0 * sin(_TwistUvAmount)) * 8.0; + half s = sin(theta); + half c = cos(theta); + half beta = max(sign(_TwistUvRadius - length(tempUv)), 0.0); + tempUv = half2(dot(tempUv, half2(c, -s)), dot(tempUv, half2(s, c))) * beta + tempUv * (1 - beta); + tempUv += half2(_TwistUvPosX * _MainTex_ST.x, _TwistUvPosY * _MainTex_ST.y); + i.uv = tempUv; + #endif + + #if FISHEYE_ON + half bind = length(centerTiled); + half2 dF = i.uv - centerTiled; + half dFlen = length(dF); + half fishInt = (3.14159265359 / bind) * (_FishEyeUvAmount + 0.001); + i.uv = centerTiled + (dF / (max(0.0001, dFlen))) * tan(dFlen * fishInt) * bind / tan(bind * fishInt); + #endif + + #if PINCH_ON + half2 dP = i.uv - centerTiled; + half pinchInt = (3.141592 / length(centerTiled)) * (-_PinchUvAmount + 0.001); + i.uv = centerTiled + normalize(dP) * atan(length(dP) * -pinchInt * 10.0) * 0.5 / atan(-pinchInt * 5); + #endif + + #if ZOOMUV_ON + i.uv -= centerTiled; + i.uv = i.uv * _ZoomUvAmount; + i.uv += centerTiled; + #endif + + #if DOODLE_ON + half2 uvCopy = uvRect; + _HandDrawnSpeed = (floor((_Time.x + randomSeed) * 20 * _HandDrawnSpeed) / _HandDrawnSpeed) * _HandDrawnSpeed; + uvCopy.x = sin((uvCopy.x * _HandDrawnAmount + _HandDrawnSpeed) * 4); + uvCopy.y = cos((uvCopy.y * _HandDrawnAmount + _HandDrawnSpeed) * 4); + i.uv = lerp(i.uv, i.uv + uvCopy, 0.0005 * _HandDrawnAmount); + #endif + + #if SHAKEUV_ON + half xShake = sin((_Time.x + randomSeed) * _ShakeUvSpeed * 50) * _ShakeUvX; + half yShake = cos((_Time.x + randomSeed) * _ShakeUvSpeed * 50) * _ShakeUvY; + i.uv += half2(xShake * 0.012, yShake * 0.01); + #endif + + #if RECTSIZE_ON + i.uv = i.uv.xy * (_RectSize).xx + (((-_RectSize * 0.5) + 0.5)).xx; + #endif + + #if DISTORT_ON + #if ATLAS_ON + i.uvDistTex.x = i.uvDistTex.x * (1 / (_MaxXUV - _MinXUV)); + i.uvDistTex.y = i.uvDistTex.y * (1 / (_MaxYUV - _MinYUV)); + #endif + i.uvDistTex.x += ((_Time.x + randomSeed) * _DistortTexXSpeed) % 1; + i.uvDistTex.y += ((_Time.x + randomSeed) * _DistortTexYSpeed) % 1; + half distortAmnt = (tex2D(_DistortTex, i.uvDistTex).r - 0.5) * 0.2 * _DistortAmount; + i.uv.x += distortAmnt; + i.uv.y += distortAmnt; + #endif + + #if WARP_ON + half2 warpUv = half2(i.uv.x / _MainTex_ST.x, i.uv.y / _MainTex_ST.y); + #if ATLAS_ON + warpUv = half2((warpUv.x - _MinXUV) / (_MaxXUV - _MinXUV), (warpUv.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + const float tau = 6.283185307179586; + float xWarp = (_Time.y + randomSeed) * _WarpSpeed + warpUv.x * tau / _WarpScale; + float yWarp = (_Time.y + randomSeed) * _WarpSpeed + warpUv.y * tau / _WarpScale; + float2 warp = float2(sin(xWarp), sin(yWarp)) * _WarpStrength; + i.uv += warp; + #endif + + #if WAVEUV_ON + float2 uvWave = half2(_WaveX * _MainTex_ST.x, _WaveY * _MainTex_ST.y) - i.uv; + uvWave %= 1; + #if ATLAS_ON + uvWave = half2(_WaveX, _WaveY) - uvRect; + #endif + uvWave.x *= _ScreenParams.x / _ScreenParams.y; + float waveTime = _Time.y + randomSeed; + float angWave = (sqrt(dot(uvWave, uvWave)) * _WaveAmount) - ((waveTime * _WaveSpeed)); + i.uv = i.uv + uvWave * sin(angWave) * (_WaveStrength / 1000.0); + #endif + + #if ROUNDWAVEUV_ON + half xWave = ((0.5 * _MainTex_ST.x) - uvRect.x); + half yWave = ((0.5 * _MainTex_ST.y) - uvRect.y) * (_MainTex_TexelSize.w / _MainTex_TexelSize.z); + half ripple = -sqrt(xWave*xWave + yWave* yWave); + i.uv += (sin((ripple + (_Time.y + randomSeed) * (_RoundWaveSpeed/10.0)) / 0.015) * (_RoundWaveStrength/10.0)) % 1; + #endif + + #if WIND_ON + half windOffset = sin((_Time.x + randomSeed) * _GrassSpeed * 10); + half2 windCenter = half2(0.5, 0.1); + #if ATLAS_ON + windCenter.x = ((_MaxXUV - _MinXUV) * windCenter.x) + _MinXUV; + windCenter.y = ((_MaxYUV - _MinYUV) * windCenter.y) + _MinYUV; + #endif + #if !MANUALWIND_ON + i.uv.x = fmod(abs(lerp(i.uv.x, i.uv.x + (_GrassWind * 0.01 * windOffset), uvRect.y)), 1); + #else + i.uv.x = fmod(abs(lerp(i.uv.x, i.uv.x + (_GrassWind * 0.01 * _GrassManualAnim), uvRect.y)), 1); + windOffset = _GrassManualAnim; + #endif + half2 delta = i.uv - windCenter; + half delta2 = dot(delta.xy, delta.xy); + half2 delta_offset = delta2 * windOffset; + i.uv = i.uv + half2(delta.y, -delta.x) * delta_offset * _GrassRadialBend; + #endif + + #if TEXTURESCROLL_ON && !ATLAS_ON + i.uv.x += ((_Time.y + randomSeed) * _TextureScrollXSpeed) % 1; + i.uv.y += ((_Time.y + randomSeed) * _TextureScrollYSpeed) % 1; + #endif + + #if PIXELATE_ON + half aspectRatio = _MainTex_TexelSize.x / _MainTex_TexelSize.y; + half2 pixelSize = float2(_PixelateSize, _PixelateSize * aspectRatio); + i.uv = floor(i.uv * pixelSize) / pixelSize; + #endif + + half4 col = tex2D(_MainTex, i.uv); + half originalAlpha = col.a; + col *= i.color; + #if PREMULTIPLYALPHA_ON + col.rgb *= col.a; + #endif + + #if GLITCH_ON + half2 uvGlitch = uvRect; + uvGlitch.y -= 0.5; + half lineNoise = pow(rand2(floor(uvGlitch * half2(24., 19.) * _GlitchSize) * 4.0, randomSeed), 3.0) * _GlitchAmount + * pow(rand2(floor(uvGlitch * half2(38., 14.) * _GlitchSize) * 4.0, randomSeed), 3.0); + col = tex2D(_MainTex, i.uv + half2(lineNoise * 0.02 * rand2(half2(2.0, 1), randomSeed), 0)) * i.color; + #endif + + #if CHROMABERR_ON + half4 r = tex2D(_MainTex, i.uv + half2(_ChromAberrAmount/10, 0)) * i.color; + half4 b = tex2D(_MainTex, i.uv + half2(-_ChromAberrAmount/10, 0)) * i.color; + col = half4(r.r * r.a, col.g, b.b * b.a, max(max(r.a, b.a) * _ChromAberrAlpha, col.a)); + #endif + + #if BLUR_ON + #if ATLAS_ON + #if !BLURISHD_ON + col = BlurHD(i.uv, _MainTex, _BlurIntensity, (_MaxXUV - _MinXUV), (_MaxYUV - _MinYUV)) * i.color; + #else + col = Blur(i.uv, _MainTex, _BlurIntensity * (_MaxXUV - _MinXUV)) * i.color; + #endif + #else + #if !BLURISHD_ON + col = BlurHD(i.uv, _MainTex, _BlurIntensity, 1, 1) * i.color; + #else + col = Blur(i.uv, _MainTex, _BlurIntensity) * i.color; + #endif + #endif + #endif + + #if MOTIONBLUR_ON + _MotionBlurAngle = _MotionBlurAngle * 3.1415926; + #define rot(n) mul(n, half2x2(cos(_MotionBlurAngle), -sin(_MotionBlurAngle), sin(_MotionBlurAngle), cos(_MotionBlurAngle))) + _MotionBlurDist = _MotionBlurDist * 0.005; + #if ATLAS_ON + _MotionBlurDist *= (_MaxXUV - _MinXUV); + #endif + col.rgb += tex2D(_MainTex, i.uv + rot(half2(-_MotionBlurDist, -_MotionBlurDist))); + col.rgb += tex2D(_MainTex, i.uv + rot(half2(-_MotionBlurDist * 2, -_MotionBlurDist * 2))); + col.rgb += tex2D(_MainTex, i.uv + rot(half2(-_MotionBlurDist * 3, -_MotionBlurDist * 3))); + col.rgb += tex2D(_MainTex, i.uv + rot(half2(-_MotionBlurDist * 4, -_MotionBlurDist * 4))); + col.rgb += tex2D(_MainTex, i.uv + rot(half2(_MotionBlurDist, _MotionBlurDist))); + col.rgb += tex2D(_MainTex, i.uv + rot(half2(_MotionBlurDist * 2, _MotionBlurDist * 2))); + col.rgb += tex2D(_MainTex, i.uv + rot(half2(_MotionBlurDist * 3, _MotionBlurDist * 3))); + col.rgb += tex2D(_MainTex, i.uv + rot(half2(_MotionBlurDist * 4, _MotionBlurDist * 4))); + col.rgb = col.rgb / 9; + #endif + + #if NEGATIVE_ON + col.rgb = lerp(col.rgb, 1 - col.rgb, _NegativeAmount); + #endif + + half luminance = 0; + #if GREYSCALE_ON && !GREYSCALEOUTLINE_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + luminance = saturate(luminance + _GreyscaleLuminosity); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _GreyscaleTintColor, _GreyscaleBlend); + #endif + + #if GHOST_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + half4 ghostResult; + ghostResult.a = saturate(luminance - _GhostTransparency) * col.a; + ghostResult.rgb = col.rgb * (luminance + _GhostColorBoost); + col = lerp(col, ghostResult, _GhostBlend); + #endif + + #if INNEROUTLINE_ON + half3 innerT = abs(GetPixel(0, _InnerOutlineThickness, i.uv, _MainTex) - GetPixel(0, -_InnerOutlineThickness, i.uv, _MainTex)); + innerT += abs(GetPixel(_InnerOutlineThickness, 0, i.uv, _MainTex) - GetPixel(-_InnerOutlineThickness, 0, i.uv, _MainTex)); + #if !ONLYINNEROUTLINE_ON + innerT = (innerT / 2.0) * col.a * _InnerOutlineAlpha; + col.rgb += length(innerT) * _InnerOutlineColor.rgb * _InnerOutlineGlow; + #else + innerT *= col.a * _InnerOutlineAlpha; + col.rgb = length(innerT) * _InnerOutlineColor.rgb * _InnerOutlineGlow; + col.a = step(0.3, col.r+col.g+col.b); + #endif + #endif + + #if HITEFFECT_ON + col.rgb = lerp(col.rgb, _HitEffectColor.rgb * _HitEffectGlow, _HitEffectBlend); + #endif + + #if GRADIENT_ON + half2 tiledUvGrad = half2(uvRect.x / _MainTex_ST.x, uvRect.y / _MainTex_ST.y); + #if GRADIENT2COL_ON + _GradTopRightCol = _GradTopLeftCol; + _GradBotRightCol = _GradBotLeftCol; + #endif + #if RADIALGRADIENT_ON + half radialDist = 1 - length(tiledUvGrad - half2(0.5, 0.5)); + radialDist *= (_MainTex_TexelSize.w / _MainTex_TexelSize.z); + radialDist = saturate(_GradBoostX * radialDist); + half4 gradientResult = lerp(_GradTopLeftCol, _GradBotLeftCol, radialDist); + #else + half gradXLerpFactor = saturate(pow(tiledUvGrad.x, _GradBoostX)); + half4 gradientResult = lerp(lerp(_GradBotLeftCol, _GradBotRightCol, gradXLerpFactor), + lerp(_GradTopLeftCol, _GradTopRightCol, gradXLerpFactor), saturate(pow(tiledUvGrad.y, _GradBoostY))); + #endif + gradientResult = lerp(col, gradientResult, _GradBlend); + col.rgb = gradientResult.rgb * col.a; + col.a *= gradientResult.a; + #endif + + #if CONTRAST_ON + col.rgb = (col.rgb - float3(0.5, 0.5, 0.5)) * _Contrast + float3(0.5, 0.5, 0.5); + col.rgb += _Brightness; + #endif + + #if COLORSWAP_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + half4 swapMask = tex2D(_ColorSwapTex, i.uv); + swapMask.rgb *= swapMask.a; + half3 redSwap = _ColorSwapRed * swapMask.r * saturate(luminance + _ColorSwapRedLuminosity); + half3 greenSwap = _ColorSwapGreen * swapMask.g * saturate(luminance + _ColorSwapGreenLuminosity); + half3 blueSwap = _ColorSwapBlue * swapMask.b * saturate(luminance + _ColorSwapBlueLuminosity); + swapMask.rgb = col.rgb * saturate(1 - swapMask.r - swapMask.g - swapMask.b); + col.rgb = lerp(col.rgb, swapMask.rgb + redSwap + greenSwap + blueSwap, _ColorSwapBlend); + #endif + + #if COLORRAMP_ON && !COLORRAMPOUTLINE_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + luminance = saturate(luminance + _ColorRampLuminosity); + #if GRADIENTCOLORRAMP_ON + col.rgb = lerp(col.rgb, tex2D(_ColorRampTexGradient, half2(luminance, 0)).rgb, _ColorRampBlend); + #else + col.rgb = lerp(col.rgb, tex2D(_ColorRampTex, half2(luminance, 0)).rgb, _ColorRampBlend); + #endif + #endif + + #if CHANGECOLOR_ON + float3 currChangeColor = saturate(col.rgb); + luminance = 0.3 * currChangeColor.r + 0.59 * currChangeColor.g + 0.11 * currChangeColor.b; + luminance = saturate(luminance + _ColorChangeLuminosity); + half3 dif = abs(currChangeColor - _ColorChangeTarget.rgb); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _ColorChangeNewCol.rgb, + max(sign(1 - saturate(dif.x + dif.y + dif.z) - _ColorChangeTolerance), 0.0)); + #if CHANGECOLOR2_ON + dif = abs(currChangeColor - _ColorChangeTarget2.rgb); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _ColorChangeNewCol2.rgb, + max(sign(1 - saturate(dif.x + dif.y + dif.z) - _ColorChangeTolerance2), 0.0)); + #endif + #if CHANGECOLOR3_ON + dif = abs(currChangeColor - _ColorChangeTarget3.rgb); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _ColorChangeNewCol3.rgb, + max(sign(1 - saturate(dif.x + dif.y + dif.z) - _ColorChangeTolerance3), 0.0)); + #endif + #endif + + #if POSTERIZE_ON && !POSTERIZEOUTLINE_ON + col.rgb = pow(col.rgb, _PosterizeGamma) * _PosterizeNumColors; + col.rgb = floor(col.rgb) / _PosterizeNumColors; + col.rgb = pow(col.rgb, 1.0 / _PosterizeGamma); + #endif + + #if HSV_ON + half3 resultHsv = half3(col.rgb); + half cosHsv = _HsvBright * _HsvSaturation * cos(_HsvShift * 3.14159265 / 180); + half sinHsv = _HsvBright * _HsvSaturation * sin(_HsvShift * 3.14159265 / 180); + resultHsv.x = (.299 * _HsvBright + .701 * cosHsv + .168 * sinHsv) * col.x + + (.587 * _HsvBright - .587 * cosHsv + .330 * sinHsv) * col.y + + (.114 * _HsvBright - .114 * cosHsv - .497 * sinHsv) * col.z; + resultHsv.y = (.299 * _HsvBright - .299 * cosHsv - .328 * sinHsv) *col.x + + (.587 * _HsvBright + .413 * cosHsv + .035 * sinHsv) * col.y + + (.114 * _HsvBright - .114 * cosHsv + .292 * sinHsv) * col.z; + resultHsv.z = (.299 * _HsvBright - .3 * cosHsv + 1.25 * sinHsv) * col.x + + (.587 * _HsvBright - .588 * cosHsv - 1.05 * sinHsv) * col.y + + (.114 * _HsvBright + .886 * cosHsv - .203 * sinHsv) * col.z; + col.rgb = resultHsv; + #endif + + #if OVERLAY_ON + half2 overlayUvs = i.uv; + overlayUvs.x += ((_Time.y + randomSeed) * _OverlayTextureScrollXSpeed) % 1; + overlayUvs.y += ((_Time.y + randomSeed) * _OverlayTextureScrollYSpeed) % 1; + half4 overlayCol = tex2D(_OverlayTex, TRANSFORM_TEX(overlayUvs, _OverlayTex)); + overlayCol.rgb *= _OverlayColor.rgb * _OverlayGlow; + #if !OVERLAYMULT_ON + overlayCol.rgb *= overlayCol.a * _OverlayColor.rgb * _OverlayColor.a * _OverlayBlend; + col.rgb += overlayCol.rgb; + #else + overlayCol.a *= _OverlayColor.a; + col = lerp(col, col * overlayCol, _OverlayBlend); + #endif + #endif + + //OUTLINE------------------------------------------------------------- + #if OUTBASE_ON + #if OUTBASEPIXELPERF_ON + half2 destUv = half2(_OutlinePixelWidth * _MainTex_TexelSize.x, _OutlinePixelWidth * _MainTex_TexelSize.y); + #else + half2 destUv = half2(_OutlineWidth * _MainTex_TexelSize.x * 200, _OutlineWidth * _MainTex_TexelSize.y * 200); + #endif + + #if OUTDIST_ON + i.uvOutDistTex.x += ((_Time.x + randomSeed) * _OutlineDistortTexXSpeed) % 1; + i.uvOutDistTex.y += ((_Time.x + randomSeed) * _OutlineDistortTexYSpeed) % 1; + #if ATLAS_ON + i.uvOutDistTex = half2((i.uvOutDistTex.x - _MinXUV) / (_MaxXUV - _MinXUV), (i.uvOutDistTex.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half outDistortAmnt = (tex2D(_OutlineDistortTex, i.uvOutDistTex).r - 0.5) * 0.2 * _OutlineDistortAmount; + destUv.x += outDistortAmnt; + destUv.y += outDistortAmnt; + #endif + + half spriteLeft = tex2D(_MainTex, i.uv + half2(destUv.x, 0)).a; + half spriteRight = tex2D(_MainTex, i.uv - half2(destUv.x, 0)).a; + half spriteBottom = tex2D(_MainTex, i.uv + half2(0, destUv.y)).a; + half spriteTop = tex2D(_MainTex, i.uv - half2(0, destUv.y)).a; + half result = spriteLeft + spriteRight + spriteBottom + spriteTop; + + #if OUTBASE8DIR_ON + half spriteTopLeft = tex2D(_MainTex, i.uv + half2(destUv.x, destUv.y)).a; + half spriteTopRight = tex2D(_MainTex, i.uv + half2(-destUv.x, destUv.y)).a; + half spriteBotLeft = tex2D(_MainTex, i.uv + half2(destUv.x, -destUv.y)).a; + half spriteBotRight = tex2D(_MainTex, i.uv + half2(-destUv.x, -destUv.y)).a; + result = result + spriteTopLeft + spriteTopRight + spriteBotLeft + spriteBotRight; + #endif + + result = step(0.05, saturate(result)); + + #if OUTTEX_ON + i.uvOutTex.x += ((_Time.x + randomSeed) * _OutlineTexXSpeed) % 1; + i.uvOutTex.y += ((_Time.x + randomSeed) * _OutlineTexYSpeed) % 1; + #if ATLAS_ON + i.uvOutTex = half2((i.uvOutTex.x - _MinXUV) / (_MaxXUV - _MinXUV), (i.uvOutTex.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half4 tempOutColor = tex2D(_OutlineTex, i.uvOutTex); + tempOutColor *= _OutlineColor; + _OutlineColor = tempOutColor; + #endif + + result *= (1 - originalAlpha) * _OutlineAlpha; + + half4 outline = _OutlineColor * i.color.a; + outline.rgb *= _OutlineGlow; + outline.a = result; + #if ONLYOUTLINE_ON + col = outline; + #else + col = lerp(col, outline, result); + #endif + #endif + //----------------------------------------------------------------------------- + + #if FADE_ON + half2 tiledUvFade1= TRANSFORM_TEX(i.uv, _FadeTex); + half2 tiledUvFade2 = TRANSFORM_TEX(i.uv, _FadeBurnTex); + #if ATLAS_ON + tiledUvFade1 = half2((tiledUvFade1.x - _MinXUV) / (_MaxXUV - _MinXUV), (tiledUvFade1.y - _MinYUV) / (_MaxYUV - _MinYUV)); + tiledUvFade2 = half2((tiledUvFade2.x - _MinXUV) / (_MaxXUV - _MinXUV), (tiledUvFade2.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half fadeTemp = tex2D(_FadeTex, tiledUvFade1).r; + half fade = smoothstep(_FadeAmount, _FadeAmount + _FadeBurnTransition, fadeTemp); + half fadeBurn = saturate(smoothstep(_FadeAmount - _FadeBurnWidth, _FadeAmount - _FadeBurnWidth + 0.1, fadeTemp) * _FadeAmount); + col.a *= fade; + _FadeBurnColor.rgb *= _FadeBurnGlow; + col += fadeBurn * tex2D(_FadeBurnTex, tiledUvFade2) * _FadeBurnColor * originalAlpha * (1 - col.a); + #endif + + #if SHADOW_ON + half shadowA = tex2D(_MainTex, i.uv + half2(_ShadowX, _ShadowY)).a; + half preMultShadowMask = 1 - (saturate(shadowA - col.a) * (1 - col.a)); + col.rgb *= 1 - ((shadowA - col.a) * (1 - col.a)); + col.rgb += (_ShadowColor * shadowA) * (1 - col.a); + col.a = max(shadowA * _ShadowAlpha * i.color.a, col.a); + #endif + + #if GLOW_ON + half4 emission; + #if GLOWTEX_ON + emission = tex2D(_GlowTex, i.uv); + #else + emission = col; + #endif + col.rgb *= _GlowGlobal; + emission.rgb *= emission.a * col.a * _Glow * _GlowColor; + col.rgb += emission.rgb; + #endif + + #if COLORRAMP_ON && COLORRAMPOUTLINE_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + luminance = saturate(luminance + _ColorRampLuminosity); + #if GRADIENTCOLORRAMP_ON + col.rgb = lerp(col.rgb, tex2D(_ColorRampTexGradient, half2(luminance, 0)).rgb, _ColorRampBlend); + #else + col.rgb = lerp(col.rgb, tex2D(_ColorRampTex, half2(luminance, 0)).rgb, _ColorRampBlend); + #endif + #endif + + #if GREYSCALE_ON && GREYSCALEOUTLINE_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + luminance = saturate(luminance + _GreyscaleLuminosity); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _GreyscaleTintColor, _GreyscaleBlend); + #endif + + #if POSTERIZE_ON && POSTERIZEOUTLINE_ON + col.rgb = pow(col.rgb, _PosterizeGamma) * _PosterizeNumColors; + col.rgb = floor(col.rgb) / _PosterizeNumColors; + col.rgb = pow(col.rgb, 1.0 / _PosterizeGamma); + #endif + + #if SHINE_ON + half2 uvShine = uvRect; + half cosAngle = cos(_ShineRotate); + half sinAngle = sin(_ShineRotate); + half2x2 rot = half2x2(cosAngle, -sinAngle, sinAngle, cosAngle); + uvShine -= half2(0.5, 0.5); + uvShine = mul(rot, uvShine); + uvShine += half2(0.5, 0.5); + half shineMask = tex2D(_ShineMask, i.uv).a; + half currentDistanceProjection = (uvShine.x + uvShine.y) / 2; + half whitePower = 1 - (abs(currentDistanceProjection - _ShineLocation) / _ShineWidth); + col.rgb += col.a * whitePower * _ShineGlow * max(sign(currentDistanceProjection - (_ShineLocation - _ShineWidth)), 0.0) + * max(sign((_ShineLocation + _ShineWidth) - currentDistanceProjection), 0.0) * _ShineColor * shineMask; + #endif + + #if HOLOGRAM_ON + half totalHologram = _HologramStripesAmount + _HologramUnmodAmount; + half hologramYCoord = ((uvRect.y + (((_Time.x + randomSeed) % 1) * _HologramStripesSpeed)) % totalHologram) / totalHologram; + hologramYCoord = abs(hologramYCoord); + half alpha = RemapFloat(saturate(hologramYCoord - (_HologramUnmodAmount/totalHologram)), 0.0, 1.0, _HologramMinAlpha, saturate(_HologramMaxAlpha)); + half hologramMask = max(sign((_HologramUnmodAmount/totalHologram) - hologramYCoord), 0.0); + half4 hologramResult = col; + hologramResult.a *= lerp(alpha, 1, hologramMask); + hologramResult.rgb *= max(1, _HologramMaxAlpha * max(sign(hologramYCoord - (_HologramUnmodAmount/totalHologram)), 0.0)); + hologramMask = 1 - step(0.01,hologramMask); + hologramResult.rgb += hologramMask * _HologramStripeColor * col.a; + col = lerp(col, hologramResult, _HologramBlend); + #endif + + #if FLICKER_ON + col.a *= saturate(col.a * step(frac(0.05 + (_Time.w + randomSeed) * _FlickerFreq), 1 - _FlickerPercent) + _FlickerAlpha); + #endif + + col.a *= _Alpha; + + #if ALPHACUTOFF_ON + clip((1 - _AlphaCutoffValue) - (1 - col.a) - 0.01); + #endif + + #if ALPHAROUND_ON + col.a = step(_AlphaRoundThreshold, col.a); + #endif + + #if ALPHAOUTLINE_ON + half alphaOutlineRes = pow(1 - col.a, max(_AlphaOutlinePower, 0.0001)) * step(_AlphaOutlineMinAlpha, col.a) * _AlphaOutlineBlend; + col.rgb = lerp(col.rgb, _AlphaOutlineColor.rgb * _AlphaOutlineGlow, alphaOutlineRes); + col.a = lerp(col.a, 1, alphaOutlineRes > 1); + #endif + + col *= _Color; + + #if FOG_ON + UNITY_APPLY_FOG(i.fogCoord, col); + #endif + + return col; + } + ENDCG + } + } + CustomEditor "AllIn1SpriteShaderMaterialInspector" + //Fallback "Sprites/Default" //Remove fallback so that any shader error is obvious to the user +} \ No newline at end of file diff --git a/Assets/Plugins/AllIn1SpriteShader/Shaders/AllIn1SpriteShader.shader.meta b/Assets/Plugins/AllIn1SpriteShader/Shaders/AllIn1SpriteShader.shader.meta new file mode 100644 index 000000000..36ffc9c91 --- /dev/null +++ b/Assets/Plugins/AllIn1SpriteShader/Shaders/AllIn1SpriteShader.shader.meta @@ -0,0 +1,29 @@ +fileFormatVersion: 2 +guid: a36b7719ff0465b42ab1407d67672c5f +ShaderImporter: + externalObjects: {} + defaultTextures: + - _MainTex: {instanceID: 0} + - _GlowTex: {instanceID: 0} + - _FadeTex: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + - _FadeBurnTex: {fileID: 2800000, guid: 677cca399782dea41aedc1d292ecb67d, type: 3} + - _OutlineTex: {fileID: 2800000, guid: 74087f6d03f233e4a8a142fa01f9e5cf, type: 3} + - _OutlineDistortTex: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, + type: 3} + - _ColorSwapTex: {instanceID: 0} + - _ColorRampTex: {fileID: 2800000, guid: 279657edc397ece4b8029c727adf6ddc, type: 3} + - _DistortTex: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + - _ShineMask: {instanceID: 0} + - _ColorRampTexGradient: {instanceID: 0} + - _OverlayTex: {fileID: 2800000, guid: 677cca399782dea41aedc1d292ecb67d, type: 3} + nonModifiableTextures: [] + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 156513 + packageName: All In 1 Sprite Shader + packageVersion: 4.25 + assetPath: Assets/Plugins/AllIn1SpriteShader/Shaders/AllIn1SpriteShader.shader + uploadId: 708810 diff --git a/Assets/Plugins/AllIn1SpriteShader/Shaders/AllIn1SpriteShaderLit.shader b/Assets/Plugins/AllIn1SpriteShader/Shaders/AllIn1SpriteShaderLit.shader new file mode 100644 index 000000000..0adfe17d8 --- /dev/null +++ b/Assets/Plugins/AllIn1SpriteShader/Shaders/AllIn1SpriteShaderLit.shader @@ -0,0 +1,17664 @@ +//////////////////////////////////////// +// Generated with Better Shaders +// +// Auto-generated shader code, don't hand edit! +// +// Unity Version: 2019.4.16f1 +// Render Pipeline: URP2023 +// Platform: WindowsEditor +//////////////////////////////////////// + + +Shader "AllIn1SpriteShader/AllIn1SpriteShaderLit" +{ + Properties + { + + _MainTex ("Main Texture", 2D) = "white" {} //0 + _Color("Main Color", Color) = (1,1,1,1) //1 + _Alpha("General Alpha", Range(0,1)) = 1 //2 + + _GlowColor("Glow Color", Color) = (1,1,1,1) //3 + _Glow("Glow Color Intensity", Range(0,100)) = 10 //4 + _GlowGlobal("Global Glow Intensity", Range(1,100)) = 1 //5 + [NoScaleOffset] _GlowTex("Glow Texture", 2D) = "white" {} //6 + + _FadeTex("Fade Texture", 2D) = "white" {} //7 + _FadeAmount("Fade Amount", Range(-0.1,1)) = -0.1 //8 + _FadeBurnWidth("Fade Burn Width", Range(0,1)) = 0.025 //9 + _FadeBurnTransition("Burn Transition", Range(0.01,0.5)) = 0.075 //10 + _FadeBurnColor("Fade Burn Color", Color) = (1,1,0,1) //11 + _FadeBurnTex("Fade Burn Texture", 2D) = "white" {} //12 + _FadeBurnGlow("Fade Burn Glow", Range(1,250)) = 2//13 + + _OutlineColor("Outline Base Color", Color) = (1,1,1,1) //14 + _OutlineAlpha("Outline Base Alpha", Range(0,1)) = 1 //15 + _OutlineGlow("Outline Base Glow", Range(1,100)) = 1.5 //16 + _OutlineWidth("Outline Base Width", Range(0,0.2)) = 0.004 //17 + _OutlinePixelWidth("Outline Base Pixel Width", Int) = 1 //18 + + [Space] + _OutlineTex("Outline Texture", 2D) = "white" {} //19 + _OutlineTexXSpeed("Texture scroll speed X", Range(-50,50)) = 10 //20 + _OutlineTexYSpeed("Texture scroll speed Y", Range(-50,50)) = 0 //21 + + [Space] + _OutlineDistortTex("Outline Distortion Texture", 2D) = "white" {} //22 + _OutlineDistortAmount("Outline Distortion Amount", Range(0,2)) = 0.5 //23 + _OutlineDistortTexXSpeed("Distortion scroll speed X", Range(-50,50)) = 5 //24 + _OutlineDistortTexYSpeed("Distortion scroll speed Y", Range(-50,50)) = 5 //25 + + _AlphaOutlineColor("Color", Color) = (1, 1, 1, 1) //26 + _AlphaOutlineGlow("Outline Glow", Range(1,100)) = 5 //27 + _AlphaOutlinePower("Power", Range(0, 5)) = 1 // 28 + _AlphaOutlineMinAlpha("Min Alpha", Range(0, 1)) = 0 // 29 + _AlphaOutlineBlend("Blend", Range(0, 1)) = 1 // 30 + + _GradBlend("Gradient Blend", Range(0,1)) = 1 //31 + _GradTopLeftCol("Top Color", Color) = (1,0,0,1) //32 + _GradTopRightCol("Top Color 2", Color) = (1, 1, 0, 1) //33 + _GradBotLeftCol("Bot Color", Color) = (0,0,1,1) //34 + _GradBotRightCol("Bot Color 2", Color) = (0, 1, 0, 1) //35 + + [NoScaleOffset] _ColorSwapTex("Color Swap Texture", 2D) = "black" {} //36 + [HDR] _ColorSwapRed("Red Channel", Color) = (1,1,1,1) //37 + _ColorSwapRedLuminosity("Red luminosity", Range(-1,1)) = 0.5 //38 + [HDR] _ColorSwapGreen("Green Channel", Color) = (1,1,1,1) //39 + _ColorSwapGreenLuminosity("Green luminosity", Range(-1,1)) = 0.5 //40 + [HDR] _ColorSwapBlue("Blue Channel", Color) = (1,1,1,1) //41 + _ColorSwapBlueLuminosity("Blue luminosity", Range(-1,1)) = 0.5 //42 + + _HsvShift("Hue Shift", Range(0, 360)) = 180 //43 + _HsvSaturation("Saturation", Range(0, 2)) = 1 //44 + _HsvBright("Brightness", Range(0, 2)) = 1 //45 + + _HitEffectColor("Hit Effect Color", Color) = (1,1,1,1) //46 + _HitEffectGlow("Glow Intensity", Range(1,100)) = 5 //47 + [Space] + _HitEffectBlend("Hit Effect Blend", Range(0,1)) = 1 //48 + + _NegativeAmount("Negative Amount", Range(0, 1)) = 1 //49 + + _PixelateSize("Pixelate size", Range(4,512)) = 32 //50 + + [NoScaleOffset] _ColorRampTex("Color ramp Texture", 2D) = "white" {} //51 + _ColorRampLuminosity("Color ramp luminosity", Range(-1,1)) = 0 //52 + [Toggle()] _ColorRampOutline("Affects everything?", float) = 0 //53 + + _GreyscaleLuminosity("Greyscale luminosity", Range(-1,1)) = 0 //54 + [Toggle()] _GreyscaleOutline("Affects everything?", float) = 0 //55 + _GreyscaleTintColor("Greyscale Tint Color", Color) = (1,1,1,1) //56 + + _PosterizeNumColors("Number of Colors", Range(0,100)) = 8 //57 + _PosterizeGamma("Posterize Amount", Range(0.1,10)) = 0.75 //58 + [Toggle()] _PosterizeOutline("Affects everything?", float) = 0 //59 + + _BlurIntensity("Blur Intensity", Range(0,100)) = 10 //60 + [Toggle()] _BlurHD("Blur is Low Res?", float) = 0 //61 + + _MotionBlurAngle("Motion Blur Angle", Range(-1, 1)) = 0.1 //62 + _MotionBlurDist("Motion Blur Distance", Range(-3, 3)) = 1.25 //63 + + _GhostColorBoost("Ghost Color Boost", Range(0,5)) = 1 //64 + _GhostTransparency("Ghost Transparency", Range(0,1)) = 0 //65 + + _InnerOutlineColor("Inner Outline Color", Color) = (1,0,0,1) //66 + _InnerOutlineThickness("Outline Thickness", Range(0,3)) = 1 //67 + _InnerOutlineAlpha("Inner Outline Alpha", Range(0,1)) = 1 //68 + _InnerOutlineGlow("Inner Outline Glow", Range(1,250)) = 4 //69 + + _AlphaCutoffValue("Alpha cutoff value", Range(0, 1)) = 0.25 //70 + + [Toggle()] _OnlyOutline("Only render outline?", float) = 0 //71 + [Toggle()] _OnlyInnerOutline("Only render inner outline?", float) = 0 //72 + + _HologramStripesAmount("Stripes Amount", Range(0, 1)) = 0.1 //73 + _HologramUnmodAmount("Unchanged Amount", Range(0, 1)) = 0.0 //74 + _HologramStripesSpeed("Stripes Speed", Range(-20, 20)) = 4.5 //75 + _HologramMinAlpha("Min Alpha", Range(0, 1)) = 0.1 //76 + _HologramMaxAlpha("Max Alpha", Range(0, 100)) = 0.75 //77 + + _ChromAberrAmount("ChromAberr Amount", Range(0, 1)) = 1 //78 + _ChromAberrAlpha("ChromAberr Alpha", Range(0, 1)) = 0.4 //79 + + _GlitchAmount("Glitch Amount", Range(0, 20)) = 3 //80 + + _FlickerPercent("Flicker Percent", Range(0, 1)) = 0.05 //81 + _FlickerFreq("Flicker Frequency", Range(0, 5)) = 0.2 //82 + _FlickerAlpha("Flicker Alpha", Range(0, 1)) = 0 //83 + + _ShadowX("Shadow X Axis", Range(-0.5, 0.5)) = 0.1 //84 + _ShadowY("Shadow Y Axis", Range(-0.5, 0.5)) = -0.05 //85 + _ShadowAlpha("Shadow Alpha", Range(0, 1)) = 0.5 //86 + _ShadowColor("Shadow Color", Color) = (0, 0, 0, 1) //87 + + _HandDrawnAmount("Hand Drawn Amount", Range(0, 20)) = 10 //88 + _HandDrawnSpeed("Hand Drawn Speed", Range(1, 15)) = 5 //89 + + _GrassSpeed("Speed", Range(0,50)) = 2 //90 + _GrassWind("Bend amount", Range(0,50)) = 20 //91 + [Space] + [Toggle()] _GrassManualToggle("Manually animated?", float) = 0 //92 + _GrassManualAnim("Manual Anim Value", Range(-1,1)) = 1 //93 + + _WaveAmount("Wave Amount", Range(0, 25)) = 7 //94 + _WaveSpeed("Wave Speed", Range(0, 25)) = 10 //95 + _WaveStrength("Wave Strength", Range(0, 25)) = 7.5 //96 + _WaveX("Wave X Axis", Range(0, 1)) = 0 //97 + _WaveY("Wave Y Axis", Range(0, 1)) = 0.5 //98 + + _RectSize("Rect Size", Range(1, 4)) = 1 //99 + + _OffsetUvX("X axis", Range(-1, 1)) = 0 //100 + _OffsetUvY("Y axis", Range(-1, 1)) = 0 //101 + + _ClipUvLeft("Clipping Left", Range(0, 1)) = 0 //102 + _ClipUvRight("Clipping Right", Range(0, 1)) = 0 //103 + _ClipUvUp("Clipping Up", Range(0, 1)) = 0 //104 + _ClipUvDown("Clipping Down", Range(0, 1)) = 0 //105 + + _TextureScrollXSpeed("Speed X Axis", Range(-5, 5)) = 1 //106 + _TextureScrollYSpeed("Speed Y Axis", Range(-5, 5)) = 0 //107 + + _ZoomUvAmount("Zoom Amount", Range(0.1, 5)) = 0.5 //108 + + _DistortTex("Distortion Texture", 2D) = "white" {} //109 + _DistortAmount("Distortion Amount", Range(0,2)) = 0.5 //110 + _DistortTexXSpeed("Scroll speed X", Range(-50,50)) = 5 //111 + _DistortTexYSpeed("Scroll speed Y", Range(-50,50)) = 5 //112 + + _TwistUvAmount("Twist Amount", Range(0, 3.1416)) = 1 //113 + _TwistUvPosX("Twist Pos X Axis", Range(0, 1)) = 0.5 //114 + _TwistUvPosY("Twist Pos Y Axis", Range(0, 1)) = 0.5 //115 + _TwistUvRadius("Twist Radius", Range(0, 3)) = 0.75 //116 + + _RotateUvAmount("Rotate Angle(radians)", Range(0, 6.2831)) = 0 //117 + + _FishEyeUvAmount("Fish Eye Amount", Range(0, 0.5)) = 0.35 //118 + + _PinchUvAmount("Pinch Amount", Range(0, 0.5)) = 0.35 //119 + + _ShakeUvSpeed("Shake Speed", Range(0, 20)) = 2.5 //120 + _ShakeUvX("X Multiplier", Range(0, 5)) = 1.5 //121 + _ShakeUvY("Y Multiplier", Range(0, 5)) = 1 //122 + + _ColorChangeTolerance("Tolerance", Range(0, 1)) = 0.25 //123 + _ColorChangeTarget("Color to change", Color) = (1, 0, 0, 1) //124 + [HDR] _ColorChangeNewCol("New Color", Color) = (1, 1, 0, 1) //125 + _ColorChangeLuminosity("New Color Luminosity", Range(0, 1)) = 0.0 //126 + + _RoundWaveStrength("Wave Strength", Range(0, 1)) = 0.7 //127 + _RoundWaveSpeed("Wave Speed", Range(0, 5)) = 2 //128 + + [Toggle()] _BillboardY("Billboard on both axis?", float) = 0 //129 + _ZWrite ("Depth Write", Float) = 1.0 // 130 + + _MySrcMode ("SrcMode", Float) = 5 // 131 + _MyDstMode ("DstMode", Float) = 10 // 132 + + _ShineColor("Shine Color", Color) = (1,1,1,1) // 133 + _ShineLocation("Shine Location", Range(0,1)) = 0.5 // 134 + _ShineRotate("Rotate Angle(radians)", Range(0, 6.2831)) = 0 //135 + _ShineWidth("Shine Width", Range(0.05,1)) = 0.1 // 136 + _ShineGlow("Shine Glow", Range(0,100)) = 1 // 137 + [NoScaleOffset] _ShineMask("Shine Mask", 2D) = "white" {} // 138 + + _GlitchSize("Glitch Size", Range(0.25, 5)) = 1 //139 + _HologramStripeColor("Stripes Color", Color) = (0,1,1,1) //140 + _GradBoostX("Boost X axis", Range(0.1, 5)) = 1.2 //141 + _GradBoostY("Boost Y axis", Range(0.1, 5)) = 1.2 //142 + [Toggle()] _GradIsRadial("Radial Gradient?", float) = 0 //143 + _AlphaRoundThreshold("Round Threshold", Range(0.005, 1.0)) = 0.5 //144 + _GrassRadialBend("Radial Bend", Range(0.0, 5.0)) = 0.1 //145 + + _ColorChangeTolerance2("Tolerance 2", Range(0, 1)) = 0.25 //146 + _ColorChangeTarget2("Color to change 2", Color) = (1, 0, 0, 1) //147 + [HDR] _ColorChangeNewCol2("New Color 2", Color) = (1, 1, 0, 1) //148 + _ColorChangeTolerance3("Tolerance 3", Range(0, 1)) = 0.25 //149 + _ColorChangeTarget3("Color to change 3", Color) = (1, 0, 0, 1) //150 + [HDR] _ColorChangeNewCol3("New Color 3", Color) = (1, 1, 0, 1) //151 + + _Contrast ("Contrast", Range(0, 6)) = 1 // 152 + _Brightness ("Brightness", Range(-1, 1)) = 0 // 153 + + _ColorSwapBlend ("Color Swap Blend", Range(0, 1)) = 1 // 154 + _ColorRampBlend ("Color Ramp Blend", Range(0, 1)) = 1 // 155 + _GreyscaleBlend ("Greyscale Blend", Range(0, 1)) = 1 // 156 + _GhostBlend ("Ghost Blend", Range(0, 1)) = 1 // 157 + _HologramBlend ("Hologram Blend", Range(0, 1)) = 1 // 158 + + [AllIn1ShaderGradient] _ColorRampTexGradient("Color ramp Gradient", 2D) = "white" {} //159 + + _OverlayTex("Overlay Texture", 2D) = "white" {} //160 + _OverlayColor("Overlay Color", Color) = (1, 1, 1, 1) //161 + _OverlayGlow("Overlay Glow", Range(0,25)) = 1 // 162 + _OverlayBlend("Overlay Blend", Range(0, 1)) = 1 // 163 + + _RadialStartAngle("Radial Start Angle", Range(0, 360)) = 90 //164 + _RadialClip("Radial Clip", Range(0, 360)) = 45 //165 + _RadialClip2("Radial Clip 2", Range(0, 360)) = 0 //166 + + _WarpStrength("Warp Strength", Range(0, 0.1)) = 0.025 //167 + _WarpSpeed("Warp Speed", Range(0, 25)) = 8 //168 + _WarpScale("Warp Scale", Range(0.05, 3)) = 0.5 //169 + + _OverlayTextureScrollXSpeed("Speed X Axis", Range(-5, 5)) = 0.25 //170 + _OverlayTextureScrollYSpeed("Speed Y Axis", Range(-5, 5)) = 0.25 //171 + + _ZTestMode ("Z Test Mode", Float) = 4 + _CullingOption ("Culling Option", float) = 0 + + [HideInInspector] _MinXUV("_MinXUV", Range(0, 1)) = 0.0 + [HideInInspector] _MaxXUV("_MaxXUV", Range(0, 1)) = 1.0 + [HideInInspector] _MinYUV("_MinYUV", Range(0, 1)) = 0.0 + [HideInInspector] _MaxYUV("_MaxYUV", Range(0, 1)) = 1.0 + [HideInInspector] _RandomSeed("_MaxYUV", Range(0, 10000)) = 0.0 + _EditorDrawers("Editor Drawers", Int) = 6 + + [Normal][NoScaleOffset] _NormalMap("Normal Map", 2D) = "bump" {} + _NormalStrength("Normal Strength", Range(0, 15)) = 1.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) = "" {} + + } + SubShader + { + Tags { "RenderPipeline"="UniversalPipeline" "RenderType" = "Opaque" "UniversalMaterialType" = "Lit" "Queue" = "Geometry" } + + + + + Pass + { + Name "Universal Forward" + Tags + { + "LightMode" = "UniversalForward" + } + Cull Back + Blend One Zero + ZTest LEqual + ZWrite On + + Blend One Zero, One Zero +Cull Back +ZTest LEqual +ZWrite On + + Tags { "RenderType" = "Opaque" "Queue" = "Geometry" "PreviewType" = "Plane" } + Cull [_CullingOption] + ZWrite [_ZWrite] + ZTest [_ZTestMode] + + + HLSLPROGRAM + + #pragma vertex Vert + #pragma fragment Frag + + #pragma target 3.0 + + #pragma prefer_hlslcc gles + #pragma exclude_renderers d3d11_9x + #pragma multi_compile_fog + #pragma multi_compile_instancing + #pragma instancing_options renderinglayer + + // Keywords + #pragma multi_compile_fragment _ _SCREEN_SPACE_OCCLUSION + #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 _ _ADDITIONAL_LIGHTS_VERTEX _ADDITIONAL_LIGHTS + #pragma multi_compile_fragment _ _ADDITIONAL_LIGHT_SHADOWS + #pragma multi_compile_fragment _ _REFLECTION_PROBE_BLENDING + #pragma multi_compile_fragment _ _REFLECTION_PROBE_BOX_PROJECTION + #pragma multi_compile_fragment _ _SHADOWS_SOFT + #pragma multi_compile_fragment _ _SHADOWS_SOFT_LOW + #pragma multi_compile_fragment _ _SHADOWS_SOFT_MEDIUM + #pragma multi_compile_fragment _ _SHADOWS_SOFT_HIGH + #pragma multi_compile _ LIGHTMAP_SHADOW_MIXING + #pragma multi_compile _ SHADOWS_SHADOWMASK + #pragma multi_compile_fragment _ _DBUFFER_MRT1 _DBUFFER_MRT2 _DBUFFER_MRT3 + #pragma multi_compile_fragment _ _LIGHT_LAYERS + #pragma multi_compile_fragment _ DEBUG_DISPLAY + #pragma multi_compile_fragment _ _LIGHT_COOKIES + #pragma multi_compile _ _FORWARD_PLUS + #pragma multi_compile _ EVALUATE_SH_VERTEX + #pragma multi_compile _ EVALUATE_SH_MIXED + #pragma multi_compile_fragment _ LOD_FADE_CROSSFADE + + + // GraphKeywords: + + #define SHADER_PASS SHADERPASS_FORWARD + #define VARYINGS_NEED_FOG_AND_VERTEX_LIGHT + #define _PASSFORWARD 1 + #define _FOG_FRAGMENT 1 + + + + #pragma shader_feature_local GLOW_ON + #pragma shader_feature_local FADE_ON + #pragma shader_feature_local OUTBASE_ON + #pragma shader_feature_local ONLYOUTLINE_ON + #pragma shader_feature_local GRADIENT_ON + #pragma shader_feature_local GRADIENT2COL_ON + #pragma shader_feature_local RADIALGRADIENT_ON + #pragma shader_feature_local COLORSWAP_ON + #pragma shader_feature_local HSV_ON + #pragma shader_feature_local CHANGECOLOR_ON + #pragma shader_feature_local CHANGECOLOR2_ON + #pragma shader_feature_local CHANGECOLOR3_ON + #pragma shader_feature_local COLORRAMP_ON + #pragma shader_feature_local GRADIENTCOLORRAMP_ON + #pragma shader_feature_local HITEFFECT_ON + #pragma shader_feature_local NEGATIVE_ON + #pragma shader_feature_local PIXELATE_ON + #pragma shader_feature_local GREYSCALE_ON + #pragma shader_feature_local POSTERIZE_ON + #pragma shader_feature_local BLUR_ON + #pragma shader_feature_local MOTIONBLUR_ON + #pragma shader_feature_local GHOST_ON + #pragma shader_feature_local ALPHAOUTLINE_ON + #pragma shader_feature_local INNEROUTLINE_ON + #pragma shader_feature_local ONLYINNEROUTLINE_ON + #pragma shader_feature_local HOLOGRAM_ON + #pragma shader_feature_local CHROMABERR_ON + #pragma shader_feature_local GLITCH_ON + #pragma shader_feature_local FLICKER_ON + #pragma shader_feature_local SHADOW_ON + #pragma shader_feature_local SHINE_ON + #pragma shader_feature_local CONTRAST_ON + #pragma shader_feature_local OVERLAY_ON + #pragma shader_feature_local OVERLAYMULT_ON + #pragma shader_feature_local DOODLE_ON + #pragma shader_feature_local WIND_ON + #pragma shader_feature_local WAVEUV_ON + #pragma shader_feature_local ROUNDWAVEUV_ON + #pragma shader_feature_local RECTSIZE_ON + #pragma shader_feature_local OFFSETUV_ON + #pragma shader_feature_local CLIPPING_ON + #pragma shader_feature_local RADIALCLIPPING_ON + #pragma shader_feature_local TEXTURESCROLL_ON + #pragma shader_feature_local ZOOMUV_ON + #pragma shader_feature_local DISTORT_ON + #pragma shader_feature_local WARP_ON + #pragma shader_feature_local TWISTUV_ON + #pragma shader_feature_local ROTATEUV_ON + #pragma shader_feature_local POLARUV_ON + #pragma shader_feature_local FISHEYE_ON + #pragma shader_feature_local PINCH_ON + #pragma shader_feature_local SHAKEUV_ON + + #pragma shader_feature_local GLOWTEX_ON + #pragma shader_feature_local OUTTEX_ON + #pragma shader_feature_local OUTDIST_ON + #pragma shader_feature_local OUTBASE8DIR_ON + #pragma shader_feature_local OUTBASEPIXELPERF_ON + #pragma shader_feature_local COLORRAMPOUTLINE_ON + #pragma shader_feature_local GREYSCALEOUTLINE_ON + #pragma shader_feature_local POSTERIZEOUTLINE_ON + #pragma shader_feature_local BLURISHD_ON + #pragma shader_feature_local MANUALWIND_ON + #pragma shader_feature_local ATLAS_ON + #pragma shader_feature_local PREMULTIPLYALPHA_ON + + #pragma shader_feature BILBOARD_ON + #pragma shader_feature BILBOARDY_ON + + #pragma shader_feature NORMALMAP_ON + + + #define _URP 1 +#define _USINGTEXCOORD1 1 +#define _USINGTEXCOORD2 1 + + + // this has to be here or specular color will be ignored. Not in SG code + #if _SIMPLELIT + #define _SPECULAR_COLOR + #endif + + + // Includes + + #include_with_pragmas "Packages/com.unity.render-pipelines.universal/ShaderLibrary/DOTS.hlsl" + #include_with_pragmas "Packages/com.unity.render-pipelines.universal/ShaderLibrary/RenderingLayers.hlsl" + #include_with_pragmas "Packages/com.unity.render-pipelines.universal/ShaderLibrary/ProbeVolumeVariants.hlsl" + #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.universal/ShaderLibrary/Input.hlsl" + #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/TextureStack.hlsl" + #include_with_pragmas "Packages/com.unity.render-pipelines.core/ShaderLibrary/FoveatedRenderingKeywords.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" + #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/LODCrossFade.hlsl" + + + #undef WorldNormalVector + #define WorldNormalVector(data, normal) mul(normal, data.TBNMatrix) + + #define UnityObjectToWorldNormal(normal) mul(GetObjectToWorldMatrix(), normal) + + #define _WorldSpaceLightPos0 _MainLightPosition + + #define UNITY_DECLARE_TEX2D(name) TEXTURE2D(name); SAMPLER(sampler##name); + #define UNITY_DECLARE_TEX2D_NOSAMPLER(name) TEXTURE2D(name); + #define UNITY_DECLARE_TEX2DARRAY(name) TEXTURE2D_ARRAY(name); SAMPLER(sampler##name); + #define UNITY_DECLARE_TEX2DARRAY_NOSAMPLER(name) TEXTURE2D_ARRAY(name); + + #define UNITY_SAMPLE_TEX2DARRAY(tex,coord) SAMPLE_TEXTURE2D_ARRAY(tex, sampler##tex, coord.xy, coord.z) + #define UNITY_SAMPLE_TEX2DARRAY_LOD(tex,coord,lod) SAMPLE_TEXTURE2D_ARRAY_LOD(tex, sampler##tex, coord.xy, coord.z, lod) + #define UNITY_SAMPLE_TEX2D(tex, coord) SAMPLE_TEXTURE2D(tex, sampler##tex, coord) + #define UNITY_SAMPLE_TEX2D_SAMPLER(tex, samp, coord) SAMPLE_TEXTURE2D(tex, sampler##samp, coord) + + #define UNITY_SAMPLE_TEX2D_LOD(tex,coord, lod) SAMPLE_TEXTURE2D_LOD(tex, sampler_##tex, coord, lod) + #define UNITY_SAMPLE_TEX2D_SAMPLER_LOD(tex,samplertex,coord, lod) SAMPLE_TEXTURE2D_LOD (tex, sampler##samplertex,coord, lod) + + #if defined(UNITY_COMPILER_HLSL) + #define UNITY_INITIALIZE_OUTPUT(type,name) name = (type)0; + #else + #define UNITY_INITIALIZE_OUTPUT(type,name) + #endif + + #define sampler2D_float sampler2D + #define sampler2D_half sampler2D + + + + // data across stages, stripped like the above. + struct VertexToPixel + { + float4 pos : SV_POSITION; + float3 worldPos : TEXCOORD0; + float3 worldNormal : TEXCOORD1; + float4 worldTangent : TEXCOORD2; + float4 texcoord0 : TEXCOORD3; + float4 texcoord1 : TEXCOORD4; + float4 texcoord2 : TEXCOORD5; + + // #if %TEXCOORD3REQUIREKEY% + float4 texcoord3 : TEXCOORD6; + // #endif + + // #if %SCREENPOSREQUIREKEY% + // float4 screenPos : TEXCOORD7; + // #endif + + // #if %VERTEXCOLORREQUIREKEY% + half4 vertexColor : COLOR; + // #endif + + #if defined(LIGHTMAP_ON) + float2 lightmapUV : TEXCOORD8; + #endif + #if defined(DYNAMICLIGHTMAP_ON) + float2 dynamicLightmapUV : TEXCOORD9; + #endif + #if !defined(LIGHTMAP_ON) + float4 probeOcclusion : TEXCOORD8; + float3 sh : TEXCOORD10; + #endif + + #if defined(VARYINGS_NEED_FOG_AND_VERTEX_LIGHT) + float4 fogFactorAndVertexLight : TEXCOORD11; + #endif + + #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR) + float4 shadowCoord : TEXCOORD12; + #endif + + // #if %EXTRAV2F0REQUIREKEY% + // float4 extraV2F0 : TEXCOORD13; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // float4 extraV2F1 : TEXCOORD14; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // float4 extraV2F2 : TEXCOORD15; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // float4 extraV2F3 : TEXCOORD16; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // float4 extraV2F4 : TEXCOORD17; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // float4 extraV2F5 : TEXCOORD18; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // float4 extraV2F6 : TEXCOORD19; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // float4 extraV2F7 : TEXCOORD20; + // #endif + + #if UNITY_ANY_INSTANCING_ENABLED + uint instanceID : CUSTOM_INSTANCE_ID; + #endif + #if (defined(UNITY_STEREO_MULTIVIEW_ENABLED)) || (defined(UNITY_STEREO_INSTANCING_ENABLED) && (defined(SHADER_API_GLES3) || defined(SHADER_API_GLCORE))) + uint stereoTargetEyeIndexAsBlendIdx0 : BLENDINDICES0; + #endif + #if (defined(UNITY_STEREO_INSTANCING_ENABLED)) + uint stereoTargetEyeIndexAsRTArrayIdx : SV_RenderTargetArrayIndex; + #endif + #if defined(SHADER_STAGE_FRAGMENT) && defined(VARYINGS_NEED_CULLFACE) + FRONT_FACE_TYPE cullFace : FRONT_FACE_SEMANTIC; + #endif + + #if _PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR)) + float4 previousPositionCS : TEXCOORD21; // Contain previous transform position (in case of skinning for example) + float4 positionCS : TEXCOORD22; + #endif + }; + + + + + // data describing the user output of a pixel + struct Surface + { + half3 Albedo; + half Height; + half3 Normal; + half Smoothness; + half3 Emission; + half Metallic; + half3 Specular; + half Occlusion; + half SpecularPower; // for simple lighting + half Alpha; + float outputDepth; // if written, SV_Depth semantic is used. ShaderData.clipPos.z is unused value + // HDRP Only + half SpecularOcclusion; + half SubsurfaceMask; + half Thickness; + half CoatMask; + half CoatSmoothness; + half Anisotropy; + half IridescenceMask; + half IridescenceThickness; + int DiffusionProfileHash; + float SpecularAAThreshold; + float SpecularAAScreenSpaceVariance; + // requires _OVERRIDE_BAKEDGI to be defined, but is mapped in all pipelines + float3 DiffuseGI; + float3 BackDiffuseGI; + float3 SpecularGI; + float ior; + float3 transmittanceColor; + float atDistance; + float transmittanceMask; + // requires _OVERRIDE_SHADOWMASK to be defines + float4 ShadowMask; + + // for decals + float NormalAlpha; + float MAOSAlpha; + + + }; + + // Data the user declares in blackboard blocks + struct Blackboard + { + + float blackboardDummyData; + }; + + // data the user might need, this will grow to be big. But easy to strip + struct ShaderData + { + float4 clipPos; // SV_POSITION + float3 localSpacePosition; + float3 localSpaceNormal; + float3 localSpaceTangent; + + float3 worldSpacePosition; + float3 worldSpaceNormal; + float3 worldSpaceTangent; + float tangentSign; + + float3 worldSpaceViewDir; + float3 tangentSpaceViewDir; + + float4 texcoord0; + float4 texcoord1; + float4 texcoord2; + float4 texcoord3; + + float2 screenUV; + float4 screenPos; + + float4 vertexColor; + bool isFrontFace; + + float4 extraV2F0; + float4 extraV2F1; + float4 extraV2F2; + float4 extraV2F3; + float4 extraV2F4; + float4 extraV2F5; + float4 extraV2F6; + float4 extraV2F7; + + float3x3 TBNMatrix; + Blackboard blackboard; + }; + + struct VertexData + { + #if SHADER_TARGET > 30 + // uint vertexID : SV_VertexID; + #endif + float4 vertex : POSITION; + float3 normal : NORMAL; + float4 tangent : TANGENT; + float4 texcoord0 : TEXCOORD0; + + // optimize out mesh coords when not in use by user or lighting system + #if _URP && (_USINGTEXCOORD1 || _PASSMETA || _PASSFORWARD || _PASSGBUFFER) + float4 texcoord1 : TEXCOORD1; + #endif + + #if _URP && (_USINGTEXCOORD2 || _PASSMETA || ((_PASSFORWARD || _PASSGBUFFER) && defined(DYNAMICLIGHTMAP_ON))) + float4 texcoord2 : TEXCOORD2; + #endif + + #if _STANDARD && (_USINGTEXCOORD1 || (_PASSMETA || ((_PASSFORWARD || _PASSGBUFFER || _PASSFORWARDADD) && LIGHTMAP_ON))) + float4 texcoord1 : TEXCOORD1; + #endif + #if _STANDARD && (_USINGTEXCOORD2 || (_PASSMETA || ((_PASSFORWARD || _PASSGBUFFER) && DYNAMICLIGHTMAP_ON))) + float4 texcoord2 : TEXCOORD2; + #endif + + + #if _HDRP + float4 texcoord1 : TEXCOORD1; + float4 texcoord2 : TEXCOORD2; + #endif + + // #if %TEXCOORD3REQUIREKEY% + float4 texcoord3 : TEXCOORD3; + // #endif + + // #if %VERTEXCOLORREQUIREKEY% + float4 vertexColor : COLOR; + // #endif + + #if _PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR)) + float3 previousPositionOS : TEXCOORD4; // Contain previous transform position (in case of skinning for example) + #if defined (_ADD_PRECOMPUTED_VELOCITY) + float3 precomputedVelocity : TEXCOORD5; // Add Precomputed Velocity (Alembic computes velocities on runtime side). + #endif + #endif + + UNITY_VERTEX_INPUT_INSTANCE_ID + }; + + struct TessVertex + { + float4 vertex : INTERNALTESSPOS; + float3 normal : NORMAL; + float4 tangent : TANGENT; + float4 texcoord0 : TEXCOORD0; + float4 texcoord1 : TEXCOORD1; + float4 texcoord2 : TEXCOORD2; + + // #if %TEXCOORD3REQUIREKEY% + float4 texcoord3 : TEXCOORD3; + // #endif + + // #if %VERTEXCOLORREQUIREKEY% + float4 vertexColor : COLOR; + // #endif + + // #if %EXTRAV2F0REQUIREKEY% + // float4 extraV2F0 : TEXCOORD5; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // float4 extraV2F1 : TEXCOORD6; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // float4 extraV2F2 : TEXCOORD7; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // float4 extraV2F3 : TEXCOORD8; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // float4 extraV2F4 : TEXCOORD9; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // float4 extraV2F5 : TEXCOORD10; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // float4 extraV2F6 : TEXCOORD11; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // float4 extraV2F7 : TEXCOORD12; + // #endif + + #if _PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR)) + float3 previousPositionOS : TEXCOORD13; // Contain previous transform position (in case of skinning for example) + #if defined (_ADD_PRECOMPUTED_VELOCITY) + float3 precomputedVelocity : TEXCOORD14; + #endif + #endif + + UNITY_VERTEX_INPUT_INSTANCE_ID + UNITY_VERTEX_OUTPUT_STEREO + }; + + struct ExtraV2F + { + float4 extraV2F0; + float4 extraV2F1; + float4 extraV2F2; + float4 extraV2F3; + float4 extraV2F4; + float4 extraV2F5; + float4 extraV2F6; + float4 extraV2F7; + Blackboard blackboard; + float4 time; + }; + + + float3 WorldToTangentSpace(ShaderData d, float3 normal) + { + return mul(d.TBNMatrix, normal); + } + + float3 TangentToWorldSpace(ShaderData d, float3 normal) + { + return mul(normal, d.TBNMatrix); + } + + // in this case, make standard more like SRPs, because we can't fix + // unity_WorldToObject in HDRP, since it already does macro-fu there + + #if _STANDARD + float3 TransformWorldToObject(float3 p) { return mul(unity_WorldToObject, float4(p, 1)); }; + float3 TransformObjectToWorld(float3 p) { return mul(unity_ObjectToWorld, float4(p, 1)); }; + float4 TransformWorldToObject(float4 p) { return mul(unity_WorldToObject, p); }; + float4 TransformObjectToWorld(float4 p) { return mul(unity_ObjectToWorld, p); }; + float4x4 GetWorldToObjectMatrix() { return unity_WorldToObject; } + float4x4 GetObjectToWorldMatrix() { return unity_ObjectToWorld; } + #if (defined(SHADER_API_D3D11) || defined(SHADER_API_XBOXONE) || defined(UNITY_COMPILER_HLSLCC) || defined(SHADER_API_PSSL) || (SHADER_TARGET_SURFACE_ANALYSIS && !SHADER_TARGET_SURFACE_ANALYSIS_MOJOSHADER)) + #define UNITY_SAMPLE_TEX2D_LOD(tex,coord, lod) tex.SampleLevel (sampler##tex,coord, lod) + #define UNITY_SAMPLE_TEX2D_SAMPLER_LOD(tex,samplertex,coord, lod) tex.SampleLevel (sampler##samplertex,coord, lod) + #else + #define UNITY_SAMPLE_TEX2D_LOD(tex,coord,lod) tex2D (tex,coord,0,lod) + #define UNITY_SAMPLE_TEX2D_SAMPLER_LOD(tex,samplertex,coord,lod) tex2D (tex,coord,0,lod) + #endif + + #undef GetWorldToObjectMatrix() + + #define GetWorldToObjectMatrix() unity_WorldToObject + + + #endif + + float3 GetCameraWorldPosition() + { + #if _HDRP + return GetCameraRelativePositionWS(_WorldSpaceCameraPos); + #else + return _WorldSpaceCameraPos; + #endif + } + + #if _GRABPASSUSED + #if _STANDARD + TEXTURE2D(%GRABTEXTURE%); + SAMPLER(sampler_%GRABTEXTURE%); + #endif + + half3 GetSceneColor(float2 uv) + { + #if _STANDARD + return SAMPLE_TEXTURE2D(%GRABTEXTURE%, sampler_%GRABTEXTURE%, uv).rgb; + #else + return SHADERGRAPH_SAMPLE_SCENE_COLOR(uv); + #endif + } + #endif + + + + #if _STANDARD + UNITY_DECLARE_DEPTH_TEXTURE(_CameraDepthTexture); + float GetSceneDepth(float2 uv) { return SAMPLE_DEPTH_TEXTURE(_CameraDepthTexture, uv); } + float GetLinear01Depth(float2 uv) { return Linear01Depth(GetSceneDepth(uv)); } + float GetLinearEyeDepth(float2 uv) { return LinearEyeDepth(GetSceneDepth(uv)); } + #else + float GetSceneDepth(float2 uv) { return SHADERGRAPH_SAMPLE_SCENE_DEPTH(uv); } + float GetLinear01Depth(float2 uv) { return Linear01Depth(GetSceneDepth(uv), _ZBufferParams); } + float GetLinearEyeDepth(float2 uv) { return LinearEyeDepth(GetSceneDepth(uv), _ZBufferParams); } + #endif + + float3 GetWorldPositionFromDepthBuffer(float2 uv, float3 worldSpaceViewDir) + { + float eye = GetLinearEyeDepth(uv); + float3 camView = mul((float3x3)GetObjectToWorldMatrix(), transpose(mul(GetWorldToObjectMatrix(), UNITY_MATRIX_I_V)) [2].xyz); + + float dt = dot(worldSpaceViewDir, camView); + float3 div = worldSpaceViewDir/dt; + float3 wpos = (eye * div) + GetCameraWorldPosition(); + return wpos; + } + + #if _HDRP + float3 ObjectToWorldSpacePosition(float3 pos) + { + return GetAbsolutePositionWS(TransformObjectToWorld(pos)); + } + #else + float3 ObjectToWorldSpacePosition(float3 pos) + { + return TransformObjectToWorld(pos); + } + #endif + + #if _STANDARD + UNITY_DECLARE_SCREENSPACE_TEXTURE(_CameraDepthNormalsTexture); + float3 GetSceneNormal(float2 uv, float3 worldSpaceViewDir) + { + float4 depthNorms = UNITY_SAMPLE_SCREENSPACE_TEXTURE(_CameraDepthNormalsTexture, uv); + float3 norms = DecodeViewNormalStereo(depthNorms); + norms = mul((float3x3)GetWorldToViewMatrix(), norms) * 0.5 + 0.5; + return norms; + } + #elif _HDRP && !_DECALSHADER + + float3 GetSceneNormal(float2 uv, float3 worldSpaceViewDir) + { + NormalData nd; + DecodeFromNormalBuffer(_ScreenSize.xy * uv, nd); + return nd.normalWS; + } + #elif _URP + #if (SHADER_LIBRARY_VERSION_MAJOR >= 10) + #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/DeclareNormalsTexture.hlsl" + #endif + + float3 GetSceneNormal(float2 uv, float3 worldSpaceViewDir) + { + #if (SHADER_LIBRARY_VERSION_MAJOR >= 10) + return SampleSceneNormals(uv); + #else + float3 wpos = GetWorldPositionFromDepthBuffer(uv, worldSpaceViewDir); + return normalize(-cross(ddx(wpos), ddy(wpos))) * 0.5 + 0.5; + #endif + + } + #endif + + #if _HDRP + + half3 UnpackNormalmapRGorAG(half4 packednormal) + { + // This do the trick + packednormal.x *= packednormal.w; + + half3 normal; + normal.xy = packednormal.xy * 2 - 1; + normal.z = sqrt(1 - saturate(dot(normal.xy, normal.xy))); + return normal; + } + half3 UnpackNormal(half4 packednormal) + { + #if defined(UNITY_NO_DXT5nm) + return packednormal.xyz * 2 - 1; + #else + return UnpackNormalmapRGorAG(packednormal); + #endif + } + #endif + #if _HDRP || _URP + + half3 UnpackScaleNormal(half4 packednormal, half scale) + { + #ifndef UNITY_NO_DXT5nm + // Unpack normal as DXT5nm (1, y, 1, x) or BC5 (x, y, 0, 1) + // Note neutral texture like "bump" is (0, 0, 1, 1) to work with both plain RGB normal and DXT5nm/BC5 + packednormal.x *= packednormal.w; + #endif + half3 normal; + normal.xy = (packednormal.xy * 2 - 1) * scale; + normal.z = sqrt(1 - saturate(dot(normal.xy, normal.xy))); + return normal; + } + + #endif + + + void GetSun(out float3 lightDir, out float3 color) + { + lightDir = float3(0.5, 0.5, 0); + color = 1; + #if _HDRP + if (_DirectionalLightCount > 0) + { + DirectionalLightData light = _DirectionalLightDatas[0]; + lightDir = -light.forward.xyz; + color = light.color; + } + #elif _STANDARD + lightDir = normalize(_WorldSpaceLightPos0.xyz); + color = _LightColor0.rgb; + #elif _URP + Light light = GetMainLight(); + lightDir = light.direction; + color = light.color; + #endif + } + + + + CBUFFER_START(UnityPerMaterial) + + + half4 _Color; + half4 _MainTex_ST, _MainTex_TexelSize; + half _Alpha, _AlphaCutoffValue; + + #if ATLAS_ON + half _MinXUV, _MaxXUV, _MinYUV, _MaxYUV; + #endif + + #if GLOW_ON + half4 _GlowColor; + half _Glow, _GlowGlobal; + #endif + + #if HSV_ON + half _HsvShift, _HsvSaturation, _HsvBright; + #endif + + #if DISTORT_ON + half4 _DistortTex_ST; + half _DistortTexXSpeed, _DistortTexYSpeed, _DistortAmount; + #endif + + #if FADE_ON + half4 _FadeBurnColor, _FadeTex_ST, _FadeBurnTex_ST; + half _FadeAmount, _FadeBurnWidth, _FadeBurnTransition,_FadeBurnGlow; + #endif + + #if OUTBASE_ON + half4 _OutlineColor; + half _OutlineAlpha, _OutlineGlow, _OutlineWidth; + int _OutlinePixelWidth; + #endif + + #if OUTTEX_ON + half4 _OutlineTex_ST; + half _OutlineTexXSpeed, _OutlineTexYSpeed; + #endif + + #if OUTDIST_ON + half4 _OutlineDistortTex_ST; + half _OutlineDistortTexXSpeed, _OutlineDistortTexYSpeed, _OutlineDistortAmount; + #endif + + #if ALPHAOUTLINE_ON + half _AlphaOutlineGlow, _AlphaOutlinePower, _AlphaOutlineMinAlpha, _AlphaOutlineBlend; + half4 _AlphaOutlineColor; + #endif + + #if INNEROUTLINE_ON + half _InnerOutlineThickness, _InnerOutlineAlpha, _InnerOutlineGlow; + half4 _InnerOutlineColor; + #endif + + #if GRADIENT_ON + half _GradBlend, _GradBoostX, _GradBoostY; + half4 _GradTopRightCol, _GradTopLeftCol, _GradBotRightCol, _GradBotLeftCol; + #endif + + #if COLORSWAP_ON + half4 _ColorSwapRed, _ColorSwapGreen, _ColorSwapBlue; + half _ColorSwapRedLuminosity, _ColorSwapGreenLuminosity, _ColorSwapBlueLuminosity, _ColorSwapBlend; + #endif + + #if CHANGECOLOR_ON + half4 _ColorChangeNewCol, _ColorChangeTarget; + half _ColorChangeTolerance, _ColorChangeLuminosity; + #endif + #if CHANGECOLOR2_ON + half4 _ColorChangeNewCol2, _ColorChangeTarget2; + half _ColorChangeTolerance2; + #endif + #if CHANGECOLOR3_ON + half4 _ColorChangeNewCol3, _ColorChangeTarget3; + half _ColorChangeTolerance3; + #endif + + #if COLORRAMP_ON + half _ColorRampLuminosity, _ColorRampBlend; + #endif + + #if HITEFFECT_ON + half4 _HitEffectColor; + half _HitEffectGlow, _HitEffectBlend; + #endif + + #if NEGATIVE_ON + half _NegativeAmount; + #endif + + #if PIXELATE_ON + half _PixelateSize; + #endif + + #if GREYSCALE_ON + half _GreyscaleLuminosity, _GreyscaleBlend; + half4 _GreyscaleTintColor; + #endif + + #if POSTERIZE_ON + half _PosterizeNumColors, _PosterizeGamma; + #endif + + #if BLUR_ON + half _BlurIntensity; + #endif + + #if MOTIONBLUR_ON + half _MotionBlurAngle, _MotionBlurDist; + #endif + + #if GHOST_ON + half _GhostColorBoost, _GhostTransparency, _GhostBlend; + #endif + + #if HOLOGRAM_ON + half _HologramStripesAmount, _HologramMinAlpha, _HologramUnmodAmount, _HologramStripesSpeed, _HologramMaxAlpha, _HologramBlend; + half4 _HologramStripeColor; + #endif + + #if CHROMABERR_ON + half _ChromAberrAmount, _ChromAberrAlpha; + #endif + + #if GLITCH_ON + half _GlitchAmount, _GlitchSize; + #endif + + #if FLICKER_ON + half _FlickerFreq, _FlickerPercent, _FlickerAlpha; + #endif + + #if SHADOW_ON + half _ShadowX, _ShadowY, _ShadowAlpha; + half4 _ShadowColor; + #endif + + #if SHINE_ON + half4 _ShineColor; + half _ShineLocation, _ShineRotate, _ShineWidth, _ShineGlow; + #endif + + #if CONTRAST_ON + half _Contrast, _Brightness; + #endif + + #if OVERLAY_ON + half4 _OverlayTex_ST, _OverlayColor; + half _OverlayGlow, _OverlayBlend, _OverlayTextureScrollXSpeed, _OverlayTextureScrollYSpeed; + #endif + + #if DOODLE_ON + half _HandDrawnAmount, _HandDrawnSpeed; + #endif + + #if WIND_ON + half _GrassSpeed, _GrassWind, _GrassManualAnim, _GrassRadialBend; + #endif + + #if WAVEUV_ON + float _WaveAmount, _WaveSpeed, _WaveStrength, _WaveX, _WaveY; + #endif + + #if ROUNDWAVEUV_ON + half _RoundWaveStrength, _RoundWaveSpeed; + #endif + + #if RECTSIZE_ON + half _RectSize; + #endif + + #if OFFSETUV_ON + half _OffsetUvX, _OffsetUvY; + #endif + + #if CLIPPING_ON + half _ClipUvLeft, _ClipUvRight, _ClipUvUp, _ClipUvDown; + #endif + + #if RADIALCLIPPING_ON + half _RadialStartAngle, _RadialClip, _RadialClip2; + #endif + + #if TEXTURESCROLL_ON + half _TextureScrollXSpeed, _TextureScrollYSpeed; + #endif + + #if ZOOMUV_ON + half _ZoomUvAmount; + #endif + + #if WARP_ON + half _WarpStrength, _WarpSpeed, _WarpScale; + #endif + + #if TWISTUV_ON + half _TwistUvAmount, _TwistUvPosX, _TwistUvPosY, _TwistUvRadius; + #endif + + #if ROTATEUV_ON + half _RotateUvAmount; + #endif + + #if FISHEYE_ON + half _FishEyeUvAmount; + #endif + + #if PINCH_ON + half _PinchUvAmount; + #endif + + #if SHAKEUV_ON + half _ShakeUvSpeed, _ShakeUvX, _ShakeUvY; + #endif + + #if NORMALMAP_ON + half _NormalStrength; + #endif + + float _RandomSeed; + + + + + CBUFFER_END + + + + + + + + TEXTURE2D(_MainTex); + SAMPLER(sampler_MainTex); + + #if GLOW_ON + TEXTURE2D(_GlowTex); + SAMPLER(sampler_GlowTex); + #endif + + #if FADE_ON + TEXTURE2D(_FadeTex); + SAMPLER(sampler_FadeTex); + + TEXTURE2D(_FadeBurnTex); + SAMPLER(sampler_FadeBurnTex); + #endif + + #if DISTORT_ON + TEXTURE2D(_DistortTex); + SAMPLER(sampler_DistortTex); + #endif + + #if OUTTEX_ON + TEXTURE2D(_OutlineTex); + SAMPLER(sampler_OutlineTex); + #endif + + #if OUTDIST_ON + TEXTURE2D(_OutlineDistortTex); + SAMPLER(sampler_OutlineDistortTex); + #endif + + #if COLORSWAP_ON + TEXTURE2D(_ColorSwapTex); + SAMPLER(sampler_ColorSwapTex); + #endif + + #if COLORRAMP_ON + TEXTURE2D(_ColorRampTex); + TEXTURE2D(_ColorRampTexGradient); + SAMPLER(sampler_ColorRampTex); + SAMPLER(sampler_ColorRampTexGradient); + #endif + + #if SHINE_ON + TEXTURE2D(_ShineMask); + SAMPLER(sampler_ShineMask); + #endif + + #if OVERLAY_ON + TEXTURE2D(_OverlayTex); + SAMPLER(sampler_OverlayTex); + #endif + + #if NORMALMAP_ON + TEXTURE2D(_NormalMap); + SAMPLER(sampler_NormalMap); + #endif + + + half3 GetPixel(in int offsetX, in int offsetY, in half2 uv, in Texture2D _tex, in SamplerState _sampler) + { + half2 _uv = uv + half2(offsetX * _MainTex_TexelSize.x, offsetY * _MainTex_TexelSize.y); + half4 col = SAMPLE_TEXTURE2D(_tex, _sampler, _uv); + return col.rgb; + } + + + //BLURS------------------------------------------------------------------------- + half4 Blur(half2 uv, Texture2D source, SamplerState sampler_source, half Intensity) + { + const half2 texelSize = 1.0 / _ScreenParams.xy; + const half4 color = SAMPLE_TEXTURE2D(source, sampler_source, uv); + const half2 offset = Intensity * texelSize; + + half4 accumulatedColor = color; + half accumulatedWeight = 1.0; + for (int x = -1; x <= 1; x++) + { + for (int y = -1; y <= 1; y++) + { + const half2 sampleUV = uv + half2(x, y) * offset; + const half4 sampleColor = SAMPLE_TEXTURE2D(source, sampler_source, sampleUV); + + accumulatedColor += sampleColor; + accumulatedWeight += 1.0; + } + } + + half4 blurredColor = accumulatedColor / accumulatedWeight; + return blurredColor; + } + + half BlurHD_G(half bhqp, half x) + { + return exp(-(x * x) / (2.0 * bhqp * bhqp)); + } + half4 BlurHD(half2 uv, Texture2D source, SamplerState sampler_source, half BlurAmount, half xScale, half yScale) + { + int iterations = 16; + int halfIterations = iterations / 2; + half sigmaX = 0.1 + BlurAmount * 0.5; + half sigmaY = sigmaX; + half total = 0.0; + half4 ret = half4(0, 0, 0, 0); + for (int iy = 0; iy < iterations; ++iy) + { + half fy = BlurHD_G(sigmaY, half(iy) -half(halfIterations)); + half offsetY = half(iy - halfIterations) * 0.00390625 * xScale; + for (int ix = 0; ix < iterations; ++ix) + { + half fx = BlurHD_G(sigmaX, half(ix) - half(halfIterations)); + half offsetX = half(ix - halfIterations) * 0.00390625 * yScale; + total += fx * fy; + ret += SAMPLE_TEXTURE2D(source, sampler_source, uv + half2(offsetX, offsetY)) * fx * fy; + } + } + return ret / total; + } + //----------------------------------------------------------------------- + + + //------------------------------------------- + half RemapFloat(half inValue, half inMin, half inMax, half outMin, half outMax){ + return outMin + (inValue - inMin) * (outMax - outMin) / (inMax - inMin); + } + //------------------------------------------- + + //----------------------------------------------------------------------- + half rand(half2 seed, half offset) { + return (frac(sin(dot(seed, half2(12.9898, 78.233))) * 43758.5453) + offset) % 1.0; + } + + half rand2(half2 seed, half offset) { + return (frac(sin(dot(seed * floor(50 + (_Time.x % 1.0) * 12.), half2(127.1, 311.7))) * 43758.5453123) + offset) % 1.0; + } + + half rand2CustomTime(half2 seed, half offset, half customTime) { + return (frac(sin(dot(seed * floor(50 + (customTime % 1.0) * 12.), half2(127.1, 311.7))) * 43758.5453123) + offset) % 1.0; + } + //----------------------------------------------------------------------- + + + void Ext_ModifyVertex0 (inout VertexData v, inout ExtraV2F d) + { + //BILBOARD_ON + #if BILBOARD_ON + half3 camRight = mul((half3x3)unity_CameraToWorld, half3(1,0,0)); + half3 camUp = half3(0,1,0); + #if BILBOARDY_ON + camUp = mul((half3x3)unity_CameraToWorld, half3(0,1,0)); + #endif + half3 localPos = v.vertex.x * camRight + v.vertex.y * camUp; + v.vertex = half4(localPos, 1); + #endif + //----------------------------------------------------------- + + v.texcoord0.xy = TRANSFORM_TEX(v.texcoord0.xy, _MainTex); + half2 center = half2(0.5, 0.5); + #if ATLAS_ON + center = half2((_MaxXUV + _MinXUV) / 2.0, (_MaxYUV + _MinYUV) / 2.0); + #endif + + //POLARUV_ON + #if POLARUV_ON + v.texcoord0.xy = v.texcoord0.xy - center; + #endif + + //---------------------------------------- + + //ROTATEUV_ON + #if ROTATEUV_ON + half2 uvC = v.texcoord0.xy; + half cosAngle = cos(_RotateUvAmount); + half sinAngle = sin(_RotateUvAmount); + half2x2 rot = half2x2(cosAngle, -sinAngle, sinAngle, cosAngle); + uvC -= center; + v.texcoord0.xy = mul(rot, uvC); + v.texcoord0.xy += center; + #endif + //-------------------- + + #if RECTSIZE_ON + v.vertex.xyz += (v.vertex.xyz * (_RectSize - 1.0)); + #endif + + #if OUTTEX_ON + v.texcoord1.xy = TRANSFORM_TEX(v.texcoord0.xy, _OutlineTex); + #endif + + #if OUTDIST_ON + v.texcoord2.xy = TRANSFORM_TEX(v.texcoord0.xy, _OutlineDistortTex); + #endif + + #if DISTORT_ON + v.texcoord3.xy = TRANSFORM_TEX(v.texcoord0.xy, _DistortTex); + #endif + } + + void Ext_SurfaceFunction0 (inout Surface o, ShaderData d) + { + half randomSeed = _RandomSeed; + + float2 uvRect = d.texcoord0; + half2 center = half2(0.5, 0.5); + #if ATLAS_ON + center = half2((_MaxXUV + _MinXUV) / 2.0, (_MaxYUV + _MinYUV) / 2.0); + uvRect = half2((d.texcoord0.x - _MinXUV) / (_MaxXUV - _MinXUV), (d.texcoord0.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half2 centerTiled = half2(center.x * _MainTex_ST.x, center.y * _MainTex_ST.y); + + //CLIPPING_ON + #if CLIPPING_ON + half2 tiledUv = half2(d.texcoord0.x / _MainTex_ST.x, d.texcoord0.y / _MainTex_ST.y); + #if ATLAS_ON + tiledUv = half2((tiledUv.x - _MinXUV) / (_MaxXUV - _MinXUV), (tiledUv.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + clip((1 - _ClipUvUp) - tiledUv.y); + clip(tiledUv.y - _ClipUvDown); + clip((1 - _ClipUvRight) - tiledUv.x); + clip(tiledUv.x - _ClipUvLeft); + #endif + //---------------------------------- + + //RADIALCLIPPING_ON + #if RADIALCLIPPING_ON + half2 tiledUv2 = half2(d.texcoord0.x / _MainTex_ST.x, d.texcoord0.y / _MainTex_ST.y); + #if ATLAS_ON + tiledUv2 = half2((tiledUv2.x - _MinXUV) / (_MaxXUV - _MinXUV), (tiledUv2.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half startAngle = _RadialStartAngle - _RadialClip; + half endAngle = _RadialStartAngle + _RadialClip2; + half offset0 = clamp(0, 360, startAngle + 360); + half offset360 = clamp(0, 360, endAngle - 360); + half2 atan2Coord = half2(lerp(-1, 1, tiledUv2.x), lerp(-1, 1, tiledUv2.y)); + half atanAngle = atan2(atan2Coord.y, atan2Coord.x) * 57.3; // angle in degrees + if(atanAngle < 0) atanAngle = 360 + atanAngle; + if(atanAngle >= startAngle && atanAngle <= endAngle) discard; + if(atanAngle <= offset360) discard; + if(atanAngle >= offset0) discard; + #endif + + //----------------------------- + + //TEXTURESCROLL_ON && ATLAS_ON + #if TEXTURESCROLL_ON && ATLAS_ON + d.texcoord0.xy = half2(_MinXUV + ((_MaxXUV - _MinXUV) * (abs(((_Time.y + randomSeed) * _TextureScrollXSpeed) + uvRect.x) % 1)), + _MinYUV + ((_MaxYUV - _MinYUV) * (abs(((_Time.y + randomSeed) * _TextureScrollYSpeed) + uvRect.y) % 1))); + #endif + //---------------------------- + + //OFFSETUV_ON + #if OFFSETUV_ON + #if ATLAS_ON + d.texcoord0.xy = half2(_MinXUV + ((_MaxXUV - _MinXUV) * (abs((_OffsetUvX + uvRect.x) % 1))), + _MinYUV + ((_MaxYUV - _MinYUV) * (abs(_OffsetUvY + uvRect.y) % 1))); + #else + d.texcoord0.xy += half2(_OffsetUvX, _OffsetUvY); + #endif + #endif + + //---------------------- + + //POLARUV_ON + #if POLARUV_ON + d.texcoord0.xy = half2(atan2(d.texcoord0.y, d.texcoord0.x) / (2.0f * 3.141592653589f), length(d.texcoord0.xy)); + d.texcoord0.xy *= _MainTex_ST.xy; + #endif + + //-------------------------------------- + + //TWISTUV_ON + #if TWISTUV_ON + #if ATLAS_ON + _TwistUvPosX = ((_MaxXUV - _MinXUV) * _TwistUvPosX) + _MinXUV; + _TwistUvPosY = ((_MaxYUV - _MinYUV) * _TwistUvPosY) + _MinYUV; + #endif + half2 tempUv = d.texcoord0.xy - half2(_TwistUvPosX * _MainTex_ST.x, _TwistUvPosY * _MainTex_ST.y); + _TwistUvRadius *= (_MainTex_ST.x + _MainTex_ST.y) / 2; + half percent = (_TwistUvRadius - length(tempUv)) / _TwistUvRadius; + half theta = percent * percent * (2.0 * sin(_TwistUvAmount)) * 8.0; + half s = sin(theta); + half c = cos(theta); + half beta = max(sign(_TwistUvRadius - length(tempUv)), 0.0); + tempUv = half2(dot(tempUv, half2(c, -s)), dot(tempUv, half2(s, c))) * beta + tempUv * (1 - beta); + tempUv += half2(_TwistUvPosX * _MainTex_ST.x, _TwistUvPosY * _MainTex_ST.y); + d.texcoord0.xy = tempUv; + #endif + + //-------------------------------------------- + + //FISHEYE_ON + #if FISHEYE_ON + half bind = length(centerTiled); + half2 dF = d.texcoord0.xy - centerTiled; + half dFlen = length(dF); + half fishInt = (3.14159265359 / bind) * (_FishEyeUvAmount + 0.001); + d.texcoord0.xy = centerTiled + (dF / (max(0.0001, dFlen))) * tan(dFlen * fishInt) * bind / tan(bind * fishInt); + #endif + //--------------------------------------------- + + //PINCH_ON + #if PINCH_ON + half2 dP = d.texcoord0.xy - centerTiled; + half pinchInt = (3.141592 / length(centerTiled)) * (-_PinchUvAmount + 0.001); + d.texcoord0.xy = centerTiled + normalize(dP) * atan(length(dP) * -pinchInt * 10.0) * 0.5 / atan(-pinchInt * 5); + #endif + + //--------------------------------------------- + + //ZOOMUV_ON + #if ZOOMUV_ON + d.texcoord0.xy -= centerTiled; + d.texcoord0.xy = d.texcoord0.xy * _ZoomUvAmount; + d.texcoord0.xy += centerTiled; + #endif + + //----------------------------------------------- + + //DOODLE_ON + #if DOODLE_ON + half2 uvCopy = uvRect; + _HandDrawnSpeed = (floor((_Time.x + randomSeed) * 20 * _HandDrawnSpeed) / _HandDrawnSpeed) * _HandDrawnSpeed; + uvCopy.x = sin((uvCopy.x * _HandDrawnAmount + _HandDrawnSpeed) * 4); + uvCopy.y = cos((uvCopy.y * _HandDrawnAmount + _HandDrawnSpeed) * 4); + d.texcoord0.xy = lerp(d.texcoord0.xy, d.texcoord0.xy + uvCopy, 0.0005 * _HandDrawnAmount); + #endif + + //-------------------------- + + //SHAKEUV_ON + #if SHAKEUV_ON + half xShake = sin((_Time.x + randomSeed) * _ShakeUvSpeed * 50) * _ShakeUvX; + half yShake = cos((_Time.x + randomSeed) * _ShakeUvSpeed * 50) * _ShakeUvY; + d.texcoord0.xy += half2(xShake * 0.012, yShake * 0.01); + #endif + + //------------------------------------------- + + //RECTSIZE_ON + #if RECTSIZE_ON + d.texcoord0.xy = d.texcoord0.xy * (_RectSize).xx + (((-_RectSize * 0.5) + 0.5)).xx; + #endif + + //------------------------------------------- + + //DISTORT_ON + #if DISTORT_ON + #if ATLAS_ON + d.texcoord3.x = d.texcoord3.x * (1 / (_MaxXUV - _MinXUV)); + d.texcoord3.y = d.texcoord3.y * (1 / (_MaxYUV - _MinYUV)); + #endif + + d.texcoord3.x += ((_Time.x + _RandomSeed) * _DistortTexXSpeed) % 1; + d.texcoord3.y += ((_Time.x + _RandomSeed) * _DistortTexYSpeed) % 1; + half distortAmnt = (SAMPLE_TEXTURE2D(_DistortTex, sampler_DistortTex, d.texcoord3.xy).r - 0.5) * 0.2 * _DistortAmount; + d.texcoord0.x += distortAmnt; + d.texcoord0.y += distortAmnt; + #endif + //------------------------------------------------------- + + //WARP_ON + #if WARP_ON + half2 warpUv = half2(d.texcoord0.x / _MainTex_ST.x, d.texcoord0.y / _MainTex_ST.y); + #if ATLAS_ON + warpUv = half2((warpUv.x - _MinXUV) / (_MaxXUV - _MinXUV), (warpUv.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + const float tau = 6.283185307179586; + float xWarp = (_Time.y + randomSeed) * _WarpSpeed + warpUv.x * tau / _WarpScale; + float yWarp = (_Time.y + randomSeed) * _WarpSpeed + warpUv.y * tau / _WarpScale; + float2 warp = float2(sin(xWarp), sin(yWarp)) * _WarpStrength; + d.texcoord0.xy += warp; + #endif + + //------------------------------------------------------- + + //WAVEUV_ON + #if WAVEUV_ON + float2 uvWave = half2(_WaveX * _MainTex_ST.x, _WaveY * _MainTex_ST.y) - d.texcoord0.xy; + uvWave %= 1; + #if ATLAS_ON + uvWave = half2(_WaveX, _WaveY) - uvRect; + #endif + uvWave.x *= _ScreenParams.x / _ScreenParams.y; + float waveTime = _Time.y + randomSeed; + float angWave = (sqrt(dot(uvWave, uvWave)) * _WaveAmount) - ((waveTime * _WaveSpeed)); + d.texcoord0.xy = d.texcoord0.xy + uvWave * sin(angWave) * (_WaveStrength / 1000.0); + #endif + //---------------------------------------------------- + + //ROUNDWAVEUV_ON + #if ROUNDWAVEUV_ON + half xWave = ((0.5 * _MainTex_ST.x) - uvRect.x); + half yWave = ((0.5 * _MainTex_ST.y) - uvRect.y) * (_MainTex_TexelSize.w / _MainTex_TexelSize.z); + half ripple = -sqrt(xWave*xWave + yWave* yWave); + d.texcoord0.xy += (sin((ripple + (_Time.y + randomSeed) * (_RoundWaveSpeed/10.0)) / 0.015) * (_RoundWaveStrength/10.0)) % 1; + #endif + //---------------------------------------------------- + + + //WIND_ON + #if WIND_ON + half windOffset = sin((_Time.x + randomSeed) * _GrassSpeed * 10); + half2 windCenter = half2(0.5, 0.1); + #if ATLAS_ON + windCenter.x = ((_MaxXUV - _MinXUV) * windCenter.x) + _MinXUV; + windCenter.y = ((_MaxYUV - _MinYUV) * windCenter.y) + _MinYUV; + #endif + #if !MANUALWIND_ON + d.texcoord0.x = fmod(abs(lerp(d.texcoord0.x, d.texcoord0.x + (_GrassWind * 0.01 * windOffset), uvRect.y)), 1); + #else + d.texcoord0.x = fmod(abs(lerp(d.texcoord0.x, d.texcoord0.x + (_GrassWind * 0.01 * _GrassManualAnim), uvRect.y)), 1); + windOffset = _GrassManualAnim; + #endif + half2 delta = d.texcoord0.xy - windCenter; + half delta2 = dot(delta.xy, delta.xy); + half2 delta_offset = delta2 * windOffset; + d.texcoord0.xy = d.texcoord0.xy + half2(delta.y, -delta.x) * delta_offset * _GrassRadialBend; + #endif + + //-------------------------------------------------------- + + //TEXTURESCROLL_ON && !ATLAS_ON + #if TEXTURESCROLL_ON && !ATLAS_ON + d.texcoord0.x += ((_Time.y + randomSeed) * _TextureScrollXSpeed) % 1; + d.texcoord0.y += ((_Time.y + randomSeed) * _TextureScrollYSpeed) % 1; + #endif + //------------------------------ + + //PIXELATE_ON + #if PIXELATE_ON + half aspectRatio = _MainTex_TexelSize.x / _MainTex_TexelSize.y; + half2 pixelSize = float2(_PixelateSize, _PixelateSize * aspectRatio); + d.texcoord0.xy = floor(d.texcoord0.xy * pixelSize) / pixelSize; + #endif + //-------------- + + half4 col = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy); + half originalAlpha = col.a; + col *= d.vertexColor; + + //NORMAL MAP + #if NORMALMAP_ON + half4 normalSample = SAMPLE_TEXTURE2D(_NormalMap, sampler_NormalMap, d.texcoord0.xy); + half3 normalTS = UnpackNormal(normalSample); + normalTS.xy *= _NormalStrength; + o.Normal = normalTS; + #endif + + + //GLITCH_ON + #if GLITCH_ON + half2 uvGlitch = uvRect; + uvGlitch.y -= 0.5; + half lineNoise = pow(rand2(floor(uvGlitch * half2(24., 19.) * _GlitchSize) * 4.0, randomSeed), 3.0) * _GlitchAmount + * pow(rand2(floor(uvGlitch * half2(38., 14.) * _GlitchSize) * 4.0, randomSeed), 3.0); + col = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(lineNoise * 0.02 * rand2(half2(2.0, 1), randomSeed), 0)) * d.vertexColor; + #endif + //-------------------------------------- + + //CHROMABERR_ON + #if CHROMABERR_ON + half4 r = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(_ChromAberrAmount/10, 0)) * d.vertexColor; + half4 b = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(-_ChromAberrAmount/10, 0)) * d.vertexColor; + col = half4(r.r * r.a, col.g, b.b * b.a, max(max(r.a, b.a) * _ChromAberrAlpha, col.a)); + #endif + + //-------------------------------- + + //BLUR_ON + #if BLUR_ON + #if ATLAS_ON + #if !BLURISHD_ON + col = BlurHD(d.texcoord0.xy, _MainTex, sampler_MainTex, _BlurIntensity, (_MaxXUV - _MinXUV), (_MaxYUV - _MinYUV)) * d.vertexColor; + #else + col = Blur(d.texcoord0.xy, _MainTex, sampler_MainTex, _BlurIntensity * (_MaxXUV - _MinXUV)) * d.vertexColor; + #endif + #else + #if !BLURISHD_ON + col = BlurHD(d.texcoord0.xy, _MainTex, sampler_MainTex, _BlurIntensity, 1, 1) * d.vertexColor; + #else + col = Blur(d.texcoord0.xy, _MainTex, sampler_MainTex, _BlurIntensity) * d.vertexColor; + #endif + #endif + #endif + + //-------------------- + + //MOTIONBLUR_ON + #if MOTIONBLUR_ON + _MotionBlurAngle = _MotionBlurAngle * 3.1415926; + #define rot(n) mul(n, half2x2(cos(_MotionBlurAngle), -sin(_MotionBlurAngle), sin(_MotionBlurAngle), cos(_MotionBlurAngle))) + _MotionBlurDist = _MotionBlurDist * 0.005; + #if ATLAS_ON + _MotionBlurDist *= (_MaxXUV - _MinXUV); + #endif + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(-_MotionBlurDist, -_MotionBlurDist))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(-_MotionBlurDist * 2, -_MotionBlurDist * 2))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(-_MotionBlurDist * 3, -_MotionBlurDist * 3))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(-_MotionBlurDist * 4, -_MotionBlurDist * 4))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(_MotionBlurDist, _MotionBlurDist))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(_MotionBlurDist * 2, _MotionBlurDist * 2))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(_MotionBlurDist * 3, _MotionBlurDist * 3))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(_MotionBlurDist * 4, _MotionBlurDist * 4))); + col.rgb = col.rgb / 9; + #endif + //------------------------------------ + + //NEGATIVE_ON + #if NEGATIVE_ON + col.rgb = lerp(col.rgb, 1 - col.rgb, _NegativeAmount); + #endif + + //-------------- + half luminance = 0; + + //GREYSCALE_ON && !GREYSCALEOUTLINE_ON + #if GREYSCALE_ON && !GREYSCALEOUTLINE_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + luminance = saturate(luminance + _GreyscaleLuminosity); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _GreyscaleTintColor, _GreyscaleBlend); + #endif + //------------------------------------ + + //GHOST_ON + #if GHOST_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + half4 ghostResult; + ghostResult.a = saturate(luminance - _GhostTransparency) * col.a; + ghostResult.rgb = col.rgb * (luminance + _GhostColorBoost); + col = lerp(col, ghostResult, _GhostBlend); + #endif + //------------------------------------ + + //INNEROUTLINE_ON + #if INNEROUTLINE_ON + half3 innerT = abs(GetPixel(0, _InnerOutlineThickness, d.texcoord0.xy, _MainTex, sampler_MainTex) - GetPixel(0, -_InnerOutlineThickness, d.texcoord0.xy, _MainTex, sampler_MainTex)); + innerT += abs(GetPixel(_InnerOutlineThickness, 0, d.texcoord0.xy, _MainTex, sampler_MainTex) - GetPixel(-_InnerOutlineThickness, 0, d.texcoord0.xy, _MainTex, sampler_MainTex)); + #if !ONLYINNEROUTLINE_ON + innerT = (innerT / 2.0) * col.a * _InnerOutlineAlpha; + col.rgb += length(innerT) * _InnerOutlineColor.rgb * _InnerOutlineGlow; + #else + innerT *= col.a * _InnerOutlineAlpha; + col.rgb = length(innerT) * _InnerOutlineColor.rgb * _InnerOutlineGlow; + col.a = step(0.3, col.r+col.g+col.b); + #endif + #endif + //------------------------------------------------------- + + //HITEFFECT_ON + #if HITEFFECT_ON + col.rgb = lerp(col.rgb, _HitEffectColor.rgb * _HitEffectGlow, _HitEffectBlend); + #endif + //-------------------- + + //GRADIENT_ON + #if GRADIENT_ON + half2 tiledUvGrad = half2(uvRect.x / _MainTex_ST.x, uvRect.y / _MainTex_ST.y); + #if GRADIENT2COL_ON + _GradTopRightCol = _GradTopLeftCol; + _GradBotRightCol = _GradBotLeftCol; + #endif + #if RADIALGRADIENT_ON + half radialDist = 1 - length(tiledUvGrad - half2(0.5, 0.5)); + radialDist *= (_MainTex_TexelSize.w / _MainTex_TexelSize.z); + radialDist = saturate(_GradBoostX * radialDist); + half4 gradientResult = lerp(_GradTopLeftCol, _GradBotLeftCol, radialDist); + #else + half gradXLerpFactor = saturate(pow(tiledUvGrad.x, _GradBoostX)); + half4 gradientResult = lerp(lerp(_GradBotLeftCol, _GradBotRightCol, gradXLerpFactor), + lerp(_GradTopLeftCol, _GradTopRightCol, gradXLerpFactor), saturate(pow(tiledUvGrad.y, _GradBoostY))); + #endif + gradientResult = lerp(col, gradientResult, _GradBlend); + col.rgb = gradientResult.rgb * col.a; + col.a *= gradientResult.a; + #endif + //-------------------------------------------------------------------- + + //CONTRAST_ON + #if CONTRAST_ON + col.rgb = (col.rgb - float3(0.5, 0.5, 0.5)) * _Contrast + float3(0.5, 0.5, 0.5); + col.rgb += _Brightness; + #endif + + //------------------------------------------------------------------- + + //COLORSWAP_ON + #if COLORSWAP_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + half4 swapMask = SAMPLE_TEXTURE2D(_ColorSwapTex, sampler_ColorSwapTex, d.texcoord0.xy); + swapMask.rgb *= swapMask.a; + half3 redSwap = _ColorSwapRed * swapMask.r * saturate(luminance + _ColorSwapRedLuminosity); + half3 greenSwap = _ColorSwapGreen * swapMask.g * saturate(luminance + _ColorSwapGreenLuminosity); + half3 blueSwap = _ColorSwapBlue * swapMask.b * saturate(luminance + _ColorSwapBlueLuminosity); + swapMask.rgb = col.rgb * saturate(1 - swapMask.r - swapMask.g - swapMask.b); + col.rgb = lerp(col.rgb, swapMask.rgb + redSwap + greenSwap + blueSwap, _ColorSwapBlend); + #endif + //-------------------------------------------------------------------- + + //COLORRAMP_ON && !COLORRAMPOUTLINE_ON + #if COLORRAMP_ON && !COLORRAMPOUTLINE_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + luminance = saturate(luminance + _ColorRampLuminosity); + #if GRADIENTCOLORRAMP_ON + col.rgb = lerp(col.rgb, SAMPLE_TEXTURE2D(_ColorRampTexGradient, sampler_ColorRampTexGradient, half2(luminance, 0)).rgb, _ColorRampBlend); + #else + col.rgb = lerp(col.rgb, SAMPLE_TEXTURE2D(_ColorRampTex, sampler_ColorRampTex, half2(luminance, 0)).rgb, _ColorRampBlend); + #endif + #endif + //-------------------------------------------------------------------- + + //CHANGECOLOR_ON + #if CHANGECOLOR_ON + float3 currChangeColor = saturate(col.rgb); + luminance = 0.3 * currChangeColor.r + 0.59 * currChangeColor.g + 0.11 * currChangeColor.b; + luminance = saturate(luminance + _ColorChangeLuminosity); + half3 dif = abs(currChangeColor - _ColorChangeTarget.rgb); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _ColorChangeNewCol.rgb, + max(sign(1 - saturate(dif.x + dif.y + dif.z) - _ColorChangeTolerance), 0.0)); + #if CHANGECOLOR2_ON + dif = abs(currChangeColor - _ColorChangeTarget2.rgb); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _ColorChangeNewCol2.rgb, + max(sign(1 - saturate(dif.x + dif.y + dif.z) - _ColorChangeTolerance2), 0.0)); + #endif + #if CHANGECOLOR3_ON + dif = abs(currChangeColor - _ColorChangeTarget3.rgb); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _ColorChangeNewCol3.rgb, + max(sign(1 - saturate(dif.x + dif.y + dif.z) - _ColorChangeTolerance3), 0.0)); + #endif + #endif + //------------------------------------------------------- + + //POSTERIZE_ON && !POSTERIZEOUTLINE_ON + #if POSTERIZE_ON && !POSTERIZEOUTLINE_ON + col.rgb = pow(col.rgb, _PosterizeGamma) * _PosterizeNumColors; + col.rgb = floor(col.rgb) / _PosterizeNumColors; + col.rgb = pow(col.rgb, 1.0 / _PosterizeGamma); + #endif + //------------------------------------ + + //HSV_ON + #if HSV_ON + half3 resultHsv = half3(col.rgb); + half cosHsv = _HsvBright * _HsvSaturation * cos(_HsvShift * 3.14159265 / 180); + half sinHsv = _HsvBright * _HsvSaturation * sin(_HsvShift * 3.14159265 / 180); + resultHsv.x = (.299 * _HsvBright + .701 * cosHsv + .168 * sinHsv) * col.x + + (.587 * _HsvBright - .587 * cosHsv + .330 * sinHsv) * col.y + + (.114 * _HsvBright - .114 * cosHsv - .497 * sinHsv) * col.z; + resultHsv.y = (.299 * _HsvBright - .299 * cosHsv - .328 * sinHsv) *col.x + + (.587 * _HsvBright + .413 * cosHsv + .035 * sinHsv) * col.y + + (.114 * _HsvBright - .114 * cosHsv + .292 * sinHsv) * col.z; + resultHsv.z = (.299 * _HsvBright - .3 * cosHsv + 1.25 * sinHsv) * col.x + + (.587 * _HsvBright - .588 * cosHsv - 1.05 * sinHsv) * col.y + + (.114 * _HsvBright + .886 * cosHsv - .203 * sinHsv) * col.z; + col.rgb = resultHsv; + #endif + //------------------------------------------------------- + + //OVERLAY_ON + #if OVERLAY_ON + half2 overlayUvs = d.texcoord0.xy; + overlayUvs.x += ((_Time.y + randomSeed) * _OverlayTextureScrollXSpeed) % 1; + overlayUvs.y += ((_Time.y + randomSeed) * _OverlayTextureScrollYSpeed) % 1; + half4 overlayCol = SAMPLE_TEXTURE2D(_OverlayTex, sampler_OverlayTex, TRANSFORM_TEX(overlayUvs, _OverlayTex)); + overlayCol.rgb *= _OverlayColor.rgb * _OverlayGlow; + #if !OVERLAYMULT_ON + overlayCol.rgb *= overlayCol.a * _OverlayColor.rgb * _OverlayColor.a * _OverlayBlend; + col.rgb += overlayCol.rgb; + #else + overlayCol.a *= _OverlayColor.a; + col = lerp(col, col * overlayCol, _OverlayBlend); + #endif + #endif + + //--------------------------------- + + //OUTBASE_ON + #if OUTBASE_ON + #if OUTBASEPIXELPERF_ON + half2 destUv = half2(_OutlinePixelWidth * _MainTex_TexelSize.x, _OutlinePixelWidth * _MainTex_TexelSize.y); + #else + half2 destUv = half2(_OutlineWidth * _MainTex_TexelSize.x * 200, _OutlineWidth * _MainTex_TexelSize.y * 200); + #endif + + #if OUTDIST_ON + d.texcoord3.x += ((_Time.x + _RandomSeed) * _OutlineDistortTexXSpeed) % 1; + d.texcoord3.y += ((_Time.x + _RandomSeed) * _OutlineDistortTexYSpeed) % 1; + #if ATLAS_ON + d.texcoord3 = half2((d.texcoord3.x - _MinXUV) / (_MaxXUV - _MinXUV), (d.texcoord3.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half outDistortAmnt = (SAMPLE_TEXTURE2D(_OutlineDistortTex, sampler_OutlineDistortTex, d.texcoord3).r - 0.5) * 0.2 * _OutlineDistortAmount; + destUv.x += outDistortAmnt; + destUv.y += outDistortAmnt; + #endif + + half spriteLeft = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(destUv.x, 0)).a; + half spriteRight = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy - half2(destUv.x, 0)).a; + half spriteBottom = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(0, destUv.y)).a; + half spriteTop = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy - half2(0, destUv.y)).a; + half result = spriteLeft + spriteRight + spriteBottom + spriteTop; + + #if OUTBASE8DIR_ON + half spriteTopLeft = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(destUv.x, destUv.y)).a; + half spriteTopRight = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(-destUv.x, destUv.y)).a; + half spriteBotLeft = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(destUv.x, -destUv.y)).a; + half spriteBotRight = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(-destUv.x, -destUv.y)).a; + result = result + spriteTopLeft + spriteTopRight + spriteBotLeft + spriteBotRight; + #endif + + result = step(0.05, saturate(result)); + + #if OUTTEX_ON + d.texcoord1.x += ((_Time.x + _RandomSeed) * _OutlineTexXSpeed) % 1; + d.texcoord1.y += ((_Time.x + _RandomSeed) * _OutlineTexYSpeed) % 1; + #if ATLAS_ON + d.texcoord1 = half2((d.texcoord1.x - _MinXUV) / (_MaxXUV - _MinXUV), (d.texcoord1.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half4 tempOutColor = SAMPLE_TEXTURE2D(_OutlineTex, sampler_OutlineTex, d.texcoord1); + tempOutColor *= _OutlineColor; + _OutlineColor = tempOutColor; + #endif + + result *= (1 - originalAlpha) * _OutlineAlpha; + + half4 outline = _OutlineColor * d.vertexColor.a; + outline.rgb *= _OutlineGlow; + outline.a = result; + #if ONLYOUTLINE_ON + col = outline; + #else + col = lerp(col, outline, result); + #endif + #endif + //------------------------------------------------------- + + //FADE_ON + #if FADE_ON + half2 tiledUvFade1 = TRANSFORM_TEX(d.texcoord0, _FadeTex); + half2 tiledUvFade2 = TRANSFORM_TEX(d.texcoord0, _FadeBurnTex); + #if ATLAS_ON + tiledUvFade1 = half2((tiledUvFade1.x - _MinXUV) / (_MaxXUV - _MinXUV), (tiledUvFade1.y - _MinYUV) / (_MaxYUV - _MinYUV)); + tiledUvFade2 = half2((tiledUvFade2.x - _MinXUV) / (_MaxXUV - _MinXUV), (tiledUvFade2.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half fadeTemp = SAMPLE_TEXTURE2D(_FadeTex, sampler_FadeTex, tiledUvFade1).r; + half fade = smoothstep(_FadeAmount, _FadeAmount + _FadeBurnTransition, fadeTemp); + half fadeBurn = saturate(smoothstep(_FadeAmount - _FadeBurnWidth, _FadeAmount - _FadeBurnWidth + 0.1, fadeTemp) * _FadeAmount); + col.a *= fade; + _FadeBurnColor.rgb *= _FadeBurnGlow; + col += fadeBurn * SAMPLE_TEXTURE2D(_FadeBurnTex, sampler_FadeBurnTex, tiledUvFade2) * _FadeBurnColor * originalAlpha * (1 - col.a); + #endif + //------------------------------------------------------- + + //SHADOW_ON + #if SHADOW_ON + half shadowA = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(_ShadowX, _ShadowY)).a; + half preMultShadowMask = 1 - (saturate(shadowA - col.a) * (1 - col.a)); + col.rgb *= 1 - ((shadowA - col.a) * (1 - col.a)); + col.rgb += (_ShadowColor * shadowA) * (1 - col.a); + col.a = max(shadowA * _ShadowAlpha * d.vertexColor.a, col.a); + #endif + + //------------------------------------------------------- + + //GLOW_ON + #if GLOW_ON + half4 emission; + #if GLOWTEX_ON + emission = SAMPLE_TEXTURE2D(_GlowTex, sampler_GlowTex, d.texcoord0); + #else + emission = col; + #endif + + col.rgb *= _GlowGlobal; + emission.rgb *= emission.a * col.a * _Glow * _GlowColor; + col.rgb += emission.rgb; + #endif + //------------------------------------------------------- + + //COLORRAMP_ON && COLORRAMPOUTLINE_ON + #if COLORRAMP_ON && COLORRAMPOUTLINE_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + luminance = saturate(luminance + _ColorRampLuminosity); + #if GRADIENTCOLORRAMP_ON + col.rgb = lerp(col.rgb, SAMPLE_TEXTURE2D(_ColorRampTexGradient, sampler_ColorRampTexGradient, half2(luminance, 0)).rgb, _ColorRampBlend); + #else + col.rgb = lerp(col.rgb, SAMPLE_TEXTURE2D(_ColorRampTex, sampler_ColorRampTex, half2(luminance, 0)).rgb, _ColorRampBlend); + #endif + #endif + //--------------- + + //GREYSCALE_ON && GREYSCALEOUTLINE_ON + #if GREYSCALE_ON && GREYSCALEOUTLINE_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + luminance = saturate(luminance + _GreyscaleLuminosity); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _GreyscaleTintColor, _GreyscaleBlend); + #endif + + //----------------------------------- + + //POSTERIZE_ON && POSTERIZEOUTLINE_ON + #if POSTERIZE_ON && POSTERIZEOUTLINE_ON + col.rgb = pow(col.rgb, _PosterizeGamma) * _PosterizeNumColors; + col.rgb = floor(col.rgb) / _PosterizeNumColors; + col.rgb = pow(col.rgb, 1.0 / _PosterizeGamma); + #endif + + //----------------------------------- + + //SHINE_ON + #if SHINE_ON + half2 uvShine = uvRect; + half cosAngle = cos(_ShineRotate); + half sinAngle = sin(_ShineRotate); + half2x2 rot = half2x2(cosAngle, -sinAngle, sinAngle, cosAngle); + uvShine -= half2(0.5, 0.5); + uvShine = mul(rot, uvShine); + uvShine += half2(0.5, 0.5); + half shineMask = SAMPLE_TEXTURE2D(_ShineMask, sampler_ShineMask, d.texcoord0.xy).a; + half currentDistanceProjection = (uvShine.x + uvShine.y) / 2; + half whitePower = 1 - (abs(currentDistanceProjection - _ShineLocation) / _ShineWidth); + col.rgb += col.a * whitePower * _ShineGlow * max(sign(currentDistanceProjection - (_ShineLocation - _ShineWidth)), 0.0) + * max(sign((_ShineLocation + _ShineWidth) - currentDistanceProjection), 0.0) * _ShineColor * shineMask; + #endif + + //----------------------------------- + + //HOLOGRAM_ON + #if HOLOGRAM_ON + half totalHologram = _HologramStripesAmount + _HologramUnmodAmount; + half hologramYCoord = ((uvRect.y + (((_Time.x + randomSeed) % 1) * _HologramStripesSpeed)) % totalHologram) / totalHologram; + hologramYCoord = abs(hologramYCoord); + half alpha = RemapFloat(saturate(hologramYCoord - (_HologramUnmodAmount/totalHologram)), 0.0, 1.0, _HologramMinAlpha, saturate(_HologramMaxAlpha)); + half hologramMask = max(sign((_HologramUnmodAmount/totalHologram) - hologramYCoord), 0.0); + half4 hologramResult = col; + hologramResult.a *= lerp(alpha, 1, hologramMask); + hologramResult.rgb *= max(1, _HologramMaxAlpha * max(sign(hologramYCoord - (_HologramUnmodAmount/totalHologram)), 0.0)); + hologramMask = 1 - step(0.01,hologramMask); + hologramResult.rgb += hologramMask * _HologramStripeColor * col.a; + col = lerp(col, hologramResult, _HologramBlend); + #endif + + //----------------------------------- + + //FLICKER_ON + #if FLICKER_ON + col.a *= saturate(col.a * step(frac(0.05 + (_Time.w + randomSeed) * _FlickerFreq), 1 - _FlickerPercent) + _FlickerAlpha); + #endif + //----------------------------------- + + //ALPHACUTOFF_ON + + //ALPHAROUND_ON + + //ALPHAOUTLINE_ON + #if ALPHAOUTLINE_ON + half alphaOutlineRes = pow(1 - col.a, max(_AlphaOutlinePower, 0.0001)) * step(_AlphaOutlineMinAlpha, col.a) * _AlphaOutlineBlend; + col.rgb = lerp(col.rgb, _AlphaOutlineColor.rgb * _AlphaOutlineGlow, alphaOutlineRes); + col.a = lerp(col.a, 1, alphaOutlineRes > 1); + #endif + //------------------------------------------------------- + + //FOG_ON + + //------------------ + + col *= _Color; + o.Albedo = col; + col.a *= _Alpha; + clip(col.a - _AlphaCutoffValue - 0.01); + o.Alpha = _Color.a; + } + + + + + + void ChainSurfaceFunction(inout Surface l, inout ShaderData d) + { + Ext_SurfaceFunction0(l, d); + // Ext_SurfaceFunction1(l, d); + // Ext_SurfaceFunction2(l, d); + // Ext_SurfaceFunction3(l, d); + // Ext_SurfaceFunction4(l, d); + // Ext_SurfaceFunction5(l, d); + // Ext_SurfaceFunction6(l, d); + // Ext_SurfaceFunction7(l, d); + // Ext_SurfaceFunction8(l, d); + // Ext_SurfaceFunction9(l, d); + // Ext_SurfaceFunction10(l, d); + // Ext_SurfaceFunction11(l, d); + // Ext_SurfaceFunction12(l, d); + // Ext_SurfaceFunction13(l, d); + // Ext_SurfaceFunction14(l, d); + // Ext_SurfaceFunction15(l, d); + // Ext_SurfaceFunction16(l, d); + // Ext_SurfaceFunction17(l, d); + // Ext_SurfaceFunction18(l, d); + // Ext_SurfaceFunction19(l, d); + // Ext_SurfaceFunction20(l, d); + // Ext_SurfaceFunction21(l, d); + // Ext_SurfaceFunction22(l, d); + // Ext_SurfaceFunction23(l, d); + // Ext_SurfaceFunction24(l, d); + // Ext_SurfaceFunction25(l, d); + // Ext_SurfaceFunction26(l, d); + // Ext_SurfaceFunction27(l, d); + // Ext_SurfaceFunction28(l, d); + // Ext_SurfaceFunction29(l, d); + } + +#if !_DECALSHADER + + void ChainModifyVertex(inout VertexData v, inout VertexToPixel v2p, float4 time) + { + ExtraV2F d; + + ZERO_INITIALIZE(ExtraV2F, d); + ZERO_INITIALIZE(Blackboard, d.blackboard); + // due to motion vectors in HDRP, we need to use the last + // time in certain spots. So if you are going to use _Time to adjust vertices, + // you need to use this time or motion vectors will break. + d.time = time; + + Ext_ModifyVertex0(v, d); + // Ext_ModifyVertex1(v, d); + // Ext_ModifyVertex2(v, d); + // Ext_ModifyVertex3(v, d); + // Ext_ModifyVertex4(v, d); + // Ext_ModifyVertex5(v, d); + // Ext_ModifyVertex6(v, d); + // Ext_ModifyVertex7(v, d); + // Ext_ModifyVertex8(v, d); + // Ext_ModifyVertex9(v, d); + // Ext_ModifyVertex10(v, d); + // Ext_ModifyVertex11(v, d); + // Ext_ModifyVertex12(v, d); + // Ext_ModifyVertex13(v, d); + // Ext_ModifyVertex14(v, d); + // Ext_ModifyVertex15(v, d); + // Ext_ModifyVertex16(v, d); + // Ext_ModifyVertex17(v, d); + // Ext_ModifyVertex18(v, d); + // Ext_ModifyVertex19(v, d); + // Ext_ModifyVertex20(v, d); + // Ext_ModifyVertex21(v, d); + // Ext_ModifyVertex22(v, d); + // Ext_ModifyVertex23(v, d); + // Ext_ModifyVertex24(v, d); + // Ext_ModifyVertex25(v, d); + // Ext_ModifyVertex26(v, d); + // Ext_ModifyVertex27(v, d); + // Ext_ModifyVertex28(v, d); + // Ext_ModifyVertex29(v, d); + + + // #if %EXTRAV2F0REQUIREKEY% + // v2p.extraV2F0 = d.extraV2F0; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // v2p.extraV2F1 = d.extraV2F1; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // v2p.extraV2F2 = d.extraV2F2; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // v2p.extraV2F3 = d.extraV2F3; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // v2p.extraV2F4 = d.extraV2F4; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // v2p.extraV2F5 = d.extraV2F5; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // v2p.extraV2F6 = d.extraV2F6; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // v2p.extraV2F7 = d.extraV2F7; + // #endif + } + + void ChainModifyTessellatedVertex(inout VertexData v, inout VertexToPixel v2p) + { + ExtraV2F d; + ZERO_INITIALIZE(ExtraV2F, d); + ZERO_INITIALIZE(Blackboard, d.blackboard); + + // #if %EXTRAV2F0REQUIREKEY% + // d.extraV2F0 = v2p.extraV2F0; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // d.extraV2F1 = v2p.extraV2F1; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // d.extraV2F2 = v2p.extraV2F2; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // d.extraV2F3 = v2p.extraV2F3; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // d.extraV2F4 = v2p.extraV2F4; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // d.extraV2F5 = v2p.extraV2F5; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // d.extraV2F6 = v2p.extraV2F6; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // d.extraV2F7 = v2p.extraV2F7; + // #endif + + + // Ext_ModifyTessellatedVertex0(v, d); + // Ext_ModifyTessellatedVertex1(v, d); + // Ext_ModifyTessellatedVertex2(v, d); + // Ext_ModifyTessellatedVertex3(v, d); + // Ext_ModifyTessellatedVertex4(v, d); + // Ext_ModifyTessellatedVertex5(v, d); + // Ext_ModifyTessellatedVertex6(v, d); + // Ext_ModifyTessellatedVertex7(v, d); + // Ext_ModifyTessellatedVertex8(v, d); + // Ext_ModifyTessellatedVertex9(v, d); + // Ext_ModifyTessellatedVertex10(v, d); + // Ext_ModifyTessellatedVertex11(v, d); + // Ext_ModifyTessellatedVertex12(v, d); + // Ext_ModifyTessellatedVertex13(v, d); + // Ext_ModifyTessellatedVertex14(v, d); + // Ext_ModifyTessellatedVertex15(v, d); + // Ext_ModifyTessellatedVertex16(v, d); + // Ext_ModifyTessellatedVertex17(v, d); + // Ext_ModifyTessellatedVertex18(v, d); + // Ext_ModifyTessellatedVertex19(v, d); + // Ext_ModifyTessellatedVertex20(v, d); + // Ext_ModifyTessellatedVertex21(v, d); + // Ext_ModifyTessellatedVertex22(v, d); + // Ext_ModifyTessellatedVertex23(v, d); + // Ext_ModifyTessellatedVertex24(v, d); + // Ext_ModifyTessellatedVertex25(v, d); + // Ext_ModifyTessellatedVertex26(v, d); + // Ext_ModifyTessellatedVertex27(v, d); + // Ext_ModifyTessellatedVertex28(v, d); + // Ext_ModifyTessellatedVertex29(v, d); + + // #if %EXTRAV2F0REQUIREKEY% + // v2p.extraV2F0 = d.extraV2F0; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // v2p.extraV2F1 = d.extraV2F1; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // v2p.extraV2F2 = d.extraV2F2; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // v2p.extraV2F3 = d.extraV2F3; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // v2p.extraV2F4 = d.extraV2F4; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // v2p.extraV2F5 = d.extraV2F5; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // v2p.extraV2F6 = d.extraV2F6; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // v2p.extraV2F7 = d.extraV2F7; + // #endif + } + + void ChainFinalColorForward(inout Surface l, inout ShaderData d, inout half4 color) + { + // Ext_FinalColorForward0(l, d, color); + // Ext_FinalColorForward1(l, d, color); + // Ext_FinalColorForward2(l, d, color); + // Ext_FinalColorForward3(l, d, color); + // Ext_FinalColorForward4(l, d, color); + // Ext_FinalColorForward5(l, d, color); + // Ext_FinalColorForward6(l, d, color); + // Ext_FinalColorForward7(l, d, color); + // Ext_FinalColorForward8(l, d, color); + // Ext_FinalColorForward9(l, d, color); + // Ext_FinalColorForward10(l, d, color); + // Ext_FinalColorForward11(l, d, color); + // Ext_FinalColorForward12(l, d, color); + // Ext_FinalColorForward13(l, d, color); + // Ext_FinalColorForward14(l, d, color); + // Ext_FinalColorForward15(l, d, color); + // Ext_FinalColorForward16(l, d, color); + // Ext_FinalColorForward17(l, d, color); + // Ext_FinalColorForward18(l, d, color); + // Ext_FinalColorForward19(l, d, color); + // Ext_FinalColorForward20(l, d, color); + // Ext_FinalColorForward21(l, d, color); + // Ext_FinalColorForward22(l, d, color); + // Ext_FinalColorForward23(l, d, color); + // Ext_FinalColorForward24(l, d, color); + // Ext_FinalColorForward25(l, d, color); + // Ext_FinalColorForward26(l, d, color); + // Ext_FinalColorForward27(l, d, color); + // Ext_FinalColorForward28(l, d, color); + // Ext_FinalColorForward29(l, d, color); + } + + void ChainFinalGBufferStandard(inout Surface s, inout ShaderData d, inout half4 GBuffer0, inout half4 GBuffer1, inout half4 GBuffer2, inout half4 outEmission, inout half4 outShadowMask) + { + // Ext_FinalGBufferStandard0(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard1(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard2(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard3(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard4(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard5(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard6(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard7(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard8(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard9(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard10(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard11(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard12(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard13(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard14(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard15(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard16(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard17(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard18(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard19(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard20(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard21(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard22(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard23(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard24(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard25(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard26(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard27(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard28(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard29(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + } +#endif + + + + + +#if _DECALSHADER + + ShaderData CreateShaderData(SurfaceDescriptionInputs IN) + { + ShaderData d = (ShaderData)0; + d.TBNMatrix = float3x3(IN.WorldSpaceTangent, IN.WorldSpaceBiTangent, IN.WorldSpaceNormal); + d.worldSpaceNormal = IN.WorldSpaceNormal; + d.worldSpaceTangent = IN.WorldSpaceTangent; + + d.worldSpacePosition = IN.WorldSpacePosition; + d.texcoord0 = IN.uv0.xyxy; + d.screenPos = IN.ScreenPosition; + + d.worldSpaceViewDir = normalize(_WorldSpaceCameraPos - d.worldSpacePosition); + + d.tangentSpaceViewDir = mul(d.TBNMatrix, d.worldSpaceViewDir); + + // these rarely get used, so we back transform them. Usually will be stripped. + #if _HDRP + // d.localSpacePosition = mul(GetWorldToObjectMatrix(), float4(GetCameraRelativePositionWS(d.worldSpacePosition), 1)).xyz; + #else + // d.localSpacePosition = mul(GetWorldToObjectMatrix(), float4(d.worldSpacePosition, 1)).xyz; + #endif + // d.localSpaceNormal = normalize(mul((float3x3)GetWorldToObjectMatrix(), d.worldSpaceNormal)); + // d.localSpaceTangent = normalize(mul((float3x3)GetWorldToObjectMatrix(), d.worldSpaceTangent.xyz)); + + // #if %SCREENPOSREQUIREKEY% + // d.screenUV = (IN.ScreenPosition.xy / max(0.01, IN.ScreenPosition.w)); + // #endif + + return d; + } +#else + + ShaderData CreateShaderData(VertexToPixel i + #if NEED_FACING + , bool facing + #endif + ) + { + ShaderData d = (ShaderData)0; + d.clipPos = i.pos; + d.worldSpacePosition = i.worldPos; + + d.worldSpaceNormal = normalize(i.worldNormal); + d.worldSpaceTangent.xyz = normalize(i.worldTangent.xyz); + + d.tangentSign = i.worldTangent.w * unity_WorldTransformParams.w; + float3 bitangent = cross(d.worldSpaceTangent.xyz, d.worldSpaceNormal) * d.tangentSign; + + d.TBNMatrix = float3x3(d.worldSpaceTangent, -bitangent, d.worldSpaceNormal); + d.worldSpaceViewDir = normalize(_WorldSpaceCameraPos - i.worldPos); + + d.tangentSpaceViewDir = mul(d.TBNMatrix, d.worldSpaceViewDir); + d.texcoord0 = i.texcoord0; + d.texcoord1 = i.texcoord1; + d.texcoord2 = i.texcoord2; + + // #if %TEXCOORD3REQUIREKEY% + d.texcoord3 = i.texcoord3; + // #endif + + // d.isFrontFace = facing; + // #if %VERTEXCOLORREQUIREKEY% + d.vertexColor = i.vertexColor; + // #endif + + // these rarely get used, so we back transform them. Usually will be stripped. + #if _HDRP + // d.localSpacePosition = mul(GetWorldToObjectMatrix(), float4(GetCameraRelativePositionWS(i.worldPos), 1)).xyz; + #else + // d.localSpacePosition = mul(GetWorldToObjectMatrix(), float4(i.worldPos, 1)).xyz; + #endif + // d.localSpaceNormal = normalize(mul((float3x3)GetWorldToObjectMatrix(), i.worldNormal)); + // d.localSpaceTangent = normalize(mul((float3x3)GetWorldToObjectMatrix(), i.worldTangent.xyz)); + + // #if %SCREENPOSREQUIREKEY% + // d.screenPos = i.screenPos; + // d.screenUV = (i.screenPos.xy / i.screenPos.w); + // #endif + + + // #if %EXTRAV2F0REQUIREKEY% + // d.extraV2F0 = i.extraV2F0; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // d.extraV2F1 = i.extraV2F1; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // d.extraV2F2 = i.extraV2F2; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // d.extraV2F3 = i.extraV2F3; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // d.extraV2F4 = i.extraV2F4; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // d.extraV2F5 = i.extraV2F5; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // d.extraV2F6 = i.extraV2F6; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // d.extraV2F7 = i.extraV2F7; + // #endif + + return d; + } + +#endif + + + #if defined(_PASSSHADOW) + float3 _LightDirection; + float3 _LightPosition; + #endif + + #if (_PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR))) + + #define GetWorldToViewMatrix() _ViewMatrix + #define UNITY_MATRIX_I_V _InvViewMatrix + #define GetViewToHClipMatrix() OptimizeProjectionMatrix(_ProjMatrix) + #define UNITY_MATRIX_I_P _InvProjMatrix + #define GetWorldToHClipMatrix() _ViewProjMatrix + #define UNITY_MATRIX_I_VP _InvViewProjMatrix + #define UNITY_MATRIX_UNJITTERED_VP _NonJitteredViewProjMatrix + #define UNITY_MATRIX_PREV_VP _PrevViewProjMatrix + #define UNITY_MATRIX_PREV_I_VP _PrevInvViewProjMatrix + + void MotionVectorPositionZBias(VertexToPixel input) + { + #if UNITY_REVERSED_Z + input.pos.z -= unity_MotionVectorsParams.z * input.pos.w; + #else + input.pos.z += unity_MotionVectorsParams.z * input.pos.w; + #endif + } + + #endif + + // vertex shader + VertexToPixel Vert (VertexData v) + { + VertexToPixel o = (VertexToPixel)0; + + UNITY_SETUP_INSTANCE_ID(v); + UNITY_TRANSFER_INSTANCE_ID(v, o); + UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o); + + + #if _URP && (_PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR))) + VertexData previousMesh = v; + #endif + #if !_TESSELLATION_ON + ChainModifyVertex(v, o, _Time); + #endif + + o.texcoord0 = v.texcoord0; + o.texcoord1 = v.texcoord1; + o.texcoord2 = v.texcoord2; + + // #if %TEXCOORD3REQUIREKEY% + o.texcoord3 = v.texcoord3; + // #endif + + // #if %VERTEXCOLORREQUIREKEY% + o.vertexColor = v.vertexColor; + // #endif + + // This return the camera relative position (if enable) + float3 positionWS = TransformObjectToWorld(v.vertex.xyz); + float3 normalWS = TransformObjectToWorldNormal(v.normal); + float4 tangentWS = float4(TransformObjectToWorldDir(v.tangent.xyz), v.tangent.w); + + VertexPositionInputs vertexInput = GetVertexPositionInputs(v.vertex.xyz); + o.worldPos = positionWS; + o.worldNormal = normalWS; + o.worldTangent = tangentWS; + + + // For some very odd reason, in 2021.2, we can't use Unity's defines, but have to use our own.. + #if _PASSSHADOW + #if _CASTING_PUNCTUAL_LIGHT_SHADOW + float3 lightDirectionWS = normalize(_LightPosition - o.worldPos); + #else + float3 lightDirectionWS = _LightDirection; + #endif + // Define shadow pass specific clip position for Universal + o.pos = TransformWorldToHClip(ApplyShadowBias(o.worldPos, o.worldNormal, lightDirectionWS)); + #if UNITY_REVERSED_Z + o.pos.z = min(o.pos.z, UNITY_NEAR_CLIP_VALUE); + #else + o.pos.z = max(o.pos.z, UNITY_NEAR_CLIP_VALUE); + #endif + #elif _PASSMETA + o.pos = MetaVertexPosition(float4(v.vertex.xyz, 0), v.texcoord1.xy, v.texcoord2.xy, unity_LightmapST, unity_DynamicLightmapST); + #else + o.pos = TransformWorldToHClip(o.worldPos); + #endif + + // #if %SCREENPOSREQUIREKEY% + // o.screenPos = ComputeScreenPos(o.pos, _ProjectionParams.x); + // #endif + + + #if _PASSFORWARD || _PASSGBUFFER + float2 uv1 = v.texcoord1.xy; + OUTPUT_LIGHTMAP_UV(uv1, unity_LightmapST, o.lightmapUV); + o.texcoord1.xy = uv1; + #if UNITY_VERSION < 60000009 + OUTPUT_SH(o.worldNormal, o.sh); + #endif + + #if defined(DYNAMICLIGHTMAP_ON) + o.dynamicLightmapUV.xy = v.texcoord2.xy * unity_DynamicLightmapST.xy + unity_DynamicLightmapST.zw; + #if UNITY_VERSION >= 60000009 + OUTPUT_SH(o.worldNormal, o.sh); + #endif + #elif (defined(PROBE_VOLUMES_L1) || defined(PROBE_VOLUMES_L2)) && UNITY_VERSION >= 60000009 + OUTPUT_SH4(vertexInput.positionWS, o.worldNormal.xyz, GetWorldSpaceNormalizeViewDir(vertexInput.positionWS), o.sh, o.probeOcclusion); + #endif + #endif + + #ifdef VARYINGS_NEED_FOG_AND_VERTEX_LIGHT + half fogFactor = 0; + #if defined(_FOG_FRAGMENT) + fogFactor = ComputeFogFactor(o.pos.z); + #endif + #if _BAKEDLIT + o.fogFactorAndVertexLight = half4(fogFactor, 0, 0, 0); + #else + half3 vertexLight = VertexLighting(o.worldPos, o.worldNormal); + o.fogFactorAndVertexLight = half4(fogFactor, vertexLight); + #endif + #endif + + #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR) + o.shadowCoord = GetShadowCoord(vertexInput); + #endif + + #if _URP && (_PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR))) + #if !defined(TESSELLATION_ON) + MotionVectorPositionZBias(o); + #endif + + o.previousPositionCS = float4(0.0, 0.0, 0.0, 1.0); + // Note: unity_MotionVectorsParams.y is 0 is forceNoMotion is enabled + bool forceNoMotion = unity_MotionVectorsParams.y == 0.0; + + if (!forceNoMotion) + { + #if defined(HAVE_VFX_MODIFICATION) + float3 previousPositionOS = currentFrameMvData.vfxParticlePositionOS; + #if defined(VFX_FEATURE_MOTION_VECTORS_VERTS) + const bool applyDeformation = false; + #else + const bool applyDeformation = true; + #endif + #else + const bool hasDeformation = unity_MotionVectorsParams.x == 1; // Mesh has skinned deformation + float3 previousPositionOS = hasDeformation ? previousMesh.previousPositionOS : previousMesh.vertex.xyz; + + #if defined(AUTOMATIC_TIME_BASED_MOTION_VECTORS) && defined(GRAPH_VERTEX_USES_TIME_PARAMETERS_INPUT) + const bool applyDeformation = true; + #else + const bool applyDeformation = hasDeformation; + #endif + #endif + // TODO + #if defined(FEATURES_GRAPH_VERTEX) + if (applyDeformation) + previousPositionOS = GetLastFrameDeformedPosition(previousMesh, currentFrameMvData, previousPositionOS); + else + previousPositionOS = previousMesh.positionOS; + + #if defined(FEATURES_GRAPH_VERTEX_MOTION_VECTOR_OUTPUT) + previousPositionOS -= previousMesh.precomputedVelocity; + #endif + #endif + + #if defined(UNITY_DOTS_INSTANCING_ENABLED) && defined(DOTS_DEFORMED) + // Deformed vertices in DOTS are not cumulative with built-in Unity skinning/blend shapes + // Needs to be called after vertex modification has been applied otherwise it will be + // overwritten by Compute Deform node + ApplyPreviousFrameDeformedVertexPosition(previousMesh.vertexID, previousPositionOS); + #endif + #if defined (_ADD_PRECOMPUTED_VELOCITY) + previousPositionOS -= previousMesh.precomputedVelocity; + #endif + o.positionCS = mul(UNITY_MATRIX_UNJITTERED_VP, float4(positionWS, 1.0f)); + + #if defined(HAVE_VFX_MODIFICATION) + #if defined(VFX_FEATURE_MOTION_VECTORS_VERTS) + #if defined(FEATURES_GRAPH_VERTEX_MOTION_VECTOR_OUTPUT) || defined(_ADD_PRECOMPUTED_VELOCITY) + #error Unexpected fast path rendering VFX motion vector while there are vertex modification afterwards. + #endif + o.previousPositionCS = VFXGetPreviousClipPosition(previousMesh, currentFrameMvData.vfxElementAttributes, o.positionCS); + #else + #if VFX_WORLD_SPACE + //previousPositionOS is already in world space + const float3 previousPositionWS = previousPositionOS; + #else + const float3 previousPositionWS = mul(UNITY_PREV_MATRIX_M, float4(previousPositionOS, 1.0f)).xyz; + #endif + o.previousPositionCS = mul(UNITY_MATRIX_PREV_VP, float4(previousPositionWS, 1.0f)); + #endif + #else + o.previousPositionCS = mul(UNITY_MATRIX_PREV_VP, mul(UNITY_PREV_MATRIX_M, float4(previousPositionOS, 1))); + #endif + } + #endif + + return o; + } + + + + +#if _UNLIT + #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Unlit.hlsl" +#endif + + // fragment shader + void Frag (VertexToPixel IN + , out half4 outColor : SV_Target0 + #ifdef _WRITE_RENDERING_LAYERS + , out float4 outRenderingLayers : SV_Target1 + #endif + #ifdef _DEPTHOFFSET_ON + , out float outputDepth : SV_Depth + #endif + #if NEED_FACING + , bool facing : SV_IsFrontFace + #endif + ) + { + UNITY_SETUP_INSTANCE_ID(IN); + UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX(IN); + + #if defined(LOD_FADE_CROSSFADE) + LODFadeCrossFade(IN.pos); + #endif + + + ShaderData d = CreateShaderData(IN + #if NEED_FACING + , facing + #endif + ); + Surface l = (Surface)0; + + #ifdef _DEPTHOFFSET_ON + l.outputDepth = outputDepth; + #endif + + l.Albedo = half3(0.5, 0.5, 0.5); + l.Normal = float3(0,0,1); + l.Occlusion = 1; + l.Alpha = 1; + + ChainSurfaceFunction(l, d); + + #ifdef _DEPTHOFFSET_ON + outputDepth = l.outputDepth; + #endif + + #if _USESPECULAR || _SIMPLELIT + float3 specular = l.Specular; + float metallic = 1; + #else + float3 specular = 0; + float metallic = l.Metallic; + #endif + + + + + InputData inputData = (InputData)0; + + inputData.positionWS = IN.worldPos; + #if _WORLDSPACENORMAL + inputData.normalWS = l.Normal; + #else + inputData.normalWS = normalize(TangentToWorldSpace(d, l.Normal)); + #endif + + inputData.viewDirectionWS = SafeNormalize(d.worldSpaceViewDir); + + + #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR) + inputData.shadowCoord = IN.shadowCoord; + #elif defined(MAIN_LIGHT_CALCULATE_SHADOWS) + inputData.shadowCoord = TransformWorldToShadowCoord(IN.worldPos); + #else + inputData.shadowCoord = float4(0, 0, 0, 0); + #endif + +#if _BAKEDLIT + inputData.fogCoord = IN.fogFactorAndVertexLight.x; + inputData.vertexLighting = 0; +#else + inputData.fogCoord = InitializeInputDataFog(float4(IN.worldPos, 1.0), IN.fogFactorAndVertexLight.x); + inputData.vertexLighting = IN.fogFactorAndVertexLight.yzw; +#endif + + + + #if defined(_OVERRIDE_BAKEDGI) + inputData.bakedGI = l.DiffuseGI; + l.Emission += l.SpecularGI; + #elif _BAKEDLIT + inputData.bakedGI = SAMPLE_GI(IN.lightmapUV, IN.sh, inputData.normalWS); + #else + #if defined(DYNAMICLIGHTMAP_ON) + inputData.bakedGI = SAMPLE_GI(IN.lightmapUV, IN.dynamicLightmapUV.xy, IN.sh, inputData.normalWS); + #elif defined(PROBE_VOLUMES_L1) || defined(PROBE_VOLUMES_L2) + #if UNITY_VERSION >= 60000009 + inputData.bakedGI = SAMPLE_GI(IN.sh, IN.worldPos, inputData.normalWS, inputData.viewDirectionWS, IN.pos, IN.probeOcclusion, inputData.shadowMask); + #else + inputData.bakedGI = SAMPLE_GI(IN.sh, IN.worldPos, inputData.normalWS, inputData.viewDirectionWS, IN.pos); + #endif + #else + inputData.bakedGI = SAMPLE_GI(IN.lightmapUV, IN.sh, inputData.normalWS); + #endif + #endif + inputData.normalizedScreenSpaceUV = GetNormalizedScreenSpaceUV(IN.pos); + #if !_BAKEDLIT + inputData.shadowMask = SAMPLE_SHADOWMASK(IN.lightmapUV); + + #if defined(_OVERRIDE_SHADOWMASK) + float4 mulColor = saturate(dot(l.ShadowMask, _MainLightOcclusionProbes)); //unity_OcclusionMaskSelector)); + inputData.shadowMask = mulColor; + #endif + #else + inputData.shadowMask = float4(1,1,1,1); + #endif + + #if defined(DEBUG_DISPLAY) + #if defined(DYNAMICLIGHTMAP_ON) + inputData.dynamicLightmapUV = IN.dynamicLightmapUV.xy; + #endif + #if defined(LIGHTMAP_ON) + inputData.staticLightmapUV = IN.lightmapUV; + #else + inputData.vertexSH = IN.sh; + #endif + #endif + + #if _WORLDSPACENORMAL + float3 normalTS = WorldToTangentSpace(d, l.Normal); + #else + float3 normalTS = l.Normal; + #endif + + SurfaceData surface = (SurfaceData)0; + surface.albedo = l.Albedo; + surface.metallic = saturate(metallic); + surface.specular = specular; + surface.smoothness = saturate(l.Smoothness), + surface.occlusion = l.Occlusion, + surface.emission = l.Emission, + surface.alpha = saturate(l.Alpha); + surface.clearCoatMask = 0; + surface.clearCoatSmoothness = 1; + + #ifdef _CLEARCOAT + surface.clearCoatMask = saturate(l.CoatMask); + surface.clearCoatSmoothness = saturate(l.CoatSmoothness); + #endif + + #if !_UNLIT + half4 color = half4(l.Albedo, l.Alpha); + #ifdef _DBUFFER + #if _BAKEDLIT + half3 bakeColor = color.rgb; + float3 bakeNormal = inputData.normalWS.xyz; + ApplyDecalToBaseColorAndNormal(IN.pos, bakeColor, bakeNormal); + color.rgb = bakeColor; + inputData.normalWS.xyz = bakeNormal; + #else + ApplyDecalToSurfaceData(IN.pos, surface, inputData); + #endif + #endif + #if _SIMPLELIT + color = UniversalFragmentBlinnPhong( + inputData, + surface); + #elif _BAKEDLIT + color = UniversalFragmentBakedLit(inputData, color.rgb, color.a, normalTS); + #else + color = UniversalFragmentPBR(inputData, surface); + #endif + + #if !DISABLEFOG + color.rgb = MixFog(color.rgb, inputData.fogCoord); + #endif + + #else // unlit + #ifdef _DBUFFER + ApplyDecalToSurfaceData(IN.pos, surface, inputData); + #endif + half4 color = UniversalFragmentUnlit(inputData, l.Albedo, l.Alpha); + #if !DISABLEFOG + color.rgb = MixFog(color.rgb, inputData.fogCoord); + #endif + #endif + ChainFinalColorForward(l, d, color); + + outColor = color; + + #ifdef _WRITE_RENDERING_LAYERS + uint renderingLayers = GetMeshRenderingLayer(); + outRenderingLayers = float4(EncodeMeshRenderingLayer(renderingLayers), 0, 0, 0); + #endif + + } + + ENDHLSL + + } + + + + Pass + { + Name "GBuffer" + Tags + { + "LightMode" = "UniversalGBuffer" + } + + Blend One Zero + ZTest LEqual + ZWrite On + + Tags { "RenderType" = "Opaque" "Queue" = "Geometry" "PreviewType" = "Plane" } + Cull [_CullingOption] + ZWrite [_ZWrite] + ZTest [_ZTestMode] + + + HLSLPROGRAM + + #pragma vertex Vert + #pragma fragment Frag + + #pragma target 3.0 + + #pragma prefer_hlslcc gles + #pragma exclude_renderers d3d11_9x + #pragma multi_compile_instancing + #pragma multi_compile_fog + #pragma instancing_options renderinglayer + + #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_fragment _ _REFLECTION_PROBE_BLENDING + #pragma multi_compile_fragment _ _REFLECTION_PROBE_BOX_PROJECTION + #pragma multi_compile_fragment _ _SHADOWS_SOFT + #pragma multi_compile_fragment _ _SHADOWS_SOFT_LOW + #pragma multi_compile_fragment _ _SHADOWS_SOFT_MEDIUM + #pragma multi_compile_fragment _ _SHADOWS_SOFT_HIGH + #pragma multi_compile _ LIGHTMAP_SHADOW_MIXING + #pragma multi_compile _ SHADOWS_SHADOWMASK + #pragma multi_compile _ _MIXED_LIGHTING_SUBTRACTIVE + #pragma multi_compile_fragment _ _DBUFFER_MRT1 _DBUFFER_MRT2 _DBUFFER_MRT3 + #pragma multi_compile_fragment _ _GBUFFER_NORMALS_OCT + #pragma multi_compile_fragment _ _RENDER_PASS_ENABLED + #pragma multi_compile_fragment _ DEBUG_DISPLAY + #pragma multi_compile_fragment _ LOD_FADE_CROSSFADE + + + #define _FOG_FRAGMENT 1 + + #define VARYINGS_NEED_FOG_AND_VERTEX_LIGHT + #define SHADERPASS SHADERPASS_GBUFFER + #define _PASSGBUFFER 1 + + + #pragma shader_feature_local GLOW_ON + #pragma shader_feature_local FADE_ON + #pragma shader_feature_local OUTBASE_ON + #pragma shader_feature_local ONLYOUTLINE_ON + #pragma shader_feature_local GRADIENT_ON + #pragma shader_feature_local GRADIENT2COL_ON + #pragma shader_feature_local RADIALGRADIENT_ON + #pragma shader_feature_local COLORSWAP_ON + #pragma shader_feature_local HSV_ON + #pragma shader_feature_local CHANGECOLOR_ON + #pragma shader_feature_local CHANGECOLOR2_ON + #pragma shader_feature_local CHANGECOLOR3_ON + #pragma shader_feature_local COLORRAMP_ON + #pragma shader_feature_local GRADIENTCOLORRAMP_ON + #pragma shader_feature_local HITEFFECT_ON + #pragma shader_feature_local NEGATIVE_ON + #pragma shader_feature_local PIXELATE_ON + #pragma shader_feature_local GREYSCALE_ON + #pragma shader_feature_local POSTERIZE_ON + #pragma shader_feature_local BLUR_ON + #pragma shader_feature_local MOTIONBLUR_ON + #pragma shader_feature_local GHOST_ON + #pragma shader_feature_local ALPHAOUTLINE_ON + #pragma shader_feature_local INNEROUTLINE_ON + #pragma shader_feature_local ONLYINNEROUTLINE_ON + #pragma shader_feature_local HOLOGRAM_ON + #pragma shader_feature_local CHROMABERR_ON + #pragma shader_feature_local GLITCH_ON + #pragma shader_feature_local FLICKER_ON + #pragma shader_feature_local SHADOW_ON + #pragma shader_feature_local SHINE_ON + #pragma shader_feature_local CONTRAST_ON + #pragma shader_feature_local OVERLAY_ON + #pragma shader_feature_local OVERLAYMULT_ON + #pragma shader_feature_local DOODLE_ON + #pragma shader_feature_local WIND_ON + #pragma shader_feature_local WAVEUV_ON + #pragma shader_feature_local ROUNDWAVEUV_ON + #pragma shader_feature_local RECTSIZE_ON + #pragma shader_feature_local OFFSETUV_ON + #pragma shader_feature_local CLIPPING_ON + #pragma shader_feature_local RADIALCLIPPING_ON + #pragma shader_feature_local TEXTURESCROLL_ON + #pragma shader_feature_local ZOOMUV_ON + #pragma shader_feature_local DISTORT_ON + #pragma shader_feature_local WARP_ON + #pragma shader_feature_local TWISTUV_ON + #pragma shader_feature_local ROTATEUV_ON + #pragma shader_feature_local POLARUV_ON + #pragma shader_feature_local FISHEYE_ON + #pragma shader_feature_local PINCH_ON + #pragma shader_feature_local SHAKEUV_ON + + #pragma shader_feature_local GLOWTEX_ON + #pragma shader_feature_local OUTTEX_ON + #pragma shader_feature_local OUTDIST_ON + #pragma shader_feature_local OUTBASE8DIR_ON + #pragma shader_feature_local OUTBASEPIXELPERF_ON + #pragma shader_feature_local COLORRAMPOUTLINE_ON + #pragma shader_feature_local GREYSCALEOUTLINE_ON + #pragma shader_feature_local POSTERIZEOUTLINE_ON + #pragma shader_feature_local BLURISHD_ON + #pragma shader_feature_local MANUALWIND_ON + #pragma shader_feature_local ATLAS_ON + #pragma shader_feature_local PREMULTIPLYALPHA_ON + + #pragma shader_feature BILBOARD_ON + #pragma shader_feature BILBOARDY_ON + + #pragma shader_feature NORMALMAP_ON + + + #define _URP 1 +#define _USINGTEXCOORD1 1 +#define _USINGTEXCOORD2 1 + + + + + // Includes + #include_with_pragmas "Packages/com.unity.render-pipelines.universal/ShaderLibrary/DOTS.hlsl" + #include_with_pragmas "Packages/com.unity.render-pipelines.universal/ShaderLibrary/RenderingLayers.hlsl" + #include_with_pragmas "Packages/com.unity.render-pipelines.universal/ShaderLibrary/ProbeVolumeVariants.hlsl" + #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.universal/ShaderLibrary/Input.hlsl" + #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/TextureStack.hlsl" + #include_with_pragmas "Packages/com.unity.render-pipelines.core/ShaderLibrary/FoveatedRenderingKeywords.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" + #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/LODCrossFade.hlsl" + + + + #undef WorldNormalVector + #define WorldNormalVector(data, normal) mul(normal, data.TBNMatrix) + + #define UnityObjectToWorldNormal(normal) mul(GetObjectToWorldMatrix(), normal) + + #define _WorldSpaceLightPos0 _MainLightPosition + + #define UNITY_DECLARE_TEX2D(name) TEXTURE2D(name); SAMPLER(sampler##name); + #define UNITY_DECLARE_TEX2D_NOSAMPLER(name) TEXTURE2D(name); + #define UNITY_DECLARE_TEX2DARRAY(name) TEXTURE2D_ARRAY(name); SAMPLER(sampler##name); + #define UNITY_DECLARE_TEX2DARRAY_NOSAMPLER(name) TEXTURE2D_ARRAY(name); + + #define UNITY_SAMPLE_TEX2DARRAY(tex,coord) SAMPLE_TEXTURE2D_ARRAY(tex, sampler##tex, coord.xy, coord.z) + #define UNITY_SAMPLE_TEX2DARRAY_LOD(tex,coord,lod) SAMPLE_TEXTURE2D_ARRAY_LOD(tex, sampler##tex, coord.xy, coord.z, lod) + #define UNITY_SAMPLE_TEX2D(tex, coord) SAMPLE_TEXTURE2D(tex, sampler##tex, coord) + #define UNITY_SAMPLE_TEX2D_SAMPLER(tex, samp, coord) SAMPLE_TEXTURE2D(tex, sampler##samp, coord) + + #define UNITY_SAMPLE_TEX2D_LOD(tex,coord, lod) SAMPLE_TEXTURE2D_LOD(tex, sampler_##tex, coord, lod) + #define UNITY_SAMPLE_TEX2D_SAMPLER_LOD(tex,samplertex,coord, lod) SAMPLE_TEXTURE2D_LOD (tex, sampler##samplertex,coord, lod) + + #if defined(UNITY_COMPILER_HLSL) + #define UNITY_INITIALIZE_OUTPUT(type,name) name = (type)0; + #else + #define UNITY_INITIALIZE_OUTPUT(type,name) + #endif + + #define sampler2D_float sampler2D + #define sampler2D_half sampler2D + + + + // data across stages, stripped like the above. + struct VertexToPixel + { + float4 pos : SV_POSITION; + float3 worldPos : TEXCOORD0; + float3 worldNormal : TEXCOORD1; + float4 worldTangent : TEXCOORD2; + float4 texcoord0 : TEXCOORD3; + float4 texcoord1 : TEXCOORD4; + float4 texcoord2 : TEXCOORD5; + + // #if %TEXCOORD3REQUIREKEY% + float4 texcoord3 : TEXCOORD6; + // #endif + + // #if %SCREENPOSREQUIREKEY% + // float4 screenPos : TEXCOORD7; + // #endif + + // #if %VERTEXCOLORREQUIREKEY% + half4 vertexColor : COLOR; + // #endif + + #if defined(LIGHTMAP_ON) + float2 lightmapUV : TEXCOORD8; + #endif + #if defined(DYNAMICLIGHTMAP_ON) + float2 dynamicLightmapUV : TEXCOORD9; + #endif + #if !defined(LIGHTMAP_ON) + float4 probeOcclusion : TEXCOORD8; + float3 sh : TEXCOORD10; + #endif + + #if defined(VARYINGS_NEED_FOG_AND_VERTEX_LIGHT) + float4 fogFactorAndVertexLight : TEXCOORD11; + #endif + + #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR) + float4 shadowCoord : TEXCOORD12; + #endif + + // #if %EXTRAV2F0REQUIREKEY% + // float4 extraV2F0 : TEXCOORD13; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // float4 extraV2F1 : TEXCOORD14; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // float4 extraV2F2 : TEXCOORD15; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // float4 extraV2F3 : TEXCOORD16; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // float4 extraV2F4 : TEXCOORD17; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // float4 extraV2F5 : TEXCOORD18; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // float4 extraV2F6 : TEXCOORD19; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // float4 extraV2F7 : TEXCOORD20; + // #endif + + #if UNITY_ANY_INSTANCING_ENABLED + uint instanceID : CUSTOM_INSTANCE_ID; + #endif + #if (defined(UNITY_STEREO_MULTIVIEW_ENABLED)) || (defined(UNITY_STEREO_INSTANCING_ENABLED) && (defined(SHADER_API_GLES3) || defined(SHADER_API_GLCORE))) + uint stereoTargetEyeIndexAsBlendIdx0 : BLENDINDICES0; + #endif + #if (defined(UNITY_STEREO_INSTANCING_ENABLED)) + uint stereoTargetEyeIndexAsRTArrayIdx : SV_RenderTargetArrayIndex; + #endif + #if defined(SHADER_STAGE_FRAGMENT) && defined(VARYINGS_NEED_CULLFACE) + FRONT_FACE_TYPE cullFace : FRONT_FACE_SEMANTIC; + #endif + + #if _PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR)) + float4 previousPositionCS : TEXCOORD21; // Contain previous transform position (in case of skinning for example) + float4 positionCS : TEXCOORD22; + #endif + }; + + + + + + // data describing the user output of a pixel + struct Surface + { + half3 Albedo; + half Height; + half3 Normal; + half Smoothness; + half3 Emission; + half Metallic; + half3 Specular; + half Occlusion; + half SpecularPower; // for simple lighting + half Alpha; + float outputDepth; // if written, SV_Depth semantic is used. ShaderData.clipPos.z is unused value + // HDRP Only + half SpecularOcclusion; + half SubsurfaceMask; + half Thickness; + half CoatMask; + half CoatSmoothness; + half Anisotropy; + half IridescenceMask; + half IridescenceThickness; + int DiffusionProfileHash; + float SpecularAAThreshold; + float SpecularAAScreenSpaceVariance; + // requires _OVERRIDE_BAKEDGI to be defined, but is mapped in all pipelines + float3 DiffuseGI; + float3 BackDiffuseGI; + float3 SpecularGI; + float ior; + float3 transmittanceColor; + float atDistance; + float transmittanceMask; + // requires _OVERRIDE_SHADOWMASK to be defines + float4 ShadowMask; + + // for decals + float NormalAlpha; + float MAOSAlpha; + + + }; + + // Data the user declares in blackboard blocks + struct Blackboard + { + + float blackboardDummyData; + }; + + // data the user might need, this will grow to be big. But easy to strip + struct ShaderData + { + float4 clipPos; // SV_POSITION + float3 localSpacePosition; + float3 localSpaceNormal; + float3 localSpaceTangent; + + float3 worldSpacePosition; + float3 worldSpaceNormal; + float3 worldSpaceTangent; + float tangentSign; + + float3 worldSpaceViewDir; + float3 tangentSpaceViewDir; + + float4 texcoord0; + float4 texcoord1; + float4 texcoord2; + float4 texcoord3; + + float2 screenUV; + float4 screenPos; + + float4 vertexColor; + bool isFrontFace; + + float4 extraV2F0; + float4 extraV2F1; + float4 extraV2F2; + float4 extraV2F3; + float4 extraV2F4; + float4 extraV2F5; + float4 extraV2F6; + float4 extraV2F7; + + float3x3 TBNMatrix; + Blackboard blackboard; + }; + + struct VertexData + { + #if SHADER_TARGET > 30 + // uint vertexID : SV_VertexID; + #endif + float4 vertex : POSITION; + float3 normal : NORMAL; + float4 tangent : TANGENT; + float4 texcoord0 : TEXCOORD0; + + // optimize out mesh coords when not in use by user or lighting system + #if _URP && (_USINGTEXCOORD1 || _PASSMETA || _PASSFORWARD || _PASSGBUFFER) + float4 texcoord1 : TEXCOORD1; + #endif + + #if _URP && (_USINGTEXCOORD2 || _PASSMETA || ((_PASSFORWARD || _PASSGBUFFER) && defined(DYNAMICLIGHTMAP_ON))) + float4 texcoord2 : TEXCOORD2; + #endif + + #if _STANDARD && (_USINGTEXCOORD1 || (_PASSMETA || ((_PASSFORWARD || _PASSGBUFFER || _PASSFORWARDADD) && LIGHTMAP_ON))) + float4 texcoord1 : TEXCOORD1; + #endif + #if _STANDARD && (_USINGTEXCOORD2 || (_PASSMETA || ((_PASSFORWARD || _PASSGBUFFER) && DYNAMICLIGHTMAP_ON))) + float4 texcoord2 : TEXCOORD2; + #endif + + + #if _HDRP + float4 texcoord1 : TEXCOORD1; + float4 texcoord2 : TEXCOORD2; + #endif + + // #if %TEXCOORD3REQUIREKEY% + float4 texcoord3 : TEXCOORD3; + // #endif + + // #if %VERTEXCOLORREQUIREKEY% + float4 vertexColor : COLOR; + // #endif + + #if _PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR)) + float3 previousPositionOS : TEXCOORD4; // Contain previous transform position (in case of skinning for example) + #if defined (_ADD_PRECOMPUTED_VELOCITY) + float3 precomputedVelocity : TEXCOORD5; // Add Precomputed Velocity (Alembic computes velocities on runtime side). + #endif + #endif + + UNITY_VERTEX_INPUT_INSTANCE_ID + }; + + struct TessVertex + { + float4 vertex : INTERNALTESSPOS; + float3 normal : NORMAL; + float4 tangent : TANGENT; + float4 texcoord0 : TEXCOORD0; + float4 texcoord1 : TEXCOORD1; + float4 texcoord2 : TEXCOORD2; + + // #if %TEXCOORD3REQUIREKEY% + float4 texcoord3 : TEXCOORD3; + // #endif + + // #if %VERTEXCOLORREQUIREKEY% + float4 vertexColor : COLOR; + // #endif + + // #if %EXTRAV2F0REQUIREKEY% + // float4 extraV2F0 : TEXCOORD5; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // float4 extraV2F1 : TEXCOORD6; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // float4 extraV2F2 : TEXCOORD7; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // float4 extraV2F3 : TEXCOORD8; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // float4 extraV2F4 : TEXCOORD9; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // float4 extraV2F5 : TEXCOORD10; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // float4 extraV2F6 : TEXCOORD11; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // float4 extraV2F7 : TEXCOORD12; + // #endif + + #if _PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR)) + float3 previousPositionOS : TEXCOORD13; // Contain previous transform position (in case of skinning for example) + #if defined (_ADD_PRECOMPUTED_VELOCITY) + float3 precomputedVelocity : TEXCOORD14; + #endif + #endif + + UNITY_VERTEX_INPUT_INSTANCE_ID + UNITY_VERTEX_OUTPUT_STEREO + }; + + struct ExtraV2F + { + float4 extraV2F0; + float4 extraV2F1; + float4 extraV2F2; + float4 extraV2F3; + float4 extraV2F4; + float4 extraV2F5; + float4 extraV2F6; + float4 extraV2F7; + Blackboard blackboard; + float4 time; + }; + + + float3 WorldToTangentSpace(ShaderData d, float3 normal) + { + return mul(d.TBNMatrix, normal); + } + + float3 TangentToWorldSpace(ShaderData d, float3 normal) + { + return mul(normal, d.TBNMatrix); + } + + // in this case, make standard more like SRPs, because we can't fix + // unity_WorldToObject in HDRP, since it already does macro-fu there + + #if _STANDARD + float3 TransformWorldToObject(float3 p) { return mul(unity_WorldToObject, float4(p, 1)); }; + float3 TransformObjectToWorld(float3 p) { return mul(unity_ObjectToWorld, float4(p, 1)); }; + float4 TransformWorldToObject(float4 p) { return mul(unity_WorldToObject, p); }; + float4 TransformObjectToWorld(float4 p) { return mul(unity_ObjectToWorld, p); }; + float4x4 GetWorldToObjectMatrix() { return unity_WorldToObject; } + float4x4 GetObjectToWorldMatrix() { return unity_ObjectToWorld; } + #if (defined(SHADER_API_D3D11) || defined(SHADER_API_XBOXONE) || defined(UNITY_COMPILER_HLSLCC) || defined(SHADER_API_PSSL) || (SHADER_TARGET_SURFACE_ANALYSIS && !SHADER_TARGET_SURFACE_ANALYSIS_MOJOSHADER)) + #define UNITY_SAMPLE_TEX2D_LOD(tex,coord, lod) tex.SampleLevel (sampler##tex,coord, lod) + #define UNITY_SAMPLE_TEX2D_SAMPLER_LOD(tex,samplertex,coord, lod) tex.SampleLevel (sampler##samplertex,coord, lod) + #else + #define UNITY_SAMPLE_TEX2D_LOD(tex,coord,lod) tex2D (tex,coord,0,lod) + #define UNITY_SAMPLE_TEX2D_SAMPLER_LOD(tex,samplertex,coord,lod) tex2D (tex,coord,0,lod) + #endif + + #undef GetWorldToObjectMatrix() + + #define GetWorldToObjectMatrix() unity_WorldToObject + + + #endif + + float3 GetCameraWorldPosition() + { + #if _HDRP + return GetCameraRelativePositionWS(_WorldSpaceCameraPos); + #else + return _WorldSpaceCameraPos; + #endif + } + + #if _GRABPASSUSED + #if _STANDARD + TEXTURE2D(%GRABTEXTURE%); + SAMPLER(sampler_%GRABTEXTURE%); + #endif + + half3 GetSceneColor(float2 uv) + { + #if _STANDARD + return SAMPLE_TEXTURE2D(%GRABTEXTURE%, sampler_%GRABTEXTURE%, uv).rgb; + #else + return SHADERGRAPH_SAMPLE_SCENE_COLOR(uv); + #endif + } + #endif + + + + #if _STANDARD + UNITY_DECLARE_DEPTH_TEXTURE(_CameraDepthTexture); + float GetSceneDepth(float2 uv) { return SAMPLE_DEPTH_TEXTURE(_CameraDepthTexture, uv); } + float GetLinear01Depth(float2 uv) { return Linear01Depth(GetSceneDepth(uv)); } + float GetLinearEyeDepth(float2 uv) { return LinearEyeDepth(GetSceneDepth(uv)); } + #else + float GetSceneDepth(float2 uv) { return SHADERGRAPH_SAMPLE_SCENE_DEPTH(uv); } + float GetLinear01Depth(float2 uv) { return Linear01Depth(GetSceneDepth(uv), _ZBufferParams); } + float GetLinearEyeDepth(float2 uv) { return LinearEyeDepth(GetSceneDepth(uv), _ZBufferParams); } + #endif + + float3 GetWorldPositionFromDepthBuffer(float2 uv, float3 worldSpaceViewDir) + { + float eye = GetLinearEyeDepth(uv); + float3 camView = mul((float3x3)GetObjectToWorldMatrix(), transpose(mul(GetWorldToObjectMatrix(), UNITY_MATRIX_I_V)) [2].xyz); + + float dt = dot(worldSpaceViewDir, camView); + float3 div = worldSpaceViewDir/dt; + float3 wpos = (eye * div) + GetCameraWorldPosition(); + return wpos; + } + + #if _HDRP + float3 ObjectToWorldSpacePosition(float3 pos) + { + return GetAbsolutePositionWS(TransformObjectToWorld(pos)); + } + #else + float3 ObjectToWorldSpacePosition(float3 pos) + { + return TransformObjectToWorld(pos); + } + #endif + + #if _STANDARD + UNITY_DECLARE_SCREENSPACE_TEXTURE(_CameraDepthNormalsTexture); + float3 GetSceneNormal(float2 uv, float3 worldSpaceViewDir) + { + float4 depthNorms = UNITY_SAMPLE_SCREENSPACE_TEXTURE(_CameraDepthNormalsTexture, uv); + float3 norms = DecodeViewNormalStereo(depthNorms); + norms = mul((float3x3)GetWorldToViewMatrix(), norms) * 0.5 + 0.5; + return norms; + } + #elif _HDRP && !_DECALSHADER + + float3 GetSceneNormal(float2 uv, float3 worldSpaceViewDir) + { + NormalData nd; + DecodeFromNormalBuffer(_ScreenSize.xy * uv, nd); + return nd.normalWS; + } + #elif _URP + #if (SHADER_LIBRARY_VERSION_MAJOR >= 10) + #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/DeclareNormalsTexture.hlsl" + #endif + + float3 GetSceneNormal(float2 uv, float3 worldSpaceViewDir) + { + #if (SHADER_LIBRARY_VERSION_MAJOR >= 10) + return SampleSceneNormals(uv); + #else + float3 wpos = GetWorldPositionFromDepthBuffer(uv, worldSpaceViewDir); + return normalize(-cross(ddx(wpos), ddy(wpos))) * 0.5 + 0.5; + #endif + + } + #endif + + #if _HDRP + + half3 UnpackNormalmapRGorAG(half4 packednormal) + { + // This do the trick + packednormal.x *= packednormal.w; + + half3 normal; + normal.xy = packednormal.xy * 2 - 1; + normal.z = sqrt(1 - saturate(dot(normal.xy, normal.xy))); + return normal; + } + half3 UnpackNormal(half4 packednormal) + { + #if defined(UNITY_NO_DXT5nm) + return packednormal.xyz * 2 - 1; + #else + return UnpackNormalmapRGorAG(packednormal); + #endif + } + #endif + #if _HDRP || _URP + + half3 UnpackScaleNormal(half4 packednormal, half scale) + { + #ifndef UNITY_NO_DXT5nm + // Unpack normal as DXT5nm (1, y, 1, x) or BC5 (x, y, 0, 1) + // Note neutral texture like "bump" is (0, 0, 1, 1) to work with both plain RGB normal and DXT5nm/BC5 + packednormal.x *= packednormal.w; + #endif + half3 normal; + normal.xy = (packednormal.xy * 2 - 1) * scale; + normal.z = sqrt(1 - saturate(dot(normal.xy, normal.xy))); + return normal; + } + + #endif + + + void GetSun(out float3 lightDir, out float3 color) + { + lightDir = float3(0.5, 0.5, 0); + color = 1; + #if _HDRP + if (_DirectionalLightCount > 0) + { + DirectionalLightData light = _DirectionalLightDatas[0]; + lightDir = -light.forward.xyz; + color = light.color; + } + #elif _STANDARD + lightDir = normalize(_WorldSpaceLightPos0.xyz); + color = _LightColor0.rgb; + #elif _URP + Light light = GetMainLight(); + lightDir = light.direction; + color = light.color; + #endif + } + + + + CBUFFER_START(UnityPerMaterial) + + + half4 _Color; + half4 _MainTex_ST, _MainTex_TexelSize; + half _Alpha, _AlphaCutoffValue; + + #if ATLAS_ON + half _MinXUV, _MaxXUV, _MinYUV, _MaxYUV; + #endif + + #if GLOW_ON + half4 _GlowColor; + half _Glow, _GlowGlobal; + #endif + + #if HSV_ON + half _HsvShift, _HsvSaturation, _HsvBright; + #endif + + #if DISTORT_ON + half4 _DistortTex_ST; + half _DistortTexXSpeed, _DistortTexYSpeed, _DistortAmount; + #endif + + #if FADE_ON + half4 _FadeBurnColor, _FadeTex_ST, _FadeBurnTex_ST; + half _FadeAmount, _FadeBurnWidth, _FadeBurnTransition,_FadeBurnGlow; + #endif + + #if OUTBASE_ON + half4 _OutlineColor; + half _OutlineAlpha, _OutlineGlow, _OutlineWidth; + int _OutlinePixelWidth; + #endif + + #if OUTTEX_ON + half4 _OutlineTex_ST; + half _OutlineTexXSpeed, _OutlineTexYSpeed; + #endif + + #if OUTDIST_ON + half4 _OutlineDistortTex_ST; + half _OutlineDistortTexXSpeed, _OutlineDistortTexYSpeed, _OutlineDistortAmount; + #endif + + #if ALPHAOUTLINE_ON + half _AlphaOutlineGlow, _AlphaOutlinePower, _AlphaOutlineMinAlpha, _AlphaOutlineBlend; + half4 _AlphaOutlineColor; + #endif + + #if INNEROUTLINE_ON + half _InnerOutlineThickness, _InnerOutlineAlpha, _InnerOutlineGlow; + half4 _InnerOutlineColor; + #endif + + #if GRADIENT_ON + half _GradBlend, _GradBoostX, _GradBoostY; + half4 _GradTopRightCol, _GradTopLeftCol, _GradBotRightCol, _GradBotLeftCol; + #endif + + #if COLORSWAP_ON + half4 _ColorSwapRed, _ColorSwapGreen, _ColorSwapBlue; + half _ColorSwapRedLuminosity, _ColorSwapGreenLuminosity, _ColorSwapBlueLuminosity, _ColorSwapBlend; + #endif + + #if CHANGECOLOR_ON + half4 _ColorChangeNewCol, _ColorChangeTarget; + half _ColorChangeTolerance, _ColorChangeLuminosity; + #endif + #if CHANGECOLOR2_ON + half4 _ColorChangeNewCol2, _ColorChangeTarget2; + half _ColorChangeTolerance2; + #endif + #if CHANGECOLOR3_ON + half4 _ColorChangeNewCol3, _ColorChangeTarget3; + half _ColorChangeTolerance3; + #endif + + #if COLORRAMP_ON + half _ColorRampLuminosity, _ColorRampBlend; + #endif + + #if HITEFFECT_ON + half4 _HitEffectColor; + half _HitEffectGlow, _HitEffectBlend; + #endif + + #if NEGATIVE_ON + half _NegativeAmount; + #endif + + #if PIXELATE_ON + half _PixelateSize; + #endif + + #if GREYSCALE_ON + half _GreyscaleLuminosity, _GreyscaleBlend; + half4 _GreyscaleTintColor; + #endif + + #if POSTERIZE_ON + half _PosterizeNumColors, _PosterizeGamma; + #endif + + #if BLUR_ON + half _BlurIntensity; + #endif + + #if MOTIONBLUR_ON + half _MotionBlurAngle, _MotionBlurDist; + #endif + + #if GHOST_ON + half _GhostColorBoost, _GhostTransparency, _GhostBlend; + #endif + + #if HOLOGRAM_ON + half _HologramStripesAmount, _HologramMinAlpha, _HologramUnmodAmount, _HologramStripesSpeed, _HologramMaxAlpha, _HologramBlend; + half4 _HologramStripeColor; + #endif + + #if CHROMABERR_ON + half _ChromAberrAmount, _ChromAberrAlpha; + #endif + + #if GLITCH_ON + half _GlitchAmount, _GlitchSize; + #endif + + #if FLICKER_ON + half _FlickerFreq, _FlickerPercent, _FlickerAlpha; + #endif + + #if SHADOW_ON + half _ShadowX, _ShadowY, _ShadowAlpha; + half4 _ShadowColor; + #endif + + #if SHINE_ON + half4 _ShineColor; + half _ShineLocation, _ShineRotate, _ShineWidth, _ShineGlow; + #endif + + #if CONTRAST_ON + half _Contrast, _Brightness; + #endif + + #if OVERLAY_ON + half4 _OverlayTex_ST, _OverlayColor; + half _OverlayGlow, _OverlayBlend, _OverlayTextureScrollXSpeed, _OverlayTextureScrollYSpeed; + #endif + + #if DOODLE_ON + half _HandDrawnAmount, _HandDrawnSpeed; + #endif + + #if WIND_ON + half _GrassSpeed, _GrassWind, _GrassManualAnim, _GrassRadialBend; + #endif + + #if WAVEUV_ON + float _WaveAmount, _WaveSpeed, _WaveStrength, _WaveX, _WaveY; + #endif + + #if ROUNDWAVEUV_ON + half _RoundWaveStrength, _RoundWaveSpeed; + #endif + + #if RECTSIZE_ON + half _RectSize; + #endif + + #if OFFSETUV_ON + half _OffsetUvX, _OffsetUvY; + #endif + + #if CLIPPING_ON + half _ClipUvLeft, _ClipUvRight, _ClipUvUp, _ClipUvDown; + #endif + + #if RADIALCLIPPING_ON + half _RadialStartAngle, _RadialClip, _RadialClip2; + #endif + + #if TEXTURESCROLL_ON + half _TextureScrollXSpeed, _TextureScrollYSpeed; + #endif + + #if ZOOMUV_ON + half _ZoomUvAmount; + #endif + + #if WARP_ON + half _WarpStrength, _WarpSpeed, _WarpScale; + #endif + + #if TWISTUV_ON + half _TwistUvAmount, _TwistUvPosX, _TwistUvPosY, _TwistUvRadius; + #endif + + #if ROTATEUV_ON + half _RotateUvAmount; + #endif + + #if FISHEYE_ON + half _FishEyeUvAmount; + #endif + + #if PINCH_ON + half _PinchUvAmount; + #endif + + #if SHAKEUV_ON + half _ShakeUvSpeed, _ShakeUvX, _ShakeUvY; + #endif + + #if NORMALMAP_ON + half _NormalStrength; + #endif + + float _RandomSeed; + + + + + CBUFFER_END + + + + + + + + TEXTURE2D(_MainTex); + SAMPLER(sampler_MainTex); + + #if GLOW_ON + TEXTURE2D(_GlowTex); + SAMPLER(sampler_GlowTex); + #endif + + #if FADE_ON + TEXTURE2D(_FadeTex); + SAMPLER(sampler_FadeTex); + + TEXTURE2D(_FadeBurnTex); + SAMPLER(sampler_FadeBurnTex); + #endif + + #if DISTORT_ON + TEXTURE2D(_DistortTex); + SAMPLER(sampler_DistortTex); + #endif + + #if OUTTEX_ON + TEXTURE2D(_OutlineTex); + SAMPLER(sampler_OutlineTex); + #endif + + #if OUTDIST_ON + TEXTURE2D(_OutlineDistortTex); + SAMPLER(sampler_OutlineDistortTex); + #endif + + #if COLORSWAP_ON + TEXTURE2D(_ColorSwapTex); + SAMPLER(sampler_ColorSwapTex); + #endif + + #if COLORRAMP_ON + TEXTURE2D(_ColorRampTex); + TEXTURE2D(_ColorRampTexGradient); + SAMPLER(sampler_ColorRampTex); + SAMPLER(sampler_ColorRampTexGradient); + #endif + + #if SHINE_ON + TEXTURE2D(_ShineMask); + SAMPLER(sampler_ShineMask); + #endif + + #if OVERLAY_ON + TEXTURE2D(_OverlayTex); + SAMPLER(sampler_OverlayTex); + #endif + + #if NORMALMAP_ON + TEXTURE2D(_NormalMap); + SAMPLER(sampler_NormalMap); + #endif + + + half3 GetPixel(in int offsetX, in int offsetY, in half2 uv, in Texture2D _tex, in SamplerState _sampler) + { + half2 _uv = uv + half2(offsetX * _MainTex_TexelSize.x, offsetY * _MainTex_TexelSize.y); + half4 col = SAMPLE_TEXTURE2D(_tex, _sampler, _uv); + return col.rgb; + } + + + //BLURS------------------------------------------------------------------------- + half4 Blur(half2 uv, Texture2D source, SamplerState sampler_source, half Intensity) + { + const half2 texelSize = 1.0 / _ScreenParams.xy; + const half4 color = SAMPLE_TEXTURE2D(source, sampler_source, uv); + const half2 offset = Intensity * texelSize; + + half4 accumulatedColor = color; + half accumulatedWeight = 1.0; + for (int x = -1; x <= 1; x++) + { + for (int y = -1; y <= 1; y++) + { + const half2 sampleUV = uv + half2(x, y) * offset; + const half4 sampleColor = SAMPLE_TEXTURE2D(source, sampler_source, sampleUV); + + accumulatedColor += sampleColor; + accumulatedWeight += 1.0; + } + } + + half4 blurredColor = accumulatedColor / accumulatedWeight; + return blurredColor; + } + + half BlurHD_G(half bhqp, half x) + { + return exp(-(x * x) / (2.0 * bhqp * bhqp)); + } + half4 BlurHD(half2 uv, Texture2D source, SamplerState sampler_source, half BlurAmount, half xScale, half yScale) + { + int iterations = 16; + int halfIterations = iterations / 2; + half sigmaX = 0.1 + BlurAmount * 0.5; + half sigmaY = sigmaX; + half total = 0.0; + half4 ret = half4(0, 0, 0, 0); + for (int iy = 0; iy < iterations; ++iy) + { + half fy = BlurHD_G(sigmaY, half(iy) -half(halfIterations)); + half offsetY = half(iy - halfIterations) * 0.00390625 * xScale; + for (int ix = 0; ix < iterations; ++ix) + { + half fx = BlurHD_G(sigmaX, half(ix) - half(halfIterations)); + half offsetX = half(ix - halfIterations) * 0.00390625 * yScale; + total += fx * fy; + ret += SAMPLE_TEXTURE2D(source, sampler_source, uv + half2(offsetX, offsetY)) * fx * fy; + } + } + return ret / total; + } + //----------------------------------------------------------------------- + + + //------------------------------------------- + half RemapFloat(half inValue, half inMin, half inMax, half outMin, half outMax){ + return outMin + (inValue - inMin) * (outMax - outMin) / (inMax - inMin); + } + //------------------------------------------- + + //----------------------------------------------------------------------- + half rand(half2 seed, half offset) { + return (frac(sin(dot(seed, half2(12.9898, 78.233))) * 43758.5453) + offset) % 1.0; + } + + half rand2(half2 seed, half offset) { + return (frac(sin(dot(seed * floor(50 + (_Time.x % 1.0) * 12.), half2(127.1, 311.7))) * 43758.5453123) + offset) % 1.0; + } + + half rand2CustomTime(half2 seed, half offset, half customTime) { + return (frac(sin(dot(seed * floor(50 + (customTime % 1.0) * 12.), half2(127.1, 311.7))) * 43758.5453123) + offset) % 1.0; + } + //----------------------------------------------------------------------- + + + void Ext_ModifyVertex0 (inout VertexData v, inout ExtraV2F d) + { + //BILBOARD_ON + #if BILBOARD_ON + half3 camRight = mul((half3x3)unity_CameraToWorld, half3(1,0,0)); + half3 camUp = half3(0,1,0); + #if BILBOARDY_ON + camUp = mul((half3x3)unity_CameraToWorld, half3(0,1,0)); + #endif + half3 localPos = v.vertex.x * camRight + v.vertex.y * camUp; + v.vertex = half4(localPos, 1); + #endif + //----------------------------------------------------------- + + v.texcoord0.xy = TRANSFORM_TEX(v.texcoord0.xy, _MainTex); + half2 center = half2(0.5, 0.5); + #if ATLAS_ON + center = half2((_MaxXUV + _MinXUV) / 2.0, (_MaxYUV + _MinYUV) / 2.0); + #endif + + //POLARUV_ON + #if POLARUV_ON + v.texcoord0.xy = v.texcoord0.xy - center; + #endif + + //---------------------------------------- + + //ROTATEUV_ON + #if ROTATEUV_ON + half2 uvC = v.texcoord0.xy; + half cosAngle = cos(_RotateUvAmount); + half sinAngle = sin(_RotateUvAmount); + half2x2 rot = half2x2(cosAngle, -sinAngle, sinAngle, cosAngle); + uvC -= center; + v.texcoord0.xy = mul(rot, uvC); + v.texcoord0.xy += center; + #endif + //-------------------- + + #if RECTSIZE_ON + v.vertex.xyz += (v.vertex.xyz * (_RectSize - 1.0)); + #endif + + #if OUTTEX_ON + v.texcoord1.xy = TRANSFORM_TEX(v.texcoord0.xy, _OutlineTex); + #endif + + #if OUTDIST_ON + v.texcoord2.xy = TRANSFORM_TEX(v.texcoord0.xy, _OutlineDistortTex); + #endif + + #if DISTORT_ON + v.texcoord3.xy = TRANSFORM_TEX(v.texcoord0.xy, _DistortTex); + #endif + } + + void Ext_SurfaceFunction0 (inout Surface o, ShaderData d) + { + half randomSeed = _RandomSeed; + + float2 uvRect = d.texcoord0; + half2 center = half2(0.5, 0.5); + #if ATLAS_ON + center = half2((_MaxXUV + _MinXUV) / 2.0, (_MaxYUV + _MinYUV) / 2.0); + uvRect = half2((d.texcoord0.x - _MinXUV) / (_MaxXUV - _MinXUV), (d.texcoord0.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half2 centerTiled = half2(center.x * _MainTex_ST.x, center.y * _MainTex_ST.y); + + //CLIPPING_ON + #if CLIPPING_ON + half2 tiledUv = half2(d.texcoord0.x / _MainTex_ST.x, d.texcoord0.y / _MainTex_ST.y); + #if ATLAS_ON + tiledUv = half2((tiledUv.x - _MinXUV) / (_MaxXUV - _MinXUV), (tiledUv.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + clip((1 - _ClipUvUp) - tiledUv.y); + clip(tiledUv.y - _ClipUvDown); + clip((1 - _ClipUvRight) - tiledUv.x); + clip(tiledUv.x - _ClipUvLeft); + #endif + //---------------------------------- + + //RADIALCLIPPING_ON + #if RADIALCLIPPING_ON + half2 tiledUv2 = half2(d.texcoord0.x / _MainTex_ST.x, d.texcoord0.y / _MainTex_ST.y); + #if ATLAS_ON + tiledUv2 = half2((tiledUv2.x - _MinXUV) / (_MaxXUV - _MinXUV), (tiledUv2.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half startAngle = _RadialStartAngle - _RadialClip; + half endAngle = _RadialStartAngle + _RadialClip2; + half offset0 = clamp(0, 360, startAngle + 360); + half offset360 = clamp(0, 360, endAngle - 360); + half2 atan2Coord = half2(lerp(-1, 1, tiledUv2.x), lerp(-1, 1, tiledUv2.y)); + half atanAngle = atan2(atan2Coord.y, atan2Coord.x) * 57.3; // angle in degrees + if(atanAngle < 0) atanAngle = 360 + atanAngle; + if(atanAngle >= startAngle && atanAngle <= endAngle) discard; + if(atanAngle <= offset360) discard; + if(atanAngle >= offset0) discard; + #endif + + //----------------------------- + + //TEXTURESCROLL_ON && ATLAS_ON + #if TEXTURESCROLL_ON && ATLAS_ON + d.texcoord0.xy = half2(_MinXUV + ((_MaxXUV - _MinXUV) * (abs(((_Time.y + randomSeed) * _TextureScrollXSpeed) + uvRect.x) % 1)), + _MinYUV + ((_MaxYUV - _MinYUV) * (abs(((_Time.y + randomSeed) * _TextureScrollYSpeed) + uvRect.y) % 1))); + #endif + //---------------------------- + + //OFFSETUV_ON + #if OFFSETUV_ON + #if ATLAS_ON + d.texcoord0.xy = half2(_MinXUV + ((_MaxXUV - _MinXUV) * (abs((_OffsetUvX + uvRect.x) % 1))), + _MinYUV + ((_MaxYUV - _MinYUV) * (abs(_OffsetUvY + uvRect.y) % 1))); + #else + d.texcoord0.xy += half2(_OffsetUvX, _OffsetUvY); + #endif + #endif + + //---------------------- + + //POLARUV_ON + #if POLARUV_ON + d.texcoord0.xy = half2(atan2(d.texcoord0.y, d.texcoord0.x) / (2.0f * 3.141592653589f), length(d.texcoord0.xy)); + d.texcoord0.xy *= _MainTex_ST.xy; + #endif + + //-------------------------------------- + + //TWISTUV_ON + #if TWISTUV_ON + #if ATLAS_ON + _TwistUvPosX = ((_MaxXUV - _MinXUV) * _TwistUvPosX) + _MinXUV; + _TwistUvPosY = ((_MaxYUV - _MinYUV) * _TwistUvPosY) + _MinYUV; + #endif + half2 tempUv = d.texcoord0.xy - half2(_TwistUvPosX * _MainTex_ST.x, _TwistUvPosY * _MainTex_ST.y); + _TwistUvRadius *= (_MainTex_ST.x + _MainTex_ST.y) / 2; + half percent = (_TwistUvRadius - length(tempUv)) / _TwistUvRadius; + half theta = percent * percent * (2.0 * sin(_TwistUvAmount)) * 8.0; + half s = sin(theta); + half c = cos(theta); + half beta = max(sign(_TwistUvRadius - length(tempUv)), 0.0); + tempUv = half2(dot(tempUv, half2(c, -s)), dot(tempUv, half2(s, c))) * beta + tempUv * (1 - beta); + tempUv += half2(_TwistUvPosX * _MainTex_ST.x, _TwistUvPosY * _MainTex_ST.y); + d.texcoord0.xy = tempUv; + #endif + + //-------------------------------------------- + + //FISHEYE_ON + #if FISHEYE_ON + half bind = length(centerTiled); + half2 dF = d.texcoord0.xy - centerTiled; + half dFlen = length(dF); + half fishInt = (3.14159265359 / bind) * (_FishEyeUvAmount + 0.001); + d.texcoord0.xy = centerTiled + (dF / (max(0.0001, dFlen))) * tan(dFlen * fishInt) * bind / tan(bind * fishInt); + #endif + //--------------------------------------------- + + //PINCH_ON + #if PINCH_ON + half2 dP = d.texcoord0.xy - centerTiled; + half pinchInt = (3.141592 / length(centerTiled)) * (-_PinchUvAmount + 0.001); + d.texcoord0.xy = centerTiled + normalize(dP) * atan(length(dP) * -pinchInt * 10.0) * 0.5 / atan(-pinchInt * 5); + #endif + + //--------------------------------------------- + + //ZOOMUV_ON + #if ZOOMUV_ON + d.texcoord0.xy -= centerTiled; + d.texcoord0.xy = d.texcoord0.xy * _ZoomUvAmount; + d.texcoord0.xy += centerTiled; + #endif + + //----------------------------------------------- + + //DOODLE_ON + #if DOODLE_ON + half2 uvCopy = uvRect; + _HandDrawnSpeed = (floor((_Time.x + randomSeed) * 20 * _HandDrawnSpeed) / _HandDrawnSpeed) * _HandDrawnSpeed; + uvCopy.x = sin((uvCopy.x * _HandDrawnAmount + _HandDrawnSpeed) * 4); + uvCopy.y = cos((uvCopy.y * _HandDrawnAmount + _HandDrawnSpeed) * 4); + d.texcoord0.xy = lerp(d.texcoord0.xy, d.texcoord0.xy + uvCopy, 0.0005 * _HandDrawnAmount); + #endif + + //-------------------------- + + //SHAKEUV_ON + #if SHAKEUV_ON + half xShake = sin((_Time.x + randomSeed) * _ShakeUvSpeed * 50) * _ShakeUvX; + half yShake = cos((_Time.x + randomSeed) * _ShakeUvSpeed * 50) * _ShakeUvY; + d.texcoord0.xy += half2(xShake * 0.012, yShake * 0.01); + #endif + + //------------------------------------------- + + //RECTSIZE_ON + #if RECTSIZE_ON + d.texcoord0.xy = d.texcoord0.xy * (_RectSize).xx + (((-_RectSize * 0.5) + 0.5)).xx; + #endif + + //------------------------------------------- + + //DISTORT_ON + #if DISTORT_ON + #if ATLAS_ON + d.texcoord3.x = d.texcoord3.x * (1 / (_MaxXUV - _MinXUV)); + d.texcoord3.y = d.texcoord3.y * (1 / (_MaxYUV - _MinYUV)); + #endif + + d.texcoord3.x += ((_Time.x + _RandomSeed) * _DistortTexXSpeed) % 1; + d.texcoord3.y += ((_Time.x + _RandomSeed) * _DistortTexYSpeed) % 1; + half distortAmnt = (SAMPLE_TEXTURE2D(_DistortTex, sampler_DistortTex, d.texcoord3.xy).r - 0.5) * 0.2 * _DistortAmount; + d.texcoord0.x += distortAmnt; + d.texcoord0.y += distortAmnt; + #endif + //------------------------------------------------------- + + //WARP_ON + #if WARP_ON + half2 warpUv = half2(d.texcoord0.x / _MainTex_ST.x, d.texcoord0.y / _MainTex_ST.y); + #if ATLAS_ON + warpUv = half2((warpUv.x - _MinXUV) / (_MaxXUV - _MinXUV), (warpUv.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + const float tau = 6.283185307179586; + float xWarp = (_Time.y + randomSeed) * _WarpSpeed + warpUv.x * tau / _WarpScale; + float yWarp = (_Time.y + randomSeed) * _WarpSpeed + warpUv.y * tau / _WarpScale; + float2 warp = float2(sin(xWarp), sin(yWarp)) * _WarpStrength; + d.texcoord0.xy += warp; + #endif + + //------------------------------------------------------- + + //WAVEUV_ON + #if WAVEUV_ON + float2 uvWave = half2(_WaveX * _MainTex_ST.x, _WaveY * _MainTex_ST.y) - d.texcoord0.xy; + uvWave %= 1; + #if ATLAS_ON + uvWave = half2(_WaveX, _WaveY) - uvRect; + #endif + uvWave.x *= _ScreenParams.x / _ScreenParams.y; + float waveTime = _Time.y + randomSeed; + float angWave = (sqrt(dot(uvWave, uvWave)) * _WaveAmount) - ((waveTime * _WaveSpeed)); + d.texcoord0.xy = d.texcoord0.xy + uvWave * sin(angWave) * (_WaveStrength / 1000.0); + #endif + //---------------------------------------------------- + + //ROUNDWAVEUV_ON + #if ROUNDWAVEUV_ON + half xWave = ((0.5 * _MainTex_ST.x) - uvRect.x); + half yWave = ((0.5 * _MainTex_ST.y) - uvRect.y) * (_MainTex_TexelSize.w / _MainTex_TexelSize.z); + half ripple = -sqrt(xWave*xWave + yWave* yWave); + d.texcoord0.xy += (sin((ripple + (_Time.y + randomSeed) * (_RoundWaveSpeed/10.0)) / 0.015) * (_RoundWaveStrength/10.0)) % 1; + #endif + //---------------------------------------------------- + + + //WIND_ON + #if WIND_ON + half windOffset = sin((_Time.x + randomSeed) * _GrassSpeed * 10); + half2 windCenter = half2(0.5, 0.1); + #if ATLAS_ON + windCenter.x = ((_MaxXUV - _MinXUV) * windCenter.x) + _MinXUV; + windCenter.y = ((_MaxYUV - _MinYUV) * windCenter.y) + _MinYUV; + #endif + #if !MANUALWIND_ON + d.texcoord0.x = fmod(abs(lerp(d.texcoord0.x, d.texcoord0.x + (_GrassWind * 0.01 * windOffset), uvRect.y)), 1); + #else + d.texcoord0.x = fmod(abs(lerp(d.texcoord0.x, d.texcoord0.x + (_GrassWind * 0.01 * _GrassManualAnim), uvRect.y)), 1); + windOffset = _GrassManualAnim; + #endif + half2 delta = d.texcoord0.xy - windCenter; + half delta2 = dot(delta.xy, delta.xy); + half2 delta_offset = delta2 * windOffset; + d.texcoord0.xy = d.texcoord0.xy + half2(delta.y, -delta.x) * delta_offset * _GrassRadialBend; + #endif + + //-------------------------------------------------------- + + //TEXTURESCROLL_ON && !ATLAS_ON + #if TEXTURESCROLL_ON && !ATLAS_ON + d.texcoord0.x += ((_Time.y + randomSeed) * _TextureScrollXSpeed) % 1; + d.texcoord0.y += ((_Time.y + randomSeed) * _TextureScrollYSpeed) % 1; + #endif + //------------------------------ + + //PIXELATE_ON + #if PIXELATE_ON + half aspectRatio = _MainTex_TexelSize.x / _MainTex_TexelSize.y; + half2 pixelSize = float2(_PixelateSize, _PixelateSize * aspectRatio); + d.texcoord0.xy = floor(d.texcoord0.xy * pixelSize) / pixelSize; + #endif + //-------------- + + half4 col = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy); + half originalAlpha = col.a; + col *= d.vertexColor; + + //NORMAL MAP + #if NORMALMAP_ON + half4 normalSample = SAMPLE_TEXTURE2D(_NormalMap, sampler_NormalMap, d.texcoord0.xy); + half3 normalTS = UnpackNormal(normalSample); + normalTS.xy *= _NormalStrength; + o.Normal = normalTS; + #endif + + + //GLITCH_ON + #if GLITCH_ON + half2 uvGlitch = uvRect; + uvGlitch.y -= 0.5; + half lineNoise = pow(rand2(floor(uvGlitch * half2(24., 19.) * _GlitchSize) * 4.0, randomSeed), 3.0) * _GlitchAmount + * pow(rand2(floor(uvGlitch * half2(38., 14.) * _GlitchSize) * 4.0, randomSeed), 3.0); + col = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(lineNoise * 0.02 * rand2(half2(2.0, 1), randomSeed), 0)) * d.vertexColor; + #endif + //-------------------------------------- + + //CHROMABERR_ON + #if CHROMABERR_ON + half4 r = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(_ChromAberrAmount/10, 0)) * d.vertexColor; + half4 b = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(-_ChromAberrAmount/10, 0)) * d.vertexColor; + col = half4(r.r * r.a, col.g, b.b * b.a, max(max(r.a, b.a) * _ChromAberrAlpha, col.a)); + #endif + + //-------------------------------- + + //BLUR_ON + #if BLUR_ON + #if ATLAS_ON + #if !BLURISHD_ON + col = BlurHD(d.texcoord0.xy, _MainTex, sampler_MainTex, _BlurIntensity, (_MaxXUV - _MinXUV), (_MaxYUV - _MinYUV)) * d.vertexColor; + #else + col = Blur(d.texcoord0.xy, _MainTex, sampler_MainTex, _BlurIntensity * (_MaxXUV - _MinXUV)) * d.vertexColor; + #endif + #else + #if !BLURISHD_ON + col = BlurHD(d.texcoord0.xy, _MainTex, sampler_MainTex, _BlurIntensity, 1, 1) * d.vertexColor; + #else + col = Blur(d.texcoord0.xy, _MainTex, sampler_MainTex, _BlurIntensity) * d.vertexColor; + #endif + #endif + #endif + + //-------------------- + + //MOTIONBLUR_ON + #if MOTIONBLUR_ON + _MotionBlurAngle = _MotionBlurAngle * 3.1415926; + #define rot(n) mul(n, half2x2(cos(_MotionBlurAngle), -sin(_MotionBlurAngle), sin(_MotionBlurAngle), cos(_MotionBlurAngle))) + _MotionBlurDist = _MotionBlurDist * 0.005; + #if ATLAS_ON + _MotionBlurDist *= (_MaxXUV - _MinXUV); + #endif + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(-_MotionBlurDist, -_MotionBlurDist))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(-_MotionBlurDist * 2, -_MotionBlurDist * 2))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(-_MotionBlurDist * 3, -_MotionBlurDist * 3))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(-_MotionBlurDist * 4, -_MotionBlurDist * 4))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(_MotionBlurDist, _MotionBlurDist))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(_MotionBlurDist * 2, _MotionBlurDist * 2))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(_MotionBlurDist * 3, _MotionBlurDist * 3))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(_MotionBlurDist * 4, _MotionBlurDist * 4))); + col.rgb = col.rgb / 9; + #endif + //------------------------------------ + + //NEGATIVE_ON + #if NEGATIVE_ON + col.rgb = lerp(col.rgb, 1 - col.rgb, _NegativeAmount); + #endif + + //-------------- + half luminance = 0; + + //GREYSCALE_ON && !GREYSCALEOUTLINE_ON + #if GREYSCALE_ON && !GREYSCALEOUTLINE_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + luminance = saturate(luminance + _GreyscaleLuminosity); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _GreyscaleTintColor, _GreyscaleBlend); + #endif + //------------------------------------ + + //GHOST_ON + #if GHOST_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + half4 ghostResult; + ghostResult.a = saturate(luminance - _GhostTransparency) * col.a; + ghostResult.rgb = col.rgb * (luminance + _GhostColorBoost); + col = lerp(col, ghostResult, _GhostBlend); + #endif + //------------------------------------ + + //INNEROUTLINE_ON + #if INNEROUTLINE_ON + half3 innerT = abs(GetPixel(0, _InnerOutlineThickness, d.texcoord0.xy, _MainTex, sampler_MainTex) - GetPixel(0, -_InnerOutlineThickness, d.texcoord0.xy, _MainTex, sampler_MainTex)); + innerT += abs(GetPixel(_InnerOutlineThickness, 0, d.texcoord0.xy, _MainTex, sampler_MainTex) - GetPixel(-_InnerOutlineThickness, 0, d.texcoord0.xy, _MainTex, sampler_MainTex)); + #if !ONLYINNEROUTLINE_ON + innerT = (innerT / 2.0) * col.a * _InnerOutlineAlpha; + col.rgb += length(innerT) * _InnerOutlineColor.rgb * _InnerOutlineGlow; + #else + innerT *= col.a * _InnerOutlineAlpha; + col.rgb = length(innerT) * _InnerOutlineColor.rgb * _InnerOutlineGlow; + col.a = step(0.3, col.r+col.g+col.b); + #endif + #endif + //------------------------------------------------------- + + //HITEFFECT_ON + #if HITEFFECT_ON + col.rgb = lerp(col.rgb, _HitEffectColor.rgb * _HitEffectGlow, _HitEffectBlend); + #endif + //-------------------- + + //GRADIENT_ON + #if GRADIENT_ON + half2 tiledUvGrad = half2(uvRect.x / _MainTex_ST.x, uvRect.y / _MainTex_ST.y); + #if GRADIENT2COL_ON + _GradTopRightCol = _GradTopLeftCol; + _GradBotRightCol = _GradBotLeftCol; + #endif + #if RADIALGRADIENT_ON + half radialDist = 1 - length(tiledUvGrad - half2(0.5, 0.5)); + radialDist *= (_MainTex_TexelSize.w / _MainTex_TexelSize.z); + radialDist = saturate(_GradBoostX * radialDist); + half4 gradientResult = lerp(_GradTopLeftCol, _GradBotLeftCol, radialDist); + #else + half gradXLerpFactor = saturate(pow(tiledUvGrad.x, _GradBoostX)); + half4 gradientResult = lerp(lerp(_GradBotLeftCol, _GradBotRightCol, gradXLerpFactor), + lerp(_GradTopLeftCol, _GradTopRightCol, gradXLerpFactor), saturate(pow(tiledUvGrad.y, _GradBoostY))); + #endif + gradientResult = lerp(col, gradientResult, _GradBlend); + col.rgb = gradientResult.rgb * col.a; + col.a *= gradientResult.a; + #endif + //-------------------------------------------------------------------- + + //CONTRAST_ON + #if CONTRAST_ON + col.rgb = (col.rgb - float3(0.5, 0.5, 0.5)) * _Contrast + float3(0.5, 0.5, 0.5); + col.rgb += _Brightness; + #endif + + //------------------------------------------------------------------- + + //COLORSWAP_ON + #if COLORSWAP_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + half4 swapMask = SAMPLE_TEXTURE2D(_ColorSwapTex, sampler_ColorSwapTex, d.texcoord0.xy); + swapMask.rgb *= swapMask.a; + half3 redSwap = _ColorSwapRed * swapMask.r * saturate(luminance + _ColorSwapRedLuminosity); + half3 greenSwap = _ColorSwapGreen * swapMask.g * saturate(luminance + _ColorSwapGreenLuminosity); + half3 blueSwap = _ColorSwapBlue * swapMask.b * saturate(luminance + _ColorSwapBlueLuminosity); + swapMask.rgb = col.rgb * saturate(1 - swapMask.r - swapMask.g - swapMask.b); + col.rgb = lerp(col.rgb, swapMask.rgb + redSwap + greenSwap + blueSwap, _ColorSwapBlend); + #endif + //-------------------------------------------------------------------- + + //COLORRAMP_ON && !COLORRAMPOUTLINE_ON + #if COLORRAMP_ON && !COLORRAMPOUTLINE_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + luminance = saturate(luminance + _ColorRampLuminosity); + #if GRADIENTCOLORRAMP_ON + col.rgb = lerp(col.rgb, SAMPLE_TEXTURE2D(_ColorRampTexGradient, sampler_ColorRampTexGradient, half2(luminance, 0)).rgb, _ColorRampBlend); + #else + col.rgb = lerp(col.rgb, SAMPLE_TEXTURE2D(_ColorRampTex, sampler_ColorRampTex, half2(luminance, 0)).rgb, _ColorRampBlend); + #endif + #endif + //-------------------------------------------------------------------- + + //CHANGECOLOR_ON + #if CHANGECOLOR_ON + float3 currChangeColor = saturate(col.rgb); + luminance = 0.3 * currChangeColor.r + 0.59 * currChangeColor.g + 0.11 * currChangeColor.b; + luminance = saturate(luminance + _ColorChangeLuminosity); + half3 dif = abs(currChangeColor - _ColorChangeTarget.rgb); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _ColorChangeNewCol.rgb, + max(sign(1 - saturate(dif.x + dif.y + dif.z) - _ColorChangeTolerance), 0.0)); + #if CHANGECOLOR2_ON + dif = abs(currChangeColor - _ColorChangeTarget2.rgb); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _ColorChangeNewCol2.rgb, + max(sign(1 - saturate(dif.x + dif.y + dif.z) - _ColorChangeTolerance2), 0.0)); + #endif + #if CHANGECOLOR3_ON + dif = abs(currChangeColor - _ColorChangeTarget3.rgb); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _ColorChangeNewCol3.rgb, + max(sign(1 - saturate(dif.x + dif.y + dif.z) - _ColorChangeTolerance3), 0.0)); + #endif + #endif + //------------------------------------------------------- + + //POSTERIZE_ON && !POSTERIZEOUTLINE_ON + #if POSTERIZE_ON && !POSTERIZEOUTLINE_ON + col.rgb = pow(col.rgb, _PosterizeGamma) * _PosterizeNumColors; + col.rgb = floor(col.rgb) / _PosterizeNumColors; + col.rgb = pow(col.rgb, 1.0 / _PosterizeGamma); + #endif + //------------------------------------ + + //HSV_ON + #if HSV_ON + half3 resultHsv = half3(col.rgb); + half cosHsv = _HsvBright * _HsvSaturation * cos(_HsvShift * 3.14159265 / 180); + half sinHsv = _HsvBright * _HsvSaturation * sin(_HsvShift * 3.14159265 / 180); + resultHsv.x = (.299 * _HsvBright + .701 * cosHsv + .168 * sinHsv) * col.x + + (.587 * _HsvBright - .587 * cosHsv + .330 * sinHsv) * col.y + + (.114 * _HsvBright - .114 * cosHsv - .497 * sinHsv) * col.z; + resultHsv.y = (.299 * _HsvBright - .299 * cosHsv - .328 * sinHsv) *col.x + + (.587 * _HsvBright + .413 * cosHsv + .035 * sinHsv) * col.y + + (.114 * _HsvBright - .114 * cosHsv + .292 * sinHsv) * col.z; + resultHsv.z = (.299 * _HsvBright - .3 * cosHsv + 1.25 * sinHsv) * col.x + + (.587 * _HsvBright - .588 * cosHsv - 1.05 * sinHsv) * col.y + + (.114 * _HsvBright + .886 * cosHsv - .203 * sinHsv) * col.z; + col.rgb = resultHsv; + #endif + //------------------------------------------------------- + + //OVERLAY_ON + #if OVERLAY_ON + half2 overlayUvs = d.texcoord0.xy; + overlayUvs.x += ((_Time.y + randomSeed) * _OverlayTextureScrollXSpeed) % 1; + overlayUvs.y += ((_Time.y + randomSeed) * _OverlayTextureScrollYSpeed) % 1; + half4 overlayCol = SAMPLE_TEXTURE2D(_OverlayTex, sampler_OverlayTex, TRANSFORM_TEX(overlayUvs, _OverlayTex)); + overlayCol.rgb *= _OverlayColor.rgb * _OverlayGlow; + #if !OVERLAYMULT_ON + overlayCol.rgb *= overlayCol.a * _OverlayColor.rgb * _OverlayColor.a * _OverlayBlend; + col.rgb += overlayCol.rgb; + #else + overlayCol.a *= _OverlayColor.a; + col = lerp(col, col * overlayCol, _OverlayBlend); + #endif + #endif + + //--------------------------------- + + //OUTBASE_ON + #if OUTBASE_ON + #if OUTBASEPIXELPERF_ON + half2 destUv = half2(_OutlinePixelWidth * _MainTex_TexelSize.x, _OutlinePixelWidth * _MainTex_TexelSize.y); + #else + half2 destUv = half2(_OutlineWidth * _MainTex_TexelSize.x * 200, _OutlineWidth * _MainTex_TexelSize.y * 200); + #endif + + #if OUTDIST_ON + d.texcoord3.x += ((_Time.x + _RandomSeed) * _OutlineDistortTexXSpeed) % 1; + d.texcoord3.y += ((_Time.x + _RandomSeed) * _OutlineDistortTexYSpeed) % 1; + #if ATLAS_ON + d.texcoord3 = half2((d.texcoord3.x - _MinXUV) / (_MaxXUV - _MinXUV), (d.texcoord3.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half outDistortAmnt = (SAMPLE_TEXTURE2D(_OutlineDistortTex, sampler_OutlineDistortTex, d.texcoord3).r - 0.5) * 0.2 * _OutlineDistortAmount; + destUv.x += outDistortAmnt; + destUv.y += outDistortAmnt; + #endif + + half spriteLeft = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(destUv.x, 0)).a; + half spriteRight = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy - half2(destUv.x, 0)).a; + half spriteBottom = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(0, destUv.y)).a; + half spriteTop = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy - half2(0, destUv.y)).a; + half result = spriteLeft + spriteRight + spriteBottom + spriteTop; + + #if OUTBASE8DIR_ON + half spriteTopLeft = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(destUv.x, destUv.y)).a; + half spriteTopRight = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(-destUv.x, destUv.y)).a; + half spriteBotLeft = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(destUv.x, -destUv.y)).a; + half spriteBotRight = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(-destUv.x, -destUv.y)).a; + result = result + spriteTopLeft + spriteTopRight + spriteBotLeft + spriteBotRight; + #endif + + result = step(0.05, saturate(result)); + + #if OUTTEX_ON + d.texcoord1.x += ((_Time.x + _RandomSeed) * _OutlineTexXSpeed) % 1; + d.texcoord1.y += ((_Time.x + _RandomSeed) * _OutlineTexYSpeed) % 1; + #if ATLAS_ON + d.texcoord1 = half2((d.texcoord1.x - _MinXUV) / (_MaxXUV - _MinXUV), (d.texcoord1.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half4 tempOutColor = SAMPLE_TEXTURE2D(_OutlineTex, sampler_OutlineTex, d.texcoord1); + tempOutColor *= _OutlineColor; + _OutlineColor = tempOutColor; + #endif + + result *= (1 - originalAlpha) * _OutlineAlpha; + + half4 outline = _OutlineColor * d.vertexColor.a; + outline.rgb *= _OutlineGlow; + outline.a = result; + #if ONLYOUTLINE_ON + col = outline; + #else + col = lerp(col, outline, result); + #endif + #endif + //------------------------------------------------------- + + //FADE_ON + #if FADE_ON + half2 tiledUvFade1 = TRANSFORM_TEX(d.texcoord0, _FadeTex); + half2 tiledUvFade2 = TRANSFORM_TEX(d.texcoord0, _FadeBurnTex); + #if ATLAS_ON + tiledUvFade1 = half2((tiledUvFade1.x - _MinXUV) / (_MaxXUV - _MinXUV), (tiledUvFade1.y - _MinYUV) / (_MaxYUV - _MinYUV)); + tiledUvFade2 = half2((tiledUvFade2.x - _MinXUV) / (_MaxXUV - _MinXUV), (tiledUvFade2.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half fadeTemp = SAMPLE_TEXTURE2D(_FadeTex, sampler_FadeTex, tiledUvFade1).r; + half fade = smoothstep(_FadeAmount, _FadeAmount + _FadeBurnTransition, fadeTemp); + half fadeBurn = saturate(smoothstep(_FadeAmount - _FadeBurnWidth, _FadeAmount - _FadeBurnWidth + 0.1, fadeTemp) * _FadeAmount); + col.a *= fade; + _FadeBurnColor.rgb *= _FadeBurnGlow; + col += fadeBurn * SAMPLE_TEXTURE2D(_FadeBurnTex, sampler_FadeBurnTex, tiledUvFade2) * _FadeBurnColor * originalAlpha * (1 - col.a); + #endif + //------------------------------------------------------- + + //SHADOW_ON + #if SHADOW_ON + half shadowA = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(_ShadowX, _ShadowY)).a; + half preMultShadowMask = 1 - (saturate(shadowA - col.a) * (1 - col.a)); + col.rgb *= 1 - ((shadowA - col.a) * (1 - col.a)); + col.rgb += (_ShadowColor * shadowA) * (1 - col.a); + col.a = max(shadowA * _ShadowAlpha * d.vertexColor.a, col.a); + #endif + + //------------------------------------------------------- + + //GLOW_ON + #if GLOW_ON + half4 emission; + #if GLOWTEX_ON + emission = SAMPLE_TEXTURE2D(_GlowTex, sampler_GlowTex, d.texcoord0); + #else + emission = col; + #endif + + col.rgb *= _GlowGlobal; + emission.rgb *= emission.a * col.a * _Glow * _GlowColor; + col.rgb += emission.rgb; + #endif + //------------------------------------------------------- + + //COLORRAMP_ON && COLORRAMPOUTLINE_ON + #if COLORRAMP_ON && COLORRAMPOUTLINE_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + luminance = saturate(luminance + _ColorRampLuminosity); + #if GRADIENTCOLORRAMP_ON + col.rgb = lerp(col.rgb, SAMPLE_TEXTURE2D(_ColorRampTexGradient, sampler_ColorRampTexGradient, half2(luminance, 0)).rgb, _ColorRampBlend); + #else + col.rgb = lerp(col.rgb, SAMPLE_TEXTURE2D(_ColorRampTex, sampler_ColorRampTex, half2(luminance, 0)).rgb, _ColorRampBlend); + #endif + #endif + //--------------- + + //GREYSCALE_ON && GREYSCALEOUTLINE_ON + #if GREYSCALE_ON && GREYSCALEOUTLINE_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + luminance = saturate(luminance + _GreyscaleLuminosity); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _GreyscaleTintColor, _GreyscaleBlend); + #endif + + //----------------------------------- + + //POSTERIZE_ON && POSTERIZEOUTLINE_ON + #if POSTERIZE_ON && POSTERIZEOUTLINE_ON + col.rgb = pow(col.rgb, _PosterizeGamma) * _PosterizeNumColors; + col.rgb = floor(col.rgb) / _PosterizeNumColors; + col.rgb = pow(col.rgb, 1.0 / _PosterizeGamma); + #endif + + //----------------------------------- + + //SHINE_ON + #if SHINE_ON + half2 uvShine = uvRect; + half cosAngle = cos(_ShineRotate); + half sinAngle = sin(_ShineRotate); + half2x2 rot = half2x2(cosAngle, -sinAngle, sinAngle, cosAngle); + uvShine -= half2(0.5, 0.5); + uvShine = mul(rot, uvShine); + uvShine += half2(0.5, 0.5); + half shineMask = SAMPLE_TEXTURE2D(_ShineMask, sampler_ShineMask, d.texcoord0.xy).a; + half currentDistanceProjection = (uvShine.x + uvShine.y) / 2; + half whitePower = 1 - (abs(currentDistanceProjection - _ShineLocation) / _ShineWidth); + col.rgb += col.a * whitePower * _ShineGlow * max(sign(currentDistanceProjection - (_ShineLocation - _ShineWidth)), 0.0) + * max(sign((_ShineLocation + _ShineWidth) - currentDistanceProjection), 0.0) * _ShineColor * shineMask; + #endif + + //----------------------------------- + + //HOLOGRAM_ON + #if HOLOGRAM_ON + half totalHologram = _HologramStripesAmount + _HologramUnmodAmount; + half hologramYCoord = ((uvRect.y + (((_Time.x + randomSeed) % 1) * _HologramStripesSpeed)) % totalHologram) / totalHologram; + hologramYCoord = abs(hologramYCoord); + half alpha = RemapFloat(saturate(hologramYCoord - (_HologramUnmodAmount/totalHologram)), 0.0, 1.0, _HologramMinAlpha, saturate(_HologramMaxAlpha)); + half hologramMask = max(sign((_HologramUnmodAmount/totalHologram) - hologramYCoord), 0.0); + half4 hologramResult = col; + hologramResult.a *= lerp(alpha, 1, hologramMask); + hologramResult.rgb *= max(1, _HologramMaxAlpha * max(sign(hologramYCoord - (_HologramUnmodAmount/totalHologram)), 0.0)); + hologramMask = 1 - step(0.01,hologramMask); + hologramResult.rgb += hologramMask * _HologramStripeColor * col.a; + col = lerp(col, hologramResult, _HologramBlend); + #endif + + //----------------------------------- + + //FLICKER_ON + #if FLICKER_ON + col.a *= saturate(col.a * step(frac(0.05 + (_Time.w + randomSeed) * _FlickerFreq), 1 - _FlickerPercent) + _FlickerAlpha); + #endif + //----------------------------------- + + //ALPHACUTOFF_ON + + //ALPHAROUND_ON + + //ALPHAOUTLINE_ON + #if ALPHAOUTLINE_ON + half alphaOutlineRes = pow(1 - col.a, max(_AlphaOutlinePower, 0.0001)) * step(_AlphaOutlineMinAlpha, col.a) * _AlphaOutlineBlend; + col.rgb = lerp(col.rgb, _AlphaOutlineColor.rgb * _AlphaOutlineGlow, alphaOutlineRes); + col.a = lerp(col.a, 1, alphaOutlineRes > 1); + #endif + //------------------------------------------------------- + + //FOG_ON + + //------------------ + + col *= _Color; + o.Albedo = col; + col.a *= _Alpha; + clip(col.a - _AlphaCutoffValue - 0.01); + o.Alpha = _Color.a; + } + + + + + + void ChainSurfaceFunction(inout Surface l, inout ShaderData d) + { + Ext_SurfaceFunction0(l, d); + // Ext_SurfaceFunction1(l, d); + // Ext_SurfaceFunction2(l, d); + // Ext_SurfaceFunction3(l, d); + // Ext_SurfaceFunction4(l, d); + // Ext_SurfaceFunction5(l, d); + // Ext_SurfaceFunction6(l, d); + // Ext_SurfaceFunction7(l, d); + // Ext_SurfaceFunction8(l, d); + // Ext_SurfaceFunction9(l, d); + // Ext_SurfaceFunction10(l, d); + // Ext_SurfaceFunction11(l, d); + // Ext_SurfaceFunction12(l, d); + // Ext_SurfaceFunction13(l, d); + // Ext_SurfaceFunction14(l, d); + // Ext_SurfaceFunction15(l, d); + // Ext_SurfaceFunction16(l, d); + // Ext_SurfaceFunction17(l, d); + // Ext_SurfaceFunction18(l, d); + // Ext_SurfaceFunction19(l, d); + // Ext_SurfaceFunction20(l, d); + // Ext_SurfaceFunction21(l, d); + // Ext_SurfaceFunction22(l, d); + // Ext_SurfaceFunction23(l, d); + // Ext_SurfaceFunction24(l, d); + // Ext_SurfaceFunction25(l, d); + // Ext_SurfaceFunction26(l, d); + // Ext_SurfaceFunction27(l, d); + // Ext_SurfaceFunction28(l, d); + // Ext_SurfaceFunction29(l, d); + } + +#if !_DECALSHADER + + void ChainModifyVertex(inout VertexData v, inout VertexToPixel v2p, float4 time) + { + ExtraV2F d; + + ZERO_INITIALIZE(ExtraV2F, d); + ZERO_INITIALIZE(Blackboard, d.blackboard); + // due to motion vectors in HDRP, we need to use the last + // time in certain spots. So if you are going to use _Time to adjust vertices, + // you need to use this time or motion vectors will break. + d.time = time; + + Ext_ModifyVertex0(v, d); + // Ext_ModifyVertex1(v, d); + // Ext_ModifyVertex2(v, d); + // Ext_ModifyVertex3(v, d); + // Ext_ModifyVertex4(v, d); + // Ext_ModifyVertex5(v, d); + // Ext_ModifyVertex6(v, d); + // Ext_ModifyVertex7(v, d); + // Ext_ModifyVertex8(v, d); + // Ext_ModifyVertex9(v, d); + // Ext_ModifyVertex10(v, d); + // Ext_ModifyVertex11(v, d); + // Ext_ModifyVertex12(v, d); + // Ext_ModifyVertex13(v, d); + // Ext_ModifyVertex14(v, d); + // Ext_ModifyVertex15(v, d); + // Ext_ModifyVertex16(v, d); + // Ext_ModifyVertex17(v, d); + // Ext_ModifyVertex18(v, d); + // Ext_ModifyVertex19(v, d); + // Ext_ModifyVertex20(v, d); + // Ext_ModifyVertex21(v, d); + // Ext_ModifyVertex22(v, d); + // Ext_ModifyVertex23(v, d); + // Ext_ModifyVertex24(v, d); + // Ext_ModifyVertex25(v, d); + // Ext_ModifyVertex26(v, d); + // Ext_ModifyVertex27(v, d); + // Ext_ModifyVertex28(v, d); + // Ext_ModifyVertex29(v, d); + + + // #if %EXTRAV2F0REQUIREKEY% + // v2p.extraV2F0 = d.extraV2F0; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // v2p.extraV2F1 = d.extraV2F1; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // v2p.extraV2F2 = d.extraV2F2; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // v2p.extraV2F3 = d.extraV2F3; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // v2p.extraV2F4 = d.extraV2F4; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // v2p.extraV2F5 = d.extraV2F5; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // v2p.extraV2F6 = d.extraV2F6; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // v2p.extraV2F7 = d.extraV2F7; + // #endif + } + + void ChainModifyTessellatedVertex(inout VertexData v, inout VertexToPixel v2p) + { + ExtraV2F d; + ZERO_INITIALIZE(ExtraV2F, d); + ZERO_INITIALIZE(Blackboard, d.blackboard); + + // #if %EXTRAV2F0REQUIREKEY% + // d.extraV2F0 = v2p.extraV2F0; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // d.extraV2F1 = v2p.extraV2F1; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // d.extraV2F2 = v2p.extraV2F2; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // d.extraV2F3 = v2p.extraV2F3; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // d.extraV2F4 = v2p.extraV2F4; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // d.extraV2F5 = v2p.extraV2F5; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // d.extraV2F6 = v2p.extraV2F6; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // d.extraV2F7 = v2p.extraV2F7; + // #endif + + + // Ext_ModifyTessellatedVertex0(v, d); + // Ext_ModifyTessellatedVertex1(v, d); + // Ext_ModifyTessellatedVertex2(v, d); + // Ext_ModifyTessellatedVertex3(v, d); + // Ext_ModifyTessellatedVertex4(v, d); + // Ext_ModifyTessellatedVertex5(v, d); + // Ext_ModifyTessellatedVertex6(v, d); + // Ext_ModifyTessellatedVertex7(v, d); + // Ext_ModifyTessellatedVertex8(v, d); + // Ext_ModifyTessellatedVertex9(v, d); + // Ext_ModifyTessellatedVertex10(v, d); + // Ext_ModifyTessellatedVertex11(v, d); + // Ext_ModifyTessellatedVertex12(v, d); + // Ext_ModifyTessellatedVertex13(v, d); + // Ext_ModifyTessellatedVertex14(v, d); + // Ext_ModifyTessellatedVertex15(v, d); + // Ext_ModifyTessellatedVertex16(v, d); + // Ext_ModifyTessellatedVertex17(v, d); + // Ext_ModifyTessellatedVertex18(v, d); + // Ext_ModifyTessellatedVertex19(v, d); + // Ext_ModifyTessellatedVertex20(v, d); + // Ext_ModifyTessellatedVertex21(v, d); + // Ext_ModifyTessellatedVertex22(v, d); + // Ext_ModifyTessellatedVertex23(v, d); + // Ext_ModifyTessellatedVertex24(v, d); + // Ext_ModifyTessellatedVertex25(v, d); + // Ext_ModifyTessellatedVertex26(v, d); + // Ext_ModifyTessellatedVertex27(v, d); + // Ext_ModifyTessellatedVertex28(v, d); + // Ext_ModifyTessellatedVertex29(v, d); + + // #if %EXTRAV2F0REQUIREKEY% + // v2p.extraV2F0 = d.extraV2F0; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // v2p.extraV2F1 = d.extraV2F1; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // v2p.extraV2F2 = d.extraV2F2; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // v2p.extraV2F3 = d.extraV2F3; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // v2p.extraV2F4 = d.extraV2F4; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // v2p.extraV2F5 = d.extraV2F5; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // v2p.extraV2F6 = d.extraV2F6; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // v2p.extraV2F7 = d.extraV2F7; + // #endif + } + + void ChainFinalColorForward(inout Surface l, inout ShaderData d, inout half4 color) + { + // Ext_FinalColorForward0(l, d, color); + // Ext_FinalColorForward1(l, d, color); + // Ext_FinalColorForward2(l, d, color); + // Ext_FinalColorForward3(l, d, color); + // Ext_FinalColorForward4(l, d, color); + // Ext_FinalColorForward5(l, d, color); + // Ext_FinalColorForward6(l, d, color); + // Ext_FinalColorForward7(l, d, color); + // Ext_FinalColorForward8(l, d, color); + // Ext_FinalColorForward9(l, d, color); + // Ext_FinalColorForward10(l, d, color); + // Ext_FinalColorForward11(l, d, color); + // Ext_FinalColorForward12(l, d, color); + // Ext_FinalColorForward13(l, d, color); + // Ext_FinalColorForward14(l, d, color); + // Ext_FinalColorForward15(l, d, color); + // Ext_FinalColorForward16(l, d, color); + // Ext_FinalColorForward17(l, d, color); + // Ext_FinalColorForward18(l, d, color); + // Ext_FinalColorForward19(l, d, color); + // Ext_FinalColorForward20(l, d, color); + // Ext_FinalColorForward21(l, d, color); + // Ext_FinalColorForward22(l, d, color); + // Ext_FinalColorForward23(l, d, color); + // Ext_FinalColorForward24(l, d, color); + // Ext_FinalColorForward25(l, d, color); + // Ext_FinalColorForward26(l, d, color); + // Ext_FinalColorForward27(l, d, color); + // Ext_FinalColorForward28(l, d, color); + // Ext_FinalColorForward29(l, d, color); + } + + void ChainFinalGBufferStandard(inout Surface s, inout ShaderData d, inout half4 GBuffer0, inout half4 GBuffer1, inout half4 GBuffer2, inout half4 outEmission, inout half4 outShadowMask) + { + // Ext_FinalGBufferStandard0(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard1(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard2(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard3(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard4(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard5(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard6(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard7(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard8(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard9(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard10(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard11(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard12(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard13(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard14(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard15(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard16(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard17(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard18(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard19(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard20(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard21(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard22(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard23(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard24(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard25(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard26(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard27(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard28(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard29(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + } +#endif + + + + + +#if _DECALSHADER + + ShaderData CreateShaderData(SurfaceDescriptionInputs IN) + { + ShaderData d = (ShaderData)0; + d.TBNMatrix = float3x3(IN.WorldSpaceTangent, IN.WorldSpaceBiTangent, IN.WorldSpaceNormal); + d.worldSpaceNormal = IN.WorldSpaceNormal; + d.worldSpaceTangent = IN.WorldSpaceTangent; + + d.worldSpacePosition = IN.WorldSpacePosition; + d.texcoord0 = IN.uv0.xyxy; + d.screenPos = IN.ScreenPosition; + + d.worldSpaceViewDir = normalize(_WorldSpaceCameraPos - d.worldSpacePosition); + + d.tangentSpaceViewDir = mul(d.TBNMatrix, d.worldSpaceViewDir); + + // these rarely get used, so we back transform them. Usually will be stripped. + #if _HDRP + // d.localSpacePosition = mul(GetWorldToObjectMatrix(), float4(GetCameraRelativePositionWS(d.worldSpacePosition), 1)).xyz; + #else + // d.localSpacePosition = mul(GetWorldToObjectMatrix(), float4(d.worldSpacePosition, 1)).xyz; + #endif + // d.localSpaceNormal = normalize(mul((float3x3)GetWorldToObjectMatrix(), d.worldSpaceNormal)); + // d.localSpaceTangent = normalize(mul((float3x3)GetWorldToObjectMatrix(), d.worldSpaceTangent.xyz)); + + // #if %SCREENPOSREQUIREKEY% + // d.screenUV = (IN.ScreenPosition.xy / max(0.01, IN.ScreenPosition.w)); + // #endif + + return d; + } +#else + + ShaderData CreateShaderData(VertexToPixel i + #if NEED_FACING + , bool facing + #endif + ) + { + ShaderData d = (ShaderData)0; + d.clipPos = i.pos; + d.worldSpacePosition = i.worldPos; + + d.worldSpaceNormal = normalize(i.worldNormal); + d.worldSpaceTangent.xyz = normalize(i.worldTangent.xyz); + + d.tangentSign = i.worldTangent.w * unity_WorldTransformParams.w; + float3 bitangent = cross(d.worldSpaceTangent.xyz, d.worldSpaceNormal) * d.tangentSign; + + d.TBNMatrix = float3x3(d.worldSpaceTangent, -bitangent, d.worldSpaceNormal); + d.worldSpaceViewDir = normalize(_WorldSpaceCameraPos - i.worldPos); + + d.tangentSpaceViewDir = mul(d.TBNMatrix, d.worldSpaceViewDir); + d.texcoord0 = i.texcoord0; + d.texcoord1 = i.texcoord1; + d.texcoord2 = i.texcoord2; + + // #if %TEXCOORD3REQUIREKEY% + d.texcoord3 = i.texcoord3; + // #endif + + // d.isFrontFace = facing; + // #if %VERTEXCOLORREQUIREKEY% + d.vertexColor = i.vertexColor; + // #endif + + // these rarely get used, so we back transform them. Usually will be stripped. + #if _HDRP + // d.localSpacePosition = mul(GetWorldToObjectMatrix(), float4(GetCameraRelativePositionWS(i.worldPos), 1)).xyz; + #else + // d.localSpacePosition = mul(GetWorldToObjectMatrix(), float4(i.worldPos, 1)).xyz; + #endif + // d.localSpaceNormal = normalize(mul((float3x3)GetWorldToObjectMatrix(), i.worldNormal)); + // d.localSpaceTangent = normalize(mul((float3x3)GetWorldToObjectMatrix(), i.worldTangent.xyz)); + + // #if %SCREENPOSREQUIREKEY% + // d.screenPos = i.screenPos; + // d.screenUV = (i.screenPos.xy / i.screenPos.w); + // #endif + + + // #if %EXTRAV2F0REQUIREKEY% + // d.extraV2F0 = i.extraV2F0; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // d.extraV2F1 = i.extraV2F1; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // d.extraV2F2 = i.extraV2F2; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // d.extraV2F3 = i.extraV2F3; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // d.extraV2F4 = i.extraV2F4; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // d.extraV2F5 = i.extraV2F5; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // d.extraV2F6 = i.extraV2F6; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // d.extraV2F7 = i.extraV2F7; + // #endif + + return d; + } + +#endif + + + #if defined(_PASSSHADOW) + float3 _LightDirection; + float3 _LightPosition; + #endif + + #if (_PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR))) + + #define GetWorldToViewMatrix() _ViewMatrix + #define UNITY_MATRIX_I_V _InvViewMatrix + #define GetViewToHClipMatrix() OptimizeProjectionMatrix(_ProjMatrix) + #define UNITY_MATRIX_I_P _InvProjMatrix + #define GetWorldToHClipMatrix() _ViewProjMatrix + #define UNITY_MATRIX_I_VP _InvViewProjMatrix + #define UNITY_MATRIX_UNJITTERED_VP _NonJitteredViewProjMatrix + #define UNITY_MATRIX_PREV_VP _PrevViewProjMatrix + #define UNITY_MATRIX_PREV_I_VP _PrevInvViewProjMatrix + + void MotionVectorPositionZBias(VertexToPixel input) + { + #if UNITY_REVERSED_Z + input.pos.z -= unity_MotionVectorsParams.z * input.pos.w; + #else + input.pos.z += unity_MotionVectorsParams.z * input.pos.w; + #endif + } + + #endif + + // vertex shader + VertexToPixel Vert (VertexData v) + { + VertexToPixel o = (VertexToPixel)0; + + UNITY_SETUP_INSTANCE_ID(v); + UNITY_TRANSFER_INSTANCE_ID(v, o); + UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o); + + + #if _URP && (_PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR))) + VertexData previousMesh = v; + #endif + #if !_TESSELLATION_ON + ChainModifyVertex(v, o, _Time); + #endif + + o.texcoord0 = v.texcoord0; + o.texcoord1 = v.texcoord1; + o.texcoord2 = v.texcoord2; + + // #if %TEXCOORD3REQUIREKEY% + o.texcoord3 = v.texcoord3; + // #endif + + // #if %VERTEXCOLORREQUIREKEY% + o.vertexColor = v.vertexColor; + // #endif + + // This return the camera relative position (if enable) + float3 positionWS = TransformObjectToWorld(v.vertex.xyz); + float3 normalWS = TransformObjectToWorldNormal(v.normal); + float4 tangentWS = float4(TransformObjectToWorldDir(v.tangent.xyz), v.tangent.w); + + VertexPositionInputs vertexInput = GetVertexPositionInputs(v.vertex.xyz); + o.worldPos = positionWS; + o.worldNormal = normalWS; + o.worldTangent = tangentWS; + + + // For some very odd reason, in 2021.2, we can't use Unity's defines, but have to use our own.. + #if _PASSSHADOW + #if _CASTING_PUNCTUAL_LIGHT_SHADOW + float3 lightDirectionWS = normalize(_LightPosition - o.worldPos); + #else + float3 lightDirectionWS = _LightDirection; + #endif + // Define shadow pass specific clip position for Universal + o.pos = TransformWorldToHClip(ApplyShadowBias(o.worldPos, o.worldNormal, lightDirectionWS)); + #if UNITY_REVERSED_Z + o.pos.z = min(o.pos.z, UNITY_NEAR_CLIP_VALUE); + #else + o.pos.z = max(o.pos.z, UNITY_NEAR_CLIP_VALUE); + #endif + #elif _PASSMETA + o.pos = MetaVertexPosition(float4(v.vertex.xyz, 0), v.texcoord1.xy, v.texcoord2.xy, unity_LightmapST, unity_DynamicLightmapST); + #else + o.pos = TransformWorldToHClip(o.worldPos); + #endif + + // #if %SCREENPOSREQUIREKEY% + // o.screenPos = ComputeScreenPos(o.pos, _ProjectionParams.x); + // #endif + + + #if _PASSFORWARD || _PASSGBUFFER + float2 uv1 = v.texcoord1.xy; + OUTPUT_LIGHTMAP_UV(uv1, unity_LightmapST, o.lightmapUV); + o.texcoord1.xy = uv1; + #if UNITY_VERSION < 60000009 + OUTPUT_SH(o.worldNormal, o.sh); + #endif + + #if defined(DYNAMICLIGHTMAP_ON) + o.dynamicLightmapUV.xy = v.texcoord2.xy * unity_DynamicLightmapST.xy + unity_DynamicLightmapST.zw; + #if UNITY_VERSION >= 60000009 + OUTPUT_SH(o.worldNormal, o.sh); + #endif + #elif (defined(PROBE_VOLUMES_L1) || defined(PROBE_VOLUMES_L2)) && UNITY_VERSION >= 60000009 + OUTPUT_SH4(vertexInput.positionWS, o.worldNormal.xyz, GetWorldSpaceNormalizeViewDir(vertexInput.positionWS), o.sh, o.probeOcclusion); + #endif + #endif + + #ifdef VARYINGS_NEED_FOG_AND_VERTEX_LIGHT + half fogFactor = 0; + #if defined(_FOG_FRAGMENT) + fogFactor = ComputeFogFactor(o.pos.z); + #endif + #if _BAKEDLIT + o.fogFactorAndVertexLight = half4(fogFactor, 0, 0, 0); + #else + half3 vertexLight = VertexLighting(o.worldPos, o.worldNormal); + o.fogFactorAndVertexLight = half4(fogFactor, vertexLight); + #endif + #endif + + #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR) + o.shadowCoord = GetShadowCoord(vertexInput); + #endif + + #if _URP && (_PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR))) + #if !defined(TESSELLATION_ON) + MotionVectorPositionZBias(o); + #endif + + o.previousPositionCS = float4(0.0, 0.0, 0.0, 1.0); + // Note: unity_MotionVectorsParams.y is 0 is forceNoMotion is enabled + bool forceNoMotion = unity_MotionVectorsParams.y == 0.0; + + if (!forceNoMotion) + { + #if defined(HAVE_VFX_MODIFICATION) + float3 previousPositionOS = currentFrameMvData.vfxParticlePositionOS; + #if defined(VFX_FEATURE_MOTION_VECTORS_VERTS) + const bool applyDeformation = false; + #else + const bool applyDeformation = true; + #endif + #else + const bool hasDeformation = unity_MotionVectorsParams.x == 1; // Mesh has skinned deformation + float3 previousPositionOS = hasDeformation ? previousMesh.previousPositionOS : previousMesh.vertex.xyz; + + #if defined(AUTOMATIC_TIME_BASED_MOTION_VECTORS) && defined(GRAPH_VERTEX_USES_TIME_PARAMETERS_INPUT) + const bool applyDeformation = true; + #else + const bool applyDeformation = hasDeformation; + #endif + #endif + // TODO + #if defined(FEATURES_GRAPH_VERTEX) + if (applyDeformation) + previousPositionOS = GetLastFrameDeformedPosition(previousMesh, currentFrameMvData, previousPositionOS); + else + previousPositionOS = previousMesh.positionOS; + + #if defined(FEATURES_GRAPH_VERTEX_MOTION_VECTOR_OUTPUT) + previousPositionOS -= previousMesh.precomputedVelocity; + #endif + #endif + + #if defined(UNITY_DOTS_INSTANCING_ENABLED) && defined(DOTS_DEFORMED) + // Deformed vertices in DOTS are not cumulative with built-in Unity skinning/blend shapes + // Needs to be called after vertex modification has been applied otherwise it will be + // overwritten by Compute Deform node + ApplyPreviousFrameDeformedVertexPosition(previousMesh.vertexID, previousPositionOS); + #endif + #if defined (_ADD_PRECOMPUTED_VELOCITY) + previousPositionOS -= previousMesh.precomputedVelocity; + #endif + o.positionCS = mul(UNITY_MATRIX_UNJITTERED_VP, float4(positionWS, 1.0f)); + + #if defined(HAVE_VFX_MODIFICATION) + #if defined(VFX_FEATURE_MOTION_VECTORS_VERTS) + #if defined(FEATURES_GRAPH_VERTEX_MOTION_VECTOR_OUTPUT) || defined(_ADD_PRECOMPUTED_VELOCITY) + #error Unexpected fast path rendering VFX motion vector while there are vertex modification afterwards. + #endif + o.previousPositionCS = VFXGetPreviousClipPosition(previousMesh, currentFrameMvData.vfxElementAttributes, o.positionCS); + #else + #if VFX_WORLD_SPACE + //previousPositionOS is already in world space + const float3 previousPositionWS = previousPositionOS; + #else + const float3 previousPositionWS = mul(UNITY_PREV_MATRIX_M, float4(previousPositionOS, 1.0f)).xyz; + #endif + o.previousPositionCS = mul(UNITY_MATRIX_PREV_VP, float4(previousPositionWS, 1.0f)); + #endif + #else + o.previousPositionCS = mul(UNITY_MATRIX_PREV_VP, mul(UNITY_PREV_MATRIX_M, float4(previousPositionOS, 1))); + #endif + } + #endif + + return o; + } + + + + + #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/UnityGBuffer.hlsl" + + // fragment shader + FragmentOutput Frag (VertexToPixel IN + #ifdef _DEPTHOFFSET_ON + , out float outputDepth : SV_Depth + #endif + #if NEED_FACING + , bool facing : SV_IsFrontFace + #endif + ) + { + UNITY_SETUP_INSTANCE_ID(IN); + UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX(IN); + + #if defined(LOD_FADE_CROSSFADE) + LODFadeCrossFade(IN.pos); + #endif + + ShaderData d = CreateShaderData(IN + #if NEED_FACING + , facing + #endif + ); + Surface l = (Surface)0; + + #ifdef _DEPTHOFFSET_ON + l.outputDepth = outputDepth; + #endif + + l.Albedo = half3(0.5, 0.5, 0.5); + l.Normal = float3(0,0,1); + l.Occlusion = 1; + l.Alpha = 1; + + ChainSurfaceFunction(l, d); + + #ifdef _DEPTHOFFSET_ON + outputDepth = l.outputDepth; + #endif + + #if _USESPECULAR || _SIMPLELIT + float3 specular = l.Specular; + float metallic = 0; + #else + float3 specular = 0; + float metallic = l.Metallic; + #endif + + InputData inputData = (InputData)0; + + inputData.positionWS = IN.worldPos; + #if _WORLDSPACENORMAL + inputData.normalWS = l.Normal; + #else + inputData.normalWS = normalize(TangentToWorldSpace(d, l.Normal)); + #endif + + inputData.viewDirectionWS = SafeNormalize(d.worldSpaceViewDir); + + + #if defined(MAIN_LIGHT_CALCULATE_SHADOWS) + inputData.shadowCoord = TransformWorldToShadowCoord(inputData.positionWS); + #else + inputData.shadowCoord = float4(0, 0, 0, 0); + #endif + + //inputData.fogCoord = IN.fogFactorAndVertexLight.x; + InitializeInputDataFog(float4(IN.worldPos, 1.0), IN.fogFactorAndVertexLight.x); + inputData.vertexLighting = IN.fogFactorAndVertexLight.yzw; + + + #if defined(_OVERRIDE_BAKEDGI) + inputData.bakedGI = l.DiffuseGI; + l.Emission += l.SpecularGI; + #else + #if defined(DYNAMICLIGHTMAP_ON) + inputData.bakedGI = SAMPLE_GI(IN.lightmapUV, IN.dynamicLightmapUV.xy, IN.sh, inputData.normalWS); + #elif defined(PROBE_VOLUMES_L1) || defined(PROBE_VOLUMES_L2) + #if UNITY_VERSION >= 60000009 + inputData.bakedGI = SAMPLE_GI(IN.sh, IN.worldPos, inputData.normalWS, inputData.viewDirectionWS, IN.pos, IN.probeOcclusion, inputData.shadowMask); + #else + inputData.bakedGI = SAMPLE_GI(IN.sh, IN.worldPos, inputData.normalWS, inputData.viewDirectionWS, IN.pos); + #endif + #else + inputData.bakedGI = SAMPLE_GI(IN.lightmapUV, IN.sh, inputData.normalWS); + #endif + #endif + + inputData.normalizedScreenSpaceUV = GetNormalizedScreenSpaceUV(IN.pos); + inputData.shadowMask = SAMPLE_SHADOWMASK(IN.lightmapUV); + + #if defined(DEBUG_DISPLAY) + #if defined(DYNAMICLIGHTMAP_ON) + inputData.dynamicLightmapUV = IN.dynamicLightmapUV.xy; + #endif + #if defined(LIGHTMAP_ON) + inputData.staticLightmapUV = IN.lightmapUV; + #else + inputData.vertexSH = IN.sh; + #endif + #endif + + #ifdef _DBUFFER + ApplyDecal(IN.pos, + l.Albedo, + specular, + inputData.normalWS, + metallic, + l.Occlusion, + l.Smoothness); + #endif + + BRDFData brdfData; + InitializeBRDFData(l.Albedo, metallic, specular, l.Smoothness, l.Alpha, brdfData); + Light mainLight = GetMainLight(inputData.shadowCoord, inputData.positionWS, inputData.shadowMask); + MixRealtimeAndBakedGI(mainLight, inputData.normalWS, inputData.bakedGI, inputData.shadowMask); + half3 color = GlobalIllumination(brdfData, inputData.bakedGI, l.Occlusion, inputData.positionWS, inputData.normalWS, inputData.viewDirectionWS); + + return BRDFDataToGbuffer(brdfData, inputData, l.Smoothness, l.Emission + color, l.Occlusion); + } + + ENDHLSL + + } + + + + Pass + { + Name "ShadowCaster" + Tags + { + "LightMode" = "ShadowCaster" + } + + // Render State + Blend One Zero, One Zero + Cull Back + ZTest LEqual + ZWrite On + // ColorMask: + + Tags { "RenderType" = "Opaque" "Queue" = "Geometry" "PreviewType" = "Plane" } + Cull [_CullingOption] + ZWrite [_ZWrite] + ZTest [_ZTestMode] + + + HLSLPROGRAM + + #pragma vertex Vert + #pragma fragment Frag + + #pragma target 3.0 + + #pragma prefer_hlslcc gles + #pragma exclude_renderers d3d11_9x + #pragma multi_compile_instancing + + #pragma multi_compile_vertex _ _CASTING_PUNCTUAL_LIGHT_SHADOW + #pragma multi_compile_fragment _ LOD_FADE_CROSSFADE + + #define _NORMAL_DROPOFF_TS 1 + #define ATTRIBUTES_NEED_NORMAL + #define ATTRIBUTES_NEED_TANGENT + #define _PASSSHADOW 1 + + + #pragma shader_feature_local GLOW_ON + #pragma shader_feature_local FADE_ON + #pragma shader_feature_local OUTBASE_ON + #pragma shader_feature_local ONLYOUTLINE_ON + #pragma shader_feature_local GRADIENT_ON + #pragma shader_feature_local GRADIENT2COL_ON + #pragma shader_feature_local RADIALGRADIENT_ON + #pragma shader_feature_local COLORSWAP_ON + #pragma shader_feature_local HSV_ON + #pragma shader_feature_local CHANGECOLOR_ON + #pragma shader_feature_local CHANGECOLOR2_ON + #pragma shader_feature_local CHANGECOLOR3_ON + #pragma shader_feature_local COLORRAMP_ON + #pragma shader_feature_local GRADIENTCOLORRAMP_ON + #pragma shader_feature_local HITEFFECT_ON + #pragma shader_feature_local NEGATIVE_ON + #pragma shader_feature_local PIXELATE_ON + #pragma shader_feature_local GREYSCALE_ON + #pragma shader_feature_local POSTERIZE_ON + #pragma shader_feature_local BLUR_ON + #pragma shader_feature_local MOTIONBLUR_ON + #pragma shader_feature_local GHOST_ON + #pragma shader_feature_local ALPHAOUTLINE_ON + #pragma shader_feature_local INNEROUTLINE_ON + #pragma shader_feature_local ONLYINNEROUTLINE_ON + #pragma shader_feature_local HOLOGRAM_ON + #pragma shader_feature_local CHROMABERR_ON + #pragma shader_feature_local GLITCH_ON + #pragma shader_feature_local FLICKER_ON + #pragma shader_feature_local SHADOW_ON + #pragma shader_feature_local SHINE_ON + #pragma shader_feature_local CONTRAST_ON + #pragma shader_feature_local OVERLAY_ON + #pragma shader_feature_local OVERLAYMULT_ON + #pragma shader_feature_local DOODLE_ON + #pragma shader_feature_local WIND_ON + #pragma shader_feature_local WAVEUV_ON + #pragma shader_feature_local ROUNDWAVEUV_ON + #pragma shader_feature_local RECTSIZE_ON + #pragma shader_feature_local OFFSETUV_ON + #pragma shader_feature_local CLIPPING_ON + #pragma shader_feature_local RADIALCLIPPING_ON + #pragma shader_feature_local TEXTURESCROLL_ON + #pragma shader_feature_local ZOOMUV_ON + #pragma shader_feature_local DISTORT_ON + #pragma shader_feature_local WARP_ON + #pragma shader_feature_local TWISTUV_ON + #pragma shader_feature_local ROTATEUV_ON + #pragma shader_feature_local POLARUV_ON + #pragma shader_feature_local FISHEYE_ON + #pragma shader_feature_local PINCH_ON + #pragma shader_feature_local SHAKEUV_ON + + #pragma shader_feature_local GLOWTEX_ON + #pragma shader_feature_local OUTTEX_ON + #pragma shader_feature_local OUTDIST_ON + #pragma shader_feature_local OUTBASE8DIR_ON + #pragma shader_feature_local OUTBASEPIXELPERF_ON + #pragma shader_feature_local COLORRAMPOUTLINE_ON + #pragma shader_feature_local GREYSCALEOUTLINE_ON + #pragma shader_feature_local POSTERIZEOUTLINE_ON + #pragma shader_feature_local BLURISHD_ON + #pragma shader_feature_local MANUALWIND_ON + #pragma shader_feature_local ATLAS_ON + #pragma shader_feature_local PREMULTIPLYALPHA_ON + + #pragma shader_feature BILBOARD_ON + #pragma shader_feature BILBOARDY_ON + + #pragma shader_feature NORMALMAP_ON + + + #define _URP 1 +#define _USINGTEXCOORD1 1 +#define _USINGTEXCOORD2 1 + + + #include_with_pragmas "Packages/com.unity.render-pipelines.universal/ShaderLibrary/DOTS.hlsl" + #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.universal/ShaderLibrary/Input.hlsl" + #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/TextureStack.hlsl" + #include_with_pragmas "Packages/com.unity.render-pipelines.core/ShaderLibrary/FoveatedRenderingKeywords.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.universal/ShaderLibrary/LODCrossFade.hlsl" + + #undef WorldNormalVector + #define WorldNormalVector(data, normal) mul(normal, data.TBNMatrix) + + #define UnityObjectToWorldNormal(normal) mul(GetObjectToWorldMatrix(), normal) + + #define _WorldSpaceLightPos0 _MainLightPosition + + #define UNITY_DECLARE_TEX2D(name) TEXTURE2D(name); SAMPLER(sampler##name); + #define UNITY_DECLARE_TEX2D_NOSAMPLER(name) TEXTURE2D(name); + #define UNITY_DECLARE_TEX2DARRAY(name) TEXTURE2D_ARRAY(name); SAMPLER(sampler##name); + #define UNITY_DECLARE_TEX2DARRAY_NOSAMPLER(name) TEXTURE2D_ARRAY(name); + + #define UNITY_SAMPLE_TEX2DARRAY(tex,coord) SAMPLE_TEXTURE2D_ARRAY(tex, sampler##tex, coord.xy, coord.z) + #define UNITY_SAMPLE_TEX2DARRAY_LOD(tex,coord,lod) SAMPLE_TEXTURE2D_ARRAY_LOD(tex, sampler##tex, coord.xy, coord.z, lod) + #define UNITY_SAMPLE_TEX2D(tex, coord) SAMPLE_TEXTURE2D(tex, sampler##tex, coord) + #define UNITY_SAMPLE_TEX2D_SAMPLER(tex, samp, coord) SAMPLE_TEXTURE2D(tex, sampler##samp, coord) + + #define UNITY_SAMPLE_TEX2D_LOD(tex,coord, lod) SAMPLE_TEXTURE2D_LOD(tex, sampler_##tex, coord, lod) + #define UNITY_SAMPLE_TEX2D_SAMPLER_LOD(tex,samplertex,coord, lod) SAMPLE_TEXTURE2D_LOD (tex, sampler##samplertex,coord, lod) + + #if defined(UNITY_COMPILER_HLSL) + #define UNITY_INITIALIZE_OUTPUT(type,name) name = (type)0; + #else + #define UNITY_INITIALIZE_OUTPUT(type,name) + #endif + + #define sampler2D_float sampler2D + #define sampler2D_half sampler2D + + + + // data across stages, stripped like the above. + struct VertexToPixel + { + float4 pos : SV_POSITION; + float3 worldPos : TEXCOORD0; + float3 worldNormal : TEXCOORD1; + float4 worldTangent : TEXCOORD2; + float4 texcoord0 : TEXCOORD3; + float4 texcoord1 : TEXCOORD4; + float4 texcoord2 : TEXCOORD5; + + // #if %TEXCOORD3REQUIREKEY% + float4 texcoord3 : TEXCOORD6; + // #endif + + // #if %SCREENPOSREQUIREKEY% + // float4 screenPos : TEXCOORD7; + // #endif + + // #if %VERTEXCOLORREQUIREKEY% + half4 vertexColor : COLOR; + // #endif + + #if defined(LIGHTMAP_ON) + float2 lightmapUV : TEXCOORD8; + #endif + #if defined(DYNAMICLIGHTMAP_ON) + float2 dynamicLightmapUV : TEXCOORD9; + #endif + #if !defined(LIGHTMAP_ON) + float4 probeOcclusion : TEXCOORD8; + float3 sh : TEXCOORD10; + #endif + + #if defined(VARYINGS_NEED_FOG_AND_VERTEX_LIGHT) + float4 fogFactorAndVertexLight : TEXCOORD11; + #endif + + #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR) + float4 shadowCoord : TEXCOORD12; + #endif + + // #if %EXTRAV2F0REQUIREKEY% + // float4 extraV2F0 : TEXCOORD13; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // float4 extraV2F1 : TEXCOORD14; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // float4 extraV2F2 : TEXCOORD15; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // float4 extraV2F3 : TEXCOORD16; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // float4 extraV2F4 : TEXCOORD17; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // float4 extraV2F5 : TEXCOORD18; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // float4 extraV2F6 : TEXCOORD19; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // float4 extraV2F7 : TEXCOORD20; + // #endif + + #if UNITY_ANY_INSTANCING_ENABLED + uint instanceID : CUSTOM_INSTANCE_ID; + #endif + #if (defined(UNITY_STEREO_MULTIVIEW_ENABLED)) || (defined(UNITY_STEREO_INSTANCING_ENABLED) && (defined(SHADER_API_GLES3) || defined(SHADER_API_GLCORE))) + uint stereoTargetEyeIndexAsBlendIdx0 : BLENDINDICES0; + #endif + #if (defined(UNITY_STEREO_INSTANCING_ENABLED)) + uint stereoTargetEyeIndexAsRTArrayIdx : SV_RenderTargetArrayIndex; + #endif + #if defined(SHADER_STAGE_FRAGMENT) && defined(VARYINGS_NEED_CULLFACE) + FRONT_FACE_TYPE cullFace : FRONT_FACE_SEMANTIC; + #endif + + #if _PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR)) + float4 previousPositionCS : TEXCOORD21; // Contain previous transform position (in case of skinning for example) + float4 positionCS : TEXCOORD22; + #endif + }; + + + + + // data describing the user output of a pixel + struct Surface + { + half3 Albedo; + half Height; + half3 Normal; + half Smoothness; + half3 Emission; + half Metallic; + half3 Specular; + half Occlusion; + half SpecularPower; // for simple lighting + half Alpha; + float outputDepth; // if written, SV_Depth semantic is used. ShaderData.clipPos.z is unused value + // HDRP Only + half SpecularOcclusion; + half SubsurfaceMask; + half Thickness; + half CoatMask; + half CoatSmoothness; + half Anisotropy; + half IridescenceMask; + half IridescenceThickness; + int DiffusionProfileHash; + float SpecularAAThreshold; + float SpecularAAScreenSpaceVariance; + // requires _OVERRIDE_BAKEDGI to be defined, but is mapped in all pipelines + float3 DiffuseGI; + float3 BackDiffuseGI; + float3 SpecularGI; + float ior; + float3 transmittanceColor; + float atDistance; + float transmittanceMask; + // requires _OVERRIDE_SHADOWMASK to be defines + float4 ShadowMask; + + // for decals + float NormalAlpha; + float MAOSAlpha; + + + }; + + // Data the user declares in blackboard blocks + struct Blackboard + { + + float blackboardDummyData; + }; + + // data the user might need, this will grow to be big. But easy to strip + struct ShaderData + { + float4 clipPos; // SV_POSITION + float3 localSpacePosition; + float3 localSpaceNormal; + float3 localSpaceTangent; + + float3 worldSpacePosition; + float3 worldSpaceNormal; + float3 worldSpaceTangent; + float tangentSign; + + float3 worldSpaceViewDir; + float3 tangentSpaceViewDir; + + float4 texcoord0; + float4 texcoord1; + float4 texcoord2; + float4 texcoord3; + + float2 screenUV; + float4 screenPos; + + float4 vertexColor; + bool isFrontFace; + + float4 extraV2F0; + float4 extraV2F1; + float4 extraV2F2; + float4 extraV2F3; + float4 extraV2F4; + float4 extraV2F5; + float4 extraV2F6; + float4 extraV2F7; + + float3x3 TBNMatrix; + Blackboard blackboard; + }; + + struct VertexData + { + #if SHADER_TARGET > 30 + // uint vertexID : SV_VertexID; + #endif + float4 vertex : POSITION; + float3 normal : NORMAL; + float4 tangent : TANGENT; + float4 texcoord0 : TEXCOORD0; + + // optimize out mesh coords when not in use by user or lighting system + #if _URP && (_USINGTEXCOORD1 || _PASSMETA || _PASSFORWARD || _PASSGBUFFER) + float4 texcoord1 : TEXCOORD1; + #endif + + #if _URP && (_USINGTEXCOORD2 || _PASSMETA || ((_PASSFORWARD || _PASSGBUFFER) && defined(DYNAMICLIGHTMAP_ON))) + float4 texcoord2 : TEXCOORD2; + #endif + + #if _STANDARD && (_USINGTEXCOORD1 || (_PASSMETA || ((_PASSFORWARD || _PASSGBUFFER || _PASSFORWARDADD) && LIGHTMAP_ON))) + float4 texcoord1 : TEXCOORD1; + #endif + #if _STANDARD && (_USINGTEXCOORD2 || (_PASSMETA || ((_PASSFORWARD || _PASSGBUFFER) && DYNAMICLIGHTMAP_ON))) + float4 texcoord2 : TEXCOORD2; + #endif + + + #if _HDRP + float4 texcoord1 : TEXCOORD1; + float4 texcoord2 : TEXCOORD2; + #endif + + // #if %TEXCOORD3REQUIREKEY% + float4 texcoord3 : TEXCOORD3; + // #endif + + // #if %VERTEXCOLORREQUIREKEY% + float4 vertexColor : COLOR; + // #endif + + #if _PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR)) + float3 previousPositionOS : TEXCOORD4; // Contain previous transform position (in case of skinning for example) + #if defined (_ADD_PRECOMPUTED_VELOCITY) + float3 precomputedVelocity : TEXCOORD5; // Add Precomputed Velocity (Alembic computes velocities on runtime side). + #endif + #endif + + UNITY_VERTEX_INPUT_INSTANCE_ID + }; + + struct TessVertex + { + float4 vertex : INTERNALTESSPOS; + float3 normal : NORMAL; + float4 tangent : TANGENT; + float4 texcoord0 : TEXCOORD0; + float4 texcoord1 : TEXCOORD1; + float4 texcoord2 : TEXCOORD2; + + // #if %TEXCOORD3REQUIREKEY% + float4 texcoord3 : TEXCOORD3; + // #endif + + // #if %VERTEXCOLORREQUIREKEY% + float4 vertexColor : COLOR; + // #endif + + // #if %EXTRAV2F0REQUIREKEY% + // float4 extraV2F0 : TEXCOORD5; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // float4 extraV2F1 : TEXCOORD6; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // float4 extraV2F2 : TEXCOORD7; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // float4 extraV2F3 : TEXCOORD8; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // float4 extraV2F4 : TEXCOORD9; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // float4 extraV2F5 : TEXCOORD10; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // float4 extraV2F6 : TEXCOORD11; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // float4 extraV2F7 : TEXCOORD12; + // #endif + + #if _PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR)) + float3 previousPositionOS : TEXCOORD13; // Contain previous transform position (in case of skinning for example) + #if defined (_ADD_PRECOMPUTED_VELOCITY) + float3 precomputedVelocity : TEXCOORD14; + #endif + #endif + + UNITY_VERTEX_INPUT_INSTANCE_ID + UNITY_VERTEX_OUTPUT_STEREO + }; + + struct ExtraV2F + { + float4 extraV2F0; + float4 extraV2F1; + float4 extraV2F2; + float4 extraV2F3; + float4 extraV2F4; + float4 extraV2F5; + float4 extraV2F6; + float4 extraV2F7; + Blackboard blackboard; + float4 time; + }; + + + float3 WorldToTangentSpace(ShaderData d, float3 normal) + { + return mul(d.TBNMatrix, normal); + } + + float3 TangentToWorldSpace(ShaderData d, float3 normal) + { + return mul(normal, d.TBNMatrix); + } + + // in this case, make standard more like SRPs, because we can't fix + // unity_WorldToObject in HDRP, since it already does macro-fu there + + #if _STANDARD + float3 TransformWorldToObject(float3 p) { return mul(unity_WorldToObject, float4(p, 1)); }; + float3 TransformObjectToWorld(float3 p) { return mul(unity_ObjectToWorld, float4(p, 1)); }; + float4 TransformWorldToObject(float4 p) { return mul(unity_WorldToObject, p); }; + float4 TransformObjectToWorld(float4 p) { return mul(unity_ObjectToWorld, p); }; + float4x4 GetWorldToObjectMatrix() { return unity_WorldToObject; } + float4x4 GetObjectToWorldMatrix() { return unity_ObjectToWorld; } + #if (defined(SHADER_API_D3D11) || defined(SHADER_API_XBOXONE) || defined(UNITY_COMPILER_HLSLCC) || defined(SHADER_API_PSSL) || (SHADER_TARGET_SURFACE_ANALYSIS && !SHADER_TARGET_SURFACE_ANALYSIS_MOJOSHADER)) + #define UNITY_SAMPLE_TEX2D_LOD(tex,coord, lod) tex.SampleLevel (sampler##tex,coord, lod) + #define UNITY_SAMPLE_TEX2D_SAMPLER_LOD(tex,samplertex,coord, lod) tex.SampleLevel (sampler##samplertex,coord, lod) + #else + #define UNITY_SAMPLE_TEX2D_LOD(tex,coord,lod) tex2D (tex,coord,0,lod) + #define UNITY_SAMPLE_TEX2D_SAMPLER_LOD(tex,samplertex,coord,lod) tex2D (tex,coord,0,lod) + #endif + + #undef GetWorldToObjectMatrix() + + #define GetWorldToObjectMatrix() unity_WorldToObject + + + #endif + + float3 GetCameraWorldPosition() + { + #if _HDRP + return GetCameraRelativePositionWS(_WorldSpaceCameraPos); + #else + return _WorldSpaceCameraPos; + #endif + } + + #if _GRABPASSUSED + #if _STANDARD + TEXTURE2D(%GRABTEXTURE%); + SAMPLER(sampler_%GRABTEXTURE%); + #endif + + half3 GetSceneColor(float2 uv) + { + #if _STANDARD + return SAMPLE_TEXTURE2D(%GRABTEXTURE%, sampler_%GRABTEXTURE%, uv).rgb; + #else + return SHADERGRAPH_SAMPLE_SCENE_COLOR(uv); + #endif + } + #endif + + + + #if _STANDARD + UNITY_DECLARE_DEPTH_TEXTURE(_CameraDepthTexture); + float GetSceneDepth(float2 uv) { return SAMPLE_DEPTH_TEXTURE(_CameraDepthTexture, uv); } + float GetLinear01Depth(float2 uv) { return Linear01Depth(GetSceneDepth(uv)); } + float GetLinearEyeDepth(float2 uv) { return LinearEyeDepth(GetSceneDepth(uv)); } + #else + float GetSceneDepth(float2 uv) { return SHADERGRAPH_SAMPLE_SCENE_DEPTH(uv); } + float GetLinear01Depth(float2 uv) { return Linear01Depth(GetSceneDepth(uv), _ZBufferParams); } + float GetLinearEyeDepth(float2 uv) { return LinearEyeDepth(GetSceneDepth(uv), _ZBufferParams); } + #endif + + float3 GetWorldPositionFromDepthBuffer(float2 uv, float3 worldSpaceViewDir) + { + float eye = GetLinearEyeDepth(uv); + float3 camView = mul((float3x3)GetObjectToWorldMatrix(), transpose(mul(GetWorldToObjectMatrix(), UNITY_MATRIX_I_V)) [2].xyz); + + float dt = dot(worldSpaceViewDir, camView); + float3 div = worldSpaceViewDir/dt; + float3 wpos = (eye * div) + GetCameraWorldPosition(); + return wpos; + } + + #if _HDRP + float3 ObjectToWorldSpacePosition(float3 pos) + { + return GetAbsolutePositionWS(TransformObjectToWorld(pos)); + } + #else + float3 ObjectToWorldSpacePosition(float3 pos) + { + return TransformObjectToWorld(pos); + } + #endif + + #if _STANDARD + UNITY_DECLARE_SCREENSPACE_TEXTURE(_CameraDepthNormalsTexture); + float3 GetSceneNormal(float2 uv, float3 worldSpaceViewDir) + { + float4 depthNorms = UNITY_SAMPLE_SCREENSPACE_TEXTURE(_CameraDepthNormalsTexture, uv); + float3 norms = DecodeViewNormalStereo(depthNorms); + norms = mul((float3x3)GetWorldToViewMatrix(), norms) * 0.5 + 0.5; + return norms; + } + #elif _HDRP && !_DECALSHADER + + float3 GetSceneNormal(float2 uv, float3 worldSpaceViewDir) + { + NormalData nd; + DecodeFromNormalBuffer(_ScreenSize.xy * uv, nd); + return nd.normalWS; + } + #elif _URP + #if (SHADER_LIBRARY_VERSION_MAJOR >= 10) + #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/DeclareNormalsTexture.hlsl" + #endif + + float3 GetSceneNormal(float2 uv, float3 worldSpaceViewDir) + { + #if (SHADER_LIBRARY_VERSION_MAJOR >= 10) + return SampleSceneNormals(uv); + #else + float3 wpos = GetWorldPositionFromDepthBuffer(uv, worldSpaceViewDir); + return normalize(-cross(ddx(wpos), ddy(wpos))) * 0.5 + 0.5; + #endif + + } + #endif + + #if _HDRP + + half3 UnpackNormalmapRGorAG(half4 packednormal) + { + // This do the trick + packednormal.x *= packednormal.w; + + half3 normal; + normal.xy = packednormal.xy * 2 - 1; + normal.z = sqrt(1 - saturate(dot(normal.xy, normal.xy))); + return normal; + } + half3 UnpackNormal(half4 packednormal) + { + #if defined(UNITY_NO_DXT5nm) + return packednormal.xyz * 2 - 1; + #else + return UnpackNormalmapRGorAG(packednormal); + #endif + } + #endif + #if _HDRP || _URP + + half3 UnpackScaleNormal(half4 packednormal, half scale) + { + #ifndef UNITY_NO_DXT5nm + // Unpack normal as DXT5nm (1, y, 1, x) or BC5 (x, y, 0, 1) + // Note neutral texture like "bump" is (0, 0, 1, 1) to work with both plain RGB normal and DXT5nm/BC5 + packednormal.x *= packednormal.w; + #endif + half3 normal; + normal.xy = (packednormal.xy * 2 - 1) * scale; + normal.z = sqrt(1 - saturate(dot(normal.xy, normal.xy))); + return normal; + } + + #endif + + + void GetSun(out float3 lightDir, out float3 color) + { + lightDir = float3(0.5, 0.5, 0); + color = 1; + #if _HDRP + if (_DirectionalLightCount > 0) + { + DirectionalLightData light = _DirectionalLightDatas[0]; + lightDir = -light.forward.xyz; + color = light.color; + } + #elif _STANDARD + lightDir = normalize(_WorldSpaceLightPos0.xyz); + color = _LightColor0.rgb; + #elif _URP + Light light = GetMainLight(); + lightDir = light.direction; + color = light.color; + #endif + } + + + + CBUFFER_START(UnityPerMaterial) + + + half4 _Color; + half4 _MainTex_ST, _MainTex_TexelSize; + half _Alpha, _AlphaCutoffValue; + + #if ATLAS_ON + half _MinXUV, _MaxXUV, _MinYUV, _MaxYUV; + #endif + + #if GLOW_ON + half4 _GlowColor; + half _Glow, _GlowGlobal; + #endif + + #if HSV_ON + half _HsvShift, _HsvSaturation, _HsvBright; + #endif + + #if DISTORT_ON + half4 _DistortTex_ST; + half _DistortTexXSpeed, _DistortTexYSpeed, _DistortAmount; + #endif + + #if FADE_ON + half4 _FadeBurnColor, _FadeTex_ST, _FadeBurnTex_ST; + half _FadeAmount, _FadeBurnWidth, _FadeBurnTransition,_FadeBurnGlow; + #endif + + #if OUTBASE_ON + half4 _OutlineColor; + half _OutlineAlpha, _OutlineGlow, _OutlineWidth; + int _OutlinePixelWidth; + #endif + + #if OUTTEX_ON + half4 _OutlineTex_ST; + half _OutlineTexXSpeed, _OutlineTexYSpeed; + #endif + + #if OUTDIST_ON + half4 _OutlineDistortTex_ST; + half _OutlineDistortTexXSpeed, _OutlineDistortTexYSpeed, _OutlineDistortAmount; + #endif + + #if ALPHAOUTLINE_ON + half _AlphaOutlineGlow, _AlphaOutlinePower, _AlphaOutlineMinAlpha, _AlphaOutlineBlend; + half4 _AlphaOutlineColor; + #endif + + #if INNEROUTLINE_ON + half _InnerOutlineThickness, _InnerOutlineAlpha, _InnerOutlineGlow; + half4 _InnerOutlineColor; + #endif + + #if GRADIENT_ON + half _GradBlend, _GradBoostX, _GradBoostY; + half4 _GradTopRightCol, _GradTopLeftCol, _GradBotRightCol, _GradBotLeftCol; + #endif + + #if COLORSWAP_ON + half4 _ColorSwapRed, _ColorSwapGreen, _ColorSwapBlue; + half _ColorSwapRedLuminosity, _ColorSwapGreenLuminosity, _ColorSwapBlueLuminosity, _ColorSwapBlend; + #endif + + #if CHANGECOLOR_ON + half4 _ColorChangeNewCol, _ColorChangeTarget; + half _ColorChangeTolerance, _ColorChangeLuminosity; + #endif + #if CHANGECOLOR2_ON + half4 _ColorChangeNewCol2, _ColorChangeTarget2; + half _ColorChangeTolerance2; + #endif + #if CHANGECOLOR3_ON + half4 _ColorChangeNewCol3, _ColorChangeTarget3; + half _ColorChangeTolerance3; + #endif + + #if COLORRAMP_ON + half _ColorRampLuminosity, _ColorRampBlend; + #endif + + #if HITEFFECT_ON + half4 _HitEffectColor; + half _HitEffectGlow, _HitEffectBlend; + #endif + + #if NEGATIVE_ON + half _NegativeAmount; + #endif + + #if PIXELATE_ON + half _PixelateSize; + #endif + + #if GREYSCALE_ON + half _GreyscaleLuminosity, _GreyscaleBlend; + half4 _GreyscaleTintColor; + #endif + + #if POSTERIZE_ON + half _PosterizeNumColors, _PosterizeGamma; + #endif + + #if BLUR_ON + half _BlurIntensity; + #endif + + #if MOTIONBLUR_ON + half _MotionBlurAngle, _MotionBlurDist; + #endif + + #if GHOST_ON + half _GhostColorBoost, _GhostTransparency, _GhostBlend; + #endif + + #if HOLOGRAM_ON + half _HologramStripesAmount, _HologramMinAlpha, _HologramUnmodAmount, _HologramStripesSpeed, _HologramMaxAlpha, _HologramBlend; + half4 _HologramStripeColor; + #endif + + #if CHROMABERR_ON + half _ChromAberrAmount, _ChromAberrAlpha; + #endif + + #if GLITCH_ON + half _GlitchAmount, _GlitchSize; + #endif + + #if FLICKER_ON + half _FlickerFreq, _FlickerPercent, _FlickerAlpha; + #endif + + #if SHADOW_ON + half _ShadowX, _ShadowY, _ShadowAlpha; + half4 _ShadowColor; + #endif + + #if SHINE_ON + half4 _ShineColor; + half _ShineLocation, _ShineRotate, _ShineWidth, _ShineGlow; + #endif + + #if CONTRAST_ON + half _Contrast, _Brightness; + #endif + + #if OVERLAY_ON + half4 _OverlayTex_ST, _OverlayColor; + half _OverlayGlow, _OverlayBlend, _OverlayTextureScrollXSpeed, _OverlayTextureScrollYSpeed; + #endif + + #if DOODLE_ON + half _HandDrawnAmount, _HandDrawnSpeed; + #endif + + #if WIND_ON + half _GrassSpeed, _GrassWind, _GrassManualAnim, _GrassRadialBend; + #endif + + #if WAVEUV_ON + float _WaveAmount, _WaveSpeed, _WaveStrength, _WaveX, _WaveY; + #endif + + #if ROUNDWAVEUV_ON + half _RoundWaveStrength, _RoundWaveSpeed; + #endif + + #if RECTSIZE_ON + half _RectSize; + #endif + + #if OFFSETUV_ON + half _OffsetUvX, _OffsetUvY; + #endif + + #if CLIPPING_ON + half _ClipUvLeft, _ClipUvRight, _ClipUvUp, _ClipUvDown; + #endif + + #if RADIALCLIPPING_ON + half _RadialStartAngle, _RadialClip, _RadialClip2; + #endif + + #if TEXTURESCROLL_ON + half _TextureScrollXSpeed, _TextureScrollYSpeed; + #endif + + #if ZOOMUV_ON + half _ZoomUvAmount; + #endif + + #if WARP_ON + half _WarpStrength, _WarpSpeed, _WarpScale; + #endif + + #if TWISTUV_ON + half _TwistUvAmount, _TwistUvPosX, _TwistUvPosY, _TwistUvRadius; + #endif + + #if ROTATEUV_ON + half _RotateUvAmount; + #endif + + #if FISHEYE_ON + half _FishEyeUvAmount; + #endif + + #if PINCH_ON + half _PinchUvAmount; + #endif + + #if SHAKEUV_ON + half _ShakeUvSpeed, _ShakeUvX, _ShakeUvY; + #endif + + #if NORMALMAP_ON + half _NormalStrength; + #endif + + float _RandomSeed; + + + + + CBUFFER_END + + + + + + + + TEXTURE2D(_MainTex); + SAMPLER(sampler_MainTex); + + #if GLOW_ON + TEXTURE2D(_GlowTex); + SAMPLER(sampler_GlowTex); + #endif + + #if FADE_ON + TEXTURE2D(_FadeTex); + SAMPLER(sampler_FadeTex); + + TEXTURE2D(_FadeBurnTex); + SAMPLER(sampler_FadeBurnTex); + #endif + + #if DISTORT_ON + TEXTURE2D(_DistortTex); + SAMPLER(sampler_DistortTex); + #endif + + #if OUTTEX_ON + TEXTURE2D(_OutlineTex); + SAMPLER(sampler_OutlineTex); + #endif + + #if OUTDIST_ON + TEXTURE2D(_OutlineDistortTex); + SAMPLER(sampler_OutlineDistortTex); + #endif + + #if COLORSWAP_ON + TEXTURE2D(_ColorSwapTex); + SAMPLER(sampler_ColorSwapTex); + #endif + + #if COLORRAMP_ON + TEXTURE2D(_ColorRampTex); + TEXTURE2D(_ColorRampTexGradient); + SAMPLER(sampler_ColorRampTex); + SAMPLER(sampler_ColorRampTexGradient); + #endif + + #if SHINE_ON + TEXTURE2D(_ShineMask); + SAMPLER(sampler_ShineMask); + #endif + + #if OVERLAY_ON + TEXTURE2D(_OverlayTex); + SAMPLER(sampler_OverlayTex); + #endif + + #if NORMALMAP_ON + TEXTURE2D(_NormalMap); + SAMPLER(sampler_NormalMap); + #endif + + + half3 GetPixel(in int offsetX, in int offsetY, in half2 uv, in Texture2D _tex, in SamplerState _sampler) + { + half2 _uv = uv + half2(offsetX * _MainTex_TexelSize.x, offsetY * _MainTex_TexelSize.y); + half4 col = SAMPLE_TEXTURE2D(_tex, _sampler, _uv); + return col.rgb; + } + + + //BLURS------------------------------------------------------------------------- + half4 Blur(half2 uv, Texture2D source, SamplerState sampler_source, half Intensity) + { + const half2 texelSize = 1.0 / _ScreenParams.xy; + const half4 color = SAMPLE_TEXTURE2D(source, sampler_source, uv); + const half2 offset = Intensity * texelSize; + + half4 accumulatedColor = color; + half accumulatedWeight = 1.0; + for (int x = -1; x <= 1; x++) + { + for (int y = -1; y <= 1; y++) + { + const half2 sampleUV = uv + half2(x, y) * offset; + const half4 sampleColor = SAMPLE_TEXTURE2D(source, sampler_source, sampleUV); + + accumulatedColor += sampleColor; + accumulatedWeight += 1.0; + } + } + + half4 blurredColor = accumulatedColor / accumulatedWeight; + return blurredColor; + } + + half BlurHD_G(half bhqp, half x) + { + return exp(-(x * x) / (2.0 * bhqp * bhqp)); + } + half4 BlurHD(half2 uv, Texture2D source, SamplerState sampler_source, half BlurAmount, half xScale, half yScale) + { + int iterations = 16; + int halfIterations = iterations / 2; + half sigmaX = 0.1 + BlurAmount * 0.5; + half sigmaY = sigmaX; + half total = 0.0; + half4 ret = half4(0, 0, 0, 0); + for (int iy = 0; iy < iterations; ++iy) + { + half fy = BlurHD_G(sigmaY, half(iy) -half(halfIterations)); + half offsetY = half(iy - halfIterations) * 0.00390625 * xScale; + for (int ix = 0; ix < iterations; ++ix) + { + half fx = BlurHD_G(sigmaX, half(ix) - half(halfIterations)); + half offsetX = half(ix - halfIterations) * 0.00390625 * yScale; + total += fx * fy; + ret += SAMPLE_TEXTURE2D(source, sampler_source, uv + half2(offsetX, offsetY)) * fx * fy; + } + } + return ret / total; + } + //----------------------------------------------------------------------- + + + //------------------------------------------- + half RemapFloat(half inValue, half inMin, half inMax, half outMin, half outMax){ + return outMin + (inValue - inMin) * (outMax - outMin) / (inMax - inMin); + } + //------------------------------------------- + + //----------------------------------------------------------------------- + half rand(half2 seed, half offset) { + return (frac(sin(dot(seed, half2(12.9898, 78.233))) * 43758.5453) + offset) % 1.0; + } + + half rand2(half2 seed, half offset) { + return (frac(sin(dot(seed * floor(50 + (_Time.x % 1.0) * 12.), half2(127.1, 311.7))) * 43758.5453123) + offset) % 1.0; + } + + half rand2CustomTime(half2 seed, half offset, half customTime) { + return (frac(sin(dot(seed * floor(50 + (customTime % 1.0) * 12.), half2(127.1, 311.7))) * 43758.5453123) + offset) % 1.0; + } + //----------------------------------------------------------------------- + + + void Ext_ModifyVertex0 (inout VertexData v, inout ExtraV2F d) + { + //BILBOARD_ON + #if BILBOARD_ON + half3 camRight = mul((half3x3)unity_CameraToWorld, half3(1,0,0)); + half3 camUp = half3(0,1,0); + #if BILBOARDY_ON + camUp = mul((half3x3)unity_CameraToWorld, half3(0,1,0)); + #endif + half3 localPos = v.vertex.x * camRight + v.vertex.y * camUp; + v.vertex = half4(localPos, 1); + #endif + //----------------------------------------------------------- + + v.texcoord0.xy = TRANSFORM_TEX(v.texcoord0.xy, _MainTex); + half2 center = half2(0.5, 0.5); + #if ATLAS_ON + center = half2((_MaxXUV + _MinXUV) / 2.0, (_MaxYUV + _MinYUV) / 2.0); + #endif + + //POLARUV_ON + #if POLARUV_ON + v.texcoord0.xy = v.texcoord0.xy - center; + #endif + + //---------------------------------------- + + //ROTATEUV_ON + #if ROTATEUV_ON + half2 uvC = v.texcoord0.xy; + half cosAngle = cos(_RotateUvAmount); + half sinAngle = sin(_RotateUvAmount); + half2x2 rot = half2x2(cosAngle, -sinAngle, sinAngle, cosAngle); + uvC -= center; + v.texcoord0.xy = mul(rot, uvC); + v.texcoord0.xy += center; + #endif + //-------------------- + + #if RECTSIZE_ON + v.vertex.xyz += (v.vertex.xyz * (_RectSize - 1.0)); + #endif + + #if OUTTEX_ON + v.texcoord1.xy = TRANSFORM_TEX(v.texcoord0.xy, _OutlineTex); + #endif + + #if OUTDIST_ON + v.texcoord2.xy = TRANSFORM_TEX(v.texcoord0.xy, _OutlineDistortTex); + #endif + + #if DISTORT_ON + v.texcoord3.xy = TRANSFORM_TEX(v.texcoord0.xy, _DistortTex); + #endif + } + + void Ext_SurfaceFunction0 (inout Surface o, ShaderData d) + { + half randomSeed = _RandomSeed; + + float2 uvRect = d.texcoord0; + half2 center = half2(0.5, 0.5); + #if ATLAS_ON + center = half2((_MaxXUV + _MinXUV) / 2.0, (_MaxYUV + _MinYUV) / 2.0); + uvRect = half2((d.texcoord0.x - _MinXUV) / (_MaxXUV - _MinXUV), (d.texcoord0.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half2 centerTiled = half2(center.x * _MainTex_ST.x, center.y * _MainTex_ST.y); + + //CLIPPING_ON + #if CLIPPING_ON + half2 tiledUv = half2(d.texcoord0.x / _MainTex_ST.x, d.texcoord0.y / _MainTex_ST.y); + #if ATLAS_ON + tiledUv = half2((tiledUv.x - _MinXUV) / (_MaxXUV - _MinXUV), (tiledUv.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + clip((1 - _ClipUvUp) - tiledUv.y); + clip(tiledUv.y - _ClipUvDown); + clip((1 - _ClipUvRight) - tiledUv.x); + clip(tiledUv.x - _ClipUvLeft); + #endif + //---------------------------------- + + //RADIALCLIPPING_ON + #if RADIALCLIPPING_ON + half2 tiledUv2 = half2(d.texcoord0.x / _MainTex_ST.x, d.texcoord0.y / _MainTex_ST.y); + #if ATLAS_ON + tiledUv2 = half2((tiledUv2.x - _MinXUV) / (_MaxXUV - _MinXUV), (tiledUv2.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half startAngle = _RadialStartAngle - _RadialClip; + half endAngle = _RadialStartAngle + _RadialClip2; + half offset0 = clamp(0, 360, startAngle + 360); + half offset360 = clamp(0, 360, endAngle - 360); + half2 atan2Coord = half2(lerp(-1, 1, tiledUv2.x), lerp(-1, 1, tiledUv2.y)); + half atanAngle = atan2(atan2Coord.y, atan2Coord.x) * 57.3; // angle in degrees + if(atanAngle < 0) atanAngle = 360 + atanAngle; + if(atanAngle >= startAngle && atanAngle <= endAngle) discard; + if(atanAngle <= offset360) discard; + if(atanAngle >= offset0) discard; + #endif + + //----------------------------- + + //TEXTURESCROLL_ON && ATLAS_ON + #if TEXTURESCROLL_ON && ATLAS_ON + d.texcoord0.xy = half2(_MinXUV + ((_MaxXUV - _MinXUV) * (abs(((_Time.y + randomSeed) * _TextureScrollXSpeed) + uvRect.x) % 1)), + _MinYUV + ((_MaxYUV - _MinYUV) * (abs(((_Time.y + randomSeed) * _TextureScrollYSpeed) + uvRect.y) % 1))); + #endif + //---------------------------- + + //OFFSETUV_ON + #if OFFSETUV_ON + #if ATLAS_ON + d.texcoord0.xy = half2(_MinXUV + ((_MaxXUV - _MinXUV) * (abs((_OffsetUvX + uvRect.x) % 1))), + _MinYUV + ((_MaxYUV - _MinYUV) * (abs(_OffsetUvY + uvRect.y) % 1))); + #else + d.texcoord0.xy += half2(_OffsetUvX, _OffsetUvY); + #endif + #endif + + //---------------------- + + //POLARUV_ON + #if POLARUV_ON + d.texcoord0.xy = half2(atan2(d.texcoord0.y, d.texcoord0.x) / (2.0f * 3.141592653589f), length(d.texcoord0.xy)); + d.texcoord0.xy *= _MainTex_ST.xy; + #endif + + //-------------------------------------- + + //TWISTUV_ON + #if TWISTUV_ON + #if ATLAS_ON + _TwistUvPosX = ((_MaxXUV - _MinXUV) * _TwistUvPosX) + _MinXUV; + _TwistUvPosY = ((_MaxYUV - _MinYUV) * _TwistUvPosY) + _MinYUV; + #endif + half2 tempUv = d.texcoord0.xy - half2(_TwistUvPosX * _MainTex_ST.x, _TwistUvPosY * _MainTex_ST.y); + _TwistUvRadius *= (_MainTex_ST.x + _MainTex_ST.y) / 2; + half percent = (_TwistUvRadius - length(tempUv)) / _TwistUvRadius; + half theta = percent * percent * (2.0 * sin(_TwistUvAmount)) * 8.0; + half s = sin(theta); + half c = cos(theta); + half beta = max(sign(_TwistUvRadius - length(tempUv)), 0.0); + tempUv = half2(dot(tempUv, half2(c, -s)), dot(tempUv, half2(s, c))) * beta + tempUv * (1 - beta); + tempUv += half2(_TwistUvPosX * _MainTex_ST.x, _TwistUvPosY * _MainTex_ST.y); + d.texcoord0.xy = tempUv; + #endif + + //-------------------------------------------- + + //FISHEYE_ON + #if FISHEYE_ON + half bind = length(centerTiled); + half2 dF = d.texcoord0.xy - centerTiled; + half dFlen = length(dF); + half fishInt = (3.14159265359 / bind) * (_FishEyeUvAmount + 0.001); + d.texcoord0.xy = centerTiled + (dF / (max(0.0001, dFlen))) * tan(dFlen * fishInt) * bind / tan(bind * fishInt); + #endif + //--------------------------------------------- + + //PINCH_ON + #if PINCH_ON + half2 dP = d.texcoord0.xy - centerTiled; + half pinchInt = (3.141592 / length(centerTiled)) * (-_PinchUvAmount + 0.001); + d.texcoord0.xy = centerTiled + normalize(dP) * atan(length(dP) * -pinchInt * 10.0) * 0.5 / atan(-pinchInt * 5); + #endif + + //--------------------------------------------- + + //ZOOMUV_ON + #if ZOOMUV_ON + d.texcoord0.xy -= centerTiled; + d.texcoord0.xy = d.texcoord0.xy * _ZoomUvAmount; + d.texcoord0.xy += centerTiled; + #endif + + //----------------------------------------------- + + //DOODLE_ON + #if DOODLE_ON + half2 uvCopy = uvRect; + _HandDrawnSpeed = (floor((_Time.x + randomSeed) * 20 * _HandDrawnSpeed) / _HandDrawnSpeed) * _HandDrawnSpeed; + uvCopy.x = sin((uvCopy.x * _HandDrawnAmount + _HandDrawnSpeed) * 4); + uvCopy.y = cos((uvCopy.y * _HandDrawnAmount + _HandDrawnSpeed) * 4); + d.texcoord0.xy = lerp(d.texcoord0.xy, d.texcoord0.xy + uvCopy, 0.0005 * _HandDrawnAmount); + #endif + + //-------------------------- + + //SHAKEUV_ON + #if SHAKEUV_ON + half xShake = sin((_Time.x + randomSeed) * _ShakeUvSpeed * 50) * _ShakeUvX; + half yShake = cos((_Time.x + randomSeed) * _ShakeUvSpeed * 50) * _ShakeUvY; + d.texcoord0.xy += half2(xShake * 0.012, yShake * 0.01); + #endif + + //------------------------------------------- + + //RECTSIZE_ON + #if RECTSIZE_ON + d.texcoord0.xy = d.texcoord0.xy * (_RectSize).xx + (((-_RectSize * 0.5) + 0.5)).xx; + #endif + + //------------------------------------------- + + //DISTORT_ON + #if DISTORT_ON + #if ATLAS_ON + d.texcoord3.x = d.texcoord3.x * (1 / (_MaxXUV - _MinXUV)); + d.texcoord3.y = d.texcoord3.y * (1 / (_MaxYUV - _MinYUV)); + #endif + + d.texcoord3.x += ((_Time.x + _RandomSeed) * _DistortTexXSpeed) % 1; + d.texcoord3.y += ((_Time.x + _RandomSeed) * _DistortTexYSpeed) % 1; + half distortAmnt = (SAMPLE_TEXTURE2D(_DistortTex, sampler_DistortTex, d.texcoord3.xy).r - 0.5) * 0.2 * _DistortAmount; + d.texcoord0.x += distortAmnt; + d.texcoord0.y += distortAmnt; + #endif + //------------------------------------------------------- + + //WARP_ON + #if WARP_ON + half2 warpUv = half2(d.texcoord0.x / _MainTex_ST.x, d.texcoord0.y / _MainTex_ST.y); + #if ATLAS_ON + warpUv = half2((warpUv.x - _MinXUV) / (_MaxXUV - _MinXUV), (warpUv.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + const float tau = 6.283185307179586; + float xWarp = (_Time.y + randomSeed) * _WarpSpeed + warpUv.x * tau / _WarpScale; + float yWarp = (_Time.y + randomSeed) * _WarpSpeed + warpUv.y * tau / _WarpScale; + float2 warp = float2(sin(xWarp), sin(yWarp)) * _WarpStrength; + d.texcoord0.xy += warp; + #endif + + //------------------------------------------------------- + + //WAVEUV_ON + #if WAVEUV_ON + float2 uvWave = half2(_WaveX * _MainTex_ST.x, _WaveY * _MainTex_ST.y) - d.texcoord0.xy; + uvWave %= 1; + #if ATLAS_ON + uvWave = half2(_WaveX, _WaveY) - uvRect; + #endif + uvWave.x *= _ScreenParams.x / _ScreenParams.y; + float waveTime = _Time.y + randomSeed; + float angWave = (sqrt(dot(uvWave, uvWave)) * _WaveAmount) - ((waveTime * _WaveSpeed)); + d.texcoord0.xy = d.texcoord0.xy + uvWave * sin(angWave) * (_WaveStrength / 1000.0); + #endif + //---------------------------------------------------- + + //ROUNDWAVEUV_ON + #if ROUNDWAVEUV_ON + half xWave = ((0.5 * _MainTex_ST.x) - uvRect.x); + half yWave = ((0.5 * _MainTex_ST.y) - uvRect.y) * (_MainTex_TexelSize.w / _MainTex_TexelSize.z); + half ripple = -sqrt(xWave*xWave + yWave* yWave); + d.texcoord0.xy += (sin((ripple + (_Time.y + randomSeed) * (_RoundWaveSpeed/10.0)) / 0.015) * (_RoundWaveStrength/10.0)) % 1; + #endif + //---------------------------------------------------- + + + //WIND_ON + #if WIND_ON + half windOffset = sin((_Time.x + randomSeed) * _GrassSpeed * 10); + half2 windCenter = half2(0.5, 0.1); + #if ATLAS_ON + windCenter.x = ((_MaxXUV - _MinXUV) * windCenter.x) + _MinXUV; + windCenter.y = ((_MaxYUV - _MinYUV) * windCenter.y) + _MinYUV; + #endif + #if !MANUALWIND_ON + d.texcoord0.x = fmod(abs(lerp(d.texcoord0.x, d.texcoord0.x + (_GrassWind * 0.01 * windOffset), uvRect.y)), 1); + #else + d.texcoord0.x = fmod(abs(lerp(d.texcoord0.x, d.texcoord0.x + (_GrassWind * 0.01 * _GrassManualAnim), uvRect.y)), 1); + windOffset = _GrassManualAnim; + #endif + half2 delta = d.texcoord0.xy - windCenter; + half delta2 = dot(delta.xy, delta.xy); + half2 delta_offset = delta2 * windOffset; + d.texcoord0.xy = d.texcoord0.xy + half2(delta.y, -delta.x) * delta_offset * _GrassRadialBend; + #endif + + //-------------------------------------------------------- + + //TEXTURESCROLL_ON && !ATLAS_ON + #if TEXTURESCROLL_ON && !ATLAS_ON + d.texcoord0.x += ((_Time.y + randomSeed) * _TextureScrollXSpeed) % 1; + d.texcoord0.y += ((_Time.y + randomSeed) * _TextureScrollYSpeed) % 1; + #endif + //------------------------------ + + //PIXELATE_ON + #if PIXELATE_ON + half aspectRatio = _MainTex_TexelSize.x / _MainTex_TexelSize.y; + half2 pixelSize = float2(_PixelateSize, _PixelateSize * aspectRatio); + d.texcoord0.xy = floor(d.texcoord0.xy * pixelSize) / pixelSize; + #endif + //-------------- + + half4 col = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy); + half originalAlpha = col.a; + col *= d.vertexColor; + + //NORMAL MAP + #if NORMALMAP_ON + half4 normalSample = SAMPLE_TEXTURE2D(_NormalMap, sampler_NormalMap, d.texcoord0.xy); + half3 normalTS = UnpackNormal(normalSample); + normalTS.xy *= _NormalStrength; + o.Normal = normalTS; + #endif + + + //GLITCH_ON + #if GLITCH_ON + half2 uvGlitch = uvRect; + uvGlitch.y -= 0.5; + half lineNoise = pow(rand2(floor(uvGlitch * half2(24., 19.) * _GlitchSize) * 4.0, randomSeed), 3.0) * _GlitchAmount + * pow(rand2(floor(uvGlitch * half2(38., 14.) * _GlitchSize) * 4.0, randomSeed), 3.0); + col = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(lineNoise * 0.02 * rand2(half2(2.0, 1), randomSeed), 0)) * d.vertexColor; + #endif + //-------------------------------------- + + //CHROMABERR_ON + #if CHROMABERR_ON + half4 r = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(_ChromAberrAmount/10, 0)) * d.vertexColor; + half4 b = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(-_ChromAberrAmount/10, 0)) * d.vertexColor; + col = half4(r.r * r.a, col.g, b.b * b.a, max(max(r.a, b.a) * _ChromAberrAlpha, col.a)); + #endif + + //-------------------------------- + + //BLUR_ON + #if BLUR_ON + #if ATLAS_ON + #if !BLURISHD_ON + col = BlurHD(d.texcoord0.xy, _MainTex, sampler_MainTex, _BlurIntensity, (_MaxXUV - _MinXUV), (_MaxYUV - _MinYUV)) * d.vertexColor; + #else + col = Blur(d.texcoord0.xy, _MainTex, sampler_MainTex, _BlurIntensity * (_MaxXUV - _MinXUV)) * d.vertexColor; + #endif + #else + #if !BLURISHD_ON + col = BlurHD(d.texcoord0.xy, _MainTex, sampler_MainTex, _BlurIntensity, 1, 1) * d.vertexColor; + #else + col = Blur(d.texcoord0.xy, _MainTex, sampler_MainTex, _BlurIntensity) * d.vertexColor; + #endif + #endif + #endif + + //-------------------- + + //MOTIONBLUR_ON + #if MOTIONBLUR_ON + _MotionBlurAngle = _MotionBlurAngle * 3.1415926; + #define rot(n) mul(n, half2x2(cos(_MotionBlurAngle), -sin(_MotionBlurAngle), sin(_MotionBlurAngle), cos(_MotionBlurAngle))) + _MotionBlurDist = _MotionBlurDist * 0.005; + #if ATLAS_ON + _MotionBlurDist *= (_MaxXUV - _MinXUV); + #endif + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(-_MotionBlurDist, -_MotionBlurDist))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(-_MotionBlurDist * 2, -_MotionBlurDist * 2))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(-_MotionBlurDist * 3, -_MotionBlurDist * 3))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(-_MotionBlurDist * 4, -_MotionBlurDist * 4))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(_MotionBlurDist, _MotionBlurDist))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(_MotionBlurDist * 2, _MotionBlurDist * 2))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(_MotionBlurDist * 3, _MotionBlurDist * 3))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(_MotionBlurDist * 4, _MotionBlurDist * 4))); + col.rgb = col.rgb / 9; + #endif + //------------------------------------ + + //NEGATIVE_ON + #if NEGATIVE_ON + col.rgb = lerp(col.rgb, 1 - col.rgb, _NegativeAmount); + #endif + + //-------------- + half luminance = 0; + + //GREYSCALE_ON && !GREYSCALEOUTLINE_ON + #if GREYSCALE_ON && !GREYSCALEOUTLINE_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + luminance = saturate(luminance + _GreyscaleLuminosity); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _GreyscaleTintColor, _GreyscaleBlend); + #endif + //------------------------------------ + + //GHOST_ON + #if GHOST_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + half4 ghostResult; + ghostResult.a = saturate(luminance - _GhostTransparency) * col.a; + ghostResult.rgb = col.rgb * (luminance + _GhostColorBoost); + col = lerp(col, ghostResult, _GhostBlend); + #endif + //------------------------------------ + + //INNEROUTLINE_ON + #if INNEROUTLINE_ON + half3 innerT = abs(GetPixel(0, _InnerOutlineThickness, d.texcoord0.xy, _MainTex, sampler_MainTex) - GetPixel(0, -_InnerOutlineThickness, d.texcoord0.xy, _MainTex, sampler_MainTex)); + innerT += abs(GetPixel(_InnerOutlineThickness, 0, d.texcoord0.xy, _MainTex, sampler_MainTex) - GetPixel(-_InnerOutlineThickness, 0, d.texcoord0.xy, _MainTex, sampler_MainTex)); + #if !ONLYINNEROUTLINE_ON + innerT = (innerT / 2.0) * col.a * _InnerOutlineAlpha; + col.rgb += length(innerT) * _InnerOutlineColor.rgb * _InnerOutlineGlow; + #else + innerT *= col.a * _InnerOutlineAlpha; + col.rgb = length(innerT) * _InnerOutlineColor.rgb * _InnerOutlineGlow; + col.a = step(0.3, col.r+col.g+col.b); + #endif + #endif + //------------------------------------------------------- + + //HITEFFECT_ON + #if HITEFFECT_ON + col.rgb = lerp(col.rgb, _HitEffectColor.rgb * _HitEffectGlow, _HitEffectBlend); + #endif + //-------------------- + + //GRADIENT_ON + #if GRADIENT_ON + half2 tiledUvGrad = half2(uvRect.x / _MainTex_ST.x, uvRect.y / _MainTex_ST.y); + #if GRADIENT2COL_ON + _GradTopRightCol = _GradTopLeftCol; + _GradBotRightCol = _GradBotLeftCol; + #endif + #if RADIALGRADIENT_ON + half radialDist = 1 - length(tiledUvGrad - half2(0.5, 0.5)); + radialDist *= (_MainTex_TexelSize.w / _MainTex_TexelSize.z); + radialDist = saturate(_GradBoostX * radialDist); + half4 gradientResult = lerp(_GradTopLeftCol, _GradBotLeftCol, radialDist); + #else + half gradXLerpFactor = saturate(pow(tiledUvGrad.x, _GradBoostX)); + half4 gradientResult = lerp(lerp(_GradBotLeftCol, _GradBotRightCol, gradXLerpFactor), + lerp(_GradTopLeftCol, _GradTopRightCol, gradXLerpFactor), saturate(pow(tiledUvGrad.y, _GradBoostY))); + #endif + gradientResult = lerp(col, gradientResult, _GradBlend); + col.rgb = gradientResult.rgb * col.a; + col.a *= gradientResult.a; + #endif + //-------------------------------------------------------------------- + + //CONTRAST_ON + #if CONTRAST_ON + col.rgb = (col.rgb - float3(0.5, 0.5, 0.5)) * _Contrast + float3(0.5, 0.5, 0.5); + col.rgb += _Brightness; + #endif + + //------------------------------------------------------------------- + + //COLORSWAP_ON + #if COLORSWAP_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + half4 swapMask = SAMPLE_TEXTURE2D(_ColorSwapTex, sampler_ColorSwapTex, d.texcoord0.xy); + swapMask.rgb *= swapMask.a; + half3 redSwap = _ColorSwapRed * swapMask.r * saturate(luminance + _ColorSwapRedLuminosity); + half3 greenSwap = _ColorSwapGreen * swapMask.g * saturate(luminance + _ColorSwapGreenLuminosity); + half3 blueSwap = _ColorSwapBlue * swapMask.b * saturate(luminance + _ColorSwapBlueLuminosity); + swapMask.rgb = col.rgb * saturate(1 - swapMask.r - swapMask.g - swapMask.b); + col.rgb = lerp(col.rgb, swapMask.rgb + redSwap + greenSwap + blueSwap, _ColorSwapBlend); + #endif + //-------------------------------------------------------------------- + + //COLORRAMP_ON && !COLORRAMPOUTLINE_ON + #if COLORRAMP_ON && !COLORRAMPOUTLINE_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + luminance = saturate(luminance + _ColorRampLuminosity); + #if GRADIENTCOLORRAMP_ON + col.rgb = lerp(col.rgb, SAMPLE_TEXTURE2D(_ColorRampTexGradient, sampler_ColorRampTexGradient, half2(luminance, 0)).rgb, _ColorRampBlend); + #else + col.rgb = lerp(col.rgb, SAMPLE_TEXTURE2D(_ColorRampTex, sampler_ColorRampTex, half2(luminance, 0)).rgb, _ColorRampBlend); + #endif + #endif + //-------------------------------------------------------------------- + + //CHANGECOLOR_ON + #if CHANGECOLOR_ON + float3 currChangeColor = saturate(col.rgb); + luminance = 0.3 * currChangeColor.r + 0.59 * currChangeColor.g + 0.11 * currChangeColor.b; + luminance = saturate(luminance + _ColorChangeLuminosity); + half3 dif = abs(currChangeColor - _ColorChangeTarget.rgb); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _ColorChangeNewCol.rgb, + max(sign(1 - saturate(dif.x + dif.y + dif.z) - _ColorChangeTolerance), 0.0)); + #if CHANGECOLOR2_ON + dif = abs(currChangeColor - _ColorChangeTarget2.rgb); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _ColorChangeNewCol2.rgb, + max(sign(1 - saturate(dif.x + dif.y + dif.z) - _ColorChangeTolerance2), 0.0)); + #endif + #if CHANGECOLOR3_ON + dif = abs(currChangeColor - _ColorChangeTarget3.rgb); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _ColorChangeNewCol3.rgb, + max(sign(1 - saturate(dif.x + dif.y + dif.z) - _ColorChangeTolerance3), 0.0)); + #endif + #endif + //------------------------------------------------------- + + //POSTERIZE_ON && !POSTERIZEOUTLINE_ON + #if POSTERIZE_ON && !POSTERIZEOUTLINE_ON + col.rgb = pow(col.rgb, _PosterizeGamma) * _PosterizeNumColors; + col.rgb = floor(col.rgb) / _PosterizeNumColors; + col.rgb = pow(col.rgb, 1.0 / _PosterizeGamma); + #endif + //------------------------------------ + + //HSV_ON + #if HSV_ON + half3 resultHsv = half3(col.rgb); + half cosHsv = _HsvBright * _HsvSaturation * cos(_HsvShift * 3.14159265 / 180); + half sinHsv = _HsvBright * _HsvSaturation * sin(_HsvShift * 3.14159265 / 180); + resultHsv.x = (.299 * _HsvBright + .701 * cosHsv + .168 * sinHsv) * col.x + + (.587 * _HsvBright - .587 * cosHsv + .330 * sinHsv) * col.y + + (.114 * _HsvBright - .114 * cosHsv - .497 * sinHsv) * col.z; + resultHsv.y = (.299 * _HsvBright - .299 * cosHsv - .328 * sinHsv) *col.x + + (.587 * _HsvBright + .413 * cosHsv + .035 * sinHsv) * col.y + + (.114 * _HsvBright - .114 * cosHsv + .292 * sinHsv) * col.z; + resultHsv.z = (.299 * _HsvBright - .3 * cosHsv + 1.25 * sinHsv) * col.x + + (.587 * _HsvBright - .588 * cosHsv - 1.05 * sinHsv) * col.y + + (.114 * _HsvBright + .886 * cosHsv - .203 * sinHsv) * col.z; + col.rgb = resultHsv; + #endif + //------------------------------------------------------- + + //OVERLAY_ON + #if OVERLAY_ON + half2 overlayUvs = d.texcoord0.xy; + overlayUvs.x += ((_Time.y + randomSeed) * _OverlayTextureScrollXSpeed) % 1; + overlayUvs.y += ((_Time.y + randomSeed) * _OverlayTextureScrollYSpeed) % 1; + half4 overlayCol = SAMPLE_TEXTURE2D(_OverlayTex, sampler_OverlayTex, TRANSFORM_TEX(overlayUvs, _OverlayTex)); + overlayCol.rgb *= _OverlayColor.rgb * _OverlayGlow; + #if !OVERLAYMULT_ON + overlayCol.rgb *= overlayCol.a * _OverlayColor.rgb * _OverlayColor.a * _OverlayBlend; + col.rgb += overlayCol.rgb; + #else + overlayCol.a *= _OverlayColor.a; + col = lerp(col, col * overlayCol, _OverlayBlend); + #endif + #endif + + //--------------------------------- + + //OUTBASE_ON + #if OUTBASE_ON + #if OUTBASEPIXELPERF_ON + half2 destUv = half2(_OutlinePixelWidth * _MainTex_TexelSize.x, _OutlinePixelWidth * _MainTex_TexelSize.y); + #else + half2 destUv = half2(_OutlineWidth * _MainTex_TexelSize.x * 200, _OutlineWidth * _MainTex_TexelSize.y * 200); + #endif + + #if OUTDIST_ON + d.texcoord3.x += ((_Time.x + _RandomSeed) * _OutlineDistortTexXSpeed) % 1; + d.texcoord3.y += ((_Time.x + _RandomSeed) * _OutlineDistortTexYSpeed) % 1; + #if ATLAS_ON + d.texcoord3 = half2((d.texcoord3.x - _MinXUV) / (_MaxXUV - _MinXUV), (d.texcoord3.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half outDistortAmnt = (SAMPLE_TEXTURE2D(_OutlineDistortTex, sampler_OutlineDistortTex, d.texcoord3).r - 0.5) * 0.2 * _OutlineDistortAmount; + destUv.x += outDistortAmnt; + destUv.y += outDistortAmnt; + #endif + + half spriteLeft = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(destUv.x, 0)).a; + half spriteRight = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy - half2(destUv.x, 0)).a; + half spriteBottom = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(0, destUv.y)).a; + half spriteTop = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy - half2(0, destUv.y)).a; + half result = spriteLeft + spriteRight + spriteBottom + spriteTop; + + #if OUTBASE8DIR_ON + half spriteTopLeft = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(destUv.x, destUv.y)).a; + half spriteTopRight = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(-destUv.x, destUv.y)).a; + half spriteBotLeft = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(destUv.x, -destUv.y)).a; + half spriteBotRight = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(-destUv.x, -destUv.y)).a; + result = result + spriteTopLeft + spriteTopRight + spriteBotLeft + spriteBotRight; + #endif + + result = step(0.05, saturate(result)); + + #if OUTTEX_ON + d.texcoord1.x += ((_Time.x + _RandomSeed) * _OutlineTexXSpeed) % 1; + d.texcoord1.y += ((_Time.x + _RandomSeed) * _OutlineTexYSpeed) % 1; + #if ATLAS_ON + d.texcoord1 = half2((d.texcoord1.x - _MinXUV) / (_MaxXUV - _MinXUV), (d.texcoord1.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half4 tempOutColor = SAMPLE_TEXTURE2D(_OutlineTex, sampler_OutlineTex, d.texcoord1); + tempOutColor *= _OutlineColor; + _OutlineColor = tempOutColor; + #endif + + result *= (1 - originalAlpha) * _OutlineAlpha; + + half4 outline = _OutlineColor * d.vertexColor.a; + outline.rgb *= _OutlineGlow; + outline.a = result; + #if ONLYOUTLINE_ON + col = outline; + #else + col = lerp(col, outline, result); + #endif + #endif + //------------------------------------------------------- + + //FADE_ON + #if FADE_ON + half2 tiledUvFade1 = TRANSFORM_TEX(d.texcoord0, _FadeTex); + half2 tiledUvFade2 = TRANSFORM_TEX(d.texcoord0, _FadeBurnTex); + #if ATLAS_ON + tiledUvFade1 = half2((tiledUvFade1.x - _MinXUV) / (_MaxXUV - _MinXUV), (tiledUvFade1.y - _MinYUV) / (_MaxYUV - _MinYUV)); + tiledUvFade2 = half2((tiledUvFade2.x - _MinXUV) / (_MaxXUV - _MinXUV), (tiledUvFade2.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half fadeTemp = SAMPLE_TEXTURE2D(_FadeTex, sampler_FadeTex, tiledUvFade1).r; + half fade = smoothstep(_FadeAmount, _FadeAmount + _FadeBurnTransition, fadeTemp); + half fadeBurn = saturate(smoothstep(_FadeAmount - _FadeBurnWidth, _FadeAmount - _FadeBurnWidth + 0.1, fadeTemp) * _FadeAmount); + col.a *= fade; + _FadeBurnColor.rgb *= _FadeBurnGlow; + col += fadeBurn * SAMPLE_TEXTURE2D(_FadeBurnTex, sampler_FadeBurnTex, tiledUvFade2) * _FadeBurnColor * originalAlpha * (1 - col.a); + #endif + //------------------------------------------------------- + + //SHADOW_ON + #if SHADOW_ON + half shadowA = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(_ShadowX, _ShadowY)).a; + half preMultShadowMask = 1 - (saturate(shadowA - col.a) * (1 - col.a)); + col.rgb *= 1 - ((shadowA - col.a) * (1 - col.a)); + col.rgb += (_ShadowColor * shadowA) * (1 - col.a); + col.a = max(shadowA * _ShadowAlpha * d.vertexColor.a, col.a); + #endif + + //------------------------------------------------------- + + //GLOW_ON + #if GLOW_ON + half4 emission; + #if GLOWTEX_ON + emission = SAMPLE_TEXTURE2D(_GlowTex, sampler_GlowTex, d.texcoord0); + #else + emission = col; + #endif + + col.rgb *= _GlowGlobal; + emission.rgb *= emission.a * col.a * _Glow * _GlowColor; + col.rgb += emission.rgb; + #endif + //------------------------------------------------------- + + //COLORRAMP_ON && COLORRAMPOUTLINE_ON + #if COLORRAMP_ON && COLORRAMPOUTLINE_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + luminance = saturate(luminance + _ColorRampLuminosity); + #if GRADIENTCOLORRAMP_ON + col.rgb = lerp(col.rgb, SAMPLE_TEXTURE2D(_ColorRampTexGradient, sampler_ColorRampTexGradient, half2(luminance, 0)).rgb, _ColorRampBlend); + #else + col.rgb = lerp(col.rgb, SAMPLE_TEXTURE2D(_ColorRampTex, sampler_ColorRampTex, half2(luminance, 0)).rgb, _ColorRampBlend); + #endif + #endif + //--------------- + + //GREYSCALE_ON && GREYSCALEOUTLINE_ON + #if GREYSCALE_ON && GREYSCALEOUTLINE_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + luminance = saturate(luminance + _GreyscaleLuminosity); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _GreyscaleTintColor, _GreyscaleBlend); + #endif + + //----------------------------------- + + //POSTERIZE_ON && POSTERIZEOUTLINE_ON + #if POSTERIZE_ON && POSTERIZEOUTLINE_ON + col.rgb = pow(col.rgb, _PosterizeGamma) * _PosterizeNumColors; + col.rgb = floor(col.rgb) / _PosterizeNumColors; + col.rgb = pow(col.rgb, 1.0 / _PosterizeGamma); + #endif + + //----------------------------------- + + //SHINE_ON + #if SHINE_ON + half2 uvShine = uvRect; + half cosAngle = cos(_ShineRotate); + half sinAngle = sin(_ShineRotate); + half2x2 rot = half2x2(cosAngle, -sinAngle, sinAngle, cosAngle); + uvShine -= half2(0.5, 0.5); + uvShine = mul(rot, uvShine); + uvShine += half2(0.5, 0.5); + half shineMask = SAMPLE_TEXTURE2D(_ShineMask, sampler_ShineMask, d.texcoord0.xy).a; + half currentDistanceProjection = (uvShine.x + uvShine.y) / 2; + half whitePower = 1 - (abs(currentDistanceProjection - _ShineLocation) / _ShineWidth); + col.rgb += col.a * whitePower * _ShineGlow * max(sign(currentDistanceProjection - (_ShineLocation - _ShineWidth)), 0.0) + * max(sign((_ShineLocation + _ShineWidth) - currentDistanceProjection), 0.0) * _ShineColor * shineMask; + #endif + + //----------------------------------- + + //HOLOGRAM_ON + #if HOLOGRAM_ON + half totalHologram = _HologramStripesAmount + _HologramUnmodAmount; + half hologramYCoord = ((uvRect.y + (((_Time.x + randomSeed) % 1) * _HologramStripesSpeed)) % totalHologram) / totalHologram; + hologramYCoord = abs(hologramYCoord); + half alpha = RemapFloat(saturate(hologramYCoord - (_HologramUnmodAmount/totalHologram)), 0.0, 1.0, _HologramMinAlpha, saturate(_HologramMaxAlpha)); + half hologramMask = max(sign((_HologramUnmodAmount/totalHologram) - hologramYCoord), 0.0); + half4 hologramResult = col; + hologramResult.a *= lerp(alpha, 1, hologramMask); + hologramResult.rgb *= max(1, _HologramMaxAlpha * max(sign(hologramYCoord - (_HologramUnmodAmount/totalHologram)), 0.0)); + hologramMask = 1 - step(0.01,hologramMask); + hologramResult.rgb += hologramMask * _HologramStripeColor * col.a; + col = lerp(col, hologramResult, _HologramBlend); + #endif + + //----------------------------------- + + //FLICKER_ON + #if FLICKER_ON + col.a *= saturate(col.a * step(frac(0.05 + (_Time.w + randomSeed) * _FlickerFreq), 1 - _FlickerPercent) + _FlickerAlpha); + #endif + //----------------------------------- + + //ALPHACUTOFF_ON + + //ALPHAROUND_ON + + //ALPHAOUTLINE_ON + #if ALPHAOUTLINE_ON + half alphaOutlineRes = pow(1 - col.a, max(_AlphaOutlinePower, 0.0001)) * step(_AlphaOutlineMinAlpha, col.a) * _AlphaOutlineBlend; + col.rgb = lerp(col.rgb, _AlphaOutlineColor.rgb * _AlphaOutlineGlow, alphaOutlineRes); + col.a = lerp(col.a, 1, alphaOutlineRes > 1); + #endif + //------------------------------------------------------- + + //FOG_ON + + //------------------ + + col *= _Color; + o.Albedo = col; + col.a *= _Alpha; + clip(col.a - _AlphaCutoffValue - 0.01); + o.Alpha = _Color.a; + } + + + + + + void ChainSurfaceFunction(inout Surface l, inout ShaderData d) + { + Ext_SurfaceFunction0(l, d); + // Ext_SurfaceFunction1(l, d); + // Ext_SurfaceFunction2(l, d); + // Ext_SurfaceFunction3(l, d); + // Ext_SurfaceFunction4(l, d); + // Ext_SurfaceFunction5(l, d); + // Ext_SurfaceFunction6(l, d); + // Ext_SurfaceFunction7(l, d); + // Ext_SurfaceFunction8(l, d); + // Ext_SurfaceFunction9(l, d); + // Ext_SurfaceFunction10(l, d); + // Ext_SurfaceFunction11(l, d); + // Ext_SurfaceFunction12(l, d); + // Ext_SurfaceFunction13(l, d); + // Ext_SurfaceFunction14(l, d); + // Ext_SurfaceFunction15(l, d); + // Ext_SurfaceFunction16(l, d); + // Ext_SurfaceFunction17(l, d); + // Ext_SurfaceFunction18(l, d); + // Ext_SurfaceFunction19(l, d); + // Ext_SurfaceFunction20(l, d); + // Ext_SurfaceFunction21(l, d); + // Ext_SurfaceFunction22(l, d); + // Ext_SurfaceFunction23(l, d); + // Ext_SurfaceFunction24(l, d); + // Ext_SurfaceFunction25(l, d); + // Ext_SurfaceFunction26(l, d); + // Ext_SurfaceFunction27(l, d); + // Ext_SurfaceFunction28(l, d); + // Ext_SurfaceFunction29(l, d); + } + +#if !_DECALSHADER + + void ChainModifyVertex(inout VertexData v, inout VertexToPixel v2p, float4 time) + { + ExtraV2F d; + + ZERO_INITIALIZE(ExtraV2F, d); + ZERO_INITIALIZE(Blackboard, d.blackboard); + // due to motion vectors in HDRP, we need to use the last + // time in certain spots. So if you are going to use _Time to adjust vertices, + // you need to use this time or motion vectors will break. + d.time = time; + + Ext_ModifyVertex0(v, d); + // Ext_ModifyVertex1(v, d); + // Ext_ModifyVertex2(v, d); + // Ext_ModifyVertex3(v, d); + // Ext_ModifyVertex4(v, d); + // Ext_ModifyVertex5(v, d); + // Ext_ModifyVertex6(v, d); + // Ext_ModifyVertex7(v, d); + // Ext_ModifyVertex8(v, d); + // Ext_ModifyVertex9(v, d); + // Ext_ModifyVertex10(v, d); + // Ext_ModifyVertex11(v, d); + // Ext_ModifyVertex12(v, d); + // Ext_ModifyVertex13(v, d); + // Ext_ModifyVertex14(v, d); + // Ext_ModifyVertex15(v, d); + // Ext_ModifyVertex16(v, d); + // Ext_ModifyVertex17(v, d); + // Ext_ModifyVertex18(v, d); + // Ext_ModifyVertex19(v, d); + // Ext_ModifyVertex20(v, d); + // Ext_ModifyVertex21(v, d); + // Ext_ModifyVertex22(v, d); + // Ext_ModifyVertex23(v, d); + // Ext_ModifyVertex24(v, d); + // Ext_ModifyVertex25(v, d); + // Ext_ModifyVertex26(v, d); + // Ext_ModifyVertex27(v, d); + // Ext_ModifyVertex28(v, d); + // Ext_ModifyVertex29(v, d); + + + // #if %EXTRAV2F0REQUIREKEY% + // v2p.extraV2F0 = d.extraV2F0; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // v2p.extraV2F1 = d.extraV2F1; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // v2p.extraV2F2 = d.extraV2F2; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // v2p.extraV2F3 = d.extraV2F3; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // v2p.extraV2F4 = d.extraV2F4; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // v2p.extraV2F5 = d.extraV2F5; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // v2p.extraV2F6 = d.extraV2F6; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // v2p.extraV2F7 = d.extraV2F7; + // #endif + } + + void ChainModifyTessellatedVertex(inout VertexData v, inout VertexToPixel v2p) + { + ExtraV2F d; + ZERO_INITIALIZE(ExtraV2F, d); + ZERO_INITIALIZE(Blackboard, d.blackboard); + + // #if %EXTRAV2F0REQUIREKEY% + // d.extraV2F0 = v2p.extraV2F0; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // d.extraV2F1 = v2p.extraV2F1; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // d.extraV2F2 = v2p.extraV2F2; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // d.extraV2F3 = v2p.extraV2F3; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // d.extraV2F4 = v2p.extraV2F4; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // d.extraV2F5 = v2p.extraV2F5; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // d.extraV2F6 = v2p.extraV2F6; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // d.extraV2F7 = v2p.extraV2F7; + // #endif + + + // Ext_ModifyTessellatedVertex0(v, d); + // Ext_ModifyTessellatedVertex1(v, d); + // Ext_ModifyTessellatedVertex2(v, d); + // Ext_ModifyTessellatedVertex3(v, d); + // Ext_ModifyTessellatedVertex4(v, d); + // Ext_ModifyTessellatedVertex5(v, d); + // Ext_ModifyTessellatedVertex6(v, d); + // Ext_ModifyTessellatedVertex7(v, d); + // Ext_ModifyTessellatedVertex8(v, d); + // Ext_ModifyTessellatedVertex9(v, d); + // Ext_ModifyTessellatedVertex10(v, d); + // Ext_ModifyTessellatedVertex11(v, d); + // Ext_ModifyTessellatedVertex12(v, d); + // Ext_ModifyTessellatedVertex13(v, d); + // Ext_ModifyTessellatedVertex14(v, d); + // Ext_ModifyTessellatedVertex15(v, d); + // Ext_ModifyTessellatedVertex16(v, d); + // Ext_ModifyTessellatedVertex17(v, d); + // Ext_ModifyTessellatedVertex18(v, d); + // Ext_ModifyTessellatedVertex19(v, d); + // Ext_ModifyTessellatedVertex20(v, d); + // Ext_ModifyTessellatedVertex21(v, d); + // Ext_ModifyTessellatedVertex22(v, d); + // Ext_ModifyTessellatedVertex23(v, d); + // Ext_ModifyTessellatedVertex24(v, d); + // Ext_ModifyTessellatedVertex25(v, d); + // Ext_ModifyTessellatedVertex26(v, d); + // Ext_ModifyTessellatedVertex27(v, d); + // Ext_ModifyTessellatedVertex28(v, d); + // Ext_ModifyTessellatedVertex29(v, d); + + // #if %EXTRAV2F0REQUIREKEY% + // v2p.extraV2F0 = d.extraV2F0; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // v2p.extraV2F1 = d.extraV2F1; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // v2p.extraV2F2 = d.extraV2F2; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // v2p.extraV2F3 = d.extraV2F3; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // v2p.extraV2F4 = d.extraV2F4; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // v2p.extraV2F5 = d.extraV2F5; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // v2p.extraV2F6 = d.extraV2F6; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // v2p.extraV2F7 = d.extraV2F7; + // #endif + } + + void ChainFinalColorForward(inout Surface l, inout ShaderData d, inout half4 color) + { + // Ext_FinalColorForward0(l, d, color); + // Ext_FinalColorForward1(l, d, color); + // Ext_FinalColorForward2(l, d, color); + // Ext_FinalColorForward3(l, d, color); + // Ext_FinalColorForward4(l, d, color); + // Ext_FinalColorForward5(l, d, color); + // Ext_FinalColorForward6(l, d, color); + // Ext_FinalColorForward7(l, d, color); + // Ext_FinalColorForward8(l, d, color); + // Ext_FinalColorForward9(l, d, color); + // Ext_FinalColorForward10(l, d, color); + // Ext_FinalColorForward11(l, d, color); + // Ext_FinalColorForward12(l, d, color); + // Ext_FinalColorForward13(l, d, color); + // Ext_FinalColorForward14(l, d, color); + // Ext_FinalColorForward15(l, d, color); + // Ext_FinalColorForward16(l, d, color); + // Ext_FinalColorForward17(l, d, color); + // Ext_FinalColorForward18(l, d, color); + // Ext_FinalColorForward19(l, d, color); + // Ext_FinalColorForward20(l, d, color); + // Ext_FinalColorForward21(l, d, color); + // Ext_FinalColorForward22(l, d, color); + // Ext_FinalColorForward23(l, d, color); + // Ext_FinalColorForward24(l, d, color); + // Ext_FinalColorForward25(l, d, color); + // Ext_FinalColorForward26(l, d, color); + // Ext_FinalColorForward27(l, d, color); + // Ext_FinalColorForward28(l, d, color); + // Ext_FinalColorForward29(l, d, color); + } + + void ChainFinalGBufferStandard(inout Surface s, inout ShaderData d, inout half4 GBuffer0, inout half4 GBuffer1, inout half4 GBuffer2, inout half4 outEmission, inout half4 outShadowMask) + { + // Ext_FinalGBufferStandard0(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard1(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard2(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard3(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard4(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard5(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard6(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard7(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard8(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard9(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard10(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard11(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard12(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard13(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard14(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard15(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard16(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard17(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard18(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard19(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard20(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard21(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard22(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard23(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard24(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard25(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard26(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard27(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard28(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard29(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + } +#endif + + + + + +#if _DECALSHADER + + ShaderData CreateShaderData(SurfaceDescriptionInputs IN) + { + ShaderData d = (ShaderData)0; + d.TBNMatrix = float3x3(IN.WorldSpaceTangent, IN.WorldSpaceBiTangent, IN.WorldSpaceNormal); + d.worldSpaceNormal = IN.WorldSpaceNormal; + d.worldSpaceTangent = IN.WorldSpaceTangent; + + d.worldSpacePosition = IN.WorldSpacePosition; + d.texcoord0 = IN.uv0.xyxy; + d.screenPos = IN.ScreenPosition; + + d.worldSpaceViewDir = normalize(_WorldSpaceCameraPos - d.worldSpacePosition); + + d.tangentSpaceViewDir = mul(d.TBNMatrix, d.worldSpaceViewDir); + + // these rarely get used, so we back transform them. Usually will be stripped. + #if _HDRP + // d.localSpacePosition = mul(GetWorldToObjectMatrix(), float4(GetCameraRelativePositionWS(d.worldSpacePosition), 1)).xyz; + #else + // d.localSpacePosition = mul(GetWorldToObjectMatrix(), float4(d.worldSpacePosition, 1)).xyz; + #endif + // d.localSpaceNormal = normalize(mul((float3x3)GetWorldToObjectMatrix(), d.worldSpaceNormal)); + // d.localSpaceTangent = normalize(mul((float3x3)GetWorldToObjectMatrix(), d.worldSpaceTangent.xyz)); + + // #if %SCREENPOSREQUIREKEY% + // d.screenUV = (IN.ScreenPosition.xy / max(0.01, IN.ScreenPosition.w)); + // #endif + + return d; + } +#else + + ShaderData CreateShaderData(VertexToPixel i + #if NEED_FACING + , bool facing + #endif + ) + { + ShaderData d = (ShaderData)0; + d.clipPos = i.pos; + d.worldSpacePosition = i.worldPos; + + d.worldSpaceNormal = normalize(i.worldNormal); + d.worldSpaceTangent.xyz = normalize(i.worldTangent.xyz); + + d.tangentSign = i.worldTangent.w * unity_WorldTransformParams.w; + float3 bitangent = cross(d.worldSpaceTangent.xyz, d.worldSpaceNormal) * d.tangentSign; + + d.TBNMatrix = float3x3(d.worldSpaceTangent, -bitangent, d.worldSpaceNormal); + d.worldSpaceViewDir = normalize(_WorldSpaceCameraPos - i.worldPos); + + d.tangentSpaceViewDir = mul(d.TBNMatrix, d.worldSpaceViewDir); + d.texcoord0 = i.texcoord0; + d.texcoord1 = i.texcoord1; + d.texcoord2 = i.texcoord2; + + // #if %TEXCOORD3REQUIREKEY% + d.texcoord3 = i.texcoord3; + // #endif + + // d.isFrontFace = facing; + // #if %VERTEXCOLORREQUIREKEY% + d.vertexColor = i.vertexColor; + // #endif + + // these rarely get used, so we back transform them. Usually will be stripped. + #if _HDRP + // d.localSpacePosition = mul(GetWorldToObjectMatrix(), float4(GetCameraRelativePositionWS(i.worldPos), 1)).xyz; + #else + // d.localSpacePosition = mul(GetWorldToObjectMatrix(), float4(i.worldPos, 1)).xyz; + #endif + // d.localSpaceNormal = normalize(mul((float3x3)GetWorldToObjectMatrix(), i.worldNormal)); + // d.localSpaceTangent = normalize(mul((float3x3)GetWorldToObjectMatrix(), i.worldTangent.xyz)); + + // #if %SCREENPOSREQUIREKEY% + // d.screenPos = i.screenPos; + // d.screenUV = (i.screenPos.xy / i.screenPos.w); + // #endif + + + // #if %EXTRAV2F0REQUIREKEY% + // d.extraV2F0 = i.extraV2F0; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // d.extraV2F1 = i.extraV2F1; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // d.extraV2F2 = i.extraV2F2; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // d.extraV2F3 = i.extraV2F3; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // d.extraV2F4 = i.extraV2F4; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // d.extraV2F5 = i.extraV2F5; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // d.extraV2F6 = i.extraV2F6; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // d.extraV2F7 = i.extraV2F7; + // #endif + + return d; + } + +#endif + + + #if defined(_PASSSHADOW) + float3 _LightDirection; + float3 _LightPosition; + #endif + + #if (_PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR))) + + #define GetWorldToViewMatrix() _ViewMatrix + #define UNITY_MATRIX_I_V _InvViewMatrix + #define GetViewToHClipMatrix() OptimizeProjectionMatrix(_ProjMatrix) + #define UNITY_MATRIX_I_P _InvProjMatrix + #define GetWorldToHClipMatrix() _ViewProjMatrix + #define UNITY_MATRIX_I_VP _InvViewProjMatrix + #define UNITY_MATRIX_UNJITTERED_VP _NonJitteredViewProjMatrix + #define UNITY_MATRIX_PREV_VP _PrevViewProjMatrix + #define UNITY_MATRIX_PREV_I_VP _PrevInvViewProjMatrix + + void MotionVectorPositionZBias(VertexToPixel input) + { + #if UNITY_REVERSED_Z + input.pos.z -= unity_MotionVectorsParams.z * input.pos.w; + #else + input.pos.z += unity_MotionVectorsParams.z * input.pos.w; + #endif + } + + #endif + + // vertex shader + VertexToPixel Vert (VertexData v) + { + VertexToPixel o = (VertexToPixel)0; + + UNITY_SETUP_INSTANCE_ID(v); + UNITY_TRANSFER_INSTANCE_ID(v, o); + UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o); + + + #if _URP && (_PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR))) + VertexData previousMesh = v; + #endif + #if !_TESSELLATION_ON + ChainModifyVertex(v, o, _Time); + #endif + + o.texcoord0 = v.texcoord0; + o.texcoord1 = v.texcoord1; + o.texcoord2 = v.texcoord2; + + // #if %TEXCOORD3REQUIREKEY% + o.texcoord3 = v.texcoord3; + // #endif + + // #if %VERTEXCOLORREQUIREKEY% + o.vertexColor = v.vertexColor; + // #endif + + // This return the camera relative position (if enable) + float3 positionWS = TransformObjectToWorld(v.vertex.xyz); + float3 normalWS = TransformObjectToWorldNormal(v.normal); + float4 tangentWS = float4(TransformObjectToWorldDir(v.tangent.xyz), v.tangent.w); + + VertexPositionInputs vertexInput = GetVertexPositionInputs(v.vertex.xyz); + o.worldPos = positionWS; + o.worldNormal = normalWS; + o.worldTangent = tangentWS; + + + // For some very odd reason, in 2021.2, we can't use Unity's defines, but have to use our own.. + #if _PASSSHADOW + #if _CASTING_PUNCTUAL_LIGHT_SHADOW + float3 lightDirectionWS = normalize(_LightPosition - o.worldPos); + #else + float3 lightDirectionWS = _LightDirection; + #endif + // Define shadow pass specific clip position for Universal + o.pos = TransformWorldToHClip(ApplyShadowBias(o.worldPos, o.worldNormal, lightDirectionWS)); + #if UNITY_REVERSED_Z + o.pos.z = min(o.pos.z, UNITY_NEAR_CLIP_VALUE); + #else + o.pos.z = max(o.pos.z, UNITY_NEAR_CLIP_VALUE); + #endif + #elif _PASSMETA + o.pos = MetaVertexPosition(float4(v.vertex.xyz, 0), v.texcoord1.xy, v.texcoord2.xy, unity_LightmapST, unity_DynamicLightmapST); + #else + o.pos = TransformWorldToHClip(o.worldPos); + #endif + + // #if %SCREENPOSREQUIREKEY% + // o.screenPos = ComputeScreenPos(o.pos, _ProjectionParams.x); + // #endif + + + #if _PASSFORWARD || _PASSGBUFFER + float2 uv1 = v.texcoord1.xy; + OUTPUT_LIGHTMAP_UV(uv1, unity_LightmapST, o.lightmapUV); + o.texcoord1.xy = uv1; + #if UNITY_VERSION < 60000009 + OUTPUT_SH(o.worldNormal, o.sh); + #endif + + #if defined(DYNAMICLIGHTMAP_ON) + o.dynamicLightmapUV.xy = v.texcoord2.xy * unity_DynamicLightmapST.xy + unity_DynamicLightmapST.zw; + #if UNITY_VERSION >= 60000009 + OUTPUT_SH(o.worldNormal, o.sh); + #endif + #elif (defined(PROBE_VOLUMES_L1) || defined(PROBE_VOLUMES_L2)) && UNITY_VERSION >= 60000009 + OUTPUT_SH4(vertexInput.positionWS, o.worldNormal.xyz, GetWorldSpaceNormalizeViewDir(vertexInput.positionWS), o.sh, o.probeOcclusion); + #endif + #endif + + #ifdef VARYINGS_NEED_FOG_AND_VERTEX_LIGHT + half fogFactor = 0; + #if defined(_FOG_FRAGMENT) + fogFactor = ComputeFogFactor(o.pos.z); + #endif + #if _BAKEDLIT + o.fogFactorAndVertexLight = half4(fogFactor, 0, 0, 0); + #else + half3 vertexLight = VertexLighting(o.worldPos, o.worldNormal); + o.fogFactorAndVertexLight = half4(fogFactor, vertexLight); + #endif + #endif + + #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR) + o.shadowCoord = GetShadowCoord(vertexInput); + #endif + + #if _URP && (_PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR))) + #if !defined(TESSELLATION_ON) + MotionVectorPositionZBias(o); + #endif + + o.previousPositionCS = float4(0.0, 0.0, 0.0, 1.0); + // Note: unity_MotionVectorsParams.y is 0 is forceNoMotion is enabled + bool forceNoMotion = unity_MotionVectorsParams.y == 0.0; + + if (!forceNoMotion) + { + #if defined(HAVE_VFX_MODIFICATION) + float3 previousPositionOS = currentFrameMvData.vfxParticlePositionOS; + #if defined(VFX_FEATURE_MOTION_VECTORS_VERTS) + const bool applyDeformation = false; + #else + const bool applyDeformation = true; + #endif + #else + const bool hasDeformation = unity_MotionVectorsParams.x == 1; // Mesh has skinned deformation + float3 previousPositionOS = hasDeformation ? previousMesh.previousPositionOS : previousMesh.vertex.xyz; + + #if defined(AUTOMATIC_TIME_BASED_MOTION_VECTORS) && defined(GRAPH_VERTEX_USES_TIME_PARAMETERS_INPUT) + const bool applyDeformation = true; + #else + const bool applyDeformation = hasDeformation; + #endif + #endif + // TODO + #if defined(FEATURES_GRAPH_VERTEX) + if (applyDeformation) + previousPositionOS = GetLastFrameDeformedPosition(previousMesh, currentFrameMvData, previousPositionOS); + else + previousPositionOS = previousMesh.positionOS; + + #if defined(FEATURES_GRAPH_VERTEX_MOTION_VECTOR_OUTPUT) + previousPositionOS -= previousMesh.precomputedVelocity; + #endif + #endif + + #if defined(UNITY_DOTS_INSTANCING_ENABLED) && defined(DOTS_DEFORMED) + // Deformed vertices in DOTS are not cumulative with built-in Unity skinning/blend shapes + // Needs to be called after vertex modification has been applied otherwise it will be + // overwritten by Compute Deform node + ApplyPreviousFrameDeformedVertexPosition(previousMesh.vertexID, previousPositionOS); + #endif + #if defined (_ADD_PRECOMPUTED_VELOCITY) + previousPositionOS -= previousMesh.precomputedVelocity; + #endif + o.positionCS = mul(UNITY_MATRIX_UNJITTERED_VP, float4(positionWS, 1.0f)); + + #if defined(HAVE_VFX_MODIFICATION) + #if defined(VFX_FEATURE_MOTION_VECTORS_VERTS) + #if defined(FEATURES_GRAPH_VERTEX_MOTION_VECTOR_OUTPUT) || defined(_ADD_PRECOMPUTED_VELOCITY) + #error Unexpected fast path rendering VFX motion vector while there are vertex modification afterwards. + #endif + o.previousPositionCS = VFXGetPreviousClipPosition(previousMesh, currentFrameMvData.vfxElementAttributes, o.positionCS); + #else + #if VFX_WORLD_SPACE + //previousPositionOS is already in world space + const float3 previousPositionWS = previousPositionOS; + #else + const float3 previousPositionWS = mul(UNITY_PREV_MATRIX_M, float4(previousPositionOS, 1.0f)).xyz; + #endif + o.previousPositionCS = mul(UNITY_MATRIX_PREV_VP, float4(previousPositionWS, 1.0f)); + #endif + #else + o.previousPositionCS = mul(UNITY_MATRIX_PREV_VP, mul(UNITY_PREV_MATRIX_M, float4(previousPositionOS, 1))); + #endif + } + #endif + + return o; + } + + + + + // fragment shader + half4 Frag (VertexToPixel IN + #ifdef _DEPTHOFFSET_ON + , out float outputDepth : SV_Depth + #endif + #if NEED_FACING + , bool facing : SV_IsFrontFace + #endif + ) : SV_Target + { + UNITY_SETUP_INSTANCE_ID(IN); + + #if defined(LOD_FADE_CROSSFADE) + LODFadeCrossFade(IN.pos); + #endif + + ShaderData d = CreateShaderData(IN + #if NEED_FACING + , facing + #endif + ); + Surface l = (Surface)0; + + #ifdef _DEPTHOFFSET_ON + l.outputDepth = outputDepth; + #endif + + l.Albedo = half3(0.5, 0.5, 0.5); + l.Normal = float3(0,0,1); + l.Occlusion = 1; + l.Alpha = 1; + + ChainSurfaceFunction(l, d); + + #ifdef _DEPTHOFFSET_ON + outputDepth = l.outputDepth; + #endif + + return 0; + + } + + ENDHLSL + + } + + + + Pass + { + Name "DepthOnly" + Tags + { + "LightMode" = "DepthOnly" + } + + // Render State + Blend One Zero, One Zero + Cull Back + ZTest LEqual + ZWrite On + ColorMask 0 + + Tags { "RenderType" = "Opaque" "Queue" = "Geometry" "PreviewType" = "Plane" } + Cull [_CullingOption] + ZWrite [_ZWrite] + ZTest [_ZTestMode] + + + HLSLPROGRAM + + #pragma vertex Vert + #pragma fragment Frag + + + #define _PASSDEPTH 1 + + #pragma target 3.0 + #pragma prefer_hlslcc gles + #pragma exclude_renderers d3d11_9x + #pragma multi_compile_instancing + + + #pragma shader_feature_local GLOW_ON + #pragma shader_feature_local FADE_ON + #pragma shader_feature_local OUTBASE_ON + #pragma shader_feature_local ONLYOUTLINE_ON + #pragma shader_feature_local GRADIENT_ON + #pragma shader_feature_local GRADIENT2COL_ON + #pragma shader_feature_local RADIALGRADIENT_ON + #pragma shader_feature_local COLORSWAP_ON + #pragma shader_feature_local HSV_ON + #pragma shader_feature_local CHANGECOLOR_ON + #pragma shader_feature_local CHANGECOLOR2_ON + #pragma shader_feature_local CHANGECOLOR3_ON + #pragma shader_feature_local COLORRAMP_ON + #pragma shader_feature_local GRADIENTCOLORRAMP_ON + #pragma shader_feature_local HITEFFECT_ON + #pragma shader_feature_local NEGATIVE_ON + #pragma shader_feature_local PIXELATE_ON + #pragma shader_feature_local GREYSCALE_ON + #pragma shader_feature_local POSTERIZE_ON + #pragma shader_feature_local BLUR_ON + #pragma shader_feature_local MOTIONBLUR_ON + #pragma shader_feature_local GHOST_ON + #pragma shader_feature_local ALPHAOUTLINE_ON + #pragma shader_feature_local INNEROUTLINE_ON + #pragma shader_feature_local ONLYINNEROUTLINE_ON + #pragma shader_feature_local HOLOGRAM_ON + #pragma shader_feature_local CHROMABERR_ON + #pragma shader_feature_local GLITCH_ON + #pragma shader_feature_local FLICKER_ON + #pragma shader_feature_local SHADOW_ON + #pragma shader_feature_local SHINE_ON + #pragma shader_feature_local CONTRAST_ON + #pragma shader_feature_local OVERLAY_ON + #pragma shader_feature_local OVERLAYMULT_ON + #pragma shader_feature_local DOODLE_ON + #pragma shader_feature_local WIND_ON + #pragma shader_feature_local WAVEUV_ON + #pragma shader_feature_local ROUNDWAVEUV_ON + #pragma shader_feature_local RECTSIZE_ON + #pragma shader_feature_local OFFSETUV_ON + #pragma shader_feature_local CLIPPING_ON + #pragma shader_feature_local RADIALCLIPPING_ON + #pragma shader_feature_local TEXTURESCROLL_ON + #pragma shader_feature_local ZOOMUV_ON + #pragma shader_feature_local DISTORT_ON + #pragma shader_feature_local WARP_ON + #pragma shader_feature_local TWISTUV_ON + #pragma shader_feature_local ROTATEUV_ON + #pragma shader_feature_local POLARUV_ON + #pragma shader_feature_local FISHEYE_ON + #pragma shader_feature_local PINCH_ON + #pragma shader_feature_local SHAKEUV_ON + + #pragma shader_feature_local GLOWTEX_ON + #pragma shader_feature_local OUTTEX_ON + #pragma shader_feature_local OUTDIST_ON + #pragma shader_feature_local OUTBASE8DIR_ON + #pragma shader_feature_local OUTBASEPIXELPERF_ON + #pragma shader_feature_local COLORRAMPOUTLINE_ON + #pragma shader_feature_local GREYSCALEOUTLINE_ON + #pragma shader_feature_local POSTERIZEOUTLINE_ON + #pragma shader_feature_local BLURISHD_ON + #pragma shader_feature_local MANUALWIND_ON + #pragma shader_feature_local ATLAS_ON + #pragma shader_feature_local PREMULTIPLYALPHA_ON + + #pragma shader_feature BILBOARD_ON + #pragma shader_feature BILBOARDY_ON + + #pragma shader_feature NORMALMAP_ON + + + #define _URP 1 +#define _USINGTEXCOORD1 1 +#define _USINGTEXCOORD2 1 + + // Includes + //#include_with_pragmas "Packages/com.unity.render-pipelines.universal/ShaderLibrary/DOTS.hlsl" + #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.universal/ShaderLibrary/Input.hlsl" + #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/TextureStack.hlsl" + #include_with_pragmas "Packages/com.unity.render-pipelines.core/ShaderLibrary/FoveatedRenderingKeywords.hlsl" + #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/ShaderGraphFunctions.hlsl" + #include "Packages/com.unity.render-pipelines.universal/Editor/ShaderGraph/Includes/ShaderPass.hlsl" + + + #undef WorldNormalVector + #define WorldNormalVector(data, normal) mul(normal, data.TBNMatrix) + + #define UnityObjectToWorldNormal(normal) mul(GetObjectToWorldMatrix(), normal) + + #define _WorldSpaceLightPos0 _MainLightPosition + + #define UNITY_DECLARE_TEX2D(name) TEXTURE2D(name); SAMPLER(sampler##name); + #define UNITY_DECLARE_TEX2D_NOSAMPLER(name) TEXTURE2D(name); + #define UNITY_DECLARE_TEX2DARRAY(name) TEXTURE2D_ARRAY(name); SAMPLER(sampler##name); + #define UNITY_DECLARE_TEX2DARRAY_NOSAMPLER(name) TEXTURE2D_ARRAY(name); + + #define UNITY_SAMPLE_TEX2DARRAY(tex,coord) SAMPLE_TEXTURE2D_ARRAY(tex, sampler##tex, coord.xy, coord.z) + #define UNITY_SAMPLE_TEX2DARRAY_LOD(tex,coord,lod) SAMPLE_TEXTURE2D_ARRAY_LOD(tex, sampler##tex, coord.xy, coord.z, lod) + #define UNITY_SAMPLE_TEX2D(tex, coord) SAMPLE_TEXTURE2D(tex, sampler##tex, coord) + #define UNITY_SAMPLE_TEX2D_SAMPLER(tex, samp, coord) SAMPLE_TEXTURE2D(tex, sampler##samp, coord) + + #define UNITY_SAMPLE_TEX2D_LOD(tex,coord, lod) SAMPLE_TEXTURE2D_LOD(tex, sampler_##tex, coord, lod) + #define UNITY_SAMPLE_TEX2D_SAMPLER_LOD(tex,samplertex,coord, lod) SAMPLE_TEXTURE2D_LOD (tex, sampler##samplertex,coord, lod) + + #if defined(UNITY_COMPILER_HLSL) + #define UNITY_INITIALIZE_OUTPUT(type,name) name = (type)0; + #else + #define UNITY_INITIALIZE_OUTPUT(type,name) + #endif + + #define sampler2D_float sampler2D + #define sampler2D_half sampler2D + + + + // data across stages, stripped like the above. + struct VertexToPixel + { + float4 pos : SV_POSITION; + float3 worldPos : TEXCOORD0; + float3 worldNormal : TEXCOORD1; + float4 worldTangent : TEXCOORD2; + float4 texcoord0 : TEXCOORD3; + float4 texcoord1 : TEXCOORD4; + float4 texcoord2 : TEXCOORD5; + + // #if %TEXCOORD3REQUIREKEY% + float4 texcoord3 : TEXCOORD6; + // #endif + + // #if %SCREENPOSREQUIREKEY% + // float4 screenPos : TEXCOORD7; + // #endif + + // #if %VERTEXCOLORREQUIREKEY% + half4 vertexColor : COLOR; + // #endif + + #if defined(LIGHTMAP_ON) + float2 lightmapUV : TEXCOORD8; + #endif + #if defined(DYNAMICLIGHTMAP_ON) + float2 dynamicLightmapUV : TEXCOORD9; + #endif + #if !defined(LIGHTMAP_ON) + float4 probeOcclusion : TEXCOORD8; + float3 sh : TEXCOORD10; + #endif + + #if defined(VARYINGS_NEED_FOG_AND_VERTEX_LIGHT) + float4 fogFactorAndVertexLight : TEXCOORD11; + #endif + + #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR) + float4 shadowCoord : TEXCOORD12; + #endif + + // #if %EXTRAV2F0REQUIREKEY% + // float4 extraV2F0 : TEXCOORD13; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // float4 extraV2F1 : TEXCOORD14; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // float4 extraV2F2 : TEXCOORD15; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // float4 extraV2F3 : TEXCOORD16; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // float4 extraV2F4 : TEXCOORD17; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // float4 extraV2F5 : TEXCOORD18; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // float4 extraV2F6 : TEXCOORD19; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // float4 extraV2F7 : TEXCOORD20; + // #endif + + #if UNITY_ANY_INSTANCING_ENABLED + uint instanceID : CUSTOM_INSTANCE_ID; + #endif + #if (defined(UNITY_STEREO_MULTIVIEW_ENABLED)) || (defined(UNITY_STEREO_INSTANCING_ENABLED) && (defined(SHADER_API_GLES3) || defined(SHADER_API_GLCORE))) + uint stereoTargetEyeIndexAsBlendIdx0 : BLENDINDICES0; + #endif + #if (defined(UNITY_STEREO_INSTANCING_ENABLED)) + uint stereoTargetEyeIndexAsRTArrayIdx : SV_RenderTargetArrayIndex; + #endif + #if defined(SHADER_STAGE_FRAGMENT) && defined(VARYINGS_NEED_CULLFACE) + FRONT_FACE_TYPE cullFace : FRONT_FACE_SEMANTIC; + #endif + + #if _PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR)) + float4 previousPositionCS : TEXCOORD21; // Contain previous transform position (in case of skinning for example) + float4 positionCS : TEXCOORD22; + #endif + }; + + + + + // data describing the user output of a pixel + struct Surface + { + half3 Albedo; + half Height; + half3 Normal; + half Smoothness; + half3 Emission; + half Metallic; + half3 Specular; + half Occlusion; + half SpecularPower; // for simple lighting + half Alpha; + float outputDepth; // if written, SV_Depth semantic is used. ShaderData.clipPos.z is unused value + // HDRP Only + half SpecularOcclusion; + half SubsurfaceMask; + half Thickness; + half CoatMask; + half CoatSmoothness; + half Anisotropy; + half IridescenceMask; + half IridescenceThickness; + int DiffusionProfileHash; + float SpecularAAThreshold; + float SpecularAAScreenSpaceVariance; + // requires _OVERRIDE_BAKEDGI to be defined, but is mapped in all pipelines + float3 DiffuseGI; + float3 BackDiffuseGI; + float3 SpecularGI; + float ior; + float3 transmittanceColor; + float atDistance; + float transmittanceMask; + // requires _OVERRIDE_SHADOWMASK to be defines + float4 ShadowMask; + + // for decals + float NormalAlpha; + float MAOSAlpha; + + + }; + + // Data the user declares in blackboard blocks + struct Blackboard + { + + float blackboardDummyData; + }; + + // data the user might need, this will grow to be big. But easy to strip + struct ShaderData + { + float4 clipPos; // SV_POSITION + float3 localSpacePosition; + float3 localSpaceNormal; + float3 localSpaceTangent; + + float3 worldSpacePosition; + float3 worldSpaceNormal; + float3 worldSpaceTangent; + float tangentSign; + + float3 worldSpaceViewDir; + float3 tangentSpaceViewDir; + + float4 texcoord0; + float4 texcoord1; + float4 texcoord2; + float4 texcoord3; + + float2 screenUV; + float4 screenPos; + + float4 vertexColor; + bool isFrontFace; + + float4 extraV2F0; + float4 extraV2F1; + float4 extraV2F2; + float4 extraV2F3; + float4 extraV2F4; + float4 extraV2F5; + float4 extraV2F6; + float4 extraV2F7; + + float3x3 TBNMatrix; + Blackboard blackboard; + }; + + struct VertexData + { + #if SHADER_TARGET > 30 + // uint vertexID : SV_VertexID; + #endif + float4 vertex : POSITION; + float3 normal : NORMAL; + float4 tangent : TANGENT; + float4 texcoord0 : TEXCOORD0; + + // optimize out mesh coords when not in use by user or lighting system + #if _URP && (_USINGTEXCOORD1 || _PASSMETA || _PASSFORWARD || _PASSGBUFFER) + float4 texcoord1 : TEXCOORD1; + #endif + + #if _URP && (_USINGTEXCOORD2 || _PASSMETA || ((_PASSFORWARD || _PASSGBUFFER) && defined(DYNAMICLIGHTMAP_ON))) + float4 texcoord2 : TEXCOORD2; + #endif + + #if _STANDARD && (_USINGTEXCOORD1 || (_PASSMETA || ((_PASSFORWARD || _PASSGBUFFER || _PASSFORWARDADD) && LIGHTMAP_ON))) + float4 texcoord1 : TEXCOORD1; + #endif + #if _STANDARD && (_USINGTEXCOORD2 || (_PASSMETA || ((_PASSFORWARD || _PASSGBUFFER) && DYNAMICLIGHTMAP_ON))) + float4 texcoord2 : TEXCOORD2; + #endif + + + #if _HDRP + float4 texcoord1 : TEXCOORD1; + float4 texcoord2 : TEXCOORD2; + #endif + + // #if %TEXCOORD3REQUIREKEY% + float4 texcoord3 : TEXCOORD3; + // #endif + + // #if %VERTEXCOLORREQUIREKEY% + float4 vertexColor : COLOR; + // #endif + + #if _PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR)) + float3 previousPositionOS : TEXCOORD4; // Contain previous transform position (in case of skinning for example) + #if defined (_ADD_PRECOMPUTED_VELOCITY) + float3 precomputedVelocity : TEXCOORD5; // Add Precomputed Velocity (Alembic computes velocities on runtime side). + #endif + #endif + + UNITY_VERTEX_INPUT_INSTANCE_ID + }; + + struct TessVertex + { + float4 vertex : INTERNALTESSPOS; + float3 normal : NORMAL; + float4 tangent : TANGENT; + float4 texcoord0 : TEXCOORD0; + float4 texcoord1 : TEXCOORD1; + float4 texcoord2 : TEXCOORD2; + + // #if %TEXCOORD3REQUIREKEY% + float4 texcoord3 : TEXCOORD3; + // #endif + + // #if %VERTEXCOLORREQUIREKEY% + float4 vertexColor : COLOR; + // #endif + + // #if %EXTRAV2F0REQUIREKEY% + // float4 extraV2F0 : TEXCOORD5; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // float4 extraV2F1 : TEXCOORD6; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // float4 extraV2F2 : TEXCOORD7; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // float4 extraV2F3 : TEXCOORD8; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // float4 extraV2F4 : TEXCOORD9; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // float4 extraV2F5 : TEXCOORD10; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // float4 extraV2F6 : TEXCOORD11; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // float4 extraV2F7 : TEXCOORD12; + // #endif + + #if _PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR)) + float3 previousPositionOS : TEXCOORD13; // Contain previous transform position (in case of skinning for example) + #if defined (_ADD_PRECOMPUTED_VELOCITY) + float3 precomputedVelocity : TEXCOORD14; + #endif + #endif + + UNITY_VERTEX_INPUT_INSTANCE_ID + UNITY_VERTEX_OUTPUT_STEREO + }; + + struct ExtraV2F + { + float4 extraV2F0; + float4 extraV2F1; + float4 extraV2F2; + float4 extraV2F3; + float4 extraV2F4; + float4 extraV2F5; + float4 extraV2F6; + float4 extraV2F7; + Blackboard blackboard; + float4 time; + }; + + + float3 WorldToTangentSpace(ShaderData d, float3 normal) + { + return mul(d.TBNMatrix, normal); + } + + float3 TangentToWorldSpace(ShaderData d, float3 normal) + { + return mul(normal, d.TBNMatrix); + } + + // in this case, make standard more like SRPs, because we can't fix + // unity_WorldToObject in HDRP, since it already does macro-fu there + + #if _STANDARD + float3 TransformWorldToObject(float3 p) { return mul(unity_WorldToObject, float4(p, 1)); }; + float3 TransformObjectToWorld(float3 p) { return mul(unity_ObjectToWorld, float4(p, 1)); }; + float4 TransformWorldToObject(float4 p) { return mul(unity_WorldToObject, p); }; + float4 TransformObjectToWorld(float4 p) { return mul(unity_ObjectToWorld, p); }; + float4x4 GetWorldToObjectMatrix() { return unity_WorldToObject; } + float4x4 GetObjectToWorldMatrix() { return unity_ObjectToWorld; } + #if (defined(SHADER_API_D3D11) || defined(SHADER_API_XBOXONE) || defined(UNITY_COMPILER_HLSLCC) || defined(SHADER_API_PSSL) || (SHADER_TARGET_SURFACE_ANALYSIS && !SHADER_TARGET_SURFACE_ANALYSIS_MOJOSHADER)) + #define UNITY_SAMPLE_TEX2D_LOD(tex,coord, lod) tex.SampleLevel (sampler##tex,coord, lod) + #define UNITY_SAMPLE_TEX2D_SAMPLER_LOD(tex,samplertex,coord, lod) tex.SampleLevel (sampler##samplertex,coord, lod) + #else + #define UNITY_SAMPLE_TEX2D_LOD(tex,coord,lod) tex2D (tex,coord,0,lod) + #define UNITY_SAMPLE_TEX2D_SAMPLER_LOD(tex,samplertex,coord,lod) tex2D (tex,coord,0,lod) + #endif + + #undef GetWorldToObjectMatrix() + + #define GetWorldToObjectMatrix() unity_WorldToObject + + + #endif + + float3 GetCameraWorldPosition() + { + #if _HDRP + return GetCameraRelativePositionWS(_WorldSpaceCameraPos); + #else + return _WorldSpaceCameraPos; + #endif + } + + #if _GRABPASSUSED + #if _STANDARD + TEXTURE2D(%GRABTEXTURE%); + SAMPLER(sampler_%GRABTEXTURE%); + #endif + + half3 GetSceneColor(float2 uv) + { + #if _STANDARD + return SAMPLE_TEXTURE2D(%GRABTEXTURE%, sampler_%GRABTEXTURE%, uv).rgb; + #else + return SHADERGRAPH_SAMPLE_SCENE_COLOR(uv); + #endif + } + #endif + + + + #if _STANDARD + UNITY_DECLARE_DEPTH_TEXTURE(_CameraDepthTexture); + float GetSceneDepth(float2 uv) { return SAMPLE_DEPTH_TEXTURE(_CameraDepthTexture, uv); } + float GetLinear01Depth(float2 uv) { return Linear01Depth(GetSceneDepth(uv)); } + float GetLinearEyeDepth(float2 uv) { return LinearEyeDepth(GetSceneDepth(uv)); } + #else + float GetSceneDepth(float2 uv) { return SHADERGRAPH_SAMPLE_SCENE_DEPTH(uv); } + float GetLinear01Depth(float2 uv) { return Linear01Depth(GetSceneDepth(uv), _ZBufferParams); } + float GetLinearEyeDepth(float2 uv) { return LinearEyeDepth(GetSceneDepth(uv), _ZBufferParams); } + #endif + + float3 GetWorldPositionFromDepthBuffer(float2 uv, float3 worldSpaceViewDir) + { + float eye = GetLinearEyeDepth(uv); + float3 camView = mul((float3x3)GetObjectToWorldMatrix(), transpose(mul(GetWorldToObjectMatrix(), UNITY_MATRIX_I_V)) [2].xyz); + + float dt = dot(worldSpaceViewDir, camView); + float3 div = worldSpaceViewDir/dt; + float3 wpos = (eye * div) + GetCameraWorldPosition(); + return wpos; + } + + #if _HDRP + float3 ObjectToWorldSpacePosition(float3 pos) + { + return GetAbsolutePositionWS(TransformObjectToWorld(pos)); + } + #else + float3 ObjectToWorldSpacePosition(float3 pos) + { + return TransformObjectToWorld(pos); + } + #endif + + #if _STANDARD + UNITY_DECLARE_SCREENSPACE_TEXTURE(_CameraDepthNormalsTexture); + float3 GetSceneNormal(float2 uv, float3 worldSpaceViewDir) + { + float4 depthNorms = UNITY_SAMPLE_SCREENSPACE_TEXTURE(_CameraDepthNormalsTexture, uv); + float3 norms = DecodeViewNormalStereo(depthNorms); + norms = mul((float3x3)GetWorldToViewMatrix(), norms) * 0.5 + 0.5; + return norms; + } + #elif _HDRP && !_DECALSHADER + + float3 GetSceneNormal(float2 uv, float3 worldSpaceViewDir) + { + NormalData nd; + DecodeFromNormalBuffer(_ScreenSize.xy * uv, nd); + return nd.normalWS; + } + #elif _URP + #if (SHADER_LIBRARY_VERSION_MAJOR >= 10) + #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/DeclareNormalsTexture.hlsl" + #endif + + float3 GetSceneNormal(float2 uv, float3 worldSpaceViewDir) + { + #if (SHADER_LIBRARY_VERSION_MAJOR >= 10) + return SampleSceneNormals(uv); + #else + float3 wpos = GetWorldPositionFromDepthBuffer(uv, worldSpaceViewDir); + return normalize(-cross(ddx(wpos), ddy(wpos))) * 0.5 + 0.5; + #endif + + } + #endif + + #if _HDRP + + half3 UnpackNormalmapRGorAG(half4 packednormal) + { + // This do the trick + packednormal.x *= packednormal.w; + + half3 normal; + normal.xy = packednormal.xy * 2 - 1; + normal.z = sqrt(1 - saturate(dot(normal.xy, normal.xy))); + return normal; + } + half3 UnpackNormal(half4 packednormal) + { + #if defined(UNITY_NO_DXT5nm) + return packednormal.xyz * 2 - 1; + #else + return UnpackNormalmapRGorAG(packednormal); + #endif + } + #endif + #if _HDRP || _URP + + half3 UnpackScaleNormal(half4 packednormal, half scale) + { + #ifndef UNITY_NO_DXT5nm + // Unpack normal as DXT5nm (1, y, 1, x) or BC5 (x, y, 0, 1) + // Note neutral texture like "bump" is (0, 0, 1, 1) to work with both plain RGB normal and DXT5nm/BC5 + packednormal.x *= packednormal.w; + #endif + half3 normal; + normal.xy = (packednormal.xy * 2 - 1) * scale; + normal.z = sqrt(1 - saturate(dot(normal.xy, normal.xy))); + return normal; + } + + #endif + + + void GetSun(out float3 lightDir, out float3 color) + { + lightDir = float3(0.5, 0.5, 0); + color = 1; + #if _HDRP + if (_DirectionalLightCount > 0) + { + DirectionalLightData light = _DirectionalLightDatas[0]; + lightDir = -light.forward.xyz; + color = light.color; + } + #elif _STANDARD + lightDir = normalize(_WorldSpaceLightPos0.xyz); + color = _LightColor0.rgb; + #elif _URP + Light light = GetMainLight(); + lightDir = light.direction; + color = light.color; + #endif + } + + + + CBUFFER_START(UnityPerMaterial) + + + half4 _Color; + half4 _MainTex_ST, _MainTex_TexelSize; + half _Alpha, _AlphaCutoffValue; + + #if ATLAS_ON + half _MinXUV, _MaxXUV, _MinYUV, _MaxYUV; + #endif + + #if GLOW_ON + half4 _GlowColor; + half _Glow, _GlowGlobal; + #endif + + #if HSV_ON + half _HsvShift, _HsvSaturation, _HsvBright; + #endif + + #if DISTORT_ON + half4 _DistortTex_ST; + half _DistortTexXSpeed, _DistortTexYSpeed, _DistortAmount; + #endif + + #if FADE_ON + half4 _FadeBurnColor, _FadeTex_ST, _FadeBurnTex_ST; + half _FadeAmount, _FadeBurnWidth, _FadeBurnTransition,_FadeBurnGlow; + #endif + + #if OUTBASE_ON + half4 _OutlineColor; + half _OutlineAlpha, _OutlineGlow, _OutlineWidth; + int _OutlinePixelWidth; + #endif + + #if OUTTEX_ON + half4 _OutlineTex_ST; + half _OutlineTexXSpeed, _OutlineTexYSpeed; + #endif + + #if OUTDIST_ON + half4 _OutlineDistortTex_ST; + half _OutlineDistortTexXSpeed, _OutlineDistortTexYSpeed, _OutlineDistortAmount; + #endif + + #if ALPHAOUTLINE_ON + half _AlphaOutlineGlow, _AlphaOutlinePower, _AlphaOutlineMinAlpha, _AlphaOutlineBlend; + half4 _AlphaOutlineColor; + #endif + + #if INNEROUTLINE_ON + half _InnerOutlineThickness, _InnerOutlineAlpha, _InnerOutlineGlow; + half4 _InnerOutlineColor; + #endif + + #if GRADIENT_ON + half _GradBlend, _GradBoostX, _GradBoostY; + half4 _GradTopRightCol, _GradTopLeftCol, _GradBotRightCol, _GradBotLeftCol; + #endif + + #if COLORSWAP_ON + half4 _ColorSwapRed, _ColorSwapGreen, _ColorSwapBlue; + half _ColorSwapRedLuminosity, _ColorSwapGreenLuminosity, _ColorSwapBlueLuminosity, _ColorSwapBlend; + #endif + + #if CHANGECOLOR_ON + half4 _ColorChangeNewCol, _ColorChangeTarget; + half _ColorChangeTolerance, _ColorChangeLuminosity; + #endif + #if CHANGECOLOR2_ON + half4 _ColorChangeNewCol2, _ColorChangeTarget2; + half _ColorChangeTolerance2; + #endif + #if CHANGECOLOR3_ON + half4 _ColorChangeNewCol3, _ColorChangeTarget3; + half _ColorChangeTolerance3; + #endif + + #if COLORRAMP_ON + half _ColorRampLuminosity, _ColorRampBlend; + #endif + + #if HITEFFECT_ON + half4 _HitEffectColor; + half _HitEffectGlow, _HitEffectBlend; + #endif + + #if NEGATIVE_ON + half _NegativeAmount; + #endif + + #if PIXELATE_ON + half _PixelateSize; + #endif + + #if GREYSCALE_ON + half _GreyscaleLuminosity, _GreyscaleBlend; + half4 _GreyscaleTintColor; + #endif + + #if POSTERIZE_ON + half _PosterizeNumColors, _PosterizeGamma; + #endif + + #if BLUR_ON + half _BlurIntensity; + #endif + + #if MOTIONBLUR_ON + half _MotionBlurAngle, _MotionBlurDist; + #endif + + #if GHOST_ON + half _GhostColorBoost, _GhostTransparency, _GhostBlend; + #endif + + #if HOLOGRAM_ON + half _HologramStripesAmount, _HologramMinAlpha, _HologramUnmodAmount, _HologramStripesSpeed, _HologramMaxAlpha, _HologramBlend; + half4 _HologramStripeColor; + #endif + + #if CHROMABERR_ON + half _ChromAberrAmount, _ChromAberrAlpha; + #endif + + #if GLITCH_ON + half _GlitchAmount, _GlitchSize; + #endif + + #if FLICKER_ON + half _FlickerFreq, _FlickerPercent, _FlickerAlpha; + #endif + + #if SHADOW_ON + half _ShadowX, _ShadowY, _ShadowAlpha; + half4 _ShadowColor; + #endif + + #if SHINE_ON + half4 _ShineColor; + half _ShineLocation, _ShineRotate, _ShineWidth, _ShineGlow; + #endif + + #if CONTRAST_ON + half _Contrast, _Brightness; + #endif + + #if OVERLAY_ON + half4 _OverlayTex_ST, _OverlayColor; + half _OverlayGlow, _OverlayBlend, _OverlayTextureScrollXSpeed, _OverlayTextureScrollYSpeed; + #endif + + #if DOODLE_ON + half _HandDrawnAmount, _HandDrawnSpeed; + #endif + + #if WIND_ON + half _GrassSpeed, _GrassWind, _GrassManualAnim, _GrassRadialBend; + #endif + + #if WAVEUV_ON + float _WaveAmount, _WaveSpeed, _WaveStrength, _WaveX, _WaveY; + #endif + + #if ROUNDWAVEUV_ON + half _RoundWaveStrength, _RoundWaveSpeed; + #endif + + #if RECTSIZE_ON + half _RectSize; + #endif + + #if OFFSETUV_ON + half _OffsetUvX, _OffsetUvY; + #endif + + #if CLIPPING_ON + half _ClipUvLeft, _ClipUvRight, _ClipUvUp, _ClipUvDown; + #endif + + #if RADIALCLIPPING_ON + half _RadialStartAngle, _RadialClip, _RadialClip2; + #endif + + #if TEXTURESCROLL_ON + half _TextureScrollXSpeed, _TextureScrollYSpeed; + #endif + + #if ZOOMUV_ON + half _ZoomUvAmount; + #endif + + #if WARP_ON + half _WarpStrength, _WarpSpeed, _WarpScale; + #endif + + #if TWISTUV_ON + half _TwistUvAmount, _TwistUvPosX, _TwistUvPosY, _TwistUvRadius; + #endif + + #if ROTATEUV_ON + half _RotateUvAmount; + #endif + + #if FISHEYE_ON + half _FishEyeUvAmount; + #endif + + #if PINCH_ON + half _PinchUvAmount; + #endif + + #if SHAKEUV_ON + half _ShakeUvSpeed, _ShakeUvX, _ShakeUvY; + #endif + + #if NORMALMAP_ON + half _NormalStrength; + #endif + + float _RandomSeed; + + + + + CBUFFER_END + + + + + + + + TEXTURE2D(_MainTex); + SAMPLER(sampler_MainTex); + + #if GLOW_ON + TEXTURE2D(_GlowTex); + SAMPLER(sampler_GlowTex); + #endif + + #if FADE_ON + TEXTURE2D(_FadeTex); + SAMPLER(sampler_FadeTex); + + TEXTURE2D(_FadeBurnTex); + SAMPLER(sampler_FadeBurnTex); + #endif + + #if DISTORT_ON + TEXTURE2D(_DistortTex); + SAMPLER(sampler_DistortTex); + #endif + + #if OUTTEX_ON + TEXTURE2D(_OutlineTex); + SAMPLER(sampler_OutlineTex); + #endif + + #if OUTDIST_ON + TEXTURE2D(_OutlineDistortTex); + SAMPLER(sampler_OutlineDistortTex); + #endif + + #if COLORSWAP_ON + TEXTURE2D(_ColorSwapTex); + SAMPLER(sampler_ColorSwapTex); + #endif + + #if COLORRAMP_ON + TEXTURE2D(_ColorRampTex); + TEXTURE2D(_ColorRampTexGradient); + SAMPLER(sampler_ColorRampTex); + SAMPLER(sampler_ColorRampTexGradient); + #endif + + #if SHINE_ON + TEXTURE2D(_ShineMask); + SAMPLER(sampler_ShineMask); + #endif + + #if OVERLAY_ON + TEXTURE2D(_OverlayTex); + SAMPLER(sampler_OverlayTex); + #endif + + #if NORMALMAP_ON + TEXTURE2D(_NormalMap); + SAMPLER(sampler_NormalMap); + #endif + + + half3 GetPixel(in int offsetX, in int offsetY, in half2 uv, in Texture2D _tex, in SamplerState _sampler) + { + half2 _uv = uv + half2(offsetX * _MainTex_TexelSize.x, offsetY * _MainTex_TexelSize.y); + half4 col = SAMPLE_TEXTURE2D(_tex, _sampler, _uv); + return col.rgb; + } + + + //BLURS------------------------------------------------------------------------- + half4 Blur(half2 uv, Texture2D source, SamplerState sampler_source, half Intensity) + { + const half2 texelSize = 1.0 / _ScreenParams.xy; + const half4 color = SAMPLE_TEXTURE2D(source, sampler_source, uv); + const half2 offset = Intensity * texelSize; + + half4 accumulatedColor = color; + half accumulatedWeight = 1.0; + for (int x = -1; x <= 1; x++) + { + for (int y = -1; y <= 1; y++) + { + const half2 sampleUV = uv + half2(x, y) * offset; + const half4 sampleColor = SAMPLE_TEXTURE2D(source, sampler_source, sampleUV); + + accumulatedColor += sampleColor; + accumulatedWeight += 1.0; + } + } + + half4 blurredColor = accumulatedColor / accumulatedWeight; + return blurredColor; + } + + half BlurHD_G(half bhqp, half x) + { + return exp(-(x * x) / (2.0 * bhqp * bhqp)); + } + half4 BlurHD(half2 uv, Texture2D source, SamplerState sampler_source, half BlurAmount, half xScale, half yScale) + { + int iterations = 16; + int halfIterations = iterations / 2; + half sigmaX = 0.1 + BlurAmount * 0.5; + half sigmaY = sigmaX; + half total = 0.0; + half4 ret = half4(0, 0, 0, 0); + for (int iy = 0; iy < iterations; ++iy) + { + half fy = BlurHD_G(sigmaY, half(iy) -half(halfIterations)); + half offsetY = half(iy - halfIterations) * 0.00390625 * xScale; + for (int ix = 0; ix < iterations; ++ix) + { + half fx = BlurHD_G(sigmaX, half(ix) - half(halfIterations)); + half offsetX = half(ix - halfIterations) * 0.00390625 * yScale; + total += fx * fy; + ret += SAMPLE_TEXTURE2D(source, sampler_source, uv + half2(offsetX, offsetY)) * fx * fy; + } + } + return ret / total; + } + //----------------------------------------------------------------------- + + + //------------------------------------------- + half RemapFloat(half inValue, half inMin, half inMax, half outMin, half outMax){ + return outMin + (inValue - inMin) * (outMax - outMin) / (inMax - inMin); + } + //------------------------------------------- + + //----------------------------------------------------------------------- + half rand(half2 seed, half offset) { + return (frac(sin(dot(seed, half2(12.9898, 78.233))) * 43758.5453) + offset) % 1.0; + } + + half rand2(half2 seed, half offset) { + return (frac(sin(dot(seed * floor(50 + (_Time.x % 1.0) * 12.), half2(127.1, 311.7))) * 43758.5453123) + offset) % 1.0; + } + + half rand2CustomTime(half2 seed, half offset, half customTime) { + return (frac(sin(dot(seed * floor(50 + (customTime % 1.0) * 12.), half2(127.1, 311.7))) * 43758.5453123) + offset) % 1.0; + } + //----------------------------------------------------------------------- + + + void Ext_ModifyVertex0 (inout VertexData v, inout ExtraV2F d) + { + //BILBOARD_ON + #if BILBOARD_ON + half3 camRight = mul((half3x3)unity_CameraToWorld, half3(1,0,0)); + half3 camUp = half3(0,1,0); + #if BILBOARDY_ON + camUp = mul((half3x3)unity_CameraToWorld, half3(0,1,0)); + #endif + half3 localPos = v.vertex.x * camRight + v.vertex.y * camUp; + v.vertex = half4(localPos, 1); + #endif + //----------------------------------------------------------- + + v.texcoord0.xy = TRANSFORM_TEX(v.texcoord0.xy, _MainTex); + half2 center = half2(0.5, 0.5); + #if ATLAS_ON + center = half2((_MaxXUV + _MinXUV) / 2.0, (_MaxYUV + _MinYUV) / 2.0); + #endif + + //POLARUV_ON + #if POLARUV_ON + v.texcoord0.xy = v.texcoord0.xy - center; + #endif + + //---------------------------------------- + + //ROTATEUV_ON + #if ROTATEUV_ON + half2 uvC = v.texcoord0.xy; + half cosAngle = cos(_RotateUvAmount); + half sinAngle = sin(_RotateUvAmount); + half2x2 rot = half2x2(cosAngle, -sinAngle, sinAngle, cosAngle); + uvC -= center; + v.texcoord0.xy = mul(rot, uvC); + v.texcoord0.xy += center; + #endif + //-------------------- + + #if RECTSIZE_ON + v.vertex.xyz += (v.vertex.xyz * (_RectSize - 1.0)); + #endif + + #if OUTTEX_ON + v.texcoord1.xy = TRANSFORM_TEX(v.texcoord0.xy, _OutlineTex); + #endif + + #if OUTDIST_ON + v.texcoord2.xy = TRANSFORM_TEX(v.texcoord0.xy, _OutlineDistortTex); + #endif + + #if DISTORT_ON + v.texcoord3.xy = TRANSFORM_TEX(v.texcoord0.xy, _DistortTex); + #endif + } + + void Ext_SurfaceFunction0 (inout Surface o, ShaderData d) + { + half randomSeed = _RandomSeed; + + float2 uvRect = d.texcoord0; + half2 center = half2(0.5, 0.5); + #if ATLAS_ON + center = half2((_MaxXUV + _MinXUV) / 2.0, (_MaxYUV + _MinYUV) / 2.0); + uvRect = half2((d.texcoord0.x - _MinXUV) / (_MaxXUV - _MinXUV), (d.texcoord0.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half2 centerTiled = half2(center.x * _MainTex_ST.x, center.y * _MainTex_ST.y); + + //CLIPPING_ON + #if CLIPPING_ON + half2 tiledUv = half2(d.texcoord0.x / _MainTex_ST.x, d.texcoord0.y / _MainTex_ST.y); + #if ATLAS_ON + tiledUv = half2((tiledUv.x - _MinXUV) / (_MaxXUV - _MinXUV), (tiledUv.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + clip((1 - _ClipUvUp) - tiledUv.y); + clip(tiledUv.y - _ClipUvDown); + clip((1 - _ClipUvRight) - tiledUv.x); + clip(tiledUv.x - _ClipUvLeft); + #endif + //---------------------------------- + + //RADIALCLIPPING_ON + #if RADIALCLIPPING_ON + half2 tiledUv2 = half2(d.texcoord0.x / _MainTex_ST.x, d.texcoord0.y / _MainTex_ST.y); + #if ATLAS_ON + tiledUv2 = half2((tiledUv2.x - _MinXUV) / (_MaxXUV - _MinXUV), (tiledUv2.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half startAngle = _RadialStartAngle - _RadialClip; + half endAngle = _RadialStartAngle + _RadialClip2; + half offset0 = clamp(0, 360, startAngle + 360); + half offset360 = clamp(0, 360, endAngle - 360); + half2 atan2Coord = half2(lerp(-1, 1, tiledUv2.x), lerp(-1, 1, tiledUv2.y)); + half atanAngle = atan2(atan2Coord.y, atan2Coord.x) * 57.3; // angle in degrees + if(atanAngle < 0) atanAngle = 360 + atanAngle; + if(atanAngle >= startAngle && atanAngle <= endAngle) discard; + if(atanAngle <= offset360) discard; + if(atanAngle >= offset0) discard; + #endif + + //----------------------------- + + //TEXTURESCROLL_ON && ATLAS_ON + #if TEXTURESCROLL_ON && ATLAS_ON + d.texcoord0.xy = half2(_MinXUV + ((_MaxXUV - _MinXUV) * (abs(((_Time.y + randomSeed) * _TextureScrollXSpeed) + uvRect.x) % 1)), + _MinYUV + ((_MaxYUV - _MinYUV) * (abs(((_Time.y + randomSeed) * _TextureScrollYSpeed) + uvRect.y) % 1))); + #endif + //---------------------------- + + //OFFSETUV_ON + #if OFFSETUV_ON + #if ATLAS_ON + d.texcoord0.xy = half2(_MinXUV + ((_MaxXUV - _MinXUV) * (abs((_OffsetUvX + uvRect.x) % 1))), + _MinYUV + ((_MaxYUV - _MinYUV) * (abs(_OffsetUvY + uvRect.y) % 1))); + #else + d.texcoord0.xy += half2(_OffsetUvX, _OffsetUvY); + #endif + #endif + + //---------------------- + + //POLARUV_ON + #if POLARUV_ON + d.texcoord0.xy = half2(atan2(d.texcoord0.y, d.texcoord0.x) / (2.0f * 3.141592653589f), length(d.texcoord0.xy)); + d.texcoord0.xy *= _MainTex_ST.xy; + #endif + + //-------------------------------------- + + //TWISTUV_ON + #if TWISTUV_ON + #if ATLAS_ON + _TwistUvPosX = ((_MaxXUV - _MinXUV) * _TwistUvPosX) + _MinXUV; + _TwistUvPosY = ((_MaxYUV - _MinYUV) * _TwistUvPosY) + _MinYUV; + #endif + half2 tempUv = d.texcoord0.xy - half2(_TwistUvPosX * _MainTex_ST.x, _TwistUvPosY * _MainTex_ST.y); + _TwistUvRadius *= (_MainTex_ST.x + _MainTex_ST.y) / 2; + half percent = (_TwistUvRadius - length(tempUv)) / _TwistUvRadius; + half theta = percent * percent * (2.0 * sin(_TwistUvAmount)) * 8.0; + half s = sin(theta); + half c = cos(theta); + half beta = max(sign(_TwistUvRadius - length(tempUv)), 0.0); + tempUv = half2(dot(tempUv, half2(c, -s)), dot(tempUv, half2(s, c))) * beta + tempUv * (1 - beta); + tempUv += half2(_TwistUvPosX * _MainTex_ST.x, _TwistUvPosY * _MainTex_ST.y); + d.texcoord0.xy = tempUv; + #endif + + //-------------------------------------------- + + //FISHEYE_ON + #if FISHEYE_ON + half bind = length(centerTiled); + half2 dF = d.texcoord0.xy - centerTiled; + half dFlen = length(dF); + half fishInt = (3.14159265359 / bind) * (_FishEyeUvAmount + 0.001); + d.texcoord0.xy = centerTiled + (dF / (max(0.0001, dFlen))) * tan(dFlen * fishInt) * bind / tan(bind * fishInt); + #endif + //--------------------------------------------- + + //PINCH_ON + #if PINCH_ON + half2 dP = d.texcoord0.xy - centerTiled; + half pinchInt = (3.141592 / length(centerTiled)) * (-_PinchUvAmount + 0.001); + d.texcoord0.xy = centerTiled + normalize(dP) * atan(length(dP) * -pinchInt * 10.0) * 0.5 / atan(-pinchInt * 5); + #endif + + //--------------------------------------------- + + //ZOOMUV_ON + #if ZOOMUV_ON + d.texcoord0.xy -= centerTiled; + d.texcoord0.xy = d.texcoord0.xy * _ZoomUvAmount; + d.texcoord0.xy += centerTiled; + #endif + + //----------------------------------------------- + + //DOODLE_ON + #if DOODLE_ON + half2 uvCopy = uvRect; + _HandDrawnSpeed = (floor((_Time.x + randomSeed) * 20 * _HandDrawnSpeed) / _HandDrawnSpeed) * _HandDrawnSpeed; + uvCopy.x = sin((uvCopy.x * _HandDrawnAmount + _HandDrawnSpeed) * 4); + uvCopy.y = cos((uvCopy.y * _HandDrawnAmount + _HandDrawnSpeed) * 4); + d.texcoord0.xy = lerp(d.texcoord0.xy, d.texcoord0.xy + uvCopy, 0.0005 * _HandDrawnAmount); + #endif + + //-------------------------- + + //SHAKEUV_ON + #if SHAKEUV_ON + half xShake = sin((_Time.x + randomSeed) * _ShakeUvSpeed * 50) * _ShakeUvX; + half yShake = cos((_Time.x + randomSeed) * _ShakeUvSpeed * 50) * _ShakeUvY; + d.texcoord0.xy += half2(xShake * 0.012, yShake * 0.01); + #endif + + //------------------------------------------- + + //RECTSIZE_ON + #if RECTSIZE_ON + d.texcoord0.xy = d.texcoord0.xy * (_RectSize).xx + (((-_RectSize * 0.5) + 0.5)).xx; + #endif + + //------------------------------------------- + + //DISTORT_ON + #if DISTORT_ON + #if ATLAS_ON + d.texcoord3.x = d.texcoord3.x * (1 / (_MaxXUV - _MinXUV)); + d.texcoord3.y = d.texcoord3.y * (1 / (_MaxYUV - _MinYUV)); + #endif + + d.texcoord3.x += ((_Time.x + _RandomSeed) * _DistortTexXSpeed) % 1; + d.texcoord3.y += ((_Time.x + _RandomSeed) * _DistortTexYSpeed) % 1; + half distortAmnt = (SAMPLE_TEXTURE2D(_DistortTex, sampler_DistortTex, d.texcoord3.xy).r - 0.5) * 0.2 * _DistortAmount; + d.texcoord0.x += distortAmnt; + d.texcoord0.y += distortAmnt; + #endif + //------------------------------------------------------- + + //WARP_ON + #if WARP_ON + half2 warpUv = half2(d.texcoord0.x / _MainTex_ST.x, d.texcoord0.y / _MainTex_ST.y); + #if ATLAS_ON + warpUv = half2((warpUv.x - _MinXUV) / (_MaxXUV - _MinXUV), (warpUv.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + const float tau = 6.283185307179586; + float xWarp = (_Time.y + randomSeed) * _WarpSpeed + warpUv.x * tau / _WarpScale; + float yWarp = (_Time.y + randomSeed) * _WarpSpeed + warpUv.y * tau / _WarpScale; + float2 warp = float2(sin(xWarp), sin(yWarp)) * _WarpStrength; + d.texcoord0.xy += warp; + #endif + + //------------------------------------------------------- + + //WAVEUV_ON + #if WAVEUV_ON + float2 uvWave = half2(_WaveX * _MainTex_ST.x, _WaveY * _MainTex_ST.y) - d.texcoord0.xy; + uvWave %= 1; + #if ATLAS_ON + uvWave = half2(_WaveX, _WaveY) - uvRect; + #endif + uvWave.x *= _ScreenParams.x / _ScreenParams.y; + float waveTime = _Time.y + randomSeed; + float angWave = (sqrt(dot(uvWave, uvWave)) * _WaveAmount) - ((waveTime * _WaveSpeed)); + d.texcoord0.xy = d.texcoord0.xy + uvWave * sin(angWave) * (_WaveStrength / 1000.0); + #endif + //---------------------------------------------------- + + //ROUNDWAVEUV_ON + #if ROUNDWAVEUV_ON + half xWave = ((0.5 * _MainTex_ST.x) - uvRect.x); + half yWave = ((0.5 * _MainTex_ST.y) - uvRect.y) * (_MainTex_TexelSize.w / _MainTex_TexelSize.z); + half ripple = -sqrt(xWave*xWave + yWave* yWave); + d.texcoord0.xy += (sin((ripple + (_Time.y + randomSeed) * (_RoundWaveSpeed/10.0)) / 0.015) * (_RoundWaveStrength/10.0)) % 1; + #endif + //---------------------------------------------------- + + + //WIND_ON + #if WIND_ON + half windOffset = sin((_Time.x + randomSeed) * _GrassSpeed * 10); + half2 windCenter = half2(0.5, 0.1); + #if ATLAS_ON + windCenter.x = ((_MaxXUV - _MinXUV) * windCenter.x) + _MinXUV; + windCenter.y = ((_MaxYUV - _MinYUV) * windCenter.y) + _MinYUV; + #endif + #if !MANUALWIND_ON + d.texcoord0.x = fmod(abs(lerp(d.texcoord0.x, d.texcoord0.x + (_GrassWind * 0.01 * windOffset), uvRect.y)), 1); + #else + d.texcoord0.x = fmod(abs(lerp(d.texcoord0.x, d.texcoord0.x + (_GrassWind * 0.01 * _GrassManualAnim), uvRect.y)), 1); + windOffset = _GrassManualAnim; + #endif + half2 delta = d.texcoord0.xy - windCenter; + half delta2 = dot(delta.xy, delta.xy); + half2 delta_offset = delta2 * windOffset; + d.texcoord0.xy = d.texcoord0.xy + half2(delta.y, -delta.x) * delta_offset * _GrassRadialBend; + #endif + + //-------------------------------------------------------- + + //TEXTURESCROLL_ON && !ATLAS_ON + #if TEXTURESCROLL_ON && !ATLAS_ON + d.texcoord0.x += ((_Time.y + randomSeed) * _TextureScrollXSpeed) % 1; + d.texcoord0.y += ((_Time.y + randomSeed) * _TextureScrollYSpeed) % 1; + #endif + //------------------------------ + + //PIXELATE_ON + #if PIXELATE_ON + half aspectRatio = _MainTex_TexelSize.x / _MainTex_TexelSize.y; + half2 pixelSize = float2(_PixelateSize, _PixelateSize * aspectRatio); + d.texcoord0.xy = floor(d.texcoord0.xy * pixelSize) / pixelSize; + #endif + //-------------- + + half4 col = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy); + half originalAlpha = col.a; + col *= d.vertexColor; + + //NORMAL MAP + #if NORMALMAP_ON + half4 normalSample = SAMPLE_TEXTURE2D(_NormalMap, sampler_NormalMap, d.texcoord0.xy); + half3 normalTS = UnpackNormal(normalSample); + normalTS.xy *= _NormalStrength; + o.Normal = normalTS; + #endif + + + //GLITCH_ON + #if GLITCH_ON + half2 uvGlitch = uvRect; + uvGlitch.y -= 0.5; + half lineNoise = pow(rand2(floor(uvGlitch * half2(24., 19.) * _GlitchSize) * 4.0, randomSeed), 3.0) * _GlitchAmount + * pow(rand2(floor(uvGlitch * half2(38., 14.) * _GlitchSize) * 4.0, randomSeed), 3.0); + col = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(lineNoise * 0.02 * rand2(half2(2.0, 1), randomSeed), 0)) * d.vertexColor; + #endif + //-------------------------------------- + + //CHROMABERR_ON + #if CHROMABERR_ON + half4 r = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(_ChromAberrAmount/10, 0)) * d.vertexColor; + half4 b = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(-_ChromAberrAmount/10, 0)) * d.vertexColor; + col = half4(r.r * r.a, col.g, b.b * b.a, max(max(r.a, b.a) * _ChromAberrAlpha, col.a)); + #endif + + //-------------------------------- + + //BLUR_ON + #if BLUR_ON + #if ATLAS_ON + #if !BLURISHD_ON + col = BlurHD(d.texcoord0.xy, _MainTex, sampler_MainTex, _BlurIntensity, (_MaxXUV - _MinXUV), (_MaxYUV - _MinYUV)) * d.vertexColor; + #else + col = Blur(d.texcoord0.xy, _MainTex, sampler_MainTex, _BlurIntensity * (_MaxXUV - _MinXUV)) * d.vertexColor; + #endif + #else + #if !BLURISHD_ON + col = BlurHD(d.texcoord0.xy, _MainTex, sampler_MainTex, _BlurIntensity, 1, 1) * d.vertexColor; + #else + col = Blur(d.texcoord0.xy, _MainTex, sampler_MainTex, _BlurIntensity) * d.vertexColor; + #endif + #endif + #endif + + //-------------------- + + //MOTIONBLUR_ON + #if MOTIONBLUR_ON + _MotionBlurAngle = _MotionBlurAngle * 3.1415926; + #define rot(n) mul(n, half2x2(cos(_MotionBlurAngle), -sin(_MotionBlurAngle), sin(_MotionBlurAngle), cos(_MotionBlurAngle))) + _MotionBlurDist = _MotionBlurDist * 0.005; + #if ATLAS_ON + _MotionBlurDist *= (_MaxXUV - _MinXUV); + #endif + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(-_MotionBlurDist, -_MotionBlurDist))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(-_MotionBlurDist * 2, -_MotionBlurDist * 2))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(-_MotionBlurDist * 3, -_MotionBlurDist * 3))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(-_MotionBlurDist * 4, -_MotionBlurDist * 4))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(_MotionBlurDist, _MotionBlurDist))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(_MotionBlurDist * 2, _MotionBlurDist * 2))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(_MotionBlurDist * 3, _MotionBlurDist * 3))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(_MotionBlurDist * 4, _MotionBlurDist * 4))); + col.rgb = col.rgb / 9; + #endif + //------------------------------------ + + //NEGATIVE_ON + #if NEGATIVE_ON + col.rgb = lerp(col.rgb, 1 - col.rgb, _NegativeAmount); + #endif + + //-------------- + half luminance = 0; + + //GREYSCALE_ON && !GREYSCALEOUTLINE_ON + #if GREYSCALE_ON && !GREYSCALEOUTLINE_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + luminance = saturate(luminance + _GreyscaleLuminosity); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _GreyscaleTintColor, _GreyscaleBlend); + #endif + //------------------------------------ + + //GHOST_ON + #if GHOST_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + half4 ghostResult; + ghostResult.a = saturate(luminance - _GhostTransparency) * col.a; + ghostResult.rgb = col.rgb * (luminance + _GhostColorBoost); + col = lerp(col, ghostResult, _GhostBlend); + #endif + //------------------------------------ + + //INNEROUTLINE_ON + #if INNEROUTLINE_ON + half3 innerT = abs(GetPixel(0, _InnerOutlineThickness, d.texcoord0.xy, _MainTex, sampler_MainTex) - GetPixel(0, -_InnerOutlineThickness, d.texcoord0.xy, _MainTex, sampler_MainTex)); + innerT += abs(GetPixel(_InnerOutlineThickness, 0, d.texcoord0.xy, _MainTex, sampler_MainTex) - GetPixel(-_InnerOutlineThickness, 0, d.texcoord0.xy, _MainTex, sampler_MainTex)); + #if !ONLYINNEROUTLINE_ON + innerT = (innerT / 2.0) * col.a * _InnerOutlineAlpha; + col.rgb += length(innerT) * _InnerOutlineColor.rgb * _InnerOutlineGlow; + #else + innerT *= col.a * _InnerOutlineAlpha; + col.rgb = length(innerT) * _InnerOutlineColor.rgb * _InnerOutlineGlow; + col.a = step(0.3, col.r+col.g+col.b); + #endif + #endif + //------------------------------------------------------- + + //HITEFFECT_ON + #if HITEFFECT_ON + col.rgb = lerp(col.rgb, _HitEffectColor.rgb * _HitEffectGlow, _HitEffectBlend); + #endif + //-------------------- + + //GRADIENT_ON + #if GRADIENT_ON + half2 tiledUvGrad = half2(uvRect.x / _MainTex_ST.x, uvRect.y / _MainTex_ST.y); + #if GRADIENT2COL_ON + _GradTopRightCol = _GradTopLeftCol; + _GradBotRightCol = _GradBotLeftCol; + #endif + #if RADIALGRADIENT_ON + half radialDist = 1 - length(tiledUvGrad - half2(0.5, 0.5)); + radialDist *= (_MainTex_TexelSize.w / _MainTex_TexelSize.z); + radialDist = saturate(_GradBoostX * radialDist); + half4 gradientResult = lerp(_GradTopLeftCol, _GradBotLeftCol, radialDist); + #else + half gradXLerpFactor = saturate(pow(tiledUvGrad.x, _GradBoostX)); + half4 gradientResult = lerp(lerp(_GradBotLeftCol, _GradBotRightCol, gradXLerpFactor), + lerp(_GradTopLeftCol, _GradTopRightCol, gradXLerpFactor), saturate(pow(tiledUvGrad.y, _GradBoostY))); + #endif + gradientResult = lerp(col, gradientResult, _GradBlend); + col.rgb = gradientResult.rgb * col.a; + col.a *= gradientResult.a; + #endif + //-------------------------------------------------------------------- + + //CONTRAST_ON + #if CONTRAST_ON + col.rgb = (col.rgb - float3(0.5, 0.5, 0.5)) * _Contrast + float3(0.5, 0.5, 0.5); + col.rgb += _Brightness; + #endif + + //------------------------------------------------------------------- + + //COLORSWAP_ON + #if COLORSWAP_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + half4 swapMask = SAMPLE_TEXTURE2D(_ColorSwapTex, sampler_ColorSwapTex, d.texcoord0.xy); + swapMask.rgb *= swapMask.a; + half3 redSwap = _ColorSwapRed * swapMask.r * saturate(luminance + _ColorSwapRedLuminosity); + half3 greenSwap = _ColorSwapGreen * swapMask.g * saturate(luminance + _ColorSwapGreenLuminosity); + half3 blueSwap = _ColorSwapBlue * swapMask.b * saturate(luminance + _ColorSwapBlueLuminosity); + swapMask.rgb = col.rgb * saturate(1 - swapMask.r - swapMask.g - swapMask.b); + col.rgb = lerp(col.rgb, swapMask.rgb + redSwap + greenSwap + blueSwap, _ColorSwapBlend); + #endif + //-------------------------------------------------------------------- + + //COLORRAMP_ON && !COLORRAMPOUTLINE_ON + #if COLORRAMP_ON && !COLORRAMPOUTLINE_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + luminance = saturate(luminance + _ColorRampLuminosity); + #if GRADIENTCOLORRAMP_ON + col.rgb = lerp(col.rgb, SAMPLE_TEXTURE2D(_ColorRampTexGradient, sampler_ColorRampTexGradient, half2(luminance, 0)).rgb, _ColorRampBlend); + #else + col.rgb = lerp(col.rgb, SAMPLE_TEXTURE2D(_ColorRampTex, sampler_ColorRampTex, half2(luminance, 0)).rgb, _ColorRampBlend); + #endif + #endif + //-------------------------------------------------------------------- + + //CHANGECOLOR_ON + #if CHANGECOLOR_ON + float3 currChangeColor = saturate(col.rgb); + luminance = 0.3 * currChangeColor.r + 0.59 * currChangeColor.g + 0.11 * currChangeColor.b; + luminance = saturate(luminance + _ColorChangeLuminosity); + half3 dif = abs(currChangeColor - _ColorChangeTarget.rgb); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _ColorChangeNewCol.rgb, + max(sign(1 - saturate(dif.x + dif.y + dif.z) - _ColorChangeTolerance), 0.0)); + #if CHANGECOLOR2_ON + dif = abs(currChangeColor - _ColorChangeTarget2.rgb); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _ColorChangeNewCol2.rgb, + max(sign(1 - saturate(dif.x + dif.y + dif.z) - _ColorChangeTolerance2), 0.0)); + #endif + #if CHANGECOLOR3_ON + dif = abs(currChangeColor - _ColorChangeTarget3.rgb); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _ColorChangeNewCol3.rgb, + max(sign(1 - saturate(dif.x + dif.y + dif.z) - _ColorChangeTolerance3), 0.0)); + #endif + #endif + //------------------------------------------------------- + + //POSTERIZE_ON && !POSTERIZEOUTLINE_ON + #if POSTERIZE_ON && !POSTERIZEOUTLINE_ON + col.rgb = pow(col.rgb, _PosterizeGamma) * _PosterizeNumColors; + col.rgb = floor(col.rgb) / _PosterizeNumColors; + col.rgb = pow(col.rgb, 1.0 / _PosterizeGamma); + #endif + //------------------------------------ + + //HSV_ON + #if HSV_ON + half3 resultHsv = half3(col.rgb); + half cosHsv = _HsvBright * _HsvSaturation * cos(_HsvShift * 3.14159265 / 180); + half sinHsv = _HsvBright * _HsvSaturation * sin(_HsvShift * 3.14159265 / 180); + resultHsv.x = (.299 * _HsvBright + .701 * cosHsv + .168 * sinHsv) * col.x + + (.587 * _HsvBright - .587 * cosHsv + .330 * sinHsv) * col.y + + (.114 * _HsvBright - .114 * cosHsv - .497 * sinHsv) * col.z; + resultHsv.y = (.299 * _HsvBright - .299 * cosHsv - .328 * sinHsv) *col.x + + (.587 * _HsvBright + .413 * cosHsv + .035 * sinHsv) * col.y + + (.114 * _HsvBright - .114 * cosHsv + .292 * sinHsv) * col.z; + resultHsv.z = (.299 * _HsvBright - .3 * cosHsv + 1.25 * sinHsv) * col.x + + (.587 * _HsvBright - .588 * cosHsv - 1.05 * sinHsv) * col.y + + (.114 * _HsvBright + .886 * cosHsv - .203 * sinHsv) * col.z; + col.rgb = resultHsv; + #endif + //------------------------------------------------------- + + //OVERLAY_ON + #if OVERLAY_ON + half2 overlayUvs = d.texcoord0.xy; + overlayUvs.x += ((_Time.y + randomSeed) * _OverlayTextureScrollXSpeed) % 1; + overlayUvs.y += ((_Time.y + randomSeed) * _OverlayTextureScrollYSpeed) % 1; + half4 overlayCol = SAMPLE_TEXTURE2D(_OverlayTex, sampler_OverlayTex, TRANSFORM_TEX(overlayUvs, _OverlayTex)); + overlayCol.rgb *= _OverlayColor.rgb * _OverlayGlow; + #if !OVERLAYMULT_ON + overlayCol.rgb *= overlayCol.a * _OverlayColor.rgb * _OverlayColor.a * _OverlayBlend; + col.rgb += overlayCol.rgb; + #else + overlayCol.a *= _OverlayColor.a; + col = lerp(col, col * overlayCol, _OverlayBlend); + #endif + #endif + + //--------------------------------- + + //OUTBASE_ON + #if OUTBASE_ON + #if OUTBASEPIXELPERF_ON + half2 destUv = half2(_OutlinePixelWidth * _MainTex_TexelSize.x, _OutlinePixelWidth * _MainTex_TexelSize.y); + #else + half2 destUv = half2(_OutlineWidth * _MainTex_TexelSize.x * 200, _OutlineWidth * _MainTex_TexelSize.y * 200); + #endif + + #if OUTDIST_ON + d.texcoord3.x += ((_Time.x + _RandomSeed) * _OutlineDistortTexXSpeed) % 1; + d.texcoord3.y += ((_Time.x + _RandomSeed) * _OutlineDistortTexYSpeed) % 1; + #if ATLAS_ON + d.texcoord3 = half2((d.texcoord3.x - _MinXUV) / (_MaxXUV - _MinXUV), (d.texcoord3.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half outDistortAmnt = (SAMPLE_TEXTURE2D(_OutlineDistortTex, sampler_OutlineDistortTex, d.texcoord3).r - 0.5) * 0.2 * _OutlineDistortAmount; + destUv.x += outDistortAmnt; + destUv.y += outDistortAmnt; + #endif + + half spriteLeft = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(destUv.x, 0)).a; + half spriteRight = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy - half2(destUv.x, 0)).a; + half spriteBottom = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(0, destUv.y)).a; + half spriteTop = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy - half2(0, destUv.y)).a; + half result = spriteLeft + spriteRight + spriteBottom + spriteTop; + + #if OUTBASE8DIR_ON + half spriteTopLeft = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(destUv.x, destUv.y)).a; + half spriteTopRight = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(-destUv.x, destUv.y)).a; + half spriteBotLeft = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(destUv.x, -destUv.y)).a; + half spriteBotRight = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(-destUv.x, -destUv.y)).a; + result = result + spriteTopLeft + spriteTopRight + spriteBotLeft + spriteBotRight; + #endif + + result = step(0.05, saturate(result)); + + #if OUTTEX_ON + d.texcoord1.x += ((_Time.x + _RandomSeed) * _OutlineTexXSpeed) % 1; + d.texcoord1.y += ((_Time.x + _RandomSeed) * _OutlineTexYSpeed) % 1; + #if ATLAS_ON + d.texcoord1 = half2((d.texcoord1.x - _MinXUV) / (_MaxXUV - _MinXUV), (d.texcoord1.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half4 tempOutColor = SAMPLE_TEXTURE2D(_OutlineTex, sampler_OutlineTex, d.texcoord1); + tempOutColor *= _OutlineColor; + _OutlineColor = tempOutColor; + #endif + + result *= (1 - originalAlpha) * _OutlineAlpha; + + half4 outline = _OutlineColor * d.vertexColor.a; + outline.rgb *= _OutlineGlow; + outline.a = result; + #if ONLYOUTLINE_ON + col = outline; + #else + col = lerp(col, outline, result); + #endif + #endif + //------------------------------------------------------- + + //FADE_ON + #if FADE_ON + half2 tiledUvFade1 = TRANSFORM_TEX(d.texcoord0, _FadeTex); + half2 tiledUvFade2 = TRANSFORM_TEX(d.texcoord0, _FadeBurnTex); + #if ATLAS_ON + tiledUvFade1 = half2((tiledUvFade1.x - _MinXUV) / (_MaxXUV - _MinXUV), (tiledUvFade1.y - _MinYUV) / (_MaxYUV - _MinYUV)); + tiledUvFade2 = half2((tiledUvFade2.x - _MinXUV) / (_MaxXUV - _MinXUV), (tiledUvFade2.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half fadeTemp = SAMPLE_TEXTURE2D(_FadeTex, sampler_FadeTex, tiledUvFade1).r; + half fade = smoothstep(_FadeAmount, _FadeAmount + _FadeBurnTransition, fadeTemp); + half fadeBurn = saturate(smoothstep(_FadeAmount - _FadeBurnWidth, _FadeAmount - _FadeBurnWidth + 0.1, fadeTemp) * _FadeAmount); + col.a *= fade; + _FadeBurnColor.rgb *= _FadeBurnGlow; + col += fadeBurn * SAMPLE_TEXTURE2D(_FadeBurnTex, sampler_FadeBurnTex, tiledUvFade2) * _FadeBurnColor * originalAlpha * (1 - col.a); + #endif + //------------------------------------------------------- + + //SHADOW_ON + #if SHADOW_ON + half shadowA = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(_ShadowX, _ShadowY)).a; + half preMultShadowMask = 1 - (saturate(shadowA - col.a) * (1 - col.a)); + col.rgb *= 1 - ((shadowA - col.a) * (1 - col.a)); + col.rgb += (_ShadowColor * shadowA) * (1 - col.a); + col.a = max(shadowA * _ShadowAlpha * d.vertexColor.a, col.a); + #endif + + //------------------------------------------------------- + + //GLOW_ON + #if GLOW_ON + half4 emission; + #if GLOWTEX_ON + emission = SAMPLE_TEXTURE2D(_GlowTex, sampler_GlowTex, d.texcoord0); + #else + emission = col; + #endif + + col.rgb *= _GlowGlobal; + emission.rgb *= emission.a * col.a * _Glow * _GlowColor; + col.rgb += emission.rgb; + #endif + //------------------------------------------------------- + + //COLORRAMP_ON && COLORRAMPOUTLINE_ON + #if COLORRAMP_ON && COLORRAMPOUTLINE_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + luminance = saturate(luminance + _ColorRampLuminosity); + #if GRADIENTCOLORRAMP_ON + col.rgb = lerp(col.rgb, SAMPLE_TEXTURE2D(_ColorRampTexGradient, sampler_ColorRampTexGradient, half2(luminance, 0)).rgb, _ColorRampBlend); + #else + col.rgb = lerp(col.rgb, SAMPLE_TEXTURE2D(_ColorRampTex, sampler_ColorRampTex, half2(luminance, 0)).rgb, _ColorRampBlend); + #endif + #endif + //--------------- + + //GREYSCALE_ON && GREYSCALEOUTLINE_ON + #if GREYSCALE_ON && GREYSCALEOUTLINE_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + luminance = saturate(luminance + _GreyscaleLuminosity); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _GreyscaleTintColor, _GreyscaleBlend); + #endif + + //----------------------------------- + + //POSTERIZE_ON && POSTERIZEOUTLINE_ON + #if POSTERIZE_ON && POSTERIZEOUTLINE_ON + col.rgb = pow(col.rgb, _PosterizeGamma) * _PosterizeNumColors; + col.rgb = floor(col.rgb) / _PosterizeNumColors; + col.rgb = pow(col.rgb, 1.0 / _PosterizeGamma); + #endif + + //----------------------------------- + + //SHINE_ON + #if SHINE_ON + half2 uvShine = uvRect; + half cosAngle = cos(_ShineRotate); + half sinAngle = sin(_ShineRotate); + half2x2 rot = half2x2(cosAngle, -sinAngle, sinAngle, cosAngle); + uvShine -= half2(0.5, 0.5); + uvShine = mul(rot, uvShine); + uvShine += half2(0.5, 0.5); + half shineMask = SAMPLE_TEXTURE2D(_ShineMask, sampler_ShineMask, d.texcoord0.xy).a; + half currentDistanceProjection = (uvShine.x + uvShine.y) / 2; + half whitePower = 1 - (abs(currentDistanceProjection - _ShineLocation) / _ShineWidth); + col.rgb += col.a * whitePower * _ShineGlow * max(sign(currentDistanceProjection - (_ShineLocation - _ShineWidth)), 0.0) + * max(sign((_ShineLocation + _ShineWidth) - currentDistanceProjection), 0.0) * _ShineColor * shineMask; + #endif + + //----------------------------------- + + //HOLOGRAM_ON + #if HOLOGRAM_ON + half totalHologram = _HologramStripesAmount + _HologramUnmodAmount; + half hologramYCoord = ((uvRect.y + (((_Time.x + randomSeed) % 1) * _HologramStripesSpeed)) % totalHologram) / totalHologram; + hologramYCoord = abs(hologramYCoord); + half alpha = RemapFloat(saturate(hologramYCoord - (_HologramUnmodAmount/totalHologram)), 0.0, 1.0, _HologramMinAlpha, saturate(_HologramMaxAlpha)); + half hologramMask = max(sign((_HologramUnmodAmount/totalHologram) - hologramYCoord), 0.0); + half4 hologramResult = col; + hologramResult.a *= lerp(alpha, 1, hologramMask); + hologramResult.rgb *= max(1, _HologramMaxAlpha * max(sign(hologramYCoord - (_HologramUnmodAmount/totalHologram)), 0.0)); + hologramMask = 1 - step(0.01,hologramMask); + hologramResult.rgb += hologramMask * _HologramStripeColor * col.a; + col = lerp(col, hologramResult, _HologramBlend); + #endif + + //----------------------------------- + + //FLICKER_ON + #if FLICKER_ON + col.a *= saturate(col.a * step(frac(0.05 + (_Time.w + randomSeed) * _FlickerFreq), 1 - _FlickerPercent) + _FlickerAlpha); + #endif + //----------------------------------- + + //ALPHACUTOFF_ON + + //ALPHAROUND_ON + + //ALPHAOUTLINE_ON + #if ALPHAOUTLINE_ON + half alphaOutlineRes = pow(1 - col.a, max(_AlphaOutlinePower, 0.0001)) * step(_AlphaOutlineMinAlpha, col.a) * _AlphaOutlineBlend; + col.rgb = lerp(col.rgb, _AlphaOutlineColor.rgb * _AlphaOutlineGlow, alphaOutlineRes); + col.a = lerp(col.a, 1, alphaOutlineRes > 1); + #endif + //------------------------------------------------------- + + //FOG_ON + + //------------------ + + col *= _Color; + o.Albedo = col; + col.a *= _Alpha; + clip(col.a - _AlphaCutoffValue - 0.01); + o.Alpha = _Color.a; + } + + + + + + void ChainSurfaceFunction(inout Surface l, inout ShaderData d) + { + Ext_SurfaceFunction0(l, d); + // Ext_SurfaceFunction1(l, d); + // Ext_SurfaceFunction2(l, d); + // Ext_SurfaceFunction3(l, d); + // Ext_SurfaceFunction4(l, d); + // Ext_SurfaceFunction5(l, d); + // Ext_SurfaceFunction6(l, d); + // Ext_SurfaceFunction7(l, d); + // Ext_SurfaceFunction8(l, d); + // Ext_SurfaceFunction9(l, d); + // Ext_SurfaceFunction10(l, d); + // Ext_SurfaceFunction11(l, d); + // Ext_SurfaceFunction12(l, d); + // Ext_SurfaceFunction13(l, d); + // Ext_SurfaceFunction14(l, d); + // Ext_SurfaceFunction15(l, d); + // Ext_SurfaceFunction16(l, d); + // Ext_SurfaceFunction17(l, d); + // Ext_SurfaceFunction18(l, d); + // Ext_SurfaceFunction19(l, d); + // Ext_SurfaceFunction20(l, d); + // Ext_SurfaceFunction21(l, d); + // Ext_SurfaceFunction22(l, d); + // Ext_SurfaceFunction23(l, d); + // Ext_SurfaceFunction24(l, d); + // Ext_SurfaceFunction25(l, d); + // Ext_SurfaceFunction26(l, d); + // Ext_SurfaceFunction27(l, d); + // Ext_SurfaceFunction28(l, d); + // Ext_SurfaceFunction29(l, d); + } + +#if !_DECALSHADER + + void ChainModifyVertex(inout VertexData v, inout VertexToPixel v2p, float4 time) + { + ExtraV2F d; + + ZERO_INITIALIZE(ExtraV2F, d); + ZERO_INITIALIZE(Blackboard, d.blackboard); + // due to motion vectors in HDRP, we need to use the last + // time in certain spots. So if you are going to use _Time to adjust vertices, + // you need to use this time or motion vectors will break. + d.time = time; + + Ext_ModifyVertex0(v, d); + // Ext_ModifyVertex1(v, d); + // Ext_ModifyVertex2(v, d); + // Ext_ModifyVertex3(v, d); + // Ext_ModifyVertex4(v, d); + // Ext_ModifyVertex5(v, d); + // Ext_ModifyVertex6(v, d); + // Ext_ModifyVertex7(v, d); + // Ext_ModifyVertex8(v, d); + // Ext_ModifyVertex9(v, d); + // Ext_ModifyVertex10(v, d); + // Ext_ModifyVertex11(v, d); + // Ext_ModifyVertex12(v, d); + // Ext_ModifyVertex13(v, d); + // Ext_ModifyVertex14(v, d); + // Ext_ModifyVertex15(v, d); + // Ext_ModifyVertex16(v, d); + // Ext_ModifyVertex17(v, d); + // Ext_ModifyVertex18(v, d); + // Ext_ModifyVertex19(v, d); + // Ext_ModifyVertex20(v, d); + // Ext_ModifyVertex21(v, d); + // Ext_ModifyVertex22(v, d); + // Ext_ModifyVertex23(v, d); + // Ext_ModifyVertex24(v, d); + // Ext_ModifyVertex25(v, d); + // Ext_ModifyVertex26(v, d); + // Ext_ModifyVertex27(v, d); + // Ext_ModifyVertex28(v, d); + // Ext_ModifyVertex29(v, d); + + + // #if %EXTRAV2F0REQUIREKEY% + // v2p.extraV2F0 = d.extraV2F0; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // v2p.extraV2F1 = d.extraV2F1; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // v2p.extraV2F2 = d.extraV2F2; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // v2p.extraV2F3 = d.extraV2F3; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // v2p.extraV2F4 = d.extraV2F4; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // v2p.extraV2F5 = d.extraV2F5; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // v2p.extraV2F6 = d.extraV2F6; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // v2p.extraV2F7 = d.extraV2F7; + // #endif + } + + void ChainModifyTessellatedVertex(inout VertexData v, inout VertexToPixel v2p) + { + ExtraV2F d; + ZERO_INITIALIZE(ExtraV2F, d); + ZERO_INITIALIZE(Blackboard, d.blackboard); + + // #if %EXTRAV2F0REQUIREKEY% + // d.extraV2F0 = v2p.extraV2F0; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // d.extraV2F1 = v2p.extraV2F1; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // d.extraV2F2 = v2p.extraV2F2; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // d.extraV2F3 = v2p.extraV2F3; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // d.extraV2F4 = v2p.extraV2F4; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // d.extraV2F5 = v2p.extraV2F5; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // d.extraV2F6 = v2p.extraV2F6; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // d.extraV2F7 = v2p.extraV2F7; + // #endif + + + // Ext_ModifyTessellatedVertex0(v, d); + // Ext_ModifyTessellatedVertex1(v, d); + // Ext_ModifyTessellatedVertex2(v, d); + // Ext_ModifyTessellatedVertex3(v, d); + // Ext_ModifyTessellatedVertex4(v, d); + // Ext_ModifyTessellatedVertex5(v, d); + // Ext_ModifyTessellatedVertex6(v, d); + // Ext_ModifyTessellatedVertex7(v, d); + // Ext_ModifyTessellatedVertex8(v, d); + // Ext_ModifyTessellatedVertex9(v, d); + // Ext_ModifyTessellatedVertex10(v, d); + // Ext_ModifyTessellatedVertex11(v, d); + // Ext_ModifyTessellatedVertex12(v, d); + // Ext_ModifyTessellatedVertex13(v, d); + // Ext_ModifyTessellatedVertex14(v, d); + // Ext_ModifyTessellatedVertex15(v, d); + // Ext_ModifyTessellatedVertex16(v, d); + // Ext_ModifyTessellatedVertex17(v, d); + // Ext_ModifyTessellatedVertex18(v, d); + // Ext_ModifyTessellatedVertex19(v, d); + // Ext_ModifyTessellatedVertex20(v, d); + // Ext_ModifyTessellatedVertex21(v, d); + // Ext_ModifyTessellatedVertex22(v, d); + // Ext_ModifyTessellatedVertex23(v, d); + // Ext_ModifyTessellatedVertex24(v, d); + // Ext_ModifyTessellatedVertex25(v, d); + // Ext_ModifyTessellatedVertex26(v, d); + // Ext_ModifyTessellatedVertex27(v, d); + // Ext_ModifyTessellatedVertex28(v, d); + // Ext_ModifyTessellatedVertex29(v, d); + + // #if %EXTRAV2F0REQUIREKEY% + // v2p.extraV2F0 = d.extraV2F0; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // v2p.extraV2F1 = d.extraV2F1; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // v2p.extraV2F2 = d.extraV2F2; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // v2p.extraV2F3 = d.extraV2F3; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // v2p.extraV2F4 = d.extraV2F4; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // v2p.extraV2F5 = d.extraV2F5; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // v2p.extraV2F6 = d.extraV2F6; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // v2p.extraV2F7 = d.extraV2F7; + // #endif + } + + void ChainFinalColorForward(inout Surface l, inout ShaderData d, inout half4 color) + { + // Ext_FinalColorForward0(l, d, color); + // Ext_FinalColorForward1(l, d, color); + // Ext_FinalColorForward2(l, d, color); + // Ext_FinalColorForward3(l, d, color); + // Ext_FinalColorForward4(l, d, color); + // Ext_FinalColorForward5(l, d, color); + // Ext_FinalColorForward6(l, d, color); + // Ext_FinalColorForward7(l, d, color); + // Ext_FinalColorForward8(l, d, color); + // Ext_FinalColorForward9(l, d, color); + // Ext_FinalColorForward10(l, d, color); + // Ext_FinalColorForward11(l, d, color); + // Ext_FinalColorForward12(l, d, color); + // Ext_FinalColorForward13(l, d, color); + // Ext_FinalColorForward14(l, d, color); + // Ext_FinalColorForward15(l, d, color); + // Ext_FinalColorForward16(l, d, color); + // Ext_FinalColorForward17(l, d, color); + // Ext_FinalColorForward18(l, d, color); + // Ext_FinalColorForward19(l, d, color); + // Ext_FinalColorForward20(l, d, color); + // Ext_FinalColorForward21(l, d, color); + // Ext_FinalColorForward22(l, d, color); + // Ext_FinalColorForward23(l, d, color); + // Ext_FinalColorForward24(l, d, color); + // Ext_FinalColorForward25(l, d, color); + // Ext_FinalColorForward26(l, d, color); + // Ext_FinalColorForward27(l, d, color); + // Ext_FinalColorForward28(l, d, color); + // Ext_FinalColorForward29(l, d, color); + } + + void ChainFinalGBufferStandard(inout Surface s, inout ShaderData d, inout half4 GBuffer0, inout half4 GBuffer1, inout half4 GBuffer2, inout half4 outEmission, inout half4 outShadowMask) + { + // Ext_FinalGBufferStandard0(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard1(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard2(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard3(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard4(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard5(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard6(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard7(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard8(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard9(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard10(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard11(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard12(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard13(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard14(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard15(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard16(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard17(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard18(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard19(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard20(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard21(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard22(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard23(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard24(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard25(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard26(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard27(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard28(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard29(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + } +#endif + + + + + +#if _DECALSHADER + + ShaderData CreateShaderData(SurfaceDescriptionInputs IN) + { + ShaderData d = (ShaderData)0; + d.TBNMatrix = float3x3(IN.WorldSpaceTangent, IN.WorldSpaceBiTangent, IN.WorldSpaceNormal); + d.worldSpaceNormal = IN.WorldSpaceNormal; + d.worldSpaceTangent = IN.WorldSpaceTangent; + + d.worldSpacePosition = IN.WorldSpacePosition; + d.texcoord0 = IN.uv0.xyxy; + d.screenPos = IN.ScreenPosition; + + d.worldSpaceViewDir = normalize(_WorldSpaceCameraPos - d.worldSpacePosition); + + d.tangentSpaceViewDir = mul(d.TBNMatrix, d.worldSpaceViewDir); + + // these rarely get used, so we back transform them. Usually will be stripped. + #if _HDRP + // d.localSpacePosition = mul(GetWorldToObjectMatrix(), float4(GetCameraRelativePositionWS(d.worldSpacePosition), 1)).xyz; + #else + // d.localSpacePosition = mul(GetWorldToObjectMatrix(), float4(d.worldSpacePosition, 1)).xyz; + #endif + // d.localSpaceNormal = normalize(mul((float3x3)GetWorldToObjectMatrix(), d.worldSpaceNormal)); + // d.localSpaceTangent = normalize(mul((float3x3)GetWorldToObjectMatrix(), d.worldSpaceTangent.xyz)); + + // #if %SCREENPOSREQUIREKEY% + // d.screenUV = (IN.ScreenPosition.xy / max(0.01, IN.ScreenPosition.w)); + // #endif + + return d; + } +#else + + ShaderData CreateShaderData(VertexToPixel i + #if NEED_FACING + , bool facing + #endif + ) + { + ShaderData d = (ShaderData)0; + d.clipPos = i.pos; + d.worldSpacePosition = i.worldPos; + + d.worldSpaceNormal = normalize(i.worldNormal); + d.worldSpaceTangent.xyz = normalize(i.worldTangent.xyz); + + d.tangentSign = i.worldTangent.w * unity_WorldTransformParams.w; + float3 bitangent = cross(d.worldSpaceTangent.xyz, d.worldSpaceNormal) * d.tangentSign; + + d.TBNMatrix = float3x3(d.worldSpaceTangent, -bitangent, d.worldSpaceNormal); + d.worldSpaceViewDir = normalize(_WorldSpaceCameraPos - i.worldPos); + + d.tangentSpaceViewDir = mul(d.TBNMatrix, d.worldSpaceViewDir); + d.texcoord0 = i.texcoord0; + d.texcoord1 = i.texcoord1; + d.texcoord2 = i.texcoord2; + + // #if %TEXCOORD3REQUIREKEY% + d.texcoord3 = i.texcoord3; + // #endif + + // d.isFrontFace = facing; + // #if %VERTEXCOLORREQUIREKEY% + d.vertexColor = i.vertexColor; + // #endif + + // these rarely get used, so we back transform them. Usually will be stripped. + #if _HDRP + // d.localSpacePosition = mul(GetWorldToObjectMatrix(), float4(GetCameraRelativePositionWS(i.worldPos), 1)).xyz; + #else + // d.localSpacePosition = mul(GetWorldToObjectMatrix(), float4(i.worldPos, 1)).xyz; + #endif + // d.localSpaceNormal = normalize(mul((float3x3)GetWorldToObjectMatrix(), i.worldNormal)); + // d.localSpaceTangent = normalize(mul((float3x3)GetWorldToObjectMatrix(), i.worldTangent.xyz)); + + // #if %SCREENPOSREQUIREKEY% + // d.screenPos = i.screenPos; + // d.screenUV = (i.screenPos.xy / i.screenPos.w); + // #endif + + + // #if %EXTRAV2F0REQUIREKEY% + // d.extraV2F0 = i.extraV2F0; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // d.extraV2F1 = i.extraV2F1; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // d.extraV2F2 = i.extraV2F2; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // d.extraV2F3 = i.extraV2F3; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // d.extraV2F4 = i.extraV2F4; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // d.extraV2F5 = i.extraV2F5; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // d.extraV2F6 = i.extraV2F6; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // d.extraV2F7 = i.extraV2F7; + // #endif + + return d; + } + +#endif + + + #if defined(_PASSSHADOW) + float3 _LightDirection; + float3 _LightPosition; + #endif + + #if (_PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR))) + + #define GetWorldToViewMatrix() _ViewMatrix + #define UNITY_MATRIX_I_V _InvViewMatrix + #define GetViewToHClipMatrix() OptimizeProjectionMatrix(_ProjMatrix) + #define UNITY_MATRIX_I_P _InvProjMatrix + #define GetWorldToHClipMatrix() _ViewProjMatrix + #define UNITY_MATRIX_I_VP _InvViewProjMatrix + #define UNITY_MATRIX_UNJITTERED_VP _NonJitteredViewProjMatrix + #define UNITY_MATRIX_PREV_VP _PrevViewProjMatrix + #define UNITY_MATRIX_PREV_I_VP _PrevInvViewProjMatrix + + void MotionVectorPositionZBias(VertexToPixel input) + { + #if UNITY_REVERSED_Z + input.pos.z -= unity_MotionVectorsParams.z * input.pos.w; + #else + input.pos.z += unity_MotionVectorsParams.z * input.pos.w; + #endif + } + + #endif + + // vertex shader + VertexToPixel Vert (VertexData v) + { + VertexToPixel o = (VertexToPixel)0; + + UNITY_SETUP_INSTANCE_ID(v); + UNITY_TRANSFER_INSTANCE_ID(v, o); + UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o); + + + #if _URP && (_PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR))) + VertexData previousMesh = v; + #endif + #if !_TESSELLATION_ON + ChainModifyVertex(v, o, _Time); + #endif + + o.texcoord0 = v.texcoord0; + o.texcoord1 = v.texcoord1; + o.texcoord2 = v.texcoord2; + + // #if %TEXCOORD3REQUIREKEY% + o.texcoord3 = v.texcoord3; + // #endif + + // #if %VERTEXCOLORREQUIREKEY% + o.vertexColor = v.vertexColor; + // #endif + + // This return the camera relative position (if enable) + float3 positionWS = TransformObjectToWorld(v.vertex.xyz); + float3 normalWS = TransformObjectToWorldNormal(v.normal); + float4 tangentWS = float4(TransformObjectToWorldDir(v.tangent.xyz), v.tangent.w); + + VertexPositionInputs vertexInput = GetVertexPositionInputs(v.vertex.xyz); + o.worldPos = positionWS; + o.worldNormal = normalWS; + o.worldTangent = tangentWS; + + + // For some very odd reason, in 2021.2, we can't use Unity's defines, but have to use our own.. + #if _PASSSHADOW + #if _CASTING_PUNCTUAL_LIGHT_SHADOW + float3 lightDirectionWS = normalize(_LightPosition - o.worldPos); + #else + float3 lightDirectionWS = _LightDirection; + #endif + // Define shadow pass specific clip position for Universal + o.pos = TransformWorldToHClip(ApplyShadowBias(o.worldPos, o.worldNormal, lightDirectionWS)); + #if UNITY_REVERSED_Z + o.pos.z = min(o.pos.z, UNITY_NEAR_CLIP_VALUE); + #else + o.pos.z = max(o.pos.z, UNITY_NEAR_CLIP_VALUE); + #endif + #elif _PASSMETA + o.pos = MetaVertexPosition(float4(v.vertex.xyz, 0), v.texcoord1.xy, v.texcoord2.xy, unity_LightmapST, unity_DynamicLightmapST); + #else + o.pos = TransformWorldToHClip(o.worldPos); + #endif + + // #if %SCREENPOSREQUIREKEY% + // o.screenPos = ComputeScreenPos(o.pos, _ProjectionParams.x); + // #endif + + + #if _PASSFORWARD || _PASSGBUFFER + float2 uv1 = v.texcoord1.xy; + OUTPUT_LIGHTMAP_UV(uv1, unity_LightmapST, o.lightmapUV); + o.texcoord1.xy = uv1; + #if UNITY_VERSION < 60000009 + OUTPUT_SH(o.worldNormal, o.sh); + #endif + + #if defined(DYNAMICLIGHTMAP_ON) + o.dynamicLightmapUV.xy = v.texcoord2.xy * unity_DynamicLightmapST.xy + unity_DynamicLightmapST.zw; + #if UNITY_VERSION >= 60000009 + OUTPUT_SH(o.worldNormal, o.sh); + #endif + #elif (defined(PROBE_VOLUMES_L1) || defined(PROBE_VOLUMES_L2)) && UNITY_VERSION >= 60000009 + OUTPUT_SH4(vertexInput.positionWS, o.worldNormal.xyz, GetWorldSpaceNormalizeViewDir(vertexInput.positionWS), o.sh, o.probeOcclusion); + #endif + #endif + + #ifdef VARYINGS_NEED_FOG_AND_VERTEX_LIGHT + half fogFactor = 0; + #if defined(_FOG_FRAGMENT) + fogFactor = ComputeFogFactor(o.pos.z); + #endif + #if _BAKEDLIT + o.fogFactorAndVertexLight = half4(fogFactor, 0, 0, 0); + #else + half3 vertexLight = VertexLighting(o.worldPos, o.worldNormal); + o.fogFactorAndVertexLight = half4(fogFactor, vertexLight); + #endif + #endif + + #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR) + o.shadowCoord = GetShadowCoord(vertexInput); + #endif + + #if _URP && (_PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR))) + #if !defined(TESSELLATION_ON) + MotionVectorPositionZBias(o); + #endif + + o.previousPositionCS = float4(0.0, 0.0, 0.0, 1.0); + // Note: unity_MotionVectorsParams.y is 0 is forceNoMotion is enabled + bool forceNoMotion = unity_MotionVectorsParams.y == 0.0; + + if (!forceNoMotion) + { + #if defined(HAVE_VFX_MODIFICATION) + float3 previousPositionOS = currentFrameMvData.vfxParticlePositionOS; + #if defined(VFX_FEATURE_MOTION_VECTORS_VERTS) + const bool applyDeformation = false; + #else + const bool applyDeformation = true; + #endif + #else + const bool hasDeformation = unity_MotionVectorsParams.x == 1; // Mesh has skinned deformation + float3 previousPositionOS = hasDeformation ? previousMesh.previousPositionOS : previousMesh.vertex.xyz; + + #if defined(AUTOMATIC_TIME_BASED_MOTION_VECTORS) && defined(GRAPH_VERTEX_USES_TIME_PARAMETERS_INPUT) + const bool applyDeformation = true; + #else + const bool applyDeformation = hasDeformation; + #endif + #endif + // TODO + #if defined(FEATURES_GRAPH_VERTEX) + if (applyDeformation) + previousPositionOS = GetLastFrameDeformedPosition(previousMesh, currentFrameMvData, previousPositionOS); + else + previousPositionOS = previousMesh.positionOS; + + #if defined(FEATURES_GRAPH_VERTEX_MOTION_VECTOR_OUTPUT) + previousPositionOS -= previousMesh.precomputedVelocity; + #endif + #endif + + #if defined(UNITY_DOTS_INSTANCING_ENABLED) && defined(DOTS_DEFORMED) + // Deformed vertices in DOTS are not cumulative with built-in Unity skinning/blend shapes + // Needs to be called after vertex modification has been applied otherwise it will be + // overwritten by Compute Deform node + ApplyPreviousFrameDeformedVertexPosition(previousMesh.vertexID, previousPositionOS); + #endif + #if defined (_ADD_PRECOMPUTED_VELOCITY) + previousPositionOS -= previousMesh.precomputedVelocity; + #endif + o.positionCS = mul(UNITY_MATRIX_UNJITTERED_VP, float4(positionWS, 1.0f)); + + #if defined(HAVE_VFX_MODIFICATION) + #if defined(VFX_FEATURE_MOTION_VECTORS_VERTS) + #if defined(FEATURES_GRAPH_VERTEX_MOTION_VECTOR_OUTPUT) || defined(_ADD_PRECOMPUTED_VELOCITY) + #error Unexpected fast path rendering VFX motion vector while there are vertex modification afterwards. + #endif + o.previousPositionCS = VFXGetPreviousClipPosition(previousMesh, currentFrameMvData.vfxElementAttributes, o.positionCS); + #else + #if VFX_WORLD_SPACE + //previousPositionOS is already in world space + const float3 previousPositionWS = previousPositionOS; + #else + const float3 previousPositionWS = mul(UNITY_PREV_MATRIX_M, float4(previousPositionOS, 1.0f)).xyz; + #endif + o.previousPositionCS = mul(UNITY_MATRIX_PREV_VP, float4(previousPositionWS, 1.0f)); + #endif + #else + o.previousPositionCS = mul(UNITY_MATRIX_PREV_VP, mul(UNITY_PREV_MATRIX_M, float4(previousPositionOS, 1))); + #endif + } + #endif + + return o; + } + + + + + // fragment shader + half4 Frag (VertexToPixel IN + #ifdef _DEPTHOFFSET_ON + , out float outputDepth : SV_Depth + #endif + #if NEED_FACING + , bool facing : SV_IsFrontFace + #endif + ) : SV_Target + { + UNITY_SETUP_INSTANCE_ID(IN); + UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX(IN); + + #if defined(LOD_FADE_CROSSFADE) && USE_UNITY_CROSSFADE + LODFadeCrossFade(IN.pos); + #endif + + ShaderData d = CreateShaderData(IN + #if NEED_FACING + , facing + #endif + ); + Surface l = (Surface)0; + + #ifdef _DEPTHOFFSET_ON + l.outputDepth = outputDepth; + #endif + + l.Albedo = half3(0.5, 0.5, 0.5); + l.Normal = float3(0,0,1); + l.Occlusion = 1; + l.Alpha = 1; + + ChainSurfaceFunction(l, d); + + #ifdef _DEPTHOFFSET_ON + outputDepth = l.outputDepth; + #endif + + return 0; + + } + + ENDHLSL + + } + + + + Pass + { + Name "Meta" + Tags + { + "LightMode" = "Meta" + } + + Cull Off + + + Tags { "RenderType" = "Opaque" "Queue" = "Geometry" "PreviewType" = "Plane" } + Cull [_CullingOption] + ZWrite [_ZWrite] + ZTest [_ZTestMode] + + + HLSLPROGRAM + + #pragma vertex Vert + #pragma fragment Frag + + #pragma target 3.0 + + #pragma prefer_hlslcc gles + #pragma exclude_renderers d3d11_9x + + #define SHADERPASS SHADERPASS_META + #define _PASSMETA 1 + + + + #pragma shader_feature_local GLOW_ON + #pragma shader_feature_local FADE_ON + #pragma shader_feature_local OUTBASE_ON + #pragma shader_feature_local ONLYOUTLINE_ON + #pragma shader_feature_local GRADIENT_ON + #pragma shader_feature_local GRADIENT2COL_ON + #pragma shader_feature_local RADIALGRADIENT_ON + #pragma shader_feature_local COLORSWAP_ON + #pragma shader_feature_local HSV_ON + #pragma shader_feature_local CHANGECOLOR_ON + #pragma shader_feature_local CHANGECOLOR2_ON + #pragma shader_feature_local CHANGECOLOR3_ON + #pragma shader_feature_local COLORRAMP_ON + #pragma shader_feature_local GRADIENTCOLORRAMP_ON + #pragma shader_feature_local HITEFFECT_ON + #pragma shader_feature_local NEGATIVE_ON + #pragma shader_feature_local PIXELATE_ON + #pragma shader_feature_local GREYSCALE_ON + #pragma shader_feature_local POSTERIZE_ON + #pragma shader_feature_local BLUR_ON + #pragma shader_feature_local MOTIONBLUR_ON + #pragma shader_feature_local GHOST_ON + #pragma shader_feature_local ALPHAOUTLINE_ON + #pragma shader_feature_local INNEROUTLINE_ON + #pragma shader_feature_local ONLYINNEROUTLINE_ON + #pragma shader_feature_local HOLOGRAM_ON + #pragma shader_feature_local CHROMABERR_ON + #pragma shader_feature_local GLITCH_ON + #pragma shader_feature_local FLICKER_ON + #pragma shader_feature_local SHADOW_ON + #pragma shader_feature_local SHINE_ON + #pragma shader_feature_local CONTRAST_ON + #pragma shader_feature_local OVERLAY_ON + #pragma shader_feature_local OVERLAYMULT_ON + #pragma shader_feature_local DOODLE_ON + #pragma shader_feature_local WIND_ON + #pragma shader_feature_local WAVEUV_ON + #pragma shader_feature_local ROUNDWAVEUV_ON + #pragma shader_feature_local RECTSIZE_ON + #pragma shader_feature_local OFFSETUV_ON + #pragma shader_feature_local CLIPPING_ON + #pragma shader_feature_local RADIALCLIPPING_ON + #pragma shader_feature_local TEXTURESCROLL_ON + #pragma shader_feature_local ZOOMUV_ON + #pragma shader_feature_local DISTORT_ON + #pragma shader_feature_local WARP_ON + #pragma shader_feature_local TWISTUV_ON + #pragma shader_feature_local ROTATEUV_ON + #pragma shader_feature_local POLARUV_ON + #pragma shader_feature_local FISHEYE_ON + #pragma shader_feature_local PINCH_ON + #pragma shader_feature_local SHAKEUV_ON + + #pragma shader_feature_local GLOWTEX_ON + #pragma shader_feature_local OUTTEX_ON + #pragma shader_feature_local OUTDIST_ON + #pragma shader_feature_local OUTBASE8DIR_ON + #pragma shader_feature_local OUTBASEPIXELPERF_ON + #pragma shader_feature_local COLORRAMPOUTLINE_ON + #pragma shader_feature_local GREYSCALEOUTLINE_ON + #pragma shader_feature_local POSTERIZEOUTLINE_ON + #pragma shader_feature_local BLURISHD_ON + #pragma shader_feature_local MANUALWIND_ON + #pragma shader_feature_local ATLAS_ON + #pragma shader_feature_local PREMULTIPLYALPHA_ON + + #pragma shader_feature BILBOARD_ON + #pragma shader_feature BILBOARDY_ON + + #pragma shader_feature NORMALMAP_ON + + + #define _URP 1 +#define _USINGTEXCOORD1 1 +#define _USINGTEXCOORD2 1 + + + + // Includes + #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.universal/ShaderLibrary/Input.hlsl" + #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/TextureStack.hlsl" + #include_with_pragmas "Packages/com.unity.render-pipelines.core/ShaderLibrary/FoveatedRenderingKeywords.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" + + #undef WorldNormalVector + #define WorldNormalVector(data, normal) mul(normal, data.TBNMatrix) + + #define UnityObjectToWorldNormal(normal) mul(GetObjectToWorldMatrix(), normal) + + #define _WorldSpaceLightPos0 _MainLightPosition + + #define UNITY_DECLARE_TEX2D(name) TEXTURE2D(name); SAMPLER(sampler##name); + #define UNITY_DECLARE_TEX2D_NOSAMPLER(name) TEXTURE2D(name); + #define UNITY_DECLARE_TEX2DARRAY(name) TEXTURE2D_ARRAY(name); SAMPLER(sampler##name); + #define UNITY_DECLARE_TEX2DARRAY_NOSAMPLER(name) TEXTURE2D_ARRAY(name); + + #define UNITY_SAMPLE_TEX2DARRAY(tex,coord) SAMPLE_TEXTURE2D_ARRAY(tex, sampler##tex, coord.xy, coord.z) + #define UNITY_SAMPLE_TEX2DARRAY_LOD(tex,coord,lod) SAMPLE_TEXTURE2D_ARRAY_LOD(tex, sampler##tex, coord.xy, coord.z, lod) + #define UNITY_SAMPLE_TEX2D(tex, coord) SAMPLE_TEXTURE2D(tex, sampler##tex, coord) + #define UNITY_SAMPLE_TEX2D_SAMPLER(tex, samp, coord) SAMPLE_TEXTURE2D(tex, sampler##samp, coord) + + #define UNITY_SAMPLE_TEX2D_LOD(tex,coord, lod) SAMPLE_TEXTURE2D_LOD(tex, sampler_##tex, coord, lod) + #define UNITY_SAMPLE_TEX2D_SAMPLER_LOD(tex,samplertex,coord, lod) SAMPLE_TEXTURE2D_LOD (tex, sampler##samplertex,coord, lod) + + #if defined(UNITY_COMPILER_HLSL) + #define UNITY_INITIALIZE_OUTPUT(type,name) name = (type)0; + #else + #define UNITY_INITIALIZE_OUTPUT(type,name) + #endif + + #define sampler2D_float sampler2D + #define sampler2D_half sampler2D + + + + // data across stages, stripped like the above. + struct VertexToPixel + { + float4 pos : SV_POSITION; + float3 worldPos : TEXCOORD0; + float3 worldNormal : TEXCOORD1; + float4 worldTangent : TEXCOORD2; + float4 texcoord0 : TEXCOORD3; + float4 texcoord1 : TEXCOORD4; + float4 texcoord2 : TEXCOORD5; + + // #if %TEXCOORD3REQUIREKEY% + float4 texcoord3 : TEXCOORD6; + // #endif + + // #if %SCREENPOSREQUIREKEY% + // float4 screenPos : TEXCOORD7; + // #endif + + // #if %VERTEXCOLORREQUIREKEY% + half4 vertexColor : COLOR; + // #endif + + #if defined(LIGHTMAP_ON) + float2 lightmapUV : TEXCOORD8; + #endif + #if defined(DYNAMICLIGHTMAP_ON) + float2 dynamicLightmapUV : TEXCOORD9; + #endif + #if !defined(LIGHTMAP_ON) + float4 probeOcclusion : TEXCOORD8; + float3 sh : TEXCOORD10; + #endif + + #if defined(VARYINGS_NEED_FOG_AND_VERTEX_LIGHT) + float4 fogFactorAndVertexLight : TEXCOORD11; + #endif + + #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR) + float4 shadowCoord : TEXCOORD12; + #endif + + // #if %EXTRAV2F0REQUIREKEY% + // float4 extraV2F0 : TEXCOORD13; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // float4 extraV2F1 : TEXCOORD14; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // float4 extraV2F2 : TEXCOORD15; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // float4 extraV2F3 : TEXCOORD16; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // float4 extraV2F4 : TEXCOORD17; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // float4 extraV2F5 : TEXCOORD18; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // float4 extraV2F6 : TEXCOORD19; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // float4 extraV2F7 : TEXCOORD20; + // #endif + + #if UNITY_ANY_INSTANCING_ENABLED + uint instanceID : CUSTOM_INSTANCE_ID; + #endif + #if (defined(UNITY_STEREO_MULTIVIEW_ENABLED)) || (defined(UNITY_STEREO_INSTANCING_ENABLED) && (defined(SHADER_API_GLES3) || defined(SHADER_API_GLCORE))) + uint stereoTargetEyeIndexAsBlendIdx0 : BLENDINDICES0; + #endif + #if (defined(UNITY_STEREO_INSTANCING_ENABLED)) + uint stereoTargetEyeIndexAsRTArrayIdx : SV_RenderTargetArrayIndex; + #endif + #if defined(SHADER_STAGE_FRAGMENT) && defined(VARYINGS_NEED_CULLFACE) + FRONT_FACE_TYPE cullFace : FRONT_FACE_SEMANTIC; + #endif + + #if _PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR)) + float4 previousPositionCS : TEXCOORD21; // Contain previous transform position (in case of skinning for example) + float4 positionCS : TEXCOORD22; + #endif + }; + + + + + // data describing the user output of a pixel + struct Surface + { + half3 Albedo; + half Height; + half3 Normal; + half Smoothness; + half3 Emission; + half Metallic; + half3 Specular; + half Occlusion; + half SpecularPower; // for simple lighting + half Alpha; + float outputDepth; // if written, SV_Depth semantic is used. ShaderData.clipPos.z is unused value + // HDRP Only + half SpecularOcclusion; + half SubsurfaceMask; + half Thickness; + half CoatMask; + half CoatSmoothness; + half Anisotropy; + half IridescenceMask; + half IridescenceThickness; + int DiffusionProfileHash; + float SpecularAAThreshold; + float SpecularAAScreenSpaceVariance; + // requires _OVERRIDE_BAKEDGI to be defined, but is mapped in all pipelines + float3 DiffuseGI; + float3 BackDiffuseGI; + float3 SpecularGI; + float ior; + float3 transmittanceColor; + float atDistance; + float transmittanceMask; + // requires _OVERRIDE_SHADOWMASK to be defines + float4 ShadowMask; + + // for decals + float NormalAlpha; + float MAOSAlpha; + + + }; + + // Data the user declares in blackboard blocks + struct Blackboard + { + + float blackboardDummyData; + }; + + // data the user might need, this will grow to be big. But easy to strip + struct ShaderData + { + float4 clipPos; // SV_POSITION + float3 localSpacePosition; + float3 localSpaceNormal; + float3 localSpaceTangent; + + float3 worldSpacePosition; + float3 worldSpaceNormal; + float3 worldSpaceTangent; + float tangentSign; + + float3 worldSpaceViewDir; + float3 tangentSpaceViewDir; + + float4 texcoord0; + float4 texcoord1; + float4 texcoord2; + float4 texcoord3; + + float2 screenUV; + float4 screenPos; + + float4 vertexColor; + bool isFrontFace; + + float4 extraV2F0; + float4 extraV2F1; + float4 extraV2F2; + float4 extraV2F3; + float4 extraV2F4; + float4 extraV2F5; + float4 extraV2F6; + float4 extraV2F7; + + float3x3 TBNMatrix; + Blackboard blackboard; + }; + + struct VertexData + { + #if SHADER_TARGET > 30 + // uint vertexID : SV_VertexID; + #endif + float4 vertex : POSITION; + float3 normal : NORMAL; + float4 tangent : TANGENT; + float4 texcoord0 : TEXCOORD0; + + // optimize out mesh coords when not in use by user or lighting system + #if _URP && (_USINGTEXCOORD1 || _PASSMETA || _PASSFORWARD || _PASSGBUFFER) + float4 texcoord1 : TEXCOORD1; + #endif + + #if _URP && (_USINGTEXCOORD2 || _PASSMETA || ((_PASSFORWARD || _PASSGBUFFER) && defined(DYNAMICLIGHTMAP_ON))) + float4 texcoord2 : TEXCOORD2; + #endif + + #if _STANDARD && (_USINGTEXCOORD1 || (_PASSMETA || ((_PASSFORWARD || _PASSGBUFFER || _PASSFORWARDADD) && LIGHTMAP_ON))) + float4 texcoord1 : TEXCOORD1; + #endif + #if _STANDARD && (_USINGTEXCOORD2 || (_PASSMETA || ((_PASSFORWARD || _PASSGBUFFER) && DYNAMICLIGHTMAP_ON))) + float4 texcoord2 : TEXCOORD2; + #endif + + + #if _HDRP + float4 texcoord1 : TEXCOORD1; + float4 texcoord2 : TEXCOORD2; + #endif + + // #if %TEXCOORD3REQUIREKEY% + float4 texcoord3 : TEXCOORD3; + // #endif + + // #if %VERTEXCOLORREQUIREKEY% + float4 vertexColor : COLOR; + // #endif + + #if _PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR)) + float3 previousPositionOS : TEXCOORD4; // Contain previous transform position (in case of skinning for example) + #if defined (_ADD_PRECOMPUTED_VELOCITY) + float3 precomputedVelocity : TEXCOORD5; // Add Precomputed Velocity (Alembic computes velocities on runtime side). + #endif + #endif + + UNITY_VERTEX_INPUT_INSTANCE_ID + }; + + struct TessVertex + { + float4 vertex : INTERNALTESSPOS; + float3 normal : NORMAL; + float4 tangent : TANGENT; + float4 texcoord0 : TEXCOORD0; + float4 texcoord1 : TEXCOORD1; + float4 texcoord2 : TEXCOORD2; + + // #if %TEXCOORD3REQUIREKEY% + float4 texcoord3 : TEXCOORD3; + // #endif + + // #if %VERTEXCOLORREQUIREKEY% + float4 vertexColor : COLOR; + // #endif + + // #if %EXTRAV2F0REQUIREKEY% + // float4 extraV2F0 : TEXCOORD5; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // float4 extraV2F1 : TEXCOORD6; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // float4 extraV2F2 : TEXCOORD7; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // float4 extraV2F3 : TEXCOORD8; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // float4 extraV2F4 : TEXCOORD9; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // float4 extraV2F5 : TEXCOORD10; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // float4 extraV2F6 : TEXCOORD11; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // float4 extraV2F7 : TEXCOORD12; + // #endif + + #if _PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR)) + float3 previousPositionOS : TEXCOORD13; // Contain previous transform position (in case of skinning for example) + #if defined (_ADD_PRECOMPUTED_VELOCITY) + float3 precomputedVelocity : TEXCOORD14; + #endif + #endif + + UNITY_VERTEX_INPUT_INSTANCE_ID + UNITY_VERTEX_OUTPUT_STEREO + }; + + struct ExtraV2F + { + float4 extraV2F0; + float4 extraV2F1; + float4 extraV2F2; + float4 extraV2F3; + float4 extraV2F4; + float4 extraV2F5; + float4 extraV2F6; + float4 extraV2F7; + Blackboard blackboard; + float4 time; + }; + + + float3 WorldToTangentSpace(ShaderData d, float3 normal) + { + return mul(d.TBNMatrix, normal); + } + + float3 TangentToWorldSpace(ShaderData d, float3 normal) + { + return mul(normal, d.TBNMatrix); + } + + // in this case, make standard more like SRPs, because we can't fix + // unity_WorldToObject in HDRP, since it already does macro-fu there + + #if _STANDARD + float3 TransformWorldToObject(float3 p) { return mul(unity_WorldToObject, float4(p, 1)); }; + float3 TransformObjectToWorld(float3 p) { return mul(unity_ObjectToWorld, float4(p, 1)); }; + float4 TransformWorldToObject(float4 p) { return mul(unity_WorldToObject, p); }; + float4 TransformObjectToWorld(float4 p) { return mul(unity_ObjectToWorld, p); }; + float4x4 GetWorldToObjectMatrix() { return unity_WorldToObject; } + float4x4 GetObjectToWorldMatrix() { return unity_ObjectToWorld; } + #if (defined(SHADER_API_D3D11) || defined(SHADER_API_XBOXONE) || defined(UNITY_COMPILER_HLSLCC) || defined(SHADER_API_PSSL) || (SHADER_TARGET_SURFACE_ANALYSIS && !SHADER_TARGET_SURFACE_ANALYSIS_MOJOSHADER)) + #define UNITY_SAMPLE_TEX2D_LOD(tex,coord, lod) tex.SampleLevel (sampler##tex,coord, lod) + #define UNITY_SAMPLE_TEX2D_SAMPLER_LOD(tex,samplertex,coord, lod) tex.SampleLevel (sampler##samplertex,coord, lod) + #else + #define UNITY_SAMPLE_TEX2D_LOD(tex,coord,lod) tex2D (tex,coord,0,lod) + #define UNITY_SAMPLE_TEX2D_SAMPLER_LOD(tex,samplertex,coord,lod) tex2D (tex,coord,0,lod) + #endif + + #undef GetWorldToObjectMatrix() + + #define GetWorldToObjectMatrix() unity_WorldToObject + + + #endif + + float3 GetCameraWorldPosition() + { + #if _HDRP + return GetCameraRelativePositionWS(_WorldSpaceCameraPos); + #else + return _WorldSpaceCameraPos; + #endif + } + + #if _GRABPASSUSED + #if _STANDARD + TEXTURE2D(%GRABTEXTURE%); + SAMPLER(sampler_%GRABTEXTURE%); + #endif + + half3 GetSceneColor(float2 uv) + { + #if _STANDARD + return SAMPLE_TEXTURE2D(%GRABTEXTURE%, sampler_%GRABTEXTURE%, uv).rgb; + #else + return SHADERGRAPH_SAMPLE_SCENE_COLOR(uv); + #endif + } + #endif + + + + #if _STANDARD + UNITY_DECLARE_DEPTH_TEXTURE(_CameraDepthTexture); + float GetSceneDepth(float2 uv) { return SAMPLE_DEPTH_TEXTURE(_CameraDepthTexture, uv); } + float GetLinear01Depth(float2 uv) { return Linear01Depth(GetSceneDepth(uv)); } + float GetLinearEyeDepth(float2 uv) { return LinearEyeDepth(GetSceneDepth(uv)); } + #else + float GetSceneDepth(float2 uv) { return SHADERGRAPH_SAMPLE_SCENE_DEPTH(uv); } + float GetLinear01Depth(float2 uv) { return Linear01Depth(GetSceneDepth(uv), _ZBufferParams); } + float GetLinearEyeDepth(float2 uv) { return LinearEyeDepth(GetSceneDepth(uv), _ZBufferParams); } + #endif + + float3 GetWorldPositionFromDepthBuffer(float2 uv, float3 worldSpaceViewDir) + { + float eye = GetLinearEyeDepth(uv); + float3 camView = mul((float3x3)GetObjectToWorldMatrix(), transpose(mul(GetWorldToObjectMatrix(), UNITY_MATRIX_I_V)) [2].xyz); + + float dt = dot(worldSpaceViewDir, camView); + float3 div = worldSpaceViewDir/dt; + float3 wpos = (eye * div) + GetCameraWorldPosition(); + return wpos; + } + + #if _HDRP + float3 ObjectToWorldSpacePosition(float3 pos) + { + return GetAbsolutePositionWS(TransformObjectToWorld(pos)); + } + #else + float3 ObjectToWorldSpacePosition(float3 pos) + { + return TransformObjectToWorld(pos); + } + #endif + + #if _STANDARD + UNITY_DECLARE_SCREENSPACE_TEXTURE(_CameraDepthNormalsTexture); + float3 GetSceneNormal(float2 uv, float3 worldSpaceViewDir) + { + float4 depthNorms = UNITY_SAMPLE_SCREENSPACE_TEXTURE(_CameraDepthNormalsTexture, uv); + float3 norms = DecodeViewNormalStereo(depthNorms); + norms = mul((float3x3)GetWorldToViewMatrix(), norms) * 0.5 + 0.5; + return norms; + } + #elif _HDRP && !_DECALSHADER + + float3 GetSceneNormal(float2 uv, float3 worldSpaceViewDir) + { + NormalData nd; + DecodeFromNormalBuffer(_ScreenSize.xy * uv, nd); + return nd.normalWS; + } + #elif _URP + #if (SHADER_LIBRARY_VERSION_MAJOR >= 10) + #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/DeclareNormalsTexture.hlsl" + #endif + + float3 GetSceneNormal(float2 uv, float3 worldSpaceViewDir) + { + #if (SHADER_LIBRARY_VERSION_MAJOR >= 10) + return SampleSceneNormals(uv); + #else + float3 wpos = GetWorldPositionFromDepthBuffer(uv, worldSpaceViewDir); + return normalize(-cross(ddx(wpos), ddy(wpos))) * 0.5 + 0.5; + #endif + + } + #endif + + #if _HDRP + + half3 UnpackNormalmapRGorAG(half4 packednormal) + { + // This do the trick + packednormal.x *= packednormal.w; + + half3 normal; + normal.xy = packednormal.xy * 2 - 1; + normal.z = sqrt(1 - saturate(dot(normal.xy, normal.xy))); + return normal; + } + half3 UnpackNormal(half4 packednormal) + { + #if defined(UNITY_NO_DXT5nm) + return packednormal.xyz * 2 - 1; + #else + return UnpackNormalmapRGorAG(packednormal); + #endif + } + #endif + #if _HDRP || _URP + + half3 UnpackScaleNormal(half4 packednormal, half scale) + { + #ifndef UNITY_NO_DXT5nm + // Unpack normal as DXT5nm (1, y, 1, x) or BC5 (x, y, 0, 1) + // Note neutral texture like "bump" is (0, 0, 1, 1) to work with both plain RGB normal and DXT5nm/BC5 + packednormal.x *= packednormal.w; + #endif + half3 normal; + normal.xy = (packednormal.xy * 2 - 1) * scale; + normal.z = sqrt(1 - saturate(dot(normal.xy, normal.xy))); + return normal; + } + + #endif + + + void GetSun(out float3 lightDir, out float3 color) + { + lightDir = float3(0.5, 0.5, 0); + color = 1; + #if _HDRP + if (_DirectionalLightCount > 0) + { + DirectionalLightData light = _DirectionalLightDatas[0]; + lightDir = -light.forward.xyz; + color = light.color; + } + #elif _STANDARD + lightDir = normalize(_WorldSpaceLightPos0.xyz); + color = _LightColor0.rgb; + #elif _URP + Light light = GetMainLight(); + lightDir = light.direction; + color = light.color; + #endif + } + + + + CBUFFER_START(UnityPerMaterial) + + + half4 _Color; + half4 _MainTex_ST, _MainTex_TexelSize; + half _Alpha, _AlphaCutoffValue; + + #if ATLAS_ON + half _MinXUV, _MaxXUV, _MinYUV, _MaxYUV; + #endif + + #if GLOW_ON + half4 _GlowColor; + half _Glow, _GlowGlobal; + #endif + + #if HSV_ON + half _HsvShift, _HsvSaturation, _HsvBright; + #endif + + #if DISTORT_ON + half4 _DistortTex_ST; + half _DistortTexXSpeed, _DistortTexYSpeed, _DistortAmount; + #endif + + #if FADE_ON + half4 _FadeBurnColor, _FadeTex_ST, _FadeBurnTex_ST; + half _FadeAmount, _FadeBurnWidth, _FadeBurnTransition,_FadeBurnGlow; + #endif + + #if OUTBASE_ON + half4 _OutlineColor; + half _OutlineAlpha, _OutlineGlow, _OutlineWidth; + int _OutlinePixelWidth; + #endif + + #if OUTTEX_ON + half4 _OutlineTex_ST; + half _OutlineTexXSpeed, _OutlineTexYSpeed; + #endif + + #if OUTDIST_ON + half4 _OutlineDistortTex_ST; + half _OutlineDistortTexXSpeed, _OutlineDistortTexYSpeed, _OutlineDistortAmount; + #endif + + #if ALPHAOUTLINE_ON + half _AlphaOutlineGlow, _AlphaOutlinePower, _AlphaOutlineMinAlpha, _AlphaOutlineBlend; + half4 _AlphaOutlineColor; + #endif + + #if INNEROUTLINE_ON + half _InnerOutlineThickness, _InnerOutlineAlpha, _InnerOutlineGlow; + half4 _InnerOutlineColor; + #endif + + #if GRADIENT_ON + half _GradBlend, _GradBoostX, _GradBoostY; + half4 _GradTopRightCol, _GradTopLeftCol, _GradBotRightCol, _GradBotLeftCol; + #endif + + #if COLORSWAP_ON + half4 _ColorSwapRed, _ColorSwapGreen, _ColorSwapBlue; + half _ColorSwapRedLuminosity, _ColorSwapGreenLuminosity, _ColorSwapBlueLuminosity, _ColorSwapBlend; + #endif + + #if CHANGECOLOR_ON + half4 _ColorChangeNewCol, _ColorChangeTarget; + half _ColorChangeTolerance, _ColorChangeLuminosity; + #endif + #if CHANGECOLOR2_ON + half4 _ColorChangeNewCol2, _ColorChangeTarget2; + half _ColorChangeTolerance2; + #endif + #if CHANGECOLOR3_ON + half4 _ColorChangeNewCol3, _ColorChangeTarget3; + half _ColorChangeTolerance3; + #endif + + #if COLORRAMP_ON + half _ColorRampLuminosity, _ColorRampBlend; + #endif + + #if HITEFFECT_ON + half4 _HitEffectColor; + half _HitEffectGlow, _HitEffectBlend; + #endif + + #if NEGATIVE_ON + half _NegativeAmount; + #endif + + #if PIXELATE_ON + half _PixelateSize; + #endif + + #if GREYSCALE_ON + half _GreyscaleLuminosity, _GreyscaleBlend; + half4 _GreyscaleTintColor; + #endif + + #if POSTERIZE_ON + half _PosterizeNumColors, _PosterizeGamma; + #endif + + #if BLUR_ON + half _BlurIntensity; + #endif + + #if MOTIONBLUR_ON + half _MotionBlurAngle, _MotionBlurDist; + #endif + + #if GHOST_ON + half _GhostColorBoost, _GhostTransparency, _GhostBlend; + #endif + + #if HOLOGRAM_ON + half _HologramStripesAmount, _HologramMinAlpha, _HologramUnmodAmount, _HologramStripesSpeed, _HologramMaxAlpha, _HologramBlend; + half4 _HologramStripeColor; + #endif + + #if CHROMABERR_ON + half _ChromAberrAmount, _ChromAberrAlpha; + #endif + + #if GLITCH_ON + half _GlitchAmount, _GlitchSize; + #endif + + #if FLICKER_ON + half _FlickerFreq, _FlickerPercent, _FlickerAlpha; + #endif + + #if SHADOW_ON + half _ShadowX, _ShadowY, _ShadowAlpha; + half4 _ShadowColor; + #endif + + #if SHINE_ON + half4 _ShineColor; + half _ShineLocation, _ShineRotate, _ShineWidth, _ShineGlow; + #endif + + #if CONTRAST_ON + half _Contrast, _Brightness; + #endif + + #if OVERLAY_ON + half4 _OverlayTex_ST, _OverlayColor; + half _OverlayGlow, _OverlayBlend, _OverlayTextureScrollXSpeed, _OverlayTextureScrollYSpeed; + #endif + + #if DOODLE_ON + half _HandDrawnAmount, _HandDrawnSpeed; + #endif + + #if WIND_ON + half _GrassSpeed, _GrassWind, _GrassManualAnim, _GrassRadialBend; + #endif + + #if WAVEUV_ON + float _WaveAmount, _WaveSpeed, _WaveStrength, _WaveX, _WaveY; + #endif + + #if ROUNDWAVEUV_ON + half _RoundWaveStrength, _RoundWaveSpeed; + #endif + + #if RECTSIZE_ON + half _RectSize; + #endif + + #if OFFSETUV_ON + half _OffsetUvX, _OffsetUvY; + #endif + + #if CLIPPING_ON + half _ClipUvLeft, _ClipUvRight, _ClipUvUp, _ClipUvDown; + #endif + + #if RADIALCLIPPING_ON + half _RadialStartAngle, _RadialClip, _RadialClip2; + #endif + + #if TEXTURESCROLL_ON + half _TextureScrollXSpeed, _TextureScrollYSpeed; + #endif + + #if ZOOMUV_ON + half _ZoomUvAmount; + #endif + + #if WARP_ON + half _WarpStrength, _WarpSpeed, _WarpScale; + #endif + + #if TWISTUV_ON + half _TwistUvAmount, _TwistUvPosX, _TwistUvPosY, _TwistUvRadius; + #endif + + #if ROTATEUV_ON + half _RotateUvAmount; + #endif + + #if FISHEYE_ON + half _FishEyeUvAmount; + #endif + + #if PINCH_ON + half _PinchUvAmount; + #endif + + #if SHAKEUV_ON + half _ShakeUvSpeed, _ShakeUvX, _ShakeUvY; + #endif + + #if NORMALMAP_ON + half _NormalStrength; + #endif + + float _RandomSeed; + + + + + CBUFFER_END + + + + + + + + TEXTURE2D(_MainTex); + SAMPLER(sampler_MainTex); + + #if GLOW_ON + TEXTURE2D(_GlowTex); + SAMPLER(sampler_GlowTex); + #endif + + #if FADE_ON + TEXTURE2D(_FadeTex); + SAMPLER(sampler_FadeTex); + + TEXTURE2D(_FadeBurnTex); + SAMPLER(sampler_FadeBurnTex); + #endif + + #if DISTORT_ON + TEXTURE2D(_DistortTex); + SAMPLER(sampler_DistortTex); + #endif + + #if OUTTEX_ON + TEXTURE2D(_OutlineTex); + SAMPLER(sampler_OutlineTex); + #endif + + #if OUTDIST_ON + TEXTURE2D(_OutlineDistortTex); + SAMPLER(sampler_OutlineDistortTex); + #endif + + #if COLORSWAP_ON + TEXTURE2D(_ColorSwapTex); + SAMPLER(sampler_ColorSwapTex); + #endif + + #if COLORRAMP_ON + TEXTURE2D(_ColorRampTex); + TEXTURE2D(_ColorRampTexGradient); + SAMPLER(sampler_ColorRampTex); + SAMPLER(sampler_ColorRampTexGradient); + #endif + + #if SHINE_ON + TEXTURE2D(_ShineMask); + SAMPLER(sampler_ShineMask); + #endif + + #if OVERLAY_ON + TEXTURE2D(_OverlayTex); + SAMPLER(sampler_OverlayTex); + #endif + + #if NORMALMAP_ON + TEXTURE2D(_NormalMap); + SAMPLER(sampler_NormalMap); + #endif + + + half3 GetPixel(in int offsetX, in int offsetY, in half2 uv, in Texture2D _tex, in SamplerState _sampler) + { + half2 _uv = uv + half2(offsetX * _MainTex_TexelSize.x, offsetY * _MainTex_TexelSize.y); + half4 col = SAMPLE_TEXTURE2D(_tex, _sampler, _uv); + return col.rgb; + } + + + //BLURS------------------------------------------------------------------------- + half4 Blur(half2 uv, Texture2D source, SamplerState sampler_source, half Intensity) + { + const half2 texelSize = 1.0 / _ScreenParams.xy; + const half4 color = SAMPLE_TEXTURE2D(source, sampler_source, uv); + const half2 offset = Intensity * texelSize; + + half4 accumulatedColor = color; + half accumulatedWeight = 1.0; + for (int x = -1; x <= 1; x++) + { + for (int y = -1; y <= 1; y++) + { + const half2 sampleUV = uv + half2(x, y) * offset; + const half4 sampleColor = SAMPLE_TEXTURE2D(source, sampler_source, sampleUV); + + accumulatedColor += sampleColor; + accumulatedWeight += 1.0; + } + } + + half4 blurredColor = accumulatedColor / accumulatedWeight; + return blurredColor; + } + + half BlurHD_G(half bhqp, half x) + { + return exp(-(x * x) / (2.0 * bhqp * bhqp)); + } + half4 BlurHD(half2 uv, Texture2D source, SamplerState sampler_source, half BlurAmount, half xScale, half yScale) + { + int iterations = 16; + int halfIterations = iterations / 2; + half sigmaX = 0.1 + BlurAmount * 0.5; + half sigmaY = sigmaX; + half total = 0.0; + half4 ret = half4(0, 0, 0, 0); + for (int iy = 0; iy < iterations; ++iy) + { + half fy = BlurHD_G(sigmaY, half(iy) -half(halfIterations)); + half offsetY = half(iy - halfIterations) * 0.00390625 * xScale; + for (int ix = 0; ix < iterations; ++ix) + { + half fx = BlurHD_G(sigmaX, half(ix) - half(halfIterations)); + half offsetX = half(ix - halfIterations) * 0.00390625 * yScale; + total += fx * fy; + ret += SAMPLE_TEXTURE2D(source, sampler_source, uv + half2(offsetX, offsetY)) * fx * fy; + } + } + return ret / total; + } + //----------------------------------------------------------------------- + + + //------------------------------------------- + half RemapFloat(half inValue, half inMin, half inMax, half outMin, half outMax){ + return outMin + (inValue - inMin) * (outMax - outMin) / (inMax - inMin); + } + //------------------------------------------- + + //----------------------------------------------------------------------- + half rand(half2 seed, half offset) { + return (frac(sin(dot(seed, half2(12.9898, 78.233))) * 43758.5453) + offset) % 1.0; + } + + half rand2(half2 seed, half offset) { + return (frac(sin(dot(seed * floor(50 + (_Time.x % 1.0) * 12.), half2(127.1, 311.7))) * 43758.5453123) + offset) % 1.0; + } + + half rand2CustomTime(half2 seed, half offset, half customTime) { + return (frac(sin(dot(seed * floor(50 + (customTime % 1.0) * 12.), half2(127.1, 311.7))) * 43758.5453123) + offset) % 1.0; + } + //----------------------------------------------------------------------- + + + void Ext_ModifyVertex0 (inout VertexData v, inout ExtraV2F d) + { + //BILBOARD_ON + #if BILBOARD_ON + half3 camRight = mul((half3x3)unity_CameraToWorld, half3(1,0,0)); + half3 camUp = half3(0,1,0); + #if BILBOARDY_ON + camUp = mul((half3x3)unity_CameraToWorld, half3(0,1,0)); + #endif + half3 localPos = v.vertex.x * camRight + v.vertex.y * camUp; + v.vertex = half4(localPos, 1); + #endif + //----------------------------------------------------------- + + v.texcoord0.xy = TRANSFORM_TEX(v.texcoord0.xy, _MainTex); + half2 center = half2(0.5, 0.5); + #if ATLAS_ON + center = half2((_MaxXUV + _MinXUV) / 2.0, (_MaxYUV + _MinYUV) / 2.0); + #endif + + //POLARUV_ON + #if POLARUV_ON + v.texcoord0.xy = v.texcoord0.xy - center; + #endif + + //---------------------------------------- + + //ROTATEUV_ON + #if ROTATEUV_ON + half2 uvC = v.texcoord0.xy; + half cosAngle = cos(_RotateUvAmount); + half sinAngle = sin(_RotateUvAmount); + half2x2 rot = half2x2(cosAngle, -sinAngle, sinAngle, cosAngle); + uvC -= center; + v.texcoord0.xy = mul(rot, uvC); + v.texcoord0.xy += center; + #endif + //-------------------- + + #if RECTSIZE_ON + v.vertex.xyz += (v.vertex.xyz * (_RectSize - 1.0)); + #endif + + #if OUTTEX_ON + v.texcoord1.xy = TRANSFORM_TEX(v.texcoord0.xy, _OutlineTex); + #endif + + #if OUTDIST_ON + v.texcoord2.xy = TRANSFORM_TEX(v.texcoord0.xy, _OutlineDistortTex); + #endif + + #if DISTORT_ON + v.texcoord3.xy = TRANSFORM_TEX(v.texcoord0.xy, _DistortTex); + #endif + } + + void Ext_SurfaceFunction0 (inout Surface o, ShaderData d) + { + half randomSeed = _RandomSeed; + + float2 uvRect = d.texcoord0; + half2 center = half2(0.5, 0.5); + #if ATLAS_ON + center = half2((_MaxXUV + _MinXUV) / 2.0, (_MaxYUV + _MinYUV) / 2.0); + uvRect = half2((d.texcoord0.x - _MinXUV) / (_MaxXUV - _MinXUV), (d.texcoord0.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half2 centerTiled = half2(center.x * _MainTex_ST.x, center.y * _MainTex_ST.y); + + //CLIPPING_ON + #if CLIPPING_ON + half2 tiledUv = half2(d.texcoord0.x / _MainTex_ST.x, d.texcoord0.y / _MainTex_ST.y); + #if ATLAS_ON + tiledUv = half2((tiledUv.x - _MinXUV) / (_MaxXUV - _MinXUV), (tiledUv.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + clip((1 - _ClipUvUp) - tiledUv.y); + clip(tiledUv.y - _ClipUvDown); + clip((1 - _ClipUvRight) - tiledUv.x); + clip(tiledUv.x - _ClipUvLeft); + #endif + //---------------------------------- + + //RADIALCLIPPING_ON + #if RADIALCLIPPING_ON + half2 tiledUv2 = half2(d.texcoord0.x / _MainTex_ST.x, d.texcoord0.y / _MainTex_ST.y); + #if ATLAS_ON + tiledUv2 = half2((tiledUv2.x - _MinXUV) / (_MaxXUV - _MinXUV), (tiledUv2.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half startAngle = _RadialStartAngle - _RadialClip; + half endAngle = _RadialStartAngle + _RadialClip2; + half offset0 = clamp(0, 360, startAngle + 360); + half offset360 = clamp(0, 360, endAngle - 360); + half2 atan2Coord = half2(lerp(-1, 1, tiledUv2.x), lerp(-1, 1, tiledUv2.y)); + half atanAngle = atan2(atan2Coord.y, atan2Coord.x) * 57.3; // angle in degrees + if(atanAngle < 0) atanAngle = 360 + atanAngle; + if(atanAngle >= startAngle && atanAngle <= endAngle) discard; + if(atanAngle <= offset360) discard; + if(atanAngle >= offset0) discard; + #endif + + //----------------------------- + + //TEXTURESCROLL_ON && ATLAS_ON + #if TEXTURESCROLL_ON && ATLAS_ON + d.texcoord0.xy = half2(_MinXUV + ((_MaxXUV - _MinXUV) * (abs(((_Time.y + randomSeed) * _TextureScrollXSpeed) + uvRect.x) % 1)), + _MinYUV + ((_MaxYUV - _MinYUV) * (abs(((_Time.y + randomSeed) * _TextureScrollYSpeed) + uvRect.y) % 1))); + #endif + //---------------------------- + + //OFFSETUV_ON + #if OFFSETUV_ON + #if ATLAS_ON + d.texcoord0.xy = half2(_MinXUV + ((_MaxXUV - _MinXUV) * (abs((_OffsetUvX + uvRect.x) % 1))), + _MinYUV + ((_MaxYUV - _MinYUV) * (abs(_OffsetUvY + uvRect.y) % 1))); + #else + d.texcoord0.xy += half2(_OffsetUvX, _OffsetUvY); + #endif + #endif + + //---------------------- + + //POLARUV_ON + #if POLARUV_ON + d.texcoord0.xy = half2(atan2(d.texcoord0.y, d.texcoord0.x) / (2.0f * 3.141592653589f), length(d.texcoord0.xy)); + d.texcoord0.xy *= _MainTex_ST.xy; + #endif + + //-------------------------------------- + + //TWISTUV_ON + #if TWISTUV_ON + #if ATLAS_ON + _TwistUvPosX = ((_MaxXUV - _MinXUV) * _TwistUvPosX) + _MinXUV; + _TwistUvPosY = ((_MaxYUV - _MinYUV) * _TwistUvPosY) + _MinYUV; + #endif + half2 tempUv = d.texcoord0.xy - half2(_TwistUvPosX * _MainTex_ST.x, _TwistUvPosY * _MainTex_ST.y); + _TwistUvRadius *= (_MainTex_ST.x + _MainTex_ST.y) / 2; + half percent = (_TwistUvRadius - length(tempUv)) / _TwistUvRadius; + half theta = percent * percent * (2.0 * sin(_TwistUvAmount)) * 8.0; + half s = sin(theta); + half c = cos(theta); + half beta = max(sign(_TwistUvRadius - length(tempUv)), 0.0); + tempUv = half2(dot(tempUv, half2(c, -s)), dot(tempUv, half2(s, c))) * beta + tempUv * (1 - beta); + tempUv += half2(_TwistUvPosX * _MainTex_ST.x, _TwistUvPosY * _MainTex_ST.y); + d.texcoord0.xy = tempUv; + #endif + + //-------------------------------------------- + + //FISHEYE_ON + #if FISHEYE_ON + half bind = length(centerTiled); + half2 dF = d.texcoord0.xy - centerTiled; + half dFlen = length(dF); + half fishInt = (3.14159265359 / bind) * (_FishEyeUvAmount + 0.001); + d.texcoord0.xy = centerTiled + (dF / (max(0.0001, dFlen))) * tan(dFlen * fishInt) * bind / tan(bind * fishInt); + #endif + //--------------------------------------------- + + //PINCH_ON + #if PINCH_ON + half2 dP = d.texcoord0.xy - centerTiled; + half pinchInt = (3.141592 / length(centerTiled)) * (-_PinchUvAmount + 0.001); + d.texcoord0.xy = centerTiled + normalize(dP) * atan(length(dP) * -pinchInt * 10.0) * 0.5 / atan(-pinchInt * 5); + #endif + + //--------------------------------------------- + + //ZOOMUV_ON + #if ZOOMUV_ON + d.texcoord0.xy -= centerTiled; + d.texcoord0.xy = d.texcoord0.xy * _ZoomUvAmount; + d.texcoord0.xy += centerTiled; + #endif + + //----------------------------------------------- + + //DOODLE_ON + #if DOODLE_ON + half2 uvCopy = uvRect; + _HandDrawnSpeed = (floor((_Time.x + randomSeed) * 20 * _HandDrawnSpeed) / _HandDrawnSpeed) * _HandDrawnSpeed; + uvCopy.x = sin((uvCopy.x * _HandDrawnAmount + _HandDrawnSpeed) * 4); + uvCopy.y = cos((uvCopy.y * _HandDrawnAmount + _HandDrawnSpeed) * 4); + d.texcoord0.xy = lerp(d.texcoord0.xy, d.texcoord0.xy + uvCopy, 0.0005 * _HandDrawnAmount); + #endif + + //-------------------------- + + //SHAKEUV_ON + #if SHAKEUV_ON + half xShake = sin((_Time.x + randomSeed) * _ShakeUvSpeed * 50) * _ShakeUvX; + half yShake = cos((_Time.x + randomSeed) * _ShakeUvSpeed * 50) * _ShakeUvY; + d.texcoord0.xy += half2(xShake * 0.012, yShake * 0.01); + #endif + + //------------------------------------------- + + //RECTSIZE_ON + #if RECTSIZE_ON + d.texcoord0.xy = d.texcoord0.xy * (_RectSize).xx + (((-_RectSize * 0.5) + 0.5)).xx; + #endif + + //------------------------------------------- + + //DISTORT_ON + #if DISTORT_ON + #if ATLAS_ON + d.texcoord3.x = d.texcoord3.x * (1 / (_MaxXUV - _MinXUV)); + d.texcoord3.y = d.texcoord3.y * (1 / (_MaxYUV - _MinYUV)); + #endif + + d.texcoord3.x += ((_Time.x + _RandomSeed) * _DistortTexXSpeed) % 1; + d.texcoord3.y += ((_Time.x + _RandomSeed) * _DistortTexYSpeed) % 1; + half distortAmnt = (SAMPLE_TEXTURE2D(_DistortTex, sampler_DistortTex, d.texcoord3.xy).r - 0.5) * 0.2 * _DistortAmount; + d.texcoord0.x += distortAmnt; + d.texcoord0.y += distortAmnt; + #endif + //------------------------------------------------------- + + //WARP_ON + #if WARP_ON + half2 warpUv = half2(d.texcoord0.x / _MainTex_ST.x, d.texcoord0.y / _MainTex_ST.y); + #if ATLAS_ON + warpUv = half2((warpUv.x - _MinXUV) / (_MaxXUV - _MinXUV), (warpUv.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + const float tau = 6.283185307179586; + float xWarp = (_Time.y + randomSeed) * _WarpSpeed + warpUv.x * tau / _WarpScale; + float yWarp = (_Time.y + randomSeed) * _WarpSpeed + warpUv.y * tau / _WarpScale; + float2 warp = float2(sin(xWarp), sin(yWarp)) * _WarpStrength; + d.texcoord0.xy += warp; + #endif + + //------------------------------------------------------- + + //WAVEUV_ON + #if WAVEUV_ON + float2 uvWave = half2(_WaveX * _MainTex_ST.x, _WaveY * _MainTex_ST.y) - d.texcoord0.xy; + uvWave %= 1; + #if ATLAS_ON + uvWave = half2(_WaveX, _WaveY) - uvRect; + #endif + uvWave.x *= _ScreenParams.x / _ScreenParams.y; + float waveTime = _Time.y + randomSeed; + float angWave = (sqrt(dot(uvWave, uvWave)) * _WaveAmount) - ((waveTime * _WaveSpeed)); + d.texcoord0.xy = d.texcoord0.xy + uvWave * sin(angWave) * (_WaveStrength / 1000.0); + #endif + //---------------------------------------------------- + + //ROUNDWAVEUV_ON + #if ROUNDWAVEUV_ON + half xWave = ((0.5 * _MainTex_ST.x) - uvRect.x); + half yWave = ((0.5 * _MainTex_ST.y) - uvRect.y) * (_MainTex_TexelSize.w / _MainTex_TexelSize.z); + half ripple = -sqrt(xWave*xWave + yWave* yWave); + d.texcoord0.xy += (sin((ripple + (_Time.y + randomSeed) * (_RoundWaveSpeed/10.0)) / 0.015) * (_RoundWaveStrength/10.0)) % 1; + #endif + //---------------------------------------------------- + + + //WIND_ON + #if WIND_ON + half windOffset = sin((_Time.x + randomSeed) * _GrassSpeed * 10); + half2 windCenter = half2(0.5, 0.1); + #if ATLAS_ON + windCenter.x = ((_MaxXUV - _MinXUV) * windCenter.x) + _MinXUV; + windCenter.y = ((_MaxYUV - _MinYUV) * windCenter.y) + _MinYUV; + #endif + #if !MANUALWIND_ON + d.texcoord0.x = fmod(abs(lerp(d.texcoord0.x, d.texcoord0.x + (_GrassWind * 0.01 * windOffset), uvRect.y)), 1); + #else + d.texcoord0.x = fmod(abs(lerp(d.texcoord0.x, d.texcoord0.x + (_GrassWind * 0.01 * _GrassManualAnim), uvRect.y)), 1); + windOffset = _GrassManualAnim; + #endif + half2 delta = d.texcoord0.xy - windCenter; + half delta2 = dot(delta.xy, delta.xy); + half2 delta_offset = delta2 * windOffset; + d.texcoord0.xy = d.texcoord0.xy + half2(delta.y, -delta.x) * delta_offset * _GrassRadialBend; + #endif + + //-------------------------------------------------------- + + //TEXTURESCROLL_ON && !ATLAS_ON + #if TEXTURESCROLL_ON && !ATLAS_ON + d.texcoord0.x += ((_Time.y + randomSeed) * _TextureScrollXSpeed) % 1; + d.texcoord0.y += ((_Time.y + randomSeed) * _TextureScrollYSpeed) % 1; + #endif + //------------------------------ + + //PIXELATE_ON + #if PIXELATE_ON + half aspectRatio = _MainTex_TexelSize.x / _MainTex_TexelSize.y; + half2 pixelSize = float2(_PixelateSize, _PixelateSize * aspectRatio); + d.texcoord0.xy = floor(d.texcoord0.xy * pixelSize) / pixelSize; + #endif + //-------------- + + half4 col = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy); + half originalAlpha = col.a; + col *= d.vertexColor; + + //NORMAL MAP + #if NORMALMAP_ON + half4 normalSample = SAMPLE_TEXTURE2D(_NormalMap, sampler_NormalMap, d.texcoord0.xy); + half3 normalTS = UnpackNormal(normalSample); + normalTS.xy *= _NormalStrength; + o.Normal = normalTS; + #endif + + + //GLITCH_ON + #if GLITCH_ON + half2 uvGlitch = uvRect; + uvGlitch.y -= 0.5; + half lineNoise = pow(rand2(floor(uvGlitch * half2(24., 19.) * _GlitchSize) * 4.0, randomSeed), 3.0) * _GlitchAmount + * pow(rand2(floor(uvGlitch * half2(38., 14.) * _GlitchSize) * 4.0, randomSeed), 3.0); + col = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(lineNoise * 0.02 * rand2(half2(2.0, 1), randomSeed), 0)) * d.vertexColor; + #endif + //-------------------------------------- + + //CHROMABERR_ON + #if CHROMABERR_ON + half4 r = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(_ChromAberrAmount/10, 0)) * d.vertexColor; + half4 b = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(-_ChromAberrAmount/10, 0)) * d.vertexColor; + col = half4(r.r * r.a, col.g, b.b * b.a, max(max(r.a, b.a) * _ChromAberrAlpha, col.a)); + #endif + + //-------------------------------- + + //BLUR_ON + #if BLUR_ON + #if ATLAS_ON + #if !BLURISHD_ON + col = BlurHD(d.texcoord0.xy, _MainTex, sampler_MainTex, _BlurIntensity, (_MaxXUV - _MinXUV), (_MaxYUV - _MinYUV)) * d.vertexColor; + #else + col = Blur(d.texcoord0.xy, _MainTex, sampler_MainTex, _BlurIntensity * (_MaxXUV - _MinXUV)) * d.vertexColor; + #endif + #else + #if !BLURISHD_ON + col = BlurHD(d.texcoord0.xy, _MainTex, sampler_MainTex, _BlurIntensity, 1, 1) * d.vertexColor; + #else + col = Blur(d.texcoord0.xy, _MainTex, sampler_MainTex, _BlurIntensity) * d.vertexColor; + #endif + #endif + #endif + + //-------------------- + + //MOTIONBLUR_ON + #if MOTIONBLUR_ON + _MotionBlurAngle = _MotionBlurAngle * 3.1415926; + #define rot(n) mul(n, half2x2(cos(_MotionBlurAngle), -sin(_MotionBlurAngle), sin(_MotionBlurAngle), cos(_MotionBlurAngle))) + _MotionBlurDist = _MotionBlurDist * 0.005; + #if ATLAS_ON + _MotionBlurDist *= (_MaxXUV - _MinXUV); + #endif + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(-_MotionBlurDist, -_MotionBlurDist))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(-_MotionBlurDist * 2, -_MotionBlurDist * 2))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(-_MotionBlurDist * 3, -_MotionBlurDist * 3))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(-_MotionBlurDist * 4, -_MotionBlurDist * 4))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(_MotionBlurDist, _MotionBlurDist))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(_MotionBlurDist * 2, _MotionBlurDist * 2))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(_MotionBlurDist * 3, _MotionBlurDist * 3))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(_MotionBlurDist * 4, _MotionBlurDist * 4))); + col.rgb = col.rgb / 9; + #endif + //------------------------------------ + + //NEGATIVE_ON + #if NEGATIVE_ON + col.rgb = lerp(col.rgb, 1 - col.rgb, _NegativeAmount); + #endif + + //-------------- + half luminance = 0; + + //GREYSCALE_ON && !GREYSCALEOUTLINE_ON + #if GREYSCALE_ON && !GREYSCALEOUTLINE_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + luminance = saturate(luminance + _GreyscaleLuminosity); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _GreyscaleTintColor, _GreyscaleBlend); + #endif + //------------------------------------ + + //GHOST_ON + #if GHOST_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + half4 ghostResult; + ghostResult.a = saturate(luminance - _GhostTransparency) * col.a; + ghostResult.rgb = col.rgb * (luminance + _GhostColorBoost); + col = lerp(col, ghostResult, _GhostBlend); + #endif + //------------------------------------ + + //INNEROUTLINE_ON + #if INNEROUTLINE_ON + half3 innerT = abs(GetPixel(0, _InnerOutlineThickness, d.texcoord0.xy, _MainTex, sampler_MainTex) - GetPixel(0, -_InnerOutlineThickness, d.texcoord0.xy, _MainTex, sampler_MainTex)); + innerT += abs(GetPixel(_InnerOutlineThickness, 0, d.texcoord0.xy, _MainTex, sampler_MainTex) - GetPixel(-_InnerOutlineThickness, 0, d.texcoord0.xy, _MainTex, sampler_MainTex)); + #if !ONLYINNEROUTLINE_ON + innerT = (innerT / 2.0) * col.a * _InnerOutlineAlpha; + col.rgb += length(innerT) * _InnerOutlineColor.rgb * _InnerOutlineGlow; + #else + innerT *= col.a * _InnerOutlineAlpha; + col.rgb = length(innerT) * _InnerOutlineColor.rgb * _InnerOutlineGlow; + col.a = step(0.3, col.r+col.g+col.b); + #endif + #endif + //------------------------------------------------------- + + //HITEFFECT_ON + #if HITEFFECT_ON + col.rgb = lerp(col.rgb, _HitEffectColor.rgb * _HitEffectGlow, _HitEffectBlend); + #endif + //-------------------- + + //GRADIENT_ON + #if GRADIENT_ON + half2 tiledUvGrad = half2(uvRect.x / _MainTex_ST.x, uvRect.y / _MainTex_ST.y); + #if GRADIENT2COL_ON + _GradTopRightCol = _GradTopLeftCol; + _GradBotRightCol = _GradBotLeftCol; + #endif + #if RADIALGRADIENT_ON + half radialDist = 1 - length(tiledUvGrad - half2(0.5, 0.5)); + radialDist *= (_MainTex_TexelSize.w / _MainTex_TexelSize.z); + radialDist = saturate(_GradBoostX * radialDist); + half4 gradientResult = lerp(_GradTopLeftCol, _GradBotLeftCol, radialDist); + #else + half gradXLerpFactor = saturate(pow(tiledUvGrad.x, _GradBoostX)); + half4 gradientResult = lerp(lerp(_GradBotLeftCol, _GradBotRightCol, gradXLerpFactor), + lerp(_GradTopLeftCol, _GradTopRightCol, gradXLerpFactor), saturate(pow(tiledUvGrad.y, _GradBoostY))); + #endif + gradientResult = lerp(col, gradientResult, _GradBlend); + col.rgb = gradientResult.rgb * col.a; + col.a *= gradientResult.a; + #endif + //-------------------------------------------------------------------- + + //CONTRAST_ON + #if CONTRAST_ON + col.rgb = (col.rgb - float3(0.5, 0.5, 0.5)) * _Contrast + float3(0.5, 0.5, 0.5); + col.rgb += _Brightness; + #endif + + //------------------------------------------------------------------- + + //COLORSWAP_ON + #if COLORSWAP_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + half4 swapMask = SAMPLE_TEXTURE2D(_ColorSwapTex, sampler_ColorSwapTex, d.texcoord0.xy); + swapMask.rgb *= swapMask.a; + half3 redSwap = _ColorSwapRed * swapMask.r * saturate(luminance + _ColorSwapRedLuminosity); + half3 greenSwap = _ColorSwapGreen * swapMask.g * saturate(luminance + _ColorSwapGreenLuminosity); + half3 blueSwap = _ColorSwapBlue * swapMask.b * saturate(luminance + _ColorSwapBlueLuminosity); + swapMask.rgb = col.rgb * saturate(1 - swapMask.r - swapMask.g - swapMask.b); + col.rgb = lerp(col.rgb, swapMask.rgb + redSwap + greenSwap + blueSwap, _ColorSwapBlend); + #endif + //-------------------------------------------------------------------- + + //COLORRAMP_ON && !COLORRAMPOUTLINE_ON + #if COLORRAMP_ON && !COLORRAMPOUTLINE_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + luminance = saturate(luminance + _ColorRampLuminosity); + #if GRADIENTCOLORRAMP_ON + col.rgb = lerp(col.rgb, SAMPLE_TEXTURE2D(_ColorRampTexGradient, sampler_ColorRampTexGradient, half2(luminance, 0)).rgb, _ColorRampBlend); + #else + col.rgb = lerp(col.rgb, SAMPLE_TEXTURE2D(_ColorRampTex, sampler_ColorRampTex, half2(luminance, 0)).rgb, _ColorRampBlend); + #endif + #endif + //-------------------------------------------------------------------- + + //CHANGECOLOR_ON + #if CHANGECOLOR_ON + float3 currChangeColor = saturate(col.rgb); + luminance = 0.3 * currChangeColor.r + 0.59 * currChangeColor.g + 0.11 * currChangeColor.b; + luminance = saturate(luminance + _ColorChangeLuminosity); + half3 dif = abs(currChangeColor - _ColorChangeTarget.rgb); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _ColorChangeNewCol.rgb, + max(sign(1 - saturate(dif.x + dif.y + dif.z) - _ColorChangeTolerance), 0.0)); + #if CHANGECOLOR2_ON + dif = abs(currChangeColor - _ColorChangeTarget2.rgb); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _ColorChangeNewCol2.rgb, + max(sign(1 - saturate(dif.x + dif.y + dif.z) - _ColorChangeTolerance2), 0.0)); + #endif + #if CHANGECOLOR3_ON + dif = abs(currChangeColor - _ColorChangeTarget3.rgb); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _ColorChangeNewCol3.rgb, + max(sign(1 - saturate(dif.x + dif.y + dif.z) - _ColorChangeTolerance3), 0.0)); + #endif + #endif + //------------------------------------------------------- + + //POSTERIZE_ON && !POSTERIZEOUTLINE_ON + #if POSTERIZE_ON && !POSTERIZEOUTLINE_ON + col.rgb = pow(col.rgb, _PosterizeGamma) * _PosterizeNumColors; + col.rgb = floor(col.rgb) / _PosterizeNumColors; + col.rgb = pow(col.rgb, 1.0 / _PosterizeGamma); + #endif + //------------------------------------ + + //HSV_ON + #if HSV_ON + half3 resultHsv = half3(col.rgb); + half cosHsv = _HsvBright * _HsvSaturation * cos(_HsvShift * 3.14159265 / 180); + half sinHsv = _HsvBright * _HsvSaturation * sin(_HsvShift * 3.14159265 / 180); + resultHsv.x = (.299 * _HsvBright + .701 * cosHsv + .168 * sinHsv) * col.x + + (.587 * _HsvBright - .587 * cosHsv + .330 * sinHsv) * col.y + + (.114 * _HsvBright - .114 * cosHsv - .497 * sinHsv) * col.z; + resultHsv.y = (.299 * _HsvBright - .299 * cosHsv - .328 * sinHsv) *col.x + + (.587 * _HsvBright + .413 * cosHsv + .035 * sinHsv) * col.y + + (.114 * _HsvBright - .114 * cosHsv + .292 * sinHsv) * col.z; + resultHsv.z = (.299 * _HsvBright - .3 * cosHsv + 1.25 * sinHsv) * col.x + + (.587 * _HsvBright - .588 * cosHsv - 1.05 * sinHsv) * col.y + + (.114 * _HsvBright + .886 * cosHsv - .203 * sinHsv) * col.z; + col.rgb = resultHsv; + #endif + //------------------------------------------------------- + + //OVERLAY_ON + #if OVERLAY_ON + half2 overlayUvs = d.texcoord0.xy; + overlayUvs.x += ((_Time.y + randomSeed) * _OverlayTextureScrollXSpeed) % 1; + overlayUvs.y += ((_Time.y + randomSeed) * _OverlayTextureScrollYSpeed) % 1; + half4 overlayCol = SAMPLE_TEXTURE2D(_OverlayTex, sampler_OverlayTex, TRANSFORM_TEX(overlayUvs, _OverlayTex)); + overlayCol.rgb *= _OverlayColor.rgb * _OverlayGlow; + #if !OVERLAYMULT_ON + overlayCol.rgb *= overlayCol.a * _OverlayColor.rgb * _OverlayColor.a * _OverlayBlend; + col.rgb += overlayCol.rgb; + #else + overlayCol.a *= _OverlayColor.a; + col = lerp(col, col * overlayCol, _OverlayBlend); + #endif + #endif + + //--------------------------------- + + //OUTBASE_ON + #if OUTBASE_ON + #if OUTBASEPIXELPERF_ON + half2 destUv = half2(_OutlinePixelWidth * _MainTex_TexelSize.x, _OutlinePixelWidth * _MainTex_TexelSize.y); + #else + half2 destUv = half2(_OutlineWidth * _MainTex_TexelSize.x * 200, _OutlineWidth * _MainTex_TexelSize.y * 200); + #endif + + #if OUTDIST_ON + d.texcoord3.x += ((_Time.x + _RandomSeed) * _OutlineDistortTexXSpeed) % 1; + d.texcoord3.y += ((_Time.x + _RandomSeed) * _OutlineDistortTexYSpeed) % 1; + #if ATLAS_ON + d.texcoord3 = half2((d.texcoord3.x - _MinXUV) / (_MaxXUV - _MinXUV), (d.texcoord3.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half outDistortAmnt = (SAMPLE_TEXTURE2D(_OutlineDistortTex, sampler_OutlineDistortTex, d.texcoord3).r - 0.5) * 0.2 * _OutlineDistortAmount; + destUv.x += outDistortAmnt; + destUv.y += outDistortAmnt; + #endif + + half spriteLeft = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(destUv.x, 0)).a; + half spriteRight = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy - half2(destUv.x, 0)).a; + half spriteBottom = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(0, destUv.y)).a; + half spriteTop = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy - half2(0, destUv.y)).a; + half result = spriteLeft + spriteRight + spriteBottom + spriteTop; + + #if OUTBASE8DIR_ON + half spriteTopLeft = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(destUv.x, destUv.y)).a; + half spriteTopRight = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(-destUv.x, destUv.y)).a; + half spriteBotLeft = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(destUv.x, -destUv.y)).a; + half spriteBotRight = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(-destUv.x, -destUv.y)).a; + result = result + spriteTopLeft + spriteTopRight + spriteBotLeft + spriteBotRight; + #endif + + result = step(0.05, saturate(result)); + + #if OUTTEX_ON + d.texcoord1.x += ((_Time.x + _RandomSeed) * _OutlineTexXSpeed) % 1; + d.texcoord1.y += ((_Time.x + _RandomSeed) * _OutlineTexYSpeed) % 1; + #if ATLAS_ON + d.texcoord1 = half2((d.texcoord1.x - _MinXUV) / (_MaxXUV - _MinXUV), (d.texcoord1.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half4 tempOutColor = SAMPLE_TEXTURE2D(_OutlineTex, sampler_OutlineTex, d.texcoord1); + tempOutColor *= _OutlineColor; + _OutlineColor = tempOutColor; + #endif + + result *= (1 - originalAlpha) * _OutlineAlpha; + + half4 outline = _OutlineColor * d.vertexColor.a; + outline.rgb *= _OutlineGlow; + outline.a = result; + #if ONLYOUTLINE_ON + col = outline; + #else + col = lerp(col, outline, result); + #endif + #endif + //------------------------------------------------------- + + //FADE_ON + #if FADE_ON + half2 tiledUvFade1 = TRANSFORM_TEX(d.texcoord0, _FadeTex); + half2 tiledUvFade2 = TRANSFORM_TEX(d.texcoord0, _FadeBurnTex); + #if ATLAS_ON + tiledUvFade1 = half2((tiledUvFade1.x - _MinXUV) / (_MaxXUV - _MinXUV), (tiledUvFade1.y - _MinYUV) / (_MaxYUV - _MinYUV)); + tiledUvFade2 = half2((tiledUvFade2.x - _MinXUV) / (_MaxXUV - _MinXUV), (tiledUvFade2.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half fadeTemp = SAMPLE_TEXTURE2D(_FadeTex, sampler_FadeTex, tiledUvFade1).r; + half fade = smoothstep(_FadeAmount, _FadeAmount + _FadeBurnTransition, fadeTemp); + half fadeBurn = saturate(smoothstep(_FadeAmount - _FadeBurnWidth, _FadeAmount - _FadeBurnWidth + 0.1, fadeTemp) * _FadeAmount); + col.a *= fade; + _FadeBurnColor.rgb *= _FadeBurnGlow; + col += fadeBurn * SAMPLE_TEXTURE2D(_FadeBurnTex, sampler_FadeBurnTex, tiledUvFade2) * _FadeBurnColor * originalAlpha * (1 - col.a); + #endif + //------------------------------------------------------- + + //SHADOW_ON + #if SHADOW_ON + half shadowA = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(_ShadowX, _ShadowY)).a; + half preMultShadowMask = 1 - (saturate(shadowA - col.a) * (1 - col.a)); + col.rgb *= 1 - ((shadowA - col.a) * (1 - col.a)); + col.rgb += (_ShadowColor * shadowA) * (1 - col.a); + col.a = max(shadowA * _ShadowAlpha * d.vertexColor.a, col.a); + #endif + + //------------------------------------------------------- + + //GLOW_ON + #if GLOW_ON + half4 emission; + #if GLOWTEX_ON + emission = SAMPLE_TEXTURE2D(_GlowTex, sampler_GlowTex, d.texcoord0); + #else + emission = col; + #endif + + col.rgb *= _GlowGlobal; + emission.rgb *= emission.a * col.a * _Glow * _GlowColor; + col.rgb += emission.rgb; + #endif + //------------------------------------------------------- + + //COLORRAMP_ON && COLORRAMPOUTLINE_ON + #if COLORRAMP_ON && COLORRAMPOUTLINE_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + luminance = saturate(luminance + _ColorRampLuminosity); + #if GRADIENTCOLORRAMP_ON + col.rgb = lerp(col.rgb, SAMPLE_TEXTURE2D(_ColorRampTexGradient, sampler_ColorRampTexGradient, half2(luminance, 0)).rgb, _ColorRampBlend); + #else + col.rgb = lerp(col.rgb, SAMPLE_TEXTURE2D(_ColorRampTex, sampler_ColorRampTex, half2(luminance, 0)).rgb, _ColorRampBlend); + #endif + #endif + //--------------- + + //GREYSCALE_ON && GREYSCALEOUTLINE_ON + #if GREYSCALE_ON && GREYSCALEOUTLINE_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + luminance = saturate(luminance + _GreyscaleLuminosity); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _GreyscaleTintColor, _GreyscaleBlend); + #endif + + //----------------------------------- + + //POSTERIZE_ON && POSTERIZEOUTLINE_ON + #if POSTERIZE_ON && POSTERIZEOUTLINE_ON + col.rgb = pow(col.rgb, _PosterizeGamma) * _PosterizeNumColors; + col.rgb = floor(col.rgb) / _PosterizeNumColors; + col.rgb = pow(col.rgb, 1.0 / _PosterizeGamma); + #endif + + //----------------------------------- + + //SHINE_ON + #if SHINE_ON + half2 uvShine = uvRect; + half cosAngle = cos(_ShineRotate); + half sinAngle = sin(_ShineRotate); + half2x2 rot = half2x2(cosAngle, -sinAngle, sinAngle, cosAngle); + uvShine -= half2(0.5, 0.5); + uvShine = mul(rot, uvShine); + uvShine += half2(0.5, 0.5); + half shineMask = SAMPLE_TEXTURE2D(_ShineMask, sampler_ShineMask, d.texcoord0.xy).a; + half currentDistanceProjection = (uvShine.x + uvShine.y) / 2; + half whitePower = 1 - (abs(currentDistanceProjection - _ShineLocation) / _ShineWidth); + col.rgb += col.a * whitePower * _ShineGlow * max(sign(currentDistanceProjection - (_ShineLocation - _ShineWidth)), 0.0) + * max(sign((_ShineLocation + _ShineWidth) - currentDistanceProjection), 0.0) * _ShineColor * shineMask; + #endif + + //----------------------------------- + + //HOLOGRAM_ON + #if HOLOGRAM_ON + half totalHologram = _HologramStripesAmount + _HologramUnmodAmount; + half hologramYCoord = ((uvRect.y + (((_Time.x + randomSeed) % 1) * _HologramStripesSpeed)) % totalHologram) / totalHologram; + hologramYCoord = abs(hologramYCoord); + half alpha = RemapFloat(saturate(hologramYCoord - (_HologramUnmodAmount/totalHologram)), 0.0, 1.0, _HologramMinAlpha, saturate(_HologramMaxAlpha)); + half hologramMask = max(sign((_HologramUnmodAmount/totalHologram) - hologramYCoord), 0.0); + half4 hologramResult = col; + hologramResult.a *= lerp(alpha, 1, hologramMask); + hologramResult.rgb *= max(1, _HologramMaxAlpha * max(sign(hologramYCoord - (_HologramUnmodAmount/totalHologram)), 0.0)); + hologramMask = 1 - step(0.01,hologramMask); + hologramResult.rgb += hologramMask * _HologramStripeColor * col.a; + col = lerp(col, hologramResult, _HologramBlend); + #endif + + //----------------------------------- + + //FLICKER_ON + #if FLICKER_ON + col.a *= saturate(col.a * step(frac(0.05 + (_Time.w + randomSeed) * _FlickerFreq), 1 - _FlickerPercent) + _FlickerAlpha); + #endif + //----------------------------------- + + //ALPHACUTOFF_ON + + //ALPHAROUND_ON + + //ALPHAOUTLINE_ON + #if ALPHAOUTLINE_ON + half alphaOutlineRes = pow(1 - col.a, max(_AlphaOutlinePower, 0.0001)) * step(_AlphaOutlineMinAlpha, col.a) * _AlphaOutlineBlend; + col.rgb = lerp(col.rgb, _AlphaOutlineColor.rgb * _AlphaOutlineGlow, alphaOutlineRes); + col.a = lerp(col.a, 1, alphaOutlineRes > 1); + #endif + //------------------------------------------------------- + + //FOG_ON + + //------------------ + + col *= _Color; + o.Albedo = col; + col.a *= _Alpha; + clip(col.a - _AlphaCutoffValue - 0.01); + o.Alpha = _Color.a; + } + + + + + + void ChainSurfaceFunction(inout Surface l, inout ShaderData d) + { + Ext_SurfaceFunction0(l, d); + // Ext_SurfaceFunction1(l, d); + // Ext_SurfaceFunction2(l, d); + // Ext_SurfaceFunction3(l, d); + // Ext_SurfaceFunction4(l, d); + // Ext_SurfaceFunction5(l, d); + // Ext_SurfaceFunction6(l, d); + // Ext_SurfaceFunction7(l, d); + // Ext_SurfaceFunction8(l, d); + // Ext_SurfaceFunction9(l, d); + // Ext_SurfaceFunction10(l, d); + // Ext_SurfaceFunction11(l, d); + // Ext_SurfaceFunction12(l, d); + // Ext_SurfaceFunction13(l, d); + // Ext_SurfaceFunction14(l, d); + // Ext_SurfaceFunction15(l, d); + // Ext_SurfaceFunction16(l, d); + // Ext_SurfaceFunction17(l, d); + // Ext_SurfaceFunction18(l, d); + // Ext_SurfaceFunction19(l, d); + // Ext_SurfaceFunction20(l, d); + // Ext_SurfaceFunction21(l, d); + // Ext_SurfaceFunction22(l, d); + // Ext_SurfaceFunction23(l, d); + // Ext_SurfaceFunction24(l, d); + // Ext_SurfaceFunction25(l, d); + // Ext_SurfaceFunction26(l, d); + // Ext_SurfaceFunction27(l, d); + // Ext_SurfaceFunction28(l, d); + // Ext_SurfaceFunction29(l, d); + } + +#if !_DECALSHADER + + void ChainModifyVertex(inout VertexData v, inout VertexToPixel v2p, float4 time) + { + ExtraV2F d; + + ZERO_INITIALIZE(ExtraV2F, d); + ZERO_INITIALIZE(Blackboard, d.blackboard); + // due to motion vectors in HDRP, we need to use the last + // time in certain spots. So if you are going to use _Time to adjust vertices, + // you need to use this time or motion vectors will break. + d.time = time; + + Ext_ModifyVertex0(v, d); + // Ext_ModifyVertex1(v, d); + // Ext_ModifyVertex2(v, d); + // Ext_ModifyVertex3(v, d); + // Ext_ModifyVertex4(v, d); + // Ext_ModifyVertex5(v, d); + // Ext_ModifyVertex6(v, d); + // Ext_ModifyVertex7(v, d); + // Ext_ModifyVertex8(v, d); + // Ext_ModifyVertex9(v, d); + // Ext_ModifyVertex10(v, d); + // Ext_ModifyVertex11(v, d); + // Ext_ModifyVertex12(v, d); + // Ext_ModifyVertex13(v, d); + // Ext_ModifyVertex14(v, d); + // Ext_ModifyVertex15(v, d); + // Ext_ModifyVertex16(v, d); + // Ext_ModifyVertex17(v, d); + // Ext_ModifyVertex18(v, d); + // Ext_ModifyVertex19(v, d); + // Ext_ModifyVertex20(v, d); + // Ext_ModifyVertex21(v, d); + // Ext_ModifyVertex22(v, d); + // Ext_ModifyVertex23(v, d); + // Ext_ModifyVertex24(v, d); + // Ext_ModifyVertex25(v, d); + // Ext_ModifyVertex26(v, d); + // Ext_ModifyVertex27(v, d); + // Ext_ModifyVertex28(v, d); + // Ext_ModifyVertex29(v, d); + + + // #if %EXTRAV2F0REQUIREKEY% + // v2p.extraV2F0 = d.extraV2F0; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // v2p.extraV2F1 = d.extraV2F1; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // v2p.extraV2F2 = d.extraV2F2; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // v2p.extraV2F3 = d.extraV2F3; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // v2p.extraV2F4 = d.extraV2F4; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // v2p.extraV2F5 = d.extraV2F5; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // v2p.extraV2F6 = d.extraV2F6; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // v2p.extraV2F7 = d.extraV2F7; + // #endif + } + + void ChainModifyTessellatedVertex(inout VertexData v, inout VertexToPixel v2p) + { + ExtraV2F d; + ZERO_INITIALIZE(ExtraV2F, d); + ZERO_INITIALIZE(Blackboard, d.blackboard); + + // #if %EXTRAV2F0REQUIREKEY% + // d.extraV2F0 = v2p.extraV2F0; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // d.extraV2F1 = v2p.extraV2F1; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // d.extraV2F2 = v2p.extraV2F2; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // d.extraV2F3 = v2p.extraV2F3; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // d.extraV2F4 = v2p.extraV2F4; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // d.extraV2F5 = v2p.extraV2F5; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // d.extraV2F6 = v2p.extraV2F6; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // d.extraV2F7 = v2p.extraV2F7; + // #endif + + + // Ext_ModifyTessellatedVertex0(v, d); + // Ext_ModifyTessellatedVertex1(v, d); + // Ext_ModifyTessellatedVertex2(v, d); + // Ext_ModifyTessellatedVertex3(v, d); + // Ext_ModifyTessellatedVertex4(v, d); + // Ext_ModifyTessellatedVertex5(v, d); + // Ext_ModifyTessellatedVertex6(v, d); + // Ext_ModifyTessellatedVertex7(v, d); + // Ext_ModifyTessellatedVertex8(v, d); + // Ext_ModifyTessellatedVertex9(v, d); + // Ext_ModifyTessellatedVertex10(v, d); + // Ext_ModifyTessellatedVertex11(v, d); + // Ext_ModifyTessellatedVertex12(v, d); + // Ext_ModifyTessellatedVertex13(v, d); + // Ext_ModifyTessellatedVertex14(v, d); + // Ext_ModifyTessellatedVertex15(v, d); + // Ext_ModifyTessellatedVertex16(v, d); + // Ext_ModifyTessellatedVertex17(v, d); + // Ext_ModifyTessellatedVertex18(v, d); + // Ext_ModifyTessellatedVertex19(v, d); + // Ext_ModifyTessellatedVertex20(v, d); + // Ext_ModifyTessellatedVertex21(v, d); + // Ext_ModifyTessellatedVertex22(v, d); + // Ext_ModifyTessellatedVertex23(v, d); + // Ext_ModifyTessellatedVertex24(v, d); + // Ext_ModifyTessellatedVertex25(v, d); + // Ext_ModifyTessellatedVertex26(v, d); + // Ext_ModifyTessellatedVertex27(v, d); + // Ext_ModifyTessellatedVertex28(v, d); + // Ext_ModifyTessellatedVertex29(v, d); + + // #if %EXTRAV2F0REQUIREKEY% + // v2p.extraV2F0 = d.extraV2F0; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // v2p.extraV2F1 = d.extraV2F1; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // v2p.extraV2F2 = d.extraV2F2; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // v2p.extraV2F3 = d.extraV2F3; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // v2p.extraV2F4 = d.extraV2F4; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // v2p.extraV2F5 = d.extraV2F5; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // v2p.extraV2F6 = d.extraV2F6; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // v2p.extraV2F7 = d.extraV2F7; + // #endif + } + + void ChainFinalColorForward(inout Surface l, inout ShaderData d, inout half4 color) + { + // Ext_FinalColorForward0(l, d, color); + // Ext_FinalColorForward1(l, d, color); + // Ext_FinalColorForward2(l, d, color); + // Ext_FinalColorForward3(l, d, color); + // Ext_FinalColorForward4(l, d, color); + // Ext_FinalColorForward5(l, d, color); + // Ext_FinalColorForward6(l, d, color); + // Ext_FinalColorForward7(l, d, color); + // Ext_FinalColorForward8(l, d, color); + // Ext_FinalColorForward9(l, d, color); + // Ext_FinalColorForward10(l, d, color); + // Ext_FinalColorForward11(l, d, color); + // Ext_FinalColorForward12(l, d, color); + // Ext_FinalColorForward13(l, d, color); + // Ext_FinalColorForward14(l, d, color); + // Ext_FinalColorForward15(l, d, color); + // Ext_FinalColorForward16(l, d, color); + // Ext_FinalColorForward17(l, d, color); + // Ext_FinalColorForward18(l, d, color); + // Ext_FinalColorForward19(l, d, color); + // Ext_FinalColorForward20(l, d, color); + // Ext_FinalColorForward21(l, d, color); + // Ext_FinalColorForward22(l, d, color); + // Ext_FinalColorForward23(l, d, color); + // Ext_FinalColorForward24(l, d, color); + // Ext_FinalColorForward25(l, d, color); + // Ext_FinalColorForward26(l, d, color); + // Ext_FinalColorForward27(l, d, color); + // Ext_FinalColorForward28(l, d, color); + // Ext_FinalColorForward29(l, d, color); + } + + void ChainFinalGBufferStandard(inout Surface s, inout ShaderData d, inout half4 GBuffer0, inout half4 GBuffer1, inout half4 GBuffer2, inout half4 outEmission, inout half4 outShadowMask) + { + // Ext_FinalGBufferStandard0(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard1(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard2(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard3(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard4(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard5(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard6(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard7(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard8(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard9(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard10(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard11(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard12(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard13(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard14(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard15(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard16(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard17(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard18(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard19(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard20(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard21(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard22(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard23(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard24(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard25(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard26(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard27(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard28(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard29(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + } +#endif + + + + + +#if _DECALSHADER + + ShaderData CreateShaderData(SurfaceDescriptionInputs IN) + { + ShaderData d = (ShaderData)0; + d.TBNMatrix = float3x3(IN.WorldSpaceTangent, IN.WorldSpaceBiTangent, IN.WorldSpaceNormal); + d.worldSpaceNormal = IN.WorldSpaceNormal; + d.worldSpaceTangent = IN.WorldSpaceTangent; + + d.worldSpacePosition = IN.WorldSpacePosition; + d.texcoord0 = IN.uv0.xyxy; + d.screenPos = IN.ScreenPosition; + + d.worldSpaceViewDir = normalize(_WorldSpaceCameraPos - d.worldSpacePosition); + + d.tangentSpaceViewDir = mul(d.TBNMatrix, d.worldSpaceViewDir); + + // these rarely get used, so we back transform them. Usually will be stripped. + #if _HDRP + // d.localSpacePosition = mul(GetWorldToObjectMatrix(), float4(GetCameraRelativePositionWS(d.worldSpacePosition), 1)).xyz; + #else + // d.localSpacePosition = mul(GetWorldToObjectMatrix(), float4(d.worldSpacePosition, 1)).xyz; + #endif + // d.localSpaceNormal = normalize(mul((float3x3)GetWorldToObjectMatrix(), d.worldSpaceNormal)); + // d.localSpaceTangent = normalize(mul((float3x3)GetWorldToObjectMatrix(), d.worldSpaceTangent.xyz)); + + // #if %SCREENPOSREQUIREKEY% + // d.screenUV = (IN.ScreenPosition.xy / max(0.01, IN.ScreenPosition.w)); + // #endif + + return d; + } +#else + + ShaderData CreateShaderData(VertexToPixel i + #if NEED_FACING + , bool facing + #endif + ) + { + ShaderData d = (ShaderData)0; + d.clipPos = i.pos; + d.worldSpacePosition = i.worldPos; + + d.worldSpaceNormal = normalize(i.worldNormal); + d.worldSpaceTangent.xyz = normalize(i.worldTangent.xyz); + + d.tangentSign = i.worldTangent.w * unity_WorldTransformParams.w; + float3 bitangent = cross(d.worldSpaceTangent.xyz, d.worldSpaceNormal) * d.tangentSign; + + d.TBNMatrix = float3x3(d.worldSpaceTangent, -bitangent, d.worldSpaceNormal); + d.worldSpaceViewDir = normalize(_WorldSpaceCameraPos - i.worldPos); + + d.tangentSpaceViewDir = mul(d.TBNMatrix, d.worldSpaceViewDir); + d.texcoord0 = i.texcoord0; + d.texcoord1 = i.texcoord1; + d.texcoord2 = i.texcoord2; + + // #if %TEXCOORD3REQUIREKEY% + d.texcoord3 = i.texcoord3; + // #endif + + // d.isFrontFace = facing; + // #if %VERTEXCOLORREQUIREKEY% + d.vertexColor = i.vertexColor; + // #endif + + // these rarely get used, so we back transform them. Usually will be stripped. + #if _HDRP + // d.localSpacePosition = mul(GetWorldToObjectMatrix(), float4(GetCameraRelativePositionWS(i.worldPos), 1)).xyz; + #else + // d.localSpacePosition = mul(GetWorldToObjectMatrix(), float4(i.worldPos, 1)).xyz; + #endif + // d.localSpaceNormal = normalize(mul((float3x3)GetWorldToObjectMatrix(), i.worldNormal)); + // d.localSpaceTangent = normalize(mul((float3x3)GetWorldToObjectMatrix(), i.worldTangent.xyz)); + + // #if %SCREENPOSREQUIREKEY% + // d.screenPos = i.screenPos; + // d.screenUV = (i.screenPos.xy / i.screenPos.w); + // #endif + + + // #if %EXTRAV2F0REQUIREKEY% + // d.extraV2F0 = i.extraV2F0; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // d.extraV2F1 = i.extraV2F1; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // d.extraV2F2 = i.extraV2F2; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // d.extraV2F3 = i.extraV2F3; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // d.extraV2F4 = i.extraV2F4; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // d.extraV2F5 = i.extraV2F5; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // d.extraV2F6 = i.extraV2F6; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // d.extraV2F7 = i.extraV2F7; + // #endif + + return d; + } + +#endif + + + #if defined(_PASSSHADOW) + float3 _LightDirection; + float3 _LightPosition; + #endif + + #if (_PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR))) + + #define GetWorldToViewMatrix() _ViewMatrix + #define UNITY_MATRIX_I_V _InvViewMatrix + #define GetViewToHClipMatrix() OptimizeProjectionMatrix(_ProjMatrix) + #define UNITY_MATRIX_I_P _InvProjMatrix + #define GetWorldToHClipMatrix() _ViewProjMatrix + #define UNITY_MATRIX_I_VP _InvViewProjMatrix + #define UNITY_MATRIX_UNJITTERED_VP _NonJitteredViewProjMatrix + #define UNITY_MATRIX_PREV_VP _PrevViewProjMatrix + #define UNITY_MATRIX_PREV_I_VP _PrevInvViewProjMatrix + + void MotionVectorPositionZBias(VertexToPixel input) + { + #if UNITY_REVERSED_Z + input.pos.z -= unity_MotionVectorsParams.z * input.pos.w; + #else + input.pos.z += unity_MotionVectorsParams.z * input.pos.w; + #endif + } + + #endif + + // vertex shader + VertexToPixel Vert (VertexData v) + { + VertexToPixel o = (VertexToPixel)0; + + UNITY_SETUP_INSTANCE_ID(v); + UNITY_TRANSFER_INSTANCE_ID(v, o); + UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o); + + + #if _URP && (_PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR))) + VertexData previousMesh = v; + #endif + #if !_TESSELLATION_ON + ChainModifyVertex(v, o, _Time); + #endif + + o.texcoord0 = v.texcoord0; + o.texcoord1 = v.texcoord1; + o.texcoord2 = v.texcoord2; + + // #if %TEXCOORD3REQUIREKEY% + o.texcoord3 = v.texcoord3; + // #endif + + // #if %VERTEXCOLORREQUIREKEY% + o.vertexColor = v.vertexColor; + // #endif + + // This return the camera relative position (if enable) + float3 positionWS = TransformObjectToWorld(v.vertex.xyz); + float3 normalWS = TransformObjectToWorldNormal(v.normal); + float4 tangentWS = float4(TransformObjectToWorldDir(v.tangent.xyz), v.tangent.w); + + VertexPositionInputs vertexInput = GetVertexPositionInputs(v.vertex.xyz); + o.worldPos = positionWS; + o.worldNormal = normalWS; + o.worldTangent = tangentWS; + + + // For some very odd reason, in 2021.2, we can't use Unity's defines, but have to use our own.. + #if _PASSSHADOW + #if _CASTING_PUNCTUAL_LIGHT_SHADOW + float3 lightDirectionWS = normalize(_LightPosition - o.worldPos); + #else + float3 lightDirectionWS = _LightDirection; + #endif + // Define shadow pass specific clip position for Universal + o.pos = TransformWorldToHClip(ApplyShadowBias(o.worldPos, o.worldNormal, lightDirectionWS)); + #if UNITY_REVERSED_Z + o.pos.z = min(o.pos.z, UNITY_NEAR_CLIP_VALUE); + #else + o.pos.z = max(o.pos.z, UNITY_NEAR_CLIP_VALUE); + #endif + #elif _PASSMETA + o.pos = MetaVertexPosition(float4(v.vertex.xyz, 0), v.texcoord1.xy, v.texcoord2.xy, unity_LightmapST, unity_DynamicLightmapST); + #else + o.pos = TransformWorldToHClip(o.worldPos); + #endif + + // #if %SCREENPOSREQUIREKEY% + // o.screenPos = ComputeScreenPos(o.pos, _ProjectionParams.x); + // #endif + + + #if _PASSFORWARD || _PASSGBUFFER + float2 uv1 = v.texcoord1.xy; + OUTPUT_LIGHTMAP_UV(uv1, unity_LightmapST, o.lightmapUV); + o.texcoord1.xy = uv1; + #if UNITY_VERSION < 60000009 + OUTPUT_SH(o.worldNormal, o.sh); + #endif + + #if defined(DYNAMICLIGHTMAP_ON) + o.dynamicLightmapUV.xy = v.texcoord2.xy * unity_DynamicLightmapST.xy + unity_DynamicLightmapST.zw; + #if UNITY_VERSION >= 60000009 + OUTPUT_SH(o.worldNormal, o.sh); + #endif + #elif (defined(PROBE_VOLUMES_L1) || defined(PROBE_VOLUMES_L2)) && UNITY_VERSION >= 60000009 + OUTPUT_SH4(vertexInput.positionWS, o.worldNormal.xyz, GetWorldSpaceNormalizeViewDir(vertexInput.positionWS), o.sh, o.probeOcclusion); + #endif + #endif + + #ifdef VARYINGS_NEED_FOG_AND_VERTEX_LIGHT + half fogFactor = 0; + #if defined(_FOG_FRAGMENT) + fogFactor = ComputeFogFactor(o.pos.z); + #endif + #if _BAKEDLIT + o.fogFactorAndVertexLight = half4(fogFactor, 0, 0, 0); + #else + half3 vertexLight = VertexLighting(o.worldPos, o.worldNormal); + o.fogFactorAndVertexLight = half4(fogFactor, vertexLight); + #endif + #endif + + #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR) + o.shadowCoord = GetShadowCoord(vertexInput); + #endif + + #if _URP && (_PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR))) + #if !defined(TESSELLATION_ON) + MotionVectorPositionZBias(o); + #endif + + o.previousPositionCS = float4(0.0, 0.0, 0.0, 1.0); + // Note: unity_MotionVectorsParams.y is 0 is forceNoMotion is enabled + bool forceNoMotion = unity_MotionVectorsParams.y == 0.0; + + if (!forceNoMotion) + { + #if defined(HAVE_VFX_MODIFICATION) + float3 previousPositionOS = currentFrameMvData.vfxParticlePositionOS; + #if defined(VFX_FEATURE_MOTION_VECTORS_VERTS) + const bool applyDeformation = false; + #else + const bool applyDeformation = true; + #endif + #else + const bool hasDeformation = unity_MotionVectorsParams.x == 1; // Mesh has skinned deformation + float3 previousPositionOS = hasDeformation ? previousMesh.previousPositionOS : previousMesh.vertex.xyz; + + #if defined(AUTOMATIC_TIME_BASED_MOTION_VECTORS) && defined(GRAPH_VERTEX_USES_TIME_PARAMETERS_INPUT) + const bool applyDeformation = true; + #else + const bool applyDeformation = hasDeformation; + #endif + #endif + // TODO + #if defined(FEATURES_GRAPH_VERTEX) + if (applyDeformation) + previousPositionOS = GetLastFrameDeformedPosition(previousMesh, currentFrameMvData, previousPositionOS); + else + previousPositionOS = previousMesh.positionOS; + + #if defined(FEATURES_GRAPH_VERTEX_MOTION_VECTOR_OUTPUT) + previousPositionOS -= previousMesh.precomputedVelocity; + #endif + #endif + + #if defined(UNITY_DOTS_INSTANCING_ENABLED) && defined(DOTS_DEFORMED) + // Deformed vertices in DOTS are not cumulative with built-in Unity skinning/blend shapes + // Needs to be called after vertex modification has been applied otherwise it will be + // overwritten by Compute Deform node + ApplyPreviousFrameDeformedVertexPosition(previousMesh.vertexID, previousPositionOS); + #endif + #if defined (_ADD_PRECOMPUTED_VELOCITY) + previousPositionOS -= previousMesh.precomputedVelocity; + #endif + o.positionCS = mul(UNITY_MATRIX_UNJITTERED_VP, float4(positionWS, 1.0f)); + + #if defined(HAVE_VFX_MODIFICATION) + #if defined(VFX_FEATURE_MOTION_VECTORS_VERTS) + #if defined(FEATURES_GRAPH_VERTEX_MOTION_VECTOR_OUTPUT) || defined(_ADD_PRECOMPUTED_VELOCITY) + #error Unexpected fast path rendering VFX motion vector while there are vertex modification afterwards. + #endif + o.previousPositionCS = VFXGetPreviousClipPosition(previousMesh, currentFrameMvData.vfxElementAttributes, o.positionCS); + #else + #if VFX_WORLD_SPACE + //previousPositionOS is already in world space + const float3 previousPositionWS = previousPositionOS; + #else + const float3 previousPositionWS = mul(UNITY_PREV_MATRIX_M, float4(previousPositionOS, 1.0f)).xyz; + #endif + o.previousPositionCS = mul(UNITY_MATRIX_PREV_VP, float4(previousPositionWS, 1.0f)); + #endif + #else + o.previousPositionCS = mul(UNITY_MATRIX_PREV_VP, mul(UNITY_PREV_MATRIX_M, float4(previousPositionOS, 1))); + #endif + } + #endif + + return o; + } + + + + + // fragment shader + half4 Frag (VertexToPixel IN + #if NEED_FACING + , bool facing : SV_IsFrontFace + #endif + ) : SV_Target + { + UNITY_SETUP_INSTANCE_ID(IN); + + ShaderData d = CreateShaderData(IN + #if NEED_FACING + , facing + #endif + ); + + Surface l = (Surface)0; + + l.Albedo = half3(0.5, 0.5, 0.5); + l.Normal = float3(0,0,1); + l.Occlusion = 1; + l.Alpha = 1; + + ChainSurfaceFunction(l, d); + + MetaInput metaInput = (MetaInput)0; + metaInput.Albedo = l.Albedo; + metaInput.Emission = l.Emission; + + return MetaFragment(metaInput); + + } + + ENDHLSL + + } + + + + Pass + { + Name "DepthNormals" + Tags + { + "LightMode" = "DepthNormals" + } + + // Render State + Cull Back + ZTest LEqual + ZWrite On + + Tags { "RenderType" = "Opaque" "Queue" = "Geometry" "PreviewType" = "Plane" } + Cull [_CullingOption] + ZWrite [_ZWrite] + ZTest [_ZTestMode] + + + HLSLPROGRAM + + #pragma vertex Vert + #pragma fragment Frag + + #pragma target 3.0 + + #pragma prefer_hlslcc gles + #pragma exclude_renderers d3d11_9x + #pragma multi_compile_fog + #pragma multi_compile_instancing + #pragma multi_compile_fragment _ LOD_FADE_CROSSFADE + #pragma multi_compile_fragment _ _WRITE_RENDERING_LAYERS + + #define SHADERPASS SHADERPASS_DEPTHNORMALSONLY + #define _PASSDEPTH 1 + #define _PASSDEPTHNORMALS 1 + + + + #pragma shader_feature_local GLOW_ON + #pragma shader_feature_local FADE_ON + #pragma shader_feature_local OUTBASE_ON + #pragma shader_feature_local ONLYOUTLINE_ON + #pragma shader_feature_local GRADIENT_ON + #pragma shader_feature_local GRADIENT2COL_ON + #pragma shader_feature_local RADIALGRADIENT_ON + #pragma shader_feature_local COLORSWAP_ON + #pragma shader_feature_local HSV_ON + #pragma shader_feature_local CHANGECOLOR_ON + #pragma shader_feature_local CHANGECOLOR2_ON + #pragma shader_feature_local CHANGECOLOR3_ON + #pragma shader_feature_local COLORRAMP_ON + #pragma shader_feature_local GRADIENTCOLORRAMP_ON + #pragma shader_feature_local HITEFFECT_ON + #pragma shader_feature_local NEGATIVE_ON + #pragma shader_feature_local PIXELATE_ON + #pragma shader_feature_local GREYSCALE_ON + #pragma shader_feature_local POSTERIZE_ON + #pragma shader_feature_local BLUR_ON + #pragma shader_feature_local MOTIONBLUR_ON + #pragma shader_feature_local GHOST_ON + #pragma shader_feature_local ALPHAOUTLINE_ON + #pragma shader_feature_local INNEROUTLINE_ON + #pragma shader_feature_local ONLYINNEROUTLINE_ON + #pragma shader_feature_local HOLOGRAM_ON + #pragma shader_feature_local CHROMABERR_ON + #pragma shader_feature_local GLITCH_ON + #pragma shader_feature_local FLICKER_ON + #pragma shader_feature_local SHADOW_ON + #pragma shader_feature_local SHINE_ON + #pragma shader_feature_local CONTRAST_ON + #pragma shader_feature_local OVERLAY_ON + #pragma shader_feature_local OVERLAYMULT_ON + #pragma shader_feature_local DOODLE_ON + #pragma shader_feature_local WIND_ON + #pragma shader_feature_local WAVEUV_ON + #pragma shader_feature_local ROUNDWAVEUV_ON + #pragma shader_feature_local RECTSIZE_ON + #pragma shader_feature_local OFFSETUV_ON + #pragma shader_feature_local CLIPPING_ON + #pragma shader_feature_local RADIALCLIPPING_ON + #pragma shader_feature_local TEXTURESCROLL_ON + #pragma shader_feature_local ZOOMUV_ON + #pragma shader_feature_local DISTORT_ON + #pragma shader_feature_local WARP_ON + #pragma shader_feature_local TWISTUV_ON + #pragma shader_feature_local ROTATEUV_ON + #pragma shader_feature_local POLARUV_ON + #pragma shader_feature_local FISHEYE_ON + #pragma shader_feature_local PINCH_ON + #pragma shader_feature_local SHAKEUV_ON + + #pragma shader_feature_local GLOWTEX_ON + #pragma shader_feature_local OUTTEX_ON + #pragma shader_feature_local OUTDIST_ON + #pragma shader_feature_local OUTBASE8DIR_ON + #pragma shader_feature_local OUTBASEPIXELPERF_ON + #pragma shader_feature_local COLORRAMPOUTLINE_ON + #pragma shader_feature_local GREYSCALEOUTLINE_ON + #pragma shader_feature_local POSTERIZEOUTLINE_ON + #pragma shader_feature_local BLURISHD_ON + #pragma shader_feature_local MANUALWIND_ON + #pragma shader_feature_local ATLAS_ON + #pragma shader_feature_local PREMULTIPLYALPHA_ON + + #pragma shader_feature BILBOARD_ON + #pragma shader_feature BILBOARDY_ON + + #pragma shader_feature NORMALMAP_ON + + + #define _URP 1 +#define _USINGTEXCOORD1 1 +#define _USINGTEXCOORD2 1 + + + // this has to be here or specular color will be ignored. Not in SG code + #if _SIMPLELIT + #define _SPECULAR_COLOR + #endif + + + // Includes + #include_with_pragmas "Packages/com.unity.render-pipelines.universal/ShaderLibrary/DOTS.hlsl" + #include_with_pragmas "Packages/com.unity.render-pipelines.universal/ShaderLibrary/RenderingLayers.hlsl" + #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.universal/ShaderLibrary/Input.hlsl" + #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/TextureStack.hlsl" + #include_with_pragmas "Packages/com.unity.render-pipelines.core/ShaderLibrary/FoveatedRenderingKeywords.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.universal/ShaderLibrary/LODCrossFade.hlsl" + + + + + + #undef WorldNormalVector + #define WorldNormalVector(data, normal) mul(normal, data.TBNMatrix) + + #define UnityObjectToWorldNormal(normal) mul(GetObjectToWorldMatrix(), normal) + + #define _WorldSpaceLightPos0 _MainLightPosition + + #define UNITY_DECLARE_TEX2D(name) TEXTURE2D(name); SAMPLER(sampler##name); + #define UNITY_DECLARE_TEX2D_NOSAMPLER(name) TEXTURE2D(name); + #define UNITY_DECLARE_TEX2DARRAY(name) TEXTURE2D_ARRAY(name); SAMPLER(sampler##name); + #define UNITY_DECLARE_TEX2DARRAY_NOSAMPLER(name) TEXTURE2D_ARRAY(name); + + #define UNITY_SAMPLE_TEX2DARRAY(tex,coord) SAMPLE_TEXTURE2D_ARRAY(tex, sampler##tex, coord.xy, coord.z) + #define UNITY_SAMPLE_TEX2DARRAY_LOD(tex,coord,lod) SAMPLE_TEXTURE2D_ARRAY_LOD(tex, sampler##tex, coord.xy, coord.z, lod) + #define UNITY_SAMPLE_TEX2D(tex, coord) SAMPLE_TEXTURE2D(tex, sampler##tex, coord) + #define UNITY_SAMPLE_TEX2D_SAMPLER(tex, samp, coord) SAMPLE_TEXTURE2D(tex, sampler##samp, coord) + + #define UNITY_SAMPLE_TEX2D_LOD(tex,coord, lod) SAMPLE_TEXTURE2D_LOD(tex, sampler_##tex, coord, lod) + #define UNITY_SAMPLE_TEX2D_SAMPLER_LOD(tex,samplertex,coord, lod) SAMPLE_TEXTURE2D_LOD (tex, sampler##samplertex,coord, lod) + + #if defined(UNITY_COMPILER_HLSL) + #define UNITY_INITIALIZE_OUTPUT(type,name) name = (type)0; + #else + #define UNITY_INITIALIZE_OUTPUT(type,name) + #endif + + #define sampler2D_float sampler2D + #define sampler2D_half sampler2D + + + + // data across stages, stripped like the above. + struct VertexToPixel + { + float4 pos : SV_POSITION; + float3 worldPos : TEXCOORD0; + float3 worldNormal : TEXCOORD1; + float4 worldTangent : TEXCOORD2; + float4 texcoord0 : TEXCOORD3; + float4 texcoord1 : TEXCOORD4; + float4 texcoord2 : TEXCOORD5; + + // #if %TEXCOORD3REQUIREKEY% + float4 texcoord3 : TEXCOORD6; + // #endif + + // #if %SCREENPOSREQUIREKEY% + // float4 screenPos : TEXCOORD7; + // #endif + + // #if %VERTEXCOLORREQUIREKEY% + half4 vertexColor : COLOR; + // #endif + + #if defined(LIGHTMAP_ON) + float2 lightmapUV : TEXCOORD8; + #endif + #if defined(DYNAMICLIGHTMAP_ON) + float2 dynamicLightmapUV : TEXCOORD9; + #endif + #if !defined(LIGHTMAP_ON) + float4 probeOcclusion : TEXCOORD8; + float3 sh : TEXCOORD10; + #endif + + #if defined(VARYINGS_NEED_FOG_AND_VERTEX_LIGHT) + float4 fogFactorAndVertexLight : TEXCOORD11; + #endif + + #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR) + float4 shadowCoord : TEXCOORD12; + #endif + + // #if %EXTRAV2F0REQUIREKEY% + // float4 extraV2F0 : TEXCOORD13; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // float4 extraV2F1 : TEXCOORD14; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // float4 extraV2F2 : TEXCOORD15; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // float4 extraV2F3 : TEXCOORD16; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // float4 extraV2F4 : TEXCOORD17; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // float4 extraV2F5 : TEXCOORD18; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // float4 extraV2F6 : TEXCOORD19; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // float4 extraV2F7 : TEXCOORD20; + // #endif + + #if UNITY_ANY_INSTANCING_ENABLED + uint instanceID : CUSTOM_INSTANCE_ID; + #endif + #if (defined(UNITY_STEREO_MULTIVIEW_ENABLED)) || (defined(UNITY_STEREO_INSTANCING_ENABLED) && (defined(SHADER_API_GLES3) || defined(SHADER_API_GLCORE))) + uint stereoTargetEyeIndexAsBlendIdx0 : BLENDINDICES0; + #endif + #if (defined(UNITY_STEREO_INSTANCING_ENABLED)) + uint stereoTargetEyeIndexAsRTArrayIdx : SV_RenderTargetArrayIndex; + #endif + #if defined(SHADER_STAGE_FRAGMENT) && defined(VARYINGS_NEED_CULLFACE) + FRONT_FACE_TYPE cullFace : FRONT_FACE_SEMANTIC; + #endif + + #if _PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR)) + float4 previousPositionCS : TEXCOORD21; // Contain previous transform position (in case of skinning for example) + float4 positionCS : TEXCOORD22; + #endif + }; + + + + + // data describing the user output of a pixel + struct Surface + { + half3 Albedo; + half Height; + half3 Normal; + half Smoothness; + half3 Emission; + half Metallic; + half3 Specular; + half Occlusion; + half SpecularPower; // for simple lighting + half Alpha; + float outputDepth; // if written, SV_Depth semantic is used. ShaderData.clipPos.z is unused value + // HDRP Only + half SpecularOcclusion; + half SubsurfaceMask; + half Thickness; + half CoatMask; + half CoatSmoothness; + half Anisotropy; + half IridescenceMask; + half IridescenceThickness; + int DiffusionProfileHash; + float SpecularAAThreshold; + float SpecularAAScreenSpaceVariance; + // requires _OVERRIDE_BAKEDGI to be defined, but is mapped in all pipelines + float3 DiffuseGI; + float3 BackDiffuseGI; + float3 SpecularGI; + float ior; + float3 transmittanceColor; + float atDistance; + float transmittanceMask; + // requires _OVERRIDE_SHADOWMASK to be defines + float4 ShadowMask; + + // for decals + float NormalAlpha; + float MAOSAlpha; + + + }; + + // Data the user declares in blackboard blocks + struct Blackboard + { + + float blackboardDummyData; + }; + + // data the user might need, this will grow to be big. But easy to strip + struct ShaderData + { + float4 clipPos; // SV_POSITION + float3 localSpacePosition; + float3 localSpaceNormal; + float3 localSpaceTangent; + + float3 worldSpacePosition; + float3 worldSpaceNormal; + float3 worldSpaceTangent; + float tangentSign; + + float3 worldSpaceViewDir; + float3 tangentSpaceViewDir; + + float4 texcoord0; + float4 texcoord1; + float4 texcoord2; + float4 texcoord3; + + float2 screenUV; + float4 screenPos; + + float4 vertexColor; + bool isFrontFace; + + float4 extraV2F0; + float4 extraV2F1; + float4 extraV2F2; + float4 extraV2F3; + float4 extraV2F4; + float4 extraV2F5; + float4 extraV2F6; + float4 extraV2F7; + + float3x3 TBNMatrix; + Blackboard blackboard; + }; + + struct VertexData + { + #if SHADER_TARGET > 30 + // uint vertexID : SV_VertexID; + #endif + float4 vertex : POSITION; + float3 normal : NORMAL; + float4 tangent : TANGENT; + float4 texcoord0 : TEXCOORD0; + + // optimize out mesh coords when not in use by user or lighting system + #if _URP && (_USINGTEXCOORD1 || _PASSMETA || _PASSFORWARD || _PASSGBUFFER) + float4 texcoord1 : TEXCOORD1; + #endif + + #if _URP && (_USINGTEXCOORD2 || _PASSMETA || ((_PASSFORWARD || _PASSGBUFFER) && defined(DYNAMICLIGHTMAP_ON))) + float4 texcoord2 : TEXCOORD2; + #endif + + #if _STANDARD && (_USINGTEXCOORD1 || (_PASSMETA || ((_PASSFORWARD || _PASSGBUFFER || _PASSFORWARDADD) && LIGHTMAP_ON))) + float4 texcoord1 : TEXCOORD1; + #endif + #if _STANDARD && (_USINGTEXCOORD2 || (_PASSMETA || ((_PASSFORWARD || _PASSGBUFFER) && DYNAMICLIGHTMAP_ON))) + float4 texcoord2 : TEXCOORD2; + #endif + + + #if _HDRP + float4 texcoord1 : TEXCOORD1; + float4 texcoord2 : TEXCOORD2; + #endif + + // #if %TEXCOORD3REQUIREKEY% + float4 texcoord3 : TEXCOORD3; + // #endif + + // #if %VERTEXCOLORREQUIREKEY% + float4 vertexColor : COLOR; + // #endif + + #if _PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR)) + float3 previousPositionOS : TEXCOORD4; // Contain previous transform position (in case of skinning for example) + #if defined (_ADD_PRECOMPUTED_VELOCITY) + float3 precomputedVelocity : TEXCOORD5; // Add Precomputed Velocity (Alembic computes velocities on runtime side). + #endif + #endif + + UNITY_VERTEX_INPUT_INSTANCE_ID + }; + + struct TessVertex + { + float4 vertex : INTERNALTESSPOS; + float3 normal : NORMAL; + float4 tangent : TANGENT; + float4 texcoord0 : TEXCOORD0; + float4 texcoord1 : TEXCOORD1; + float4 texcoord2 : TEXCOORD2; + + // #if %TEXCOORD3REQUIREKEY% + float4 texcoord3 : TEXCOORD3; + // #endif + + // #if %VERTEXCOLORREQUIREKEY% + float4 vertexColor : COLOR; + // #endif + + // #if %EXTRAV2F0REQUIREKEY% + // float4 extraV2F0 : TEXCOORD5; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // float4 extraV2F1 : TEXCOORD6; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // float4 extraV2F2 : TEXCOORD7; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // float4 extraV2F3 : TEXCOORD8; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // float4 extraV2F4 : TEXCOORD9; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // float4 extraV2F5 : TEXCOORD10; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // float4 extraV2F6 : TEXCOORD11; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // float4 extraV2F7 : TEXCOORD12; + // #endif + + #if _PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR)) + float3 previousPositionOS : TEXCOORD13; // Contain previous transform position (in case of skinning for example) + #if defined (_ADD_PRECOMPUTED_VELOCITY) + float3 precomputedVelocity : TEXCOORD14; + #endif + #endif + + UNITY_VERTEX_INPUT_INSTANCE_ID + UNITY_VERTEX_OUTPUT_STEREO + }; + + struct ExtraV2F + { + float4 extraV2F0; + float4 extraV2F1; + float4 extraV2F2; + float4 extraV2F3; + float4 extraV2F4; + float4 extraV2F5; + float4 extraV2F6; + float4 extraV2F7; + Blackboard blackboard; + float4 time; + }; + + + float3 WorldToTangentSpace(ShaderData d, float3 normal) + { + return mul(d.TBNMatrix, normal); + } + + float3 TangentToWorldSpace(ShaderData d, float3 normal) + { + return mul(normal, d.TBNMatrix); + } + + // in this case, make standard more like SRPs, because we can't fix + // unity_WorldToObject in HDRP, since it already does macro-fu there + + #if _STANDARD + float3 TransformWorldToObject(float3 p) { return mul(unity_WorldToObject, float4(p, 1)); }; + float3 TransformObjectToWorld(float3 p) { return mul(unity_ObjectToWorld, float4(p, 1)); }; + float4 TransformWorldToObject(float4 p) { return mul(unity_WorldToObject, p); }; + float4 TransformObjectToWorld(float4 p) { return mul(unity_ObjectToWorld, p); }; + float4x4 GetWorldToObjectMatrix() { return unity_WorldToObject; } + float4x4 GetObjectToWorldMatrix() { return unity_ObjectToWorld; } + #if (defined(SHADER_API_D3D11) || defined(SHADER_API_XBOXONE) || defined(UNITY_COMPILER_HLSLCC) || defined(SHADER_API_PSSL) || (SHADER_TARGET_SURFACE_ANALYSIS && !SHADER_TARGET_SURFACE_ANALYSIS_MOJOSHADER)) + #define UNITY_SAMPLE_TEX2D_LOD(tex,coord, lod) tex.SampleLevel (sampler##tex,coord, lod) + #define UNITY_SAMPLE_TEX2D_SAMPLER_LOD(tex,samplertex,coord, lod) tex.SampleLevel (sampler##samplertex,coord, lod) + #else + #define UNITY_SAMPLE_TEX2D_LOD(tex,coord,lod) tex2D (tex,coord,0,lod) + #define UNITY_SAMPLE_TEX2D_SAMPLER_LOD(tex,samplertex,coord,lod) tex2D (tex,coord,0,lod) + #endif + + #undef GetWorldToObjectMatrix() + + #define GetWorldToObjectMatrix() unity_WorldToObject + + + #endif + + float3 GetCameraWorldPosition() + { + #if _HDRP + return GetCameraRelativePositionWS(_WorldSpaceCameraPos); + #else + return _WorldSpaceCameraPos; + #endif + } + + #if _GRABPASSUSED + #if _STANDARD + TEXTURE2D(%GRABTEXTURE%); + SAMPLER(sampler_%GRABTEXTURE%); + #endif + + half3 GetSceneColor(float2 uv) + { + #if _STANDARD + return SAMPLE_TEXTURE2D(%GRABTEXTURE%, sampler_%GRABTEXTURE%, uv).rgb; + #else + return SHADERGRAPH_SAMPLE_SCENE_COLOR(uv); + #endif + } + #endif + + + + #if _STANDARD + UNITY_DECLARE_DEPTH_TEXTURE(_CameraDepthTexture); + float GetSceneDepth(float2 uv) { return SAMPLE_DEPTH_TEXTURE(_CameraDepthTexture, uv); } + float GetLinear01Depth(float2 uv) { return Linear01Depth(GetSceneDepth(uv)); } + float GetLinearEyeDepth(float2 uv) { return LinearEyeDepth(GetSceneDepth(uv)); } + #else + float GetSceneDepth(float2 uv) { return SHADERGRAPH_SAMPLE_SCENE_DEPTH(uv); } + float GetLinear01Depth(float2 uv) { return Linear01Depth(GetSceneDepth(uv), _ZBufferParams); } + float GetLinearEyeDepth(float2 uv) { return LinearEyeDepth(GetSceneDepth(uv), _ZBufferParams); } + #endif + + float3 GetWorldPositionFromDepthBuffer(float2 uv, float3 worldSpaceViewDir) + { + float eye = GetLinearEyeDepth(uv); + float3 camView = mul((float3x3)GetObjectToWorldMatrix(), transpose(mul(GetWorldToObjectMatrix(), UNITY_MATRIX_I_V)) [2].xyz); + + float dt = dot(worldSpaceViewDir, camView); + float3 div = worldSpaceViewDir/dt; + float3 wpos = (eye * div) + GetCameraWorldPosition(); + return wpos; + } + + #if _HDRP + float3 ObjectToWorldSpacePosition(float3 pos) + { + return GetAbsolutePositionWS(TransformObjectToWorld(pos)); + } + #else + float3 ObjectToWorldSpacePosition(float3 pos) + { + return TransformObjectToWorld(pos); + } + #endif + + #if _STANDARD + UNITY_DECLARE_SCREENSPACE_TEXTURE(_CameraDepthNormalsTexture); + float3 GetSceneNormal(float2 uv, float3 worldSpaceViewDir) + { + float4 depthNorms = UNITY_SAMPLE_SCREENSPACE_TEXTURE(_CameraDepthNormalsTexture, uv); + float3 norms = DecodeViewNormalStereo(depthNorms); + norms = mul((float3x3)GetWorldToViewMatrix(), norms) * 0.5 + 0.5; + return norms; + } + #elif _HDRP && !_DECALSHADER + + float3 GetSceneNormal(float2 uv, float3 worldSpaceViewDir) + { + NormalData nd; + DecodeFromNormalBuffer(_ScreenSize.xy * uv, nd); + return nd.normalWS; + } + #elif _URP + #if (SHADER_LIBRARY_VERSION_MAJOR >= 10) + #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/DeclareNormalsTexture.hlsl" + #endif + + float3 GetSceneNormal(float2 uv, float3 worldSpaceViewDir) + { + #if (SHADER_LIBRARY_VERSION_MAJOR >= 10) + return SampleSceneNormals(uv); + #else + float3 wpos = GetWorldPositionFromDepthBuffer(uv, worldSpaceViewDir); + return normalize(-cross(ddx(wpos), ddy(wpos))) * 0.5 + 0.5; + #endif + + } + #endif + + #if _HDRP + + half3 UnpackNormalmapRGorAG(half4 packednormal) + { + // This do the trick + packednormal.x *= packednormal.w; + + half3 normal; + normal.xy = packednormal.xy * 2 - 1; + normal.z = sqrt(1 - saturate(dot(normal.xy, normal.xy))); + return normal; + } + half3 UnpackNormal(half4 packednormal) + { + #if defined(UNITY_NO_DXT5nm) + return packednormal.xyz * 2 - 1; + #else + return UnpackNormalmapRGorAG(packednormal); + #endif + } + #endif + #if _HDRP || _URP + + half3 UnpackScaleNormal(half4 packednormal, half scale) + { + #ifndef UNITY_NO_DXT5nm + // Unpack normal as DXT5nm (1, y, 1, x) or BC5 (x, y, 0, 1) + // Note neutral texture like "bump" is (0, 0, 1, 1) to work with both plain RGB normal and DXT5nm/BC5 + packednormal.x *= packednormal.w; + #endif + half3 normal; + normal.xy = (packednormal.xy * 2 - 1) * scale; + normal.z = sqrt(1 - saturate(dot(normal.xy, normal.xy))); + return normal; + } + + #endif + + + void GetSun(out float3 lightDir, out float3 color) + { + lightDir = float3(0.5, 0.5, 0); + color = 1; + #if _HDRP + if (_DirectionalLightCount > 0) + { + DirectionalLightData light = _DirectionalLightDatas[0]; + lightDir = -light.forward.xyz; + color = light.color; + } + #elif _STANDARD + lightDir = normalize(_WorldSpaceLightPos0.xyz); + color = _LightColor0.rgb; + #elif _URP + Light light = GetMainLight(); + lightDir = light.direction; + color = light.color; + #endif + } + + + + CBUFFER_START(UnityPerMaterial) + + + half4 _Color; + half4 _MainTex_ST, _MainTex_TexelSize; + half _Alpha, _AlphaCutoffValue; + + #if ATLAS_ON + half _MinXUV, _MaxXUV, _MinYUV, _MaxYUV; + #endif + + #if GLOW_ON + half4 _GlowColor; + half _Glow, _GlowGlobal; + #endif + + #if HSV_ON + half _HsvShift, _HsvSaturation, _HsvBright; + #endif + + #if DISTORT_ON + half4 _DistortTex_ST; + half _DistortTexXSpeed, _DistortTexYSpeed, _DistortAmount; + #endif + + #if FADE_ON + half4 _FadeBurnColor, _FadeTex_ST, _FadeBurnTex_ST; + half _FadeAmount, _FadeBurnWidth, _FadeBurnTransition,_FadeBurnGlow; + #endif + + #if OUTBASE_ON + half4 _OutlineColor; + half _OutlineAlpha, _OutlineGlow, _OutlineWidth; + int _OutlinePixelWidth; + #endif + + #if OUTTEX_ON + half4 _OutlineTex_ST; + half _OutlineTexXSpeed, _OutlineTexYSpeed; + #endif + + #if OUTDIST_ON + half4 _OutlineDistortTex_ST; + half _OutlineDistortTexXSpeed, _OutlineDistortTexYSpeed, _OutlineDistortAmount; + #endif + + #if ALPHAOUTLINE_ON + half _AlphaOutlineGlow, _AlphaOutlinePower, _AlphaOutlineMinAlpha, _AlphaOutlineBlend; + half4 _AlphaOutlineColor; + #endif + + #if INNEROUTLINE_ON + half _InnerOutlineThickness, _InnerOutlineAlpha, _InnerOutlineGlow; + half4 _InnerOutlineColor; + #endif + + #if GRADIENT_ON + half _GradBlend, _GradBoostX, _GradBoostY; + half4 _GradTopRightCol, _GradTopLeftCol, _GradBotRightCol, _GradBotLeftCol; + #endif + + #if COLORSWAP_ON + half4 _ColorSwapRed, _ColorSwapGreen, _ColorSwapBlue; + half _ColorSwapRedLuminosity, _ColorSwapGreenLuminosity, _ColorSwapBlueLuminosity, _ColorSwapBlend; + #endif + + #if CHANGECOLOR_ON + half4 _ColorChangeNewCol, _ColorChangeTarget; + half _ColorChangeTolerance, _ColorChangeLuminosity; + #endif + #if CHANGECOLOR2_ON + half4 _ColorChangeNewCol2, _ColorChangeTarget2; + half _ColorChangeTolerance2; + #endif + #if CHANGECOLOR3_ON + half4 _ColorChangeNewCol3, _ColorChangeTarget3; + half _ColorChangeTolerance3; + #endif + + #if COLORRAMP_ON + half _ColorRampLuminosity, _ColorRampBlend; + #endif + + #if HITEFFECT_ON + half4 _HitEffectColor; + half _HitEffectGlow, _HitEffectBlend; + #endif + + #if NEGATIVE_ON + half _NegativeAmount; + #endif + + #if PIXELATE_ON + half _PixelateSize; + #endif + + #if GREYSCALE_ON + half _GreyscaleLuminosity, _GreyscaleBlend; + half4 _GreyscaleTintColor; + #endif + + #if POSTERIZE_ON + half _PosterizeNumColors, _PosterizeGamma; + #endif + + #if BLUR_ON + half _BlurIntensity; + #endif + + #if MOTIONBLUR_ON + half _MotionBlurAngle, _MotionBlurDist; + #endif + + #if GHOST_ON + half _GhostColorBoost, _GhostTransparency, _GhostBlend; + #endif + + #if HOLOGRAM_ON + half _HologramStripesAmount, _HologramMinAlpha, _HologramUnmodAmount, _HologramStripesSpeed, _HologramMaxAlpha, _HologramBlend; + half4 _HologramStripeColor; + #endif + + #if CHROMABERR_ON + half _ChromAberrAmount, _ChromAberrAlpha; + #endif + + #if GLITCH_ON + half _GlitchAmount, _GlitchSize; + #endif + + #if FLICKER_ON + half _FlickerFreq, _FlickerPercent, _FlickerAlpha; + #endif + + #if SHADOW_ON + half _ShadowX, _ShadowY, _ShadowAlpha; + half4 _ShadowColor; + #endif + + #if SHINE_ON + half4 _ShineColor; + half _ShineLocation, _ShineRotate, _ShineWidth, _ShineGlow; + #endif + + #if CONTRAST_ON + half _Contrast, _Brightness; + #endif + + #if OVERLAY_ON + half4 _OverlayTex_ST, _OverlayColor; + half _OverlayGlow, _OverlayBlend, _OverlayTextureScrollXSpeed, _OverlayTextureScrollYSpeed; + #endif + + #if DOODLE_ON + half _HandDrawnAmount, _HandDrawnSpeed; + #endif + + #if WIND_ON + half _GrassSpeed, _GrassWind, _GrassManualAnim, _GrassRadialBend; + #endif + + #if WAVEUV_ON + float _WaveAmount, _WaveSpeed, _WaveStrength, _WaveX, _WaveY; + #endif + + #if ROUNDWAVEUV_ON + half _RoundWaveStrength, _RoundWaveSpeed; + #endif + + #if RECTSIZE_ON + half _RectSize; + #endif + + #if OFFSETUV_ON + half _OffsetUvX, _OffsetUvY; + #endif + + #if CLIPPING_ON + half _ClipUvLeft, _ClipUvRight, _ClipUvUp, _ClipUvDown; + #endif + + #if RADIALCLIPPING_ON + half _RadialStartAngle, _RadialClip, _RadialClip2; + #endif + + #if TEXTURESCROLL_ON + half _TextureScrollXSpeed, _TextureScrollYSpeed; + #endif + + #if ZOOMUV_ON + half _ZoomUvAmount; + #endif + + #if WARP_ON + half _WarpStrength, _WarpSpeed, _WarpScale; + #endif + + #if TWISTUV_ON + half _TwistUvAmount, _TwistUvPosX, _TwistUvPosY, _TwistUvRadius; + #endif + + #if ROTATEUV_ON + half _RotateUvAmount; + #endif + + #if FISHEYE_ON + half _FishEyeUvAmount; + #endif + + #if PINCH_ON + half _PinchUvAmount; + #endif + + #if SHAKEUV_ON + half _ShakeUvSpeed, _ShakeUvX, _ShakeUvY; + #endif + + #if NORMALMAP_ON + half _NormalStrength; + #endif + + float _RandomSeed; + + + + + CBUFFER_END + + + + + + + + TEXTURE2D(_MainTex); + SAMPLER(sampler_MainTex); + + #if GLOW_ON + TEXTURE2D(_GlowTex); + SAMPLER(sampler_GlowTex); + #endif + + #if FADE_ON + TEXTURE2D(_FadeTex); + SAMPLER(sampler_FadeTex); + + TEXTURE2D(_FadeBurnTex); + SAMPLER(sampler_FadeBurnTex); + #endif + + #if DISTORT_ON + TEXTURE2D(_DistortTex); + SAMPLER(sampler_DistortTex); + #endif + + #if OUTTEX_ON + TEXTURE2D(_OutlineTex); + SAMPLER(sampler_OutlineTex); + #endif + + #if OUTDIST_ON + TEXTURE2D(_OutlineDistortTex); + SAMPLER(sampler_OutlineDistortTex); + #endif + + #if COLORSWAP_ON + TEXTURE2D(_ColorSwapTex); + SAMPLER(sampler_ColorSwapTex); + #endif + + #if COLORRAMP_ON + TEXTURE2D(_ColorRampTex); + TEXTURE2D(_ColorRampTexGradient); + SAMPLER(sampler_ColorRampTex); + SAMPLER(sampler_ColorRampTexGradient); + #endif + + #if SHINE_ON + TEXTURE2D(_ShineMask); + SAMPLER(sampler_ShineMask); + #endif + + #if OVERLAY_ON + TEXTURE2D(_OverlayTex); + SAMPLER(sampler_OverlayTex); + #endif + + #if NORMALMAP_ON + TEXTURE2D(_NormalMap); + SAMPLER(sampler_NormalMap); + #endif + + + half3 GetPixel(in int offsetX, in int offsetY, in half2 uv, in Texture2D _tex, in SamplerState _sampler) + { + half2 _uv = uv + half2(offsetX * _MainTex_TexelSize.x, offsetY * _MainTex_TexelSize.y); + half4 col = SAMPLE_TEXTURE2D(_tex, _sampler, _uv); + return col.rgb; + } + + + //BLURS------------------------------------------------------------------------- + half4 Blur(half2 uv, Texture2D source, SamplerState sampler_source, half Intensity) + { + const half2 texelSize = 1.0 / _ScreenParams.xy; + const half4 color = SAMPLE_TEXTURE2D(source, sampler_source, uv); + const half2 offset = Intensity * texelSize; + + half4 accumulatedColor = color; + half accumulatedWeight = 1.0; + for (int x = -1; x <= 1; x++) + { + for (int y = -1; y <= 1; y++) + { + const half2 sampleUV = uv + half2(x, y) * offset; + const half4 sampleColor = SAMPLE_TEXTURE2D(source, sampler_source, sampleUV); + + accumulatedColor += sampleColor; + accumulatedWeight += 1.0; + } + } + + half4 blurredColor = accumulatedColor / accumulatedWeight; + return blurredColor; + } + + half BlurHD_G(half bhqp, half x) + { + return exp(-(x * x) / (2.0 * bhqp * bhqp)); + } + half4 BlurHD(half2 uv, Texture2D source, SamplerState sampler_source, half BlurAmount, half xScale, half yScale) + { + int iterations = 16; + int halfIterations = iterations / 2; + half sigmaX = 0.1 + BlurAmount * 0.5; + half sigmaY = sigmaX; + half total = 0.0; + half4 ret = half4(0, 0, 0, 0); + for (int iy = 0; iy < iterations; ++iy) + { + half fy = BlurHD_G(sigmaY, half(iy) -half(halfIterations)); + half offsetY = half(iy - halfIterations) * 0.00390625 * xScale; + for (int ix = 0; ix < iterations; ++ix) + { + half fx = BlurHD_G(sigmaX, half(ix) - half(halfIterations)); + half offsetX = half(ix - halfIterations) * 0.00390625 * yScale; + total += fx * fy; + ret += SAMPLE_TEXTURE2D(source, sampler_source, uv + half2(offsetX, offsetY)) * fx * fy; + } + } + return ret / total; + } + //----------------------------------------------------------------------- + + + //------------------------------------------- + half RemapFloat(half inValue, half inMin, half inMax, half outMin, half outMax){ + return outMin + (inValue - inMin) * (outMax - outMin) / (inMax - inMin); + } + //------------------------------------------- + + //----------------------------------------------------------------------- + half rand(half2 seed, half offset) { + return (frac(sin(dot(seed, half2(12.9898, 78.233))) * 43758.5453) + offset) % 1.0; + } + + half rand2(half2 seed, half offset) { + return (frac(sin(dot(seed * floor(50 + (_Time.x % 1.0) * 12.), half2(127.1, 311.7))) * 43758.5453123) + offset) % 1.0; + } + + half rand2CustomTime(half2 seed, half offset, half customTime) { + return (frac(sin(dot(seed * floor(50 + (customTime % 1.0) * 12.), half2(127.1, 311.7))) * 43758.5453123) + offset) % 1.0; + } + //----------------------------------------------------------------------- + + + void Ext_ModifyVertex0 (inout VertexData v, inout ExtraV2F d) + { + //BILBOARD_ON + #if BILBOARD_ON + half3 camRight = mul((half3x3)unity_CameraToWorld, half3(1,0,0)); + half3 camUp = half3(0,1,0); + #if BILBOARDY_ON + camUp = mul((half3x3)unity_CameraToWorld, half3(0,1,0)); + #endif + half3 localPos = v.vertex.x * camRight + v.vertex.y * camUp; + v.vertex = half4(localPos, 1); + #endif + //----------------------------------------------------------- + + v.texcoord0.xy = TRANSFORM_TEX(v.texcoord0.xy, _MainTex); + half2 center = half2(0.5, 0.5); + #if ATLAS_ON + center = half2((_MaxXUV + _MinXUV) / 2.0, (_MaxYUV + _MinYUV) / 2.0); + #endif + + //POLARUV_ON + #if POLARUV_ON + v.texcoord0.xy = v.texcoord0.xy - center; + #endif + + //---------------------------------------- + + //ROTATEUV_ON + #if ROTATEUV_ON + half2 uvC = v.texcoord0.xy; + half cosAngle = cos(_RotateUvAmount); + half sinAngle = sin(_RotateUvAmount); + half2x2 rot = half2x2(cosAngle, -sinAngle, sinAngle, cosAngle); + uvC -= center; + v.texcoord0.xy = mul(rot, uvC); + v.texcoord0.xy += center; + #endif + //-------------------- + + #if RECTSIZE_ON + v.vertex.xyz += (v.vertex.xyz * (_RectSize - 1.0)); + #endif + + #if OUTTEX_ON + v.texcoord1.xy = TRANSFORM_TEX(v.texcoord0.xy, _OutlineTex); + #endif + + #if OUTDIST_ON + v.texcoord2.xy = TRANSFORM_TEX(v.texcoord0.xy, _OutlineDistortTex); + #endif + + #if DISTORT_ON + v.texcoord3.xy = TRANSFORM_TEX(v.texcoord0.xy, _DistortTex); + #endif + } + + void Ext_SurfaceFunction0 (inout Surface o, ShaderData d) + { + half randomSeed = _RandomSeed; + + float2 uvRect = d.texcoord0; + half2 center = half2(0.5, 0.5); + #if ATLAS_ON + center = half2((_MaxXUV + _MinXUV) / 2.0, (_MaxYUV + _MinYUV) / 2.0); + uvRect = half2((d.texcoord0.x - _MinXUV) / (_MaxXUV - _MinXUV), (d.texcoord0.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half2 centerTiled = half2(center.x * _MainTex_ST.x, center.y * _MainTex_ST.y); + + //CLIPPING_ON + #if CLIPPING_ON + half2 tiledUv = half2(d.texcoord0.x / _MainTex_ST.x, d.texcoord0.y / _MainTex_ST.y); + #if ATLAS_ON + tiledUv = half2((tiledUv.x - _MinXUV) / (_MaxXUV - _MinXUV), (tiledUv.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + clip((1 - _ClipUvUp) - tiledUv.y); + clip(tiledUv.y - _ClipUvDown); + clip((1 - _ClipUvRight) - tiledUv.x); + clip(tiledUv.x - _ClipUvLeft); + #endif + //---------------------------------- + + //RADIALCLIPPING_ON + #if RADIALCLIPPING_ON + half2 tiledUv2 = half2(d.texcoord0.x / _MainTex_ST.x, d.texcoord0.y / _MainTex_ST.y); + #if ATLAS_ON + tiledUv2 = half2((tiledUv2.x - _MinXUV) / (_MaxXUV - _MinXUV), (tiledUv2.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half startAngle = _RadialStartAngle - _RadialClip; + half endAngle = _RadialStartAngle + _RadialClip2; + half offset0 = clamp(0, 360, startAngle + 360); + half offset360 = clamp(0, 360, endAngle - 360); + half2 atan2Coord = half2(lerp(-1, 1, tiledUv2.x), lerp(-1, 1, tiledUv2.y)); + half atanAngle = atan2(atan2Coord.y, atan2Coord.x) * 57.3; // angle in degrees + if(atanAngle < 0) atanAngle = 360 + atanAngle; + if(atanAngle >= startAngle && atanAngle <= endAngle) discard; + if(atanAngle <= offset360) discard; + if(atanAngle >= offset0) discard; + #endif + + //----------------------------- + + //TEXTURESCROLL_ON && ATLAS_ON + #if TEXTURESCROLL_ON && ATLAS_ON + d.texcoord0.xy = half2(_MinXUV + ((_MaxXUV - _MinXUV) * (abs(((_Time.y + randomSeed) * _TextureScrollXSpeed) + uvRect.x) % 1)), + _MinYUV + ((_MaxYUV - _MinYUV) * (abs(((_Time.y + randomSeed) * _TextureScrollYSpeed) + uvRect.y) % 1))); + #endif + //---------------------------- + + //OFFSETUV_ON + #if OFFSETUV_ON + #if ATLAS_ON + d.texcoord0.xy = half2(_MinXUV + ((_MaxXUV - _MinXUV) * (abs((_OffsetUvX + uvRect.x) % 1))), + _MinYUV + ((_MaxYUV - _MinYUV) * (abs(_OffsetUvY + uvRect.y) % 1))); + #else + d.texcoord0.xy += half2(_OffsetUvX, _OffsetUvY); + #endif + #endif + + //---------------------- + + //POLARUV_ON + #if POLARUV_ON + d.texcoord0.xy = half2(atan2(d.texcoord0.y, d.texcoord0.x) / (2.0f * 3.141592653589f), length(d.texcoord0.xy)); + d.texcoord0.xy *= _MainTex_ST.xy; + #endif + + //-------------------------------------- + + //TWISTUV_ON + #if TWISTUV_ON + #if ATLAS_ON + _TwistUvPosX = ((_MaxXUV - _MinXUV) * _TwistUvPosX) + _MinXUV; + _TwistUvPosY = ((_MaxYUV - _MinYUV) * _TwistUvPosY) + _MinYUV; + #endif + half2 tempUv = d.texcoord0.xy - half2(_TwistUvPosX * _MainTex_ST.x, _TwistUvPosY * _MainTex_ST.y); + _TwistUvRadius *= (_MainTex_ST.x + _MainTex_ST.y) / 2; + half percent = (_TwistUvRadius - length(tempUv)) / _TwistUvRadius; + half theta = percent * percent * (2.0 * sin(_TwistUvAmount)) * 8.0; + half s = sin(theta); + half c = cos(theta); + half beta = max(sign(_TwistUvRadius - length(tempUv)), 0.0); + tempUv = half2(dot(tempUv, half2(c, -s)), dot(tempUv, half2(s, c))) * beta + tempUv * (1 - beta); + tempUv += half2(_TwistUvPosX * _MainTex_ST.x, _TwistUvPosY * _MainTex_ST.y); + d.texcoord0.xy = tempUv; + #endif + + //-------------------------------------------- + + //FISHEYE_ON + #if FISHEYE_ON + half bind = length(centerTiled); + half2 dF = d.texcoord0.xy - centerTiled; + half dFlen = length(dF); + half fishInt = (3.14159265359 / bind) * (_FishEyeUvAmount + 0.001); + d.texcoord0.xy = centerTiled + (dF / (max(0.0001, dFlen))) * tan(dFlen * fishInt) * bind / tan(bind * fishInt); + #endif + //--------------------------------------------- + + //PINCH_ON + #if PINCH_ON + half2 dP = d.texcoord0.xy - centerTiled; + half pinchInt = (3.141592 / length(centerTiled)) * (-_PinchUvAmount + 0.001); + d.texcoord0.xy = centerTiled + normalize(dP) * atan(length(dP) * -pinchInt * 10.0) * 0.5 / atan(-pinchInt * 5); + #endif + + //--------------------------------------------- + + //ZOOMUV_ON + #if ZOOMUV_ON + d.texcoord0.xy -= centerTiled; + d.texcoord0.xy = d.texcoord0.xy * _ZoomUvAmount; + d.texcoord0.xy += centerTiled; + #endif + + //----------------------------------------------- + + //DOODLE_ON + #if DOODLE_ON + half2 uvCopy = uvRect; + _HandDrawnSpeed = (floor((_Time.x + randomSeed) * 20 * _HandDrawnSpeed) / _HandDrawnSpeed) * _HandDrawnSpeed; + uvCopy.x = sin((uvCopy.x * _HandDrawnAmount + _HandDrawnSpeed) * 4); + uvCopy.y = cos((uvCopy.y * _HandDrawnAmount + _HandDrawnSpeed) * 4); + d.texcoord0.xy = lerp(d.texcoord0.xy, d.texcoord0.xy + uvCopy, 0.0005 * _HandDrawnAmount); + #endif + + //-------------------------- + + //SHAKEUV_ON + #if SHAKEUV_ON + half xShake = sin((_Time.x + randomSeed) * _ShakeUvSpeed * 50) * _ShakeUvX; + half yShake = cos((_Time.x + randomSeed) * _ShakeUvSpeed * 50) * _ShakeUvY; + d.texcoord0.xy += half2(xShake * 0.012, yShake * 0.01); + #endif + + //------------------------------------------- + + //RECTSIZE_ON + #if RECTSIZE_ON + d.texcoord0.xy = d.texcoord0.xy * (_RectSize).xx + (((-_RectSize * 0.5) + 0.5)).xx; + #endif + + //------------------------------------------- + + //DISTORT_ON + #if DISTORT_ON + #if ATLAS_ON + d.texcoord3.x = d.texcoord3.x * (1 / (_MaxXUV - _MinXUV)); + d.texcoord3.y = d.texcoord3.y * (1 / (_MaxYUV - _MinYUV)); + #endif + + d.texcoord3.x += ((_Time.x + _RandomSeed) * _DistortTexXSpeed) % 1; + d.texcoord3.y += ((_Time.x + _RandomSeed) * _DistortTexYSpeed) % 1; + half distortAmnt = (SAMPLE_TEXTURE2D(_DistortTex, sampler_DistortTex, d.texcoord3.xy).r - 0.5) * 0.2 * _DistortAmount; + d.texcoord0.x += distortAmnt; + d.texcoord0.y += distortAmnt; + #endif + //------------------------------------------------------- + + //WARP_ON + #if WARP_ON + half2 warpUv = half2(d.texcoord0.x / _MainTex_ST.x, d.texcoord0.y / _MainTex_ST.y); + #if ATLAS_ON + warpUv = half2((warpUv.x - _MinXUV) / (_MaxXUV - _MinXUV), (warpUv.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + const float tau = 6.283185307179586; + float xWarp = (_Time.y + randomSeed) * _WarpSpeed + warpUv.x * tau / _WarpScale; + float yWarp = (_Time.y + randomSeed) * _WarpSpeed + warpUv.y * tau / _WarpScale; + float2 warp = float2(sin(xWarp), sin(yWarp)) * _WarpStrength; + d.texcoord0.xy += warp; + #endif + + //------------------------------------------------------- + + //WAVEUV_ON + #if WAVEUV_ON + float2 uvWave = half2(_WaveX * _MainTex_ST.x, _WaveY * _MainTex_ST.y) - d.texcoord0.xy; + uvWave %= 1; + #if ATLAS_ON + uvWave = half2(_WaveX, _WaveY) - uvRect; + #endif + uvWave.x *= _ScreenParams.x / _ScreenParams.y; + float waveTime = _Time.y + randomSeed; + float angWave = (sqrt(dot(uvWave, uvWave)) * _WaveAmount) - ((waveTime * _WaveSpeed)); + d.texcoord0.xy = d.texcoord0.xy + uvWave * sin(angWave) * (_WaveStrength / 1000.0); + #endif + //---------------------------------------------------- + + //ROUNDWAVEUV_ON + #if ROUNDWAVEUV_ON + half xWave = ((0.5 * _MainTex_ST.x) - uvRect.x); + half yWave = ((0.5 * _MainTex_ST.y) - uvRect.y) * (_MainTex_TexelSize.w / _MainTex_TexelSize.z); + half ripple = -sqrt(xWave*xWave + yWave* yWave); + d.texcoord0.xy += (sin((ripple + (_Time.y + randomSeed) * (_RoundWaveSpeed/10.0)) / 0.015) * (_RoundWaveStrength/10.0)) % 1; + #endif + //---------------------------------------------------- + + + //WIND_ON + #if WIND_ON + half windOffset = sin((_Time.x + randomSeed) * _GrassSpeed * 10); + half2 windCenter = half2(0.5, 0.1); + #if ATLAS_ON + windCenter.x = ((_MaxXUV - _MinXUV) * windCenter.x) + _MinXUV; + windCenter.y = ((_MaxYUV - _MinYUV) * windCenter.y) + _MinYUV; + #endif + #if !MANUALWIND_ON + d.texcoord0.x = fmod(abs(lerp(d.texcoord0.x, d.texcoord0.x + (_GrassWind * 0.01 * windOffset), uvRect.y)), 1); + #else + d.texcoord0.x = fmod(abs(lerp(d.texcoord0.x, d.texcoord0.x + (_GrassWind * 0.01 * _GrassManualAnim), uvRect.y)), 1); + windOffset = _GrassManualAnim; + #endif + half2 delta = d.texcoord0.xy - windCenter; + half delta2 = dot(delta.xy, delta.xy); + half2 delta_offset = delta2 * windOffset; + d.texcoord0.xy = d.texcoord0.xy + half2(delta.y, -delta.x) * delta_offset * _GrassRadialBend; + #endif + + //-------------------------------------------------------- + + //TEXTURESCROLL_ON && !ATLAS_ON + #if TEXTURESCROLL_ON && !ATLAS_ON + d.texcoord0.x += ((_Time.y + randomSeed) * _TextureScrollXSpeed) % 1; + d.texcoord0.y += ((_Time.y + randomSeed) * _TextureScrollYSpeed) % 1; + #endif + //------------------------------ + + //PIXELATE_ON + #if PIXELATE_ON + half aspectRatio = _MainTex_TexelSize.x / _MainTex_TexelSize.y; + half2 pixelSize = float2(_PixelateSize, _PixelateSize * aspectRatio); + d.texcoord0.xy = floor(d.texcoord0.xy * pixelSize) / pixelSize; + #endif + //-------------- + + half4 col = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy); + half originalAlpha = col.a; + col *= d.vertexColor; + + //NORMAL MAP + #if NORMALMAP_ON + half4 normalSample = SAMPLE_TEXTURE2D(_NormalMap, sampler_NormalMap, d.texcoord0.xy); + half3 normalTS = UnpackNormal(normalSample); + normalTS.xy *= _NormalStrength; + o.Normal = normalTS; + #endif + + + //GLITCH_ON + #if GLITCH_ON + half2 uvGlitch = uvRect; + uvGlitch.y -= 0.5; + half lineNoise = pow(rand2(floor(uvGlitch * half2(24., 19.) * _GlitchSize) * 4.0, randomSeed), 3.0) * _GlitchAmount + * pow(rand2(floor(uvGlitch * half2(38., 14.) * _GlitchSize) * 4.0, randomSeed), 3.0); + col = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(lineNoise * 0.02 * rand2(half2(2.0, 1), randomSeed), 0)) * d.vertexColor; + #endif + //-------------------------------------- + + //CHROMABERR_ON + #if CHROMABERR_ON + half4 r = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(_ChromAberrAmount/10, 0)) * d.vertexColor; + half4 b = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(-_ChromAberrAmount/10, 0)) * d.vertexColor; + col = half4(r.r * r.a, col.g, b.b * b.a, max(max(r.a, b.a) * _ChromAberrAlpha, col.a)); + #endif + + //-------------------------------- + + //BLUR_ON + #if BLUR_ON + #if ATLAS_ON + #if !BLURISHD_ON + col = BlurHD(d.texcoord0.xy, _MainTex, sampler_MainTex, _BlurIntensity, (_MaxXUV - _MinXUV), (_MaxYUV - _MinYUV)) * d.vertexColor; + #else + col = Blur(d.texcoord0.xy, _MainTex, sampler_MainTex, _BlurIntensity * (_MaxXUV - _MinXUV)) * d.vertexColor; + #endif + #else + #if !BLURISHD_ON + col = BlurHD(d.texcoord0.xy, _MainTex, sampler_MainTex, _BlurIntensity, 1, 1) * d.vertexColor; + #else + col = Blur(d.texcoord0.xy, _MainTex, sampler_MainTex, _BlurIntensity) * d.vertexColor; + #endif + #endif + #endif + + //-------------------- + + //MOTIONBLUR_ON + #if MOTIONBLUR_ON + _MotionBlurAngle = _MotionBlurAngle * 3.1415926; + #define rot(n) mul(n, half2x2(cos(_MotionBlurAngle), -sin(_MotionBlurAngle), sin(_MotionBlurAngle), cos(_MotionBlurAngle))) + _MotionBlurDist = _MotionBlurDist * 0.005; + #if ATLAS_ON + _MotionBlurDist *= (_MaxXUV - _MinXUV); + #endif + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(-_MotionBlurDist, -_MotionBlurDist))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(-_MotionBlurDist * 2, -_MotionBlurDist * 2))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(-_MotionBlurDist * 3, -_MotionBlurDist * 3))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(-_MotionBlurDist * 4, -_MotionBlurDist * 4))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(_MotionBlurDist, _MotionBlurDist))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(_MotionBlurDist * 2, _MotionBlurDist * 2))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(_MotionBlurDist * 3, _MotionBlurDist * 3))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(_MotionBlurDist * 4, _MotionBlurDist * 4))); + col.rgb = col.rgb / 9; + #endif + //------------------------------------ + + //NEGATIVE_ON + #if NEGATIVE_ON + col.rgb = lerp(col.rgb, 1 - col.rgb, _NegativeAmount); + #endif + + //-------------- + half luminance = 0; + + //GREYSCALE_ON && !GREYSCALEOUTLINE_ON + #if GREYSCALE_ON && !GREYSCALEOUTLINE_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + luminance = saturate(luminance + _GreyscaleLuminosity); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _GreyscaleTintColor, _GreyscaleBlend); + #endif + //------------------------------------ + + //GHOST_ON + #if GHOST_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + half4 ghostResult; + ghostResult.a = saturate(luminance - _GhostTransparency) * col.a; + ghostResult.rgb = col.rgb * (luminance + _GhostColorBoost); + col = lerp(col, ghostResult, _GhostBlend); + #endif + //------------------------------------ + + //INNEROUTLINE_ON + #if INNEROUTLINE_ON + half3 innerT = abs(GetPixel(0, _InnerOutlineThickness, d.texcoord0.xy, _MainTex, sampler_MainTex) - GetPixel(0, -_InnerOutlineThickness, d.texcoord0.xy, _MainTex, sampler_MainTex)); + innerT += abs(GetPixel(_InnerOutlineThickness, 0, d.texcoord0.xy, _MainTex, sampler_MainTex) - GetPixel(-_InnerOutlineThickness, 0, d.texcoord0.xy, _MainTex, sampler_MainTex)); + #if !ONLYINNEROUTLINE_ON + innerT = (innerT / 2.0) * col.a * _InnerOutlineAlpha; + col.rgb += length(innerT) * _InnerOutlineColor.rgb * _InnerOutlineGlow; + #else + innerT *= col.a * _InnerOutlineAlpha; + col.rgb = length(innerT) * _InnerOutlineColor.rgb * _InnerOutlineGlow; + col.a = step(0.3, col.r+col.g+col.b); + #endif + #endif + //------------------------------------------------------- + + //HITEFFECT_ON + #if HITEFFECT_ON + col.rgb = lerp(col.rgb, _HitEffectColor.rgb * _HitEffectGlow, _HitEffectBlend); + #endif + //-------------------- + + //GRADIENT_ON + #if GRADIENT_ON + half2 tiledUvGrad = half2(uvRect.x / _MainTex_ST.x, uvRect.y / _MainTex_ST.y); + #if GRADIENT2COL_ON + _GradTopRightCol = _GradTopLeftCol; + _GradBotRightCol = _GradBotLeftCol; + #endif + #if RADIALGRADIENT_ON + half radialDist = 1 - length(tiledUvGrad - half2(0.5, 0.5)); + radialDist *= (_MainTex_TexelSize.w / _MainTex_TexelSize.z); + radialDist = saturate(_GradBoostX * radialDist); + half4 gradientResult = lerp(_GradTopLeftCol, _GradBotLeftCol, radialDist); + #else + half gradXLerpFactor = saturate(pow(tiledUvGrad.x, _GradBoostX)); + half4 gradientResult = lerp(lerp(_GradBotLeftCol, _GradBotRightCol, gradXLerpFactor), + lerp(_GradTopLeftCol, _GradTopRightCol, gradXLerpFactor), saturate(pow(tiledUvGrad.y, _GradBoostY))); + #endif + gradientResult = lerp(col, gradientResult, _GradBlend); + col.rgb = gradientResult.rgb * col.a; + col.a *= gradientResult.a; + #endif + //-------------------------------------------------------------------- + + //CONTRAST_ON + #if CONTRAST_ON + col.rgb = (col.rgb - float3(0.5, 0.5, 0.5)) * _Contrast + float3(0.5, 0.5, 0.5); + col.rgb += _Brightness; + #endif + + //------------------------------------------------------------------- + + //COLORSWAP_ON + #if COLORSWAP_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + half4 swapMask = SAMPLE_TEXTURE2D(_ColorSwapTex, sampler_ColorSwapTex, d.texcoord0.xy); + swapMask.rgb *= swapMask.a; + half3 redSwap = _ColorSwapRed * swapMask.r * saturate(luminance + _ColorSwapRedLuminosity); + half3 greenSwap = _ColorSwapGreen * swapMask.g * saturate(luminance + _ColorSwapGreenLuminosity); + half3 blueSwap = _ColorSwapBlue * swapMask.b * saturate(luminance + _ColorSwapBlueLuminosity); + swapMask.rgb = col.rgb * saturate(1 - swapMask.r - swapMask.g - swapMask.b); + col.rgb = lerp(col.rgb, swapMask.rgb + redSwap + greenSwap + blueSwap, _ColorSwapBlend); + #endif + //-------------------------------------------------------------------- + + //COLORRAMP_ON && !COLORRAMPOUTLINE_ON + #if COLORRAMP_ON && !COLORRAMPOUTLINE_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + luminance = saturate(luminance + _ColorRampLuminosity); + #if GRADIENTCOLORRAMP_ON + col.rgb = lerp(col.rgb, SAMPLE_TEXTURE2D(_ColorRampTexGradient, sampler_ColorRampTexGradient, half2(luminance, 0)).rgb, _ColorRampBlend); + #else + col.rgb = lerp(col.rgb, SAMPLE_TEXTURE2D(_ColorRampTex, sampler_ColorRampTex, half2(luminance, 0)).rgb, _ColorRampBlend); + #endif + #endif + //-------------------------------------------------------------------- + + //CHANGECOLOR_ON + #if CHANGECOLOR_ON + float3 currChangeColor = saturate(col.rgb); + luminance = 0.3 * currChangeColor.r + 0.59 * currChangeColor.g + 0.11 * currChangeColor.b; + luminance = saturate(luminance + _ColorChangeLuminosity); + half3 dif = abs(currChangeColor - _ColorChangeTarget.rgb); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _ColorChangeNewCol.rgb, + max(sign(1 - saturate(dif.x + dif.y + dif.z) - _ColorChangeTolerance), 0.0)); + #if CHANGECOLOR2_ON + dif = abs(currChangeColor - _ColorChangeTarget2.rgb); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _ColorChangeNewCol2.rgb, + max(sign(1 - saturate(dif.x + dif.y + dif.z) - _ColorChangeTolerance2), 0.0)); + #endif + #if CHANGECOLOR3_ON + dif = abs(currChangeColor - _ColorChangeTarget3.rgb); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _ColorChangeNewCol3.rgb, + max(sign(1 - saturate(dif.x + dif.y + dif.z) - _ColorChangeTolerance3), 0.0)); + #endif + #endif + //------------------------------------------------------- + + //POSTERIZE_ON && !POSTERIZEOUTLINE_ON + #if POSTERIZE_ON && !POSTERIZEOUTLINE_ON + col.rgb = pow(col.rgb, _PosterizeGamma) * _PosterizeNumColors; + col.rgb = floor(col.rgb) / _PosterizeNumColors; + col.rgb = pow(col.rgb, 1.0 / _PosterizeGamma); + #endif + //------------------------------------ + + //HSV_ON + #if HSV_ON + half3 resultHsv = half3(col.rgb); + half cosHsv = _HsvBright * _HsvSaturation * cos(_HsvShift * 3.14159265 / 180); + half sinHsv = _HsvBright * _HsvSaturation * sin(_HsvShift * 3.14159265 / 180); + resultHsv.x = (.299 * _HsvBright + .701 * cosHsv + .168 * sinHsv) * col.x + + (.587 * _HsvBright - .587 * cosHsv + .330 * sinHsv) * col.y + + (.114 * _HsvBright - .114 * cosHsv - .497 * sinHsv) * col.z; + resultHsv.y = (.299 * _HsvBright - .299 * cosHsv - .328 * sinHsv) *col.x + + (.587 * _HsvBright + .413 * cosHsv + .035 * sinHsv) * col.y + + (.114 * _HsvBright - .114 * cosHsv + .292 * sinHsv) * col.z; + resultHsv.z = (.299 * _HsvBright - .3 * cosHsv + 1.25 * sinHsv) * col.x + + (.587 * _HsvBright - .588 * cosHsv - 1.05 * sinHsv) * col.y + + (.114 * _HsvBright + .886 * cosHsv - .203 * sinHsv) * col.z; + col.rgb = resultHsv; + #endif + //------------------------------------------------------- + + //OVERLAY_ON + #if OVERLAY_ON + half2 overlayUvs = d.texcoord0.xy; + overlayUvs.x += ((_Time.y + randomSeed) * _OverlayTextureScrollXSpeed) % 1; + overlayUvs.y += ((_Time.y + randomSeed) * _OverlayTextureScrollYSpeed) % 1; + half4 overlayCol = SAMPLE_TEXTURE2D(_OverlayTex, sampler_OverlayTex, TRANSFORM_TEX(overlayUvs, _OverlayTex)); + overlayCol.rgb *= _OverlayColor.rgb * _OverlayGlow; + #if !OVERLAYMULT_ON + overlayCol.rgb *= overlayCol.a * _OverlayColor.rgb * _OverlayColor.a * _OverlayBlend; + col.rgb += overlayCol.rgb; + #else + overlayCol.a *= _OverlayColor.a; + col = lerp(col, col * overlayCol, _OverlayBlend); + #endif + #endif + + //--------------------------------- + + //OUTBASE_ON + #if OUTBASE_ON + #if OUTBASEPIXELPERF_ON + half2 destUv = half2(_OutlinePixelWidth * _MainTex_TexelSize.x, _OutlinePixelWidth * _MainTex_TexelSize.y); + #else + half2 destUv = half2(_OutlineWidth * _MainTex_TexelSize.x * 200, _OutlineWidth * _MainTex_TexelSize.y * 200); + #endif + + #if OUTDIST_ON + d.texcoord3.x += ((_Time.x + _RandomSeed) * _OutlineDistortTexXSpeed) % 1; + d.texcoord3.y += ((_Time.x + _RandomSeed) * _OutlineDistortTexYSpeed) % 1; + #if ATLAS_ON + d.texcoord3 = half2((d.texcoord3.x - _MinXUV) / (_MaxXUV - _MinXUV), (d.texcoord3.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half outDistortAmnt = (SAMPLE_TEXTURE2D(_OutlineDistortTex, sampler_OutlineDistortTex, d.texcoord3).r - 0.5) * 0.2 * _OutlineDistortAmount; + destUv.x += outDistortAmnt; + destUv.y += outDistortAmnt; + #endif + + half spriteLeft = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(destUv.x, 0)).a; + half spriteRight = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy - half2(destUv.x, 0)).a; + half spriteBottom = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(0, destUv.y)).a; + half spriteTop = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy - half2(0, destUv.y)).a; + half result = spriteLeft + spriteRight + spriteBottom + spriteTop; + + #if OUTBASE8DIR_ON + half spriteTopLeft = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(destUv.x, destUv.y)).a; + half spriteTopRight = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(-destUv.x, destUv.y)).a; + half spriteBotLeft = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(destUv.x, -destUv.y)).a; + half spriteBotRight = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(-destUv.x, -destUv.y)).a; + result = result + spriteTopLeft + spriteTopRight + spriteBotLeft + spriteBotRight; + #endif + + result = step(0.05, saturate(result)); + + #if OUTTEX_ON + d.texcoord1.x += ((_Time.x + _RandomSeed) * _OutlineTexXSpeed) % 1; + d.texcoord1.y += ((_Time.x + _RandomSeed) * _OutlineTexYSpeed) % 1; + #if ATLAS_ON + d.texcoord1 = half2((d.texcoord1.x - _MinXUV) / (_MaxXUV - _MinXUV), (d.texcoord1.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half4 tempOutColor = SAMPLE_TEXTURE2D(_OutlineTex, sampler_OutlineTex, d.texcoord1); + tempOutColor *= _OutlineColor; + _OutlineColor = tempOutColor; + #endif + + result *= (1 - originalAlpha) * _OutlineAlpha; + + half4 outline = _OutlineColor * d.vertexColor.a; + outline.rgb *= _OutlineGlow; + outline.a = result; + #if ONLYOUTLINE_ON + col = outline; + #else + col = lerp(col, outline, result); + #endif + #endif + //------------------------------------------------------- + + //FADE_ON + #if FADE_ON + half2 tiledUvFade1 = TRANSFORM_TEX(d.texcoord0, _FadeTex); + half2 tiledUvFade2 = TRANSFORM_TEX(d.texcoord0, _FadeBurnTex); + #if ATLAS_ON + tiledUvFade1 = half2((tiledUvFade1.x - _MinXUV) / (_MaxXUV - _MinXUV), (tiledUvFade1.y - _MinYUV) / (_MaxYUV - _MinYUV)); + tiledUvFade2 = half2((tiledUvFade2.x - _MinXUV) / (_MaxXUV - _MinXUV), (tiledUvFade2.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half fadeTemp = SAMPLE_TEXTURE2D(_FadeTex, sampler_FadeTex, tiledUvFade1).r; + half fade = smoothstep(_FadeAmount, _FadeAmount + _FadeBurnTransition, fadeTemp); + half fadeBurn = saturate(smoothstep(_FadeAmount - _FadeBurnWidth, _FadeAmount - _FadeBurnWidth + 0.1, fadeTemp) * _FadeAmount); + col.a *= fade; + _FadeBurnColor.rgb *= _FadeBurnGlow; + col += fadeBurn * SAMPLE_TEXTURE2D(_FadeBurnTex, sampler_FadeBurnTex, tiledUvFade2) * _FadeBurnColor * originalAlpha * (1 - col.a); + #endif + //------------------------------------------------------- + + //SHADOW_ON + #if SHADOW_ON + half shadowA = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(_ShadowX, _ShadowY)).a; + half preMultShadowMask = 1 - (saturate(shadowA - col.a) * (1 - col.a)); + col.rgb *= 1 - ((shadowA - col.a) * (1 - col.a)); + col.rgb += (_ShadowColor * shadowA) * (1 - col.a); + col.a = max(shadowA * _ShadowAlpha * d.vertexColor.a, col.a); + #endif + + //------------------------------------------------------- + + //GLOW_ON + #if GLOW_ON + half4 emission; + #if GLOWTEX_ON + emission = SAMPLE_TEXTURE2D(_GlowTex, sampler_GlowTex, d.texcoord0); + #else + emission = col; + #endif + + col.rgb *= _GlowGlobal; + emission.rgb *= emission.a * col.a * _Glow * _GlowColor; + col.rgb += emission.rgb; + #endif + //------------------------------------------------------- + + //COLORRAMP_ON && COLORRAMPOUTLINE_ON + #if COLORRAMP_ON && COLORRAMPOUTLINE_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + luminance = saturate(luminance + _ColorRampLuminosity); + #if GRADIENTCOLORRAMP_ON + col.rgb = lerp(col.rgb, SAMPLE_TEXTURE2D(_ColorRampTexGradient, sampler_ColorRampTexGradient, half2(luminance, 0)).rgb, _ColorRampBlend); + #else + col.rgb = lerp(col.rgb, SAMPLE_TEXTURE2D(_ColorRampTex, sampler_ColorRampTex, half2(luminance, 0)).rgb, _ColorRampBlend); + #endif + #endif + //--------------- + + //GREYSCALE_ON && GREYSCALEOUTLINE_ON + #if GREYSCALE_ON && GREYSCALEOUTLINE_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + luminance = saturate(luminance + _GreyscaleLuminosity); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _GreyscaleTintColor, _GreyscaleBlend); + #endif + + //----------------------------------- + + //POSTERIZE_ON && POSTERIZEOUTLINE_ON + #if POSTERIZE_ON && POSTERIZEOUTLINE_ON + col.rgb = pow(col.rgb, _PosterizeGamma) * _PosterizeNumColors; + col.rgb = floor(col.rgb) / _PosterizeNumColors; + col.rgb = pow(col.rgb, 1.0 / _PosterizeGamma); + #endif + + //----------------------------------- + + //SHINE_ON + #if SHINE_ON + half2 uvShine = uvRect; + half cosAngle = cos(_ShineRotate); + half sinAngle = sin(_ShineRotate); + half2x2 rot = half2x2(cosAngle, -sinAngle, sinAngle, cosAngle); + uvShine -= half2(0.5, 0.5); + uvShine = mul(rot, uvShine); + uvShine += half2(0.5, 0.5); + half shineMask = SAMPLE_TEXTURE2D(_ShineMask, sampler_ShineMask, d.texcoord0.xy).a; + half currentDistanceProjection = (uvShine.x + uvShine.y) / 2; + half whitePower = 1 - (abs(currentDistanceProjection - _ShineLocation) / _ShineWidth); + col.rgb += col.a * whitePower * _ShineGlow * max(sign(currentDistanceProjection - (_ShineLocation - _ShineWidth)), 0.0) + * max(sign((_ShineLocation + _ShineWidth) - currentDistanceProjection), 0.0) * _ShineColor * shineMask; + #endif + + //----------------------------------- + + //HOLOGRAM_ON + #if HOLOGRAM_ON + half totalHologram = _HologramStripesAmount + _HologramUnmodAmount; + half hologramYCoord = ((uvRect.y + (((_Time.x + randomSeed) % 1) * _HologramStripesSpeed)) % totalHologram) / totalHologram; + hologramYCoord = abs(hologramYCoord); + half alpha = RemapFloat(saturate(hologramYCoord - (_HologramUnmodAmount/totalHologram)), 0.0, 1.0, _HologramMinAlpha, saturate(_HologramMaxAlpha)); + half hologramMask = max(sign((_HologramUnmodAmount/totalHologram) - hologramYCoord), 0.0); + half4 hologramResult = col; + hologramResult.a *= lerp(alpha, 1, hologramMask); + hologramResult.rgb *= max(1, _HologramMaxAlpha * max(sign(hologramYCoord - (_HologramUnmodAmount/totalHologram)), 0.0)); + hologramMask = 1 - step(0.01,hologramMask); + hologramResult.rgb += hologramMask * _HologramStripeColor * col.a; + col = lerp(col, hologramResult, _HologramBlend); + #endif + + //----------------------------------- + + //FLICKER_ON + #if FLICKER_ON + col.a *= saturate(col.a * step(frac(0.05 + (_Time.w + randomSeed) * _FlickerFreq), 1 - _FlickerPercent) + _FlickerAlpha); + #endif + //----------------------------------- + + //ALPHACUTOFF_ON + + //ALPHAROUND_ON + + //ALPHAOUTLINE_ON + #if ALPHAOUTLINE_ON + half alphaOutlineRes = pow(1 - col.a, max(_AlphaOutlinePower, 0.0001)) * step(_AlphaOutlineMinAlpha, col.a) * _AlphaOutlineBlend; + col.rgb = lerp(col.rgb, _AlphaOutlineColor.rgb * _AlphaOutlineGlow, alphaOutlineRes); + col.a = lerp(col.a, 1, alphaOutlineRes > 1); + #endif + //------------------------------------------------------- + + //FOG_ON + + //------------------ + + col *= _Color; + o.Albedo = col; + col.a *= _Alpha; + clip(col.a - _AlphaCutoffValue - 0.01); + o.Alpha = _Color.a; + } + + + + + + void ChainSurfaceFunction(inout Surface l, inout ShaderData d) + { + Ext_SurfaceFunction0(l, d); + // Ext_SurfaceFunction1(l, d); + // Ext_SurfaceFunction2(l, d); + // Ext_SurfaceFunction3(l, d); + // Ext_SurfaceFunction4(l, d); + // Ext_SurfaceFunction5(l, d); + // Ext_SurfaceFunction6(l, d); + // Ext_SurfaceFunction7(l, d); + // Ext_SurfaceFunction8(l, d); + // Ext_SurfaceFunction9(l, d); + // Ext_SurfaceFunction10(l, d); + // Ext_SurfaceFunction11(l, d); + // Ext_SurfaceFunction12(l, d); + // Ext_SurfaceFunction13(l, d); + // Ext_SurfaceFunction14(l, d); + // Ext_SurfaceFunction15(l, d); + // Ext_SurfaceFunction16(l, d); + // Ext_SurfaceFunction17(l, d); + // Ext_SurfaceFunction18(l, d); + // Ext_SurfaceFunction19(l, d); + // Ext_SurfaceFunction20(l, d); + // Ext_SurfaceFunction21(l, d); + // Ext_SurfaceFunction22(l, d); + // Ext_SurfaceFunction23(l, d); + // Ext_SurfaceFunction24(l, d); + // Ext_SurfaceFunction25(l, d); + // Ext_SurfaceFunction26(l, d); + // Ext_SurfaceFunction27(l, d); + // Ext_SurfaceFunction28(l, d); + // Ext_SurfaceFunction29(l, d); + } + +#if !_DECALSHADER + + void ChainModifyVertex(inout VertexData v, inout VertexToPixel v2p, float4 time) + { + ExtraV2F d; + + ZERO_INITIALIZE(ExtraV2F, d); + ZERO_INITIALIZE(Blackboard, d.blackboard); + // due to motion vectors in HDRP, we need to use the last + // time in certain spots. So if you are going to use _Time to adjust vertices, + // you need to use this time or motion vectors will break. + d.time = time; + + Ext_ModifyVertex0(v, d); + // Ext_ModifyVertex1(v, d); + // Ext_ModifyVertex2(v, d); + // Ext_ModifyVertex3(v, d); + // Ext_ModifyVertex4(v, d); + // Ext_ModifyVertex5(v, d); + // Ext_ModifyVertex6(v, d); + // Ext_ModifyVertex7(v, d); + // Ext_ModifyVertex8(v, d); + // Ext_ModifyVertex9(v, d); + // Ext_ModifyVertex10(v, d); + // Ext_ModifyVertex11(v, d); + // Ext_ModifyVertex12(v, d); + // Ext_ModifyVertex13(v, d); + // Ext_ModifyVertex14(v, d); + // Ext_ModifyVertex15(v, d); + // Ext_ModifyVertex16(v, d); + // Ext_ModifyVertex17(v, d); + // Ext_ModifyVertex18(v, d); + // Ext_ModifyVertex19(v, d); + // Ext_ModifyVertex20(v, d); + // Ext_ModifyVertex21(v, d); + // Ext_ModifyVertex22(v, d); + // Ext_ModifyVertex23(v, d); + // Ext_ModifyVertex24(v, d); + // Ext_ModifyVertex25(v, d); + // Ext_ModifyVertex26(v, d); + // Ext_ModifyVertex27(v, d); + // Ext_ModifyVertex28(v, d); + // Ext_ModifyVertex29(v, d); + + + // #if %EXTRAV2F0REQUIREKEY% + // v2p.extraV2F0 = d.extraV2F0; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // v2p.extraV2F1 = d.extraV2F1; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // v2p.extraV2F2 = d.extraV2F2; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // v2p.extraV2F3 = d.extraV2F3; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // v2p.extraV2F4 = d.extraV2F4; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // v2p.extraV2F5 = d.extraV2F5; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // v2p.extraV2F6 = d.extraV2F6; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // v2p.extraV2F7 = d.extraV2F7; + // #endif + } + + void ChainModifyTessellatedVertex(inout VertexData v, inout VertexToPixel v2p) + { + ExtraV2F d; + ZERO_INITIALIZE(ExtraV2F, d); + ZERO_INITIALIZE(Blackboard, d.blackboard); + + // #if %EXTRAV2F0REQUIREKEY% + // d.extraV2F0 = v2p.extraV2F0; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // d.extraV2F1 = v2p.extraV2F1; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // d.extraV2F2 = v2p.extraV2F2; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // d.extraV2F3 = v2p.extraV2F3; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // d.extraV2F4 = v2p.extraV2F4; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // d.extraV2F5 = v2p.extraV2F5; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // d.extraV2F6 = v2p.extraV2F6; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // d.extraV2F7 = v2p.extraV2F7; + // #endif + + + // Ext_ModifyTessellatedVertex0(v, d); + // Ext_ModifyTessellatedVertex1(v, d); + // Ext_ModifyTessellatedVertex2(v, d); + // Ext_ModifyTessellatedVertex3(v, d); + // Ext_ModifyTessellatedVertex4(v, d); + // Ext_ModifyTessellatedVertex5(v, d); + // Ext_ModifyTessellatedVertex6(v, d); + // Ext_ModifyTessellatedVertex7(v, d); + // Ext_ModifyTessellatedVertex8(v, d); + // Ext_ModifyTessellatedVertex9(v, d); + // Ext_ModifyTessellatedVertex10(v, d); + // Ext_ModifyTessellatedVertex11(v, d); + // Ext_ModifyTessellatedVertex12(v, d); + // Ext_ModifyTessellatedVertex13(v, d); + // Ext_ModifyTessellatedVertex14(v, d); + // Ext_ModifyTessellatedVertex15(v, d); + // Ext_ModifyTessellatedVertex16(v, d); + // Ext_ModifyTessellatedVertex17(v, d); + // Ext_ModifyTessellatedVertex18(v, d); + // Ext_ModifyTessellatedVertex19(v, d); + // Ext_ModifyTessellatedVertex20(v, d); + // Ext_ModifyTessellatedVertex21(v, d); + // Ext_ModifyTessellatedVertex22(v, d); + // Ext_ModifyTessellatedVertex23(v, d); + // Ext_ModifyTessellatedVertex24(v, d); + // Ext_ModifyTessellatedVertex25(v, d); + // Ext_ModifyTessellatedVertex26(v, d); + // Ext_ModifyTessellatedVertex27(v, d); + // Ext_ModifyTessellatedVertex28(v, d); + // Ext_ModifyTessellatedVertex29(v, d); + + // #if %EXTRAV2F0REQUIREKEY% + // v2p.extraV2F0 = d.extraV2F0; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // v2p.extraV2F1 = d.extraV2F1; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // v2p.extraV2F2 = d.extraV2F2; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // v2p.extraV2F3 = d.extraV2F3; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // v2p.extraV2F4 = d.extraV2F4; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // v2p.extraV2F5 = d.extraV2F5; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // v2p.extraV2F6 = d.extraV2F6; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // v2p.extraV2F7 = d.extraV2F7; + // #endif + } + + void ChainFinalColorForward(inout Surface l, inout ShaderData d, inout half4 color) + { + // Ext_FinalColorForward0(l, d, color); + // Ext_FinalColorForward1(l, d, color); + // Ext_FinalColorForward2(l, d, color); + // Ext_FinalColorForward3(l, d, color); + // Ext_FinalColorForward4(l, d, color); + // Ext_FinalColorForward5(l, d, color); + // Ext_FinalColorForward6(l, d, color); + // Ext_FinalColorForward7(l, d, color); + // Ext_FinalColorForward8(l, d, color); + // Ext_FinalColorForward9(l, d, color); + // Ext_FinalColorForward10(l, d, color); + // Ext_FinalColorForward11(l, d, color); + // Ext_FinalColorForward12(l, d, color); + // Ext_FinalColorForward13(l, d, color); + // Ext_FinalColorForward14(l, d, color); + // Ext_FinalColorForward15(l, d, color); + // Ext_FinalColorForward16(l, d, color); + // Ext_FinalColorForward17(l, d, color); + // Ext_FinalColorForward18(l, d, color); + // Ext_FinalColorForward19(l, d, color); + // Ext_FinalColorForward20(l, d, color); + // Ext_FinalColorForward21(l, d, color); + // Ext_FinalColorForward22(l, d, color); + // Ext_FinalColorForward23(l, d, color); + // Ext_FinalColorForward24(l, d, color); + // Ext_FinalColorForward25(l, d, color); + // Ext_FinalColorForward26(l, d, color); + // Ext_FinalColorForward27(l, d, color); + // Ext_FinalColorForward28(l, d, color); + // Ext_FinalColorForward29(l, d, color); + } + + void ChainFinalGBufferStandard(inout Surface s, inout ShaderData d, inout half4 GBuffer0, inout half4 GBuffer1, inout half4 GBuffer2, inout half4 outEmission, inout half4 outShadowMask) + { + // Ext_FinalGBufferStandard0(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard1(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard2(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard3(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard4(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard5(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard6(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard7(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard8(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard9(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard10(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard11(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard12(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard13(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard14(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard15(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard16(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard17(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard18(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard19(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard20(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard21(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard22(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard23(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard24(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard25(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard26(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard27(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard28(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard29(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + } +#endif + + + + + +#if _DECALSHADER + + ShaderData CreateShaderData(SurfaceDescriptionInputs IN) + { + ShaderData d = (ShaderData)0; + d.TBNMatrix = float3x3(IN.WorldSpaceTangent, IN.WorldSpaceBiTangent, IN.WorldSpaceNormal); + d.worldSpaceNormal = IN.WorldSpaceNormal; + d.worldSpaceTangent = IN.WorldSpaceTangent; + + d.worldSpacePosition = IN.WorldSpacePosition; + d.texcoord0 = IN.uv0.xyxy; + d.screenPos = IN.ScreenPosition; + + d.worldSpaceViewDir = normalize(_WorldSpaceCameraPos - d.worldSpacePosition); + + d.tangentSpaceViewDir = mul(d.TBNMatrix, d.worldSpaceViewDir); + + // these rarely get used, so we back transform them. Usually will be stripped. + #if _HDRP + // d.localSpacePosition = mul(GetWorldToObjectMatrix(), float4(GetCameraRelativePositionWS(d.worldSpacePosition), 1)).xyz; + #else + // d.localSpacePosition = mul(GetWorldToObjectMatrix(), float4(d.worldSpacePosition, 1)).xyz; + #endif + // d.localSpaceNormal = normalize(mul((float3x3)GetWorldToObjectMatrix(), d.worldSpaceNormal)); + // d.localSpaceTangent = normalize(mul((float3x3)GetWorldToObjectMatrix(), d.worldSpaceTangent.xyz)); + + // #if %SCREENPOSREQUIREKEY% + // d.screenUV = (IN.ScreenPosition.xy / max(0.01, IN.ScreenPosition.w)); + // #endif + + return d; + } +#else + + ShaderData CreateShaderData(VertexToPixel i + #if NEED_FACING + , bool facing + #endif + ) + { + ShaderData d = (ShaderData)0; + d.clipPos = i.pos; + d.worldSpacePosition = i.worldPos; + + d.worldSpaceNormal = normalize(i.worldNormal); + d.worldSpaceTangent.xyz = normalize(i.worldTangent.xyz); + + d.tangentSign = i.worldTangent.w * unity_WorldTransformParams.w; + float3 bitangent = cross(d.worldSpaceTangent.xyz, d.worldSpaceNormal) * d.tangentSign; + + d.TBNMatrix = float3x3(d.worldSpaceTangent, -bitangent, d.worldSpaceNormal); + d.worldSpaceViewDir = normalize(_WorldSpaceCameraPos - i.worldPos); + + d.tangentSpaceViewDir = mul(d.TBNMatrix, d.worldSpaceViewDir); + d.texcoord0 = i.texcoord0; + d.texcoord1 = i.texcoord1; + d.texcoord2 = i.texcoord2; + + // #if %TEXCOORD3REQUIREKEY% + d.texcoord3 = i.texcoord3; + // #endif + + // d.isFrontFace = facing; + // #if %VERTEXCOLORREQUIREKEY% + d.vertexColor = i.vertexColor; + // #endif + + // these rarely get used, so we back transform them. Usually will be stripped. + #if _HDRP + // d.localSpacePosition = mul(GetWorldToObjectMatrix(), float4(GetCameraRelativePositionWS(i.worldPos), 1)).xyz; + #else + // d.localSpacePosition = mul(GetWorldToObjectMatrix(), float4(i.worldPos, 1)).xyz; + #endif + // d.localSpaceNormal = normalize(mul((float3x3)GetWorldToObjectMatrix(), i.worldNormal)); + // d.localSpaceTangent = normalize(mul((float3x3)GetWorldToObjectMatrix(), i.worldTangent.xyz)); + + // #if %SCREENPOSREQUIREKEY% + // d.screenPos = i.screenPos; + // d.screenUV = (i.screenPos.xy / i.screenPos.w); + // #endif + + + // #if %EXTRAV2F0REQUIREKEY% + // d.extraV2F0 = i.extraV2F0; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // d.extraV2F1 = i.extraV2F1; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // d.extraV2F2 = i.extraV2F2; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // d.extraV2F3 = i.extraV2F3; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // d.extraV2F4 = i.extraV2F4; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // d.extraV2F5 = i.extraV2F5; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // d.extraV2F6 = i.extraV2F6; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // d.extraV2F7 = i.extraV2F7; + // #endif + + return d; + } + +#endif + + + #if defined(_PASSSHADOW) + float3 _LightDirection; + float3 _LightPosition; + #endif + + #if (_PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR))) + + #define GetWorldToViewMatrix() _ViewMatrix + #define UNITY_MATRIX_I_V _InvViewMatrix + #define GetViewToHClipMatrix() OptimizeProjectionMatrix(_ProjMatrix) + #define UNITY_MATRIX_I_P _InvProjMatrix + #define GetWorldToHClipMatrix() _ViewProjMatrix + #define UNITY_MATRIX_I_VP _InvViewProjMatrix + #define UNITY_MATRIX_UNJITTERED_VP _NonJitteredViewProjMatrix + #define UNITY_MATRIX_PREV_VP _PrevViewProjMatrix + #define UNITY_MATRIX_PREV_I_VP _PrevInvViewProjMatrix + + void MotionVectorPositionZBias(VertexToPixel input) + { + #if UNITY_REVERSED_Z + input.pos.z -= unity_MotionVectorsParams.z * input.pos.w; + #else + input.pos.z += unity_MotionVectorsParams.z * input.pos.w; + #endif + } + + #endif + + // vertex shader + VertexToPixel Vert (VertexData v) + { + VertexToPixel o = (VertexToPixel)0; + + UNITY_SETUP_INSTANCE_ID(v); + UNITY_TRANSFER_INSTANCE_ID(v, o); + UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o); + + + #if _URP && (_PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR))) + VertexData previousMesh = v; + #endif + #if !_TESSELLATION_ON + ChainModifyVertex(v, o, _Time); + #endif + + o.texcoord0 = v.texcoord0; + o.texcoord1 = v.texcoord1; + o.texcoord2 = v.texcoord2; + + // #if %TEXCOORD3REQUIREKEY% + o.texcoord3 = v.texcoord3; + // #endif + + // #if %VERTEXCOLORREQUIREKEY% + o.vertexColor = v.vertexColor; + // #endif + + // This return the camera relative position (if enable) + float3 positionWS = TransformObjectToWorld(v.vertex.xyz); + float3 normalWS = TransformObjectToWorldNormal(v.normal); + float4 tangentWS = float4(TransformObjectToWorldDir(v.tangent.xyz), v.tangent.w); + + VertexPositionInputs vertexInput = GetVertexPositionInputs(v.vertex.xyz); + o.worldPos = positionWS; + o.worldNormal = normalWS; + o.worldTangent = tangentWS; + + + // For some very odd reason, in 2021.2, we can't use Unity's defines, but have to use our own.. + #if _PASSSHADOW + #if _CASTING_PUNCTUAL_LIGHT_SHADOW + float3 lightDirectionWS = normalize(_LightPosition - o.worldPos); + #else + float3 lightDirectionWS = _LightDirection; + #endif + // Define shadow pass specific clip position for Universal + o.pos = TransformWorldToHClip(ApplyShadowBias(o.worldPos, o.worldNormal, lightDirectionWS)); + #if UNITY_REVERSED_Z + o.pos.z = min(o.pos.z, UNITY_NEAR_CLIP_VALUE); + #else + o.pos.z = max(o.pos.z, UNITY_NEAR_CLIP_VALUE); + #endif + #elif _PASSMETA + o.pos = MetaVertexPosition(float4(v.vertex.xyz, 0), v.texcoord1.xy, v.texcoord2.xy, unity_LightmapST, unity_DynamicLightmapST); + #else + o.pos = TransformWorldToHClip(o.worldPos); + #endif + + // #if %SCREENPOSREQUIREKEY% + // o.screenPos = ComputeScreenPos(o.pos, _ProjectionParams.x); + // #endif + + + #if _PASSFORWARD || _PASSGBUFFER + float2 uv1 = v.texcoord1.xy; + OUTPUT_LIGHTMAP_UV(uv1, unity_LightmapST, o.lightmapUV); + o.texcoord1.xy = uv1; + #if UNITY_VERSION < 60000009 + OUTPUT_SH(o.worldNormal, o.sh); + #endif + + #if defined(DYNAMICLIGHTMAP_ON) + o.dynamicLightmapUV.xy = v.texcoord2.xy * unity_DynamicLightmapST.xy + unity_DynamicLightmapST.zw; + #if UNITY_VERSION >= 60000009 + OUTPUT_SH(o.worldNormal, o.sh); + #endif + #elif (defined(PROBE_VOLUMES_L1) || defined(PROBE_VOLUMES_L2)) && UNITY_VERSION >= 60000009 + OUTPUT_SH4(vertexInput.positionWS, o.worldNormal.xyz, GetWorldSpaceNormalizeViewDir(vertexInput.positionWS), o.sh, o.probeOcclusion); + #endif + #endif + + #ifdef VARYINGS_NEED_FOG_AND_VERTEX_LIGHT + half fogFactor = 0; + #if defined(_FOG_FRAGMENT) + fogFactor = ComputeFogFactor(o.pos.z); + #endif + #if _BAKEDLIT + o.fogFactorAndVertexLight = half4(fogFactor, 0, 0, 0); + #else + half3 vertexLight = VertexLighting(o.worldPos, o.worldNormal); + o.fogFactorAndVertexLight = half4(fogFactor, vertexLight); + #endif + #endif + + #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR) + o.shadowCoord = GetShadowCoord(vertexInput); + #endif + + #if _URP && (_PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR))) + #if !defined(TESSELLATION_ON) + MotionVectorPositionZBias(o); + #endif + + o.previousPositionCS = float4(0.0, 0.0, 0.0, 1.0); + // Note: unity_MotionVectorsParams.y is 0 is forceNoMotion is enabled + bool forceNoMotion = unity_MotionVectorsParams.y == 0.0; + + if (!forceNoMotion) + { + #if defined(HAVE_VFX_MODIFICATION) + float3 previousPositionOS = currentFrameMvData.vfxParticlePositionOS; + #if defined(VFX_FEATURE_MOTION_VECTORS_VERTS) + const bool applyDeformation = false; + #else + const bool applyDeformation = true; + #endif + #else + const bool hasDeformation = unity_MotionVectorsParams.x == 1; // Mesh has skinned deformation + float3 previousPositionOS = hasDeformation ? previousMesh.previousPositionOS : previousMesh.vertex.xyz; + + #if defined(AUTOMATIC_TIME_BASED_MOTION_VECTORS) && defined(GRAPH_VERTEX_USES_TIME_PARAMETERS_INPUT) + const bool applyDeformation = true; + #else + const bool applyDeformation = hasDeformation; + #endif + #endif + // TODO + #if defined(FEATURES_GRAPH_VERTEX) + if (applyDeformation) + previousPositionOS = GetLastFrameDeformedPosition(previousMesh, currentFrameMvData, previousPositionOS); + else + previousPositionOS = previousMesh.positionOS; + + #if defined(FEATURES_GRAPH_VERTEX_MOTION_VECTOR_OUTPUT) + previousPositionOS -= previousMesh.precomputedVelocity; + #endif + #endif + + #if defined(UNITY_DOTS_INSTANCING_ENABLED) && defined(DOTS_DEFORMED) + // Deformed vertices in DOTS are not cumulative with built-in Unity skinning/blend shapes + // Needs to be called after vertex modification has been applied otherwise it will be + // overwritten by Compute Deform node + ApplyPreviousFrameDeformedVertexPosition(previousMesh.vertexID, previousPositionOS); + #endif + #if defined (_ADD_PRECOMPUTED_VELOCITY) + previousPositionOS -= previousMesh.precomputedVelocity; + #endif + o.positionCS = mul(UNITY_MATRIX_UNJITTERED_VP, float4(positionWS, 1.0f)); + + #if defined(HAVE_VFX_MODIFICATION) + #if defined(VFX_FEATURE_MOTION_VECTORS_VERTS) + #if defined(FEATURES_GRAPH_VERTEX_MOTION_VECTOR_OUTPUT) || defined(_ADD_PRECOMPUTED_VELOCITY) + #error Unexpected fast path rendering VFX motion vector while there are vertex modification afterwards. + #endif + o.previousPositionCS = VFXGetPreviousClipPosition(previousMesh, currentFrameMvData.vfxElementAttributes, o.positionCS); + #else + #if VFX_WORLD_SPACE + //previousPositionOS is already in world space + const float3 previousPositionWS = previousPositionOS; + #else + const float3 previousPositionWS = mul(UNITY_PREV_MATRIX_M, float4(previousPositionOS, 1.0f)).xyz; + #endif + o.previousPositionCS = mul(UNITY_MATRIX_PREV_VP, float4(previousPositionWS, 1.0f)); + #endif + #else + o.previousPositionCS = mul(UNITY_MATRIX_PREV_VP, mul(UNITY_PREV_MATRIX_M, float4(previousPositionOS, 1))); + #endif + } + #endif + + return o; + } + + + + + // fragment shader + void Frag (VertexToPixel IN + , out half4 outNormalWS : SV_Target0 + #ifdef _WRITE_RENDERING_LAYERS + , out float4 outRenderingLayers : SV_Target1 + #endif + #ifdef _DEPTHOFFSET_ON + , out float outputDepth : SV_Depth + #endif + #if NEED_FACING + , bool facing : SV_IsFrontFace + #endif + ) + { + UNITY_SETUP_INSTANCE_ID(IN); + UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX(IN); + + #if defined(LOD_FADE_CROSSFADE) + LODFadeCrossFade(IN.pos); + #endif + + ShaderData d = CreateShaderData(IN + #if NEED_FACING + , facing + #endif + ); + Surface l = (Surface)0; + + #ifdef _DEPTHOFFSET_ON + l.outputDepth = outputDepth; + #endif + + l.Albedo = half3(0.5, 0.5, 0.5); + l.Normal = float3(0,0,1); + l.Occlusion = 1; + l.Alpha = 1; + + ChainSurfaceFunction(l, d); + + #ifdef _DEPTHOFFSET_ON + outputDepth = l.outputDepth; + #endif + + #if defined(_GBUFFER_NORMALS_OCT) + float3 normalWS = d.worldSpaceNormal; + float2 octNormalWS = PackNormalOctQuadEncode(normalWS); // values between [-1, +1], must use fp32 on some platforms + float2 remappedOctNormalWS = saturate(octNormalWS * 0.5 + 0.5); // values between [ 0, 1] + half3 packedNormalWS = PackFloat2To888(remappedOctNormalWS); // values between [ 0, 1] + outNormalWS = half4(packedNormalWS, 0.0); + #else + float3 wsn = l.Normal; + #if !_WORLDSPACENORMAL + wsn = TangentToWorldSpace(d, l.Normal); + #endif + outNormalWS = half4(NormalizeNormalPerPixel(wsn), 0.0); + #endif + + #ifdef _WRITE_RENDERING_LAYERS + uint renderingLayers = GetMeshRenderingLayer(); + outRenderingLayers = float4(EncodeMeshRenderingLayer(renderingLayers), 0, 0, 0); + #endif + + + } + + ENDHLSL + + } + + + + Pass + { + Name "MotionVectors" + Tags + { + "LightMode" = "MotionVectors" + } + + // Render State + Cull Back + ZTest LEqual + ZWrite On + ColorMask RG + + Tags { "RenderType" = "Opaque" "Queue" = "Geometry" "PreviewType" = "Plane" } + Cull [_CullingOption] + ZWrite [_ZWrite] + ZTest [_ZTestMode] + + + HLSLPROGRAM + + #pragma vertex Vert + #pragma fragment Frag + + #define _PASSMOTIONVECTOR 1 + + #pragma target 3.5 + #pragma multi_compile_instancing + #pragma vertex vert + #pragma fragment frag + + #define SHADERPASS SHADERPASS_MOTION_VECTORS + #define RAYTRACING_SHADER_GRAPH_DEFAULT + #define VARYINGS_NEED_PASS + #define _PASSMOTIONVECTOR 1 + + + #pragma shader_feature_local GLOW_ON + #pragma shader_feature_local FADE_ON + #pragma shader_feature_local OUTBASE_ON + #pragma shader_feature_local ONLYOUTLINE_ON + #pragma shader_feature_local GRADIENT_ON + #pragma shader_feature_local GRADIENT2COL_ON + #pragma shader_feature_local RADIALGRADIENT_ON + #pragma shader_feature_local COLORSWAP_ON + #pragma shader_feature_local HSV_ON + #pragma shader_feature_local CHANGECOLOR_ON + #pragma shader_feature_local CHANGECOLOR2_ON + #pragma shader_feature_local CHANGECOLOR3_ON + #pragma shader_feature_local COLORRAMP_ON + #pragma shader_feature_local GRADIENTCOLORRAMP_ON + #pragma shader_feature_local HITEFFECT_ON + #pragma shader_feature_local NEGATIVE_ON + #pragma shader_feature_local PIXELATE_ON + #pragma shader_feature_local GREYSCALE_ON + #pragma shader_feature_local POSTERIZE_ON + #pragma shader_feature_local BLUR_ON + #pragma shader_feature_local MOTIONBLUR_ON + #pragma shader_feature_local GHOST_ON + #pragma shader_feature_local ALPHAOUTLINE_ON + #pragma shader_feature_local INNEROUTLINE_ON + #pragma shader_feature_local ONLYINNEROUTLINE_ON + #pragma shader_feature_local HOLOGRAM_ON + #pragma shader_feature_local CHROMABERR_ON + #pragma shader_feature_local GLITCH_ON + #pragma shader_feature_local FLICKER_ON + #pragma shader_feature_local SHADOW_ON + #pragma shader_feature_local SHINE_ON + #pragma shader_feature_local CONTRAST_ON + #pragma shader_feature_local OVERLAY_ON + #pragma shader_feature_local OVERLAYMULT_ON + #pragma shader_feature_local DOODLE_ON + #pragma shader_feature_local WIND_ON + #pragma shader_feature_local WAVEUV_ON + #pragma shader_feature_local ROUNDWAVEUV_ON + #pragma shader_feature_local RECTSIZE_ON + #pragma shader_feature_local OFFSETUV_ON + #pragma shader_feature_local CLIPPING_ON + #pragma shader_feature_local RADIALCLIPPING_ON + #pragma shader_feature_local TEXTURESCROLL_ON + #pragma shader_feature_local ZOOMUV_ON + #pragma shader_feature_local DISTORT_ON + #pragma shader_feature_local WARP_ON + #pragma shader_feature_local TWISTUV_ON + #pragma shader_feature_local ROTATEUV_ON + #pragma shader_feature_local POLARUV_ON + #pragma shader_feature_local FISHEYE_ON + #pragma shader_feature_local PINCH_ON + #pragma shader_feature_local SHAKEUV_ON + + #pragma shader_feature_local GLOWTEX_ON + #pragma shader_feature_local OUTTEX_ON + #pragma shader_feature_local OUTDIST_ON + #pragma shader_feature_local OUTBASE8DIR_ON + #pragma shader_feature_local OUTBASEPIXELPERF_ON + #pragma shader_feature_local COLORRAMPOUTLINE_ON + #pragma shader_feature_local GREYSCALEOUTLINE_ON + #pragma shader_feature_local POSTERIZEOUTLINE_ON + #pragma shader_feature_local BLURISHD_ON + #pragma shader_feature_local MANUALWIND_ON + #pragma shader_feature_local ATLAS_ON + #pragma shader_feature_local PREMULTIPLYALPHA_ON + + #pragma shader_feature BILBOARD_ON + #pragma shader_feature BILBOARDY_ON + + #pragma shader_feature NORMALMAP_ON + + + #define _URP 1 +#define _USINGTEXCOORD1 1 +#define _USINGTEXCOORD2 1 + + + #include_with_pragmas "Packages/com.unity.render-pipelines.universal/ShaderLibrary/DOTS.hlsl" + #include_with_pragmas "Packages/com.unity.render-pipelines.universal/ShaderLibrary/RenderingLayers.hlsl" + #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.universal/ShaderLibrary/Input.hlsl" + #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/TextureStack.hlsl" + #include_with_pragmas "Packages/com.unity.render-pipelines.core/ShaderLibrary/FoveatedRenderingKeywords.hlsl" + #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/DebugMipmapStreamingMacros.hlsl" + #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/ShaderGraphFunctions.hlsl" + #include "Packages/com.unity.render-pipelines.universal/Editor/ShaderGraph/Includes/ShaderPass.hlsl" + + #undef WorldNormalVector + #define WorldNormalVector(data, normal) mul(normal, data.TBNMatrix) + + #define UnityObjectToWorldNormal(normal) mul(GetObjectToWorldMatrix(), normal) + + #define _WorldSpaceLightPos0 _MainLightPosition + + #define UNITY_DECLARE_TEX2D(name) TEXTURE2D(name); SAMPLER(sampler##name); + #define UNITY_DECLARE_TEX2D_NOSAMPLER(name) TEXTURE2D(name); + #define UNITY_DECLARE_TEX2DARRAY(name) TEXTURE2D_ARRAY(name); SAMPLER(sampler##name); + #define UNITY_DECLARE_TEX2DARRAY_NOSAMPLER(name) TEXTURE2D_ARRAY(name); + + #define UNITY_SAMPLE_TEX2DARRAY(tex,coord) SAMPLE_TEXTURE2D_ARRAY(tex, sampler##tex, coord.xy, coord.z) + #define UNITY_SAMPLE_TEX2DARRAY_LOD(tex,coord,lod) SAMPLE_TEXTURE2D_ARRAY_LOD(tex, sampler##tex, coord.xy, coord.z, lod) + #define UNITY_SAMPLE_TEX2D(tex, coord) SAMPLE_TEXTURE2D(tex, sampler##tex, coord) + #define UNITY_SAMPLE_TEX2D_SAMPLER(tex, samp, coord) SAMPLE_TEXTURE2D(tex, sampler##samp, coord) + + #define UNITY_SAMPLE_TEX2D_LOD(tex,coord, lod) SAMPLE_TEXTURE2D_LOD(tex, sampler_##tex, coord, lod) + #define UNITY_SAMPLE_TEX2D_SAMPLER_LOD(tex,samplertex,coord, lod) SAMPLE_TEXTURE2D_LOD (tex, sampler##samplertex,coord, lod) + + #if defined(UNITY_COMPILER_HLSL) + #define UNITY_INITIALIZE_OUTPUT(type,name) name = (type)0; + #else + #define UNITY_INITIALIZE_OUTPUT(type,name) + #endif + + #define sampler2D_float sampler2D + #define sampler2D_half sampler2D + + + + // data across stages, stripped like the above. + struct VertexToPixel + { + float4 pos : SV_POSITION; + float3 worldPos : TEXCOORD0; + float3 worldNormal : TEXCOORD1; + float4 worldTangent : TEXCOORD2; + float4 texcoord0 : TEXCOORD3; + float4 texcoord1 : TEXCOORD4; + float4 texcoord2 : TEXCOORD5; + + // #if %TEXCOORD3REQUIREKEY% + float4 texcoord3 : TEXCOORD6; + // #endif + + // #if %SCREENPOSREQUIREKEY% + // float4 screenPos : TEXCOORD7; + // #endif + + // #if %VERTEXCOLORREQUIREKEY% + half4 vertexColor : COLOR; + // #endif + + #if defined(LIGHTMAP_ON) + float2 lightmapUV : TEXCOORD8; + #endif + #if defined(DYNAMICLIGHTMAP_ON) + float2 dynamicLightmapUV : TEXCOORD9; + #endif + #if !defined(LIGHTMAP_ON) + float4 probeOcclusion : TEXCOORD8; + float3 sh : TEXCOORD10; + #endif + + #if defined(VARYINGS_NEED_FOG_AND_VERTEX_LIGHT) + float4 fogFactorAndVertexLight : TEXCOORD11; + #endif + + #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR) + float4 shadowCoord : TEXCOORD12; + #endif + + // #if %EXTRAV2F0REQUIREKEY% + // float4 extraV2F0 : TEXCOORD13; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // float4 extraV2F1 : TEXCOORD14; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // float4 extraV2F2 : TEXCOORD15; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // float4 extraV2F3 : TEXCOORD16; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // float4 extraV2F4 : TEXCOORD17; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // float4 extraV2F5 : TEXCOORD18; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // float4 extraV2F6 : TEXCOORD19; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // float4 extraV2F7 : TEXCOORD20; + // #endif + + #if UNITY_ANY_INSTANCING_ENABLED + uint instanceID : CUSTOM_INSTANCE_ID; + #endif + #if (defined(UNITY_STEREO_MULTIVIEW_ENABLED)) || (defined(UNITY_STEREO_INSTANCING_ENABLED) && (defined(SHADER_API_GLES3) || defined(SHADER_API_GLCORE))) + uint stereoTargetEyeIndexAsBlendIdx0 : BLENDINDICES0; + #endif + #if (defined(UNITY_STEREO_INSTANCING_ENABLED)) + uint stereoTargetEyeIndexAsRTArrayIdx : SV_RenderTargetArrayIndex; + #endif + #if defined(SHADER_STAGE_FRAGMENT) && defined(VARYINGS_NEED_CULLFACE) + FRONT_FACE_TYPE cullFace : FRONT_FACE_SEMANTIC; + #endif + + #if _PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR)) + float4 previousPositionCS : TEXCOORD21; // Contain previous transform position (in case of skinning for example) + float4 positionCS : TEXCOORD22; + #endif + }; + + + + + // data describing the user output of a pixel + struct Surface + { + half3 Albedo; + half Height; + half3 Normal; + half Smoothness; + half3 Emission; + half Metallic; + half3 Specular; + half Occlusion; + half SpecularPower; // for simple lighting + half Alpha; + float outputDepth; // if written, SV_Depth semantic is used. ShaderData.clipPos.z is unused value + // HDRP Only + half SpecularOcclusion; + half SubsurfaceMask; + half Thickness; + half CoatMask; + half CoatSmoothness; + half Anisotropy; + half IridescenceMask; + half IridescenceThickness; + int DiffusionProfileHash; + float SpecularAAThreshold; + float SpecularAAScreenSpaceVariance; + // requires _OVERRIDE_BAKEDGI to be defined, but is mapped in all pipelines + float3 DiffuseGI; + float3 BackDiffuseGI; + float3 SpecularGI; + float ior; + float3 transmittanceColor; + float atDistance; + float transmittanceMask; + // requires _OVERRIDE_SHADOWMASK to be defines + float4 ShadowMask; + + // for decals + float NormalAlpha; + float MAOSAlpha; + + + }; + + // Data the user declares in blackboard blocks + struct Blackboard + { + + float blackboardDummyData; + }; + + // data the user might need, this will grow to be big. But easy to strip + struct ShaderData + { + float4 clipPos; // SV_POSITION + float3 localSpacePosition; + float3 localSpaceNormal; + float3 localSpaceTangent; + + float3 worldSpacePosition; + float3 worldSpaceNormal; + float3 worldSpaceTangent; + float tangentSign; + + float3 worldSpaceViewDir; + float3 tangentSpaceViewDir; + + float4 texcoord0; + float4 texcoord1; + float4 texcoord2; + float4 texcoord3; + + float2 screenUV; + float4 screenPos; + + float4 vertexColor; + bool isFrontFace; + + float4 extraV2F0; + float4 extraV2F1; + float4 extraV2F2; + float4 extraV2F3; + float4 extraV2F4; + float4 extraV2F5; + float4 extraV2F6; + float4 extraV2F7; + + float3x3 TBNMatrix; + Blackboard blackboard; + }; + + struct VertexData + { + #if SHADER_TARGET > 30 + // uint vertexID : SV_VertexID; + #endif + float4 vertex : POSITION; + float3 normal : NORMAL; + float4 tangent : TANGENT; + float4 texcoord0 : TEXCOORD0; + + // optimize out mesh coords when not in use by user or lighting system + #if _URP && (_USINGTEXCOORD1 || _PASSMETA || _PASSFORWARD || _PASSGBUFFER) + float4 texcoord1 : TEXCOORD1; + #endif + + #if _URP && (_USINGTEXCOORD2 || _PASSMETA || ((_PASSFORWARD || _PASSGBUFFER) && defined(DYNAMICLIGHTMAP_ON))) + float4 texcoord2 : TEXCOORD2; + #endif + + #if _STANDARD && (_USINGTEXCOORD1 || (_PASSMETA || ((_PASSFORWARD || _PASSGBUFFER || _PASSFORWARDADD) && LIGHTMAP_ON))) + float4 texcoord1 : TEXCOORD1; + #endif + #if _STANDARD && (_USINGTEXCOORD2 || (_PASSMETA || ((_PASSFORWARD || _PASSGBUFFER) && DYNAMICLIGHTMAP_ON))) + float4 texcoord2 : TEXCOORD2; + #endif + + + #if _HDRP + float4 texcoord1 : TEXCOORD1; + float4 texcoord2 : TEXCOORD2; + #endif + + // #if %TEXCOORD3REQUIREKEY% + float4 texcoord3 : TEXCOORD3; + // #endif + + // #if %VERTEXCOLORREQUIREKEY% + float4 vertexColor : COLOR; + // #endif + + #if _PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR)) + float3 previousPositionOS : TEXCOORD4; // Contain previous transform position (in case of skinning for example) + #if defined (_ADD_PRECOMPUTED_VELOCITY) + float3 precomputedVelocity : TEXCOORD5; // Add Precomputed Velocity (Alembic computes velocities on runtime side). + #endif + #endif + + UNITY_VERTEX_INPUT_INSTANCE_ID + }; + + struct TessVertex + { + float4 vertex : INTERNALTESSPOS; + float3 normal : NORMAL; + float4 tangent : TANGENT; + float4 texcoord0 : TEXCOORD0; + float4 texcoord1 : TEXCOORD1; + float4 texcoord2 : TEXCOORD2; + + // #if %TEXCOORD3REQUIREKEY% + float4 texcoord3 : TEXCOORD3; + // #endif + + // #if %VERTEXCOLORREQUIREKEY% + float4 vertexColor : COLOR; + // #endif + + // #if %EXTRAV2F0REQUIREKEY% + // float4 extraV2F0 : TEXCOORD5; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // float4 extraV2F1 : TEXCOORD6; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // float4 extraV2F2 : TEXCOORD7; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // float4 extraV2F3 : TEXCOORD8; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // float4 extraV2F4 : TEXCOORD9; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // float4 extraV2F5 : TEXCOORD10; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // float4 extraV2F6 : TEXCOORD11; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // float4 extraV2F7 : TEXCOORD12; + // #endif + + #if _PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR)) + float3 previousPositionOS : TEXCOORD13; // Contain previous transform position (in case of skinning for example) + #if defined (_ADD_PRECOMPUTED_VELOCITY) + float3 precomputedVelocity : TEXCOORD14; + #endif + #endif + + UNITY_VERTEX_INPUT_INSTANCE_ID + UNITY_VERTEX_OUTPUT_STEREO + }; + + struct ExtraV2F + { + float4 extraV2F0; + float4 extraV2F1; + float4 extraV2F2; + float4 extraV2F3; + float4 extraV2F4; + float4 extraV2F5; + float4 extraV2F6; + float4 extraV2F7; + Blackboard blackboard; + float4 time; + }; + + + float3 WorldToTangentSpace(ShaderData d, float3 normal) + { + return mul(d.TBNMatrix, normal); + } + + float3 TangentToWorldSpace(ShaderData d, float3 normal) + { + return mul(normal, d.TBNMatrix); + } + + // in this case, make standard more like SRPs, because we can't fix + // unity_WorldToObject in HDRP, since it already does macro-fu there + + #if _STANDARD + float3 TransformWorldToObject(float3 p) { return mul(unity_WorldToObject, float4(p, 1)); }; + float3 TransformObjectToWorld(float3 p) { return mul(unity_ObjectToWorld, float4(p, 1)); }; + float4 TransformWorldToObject(float4 p) { return mul(unity_WorldToObject, p); }; + float4 TransformObjectToWorld(float4 p) { return mul(unity_ObjectToWorld, p); }; + float4x4 GetWorldToObjectMatrix() { return unity_WorldToObject; } + float4x4 GetObjectToWorldMatrix() { return unity_ObjectToWorld; } + #if (defined(SHADER_API_D3D11) || defined(SHADER_API_XBOXONE) || defined(UNITY_COMPILER_HLSLCC) || defined(SHADER_API_PSSL) || (SHADER_TARGET_SURFACE_ANALYSIS && !SHADER_TARGET_SURFACE_ANALYSIS_MOJOSHADER)) + #define UNITY_SAMPLE_TEX2D_LOD(tex,coord, lod) tex.SampleLevel (sampler##tex,coord, lod) + #define UNITY_SAMPLE_TEX2D_SAMPLER_LOD(tex,samplertex,coord, lod) tex.SampleLevel (sampler##samplertex,coord, lod) + #else + #define UNITY_SAMPLE_TEX2D_LOD(tex,coord,lod) tex2D (tex,coord,0,lod) + #define UNITY_SAMPLE_TEX2D_SAMPLER_LOD(tex,samplertex,coord,lod) tex2D (tex,coord,0,lod) + #endif + + #undef GetWorldToObjectMatrix() + + #define GetWorldToObjectMatrix() unity_WorldToObject + + + #endif + + float3 GetCameraWorldPosition() + { + #if _HDRP + return GetCameraRelativePositionWS(_WorldSpaceCameraPos); + #else + return _WorldSpaceCameraPos; + #endif + } + + #if _GRABPASSUSED + #if _STANDARD + TEXTURE2D(%GRABTEXTURE%); + SAMPLER(sampler_%GRABTEXTURE%); + #endif + + half3 GetSceneColor(float2 uv) + { + #if _STANDARD + return SAMPLE_TEXTURE2D(%GRABTEXTURE%, sampler_%GRABTEXTURE%, uv).rgb; + #else + return SHADERGRAPH_SAMPLE_SCENE_COLOR(uv); + #endif + } + #endif + + + + #if _STANDARD + UNITY_DECLARE_DEPTH_TEXTURE(_CameraDepthTexture); + float GetSceneDepth(float2 uv) { return SAMPLE_DEPTH_TEXTURE(_CameraDepthTexture, uv); } + float GetLinear01Depth(float2 uv) { return Linear01Depth(GetSceneDepth(uv)); } + float GetLinearEyeDepth(float2 uv) { return LinearEyeDepth(GetSceneDepth(uv)); } + #else + float GetSceneDepth(float2 uv) { return SHADERGRAPH_SAMPLE_SCENE_DEPTH(uv); } + float GetLinear01Depth(float2 uv) { return Linear01Depth(GetSceneDepth(uv), _ZBufferParams); } + float GetLinearEyeDepth(float2 uv) { return LinearEyeDepth(GetSceneDepth(uv), _ZBufferParams); } + #endif + + float3 GetWorldPositionFromDepthBuffer(float2 uv, float3 worldSpaceViewDir) + { + float eye = GetLinearEyeDepth(uv); + float3 camView = mul((float3x3)GetObjectToWorldMatrix(), transpose(mul(GetWorldToObjectMatrix(), UNITY_MATRIX_I_V)) [2].xyz); + + float dt = dot(worldSpaceViewDir, camView); + float3 div = worldSpaceViewDir/dt; + float3 wpos = (eye * div) + GetCameraWorldPosition(); + return wpos; + } + + #if _HDRP + float3 ObjectToWorldSpacePosition(float3 pos) + { + return GetAbsolutePositionWS(TransformObjectToWorld(pos)); + } + #else + float3 ObjectToWorldSpacePosition(float3 pos) + { + return TransformObjectToWorld(pos); + } + #endif + + #if _STANDARD + UNITY_DECLARE_SCREENSPACE_TEXTURE(_CameraDepthNormalsTexture); + float3 GetSceneNormal(float2 uv, float3 worldSpaceViewDir) + { + float4 depthNorms = UNITY_SAMPLE_SCREENSPACE_TEXTURE(_CameraDepthNormalsTexture, uv); + float3 norms = DecodeViewNormalStereo(depthNorms); + norms = mul((float3x3)GetWorldToViewMatrix(), norms) * 0.5 + 0.5; + return norms; + } + #elif _HDRP && !_DECALSHADER + + float3 GetSceneNormal(float2 uv, float3 worldSpaceViewDir) + { + NormalData nd; + DecodeFromNormalBuffer(_ScreenSize.xy * uv, nd); + return nd.normalWS; + } + #elif _URP + #if (SHADER_LIBRARY_VERSION_MAJOR >= 10) + #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/DeclareNormalsTexture.hlsl" + #endif + + float3 GetSceneNormal(float2 uv, float3 worldSpaceViewDir) + { + #if (SHADER_LIBRARY_VERSION_MAJOR >= 10) + return SampleSceneNormals(uv); + #else + float3 wpos = GetWorldPositionFromDepthBuffer(uv, worldSpaceViewDir); + return normalize(-cross(ddx(wpos), ddy(wpos))) * 0.5 + 0.5; + #endif + + } + #endif + + #if _HDRP + + half3 UnpackNormalmapRGorAG(half4 packednormal) + { + // This do the trick + packednormal.x *= packednormal.w; + + half3 normal; + normal.xy = packednormal.xy * 2 - 1; + normal.z = sqrt(1 - saturate(dot(normal.xy, normal.xy))); + return normal; + } + half3 UnpackNormal(half4 packednormal) + { + #if defined(UNITY_NO_DXT5nm) + return packednormal.xyz * 2 - 1; + #else + return UnpackNormalmapRGorAG(packednormal); + #endif + } + #endif + #if _HDRP || _URP + + half3 UnpackScaleNormal(half4 packednormal, half scale) + { + #ifndef UNITY_NO_DXT5nm + // Unpack normal as DXT5nm (1, y, 1, x) or BC5 (x, y, 0, 1) + // Note neutral texture like "bump" is (0, 0, 1, 1) to work with both plain RGB normal and DXT5nm/BC5 + packednormal.x *= packednormal.w; + #endif + half3 normal; + normal.xy = (packednormal.xy * 2 - 1) * scale; + normal.z = sqrt(1 - saturate(dot(normal.xy, normal.xy))); + return normal; + } + + #endif + + + void GetSun(out float3 lightDir, out float3 color) + { + lightDir = float3(0.5, 0.5, 0); + color = 1; + #if _HDRP + if (_DirectionalLightCount > 0) + { + DirectionalLightData light = _DirectionalLightDatas[0]; + lightDir = -light.forward.xyz; + color = light.color; + } + #elif _STANDARD + lightDir = normalize(_WorldSpaceLightPos0.xyz); + color = _LightColor0.rgb; + #elif _URP + Light light = GetMainLight(); + lightDir = light.direction; + color = light.color; + #endif + } + + + + CBUFFER_START(UnityPerMaterial) + + + half4 _Color; + half4 _MainTex_ST, _MainTex_TexelSize; + half _Alpha, _AlphaCutoffValue; + + #if ATLAS_ON + half _MinXUV, _MaxXUV, _MinYUV, _MaxYUV; + #endif + + #if GLOW_ON + half4 _GlowColor; + half _Glow, _GlowGlobal; + #endif + + #if HSV_ON + half _HsvShift, _HsvSaturation, _HsvBright; + #endif + + #if DISTORT_ON + half4 _DistortTex_ST; + half _DistortTexXSpeed, _DistortTexYSpeed, _DistortAmount; + #endif + + #if FADE_ON + half4 _FadeBurnColor, _FadeTex_ST, _FadeBurnTex_ST; + half _FadeAmount, _FadeBurnWidth, _FadeBurnTransition,_FadeBurnGlow; + #endif + + #if OUTBASE_ON + half4 _OutlineColor; + half _OutlineAlpha, _OutlineGlow, _OutlineWidth; + int _OutlinePixelWidth; + #endif + + #if OUTTEX_ON + half4 _OutlineTex_ST; + half _OutlineTexXSpeed, _OutlineTexYSpeed; + #endif + + #if OUTDIST_ON + half4 _OutlineDistortTex_ST; + half _OutlineDistortTexXSpeed, _OutlineDistortTexYSpeed, _OutlineDistortAmount; + #endif + + #if ALPHAOUTLINE_ON + half _AlphaOutlineGlow, _AlphaOutlinePower, _AlphaOutlineMinAlpha, _AlphaOutlineBlend; + half4 _AlphaOutlineColor; + #endif + + #if INNEROUTLINE_ON + half _InnerOutlineThickness, _InnerOutlineAlpha, _InnerOutlineGlow; + half4 _InnerOutlineColor; + #endif + + #if GRADIENT_ON + half _GradBlend, _GradBoostX, _GradBoostY; + half4 _GradTopRightCol, _GradTopLeftCol, _GradBotRightCol, _GradBotLeftCol; + #endif + + #if COLORSWAP_ON + half4 _ColorSwapRed, _ColorSwapGreen, _ColorSwapBlue; + half _ColorSwapRedLuminosity, _ColorSwapGreenLuminosity, _ColorSwapBlueLuminosity, _ColorSwapBlend; + #endif + + #if CHANGECOLOR_ON + half4 _ColorChangeNewCol, _ColorChangeTarget; + half _ColorChangeTolerance, _ColorChangeLuminosity; + #endif + #if CHANGECOLOR2_ON + half4 _ColorChangeNewCol2, _ColorChangeTarget2; + half _ColorChangeTolerance2; + #endif + #if CHANGECOLOR3_ON + half4 _ColorChangeNewCol3, _ColorChangeTarget3; + half _ColorChangeTolerance3; + #endif + + #if COLORRAMP_ON + half _ColorRampLuminosity, _ColorRampBlend; + #endif + + #if HITEFFECT_ON + half4 _HitEffectColor; + half _HitEffectGlow, _HitEffectBlend; + #endif + + #if NEGATIVE_ON + half _NegativeAmount; + #endif + + #if PIXELATE_ON + half _PixelateSize; + #endif + + #if GREYSCALE_ON + half _GreyscaleLuminosity, _GreyscaleBlend; + half4 _GreyscaleTintColor; + #endif + + #if POSTERIZE_ON + half _PosterizeNumColors, _PosterizeGamma; + #endif + + #if BLUR_ON + half _BlurIntensity; + #endif + + #if MOTIONBLUR_ON + half _MotionBlurAngle, _MotionBlurDist; + #endif + + #if GHOST_ON + half _GhostColorBoost, _GhostTransparency, _GhostBlend; + #endif + + #if HOLOGRAM_ON + half _HologramStripesAmount, _HologramMinAlpha, _HologramUnmodAmount, _HologramStripesSpeed, _HologramMaxAlpha, _HologramBlend; + half4 _HologramStripeColor; + #endif + + #if CHROMABERR_ON + half _ChromAberrAmount, _ChromAberrAlpha; + #endif + + #if GLITCH_ON + half _GlitchAmount, _GlitchSize; + #endif + + #if FLICKER_ON + half _FlickerFreq, _FlickerPercent, _FlickerAlpha; + #endif + + #if SHADOW_ON + half _ShadowX, _ShadowY, _ShadowAlpha; + half4 _ShadowColor; + #endif + + #if SHINE_ON + half4 _ShineColor; + half _ShineLocation, _ShineRotate, _ShineWidth, _ShineGlow; + #endif + + #if CONTRAST_ON + half _Contrast, _Brightness; + #endif + + #if OVERLAY_ON + half4 _OverlayTex_ST, _OverlayColor; + half _OverlayGlow, _OverlayBlend, _OverlayTextureScrollXSpeed, _OverlayTextureScrollYSpeed; + #endif + + #if DOODLE_ON + half _HandDrawnAmount, _HandDrawnSpeed; + #endif + + #if WIND_ON + half _GrassSpeed, _GrassWind, _GrassManualAnim, _GrassRadialBend; + #endif + + #if WAVEUV_ON + float _WaveAmount, _WaveSpeed, _WaveStrength, _WaveX, _WaveY; + #endif + + #if ROUNDWAVEUV_ON + half _RoundWaveStrength, _RoundWaveSpeed; + #endif + + #if RECTSIZE_ON + half _RectSize; + #endif + + #if OFFSETUV_ON + half _OffsetUvX, _OffsetUvY; + #endif + + #if CLIPPING_ON + half _ClipUvLeft, _ClipUvRight, _ClipUvUp, _ClipUvDown; + #endif + + #if RADIALCLIPPING_ON + half _RadialStartAngle, _RadialClip, _RadialClip2; + #endif + + #if TEXTURESCROLL_ON + half _TextureScrollXSpeed, _TextureScrollYSpeed; + #endif + + #if ZOOMUV_ON + half _ZoomUvAmount; + #endif + + #if WARP_ON + half _WarpStrength, _WarpSpeed, _WarpScale; + #endif + + #if TWISTUV_ON + half _TwistUvAmount, _TwistUvPosX, _TwistUvPosY, _TwistUvRadius; + #endif + + #if ROTATEUV_ON + half _RotateUvAmount; + #endif + + #if FISHEYE_ON + half _FishEyeUvAmount; + #endif + + #if PINCH_ON + half _PinchUvAmount; + #endif + + #if SHAKEUV_ON + half _ShakeUvSpeed, _ShakeUvX, _ShakeUvY; + #endif + + #if NORMALMAP_ON + half _NormalStrength; + #endif + + float _RandomSeed; + + + + + CBUFFER_END + + + + + + + + TEXTURE2D(_MainTex); + SAMPLER(sampler_MainTex); + + #if GLOW_ON + TEXTURE2D(_GlowTex); + SAMPLER(sampler_GlowTex); + #endif + + #if FADE_ON + TEXTURE2D(_FadeTex); + SAMPLER(sampler_FadeTex); + + TEXTURE2D(_FadeBurnTex); + SAMPLER(sampler_FadeBurnTex); + #endif + + #if DISTORT_ON + TEXTURE2D(_DistortTex); + SAMPLER(sampler_DistortTex); + #endif + + #if OUTTEX_ON + TEXTURE2D(_OutlineTex); + SAMPLER(sampler_OutlineTex); + #endif + + #if OUTDIST_ON + TEXTURE2D(_OutlineDistortTex); + SAMPLER(sampler_OutlineDistortTex); + #endif + + #if COLORSWAP_ON + TEXTURE2D(_ColorSwapTex); + SAMPLER(sampler_ColorSwapTex); + #endif + + #if COLORRAMP_ON + TEXTURE2D(_ColorRampTex); + TEXTURE2D(_ColorRampTexGradient); + SAMPLER(sampler_ColorRampTex); + SAMPLER(sampler_ColorRampTexGradient); + #endif + + #if SHINE_ON + TEXTURE2D(_ShineMask); + SAMPLER(sampler_ShineMask); + #endif + + #if OVERLAY_ON + TEXTURE2D(_OverlayTex); + SAMPLER(sampler_OverlayTex); + #endif + + #if NORMALMAP_ON + TEXTURE2D(_NormalMap); + SAMPLER(sampler_NormalMap); + #endif + + + half3 GetPixel(in int offsetX, in int offsetY, in half2 uv, in Texture2D _tex, in SamplerState _sampler) + { + half2 _uv = uv + half2(offsetX * _MainTex_TexelSize.x, offsetY * _MainTex_TexelSize.y); + half4 col = SAMPLE_TEXTURE2D(_tex, _sampler, _uv); + return col.rgb; + } + + + //BLURS------------------------------------------------------------------------- + half4 Blur(half2 uv, Texture2D source, SamplerState sampler_source, half Intensity) + { + const half2 texelSize = 1.0 / _ScreenParams.xy; + const half4 color = SAMPLE_TEXTURE2D(source, sampler_source, uv); + const half2 offset = Intensity * texelSize; + + half4 accumulatedColor = color; + half accumulatedWeight = 1.0; + for (int x = -1; x <= 1; x++) + { + for (int y = -1; y <= 1; y++) + { + const half2 sampleUV = uv + half2(x, y) * offset; + const half4 sampleColor = SAMPLE_TEXTURE2D(source, sampler_source, sampleUV); + + accumulatedColor += sampleColor; + accumulatedWeight += 1.0; + } + } + + half4 blurredColor = accumulatedColor / accumulatedWeight; + return blurredColor; + } + + half BlurHD_G(half bhqp, half x) + { + return exp(-(x * x) / (2.0 * bhqp * bhqp)); + } + half4 BlurHD(half2 uv, Texture2D source, SamplerState sampler_source, half BlurAmount, half xScale, half yScale) + { + int iterations = 16; + int halfIterations = iterations / 2; + half sigmaX = 0.1 + BlurAmount * 0.5; + half sigmaY = sigmaX; + half total = 0.0; + half4 ret = half4(0, 0, 0, 0); + for (int iy = 0; iy < iterations; ++iy) + { + half fy = BlurHD_G(sigmaY, half(iy) -half(halfIterations)); + half offsetY = half(iy - halfIterations) * 0.00390625 * xScale; + for (int ix = 0; ix < iterations; ++ix) + { + half fx = BlurHD_G(sigmaX, half(ix) - half(halfIterations)); + half offsetX = half(ix - halfIterations) * 0.00390625 * yScale; + total += fx * fy; + ret += SAMPLE_TEXTURE2D(source, sampler_source, uv + half2(offsetX, offsetY)) * fx * fy; + } + } + return ret / total; + } + //----------------------------------------------------------------------- + + + //------------------------------------------- + half RemapFloat(half inValue, half inMin, half inMax, half outMin, half outMax){ + return outMin + (inValue - inMin) * (outMax - outMin) / (inMax - inMin); + } + //------------------------------------------- + + //----------------------------------------------------------------------- + half rand(half2 seed, half offset) { + return (frac(sin(dot(seed, half2(12.9898, 78.233))) * 43758.5453) + offset) % 1.0; + } + + half rand2(half2 seed, half offset) { + return (frac(sin(dot(seed * floor(50 + (_Time.x % 1.0) * 12.), half2(127.1, 311.7))) * 43758.5453123) + offset) % 1.0; + } + + half rand2CustomTime(half2 seed, half offset, half customTime) { + return (frac(sin(dot(seed * floor(50 + (customTime % 1.0) * 12.), half2(127.1, 311.7))) * 43758.5453123) + offset) % 1.0; + } + //----------------------------------------------------------------------- + + + void Ext_ModifyVertex0 (inout VertexData v, inout ExtraV2F d) + { + //BILBOARD_ON + #if BILBOARD_ON + half3 camRight = mul((half3x3)unity_CameraToWorld, half3(1,0,0)); + half3 camUp = half3(0,1,0); + #if BILBOARDY_ON + camUp = mul((half3x3)unity_CameraToWorld, half3(0,1,0)); + #endif + half3 localPos = v.vertex.x * camRight + v.vertex.y * camUp; + v.vertex = half4(localPos, 1); + #endif + //----------------------------------------------------------- + + v.texcoord0.xy = TRANSFORM_TEX(v.texcoord0.xy, _MainTex); + half2 center = half2(0.5, 0.5); + #if ATLAS_ON + center = half2((_MaxXUV + _MinXUV) / 2.0, (_MaxYUV + _MinYUV) / 2.0); + #endif + + //POLARUV_ON + #if POLARUV_ON + v.texcoord0.xy = v.texcoord0.xy - center; + #endif + + //---------------------------------------- + + //ROTATEUV_ON + #if ROTATEUV_ON + half2 uvC = v.texcoord0.xy; + half cosAngle = cos(_RotateUvAmount); + half sinAngle = sin(_RotateUvAmount); + half2x2 rot = half2x2(cosAngle, -sinAngle, sinAngle, cosAngle); + uvC -= center; + v.texcoord0.xy = mul(rot, uvC); + v.texcoord0.xy += center; + #endif + //-------------------- + + #if RECTSIZE_ON + v.vertex.xyz += (v.vertex.xyz * (_RectSize - 1.0)); + #endif + + #if OUTTEX_ON + v.texcoord1.xy = TRANSFORM_TEX(v.texcoord0.xy, _OutlineTex); + #endif + + #if OUTDIST_ON + v.texcoord2.xy = TRANSFORM_TEX(v.texcoord0.xy, _OutlineDistortTex); + #endif + + #if DISTORT_ON + v.texcoord3.xy = TRANSFORM_TEX(v.texcoord0.xy, _DistortTex); + #endif + } + + void Ext_SurfaceFunction0 (inout Surface o, ShaderData d) + { + half randomSeed = _RandomSeed; + + float2 uvRect = d.texcoord0; + half2 center = half2(0.5, 0.5); + #if ATLAS_ON + center = half2((_MaxXUV + _MinXUV) / 2.0, (_MaxYUV + _MinYUV) / 2.0); + uvRect = half2((d.texcoord0.x - _MinXUV) / (_MaxXUV - _MinXUV), (d.texcoord0.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half2 centerTiled = half2(center.x * _MainTex_ST.x, center.y * _MainTex_ST.y); + + //CLIPPING_ON + #if CLIPPING_ON + half2 tiledUv = half2(d.texcoord0.x / _MainTex_ST.x, d.texcoord0.y / _MainTex_ST.y); + #if ATLAS_ON + tiledUv = half2((tiledUv.x - _MinXUV) / (_MaxXUV - _MinXUV), (tiledUv.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + clip((1 - _ClipUvUp) - tiledUv.y); + clip(tiledUv.y - _ClipUvDown); + clip((1 - _ClipUvRight) - tiledUv.x); + clip(tiledUv.x - _ClipUvLeft); + #endif + //---------------------------------- + + //RADIALCLIPPING_ON + #if RADIALCLIPPING_ON + half2 tiledUv2 = half2(d.texcoord0.x / _MainTex_ST.x, d.texcoord0.y / _MainTex_ST.y); + #if ATLAS_ON + tiledUv2 = half2((tiledUv2.x - _MinXUV) / (_MaxXUV - _MinXUV), (tiledUv2.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half startAngle = _RadialStartAngle - _RadialClip; + half endAngle = _RadialStartAngle + _RadialClip2; + half offset0 = clamp(0, 360, startAngle + 360); + half offset360 = clamp(0, 360, endAngle - 360); + half2 atan2Coord = half2(lerp(-1, 1, tiledUv2.x), lerp(-1, 1, tiledUv2.y)); + half atanAngle = atan2(atan2Coord.y, atan2Coord.x) * 57.3; // angle in degrees + if(atanAngle < 0) atanAngle = 360 + atanAngle; + if(atanAngle >= startAngle && atanAngle <= endAngle) discard; + if(atanAngle <= offset360) discard; + if(atanAngle >= offset0) discard; + #endif + + //----------------------------- + + //TEXTURESCROLL_ON && ATLAS_ON + #if TEXTURESCROLL_ON && ATLAS_ON + d.texcoord0.xy = half2(_MinXUV + ((_MaxXUV - _MinXUV) * (abs(((_Time.y + randomSeed) * _TextureScrollXSpeed) + uvRect.x) % 1)), + _MinYUV + ((_MaxYUV - _MinYUV) * (abs(((_Time.y + randomSeed) * _TextureScrollYSpeed) + uvRect.y) % 1))); + #endif + //---------------------------- + + //OFFSETUV_ON + #if OFFSETUV_ON + #if ATLAS_ON + d.texcoord0.xy = half2(_MinXUV + ((_MaxXUV - _MinXUV) * (abs((_OffsetUvX + uvRect.x) % 1))), + _MinYUV + ((_MaxYUV - _MinYUV) * (abs(_OffsetUvY + uvRect.y) % 1))); + #else + d.texcoord0.xy += half2(_OffsetUvX, _OffsetUvY); + #endif + #endif + + //---------------------- + + //POLARUV_ON + #if POLARUV_ON + d.texcoord0.xy = half2(atan2(d.texcoord0.y, d.texcoord0.x) / (2.0f * 3.141592653589f), length(d.texcoord0.xy)); + d.texcoord0.xy *= _MainTex_ST.xy; + #endif + + //-------------------------------------- + + //TWISTUV_ON + #if TWISTUV_ON + #if ATLAS_ON + _TwistUvPosX = ((_MaxXUV - _MinXUV) * _TwistUvPosX) + _MinXUV; + _TwistUvPosY = ((_MaxYUV - _MinYUV) * _TwistUvPosY) + _MinYUV; + #endif + half2 tempUv = d.texcoord0.xy - half2(_TwistUvPosX * _MainTex_ST.x, _TwistUvPosY * _MainTex_ST.y); + _TwistUvRadius *= (_MainTex_ST.x + _MainTex_ST.y) / 2; + half percent = (_TwistUvRadius - length(tempUv)) / _TwistUvRadius; + half theta = percent * percent * (2.0 * sin(_TwistUvAmount)) * 8.0; + half s = sin(theta); + half c = cos(theta); + half beta = max(sign(_TwistUvRadius - length(tempUv)), 0.0); + tempUv = half2(dot(tempUv, half2(c, -s)), dot(tempUv, half2(s, c))) * beta + tempUv * (1 - beta); + tempUv += half2(_TwistUvPosX * _MainTex_ST.x, _TwistUvPosY * _MainTex_ST.y); + d.texcoord0.xy = tempUv; + #endif + + //-------------------------------------------- + + //FISHEYE_ON + #if FISHEYE_ON + half bind = length(centerTiled); + half2 dF = d.texcoord0.xy - centerTiled; + half dFlen = length(dF); + half fishInt = (3.14159265359 / bind) * (_FishEyeUvAmount + 0.001); + d.texcoord0.xy = centerTiled + (dF / (max(0.0001, dFlen))) * tan(dFlen * fishInt) * bind / tan(bind * fishInt); + #endif + //--------------------------------------------- + + //PINCH_ON + #if PINCH_ON + half2 dP = d.texcoord0.xy - centerTiled; + half pinchInt = (3.141592 / length(centerTiled)) * (-_PinchUvAmount + 0.001); + d.texcoord0.xy = centerTiled + normalize(dP) * atan(length(dP) * -pinchInt * 10.0) * 0.5 / atan(-pinchInt * 5); + #endif + + //--------------------------------------------- + + //ZOOMUV_ON + #if ZOOMUV_ON + d.texcoord0.xy -= centerTiled; + d.texcoord0.xy = d.texcoord0.xy * _ZoomUvAmount; + d.texcoord0.xy += centerTiled; + #endif + + //----------------------------------------------- + + //DOODLE_ON + #if DOODLE_ON + half2 uvCopy = uvRect; + _HandDrawnSpeed = (floor((_Time.x + randomSeed) * 20 * _HandDrawnSpeed) / _HandDrawnSpeed) * _HandDrawnSpeed; + uvCopy.x = sin((uvCopy.x * _HandDrawnAmount + _HandDrawnSpeed) * 4); + uvCopy.y = cos((uvCopy.y * _HandDrawnAmount + _HandDrawnSpeed) * 4); + d.texcoord0.xy = lerp(d.texcoord0.xy, d.texcoord0.xy + uvCopy, 0.0005 * _HandDrawnAmount); + #endif + + //-------------------------- + + //SHAKEUV_ON + #if SHAKEUV_ON + half xShake = sin((_Time.x + randomSeed) * _ShakeUvSpeed * 50) * _ShakeUvX; + half yShake = cos((_Time.x + randomSeed) * _ShakeUvSpeed * 50) * _ShakeUvY; + d.texcoord0.xy += half2(xShake * 0.012, yShake * 0.01); + #endif + + //------------------------------------------- + + //RECTSIZE_ON + #if RECTSIZE_ON + d.texcoord0.xy = d.texcoord0.xy * (_RectSize).xx + (((-_RectSize * 0.5) + 0.5)).xx; + #endif + + //------------------------------------------- + + //DISTORT_ON + #if DISTORT_ON + #if ATLAS_ON + d.texcoord3.x = d.texcoord3.x * (1 / (_MaxXUV - _MinXUV)); + d.texcoord3.y = d.texcoord3.y * (1 / (_MaxYUV - _MinYUV)); + #endif + + d.texcoord3.x += ((_Time.x + _RandomSeed) * _DistortTexXSpeed) % 1; + d.texcoord3.y += ((_Time.x + _RandomSeed) * _DistortTexYSpeed) % 1; + half distortAmnt = (SAMPLE_TEXTURE2D(_DistortTex, sampler_DistortTex, d.texcoord3.xy).r - 0.5) * 0.2 * _DistortAmount; + d.texcoord0.x += distortAmnt; + d.texcoord0.y += distortAmnt; + #endif + //------------------------------------------------------- + + //WARP_ON + #if WARP_ON + half2 warpUv = half2(d.texcoord0.x / _MainTex_ST.x, d.texcoord0.y / _MainTex_ST.y); + #if ATLAS_ON + warpUv = half2((warpUv.x - _MinXUV) / (_MaxXUV - _MinXUV), (warpUv.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + const float tau = 6.283185307179586; + float xWarp = (_Time.y + randomSeed) * _WarpSpeed + warpUv.x * tau / _WarpScale; + float yWarp = (_Time.y + randomSeed) * _WarpSpeed + warpUv.y * tau / _WarpScale; + float2 warp = float2(sin(xWarp), sin(yWarp)) * _WarpStrength; + d.texcoord0.xy += warp; + #endif + + //------------------------------------------------------- + + //WAVEUV_ON + #if WAVEUV_ON + float2 uvWave = half2(_WaveX * _MainTex_ST.x, _WaveY * _MainTex_ST.y) - d.texcoord0.xy; + uvWave %= 1; + #if ATLAS_ON + uvWave = half2(_WaveX, _WaveY) - uvRect; + #endif + uvWave.x *= _ScreenParams.x / _ScreenParams.y; + float waveTime = _Time.y + randomSeed; + float angWave = (sqrt(dot(uvWave, uvWave)) * _WaveAmount) - ((waveTime * _WaveSpeed)); + d.texcoord0.xy = d.texcoord0.xy + uvWave * sin(angWave) * (_WaveStrength / 1000.0); + #endif + //---------------------------------------------------- + + //ROUNDWAVEUV_ON + #if ROUNDWAVEUV_ON + half xWave = ((0.5 * _MainTex_ST.x) - uvRect.x); + half yWave = ((0.5 * _MainTex_ST.y) - uvRect.y) * (_MainTex_TexelSize.w / _MainTex_TexelSize.z); + half ripple = -sqrt(xWave*xWave + yWave* yWave); + d.texcoord0.xy += (sin((ripple + (_Time.y + randomSeed) * (_RoundWaveSpeed/10.0)) / 0.015) * (_RoundWaveStrength/10.0)) % 1; + #endif + //---------------------------------------------------- + + + //WIND_ON + #if WIND_ON + half windOffset = sin((_Time.x + randomSeed) * _GrassSpeed * 10); + half2 windCenter = half2(0.5, 0.1); + #if ATLAS_ON + windCenter.x = ((_MaxXUV - _MinXUV) * windCenter.x) + _MinXUV; + windCenter.y = ((_MaxYUV - _MinYUV) * windCenter.y) + _MinYUV; + #endif + #if !MANUALWIND_ON + d.texcoord0.x = fmod(abs(lerp(d.texcoord0.x, d.texcoord0.x + (_GrassWind * 0.01 * windOffset), uvRect.y)), 1); + #else + d.texcoord0.x = fmod(abs(lerp(d.texcoord0.x, d.texcoord0.x + (_GrassWind * 0.01 * _GrassManualAnim), uvRect.y)), 1); + windOffset = _GrassManualAnim; + #endif + half2 delta = d.texcoord0.xy - windCenter; + half delta2 = dot(delta.xy, delta.xy); + half2 delta_offset = delta2 * windOffset; + d.texcoord0.xy = d.texcoord0.xy + half2(delta.y, -delta.x) * delta_offset * _GrassRadialBend; + #endif + + //-------------------------------------------------------- + + //TEXTURESCROLL_ON && !ATLAS_ON + #if TEXTURESCROLL_ON && !ATLAS_ON + d.texcoord0.x += ((_Time.y + randomSeed) * _TextureScrollXSpeed) % 1; + d.texcoord0.y += ((_Time.y + randomSeed) * _TextureScrollYSpeed) % 1; + #endif + //------------------------------ + + //PIXELATE_ON + #if PIXELATE_ON + half aspectRatio = _MainTex_TexelSize.x / _MainTex_TexelSize.y; + half2 pixelSize = float2(_PixelateSize, _PixelateSize * aspectRatio); + d.texcoord0.xy = floor(d.texcoord0.xy * pixelSize) / pixelSize; + #endif + //-------------- + + half4 col = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy); + half originalAlpha = col.a; + col *= d.vertexColor; + + //NORMAL MAP + #if NORMALMAP_ON + half4 normalSample = SAMPLE_TEXTURE2D(_NormalMap, sampler_NormalMap, d.texcoord0.xy); + half3 normalTS = UnpackNormal(normalSample); + normalTS.xy *= _NormalStrength; + o.Normal = normalTS; + #endif + + + //GLITCH_ON + #if GLITCH_ON + half2 uvGlitch = uvRect; + uvGlitch.y -= 0.5; + half lineNoise = pow(rand2(floor(uvGlitch * half2(24., 19.) * _GlitchSize) * 4.0, randomSeed), 3.0) * _GlitchAmount + * pow(rand2(floor(uvGlitch * half2(38., 14.) * _GlitchSize) * 4.0, randomSeed), 3.0); + col = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(lineNoise * 0.02 * rand2(half2(2.0, 1), randomSeed), 0)) * d.vertexColor; + #endif + //-------------------------------------- + + //CHROMABERR_ON + #if CHROMABERR_ON + half4 r = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(_ChromAberrAmount/10, 0)) * d.vertexColor; + half4 b = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(-_ChromAberrAmount/10, 0)) * d.vertexColor; + col = half4(r.r * r.a, col.g, b.b * b.a, max(max(r.a, b.a) * _ChromAberrAlpha, col.a)); + #endif + + //-------------------------------- + + //BLUR_ON + #if BLUR_ON + #if ATLAS_ON + #if !BLURISHD_ON + col = BlurHD(d.texcoord0.xy, _MainTex, sampler_MainTex, _BlurIntensity, (_MaxXUV - _MinXUV), (_MaxYUV - _MinYUV)) * d.vertexColor; + #else + col = Blur(d.texcoord0.xy, _MainTex, sampler_MainTex, _BlurIntensity * (_MaxXUV - _MinXUV)) * d.vertexColor; + #endif + #else + #if !BLURISHD_ON + col = BlurHD(d.texcoord0.xy, _MainTex, sampler_MainTex, _BlurIntensity, 1, 1) * d.vertexColor; + #else + col = Blur(d.texcoord0.xy, _MainTex, sampler_MainTex, _BlurIntensity) * d.vertexColor; + #endif + #endif + #endif + + //-------------------- + + //MOTIONBLUR_ON + #if MOTIONBLUR_ON + _MotionBlurAngle = _MotionBlurAngle * 3.1415926; + #define rot(n) mul(n, half2x2(cos(_MotionBlurAngle), -sin(_MotionBlurAngle), sin(_MotionBlurAngle), cos(_MotionBlurAngle))) + _MotionBlurDist = _MotionBlurDist * 0.005; + #if ATLAS_ON + _MotionBlurDist *= (_MaxXUV - _MinXUV); + #endif + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(-_MotionBlurDist, -_MotionBlurDist))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(-_MotionBlurDist * 2, -_MotionBlurDist * 2))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(-_MotionBlurDist * 3, -_MotionBlurDist * 3))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(-_MotionBlurDist * 4, -_MotionBlurDist * 4))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(_MotionBlurDist, _MotionBlurDist))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(_MotionBlurDist * 2, _MotionBlurDist * 2))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(_MotionBlurDist * 3, _MotionBlurDist * 3))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(_MotionBlurDist * 4, _MotionBlurDist * 4))); + col.rgb = col.rgb / 9; + #endif + //------------------------------------ + + //NEGATIVE_ON + #if NEGATIVE_ON + col.rgb = lerp(col.rgb, 1 - col.rgb, _NegativeAmount); + #endif + + //-------------- + half luminance = 0; + + //GREYSCALE_ON && !GREYSCALEOUTLINE_ON + #if GREYSCALE_ON && !GREYSCALEOUTLINE_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + luminance = saturate(luminance + _GreyscaleLuminosity); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _GreyscaleTintColor, _GreyscaleBlend); + #endif + //------------------------------------ + + //GHOST_ON + #if GHOST_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + half4 ghostResult; + ghostResult.a = saturate(luminance - _GhostTransparency) * col.a; + ghostResult.rgb = col.rgb * (luminance + _GhostColorBoost); + col = lerp(col, ghostResult, _GhostBlend); + #endif + //------------------------------------ + + //INNEROUTLINE_ON + #if INNEROUTLINE_ON + half3 innerT = abs(GetPixel(0, _InnerOutlineThickness, d.texcoord0.xy, _MainTex, sampler_MainTex) - GetPixel(0, -_InnerOutlineThickness, d.texcoord0.xy, _MainTex, sampler_MainTex)); + innerT += abs(GetPixel(_InnerOutlineThickness, 0, d.texcoord0.xy, _MainTex, sampler_MainTex) - GetPixel(-_InnerOutlineThickness, 0, d.texcoord0.xy, _MainTex, sampler_MainTex)); + #if !ONLYINNEROUTLINE_ON + innerT = (innerT / 2.0) * col.a * _InnerOutlineAlpha; + col.rgb += length(innerT) * _InnerOutlineColor.rgb * _InnerOutlineGlow; + #else + innerT *= col.a * _InnerOutlineAlpha; + col.rgb = length(innerT) * _InnerOutlineColor.rgb * _InnerOutlineGlow; + col.a = step(0.3, col.r+col.g+col.b); + #endif + #endif + //------------------------------------------------------- + + //HITEFFECT_ON + #if HITEFFECT_ON + col.rgb = lerp(col.rgb, _HitEffectColor.rgb * _HitEffectGlow, _HitEffectBlend); + #endif + //-------------------- + + //GRADIENT_ON + #if GRADIENT_ON + half2 tiledUvGrad = half2(uvRect.x / _MainTex_ST.x, uvRect.y / _MainTex_ST.y); + #if GRADIENT2COL_ON + _GradTopRightCol = _GradTopLeftCol; + _GradBotRightCol = _GradBotLeftCol; + #endif + #if RADIALGRADIENT_ON + half radialDist = 1 - length(tiledUvGrad - half2(0.5, 0.5)); + radialDist *= (_MainTex_TexelSize.w / _MainTex_TexelSize.z); + radialDist = saturate(_GradBoostX * radialDist); + half4 gradientResult = lerp(_GradTopLeftCol, _GradBotLeftCol, radialDist); + #else + half gradXLerpFactor = saturate(pow(tiledUvGrad.x, _GradBoostX)); + half4 gradientResult = lerp(lerp(_GradBotLeftCol, _GradBotRightCol, gradXLerpFactor), + lerp(_GradTopLeftCol, _GradTopRightCol, gradXLerpFactor), saturate(pow(tiledUvGrad.y, _GradBoostY))); + #endif + gradientResult = lerp(col, gradientResult, _GradBlend); + col.rgb = gradientResult.rgb * col.a; + col.a *= gradientResult.a; + #endif + //-------------------------------------------------------------------- + + //CONTRAST_ON + #if CONTRAST_ON + col.rgb = (col.rgb - float3(0.5, 0.5, 0.5)) * _Contrast + float3(0.5, 0.5, 0.5); + col.rgb += _Brightness; + #endif + + //------------------------------------------------------------------- + + //COLORSWAP_ON + #if COLORSWAP_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + half4 swapMask = SAMPLE_TEXTURE2D(_ColorSwapTex, sampler_ColorSwapTex, d.texcoord0.xy); + swapMask.rgb *= swapMask.a; + half3 redSwap = _ColorSwapRed * swapMask.r * saturate(luminance + _ColorSwapRedLuminosity); + half3 greenSwap = _ColorSwapGreen * swapMask.g * saturate(luminance + _ColorSwapGreenLuminosity); + half3 blueSwap = _ColorSwapBlue * swapMask.b * saturate(luminance + _ColorSwapBlueLuminosity); + swapMask.rgb = col.rgb * saturate(1 - swapMask.r - swapMask.g - swapMask.b); + col.rgb = lerp(col.rgb, swapMask.rgb + redSwap + greenSwap + blueSwap, _ColorSwapBlend); + #endif + //-------------------------------------------------------------------- + + //COLORRAMP_ON && !COLORRAMPOUTLINE_ON + #if COLORRAMP_ON && !COLORRAMPOUTLINE_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + luminance = saturate(luminance + _ColorRampLuminosity); + #if GRADIENTCOLORRAMP_ON + col.rgb = lerp(col.rgb, SAMPLE_TEXTURE2D(_ColorRampTexGradient, sampler_ColorRampTexGradient, half2(luminance, 0)).rgb, _ColorRampBlend); + #else + col.rgb = lerp(col.rgb, SAMPLE_TEXTURE2D(_ColorRampTex, sampler_ColorRampTex, half2(luminance, 0)).rgb, _ColorRampBlend); + #endif + #endif + //-------------------------------------------------------------------- + + //CHANGECOLOR_ON + #if CHANGECOLOR_ON + float3 currChangeColor = saturate(col.rgb); + luminance = 0.3 * currChangeColor.r + 0.59 * currChangeColor.g + 0.11 * currChangeColor.b; + luminance = saturate(luminance + _ColorChangeLuminosity); + half3 dif = abs(currChangeColor - _ColorChangeTarget.rgb); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _ColorChangeNewCol.rgb, + max(sign(1 - saturate(dif.x + dif.y + dif.z) - _ColorChangeTolerance), 0.0)); + #if CHANGECOLOR2_ON + dif = abs(currChangeColor - _ColorChangeTarget2.rgb); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _ColorChangeNewCol2.rgb, + max(sign(1 - saturate(dif.x + dif.y + dif.z) - _ColorChangeTolerance2), 0.0)); + #endif + #if CHANGECOLOR3_ON + dif = abs(currChangeColor - _ColorChangeTarget3.rgb); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _ColorChangeNewCol3.rgb, + max(sign(1 - saturate(dif.x + dif.y + dif.z) - _ColorChangeTolerance3), 0.0)); + #endif + #endif + //------------------------------------------------------- + + //POSTERIZE_ON && !POSTERIZEOUTLINE_ON + #if POSTERIZE_ON && !POSTERIZEOUTLINE_ON + col.rgb = pow(col.rgb, _PosterizeGamma) * _PosterizeNumColors; + col.rgb = floor(col.rgb) / _PosterizeNumColors; + col.rgb = pow(col.rgb, 1.0 / _PosterizeGamma); + #endif + //------------------------------------ + + //HSV_ON + #if HSV_ON + half3 resultHsv = half3(col.rgb); + half cosHsv = _HsvBright * _HsvSaturation * cos(_HsvShift * 3.14159265 / 180); + half sinHsv = _HsvBright * _HsvSaturation * sin(_HsvShift * 3.14159265 / 180); + resultHsv.x = (.299 * _HsvBright + .701 * cosHsv + .168 * sinHsv) * col.x + + (.587 * _HsvBright - .587 * cosHsv + .330 * sinHsv) * col.y + + (.114 * _HsvBright - .114 * cosHsv - .497 * sinHsv) * col.z; + resultHsv.y = (.299 * _HsvBright - .299 * cosHsv - .328 * sinHsv) *col.x + + (.587 * _HsvBright + .413 * cosHsv + .035 * sinHsv) * col.y + + (.114 * _HsvBright - .114 * cosHsv + .292 * sinHsv) * col.z; + resultHsv.z = (.299 * _HsvBright - .3 * cosHsv + 1.25 * sinHsv) * col.x + + (.587 * _HsvBright - .588 * cosHsv - 1.05 * sinHsv) * col.y + + (.114 * _HsvBright + .886 * cosHsv - .203 * sinHsv) * col.z; + col.rgb = resultHsv; + #endif + //------------------------------------------------------- + + //OVERLAY_ON + #if OVERLAY_ON + half2 overlayUvs = d.texcoord0.xy; + overlayUvs.x += ((_Time.y + randomSeed) * _OverlayTextureScrollXSpeed) % 1; + overlayUvs.y += ((_Time.y + randomSeed) * _OverlayTextureScrollYSpeed) % 1; + half4 overlayCol = SAMPLE_TEXTURE2D(_OverlayTex, sampler_OverlayTex, TRANSFORM_TEX(overlayUvs, _OverlayTex)); + overlayCol.rgb *= _OverlayColor.rgb * _OverlayGlow; + #if !OVERLAYMULT_ON + overlayCol.rgb *= overlayCol.a * _OverlayColor.rgb * _OverlayColor.a * _OverlayBlend; + col.rgb += overlayCol.rgb; + #else + overlayCol.a *= _OverlayColor.a; + col = lerp(col, col * overlayCol, _OverlayBlend); + #endif + #endif + + //--------------------------------- + + //OUTBASE_ON + #if OUTBASE_ON + #if OUTBASEPIXELPERF_ON + half2 destUv = half2(_OutlinePixelWidth * _MainTex_TexelSize.x, _OutlinePixelWidth * _MainTex_TexelSize.y); + #else + half2 destUv = half2(_OutlineWidth * _MainTex_TexelSize.x * 200, _OutlineWidth * _MainTex_TexelSize.y * 200); + #endif + + #if OUTDIST_ON + d.texcoord3.x += ((_Time.x + _RandomSeed) * _OutlineDistortTexXSpeed) % 1; + d.texcoord3.y += ((_Time.x + _RandomSeed) * _OutlineDistortTexYSpeed) % 1; + #if ATLAS_ON + d.texcoord3 = half2((d.texcoord3.x - _MinXUV) / (_MaxXUV - _MinXUV), (d.texcoord3.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half outDistortAmnt = (SAMPLE_TEXTURE2D(_OutlineDistortTex, sampler_OutlineDistortTex, d.texcoord3).r - 0.5) * 0.2 * _OutlineDistortAmount; + destUv.x += outDistortAmnt; + destUv.y += outDistortAmnt; + #endif + + half spriteLeft = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(destUv.x, 0)).a; + half spriteRight = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy - half2(destUv.x, 0)).a; + half spriteBottom = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(0, destUv.y)).a; + half spriteTop = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy - half2(0, destUv.y)).a; + half result = spriteLeft + spriteRight + spriteBottom + spriteTop; + + #if OUTBASE8DIR_ON + half spriteTopLeft = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(destUv.x, destUv.y)).a; + half spriteTopRight = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(-destUv.x, destUv.y)).a; + half spriteBotLeft = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(destUv.x, -destUv.y)).a; + half spriteBotRight = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(-destUv.x, -destUv.y)).a; + result = result + spriteTopLeft + spriteTopRight + spriteBotLeft + spriteBotRight; + #endif + + result = step(0.05, saturate(result)); + + #if OUTTEX_ON + d.texcoord1.x += ((_Time.x + _RandomSeed) * _OutlineTexXSpeed) % 1; + d.texcoord1.y += ((_Time.x + _RandomSeed) * _OutlineTexYSpeed) % 1; + #if ATLAS_ON + d.texcoord1 = half2((d.texcoord1.x - _MinXUV) / (_MaxXUV - _MinXUV), (d.texcoord1.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half4 tempOutColor = SAMPLE_TEXTURE2D(_OutlineTex, sampler_OutlineTex, d.texcoord1); + tempOutColor *= _OutlineColor; + _OutlineColor = tempOutColor; + #endif + + result *= (1 - originalAlpha) * _OutlineAlpha; + + half4 outline = _OutlineColor * d.vertexColor.a; + outline.rgb *= _OutlineGlow; + outline.a = result; + #if ONLYOUTLINE_ON + col = outline; + #else + col = lerp(col, outline, result); + #endif + #endif + //------------------------------------------------------- + + //FADE_ON + #if FADE_ON + half2 tiledUvFade1 = TRANSFORM_TEX(d.texcoord0, _FadeTex); + half2 tiledUvFade2 = TRANSFORM_TEX(d.texcoord0, _FadeBurnTex); + #if ATLAS_ON + tiledUvFade1 = half2((tiledUvFade1.x - _MinXUV) / (_MaxXUV - _MinXUV), (tiledUvFade1.y - _MinYUV) / (_MaxYUV - _MinYUV)); + tiledUvFade2 = half2((tiledUvFade2.x - _MinXUV) / (_MaxXUV - _MinXUV), (tiledUvFade2.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half fadeTemp = SAMPLE_TEXTURE2D(_FadeTex, sampler_FadeTex, tiledUvFade1).r; + half fade = smoothstep(_FadeAmount, _FadeAmount + _FadeBurnTransition, fadeTemp); + half fadeBurn = saturate(smoothstep(_FadeAmount - _FadeBurnWidth, _FadeAmount - _FadeBurnWidth + 0.1, fadeTemp) * _FadeAmount); + col.a *= fade; + _FadeBurnColor.rgb *= _FadeBurnGlow; + col += fadeBurn * SAMPLE_TEXTURE2D(_FadeBurnTex, sampler_FadeBurnTex, tiledUvFade2) * _FadeBurnColor * originalAlpha * (1 - col.a); + #endif + //------------------------------------------------------- + + //SHADOW_ON + #if SHADOW_ON + half shadowA = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(_ShadowX, _ShadowY)).a; + half preMultShadowMask = 1 - (saturate(shadowA - col.a) * (1 - col.a)); + col.rgb *= 1 - ((shadowA - col.a) * (1 - col.a)); + col.rgb += (_ShadowColor * shadowA) * (1 - col.a); + col.a = max(shadowA * _ShadowAlpha * d.vertexColor.a, col.a); + #endif + + //------------------------------------------------------- + + //GLOW_ON + #if GLOW_ON + half4 emission; + #if GLOWTEX_ON + emission = SAMPLE_TEXTURE2D(_GlowTex, sampler_GlowTex, d.texcoord0); + #else + emission = col; + #endif + + col.rgb *= _GlowGlobal; + emission.rgb *= emission.a * col.a * _Glow * _GlowColor; + col.rgb += emission.rgb; + #endif + //------------------------------------------------------- + + //COLORRAMP_ON && COLORRAMPOUTLINE_ON + #if COLORRAMP_ON && COLORRAMPOUTLINE_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + luminance = saturate(luminance + _ColorRampLuminosity); + #if GRADIENTCOLORRAMP_ON + col.rgb = lerp(col.rgb, SAMPLE_TEXTURE2D(_ColorRampTexGradient, sampler_ColorRampTexGradient, half2(luminance, 0)).rgb, _ColorRampBlend); + #else + col.rgb = lerp(col.rgb, SAMPLE_TEXTURE2D(_ColorRampTex, sampler_ColorRampTex, half2(luminance, 0)).rgb, _ColorRampBlend); + #endif + #endif + //--------------- + + //GREYSCALE_ON && GREYSCALEOUTLINE_ON + #if GREYSCALE_ON && GREYSCALEOUTLINE_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + luminance = saturate(luminance + _GreyscaleLuminosity); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _GreyscaleTintColor, _GreyscaleBlend); + #endif + + //----------------------------------- + + //POSTERIZE_ON && POSTERIZEOUTLINE_ON + #if POSTERIZE_ON && POSTERIZEOUTLINE_ON + col.rgb = pow(col.rgb, _PosterizeGamma) * _PosterizeNumColors; + col.rgb = floor(col.rgb) / _PosterizeNumColors; + col.rgb = pow(col.rgb, 1.0 / _PosterizeGamma); + #endif + + //----------------------------------- + + //SHINE_ON + #if SHINE_ON + half2 uvShine = uvRect; + half cosAngle = cos(_ShineRotate); + half sinAngle = sin(_ShineRotate); + half2x2 rot = half2x2(cosAngle, -sinAngle, sinAngle, cosAngle); + uvShine -= half2(0.5, 0.5); + uvShine = mul(rot, uvShine); + uvShine += half2(0.5, 0.5); + half shineMask = SAMPLE_TEXTURE2D(_ShineMask, sampler_ShineMask, d.texcoord0.xy).a; + half currentDistanceProjection = (uvShine.x + uvShine.y) / 2; + half whitePower = 1 - (abs(currentDistanceProjection - _ShineLocation) / _ShineWidth); + col.rgb += col.a * whitePower * _ShineGlow * max(sign(currentDistanceProjection - (_ShineLocation - _ShineWidth)), 0.0) + * max(sign((_ShineLocation + _ShineWidth) - currentDistanceProjection), 0.0) * _ShineColor * shineMask; + #endif + + //----------------------------------- + + //HOLOGRAM_ON + #if HOLOGRAM_ON + half totalHologram = _HologramStripesAmount + _HologramUnmodAmount; + half hologramYCoord = ((uvRect.y + (((_Time.x + randomSeed) % 1) * _HologramStripesSpeed)) % totalHologram) / totalHologram; + hologramYCoord = abs(hologramYCoord); + half alpha = RemapFloat(saturate(hologramYCoord - (_HologramUnmodAmount/totalHologram)), 0.0, 1.0, _HologramMinAlpha, saturate(_HologramMaxAlpha)); + half hologramMask = max(sign((_HologramUnmodAmount/totalHologram) - hologramYCoord), 0.0); + half4 hologramResult = col; + hologramResult.a *= lerp(alpha, 1, hologramMask); + hologramResult.rgb *= max(1, _HologramMaxAlpha * max(sign(hologramYCoord - (_HologramUnmodAmount/totalHologram)), 0.0)); + hologramMask = 1 - step(0.01,hologramMask); + hologramResult.rgb += hologramMask * _HologramStripeColor * col.a; + col = lerp(col, hologramResult, _HologramBlend); + #endif + + //----------------------------------- + + //FLICKER_ON + #if FLICKER_ON + col.a *= saturate(col.a * step(frac(0.05 + (_Time.w + randomSeed) * _FlickerFreq), 1 - _FlickerPercent) + _FlickerAlpha); + #endif + //----------------------------------- + + //ALPHACUTOFF_ON + + //ALPHAROUND_ON + + //ALPHAOUTLINE_ON + #if ALPHAOUTLINE_ON + half alphaOutlineRes = pow(1 - col.a, max(_AlphaOutlinePower, 0.0001)) * step(_AlphaOutlineMinAlpha, col.a) * _AlphaOutlineBlend; + col.rgb = lerp(col.rgb, _AlphaOutlineColor.rgb * _AlphaOutlineGlow, alphaOutlineRes); + col.a = lerp(col.a, 1, alphaOutlineRes > 1); + #endif + //------------------------------------------------------- + + //FOG_ON + + //------------------ + + col *= _Color; + o.Albedo = col; + col.a *= _Alpha; + clip(col.a - _AlphaCutoffValue - 0.01); + o.Alpha = _Color.a; + } + + + + + + void ChainSurfaceFunction(inout Surface l, inout ShaderData d) + { + Ext_SurfaceFunction0(l, d); + // Ext_SurfaceFunction1(l, d); + // Ext_SurfaceFunction2(l, d); + // Ext_SurfaceFunction3(l, d); + // Ext_SurfaceFunction4(l, d); + // Ext_SurfaceFunction5(l, d); + // Ext_SurfaceFunction6(l, d); + // Ext_SurfaceFunction7(l, d); + // Ext_SurfaceFunction8(l, d); + // Ext_SurfaceFunction9(l, d); + // Ext_SurfaceFunction10(l, d); + // Ext_SurfaceFunction11(l, d); + // Ext_SurfaceFunction12(l, d); + // Ext_SurfaceFunction13(l, d); + // Ext_SurfaceFunction14(l, d); + // Ext_SurfaceFunction15(l, d); + // Ext_SurfaceFunction16(l, d); + // Ext_SurfaceFunction17(l, d); + // Ext_SurfaceFunction18(l, d); + // Ext_SurfaceFunction19(l, d); + // Ext_SurfaceFunction20(l, d); + // Ext_SurfaceFunction21(l, d); + // Ext_SurfaceFunction22(l, d); + // Ext_SurfaceFunction23(l, d); + // Ext_SurfaceFunction24(l, d); + // Ext_SurfaceFunction25(l, d); + // Ext_SurfaceFunction26(l, d); + // Ext_SurfaceFunction27(l, d); + // Ext_SurfaceFunction28(l, d); + // Ext_SurfaceFunction29(l, d); + } + +#if !_DECALSHADER + + void ChainModifyVertex(inout VertexData v, inout VertexToPixel v2p, float4 time) + { + ExtraV2F d; + + ZERO_INITIALIZE(ExtraV2F, d); + ZERO_INITIALIZE(Blackboard, d.blackboard); + // due to motion vectors in HDRP, we need to use the last + // time in certain spots. So if you are going to use _Time to adjust vertices, + // you need to use this time or motion vectors will break. + d.time = time; + + Ext_ModifyVertex0(v, d); + // Ext_ModifyVertex1(v, d); + // Ext_ModifyVertex2(v, d); + // Ext_ModifyVertex3(v, d); + // Ext_ModifyVertex4(v, d); + // Ext_ModifyVertex5(v, d); + // Ext_ModifyVertex6(v, d); + // Ext_ModifyVertex7(v, d); + // Ext_ModifyVertex8(v, d); + // Ext_ModifyVertex9(v, d); + // Ext_ModifyVertex10(v, d); + // Ext_ModifyVertex11(v, d); + // Ext_ModifyVertex12(v, d); + // Ext_ModifyVertex13(v, d); + // Ext_ModifyVertex14(v, d); + // Ext_ModifyVertex15(v, d); + // Ext_ModifyVertex16(v, d); + // Ext_ModifyVertex17(v, d); + // Ext_ModifyVertex18(v, d); + // Ext_ModifyVertex19(v, d); + // Ext_ModifyVertex20(v, d); + // Ext_ModifyVertex21(v, d); + // Ext_ModifyVertex22(v, d); + // Ext_ModifyVertex23(v, d); + // Ext_ModifyVertex24(v, d); + // Ext_ModifyVertex25(v, d); + // Ext_ModifyVertex26(v, d); + // Ext_ModifyVertex27(v, d); + // Ext_ModifyVertex28(v, d); + // Ext_ModifyVertex29(v, d); + + + // #if %EXTRAV2F0REQUIREKEY% + // v2p.extraV2F0 = d.extraV2F0; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // v2p.extraV2F1 = d.extraV2F1; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // v2p.extraV2F2 = d.extraV2F2; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // v2p.extraV2F3 = d.extraV2F3; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // v2p.extraV2F4 = d.extraV2F4; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // v2p.extraV2F5 = d.extraV2F5; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // v2p.extraV2F6 = d.extraV2F6; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // v2p.extraV2F7 = d.extraV2F7; + // #endif + } + + void ChainModifyTessellatedVertex(inout VertexData v, inout VertexToPixel v2p) + { + ExtraV2F d; + ZERO_INITIALIZE(ExtraV2F, d); + ZERO_INITIALIZE(Blackboard, d.blackboard); + + // #if %EXTRAV2F0REQUIREKEY% + // d.extraV2F0 = v2p.extraV2F0; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // d.extraV2F1 = v2p.extraV2F1; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // d.extraV2F2 = v2p.extraV2F2; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // d.extraV2F3 = v2p.extraV2F3; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // d.extraV2F4 = v2p.extraV2F4; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // d.extraV2F5 = v2p.extraV2F5; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // d.extraV2F6 = v2p.extraV2F6; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // d.extraV2F7 = v2p.extraV2F7; + // #endif + + + // Ext_ModifyTessellatedVertex0(v, d); + // Ext_ModifyTessellatedVertex1(v, d); + // Ext_ModifyTessellatedVertex2(v, d); + // Ext_ModifyTessellatedVertex3(v, d); + // Ext_ModifyTessellatedVertex4(v, d); + // Ext_ModifyTessellatedVertex5(v, d); + // Ext_ModifyTessellatedVertex6(v, d); + // Ext_ModifyTessellatedVertex7(v, d); + // Ext_ModifyTessellatedVertex8(v, d); + // Ext_ModifyTessellatedVertex9(v, d); + // Ext_ModifyTessellatedVertex10(v, d); + // Ext_ModifyTessellatedVertex11(v, d); + // Ext_ModifyTessellatedVertex12(v, d); + // Ext_ModifyTessellatedVertex13(v, d); + // Ext_ModifyTessellatedVertex14(v, d); + // Ext_ModifyTessellatedVertex15(v, d); + // Ext_ModifyTessellatedVertex16(v, d); + // Ext_ModifyTessellatedVertex17(v, d); + // Ext_ModifyTessellatedVertex18(v, d); + // Ext_ModifyTessellatedVertex19(v, d); + // Ext_ModifyTessellatedVertex20(v, d); + // Ext_ModifyTessellatedVertex21(v, d); + // Ext_ModifyTessellatedVertex22(v, d); + // Ext_ModifyTessellatedVertex23(v, d); + // Ext_ModifyTessellatedVertex24(v, d); + // Ext_ModifyTessellatedVertex25(v, d); + // Ext_ModifyTessellatedVertex26(v, d); + // Ext_ModifyTessellatedVertex27(v, d); + // Ext_ModifyTessellatedVertex28(v, d); + // Ext_ModifyTessellatedVertex29(v, d); + + // #if %EXTRAV2F0REQUIREKEY% + // v2p.extraV2F0 = d.extraV2F0; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // v2p.extraV2F1 = d.extraV2F1; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // v2p.extraV2F2 = d.extraV2F2; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // v2p.extraV2F3 = d.extraV2F3; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // v2p.extraV2F4 = d.extraV2F4; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // v2p.extraV2F5 = d.extraV2F5; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // v2p.extraV2F6 = d.extraV2F6; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // v2p.extraV2F7 = d.extraV2F7; + // #endif + } + + void ChainFinalColorForward(inout Surface l, inout ShaderData d, inout half4 color) + { + // Ext_FinalColorForward0(l, d, color); + // Ext_FinalColorForward1(l, d, color); + // Ext_FinalColorForward2(l, d, color); + // Ext_FinalColorForward3(l, d, color); + // Ext_FinalColorForward4(l, d, color); + // Ext_FinalColorForward5(l, d, color); + // Ext_FinalColorForward6(l, d, color); + // Ext_FinalColorForward7(l, d, color); + // Ext_FinalColorForward8(l, d, color); + // Ext_FinalColorForward9(l, d, color); + // Ext_FinalColorForward10(l, d, color); + // Ext_FinalColorForward11(l, d, color); + // Ext_FinalColorForward12(l, d, color); + // Ext_FinalColorForward13(l, d, color); + // Ext_FinalColorForward14(l, d, color); + // Ext_FinalColorForward15(l, d, color); + // Ext_FinalColorForward16(l, d, color); + // Ext_FinalColorForward17(l, d, color); + // Ext_FinalColorForward18(l, d, color); + // Ext_FinalColorForward19(l, d, color); + // Ext_FinalColorForward20(l, d, color); + // Ext_FinalColorForward21(l, d, color); + // Ext_FinalColorForward22(l, d, color); + // Ext_FinalColorForward23(l, d, color); + // Ext_FinalColorForward24(l, d, color); + // Ext_FinalColorForward25(l, d, color); + // Ext_FinalColorForward26(l, d, color); + // Ext_FinalColorForward27(l, d, color); + // Ext_FinalColorForward28(l, d, color); + // Ext_FinalColorForward29(l, d, color); + } + + void ChainFinalGBufferStandard(inout Surface s, inout ShaderData d, inout half4 GBuffer0, inout half4 GBuffer1, inout half4 GBuffer2, inout half4 outEmission, inout half4 outShadowMask) + { + // Ext_FinalGBufferStandard0(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard1(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard2(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard3(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard4(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard5(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard6(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard7(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard8(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard9(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard10(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard11(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard12(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard13(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard14(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard15(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard16(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard17(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard18(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard19(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard20(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard21(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard22(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard23(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard24(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard25(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard26(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard27(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard28(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard29(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + } +#endif + + + + + +#if _DECALSHADER + + ShaderData CreateShaderData(SurfaceDescriptionInputs IN) + { + ShaderData d = (ShaderData)0; + d.TBNMatrix = float3x3(IN.WorldSpaceTangent, IN.WorldSpaceBiTangent, IN.WorldSpaceNormal); + d.worldSpaceNormal = IN.WorldSpaceNormal; + d.worldSpaceTangent = IN.WorldSpaceTangent; + + d.worldSpacePosition = IN.WorldSpacePosition; + d.texcoord0 = IN.uv0.xyxy; + d.screenPos = IN.ScreenPosition; + + d.worldSpaceViewDir = normalize(_WorldSpaceCameraPos - d.worldSpacePosition); + + d.tangentSpaceViewDir = mul(d.TBNMatrix, d.worldSpaceViewDir); + + // these rarely get used, so we back transform them. Usually will be stripped. + #if _HDRP + // d.localSpacePosition = mul(GetWorldToObjectMatrix(), float4(GetCameraRelativePositionWS(d.worldSpacePosition), 1)).xyz; + #else + // d.localSpacePosition = mul(GetWorldToObjectMatrix(), float4(d.worldSpacePosition, 1)).xyz; + #endif + // d.localSpaceNormal = normalize(mul((float3x3)GetWorldToObjectMatrix(), d.worldSpaceNormal)); + // d.localSpaceTangent = normalize(mul((float3x3)GetWorldToObjectMatrix(), d.worldSpaceTangent.xyz)); + + // #if %SCREENPOSREQUIREKEY% + // d.screenUV = (IN.ScreenPosition.xy / max(0.01, IN.ScreenPosition.w)); + // #endif + + return d; + } +#else + + ShaderData CreateShaderData(VertexToPixel i + #if NEED_FACING + , bool facing + #endif + ) + { + ShaderData d = (ShaderData)0; + d.clipPos = i.pos; + d.worldSpacePosition = i.worldPos; + + d.worldSpaceNormal = normalize(i.worldNormal); + d.worldSpaceTangent.xyz = normalize(i.worldTangent.xyz); + + d.tangentSign = i.worldTangent.w * unity_WorldTransformParams.w; + float3 bitangent = cross(d.worldSpaceTangent.xyz, d.worldSpaceNormal) * d.tangentSign; + + d.TBNMatrix = float3x3(d.worldSpaceTangent, -bitangent, d.worldSpaceNormal); + d.worldSpaceViewDir = normalize(_WorldSpaceCameraPos - i.worldPos); + + d.tangentSpaceViewDir = mul(d.TBNMatrix, d.worldSpaceViewDir); + d.texcoord0 = i.texcoord0; + d.texcoord1 = i.texcoord1; + d.texcoord2 = i.texcoord2; + + // #if %TEXCOORD3REQUIREKEY% + d.texcoord3 = i.texcoord3; + // #endif + + // d.isFrontFace = facing; + // #if %VERTEXCOLORREQUIREKEY% + d.vertexColor = i.vertexColor; + // #endif + + // these rarely get used, so we back transform them. Usually will be stripped. + #if _HDRP + // d.localSpacePosition = mul(GetWorldToObjectMatrix(), float4(GetCameraRelativePositionWS(i.worldPos), 1)).xyz; + #else + // d.localSpacePosition = mul(GetWorldToObjectMatrix(), float4(i.worldPos, 1)).xyz; + #endif + // d.localSpaceNormal = normalize(mul((float3x3)GetWorldToObjectMatrix(), i.worldNormal)); + // d.localSpaceTangent = normalize(mul((float3x3)GetWorldToObjectMatrix(), i.worldTangent.xyz)); + + // #if %SCREENPOSREQUIREKEY% + // d.screenPos = i.screenPos; + // d.screenUV = (i.screenPos.xy / i.screenPos.w); + // #endif + + + // #if %EXTRAV2F0REQUIREKEY% + // d.extraV2F0 = i.extraV2F0; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // d.extraV2F1 = i.extraV2F1; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // d.extraV2F2 = i.extraV2F2; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // d.extraV2F3 = i.extraV2F3; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // d.extraV2F4 = i.extraV2F4; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // d.extraV2F5 = i.extraV2F5; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // d.extraV2F6 = i.extraV2F6; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // d.extraV2F7 = i.extraV2F7; + // #endif + + return d; + } + +#endif + + + #if defined(_PASSSHADOW) + float3 _LightDirection; + float3 _LightPosition; + #endif + + #if (_PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR))) + + #define GetWorldToViewMatrix() _ViewMatrix + #define UNITY_MATRIX_I_V _InvViewMatrix + #define GetViewToHClipMatrix() OptimizeProjectionMatrix(_ProjMatrix) + #define UNITY_MATRIX_I_P _InvProjMatrix + #define GetWorldToHClipMatrix() _ViewProjMatrix + #define UNITY_MATRIX_I_VP _InvViewProjMatrix + #define UNITY_MATRIX_UNJITTERED_VP _NonJitteredViewProjMatrix + #define UNITY_MATRIX_PREV_VP _PrevViewProjMatrix + #define UNITY_MATRIX_PREV_I_VP _PrevInvViewProjMatrix + + void MotionVectorPositionZBias(VertexToPixel input) + { + #if UNITY_REVERSED_Z + input.pos.z -= unity_MotionVectorsParams.z * input.pos.w; + #else + input.pos.z += unity_MotionVectorsParams.z * input.pos.w; + #endif + } + + #endif + + // vertex shader + VertexToPixel Vert (VertexData v) + { + VertexToPixel o = (VertexToPixel)0; + + UNITY_SETUP_INSTANCE_ID(v); + UNITY_TRANSFER_INSTANCE_ID(v, o); + UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o); + + + #if _URP && (_PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR))) + VertexData previousMesh = v; + #endif + #if !_TESSELLATION_ON + ChainModifyVertex(v, o, _Time); + #endif + + o.texcoord0 = v.texcoord0; + o.texcoord1 = v.texcoord1; + o.texcoord2 = v.texcoord2; + + // #if %TEXCOORD3REQUIREKEY% + o.texcoord3 = v.texcoord3; + // #endif + + // #if %VERTEXCOLORREQUIREKEY% + o.vertexColor = v.vertexColor; + // #endif + + // This return the camera relative position (if enable) + float3 positionWS = TransformObjectToWorld(v.vertex.xyz); + float3 normalWS = TransformObjectToWorldNormal(v.normal); + float4 tangentWS = float4(TransformObjectToWorldDir(v.tangent.xyz), v.tangent.w); + + VertexPositionInputs vertexInput = GetVertexPositionInputs(v.vertex.xyz); + o.worldPos = positionWS; + o.worldNormal = normalWS; + o.worldTangent = tangentWS; + + + // For some very odd reason, in 2021.2, we can't use Unity's defines, but have to use our own.. + #if _PASSSHADOW + #if _CASTING_PUNCTUAL_LIGHT_SHADOW + float3 lightDirectionWS = normalize(_LightPosition - o.worldPos); + #else + float3 lightDirectionWS = _LightDirection; + #endif + // Define shadow pass specific clip position for Universal + o.pos = TransformWorldToHClip(ApplyShadowBias(o.worldPos, o.worldNormal, lightDirectionWS)); + #if UNITY_REVERSED_Z + o.pos.z = min(o.pos.z, UNITY_NEAR_CLIP_VALUE); + #else + o.pos.z = max(o.pos.z, UNITY_NEAR_CLIP_VALUE); + #endif + #elif _PASSMETA + o.pos = MetaVertexPosition(float4(v.vertex.xyz, 0), v.texcoord1.xy, v.texcoord2.xy, unity_LightmapST, unity_DynamicLightmapST); + #else + o.pos = TransformWorldToHClip(o.worldPos); + #endif + + // #if %SCREENPOSREQUIREKEY% + // o.screenPos = ComputeScreenPos(o.pos, _ProjectionParams.x); + // #endif + + + #if _PASSFORWARD || _PASSGBUFFER + float2 uv1 = v.texcoord1.xy; + OUTPUT_LIGHTMAP_UV(uv1, unity_LightmapST, o.lightmapUV); + o.texcoord1.xy = uv1; + #if UNITY_VERSION < 60000009 + OUTPUT_SH(o.worldNormal, o.sh); + #endif + + #if defined(DYNAMICLIGHTMAP_ON) + o.dynamicLightmapUV.xy = v.texcoord2.xy * unity_DynamicLightmapST.xy + unity_DynamicLightmapST.zw; + #if UNITY_VERSION >= 60000009 + OUTPUT_SH(o.worldNormal, o.sh); + #endif + #elif (defined(PROBE_VOLUMES_L1) || defined(PROBE_VOLUMES_L2)) && UNITY_VERSION >= 60000009 + OUTPUT_SH4(vertexInput.positionWS, o.worldNormal.xyz, GetWorldSpaceNormalizeViewDir(vertexInput.positionWS), o.sh, o.probeOcclusion); + #endif + #endif + + #ifdef VARYINGS_NEED_FOG_AND_VERTEX_LIGHT + half fogFactor = 0; + #if defined(_FOG_FRAGMENT) + fogFactor = ComputeFogFactor(o.pos.z); + #endif + #if _BAKEDLIT + o.fogFactorAndVertexLight = half4(fogFactor, 0, 0, 0); + #else + half3 vertexLight = VertexLighting(o.worldPos, o.worldNormal); + o.fogFactorAndVertexLight = half4(fogFactor, vertexLight); + #endif + #endif + + #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR) + o.shadowCoord = GetShadowCoord(vertexInput); + #endif + + #if _URP && (_PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR))) + #if !defined(TESSELLATION_ON) + MotionVectorPositionZBias(o); + #endif + + o.previousPositionCS = float4(0.0, 0.0, 0.0, 1.0); + // Note: unity_MotionVectorsParams.y is 0 is forceNoMotion is enabled + bool forceNoMotion = unity_MotionVectorsParams.y == 0.0; + + if (!forceNoMotion) + { + #if defined(HAVE_VFX_MODIFICATION) + float3 previousPositionOS = currentFrameMvData.vfxParticlePositionOS; + #if defined(VFX_FEATURE_MOTION_VECTORS_VERTS) + const bool applyDeformation = false; + #else + const bool applyDeformation = true; + #endif + #else + const bool hasDeformation = unity_MotionVectorsParams.x == 1; // Mesh has skinned deformation + float3 previousPositionOS = hasDeformation ? previousMesh.previousPositionOS : previousMesh.vertex.xyz; + + #if defined(AUTOMATIC_TIME_BASED_MOTION_VECTORS) && defined(GRAPH_VERTEX_USES_TIME_PARAMETERS_INPUT) + const bool applyDeformation = true; + #else + const bool applyDeformation = hasDeformation; + #endif + #endif + // TODO + #if defined(FEATURES_GRAPH_VERTEX) + if (applyDeformation) + previousPositionOS = GetLastFrameDeformedPosition(previousMesh, currentFrameMvData, previousPositionOS); + else + previousPositionOS = previousMesh.positionOS; + + #if defined(FEATURES_GRAPH_VERTEX_MOTION_VECTOR_OUTPUT) + previousPositionOS -= previousMesh.precomputedVelocity; + #endif + #endif + + #if defined(UNITY_DOTS_INSTANCING_ENABLED) && defined(DOTS_DEFORMED) + // Deformed vertices in DOTS are not cumulative with built-in Unity skinning/blend shapes + // Needs to be called after vertex modification has been applied otherwise it will be + // overwritten by Compute Deform node + ApplyPreviousFrameDeformedVertexPosition(previousMesh.vertexID, previousPositionOS); + #endif + #if defined (_ADD_PRECOMPUTED_VELOCITY) + previousPositionOS -= previousMesh.precomputedVelocity; + #endif + o.positionCS = mul(UNITY_MATRIX_UNJITTERED_VP, float4(positionWS, 1.0f)); + + #if defined(HAVE_VFX_MODIFICATION) + #if defined(VFX_FEATURE_MOTION_VECTORS_VERTS) + #if defined(FEATURES_GRAPH_VERTEX_MOTION_VECTOR_OUTPUT) || defined(_ADD_PRECOMPUTED_VELOCITY) + #error Unexpected fast path rendering VFX motion vector while there are vertex modification afterwards. + #endif + o.previousPositionCS = VFXGetPreviousClipPosition(previousMesh, currentFrameMvData.vfxElementAttributes, o.positionCS); + #else + #if VFX_WORLD_SPACE + //previousPositionOS is already in world space + const float3 previousPositionWS = previousPositionOS; + #else + const float3 previousPositionWS = mul(UNITY_PREV_MATRIX_M, float4(previousPositionOS, 1.0f)).xyz; + #endif + o.previousPositionCS = mul(UNITY_MATRIX_PREV_VP, float4(previousPositionWS, 1.0f)); + #endif + #else + o.previousPositionCS = mul(UNITY_MATRIX_PREV_VP, mul(UNITY_PREV_MATRIX_M, float4(previousPositionOS, 1))); + #endif + } + #endif + + return o; + } + + + + + // Using parts of com.unity.render-pipelines.universal\Editor\ShaderGraph\Includes\MotionVectorPass.hlsl + // com.unity.render-pipelines.universal\ShaderLibrary\MotionVectorsCommon.hlsl + // com.unity.render-pipelines.universal\Editor\ShaderGraph\Includes\Varyings.hlsl + + float2 CalcNdcMotionVectorFromCsPositions(float4 posCS, float4 prevPosCS) + { + // Note: unity_MotionVectorsParams.y is 0 is forceNoMotion is enabled + bool forceNoMotion = unity_MotionVectorsParams.y == 0.0; + if (forceNoMotion) + return float2(0.0, 0.0); + + // Non-uniform raster needs to keep the posNDC values in float to avoid additional conversions + // since uv remap functions use floats + float2 posNDC = posCS.xy * rcp(posCS.w); + float2 prevPosNDC = prevPosCS.xy * rcp(prevPosCS.w); + + float2 velocity; + #if defined(SUPPORTS_FOVEATED_RENDERING_NON_UNIFORM_RASTER) + UNITY_BRANCH if (_FOVEATED_RENDERING_NON_UNIFORM_RASTER) + { + // Convert velocity from NDC space (-1..1) to screen UV 0..1 space since FoveatedRendering remap needs that range. + float2 posUV = RemapFoveatedRenderingResolve(posNDC * 0.5 + 0.5); + float2 prevPosUV = RemapFoveatedRenderingPrevFrameLinearToNonUniform(prevPosNDC * 0.5 + 0.5); + + // Calculate forward velocity + velocity = (posUV - prevPosUV); + #if UNITY_UV_STARTS_AT_TOP + velocity.y = -velocity.y; + #endif + } + else + #endif + { + // Calculate forward velocity + velocity = (posNDC.xy - prevPosNDC.xy); + #if UNITY_UV_STARTS_AT_TOP + velocity.y = -velocity.y; + #endif + + // Convert velocity from NDC space (-1..1) to UV 0..1 space + // Note: It doesn't mean we don't have negative values, we store negative or positive offset in UV space. + // Note: ((posNDC * 0.5 + 0.5) - (prevPosNDC * 0.5 + 0.5)) = (velocity * 0.5) + velocity.xy *= 0.5; + } + + return velocity; + } + + float4 Frag( + VertexToPixel input) : SV_Target + { + UNITY_SETUP_INSTANCE_ID(input); + + float4 motionVector = float4(CalcNdcMotionVectorFromCsPositions(input.positionCS, input.previousPositionCS), 0, 0); + + return motionVector; + } + + ENDHLSL + } + + + + + + } + + + CustomEditor "AllIn1SpriteShaderLitMaterialInspector" +} diff --git a/Assets/Plugins/AllIn1SpriteShader/Shaders/AllIn1SpriteShaderLit.shader.meta b/Assets/Plugins/AllIn1SpriteShader/Shaders/AllIn1SpriteShaderLit.shader.meta new file mode 100644 index 000000000..c799c4fea --- /dev/null +++ b/Assets/Plugins/AllIn1SpriteShader/Shaders/AllIn1SpriteShaderLit.shader.meta @@ -0,0 +1,16 @@ +fileFormatVersion: 2 +guid: 86ce7e600deb17e429b8be445bb652f7 +ShaderImporter: + externalObjects: {} + defaultTextures: [] + nonModifiableTextures: [] + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 156513 + packageName: All In 1 Sprite Shader + packageVersion: 4.25 + assetPath: Assets/Plugins/AllIn1SpriteShader/Shaders/AllIn1SpriteShaderLit.shader + uploadId: 708810 diff --git a/Assets/Plugins/AllIn1SpriteShader/Shaders/AllIn1SpriteShaderScaledTime.shader b/Assets/Plugins/AllIn1SpriteShader/Shaders/AllIn1SpriteShaderScaledTime.shader new file mode 100644 index 000000000..c7ab18a1c --- /dev/null +++ b/Assets/Plugins/AllIn1SpriteShader/Shaders/AllIn1SpriteShaderScaledTime.shader @@ -0,0 +1,1236 @@ +Shader "AllIn1SpriteShader/AllIn1SpriteShaderScaledTime" +{ + Properties + { + _MainTex ("Main Texture", 2D) = "white" {} //0 + _Color("Main Color", Color) = (1,1,1,1) //1 + _Alpha("General Alpha", Range(0,1)) = 1 //2 + + _GlowColor("Glow Color", Color) = (1,1,1,1) //3 + _Glow("Glow Color Intensity", Range(0,100)) = 10 //4 + _GlowGlobal("Global Glow Intensity", Range(1,100)) = 1 //5 + [NoScaleOffset] _GlowTex("Glow Texture", 2D) = "white" {} //6 + + _FadeTex("Fade Texture", 2D) = "white" {} //7 + _FadeAmount("Fade Amount", Range(-0.1,1)) = -0.1 //8 + _FadeBurnWidth("Fade Burn Width", Range(0,1)) = 0.025 //9 + _FadeBurnTransition("Burn Transition", Range(0.01,0.5)) = 0.075 //10 + _FadeBurnColor("Fade Burn Color", Color) = (1,1,0,1) //11 + _FadeBurnTex("Fade Burn Texture", 2D) = "white" {} //12 + _FadeBurnGlow("Fade Burn Glow", Range(1,250)) = 2//13 + + _OutlineColor("Outline Base Color", Color) = (1,1,1,1) //14 + _OutlineAlpha("Outline Base Alpha", Range(0,1)) = 1 //15 + _OutlineGlow("Outline Base Glow", Range(1,100)) = 1.5 //16 + _OutlineWidth("Outline Base Width", Range(0,0.2)) = 0.004 //17 + _OutlinePixelWidth("Outline Base Pixel Width", Int) = 1 //18 + + [Space] + _OutlineTex("Outline Texture", 2D) = "white" {} //19 + _OutlineTexXSpeed("Texture scroll speed X", Range(-50,50)) = 10 //20 + _OutlineTexYSpeed("Texture scroll speed Y", Range(-50,50)) = 0 //21 + + [Space] + _OutlineDistortTex("Outline Distortion Texture", 2D) = "white" {} //22 + _OutlineDistortAmount("Outline Distortion Amount", Range(0,2)) = 0.5 //23 + _OutlineDistortTexXSpeed("Distortion scroll speed X", Range(-50,50)) = 5 //24 + _OutlineDistortTexYSpeed("Distortion scroll speed Y", Range(-50,50)) = 5 //25 + + _AlphaOutlineColor("Color", Color) = (1, 1, 1, 1) //26 + _AlphaOutlineGlow("Outline Glow", Range(1,100)) = 5 //27 + _AlphaOutlinePower("Power", Range(0, 5)) = 1 // 28 + _AlphaOutlineMinAlpha("Min Alpha", Range(0, 1)) = 0 // 29 + _AlphaOutlineBlend("Blend", Range(0, 1)) = 1 // 30 + + _GradBlend("Gradient Blend", Range(0,1)) = 1 //31 + _GradTopLeftCol("Top Color", Color) = (1,0,0,1) //32 + _GradTopRightCol("Top Color 2", Color) = (1, 1, 0, 1) //33 + _GradBotLeftCol("Bot Color", Color) = (0,0,1,1) //34 + _GradBotRightCol("Bot Color 2", Color) = (0, 1, 0, 1) //35 + + [NoScaleOffset] _ColorSwapTex("Color Swap Texture", 2D) = "black" {} //36 + [HDR] _ColorSwapRed("Red Channel", Color) = (1,1,1,1) //37 + _ColorSwapRedLuminosity("Red luminosity", Range(-1,1)) = 0.5 //38 + [HDR] _ColorSwapGreen("Green Channel", Color) = (1,1,1,1) //39 + _ColorSwapGreenLuminosity("Green luminosity", Range(-1,1)) = 0.5 //40 + [HDR] _ColorSwapBlue("Blue Channel", Color) = (1,1,1,1) //41 + _ColorSwapBlueLuminosity("Blue luminosity", Range(-1,1)) = 0.5 //42 + + _HsvShift("Hue Shift", Range(0, 360)) = 180 //43 + _HsvSaturation("Saturation", Range(0, 2)) = 1 //44 + _HsvBright("Brightness", Range(0, 2)) = 1 //45 + + _HitEffectColor("Hit Effect Color", Color) = (1,1,1,1) //46 + _HitEffectGlow("Glow Intensity", Range(1,100)) = 5 //47 + [Space] + _HitEffectBlend("Hit Effect Blend", Range(0,1)) = 1 //48 + + _NegativeAmount("Negative Amount", Range(0, 1)) = 1 //49 + + _PixelateSize("Pixelate size", Range(4,512)) = 32 //50 + + [NoScaleOffset] _ColorRampTex("Color ramp Texture", 2D) = "white" {} //51 + _ColorRampLuminosity("Color ramp luminosity", Range(-1,1)) = 0 //52 + [Toggle()] _ColorRampOutline("Affects everything?", float) = 0 //53 + + _GreyscaleLuminosity("Greyscale luminosity", Range(-1,1)) = 0 //54 + [Toggle()] _GreyscaleOutline("Affects everything?", float) = 0 //55 + _GreyscaleTintColor("Greyscale Tint Color", Color) = (1,1,1,1) //56 + + _PosterizeNumColors("Number of Colors", Range(0,100)) = 8 //57 + _PosterizeGamma("Posterize Amount", Range(0.1,10)) = 0.75 //58 + [Toggle()] _PosterizeOutline("Affects everything?", float) = 0 //59 + + _BlurIntensity("Blur Intensity", Range(0,100)) = 10 //60 + [Toggle()] _BlurHD("Blur is Low Res?", float) = 0 //61 + + _MotionBlurAngle("Motion Blur Angle", Range(-1, 1)) = 0.1 //62 + _MotionBlurDist("Motion Blur Distance", Range(-3, 3)) = 1.25 //63 + + _GhostColorBoost("Ghost Color Boost", Range(0,5)) = 1 //64 + _GhostTransparency("Ghost Transparency", Range(0,1)) = 0 //65 + + _InnerOutlineColor("Inner Outline Color", Color) = (1,0,0,1) //66 + _InnerOutlineThickness("Outline Thickness", Range(0,3)) = 1 //67 + _InnerOutlineAlpha("Inner Outline Alpha", Range(0,1)) = 1 //68 + _InnerOutlineGlow("Inner Outline Glow", Range(1,250)) = 4 //69 + + _AlphaCutoffValue("Alpha cutoff value", Range(0, 1)) = 0.25 //70 + + [Toggle()] _OnlyOutline("Only render outline?", float) = 0 //71 + [Toggle()] _OnlyInnerOutline("Only render inner outline?", float) = 0 //72 + + _HologramStripesAmount("Stripes Amount", Range(0, 1)) = 0.1 //73 + _HologramUnmodAmount("Unchanged Amount", Range(0, 1)) = 0.0 //74 + _HologramStripesSpeed("Stripes Speed", Range(-20, 20)) = 4.5 //75 + _HologramMinAlpha("Min Alpha", Range(0, 1)) = 0.1 //76 + _HologramMaxAlpha("Max Alpha", Range(0, 100)) = 0.75 //77 + + _ChromAberrAmount("ChromAberr Amount", Range(0, 1)) = 1 //78 + _ChromAberrAlpha("ChromAberr Alpha", Range(0, 1)) = 0.4 //79 + + _GlitchAmount("Glitch Amount", Range(0, 20)) = 3 //80 + + _FlickerPercent("Flicker Percent", Range(0, 1)) = 0.05 //81 + _FlickerFreq("Flicker Frequency", Range(0, 5)) = 0.2 //82 + _FlickerAlpha("Flicker Alpha", Range(0, 1)) = 0 //83 + + _ShadowX("Shadow X Axis", Range(-0.5, 0.5)) = 0.1 //84 + _ShadowY("Shadow Y Axis", Range(-0.5, 0.5)) = -0.05 //85 + _ShadowAlpha("Shadow Alpha", Range(0, 1)) = 0.5 //86 + _ShadowColor("Shadow Color", Color) = (0, 0, 0, 1) //87 + + _HandDrawnAmount("Hand Drawn Amount", Range(0, 20)) = 10 //88 + _HandDrawnSpeed("Hand Drawn Speed", Range(1, 15)) = 5 //89 + + _GrassSpeed("Speed", Range(0,50)) = 2 //90 + _GrassWind("Bend amount", Range(0,50)) = 20 //91 + [Space] + [Toggle()] _GrassManualToggle("Manually animated?", float) = 0 //92 + _GrassManualAnim("Manual Anim Value", Range(-1,1)) = 1 //93 + + _WaveAmount("Wave Amount", Range(0, 25)) = 7 //94 + _WaveSpeed("Wave Speed", Range(0, 25)) = 10 //95 + _WaveStrength("Wave Strength", Range(0, 25)) = 7.5 //96 + _WaveX("Wave X Axis", Range(0, 1)) = 0 //97 + _WaveY("Wave Y Axis", Range(0, 1)) = 0.5 //98 + + _RectSize("Rect Size", Range(1, 4)) = 1 //99 + + _OffsetUvX("X axis", Range(-1, 1)) = 0 //100 + _OffsetUvY("Y axis", Range(-1, 1)) = 0 //101 + + _ClipUvLeft("Clipping Left", Range(0, 1)) = 0 //102 + _ClipUvRight("Clipping Right", Range(0, 1)) = 0 //103 + _ClipUvUp("Clipping Up", Range(0, 1)) = 0 //104 + _ClipUvDown("Clipping Down", Range(0, 1)) = 0 //105 + + _TextureScrollXSpeed("Speed X Axis", Range(-5, 5)) = 1 //106 + _TextureScrollYSpeed("Speed Y Axis", Range(-5, 5)) = 0 //107 + + _ZoomUvAmount("Zoom Amount", Range(0.1, 5)) = 0.5 //108 + + _DistortTex("Distortion Texture", 2D) = "white" {} //109 + _DistortAmount("Distortion Amount", Range(0,2)) = 0.5 //110 + _DistortTexXSpeed("Scroll speed X", Range(-50,50)) = 5 //111 + _DistortTexYSpeed("Scroll speed Y", Range(-50,50)) = 5 //112 + + _TwistUvAmount("Twist Amount", Range(0, 3.1416)) = 1 //113 + _TwistUvPosX("Twist Pos X Axis", Range(0, 1)) = 0.5 //114 + _TwistUvPosY("Twist Pos Y Axis", Range(0, 1)) = 0.5 //115 + _TwistUvRadius("Twist Radius", Range(0, 3)) = 0.75 //116 + + _RotateUvAmount("Rotate Angle(radians)", Range(0, 6.2831)) = 0 //117 + + _FishEyeUvAmount("Fish Eye Amount", Range(0, 0.5)) = 0.35 //118 + + _PinchUvAmount("Pinch Amount", Range(0, 0.5)) = 0.35 //119 + + _ShakeUvSpeed("Shake Speed", Range(0, 20)) = 2.5 //120 + _ShakeUvX("X Multiplier", Range(0, 5)) = 1.5 //121 + _ShakeUvY("Y Multiplier", Range(0, 5)) = 1 //122 + + _ColorChangeTolerance("Tolerance", Range(0, 1)) = 0.25 //123 + _ColorChangeTarget("Color to change", Color) = (1, 0, 0, 1) //124 + [HDR] _ColorChangeNewCol("New Color", Color) = (1, 1, 0, 1) //125 + _ColorChangeLuminosity("New Color Luminosity", Range(0, 1)) = 0.0 //126 + + _RoundWaveStrength("Wave Strength", Range(0, 1)) = 0.7 //127 + _RoundWaveSpeed("Wave Speed", Range(0, 5)) = 2 //128 + + [Toggle()] _BillboardY("Billboard on both axis?", float) = 0 //129 + _ZWrite ("Depth Write", Float) = 0.0 // 130 + + _MySrcMode ("SrcMode", Float) = 5 // 131 + _MyDstMode ("DstMode", Float) = 10 // 132 + + _ShineColor("Shine Color", Color) = (1,1,1,1) // 133 + _ShineLocation("Shine Location", Range(0,1)) = 0.5 // 134 + _ShineRotate("Rotate Angle(radians)", Range(0, 6.2831)) = 0 //135 + _ShineWidth("Shine Width", Range(0.05,1)) = 0.1 // 136 + _ShineGlow("Shine Glow", Range(0,100)) = 1 // 137 + [NoScaleOffset] _ShineMask("Shine Mask", 2D) = "white" {} // 138 + + _GlitchSize("Glitch Size", Range(0.25, 5)) = 1 //139 + _HologramStripeColor("Stripes Color", Color) = (0,1,1,1) //140 + _GradBoostX("Boost X axis", Range(0.1, 5)) = 1.2 //141 + _GradBoostY("Boost Y axis", Range(0.1, 5)) = 1.2 //142 + [Toggle()] _GradIsRadial("Radial Gradient?", float) = 0 //143 + _AlphaRoundThreshold("Round Threshold", Range(0.005, 1.0)) = 0.5 //144 + _GrassRadialBend("Radial Bend", Range(0.0, 5.0)) = 0.1 //145 + + _ColorChangeTolerance2("Tolerance 2", Range(0, 1)) = 0.25 //146 + _ColorChangeTarget2("Color to change 2", Color) = (1, 0, 0, 1) //147 + [HDR] _ColorChangeNewCol2("New Color 2", Color) = (1, 1, 0, 1) //148 + _ColorChangeTolerance3("Tolerance 3", Range(0, 1)) = 0.25 //149 + _ColorChangeTarget3("Color to change 3", Color) = (1, 0, 0, 1) //150 + [HDR] _ColorChangeNewCol3("New Color 3", Color) = (1, 1, 0, 1) //151 + + _Contrast ("Contrast", Range(0, 6)) = 1 // 152 + _Brightness ("Brightness", Range(-1, 1)) = 0 // 153 + + _ColorSwapBlend ("Color Swap Blend", Range(0, 1)) = 1 // 154 + _ColorRampBlend ("Color Ramp Blend", Range(0, 1)) = 1 // 155 + _GreyscaleBlend ("Greyscale Blend", Range(0, 1)) = 1 // 156 + _GhostBlend ("Ghost Blend", Range(0, 1)) = 1 // 157 + _HologramBlend ("Hologram Blend", Range(0, 1)) = 1 // 158 + + [AllIn1ShaderGradient] _ColorRampTexGradient("Color ramp Gradient", 2D) = "white" {} //159 + + _OverlayTex("Overlay Texture", 2D) = "white" {} //160 + _OverlayColor("Overlay Color", Color) = (1, 1, 1, 1) //161 + _OverlayGlow("Overlay Glow", Range(0,25)) = 1 // 162 + _OverlayBlend("Overlay Blend", Range(0, 1)) = 1 // 163 + + _RadialStartAngle("Radial Start Angle", Range(0, 360)) = 90 //164 + _RadialClip("Radial Clip", Range(0, 360)) = 45 //165 + _RadialClip2("Radial Clip 2", Range(0, 360)) = 0 //166 + + _WarpStrength("Warp Strength", Range(0, 0.1)) = 0.025 //167 + _WarpSpeed("Warp Speed", Range(0, 25)) = 8 //168 + _WarpScale("Warp Scale", Range(0.05, 3)) = 0.5 //169 + + _OverlayTextureScrollXSpeed("Speed X Axis", Range(-5, 5)) = 0.25 //170 + _OverlayTextureScrollYSpeed("Speed Y Axis", Range(-5, 5)) = 0.25 //171 + + _ZTestMode ("Z Test Mode", Float) = 4 + _CullingOption ("Culling Option", float) = 0 + + [HideInInspector] _MinXUV("_MinXUV", Range(0, 1)) = 0.0 + [HideInInspector] _MaxXUV("_MaxXUV", Range(0, 1)) = 1.0 + [HideInInspector] _MinYUV("_MinYUV", Range(0, 1)) = 0.0 + [HideInInspector] _MaxYUV("_MaxYUV", Range(0, 1)) = 1.0 + [HideInInspector] _RandomSeed("_MaxYUV", Range(0, 10000)) = 0.0 + _EditorDrawers("Editor Drawers", Int) = 6 + } + + SubShader + { + Tags { "Queue" = "Transparent" "CanUseSpriteAtlas" = "True" "IgnoreProjector" = "True" "RenderType" = "Transparent" "PreviewType" = "Plane" } + Blend [_MySrcMode] [_MyDstMode] + Cull [_CullingOption] + ZWrite [_ZWrite] + ZTest [_ZTestMode] + + Pass + { + CGPROGRAM + #pragma vertex vert + #pragma fragment frag + #pragma multi_compile_instancing + + #pragma shader_feature_local GLOW_ON + #pragma shader_feature_local FADE_ON + #pragma shader_feature_local OUTBASE_ON + #pragma shader_feature_local ONLYOUTLINE_ON + #pragma shader_feature_local GRADIENT_ON + #pragma shader_feature_local GRADIENT2COL_ON + #pragma shader_feature_local RADIALGRADIENT_ON + #pragma shader_feature_local COLORSWAP_ON + #pragma shader_feature_local HSV_ON + #pragma shader_feature_local CHANGECOLOR_ON + #pragma shader_feature_local CHANGECOLOR2_ON + #pragma shader_feature_local CHANGECOLOR3_ON + #pragma shader_feature_local COLORRAMP_ON + #pragma shader_feature_local GRADIENTCOLORRAMP_ON + #pragma shader_feature_local HITEFFECT_ON + #pragma shader_feature_local NEGATIVE_ON + #pragma shader_feature_local PIXELATE_ON + #pragma shader_feature_local GREYSCALE_ON + #pragma shader_feature_local POSTERIZE_ON + #pragma shader_feature_local BLUR_ON + #pragma shader_feature_local MOTIONBLUR_ON + #pragma shader_feature_local GHOST_ON + #pragma shader_feature_local ALPHAOUTLINE_ON + #pragma shader_feature_local INNEROUTLINE_ON + #pragma shader_feature_local ONLYINNEROUTLINE_ON + #pragma shader_feature_local HOLOGRAM_ON + #pragma shader_feature_local CHROMABERR_ON + #pragma shader_feature_local GLITCH_ON + #pragma shader_feature_local FLICKER_ON + #pragma shader_feature_local SHADOW_ON + #pragma shader_feature_local SHINE_ON + #pragma shader_feature_local CONTRAST_ON + #pragma shader_feature_local OVERLAY_ON + #pragma shader_feature_local OVERLAYMULT_ON + #pragma shader_feature_local ALPHACUTOFF_ON + #pragma shader_feature_local ALPHAROUND_ON + #pragma shader_feature_local DOODLE_ON + #pragma shader_feature_local WIND_ON + #pragma shader_feature_local WAVEUV_ON + #pragma shader_feature_local ROUNDWAVEUV_ON + #pragma shader_feature_local RECTSIZE_ON + #pragma shader_feature_local OFFSETUV_ON + #pragma shader_feature_local CLIPPING_ON + #pragma shader_feature_local RADIALCLIPPING_ON + #pragma shader_feature_local TEXTURESCROLL_ON + #pragma shader_feature_local ZOOMUV_ON + #pragma shader_feature_local DISTORT_ON + #pragma shader_feature_local WARP_ON + #pragma shader_feature_local TWISTUV_ON + #pragma shader_feature_local ROTATEUV_ON + #pragma shader_feature_local POLARUV_ON + #pragma shader_feature_local FISHEYE_ON + #pragma shader_feature_local PINCH_ON + #pragma shader_feature_local SHAKEUV_ON + + #pragma shader_feature_local GLOWTEX_ON + #pragma shader_feature_local OUTTEX_ON + #pragma shader_feature_local OUTDIST_ON + #pragma shader_feature_local OUTBASE8DIR_ON + #pragma shader_feature_local OUTBASEPIXELPERF_ON + #pragma shader_feature_local COLORRAMPOUTLINE_ON + #pragma shader_feature_local GREYSCALEOUTLINE_ON + #pragma shader_feature_local POSTERIZEOUTLINE_ON + #pragma shader_feature_local BLURISHD_ON + #pragma shader_feature_local MANUALWIND_ON + #pragma shader_feature ATLAS_ON + #pragma shader_feature PREMULTIPLYALPHA_ON + + #pragma shader_feature BILBOARD_ON + #pragma shader_feature BILBOARDY_ON + #pragma shader_feature FOG_ON + + #include "UnityCG.cginc" + #include "AllIn1OneShaderFunctions.cginc" + + #if FOG_ON + #pragma multi_compile_fog + #endif + + struct appdata + { + float4 vertex : POSITION; + float2 uv : TEXCOORD0; + half4 color : COLOR; + UNITY_VERTEX_INPUT_INSTANCE_ID + }; + + struct v2f + { + float2 uv : TEXCOORD0; + float4 vertex : SV_POSITION; + half4 color : COLOR; + #if OUTTEX_ON + half2 uvOutTex : TEXCOORD1; + #endif + #if OUTDIST_ON + half2 uvOutDistTex : TEXCOORD2; + #endif + #if DISTORT_ON + half2 uvDistTex : TEXCOORD3; + #endif + #if FOG_ON + UNITY_FOG_COORDS(4) + #endif + UNITY_VERTEX_INPUT_INSTANCE_ID + UNITY_VERTEX_OUTPUT_STEREO + }; + + float globalUnscaledTime; + + sampler2D _MainTex; + half4 _MainTex_ST, _MainTex_TexelSize, _Color; + half _Alpha; + + #if ATLAS_ON + half _MinXUV, _MaxXUV, _MinYUV, _MaxYUV; + #endif + + #if RECTSIZE_ON + half _RectSize; + #endif + + #if OFFSETUV_ON + half _OffsetUvX, _OffsetUvY; + #endif + + #if CLIPPING_ON + half _ClipUvLeft, _ClipUvRight, _ClipUvUp, _ClipUvDown; + #endif + + #if RADIALCLIPPING_ON + half _RadialStartAngle, _RadialClip, _RadialClip2; + #endif + + #if TWISTUV_ON + half _TwistUvAmount, _TwistUvPosX, _TwistUvPosY, _TwistUvRadius; + #endif + + #if ROTATEUV_ON + half _RotateUvAmount; + #endif + + #if FISHEYE_ON + half _FishEyeUvAmount; + #endif + + #if PINCH_ON + half _PinchUvAmount; + #endif + + #if DOODLE_ON + half _HandDrawnAmount, _HandDrawnSpeed; + #endif + + #if SHAKEUV_ON + half _ShakeUvSpeed, _ShakeUvX, _ShakeUvY; + #endif + + #if WAVEUV_ON + float _WaveAmount, _WaveSpeed, _WaveStrength, _WaveX, _WaveY; + #endif + + #if ROUNDWAVEUV_ON + half _RoundWaveStrength, _RoundWaveSpeed; + #endif + + #if ZOOMUV_ON + half _ZoomUvAmount; + #endif + + #if FADE_ON + sampler2D _FadeTex, _FadeBurnTex; + half4 _FadeBurnColor, _FadeTex_ST, _FadeBurnTex_ST; + half _FadeAmount, _FadeBurnWidth, _FadeBurnTransition,_FadeBurnGlow; + #endif + + #if TEXTURESCROLL_ON + half _TextureScrollXSpeed, _TextureScrollYSpeed; + #endif + + #if GLOW_ON + sampler2D _GlowTex; + half4 _GlowColor; + half _Glow, _GlowGlobal; + #endif + + #if OUTBASE_ON + half4 _OutlineColor; + half _OutlineAlpha, _OutlineGlow, _OutlineWidth; + int _OutlinePixelWidth; + #endif + + #if OUTTEX_ON + sampler2D _OutlineTex; + half4 _OutlineTex_ST; + half _OutlineTexXSpeed, _OutlineTexYSpeed; + #endif + + #if OUTDIST_ON + sampler2D _OutlineDistortTex; + half4 _OutlineDistortTex_ST; + half _OutlineDistortTexXSpeed, _OutlineDistortTexYSpeed, _OutlineDistortAmount; + #endif + + #if DISTORT_ON + sampler2D _DistortTex; + half4 _DistortTex_ST; + half _DistortTexXSpeed, _DistortTexYSpeed, _DistortAmount; + #endif + + #if WARP_ON + half _WarpStrength, _WarpSpeed, _WarpScale; + #endif + + #if WIND_ON + half _GrassSpeed, _GrassWind, _GrassManualAnim, _GrassRadialBend; + #endif + + #if GRADIENT_ON + half _GradBlend, _GradBoostX, _GradBoostY; + half4 _GradTopRightCol, _GradTopLeftCol, _GradBotRightCol, _GradBotLeftCol; + #endif + + #if COLORSWAP_ON + sampler2D _ColorSwapTex; + half4 _ColorSwapRed, _ColorSwapGreen, _ColorSwapBlue; + half _ColorSwapRedLuminosity, _ColorSwapGreenLuminosity, _ColorSwapBlueLuminosity, _ColorSwapBlend; + #endif + + #if HSV_ON + half _HsvShift, _HsvSaturation, _HsvBright; + #endif + + #if HITEFFECT_ON + half4 _HitEffectColor; + half _HitEffectGlow, _HitEffectBlend; + #endif + + #if PIXELATE_ON + half _PixelateSize; + #endif + + #if NEGATIVE_ON + half _NegativeAmount; + #endif + + #if COLORRAMP_ON + sampler2D _ColorRampTex, _ColorRampTexGradient; + half _ColorRampLuminosity, _ColorRampBlend; + #endif + + #if GREYSCALE_ON + half _GreyscaleLuminosity, _GreyscaleBlend; + half4 _GreyscaleTintColor; + #endif + + #if POSTERIZE_ON + half _PosterizeNumColors, _PosterizeGamma; + #endif + + #if BLUR_ON + half _BlurIntensity; + #endif + + #if MOTIONBLUR_ON + half _MotionBlurAngle, _MotionBlurDist; + #endif + + #if GHOST_ON + half _GhostColorBoost, _GhostTransparency, _GhostBlend; + #endif + + #if ALPHAOUTLINE_ON + half _AlphaOutlineGlow, _AlphaOutlinePower, _AlphaOutlineMinAlpha, _AlphaOutlineBlend; + half4 _AlphaOutlineColor; + #endif + + #if INNEROUTLINE_ON + half _InnerOutlineThickness, _InnerOutlineAlpha, _InnerOutlineGlow; + half4 _InnerOutlineColor; + #endif + + #if HOLOGRAM_ON + half _HologramStripesAmount, _HologramMinAlpha, _HologramUnmodAmount, _HologramStripesSpeed, _HologramMaxAlpha, _HologramBlend; + half4 _HologramStripeColor; + #endif + + #if CHROMABERR_ON + half _ChromAberrAmount, _ChromAberrAlpha; + #endif + + #if GLITCH_ON + half _GlitchAmount, _GlitchSize; + #endif + + #if FLICKER_ON + half _FlickerFreq, _FlickerPercent, _FlickerAlpha; + #endif + + #if SHADOW_ON + half _ShadowX, _ShadowY, _ShadowAlpha; + half4 _ShadowColor; + #endif + + #if SHINE_ON + sampler2D _ShineMask; + half4 _ShineColor; + half _ShineLocation, _ShineRotate, _ShineWidth, _ShineGlow; + #endif + + #if ALPHACUTOFF_ON + half _AlphaCutoffValue; + #endif + + #if ALPHAROUND_ON + half _AlphaRoundThreshold; + #endif + + #if CHANGECOLOR_ON + half4 _ColorChangeNewCol, _ColorChangeTarget; + half _ColorChangeTolerance, _ColorChangeLuminosity; + #endif + #if CHANGECOLOR2_ON + half4 _ColorChangeNewCol2, _ColorChangeTarget2; + half _ColorChangeTolerance2; + #endif + #if CHANGECOLOR3_ON + half4 _ColorChangeNewCol3, _ColorChangeTarget3; + half _ColorChangeTolerance3; + #endif + + #if CONTRAST_ON + half _Contrast, _Brightness; + #endif + + #if OVERLAY_ON + sampler2D _OverlayTex; + half4 _OverlayTex_ST, _OverlayColor; + half _OverlayGlow, _OverlayBlend, _OverlayTextureScrollXSpeed, _OverlayTextureScrollYSpeed; + #endif + + UNITY_INSTANCING_BUFFER_START(Props) + UNITY_DEFINE_INSTANCED_PROP(float, _RandomSeed) + UNITY_INSTANCING_BUFFER_END(Props) + + v2f vert (appdata v) + { + #if RECTSIZE_ON + v.vertex.xyz += (v.vertex.xyz * (_RectSize - 1.0)); + #endif + + v2f o; + UNITY_SETUP_INSTANCE_ID(v); + UNITY_TRANSFER_INSTANCE_ID(v, o); + UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o); + + #if BILBOARD_ON + half3 camRight = mul((half3x3)unity_CameraToWorld, half3(1,0,0)); + half3 camUp = half3(0,1,0); + #if BILBOARDY_ON + camUp = mul((half3x3)unity_CameraToWorld, half3(0,1,0)); + #endif + half3 localPos = v.vertex.x * camRight + v.vertex.y * camUp; + o.vertex = UnityObjectToClipPos(half4(localPos, 1)); + #else + o.vertex = UnityObjectToClipPos(v.vertex); + #endif + o.uv = TRANSFORM_TEX(v.uv, _MainTex); + o.color = v.color; + + half2 center = half2(0.5, 0.5); + #if ATLAS_ON + center = half2((_MaxXUV + _MinXUV) / 2.0, (_MaxYUV + _MinYUV) / 2.0); + #endif + + #if POLARUV_ON + o.uv = v.uv - center; + #endif + + #if ROTATEUV_ON + half2 uvC = v.uv; + half cosAngle = cos(_RotateUvAmount); + half sinAngle = sin(_RotateUvAmount); + half2x2 rot = half2x2(cosAngle, -sinAngle, sinAngle, cosAngle); + uvC -= center; + o.uv = mul(rot, uvC); + o.uv += center; + #endif + + #if OUTTEX_ON + o.uvOutTex = TRANSFORM_TEX(v.uv, _OutlineTex); + #endif + + #if OUTDIST_ON + o.uvOutDistTex = TRANSFORM_TEX(v.uv, _OutlineDistortTex); + #endif + + #if DISTORT_ON + o.uvDistTex = TRANSFORM_TEX(v.uv, _DistortTex); + #endif + + #if FOG_ON + UNITY_TRANSFER_FOG(o,o.vertex); + #endif + + return o; + } + + half3 GetPixel(in int offsetX, in int offsetY, half2 uv, sampler2D tex) + { + return tex2D(tex, (uv + half2(offsetX * _MainTex_TexelSize.x, offsetY * _MainTex_TexelSize.y))).rgb; + } + + half4 frag (v2f i) : SV_Target + { + UNITY_SETUP_INSTANCE_ID(i); + UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX(i); + half randomSeed = UNITY_ACCESS_INSTANCED_PROP(Props, _RandomSeed); + + float2 uvRect = i.uv; + half2 center = half2(0.5, 0.5); + #if ATLAS_ON + center = half2((_MaxXUV + _MinXUV) / 2.0, (_MaxYUV + _MinYUV) / 2.0); + uvRect = half2((i.uv.x - _MinXUV) / (_MaxXUV - _MinXUV), (i.uv.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half2 centerTiled = half2(center.x * _MainTex_ST.x, center.y * _MainTex_ST.y); + + #if CLIPPING_ON + half2 tiledUv = half2(i.uv.x / _MainTex_ST.x, i.uv.y / _MainTex_ST.y); + #if ATLAS_ON + tiledUv = half2((tiledUv.x - _MinXUV) / (_MaxXUV - _MinXUV), (tiledUv.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + clip((1 - _ClipUvUp) - tiledUv.y); + clip(tiledUv.y - _ClipUvDown); + clip((1 - _ClipUvRight) - tiledUv.x); + clip(tiledUv.x - _ClipUvLeft); + #endif + + #if RADIALCLIPPING_ON + half2 tiledUv2 = half2(i.uv.x / _MainTex_ST.x, i.uv.y / _MainTex_ST.y); + #if ATLAS_ON + tiledUv2 = half2((tiledUv2.x - _MinXUV) / (_MaxXUV - _MinXUV), (tiledUv2.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half startAngle = _RadialStartAngle - _RadialClip; + half endAngle = _RadialStartAngle + _RadialClip2; + half offset0 = clamp(0, 360, startAngle + 360); + half offset360 = clamp(0, 360, endAngle - 360); + half2 atan2Coord = half2(lerp(-1, 1, tiledUv2.x), lerp(-1, 1, tiledUv2.y)); + half atanAngle = atan2(atan2Coord.y, atan2Coord.x) * 57.3; // angle in degrees + if(atanAngle < 0) atanAngle = 360 + atanAngle; + if(atanAngle >= startAngle && atanAngle <= endAngle) discard; + if(atanAngle <= offset360) discard; + if(atanAngle >= offset0) discard; + #endif + + #if TEXTURESCROLL_ON && ATLAS_ON + i.uv = half2(_MinXUV + ((_MaxXUV - _MinXUV) * (abs((((globalUnscaledTime * 20) + randomSeed) * _TextureScrollXSpeed) + uvRect.x) % 1)), + _MinYUV + ((_MaxYUV - _MinYUV) * (abs((((globalUnscaledTime * 20) + randomSeed) * _TextureScrollYSpeed) + uvRect.y) % 1))); + #endif + + #if OFFSETUV_ON + #if ATLAS_ON + i.uv = half2(_MinXUV + ((_MaxXUV - _MinXUV) * (abs((_OffsetUvX + uvRect.x) % 1))), + _MinYUV + ((_MaxYUV - _MinYUV) * (abs(_OffsetUvY + uvRect.y) % 1))); + #else + i.uv += half2(_OffsetUvX, _OffsetUvY); + #endif + #endif + + #if POLARUV_ON + i.uv = half2(atan2(i.uv.y, i.uv.x) / (2.0f * 3.141592653589f), length(i.uv)); + i.uv *= _MainTex_ST.xy; + #endif + + #if TWISTUV_ON + #if ATLAS_ON + _TwistUvPosX = ((_MaxXUV - _MinXUV) * _TwistUvPosX) + _MinXUV; + _TwistUvPosY = ((_MaxYUV - _MinYUV) * _TwistUvPosY) + _MinYUV; + #endif + half2 tempUv = i.uv - half2(_TwistUvPosX * _MainTex_ST.x, _TwistUvPosY * _MainTex_ST.y); + _TwistUvRadius *= (_MainTex_ST.x + _MainTex_ST.y) / 2; + half percent = (_TwistUvRadius - length(tempUv)) / _TwistUvRadius; + half theta = percent * percent * (2.0 * sin(_TwistUvAmount)) * 8.0; + half s = sin(theta); + half c = cos(theta); + half beta = max(sign(_TwistUvRadius - length(tempUv)), 0.0); + tempUv = half2(dot(tempUv, half2(c, -s)), dot(tempUv, half2(s, c))) * beta + tempUv * (1 - beta); + tempUv += half2(_TwistUvPosX * _MainTex_ST.x, _TwistUvPosY * _MainTex_ST.y); + i.uv = tempUv; + #endif + + #if FISHEYE_ON + half bind = length(centerTiled); + half2 dF = i.uv - centerTiled; + half dFlen = length(dF); + half fishInt = (3.14159265359 / bind) * (_FishEyeUvAmount + 0.001); + i.uv = centerTiled + (dF / (max(0.0001, dFlen))) * tan(dFlen * fishInt) * bind / tan(bind * fishInt); + #endif + + #if PINCH_ON + half2 dP = i.uv - centerTiled; + half pinchInt = (3.141592 / length(centerTiled)) * (-_PinchUvAmount + 0.001); + i.uv = centerTiled + normalize(dP) * atan(length(dP) * -pinchInt * 10.0) * 0.5 / atan(-pinchInt * 5); + #endif + + #if ZOOMUV_ON + i.uv -= centerTiled; + i.uv = i.uv * _ZoomUvAmount; + i.uv += centerTiled; + #endif + + #if DOODLE_ON + half2 uvCopy = uvRect; + _HandDrawnSpeed = (floor(((globalUnscaledTime * 20) + randomSeed) * _HandDrawnSpeed) / _HandDrawnSpeed) * _HandDrawnSpeed; + uvCopy.x = sin((uvCopy.x * _HandDrawnAmount + _HandDrawnSpeed) * 4); + uvCopy.y = cos((uvCopy.y * _HandDrawnAmount + _HandDrawnSpeed) * 4); + i.uv = lerp(i.uv, i.uv + uvCopy, 0.0005 * _HandDrawnAmount); + #endif + + #if SHAKEUV_ON + half xShake = sin((globalUnscaledTime + randomSeed) * _ShakeUvSpeed * 50) * _ShakeUvX; + half yShake = cos((globalUnscaledTime + randomSeed) * _ShakeUvSpeed * 50) * _ShakeUvY; + i.uv += half2(xShake * 0.012, yShake * 0.01); + #endif + + #if RECTSIZE_ON + i.uv = i.uv.xy * (_RectSize).xx + (((-_RectSize * 0.5) + 0.5)).xx; + #endif + + #if DISTORT_ON + #if ATLAS_ON + i.uvDistTex.x = i.uvDistTex.x * (1 / (_MaxXUV - _MinXUV)); + i.uvDistTex.y = i.uvDistTex.y * (1 / (_MaxYUV - _MinYUV)); + #endif + i.uvDistTex.x += ((globalUnscaledTime + randomSeed) * _DistortTexXSpeed) % 1; + i.uvDistTex.y += ((globalUnscaledTime + randomSeed) * _DistortTexYSpeed) % 1; + half distortAmnt = (tex2D(_DistortTex, i.uvDistTex).r - 0.5) * 0.2 * _DistortAmount; + i.uv.x += distortAmnt; + i.uv.y += distortAmnt; + #endif + + #if WARP_ON + half2 warpUv = half2(i.uv.x / _MainTex_ST.x, i.uv.y / _MainTex_ST.y); + #if ATLAS_ON + warpUv = half2((warpUv.x - _MinXUV) / (_MaxXUV - _MinXUV), (warpUv.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + const float tau = 6.283185307179586; + float xWarp = ((globalUnscaledTime * 20) + randomSeed) * _WarpSpeed + warpUv.x * tau / _WarpScale; + float yWarp = ((globalUnscaledTime * 20) + randomSeed) * _WarpSpeed + warpUv.y * tau / _WarpScale; + float2 warp = float2(sin(xWarp), sin(yWarp)) * _WarpStrength; + i.uv += warp; + #endif + + #if WAVEUV_ON + float2 uvWave = half2(_WaveX * _MainTex_ST.x, _WaveY * _MainTex_ST.y) - i.uv; + uvWave %= 1; + #if ATLAS_ON + uvWave = half2(_WaveX, _WaveY) - uvRect; + #endif + uvWave.x *= _ScreenParams.x / _ScreenParams.y; + float waveTime = (globalUnscaledTime * 20) + randomSeed; + float angWave = (sqrt(dot(uvWave, uvWave)) * _WaveAmount) - ((waveTime * _WaveSpeed)); + i.uv = i.uv + uvWave * sin(angWave) * (_WaveStrength / 1000.0); + #endif + + #if ROUNDWAVEUV_ON + half xWave = ((0.5 * _MainTex_ST.x) - uvRect.x); + half yWave = ((0.5 * _MainTex_ST.y) - uvRect.y) * (_MainTex_TexelSize.w / _MainTex_TexelSize.z); + half ripple = -sqrt(xWave*xWave + yWave* yWave); + i.uv += (sin((ripple + ((globalUnscaledTime * 20) + randomSeed) * (_RoundWaveSpeed/10.0)) / 0.015) * (_RoundWaveStrength/10.0)) % 1; + #endif + + #if WIND_ON + half windOffset = sin((globalUnscaledTime + randomSeed) * _GrassSpeed * 10); + half2 windCenter = half2(0.5, 0.1); + #if ATLAS_ON + windCenter.x = ((_MaxXUV - _MinXUV) * windCenter.x) + _MinXUV; + windCenter.y = ((_MaxYUV - _MinYUV) * windCenter.y) + _MinYUV; + #endif + #if !MANUALWIND_ON + i.uv.x = fmod(abs(lerp(i.uv.x, i.uv.x + (_GrassWind * 0.01 * windOffset), uvRect.y)), 1); + #else + i.uv.x = fmod(abs(lerp(i.uv.x, i.uv.x + (_GrassWind * 0.01 * _GrassManualAnim), uvRect.y)), 1); + windOffset = _GrassManualAnim; + #endif + half2 delta = i.uv - windCenter; + half delta2 = dot(delta.xy, delta.xy); + half2 delta_offset = delta2 * windOffset; + i.uv = i.uv + half2(delta.y, -delta.x) * delta_offset * _GrassRadialBend; + #endif + + #if TEXTURESCROLL_ON && !ATLAS_ON + i.uv.x += (((globalUnscaledTime * 20) + randomSeed) * _TextureScrollXSpeed) % 1; + i.uv.y += (((globalUnscaledTime * 20) + randomSeed) * _TextureScrollYSpeed) % 1; + #endif + + #if PIXELATE_ON + half aspectRatio = _MainTex_TexelSize.x / _MainTex_TexelSize.y; + half2 pixelSize = float2(_PixelateSize, _PixelateSize * aspectRatio); + i.uv = floor(i.uv * pixelSize) / pixelSize; + #endif + + half4 col = tex2D(_MainTex, i.uv); + half originalAlpha = col.a; + col *= i.color; + #if PREMULTIPLYALPHA_ON + col.rgb *= col.a; + #endif + + #if GLITCH_ON + half2 uvGlitch = uvRect; + uvGlitch.y -= 0.5; + half lineNoise = pow(rand2CustomTime(floor(uvGlitch * half2(24., 19.) * _GlitchSize) * 4.0, randomSeed, globalUnscaledTime), 3.0) * _GlitchAmount + * pow(rand2CustomTime(floor(uvGlitch * half2(38., 14.) * _GlitchSize) * 4.0, randomSeed, globalUnscaledTime), 3.0); + col = tex2D(_MainTex, i.uv + half2(lineNoise * 0.02 * rand2CustomTime(half2(2.0, 1), randomSeed, globalUnscaledTime), 0)) * i.color; + #endif + + #if CHROMABERR_ON + half4 r = tex2D(_MainTex, i.uv + half2(_ChromAberrAmount/10, 0)) * i.color; + half4 b = tex2D(_MainTex, i.uv + half2(-_ChromAberrAmount/10, 0)) * i.color; + col = half4(r.r * r.a, col.g, b.b * b.a, max(max(r.a, b.a) * _ChromAberrAlpha, col.a)); + #endif + + #if BLUR_ON + #if ATLAS_ON + #if !BLURISHD_ON + col = BlurHD(i.uv, _MainTex, _BlurIntensity, (_MaxXUV - _MinXUV), (_MaxYUV - _MinYUV)) * i.color; + #else + col = Blur(i.uv, _MainTex, _BlurIntensity * (_MaxXUV - _MinXUV)) * i.color; + #endif + #else + #if !BLURISHD_ON + col = BlurHD(i.uv, _MainTex, _BlurIntensity, 1, 1) * i.color; + #else + col = Blur(i.uv, _MainTex, _BlurIntensity) * i.color; + #endif + #endif + #endif + + #if MOTIONBLUR_ON + _MotionBlurAngle = _MotionBlurAngle * 3.1415926; + #define rot(n) mul(n, half2x2(cos(_MotionBlurAngle), -sin(_MotionBlurAngle), sin(_MotionBlurAngle), cos(_MotionBlurAngle))) + _MotionBlurDist = _MotionBlurDist * 0.005; + #if ATLAS_ON + _MotionBlurDist *= (_MaxXUV - _MinXUV); + #endif + col.rgb += tex2D(_MainTex, i.uv + rot(half2(-_MotionBlurDist, -_MotionBlurDist))); + col.rgb += tex2D(_MainTex, i.uv + rot(half2(-_MotionBlurDist * 2, -_MotionBlurDist * 2))); + col.rgb += tex2D(_MainTex, i.uv + rot(half2(-_MotionBlurDist * 3, -_MotionBlurDist * 3))); + col.rgb += tex2D(_MainTex, i.uv + rot(half2(-_MotionBlurDist * 4, -_MotionBlurDist * 4))); + col.rgb += tex2D(_MainTex, i.uv + rot(half2(_MotionBlurDist, _MotionBlurDist))); + col.rgb += tex2D(_MainTex, i.uv + rot(half2(_MotionBlurDist * 2, _MotionBlurDist * 2))); + col.rgb += tex2D(_MainTex, i.uv + rot(half2(_MotionBlurDist * 3, _MotionBlurDist * 3))); + col.rgb += tex2D(_MainTex, i.uv + rot(half2(_MotionBlurDist * 4, _MotionBlurDist * 4))); + col.rgb = col.rgb / 9; + #endif + + #if NEGATIVE_ON + col.rgb = lerp(col.rgb, 1 - col.rgb, _NegativeAmount); + #endif + + half luminance = 0; + #if GREYSCALE_ON && !GREYSCALEOUTLINE_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + luminance = saturate(luminance + _GreyscaleLuminosity); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _GreyscaleTintColor, _GreyscaleBlend); + #endif + + #if GHOST_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + half4 ghostResult; + ghostResult.a = saturate(luminance - _GhostTransparency) * col.a; + ghostResult.rgb = col.rgb * (luminance + _GhostColorBoost); + col = lerp(col, ghostResult, _GhostBlend); + #endif + + #if INNEROUTLINE_ON + half3 innerT = abs(GetPixel(0, _InnerOutlineThickness, i.uv, _MainTex) - GetPixel(0, -_InnerOutlineThickness, i.uv, _MainTex)); + innerT += abs(GetPixel(_InnerOutlineThickness, 0, i.uv, _MainTex) - GetPixel(-_InnerOutlineThickness, 0, i.uv, _MainTex)); + #if !ONLYINNEROUTLINE_ON + innerT = (innerT / 2.0) * col.a * _InnerOutlineAlpha; + col.rgb += length(innerT) * _InnerOutlineColor.rgb * _InnerOutlineGlow; + #else + innerT *= col.a * _InnerOutlineAlpha; + col.rgb = length(innerT) * _InnerOutlineColor.rgb * _InnerOutlineGlow; + col.a = step(0.3, col.r+col.g+col.b); + #endif + #endif + + #if HITEFFECT_ON + col.rgb = lerp(col.rgb, _HitEffectColor.rgb * _HitEffectGlow, _HitEffectBlend); + #endif + + #if GRADIENT_ON + half2 tiledUvGrad = half2(uvRect.x / _MainTex_ST.x, uvRect.y / _MainTex_ST.y); + #if GRADIENT2COL_ON + _GradTopRightCol = _GradTopLeftCol; + _GradBotRightCol = _GradBotLeftCol; + #endif + #if RADIALGRADIENT_ON + half radialDist = 1 - length(tiledUvGrad - half2(0.5, 0.5)); + radialDist *= (_MainTex_TexelSize.w / _MainTex_TexelSize.z); + radialDist = saturate(_GradBoostX * radialDist); + half4 gradientResult = lerp(_GradTopLeftCol, _GradBotLeftCol, radialDist); + #else + half gradXLerpFactor = saturate(pow(tiledUvGrad.x, _GradBoostX)); + half4 gradientResult = lerp(lerp(_GradBotLeftCol, _GradBotRightCol, gradXLerpFactor), + lerp(_GradTopLeftCol, _GradTopRightCol, gradXLerpFactor), saturate(pow(tiledUvGrad.y, _GradBoostY))); + #endif + gradientResult = lerp(col, gradientResult, _GradBlend); + col.rgb = gradientResult.rgb * col.a; + col.a *= gradientResult.a; + #endif + + #if CONTRAST_ON + col.rgb = (col.rgb - float3(0.5, 0.5, 0.5)) * _Contrast + float3(0.5, 0.5, 0.5); + col.rgb += _Brightness; + #endif + + #if COLORSWAP_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + half4 swapMask = tex2D(_ColorSwapTex, i.uv); + swapMask.rgb *= swapMask.a; + half3 redSwap = _ColorSwapRed * swapMask.r * saturate(luminance + _ColorSwapRedLuminosity); + half3 greenSwap = _ColorSwapGreen * swapMask.g * saturate(luminance + _ColorSwapGreenLuminosity); + half3 blueSwap = _ColorSwapBlue * swapMask.b * saturate(luminance + _ColorSwapBlueLuminosity); + swapMask.rgb = col.rgb * saturate(1 - swapMask.r - swapMask.g - swapMask.b); + col.rgb = lerp(col.rgb, swapMask.rgb + redSwap + greenSwap + blueSwap, _ColorSwapBlend); + #endif + + #if COLORRAMP_ON && !COLORRAMPOUTLINE_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + luminance = saturate(luminance + _ColorRampLuminosity); + #if GRADIENTCOLORRAMP_ON + col.rgb = lerp(col.rgb, tex2D(_ColorRampTexGradient, half2(luminance, 0)).rgb, _ColorRampBlend); + #else + col.rgb = lerp(col.rgb, tex2D(_ColorRampTex, half2(luminance, 0)).rgb, _ColorRampBlend); + #endif + #endif + + #if CHANGECOLOR_ON + float3 currChangeColor = col.rgb; + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + luminance = saturate(luminance + _ColorChangeLuminosity); + half3 dif = abs(currChangeColor - _ColorChangeTarget.rgb); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _ColorChangeNewCol.rgb, + max(sign(1 - saturate(dif.x + dif.y + dif.z) - _ColorChangeTolerance), 0.0)); + #if CHANGECOLOR2_ON + dif = abs(currChangeColor - _ColorChangeTarget2.rgb); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _ColorChangeNewCol2.rgb, + max(sign(1 - saturate(dif.x + dif.y + dif.z) - _ColorChangeTolerance2), 0.0)); + #endif + #if CHANGECOLOR3_ON + dif = abs(currChangeColor - _ColorChangeTarget3.rgb); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _ColorChangeNewCol3.rgb, + max(sign(1 - saturate(dif.x + dif.y + dif.z) - _ColorChangeTolerance3), 0.0)); + #endif + #endif + + #if POSTERIZE_ON && !POSTERIZEOUTLINE_ON + col.rgb = pow(col.rgb, _PosterizeGamma) * _PosterizeNumColors; + col.rgb = floor(col.rgb) / _PosterizeNumColors; + col.rgb = pow(col.rgb, 1.0 / _PosterizeGamma); + #endif + + #if HSV_ON + half3 resultHsv = half3(col.rgb); + half cosHsv = _HsvBright * _HsvSaturation * cos(_HsvShift * 3.14159265 / 180); + half sinHsv = _HsvBright * _HsvSaturation * sin(_HsvShift * 3.14159265 / 180); + resultHsv.x = (.299 * _HsvBright + .701 * cosHsv + .168 * sinHsv) * col.x + + (.587 * _HsvBright - .587 * cosHsv + .330 * sinHsv) * col.y + + (.114 * _HsvBright - .114 * cosHsv - .497 * sinHsv) * col.z; + resultHsv.y = (.299 * _HsvBright - .299 * cosHsv - .328 * sinHsv) *col.x + + (.587 * _HsvBright + .413 * cosHsv + .035 * sinHsv) * col.y + + (.114 * _HsvBright - .114 * cosHsv + .292 * sinHsv) * col.z; + resultHsv.z = (.299 * _HsvBright - .3 * cosHsv + 1.25 * sinHsv) * col.x + + (.587 * _HsvBright - .588 * cosHsv - 1.05 * sinHsv) * col.y + + (.114 * _HsvBright + .886 * cosHsv - .203 * sinHsv) * col.z; + col.rgb = resultHsv; + #endif + + #if OVERLAY_ON + half2 overlayUvs = i.uv; + overlayUvs.x += (((globalUnscaledTime * 20) + randomSeed) * _OverlayTextureScrollXSpeed) % 1; + overlayUvs.y += (((globalUnscaledTime * 20) + randomSeed) * _OverlayTextureScrollYSpeed) % 1; + half4 overlayCol = tex2D(_OverlayTex, TRANSFORM_TEX(overlayUvs, _OverlayTex)); + overlayCol.rgb *= _OverlayColor.rgb * _OverlayGlow; + #if !OVERLAYMULT_ON + overlayCol.rgb *= overlayCol.a * _OverlayColor.rgb * _OverlayColor.a * _OverlayBlend; + col.rgb += overlayCol.rgb; + #else + overlayCol.a *= _OverlayColor.a; + col = lerp(col, col * overlayCol, _OverlayBlend); + #endif + #endif + + //OUTLINE------------------------------------------------------------- + #if OUTBASE_ON + #if OUTBASEPIXELPERF_ON + half2 destUv = half2(_OutlinePixelWidth * _MainTex_TexelSize.x, _OutlinePixelWidth * _MainTex_TexelSize.y); + #else + half2 destUv = half2(_OutlineWidth * _MainTex_TexelSize.x * 200, _OutlineWidth * _MainTex_TexelSize.y * 200); + #endif + + #if OUTDIST_ON + i.uvOutDistTex.x += ((globalUnscaledTime + randomSeed) * _OutlineDistortTexXSpeed) % 1; + i.uvOutDistTex.y += ((globalUnscaledTime + randomSeed) * _OutlineDistortTexYSpeed) % 1; + #if ATLAS_ON + i.uvOutDistTex = half2((i.uvOutDistTex.x - _MinXUV) / (_MaxXUV - _MinXUV), (i.uvOutDistTex.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half outDistortAmnt = (tex2D(_OutlineDistortTex, i.uvOutDistTex).r - 0.5) * 0.2 * _OutlineDistortAmount; + destUv.x += outDistortAmnt; + destUv.y += outDistortAmnt; + #endif + + half spriteLeft = tex2D(_MainTex, i.uv + half2(destUv.x, 0)).a; + half spriteRight = tex2D(_MainTex, i.uv - half2(destUv.x, 0)).a; + half spriteBottom = tex2D(_MainTex, i.uv + half2(0, destUv.y)).a; + half spriteTop = tex2D(_MainTex, i.uv - half2(0, destUv.y)).a; + half result = spriteLeft + spriteRight + spriteBottom + spriteTop; + + #if OUTBASE8DIR_ON + half spriteTopLeft = tex2D(_MainTex, i.uv + half2(destUv.x, destUv.y)).a; + half spriteTopRight = tex2D(_MainTex, i.uv + half2(-destUv.x, destUv.y)).a; + half spriteBotLeft = tex2D(_MainTex, i.uv + half2(destUv.x, -destUv.y)).a; + half spriteBotRight = tex2D(_MainTex, i.uv + half2(-destUv.x, -destUv.y)).a; + result = result + spriteTopLeft + spriteTopRight + spriteBotLeft + spriteBotRight; + #endif + + result = step(0.05, saturate(result)); + + #if OUTTEX_ON + i.uvOutTex.x += ((globalUnscaledTime + randomSeed) * _OutlineTexXSpeed) % 1; + i.uvOutTex.y += ((globalUnscaledTime + randomSeed) * _OutlineTexYSpeed) % 1; + #if ATLAS_ON + i.uvOutTex = half2((i.uvOutTex.x - _MinXUV) / (_MaxXUV - _MinXUV), (i.uvOutTex.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half4 tempOutColor = tex2D(_OutlineTex, i.uvOutTex); + tempOutColor *= _OutlineColor; + _OutlineColor = tempOutColor; + #endif + + result *= (1 - originalAlpha) * _OutlineAlpha; + + half4 outline = _OutlineColor * i.color.a; + outline.rgb *= _OutlineGlow; + outline.a = result; + #if ONLYOUTLINE_ON + col = outline; + #else + col = lerp(col, outline, result); + #endif + #endif + //----------------------------------------------------------------------------- + + #if FADE_ON + half2 tiledUvFade1= TRANSFORM_TEX(i.uv, _FadeTex); + half2 tiledUvFade2 = TRANSFORM_TEX(i.uv, _FadeBurnTex); + #if ATLAS_ON + tiledUvFade1 = half2((tiledUvFade1.x - _MinXUV) / (_MaxXUV - _MinXUV), (tiledUvFade1.y - _MinYUV) / (_MaxYUV - _MinYUV)); + tiledUvFade2 = half2((tiledUvFade2.x - _MinXUV) / (_MaxXUV - _MinXUV), (tiledUvFade2.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half fadeTemp = tex2D(_FadeTex, tiledUvFade1).r; + half fade = smoothstep(_FadeAmount, _FadeAmount + _FadeBurnTransition, fadeTemp); + half fadeBurn = saturate(smoothstep(_FadeAmount - _FadeBurnWidth, _FadeAmount - _FadeBurnWidth + 0.1, fadeTemp) * _FadeAmount); + col.a *= fade; + _FadeBurnColor.rgb *= _FadeBurnGlow; + col += fadeBurn * tex2D(_FadeBurnTex, tiledUvFade2) * _FadeBurnColor * originalAlpha * (1 - col.a); + #endif + + #if SHADOW_ON + half shadowA = tex2D(_MainTex, i.uv + half2(_ShadowX, _ShadowY)).a; + half preMultShadowMask = 1 - (saturate(shadowA - col.a) * (1 - col.a)); + col.rgb *= 1 - ((shadowA - col.a) * (1 - col.a)); + col.rgb += (_ShadowColor * shadowA) * (1 - col.a); + col.a = max(shadowA * _ShadowAlpha * i.color.a, col.a); + #endif + + #if GLOW_ON + half4 emission; + #if GLOWTEX_ON + emission = tex2D(_GlowTex, i.uv); + #else + emission = col; + #endif + col.rgb *= _GlowGlobal; + emission.rgb *= emission.a * col.a * _Glow * _GlowColor; + col.rgb += emission.rgb; + #endif + + #if COLORRAMP_ON && COLORRAMPOUTLINE_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + luminance = saturate(luminance + _ColorRampLuminosity); + #if GRADIENTCOLORRAMP_ON + col.rgb = lerp(col.rgb, tex2D(_ColorRampTexGradient, half2(luminance, 0)).rgb, _ColorRampBlend); + #else + col.rgb = lerp(col.rgb, tex2D(_ColorRampTex, half2(luminance, 0)).rgb, _ColorRampBlend); + #endif + #endif + + #if GREYSCALE_ON && GREYSCALEOUTLINE_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + luminance = saturate(luminance + _GreyscaleLuminosity); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _GreyscaleTintColor, _GreyscaleBlend); + #endif + + #if POSTERIZE_ON && POSTERIZEOUTLINE_ON + col.rgb = pow(col.rgb, _PosterizeGamma) * _PosterizeNumColors; + col.rgb = floor(col.rgb) / _PosterizeNumColors; + col.rgb = pow(col.rgb, 1.0 / _PosterizeGamma); + #endif + + #if SHINE_ON + half2 uvShine = uvRect; + half cosAngle = cos(_ShineRotate); + half sinAngle = sin(_ShineRotate); + half2x2 rot = half2x2(cosAngle, -sinAngle, sinAngle, cosAngle); + uvShine -= half2(0.5, 0.5); + uvShine = mul(rot, uvShine); + uvShine += half2(0.5, 0.5); + half shineMask = tex2D(_ShineMask, i.uv).a; + half currentDistanceProjection = (uvShine.x + uvShine.y) / 2; + half whitePower = 1 - (abs(currentDistanceProjection - _ShineLocation) / _ShineWidth); + col.rgb += col.a * whitePower * _ShineGlow * max(sign(currentDistanceProjection - (_ShineLocation - _ShineWidth)), 0.0) + * max(sign((_ShineLocation + _ShineWidth) - currentDistanceProjection), 0.0) * _ShineColor * shineMask; + #endif + + #if HOLOGRAM_ON + half totalHologram = _HologramStripesAmount + _HologramUnmodAmount; + half hologramYCoord = ((uvRect.y + (((globalUnscaledTime + randomSeed) % 1) * _HologramStripesSpeed)) % totalHologram) / totalHologram; + hologramYCoord = abs(hologramYCoord); + half alpha = RemapFloat(saturate(hologramYCoord - (_HologramUnmodAmount/totalHologram)), 0.0, 1.0, _HologramMinAlpha, saturate(_HologramMaxAlpha)); + half hologramMask = max(sign((_HologramUnmodAmount/totalHologram) - hologramYCoord), 0.0); + half4 hologramResult = col; + hologramResult.a *= lerp(alpha, 1, hologramMask); + hologramResult.rgb *= max(1, _HologramMaxAlpha * max(sign(hologramYCoord - (_HologramUnmodAmount/totalHologram)), 0.0)); + hologramMask = 1 - step(0.01,hologramMask); + hologramResult.rgb += hologramMask * _HologramStripeColor * col.a; + col = lerp(col, hologramResult, _HologramBlend); + #endif + + #if FLICKER_ON + col.a *= saturate(col.a * step(frac(0.05 + ((globalUnscaledTime * 60) + randomSeed) * _FlickerFreq), 1 - _FlickerPercent) + _FlickerAlpha); + #endif + + col.a *= _Alpha; + + #if ALPHACUTOFF_ON + clip((1 - _AlphaCutoffValue) - (1 - col.a) - 0.01); + #endif + + #if ALPHAROUND_ON + col.a = step(_AlphaRoundThreshold, col.a); + #endif + + #if ALPHAOUTLINE_ON + half alphaOutlineRes = pow(1 - col.a, max(_AlphaOutlinePower, 0.0001)) * step(_AlphaOutlineMinAlpha, col.a) * _AlphaOutlineBlend; + col.rgb = lerp(col.rgb, _AlphaOutlineColor.rgb * _AlphaOutlineGlow, alphaOutlineRes); + col.a = lerp(col.a, 1, alphaOutlineRes > 1); + #endif + + col *= _Color; + + #if FOG_ON + UNITY_APPLY_FOG(i.fogCoord, col); + #endif + + return col; + } + ENDCG + } + } + CustomEditor "AllIn1SpriteShaderMaterialInspector" + //Fallback "Sprites/Default" //Remove fallback so that any shader error is obvious to the user +} \ No newline at end of file diff --git a/Assets/Plugins/AllIn1SpriteShader/Shaders/AllIn1SpriteShaderScaledTime.shader.meta b/Assets/Plugins/AllIn1SpriteShader/Shaders/AllIn1SpriteShaderScaledTime.shader.meta new file mode 100644 index 000000000..3192aca34 --- /dev/null +++ b/Assets/Plugins/AllIn1SpriteShader/Shaders/AllIn1SpriteShaderScaledTime.shader.meta @@ -0,0 +1,29 @@ +fileFormatVersion: 2 +guid: f3622b3ac1631ea409b0f5811034f3a9 +ShaderImporter: + externalObjects: {} + defaultTextures: + - _MainTex: {instanceID: 0} + - _GlowTex: {instanceID: 0} + - _FadeTex: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + - _FadeBurnTex: {fileID: 2800000, guid: 677cca399782dea41aedc1d292ecb67d, type: 3} + - _OutlineTex: {fileID: 2800000, guid: 74087f6d03f233e4a8a142fa01f9e5cf, type: 3} + - _OutlineDistortTex: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, + type: 3} + - _ColorSwapTex: {instanceID: 0} + - _ColorRampTex: {fileID: 2800000, guid: 279657edc397ece4b8029c727adf6ddc, type: 3} + - _DistortTex: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + - _ShineMask: {instanceID: 0} + - _ColorRampTexGradient: {instanceID: 0} + - _OverlayTex: {fileID: 2800000, guid: 677cca399782dea41aedc1d292ecb67d, type: 3} + nonModifiableTextures: [] + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 156513 + packageName: All In 1 Sprite Shader + packageVersion: 4.25 + assetPath: Assets/Plugins/AllIn1SpriteShader/Shaders/AllIn1SpriteShaderScaledTime.shader + uploadId: 708810 diff --git a/Assets/Plugins/AllIn1SpriteShader/Shaders/AllIn1SpriteShaderUiMask.shader b/Assets/Plugins/AllIn1SpriteShader/Shaders/AllIn1SpriteShaderUiMask.shader new file mode 100644 index 000000000..f9256b228 --- /dev/null +++ b/Assets/Plugins/AllIn1SpriteShader/Shaders/AllIn1SpriteShaderUiMask.shader @@ -0,0 +1,1247 @@ +Shader "AllIn1SpriteShader/AllIn1SpriteShaderUiMask" +{ + Properties + { + _MainTex ("Main Texture", 2D) = "white" {} //0 + _Color("Main Color", Color) = (1,1,1,1) //1 + _Alpha("General Alpha", Range(0,1)) = 1 //2 + + _GlowColor("Glow Color", Color) = (1,1,1,1) //3 + _Glow("Glow Color Intensity", Range(0,100)) = 10 //4 + _GlowGlobal("Global Glow Intensity", Range(1,100)) = 1 //5 + [NoScaleOffset] _GlowTex("Glow Texture", 2D) = "white" {} //6 + + _FadeTex("Fade Texture", 2D) = "white" {} //7 + _FadeAmount("Fade Amount", Range(-0.1,1)) = -0.1 //8 + _FadeBurnWidth("Fade Burn Width", Range(0,1)) = 0.025 //9 + _FadeBurnTransition("Burn Transition", Range(0.01,0.5)) = 0.075 //10 + _FadeBurnColor("Fade Burn Color", Color) = (1,1,0,1) //11 + _FadeBurnTex("Fade Burn Texture", 2D) = "white" {} //12 + _FadeBurnGlow("Fade Burn Glow", Range(1,250)) = 2//13 + + _OutlineColor("Outline Base Color", Color) = (1,1,1,1) //14 + _OutlineAlpha("Outline Base Alpha", Range(0,1)) = 1 //15 + _OutlineGlow("Outline Base Glow", Range(1,100)) = 1.5 //16 + _OutlineWidth("Outline Base Width", Range(0,0.2)) = 0.004 //17 + _OutlinePixelWidth("Outline Base Pixel Width", Int) = 1 //18 + + [Space] + _OutlineTex("Outline Texture", 2D) = "white" {} //19 + _OutlineTexXSpeed("Texture scroll speed X", Range(-50,50)) = 10 //20 + _OutlineTexYSpeed("Texture scroll speed Y", Range(-50,50)) = 0 //21 + + [Space] + _OutlineDistortTex("Outline Distortion Texture", 2D) = "white" {} //22 + _OutlineDistortAmount("Outline Distortion Amount", Range(0,2)) = 0.5 //23 + _OutlineDistortTexXSpeed("Distortion scroll speed X", Range(-50,50)) = 5 //24 + _OutlineDistortTexYSpeed("Distortion scroll speed Y", Range(-50,50)) = 5 //25 + + _AlphaOutlineColor("Color", Color) = (1, 1, 1, 1) //26 + _AlphaOutlineGlow("Outline Glow", Range(1,100)) = 5 //27 + _AlphaOutlinePower("Power", Range(0, 5)) = 1 // 28 + _AlphaOutlineMinAlpha("Min Alpha", Range(0, 1)) = 0 // 29 + _AlphaOutlineBlend("Blend", Range(0, 1)) = 1 // 30 + + _GradBlend("Gradient Blend", Range(0,1)) = 1 //31 + _GradTopLeftCol("Top Color", Color) = (1,0,0,1) //32 + _GradTopRightCol("Top Color 2", Color) = (1, 1, 0, 1) //33 + _GradBotLeftCol("Bot Color", Color) = (0,0,1,1) //34 + _GradBotRightCol("Bot Color 2", Color) = (0, 1, 0, 1) //35 + + [NoScaleOffset] _ColorSwapTex("Color Swap Texture", 2D) = "black" {} //36 + [HDR] _ColorSwapRed("Red Channel", Color) = (1,1,1,1) //37 + _ColorSwapRedLuminosity("Red luminosity", Range(-1,1)) = 0.5 //38 + [HDR] _ColorSwapGreen("Green Channel", Color) = (1,1,1,1) //39 + _ColorSwapGreenLuminosity("Green luminosity", Range(-1,1)) = 0.5 //40 + [HDR] _ColorSwapBlue("Blue Channel", Color) = (1,1,1,1) //41 + _ColorSwapBlueLuminosity("Blue luminosity", Range(-1,1)) = 0.5 //42 + + _HsvShift("Hue Shift", Range(0, 360)) = 180 //43 + _HsvSaturation("Saturation", Range(0, 2)) = 1 //44 + _HsvBright("Brightness", Range(0, 2)) = 1 //45 + + _HitEffectColor("Hit Effect Color", Color) = (1,1,1,1) //46 + _HitEffectGlow("Glow Intensity", Range(1,100)) = 5 //47 + [Space] + _HitEffectBlend("Hit Effect Blend", Range(0,1)) = 1 //48 + + _NegativeAmount("Negative Amount", Range(0, 1)) = 1 //49 + + _PixelateSize("Pixelate size", Range(4,512)) = 32 //50 + + [NoScaleOffset] _ColorRampTex("Color ramp Texture", 2D) = "white" {} //51 + _ColorRampLuminosity("Color ramp luminosity", Range(-1,1)) = 0 //52 + [Toggle()] _ColorRampOutline("Affects everything?", float) = 0 //53 + + _GreyscaleLuminosity("Greyscale luminosity", Range(-1,1)) = 0 //54 + [Toggle()] _GreyscaleOutline("Affects everything?", float) = 0 //55 + _GreyscaleTintColor("Greyscale Tint Color", Color) = (1,1,1,1) //56 + + _PosterizeNumColors("Number of Colors", Range(0,100)) = 8 //57 + _PosterizeGamma("Posterize Amount", Range(0.1,10)) = 0.75 //58 + [Toggle()] _PosterizeOutline("Affects everything?", float) = 0 //59 + + _BlurIntensity("Blur Intensity", Range(0,100)) = 10 //60 + [Toggle()] _BlurHD("Blur is Low Res?", float) = 0 //61 + + _MotionBlurAngle("Motion Blur Angle", Range(-1, 1)) = 0.1 //62 + _MotionBlurDist("Motion Blur Distance", Range(-3, 3)) = 1.25 //63 + + _GhostColorBoost("Ghost Color Boost", Range(0,5)) = 1 //64 + _GhostTransparency("Ghost Transparency", Range(0,1)) = 0 //65 + + _InnerOutlineColor("Inner Outline Color", Color) = (1,0,0,1) //66 + _InnerOutlineThickness("Outline Thickness", Range(0,3)) = 1 //67 + _InnerOutlineAlpha("Inner Outline Alpha", Range(0,1)) = 1 //68 + _InnerOutlineGlow("Inner Outline Glow", Range(1,250)) = 4 //69 + + _AlphaCutoffValue("Alpha cutoff value", Range(0, 1)) = 0.25 //70 + + [Toggle()] _OnlyOutline("Only render outline?", float) = 0 //71 + [Toggle()] _OnlyInnerOutline("Only render inner outline?", float) = 0 //72 + + _HologramStripesAmount("Stripes Amount", Range(0, 1)) = 0.1 //73 + _HologramUnmodAmount("Unchanged Amount", Range(0, 1)) = 0.0 //74 + _HologramStripesSpeed("Stripes Speed", Range(-20, 20)) = 4.5 //75 + _HologramMinAlpha("Min Alpha", Range(0, 1)) = 0.1 //76 + _HologramMaxAlpha("Max Alpha", Range(0, 100)) = 0.75 //77 + + _ChromAberrAmount("ChromAberr Amount", Range(0, 1)) = 1 //78 + _ChromAberrAlpha("ChromAberr Alpha", Range(0, 1)) = 0.4 //79 + + _GlitchAmount("Glitch Amount", Range(0, 20)) = 3 //80 + + _FlickerPercent("Flicker Percent", Range(0, 1)) = 0.05 //81 + _FlickerFreq("Flicker Frequency", Range(0, 5)) = 0.2 //82 + _FlickerAlpha("Flicker Alpha", Range(0, 1)) = 0 //83 + + _ShadowX("Shadow X Axis", Range(-0.5, 0.5)) = 0.1 //84 + _ShadowY("Shadow Y Axis", Range(-0.5, 0.5)) = -0.05 //85 + _ShadowAlpha("Shadow Alpha", Range(0, 1)) = 0.5 //86 + _ShadowColor("Shadow Color", Color) = (0, 0, 0, 1) //87 + + _HandDrawnAmount("Hand Drawn Amount", Range(0, 20)) = 10 //88 + _HandDrawnSpeed("Hand Drawn Speed", Range(1, 15)) = 5 //89 + + _GrassSpeed("Speed", Range(0,50)) = 2 //90 + _GrassWind("Bend amount", Range(0,50)) = 20 //91 + [Space] + [Toggle()] _GrassManualToggle("Manually animated?", float) = 0 //92 + _GrassManualAnim("Manual Anim Value", Range(-1,1)) = 1 //93 + + _WaveAmount("Wave Amount", Range(0, 25)) = 7 //94 + _WaveSpeed("Wave Speed", Range(0, 25)) = 10 //95 + _WaveStrength("Wave Strength", Range(0, 25)) = 7.5 //96 + _WaveX("Wave X Axis", Range(0, 1)) = 0 //97 + _WaveY("Wave Y Axis", Range(0, 1)) = 0.5 //98 + + _RectSize("Rect Size", Range(1, 4)) = 1 //99 + + _OffsetUvX("X axis", Range(-1, 1)) = 0 //100 + _OffsetUvY("Y axis", Range(-1, 1)) = 0 //101 + + _ClipUvLeft("Clipping Left", Range(0, 1)) = 0 //102 + _ClipUvRight("Clipping Right", Range(0, 1)) = 0 //103 + _ClipUvUp("Clipping Up", Range(0, 1)) = 0 //104 + _ClipUvDown("Clipping Down", Range(0, 1)) = 0 //105 + + _TextureScrollXSpeed("Speed X Axis", Range(-5, 5)) = 1 //106 + _TextureScrollYSpeed("Speed Y Axis", Range(-5, 5)) = 0 //107 + + _ZoomUvAmount("Zoom Amount", Range(0.1, 5)) = 0.5 //108 + + _DistortTex("Distortion Texture", 2D) = "white" {} //109 + _DistortAmount("Distortion Amount", Range(0,2)) = 0.5 //110 + _DistortTexXSpeed("Scroll speed X", Range(-50,50)) = 5 //111 + _DistortTexYSpeed("Scroll speed Y", Range(-50,50)) = 5 //112 + + _TwistUvAmount("Twist Amount", Range(0, 3.1416)) = 1 //113 + _TwistUvPosX("Twist Pos X Axis", Range(0, 1)) = 0.5 //114 + _TwistUvPosY("Twist Pos Y Axis", Range(0, 1)) = 0.5 //115 + _TwistUvRadius("Twist Radius", Range(0, 3)) = 0.75 //116 + + _RotateUvAmount("Rotate Angle(radians)", Range(0, 6.2831)) = 0 //117 + + _FishEyeUvAmount("Fish Eye Amount", Range(0, 0.5)) = 0.35 //118 + + _PinchUvAmount("Pinch Amount", Range(0, 0.5)) = 0.35 //119 + + _ShakeUvSpeed("Shake Speed", Range(0, 20)) = 2.5 //120 + _ShakeUvX("X Multiplier", Range(0, 5)) = 1.5 //121 + _ShakeUvY("Y Multiplier", Range(0, 5)) = 1 //122 + + _ColorChangeTolerance("Tolerance", Range(0, 1)) = 0.25 //123 + _ColorChangeTarget("Color to change", Color) = (1, 0, 0, 1) //124 + [HDR] _ColorChangeNewCol("New Color", Color) = (1, 1, 0, 1) //125 + _ColorChangeLuminosity("New Color Luminosity", Range(0, 1)) = 0.0 //126 + + _RoundWaveStrength("Wave Strength", Range(0, 1)) = 0.7 //127 + _RoundWaveSpeed("Wave Speed", Range(0, 5)) = 2 //128 + + [Toggle()] _BillboardY("Billboard on both axis?", float) = 0 //129 + _ZWrite ("Depth Write", Float) = 0.0 // 130 + + _MySrcMode ("SrcMode", Float) = 5 // 131 + _MyDstMode ("DstMode", Float) = 10 // 132 + + _ShineColor("Shine Color", Color) = (1,1,1,1) // 133 + _ShineLocation("Shine Location", Range(0,1)) = 0.5 // 134 + _ShineRotate("Rotate Angle(radians)", Range(0, 6.2831)) = 0 //135 + _ShineWidth("Shine Width", Range(0.05,1)) = 0.1 // 136 + _ShineGlow("Shine Glow", Range(0,100)) = 1 // 137 + [NoScaleOffset] _ShineMask("Shine Mask", 2D) = "white" {} // 138 + + _GlitchSize("Glitch Size", Range(0.25, 5)) = 1 //139 + _HologramStripeColor("Stripes Color", Color) = (0,1,1,1) //140 + _GradBoostX("Boost X axis", Range(0.1, 5)) = 1.2 //141 + _GradBoostY("Boost Y axis", Range(0.1, 5)) = 1.2 //142 + [Toggle()] _GradIsRadial("Radial Gradient?", float) = 0 //143 + _AlphaRoundThreshold("Round Threshold", Range(0.005, 1.0)) = 0.5 //144 + _GrassRadialBend("Radial Bend", Range(0.0, 5.0)) = 0.1 //145 + + _ColorChangeTolerance2("Tolerance 2", Range(0, 1)) = 0.25 //146 + _ColorChangeTarget2("Color to change 2", Color) = (1, 0, 0, 1) //147 + [HDR] _ColorChangeNewCol2("New Color 2", Color) = (1, 1, 0, 1) //148 + _ColorChangeTolerance3("Tolerance 3", Range(0, 1)) = 0.25 //149 + _ColorChangeTarget3("Color to change 3", Color) = (1, 0, 0, 1) //150 + [HDR] _ColorChangeNewCol3("New Color 3", Color) = (1, 1, 0, 1) //151 + + _Contrast ("Contrast", Range(0, 6)) = 1 // 152 + _Brightness ("Brightness", Range(-1, 1)) = 0 // 153 + + _ColorSwapBlend ("Color Swap Blend", Range(0, 1)) = 1 // 154 + _ColorRampBlend ("Color Ramp Blend", Range(0, 1)) = 1 // 155 + _GreyscaleBlend ("Greyscale Blend", Range(0, 1)) = 1 // 156 + _GhostBlend ("Ghost Blend", Range(0, 1)) = 1 // 157 + _HologramBlend ("Hologram Blend", Range(0, 1)) = 1 // 158 + + [AllIn1ShaderGradient] _ColorRampTexGradient("Color ramp Gradient", 2D) = "white" {} //159 + + _OverlayTex("Overlay Texture", 2D) = "white" {} //160 + _OverlayColor("Overlay Color", Color) = (1, 1, 1, 1) //161 + _OverlayGlow("Overlay Glow", Range(0,25)) = 1 // 162 + _OverlayBlend("Overlay Blend", Range(0, 1)) = 1 // 163 + + _RadialStartAngle("Radial Start Angle", Range(0, 360)) = 90 //164 + _RadialClip("Radial Clip", Range(0, 360)) = 45 //165 + _RadialClip2("Radial Clip 2", Range(0, 360)) = 0 //166 + + _WarpStrength("Warp Strength", Range(0, 0.1)) = 0.025 //167 + _WarpSpeed("Warp Speed", Range(0, 25)) = 8 //168 + _WarpScale("Warp Scale", Range(0.05, 3)) = 0.5 //169 + + _OverlayTextureScrollXSpeed("Speed X Axis", Range(-5, 5)) = 0.25 //170 + _OverlayTextureScrollYSpeed("Speed Y Axis", Range(-5, 5)) = 0.25 //171 + + _Stencil ("Stencil ID", Float) = 0 + _StencilComp ("Stencil Comparison", Float) = 8 + _StencilOp ("Stencil Operation", Float) = 0 + _StencilWriteMask ("Stencil Write Mask", Float) = 255 + _StencilReadMask ("Stencil Read Mask", Float) = 255 + _ColorMask ("Color Mask", Float) = 15 + + [HideInInspector] _MinXUV("_MinXUV", Range(0, 1)) = 0.0 + [HideInInspector] _MaxXUV("_MaxXUV", Range(0, 1)) = 1.0 + [HideInInspector] _MinYUV("_MinYUV", Range(0, 1)) = 0.0 + [HideInInspector] _MaxYUV("_MaxYUV", Range(0, 1)) = 1.0 + [HideInInspector] _RandomSeed("_MaxYUV", Range(0, 10000)) = 0.0 + _EditorDrawers("Editor Drawers", Int) = 6 + } + + SubShader + { + Tags { "Queue"="Transparent" "IgnoreProjector"="True" "RenderType"="Transparent" "PreviewType"="Plane" "CanUseSpriteAtlas"="True" } + Blend [_MySrcMode] [_MyDstMode] + Cull Off + ZWrite Off + ZTest [unity_GUIZTestMode] + ColorMask [_ColorMask] + + Stencil + { + Ref [_Stencil] + Comp [_StencilComp] + Pass [_StencilOp] + ReadMask [_StencilReadMask] + WriteMask [_StencilWriteMask] + } + + Pass + { + CGPROGRAM + #pragma vertex vert + #pragma fragment frag + #pragma multi_compile_instancing + + #pragma shader_feature_local GLOW_ON + #pragma shader_feature_local FADE_ON + #pragma shader_feature_local OUTBASE_ON + #pragma shader_feature_local ONLYOUTLINE_ON + #pragma shader_feature_local GRADIENT_ON + #pragma shader_feature_local GRADIENT2COL_ON + #pragma shader_feature_local RADIALGRADIENT_ON + #pragma shader_feature_local COLORSWAP_ON + #pragma shader_feature_local HSV_ON + #pragma shader_feature_local CHANGECOLOR_ON + #pragma shader_feature_local CHANGECOLOR2_ON + #pragma shader_feature_local CHANGECOLOR3_ON + #pragma shader_feature_local COLORRAMP_ON + #pragma shader_feature_local GRADIENTCOLORRAMP_ON + #pragma shader_feature_local HITEFFECT_ON + #pragma shader_feature_local NEGATIVE_ON + #pragma shader_feature_local PIXELATE_ON + #pragma shader_feature_local GREYSCALE_ON + #pragma shader_feature_local POSTERIZE_ON + #pragma shader_feature_local BLUR_ON + #pragma shader_feature_local MOTIONBLUR_ON + #pragma shader_feature_local GHOST_ON + #pragma shader_feature_local ALPHAOUTLINE_ON + #pragma shader_feature_local INNEROUTLINE_ON + #pragma shader_feature_local ONLYINNEROUTLINE_ON + #pragma shader_feature_local HOLOGRAM_ON + #pragma shader_feature_local CHROMABERR_ON + #pragma shader_feature_local GLITCH_ON + #pragma shader_feature_local FLICKER_ON + #pragma shader_feature_local SHADOW_ON + #pragma shader_feature_local SHINE_ON + #pragma shader_feature_local CONTRAST_ON + #pragma shader_feature_local OVERLAY_ON + #pragma shader_feature_local OVERLAYMULT_ON + #pragma shader_feature_local ALPHACUTOFF_ON + #pragma shader_feature_local ALPHAROUND_ON + #pragma shader_feature_local DOODLE_ON + #pragma shader_feature_local WIND_ON + #pragma shader_feature_local WAVEUV_ON + #pragma shader_feature_local ROUNDWAVEUV_ON + #pragma shader_feature_local RECTSIZE_ON + #pragma shader_feature_local OFFSETUV_ON + #pragma shader_feature_local CLIPPING_ON + #pragma shader_feature_local RADIALCLIPPING_ON + #pragma shader_feature_local TEXTURESCROLL_ON + #pragma shader_feature_local ZOOMUV_ON + #pragma shader_feature_local DISTORT_ON + #pragma shader_feature_local WARP_ON + #pragma shader_feature_local TWISTUV_ON + #pragma shader_feature_local ROTATEUV_ON + #pragma shader_feature_local POLARUV_ON + #pragma shader_feature_local FISHEYE_ON + #pragma shader_feature_local PINCH_ON + #pragma shader_feature_local SHAKEUV_ON + + #pragma shader_feature_local GLOWTEX_ON + #pragma shader_feature_local OUTTEX_ON + #pragma shader_feature_local OUTDIST_ON + #pragma shader_feature_local OUTBASE8DIR_ON + #pragma shader_feature_local OUTBASEPIXELPERF_ON + #pragma shader_feature_local COLORRAMPOUTLINE_ON + #pragma shader_feature_local GREYSCALEOUTLINE_ON + #pragma shader_feature_local POSTERIZEOUTLINE_ON + #pragma shader_feature_local BLURISHD_ON + #pragma shader_feature_local MANUALWIND_ON + #pragma shader_feature ATLAS_ON + #pragma shader_feature PREMULTIPLYALPHA_ON + + #pragma multi_compile _ UNITY_UI_CLIP_RECT + #pragma multi_compile _ UNITY_UI_ALPHACLIP + + #include "UnityCG.cginc" + #include "AllIn1OneShaderFunctions.cginc" + + struct appdata + { + float4 vertex : POSITION; + float2 uv : TEXCOORD0; + half4 color : COLOR; + UNITY_VERTEX_INPUT_INSTANCE_ID + }; + + struct v2f + { + float2 uv : TEXCOORD0; + float4 vertex : SV_POSITION; + half4 color : COLOR; + #if OUTTEX_ON + half2 uvOutTex : TEXCOORD1; + #endif + #if OUTDIST_ON + half2 uvOutDistTex : TEXCOORD2; + #endif + #if DISTORT_ON + half2 uvDistTex : TEXCOORD3; + #endif + #if UNITY_UI_CLIP_RECT + half4 mask : TEXCOORD4; + #endif + UNITY_VERTEX_INPUT_INSTANCE_ID + UNITY_VERTEX_OUTPUT_STEREO + }; + + #if UNITY_UI_CLIP_RECT + float4 _ClipRect; + half _UIMaskSoftnessX, _UIMaskSoftnessY; + #endif + + sampler2D _MainTex; + half4 _MainTex_ST, _MainTex_TexelSize, _Color; + half _Alpha; + + #if ATLAS_ON + half _MinXUV, _MaxXUV, _MinYUV, _MaxYUV; + #endif + + #if RECTSIZE_ON + half _RectSize; + #endif + + #if OFFSETUV_ON + half _OffsetUvX, _OffsetUvY; + #endif + + #if CLIPPING_ON + half _ClipUvLeft, _ClipUvRight, _ClipUvUp, _ClipUvDown; + #endif + + #if RADIALCLIPPING_ON + half _RadialStartAngle, _RadialClip, _RadialClip2; + #endif + + #if TWISTUV_ON + half _TwistUvAmount, _TwistUvPosX, _TwistUvPosY, _TwistUvRadius; + #endif + + #if ROTATEUV_ON + half _RotateUvAmount; + #endif + + #if FISHEYE_ON + half _FishEyeUvAmount; + #endif + + #if PINCH_ON + half _PinchUvAmount; + #endif + + #if DOODLE_ON + half _HandDrawnAmount, _HandDrawnSpeed; + #endif + + #if SHAKEUV_ON + half _ShakeUvSpeed, _ShakeUvX, _ShakeUvY; + #endif + + #if WAVEUV_ON + float _WaveAmount, _WaveSpeed, _WaveStrength, _WaveX, _WaveY; + #endif + + #if ROUNDWAVEUV_ON + half _RoundWaveStrength, _RoundWaveSpeed; + #endif + + #if ZOOMUV_ON + half _ZoomUvAmount; + #endif + + #if FADE_ON + sampler2D _FadeTex, _FadeBurnTex; + half4 _FadeBurnColor, _FadeTex_ST, _FadeBurnTex_ST; + half _FadeAmount, _FadeBurnWidth, _FadeBurnTransition,_FadeBurnGlow; + #endif + + #if TEXTURESCROLL_ON + half _TextureScrollXSpeed, _TextureScrollYSpeed; + #endif + + #if GLOW_ON + sampler2D _GlowTex; + half4 _GlowColor; + half _Glow, _GlowGlobal; + #endif + + #if OUTBASE_ON + half4 _OutlineColor; + half _OutlineAlpha, _OutlineGlow, _OutlineWidth; + int _OutlinePixelWidth; + #endif + + #if OUTTEX_ON + sampler2D _OutlineTex; + half4 _OutlineTex_ST; + half _OutlineTexXSpeed, _OutlineTexYSpeed; + #endif + + #if OUTDIST_ON + sampler2D _OutlineDistortTex; + half4 _OutlineDistortTex_ST; + half _OutlineDistortTexXSpeed, _OutlineDistortTexYSpeed, _OutlineDistortAmount; + #endif + + #if DISTORT_ON + sampler2D _DistortTex; + half4 _DistortTex_ST; + half _DistortTexXSpeed, _DistortTexYSpeed, _DistortAmount; + #endif + + #if WARP_ON + half _WarpStrength, _WarpSpeed, _WarpScale; + #endif + + #if WIND_ON + half _GrassSpeed, _GrassWind, _GrassManualAnim, _GrassRadialBend; + #endif + + #if GRADIENT_ON + half _GradBlend, _GradBoostX, _GradBoostY; + half4 _GradTopRightCol, _GradTopLeftCol, _GradBotRightCol, _GradBotLeftCol; + #endif + + #if COLORSWAP_ON + sampler2D _ColorSwapTex; + half4 _ColorSwapRed, _ColorSwapGreen, _ColorSwapBlue; + half _ColorSwapRedLuminosity, _ColorSwapGreenLuminosity, _ColorSwapBlueLuminosity, _ColorSwapBlend; + #endif + + #if HSV_ON + half _HsvShift, _HsvSaturation, _HsvBright; + #endif + + #if HITEFFECT_ON + half4 _HitEffectColor; + half _HitEffectGlow, _HitEffectBlend; + #endif + + #if PIXELATE_ON + half _PixelateSize; + #endif + + #if NEGATIVE_ON + half _NegativeAmount; + #endif + + #if COLORRAMP_ON + sampler2D _ColorRampTex, _ColorRampTexGradient; + half _ColorRampLuminosity, _ColorRampBlend; + #endif + + #if GREYSCALE_ON + half _GreyscaleLuminosity, _GreyscaleBlend; + half4 _GreyscaleTintColor; + #endif + + #if POSTERIZE_ON + half _PosterizeNumColors, _PosterizeGamma; + #endif + + #if BLUR_ON + half _BlurIntensity; + #endif + + #if MOTIONBLUR_ON + half _MotionBlurAngle, _MotionBlurDist; + #endif + + #if GHOST_ON + half _GhostColorBoost, _GhostTransparency, _GhostBlend; + #endif + + #if ALPHAOUTLINE_ON + half _AlphaOutlineGlow, _AlphaOutlinePower, _AlphaOutlineMinAlpha, _AlphaOutlineBlend; + half4 _AlphaOutlineColor; + #endif + + #if INNEROUTLINE_ON + half _InnerOutlineThickness, _InnerOutlineAlpha, _InnerOutlineGlow; + half4 _InnerOutlineColor; + #endif + + #if HOLOGRAM_ON + half _HologramStripesAmount, _HologramMinAlpha, _HologramUnmodAmount, _HologramStripesSpeed, _HologramMaxAlpha, _HologramBlend; + half4 _HologramStripeColor; + #endif + + #if CHROMABERR_ON + half _ChromAberrAmount, _ChromAberrAlpha; + #endif + + #if GLITCH_ON + half _GlitchAmount, _GlitchSize; + #endif + + #if FLICKER_ON + half _FlickerFreq, _FlickerPercent, _FlickerAlpha; + #endif + + #if SHADOW_ON + half _ShadowX, _ShadowY, _ShadowAlpha; + half4 _ShadowColor; + #endif + + #if SHINE_ON + sampler2D _ShineMask; + half4 _ShineColor; + half _ShineLocation, _ShineRotate, _ShineWidth, _ShineGlow; + #endif + + #if ALPHACUTOFF_ON + half _AlphaCutoffValue; + #endif + + #if ALPHAROUND_ON + half _AlphaRoundThreshold; + #endif + + #if CHANGECOLOR_ON + half4 _ColorChangeNewCol, _ColorChangeTarget; + half _ColorChangeTolerance, _ColorChangeLuminosity; + #endif + #if CHANGECOLOR2_ON + half4 _ColorChangeNewCol2, _ColorChangeTarget2; + half _ColorChangeTolerance2; + #endif + #if CHANGECOLOR3_ON + half4 _ColorChangeNewCol3, _ColorChangeTarget3; + half _ColorChangeTolerance3; + #endif + + #if CONTRAST_ON + half _Contrast, _Brightness; + #endif + + #if OVERLAY_ON + sampler2D _OverlayTex; + half4 _OverlayTex_ST, _OverlayColor; + half _OverlayGlow, _OverlayBlend, _OverlayTextureScrollXSpeed, _OverlayTextureScrollYSpeed; + #endif + + UNITY_INSTANCING_BUFFER_START(Props) + UNITY_DEFINE_INSTANCED_PROP(float, _RandomSeed) + UNITY_INSTANCING_BUFFER_END(Props) + + v2f vert(appdata v) + { + #if RECTSIZE_ON + v.vertex.xyz += (v.vertex.xyz * (_RectSize - 1.0)); + #endif + + v2f o; + UNITY_SETUP_INSTANCE_ID(v); + UNITY_TRANSFER_INSTANCE_ID(v, o); + UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o); + + o.vertex = UnityObjectToClipPos(v.vertex); + o.uv = TRANSFORM_TEX(v.uv, _MainTex); + o.color = v.color; + + #if UNITY_UI_CLIP_RECT + half2 pixelSize = o.vertex.w; + pixelSize /= half2(1, 1) * abs(mul((half2x2)UNITY_MATRIX_P, _ScreenParams.xy)); + half4 clampedRect = clamp(_ClipRect, -2e10, 2e10); + half2 maskUV = (v.vertex.xy - clampedRect.xy) / (clampedRect.zw - clampedRect.xy); + o.mask = half4(v.vertex.xy * 2 - clampedRect.xy - clampedRect.zw, 0.25 / (0.25 * half2(_UIMaskSoftnessX, _UIMaskSoftnessY) + abs(pixelSize.xy))); + #endif + + half2 center = half2(0.5, 0.5); + #if ATLAS_ON + center = half2((_MaxXUV + _MinXUV) / 2.0, (_MaxYUV + _MinYUV) / 2.0); + #endif + + #if POLARUV_ON + o.uv = v.uv - center; + #endif + + #if ROTATEUV_ON + half2 uvC = v.uv; + half cosAngle = cos(_RotateUvAmount); + half sinAngle = sin(_RotateUvAmount); + half2x2 rot = half2x2(cosAngle, -sinAngle, sinAngle, cosAngle); + uvC -= center; + o.uv = mul(rot, uvC); + o.uv += center; + #endif + + #if OUTTEX_ON + o.uvOutTex = TRANSFORM_TEX(v.uv, _OutlineTex); + #endif + + #if OUTDIST_ON + o.uvOutDistTex = TRANSFORM_TEX(v.uv, _OutlineDistortTex); + #endif + + #if DISTORT_ON + o.uvDistTex = TRANSFORM_TEX(v.uv, _DistortTex); + #endif + + return o; + } + + half3 GetPixel(in int offsetX, in int offsetY, half2 uv, sampler2D tex) + { + return tex2D(tex, (uv + half2(offsetX * _MainTex_TexelSize.x, offsetY * _MainTex_TexelSize.y))).rgb; + } + + half4 frag(v2f i) : SV_Target + { + UNITY_SETUP_INSTANCE_ID(i); + UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX(i); + half randomSeed = UNITY_ACCESS_INSTANCED_PROP(Props, _RandomSeed); + + float2 uvRect = i.uv; + half2 center = half2(0.5, 0.5); + #if ATLAS_ON + center = half2((_MaxXUV + _MinXUV) / 2.0, (_MaxYUV + _MinYUV) / 2.0); + uvRect = half2((i.uv.x - _MinXUV) / (_MaxXUV - _MinXUV), (i.uv.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half2 centerTiled = half2(center.x * _MainTex_ST.x, center.y * _MainTex_ST.y); + + #if CLIPPING_ON + half2 tiledUv = half2(i.uv.x / _MainTex_ST.x, i.uv.y / _MainTex_ST.y); + #if ATLAS_ON + tiledUv = half2((tiledUv.x - _MinXUV) / (_MaxXUV - _MinXUV), (tiledUv.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + clip((1 - _ClipUvUp) - tiledUv.y); + clip(tiledUv.y - _ClipUvDown); + clip((1 - _ClipUvRight) - tiledUv.x); + clip(tiledUv.x - _ClipUvLeft); + #endif + + #if RADIALCLIPPING_ON + half2 tiledUv2 = half2(i.uv.x / _MainTex_ST.x, i.uv.y / _MainTex_ST.y); + #if ATLAS_ON + tiledUv2 = half2((tiledUv2.x - _MinXUV) / (_MaxXUV - _MinXUV), (tiledUv2.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half startAngle = _RadialStartAngle - _RadialClip; + half endAngle = _RadialStartAngle + _RadialClip2; + half offset0 = clamp(0, 360, startAngle + 360); + half offset360 = clamp(0, 360, endAngle - 360); + half2 atan2Coord = half2(lerp(-1, 1, tiledUv2.x), lerp(-1, 1, tiledUv2.y)); + half atanAngle = atan2(atan2Coord.y, atan2Coord.x) * 57.3; // angle in degrees + if(atanAngle < 0) atanAngle = 360 + atanAngle; + if(atanAngle >= startAngle && atanAngle <= endAngle) discard; + if(atanAngle <= offset360) discard; + if(atanAngle >= offset0) discard; + #endif + + #if TEXTURESCROLL_ON && ATLAS_ON + i.uv = half2(_MinXUV + ((_MaxXUV - _MinXUV) * (abs(((_Time.y + randomSeed) * _TextureScrollXSpeed) + uvRect.x) % 1)), + _MinYUV + ((_MaxYUV - _MinYUV) * (abs(((_Time.y + randomSeed) * _TextureScrollYSpeed) + uvRect.y) % 1))); + #endif + + #if OFFSETUV_ON + #if ATLAS_ON + i.uv = half2(_MinXUV + ((_MaxXUV - _MinXUV) * (abs((_OffsetUvX + uvRect.x) % 1))), + _MinYUV + ((_MaxYUV - _MinYUV) * (abs(_OffsetUvY + uvRect.y) % 1))); + #else + i.uv += half2(_OffsetUvX, _OffsetUvY); + #endif + #endif + + #if POLARUV_ON + i.uv = half2(atan2(i.uv.y, i.uv.x) / (2.0f * 3.141592653589f), length(i.uv)); + i.uv *= _MainTex_ST.xy; + #endif + + #if TWISTUV_ON + #if ATLAS_ON + _TwistUvPosX = ((_MaxXUV - _MinXUV) * _TwistUvPosX) + _MinXUV; + _TwistUvPosY = ((_MaxYUV - _MinYUV) * _TwistUvPosY) + _MinYUV; + #endif + half2 tempUv = i.uv - half2(_TwistUvPosX * _MainTex_ST.x, _TwistUvPosY * _MainTex_ST.y); + _TwistUvRadius *= (_MainTex_ST.x + _MainTex_ST.y) / 2; + half percent = (_TwistUvRadius - length(tempUv)) / _TwistUvRadius; + half theta = percent * percent * (2.0 * sin(_TwistUvAmount)) * 8.0; + half s = sin(theta); + half c = cos(theta); + half beta = max(sign(_TwistUvRadius - length(tempUv)), 0.0); + tempUv = half2(dot(tempUv, half2(c, -s)), dot(tempUv, half2(s, c))) * beta + tempUv * (1 - beta); + tempUv += half2(_TwistUvPosX * _MainTex_ST.x, _TwistUvPosY * _MainTex_ST.y); + i.uv = tempUv; + #endif + + #if FISHEYE_ON + half bind = length(centerTiled); + half2 dF = i.uv - centerTiled; + half dFlen = length(dF); + half fishInt = (3.14159265359 / bind) * (_FishEyeUvAmount + 0.001); + i.uv = centerTiled + (dF / (max(0.0001, dFlen))) * tan(dFlen * fishInt) * bind / tan(bind * fishInt); + #endif + + #if PINCH_ON + half2 dP = i.uv - centerTiled; + half pinchInt = (3.141592 / length(centerTiled)) * (-_PinchUvAmount + 0.001); + i.uv = centerTiled + normalize(dP) * atan(length(dP) * -pinchInt * 10.0) * 0.5 / atan(-pinchInt * 5); + #endif + + #if ZOOMUV_ON + i.uv -= centerTiled; + i.uv = i.uv * _ZoomUvAmount; + i.uv += centerTiled; + #endif + + #if DOODLE_ON + half2 uvCopy = uvRect; + _HandDrawnSpeed = (floor((_Time.x + randomSeed) * 20 * _HandDrawnSpeed) / _HandDrawnSpeed) * _HandDrawnSpeed; + uvCopy.x = sin((uvCopy.x * _HandDrawnAmount + _HandDrawnSpeed) * 4); + uvCopy.y = cos((uvCopy.y * _HandDrawnAmount + _HandDrawnSpeed) * 4); + i.uv = lerp(i.uv, i.uv + uvCopy, 0.0005 * _HandDrawnAmount); + #endif + + #if SHAKEUV_ON + half xShake = sin((_Time.x + randomSeed) * _ShakeUvSpeed * 50) * _ShakeUvX; + half yShake = cos((_Time.x + randomSeed) * _ShakeUvSpeed * 50) * _ShakeUvY; + i.uv += half2(xShake * 0.012, yShake * 0.01); + #endif + + #if RECTSIZE_ON + i.uv = i.uv.xy * (_RectSize).xx + (((-_RectSize * 0.5) + 0.5)).xx; + #endif + + #if DISTORT_ON + #if ATLAS_ON + i.uvDistTex.x = i.uvDistTex.x * (1 / (_MaxXUV - _MinXUV)); + i.uvDistTex.y = i.uvDistTex.y * (1 / (_MaxYUV - _MinYUV)); + #endif + i.uvDistTex.x += ((_Time.x + randomSeed) * _DistortTexXSpeed) % 1; + i.uvDistTex.y += ((_Time.x + randomSeed) * _DistortTexYSpeed) % 1; + half distortAmnt = (tex2D(_DistortTex, i.uvDistTex).r - 0.5) * 0.2 * _DistortAmount; + i.uv.x += distortAmnt; + i.uv.y += distortAmnt; + #endif + + #if WARP_ON + half2 warpUv = half2(i.uv.x / _MainTex_ST.x, i.uv.y / _MainTex_ST.y); + #if ATLAS_ON + warpUv = half2((warpUv.x - _MinXUV) / (_MaxXUV - _MinXUV), (warpUv.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + const float tau = 6.283185307179586; + float xWarp = (_Time.y + randomSeed) * _WarpSpeed + warpUv.x * tau / _WarpScale; + float yWarp = (_Time.y + randomSeed) * _WarpSpeed + warpUv.y * tau / _WarpScale; + float2 warp = float2(sin(xWarp), sin(yWarp)) * _WarpStrength; + i.uv += warp; + #endif + + #if WAVEUV_ON + float2 uvWave = half2(_WaveX * _MainTex_ST.x, _WaveY * _MainTex_ST.y) - i.uv; + uvWave %= 1; + #if ATLAS_ON + uvWave = half2(_WaveX, _WaveY) - uvRect; + #endif + uvWave.x *= _ScreenParams.x / _ScreenParams.y; + float waveTime = _Time.y + randomSeed; + float angWave = (sqrt(dot(uvWave, uvWave)) * _WaveAmount) - ((waveTime * _WaveSpeed)); + i.uv = i.uv + uvWave * sin(angWave) * (_WaveStrength / 1000.0); + #endif + + #if ROUNDWAVEUV_ON + half xWave = ((0.5 * _MainTex_ST.x) - uvRect.x); + half yWave = ((0.5 * _MainTex_ST.y) - uvRect.y) * (_MainTex_TexelSize.w / _MainTex_TexelSize.z); + half ripple = -sqrt(xWave*xWave + yWave* yWave); + i.uv += (sin((ripple + (_Time.y + randomSeed) * (_RoundWaveSpeed/10.0)) / 0.015) * (_RoundWaveStrength/10.0)) % 1; + #endif + + #if WIND_ON + half windOffset = sin((_Time.x + randomSeed) * _GrassSpeed * 10); + half2 windCenter = half2(0.5, 0.1); + #if ATLAS_ON + windCenter.x = ((_MaxXUV - _MinXUV) * windCenter.x) + _MinXUV; + windCenter.y = ((_MaxYUV - _MinYUV) * windCenter.y) + _MinYUV; + #endif + #if !MANUALWIND_ON + i.uv.x = fmod(abs(lerp(i.uv.x, i.uv.x + (_GrassWind * 0.01 * windOffset), uvRect.y)), 1); + #else + i.uv.x = fmod(abs(lerp(i.uv.x, i.uv.x + (_GrassWind * 0.01 * _GrassManualAnim), uvRect.y)), 1); + windOffset = _GrassManualAnim; + #endif + half2 delta = i.uv - windCenter; + half delta2 = dot(delta.xy, delta.xy); + half2 delta_offset = delta2 * windOffset; + i.uv = i.uv + half2(delta.y, -delta.x) * delta_offset * _GrassRadialBend; + #endif + + #if TEXTURESCROLL_ON && !ATLAS_ON + i.uv.x += ((_Time.y + randomSeed) * _TextureScrollXSpeed) % 1; + i.uv.y += ((_Time.y + randomSeed) * _TextureScrollYSpeed) % 1; + #endif + + #if PIXELATE_ON + half aspectRatio = _MainTex_TexelSize.x / _MainTex_TexelSize.y; + half2 pixelSize = float2(_PixelateSize, _PixelateSize * aspectRatio); + i.uv = floor(i.uv * pixelSize) / pixelSize; + #endif + + half4 col = tex2D(_MainTex, i.uv); + half originalAlpha = col.a; + col *= i.color; + #if PREMULTIPLYALPHA_ON + col.rgb *= col.a; + #endif + + #if GLITCH_ON + half2 uvGlitch = uvRect; + uvGlitch.y -= 0.5; + half lineNoise = pow(rand2(floor(uvGlitch * half2(24., 19.) * _GlitchSize) * 4.0, randomSeed), 3.0) * _GlitchAmount + * pow(rand2(floor(uvGlitch * half2(38., 14.) * _GlitchSize) * 4.0, randomSeed), 3.0); + col = tex2D(_MainTex, i.uv + half2(lineNoise * 0.02 * rand2(half2(2.0, 1), randomSeed), 0)) * i.color; + #endif + + #if CHROMABERR_ON + half4 r = tex2D(_MainTex, i.uv + half2(_ChromAberrAmount/10, 0)) * i.color; + half4 b = tex2D(_MainTex, i.uv + half2(-_ChromAberrAmount/10, 0)) * i.color; + col = half4(r.r * r.a, col.g, b.b * b.a, max(max(r.a, b.a) * _ChromAberrAlpha, col.a)); + #endif + + #if BLUR_ON + #if ATLAS_ON + #if !BLURISHD_ON + col = BlurHD(i.uv, _MainTex, _BlurIntensity, (_MaxXUV - _MinXUV), (_MaxYUV - _MinYUV)) * i.color; + #else + col = Blur(i.uv, _MainTex, _BlurIntensity * (_MaxXUV - _MinXUV)) * i.color; + #endif + #else + #if !BLURISHD_ON + col = BlurHD(i.uv, _MainTex, _BlurIntensity, 1, 1) * i.color; + #else + col = Blur(i.uv, _MainTex, _BlurIntensity) * i.color; + #endif + #endif + #endif + + #if MOTIONBLUR_ON + _MotionBlurAngle = _MotionBlurAngle * 3.1415926; + #define rot(n) mul(n, half2x2(cos(_MotionBlurAngle), -sin(_MotionBlurAngle), sin(_MotionBlurAngle), cos(_MotionBlurAngle))) + _MotionBlurDist = _MotionBlurDist * 0.005; + #if ATLAS_ON + _MotionBlurDist *= (_MaxXUV - _MinXUV); + #endif + col.rgb += tex2D(_MainTex, i.uv + rot(half2(-_MotionBlurDist, -_MotionBlurDist))); + col.rgb += tex2D(_MainTex, i.uv + rot(half2(-_MotionBlurDist * 2, -_MotionBlurDist * 2))); + col.rgb += tex2D(_MainTex, i.uv + rot(half2(-_MotionBlurDist * 3, -_MotionBlurDist * 3))); + col.rgb += tex2D(_MainTex, i.uv + rot(half2(-_MotionBlurDist * 4, -_MotionBlurDist * 4))); + col.rgb += tex2D(_MainTex, i.uv + rot(half2(_MotionBlurDist, _MotionBlurDist))); + col.rgb += tex2D(_MainTex, i.uv + rot(half2(_MotionBlurDist * 2, _MotionBlurDist * 2))); + col.rgb += tex2D(_MainTex, i.uv + rot(half2(_MotionBlurDist * 3, _MotionBlurDist * 3))); + col.rgb += tex2D(_MainTex, i.uv + rot(half2(_MotionBlurDist * 4, _MotionBlurDist * 4))); + col.rgb = col.rgb / 9; + #endif + + #if NEGATIVE_ON + col.rgb = lerp(col.rgb, 1 - col.rgb, _NegativeAmount); + #endif + + half luminance = 0; + #if GREYSCALE_ON && !GREYSCALEOUTLINE_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + luminance = saturate(luminance + _GreyscaleLuminosity); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _GreyscaleTintColor, _GreyscaleBlend); + #endif + + #if GHOST_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + half4 ghostResult; + ghostResult.a = saturate(luminance - _GhostTransparency) * col.a; + ghostResult.rgb = col.rgb * (luminance + _GhostColorBoost); + col = lerp(col, ghostResult, _GhostBlend); + #endif + + #if INNEROUTLINE_ON + half3 innerT = abs(GetPixel(0, _InnerOutlineThickness, i.uv, _MainTex) - GetPixel(0, -_InnerOutlineThickness, i.uv, _MainTex)); + innerT += abs(GetPixel(_InnerOutlineThickness, 0, i.uv, _MainTex) - GetPixel(-_InnerOutlineThickness, 0, i.uv, _MainTex)); + #if !ONLYINNEROUTLINE_ON + innerT = (innerT / 2.0) * col.a * _InnerOutlineAlpha; + col.rgb += length(innerT) * _InnerOutlineColor.rgb * _InnerOutlineGlow; + #else + innerT *= col.a * _InnerOutlineAlpha; + col.rgb = length(innerT) * _InnerOutlineColor.rgb * _InnerOutlineGlow; + col.a = step(0.3, col.r+col.g+col.b); + #endif + #endif + + #if HITEFFECT_ON + col.rgb = lerp(col.rgb, _HitEffectColor.rgb * _HitEffectGlow, _HitEffectBlend); + #endif + + #if GRADIENT_ON + half2 tiledUvGrad = half2(uvRect.x / _MainTex_ST.x, uvRect.y / _MainTex_ST.y); + #if GRADIENT2COL_ON + _GradTopRightCol = _GradTopLeftCol; + _GradBotRightCol = _GradBotLeftCol; + #endif + #if RADIALGRADIENT_ON + half radialDist = 1 - length(tiledUvGrad - half2(0.5, 0.5)); + radialDist *= (_MainTex_TexelSize.w / _MainTex_TexelSize.z); + radialDist = saturate(_GradBoostX * radialDist); + half4 gradientResult = lerp(_GradTopLeftCol, _GradBotLeftCol, radialDist); + #else + half gradXLerpFactor = saturate(pow(tiledUvGrad.x, _GradBoostX)); + half4 gradientResult = lerp(lerp(_GradBotLeftCol, _GradBotRightCol, gradXLerpFactor), + lerp(_GradTopLeftCol, _GradTopRightCol, gradXLerpFactor), saturate(pow(tiledUvGrad.y, _GradBoostY))); + #endif + gradientResult = lerp(col, gradientResult, _GradBlend); + col.rgb = gradientResult.rgb * col.a; + col.a *= gradientResult.a; + #endif + + #if CONTRAST_ON + col.rgb = (col.rgb - float3(0.5, 0.5, 0.5)) * _Contrast + float3(0.5, 0.5, 0.5); + col.rgb += _Brightness; + #endif + + #if COLORSWAP_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + half4 swapMask = tex2D(_ColorSwapTex, i.uv); + swapMask.rgb *= swapMask.a; + half3 redSwap = _ColorSwapRed * swapMask.r * saturate(luminance + _ColorSwapRedLuminosity); + half3 greenSwap = _ColorSwapGreen * swapMask.g * saturate(luminance + _ColorSwapGreenLuminosity); + half3 blueSwap = _ColorSwapBlue * swapMask.b * saturate(luminance + _ColorSwapBlueLuminosity); + swapMask.rgb = col.rgb * saturate(1 - swapMask.r - swapMask.g - swapMask.b); + col.rgb = lerp(col.rgb, swapMask.rgb + redSwap + greenSwap + blueSwap, _ColorSwapBlend); + #endif + + #if COLORRAMP_ON && !COLORRAMPOUTLINE_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + luminance = saturate(luminance + _ColorRampLuminosity); + #if GRADIENTCOLORRAMP_ON + col.rgb = lerp(col.rgb, tex2D(_ColorRampTexGradient, half2(luminance, 0)).rgb, _ColorRampBlend); + #else + col.rgb = lerp(col.rgb, tex2D(_ColorRampTex, half2(luminance, 0)).rgb, _ColorRampBlend); + #endif + #endif + + #if CHANGECOLOR_ON + float3 currChangeColor = saturate(col.rgb); + luminance = 0.3 * currChangeColor.r + 0.59 * currChangeColor.g + 0.11 * currChangeColor.b; + luminance = saturate(luminance + _ColorChangeLuminosity); + half3 dif = abs(currChangeColor - _ColorChangeTarget.rgb); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _ColorChangeNewCol.rgb, + max(sign(1 - saturate(dif.x + dif.y + dif.z) - _ColorChangeTolerance), 0.0)); + #if CHANGECOLOR2_ON + dif = abs(currChangeColor - _ColorChangeTarget2.rgb); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _ColorChangeNewCol2.rgb, + max(sign(1 - saturate(dif.x + dif.y + dif.z) - _ColorChangeTolerance2), 0.0)); + #endif + #if CHANGECOLOR3_ON + dif = abs(currChangeColor - _ColorChangeTarget3.rgb); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _ColorChangeNewCol3.rgb, + max(sign(1 - saturate(dif.x + dif.y + dif.z) - _ColorChangeTolerance3), 0.0)); + #endif + #endif + + #if POSTERIZE_ON && !POSTERIZEOUTLINE_ON + col.rgb = pow(col.rgb, _PosterizeGamma) * _PosterizeNumColors; + col.rgb = floor(col.rgb) / _PosterizeNumColors; + col.rgb = pow(col.rgb, 1.0 / _PosterizeGamma); + #endif + + #if HSV_ON + half3 resultHsv = half3(col.rgb); + half cosHsv = _HsvBright * _HsvSaturation * cos(_HsvShift * 3.14159265 / 180); + half sinHsv = _HsvBright * _HsvSaturation * sin(_HsvShift * 3.14159265 / 180); + resultHsv.x = (.299 * _HsvBright + .701 * cosHsv + .168 * sinHsv) * col.x + + (.587 * _HsvBright - .587 * cosHsv + .330 * sinHsv) * col.y + + (.114 * _HsvBright - .114 * cosHsv - .497 * sinHsv) * col.z; + resultHsv.y = (.299 * _HsvBright - .299 * cosHsv - .328 * sinHsv) *col.x + + (.587 * _HsvBright + .413 * cosHsv + .035 * sinHsv) * col.y + + (.114 * _HsvBright - .114 * cosHsv + .292 * sinHsv) * col.z; + resultHsv.z = (.299 * _HsvBright - .3 * cosHsv + 1.25 * sinHsv) * col.x + + (.587 * _HsvBright - .588 * cosHsv - 1.05 * sinHsv) * col.y + + (.114 * _HsvBright + .886 * cosHsv - .203 * sinHsv) * col.z; + col.rgb = resultHsv; + #endif + + #if OVERLAY_ON + half2 overlayUvs = i.uv; + overlayUvs.x += ((_Time.y + randomSeed) * _OverlayTextureScrollXSpeed) % 1; + overlayUvs.y += ((_Time.y + randomSeed) * _OverlayTextureScrollYSpeed) % 1; + half4 overlayCol = tex2D(_OverlayTex, TRANSFORM_TEX(overlayUvs, _OverlayTex)); + overlayCol.rgb *= _OverlayColor.rgb * _OverlayGlow; + #if !OVERLAYMULT_ON + overlayCol.rgb *= overlayCol.a * _OverlayColor.rgb * _OverlayColor.a * _OverlayBlend; + col.rgb += overlayCol.rgb; + #else + overlayCol.a *= _OverlayColor.a; + col = lerp(col, col * overlayCol, _OverlayBlend); + #endif + #endif + + //OUTLINE------------------------------------------------------------- + #if OUTBASE_ON + #if OUTBASEPIXELPERF_ON + half2 destUv = half2(_OutlinePixelWidth * _MainTex_TexelSize.x, _OutlinePixelWidth * _MainTex_TexelSize.y); + #else + half2 destUv = half2(_OutlineWidth * _MainTex_TexelSize.x * 200, _OutlineWidth * _MainTex_TexelSize.y * 200); + #endif + + #if OUTDIST_ON + i.uvOutDistTex.x += ((_Time.x + randomSeed) * _OutlineDistortTexXSpeed) % 1; + i.uvOutDistTex.y += ((_Time.x + randomSeed) * _OutlineDistortTexYSpeed) % 1; + #if ATLAS_ON + i.uvOutDistTex = half2((i.uvOutDistTex.x - _MinXUV) / (_MaxXUV - _MinXUV), (i.uvOutDistTex.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half outDistortAmnt = (tex2D(_OutlineDistortTex, i.uvOutDistTex).r - 0.5) * 0.2 * _OutlineDistortAmount; + destUv.x += outDistortAmnt; + destUv.y += outDistortAmnt; + #endif + + half spriteLeft = tex2D(_MainTex, i.uv + half2(destUv.x, 0)).a; + half spriteRight = tex2D(_MainTex, i.uv - half2(destUv.x, 0)).a; + half spriteBottom = tex2D(_MainTex, i.uv + half2(0, destUv.y)).a; + half spriteTop = tex2D(_MainTex, i.uv - half2(0, destUv.y)).a; + half result = spriteLeft + spriteRight + spriteBottom + spriteTop; + + #if OUTBASE8DIR_ON + half spriteTopLeft = tex2D(_MainTex, i.uv + half2(destUv.x, destUv.y)).a; + half spriteTopRight = tex2D(_MainTex, i.uv + half2(-destUv.x, destUv.y)).a; + half spriteBotLeft = tex2D(_MainTex, i.uv + half2(destUv.x, -destUv.y)).a; + half spriteBotRight = tex2D(_MainTex, i.uv + half2(-destUv.x, -destUv.y)).a; + result = result + spriteTopLeft + spriteTopRight + spriteBotLeft + spriteBotRight; + #endif + + result = step(0.05, saturate(result)); + + #if OUTTEX_ON + i.uvOutTex.x += ((_Time.x + randomSeed) * _OutlineTexXSpeed) % 1; + i.uvOutTex.y += ((_Time.x + randomSeed) * _OutlineTexYSpeed) % 1; + #if ATLAS_ON + i.uvOutTex = half2((i.uvOutTex.x - _MinXUV) / (_MaxXUV - _MinXUV), (i.uvOutTex.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half4 tempOutColor = tex2D(_OutlineTex, i.uvOutTex); + tempOutColor *= _OutlineColor; + _OutlineColor = tempOutColor; + #endif + + result *= (1 - originalAlpha) * _OutlineAlpha; + + half4 outline = _OutlineColor * i.color.a; + outline.rgb *= _OutlineGlow; + outline.a = result; + #if ONLYOUTLINE_ON + col = outline; + #else + col = lerp(col, outline, result); + #endif + #endif + //----------------------------------------------------------------------------- + + #if FADE_ON + half2 tiledUvFade1= TRANSFORM_TEX(i.uv, _FadeTex); + half2 tiledUvFade2 = TRANSFORM_TEX(i.uv, _FadeBurnTex); + #if ATLAS_ON + tiledUvFade1 = half2((tiledUvFade1.x - _MinXUV) / (_MaxXUV - _MinXUV), (tiledUvFade1.y - _MinYUV) / (_MaxYUV - _MinYUV)); + tiledUvFade2 = half2((tiledUvFade2.x - _MinXUV) / (_MaxXUV - _MinXUV), (tiledUvFade2.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half fadeTemp = tex2D(_FadeTex, tiledUvFade1).r; + half fade = smoothstep(_FadeAmount, _FadeAmount + _FadeBurnTransition, fadeTemp); + half fadeBurn = saturate(smoothstep(_FadeAmount - _FadeBurnWidth, _FadeAmount - _FadeBurnWidth + 0.1, fadeTemp) * _FadeAmount); + col.a *= fade; + _FadeBurnColor.rgb *= _FadeBurnGlow; + col += fadeBurn * tex2D(_FadeBurnTex, tiledUvFade2) * _FadeBurnColor * originalAlpha * (1 - col.a); + #endif + + #if SHADOW_ON + half shadowA = tex2D(_MainTex, i.uv + half2(_ShadowX, _ShadowY)).a; + half preMultShadowMask = 1 - (saturate(shadowA - col.a) * (1 - col.a)); + col.rgb *= 1 - ((shadowA - col.a) * (1 - col.a)); + col.rgb += (_ShadowColor * shadowA) * (1 - col.a); + col.a = max(shadowA * _ShadowAlpha * i.color.a, col.a); + #endif + + #if GLOW_ON + half4 emission; + #if GLOWTEX_ON + emission = tex2D(_GlowTex, i.uv); + #else + emission = col; + #endif + col.rgb *= _GlowGlobal; + emission.rgb *= emission.a * col.a * _Glow * _GlowColor; + col.rgb += emission.rgb; + #endif + + #if COLORRAMP_ON && COLORRAMPOUTLINE_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + luminance = saturate(luminance + _ColorRampLuminosity); + #if GRADIENTCOLORRAMP_ON + col.rgb = lerp(col.rgb, tex2D(_ColorRampTexGradient, half2(luminance, 0)).rgb, _ColorRampBlend); + #else + col.rgb = lerp(col.rgb, tex2D(_ColorRampTex, half2(luminance, 0)).rgb, _ColorRampBlend); + #endif + #endif + + #if GREYSCALE_ON && GREYSCALEOUTLINE_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + luminance = saturate(luminance + _GreyscaleLuminosity); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _GreyscaleTintColor, _GreyscaleBlend); + #endif + + #if POSTERIZE_ON && POSTERIZEOUTLINE_ON + col.rgb = pow(col.rgb, _PosterizeGamma) * _PosterizeNumColors; + col.rgb = floor(col.rgb) / _PosterizeNumColors; + col.rgb = pow(col.rgb, 1.0 / _PosterizeGamma); + #endif + + #if SHINE_ON + half2 uvShine = uvRect; + half cosAngle = cos(_ShineRotate); + half sinAngle = sin(_ShineRotate); + half2x2 rot = half2x2(cosAngle, -sinAngle, sinAngle, cosAngle); + uvShine -= half2(0.5, 0.5); + uvShine = mul(rot, uvShine); + uvShine += half2(0.5, 0.5); + half shineMask = tex2D(_ShineMask, i.uv).a; + half currentDistanceProjection = (uvShine.x + uvShine.y) / 2; + half whitePower = 1 - (abs(currentDistanceProjection - _ShineLocation) / _ShineWidth); + col.rgb += col.a * whitePower * _ShineGlow * max(sign(currentDistanceProjection - (_ShineLocation - _ShineWidth)), 0.0) + * max(sign((_ShineLocation + _ShineWidth) - currentDistanceProjection), 0.0) * _ShineColor * shineMask; + #endif + + #if HOLOGRAM_ON + half totalHologram = _HologramStripesAmount + _HologramUnmodAmount; + half hologramYCoord = ((uvRect.y + (((_Time.x + randomSeed) % 1) * _HologramStripesSpeed)) % totalHologram) / totalHologram; + hologramYCoord = abs(hologramYCoord); + half alpha = RemapFloat(saturate(hologramYCoord - (_HologramUnmodAmount/totalHologram)), 0.0, 1.0, _HologramMinAlpha, saturate(_HologramMaxAlpha)); + half hologramMask = max(sign((_HologramUnmodAmount/totalHologram) - hologramYCoord), 0.0); + half4 hologramResult = col; + hologramResult.a *= lerp(alpha, 1, hologramMask); + hologramResult.rgb *= max(1, _HologramMaxAlpha * max(sign(hologramYCoord - (_HologramUnmodAmount/totalHologram)), 0.0)); + hologramMask = 1 - step(0.01,hologramMask); + hologramResult.rgb += hologramMask * _HologramStripeColor * col.a; + col = lerp(col, hologramResult, _HologramBlend); + #endif + + #if FLICKER_ON + col.a *= saturate(col.a * step(frac(0.05 + (_Time.w + randomSeed) * _FlickerFreq), 1 - _FlickerPercent) + _FlickerAlpha); + #endif + + col.a *= _Alpha; + + #if UNITY_UI_CLIP_RECT + half2 clipMask = saturate((_ClipRect.zw - _ClipRect.xy - abs(i.mask.xy)) * i.mask.zw); + col.a *= clipMask.x * clipMask.y; + #endif + + #if UNITY_UI_ALPHACLIP + clip (col.a - 0.001); + #endif + + #if ALPHACUTOFF_ON + clip((1 - _AlphaCutoffValue) - (1 - col.a) - 0.01); + #endif + + #if ALPHAROUND_ON + col.a = step(_AlphaRoundThreshold, col.a); + #endif + + #if ALPHAOUTLINE_ON + half alphaOutlineRes = pow(1 - col.a, max(_AlphaOutlinePower, 0.0001)) * step(_AlphaOutlineMinAlpha, col.a) * _AlphaOutlineBlend; + col.rgb = lerp(col.rgb, _AlphaOutlineColor.rgb * _AlphaOutlineGlow, alphaOutlineRes); + col.a = lerp(col.a, 1, alphaOutlineRes > 1); + #endif + + col *= _Color; + + return col; + } + ENDCG + } + } + CustomEditor "AllIn1SpriteShaderUiMaskMaterialInspector" + //Fallback "Sprites/Default" //Remove fallback so that any shader error is obvious to the user +} \ No newline at end of file diff --git a/Assets/Plugins/AllIn1SpriteShader/Shaders/AllIn1SpriteShaderUiMask.shader.meta b/Assets/Plugins/AllIn1SpriteShader/Shaders/AllIn1SpriteShaderUiMask.shader.meta new file mode 100644 index 000000000..b91f557c3 --- /dev/null +++ b/Assets/Plugins/AllIn1SpriteShader/Shaders/AllIn1SpriteShaderUiMask.shader.meta @@ -0,0 +1,29 @@ +fileFormatVersion: 2 +guid: a53f4bb29f3644b43b5075c6dcfecb32 +ShaderImporter: + externalObjects: {} + defaultTextures: + - _MainTex: {instanceID: 0} + - _GlowTex: {instanceID: 0} + - _FadeTex: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + - _FadeBurnTex: {fileID: 2800000, guid: 677cca399782dea41aedc1d292ecb67d, type: 3} + - _OutlineTex: {fileID: 2800000, guid: 74087f6d03f233e4a8a142fa01f9e5cf, type: 3} + - _OutlineDistortTex: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, + type: 3} + - _ColorSwapTex: {instanceID: 0} + - _ColorRampTex: {fileID: 2800000, guid: 279657edc397ece4b8029c727adf6ddc, type: 3} + - _DistortTex: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + - _ShineMask: {instanceID: 0} + - _ColorRampTexGradient: {instanceID: 0} + - _OverlayTex: {fileID: 2800000, guid: 677cca399782dea41aedc1d292ecb67d, type: 3} + nonModifiableTextures: [] + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 156513 + packageName: All In 1 Sprite Shader + packageVersion: 4.25 + assetPath: Assets/Plugins/AllIn1SpriteShader/Shaders/AllIn1SpriteShaderUiMask.shader + uploadId: 708810 diff --git a/Assets/Plugins/AllIn1SpriteShader/Shaders/AllIn1SpriteShaderUiMaskScaledTime.shader b/Assets/Plugins/AllIn1SpriteShader/Shaders/AllIn1SpriteShaderUiMaskScaledTime.shader new file mode 100644 index 000000000..45cab0a8d --- /dev/null +++ b/Assets/Plugins/AllIn1SpriteShader/Shaders/AllIn1SpriteShaderUiMaskScaledTime.shader @@ -0,0 +1,1249 @@ +Shader "AllIn1SpriteShader/AllIn1SpriteShaderUiMaskScaledTime" +{ + Properties + { + _MainTex ("Main Texture", 2D) = "white" {} //0 + _Color("Main Color", Color) = (1,1,1,1) //1 + _Alpha("General Alpha", Range(0,1)) = 1 //2 + + _GlowColor("Glow Color", Color) = (1,1,1,1) //3 + _Glow("Glow Color Intensity", Range(0,100)) = 10 //4 + _GlowGlobal("Global Glow Intensity", Range(1,100)) = 1 //5 + [NoScaleOffset] _GlowTex("Glow Texture", 2D) = "white" {} //6 + + _FadeTex("Fade Texture", 2D) = "white" {} //7 + _FadeAmount("Fade Amount", Range(-0.1,1)) = -0.1 //8 + _FadeBurnWidth("Fade Burn Width", Range(0,1)) = 0.025 //9 + _FadeBurnTransition("Burn Transition", Range(0.01,0.5)) = 0.075 //10 + _FadeBurnColor("Fade Burn Color", Color) = (1,1,0,1) //11 + _FadeBurnTex("Fade Burn Texture", 2D) = "white" {} //12 + _FadeBurnGlow("Fade Burn Glow", Range(1,250)) = 2//13 + + _OutlineColor("Outline Base Color", Color) = (1,1,1,1) //14 + _OutlineAlpha("Outline Base Alpha", Range(0,1)) = 1 //15 + _OutlineGlow("Outline Base Glow", Range(1,100)) = 1.5 //16 + _OutlineWidth("Outline Base Width", Range(0,0.2)) = 0.004 //17 + _OutlinePixelWidth("Outline Base Pixel Width", Int) = 1 //18 + + [Space] + _OutlineTex("Outline Texture", 2D) = "white" {} //19 + _OutlineTexXSpeed("Texture scroll speed X", Range(-50,50)) = 10 //20 + _OutlineTexYSpeed("Texture scroll speed Y", Range(-50,50)) = 0 //21 + + [Space] + _OutlineDistortTex("Outline Distortion Texture", 2D) = "white" {} //22 + _OutlineDistortAmount("Outline Distortion Amount", Range(0,2)) = 0.5 //23 + _OutlineDistortTexXSpeed("Distortion scroll speed X", Range(-50,50)) = 5 //24 + _OutlineDistortTexYSpeed("Distortion scroll speed Y", Range(-50,50)) = 5 //25 + + _AlphaOutlineColor("Color", Color) = (1, 1, 1, 1) //26 + _AlphaOutlineGlow("Outline Glow", Range(1,100)) = 5 //27 + _AlphaOutlinePower("Power", Range(0, 5)) = 1 // 28 + _AlphaOutlineMinAlpha("Min Alpha", Range(0, 1)) = 0 // 29 + _AlphaOutlineBlend("Blend", Range(0, 1)) = 1 // 30 + + _GradBlend("Gradient Blend", Range(0,1)) = 1 //31 + _GradTopLeftCol("Top Color", Color) = (1,0,0,1) //32 + _GradTopRightCol("Top Color 2", Color) = (1, 1, 0, 1) //33 + _GradBotLeftCol("Bot Color", Color) = (0,0,1,1) //34 + _GradBotRightCol("Bot Color 2", Color) = (0, 1, 0, 1) //35 + + [NoScaleOffset] _ColorSwapTex("Color Swap Texture", 2D) = "black" {} //36 + [HDR] _ColorSwapRed("Red Channel", Color) = (1,1,1,1) //37 + _ColorSwapRedLuminosity("Red luminosity", Range(-1,1)) = 0.5 //38 + [HDR] _ColorSwapGreen("Green Channel", Color) = (1,1,1,1) //39 + _ColorSwapGreenLuminosity("Green luminosity", Range(-1,1)) = 0.5 //40 + [HDR] _ColorSwapBlue("Blue Channel", Color) = (1,1,1,1) //41 + _ColorSwapBlueLuminosity("Blue luminosity", Range(-1,1)) = 0.5 //42 + + _HsvShift("Hue Shift", Range(0, 360)) = 180 //43 + _HsvSaturation("Saturation", Range(0, 2)) = 1 //44 + _HsvBright("Brightness", Range(0, 2)) = 1 //45 + + _HitEffectColor("Hit Effect Color", Color) = (1,1,1,1) //46 + _HitEffectGlow("Glow Intensity", Range(1,100)) = 5 //47 + [Space] + _HitEffectBlend("Hit Effect Blend", Range(0,1)) = 1 //48 + + _NegativeAmount("Negative Amount", Range(0, 1)) = 1 //49 + + _PixelateSize("Pixelate size", Range(4,512)) = 32 //50 + + [NoScaleOffset] _ColorRampTex("Color ramp Texture", 2D) = "white" {} //51 + _ColorRampLuminosity("Color ramp luminosity", Range(-1,1)) = 0 //52 + [Toggle()] _ColorRampOutline("Affects everything?", float) = 0 //53 + + _GreyscaleLuminosity("Greyscale luminosity", Range(-1,1)) = 0 //54 + [Toggle()] _GreyscaleOutline("Affects everything?", float) = 0 //55 + _GreyscaleTintColor("Greyscale Tint Color", Color) = (1,1,1,1) //56 + + _PosterizeNumColors("Number of Colors", Range(0,100)) = 8 //57 + _PosterizeGamma("Posterize Amount", Range(0.1,10)) = 0.75 //58 + [Toggle()] _PosterizeOutline("Affects everything?", float) = 0 //59 + + _BlurIntensity("Blur Intensity", Range(0,100)) = 10 //60 + [Toggle()] _BlurHD("Blur is Low Res?", float) = 0 //61 + + _MotionBlurAngle("Motion Blur Angle", Range(-1, 1)) = 0.1 //62 + _MotionBlurDist("Motion Blur Distance", Range(-3, 3)) = 1.25 //63 + + _GhostColorBoost("Ghost Color Boost", Range(0,5)) = 1 //64 + _GhostTransparency("Ghost Transparency", Range(0,1)) = 0 //65 + + _InnerOutlineColor("Inner Outline Color", Color) = (1,0,0,1) //66 + _InnerOutlineThickness("Outline Thickness", Range(0,3)) = 1 //67 + _InnerOutlineAlpha("Inner Outline Alpha", Range(0,1)) = 1 //68 + _InnerOutlineGlow("Inner Outline Glow", Range(1,250)) = 4 //69 + + _AlphaCutoffValue("Alpha cutoff value", Range(0, 1)) = 0.25 //70 + + [Toggle()] _OnlyOutline("Only render outline?", float) = 0 //71 + [Toggle()] _OnlyInnerOutline("Only render inner outline?", float) = 0 //72 + + _HologramStripesAmount("Stripes Amount", Range(0, 1)) = 0.1 //73 + _HologramUnmodAmount("Unchanged Amount", Range(0, 1)) = 0.0 //74 + _HologramStripesSpeed("Stripes Speed", Range(-20, 20)) = 4.5 //75 + _HologramMinAlpha("Min Alpha", Range(0, 1)) = 0.1 //76 + _HologramMaxAlpha("Max Alpha", Range(0, 100)) = 0.75 //77 + + _ChromAberrAmount("ChromAberr Amount", Range(0, 1)) = 1 //78 + _ChromAberrAlpha("ChromAberr Alpha", Range(0, 1)) = 0.4 //79 + + _GlitchAmount("Glitch Amount", Range(0, 20)) = 3 //80 + + _FlickerPercent("Flicker Percent", Range(0, 1)) = 0.05 //81 + _FlickerFreq("Flicker Frequency", Range(0, 5)) = 0.2 //82 + _FlickerAlpha("Flicker Alpha", Range(0, 1)) = 0 //83 + + _ShadowX("Shadow X Axis", Range(-0.5, 0.5)) = 0.1 //84 + _ShadowY("Shadow Y Axis", Range(-0.5, 0.5)) = -0.05 //85 + _ShadowAlpha("Shadow Alpha", Range(0, 1)) = 0.5 //86 + _ShadowColor("Shadow Color", Color) = (0, 0, 0, 1) //87 + + _HandDrawnAmount("Hand Drawn Amount", Range(0, 20)) = 10 //88 + _HandDrawnSpeed("Hand Drawn Speed", Range(1, 15)) = 5 //89 + + _GrassSpeed("Speed", Range(0,50)) = 2 //90 + _GrassWind("Bend amount", Range(0,50)) = 20 //91 + [Space] + [Toggle()] _GrassManualToggle("Manually animated?", float) = 0 //92 + _GrassManualAnim("Manual Anim Value", Range(-1,1)) = 1 //93 + + _WaveAmount("Wave Amount", Range(0, 25)) = 7 //94 + _WaveSpeed("Wave Speed", Range(0, 25)) = 10 //95 + _WaveStrength("Wave Strength", Range(0, 25)) = 7.5 //96 + _WaveX("Wave X Axis", Range(0, 1)) = 0 //97 + _WaveY("Wave Y Axis", Range(0, 1)) = 0.5 //98 + + _RectSize("Rect Size", Range(1, 4)) = 1 //99 + + _OffsetUvX("X axis", Range(-1, 1)) = 0 //100 + _OffsetUvY("Y axis", Range(-1, 1)) = 0 //101 + + _ClipUvLeft("Clipping Left", Range(0, 1)) = 0 //102 + _ClipUvRight("Clipping Right", Range(0, 1)) = 0 //103 + _ClipUvUp("Clipping Up", Range(0, 1)) = 0 //104 + _ClipUvDown("Clipping Down", Range(0, 1)) = 0 //105 + + _TextureScrollXSpeed("Speed X Axis", Range(-5, 5)) = 1 //106 + _TextureScrollYSpeed("Speed Y Axis", Range(-5, 5)) = 0 //107 + + _ZoomUvAmount("Zoom Amount", Range(0.1, 5)) = 0.5 //108 + + _DistortTex("Distortion Texture", 2D) = "white" {} //109 + _DistortAmount("Distortion Amount", Range(0,2)) = 0.5 //110 + _DistortTexXSpeed("Scroll speed X", Range(-50,50)) = 5 //111 + _DistortTexYSpeed("Scroll speed Y", Range(-50,50)) = 5 //112 + + _TwistUvAmount("Twist Amount", Range(0, 3.1416)) = 1 //113 + _TwistUvPosX("Twist Pos X Axis", Range(0, 1)) = 0.5 //114 + _TwistUvPosY("Twist Pos Y Axis", Range(0, 1)) = 0.5 //115 + _TwistUvRadius("Twist Radius", Range(0, 3)) = 0.75 //116 + + _RotateUvAmount("Rotate Angle(radians)", Range(0, 6.2831)) = 0 //117 + + _FishEyeUvAmount("Fish Eye Amount", Range(0, 0.5)) = 0.35 //118 + + _PinchUvAmount("Pinch Amount", Range(0, 0.5)) = 0.35 //119 + + _ShakeUvSpeed("Shake Speed", Range(0, 20)) = 2.5 //120 + _ShakeUvX("X Multiplier", Range(0, 5)) = 1.5 //121 + _ShakeUvY("Y Multiplier", Range(0, 5)) = 1 //122 + + _ColorChangeTolerance("Tolerance", Range(0, 1)) = 0.25 //123 + _ColorChangeTarget("Color to change", Color) = (1, 0, 0, 1) //124 + [HDR] _ColorChangeNewCol("New Color", Color) = (1, 1, 0, 1) //125 + _ColorChangeLuminosity("New Color Luminosity", Range(0, 1)) = 0.0 //126 + + _RoundWaveStrength("Wave Strength", Range(0, 1)) = 0.7 //127 + _RoundWaveSpeed("Wave Speed", Range(0, 5)) = 2 //128 + + [Toggle()] _BillboardY("Billboard on both axis?", float) = 0 //129 + _ZWrite ("Depth Write", Float) = 0.0 // 130 + + _MySrcMode ("SrcMode", Float) = 5 // 131 + _MyDstMode ("DstMode", Float) = 10 // 132 + + _ShineColor("Shine Color", Color) = (1,1,1,1) // 133 + _ShineLocation("Shine Location", Range(0,1)) = 0.5 // 134 + _ShineRotate("Rotate Angle(radians)", Range(0, 6.2831)) = 0 //135 + _ShineWidth("Shine Width", Range(0.05,1)) = 0.1 // 136 + _ShineGlow("Shine Glow", Range(0,100)) = 1 // 137 + [NoScaleOffset] _ShineMask("Shine Mask", 2D) = "white" {} // 138 + + _GlitchSize("Glitch Size", Range(0.25, 5)) = 1 //139 + _HologramStripeColor("Stripes Color", Color) = (0,1,1,1) //140 + _GradBoostX("Boost X axis", Range(0.1, 5)) = 1.2 //141 + _GradBoostY("Boost Y axis", Range(0.1, 5)) = 1.2 //142 + [Toggle()] _GradIsRadial("Radial Gradient?", float) = 0 //143 + _AlphaRoundThreshold("Round Threshold", Range(0.005, 1.0)) = 0.5 //144 + _GrassRadialBend("Radial Bend", Range(0.0, 5.0)) = 0.1 //145 + + _ColorChangeTolerance2("Tolerance 2", Range(0, 1)) = 0.25 //146 + _ColorChangeTarget2("Color to change 2", Color) = (1, 0, 0, 1) //147 + [HDR] _ColorChangeNewCol2("New Color 2", Color) = (1, 1, 0, 1) //148 + _ColorChangeTolerance3("Tolerance 3", Range(0, 1)) = 0.25 //149 + _ColorChangeTarget3("Color to change 3", Color) = (1, 0, 0, 1) //150 + [HDR] _ColorChangeNewCol3("New Color 3", Color) = (1, 1, 0, 1) //151 + + _Contrast ("Contrast", Range(0, 6)) = 1 // 152 + _Brightness ("Brightness", Range(-1, 1)) = 0 // 153 + + _ColorSwapBlend ("Color Swap Blend", Range(0, 1)) = 1 // 154 + _ColorRampBlend ("Color Ramp Blend", Range(0, 1)) = 1 // 155 + _GreyscaleBlend ("Greyscale Blend", Range(0, 1)) = 1 // 156 + _GhostBlend ("Ghost Blend", Range(0, 1)) = 1 // 157 + _HologramBlend ("Hologram Blend", Range(0, 1)) = 1 // 158 + + [AllIn1ShaderGradient] _ColorRampTexGradient("Color ramp Gradient", 2D) = "white" {} //159 + + _OverlayTex("Overlay Texture", 2D) = "white" {} //160 + _OverlayColor("Overlay Color", Color) = (1, 1, 1, 1) //161 + _OverlayGlow("Overlay Glow", Range(0,25)) = 1 // 162 + _OverlayBlend("Overlay Blend", Range(0, 1)) = 1 // 163 + + _RadialStartAngle("Radial Start Angle", Range(0, 360)) = 90 //164 + _RadialClip("Radial Clip", Range(0, 360)) = 45 //165 + _RadialClip2("Radial Clip 2", Range(0, 360)) = 0 //166 + + _WarpStrength("Warp Strength", Range(0, 0.1)) = 0.025 //167 + _WarpSpeed("Warp Speed", Range(0, 25)) = 8 //168 + _WarpScale("Warp Scale", Range(0.05, 3)) = 0.5 //169 + + _OverlayTextureScrollXSpeed("Speed X Axis", Range(-5, 5)) = 0.25 //170 + _OverlayTextureScrollYSpeed("Speed Y Axis", Range(-5, 5)) = 0.25 //171 + + _Stencil ("Stencil ID", Float) = 0 + _StencilComp ("Stencil Comparison", Float) = 8 + _StencilOp ("Stencil Operation", Float) = 0 + _StencilWriteMask ("Stencil Write Mask", Float) = 255 + _StencilReadMask ("Stencil Read Mask", Float) = 255 + _ColorMask ("Color Mask", Float) = 15 + + [HideInInspector] _MinXUV("_MinXUV", Range(0, 1)) = 0.0 + [HideInInspector] _MaxXUV("_MaxXUV", Range(0, 1)) = 1.0 + [HideInInspector] _MinYUV("_MinYUV", Range(0, 1)) = 0.0 + [HideInInspector] _MaxYUV("_MaxYUV", Range(0, 1)) = 1.0 + [HideInInspector] _RandomSeed("_MaxYUV", Range(0, 10000)) = 0.0 + _EditorDrawers("Editor Drawers", Int) = 6 + } + + SubShader + { + Tags { "Queue"="Transparent" "IgnoreProjector"="True" "RenderType"="Transparent" "PreviewType"="Plane" "CanUseSpriteAtlas"="True" } + Blend [_MySrcMode] [_MyDstMode] + Cull Off + ZWrite Off + ZTest [unity_GUIZTestMode] + ColorMask [_ColorMask] + + Stencil + { + Ref [_Stencil] + Comp [_StencilComp] + Pass [_StencilOp] + ReadMask [_StencilReadMask] + WriteMask [_StencilWriteMask] + } + + Pass + { + CGPROGRAM + #pragma vertex vert + #pragma fragment frag + #pragma multi_compile_instancing + + #pragma shader_feature_local GLOW_ON + #pragma shader_feature_local FADE_ON + #pragma shader_feature_local OUTBASE_ON + #pragma shader_feature_local ONLYOUTLINE_ON + #pragma shader_feature_local GRADIENT_ON + #pragma shader_feature_local GRADIENT2COL_ON + #pragma shader_feature_local RADIALGRADIENT_ON + #pragma shader_feature_local COLORSWAP_ON + #pragma shader_feature_local HSV_ON + #pragma shader_feature_local CHANGECOLOR_ON + #pragma shader_feature_local CHANGECOLOR2_ON + #pragma shader_feature_local CHANGECOLOR3_ON + #pragma shader_feature_local COLORRAMP_ON + #pragma shader_feature_local GRADIENTCOLORRAMP_ON + #pragma shader_feature_local HITEFFECT_ON + #pragma shader_feature_local NEGATIVE_ON + #pragma shader_feature_local PIXELATE_ON + #pragma shader_feature_local GREYSCALE_ON + #pragma shader_feature_local POSTERIZE_ON + #pragma shader_feature_local BLUR_ON + #pragma shader_feature_local MOTIONBLUR_ON + #pragma shader_feature_local GHOST_ON + #pragma shader_feature_local ALPHAOUTLINE_ON + #pragma shader_feature_local INNEROUTLINE_ON + #pragma shader_feature_local ONLYINNEROUTLINE_ON + #pragma shader_feature_local HOLOGRAM_ON + #pragma shader_feature_local CHROMABERR_ON + #pragma shader_feature_local GLITCH_ON + #pragma shader_feature_local FLICKER_ON + #pragma shader_feature_local SHADOW_ON + #pragma shader_feature_local SHINE_ON + #pragma shader_feature_local CONTRAST_ON + #pragma shader_feature_local OVERLAY_ON + #pragma shader_feature_local OVERLAYMULT_ON + #pragma shader_feature_local ALPHACUTOFF_ON + #pragma shader_feature_local ALPHAROUND_ON + #pragma shader_feature_local DOODLE_ON + #pragma shader_feature_local WIND_ON + #pragma shader_feature_local WAVEUV_ON + #pragma shader_feature_local ROUNDWAVEUV_ON + #pragma shader_feature_local RECTSIZE_ON + #pragma shader_feature_local OFFSETUV_ON + #pragma shader_feature_local CLIPPING_ON + #pragma shader_feature_local RADIALCLIPPING_ON + #pragma shader_feature_local TEXTURESCROLL_ON + #pragma shader_feature_local ZOOMUV_ON + #pragma shader_feature_local DISTORT_ON + #pragma shader_feature_local WARP_ON + #pragma shader_feature_local TWISTUV_ON + #pragma shader_feature_local ROTATEUV_ON + #pragma shader_feature_local POLARUV_ON + #pragma shader_feature_local FISHEYE_ON + #pragma shader_feature_local PINCH_ON + #pragma shader_feature_local SHAKEUV_ON + + #pragma shader_feature_local GLOWTEX_ON + #pragma shader_feature_local OUTTEX_ON + #pragma shader_feature_local OUTDIST_ON + #pragma shader_feature_local OUTBASE8DIR_ON + #pragma shader_feature_local OUTBASEPIXELPERF_ON + #pragma shader_feature_local COLORRAMPOUTLINE_ON + #pragma shader_feature_local GREYSCALEOUTLINE_ON + #pragma shader_feature_local POSTERIZEOUTLINE_ON + #pragma shader_feature_local BLURISHD_ON + #pragma shader_feature_local MANUALWIND_ON + #pragma shader_feature ATLAS_ON + #pragma shader_feature PREMULTIPLYALPHA_ON + + #pragma multi_compile _ UNITY_UI_CLIP_RECT + #pragma multi_compile _ UNITY_UI_ALPHACLIP + + #include "UnityCG.cginc" + #include "AllIn1OneShaderFunctions.cginc" + + struct appdata + { + float4 vertex : POSITION; + float2 uv : TEXCOORD0; + half4 color : COLOR; + UNITY_VERTEX_INPUT_INSTANCE_ID + }; + + struct v2f + { + float2 uv : TEXCOORD0; + float4 vertex : SV_POSITION; + half4 color : COLOR; + #if OUTTEX_ON + half2 uvOutTex : TEXCOORD1; + #endif + #if OUTDIST_ON + half2 uvOutDistTex : TEXCOORD2; + #endif + #if DISTORT_ON + half2 uvDistTex : TEXCOORD3; + #endif + #if UNITY_UI_CLIP_RECT + half4 mask : TEXCOORD4; + #endif + UNITY_VERTEX_INPUT_INSTANCE_ID + UNITY_VERTEX_OUTPUT_STEREO + }; + + #if UNITY_UI_CLIP_RECT + float4 _ClipRect; + half _UIMaskSoftnessX, _UIMaskSoftnessY; + #endif + + float globalUnscaledTime; + + sampler2D _MainTex; + half4 _MainTex_ST, _MainTex_TexelSize, _Color; + half _Alpha; + + #if ATLAS_ON + half _MinXUV, _MaxXUV, _MinYUV, _MaxYUV; + #endif + + #if RECTSIZE_ON + half _RectSize; + #endif + + #if OFFSETUV_ON + half _OffsetUvX, _OffsetUvY; + #endif + + #if CLIPPING_ON + half _ClipUvLeft, _ClipUvRight, _ClipUvUp, _ClipUvDown; + #endif + + #if RADIALCLIPPING_ON + half _RadialStartAngle, _RadialClip, _RadialClip2; + #endif + + #if TWISTUV_ON + half _TwistUvAmount, _TwistUvPosX, _TwistUvPosY, _TwistUvRadius; + #endif + + #if ROTATEUV_ON + half _RotateUvAmount; + #endif + + #if FISHEYE_ON + half _FishEyeUvAmount; + #endif + + #if PINCH_ON + half _PinchUvAmount; + #endif + + #if DOODLE_ON + half _HandDrawnAmount, _HandDrawnSpeed; + #endif + + #if SHAKEUV_ON + half _ShakeUvSpeed, _ShakeUvX, _ShakeUvY; + #endif + + #if WAVEUV_ON + float _WaveAmount, _WaveSpeed, _WaveStrength, _WaveX, _WaveY; + #endif + + #if ROUNDWAVEUV_ON + half _RoundWaveStrength, _RoundWaveSpeed; + #endif + + #if ZOOMUV_ON + half _ZoomUvAmount; + #endif + + #if FADE_ON + sampler2D _FadeTex, _FadeBurnTex; + half4 _FadeBurnColor, _FadeTex_ST, _FadeBurnTex_ST; + half _FadeAmount, _FadeBurnWidth, _FadeBurnTransition,_FadeBurnGlow; + #endif + + #if TEXTURESCROLL_ON + half _TextureScrollXSpeed, _TextureScrollYSpeed; + #endif + + #if GLOW_ON + sampler2D _GlowTex; + half4 _GlowColor; + half _Glow, _GlowGlobal; + #endif + + #if OUTBASE_ON + half4 _OutlineColor; + half _OutlineAlpha, _OutlineGlow, _OutlineWidth; + int _OutlinePixelWidth; + #endif + + #if OUTTEX_ON + sampler2D _OutlineTex; + half4 _OutlineTex_ST; + half _OutlineTexXSpeed, _OutlineTexYSpeed; + #endif + + #if OUTDIST_ON + sampler2D _OutlineDistortTex; + half4 _OutlineDistortTex_ST; + half _OutlineDistortTexXSpeed, _OutlineDistortTexYSpeed, _OutlineDistortAmount; + #endif + + #if DISTORT_ON + sampler2D _DistortTex; + half4 _DistortTex_ST; + half _DistortTexXSpeed, _DistortTexYSpeed, _DistortAmount; + #endif + + #if WARP_ON + half _WarpStrength, _WarpSpeed, _WarpScale; + #endif + + #if WIND_ON + half _GrassSpeed, _GrassWind, _GrassManualAnim, _GrassRadialBend; + #endif + + #if GRADIENT_ON + half _GradBlend, _GradBoostX, _GradBoostY; + half4 _GradTopRightCol, _GradTopLeftCol, _GradBotRightCol, _GradBotLeftCol; + #endif + + #if COLORSWAP_ON + sampler2D _ColorSwapTex; + half4 _ColorSwapRed, _ColorSwapGreen, _ColorSwapBlue; + half _ColorSwapRedLuminosity, _ColorSwapGreenLuminosity, _ColorSwapBlueLuminosity, _ColorSwapBlend; + #endif + + #if HSV_ON + half _HsvShift, _HsvSaturation, _HsvBright; + #endif + + #if HITEFFECT_ON + half4 _HitEffectColor; + half _HitEffectGlow, _HitEffectBlend; + #endif + + #if PIXELATE_ON + half _PixelateSize; + #endif + + #if NEGATIVE_ON + half _NegativeAmount; + #endif + + #if COLORRAMP_ON + sampler2D _ColorRampTex, _ColorRampTexGradient; + half _ColorRampLuminosity, _ColorRampBlend; + #endif + + #if GREYSCALE_ON + half _GreyscaleLuminosity, _GreyscaleBlend; + half4 _GreyscaleTintColor; + #endif + + #if POSTERIZE_ON + half _PosterizeNumColors, _PosterizeGamma; + #endif + + #if BLUR_ON + half _BlurIntensity; + #endif + + #if MOTIONBLUR_ON + half _MotionBlurAngle, _MotionBlurDist; + #endif + + #if GHOST_ON + half _GhostColorBoost, _GhostTransparency, _GhostBlend; + #endif + + #if ALPHAOUTLINE_ON + half _AlphaOutlineGlow, _AlphaOutlinePower, _AlphaOutlineMinAlpha, _AlphaOutlineBlend; + half4 _AlphaOutlineColor; + #endif + + #if INNEROUTLINE_ON + half _InnerOutlineThickness, _InnerOutlineAlpha, _InnerOutlineGlow; + half4 _InnerOutlineColor; + #endif + + #if HOLOGRAM_ON + half _HologramStripesAmount, _HologramMinAlpha, _HologramUnmodAmount, _HologramStripesSpeed, _HologramMaxAlpha, _HologramBlend; + half4 _HologramStripeColor; + #endif + + #if CHROMABERR_ON + half _ChromAberrAmount, _ChromAberrAlpha; + #endif + + #if GLITCH_ON + half _GlitchAmount, _GlitchSize; + #endif + + #if FLICKER_ON + half _FlickerFreq, _FlickerPercent, _FlickerAlpha; + #endif + + #if SHADOW_ON + half _ShadowX, _ShadowY, _ShadowAlpha; + half4 _ShadowColor; + #endif + + #if SHINE_ON + sampler2D _ShineMask; + half4 _ShineColor; + half _ShineLocation, _ShineRotate, _ShineWidth, _ShineGlow; + #endif + + #if ALPHACUTOFF_ON + half _AlphaCutoffValue; + #endif + + #if ALPHAROUND_ON + half _AlphaRoundThreshold; + #endif + + #if CHANGECOLOR_ON + half4 _ColorChangeNewCol, _ColorChangeTarget; + half _ColorChangeTolerance, _ColorChangeLuminosity; + #endif + #if CHANGECOLOR2_ON + half4 _ColorChangeNewCol2, _ColorChangeTarget2; + half _ColorChangeTolerance2; + #endif + #if CHANGECOLOR3_ON + half4 _ColorChangeNewCol3, _ColorChangeTarget3; + half _ColorChangeTolerance3; + #endif + + #if CONTRAST_ON + half _Contrast, _Brightness; + #endif + + #if OVERLAY_ON + sampler2D _OverlayTex; + half4 _OverlayTex_ST, _OverlayColor; + half _OverlayGlow, _OverlayBlend, _OverlayTextureScrollXSpeed, _OverlayTextureScrollYSpeed; + #endif + + UNITY_INSTANCING_BUFFER_START(Props) + UNITY_DEFINE_INSTANCED_PROP(float, _RandomSeed) + UNITY_INSTANCING_BUFFER_END(Props) + + v2f vert(appdata v) + { + #if RECTSIZE_ON + v.vertex.xyz += (v.vertex.xyz * (_RectSize - 1.0)); + #endif + + v2f o; + UNITY_SETUP_INSTANCE_ID(v); + UNITY_TRANSFER_INSTANCE_ID(v, o); + UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o); + + o.vertex = UnityObjectToClipPos(v.vertex); + o.uv = TRANSFORM_TEX(v.uv, _MainTex); + o.color = v.color; + + #if UNITY_UI_CLIP_RECT + half2 pixelSize = o.vertex.w; + pixelSize /= half2(1, 1) * abs(mul((half2x2)UNITY_MATRIX_P, _ScreenParams.xy)); + half4 clampedRect = clamp(_ClipRect, -2e10, 2e10); + half2 maskUV = (v.vertex.xy - clampedRect.xy) / (clampedRect.zw - clampedRect.xy); + o.mask = half4(v.vertex.xy * 2 - clampedRect.xy - clampedRect.zw, 0.25 / (0.25 * half2(_UIMaskSoftnessX, _UIMaskSoftnessY) + abs(pixelSize.xy))); + #endif + + half2 center = half2(0.5, 0.5); + #if ATLAS_ON + center = half2((_MaxXUV + _MinXUV) / 2.0, (_MaxYUV + _MinYUV) / 2.0); + #endif + + #if POLARUV_ON + o.uv = v.uv - center; + #endif + + #if ROTATEUV_ON + half2 uvC = v.uv; + half cosAngle = cos(_RotateUvAmount); + half sinAngle = sin(_RotateUvAmount); + half2x2 rot = half2x2(cosAngle, -sinAngle, sinAngle, cosAngle); + uvC -= center; + o.uv = mul(rot, uvC); + o.uv += center; + #endif + + #if OUTTEX_ON + o.uvOutTex = TRANSFORM_TEX(v.uv, _OutlineTex); + #endif + + #if OUTDIST_ON + o.uvOutDistTex = TRANSFORM_TEX(v.uv, _OutlineDistortTex); + #endif + + #if DISTORT_ON + o.uvDistTex = TRANSFORM_TEX(v.uv, _DistortTex); + #endif + + return o; + } + + half3 GetPixel(in int offsetX, in int offsetY, half2 uv, sampler2D tex) + { + return tex2D(tex, (uv + half2(offsetX * _MainTex_TexelSize.x, offsetY * _MainTex_TexelSize.y))).rgb; + } + + half4 frag(v2f i) : SV_Target + { + UNITY_SETUP_INSTANCE_ID(i); + UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX(i); + half randomSeed = UNITY_ACCESS_INSTANCED_PROP(Props, _RandomSeed); + + float2 uvRect = i.uv; + half2 center = half2(0.5, 0.5); + #if ATLAS_ON + center = half2((_MaxXUV + _MinXUV) / 2.0, (_MaxYUV + _MinYUV) / 2.0); + uvRect = half2((i.uv.x - _MinXUV) / (_MaxXUV - _MinXUV), (i.uv.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half2 centerTiled = half2(center.x * _MainTex_ST.x, center.y * _MainTex_ST.y); + + #if CLIPPING_ON + half2 tiledUv = half2(i.uv.x / _MainTex_ST.x, i.uv.y / _MainTex_ST.y); + #if ATLAS_ON + tiledUv = half2((tiledUv.x - _MinXUV) / (_MaxXUV - _MinXUV), (tiledUv.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + clip((1 - _ClipUvUp) - tiledUv.y); + clip(tiledUv.y - _ClipUvDown); + clip((1 - _ClipUvRight) - tiledUv.x); + clip(tiledUv.x - _ClipUvLeft); + #endif + + #if RADIALCLIPPING_ON + half2 tiledUv2 = half2(i.uv.x / _MainTex_ST.x, i.uv.y / _MainTex_ST.y); + #if ATLAS_ON + tiledUv2 = half2((tiledUv2.x - _MinXUV) / (_MaxXUV - _MinXUV), (tiledUv2.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half startAngle = _RadialStartAngle - _RadialClip; + half endAngle = _RadialStartAngle + _RadialClip2; + half offset0 = clamp(0, 360, startAngle + 360); + half offset360 = clamp(0, 360, endAngle - 360); + half2 atan2Coord = half2(lerp(-1, 1, tiledUv2.x), lerp(-1, 1, tiledUv2.y)); + half atanAngle = atan2(atan2Coord.y, atan2Coord.x) * 57.3; // angle in degrees + if(atanAngle < 0) atanAngle = 360 + atanAngle; + if(atanAngle >= startAngle && atanAngle <= endAngle) discard; + if(atanAngle <= offset360) discard; + if(atanAngle >= offset0) discard; + #endif + + #if TEXTURESCROLL_ON && ATLAS_ON + i.uv = half2(_MinXUV + ((_MaxXUV - _MinXUV) * (abs((((globalUnscaledTime * 20) + randomSeed) * _TextureScrollXSpeed) + uvRect.x) % 1)), + _MinYUV + ((_MaxYUV - _MinYUV) * (abs((((globalUnscaledTime * 20) + randomSeed) * _TextureScrollYSpeed) + uvRect.y) % 1))); + #endif + + #if OFFSETUV_ON + #if ATLAS_ON + i.uv = half2(_MinXUV + ((_MaxXUV - _MinXUV) * (abs((_OffsetUvX + uvRect.x) % 1))), + _MinYUV + ((_MaxYUV - _MinYUV) * (abs(_OffsetUvY + uvRect.y) % 1))); + #else + i.uv += half2(_OffsetUvX, _OffsetUvY); + #endif + #endif + + #if POLARUV_ON + i.uv = half2(atan2(i.uv.y, i.uv.x) / (2.0f * 3.141592653589f), length(i.uv)); + i.uv *= _MainTex_ST.xy; + #endif + + #if TWISTUV_ON + #if ATLAS_ON + _TwistUvPosX = ((_MaxXUV - _MinXUV) * _TwistUvPosX) + _MinXUV; + _TwistUvPosY = ((_MaxYUV - _MinYUV) * _TwistUvPosY) + _MinYUV; + #endif + half2 tempUv = i.uv - half2(_TwistUvPosX * _MainTex_ST.x, _TwistUvPosY * _MainTex_ST.y); + _TwistUvRadius *= (_MainTex_ST.x + _MainTex_ST.y) / 2; + half percent = (_TwistUvRadius - length(tempUv)) / _TwistUvRadius; + half theta = percent * percent * (2.0 * sin(_TwistUvAmount)) * 8.0; + half s = sin(theta); + half c = cos(theta); + half beta = max(sign(_TwistUvRadius - length(tempUv)), 0.0); + tempUv = half2(dot(tempUv, half2(c, -s)), dot(tempUv, half2(s, c))) * beta + tempUv * (1 - beta); + tempUv += half2(_TwistUvPosX * _MainTex_ST.x, _TwistUvPosY * _MainTex_ST.y); + i.uv = tempUv; + #endif + + #if FISHEYE_ON + half bind = length(centerTiled); + half2 dF = i.uv - centerTiled; + half dFlen = length(dF); + half fishInt = (3.14159265359 / bind) * (_FishEyeUvAmount + 0.001); + i.uv = centerTiled + (dF / (max(0.0001, dFlen))) * tan(dFlen * fishInt) * bind / tan(bind * fishInt); + #endif + + #if PINCH_ON + half2 dP = i.uv - centerTiled; + half pinchInt = (3.141592 / length(centerTiled)) * (-_PinchUvAmount + 0.001); + i.uv = centerTiled + normalize(dP) * atan(length(dP) * -pinchInt * 10.0) * 0.5 / atan(-pinchInt * 5); + #endif + + #if ZOOMUV_ON + i.uv -= centerTiled; + i.uv = i.uv * _ZoomUvAmount; + i.uv += centerTiled; + #endif + + #if DOODLE_ON + half2 uvCopy = uvRect; + _HandDrawnSpeed = (floor((globalUnscaledTime + randomSeed) * 20 * _HandDrawnSpeed) / _HandDrawnSpeed) * _HandDrawnSpeed; + uvCopy.x = sin((uvCopy.x * _HandDrawnAmount + _HandDrawnSpeed) * 4); + uvCopy.y = cos((uvCopy.y * _HandDrawnAmount + _HandDrawnSpeed) * 4); + i.uv = lerp(i.uv, i.uv + uvCopy, 0.0005 * _HandDrawnAmount); + #endif + + #if SHAKEUV_ON + half xShake = sin((globalUnscaledTime + randomSeed) * _ShakeUvSpeed * 50) * _ShakeUvX; + half yShake = cos((globalUnscaledTime + randomSeed) * _ShakeUvSpeed * 50) * _ShakeUvY; + i.uv += half2(xShake * 0.012, yShake * 0.01); + #endif + + #if RECTSIZE_ON + i.uv = i.uv.xy * (_RectSize).xx + (((-_RectSize * 0.5) + 0.5)).xx; + #endif + + #if DISTORT_ON + #if ATLAS_ON + i.uvDistTex.x = i.uvDistTex.x * (1 / (_MaxXUV - _MinXUV)); + i.uvDistTex.y = i.uvDistTex.y * (1 / (_MaxYUV - _MinYUV)); + #endif + i.uvDistTex.x += ((globalUnscaledTime + randomSeed) * _DistortTexXSpeed) % 1; + i.uvDistTex.y += ((globalUnscaledTime + randomSeed) * _DistortTexYSpeed) % 1; + half distortAmnt = (tex2D(_DistortTex, i.uvDistTex).r - 0.5) * 0.2 * _DistortAmount; + i.uv.x += distortAmnt; + i.uv.y += distortAmnt; + #endif + + #if WARP_ON + half2 warpUv = half2(i.uv.x / _MainTex_ST.x, i.uv.y / _MainTex_ST.y); + #if ATLAS_ON + warpUv = half2((warpUv.x - _MinXUV) / (_MaxXUV - _MinXUV), (warpUv.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + const float tau = 6.283185307179586; + float xWarp = ((globalUnscaledTime * 20) + randomSeed) * _WarpSpeed + warpUv.x * tau / _WarpScale; + float yWarp = ((globalUnscaledTime * 20) + randomSeed) * _WarpSpeed + warpUv.y * tau / _WarpScale; + float2 warp = float2(sin(xWarp), sin(yWarp)) * _WarpStrength; + i.uv += warp; + #endif + + #if WAVEUV_ON + float2 uvWave = half2(_WaveX * _MainTex_ST.x, _WaveY * _MainTex_ST.y) - i.uv; + uvWave %= 1; + #if ATLAS_ON + uvWave = half2(_WaveX, _WaveY) - uvRect; + #endif + uvWave.x *= _ScreenParams.x / _ScreenParams.y; + float waveTime = (globalUnscaledTime * 20) + randomSeed; + float angWave = (sqrt(dot(uvWave, uvWave)) * _WaveAmount) - ((waveTime * _WaveSpeed)); + i.uv = i.uv + uvWave * sin(angWave) * (_WaveStrength / 1000.0); + #endif + + #if ROUNDWAVEUV_ON + half xWave = ((0.5 * _MainTex_ST.x) - uvRect.x); + half yWave = ((0.5 * _MainTex_ST.y) - uvRect.y) * (_MainTex_TexelSize.w / _MainTex_TexelSize.z); + half ripple = -sqrt(xWave*xWave + yWave* yWave); + i.uv += (sin((ripple + ((globalUnscaledTime * 20) + randomSeed) * (_RoundWaveSpeed/10.0)) / 0.015) * (_RoundWaveStrength/10.0)) % 1; + #endif + + #if WIND_ON + half windOffset = sin((globalUnscaledTime + randomSeed) * _GrassSpeed * 10); + half2 windCenter = half2(0.5, 0.1); + #if ATLAS_ON + windCenter.x = ((_MaxXUV - _MinXUV) * windCenter.x) + _MinXUV; + windCenter.y = ((_MaxYUV - _MinYUV) * windCenter.y) + _MinYUV; + #endif + #if !MANUALWIND_ON + i.uv.x = fmod(abs(lerp(i.uv.x, i.uv.x + (_GrassWind * 0.01 * windOffset), uvRect.y)), 1); + #else + i.uv.x = fmod(abs(lerp(i.uv.x, i.uv.x + (_GrassWind * 0.01 * _GrassManualAnim), uvRect.y)), 1); + windOffset = _GrassManualAnim; + #endif + half2 delta = i.uv - windCenter; + half delta2 = dot(delta.xy, delta.xy); + half2 delta_offset = delta2 * windOffset; + i.uv = i.uv + half2(delta.y, -delta.x) * delta_offset * _GrassRadialBend; + #endif + + #if TEXTURESCROLL_ON && !ATLAS_ON + i.uv.x += (((globalUnscaledTime * 20) + randomSeed) * _TextureScrollXSpeed) % 1; + i.uv.y += (((globalUnscaledTime * 20) + randomSeed) * _TextureScrollYSpeed) % 1; + #endif + + #if PIXELATE_ON + half aspectRatio = _MainTex_TexelSize.x / _MainTex_TexelSize.y; + half2 pixelSize = float2(_PixelateSize, _PixelateSize * aspectRatio); + i.uv = floor(i.uv * pixelSize) / pixelSize; + #endif + + half4 col = tex2D(_MainTex, i.uv); + half originalAlpha = col.a; + col *= i.color; + #if PREMULTIPLYALPHA_ON + col.rgb *= col.a; + #endif + + #if GLITCH_ON + half2 uvGlitch = uvRect; + uvGlitch.y -= 0.5; + half lineNoise = pow(rand2CustomTime(floor(uvGlitch * half2(24., 19.) * _GlitchSize) * 4.0, randomSeed, globalUnscaledTime), 3.0) * _GlitchAmount + * pow(rand2CustomTime(floor(uvGlitch * half2(38., 14.) * _GlitchSize) * 4.0, randomSeed, globalUnscaledTime), 3.0); + col = tex2D(_MainTex, i.uv + half2(lineNoise * 0.02 * rand2CustomTime(half2(2.0, 1), randomSeed, globalUnscaledTime), 0)) * i.color; + #endif + + #if CHROMABERR_ON + half4 r = tex2D(_MainTex, i.uv + half2(_ChromAberrAmount/10, 0)) * i.color; + half4 b = tex2D(_MainTex, i.uv + half2(-_ChromAberrAmount/10, 0)) * i.color; + col = half4(r.r * r.a, col.g, b.b * b.a, max(max(r.a, b.a) * _ChromAberrAlpha, col.a)); + #endif + + #if BLUR_ON + #if ATLAS_ON + #if !BLURISHD_ON + col = BlurHD(i.uv, _MainTex, _BlurIntensity, (_MaxXUV - _MinXUV), (_MaxYUV - _MinYUV)) * i.color; + #else + col = Blur(i.uv, _MainTex, _BlurIntensity * (_MaxXUV - _MinXUV)) * i.color; + #endif + #else + #if !BLURISHD_ON + col = BlurHD(i.uv, _MainTex, _BlurIntensity, 1, 1) * i.color; + #else + col = Blur(i.uv, _MainTex, _BlurIntensity) * i.color; + #endif + #endif + #endif + + #if MOTIONBLUR_ON + _MotionBlurAngle = _MotionBlurAngle * 3.1415926; + #define rot(n) mul(n, half2x2(cos(_MotionBlurAngle), -sin(_MotionBlurAngle), sin(_MotionBlurAngle), cos(_MotionBlurAngle))) + _MotionBlurDist = _MotionBlurDist * 0.005; + #if ATLAS_ON + _MotionBlurDist *= (_MaxXUV - _MinXUV); + #endif + col.rgb += tex2D(_MainTex, i.uv + rot(half2(-_MotionBlurDist, -_MotionBlurDist))); + col.rgb += tex2D(_MainTex, i.uv + rot(half2(-_MotionBlurDist * 2, -_MotionBlurDist * 2))); + col.rgb += tex2D(_MainTex, i.uv + rot(half2(-_MotionBlurDist * 3, -_MotionBlurDist * 3))); + col.rgb += tex2D(_MainTex, i.uv + rot(half2(-_MotionBlurDist * 4, -_MotionBlurDist * 4))); + col.rgb += tex2D(_MainTex, i.uv + rot(half2(_MotionBlurDist, _MotionBlurDist))); + col.rgb += tex2D(_MainTex, i.uv + rot(half2(_MotionBlurDist * 2, _MotionBlurDist * 2))); + col.rgb += tex2D(_MainTex, i.uv + rot(half2(_MotionBlurDist * 3, _MotionBlurDist * 3))); + col.rgb += tex2D(_MainTex, i.uv + rot(half2(_MotionBlurDist * 4, _MotionBlurDist * 4))); + col.rgb = col.rgb / 9; + #endif + + #if NEGATIVE_ON + col.rgb = lerp(col.rgb, 1 - col.rgb, _NegativeAmount); + #endif + + half luminance = 0; + #if GREYSCALE_ON && !GREYSCALEOUTLINE_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + luminance = saturate(luminance + _GreyscaleLuminosity); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _GreyscaleTintColor, _GreyscaleBlend); + #endif + + #if GHOST_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + half4 ghostResult; + ghostResult.a = saturate(luminance - _GhostTransparency) * col.a; + ghostResult.rgb = col.rgb * (luminance + _GhostColorBoost); + col = lerp(col, ghostResult, _GhostBlend); + #endif + + #if INNEROUTLINE_ON + half3 innerT = abs(GetPixel(0, _InnerOutlineThickness, i.uv, _MainTex) - GetPixel(0, -_InnerOutlineThickness, i.uv, _MainTex)); + innerT += abs(GetPixel(_InnerOutlineThickness, 0, i.uv, _MainTex) - GetPixel(-_InnerOutlineThickness, 0, i.uv, _MainTex)); + #if !ONLYINNEROUTLINE_ON + innerT = (innerT / 2.0) * col.a * _InnerOutlineAlpha; + col.rgb += length(innerT) * _InnerOutlineColor.rgb * _InnerOutlineGlow; + #else + innerT *= col.a * _InnerOutlineAlpha; + col.rgb = length(innerT) * _InnerOutlineColor.rgb * _InnerOutlineGlow; + col.a = step(0.3, col.r+col.g+col.b); + #endif + #endif + + #if HITEFFECT_ON + col.rgb = lerp(col.rgb, _HitEffectColor.rgb * _HitEffectGlow, _HitEffectBlend); + #endif + + #if GRADIENT_ON + half2 tiledUvGrad = half2(uvRect.x / _MainTex_ST.x, uvRect.y / _MainTex_ST.y); + #if GRADIENT2COL_ON + _GradTopRightCol = _GradTopLeftCol; + _GradBotRightCol = _GradBotLeftCol; + #endif + #if RADIALGRADIENT_ON + half radialDist = 1 - length(tiledUvGrad - half2(0.5, 0.5)); + radialDist *= (_MainTex_TexelSize.w / _MainTex_TexelSize.z); + radialDist = saturate(_GradBoostX * radialDist); + half4 gradientResult = lerp(_GradTopLeftCol, _GradBotLeftCol, radialDist); + #else + half gradXLerpFactor = saturate(pow(tiledUvGrad.x, _GradBoostX)); + half4 gradientResult = lerp(lerp(_GradBotLeftCol, _GradBotRightCol, gradXLerpFactor), + lerp(_GradTopLeftCol, _GradTopRightCol, gradXLerpFactor), saturate(pow(tiledUvGrad.y, _GradBoostY))); + #endif + gradientResult = lerp(col, gradientResult, _GradBlend); + col.rgb = gradientResult.rgb * col.a; + col.a *= gradientResult.a; + #endif + + #if CONTRAST_ON + col.rgb = (col.rgb - float3(0.5, 0.5, 0.5)) * _Contrast + float3(0.5, 0.5, 0.5); + col.rgb += _Brightness; + #endif + + #if COLORSWAP_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + half4 swapMask = tex2D(_ColorSwapTex, i.uv); + swapMask.rgb *= swapMask.a; + half3 redSwap = _ColorSwapRed * swapMask.r * saturate(luminance + _ColorSwapRedLuminosity); + half3 greenSwap = _ColorSwapGreen * swapMask.g * saturate(luminance + _ColorSwapGreenLuminosity); + half3 blueSwap = _ColorSwapBlue * swapMask.b * saturate(luminance + _ColorSwapBlueLuminosity); + swapMask.rgb = col.rgb * saturate(1 - swapMask.r - swapMask.g - swapMask.b); + col.rgb = lerp(col.rgb, swapMask.rgb + redSwap + greenSwap + blueSwap, _ColorSwapBlend); + #endif + + #if COLORRAMP_ON && !COLORRAMPOUTLINE_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + luminance = saturate(luminance + _ColorRampLuminosity); + #if GRADIENTCOLORRAMP_ON + col.rgb = lerp(col.rgb, tex2D(_ColorRampTexGradient, half2(luminance, 0)).rgb, _ColorRampBlend); + #else + col.rgb = lerp(col.rgb, tex2D(_ColorRampTex, half2(luminance, 0)).rgb, _ColorRampBlend); + #endif + #endif + + #if CHANGECOLOR_ON + float3 currChangeColor = saturate(col.rgb); + luminance = 0.3 * currChangeColor.r + 0.59 * currChangeColor.g + 0.11 * currChangeColor.b; + luminance = saturate(luminance + _ColorChangeLuminosity); + half3 dif = abs(currChangeColor - _ColorChangeTarget.rgb); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _ColorChangeNewCol.rgb, + max(sign(1 - saturate(dif.x + dif.y + dif.z) - _ColorChangeTolerance), 0.0)); + #if CHANGECOLOR2_ON + dif = abs(currChangeColor - _ColorChangeTarget2.rgb); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _ColorChangeNewCol2.rgb, + max(sign(1 - saturate(dif.x + dif.y + dif.z) - _ColorChangeTolerance2), 0.0)); + #endif + #if CHANGECOLOR3_ON + dif = abs(currChangeColor - _ColorChangeTarget3.rgb); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _ColorChangeNewCol3.rgb, + max(sign(1 - saturate(dif.x + dif.y + dif.z) - _ColorChangeTolerance3), 0.0)); + #endif + #endif + + #if POSTERIZE_ON && !POSTERIZEOUTLINE_ON + col.rgb = pow(col.rgb, _PosterizeGamma) * _PosterizeNumColors; + col.rgb = floor(col.rgb) / _PosterizeNumColors; + col.rgb = pow(col.rgb, 1.0 / _PosterizeGamma); + #endif + + #if HSV_ON + half3 resultHsv = half3(col.rgb); + half cosHsv = _HsvBright * _HsvSaturation * cos(_HsvShift * 3.14159265 / 180); + half sinHsv = _HsvBright * _HsvSaturation * sin(_HsvShift * 3.14159265 / 180); + resultHsv.x = (.299 * _HsvBright + .701 * cosHsv + .168 * sinHsv) * col.x + + (.587 * _HsvBright - .587 * cosHsv + .330 * sinHsv) * col.y + + (.114 * _HsvBright - .114 * cosHsv - .497 * sinHsv) * col.z; + resultHsv.y = (.299 * _HsvBright - .299 * cosHsv - .328 * sinHsv) *col.x + + (.587 * _HsvBright + .413 * cosHsv + .035 * sinHsv) * col.y + + (.114 * _HsvBright - .114 * cosHsv + .292 * sinHsv) * col.z; + resultHsv.z = (.299 * _HsvBright - .3 * cosHsv + 1.25 * sinHsv) * col.x + + (.587 * _HsvBright - .588 * cosHsv - 1.05 * sinHsv) * col.y + + (.114 * _HsvBright + .886 * cosHsv - .203 * sinHsv) * col.z; + col.rgb = resultHsv; + #endif + + #if OVERLAY_ON + half2 overlayUvs = i.uv; + overlayUvs.x += (((globalUnscaledTime * 20) + randomSeed) * _OverlayTextureScrollXSpeed) % 1; + overlayUvs.y += (((globalUnscaledTime * 20) + randomSeed) * _OverlayTextureScrollYSpeed) % 1; + half4 overlayCol = tex2D(_OverlayTex, TRANSFORM_TEX(overlayUvs, _OverlayTex)); + overlayCol.rgb *= _OverlayColor.rgb * _OverlayGlow; + #if !OVERLAYMULT_ON + overlayCol.rgb *= overlayCol.a * _OverlayColor.rgb * _OverlayColor.a * _OverlayBlend; + col.rgb += overlayCol.rgb; + #else + overlayCol.a *= _OverlayColor.a; + col = lerp(col, col * overlayCol, _OverlayBlend); + #endif + #endif + + //OUTLINE------------------------------------------------------------- + #if OUTBASE_ON + #if OUTBASEPIXELPERF_ON + half2 destUv = half2(_OutlinePixelWidth * _MainTex_TexelSize.x, _OutlinePixelWidth * _MainTex_TexelSize.y); + #else + half2 destUv = half2(_OutlineWidth * _MainTex_TexelSize.x * 200, _OutlineWidth * _MainTex_TexelSize.y * 200); + #endif + + #if OUTDIST_ON + i.uvOutDistTex.x += ((globalUnscaledTime + randomSeed) * _OutlineDistortTexXSpeed) % 1; + i.uvOutDistTex.y += ((globalUnscaledTime + randomSeed) * _OutlineDistortTexYSpeed) % 1; + #if ATLAS_ON + i.uvOutDistTex = half2((i.uvOutDistTex.x - _MinXUV) / (_MaxXUV - _MinXUV), (i.uvOutDistTex.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half outDistortAmnt = (tex2D(_OutlineDistortTex, i.uvOutDistTex).r - 0.5) * 0.2 * _OutlineDistortAmount; + destUv.x += outDistortAmnt; + destUv.y += outDistortAmnt; + #endif + + half spriteLeft = tex2D(_MainTex, i.uv + half2(destUv.x, 0)).a; + half spriteRight = tex2D(_MainTex, i.uv - half2(destUv.x, 0)).a; + half spriteBottom = tex2D(_MainTex, i.uv + half2(0, destUv.y)).a; + half spriteTop = tex2D(_MainTex, i.uv - half2(0, destUv.y)).a; + half result = spriteLeft + spriteRight + spriteBottom + spriteTop; + + #if OUTBASE8DIR_ON + half spriteTopLeft = tex2D(_MainTex, i.uv + half2(destUv.x, destUv.y)).a; + half spriteTopRight = tex2D(_MainTex, i.uv + half2(-destUv.x, destUv.y)).a; + half spriteBotLeft = tex2D(_MainTex, i.uv + half2(destUv.x, -destUv.y)).a; + half spriteBotRight = tex2D(_MainTex, i.uv + half2(-destUv.x, -destUv.y)).a; + result = result + spriteTopLeft + spriteTopRight + spriteBotLeft + spriteBotRight; + #endif + + result = step(0.05, saturate(result)); + + #if OUTTEX_ON + i.uvOutTex.x += ((globalUnscaledTime + randomSeed) * _OutlineTexXSpeed) % 1; + i.uvOutTex.y += ((globalUnscaledTime + randomSeed) * _OutlineTexYSpeed) % 1; + #if ATLAS_ON + i.uvOutTex = half2((i.uvOutTex.x - _MinXUV) / (_MaxXUV - _MinXUV), (i.uvOutTex.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half4 tempOutColor = tex2D(_OutlineTex, i.uvOutTex); + tempOutColor *= _OutlineColor; + _OutlineColor = tempOutColor; + #endif + + result *= (1 - originalAlpha) * _OutlineAlpha; + + half4 outline = _OutlineColor * i.color.a; + outline.rgb *= _OutlineGlow; + outline.a = result; + #if ONLYOUTLINE_ON + col = outline; + #else + col = lerp(col, outline, result); + #endif + #endif + //----------------------------------------------------------------------------- + + #if FADE_ON + half2 tiledUvFade1= TRANSFORM_TEX(i.uv, _FadeTex); + half2 tiledUvFade2 = TRANSFORM_TEX(i.uv, _FadeBurnTex); + #if ATLAS_ON + tiledUvFade1 = half2((tiledUvFade1.x - _MinXUV) / (_MaxXUV - _MinXUV), (tiledUvFade1.y - _MinYUV) / (_MaxYUV - _MinYUV)); + tiledUvFade2 = half2((tiledUvFade2.x - _MinXUV) / (_MaxXUV - _MinXUV), (tiledUvFade2.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half fadeTemp = tex2D(_FadeTex, tiledUvFade1).r; + half fade = smoothstep(_FadeAmount, _FadeAmount + _FadeBurnTransition, fadeTemp); + half fadeBurn = saturate(smoothstep(_FadeAmount - _FadeBurnWidth, _FadeAmount - _FadeBurnWidth + 0.1, fadeTemp) * _FadeAmount); + col.a *= fade; + _FadeBurnColor.rgb *= _FadeBurnGlow; + col += fadeBurn * tex2D(_FadeBurnTex, tiledUvFade2) * _FadeBurnColor * originalAlpha * (1 - col.a); + #endif + + #if SHADOW_ON + half shadowA = tex2D(_MainTex, i.uv + half2(_ShadowX, _ShadowY)).a; + half preMultShadowMask = 1 - (saturate(shadowA - col.a) * (1 - col.a)); + col.rgb *= 1 - ((shadowA - col.a) * (1 - col.a)); + col.rgb += (_ShadowColor * shadowA) * (1 - col.a); + col.a = max(shadowA * _ShadowAlpha * i.color.a, col.a); + #endif + + #if GLOW_ON + half4 emission; + #if GLOWTEX_ON + emission = tex2D(_GlowTex, i.uv); + #else + emission = col; + #endif + col.rgb *= _GlowGlobal; + emission.rgb *= emission.a * col.a * _Glow * _GlowColor; + col.rgb += emission.rgb; + #endif + + #if COLORRAMP_ON && COLORRAMPOUTLINE_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + luminance = saturate(luminance + _ColorRampLuminosity); + #if GRADIENTCOLORRAMP_ON + col.rgb = lerp(col.rgb, tex2D(_ColorRampTexGradient, half2(luminance, 0)).rgb, _ColorRampBlend); + #else + col.rgb = lerp(col.rgb, tex2D(_ColorRampTex, half2(luminance, 0)).rgb, _ColorRampBlend); + #endif + #endif + + #if GREYSCALE_ON && GREYSCALEOUTLINE_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + luminance = saturate(luminance + _GreyscaleLuminosity); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _GreyscaleTintColor, _GreyscaleBlend); + #endif + + #if POSTERIZE_ON && POSTERIZEOUTLINE_ON + col.rgb = pow(col.rgb, _PosterizeGamma) * _PosterizeNumColors; + col.rgb = floor(col.rgb) / _PosterizeNumColors; + col.rgb = pow(col.rgb, 1.0 / _PosterizeGamma); + #endif + + #if SHINE_ON + half2 uvShine = uvRect; + half cosAngle = cos(_ShineRotate); + half sinAngle = sin(_ShineRotate); + half2x2 rot = half2x2(cosAngle, -sinAngle, sinAngle, cosAngle); + uvShine -= half2(0.5, 0.5); + uvShine = mul(rot, uvShine); + uvShine += half2(0.5, 0.5); + half shineMask = tex2D(_ShineMask, i.uv).a; + half currentDistanceProjection = (uvShine.x + uvShine.y) / 2; + half whitePower = 1 - (abs(currentDistanceProjection - _ShineLocation) / _ShineWidth); + col.rgb += col.a * whitePower * _ShineGlow * max(sign(currentDistanceProjection - (_ShineLocation - _ShineWidth)), 0.0) + * max(sign((_ShineLocation + _ShineWidth) - currentDistanceProjection), 0.0) * _ShineColor * shineMask; + #endif + + #if HOLOGRAM_ON + half totalHologram = _HologramStripesAmount + _HologramUnmodAmount; + half hologramYCoord = ((uvRect.y + (((globalUnscaledTime + randomSeed) % 1) * _HologramStripesSpeed)) % totalHologram) / totalHologram; + hologramYCoord = abs(hologramYCoord); + half alpha = RemapFloat(saturate(hologramYCoord - (_HologramUnmodAmount/totalHologram)), 0.0, 1.0, _HologramMinAlpha, saturate(_HologramMaxAlpha)); + half hologramMask = max(sign((_HologramUnmodAmount/totalHologram) - hologramYCoord), 0.0); + half4 hologramResult = col; + hologramResult.a *= lerp(alpha, 1, hologramMask); + hologramResult.rgb *= max(1, _HologramMaxAlpha * max(sign(hologramYCoord - (_HologramUnmodAmount/totalHologram)), 0.0)); + hologramMask = 1 - step(0.01,hologramMask); + hologramResult.rgb += hologramMask * _HologramStripeColor * col.a; + col = lerp(col, hologramResult, _HologramBlend); + #endif + + #if FLICKER_ON + col.a *= saturate(col.a * step(frac(0.05 + ((globalUnscaledTime * 60) + randomSeed) * _FlickerFreq), 1 - _FlickerPercent) + _FlickerAlpha); + #endif + + col.a *= _Alpha; + + #if UNITY_UI_CLIP_RECT + half2 clipMask = saturate((_ClipRect.zw - _ClipRect.xy - abs(i.mask.xy)) * i.mask.zw); + col.a *= clipMask.x * clipMask.y; + #endif + + #if UNITY_UI_ALPHACLIP + clip (col.a - 0.001); + #endif + + #if ALPHACUTOFF_ON + clip((1 - _AlphaCutoffValue) - (1 - col.a) - 0.01); + #endif + + #if ALPHAROUND_ON + col.a = step(_AlphaRoundThreshold, col.a); + #endif + + #if ALPHAOUTLINE_ON + half alphaOutlineRes = pow(1 - col.a, max(_AlphaOutlinePower, 0.0001)) * step(_AlphaOutlineMinAlpha, col.a) * _AlphaOutlineBlend; + col.rgb = lerp(col.rgb, _AlphaOutlineColor.rgb * _AlphaOutlineGlow, alphaOutlineRes); + col.a = lerp(col.a, 1, alphaOutlineRes > 1); + #endif + + col *= _Color; + + return col; + } + ENDCG + } + } + CustomEditor "AllIn1SpriteShaderUiMaskMaterialInspector" + //Fallback "Sprites/Default" //Remove fallback so that any shader error is obvious to the user +} \ No newline at end of file diff --git a/Assets/Plugins/AllIn1SpriteShader/Shaders/AllIn1SpriteShaderUiMaskScaledTime.shader.meta b/Assets/Plugins/AllIn1SpriteShader/Shaders/AllIn1SpriteShaderUiMaskScaledTime.shader.meta new file mode 100644 index 000000000..0c49617d4 --- /dev/null +++ b/Assets/Plugins/AllIn1SpriteShader/Shaders/AllIn1SpriteShaderUiMaskScaledTime.shader.meta @@ -0,0 +1,29 @@ +fileFormatVersion: 2 +guid: e89361f7792fee34fbaa655df899c819 +ShaderImporter: + externalObjects: {} + defaultTextures: + - _MainTex: {instanceID: 0} + - _GlowTex: {instanceID: 0} + - _FadeTex: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + - _FadeBurnTex: {fileID: 2800000, guid: 677cca399782dea41aedc1d292ecb67d, type: 3} + - _OutlineTex: {fileID: 2800000, guid: 74087f6d03f233e4a8a142fa01f9e5cf, type: 3} + - _OutlineDistortTex: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, + type: 3} + - _ColorSwapTex: {instanceID: 0} + - _ColorRampTex: {fileID: 2800000, guid: 279657edc397ece4b8029c727adf6ddc, type: 3} + - _DistortTex: {fileID: 2800000, guid: 7aad8c583ef292e48b06af0d1f2fab97, type: 3} + - _ShineMask: {instanceID: 0} + - _ColorRampTexGradient: {instanceID: 0} + - _OverlayTex: {fileID: 2800000, guid: 677cca399782dea41aedc1d292ecb67d, type: 3} + nonModifiableTextures: [] + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 156513 + packageName: All In 1 Sprite Shader + packageVersion: 4.25 + assetPath: Assets/Plugins/AllIn1SpriteShader/Shaders/AllIn1SpriteShaderUiMaskScaledTime.shader + uploadId: 708810 diff --git a/Assets/Plugins/AllIn1SpriteShader/Shaders/LitShaders.meta b/Assets/Plugins/AllIn1SpriteShader/Shaders/LitShaders.meta new file mode 100644 index 000000000..153166a7f --- /dev/null +++ b/Assets/Plugins/AllIn1SpriteShader/Shaders/LitShaders.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: ab83761dc46d94e4e90385302b0cd179 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/AllIn1SpriteShader/Shaders/LitShaders/AllIn1SpriteShaderLit_BetterShader.surfshader b/Assets/Plugins/AllIn1SpriteShader/Shaders/LitShaders/AllIn1SpriteShaderLit_BetterShader.surfshader new file mode 100644 index 000000000..d29d5d534 --- /dev/null +++ b/Assets/Plugins/AllIn1SpriteShader/Shaders/LitShaders/AllIn1SpriteShaderLit_BetterShader.surfshader @@ -0,0 +1,1433 @@ +BEGIN_OPTIONS + CustomEditor "AllIn1SpriteShaderLitMaterialInspector" + ShaderName "AllIn1SpriteShader/AllIn1SpriteShaderLit_BetterShader" +END_OPTIONS + +BEGIN_SUBSHADER + +END_SUBSHADER + +BEGIN_PROPERTIES + _MainTex ("Main Texture", 2D) = "white" {} //0 + _Color("Main Color", Color) = (1,1,1,1) //1 + _Alpha("General Alpha", Range(0,1)) = 1 //2 + + _GlowColor("Glow Color", Color) = (1,1,1,1) //3 + _Glow("Glow Color Intensity", Range(0,100)) = 10 //4 + _GlowGlobal("Global Glow Intensity", Range(1,100)) = 1 //5 + [NoScaleOffset] _GlowTex("Glow Texture", 2D) = "white" {} //6 + + _FadeTex("Fade Texture", 2D) = "white" {} //7 + _FadeAmount("Fade Amount", Range(-0.1,1)) = -0.1 //8 + _FadeBurnWidth("Fade Burn Width", Range(0,1)) = 0.025 //9 + _FadeBurnTransition("Burn Transition", Range(0.01,0.5)) = 0.075 //10 + _FadeBurnColor("Fade Burn Color", Color) = (1,1,0,1) //11 + _FadeBurnTex("Fade Burn Texture", 2D) = "white" {} //12 + _FadeBurnGlow("Fade Burn Glow", Range(1,250)) = 2//13 + + _OutlineColor("Outline Base Color", Color) = (1,1,1,1) //14 + _OutlineAlpha("Outline Base Alpha", Range(0,1)) = 1 //15 + _OutlineGlow("Outline Base Glow", Range(1,100)) = 1.5 //16 + _OutlineWidth("Outline Base Width", Range(0,0.2)) = 0.004 //17 + _OutlinePixelWidth("Outline Base Pixel Width", Int) = 1 //18 + + [Space] + _OutlineTex("Outline Texture", 2D) = "white" {} //19 + _OutlineTexXSpeed("Texture scroll speed X", Range(-50,50)) = 10 //20 + _OutlineTexYSpeed("Texture scroll speed Y", Range(-50,50)) = 0 //21 + + [Space] + _OutlineDistortTex("Outline Distortion Texture", 2D) = "white" {} //22 + _OutlineDistortAmount("Outline Distortion Amount", Range(0,2)) = 0.5 //23 + _OutlineDistortTexXSpeed("Distortion scroll speed X", Range(-50,50)) = 5 //24 + _OutlineDistortTexYSpeed("Distortion scroll speed Y", Range(-50,50)) = 5 //25 + + _AlphaOutlineColor("Color", Color) = (1, 1, 1, 1) //26 + _AlphaOutlineGlow("Outline Glow", Range(1,100)) = 5 //27 + _AlphaOutlinePower("Power", Range(0, 5)) = 1 // 28 + _AlphaOutlineMinAlpha("Min Alpha", Range(0, 1)) = 0 // 29 + _AlphaOutlineBlend("Blend", Range(0, 1)) = 1 // 30 + + _GradBlend("Gradient Blend", Range(0,1)) = 1 //31 + _GradTopLeftCol("Top Color", Color) = (1,0,0,1) //32 + _GradTopRightCol("Top Color 2", Color) = (1, 1, 0, 1) //33 + _GradBotLeftCol("Bot Color", Color) = (0,0,1,1) //34 + _GradBotRightCol("Bot Color 2", Color) = (0, 1, 0, 1) //35 + + [NoScaleOffset] _ColorSwapTex("Color Swap Texture", 2D) = "black" {} //36 + [HDR] _ColorSwapRed("Red Channel", Color) = (1,1,1,1) //37 + _ColorSwapRedLuminosity("Red luminosity", Range(-1,1)) = 0.5 //38 + [HDR] _ColorSwapGreen("Green Channel", Color) = (1,1,1,1) //39 + _ColorSwapGreenLuminosity("Green luminosity", Range(-1,1)) = 0.5 //40 + [HDR] _ColorSwapBlue("Blue Channel", Color) = (1,1,1,1) //41 + _ColorSwapBlueLuminosity("Blue luminosity", Range(-1,1)) = 0.5 //42 + + _HsvShift("Hue Shift", Range(0, 360)) = 180 //43 + _HsvSaturation("Saturation", Range(0, 2)) = 1 //44 + _HsvBright("Brightness", Range(0, 2)) = 1 //45 + + _HitEffectColor("Hit Effect Color", Color) = (1,1,1,1) //46 + _HitEffectGlow("Glow Intensity", Range(1,100)) = 5 //47 + [Space] + _HitEffectBlend("Hit Effect Blend", Range(0,1)) = 1 //48 + + _NegativeAmount("Negative Amount", Range(0, 1)) = 1 //49 + + _PixelateSize("Pixelate size", Range(4,512)) = 32 //50 + + [NoScaleOffset] _ColorRampTex("Color ramp Texture", 2D) = "white" {} //51 + _ColorRampLuminosity("Color ramp luminosity", Range(-1,1)) = 0 //52 + [Toggle()] _ColorRampOutline("Affects everything?", float) = 0 //53 + + _GreyscaleLuminosity("Greyscale luminosity", Range(-1,1)) = 0 //54 + [Toggle()] _GreyscaleOutline("Affects everything?", float) = 0 //55 + _GreyscaleTintColor("Greyscale Tint Color", Color) = (1,1,1,1) //56 + + _PosterizeNumColors("Number of Colors", Range(0,100)) = 8 //57 + _PosterizeGamma("Posterize Amount", Range(0.1,10)) = 0.75 //58 + [Toggle()] _PosterizeOutline("Affects everything?", float) = 0 //59 + + _BlurIntensity("Blur Intensity", Range(0,100)) = 10 //60 + [Toggle()] _BlurHD("Blur is Low Res?", float) = 0 //61 + + _MotionBlurAngle("Motion Blur Angle", Range(-1, 1)) = 0.1 //62 + _MotionBlurDist("Motion Blur Distance", Range(-3, 3)) = 1.25 //63 + + _GhostColorBoost("Ghost Color Boost", Range(0,5)) = 1 //64 + _GhostTransparency("Ghost Transparency", Range(0,1)) = 0 //65 + + _InnerOutlineColor("Inner Outline Color", Color) = (1,0,0,1) //66 + _InnerOutlineThickness("Outline Thickness", Range(0,3)) = 1 //67 + _InnerOutlineAlpha("Inner Outline Alpha", Range(0,1)) = 1 //68 + _InnerOutlineGlow("Inner Outline Glow", Range(1,250)) = 4 //69 + + _AlphaCutoffValue("Alpha cutoff value", Range(0, 1)) = 0.25 //70 + + [Toggle()] _OnlyOutline("Only render outline?", float) = 0 //71 + [Toggle()] _OnlyInnerOutline("Only render inner outline?", float) = 0 //72 + + _HologramStripesAmount("Stripes Amount", Range(0, 1)) = 0.1 //73 + _HologramUnmodAmount("Unchanged Amount", Range(0, 1)) = 0.0 //74 + _HologramStripesSpeed("Stripes Speed", Range(-20, 20)) = 4.5 //75 + _HologramMinAlpha("Min Alpha", Range(0, 1)) = 0.1 //76 + _HologramMaxAlpha("Max Alpha", Range(0, 100)) = 0.75 //77 + + _ChromAberrAmount("ChromAberr Amount", Range(0, 1)) = 1 //78 + _ChromAberrAlpha("ChromAberr Alpha", Range(0, 1)) = 0.4 //79 + + _GlitchAmount("Glitch Amount", Range(0, 20)) = 3 //80 + + _FlickerPercent("Flicker Percent", Range(0, 1)) = 0.05 //81 + _FlickerFreq("Flicker Frequency", Range(0, 5)) = 0.2 //82 + _FlickerAlpha("Flicker Alpha", Range(0, 1)) = 0 //83 + + _ShadowX("Shadow X Axis", Range(-0.5, 0.5)) = 0.1 //84 + _ShadowY("Shadow Y Axis", Range(-0.5, 0.5)) = -0.05 //85 + _ShadowAlpha("Shadow Alpha", Range(0, 1)) = 0.5 //86 + _ShadowColor("Shadow Color", Color) = (0, 0, 0, 1) //87 + + _HandDrawnAmount("Hand Drawn Amount", Range(0, 20)) = 10 //88 + _HandDrawnSpeed("Hand Drawn Speed", Range(1, 15)) = 5 //89 + + _GrassSpeed("Speed", Range(0,50)) = 2 //90 + _GrassWind("Bend amount", Range(0,50)) = 20 //91 + [Space] + [Toggle()] _GrassManualToggle("Manually animated?", float) = 0 //92 + _GrassManualAnim("Manual Anim Value", Range(-1,1)) = 1 //93 + + _WaveAmount("Wave Amount", Range(0, 25)) = 7 //94 + _WaveSpeed("Wave Speed", Range(0, 25)) = 10 //95 + _WaveStrength("Wave Strength", Range(0, 25)) = 7.5 //96 + _WaveX("Wave X Axis", Range(0, 1)) = 0 //97 + _WaveY("Wave Y Axis", Range(0, 1)) = 0.5 //98 + + _RectSize("Rect Size", Range(1, 4)) = 1 //99 + + _OffsetUvX("X axis", Range(-1, 1)) = 0 //100 + _OffsetUvY("Y axis", Range(-1, 1)) = 0 //101 + + _ClipUvLeft("Clipping Left", Range(0, 1)) = 0 //102 + _ClipUvRight("Clipping Right", Range(0, 1)) = 0 //103 + _ClipUvUp("Clipping Up", Range(0, 1)) = 0 //104 + _ClipUvDown("Clipping Down", Range(0, 1)) = 0 //105 + + _TextureScrollXSpeed("Speed X Axis", Range(-5, 5)) = 1 //106 + _TextureScrollYSpeed("Speed Y Axis", Range(-5, 5)) = 0 //107 + + _ZoomUvAmount("Zoom Amount", Range(0.1, 5)) = 0.5 //108 + + _DistortTex("Distortion Texture", 2D) = "white" {} //109 + _DistortAmount("Distortion Amount", Range(0,2)) = 0.5 //110 + _DistortTexXSpeed("Scroll speed X", Range(-50,50)) = 5 //111 + _DistortTexYSpeed("Scroll speed Y", Range(-50,50)) = 5 //112 + + _TwistUvAmount("Twist Amount", Range(0, 3.1416)) = 1 //113 + _TwistUvPosX("Twist Pos X Axis", Range(0, 1)) = 0.5 //114 + _TwistUvPosY("Twist Pos Y Axis", Range(0, 1)) = 0.5 //115 + _TwistUvRadius("Twist Radius", Range(0, 3)) = 0.75 //116 + + _RotateUvAmount("Rotate Angle(radians)", Range(0, 6.2831)) = 0 //117 + + _FishEyeUvAmount("Fish Eye Amount", Range(0, 0.5)) = 0.35 //118 + + _PinchUvAmount("Pinch Amount", Range(0, 0.5)) = 0.35 //119 + + _ShakeUvSpeed("Shake Speed", Range(0, 20)) = 2.5 //120 + _ShakeUvX("X Multiplier", Range(0, 5)) = 1.5 //121 + _ShakeUvY("Y Multiplier", Range(0, 5)) = 1 //122 + + _ColorChangeTolerance("Tolerance", Range(0, 1)) = 0.25 //123 + _ColorChangeTarget("Color to change", Color) = (1, 0, 0, 1) //124 + [HDR] _ColorChangeNewCol("New Color", Color) = (1, 1, 0, 1) //125 + _ColorChangeLuminosity("New Color Luminosity", Range(0, 1)) = 0.0 //126 + + _RoundWaveStrength("Wave Strength", Range(0, 1)) = 0.7 //127 + _RoundWaveSpeed("Wave Speed", Range(0, 5)) = 2 //128 + + [Toggle()] _BillboardY("Billboard on both axis?", float) = 0 //129 + _ZWrite ("Depth Write", Float) = 1.0 // 130 + + _MySrcMode ("SrcMode", Float) = 5 // 131 + _MyDstMode ("DstMode", Float) = 10 // 132 + + _ShineColor("Shine Color", Color) = (1,1,1,1) // 133 + _ShineLocation("Shine Location", Range(0,1)) = 0.5 // 134 + _ShineRotate("Rotate Angle(radians)", Range(0, 6.2831)) = 0 //135 + _ShineWidth("Shine Width", Range(0.05,1)) = 0.1 // 136 + _ShineGlow("Shine Glow", Range(0,100)) = 1 // 137 + [NoScaleOffset] _ShineMask("Shine Mask", 2D) = "white" {} // 138 + + _GlitchSize("Glitch Size", Range(0.25, 5)) = 1 //139 + _HologramStripeColor("Stripes Color", Color) = (0,1,1,1) //140 + _GradBoostX("Boost X axis", Range(0.1, 5)) = 1.2 //141 + _GradBoostY("Boost Y axis", Range(0.1, 5)) = 1.2 //142 + [Toggle()] _GradIsRadial("Radial Gradient?", float) = 0 //143 + _AlphaRoundThreshold("Round Threshold", Range(0.005, 1.0)) = 0.5 //144 + _GrassRadialBend("Radial Bend", Range(0.0, 5.0)) = 0.1 //145 + + _ColorChangeTolerance2("Tolerance 2", Range(0, 1)) = 0.25 //146 + _ColorChangeTarget2("Color to change 2", Color) = (1, 0, 0, 1) //147 + [HDR] _ColorChangeNewCol2("New Color 2", Color) = (1, 1, 0, 1) //148 + _ColorChangeTolerance3("Tolerance 3", Range(0, 1)) = 0.25 //149 + _ColorChangeTarget3("Color to change 3", Color) = (1, 0, 0, 1) //150 + [HDR] _ColorChangeNewCol3("New Color 3", Color) = (1, 1, 0, 1) //151 + + _Contrast ("Contrast", Range(0, 6)) = 1 // 152 + _Brightness ("Brightness", Range(-1, 1)) = 0 // 153 + + _ColorSwapBlend ("Color Swap Blend", Range(0, 1)) = 1 // 154 + _ColorRampBlend ("Color Ramp Blend", Range(0, 1)) = 1 // 155 + _GreyscaleBlend ("Greyscale Blend", Range(0, 1)) = 1 // 156 + _GhostBlend ("Ghost Blend", Range(0, 1)) = 1 // 157 + _HologramBlend ("Hologram Blend", Range(0, 1)) = 1 // 158 + + [AllIn1ShaderGradient] _ColorRampTexGradient("Color ramp Gradient", 2D) = "white" {} //159 + + _OverlayTex("Overlay Texture", 2D) = "white" {} //160 + _OverlayColor("Overlay Color", Color) = (1, 1, 1, 1) //161 + _OverlayGlow("Overlay Glow", Range(0,25)) = 1 // 162 + _OverlayBlend("Overlay Blend", Range(0, 1)) = 1 // 163 + + _RadialStartAngle("Radial Start Angle", Range(0, 360)) = 90 //164 + _RadialClip("Radial Clip", Range(0, 360)) = 45 //165 + _RadialClip2("Radial Clip 2", Range(0, 360)) = 0 //166 + + _WarpStrength("Warp Strength", Range(0, 0.1)) = 0.025 //167 + _WarpSpeed("Warp Speed", Range(0, 25)) = 8 //168 + _WarpScale("Warp Scale", Range(0.05, 3)) = 0.5 //169 + + _OverlayTextureScrollXSpeed("Speed X Axis", Range(-5, 5)) = 0.25 //170 + _OverlayTextureScrollYSpeed("Speed Y Axis", Range(-5, 5)) = 0.25 //171 + + _ZTestMode ("Z Test Mode", Float) = 4 + _CullingOption ("Culling Option", float) = 0 + + [HideInInspector] _MinXUV("_MinXUV", Range(0, 1)) = 0.0 + [HideInInspector] _MaxXUV("_MaxXUV", Range(0, 1)) = 1.0 + [HideInInspector] _MinYUV("_MinYUV", Range(0, 1)) = 0.0 + [HideInInspector] _MaxYUV("_MaxYUV", Range(0, 1)) = 1.0 + [HideInInspector] _RandomSeed("_MaxYUV", Range(0, 10000)) = 0.0 + _EditorDrawers("Editor Drawers", Int) = 6 + + [Normal][NoScaleOffset] _NormalMap("Normal Map", 2D) = "bump" {} + _NormalStrength("Normal Strength", Range(0, 15)) = 1.0 +END_PROPERTIES + + +BEGIN_DEFINES + #pragma shader_feature_local GLOW_ON + #pragma shader_feature_local FADE_ON + #pragma shader_feature_local OUTBASE_ON + #pragma shader_feature_local ONLYOUTLINE_ON + #pragma shader_feature_local GRADIENT_ON + #pragma shader_feature_local GRADIENT2COL_ON + #pragma shader_feature_local RADIALGRADIENT_ON + #pragma shader_feature_local COLORSWAP_ON + #pragma shader_feature_local HSV_ON + #pragma shader_feature_local CHANGECOLOR_ON + #pragma shader_feature_local CHANGECOLOR2_ON + #pragma shader_feature_local CHANGECOLOR3_ON + #pragma shader_feature_local COLORRAMP_ON + #pragma shader_feature_local GRADIENTCOLORRAMP_ON + #pragma shader_feature_local HITEFFECT_ON + #pragma shader_feature_local NEGATIVE_ON + #pragma shader_feature_local PIXELATE_ON + #pragma shader_feature_local GREYSCALE_ON + #pragma shader_feature_local POSTERIZE_ON + #pragma shader_feature_local BLUR_ON + #pragma shader_feature_local MOTIONBLUR_ON + #pragma shader_feature_local GHOST_ON + #pragma shader_feature_local ALPHAOUTLINE_ON + #pragma shader_feature_local INNEROUTLINE_ON + #pragma shader_feature_local ONLYINNEROUTLINE_ON + #pragma shader_feature_local HOLOGRAM_ON + #pragma shader_feature_local CHROMABERR_ON + #pragma shader_feature_local GLITCH_ON + #pragma shader_feature_local FLICKER_ON + #pragma shader_feature_local SHADOW_ON + #pragma shader_feature_local SHINE_ON + #pragma shader_feature_local CONTRAST_ON + #pragma shader_feature_local OVERLAY_ON + #pragma shader_feature_local OVERLAYMULT_ON + #pragma shader_feature_local DOODLE_ON + #pragma shader_feature_local WIND_ON + #pragma shader_feature_local WAVEUV_ON + #pragma shader_feature_local ROUNDWAVEUV_ON + #pragma shader_feature_local RECTSIZE_ON + #pragma shader_feature_local OFFSETUV_ON + #pragma shader_feature_local CLIPPING_ON + #pragma shader_feature_local RADIALCLIPPING_ON + #pragma shader_feature_local TEXTURESCROLL_ON + #pragma shader_feature_local ZOOMUV_ON + #pragma shader_feature_local DISTORT_ON + #pragma shader_feature_local WARP_ON + #pragma shader_feature_local TWISTUV_ON + #pragma shader_feature_local ROTATEUV_ON + #pragma shader_feature_local POLARUV_ON + #pragma shader_feature_local FISHEYE_ON + #pragma shader_feature_local PINCH_ON + #pragma shader_feature_local SHAKEUV_ON + + #pragma shader_feature_local GLOWTEX_ON + #pragma shader_feature_local OUTTEX_ON + #pragma shader_feature_local OUTDIST_ON + #pragma shader_feature_local OUTBASE8DIR_ON + #pragma shader_feature_local OUTBASEPIXELPERF_ON + #pragma shader_feature_local COLORRAMPOUTLINE_ON + #pragma shader_feature_local GREYSCALEOUTLINE_ON + #pragma shader_feature_local POSTERIZEOUTLINE_ON + #pragma shader_feature_local BLURISHD_ON + #pragma shader_feature_local MANUALWIND_ON + #pragma shader_feature_local ATLAS_ON + #pragma shader_feature_local PREMULTIPLYALPHA_ON + + #pragma shader_feature BILBOARD_ON + #pragma shader_feature BILBOARDY_ON + + #pragma shader_feature NORMALMAP_ON +END_DEFINES + +BEGIN_CBUFFER + half4 _Color; + half4 _MainTex_ST, _MainTex_TexelSize; + half _Alpha, _AlphaCutoffValue; + + #if ATLAS_ON + half _MinXUV, _MaxXUV, _MinYUV, _MaxYUV; + #endif + + #if GLOW_ON + half4 _GlowColor; + half _Glow, _GlowGlobal; + #endif + + #if HSV_ON + half _HsvShift, _HsvSaturation, _HsvBright; + #endif + + #if DISTORT_ON + half4 _DistortTex_ST; + half _DistortTexXSpeed, _DistortTexYSpeed, _DistortAmount; + #endif + + #if FADE_ON + half4 _FadeBurnColor, _FadeTex_ST, _FadeBurnTex_ST; + half _FadeAmount, _FadeBurnWidth, _FadeBurnTransition,_FadeBurnGlow; + #endif + + #if OUTBASE_ON + half4 _OutlineColor; + half _OutlineAlpha, _OutlineGlow, _OutlineWidth; + int _OutlinePixelWidth; + #endif + + #if OUTTEX_ON + half4 _OutlineTex_ST; + half _OutlineTexXSpeed, _OutlineTexYSpeed; + #endif + + #if OUTDIST_ON + half4 _OutlineDistortTex_ST; + half _OutlineDistortTexXSpeed, _OutlineDistortTexYSpeed, _OutlineDistortAmount; + #endif + + #if ALPHAOUTLINE_ON + half _AlphaOutlineGlow, _AlphaOutlinePower, _AlphaOutlineMinAlpha, _AlphaOutlineBlend; + half4 _AlphaOutlineColor; + #endif + + #if INNEROUTLINE_ON + half _InnerOutlineThickness, _InnerOutlineAlpha, _InnerOutlineGlow; + half4 _InnerOutlineColor; + #endif + + #if GRADIENT_ON + half _GradBlend, _GradBoostX, _GradBoostY; + half4 _GradTopRightCol, _GradTopLeftCol, _GradBotRightCol, _GradBotLeftCol; + #endif + + #if COLORSWAP_ON + half4 _ColorSwapRed, _ColorSwapGreen, _ColorSwapBlue; + half _ColorSwapRedLuminosity, _ColorSwapGreenLuminosity, _ColorSwapBlueLuminosity, _ColorSwapBlend; + #endif + + #if CHANGECOLOR_ON + half4 _ColorChangeNewCol, _ColorChangeTarget; + half _ColorChangeTolerance, _ColorChangeLuminosity; + #endif + #if CHANGECOLOR2_ON + half4 _ColorChangeNewCol2, _ColorChangeTarget2; + half _ColorChangeTolerance2; + #endif + #if CHANGECOLOR3_ON + half4 _ColorChangeNewCol3, _ColorChangeTarget3; + half _ColorChangeTolerance3; + #endif + + #if COLORRAMP_ON + half _ColorRampLuminosity, _ColorRampBlend; + #endif + + #if HITEFFECT_ON + half4 _HitEffectColor; + half _HitEffectGlow, _HitEffectBlend; + #endif + + #if NEGATIVE_ON + half _NegativeAmount; + #endif + + #if PIXELATE_ON + half _PixelateSize; + #endif + + #if GREYSCALE_ON + half _GreyscaleLuminosity, _GreyscaleBlend; + half4 _GreyscaleTintColor; + #endif + + #if POSTERIZE_ON + half _PosterizeNumColors, _PosterizeGamma; + #endif + + #if BLUR_ON + half _BlurIntensity; + #endif + + #if MOTIONBLUR_ON + half _MotionBlurAngle, _MotionBlurDist; + #endif + + #if GHOST_ON + half _GhostColorBoost, _GhostTransparency, _GhostBlend; + #endif + + #if HOLOGRAM_ON + half _HologramStripesAmount, _HologramMinAlpha, _HologramUnmodAmount, _HologramStripesSpeed, _HologramMaxAlpha, _HologramBlend; + half4 _HologramStripeColor; + #endif + + #if CHROMABERR_ON + half _ChromAberrAmount, _ChromAberrAlpha; + #endif + + #if GLITCH_ON + half _GlitchAmount, _GlitchSize; + #endif + + #if FLICKER_ON + half _FlickerFreq, _FlickerPercent, _FlickerAlpha; + #endif + + #if SHADOW_ON + half _ShadowX, _ShadowY, _ShadowAlpha; + half4 _ShadowColor; + #endif + + #if SHINE_ON + half4 _ShineColor; + half _ShineLocation, _ShineRotate, _ShineWidth, _ShineGlow; + #endif + + #if CONTRAST_ON + half _Contrast, _Brightness; + #endif + + #if OVERLAY_ON + half4 _OverlayTex_ST, _OverlayColor; + half _OverlayGlow, _OverlayBlend, _OverlayTextureScrollXSpeed, _OverlayTextureScrollYSpeed; + #endif + + #if DOODLE_ON + half _HandDrawnAmount, _HandDrawnSpeed; + #endif + + #if WIND_ON + half _GrassSpeed, _GrassWind, _GrassManualAnim, _GrassRadialBend; + #endif + + #if WAVEUV_ON + float _WaveAmount, _WaveSpeed, _WaveStrength, _WaveX, _WaveY; + #endif + + #if ROUNDWAVEUV_ON + half _RoundWaveStrength, _RoundWaveSpeed; + #endif + + #if RECTSIZE_ON + half _RectSize; + #endif + + #if OFFSETUV_ON + half _OffsetUvX, _OffsetUvY; + #endif + + #if CLIPPING_ON + half _ClipUvLeft, _ClipUvRight, _ClipUvUp, _ClipUvDown; + #endif + + #if RADIALCLIPPING_ON + half _RadialStartAngle, _RadialClip, _RadialClip2; + #endif + + #if TEXTURESCROLL_ON + half _TextureScrollXSpeed, _TextureScrollYSpeed; + #endif + + #if ZOOMUV_ON + half _ZoomUvAmount; + #endif + + #if WARP_ON + half _WarpStrength, _WarpSpeed, _WarpScale; + #endif + + #if TWISTUV_ON + half _TwistUvAmount, _TwistUvPosX, _TwistUvPosY, _TwistUvRadius; + #endif + + #if ROTATEUV_ON + half _RotateUvAmount; + #endif + + #if FISHEYE_ON + half _FishEyeUvAmount; + #endif + + #if PINCH_ON + half _PinchUvAmount; + #endif + + #if SHAKEUV_ON + half _ShakeUvSpeed, _ShakeUvX, _ShakeUvY; + #endif + + #if NORMALMAP_ON + half _NormalStrength; + #endif + + float _RandomSeed; + +END_CBUFFER + +BEGIN_PASS("All") + Tags { "RenderType" = "Opaque" "Queue" = "Geometry" "PreviewType" = "Plane" } + Cull [_CullingOption] + ZWrite [_ZWrite] + ZTest [_ZTestMode] +END_PASS + +BEGIN_CODE + + TEXTURE2D(_MainTex); + SAMPLER(sampler_MainTex); + + #if GLOW_ON + TEXTURE2D(_GlowTex); + SAMPLER(sampler_GlowTex); + #endif + + #if FADE_ON + TEXTURE2D(_FadeTex); + SAMPLER(sampler_FadeTex); + + TEXTURE2D(_FadeBurnTex); + SAMPLER(sampler_FadeBurnTex); + #endif + + #if DISTORT_ON + TEXTURE2D(_DistortTex); + SAMPLER(sampler_DistortTex); + #endif + + #if OUTTEX_ON + TEXTURE2D(_OutlineTex); + SAMPLER(sampler_OutlineTex); + #endif + + #if OUTDIST_ON + TEXTURE2D(_OutlineDistortTex); + SAMPLER(sampler_OutlineDistortTex); + #endif + + #if COLORSWAP_ON + TEXTURE2D(_ColorSwapTex); + SAMPLER(sampler_ColorSwapTex); + #endif + + #if COLORRAMP_ON + TEXTURE2D(_ColorRampTex); + TEXTURE2D(_ColorRampTexGradient); + SAMPLER(sampler_ColorRampTex); + SAMPLER(sampler_ColorRampTexGradient); + #endif + + #if SHINE_ON + TEXTURE2D(_ShineMask); + SAMPLER(sampler_ShineMask); + #endif + + #if OVERLAY_ON + TEXTURE2D(_OverlayTex); + SAMPLER(sampler_OverlayTex); + #endif + + #if NORMALMAP_ON + TEXTURE2D(_NormalMap); + SAMPLER(sampler_NormalMap); + #endif + + + half3 GetPixel(in int offsetX, in int offsetY, in half2 uv, in Texture2D _tex, in SamplerState _sampler) + { + half2 _uv = uv + half2(offsetX * _MainTex_TexelSize.x, offsetY * _MainTex_TexelSize.y); + half4 col = SAMPLE_TEXTURE2D(_tex, _sampler, _uv); + return col.rgb; + } + + + //BLURS------------------------------------------------------------------------- + half4 Blur(half2 uv, Texture2D source, SamplerState sampler_source, half Intensity) + { + const half2 texelSize = 1.0 / _ScreenParams.xy; + const half4 color = SAMPLE_TEXTURE2D(source, sampler_source, uv); + const half2 offset = Intensity * texelSize; + + half4 accumulatedColor = color; + half accumulatedWeight = 1.0; + for (int x = -1; x <= 1; x++) + { + for (int y = -1; y <= 1; y++) + { + const half2 sampleUV = uv + half2(x, y) * offset; + const half4 sampleColor = SAMPLE_TEXTURE2D(source, sampler_source, sampleUV); + + accumulatedColor += sampleColor; + accumulatedWeight += 1.0; + } + } + + half4 blurredColor = accumulatedColor / accumulatedWeight; + return blurredColor; + } + + half BlurHD_G(half bhqp, half x) + { + return exp(-(x * x) / (2.0 * bhqp * bhqp)); + } + half4 BlurHD(half2 uv, Texture2D source, SamplerState sampler_source, half BlurAmount, half xScale, half yScale) + { + int iterations = 16; + int halfIterations = iterations / 2; + half sigmaX = 0.1 + BlurAmount * 0.5; + half sigmaY = sigmaX; + half total = 0.0; + half4 ret = half4(0, 0, 0, 0); + for (int iy = 0; iy < iterations; ++iy) + { + half fy = BlurHD_G(sigmaY, half(iy) -half(halfIterations)); + half offsetY = half(iy - halfIterations) * 0.00390625 * xScale; + for (int ix = 0; ix < iterations; ++ix) + { + half fx = BlurHD_G(sigmaX, half(ix) - half(halfIterations)); + half offsetX = half(ix - halfIterations) * 0.00390625 * yScale; + total += fx * fy; + ret += SAMPLE_TEXTURE2D(source, sampler_source, uv + half2(offsetX, offsetY)) * fx * fy; + } + } + return ret / total; + } + //----------------------------------------------------------------------- + + + //------------------------------------------- + half RemapFloat(half inValue, half inMin, half inMax, half outMin, half outMax){ + return outMin + (inValue - inMin) * (outMax - outMin) / (inMax - inMin); + } + //------------------------------------------- + + //----------------------------------------------------------------------- + half rand(half2 seed, half offset) { + return (frac(sin(dot(seed, half2(12.9898, 78.233))) * 43758.5453) + offset) % 1.0; + } + + half rand2(half2 seed, half offset) { + return (frac(sin(dot(seed * floor(50 + (_Time.x % 1.0) * 12.), half2(127.1, 311.7))) * 43758.5453123) + offset) % 1.0; + } + + half rand2CustomTime(half2 seed, half offset, half customTime) { + return (frac(sin(dot(seed * floor(50 + (customTime % 1.0) * 12.), half2(127.1, 311.7))) * 43758.5453123) + offset) % 1.0; + } + //----------------------------------------------------------------------- + + + void ModifyVertex(inout VertexData v, inout ExtraV2F d) + { + //BILBOARD_ON + #if BILBOARD_ON + half3 camRight = mul((half3x3)unity_CameraToWorld, half3(1,0,0)); + half3 camUp = half3(0,1,0); + #if BILBOARDY_ON + camUp = mul((half3x3)unity_CameraToWorld, half3(0,1,0)); + #endif + half3 localPos = v.vertex.x * camRight + v.vertex.y * camUp; + v.vertex = half4(localPos, 1); + #endif + //----------------------------------------------------------- + + v.texcoord0.xy = TRANSFORM_TEX(v.texcoord0.xy, _MainTex); + half2 center = half2(0.5, 0.5); + #if ATLAS_ON + center = half2((_MaxXUV + _MinXUV) / 2.0, (_MaxYUV + _MinYUV) / 2.0); + #endif + + //POLARUV_ON + #if POLARUV_ON + v.texcoord0.xy = v.texcoord0.xy - center; + #endif + + //---------------------------------------- + + //ROTATEUV_ON + #if ROTATEUV_ON + half2 uvC = v.texcoord0.xy; + half cosAngle = cos(_RotateUvAmount); + half sinAngle = sin(_RotateUvAmount); + half2x2 rot = half2x2(cosAngle, -sinAngle, sinAngle, cosAngle); + uvC -= center; + v.texcoord0.xy = mul(rot, uvC); + v.texcoord0.xy += center; + #endif + //-------------------- + + #if RECTSIZE_ON + v.vertex.xyz += (v.vertex.xyz * (_RectSize - 1.0)); + #endif + + #if OUTTEX_ON + v.texcoord1.xy = TRANSFORM_TEX(v.texcoord0.xy, _OutlineTex); + #endif + + #if OUTDIST_ON + v.texcoord2.xy = TRANSFORM_TEX(v.texcoord0.xy, _OutlineDistortTex); + #endif + + #if DISTORT_ON + v.texcoord3.xy = TRANSFORM_TEX(v.texcoord0.xy, _DistortTex); + #endif + } + + void SurfaceFunction(inout Surface o, ShaderData d) + { + half randomSeed = _RandomSeed; + + float2 uvRect = d.texcoord0; + half2 center = half2(0.5, 0.5); + #if ATLAS_ON + center = half2((_MaxXUV + _MinXUV) / 2.0, (_MaxYUV + _MinYUV) / 2.0); + uvRect = half2((d.texcoord0.x - _MinXUV) / (_MaxXUV - _MinXUV), (d.texcoord0.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half2 centerTiled = half2(center.x * _MainTex_ST.x, center.y * _MainTex_ST.y); + + //CLIPPING_ON + #if CLIPPING_ON + half2 tiledUv = half2(d.texcoord0.x / _MainTex_ST.x, d.texcoord0.y / _MainTex_ST.y); + #if ATLAS_ON + tiledUv = half2((tiledUv.x - _MinXUV) / (_MaxXUV - _MinXUV), (tiledUv.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + clip((1 - _ClipUvUp) - tiledUv.y); + clip(tiledUv.y - _ClipUvDown); + clip((1 - _ClipUvRight) - tiledUv.x); + clip(tiledUv.x - _ClipUvLeft); + #endif + //---------------------------------- + + //RADIALCLIPPING_ON + #if RADIALCLIPPING_ON + half2 tiledUv2 = half2(d.texcoord0.x / _MainTex_ST.x, d.texcoord0.y / _MainTex_ST.y); + #if ATLAS_ON + tiledUv2 = half2((tiledUv2.x - _MinXUV) / (_MaxXUV - _MinXUV), (tiledUv2.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half startAngle = _RadialStartAngle - _RadialClip; + half endAngle = _RadialStartAngle + _RadialClip2; + half offset0 = clamp(0, 360, startAngle + 360); + half offset360 = clamp(0, 360, endAngle - 360); + half2 atan2Coord = half2(lerp(-1, 1, tiledUv2.x), lerp(-1, 1, tiledUv2.y)); + half atanAngle = atan2(atan2Coord.y, atan2Coord.x) * 57.3; // angle in degrees + if(atanAngle < 0) atanAngle = 360 + atanAngle; + if(atanAngle >= startAngle && atanAngle <= endAngle) discard; + if(atanAngle <= offset360) discard; + if(atanAngle >= offset0) discard; + #endif + + //----------------------------- + + //TEXTURESCROLL_ON && ATLAS_ON + #if TEXTURESCROLL_ON && ATLAS_ON + d.texcoord0.xy = half2(_MinXUV + ((_MaxXUV - _MinXUV) * (abs(((_Time.y + randomSeed) * _TextureScrollXSpeed) + uvRect.x) % 1)), + _MinYUV + ((_MaxYUV - _MinYUV) * (abs(((_Time.y + randomSeed) * _TextureScrollYSpeed) + uvRect.y) % 1))); + #endif + //---------------------------- + + //OFFSETUV_ON + #if OFFSETUV_ON + #if ATLAS_ON + d.texcoord0.xy = half2(_MinXUV + ((_MaxXUV - _MinXUV) * (abs((_OffsetUvX + uvRect.x) % 1))), + _MinYUV + ((_MaxYUV - _MinYUV) * (abs(_OffsetUvY + uvRect.y) % 1))); + #else + d.texcoord0.xy += half2(_OffsetUvX, _OffsetUvY); + #endif + #endif + + //---------------------- + + //POLARUV_ON + #if POLARUV_ON + d.texcoord0.xy = half2(atan2(d.texcoord0.y, d.texcoord0.x) / (2.0f * 3.141592653589f), length(d.texcoord0.xy)); + d.texcoord0.xy *= _MainTex_ST.xy; + #endif + + //-------------------------------------- + + //TWISTUV_ON + #if TWISTUV_ON + #if ATLAS_ON + _TwistUvPosX = ((_MaxXUV - _MinXUV) * _TwistUvPosX) + _MinXUV; + _TwistUvPosY = ((_MaxYUV - _MinYUV) * _TwistUvPosY) + _MinYUV; + #endif + half2 tempUv = d.texcoord0.xy - half2(_TwistUvPosX * _MainTex_ST.x, _TwistUvPosY * _MainTex_ST.y); + _TwistUvRadius *= (_MainTex_ST.x + _MainTex_ST.y) / 2; + half percent = (_TwistUvRadius - length(tempUv)) / _TwistUvRadius; + half theta = percent * percent * (2.0 * sin(_TwistUvAmount)) * 8.0; + half s = sin(theta); + half c = cos(theta); + half beta = max(sign(_TwistUvRadius - length(tempUv)), 0.0); + tempUv = half2(dot(tempUv, half2(c, -s)), dot(tempUv, half2(s, c))) * beta + tempUv * (1 - beta); + tempUv += half2(_TwistUvPosX * _MainTex_ST.x, _TwistUvPosY * _MainTex_ST.y); + d.texcoord0.xy = tempUv; + #endif + + //-------------------------------------------- + + //FISHEYE_ON + #if FISHEYE_ON + half bind = length(centerTiled); + half2 dF = d.texcoord0.xy - centerTiled; + half dFlen = length(dF); + half fishInt = (3.14159265359 / bind) * (_FishEyeUvAmount + 0.001); + d.texcoord0.xy = centerTiled + (dF / (max(0.0001, dFlen))) * tan(dFlen * fishInt) * bind / tan(bind * fishInt); + #endif + //--------------------------------------------- + + //PINCH_ON + #if PINCH_ON + half2 dP = d.texcoord0.xy - centerTiled; + half pinchInt = (3.141592 / length(centerTiled)) * (-_PinchUvAmount + 0.001); + d.texcoord0.xy = centerTiled + normalize(dP) * atan(length(dP) * -pinchInt * 10.0) * 0.5 / atan(-pinchInt * 5); + #endif + + //--------------------------------------------- + + //ZOOMUV_ON + #if ZOOMUV_ON + d.texcoord0.xy -= centerTiled; + d.texcoord0.xy = d.texcoord0.xy * _ZoomUvAmount; + d.texcoord0.xy += centerTiled; + #endif + + //----------------------------------------------- + + //DOODLE_ON + #if DOODLE_ON + half2 uvCopy = uvRect; + _HandDrawnSpeed = (floor((_Time.x + randomSeed) * 20 * _HandDrawnSpeed) / _HandDrawnSpeed) * _HandDrawnSpeed; + uvCopy.x = sin((uvCopy.x * _HandDrawnAmount + _HandDrawnSpeed) * 4); + uvCopy.y = cos((uvCopy.y * _HandDrawnAmount + _HandDrawnSpeed) * 4); + d.texcoord0.xy = lerp(d.texcoord0.xy, d.texcoord0.xy + uvCopy, 0.0005 * _HandDrawnAmount); + #endif + + //-------------------------- + + //SHAKEUV_ON + #if SHAKEUV_ON + half xShake = sin((_Time.x + randomSeed) * _ShakeUvSpeed * 50) * _ShakeUvX; + half yShake = cos((_Time.x + randomSeed) * _ShakeUvSpeed * 50) * _ShakeUvY; + d.texcoord0.xy += half2(xShake * 0.012, yShake * 0.01); + #endif + + //------------------------------------------- + + //RECTSIZE_ON + #if RECTSIZE_ON + d.texcoord0.xy = d.texcoord0.xy * (_RectSize).xx + (((-_RectSize * 0.5) + 0.5)).xx; + #endif + + //------------------------------------------- + + //DISTORT_ON + #if DISTORT_ON + #if ATLAS_ON + d.texcoord3.x = d.texcoord3.x * (1 / (_MaxXUV - _MinXUV)); + d.texcoord3.y = d.texcoord3.y * (1 / (_MaxYUV - _MinYUV)); + #endif + + d.texcoord3.x += ((_Time.x + _RandomSeed) * _DistortTexXSpeed) % 1; + d.texcoord3.y += ((_Time.x + _RandomSeed) * _DistortTexYSpeed) % 1; + half distortAmnt = (SAMPLE_TEXTURE2D(_DistortTex, sampler_DistortTex, d.texcoord3.xy).r - 0.5) * 0.2 * _DistortAmount; + d.texcoord0.x += distortAmnt; + d.texcoord0.y += distortAmnt; + #endif + //------------------------------------------------------- + + //WARP_ON + #if WARP_ON + half2 warpUv = half2(d.texcoord0.x / _MainTex_ST.x, d.texcoord0.y / _MainTex_ST.y); + #if ATLAS_ON + warpUv = half2((warpUv.x - _MinXUV) / (_MaxXUV - _MinXUV), (warpUv.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + const float tau = 6.283185307179586; + float xWarp = (_Time.y + randomSeed) * _WarpSpeed + warpUv.x * tau / _WarpScale; + float yWarp = (_Time.y + randomSeed) * _WarpSpeed + warpUv.y * tau / _WarpScale; + float2 warp = float2(sin(xWarp), sin(yWarp)) * _WarpStrength; + d.texcoord0.xy += warp; + #endif + + //------------------------------------------------------- + + //WAVEUV_ON + #if WAVEUV_ON + float2 uvWave = half2(_WaveX * _MainTex_ST.x, _WaveY * _MainTex_ST.y) - d.texcoord0.xy; + uvWave %= 1; + #if ATLAS_ON + uvWave = half2(_WaveX, _WaveY) - uvRect; + #endif + uvWave.x *= _ScreenParams.x / _ScreenParams.y; + float waveTime = _Time.y + randomSeed; + float angWave = (sqrt(dot(uvWave, uvWave)) * _WaveAmount) - ((waveTime * _WaveSpeed)); + d.texcoord0.xy = d.texcoord0.xy + uvWave * sin(angWave) * (_WaveStrength / 1000.0); + #endif + //---------------------------------------------------- + + //ROUNDWAVEUV_ON + #if ROUNDWAVEUV_ON + half xWave = ((0.5 * _MainTex_ST.x) - uvRect.x); + half yWave = ((0.5 * _MainTex_ST.y) - uvRect.y) * (_MainTex_TexelSize.w / _MainTex_TexelSize.z); + half ripple = -sqrt(xWave*xWave + yWave* yWave); + d.texcoord0.xy += (sin((ripple + (_Time.y + randomSeed) * (_RoundWaveSpeed/10.0)) / 0.015) * (_RoundWaveStrength/10.0)) % 1; + #endif + //---------------------------------------------------- + + + //WIND_ON + #if WIND_ON + half windOffset = sin((_Time.x + randomSeed) * _GrassSpeed * 10); + half2 windCenter = half2(0.5, 0.1); + #if ATLAS_ON + windCenter.x = ((_MaxXUV - _MinXUV) * windCenter.x) + _MinXUV; + windCenter.y = ((_MaxYUV - _MinYUV) * windCenter.y) + _MinYUV; + #endif + #if !MANUALWIND_ON + d.texcoord0.x = fmod(abs(lerp(d.texcoord0.x, d.texcoord0.x + (_GrassWind * 0.01 * windOffset), uvRect.y)), 1); + #else + d.texcoord0.x = fmod(abs(lerp(d.texcoord0.x, d.texcoord0.x + (_GrassWind * 0.01 * _GrassManualAnim), uvRect.y)), 1); + windOffset = _GrassManualAnim; + #endif + half2 delta = d.texcoord0.xy - windCenter; + half delta2 = dot(delta.xy, delta.xy); + half2 delta_offset = delta2 * windOffset; + d.texcoord0.xy = d.texcoord0.xy + half2(delta.y, -delta.x) * delta_offset * _GrassRadialBend; + #endif + + //-------------------------------------------------------- + + //TEXTURESCROLL_ON && !ATLAS_ON + #if TEXTURESCROLL_ON && !ATLAS_ON + d.texcoord0.x += ((_Time.y + randomSeed) * _TextureScrollXSpeed) % 1; + d.texcoord0.y += ((_Time.y + randomSeed) * _TextureScrollYSpeed) % 1; + #endif + //------------------------------ + + //PIXELATE_ON + #if PIXELATE_ON + half aspectRatio = _MainTex_TexelSize.x / _MainTex_TexelSize.y; + half2 pixelSize = float2(_PixelateSize, _PixelateSize * aspectRatio); + d.texcoord0.xy = floor(d.texcoord0.xy * pixelSize) / pixelSize; + #endif + //-------------- + + half4 col = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy); + half originalAlpha = col.a; + col *= d.vertexColor; + + //NORMAL MAP + #if NORMALMAP_ON + half4 normalSample = SAMPLE_TEXTURE2D(_NormalMap, sampler_NormalMap, d.texcoord0.xy); + half3 normalTS = UnpackNormal(normalSample); + normalTS.xy *= _NormalStrength; + o.Normal = normalTS; + #endif + + + //GLITCH_ON + #if GLITCH_ON + half2 uvGlitch = uvRect; + uvGlitch.y -= 0.5; + half lineNoise = pow(rand2(floor(uvGlitch * half2(24., 19.) * _GlitchSize) * 4.0, randomSeed), 3.0) * _GlitchAmount + * pow(rand2(floor(uvGlitch * half2(38., 14.) * _GlitchSize) * 4.0, randomSeed), 3.0); + col = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(lineNoise * 0.02 * rand2(half2(2.0, 1), randomSeed), 0)) * d.vertexColor; + #endif + //-------------------------------------- + + //CHROMABERR_ON + #if CHROMABERR_ON + half4 r = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(_ChromAberrAmount/10, 0)) * d.vertexColor; + half4 b = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(-_ChromAberrAmount/10, 0)) * d.vertexColor; + col = half4(r.r * r.a, col.g, b.b * b.a, max(max(r.a, b.a) * _ChromAberrAlpha, col.a)); + #endif + + //-------------------------------- + + //BLUR_ON + #if BLUR_ON + #if ATLAS_ON + #if !BLURISHD_ON + col = BlurHD(d.texcoord0.xy, _MainTex, sampler_MainTex, _BlurIntensity, (_MaxXUV - _MinXUV), (_MaxYUV - _MinYUV)) * d.vertexColor; + #else + col = Blur(d.texcoord0.xy, _MainTex, sampler_MainTex, _BlurIntensity * (_MaxXUV - _MinXUV)) * d.vertexColor; + #endif + #else + #if !BLURISHD_ON + col = BlurHD(d.texcoord0.xy, _MainTex, sampler_MainTex, _BlurIntensity, 1, 1) * d.vertexColor; + #else + col = Blur(d.texcoord0.xy, _MainTex, sampler_MainTex, _BlurIntensity) * d.vertexColor; + #endif + #endif + #endif + + //-------------------- + + //MOTIONBLUR_ON + #if MOTIONBLUR_ON + _MotionBlurAngle = _MotionBlurAngle * 3.1415926; + #define rot(n) mul(n, half2x2(cos(_MotionBlurAngle), -sin(_MotionBlurAngle), sin(_MotionBlurAngle), cos(_MotionBlurAngle))) + _MotionBlurDist = _MotionBlurDist * 0.005; + #if ATLAS_ON + _MotionBlurDist *= (_MaxXUV - _MinXUV); + #endif + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(-_MotionBlurDist, -_MotionBlurDist))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(-_MotionBlurDist * 2, -_MotionBlurDist * 2))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(-_MotionBlurDist * 3, -_MotionBlurDist * 3))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(-_MotionBlurDist * 4, -_MotionBlurDist * 4))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(_MotionBlurDist, _MotionBlurDist))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(_MotionBlurDist * 2, _MotionBlurDist * 2))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(_MotionBlurDist * 3, _MotionBlurDist * 3))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(_MotionBlurDist * 4, _MotionBlurDist * 4))); + col.rgb = col.rgb / 9; + #endif + //------------------------------------ + + //NEGATIVE_ON + #if NEGATIVE_ON + col.rgb = lerp(col.rgb, 1 - col.rgb, _NegativeAmount); + #endif + + //-------------- + half luminance = 0; + + //GREYSCALE_ON && !GREYSCALEOUTLINE_ON + #if GREYSCALE_ON && !GREYSCALEOUTLINE_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + luminance = saturate(luminance + _GreyscaleLuminosity); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _GreyscaleTintColor, _GreyscaleBlend); + #endif + //------------------------------------ + + //GHOST_ON + #if GHOST_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + half4 ghostResult; + ghostResult.a = saturate(luminance - _GhostTransparency) * col.a; + ghostResult.rgb = col.rgb * (luminance + _GhostColorBoost); + col = lerp(col, ghostResult, _GhostBlend); + #endif + //------------------------------------ + + //INNEROUTLINE_ON + #if INNEROUTLINE_ON + half3 innerT = abs(GetPixel(0, _InnerOutlineThickness, d.texcoord0.xy, _MainTex, sampler_MainTex) - GetPixel(0, -_InnerOutlineThickness, d.texcoord0.xy, _MainTex, sampler_MainTex)); + innerT += abs(GetPixel(_InnerOutlineThickness, 0, d.texcoord0.xy, _MainTex, sampler_MainTex) - GetPixel(-_InnerOutlineThickness, 0, d.texcoord0.xy, _MainTex, sampler_MainTex)); + #if !ONLYINNEROUTLINE_ON + innerT = (innerT / 2.0) * col.a * _InnerOutlineAlpha; + col.rgb += length(innerT) * _InnerOutlineColor.rgb * _InnerOutlineGlow; + #else + innerT *= col.a * _InnerOutlineAlpha; + col.rgb = length(innerT) * _InnerOutlineColor.rgb * _InnerOutlineGlow; + col.a = step(0.3, col.r+col.g+col.b); + #endif + #endif + //------------------------------------------------------- + + //HITEFFECT_ON + #if HITEFFECT_ON + col.rgb = lerp(col.rgb, _HitEffectColor.rgb * _HitEffectGlow, _HitEffectBlend); + #endif + //-------------------- + + //GRADIENT_ON + #if GRADIENT_ON + half2 tiledUvGrad = half2(uvRect.x / _MainTex_ST.x, uvRect.y / _MainTex_ST.y); + #if GRADIENT2COL_ON + _GradTopRightCol = _GradTopLeftCol; + _GradBotRightCol = _GradBotLeftCol; + #endif + #if RADIALGRADIENT_ON + half radialDist = 1 - length(tiledUvGrad - half2(0.5, 0.5)); + radialDist *= (_MainTex_TexelSize.w / _MainTex_TexelSize.z); + radialDist = saturate(_GradBoostX * radialDist); + half4 gradientResult = lerp(_GradTopLeftCol, _GradBotLeftCol, radialDist); + #else + half gradXLerpFactor = saturate(pow(tiledUvGrad.x, _GradBoostX)); + half4 gradientResult = lerp(lerp(_GradBotLeftCol, _GradBotRightCol, gradXLerpFactor), + lerp(_GradTopLeftCol, _GradTopRightCol, gradXLerpFactor), saturate(pow(tiledUvGrad.y, _GradBoostY))); + #endif + gradientResult = lerp(col, gradientResult, _GradBlend); + col.rgb = gradientResult.rgb * col.a; + col.a *= gradientResult.a; + #endif + //-------------------------------------------------------------------- + + //CONTRAST_ON + #if CONTRAST_ON + col.rgb = (col.rgb - float3(0.5, 0.5, 0.5)) * _Contrast + float3(0.5, 0.5, 0.5); + col.rgb += _Brightness; + #endif + + //------------------------------------------------------------------- + + //COLORSWAP_ON + #if COLORSWAP_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + half4 swapMask = SAMPLE_TEXTURE2D(_ColorSwapTex, sampler_ColorSwapTex, d.texcoord0.xy); + swapMask.rgb *= swapMask.a; + half3 redSwap = _ColorSwapRed * swapMask.r * saturate(luminance + _ColorSwapRedLuminosity); + half3 greenSwap = _ColorSwapGreen * swapMask.g * saturate(luminance + _ColorSwapGreenLuminosity); + half3 blueSwap = _ColorSwapBlue * swapMask.b * saturate(luminance + _ColorSwapBlueLuminosity); + swapMask.rgb = col.rgb * saturate(1 - swapMask.r - swapMask.g - swapMask.b); + col.rgb = lerp(col.rgb, swapMask.rgb + redSwap + greenSwap + blueSwap, _ColorSwapBlend); + #endif + //-------------------------------------------------------------------- + + //COLORRAMP_ON && !COLORRAMPOUTLINE_ON + #if COLORRAMP_ON && !COLORRAMPOUTLINE_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + luminance = saturate(luminance + _ColorRampLuminosity); + #if GRADIENTCOLORRAMP_ON + col.rgb = lerp(col.rgb, SAMPLE_TEXTURE2D(_ColorRampTexGradient, sampler_ColorRampTexGradient, half2(luminance, 0)).rgb, _ColorRampBlend); + #else + col.rgb = lerp(col.rgb, SAMPLE_TEXTURE2D(_ColorRampTex, sampler_ColorRampTex, half2(luminance, 0)).rgb, _ColorRampBlend); + #endif + #endif + //-------------------------------------------------------------------- + + //CHANGECOLOR_ON + #if CHANGECOLOR_ON + float3 currChangeColor = saturate(col.rgb); + luminance = 0.3 * currChangeColor.r + 0.59 * currChangeColor.g + 0.11 * currChangeColor.b; + luminance = saturate(luminance + _ColorChangeLuminosity); + half3 dif = abs(currChangeColor - _ColorChangeTarget.rgb); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _ColorChangeNewCol.rgb, + max(sign(1 - saturate(dif.x + dif.y + dif.z) - _ColorChangeTolerance), 0.0)); + #if CHANGECOLOR2_ON + dif = abs(currChangeColor - _ColorChangeTarget2.rgb); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _ColorChangeNewCol2.rgb, + max(sign(1 - saturate(dif.x + dif.y + dif.z) - _ColorChangeTolerance2), 0.0)); + #endif + #if CHANGECOLOR3_ON + dif = abs(currChangeColor - _ColorChangeTarget3.rgb); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _ColorChangeNewCol3.rgb, + max(sign(1 - saturate(dif.x + dif.y + dif.z) - _ColorChangeTolerance3), 0.0)); + #endif + #endif + //------------------------------------------------------- + + //POSTERIZE_ON && !POSTERIZEOUTLINE_ON + #if POSTERIZE_ON && !POSTERIZEOUTLINE_ON + col.rgb = pow(col.rgb, _PosterizeGamma) * _PosterizeNumColors; + col.rgb = floor(col.rgb) / _PosterizeNumColors; + col.rgb = pow(col.rgb, 1.0 / _PosterizeGamma); + #endif + //------------------------------------ + + //HSV_ON + #if HSV_ON + half3 resultHsv = half3(col.rgb); + half cosHsv = _HsvBright * _HsvSaturation * cos(_HsvShift * 3.14159265 / 180); + half sinHsv = _HsvBright * _HsvSaturation * sin(_HsvShift * 3.14159265 / 180); + resultHsv.x = (.299 * _HsvBright + .701 * cosHsv + .168 * sinHsv) * col.x + + (.587 * _HsvBright - .587 * cosHsv + .330 * sinHsv) * col.y + + (.114 * _HsvBright - .114 * cosHsv - .497 * sinHsv) * col.z; + resultHsv.y = (.299 * _HsvBright - .299 * cosHsv - .328 * sinHsv) *col.x + + (.587 * _HsvBright + .413 * cosHsv + .035 * sinHsv) * col.y + + (.114 * _HsvBright - .114 * cosHsv + .292 * sinHsv) * col.z; + resultHsv.z = (.299 * _HsvBright - .3 * cosHsv + 1.25 * sinHsv) * col.x + + (.587 * _HsvBright - .588 * cosHsv - 1.05 * sinHsv) * col.y + + (.114 * _HsvBright + .886 * cosHsv - .203 * sinHsv) * col.z; + col.rgb = resultHsv; + #endif + //------------------------------------------------------- + + //OVERLAY_ON + #if OVERLAY_ON + half2 overlayUvs = d.texcoord0.xy; + overlayUvs.x += ((_Time.y + randomSeed) * _OverlayTextureScrollXSpeed) % 1; + overlayUvs.y += ((_Time.y + randomSeed) * _OverlayTextureScrollYSpeed) % 1; + half4 overlayCol = SAMPLE_TEXTURE2D(_OverlayTex, sampler_OverlayTex, TRANSFORM_TEX(overlayUvs, _OverlayTex)); + overlayCol.rgb *= _OverlayColor.rgb * _OverlayGlow; + #if !OVERLAYMULT_ON + overlayCol.rgb *= overlayCol.a * _OverlayColor.rgb * _OverlayColor.a * _OverlayBlend; + col.rgb += overlayCol.rgb; + #else + overlayCol.a *= _OverlayColor.a; + col = lerp(col, col * overlayCol, _OverlayBlend); + #endif + #endif + + //--------------------------------- + + //OUTBASE_ON + #if OUTBASE_ON + #if OUTBASEPIXELPERF_ON + half2 destUv = half2(_OutlinePixelWidth * _MainTex_TexelSize.x, _OutlinePixelWidth * _MainTex_TexelSize.y); + #else + half2 destUv = half2(_OutlineWidth * _MainTex_TexelSize.x * 200, _OutlineWidth * _MainTex_TexelSize.y * 200); + #endif + + #if OUTDIST_ON + d.texcoord3.x += ((_Time.x + _RandomSeed) * _OutlineDistortTexXSpeed) % 1; + d.texcoord3.y += ((_Time.x + _RandomSeed) * _OutlineDistortTexYSpeed) % 1; + #if ATLAS_ON + d.texcoord3 = half2((d.texcoord3.x - _MinXUV) / (_MaxXUV - _MinXUV), (d.texcoord3.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half outDistortAmnt = (SAMPLE_TEXTURE2D(_OutlineDistortTex, sampler_OutlineDistortTex, d.texcoord3).r - 0.5) * 0.2 * _OutlineDistortAmount; + destUv.x += outDistortAmnt; + destUv.y += outDistortAmnt; + #endif + + half spriteLeft = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(destUv.x, 0)).a; + half spriteRight = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy - half2(destUv.x, 0)).a; + half spriteBottom = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(0, destUv.y)).a; + half spriteTop = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy - half2(0, destUv.y)).a; + half result = spriteLeft + spriteRight + spriteBottom + spriteTop; + + #if OUTBASE8DIR_ON + half spriteTopLeft = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(destUv.x, destUv.y)).a; + half spriteTopRight = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(-destUv.x, destUv.y)).a; + half spriteBotLeft = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(destUv.x, -destUv.y)).a; + half spriteBotRight = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(-destUv.x, -destUv.y)).a; + result = result + spriteTopLeft + spriteTopRight + spriteBotLeft + spriteBotRight; + #endif + + result = step(0.05, saturate(result)); + + #if OUTTEX_ON + d.texcoord1.x += ((_Time.x + _RandomSeed) * _OutlineTexXSpeed) % 1; + d.texcoord1.y += ((_Time.x + _RandomSeed) * _OutlineTexYSpeed) % 1; + #if ATLAS_ON + d.texcoord1 = half2((d.texcoord1.x - _MinXUV) / (_MaxXUV - _MinXUV), (d.texcoord1.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half4 tempOutColor = SAMPLE_TEXTURE2D(_OutlineTex, sampler_OutlineTex, d.texcoord1); + tempOutColor *= _OutlineColor; + _OutlineColor = tempOutColor; + #endif + + result *= (1 - originalAlpha) * _OutlineAlpha; + + half4 outline = _OutlineColor * d.vertexColor.a; + outline.rgb *= _OutlineGlow; + outline.a = result; + #if ONLYOUTLINE_ON + col = outline; + #else + col = lerp(col, outline, result); + #endif + #endif + //------------------------------------------------------- + + //FADE_ON + #if FADE_ON + half2 tiledUvFade1 = TRANSFORM_TEX(d.texcoord0, _FadeTex); + half2 tiledUvFade2 = TRANSFORM_TEX(d.texcoord0, _FadeBurnTex); + #if ATLAS_ON + tiledUvFade1 = half2((tiledUvFade1.x - _MinXUV) / (_MaxXUV - _MinXUV), (tiledUvFade1.y - _MinYUV) / (_MaxYUV - _MinYUV)); + tiledUvFade2 = half2((tiledUvFade2.x - _MinXUV) / (_MaxXUV - _MinXUV), (tiledUvFade2.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half fadeTemp = SAMPLE_TEXTURE2D(_FadeTex, sampler_FadeTex, tiledUvFade1).r; + half fade = smoothstep(_FadeAmount, _FadeAmount + _FadeBurnTransition, fadeTemp); + half fadeBurn = saturate(smoothstep(_FadeAmount - _FadeBurnWidth, _FadeAmount - _FadeBurnWidth + 0.1, fadeTemp) * _FadeAmount); + col.a *= fade; + _FadeBurnColor.rgb *= _FadeBurnGlow; + col += fadeBurn * SAMPLE_TEXTURE2D(_FadeBurnTex, sampler_FadeBurnTex, tiledUvFade2) * _FadeBurnColor * originalAlpha * (1 - col.a); + #endif + //------------------------------------------------------- + + //SHADOW_ON + #if SHADOW_ON + half shadowA = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(_ShadowX, _ShadowY)).a; + half preMultShadowMask = 1 - (saturate(shadowA - col.a) * (1 - col.a)); + col.rgb *= 1 - ((shadowA - col.a) * (1 - col.a)); + col.rgb += (_ShadowColor * shadowA) * (1 - col.a); + col.a = max(shadowA * _ShadowAlpha * d.vertexColor.a, col.a); + #endif + + //------------------------------------------------------- + + //GLOW_ON + #if GLOW_ON + half4 emission; + #if GLOWTEX_ON + emission = SAMPLE_TEXTURE2D(_GlowTex, sampler_GlowTex, d.texcoord0); + #else + emission = col; + #endif + + col.rgb *= _GlowGlobal; + emission.rgb *= emission.a * col.a * _Glow * _GlowColor; + col.rgb += emission.rgb; + #endif + //------------------------------------------------------- + + //COLORRAMP_ON && COLORRAMPOUTLINE_ON + #if COLORRAMP_ON && COLORRAMPOUTLINE_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + luminance = saturate(luminance + _ColorRampLuminosity); + #if GRADIENTCOLORRAMP_ON + col.rgb = lerp(col.rgb, SAMPLE_TEXTURE2D(_ColorRampTexGradient, sampler_ColorRampTexGradient, half2(luminance, 0)).rgb, _ColorRampBlend); + #else + col.rgb = lerp(col.rgb, SAMPLE_TEXTURE2D(_ColorRampTex, sampler_ColorRampTex, half2(luminance, 0)).rgb, _ColorRampBlend); + #endif + #endif + //--------------- + + //GREYSCALE_ON && GREYSCALEOUTLINE_ON + #if GREYSCALE_ON && GREYSCALEOUTLINE_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + luminance = saturate(luminance + _GreyscaleLuminosity); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _GreyscaleTintColor, _GreyscaleBlend); + #endif + + //----------------------------------- + + //POSTERIZE_ON && POSTERIZEOUTLINE_ON + #if POSTERIZE_ON && POSTERIZEOUTLINE_ON + col.rgb = pow(col.rgb, _PosterizeGamma) * _PosterizeNumColors; + col.rgb = floor(col.rgb) / _PosterizeNumColors; + col.rgb = pow(col.rgb, 1.0 / _PosterizeGamma); + #endif + + //----------------------------------- + + //SHINE_ON + #if SHINE_ON + half2 uvShine = uvRect; + half cosAngle = cos(_ShineRotate); + half sinAngle = sin(_ShineRotate); + half2x2 rot = half2x2(cosAngle, -sinAngle, sinAngle, cosAngle); + uvShine -= half2(0.5, 0.5); + uvShine = mul(rot, uvShine); + uvShine += half2(0.5, 0.5); + half shineMask = SAMPLE_TEXTURE2D(_ShineMask, sampler_ShineMask, d.texcoord0.xy).a; + half currentDistanceProjection = (uvShine.x + uvShine.y) / 2; + half whitePower = 1 - (abs(currentDistanceProjection - _ShineLocation) / _ShineWidth); + col.rgb += col.a * whitePower * _ShineGlow * max(sign(currentDistanceProjection - (_ShineLocation - _ShineWidth)), 0.0) + * max(sign((_ShineLocation + _ShineWidth) - currentDistanceProjection), 0.0) * _ShineColor * shineMask; + #endif + + //----------------------------------- + + //HOLOGRAM_ON + #if HOLOGRAM_ON + half totalHologram = _HologramStripesAmount + _HologramUnmodAmount; + half hologramYCoord = ((uvRect.y + (((_Time.x + randomSeed) % 1) * _HologramStripesSpeed)) % totalHologram) / totalHologram; + hologramYCoord = abs(hologramYCoord); + half alpha = RemapFloat(saturate(hologramYCoord - (_HologramUnmodAmount/totalHologram)), 0.0, 1.0, _HologramMinAlpha, saturate(_HologramMaxAlpha)); + half hologramMask = max(sign((_HologramUnmodAmount/totalHologram) - hologramYCoord), 0.0); + half4 hologramResult = col; + hologramResult.a *= lerp(alpha, 1, hologramMask); + hologramResult.rgb *= max(1, _HologramMaxAlpha * max(sign(hologramYCoord - (_HologramUnmodAmount/totalHologram)), 0.0)); + hologramMask = 1 - step(0.01,hologramMask); + hologramResult.rgb += hologramMask * _HologramStripeColor * col.a; + col = lerp(col, hologramResult, _HologramBlend); + #endif + + //----------------------------------- + + //FLICKER_ON + #if FLICKER_ON + col.a *= saturate(col.a * step(frac(0.05 + (_Time.w + randomSeed) * _FlickerFreq), 1 - _FlickerPercent) + _FlickerAlpha); + #endif + //----------------------------------- + + //ALPHACUTOFF_ON + + //ALPHAROUND_ON + + //ALPHAOUTLINE_ON + #if ALPHAOUTLINE_ON + half alphaOutlineRes = pow(1 - col.a, max(_AlphaOutlinePower, 0.0001)) * step(_AlphaOutlineMinAlpha, col.a) * _AlphaOutlineBlend; + col.rgb = lerp(col.rgb, _AlphaOutlineColor.rgb * _AlphaOutlineGlow, alphaOutlineRes); + col.a = lerp(col.a, 1, alphaOutlineRes > 1); + #endif + //------------------------------------------------------- + + //FOG_ON + + //------------------ + + col *= _Color; + o.Albedo = col; + col.a *= _Alpha; + clip(col.a - _AlphaCutoffValue - 0.01); + o.Alpha = _Color.a; + } + +END_CODE \ No newline at end of file diff --git a/Assets/Plugins/AllIn1SpriteShader/Shaders/LitShaders/AllIn1SpriteShaderLit_BetterShader.surfshader.meta b/Assets/Plugins/AllIn1SpriteShader/Shaders/LitShaders/AllIn1SpriteShaderLit_BetterShader.surfshader.meta new file mode 100644 index 000000000..3ec2c6d08 --- /dev/null +++ b/Assets/Plugins/AllIn1SpriteShader/Shaders/LitShaders/AllIn1SpriteShaderLit_BetterShader.surfshader.meta @@ -0,0 +1,17 @@ +fileFormatVersion: 2 +guid: 325f1e8448719734a8a423b1dec4f03a +ScriptedImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 2 + userData: + assetBundleName: + assetBundleVariant: + script: {fileID: 11500000, guid: ed1b96e11e9064957833ce8c01da6f92, type: 3} +AssetOrigin: + serializedVersion: 1 + productId: 156513 + packageName: All In 1 Sprite Shader + packageVersion: 4.25 + assetPath: Assets/Plugins/AllIn1SpriteShader/Shaders/LitShaders/AllIn1SpriteShaderLit_BetterShader.surfshader + uploadId: 708810 diff --git a/Assets/Plugins/AllIn1SpriteShader/Shaders/LitShaders/AllIn1SpriteShaderLit_BetterShader_HDRP2019.txt b/Assets/Plugins/AllIn1SpriteShader/Shaders/LitShaders/AllIn1SpriteShaderLit_BetterShader_HDRP2019.txt new file mode 100644 index 000000000..0529507e5 --- /dev/null +++ b/Assets/Plugins/AllIn1SpriteShader/Shaders/LitShaders/AllIn1SpriteShaderLit_BetterShader_HDRP2019.txt @@ -0,0 +1,16835 @@ +//////////////////////////////////////// +// Generated with Better Shaders +// +// Auto-generated shader code, don't hand edit! +// +// Unity Version: 2019.4.16f1 +// Render Pipeline: HDRP2019 +// Platform: WindowsEditor +//////////////////////////////////////// + + +Shader "AllIn1SpriteShader/AllIn1SpriteShaderLit_BetterShader" +{ + Properties + { + + _MainTex ("Main Texture", 2D) = "white" {} //0 + _Color("Main Color", Color) = (1,1,1,1) //1 + _Alpha("General Alpha", Range(0,1)) = 1 //2 + + _GlowColor("Glow Color", Color) = (1,1,1,1) //3 + _Glow("Glow Color Intensity", Range(0,100)) = 10 //4 + _GlowGlobal("Global Glow Intensity", Range(1,100)) = 1 //5 + [NoScaleOffset] _GlowTex("Glow Texture", 2D) = "white" {} //6 + + _FadeTex("Fade Texture", 2D) = "white" {} //7 + _FadeAmount("Fade Amount", Range(-0.1,1)) = -0.1 //8 + _FadeBurnWidth("Fade Burn Width", Range(0,1)) = 0.025 //9 + _FadeBurnTransition("Burn Transition", Range(0.01,0.5)) = 0.075 //10 + _FadeBurnColor("Fade Burn Color", Color) = (1,1,0,1) //11 + _FadeBurnTex("Fade Burn Texture", 2D) = "white" {} //12 + _FadeBurnGlow("Fade Burn Glow", Range(1,250)) = 2//13 + + _OutlineColor("Outline Base Color", Color) = (1,1,1,1) //14 + _OutlineAlpha("Outline Base Alpha", Range(0,1)) = 1 //15 + _OutlineGlow("Outline Base Glow", Range(1,100)) = 1.5 //16 + _OutlineWidth("Outline Base Width", Range(0,0.2)) = 0.004 //17 + _OutlinePixelWidth("Outline Base Pixel Width", Int) = 1 //18 + + [Space] + _OutlineTex("Outline Texture", 2D) = "white" {} //19 + _OutlineTexXSpeed("Texture scroll speed X", Range(-50,50)) = 10 //20 + _OutlineTexYSpeed("Texture scroll speed Y", Range(-50,50)) = 0 //21 + + [Space] + _OutlineDistortTex("Outline Distortion Texture", 2D) = "white" {} //22 + _OutlineDistortAmount("Outline Distortion Amount", Range(0,2)) = 0.5 //23 + _OutlineDistortTexXSpeed("Distortion scroll speed X", Range(-50,50)) = 5 //24 + _OutlineDistortTexYSpeed("Distortion scroll speed Y", Range(-50,50)) = 5 //25 + + _AlphaOutlineColor("Color", Color) = (1, 1, 1, 1) //26 + _AlphaOutlineGlow("Outline Glow", Range(1,100)) = 5 //27 + _AlphaOutlinePower("Power", Range(0, 5)) = 1 // 28 + _AlphaOutlineMinAlpha("Min Alpha", Range(0, 1)) = 0 // 29 + _AlphaOutlineBlend("Blend", Range(0, 1)) = 1 // 30 + + _GradBlend("Gradient Blend", Range(0,1)) = 1 //31 + _GradTopLeftCol("Top Color", Color) = (1,0,0,1) //32 + _GradTopRightCol("Top Color 2", Color) = (1, 1, 0, 1) //33 + _GradBotLeftCol("Bot Color", Color) = (0,0,1,1) //34 + _GradBotRightCol("Bot Color 2", Color) = (0, 1, 0, 1) //35 + + [NoScaleOffset] _ColorSwapTex("Color Swap Texture", 2D) = "black" {} //36 + [HDR] _ColorSwapRed("Red Channel", Color) = (1,1,1,1) //37 + _ColorSwapRedLuminosity("Red luminosity", Range(-1,1)) = 0.5 //38 + [HDR] _ColorSwapGreen("Green Channel", Color) = (1,1,1,1) //39 + _ColorSwapGreenLuminosity("Green luminosity", Range(-1,1)) = 0.5 //40 + [HDR] _ColorSwapBlue("Blue Channel", Color) = (1,1,1,1) //41 + _ColorSwapBlueLuminosity("Blue luminosity", Range(-1,1)) = 0.5 //42 + + _HsvShift("Hue Shift", Range(0, 360)) = 180 //43 + _HsvSaturation("Saturation", Range(0, 2)) = 1 //44 + _HsvBright("Brightness", Range(0, 2)) = 1 //45 + + _HitEffectColor("Hit Effect Color", Color) = (1,1,1,1) //46 + _HitEffectGlow("Glow Intensity", Range(1,100)) = 5 //47 + [Space] + _HitEffectBlend("Hit Effect Blend", Range(0,1)) = 1 //48 + + _NegativeAmount("Negative Amount", Range(0, 1)) = 1 //49 + + _PixelateSize("Pixelate size", Range(4,512)) = 32 //50 + + [NoScaleOffset] _ColorRampTex("Color ramp Texture", 2D) = "white" {} //51 + _ColorRampLuminosity("Color ramp luminosity", Range(-1,1)) = 0 //52 + [Toggle()] _ColorRampOutline("Affects everything?", float) = 0 //53 + + _GreyscaleLuminosity("Greyscale luminosity", Range(-1,1)) = 0 //54 + [Toggle()] _GreyscaleOutline("Affects everything?", float) = 0 //55 + _GreyscaleTintColor("Greyscale Tint Color", Color) = (1,1,1,1) //56 + + _PosterizeNumColors("Number of Colors", Range(0,100)) = 8 //57 + _PosterizeGamma("Posterize Amount", Range(0.1,10)) = 0.75 //58 + [Toggle()] _PosterizeOutline("Affects everything?", float) = 0 //59 + + _BlurIntensity("Blur Intensity", Range(0,100)) = 10 //60 + [Toggle()] _BlurHD("Blur is Low Res?", float) = 0 //61 + + _MotionBlurAngle("Motion Blur Angle", Range(-1, 1)) = 0.1 //62 + _MotionBlurDist("Motion Blur Distance", Range(-3, 3)) = 1.25 //63 + + _GhostColorBoost("Ghost Color Boost", Range(0,5)) = 1 //64 + _GhostTransparency("Ghost Transparency", Range(0,1)) = 0 //65 + + _InnerOutlineColor("Inner Outline Color", Color) = (1,0,0,1) //66 + _InnerOutlineThickness("Outline Thickness", Range(0,3)) = 1 //67 + _InnerOutlineAlpha("Inner Outline Alpha", Range(0,1)) = 1 //68 + _InnerOutlineGlow("Inner Outline Glow", Range(1,250)) = 4 //69 + + _AlphaCutoffValue("Alpha cutoff value", Range(0, 1)) = 0.25 //70 + + [Toggle()] _OnlyOutline("Only render outline?", float) = 0 //71 + [Toggle()] _OnlyInnerOutline("Only render inner outline?", float) = 0 //72 + + _HologramStripesAmount("Stripes Amount", Range(0, 1)) = 0.1 //73 + _HologramUnmodAmount("Unchanged Amount", Range(0, 1)) = 0.0 //74 + _HologramStripesSpeed("Stripes Speed", Range(-20, 20)) = 4.5 //75 + _HologramMinAlpha("Min Alpha", Range(0, 1)) = 0.1 //76 + _HologramMaxAlpha("Max Alpha", Range(0, 100)) = 0.75 //77 + + _ChromAberrAmount("ChromAberr Amount", Range(0, 1)) = 1 //78 + _ChromAberrAlpha("ChromAberr Alpha", Range(0, 1)) = 0.4 //79 + + _GlitchAmount("Glitch Amount", Range(0, 20)) = 3 //80 + + _FlickerPercent("Flicker Percent", Range(0, 1)) = 0.05 //81 + _FlickerFreq("Flicker Frequency", Range(0, 5)) = 0.2 //82 + _FlickerAlpha("Flicker Alpha", Range(0, 1)) = 0 //83 + + _ShadowX("Shadow X Axis", Range(-0.5, 0.5)) = 0.1 //84 + _ShadowY("Shadow Y Axis", Range(-0.5, 0.5)) = -0.05 //85 + _ShadowAlpha("Shadow Alpha", Range(0, 1)) = 0.5 //86 + _ShadowColor("Shadow Color", Color) = (0, 0, 0, 1) //87 + + _HandDrawnAmount("Hand Drawn Amount", Range(0, 20)) = 10 //88 + _HandDrawnSpeed("Hand Drawn Speed", Range(1, 15)) = 5 //89 + + _GrassSpeed("Speed", Range(0,50)) = 2 //90 + _GrassWind("Bend amount", Range(0,50)) = 20 //91 + [Space] + [Toggle()] _GrassManualToggle("Manually animated?", float) = 0 //92 + _GrassManualAnim("Manual Anim Value", Range(-1,1)) = 1 //93 + + _WaveAmount("Wave Amount", Range(0, 25)) = 7 //94 + _WaveSpeed("Wave Speed", Range(0, 25)) = 10 //95 + _WaveStrength("Wave Strength", Range(0, 25)) = 7.5 //96 + _WaveX("Wave X Axis", Range(0, 1)) = 0 //97 + _WaveY("Wave Y Axis", Range(0, 1)) = 0.5 //98 + + _RectSize("Rect Size", Range(1, 4)) = 1 //99 + + _OffsetUvX("X axis", Range(-1, 1)) = 0 //100 + _OffsetUvY("Y axis", Range(-1, 1)) = 0 //101 + + _ClipUvLeft("Clipping Left", Range(0, 1)) = 0 //102 + _ClipUvRight("Clipping Right", Range(0, 1)) = 0 //103 + _ClipUvUp("Clipping Up", Range(0, 1)) = 0 //104 + _ClipUvDown("Clipping Down", Range(0, 1)) = 0 //105 + + _TextureScrollXSpeed("Speed X Axis", Range(-5, 5)) = 1 //106 + _TextureScrollYSpeed("Speed Y Axis", Range(-5, 5)) = 0 //107 + + _ZoomUvAmount("Zoom Amount", Range(0.1, 5)) = 0.5 //108 + + _DistortTex("Distortion Texture", 2D) = "white" {} //109 + _DistortAmount("Distortion Amount", Range(0,2)) = 0.5 //110 + _DistortTexXSpeed("Scroll speed X", Range(-50,50)) = 5 //111 + _DistortTexYSpeed("Scroll speed Y", Range(-50,50)) = 5 //112 + + _TwistUvAmount("Twist Amount", Range(0, 3.1416)) = 1 //113 + _TwistUvPosX("Twist Pos X Axis", Range(0, 1)) = 0.5 //114 + _TwistUvPosY("Twist Pos Y Axis", Range(0, 1)) = 0.5 //115 + _TwistUvRadius("Twist Radius", Range(0, 3)) = 0.75 //116 + + _RotateUvAmount("Rotate Angle(radians)", Range(0, 6.2831)) = 0 //117 + + _FishEyeUvAmount("Fish Eye Amount", Range(0, 0.5)) = 0.35 //118 + + _PinchUvAmount("Pinch Amount", Range(0, 0.5)) = 0.35 //119 + + _ShakeUvSpeed("Shake Speed", Range(0, 20)) = 2.5 //120 + _ShakeUvX("X Multiplier", Range(0, 5)) = 1.5 //121 + _ShakeUvY("Y Multiplier", Range(0, 5)) = 1 //122 + + _ColorChangeTolerance("Tolerance", Range(0, 1)) = 0.25 //123 + _ColorChangeTarget("Color to change", Color) = (1, 0, 0, 1) //124 + [HDR] _ColorChangeNewCol("New Color", Color) = (1, 1, 0, 1) //125 + _ColorChangeLuminosity("New Color Luminosity", Range(0, 1)) = 0.0 //126 + + _RoundWaveStrength("Wave Strength", Range(0, 1)) = 0.7 //127 + _RoundWaveSpeed("Wave Speed", Range(0, 5)) = 2 //128 + + [Toggle()] _BillboardY("Billboard on both axis?", float) = 0 //129 + _ZWrite ("Depth Write", Float) = 1.0 // 130 + + _MySrcMode ("SrcMode", Float) = 5 // 131 + _MyDstMode ("DstMode", Float) = 10 // 132 + + _ShineColor("Shine Color", Color) = (1,1,1,1) // 133 + _ShineLocation("Shine Location", Range(0,1)) = 0.5 // 134 + _ShineRotate("Rotate Angle(radians)", Range(0, 6.2831)) = 0 //135 + _ShineWidth("Shine Width", Range(0.05,1)) = 0.1 // 136 + _ShineGlow("Shine Glow", Range(0,100)) = 1 // 137 + [NoScaleOffset] _ShineMask("Shine Mask", 2D) = "white" {} // 138 + + _GlitchSize("Glitch Size", Range(0.25, 5)) = 1 //139 + _HologramStripeColor("Stripes Color", Color) = (0,1,1,1) //140 + _GradBoostX("Boost X axis", Range(0.1, 5)) = 1.2 //141 + _GradBoostY("Boost Y axis", Range(0.1, 5)) = 1.2 //142 + [Toggle()] _GradIsRadial("Radial Gradient?", float) = 0 //143 + _AlphaRoundThreshold("Round Threshold", Range(0.005, 1.0)) = 0.5 //144 + _GrassRadialBend("Radial Bend", Range(0.0, 5.0)) = 0.1 //145 + + _ColorChangeTolerance2("Tolerance 2", Range(0, 1)) = 0.25 //146 + _ColorChangeTarget2("Color to change 2", Color) = (1, 0, 0, 1) //147 + [HDR] _ColorChangeNewCol2("New Color 2", Color) = (1, 1, 0, 1) //148 + _ColorChangeTolerance3("Tolerance 3", Range(0, 1)) = 0.25 //149 + _ColorChangeTarget3("Color to change 3", Color) = (1, 0, 0, 1) //150 + [HDR] _ColorChangeNewCol3("New Color 3", Color) = (1, 1, 0, 1) //151 + + _Contrast ("Contrast", Range(0, 6)) = 1 // 152 + _Brightness ("Brightness", Range(-1, 1)) = 0 // 153 + + _ColorSwapBlend ("Color Swap Blend", Range(0, 1)) = 1 // 154 + _ColorRampBlend ("Color Ramp Blend", Range(0, 1)) = 1 // 155 + _GreyscaleBlend ("Greyscale Blend", Range(0, 1)) = 1 // 156 + _GhostBlend ("Ghost Blend", Range(0, 1)) = 1 // 157 + _HologramBlend ("Hologram Blend", Range(0, 1)) = 1 // 158 + + [AllIn1ShaderGradient] _ColorRampTexGradient("Color ramp Gradient", 2D) = "white" {} //159 + + _OverlayTex("Overlay Texture", 2D) = "white" {} //160 + _OverlayColor("Overlay Color", Color) = (1, 1, 1, 1) //161 + _OverlayGlow("Overlay Glow", Range(0,25)) = 1 // 162 + _OverlayBlend("Overlay Blend", Range(0, 1)) = 1 // 163 + + _RadialStartAngle("Radial Start Angle", Range(0, 360)) = 90 //164 + _RadialClip("Radial Clip", Range(0, 360)) = 45 //165 + _RadialClip2("Radial Clip 2", Range(0, 360)) = 0 //166 + + _WarpStrength("Warp Strength", Range(0, 0.1)) = 0.025 //167 + _WarpSpeed("Warp Speed", Range(0, 25)) = 8 //168 + _WarpScale("Warp Scale", Range(0.05, 3)) = 0.5 //169 + + _OverlayTextureScrollXSpeed("Speed X Axis", Range(-5, 5)) = 0.25 //170 + _OverlayTextureScrollYSpeed("Speed Y Axis", Range(-5, 5)) = 0.25 //171 + + _ZTestMode ("Z Test Mode", Float) = 4 + _CullingOption ("Culling Option", float) = 0 + + [HideInInspector] _MinXUV("_MinXUV", Range(0, 1)) = 0.0 + [HideInInspector] _MaxXUV("_MaxXUV", Range(0, 1)) = 1.0 + [HideInInspector] _MinYUV("_MinYUV", Range(0, 1)) = 0.0 + [HideInInspector] _MaxYUV("_MaxYUV", Range(0, 1)) = 1.0 + [HideInInspector] _RandomSeed("_MaxYUV", Range(0, 10000)) = 0.0 + _EditorDrawers("Editor Drawers", Int) = 6 + + [Normal][NoScaleOffset] _NormalMap("Normal Map", 2D) = "bump" {} + _NormalStrength("Normal Strength", Range(0, 15)) = 1.0 + + + + [HideInInspector] _StencilRef("Vector1 ", Int) = 0 + [HideInInspector] _StencilWriteMask("Vector1 ", Int) = 3 + [HideInInspector] _StencilRefDepth("Vector1 ", Int) = 0 + [HideInInspector] _StencilWriteMaskDepth("Vector1 ", Int) = 32 + [HideInInspector] _StencilRefMV("Vector1 ", Int) = 128 + [HideInInspector] _StencilWriteMaskMV("Vector1 ", Int) = 128 + [HideInInspector] _StencilRefDistortionVec("Vector1 ", Int) = 64 + [HideInInspector] _StencilWriteMaskDistortionVec("Vector1 ", Int) = 64 + [HideInInspector] _StencilWriteMaskGBuffer("Vector1 ", Int) = 3 + [HideInInspector] _StencilRefGBuffer("Vector1 ", Int) = 2 + [HideInInspector] _ZTestGBuffer("Vector1 ", Int) = 4 + [HideInInspector] [ToggleUI] _RequireSplitLighting("Boolean", Float) = 0 + [HideInInspector] [ToggleUI] _ReceivesSSR("Boolean", Float) = 1 + [HideInInspector] _SurfaceType("Vector1 ", Float) = 0 + [HideInInspector] [ToggleUI] _ZWrite("Boolean", Float) = 0 + [HideInInspector] _TransparentSortPriority("Vector1 ", Int) = 0 + [HideInInspector] _ZTestDepthEqualForOpaque("Vector1 ", Int) = 4 + [HideInInspector] [Enum(UnityEngine.Rendering.CompareFunction)] _ZTestTransparent("Vector1", Float) = 4 + [HideInInspector] [ToggleUI] _TransparentBackfaceEnable("Boolean", Float) = 0 + [HideInInspector] [ToggleUI] _AlphaCutoffEnable("Boolean", Float) = 0 + [HideInInspector] [ToggleUI] _UseShadowThreshold("Boolean", Float) = 0 + [HideInInspector] _BlendMode("Float", Float) = 0 + } + SubShader + { + Tags { "RenderPipeline"="HDRenderPipeline" "RenderPipeline" = "HDRenderPipeline" "RenderType" = "HDLitShader" "Queue" = "Geometry+225" } + + + Pass + { + // based on HDLitPass.template + Name "Forward" + Tags { "LightMode" = "Forward" } + + + + + + // Stencil setup + Stencil + { + WriteMask [_StencilWriteMask] + Ref [_StencilRef] + Comp Always + Pass Replace + } + + ColorMask [_ColorMaskTransparentVel] 1 + + Tags { "RenderType" = "Opaque" "Queue" = "Geometry" "PreviewType" = "Plane" } + Cull [_CullingOption] + ZWrite [_ZWrite] + ZTest [_ZTestMode] + + + //------------------------------------------------------------------------------------- + // End Render Modes + //------------------------------------------------------------------------------------- + + HLSLPROGRAM + + #pragma target 4.5 + #pragma only_renderers d3d11 ps4 xboxone vulkan metal switch + //#pragma enable_d3d11_debug_symbols + + #pragma multi_compile_instancing + + //#pragma multi_compile_local _ _ALPHATEST_ON + + // #pragma multi_compile _ LOD_FADE_CROSSFADE + + //#pragma shader_feature _SURFACE_TYPE_TRANSPARENT + //#pragma shader_feature_local _BLENDMODE_OFF _BLENDMODE_ALPHA _BLENDMODE_ADDITIVE _BLENDMODE_PRE_MULTIPLY + + //------------------------------------------------------------------------------------- + // Variant Definitions (active field translations to HDRP defines) + //------------------------------------------------------------------------------------- + // #define _MATERIAL_FEATURE_SUBSURFACE_SCATTERING 1 + // #define _MATERIAL_FEATURE_TRANSMISSION 1 + // #define _MATERIAL_FEATURE_ANISOTROPY 1 + // #define _MATERIAL_FEATURE_IRIDESCENCE 1 + // #define _MATERIAL_FEATURE_SPECULAR_COLOR 1 + #define _ENABLE_FOG_ON_TRANSPARENT 1 + // #define _AMBIENT_OCCLUSION 1 + // #define _SPECULAR_OCCLUSION_FROM_AO 1 + // #define _SPECULAR_OCCLUSION_FROM_AO_BENT_NORMAL 1 + // #define _SPECULAR_OCCLUSION_CUSTOM 1 + // #define _ENERGY_CONSERVING_SPECULAR 1 + // #define _ENABLE_GEOMETRIC_SPECULAR_AA 1 + // #define _HAS_REFRACTION 1 + // #define _REFRACTION_PLANE 1 + // #define _REFRACTION_SPHERE 1 + // #define _DISABLE_DECALS 1 + // #define _DISABLE_SSR 1 + // #define _ADD_PRECOMPUTED_VELOCITY + // #define _WRITE_TRANSPARENT_MOTION_VECTOR 1 + // #define _DEPTHOFFSET_ON 1 + // #define _BLENDMODE_PRESERVE_SPECULAR_LIGHTING 1 + + #define SHADERPASS SHADERPASS_FORWARD + #define _PASSFORWARD 1 + + + #pragma shader_feature_local GLOW_ON + #pragma shader_feature_local FADE_ON + #pragma shader_feature_local OUTBASE_ON + #pragma shader_feature_local ONLYOUTLINE_ON + #pragma shader_feature_local GRADIENT_ON + #pragma shader_feature_local GRADIENT2COL_ON + #pragma shader_feature_local RADIALGRADIENT_ON + #pragma shader_feature_local COLORSWAP_ON + #pragma shader_feature_local HSV_ON + #pragma shader_feature_local CHANGECOLOR_ON + #pragma shader_feature_local CHANGECOLOR2_ON + #pragma shader_feature_local CHANGECOLOR3_ON + #pragma shader_feature_local COLORRAMP_ON + #pragma shader_feature_local GRADIENTCOLORRAMP_ON + #pragma shader_feature_local HITEFFECT_ON + #pragma shader_feature_local NEGATIVE_ON + #pragma shader_feature_local PIXELATE_ON + #pragma shader_feature_local GREYSCALE_ON + #pragma shader_feature_local POSTERIZE_ON + #pragma shader_feature_local BLUR_ON + #pragma shader_feature_local MOTIONBLUR_ON + #pragma shader_feature_local GHOST_ON + #pragma shader_feature_local ALPHAOUTLINE_ON + #pragma shader_feature_local INNEROUTLINE_ON + #pragma shader_feature_local ONLYINNEROUTLINE_ON + #pragma shader_feature_local HOLOGRAM_ON + #pragma shader_feature_local CHROMABERR_ON + #pragma shader_feature_local GLITCH_ON + #pragma shader_feature_local FLICKER_ON + #pragma shader_feature_local SHADOW_ON + #pragma shader_feature_local SHINE_ON + #pragma shader_feature_local CONTRAST_ON + #pragma shader_feature_local OVERLAY_ON + #pragma shader_feature_local OVERLAYMULT_ON + #pragma shader_feature_local DOODLE_ON + #pragma shader_feature_local WIND_ON + #pragma shader_feature_local WAVEUV_ON + #pragma shader_feature_local ROUNDWAVEUV_ON + #pragma shader_feature_local RECTSIZE_ON + #pragma shader_feature_local OFFSETUV_ON + #pragma shader_feature_local CLIPPING_ON + #pragma shader_feature_local RADIALCLIPPING_ON + #pragma shader_feature_local TEXTURESCROLL_ON + #pragma shader_feature_local ZOOMUV_ON + #pragma shader_feature_local DISTORT_ON + #pragma shader_feature_local WARP_ON + #pragma shader_feature_local TWISTUV_ON + #pragma shader_feature_local ROTATEUV_ON + #pragma shader_feature_local POLARUV_ON + #pragma shader_feature_local FISHEYE_ON + #pragma shader_feature_local PINCH_ON + #pragma shader_feature_local SHAKEUV_ON + + #pragma shader_feature_local GLOWTEX_ON + #pragma shader_feature_local OUTTEX_ON + #pragma shader_feature_local OUTDIST_ON + #pragma shader_feature_local OUTBASE8DIR_ON + #pragma shader_feature_local OUTBASEPIXELPERF_ON + #pragma shader_feature_local COLORRAMPOUTLINE_ON + #pragma shader_feature_local GREYSCALEOUTLINE_ON + #pragma shader_feature_local POSTERIZEOUTLINE_ON + #pragma shader_feature_local BLURISHD_ON + #pragma shader_feature_local MANUALWIND_ON + #pragma shader_feature_local ATLAS_ON + #pragma shader_feature_local PREMULTIPLYALPHA_ON + + #pragma shader_feature BILBOARD_ON + #pragma shader_feature BILBOARDY_ON + + #pragma shader_feature NORMALMAP_ON + + + #define _HDRP 1 +#define _USINGTEXCOORD1 1 +#define _USINGTEXCOORD2 1 + + + #pragma vertex Vert + #pragma fragment Frag + + + #pragma multi_compile _ DEBUG_DISPLAY + #pragma multi_compile _ LIGHTMAP_ON + #pragma multi_compile _ DIRLIGHTMAP_COMBINED + #pragma multi_compile _ DYNAMICLIGHTMAP_ON + #pragma multi_compile _ SHADOWS_SHADOWMASK + #pragma multi_compile DECALS_OFF DECALS_3RT DECALS_4RT + #pragma multi_compile USE_FPTL_LIGHTLIST USE_CLUSTERED_LIGHTLIST + #pragma multi_compile SHADOW_LOW SHADOW_MEDIUM SHADOW_HIGH + #define REQUIRE_DEPTH_TEXTURE + + + + // useful conversion functions to make surface shader code just work + + #define UNITY_DECLARE_TEX2D(name) TEXTURE2D(name); SAMPLER(sampler##name); + #define UNITY_DECLARE_TEX2D_NOSAMPLER(name) TEXTURE2D(name); + #define UNITY_DECLARE_TEX2DARRAY(name) TEXTURE2D_ARRAY(name); SAMPLER(sampler##name); + #define UNITY_DECLARE_TEX2DARRAY_NOSAMPLER(tex) TEXTURE2D_ARRAY(tex); + + #define UNITY_SAMPLE_TEX2DARRAY(tex,coord) SAMPLE_TEXTURE2D_ARRAY(tex, sampler##tex, coord.xy, coord.z) + #define UNITY_SAMPLE_TEX2DARRAY_LOD(tex,coord,lod) SAMPLE_TEXTURE2D_ARRAY_LOD(tex, sampler##tex, coord.xy, coord.z, lod) + #define UNITY_SAMPLE_TEX2D(tex, coord) SAMPLE_TEXTURE2D(tex, sampler##tex, coord) + #define UNITY_SAMPLE_TEX2D_SAMPLER(tex, samp, coord) SAMPLE_TEXTURE2D(tex, sampler##samp, coord) + + #define UNITY_SAMPLE_TEX2D_LOD(tex,coord, lod) SAMPLE_TEXTURE2D_LOD(tex, sampler_##tex, coord, lod) + #define UNITY_SAMPLE_TEX2D_SAMPLER_LOD(tex,samplertex,coord, lod) SAMPLE_TEXTURE2D_LOD (tex, sampler##samplertex,coord, lod) + + #if defined(UNITY_COMPILER_HLSL) + #define UNITY_INITIALIZE_OUTPUT(type,name) name = (type)0; + #else + #define UNITY_INITIALIZE_OUTPUT(type,name) + #endif + + #define sampler2D_float sampler2D + #define sampler2D_half sampler2D + + #undef WorldNormalVector + #define WorldNormalVector(data, normal) mul(normal, data.TBNMatrix) + + #define UnityObjectToWorldNormal(normal) mul(GetObjectToWorldMatrix(), normal) + + + + +// HDRP Adapter stuff + + + // If we use subsurface scattering, enable output split lighting (for forward pass) + #if defined(_MATERIAL_FEATURE_SUBSURFACE_SCATTERING) && !defined(_SURFACE_TYPE_TRANSPARENT) + #define OUTPUT_SPLIT_LIGHTING + #endif + + #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Version.hlsl" + #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Common.hlsl" + + #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/NormalSurfaceGradient.hlsl" + + // define FragInputs structure + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/ShaderPass/FragInputs.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/ShaderPass/ShaderPass.cs.hlsl" + #if (SHADER_LIBRARY_VERSION_MAJOR >= 10) + #include "Packages/com.unity.shadergraph/ShaderGraphLibrary/Functions.hlsl" + #endif + + + + + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/ShaderVariables.hlsl" + #ifdef DEBUG_DISPLAY + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Debug/DebugDisplay.hlsl" + #endif + + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/Material.hlsl" + + #if (SHADERPASS == SHADERPASS_FORWARD) + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Lighting/Lighting.hlsl" + + #define HAS_LIGHTLOOP + + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Lighting/LightLoop/LightLoopDef.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/Lit/Lit.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Lighting/LightLoop/LightLoop.hlsl" + #else + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/Lit/Lit.hlsl" + #endif + + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/BuiltinUtilities.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/MaterialUtilities.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/Decal/DecalUtilities.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/Lit/LitDecalData.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/ShaderGraphFunctions.hlsl" + + // Used by SceneSelectionPass + int _ObjectId; + int _PassValue; + + + // data across stages, stripped like the above. + struct VertexToPixel + { + float4 pos : SV_POSITION; + float3 worldPos : TEXCOORD0; + float3 worldNormal : TEXCOORD1; + float4 worldTangent : TEXCOORD2; + float4 texcoord0 : TEXCOORD3; + float4 texcoord1 : TEXCOORD4; + float4 texcoord2 : TEXCOORD5; + + // #if %TEXCOORD3REQUIREKEY% + float4 texcoord3 : TEXCOORD6; + // #endif + + // #if %SCREENPOSREQUIREKEY% + // float4 screenPos : TEXCOORD7; + // #endif + + // #if %VERTEXCOLORREQUIREKEY% + float4 vertexColor : COLOR; + // #endif + + // #if %EXTRAV2F0REQUIREKEY% + // float4 extraV2F0 : TEXCOORD8; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // float4 extraV2F1 : TEXCOORD9; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // float4 extraV2F2 : TEXCOORD10; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // float4 extraV2F3 : TEXCOORD11; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // float4 extraV2F4 : TEXCOORD12; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // float4 extraV2F5 : TEXCOORD13; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // float4 extraV2F6 : TEXCOORD14; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // float4 extraV2F7 : TEXCOORD15; + // #endif + + #if UNITY_ANY_INSTANCING_ENABLED + UNITY_VERTEX_INPUT_INSTANCE_ID + #endif // UNITY_ANY_INSTANCING_ENABLED + + UNITY_VERTEX_OUTPUT_STEREO + }; + + + + + + // data describing the user output of a pixel + struct Surface + { + half3 Albedo; + half Height; + half3 Normal; + half Smoothness; + half3 Emission; + half Metallic; + half3 Specular; + half Occlusion; + half SpecularPower; // for simple lighting + half Alpha; + float outputDepth; // if written, SV_Depth semantic is used. ShaderData.clipPos.z is unused value + // HDRP Only + half SpecularOcclusion; + half SubsurfaceMask; + half Thickness; + half CoatMask; + half CoatSmoothness; + half Anisotropy; + half IridescenceMask; + half IridescenceThickness; + int DiffusionProfileHash; + float SpecularAAThreshold; + float SpecularAAScreenSpaceVariance; + // requires _OVERRIDE_BAKEDGI to be defined, but is mapped in all pipelines + float3 DiffuseGI; + float3 BackDiffuseGI; + float3 SpecularGI; + float ior; + float3 transmittanceColor; + float atDistance; + float transmittanceMask; + // requires _OVERRIDE_SHADOWMASK to be defines + float4 ShadowMask; + + // for decals + float NormalAlpha; + float MAOSAlpha; + + + }; + + // Data the user declares in blackboard blocks + struct Blackboard + { + + float blackboardDummyData; + }; + + // data the user might need, this will grow to be big. But easy to strip + struct ShaderData + { + float4 clipPos; // SV_POSITION + float3 localSpacePosition; + float3 localSpaceNormal; + float3 localSpaceTangent; + + float3 worldSpacePosition; + float3 worldSpaceNormal; + float3 worldSpaceTangent; + float tangentSign; + + float3 worldSpaceViewDir; + float3 tangentSpaceViewDir; + + float4 texcoord0; + float4 texcoord1; + float4 texcoord2; + float4 texcoord3; + + float2 screenUV; + float4 screenPos; + + float4 vertexColor; + bool isFrontFace; + + float4 extraV2F0; + float4 extraV2F1; + float4 extraV2F2; + float4 extraV2F3; + float4 extraV2F4; + float4 extraV2F5; + float4 extraV2F6; + float4 extraV2F7; + + float3x3 TBNMatrix; + Blackboard blackboard; + }; + + struct VertexData + { + #if SHADER_TARGET > 30 + // uint vertexID : SV_VertexID; + #endif + float4 vertex : POSITION; + float3 normal : NORMAL; + float4 tangent : TANGENT; + float4 texcoord0 : TEXCOORD0; + + // optimize out mesh coords when not in use by user or lighting system + #if _URP && (_USINGTEXCOORD1 || _PASSMETA || _PASSFORWARD || _PASSGBUFFER) + float4 texcoord1 : TEXCOORD1; + #endif + + #if _URP && (_USINGTEXCOORD2 || _PASSMETA || ((_PASSFORWARD || _PASSGBUFFER) && defined(DYNAMICLIGHTMAP_ON))) + float4 texcoord2 : TEXCOORD2; + #endif + + #if _STANDARD && (_USINGTEXCOORD1 || (_PASSMETA || ((_PASSFORWARD || _PASSGBUFFER || _PASSFORWARDADD) && LIGHTMAP_ON))) + float4 texcoord1 : TEXCOORD1; + #endif + #if _STANDARD && (_USINGTEXCOORD2 || (_PASSMETA || ((_PASSFORWARD || _PASSGBUFFER) && DYNAMICLIGHTMAP_ON))) + float4 texcoord2 : TEXCOORD2; + #endif + + + #if _HDRP + float4 texcoord1 : TEXCOORD1; + float4 texcoord2 : TEXCOORD2; + #endif + + // #if %TEXCOORD3REQUIREKEY% + float4 texcoord3 : TEXCOORD3; + // #endif + + // #if %VERTEXCOLORREQUIREKEY% + float4 vertexColor : COLOR; + // #endif + + #if _PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR)) + float3 previousPositionOS : TEXCOORD4; // Contain previous transform position (in case of skinning for example) + #if defined (_ADD_PRECOMPUTED_VELOCITY) + float3 precomputedVelocity : TEXCOORD5; // Add Precomputed Velocity (Alembic computes velocities on runtime side). + #endif + #endif + + UNITY_VERTEX_INPUT_INSTANCE_ID + }; + + struct TessVertex + { + float4 vertex : INTERNALTESSPOS; + float3 normal : NORMAL; + float4 tangent : TANGENT; + float4 texcoord0 : TEXCOORD0; + float4 texcoord1 : TEXCOORD1; + float4 texcoord2 : TEXCOORD2; + + // #if %TEXCOORD3REQUIREKEY% + float4 texcoord3 : TEXCOORD3; + // #endif + + // #if %VERTEXCOLORREQUIREKEY% + float4 vertexColor : COLOR; + // #endif + + // #if %EXTRAV2F0REQUIREKEY% + // float4 extraV2F0 : TEXCOORD5; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // float4 extraV2F1 : TEXCOORD6; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // float4 extraV2F2 : TEXCOORD7; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // float4 extraV2F3 : TEXCOORD8; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // float4 extraV2F4 : TEXCOORD9; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // float4 extraV2F5 : TEXCOORD10; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // float4 extraV2F6 : TEXCOORD11; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // float4 extraV2F7 : TEXCOORD12; + // #endif + + #if _PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR)) + float3 previousPositionOS : TEXCOORD13; // Contain previous transform position (in case of skinning for example) + #if defined (_ADD_PRECOMPUTED_VELOCITY) + float3 precomputedVelocity : TEXCOORD14; + #endif + #endif + + UNITY_VERTEX_INPUT_INSTANCE_ID + UNITY_VERTEX_OUTPUT_STEREO + }; + + struct ExtraV2F + { + float4 extraV2F0; + float4 extraV2F1; + float4 extraV2F2; + float4 extraV2F3; + float4 extraV2F4; + float4 extraV2F5; + float4 extraV2F6; + float4 extraV2F7; + Blackboard blackboard; + float4 time; + }; + + + float3 WorldToTangentSpace(ShaderData d, float3 normal) + { + return mul(d.TBNMatrix, normal); + } + + float3 TangentToWorldSpace(ShaderData d, float3 normal) + { + return mul(normal, d.TBNMatrix); + } + + // in this case, make standard more like SRPs, because we can't fix + // unity_WorldToObject in HDRP, since it already does macro-fu there + + #if _STANDARD + float3 TransformWorldToObject(float3 p) { return mul(unity_WorldToObject, float4(p, 1)); }; + float3 TransformObjectToWorld(float3 p) { return mul(unity_ObjectToWorld, float4(p, 1)); }; + float4 TransformWorldToObject(float4 p) { return mul(unity_WorldToObject, p); }; + float4 TransformObjectToWorld(float4 p) { return mul(unity_ObjectToWorld, p); }; + float4x4 GetWorldToObjectMatrix() { return unity_WorldToObject; } + float4x4 GetObjectToWorldMatrix() { return unity_ObjectToWorld; } + #if (defined(SHADER_API_D3D11) || defined(SHADER_API_XBOXONE) || defined(UNITY_COMPILER_HLSLCC) || defined(SHADER_API_PSSL) || (SHADER_TARGET_SURFACE_ANALYSIS && !SHADER_TARGET_SURFACE_ANALYSIS_MOJOSHADER)) + #define UNITY_SAMPLE_TEX2D_LOD(tex,coord, lod) tex.SampleLevel (sampler##tex,coord, lod) + #define UNITY_SAMPLE_TEX2D_SAMPLER_LOD(tex,samplertex,coord, lod) tex.SampleLevel (sampler##samplertex,coord, lod) + #else + #define UNITY_SAMPLE_TEX2D_LOD(tex,coord,lod) tex2D (tex,coord,0,lod) + #define UNITY_SAMPLE_TEX2D_SAMPLER_LOD(tex,samplertex,coord,lod) tex2D (tex,coord,0,lod) + #endif + + #undef GetWorldToObjectMatrix() + + #define GetWorldToObjectMatrix() unity_WorldToObject + + + #endif + + float3 GetCameraWorldPosition() + { + #if _HDRP + return GetCameraRelativePositionWS(_WorldSpaceCameraPos); + #else + return _WorldSpaceCameraPos; + #endif + } + + #if _GRABPASSUSED + #if _STANDARD + TEXTURE2D(%GRABTEXTURE%); + SAMPLER(sampler_%GRABTEXTURE%); + #endif + + half3 GetSceneColor(float2 uv) + { + #if _STANDARD + return SAMPLE_TEXTURE2D(%GRABTEXTURE%, sampler_%GRABTEXTURE%, uv).rgb; + #else + return SHADERGRAPH_SAMPLE_SCENE_COLOR(uv); + #endif + } + #endif + + + + #if _STANDARD + UNITY_DECLARE_DEPTH_TEXTURE(_CameraDepthTexture); + float GetSceneDepth(float2 uv) { return SAMPLE_DEPTH_TEXTURE(_CameraDepthTexture, uv); } + float GetLinear01Depth(float2 uv) { return Linear01Depth(GetSceneDepth(uv)); } + float GetLinearEyeDepth(float2 uv) { return LinearEyeDepth(GetSceneDepth(uv)); } + #else + float GetSceneDepth(float2 uv) { return SHADERGRAPH_SAMPLE_SCENE_DEPTH(uv); } + float GetLinear01Depth(float2 uv) { return Linear01Depth(GetSceneDepth(uv), _ZBufferParams); } + float GetLinearEyeDepth(float2 uv) { return LinearEyeDepth(GetSceneDepth(uv), _ZBufferParams); } + #endif + + float3 GetWorldPositionFromDepthBuffer(float2 uv, float3 worldSpaceViewDir) + { + float eye = GetLinearEyeDepth(uv); + float3 camView = mul((float3x3)GetObjectToWorldMatrix(), transpose(mul(GetWorldToObjectMatrix(), UNITY_MATRIX_I_V)) [2].xyz); + + float dt = dot(worldSpaceViewDir, camView); + float3 div = worldSpaceViewDir/dt; + float3 wpos = (eye * div) + GetCameraWorldPosition(); + return wpos; + } + + #if _HDRP + float3 ObjectToWorldSpacePosition(float3 pos) + { + return GetAbsolutePositionWS(TransformObjectToWorld(pos)); + } + #else + float3 ObjectToWorldSpacePosition(float3 pos) + { + return TransformObjectToWorld(pos); + } + #endif + + #if _STANDARD + UNITY_DECLARE_SCREENSPACE_TEXTURE(_CameraDepthNormalsTexture); + float3 GetSceneNormal(float2 uv, float3 worldSpaceViewDir) + { + float4 depthNorms = UNITY_SAMPLE_SCREENSPACE_TEXTURE(_CameraDepthNormalsTexture, uv); + float3 norms = DecodeViewNormalStereo(depthNorms); + norms = mul((float3x3)GetWorldToViewMatrix(), norms) * 0.5 + 0.5; + return norms; + } + #elif _HDRP && !_DECALSHADER + + float3 GetSceneNormal(float2 uv, float3 worldSpaceViewDir) + { + NormalData nd; + DecodeFromNormalBuffer(_ScreenSize.xy * uv, nd); + return nd.normalWS; + } + #elif _URP + #if (SHADER_LIBRARY_VERSION_MAJOR >= 10) + #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/DeclareNormalsTexture.hlsl" + #endif + + float3 GetSceneNormal(float2 uv, float3 worldSpaceViewDir) + { + #if (SHADER_LIBRARY_VERSION_MAJOR >= 10) + return SampleSceneNormals(uv); + #else + float3 wpos = GetWorldPositionFromDepthBuffer(uv, worldSpaceViewDir); + return normalize(-cross(ddx(wpos), ddy(wpos))) * 0.5 + 0.5; + #endif + + } + #endif + + #if _HDRP + + half3 UnpackNormalmapRGorAG(half4 packednormal) + { + // This do the trick + packednormal.x *= packednormal.w; + + half3 normal; + normal.xy = packednormal.xy * 2 - 1; + normal.z = sqrt(1 - saturate(dot(normal.xy, normal.xy))); + return normal; + } + half3 UnpackNormal(half4 packednormal) + { + #if defined(UNITY_NO_DXT5nm) + return packednormal.xyz * 2 - 1; + #else + return UnpackNormalmapRGorAG(packednormal); + #endif + } + #endif + #if _HDRP || _URP + + half3 UnpackScaleNormal(half4 packednormal, half scale) + { + #ifndef UNITY_NO_DXT5nm + // Unpack normal as DXT5nm (1, y, 1, x) or BC5 (x, y, 0, 1) + // Note neutral texture like "bump" is (0, 0, 1, 1) to work with both plain RGB normal and DXT5nm/BC5 + packednormal.x *= packednormal.w; + #endif + half3 normal; + normal.xy = (packednormal.xy * 2 - 1) * scale; + normal.z = sqrt(1 - saturate(dot(normal.xy, normal.xy))); + return normal; + } + + #endif + + + void GetSun(out float3 lightDir, out float3 color) + { + lightDir = float3(0.5, 0.5, 0); + color = 1; + #if _HDRP + if (_DirectionalLightCount > 0) + { + DirectionalLightData light = _DirectionalLightDatas[0]; + lightDir = -light.forward.xyz; + color = light.color; + } + #elif _STANDARD + lightDir = normalize(_WorldSpaceLightPos0.xyz); + color = _LightColor0.rgb; + #elif _URP + Light light = GetMainLight(); + lightDir = light.direction; + color = light.color; + #endif + } + + + + + CBUFFER_START(UnityPerMaterial) + float _StencilRef; + float _StencilWriteMask; + float _StencilRefDepth; + float _StencilWriteMaskDepth; + float _StencilRefMV; + float _StencilWriteMaskMV; + float _StencilRefDistortionVec; + float _StencilWriteMaskDistortionVec; + float _StencilWriteMaskGBuffer; + float _StencilRefGBuffer; + float _ZTestGBuffer; + float _RequireSplitLighting; + float _ReceivesSSR; + float _ZWrite; + float _TransparentSortPriority; + float _ZTestDepthEqualForOpaque; + float _ZTestTransparent; + float _TransparentBackfaceEnable; + float _AlphaCutoffEnable; + float _UseShadowThreshold; + + + half4 _Color; + half4 _MainTex_ST, _MainTex_TexelSize; + half _Alpha, _AlphaCutoffValue; + + #if ATLAS_ON + half _MinXUV, _MaxXUV, _MinYUV, _MaxYUV; + #endif + + #if GLOW_ON + half4 _GlowColor; + half _Glow, _GlowGlobal; + #endif + + #if HSV_ON + half _HsvShift, _HsvSaturation, _HsvBright; + #endif + + #if DISTORT_ON + half4 _DistortTex_ST; + half _DistortTexXSpeed, _DistortTexYSpeed, _DistortAmount; + #endif + + #if FADE_ON + half4 _FadeBurnColor, _FadeTex_ST, _FadeBurnTex_ST; + half _FadeAmount, _FadeBurnWidth, _FadeBurnTransition,_FadeBurnGlow; + #endif + + #if OUTBASE_ON + half4 _OutlineColor; + half _OutlineAlpha, _OutlineGlow, _OutlineWidth; + int _OutlinePixelWidth; + #endif + + #if OUTTEX_ON + half4 _OutlineTex_ST; + half _OutlineTexXSpeed, _OutlineTexYSpeed; + #endif + + #if OUTDIST_ON + half4 _OutlineDistortTex_ST; + half _OutlineDistortTexXSpeed, _OutlineDistortTexYSpeed, _OutlineDistortAmount; + #endif + + #if ALPHAOUTLINE_ON + half _AlphaOutlineGlow, _AlphaOutlinePower, _AlphaOutlineMinAlpha, _AlphaOutlineBlend; + half4 _AlphaOutlineColor; + #endif + + #if INNEROUTLINE_ON + half _InnerOutlineThickness, _InnerOutlineAlpha, _InnerOutlineGlow; + half4 _InnerOutlineColor; + #endif + + #if GRADIENT_ON + half _GradBlend, _GradBoostX, _GradBoostY; + half4 _GradTopRightCol, _GradTopLeftCol, _GradBotRightCol, _GradBotLeftCol; + #endif + + #if COLORSWAP_ON + half4 _ColorSwapRed, _ColorSwapGreen, _ColorSwapBlue; + half _ColorSwapRedLuminosity, _ColorSwapGreenLuminosity, _ColorSwapBlueLuminosity, _ColorSwapBlend; + #endif + + #if CHANGECOLOR_ON + half4 _ColorChangeNewCol, _ColorChangeTarget; + half _ColorChangeTolerance, _ColorChangeLuminosity; + #endif + #if CHANGECOLOR2_ON + half4 _ColorChangeNewCol2, _ColorChangeTarget2; + half _ColorChangeTolerance2; + #endif + #if CHANGECOLOR3_ON + half4 _ColorChangeNewCol3, _ColorChangeTarget3; + half _ColorChangeTolerance3; + #endif + + #if COLORRAMP_ON + half _ColorRampLuminosity, _ColorRampBlend; + #endif + + #if HITEFFECT_ON + half4 _HitEffectColor; + half _HitEffectGlow, _HitEffectBlend; + #endif + + #if NEGATIVE_ON + half _NegativeAmount; + #endif + + #if PIXELATE_ON + half _PixelateSize; + #endif + + #if GREYSCALE_ON + half _GreyscaleLuminosity, _GreyscaleBlend; + half4 _GreyscaleTintColor; + #endif + + #if POSTERIZE_ON + half _PosterizeNumColors, _PosterizeGamma; + #endif + + #if BLUR_ON + half _BlurIntensity; + #endif + + #if MOTIONBLUR_ON + half _MotionBlurAngle, _MotionBlurDist; + #endif + + #if GHOST_ON + half _GhostColorBoost, _GhostTransparency, _GhostBlend; + #endif + + #if HOLOGRAM_ON + half _HologramStripesAmount, _HologramMinAlpha, _HologramUnmodAmount, _HologramStripesSpeed, _HologramMaxAlpha, _HologramBlend; + half4 _HologramStripeColor; + #endif + + #if CHROMABERR_ON + half _ChromAberrAmount, _ChromAberrAlpha; + #endif + + #if GLITCH_ON + half _GlitchAmount, _GlitchSize; + #endif + + #if FLICKER_ON + half _FlickerFreq, _FlickerPercent, _FlickerAlpha; + #endif + + #if SHADOW_ON + half _ShadowX, _ShadowY, _ShadowAlpha; + half4 _ShadowColor; + #endif + + #if SHINE_ON + half4 _ShineColor; + half _ShineLocation, _ShineRotate, _ShineWidth, _ShineGlow; + #endif + + #if CONTRAST_ON + half _Contrast, _Brightness; + #endif + + #if OVERLAY_ON + half4 _OverlayTex_ST, _OverlayColor; + half _OverlayGlow, _OverlayBlend, _OverlayTextureScrollXSpeed, _OverlayTextureScrollYSpeed; + #endif + + #if DOODLE_ON + half _HandDrawnAmount, _HandDrawnSpeed; + #endif + + #if WIND_ON + half _GrassSpeed, _GrassWind, _GrassManualAnim, _GrassRadialBend; + #endif + + #if WAVEUV_ON + float _WaveAmount, _WaveSpeed, _WaveStrength, _WaveX, _WaveY; + #endif + + #if ROUNDWAVEUV_ON + half _RoundWaveStrength, _RoundWaveSpeed; + #endif + + #if RECTSIZE_ON + half _RectSize; + #endif + + #if OFFSETUV_ON + half _OffsetUvX, _OffsetUvY; + #endif + + #if CLIPPING_ON + half _ClipUvLeft, _ClipUvRight, _ClipUvUp, _ClipUvDown; + #endif + + #if RADIALCLIPPING_ON + half _RadialStartAngle, _RadialClip, _RadialClip2; + #endif + + #if TEXTURESCROLL_ON + half _TextureScrollXSpeed, _TextureScrollYSpeed; + #endif + + #if ZOOMUV_ON + half _ZoomUvAmount; + #endif + + #if WARP_ON + half _WarpStrength, _WarpSpeed, _WarpScale; + #endif + + #if TWISTUV_ON + half _TwistUvAmount, _TwistUvPosX, _TwistUvPosY, _TwistUvRadius; + #endif + + #if ROTATEUV_ON + half _RotateUvAmount; + #endif + + #if FISHEYE_ON + half _FishEyeUvAmount; + #endif + + #if PINCH_ON + half _PinchUvAmount; + #endif + + #if SHAKEUV_ON + half _ShakeUvSpeed, _ShakeUvX, _ShakeUvY; + #endif + + #if NORMALMAP_ON + half _NormalStrength; + #endif + + float _RandomSeed; + + + + + CBUFFER_END + + + + + + + + TEXTURE2D(_MainTex); + SAMPLER(sampler_MainTex); + + #if GLOW_ON + TEXTURE2D(_GlowTex); + SAMPLER(sampler_GlowTex); + #endif + + #if FADE_ON + TEXTURE2D(_FadeTex); + SAMPLER(sampler_FadeTex); + + TEXTURE2D(_FadeBurnTex); + SAMPLER(sampler_FadeBurnTex); + #endif + + #if DISTORT_ON + TEXTURE2D(_DistortTex); + SAMPLER(sampler_DistortTex); + #endif + + #if OUTTEX_ON + TEXTURE2D(_OutlineTex); + SAMPLER(sampler_OutlineTex); + #endif + + #if OUTDIST_ON + TEXTURE2D(_OutlineDistortTex); + SAMPLER(sampler_OutlineDistortTex); + #endif + + #if COLORSWAP_ON + TEXTURE2D(_ColorSwapTex); + SAMPLER(sampler_ColorSwapTex); + #endif + + #if COLORRAMP_ON + TEXTURE2D(_ColorRampTex); + TEXTURE2D(_ColorRampTexGradient); + SAMPLER(sampler_ColorRampTex); + SAMPLER(sampler_ColorRampTexGradient); + #endif + + #if SHINE_ON + TEXTURE2D(_ShineMask); + SAMPLER(sampler_ShineMask); + #endif + + #if OVERLAY_ON + TEXTURE2D(_OverlayTex); + SAMPLER(sampler_OverlayTex); + #endif + + #if NORMALMAP_ON + TEXTURE2D(_NormalMap); + SAMPLER(sampler_NormalMap); + #endif + + + half3 GetPixel(in int offsetX, in int offsetY, in half2 uv, in Texture2D _tex, in SamplerState _sampler) + { + half2 _uv = uv + half2(offsetX * _MainTex_TexelSize.x, offsetY * _MainTex_TexelSize.y); + half4 col = SAMPLE_TEXTURE2D(_tex, _sampler, _uv); + return col.rgb; + } + + + //BLURS------------------------------------------------------------------------- + half4 Blur(half2 uv, Texture2D source, SamplerState sampler_source, half Intensity) + { + const half2 texelSize = 1.0 / _ScreenParams.xy; + const half4 color = SAMPLE_TEXTURE2D(source, sampler_source, uv); + const half2 offset = Intensity * texelSize; + + half4 accumulatedColor = color; + half accumulatedWeight = 1.0; + for (int x = -1; x <= 1; x++) + { + for (int y = -1; y <= 1; y++) + { + const half2 sampleUV = uv + half2(x, y) * offset; + const half4 sampleColor = SAMPLE_TEXTURE2D(source, sampler_source, sampleUV); + + accumulatedColor += sampleColor; + accumulatedWeight += 1.0; + } + } + + half4 blurredColor = accumulatedColor / accumulatedWeight; + return blurredColor; + } + + half BlurHD_G(half bhqp, half x) + { + return exp(-(x * x) / (2.0 * bhqp * bhqp)); + } + half4 BlurHD(half2 uv, Texture2D source, SamplerState sampler_source, half BlurAmount, half xScale, half yScale) + { + int iterations = 16; + int halfIterations = iterations / 2; + half sigmaX = 0.1 + BlurAmount * 0.5; + half sigmaY = sigmaX; + half total = 0.0; + half4 ret = half4(0, 0, 0, 0); + for (int iy = 0; iy < iterations; ++iy) + { + half fy = BlurHD_G(sigmaY, half(iy) -half(halfIterations)); + half offsetY = half(iy - halfIterations) * 0.00390625 * xScale; + for (int ix = 0; ix < iterations; ++ix) + { + half fx = BlurHD_G(sigmaX, half(ix) - half(halfIterations)); + half offsetX = half(ix - halfIterations) * 0.00390625 * yScale; + total += fx * fy; + ret += SAMPLE_TEXTURE2D(source, sampler_source, uv + half2(offsetX, offsetY)) * fx * fy; + } + } + return ret / total; + } + //----------------------------------------------------------------------- + + + //------------------------------------------- + half RemapFloat(half inValue, half inMin, half inMax, half outMin, half outMax){ + return outMin + (inValue - inMin) * (outMax - outMin) / (inMax - inMin); + } + //------------------------------------------- + + //----------------------------------------------------------------------- + half rand(half2 seed, half offset) { + return (frac(sin(dot(seed, half2(12.9898, 78.233))) * 43758.5453) + offset) % 1.0; + } + + half rand2(half2 seed, half offset) { + return (frac(sin(dot(seed * floor(50 + (_Time.x % 1.0) * 12.), half2(127.1, 311.7))) * 43758.5453123) + offset) % 1.0; + } + + half rand2CustomTime(half2 seed, half offset, half customTime) { + return (frac(sin(dot(seed * floor(50 + (customTime % 1.0) * 12.), half2(127.1, 311.7))) * 43758.5453123) + offset) % 1.0; + } + //----------------------------------------------------------------------- + + + void Ext_ModifyVertex0 (inout VertexData v, inout ExtraV2F d) + { + //BILBOARD_ON + #if BILBOARD_ON + half3 camRight = mul((half3x3)unity_CameraToWorld, half3(1,0,0)); + half3 camUp = half3(0,1,0); + #if BILBOARDY_ON + camUp = mul((half3x3)unity_CameraToWorld, half3(0,1,0)); + #endif + half3 localPos = v.vertex.x * camRight + v.vertex.y * camUp; + v.vertex = half4(localPos, 1); + #endif + //----------------------------------------------------------- + + v.texcoord0.xy = TRANSFORM_TEX(v.texcoord0.xy, _MainTex); + half2 center = half2(0.5, 0.5); + #if ATLAS_ON + center = half2((_MaxXUV + _MinXUV) / 2.0, (_MaxYUV + _MinYUV) / 2.0); + #endif + + //POLARUV_ON + #if POLARUV_ON + v.texcoord0.xy = v.texcoord0.xy - center; + #endif + + //---------------------------------------- + + //ROTATEUV_ON + #if ROTATEUV_ON + half2 uvC = v.texcoord0.xy; + half cosAngle = cos(_RotateUvAmount); + half sinAngle = sin(_RotateUvAmount); + half2x2 rot = half2x2(cosAngle, -sinAngle, sinAngle, cosAngle); + uvC -= center; + v.texcoord0.xy = mul(rot, uvC); + v.texcoord0.xy += center; + #endif + //-------------------- + + #if RECTSIZE_ON + v.vertex.xyz += (v.vertex.xyz * (_RectSize - 1.0)); + #endif + + #if OUTTEX_ON + v.texcoord1.xy = TRANSFORM_TEX(v.texcoord0.xy, _OutlineTex); + #endif + + #if OUTDIST_ON + v.texcoord2.xy = TRANSFORM_TEX(v.texcoord0.xy, _OutlineDistortTex); + #endif + + #if DISTORT_ON + v.texcoord3.xy = TRANSFORM_TEX(v.texcoord0.xy, _DistortTex); + #endif + } + + void Ext_SurfaceFunction0 (inout Surface o, ShaderData d) + { + half randomSeed = _RandomSeed; + + float2 uvRect = d.texcoord0; + half2 center = half2(0.5, 0.5); + #if ATLAS_ON + center = half2((_MaxXUV + _MinXUV) / 2.0, (_MaxYUV + _MinYUV) / 2.0); + uvRect = half2((d.texcoord0.x - _MinXUV) / (_MaxXUV - _MinXUV), (d.texcoord0.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half2 centerTiled = half2(center.x * _MainTex_ST.x, center.y * _MainTex_ST.y); + + //CLIPPING_ON + #if CLIPPING_ON + half2 tiledUv = half2(d.texcoord0.x / _MainTex_ST.x, d.texcoord0.y / _MainTex_ST.y); + #if ATLAS_ON + tiledUv = half2((tiledUv.x - _MinXUV) / (_MaxXUV - _MinXUV), (tiledUv.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + clip((1 - _ClipUvUp) - tiledUv.y); + clip(tiledUv.y - _ClipUvDown); + clip((1 - _ClipUvRight) - tiledUv.x); + clip(tiledUv.x - _ClipUvLeft); + #endif + //---------------------------------- + + //RADIALCLIPPING_ON + #if RADIALCLIPPING_ON + half2 tiledUv2 = half2(d.texcoord0.x / _MainTex_ST.x, d.texcoord0.y / _MainTex_ST.y); + #if ATLAS_ON + tiledUv2 = half2((tiledUv2.x - _MinXUV) / (_MaxXUV - _MinXUV), (tiledUv2.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half startAngle = _RadialStartAngle - _RadialClip; + half endAngle = _RadialStartAngle + _RadialClip2; + half offset0 = clamp(0, 360, startAngle + 360); + half offset360 = clamp(0, 360, endAngle - 360); + half2 atan2Coord = half2(lerp(-1, 1, tiledUv2.x), lerp(-1, 1, tiledUv2.y)); + half atanAngle = atan2(atan2Coord.y, atan2Coord.x) * 57.3; // angle in degrees + if(atanAngle < 0) atanAngle = 360 + atanAngle; + if(atanAngle >= startAngle && atanAngle <= endAngle) discard; + if(atanAngle <= offset360) discard; + if(atanAngle >= offset0) discard; + #endif + + //----------------------------- + + //TEXTURESCROLL_ON && ATLAS_ON + #if TEXTURESCROLL_ON && ATLAS_ON + d.texcoord0.xy = half2(_MinXUV + ((_MaxXUV - _MinXUV) * (abs(((_Time.y + randomSeed) * _TextureScrollXSpeed) + uvRect.x) % 1)), + _MinYUV + ((_MaxYUV - _MinYUV) * (abs(((_Time.y + randomSeed) * _TextureScrollYSpeed) + uvRect.y) % 1))); + #endif + //---------------------------- + + //OFFSETUV_ON + #if OFFSETUV_ON + #if ATLAS_ON + d.texcoord0.xy = half2(_MinXUV + ((_MaxXUV - _MinXUV) * (abs((_OffsetUvX + uvRect.x) % 1))), + _MinYUV + ((_MaxYUV - _MinYUV) * (abs(_OffsetUvY + uvRect.y) % 1))); + #else + d.texcoord0.xy += half2(_OffsetUvX, _OffsetUvY); + #endif + #endif + + //---------------------- + + //POLARUV_ON + #if POLARUV_ON + d.texcoord0.xy = half2(atan2(d.texcoord0.y, d.texcoord0.x) / (2.0f * 3.141592653589f), length(d.texcoord0.xy)); + d.texcoord0.xy *= _MainTex_ST.xy; + #endif + + //-------------------------------------- + + //TWISTUV_ON + #if TWISTUV_ON + #if ATLAS_ON + _TwistUvPosX = ((_MaxXUV - _MinXUV) * _TwistUvPosX) + _MinXUV; + _TwistUvPosY = ((_MaxYUV - _MinYUV) * _TwistUvPosY) + _MinYUV; + #endif + half2 tempUv = d.texcoord0.xy - half2(_TwistUvPosX * _MainTex_ST.x, _TwistUvPosY * _MainTex_ST.y); + _TwistUvRadius *= (_MainTex_ST.x + _MainTex_ST.y) / 2; + half percent = (_TwistUvRadius - length(tempUv)) / _TwistUvRadius; + half theta = percent * percent * (2.0 * sin(_TwistUvAmount)) * 8.0; + half s = sin(theta); + half c = cos(theta); + half beta = max(sign(_TwistUvRadius - length(tempUv)), 0.0); + tempUv = half2(dot(tempUv, half2(c, -s)), dot(tempUv, half2(s, c))) * beta + tempUv * (1 - beta); + tempUv += half2(_TwistUvPosX * _MainTex_ST.x, _TwistUvPosY * _MainTex_ST.y); + d.texcoord0.xy = tempUv; + #endif + + //-------------------------------------------- + + //FISHEYE_ON + #if FISHEYE_ON + half bind = length(centerTiled); + half2 dF = d.texcoord0.xy - centerTiled; + half dFlen = length(dF); + half fishInt = (3.14159265359 / bind) * (_FishEyeUvAmount + 0.001); + d.texcoord0.xy = centerTiled + (dF / (max(0.0001, dFlen))) * tan(dFlen * fishInt) * bind / tan(bind * fishInt); + #endif + //--------------------------------------------- + + //PINCH_ON + #if PINCH_ON + half2 dP = d.texcoord0.xy - centerTiled; + half pinchInt = (3.141592 / length(centerTiled)) * (-_PinchUvAmount + 0.001); + d.texcoord0.xy = centerTiled + normalize(dP) * atan(length(dP) * -pinchInt * 10.0) * 0.5 / atan(-pinchInt * 5); + #endif + + //--------------------------------------------- + + //ZOOMUV_ON + #if ZOOMUV_ON + d.texcoord0.xy -= centerTiled; + d.texcoord0.xy = d.texcoord0.xy * _ZoomUvAmount; + d.texcoord0.xy += centerTiled; + #endif + + //----------------------------------------------- + + //DOODLE_ON + #if DOODLE_ON + half2 uvCopy = uvRect; + _HandDrawnSpeed = (floor((_Time.x + randomSeed) * 20 * _HandDrawnSpeed) / _HandDrawnSpeed) * _HandDrawnSpeed; + uvCopy.x = sin((uvCopy.x * _HandDrawnAmount + _HandDrawnSpeed) * 4); + uvCopy.y = cos((uvCopy.y * _HandDrawnAmount + _HandDrawnSpeed) * 4); + d.texcoord0.xy = lerp(d.texcoord0.xy, d.texcoord0.xy + uvCopy, 0.0005 * _HandDrawnAmount); + #endif + + //-------------------------- + + //SHAKEUV_ON + #if SHAKEUV_ON + half xShake = sin((_Time.x + randomSeed) * _ShakeUvSpeed * 50) * _ShakeUvX; + half yShake = cos((_Time.x + randomSeed) * _ShakeUvSpeed * 50) * _ShakeUvY; + d.texcoord0.xy += half2(xShake * 0.012, yShake * 0.01); + #endif + + //------------------------------------------- + + //RECTSIZE_ON + #if RECTSIZE_ON + d.texcoord0.xy = d.texcoord0.xy * (_RectSize).xx + (((-_RectSize * 0.5) + 0.5)).xx; + #endif + + //------------------------------------------- + + //DISTORT_ON + #if DISTORT_ON + #if ATLAS_ON + d.texcoord3.x = d.texcoord3.x * (1 / (_MaxXUV - _MinXUV)); + d.texcoord3.y = d.texcoord3.y * (1 / (_MaxYUV - _MinYUV)); + #endif + + d.texcoord3.x += ((_Time.x + _RandomSeed) * _DistortTexXSpeed) % 1; + d.texcoord3.y += ((_Time.x + _RandomSeed) * _DistortTexYSpeed) % 1; + half distortAmnt = (SAMPLE_TEXTURE2D(_DistortTex, sampler_DistortTex, d.texcoord3.xy).r - 0.5) * 0.2 * _DistortAmount; + d.texcoord0.x += distortAmnt; + d.texcoord0.y += distortAmnt; + #endif + //------------------------------------------------------- + + //WARP_ON + #if WARP_ON + half2 warpUv = half2(d.texcoord0.x / _MainTex_ST.x, d.texcoord0.y / _MainTex_ST.y); + #if ATLAS_ON + warpUv = half2((warpUv.x - _MinXUV) / (_MaxXUV - _MinXUV), (warpUv.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + const float tau = 6.283185307179586; + float xWarp = (_Time.y + randomSeed) * _WarpSpeed + warpUv.x * tau / _WarpScale; + float yWarp = (_Time.y + randomSeed) * _WarpSpeed + warpUv.y * tau / _WarpScale; + float2 warp = float2(sin(xWarp), sin(yWarp)) * _WarpStrength; + d.texcoord0.xy += warp; + #endif + + //------------------------------------------------------- + + //WAVEUV_ON + #if WAVEUV_ON + float2 uvWave = half2(_WaveX * _MainTex_ST.x, _WaveY * _MainTex_ST.y) - d.texcoord0.xy; + uvWave %= 1; + #if ATLAS_ON + uvWave = half2(_WaveX, _WaveY) - uvRect; + #endif + uvWave.x *= _ScreenParams.x / _ScreenParams.y; + float waveTime = _Time.y + randomSeed; + float angWave = (sqrt(dot(uvWave, uvWave)) * _WaveAmount) - ((waveTime * _WaveSpeed)); + d.texcoord0.xy = d.texcoord0.xy + uvWave * sin(angWave) * (_WaveStrength / 1000.0); + #endif + //---------------------------------------------------- + + //ROUNDWAVEUV_ON + #if ROUNDWAVEUV_ON + half xWave = ((0.5 * _MainTex_ST.x) - uvRect.x); + half yWave = ((0.5 * _MainTex_ST.y) - uvRect.y) * (_MainTex_TexelSize.w / _MainTex_TexelSize.z); + half ripple = -sqrt(xWave*xWave + yWave* yWave); + d.texcoord0.xy += (sin((ripple + (_Time.y + randomSeed) * (_RoundWaveSpeed/10.0)) / 0.015) * (_RoundWaveStrength/10.0)) % 1; + #endif + //---------------------------------------------------- + + + //WIND_ON + #if WIND_ON + half windOffset = sin((_Time.x + randomSeed) * _GrassSpeed * 10); + half2 windCenter = half2(0.5, 0.1); + #if ATLAS_ON + windCenter.x = ((_MaxXUV - _MinXUV) * windCenter.x) + _MinXUV; + windCenter.y = ((_MaxYUV - _MinYUV) * windCenter.y) + _MinYUV; + #endif + #if !MANUALWIND_ON + d.texcoord0.x = fmod(abs(lerp(d.texcoord0.x, d.texcoord0.x + (_GrassWind * 0.01 * windOffset), uvRect.y)), 1); + #else + d.texcoord0.x = fmod(abs(lerp(d.texcoord0.x, d.texcoord0.x + (_GrassWind * 0.01 * _GrassManualAnim), uvRect.y)), 1); + windOffset = _GrassManualAnim; + #endif + half2 delta = d.texcoord0.xy - windCenter; + half delta2 = dot(delta.xy, delta.xy); + half2 delta_offset = delta2 * windOffset; + d.texcoord0.xy = d.texcoord0.xy + half2(delta.y, -delta.x) * delta_offset * _GrassRadialBend; + #endif + + //-------------------------------------------------------- + + //TEXTURESCROLL_ON && !ATLAS_ON + #if TEXTURESCROLL_ON && !ATLAS_ON + d.texcoord0.x += ((_Time.y + randomSeed) * _TextureScrollXSpeed) % 1; + d.texcoord0.y += ((_Time.y + randomSeed) * _TextureScrollYSpeed) % 1; + #endif + //------------------------------ + + //PIXELATE_ON + #if PIXELATE_ON + half aspectRatio = _MainTex_TexelSize.x / _MainTex_TexelSize.y; + half2 pixelSize = float2(_PixelateSize, _PixelateSize * aspectRatio); + d.texcoord0.xy = floor(d.texcoord0.xy * pixelSize) / pixelSize; + #endif + //-------------- + + half4 col = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy); + half originalAlpha = col.a; + col *= d.vertexColor; + + //NORMAL MAP + #if NORMALMAP_ON + half4 normalSample = SAMPLE_TEXTURE2D(_NormalMap, sampler_NormalMap, d.texcoord0.xy); + half3 normalTS = UnpackNormal(normalSample); + normalTS.xy *= _NormalStrength; + o.Normal = normalTS; + #endif + + + //GLITCH_ON + #if GLITCH_ON + half2 uvGlitch = uvRect; + uvGlitch.y -= 0.5; + half lineNoise = pow(rand2(floor(uvGlitch * half2(24., 19.) * _GlitchSize) * 4.0, randomSeed), 3.0) * _GlitchAmount + * pow(rand2(floor(uvGlitch * half2(38., 14.) * _GlitchSize) * 4.0, randomSeed), 3.0); + col = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(lineNoise * 0.02 * rand2(half2(2.0, 1), randomSeed), 0)) * d.vertexColor; + #endif + //-------------------------------------- + + //CHROMABERR_ON + #if CHROMABERR_ON + half4 r = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(_ChromAberrAmount/10, 0)) * d.vertexColor; + half4 b = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(-_ChromAberrAmount/10, 0)) * d.vertexColor; + col = half4(r.r * r.a, col.g, b.b * b.a, max(max(r.a, b.a) * _ChromAberrAlpha, col.a)); + #endif + + //-------------------------------- + + //BLUR_ON + #if BLUR_ON + #if ATLAS_ON + #if !BLURISHD_ON + col = BlurHD(d.texcoord0.xy, _MainTex, sampler_MainTex, _BlurIntensity, (_MaxXUV - _MinXUV), (_MaxYUV - _MinYUV)) * d.vertexColor; + #else + col = Blur(d.texcoord0.xy, _MainTex, sampler_MainTex, _BlurIntensity * (_MaxXUV - _MinXUV)) * d.vertexColor; + #endif + #else + #if !BLURISHD_ON + col = BlurHD(d.texcoord0.xy, _MainTex, sampler_MainTex, _BlurIntensity, 1, 1) * d.vertexColor; + #else + col = Blur(d.texcoord0.xy, _MainTex, sampler_MainTex, _BlurIntensity) * d.vertexColor; + #endif + #endif + #endif + + //-------------------- + + //MOTIONBLUR_ON + #if MOTIONBLUR_ON + _MotionBlurAngle = _MotionBlurAngle * 3.1415926; + #define rot(n) mul(n, half2x2(cos(_MotionBlurAngle), -sin(_MotionBlurAngle), sin(_MotionBlurAngle), cos(_MotionBlurAngle))) + _MotionBlurDist = _MotionBlurDist * 0.005; + #if ATLAS_ON + _MotionBlurDist *= (_MaxXUV - _MinXUV); + #endif + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(-_MotionBlurDist, -_MotionBlurDist))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(-_MotionBlurDist * 2, -_MotionBlurDist * 2))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(-_MotionBlurDist * 3, -_MotionBlurDist * 3))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(-_MotionBlurDist * 4, -_MotionBlurDist * 4))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(_MotionBlurDist, _MotionBlurDist))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(_MotionBlurDist * 2, _MotionBlurDist * 2))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(_MotionBlurDist * 3, _MotionBlurDist * 3))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(_MotionBlurDist * 4, _MotionBlurDist * 4))); + col.rgb = col.rgb / 9; + #endif + //------------------------------------ + + //NEGATIVE_ON + #if NEGATIVE_ON + col.rgb = lerp(col.rgb, 1 - col.rgb, _NegativeAmount); + #endif + + //-------------- + half luminance = 0; + + //GREYSCALE_ON && !GREYSCALEOUTLINE_ON + #if GREYSCALE_ON && !GREYSCALEOUTLINE_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + luminance = saturate(luminance + _GreyscaleLuminosity); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _GreyscaleTintColor, _GreyscaleBlend); + #endif + //------------------------------------ + + //GHOST_ON + #if GHOST_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + half4 ghostResult; + ghostResult.a = saturate(luminance - _GhostTransparency) * col.a; + ghostResult.rgb = col.rgb * (luminance + _GhostColorBoost); + col = lerp(col, ghostResult, _GhostBlend); + #endif + //------------------------------------ + + //INNEROUTLINE_ON + #if INNEROUTLINE_ON + half3 innerT = abs(GetPixel(0, _InnerOutlineThickness, d.texcoord0.xy, _MainTex, sampler_MainTex) - GetPixel(0, -_InnerOutlineThickness, d.texcoord0.xy, _MainTex, sampler_MainTex)); + innerT += abs(GetPixel(_InnerOutlineThickness, 0, d.texcoord0.xy, _MainTex, sampler_MainTex) - GetPixel(-_InnerOutlineThickness, 0, d.texcoord0.xy, _MainTex, sampler_MainTex)); + #if !ONLYINNEROUTLINE_ON + innerT = (innerT / 2.0) * col.a * _InnerOutlineAlpha; + col.rgb += length(innerT) * _InnerOutlineColor.rgb * _InnerOutlineGlow; + #else + innerT *= col.a * _InnerOutlineAlpha; + col.rgb = length(innerT) * _InnerOutlineColor.rgb * _InnerOutlineGlow; + col.a = step(0.3, col.r+col.g+col.b); + #endif + #endif + //------------------------------------------------------- + + //HITEFFECT_ON + #if HITEFFECT_ON + col.rgb = lerp(col.rgb, _HitEffectColor.rgb * _HitEffectGlow, _HitEffectBlend); + #endif + //-------------------- + + //GRADIENT_ON + #if GRADIENT_ON + half2 tiledUvGrad = half2(uvRect.x / _MainTex_ST.x, uvRect.y / _MainTex_ST.y); + #if GRADIENT2COL_ON + _GradTopRightCol = _GradTopLeftCol; + _GradBotRightCol = _GradBotLeftCol; + #endif + #if RADIALGRADIENT_ON + half radialDist = 1 - length(tiledUvGrad - half2(0.5, 0.5)); + radialDist *= (_MainTex_TexelSize.w / _MainTex_TexelSize.z); + radialDist = saturate(_GradBoostX * radialDist); + half4 gradientResult = lerp(_GradTopLeftCol, _GradBotLeftCol, radialDist); + #else + half gradXLerpFactor = saturate(pow(tiledUvGrad.x, _GradBoostX)); + half4 gradientResult = lerp(lerp(_GradBotLeftCol, _GradBotRightCol, gradXLerpFactor), + lerp(_GradTopLeftCol, _GradTopRightCol, gradXLerpFactor), saturate(pow(tiledUvGrad.y, _GradBoostY))); + #endif + gradientResult = lerp(col, gradientResult, _GradBlend); + col.rgb = gradientResult.rgb * col.a; + col.a *= gradientResult.a; + #endif + //-------------------------------------------------------------------- + + //CONTRAST_ON + #if CONTRAST_ON + col.rgb = (col.rgb - float3(0.5, 0.5, 0.5)) * _Contrast + float3(0.5, 0.5, 0.5); + col.rgb += _Brightness; + #endif + + //------------------------------------------------------------------- + + //COLORSWAP_ON + #if COLORSWAP_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + half4 swapMask = SAMPLE_TEXTURE2D(_ColorSwapTex, sampler_ColorSwapTex, d.texcoord0.xy); + swapMask.rgb *= swapMask.a; + half3 redSwap = _ColorSwapRed * swapMask.r * saturate(luminance + _ColorSwapRedLuminosity); + half3 greenSwap = _ColorSwapGreen * swapMask.g * saturate(luminance + _ColorSwapGreenLuminosity); + half3 blueSwap = _ColorSwapBlue * swapMask.b * saturate(luminance + _ColorSwapBlueLuminosity); + swapMask.rgb = col.rgb * saturate(1 - swapMask.r - swapMask.g - swapMask.b); + col.rgb = lerp(col.rgb, swapMask.rgb + redSwap + greenSwap + blueSwap, _ColorSwapBlend); + #endif + //-------------------------------------------------------------------- + + //COLORRAMP_ON && !COLORRAMPOUTLINE_ON + #if COLORRAMP_ON && !COLORRAMPOUTLINE_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + luminance = saturate(luminance + _ColorRampLuminosity); + #if GRADIENTCOLORRAMP_ON + col.rgb = lerp(col.rgb, SAMPLE_TEXTURE2D(_ColorRampTexGradient, sampler_ColorRampTexGradient, half2(luminance, 0)).rgb, _ColorRampBlend); + #else + col.rgb = lerp(col.rgb, SAMPLE_TEXTURE2D(_ColorRampTex, sampler_ColorRampTex, half2(luminance, 0)).rgb, _ColorRampBlend); + #endif + #endif + //-------------------------------------------------------------------- + + //CHANGECOLOR_ON + #if CHANGECOLOR_ON + float3 currChangeColor = saturate(col.rgb); + luminance = 0.3 * currChangeColor.r + 0.59 * currChangeColor.g + 0.11 * currChangeColor.b; + luminance = saturate(luminance + _ColorChangeLuminosity); + half3 dif = abs(currChangeColor - _ColorChangeTarget.rgb); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _ColorChangeNewCol.rgb, + max(sign(1 - saturate(dif.x + dif.y + dif.z) - _ColorChangeTolerance), 0.0)); + #if CHANGECOLOR2_ON + dif = abs(currChangeColor - _ColorChangeTarget2.rgb); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _ColorChangeNewCol2.rgb, + max(sign(1 - saturate(dif.x + dif.y + dif.z) - _ColorChangeTolerance2), 0.0)); + #endif + #if CHANGECOLOR3_ON + dif = abs(currChangeColor - _ColorChangeTarget3.rgb); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _ColorChangeNewCol3.rgb, + max(sign(1 - saturate(dif.x + dif.y + dif.z) - _ColorChangeTolerance3), 0.0)); + #endif + #endif + //------------------------------------------------------- + + //POSTERIZE_ON && !POSTERIZEOUTLINE_ON + #if POSTERIZE_ON && !POSTERIZEOUTLINE_ON + col.rgb = pow(col.rgb, _PosterizeGamma) * _PosterizeNumColors; + col.rgb = floor(col.rgb) / _PosterizeNumColors; + col.rgb = pow(col.rgb, 1.0 / _PosterizeGamma); + #endif + //------------------------------------ + + //HSV_ON + #if HSV_ON + half3 resultHsv = half3(col.rgb); + half cosHsv = _HsvBright * _HsvSaturation * cos(_HsvShift * 3.14159265 / 180); + half sinHsv = _HsvBright * _HsvSaturation * sin(_HsvShift * 3.14159265 / 180); + resultHsv.x = (.299 * _HsvBright + .701 * cosHsv + .168 * sinHsv) * col.x + + (.587 * _HsvBright - .587 * cosHsv + .330 * sinHsv) * col.y + + (.114 * _HsvBright - .114 * cosHsv - .497 * sinHsv) * col.z; + resultHsv.y = (.299 * _HsvBright - .299 * cosHsv - .328 * sinHsv) *col.x + + (.587 * _HsvBright + .413 * cosHsv + .035 * sinHsv) * col.y + + (.114 * _HsvBright - .114 * cosHsv + .292 * sinHsv) * col.z; + resultHsv.z = (.299 * _HsvBright - .3 * cosHsv + 1.25 * sinHsv) * col.x + + (.587 * _HsvBright - .588 * cosHsv - 1.05 * sinHsv) * col.y + + (.114 * _HsvBright + .886 * cosHsv - .203 * sinHsv) * col.z; + col.rgb = resultHsv; + #endif + //------------------------------------------------------- + + //OVERLAY_ON + #if OVERLAY_ON + half2 overlayUvs = d.texcoord0.xy; + overlayUvs.x += ((_Time.y + randomSeed) * _OverlayTextureScrollXSpeed) % 1; + overlayUvs.y += ((_Time.y + randomSeed) * _OverlayTextureScrollYSpeed) % 1; + half4 overlayCol = SAMPLE_TEXTURE2D(_OverlayTex, sampler_OverlayTex, TRANSFORM_TEX(overlayUvs, _OverlayTex)); + overlayCol.rgb *= _OverlayColor.rgb * _OverlayGlow; + #if !OVERLAYMULT_ON + overlayCol.rgb *= overlayCol.a * _OverlayColor.rgb * _OverlayColor.a * _OverlayBlend; + col.rgb += overlayCol.rgb; + #else + overlayCol.a *= _OverlayColor.a; + col = lerp(col, col * overlayCol, _OverlayBlend); + #endif + #endif + + //--------------------------------- + + //OUTBASE_ON + #if OUTBASE_ON + #if OUTBASEPIXELPERF_ON + half2 destUv = half2(_OutlinePixelWidth * _MainTex_TexelSize.x, _OutlinePixelWidth * _MainTex_TexelSize.y); + #else + half2 destUv = half2(_OutlineWidth * _MainTex_TexelSize.x * 200, _OutlineWidth * _MainTex_TexelSize.y * 200); + #endif + + #if OUTDIST_ON + d.texcoord3.x += ((_Time.x + _RandomSeed) * _OutlineDistortTexXSpeed) % 1; + d.texcoord3.y += ((_Time.x + _RandomSeed) * _OutlineDistortTexYSpeed) % 1; + #if ATLAS_ON + d.texcoord3 = half2((d.texcoord3.x - _MinXUV) / (_MaxXUV - _MinXUV), (d.texcoord3.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half outDistortAmnt = (SAMPLE_TEXTURE2D(_OutlineDistortTex, sampler_OutlineDistortTex, d.texcoord3).r - 0.5) * 0.2 * _OutlineDistortAmount; + destUv.x += outDistortAmnt; + destUv.y += outDistortAmnt; + #endif + + half spriteLeft = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(destUv.x, 0)).a; + half spriteRight = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy - half2(destUv.x, 0)).a; + half spriteBottom = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(0, destUv.y)).a; + half spriteTop = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy - half2(0, destUv.y)).a; + half result = spriteLeft + spriteRight + spriteBottom + spriteTop; + + #if OUTBASE8DIR_ON + half spriteTopLeft = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(destUv.x, destUv.y)).a; + half spriteTopRight = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(-destUv.x, destUv.y)).a; + half spriteBotLeft = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(destUv.x, -destUv.y)).a; + half spriteBotRight = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(-destUv.x, -destUv.y)).a; + result = result + spriteTopLeft + spriteTopRight + spriteBotLeft + spriteBotRight; + #endif + + result = step(0.05, saturate(result)); + + #if OUTTEX_ON + d.texcoord1.x += ((_Time.x + _RandomSeed) * _OutlineTexXSpeed) % 1; + d.texcoord1.y += ((_Time.x + _RandomSeed) * _OutlineTexYSpeed) % 1; + #if ATLAS_ON + d.texcoord1 = half2((d.texcoord1.x - _MinXUV) / (_MaxXUV - _MinXUV), (d.texcoord1.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half4 tempOutColor = SAMPLE_TEXTURE2D(_OutlineTex, sampler_OutlineTex, d.texcoord1); + tempOutColor *= _OutlineColor; + _OutlineColor = tempOutColor; + #endif + + result *= (1 - originalAlpha) * _OutlineAlpha; + + half4 outline = _OutlineColor * d.vertexColor.a; + outline.rgb *= _OutlineGlow; + outline.a = result; + #if ONLYOUTLINE_ON + col = outline; + #else + col = lerp(col, outline, result); + #endif + #endif + //------------------------------------------------------- + + //FADE_ON + #if FADE_ON + half2 tiledUvFade1 = TRANSFORM_TEX(d.texcoord0, _FadeTex); + half2 tiledUvFade2 = TRANSFORM_TEX(d.texcoord0, _FadeBurnTex); + #if ATLAS_ON + tiledUvFade1 = half2((tiledUvFade1.x - _MinXUV) / (_MaxXUV - _MinXUV), (tiledUvFade1.y - _MinYUV) / (_MaxYUV - _MinYUV)); + tiledUvFade2 = half2((tiledUvFade2.x - _MinXUV) / (_MaxXUV - _MinXUV), (tiledUvFade2.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half fadeTemp = SAMPLE_TEXTURE2D(_FadeTex, sampler_FadeTex, tiledUvFade1).r; + half fade = smoothstep(_FadeAmount, _FadeAmount + _FadeBurnTransition, fadeTemp); + half fadeBurn = saturate(smoothstep(_FadeAmount - _FadeBurnWidth, _FadeAmount - _FadeBurnWidth + 0.1, fadeTemp) * _FadeAmount); + col.a *= fade; + _FadeBurnColor.rgb *= _FadeBurnGlow; + col += fadeBurn * SAMPLE_TEXTURE2D(_FadeBurnTex, sampler_FadeBurnTex, tiledUvFade2) * _FadeBurnColor * originalAlpha * (1 - col.a); + #endif + //------------------------------------------------------- + + //SHADOW_ON + #if SHADOW_ON + half shadowA = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(_ShadowX, _ShadowY)).a; + half preMultShadowMask = 1 - (saturate(shadowA - col.a) * (1 - col.a)); + col.rgb *= 1 - ((shadowA - col.a) * (1 - col.a)); + col.rgb += (_ShadowColor * shadowA) * (1 - col.a); + col.a = max(shadowA * _ShadowAlpha * d.vertexColor.a, col.a); + #endif + + //------------------------------------------------------- + + //GLOW_ON + #if GLOW_ON + half4 emission; + #if GLOWTEX_ON + emission = SAMPLE_TEXTURE2D(_GlowTex, sampler_GlowTex, d.texcoord0); + #else + emission = col; + #endif + + col.rgb *= _GlowGlobal; + emission.rgb *= emission.a * col.a * _Glow * _GlowColor; + col.rgb += emission.rgb; + #endif + //------------------------------------------------------- + + //COLORRAMP_ON && COLORRAMPOUTLINE_ON + #if COLORRAMP_ON && COLORRAMPOUTLINE_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + luminance = saturate(luminance + _ColorRampLuminosity); + #if GRADIENTCOLORRAMP_ON + col.rgb = lerp(col.rgb, SAMPLE_TEXTURE2D(_ColorRampTexGradient, sampler_ColorRampTexGradient, half2(luminance, 0)).rgb, _ColorRampBlend); + #else + col.rgb = lerp(col.rgb, SAMPLE_TEXTURE2D(_ColorRampTex, sampler_ColorRampTex, half2(luminance, 0)).rgb, _ColorRampBlend); + #endif + #endif + //--------------- + + //GREYSCALE_ON && GREYSCALEOUTLINE_ON + #if GREYSCALE_ON && GREYSCALEOUTLINE_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + luminance = saturate(luminance + _GreyscaleLuminosity); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _GreyscaleTintColor, _GreyscaleBlend); + #endif + + //----------------------------------- + + //POSTERIZE_ON && POSTERIZEOUTLINE_ON + #if POSTERIZE_ON && POSTERIZEOUTLINE_ON + col.rgb = pow(col.rgb, _PosterizeGamma) * _PosterizeNumColors; + col.rgb = floor(col.rgb) / _PosterizeNumColors; + col.rgb = pow(col.rgb, 1.0 / _PosterizeGamma); + #endif + + //----------------------------------- + + //SHINE_ON + #if SHINE_ON + half2 uvShine = uvRect; + half cosAngle = cos(_ShineRotate); + half sinAngle = sin(_ShineRotate); + half2x2 rot = half2x2(cosAngle, -sinAngle, sinAngle, cosAngle); + uvShine -= half2(0.5, 0.5); + uvShine = mul(rot, uvShine); + uvShine += half2(0.5, 0.5); + half shineMask = SAMPLE_TEXTURE2D(_ShineMask, sampler_ShineMask, d.texcoord0.xy).a; + half currentDistanceProjection = (uvShine.x + uvShine.y) / 2; + half whitePower = 1 - (abs(currentDistanceProjection - _ShineLocation) / _ShineWidth); + col.rgb += col.a * whitePower * _ShineGlow * max(sign(currentDistanceProjection - (_ShineLocation - _ShineWidth)), 0.0) + * max(sign((_ShineLocation + _ShineWidth) - currentDistanceProjection), 0.0) * _ShineColor * shineMask; + #endif + + //----------------------------------- + + //HOLOGRAM_ON + #if HOLOGRAM_ON + half totalHologram = _HologramStripesAmount + _HologramUnmodAmount; + half hologramYCoord = ((uvRect.y + (((_Time.x + randomSeed) % 1) * _HologramStripesSpeed)) % totalHologram) / totalHologram; + hologramYCoord = abs(hologramYCoord); + half alpha = RemapFloat(saturate(hologramYCoord - (_HologramUnmodAmount/totalHologram)), 0.0, 1.0, _HologramMinAlpha, saturate(_HologramMaxAlpha)); + half hologramMask = max(sign((_HologramUnmodAmount/totalHologram) - hologramYCoord), 0.0); + half4 hologramResult = col; + hologramResult.a *= lerp(alpha, 1, hologramMask); + hologramResult.rgb *= max(1, _HologramMaxAlpha * max(sign(hologramYCoord - (_HologramUnmodAmount/totalHologram)), 0.0)); + hologramMask = 1 - step(0.01,hologramMask); + hologramResult.rgb += hologramMask * _HologramStripeColor * col.a; + col = lerp(col, hologramResult, _HologramBlend); + #endif + + //----------------------------------- + + //FLICKER_ON + #if FLICKER_ON + col.a *= saturate(col.a * step(frac(0.05 + (_Time.w + randomSeed) * _FlickerFreq), 1 - _FlickerPercent) + _FlickerAlpha); + #endif + //----------------------------------- + + //ALPHACUTOFF_ON + + //ALPHAROUND_ON + + //ALPHAOUTLINE_ON + #if ALPHAOUTLINE_ON + half alphaOutlineRes = pow(1 - col.a, max(_AlphaOutlinePower, 0.0001)) * step(_AlphaOutlineMinAlpha, col.a) * _AlphaOutlineBlend; + col.rgb = lerp(col.rgb, _AlphaOutlineColor.rgb * _AlphaOutlineGlow, alphaOutlineRes); + col.a = lerp(col.a, 1, alphaOutlineRes > 1); + #endif + //------------------------------------------------------- + + //FOG_ON + + //------------------ + + col *= _Color; + o.Albedo = col; + col.a *= _Alpha; + clip(col.a - _AlphaCutoffValue - 0.01); + o.Alpha = _Color.a; + } + + + + + + void ChainSurfaceFunction(inout Surface l, inout ShaderData d) + { + Ext_SurfaceFunction0(l, d); + // Ext_SurfaceFunction1(l, d); + // Ext_SurfaceFunction2(l, d); + // Ext_SurfaceFunction3(l, d); + // Ext_SurfaceFunction4(l, d); + // Ext_SurfaceFunction5(l, d); + // Ext_SurfaceFunction6(l, d); + // Ext_SurfaceFunction7(l, d); + // Ext_SurfaceFunction8(l, d); + // Ext_SurfaceFunction9(l, d); + // Ext_SurfaceFunction10(l, d); + // Ext_SurfaceFunction11(l, d); + // Ext_SurfaceFunction12(l, d); + // Ext_SurfaceFunction13(l, d); + // Ext_SurfaceFunction14(l, d); + // Ext_SurfaceFunction15(l, d); + // Ext_SurfaceFunction16(l, d); + // Ext_SurfaceFunction17(l, d); + // Ext_SurfaceFunction18(l, d); + // Ext_SurfaceFunction19(l, d); + // Ext_SurfaceFunction20(l, d); + // Ext_SurfaceFunction21(l, d); + // Ext_SurfaceFunction22(l, d); + // Ext_SurfaceFunction23(l, d); + // Ext_SurfaceFunction24(l, d); + // Ext_SurfaceFunction25(l, d); + // Ext_SurfaceFunction26(l, d); + // Ext_SurfaceFunction27(l, d); + // Ext_SurfaceFunction28(l, d); + // Ext_SurfaceFunction29(l, d); + } + +#if !_DECALSHADER + + void ChainModifyVertex(inout VertexData v, inout VertexToPixel v2p, float4 time) + { + ExtraV2F d; + + ZERO_INITIALIZE(ExtraV2F, d); + ZERO_INITIALIZE(Blackboard, d.blackboard); + // due to motion vectors in HDRP, we need to use the last + // time in certain spots. So if you are going to use _Time to adjust vertices, + // you need to use this time or motion vectors will break. + d.time = time; + + Ext_ModifyVertex0(v, d); + // Ext_ModifyVertex1(v, d); + // Ext_ModifyVertex2(v, d); + // Ext_ModifyVertex3(v, d); + // Ext_ModifyVertex4(v, d); + // Ext_ModifyVertex5(v, d); + // Ext_ModifyVertex6(v, d); + // Ext_ModifyVertex7(v, d); + // Ext_ModifyVertex8(v, d); + // Ext_ModifyVertex9(v, d); + // Ext_ModifyVertex10(v, d); + // Ext_ModifyVertex11(v, d); + // Ext_ModifyVertex12(v, d); + // Ext_ModifyVertex13(v, d); + // Ext_ModifyVertex14(v, d); + // Ext_ModifyVertex15(v, d); + // Ext_ModifyVertex16(v, d); + // Ext_ModifyVertex17(v, d); + // Ext_ModifyVertex18(v, d); + // Ext_ModifyVertex19(v, d); + // Ext_ModifyVertex20(v, d); + // Ext_ModifyVertex21(v, d); + // Ext_ModifyVertex22(v, d); + // Ext_ModifyVertex23(v, d); + // Ext_ModifyVertex24(v, d); + // Ext_ModifyVertex25(v, d); + // Ext_ModifyVertex26(v, d); + // Ext_ModifyVertex27(v, d); + // Ext_ModifyVertex28(v, d); + // Ext_ModifyVertex29(v, d); + + + // #if %EXTRAV2F0REQUIREKEY% + // v2p.extraV2F0 = d.extraV2F0; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // v2p.extraV2F1 = d.extraV2F1; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // v2p.extraV2F2 = d.extraV2F2; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // v2p.extraV2F3 = d.extraV2F3; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // v2p.extraV2F4 = d.extraV2F4; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // v2p.extraV2F5 = d.extraV2F5; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // v2p.extraV2F6 = d.extraV2F6; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // v2p.extraV2F7 = d.extraV2F7; + // #endif + } + + void ChainModifyTessellatedVertex(inout VertexData v, inout VertexToPixel v2p) + { + ExtraV2F d; + ZERO_INITIALIZE(ExtraV2F, d); + ZERO_INITIALIZE(Blackboard, d.blackboard); + + // #if %EXTRAV2F0REQUIREKEY% + // d.extraV2F0 = v2p.extraV2F0; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // d.extraV2F1 = v2p.extraV2F1; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // d.extraV2F2 = v2p.extraV2F2; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // d.extraV2F3 = v2p.extraV2F3; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // d.extraV2F4 = v2p.extraV2F4; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // d.extraV2F5 = v2p.extraV2F5; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // d.extraV2F6 = v2p.extraV2F6; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // d.extraV2F7 = v2p.extraV2F7; + // #endif + + + // Ext_ModifyTessellatedVertex0(v, d); + // Ext_ModifyTessellatedVertex1(v, d); + // Ext_ModifyTessellatedVertex2(v, d); + // Ext_ModifyTessellatedVertex3(v, d); + // Ext_ModifyTessellatedVertex4(v, d); + // Ext_ModifyTessellatedVertex5(v, d); + // Ext_ModifyTessellatedVertex6(v, d); + // Ext_ModifyTessellatedVertex7(v, d); + // Ext_ModifyTessellatedVertex8(v, d); + // Ext_ModifyTessellatedVertex9(v, d); + // Ext_ModifyTessellatedVertex10(v, d); + // Ext_ModifyTessellatedVertex11(v, d); + // Ext_ModifyTessellatedVertex12(v, d); + // Ext_ModifyTessellatedVertex13(v, d); + // Ext_ModifyTessellatedVertex14(v, d); + // Ext_ModifyTessellatedVertex15(v, d); + // Ext_ModifyTessellatedVertex16(v, d); + // Ext_ModifyTessellatedVertex17(v, d); + // Ext_ModifyTessellatedVertex18(v, d); + // Ext_ModifyTessellatedVertex19(v, d); + // Ext_ModifyTessellatedVertex20(v, d); + // Ext_ModifyTessellatedVertex21(v, d); + // Ext_ModifyTessellatedVertex22(v, d); + // Ext_ModifyTessellatedVertex23(v, d); + // Ext_ModifyTessellatedVertex24(v, d); + // Ext_ModifyTessellatedVertex25(v, d); + // Ext_ModifyTessellatedVertex26(v, d); + // Ext_ModifyTessellatedVertex27(v, d); + // Ext_ModifyTessellatedVertex28(v, d); + // Ext_ModifyTessellatedVertex29(v, d); + + // #if %EXTRAV2F0REQUIREKEY% + // v2p.extraV2F0 = d.extraV2F0; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // v2p.extraV2F1 = d.extraV2F1; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // v2p.extraV2F2 = d.extraV2F2; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // v2p.extraV2F3 = d.extraV2F3; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // v2p.extraV2F4 = d.extraV2F4; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // v2p.extraV2F5 = d.extraV2F5; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // v2p.extraV2F6 = d.extraV2F6; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // v2p.extraV2F7 = d.extraV2F7; + // #endif + } + + void ChainFinalColorForward(inout Surface l, inout ShaderData d, inout half4 color) + { + // Ext_FinalColorForward0(l, d, color); + // Ext_FinalColorForward1(l, d, color); + // Ext_FinalColorForward2(l, d, color); + // Ext_FinalColorForward3(l, d, color); + // Ext_FinalColorForward4(l, d, color); + // Ext_FinalColorForward5(l, d, color); + // Ext_FinalColorForward6(l, d, color); + // Ext_FinalColorForward7(l, d, color); + // Ext_FinalColorForward8(l, d, color); + // Ext_FinalColorForward9(l, d, color); + // Ext_FinalColorForward10(l, d, color); + // Ext_FinalColorForward11(l, d, color); + // Ext_FinalColorForward12(l, d, color); + // Ext_FinalColorForward13(l, d, color); + // Ext_FinalColorForward14(l, d, color); + // Ext_FinalColorForward15(l, d, color); + // Ext_FinalColorForward16(l, d, color); + // Ext_FinalColorForward17(l, d, color); + // Ext_FinalColorForward18(l, d, color); + // Ext_FinalColorForward19(l, d, color); + // Ext_FinalColorForward20(l, d, color); + // Ext_FinalColorForward21(l, d, color); + // Ext_FinalColorForward22(l, d, color); + // Ext_FinalColorForward23(l, d, color); + // Ext_FinalColorForward24(l, d, color); + // Ext_FinalColorForward25(l, d, color); + // Ext_FinalColorForward26(l, d, color); + // Ext_FinalColorForward27(l, d, color); + // Ext_FinalColorForward28(l, d, color); + // Ext_FinalColorForward29(l, d, color); + } + + void ChainFinalGBufferStandard(inout Surface s, inout ShaderData d, inout half4 GBuffer0, inout half4 GBuffer1, inout half4 GBuffer2, inout half4 outEmission, inout half4 outShadowMask) + { + // Ext_FinalGBufferStandard0(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard1(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard2(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard3(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard4(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard5(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard6(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard7(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard8(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard9(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard10(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard11(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard12(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard13(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard14(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard15(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard16(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard17(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard18(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard19(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard20(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard21(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard22(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard23(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard24(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard25(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard26(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard27(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard28(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard29(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + } +#endif + + + + + +#if _DECALSHADER + + ShaderData CreateShaderData(SurfaceDescriptionInputs IN) + { + ShaderData d = (ShaderData)0; + d.TBNMatrix = float3x3(IN.WorldSpaceTangent, IN.WorldSpaceBiTangent, IN.WorldSpaceNormal); + d.worldSpaceNormal = IN.WorldSpaceNormal; + d.worldSpaceTangent = IN.WorldSpaceTangent; + + d.worldSpacePosition = IN.WorldSpacePosition; + d.texcoord0 = IN.uv0.xyxy; + d.screenPos = IN.ScreenPosition; + + d.worldSpaceViewDir = normalize(_WorldSpaceCameraPos - d.worldSpacePosition); + + d.tangentSpaceViewDir = mul(d.TBNMatrix, d.worldSpaceViewDir); + + // these rarely get used, so we back transform them. Usually will be stripped. + #if _HDRP + // d.localSpacePosition = mul(GetWorldToObjectMatrix(), float4(GetCameraRelativePositionWS(d.worldSpacePosition), 1)).xyz; + #else + // d.localSpacePosition = mul(GetWorldToObjectMatrix(), float4(d.worldSpacePosition, 1)).xyz; + #endif + // d.localSpaceNormal = normalize(mul((float3x3)GetWorldToObjectMatrix(), d.worldSpaceNormal)); + // d.localSpaceTangent = normalize(mul((float3x3)GetWorldToObjectMatrix(), d.worldSpaceTangent.xyz)); + + // #if %SCREENPOSREQUIREKEY% + // d.screenUV = (IN.ScreenPosition.xy / max(0.01, IN.ScreenPosition.w)); + // #endif + + return d; + } +#else + + ShaderData CreateShaderData(VertexToPixel i + #if NEED_FACING + , bool facing + #endif + ) + { + ShaderData d = (ShaderData)0; + d.clipPos = i.pos; + d.worldSpacePosition = i.worldPos; + + d.worldSpaceNormal = normalize(i.worldNormal); + d.worldSpaceTangent.xyz = normalize(i.worldTangent.xyz); + + d.tangentSign = i.worldTangent.w * unity_WorldTransformParams.w; + float3 bitangent = cross(d.worldSpaceTangent.xyz, d.worldSpaceNormal) * d.tangentSign; + + d.TBNMatrix = float3x3(d.worldSpaceTangent, -bitangent, d.worldSpaceNormal); + d.worldSpaceViewDir = normalize(_WorldSpaceCameraPos - i.worldPos); + + d.tangentSpaceViewDir = mul(d.TBNMatrix, d.worldSpaceViewDir); + d.texcoord0 = i.texcoord0; + d.texcoord1 = i.texcoord1; + d.texcoord2 = i.texcoord2; + + // #if %TEXCOORD3REQUIREKEY% + d.texcoord3 = i.texcoord3; + // #endif + + // d.isFrontFace = facing; + // #if %VERTEXCOLORREQUIREKEY% + d.vertexColor = i.vertexColor; + // #endif + + // these rarely get used, so we back transform them. Usually will be stripped. + #if _HDRP + // d.localSpacePosition = mul(GetWorldToObjectMatrix(), float4(GetCameraRelativePositionWS(i.worldPos), 1)).xyz; + #else + // d.localSpacePosition = mul(GetWorldToObjectMatrix(), float4(i.worldPos, 1)).xyz; + #endif + // d.localSpaceNormal = normalize(mul((float3x3)GetWorldToObjectMatrix(), i.worldNormal)); + // d.localSpaceTangent = normalize(mul((float3x3)GetWorldToObjectMatrix(), i.worldTangent.xyz)); + + // #if %SCREENPOSREQUIREKEY% + // d.screenPos = i.screenPos; + // d.screenUV = (i.screenPos.xy / i.screenPos.w); + // #endif + + + // #if %EXTRAV2F0REQUIREKEY% + // d.extraV2F0 = i.extraV2F0; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // d.extraV2F1 = i.extraV2F1; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // d.extraV2F2 = i.extraV2F2; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // d.extraV2F3 = i.extraV2F3; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // d.extraV2F4 = i.extraV2F4; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // d.extraV2F5 = i.extraV2F5; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // d.extraV2F6 = i.extraV2F6; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // d.extraV2F7 = i.extraV2F7; + // #endif + + return d; + } + +#endif + + + +struct VaryingsToPS +{ + VertexToPixel vmesh; + #ifdef VARYINGS_NEED_PASS + VaryingsPassToPS vpass; + #endif +}; + +struct PackedVaryingsToPS +{ + #ifdef VARYINGS_NEED_PASS + PackedVaryingsPassToPS vpass; + #endif + VertexToPixel vmesh; + + UNITY_VERTEX_OUTPUT_STEREO +}; + +PackedVaryingsToPS PackVaryingsToPS(VaryingsToPS input) +{ + PackedVaryingsToPS output = (PackedVaryingsToPS)0; + output.vmesh = input.vmesh; + #ifdef VARYINGS_NEED_PASS + output.vpass = PackVaryingsPassToPS(input.vpass); + #endif + + UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(output); + return output; +} + + + + +VertexToPixel VertMesh(VertexData input) +{ + VertexToPixel output = (VertexToPixel)0; + + UNITY_SETUP_INSTANCE_ID(input); + UNITY_TRANSFER_INSTANCE_ID(input, output); + + + ChainModifyVertex(input, output, _Time); + + + // This return the camera relative position (if enable) + float3 positionRWS = TransformObjectToWorld(input.vertex.xyz); + float3 normalWS = TransformObjectToWorldNormal(input.normal); + float4 tangentWS = float4(TransformObjectToWorldDir(input.tangent.xyz), input.tangent.w); + + + output.worldPos = GetAbsolutePositionWS(positionRWS); + output.pos = TransformWorldToHClip(positionRWS); + output.worldNormal = normalWS; + output.worldTangent = tangentWS; + + + output.texcoord0 = input.texcoord0; + output.texcoord1 = input.texcoord1; + output.texcoord2 = input.texcoord2; + // #if %TEXCOORD3REQUIREKEY% + output.texcoord3 = input.texcoord3; + // #endif + + // #if %SCREENPOSREQUIREKEY% + // output.screenPos = ComputeScreenPos(output.pos, _ProjectionParams.x); + // #endif + + // #if %VERTEXCOLORREQUIREKEY% + output.vertexColor = input.vertexColor; + // #endif + return output; +} + + +#if (SHADERPASS == SHADERPASS_DBUFFER_MESH) +void MeshDecalsPositionZBias(inout VaryingsToPS input) +{ +#if defined(UNITY_REVERSED_Z) + input.vmesh.pos.z -= _DecalMeshDepthBias; +#else + input.vmesh.pos.z += _DecalMeshDepthBias; +#endif +} +#endif + + +#if (SHADERPASS == SHADERPASS_LIGHT_TRANSPORT) + +// This was not in constant buffer in original unity, so keep outiside. But should be in as ShaderRenderPass frequency +float unity_OneOverOutputBoost; +float unity_MaxOutputValue; + +CBUFFER_START(UnityMetaPass) +// x = use uv1 as raster position +// y = use uv2 as raster position +bool4 unity_MetaVertexControl; + +// x = return albedo +// y = return normal +bool4 unity_MetaFragmentControl; +CBUFFER_END + +PackedVaryingsToPS Vert(VertexData inputMesh) +{ + VaryingsToPS output = (VaryingsToPS)0; + output.vmesh = (VertexToPixel)0; + + UNITY_SETUP_INSTANCE_ID(inputMesh); + UNITY_TRANSFER_INSTANCE_ID(inputMesh, output.vmesh); + + // Output UV coordinate in vertex shader + float2 uv = float2(0.0, 0.0); + + if (unity_MetaVertexControl.x) + { + uv = inputMesh.texcoord1.xy * unity_LightmapST.xy + unity_LightmapST.zw; + } + else if (unity_MetaVertexControl.y) + { + uv = inputMesh.texcoord2.xy * unity_DynamicLightmapST.xy + unity_DynamicLightmapST.zw; + } + + // OpenGL right now needs to actually use the incoming vertex position + // so we create a fake dependency on it here that haven't any impact. + output.vmesh.pos = float4(uv * 2.0 - 1.0, inputMesh.vertex.z > 0 ? 1.0e-4 : 0.0, 1.0); + +#ifdef VARYINGS_NEED_POSITION_WS + output.vmesh.worldPos = TransformObjectToWorld(inputMesh.vertex.xyz); +#endif + +#ifdef VARYINGS_NEED_TANGENT_TO_WORLD + // Normal is required for triplanar mapping + output.vmesh.worldNormal = TransformObjectToWorldNormal(inputMesh.normal); + // Not required but assign to silent compiler warning + output.vmesh.worldTangent = float4(1.0, 0.0, 0.0, 0.0); +#endif + + output.vmesh.texcoord0 = inputMesh.texcoord0; + output.vmesh.texcoord1 = inputMesh.texcoord1; + output.vmesh.texcoord2 = inputMesh.texcoord2; + // #if %TEXCOORD3REQUIREKEY% + output.vmesh.texcoord3 = inputMesh.texcoord3; + // #endif + + // #if %VERTEXCOLORREQUIREKEY% + output.vmesh.vertexColor = inputMesh.vertexColor; + // #endif + + return PackVaryingsToPS(output); +} +#else + +PackedVaryingsToPS Vert(VertexData inputMesh) +{ + VaryingsToPS varyingsType; + varyingsType.vmesh = VertMesh(inputMesh); + #if (SHADERPASS == SHADERPASS_DBUFFER_MESH) + MeshDecalsPositionZBias(varyingsType); + #endif + return PackVaryingsToPS(varyingsType); +} + +#endif + + + + + + + FragInputs BuildFragInputs(VertexToPixel input) + { + UNITY_SETUP_INSTANCE_ID(input); + FragInputs output; + ZERO_INITIALIZE(FragInputs, output); + + // Init to some default value to make the computer quiet (else it output 'divide by zero' warning even if value is not used). + // TODO: this is a really poor workaround, but the variable is used in a bunch of places + // to compute normals which are then passed on elsewhere to compute other values... + output.tangentToWorld = k_identity3x3; + output.positionSS = input.pos; // input.positionCS is SV_Position + + output.positionRWS = GetCameraRelativePositionWS(input.worldPos); + output.tangentToWorld = BuildTangentToWorld(input.worldTangent, input.worldNormal); + output.texCoord0 = input.texcoord0; + output.texCoord1 = input.texcoord1; + output.texCoord2 = input.texcoord2; + + return output; + } + + void BuildSurfaceData(FragInputs fragInputs, inout Surface surfaceDescription, float3 V, PositionInputs posInput, out SurfaceData surfaceData, out float3 bentNormalWS) + { + // setup defaults -- these are used if the graph doesn't output a value + ZERO_INITIALIZE(SurfaceData, surfaceData); + + // specularOcclusion need to be init ahead of decal to quiet the compiler that modify the SurfaceData struct + // however specularOcclusion can come from the graph, so need to be init here so it can be override. + surfaceData.specularOcclusion = 1.0; + + // copy across graph values, if defined + surfaceData.baseColor = surfaceDescription.Albedo; + surfaceData.perceptualSmoothness = surfaceDescription.Smoothness; + surfaceData.ambientOcclusion = surfaceDescription.Occlusion; + surfaceData.specularOcclusion = surfaceDescription.SpecularOcclusion; + surfaceData.metallic = surfaceDescription.Metallic; + surfaceData.subsurfaceMask = surfaceDescription.SubsurfaceMask; + surfaceData.thickness = surfaceDescription.Thickness; + surfaceData.diffusionProfileHash = asuint(surfaceDescription.DiffusionProfileHash); + #if _USESPECULAR + surfaceData.specularColor = surfaceDescription.Specular; + #endif + surfaceData.coatMask = surfaceDescription.CoatMask; + surfaceData.anisotropy = surfaceDescription.Anisotropy; + surfaceData.iridescenceMask = surfaceDescription.IridescenceMask; + surfaceData.iridescenceThickness = surfaceDescription.IridescenceThickness; + + #ifdef _HAS_REFRACTION + if (_EnableSSRefraction) + { + // surfaceData.ior = surfaceDescription.RefractionIndex; + // surfaceData.transmittanceColor = surfaceDescription.RefractionColor; + // surfaceData.atDistance = surfaceDescription.RefractionDistance; + + surfaceData.transmittanceMask = (1.0 - surfaceDescription.Alpha); + surfaceDescription.Alpha = 1.0; + } + else + { + surfaceData.ior = surfaceDescription.ior; + surfaceData.transmittanceColor = surfaceDescription.transmittanceColor; + surfaceData.atDistance = surfaceDescription.atDistance; + surfaceData.transmittanceMask = surfaceDescription.transmittanceMask; + surfaceDescription.Alpha = 1.0; + } + #else + surfaceData.ior = 1.0; + surfaceData.transmittanceColor = float3(1.0, 1.0, 1.0); + surfaceData.atDistance = 1.0; + surfaceData.transmittanceMask = 0.0; + #endif + + // These static material feature allow compile time optimization + surfaceData.materialFeatures = MATERIALFEATUREFLAGS_LIT_STANDARD; + #ifdef _MATERIAL_FEATURE_SUBSURFACE_SCATTERING + surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_SUBSURFACE_SCATTERING; + #endif + #ifdef _MATERIAL_FEATURE_TRANSMISSION + surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_TRANSMISSION; + #endif + #ifdef _MATERIAL_FEATURE_ANISOTROPY + surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_ANISOTROPY; + #endif + // surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_CLEAR_COAT; + + #ifdef _MATERIAL_FEATURE_IRIDESCENCE + surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_IRIDESCENCE; + #endif + #ifdef _MATERIAL_FEATURE_SPECULAR_COLOR + surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_SPECULAR_COLOR; + #endif + + #if defined (_MATERIAL_FEATURE_SPECULAR_COLOR) && defined (_ENERGY_CONSERVING_SPECULAR) + // Require to have setup baseColor + // Reproduce the energy conservation done in legacy Unity. Not ideal but better for compatibility and users can unchek it + surfaceData.baseColor *= (1.0 - Max3(surfaceData.specularColor.r, surfaceData.specularColor.g, surfaceData.specularColor.b)); + #endif + + + // tangent-space normal + float3 normalTS = float3(0.0f, 0.0f, 1.0f); + normalTS = surfaceDescription.Normal; + + // compute world space normal + #if !_WORLDSPACENORMAL + surfaceData.normalWS = mul(normalTS, fragInputs.tangentToWorld); + #else + surfaceData.normalWS = normalTS; + #endif + surfaceData.geomNormalWS = fragInputs.tangentToWorld[2]; + + surfaceData.tangentWS = normalize(fragInputs.tangentToWorld[0].xyz); // The tangent is not normalize in tangentToWorld for mikkt. TODO: Check if it expected that we normalize with Morten. Tag: SURFACE_GRADIENT + // surfaceData.tangentWS = TransformTangentToWorld(surfaceDescription.Tangent, fragInputs.tangentToWorld); + + #if HAVE_DECALS + if (_EnableDecals) + { + #if VERSION_GREATER_EQUAL(10,2) + DecalSurfaceData decalSurfaceData = GetDecalSurfaceData(posInput, surfaceData.geomNormalWS, surfaceDescription.Alpha); + ApplyDecalToSurfaceData(decalSurfaceData, surfaceData.geomNormalWS, surfaceData); + #else + DecalSurfaceData decalSurfaceData = GetDecalSurfaceData(posInput, surfaceDescription.Alpha); + ApplyDecalToSurfaceData(decalSurfaceData, surfaceData); + #endif + } + #endif + + bentNormalWS = surfaceData.normalWS; + + surfaceData.tangentWS = Orthonormalize(surfaceData.tangentWS, surfaceData.normalWS); + + + // By default we use the ambient occlusion with Tri-ace trick (apply outside) for specular occlusion. + // If user provide bent normal then we process a better term + #if defined(_SPECULAR_OCCLUSION_CUSTOM) + // Just use the value passed through via the slot (not active otherwise) + #elif defined(_SPECULAR_OCCLUSION_FROM_AO_BENT_NORMAL) + // If we have bent normal and ambient occlusion, process a specular occlusion + surfaceData.specularOcclusion = GetSpecularOcclusionFromBentAO(V, bentNormalWS, surfaceData.normalWS, surfaceData.ambientOcclusion, PerceptualSmoothnessToPerceptualRoughness(surfaceData.perceptualSmoothness)); + #elif defined(_AMBIENT_OCCLUSION) && defined(_SPECULAR_OCCLUSION_FROM_AO) + surfaceData.specularOcclusion = GetSpecularOcclusionFromAmbientOcclusion(ClampNdotV(dot(surfaceData.normalWS, V)), surfaceData.ambientOcclusion, PerceptualSmoothnessToRoughness(surfaceData.perceptualSmoothness)); + #endif + + #ifdef _ENABLE_GEOMETRIC_SPECULAR_AA + surfaceData.perceptualSmoothness = GeometricNormalFiltering(surfaceData.perceptualSmoothness, fragInputs.tangentToWorld[2], surfaceDescription.SpecularAAScreenSpaceVariance, surfaceDescription.SpecularAAThreshold); + #endif + + #ifdef DEBUG_DISPLAY + if (_DebugMipMapMode != DEBUGMIPMAPMODE_NONE) + { + // TODO: need to update mip info + surfaceData.metallic = 0; + } + + // We need to call ApplyDebugToSurfaceData after filling the surfarcedata and before filling builtinData + // as it can modify attribute use for static lighting + ApplyDebugToSurfaceData(fragInputs.tangentToWorld, surfaceData); + #endif + } + + void GetSurfaceAndBuiltinData(VertexToPixel m2ps, FragInputs fragInputs, float3 V, inout PositionInputs posInput, + out SurfaceData surfaceData, out BuiltinData builtinData, inout Surface l, inout ShaderData d + #if NEED_FACING + , bool facing + #endif + ) + { + // Removed since crossfade does not work, probably needs extra material setup. + //#ifdef LOD_FADE_CROSSFADE // enable dithering LOD transition if user select CrossFade transition in LOD group + // uint3 fadeMaskSeed = asuint((int3)(V * _ScreenSize.xyx)); // Quantize V to _ScreenSize values + // LODDitheringTransition(fadeMaskSeed, unity_LODFade.x); + //#endif + + d = CreateShaderData(m2ps + #if NEED_FACING + , facing + #endif + ); + + + + l = (Surface)0; + + l.Albedo = half3(0.5, 0.5, 0.5); + l.Normal = float3(0,0,1); + l.Occlusion = 1; + l.Alpha = 1; + l.SpecularOcclusion = 1; + + #ifdef _DEPTHOFFSET_ON + l.outputDepth = posInput.deviceDepth; + #endif + + ChainSurfaceFunction(l, d); + + #ifdef _DEPTHOFFSET_ON + posInput.deviceDepth = l.outputDepth; + #endif + + #if _UNLIT + //l.Emission = l.Albedo; + //l.Albedo = 0; + l.Normal = half3(0,0,1); + l.Occlusion = 1; + l.Metallic = 0; + l.Specular = 0; + #endif + + surfaceData.geomNormalWS = d.worldSpaceNormal; + surfaceData.tangentWS = d.worldSpaceTangent; + fragInputs.tangentToWorld = d.TBNMatrix; + + float3 bentNormalWS; + BuildSurfaceData(fragInputs, l, V, posInput, surfaceData, bentNormalWS); + + InitBuiltinData(posInput, l.Alpha, bentNormalWS, -d.worldSpaceNormal, fragInputs.texCoord1, fragInputs.texCoord2, builtinData); + + + + builtinData.emissiveColor = l.Emission; + + #if defined(_OVERRIDE_BAKEDGI) + builtinData.bakeDiffuseLighting = l.DiffuseGI; + builtinData.backBakeDiffuseLighting = l.BackDiffuseGI; + builtinData.emissiveColor += l.SpecularGI; + #endif + + #if defined(_OVERRIDE_SHADOWMASK) + builtinData.shadowMask0 = l.ShadowMask.x; + builtinData.shadowMask1 = l.ShadowMask.y; + builtinData.shadowMask2 = l.ShadowMask.z; + builtinData.shadowMask3 = l.ShadowMask.w; + #endif + + #if (SHADERPASS == SHADERPASS_DISTORTION) + //builtinData.distortion = surfaceDescription.Distortion; + //builtinData.distortionBlur = surfaceDescription.DistortionBlur; + builtinData.distortion = float2(0.0, 0.0); + builtinData.distortionBlur = 0.0; + #else + builtinData.distortion = float2(0.0, 0.0); + builtinData.distortionBlur = 0.0; + #endif + + PostInitBuiltinData(V, posInput, surfaceData, builtinData); + } + + + void Frag(PackedVaryingsToPS packedInput, + #ifdef OUTPUT_SPLIT_LIGHTING + out float4 outColor : SV_Target0, // outSpecularLighting + out float4 outDiffuseLighting : SV_Target1, + OUTPUT_SSSBUFFER(outSSSBuffer) + #else + out float4 outColor : SV_Target0 + #ifdef _WRITE_TRANSPARENT_MOTION_VECTOR + , out float4 outMotionVec : SV_Target1 + #endif // _WRITE_TRANSPARENT_MOTION_VECTOR + #endif // OUTPUT_SPLIT_LIGHTING + #ifdef _DEPTHOFFSET_ON + , out float outputDepth : SV_Depth + #endif + #if NEED_FACING + , bool facing : SV_IsFrontFace + #endif + ) + { + #ifdef _WRITE_TRANSPARENT_MOTION_VECTOR + // Init outMotionVector here to solve compiler warning (potentially unitialized variable) + // It is init to the value of forceNoMotion (with 2.0) + outMotionVec = float4(2.0, 0.0, 0.0, 0.0); + #endif + + UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX(packedInput); + FragInputs input = BuildFragInputs(packedInput.vmesh); + + // We need to readapt the SS position as our screen space positions are for a low res buffer, but we try to access a full res buffer. + input.positionSS.xy = _OffScreenRendering > 0 ? (input.positionSS.xy * _OffScreenDownsampleFactor) : input.positionSS.xy; + + uint2 tileIndex = uint2(input.positionSS.xy) / GetTileSize(); + + // input.positionSS is SV_Position + PositionInputs posInput = GetPositionInput(input.positionSS.xy, _ScreenSize.zw, input.positionSS.z, input.positionSS.w, input.positionRWS.xyz, tileIndex); + + float3 V = GetWorldSpaceNormalizeViewDir(input.positionRWS); + + + SurfaceData surfaceData; + BuiltinData builtinData; + Surface l; + ShaderData d; + GetSurfaceAndBuiltinData(packedInput.vmesh, input, V, posInput, surfaceData, builtinData, l, d + #if NEED_FACING + , facing + #endif + ); + + BSDFData bsdfData = ConvertSurfaceDataToBSDFData(input.positionSS.xy, surfaceData); + + PreLightData preLightData = GetPreLightData(V, posInput, bsdfData); + + outColor = float4(0.0, 0.0, 0.0, 0.0); + + // We need to skip lighting when doing debug pass because the debug pass is done before lighting so some buffers may not be properly initialized potentially causing crashes on PS4. + + #ifdef DEBUG_DISPLAY + // Init in debug display mode to quiet warning + #ifdef OUTPUT_SPLIT_LIGHTING + outDiffuseLighting = 0; + ENCODE_INTO_SSSBUFFER(surfaceData, posInput.positionSS, outSSSBuffer); + #endif + + + + // Same code in ShaderPassForwardUnlit.shader + // Reminder: _DebugViewMaterialArray[i] + // i==0 -> the size used in the buffer + // i>0 -> the index used (0 value means nothing) + // The index stored in this buffer could either be + // - a gBufferIndex (always stored in _DebugViewMaterialArray[1] as only one supported) + // - a property index which is different for each kind of material even if reflecting the same thing (see MaterialSharedProperty) + bool viewMaterial = false; + int bufferSize = int(_DebugViewMaterialArray[0]); + if (bufferSize != 0) + { + bool needLinearToSRGB = false; + float3 result = float3(1.0, 0.0, 1.0); + + // Loop through the whole buffer + // Works because GetSurfaceDataDebug will do nothing if the index is not a known one + for (int index = 1; index <= bufferSize; index++) + { + int indexMaterialProperty = int(_DebugViewMaterialArray[index]); + + // skip if not really in use + if (indexMaterialProperty != 0) + { + viewMaterial = true; + + GetPropertiesDataDebug(indexMaterialProperty, result, needLinearToSRGB); + GetVaryingsDataDebug(indexMaterialProperty, input, result, needLinearToSRGB); + GetBuiltinDataDebug(indexMaterialProperty, builtinData, result, needLinearToSRGB); + GetSurfaceDataDebug(indexMaterialProperty, surfaceData, result, needLinearToSRGB); + GetBSDFDataDebug(indexMaterialProperty, bsdfData, result, needLinearToSRGB); + } + } + + // TEMP! + // For now, the final blit in the backbuffer performs an sRGB write + // So in the meantime we apply the inverse transform to linear data to compensate. + if (!needLinearToSRGB) + result = SRGBToLinear(max(0, result)); + + outColor = float4(result, 1.0); + } + + if (!viewMaterial) + { + if (_DebugFullScreenMode == FULLSCREENDEBUGMODE_VALIDATE_DIFFUSE_COLOR || _DebugFullScreenMode == FULLSCREENDEBUGMODE_VALIDATE_SPECULAR_COLOR) + { + float3 result = float3(0.0, 0.0, 0.0); + + GetPBRValidatorDebug(surfaceData, result); + + outColor = float4(result, 1.0f); + } + else if (_DebugFullScreenMode == FULLSCREENDEBUGMODE_TRANSPARENCY_OVERDRAW) + { + float4 result = _DebugTransparencyOverdrawWeight * float4(TRANSPARENCY_OVERDRAW_COST, TRANSPARENCY_OVERDRAW_COST, TRANSPARENCY_OVERDRAW_COST, TRANSPARENCY_OVERDRAW_A); + outColor = result; + } + else + #endif + { + #ifdef _SURFACE_TYPE_TRANSPARENT + uint featureFlags = LIGHT_FEATURE_MASK_FLAGS_TRANSPARENT; + #else + uint featureFlags = LIGHT_FEATURE_MASK_FLAGS_OPAQUE; + #endif + + float3 diffuseLighting; + float3 specularLighting; + + #if (SHADER_LIBRARY_VERSION_MAJOR >= 10) + { + LightLoopOutput lightLoopOutput; + LightLoop(V, posInput, preLightData, bsdfData, builtinData, featureFlags, lightLoopOutput); + + // Alias + diffuseLighting = lightLoopOutput.diffuseLighting; + specularLighting = lightLoopOutput.specularLighting; + } + #else + { + LightLoop(V, posInput, preLightData, bsdfData, builtinData, featureFlags, diffuseLighting, specularLighting); + } + #endif + + diffuseLighting *= GetCurrentExposureMultiplier(); + specularLighting *= GetCurrentExposureMultiplier(); + + #ifdef OUTPUT_SPLIT_LIGHTING + if (_EnableSubsurfaceScattering != 0 && ShouldOutputSplitLighting(bsdfData)) + { + outColor = float4(specularLighting, 1.0); + outDiffuseLighting = float4(TagLightingForSSS(diffuseLighting), 1.0); + } + else + { + outColor = float4(diffuseLighting + specularLighting, 1.0); + outDiffuseLighting = 0; + } + ENCODE_INTO_SSSBUFFER(surfaceData, posInput.positionSS, outSSSBuffer); + #else + outColor = ApplyBlendMode(diffuseLighting, specularLighting, builtinData.opacity); + outColor = EvaluateAtmosphericScattering(posInput, V, outColor); + #endif + + ChainFinalColorForward(l, d, outColor); + + #ifdef _WRITE_TRANSPARENT_MOTION_VECTOR + VaryingsPassToPS inputPass = UnpackVaryingsPassToPS(packedInput.vpass); + bool forceNoMotion = any(unity_MotionVectorsParams.yw == 0.0); + // outMotionVec is already initialize at the value of forceNoMotion (see above) + if (!forceNoMotion) + { + float2 motionVec = CalculateMotionVector(inputPass.positionCS, inputPass.previousPositionCS); + EncodeMotionVector(motionVec * 0.5, outMotionVec); + outMotionVec.zw = 1.0; + } + #endif + } + + #ifdef DEBUG_DISPLAY + } + #endif + + #ifdef _DEPTHOFFSET_ON + outputDepth = posInput.deviceDepth; + #endif + } + + ENDHLSL + } + + Pass + { + // based on HDLitPass.template + Name "GBuffer" + Tags { "LightMode" = "GBuffer" } + //------------------------------------------------------------------------------------- + // Render Modes (Blend, Cull, ZTest, Stencil, etc) + //------------------------------------------------------------------------------------- + + Cull Back + + ZTest [_ZTestGBuffer] + + + + // Stencil setup + Stencil + { + WriteMask [_StencilWriteMaskGBuffer] + Ref [_StencilRefGBuffer] + Comp Always + Pass Replace + } + Tags { "RenderType" = "Opaque" "Queue" = "Geometry" "PreviewType" = "Plane" } + Cull [_CullingOption] + ZWrite [_ZWrite] + ZTest [_ZTestMode] + + + //------------------------------------------------------------------------------------- + // End Render Modes + //------------------------------------------------------------------------------------- + + HLSLPROGRAM + + #pragma target 4.5 + #pragma only_renderers d3d11 ps4 xboxone vulkan metal switch + //#pragma enable_d3d11_debug_symbols + + #pragma multi_compile_instancing + + //#pragma multi_compile_local _ _ALPHATEST_ON + + //#pragma shader_feature _SURFACE_TYPE_TRANSPARENT + //#pragma shader_feature_local _ _BLENDMODE_ALPHA _BLENDMODE_ADD _BLENDMODE_PRE_MULTIPLY + + //------------------------------------------------------------------------------------- + // Variant Definitions (active field translations to HDRP defines) + //------------------------------------------------------------------------------------- + // #define _MATERIAL_FEATURE_SUBSURFACE_SCATTERING 1 + // #define _MATERIAL_FEATURE_TRANSMISSION 1 + // #define _MATERIAL_FEATURE_ANISOTROPY 1 + // #define _MATERIAL_FEATURE_IRIDESCENCE 1 + // #define _MATERIAL_FEATURE_SPECULAR_COLOR 1 + #define _ENABLE_FOG_ON_TRANSPARENT 1 + // #define _AMBIENT_OCCLUSION 1 + // #define _SPECULAR_OCCLUSION_FROM_AO 1 + // #define _SPECULAR_OCCLUSION_FROM_AO_BENT_NORMAL 1 + // #define _SPECULAR_OCCLUSION_CUSTOM 1 + // #define _ENERGY_CONSERVING_SPECULAR 1 + // #define _ENABLE_GEOMETRIC_SPECULAR_AA 1 + // #define _HAS_REFRACTION 1 + // #define _REFRACTION_PLANE 1 + // #define _REFRACTION_SPHERE 1 + // #define _DISABLE_DECALS 1 + // #define _DISABLE_SSR 1 + // #define _ADD_PRECOMPUTED_VELOCITY + // #define _WRITE_TRANSPARENT_MOTION_VECTOR 1 + // #define _DEPTHOFFSET_ON 1 + // #define _BLENDMODE_PRESERVE_SPECULAR_LIGHTING 1 + + #define _PASSGBUFFER 1 + + + #pragma shader_feature_local GLOW_ON + #pragma shader_feature_local FADE_ON + #pragma shader_feature_local OUTBASE_ON + #pragma shader_feature_local ONLYOUTLINE_ON + #pragma shader_feature_local GRADIENT_ON + #pragma shader_feature_local GRADIENT2COL_ON + #pragma shader_feature_local RADIALGRADIENT_ON + #pragma shader_feature_local COLORSWAP_ON + #pragma shader_feature_local HSV_ON + #pragma shader_feature_local CHANGECOLOR_ON + #pragma shader_feature_local CHANGECOLOR2_ON + #pragma shader_feature_local CHANGECOLOR3_ON + #pragma shader_feature_local COLORRAMP_ON + #pragma shader_feature_local GRADIENTCOLORRAMP_ON + #pragma shader_feature_local HITEFFECT_ON + #pragma shader_feature_local NEGATIVE_ON + #pragma shader_feature_local PIXELATE_ON + #pragma shader_feature_local GREYSCALE_ON + #pragma shader_feature_local POSTERIZE_ON + #pragma shader_feature_local BLUR_ON + #pragma shader_feature_local MOTIONBLUR_ON + #pragma shader_feature_local GHOST_ON + #pragma shader_feature_local ALPHAOUTLINE_ON + #pragma shader_feature_local INNEROUTLINE_ON + #pragma shader_feature_local ONLYINNEROUTLINE_ON + #pragma shader_feature_local HOLOGRAM_ON + #pragma shader_feature_local CHROMABERR_ON + #pragma shader_feature_local GLITCH_ON + #pragma shader_feature_local FLICKER_ON + #pragma shader_feature_local SHADOW_ON + #pragma shader_feature_local SHINE_ON + #pragma shader_feature_local CONTRAST_ON + #pragma shader_feature_local OVERLAY_ON + #pragma shader_feature_local OVERLAYMULT_ON + #pragma shader_feature_local DOODLE_ON + #pragma shader_feature_local WIND_ON + #pragma shader_feature_local WAVEUV_ON + #pragma shader_feature_local ROUNDWAVEUV_ON + #pragma shader_feature_local RECTSIZE_ON + #pragma shader_feature_local OFFSETUV_ON + #pragma shader_feature_local CLIPPING_ON + #pragma shader_feature_local RADIALCLIPPING_ON + #pragma shader_feature_local TEXTURESCROLL_ON + #pragma shader_feature_local ZOOMUV_ON + #pragma shader_feature_local DISTORT_ON + #pragma shader_feature_local WARP_ON + #pragma shader_feature_local TWISTUV_ON + #pragma shader_feature_local ROTATEUV_ON + #pragma shader_feature_local POLARUV_ON + #pragma shader_feature_local FISHEYE_ON + #pragma shader_feature_local PINCH_ON + #pragma shader_feature_local SHAKEUV_ON + + #pragma shader_feature_local GLOWTEX_ON + #pragma shader_feature_local OUTTEX_ON + #pragma shader_feature_local OUTDIST_ON + #pragma shader_feature_local OUTBASE8DIR_ON + #pragma shader_feature_local OUTBASEPIXELPERF_ON + #pragma shader_feature_local COLORRAMPOUTLINE_ON + #pragma shader_feature_local GREYSCALEOUTLINE_ON + #pragma shader_feature_local POSTERIZEOUTLINE_ON + #pragma shader_feature_local BLURISHD_ON + #pragma shader_feature_local MANUALWIND_ON + #pragma shader_feature_local ATLAS_ON + #pragma shader_feature_local PREMULTIPLYALPHA_ON + + #pragma shader_feature BILBOARD_ON + #pragma shader_feature BILBOARDY_ON + + #pragma shader_feature NORMALMAP_ON + + + #define _HDRP 1 +#define _USINGTEXCOORD1 1 +#define _USINGTEXCOORD2 1 + + + #pragma vertex Vert + #pragma fragment Frag + + + //------------------------------------------------------------------------------------- + // Defines + //------------------------------------------------------------------------------------- + #define SHADERPASS SHADERPASS_GBUFFER + #pragma multi_compile _ DEBUG_DISPLAY + #pragma multi_compile _ LIGHTMAP_ON + #pragma multi_compile _ DIRLIGHTMAP_COMBINED + #pragma multi_compile _ DYNAMICLIGHTMAP_ON + #pragma multi_compile _ SHADOWS_SHADOWMASK + #pragma multi_compile DECALS_OFF DECALS_3RT DECALS_4RT + #pragma multi_compile _ LIGHT_LAYERS + #define RAYTRACING_SHADER_GRAPH_HIGH + #define REQUIRE_DEPTH_TEXTURE + + + // useful conversion functions to make surface shader code just work + + #define UNITY_DECLARE_TEX2D(name) TEXTURE2D(name); SAMPLER(sampler##name); + #define UNITY_DECLARE_TEX2D_NOSAMPLER(name) TEXTURE2D(name); + #define UNITY_DECLARE_TEX2DARRAY(name) TEXTURE2D_ARRAY(name); SAMPLER(sampler##name); + #define UNITY_DECLARE_TEX2DARRAY_NOSAMPLER(tex) TEXTURE2D_ARRAY(tex); + + #define UNITY_SAMPLE_TEX2DARRAY(tex,coord) SAMPLE_TEXTURE2D_ARRAY(tex, sampler##tex, coord.xy, coord.z) + #define UNITY_SAMPLE_TEX2DARRAY_LOD(tex,coord,lod) SAMPLE_TEXTURE2D_ARRAY_LOD(tex, sampler##tex, coord.xy, coord.z, lod) + #define UNITY_SAMPLE_TEX2D(tex, coord) SAMPLE_TEXTURE2D(tex, sampler##tex, coord) + #define UNITY_SAMPLE_TEX2D_SAMPLER(tex, samp, coord) SAMPLE_TEXTURE2D(tex, sampler##samp, coord) + + #define UNITY_SAMPLE_TEX2D_LOD(tex,coord, lod) SAMPLE_TEXTURE2D_LOD(tex, sampler_##tex, coord, lod) + #define UNITY_SAMPLE_TEX2D_SAMPLER_LOD(tex,samplertex,coord, lod) SAMPLE_TEXTURE2D_LOD (tex, sampler##samplertex,coord, lod) + + #if defined(UNITY_COMPILER_HLSL) + #define UNITY_INITIALIZE_OUTPUT(type,name) name = (type)0; + #else + #define UNITY_INITIALIZE_OUTPUT(type,name) + #endif + + #define sampler2D_float sampler2D + #define sampler2D_half sampler2D + + #undef WorldNormalVector + #define WorldNormalVector(data, normal) mul(normal, data.TBNMatrix) + + #define UnityObjectToWorldNormal(normal) mul(GetObjectToWorldMatrix(), normal) + + + + +// HDRP Adapter stuff + + + // If we use subsurface scattering, enable output split lighting (for forward pass) + #if defined(_MATERIAL_FEATURE_SUBSURFACE_SCATTERING) && !defined(_SURFACE_TYPE_TRANSPARENT) + #define OUTPUT_SPLIT_LIGHTING + #endif + + #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Version.hlsl" + #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Common.hlsl" + + #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/NormalSurfaceGradient.hlsl" + + // define FragInputs structure + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/ShaderPass/FragInputs.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/ShaderPass/ShaderPass.cs.hlsl" + #if (SHADER_LIBRARY_VERSION_MAJOR >= 10) + #include "Packages/com.unity.shadergraph/ShaderGraphLibrary/Functions.hlsl" + #endif + + + + + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/ShaderVariables.hlsl" + #ifdef DEBUG_DISPLAY + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Debug/DebugDisplay.hlsl" + #endif + + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/Material.hlsl" + + #if (SHADERPASS == SHADERPASS_FORWARD) + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Lighting/Lighting.hlsl" + + #define HAS_LIGHTLOOP + + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Lighting/LightLoop/LightLoopDef.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/Lit/Lit.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Lighting/LightLoop/LightLoop.hlsl" + #else + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/Lit/Lit.hlsl" + #endif + + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/BuiltinUtilities.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/MaterialUtilities.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/Decal/DecalUtilities.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/Lit/LitDecalData.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/ShaderGraphFunctions.hlsl" + + // Used by SceneSelectionPass + int _ObjectId; + int _PassValue; + + + // data across stages, stripped like the above. + struct VertexToPixel + { + float4 pos : SV_POSITION; + float3 worldPos : TEXCOORD0; + float3 worldNormal : TEXCOORD1; + float4 worldTangent : TEXCOORD2; + float4 texcoord0 : TEXCOORD3; + float4 texcoord1 : TEXCOORD4; + float4 texcoord2 : TEXCOORD5; + + // #if %TEXCOORD3REQUIREKEY% + float4 texcoord3 : TEXCOORD6; + // #endif + + // #if %SCREENPOSREQUIREKEY% + // float4 screenPos : TEXCOORD7; + // #endif + + // #if %VERTEXCOLORREQUIREKEY% + float4 vertexColor : COLOR; + // #endif + + // #if %EXTRAV2F0REQUIREKEY% + // float4 extraV2F0 : TEXCOORD8; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // float4 extraV2F1 : TEXCOORD9; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // float4 extraV2F2 : TEXCOORD10; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // float4 extraV2F3 : TEXCOORD11; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // float4 extraV2F4 : TEXCOORD12; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // float4 extraV2F5 : TEXCOORD13; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // float4 extraV2F6 : TEXCOORD14; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // float4 extraV2F7 : TEXCOORD15; + // #endif + + #if UNITY_ANY_INSTANCING_ENABLED + UNITY_VERTEX_INPUT_INSTANCE_ID + #endif // UNITY_ANY_INSTANCING_ENABLED + + UNITY_VERTEX_OUTPUT_STEREO + }; + + + + + + // data describing the user output of a pixel + struct Surface + { + half3 Albedo; + half Height; + half3 Normal; + half Smoothness; + half3 Emission; + half Metallic; + half3 Specular; + half Occlusion; + half SpecularPower; // for simple lighting + half Alpha; + float outputDepth; // if written, SV_Depth semantic is used. ShaderData.clipPos.z is unused value + // HDRP Only + half SpecularOcclusion; + half SubsurfaceMask; + half Thickness; + half CoatMask; + half CoatSmoothness; + half Anisotropy; + half IridescenceMask; + half IridescenceThickness; + int DiffusionProfileHash; + float SpecularAAThreshold; + float SpecularAAScreenSpaceVariance; + // requires _OVERRIDE_BAKEDGI to be defined, but is mapped in all pipelines + float3 DiffuseGI; + float3 BackDiffuseGI; + float3 SpecularGI; + float ior; + float3 transmittanceColor; + float atDistance; + float transmittanceMask; + // requires _OVERRIDE_SHADOWMASK to be defines + float4 ShadowMask; + + // for decals + float NormalAlpha; + float MAOSAlpha; + + + }; + + // Data the user declares in blackboard blocks + struct Blackboard + { + + float blackboardDummyData; + }; + + // data the user might need, this will grow to be big. But easy to strip + struct ShaderData + { + float4 clipPos; // SV_POSITION + float3 localSpacePosition; + float3 localSpaceNormal; + float3 localSpaceTangent; + + float3 worldSpacePosition; + float3 worldSpaceNormal; + float3 worldSpaceTangent; + float tangentSign; + + float3 worldSpaceViewDir; + float3 tangentSpaceViewDir; + + float4 texcoord0; + float4 texcoord1; + float4 texcoord2; + float4 texcoord3; + + float2 screenUV; + float4 screenPos; + + float4 vertexColor; + bool isFrontFace; + + float4 extraV2F0; + float4 extraV2F1; + float4 extraV2F2; + float4 extraV2F3; + float4 extraV2F4; + float4 extraV2F5; + float4 extraV2F6; + float4 extraV2F7; + + float3x3 TBNMatrix; + Blackboard blackboard; + }; + + struct VertexData + { + #if SHADER_TARGET > 30 + // uint vertexID : SV_VertexID; + #endif + float4 vertex : POSITION; + float3 normal : NORMAL; + float4 tangent : TANGENT; + float4 texcoord0 : TEXCOORD0; + + // optimize out mesh coords when not in use by user or lighting system + #if _URP && (_USINGTEXCOORD1 || _PASSMETA || _PASSFORWARD || _PASSGBUFFER) + float4 texcoord1 : TEXCOORD1; + #endif + + #if _URP && (_USINGTEXCOORD2 || _PASSMETA || ((_PASSFORWARD || _PASSGBUFFER) && defined(DYNAMICLIGHTMAP_ON))) + float4 texcoord2 : TEXCOORD2; + #endif + + #if _STANDARD && (_USINGTEXCOORD1 || (_PASSMETA || ((_PASSFORWARD || _PASSGBUFFER || _PASSFORWARDADD) && LIGHTMAP_ON))) + float4 texcoord1 : TEXCOORD1; + #endif + #if _STANDARD && (_USINGTEXCOORD2 || (_PASSMETA || ((_PASSFORWARD || _PASSGBUFFER) && DYNAMICLIGHTMAP_ON))) + float4 texcoord2 : TEXCOORD2; + #endif + + + #if _HDRP + float4 texcoord1 : TEXCOORD1; + float4 texcoord2 : TEXCOORD2; + #endif + + // #if %TEXCOORD3REQUIREKEY% + float4 texcoord3 : TEXCOORD3; + // #endif + + // #if %VERTEXCOLORREQUIREKEY% + float4 vertexColor : COLOR; + // #endif + + #if _PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR)) + float3 previousPositionOS : TEXCOORD4; // Contain previous transform position (in case of skinning for example) + #if defined (_ADD_PRECOMPUTED_VELOCITY) + float3 precomputedVelocity : TEXCOORD5; // Add Precomputed Velocity (Alembic computes velocities on runtime side). + #endif + #endif + + UNITY_VERTEX_INPUT_INSTANCE_ID + }; + + struct TessVertex + { + float4 vertex : INTERNALTESSPOS; + float3 normal : NORMAL; + float4 tangent : TANGENT; + float4 texcoord0 : TEXCOORD0; + float4 texcoord1 : TEXCOORD1; + float4 texcoord2 : TEXCOORD2; + + // #if %TEXCOORD3REQUIREKEY% + float4 texcoord3 : TEXCOORD3; + // #endif + + // #if %VERTEXCOLORREQUIREKEY% + float4 vertexColor : COLOR; + // #endif + + // #if %EXTRAV2F0REQUIREKEY% + // float4 extraV2F0 : TEXCOORD5; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // float4 extraV2F1 : TEXCOORD6; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // float4 extraV2F2 : TEXCOORD7; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // float4 extraV2F3 : TEXCOORD8; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // float4 extraV2F4 : TEXCOORD9; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // float4 extraV2F5 : TEXCOORD10; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // float4 extraV2F6 : TEXCOORD11; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // float4 extraV2F7 : TEXCOORD12; + // #endif + + #if _PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR)) + float3 previousPositionOS : TEXCOORD13; // Contain previous transform position (in case of skinning for example) + #if defined (_ADD_PRECOMPUTED_VELOCITY) + float3 precomputedVelocity : TEXCOORD14; + #endif + #endif + + UNITY_VERTEX_INPUT_INSTANCE_ID + UNITY_VERTEX_OUTPUT_STEREO + }; + + struct ExtraV2F + { + float4 extraV2F0; + float4 extraV2F1; + float4 extraV2F2; + float4 extraV2F3; + float4 extraV2F4; + float4 extraV2F5; + float4 extraV2F6; + float4 extraV2F7; + Blackboard blackboard; + float4 time; + }; + + + float3 WorldToTangentSpace(ShaderData d, float3 normal) + { + return mul(d.TBNMatrix, normal); + } + + float3 TangentToWorldSpace(ShaderData d, float3 normal) + { + return mul(normal, d.TBNMatrix); + } + + // in this case, make standard more like SRPs, because we can't fix + // unity_WorldToObject in HDRP, since it already does macro-fu there + + #if _STANDARD + float3 TransformWorldToObject(float3 p) { return mul(unity_WorldToObject, float4(p, 1)); }; + float3 TransformObjectToWorld(float3 p) { return mul(unity_ObjectToWorld, float4(p, 1)); }; + float4 TransformWorldToObject(float4 p) { return mul(unity_WorldToObject, p); }; + float4 TransformObjectToWorld(float4 p) { return mul(unity_ObjectToWorld, p); }; + float4x4 GetWorldToObjectMatrix() { return unity_WorldToObject; } + float4x4 GetObjectToWorldMatrix() { return unity_ObjectToWorld; } + #if (defined(SHADER_API_D3D11) || defined(SHADER_API_XBOXONE) || defined(UNITY_COMPILER_HLSLCC) || defined(SHADER_API_PSSL) || (SHADER_TARGET_SURFACE_ANALYSIS && !SHADER_TARGET_SURFACE_ANALYSIS_MOJOSHADER)) + #define UNITY_SAMPLE_TEX2D_LOD(tex,coord, lod) tex.SampleLevel (sampler##tex,coord, lod) + #define UNITY_SAMPLE_TEX2D_SAMPLER_LOD(tex,samplertex,coord, lod) tex.SampleLevel (sampler##samplertex,coord, lod) + #else + #define UNITY_SAMPLE_TEX2D_LOD(tex,coord,lod) tex2D (tex,coord,0,lod) + #define UNITY_SAMPLE_TEX2D_SAMPLER_LOD(tex,samplertex,coord,lod) tex2D (tex,coord,0,lod) + #endif + + #undef GetWorldToObjectMatrix() + + #define GetWorldToObjectMatrix() unity_WorldToObject + + + #endif + + float3 GetCameraWorldPosition() + { + #if _HDRP + return GetCameraRelativePositionWS(_WorldSpaceCameraPos); + #else + return _WorldSpaceCameraPos; + #endif + } + + #if _GRABPASSUSED + #if _STANDARD + TEXTURE2D(%GRABTEXTURE%); + SAMPLER(sampler_%GRABTEXTURE%); + #endif + + half3 GetSceneColor(float2 uv) + { + #if _STANDARD + return SAMPLE_TEXTURE2D(%GRABTEXTURE%, sampler_%GRABTEXTURE%, uv).rgb; + #else + return SHADERGRAPH_SAMPLE_SCENE_COLOR(uv); + #endif + } + #endif + + + + #if _STANDARD + UNITY_DECLARE_DEPTH_TEXTURE(_CameraDepthTexture); + float GetSceneDepth(float2 uv) { return SAMPLE_DEPTH_TEXTURE(_CameraDepthTexture, uv); } + float GetLinear01Depth(float2 uv) { return Linear01Depth(GetSceneDepth(uv)); } + float GetLinearEyeDepth(float2 uv) { return LinearEyeDepth(GetSceneDepth(uv)); } + #else + float GetSceneDepth(float2 uv) { return SHADERGRAPH_SAMPLE_SCENE_DEPTH(uv); } + float GetLinear01Depth(float2 uv) { return Linear01Depth(GetSceneDepth(uv), _ZBufferParams); } + float GetLinearEyeDepth(float2 uv) { return LinearEyeDepth(GetSceneDepth(uv), _ZBufferParams); } + #endif + + float3 GetWorldPositionFromDepthBuffer(float2 uv, float3 worldSpaceViewDir) + { + float eye = GetLinearEyeDepth(uv); + float3 camView = mul((float3x3)GetObjectToWorldMatrix(), transpose(mul(GetWorldToObjectMatrix(), UNITY_MATRIX_I_V)) [2].xyz); + + float dt = dot(worldSpaceViewDir, camView); + float3 div = worldSpaceViewDir/dt; + float3 wpos = (eye * div) + GetCameraWorldPosition(); + return wpos; + } + + #if _HDRP + float3 ObjectToWorldSpacePosition(float3 pos) + { + return GetAbsolutePositionWS(TransformObjectToWorld(pos)); + } + #else + float3 ObjectToWorldSpacePosition(float3 pos) + { + return TransformObjectToWorld(pos); + } + #endif + + #if _STANDARD + UNITY_DECLARE_SCREENSPACE_TEXTURE(_CameraDepthNormalsTexture); + float3 GetSceneNormal(float2 uv, float3 worldSpaceViewDir) + { + float4 depthNorms = UNITY_SAMPLE_SCREENSPACE_TEXTURE(_CameraDepthNormalsTexture, uv); + float3 norms = DecodeViewNormalStereo(depthNorms); + norms = mul((float3x3)GetWorldToViewMatrix(), norms) * 0.5 + 0.5; + return norms; + } + #elif _HDRP && !_DECALSHADER + + float3 GetSceneNormal(float2 uv, float3 worldSpaceViewDir) + { + NormalData nd; + DecodeFromNormalBuffer(_ScreenSize.xy * uv, nd); + return nd.normalWS; + } + #elif _URP + #if (SHADER_LIBRARY_VERSION_MAJOR >= 10) + #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/DeclareNormalsTexture.hlsl" + #endif + + float3 GetSceneNormal(float2 uv, float3 worldSpaceViewDir) + { + #if (SHADER_LIBRARY_VERSION_MAJOR >= 10) + return SampleSceneNormals(uv); + #else + float3 wpos = GetWorldPositionFromDepthBuffer(uv, worldSpaceViewDir); + return normalize(-cross(ddx(wpos), ddy(wpos))) * 0.5 + 0.5; + #endif + + } + #endif + + #if _HDRP + + half3 UnpackNormalmapRGorAG(half4 packednormal) + { + // This do the trick + packednormal.x *= packednormal.w; + + half3 normal; + normal.xy = packednormal.xy * 2 - 1; + normal.z = sqrt(1 - saturate(dot(normal.xy, normal.xy))); + return normal; + } + half3 UnpackNormal(half4 packednormal) + { + #if defined(UNITY_NO_DXT5nm) + return packednormal.xyz * 2 - 1; + #else + return UnpackNormalmapRGorAG(packednormal); + #endif + } + #endif + #if _HDRP || _URP + + half3 UnpackScaleNormal(half4 packednormal, half scale) + { + #ifndef UNITY_NO_DXT5nm + // Unpack normal as DXT5nm (1, y, 1, x) or BC5 (x, y, 0, 1) + // Note neutral texture like "bump" is (0, 0, 1, 1) to work with both plain RGB normal and DXT5nm/BC5 + packednormal.x *= packednormal.w; + #endif + half3 normal; + normal.xy = (packednormal.xy * 2 - 1) * scale; + normal.z = sqrt(1 - saturate(dot(normal.xy, normal.xy))); + return normal; + } + + #endif + + + void GetSun(out float3 lightDir, out float3 color) + { + lightDir = float3(0.5, 0.5, 0); + color = 1; + #if _HDRP + if (_DirectionalLightCount > 0) + { + DirectionalLightData light = _DirectionalLightDatas[0]; + lightDir = -light.forward.xyz; + color = light.color; + } + #elif _STANDARD + lightDir = normalize(_WorldSpaceLightPos0.xyz); + color = _LightColor0.rgb; + #elif _URP + Light light = GetMainLight(); + lightDir = light.direction; + color = light.color; + #endif + } + + + + + CBUFFER_START(UnityPerMaterial) + float _StencilRef; + float _StencilWriteMask; + float _StencilRefDepth; + float _StencilWriteMaskDepth; + float _StencilRefMV; + float _StencilWriteMaskMV; + float _StencilRefDistortionVec; + float _StencilWriteMaskDistortionVec; + float _StencilWriteMaskGBuffer; + float _StencilRefGBuffer; + float _ZTestGBuffer; + float _RequireSplitLighting; + float _ReceivesSSR; + float _ZWrite; + float _TransparentSortPriority; + float _ZTestDepthEqualForOpaque; + float _ZTestTransparent; + float _TransparentBackfaceEnable; + float _AlphaCutoffEnable; + float _UseShadowThreshold; + + + half4 _Color; + half4 _MainTex_ST, _MainTex_TexelSize; + half _Alpha, _AlphaCutoffValue; + + #if ATLAS_ON + half _MinXUV, _MaxXUV, _MinYUV, _MaxYUV; + #endif + + #if GLOW_ON + half4 _GlowColor; + half _Glow, _GlowGlobal; + #endif + + #if HSV_ON + half _HsvShift, _HsvSaturation, _HsvBright; + #endif + + #if DISTORT_ON + half4 _DistortTex_ST; + half _DistortTexXSpeed, _DistortTexYSpeed, _DistortAmount; + #endif + + #if FADE_ON + half4 _FadeBurnColor, _FadeTex_ST, _FadeBurnTex_ST; + half _FadeAmount, _FadeBurnWidth, _FadeBurnTransition,_FadeBurnGlow; + #endif + + #if OUTBASE_ON + half4 _OutlineColor; + half _OutlineAlpha, _OutlineGlow, _OutlineWidth; + int _OutlinePixelWidth; + #endif + + #if OUTTEX_ON + half4 _OutlineTex_ST; + half _OutlineTexXSpeed, _OutlineTexYSpeed; + #endif + + #if OUTDIST_ON + half4 _OutlineDistortTex_ST; + half _OutlineDistortTexXSpeed, _OutlineDistortTexYSpeed, _OutlineDistortAmount; + #endif + + #if ALPHAOUTLINE_ON + half _AlphaOutlineGlow, _AlphaOutlinePower, _AlphaOutlineMinAlpha, _AlphaOutlineBlend; + half4 _AlphaOutlineColor; + #endif + + #if INNEROUTLINE_ON + half _InnerOutlineThickness, _InnerOutlineAlpha, _InnerOutlineGlow; + half4 _InnerOutlineColor; + #endif + + #if GRADIENT_ON + half _GradBlend, _GradBoostX, _GradBoostY; + half4 _GradTopRightCol, _GradTopLeftCol, _GradBotRightCol, _GradBotLeftCol; + #endif + + #if COLORSWAP_ON + half4 _ColorSwapRed, _ColorSwapGreen, _ColorSwapBlue; + half _ColorSwapRedLuminosity, _ColorSwapGreenLuminosity, _ColorSwapBlueLuminosity, _ColorSwapBlend; + #endif + + #if CHANGECOLOR_ON + half4 _ColorChangeNewCol, _ColorChangeTarget; + half _ColorChangeTolerance, _ColorChangeLuminosity; + #endif + #if CHANGECOLOR2_ON + half4 _ColorChangeNewCol2, _ColorChangeTarget2; + half _ColorChangeTolerance2; + #endif + #if CHANGECOLOR3_ON + half4 _ColorChangeNewCol3, _ColorChangeTarget3; + half _ColorChangeTolerance3; + #endif + + #if COLORRAMP_ON + half _ColorRampLuminosity, _ColorRampBlend; + #endif + + #if HITEFFECT_ON + half4 _HitEffectColor; + half _HitEffectGlow, _HitEffectBlend; + #endif + + #if NEGATIVE_ON + half _NegativeAmount; + #endif + + #if PIXELATE_ON + half _PixelateSize; + #endif + + #if GREYSCALE_ON + half _GreyscaleLuminosity, _GreyscaleBlend; + half4 _GreyscaleTintColor; + #endif + + #if POSTERIZE_ON + half _PosterizeNumColors, _PosterizeGamma; + #endif + + #if BLUR_ON + half _BlurIntensity; + #endif + + #if MOTIONBLUR_ON + half _MotionBlurAngle, _MotionBlurDist; + #endif + + #if GHOST_ON + half _GhostColorBoost, _GhostTransparency, _GhostBlend; + #endif + + #if HOLOGRAM_ON + half _HologramStripesAmount, _HologramMinAlpha, _HologramUnmodAmount, _HologramStripesSpeed, _HologramMaxAlpha, _HologramBlend; + half4 _HologramStripeColor; + #endif + + #if CHROMABERR_ON + half _ChromAberrAmount, _ChromAberrAlpha; + #endif + + #if GLITCH_ON + half _GlitchAmount, _GlitchSize; + #endif + + #if FLICKER_ON + half _FlickerFreq, _FlickerPercent, _FlickerAlpha; + #endif + + #if SHADOW_ON + half _ShadowX, _ShadowY, _ShadowAlpha; + half4 _ShadowColor; + #endif + + #if SHINE_ON + half4 _ShineColor; + half _ShineLocation, _ShineRotate, _ShineWidth, _ShineGlow; + #endif + + #if CONTRAST_ON + half _Contrast, _Brightness; + #endif + + #if OVERLAY_ON + half4 _OverlayTex_ST, _OverlayColor; + half _OverlayGlow, _OverlayBlend, _OverlayTextureScrollXSpeed, _OverlayTextureScrollYSpeed; + #endif + + #if DOODLE_ON + half _HandDrawnAmount, _HandDrawnSpeed; + #endif + + #if WIND_ON + half _GrassSpeed, _GrassWind, _GrassManualAnim, _GrassRadialBend; + #endif + + #if WAVEUV_ON + float _WaveAmount, _WaveSpeed, _WaveStrength, _WaveX, _WaveY; + #endif + + #if ROUNDWAVEUV_ON + half _RoundWaveStrength, _RoundWaveSpeed; + #endif + + #if RECTSIZE_ON + half _RectSize; + #endif + + #if OFFSETUV_ON + half _OffsetUvX, _OffsetUvY; + #endif + + #if CLIPPING_ON + half _ClipUvLeft, _ClipUvRight, _ClipUvUp, _ClipUvDown; + #endif + + #if RADIALCLIPPING_ON + half _RadialStartAngle, _RadialClip, _RadialClip2; + #endif + + #if TEXTURESCROLL_ON + half _TextureScrollXSpeed, _TextureScrollYSpeed; + #endif + + #if ZOOMUV_ON + half _ZoomUvAmount; + #endif + + #if WARP_ON + half _WarpStrength, _WarpSpeed, _WarpScale; + #endif + + #if TWISTUV_ON + half _TwistUvAmount, _TwistUvPosX, _TwistUvPosY, _TwistUvRadius; + #endif + + #if ROTATEUV_ON + half _RotateUvAmount; + #endif + + #if FISHEYE_ON + half _FishEyeUvAmount; + #endif + + #if PINCH_ON + half _PinchUvAmount; + #endif + + #if SHAKEUV_ON + half _ShakeUvSpeed, _ShakeUvX, _ShakeUvY; + #endif + + #if NORMALMAP_ON + half _NormalStrength; + #endif + + float _RandomSeed; + + + + + CBUFFER_END + + + + + + + + TEXTURE2D(_MainTex); + SAMPLER(sampler_MainTex); + + #if GLOW_ON + TEXTURE2D(_GlowTex); + SAMPLER(sampler_GlowTex); + #endif + + #if FADE_ON + TEXTURE2D(_FadeTex); + SAMPLER(sampler_FadeTex); + + TEXTURE2D(_FadeBurnTex); + SAMPLER(sampler_FadeBurnTex); + #endif + + #if DISTORT_ON + TEXTURE2D(_DistortTex); + SAMPLER(sampler_DistortTex); + #endif + + #if OUTTEX_ON + TEXTURE2D(_OutlineTex); + SAMPLER(sampler_OutlineTex); + #endif + + #if OUTDIST_ON + TEXTURE2D(_OutlineDistortTex); + SAMPLER(sampler_OutlineDistortTex); + #endif + + #if COLORSWAP_ON + TEXTURE2D(_ColorSwapTex); + SAMPLER(sampler_ColorSwapTex); + #endif + + #if COLORRAMP_ON + TEXTURE2D(_ColorRampTex); + TEXTURE2D(_ColorRampTexGradient); + SAMPLER(sampler_ColorRampTex); + SAMPLER(sampler_ColorRampTexGradient); + #endif + + #if SHINE_ON + TEXTURE2D(_ShineMask); + SAMPLER(sampler_ShineMask); + #endif + + #if OVERLAY_ON + TEXTURE2D(_OverlayTex); + SAMPLER(sampler_OverlayTex); + #endif + + #if NORMALMAP_ON + TEXTURE2D(_NormalMap); + SAMPLER(sampler_NormalMap); + #endif + + + half3 GetPixel(in int offsetX, in int offsetY, in half2 uv, in Texture2D _tex, in SamplerState _sampler) + { + half2 _uv = uv + half2(offsetX * _MainTex_TexelSize.x, offsetY * _MainTex_TexelSize.y); + half4 col = SAMPLE_TEXTURE2D(_tex, _sampler, _uv); + return col.rgb; + } + + + //BLURS------------------------------------------------------------------------- + half4 Blur(half2 uv, Texture2D source, SamplerState sampler_source, half Intensity) + { + const half2 texelSize = 1.0 / _ScreenParams.xy; + const half4 color = SAMPLE_TEXTURE2D(source, sampler_source, uv); + const half2 offset = Intensity * texelSize; + + half4 accumulatedColor = color; + half accumulatedWeight = 1.0; + for (int x = -1; x <= 1; x++) + { + for (int y = -1; y <= 1; y++) + { + const half2 sampleUV = uv + half2(x, y) * offset; + const half4 sampleColor = SAMPLE_TEXTURE2D(source, sampler_source, sampleUV); + + accumulatedColor += sampleColor; + accumulatedWeight += 1.0; + } + } + + half4 blurredColor = accumulatedColor / accumulatedWeight; + return blurredColor; + } + + half BlurHD_G(half bhqp, half x) + { + return exp(-(x * x) / (2.0 * bhqp * bhqp)); + } + half4 BlurHD(half2 uv, Texture2D source, SamplerState sampler_source, half BlurAmount, half xScale, half yScale) + { + int iterations = 16; + int halfIterations = iterations / 2; + half sigmaX = 0.1 + BlurAmount * 0.5; + half sigmaY = sigmaX; + half total = 0.0; + half4 ret = half4(0, 0, 0, 0); + for (int iy = 0; iy < iterations; ++iy) + { + half fy = BlurHD_G(sigmaY, half(iy) -half(halfIterations)); + half offsetY = half(iy - halfIterations) * 0.00390625 * xScale; + for (int ix = 0; ix < iterations; ++ix) + { + half fx = BlurHD_G(sigmaX, half(ix) - half(halfIterations)); + half offsetX = half(ix - halfIterations) * 0.00390625 * yScale; + total += fx * fy; + ret += SAMPLE_TEXTURE2D(source, sampler_source, uv + half2(offsetX, offsetY)) * fx * fy; + } + } + return ret / total; + } + //----------------------------------------------------------------------- + + + //------------------------------------------- + half RemapFloat(half inValue, half inMin, half inMax, half outMin, half outMax){ + return outMin + (inValue - inMin) * (outMax - outMin) / (inMax - inMin); + } + //------------------------------------------- + + //----------------------------------------------------------------------- + half rand(half2 seed, half offset) { + return (frac(sin(dot(seed, half2(12.9898, 78.233))) * 43758.5453) + offset) % 1.0; + } + + half rand2(half2 seed, half offset) { + return (frac(sin(dot(seed * floor(50 + (_Time.x % 1.0) * 12.), half2(127.1, 311.7))) * 43758.5453123) + offset) % 1.0; + } + + half rand2CustomTime(half2 seed, half offset, half customTime) { + return (frac(sin(dot(seed * floor(50 + (customTime % 1.0) * 12.), half2(127.1, 311.7))) * 43758.5453123) + offset) % 1.0; + } + //----------------------------------------------------------------------- + + + void Ext_ModifyVertex0 (inout VertexData v, inout ExtraV2F d) + { + //BILBOARD_ON + #if BILBOARD_ON + half3 camRight = mul((half3x3)unity_CameraToWorld, half3(1,0,0)); + half3 camUp = half3(0,1,0); + #if BILBOARDY_ON + camUp = mul((half3x3)unity_CameraToWorld, half3(0,1,0)); + #endif + half3 localPos = v.vertex.x * camRight + v.vertex.y * camUp; + v.vertex = half4(localPos, 1); + #endif + //----------------------------------------------------------- + + v.texcoord0.xy = TRANSFORM_TEX(v.texcoord0.xy, _MainTex); + half2 center = half2(0.5, 0.5); + #if ATLAS_ON + center = half2((_MaxXUV + _MinXUV) / 2.0, (_MaxYUV + _MinYUV) / 2.0); + #endif + + //POLARUV_ON + #if POLARUV_ON + v.texcoord0.xy = v.texcoord0.xy - center; + #endif + + //---------------------------------------- + + //ROTATEUV_ON + #if ROTATEUV_ON + half2 uvC = v.texcoord0.xy; + half cosAngle = cos(_RotateUvAmount); + half sinAngle = sin(_RotateUvAmount); + half2x2 rot = half2x2(cosAngle, -sinAngle, sinAngle, cosAngle); + uvC -= center; + v.texcoord0.xy = mul(rot, uvC); + v.texcoord0.xy += center; + #endif + //-------------------- + + #if RECTSIZE_ON + v.vertex.xyz += (v.vertex.xyz * (_RectSize - 1.0)); + #endif + + #if OUTTEX_ON + v.texcoord1.xy = TRANSFORM_TEX(v.texcoord0.xy, _OutlineTex); + #endif + + #if OUTDIST_ON + v.texcoord2.xy = TRANSFORM_TEX(v.texcoord0.xy, _OutlineDistortTex); + #endif + + #if DISTORT_ON + v.texcoord3.xy = TRANSFORM_TEX(v.texcoord0.xy, _DistortTex); + #endif + } + + void Ext_SurfaceFunction0 (inout Surface o, ShaderData d) + { + half randomSeed = _RandomSeed; + + float2 uvRect = d.texcoord0; + half2 center = half2(0.5, 0.5); + #if ATLAS_ON + center = half2((_MaxXUV + _MinXUV) / 2.0, (_MaxYUV + _MinYUV) / 2.0); + uvRect = half2((d.texcoord0.x - _MinXUV) / (_MaxXUV - _MinXUV), (d.texcoord0.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half2 centerTiled = half2(center.x * _MainTex_ST.x, center.y * _MainTex_ST.y); + + //CLIPPING_ON + #if CLIPPING_ON + half2 tiledUv = half2(d.texcoord0.x / _MainTex_ST.x, d.texcoord0.y / _MainTex_ST.y); + #if ATLAS_ON + tiledUv = half2((tiledUv.x - _MinXUV) / (_MaxXUV - _MinXUV), (tiledUv.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + clip((1 - _ClipUvUp) - tiledUv.y); + clip(tiledUv.y - _ClipUvDown); + clip((1 - _ClipUvRight) - tiledUv.x); + clip(tiledUv.x - _ClipUvLeft); + #endif + //---------------------------------- + + //RADIALCLIPPING_ON + #if RADIALCLIPPING_ON + half2 tiledUv2 = half2(d.texcoord0.x / _MainTex_ST.x, d.texcoord0.y / _MainTex_ST.y); + #if ATLAS_ON + tiledUv2 = half2((tiledUv2.x - _MinXUV) / (_MaxXUV - _MinXUV), (tiledUv2.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half startAngle = _RadialStartAngle - _RadialClip; + half endAngle = _RadialStartAngle + _RadialClip2; + half offset0 = clamp(0, 360, startAngle + 360); + half offset360 = clamp(0, 360, endAngle - 360); + half2 atan2Coord = half2(lerp(-1, 1, tiledUv2.x), lerp(-1, 1, tiledUv2.y)); + half atanAngle = atan2(atan2Coord.y, atan2Coord.x) * 57.3; // angle in degrees + if(atanAngle < 0) atanAngle = 360 + atanAngle; + if(atanAngle >= startAngle && atanAngle <= endAngle) discard; + if(atanAngle <= offset360) discard; + if(atanAngle >= offset0) discard; + #endif + + //----------------------------- + + //TEXTURESCROLL_ON && ATLAS_ON + #if TEXTURESCROLL_ON && ATLAS_ON + d.texcoord0.xy = half2(_MinXUV + ((_MaxXUV - _MinXUV) * (abs(((_Time.y + randomSeed) * _TextureScrollXSpeed) + uvRect.x) % 1)), + _MinYUV + ((_MaxYUV - _MinYUV) * (abs(((_Time.y + randomSeed) * _TextureScrollYSpeed) + uvRect.y) % 1))); + #endif + //---------------------------- + + //OFFSETUV_ON + #if OFFSETUV_ON + #if ATLAS_ON + d.texcoord0.xy = half2(_MinXUV + ((_MaxXUV - _MinXUV) * (abs((_OffsetUvX + uvRect.x) % 1))), + _MinYUV + ((_MaxYUV - _MinYUV) * (abs(_OffsetUvY + uvRect.y) % 1))); + #else + d.texcoord0.xy += half2(_OffsetUvX, _OffsetUvY); + #endif + #endif + + //---------------------- + + //POLARUV_ON + #if POLARUV_ON + d.texcoord0.xy = half2(atan2(d.texcoord0.y, d.texcoord0.x) / (2.0f * 3.141592653589f), length(d.texcoord0.xy)); + d.texcoord0.xy *= _MainTex_ST.xy; + #endif + + //-------------------------------------- + + //TWISTUV_ON + #if TWISTUV_ON + #if ATLAS_ON + _TwistUvPosX = ((_MaxXUV - _MinXUV) * _TwistUvPosX) + _MinXUV; + _TwistUvPosY = ((_MaxYUV - _MinYUV) * _TwistUvPosY) + _MinYUV; + #endif + half2 tempUv = d.texcoord0.xy - half2(_TwistUvPosX * _MainTex_ST.x, _TwistUvPosY * _MainTex_ST.y); + _TwistUvRadius *= (_MainTex_ST.x + _MainTex_ST.y) / 2; + half percent = (_TwistUvRadius - length(tempUv)) / _TwistUvRadius; + half theta = percent * percent * (2.0 * sin(_TwistUvAmount)) * 8.0; + half s = sin(theta); + half c = cos(theta); + half beta = max(sign(_TwistUvRadius - length(tempUv)), 0.0); + tempUv = half2(dot(tempUv, half2(c, -s)), dot(tempUv, half2(s, c))) * beta + tempUv * (1 - beta); + tempUv += half2(_TwistUvPosX * _MainTex_ST.x, _TwistUvPosY * _MainTex_ST.y); + d.texcoord0.xy = tempUv; + #endif + + //-------------------------------------------- + + //FISHEYE_ON + #if FISHEYE_ON + half bind = length(centerTiled); + half2 dF = d.texcoord0.xy - centerTiled; + half dFlen = length(dF); + half fishInt = (3.14159265359 / bind) * (_FishEyeUvAmount + 0.001); + d.texcoord0.xy = centerTiled + (dF / (max(0.0001, dFlen))) * tan(dFlen * fishInt) * bind / tan(bind * fishInt); + #endif + //--------------------------------------------- + + //PINCH_ON + #if PINCH_ON + half2 dP = d.texcoord0.xy - centerTiled; + half pinchInt = (3.141592 / length(centerTiled)) * (-_PinchUvAmount + 0.001); + d.texcoord0.xy = centerTiled + normalize(dP) * atan(length(dP) * -pinchInt * 10.0) * 0.5 / atan(-pinchInt * 5); + #endif + + //--------------------------------------------- + + //ZOOMUV_ON + #if ZOOMUV_ON + d.texcoord0.xy -= centerTiled; + d.texcoord0.xy = d.texcoord0.xy * _ZoomUvAmount; + d.texcoord0.xy += centerTiled; + #endif + + //----------------------------------------------- + + //DOODLE_ON + #if DOODLE_ON + half2 uvCopy = uvRect; + _HandDrawnSpeed = (floor((_Time.x + randomSeed) * 20 * _HandDrawnSpeed) / _HandDrawnSpeed) * _HandDrawnSpeed; + uvCopy.x = sin((uvCopy.x * _HandDrawnAmount + _HandDrawnSpeed) * 4); + uvCopy.y = cos((uvCopy.y * _HandDrawnAmount + _HandDrawnSpeed) * 4); + d.texcoord0.xy = lerp(d.texcoord0.xy, d.texcoord0.xy + uvCopy, 0.0005 * _HandDrawnAmount); + #endif + + //-------------------------- + + //SHAKEUV_ON + #if SHAKEUV_ON + half xShake = sin((_Time.x + randomSeed) * _ShakeUvSpeed * 50) * _ShakeUvX; + half yShake = cos((_Time.x + randomSeed) * _ShakeUvSpeed * 50) * _ShakeUvY; + d.texcoord0.xy += half2(xShake * 0.012, yShake * 0.01); + #endif + + //------------------------------------------- + + //RECTSIZE_ON + #if RECTSIZE_ON + d.texcoord0.xy = d.texcoord0.xy * (_RectSize).xx + (((-_RectSize * 0.5) + 0.5)).xx; + #endif + + //------------------------------------------- + + //DISTORT_ON + #if DISTORT_ON + #if ATLAS_ON + d.texcoord3.x = d.texcoord3.x * (1 / (_MaxXUV - _MinXUV)); + d.texcoord3.y = d.texcoord3.y * (1 / (_MaxYUV - _MinYUV)); + #endif + + d.texcoord3.x += ((_Time.x + _RandomSeed) * _DistortTexXSpeed) % 1; + d.texcoord3.y += ((_Time.x + _RandomSeed) * _DistortTexYSpeed) % 1; + half distortAmnt = (SAMPLE_TEXTURE2D(_DistortTex, sampler_DistortTex, d.texcoord3.xy).r - 0.5) * 0.2 * _DistortAmount; + d.texcoord0.x += distortAmnt; + d.texcoord0.y += distortAmnt; + #endif + //------------------------------------------------------- + + //WARP_ON + #if WARP_ON + half2 warpUv = half2(d.texcoord0.x / _MainTex_ST.x, d.texcoord0.y / _MainTex_ST.y); + #if ATLAS_ON + warpUv = half2((warpUv.x - _MinXUV) / (_MaxXUV - _MinXUV), (warpUv.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + const float tau = 6.283185307179586; + float xWarp = (_Time.y + randomSeed) * _WarpSpeed + warpUv.x * tau / _WarpScale; + float yWarp = (_Time.y + randomSeed) * _WarpSpeed + warpUv.y * tau / _WarpScale; + float2 warp = float2(sin(xWarp), sin(yWarp)) * _WarpStrength; + d.texcoord0.xy += warp; + #endif + + //------------------------------------------------------- + + //WAVEUV_ON + #if WAVEUV_ON + float2 uvWave = half2(_WaveX * _MainTex_ST.x, _WaveY * _MainTex_ST.y) - d.texcoord0.xy; + uvWave %= 1; + #if ATLAS_ON + uvWave = half2(_WaveX, _WaveY) - uvRect; + #endif + uvWave.x *= _ScreenParams.x / _ScreenParams.y; + float waveTime = _Time.y + randomSeed; + float angWave = (sqrt(dot(uvWave, uvWave)) * _WaveAmount) - ((waveTime * _WaveSpeed)); + d.texcoord0.xy = d.texcoord0.xy + uvWave * sin(angWave) * (_WaveStrength / 1000.0); + #endif + //---------------------------------------------------- + + //ROUNDWAVEUV_ON + #if ROUNDWAVEUV_ON + half xWave = ((0.5 * _MainTex_ST.x) - uvRect.x); + half yWave = ((0.5 * _MainTex_ST.y) - uvRect.y) * (_MainTex_TexelSize.w / _MainTex_TexelSize.z); + half ripple = -sqrt(xWave*xWave + yWave* yWave); + d.texcoord0.xy += (sin((ripple + (_Time.y + randomSeed) * (_RoundWaveSpeed/10.0)) / 0.015) * (_RoundWaveStrength/10.0)) % 1; + #endif + //---------------------------------------------------- + + + //WIND_ON + #if WIND_ON + half windOffset = sin((_Time.x + randomSeed) * _GrassSpeed * 10); + half2 windCenter = half2(0.5, 0.1); + #if ATLAS_ON + windCenter.x = ((_MaxXUV - _MinXUV) * windCenter.x) + _MinXUV; + windCenter.y = ((_MaxYUV - _MinYUV) * windCenter.y) + _MinYUV; + #endif + #if !MANUALWIND_ON + d.texcoord0.x = fmod(abs(lerp(d.texcoord0.x, d.texcoord0.x + (_GrassWind * 0.01 * windOffset), uvRect.y)), 1); + #else + d.texcoord0.x = fmod(abs(lerp(d.texcoord0.x, d.texcoord0.x + (_GrassWind * 0.01 * _GrassManualAnim), uvRect.y)), 1); + windOffset = _GrassManualAnim; + #endif + half2 delta = d.texcoord0.xy - windCenter; + half delta2 = dot(delta.xy, delta.xy); + half2 delta_offset = delta2 * windOffset; + d.texcoord0.xy = d.texcoord0.xy + half2(delta.y, -delta.x) * delta_offset * _GrassRadialBend; + #endif + + //-------------------------------------------------------- + + //TEXTURESCROLL_ON && !ATLAS_ON + #if TEXTURESCROLL_ON && !ATLAS_ON + d.texcoord0.x += ((_Time.y + randomSeed) * _TextureScrollXSpeed) % 1; + d.texcoord0.y += ((_Time.y + randomSeed) * _TextureScrollYSpeed) % 1; + #endif + //------------------------------ + + //PIXELATE_ON + #if PIXELATE_ON + half aspectRatio = _MainTex_TexelSize.x / _MainTex_TexelSize.y; + half2 pixelSize = float2(_PixelateSize, _PixelateSize * aspectRatio); + d.texcoord0.xy = floor(d.texcoord0.xy * pixelSize) / pixelSize; + #endif + //-------------- + + half4 col = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy); + half originalAlpha = col.a; + col *= d.vertexColor; + + //NORMAL MAP + #if NORMALMAP_ON + half4 normalSample = SAMPLE_TEXTURE2D(_NormalMap, sampler_NormalMap, d.texcoord0.xy); + half3 normalTS = UnpackNormal(normalSample); + normalTS.xy *= _NormalStrength; + o.Normal = normalTS; + #endif + + + //GLITCH_ON + #if GLITCH_ON + half2 uvGlitch = uvRect; + uvGlitch.y -= 0.5; + half lineNoise = pow(rand2(floor(uvGlitch * half2(24., 19.) * _GlitchSize) * 4.0, randomSeed), 3.0) * _GlitchAmount + * pow(rand2(floor(uvGlitch * half2(38., 14.) * _GlitchSize) * 4.0, randomSeed), 3.0); + col = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(lineNoise * 0.02 * rand2(half2(2.0, 1), randomSeed), 0)) * d.vertexColor; + #endif + //-------------------------------------- + + //CHROMABERR_ON + #if CHROMABERR_ON + half4 r = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(_ChromAberrAmount/10, 0)) * d.vertexColor; + half4 b = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(-_ChromAberrAmount/10, 0)) * d.vertexColor; + col = half4(r.r * r.a, col.g, b.b * b.a, max(max(r.a, b.a) * _ChromAberrAlpha, col.a)); + #endif + + //-------------------------------- + + //BLUR_ON + #if BLUR_ON + #if ATLAS_ON + #if !BLURISHD_ON + col = BlurHD(d.texcoord0.xy, _MainTex, sampler_MainTex, _BlurIntensity, (_MaxXUV - _MinXUV), (_MaxYUV - _MinYUV)) * d.vertexColor; + #else + col = Blur(d.texcoord0.xy, _MainTex, sampler_MainTex, _BlurIntensity * (_MaxXUV - _MinXUV)) * d.vertexColor; + #endif + #else + #if !BLURISHD_ON + col = BlurHD(d.texcoord0.xy, _MainTex, sampler_MainTex, _BlurIntensity, 1, 1) * d.vertexColor; + #else + col = Blur(d.texcoord0.xy, _MainTex, sampler_MainTex, _BlurIntensity) * d.vertexColor; + #endif + #endif + #endif + + //-------------------- + + //MOTIONBLUR_ON + #if MOTIONBLUR_ON + _MotionBlurAngle = _MotionBlurAngle * 3.1415926; + #define rot(n) mul(n, half2x2(cos(_MotionBlurAngle), -sin(_MotionBlurAngle), sin(_MotionBlurAngle), cos(_MotionBlurAngle))) + _MotionBlurDist = _MotionBlurDist * 0.005; + #if ATLAS_ON + _MotionBlurDist *= (_MaxXUV - _MinXUV); + #endif + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(-_MotionBlurDist, -_MotionBlurDist))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(-_MotionBlurDist * 2, -_MotionBlurDist * 2))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(-_MotionBlurDist * 3, -_MotionBlurDist * 3))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(-_MotionBlurDist * 4, -_MotionBlurDist * 4))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(_MotionBlurDist, _MotionBlurDist))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(_MotionBlurDist * 2, _MotionBlurDist * 2))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(_MotionBlurDist * 3, _MotionBlurDist * 3))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(_MotionBlurDist * 4, _MotionBlurDist * 4))); + col.rgb = col.rgb / 9; + #endif + //------------------------------------ + + //NEGATIVE_ON + #if NEGATIVE_ON + col.rgb = lerp(col.rgb, 1 - col.rgb, _NegativeAmount); + #endif + + //-------------- + half luminance = 0; + + //GREYSCALE_ON && !GREYSCALEOUTLINE_ON + #if GREYSCALE_ON && !GREYSCALEOUTLINE_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + luminance = saturate(luminance + _GreyscaleLuminosity); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _GreyscaleTintColor, _GreyscaleBlend); + #endif + //------------------------------------ + + //GHOST_ON + #if GHOST_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + half4 ghostResult; + ghostResult.a = saturate(luminance - _GhostTransparency) * col.a; + ghostResult.rgb = col.rgb * (luminance + _GhostColorBoost); + col = lerp(col, ghostResult, _GhostBlend); + #endif + //------------------------------------ + + //INNEROUTLINE_ON + #if INNEROUTLINE_ON + half3 innerT = abs(GetPixel(0, _InnerOutlineThickness, d.texcoord0.xy, _MainTex, sampler_MainTex) - GetPixel(0, -_InnerOutlineThickness, d.texcoord0.xy, _MainTex, sampler_MainTex)); + innerT += abs(GetPixel(_InnerOutlineThickness, 0, d.texcoord0.xy, _MainTex, sampler_MainTex) - GetPixel(-_InnerOutlineThickness, 0, d.texcoord0.xy, _MainTex, sampler_MainTex)); + #if !ONLYINNEROUTLINE_ON + innerT = (innerT / 2.0) * col.a * _InnerOutlineAlpha; + col.rgb += length(innerT) * _InnerOutlineColor.rgb * _InnerOutlineGlow; + #else + innerT *= col.a * _InnerOutlineAlpha; + col.rgb = length(innerT) * _InnerOutlineColor.rgb * _InnerOutlineGlow; + col.a = step(0.3, col.r+col.g+col.b); + #endif + #endif + //------------------------------------------------------- + + //HITEFFECT_ON + #if HITEFFECT_ON + col.rgb = lerp(col.rgb, _HitEffectColor.rgb * _HitEffectGlow, _HitEffectBlend); + #endif + //-------------------- + + //GRADIENT_ON + #if GRADIENT_ON + half2 tiledUvGrad = half2(uvRect.x / _MainTex_ST.x, uvRect.y / _MainTex_ST.y); + #if GRADIENT2COL_ON + _GradTopRightCol = _GradTopLeftCol; + _GradBotRightCol = _GradBotLeftCol; + #endif + #if RADIALGRADIENT_ON + half radialDist = 1 - length(tiledUvGrad - half2(0.5, 0.5)); + radialDist *= (_MainTex_TexelSize.w / _MainTex_TexelSize.z); + radialDist = saturate(_GradBoostX * radialDist); + half4 gradientResult = lerp(_GradTopLeftCol, _GradBotLeftCol, radialDist); + #else + half gradXLerpFactor = saturate(pow(tiledUvGrad.x, _GradBoostX)); + half4 gradientResult = lerp(lerp(_GradBotLeftCol, _GradBotRightCol, gradXLerpFactor), + lerp(_GradTopLeftCol, _GradTopRightCol, gradXLerpFactor), saturate(pow(tiledUvGrad.y, _GradBoostY))); + #endif + gradientResult = lerp(col, gradientResult, _GradBlend); + col.rgb = gradientResult.rgb * col.a; + col.a *= gradientResult.a; + #endif + //-------------------------------------------------------------------- + + //CONTRAST_ON + #if CONTRAST_ON + col.rgb = (col.rgb - float3(0.5, 0.5, 0.5)) * _Contrast + float3(0.5, 0.5, 0.5); + col.rgb += _Brightness; + #endif + + //------------------------------------------------------------------- + + //COLORSWAP_ON + #if COLORSWAP_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + half4 swapMask = SAMPLE_TEXTURE2D(_ColorSwapTex, sampler_ColorSwapTex, d.texcoord0.xy); + swapMask.rgb *= swapMask.a; + half3 redSwap = _ColorSwapRed * swapMask.r * saturate(luminance + _ColorSwapRedLuminosity); + half3 greenSwap = _ColorSwapGreen * swapMask.g * saturate(luminance + _ColorSwapGreenLuminosity); + half3 blueSwap = _ColorSwapBlue * swapMask.b * saturate(luminance + _ColorSwapBlueLuminosity); + swapMask.rgb = col.rgb * saturate(1 - swapMask.r - swapMask.g - swapMask.b); + col.rgb = lerp(col.rgb, swapMask.rgb + redSwap + greenSwap + blueSwap, _ColorSwapBlend); + #endif + //-------------------------------------------------------------------- + + //COLORRAMP_ON && !COLORRAMPOUTLINE_ON + #if COLORRAMP_ON && !COLORRAMPOUTLINE_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + luminance = saturate(luminance + _ColorRampLuminosity); + #if GRADIENTCOLORRAMP_ON + col.rgb = lerp(col.rgb, SAMPLE_TEXTURE2D(_ColorRampTexGradient, sampler_ColorRampTexGradient, half2(luminance, 0)).rgb, _ColorRampBlend); + #else + col.rgb = lerp(col.rgb, SAMPLE_TEXTURE2D(_ColorRampTex, sampler_ColorRampTex, half2(luminance, 0)).rgb, _ColorRampBlend); + #endif + #endif + //-------------------------------------------------------------------- + + //CHANGECOLOR_ON + #if CHANGECOLOR_ON + float3 currChangeColor = saturate(col.rgb); + luminance = 0.3 * currChangeColor.r + 0.59 * currChangeColor.g + 0.11 * currChangeColor.b; + luminance = saturate(luminance + _ColorChangeLuminosity); + half3 dif = abs(currChangeColor - _ColorChangeTarget.rgb); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _ColorChangeNewCol.rgb, + max(sign(1 - saturate(dif.x + dif.y + dif.z) - _ColorChangeTolerance), 0.0)); + #if CHANGECOLOR2_ON + dif = abs(currChangeColor - _ColorChangeTarget2.rgb); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _ColorChangeNewCol2.rgb, + max(sign(1 - saturate(dif.x + dif.y + dif.z) - _ColorChangeTolerance2), 0.0)); + #endif + #if CHANGECOLOR3_ON + dif = abs(currChangeColor - _ColorChangeTarget3.rgb); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _ColorChangeNewCol3.rgb, + max(sign(1 - saturate(dif.x + dif.y + dif.z) - _ColorChangeTolerance3), 0.0)); + #endif + #endif + //------------------------------------------------------- + + //POSTERIZE_ON && !POSTERIZEOUTLINE_ON + #if POSTERIZE_ON && !POSTERIZEOUTLINE_ON + col.rgb = pow(col.rgb, _PosterizeGamma) * _PosterizeNumColors; + col.rgb = floor(col.rgb) / _PosterizeNumColors; + col.rgb = pow(col.rgb, 1.0 / _PosterizeGamma); + #endif + //------------------------------------ + + //HSV_ON + #if HSV_ON + half3 resultHsv = half3(col.rgb); + half cosHsv = _HsvBright * _HsvSaturation * cos(_HsvShift * 3.14159265 / 180); + half sinHsv = _HsvBright * _HsvSaturation * sin(_HsvShift * 3.14159265 / 180); + resultHsv.x = (.299 * _HsvBright + .701 * cosHsv + .168 * sinHsv) * col.x + + (.587 * _HsvBright - .587 * cosHsv + .330 * sinHsv) * col.y + + (.114 * _HsvBright - .114 * cosHsv - .497 * sinHsv) * col.z; + resultHsv.y = (.299 * _HsvBright - .299 * cosHsv - .328 * sinHsv) *col.x + + (.587 * _HsvBright + .413 * cosHsv + .035 * sinHsv) * col.y + + (.114 * _HsvBright - .114 * cosHsv + .292 * sinHsv) * col.z; + resultHsv.z = (.299 * _HsvBright - .3 * cosHsv + 1.25 * sinHsv) * col.x + + (.587 * _HsvBright - .588 * cosHsv - 1.05 * sinHsv) * col.y + + (.114 * _HsvBright + .886 * cosHsv - .203 * sinHsv) * col.z; + col.rgb = resultHsv; + #endif + //------------------------------------------------------- + + //OVERLAY_ON + #if OVERLAY_ON + half2 overlayUvs = d.texcoord0.xy; + overlayUvs.x += ((_Time.y + randomSeed) * _OverlayTextureScrollXSpeed) % 1; + overlayUvs.y += ((_Time.y + randomSeed) * _OverlayTextureScrollYSpeed) % 1; + half4 overlayCol = SAMPLE_TEXTURE2D(_OverlayTex, sampler_OverlayTex, TRANSFORM_TEX(overlayUvs, _OverlayTex)); + overlayCol.rgb *= _OverlayColor.rgb * _OverlayGlow; + #if !OVERLAYMULT_ON + overlayCol.rgb *= overlayCol.a * _OverlayColor.rgb * _OverlayColor.a * _OverlayBlend; + col.rgb += overlayCol.rgb; + #else + overlayCol.a *= _OverlayColor.a; + col = lerp(col, col * overlayCol, _OverlayBlend); + #endif + #endif + + //--------------------------------- + + //OUTBASE_ON + #if OUTBASE_ON + #if OUTBASEPIXELPERF_ON + half2 destUv = half2(_OutlinePixelWidth * _MainTex_TexelSize.x, _OutlinePixelWidth * _MainTex_TexelSize.y); + #else + half2 destUv = half2(_OutlineWidth * _MainTex_TexelSize.x * 200, _OutlineWidth * _MainTex_TexelSize.y * 200); + #endif + + #if OUTDIST_ON + d.texcoord3.x += ((_Time.x + _RandomSeed) * _OutlineDistortTexXSpeed) % 1; + d.texcoord3.y += ((_Time.x + _RandomSeed) * _OutlineDistortTexYSpeed) % 1; + #if ATLAS_ON + d.texcoord3 = half2((d.texcoord3.x - _MinXUV) / (_MaxXUV - _MinXUV), (d.texcoord3.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half outDistortAmnt = (SAMPLE_TEXTURE2D(_OutlineDistortTex, sampler_OutlineDistortTex, d.texcoord3).r - 0.5) * 0.2 * _OutlineDistortAmount; + destUv.x += outDistortAmnt; + destUv.y += outDistortAmnt; + #endif + + half spriteLeft = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(destUv.x, 0)).a; + half spriteRight = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy - half2(destUv.x, 0)).a; + half spriteBottom = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(0, destUv.y)).a; + half spriteTop = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy - half2(0, destUv.y)).a; + half result = spriteLeft + spriteRight + spriteBottom + spriteTop; + + #if OUTBASE8DIR_ON + half spriteTopLeft = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(destUv.x, destUv.y)).a; + half spriteTopRight = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(-destUv.x, destUv.y)).a; + half spriteBotLeft = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(destUv.x, -destUv.y)).a; + half spriteBotRight = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(-destUv.x, -destUv.y)).a; + result = result + spriteTopLeft + spriteTopRight + spriteBotLeft + spriteBotRight; + #endif + + result = step(0.05, saturate(result)); + + #if OUTTEX_ON + d.texcoord1.x += ((_Time.x + _RandomSeed) * _OutlineTexXSpeed) % 1; + d.texcoord1.y += ((_Time.x + _RandomSeed) * _OutlineTexYSpeed) % 1; + #if ATLAS_ON + d.texcoord1 = half2((d.texcoord1.x - _MinXUV) / (_MaxXUV - _MinXUV), (d.texcoord1.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half4 tempOutColor = SAMPLE_TEXTURE2D(_OutlineTex, sampler_OutlineTex, d.texcoord1); + tempOutColor *= _OutlineColor; + _OutlineColor = tempOutColor; + #endif + + result *= (1 - originalAlpha) * _OutlineAlpha; + + half4 outline = _OutlineColor * d.vertexColor.a; + outline.rgb *= _OutlineGlow; + outline.a = result; + #if ONLYOUTLINE_ON + col = outline; + #else + col = lerp(col, outline, result); + #endif + #endif + //------------------------------------------------------- + + //FADE_ON + #if FADE_ON + half2 tiledUvFade1 = TRANSFORM_TEX(d.texcoord0, _FadeTex); + half2 tiledUvFade2 = TRANSFORM_TEX(d.texcoord0, _FadeBurnTex); + #if ATLAS_ON + tiledUvFade1 = half2((tiledUvFade1.x - _MinXUV) / (_MaxXUV - _MinXUV), (tiledUvFade1.y - _MinYUV) / (_MaxYUV - _MinYUV)); + tiledUvFade2 = half2((tiledUvFade2.x - _MinXUV) / (_MaxXUV - _MinXUV), (tiledUvFade2.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half fadeTemp = SAMPLE_TEXTURE2D(_FadeTex, sampler_FadeTex, tiledUvFade1).r; + half fade = smoothstep(_FadeAmount, _FadeAmount + _FadeBurnTransition, fadeTemp); + half fadeBurn = saturate(smoothstep(_FadeAmount - _FadeBurnWidth, _FadeAmount - _FadeBurnWidth + 0.1, fadeTemp) * _FadeAmount); + col.a *= fade; + _FadeBurnColor.rgb *= _FadeBurnGlow; + col += fadeBurn * SAMPLE_TEXTURE2D(_FadeBurnTex, sampler_FadeBurnTex, tiledUvFade2) * _FadeBurnColor * originalAlpha * (1 - col.a); + #endif + //------------------------------------------------------- + + //SHADOW_ON + #if SHADOW_ON + half shadowA = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(_ShadowX, _ShadowY)).a; + half preMultShadowMask = 1 - (saturate(shadowA - col.a) * (1 - col.a)); + col.rgb *= 1 - ((shadowA - col.a) * (1 - col.a)); + col.rgb += (_ShadowColor * shadowA) * (1 - col.a); + col.a = max(shadowA * _ShadowAlpha * d.vertexColor.a, col.a); + #endif + + //------------------------------------------------------- + + //GLOW_ON + #if GLOW_ON + half4 emission; + #if GLOWTEX_ON + emission = SAMPLE_TEXTURE2D(_GlowTex, sampler_GlowTex, d.texcoord0); + #else + emission = col; + #endif + + col.rgb *= _GlowGlobal; + emission.rgb *= emission.a * col.a * _Glow * _GlowColor; + col.rgb += emission.rgb; + #endif + //------------------------------------------------------- + + //COLORRAMP_ON && COLORRAMPOUTLINE_ON + #if COLORRAMP_ON && COLORRAMPOUTLINE_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + luminance = saturate(luminance + _ColorRampLuminosity); + #if GRADIENTCOLORRAMP_ON + col.rgb = lerp(col.rgb, SAMPLE_TEXTURE2D(_ColorRampTexGradient, sampler_ColorRampTexGradient, half2(luminance, 0)).rgb, _ColorRampBlend); + #else + col.rgb = lerp(col.rgb, SAMPLE_TEXTURE2D(_ColorRampTex, sampler_ColorRampTex, half2(luminance, 0)).rgb, _ColorRampBlend); + #endif + #endif + //--------------- + + //GREYSCALE_ON && GREYSCALEOUTLINE_ON + #if GREYSCALE_ON && GREYSCALEOUTLINE_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + luminance = saturate(luminance + _GreyscaleLuminosity); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _GreyscaleTintColor, _GreyscaleBlend); + #endif + + //----------------------------------- + + //POSTERIZE_ON && POSTERIZEOUTLINE_ON + #if POSTERIZE_ON && POSTERIZEOUTLINE_ON + col.rgb = pow(col.rgb, _PosterizeGamma) * _PosterizeNumColors; + col.rgb = floor(col.rgb) / _PosterizeNumColors; + col.rgb = pow(col.rgb, 1.0 / _PosterizeGamma); + #endif + + //----------------------------------- + + //SHINE_ON + #if SHINE_ON + half2 uvShine = uvRect; + half cosAngle = cos(_ShineRotate); + half sinAngle = sin(_ShineRotate); + half2x2 rot = half2x2(cosAngle, -sinAngle, sinAngle, cosAngle); + uvShine -= half2(0.5, 0.5); + uvShine = mul(rot, uvShine); + uvShine += half2(0.5, 0.5); + half shineMask = SAMPLE_TEXTURE2D(_ShineMask, sampler_ShineMask, d.texcoord0.xy).a; + half currentDistanceProjection = (uvShine.x + uvShine.y) / 2; + half whitePower = 1 - (abs(currentDistanceProjection - _ShineLocation) / _ShineWidth); + col.rgb += col.a * whitePower * _ShineGlow * max(sign(currentDistanceProjection - (_ShineLocation - _ShineWidth)), 0.0) + * max(sign((_ShineLocation + _ShineWidth) - currentDistanceProjection), 0.0) * _ShineColor * shineMask; + #endif + + //----------------------------------- + + //HOLOGRAM_ON + #if HOLOGRAM_ON + half totalHologram = _HologramStripesAmount + _HologramUnmodAmount; + half hologramYCoord = ((uvRect.y + (((_Time.x + randomSeed) % 1) * _HologramStripesSpeed)) % totalHologram) / totalHologram; + hologramYCoord = abs(hologramYCoord); + half alpha = RemapFloat(saturate(hologramYCoord - (_HologramUnmodAmount/totalHologram)), 0.0, 1.0, _HologramMinAlpha, saturate(_HologramMaxAlpha)); + half hologramMask = max(sign((_HologramUnmodAmount/totalHologram) - hologramYCoord), 0.0); + half4 hologramResult = col; + hologramResult.a *= lerp(alpha, 1, hologramMask); + hologramResult.rgb *= max(1, _HologramMaxAlpha * max(sign(hologramYCoord - (_HologramUnmodAmount/totalHologram)), 0.0)); + hologramMask = 1 - step(0.01,hologramMask); + hologramResult.rgb += hologramMask * _HologramStripeColor * col.a; + col = lerp(col, hologramResult, _HologramBlend); + #endif + + //----------------------------------- + + //FLICKER_ON + #if FLICKER_ON + col.a *= saturate(col.a * step(frac(0.05 + (_Time.w + randomSeed) * _FlickerFreq), 1 - _FlickerPercent) + _FlickerAlpha); + #endif + //----------------------------------- + + //ALPHACUTOFF_ON + + //ALPHAROUND_ON + + //ALPHAOUTLINE_ON + #if ALPHAOUTLINE_ON + half alphaOutlineRes = pow(1 - col.a, max(_AlphaOutlinePower, 0.0001)) * step(_AlphaOutlineMinAlpha, col.a) * _AlphaOutlineBlend; + col.rgb = lerp(col.rgb, _AlphaOutlineColor.rgb * _AlphaOutlineGlow, alphaOutlineRes); + col.a = lerp(col.a, 1, alphaOutlineRes > 1); + #endif + //------------------------------------------------------- + + //FOG_ON + + //------------------ + + col *= _Color; + o.Albedo = col; + col.a *= _Alpha; + clip(col.a - _AlphaCutoffValue - 0.01); + o.Alpha = _Color.a; + } + + + + + + void ChainSurfaceFunction(inout Surface l, inout ShaderData d) + { + Ext_SurfaceFunction0(l, d); + // Ext_SurfaceFunction1(l, d); + // Ext_SurfaceFunction2(l, d); + // Ext_SurfaceFunction3(l, d); + // Ext_SurfaceFunction4(l, d); + // Ext_SurfaceFunction5(l, d); + // Ext_SurfaceFunction6(l, d); + // Ext_SurfaceFunction7(l, d); + // Ext_SurfaceFunction8(l, d); + // Ext_SurfaceFunction9(l, d); + // Ext_SurfaceFunction10(l, d); + // Ext_SurfaceFunction11(l, d); + // Ext_SurfaceFunction12(l, d); + // Ext_SurfaceFunction13(l, d); + // Ext_SurfaceFunction14(l, d); + // Ext_SurfaceFunction15(l, d); + // Ext_SurfaceFunction16(l, d); + // Ext_SurfaceFunction17(l, d); + // Ext_SurfaceFunction18(l, d); + // Ext_SurfaceFunction19(l, d); + // Ext_SurfaceFunction20(l, d); + // Ext_SurfaceFunction21(l, d); + // Ext_SurfaceFunction22(l, d); + // Ext_SurfaceFunction23(l, d); + // Ext_SurfaceFunction24(l, d); + // Ext_SurfaceFunction25(l, d); + // Ext_SurfaceFunction26(l, d); + // Ext_SurfaceFunction27(l, d); + // Ext_SurfaceFunction28(l, d); + // Ext_SurfaceFunction29(l, d); + } + +#if !_DECALSHADER + + void ChainModifyVertex(inout VertexData v, inout VertexToPixel v2p, float4 time) + { + ExtraV2F d; + + ZERO_INITIALIZE(ExtraV2F, d); + ZERO_INITIALIZE(Blackboard, d.blackboard); + // due to motion vectors in HDRP, we need to use the last + // time in certain spots. So if you are going to use _Time to adjust vertices, + // you need to use this time or motion vectors will break. + d.time = time; + + Ext_ModifyVertex0(v, d); + // Ext_ModifyVertex1(v, d); + // Ext_ModifyVertex2(v, d); + // Ext_ModifyVertex3(v, d); + // Ext_ModifyVertex4(v, d); + // Ext_ModifyVertex5(v, d); + // Ext_ModifyVertex6(v, d); + // Ext_ModifyVertex7(v, d); + // Ext_ModifyVertex8(v, d); + // Ext_ModifyVertex9(v, d); + // Ext_ModifyVertex10(v, d); + // Ext_ModifyVertex11(v, d); + // Ext_ModifyVertex12(v, d); + // Ext_ModifyVertex13(v, d); + // Ext_ModifyVertex14(v, d); + // Ext_ModifyVertex15(v, d); + // Ext_ModifyVertex16(v, d); + // Ext_ModifyVertex17(v, d); + // Ext_ModifyVertex18(v, d); + // Ext_ModifyVertex19(v, d); + // Ext_ModifyVertex20(v, d); + // Ext_ModifyVertex21(v, d); + // Ext_ModifyVertex22(v, d); + // Ext_ModifyVertex23(v, d); + // Ext_ModifyVertex24(v, d); + // Ext_ModifyVertex25(v, d); + // Ext_ModifyVertex26(v, d); + // Ext_ModifyVertex27(v, d); + // Ext_ModifyVertex28(v, d); + // Ext_ModifyVertex29(v, d); + + + // #if %EXTRAV2F0REQUIREKEY% + // v2p.extraV2F0 = d.extraV2F0; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // v2p.extraV2F1 = d.extraV2F1; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // v2p.extraV2F2 = d.extraV2F2; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // v2p.extraV2F3 = d.extraV2F3; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // v2p.extraV2F4 = d.extraV2F4; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // v2p.extraV2F5 = d.extraV2F5; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // v2p.extraV2F6 = d.extraV2F6; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // v2p.extraV2F7 = d.extraV2F7; + // #endif + } + + void ChainModifyTessellatedVertex(inout VertexData v, inout VertexToPixel v2p) + { + ExtraV2F d; + ZERO_INITIALIZE(ExtraV2F, d); + ZERO_INITIALIZE(Blackboard, d.blackboard); + + // #if %EXTRAV2F0REQUIREKEY% + // d.extraV2F0 = v2p.extraV2F0; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // d.extraV2F1 = v2p.extraV2F1; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // d.extraV2F2 = v2p.extraV2F2; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // d.extraV2F3 = v2p.extraV2F3; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // d.extraV2F4 = v2p.extraV2F4; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // d.extraV2F5 = v2p.extraV2F5; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // d.extraV2F6 = v2p.extraV2F6; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // d.extraV2F7 = v2p.extraV2F7; + // #endif + + + // Ext_ModifyTessellatedVertex0(v, d); + // Ext_ModifyTessellatedVertex1(v, d); + // Ext_ModifyTessellatedVertex2(v, d); + // Ext_ModifyTessellatedVertex3(v, d); + // Ext_ModifyTessellatedVertex4(v, d); + // Ext_ModifyTessellatedVertex5(v, d); + // Ext_ModifyTessellatedVertex6(v, d); + // Ext_ModifyTessellatedVertex7(v, d); + // Ext_ModifyTessellatedVertex8(v, d); + // Ext_ModifyTessellatedVertex9(v, d); + // Ext_ModifyTessellatedVertex10(v, d); + // Ext_ModifyTessellatedVertex11(v, d); + // Ext_ModifyTessellatedVertex12(v, d); + // Ext_ModifyTessellatedVertex13(v, d); + // Ext_ModifyTessellatedVertex14(v, d); + // Ext_ModifyTessellatedVertex15(v, d); + // Ext_ModifyTessellatedVertex16(v, d); + // Ext_ModifyTessellatedVertex17(v, d); + // Ext_ModifyTessellatedVertex18(v, d); + // Ext_ModifyTessellatedVertex19(v, d); + // Ext_ModifyTessellatedVertex20(v, d); + // Ext_ModifyTessellatedVertex21(v, d); + // Ext_ModifyTessellatedVertex22(v, d); + // Ext_ModifyTessellatedVertex23(v, d); + // Ext_ModifyTessellatedVertex24(v, d); + // Ext_ModifyTessellatedVertex25(v, d); + // Ext_ModifyTessellatedVertex26(v, d); + // Ext_ModifyTessellatedVertex27(v, d); + // Ext_ModifyTessellatedVertex28(v, d); + // Ext_ModifyTessellatedVertex29(v, d); + + // #if %EXTRAV2F0REQUIREKEY% + // v2p.extraV2F0 = d.extraV2F0; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // v2p.extraV2F1 = d.extraV2F1; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // v2p.extraV2F2 = d.extraV2F2; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // v2p.extraV2F3 = d.extraV2F3; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // v2p.extraV2F4 = d.extraV2F4; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // v2p.extraV2F5 = d.extraV2F5; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // v2p.extraV2F6 = d.extraV2F6; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // v2p.extraV2F7 = d.extraV2F7; + // #endif + } + + void ChainFinalColorForward(inout Surface l, inout ShaderData d, inout half4 color) + { + // Ext_FinalColorForward0(l, d, color); + // Ext_FinalColorForward1(l, d, color); + // Ext_FinalColorForward2(l, d, color); + // Ext_FinalColorForward3(l, d, color); + // Ext_FinalColorForward4(l, d, color); + // Ext_FinalColorForward5(l, d, color); + // Ext_FinalColorForward6(l, d, color); + // Ext_FinalColorForward7(l, d, color); + // Ext_FinalColorForward8(l, d, color); + // Ext_FinalColorForward9(l, d, color); + // Ext_FinalColorForward10(l, d, color); + // Ext_FinalColorForward11(l, d, color); + // Ext_FinalColorForward12(l, d, color); + // Ext_FinalColorForward13(l, d, color); + // Ext_FinalColorForward14(l, d, color); + // Ext_FinalColorForward15(l, d, color); + // Ext_FinalColorForward16(l, d, color); + // Ext_FinalColorForward17(l, d, color); + // Ext_FinalColorForward18(l, d, color); + // Ext_FinalColorForward19(l, d, color); + // Ext_FinalColorForward20(l, d, color); + // Ext_FinalColorForward21(l, d, color); + // Ext_FinalColorForward22(l, d, color); + // Ext_FinalColorForward23(l, d, color); + // Ext_FinalColorForward24(l, d, color); + // Ext_FinalColorForward25(l, d, color); + // Ext_FinalColorForward26(l, d, color); + // Ext_FinalColorForward27(l, d, color); + // Ext_FinalColorForward28(l, d, color); + // Ext_FinalColorForward29(l, d, color); + } + + void ChainFinalGBufferStandard(inout Surface s, inout ShaderData d, inout half4 GBuffer0, inout half4 GBuffer1, inout half4 GBuffer2, inout half4 outEmission, inout half4 outShadowMask) + { + // Ext_FinalGBufferStandard0(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard1(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard2(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard3(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard4(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard5(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard6(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard7(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard8(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard9(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard10(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard11(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard12(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard13(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard14(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard15(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard16(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard17(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard18(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard19(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard20(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard21(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard22(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard23(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard24(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard25(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard26(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard27(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard28(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard29(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + } +#endif + + + + + +#if _DECALSHADER + + ShaderData CreateShaderData(SurfaceDescriptionInputs IN) + { + ShaderData d = (ShaderData)0; + d.TBNMatrix = float3x3(IN.WorldSpaceTangent, IN.WorldSpaceBiTangent, IN.WorldSpaceNormal); + d.worldSpaceNormal = IN.WorldSpaceNormal; + d.worldSpaceTangent = IN.WorldSpaceTangent; + + d.worldSpacePosition = IN.WorldSpacePosition; + d.texcoord0 = IN.uv0.xyxy; + d.screenPos = IN.ScreenPosition; + + d.worldSpaceViewDir = normalize(_WorldSpaceCameraPos - d.worldSpacePosition); + + d.tangentSpaceViewDir = mul(d.TBNMatrix, d.worldSpaceViewDir); + + // these rarely get used, so we back transform them. Usually will be stripped. + #if _HDRP + // d.localSpacePosition = mul(GetWorldToObjectMatrix(), float4(GetCameraRelativePositionWS(d.worldSpacePosition), 1)).xyz; + #else + // d.localSpacePosition = mul(GetWorldToObjectMatrix(), float4(d.worldSpacePosition, 1)).xyz; + #endif + // d.localSpaceNormal = normalize(mul((float3x3)GetWorldToObjectMatrix(), d.worldSpaceNormal)); + // d.localSpaceTangent = normalize(mul((float3x3)GetWorldToObjectMatrix(), d.worldSpaceTangent.xyz)); + + // #if %SCREENPOSREQUIREKEY% + // d.screenUV = (IN.ScreenPosition.xy / max(0.01, IN.ScreenPosition.w)); + // #endif + + return d; + } +#else + + ShaderData CreateShaderData(VertexToPixel i + #if NEED_FACING + , bool facing + #endif + ) + { + ShaderData d = (ShaderData)0; + d.clipPos = i.pos; + d.worldSpacePosition = i.worldPos; + + d.worldSpaceNormal = normalize(i.worldNormal); + d.worldSpaceTangent.xyz = normalize(i.worldTangent.xyz); + + d.tangentSign = i.worldTangent.w * unity_WorldTransformParams.w; + float3 bitangent = cross(d.worldSpaceTangent.xyz, d.worldSpaceNormal) * d.tangentSign; + + d.TBNMatrix = float3x3(d.worldSpaceTangent, -bitangent, d.worldSpaceNormal); + d.worldSpaceViewDir = normalize(_WorldSpaceCameraPos - i.worldPos); + + d.tangentSpaceViewDir = mul(d.TBNMatrix, d.worldSpaceViewDir); + d.texcoord0 = i.texcoord0; + d.texcoord1 = i.texcoord1; + d.texcoord2 = i.texcoord2; + + // #if %TEXCOORD3REQUIREKEY% + d.texcoord3 = i.texcoord3; + // #endif + + // d.isFrontFace = facing; + // #if %VERTEXCOLORREQUIREKEY% + d.vertexColor = i.vertexColor; + // #endif + + // these rarely get used, so we back transform them. Usually will be stripped. + #if _HDRP + // d.localSpacePosition = mul(GetWorldToObjectMatrix(), float4(GetCameraRelativePositionWS(i.worldPos), 1)).xyz; + #else + // d.localSpacePosition = mul(GetWorldToObjectMatrix(), float4(i.worldPos, 1)).xyz; + #endif + // d.localSpaceNormal = normalize(mul((float3x3)GetWorldToObjectMatrix(), i.worldNormal)); + // d.localSpaceTangent = normalize(mul((float3x3)GetWorldToObjectMatrix(), i.worldTangent.xyz)); + + // #if %SCREENPOSREQUIREKEY% + // d.screenPos = i.screenPos; + // d.screenUV = (i.screenPos.xy / i.screenPos.w); + // #endif + + + // #if %EXTRAV2F0REQUIREKEY% + // d.extraV2F0 = i.extraV2F0; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // d.extraV2F1 = i.extraV2F1; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // d.extraV2F2 = i.extraV2F2; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // d.extraV2F3 = i.extraV2F3; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // d.extraV2F4 = i.extraV2F4; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // d.extraV2F5 = i.extraV2F5; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // d.extraV2F6 = i.extraV2F6; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // d.extraV2F7 = i.extraV2F7; + // #endif + + return d; + } + +#endif + + + +struct VaryingsToPS +{ + VertexToPixel vmesh; + #ifdef VARYINGS_NEED_PASS + VaryingsPassToPS vpass; + #endif +}; + +struct PackedVaryingsToPS +{ + #ifdef VARYINGS_NEED_PASS + PackedVaryingsPassToPS vpass; + #endif + VertexToPixel vmesh; + + UNITY_VERTEX_OUTPUT_STEREO +}; + +PackedVaryingsToPS PackVaryingsToPS(VaryingsToPS input) +{ + PackedVaryingsToPS output = (PackedVaryingsToPS)0; + output.vmesh = input.vmesh; + #ifdef VARYINGS_NEED_PASS + output.vpass = PackVaryingsPassToPS(input.vpass); + #endif + + UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(output); + return output; +} + + + + +VertexToPixel VertMesh(VertexData input) +{ + VertexToPixel output = (VertexToPixel)0; + + UNITY_SETUP_INSTANCE_ID(input); + UNITY_TRANSFER_INSTANCE_ID(input, output); + + + ChainModifyVertex(input, output, _Time); + + + // This return the camera relative position (if enable) + float3 positionRWS = TransformObjectToWorld(input.vertex.xyz); + float3 normalWS = TransformObjectToWorldNormal(input.normal); + float4 tangentWS = float4(TransformObjectToWorldDir(input.tangent.xyz), input.tangent.w); + + + output.worldPos = GetAbsolutePositionWS(positionRWS); + output.pos = TransformWorldToHClip(positionRWS); + output.worldNormal = normalWS; + output.worldTangent = tangentWS; + + + output.texcoord0 = input.texcoord0; + output.texcoord1 = input.texcoord1; + output.texcoord2 = input.texcoord2; + // #if %TEXCOORD3REQUIREKEY% + output.texcoord3 = input.texcoord3; + // #endif + + // #if %SCREENPOSREQUIREKEY% + // output.screenPos = ComputeScreenPos(output.pos, _ProjectionParams.x); + // #endif + + // #if %VERTEXCOLORREQUIREKEY% + output.vertexColor = input.vertexColor; + // #endif + return output; +} + + +#if (SHADERPASS == SHADERPASS_DBUFFER_MESH) +void MeshDecalsPositionZBias(inout VaryingsToPS input) +{ +#if defined(UNITY_REVERSED_Z) + input.vmesh.pos.z -= _DecalMeshDepthBias; +#else + input.vmesh.pos.z += _DecalMeshDepthBias; +#endif +} +#endif + + +#if (SHADERPASS == SHADERPASS_LIGHT_TRANSPORT) + +// This was not in constant buffer in original unity, so keep outiside. But should be in as ShaderRenderPass frequency +float unity_OneOverOutputBoost; +float unity_MaxOutputValue; + +CBUFFER_START(UnityMetaPass) +// x = use uv1 as raster position +// y = use uv2 as raster position +bool4 unity_MetaVertexControl; + +// x = return albedo +// y = return normal +bool4 unity_MetaFragmentControl; +CBUFFER_END + +PackedVaryingsToPS Vert(VertexData inputMesh) +{ + VaryingsToPS output = (VaryingsToPS)0; + output.vmesh = (VertexToPixel)0; + + UNITY_SETUP_INSTANCE_ID(inputMesh); + UNITY_TRANSFER_INSTANCE_ID(inputMesh, output.vmesh); + + // Output UV coordinate in vertex shader + float2 uv = float2(0.0, 0.0); + + if (unity_MetaVertexControl.x) + { + uv = inputMesh.texcoord1.xy * unity_LightmapST.xy + unity_LightmapST.zw; + } + else if (unity_MetaVertexControl.y) + { + uv = inputMesh.texcoord2.xy * unity_DynamicLightmapST.xy + unity_DynamicLightmapST.zw; + } + + // OpenGL right now needs to actually use the incoming vertex position + // so we create a fake dependency on it here that haven't any impact. + output.vmesh.pos = float4(uv * 2.0 - 1.0, inputMesh.vertex.z > 0 ? 1.0e-4 : 0.0, 1.0); + +#ifdef VARYINGS_NEED_POSITION_WS + output.vmesh.worldPos = TransformObjectToWorld(inputMesh.vertex.xyz); +#endif + +#ifdef VARYINGS_NEED_TANGENT_TO_WORLD + // Normal is required for triplanar mapping + output.vmesh.worldNormal = TransformObjectToWorldNormal(inputMesh.normal); + // Not required but assign to silent compiler warning + output.vmesh.worldTangent = float4(1.0, 0.0, 0.0, 0.0); +#endif + + output.vmesh.texcoord0 = inputMesh.texcoord0; + output.vmesh.texcoord1 = inputMesh.texcoord1; + output.vmesh.texcoord2 = inputMesh.texcoord2; + // #if %TEXCOORD3REQUIREKEY% + output.vmesh.texcoord3 = inputMesh.texcoord3; + // #endif + + // #if %VERTEXCOLORREQUIREKEY% + output.vmesh.vertexColor = inputMesh.vertexColor; + // #endif + + return PackVaryingsToPS(output); +} +#else + +PackedVaryingsToPS Vert(VertexData inputMesh) +{ + VaryingsToPS varyingsType; + varyingsType.vmesh = VertMesh(inputMesh); + #if (SHADERPASS == SHADERPASS_DBUFFER_MESH) + MeshDecalsPositionZBias(varyingsType); + #endif + return PackVaryingsToPS(varyingsType); +} + +#endif + + + + + + + FragInputs BuildFragInputs(VertexToPixel input) + { + UNITY_SETUP_INSTANCE_ID(input); + FragInputs output; + ZERO_INITIALIZE(FragInputs, output); + + // Init to some default value to make the computer quiet (else it output 'divide by zero' warning even if value is not used). + // TODO: this is a really poor workaround, but the variable is used in a bunch of places + // to compute normals which are then passed on elsewhere to compute other values... + output.tangentToWorld = k_identity3x3; + output.positionSS = input.pos; // input.positionCS is SV_Position + + output.positionRWS = GetCameraRelativePositionWS(input.worldPos); + output.tangentToWorld = BuildTangentToWorld(input.worldTangent, input.worldNormal); + output.texCoord0 = input.texcoord0; + output.texCoord1 = input.texcoord1; + output.texCoord2 = input.texcoord2; + + return output; + } + + void BuildSurfaceData(FragInputs fragInputs, inout Surface surfaceDescription, float3 V, PositionInputs posInput, out SurfaceData surfaceData, out float3 bentNormalWS) + { + // setup defaults -- these are used if the graph doesn't output a value + ZERO_INITIALIZE(SurfaceData, surfaceData); + + // specularOcclusion need to be init ahead of decal to quiet the compiler that modify the SurfaceData struct + // however specularOcclusion can come from the graph, so need to be init here so it can be override. + surfaceData.specularOcclusion = 1.0; + + // copy across graph values, if defined + surfaceData.baseColor = surfaceDescription.Albedo; + surfaceData.perceptualSmoothness = surfaceDescription.Smoothness; + surfaceData.ambientOcclusion = surfaceDescription.Occlusion; + surfaceData.specularOcclusion = surfaceDescription.SpecularOcclusion; + surfaceData.metallic = surfaceDescription.Metallic; + surfaceData.subsurfaceMask = surfaceDescription.SubsurfaceMask; + surfaceData.thickness = surfaceDescription.Thickness; + surfaceData.diffusionProfileHash = asuint(surfaceDescription.DiffusionProfileHash); + #if _USESPECULAR + surfaceData.specularColor = surfaceDescription.Specular; + #endif + surfaceData.coatMask = surfaceDescription.CoatMask; + surfaceData.anisotropy = surfaceDescription.Anisotropy; + surfaceData.iridescenceMask = surfaceDescription.IridescenceMask; + surfaceData.iridescenceThickness = surfaceDescription.IridescenceThickness; + + #ifdef _HAS_REFRACTION + if (_EnableSSRefraction) + { + // surfaceData.ior = surfaceDescription.RefractionIndex; + // surfaceData.transmittanceColor = surfaceDescription.RefractionColor; + // surfaceData.atDistance = surfaceDescription.RefractionDistance; + + surfaceData.transmittanceMask = (1.0 - surfaceDescription.Alpha); + surfaceDescription.Alpha = 1.0; + } + else + { + surfaceData.ior = surfaceDescription.ior; + surfaceData.transmittanceColor = surfaceDescription.transmittanceColor; + surfaceData.atDistance = surfaceDescription.atDistance; + surfaceData.transmittanceMask = surfaceDescription.transmittanceMask; + surfaceDescription.Alpha = 1.0; + } + #else + surfaceData.ior = 1.0; + surfaceData.transmittanceColor = float3(1.0, 1.0, 1.0); + surfaceData.atDistance = 1.0; + surfaceData.transmittanceMask = 0.0; + #endif + + // These static material feature allow compile time optimization + surfaceData.materialFeatures = MATERIALFEATUREFLAGS_LIT_STANDARD; + #ifdef _MATERIAL_FEATURE_SUBSURFACE_SCATTERING + surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_SUBSURFACE_SCATTERING; + #endif + #ifdef _MATERIAL_FEATURE_TRANSMISSION + surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_TRANSMISSION; + #endif + #ifdef _MATERIAL_FEATURE_ANISOTROPY + surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_ANISOTROPY; + #endif + // surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_CLEAR_COAT; + + #ifdef _MATERIAL_FEATURE_IRIDESCENCE + surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_IRIDESCENCE; + #endif + #ifdef _MATERIAL_FEATURE_SPECULAR_COLOR + surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_SPECULAR_COLOR; + #endif + + #if defined (_MATERIAL_FEATURE_SPECULAR_COLOR) && defined (_ENERGY_CONSERVING_SPECULAR) + // Require to have setup baseColor + // Reproduce the energy conservation done in legacy Unity. Not ideal but better for compatibility and users can unchek it + surfaceData.baseColor *= (1.0 - Max3(surfaceData.specularColor.r, surfaceData.specularColor.g, surfaceData.specularColor.b)); + #endif + + + // tangent-space normal + float3 normalTS = float3(0.0f, 0.0f, 1.0f); + normalTS = surfaceDescription.Normal; + + // compute world space normal + #if !_WORLDSPACENORMAL + surfaceData.normalWS = mul(normalTS, fragInputs.tangentToWorld); + #else + surfaceData.normalWS = normalTS; + #endif + surfaceData.geomNormalWS = fragInputs.tangentToWorld[2]; + + surfaceData.tangentWS = normalize(fragInputs.tangentToWorld[0].xyz); // The tangent is not normalize in tangentToWorld for mikkt. TODO: Check if it expected that we normalize with Morten. Tag: SURFACE_GRADIENT + // surfaceData.tangentWS = TransformTangentToWorld(surfaceDescription.Tangent, fragInputs.tangentToWorld); + + #if HAVE_DECALS + if (_EnableDecals) + { + #if VERSION_GREATER_EQUAL(10,2) + DecalSurfaceData decalSurfaceData = GetDecalSurfaceData(posInput, surfaceData.geomNormalWS, surfaceDescription.Alpha); + ApplyDecalToSurfaceData(decalSurfaceData, surfaceData.geomNormalWS, surfaceData); + #else + DecalSurfaceData decalSurfaceData = GetDecalSurfaceData(posInput, surfaceDescription.Alpha); + ApplyDecalToSurfaceData(decalSurfaceData, surfaceData); + #endif + } + #endif + + bentNormalWS = surfaceData.normalWS; + + surfaceData.tangentWS = Orthonormalize(surfaceData.tangentWS, surfaceData.normalWS); + + + // By default we use the ambient occlusion with Tri-ace trick (apply outside) for specular occlusion. + // If user provide bent normal then we process a better term + #if defined(_SPECULAR_OCCLUSION_CUSTOM) + // Just use the value passed through via the slot (not active otherwise) + #elif defined(_SPECULAR_OCCLUSION_FROM_AO_BENT_NORMAL) + // If we have bent normal and ambient occlusion, process a specular occlusion + surfaceData.specularOcclusion = GetSpecularOcclusionFromBentAO(V, bentNormalWS, surfaceData.normalWS, surfaceData.ambientOcclusion, PerceptualSmoothnessToPerceptualRoughness(surfaceData.perceptualSmoothness)); + #elif defined(_AMBIENT_OCCLUSION) && defined(_SPECULAR_OCCLUSION_FROM_AO) + surfaceData.specularOcclusion = GetSpecularOcclusionFromAmbientOcclusion(ClampNdotV(dot(surfaceData.normalWS, V)), surfaceData.ambientOcclusion, PerceptualSmoothnessToRoughness(surfaceData.perceptualSmoothness)); + #endif + + #ifdef _ENABLE_GEOMETRIC_SPECULAR_AA + surfaceData.perceptualSmoothness = GeometricNormalFiltering(surfaceData.perceptualSmoothness, fragInputs.tangentToWorld[2], surfaceDescription.SpecularAAScreenSpaceVariance, surfaceDescription.SpecularAAThreshold); + #endif + + #ifdef DEBUG_DISPLAY + if (_DebugMipMapMode != DEBUGMIPMAPMODE_NONE) + { + // TODO: need to update mip info + surfaceData.metallic = 0; + } + + // We need to call ApplyDebugToSurfaceData after filling the surfarcedata and before filling builtinData + // as it can modify attribute use for static lighting + ApplyDebugToSurfaceData(fragInputs.tangentToWorld, surfaceData); + #endif + } + + void GetSurfaceAndBuiltinData(VertexToPixel m2ps, FragInputs fragInputs, float3 V, inout PositionInputs posInput, + out SurfaceData surfaceData, out BuiltinData builtinData, inout Surface l, inout ShaderData d + #if NEED_FACING + , bool facing + #endif + ) + { + // Removed since crossfade does not work, probably needs extra material setup. + //#ifdef LOD_FADE_CROSSFADE // enable dithering LOD transition if user select CrossFade transition in LOD group + // uint3 fadeMaskSeed = asuint((int3)(V * _ScreenSize.xyx)); // Quantize V to _ScreenSize values + // LODDitheringTransition(fadeMaskSeed, unity_LODFade.x); + //#endif + + d = CreateShaderData(m2ps + #if NEED_FACING + , facing + #endif + ); + + + + l = (Surface)0; + + l.Albedo = half3(0.5, 0.5, 0.5); + l.Normal = float3(0,0,1); + l.Occlusion = 1; + l.Alpha = 1; + l.SpecularOcclusion = 1; + + #ifdef _DEPTHOFFSET_ON + l.outputDepth = posInput.deviceDepth; + #endif + + ChainSurfaceFunction(l, d); + + #ifdef _DEPTHOFFSET_ON + posInput.deviceDepth = l.outputDepth; + #endif + + #if _UNLIT + //l.Emission = l.Albedo; + //l.Albedo = 0; + l.Normal = half3(0,0,1); + l.Occlusion = 1; + l.Metallic = 0; + l.Specular = 0; + #endif + + surfaceData.geomNormalWS = d.worldSpaceNormal; + surfaceData.tangentWS = d.worldSpaceTangent; + fragInputs.tangentToWorld = d.TBNMatrix; + + float3 bentNormalWS; + BuildSurfaceData(fragInputs, l, V, posInput, surfaceData, bentNormalWS); + + InitBuiltinData(posInput, l.Alpha, bentNormalWS, -d.worldSpaceNormal, fragInputs.texCoord1, fragInputs.texCoord2, builtinData); + + + + builtinData.emissiveColor = l.Emission; + + #if defined(_OVERRIDE_BAKEDGI) + builtinData.bakeDiffuseLighting = l.DiffuseGI; + builtinData.backBakeDiffuseLighting = l.BackDiffuseGI; + builtinData.emissiveColor += l.SpecularGI; + #endif + + #if defined(_OVERRIDE_SHADOWMASK) + builtinData.shadowMask0 = l.ShadowMask.x; + builtinData.shadowMask1 = l.ShadowMask.y; + builtinData.shadowMask2 = l.ShadowMask.z; + builtinData.shadowMask3 = l.ShadowMask.w; + #endif + + #if (SHADERPASS == SHADERPASS_DISTORTION) + //builtinData.distortion = surfaceDescription.Distortion; + //builtinData.distortionBlur = surfaceDescription.DistortionBlur; + builtinData.distortion = float2(0.0, 0.0); + builtinData.distortionBlur = 0.0; + #else + builtinData.distortion = float2(0.0, 0.0); + builtinData.distortionBlur = 0.0; + #endif + + PostInitBuiltinData(V, posInput, surfaceData, builtinData); + } + + void Frag( PackedVaryingsToPS packedInput, + OUTPUT_GBUFFER(outGBuffer) + #ifdef _DEPTHOFFSET_ON + , out float outputDepth : SV_Depth + #endif + #if NEED_FACING + , bool facing : SV_IsFrontFace + #endif + ) + { + UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX(packedInput); + FragInputs input = BuildFragInputs(packedInput.vmesh); + + // input.positionSS is SV_Position + PositionInputs posInput = GetPositionInput(input.positionSS.xy, _ScreenSize.zw, input.positionSS.z, input.positionSS.w, input.positionRWS); + + float3 V = GetWorldSpaceNormalizeViewDir(input.positionRWS); + + SurfaceData surfaceData; + BuiltinData builtinData; + Surface l; + ShaderData d; + GetSurfaceAndBuiltinData(packedInput.vmesh, input, V, posInput, surfaceData, builtinData, l, d + #if NEED_FACING + , facing + #endif + ); + + ENCODE_INTO_GBUFFER(surfaceData, builtinData, posInput.positionSS, outGBuffer); + + #ifdef _DEPTHOFFSET_ON + outputDepth = posInput.deviceDepth; + #endif + } + + ENDHLSL + } + + Pass + { + // based on HDLitPass.template + Name "ShadowCaster" + Tags { "LightMode" = "ShadowCaster" } + + + + //------------------------------------------------------------------------------------- + // Render Modes (Blend, Cull, ZTest, Stencil, etc) + //------------------------------------------------------------------------------------- + + Cull Back + + ZClip [_ZClip] + ZWrite On + ZTest LEqual + + ColorMask 0 + + Tags { "RenderType" = "Opaque" "Queue" = "Geometry" "PreviewType" = "Plane" } + Cull [_CullingOption] + ZWrite [_ZWrite] + ZTest [_ZTestMode] + + + //------------------------------------------------------------------------------------- + // End Render Modes + //------------------------------------------------------------------------------------- + + HLSLPROGRAM + + #pragma target 4.5 + #pragma only_renderers d3d11 ps4 xboxone vulkan metal switch + //#pragma enable_d3d11_debug_symbols + + #pragma multi_compile_instancing + + //#pragma multi_compile_local _ _ALPHATEST_ON + + + //#pragma shader_feature _SURFACE_TYPE_TRANSPARENT + //#pragma shader_feature_local _ _BLENDMODE_ALPHA _BLENDMODE_ADD _BLENDMODE_PRE_MULTIPLY + + //------------------------------------------------------------------------------------- + // Variant Definitions (active field translations to HDRP defines) + //------------------------------------------------------------------------------------- + // #define _MATERIAL_FEATURE_SUBSURFACE_SCATTERING 1 + // #define _MATERIAL_FEATURE_TRANSMISSION 1 + // #define _MATERIAL_FEATURE_ANISOTROPY 1 + // #define _MATERIAL_FEATURE_IRIDESCENCE 1 + // #define _MATERIAL_FEATURE_SPECULAR_COLOR 1 + #define _ENABLE_FOG_ON_TRANSPARENT 1 + // #define _AMBIENT_OCCLUSION 1 + // #define _SPECULAR_OCCLUSION_FROM_AO 1 + // #define _SPECULAR_OCCLUSION_FROM_AO_BENT_NORMAL 1 + // #define _SPECULAR_OCCLUSION_CUSTOM 1 + // #define _ENERGY_CONSERVING_SPECULAR 1 + // #define _ENABLE_GEOMETRIC_SPECULAR_AA 1 + // #define _HAS_REFRACTION 1 + // #define _REFRACTION_PLANE 1 + // #define _REFRACTION_SPHERE 1 + // #define _DISABLE_DECALS 1 + // #define _DISABLE_SSR 1 + // #define _ADD_PRECOMPUTED_VELOCITY + // #define _WRITE_TRANSPARENT_MOTION_VECTOR 1 + // #define _DEPTHOFFSET_ON 1 + // #define _BLENDMODE_PRESERVE_SPECULAR_LIGHTING 1 + + #define SHADERPASS SHADERPASS_SHADOWS + #define RAYTRACING_SHADER_GRAPH_HIGH + #define _PASSSHADOW 1 + + + #pragma shader_feature_local GLOW_ON + #pragma shader_feature_local FADE_ON + #pragma shader_feature_local OUTBASE_ON + #pragma shader_feature_local ONLYOUTLINE_ON + #pragma shader_feature_local GRADIENT_ON + #pragma shader_feature_local GRADIENT2COL_ON + #pragma shader_feature_local RADIALGRADIENT_ON + #pragma shader_feature_local COLORSWAP_ON + #pragma shader_feature_local HSV_ON + #pragma shader_feature_local CHANGECOLOR_ON + #pragma shader_feature_local CHANGECOLOR2_ON + #pragma shader_feature_local CHANGECOLOR3_ON + #pragma shader_feature_local COLORRAMP_ON + #pragma shader_feature_local GRADIENTCOLORRAMP_ON + #pragma shader_feature_local HITEFFECT_ON + #pragma shader_feature_local NEGATIVE_ON + #pragma shader_feature_local PIXELATE_ON + #pragma shader_feature_local GREYSCALE_ON + #pragma shader_feature_local POSTERIZE_ON + #pragma shader_feature_local BLUR_ON + #pragma shader_feature_local MOTIONBLUR_ON + #pragma shader_feature_local GHOST_ON + #pragma shader_feature_local ALPHAOUTLINE_ON + #pragma shader_feature_local INNEROUTLINE_ON + #pragma shader_feature_local ONLYINNEROUTLINE_ON + #pragma shader_feature_local HOLOGRAM_ON + #pragma shader_feature_local CHROMABERR_ON + #pragma shader_feature_local GLITCH_ON + #pragma shader_feature_local FLICKER_ON + #pragma shader_feature_local SHADOW_ON + #pragma shader_feature_local SHINE_ON + #pragma shader_feature_local CONTRAST_ON + #pragma shader_feature_local OVERLAY_ON + #pragma shader_feature_local OVERLAYMULT_ON + #pragma shader_feature_local DOODLE_ON + #pragma shader_feature_local WIND_ON + #pragma shader_feature_local WAVEUV_ON + #pragma shader_feature_local ROUNDWAVEUV_ON + #pragma shader_feature_local RECTSIZE_ON + #pragma shader_feature_local OFFSETUV_ON + #pragma shader_feature_local CLIPPING_ON + #pragma shader_feature_local RADIALCLIPPING_ON + #pragma shader_feature_local TEXTURESCROLL_ON + #pragma shader_feature_local ZOOMUV_ON + #pragma shader_feature_local DISTORT_ON + #pragma shader_feature_local WARP_ON + #pragma shader_feature_local TWISTUV_ON + #pragma shader_feature_local ROTATEUV_ON + #pragma shader_feature_local POLARUV_ON + #pragma shader_feature_local FISHEYE_ON + #pragma shader_feature_local PINCH_ON + #pragma shader_feature_local SHAKEUV_ON + + #pragma shader_feature_local GLOWTEX_ON + #pragma shader_feature_local OUTTEX_ON + #pragma shader_feature_local OUTDIST_ON + #pragma shader_feature_local OUTBASE8DIR_ON + #pragma shader_feature_local OUTBASEPIXELPERF_ON + #pragma shader_feature_local COLORRAMPOUTLINE_ON + #pragma shader_feature_local GREYSCALEOUTLINE_ON + #pragma shader_feature_local POSTERIZEOUTLINE_ON + #pragma shader_feature_local BLURISHD_ON + #pragma shader_feature_local MANUALWIND_ON + #pragma shader_feature_local ATLAS_ON + #pragma shader_feature_local PREMULTIPLYALPHA_ON + + #pragma shader_feature BILBOARD_ON + #pragma shader_feature BILBOARDY_ON + + #pragma shader_feature NORMALMAP_ON + + + #define _HDRP 1 +#define _USINGTEXCOORD1 1 +#define _USINGTEXCOORD2 1 + + + #pragma vertex Vert + #pragma fragment Frag + + //------------------------------------------------------------------------------------- + // Defines + //------------------------------------------------------------------------------------- + + + // useful conversion functions to make surface shader code just work + + #define UNITY_DECLARE_TEX2D(name) TEXTURE2D(name); SAMPLER(sampler##name); + #define UNITY_DECLARE_TEX2D_NOSAMPLER(name) TEXTURE2D(name); + #define UNITY_DECLARE_TEX2DARRAY(name) TEXTURE2D_ARRAY(name); SAMPLER(sampler##name); + #define UNITY_DECLARE_TEX2DARRAY_NOSAMPLER(tex) TEXTURE2D_ARRAY(tex); + + #define UNITY_SAMPLE_TEX2DARRAY(tex,coord) SAMPLE_TEXTURE2D_ARRAY(tex, sampler##tex, coord.xy, coord.z) + #define UNITY_SAMPLE_TEX2DARRAY_LOD(tex,coord,lod) SAMPLE_TEXTURE2D_ARRAY_LOD(tex, sampler##tex, coord.xy, coord.z, lod) + #define UNITY_SAMPLE_TEX2D(tex, coord) SAMPLE_TEXTURE2D(tex, sampler##tex, coord) + #define UNITY_SAMPLE_TEX2D_SAMPLER(tex, samp, coord) SAMPLE_TEXTURE2D(tex, sampler##samp, coord) + + #define UNITY_SAMPLE_TEX2D_LOD(tex,coord, lod) SAMPLE_TEXTURE2D_LOD(tex, sampler_##tex, coord, lod) + #define UNITY_SAMPLE_TEX2D_SAMPLER_LOD(tex,samplertex,coord, lod) SAMPLE_TEXTURE2D_LOD (tex, sampler##samplertex,coord, lod) + + #if defined(UNITY_COMPILER_HLSL) + #define UNITY_INITIALIZE_OUTPUT(type,name) name = (type)0; + #else + #define UNITY_INITIALIZE_OUTPUT(type,name) + #endif + + #define sampler2D_float sampler2D + #define sampler2D_half sampler2D + + #undef WorldNormalVector + #define WorldNormalVector(data, normal) mul(normal, data.TBNMatrix) + + #define UnityObjectToWorldNormal(normal) mul(GetObjectToWorldMatrix(), normal) + + + + +// HDRP Adapter stuff + + + // If we use subsurface scattering, enable output split lighting (for forward pass) + #if defined(_MATERIAL_FEATURE_SUBSURFACE_SCATTERING) && !defined(_SURFACE_TYPE_TRANSPARENT) + #define OUTPUT_SPLIT_LIGHTING + #endif + + #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Version.hlsl" + #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Common.hlsl" + + #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/NormalSurfaceGradient.hlsl" + + // define FragInputs structure + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/ShaderPass/FragInputs.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/ShaderPass/ShaderPass.cs.hlsl" + #if (SHADER_LIBRARY_VERSION_MAJOR >= 10) + #include "Packages/com.unity.shadergraph/ShaderGraphLibrary/Functions.hlsl" + #endif + + + + + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/ShaderVariables.hlsl" + #ifdef DEBUG_DISPLAY + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Debug/DebugDisplay.hlsl" + #endif + + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/Material.hlsl" + + #if (SHADERPASS == SHADERPASS_FORWARD) + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Lighting/Lighting.hlsl" + + #define HAS_LIGHTLOOP + + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Lighting/LightLoop/LightLoopDef.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/Lit/Lit.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Lighting/LightLoop/LightLoop.hlsl" + #else + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/Lit/Lit.hlsl" + #endif + + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/BuiltinUtilities.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/MaterialUtilities.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/Decal/DecalUtilities.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/Lit/LitDecalData.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/ShaderGraphFunctions.hlsl" + + // Used by SceneSelectionPass + int _ObjectId; + int _PassValue; + + + // data across stages, stripped like the above. + struct VertexToPixel + { + float4 pos : SV_POSITION; + float3 worldPos : TEXCOORD0; + float3 worldNormal : TEXCOORD1; + float4 worldTangent : TEXCOORD2; + float4 texcoord0 : TEXCOORD3; + float4 texcoord1 : TEXCOORD4; + float4 texcoord2 : TEXCOORD5; + + // #if %TEXCOORD3REQUIREKEY% + float4 texcoord3 : TEXCOORD6; + // #endif + + // #if %SCREENPOSREQUIREKEY% + // float4 screenPos : TEXCOORD7; + // #endif + + // #if %VERTEXCOLORREQUIREKEY% + float4 vertexColor : COLOR; + // #endif + + // #if %EXTRAV2F0REQUIREKEY% + // float4 extraV2F0 : TEXCOORD8; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // float4 extraV2F1 : TEXCOORD9; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // float4 extraV2F2 : TEXCOORD10; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // float4 extraV2F3 : TEXCOORD11; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // float4 extraV2F4 : TEXCOORD12; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // float4 extraV2F5 : TEXCOORD13; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // float4 extraV2F6 : TEXCOORD14; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // float4 extraV2F7 : TEXCOORD15; + // #endif + + #if UNITY_ANY_INSTANCING_ENABLED + UNITY_VERTEX_INPUT_INSTANCE_ID + #endif // UNITY_ANY_INSTANCING_ENABLED + + UNITY_VERTEX_OUTPUT_STEREO + }; + + + + + // data describing the user output of a pixel + struct Surface + { + half3 Albedo; + half Height; + half3 Normal; + half Smoothness; + half3 Emission; + half Metallic; + half3 Specular; + half Occlusion; + half SpecularPower; // for simple lighting + half Alpha; + float outputDepth; // if written, SV_Depth semantic is used. ShaderData.clipPos.z is unused value + // HDRP Only + half SpecularOcclusion; + half SubsurfaceMask; + half Thickness; + half CoatMask; + half CoatSmoothness; + half Anisotropy; + half IridescenceMask; + half IridescenceThickness; + int DiffusionProfileHash; + float SpecularAAThreshold; + float SpecularAAScreenSpaceVariance; + // requires _OVERRIDE_BAKEDGI to be defined, but is mapped in all pipelines + float3 DiffuseGI; + float3 BackDiffuseGI; + float3 SpecularGI; + float ior; + float3 transmittanceColor; + float atDistance; + float transmittanceMask; + // requires _OVERRIDE_SHADOWMASK to be defines + float4 ShadowMask; + + // for decals + float NormalAlpha; + float MAOSAlpha; + + + }; + + // Data the user declares in blackboard blocks + struct Blackboard + { + + float blackboardDummyData; + }; + + // data the user might need, this will grow to be big. But easy to strip + struct ShaderData + { + float4 clipPos; // SV_POSITION + float3 localSpacePosition; + float3 localSpaceNormal; + float3 localSpaceTangent; + + float3 worldSpacePosition; + float3 worldSpaceNormal; + float3 worldSpaceTangent; + float tangentSign; + + float3 worldSpaceViewDir; + float3 tangentSpaceViewDir; + + float4 texcoord0; + float4 texcoord1; + float4 texcoord2; + float4 texcoord3; + + float2 screenUV; + float4 screenPos; + + float4 vertexColor; + bool isFrontFace; + + float4 extraV2F0; + float4 extraV2F1; + float4 extraV2F2; + float4 extraV2F3; + float4 extraV2F4; + float4 extraV2F5; + float4 extraV2F6; + float4 extraV2F7; + + float3x3 TBNMatrix; + Blackboard blackboard; + }; + + struct VertexData + { + #if SHADER_TARGET > 30 + // uint vertexID : SV_VertexID; + #endif + float4 vertex : POSITION; + float3 normal : NORMAL; + float4 tangent : TANGENT; + float4 texcoord0 : TEXCOORD0; + + // optimize out mesh coords when not in use by user or lighting system + #if _URP && (_USINGTEXCOORD1 || _PASSMETA || _PASSFORWARD || _PASSGBUFFER) + float4 texcoord1 : TEXCOORD1; + #endif + + #if _URP && (_USINGTEXCOORD2 || _PASSMETA || ((_PASSFORWARD || _PASSGBUFFER) && defined(DYNAMICLIGHTMAP_ON))) + float4 texcoord2 : TEXCOORD2; + #endif + + #if _STANDARD && (_USINGTEXCOORD1 || (_PASSMETA || ((_PASSFORWARD || _PASSGBUFFER || _PASSFORWARDADD) && LIGHTMAP_ON))) + float4 texcoord1 : TEXCOORD1; + #endif + #if _STANDARD && (_USINGTEXCOORD2 || (_PASSMETA || ((_PASSFORWARD || _PASSGBUFFER) && DYNAMICLIGHTMAP_ON))) + float4 texcoord2 : TEXCOORD2; + #endif + + + #if _HDRP + float4 texcoord1 : TEXCOORD1; + float4 texcoord2 : TEXCOORD2; + #endif + + // #if %TEXCOORD3REQUIREKEY% + float4 texcoord3 : TEXCOORD3; + // #endif + + // #if %VERTEXCOLORREQUIREKEY% + float4 vertexColor : COLOR; + // #endif + + #if _PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR)) + float3 previousPositionOS : TEXCOORD4; // Contain previous transform position (in case of skinning for example) + #if defined (_ADD_PRECOMPUTED_VELOCITY) + float3 precomputedVelocity : TEXCOORD5; // Add Precomputed Velocity (Alembic computes velocities on runtime side). + #endif + #endif + + UNITY_VERTEX_INPUT_INSTANCE_ID + }; + + struct TessVertex + { + float4 vertex : INTERNALTESSPOS; + float3 normal : NORMAL; + float4 tangent : TANGENT; + float4 texcoord0 : TEXCOORD0; + float4 texcoord1 : TEXCOORD1; + float4 texcoord2 : TEXCOORD2; + + // #if %TEXCOORD3REQUIREKEY% + float4 texcoord3 : TEXCOORD3; + // #endif + + // #if %VERTEXCOLORREQUIREKEY% + float4 vertexColor : COLOR; + // #endif + + // #if %EXTRAV2F0REQUIREKEY% + // float4 extraV2F0 : TEXCOORD5; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // float4 extraV2F1 : TEXCOORD6; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // float4 extraV2F2 : TEXCOORD7; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // float4 extraV2F3 : TEXCOORD8; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // float4 extraV2F4 : TEXCOORD9; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // float4 extraV2F5 : TEXCOORD10; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // float4 extraV2F6 : TEXCOORD11; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // float4 extraV2F7 : TEXCOORD12; + // #endif + + #if _PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR)) + float3 previousPositionOS : TEXCOORD13; // Contain previous transform position (in case of skinning for example) + #if defined (_ADD_PRECOMPUTED_VELOCITY) + float3 precomputedVelocity : TEXCOORD14; + #endif + #endif + + UNITY_VERTEX_INPUT_INSTANCE_ID + UNITY_VERTEX_OUTPUT_STEREO + }; + + struct ExtraV2F + { + float4 extraV2F0; + float4 extraV2F1; + float4 extraV2F2; + float4 extraV2F3; + float4 extraV2F4; + float4 extraV2F5; + float4 extraV2F6; + float4 extraV2F7; + Blackboard blackboard; + float4 time; + }; + + + float3 WorldToTangentSpace(ShaderData d, float3 normal) + { + return mul(d.TBNMatrix, normal); + } + + float3 TangentToWorldSpace(ShaderData d, float3 normal) + { + return mul(normal, d.TBNMatrix); + } + + // in this case, make standard more like SRPs, because we can't fix + // unity_WorldToObject in HDRP, since it already does macro-fu there + + #if _STANDARD + float3 TransformWorldToObject(float3 p) { return mul(unity_WorldToObject, float4(p, 1)); }; + float3 TransformObjectToWorld(float3 p) { return mul(unity_ObjectToWorld, float4(p, 1)); }; + float4 TransformWorldToObject(float4 p) { return mul(unity_WorldToObject, p); }; + float4 TransformObjectToWorld(float4 p) { return mul(unity_ObjectToWorld, p); }; + float4x4 GetWorldToObjectMatrix() { return unity_WorldToObject; } + float4x4 GetObjectToWorldMatrix() { return unity_ObjectToWorld; } + #if (defined(SHADER_API_D3D11) || defined(SHADER_API_XBOXONE) || defined(UNITY_COMPILER_HLSLCC) || defined(SHADER_API_PSSL) || (SHADER_TARGET_SURFACE_ANALYSIS && !SHADER_TARGET_SURFACE_ANALYSIS_MOJOSHADER)) + #define UNITY_SAMPLE_TEX2D_LOD(tex,coord, lod) tex.SampleLevel (sampler##tex,coord, lod) + #define UNITY_SAMPLE_TEX2D_SAMPLER_LOD(tex,samplertex,coord, lod) tex.SampleLevel (sampler##samplertex,coord, lod) + #else + #define UNITY_SAMPLE_TEX2D_LOD(tex,coord,lod) tex2D (tex,coord,0,lod) + #define UNITY_SAMPLE_TEX2D_SAMPLER_LOD(tex,samplertex,coord,lod) tex2D (tex,coord,0,lod) + #endif + + #undef GetWorldToObjectMatrix() + + #define GetWorldToObjectMatrix() unity_WorldToObject + + + #endif + + float3 GetCameraWorldPosition() + { + #if _HDRP + return GetCameraRelativePositionWS(_WorldSpaceCameraPos); + #else + return _WorldSpaceCameraPos; + #endif + } + + #if _GRABPASSUSED + #if _STANDARD + TEXTURE2D(%GRABTEXTURE%); + SAMPLER(sampler_%GRABTEXTURE%); + #endif + + half3 GetSceneColor(float2 uv) + { + #if _STANDARD + return SAMPLE_TEXTURE2D(%GRABTEXTURE%, sampler_%GRABTEXTURE%, uv).rgb; + #else + return SHADERGRAPH_SAMPLE_SCENE_COLOR(uv); + #endif + } + #endif + + + + #if _STANDARD + UNITY_DECLARE_DEPTH_TEXTURE(_CameraDepthTexture); + float GetSceneDepth(float2 uv) { return SAMPLE_DEPTH_TEXTURE(_CameraDepthTexture, uv); } + float GetLinear01Depth(float2 uv) { return Linear01Depth(GetSceneDepth(uv)); } + float GetLinearEyeDepth(float2 uv) { return LinearEyeDepth(GetSceneDepth(uv)); } + #else + float GetSceneDepth(float2 uv) { return SHADERGRAPH_SAMPLE_SCENE_DEPTH(uv); } + float GetLinear01Depth(float2 uv) { return Linear01Depth(GetSceneDepth(uv), _ZBufferParams); } + float GetLinearEyeDepth(float2 uv) { return LinearEyeDepth(GetSceneDepth(uv), _ZBufferParams); } + #endif + + float3 GetWorldPositionFromDepthBuffer(float2 uv, float3 worldSpaceViewDir) + { + float eye = GetLinearEyeDepth(uv); + float3 camView = mul((float3x3)GetObjectToWorldMatrix(), transpose(mul(GetWorldToObjectMatrix(), UNITY_MATRIX_I_V)) [2].xyz); + + float dt = dot(worldSpaceViewDir, camView); + float3 div = worldSpaceViewDir/dt; + float3 wpos = (eye * div) + GetCameraWorldPosition(); + return wpos; + } + + #if _HDRP + float3 ObjectToWorldSpacePosition(float3 pos) + { + return GetAbsolutePositionWS(TransformObjectToWorld(pos)); + } + #else + float3 ObjectToWorldSpacePosition(float3 pos) + { + return TransformObjectToWorld(pos); + } + #endif + + #if _STANDARD + UNITY_DECLARE_SCREENSPACE_TEXTURE(_CameraDepthNormalsTexture); + float3 GetSceneNormal(float2 uv, float3 worldSpaceViewDir) + { + float4 depthNorms = UNITY_SAMPLE_SCREENSPACE_TEXTURE(_CameraDepthNormalsTexture, uv); + float3 norms = DecodeViewNormalStereo(depthNorms); + norms = mul((float3x3)GetWorldToViewMatrix(), norms) * 0.5 + 0.5; + return norms; + } + #elif _HDRP && !_DECALSHADER + + float3 GetSceneNormal(float2 uv, float3 worldSpaceViewDir) + { + NormalData nd; + DecodeFromNormalBuffer(_ScreenSize.xy * uv, nd); + return nd.normalWS; + } + #elif _URP + #if (SHADER_LIBRARY_VERSION_MAJOR >= 10) + #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/DeclareNormalsTexture.hlsl" + #endif + + float3 GetSceneNormal(float2 uv, float3 worldSpaceViewDir) + { + #if (SHADER_LIBRARY_VERSION_MAJOR >= 10) + return SampleSceneNormals(uv); + #else + float3 wpos = GetWorldPositionFromDepthBuffer(uv, worldSpaceViewDir); + return normalize(-cross(ddx(wpos), ddy(wpos))) * 0.5 + 0.5; + #endif + + } + #endif + + #if _HDRP + + half3 UnpackNormalmapRGorAG(half4 packednormal) + { + // This do the trick + packednormal.x *= packednormal.w; + + half3 normal; + normal.xy = packednormal.xy * 2 - 1; + normal.z = sqrt(1 - saturate(dot(normal.xy, normal.xy))); + return normal; + } + half3 UnpackNormal(half4 packednormal) + { + #if defined(UNITY_NO_DXT5nm) + return packednormal.xyz * 2 - 1; + #else + return UnpackNormalmapRGorAG(packednormal); + #endif + } + #endif + #if _HDRP || _URP + + half3 UnpackScaleNormal(half4 packednormal, half scale) + { + #ifndef UNITY_NO_DXT5nm + // Unpack normal as DXT5nm (1, y, 1, x) or BC5 (x, y, 0, 1) + // Note neutral texture like "bump" is (0, 0, 1, 1) to work with both plain RGB normal and DXT5nm/BC5 + packednormal.x *= packednormal.w; + #endif + half3 normal; + normal.xy = (packednormal.xy * 2 - 1) * scale; + normal.z = sqrt(1 - saturate(dot(normal.xy, normal.xy))); + return normal; + } + + #endif + + + void GetSun(out float3 lightDir, out float3 color) + { + lightDir = float3(0.5, 0.5, 0); + color = 1; + #if _HDRP + if (_DirectionalLightCount > 0) + { + DirectionalLightData light = _DirectionalLightDatas[0]; + lightDir = -light.forward.xyz; + color = light.color; + } + #elif _STANDARD + lightDir = normalize(_WorldSpaceLightPos0.xyz); + color = _LightColor0.rgb; + #elif _URP + Light light = GetMainLight(); + lightDir = light.direction; + color = light.color; + #endif + } + + + + + CBUFFER_START(UnityPerMaterial) + + float _StencilRef; + float _StencilWriteMask; + float _StencilRefDepth; + float _StencilWriteMaskDepth; + float _StencilRefMV; + float _StencilWriteMaskMV; + float _StencilRefDistortionVec; + float _StencilWriteMaskDistortionVec; + float _StencilWriteMaskGBuffer; + float _StencilRefGBuffer; + float _ZTestGBuffer; + float _RequireSplitLighting; + float _ReceivesSSR; + float _ZWrite; + float _TransparentSortPriority; + float _ZTestDepthEqualForOpaque; + float _ZTestTransparent; + float _TransparentBackfaceEnable; + float _AlphaCutoffEnable; + float _UseShadowThreshold; + + + half4 _Color; + half4 _MainTex_ST, _MainTex_TexelSize; + half _Alpha, _AlphaCutoffValue; + + #if ATLAS_ON + half _MinXUV, _MaxXUV, _MinYUV, _MaxYUV; + #endif + + #if GLOW_ON + half4 _GlowColor; + half _Glow, _GlowGlobal; + #endif + + #if HSV_ON + half _HsvShift, _HsvSaturation, _HsvBright; + #endif + + #if DISTORT_ON + half4 _DistortTex_ST; + half _DistortTexXSpeed, _DistortTexYSpeed, _DistortAmount; + #endif + + #if FADE_ON + half4 _FadeBurnColor, _FadeTex_ST, _FadeBurnTex_ST; + half _FadeAmount, _FadeBurnWidth, _FadeBurnTransition,_FadeBurnGlow; + #endif + + #if OUTBASE_ON + half4 _OutlineColor; + half _OutlineAlpha, _OutlineGlow, _OutlineWidth; + int _OutlinePixelWidth; + #endif + + #if OUTTEX_ON + half4 _OutlineTex_ST; + half _OutlineTexXSpeed, _OutlineTexYSpeed; + #endif + + #if OUTDIST_ON + half4 _OutlineDistortTex_ST; + half _OutlineDistortTexXSpeed, _OutlineDistortTexYSpeed, _OutlineDistortAmount; + #endif + + #if ALPHAOUTLINE_ON + half _AlphaOutlineGlow, _AlphaOutlinePower, _AlphaOutlineMinAlpha, _AlphaOutlineBlend; + half4 _AlphaOutlineColor; + #endif + + #if INNEROUTLINE_ON + half _InnerOutlineThickness, _InnerOutlineAlpha, _InnerOutlineGlow; + half4 _InnerOutlineColor; + #endif + + #if GRADIENT_ON + half _GradBlend, _GradBoostX, _GradBoostY; + half4 _GradTopRightCol, _GradTopLeftCol, _GradBotRightCol, _GradBotLeftCol; + #endif + + #if COLORSWAP_ON + half4 _ColorSwapRed, _ColorSwapGreen, _ColorSwapBlue; + half _ColorSwapRedLuminosity, _ColorSwapGreenLuminosity, _ColorSwapBlueLuminosity, _ColorSwapBlend; + #endif + + #if CHANGECOLOR_ON + half4 _ColorChangeNewCol, _ColorChangeTarget; + half _ColorChangeTolerance, _ColorChangeLuminosity; + #endif + #if CHANGECOLOR2_ON + half4 _ColorChangeNewCol2, _ColorChangeTarget2; + half _ColorChangeTolerance2; + #endif + #if CHANGECOLOR3_ON + half4 _ColorChangeNewCol3, _ColorChangeTarget3; + half _ColorChangeTolerance3; + #endif + + #if COLORRAMP_ON + half _ColorRampLuminosity, _ColorRampBlend; + #endif + + #if HITEFFECT_ON + half4 _HitEffectColor; + half _HitEffectGlow, _HitEffectBlend; + #endif + + #if NEGATIVE_ON + half _NegativeAmount; + #endif + + #if PIXELATE_ON + half _PixelateSize; + #endif + + #if GREYSCALE_ON + half _GreyscaleLuminosity, _GreyscaleBlend; + half4 _GreyscaleTintColor; + #endif + + #if POSTERIZE_ON + half _PosterizeNumColors, _PosterizeGamma; + #endif + + #if BLUR_ON + half _BlurIntensity; + #endif + + #if MOTIONBLUR_ON + half _MotionBlurAngle, _MotionBlurDist; + #endif + + #if GHOST_ON + half _GhostColorBoost, _GhostTransparency, _GhostBlend; + #endif + + #if HOLOGRAM_ON + half _HologramStripesAmount, _HologramMinAlpha, _HologramUnmodAmount, _HologramStripesSpeed, _HologramMaxAlpha, _HologramBlend; + half4 _HologramStripeColor; + #endif + + #if CHROMABERR_ON + half _ChromAberrAmount, _ChromAberrAlpha; + #endif + + #if GLITCH_ON + half _GlitchAmount, _GlitchSize; + #endif + + #if FLICKER_ON + half _FlickerFreq, _FlickerPercent, _FlickerAlpha; + #endif + + #if SHADOW_ON + half _ShadowX, _ShadowY, _ShadowAlpha; + half4 _ShadowColor; + #endif + + #if SHINE_ON + half4 _ShineColor; + half _ShineLocation, _ShineRotate, _ShineWidth, _ShineGlow; + #endif + + #if CONTRAST_ON + half _Contrast, _Brightness; + #endif + + #if OVERLAY_ON + half4 _OverlayTex_ST, _OverlayColor; + half _OverlayGlow, _OverlayBlend, _OverlayTextureScrollXSpeed, _OverlayTextureScrollYSpeed; + #endif + + #if DOODLE_ON + half _HandDrawnAmount, _HandDrawnSpeed; + #endif + + #if WIND_ON + half _GrassSpeed, _GrassWind, _GrassManualAnim, _GrassRadialBend; + #endif + + #if WAVEUV_ON + float _WaveAmount, _WaveSpeed, _WaveStrength, _WaveX, _WaveY; + #endif + + #if ROUNDWAVEUV_ON + half _RoundWaveStrength, _RoundWaveSpeed; + #endif + + #if RECTSIZE_ON + half _RectSize; + #endif + + #if OFFSETUV_ON + half _OffsetUvX, _OffsetUvY; + #endif + + #if CLIPPING_ON + half _ClipUvLeft, _ClipUvRight, _ClipUvUp, _ClipUvDown; + #endif + + #if RADIALCLIPPING_ON + half _RadialStartAngle, _RadialClip, _RadialClip2; + #endif + + #if TEXTURESCROLL_ON + half _TextureScrollXSpeed, _TextureScrollYSpeed; + #endif + + #if ZOOMUV_ON + half _ZoomUvAmount; + #endif + + #if WARP_ON + half _WarpStrength, _WarpSpeed, _WarpScale; + #endif + + #if TWISTUV_ON + half _TwistUvAmount, _TwistUvPosX, _TwistUvPosY, _TwistUvRadius; + #endif + + #if ROTATEUV_ON + half _RotateUvAmount; + #endif + + #if FISHEYE_ON + half _FishEyeUvAmount; + #endif + + #if PINCH_ON + half _PinchUvAmount; + #endif + + #if SHAKEUV_ON + half _ShakeUvSpeed, _ShakeUvX, _ShakeUvY; + #endif + + #if NORMALMAP_ON + half _NormalStrength; + #endif + + float _RandomSeed; + + + + + CBUFFER_END + + + + + + + + TEXTURE2D(_MainTex); + SAMPLER(sampler_MainTex); + + #if GLOW_ON + TEXTURE2D(_GlowTex); + SAMPLER(sampler_GlowTex); + #endif + + #if FADE_ON + TEXTURE2D(_FadeTex); + SAMPLER(sampler_FadeTex); + + TEXTURE2D(_FadeBurnTex); + SAMPLER(sampler_FadeBurnTex); + #endif + + #if DISTORT_ON + TEXTURE2D(_DistortTex); + SAMPLER(sampler_DistortTex); + #endif + + #if OUTTEX_ON + TEXTURE2D(_OutlineTex); + SAMPLER(sampler_OutlineTex); + #endif + + #if OUTDIST_ON + TEXTURE2D(_OutlineDistortTex); + SAMPLER(sampler_OutlineDistortTex); + #endif + + #if COLORSWAP_ON + TEXTURE2D(_ColorSwapTex); + SAMPLER(sampler_ColorSwapTex); + #endif + + #if COLORRAMP_ON + TEXTURE2D(_ColorRampTex); + TEXTURE2D(_ColorRampTexGradient); + SAMPLER(sampler_ColorRampTex); + SAMPLER(sampler_ColorRampTexGradient); + #endif + + #if SHINE_ON + TEXTURE2D(_ShineMask); + SAMPLER(sampler_ShineMask); + #endif + + #if OVERLAY_ON + TEXTURE2D(_OverlayTex); + SAMPLER(sampler_OverlayTex); + #endif + + #if NORMALMAP_ON + TEXTURE2D(_NormalMap); + SAMPLER(sampler_NormalMap); + #endif + + + half3 GetPixel(in int offsetX, in int offsetY, in half2 uv, in Texture2D _tex, in SamplerState _sampler) + { + half2 _uv = uv + half2(offsetX * _MainTex_TexelSize.x, offsetY * _MainTex_TexelSize.y); + half4 col = SAMPLE_TEXTURE2D(_tex, _sampler, _uv); + return col.rgb; + } + + + //BLURS------------------------------------------------------------------------- + half4 Blur(half2 uv, Texture2D source, SamplerState sampler_source, half Intensity) + { + const half2 texelSize = 1.0 / _ScreenParams.xy; + const half4 color = SAMPLE_TEXTURE2D(source, sampler_source, uv); + const half2 offset = Intensity * texelSize; + + half4 accumulatedColor = color; + half accumulatedWeight = 1.0; + for (int x = -1; x <= 1; x++) + { + for (int y = -1; y <= 1; y++) + { + const half2 sampleUV = uv + half2(x, y) * offset; + const half4 sampleColor = SAMPLE_TEXTURE2D(source, sampler_source, sampleUV); + + accumulatedColor += sampleColor; + accumulatedWeight += 1.0; + } + } + + half4 blurredColor = accumulatedColor / accumulatedWeight; + return blurredColor; + } + + half BlurHD_G(half bhqp, half x) + { + return exp(-(x * x) / (2.0 * bhqp * bhqp)); + } + half4 BlurHD(half2 uv, Texture2D source, SamplerState sampler_source, half BlurAmount, half xScale, half yScale) + { + int iterations = 16; + int halfIterations = iterations / 2; + half sigmaX = 0.1 + BlurAmount * 0.5; + half sigmaY = sigmaX; + half total = 0.0; + half4 ret = half4(0, 0, 0, 0); + for (int iy = 0; iy < iterations; ++iy) + { + half fy = BlurHD_G(sigmaY, half(iy) -half(halfIterations)); + half offsetY = half(iy - halfIterations) * 0.00390625 * xScale; + for (int ix = 0; ix < iterations; ++ix) + { + half fx = BlurHD_G(sigmaX, half(ix) - half(halfIterations)); + half offsetX = half(ix - halfIterations) * 0.00390625 * yScale; + total += fx * fy; + ret += SAMPLE_TEXTURE2D(source, sampler_source, uv + half2(offsetX, offsetY)) * fx * fy; + } + } + return ret / total; + } + //----------------------------------------------------------------------- + + + //------------------------------------------- + half RemapFloat(half inValue, half inMin, half inMax, half outMin, half outMax){ + return outMin + (inValue - inMin) * (outMax - outMin) / (inMax - inMin); + } + //------------------------------------------- + + //----------------------------------------------------------------------- + half rand(half2 seed, half offset) { + return (frac(sin(dot(seed, half2(12.9898, 78.233))) * 43758.5453) + offset) % 1.0; + } + + half rand2(half2 seed, half offset) { + return (frac(sin(dot(seed * floor(50 + (_Time.x % 1.0) * 12.), half2(127.1, 311.7))) * 43758.5453123) + offset) % 1.0; + } + + half rand2CustomTime(half2 seed, half offset, half customTime) { + return (frac(sin(dot(seed * floor(50 + (customTime % 1.0) * 12.), half2(127.1, 311.7))) * 43758.5453123) + offset) % 1.0; + } + //----------------------------------------------------------------------- + + + void Ext_ModifyVertex0 (inout VertexData v, inout ExtraV2F d) + { + //BILBOARD_ON + #if BILBOARD_ON + half3 camRight = mul((half3x3)unity_CameraToWorld, half3(1,0,0)); + half3 camUp = half3(0,1,0); + #if BILBOARDY_ON + camUp = mul((half3x3)unity_CameraToWorld, half3(0,1,0)); + #endif + half3 localPos = v.vertex.x * camRight + v.vertex.y * camUp; + v.vertex = half4(localPos, 1); + #endif + //----------------------------------------------------------- + + v.texcoord0.xy = TRANSFORM_TEX(v.texcoord0.xy, _MainTex); + half2 center = half2(0.5, 0.5); + #if ATLAS_ON + center = half2((_MaxXUV + _MinXUV) / 2.0, (_MaxYUV + _MinYUV) / 2.0); + #endif + + //POLARUV_ON + #if POLARUV_ON + v.texcoord0.xy = v.texcoord0.xy - center; + #endif + + //---------------------------------------- + + //ROTATEUV_ON + #if ROTATEUV_ON + half2 uvC = v.texcoord0.xy; + half cosAngle = cos(_RotateUvAmount); + half sinAngle = sin(_RotateUvAmount); + half2x2 rot = half2x2(cosAngle, -sinAngle, sinAngle, cosAngle); + uvC -= center; + v.texcoord0.xy = mul(rot, uvC); + v.texcoord0.xy += center; + #endif + //-------------------- + + #if RECTSIZE_ON + v.vertex.xyz += (v.vertex.xyz * (_RectSize - 1.0)); + #endif + + #if OUTTEX_ON + v.texcoord1.xy = TRANSFORM_TEX(v.texcoord0.xy, _OutlineTex); + #endif + + #if OUTDIST_ON + v.texcoord2.xy = TRANSFORM_TEX(v.texcoord0.xy, _OutlineDistortTex); + #endif + + #if DISTORT_ON + v.texcoord3.xy = TRANSFORM_TEX(v.texcoord0.xy, _DistortTex); + #endif + } + + void Ext_SurfaceFunction0 (inout Surface o, ShaderData d) + { + half randomSeed = _RandomSeed; + + float2 uvRect = d.texcoord0; + half2 center = half2(0.5, 0.5); + #if ATLAS_ON + center = half2((_MaxXUV + _MinXUV) / 2.0, (_MaxYUV + _MinYUV) / 2.0); + uvRect = half2((d.texcoord0.x - _MinXUV) / (_MaxXUV - _MinXUV), (d.texcoord0.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half2 centerTiled = half2(center.x * _MainTex_ST.x, center.y * _MainTex_ST.y); + + //CLIPPING_ON + #if CLIPPING_ON + half2 tiledUv = half2(d.texcoord0.x / _MainTex_ST.x, d.texcoord0.y / _MainTex_ST.y); + #if ATLAS_ON + tiledUv = half2((tiledUv.x - _MinXUV) / (_MaxXUV - _MinXUV), (tiledUv.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + clip((1 - _ClipUvUp) - tiledUv.y); + clip(tiledUv.y - _ClipUvDown); + clip((1 - _ClipUvRight) - tiledUv.x); + clip(tiledUv.x - _ClipUvLeft); + #endif + //---------------------------------- + + //RADIALCLIPPING_ON + #if RADIALCLIPPING_ON + half2 tiledUv2 = half2(d.texcoord0.x / _MainTex_ST.x, d.texcoord0.y / _MainTex_ST.y); + #if ATLAS_ON + tiledUv2 = half2((tiledUv2.x - _MinXUV) / (_MaxXUV - _MinXUV), (tiledUv2.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half startAngle = _RadialStartAngle - _RadialClip; + half endAngle = _RadialStartAngle + _RadialClip2; + half offset0 = clamp(0, 360, startAngle + 360); + half offset360 = clamp(0, 360, endAngle - 360); + half2 atan2Coord = half2(lerp(-1, 1, tiledUv2.x), lerp(-1, 1, tiledUv2.y)); + half atanAngle = atan2(atan2Coord.y, atan2Coord.x) * 57.3; // angle in degrees + if(atanAngle < 0) atanAngle = 360 + atanAngle; + if(atanAngle >= startAngle && atanAngle <= endAngle) discard; + if(atanAngle <= offset360) discard; + if(atanAngle >= offset0) discard; + #endif + + //----------------------------- + + //TEXTURESCROLL_ON && ATLAS_ON + #if TEXTURESCROLL_ON && ATLAS_ON + d.texcoord0.xy = half2(_MinXUV + ((_MaxXUV - _MinXUV) * (abs(((_Time.y + randomSeed) * _TextureScrollXSpeed) + uvRect.x) % 1)), + _MinYUV + ((_MaxYUV - _MinYUV) * (abs(((_Time.y + randomSeed) * _TextureScrollYSpeed) + uvRect.y) % 1))); + #endif + //---------------------------- + + //OFFSETUV_ON + #if OFFSETUV_ON + #if ATLAS_ON + d.texcoord0.xy = half2(_MinXUV + ((_MaxXUV - _MinXUV) * (abs((_OffsetUvX + uvRect.x) % 1))), + _MinYUV + ((_MaxYUV - _MinYUV) * (abs(_OffsetUvY + uvRect.y) % 1))); + #else + d.texcoord0.xy += half2(_OffsetUvX, _OffsetUvY); + #endif + #endif + + //---------------------- + + //POLARUV_ON + #if POLARUV_ON + d.texcoord0.xy = half2(atan2(d.texcoord0.y, d.texcoord0.x) / (2.0f * 3.141592653589f), length(d.texcoord0.xy)); + d.texcoord0.xy *= _MainTex_ST.xy; + #endif + + //-------------------------------------- + + //TWISTUV_ON + #if TWISTUV_ON + #if ATLAS_ON + _TwistUvPosX = ((_MaxXUV - _MinXUV) * _TwistUvPosX) + _MinXUV; + _TwistUvPosY = ((_MaxYUV - _MinYUV) * _TwistUvPosY) + _MinYUV; + #endif + half2 tempUv = d.texcoord0.xy - half2(_TwistUvPosX * _MainTex_ST.x, _TwistUvPosY * _MainTex_ST.y); + _TwistUvRadius *= (_MainTex_ST.x + _MainTex_ST.y) / 2; + half percent = (_TwistUvRadius - length(tempUv)) / _TwistUvRadius; + half theta = percent * percent * (2.0 * sin(_TwistUvAmount)) * 8.0; + half s = sin(theta); + half c = cos(theta); + half beta = max(sign(_TwistUvRadius - length(tempUv)), 0.0); + tempUv = half2(dot(tempUv, half2(c, -s)), dot(tempUv, half2(s, c))) * beta + tempUv * (1 - beta); + tempUv += half2(_TwistUvPosX * _MainTex_ST.x, _TwistUvPosY * _MainTex_ST.y); + d.texcoord0.xy = tempUv; + #endif + + //-------------------------------------------- + + //FISHEYE_ON + #if FISHEYE_ON + half bind = length(centerTiled); + half2 dF = d.texcoord0.xy - centerTiled; + half dFlen = length(dF); + half fishInt = (3.14159265359 / bind) * (_FishEyeUvAmount + 0.001); + d.texcoord0.xy = centerTiled + (dF / (max(0.0001, dFlen))) * tan(dFlen * fishInt) * bind / tan(bind * fishInt); + #endif + //--------------------------------------------- + + //PINCH_ON + #if PINCH_ON + half2 dP = d.texcoord0.xy - centerTiled; + half pinchInt = (3.141592 / length(centerTiled)) * (-_PinchUvAmount + 0.001); + d.texcoord0.xy = centerTiled + normalize(dP) * atan(length(dP) * -pinchInt * 10.0) * 0.5 / atan(-pinchInt * 5); + #endif + + //--------------------------------------------- + + //ZOOMUV_ON + #if ZOOMUV_ON + d.texcoord0.xy -= centerTiled; + d.texcoord0.xy = d.texcoord0.xy * _ZoomUvAmount; + d.texcoord0.xy += centerTiled; + #endif + + //----------------------------------------------- + + //DOODLE_ON + #if DOODLE_ON + half2 uvCopy = uvRect; + _HandDrawnSpeed = (floor((_Time.x + randomSeed) * 20 * _HandDrawnSpeed) / _HandDrawnSpeed) * _HandDrawnSpeed; + uvCopy.x = sin((uvCopy.x * _HandDrawnAmount + _HandDrawnSpeed) * 4); + uvCopy.y = cos((uvCopy.y * _HandDrawnAmount + _HandDrawnSpeed) * 4); + d.texcoord0.xy = lerp(d.texcoord0.xy, d.texcoord0.xy + uvCopy, 0.0005 * _HandDrawnAmount); + #endif + + //-------------------------- + + //SHAKEUV_ON + #if SHAKEUV_ON + half xShake = sin((_Time.x + randomSeed) * _ShakeUvSpeed * 50) * _ShakeUvX; + half yShake = cos((_Time.x + randomSeed) * _ShakeUvSpeed * 50) * _ShakeUvY; + d.texcoord0.xy += half2(xShake * 0.012, yShake * 0.01); + #endif + + //------------------------------------------- + + //RECTSIZE_ON + #if RECTSIZE_ON + d.texcoord0.xy = d.texcoord0.xy * (_RectSize).xx + (((-_RectSize * 0.5) + 0.5)).xx; + #endif + + //------------------------------------------- + + //DISTORT_ON + #if DISTORT_ON + #if ATLAS_ON + d.texcoord3.x = d.texcoord3.x * (1 / (_MaxXUV - _MinXUV)); + d.texcoord3.y = d.texcoord3.y * (1 / (_MaxYUV - _MinYUV)); + #endif + + d.texcoord3.x += ((_Time.x + _RandomSeed) * _DistortTexXSpeed) % 1; + d.texcoord3.y += ((_Time.x + _RandomSeed) * _DistortTexYSpeed) % 1; + half distortAmnt = (SAMPLE_TEXTURE2D(_DistortTex, sampler_DistortTex, d.texcoord3.xy).r - 0.5) * 0.2 * _DistortAmount; + d.texcoord0.x += distortAmnt; + d.texcoord0.y += distortAmnt; + #endif + //------------------------------------------------------- + + //WARP_ON + #if WARP_ON + half2 warpUv = half2(d.texcoord0.x / _MainTex_ST.x, d.texcoord0.y / _MainTex_ST.y); + #if ATLAS_ON + warpUv = half2((warpUv.x - _MinXUV) / (_MaxXUV - _MinXUV), (warpUv.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + const float tau = 6.283185307179586; + float xWarp = (_Time.y + randomSeed) * _WarpSpeed + warpUv.x * tau / _WarpScale; + float yWarp = (_Time.y + randomSeed) * _WarpSpeed + warpUv.y * tau / _WarpScale; + float2 warp = float2(sin(xWarp), sin(yWarp)) * _WarpStrength; + d.texcoord0.xy += warp; + #endif + + //------------------------------------------------------- + + //WAVEUV_ON + #if WAVEUV_ON + float2 uvWave = half2(_WaveX * _MainTex_ST.x, _WaveY * _MainTex_ST.y) - d.texcoord0.xy; + uvWave %= 1; + #if ATLAS_ON + uvWave = half2(_WaveX, _WaveY) - uvRect; + #endif + uvWave.x *= _ScreenParams.x / _ScreenParams.y; + float waveTime = _Time.y + randomSeed; + float angWave = (sqrt(dot(uvWave, uvWave)) * _WaveAmount) - ((waveTime * _WaveSpeed)); + d.texcoord0.xy = d.texcoord0.xy + uvWave * sin(angWave) * (_WaveStrength / 1000.0); + #endif + //---------------------------------------------------- + + //ROUNDWAVEUV_ON + #if ROUNDWAVEUV_ON + half xWave = ((0.5 * _MainTex_ST.x) - uvRect.x); + half yWave = ((0.5 * _MainTex_ST.y) - uvRect.y) * (_MainTex_TexelSize.w / _MainTex_TexelSize.z); + half ripple = -sqrt(xWave*xWave + yWave* yWave); + d.texcoord0.xy += (sin((ripple + (_Time.y + randomSeed) * (_RoundWaveSpeed/10.0)) / 0.015) * (_RoundWaveStrength/10.0)) % 1; + #endif + //---------------------------------------------------- + + + //WIND_ON + #if WIND_ON + half windOffset = sin((_Time.x + randomSeed) * _GrassSpeed * 10); + half2 windCenter = half2(0.5, 0.1); + #if ATLAS_ON + windCenter.x = ((_MaxXUV - _MinXUV) * windCenter.x) + _MinXUV; + windCenter.y = ((_MaxYUV - _MinYUV) * windCenter.y) + _MinYUV; + #endif + #if !MANUALWIND_ON + d.texcoord0.x = fmod(abs(lerp(d.texcoord0.x, d.texcoord0.x + (_GrassWind * 0.01 * windOffset), uvRect.y)), 1); + #else + d.texcoord0.x = fmod(abs(lerp(d.texcoord0.x, d.texcoord0.x + (_GrassWind * 0.01 * _GrassManualAnim), uvRect.y)), 1); + windOffset = _GrassManualAnim; + #endif + half2 delta = d.texcoord0.xy - windCenter; + half delta2 = dot(delta.xy, delta.xy); + half2 delta_offset = delta2 * windOffset; + d.texcoord0.xy = d.texcoord0.xy + half2(delta.y, -delta.x) * delta_offset * _GrassRadialBend; + #endif + + //-------------------------------------------------------- + + //TEXTURESCROLL_ON && !ATLAS_ON + #if TEXTURESCROLL_ON && !ATLAS_ON + d.texcoord0.x += ((_Time.y + randomSeed) * _TextureScrollXSpeed) % 1; + d.texcoord0.y += ((_Time.y + randomSeed) * _TextureScrollYSpeed) % 1; + #endif + //------------------------------ + + //PIXELATE_ON + #if PIXELATE_ON + half aspectRatio = _MainTex_TexelSize.x / _MainTex_TexelSize.y; + half2 pixelSize = float2(_PixelateSize, _PixelateSize * aspectRatio); + d.texcoord0.xy = floor(d.texcoord0.xy * pixelSize) / pixelSize; + #endif + //-------------- + + half4 col = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy); + half originalAlpha = col.a; + col *= d.vertexColor; + + //NORMAL MAP + #if NORMALMAP_ON + half4 normalSample = SAMPLE_TEXTURE2D(_NormalMap, sampler_NormalMap, d.texcoord0.xy); + half3 normalTS = UnpackNormal(normalSample); + normalTS.xy *= _NormalStrength; + o.Normal = normalTS; + #endif + + + //GLITCH_ON + #if GLITCH_ON + half2 uvGlitch = uvRect; + uvGlitch.y -= 0.5; + half lineNoise = pow(rand2(floor(uvGlitch * half2(24., 19.) * _GlitchSize) * 4.0, randomSeed), 3.0) * _GlitchAmount + * pow(rand2(floor(uvGlitch * half2(38., 14.) * _GlitchSize) * 4.0, randomSeed), 3.0); + col = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(lineNoise * 0.02 * rand2(half2(2.0, 1), randomSeed), 0)) * d.vertexColor; + #endif + //-------------------------------------- + + //CHROMABERR_ON + #if CHROMABERR_ON + half4 r = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(_ChromAberrAmount/10, 0)) * d.vertexColor; + half4 b = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(-_ChromAberrAmount/10, 0)) * d.vertexColor; + col = half4(r.r * r.a, col.g, b.b * b.a, max(max(r.a, b.a) * _ChromAberrAlpha, col.a)); + #endif + + //-------------------------------- + + //BLUR_ON + #if BLUR_ON + #if ATLAS_ON + #if !BLURISHD_ON + col = BlurHD(d.texcoord0.xy, _MainTex, sampler_MainTex, _BlurIntensity, (_MaxXUV - _MinXUV), (_MaxYUV - _MinYUV)) * d.vertexColor; + #else + col = Blur(d.texcoord0.xy, _MainTex, sampler_MainTex, _BlurIntensity * (_MaxXUV - _MinXUV)) * d.vertexColor; + #endif + #else + #if !BLURISHD_ON + col = BlurHD(d.texcoord0.xy, _MainTex, sampler_MainTex, _BlurIntensity, 1, 1) * d.vertexColor; + #else + col = Blur(d.texcoord0.xy, _MainTex, sampler_MainTex, _BlurIntensity) * d.vertexColor; + #endif + #endif + #endif + + //-------------------- + + //MOTIONBLUR_ON + #if MOTIONBLUR_ON + _MotionBlurAngle = _MotionBlurAngle * 3.1415926; + #define rot(n) mul(n, half2x2(cos(_MotionBlurAngle), -sin(_MotionBlurAngle), sin(_MotionBlurAngle), cos(_MotionBlurAngle))) + _MotionBlurDist = _MotionBlurDist * 0.005; + #if ATLAS_ON + _MotionBlurDist *= (_MaxXUV - _MinXUV); + #endif + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(-_MotionBlurDist, -_MotionBlurDist))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(-_MotionBlurDist * 2, -_MotionBlurDist * 2))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(-_MotionBlurDist * 3, -_MotionBlurDist * 3))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(-_MotionBlurDist * 4, -_MotionBlurDist * 4))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(_MotionBlurDist, _MotionBlurDist))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(_MotionBlurDist * 2, _MotionBlurDist * 2))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(_MotionBlurDist * 3, _MotionBlurDist * 3))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(_MotionBlurDist * 4, _MotionBlurDist * 4))); + col.rgb = col.rgb / 9; + #endif + //------------------------------------ + + //NEGATIVE_ON + #if NEGATIVE_ON + col.rgb = lerp(col.rgb, 1 - col.rgb, _NegativeAmount); + #endif + + //-------------- + half luminance = 0; + + //GREYSCALE_ON && !GREYSCALEOUTLINE_ON + #if GREYSCALE_ON && !GREYSCALEOUTLINE_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + luminance = saturate(luminance + _GreyscaleLuminosity); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _GreyscaleTintColor, _GreyscaleBlend); + #endif + //------------------------------------ + + //GHOST_ON + #if GHOST_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + half4 ghostResult; + ghostResult.a = saturate(luminance - _GhostTransparency) * col.a; + ghostResult.rgb = col.rgb * (luminance + _GhostColorBoost); + col = lerp(col, ghostResult, _GhostBlend); + #endif + //------------------------------------ + + //INNEROUTLINE_ON + #if INNEROUTLINE_ON + half3 innerT = abs(GetPixel(0, _InnerOutlineThickness, d.texcoord0.xy, _MainTex, sampler_MainTex) - GetPixel(0, -_InnerOutlineThickness, d.texcoord0.xy, _MainTex, sampler_MainTex)); + innerT += abs(GetPixel(_InnerOutlineThickness, 0, d.texcoord0.xy, _MainTex, sampler_MainTex) - GetPixel(-_InnerOutlineThickness, 0, d.texcoord0.xy, _MainTex, sampler_MainTex)); + #if !ONLYINNEROUTLINE_ON + innerT = (innerT / 2.0) * col.a * _InnerOutlineAlpha; + col.rgb += length(innerT) * _InnerOutlineColor.rgb * _InnerOutlineGlow; + #else + innerT *= col.a * _InnerOutlineAlpha; + col.rgb = length(innerT) * _InnerOutlineColor.rgb * _InnerOutlineGlow; + col.a = step(0.3, col.r+col.g+col.b); + #endif + #endif + //------------------------------------------------------- + + //HITEFFECT_ON + #if HITEFFECT_ON + col.rgb = lerp(col.rgb, _HitEffectColor.rgb * _HitEffectGlow, _HitEffectBlend); + #endif + //-------------------- + + //GRADIENT_ON + #if GRADIENT_ON + half2 tiledUvGrad = half2(uvRect.x / _MainTex_ST.x, uvRect.y / _MainTex_ST.y); + #if GRADIENT2COL_ON + _GradTopRightCol = _GradTopLeftCol; + _GradBotRightCol = _GradBotLeftCol; + #endif + #if RADIALGRADIENT_ON + half radialDist = 1 - length(tiledUvGrad - half2(0.5, 0.5)); + radialDist *= (_MainTex_TexelSize.w / _MainTex_TexelSize.z); + radialDist = saturate(_GradBoostX * radialDist); + half4 gradientResult = lerp(_GradTopLeftCol, _GradBotLeftCol, radialDist); + #else + half gradXLerpFactor = saturate(pow(tiledUvGrad.x, _GradBoostX)); + half4 gradientResult = lerp(lerp(_GradBotLeftCol, _GradBotRightCol, gradXLerpFactor), + lerp(_GradTopLeftCol, _GradTopRightCol, gradXLerpFactor), saturate(pow(tiledUvGrad.y, _GradBoostY))); + #endif + gradientResult = lerp(col, gradientResult, _GradBlend); + col.rgb = gradientResult.rgb * col.a; + col.a *= gradientResult.a; + #endif + //-------------------------------------------------------------------- + + //CONTRAST_ON + #if CONTRAST_ON + col.rgb = (col.rgb - float3(0.5, 0.5, 0.5)) * _Contrast + float3(0.5, 0.5, 0.5); + col.rgb += _Brightness; + #endif + + //------------------------------------------------------------------- + + //COLORSWAP_ON + #if COLORSWAP_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + half4 swapMask = SAMPLE_TEXTURE2D(_ColorSwapTex, sampler_ColorSwapTex, d.texcoord0.xy); + swapMask.rgb *= swapMask.a; + half3 redSwap = _ColorSwapRed * swapMask.r * saturate(luminance + _ColorSwapRedLuminosity); + half3 greenSwap = _ColorSwapGreen * swapMask.g * saturate(luminance + _ColorSwapGreenLuminosity); + half3 blueSwap = _ColorSwapBlue * swapMask.b * saturate(luminance + _ColorSwapBlueLuminosity); + swapMask.rgb = col.rgb * saturate(1 - swapMask.r - swapMask.g - swapMask.b); + col.rgb = lerp(col.rgb, swapMask.rgb + redSwap + greenSwap + blueSwap, _ColorSwapBlend); + #endif + //-------------------------------------------------------------------- + + //COLORRAMP_ON && !COLORRAMPOUTLINE_ON + #if COLORRAMP_ON && !COLORRAMPOUTLINE_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + luminance = saturate(luminance + _ColorRampLuminosity); + #if GRADIENTCOLORRAMP_ON + col.rgb = lerp(col.rgb, SAMPLE_TEXTURE2D(_ColorRampTexGradient, sampler_ColorRampTexGradient, half2(luminance, 0)).rgb, _ColorRampBlend); + #else + col.rgb = lerp(col.rgb, SAMPLE_TEXTURE2D(_ColorRampTex, sampler_ColorRampTex, half2(luminance, 0)).rgb, _ColorRampBlend); + #endif + #endif + //-------------------------------------------------------------------- + + //CHANGECOLOR_ON + #if CHANGECOLOR_ON + float3 currChangeColor = saturate(col.rgb); + luminance = 0.3 * currChangeColor.r + 0.59 * currChangeColor.g + 0.11 * currChangeColor.b; + luminance = saturate(luminance + _ColorChangeLuminosity); + half3 dif = abs(currChangeColor - _ColorChangeTarget.rgb); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _ColorChangeNewCol.rgb, + max(sign(1 - saturate(dif.x + dif.y + dif.z) - _ColorChangeTolerance), 0.0)); + #if CHANGECOLOR2_ON + dif = abs(currChangeColor - _ColorChangeTarget2.rgb); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _ColorChangeNewCol2.rgb, + max(sign(1 - saturate(dif.x + dif.y + dif.z) - _ColorChangeTolerance2), 0.0)); + #endif + #if CHANGECOLOR3_ON + dif = abs(currChangeColor - _ColorChangeTarget3.rgb); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _ColorChangeNewCol3.rgb, + max(sign(1 - saturate(dif.x + dif.y + dif.z) - _ColorChangeTolerance3), 0.0)); + #endif + #endif + //------------------------------------------------------- + + //POSTERIZE_ON && !POSTERIZEOUTLINE_ON + #if POSTERIZE_ON && !POSTERIZEOUTLINE_ON + col.rgb = pow(col.rgb, _PosterizeGamma) * _PosterizeNumColors; + col.rgb = floor(col.rgb) / _PosterizeNumColors; + col.rgb = pow(col.rgb, 1.0 / _PosterizeGamma); + #endif + //------------------------------------ + + //HSV_ON + #if HSV_ON + half3 resultHsv = half3(col.rgb); + half cosHsv = _HsvBright * _HsvSaturation * cos(_HsvShift * 3.14159265 / 180); + half sinHsv = _HsvBright * _HsvSaturation * sin(_HsvShift * 3.14159265 / 180); + resultHsv.x = (.299 * _HsvBright + .701 * cosHsv + .168 * sinHsv) * col.x + + (.587 * _HsvBright - .587 * cosHsv + .330 * sinHsv) * col.y + + (.114 * _HsvBright - .114 * cosHsv - .497 * sinHsv) * col.z; + resultHsv.y = (.299 * _HsvBright - .299 * cosHsv - .328 * sinHsv) *col.x + + (.587 * _HsvBright + .413 * cosHsv + .035 * sinHsv) * col.y + + (.114 * _HsvBright - .114 * cosHsv + .292 * sinHsv) * col.z; + resultHsv.z = (.299 * _HsvBright - .3 * cosHsv + 1.25 * sinHsv) * col.x + + (.587 * _HsvBright - .588 * cosHsv - 1.05 * sinHsv) * col.y + + (.114 * _HsvBright + .886 * cosHsv - .203 * sinHsv) * col.z; + col.rgb = resultHsv; + #endif + //------------------------------------------------------- + + //OVERLAY_ON + #if OVERLAY_ON + half2 overlayUvs = d.texcoord0.xy; + overlayUvs.x += ((_Time.y + randomSeed) * _OverlayTextureScrollXSpeed) % 1; + overlayUvs.y += ((_Time.y + randomSeed) * _OverlayTextureScrollYSpeed) % 1; + half4 overlayCol = SAMPLE_TEXTURE2D(_OverlayTex, sampler_OverlayTex, TRANSFORM_TEX(overlayUvs, _OverlayTex)); + overlayCol.rgb *= _OverlayColor.rgb * _OverlayGlow; + #if !OVERLAYMULT_ON + overlayCol.rgb *= overlayCol.a * _OverlayColor.rgb * _OverlayColor.a * _OverlayBlend; + col.rgb += overlayCol.rgb; + #else + overlayCol.a *= _OverlayColor.a; + col = lerp(col, col * overlayCol, _OverlayBlend); + #endif + #endif + + //--------------------------------- + + //OUTBASE_ON + #if OUTBASE_ON + #if OUTBASEPIXELPERF_ON + half2 destUv = half2(_OutlinePixelWidth * _MainTex_TexelSize.x, _OutlinePixelWidth * _MainTex_TexelSize.y); + #else + half2 destUv = half2(_OutlineWidth * _MainTex_TexelSize.x * 200, _OutlineWidth * _MainTex_TexelSize.y * 200); + #endif + + #if OUTDIST_ON + d.texcoord3.x += ((_Time.x + _RandomSeed) * _OutlineDistortTexXSpeed) % 1; + d.texcoord3.y += ((_Time.x + _RandomSeed) * _OutlineDistortTexYSpeed) % 1; + #if ATLAS_ON + d.texcoord3 = half2((d.texcoord3.x - _MinXUV) / (_MaxXUV - _MinXUV), (d.texcoord3.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half outDistortAmnt = (SAMPLE_TEXTURE2D(_OutlineDistortTex, sampler_OutlineDistortTex, d.texcoord3).r - 0.5) * 0.2 * _OutlineDistortAmount; + destUv.x += outDistortAmnt; + destUv.y += outDistortAmnt; + #endif + + half spriteLeft = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(destUv.x, 0)).a; + half spriteRight = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy - half2(destUv.x, 0)).a; + half spriteBottom = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(0, destUv.y)).a; + half spriteTop = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy - half2(0, destUv.y)).a; + half result = spriteLeft + spriteRight + spriteBottom + spriteTop; + + #if OUTBASE8DIR_ON + half spriteTopLeft = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(destUv.x, destUv.y)).a; + half spriteTopRight = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(-destUv.x, destUv.y)).a; + half spriteBotLeft = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(destUv.x, -destUv.y)).a; + half spriteBotRight = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(-destUv.x, -destUv.y)).a; + result = result + spriteTopLeft + spriteTopRight + spriteBotLeft + spriteBotRight; + #endif + + result = step(0.05, saturate(result)); + + #if OUTTEX_ON + d.texcoord1.x += ((_Time.x + _RandomSeed) * _OutlineTexXSpeed) % 1; + d.texcoord1.y += ((_Time.x + _RandomSeed) * _OutlineTexYSpeed) % 1; + #if ATLAS_ON + d.texcoord1 = half2((d.texcoord1.x - _MinXUV) / (_MaxXUV - _MinXUV), (d.texcoord1.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half4 tempOutColor = SAMPLE_TEXTURE2D(_OutlineTex, sampler_OutlineTex, d.texcoord1); + tempOutColor *= _OutlineColor; + _OutlineColor = tempOutColor; + #endif + + result *= (1 - originalAlpha) * _OutlineAlpha; + + half4 outline = _OutlineColor * d.vertexColor.a; + outline.rgb *= _OutlineGlow; + outline.a = result; + #if ONLYOUTLINE_ON + col = outline; + #else + col = lerp(col, outline, result); + #endif + #endif + //------------------------------------------------------- + + //FADE_ON + #if FADE_ON + half2 tiledUvFade1 = TRANSFORM_TEX(d.texcoord0, _FadeTex); + half2 tiledUvFade2 = TRANSFORM_TEX(d.texcoord0, _FadeBurnTex); + #if ATLAS_ON + tiledUvFade1 = half2((tiledUvFade1.x - _MinXUV) / (_MaxXUV - _MinXUV), (tiledUvFade1.y - _MinYUV) / (_MaxYUV - _MinYUV)); + tiledUvFade2 = half2((tiledUvFade2.x - _MinXUV) / (_MaxXUV - _MinXUV), (tiledUvFade2.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half fadeTemp = SAMPLE_TEXTURE2D(_FadeTex, sampler_FadeTex, tiledUvFade1).r; + half fade = smoothstep(_FadeAmount, _FadeAmount + _FadeBurnTransition, fadeTemp); + half fadeBurn = saturate(smoothstep(_FadeAmount - _FadeBurnWidth, _FadeAmount - _FadeBurnWidth + 0.1, fadeTemp) * _FadeAmount); + col.a *= fade; + _FadeBurnColor.rgb *= _FadeBurnGlow; + col += fadeBurn * SAMPLE_TEXTURE2D(_FadeBurnTex, sampler_FadeBurnTex, tiledUvFade2) * _FadeBurnColor * originalAlpha * (1 - col.a); + #endif + //------------------------------------------------------- + + //SHADOW_ON + #if SHADOW_ON + half shadowA = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(_ShadowX, _ShadowY)).a; + half preMultShadowMask = 1 - (saturate(shadowA - col.a) * (1 - col.a)); + col.rgb *= 1 - ((shadowA - col.a) * (1 - col.a)); + col.rgb += (_ShadowColor * shadowA) * (1 - col.a); + col.a = max(shadowA * _ShadowAlpha * d.vertexColor.a, col.a); + #endif + + //------------------------------------------------------- + + //GLOW_ON + #if GLOW_ON + half4 emission; + #if GLOWTEX_ON + emission = SAMPLE_TEXTURE2D(_GlowTex, sampler_GlowTex, d.texcoord0); + #else + emission = col; + #endif + + col.rgb *= _GlowGlobal; + emission.rgb *= emission.a * col.a * _Glow * _GlowColor; + col.rgb += emission.rgb; + #endif + //------------------------------------------------------- + + //COLORRAMP_ON && COLORRAMPOUTLINE_ON + #if COLORRAMP_ON && COLORRAMPOUTLINE_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + luminance = saturate(luminance + _ColorRampLuminosity); + #if GRADIENTCOLORRAMP_ON + col.rgb = lerp(col.rgb, SAMPLE_TEXTURE2D(_ColorRampTexGradient, sampler_ColorRampTexGradient, half2(luminance, 0)).rgb, _ColorRampBlend); + #else + col.rgb = lerp(col.rgb, SAMPLE_TEXTURE2D(_ColorRampTex, sampler_ColorRampTex, half2(luminance, 0)).rgb, _ColorRampBlend); + #endif + #endif + //--------------- + + //GREYSCALE_ON && GREYSCALEOUTLINE_ON + #if GREYSCALE_ON && GREYSCALEOUTLINE_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + luminance = saturate(luminance + _GreyscaleLuminosity); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _GreyscaleTintColor, _GreyscaleBlend); + #endif + + //----------------------------------- + + //POSTERIZE_ON && POSTERIZEOUTLINE_ON + #if POSTERIZE_ON && POSTERIZEOUTLINE_ON + col.rgb = pow(col.rgb, _PosterizeGamma) * _PosterizeNumColors; + col.rgb = floor(col.rgb) / _PosterizeNumColors; + col.rgb = pow(col.rgb, 1.0 / _PosterizeGamma); + #endif + + //----------------------------------- + + //SHINE_ON + #if SHINE_ON + half2 uvShine = uvRect; + half cosAngle = cos(_ShineRotate); + half sinAngle = sin(_ShineRotate); + half2x2 rot = half2x2(cosAngle, -sinAngle, sinAngle, cosAngle); + uvShine -= half2(0.5, 0.5); + uvShine = mul(rot, uvShine); + uvShine += half2(0.5, 0.5); + half shineMask = SAMPLE_TEXTURE2D(_ShineMask, sampler_ShineMask, d.texcoord0.xy).a; + half currentDistanceProjection = (uvShine.x + uvShine.y) / 2; + half whitePower = 1 - (abs(currentDistanceProjection - _ShineLocation) / _ShineWidth); + col.rgb += col.a * whitePower * _ShineGlow * max(sign(currentDistanceProjection - (_ShineLocation - _ShineWidth)), 0.0) + * max(sign((_ShineLocation + _ShineWidth) - currentDistanceProjection), 0.0) * _ShineColor * shineMask; + #endif + + //----------------------------------- + + //HOLOGRAM_ON + #if HOLOGRAM_ON + half totalHologram = _HologramStripesAmount + _HologramUnmodAmount; + half hologramYCoord = ((uvRect.y + (((_Time.x + randomSeed) % 1) * _HologramStripesSpeed)) % totalHologram) / totalHologram; + hologramYCoord = abs(hologramYCoord); + half alpha = RemapFloat(saturate(hologramYCoord - (_HologramUnmodAmount/totalHologram)), 0.0, 1.0, _HologramMinAlpha, saturate(_HologramMaxAlpha)); + half hologramMask = max(sign((_HologramUnmodAmount/totalHologram) - hologramYCoord), 0.0); + half4 hologramResult = col; + hologramResult.a *= lerp(alpha, 1, hologramMask); + hologramResult.rgb *= max(1, _HologramMaxAlpha * max(sign(hologramYCoord - (_HologramUnmodAmount/totalHologram)), 0.0)); + hologramMask = 1 - step(0.01,hologramMask); + hologramResult.rgb += hologramMask * _HologramStripeColor * col.a; + col = lerp(col, hologramResult, _HologramBlend); + #endif + + //----------------------------------- + + //FLICKER_ON + #if FLICKER_ON + col.a *= saturate(col.a * step(frac(0.05 + (_Time.w + randomSeed) * _FlickerFreq), 1 - _FlickerPercent) + _FlickerAlpha); + #endif + //----------------------------------- + + //ALPHACUTOFF_ON + + //ALPHAROUND_ON + + //ALPHAOUTLINE_ON + #if ALPHAOUTLINE_ON + half alphaOutlineRes = pow(1 - col.a, max(_AlphaOutlinePower, 0.0001)) * step(_AlphaOutlineMinAlpha, col.a) * _AlphaOutlineBlend; + col.rgb = lerp(col.rgb, _AlphaOutlineColor.rgb * _AlphaOutlineGlow, alphaOutlineRes); + col.a = lerp(col.a, 1, alphaOutlineRes > 1); + #endif + //------------------------------------------------------- + + //FOG_ON + + //------------------ + + col *= _Color; + o.Albedo = col; + col.a *= _Alpha; + clip(col.a - _AlphaCutoffValue - 0.01); + o.Alpha = _Color.a; + } + + + + + + void ChainSurfaceFunction(inout Surface l, inout ShaderData d) + { + Ext_SurfaceFunction0(l, d); + // Ext_SurfaceFunction1(l, d); + // Ext_SurfaceFunction2(l, d); + // Ext_SurfaceFunction3(l, d); + // Ext_SurfaceFunction4(l, d); + // Ext_SurfaceFunction5(l, d); + // Ext_SurfaceFunction6(l, d); + // Ext_SurfaceFunction7(l, d); + // Ext_SurfaceFunction8(l, d); + // Ext_SurfaceFunction9(l, d); + // Ext_SurfaceFunction10(l, d); + // Ext_SurfaceFunction11(l, d); + // Ext_SurfaceFunction12(l, d); + // Ext_SurfaceFunction13(l, d); + // Ext_SurfaceFunction14(l, d); + // Ext_SurfaceFunction15(l, d); + // Ext_SurfaceFunction16(l, d); + // Ext_SurfaceFunction17(l, d); + // Ext_SurfaceFunction18(l, d); + // Ext_SurfaceFunction19(l, d); + // Ext_SurfaceFunction20(l, d); + // Ext_SurfaceFunction21(l, d); + // Ext_SurfaceFunction22(l, d); + // Ext_SurfaceFunction23(l, d); + // Ext_SurfaceFunction24(l, d); + // Ext_SurfaceFunction25(l, d); + // Ext_SurfaceFunction26(l, d); + // Ext_SurfaceFunction27(l, d); + // Ext_SurfaceFunction28(l, d); + // Ext_SurfaceFunction29(l, d); + } + +#if !_DECALSHADER + + void ChainModifyVertex(inout VertexData v, inout VertexToPixel v2p, float4 time) + { + ExtraV2F d; + + ZERO_INITIALIZE(ExtraV2F, d); + ZERO_INITIALIZE(Blackboard, d.blackboard); + // due to motion vectors in HDRP, we need to use the last + // time in certain spots. So if you are going to use _Time to adjust vertices, + // you need to use this time or motion vectors will break. + d.time = time; + + Ext_ModifyVertex0(v, d); + // Ext_ModifyVertex1(v, d); + // Ext_ModifyVertex2(v, d); + // Ext_ModifyVertex3(v, d); + // Ext_ModifyVertex4(v, d); + // Ext_ModifyVertex5(v, d); + // Ext_ModifyVertex6(v, d); + // Ext_ModifyVertex7(v, d); + // Ext_ModifyVertex8(v, d); + // Ext_ModifyVertex9(v, d); + // Ext_ModifyVertex10(v, d); + // Ext_ModifyVertex11(v, d); + // Ext_ModifyVertex12(v, d); + // Ext_ModifyVertex13(v, d); + // Ext_ModifyVertex14(v, d); + // Ext_ModifyVertex15(v, d); + // Ext_ModifyVertex16(v, d); + // Ext_ModifyVertex17(v, d); + // Ext_ModifyVertex18(v, d); + // Ext_ModifyVertex19(v, d); + // Ext_ModifyVertex20(v, d); + // Ext_ModifyVertex21(v, d); + // Ext_ModifyVertex22(v, d); + // Ext_ModifyVertex23(v, d); + // Ext_ModifyVertex24(v, d); + // Ext_ModifyVertex25(v, d); + // Ext_ModifyVertex26(v, d); + // Ext_ModifyVertex27(v, d); + // Ext_ModifyVertex28(v, d); + // Ext_ModifyVertex29(v, d); + + + // #if %EXTRAV2F0REQUIREKEY% + // v2p.extraV2F0 = d.extraV2F0; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // v2p.extraV2F1 = d.extraV2F1; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // v2p.extraV2F2 = d.extraV2F2; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // v2p.extraV2F3 = d.extraV2F3; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // v2p.extraV2F4 = d.extraV2F4; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // v2p.extraV2F5 = d.extraV2F5; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // v2p.extraV2F6 = d.extraV2F6; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // v2p.extraV2F7 = d.extraV2F7; + // #endif + } + + void ChainModifyTessellatedVertex(inout VertexData v, inout VertexToPixel v2p) + { + ExtraV2F d; + ZERO_INITIALIZE(ExtraV2F, d); + ZERO_INITIALIZE(Blackboard, d.blackboard); + + // #if %EXTRAV2F0REQUIREKEY% + // d.extraV2F0 = v2p.extraV2F0; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // d.extraV2F1 = v2p.extraV2F1; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // d.extraV2F2 = v2p.extraV2F2; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // d.extraV2F3 = v2p.extraV2F3; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // d.extraV2F4 = v2p.extraV2F4; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // d.extraV2F5 = v2p.extraV2F5; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // d.extraV2F6 = v2p.extraV2F6; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // d.extraV2F7 = v2p.extraV2F7; + // #endif + + + // Ext_ModifyTessellatedVertex0(v, d); + // Ext_ModifyTessellatedVertex1(v, d); + // Ext_ModifyTessellatedVertex2(v, d); + // Ext_ModifyTessellatedVertex3(v, d); + // Ext_ModifyTessellatedVertex4(v, d); + // Ext_ModifyTessellatedVertex5(v, d); + // Ext_ModifyTessellatedVertex6(v, d); + // Ext_ModifyTessellatedVertex7(v, d); + // Ext_ModifyTessellatedVertex8(v, d); + // Ext_ModifyTessellatedVertex9(v, d); + // Ext_ModifyTessellatedVertex10(v, d); + // Ext_ModifyTessellatedVertex11(v, d); + // Ext_ModifyTessellatedVertex12(v, d); + // Ext_ModifyTessellatedVertex13(v, d); + // Ext_ModifyTessellatedVertex14(v, d); + // Ext_ModifyTessellatedVertex15(v, d); + // Ext_ModifyTessellatedVertex16(v, d); + // Ext_ModifyTessellatedVertex17(v, d); + // Ext_ModifyTessellatedVertex18(v, d); + // Ext_ModifyTessellatedVertex19(v, d); + // Ext_ModifyTessellatedVertex20(v, d); + // Ext_ModifyTessellatedVertex21(v, d); + // Ext_ModifyTessellatedVertex22(v, d); + // Ext_ModifyTessellatedVertex23(v, d); + // Ext_ModifyTessellatedVertex24(v, d); + // Ext_ModifyTessellatedVertex25(v, d); + // Ext_ModifyTessellatedVertex26(v, d); + // Ext_ModifyTessellatedVertex27(v, d); + // Ext_ModifyTessellatedVertex28(v, d); + // Ext_ModifyTessellatedVertex29(v, d); + + // #if %EXTRAV2F0REQUIREKEY% + // v2p.extraV2F0 = d.extraV2F0; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // v2p.extraV2F1 = d.extraV2F1; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // v2p.extraV2F2 = d.extraV2F2; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // v2p.extraV2F3 = d.extraV2F3; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // v2p.extraV2F4 = d.extraV2F4; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // v2p.extraV2F5 = d.extraV2F5; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // v2p.extraV2F6 = d.extraV2F6; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // v2p.extraV2F7 = d.extraV2F7; + // #endif + } + + void ChainFinalColorForward(inout Surface l, inout ShaderData d, inout half4 color) + { + // Ext_FinalColorForward0(l, d, color); + // Ext_FinalColorForward1(l, d, color); + // Ext_FinalColorForward2(l, d, color); + // Ext_FinalColorForward3(l, d, color); + // Ext_FinalColorForward4(l, d, color); + // Ext_FinalColorForward5(l, d, color); + // Ext_FinalColorForward6(l, d, color); + // Ext_FinalColorForward7(l, d, color); + // Ext_FinalColorForward8(l, d, color); + // Ext_FinalColorForward9(l, d, color); + // Ext_FinalColorForward10(l, d, color); + // Ext_FinalColorForward11(l, d, color); + // Ext_FinalColorForward12(l, d, color); + // Ext_FinalColorForward13(l, d, color); + // Ext_FinalColorForward14(l, d, color); + // Ext_FinalColorForward15(l, d, color); + // Ext_FinalColorForward16(l, d, color); + // Ext_FinalColorForward17(l, d, color); + // Ext_FinalColorForward18(l, d, color); + // Ext_FinalColorForward19(l, d, color); + // Ext_FinalColorForward20(l, d, color); + // Ext_FinalColorForward21(l, d, color); + // Ext_FinalColorForward22(l, d, color); + // Ext_FinalColorForward23(l, d, color); + // Ext_FinalColorForward24(l, d, color); + // Ext_FinalColorForward25(l, d, color); + // Ext_FinalColorForward26(l, d, color); + // Ext_FinalColorForward27(l, d, color); + // Ext_FinalColorForward28(l, d, color); + // Ext_FinalColorForward29(l, d, color); + } + + void ChainFinalGBufferStandard(inout Surface s, inout ShaderData d, inout half4 GBuffer0, inout half4 GBuffer1, inout half4 GBuffer2, inout half4 outEmission, inout half4 outShadowMask) + { + // Ext_FinalGBufferStandard0(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard1(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard2(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard3(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard4(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard5(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard6(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard7(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard8(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard9(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard10(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard11(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard12(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard13(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard14(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard15(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard16(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard17(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard18(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard19(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard20(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard21(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard22(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard23(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard24(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard25(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard26(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard27(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard28(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard29(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + } +#endif + + + + + +#if _DECALSHADER + + ShaderData CreateShaderData(SurfaceDescriptionInputs IN) + { + ShaderData d = (ShaderData)0; + d.TBNMatrix = float3x3(IN.WorldSpaceTangent, IN.WorldSpaceBiTangent, IN.WorldSpaceNormal); + d.worldSpaceNormal = IN.WorldSpaceNormal; + d.worldSpaceTangent = IN.WorldSpaceTangent; + + d.worldSpacePosition = IN.WorldSpacePosition; + d.texcoord0 = IN.uv0.xyxy; + d.screenPos = IN.ScreenPosition; + + d.worldSpaceViewDir = normalize(_WorldSpaceCameraPos - d.worldSpacePosition); + + d.tangentSpaceViewDir = mul(d.TBNMatrix, d.worldSpaceViewDir); + + // these rarely get used, so we back transform them. Usually will be stripped. + #if _HDRP + // d.localSpacePosition = mul(GetWorldToObjectMatrix(), float4(GetCameraRelativePositionWS(d.worldSpacePosition), 1)).xyz; + #else + // d.localSpacePosition = mul(GetWorldToObjectMatrix(), float4(d.worldSpacePosition, 1)).xyz; + #endif + // d.localSpaceNormal = normalize(mul((float3x3)GetWorldToObjectMatrix(), d.worldSpaceNormal)); + // d.localSpaceTangent = normalize(mul((float3x3)GetWorldToObjectMatrix(), d.worldSpaceTangent.xyz)); + + // #if %SCREENPOSREQUIREKEY% + // d.screenUV = (IN.ScreenPosition.xy / max(0.01, IN.ScreenPosition.w)); + // #endif + + return d; + } +#else + + ShaderData CreateShaderData(VertexToPixel i + #if NEED_FACING + , bool facing + #endif + ) + { + ShaderData d = (ShaderData)0; + d.clipPos = i.pos; + d.worldSpacePosition = i.worldPos; + + d.worldSpaceNormal = normalize(i.worldNormal); + d.worldSpaceTangent.xyz = normalize(i.worldTangent.xyz); + + d.tangentSign = i.worldTangent.w * unity_WorldTransformParams.w; + float3 bitangent = cross(d.worldSpaceTangent.xyz, d.worldSpaceNormal) * d.tangentSign; + + d.TBNMatrix = float3x3(d.worldSpaceTangent, -bitangent, d.worldSpaceNormal); + d.worldSpaceViewDir = normalize(_WorldSpaceCameraPos - i.worldPos); + + d.tangentSpaceViewDir = mul(d.TBNMatrix, d.worldSpaceViewDir); + d.texcoord0 = i.texcoord0; + d.texcoord1 = i.texcoord1; + d.texcoord2 = i.texcoord2; + + // #if %TEXCOORD3REQUIREKEY% + d.texcoord3 = i.texcoord3; + // #endif + + // d.isFrontFace = facing; + // #if %VERTEXCOLORREQUIREKEY% + d.vertexColor = i.vertexColor; + // #endif + + // these rarely get used, so we back transform them. Usually will be stripped. + #if _HDRP + // d.localSpacePosition = mul(GetWorldToObjectMatrix(), float4(GetCameraRelativePositionWS(i.worldPos), 1)).xyz; + #else + // d.localSpacePosition = mul(GetWorldToObjectMatrix(), float4(i.worldPos, 1)).xyz; + #endif + // d.localSpaceNormal = normalize(mul((float3x3)GetWorldToObjectMatrix(), i.worldNormal)); + // d.localSpaceTangent = normalize(mul((float3x3)GetWorldToObjectMatrix(), i.worldTangent.xyz)); + + // #if %SCREENPOSREQUIREKEY% + // d.screenPos = i.screenPos; + // d.screenUV = (i.screenPos.xy / i.screenPos.w); + // #endif + + + // #if %EXTRAV2F0REQUIREKEY% + // d.extraV2F0 = i.extraV2F0; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // d.extraV2F1 = i.extraV2F1; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // d.extraV2F2 = i.extraV2F2; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // d.extraV2F3 = i.extraV2F3; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // d.extraV2F4 = i.extraV2F4; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // d.extraV2F5 = i.extraV2F5; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // d.extraV2F6 = i.extraV2F6; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // d.extraV2F7 = i.extraV2F7; + // #endif + + return d; + } + +#endif + + + +struct VaryingsToPS +{ + VertexToPixel vmesh; + #ifdef VARYINGS_NEED_PASS + VaryingsPassToPS vpass; + #endif +}; + +struct PackedVaryingsToPS +{ + #ifdef VARYINGS_NEED_PASS + PackedVaryingsPassToPS vpass; + #endif + VertexToPixel vmesh; + + UNITY_VERTEX_OUTPUT_STEREO +}; + +PackedVaryingsToPS PackVaryingsToPS(VaryingsToPS input) +{ + PackedVaryingsToPS output = (PackedVaryingsToPS)0; + output.vmesh = input.vmesh; + #ifdef VARYINGS_NEED_PASS + output.vpass = PackVaryingsPassToPS(input.vpass); + #endif + + UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(output); + return output; +} + + + + +VertexToPixel VertMesh(VertexData input) +{ + VertexToPixel output = (VertexToPixel)0; + + UNITY_SETUP_INSTANCE_ID(input); + UNITY_TRANSFER_INSTANCE_ID(input, output); + + + ChainModifyVertex(input, output, _Time); + + + // This return the camera relative position (if enable) + float3 positionRWS = TransformObjectToWorld(input.vertex.xyz); + float3 normalWS = TransformObjectToWorldNormal(input.normal); + float4 tangentWS = float4(TransformObjectToWorldDir(input.tangent.xyz), input.tangent.w); + + + output.worldPos = GetAbsolutePositionWS(positionRWS); + output.pos = TransformWorldToHClip(positionRWS); + output.worldNormal = normalWS; + output.worldTangent = tangentWS; + + + output.texcoord0 = input.texcoord0; + output.texcoord1 = input.texcoord1; + output.texcoord2 = input.texcoord2; + // #if %TEXCOORD3REQUIREKEY% + output.texcoord3 = input.texcoord3; + // #endif + + // #if %SCREENPOSREQUIREKEY% + // output.screenPos = ComputeScreenPos(output.pos, _ProjectionParams.x); + // #endif + + // #if %VERTEXCOLORREQUIREKEY% + output.vertexColor = input.vertexColor; + // #endif + return output; +} + + +#if (SHADERPASS == SHADERPASS_DBUFFER_MESH) +void MeshDecalsPositionZBias(inout VaryingsToPS input) +{ +#if defined(UNITY_REVERSED_Z) + input.vmesh.pos.z -= _DecalMeshDepthBias; +#else + input.vmesh.pos.z += _DecalMeshDepthBias; +#endif +} +#endif + + +#if (SHADERPASS == SHADERPASS_LIGHT_TRANSPORT) + +// This was not in constant buffer in original unity, so keep outiside. But should be in as ShaderRenderPass frequency +float unity_OneOverOutputBoost; +float unity_MaxOutputValue; + +CBUFFER_START(UnityMetaPass) +// x = use uv1 as raster position +// y = use uv2 as raster position +bool4 unity_MetaVertexControl; + +// x = return albedo +// y = return normal +bool4 unity_MetaFragmentControl; +CBUFFER_END + +PackedVaryingsToPS Vert(VertexData inputMesh) +{ + VaryingsToPS output = (VaryingsToPS)0; + output.vmesh = (VertexToPixel)0; + + UNITY_SETUP_INSTANCE_ID(inputMesh); + UNITY_TRANSFER_INSTANCE_ID(inputMesh, output.vmesh); + + // Output UV coordinate in vertex shader + float2 uv = float2(0.0, 0.0); + + if (unity_MetaVertexControl.x) + { + uv = inputMesh.texcoord1.xy * unity_LightmapST.xy + unity_LightmapST.zw; + } + else if (unity_MetaVertexControl.y) + { + uv = inputMesh.texcoord2.xy * unity_DynamicLightmapST.xy + unity_DynamicLightmapST.zw; + } + + // OpenGL right now needs to actually use the incoming vertex position + // so we create a fake dependency on it here that haven't any impact. + output.vmesh.pos = float4(uv * 2.0 - 1.0, inputMesh.vertex.z > 0 ? 1.0e-4 : 0.0, 1.0); + +#ifdef VARYINGS_NEED_POSITION_WS + output.vmesh.worldPos = TransformObjectToWorld(inputMesh.vertex.xyz); +#endif + +#ifdef VARYINGS_NEED_TANGENT_TO_WORLD + // Normal is required for triplanar mapping + output.vmesh.worldNormal = TransformObjectToWorldNormal(inputMesh.normal); + // Not required but assign to silent compiler warning + output.vmesh.worldTangent = float4(1.0, 0.0, 0.0, 0.0); +#endif + + output.vmesh.texcoord0 = inputMesh.texcoord0; + output.vmesh.texcoord1 = inputMesh.texcoord1; + output.vmesh.texcoord2 = inputMesh.texcoord2; + // #if %TEXCOORD3REQUIREKEY% + output.vmesh.texcoord3 = inputMesh.texcoord3; + // #endif + + // #if %VERTEXCOLORREQUIREKEY% + output.vmesh.vertexColor = inputMesh.vertexColor; + // #endif + + return PackVaryingsToPS(output); +} +#else + +PackedVaryingsToPS Vert(VertexData inputMesh) +{ + VaryingsToPS varyingsType; + varyingsType.vmesh = VertMesh(inputMesh); + #if (SHADERPASS == SHADERPASS_DBUFFER_MESH) + MeshDecalsPositionZBias(varyingsType); + #endif + return PackVaryingsToPS(varyingsType); +} + +#endif + + + + + + + FragInputs BuildFragInputs(VertexToPixel input) + { + UNITY_SETUP_INSTANCE_ID(input); + FragInputs output; + ZERO_INITIALIZE(FragInputs, output); + + // Init to some default value to make the computer quiet (else it output 'divide by zero' warning even if value is not used). + // TODO: this is a really poor workaround, but the variable is used in a bunch of places + // to compute normals which are then passed on elsewhere to compute other values... + output.tangentToWorld = k_identity3x3; + output.positionSS = input.pos; // input.positionCS is SV_Position + + output.positionRWS = GetCameraRelativePositionWS(input.worldPos); + output.tangentToWorld = BuildTangentToWorld(input.worldTangent, input.worldNormal); + output.texCoord0 = input.texcoord0; + output.texCoord1 = input.texcoord1; + output.texCoord2 = input.texcoord2; + + return output; + } + + void BuildSurfaceData(FragInputs fragInputs, inout Surface surfaceDescription, float3 V, PositionInputs posInput, out SurfaceData surfaceData, out float3 bentNormalWS) + { + // setup defaults -- these are used if the graph doesn't output a value + ZERO_INITIALIZE(SurfaceData, surfaceData); + + // specularOcclusion need to be init ahead of decal to quiet the compiler that modify the SurfaceData struct + // however specularOcclusion can come from the graph, so need to be init here so it can be override. + surfaceData.specularOcclusion = 1.0; + + // copy across graph values, if defined + surfaceData.baseColor = surfaceDescription.Albedo; + surfaceData.perceptualSmoothness = surfaceDescription.Smoothness; + surfaceData.ambientOcclusion = surfaceDescription.Occlusion; + surfaceData.specularOcclusion = surfaceDescription.SpecularOcclusion; + surfaceData.metallic = surfaceDescription.Metallic; + surfaceData.subsurfaceMask = surfaceDescription.SubsurfaceMask; + surfaceData.thickness = surfaceDescription.Thickness; + surfaceData.diffusionProfileHash = asuint(surfaceDescription.DiffusionProfileHash); + #if _USESPECULAR + surfaceData.specularColor = surfaceDescription.Specular; + #endif + surfaceData.coatMask = surfaceDescription.CoatMask; + surfaceData.anisotropy = surfaceDescription.Anisotropy; + surfaceData.iridescenceMask = surfaceDescription.IridescenceMask; + surfaceData.iridescenceThickness = surfaceDescription.IridescenceThickness; + + #ifdef _HAS_REFRACTION + if (_EnableSSRefraction) + { + // surfaceData.ior = surfaceDescription.RefractionIndex; + // surfaceData.transmittanceColor = surfaceDescription.RefractionColor; + // surfaceData.atDistance = surfaceDescription.RefractionDistance; + + surfaceData.transmittanceMask = (1.0 - surfaceDescription.Alpha); + surfaceDescription.Alpha = 1.0; + } + else + { + surfaceData.ior = surfaceDescription.ior; + surfaceData.transmittanceColor = surfaceDescription.transmittanceColor; + surfaceData.atDistance = surfaceDescription.atDistance; + surfaceData.transmittanceMask = surfaceDescription.transmittanceMask; + surfaceDescription.Alpha = 1.0; + } + #else + surfaceData.ior = 1.0; + surfaceData.transmittanceColor = float3(1.0, 1.0, 1.0); + surfaceData.atDistance = 1.0; + surfaceData.transmittanceMask = 0.0; + #endif + + // These static material feature allow compile time optimization + surfaceData.materialFeatures = MATERIALFEATUREFLAGS_LIT_STANDARD; + #ifdef _MATERIAL_FEATURE_SUBSURFACE_SCATTERING + surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_SUBSURFACE_SCATTERING; + #endif + #ifdef _MATERIAL_FEATURE_TRANSMISSION + surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_TRANSMISSION; + #endif + #ifdef _MATERIAL_FEATURE_ANISOTROPY + surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_ANISOTROPY; + #endif + // surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_CLEAR_COAT; + + #ifdef _MATERIAL_FEATURE_IRIDESCENCE + surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_IRIDESCENCE; + #endif + #ifdef _MATERIAL_FEATURE_SPECULAR_COLOR + surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_SPECULAR_COLOR; + #endif + + #if defined (_MATERIAL_FEATURE_SPECULAR_COLOR) && defined (_ENERGY_CONSERVING_SPECULAR) + // Require to have setup baseColor + // Reproduce the energy conservation done in legacy Unity. Not ideal but better for compatibility and users can unchek it + surfaceData.baseColor *= (1.0 - Max3(surfaceData.specularColor.r, surfaceData.specularColor.g, surfaceData.specularColor.b)); + #endif + + + // tangent-space normal + float3 normalTS = float3(0.0f, 0.0f, 1.0f); + normalTS = surfaceDescription.Normal; + + // compute world space normal + #if !_WORLDSPACENORMAL + surfaceData.normalWS = mul(normalTS, fragInputs.tangentToWorld); + #else + surfaceData.normalWS = normalTS; + #endif + surfaceData.geomNormalWS = fragInputs.tangentToWorld[2]; + + surfaceData.tangentWS = normalize(fragInputs.tangentToWorld[0].xyz); // The tangent is not normalize in tangentToWorld for mikkt. TODO: Check if it expected that we normalize with Morten. Tag: SURFACE_GRADIENT + // surfaceData.tangentWS = TransformTangentToWorld(surfaceDescription.Tangent, fragInputs.tangentToWorld); + + #if HAVE_DECALS + if (_EnableDecals) + { + #if VERSION_GREATER_EQUAL(10,2) + DecalSurfaceData decalSurfaceData = GetDecalSurfaceData(posInput, surfaceData.geomNormalWS, surfaceDescription.Alpha); + ApplyDecalToSurfaceData(decalSurfaceData, surfaceData.geomNormalWS, surfaceData); + #else + DecalSurfaceData decalSurfaceData = GetDecalSurfaceData(posInput, surfaceDescription.Alpha); + ApplyDecalToSurfaceData(decalSurfaceData, surfaceData); + #endif + } + #endif + + bentNormalWS = surfaceData.normalWS; + + surfaceData.tangentWS = Orthonormalize(surfaceData.tangentWS, surfaceData.normalWS); + + + // By default we use the ambient occlusion with Tri-ace trick (apply outside) for specular occlusion. + // If user provide bent normal then we process a better term + #if defined(_SPECULAR_OCCLUSION_CUSTOM) + // Just use the value passed through via the slot (not active otherwise) + #elif defined(_SPECULAR_OCCLUSION_FROM_AO_BENT_NORMAL) + // If we have bent normal and ambient occlusion, process a specular occlusion + surfaceData.specularOcclusion = GetSpecularOcclusionFromBentAO(V, bentNormalWS, surfaceData.normalWS, surfaceData.ambientOcclusion, PerceptualSmoothnessToPerceptualRoughness(surfaceData.perceptualSmoothness)); + #elif defined(_AMBIENT_OCCLUSION) && defined(_SPECULAR_OCCLUSION_FROM_AO) + surfaceData.specularOcclusion = GetSpecularOcclusionFromAmbientOcclusion(ClampNdotV(dot(surfaceData.normalWS, V)), surfaceData.ambientOcclusion, PerceptualSmoothnessToRoughness(surfaceData.perceptualSmoothness)); + #endif + + #ifdef _ENABLE_GEOMETRIC_SPECULAR_AA + surfaceData.perceptualSmoothness = GeometricNormalFiltering(surfaceData.perceptualSmoothness, fragInputs.tangentToWorld[2], surfaceDescription.SpecularAAScreenSpaceVariance, surfaceDescription.SpecularAAThreshold); + #endif + + #ifdef DEBUG_DISPLAY + if (_DebugMipMapMode != DEBUGMIPMAPMODE_NONE) + { + // TODO: need to update mip info + surfaceData.metallic = 0; + } + + // We need to call ApplyDebugToSurfaceData after filling the surfarcedata and before filling builtinData + // as it can modify attribute use for static lighting + ApplyDebugToSurfaceData(fragInputs.tangentToWorld, surfaceData); + #endif + } + + void GetSurfaceAndBuiltinData(VertexToPixel m2ps, FragInputs fragInputs, float3 V, inout PositionInputs posInput, + out SurfaceData surfaceData, out BuiltinData builtinData, inout Surface l, inout ShaderData d + #if NEED_FACING + , bool facing + #endif + ) + { + // Removed since crossfade does not work, probably needs extra material setup. + //#ifdef LOD_FADE_CROSSFADE // enable dithering LOD transition if user select CrossFade transition in LOD group + // uint3 fadeMaskSeed = asuint((int3)(V * _ScreenSize.xyx)); // Quantize V to _ScreenSize values + // LODDitheringTransition(fadeMaskSeed, unity_LODFade.x); + //#endif + + d = CreateShaderData(m2ps + #if NEED_FACING + , facing + #endif + ); + + + + l = (Surface)0; + + l.Albedo = half3(0.5, 0.5, 0.5); + l.Normal = float3(0,0,1); + l.Occlusion = 1; + l.Alpha = 1; + l.SpecularOcclusion = 1; + + #ifdef _DEPTHOFFSET_ON + l.outputDepth = posInput.deviceDepth; + #endif + + ChainSurfaceFunction(l, d); + + #ifdef _DEPTHOFFSET_ON + posInput.deviceDepth = l.outputDepth; + #endif + + #if _UNLIT + //l.Emission = l.Albedo; + //l.Albedo = 0; + l.Normal = half3(0,0,1); + l.Occlusion = 1; + l.Metallic = 0; + l.Specular = 0; + #endif + + surfaceData.geomNormalWS = d.worldSpaceNormal; + surfaceData.tangentWS = d.worldSpaceTangent; + fragInputs.tangentToWorld = d.TBNMatrix; + + float3 bentNormalWS; + BuildSurfaceData(fragInputs, l, V, posInput, surfaceData, bentNormalWS); + + InitBuiltinData(posInput, l.Alpha, bentNormalWS, -d.worldSpaceNormal, fragInputs.texCoord1, fragInputs.texCoord2, builtinData); + + + + builtinData.emissiveColor = l.Emission; + + #if defined(_OVERRIDE_BAKEDGI) + builtinData.bakeDiffuseLighting = l.DiffuseGI; + builtinData.backBakeDiffuseLighting = l.BackDiffuseGI; + builtinData.emissiveColor += l.SpecularGI; + #endif + + #if defined(_OVERRIDE_SHADOWMASK) + builtinData.shadowMask0 = l.ShadowMask.x; + builtinData.shadowMask1 = l.ShadowMask.y; + builtinData.shadowMask2 = l.ShadowMask.z; + builtinData.shadowMask3 = l.ShadowMask.w; + #endif + + #if (SHADERPASS == SHADERPASS_DISTORTION) + //builtinData.distortion = surfaceDescription.Distortion; + //builtinData.distortionBlur = surfaceDescription.DistortionBlur; + builtinData.distortion = float2(0.0, 0.0); + builtinData.distortionBlur = 0.0; + #else + builtinData.distortion = float2(0.0, 0.0); + builtinData.distortionBlur = 0.0; + #endif + + PostInitBuiltinData(V, posInput, surfaceData, builtinData); + } + + + + void Frag( PackedVaryingsToPS packedInput + #ifdef WRITE_NORMAL_BUFFER + , out float4 outNormalBuffer : SV_Target0 + #ifdef WRITE_MSAA_DEPTH + , out float1 depthColor : SV_Target1 + #endif + #elif defined(WRITE_MSAA_DEPTH) // When only WRITE_MSAA_DEPTH is define and not WRITE_NORMAL_BUFFER it mean we are Unlit and only need depth, but we still have normal buffer binded + , out float4 outNormalBuffer : SV_Target0 + , out float1 depthColor : SV_Target1 + #elif defined(SCENESELECTIONPASS) + , out float4 outColor : SV_Target0 + #endif + + #ifdef _DEPTHOFFSET_ON + , out float outputDepth : SV_Depth + #endif + #if NEED_FACING + , bool facing : SV_IsFrontFace + #endif + ) + { + UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX(packedInput); + FragInputs input = BuildFragInputs(packedInput.vmesh); + + // input.positionSS is SV_Position + PositionInputs posInput = GetPositionInput(input.positionSS.xy, _ScreenSize.zw, input.positionSS.z, input.positionSS.w, input.positionRWS); + + + float3 V = GetWorldSpaceNormalizeViewDir(input.positionRWS); + + + SurfaceData surfaceData; + BuiltinData builtinData; + Surface l; + ShaderData d; + GetSurfaceAndBuiltinData(packedInput.vmesh, input, V, posInput, surfaceData, builtinData, l, d + #if NEED_FACING + , facing + #endif + ); + + + + #ifdef _DEPTHOFFSET_ON + outputDepth = posInput.deviceDepth; + #endif + + #ifdef WRITE_NORMAL_BUFFER + EncodeIntoNormalBuffer(ConvertSurfaceDataToNormalData(surfaceData), posInput.positionSS, outNormalBuffer); + #ifdef WRITE_MSAA_DEPTH + // In case we are rendering in MSAA, reading the an MSAA depth buffer is way too expensive. To avoid that, we export the depth to a color buffer + depthColor = packedInput.vmesh.pos.z; + #endif + #elif defined(WRITE_MSAA_DEPTH) // When we are MSAA depth only without normal buffer + // Due to the binding order of these two render targets, we need to have them both declared + outNormalBuffer = float4(0.0, 0.0, 0.0, 1.0); + // In case we are rendering in MSAA, reading the an MSAA depth buffer is way too expensive. To avoid that, we export the depth to a color buffer + depthColor = packedInput.vmesh.pos.z; + #elif defined(SCENESELECTIONPASS) + // We use depth prepass for scene selection in the editor, this code allow to output the outline correctly + outColor = float4(_ObjectId, _PassValue, 1.0, 1.0); + #endif + } + + + + + ENDHLSL + } + + Pass + { + // based on HDLitPass.template + Name "META" + Tags { "LightMode" = "META" } + + Cull Off + + Tags { "RenderType" = "Opaque" "Queue" = "Geometry" "PreviewType" = "Plane" } + Cull [_CullingOption] + ZWrite [_ZWrite] + ZTest [_ZTestMode] + + + //------------------------------------------------------------------------------------- + // End Render Modes + //------------------------------------------------------------------------------------- + + HLSLPROGRAM + + #pragma target 4.5 + #pragma only_renderers d3d11 ps4 xboxone vulkan metal switch + //#pragma enable_d3d11_debug_symbols + + #pragma multi_compile_instancing + + //#pragma multi_compile_local _ _ALPHATEST_ON + + + //#pragma shader_feature _SURFACE_TYPE_TRANSPARENT + //#pragma shader_feature_local _ _BLENDMODE_ALPHA _BLENDMODE_ADD _BLENDMODE_PRE_MULTIPLY + + //------------------------------------------------------------------------------------- + // Variant Definitions (active field translations to HDRP defines) + //------------------------------------------------------------------------------------- + // #define _MATERIAL_FEATURE_SUBSURFACE_SCATTERING 1 + // #define _MATERIAL_FEATURE_TRANSMISSION 1 + // #define _MATERIAL_FEATURE_ANISOTROPY 1 + // #define _MATERIAL_FEATURE_IRIDESCENCE 1 + // #define _MATERIAL_FEATURE_SPECULAR_COLOR 1 + #define _ENABLE_FOG_ON_TRANSPARENT 1 + // #define _AMBIENT_OCCLUSION 1 + // #define _SPECULAR_OCCLUSION_FROM_AO 1 + // #define _SPECULAR_OCCLUSION_FROM_AO_BENT_NORMAL 1 + // #define _SPECULAR_OCCLUSION_CUSTOM 1 + // #define _ENERGY_CONSERVING_SPECULAR 1 + // #define _ENABLE_GEOMETRIC_SPECULAR_AA 1 + // #define _HAS_REFRACTION 1 + // #define _REFRACTION_PLANE 1 + // #define _REFRACTION_SPHERE 1 + // #define _DISABLE_DECALS 1 + // #define _DISABLE_SSR 1 + // #define _ADD_PRECOMPUTED_VELOCITY + // #define _WRITE_TRANSPARENT_MOTION_VECTOR 1 + // #define _DEPTHOFFSET_ON 1 + // #define _BLENDMODE_PRESERVE_SPECULAR_LIGHTING 1 + + #define SHADERPASS SHADERPASS_LIGHT_TRANSPORT + #define RAYTRACING_SHADER_GRAPH_HIGH + #define REQUIRE_DEPTH_TEXTURE + #define _PASSMETA 1 + + + + #pragma shader_feature_local GLOW_ON + #pragma shader_feature_local FADE_ON + #pragma shader_feature_local OUTBASE_ON + #pragma shader_feature_local ONLYOUTLINE_ON + #pragma shader_feature_local GRADIENT_ON + #pragma shader_feature_local GRADIENT2COL_ON + #pragma shader_feature_local RADIALGRADIENT_ON + #pragma shader_feature_local COLORSWAP_ON + #pragma shader_feature_local HSV_ON + #pragma shader_feature_local CHANGECOLOR_ON + #pragma shader_feature_local CHANGECOLOR2_ON + #pragma shader_feature_local CHANGECOLOR3_ON + #pragma shader_feature_local COLORRAMP_ON + #pragma shader_feature_local GRADIENTCOLORRAMP_ON + #pragma shader_feature_local HITEFFECT_ON + #pragma shader_feature_local NEGATIVE_ON + #pragma shader_feature_local PIXELATE_ON + #pragma shader_feature_local GREYSCALE_ON + #pragma shader_feature_local POSTERIZE_ON + #pragma shader_feature_local BLUR_ON + #pragma shader_feature_local MOTIONBLUR_ON + #pragma shader_feature_local GHOST_ON + #pragma shader_feature_local ALPHAOUTLINE_ON + #pragma shader_feature_local INNEROUTLINE_ON + #pragma shader_feature_local ONLYINNEROUTLINE_ON + #pragma shader_feature_local HOLOGRAM_ON + #pragma shader_feature_local CHROMABERR_ON + #pragma shader_feature_local GLITCH_ON + #pragma shader_feature_local FLICKER_ON + #pragma shader_feature_local SHADOW_ON + #pragma shader_feature_local SHINE_ON + #pragma shader_feature_local CONTRAST_ON + #pragma shader_feature_local OVERLAY_ON + #pragma shader_feature_local OVERLAYMULT_ON + #pragma shader_feature_local DOODLE_ON + #pragma shader_feature_local WIND_ON + #pragma shader_feature_local WAVEUV_ON + #pragma shader_feature_local ROUNDWAVEUV_ON + #pragma shader_feature_local RECTSIZE_ON + #pragma shader_feature_local OFFSETUV_ON + #pragma shader_feature_local CLIPPING_ON + #pragma shader_feature_local RADIALCLIPPING_ON + #pragma shader_feature_local TEXTURESCROLL_ON + #pragma shader_feature_local ZOOMUV_ON + #pragma shader_feature_local DISTORT_ON + #pragma shader_feature_local WARP_ON + #pragma shader_feature_local TWISTUV_ON + #pragma shader_feature_local ROTATEUV_ON + #pragma shader_feature_local POLARUV_ON + #pragma shader_feature_local FISHEYE_ON + #pragma shader_feature_local PINCH_ON + #pragma shader_feature_local SHAKEUV_ON + + #pragma shader_feature_local GLOWTEX_ON + #pragma shader_feature_local OUTTEX_ON + #pragma shader_feature_local OUTDIST_ON + #pragma shader_feature_local OUTBASE8DIR_ON + #pragma shader_feature_local OUTBASEPIXELPERF_ON + #pragma shader_feature_local COLORRAMPOUTLINE_ON + #pragma shader_feature_local GREYSCALEOUTLINE_ON + #pragma shader_feature_local POSTERIZEOUTLINE_ON + #pragma shader_feature_local BLURISHD_ON + #pragma shader_feature_local MANUALWIND_ON + #pragma shader_feature_local ATLAS_ON + #pragma shader_feature_local PREMULTIPLYALPHA_ON + + #pragma shader_feature BILBOARD_ON + #pragma shader_feature BILBOARDY_ON + + #pragma shader_feature NORMALMAP_ON + + + #define _HDRP 1 +#define _USINGTEXCOORD1 1 +#define _USINGTEXCOORD2 1 + + + #pragma vertex Vert + #pragma fragment Frag + + + + + // useful conversion functions to make surface shader code just work + + #define UNITY_DECLARE_TEX2D(name) TEXTURE2D(name); SAMPLER(sampler##name); + #define UNITY_DECLARE_TEX2D_NOSAMPLER(name) TEXTURE2D(name); + #define UNITY_DECLARE_TEX2DARRAY(name) TEXTURE2D_ARRAY(name); SAMPLER(sampler##name); + #define UNITY_DECLARE_TEX2DARRAY_NOSAMPLER(tex) TEXTURE2D_ARRAY(tex); + + #define UNITY_SAMPLE_TEX2DARRAY(tex,coord) SAMPLE_TEXTURE2D_ARRAY(tex, sampler##tex, coord.xy, coord.z) + #define UNITY_SAMPLE_TEX2DARRAY_LOD(tex,coord,lod) SAMPLE_TEXTURE2D_ARRAY_LOD(tex, sampler##tex, coord.xy, coord.z, lod) + #define UNITY_SAMPLE_TEX2D(tex, coord) SAMPLE_TEXTURE2D(tex, sampler##tex, coord) + #define UNITY_SAMPLE_TEX2D_SAMPLER(tex, samp, coord) SAMPLE_TEXTURE2D(tex, sampler##samp, coord) + + #define UNITY_SAMPLE_TEX2D_LOD(tex,coord, lod) SAMPLE_TEXTURE2D_LOD(tex, sampler_##tex, coord, lod) + #define UNITY_SAMPLE_TEX2D_SAMPLER_LOD(tex,samplertex,coord, lod) SAMPLE_TEXTURE2D_LOD (tex, sampler##samplertex,coord, lod) + + #if defined(UNITY_COMPILER_HLSL) + #define UNITY_INITIALIZE_OUTPUT(type,name) name = (type)0; + #else + #define UNITY_INITIALIZE_OUTPUT(type,name) + #endif + + #define sampler2D_float sampler2D + #define sampler2D_half sampler2D + + #undef WorldNormalVector + #define WorldNormalVector(data, normal) mul(normal, data.TBNMatrix) + + #define UnityObjectToWorldNormal(normal) mul(GetObjectToWorldMatrix(), normal) + + + + +// HDRP Adapter stuff + + + // If we use subsurface scattering, enable output split lighting (for forward pass) + #if defined(_MATERIAL_FEATURE_SUBSURFACE_SCATTERING) && !defined(_SURFACE_TYPE_TRANSPARENT) + #define OUTPUT_SPLIT_LIGHTING + #endif + + #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Version.hlsl" + #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Common.hlsl" + + #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/NormalSurfaceGradient.hlsl" + + // define FragInputs structure + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/ShaderPass/FragInputs.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/ShaderPass/ShaderPass.cs.hlsl" + #if (SHADER_LIBRARY_VERSION_MAJOR >= 10) + #include "Packages/com.unity.shadergraph/ShaderGraphLibrary/Functions.hlsl" + #endif + + + + + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/ShaderVariables.hlsl" + #ifdef DEBUG_DISPLAY + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Debug/DebugDisplay.hlsl" + #endif + + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/Material.hlsl" + + #if (SHADERPASS == SHADERPASS_FORWARD) + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Lighting/Lighting.hlsl" + + #define HAS_LIGHTLOOP + + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Lighting/LightLoop/LightLoopDef.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/Lit/Lit.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Lighting/LightLoop/LightLoop.hlsl" + #else + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/Lit/Lit.hlsl" + #endif + + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/BuiltinUtilities.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/MaterialUtilities.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/Decal/DecalUtilities.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/Lit/LitDecalData.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/ShaderGraphFunctions.hlsl" + + // Used by SceneSelectionPass + int _ObjectId; + int _PassValue; + + + // data across stages, stripped like the above. + struct VertexToPixel + { + float4 pos : SV_POSITION; + float3 worldPos : TEXCOORD0; + float3 worldNormal : TEXCOORD1; + float4 worldTangent : TEXCOORD2; + float4 texcoord0 : TEXCOORD3; + float4 texcoord1 : TEXCOORD4; + float4 texcoord2 : TEXCOORD5; + + // #if %TEXCOORD3REQUIREKEY% + float4 texcoord3 : TEXCOORD6; + // #endif + + // #if %SCREENPOSREQUIREKEY% + // float4 screenPos : TEXCOORD7; + // #endif + + // #if %VERTEXCOLORREQUIREKEY% + float4 vertexColor : COLOR; + // #endif + + // #if %EXTRAV2F0REQUIREKEY% + // float4 extraV2F0 : TEXCOORD8; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // float4 extraV2F1 : TEXCOORD9; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // float4 extraV2F2 : TEXCOORD10; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // float4 extraV2F3 : TEXCOORD11; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // float4 extraV2F4 : TEXCOORD12; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // float4 extraV2F5 : TEXCOORD13; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // float4 extraV2F6 : TEXCOORD14; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // float4 extraV2F7 : TEXCOORD15; + // #endif + + #if UNITY_ANY_INSTANCING_ENABLED + UNITY_VERTEX_INPUT_INSTANCE_ID + #endif // UNITY_ANY_INSTANCING_ENABLED + + UNITY_VERTEX_OUTPUT_STEREO + }; + + + + + + // data describing the user output of a pixel + struct Surface + { + half3 Albedo; + half Height; + half3 Normal; + half Smoothness; + half3 Emission; + half Metallic; + half3 Specular; + half Occlusion; + half SpecularPower; // for simple lighting + half Alpha; + float outputDepth; // if written, SV_Depth semantic is used. ShaderData.clipPos.z is unused value + // HDRP Only + half SpecularOcclusion; + half SubsurfaceMask; + half Thickness; + half CoatMask; + half CoatSmoothness; + half Anisotropy; + half IridescenceMask; + half IridescenceThickness; + int DiffusionProfileHash; + float SpecularAAThreshold; + float SpecularAAScreenSpaceVariance; + // requires _OVERRIDE_BAKEDGI to be defined, but is mapped in all pipelines + float3 DiffuseGI; + float3 BackDiffuseGI; + float3 SpecularGI; + float ior; + float3 transmittanceColor; + float atDistance; + float transmittanceMask; + // requires _OVERRIDE_SHADOWMASK to be defines + float4 ShadowMask; + + // for decals + float NormalAlpha; + float MAOSAlpha; + + + }; + + // Data the user declares in blackboard blocks + struct Blackboard + { + + float blackboardDummyData; + }; + + // data the user might need, this will grow to be big. But easy to strip + struct ShaderData + { + float4 clipPos; // SV_POSITION + float3 localSpacePosition; + float3 localSpaceNormal; + float3 localSpaceTangent; + + float3 worldSpacePosition; + float3 worldSpaceNormal; + float3 worldSpaceTangent; + float tangentSign; + + float3 worldSpaceViewDir; + float3 tangentSpaceViewDir; + + float4 texcoord0; + float4 texcoord1; + float4 texcoord2; + float4 texcoord3; + + float2 screenUV; + float4 screenPos; + + float4 vertexColor; + bool isFrontFace; + + float4 extraV2F0; + float4 extraV2F1; + float4 extraV2F2; + float4 extraV2F3; + float4 extraV2F4; + float4 extraV2F5; + float4 extraV2F6; + float4 extraV2F7; + + float3x3 TBNMatrix; + Blackboard blackboard; + }; + + struct VertexData + { + #if SHADER_TARGET > 30 + // uint vertexID : SV_VertexID; + #endif + float4 vertex : POSITION; + float3 normal : NORMAL; + float4 tangent : TANGENT; + float4 texcoord0 : TEXCOORD0; + + // optimize out mesh coords when not in use by user or lighting system + #if _URP && (_USINGTEXCOORD1 || _PASSMETA || _PASSFORWARD || _PASSGBUFFER) + float4 texcoord1 : TEXCOORD1; + #endif + + #if _URP && (_USINGTEXCOORD2 || _PASSMETA || ((_PASSFORWARD || _PASSGBUFFER) && defined(DYNAMICLIGHTMAP_ON))) + float4 texcoord2 : TEXCOORD2; + #endif + + #if _STANDARD && (_USINGTEXCOORD1 || (_PASSMETA || ((_PASSFORWARD || _PASSGBUFFER || _PASSFORWARDADD) && LIGHTMAP_ON))) + float4 texcoord1 : TEXCOORD1; + #endif + #if _STANDARD && (_USINGTEXCOORD2 || (_PASSMETA || ((_PASSFORWARD || _PASSGBUFFER) && DYNAMICLIGHTMAP_ON))) + float4 texcoord2 : TEXCOORD2; + #endif + + + #if _HDRP + float4 texcoord1 : TEXCOORD1; + float4 texcoord2 : TEXCOORD2; + #endif + + // #if %TEXCOORD3REQUIREKEY% + float4 texcoord3 : TEXCOORD3; + // #endif + + // #if %VERTEXCOLORREQUIREKEY% + float4 vertexColor : COLOR; + // #endif + + #if _PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR)) + float3 previousPositionOS : TEXCOORD4; // Contain previous transform position (in case of skinning for example) + #if defined (_ADD_PRECOMPUTED_VELOCITY) + float3 precomputedVelocity : TEXCOORD5; // Add Precomputed Velocity (Alembic computes velocities on runtime side). + #endif + #endif + + UNITY_VERTEX_INPUT_INSTANCE_ID + }; + + struct TessVertex + { + float4 vertex : INTERNALTESSPOS; + float3 normal : NORMAL; + float4 tangent : TANGENT; + float4 texcoord0 : TEXCOORD0; + float4 texcoord1 : TEXCOORD1; + float4 texcoord2 : TEXCOORD2; + + // #if %TEXCOORD3REQUIREKEY% + float4 texcoord3 : TEXCOORD3; + // #endif + + // #if %VERTEXCOLORREQUIREKEY% + float4 vertexColor : COLOR; + // #endif + + // #if %EXTRAV2F0REQUIREKEY% + // float4 extraV2F0 : TEXCOORD5; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // float4 extraV2F1 : TEXCOORD6; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // float4 extraV2F2 : TEXCOORD7; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // float4 extraV2F3 : TEXCOORD8; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // float4 extraV2F4 : TEXCOORD9; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // float4 extraV2F5 : TEXCOORD10; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // float4 extraV2F6 : TEXCOORD11; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // float4 extraV2F7 : TEXCOORD12; + // #endif + + #if _PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR)) + float3 previousPositionOS : TEXCOORD13; // Contain previous transform position (in case of skinning for example) + #if defined (_ADD_PRECOMPUTED_VELOCITY) + float3 precomputedVelocity : TEXCOORD14; + #endif + #endif + + UNITY_VERTEX_INPUT_INSTANCE_ID + UNITY_VERTEX_OUTPUT_STEREO + }; + + struct ExtraV2F + { + float4 extraV2F0; + float4 extraV2F1; + float4 extraV2F2; + float4 extraV2F3; + float4 extraV2F4; + float4 extraV2F5; + float4 extraV2F6; + float4 extraV2F7; + Blackboard blackboard; + float4 time; + }; + + + float3 WorldToTangentSpace(ShaderData d, float3 normal) + { + return mul(d.TBNMatrix, normal); + } + + float3 TangentToWorldSpace(ShaderData d, float3 normal) + { + return mul(normal, d.TBNMatrix); + } + + // in this case, make standard more like SRPs, because we can't fix + // unity_WorldToObject in HDRP, since it already does macro-fu there + + #if _STANDARD + float3 TransformWorldToObject(float3 p) { return mul(unity_WorldToObject, float4(p, 1)); }; + float3 TransformObjectToWorld(float3 p) { return mul(unity_ObjectToWorld, float4(p, 1)); }; + float4 TransformWorldToObject(float4 p) { return mul(unity_WorldToObject, p); }; + float4 TransformObjectToWorld(float4 p) { return mul(unity_ObjectToWorld, p); }; + float4x4 GetWorldToObjectMatrix() { return unity_WorldToObject; } + float4x4 GetObjectToWorldMatrix() { return unity_ObjectToWorld; } + #if (defined(SHADER_API_D3D11) || defined(SHADER_API_XBOXONE) || defined(UNITY_COMPILER_HLSLCC) || defined(SHADER_API_PSSL) || (SHADER_TARGET_SURFACE_ANALYSIS && !SHADER_TARGET_SURFACE_ANALYSIS_MOJOSHADER)) + #define UNITY_SAMPLE_TEX2D_LOD(tex,coord, lod) tex.SampleLevel (sampler##tex,coord, lod) + #define UNITY_SAMPLE_TEX2D_SAMPLER_LOD(tex,samplertex,coord, lod) tex.SampleLevel (sampler##samplertex,coord, lod) + #else + #define UNITY_SAMPLE_TEX2D_LOD(tex,coord,lod) tex2D (tex,coord,0,lod) + #define UNITY_SAMPLE_TEX2D_SAMPLER_LOD(tex,samplertex,coord,lod) tex2D (tex,coord,0,lod) + #endif + + #undef GetWorldToObjectMatrix() + + #define GetWorldToObjectMatrix() unity_WorldToObject + + + #endif + + float3 GetCameraWorldPosition() + { + #if _HDRP + return GetCameraRelativePositionWS(_WorldSpaceCameraPos); + #else + return _WorldSpaceCameraPos; + #endif + } + + #if _GRABPASSUSED + #if _STANDARD + TEXTURE2D(%GRABTEXTURE%); + SAMPLER(sampler_%GRABTEXTURE%); + #endif + + half3 GetSceneColor(float2 uv) + { + #if _STANDARD + return SAMPLE_TEXTURE2D(%GRABTEXTURE%, sampler_%GRABTEXTURE%, uv).rgb; + #else + return SHADERGRAPH_SAMPLE_SCENE_COLOR(uv); + #endif + } + #endif + + + + #if _STANDARD + UNITY_DECLARE_DEPTH_TEXTURE(_CameraDepthTexture); + float GetSceneDepth(float2 uv) { return SAMPLE_DEPTH_TEXTURE(_CameraDepthTexture, uv); } + float GetLinear01Depth(float2 uv) { return Linear01Depth(GetSceneDepth(uv)); } + float GetLinearEyeDepth(float2 uv) { return LinearEyeDepth(GetSceneDepth(uv)); } + #else + float GetSceneDepth(float2 uv) { return SHADERGRAPH_SAMPLE_SCENE_DEPTH(uv); } + float GetLinear01Depth(float2 uv) { return Linear01Depth(GetSceneDepth(uv), _ZBufferParams); } + float GetLinearEyeDepth(float2 uv) { return LinearEyeDepth(GetSceneDepth(uv), _ZBufferParams); } + #endif + + float3 GetWorldPositionFromDepthBuffer(float2 uv, float3 worldSpaceViewDir) + { + float eye = GetLinearEyeDepth(uv); + float3 camView = mul((float3x3)GetObjectToWorldMatrix(), transpose(mul(GetWorldToObjectMatrix(), UNITY_MATRIX_I_V)) [2].xyz); + + float dt = dot(worldSpaceViewDir, camView); + float3 div = worldSpaceViewDir/dt; + float3 wpos = (eye * div) + GetCameraWorldPosition(); + return wpos; + } + + #if _HDRP + float3 ObjectToWorldSpacePosition(float3 pos) + { + return GetAbsolutePositionWS(TransformObjectToWorld(pos)); + } + #else + float3 ObjectToWorldSpacePosition(float3 pos) + { + return TransformObjectToWorld(pos); + } + #endif + + #if _STANDARD + UNITY_DECLARE_SCREENSPACE_TEXTURE(_CameraDepthNormalsTexture); + float3 GetSceneNormal(float2 uv, float3 worldSpaceViewDir) + { + float4 depthNorms = UNITY_SAMPLE_SCREENSPACE_TEXTURE(_CameraDepthNormalsTexture, uv); + float3 norms = DecodeViewNormalStereo(depthNorms); + norms = mul((float3x3)GetWorldToViewMatrix(), norms) * 0.5 + 0.5; + return norms; + } + #elif _HDRP && !_DECALSHADER + + float3 GetSceneNormal(float2 uv, float3 worldSpaceViewDir) + { + NormalData nd; + DecodeFromNormalBuffer(_ScreenSize.xy * uv, nd); + return nd.normalWS; + } + #elif _URP + #if (SHADER_LIBRARY_VERSION_MAJOR >= 10) + #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/DeclareNormalsTexture.hlsl" + #endif + + float3 GetSceneNormal(float2 uv, float3 worldSpaceViewDir) + { + #if (SHADER_LIBRARY_VERSION_MAJOR >= 10) + return SampleSceneNormals(uv); + #else + float3 wpos = GetWorldPositionFromDepthBuffer(uv, worldSpaceViewDir); + return normalize(-cross(ddx(wpos), ddy(wpos))) * 0.5 + 0.5; + #endif + + } + #endif + + #if _HDRP + + half3 UnpackNormalmapRGorAG(half4 packednormal) + { + // This do the trick + packednormal.x *= packednormal.w; + + half3 normal; + normal.xy = packednormal.xy * 2 - 1; + normal.z = sqrt(1 - saturate(dot(normal.xy, normal.xy))); + return normal; + } + half3 UnpackNormal(half4 packednormal) + { + #if defined(UNITY_NO_DXT5nm) + return packednormal.xyz * 2 - 1; + #else + return UnpackNormalmapRGorAG(packednormal); + #endif + } + #endif + #if _HDRP || _URP + + half3 UnpackScaleNormal(half4 packednormal, half scale) + { + #ifndef UNITY_NO_DXT5nm + // Unpack normal as DXT5nm (1, y, 1, x) or BC5 (x, y, 0, 1) + // Note neutral texture like "bump" is (0, 0, 1, 1) to work with both plain RGB normal and DXT5nm/BC5 + packednormal.x *= packednormal.w; + #endif + half3 normal; + normal.xy = (packednormal.xy * 2 - 1) * scale; + normal.z = sqrt(1 - saturate(dot(normal.xy, normal.xy))); + return normal; + } + + #endif + + + void GetSun(out float3 lightDir, out float3 color) + { + lightDir = float3(0.5, 0.5, 0); + color = 1; + #if _HDRP + if (_DirectionalLightCount > 0) + { + DirectionalLightData light = _DirectionalLightDatas[0]; + lightDir = -light.forward.xyz; + color = light.color; + } + #elif _STANDARD + lightDir = normalize(_WorldSpaceLightPos0.xyz); + color = _LightColor0.rgb; + #elif _URP + Light light = GetMainLight(); + lightDir = light.direction; + color = light.color; + #endif + } + + + + + CBUFFER_START(UnityPerMaterial) + + float _StencilRef; + float _StencilWriteMask; + float _StencilRefDepth; + float _StencilWriteMaskDepth; + float _StencilRefMV; + float _StencilWriteMaskMV; + float _StencilRefDistortionVec; + float _StencilWriteMaskDistortionVec; + float _StencilWriteMaskGBuffer; + float _StencilRefGBuffer; + float _ZTestGBuffer; + float _RequireSplitLighting; + float _ReceivesSSR; + float _ZWrite; + float _TransparentSortPriority; + float _ZTestDepthEqualForOpaque; + float _ZTestTransparent; + float _TransparentBackfaceEnable; + float _AlphaCutoffEnable; + float _UseShadowThreshold; + + + half4 _Color; + half4 _MainTex_ST, _MainTex_TexelSize; + half _Alpha, _AlphaCutoffValue; + + #if ATLAS_ON + half _MinXUV, _MaxXUV, _MinYUV, _MaxYUV; + #endif + + #if GLOW_ON + half4 _GlowColor; + half _Glow, _GlowGlobal; + #endif + + #if HSV_ON + half _HsvShift, _HsvSaturation, _HsvBright; + #endif + + #if DISTORT_ON + half4 _DistortTex_ST; + half _DistortTexXSpeed, _DistortTexYSpeed, _DistortAmount; + #endif + + #if FADE_ON + half4 _FadeBurnColor, _FadeTex_ST, _FadeBurnTex_ST; + half _FadeAmount, _FadeBurnWidth, _FadeBurnTransition,_FadeBurnGlow; + #endif + + #if OUTBASE_ON + half4 _OutlineColor; + half _OutlineAlpha, _OutlineGlow, _OutlineWidth; + int _OutlinePixelWidth; + #endif + + #if OUTTEX_ON + half4 _OutlineTex_ST; + half _OutlineTexXSpeed, _OutlineTexYSpeed; + #endif + + #if OUTDIST_ON + half4 _OutlineDistortTex_ST; + half _OutlineDistortTexXSpeed, _OutlineDistortTexYSpeed, _OutlineDistortAmount; + #endif + + #if ALPHAOUTLINE_ON + half _AlphaOutlineGlow, _AlphaOutlinePower, _AlphaOutlineMinAlpha, _AlphaOutlineBlend; + half4 _AlphaOutlineColor; + #endif + + #if INNEROUTLINE_ON + half _InnerOutlineThickness, _InnerOutlineAlpha, _InnerOutlineGlow; + half4 _InnerOutlineColor; + #endif + + #if GRADIENT_ON + half _GradBlend, _GradBoostX, _GradBoostY; + half4 _GradTopRightCol, _GradTopLeftCol, _GradBotRightCol, _GradBotLeftCol; + #endif + + #if COLORSWAP_ON + half4 _ColorSwapRed, _ColorSwapGreen, _ColorSwapBlue; + half _ColorSwapRedLuminosity, _ColorSwapGreenLuminosity, _ColorSwapBlueLuminosity, _ColorSwapBlend; + #endif + + #if CHANGECOLOR_ON + half4 _ColorChangeNewCol, _ColorChangeTarget; + half _ColorChangeTolerance, _ColorChangeLuminosity; + #endif + #if CHANGECOLOR2_ON + half4 _ColorChangeNewCol2, _ColorChangeTarget2; + half _ColorChangeTolerance2; + #endif + #if CHANGECOLOR3_ON + half4 _ColorChangeNewCol3, _ColorChangeTarget3; + half _ColorChangeTolerance3; + #endif + + #if COLORRAMP_ON + half _ColorRampLuminosity, _ColorRampBlend; + #endif + + #if HITEFFECT_ON + half4 _HitEffectColor; + half _HitEffectGlow, _HitEffectBlend; + #endif + + #if NEGATIVE_ON + half _NegativeAmount; + #endif + + #if PIXELATE_ON + half _PixelateSize; + #endif + + #if GREYSCALE_ON + half _GreyscaleLuminosity, _GreyscaleBlend; + half4 _GreyscaleTintColor; + #endif + + #if POSTERIZE_ON + half _PosterizeNumColors, _PosterizeGamma; + #endif + + #if BLUR_ON + half _BlurIntensity; + #endif + + #if MOTIONBLUR_ON + half _MotionBlurAngle, _MotionBlurDist; + #endif + + #if GHOST_ON + half _GhostColorBoost, _GhostTransparency, _GhostBlend; + #endif + + #if HOLOGRAM_ON + half _HologramStripesAmount, _HologramMinAlpha, _HologramUnmodAmount, _HologramStripesSpeed, _HologramMaxAlpha, _HologramBlend; + half4 _HologramStripeColor; + #endif + + #if CHROMABERR_ON + half _ChromAberrAmount, _ChromAberrAlpha; + #endif + + #if GLITCH_ON + half _GlitchAmount, _GlitchSize; + #endif + + #if FLICKER_ON + half _FlickerFreq, _FlickerPercent, _FlickerAlpha; + #endif + + #if SHADOW_ON + half _ShadowX, _ShadowY, _ShadowAlpha; + half4 _ShadowColor; + #endif + + #if SHINE_ON + half4 _ShineColor; + half _ShineLocation, _ShineRotate, _ShineWidth, _ShineGlow; + #endif + + #if CONTRAST_ON + half _Contrast, _Brightness; + #endif + + #if OVERLAY_ON + half4 _OverlayTex_ST, _OverlayColor; + half _OverlayGlow, _OverlayBlend, _OverlayTextureScrollXSpeed, _OverlayTextureScrollYSpeed; + #endif + + #if DOODLE_ON + half _HandDrawnAmount, _HandDrawnSpeed; + #endif + + #if WIND_ON + half _GrassSpeed, _GrassWind, _GrassManualAnim, _GrassRadialBend; + #endif + + #if WAVEUV_ON + float _WaveAmount, _WaveSpeed, _WaveStrength, _WaveX, _WaveY; + #endif + + #if ROUNDWAVEUV_ON + half _RoundWaveStrength, _RoundWaveSpeed; + #endif + + #if RECTSIZE_ON + half _RectSize; + #endif + + #if OFFSETUV_ON + half _OffsetUvX, _OffsetUvY; + #endif + + #if CLIPPING_ON + half _ClipUvLeft, _ClipUvRight, _ClipUvUp, _ClipUvDown; + #endif + + #if RADIALCLIPPING_ON + half _RadialStartAngle, _RadialClip, _RadialClip2; + #endif + + #if TEXTURESCROLL_ON + half _TextureScrollXSpeed, _TextureScrollYSpeed; + #endif + + #if ZOOMUV_ON + half _ZoomUvAmount; + #endif + + #if WARP_ON + half _WarpStrength, _WarpSpeed, _WarpScale; + #endif + + #if TWISTUV_ON + half _TwistUvAmount, _TwistUvPosX, _TwistUvPosY, _TwistUvRadius; + #endif + + #if ROTATEUV_ON + half _RotateUvAmount; + #endif + + #if FISHEYE_ON + half _FishEyeUvAmount; + #endif + + #if PINCH_ON + half _PinchUvAmount; + #endif + + #if SHAKEUV_ON + half _ShakeUvSpeed, _ShakeUvX, _ShakeUvY; + #endif + + #if NORMALMAP_ON + half _NormalStrength; + #endif + + float _RandomSeed; + + + + + CBUFFER_END + + + + + + + + TEXTURE2D(_MainTex); + SAMPLER(sampler_MainTex); + + #if GLOW_ON + TEXTURE2D(_GlowTex); + SAMPLER(sampler_GlowTex); + #endif + + #if FADE_ON + TEXTURE2D(_FadeTex); + SAMPLER(sampler_FadeTex); + + TEXTURE2D(_FadeBurnTex); + SAMPLER(sampler_FadeBurnTex); + #endif + + #if DISTORT_ON + TEXTURE2D(_DistortTex); + SAMPLER(sampler_DistortTex); + #endif + + #if OUTTEX_ON + TEXTURE2D(_OutlineTex); + SAMPLER(sampler_OutlineTex); + #endif + + #if OUTDIST_ON + TEXTURE2D(_OutlineDistortTex); + SAMPLER(sampler_OutlineDistortTex); + #endif + + #if COLORSWAP_ON + TEXTURE2D(_ColorSwapTex); + SAMPLER(sampler_ColorSwapTex); + #endif + + #if COLORRAMP_ON + TEXTURE2D(_ColorRampTex); + TEXTURE2D(_ColorRampTexGradient); + SAMPLER(sampler_ColorRampTex); + SAMPLER(sampler_ColorRampTexGradient); + #endif + + #if SHINE_ON + TEXTURE2D(_ShineMask); + SAMPLER(sampler_ShineMask); + #endif + + #if OVERLAY_ON + TEXTURE2D(_OverlayTex); + SAMPLER(sampler_OverlayTex); + #endif + + #if NORMALMAP_ON + TEXTURE2D(_NormalMap); + SAMPLER(sampler_NormalMap); + #endif + + + half3 GetPixel(in int offsetX, in int offsetY, in half2 uv, in Texture2D _tex, in SamplerState _sampler) + { + half2 _uv = uv + half2(offsetX * _MainTex_TexelSize.x, offsetY * _MainTex_TexelSize.y); + half4 col = SAMPLE_TEXTURE2D(_tex, _sampler, _uv); + return col.rgb; + } + + + //BLURS------------------------------------------------------------------------- + half4 Blur(half2 uv, Texture2D source, SamplerState sampler_source, half Intensity) + { + const half2 texelSize = 1.0 / _ScreenParams.xy; + const half4 color = SAMPLE_TEXTURE2D(source, sampler_source, uv); + const half2 offset = Intensity * texelSize; + + half4 accumulatedColor = color; + half accumulatedWeight = 1.0; + for (int x = -1; x <= 1; x++) + { + for (int y = -1; y <= 1; y++) + { + const half2 sampleUV = uv + half2(x, y) * offset; + const half4 sampleColor = SAMPLE_TEXTURE2D(source, sampler_source, sampleUV); + + accumulatedColor += sampleColor; + accumulatedWeight += 1.0; + } + } + + half4 blurredColor = accumulatedColor / accumulatedWeight; + return blurredColor; + } + + half BlurHD_G(half bhqp, half x) + { + return exp(-(x * x) / (2.0 * bhqp * bhqp)); + } + half4 BlurHD(half2 uv, Texture2D source, SamplerState sampler_source, half BlurAmount, half xScale, half yScale) + { + int iterations = 16; + int halfIterations = iterations / 2; + half sigmaX = 0.1 + BlurAmount * 0.5; + half sigmaY = sigmaX; + half total = 0.0; + half4 ret = half4(0, 0, 0, 0); + for (int iy = 0; iy < iterations; ++iy) + { + half fy = BlurHD_G(sigmaY, half(iy) -half(halfIterations)); + half offsetY = half(iy - halfIterations) * 0.00390625 * xScale; + for (int ix = 0; ix < iterations; ++ix) + { + half fx = BlurHD_G(sigmaX, half(ix) - half(halfIterations)); + half offsetX = half(ix - halfIterations) * 0.00390625 * yScale; + total += fx * fy; + ret += SAMPLE_TEXTURE2D(source, sampler_source, uv + half2(offsetX, offsetY)) * fx * fy; + } + } + return ret / total; + } + //----------------------------------------------------------------------- + + + //------------------------------------------- + half RemapFloat(half inValue, half inMin, half inMax, half outMin, half outMax){ + return outMin + (inValue - inMin) * (outMax - outMin) / (inMax - inMin); + } + //------------------------------------------- + + //----------------------------------------------------------------------- + half rand(half2 seed, half offset) { + return (frac(sin(dot(seed, half2(12.9898, 78.233))) * 43758.5453) + offset) % 1.0; + } + + half rand2(half2 seed, half offset) { + return (frac(sin(dot(seed * floor(50 + (_Time.x % 1.0) * 12.), half2(127.1, 311.7))) * 43758.5453123) + offset) % 1.0; + } + + half rand2CustomTime(half2 seed, half offset, half customTime) { + return (frac(sin(dot(seed * floor(50 + (customTime % 1.0) * 12.), half2(127.1, 311.7))) * 43758.5453123) + offset) % 1.0; + } + //----------------------------------------------------------------------- + + + void Ext_ModifyVertex0 (inout VertexData v, inout ExtraV2F d) + { + //BILBOARD_ON + #if BILBOARD_ON + half3 camRight = mul((half3x3)unity_CameraToWorld, half3(1,0,0)); + half3 camUp = half3(0,1,0); + #if BILBOARDY_ON + camUp = mul((half3x3)unity_CameraToWorld, half3(0,1,0)); + #endif + half3 localPos = v.vertex.x * camRight + v.vertex.y * camUp; + v.vertex = half4(localPos, 1); + #endif + //----------------------------------------------------------- + + v.texcoord0.xy = TRANSFORM_TEX(v.texcoord0.xy, _MainTex); + half2 center = half2(0.5, 0.5); + #if ATLAS_ON + center = half2((_MaxXUV + _MinXUV) / 2.0, (_MaxYUV + _MinYUV) / 2.0); + #endif + + //POLARUV_ON + #if POLARUV_ON + v.texcoord0.xy = v.texcoord0.xy - center; + #endif + + //---------------------------------------- + + //ROTATEUV_ON + #if ROTATEUV_ON + half2 uvC = v.texcoord0.xy; + half cosAngle = cos(_RotateUvAmount); + half sinAngle = sin(_RotateUvAmount); + half2x2 rot = half2x2(cosAngle, -sinAngle, sinAngle, cosAngle); + uvC -= center; + v.texcoord0.xy = mul(rot, uvC); + v.texcoord0.xy += center; + #endif + //-------------------- + + #if RECTSIZE_ON + v.vertex.xyz += (v.vertex.xyz * (_RectSize - 1.0)); + #endif + + #if OUTTEX_ON + v.texcoord1.xy = TRANSFORM_TEX(v.texcoord0.xy, _OutlineTex); + #endif + + #if OUTDIST_ON + v.texcoord2.xy = TRANSFORM_TEX(v.texcoord0.xy, _OutlineDistortTex); + #endif + + #if DISTORT_ON + v.texcoord3.xy = TRANSFORM_TEX(v.texcoord0.xy, _DistortTex); + #endif + } + + void Ext_SurfaceFunction0 (inout Surface o, ShaderData d) + { + half randomSeed = _RandomSeed; + + float2 uvRect = d.texcoord0; + half2 center = half2(0.5, 0.5); + #if ATLAS_ON + center = half2((_MaxXUV + _MinXUV) / 2.0, (_MaxYUV + _MinYUV) / 2.0); + uvRect = half2((d.texcoord0.x - _MinXUV) / (_MaxXUV - _MinXUV), (d.texcoord0.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half2 centerTiled = half2(center.x * _MainTex_ST.x, center.y * _MainTex_ST.y); + + //CLIPPING_ON + #if CLIPPING_ON + half2 tiledUv = half2(d.texcoord0.x / _MainTex_ST.x, d.texcoord0.y / _MainTex_ST.y); + #if ATLAS_ON + tiledUv = half2((tiledUv.x - _MinXUV) / (_MaxXUV - _MinXUV), (tiledUv.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + clip((1 - _ClipUvUp) - tiledUv.y); + clip(tiledUv.y - _ClipUvDown); + clip((1 - _ClipUvRight) - tiledUv.x); + clip(tiledUv.x - _ClipUvLeft); + #endif + //---------------------------------- + + //RADIALCLIPPING_ON + #if RADIALCLIPPING_ON + half2 tiledUv2 = half2(d.texcoord0.x / _MainTex_ST.x, d.texcoord0.y / _MainTex_ST.y); + #if ATLAS_ON + tiledUv2 = half2((tiledUv2.x - _MinXUV) / (_MaxXUV - _MinXUV), (tiledUv2.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half startAngle = _RadialStartAngle - _RadialClip; + half endAngle = _RadialStartAngle + _RadialClip2; + half offset0 = clamp(0, 360, startAngle + 360); + half offset360 = clamp(0, 360, endAngle - 360); + half2 atan2Coord = half2(lerp(-1, 1, tiledUv2.x), lerp(-1, 1, tiledUv2.y)); + half atanAngle = atan2(atan2Coord.y, atan2Coord.x) * 57.3; // angle in degrees + if(atanAngle < 0) atanAngle = 360 + atanAngle; + if(atanAngle >= startAngle && atanAngle <= endAngle) discard; + if(atanAngle <= offset360) discard; + if(atanAngle >= offset0) discard; + #endif + + //----------------------------- + + //TEXTURESCROLL_ON && ATLAS_ON + #if TEXTURESCROLL_ON && ATLAS_ON + d.texcoord0.xy = half2(_MinXUV + ((_MaxXUV - _MinXUV) * (abs(((_Time.y + randomSeed) * _TextureScrollXSpeed) + uvRect.x) % 1)), + _MinYUV + ((_MaxYUV - _MinYUV) * (abs(((_Time.y + randomSeed) * _TextureScrollYSpeed) + uvRect.y) % 1))); + #endif + //---------------------------- + + //OFFSETUV_ON + #if OFFSETUV_ON + #if ATLAS_ON + d.texcoord0.xy = half2(_MinXUV + ((_MaxXUV - _MinXUV) * (abs((_OffsetUvX + uvRect.x) % 1))), + _MinYUV + ((_MaxYUV - _MinYUV) * (abs(_OffsetUvY + uvRect.y) % 1))); + #else + d.texcoord0.xy += half2(_OffsetUvX, _OffsetUvY); + #endif + #endif + + //---------------------- + + //POLARUV_ON + #if POLARUV_ON + d.texcoord0.xy = half2(atan2(d.texcoord0.y, d.texcoord0.x) / (2.0f * 3.141592653589f), length(d.texcoord0.xy)); + d.texcoord0.xy *= _MainTex_ST.xy; + #endif + + //-------------------------------------- + + //TWISTUV_ON + #if TWISTUV_ON + #if ATLAS_ON + _TwistUvPosX = ((_MaxXUV - _MinXUV) * _TwistUvPosX) + _MinXUV; + _TwistUvPosY = ((_MaxYUV - _MinYUV) * _TwistUvPosY) + _MinYUV; + #endif + half2 tempUv = d.texcoord0.xy - half2(_TwistUvPosX * _MainTex_ST.x, _TwistUvPosY * _MainTex_ST.y); + _TwistUvRadius *= (_MainTex_ST.x + _MainTex_ST.y) / 2; + half percent = (_TwistUvRadius - length(tempUv)) / _TwistUvRadius; + half theta = percent * percent * (2.0 * sin(_TwistUvAmount)) * 8.0; + half s = sin(theta); + half c = cos(theta); + half beta = max(sign(_TwistUvRadius - length(tempUv)), 0.0); + tempUv = half2(dot(tempUv, half2(c, -s)), dot(tempUv, half2(s, c))) * beta + tempUv * (1 - beta); + tempUv += half2(_TwistUvPosX * _MainTex_ST.x, _TwistUvPosY * _MainTex_ST.y); + d.texcoord0.xy = tempUv; + #endif + + //-------------------------------------------- + + //FISHEYE_ON + #if FISHEYE_ON + half bind = length(centerTiled); + half2 dF = d.texcoord0.xy - centerTiled; + half dFlen = length(dF); + half fishInt = (3.14159265359 / bind) * (_FishEyeUvAmount + 0.001); + d.texcoord0.xy = centerTiled + (dF / (max(0.0001, dFlen))) * tan(dFlen * fishInt) * bind / tan(bind * fishInt); + #endif + //--------------------------------------------- + + //PINCH_ON + #if PINCH_ON + half2 dP = d.texcoord0.xy - centerTiled; + half pinchInt = (3.141592 / length(centerTiled)) * (-_PinchUvAmount + 0.001); + d.texcoord0.xy = centerTiled + normalize(dP) * atan(length(dP) * -pinchInt * 10.0) * 0.5 / atan(-pinchInt * 5); + #endif + + //--------------------------------------------- + + //ZOOMUV_ON + #if ZOOMUV_ON + d.texcoord0.xy -= centerTiled; + d.texcoord0.xy = d.texcoord0.xy * _ZoomUvAmount; + d.texcoord0.xy += centerTiled; + #endif + + //----------------------------------------------- + + //DOODLE_ON + #if DOODLE_ON + half2 uvCopy = uvRect; + _HandDrawnSpeed = (floor((_Time.x + randomSeed) * 20 * _HandDrawnSpeed) / _HandDrawnSpeed) * _HandDrawnSpeed; + uvCopy.x = sin((uvCopy.x * _HandDrawnAmount + _HandDrawnSpeed) * 4); + uvCopy.y = cos((uvCopy.y * _HandDrawnAmount + _HandDrawnSpeed) * 4); + d.texcoord0.xy = lerp(d.texcoord0.xy, d.texcoord0.xy + uvCopy, 0.0005 * _HandDrawnAmount); + #endif + + //-------------------------- + + //SHAKEUV_ON + #if SHAKEUV_ON + half xShake = sin((_Time.x + randomSeed) * _ShakeUvSpeed * 50) * _ShakeUvX; + half yShake = cos((_Time.x + randomSeed) * _ShakeUvSpeed * 50) * _ShakeUvY; + d.texcoord0.xy += half2(xShake * 0.012, yShake * 0.01); + #endif + + //------------------------------------------- + + //RECTSIZE_ON + #if RECTSIZE_ON + d.texcoord0.xy = d.texcoord0.xy * (_RectSize).xx + (((-_RectSize * 0.5) + 0.5)).xx; + #endif + + //------------------------------------------- + + //DISTORT_ON + #if DISTORT_ON + #if ATLAS_ON + d.texcoord3.x = d.texcoord3.x * (1 / (_MaxXUV - _MinXUV)); + d.texcoord3.y = d.texcoord3.y * (1 / (_MaxYUV - _MinYUV)); + #endif + + d.texcoord3.x += ((_Time.x + _RandomSeed) * _DistortTexXSpeed) % 1; + d.texcoord3.y += ((_Time.x + _RandomSeed) * _DistortTexYSpeed) % 1; + half distortAmnt = (SAMPLE_TEXTURE2D(_DistortTex, sampler_DistortTex, d.texcoord3.xy).r - 0.5) * 0.2 * _DistortAmount; + d.texcoord0.x += distortAmnt; + d.texcoord0.y += distortAmnt; + #endif + //------------------------------------------------------- + + //WARP_ON + #if WARP_ON + half2 warpUv = half2(d.texcoord0.x / _MainTex_ST.x, d.texcoord0.y / _MainTex_ST.y); + #if ATLAS_ON + warpUv = half2((warpUv.x - _MinXUV) / (_MaxXUV - _MinXUV), (warpUv.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + const float tau = 6.283185307179586; + float xWarp = (_Time.y + randomSeed) * _WarpSpeed + warpUv.x * tau / _WarpScale; + float yWarp = (_Time.y + randomSeed) * _WarpSpeed + warpUv.y * tau / _WarpScale; + float2 warp = float2(sin(xWarp), sin(yWarp)) * _WarpStrength; + d.texcoord0.xy += warp; + #endif + + //------------------------------------------------------- + + //WAVEUV_ON + #if WAVEUV_ON + float2 uvWave = half2(_WaveX * _MainTex_ST.x, _WaveY * _MainTex_ST.y) - d.texcoord0.xy; + uvWave %= 1; + #if ATLAS_ON + uvWave = half2(_WaveX, _WaveY) - uvRect; + #endif + uvWave.x *= _ScreenParams.x / _ScreenParams.y; + float waveTime = _Time.y + randomSeed; + float angWave = (sqrt(dot(uvWave, uvWave)) * _WaveAmount) - ((waveTime * _WaveSpeed)); + d.texcoord0.xy = d.texcoord0.xy + uvWave * sin(angWave) * (_WaveStrength / 1000.0); + #endif + //---------------------------------------------------- + + //ROUNDWAVEUV_ON + #if ROUNDWAVEUV_ON + half xWave = ((0.5 * _MainTex_ST.x) - uvRect.x); + half yWave = ((0.5 * _MainTex_ST.y) - uvRect.y) * (_MainTex_TexelSize.w / _MainTex_TexelSize.z); + half ripple = -sqrt(xWave*xWave + yWave* yWave); + d.texcoord0.xy += (sin((ripple + (_Time.y + randomSeed) * (_RoundWaveSpeed/10.0)) / 0.015) * (_RoundWaveStrength/10.0)) % 1; + #endif + //---------------------------------------------------- + + + //WIND_ON + #if WIND_ON + half windOffset = sin((_Time.x + randomSeed) * _GrassSpeed * 10); + half2 windCenter = half2(0.5, 0.1); + #if ATLAS_ON + windCenter.x = ((_MaxXUV - _MinXUV) * windCenter.x) + _MinXUV; + windCenter.y = ((_MaxYUV - _MinYUV) * windCenter.y) + _MinYUV; + #endif + #if !MANUALWIND_ON + d.texcoord0.x = fmod(abs(lerp(d.texcoord0.x, d.texcoord0.x + (_GrassWind * 0.01 * windOffset), uvRect.y)), 1); + #else + d.texcoord0.x = fmod(abs(lerp(d.texcoord0.x, d.texcoord0.x + (_GrassWind * 0.01 * _GrassManualAnim), uvRect.y)), 1); + windOffset = _GrassManualAnim; + #endif + half2 delta = d.texcoord0.xy - windCenter; + half delta2 = dot(delta.xy, delta.xy); + half2 delta_offset = delta2 * windOffset; + d.texcoord0.xy = d.texcoord0.xy + half2(delta.y, -delta.x) * delta_offset * _GrassRadialBend; + #endif + + //-------------------------------------------------------- + + //TEXTURESCROLL_ON && !ATLAS_ON + #if TEXTURESCROLL_ON && !ATLAS_ON + d.texcoord0.x += ((_Time.y + randomSeed) * _TextureScrollXSpeed) % 1; + d.texcoord0.y += ((_Time.y + randomSeed) * _TextureScrollYSpeed) % 1; + #endif + //------------------------------ + + //PIXELATE_ON + #if PIXELATE_ON + half aspectRatio = _MainTex_TexelSize.x / _MainTex_TexelSize.y; + half2 pixelSize = float2(_PixelateSize, _PixelateSize * aspectRatio); + d.texcoord0.xy = floor(d.texcoord0.xy * pixelSize) / pixelSize; + #endif + //-------------- + + half4 col = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy); + half originalAlpha = col.a; + col *= d.vertexColor; + + //NORMAL MAP + #if NORMALMAP_ON + half4 normalSample = SAMPLE_TEXTURE2D(_NormalMap, sampler_NormalMap, d.texcoord0.xy); + half3 normalTS = UnpackNormal(normalSample); + normalTS.xy *= _NormalStrength; + o.Normal = normalTS; + #endif + + + //GLITCH_ON + #if GLITCH_ON + half2 uvGlitch = uvRect; + uvGlitch.y -= 0.5; + half lineNoise = pow(rand2(floor(uvGlitch * half2(24., 19.) * _GlitchSize) * 4.0, randomSeed), 3.0) * _GlitchAmount + * pow(rand2(floor(uvGlitch * half2(38., 14.) * _GlitchSize) * 4.0, randomSeed), 3.0); + col = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(lineNoise * 0.02 * rand2(half2(2.0, 1), randomSeed), 0)) * d.vertexColor; + #endif + //-------------------------------------- + + //CHROMABERR_ON + #if CHROMABERR_ON + half4 r = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(_ChromAberrAmount/10, 0)) * d.vertexColor; + half4 b = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(-_ChromAberrAmount/10, 0)) * d.vertexColor; + col = half4(r.r * r.a, col.g, b.b * b.a, max(max(r.a, b.a) * _ChromAberrAlpha, col.a)); + #endif + + //-------------------------------- + + //BLUR_ON + #if BLUR_ON + #if ATLAS_ON + #if !BLURISHD_ON + col = BlurHD(d.texcoord0.xy, _MainTex, sampler_MainTex, _BlurIntensity, (_MaxXUV - _MinXUV), (_MaxYUV - _MinYUV)) * d.vertexColor; + #else + col = Blur(d.texcoord0.xy, _MainTex, sampler_MainTex, _BlurIntensity * (_MaxXUV - _MinXUV)) * d.vertexColor; + #endif + #else + #if !BLURISHD_ON + col = BlurHD(d.texcoord0.xy, _MainTex, sampler_MainTex, _BlurIntensity, 1, 1) * d.vertexColor; + #else + col = Blur(d.texcoord0.xy, _MainTex, sampler_MainTex, _BlurIntensity) * d.vertexColor; + #endif + #endif + #endif + + //-------------------- + + //MOTIONBLUR_ON + #if MOTIONBLUR_ON + _MotionBlurAngle = _MotionBlurAngle * 3.1415926; + #define rot(n) mul(n, half2x2(cos(_MotionBlurAngle), -sin(_MotionBlurAngle), sin(_MotionBlurAngle), cos(_MotionBlurAngle))) + _MotionBlurDist = _MotionBlurDist * 0.005; + #if ATLAS_ON + _MotionBlurDist *= (_MaxXUV - _MinXUV); + #endif + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(-_MotionBlurDist, -_MotionBlurDist))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(-_MotionBlurDist * 2, -_MotionBlurDist * 2))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(-_MotionBlurDist * 3, -_MotionBlurDist * 3))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(-_MotionBlurDist * 4, -_MotionBlurDist * 4))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(_MotionBlurDist, _MotionBlurDist))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(_MotionBlurDist * 2, _MotionBlurDist * 2))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(_MotionBlurDist * 3, _MotionBlurDist * 3))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(_MotionBlurDist * 4, _MotionBlurDist * 4))); + col.rgb = col.rgb / 9; + #endif + //------------------------------------ + + //NEGATIVE_ON + #if NEGATIVE_ON + col.rgb = lerp(col.rgb, 1 - col.rgb, _NegativeAmount); + #endif + + //-------------- + half luminance = 0; + + //GREYSCALE_ON && !GREYSCALEOUTLINE_ON + #if GREYSCALE_ON && !GREYSCALEOUTLINE_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + luminance = saturate(luminance + _GreyscaleLuminosity); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _GreyscaleTintColor, _GreyscaleBlend); + #endif + //------------------------------------ + + //GHOST_ON + #if GHOST_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + half4 ghostResult; + ghostResult.a = saturate(luminance - _GhostTransparency) * col.a; + ghostResult.rgb = col.rgb * (luminance + _GhostColorBoost); + col = lerp(col, ghostResult, _GhostBlend); + #endif + //------------------------------------ + + //INNEROUTLINE_ON + #if INNEROUTLINE_ON + half3 innerT = abs(GetPixel(0, _InnerOutlineThickness, d.texcoord0.xy, _MainTex, sampler_MainTex) - GetPixel(0, -_InnerOutlineThickness, d.texcoord0.xy, _MainTex, sampler_MainTex)); + innerT += abs(GetPixel(_InnerOutlineThickness, 0, d.texcoord0.xy, _MainTex, sampler_MainTex) - GetPixel(-_InnerOutlineThickness, 0, d.texcoord0.xy, _MainTex, sampler_MainTex)); + #if !ONLYINNEROUTLINE_ON + innerT = (innerT / 2.0) * col.a * _InnerOutlineAlpha; + col.rgb += length(innerT) * _InnerOutlineColor.rgb * _InnerOutlineGlow; + #else + innerT *= col.a * _InnerOutlineAlpha; + col.rgb = length(innerT) * _InnerOutlineColor.rgb * _InnerOutlineGlow; + col.a = step(0.3, col.r+col.g+col.b); + #endif + #endif + //------------------------------------------------------- + + //HITEFFECT_ON + #if HITEFFECT_ON + col.rgb = lerp(col.rgb, _HitEffectColor.rgb * _HitEffectGlow, _HitEffectBlend); + #endif + //-------------------- + + //GRADIENT_ON + #if GRADIENT_ON + half2 tiledUvGrad = half2(uvRect.x / _MainTex_ST.x, uvRect.y / _MainTex_ST.y); + #if GRADIENT2COL_ON + _GradTopRightCol = _GradTopLeftCol; + _GradBotRightCol = _GradBotLeftCol; + #endif + #if RADIALGRADIENT_ON + half radialDist = 1 - length(tiledUvGrad - half2(0.5, 0.5)); + radialDist *= (_MainTex_TexelSize.w / _MainTex_TexelSize.z); + radialDist = saturate(_GradBoostX * radialDist); + half4 gradientResult = lerp(_GradTopLeftCol, _GradBotLeftCol, radialDist); + #else + half gradXLerpFactor = saturate(pow(tiledUvGrad.x, _GradBoostX)); + half4 gradientResult = lerp(lerp(_GradBotLeftCol, _GradBotRightCol, gradXLerpFactor), + lerp(_GradTopLeftCol, _GradTopRightCol, gradXLerpFactor), saturate(pow(tiledUvGrad.y, _GradBoostY))); + #endif + gradientResult = lerp(col, gradientResult, _GradBlend); + col.rgb = gradientResult.rgb * col.a; + col.a *= gradientResult.a; + #endif + //-------------------------------------------------------------------- + + //CONTRAST_ON + #if CONTRAST_ON + col.rgb = (col.rgb - float3(0.5, 0.5, 0.5)) * _Contrast + float3(0.5, 0.5, 0.5); + col.rgb += _Brightness; + #endif + + //------------------------------------------------------------------- + + //COLORSWAP_ON + #if COLORSWAP_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + half4 swapMask = SAMPLE_TEXTURE2D(_ColorSwapTex, sampler_ColorSwapTex, d.texcoord0.xy); + swapMask.rgb *= swapMask.a; + half3 redSwap = _ColorSwapRed * swapMask.r * saturate(luminance + _ColorSwapRedLuminosity); + half3 greenSwap = _ColorSwapGreen * swapMask.g * saturate(luminance + _ColorSwapGreenLuminosity); + half3 blueSwap = _ColorSwapBlue * swapMask.b * saturate(luminance + _ColorSwapBlueLuminosity); + swapMask.rgb = col.rgb * saturate(1 - swapMask.r - swapMask.g - swapMask.b); + col.rgb = lerp(col.rgb, swapMask.rgb + redSwap + greenSwap + blueSwap, _ColorSwapBlend); + #endif + //-------------------------------------------------------------------- + + //COLORRAMP_ON && !COLORRAMPOUTLINE_ON + #if COLORRAMP_ON && !COLORRAMPOUTLINE_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + luminance = saturate(luminance + _ColorRampLuminosity); + #if GRADIENTCOLORRAMP_ON + col.rgb = lerp(col.rgb, SAMPLE_TEXTURE2D(_ColorRampTexGradient, sampler_ColorRampTexGradient, half2(luminance, 0)).rgb, _ColorRampBlend); + #else + col.rgb = lerp(col.rgb, SAMPLE_TEXTURE2D(_ColorRampTex, sampler_ColorRampTex, half2(luminance, 0)).rgb, _ColorRampBlend); + #endif + #endif + //-------------------------------------------------------------------- + + //CHANGECOLOR_ON + #if CHANGECOLOR_ON + float3 currChangeColor = saturate(col.rgb); + luminance = 0.3 * currChangeColor.r + 0.59 * currChangeColor.g + 0.11 * currChangeColor.b; + luminance = saturate(luminance + _ColorChangeLuminosity); + half3 dif = abs(currChangeColor - _ColorChangeTarget.rgb); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _ColorChangeNewCol.rgb, + max(sign(1 - saturate(dif.x + dif.y + dif.z) - _ColorChangeTolerance), 0.0)); + #if CHANGECOLOR2_ON + dif = abs(currChangeColor - _ColorChangeTarget2.rgb); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _ColorChangeNewCol2.rgb, + max(sign(1 - saturate(dif.x + dif.y + dif.z) - _ColorChangeTolerance2), 0.0)); + #endif + #if CHANGECOLOR3_ON + dif = abs(currChangeColor - _ColorChangeTarget3.rgb); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _ColorChangeNewCol3.rgb, + max(sign(1 - saturate(dif.x + dif.y + dif.z) - _ColorChangeTolerance3), 0.0)); + #endif + #endif + //------------------------------------------------------- + + //POSTERIZE_ON && !POSTERIZEOUTLINE_ON + #if POSTERIZE_ON && !POSTERIZEOUTLINE_ON + col.rgb = pow(col.rgb, _PosterizeGamma) * _PosterizeNumColors; + col.rgb = floor(col.rgb) / _PosterizeNumColors; + col.rgb = pow(col.rgb, 1.0 / _PosterizeGamma); + #endif + //------------------------------------ + + //HSV_ON + #if HSV_ON + half3 resultHsv = half3(col.rgb); + half cosHsv = _HsvBright * _HsvSaturation * cos(_HsvShift * 3.14159265 / 180); + half sinHsv = _HsvBright * _HsvSaturation * sin(_HsvShift * 3.14159265 / 180); + resultHsv.x = (.299 * _HsvBright + .701 * cosHsv + .168 * sinHsv) * col.x + + (.587 * _HsvBright - .587 * cosHsv + .330 * sinHsv) * col.y + + (.114 * _HsvBright - .114 * cosHsv - .497 * sinHsv) * col.z; + resultHsv.y = (.299 * _HsvBright - .299 * cosHsv - .328 * sinHsv) *col.x + + (.587 * _HsvBright + .413 * cosHsv + .035 * sinHsv) * col.y + + (.114 * _HsvBright - .114 * cosHsv + .292 * sinHsv) * col.z; + resultHsv.z = (.299 * _HsvBright - .3 * cosHsv + 1.25 * sinHsv) * col.x + + (.587 * _HsvBright - .588 * cosHsv - 1.05 * sinHsv) * col.y + + (.114 * _HsvBright + .886 * cosHsv - .203 * sinHsv) * col.z; + col.rgb = resultHsv; + #endif + //------------------------------------------------------- + + //OVERLAY_ON + #if OVERLAY_ON + half2 overlayUvs = d.texcoord0.xy; + overlayUvs.x += ((_Time.y + randomSeed) * _OverlayTextureScrollXSpeed) % 1; + overlayUvs.y += ((_Time.y + randomSeed) * _OverlayTextureScrollYSpeed) % 1; + half4 overlayCol = SAMPLE_TEXTURE2D(_OverlayTex, sampler_OverlayTex, TRANSFORM_TEX(overlayUvs, _OverlayTex)); + overlayCol.rgb *= _OverlayColor.rgb * _OverlayGlow; + #if !OVERLAYMULT_ON + overlayCol.rgb *= overlayCol.a * _OverlayColor.rgb * _OverlayColor.a * _OverlayBlend; + col.rgb += overlayCol.rgb; + #else + overlayCol.a *= _OverlayColor.a; + col = lerp(col, col * overlayCol, _OverlayBlend); + #endif + #endif + + //--------------------------------- + + //OUTBASE_ON + #if OUTBASE_ON + #if OUTBASEPIXELPERF_ON + half2 destUv = half2(_OutlinePixelWidth * _MainTex_TexelSize.x, _OutlinePixelWidth * _MainTex_TexelSize.y); + #else + half2 destUv = half2(_OutlineWidth * _MainTex_TexelSize.x * 200, _OutlineWidth * _MainTex_TexelSize.y * 200); + #endif + + #if OUTDIST_ON + d.texcoord3.x += ((_Time.x + _RandomSeed) * _OutlineDistortTexXSpeed) % 1; + d.texcoord3.y += ((_Time.x + _RandomSeed) * _OutlineDistortTexYSpeed) % 1; + #if ATLAS_ON + d.texcoord3 = half2((d.texcoord3.x - _MinXUV) / (_MaxXUV - _MinXUV), (d.texcoord3.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half outDistortAmnt = (SAMPLE_TEXTURE2D(_OutlineDistortTex, sampler_OutlineDistortTex, d.texcoord3).r - 0.5) * 0.2 * _OutlineDistortAmount; + destUv.x += outDistortAmnt; + destUv.y += outDistortAmnt; + #endif + + half spriteLeft = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(destUv.x, 0)).a; + half spriteRight = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy - half2(destUv.x, 0)).a; + half spriteBottom = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(0, destUv.y)).a; + half spriteTop = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy - half2(0, destUv.y)).a; + half result = spriteLeft + spriteRight + spriteBottom + spriteTop; + + #if OUTBASE8DIR_ON + half spriteTopLeft = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(destUv.x, destUv.y)).a; + half spriteTopRight = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(-destUv.x, destUv.y)).a; + half spriteBotLeft = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(destUv.x, -destUv.y)).a; + half spriteBotRight = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(-destUv.x, -destUv.y)).a; + result = result + spriteTopLeft + spriteTopRight + spriteBotLeft + spriteBotRight; + #endif + + result = step(0.05, saturate(result)); + + #if OUTTEX_ON + d.texcoord1.x += ((_Time.x + _RandomSeed) * _OutlineTexXSpeed) % 1; + d.texcoord1.y += ((_Time.x + _RandomSeed) * _OutlineTexYSpeed) % 1; + #if ATLAS_ON + d.texcoord1 = half2((d.texcoord1.x - _MinXUV) / (_MaxXUV - _MinXUV), (d.texcoord1.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half4 tempOutColor = SAMPLE_TEXTURE2D(_OutlineTex, sampler_OutlineTex, d.texcoord1); + tempOutColor *= _OutlineColor; + _OutlineColor = tempOutColor; + #endif + + result *= (1 - originalAlpha) * _OutlineAlpha; + + half4 outline = _OutlineColor * d.vertexColor.a; + outline.rgb *= _OutlineGlow; + outline.a = result; + #if ONLYOUTLINE_ON + col = outline; + #else + col = lerp(col, outline, result); + #endif + #endif + //------------------------------------------------------- + + //FADE_ON + #if FADE_ON + half2 tiledUvFade1 = TRANSFORM_TEX(d.texcoord0, _FadeTex); + half2 tiledUvFade2 = TRANSFORM_TEX(d.texcoord0, _FadeBurnTex); + #if ATLAS_ON + tiledUvFade1 = half2((tiledUvFade1.x - _MinXUV) / (_MaxXUV - _MinXUV), (tiledUvFade1.y - _MinYUV) / (_MaxYUV - _MinYUV)); + tiledUvFade2 = half2((tiledUvFade2.x - _MinXUV) / (_MaxXUV - _MinXUV), (tiledUvFade2.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half fadeTemp = SAMPLE_TEXTURE2D(_FadeTex, sampler_FadeTex, tiledUvFade1).r; + half fade = smoothstep(_FadeAmount, _FadeAmount + _FadeBurnTransition, fadeTemp); + half fadeBurn = saturate(smoothstep(_FadeAmount - _FadeBurnWidth, _FadeAmount - _FadeBurnWidth + 0.1, fadeTemp) * _FadeAmount); + col.a *= fade; + _FadeBurnColor.rgb *= _FadeBurnGlow; + col += fadeBurn * SAMPLE_TEXTURE2D(_FadeBurnTex, sampler_FadeBurnTex, tiledUvFade2) * _FadeBurnColor * originalAlpha * (1 - col.a); + #endif + //------------------------------------------------------- + + //SHADOW_ON + #if SHADOW_ON + half shadowA = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(_ShadowX, _ShadowY)).a; + half preMultShadowMask = 1 - (saturate(shadowA - col.a) * (1 - col.a)); + col.rgb *= 1 - ((shadowA - col.a) * (1 - col.a)); + col.rgb += (_ShadowColor * shadowA) * (1 - col.a); + col.a = max(shadowA * _ShadowAlpha * d.vertexColor.a, col.a); + #endif + + //------------------------------------------------------- + + //GLOW_ON + #if GLOW_ON + half4 emission; + #if GLOWTEX_ON + emission = SAMPLE_TEXTURE2D(_GlowTex, sampler_GlowTex, d.texcoord0); + #else + emission = col; + #endif + + col.rgb *= _GlowGlobal; + emission.rgb *= emission.a * col.a * _Glow * _GlowColor; + col.rgb += emission.rgb; + #endif + //------------------------------------------------------- + + //COLORRAMP_ON && COLORRAMPOUTLINE_ON + #if COLORRAMP_ON && COLORRAMPOUTLINE_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + luminance = saturate(luminance + _ColorRampLuminosity); + #if GRADIENTCOLORRAMP_ON + col.rgb = lerp(col.rgb, SAMPLE_TEXTURE2D(_ColorRampTexGradient, sampler_ColorRampTexGradient, half2(luminance, 0)).rgb, _ColorRampBlend); + #else + col.rgb = lerp(col.rgb, SAMPLE_TEXTURE2D(_ColorRampTex, sampler_ColorRampTex, half2(luminance, 0)).rgb, _ColorRampBlend); + #endif + #endif + //--------------- + + //GREYSCALE_ON && GREYSCALEOUTLINE_ON + #if GREYSCALE_ON && GREYSCALEOUTLINE_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + luminance = saturate(luminance + _GreyscaleLuminosity); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _GreyscaleTintColor, _GreyscaleBlend); + #endif + + //----------------------------------- + + //POSTERIZE_ON && POSTERIZEOUTLINE_ON + #if POSTERIZE_ON && POSTERIZEOUTLINE_ON + col.rgb = pow(col.rgb, _PosterizeGamma) * _PosterizeNumColors; + col.rgb = floor(col.rgb) / _PosterizeNumColors; + col.rgb = pow(col.rgb, 1.0 / _PosterizeGamma); + #endif + + //----------------------------------- + + //SHINE_ON + #if SHINE_ON + half2 uvShine = uvRect; + half cosAngle = cos(_ShineRotate); + half sinAngle = sin(_ShineRotate); + half2x2 rot = half2x2(cosAngle, -sinAngle, sinAngle, cosAngle); + uvShine -= half2(0.5, 0.5); + uvShine = mul(rot, uvShine); + uvShine += half2(0.5, 0.5); + half shineMask = SAMPLE_TEXTURE2D(_ShineMask, sampler_ShineMask, d.texcoord0.xy).a; + half currentDistanceProjection = (uvShine.x + uvShine.y) / 2; + half whitePower = 1 - (abs(currentDistanceProjection - _ShineLocation) / _ShineWidth); + col.rgb += col.a * whitePower * _ShineGlow * max(sign(currentDistanceProjection - (_ShineLocation - _ShineWidth)), 0.0) + * max(sign((_ShineLocation + _ShineWidth) - currentDistanceProjection), 0.0) * _ShineColor * shineMask; + #endif + + //----------------------------------- + + //HOLOGRAM_ON + #if HOLOGRAM_ON + half totalHologram = _HologramStripesAmount + _HologramUnmodAmount; + half hologramYCoord = ((uvRect.y + (((_Time.x + randomSeed) % 1) * _HologramStripesSpeed)) % totalHologram) / totalHologram; + hologramYCoord = abs(hologramYCoord); + half alpha = RemapFloat(saturate(hologramYCoord - (_HologramUnmodAmount/totalHologram)), 0.0, 1.0, _HologramMinAlpha, saturate(_HologramMaxAlpha)); + half hologramMask = max(sign((_HologramUnmodAmount/totalHologram) - hologramYCoord), 0.0); + half4 hologramResult = col; + hologramResult.a *= lerp(alpha, 1, hologramMask); + hologramResult.rgb *= max(1, _HologramMaxAlpha * max(sign(hologramYCoord - (_HologramUnmodAmount/totalHologram)), 0.0)); + hologramMask = 1 - step(0.01,hologramMask); + hologramResult.rgb += hologramMask * _HologramStripeColor * col.a; + col = lerp(col, hologramResult, _HologramBlend); + #endif + + //----------------------------------- + + //FLICKER_ON + #if FLICKER_ON + col.a *= saturate(col.a * step(frac(0.05 + (_Time.w + randomSeed) * _FlickerFreq), 1 - _FlickerPercent) + _FlickerAlpha); + #endif + //----------------------------------- + + //ALPHACUTOFF_ON + + //ALPHAROUND_ON + + //ALPHAOUTLINE_ON + #if ALPHAOUTLINE_ON + half alphaOutlineRes = pow(1 - col.a, max(_AlphaOutlinePower, 0.0001)) * step(_AlphaOutlineMinAlpha, col.a) * _AlphaOutlineBlend; + col.rgb = lerp(col.rgb, _AlphaOutlineColor.rgb * _AlphaOutlineGlow, alphaOutlineRes); + col.a = lerp(col.a, 1, alphaOutlineRes > 1); + #endif + //------------------------------------------------------- + + //FOG_ON + + //------------------ + + col *= _Color; + o.Albedo = col; + col.a *= _Alpha; + clip(col.a - _AlphaCutoffValue - 0.01); + o.Alpha = _Color.a; + } + + + + + + void ChainSurfaceFunction(inout Surface l, inout ShaderData d) + { + Ext_SurfaceFunction0(l, d); + // Ext_SurfaceFunction1(l, d); + // Ext_SurfaceFunction2(l, d); + // Ext_SurfaceFunction3(l, d); + // Ext_SurfaceFunction4(l, d); + // Ext_SurfaceFunction5(l, d); + // Ext_SurfaceFunction6(l, d); + // Ext_SurfaceFunction7(l, d); + // Ext_SurfaceFunction8(l, d); + // Ext_SurfaceFunction9(l, d); + // Ext_SurfaceFunction10(l, d); + // Ext_SurfaceFunction11(l, d); + // Ext_SurfaceFunction12(l, d); + // Ext_SurfaceFunction13(l, d); + // Ext_SurfaceFunction14(l, d); + // Ext_SurfaceFunction15(l, d); + // Ext_SurfaceFunction16(l, d); + // Ext_SurfaceFunction17(l, d); + // Ext_SurfaceFunction18(l, d); + // Ext_SurfaceFunction19(l, d); + // Ext_SurfaceFunction20(l, d); + // Ext_SurfaceFunction21(l, d); + // Ext_SurfaceFunction22(l, d); + // Ext_SurfaceFunction23(l, d); + // Ext_SurfaceFunction24(l, d); + // Ext_SurfaceFunction25(l, d); + // Ext_SurfaceFunction26(l, d); + // Ext_SurfaceFunction27(l, d); + // Ext_SurfaceFunction28(l, d); + // Ext_SurfaceFunction29(l, d); + } + +#if !_DECALSHADER + + void ChainModifyVertex(inout VertexData v, inout VertexToPixel v2p, float4 time) + { + ExtraV2F d; + + ZERO_INITIALIZE(ExtraV2F, d); + ZERO_INITIALIZE(Blackboard, d.blackboard); + // due to motion vectors in HDRP, we need to use the last + // time in certain spots. So if you are going to use _Time to adjust vertices, + // you need to use this time or motion vectors will break. + d.time = time; + + Ext_ModifyVertex0(v, d); + // Ext_ModifyVertex1(v, d); + // Ext_ModifyVertex2(v, d); + // Ext_ModifyVertex3(v, d); + // Ext_ModifyVertex4(v, d); + // Ext_ModifyVertex5(v, d); + // Ext_ModifyVertex6(v, d); + // Ext_ModifyVertex7(v, d); + // Ext_ModifyVertex8(v, d); + // Ext_ModifyVertex9(v, d); + // Ext_ModifyVertex10(v, d); + // Ext_ModifyVertex11(v, d); + // Ext_ModifyVertex12(v, d); + // Ext_ModifyVertex13(v, d); + // Ext_ModifyVertex14(v, d); + // Ext_ModifyVertex15(v, d); + // Ext_ModifyVertex16(v, d); + // Ext_ModifyVertex17(v, d); + // Ext_ModifyVertex18(v, d); + // Ext_ModifyVertex19(v, d); + // Ext_ModifyVertex20(v, d); + // Ext_ModifyVertex21(v, d); + // Ext_ModifyVertex22(v, d); + // Ext_ModifyVertex23(v, d); + // Ext_ModifyVertex24(v, d); + // Ext_ModifyVertex25(v, d); + // Ext_ModifyVertex26(v, d); + // Ext_ModifyVertex27(v, d); + // Ext_ModifyVertex28(v, d); + // Ext_ModifyVertex29(v, d); + + + // #if %EXTRAV2F0REQUIREKEY% + // v2p.extraV2F0 = d.extraV2F0; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // v2p.extraV2F1 = d.extraV2F1; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // v2p.extraV2F2 = d.extraV2F2; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // v2p.extraV2F3 = d.extraV2F3; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // v2p.extraV2F4 = d.extraV2F4; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // v2p.extraV2F5 = d.extraV2F5; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // v2p.extraV2F6 = d.extraV2F6; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // v2p.extraV2F7 = d.extraV2F7; + // #endif + } + + void ChainModifyTessellatedVertex(inout VertexData v, inout VertexToPixel v2p) + { + ExtraV2F d; + ZERO_INITIALIZE(ExtraV2F, d); + ZERO_INITIALIZE(Blackboard, d.blackboard); + + // #if %EXTRAV2F0REQUIREKEY% + // d.extraV2F0 = v2p.extraV2F0; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // d.extraV2F1 = v2p.extraV2F1; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // d.extraV2F2 = v2p.extraV2F2; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // d.extraV2F3 = v2p.extraV2F3; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // d.extraV2F4 = v2p.extraV2F4; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // d.extraV2F5 = v2p.extraV2F5; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // d.extraV2F6 = v2p.extraV2F6; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // d.extraV2F7 = v2p.extraV2F7; + // #endif + + + // Ext_ModifyTessellatedVertex0(v, d); + // Ext_ModifyTessellatedVertex1(v, d); + // Ext_ModifyTessellatedVertex2(v, d); + // Ext_ModifyTessellatedVertex3(v, d); + // Ext_ModifyTessellatedVertex4(v, d); + // Ext_ModifyTessellatedVertex5(v, d); + // Ext_ModifyTessellatedVertex6(v, d); + // Ext_ModifyTessellatedVertex7(v, d); + // Ext_ModifyTessellatedVertex8(v, d); + // Ext_ModifyTessellatedVertex9(v, d); + // Ext_ModifyTessellatedVertex10(v, d); + // Ext_ModifyTessellatedVertex11(v, d); + // Ext_ModifyTessellatedVertex12(v, d); + // Ext_ModifyTessellatedVertex13(v, d); + // Ext_ModifyTessellatedVertex14(v, d); + // Ext_ModifyTessellatedVertex15(v, d); + // Ext_ModifyTessellatedVertex16(v, d); + // Ext_ModifyTessellatedVertex17(v, d); + // Ext_ModifyTessellatedVertex18(v, d); + // Ext_ModifyTessellatedVertex19(v, d); + // Ext_ModifyTessellatedVertex20(v, d); + // Ext_ModifyTessellatedVertex21(v, d); + // Ext_ModifyTessellatedVertex22(v, d); + // Ext_ModifyTessellatedVertex23(v, d); + // Ext_ModifyTessellatedVertex24(v, d); + // Ext_ModifyTessellatedVertex25(v, d); + // Ext_ModifyTessellatedVertex26(v, d); + // Ext_ModifyTessellatedVertex27(v, d); + // Ext_ModifyTessellatedVertex28(v, d); + // Ext_ModifyTessellatedVertex29(v, d); + + // #if %EXTRAV2F0REQUIREKEY% + // v2p.extraV2F0 = d.extraV2F0; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // v2p.extraV2F1 = d.extraV2F1; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // v2p.extraV2F2 = d.extraV2F2; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // v2p.extraV2F3 = d.extraV2F3; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // v2p.extraV2F4 = d.extraV2F4; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // v2p.extraV2F5 = d.extraV2F5; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // v2p.extraV2F6 = d.extraV2F6; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // v2p.extraV2F7 = d.extraV2F7; + // #endif + } + + void ChainFinalColorForward(inout Surface l, inout ShaderData d, inout half4 color) + { + // Ext_FinalColorForward0(l, d, color); + // Ext_FinalColorForward1(l, d, color); + // Ext_FinalColorForward2(l, d, color); + // Ext_FinalColorForward3(l, d, color); + // Ext_FinalColorForward4(l, d, color); + // Ext_FinalColorForward5(l, d, color); + // Ext_FinalColorForward6(l, d, color); + // Ext_FinalColorForward7(l, d, color); + // Ext_FinalColorForward8(l, d, color); + // Ext_FinalColorForward9(l, d, color); + // Ext_FinalColorForward10(l, d, color); + // Ext_FinalColorForward11(l, d, color); + // Ext_FinalColorForward12(l, d, color); + // Ext_FinalColorForward13(l, d, color); + // Ext_FinalColorForward14(l, d, color); + // Ext_FinalColorForward15(l, d, color); + // Ext_FinalColorForward16(l, d, color); + // Ext_FinalColorForward17(l, d, color); + // Ext_FinalColorForward18(l, d, color); + // Ext_FinalColorForward19(l, d, color); + // Ext_FinalColorForward20(l, d, color); + // Ext_FinalColorForward21(l, d, color); + // Ext_FinalColorForward22(l, d, color); + // Ext_FinalColorForward23(l, d, color); + // Ext_FinalColorForward24(l, d, color); + // Ext_FinalColorForward25(l, d, color); + // Ext_FinalColorForward26(l, d, color); + // Ext_FinalColorForward27(l, d, color); + // Ext_FinalColorForward28(l, d, color); + // Ext_FinalColorForward29(l, d, color); + } + + void ChainFinalGBufferStandard(inout Surface s, inout ShaderData d, inout half4 GBuffer0, inout half4 GBuffer1, inout half4 GBuffer2, inout half4 outEmission, inout half4 outShadowMask) + { + // Ext_FinalGBufferStandard0(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard1(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard2(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard3(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard4(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard5(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard6(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard7(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard8(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard9(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard10(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard11(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard12(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard13(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard14(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard15(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard16(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard17(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard18(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard19(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard20(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard21(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard22(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard23(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard24(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard25(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard26(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard27(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard28(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard29(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + } +#endif + + + + + +#if _DECALSHADER + + ShaderData CreateShaderData(SurfaceDescriptionInputs IN) + { + ShaderData d = (ShaderData)0; + d.TBNMatrix = float3x3(IN.WorldSpaceTangent, IN.WorldSpaceBiTangent, IN.WorldSpaceNormal); + d.worldSpaceNormal = IN.WorldSpaceNormal; + d.worldSpaceTangent = IN.WorldSpaceTangent; + + d.worldSpacePosition = IN.WorldSpacePosition; + d.texcoord0 = IN.uv0.xyxy; + d.screenPos = IN.ScreenPosition; + + d.worldSpaceViewDir = normalize(_WorldSpaceCameraPos - d.worldSpacePosition); + + d.tangentSpaceViewDir = mul(d.TBNMatrix, d.worldSpaceViewDir); + + // these rarely get used, so we back transform them. Usually will be stripped. + #if _HDRP + // d.localSpacePosition = mul(GetWorldToObjectMatrix(), float4(GetCameraRelativePositionWS(d.worldSpacePosition), 1)).xyz; + #else + // d.localSpacePosition = mul(GetWorldToObjectMatrix(), float4(d.worldSpacePosition, 1)).xyz; + #endif + // d.localSpaceNormal = normalize(mul((float3x3)GetWorldToObjectMatrix(), d.worldSpaceNormal)); + // d.localSpaceTangent = normalize(mul((float3x3)GetWorldToObjectMatrix(), d.worldSpaceTangent.xyz)); + + // #if %SCREENPOSREQUIREKEY% + // d.screenUV = (IN.ScreenPosition.xy / max(0.01, IN.ScreenPosition.w)); + // #endif + + return d; + } +#else + + ShaderData CreateShaderData(VertexToPixel i + #if NEED_FACING + , bool facing + #endif + ) + { + ShaderData d = (ShaderData)0; + d.clipPos = i.pos; + d.worldSpacePosition = i.worldPos; + + d.worldSpaceNormal = normalize(i.worldNormal); + d.worldSpaceTangent.xyz = normalize(i.worldTangent.xyz); + + d.tangentSign = i.worldTangent.w * unity_WorldTransformParams.w; + float3 bitangent = cross(d.worldSpaceTangent.xyz, d.worldSpaceNormal) * d.tangentSign; + + d.TBNMatrix = float3x3(d.worldSpaceTangent, -bitangent, d.worldSpaceNormal); + d.worldSpaceViewDir = normalize(_WorldSpaceCameraPos - i.worldPos); + + d.tangentSpaceViewDir = mul(d.TBNMatrix, d.worldSpaceViewDir); + d.texcoord0 = i.texcoord0; + d.texcoord1 = i.texcoord1; + d.texcoord2 = i.texcoord2; + + // #if %TEXCOORD3REQUIREKEY% + d.texcoord3 = i.texcoord3; + // #endif + + // d.isFrontFace = facing; + // #if %VERTEXCOLORREQUIREKEY% + d.vertexColor = i.vertexColor; + // #endif + + // these rarely get used, so we back transform them. Usually will be stripped. + #if _HDRP + // d.localSpacePosition = mul(GetWorldToObjectMatrix(), float4(GetCameraRelativePositionWS(i.worldPos), 1)).xyz; + #else + // d.localSpacePosition = mul(GetWorldToObjectMatrix(), float4(i.worldPos, 1)).xyz; + #endif + // d.localSpaceNormal = normalize(mul((float3x3)GetWorldToObjectMatrix(), i.worldNormal)); + // d.localSpaceTangent = normalize(mul((float3x3)GetWorldToObjectMatrix(), i.worldTangent.xyz)); + + // #if %SCREENPOSREQUIREKEY% + // d.screenPos = i.screenPos; + // d.screenUV = (i.screenPos.xy / i.screenPos.w); + // #endif + + + // #if %EXTRAV2F0REQUIREKEY% + // d.extraV2F0 = i.extraV2F0; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // d.extraV2F1 = i.extraV2F1; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // d.extraV2F2 = i.extraV2F2; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // d.extraV2F3 = i.extraV2F3; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // d.extraV2F4 = i.extraV2F4; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // d.extraV2F5 = i.extraV2F5; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // d.extraV2F6 = i.extraV2F6; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // d.extraV2F7 = i.extraV2F7; + // #endif + + return d; + } + +#endif + + + +struct VaryingsToPS +{ + VertexToPixel vmesh; + #ifdef VARYINGS_NEED_PASS + VaryingsPassToPS vpass; + #endif +}; + +struct PackedVaryingsToPS +{ + #ifdef VARYINGS_NEED_PASS + PackedVaryingsPassToPS vpass; + #endif + VertexToPixel vmesh; + + UNITY_VERTEX_OUTPUT_STEREO +}; + +PackedVaryingsToPS PackVaryingsToPS(VaryingsToPS input) +{ + PackedVaryingsToPS output = (PackedVaryingsToPS)0; + output.vmesh = input.vmesh; + #ifdef VARYINGS_NEED_PASS + output.vpass = PackVaryingsPassToPS(input.vpass); + #endif + + UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(output); + return output; +} + + + + +VertexToPixel VertMesh(VertexData input) +{ + VertexToPixel output = (VertexToPixel)0; + + UNITY_SETUP_INSTANCE_ID(input); + UNITY_TRANSFER_INSTANCE_ID(input, output); + + + ChainModifyVertex(input, output, _Time); + + + // This return the camera relative position (if enable) + float3 positionRWS = TransformObjectToWorld(input.vertex.xyz); + float3 normalWS = TransformObjectToWorldNormal(input.normal); + float4 tangentWS = float4(TransformObjectToWorldDir(input.tangent.xyz), input.tangent.w); + + + output.worldPos = GetAbsolutePositionWS(positionRWS); + output.pos = TransformWorldToHClip(positionRWS); + output.worldNormal = normalWS; + output.worldTangent = tangentWS; + + + output.texcoord0 = input.texcoord0; + output.texcoord1 = input.texcoord1; + output.texcoord2 = input.texcoord2; + // #if %TEXCOORD3REQUIREKEY% + output.texcoord3 = input.texcoord3; + // #endif + + // #if %SCREENPOSREQUIREKEY% + // output.screenPos = ComputeScreenPos(output.pos, _ProjectionParams.x); + // #endif + + // #if %VERTEXCOLORREQUIREKEY% + output.vertexColor = input.vertexColor; + // #endif + return output; +} + + +#if (SHADERPASS == SHADERPASS_DBUFFER_MESH) +void MeshDecalsPositionZBias(inout VaryingsToPS input) +{ +#if defined(UNITY_REVERSED_Z) + input.vmesh.pos.z -= _DecalMeshDepthBias; +#else + input.vmesh.pos.z += _DecalMeshDepthBias; +#endif +} +#endif + + +#if (SHADERPASS == SHADERPASS_LIGHT_TRANSPORT) + +// This was not in constant buffer in original unity, so keep outiside. But should be in as ShaderRenderPass frequency +float unity_OneOverOutputBoost; +float unity_MaxOutputValue; + +CBUFFER_START(UnityMetaPass) +// x = use uv1 as raster position +// y = use uv2 as raster position +bool4 unity_MetaVertexControl; + +// x = return albedo +// y = return normal +bool4 unity_MetaFragmentControl; +CBUFFER_END + +PackedVaryingsToPS Vert(VertexData inputMesh) +{ + VaryingsToPS output = (VaryingsToPS)0; + output.vmesh = (VertexToPixel)0; + + UNITY_SETUP_INSTANCE_ID(inputMesh); + UNITY_TRANSFER_INSTANCE_ID(inputMesh, output.vmesh); + + // Output UV coordinate in vertex shader + float2 uv = float2(0.0, 0.0); + + if (unity_MetaVertexControl.x) + { + uv = inputMesh.texcoord1.xy * unity_LightmapST.xy + unity_LightmapST.zw; + } + else if (unity_MetaVertexControl.y) + { + uv = inputMesh.texcoord2.xy * unity_DynamicLightmapST.xy + unity_DynamicLightmapST.zw; + } + + // OpenGL right now needs to actually use the incoming vertex position + // so we create a fake dependency on it here that haven't any impact. + output.vmesh.pos = float4(uv * 2.0 - 1.0, inputMesh.vertex.z > 0 ? 1.0e-4 : 0.0, 1.0); + +#ifdef VARYINGS_NEED_POSITION_WS + output.vmesh.worldPos = TransformObjectToWorld(inputMesh.vertex.xyz); +#endif + +#ifdef VARYINGS_NEED_TANGENT_TO_WORLD + // Normal is required for triplanar mapping + output.vmesh.worldNormal = TransformObjectToWorldNormal(inputMesh.normal); + // Not required but assign to silent compiler warning + output.vmesh.worldTangent = float4(1.0, 0.0, 0.0, 0.0); +#endif + + output.vmesh.texcoord0 = inputMesh.texcoord0; + output.vmesh.texcoord1 = inputMesh.texcoord1; + output.vmesh.texcoord2 = inputMesh.texcoord2; + // #if %TEXCOORD3REQUIREKEY% + output.vmesh.texcoord3 = inputMesh.texcoord3; + // #endif + + // #if %VERTEXCOLORREQUIREKEY% + output.vmesh.vertexColor = inputMesh.vertexColor; + // #endif + + return PackVaryingsToPS(output); +} +#else + +PackedVaryingsToPS Vert(VertexData inputMesh) +{ + VaryingsToPS varyingsType; + varyingsType.vmesh = VertMesh(inputMesh); + #if (SHADERPASS == SHADERPASS_DBUFFER_MESH) + MeshDecalsPositionZBias(varyingsType); + #endif + return PackVaryingsToPS(varyingsType); +} + +#endif + + + + + + + FragInputs BuildFragInputs(VertexToPixel input) + { + UNITY_SETUP_INSTANCE_ID(input); + FragInputs output; + ZERO_INITIALIZE(FragInputs, output); + + // Init to some default value to make the computer quiet (else it output 'divide by zero' warning even if value is not used). + // TODO: this is a really poor workaround, but the variable is used in a bunch of places + // to compute normals which are then passed on elsewhere to compute other values... + output.tangentToWorld = k_identity3x3; + output.positionSS = input.pos; // input.positionCS is SV_Position + + output.positionRWS = GetCameraRelativePositionWS(input.worldPos); + output.tangentToWorld = BuildTangentToWorld(input.worldTangent, input.worldNormal); + output.texCoord0 = input.texcoord0; + output.texCoord1 = input.texcoord1; + output.texCoord2 = input.texcoord2; + + return output; + } + + void BuildSurfaceData(FragInputs fragInputs, inout Surface surfaceDescription, float3 V, PositionInputs posInput, out SurfaceData surfaceData, out float3 bentNormalWS) + { + // setup defaults -- these are used if the graph doesn't output a value + ZERO_INITIALIZE(SurfaceData, surfaceData); + + // specularOcclusion need to be init ahead of decal to quiet the compiler that modify the SurfaceData struct + // however specularOcclusion can come from the graph, so need to be init here so it can be override. + surfaceData.specularOcclusion = 1.0; + + // copy across graph values, if defined + surfaceData.baseColor = surfaceDescription.Albedo; + surfaceData.perceptualSmoothness = surfaceDescription.Smoothness; + surfaceData.ambientOcclusion = surfaceDescription.Occlusion; + surfaceData.specularOcclusion = surfaceDescription.SpecularOcclusion; + surfaceData.metallic = surfaceDescription.Metallic; + surfaceData.subsurfaceMask = surfaceDescription.SubsurfaceMask; + surfaceData.thickness = surfaceDescription.Thickness; + surfaceData.diffusionProfileHash = asuint(surfaceDescription.DiffusionProfileHash); + #if _USESPECULAR + surfaceData.specularColor = surfaceDescription.Specular; + #endif + surfaceData.coatMask = surfaceDescription.CoatMask; + surfaceData.anisotropy = surfaceDescription.Anisotropy; + surfaceData.iridescenceMask = surfaceDescription.IridescenceMask; + surfaceData.iridescenceThickness = surfaceDescription.IridescenceThickness; + + #ifdef _HAS_REFRACTION + if (_EnableSSRefraction) + { + // surfaceData.ior = surfaceDescription.RefractionIndex; + // surfaceData.transmittanceColor = surfaceDescription.RefractionColor; + // surfaceData.atDistance = surfaceDescription.RefractionDistance; + + surfaceData.transmittanceMask = (1.0 - surfaceDescription.Alpha); + surfaceDescription.Alpha = 1.0; + } + else + { + surfaceData.ior = surfaceDescription.ior; + surfaceData.transmittanceColor = surfaceDescription.transmittanceColor; + surfaceData.atDistance = surfaceDescription.atDistance; + surfaceData.transmittanceMask = surfaceDescription.transmittanceMask; + surfaceDescription.Alpha = 1.0; + } + #else + surfaceData.ior = 1.0; + surfaceData.transmittanceColor = float3(1.0, 1.0, 1.0); + surfaceData.atDistance = 1.0; + surfaceData.transmittanceMask = 0.0; + #endif + + // These static material feature allow compile time optimization + surfaceData.materialFeatures = MATERIALFEATUREFLAGS_LIT_STANDARD; + #ifdef _MATERIAL_FEATURE_SUBSURFACE_SCATTERING + surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_SUBSURFACE_SCATTERING; + #endif + #ifdef _MATERIAL_FEATURE_TRANSMISSION + surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_TRANSMISSION; + #endif + #ifdef _MATERIAL_FEATURE_ANISOTROPY + surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_ANISOTROPY; + #endif + // surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_CLEAR_COAT; + + #ifdef _MATERIAL_FEATURE_IRIDESCENCE + surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_IRIDESCENCE; + #endif + #ifdef _MATERIAL_FEATURE_SPECULAR_COLOR + surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_SPECULAR_COLOR; + #endif + + #if defined (_MATERIAL_FEATURE_SPECULAR_COLOR) && defined (_ENERGY_CONSERVING_SPECULAR) + // Require to have setup baseColor + // Reproduce the energy conservation done in legacy Unity. Not ideal but better for compatibility and users can unchek it + surfaceData.baseColor *= (1.0 - Max3(surfaceData.specularColor.r, surfaceData.specularColor.g, surfaceData.specularColor.b)); + #endif + + + // tangent-space normal + float3 normalTS = float3(0.0f, 0.0f, 1.0f); + normalTS = surfaceDescription.Normal; + + // compute world space normal + #if !_WORLDSPACENORMAL + surfaceData.normalWS = mul(normalTS, fragInputs.tangentToWorld); + #else + surfaceData.normalWS = normalTS; + #endif + surfaceData.geomNormalWS = fragInputs.tangentToWorld[2]; + + surfaceData.tangentWS = normalize(fragInputs.tangentToWorld[0].xyz); // The tangent is not normalize in tangentToWorld for mikkt. TODO: Check if it expected that we normalize with Morten. Tag: SURFACE_GRADIENT + // surfaceData.tangentWS = TransformTangentToWorld(surfaceDescription.Tangent, fragInputs.tangentToWorld); + + #if HAVE_DECALS + if (_EnableDecals) + { + #if VERSION_GREATER_EQUAL(10,2) + DecalSurfaceData decalSurfaceData = GetDecalSurfaceData(posInput, surfaceData.geomNormalWS, surfaceDescription.Alpha); + ApplyDecalToSurfaceData(decalSurfaceData, surfaceData.geomNormalWS, surfaceData); + #else + DecalSurfaceData decalSurfaceData = GetDecalSurfaceData(posInput, surfaceDescription.Alpha); + ApplyDecalToSurfaceData(decalSurfaceData, surfaceData); + #endif + } + #endif + + bentNormalWS = surfaceData.normalWS; + + surfaceData.tangentWS = Orthonormalize(surfaceData.tangentWS, surfaceData.normalWS); + + + // By default we use the ambient occlusion with Tri-ace trick (apply outside) for specular occlusion. + // If user provide bent normal then we process a better term + #if defined(_SPECULAR_OCCLUSION_CUSTOM) + // Just use the value passed through via the slot (not active otherwise) + #elif defined(_SPECULAR_OCCLUSION_FROM_AO_BENT_NORMAL) + // If we have bent normal and ambient occlusion, process a specular occlusion + surfaceData.specularOcclusion = GetSpecularOcclusionFromBentAO(V, bentNormalWS, surfaceData.normalWS, surfaceData.ambientOcclusion, PerceptualSmoothnessToPerceptualRoughness(surfaceData.perceptualSmoothness)); + #elif defined(_AMBIENT_OCCLUSION) && defined(_SPECULAR_OCCLUSION_FROM_AO) + surfaceData.specularOcclusion = GetSpecularOcclusionFromAmbientOcclusion(ClampNdotV(dot(surfaceData.normalWS, V)), surfaceData.ambientOcclusion, PerceptualSmoothnessToRoughness(surfaceData.perceptualSmoothness)); + #endif + + #ifdef _ENABLE_GEOMETRIC_SPECULAR_AA + surfaceData.perceptualSmoothness = GeometricNormalFiltering(surfaceData.perceptualSmoothness, fragInputs.tangentToWorld[2], surfaceDescription.SpecularAAScreenSpaceVariance, surfaceDescription.SpecularAAThreshold); + #endif + + #ifdef DEBUG_DISPLAY + if (_DebugMipMapMode != DEBUGMIPMAPMODE_NONE) + { + // TODO: need to update mip info + surfaceData.metallic = 0; + } + + // We need to call ApplyDebugToSurfaceData after filling the surfarcedata and before filling builtinData + // as it can modify attribute use for static lighting + ApplyDebugToSurfaceData(fragInputs.tangentToWorld, surfaceData); + #endif + } + + void GetSurfaceAndBuiltinData(VertexToPixel m2ps, FragInputs fragInputs, float3 V, inout PositionInputs posInput, + out SurfaceData surfaceData, out BuiltinData builtinData, inout Surface l, inout ShaderData d + #if NEED_FACING + , bool facing + #endif + ) + { + // Removed since crossfade does not work, probably needs extra material setup. + //#ifdef LOD_FADE_CROSSFADE // enable dithering LOD transition if user select CrossFade transition in LOD group + // uint3 fadeMaskSeed = asuint((int3)(V * _ScreenSize.xyx)); // Quantize V to _ScreenSize values + // LODDitheringTransition(fadeMaskSeed, unity_LODFade.x); + //#endif + + d = CreateShaderData(m2ps + #if NEED_FACING + , facing + #endif + ); + + + + l = (Surface)0; + + l.Albedo = half3(0.5, 0.5, 0.5); + l.Normal = float3(0,0,1); + l.Occlusion = 1; + l.Alpha = 1; + l.SpecularOcclusion = 1; + + #ifdef _DEPTHOFFSET_ON + l.outputDepth = posInput.deviceDepth; + #endif + + ChainSurfaceFunction(l, d); + + #ifdef _DEPTHOFFSET_ON + posInput.deviceDepth = l.outputDepth; + #endif + + #if _UNLIT + //l.Emission = l.Albedo; + //l.Albedo = 0; + l.Normal = half3(0,0,1); + l.Occlusion = 1; + l.Metallic = 0; + l.Specular = 0; + #endif + + surfaceData.geomNormalWS = d.worldSpaceNormal; + surfaceData.tangentWS = d.worldSpaceTangent; + fragInputs.tangentToWorld = d.TBNMatrix; + + float3 bentNormalWS; + BuildSurfaceData(fragInputs, l, V, posInput, surfaceData, bentNormalWS); + + InitBuiltinData(posInput, l.Alpha, bentNormalWS, -d.worldSpaceNormal, fragInputs.texCoord1, fragInputs.texCoord2, builtinData); + + + + builtinData.emissiveColor = l.Emission; + + #if defined(_OVERRIDE_BAKEDGI) + builtinData.bakeDiffuseLighting = l.DiffuseGI; + builtinData.backBakeDiffuseLighting = l.BackDiffuseGI; + builtinData.emissiveColor += l.SpecularGI; + #endif + + #if defined(_OVERRIDE_SHADOWMASK) + builtinData.shadowMask0 = l.ShadowMask.x; + builtinData.shadowMask1 = l.ShadowMask.y; + builtinData.shadowMask2 = l.ShadowMask.z; + builtinData.shadowMask3 = l.ShadowMask.w; + #endif + + #if (SHADERPASS == SHADERPASS_DISTORTION) + //builtinData.distortion = surfaceDescription.Distortion; + //builtinData.distortionBlur = surfaceDescription.DistortionBlur; + builtinData.distortion = float2(0.0, 0.0); + builtinData.distortionBlur = 0.0; + #else + builtinData.distortion = float2(0.0, 0.0); + builtinData.distortionBlur = 0.0; + #endif + + PostInitBuiltinData(V, posInput, surfaceData, builtinData); + } + + + float4 Frag(PackedVaryingsToPS packedInput + #if NEED_FACING + , bool facing : SV_IsFrontFace + #endif + + ) : SV_Target + { + FragInputs input = BuildFragInputs(packedInput.vmesh); + + // input.positionSS is SV_Position + PositionInputs posInput = GetPositionInput(input.positionSS.xy, _ScreenSize.zw, input.positionSS.z, input.positionSS.w, input.positionRWS); + + float3 V = GetWorldSpaceNormalizeViewDir(input.positionRWS); + + + SurfaceData surfaceData; + BuiltinData builtinData; + Surface l; + ShaderData d; + GetSurfaceAndBuiltinData(packedInput.vmesh, input, V, posInput, surfaceData, builtinData, l, d + #if NEED_FACING + , facing + #endif + ); + + // no debug apply during light transport pass + + BSDFData bsdfData = ConvertSurfaceDataToBSDFData(input.positionSS.xy, surfaceData); + LightTransportData lightTransportData = GetLightTransportData(surfaceData, builtinData, bsdfData); + + // This shader is call two times. Once for getting emissiveColor, the other time to get diffuseColor + // We use unity_MetaFragmentControl to make the distinction. + float4 res = float4(0.0, 0.0, 0.0, 1.0); + + if (unity_MetaFragmentControl.x) + { + // Apply diffuseColor Boost from LightmapSettings. + // put abs here to silent a warning, no cost, no impact as color is assume to be positive. + res.rgb = clamp(pow(abs(lightTransportData.diffuseColor), saturate(unity_OneOverOutputBoost)), 0, unity_MaxOutputValue); + } + + if (unity_MetaFragmentControl.y) + { + // emissive use HDR format + res.rgb = lightTransportData.emissiveColor; + } + + return res; + } + + + + ENDHLSL + } + + Pass + { + // based on HDLitPass.template + Name "SceneSelectionPass" + Tags { "LightMode" = "SceneSelectionPass" } + + ColorMask 0 + + Tags { "RenderType" = "Opaque" "Queue" = "Geometry" "PreviewType" = "Plane" } + Cull [_CullingOption] + ZWrite [_ZWrite] + ZTest [_ZTestMode] + + + HLSLPROGRAM + + #pragma target 4.5 + #pragma only_renderers d3d11 ps4 xboxone vulkan metal switch + //#pragma enable_d3d11_debug_symbols + + #pragma multi_compile_instancing + + //#pragma multi_compile_local _ _ALPHATEST_ON + + + //#pragma shader_feature _SURFACE_TYPE_TRANSPARENT + //#pragma shader_feature_local _ _BLENDMODE_ALPHA _BLENDMODE_ADD _BLENDMODE_PRE_MULTIPLY + + //------------------------------------------------------------------------------------- + // Variant Definitions (active field translations to HDRP defines) + //------------------------------------------------------------------------------------- + // #define _MATERIAL_FEATURE_SUBSURFACE_SCATTERING 1 + // #define _MATERIAL_FEATURE_TRANSMISSION 1 + // #define _MATERIAL_FEATURE_ANISOTROPY 1 + // #define _MATERIAL_FEATURE_IRIDESCENCE 1 + // #define _MATERIAL_FEATURE_SPECULAR_COLOR 1 + #define _ENABLE_FOG_ON_TRANSPARENT 1 + // #define _AMBIENT_OCCLUSION 1 + // #define _SPECULAR_OCCLUSION_FROM_AO 1 + // #define _SPECULAR_OCCLUSION_FROM_AO_BENT_NORMAL 1 + // #define _SPECULAR_OCCLUSION_CUSTOM 1 + // #define _ENERGY_CONSERVING_SPECULAR 1 + // #define _ENABLE_GEOMETRIC_SPECULAR_AA 1 + // #define _HAS_REFRACTION 1 + // #define _REFRACTION_PLANE 1 + // #define _REFRACTION_SPHERE 1 + // #define _DISABLE_DECALS 1 + // #define _DISABLE_SSR 1 + // #define _ADD_PRECOMPUTED_VELOCITY + // #define _WRITE_TRANSPARENT_MOTION_VECTOR 1 + // #define _DEPTHOFFSET_ON 1 + // #define _BLENDMODE_PRESERVE_SPECULAR_LIGHTING 1 + + #define SHADERPASS SHADERPASS_DEPTH_ONLY + #define SCENESELECTIONPASS + #pragma editor_sync_compilation + #define RAYTRACING_SHADER_GRAPH_HIGH + #define _PASSSCENESELECT 1 + + + #pragma shader_feature_local GLOW_ON + #pragma shader_feature_local FADE_ON + #pragma shader_feature_local OUTBASE_ON + #pragma shader_feature_local ONLYOUTLINE_ON + #pragma shader_feature_local GRADIENT_ON + #pragma shader_feature_local GRADIENT2COL_ON + #pragma shader_feature_local RADIALGRADIENT_ON + #pragma shader_feature_local COLORSWAP_ON + #pragma shader_feature_local HSV_ON + #pragma shader_feature_local CHANGECOLOR_ON + #pragma shader_feature_local CHANGECOLOR2_ON + #pragma shader_feature_local CHANGECOLOR3_ON + #pragma shader_feature_local COLORRAMP_ON + #pragma shader_feature_local GRADIENTCOLORRAMP_ON + #pragma shader_feature_local HITEFFECT_ON + #pragma shader_feature_local NEGATIVE_ON + #pragma shader_feature_local PIXELATE_ON + #pragma shader_feature_local GREYSCALE_ON + #pragma shader_feature_local POSTERIZE_ON + #pragma shader_feature_local BLUR_ON + #pragma shader_feature_local MOTIONBLUR_ON + #pragma shader_feature_local GHOST_ON + #pragma shader_feature_local ALPHAOUTLINE_ON + #pragma shader_feature_local INNEROUTLINE_ON + #pragma shader_feature_local ONLYINNEROUTLINE_ON + #pragma shader_feature_local HOLOGRAM_ON + #pragma shader_feature_local CHROMABERR_ON + #pragma shader_feature_local GLITCH_ON + #pragma shader_feature_local FLICKER_ON + #pragma shader_feature_local SHADOW_ON + #pragma shader_feature_local SHINE_ON + #pragma shader_feature_local CONTRAST_ON + #pragma shader_feature_local OVERLAY_ON + #pragma shader_feature_local OVERLAYMULT_ON + #pragma shader_feature_local DOODLE_ON + #pragma shader_feature_local WIND_ON + #pragma shader_feature_local WAVEUV_ON + #pragma shader_feature_local ROUNDWAVEUV_ON + #pragma shader_feature_local RECTSIZE_ON + #pragma shader_feature_local OFFSETUV_ON + #pragma shader_feature_local CLIPPING_ON + #pragma shader_feature_local RADIALCLIPPING_ON + #pragma shader_feature_local TEXTURESCROLL_ON + #pragma shader_feature_local ZOOMUV_ON + #pragma shader_feature_local DISTORT_ON + #pragma shader_feature_local WARP_ON + #pragma shader_feature_local TWISTUV_ON + #pragma shader_feature_local ROTATEUV_ON + #pragma shader_feature_local POLARUV_ON + #pragma shader_feature_local FISHEYE_ON + #pragma shader_feature_local PINCH_ON + #pragma shader_feature_local SHAKEUV_ON + + #pragma shader_feature_local GLOWTEX_ON + #pragma shader_feature_local OUTTEX_ON + #pragma shader_feature_local OUTDIST_ON + #pragma shader_feature_local OUTBASE8DIR_ON + #pragma shader_feature_local OUTBASEPIXELPERF_ON + #pragma shader_feature_local COLORRAMPOUTLINE_ON + #pragma shader_feature_local GREYSCALEOUTLINE_ON + #pragma shader_feature_local POSTERIZEOUTLINE_ON + #pragma shader_feature_local BLURISHD_ON + #pragma shader_feature_local MANUALWIND_ON + #pragma shader_feature_local ATLAS_ON + #pragma shader_feature_local PREMULTIPLYALPHA_ON + + #pragma shader_feature BILBOARD_ON + #pragma shader_feature BILBOARDY_ON + + #pragma shader_feature NORMALMAP_ON + + + #define _HDRP 1 +#define _USINGTEXCOORD1 1 +#define _USINGTEXCOORD2 1 + + + #pragma vertex Vert + #pragma fragment Frag + + + + // useful conversion functions to make surface shader code just work + + #define UNITY_DECLARE_TEX2D(name) TEXTURE2D(name); SAMPLER(sampler##name); + #define UNITY_DECLARE_TEX2D_NOSAMPLER(name) TEXTURE2D(name); + #define UNITY_DECLARE_TEX2DARRAY(name) TEXTURE2D_ARRAY(name); SAMPLER(sampler##name); + #define UNITY_DECLARE_TEX2DARRAY_NOSAMPLER(tex) TEXTURE2D_ARRAY(tex); + + #define UNITY_SAMPLE_TEX2DARRAY(tex,coord) SAMPLE_TEXTURE2D_ARRAY(tex, sampler##tex, coord.xy, coord.z) + #define UNITY_SAMPLE_TEX2DARRAY_LOD(tex,coord,lod) SAMPLE_TEXTURE2D_ARRAY_LOD(tex, sampler##tex, coord.xy, coord.z, lod) + #define UNITY_SAMPLE_TEX2D(tex, coord) SAMPLE_TEXTURE2D(tex, sampler##tex, coord) + #define UNITY_SAMPLE_TEX2D_SAMPLER(tex, samp, coord) SAMPLE_TEXTURE2D(tex, sampler##samp, coord) + + #define UNITY_SAMPLE_TEX2D_LOD(tex,coord, lod) SAMPLE_TEXTURE2D_LOD(tex, sampler_##tex, coord, lod) + #define UNITY_SAMPLE_TEX2D_SAMPLER_LOD(tex,samplertex,coord, lod) SAMPLE_TEXTURE2D_LOD (tex, sampler##samplertex,coord, lod) + + #if defined(UNITY_COMPILER_HLSL) + #define UNITY_INITIALIZE_OUTPUT(type,name) name = (type)0; + #else + #define UNITY_INITIALIZE_OUTPUT(type,name) + #endif + + #define sampler2D_float sampler2D + #define sampler2D_half sampler2D + + #undef WorldNormalVector + #define WorldNormalVector(data, normal) mul(normal, data.TBNMatrix) + + #define UnityObjectToWorldNormal(normal) mul(GetObjectToWorldMatrix(), normal) + + + + +// HDRP Adapter stuff + + + // If we use subsurface scattering, enable output split lighting (for forward pass) + #if defined(_MATERIAL_FEATURE_SUBSURFACE_SCATTERING) && !defined(_SURFACE_TYPE_TRANSPARENT) + #define OUTPUT_SPLIT_LIGHTING + #endif + + #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Version.hlsl" + #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Common.hlsl" + + #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/NormalSurfaceGradient.hlsl" + + // define FragInputs structure + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/ShaderPass/FragInputs.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/ShaderPass/ShaderPass.cs.hlsl" + #if (SHADER_LIBRARY_VERSION_MAJOR >= 10) + #include "Packages/com.unity.shadergraph/ShaderGraphLibrary/Functions.hlsl" + #endif + + + + + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/ShaderVariables.hlsl" + #ifdef DEBUG_DISPLAY + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Debug/DebugDisplay.hlsl" + #endif + + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/Material.hlsl" + + #if (SHADERPASS == SHADERPASS_FORWARD) + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Lighting/Lighting.hlsl" + + #define HAS_LIGHTLOOP + + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Lighting/LightLoop/LightLoopDef.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/Lit/Lit.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Lighting/LightLoop/LightLoop.hlsl" + #else + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/Lit/Lit.hlsl" + #endif + + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/BuiltinUtilities.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/MaterialUtilities.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/Decal/DecalUtilities.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/Lit/LitDecalData.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/ShaderGraphFunctions.hlsl" + + // Used by SceneSelectionPass + int _ObjectId; + int _PassValue; + + + // data across stages, stripped like the above. + struct VertexToPixel + { + float4 pos : SV_POSITION; + float3 worldPos : TEXCOORD0; + float3 worldNormal : TEXCOORD1; + float4 worldTangent : TEXCOORD2; + float4 texcoord0 : TEXCOORD3; + float4 texcoord1 : TEXCOORD4; + float4 texcoord2 : TEXCOORD5; + + // #if %TEXCOORD3REQUIREKEY% + float4 texcoord3 : TEXCOORD6; + // #endif + + // #if %SCREENPOSREQUIREKEY% + // float4 screenPos : TEXCOORD7; + // #endif + + // #if %VERTEXCOLORREQUIREKEY% + float4 vertexColor : COLOR; + // #endif + + // #if %EXTRAV2F0REQUIREKEY% + // float4 extraV2F0 : TEXCOORD8; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // float4 extraV2F1 : TEXCOORD9; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // float4 extraV2F2 : TEXCOORD10; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // float4 extraV2F3 : TEXCOORD11; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // float4 extraV2F4 : TEXCOORD12; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // float4 extraV2F5 : TEXCOORD13; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // float4 extraV2F6 : TEXCOORD14; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // float4 extraV2F7 : TEXCOORD15; + // #endif + + #if UNITY_ANY_INSTANCING_ENABLED + UNITY_VERTEX_INPUT_INSTANCE_ID + #endif // UNITY_ANY_INSTANCING_ENABLED + + UNITY_VERTEX_OUTPUT_STEREO + }; + + + + + // data describing the user output of a pixel + struct Surface + { + half3 Albedo; + half Height; + half3 Normal; + half Smoothness; + half3 Emission; + half Metallic; + half3 Specular; + half Occlusion; + half SpecularPower; // for simple lighting + half Alpha; + float outputDepth; // if written, SV_Depth semantic is used. ShaderData.clipPos.z is unused value + // HDRP Only + half SpecularOcclusion; + half SubsurfaceMask; + half Thickness; + half CoatMask; + half CoatSmoothness; + half Anisotropy; + half IridescenceMask; + half IridescenceThickness; + int DiffusionProfileHash; + float SpecularAAThreshold; + float SpecularAAScreenSpaceVariance; + // requires _OVERRIDE_BAKEDGI to be defined, but is mapped in all pipelines + float3 DiffuseGI; + float3 BackDiffuseGI; + float3 SpecularGI; + float ior; + float3 transmittanceColor; + float atDistance; + float transmittanceMask; + // requires _OVERRIDE_SHADOWMASK to be defines + float4 ShadowMask; + + // for decals + float NormalAlpha; + float MAOSAlpha; + + + }; + + // Data the user declares in blackboard blocks + struct Blackboard + { + + float blackboardDummyData; + }; + + // data the user might need, this will grow to be big. But easy to strip + struct ShaderData + { + float4 clipPos; // SV_POSITION + float3 localSpacePosition; + float3 localSpaceNormal; + float3 localSpaceTangent; + + float3 worldSpacePosition; + float3 worldSpaceNormal; + float3 worldSpaceTangent; + float tangentSign; + + float3 worldSpaceViewDir; + float3 tangentSpaceViewDir; + + float4 texcoord0; + float4 texcoord1; + float4 texcoord2; + float4 texcoord3; + + float2 screenUV; + float4 screenPos; + + float4 vertexColor; + bool isFrontFace; + + float4 extraV2F0; + float4 extraV2F1; + float4 extraV2F2; + float4 extraV2F3; + float4 extraV2F4; + float4 extraV2F5; + float4 extraV2F6; + float4 extraV2F7; + + float3x3 TBNMatrix; + Blackboard blackboard; + }; + + struct VertexData + { + #if SHADER_TARGET > 30 + // uint vertexID : SV_VertexID; + #endif + float4 vertex : POSITION; + float3 normal : NORMAL; + float4 tangent : TANGENT; + float4 texcoord0 : TEXCOORD0; + + // optimize out mesh coords when not in use by user or lighting system + #if _URP && (_USINGTEXCOORD1 || _PASSMETA || _PASSFORWARD || _PASSGBUFFER) + float4 texcoord1 : TEXCOORD1; + #endif + + #if _URP && (_USINGTEXCOORD2 || _PASSMETA || ((_PASSFORWARD || _PASSGBUFFER) && defined(DYNAMICLIGHTMAP_ON))) + float4 texcoord2 : TEXCOORD2; + #endif + + #if _STANDARD && (_USINGTEXCOORD1 || (_PASSMETA || ((_PASSFORWARD || _PASSGBUFFER || _PASSFORWARDADD) && LIGHTMAP_ON))) + float4 texcoord1 : TEXCOORD1; + #endif + #if _STANDARD && (_USINGTEXCOORD2 || (_PASSMETA || ((_PASSFORWARD || _PASSGBUFFER) && DYNAMICLIGHTMAP_ON))) + float4 texcoord2 : TEXCOORD2; + #endif + + + #if _HDRP + float4 texcoord1 : TEXCOORD1; + float4 texcoord2 : TEXCOORD2; + #endif + + // #if %TEXCOORD3REQUIREKEY% + float4 texcoord3 : TEXCOORD3; + // #endif + + // #if %VERTEXCOLORREQUIREKEY% + float4 vertexColor : COLOR; + // #endif + + #if _PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR)) + float3 previousPositionOS : TEXCOORD4; // Contain previous transform position (in case of skinning for example) + #if defined (_ADD_PRECOMPUTED_VELOCITY) + float3 precomputedVelocity : TEXCOORD5; // Add Precomputed Velocity (Alembic computes velocities on runtime side). + #endif + #endif + + UNITY_VERTEX_INPUT_INSTANCE_ID + }; + + struct TessVertex + { + float4 vertex : INTERNALTESSPOS; + float3 normal : NORMAL; + float4 tangent : TANGENT; + float4 texcoord0 : TEXCOORD0; + float4 texcoord1 : TEXCOORD1; + float4 texcoord2 : TEXCOORD2; + + // #if %TEXCOORD3REQUIREKEY% + float4 texcoord3 : TEXCOORD3; + // #endif + + // #if %VERTEXCOLORREQUIREKEY% + float4 vertexColor : COLOR; + // #endif + + // #if %EXTRAV2F0REQUIREKEY% + // float4 extraV2F0 : TEXCOORD5; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // float4 extraV2F1 : TEXCOORD6; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // float4 extraV2F2 : TEXCOORD7; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // float4 extraV2F3 : TEXCOORD8; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // float4 extraV2F4 : TEXCOORD9; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // float4 extraV2F5 : TEXCOORD10; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // float4 extraV2F6 : TEXCOORD11; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // float4 extraV2F7 : TEXCOORD12; + // #endif + + #if _PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR)) + float3 previousPositionOS : TEXCOORD13; // Contain previous transform position (in case of skinning for example) + #if defined (_ADD_PRECOMPUTED_VELOCITY) + float3 precomputedVelocity : TEXCOORD14; + #endif + #endif + + UNITY_VERTEX_INPUT_INSTANCE_ID + UNITY_VERTEX_OUTPUT_STEREO + }; + + struct ExtraV2F + { + float4 extraV2F0; + float4 extraV2F1; + float4 extraV2F2; + float4 extraV2F3; + float4 extraV2F4; + float4 extraV2F5; + float4 extraV2F6; + float4 extraV2F7; + Blackboard blackboard; + float4 time; + }; + + + float3 WorldToTangentSpace(ShaderData d, float3 normal) + { + return mul(d.TBNMatrix, normal); + } + + float3 TangentToWorldSpace(ShaderData d, float3 normal) + { + return mul(normal, d.TBNMatrix); + } + + // in this case, make standard more like SRPs, because we can't fix + // unity_WorldToObject in HDRP, since it already does macro-fu there + + #if _STANDARD + float3 TransformWorldToObject(float3 p) { return mul(unity_WorldToObject, float4(p, 1)); }; + float3 TransformObjectToWorld(float3 p) { return mul(unity_ObjectToWorld, float4(p, 1)); }; + float4 TransformWorldToObject(float4 p) { return mul(unity_WorldToObject, p); }; + float4 TransformObjectToWorld(float4 p) { return mul(unity_ObjectToWorld, p); }; + float4x4 GetWorldToObjectMatrix() { return unity_WorldToObject; } + float4x4 GetObjectToWorldMatrix() { return unity_ObjectToWorld; } + #if (defined(SHADER_API_D3D11) || defined(SHADER_API_XBOXONE) || defined(UNITY_COMPILER_HLSLCC) || defined(SHADER_API_PSSL) || (SHADER_TARGET_SURFACE_ANALYSIS && !SHADER_TARGET_SURFACE_ANALYSIS_MOJOSHADER)) + #define UNITY_SAMPLE_TEX2D_LOD(tex,coord, lod) tex.SampleLevel (sampler##tex,coord, lod) + #define UNITY_SAMPLE_TEX2D_SAMPLER_LOD(tex,samplertex,coord, lod) tex.SampleLevel (sampler##samplertex,coord, lod) + #else + #define UNITY_SAMPLE_TEX2D_LOD(tex,coord,lod) tex2D (tex,coord,0,lod) + #define UNITY_SAMPLE_TEX2D_SAMPLER_LOD(tex,samplertex,coord,lod) tex2D (tex,coord,0,lod) + #endif + + #undef GetWorldToObjectMatrix() + + #define GetWorldToObjectMatrix() unity_WorldToObject + + + #endif + + float3 GetCameraWorldPosition() + { + #if _HDRP + return GetCameraRelativePositionWS(_WorldSpaceCameraPos); + #else + return _WorldSpaceCameraPos; + #endif + } + + #if _GRABPASSUSED + #if _STANDARD + TEXTURE2D(%GRABTEXTURE%); + SAMPLER(sampler_%GRABTEXTURE%); + #endif + + half3 GetSceneColor(float2 uv) + { + #if _STANDARD + return SAMPLE_TEXTURE2D(%GRABTEXTURE%, sampler_%GRABTEXTURE%, uv).rgb; + #else + return SHADERGRAPH_SAMPLE_SCENE_COLOR(uv); + #endif + } + #endif + + + + #if _STANDARD + UNITY_DECLARE_DEPTH_TEXTURE(_CameraDepthTexture); + float GetSceneDepth(float2 uv) { return SAMPLE_DEPTH_TEXTURE(_CameraDepthTexture, uv); } + float GetLinear01Depth(float2 uv) { return Linear01Depth(GetSceneDepth(uv)); } + float GetLinearEyeDepth(float2 uv) { return LinearEyeDepth(GetSceneDepth(uv)); } + #else + float GetSceneDepth(float2 uv) { return SHADERGRAPH_SAMPLE_SCENE_DEPTH(uv); } + float GetLinear01Depth(float2 uv) { return Linear01Depth(GetSceneDepth(uv), _ZBufferParams); } + float GetLinearEyeDepth(float2 uv) { return LinearEyeDepth(GetSceneDepth(uv), _ZBufferParams); } + #endif + + float3 GetWorldPositionFromDepthBuffer(float2 uv, float3 worldSpaceViewDir) + { + float eye = GetLinearEyeDepth(uv); + float3 camView = mul((float3x3)GetObjectToWorldMatrix(), transpose(mul(GetWorldToObjectMatrix(), UNITY_MATRIX_I_V)) [2].xyz); + + float dt = dot(worldSpaceViewDir, camView); + float3 div = worldSpaceViewDir/dt; + float3 wpos = (eye * div) + GetCameraWorldPosition(); + return wpos; + } + + #if _HDRP + float3 ObjectToWorldSpacePosition(float3 pos) + { + return GetAbsolutePositionWS(TransformObjectToWorld(pos)); + } + #else + float3 ObjectToWorldSpacePosition(float3 pos) + { + return TransformObjectToWorld(pos); + } + #endif + + #if _STANDARD + UNITY_DECLARE_SCREENSPACE_TEXTURE(_CameraDepthNormalsTexture); + float3 GetSceneNormal(float2 uv, float3 worldSpaceViewDir) + { + float4 depthNorms = UNITY_SAMPLE_SCREENSPACE_TEXTURE(_CameraDepthNormalsTexture, uv); + float3 norms = DecodeViewNormalStereo(depthNorms); + norms = mul((float3x3)GetWorldToViewMatrix(), norms) * 0.5 + 0.5; + return norms; + } + #elif _HDRP && !_DECALSHADER + + float3 GetSceneNormal(float2 uv, float3 worldSpaceViewDir) + { + NormalData nd; + DecodeFromNormalBuffer(_ScreenSize.xy * uv, nd); + return nd.normalWS; + } + #elif _URP + #if (SHADER_LIBRARY_VERSION_MAJOR >= 10) + #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/DeclareNormalsTexture.hlsl" + #endif + + float3 GetSceneNormal(float2 uv, float3 worldSpaceViewDir) + { + #if (SHADER_LIBRARY_VERSION_MAJOR >= 10) + return SampleSceneNormals(uv); + #else + float3 wpos = GetWorldPositionFromDepthBuffer(uv, worldSpaceViewDir); + return normalize(-cross(ddx(wpos), ddy(wpos))) * 0.5 + 0.5; + #endif + + } + #endif + + #if _HDRP + + half3 UnpackNormalmapRGorAG(half4 packednormal) + { + // This do the trick + packednormal.x *= packednormal.w; + + half3 normal; + normal.xy = packednormal.xy * 2 - 1; + normal.z = sqrt(1 - saturate(dot(normal.xy, normal.xy))); + return normal; + } + half3 UnpackNormal(half4 packednormal) + { + #if defined(UNITY_NO_DXT5nm) + return packednormal.xyz * 2 - 1; + #else + return UnpackNormalmapRGorAG(packednormal); + #endif + } + #endif + #if _HDRP || _URP + + half3 UnpackScaleNormal(half4 packednormal, half scale) + { + #ifndef UNITY_NO_DXT5nm + // Unpack normal as DXT5nm (1, y, 1, x) or BC5 (x, y, 0, 1) + // Note neutral texture like "bump" is (0, 0, 1, 1) to work with both plain RGB normal and DXT5nm/BC5 + packednormal.x *= packednormal.w; + #endif + half3 normal; + normal.xy = (packednormal.xy * 2 - 1) * scale; + normal.z = sqrt(1 - saturate(dot(normal.xy, normal.xy))); + return normal; + } + + #endif + + + void GetSun(out float3 lightDir, out float3 color) + { + lightDir = float3(0.5, 0.5, 0); + color = 1; + #if _HDRP + if (_DirectionalLightCount > 0) + { + DirectionalLightData light = _DirectionalLightDatas[0]; + lightDir = -light.forward.xyz; + color = light.color; + } + #elif _STANDARD + lightDir = normalize(_WorldSpaceLightPos0.xyz); + color = _LightColor0.rgb; + #elif _URP + Light light = GetMainLight(); + lightDir = light.direction; + color = light.color; + #endif + } + + + + + CBUFFER_START(UnityPerMaterial) + + float _StencilRef; + float _StencilWriteMask; + float _StencilRefDepth; + float _StencilWriteMaskDepth; + float _StencilRefMV; + float _StencilWriteMaskMV; + float _StencilRefDistortionVec; + float _StencilWriteMaskDistortionVec; + float _StencilWriteMaskGBuffer; + float _StencilRefGBuffer; + float _ZTestGBuffer; + float _RequireSplitLighting; + float _ReceivesSSR; + float _ZWrite; + float _TransparentSortPriority; + float _ZTestDepthEqualForOpaque; + float _ZTestTransparent; + float _TransparentBackfaceEnable; + float _AlphaCutoffEnable; + float _UseShadowThreshold; + + + half4 _Color; + half4 _MainTex_ST, _MainTex_TexelSize; + half _Alpha, _AlphaCutoffValue; + + #if ATLAS_ON + half _MinXUV, _MaxXUV, _MinYUV, _MaxYUV; + #endif + + #if GLOW_ON + half4 _GlowColor; + half _Glow, _GlowGlobal; + #endif + + #if HSV_ON + half _HsvShift, _HsvSaturation, _HsvBright; + #endif + + #if DISTORT_ON + half4 _DistortTex_ST; + half _DistortTexXSpeed, _DistortTexYSpeed, _DistortAmount; + #endif + + #if FADE_ON + half4 _FadeBurnColor, _FadeTex_ST, _FadeBurnTex_ST; + half _FadeAmount, _FadeBurnWidth, _FadeBurnTransition,_FadeBurnGlow; + #endif + + #if OUTBASE_ON + half4 _OutlineColor; + half _OutlineAlpha, _OutlineGlow, _OutlineWidth; + int _OutlinePixelWidth; + #endif + + #if OUTTEX_ON + half4 _OutlineTex_ST; + half _OutlineTexXSpeed, _OutlineTexYSpeed; + #endif + + #if OUTDIST_ON + half4 _OutlineDistortTex_ST; + half _OutlineDistortTexXSpeed, _OutlineDistortTexYSpeed, _OutlineDistortAmount; + #endif + + #if ALPHAOUTLINE_ON + half _AlphaOutlineGlow, _AlphaOutlinePower, _AlphaOutlineMinAlpha, _AlphaOutlineBlend; + half4 _AlphaOutlineColor; + #endif + + #if INNEROUTLINE_ON + half _InnerOutlineThickness, _InnerOutlineAlpha, _InnerOutlineGlow; + half4 _InnerOutlineColor; + #endif + + #if GRADIENT_ON + half _GradBlend, _GradBoostX, _GradBoostY; + half4 _GradTopRightCol, _GradTopLeftCol, _GradBotRightCol, _GradBotLeftCol; + #endif + + #if COLORSWAP_ON + half4 _ColorSwapRed, _ColorSwapGreen, _ColorSwapBlue; + half _ColorSwapRedLuminosity, _ColorSwapGreenLuminosity, _ColorSwapBlueLuminosity, _ColorSwapBlend; + #endif + + #if CHANGECOLOR_ON + half4 _ColorChangeNewCol, _ColorChangeTarget; + half _ColorChangeTolerance, _ColorChangeLuminosity; + #endif + #if CHANGECOLOR2_ON + half4 _ColorChangeNewCol2, _ColorChangeTarget2; + half _ColorChangeTolerance2; + #endif + #if CHANGECOLOR3_ON + half4 _ColorChangeNewCol3, _ColorChangeTarget3; + half _ColorChangeTolerance3; + #endif + + #if COLORRAMP_ON + half _ColorRampLuminosity, _ColorRampBlend; + #endif + + #if HITEFFECT_ON + half4 _HitEffectColor; + half _HitEffectGlow, _HitEffectBlend; + #endif + + #if NEGATIVE_ON + half _NegativeAmount; + #endif + + #if PIXELATE_ON + half _PixelateSize; + #endif + + #if GREYSCALE_ON + half _GreyscaleLuminosity, _GreyscaleBlend; + half4 _GreyscaleTintColor; + #endif + + #if POSTERIZE_ON + half _PosterizeNumColors, _PosterizeGamma; + #endif + + #if BLUR_ON + half _BlurIntensity; + #endif + + #if MOTIONBLUR_ON + half _MotionBlurAngle, _MotionBlurDist; + #endif + + #if GHOST_ON + half _GhostColorBoost, _GhostTransparency, _GhostBlend; + #endif + + #if HOLOGRAM_ON + half _HologramStripesAmount, _HologramMinAlpha, _HologramUnmodAmount, _HologramStripesSpeed, _HologramMaxAlpha, _HologramBlend; + half4 _HologramStripeColor; + #endif + + #if CHROMABERR_ON + half _ChromAberrAmount, _ChromAberrAlpha; + #endif + + #if GLITCH_ON + half _GlitchAmount, _GlitchSize; + #endif + + #if FLICKER_ON + half _FlickerFreq, _FlickerPercent, _FlickerAlpha; + #endif + + #if SHADOW_ON + half _ShadowX, _ShadowY, _ShadowAlpha; + half4 _ShadowColor; + #endif + + #if SHINE_ON + half4 _ShineColor; + half _ShineLocation, _ShineRotate, _ShineWidth, _ShineGlow; + #endif + + #if CONTRAST_ON + half _Contrast, _Brightness; + #endif + + #if OVERLAY_ON + half4 _OverlayTex_ST, _OverlayColor; + half _OverlayGlow, _OverlayBlend, _OverlayTextureScrollXSpeed, _OverlayTextureScrollYSpeed; + #endif + + #if DOODLE_ON + half _HandDrawnAmount, _HandDrawnSpeed; + #endif + + #if WIND_ON + half _GrassSpeed, _GrassWind, _GrassManualAnim, _GrassRadialBend; + #endif + + #if WAVEUV_ON + float _WaveAmount, _WaveSpeed, _WaveStrength, _WaveX, _WaveY; + #endif + + #if ROUNDWAVEUV_ON + half _RoundWaveStrength, _RoundWaveSpeed; + #endif + + #if RECTSIZE_ON + half _RectSize; + #endif + + #if OFFSETUV_ON + half _OffsetUvX, _OffsetUvY; + #endif + + #if CLIPPING_ON + half _ClipUvLeft, _ClipUvRight, _ClipUvUp, _ClipUvDown; + #endif + + #if RADIALCLIPPING_ON + half _RadialStartAngle, _RadialClip, _RadialClip2; + #endif + + #if TEXTURESCROLL_ON + half _TextureScrollXSpeed, _TextureScrollYSpeed; + #endif + + #if ZOOMUV_ON + half _ZoomUvAmount; + #endif + + #if WARP_ON + half _WarpStrength, _WarpSpeed, _WarpScale; + #endif + + #if TWISTUV_ON + half _TwistUvAmount, _TwistUvPosX, _TwistUvPosY, _TwistUvRadius; + #endif + + #if ROTATEUV_ON + half _RotateUvAmount; + #endif + + #if FISHEYE_ON + half _FishEyeUvAmount; + #endif + + #if PINCH_ON + half _PinchUvAmount; + #endif + + #if SHAKEUV_ON + half _ShakeUvSpeed, _ShakeUvX, _ShakeUvY; + #endif + + #if NORMALMAP_ON + half _NormalStrength; + #endif + + float _RandomSeed; + + + + + CBUFFER_END + + + + + + + + TEXTURE2D(_MainTex); + SAMPLER(sampler_MainTex); + + #if GLOW_ON + TEXTURE2D(_GlowTex); + SAMPLER(sampler_GlowTex); + #endif + + #if FADE_ON + TEXTURE2D(_FadeTex); + SAMPLER(sampler_FadeTex); + + TEXTURE2D(_FadeBurnTex); + SAMPLER(sampler_FadeBurnTex); + #endif + + #if DISTORT_ON + TEXTURE2D(_DistortTex); + SAMPLER(sampler_DistortTex); + #endif + + #if OUTTEX_ON + TEXTURE2D(_OutlineTex); + SAMPLER(sampler_OutlineTex); + #endif + + #if OUTDIST_ON + TEXTURE2D(_OutlineDistortTex); + SAMPLER(sampler_OutlineDistortTex); + #endif + + #if COLORSWAP_ON + TEXTURE2D(_ColorSwapTex); + SAMPLER(sampler_ColorSwapTex); + #endif + + #if COLORRAMP_ON + TEXTURE2D(_ColorRampTex); + TEXTURE2D(_ColorRampTexGradient); + SAMPLER(sampler_ColorRampTex); + SAMPLER(sampler_ColorRampTexGradient); + #endif + + #if SHINE_ON + TEXTURE2D(_ShineMask); + SAMPLER(sampler_ShineMask); + #endif + + #if OVERLAY_ON + TEXTURE2D(_OverlayTex); + SAMPLER(sampler_OverlayTex); + #endif + + #if NORMALMAP_ON + TEXTURE2D(_NormalMap); + SAMPLER(sampler_NormalMap); + #endif + + + half3 GetPixel(in int offsetX, in int offsetY, in half2 uv, in Texture2D _tex, in SamplerState _sampler) + { + half2 _uv = uv + half2(offsetX * _MainTex_TexelSize.x, offsetY * _MainTex_TexelSize.y); + half4 col = SAMPLE_TEXTURE2D(_tex, _sampler, _uv); + return col.rgb; + } + + + //BLURS------------------------------------------------------------------------- + half4 Blur(half2 uv, Texture2D source, SamplerState sampler_source, half Intensity) + { + const half2 texelSize = 1.0 / _ScreenParams.xy; + const half4 color = SAMPLE_TEXTURE2D(source, sampler_source, uv); + const half2 offset = Intensity * texelSize; + + half4 accumulatedColor = color; + half accumulatedWeight = 1.0; + for (int x = -1; x <= 1; x++) + { + for (int y = -1; y <= 1; y++) + { + const half2 sampleUV = uv + half2(x, y) * offset; + const half4 sampleColor = SAMPLE_TEXTURE2D(source, sampler_source, sampleUV); + + accumulatedColor += sampleColor; + accumulatedWeight += 1.0; + } + } + + half4 blurredColor = accumulatedColor / accumulatedWeight; + return blurredColor; + } + + half BlurHD_G(half bhqp, half x) + { + return exp(-(x * x) / (2.0 * bhqp * bhqp)); + } + half4 BlurHD(half2 uv, Texture2D source, SamplerState sampler_source, half BlurAmount, half xScale, half yScale) + { + int iterations = 16; + int halfIterations = iterations / 2; + half sigmaX = 0.1 + BlurAmount * 0.5; + half sigmaY = sigmaX; + half total = 0.0; + half4 ret = half4(0, 0, 0, 0); + for (int iy = 0; iy < iterations; ++iy) + { + half fy = BlurHD_G(sigmaY, half(iy) -half(halfIterations)); + half offsetY = half(iy - halfIterations) * 0.00390625 * xScale; + for (int ix = 0; ix < iterations; ++ix) + { + half fx = BlurHD_G(sigmaX, half(ix) - half(halfIterations)); + half offsetX = half(ix - halfIterations) * 0.00390625 * yScale; + total += fx * fy; + ret += SAMPLE_TEXTURE2D(source, sampler_source, uv + half2(offsetX, offsetY)) * fx * fy; + } + } + return ret / total; + } + //----------------------------------------------------------------------- + + + //------------------------------------------- + half RemapFloat(half inValue, half inMin, half inMax, half outMin, half outMax){ + return outMin + (inValue - inMin) * (outMax - outMin) / (inMax - inMin); + } + //------------------------------------------- + + //----------------------------------------------------------------------- + half rand(half2 seed, half offset) { + return (frac(sin(dot(seed, half2(12.9898, 78.233))) * 43758.5453) + offset) % 1.0; + } + + half rand2(half2 seed, half offset) { + return (frac(sin(dot(seed * floor(50 + (_Time.x % 1.0) * 12.), half2(127.1, 311.7))) * 43758.5453123) + offset) % 1.0; + } + + half rand2CustomTime(half2 seed, half offset, half customTime) { + return (frac(sin(dot(seed * floor(50 + (customTime % 1.0) * 12.), half2(127.1, 311.7))) * 43758.5453123) + offset) % 1.0; + } + //----------------------------------------------------------------------- + + + void Ext_ModifyVertex0 (inout VertexData v, inout ExtraV2F d) + { + //BILBOARD_ON + #if BILBOARD_ON + half3 camRight = mul((half3x3)unity_CameraToWorld, half3(1,0,0)); + half3 camUp = half3(0,1,0); + #if BILBOARDY_ON + camUp = mul((half3x3)unity_CameraToWorld, half3(0,1,0)); + #endif + half3 localPos = v.vertex.x * camRight + v.vertex.y * camUp; + v.vertex = half4(localPos, 1); + #endif + //----------------------------------------------------------- + + v.texcoord0.xy = TRANSFORM_TEX(v.texcoord0.xy, _MainTex); + half2 center = half2(0.5, 0.5); + #if ATLAS_ON + center = half2((_MaxXUV + _MinXUV) / 2.0, (_MaxYUV + _MinYUV) / 2.0); + #endif + + //POLARUV_ON + #if POLARUV_ON + v.texcoord0.xy = v.texcoord0.xy - center; + #endif + + //---------------------------------------- + + //ROTATEUV_ON + #if ROTATEUV_ON + half2 uvC = v.texcoord0.xy; + half cosAngle = cos(_RotateUvAmount); + half sinAngle = sin(_RotateUvAmount); + half2x2 rot = half2x2(cosAngle, -sinAngle, sinAngle, cosAngle); + uvC -= center; + v.texcoord0.xy = mul(rot, uvC); + v.texcoord0.xy += center; + #endif + //-------------------- + + #if RECTSIZE_ON + v.vertex.xyz += (v.vertex.xyz * (_RectSize - 1.0)); + #endif + + #if OUTTEX_ON + v.texcoord1.xy = TRANSFORM_TEX(v.texcoord0.xy, _OutlineTex); + #endif + + #if OUTDIST_ON + v.texcoord2.xy = TRANSFORM_TEX(v.texcoord0.xy, _OutlineDistortTex); + #endif + + #if DISTORT_ON + v.texcoord3.xy = TRANSFORM_TEX(v.texcoord0.xy, _DistortTex); + #endif + } + + void Ext_SurfaceFunction0 (inout Surface o, ShaderData d) + { + half randomSeed = _RandomSeed; + + float2 uvRect = d.texcoord0; + half2 center = half2(0.5, 0.5); + #if ATLAS_ON + center = half2((_MaxXUV + _MinXUV) / 2.0, (_MaxYUV + _MinYUV) / 2.0); + uvRect = half2((d.texcoord0.x - _MinXUV) / (_MaxXUV - _MinXUV), (d.texcoord0.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half2 centerTiled = half2(center.x * _MainTex_ST.x, center.y * _MainTex_ST.y); + + //CLIPPING_ON + #if CLIPPING_ON + half2 tiledUv = half2(d.texcoord0.x / _MainTex_ST.x, d.texcoord0.y / _MainTex_ST.y); + #if ATLAS_ON + tiledUv = half2((tiledUv.x - _MinXUV) / (_MaxXUV - _MinXUV), (tiledUv.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + clip((1 - _ClipUvUp) - tiledUv.y); + clip(tiledUv.y - _ClipUvDown); + clip((1 - _ClipUvRight) - tiledUv.x); + clip(tiledUv.x - _ClipUvLeft); + #endif + //---------------------------------- + + //RADIALCLIPPING_ON + #if RADIALCLIPPING_ON + half2 tiledUv2 = half2(d.texcoord0.x / _MainTex_ST.x, d.texcoord0.y / _MainTex_ST.y); + #if ATLAS_ON + tiledUv2 = half2((tiledUv2.x - _MinXUV) / (_MaxXUV - _MinXUV), (tiledUv2.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half startAngle = _RadialStartAngle - _RadialClip; + half endAngle = _RadialStartAngle + _RadialClip2; + half offset0 = clamp(0, 360, startAngle + 360); + half offset360 = clamp(0, 360, endAngle - 360); + half2 atan2Coord = half2(lerp(-1, 1, tiledUv2.x), lerp(-1, 1, tiledUv2.y)); + half atanAngle = atan2(atan2Coord.y, atan2Coord.x) * 57.3; // angle in degrees + if(atanAngle < 0) atanAngle = 360 + atanAngle; + if(atanAngle >= startAngle && atanAngle <= endAngle) discard; + if(atanAngle <= offset360) discard; + if(atanAngle >= offset0) discard; + #endif + + //----------------------------- + + //TEXTURESCROLL_ON && ATLAS_ON + #if TEXTURESCROLL_ON && ATLAS_ON + d.texcoord0.xy = half2(_MinXUV + ((_MaxXUV - _MinXUV) * (abs(((_Time.y + randomSeed) * _TextureScrollXSpeed) + uvRect.x) % 1)), + _MinYUV + ((_MaxYUV - _MinYUV) * (abs(((_Time.y + randomSeed) * _TextureScrollYSpeed) + uvRect.y) % 1))); + #endif + //---------------------------- + + //OFFSETUV_ON + #if OFFSETUV_ON + #if ATLAS_ON + d.texcoord0.xy = half2(_MinXUV + ((_MaxXUV - _MinXUV) * (abs((_OffsetUvX + uvRect.x) % 1))), + _MinYUV + ((_MaxYUV - _MinYUV) * (abs(_OffsetUvY + uvRect.y) % 1))); + #else + d.texcoord0.xy += half2(_OffsetUvX, _OffsetUvY); + #endif + #endif + + //---------------------- + + //POLARUV_ON + #if POLARUV_ON + d.texcoord0.xy = half2(atan2(d.texcoord0.y, d.texcoord0.x) / (2.0f * 3.141592653589f), length(d.texcoord0.xy)); + d.texcoord0.xy *= _MainTex_ST.xy; + #endif + + //-------------------------------------- + + //TWISTUV_ON + #if TWISTUV_ON + #if ATLAS_ON + _TwistUvPosX = ((_MaxXUV - _MinXUV) * _TwistUvPosX) + _MinXUV; + _TwistUvPosY = ((_MaxYUV - _MinYUV) * _TwistUvPosY) + _MinYUV; + #endif + half2 tempUv = d.texcoord0.xy - half2(_TwistUvPosX * _MainTex_ST.x, _TwistUvPosY * _MainTex_ST.y); + _TwistUvRadius *= (_MainTex_ST.x + _MainTex_ST.y) / 2; + half percent = (_TwistUvRadius - length(tempUv)) / _TwistUvRadius; + half theta = percent * percent * (2.0 * sin(_TwistUvAmount)) * 8.0; + half s = sin(theta); + half c = cos(theta); + half beta = max(sign(_TwistUvRadius - length(tempUv)), 0.0); + tempUv = half2(dot(tempUv, half2(c, -s)), dot(tempUv, half2(s, c))) * beta + tempUv * (1 - beta); + tempUv += half2(_TwistUvPosX * _MainTex_ST.x, _TwistUvPosY * _MainTex_ST.y); + d.texcoord0.xy = tempUv; + #endif + + //-------------------------------------------- + + //FISHEYE_ON + #if FISHEYE_ON + half bind = length(centerTiled); + half2 dF = d.texcoord0.xy - centerTiled; + half dFlen = length(dF); + half fishInt = (3.14159265359 / bind) * (_FishEyeUvAmount + 0.001); + d.texcoord0.xy = centerTiled + (dF / (max(0.0001, dFlen))) * tan(dFlen * fishInt) * bind / tan(bind * fishInt); + #endif + //--------------------------------------------- + + //PINCH_ON + #if PINCH_ON + half2 dP = d.texcoord0.xy - centerTiled; + half pinchInt = (3.141592 / length(centerTiled)) * (-_PinchUvAmount + 0.001); + d.texcoord0.xy = centerTiled + normalize(dP) * atan(length(dP) * -pinchInt * 10.0) * 0.5 / atan(-pinchInt * 5); + #endif + + //--------------------------------------------- + + //ZOOMUV_ON + #if ZOOMUV_ON + d.texcoord0.xy -= centerTiled; + d.texcoord0.xy = d.texcoord0.xy * _ZoomUvAmount; + d.texcoord0.xy += centerTiled; + #endif + + //----------------------------------------------- + + //DOODLE_ON + #if DOODLE_ON + half2 uvCopy = uvRect; + _HandDrawnSpeed = (floor((_Time.x + randomSeed) * 20 * _HandDrawnSpeed) / _HandDrawnSpeed) * _HandDrawnSpeed; + uvCopy.x = sin((uvCopy.x * _HandDrawnAmount + _HandDrawnSpeed) * 4); + uvCopy.y = cos((uvCopy.y * _HandDrawnAmount + _HandDrawnSpeed) * 4); + d.texcoord0.xy = lerp(d.texcoord0.xy, d.texcoord0.xy + uvCopy, 0.0005 * _HandDrawnAmount); + #endif + + //-------------------------- + + //SHAKEUV_ON + #if SHAKEUV_ON + half xShake = sin((_Time.x + randomSeed) * _ShakeUvSpeed * 50) * _ShakeUvX; + half yShake = cos((_Time.x + randomSeed) * _ShakeUvSpeed * 50) * _ShakeUvY; + d.texcoord0.xy += half2(xShake * 0.012, yShake * 0.01); + #endif + + //------------------------------------------- + + //RECTSIZE_ON + #if RECTSIZE_ON + d.texcoord0.xy = d.texcoord0.xy * (_RectSize).xx + (((-_RectSize * 0.5) + 0.5)).xx; + #endif + + //------------------------------------------- + + //DISTORT_ON + #if DISTORT_ON + #if ATLAS_ON + d.texcoord3.x = d.texcoord3.x * (1 / (_MaxXUV - _MinXUV)); + d.texcoord3.y = d.texcoord3.y * (1 / (_MaxYUV - _MinYUV)); + #endif + + d.texcoord3.x += ((_Time.x + _RandomSeed) * _DistortTexXSpeed) % 1; + d.texcoord3.y += ((_Time.x + _RandomSeed) * _DistortTexYSpeed) % 1; + half distortAmnt = (SAMPLE_TEXTURE2D(_DistortTex, sampler_DistortTex, d.texcoord3.xy).r - 0.5) * 0.2 * _DistortAmount; + d.texcoord0.x += distortAmnt; + d.texcoord0.y += distortAmnt; + #endif + //------------------------------------------------------- + + //WARP_ON + #if WARP_ON + half2 warpUv = half2(d.texcoord0.x / _MainTex_ST.x, d.texcoord0.y / _MainTex_ST.y); + #if ATLAS_ON + warpUv = half2((warpUv.x - _MinXUV) / (_MaxXUV - _MinXUV), (warpUv.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + const float tau = 6.283185307179586; + float xWarp = (_Time.y + randomSeed) * _WarpSpeed + warpUv.x * tau / _WarpScale; + float yWarp = (_Time.y + randomSeed) * _WarpSpeed + warpUv.y * tau / _WarpScale; + float2 warp = float2(sin(xWarp), sin(yWarp)) * _WarpStrength; + d.texcoord0.xy += warp; + #endif + + //------------------------------------------------------- + + //WAVEUV_ON + #if WAVEUV_ON + float2 uvWave = half2(_WaveX * _MainTex_ST.x, _WaveY * _MainTex_ST.y) - d.texcoord0.xy; + uvWave %= 1; + #if ATLAS_ON + uvWave = half2(_WaveX, _WaveY) - uvRect; + #endif + uvWave.x *= _ScreenParams.x / _ScreenParams.y; + float waveTime = _Time.y + randomSeed; + float angWave = (sqrt(dot(uvWave, uvWave)) * _WaveAmount) - ((waveTime * _WaveSpeed)); + d.texcoord0.xy = d.texcoord0.xy + uvWave * sin(angWave) * (_WaveStrength / 1000.0); + #endif + //---------------------------------------------------- + + //ROUNDWAVEUV_ON + #if ROUNDWAVEUV_ON + half xWave = ((0.5 * _MainTex_ST.x) - uvRect.x); + half yWave = ((0.5 * _MainTex_ST.y) - uvRect.y) * (_MainTex_TexelSize.w / _MainTex_TexelSize.z); + half ripple = -sqrt(xWave*xWave + yWave* yWave); + d.texcoord0.xy += (sin((ripple + (_Time.y + randomSeed) * (_RoundWaveSpeed/10.0)) / 0.015) * (_RoundWaveStrength/10.0)) % 1; + #endif + //---------------------------------------------------- + + + //WIND_ON + #if WIND_ON + half windOffset = sin((_Time.x + randomSeed) * _GrassSpeed * 10); + half2 windCenter = half2(0.5, 0.1); + #if ATLAS_ON + windCenter.x = ((_MaxXUV - _MinXUV) * windCenter.x) + _MinXUV; + windCenter.y = ((_MaxYUV - _MinYUV) * windCenter.y) + _MinYUV; + #endif + #if !MANUALWIND_ON + d.texcoord0.x = fmod(abs(lerp(d.texcoord0.x, d.texcoord0.x + (_GrassWind * 0.01 * windOffset), uvRect.y)), 1); + #else + d.texcoord0.x = fmod(abs(lerp(d.texcoord0.x, d.texcoord0.x + (_GrassWind * 0.01 * _GrassManualAnim), uvRect.y)), 1); + windOffset = _GrassManualAnim; + #endif + half2 delta = d.texcoord0.xy - windCenter; + half delta2 = dot(delta.xy, delta.xy); + half2 delta_offset = delta2 * windOffset; + d.texcoord0.xy = d.texcoord0.xy + half2(delta.y, -delta.x) * delta_offset * _GrassRadialBend; + #endif + + //-------------------------------------------------------- + + //TEXTURESCROLL_ON && !ATLAS_ON + #if TEXTURESCROLL_ON && !ATLAS_ON + d.texcoord0.x += ((_Time.y + randomSeed) * _TextureScrollXSpeed) % 1; + d.texcoord0.y += ((_Time.y + randomSeed) * _TextureScrollYSpeed) % 1; + #endif + //------------------------------ + + //PIXELATE_ON + #if PIXELATE_ON + half aspectRatio = _MainTex_TexelSize.x / _MainTex_TexelSize.y; + half2 pixelSize = float2(_PixelateSize, _PixelateSize * aspectRatio); + d.texcoord0.xy = floor(d.texcoord0.xy * pixelSize) / pixelSize; + #endif + //-------------- + + half4 col = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy); + half originalAlpha = col.a; + col *= d.vertexColor; + + //NORMAL MAP + #if NORMALMAP_ON + half4 normalSample = SAMPLE_TEXTURE2D(_NormalMap, sampler_NormalMap, d.texcoord0.xy); + half3 normalTS = UnpackNormal(normalSample); + normalTS.xy *= _NormalStrength; + o.Normal = normalTS; + #endif + + + //GLITCH_ON + #if GLITCH_ON + half2 uvGlitch = uvRect; + uvGlitch.y -= 0.5; + half lineNoise = pow(rand2(floor(uvGlitch * half2(24., 19.) * _GlitchSize) * 4.0, randomSeed), 3.0) * _GlitchAmount + * pow(rand2(floor(uvGlitch * half2(38., 14.) * _GlitchSize) * 4.0, randomSeed), 3.0); + col = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(lineNoise * 0.02 * rand2(half2(2.0, 1), randomSeed), 0)) * d.vertexColor; + #endif + //-------------------------------------- + + //CHROMABERR_ON + #if CHROMABERR_ON + half4 r = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(_ChromAberrAmount/10, 0)) * d.vertexColor; + half4 b = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(-_ChromAberrAmount/10, 0)) * d.vertexColor; + col = half4(r.r * r.a, col.g, b.b * b.a, max(max(r.a, b.a) * _ChromAberrAlpha, col.a)); + #endif + + //-------------------------------- + + //BLUR_ON + #if BLUR_ON + #if ATLAS_ON + #if !BLURISHD_ON + col = BlurHD(d.texcoord0.xy, _MainTex, sampler_MainTex, _BlurIntensity, (_MaxXUV - _MinXUV), (_MaxYUV - _MinYUV)) * d.vertexColor; + #else + col = Blur(d.texcoord0.xy, _MainTex, sampler_MainTex, _BlurIntensity * (_MaxXUV - _MinXUV)) * d.vertexColor; + #endif + #else + #if !BLURISHD_ON + col = BlurHD(d.texcoord0.xy, _MainTex, sampler_MainTex, _BlurIntensity, 1, 1) * d.vertexColor; + #else + col = Blur(d.texcoord0.xy, _MainTex, sampler_MainTex, _BlurIntensity) * d.vertexColor; + #endif + #endif + #endif + + //-------------------- + + //MOTIONBLUR_ON + #if MOTIONBLUR_ON + _MotionBlurAngle = _MotionBlurAngle * 3.1415926; + #define rot(n) mul(n, half2x2(cos(_MotionBlurAngle), -sin(_MotionBlurAngle), sin(_MotionBlurAngle), cos(_MotionBlurAngle))) + _MotionBlurDist = _MotionBlurDist * 0.005; + #if ATLAS_ON + _MotionBlurDist *= (_MaxXUV - _MinXUV); + #endif + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(-_MotionBlurDist, -_MotionBlurDist))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(-_MotionBlurDist * 2, -_MotionBlurDist * 2))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(-_MotionBlurDist * 3, -_MotionBlurDist * 3))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(-_MotionBlurDist * 4, -_MotionBlurDist * 4))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(_MotionBlurDist, _MotionBlurDist))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(_MotionBlurDist * 2, _MotionBlurDist * 2))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(_MotionBlurDist * 3, _MotionBlurDist * 3))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(_MotionBlurDist * 4, _MotionBlurDist * 4))); + col.rgb = col.rgb / 9; + #endif + //------------------------------------ + + //NEGATIVE_ON + #if NEGATIVE_ON + col.rgb = lerp(col.rgb, 1 - col.rgb, _NegativeAmount); + #endif + + //-------------- + half luminance = 0; + + //GREYSCALE_ON && !GREYSCALEOUTLINE_ON + #if GREYSCALE_ON && !GREYSCALEOUTLINE_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + luminance = saturate(luminance + _GreyscaleLuminosity); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _GreyscaleTintColor, _GreyscaleBlend); + #endif + //------------------------------------ + + //GHOST_ON + #if GHOST_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + half4 ghostResult; + ghostResult.a = saturate(luminance - _GhostTransparency) * col.a; + ghostResult.rgb = col.rgb * (luminance + _GhostColorBoost); + col = lerp(col, ghostResult, _GhostBlend); + #endif + //------------------------------------ + + //INNEROUTLINE_ON + #if INNEROUTLINE_ON + half3 innerT = abs(GetPixel(0, _InnerOutlineThickness, d.texcoord0.xy, _MainTex, sampler_MainTex) - GetPixel(0, -_InnerOutlineThickness, d.texcoord0.xy, _MainTex, sampler_MainTex)); + innerT += abs(GetPixel(_InnerOutlineThickness, 0, d.texcoord0.xy, _MainTex, sampler_MainTex) - GetPixel(-_InnerOutlineThickness, 0, d.texcoord0.xy, _MainTex, sampler_MainTex)); + #if !ONLYINNEROUTLINE_ON + innerT = (innerT / 2.0) * col.a * _InnerOutlineAlpha; + col.rgb += length(innerT) * _InnerOutlineColor.rgb * _InnerOutlineGlow; + #else + innerT *= col.a * _InnerOutlineAlpha; + col.rgb = length(innerT) * _InnerOutlineColor.rgb * _InnerOutlineGlow; + col.a = step(0.3, col.r+col.g+col.b); + #endif + #endif + //------------------------------------------------------- + + //HITEFFECT_ON + #if HITEFFECT_ON + col.rgb = lerp(col.rgb, _HitEffectColor.rgb * _HitEffectGlow, _HitEffectBlend); + #endif + //-------------------- + + //GRADIENT_ON + #if GRADIENT_ON + half2 tiledUvGrad = half2(uvRect.x / _MainTex_ST.x, uvRect.y / _MainTex_ST.y); + #if GRADIENT2COL_ON + _GradTopRightCol = _GradTopLeftCol; + _GradBotRightCol = _GradBotLeftCol; + #endif + #if RADIALGRADIENT_ON + half radialDist = 1 - length(tiledUvGrad - half2(0.5, 0.5)); + radialDist *= (_MainTex_TexelSize.w / _MainTex_TexelSize.z); + radialDist = saturate(_GradBoostX * radialDist); + half4 gradientResult = lerp(_GradTopLeftCol, _GradBotLeftCol, radialDist); + #else + half gradXLerpFactor = saturate(pow(tiledUvGrad.x, _GradBoostX)); + half4 gradientResult = lerp(lerp(_GradBotLeftCol, _GradBotRightCol, gradXLerpFactor), + lerp(_GradTopLeftCol, _GradTopRightCol, gradXLerpFactor), saturate(pow(tiledUvGrad.y, _GradBoostY))); + #endif + gradientResult = lerp(col, gradientResult, _GradBlend); + col.rgb = gradientResult.rgb * col.a; + col.a *= gradientResult.a; + #endif + //-------------------------------------------------------------------- + + //CONTRAST_ON + #if CONTRAST_ON + col.rgb = (col.rgb - float3(0.5, 0.5, 0.5)) * _Contrast + float3(0.5, 0.5, 0.5); + col.rgb += _Brightness; + #endif + + //------------------------------------------------------------------- + + //COLORSWAP_ON + #if COLORSWAP_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + half4 swapMask = SAMPLE_TEXTURE2D(_ColorSwapTex, sampler_ColorSwapTex, d.texcoord0.xy); + swapMask.rgb *= swapMask.a; + half3 redSwap = _ColorSwapRed * swapMask.r * saturate(luminance + _ColorSwapRedLuminosity); + half3 greenSwap = _ColorSwapGreen * swapMask.g * saturate(luminance + _ColorSwapGreenLuminosity); + half3 blueSwap = _ColorSwapBlue * swapMask.b * saturate(luminance + _ColorSwapBlueLuminosity); + swapMask.rgb = col.rgb * saturate(1 - swapMask.r - swapMask.g - swapMask.b); + col.rgb = lerp(col.rgb, swapMask.rgb + redSwap + greenSwap + blueSwap, _ColorSwapBlend); + #endif + //-------------------------------------------------------------------- + + //COLORRAMP_ON && !COLORRAMPOUTLINE_ON + #if COLORRAMP_ON && !COLORRAMPOUTLINE_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + luminance = saturate(luminance + _ColorRampLuminosity); + #if GRADIENTCOLORRAMP_ON + col.rgb = lerp(col.rgb, SAMPLE_TEXTURE2D(_ColorRampTexGradient, sampler_ColorRampTexGradient, half2(luminance, 0)).rgb, _ColorRampBlend); + #else + col.rgb = lerp(col.rgb, SAMPLE_TEXTURE2D(_ColorRampTex, sampler_ColorRampTex, half2(luminance, 0)).rgb, _ColorRampBlend); + #endif + #endif + //-------------------------------------------------------------------- + + //CHANGECOLOR_ON + #if CHANGECOLOR_ON + float3 currChangeColor = saturate(col.rgb); + luminance = 0.3 * currChangeColor.r + 0.59 * currChangeColor.g + 0.11 * currChangeColor.b; + luminance = saturate(luminance + _ColorChangeLuminosity); + half3 dif = abs(currChangeColor - _ColorChangeTarget.rgb); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _ColorChangeNewCol.rgb, + max(sign(1 - saturate(dif.x + dif.y + dif.z) - _ColorChangeTolerance), 0.0)); + #if CHANGECOLOR2_ON + dif = abs(currChangeColor - _ColorChangeTarget2.rgb); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _ColorChangeNewCol2.rgb, + max(sign(1 - saturate(dif.x + dif.y + dif.z) - _ColorChangeTolerance2), 0.0)); + #endif + #if CHANGECOLOR3_ON + dif = abs(currChangeColor - _ColorChangeTarget3.rgb); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _ColorChangeNewCol3.rgb, + max(sign(1 - saturate(dif.x + dif.y + dif.z) - _ColorChangeTolerance3), 0.0)); + #endif + #endif + //------------------------------------------------------- + + //POSTERIZE_ON && !POSTERIZEOUTLINE_ON + #if POSTERIZE_ON && !POSTERIZEOUTLINE_ON + col.rgb = pow(col.rgb, _PosterizeGamma) * _PosterizeNumColors; + col.rgb = floor(col.rgb) / _PosterizeNumColors; + col.rgb = pow(col.rgb, 1.0 / _PosterizeGamma); + #endif + //------------------------------------ + + //HSV_ON + #if HSV_ON + half3 resultHsv = half3(col.rgb); + half cosHsv = _HsvBright * _HsvSaturation * cos(_HsvShift * 3.14159265 / 180); + half sinHsv = _HsvBright * _HsvSaturation * sin(_HsvShift * 3.14159265 / 180); + resultHsv.x = (.299 * _HsvBright + .701 * cosHsv + .168 * sinHsv) * col.x + + (.587 * _HsvBright - .587 * cosHsv + .330 * sinHsv) * col.y + + (.114 * _HsvBright - .114 * cosHsv - .497 * sinHsv) * col.z; + resultHsv.y = (.299 * _HsvBright - .299 * cosHsv - .328 * sinHsv) *col.x + + (.587 * _HsvBright + .413 * cosHsv + .035 * sinHsv) * col.y + + (.114 * _HsvBright - .114 * cosHsv + .292 * sinHsv) * col.z; + resultHsv.z = (.299 * _HsvBright - .3 * cosHsv + 1.25 * sinHsv) * col.x + + (.587 * _HsvBright - .588 * cosHsv - 1.05 * sinHsv) * col.y + + (.114 * _HsvBright + .886 * cosHsv - .203 * sinHsv) * col.z; + col.rgb = resultHsv; + #endif + //------------------------------------------------------- + + //OVERLAY_ON + #if OVERLAY_ON + half2 overlayUvs = d.texcoord0.xy; + overlayUvs.x += ((_Time.y + randomSeed) * _OverlayTextureScrollXSpeed) % 1; + overlayUvs.y += ((_Time.y + randomSeed) * _OverlayTextureScrollYSpeed) % 1; + half4 overlayCol = SAMPLE_TEXTURE2D(_OverlayTex, sampler_OverlayTex, TRANSFORM_TEX(overlayUvs, _OverlayTex)); + overlayCol.rgb *= _OverlayColor.rgb * _OverlayGlow; + #if !OVERLAYMULT_ON + overlayCol.rgb *= overlayCol.a * _OverlayColor.rgb * _OverlayColor.a * _OverlayBlend; + col.rgb += overlayCol.rgb; + #else + overlayCol.a *= _OverlayColor.a; + col = lerp(col, col * overlayCol, _OverlayBlend); + #endif + #endif + + //--------------------------------- + + //OUTBASE_ON + #if OUTBASE_ON + #if OUTBASEPIXELPERF_ON + half2 destUv = half2(_OutlinePixelWidth * _MainTex_TexelSize.x, _OutlinePixelWidth * _MainTex_TexelSize.y); + #else + half2 destUv = half2(_OutlineWidth * _MainTex_TexelSize.x * 200, _OutlineWidth * _MainTex_TexelSize.y * 200); + #endif + + #if OUTDIST_ON + d.texcoord3.x += ((_Time.x + _RandomSeed) * _OutlineDistortTexXSpeed) % 1; + d.texcoord3.y += ((_Time.x + _RandomSeed) * _OutlineDistortTexYSpeed) % 1; + #if ATLAS_ON + d.texcoord3 = half2((d.texcoord3.x - _MinXUV) / (_MaxXUV - _MinXUV), (d.texcoord3.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half outDistortAmnt = (SAMPLE_TEXTURE2D(_OutlineDistortTex, sampler_OutlineDistortTex, d.texcoord3).r - 0.5) * 0.2 * _OutlineDistortAmount; + destUv.x += outDistortAmnt; + destUv.y += outDistortAmnt; + #endif + + half spriteLeft = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(destUv.x, 0)).a; + half spriteRight = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy - half2(destUv.x, 0)).a; + half spriteBottom = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(0, destUv.y)).a; + half spriteTop = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy - half2(0, destUv.y)).a; + half result = spriteLeft + spriteRight + spriteBottom + spriteTop; + + #if OUTBASE8DIR_ON + half spriteTopLeft = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(destUv.x, destUv.y)).a; + half spriteTopRight = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(-destUv.x, destUv.y)).a; + half spriteBotLeft = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(destUv.x, -destUv.y)).a; + half spriteBotRight = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(-destUv.x, -destUv.y)).a; + result = result + spriteTopLeft + spriteTopRight + spriteBotLeft + spriteBotRight; + #endif + + result = step(0.05, saturate(result)); + + #if OUTTEX_ON + d.texcoord1.x += ((_Time.x + _RandomSeed) * _OutlineTexXSpeed) % 1; + d.texcoord1.y += ((_Time.x + _RandomSeed) * _OutlineTexYSpeed) % 1; + #if ATLAS_ON + d.texcoord1 = half2((d.texcoord1.x - _MinXUV) / (_MaxXUV - _MinXUV), (d.texcoord1.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half4 tempOutColor = SAMPLE_TEXTURE2D(_OutlineTex, sampler_OutlineTex, d.texcoord1); + tempOutColor *= _OutlineColor; + _OutlineColor = tempOutColor; + #endif + + result *= (1 - originalAlpha) * _OutlineAlpha; + + half4 outline = _OutlineColor * d.vertexColor.a; + outline.rgb *= _OutlineGlow; + outline.a = result; + #if ONLYOUTLINE_ON + col = outline; + #else + col = lerp(col, outline, result); + #endif + #endif + //------------------------------------------------------- + + //FADE_ON + #if FADE_ON + half2 tiledUvFade1 = TRANSFORM_TEX(d.texcoord0, _FadeTex); + half2 tiledUvFade2 = TRANSFORM_TEX(d.texcoord0, _FadeBurnTex); + #if ATLAS_ON + tiledUvFade1 = half2((tiledUvFade1.x - _MinXUV) / (_MaxXUV - _MinXUV), (tiledUvFade1.y - _MinYUV) / (_MaxYUV - _MinYUV)); + tiledUvFade2 = half2((tiledUvFade2.x - _MinXUV) / (_MaxXUV - _MinXUV), (tiledUvFade2.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half fadeTemp = SAMPLE_TEXTURE2D(_FadeTex, sampler_FadeTex, tiledUvFade1).r; + half fade = smoothstep(_FadeAmount, _FadeAmount + _FadeBurnTransition, fadeTemp); + half fadeBurn = saturate(smoothstep(_FadeAmount - _FadeBurnWidth, _FadeAmount - _FadeBurnWidth + 0.1, fadeTemp) * _FadeAmount); + col.a *= fade; + _FadeBurnColor.rgb *= _FadeBurnGlow; + col += fadeBurn * SAMPLE_TEXTURE2D(_FadeBurnTex, sampler_FadeBurnTex, tiledUvFade2) * _FadeBurnColor * originalAlpha * (1 - col.a); + #endif + //------------------------------------------------------- + + //SHADOW_ON + #if SHADOW_ON + half shadowA = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(_ShadowX, _ShadowY)).a; + half preMultShadowMask = 1 - (saturate(shadowA - col.a) * (1 - col.a)); + col.rgb *= 1 - ((shadowA - col.a) * (1 - col.a)); + col.rgb += (_ShadowColor * shadowA) * (1 - col.a); + col.a = max(shadowA * _ShadowAlpha * d.vertexColor.a, col.a); + #endif + + //------------------------------------------------------- + + //GLOW_ON + #if GLOW_ON + half4 emission; + #if GLOWTEX_ON + emission = SAMPLE_TEXTURE2D(_GlowTex, sampler_GlowTex, d.texcoord0); + #else + emission = col; + #endif + + col.rgb *= _GlowGlobal; + emission.rgb *= emission.a * col.a * _Glow * _GlowColor; + col.rgb += emission.rgb; + #endif + //------------------------------------------------------- + + //COLORRAMP_ON && COLORRAMPOUTLINE_ON + #if COLORRAMP_ON && COLORRAMPOUTLINE_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + luminance = saturate(luminance + _ColorRampLuminosity); + #if GRADIENTCOLORRAMP_ON + col.rgb = lerp(col.rgb, SAMPLE_TEXTURE2D(_ColorRampTexGradient, sampler_ColorRampTexGradient, half2(luminance, 0)).rgb, _ColorRampBlend); + #else + col.rgb = lerp(col.rgb, SAMPLE_TEXTURE2D(_ColorRampTex, sampler_ColorRampTex, half2(luminance, 0)).rgb, _ColorRampBlend); + #endif + #endif + //--------------- + + //GREYSCALE_ON && GREYSCALEOUTLINE_ON + #if GREYSCALE_ON && GREYSCALEOUTLINE_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + luminance = saturate(luminance + _GreyscaleLuminosity); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _GreyscaleTintColor, _GreyscaleBlend); + #endif + + //----------------------------------- + + //POSTERIZE_ON && POSTERIZEOUTLINE_ON + #if POSTERIZE_ON && POSTERIZEOUTLINE_ON + col.rgb = pow(col.rgb, _PosterizeGamma) * _PosterizeNumColors; + col.rgb = floor(col.rgb) / _PosterizeNumColors; + col.rgb = pow(col.rgb, 1.0 / _PosterizeGamma); + #endif + + //----------------------------------- + + //SHINE_ON + #if SHINE_ON + half2 uvShine = uvRect; + half cosAngle = cos(_ShineRotate); + half sinAngle = sin(_ShineRotate); + half2x2 rot = half2x2(cosAngle, -sinAngle, sinAngle, cosAngle); + uvShine -= half2(0.5, 0.5); + uvShine = mul(rot, uvShine); + uvShine += half2(0.5, 0.5); + half shineMask = SAMPLE_TEXTURE2D(_ShineMask, sampler_ShineMask, d.texcoord0.xy).a; + half currentDistanceProjection = (uvShine.x + uvShine.y) / 2; + half whitePower = 1 - (abs(currentDistanceProjection - _ShineLocation) / _ShineWidth); + col.rgb += col.a * whitePower * _ShineGlow * max(sign(currentDistanceProjection - (_ShineLocation - _ShineWidth)), 0.0) + * max(sign((_ShineLocation + _ShineWidth) - currentDistanceProjection), 0.0) * _ShineColor * shineMask; + #endif + + //----------------------------------- + + //HOLOGRAM_ON + #if HOLOGRAM_ON + half totalHologram = _HologramStripesAmount + _HologramUnmodAmount; + half hologramYCoord = ((uvRect.y + (((_Time.x + randomSeed) % 1) * _HologramStripesSpeed)) % totalHologram) / totalHologram; + hologramYCoord = abs(hologramYCoord); + half alpha = RemapFloat(saturate(hologramYCoord - (_HologramUnmodAmount/totalHologram)), 0.0, 1.0, _HologramMinAlpha, saturate(_HologramMaxAlpha)); + half hologramMask = max(sign((_HologramUnmodAmount/totalHologram) - hologramYCoord), 0.0); + half4 hologramResult = col; + hologramResult.a *= lerp(alpha, 1, hologramMask); + hologramResult.rgb *= max(1, _HologramMaxAlpha * max(sign(hologramYCoord - (_HologramUnmodAmount/totalHologram)), 0.0)); + hologramMask = 1 - step(0.01,hologramMask); + hologramResult.rgb += hologramMask * _HologramStripeColor * col.a; + col = lerp(col, hologramResult, _HologramBlend); + #endif + + //----------------------------------- + + //FLICKER_ON + #if FLICKER_ON + col.a *= saturate(col.a * step(frac(0.05 + (_Time.w + randomSeed) * _FlickerFreq), 1 - _FlickerPercent) + _FlickerAlpha); + #endif + //----------------------------------- + + //ALPHACUTOFF_ON + + //ALPHAROUND_ON + + //ALPHAOUTLINE_ON + #if ALPHAOUTLINE_ON + half alphaOutlineRes = pow(1 - col.a, max(_AlphaOutlinePower, 0.0001)) * step(_AlphaOutlineMinAlpha, col.a) * _AlphaOutlineBlend; + col.rgb = lerp(col.rgb, _AlphaOutlineColor.rgb * _AlphaOutlineGlow, alphaOutlineRes); + col.a = lerp(col.a, 1, alphaOutlineRes > 1); + #endif + //------------------------------------------------------- + + //FOG_ON + + //------------------ + + col *= _Color; + o.Albedo = col; + col.a *= _Alpha; + clip(col.a - _AlphaCutoffValue - 0.01); + o.Alpha = _Color.a; + } + + + + + + void ChainSurfaceFunction(inout Surface l, inout ShaderData d) + { + Ext_SurfaceFunction0(l, d); + // Ext_SurfaceFunction1(l, d); + // Ext_SurfaceFunction2(l, d); + // Ext_SurfaceFunction3(l, d); + // Ext_SurfaceFunction4(l, d); + // Ext_SurfaceFunction5(l, d); + // Ext_SurfaceFunction6(l, d); + // Ext_SurfaceFunction7(l, d); + // Ext_SurfaceFunction8(l, d); + // Ext_SurfaceFunction9(l, d); + // Ext_SurfaceFunction10(l, d); + // Ext_SurfaceFunction11(l, d); + // Ext_SurfaceFunction12(l, d); + // Ext_SurfaceFunction13(l, d); + // Ext_SurfaceFunction14(l, d); + // Ext_SurfaceFunction15(l, d); + // Ext_SurfaceFunction16(l, d); + // Ext_SurfaceFunction17(l, d); + // Ext_SurfaceFunction18(l, d); + // Ext_SurfaceFunction19(l, d); + // Ext_SurfaceFunction20(l, d); + // Ext_SurfaceFunction21(l, d); + // Ext_SurfaceFunction22(l, d); + // Ext_SurfaceFunction23(l, d); + // Ext_SurfaceFunction24(l, d); + // Ext_SurfaceFunction25(l, d); + // Ext_SurfaceFunction26(l, d); + // Ext_SurfaceFunction27(l, d); + // Ext_SurfaceFunction28(l, d); + // Ext_SurfaceFunction29(l, d); + } + +#if !_DECALSHADER + + void ChainModifyVertex(inout VertexData v, inout VertexToPixel v2p, float4 time) + { + ExtraV2F d; + + ZERO_INITIALIZE(ExtraV2F, d); + ZERO_INITIALIZE(Blackboard, d.blackboard); + // due to motion vectors in HDRP, we need to use the last + // time in certain spots. So if you are going to use _Time to adjust vertices, + // you need to use this time or motion vectors will break. + d.time = time; + + Ext_ModifyVertex0(v, d); + // Ext_ModifyVertex1(v, d); + // Ext_ModifyVertex2(v, d); + // Ext_ModifyVertex3(v, d); + // Ext_ModifyVertex4(v, d); + // Ext_ModifyVertex5(v, d); + // Ext_ModifyVertex6(v, d); + // Ext_ModifyVertex7(v, d); + // Ext_ModifyVertex8(v, d); + // Ext_ModifyVertex9(v, d); + // Ext_ModifyVertex10(v, d); + // Ext_ModifyVertex11(v, d); + // Ext_ModifyVertex12(v, d); + // Ext_ModifyVertex13(v, d); + // Ext_ModifyVertex14(v, d); + // Ext_ModifyVertex15(v, d); + // Ext_ModifyVertex16(v, d); + // Ext_ModifyVertex17(v, d); + // Ext_ModifyVertex18(v, d); + // Ext_ModifyVertex19(v, d); + // Ext_ModifyVertex20(v, d); + // Ext_ModifyVertex21(v, d); + // Ext_ModifyVertex22(v, d); + // Ext_ModifyVertex23(v, d); + // Ext_ModifyVertex24(v, d); + // Ext_ModifyVertex25(v, d); + // Ext_ModifyVertex26(v, d); + // Ext_ModifyVertex27(v, d); + // Ext_ModifyVertex28(v, d); + // Ext_ModifyVertex29(v, d); + + + // #if %EXTRAV2F0REQUIREKEY% + // v2p.extraV2F0 = d.extraV2F0; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // v2p.extraV2F1 = d.extraV2F1; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // v2p.extraV2F2 = d.extraV2F2; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // v2p.extraV2F3 = d.extraV2F3; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // v2p.extraV2F4 = d.extraV2F4; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // v2p.extraV2F5 = d.extraV2F5; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // v2p.extraV2F6 = d.extraV2F6; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // v2p.extraV2F7 = d.extraV2F7; + // #endif + } + + void ChainModifyTessellatedVertex(inout VertexData v, inout VertexToPixel v2p) + { + ExtraV2F d; + ZERO_INITIALIZE(ExtraV2F, d); + ZERO_INITIALIZE(Blackboard, d.blackboard); + + // #if %EXTRAV2F0REQUIREKEY% + // d.extraV2F0 = v2p.extraV2F0; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // d.extraV2F1 = v2p.extraV2F1; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // d.extraV2F2 = v2p.extraV2F2; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // d.extraV2F3 = v2p.extraV2F3; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // d.extraV2F4 = v2p.extraV2F4; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // d.extraV2F5 = v2p.extraV2F5; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // d.extraV2F6 = v2p.extraV2F6; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // d.extraV2F7 = v2p.extraV2F7; + // #endif + + + // Ext_ModifyTessellatedVertex0(v, d); + // Ext_ModifyTessellatedVertex1(v, d); + // Ext_ModifyTessellatedVertex2(v, d); + // Ext_ModifyTessellatedVertex3(v, d); + // Ext_ModifyTessellatedVertex4(v, d); + // Ext_ModifyTessellatedVertex5(v, d); + // Ext_ModifyTessellatedVertex6(v, d); + // Ext_ModifyTessellatedVertex7(v, d); + // Ext_ModifyTessellatedVertex8(v, d); + // Ext_ModifyTessellatedVertex9(v, d); + // Ext_ModifyTessellatedVertex10(v, d); + // Ext_ModifyTessellatedVertex11(v, d); + // Ext_ModifyTessellatedVertex12(v, d); + // Ext_ModifyTessellatedVertex13(v, d); + // Ext_ModifyTessellatedVertex14(v, d); + // Ext_ModifyTessellatedVertex15(v, d); + // Ext_ModifyTessellatedVertex16(v, d); + // Ext_ModifyTessellatedVertex17(v, d); + // Ext_ModifyTessellatedVertex18(v, d); + // Ext_ModifyTessellatedVertex19(v, d); + // Ext_ModifyTessellatedVertex20(v, d); + // Ext_ModifyTessellatedVertex21(v, d); + // Ext_ModifyTessellatedVertex22(v, d); + // Ext_ModifyTessellatedVertex23(v, d); + // Ext_ModifyTessellatedVertex24(v, d); + // Ext_ModifyTessellatedVertex25(v, d); + // Ext_ModifyTessellatedVertex26(v, d); + // Ext_ModifyTessellatedVertex27(v, d); + // Ext_ModifyTessellatedVertex28(v, d); + // Ext_ModifyTessellatedVertex29(v, d); + + // #if %EXTRAV2F0REQUIREKEY% + // v2p.extraV2F0 = d.extraV2F0; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // v2p.extraV2F1 = d.extraV2F1; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // v2p.extraV2F2 = d.extraV2F2; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // v2p.extraV2F3 = d.extraV2F3; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // v2p.extraV2F4 = d.extraV2F4; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // v2p.extraV2F5 = d.extraV2F5; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // v2p.extraV2F6 = d.extraV2F6; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // v2p.extraV2F7 = d.extraV2F7; + // #endif + } + + void ChainFinalColorForward(inout Surface l, inout ShaderData d, inout half4 color) + { + // Ext_FinalColorForward0(l, d, color); + // Ext_FinalColorForward1(l, d, color); + // Ext_FinalColorForward2(l, d, color); + // Ext_FinalColorForward3(l, d, color); + // Ext_FinalColorForward4(l, d, color); + // Ext_FinalColorForward5(l, d, color); + // Ext_FinalColorForward6(l, d, color); + // Ext_FinalColorForward7(l, d, color); + // Ext_FinalColorForward8(l, d, color); + // Ext_FinalColorForward9(l, d, color); + // Ext_FinalColorForward10(l, d, color); + // Ext_FinalColorForward11(l, d, color); + // Ext_FinalColorForward12(l, d, color); + // Ext_FinalColorForward13(l, d, color); + // Ext_FinalColorForward14(l, d, color); + // Ext_FinalColorForward15(l, d, color); + // Ext_FinalColorForward16(l, d, color); + // Ext_FinalColorForward17(l, d, color); + // Ext_FinalColorForward18(l, d, color); + // Ext_FinalColorForward19(l, d, color); + // Ext_FinalColorForward20(l, d, color); + // Ext_FinalColorForward21(l, d, color); + // Ext_FinalColorForward22(l, d, color); + // Ext_FinalColorForward23(l, d, color); + // Ext_FinalColorForward24(l, d, color); + // Ext_FinalColorForward25(l, d, color); + // Ext_FinalColorForward26(l, d, color); + // Ext_FinalColorForward27(l, d, color); + // Ext_FinalColorForward28(l, d, color); + // Ext_FinalColorForward29(l, d, color); + } + + void ChainFinalGBufferStandard(inout Surface s, inout ShaderData d, inout half4 GBuffer0, inout half4 GBuffer1, inout half4 GBuffer2, inout half4 outEmission, inout half4 outShadowMask) + { + // Ext_FinalGBufferStandard0(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard1(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard2(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard3(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard4(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard5(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard6(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard7(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard8(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard9(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard10(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard11(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard12(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard13(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard14(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard15(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard16(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard17(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard18(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard19(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard20(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard21(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard22(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard23(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard24(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard25(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard26(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard27(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard28(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard29(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + } +#endif + + + + + +#if _DECALSHADER + + ShaderData CreateShaderData(SurfaceDescriptionInputs IN) + { + ShaderData d = (ShaderData)0; + d.TBNMatrix = float3x3(IN.WorldSpaceTangent, IN.WorldSpaceBiTangent, IN.WorldSpaceNormal); + d.worldSpaceNormal = IN.WorldSpaceNormal; + d.worldSpaceTangent = IN.WorldSpaceTangent; + + d.worldSpacePosition = IN.WorldSpacePosition; + d.texcoord0 = IN.uv0.xyxy; + d.screenPos = IN.ScreenPosition; + + d.worldSpaceViewDir = normalize(_WorldSpaceCameraPos - d.worldSpacePosition); + + d.tangentSpaceViewDir = mul(d.TBNMatrix, d.worldSpaceViewDir); + + // these rarely get used, so we back transform them. Usually will be stripped. + #if _HDRP + // d.localSpacePosition = mul(GetWorldToObjectMatrix(), float4(GetCameraRelativePositionWS(d.worldSpacePosition), 1)).xyz; + #else + // d.localSpacePosition = mul(GetWorldToObjectMatrix(), float4(d.worldSpacePosition, 1)).xyz; + #endif + // d.localSpaceNormal = normalize(mul((float3x3)GetWorldToObjectMatrix(), d.worldSpaceNormal)); + // d.localSpaceTangent = normalize(mul((float3x3)GetWorldToObjectMatrix(), d.worldSpaceTangent.xyz)); + + // #if %SCREENPOSREQUIREKEY% + // d.screenUV = (IN.ScreenPosition.xy / max(0.01, IN.ScreenPosition.w)); + // #endif + + return d; + } +#else + + ShaderData CreateShaderData(VertexToPixel i + #if NEED_FACING + , bool facing + #endif + ) + { + ShaderData d = (ShaderData)0; + d.clipPos = i.pos; + d.worldSpacePosition = i.worldPos; + + d.worldSpaceNormal = normalize(i.worldNormal); + d.worldSpaceTangent.xyz = normalize(i.worldTangent.xyz); + + d.tangentSign = i.worldTangent.w * unity_WorldTransformParams.w; + float3 bitangent = cross(d.worldSpaceTangent.xyz, d.worldSpaceNormal) * d.tangentSign; + + d.TBNMatrix = float3x3(d.worldSpaceTangent, -bitangent, d.worldSpaceNormal); + d.worldSpaceViewDir = normalize(_WorldSpaceCameraPos - i.worldPos); + + d.tangentSpaceViewDir = mul(d.TBNMatrix, d.worldSpaceViewDir); + d.texcoord0 = i.texcoord0; + d.texcoord1 = i.texcoord1; + d.texcoord2 = i.texcoord2; + + // #if %TEXCOORD3REQUIREKEY% + d.texcoord3 = i.texcoord3; + // #endif + + // d.isFrontFace = facing; + // #if %VERTEXCOLORREQUIREKEY% + d.vertexColor = i.vertexColor; + // #endif + + // these rarely get used, so we back transform them. Usually will be stripped. + #if _HDRP + // d.localSpacePosition = mul(GetWorldToObjectMatrix(), float4(GetCameraRelativePositionWS(i.worldPos), 1)).xyz; + #else + // d.localSpacePosition = mul(GetWorldToObjectMatrix(), float4(i.worldPos, 1)).xyz; + #endif + // d.localSpaceNormal = normalize(mul((float3x3)GetWorldToObjectMatrix(), i.worldNormal)); + // d.localSpaceTangent = normalize(mul((float3x3)GetWorldToObjectMatrix(), i.worldTangent.xyz)); + + // #if %SCREENPOSREQUIREKEY% + // d.screenPos = i.screenPos; + // d.screenUV = (i.screenPos.xy / i.screenPos.w); + // #endif + + + // #if %EXTRAV2F0REQUIREKEY% + // d.extraV2F0 = i.extraV2F0; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // d.extraV2F1 = i.extraV2F1; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // d.extraV2F2 = i.extraV2F2; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // d.extraV2F3 = i.extraV2F3; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // d.extraV2F4 = i.extraV2F4; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // d.extraV2F5 = i.extraV2F5; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // d.extraV2F6 = i.extraV2F6; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // d.extraV2F7 = i.extraV2F7; + // #endif + + return d; + } + +#endif + + + +struct VaryingsToPS +{ + VertexToPixel vmesh; + #ifdef VARYINGS_NEED_PASS + VaryingsPassToPS vpass; + #endif +}; + +struct PackedVaryingsToPS +{ + #ifdef VARYINGS_NEED_PASS + PackedVaryingsPassToPS vpass; + #endif + VertexToPixel vmesh; + + UNITY_VERTEX_OUTPUT_STEREO +}; + +PackedVaryingsToPS PackVaryingsToPS(VaryingsToPS input) +{ + PackedVaryingsToPS output = (PackedVaryingsToPS)0; + output.vmesh = input.vmesh; + #ifdef VARYINGS_NEED_PASS + output.vpass = PackVaryingsPassToPS(input.vpass); + #endif + + UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(output); + return output; +} + + + + +VertexToPixel VertMesh(VertexData input) +{ + VertexToPixel output = (VertexToPixel)0; + + UNITY_SETUP_INSTANCE_ID(input); + UNITY_TRANSFER_INSTANCE_ID(input, output); + + + ChainModifyVertex(input, output, _Time); + + + // This return the camera relative position (if enable) + float3 positionRWS = TransformObjectToWorld(input.vertex.xyz); + float3 normalWS = TransformObjectToWorldNormal(input.normal); + float4 tangentWS = float4(TransformObjectToWorldDir(input.tangent.xyz), input.tangent.w); + + + output.worldPos = GetAbsolutePositionWS(positionRWS); + output.pos = TransformWorldToHClip(positionRWS); + output.worldNormal = normalWS; + output.worldTangent = tangentWS; + + + output.texcoord0 = input.texcoord0; + output.texcoord1 = input.texcoord1; + output.texcoord2 = input.texcoord2; + // #if %TEXCOORD3REQUIREKEY% + output.texcoord3 = input.texcoord3; + // #endif + + // #if %SCREENPOSREQUIREKEY% + // output.screenPos = ComputeScreenPos(output.pos, _ProjectionParams.x); + // #endif + + // #if %VERTEXCOLORREQUIREKEY% + output.vertexColor = input.vertexColor; + // #endif + return output; +} + + +#if (SHADERPASS == SHADERPASS_DBUFFER_MESH) +void MeshDecalsPositionZBias(inout VaryingsToPS input) +{ +#if defined(UNITY_REVERSED_Z) + input.vmesh.pos.z -= _DecalMeshDepthBias; +#else + input.vmesh.pos.z += _DecalMeshDepthBias; +#endif +} +#endif + + +#if (SHADERPASS == SHADERPASS_LIGHT_TRANSPORT) + +// This was not in constant buffer in original unity, so keep outiside. But should be in as ShaderRenderPass frequency +float unity_OneOverOutputBoost; +float unity_MaxOutputValue; + +CBUFFER_START(UnityMetaPass) +// x = use uv1 as raster position +// y = use uv2 as raster position +bool4 unity_MetaVertexControl; + +// x = return albedo +// y = return normal +bool4 unity_MetaFragmentControl; +CBUFFER_END + +PackedVaryingsToPS Vert(VertexData inputMesh) +{ + VaryingsToPS output = (VaryingsToPS)0; + output.vmesh = (VertexToPixel)0; + + UNITY_SETUP_INSTANCE_ID(inputMesh); + UNITY_TRANSFER_INSTANCE_ID(inputMesh, output.vmesh); + + // Output UV coordinate in vertex shader + float2 uv = float2(0.0, 0.0); + + if (unity_MetaVertexControl.x) + { + uv = inputMesh.texcoord1.xy * unity_LightmapST.xy + unity_LightmapST.zw; + } + else if (unity_MetaVertexControl.y) + { + uv = inputMesh.texcoord2.xy * unity_DynamicLightmapST.xy + unity_DynamicLightmapST.zw; + } + + // OpenGL right now needs to actually use the incoming vertex position + // so we create a fake dependency on it here that haven't any impact. + output.vmesh.pos = float4(uv * 2.0 - 1.0, inputMesh.vertex.z > 0 ? 1.0e-4 : 0.0, 1.0); + +#ifdef VARYINGS_NEED_POSITION_WS + output.vmesh.worldPos = TransformObjectToWorld(inputMesh.vertex.xyz); +#endif + +#ifdef VARYINGS_NEED_TANGENT_TO_WORLD + // Normal is required for triplanar mapping + output.vmesh.worldNormal = TransformObjectToWorldNormal(inputMesh.normal); + // Not required but assign to silent compiler warning + output.vmesh.worldTangent = float4(1.0, 0.0, 0.0, 0.0); +#endif + + output.vmesh.texcoord0 = inputMesh.texcoord0; + output.vmesh.texcoord1 = inputMesh.texcoord1; + output.vmesh.texcoord2 = inputMesh.texcoord2; + // #if %TEXCOORD3REQUIREKEY% + output.vmesh.texcoord3 = inputMesh.texcoord3; + // #endif + + // #if %VERTEXCOLORREQUIREKEY% + output.vmesh.vertexColor = inputMesh.vertexColor; + // #endif + + return PackVaryingsToPS(output); +} +#else + +PackedVaryingsToPS Vert(VertexData inputMesh) +{ + VaryingsToPS varyingsType; + varyingsType.vmesh = VertMesh(inputMesh); + #if (SHADERPASS == SHADERPASS_DBUFFER_MESH) + MeshDecalsPositionZBias(varyingsType); + #endif + return PackVaryingsToPS(varyingsType); +} + +#endif + + + + + + + FragInputs BuildFragInputs(VertexToPixel input) + { + UNITY_SETUP_INSTANCE_ID(input); + FragInputs output; + ZERO_INITIALIZE(FragInputs, output); + + // Init to some default value to make the computer quiet (else it output 'divide by zero' warning even if value is not used). + // TODO: this is a really poor workaround, but the variable is used in a bunch of places + // to compute normals which are then passed on elsewhere to compute other values... + output.tangentToWorld = k_identity3x3; + output.positionSS = input.pos; // input.positionCS is SV_Position + + output.positionRWS = GetCameraRelativePositionWS(input.worldPos); + output.tangentToWorld = BuildTangentToWorld(input.worldTangent, input.worldNormal); + output.texCoord0 = input.texcoord0; + output.texCoord1 = input.texcoord1; + output.texCoord2 = input.texcoord2; + + return output; + } + + void BuildSurfaceData(FragInputs fragInputs, inout Surface surfaceDescription, float3 V, PositionInputs posInput, out SurfaceData surfaceData, out float3 bentNormalWS) + { + // setup defaults -- these are used if the graph doesn't output a value + ZERO_INITIALIZE(SurfaceData, surfaceData); + + // specularOcclusion need to be init ahead of decal to quiet the compiler that modify the SurfaceData struct + // however specularOcclusion can come from the graph, so need to be init here so it can be override. + surfaceData.specularOcclusion = 1.0; + + // copy across graph values, if defined + surfaceData.baseColor = surfaceDescription.Albedo; + surfaceData.perceptualSmoothness = surfaceDescription.Smoothness; + surfaceData.ambientOcclusion = surfaceDescription.Occlusion; + surfaceData.specularOcclusion = surfaceDescription.SpecularOcclusion; + surfaceData.metallic = surfaceDescription.Metallic; + surfaceData.subsurfaceMask = surfaceDescription.SubsurfaceMask; + surfaceData.thickness = surfaceDescription.Thickness; + surfaceData.diffusionProfileHash = asuint(surfaceDescription.DiffusionProfileHash); + #if _USESPECULAR + surfaceData.specularColor = surfaceDescription.Specular; + #endif + surfaceData.coatMask = surfaceDescription.CoatMask; + surfaceData.anisotropy = surfaceDescription.Anisotropy; + surfaceData.iridescenceMask = surfaceDescription.IridescenceMask; + surfaceData.iridescenceThickness = surfaceDescription.IridescenceThickness; + + #ifdef _HAS_REFRACTION + if (_EnableSSRefraction) + { + // surfaceData.ior = surfaceDescription.RefractionIndex; + // surfaceData.transmittanceColor = surfaceDescription.RefractionColor; + // surfaceData.atDistance = surfaceDescription.RefractionDistance; + + surfaceData.transmittanceMask = (1.0 - surfaceDescription.Alpha); + surfaceDescription.Alpha = 1.0; + } + else + { + surfaceData.ior = surfaceDescription.ior; + surfaceData.transmittanceColor = surfaceDescription.transmittanceColor; + surfaceData.atDistance = surfaceDescription.atDistance; + surfaceData.transmittanceMask = surfaceDescription.transmittanceMask; + surfaceDescription.Alpha = 1.0; + } + #else + surfaceData.ior = 1.0; + surfaceData.transmittanceColor = float3(1.0, 1.0, 1.0); + surfaceData.atDistance = 1.0; + surfaceData.transmittanceMask = 0.0; + #endif + + // These static material feature allow compile time optimization + surfaceData.materialFeatures = MATERIALFEATUREFLAGS_LIT_STANDARD; + #ifdef _MATERIAL_FEATURE_SUBSURFACE_SCATTERING + surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_SUBSURFACE_SCATTERING; + #endif + #ifdef _MATERIAL_FEATURE_TRANSMISSION + surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_TRANSMISSION; + #endif + #ifdef _MATERIAL_FEATURE_ANISOTROPY + surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_ANISOTROPY; + #endif + // surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_CLEAR_COAT; + + #ifdef _MATERIAL_FEATURE_IRIDESCENCE + surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_IRIDESCENCE; + #endif + #ifdef _MATERIAL_FEATURE_SPECULAR_COLOR + surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_SPECULAR_COLOR; + #endif + + #if defined (_MATERIAL_FEATURE_SPECULAR_COLOR) && defined (_ENERGY_CONSERVING_SPECULAR) + // Require to have setup baseColor + // Reproduce the energy conservation done in legacy Unity. Not ideal but better for compatibility and users can unchek it + surfaceData.baseColor *= (1.0 - Max3(surfaceData.specularColor.r, surfaceData.specularColor.g, surfaceData.specularColor.b)); + #endif + + + // tangent-space normal + float3 normalTS = float3(0.0f, 0.0f, 1.0f); + normalTS = surfaceDescription.Normal; + + // compute world space normal + #if !_WORLDSPACENORMAL + surfaceData.normalWS = mul(normalTS, fragInputs.tangentToWorld); + #else + surfaceData.normalWS = normalTS; + #endif + surfaceData.geomNormalWS = fragInputs.tangentToWorld[2]; + + surfaceData.tangentWS = normalize(fragInputs.tangentToWorld[0].xyz); // The tangent is not normalize in tangentToWorld for mikkt. TODO: Check if it expected that we normalize with Morten. Tag: SURFACE_GRADIENT + // surfaceData.tangentWS = TransformTangentToWorld(surfaceDescription.Tangent, fragInputs.tangentToWorld); + + #if HAVE_DECALS + if (_EnableDecals) + { + #if VERSION_GREATER_EQUAL(10,2) + DecalSurfaceData decalSurfaceData = GetDecalSurfaceData(posInput, surfaceData.geomNormalWS, surfaceDescription.Alpha); + ApplyDecalToSurfaceData(decalSurfaceData, surfaceData.geomNormalWS, surfaceData); + #else + DecalSurfaceData decalSurfaceData = GetDecalSurfaceData(posInput, surfaceDescription.Alpha); + ApplyDecalToSurfaceData(decalSurfaceData, surfaceData); + #endif + } + #endif + + bentNormalWS = surfaceData.normalWS; + + surfaceData.tangentWS = Orthonormalize(surfaceData.tangentWS, surfaceData.normalWS); + + + // By default we use the ambient occlusion with Tri-ace trick (apply outside) for specular occlusion. + // If user provide bent normal then we process a better term + #if defined(_SPECULAR_OCCLUSION_CUSTOM) + // Just use the value passed through via the slot (not active otherwise) + #elif defined(_SPECULAR_OCCLUSION_FROM_AO_BENT_NORMAL) + // If we have bent normal and ambient occlusion, process a specular occlusion + surfaceData.specularOcclusion = GetSpecularOcclusionFromBentAO(V, bentNormalWS, surfaceData.normalWS, surfaceData.ambientOcclusion, PerceptualSmoothnessToPerceptualRoughness(surfaceData.perceptualSmoothness)); + #elif defined(_AMBIENT_OCCLUSION) && defined(_SPECULAR_OCCLUSION_FROM_AO) + surfaceData.specularOcclusion = GetSpecularOcclusionFromAmbientOcclusion(ClampNdotV(dot(surfaceData.normalWS, V)), surfaceData.ambientOcclusion, PerceptualSmoothnessToRoughness(surfaceData.perceptualSmoothness)); + #endif + + #ifdef _ENABLE_GEOMETRIC_SPECULAR_AA + surfaceData.perceptualSmoothness = GeometricNormalFiltering(surfaceData.perceptualSmoothness, fragInputs.tangentToWorld[2], surfaceDescription.SpecularAAScreenSpaceVariance, surfaceDescription.SpecularAAThreshold); + #endif + + #ifdef DEBUG_DISPLAY + if (_DebugMipMapMode != DEBUGMIPMAPMODE_NONE) + { + // TODO: need to update mip info + surfaceData.metallic = 0; + } + + // We need to call ApplyDebugToSurfaceData after filling the surfarcedata and before filling builtinData + // as it can modify attribute use for static lighting + ApplyDebugToSurfaceData(fragInputs.tangentToWorld, surfaceData); + #endif + } + + void GetSurfaceAndBuiltinData(VertexToPixel m2ps, FragInputs fragInputs, float3 V, inout PositionInputs posInput, + out SurfaceData surfaceData, out BuiltinData builtinData, inout Surface l, inout ShaderData d + #if NEED_FACING + , bool facing + #endif + ) + { + // Removed since crossfade does not work, probably needs extra material setup. + //#ifdef LOD_FADE_CROSSFADE // enable dithering LOD transition if user select CrossFade transition in LOD group + // uint3 fadeMaskSeed = asuint((int3)(V * _ScreenSize.xyx)); // Quantize V to _ScreenSize values + // LODDitheringTransition(fadeMaskSeed, unity_LODFade.x); + //#endif + + d = CreateShaderData(m2ps + #if NEED_FACING + , facing + #endif + ); + + + + l = (Surface)0; + + l.Albedo = half3(0.5, 0.5, 0.5); + l.Normal = float3(0,0,1); + l.Occlusion = 1; + l.Alpha = 1; + l.SpecularOcclusion = 1; + + #ifdef _DEPTHOFFSET_ON + l.outputDepth = posInput.deviceDepth; + #endif + + ChainSurfaceFunction(l, d); + + #ifdef _DEPTHOFFSET_ON + posInput.deviceDepth = l.outputDepth; + #endif + + #if _UNLIT + //l.Emission = l.Albedo; + //l.Albedo = 0; + l.Normal = half3(0,0,1); + l.Occlusion = 1; + l.Metallic = 0; + l.Specular = 0; + #endif + + surfaceData.geomNormalWS = d.worldSpaceNormal; + surfaceData.tangentWS = d.worldSpaceTangent; + fragInputs.tangentToWorld = d.TBNMatrix; + + float3 bentNormalWS; + BuildSurfaceData(fragInputs, l, V, posInput, surfaceData, bentNormalWS); + + InitBuiltinData(posInput, l.Alpha, bentNormalWS, -d.worldSpaceNormal, fragInputs.texCoord1, fragInputs.texCoord2, builtinData); + + + + builtinData.emissiveColor = l.Emission; + + #if defined(_OVERRIDE_BAKEDGI) + builtinData.bakeDiffuseLighting = l.DiffuseGI; + builtinData.backBakeDiffuseLighting = l.BackDiffuseGI; + builtinData.emissiveColor += l.SpecularGI; + #endif + + #if defined(_OVERRIDE_SHADOWMASK) + builtinData.shadowMask0 = l.ShadowMask.x; + builtinData.shadowMask1 = l.ShadowMask.y; + builtinData.shadowMask2 = l.ShadowMask.z; + builtinData.shadowMask3 = l.ShadowMask.w; + #endif + + #if (SHADERPASS == SHADERPASS_DISTORTION) + //builtinData.distortion = surfaceDescription.Distortion; + //builtinData.distortionBlur = surfaceDescription.DistortionBlur; + builtinData.distortion = float2(0.0, 0.0); + builtinData.distortionBlur = 0.0; + #else + builtinData.distortion = float2(0.0, 0.0); + builtinData.distortionBlur = 0.0; + #endif + + PostInitBuiltinData(V, posInput, surfaceData, builtinData); + } + + + + void Frag( PackedVaryingsToPS packedInput + #ifdef WRITE_NORMAL_BUFFER + , out float4 outNormalBuffer : SV_Target0 + #ifdef WRITE_MSAA_DEPTH + , out float1 depthColor : SV_Target1 + #endif + #elif defined(WRITE_MSAA_DEPTH) // When only WRITE_MSAA_DEPTH is define and not WRITE_NORMAL_BUFFER it mean we are Unlit and only need depth, but we still have normal buffer binded + , out float4 outNormalBuffer : SV_Target0 + , out float1 depthColor : SV_Target1 + #elif defined(SCENESELECTIONPASS) + , out float4 outColor : SV_Target0 + #endif + + #ifdef _DEPTHOFFSET_ON + , out float outputDepth : SV_Depth + #endif + #if NEED_FACING + , bool facing : SV_IsFrontFace + #endif + ) + { + UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX(packedInput); + FragInputs input = BuildFragInputs(packedInput.vmesh); + + // input.positionSS is SV_Position + PositionInputs posInput = GetPositionInput(input.positionSS.xy, _ScreenSize.zw, input.positionSS.z, input.positionSS.w, input.positionRWS); + + float3 V = GetWorldSpaceNormalizeViewDir(input.positionRWS); + + SurfaceData surfaceData; + BuiltinData builtinData; + Surface l; + ShaderData d; + GetSurfaceAndBuiltinData(packedInput.vmesh, input, V, posInput, surfaceData, builtinData, l, d + #if NEED_FACING + , facing + #endif + ); + + + #ifdef _DEPTHOFFSET_ON + outputDepth = posInput.deviceDepth; + #endif + + #ifdef WRITE_NORMAL_BUFFER + EncodeIntoNormalBuffer(ConvertSurfaceDataToNormalData(surfaceData), posInput.positionSS, outNormalBuffer); + #ifdef WRITE_MSAA_DEPTH + // In case we are rendering in MSAA, reading the an MSAA depth buffer is way too expensive. To avoid that, we export the depth to a color buffer + depthColor = packedInput.vmesh.pos.z; + #endif + #elif defined(WRITE_MSAA_DEPTH) // When we are MSAA depth only without normal buffer + // Due to the binding order of these two render targets, we need to have them both declared + outNormalBuffer = float4(0.0, 0.0, 0.0, 1.0); + // In case we are rendering in MSAA, reading the an MSAA depth buffer is way too expensive. To avoid that, we export the depth to a color buffer + depthColor = packedInput.vmesh.pos.z; + #elif defined(SCENESELECTIONPASS) + // We use depth prepass for scene selection in the editor, this code allow to output the outline correctly + outColor = float4(_ObjectId, _PassValue, 1.0, 1.0); + #endif + } + + ENDHLSL + } + + + Pass + { + // based on HDLitPass.template + Name "DepthOnly" + Tags { "LightMode" = "DepthOnly" } + + //------------------------------------------------------------------------------------- + // Render Modes (Blend, Cull, ZTest, Stencil, etc) + //------------------------------------------------------------------------------------- + + Cull Back + + + ZWrite On + + + // Stencil setup + Stencil + { + WriteMask [_StencilWriteMaskDepth] + Ref [_StencilRefDepth] + Comp Always + Pass Replace + } + Tags { "RenderType" = "Opaque" "Queue" = "Geometry" "PreviewType" = "Plane" } + Cull [_CullingOption] + ZWrite [_ZWrite] + ZTest [_ZTestMode] + + + //------------------------------------------------------------------------------------- + // End Render Modes + //------------------------------------------------------------------------------------- + + HLSLPROGRAM + + #pragma target 4.5 + #pragma only_renderers d3d11 ps4 xboxone vulkan metal switch + //#pragma enable_d3d11_debug_symbols + + #pragma multi_compile_instancing + + //#pragma multi_compile_local _ _ALPHATEST_ON + + // #pragma multi_compile _ LOD_FADE_CROSSFADE + + //#pragma shader_feature _SURFACE_TYPE_TRANSPARENT + //#pragma shader_feature_local _ _BLENDMODE_ALPHA _BLENDMODE_ADD _BLENDMODE_PRE_MULTIPLY + + //------------------------------------------------------------------------------------- + // Variant Definitions (active field translations to HDRP defines) + //------------------------------------------------------------------------------------- + // #define _MATERIAL_FEATURE_SUBSURFACE_SCATTERING 1 + // #define _MATERIAL_FEATURE_TRANSMISSION 1 + // #define _MATERIAL_FEATURE_ANISOTROPY 1 + // #define _MATERIAL_FEATURE_IRIDESCENCE 1 + // #define _MATERIAL_FEATURE_SPECULAR_COLOR 1 + #define _ENABLE_FOG_ON_TRANSPARENT 1 + // #define _AMBIENT_OCCLUSION 1 + // #define _SPECULAR_OCCLUSION_FROM_AO 1 + // #define _SPECULAR_OCCLUSION_FROM_AO_BENT_NORMAL 1 + // #define _SPECULAR_OCCLUSION_CUSTOM 1 + // #define _ENERGY_CONSERVING_SPECULAR 1 + // #define _ENABLE_GEOMETRIC_SPECULAR_AA 1 + // #define _HAS_REFRACTION 1 + // #define _REFRACTION_PLANE 1 + // #define _REFRACTION_SPHERE 1 + // #define _DISABLE_DECALS 1 + // #define _DISABLE_SSR 1 + // #define _ADD_PRECOMPUTED_VELOCITY + // #define _WRITE_TRANSPARENT_MOTION_VECTOR 1 + // #define _DEPTHOFFSET_ON 1 + // #define _BLENDMODE_PRESERVE_SPECULAR_LIGHTING 1 + + #define SHADERPASS SHADERPASS_DEPTH_ONLY + #pragma multi_compile _ WRITE_NORMAL_BUFFER + #pragma multi_compile _ WRITE_MSAA_DEPTH + #define RAYTRACING_SHADER_GRAPH_HIGH + #define _PASSDEPTH 1 + + + + #pragma shader_feature_local GLOW_ON + #pragma shader_feature_local FADE_ON + #pragma shader_feature_local OUTBASE_ON + #pragma shader_feature_local ONLYOUTLINE_ON + #pragma shader_feature_local GRADIENT_ON + #pragma shader_feature_local GRADIENT2COL_ON + #pragma shader_feature_local RADIALGRADIENT_ON + #pragma shader_feature_local COLORSWAP_ON + #pragma shader_feature_local HSV_ON + #pragma shader_feature_local CHANGECOLOR_ON + #pragma shader_feature_local CHANGECOLOR2_ON + #pragma shader_feature_local CHANGECOLOR3_ON + #pragma shader_feature_local COLORRAMP_ON + #pragma shader_feature_local GRADIENTCOLORRAMP_ON + #pragma shader_feature_local HITEFFECT_ON + #pragma shader_feature_local NEGATIVE_ON + #pragma shader_feature_local PIXELATE_ON + #pragma shader_feature_local GREYSCALE_ON + #pragma shader_feature_local POSTERIZE_ON + #pragma shader_feature_local BLUR_ON + #pragma shader_feature_local MOTIONBLUR_ON + #pragma shader_feature_local GHOST_ON + #pragma shader_feature_local ALPHAOUTLINE_ON + #pragma shader_feature_local INNEROUTLINE_ON + #pragma shader_feature_local ONLYINNEROUTLINE_ON + #pragma shader_feature_local HOLOGRAM_ON + #pragma shader_feature_local CHROMABERR_ON + #pragma shader_feature_local GLITCH_ON + #pragma shader_feature_local FLICKER_ON + #pragma shader_feature_local SHADOW_ON + #pragma shader_feature_local SHINE_ON + #pragma shader_feature_local CONTRAST_ON + #pragma shader_feature_local OVERLAY_ON + #pragma shader_feature_local OVERLAYMULT_ON + #pragma shader_feature_local DOODLE_ON + #pragma shader_feature_local WIND_ON + #pragma shader_feature_local WAVEUV_ON + #pragma shader_feature_local ROUNDWAVEUV_ON + #pragma shader_feature_local RECTSIZE_ON + #pragma shader_feature_local OFFSETUV_ON + #pragma shader_feature_local CLIPPING_ON + #pragma shader_feature_local RADIALCLIPPING_ON + #pragma shader_feature_local TEXTURESCROLL_ON + #pragma shader_feature_local ZOOMUV_ON + #pragma shader_feature_local DISTORT_ON + #pragma shader_feature_local WARP_ON + #pragma shader_feature_local TWISTUV_ON + #pragma shader_feature_local ROTATEUV_ON + #pragma shader_feature_local POLARUV_ON + #pragma shader_feature_local FISHEYE_ON + #pragma shader_feature_local PINCH_ON + #pragma shader_feature_local SHAKEUV_ON + + #pragma shader_feature_local GLOWTEX_ON + #pragma shader_feature_local OUTTEX_ON + #pragma shader_feature_local OUTDIST_ON + #pragma shader_feature_local OUTBASE8DIR_ON + #pragma shader_feature_local OUTBASEPIXELPERF_ON + #pragma shader_feature_local COLORRAMPOUTLINE_ON + #pragma shader_feature_local GREYSCALEOUTLINE_ON + #pragma shader_feature_local POSTERIZEOUTLINE_ON + #pragma shader_feature_local BLURISHD_ON + #pragma shader_feature_local MANUALWIND_ON + #pragma shader_feature_local ATLAS_ON + #pragma shader_feature_local PREMULTIPLYALPHA_ON + + #pragma shader_feature BILBOARD_ON + #pragma shader_feature BILBOARDY_ON + + #pragma shader_feature NORMALMAP_ON + + + #define _HDRP 1 +#define _USINGTEXCOORD1 1 +#define _USINGTEXCOORD2 1 + + + #pragma vertex Vert + #pragma fragment Frag + + + + // useful conversion functions to make surface shader code just work + + #define UNITY_DECLARE_TEX2D(name) TEXTURE2D(name); SAMPLER(sampler##name); + #define UNITY_DECLARE_TEX2D_NOSAMPLER(name) TEXTURE2D(name); + #define UNITY_DECLARE_TEX2DARRAY(name) TEXTURE2D_ARRAY(name); SAMPLER(sampler##name); + #define UNITY_DECLARE_TEX2DARRAY_NOSAMPLER(tex) TEXTURE2D_ARRAY(tex); + + #define UNITY_SAMPLE_TEX2DARRAY(tex,coord) SAMPLE_TEXTURE2D_ARRAY(tex, sampler##tex, coord.xy, coord.z) + #define UNITY_SAMPLE_TEX2DARRAY_LOD(tex,coord,lod) SAMPLE_TEXTURE2D_ARRAY_LOD(tex, sampler##tex, coord.xy, coord.z, lod) + #define UNITY_SAMPLE_TEX2D(tex, coord) SAMPLE_TEXTURE2D(tex, sampler##tex, coord) + #define UNITY_SAMPLE_TEX2D_SAMPLER(tex, samp, coord) SAMPLE_TEXTURE2D(tex, sampler##samp, coord) + + #define UNITY_SAMPLE_TEX2D_LOD(tex,coord, lod) SAMPLE_TEXTURE2D_LOD(tex, sampler_##tex, coord, lod) + #define UNITY_SAMPLE_TEX2D_SAMPLER_LOD(tex,samplertex,coord, lod) SAMPLE_TEXTURE2D_LOD (tex, sampler##samplertex,coord, lod) + + #if defined(UNITY_COMPILER_HLSL) + #define UNITY_INITIALIZE_OUTPUT(type,name) name = (type)0; + #else + #define UNITY_INITIALIZE_OUTPUT(type,name) + #endif + + #define sampler2D_float sampler2D + #define sampler2D_half sampler2D + + #undef WorldNormalVector + #define WorldNormalVector(data, normal) mul(normal, data.TBNMatrix) + + #define UnityObjectToWorldNormal(normal) mul(GetObjectToWorldMatrix(), normal) + + + + +// HDRP Adapter stuff + + + // If we use subsurface scattering, enable output split lighting (for forward pass) + #if defined(_MATERIAL_FEATURE_SUBSURFACE_SCATTERING) && !defined(_SURFACE_TYPE_TRANSPARENT) + #define OUTPUT_SPLIT_LIGHTING + #endif + + #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Version.hlsl" + #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Common.hlsl" + + #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/NormalSurfaceGradient.hlsl" + + // define FragInputs structure + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/ShaderPass/FragInputs.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/ShaderPass/ShaderPass.cs.hlsl" + #if (SHADER_LIBRARY_VERSION_MAJOR >= 10) + #include "Packages/com.unity.shadergraph/ShaderGraphLibrary/Functions.hlsl" + #endif + + + + + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/ShaderVariables.hlsl" + #ifdef DEBUG_DISPLAY + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Debug/DebugDisplay.hlsl" + #endif + + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/Material.hlsl" + + #if (SHADERPASS == SHADERPASS_FORWARD) + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Lighting/Lighting.hlsl" + + #define HAS_LIGHTLOOP + + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Lighting/LightLoop/LightLoopDef.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/Lit/Lit.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Lighting/LightLoop/LightLoop.hlsl" + #else + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/Lit/Lit.hlsl" + #endif + + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/BuiltinUtilities.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/MaterialUtilities.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/Decal/DecalUtilities.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/Lit/LitDecalData.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/ShaderGraphFunctions.hlsl" + + // Used by SceneSelectionPass + int _ObjectId; + int _PassValue; + + + // data across stages, stripped like the above. + struct VertexToPixel + { + float4 pos : SV_POSITION; + float3 worldPos : TEXCOORD0; + float3 worldNormal : TEXCOORD1; + float4 worldTangent : TEXCOORD2; + float4 texcoord0 : TEXCOORD3; + float4 texcoord1 : TEXCOORD4; + float4 texcoord2 : TEXCOORD5; + + // #if %TEXCOORD3REQUIREKEY% + float4 texcoord3 : TEXCOORD6; + // #endif + + // #if %SCREENPOSREQUIREKEY% + // float4 screenPos : TEXCOORD7; + // #endif + + // #if %VERTEXCOLORREQUIREKEY% + float4 vertexColor : COLOR; + // #endif + + // #if %EXTRAV2F0REQUIREKEY% + // float4 extraV2F0 : TEXCOORD8; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // float4 extraV2F1 : TEXCOORD9; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // float4 extraV2F2 : TEXCOORD10; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // float4 extraV2F3 : TEXCOORD11; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // float4 extraV2F4 : TEXCOORD12; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // float4 extraV2F5 : TEXCOORD13; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // float4 extraV2F6 : TEXCOORD14; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // float4 extraV2F7 : TEXCOORD15; + // #endif + + #if UNITY_ANY_INSTANCING_ENABLED + UNITY_VERTEX_INPUT_INSTANCE_ID + #endif // UNITY_ANY_INSTANCING_ENABLED + + UNITY_VERTEX_OUTPUT_STEREO + }; + + + + + + // data describing the user output of a pixel + struct Surface + { + half3 Albedo; + half Height; + half3 Normal; + half Smoothness; + half3 Emission; + half Metallic; + half3 Specular; + half Occlusion; + half SpecularPower; // for simple lighting + half Alpha; + float outputDepth; // if written, SV_Depth semantic is used. ShaderData.clipPos.z is unused value + // HDRP Only + half SpecularOcclusion; + half SubsurfaceMask; + half Thickness; + half CoatMask; + half CoatSmoothness; + half Anisotropy; + half IridescenceMask; + half IridescenceThickness; + int DiffusionProfileHash; + float SpecularAAThreshold; + float SpecularAAScreenSpaceVariance; + // requires _OVERRIDE_BAKEDGI to be defined, but is mapped in all pipelines + float3 DiffuseGI; + float3 BackDiffuseGI; + float3 SpecularGI; + float ior; + float3 transmittanceColor; + float atDistance; + float transmittanceMask; + // requires _OVERRIDE_SHADOWMASK to be defines + float4 ShadowMask; + + // for decals + float NormalAlpha; + float MAOSAlpha; + + + }; + + // Data the user declares in blackboard blocks + struct Blackboard + { + + float blackboardDummyData; + }; + + // data the user might need, this will grow to be big. But easy to strip + struct ShaderData + { + float4 clipPos; // SV_POSITION + float3 localSpacePosition; + float3 localSpaceNormal; + float3 localSpaceTangent; + + float3 worldSpacePosition; + float3 worldSpaceNormal; + float3 worldSpaceTangent; + float tangentSign; + + float3 worldSpaceViewDir; + float3 tangentSpaceViewDir; + + float4 texcoord0; + float4 texcoord1; + float4 texcoord2; + float4 texcoord3; + + float2 screenUV; + float4 screenPos; + + float4 vertexColor; + bool isFrontFace; + + float4 extraV2F0; + float4 extraV2F1; + float4 extraV2F2; + float4 extraV2F3; + float4 extraV2F4; + float4 extraV2F5; + float4 extraV2F6; + float4 extraV2F7; + + float3x3 TBNMatrix; + Blackboard blackboard; + }; + + struct VertexData + { + #if SHADER_TARGET > 30 + // uint vertexID : SV_VertexID; + #endif + float4 vertex : POSITION; + float3 normal : NORMAL; + float4 tangent : TANGENT; + float4 texcoord0 : TEXCOORD0; + + // optimize out mesh coords when not in use by user or lighting system + #if _URP && (_USINGTEXCOORD1 || _PASSMETA || _PASSFORWARD || _PASSGBUFFER) + float4 texcoord1 : TEXCOORD1; + #endif + + #if _URP && (_USINGTEXCOORD2 || _PASSMETA || ((_PASSFORWARD || _PASSGBUFFER) && defined(DYNAMICLIGHTMAP_ON))) + float4 texcoord2 : TEXCOORD2; + #endif + + #if _STANDARD && (_USINGTEXCOORD1 || (_PASSMETA || ((_PASSFORWARD || _PASSGBUFFER || _PASSFORWARDADD) && LIGHTMAP_ON))) + float4 texcoord1 : TEXCOORD1; + #endif + #if _STANDARD && (_USINGTEXCOORD2 || (_PASSMETA || ((_PASSFORWARD || _PASSGBUFFER) && DYNAMICLIGHTMAP_ON))) + float4 texcoord2 : TEXCOORD2; + #endif + + + #if _HDRP + float4 texcoord1 : TEXCOORD1; + float4 texcoord2 : TEXCOORD2; + #endif + + // #if %TEXCOORD3REQUIREKEY% + float4 texcoord3 : TEXCOORD3; + // #endif + + // #if %VERTEXCOLORREQUIREKEY% + float4 vertexColor : COLOR; + // #endif + + #if _PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR)) + float3 previousPositionOS : TEXCOORD4; // Contain previous transform position (in case of skinning for example) + #if defined (_ADD_PRECOMPUTED_VELOCITY) + float3 precomputedVelocity : TEXCOORD5; // Add Precomputed Velocity (Alembic computes velocities on runtime side). + #endif + #endif + + UNITY_VERTEX_INPUT_INSTANCE_ID + }; + + struct TessVertex + { + float4 vertex : INTERNALTESSPOS; + float3 normal : NORMAL; + float4 tangent : TANGENT; + float4 texcoord0 : TEXCOORD0; + float4 texcoord1 : TEXCOORD1; + float4 texcoord2 : TEXCOORD2; + + // #if %TEXCOORD3REQUIREKEY% + float4 texcoord3 : TEXCOORD3; + // #endif + + // #if %VERTEXCOLORREQUIREKEY% + float4 vertexColor : COLOR; + // #endif + + // #if %EXTRAV2F0REQUIREKEY% + // float4 extraV2F0 : TEXCOORD5; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // float4 extraV2F1 : TEXCOORD6; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // float4 extraV2F2 : TEXCOORD7; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // float4 extraV2F3 : TEXCOORD8; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // float4 extraV2F4 : TEXCOORD9; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // float4 extraV2F5 : TEXCOORD10; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // float4 extraV2F6 : TEXCOORD11; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // float4 extraV2F7 : TEXCOORD12; + // #endif + + #if _PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR)) + float3 previousPositionOS : TEXCOORD13; // Contain previous transform position (in case of skinning for example) + #if defined (_ADD_PRECOMPUTED_VELOCITY) + float3 precomputedVelocity : TEXCOORD14; + #endif + #endif + + UNITY_VERTEX_INPUT_INSTANCE_ID + UNITY_VERTEX_OUTPUT_STEREO + }; + + struct ExtraV2F + { + float4 extraV2F0; + float4 extraV2F1; + float4 extraV2F2; + float4 extraV2F3; + float4 extraV2F4; + float4 extraV2F5; + float4 extraV2F6; + float4 extraV2F7; + Blackboard blackboard; + float4 time; + }; + + + float3 WorldToTangentSpace(ShaderData d, float3 normal) + { + return mul(d.TBNMatrix, normal); + } + + float3 TangentToWorldSpace(ShaderData d, float3 normal) + { + return mul(normal, d.TBNMatrix); + } + + // in this case, make standard more like SRPs, because we can't fix + // unity_WorldToObject in HDRP, since it already does macro-fu there + + #if _STANDARD + float3 TransformWorldToObject(float3 p) { return mul(unity_WorldToObject, float4(p, 1)); }; + float3 TransformObjectToWorld(float3 p) { return mul(unity_ObjectToWorld, float4(p, 1)); }; + float4 TransformWorldToObject(float4 p) { return mul(unity_WorldToObject, p); }; + float4 TransformObjectToWorld(float4 p) { return mul(unity_ObjectToWorld, p); }; + float4x4 GetWorldToObjectMatrix() { return unity_WorldToObject; } + float4x4 GetObjectToWorldMatrix() { return unity_ObjectToWorld; } + #if (defined(SHADER_API_D3D11) || defined(SHADER_API_XBOXONE) || defined(UNITY_COMPILER_HLSLCC) || defined(SHADER_API_PSSL) || (SHADER_TARGET_SURFACE_ANALYSIS && !SHADER_TARGET_SURFACE_ANALYSIS_MOJOSHADER)) + #define UNITY_SAMPLE_TEX2D_LOD(tex,coord, lod) tex.SampleLevel (sampler##tex,coord, lod) + #define UNITY_SAMPLE_TEX2D_SAMPLER_LOD(tex,samplertex,coord, lod) tex.SampleLevel (sampler##samplertex,coord, lod) + #else + #define UNITY_SAMPLE_TEX2D_LOD(tex,coord,lod) tex2D (tex,coord,0,lod) + #define UNITY_SAMPLE_TEX2D_SAMPLER_LOD(tex,samplertex,coord,lod) tex2D (tex,coord,0,lod) + #endif + + #undef GetWorldToObjectMatrix() + + #define GetWorldToObjectMatrix() unity_WorldToObject + + + #endif + + float3 GetCameraWorldPosition() + { + #if _HDRP + return GetCameraRelativePositionWS(_WorldSpaceCameraPos); + #else + return _WorldSpaceCameraPos; + #endif + } + + #if _GRABPASSUSED + #if _STANDARD + TEXTURE2D(%GRABTEXTURE%); + SAMPLER(sampler_%GRABTEXTURE%); + #endif + + half3 GetSceneColor(float2 uv) + { + #if _STANDARD + return SAMPLE_TEXTURE2D(%GRABTEXTURE%, sampler_%GRABTEXTURE%, uv).rgb; + #else + return SHADERGRAPH_SAMPLE_SCENE_COLOR(uv); + #endif + } + #endif + + + + #if _STANDARD + UNITY_DECLARE_DEPTH_TEXTURE(_CameraDepthTexture); + float GetSceneDepth(float2 uv) { return SAMPLE_DEPTH_TEXTURE(_CameraDepthTexture, uv); } + float GetLinear01Depth(float2 uv) { return Linear01Depth(GetSceneDepth(uv)); } + float GetLinearEyeDepth(float2 uv) { return LinearEyeDepth(GetSceneDepth(uv)); } + #else + float GetSceneDepth(float2 uv) { return SHADERGRAPH_SAMPLE_SCENE_DEPTH(uv); } + float GetLinear01Depth(float2 uv) { return Linear01Depth(GetSceneDepth(uv), _ZBufferParams); } + float GetLinearEyeDepth(float2 uv) { return LinearEyeDepth(GetSceneDepth(uv), _ZBufferParams); } + #endif + + float3 GetWorldPositionFromDepthBuffer(float2 uv, float3 worldSpaceViewDir) + { + float eye = GetLinearEyeDepth(uv); + float3 camView = mul((float3x3)GetObjectToWorldMatrix(), transpose(mul(GetWorldToObjectMatrix(), UNITY_MATRIX_I_V)) [2].xyz); + + float dt = dot(worldSpaceViewDir, camView); + float3 div = worldSpaceViewDir/dt; + float3 wpos = (eye * div) + GetCameraWorldPosition(); + return wpos; + } + + #if _HDRP + float3 ObjectToWorldSpacePosition(float3 pos) + { + return GetAbsolutePositionWS(TransformObjectToWorld(pos)); + } + #else + float3 ObjectToWorldSpacePosition(float3 pos) + { + return TransformObjectToWorld(pos); + } + #endif + + #if _STANDARD + UNITY_DECLARE_SCREENSPACE_TEXTURE(_CameraDepthNormalsTexture); + float3 GetSceneNormal(float2 uv, float3 worldSpaceViewDir) + { + float4 depthNorms = UNITY_SAMPLE_SCREENSPACE_TEXTURE(_CameraDepthNormalsTexture, uv); + float3 norms = DecodeViewNormalStereo(depthNorms); + norms = mul((float3x3)GetWorldToViewMatrix(), norms) * 0.5 + 0.5; + return norms; + } + #elif _HDRP && !_DECALSHADER + + float3 GetSceneNormal(float2 uv, float3 worldSpaceViewDir) + { + NormalData nd; + DecodeFromNormalBuffer(_ScreenSize.xy * uv, nd); + return nd.normalWS; + } + #elif _URP + #if (SHADER_LIBRARY_VERSION_MAJOR >= 10) + #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/DeclareNormalsTexture.hlsl" + #endif + + float3 GetSceneNormal(float2 uv, float3 worldSpaceViewDir) + { + #if (SHADER_LIBRARY_VERSION_MAJOR >= 10) + return SampleSceneNormals(uv); + #else + float3 wpos = GetWorldPositionFromDepthBuffer(uv, worldSpaceViewDir); + return normalize(-cross(ddx(wpos), ddy(wpos))) * 0.5 + 0.5; + #endif + + } + #endif + + #if _HDRP + + half3 UnpackNormalmapRGorAG(half4 packednormal) + { + // This do the trick + packednormal.x *= packednormal.w; + + half3 normal; + normal.xy = packednormal.xy * 2 - 1; + normal.z = sqrt(1 - saturate(dot(normal.xy, normal.xy))); + return normal; + } + half3 UnpackNormal(half4 packednormal) + { + #if defined(UNITY_NO_DXT5nm) + return packednormal.xyz * 2 - 1; + #else + return UnpackNormalmapRGorAG(packednormal); + #endif + } + #endif + #if _HDRP || _URP + + half3 UnpackScaleNormal(half4 packednormal, half scale) + { + #ifndef UNITY_NO_DXT5nm + // Unpack normal as DXT5nm (1, y, 1, x) or BC5 (x, y, 0, 1) + // Note neutral texture like "bump" is (0, 0, 1, 1) to work with both plain RGB normal and DXT5nm/BC5 + packednormal.x *= packednormal.w; + #endif + half3 normal; + normal.xy = (packednormal.xy * 2 - 1) * scale; + normal.z = sqrt(1 - saturate(dot(normal.xy, normal.xy))); + return normal; + } + + #endif + + + void GetSun(out float3 lightDir, out float3 color) + { + lightDir = float3(0.5, 0.5, 0); + color = 1; + #if _HDRP + if (_DirectionalLightCount > 0) + { + DirectionalLightData light = _DirectionalLightDatas[0]; + lightDir = -light.forward.xyz; + color = light.color; + } + #elif _STANDARD + lightDir = normalize(_WorldSpaceLightPos0.xyz); + color = _LightColor0.rgb; + #elif _URP + Light light = GetMainLight(); + lightDir = light.direction; + color = light.color; + #endif + } + + + + + CBUFFER_START(UnityPerMaterial) + float _StencilRef; + float _StencilWriteMask; + float _StencilRefDepth; + float _StencilWriteMaskDepth; + float _StencilRefMV; + float _StencilWriteMaskMV; + float _StencilRefDistortionVec; + float _StencilWriteMaskDistortionVec; + float _StencilWriteMaskGBuffer; + float _StencilRefGBuffer; + float _ZTestGBuffer; + float _RequireSplitLighting; + float _ReceivesSSR; + float _ZWrite; + float _TransparentSortPriority; + float _ZTestDepthEqualForOpaque; + float _ZTestTransparent; + float _TransparentBackfaceEnable; + float _AlphaCutoffEnable; + float _UseShadowThreshold; + + + half4 _Color; + half4 _MainTex_ST, _MainTex_TexelSize; + half _Alpha, _AlphaCutoffValue; + + #if ATLAS_ON + half _MinXUV, _MaxXUV, _MinYUV, _MaxYUV; + #endif + + #if GLOW_ON + half4 _GlowColor; + half _Glow, _GlowGlobal; + #endif + + #if HSV_ON + half _HsvShift, _HsvSaturation, _HsvBright; + #endif + + #if DISTORT_ON + half4 _DistortTex_ST; + half _DistortTexXSpeed, _DistortTexYSpeed, _DistortAmount; + #endif + + #if FADE_ON + half4 _FadeBurnColor, _FadeTex_ST, _FadeBurnTex_ST; + half _FadeAmount, _FadeBurnWidth, _FadeBurnTransition,_FadeBurnGlow; + #endif + + #if OUTBASE_ON + half4 _OutlineColor; + half _OutlineAlpha, _OutlineGlow, _OutlineWidth; + int _OutlinePixelWidth; + #endif + + #if OUTTEX_ON + half4 _OutlineTex_ST; + half _OutlineTexXSpeed, _OutlineTexYSpeed; + #endif + + #if OUTDIST_ON + half4 _OutlineDistortTex_ST; + half _OutlineDistortTexXSpeed, _OutlineDistortTexYSpeed, _OutlineDistortAmount; + #endif + + #if ALPHAOUTLINE_ON + half _AlphaOutlineGlow, _AlphaOutlinePower, _AlphaOutlineMinAlpha, _AlphaOutlineBlend; + half4 _AlphaOutlineColor; + #endif + + #if INNEROUTLINE_ON + half _InnerOutlineThickness, _InnerOutlineAlpha, _InnerOutlineGlow; + half4 _InnerOutlineColor; + #endif + + #if GRADIENT_ON + half _GradBlend, _GradBoostX, _GradBoostY; + half4 _GradTopRightCol, _GradTopLeftCol, _GradBotRightCol, _GradBotLeftCol; + #endif + + #if COLORSWAP_ON + half4 _ColorSwapRed, _ColorSwapGreen, _ColorSwapBlue; + half _ColorSwapRedLuminosity, _ColorSwapGreenLuminosity, _ColorSwapBlueLuminosity, _ColorSwapBlend; + #endif + + #if CHANGECOLOR_ON + half4 _ColorChangeNewCol, _ColorChangeTarget; + half _ColorChangeTolerance, _ColorChangeLuminosity; + #endif + #if CHANGECOLOR2_ON + half4 _ColorChangeNewCol2, _ColorChangeTarget2; + half _ColorChangeTolerance2; + #endif + #if CHANGECOLOR3_ON + half4 _ColorChangeNewCol3, _ColorChangeTarget3; + half _ColorChangeTolerance3; + #endif + + #if COLORRAMP_ON + half _ColorRampLuminosity, _ColorRampBlend; + #endif + + #if HITEFFECT_ON + half4 _HitEffectColor; + half _HitEffectGlow, _HitEffectBlend; + #endif + + #if NEGATIVE_ON + half _NegativeAmount; + #endif + + #if PIXELATE_ON + half _PixelateSize; + #endif + + #if GREYSCALE_ON + half _GreyscaleLuminosity, _GreyscaleBlend; + half4 _GreyscaleTintColor; + #endif + + #if POSTERIZE_ON + half _PosterizeNumColors, _PosterizeGamma; + #endif + + #if BLUR_ON + half _BlurIntensity; + #endif + + #if MOTIONBLUR_ON + half _MotionBlurAngle, _MotionBlurDist; + #endif + + #if GHOST_ON + half _GhostColorBoost, _GhostTransparency, _GhostBlend; + #endif + + #if HOLOGRAM_ON + half _HologramStripesAmount, _HologramMinAlpha, _HologramUnmodAmount, _HologramStripesSpeed, _HologramMaxAlpha, _HologramBlend; + half4 _HologramStripeColor; + #endif + + #if CHROMABERR_ON + half _ChromAberrAmount, _ChromAberrAlpha; + #endif + + #if GLITCH_ON + half _GlitchAmount, _GlitchSize; + #endif + + #if FLICKER_ON + half _FlickerFreq, _FlickerPercent, _FlickerAlpha; + #endif + + #if SHADOW_ON + half _ShadowX, _ShadowY, _ShadowAlpha; + half4 _ShadowColor; + #endif + + #if SHINE_ON + half4 _ShineColor; + half _ShineLocation, _ShineRotate, _ShineWidth, _ShineGlow; + #endif + + #if CONTRAST_ON + half _Contrast, _Brightness; + #endif + + #if OVERLAY_ON + half4 _OverlayTex_ST, _OverlayColor; + half _OverlayGlow, _OverlayBlend, _OverlayTextureScrollXSpeed, _OverlayTextureScrollYSpeed; + #endif + + #if DOODLE_ON + half _HandDrawnAmount, _HandDrawnSpeed; + #endif + + #if WIND_ON + half _GrassSpeed, _GrassWind, _GrassManualAnim, _GrassRadialBend; + #endif + + #if WAVEUV_ON + float _WaveAmount, _WaveSpeed, _WaveStrength, _WaveX, _WaveY; + #endif + + #if ROUNDWAVEUV_ON + half _RoundWaveStrength, _RoundWaveSpeed; + #endif + + #if RECTSIZE_ON + half _RectSize; + #endif + + #if OFFSETUV_ON + half _OffsetUvX, _OffsetUvY; + #endif + + #if CLIPPING_ON + half _ClipUvLeft, _ClipUvRight, _ClipUvUp, _ClipUvDown; + #endif + + #if RADIALCLIPPING_ON + half _RadialStartAngle, _RadialClip, _RadialClip2; + #endif + + #if TEXTURESCROLL_ON + half _TextureScrollXSpeed, _TextureScrollYSpeed; + #endif + + #if ZOOMUV_ON + half _ZoomUvAmount; + #endif + + #if WARP_ON + half _WarpStrength, _WarpSpeed, _WarpScale; + #endif + + #if TWISTUV_ON + half _TwistUvAmount, _TwistUvPosX, _TwistUvPosY, _TwistUvRadius; + #endif + + #if ROTATEUV_ON + half _RotateUvAmount; + #endif + + #if FISHEYE_ON + half _FishEyeUvAmount; + #endif + + #if PINCH_ON + half _PinchUvAmount; + #endif + + #if SHAKEUV_ON + half _ShakeUvSpeed, _ShakeUvX, _ShakeUvY; + #endif + + #if NORMALMAP_ON + half _NormalStrength; + #endif + + float _RandomSeed; + + + + + CBUFFER_END + + + + + + + + TEXTURE2D(_MainTex); + SAMPLER(sampler_MainTex); + + #if GLOW_ON + TEXTURE2D(_GlowTex); + SAMPLER(sampler_GlowTex); + #endif + + #if FADE_ON + TEXTURE2D(_FadeTex); + SAMPLER(sampler_FadeTex); + + TEXTURE2D(_FadeBurnTex); + SAMPLER(sampler_FadeBurnTex); + #endif + + #if DISTORT_ON + TEXTURE2D(_DistortTex); + SAMPLER(sampler_DistortTex); + #endif + + #if OUTTEX_ON + TEXTURE2D(_OutlineTex); + SAMPLER(sampler_OutlineTex); + #endif + + #if OUTDIST_ON + TEXTURE2D(_OutlineDistortTex); + SAMPLER(sampler_OutlineDistortTex); + #endif + + #if COLORSWAP_ON + TEXTURE2D(_ColorSwapTex); + SAMPLER(sampler_ColorSwapTex); + #endif + + #if COLORRAMP_ON + TEXTURE2D(_ColorRampTex); + TEXTURE2D(_ColorRampTexGradient); + SAMPLER(sampler_ColorRampTex); + SAMPLER(sampler_ColorRampTexGradient); + #endif + + #if SHINE_ON + TEXTURE2D(_ShineMask); + SAMPLER(sampler_ShineMask); + #endif + + #if OVERLAY_ON + TEXTURE2D(_OverlayTex); + SAMPLER(sampler_OverlayTex); + #endif + + #if NORMALMAP_ON + TEXTURE2D(_NormalMap); + SAMPLER(sampler_NormalMap); + #endif + + + half3 GetPixel(in int offsetX, in int offsetY, in half2 uv, in Texture2D _tex, in SamplerState _sampler) + { + half2 _uv = uv + half2(offsetX * _MainTex_TexelSize.x, offsetY * _MainTex_TexelSize.y); + half4 col = SAMPLE_TEXTURE2D(_tex, _sampler, _uv); + return col.rgb; + } + + + //BLURS------------------------------------------------------------------------- + half4 Blur(half2 uv, Texture2D source, SamplerState sampler_source, half Intensity) + { + const half2 texelSize = 1.0 / _ScreenParams.xy; + const half4 color = SAMPLE_TEXTURE2D(source, sampler_source, uv); + const half2 offset = Intensity * texelSize; + + half4 accumulatedColor = color; + half accumulatedWeight = 1.0; + for (int x = -1; x <= 1; x++) + { + for (int y = -1; y <= 1; y++) + { + const half2 sampleUV = uv + half2(x, y) * offset; + const half4 sampleColor = SAMPLE_TEXTURE2D(source, sampler_source, sampleUV); + + accumulatedColor += sampleColor; + accumulatedWeight += 1.0; + } + } + + half4 blurredColor = accumulatedColor / accumulatedWeight; + return blurredColor; + } + + half BlurHD_G(half bhqp, half x) + { + return exp(-(x * x) / (2.0 * bhqp * bhqp)); + } + half4 BlurHD(half2 uv, Texture2D source, SamplerState sampler_source, half BlurAmount, half xScale, half yScale) + { + int iterations = 16; + int halfIterations = iterations / 2; + half sigmaX = 0.1 + BlurAmount * 0.5; + half sigmaY = sigmaX; + half total = 0.0; + half4 ret = half4(0, 0, 0, 0); + for (int iy = 0; iy < iterations; ++iy) + { + half fy = BlurHD_G(sigmaY, half(iy) -half(halfIterations)); + half offsetY = half(iy - halfIterations) * 0.00390625 * xScale; + for (int ix = 0; ix < iterations; ++ix) + { + half fx = BlurHD_G(sigmaX, half(ix) - half(halfIterations)); + half offsetX = half(ix - halfIterations) * 0.00390625 * yScale; + total += fx * fy; + ret += SAMPLE_TEXTURE2D(source, sampler_source, uv + half2(offsetX, offsetY)) * fx * fy; + } + } + return ret / total; + } + //----------------------------------------------------------------------- + + + //------------------------------------------- + half RemapFloat(half inValue, half inMin, half inMax, half outMin, half outMax){ + return outMin + (inValue - inMin) * (outMax - outMin) / (inMax - inMin); + } + //------------------------------------------- + + //----------------------------------------------------------------------- + half rand(half2 seed, half offset) { + return (frac(sin(dot(seed, half2(12.9898, 78.233))) * 43758.5453) + offset) % 1.0; + } + + half rand2(half2 seed, half offset) { + return (frac(sin(dot(seed * floor(50 + (_Time.x % 1.0) * 12.), half2(127.1, 311.7))) * 43758.5453123) + offset) % 1.0; + } + + half rand2CustomTime(half2 seed, half offset, half customTime) { + return (frac(sin(dot(seed * floor(50 + (customTime % 1.0) * 12.), half2(127.1, 311.7))) * 43758.5453123) + offset) % 1.0; + } + //----------------------------------------------------------------------- + + + void Ext_ModifyVertex0 (inout VertexData v, inout ExtraV2F d) + { + //BILBOARD_ON + #if BILBOARD_ON + half3 camRight = mul((half3x3)unity_CameraToWorld, half3(1,0,0)); + half3 camUp = half3(0,1,0); + #if BILBOARDY_ON + camUp = mul((half3x3)unity_CameraToWorld, half3(0,1,0)); + #endif + half3 localPos = v.vertex.x * camRight + v.vertex.y * camUp; + v.vertex = half4(localPos, 1); + #endif + //----------------------------------------------------------- + + v.texcoord0.xy = TRANSFORM_TEX(v.texcoord0.xy, _MainTex); + half2 center = half2(0.5, 0.5); + #if ATLAS_ON + center = half2((_MaxXUV + _MinXUV) / 2.0, (_MaxYUV + _MinYUV) / 2.0); + #endif + + //POLARUV_ON + #if POLARUV_ON + v.texcoord0.xy = v.texcoord0.xy - center; + #endif + + //---------------------------------------- + + //ROTATEUV_ON + #if ROTATEUV_ON + half2 uvC = v.texcoord0.xy; + half cosAngle = cos(_RotateUvAmount); + half sinAngle = sin(_RotateUvAmount); + half2x2 rot = half2x2(cosAngle, -sinAngle, sinAngle, cosAngle); + uvC -= center; + v.texcoord0.xy = mul(rot, uvC); + v.texcoord0.xy += center; + #endif + //-------------------- + + #if RECTSIZE_ON + v.vertex.xyz += (v.vertex.xyz * (_RectSize - 1.0)); + #endif + + #if OUTTEX_ON + v.texcoord1.xy = TRANSFORM_TEX(v.texcoord0.xy, _OutlineTex); + #endif + + #if OUTDIST_ON + v.texcoord2.xy = TRANSFORM_TEX(v.texcoord0.xy, _OutlineDistortTex); + #endif + + #if DISTORT_ON + v.texcoord3.xy = TRANSFORM_TEX(v.texcoord0.xy, _DistortTex); + #endif + } + + void Ext_SurfaceFunction0 (inout Surface o, ShaderData d) + { + half randomSeed = _RandomSeed; + + float2 uvRect = d.texcoord0; + half2 center = half2(0.5, 0.5); + #if ATLAS_ON + center = half2((_MaxXUV + _MinXUV) / 2.0, (_MaxYUV + _MinYUV) / 2.0); + uvRect = half2((d.texcoord0.x - _MinXUV) / (_MaxXUV - _MinXUV), (d.texcoord0.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half2 centerTiled = half2(center.x * _MainTex_ST.x, center.y * _MainTex_ST.y); + + //CLIPPING_ON + #if CLIPPING_ON + half2 tiledUv = half2(d.texcoord0.x / _MainTex_ST.x, d.texcoord0.y / _MainTex_ST.y); + #if ATLAS_ON + tiledUv = half2((tiledUv.x - _MinXUV) / (_MaxXUV - _MinXUV), (tiledUv.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + clip((1 - _ClipUvUp) - tiledUv.y); + clip(tiledUv.y - _ClipUvDown); + clip((1 - _ClipUvRight) - tiledUv.x); + clip(tiledUv.x - _ClipUvLeft); + #endif + //---------------------------------- + + //RADIALCLIPPING_ON + #if RADIALCLIPPING_ON + half2 tiledUv2 = half2(d.texcoord0.x / _MainTex_ST.x, d.texcoord0.y / _MainTex_ST.y); + #if ATLAS_ON + tiledUv2 = half2((tiledUv2.x - _MinXUV) / (_MaxXUV - _MinXUV), (tiledUv2.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half startAngle = _RadialStartAngle - _RadialClip; + half endAngle = _RadialStartAngle + _RadialClip2; + half offset0 = clamp(0, 360, startAngle + 360); + half offset360 = clamp(0, 360, endAngle - 360); + half2 atan2Coord = half2(lerp(-1, 1, tiledUv2.x), lerp(-1, 1, tiledUv2.y)); + half atanAngle = atan2(atan2Coord.y, atan2Coord.x) * 57.3; // angle in degrees + if(atanAngle < 0) atanAngle = 360 + atanAngle; + if(atanAngle >= startAngle && atanAngle <= endAngle) discard; + if(atanAngle <= offset360) discard; + if(atanAngle >= offset0) discard; + #endif + + //----------------------------- + + //TEXTURESCROLL_ON && ATLAS_ON + #if TEXTURESCROLL_ON && ATLAS_ON + d.texcoord0.xy = half2(_MinXUV + ((_MaxXUV - _MinXUV) * (abs(((_Time.y + randomSeed) * _TextureScrollXSpeed) + uvRect.x) % 1)), + _MinYUV + ((_MaxYUV - _MinYUV) * (abs(((_Time.y + randomSeed) * _TextureScrollYSpeed) + uvRect.y) % 1))); + #endif + //---------------------------- + + //OFFSETUV_ON + #if OFFSETUV_ON + #if ATLAS_ON + d.texcoord0.xy = half2(_MinXUV + ((_MaxXUV - _MinXUV) * (abs((_OffsetUvX + uvRect.x) % 1))), + _MinYUV + ((_MaxYUV - _MinYUV) * (abs(_OffsetUvY + uvRect.y) % 1))); + #else + d.texcoord0.xy += half2(_OffsetUvX, _OffsetUvY); + #endif + #endif + + //---------------------- + + //POLARUV_ON + #if POLARUV_ON + d.texcoord0.xy = half2(atan2(d.texcoord0.y, d.texcoord0.x) / (2.0f * 3.141592653589f), length(d.texcoord0.xy)); + d.texcoord0.xy *= _MainTex_ST.xy; + #endif + + //-------------------------------------- + + //TWISTUV_ON + #if TWISTUV_ON + #if ATLAS_ON + _TwistUvPosX = ((_MaxXUV - _MinXUV) * _TwistUvPosX) + _MinXUV; + _TwistUvPosY = ((_MaxYUV - _MinYUV) * _TwistUvPosY) + _MinYUV; + #endif + half2 tempUv = d.texcoord0.xy - half2(_TwistUvPosX * _MainTex_ST.x, _TwistUvPosY * _MainTex_ST.y); + _TwistUvRadius *= (_MainTex_ST.x + _MainTex_ST.y) / 2; + half percent = (_TwistUvRadius - length(tempUv)) / _TwistUvRadius; + half theta = percent * percent * (2.0 * sin(_TwistUvAmount)) * 8.0; + half s = sin(theta); + half c = cos(theta); + half beta = max(sign(_TwistUvRadius - length(tempUv)), 0.0); + tempUv = half2(dot(tempUv, half2(c, -s)), dot(tempUv, half2(s, c))) * beta + tempUv * (1 - beta); + tempUv += half2(_TwistUvPosX * _MainTex_ST.x, _TwistUvPosY * _MainTex_ST.y); + d.texcoord0.xy = tempUv; + #endif + + //-------------------------------------------- + + //FISHEYE_ON + #if FISHEYE_ON + half bind = length(centerTiled); + half2 dF = d.texcoord0.xy - centerTiled; + half dFlen = length(dF); + half fishInt = (3.14159265359 / bind) * (_FishEyeUvAmount + 0.001); + d.texcoord0.xy = centerTiled + (dF / (max(0.0001, dFlen))) * tan(dFlen * fishInt) * bind / tan(bind * fishInt); + #endif + //--------------------------------------------- + + //PINCH_ON + #if PINCH_ON + half2 dP = d.texcoord0.xy - centerTiled; + half pinchInt = (3.141592 / length(centerTiled)) * (-_PinchUvAmount + 0.001); + d.texcoord0.xy = centerTiled + normalize(dP) * atan(length(dP) * -pinchInt * 10.0) * 0.5 / atan(-pinchInt * 5); + #endif + + //--------------------------------------------- + + //ZOOMUV_ON + #if ZOOMUV_ON + d.texcoord0.xy -= centerTiled; + d.texcoord0.xy = d.texcoord0.xy * _ZoomUvAmount; + d.texcoord0.xy += centerTiled; + #endif + + //----------------------------------------------- + + //DOODLE_ON + #if DOODLE_ON + half2 uvCopy = uvRect; + _HandDrawnSpeed = (floor((_Time.x + randomSeed) * 20 * _HandDrawnSpeed) / _HandDrawnSpeed) * _HandDrawnSpeed; + uvCopy.x = sin((uvCopy.x * _HandDrawnAmount + _HandDrawnSpeed) * 4); + uvCopy.y = cos((uvCopy.y * _HandDrawnAmount + _HandDrawnSpeed) * 4); + d.texcoord0.xy = lerp(d.texcoord0.xy, d.texcoord0.xy + uvCopy, 0.0005 * _HandDrawnAmount); + #endif + + //-------------------------- + + //SHAKEUV_ON + #if SHAKEUV_ON + half xShake = sin((_Time.x + randomSeed) * _ShakeUvSpeed * 50) * _ShakeUvX; + half yShake = cos((_Time.x + randomSeed) * _ShakeUvSpeed * 50) * _ShakeUvY; + d.texcoord0.xy += half2(xShake * 0.012, yShake * 0.01); + #endif + + //------------------------------------------- + + //RECTSIZE_ON + #if RECTSIZE_ON + d.texcoord0.xy = d.texcoord0.xy * (_RectSize).xx + (((-_RectSize * 0.5) + 0.5)).xx; + #endif + + //------------------------------------------- + + //DISTORT_ON + #if DISTORT_ON + #if ATLAS_ON + d.texcoord3.x = d.texcoord3.x * (1 / (_MaxXUV - _MinXUV)); + d.texcoord3.y = d.texcoord3.y * (1 / (_MaxYUV - _MinYUV)); + #endif + + d.texcoord3.x += ((_Time.x + _RandomSeed) * _DistortTexXSpeed) % 1; + d.texcoord3.y += ((_Time.x + _RandomSeed) * _DistortTexYSpeed) % 1; + half distortAmnt = (SAMPLE_TEXTURE2D(_DistortTex, sampler_DistortTex, d.texcoord3.xy).r - 0.5) * 0.2 * _DistortAmount; + d.texcoord0.x += distortAmnt; + d.texcoord0.y += distortAmnt; + #endif + //------------------------------------------------------- + + //WARP_ON + #if WARP_ON + half2 warpUv = half2(d.texcoord0.x / _MainTex_ST.x, d.texcoord0.y / _MainTex_ST.y); + #if ATLAS_ON + warpUv = half2((warpUv.x - _MinXUV) / (_MaxXUV - _MinXUV), (warpUv.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + const float tau = 6.283185307179586; + float xWarp = (_Time.y + randomSeed) * _WarpSpeed + warpUv.x * tau / _WarpScale; + float yWarp = (_Time.y + randomSeed) * _WarpSpeed + warpUv.y * tau / _WarpScale; + float2 warp = float2(sin(xWarp), sin(yWarp)) * _WarpStrength; + d.texcoord0.xy += warp; + #endif + + //------------------------------------------------------- + + //WAVEUV_ON + #if WAVEUV_ON + float2 uvWave = half2(_WaveX * _MainTex_ST.x, _WaveY * _MainTex_ST.y) - d.texcoord0.xy; + uvWave %= 1; + #if ATLAS_ON + uvWave = half2(_WaveX, _WaveY) - uvRect; + #endif + uvWave.x *= _ScreenParams.x / _ScreenParams.y; + float waveTime = _Time.y + randomSeed; + float angWave = (sqrt(dot(uvWave, uvWave)) * _WaveAmount) - ((waveTime * _WaveSpeed)); + d.texcoord0.xy = d.texcoord0.xy + uvWave * sin(angWave) * (_WaveStrength / 1000.0); + #endif + //---------------------------------------------------- + + //ROUNDWAVEUV_ON + #if ROUNDWAVEUV_ON + half xWave = ((0.5 * _MainTex_ST.x) - uvRect.x); + half yWave = ((0.5 * _MainTex_ST.y) - uvRect.y) * (_MainTex_TexelSize.w / _MainTex_TexelSize.z); + half ripple = -sqrt(xWave*xWave + yWave* yWave); + d.texcoord0.xy += (sin((ripple + (_Time.y + randomSeed) * (_RoundWaveSpeed/10.0)) / 0.015) * (_RoundWaveStrength/10.0)) % 1; + #endif + //---------------------------------------------------- + + + //WIND_ON + #if WIND_ON + half windOffset = sin((_Time.x + randomSeed) * _GrassSpeed * 10); + half2 windCenter = half2(0.5, 0.1); + #if ATLAS_ON + windCenter.x = ((_MaxXUV - _MinXUV) * windCenter.x) + _MinXUV; + windCenter.y = ((_MaxYUV - _MinYUV) * windCenter.y) + _MinYUV; + #endif + #if !MANUALWIND_ON + d.texcoord0.x = fmod(abs(lerp(d.texcoord0.x, d.texcoord0.x + (_GrassWind * 0.01 * windOffset), uvRect.y)), 1); + #else + d.texcoord0.x = fmod(abs(lerp(d.texcoord0.x, d.texcoord0.x + (_GrassWind * 0.01 * _GrassManualAnim), uvRect.y)), 1); + windOffset = _GrassManualAnim; + #endif + half2 delta = d.texcoord0.xy - windCenter; + half delta2 = dot(delta.xy, delta.xy); + half2 delta_offset = delta2 * windOffset; + d.texcoord0.xy = d.texcoord0.xy + half2(delta.y, -delta.x) * delta_offset * _GrassRadialBend; + #endif + + //-------------------------------------------------------- + + //TEXTURESCROLL_ON && !ATLAS_ON + #if TEXTURESCROLL_ON && !ATLAS_ON + d.texcoord0.x += ((_Time.y + randomSeed) * _TextureScrollXSpeed) % 1; + d.texcoord0.y += ((_Time.y + randomSeed) * _TextureScrollYSpeed) % 1; + #endif + //------------------------------ + + //PIXELATE_ON + #if PIXELATE_ON + half aspectRatio = _MainTex_TexelSize.x / _MainTex_TexelSize.y; + half2 pixelSize = float2(_PixelateSize, _PixelateSize * aspectRatio); + d.texcoord0.xy = floor(d.texcoord0.xy * pixelSize) / pixelSize; + #endif + //-------------- + + half4 col = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy); + half originalAlpha = col.a; + col *= d.vertexColor; + + //NORMAL MAP + #if NORMALMAP_ON + half4 normalSample = SAMPLE_TEXTURE2D(_NormalMap, sampler_NormalMap, d.texcoord0.xy); + half3 normalTS = UnpackNormal(normalSample); + normalTS.xy *= _NormalStrength; + o.Normal = normalTS; + #endif + + + //GLITCH_ON + #if GLITCH_ON + half2 uvGlitch = uvRect; + uvGlitch.y -= 0.5; + half lineNoise = pow(rand2(floor(uvGlitch * half2(24., 19.) * _GlitchSize) * 4.0, randomSeed), 3.0) * _GlitchAmount + * pow(rand2(floor(uvGlitch * half2(38., 14.) * _GlitchSize) * 4.0, randomSeed), 3.0); + col = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(lineNoise * 0.02 * rand2(half2(2.0, 1), randomSeed), 0)) * d.vertexColor; + #endif + //-------------------------------------- + + //CHROMABERR_ON + #if CHROMABERR_ON + half4 r = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(_ChromAberrAmount/10, 0)) * d.vertexColor; + half4 b = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(-_ChromAberrAmount/10, 0)) * d.vertexColor; + col = half4(r.r * r.a, col.g, b.b * b.a, max(max(r.a, b.a) * _ChromAberrAlpha, col.a)); + #endif + + //-------------------------------- + + //BLUR_ON + #if BLUR_ON + #if ATLAS_ON + #if !BLURISHD_ON + col = BlurHD(d.texcoord0.xy, _MainTex, sampler_MainTex, _BlurIntensity, (_MaxXUV - _MinXUV), (_MaxYUV - _MinYUV)) * d.vertexColor; + #else + col = Blur(d.texcoord0.xy, _MainTex, sampler_MainTex, _BlurIntensity * (_MaxXUV - _MinXUV)) * d.vertexColor; + #endif + #else + #if !BLURISHD_ON + col = BlurHD(d.texcoord0.xy, _MainTex, sampler_MainTex, _BlurIntensity, 1, 1) * d.vertexColor; + #else + col = Blur(d.texcoord0.xy, _MainTex, sampler_MainTex, _BlurIntensity) * d.vertexColor; + #endif + #endif + #endif + + //-------------------- + + //MOTIONBLUR_ON + #if MOTIONBLUR_ON + _MotionBlurAngle = _MotionBlurAngle * 3.1415926; + #define rot(n) mul(n, half2x2(cos(_MotionBlurAngle), -sin(_MotionBlurAngle), sin(_MotionBlurAngle), cos(_MotionBlurAngle))) + _MotionBlurDist = _MotionBlurDist * 0.005; + #if ATLAS_ON + _MotionBlurDist *= (_MaxXUV - _MinXUV); + #endif + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(-_MotionBlurDist, -_MotionBlurDist))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(-_MotionBlurDist * 2, -_MotionBlurDist * 2))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(-_MotionBlurDist * 3, -_MotionBlurDist * 3))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(-_MotionBlurDist * 4, -_MotionBlurDist * 4))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(_MotionBlurDist, _MotionBlurDist))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(_MotionBlurDist * 2, _MotionBlurDist * 2))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(_MotionBlurDist * 3, _MotionBlurDist * 3))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(_MotionBlurDist * 4, _MotionBlurDist * 4))); + col.rgb = col.rgb / 9; + #endif + //------------------------------------ + + //NEGATIVE_ON + #if NEGATIVE_ON + col.rgb = lerp(col.rgb, 1 - col.rgb, _NegativeAmount); + #endif + + //-------------- + half luminance = 0; + + //GREYSCALE_ON && !GREYSCALEOUTLINE_ON + #if GREYSCALE_ON && !GREYSCALEOUTLINE_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + luminance = saturate(luminance + _GreyscaleLuminosity); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _GreyscaleTintColor, _GreyscaleBlend); + #endif + //------------------------------------ + + //GHOST_ON + #if GHOST_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + half4 ghostResult; + ghostResult.a = saturate(luminance - _GhostTransparency) * col.a; + ghostResult.rgb = col.rgb * (luminance + _GhostColorBoost); + col = lerp(col, ghostResult, _GhostBlend); + #endif + //------------------------------------ + + //INNEROUTLINE_ON + #if INNEROUTLINE_ON + half3 innerT = abs(GetPixel(0, _InnerOutlineThickness, d.texcoord0.xy, _MainTex, sampler_MainTex) - GetPixel(0, -_InnerOutlineThickness, d.texcoord0.xy, _MainTex, sampler_MainTex)); + innerT += abs(GetPixel(_InnerOutlineThickness, 0, d.texcoord0.xy, _MainTex, sampler_MainTex) - GetPixel(-_InnerOutlineThickness, 0, d.texcoord0.xy, _MainTex, sampler_MainTex)); + #if !ONLYINNEROUTLINE_ON + innerT = (innerT / 2.0) * col.a * _InnerOutlineAlpha; + col.rgb += length(innerT) * _InnerOutlineColor.rgb * _InnerOutlineGlow; + #else + innerT *= col.a * _InnerOutlineAlpha; + col.rgb = length(innerT) * _InnerOutlineColor.rgb * _InnerOutlineGlow; + col.a = step(0.3, col.r+col.g+col.b); + #endif + #endif + //------------------------------------------------------- + + //HITEFFECT_ON + #if HITEFFECT_ON + col.rgb = lerp(col.rgb, _HitEffectColor.rgb * _HitEffectGlow, _HitEffectBlend); + #endif + //-------------------- + + //GRADIENT_ON + #if GRADIENT_ON + half2 tiledUvGrad = half2(uvRect.x / _MainTex_ST.x, uvRect.y / _MainTex_ST.y); + #if GRADIENT2COL_ON + _GradTopRightCol = _GradTopLeftCol; + _GradBotRightCol = _GradBotLeftCol; + #endif + #if RADIALGRADIENT_ON + half radialDist = 1 - length(tiledUvGrad - half2(0.5, 0.5)); + radialDist *= (_MainTex_TexelSize.w / _MainTex_TexelSize.z); + radialDist = saturate(_GradBoostX * radialDist); + half4 gradientResult = lerp(_GradTopLeftCol, _GradBotLeftCol, radialDist); + #else + half gradXLerpFactor = saturate(pow(tiledUvGrad.x, _GradBoostX)); + half4 gradientResult = lerp(lerp(_GradBotLeftCol, _GradBotRightCol, gradXLerpFactor), + lerp(_GradTopLeftCol, _GradTopRightCol, gradXLerpFactor), saturate(pow(tiledUvGrad.y, _GradBoostY))); + #endif + gradientResult = lerp(col, gradientResult, _GradBlend); + col.rgb = gradientResult.rgb * col.a; + col.a *= gradientResult.a; + #endif + //-------------------------------------------------------------------- + + //CONTRAST_ON + #if CONTRAST_ON + col.rgb = (col.rgb - float3(0.5, 0.5, 0.5)) * _Contrast + float3(0.5, 0.5, 0.5); + col.rgb += _Brightness; + #endif + + //------------------------------------------------------------------- + + //COLORSWAP_ON + #if COLORSWAP_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + half4 swapMask = SAMPLE_TEXTURE2D(_ColorSwapTex, sampler_ColorSwapTex, d.texcoord0.xy); + swapMask.rgb *= swapMask.a; + half3 redSwap = _ColorSwapRed * swapMask.r * saturate(luminance + _ColorSwapRedLuminosity); + half3 greenSwap = _ColorSwapGreen * swapMask.g * saturate(luminance + _ColorSwapGreenLuminosity); + half3 blueSwap = _ColorSwapBlue * swapMask.b * saturate(luminance + _ColorSwapBlueLuminosity); + swapMask.rgb = col.rgb * saturate(1 - swapMask.r - swapMask.g - swapMask.b); + col.rgb = lerp(col.rgb, swapMask.rgb + redSwap + greenSwap + blueSwap, _ColorSwapBlend); + #endif + //-------------------------------------------------------------------- + + //COLORRAMP_ON && !COLORRAMPOUTLINE_ON + #if COLORRAMP_ON && !COLORRAMPOUTLINE_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + luminance = saturate(luminance + _ColorRampLuminosity); + #if GRADIENTCOLORRAMP_ON + col.rgb = lerp(col.rgb, SAMPLE_TEXTURE2D(_ColorRampTexGradient, sampler_ColorRampTexGradient, half2(luminance, 0)).rgb, _ColorRampBlend); + #else + col.rgb = lerp(col.rgb, SAMPLE_TEXTURE2D(_ColorRampTex, sampler_ColorRampTex, half2(luminance, 0)).rgb, _ColorRampBlend); + #endif + #endif + //-------------------------------------------------------------------- + + //CHANGECOLOR_ON + #if CHANGECOLOR_ON + float3 currChangeColor = saturate(col.rgb); + luminance = 0.3 * currChangeColor.r + 0.59 * currChangeColor.g + 0.11 * currChangeColor.b; + luminance = saturate(luminance + _ColorChangeLuminosity); + half3 dif = abs(currChangeColor - _ColorChangeTarget.rgb); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _ColorChangeNewCol.rgb, + max(sign(1 - saturate(dif.x + dif.y + dif.z) - _ColorChangeTolerance), 0.0)); + #if CHANGECOLOR2_ON + dif = abs(currChangeColor - _ColorChangeTarget2.rgb); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _ColorChangeNewCol2.rgb, + max(sign(1 - saturate(dif.x + dif.y + dif.z) - _ColorChangeTolerance2), 0.0)); + #endif + #if CHANGECOLOR3_ON + dif = abs(currChangeColor - _ColorChangeTarget3.rgb); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _ColorChangeNewCol3.rgb, + max(sign(1 - saturate(dif.x + dif.y + dif.z) - _ColorChangeTolerance3), 0.0)); + #endif + #endif + //------------------------------------------------------- + + //POSTERIZE_ON && !POSTERIZEOUTLINE_ON + #if POSTERIZE_ON && !POSTERIZEOUTLINE_ON + col.rgb = pow(col.rgb, _PosterizeGamma) * _PosterizeNumColors; + col.rgb = floor(col.rgb) / _PosterizeNumColors; + col.rgb = pow(col.rgb, 1.0 / _PosterizeGamma); + #endif + //------------------------------------ + + //HSV_ON + #if HSV_ON + half3 resultHsv = half3(col.rgb); + half cosHsv = _HsvBright * _HsvSaturation * cos(_HsvShift * 3.14159265 / 180); + half sinHsv = _HsvBright * _HsvSaturation * sin(_HsvShift * 3.14159265 / 180); + resultHsv.x = (.299 * _HsvBright + .701 * cosHsv + .168 * sinHsv) * col.x + + (.587 * _HsvBright - .587 * cosHsv + .330 * sinHsv) * col.y + + (.114 * _HsvBright - .114 * cosHsv - .497 * sinHsv) * col.z; + resultHsv.y = (.299 * _HsvBright - .299 * cosHsv - .328 * sinHsv) *col.x + + (.587 * _HsvBright + .413 * cosHsv + .035 * sinHsv) * col.y + + (.114 * _HsvBright - .114 * cosHsv + .292 * sinHsv) * col.z; + resultHsv.z = (.299 * _HsvBright - .3 * cosHsv + 1.25 * sinHsv) * col.x + + (.587 * _HsvBright - .588 * cosHsv - 1.05 * sinHsv) * col.y + + (.114 * _HsvBright + .886 * cosHsv - .203 * sinHsv) * col.z; + col.rgb = resultHsv; + #endif + //------------------------------------------------------- + + //OVERLAY_ON + #if OVERLAY_ON + half2 overlayUvs = d.texcoord0.xy; + overlayUvs.x += ((_Time.y + randomSeed) * _OverlayTextureScrollXSpeed) % 1; + overlayUvs.y += ((_Time.y + randomSeed) * _OverlayTextureScrollYSpeed) % 1; + half4 overlayCol = SAMPLE_TEXTURE2D(_OverlayTex, sampler_OverlayTex, TRANSFORM_TEX(overlayUvs, _OverlayTex)); + overlayCol.rgb *= _OverlayColor.rgb * _OverlayGlow; + #if !OVERLAYMULT_ON + overlayCol.rgb *= overlayCol.a * _OverlayColor.rgb * _OverlayColor.a * _OverlayBlend; + col.rgb += overlayCol.rgb; + #else + overlayCol.a *= _OverlayColor.a; + col = lerp(col, col * overlayCol, _OverlayBlend); + #endif + #endif + + //--------------------------------- + + //OUTBASE_ON + #if OUTBASE_ON + #if OUTBASEPIXELPERF_ON + half2 destUv = half2(_OutlinePixelWidth * _MainTex_TexelSize.x, _OutlinePixelWidth * _MainTex_TexelSize.y); + #else + half2 destUv = half2(_OutlineWidth * _MainTex_TexelSize.x * 200, _OutlineWidth * _MainTex_TexelSize.y * 200); + #endif + + #if OUTDIST_ON + d.texcoord3.x += ((_Time.x + _RandomSeed) * _OutlineDistortTexXSpeed) % 1; + d.texcoord3.y += ((_Time.x + _RandomSeed) * _OutlineDistortTexYSpeed) % 1; + #if ATLAS_ON + d.texcoord3 = half2((d.texcoord3.x - _MinXUV) / (_MaxXUV - _MinXUV), (d.texcoord3.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half outDistortAmnt = (SAMPLE_TEXTURE2D(_OutlineDistortTex, sampler_OutlineDistortTex, d.texcoord3).r - 0.5) * 0.2 * _OutlineDistortAmount; + destUv.x += outDistortAmnt; + destUv.y += outDistortAmnt; + #endif + + half spriteLeft = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(destUv.x, 0)).a; + half spriteRight = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy - half2(destUv.x, 0)).a; + half spriteBottom = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(0, destUv.y)).a; + half spriteTop = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy - half2(0, destUv.y)).a; + half result = spriteLeft + spriteRight + spriteBottom + spriteTop; + + #if OUTBASE8DIR_ON + half spriteTopLeft = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(destUv.x, destUv.y)).a; + half spriteTopRight = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(-destUv.x, destUv.y)).a; + half spriteBotLeft = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(destUv.x, -destUv.y)).a; + half spriteBotRight = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(-destUv.x, -destUv.y)).a; + result = result + spriteTopLeft + spriteTopRight + spriteBotLeft + spriteBotRight; + #endif + + result = step(0.05, saturate(result)); + + #if OUTTEX_ON + d.texcoord1.x += ((_Time.x + _RandomSeed) * _OutlineTexXSpeed) % 1; + d.texcoord1.y += ((_Time.x + _RandomSeed) * _OutlineTexYSpeed) % 1; + #if ATLAS_ON + d.texcoord1 = half2((d.texcoord1.x - _MinXUV) / (_MaxXUV - _MinXUV), (d.texcoord1.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half4 tempOutColor = SAMPLE_TEXTURE2D(_OutlineTex, sampler_OutlineTex, d.texcoord1); + tempOutColor *= _OutlineColor; + _OutlineColor = tempOutColor; + #endif + + result *= (1 - originalAlpha) * _OutlineAlpha; + + half4 outline = _OutlineColor * d.vertexColor.a; + outline.rgb *= _OutlineGlow; + outline.a = result; + #if ONLYOUTLINE_ON + col = outline; + #else + col = lerp(col, outline, result); + #endif + #endif + //------------------------------------------------------- + + //FADE_ON + #if FADE_ON + half2 tiledUvFade1 = TRANSFORM_TEX(d.texcoord0, _FadeTex); + half2 tiledUvFade2 = TRANSFORM_TEX(d.texcoord0, _FadeBurnTex); + #if ATLAS_ON + tiledUvFade1 = half2((tiledUvFade1.x - _MinXUV) / (_MaxXUV - _MinXUV), (tiledUvFade1.y - _MinYUV) / (_MaxYUV - _MinYUV)); + tiledUvFade2 = half2((tiledUvFade2.x - _MinXUV) / (_MaxXUV - _MinXUV), (tiledUvFade2.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half fadeTemp = SAMPLE_TEXTURE2D(_FadeTex, sampler_FadeTex, tiledUvFade1).r; + half fade = smoothstep(_FadeAmount, _FadeAmount + _FadeBurnTransition, fadeTemp); + half fadeBurn = saturate(smoothstep(_FadeAmount - _FadeBurnWidth, _FadeAmount - _FadeBurnWidth + 0.1, fadeTemp) * _FadeAmount); + col.a *= fade; + _FadeBurnColor.rgb *= _FadeBurnGlow; + col += fadeBurn * SAMPLE_TEXTURE2D(_FadeBurnTex, sampler_FadeBurnTex, tiledUvFade2) * _FadeBurnColor * originalAlpha * (1 - col.a); + #endif + //------------------------------------------------------- + + //SHADOW_ON + #if SHADOW_ON + half shadowA = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(_ShadowX, _ShadowY)).a; + half preMultShadowMask = 1 - (saturate(shadowA - col.a) * (1 - col.a)); + col.rgb *= 1 - ((shadowA - col.a) * (1 - col.a)); + col.rgb += (_ShadowColor * shadowA) * (1 - col.a); + col.a = max(shadowA * _ShadowAlpha * d.vertexColor.a, col.a); + #endif + + //------------------------------------------------------- + + //GLOW_ON + #if GLOW_ON + half4 emission; + #if GLOWTEX_ON + emission = SAMPLE_TEXTURE2D(_GlowTex, sampler_GlowTex, d.texcoord0); + #else + emission = col; + #endif + + col.rgb *= _GlowGlobal; + emission.rgb *= emission.a * col.a * _Glow * _GlowColor; + col.rgb += emission.rgb; + #endif + //------------------------------------------------------- + + //COLORRAMP_ON && COLORRAMPOUTLINE_ON + #if COLORRAMP_ON && COLORRAMPOUTLINE_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + luminance = saturate(luminance + _ColorRampLuminosity); + #if GRADIENTCOLORRAMP_ON + col.rgb = lerp(col.rgb, SAMPLE_TEXTURE2D(_ColorRampTexGradient, sampler_ColorRampTexGradient, half2(luminance, 0)).rgb, _ColorRampBlend); + #else + col.rgb = lerp(col.rgb, SAMPLE_TEXTURE2D(_ColorRampTex, sampler_ColorRampTex, half2(luminance, 0)).rgb, _ColorRampBlend); + #endif + #endif + //--------------- + + //GREYSCALE_ON && GREYSCALEOUTLINE_ON + #if GREYSCALE_ON && GREYSCALEOUTLINE_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + luminance = saturate(luminance + _GreyscaleLuminosity); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _GreyscaleTintColor, _GreyscaleBlend); + #endif + + //----------------------------------- + + //POSTERIZE_ON && POSTERIZEOUTLINE_ON + #if POSTERIZE_ON && POSTERIZEOUTLINE_ON + col.rgb = pow(col.rgb, _PosterizeGamma) * _PosterizeNumColors; + col.rgb = floor(col.rgb) / _PosterizeNumColors; + col.rgb = pow(col.rgb, 1.0 / _PosterizeGamma); + #endif + + //----------------------------------- + + //SHINE_ON + #if SHINE_ON + half2 uvShine = uvRect; + half cosAngle = cos(_ShineRotate); + half sinAngle = sin(_ShineRotate); + half2x2 rot = half2x2(cosAngle, -sinAngle, sinAngle, cosAngle); + uvShine -= half2(0.5, 0.5); + uvShine = mul(rot, uvShine); + uvShine += half2(0.5, 0.5); + half shineMask = SAMPLE_TEXTURE2D(_ShineMask, sampler_ShineMask, d.texcoord0.xy).a; + half currentDistanceProjection = (uvShine.x + uvShine.y) / 2; + half whitePower = 1 - (abs(currentDistanceProjection - _ShineLocation) / _ShineWidth); + col.rgb += col.a * whitePower * _ShineGlow * max(sign(currentDistanceProjection - (_ShineLocation - _ShineWidth)), 0.0) + * max(sign((_ShineLocation + _ShineWidth) - currentDistanceProjection), 0.0) * _ShineColor * shineMask; + #endif + + //----------------------------------- + + //HOLOGRAM_ON + #if HOLOGRAM_ON + half totalHologram = _HologramStripesAmount + _HologramUnmodAmount; + half hologramYCoord = ((uvRect.y + (((_Time.x + randomSeed) % 1) * _HologramStripesSpeed)) % totalHologram) / totalHologram; + hologramYCoord = abs(hologramYCoord); + half alpha = RemapFloat(saturate(hologramYCoord - (_HologramUnmodAmount/totalHologram)), 0.0, 1.0, _HologramMinAlpha, saturate(_HologramMaxAlpha)); + half hologramMask = max(sign((_HologramUnmodAmount/totalHologram) - hologramYCoord), 0.0); + half4 hologramResult = col; + hologramResult.a *= lerp(alpha, 1, hologramMask); + hologramResult.rgb *= max(1, _HologramMaxAlpha * max(sign(hologramYCoord - (_HologramUnmodAmount/totalHologram)), 0.0)); + hologramMask = 1 - step(0.01,hologramMask); + hologramResult.rgb += hologramMask * _HologramStripeColor * col.a; + col = lerp(col, hologramResult, _HologramBlend); + #endif + + //----------------------------------- + + //FLICKER_ON + #if FLICKER_ON + col.a *= saturate(col.a * step(frac(0.05 + (_Time.w + randomSeed) * _FlickerFreq), 1 - _FlickerPercent) + _FlickerAlpha); + #endif + //----------------------------------- + + //ALPHACUTOFF_ON + + //ALPHAROUND_ON + + //ALPHAOUTLINE_ON + #if ALPHAOUTLINE_ON + half alphaOutlineRes = pow(1 - col.a, max(_AlphaOutlinePower, 0.0001)) * step(_AlphaOutlineMinAlpha, col.a) * _AlphaOutlineBlend; + col.rgb = lerp(col.rgb, _AlphaOutlineColor.rgb * _AlphaOutlineGlow, alphaOutlineRes); + col.a = lerp(col.a, 1, alphaOutlineRes > 1); + #endif + //------------------------------------------------------- + + //FOG_ON + + //------------------ + + col *= _Color; + o.Albedo = col; + col.a *= _Alpha; + clip(col.a - _AlphaCutoffValue - 0.01); + o.Alpha = _Color.a; + } + + + + + + void ChainSurfaceFunction(inout Surface l, inout ShaderData d) + { + Ext_SurfaceFunction0(l, d); + // Ext_SurfaceFunction1(l, d); + // Ext_SurfaceFunction2(l, d); + // Ext_SurfaceFunction3(l, d); + // Ext_SurfaceFunction4(l, d); + // Ext_SurfaceFunction5(l, d); + // Ext_SurfaceFunction6(l, d); + // Ext_SurfaceFunction7(l, d); + // Ext_SurfaceFunction8(l, d); + // Ext_SurfaceFunction9(l, d); + // Ext_SurfaceFunction10(l, d); + // Ext_SurfaceFunction11(l, d); + // Ext_SurfaceFunction12(l, d); + // Ext_SurfaceFunction13(l, d); + // Ext_SurfaceFunction14(l, d); + // Ext_SurfaceFunction15(l, d); + // Ext_SurfaceFunction16(l, d); + // Ext_SurfaceFunction17(l, d); + // Ext_SurfaceFunction18(l, d); + // Ext_SurfaceFunction19(l, d); + // Ext_SurfaceFunction20(l, d); + // Ext_SurfaceFunction21(l, d); + // Ext_SurfaceFunction22(l, d); + // Ext_SurfaceFunction23(l, d); + // Ext_SurfaceFunction24(l, d); + // Ext_SurfaceFunction25(l, d); + // Ext_SurfaceFunction26(l, d); + // Ext_SurfaceFunction27(l, d); + // Ext_SurfaceFunction28(l, d); + // Ext_SurfaceFunction29(l, d); + } + +#if !_DECALSHADER + + void ChainModifyVertex(inout VertexData v, inout VertexToPixel v2p, float4 time) + { + ExtraV2F d; + + ZERO_INITIALIZE(ExtraV2F, d); + ZERO_INITIALIZE(Blackboard, d.blackboard); + // due to motion vectors in HDRP, we need to use the last + // time in certain spots. So if you are going to use _Time to adjust vertices, + // you need to use this time or motion vectors will break. + d.time = time; + + Ext_ModifyVertex0(v, d); + // Ext_ModifyVertex1(v, d); + // Ext_ModifyVertex2(v, d); + // Ext_ModifyVertex3(v, d); + // Ext_ModifyVertex4(v, d); + // Ext_ModifyVertex5(v, d); + // Ext_ModifyVertex6(v, d); + // Ext_ModifyVertex7(v, d); + // Ext_ModifyVertex8(v, d); + // Ext_ModifyVertex9(v, d); + // Ext_ModifyVertex10(v, d); + // Ext_ModifyVertex11(v, d); + // Ext_ModifyVertex12(v, d); + // Ext_ModifyVertex13(v, d); + // Ext_ModifyVertex14(v, d); + // Ext_ModifyVertex15(v, d); + // Ext_ModifyVertex16(v, d); + // Ext_ModifyVertex17(v, d); + // Ext_ModifyVertex18(v, d); + // Ext_ModifyVertex19(v, d); + // Ext_ModifyVertex20(v, d); + // Ext_ModifyVertex21(v, d); + // Ext_ModifyVertex22(v, d); + // Ext_ModifyVertex23(v, d); + // Ext_ModifyVertex24(v, d); + // Ext_ModifyVertex25(v, d); + // Ext_ModifyVertex26(v, d); + // Ext_ModifyVertex27(v, d); + // Ext_ModifyVertex28(v, d); + // Ext_ModifyVertex29(v, d); + + + // #if %EXTRAV2F0REQUIREKEY% + // v2p.extraV2F0 = d.extraV2F0; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // v2p.extraV2F1 = d.extraV2F1; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // v2p.extraV2F2 = d.extraV2F2; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // v2p.extraV2F3 = d.extraV2F3; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // v2p.extraV2F4 = d.extraV2F4; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // v2p.extraV2F5 = d.extraV2F5; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // v2p.extraV2F6 = d.extraV2F6; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // v2p.extraV2F7 = d.extraV2F7; + // #endif + } + + void ChainModifyTessellatedVertex(inout VertexData v, inout VertexToPixel v2p) + { + ExtraV2F d; + ZERO_INITIALIZE(ExtraV2F, d); + ZERO_INITIALIZE(Blackboard, d.blackboard); + + // #if %EXTRAV2F0REQUIREKEY% + // d.extraV2F0 = v2p.extraV2F0; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // d.extraV2F1 = v2p.extraV2F1; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // d.extraV2F2 = v2p.extraV2F2; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // d.extraV2F3 = v2p.extraV2F3; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // d.extraV2F4 = v2p.extraV2F4; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // d.extraV2F5 = v2p.extraV2F5; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // d.extraV2F6 = v2p.extraV2F6; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // d.extraV2F7 = v2p.extraV2F7; + // #endif + + + // Ext_ModifyTessellatedVertex0(v, d); + // Ext_ModifyTessellatedVertex1(v, d); + // Ext_ModifyTessellatedVertex2(v, d); + // Ext_ModifyTessellatedVertex3(v, d); + // Ext_ModifyTessellatedVertex4(v, d); + // Ext_ModifyTessellatedVertex5(v, d); + // Ext_ModifyTessellatedVertex6(v, d); + // Ext_ModifyTessellatedVertex7(v, d); + // Ext_ModifyTessellatedVertex8(v, d); + // Ext_ModifyTessellatedVertex9(v, d); + // Ext_ModifyTessellatedVertex10(v, d); + // Ext_ModifyTessellatedVertex11(v, d); + // Ext_ModifyTessellatedVertex12(v, d); + // Ext_ModifyTessellatedVertex13(v, d); + // Ext_ModifyTessellatedVertex14(v, d); + // Ext_ModifyTessellatedVertex15(v, d); + // Ext_ModifyTessellatedVertex16(v, d); + // Ext_ModifyTessellatedVertex17(v, d); + // Ext_ModifyTessellatedVertex18(v, d); + // Ext_ModifyTessellatedVertex19(v, d); + // Ext_ModifyTessellatedVertex20(v, d); + // Ext_ModifyTessellatedVertex21(v, d); + // Ext_ModifyTessellatedVertex22(v, d); + // Ext_ModifyTessellatedVertex23(v, d); + // Ext_ModifyTessellatedVertex24(v, d); + // Ext_ModifyTessellatedVertex25(v, d); + // Ext_ModifyTessellatedVertex26(v, d); + // Ext_ModifyTessellatedVertex27(v, d); + // Ext_ModifyTessellatedVertex28(v, d); + // Ext_ModifyTessellatedVertex29(v, d); + + // #if %EXTRAV2F0REQUIREKEY% + // v2p.extraV2F0 = d.extraV2F0; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // v2p.extraV2F1 = d.extraV2F1; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // v2p.extraV2F2 = d.extraV2F2; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // v2p.extraV2F3 = d.extraV2F3; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // v2p.extraV2F4 = d.extraV2F4; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // v2p.extraV2F5 = d.extraV2F5; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // v2p.extraV2F6 = d.extraV2F6; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // v2p.extraV2F7 = d.extraV2F7; + // #endif + } + + void ChainFinalColorForward(inout Surface l, inout ShaderData d, inout half4 color) + { + // Ext_FinalColorForward0(l, d, color); + // Ext_FinalColorForward1(l, d, color); + // Ext_FinalColorForward2(l, d, color); + // Ext_FinalColorForward3(l, d, color); + // Ext_FinalColorForward4(l, d, color); + // Ext_FinalColorForward5(l, d, color); + // Ext_FinalColorForward6(l, d, color); + // Ext_FinalColorForward7(l, d, color); + // Ext_FinalColorForward8(l, d, color); + // Ext_FinalColorForward9(l, d, color); + // Ext_FinalColorForward10(l, d, color); + // Ext_FinalColorForward11(l, d, color); + // Ext_FinalColorForward12(l, d, color); + // Ext_FinalColorForward13(l, d, color); + // Ext_FinalColorForward14(l, d, color); + // Ext_FinalColorForward15(l, d, color); + // Ext_FinalColorForward16(l, d, color); + // Ext_FinalColorForward17(l, d, color); + // Ext_FinalColorForward18(l, d, color); + // Ext_FinalColorForward19(l, d, color); + // Ext_FinalColorForward20(l, d, color); + // Ext_FinalColorForward21(l, d, color); + // Ext_FinalColorForward22(l, d, color); + // Ext_FinalColorForward23(l, d, color); + // Ext_FinalColorForward24(l, d, color); + // Ext_FinalColorForward25(l, d, color); + // Ext_FinalColorForward26(l, d, color); + // Ext_FinalColorForward27(l, d, color); + // Ext_FinalColorForward28(l, d, color); + // Ext_FinalColorForward29(l, d, color); + } + + void ChainFinalGBufferStandard(inout Surface s, inout ShaderData d, inout half4 GBuffer0, inout half4 GBuffer1, inout half4 GBuffer2, inout half4 outEmission, inout half4 outShadowMask) + { + // Ext_FinalGBufferStandard0(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard1(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard2(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard3(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard4(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard5(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard6(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard7(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard8(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard9(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard10(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard11(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard12(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard13(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard14(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard15(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard16(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard17(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard18(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard19(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard20(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard21(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard22(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard23(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard24(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard25(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard26(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard27(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard28(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard29(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + } +#endif + + + + + +#if _DECALSHADER + + ShaderData CreateShaderData(SurfaceDescriptionInputs IN) + { + ShaderData d = (ShaderData)0; + d.TBNMatrix = float3x3(IN.WorldSpaceTangent, IN.WorldSpaceBiTangent, IN.WorldSpaceNormal); + d.worldSpaceNormal = IN.WorldSpaceNormal; + d.worldSpaceTangent = IN.WorldSpaceTangent; + + d.worldSpacePosition = IN.WorldSpacePosition; + d.texcoord0 = IN.uv0.xyxy; + d.screenPos = IN.ScreenPosition; + + d.worldSpaceViewDir = normalize(_WorldSpaceCameraPos - d.worldSpacePosition); + + d.tangentSpaceViewDir = mul(d.TBNMatrix, d.worldSpaceViewDir); + + // these rarely get used, so we back transform them. Usually will be stripped. + #if _HDRP + // d.localSpacePosition = mul(GetWorldToObjectMatrix(), float4(GetCameraRelativePositionWS(d.worldSpacePosition), 1)).xyz; + #else + // d.localSpacePosition = mul(GetWorldToObjectMatrix(), float4(d.worldSpacePosition, 1)).xyz; + #endif + // d.localSpaceNormal = normalize(mul((float3x3)GetWorldToObjectMatrix(), d.worldSpaceNormal)); + // d.localSpaceTangent = normalize(mul((float3x3)GetWorldToObjectMatrix(), d.worldSpaceTangent.xyz)); + + // #if %SCREENPOSREQUIREKEY% + // d.screenUV = (IN.ScreenPosition.xy / max(0.01, IN.ScreenPosition.w)); + // #endif + + return d; + } +#else + + ShaderData CreateShaderData(VertexToPixel i + #if NEED_FACING + , bool facing + #endif + ) + { + ShaderData d = (ShaderData)0; + d.clipPos = i.pos; + d.worldSpacePosition = i.worldPos; + + d.worldSpaceNormal = normalize(i.worldNormal); + d.worldSpaceTangent.xyz = normalize(i.worldTangent.xyz); + + d.tangentSign = i.worldTangent.w * unity_WorldTransformParams.w; + float3 bitangent = cross(d.worldSpaceTangent.xyz, d.worldSpaceNormal) * d.tangentSign; + + d.TBNMatrix = float3x3(d.worldSpaceTangent, -bitangent, d.worldSpaceNormal); + d.worldSpaceViewDir = normalize(_WorldSpaceCameraPos - i.worldPos); + + d.tangentSpaceViewDir = mul(d.TBNMatrix, d.worldSpaceViewDir); + d.texcoord0 = i.texcoord0; + d.texcoord1 = i.texcoord1; + d.texcoord2 = i.texcoord2; + + // #if %TEXCOORD3REQUIREKEY% + d.texcoord3 = i.texcoord3; + // #endif + + // d.isFrontFace = facing; + // #if %VERTEXCOLORREQUIREKEY% + d.vertexColor = i.vertexColor; + // #endif + + // these rarely get used, so we back transform them. Usually will be stripped. + #if _HDRP + // d.localSpacePosition = mul(GetWorldToObjectMatrix(), float4(GetCameraRelativePositionWS(i.worldPos), 1)).xyz; + #else + // d.localSpacePosition = mul(GetWorldToObjectMatrix(), float4(i.worldPos, 1)).xyz; + #endif + // d.localSpaceNormal = normalize(mul((float3x3)GetWorldToObjectMatrix(), i.worldNormal)); + // d.localSpaceTangent = normalize(mul((float3x3)GetWorldToObjectMatrix(), i.worldTangent.xyz)); + + // #if %SCREENPOSREQUIREKEY% + // d.screenPos = i.screenPos; + // d.screenUV = (i.screenPos.xy / i.screenPos.w); + // #endif + + + // #if %EXTRAV2F0REQUIREKEY% + // d.extraV2F0 = i.extraV2F0; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // d.extraV2F1 = i.extraV2F1; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // d.extraV2F2 = i.extraV2F2; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // d.extraV2F3 = i.extraV2F3; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // d.extraV2F4 = i.extraV2F4; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // d.extraV2F5 = i.extraV2F5; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // d.extraV2F6 = i.extraV2F6; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // d.extraV2F7 = i.extraV2F7; + // #endif + + return d; + } + +#endif + + + +struct VaryingsToPS +{ + VertexToPixel vmesh; + #ifdef VARYINGS_NEED_PASS + VaryingsPassToPS vpass; + #endif +}; + +struct PackedVaryingsToPS +{ + #ifdef VARYINGS_NEED_PASS + PackedVaryingsPassToPS vpass; + #endif + VertexToPixel vmesh; + + UNITY_VERTEX_OUTPUT_STEREO +}; + +PackedVaryingsToPS PackVaryingsToPS(VaryingsToPS input) +{ + PackedVaryingsToPS output = (PackedVaryingsToPS)0; + output.vmesh = input.vmesh; + #ifdef VARYINGS_NEED_PASS + output.vpass = PackVaryingsPassToPS(input.vpass); + #endif + + UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(output); + return output; +} + + + + +VertexToPixel VertMesh(VertexData input) +{ + VertexToPixel output = (VertexToPixel)0; + + UNITY_SETUP_INSTANCE_ID(input); + UNITY_TRANSFER_INSTANCE_ID(input, output); + + + ChainModifyVertex(input, output, _Time); + + + // This return the camera relative position (if enable) + float3 positionRWS = TransformObjectToWorld(input.vertex.xyz); + float3 normalWS = TransformObjectToWorldNormal(input.normal); + float4 tangentWS = float4(TransformObjectToWorldDir(input.tangent.xyz), input.tangent.w); + + + output.worldPos = GetAbsolutePositionWS(positionRWS); + output.pos = TransformWorldToHClip(positionRWS); + output.worldNormal = normalWS; + output.worldTangent = tangentWS; + + + output.texcoord0 = input.texcoord0; + output.texcoord1 = input.texcoord1; + output.texcoord2 = input.texcoord2; + // #if %TEXCOORD3REQUIREKEY% + output.texcoord3 = input.texcoord3; + // #endif + + // #if %SCREENPOSREQUIREKEY% + // output.screenPos = ComputeScreenPos(output.pos, _ProjectionParams.x); + // #endif + + // #if %VERTEXCOLORREQUIREKEY% + output.vertexColor = input.vertexColor; + // #endif + return output; +} + + +#if (SHADERPASS == SHADERPASS_DBUFFER_MESH) +void MeshDecalsPositionZBias(inout VaryingsToPS input) +{ +#if defined(UNITY_REVERSED_Z) + input.vmesh.pos.z -= _DecalMeshDepthBias; +#else + input.vmesh.pos.z += _DecalMeshDepthBias; +#endif +} +#endif + + +#if (SHADERPASS == SHADERPASS_LIGHT_TRANSPORT) + +// This was not in constant buffer in original unity, so keep outiside. But should be in as ShaderRenderPass frequency +float unity_OneOverOutputBoost; +float unity_MaxOutputValue; + +CBUFFER_START(UnityMetaPass) +// x = use uv1 as raster position +// y = use uv2 as raster position +bool4 unity_MetaVertexControl; + +// x = return albedo +// y = return normal +bool4 unity_MetaFragmentControl; +CBUFFER_END + +PackedVaryingsToPS Vert(VertexData inputMesh) +{ + VaryingsToPS output = (VaryingsToPS)0; + output.vmesh = (VertexToPixel)0; + + UNITY_SETUP_INSTANCE_ID(inputMesh); + UNITY_TRANSFER_INSTANCE_ID(inputMesh, output.vmesh); + + // Output UV coordinate in vertex shader + float2 uv = float2(0.0, 0.0); + + if (unity_MetaVertexControl.x) + { + uv = inputMesh.texcoord1.xy * unity_LightmapST.xy + unity_LightmapST.zw; + } + else if (unity_MetaVertexControl.y) + { + uv = inputMesh.texcoord2.xy * unity_DynamicLightmapST.xy + unity_DynamicLightmapST.zw; + } + + // OpenGL right now needs to actually use the incoming vertex position + // so we create a fake dependency on it here that haven't any impact. + output.vmesh.pos = float4(uv * 2.0 - 1.0, inputMesh.vertex.z > 0 ? 1.0e-4 : 0.0, 1.0); + +#ifdef VARYINGS_NEED_POSITION_WS + output.vmesh.worldPos = TransformObjectToWorld(inputMesh.vertex.xyz); +#endif + +#ifdef VARYINGS_NEED_TANGENT_TO_WORLD + // Normal is required for triplanar mapping + output.vmesh.worldNormal = TransformObjectToWorldNormal(inputMesh.normal); + // Not required but assign to silent compiler warning + output.vmesh.worldTangent = float4(1.0, 0.0, 0.0, 0.0); +#endif + + output.vmesh.texcoord0 = inputMesh.texcoord0; + output.vmesh.texcoord1 = inputMesh.texcoord1; + output.vmesh.texcoord2 = inputMesh.texcoord2; + // #if %TEXCOORD3REQUIREKEY% + output.vmesh.texcoord3 = inputMesh.texcoord3; + // #endif + + // #if %VERTEXCOLORREQUIREKEY% + output.vmesh.vertexColor = inputMesh.vertexColor; + // #endif + + return PackVaryingsToPS(output); +} +#else + +PackedVaryingsToPS Vert(VertexData inputMesh) +{ + VaryingsToPS varyingsType; + varyingsType.vmesh = VertMesh(inputMesh); + #if (SHADERPASS == SHADERPASS_DBUFFER_MESH) + MeshDecalsPositionZBias(varyingsType); + #endif + return PackVaryingsToPS(varyingsType); +} + +#endif + + + + + + + FragInputs BuildFragInputs(VertexToPixel input) + { + UNITY_SETUP_INSTANCE_ID(input); + FragInputs output; + ZERO_INITIALIZE(FragInputs, output); + + // Init to some default value to make the computer quiet (else it output 'divide by zero' warning even if value is not used). + // TODO: this is a really poor workaround, but the variable is used in a bunch of places + // to compute normals which are then passed on elsewhere to compute other values... + output.tangentToWorld = k_identity3x3; + output.positionSS = input.pos; // input.positionCS is SV_Position + + output.positionRWS = GetCameraRelativePositionWS(input.worldPos); + output.tangentToWorld = BuildTangentToWorld(input.worldTangent, input.worldNormal); + output.texCoord0 = input.texcoord0; + output.texCoord1 = input.texcoord1; + output.texCoord2 = input.texcoord2; + + return output; + } + + void BuildSurfaceData(FragInputs fragInputs, inout Surface surfaceDescription, float3 V, PositionInputs posInput, out SurfaceData surfaceData, out float3 bentNormalWS) + { + // setup defaults -- these are used if the graph doesn't output a value + ZERO_INITIALIZE(SurfaceData, surfaceData); + + // specularOcclusion need to be init ahead of decal to quiet the compiler that modify the SurfaceData struct + // however specularOcclusion can come from the graph, so need to be init here so it can be override. + surfaceData.specularOcclusion = 1.0; + + // copy across graph values, if defined + surfaceData.baseColor = surfaceDescription.Albedo; + surfaceData.perceptualSmoothness = surfaceDescription.Smoothness; + surfaceData.ambientOcclusion = surfaceDescription.Occlusion; + surfaceData.specularOcclusion = surfaceDescription.SpecularOcclusion; + surfaceData.metallic = surfaceDescription.Metallic; + surfaceData.subsurfaceMask = surfaceDescription.SubsurfaceMask; + surfaceData.thickness = surfaceDescription.Thickness; + surfaceData.diffusionProfileHash = asuint(surfaceDescription.DiffusionProfileHash); + #if _USESPECULAR + surfaceData.specularColor = surfaceDescription.Specular; + #endif + surfaceData.coatMask = surfaceDescription.CoatMask; + surfaceData.anisotropy = surfaceDescription.Anisotropy; + surfaceData.iridescenceMask = surfaceDescription.IridescenceMask; + surfaceData.iridescenceThickness = surfaceDescription.IridescenceThickness; + + #ifdef _HAS_REFRACTION + if (_EnableSSRefraction) + { + // surfaceData.ior = surfaceDescription.RefractionIndex; + // surfaceData.transmittanceColor = surfaceDescription.RefractionColor; + // surfaceData.atDistance = surfaceDescription.RefractionDistance; + + surfaceData.transmittanceMask = (1.0 - surfaceDescription.Alpha); + surfaceDescription.Alpha = 1.0; + } + else + { + surfaceData.ior = surfaceDescription.ior; + surfaceData.transmittanceColor = surfaceDescription.transmittanceColor; + surfaceData.atDistance = surfaceDescription.atDistance; + surfaceData.transmittanceMask = surfaceDescription.transmittanceMask; + surfaceDescription.Alpha = 1.0; + } + #else + surfaceData.ior = 1.0; + surfaceData.transmittanceColor = float3(1.0, 1.0, 1.0); + surfaceData.atDistance = 1.0; + surfaceData.transmittanceMask = 0.0; + #endif + + // These static material feature allow compile time optimization + surfaceData.materialFeatures = MATERIALFEATUREFLAGS_LIT_STANDARD; + #ifdef _MATERIAL_FEATURE_SUBSURFACE_SCATTERING + surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_SUBSURFACE_SCATTERING; + #endif + #ifdef _MATERIAL_FEATURE_TRANSMISSION + surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_TRANSMISSION; + #endif + #ifdef _MATERIAL_FEATURE_ANISOTROPY + surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_ANISOTROPY; + #endif + // surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_CLEAR_COAT; + + #ifdef _MATERIAL_FEATURE_IRIDESCENCE + surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_IRIDESCENCE; + #endif + #ifdef _MATERIAL_FEATURE_SPECULAR_COLOR + surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_SPECULAR_COLOR; + #endif + + #if defined (_MATERIAL_FEATURE_SPECULAR_COLOR) && defined (_ENERGY_CONSERVING_SPECULAR) + // Require to have setup baseColor + // Reproduce the energy conservation done in legacy Unity. Not ideal but better for compatibility and users can unchek it + surfaceData.baseColor *= (1.0 - Max3(surfaceData.specularColor.r, surfaceData.specularColor.g, surfaceData.specularColor.b)); + #endif + + + // tangent-space normal + float3 normalTS = float3(0.0f, 0.0f, 1.0f); + normalTS = surfaceDescription.Normal; + + // compute world space normal + #if !_WORLDSPACENORMAL + surfaceData.normalWS = mul(normalTS, fragInputs.tangentToWorld); + #else + surfaceData.normalWS = normalTS; + #endif + surfaceData.geomNormalWS = fragInputs.tangentToWorld[2]; + + surfaceData.tangentWS = normalize(fragInputs.tangentToWorld[0].xyz); // The tangent is not normalize in tangentToWorld for mikkt. TODO: Check if it expected that we normalize with Morten. Tag: SURFACE_GRADIENT + // surfaceData.tangentWS = TransformTangentToWorld(surfaceDescription.Tangent, fragInputs.tangentToWorld); + + #if HAVE_DECALS + if (_EnableDecals) + { + #if VERSION_GREATER_EQUAL(10,2) + DecalSurfaceData decalSurfaceData = GetDecalSurfaceData(posInput, surfaceData.geomNormalWS, surfaceDescription.Alpha); + ApplyDecalToSurfaceData(decalSurfaceData, surfaceData.geomNormalWS, surfaceData); + #else + DecalSurfaceData decalSurfaceData = GetDecalSurfaceData(posInput, surfaceDescription.Alpha); + ApplyDecalToSurfaceData(decalSurfaceData, surfaceData); + #endif + } + #endif + + bentNormalWS = surfaceData.normalWS; + + surfaceData.tangentWS = Orthonormalize(surfaceData.tangentWS, surfaceData.normalWS); + + + // By default we use the ambient occlusion with Tri-ace trick (apply outside) for specular occlusion. + // If user provide bent normal then we process a better term + #if defined(_SPECULAR_OCCLUSION_CUSTOM) + // Just use the value passed through via the slot (not active otherwise) + #elif defined(_SPECULAR_OCCLUSION_FROM_AO_BENT_NORMAL) + // If we have bent normal and ambient occlusion, process a specular occlusion + surfaceData.specularOcclusion = GetSpecularOcclusionFromBentAO(V, bentNormalWS, surfaceData.normalWS, surfaceData.ambientOcclusion, PerceptualSmoothnessToPerceptualRoughness(surfaceData.perceptualSmoothness)); + #elif defined(_AMBIENT_OCCLUSION) && defined(_SPECULAR_OCCLUSION_FROM_AO) + surfaceData.specularOcclusion = GetSpecularOcclusionFromAmbientOcclusion(ClampNdotV(dot(surfaceData.normalWS, V)), surfaceData.ambientOcclusion, PerceptualSmoothnessToRoughness(surfaceData.perceptualSmoothness)); + #endif + + #ifdef _ENABLE_GEOMETRIC_SPECULAR_AA + surfaceData.perceptualSmoothness = GeometricNormalFiltering(surfaceData.perceptualSmoothness, fragInputs.tangentToWorld[2], surfaceDescription.SpecularAAScreenSpaceVariance, surfaceDescription.SpecularAAThreshold); + #endif + + #ifdef DEBUG_DISPLAY + if (_DebugMipMapMode != DEBUGMIPMAPMODE_NONE) + { + // TODO: need to update mip info + surfaceData.metallic = 0; + } + + // We need to call ApplyDebugToSurfaceData after filling the surfarcedata and before filling builtinData + // as it can modify attribute use for static lighting + ApplyDebugToSurfaceData(fragInputs.tangentToWorld, surfaceData); + #endif + } + + void GetSurfaceAndBuiltinData(VertexToPixel m2ps, FragInputs fragInputs, float3 V, inout PositionInputs posInput, + out SurfaceData surfaceData, out BuiltinData builtinData, inout Surface l, inout ShaderData d + #if NEED_FACING + , bool facing + #endif + ) + { + // Removed since crossfade does not work, probably needs extra material setup. + //#ifdef LOD_FADE_CROSSFADE // enable dithering LOD transition if user select CrossFade transition in LOD group + // uint3 fadeMaskSeed = asuint((int3)(V * _ScreenSize.xyx)); // Quantize V to _ScreenSize values + // LODDitheringTransition(fadeMaskSeed, unity_LODFade.x); + //#endif + + d = CreateShaderData(m2ps + #if NEED_FACING + , facing + #endif + ); + + + + l = (Surface)0; + + l.Albedo = half3(0.5, 0.5, 0.5); + l.Normal = float3(0,0,1); + l.Occlusion = 1; + l.Alpha = 1; + l.SpecularOcclusion = 1; + + #ifdef _DEPTHOFFSET_ON + l.outputDepth = posInput.deviceDepth; + #endif + + ChainSurfaceFunction(l, d); + + #ifdef _DEPTHOFFSET_ON + posInput.deviceDepth = l.outputDepth; + #endif + + #if _UNLIT + //l.Emission = l.Albedo; + //l.Albedo = 0; + l.Normal = half3(0,0,1); + l.Occlusion = 1; + l.Metallic = 0; + l.Specular = 0; + #endif + + surfaceData.geomNormalWS = d.worldSpaceNormal; + surfaceData.tangentWS = d.worldSpaceTangent; + fragInputs.tangentToWorld = d.TBNMatrix; + + float3 bentNormalWS; + BuildSurfaceData(fragInputs, l, V, posInput, surfaceData, bentNormalWS); + + InitBuiltinData(posInput, l.Alpha, bentNormalWS, -d.worldSpaceNormal, fragInputs.texCoord1, fragInputs.texCoord2, builtinData); + + + + builtinData.emissiveColor = l.Emission; + + #if defined(_OVERRIDE_BAKEDGI) + builtinData.bakeDiffuseLighting = l.DiffuseGI; + builtinData.backBakeDiffuseLighting = l.BackDiffuseGI; + builtinData.emissiveColor += l.SpecularGI; + #endif + + #if defined(_OVERRIDE_SHADOWMASK) + builtinData.shadowMask0 = l.ShadowMask.x; + builtinData.shadowMask1 = l.ShadowMask.y; + builtinData.shadowMask2 = l.ShadowMask.z; + builtinData.shadowMask3 = l.ShadowMask.w; + #endif + + #if (SHADERPASS == SHADERPASS_DISTORTION) + //builtinData.distortion = surfaceDescription.Distortion; + //builtinData.distortionBlur = surfaceDescription.DistortionBlur; + builtinData.distortion = float2(0.0, 0.0); + builtinData.distortionBlur = 0.0; + #else + builtinData.distortion = float2(0.0, 0.0); + builtinData.distortionBlur = 0.0; + #endif + + PostInitBuiltinData(V, posInput, surfaceData, builtinData); + } + + + void Frag( PackedVaryingsToPS packedInput + #ifdef WRITE_NORMAL_BUFFER + , out float4 outNormalBuffer : SV_Target0 + #ifdef WRITE_MSAA_DEPTH + , out float1 depthColor : SV_Target1 + #endif + #elif defined(WRITE_MSAA_DEPTH) // When only WRITE_MSAA_DEPTH is define and not WRITE_NORMAL_BUFFER it mean we are Unlit and only need depth, but we still have normal buffer binded + , out float4 outNormalBuffer : SV_Target0 + , out float1 depthColor : SV_Target1 + #elif defined(SCENESELECTIONPASS) + , out float4 outColor : SV_Target0 + #endif + + #ifdef _DEPTHOFFSET_ON + , out float outputDepth : SV_Depth + #endif + #if NEED_FACING + , bool facing : SV_IsFrontFace + #endif + ) + { + UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX(packedInput); + FragInputs input = BuildFragInputs(packedInput.vmesh); + + // input.positionSS is SV_Position + PositionInputs posInput = GetPositionInput(input.positionSS.xy, _ScreenSize.zw, input.positionSS.z, input.positionSS.w, input.positionRWS); + + float3 V = GetWorldSpaceNormalizeViewDir(input.positionRWS); + + SurfaceData surfaceData; + BuiltinData builtinData; + Surface l; + ShaderData d; + GetSurfaceAndBuiltinData(packedInput.vmesh, input, V, posInput, surfaceData, builtinData, l, d + #if NEED_FACING + , facing + #endif + ); + + // to prevent stripping + surfaceData.normalWS *= saturate(l.Albedo.r + 9999); + + + + #ifdef _DEPTHOFFSET_ON + outputDepth = posInput.deviceDepth; + #endif + + #ifdef WRITE_NORMAL_BUFFER + EncodeIntoNormalBuffer(ConvertSurfaceDataToNormalData(surfaceData), posInput.positionSS, outNormalBuffer); + #ifdef WRITE_MSAA_DEPTH + // In case we are rendering in MSAA, reading the an MSAA depth buffer is way too expensive. To avoid that, we export the depth to a color buffer + depthColor = packedInput.vmesh.pos.z; + #endif + #elif defined(WRITE_MSAA_DEPTH) // When we are MSAA depth only without normal buffer + // Due to the binding order of these two render targets, we need to have them both declared + outNormalBuffer = float4(0.0, 0.0, 0.0, 1.0); + // In case we are rendering in MSAA, reading the an MSAA depth buffer is way too expensive. To avoid that, we export the depth to a color buffer + depthColor = packedInput.vmesh.pos.z; + #elif defined(SCENESELECTIONPASS) + // We use depth prepass for scene selection in the editor, this code allow to output the outline correctly + outColor = float4(_ObjectId, _PassValue, 1.0, 1.0); + #endif + } + + ENDHLSL + } + + + + + + + } + + + CustomEditor "AllIn1SpriteShaderLitMaterialInspector" +} diff --git a/Assets/Plugins/AllIn1SpriteShader/Shaders/LitShaders/AllIn1SpriteShaderLit_BetterShader_HDRP2019.txt.meta b/Assets/Plugins/AllIn1SpriteShader/Shaders/LitShaders/AllIn1SpriteShaderLit_BetterShader_HDRP2019.txt.meta new file mode 100644 index 000000000..bd913b547 --- /dev/null +++ b/Assets/Plugins/AllIn1SpriteShader/Shaders/LitShaders/AllIn1SpriteShaderLit_BetterShader_HDRP2019.txt.meta @@ -0,0 +1,14 @@ +fileFormatVersion: 2 +guid: e25ae0d994e4df1408dc1cbf96a8adf3 +TextScriptImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 156513 + packageName: All In 1 Sprite Shader + packageVersion: 4.25 + assetPath: Assets/Plugins/AllIn1SpriteShader/Shaders/LitShaders/AllIn1SpriteShaderLit_BetterShader_HDRP2019.txt + uploadId: 708810 diff --git a/Assets/Plugins/AllIn1SpriteShader/Shaders/LitShaders/AllIn1SpriteShaderLit_BetterShader_HDRP2020.txt b/Assets/Plugins/AllIn1SpriteShader/Shaders/LitShaders/AllIn1SpriteShaderLit_BetterShader_HDRP2020.txt new file mode 100644 index 000000000..b061ea451 --- /dev/null +++ b/Assets/Plugins/AllIn1SpriteShader/Shaders/LitShaders/AllIn1SpriteShaderLit_BetterShader_HDRP2020.txt @@ -0,0 +1,25648 @@ +//////////////////////////////////////// +// Generated with Better Shaders +// +// Auto-generated shader code, don't hand edit! +// +// Unity Version: 2019.4.16f1 +// Render Pipeline: HDRP2020 +// Platform: WindowsEditor +//////////////////////////////////////// + + +Shader "AllIn1SpriteShader/AllIn1SpriteShaderLit_BetterShader" +{ + Properties + { + + _MainTex ("Main Texture", 2D) = "white" {} //0 + _Color("Main Color", Color) = (1,1,1,1) //1 + _Alpha("General Alpha", Range(0,1)) = 1 //2 + + _GlowColor("Glow Color", Color) = (1,1,1,1) //3 + _Glow("Glow Color Intensity", Range(0,100)) = 10 //4 + _GlowGlobal("Global Glow Intensity", Range(1,100)) = 1 //5 + [NoScaleOffset] _GlowTex("Glow Texture", 2D) = "white" {} //6 + + _FadeTex("Fade Texture", 2D) = "white" {} //7 + _FadeAmount("Fade Amount", Range(-0.1,1)) = -0.1 //8 + _FadeBurnWidth("Fade Burn Width", Range(0,1)) = 0.025 //9 + _FadeBurnTransition("Burn Transition", Range(0.01,0.5)) = 0.075 //10 + _FadeBurnColor("Fade Burn Color", Color) = (1,1,0,1) //11 + _FadeBurnTex("Fade Burn Texture", 2D) = "white" {} //12 + _FadeBurnGlow("Fade Burn Glow", Range(1,250)) = 2//13 + + _OutlineColor("Outline Base Color", Color) = (1,1,1,1) //14 + _OutlineAlpha("Outline Base Alpha", Range(0,1)) = 1 //15 + _OutlineGlow("Outline Base Glow", Range(1,100)) = 1.5 //16 + _OutlineWidth("Outline Base Width", Range(0,0.2)) = 0.004 //17 + _OutlinePixelWidth("Outline Base Pixel Width", Int) = 1 //18 + + [Space] + _OutlineTex("Outline Texture", 2D) = "white" {} //19 + _OutlineTexXSpeed("Texture scroll speed X", Range(-50,50)) = 10 //20 + _OutlineTexYSpeed("Texture scroll speed Y", Range(-50,50)) = 0 //21 + + [Space] + _OutlineDistortTex("Outline Distortion Texture", 2D) = "white" {} //22 + _OutlineDistortAmount("Outline Distortion Amount", Range(0,2)) = 0.5 //23 + _OutlineDistortTexXSpeed("Distortion scroll speed X", Range(-50,50)) = 5 //24 + _OutlineDistortTexYSpeed("Distortion scroll speed Y", Range(-50,50)) = 5 //25 + + _AlphaOutlineColor("Color", Color) = (1, 1, 1, 1) //26 + _AlphaOutlineGlow("Outline Glow", Range(1,100)) = 5 //27 + _AlphaOutlinePower("Power", Range(0, 5)) = 1 // 28 + _AlphaOutlineMinAlpha("Min Alpha", Range(0, 1)) = 0 // 29 + _AlphaOutlineBlend("Blend", Range(0, 1)) = 1 // 30 + + _GradBlend("Gradient Blend", Range(0,1)) = 1 //31 + _GradTopLeftCol("Top Color", Color) = (1,0,0,1) //32 + _GradTopRightCol("Top Color 2", Color) = (1, 1, 0, 1) //33 + _GradBotLeftCol("Bot Color", Color) = (0,0,1,1) //34 + _GradBotRightCol("Bot Color 2", Color) = (0, 1, 0, 1) //35 + + [NoScaleOffset] _ColorSwapTex("Color Swap Texture", 2D) = "black" {} //36 + [HDR] _ColorSwapRed("Red Channel", Color) = (1,1,1,1) //37 + _ColorSwapRedLuminosity("Red luminosity", Range(-1,1)) = 0.5 //38 + [HDR] _ColorSwapGreen("Green Channel", Color) = (1,1,1,1) //39 + _ColorSwapGreenLuminosity("Green luminosity", Range(-1,1)) = 0.5 //40 + [HDR] _ColorSwapBlue("Blue Channel", Color) = (1,1,1,1) //41 + _ColorSwapBlueLuminosity("Blue luminosity", Range(-1,1)) = 0.5 //42 + + _HsvShift("Hue Shift", Range(0, 360)) = 180 //43 + _HsvSaturation("Saturation", Range(0, 2)) = 1 //44 + _HsvBright("Brightness", Range(0, 2)) = 1 //45 + + _HitEffectColor("Hit Effect Color", Color) = (1,1,1,1) //46 + _HitEffectGlow("Glow Intensity", Range(1,100)) = 5 //47 + [Space] + _HitEffectBlend("Hit Effect Blend", Range(0,1)) = 1 //48 + + _NegativeAmount("Negative Amount", Range(0, 1)) = 1 //49 + + _PixelateSize("Pixelate size", Range(4,512)) = 32 //50 + + [NoScaleOffset] _ColorRampTex("Color ramp Texture", 2D) = "white" {} //51 + _ColorRampLuminosity("Color ramp luminosity", Range(-1,1)) = 0 //52 + [Toggle()] _ColorRampOutline("Affects everything?", float) = 0 //53 + + _GreyscaleLuminosity("Greyscale luminosity", Range(-1,1)) = 0 //54 + [Toggle()] _GreyscaleOutline("Affects everything?", float) = 0 //55 + _GreyscaleTintColor("Greyscale Tint Color", Color) = (1,1,1,1) //56 + + _PosterizeNumColors("Number of Colors", Range(0,100)) = 8 //57 + _PosterizeGamma("Posterize Amount", Range(0.1,10)) = 0.75 //58 + [Toggle()] _PosterizeOutline("Affects everything?", float) = 0 //59 + + _BlurIntensity("Blur Intensity", Range(0,100)) = 10 //60 + [Toggle()] _BlurHD("Blur is Low Res?", float) = 0 //61 + + _MotionBlurAngle("Motion Blur Angle", Range(-1, 1)) = 0.1 //62 + _MotionBlurDist("Motion Blur Distance", Range(-3, 3)) = 1.25 //63 + + _GhostColorBoost("Ghost Color Boost", Range(0,5)) = 1 //64 + _GhostTransparency("Ghost Transparency", Range(0,1)) = 0 //65 + + _InnerOutlineColor("Inner Outline Color", Color) = (1,0,0,1) //66 + _InnerOutlineThickness("Outline Thickness", Range(0,3)) = 1 //67 + _InnerOutlineAlpha("Inner Outline Alpha", Range(0,1)) = 1 //68 + _InnerOutlineGlow("Inner Outline Glow", Range(1,250)) = 4 //69 + + _AlphaCutoffValue("Alpha cutoff value", Range(0, 1)) = 0.25 //70 + + [Toggle()] _OnlyOutline("Only render outline?", float) = 0 //71 + [Toggle()] _OnlyInnerOutline("Only render inner outline?", float) = 0 //72 + + _HologramStripesAmount("Stripes Amount", Range(0, 1)) = 0.1 //73 + _HologramUnmodAmount("Unchanged Amount", Range(0, 1)) = 0.0 //74 + _HologramStripesSpeed("Stripes Speed", Range(-20, 20)) = 4.5 //75 + _HologramMinAlpha("Min Alpha", Range(0, 1)) = 0.1 //76 + _HologramMaxAlpha("Max Alpha", Range(0, 100)) = 0.75 //77 + + _ChromAberrAmount("ChromAberr Amount", Range(0, 1)) = 1 //78 + _ChromAberrAlpha("ChromAberr Alpha", Range(0, 1)) = 0.4 //79 + + _GlitchAmount("Glitch Amount", Range(0, 20)) = 3 //80 + + _FlickerPercent("Flicker Percent", Range(0, 1)) = 0.05 //81 + _FlickerFreq("Flicker Frequency", Range(0, 5)) = 0.2 //82 + _FlickerAlpha("Flicker Alpha", Range(0, 1)) = 0 //83 + + _ShadowX("Shadow X Axis", Range(-0.5, 0.5)) = 0.1 //84 + _ShadowY("Shadow Y Axis", Range(-0.5, 0.5)) = -0.05 //85 + _ShadowAlpha("Shadow Alpha", Range(0, 1)) = 0.5 //86 + _ShadowColor("Shadow Color", Color) = (0, 0, 0, 1) //87 + + _HandDrawnAmount("Hand Drawn Amount", Range(0, 20)) = 10 //88 + _HandDrawnSpeed("Hand Drawn Speed", Range(1, 15)) = 5 //89 + + _GrassSpeed("Speed", Range(0,50)) = 2 //90 + _GrassWind("Bend amount", Range(0,50)) = 20 //91 + [Space] + [Toggle()] _GrassManualToggle("Manually animated?", float) = 0 //92 + _GrassManualAnim("Manual Anim Value", Range(-1,1)) = 1 //93 + + _WaveAmount("Wave Amount", Range(0, 25)) = 7 //94 + _WaveSpeed("Wave Speed", Range(0, 25)) = 10 //95 + _WaveStrength("Wave Strength", Range(0, 25)) = 7.5 //96 + _WaveX("Wave X Axis", Range(0, 1)) = 0 //97 + _WaveY("Wave Y Axis", Range(0, 1)) = 0.5 //98 + + _RectSize("Rect Size", Range(1, 4)) = 1 //99 + + _OffsetUvX("X axis", Range(-1, 1)) = 0 //100 + _OffsetUvY("Y axis", Range(-1, 1)) = 0 //101 + + _ClipUvLeft("Clipping Left", Range(0, 1)) = 0 //102 + _ClipUvRight("Clipping Right", Range(0, 1)) = 0 //103 + _ClipUvUp("Clipping Up", Range(0, 1)) = 0 //104 + _ClipUvDown("Clipping Down", Range(0, 1)) = 0 //105 + + _TextureScrollXSpeed("Speed X Axis", Range(-5, 5)) = 1 //106 + _TextureScrollYSpeed("Speed Y Axis", Range(-5, 5)) = 0 //107 + + _ZoomUvAmount("Zoom Amount", Range(0.1, 5)) = 0.5 //108 + + _DistortTex("Distortion Texture", 2D) = "white" {} //109 + _DistortAmount("Distortion Amount", Range(0,2)) = 0.5 //110 + _DistortTexXSpeed("Scroll speed X", Range(-50,50)) = 5 //111 + _DistortTexYSpeed("Scroll speed Y", Range(-50,50)) = 5 //112 + + _TwistUvAmount("Twist Amount", Range(0, 3.1416)) = 1 //113 + _TwistUvPosX("Twist Pos X Axis", Range(0, 1)) = 0.5 //114 + _TwistUvPosY("Twist Pos Y Axis", Range(0, 1)) = 0.5 //115 + _TwistUvRadius("Twist Radius", Range(0, 3)) = 0.75 //116 + + _RotateUvAmount("Rotate Angle(radians)", Range(0, 6.2831)) = 0 //117 + + _FishEyeUvAmount("Fish Eye Amount", Range(0, 0.5)) = 0.35 //118 + + _PinchUvAmount("Pinch Amount", Range(0, 0.5)) = 0.35 //119 + + _ShakeUvSpeed("Shake Speed", Range(0, 20)) = 2.5 //120 + _ShakeUvX("X Multiplier", Range(0, 5)) = 1.5 //121 + _ShakeUvY("Y Multiplier", Range(0, 5)) = 1 //122 + + _ColorChangeTolerance("Tolerance", Range(0, 1)) = 0.25 //123 + _ColorChangeTarget("Color to change", Color) = (1, 0, 0, 1) //124 + [HDR] _ColorChangeNewCol("New Color", Color) = (1, 1, 0, 1) //125 + _ColorChangeLuminosity("New Color Luminosity", Range(0, 1)) = 0.0 //126 + + _RoundWaveStrength("Wave Strength", Range(0, 1)) = 0.7 //127 + _RoundWaveSpeed("Wave Speed", Range(0, 5)) = 2 //128 + + [Toggle()] _BillboardY("Billboard on both axis?", float) = 0 //129 + _ZWrite ("Depth Write", Float) = 1.0 // 130 + + _MySrcMode ("SrcMode", Float) = 5 // 131 + _MyDstMode ("DstMode", Float) = 10 // 132 + + _ShineColor("Shine Color", Color) = (1,1,1,1) // 133 + _ShineLocation("Shine Location", Range(0,1)) = 0.5 // 134 + _ShineRotate("Rotate Angle(radians)", Range(0, 6.2831)) = 0 //135 + _ShineWidth("Shine Width", Range(0.05,1)) = 0.1 // 136 + _ShineGlow("Shine Glow", Range(0,100)) = 1 // 137 + [NoScaleOffset] _ShineMask("Shine Mask", 2D) = "white" {} // 138 + + _GlitchSize("Glitch Size", Range(0.25, 5)) = 1 //139 + _HologramStripeColor("Stripes Color", Color) = (0,1,1,1) //140 + _GradBoostX("Boost X axis", Range(0.1, 5)) = 1.2 //141 + _GradBoostY("Boost Y axis", Range(0.1, 5)) = 1.2 //142 + [Toggle()] _GradIsRadial("Radial Gradient?", float) = 0 //143 + _AlphaRoundThreshold("Round Threshold", Range(0.005, 1.0)) = 0.5 //144 + _GrassRadialBend("Radial Bend", Range(0.0, 5.0)) = 0.1 //145 + + _ColorChangeTolerance2("Tolerance 2", Range(0, 1)) = 0.25 //146 + _ColorChangeTarget2("Color to change 2", Color) = (1, 0, 0, 1) //147 + [HDR] _ColorChangeNewCol2("New Color 2", Color) = (1, 1, 0, 1) //148 + _ColorChangeTolerance3("Tolerance 3", Range(0, 1)) = 0.25 //149 + _ColorChangeTarget3("Color to change 3", Color) = (1, 0, 0, 1) //150 + [HDR] _ColorChangeNewCol3("New Color 3", Color) = (1, 1, 0, 1) //151 + + _Contrast ("Contrast", Range(0, 6)) = 1 // 152 + _Brightness ("Brightness", Range(-1, 1)) = 0 // 153 + + _ColorSwapBlend ("Color Swap Blend", Range(0, 1)) = 1 // 154 + _ColorRampBlend ("Color Ramp Blend", Range(0, 1)) = 1 // 155 + _GreyscaleBlend ("Greyscale Blend", Range(0, 1)) = 1 // 156 + _GhostBlend ("Ghost Blend", Range(0, 1)) = 1 // 157 + _HologramBlend ("Hologram Blend", Range(0, 1)) = 1 // 158 + + [AllIn1ShaderGradient] _ColorRampTexGradient("Color ramp Gradient", 2D) = "white" {} //159 + + _OverlayTex("Overlay Texture", 2D) = "white" {} //160 + _OverlayColor("Overlay Color", Color) = (1, 1, 1, 1) //161 + _OverlayGlow("Overlay Glow", Range(0,25)) = 1 // 162 + _OverlayBlend("Overlay Blend", Range(0, 1)) = 1 // 163 + + _RadialStartAngle("Radial Start Angle", Range(0, 360)) = 90 //164 + _RadialClip("Radial Clip", Range(0, 360)) = 45 //165 + _RadialClip2("Radial Clip 2", Range(0, 360)) = 0 //166 + + _WarpStrength("Warp Strength", Range(0, 0.1)) = 0.025 //167 + _WarpSpeed("Warp Speed", Range(0, 25)) = 8 //168 + _WarpScale("Warp Scale", Range(0.05, 3)) = 0.5 //169 + + _OverlayTextureScrollXSpeed("Speed X Axis", Range(-5, 5)) = 0.25 //170 + _OverlayTextureScrollYSpeed("Speed Y Axis", Range(-5, 5)) = 0.25 //171 + + _ZTestMode ("Z Test Mode", Float) = 4 + _CullingOption ("Culling Option", float) = 0 + + [HideInInspector] _MinXUV("_MinXUV", Range(0, 1)) = 0.0 + [HideInInspector] _MaxXUV("_MaxXUV", Range(0, 1)) = 1.0 + [HideInInspector] _MinYUV("_MinYUV", Range(0, 1)) = 0.0 + [HideInInspector] _MaxYUV("_MaxYUV", Range(0, 1)) = 1.0 + [HideInInspector] _RandomSeed("_MaxYUV", Range(0, 10000)) = 0.0 + _EditorDrawers("Editor Drawers", Int) = 6 + + [Normal][NoScaleOffset] _NormalMap("Normal Map", 2D) = "bump" {} + _NormalStrength("Normal Strength", Range(0, 15)) = 1.0 + + + + [HideInInspector]_RenderQueueType("Float", Float) = 1 + [HideInInspector][ToggleUI]_AddPrecomputedVelocity("Boolean", Float) = 0 + [HideInInspector][ToggleUI]_DepthOffsetEnable("Boolean", Float) = 0 + [HideInInspector][ToggleUI]_TransparentWritingMotionVec("Boolean", Float) = 0 + [HideInInspector][ToggleUI]_AlphaCutoffEnable("Boolean", Float) = 0 + [HideInInspector]_TransparentSortPriority("_TransparentSortPriority", Float) = 0 + [HideInInspector][ToggleUI]_UseShadowThreshold("Boolean", Float) = 0 + [HideInInspector][ToggleUI]_TransparentDepthPrepassEnable("Boolean", Float) = 0 + [HideInInspector][ToggleUI]_TransparentDepthPostpassEnable("Boolean", Float) = 0 + [HideInInspector]_SurfaceType("Float", Float) = 0 + [HideInInspector]_BlendMode("Float", Float) = 0 + [HideInInspector]_SrcBlend("Float", Float) = 1 + [HideInInspector]_DstBlend("Float", Float) = 0 + [HideInInspector]_AlphaSrcBlend("Float", Float) = 1 + [HideInInspector]_AlphaDstBlend("Float", Float) = 0 + [HideInInspector][ToggleUI]_AlphaToMask("Boolean", Float) = 0 + [HideInInspector][ToggleUI]_AlphaToMaskInspectorValue("Boolean", Float) = 0 + [HideInInspector][ToggleUI]_ZWrite("Boolean", Float) = 1 + [HideInInspector][ToggleUI]_TransparentZWrite("Boolean", Float) = 0 + [HideInInspector][ToggleUI]_EnableFogOnTransparent("Boolean", Float) = 1 + [HideInInspector]_ZTestDepthEqualForOpaque("Float", Int) = 4 + [HideInInspector][Enum(UnityEngine.Rendering.CompareFunction)]_ZTestTransparent("Float", Float) = 4 + [HideInInspector][ToggleUI]_TransparentBackfaceEnable("Boolean", Float) = 0 + [HideInInspector][ToggleUI]_RequireSplitLighting("Boolean", Float) = 0 + [HideInInspector][ToggleUI]_ReceivesSSR("Boolean", Float) = 1 + [HideInInspector][ToggleUI]_ReceivesSSRTransparent("Boolean", Float) = 0 + [HideInInspector][ToggleUI]_EnableBlendModePreserveSpecularLighting("Boolean", Float) = 1 + [HideInInspector][ToggleUI]_SupportDecals("Boolean", Float) = 1 + [HideInInspector]_StencilRef("Float", Int) = 0 + [HideInInspector]_StencilWriteMask("Float", Int) = 6 + [HideInInspector]_StencilRefDepth("Float", Int) = 8 + [HideInInspector]_StencilWriteMaskDepth("Float", Int) = 8 + [HideInInspector]_StencilRefMV("Float", Int) = 40 + [HideInInspector]_StencilWriteMaskMV("Float", Int) = 40 + [HideInInspector]_StencilRefDistortionVec("Float", Int) = 4 + [HideInInspector]_StencilWriteMaskDistortionVec("Float", Int) = 4 + [HideInInspector]_StencilWriteMaskGBuffer("Float", Int) = 14 + [HideInInspector]_StencilRefGBuffer("Float", Int) = 10 + [HideInInspector]_ZTestGBuffer("Float", Int) = 4 + [HideInInspector][ToggleUI]_RayTracing("Boolean", Float) = 0 + [HideInInspector][Enum(None, 0, Box, 1, Sphere, 2, Thin, 3)]_RefractionModel("Float", Float) = 0 + [HideInInspector][NoScaleOffset]unity_Lightmaps("unity_Lightmaps", 2DArray) = "" {} + [HideInInspector][NoScaleOffset]unity_LightmapsInd("unity_LightmapsInd", 2DArray) = "" {} + [HideInInspector][NoScaleOffset]unity_ShadowMasks("unity_ShadowMasks", 2DArray) = "" {} + } + SubShader + { + Tags { "RenderPipeline" = "HDRenderPipeline" "RenderType" = "HDLitShader" "Queue" = "Geometry+225" } + + + Pass + { + // based on HDLitPass.template + Name "Forward" + Tags { "LightMode" = "Forward" } + + + + Stencil + { + WriteMask [_StencilWriteMask] + Ref [_StencilRef] + CompFront Always + PassFront Replace + CompBack Always + PassBack Replace + } + + ColorMask [_ColorMaskTransparentVel] 1 + + Tags { "RenderType" = "Opaque" "Queue" = "Geometry" "PreviewType" = "Plane" } + Cull [_CullingOption] + ZWrite [_ZWrite] + ZTest [_ZTestMode] + + + //------------------------------------------------------------------------------------- + // End Render Modes + //------------------------------------------------------------------------------------- + + HLSLPROGRAM + + #pragma target 4.5 + #pragma only_renderers d3d11 playstation xboxone vulkan metal switch + #pragma multi_compile_instancing + #pragma instancing_options renderinglayer + + + //#pragma shader_feature _ _SURFACE_TYPE_TRANSPARENT + //#pragma shader_feature_local _BLENDMODE_OFF _BLENDMODE_ALPHA _BLENDMODE_ADD _BLENDMODE_PRE_MULTIPLY + //#pragma shader_feature_local _ _ADD_PRECOMPUTED_VELOCITY + //#pragma shader_feature_local _ _TRANSPARENT_WRITES_MOTION_VEC + //#pragma shader_feature_local _ _ENABLE_FOG_ON_TRANSPARENT + #pragma multi_compile _ DEBUG_DISPLAY + //#pragma shader_feature_local _ _DISABLE_DECALS + //#pragma shader_feature_local _ _DISABLE_SSR + //#pragma shader_feature_local _ _DISABLE_SSR_TRANSPARENT + #pragma multi_compile _ LIGHTMAP_ON + #pragma multi_compile _ DIRLIGHTMAP_COMBINED + #pragma multi_compile _ DYNAMICLIGHTMAP_ON + #pragma multi_compile _ SHADOWS_SHADOWMASK + #pragma multi_compile DECALS_OFF DECALS_3RT DECALS_4RT + #pragma multi_compile SHADOW_LOW SHADOW_MEDIUM SHADOW_HIGH + #pragma multi_compile SCREEN_SPACE_SHADOWS_OFF SCREEN_SPACE_SHADOWS_ON + #pragma multi_compile USE_FPTL_LIGHTLIST USE_CLUSTERED_LIGHTLIST + //#pragma shader_feature_local _REFRACTION_OFF _REFRACTION_PLANE _REFRACTION_SPHERE _REFRACTION_THIN + + + //------------------------------------------------------------------------------------- + // Variant Definitions (active field translations to HDRP defines) + //------------------------------------------------------------------------------------- + // #define _MATERIAL_FEATURE_SUBSURFACE_SCATTERING 1 + // #define _MATERIAL_FEATURE_TRANSMISSION 1 + // #define _MATERIAL_FEATURE_ANISOTROPY 1 + // #define _MATERIAL_FEATURE_IRIDESCENCE 1 + // #define _MATERIAL_FEATURE_SPECULAR_COLOR 1 + #define _ENABLE_FOG_ON_TRANSPARENT 1 + // #define _AMBIENT_OCCLUSION 1 + // #define _SPECULAR_OCCLUSION_FROM_AO 1 + // #define _SPECULAR_OCCLUSION_FROM_AO_BENT_NORMAL 1 + // #define _SPECULAR_OCCLUSION_CUSTOM 1 + // #define _ENERGY_CONSERVING_SPECULAR 1 + // #define _ENABLE_GEOMETRIC_SPECULAR_AA 1 + // #define _HAS_REFRACTION 1 + // #define _REFRACTION_PLANE 1 + // #define _REFRACTION_SPHERE 1 + // #define _DISABLE_DECALS 1 + // #define _DISABLE_SSR 1 + // #define _ADD_PRECOMPUTED_VELOCITY + // #define _WRITE_TRANSPARENT_MOTION_VECTOR 1 + // #define _DEPTHOFFSET_ON 1 + // #define _BLENDMODE_PRESERVE_SPECULAR_LIGHTING 1 + + #define SHADERPASS SHADERPASS_FORWARD + #define SUPPORT_BLENDMODE_PRESERVE_SPECULAR_LIGHTING + #define HAS_LIGHTLOOP + #define RAYTRACING_SHADER_GRAPH_DEFAULT + #define _PASSFORWARD 1 + + + #pragma shader_feature_local GLOW_ON + #pragma shader_feature_local FADE_ON + #pragma shader_feature_local OUTBASE_ON + #pragma shader_feature_local ONLYOUTLINE_ON + #pragma shader_feature_local GRADIENT_ON + #pragma shader_feature_local GRADIENT2COL_ON + #pragma shader_feature_local RADIALGRADIENT_ON + #pragma shader_feature_local COLORSWAP_ON + #pragma shader_feature_local HSV_ON + #pragma shader_feature_local CHANGECOLOR_ON + #pragma shader_feature_local CHANGECOLOR2_ON + #pragma shader_feature_local CHANGECOLOR3_ON + #pragma shader_feature_local COLORRAMP_ON + #pragma shader_feature_local GRADIENTCOLORRAMP_ON + #pragma shader_feature_local HITEFFECT_ON + #pragma shader_feature_local NEGATIVE_ON + #pragma shader_feature_local PIXELATE_ON + #pragma shader_feature_local GREYSCALE_ON + #pragma shader_feature_local POSTERIZE_ON + #pragma shader_feature_local BLUR_ON + #pragma shader_feature_local MOTIONBLUR_ON + #pragma shader_feature_local GHOST_ON + #pragma shader_feature_local ALPHAOUTLINE_ON + #pragma shader_feature_local INNEROUTLINE_ON + #pragma shader_feature_local ONLYINNEROUTLINE_ON + #pragma shader_feature_local HOLOGRAM_ON + #pragma shader_feature_local CHROMABERR_ON + #pragma shader_feature_local GLITCH_ON + #pragma shader_feature_local FLICKER_ON + #pragma shader_feature_local SHADOW_ON + #pragma shader_feature_local SHINE_ON + #pragma shader_feature_local CONTRAST_ON + #pragma shader_feature_local OVERLAY_ON + #pragma shader_feature_local OVERLAYMULT_ON + #pragma shader_feature_local DOODLE_ON + #pragma shader_feature_local WIND_ON + #pragma shader_feature_local WAVEUV_ON + #pragma shader_feature_local ROUNDWAVEUV_ON + #pragma shader_feature_local RECTSIZE_ON + #pragma shader_feature_local OFFSETUV_ON + #pragma shader_feature_local CLIPPING_ON + #pragma shader_feature_local RADIALCLIPPING_ON + #pragma shader_feature_local TEXTURESCROLL_ON + #pragma shader_feature_local ZOOMUV_ON + #pragma shader_feature_local DISTORT_ON + #pragma shader_feature_local WARP_ON + #pragma shader_feature_local TWISTUV_ON + #pragma shader_feature_local ROTATEUV_ON + #pragma shader_feature_local POLARUV_ON + #pragma shader_feature_local FISHEYE_ON + #pragma shader_feature_local PINCH_ON + #pragma shader_feature_local SHAKEUV_ON + + #pragma shader_feature_local GLOWTEX_ON + #pragma shader_feature_local OUTTEX_ON + #pragma shader_feature_local OUTDIST_ON + #pragma shader_feature_local OUTBASE8DIR_ON + #pragma shader_feature_local OUTBASEPIXELPERF_ON + #pragma shader_feature_local COLORRAMPOUTLINE_ON + #pragma shader_feature_local GREYSCALEOUTLINE_ON + #pragma shader_feature_local POSTERIZEOUTLINE_ON + #pragma shader_feature_local BLURISHD_ON + #pragma shader_feature_local MANUALWIND_ON + #pragma shader_feature_local ATLAS_ON + #pragma shader_feature_local PREMULTIPLYALPHA_ON + + #pragma shader_feature BILBOARD_ON + #pragma shader_feature BILBOARDY_ON + + #pragma shader_feature NORMALMAP_ON + + + #define _HDRP 1 +#define _USINGTEXCOORD1 1 +#define _USINGTEXCOORD2 1 + + + #pragma vertex Vert + #pragma fragment Frag + + // useful conversion functions to make surface shader code just work + + #define UNITY_DECLARE_TEX2D(name) TEXTURE2D(name); SAMPLER(sampler##name); + #define UNITY_DECLARE_TEX2D_NOSAMPLER(name) TEXTURE2D(name); + #define UNITY_DECLARE_TEX2DARRAY(name) TEXTURE2D_ARRAY(name); SAMPLER(sampler##name); + #define UNITY_DECLARE_TEX2DARRAY_NOSAMPLER(tex) TEXTURE2D_ARRAY(tex); + + #define UNITY_SAMPLE_TEX2DARRAY(tex,coord) SAMPLE_TEXTURE2D_ARRAY(tex, sampler##tex, coord.xy, coord.z) + #define UNITY_SAMPLE_TEX2DARRAY_LOD(tex,coord,lod) SAMPLE_TEXTURE2D_ARRAY_LOD(tex, sampler##tex, coord.xy, coord.z, lod) + #define UNITY_SAMPLE_TEX2D(tex, coord) SAMPLE_TEXTURE2D(tex, sampler##tex, coord) + #define UNITY_SAMPLE_TEX2D_SAMPLER(tex, samp, coord) SAMPLE_TEXTURE2D(tex, sampler##samp, coord) + + #define UNITY_SAMPLE_TEX2D_LOD(tex,coord, lod) SAMPLE_TEXTURE2D_LOD(tex, sampler_##tex, coord, lod) + #define UNITY_SAMPLE_TEX2D_SAMPLER_LOD(tex,samplertex,coord, lod) SAMPLE_TEXTURE2D_LOD (tex, sampler##samplertex,coord, lod) + + #if defined(UNITY_COMPILER_HLSL) + #define UNITY_INITIALIZE_OUTPUT(type,name) name = (type)0; + #else + #define UNITY_INITIALIZE_OUTPUT(type,name) + #endif + + #define sampler2D_float sampler2D + #define sampler2D_half sampler2D + + #undef WorldNormalVector + #define WorldNormalVector(data, normal) mul(normal, data.TBNMatrix) + + #define UnityObjectToWorldNormal(normal) mul(GetObjectToWorldMatrix(), normal) + + + + +// HDRP Adapter stuff + #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Common.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/ShaderVariables.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/ShaderPass/FragInputs.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/ShaderPass/ShaderPass.cs.hlsl" + #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/TextureStack.hlsl" // Required to be include before we include properties as it define DECLARE_STACK_CB + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/ShaderGraphHeader.hlsl" // Need to be here for Gradient struct definition + + #ifdef RAYTRACING_SHADER_GRAPH_DEFAULT + #define RAYTRACING_SHADER_GRAPH_HIGH + #endif + + #ifdef RAYTRACING_SHADER_GRAPH_RAYTRACED + #define RAYTRACING_SHADER_GRAPH_LOW + #endif + // end + + + + + // If we use subsurface scattering, enable output split lighting (for forward pass) + #if defined(_MATERIAL_FEATURE_SUBSURFACE_SCATTERING) && !defined(_SURFACE_TYPE_TRANSPARENT) + #define OUTPUT_SPLIT_LIGHTING + #endif + + #define HAVE_RECURSIVE_RENDERING + + #if SHADERPASS == SHADERPASS_TRANSPARENT_DEPTH_PREPASS + #if !defined(_DISABLE_SSR_TRANSPARENT) && !defined(SHADER_UNLIT) + #define WRITE_NORMAL_BUFFER + #endif + #endif + + #ifndef DEBUG_DISPLAY + // In case of opaque we don't want to perform the alpha test, it is done in depth prepass and we use depth equal for ztest (setup from UI) + // Don't do it with debug display mode as it is possible there is no depth prepass in this case + #if !defined(_SURFACE_TYPE_TRANSPARENT) && defined(_ALPHATEST) + #if SHADERPASS == SHADERPASS_FORWARD + #define SHADERPASS_FORWARD_BYPASS_ALPHA_TEST + #elif SHADERPASS == SHADERPASS_GBUFFER + #define SHADERPASS_GBUFFER_BYPASS_ALPHA_TEST + #endif + #endif + #endif + + // Translate transparent motion vector define + #if defined(_TRANSPARENT_WRITES_MOTION_VEC) && defined(_SURFACE_TYPE_TRANSPARENT) + #define _WRITE_TRANSPARENT_MOTION_VECTOR + #endif + + + + + CBUFFER_START(UnityPerMaterial) + float _UseShadowThreshold; + float _BlendMode; + float _EnableBlendModePreserveSpecularLighting; + float _RayTracing; + float _RefractionModel; + + + half4 _Color; + half4 _MainTex_ST, _MainTex_TexelSize; + half _Alpha, _AlphaCutoffValue; + + #if ATLAS_ON + half _MinXUV, _MaxXUV, _MinYUV, _MaxYUV; + #endif + + #if GLOW_ON + half4 _GlowColor; + half _Glow, _GlowGlobal; + #endif + + #if HSV_ON + half _HsvShift, _HsvSaturation, _HsvBright; + #endif + + #if DISTORT_ON + half4 _DistortTex_ST; + half _DistortTexXSpeed, _DistortTexYSpeed, _DistortAmount; + #endif + + #if FADE_ON + half4 _FadeBurnColor, _FadeTex_ST, _FadeBurnTex_ST; + half _FadeAmount, _FadeBurnWidth, _FadeBurnTransition,_FadeBurnGlow; + #endif + + #if OUTBASE_ON + half4 _OutlineColor; + half _OutlineAlpha, _OutlineGlow, _OutlineWidth; + int _OutlinePixelWidth; + #endif + + #if OUTTEX_ON + half4 _OutlineTex_ST; + half _OutlineTexXSpeed, _OutlineTexYSpeed; + #endif + + #if OUTDIST_ON + half4 _OutlineDistortTex_ST; + half _OutlineDistortTexXSpeed, _OutlineDistortTexYSpeed, _OutlineDistortAmount; + #endif + + #if ALPHAOUTLINE_ON + half _AlphaOutlineGlow, _AlphaOutlinePower, _AlphaOutlineMinAlpha, _AlphaOutlineBlend; + half4 _AlphaOutlineColor; + #endif + + #if INNEROUTLINE_ON + half _InnerOutlineThickness, _InnerOutlineAlpha, _InnerOutlineGlow; + half4 _InnerOutlineColor; + #endif + + #if GRADIENT_ON + half _GradBlend, _GradBoostX, _GradBoostY; + half4 _GradTopRightCol, _GradTopLeftCol, _GradBotRightCol, _GradBotLeftCol; + #endif + + #if COLORSWAP_ON + half4 _ColorSwapRed, _ColorSwapGreen, _ColorSwapBlue; + half _ColorSwapRedLuminosity, _ColorSwapGreenLuminosity, _ColorSwapBlueLuminosity, _ColorSwapBlend; + #endif + + #if CHANGECOLOR_ON + half4 _ColorChangeNewCol, _ColorChangeTarget; + half _ColorChangeTolerance, _ColorChangeLuminosity; + #endif + #if CHANGECOLOR2_ON + half4 _ColorChangeNewCol2, _ColorChangeTarget2; + half _ColorChangeTolerance2; + #endif + #if CHANGECOLOR3_ON + half4 _ColorChangeNewCol3, _ColorChangeTarget3; + half _ColorChangeTolerance3; + #endif + + #if COLORRAMP_ON + half _ColorRampLuminosity, _ColorRampBlend; + #endif + + #if HITEFFECT_ON + half4 _HitEffectColor; + half _HitEffectGlow, _HitEffectBlend; + #endif + + #if NEGATIVE_ON + half _NegativeAmount; + #endif + + #if PIXELATE_ON + half _PixelateSize; + #endif + + #if GREYSCALE_ON + half _GreyscaleLuminosity, _GreyscaleBlend; + half4 _GreyscaleTintColor; + #endif + + #if POSTERIZE_ON + half _PosterizeNumColors, _PosterizeGamma; + #endif + + #if BLUR_ON + half _BlurIntensity; + #endif + + #if MOTIONBLUR_ON + half _MotionBlurAngle, _MotionBlurDist; + #endif + + #if GHOST_ON + half _GhostColorBoost, _GhostTransparency, _GhostBlend; + #endif + + #if HOLOGRAM_ON + half _HologramStripesAmount, _HologramMinAlpha, _HologramUnmodAmount, _HologramStripesSpeed, _HologramMaxAlpha, _HologramBlend; + half4 _HologramStripeColor; + #endif + + #if CHROMABERR_ON + half _ChromAberrAmount, _ChromAberrAlpha; + #endif + + #if GLITCH_ON + half _GlitchAmount, _GlitchSize; + #endif + + #if FLICKER_ON + half _FlickerFreq, _FlickerPercent, _FlickerAlpha; + #endif + + #if SHADOW_ON + half _ShadowX, _ShadowY, _ShadowAlpha; + half4 _ShadowColor; + #endif + + #if SHINE_ON + half4 _ShineColor; + half _ShineLocation, _ShineRotate, _ShineWidth, _ShineGlow; + #endif + + #if CONTRAST_ON + half _Contrast, _Brightness; + #endif + + #if OVERLAY_ON + half4 _OverlayTex_ST, _OverlayColor; + half _OverlayGlow, _OverlayBlend, _OverlayTextureScrollXSpeed, _OverlayTextureScrollYSpeed; + #endif + + #if DOODLE_ON + half _HandDrawnAmount, _HandDrawnSpeed; + #endif + + #if WIND_ON + half _GrassSpeed, _GrassWind, _GrassManualAnim, _GrassRadialBend; + #endif + + #if WAVEUV_ON + float _WaveAmount, _WaveSpeed, _WaveStrength, _WaveX, _WaveY; + #endif + + #if ROUNDWAVEUV_ON + half _RoundWaveStrength, _RoundWaveSpeed; + #endif + + #if RECTSIZE_ON + half _RectSize; + #endif + + #if OFFSETUV_ON + half _OffsetUvX, _OffsetUvY; + #endif + + #if CLIPPING_ON + half _ClipUvLeft, _ClipUvRight, _ClipUvUp, _ClipUvDown; + #endif + + #if RADIALCLIPPING_ON + half _RadialStartAngle, _RadialClip, _RadialClip2; + #endif + + #if TEXTURESCROLL_ON + half _TextureScrollXSpeed, _TextureScrollYSpeed; + #endif + + #if ZOOMUV_ON + half _ZoomUvAmount; + #endif + + #if WARP_ON + half _WarpStrength, _WarpSpeed, _WarpScale; + #endif + + #if TWISTUV_ON + half _TwistUvAmount, _TwistUvPosX, _TwistUvPosY, _TwistUvRadius; + #endif + + #if ROTATEUV_ON + half _RotateUvAmount; + #endif + + #if FISHEYE_ON + half _FishEyeUvAmount; + #endif + + #if PINCH_ON + half _PinchUvAmount; + #endif + + #if SHAKEUV_ON + half _ShakeUvSpeed, _ShakeUvX, _ShakeUvY; + #endif + + #if NORMALMAP_ON + half _NormalStrength; + #endif + + float _RandomSeed; + + + + + CBUFFER_END + + + + // -- Property used by ScenePickingPass + #ifdef SCENEPICKINGPASS + float4 _SelectionID; + #endif + + // -- Properties used by SceneSelectionPass + #ifdef SCENESELECTIONPASS + int _ObjectId; + int _PassValue; + #endif + + + // data across stages, stripped like the above. + struct VertexToPixel + { + float4 pos : SV_POSITION; + float3 worldPos : TEXCOORD0; + float3 worldNormal : TEXCOORD1; + float4 worldTangent : TEXCOORD2; + float4 texcoord0 : TEXCOORD3; + float4 texcoord1 : TEXCOORD4; + float4 texcoord2 : TEXCOORD5; + // #if %TEXCOORD3REQUIREKEY% + float4 texcoord3 : TEXCOORD6; + // #endif + + // #if %SCREENPOSREQUIREKEY% + // float4 screenPos : TEXCOORD7; + // #endif + + // #if %VERTEXCOLORREQUIREKEY% + float4 vertexColor : COLOR; + // #endif + + // #if %EXTRAV2F0REQUIREKEY% + // float4 extraV2F0 : TEXCOORD8; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // float4 extraV2F1 : TEXCOORD9; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // float4 extraV2F2 : TEXCOORD10; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // float4 extraV2F3 : TEXCOORD11; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // float4 extraV2F4 : TEXCOORD12; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // float4 extraV2F5 : TEXCOORD13; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // float4 extraV2F6 : TEXCOORD14; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // float4 extraV2F7 : TEXCOORD15; + // #endif + + #if UNITY_ANY_INSTANCING_ENABLED + UNITY_VERTEX_INPUT_INSTANCE_ID + #endif // UNITY_ANY_INSTANCING_ENABLED + + #if _HDRP && (_PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR))) + float4 previousPositionCS : TEXCOORD16; // Contain previous transform position (in case of skinning for example) + float4 motionVectorCS : TEXCOORD17; + #endif + + UNITY_VERTEX_OUTPUT_STEREO + }; + + + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Debug/DebugDisplay.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/Material.hlsl" + #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/NormalSurfaceGradient.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Lighting/Lighting.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Lighting/LightLoop/LightLoopDef.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/Lit/Lit.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Lighting/LightLoop/LightLoop.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/BuiltinUtilities.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/MaterialUtilities.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/Decal/DecalUtilities.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/Lit/LitDecalData.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/ShaderGraphFunctions.hlsl" + + + + + // data describing the user output of a pixel + struct Surface + { + half3 Albedo; + half Height; + half3 Normal; + half Smoothness; + half3 Emission; + half Metallic; + half3 Specular; + half Occlusion; + half SpecularPower; // for simple lighting + half Alpha; + float outputDepth; // if written, SV_Depth semantic is used. ShaderData.clipPos.z is unused value + // HDRP Only + half SpecularOcclusion; + half SubsurfaceMask; + half Thickness; + half CoatMask; + half CoatSmoothness; + half Anisotropy; + half IridescenceMask; + half IridescenceThickness; + int DiffusionProfileHash; + float SpecularAAThreshold; + float SpecularAAScreenSpaceVariance; + // requires _OVERRIDE_BAKEDGI to be defined, but is mapped in all pipelines + float3 DiffuseGI; + float3 BackDiffuseGI; + float3 SpecularGI; + float ior; + float3 transmittanceColor; + float atDistance; + float transmittanceMask; + // requires _OVERRIDE_SHADOWMASK to be defines + float4 ShadowMask; + + // for decals + float NormalAlpha; + float MAOSAlpha; + + + }; + + // Data the user declares in blackboard blocks + struct Blackboard + { + + float blackboardDummyData; + }; + + // data the user might need, this will grow to be big. But easy to strip + struct ShaderData + { + float4 clipPos; // SV_POSITION + float3 localSpacePosition; + float3 localSpaceNormal; + float3 localSpaceTangent; + + float3 worldSpacePosition; + float3 worldSpaceNormal; + float3 worldSpaceTangent; + float tangentSign; + + float3 worldSpaceViewDir; + float3 tangentSpaceViewDir; + + float4 texcoord0; + float4 texcoord1; + float4 texcoord2; + float4 texcoord3; + + float2 screenUV; + float4 screenPos; + + float4 vertexColor; + bool isFrontFace; + + float4 extraV2F0; + float4 extraV2F1; + float4 extraV2F2; + float4 extraV2F3; + float4 extraV2F4; + float4 extraV2F5; + float4 extraV2F6; + float4 extraV2F7; + + float3x3 TBNMatrix; + Blackboard blackboard; + }; + + struct VertexData + { + #if SHADER_TARGET > 30 + // uint vertexID : SV_VertexID; + #endif + float4 vertex : POSITION; + float3 normal : NORMAL; + float4 tangent : TANGENT; + float4 texcoord0 : TEXCOORD0; + + // optimize out mesh coords when not in use by user or lighting system + #if _URP && (_USINGTEXCOORD1 || _PASSMETA || _PASSFORWARD || _PASSGBUFFER) + float4 texcoord1 : TEXCOORD1; + #endif + + #if _URP && (_USINGTEXCOORD2 || _PASSMETA || ((_PASSFORWARD || _PASSGBUFFER) && defined(DYNAMICLIGHTMAP_ON))) + float4 texcoord2 : TEXCOORD2; + #endif + + #if _STANDARD && (_USINGTEXCOORD1 || (_PASSMETA || ((_PASSFORWARD || _PASSGBUFFER || _PASSFORWARDADD) && LIGHTMAP_ON))) + float4 texcoord1 : TEXCOORD1; + #endif + #if _STANDARD && (_USINGTEXCOORD2 || (_PASSMETA || ((_PASSFORWARD || _PASSGBUFFER) && DYNAMICLIGHTMAP_ON))) + float4 texcoord2 : TEXCOORD2; + #endif + + + #if _HDRP + float4 texcoord1 : TEXCOORD1; + float4 texcoord2 : TEXCOORD2; + #endif + + // #if %TEXCOORD3REQUIREKEY% + float4 texcoord3 : TEXCOORD3; + // #endif + + // #if %VERTEXCOLORREQUIREKEY% + float4 vertexColor : COLOR; + // #endif + + #if _PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR)) + float3 previousPositionOS : TEXCOORD4; // Contain previous transform position (in case of skinning for example) + #if defined (_ADD_PRECOMPUTED_VELOCITY) + float3 precomputedVelocity : TEXCOORD5; // Add Precomputed Velocity (Alembic computes velocities on runtime side). + #endif + #endif + + UNITY_VERTEX_INPUT_INSTANCE_ID + }; + + struct TessVertex + { + float4 vertex : INTERNALTESSPOS; + float3 normal : NORMAL; + float4 tangent : TANGENT; + float4 texcoord0 : TEXCOORD0; + float4 texcoord1 : TEXCOORD1; + float4 texcoord2 : TEXCOORD2; + + // #if %TEXCOORD3REQUIREKEY% + float4 texcoord3 : TEXCOORD3; + // #endif + + // #if %VERTEXCOLORREQUIREKEY% + float4 vertexColor : COLOR; + // #endif + + // #if %EXTRAV2F0REQUIREKEY% + // float4 extraV2F0 : TEXCOORD5; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // float4 extraV2F1 : TEXCOORD6; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // float4 extraV2F2 : TEXCOORD7; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // float4 extraV2F3 : TEXCOORD8; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // float4 extraV2F4 : TEXCOORD9; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // float4 extraV2F5 : TEXCOORD10; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // float4 extraV2F6 : TEXCOORD11; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // float4 extraV2F7 : TEXCOORD12; + // #endif + + #if _PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR)) + float3 previousPositionOS : TEXCOORD13; // Contain previous transform position (in case of skinning for example) + #if defined (_ADD_PRECOMPUTED_VELOCITY) + float3 precomputedVelocity : TEXCOORD14; + #endif + #endif + + UNITY_VERTEX_INPUT_INSTANCE_ID + UNITY_VERTEX_OUTPUT_STEREO + }; + + struct ExtraV2F + { + float4 extraV2F0; + float4 extraV2F1; + float4 extraV2F2; + float4 extraV2F3; + float4 extraV2F4; + float4 extraV2F5; + float4 extraV2F6; + float4 extraV2F7; + Blackboard blackboard; + float4 time; + }; + + + float3 WorldToTangentSpace(ShaderData d, float3 normal) + { + return mul(d.TBNMatrix, normal); + } + + float3 TangentToWorldSpace(ShaderData d, float3 normal) + { + return mul(normal, d.TBNMatrix); + } + + // in this case, make standard more like SRPs, because we can't fix + // unity_WorldToObject in HDRP, since it already does macro-fu there + + #if _STANDARD + float3 TransformWorldToObject(float3 p) { return mul(unity_WorldToObject, float4(p, 1)); }; + float3 TransformObjectToWorld(float3 p) { return mul(unity_ObjectToWorld, float4(p, 1)); }; + float4 TransformWorldToObject(float4 p) { return mul(unity_WorldToObject, p); }; + float4 TransformObjectToWorld(float4 p) { return mul(unity_ObjectToWorld, p); }; + float4x4 GetWorldToObjectMatrix() { return unity_WorldToObject; } + float4x4 GetObjectToWorldMatrix() { return unity_ObjectToWorld; } + #if (defined(SHADER_API_D3D11) || defined(SHADER_API_XBOXONE) || defined(UNITY_COMPILER_HLSLCC) || defined(SHADER_API_PSSL) || (SHADER_TARGET_SURFACE_ANALYSIS && !SHADER_TARGET_SURFACE_ANALYSIS_MOJOSHADER)) + #define UNITY_SAMPLE_TEX2D_LOD(tex,coord, lod) tex.SampleLevel (sampler##tex,coord, lod) + #define UNITY_SAMPLE_TEX2D_SAMPLER_LOD(tex,samplertex,coord, lod) tex.SampleLevel (sampler##samplertex,coord, lod) + #else + #define UNITY_SAMPLE_TEX2D_LOD(tex,coord,lod) tex2D (tex,coord,0,lod) + #define UNITY_SAMPLE_TEX2D_SAMPLER_LOD(tex,samplertex,coord,lod) tex2D (tex,coord,0,lod) + #endif + + #undef GetWorldToObjectMatrix() + + #define GetWorldToObjectMatrix() unity_WorldToObject + + + #endif + + float3 GetCameraWorldPosition() + { + #if _HDRP + return GetCameraRelativePositionWS(_WorldSpaceCameraPos); + #else + return _WorldSpaceCameraPos; + #endif + } + + #if _GRABPASSUSED + #if _STANDARD + TEXTURE2D(%GRABTEXTURE%); + SAMPLER(sampler_%GRABTEXTURE%); + #endif + + half3 GetSceneColor(float2 uv) + { + #if _STANDARD + return SAMPLE_TEXTURE2D(%GRABTEXTURE%, sampler_%GRABTEXTURE%, uv).rgb; + #else + return SHADERGRAPH_SAMPLE_SCENE_COLOR(uv); + #endif + } + #endif + + + + #if _STANDARD + UNITY_DECLARE_DEPTH_TEXTURE(_CameraDepthTexture); + float GetSceneDepth(float2 uv) { return SAMPLE_DEPTH_TEXTURE(_CameraDepthTexture, uv); } + float GetLinear01Depth(float2 uv) { return Linear01Depth(GetSceneDepth(uv)); } + float GetLinearEyeDepth(float2 uv) { return LinearEyeDepth(GetSceneDepth(uv)); } + #else + float GetSceneDepth(float2 uv) { return SHADERGRAPH_SAMPLE_SCENE_DEPTH(uv); } + float GetLinear01Depth(float2 uv) { return Linear01Depth(GetSceneDepth(uv), _ZBufferParams); } + float GetLinearEyeDepth(float2 uv) { return LinearEyeDepth(GetSceneDepth(uv), _ZBufferParams); } + #endif + + float3 GetWorldPositionFromDepthBuffer(float2 uv, float3 worldSpaceViewDir) + { + float eye = GetLinearEyeDepth(uv); + float3 camView = mul((float3x3)GetObjectToWorldMatrix(), transpose(mul(GetWorldToObjectMatrix(), UNITY_MATRIX_I_V)) [2].xyz); + + float dt = dot(worldSpaceViewDir, camView); + float3 div = worldSpaceViewDir/dt; + float3 wpos = (eye * div) + GetCameraWorldPosition(); + return wpos; + } + + #if _HDRP + float3 ObjectToWorldSpacePosition(float3 pos) + { + return GetAbsolutePositionWS(TransformObjectToWorld(pos)); + } + #else + float3 ObjectToWorldSpacePosition(float3 pos) + { + return TransformObjectToWorld(pos); + } + #endif + + #if _STANDARD + UNITY_DECLARE_SCREENSPACE_TEXTURE(_CameraDepthNormalsTexture); + float3 GetSceneNormal(float2 uv, float3 worldSpaceViewDir) + { + float4 depthNorms = UNITY_SAMPLE_SCREENSPACE_TEXTURE(_CameraDepthNormalsTexture, uv); + float3 norms = DecodeViewNormalStereo(depthNorms); + norms = mul((float3x3)GetWorldToViewMatrix(), norms) * 0.5 + 0.5; + return norms; + } + #elif _HDRP && !_DECALSHADER + + float3 GetSceneNormal(float2 uv, float3 worldSpaceViewDir) + { + NormalData nd; + DecodeFromNormalBuffer(_ScreenSize.xy * uv, nd); + return nd.normalWS; + } + #elif _URP + #if (SHADER_LIBRARY_VERSION_MAJOR >= 10) + #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/DeclareNormalsTexture.hlsl" + #endif + + float3 GetSceneNormal(float2 uv, float3 worldSpaceViewDir) + { + #if (SHADER_LIBRARY_VERSION_MAJOR >= 10) + return SampleSceneNormals(uv); + #else + float3 wpos = GetWorldPositionFromDepthBuffer(uv, worldSpaceViewDir); + return normalize(-cross(ddx(wpos), ddy(wpos))) * 0.5 + 0.5; + #endif + + } + #endif + + #if _HDRP + + half3 UnpackNormalmapRGorAG(half4 packednormal) + { + // This do the trick + packednormal.x *= packednormal.w; + + half3 normal; + normal.xy = packednormal.xy * 2 - 1; + normal.z = sqrt(1 - saturate(dot(normal.xy, normal.xy))); + return normal; + } + half3 UnpackNormal(half4 packednormal) + { + #if defined(UNITY_NO_DXT5nm) + return packednormal.xyz * 2 - 1; + #else + return UnpackNormalmapRGorAG(packednormal); + #endif + } + #endif + #if _HDRP || _URP + + half3 UnpackScaleNormal(half4 packednormal, half scale) + { + #ifndef UNITY_NO_DXT5nm + // Unpack normal as DXT5nm (1, y, 1, x) or BC5 (x, y, 0, 1) + // Note neutral texture like "bump" is (0, 0, 1, 1) to work with both plain RGB normal and DXT5nm/BC5 + packednormal.x *= packednormal.w; + #endif + half3 normal; + normal.xy = (packednormal.xy * 2 - 1) * scale; + normal.z = sqrt(1 - saturate(dot(normal.xy, normal.xy))); + return normal; + } + + #endif + + + void GetSun(out float3 lightDir, out float3 color) + { + lightDir = float3(0.5, 0.5, 0); + color = 1; + #if _HDRP + if (_DirectionalLightCount > 0) + { + DirectionalLightData light = _DirectionalLightDatas[0]; + lightDir = -light.forward.xyz; + color = light.color; + } + #elif _STANDARD + lightDir = normalize(_WorldSpaceLightPos0.xyz); + color = _LightColor0.rgb; + #elif _URP + Light light = GetMainLight(); + lightDir = light.direction; + color = light.color; + #endif + } + + + + + + + + + + TEXTURE2D(_MainTex); + SAMPLER(sampler_MainTex); + + #if GLOW_ON + TEXTURE2D(_GlowTex); + SAMPLER(sampler_GlowTex); + #endif + + #if FADE_ON + TEXTURE2D(_FadeTex); + SAMPLER(sampler_FadeTex); + + TEXTURE2D(_FadeBurnTex); + SAMPLER(sampler_FadeBurnTex); + #endif + + #if DISTORT_ON + TEXTURE2D(_DistortTex); + SAMPLER(sampler_DistortTex); + #endif + + #if OUTTEX_ON + TEXTURE2D(_OutlineTex); + SAMPLER(sampler_OutlineTex); + #endif + + #if OUTDIST_ON + TEXTURE2D(_OutlineDistortTex); + SAMPLER(sampler_OutlineDistortTex); + #endif + + #if COLORSWAP_ON + TEXTURE2D(_ColorSwapTex); + SAMPLER(sampler_ColorSwapTex); + #endif + + #if COLORRAMP_ON + TEXTURE2D(_ColorRampTex); + TEXTURE2D(_ColorRampTexGradient); + SAMPLER(sampler_ColorRampTex); + SAMPLER(sampler_ColorRampTexGradient); + #endif + + #if SHINE_ON + TEXTURE2D(_ShineMask); + SAMPLER(sampler_ShineMask); + #endif + + #if OVERLAY_ON + TEXTURE2D(_OverlayTex); + SAMPLER(sampler_OverlayTex); + #endif + + #if NORMALMAP_ON + TEXTURE2D(_NormalMap); + SAMPLER(sampler_NormalMap); + #endif + + + half3 GetPixel(in int offsetX, in int offsetY, in half2 uv, in Texture2D _tex, in SamplerState _sampler) + { + half2 _uv = uv + half2(offsetX * _MainTex_TexelSize.x, offsetY * _MainTex_TexelSize.y); + half4 col = SAMPLE_TEXTURE2D(_tex, _sampler, _uv); + return col.rgb; + } + + + //BLURS------------------------------------------------------------------------- + half4 Blur(half2 uv, Texture2D source, SamplerState sampler_source, half Intensity) + { + const half2 texelSize = 1.0 / _ScreenParams.xy; + const half4 color = SAMPLE_TEXTURE2D(source, sampler_source, uv); + const half2 offset = Intensity * texelSize; + + half4 accumulatedColor = color; + half accumulatedWeight = 1.0; + for (int x = -1; x <= 1; x++) + { + for (int y = -1; y <= 1; y++) + { + const half2 sampleUV = uv + half2(x, y) * offset; + const half4 sampleColor = SAMPLE_TEXTURE2D(source, sampler_source, sampleUV); + + accumulatedColor += sampleColor; + accumulatedWeight += 1.0; + } + } + + half4 blurredColor = accumulatedColor / accumulatedWeight; + return blurredColor; + } + + half BlurHD_G(half bhqp, half x) + { + return exp(-(x * x) / (2.0 * bhqp * bhqp)); + } + half4 BlurHD(half2 uv, Texture2D source, SamplerState sampler_source, half BlurAmount, half xScale, half yScale) + { + int iterations = 16; + int halfIterations = iterations / 2; + half sigmaX = 0.1 + BlurAmount * 0.5; + half sigmaY = sigmaX; + half total = 0.0; + half4 ret = half4(0, 0, 0, 0); + for (int iy = 0; iy < iterations; ++iy) + { + half fy = BlurHD_G(sigmaY, half(iy) -half(halfIterations)); + half offsetY = half(iy - halfIterations) * 0.00390625 * xScale; + for (int ix = 0; ix < iterations; ++ix) + { + half fx = BlurHD_G(sigmaX, half(ix) - half(halfIterations)); + half offsetX = half(ix - halfIterations) * 0.00390625 * yScale; + total += fx * fy; + ret += SAMPLE_TEXTURE2D(source, sampler_source, uv + half2(offsetX, offsetY)) * fx * fy; + } + } + return ret / total; + } + //----------------------------------------------------------------------- + + + //------------------------------------------- + half RemapFloat(half inValue, half inMin, half inMax, half outMin, half outMax){ + return outMin + (inValue - inMin) * (outMax - outMin) / (inMax - inMin); + } + //------------------------------------------- + + //----------------------------------------------------------------------- + half rand(half2 seed, half offset) { + return (frac(sin(dot(seed, half2(12.9898, 78.233))) * 43758.5453) + offset) % 1.0; + } + + half rand2(half2 seed, half offset) { + return (frac(sin(dot(seed * floor(50 + (_Time.x % 1.0) * 12.), half2(127.1, 311.7))) * 43758.5453123) + offset) % 1.0; + } + + half rand2CustomTime(half2 seed, half offset, half customTime) { + return (frac(sin(dot(seed * floor(50 + (customTime % 1.0) * 12.), half2(127.1, 311.7))) * 43758.5453123) + offset) % 1.0; + } + //----------------------------------------------------------------------- + + + void Ext_ModifyVertex0 (inout VertexData v, inout ExtraV2F d) + { + //BILBOARD_ON + #if BILBOARD_ON + half3 camRight = mul((half3x3)unity_CameraToWorld, half3(1,0,0)); + half3 camUp = half3(0,1,0); + #if BILBOARDY_ON + camUp = mul((half3x3)unity_CameraToWorld, half3(0,1,0)); + #endif + half3 localPos = v.vertex.x * camRight + v.vertex.y * camUp; + v.vertex = half4(localPos, 1); + #endif + //----------------------------------------------------------- + + v.texcoord0.xy = TRANSFORM_TEX(v.texcoord0.xy, _MainTex); + half2 center = half2(0.5, 0.5); + #if ATLAS_ON + center = half2((_MaxXUV + _MinXUV) / 2.0, (_MaxYUV + _MinYUV) / 2.0); + #endif + + //POLARUV_ON + #if POLARUV_ON + v.texcoord0.xy = v.texcoord0.xy - center; + #endif + + //---------------------------------------- + + //ROTATEUV_ON + #if ROTATEUV_ON + half2 uvC = v.texcoord0.xy; + half cosAngle = cos(_RotateUvAmount); + half sinAngle = sin(_RotateUvAmount); + half2x2 rot = half2x2(cosAngle, -sinAngle, sinAngle, cosAngle); + uvC -= center; + v.texcoord0.xy = mul(rot, uvC); + v.texcoord0.xy += center; + #endif + //-------------------- + + #if RECTSIZE_ON + v.vertex.xyz += (v.vertex.xyz * (_RectSize - 1.0)); + #endif + + #if OUTTEX_ON + v.texcoord1.xy = TRANSFORM_TEX(v.texcoord0.xy, _OutlineTex); + #endif + + #if OUTDIST_ON + v.texcoord2.xy = TRANSFORM_TEX(v.texcoord0.xy, _OutlineDistortTex); + #endif + + #if DISTORT_ON + v.texcoord3.xy = TRANSFORM_TEX(v.texcoord0.xy, _DistortTex); + #endif + } + + void Ext_SurfaceFunction0 (inout Surface o, ShaderData d) + { + half randomSeed = _RandomSeed; + + float2 uvRect = d.texcoord0; + half2 center = half2(0.5, 0.5); + #if ATLAS_ON + center = half2((_MaxXUV + _MinXUV) / 2.0, (_MaxYUV + _MinYUV) / 2.0); + uvRect = half2((d.texcoord0.x - _MinXUV) / (_MaxXUV - _MinXUV), (d.texcoord0.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half2 centerTiled = half2(center.x * _MainTex_ST.x, center.y * _MainTex_ST.y); + + //CLIPPING_ON + #if CLIPPING_ON + half2 tiledUv = half2(d.texcoord0.x / _MainTex_ST.x, d.texcoord0.y / _MainTex_ST.y); + #if ATLAS_ON + tiledUv = half2((tiledUv.x - _MinXUV) / (_MaxXUV - _MinXUV), (tiledUv.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + clip((1 - _ClipUvUp) - tiledUv.y); + clip(tiledUv.y - _ClipUvDown); + clip((1 - _ClipUvRight) - tiledUv.x); + clip(tiledUv.x - _ClipUvLeft); + #endif + //---------------------------------- + + //RADIALCLIPPING_ON + #if RADIALCLIPPING_ON + half2 tiledUv2 = half2(d.texcoord0.x / _MainTex_ST.x, d.texcoord0.y / _MainTex_ST.y); + #if ATLAS_ON + tiledUv2 = half2((tiledUv2.x - _MinXUV) / (_MaxXUV - _MinXUV), (tiledUv2.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half startAngle = _RadialStartAngle - _RadialClip; + half endAngle = _RadialStartAngle + _RadialClip2; + half offset0 = clamp(0, 360, startAngle + 360); + half offset360 = clamp(0, 360, endAngle - 360); + half2 atan2Coord = half2(lerp(-1, 1, tiledUv2.x), lerp(-1, 1, tiledUv2.y)); + half atanAngle = atan2(atan2Coord.y, atan2Coord.x) * 57.3; // angle in degrees + if(atanAngle < 0) atanAngle = 360 + atanAngle; + if(atanAngle >= startAngle && atanAngle <= endAngle) discard; + if(atanAngle <= offset360) discard; + if(atanAngle >= offset0) discard; + #endif + + //----------------------------- + + //TEXTURESCROLL_ON && ATLAS_ON + #if TEXTURESCROLL_ON && ATLAS_ON + d.texcoord0.xy = half2(_MinXUV + ((_MaxXUV - _MinXUV) * (abs(((_Time.y + randomSeed) * _TextureScrollXSpeed) + uvRect.x) % 1)), + _MinYUV + ((_MaxYUV - _MinYUV) * (abs(((_Time.y + randomSeed) * _TextureScrollYSpeed) + uvRect.y) % 1))); + #endif + //---------------------------- + + //OFFSETUV_ON + #if OFFSETUV_ON + #if ATLAS_ON + d.texcoord0.xy = half2(_MinXUV + ((_MaxXUV - _MinXUV) * (abs((_OffsetUvX + uvRect.x) % 1))), + _MinYUV + ((_MaxYUV - _MinYUV) * (abs(_OffsetUvY + uvRect.y) % 1))); + #else + d.texcoord0.xy += half2(_OffsetUvX, _OffsetUvY); + #endif + #endif + + //---------------------- + + //POLARUV_ON + #if POLARUV_ON + d.texcoord0.xy = half2(atan2(d.texcoord0.y, d.texcoord0.x) / (2.0f * 3.141592653589f), length(d.texcoord0.xy)); + d.texcoord0.xy *= _MainTex_ST.xy; + #endif + + //-------------------------------------- + + //TWISTUV_ON + #if TWISTUV_ON + #if ATLAS_ON + _TwistUvPosX = ((_MaxXUV - _MinXUV) * _TwistUvPosX) + _MinXUV; + _TwistUvPosY = ((_MaxYUV - _MinYUV) * _TwistUvPosY) + _MinYUV; + #endif + half2 tempUv = d.texcoord0.xy - half2(_TwistUvPosX * _MainTex_ST.x, _TwistUvPosY * _MainTex_ST.y); + _TwistUvRadius *= (_MainTex_ST.x + _MainTex_ST.y) / 2; + half percent = (_TwistUvRadius - length(tempUv)) / _TwistUvRadius; + half theta = percent * percent * (2.0 * sin(_TwistUvAmount)) * 8.0; + half s = sin(theta); + half c = cos(theta); + half beta = max(sign(_TwistUvRadius - length(tempUv)), 0.0); + tempUv = half2(dot(tempUv, half2(c, -s)), dot(tempUv, half2(s, c))) * beta + tempUv * (1 - beta); + tempUv += half2(_TwistUvPosX * _MainTex_ST.x, _TwistUvPosY * _MainTex_ST.y); + d.texcoord0.xy = tempUv; + #endif + + //-------------------------------------------- + + //FISHEYE_ON + #if FISHEYE_ON + half bind = length(centerTiled); + half2 dF = d.texcoord0.xy - centerTiled; + half dFlen = length(dF); + half fishInt = (3.14159265359 / bind) * (_FishEyeUvAmount + 0.001); + d.texcoord0.xy = centerTiled + (dF / (max(0.0001, dFlen))) * tan(dFlen * fishInt) * bind / tan(bind * fishInt); + #endif + //--------------------------------------------- + + //PINCH_ON + #if PINCH_ON + half2 dP = d.texcoord0.xy - centerTiled; + half pinchInt = (3.141592 / length(centerTiled)) * (-_PinchUvAmount + 0.001); + d.texcoord0.xy = centerTiled + normalize(dP) * atan(length(dP) * -pinchInt * 10.0) * 0.5 / atan(-pinchInt * 5); + #endif + + //--------------------------------------------- + + //ZOOMUV_ON + #if ZOOMUV_ON + d.texcoord0.xy -= centerTiled; + d.texcoord0.xy = d.texcoord0.xy * _ZoomUvAmount; + d.texcoord0.xy += centerTiled; + #endif + + //----------------------------------------------- + + //DOODLE_ON + #if DOODLE_ON + half2 uvCopy = uvRect; + _HandDrawnSpeed = (floor((_Time.x + randomSeed) * 20 * _HandDrawnSpeed) / _HandDrawnSpeed) * _HandDrawnSpeed; + uvCopy.x = sin((uvCopy.x * _HandDrawnAmount + _HandDrawnSpeed) * 4); + uvCopy.y = cos((uvCopy.y * _HandDrawnAmount + _HandDrawnSpeed) * 4); + d.texcoord0.xy = lerp(d.texcoord0.xy, d.texcoord0.xy + uvCopy, 0.0005 * _HandDrawnAmount); + #endif + + //-------------------------- + + //SHAKEUV_ON + #if SHAKEUV_ON + half xShake = sin((_Time.x + randomSeed) * _ShakeUvSpeed * 50) * _ShakeUvX; + half yShake = cos((_Time.x + randomSeed) * _ShakeUvSpeed * 50) * _ShakeUvY; + d.texcoord0.xy += half2(xShake * 0.012, yShake * 0.01); + #endif + + //------------------------------------------- + + //RECTSIZE_ON + #if RECTSIZE_ON + d.texcoord0.xy = d.texcoord0.xy * (_RectSize).xx + (((-_RectSize * 0.5) + 0.5)).xx; + #endif + + //------------------------------------------- + + //DISTORT_ON + #if DISTORT_ON + #if ATLAS_ON + d.texcoord3.x = d.texcoord3.x * (1 / (_MaxXUV - _MinXUV)); + d.texcoord3.y = d.texcoord3.y * (1 / (_MaxYUV - _MinYUV)); + #endif + + d.texcoord3.x += ((_Time.x + _RandomSeed) * _DistortTexXSpeed) % 1; + d.texcoord3.y += ((_Time.x + _RandomSeed) * _DistortTexYSpeed) % 1; + half distortAmnt = (SAMPLE_TEXTURE2D(_DistortTex, sampler_DistortTex, d.texcoord3.xy).r - 0.5) * 0.2 * _DistortAmount; + d.texcoord0.x += distortAmnt; + d.texcoord0.y += distortAmnt; + #endif + //------------------------------------------------------- + + //WARP_ON + #if WARP_ON + half2 warpUv = half2(d.texcoord0.x / _MainTex_ST.x, d.texcoord0.y / _MainTex_ST.y); + #if ATLAS_ON + warpUv = half2((warpUv.x - _MinXUV) / (_MaxXUV - _MinXUV), (warpUv.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + const float tau = 6.283185307179586; + float xWarp = (_Time.y + randomSeed) * _WarpSpeed + warpUv.x * tau / _WarpScale; + float yWarp = (_Time.y + randomSeed) * _WarpSpeed + warpUv.y * tau / _WarpScale; + float2 warp = float2(sin(xWarp), sin(yWarp)) * _WarpStrength; + d.texcoord0.xy += warp; + #endif + + //------------------------------------------------------- + + //WAVEUV_ON + #if WAVEUV_ON + float2 uvWave = half2(_WaveX * _MainTex_ST.x, _WaveY * _MainTex_ST.y) - d.texcoord0.xy; + uvWave %= 1; + #if ATLAS_ON + uvWave = half2(_WaveX, _WaveY) - uvRect; + #endif + uvWave.x *= _ScreenParams.x / _ScreenParams.y; + float waveTime = _Time.y + randomSeed; + float angWave = (sqrt(dot(uvWave, uvWave)) * _WaveAmount) - ((waveTime * _WaveSpeed)); + d.texcoord0.xy = d.texcoord0.xy + uvWave * sin(angWave) * (_WaveStrength / 1000.0); + #endif + //---------------------------------------------------- + + //ROUNDWAVEUV_ON + #if ROUNDWAVEUV_ON + half xWave = ((0.5 * _MainTex_ST.x) - uvRect.x); + half yWave = ((0.5 * _MainTex_ST.y) - uvRect.y) * (_MainTex_TexelSize.w / _MainTex_TexelSize.z); + half ripple = -sqrt(xWave*xWave + yWave* yWave); + d.texcoord0.xy += (sin((ripple + (_Time.y + randomSeed) * (_RoundWaveSpeed/10.0)) / 0.015) * (_RoundWaveStrength/10.0)) % 1; + #endif + //---------------------------------------------------- + + + //WIND_ON + #if WIND_ON + half windOffset = sin((_Time.x + randomSeed) * _GrassSpeed * 10); + half2 windCenter = half2(0.5, 0.1); + #if ATLAS_ON + windCenter.x = ((_MaxXUV - _MinXUV) * windCenter.x) + _MinXUV; + windCenter.y = ((_MaxYUV - _MinYUV) * windCenter.y) + _MinYUV; + #endif + #if !MANUALWIND_ON + d.texcoord0.x = fmod(abs(lerp(d.texcoord0.x, d.texcoord0.x + (_GrassWind * 0.01 * windOffset), uvRect.y)), 1); + #else + d.texcoord0.x = fmod(abs(lerp(d.texcoord0.x, d.texcoord0.x + (_GrassWind * 0.01 * _GrassManualAnim), uvRect.y)), 1); + windOffset = _GrassManualAnim; + #endif + half2 delta = d.texcoord0.xy - windCenter; + half delta2 = dot(delta.xy, delta.xy); + half2 delta_offset = delta2 * windOffset; + d.texcoord0.xy = d.texcoord0.xy + half2(delta.y, -delta.x) * delta_offset * _GrassRadialBend; + #endif + + //-------------------------------------------------------- + + //TEXTURESCROLL_ON && !ATLAS_ON + #if TEXTURESCROLL_ON && !ATLAS_ON + d.texcoord0.x += ((_Time.y + randomSeed) * _TextureScrollXSpeed) % 1; + d.texcoord0.y += ((_Time.y + randomSeed) * _TextureScrollYSpeed) % 1; + #endif + //------------------------------ + + //PIXELATE_ON + #if PIXELATE_ON + half aspectRatio = _MainTex_TexelSize.x / _MainTex_TexelSize.y; + half2 pixelSize = float2(_PixelateSize, _PixelateSize * aspectRatio); + d.texcoord0.xy = floor(d.texcoord0.xy * pixelSize) / pixelSize; + #endif + //-------------- + + half4 col = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy); + half originalAlpha = col.a; + col *= d.vertexColor; + + //NORMAL MAP + #if NORMALMAP_ON + half4 normalSample = SAMPLE_TEXTURE2D(_NormalMap, sampler_NormalMap, d.texcoord0.xy); + half3 normalTS = UnpackNormal(normalSample); + normalTS.xy *= _NormalStrength; + o.Normal = normalTS; + #endif + + + //GLITCH_ON + #if GLITCH_ON + half2 uvGlitch = uvRect; + uvGlitch.y -= 0.5; + half lineNoise = pow(rand2(floor(uvGlitch * half2(24., 19.) * _GlitchSize) * 4.0, randomSeed), 3.0) * _GlitchAmount + * pow(rand2(floor(uvGlitch * half2(38., 14.) * _GlitchSize) * 4.0, randomSeed), 3.0); + col = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(lineNoise * 0.02 * rand2(half2(2.0, 1), randomSeed), 0)) * d.vertexColor; + #endif + //-------------------------------------- + + //CHROMABERR_ON + #if CHROMABERR_ON + half4 r = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(_ChromAberrAmount/10, 0)) * d.vertexColor; + half4 b = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(-_ChromAberrAmount/10, 0)) * d.vertexColor; + col = half4(r.r * r.a, col.g, b.b * b.a, max(max(r.a, b.a) * _ChromAberrAlpha, col.a)); + #endif + + //-------------------------------- + + //BLUR_ON + #if BLUR_ON + #if ATLAS_ON + #if !BLURISHD_ON + col = BlurHD(d.texcoord0.xy, _MainTex, sampler_MainTex, _BlurIntensity, (_MaxXUV - _MinXUV), (_MaxYUV - _MinYUV)) * d.vertexColor; + #else + col = Blur(d.texcoord0.xy, _MainTex, sampler_MainTex, _BlurIntensity * (_MaxXUV - _MinXUV)) * d.vertexColor; + #endif + #else + #if !BLURISHD_ON + col = BlurHD(d.texcoord0.xy, _MainTex, sampler_MainTex, _BlurIntensity, 1, 1) * d.vertexColor; + #else + col = Blur(d.texcoord0.xy, _MainTex, sampler_MainTex, _BlurIntensity) * d.vertexColor; + #endif + #endif + #endif + + //-------------------- + + //MOTIONBLUR_ON + #if MOTIONBLUR_ON + _MotionBlurAngle = _MotionBlurAngle * 3.1415926; + #define rot(n) mul(n, half2x2(cos(_MotionBlurAngle), -sin(_MotionBlurAngle), sin(_MotionBlurAngle), cos(_MotionBlurAngle))) + _MotionBlurDist = _MotionBlurDist * 0.005; + #if ATLAS_ON + _MotionBlurDist *= (_MaxXUV - _MinXUV); + #endif + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(-_MotionBlurDist, -_MotionBlurDist))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(-_MotionBlurDist * 2, -_MotionBlurDist * 2))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(-_MotionBlurDist * 3, -_MotionBlurDist * 3))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(-_MotionBlurDist * 4, -_MotionBlurDist * 4))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(_MotionBlurDist, _MotionBlurDist))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(_MotionBlurDist * 2, _MotionBlurDist * 2))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(_MotionBlurDist * 3, _MotionBlurDist * 3))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(_MotionBlurDist * 4, _MotionBlurDist * 4))); + col.rgb = col.rgb / 9; + #endif + //------------------------------------ + + //NEGATIVE_ON + #if NEGATIVE_ON + col.rgb = lerp(col.rgb, 1 - col.rgb, _NegativeAmount); + #endif + + //-------------- + half luminance = 0; + + //GREYSCALE_ON && !GREYSCALEOUTLINE_ON + #if GREYSCALE_ON && !GREYSCALEOUTLINE_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + luminance = saturate(luminance + _GreyscaleLuminosity); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _GreyscaleTintColor, _GreyscaleBlend); + #endif + //------------------------------------ + + //GHOST_ON + #if GHOST_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + half4 ghostResult; + ghostResult.a = saturate(luminance - _GhostTransparency) * col.a; + ghostResult.rgb = col.rgb * (luminance + _GhostColorBoost); + col = lerp(col, ghostResult, _GhostBlend); + #endif + //------------------------------------ + + //INNEROUTLINE_ON + #if INNEROUTLINE_ON + half3 innerT = abs(GetPixel(0, _InnerOutlineThickness, d.texcoord0.xy, _MainTex, sampler_MainTex) - GetPixel(0, -_InnerOutlineThickness, d.texcoord0.xy, _MainTex, sampler_MainTex)); + innerT += abs(GetPixel(_InnerOutlineThickness, 0, d.texcoord0.xy, _MainTex, sampler_MainTex) - GetPixel(-_InnerOutlineThickness, 0, d.texcoord0.xy, _MainTex, sampler_MainTex)); + #if !ONLYINNEROUTLINE_ON + innerT = (innerT / 2.0) * col.a * _InnerOutlineAlpha; + col.rgb += length(innerT) * _InnerOutlineColor.rgb * _InnerOutlineGlow; + #else + innerT *= col.a * _InnerOutlineAlpha; + col.rgb = length(innerT) * _InnerOutlineColor.rgb * _InnerOutlineGlow; + col.a = step(0.3, col.r+col.g+col.b); + #endif + #endif + //------------------------------------------------------- + + //HITEFFECT_ON + #if HITEFFECT_ON + col.rgb = lerp(col.rgb, _HitEffectColor.rgb * _HitEffectGlow, _HitEffectBlend); + #endif + //-------------------- + + //GRADIENT_ON + #if GRADIENT_ON + half2 tiledUvGrad = half2(uvRect.x / _MainTex_ST.x, uvRect.y / _MainTex_ST.y); + #if GRADIENT2COL_ON + _GradTopRightCol = _GradTopLeftCol; + _GradBotRightCol = _GradBotLeftCol; + #endif + #if RADIALGRADIENT_ON + half radialDist = 1 - length(tiledUvGrad - half2(0.5, 0.5)); + radialDist *= (_MainTex_TexelSize.w / _MainTex_TexelSize.z); + radialDist = saturate(_GradBoostX * radialDist); + half4 gradientResult = lerp(_GradTopLeftCol, _GradBotLeftCol, radialDist); + #else + half gradXLerpFactor = saturate(pow(tiledUvGrad.x, _GradBoostX)); + half4 gradientResult = lerp(lerp(_GradBotLeftCol, _GradBotRightCol, gradXLerpFactor), + lerp(_GradTopLeftCol, _GradTopRightCol, gradXLerpFactor), saturate(pow(tiledUvGrad.y, _GradBoostY))); + #endif + gradientResult = lerp(col, gradientResult, _GradBlend); + col.rgb = gradientResult.rgb * col.a; + col.a *= gradientResult.a; + #endif + //-------------------------------------------------------------------- + + //CONTRAST_ON + #if CONTRAST_ON + col.rgb = (col.rgb - float3(0.5, 0.5, 0.5)) * _Contrast + float3(0.5, 0.5, 0.5); + col.rgb += _Brightness; + #endif + + //------------------------------------------------------------------- + + //COLORSWAP_ON + #if COLORSWAP_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + half4 swapMask = SAMPLE_TEXTURE2D(_ColorSwapTex, sampler_ColorSwapTex, d.texcoord0.xy); + swapMask.rgb *= swapMask.a; + half3 redSwap = _ColorSwapRed * swapMask.r * saturate(luminance + _ColorSwapRedLuminosity); + half3 greenSwap = _ColorSwapGreen * swapMask.g * saturate(luminance + _ColorSwapGreenLuminosity); + half3 blueSwap = _ColorSwapBlue * swapMask.b * saturate(luminance + _ColorSwapBlueLuminosity); + swapMask.rgb = col.rgb * saturate(1 - swapMask.r - swapMask.g - swapMask.b); + col.rgb = lerp(col.rgb, swapMask.rgb + redSwap + greenSwap + blueSwap, _ColorSwapBlend); + #endif + //-------------------------------------------------------------------- + + //COLORRAMP_ON && !COLORRAMPOUTLINE_ON + #if COLORRAMP_ON && !COLORRAMPOUTLINE_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + luminance = saturate(luminance + _ColorRampLuminosity); + #if GRADIENTCOLORRAMP_ON + col.rgb = lerp(col.rgb, SAMPLE_TEXTURE2D(_ColorRampTexGradient, sampler_ColorRampTexGradient, half2(luminance, 0)).rgb, _ColorRampBlend); + #else + col.rgb = lerp(col.rgb, SAMPLE_TEXTURE2D(_ColorRampTex, sampler_ColorRampTex, half2(luminance, 0)).rgb, _ColorRampBlend); + #endif + #endif + //-------------------------------------------------------------------- + + //CHANGECOLOR_ON + #if CHANGECOLOR_ON + float3 currChangeColor = saturate(col.rgb); + luminance = 0.3 * currChangeColor.r + 0.59 * currChangeColor.g + 0.11 * currChangeColor.b; + luminance = saturate(luminance + _ColorChangeLuminosity); + half3 dif = abs(currChangeColor - _ColorChangeTarget.rgb); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _ColorChangeNewCol.rgb, + max(sign(1 - saturate(dif.x + dif.y + dif.z) - _ColorChangeTolerance), 0.0)); + #if CHANGECOLOR2_ON + dif = abs(currChangeColor - _ColorChangeTarget2.rgb); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _ColorChangeNewCol2.rgb, + max(sign(1 - saturate(dif.x + dif.y + dif.z) - _ColorChangeTolerance2), 0.0)); + #endif + #if CHANGECOLOR3_ON + dif = abs(currChangeColor - _ColorChangeTarget3.rgb); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _ColorChangeNewCol3.rgb, + max(sign(1 - saturate(dif.x + dif.y + dif.z) - _ColorChangeTolerance3), 0.0)); + #endif + #endif + //------------------------------------------------------- + + //POSTERIZE_ON && !POSTERIZEOUTLINE_ON + #if POSTERIZE_ON && !POSTERIZEOUTLINE_ON + col.rgb = pow(col.rgb, _PosterizeGamma) * _PosterizeNumColors; + col.rgb = floor(col.rgb) / _PosterizeNumColors; + col.rgb = pow(col.rgb, 1.0 / _PosterizeGamma); + #endif + //------------------------------------ + + //HSV_ON + #if HSV_ON + half3 resultHsv = half3(col.rgb); + half cosHsv = _HsvBright * _HsvSaturation * cos(_HsvShift * 3.14159265 / 180); + half sinHsv = _HsvBright * _HsvSaturation * sin(_HsvShift * 3.14159265 / 180); + resultHsv.x = (.299 * _HsvBright + .701 * cosHsv + .168 * sinHsv) * col.x + + (.587 * _HsvBright - .587 * cosHsv + .330 * sinHsv) * col.y + + (.114 * _HsvBright - .114 * cosHsv - .497 * sinHsv) * col.z; + resultHsv.y = (.299 * _HsvBright - .299 * cosHsv - .328 * sinHsv) *col.x + + (.587 * _HsvBright + .413 * cosHsv + .035 * sinHsv) * col.y + + (.114 * _HsvBright - .114 * cosHsv + .292 * sinHsv) * col.z; + resultHsv.z = (.299 * _HsvBright - .3 * cosHsv + 1.25 * sinHsv) * col.x + + (.587 * _HsvBright - .588 * cosHsv - 1.05 * sinHsv) * col.y + + (.114 * _HsvBright + .886 * cosHsv - .203 * sinHsv) * col.z; + col.rgb = resultHsv; + #endif + //------------------------------------------------------- + + //OVERLAY_ON + #if OVERLAY_ON + half2 overlayUvs = d.texcoord0.xy; + overlayUvs.x += ((_Time.y + randomSeed) * _OverlayTextureScrollXSpeed) % 1; + overlayUvs.y += ((_Time.y + randomSeed) * _OverlayTextureScrollYSpeed) % 1; + half4 overlayCol = SAMPLE_TEXTURE2D(_OverlayTex, sampler_OverlayTex, TRANSFORM_TEX(overlayUvs, _OverlayTex)); + overlayCol.rgb *= _OverlayColor.rgb * _OverlayGlow; + #if !OVERLAYMULT_ON + overlayCol.rgb *= overlayCol.a * _OverlayColor.rgb * _OverlayColor.a * _OverlayBlend; + col.rgb += overlayCol.rgb; + #else + overlayCol.a *= _OverlayColor.a; + col = lerp(col, col * overlayCol, _OverlayBlend); + #endif + #endif + + //--------------------------------- + + //OUTBASE_ON + #if OUTBASE_ON + #if OUTBASEPIXELPERF_ON + half2 destUv = half2(_OutlinePixelWidth * _MainTex_TexelSize.x, _OutlinePixelWidth * _MainTex_TexelSize.y); + #else + half2 destUv = half2(_OutlineWidth * _MainTex_TexelSize.x * 200, _OutlineWidth * _MainTex_TexelSize.y * 200); + #endif + + #if OUTDIST_ON + d.texcoord3.x += ((_Time.x + _RandomSeed) * _OutlineDistortTexXSpeed) % 1; + d.texcoord3.y += ((_Time.x + _RandomSeed) * _OutlineDistortTexYSpeed) % 1; + #if ATLAS_ON + d.texcoord3 = half2((d.texcoord3.x - _MinXUV) / (_MaxXUV - _MinXUV), (d.texcoord3.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half outDistortAmnt = (SAMPLE_TEXTURE2D(_OutlineDistortTex, sampler_OutlineDistortTex, d.texcoord3).r - 0.5) * 0.2 * _OutlineDistortAmount; + destUv.x += outDistortAmnt; + destUv.y += outDistortAmnt; + #endif + + half spriteLeft = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(destUv.x, 0)).a; + half spriteRight = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy - half2(destUv.x, 0)).a; + half spriteBottom = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(0, destUv.y)).a; + half spriteTop = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy - half2(0, destUv.y)).a; + half result = spriteLeft + spriteRight + spriteBottom + spriteTop; + + #if OUTBASE8DIR_ON + half spriteTopLeft = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(destUv.x, destUv.y)).a; + half spriteTopRight = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(-destUv.x, destUv.y)).a; + half spriteBotLeft = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(destUv.x, -destUv.y)).a; + half spriteBotRight = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(-destUv.x, -destUv.y)).a; + result = result + spriteTopLeft + spriteTopRight + spriteBotLeft + spriteBotRight; + #endif + + result = step(0.05, saturate(result)); + + #if OUTTEX_ON + d.texcoord1.x += ((_Time.x + _RandomSeed) * _OutlineTexXSpeed) % 1; + d.texcoord1.y += ((_Time.x + _RandomSeed) * _OutlineTexYSpeed) % 1; + #if ATLAS_ON + d.texcoord1 = half2((d.texcoord1.x - _MinXUV) / (_MaxXUV - _MinXUV), (d.texcoord1.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half4 tempOutColor = SAMPLE_TEXTURE2D(_OutlineTex, sampler_OutlineTex, d.texcoord1); + tempOutColor *= _OutlineColor; + _OutlineColor = tempOutColor; + #endif + + result *= (1 - originalAlpha) * _OutlineAlpha; + + half4 outline = _OutlineColor * d.vertexColor.a; + outline.rgb *= _OutlineGlow; + outline.a = result; + #if ONLYOUTLINE_ON + col = outline; + #else + col = lerp(col, outline, result); + #endif + #endif + //------------------------------------------------------- + + //FADE_ON + #if FADE_ON + half2 tiledUvFade1 = TRANSFORM_TEX(d.texcoord0, _FadeTex); + half2 tiledUvFade2 = TRANSFORM_TEX(d.texcoord0, _FadeBurnTex); + #if ATLAS_ON + tiledUvFade1 = half2((tiledUvFade1.x - _MinXUV) / (_MaxXUV - _MinXUV), (tiledUvFade1.y - _MinYUV) / (_MaxYUV - _MinYUV)); + tiledUvFade2 = half2((tiledUvFade2.x - _MinXUV) / (_MaxXUV - _MinXUV), (tiledUvFade2.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half fadeTemp = SAMPLE_TEXTURE2D(_FadeTex, sampler_FadeTex, tiledUvFade1).r; + half fade = smoothstep(_FadeAmount, _FadeAmount + _FadeBurnTransition, fadeTemp); + half fadeBurn = saturate(smoothstep(_FadeAmount - _FadeBurnWidth, _FadeAmount - _FadeBurnWidth + 0.1, fadeTemp) * _FadeAmount); + col.a *= fade; + _FadeBurnColor.rgb *= _FadeBurnGlow; + col += fadeBurn * SAMPLE_TEXTURE2D(_FadeBurnTex, sampler_FadeBurnTex, tiledUvFade2) * _FadeBurnColor * originalAlpha * (1 - col.a); + #endif + //------------------------------------------------------- + + //SHADOW_ON + #if SHADOW_ON + half shadowA = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(_ShadowX, _ShadowY)).a; + half preMultShadowMask = 1 - (saturate(shadowA - col.a) * (1 - col.a)); + col.rgb *= 1 - ((shadowA - col.a) * (1 - col.a)); + col.rgb += (_ShadowColor * shadowA) * (1 - col.a); + col.a = max(shadowA * _ShadowAlpha * d.vertexColor.a, col.a); + #endif + + //------------------------------------------------------- + + //GLOW_ON + #if GLOW_ON + half4 emission; + #if GLOWTEX_ON + emission = SAMPLE_TEXTURE2D(_GlowTex, sampler_GlowTex, d.texcoord0); + #else + emission = col; + #endif + + col.rgb *= _GlowGlobal; + emission.rgb *= emission.a * col.a * _Glow * _GlowColor; + col.rgb += emission.rgb; + #endif + //------------------------------------------------------- + + //COLORRAMP_ON && COLORRAMPOUTLINE_ON + #if COLORRAMP_ON && COLORRAMPOUTLINE_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + luminance = saturate(luminance + _ColorRampLuminosity); + #if GRADIENTCOLORRAMP_ON + col.rgb = lerp(col.rgb, SAMPLE_TEXTURE2D(_ColorRampTexGradient, sampler_ColorRampTexGradient, half2(luminance, 0)).rgb, _ColorRampBlend); + #else + col.rgb = lerp(col.rgb, SAMPLE_TEXTURE2D(_ColorRampTex, sampler_ColorRampTex, half2(luminance, 0)).rgb, _ColorRampBlend); + #endif + #endif + //--------------- + + //GREYSCALE_ON && GREYSCALEOUTLINE_ON + #if GREYSCALE_ON && GREYSCALEOUTLINE_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + luminance = saturate(luminance + _GreyscaleLuminosity); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _GreyscaleTintColor, _GreyscaleBlend); + #endif + + //----------------------------------- + + //POSTERIZE_ON && POSTERIZEOUTLINE_ON + #if POSTERIZE_ON && POSTERIZEOUTLINE_ON + col.rgb = pow(col.rgb, _PosterizeGamma) * _PosterizeNumColors; + col.rgb = floor(col.rgb) / _PosterizeNumColors; + col.rgb = pow(col.rgb, 1.0 / _PosterizeGamma); + #endif + + //----------------------------------- + + //SHINE_ON + #if SHINE_ON + half2 uvShine = uvRect; + half cosAngle = cos(_ShineRotate); + half sinAngle = sin(_ShineRotate); + half2x2 rot = half2x2(cosAngle, -sinAngle, sinAngle, cosAngle); + uvShine -= half2(0.5, 0.5); + uvShine = mul(rot, uvShine); + uvShine += half2(0.5, 0.5); + half shineMask = SAMPLE_TEXTURE2D(_ShineMask, sampler_ShineMask, d.texcoord0.xy).a; + half currentDistanceProjection = (uvShine.x + uvShine.y) / 2; + half whitePower = 1 - (abs(currentDistanceProjection - _ShineLocation) / _ShineWidth); + col.rgb += col.a * whitePower * _ShineGlow * max(sign(currentDistanceProjection - (_ShineLocation - _ShineWidth)), 0.0) + * max(sign((_ShineLocation + _ShineWidth) - currentDistanceProjection), 0.0) * _ShineColor * shineMask; + #endif + + //----------------------------------- + + //HOLOGRAM_ON + #if HOLOGRAM_ON + half totalHologram = _HologramStripesAmount + _HologramUnmodAmount; + half hologramYCoord = ((uvRect.y + (((_Time.x + randomSeed) % 1) * _HologramStripesSpeed)) % totalHologram) / totalHologram; + hologramYCoord = abs(hologramYCoord); + half alpha = RemapFloat(saturate(hologramYCoord - (_HologramUnmodAmount/totalHologram)), 0.0, 1.0, _HologramMinAlpha, saturate(_HologramMaxAlpha)); + half hologramMask = max(sign((_HologramUnmodAmount/totalHologram) - hologramYCoord), 0.0); + half4 hologramResult = col; + hologramResult.a *= lerp(alpha, 1, hologramMask); + hologramResult.rgb *= max(1, _HologramMaxAlpha * max(sign(hologramYCoord - (_HologramUnmodAmount/totalHologram)), 0.0)); + hologramMask = 1 - step(0.01,hologramMask); + hologramResult.rgb += hologramMask * _HologramStripeColor * col.a; + col = lerp(col, hologramResult, _HologramBlend); + #endif + + //----------------------------------- + + //FLICKER_ON + #if FLICKER_ON + col.a *= saturate(col.a * step(frac(0.05 + (_Time.w + randomSeed) * _FlickerFreq), 1 - _FlickerPercent) + _FlickerAlpha); + #endif + //----------------------------------- + + //ALPHACUTOFF_ON + + //ALPHAROUND_ON + + //ALPHAOUTLINE_ON + #if ALPHAOUTLINE_ON + half alphaOutlineRes = pow(1 - col.a, max(_AlphaOutlinePower, 0.0001)) * step(_AlphaOutlineMinAlpha, col.a) * _AlphaOutlineBlend; + col.rgb = lerp(col.rgb, _AlphaOutlineColor.rgb * _AlphaOutlineGlow, alphaOutlineRes); + col.a = lerp(col.a, 1, alphaOutlineRes > 1); + #endif + //------------------------------------------------------- + + //FOG_ON + + //------------------ + + col *= _Color; + o.Albedo = col; + col.a *= _Alpha; + clip(col.a - _AlphaCutoffValue - 0.01); + o.Alpha = _Color.a; + } + + + + + + void ChainSurfaceFunction(inout Surface l, inout ShaderData d) + { + Ext_SurfaceFunction0(l, d); + // Ext_SurfaceFunction1(l, d); + // Ext_SurfaceFunction2(l, d); + // Ext_SurfaceFunction3(l, d); + // Ext_SurfaceFunction4(l, d); + // Ext_SurfaceFunction5(l, d); + // Ext_SurfaceFunction6(l, d); + // Ext_SurfaceFunction7(l, d); + // Ext_SurfaceFunction8(l, d); + // Ext_SurfaceFunction9(l, d); + // Ext_SurfaceFunction10(l, d); + // Ext_SurfaceFunction11(l, d); + // Ext_SurfaceFunction12(l, d); + // Ext_SurfaceFunction13(l, d); + // Ext_SurfaceFunction14(l, d); + // Ext_SurfaceFunction15(l, d); + // Ext_SurfaceFunction16(l, d); + // Ext_SurfaceFunction17(l, d); + // Ext_SurfaceFunction18(l, d); + // Ext_SurfaceFunction19(l, d); + // Ext_SurfaceFunction20(l, d); + // Ext_SurfaceFunction21(l, d); + // Ext_SurfaceFunction22(l, d); + // Ext_SurfaceFunction23(l, d); + // Ext_SurfaceFunction24(l, d); + // Ext_SurfaceFunction25(l, d); + // Ext_SurfaceFunction26(l, d); + // Ext_SurfaceFunction27(l, d); + // Ext_SurfaceFunction28(l, d); + // Ext_SurfaceFunction29(l, d); + } + +#if !_DECALSHADER + + void ChainModifyVertex(inout VertexData v, inout VertexToPixel v2p, float4 time) + { + ExtraV2F d; + + ZERO_INITIALIZE(ExtraV2F, d); + ZERO_INITIALIZE(Blackboard, d.blackboard); + // due to motion vectors in HDRP, we need to use the last + // time in certain spots. So if you are going to use _Time to adjust vertices, + // you need to use this time or motion vectors will break. + d.time = time; + + Ext_ModifyVertex0(v, d); + // Ext_ModifyVertex1(v, d); + // Ext_ModifyVertex2(v, d); + // Ext_ModifyVertex3(v, d); + // Ext_ModifyVertex4(v, d); + // Ext_ModifyVertex5(v, d); + // Ext_ModifyVertex6(v, d); + // Ext_ModifyVertex7(v, d); + // Ext_ModifyVertex8(v, d); + // Ext_ModifyVertex9(v, d); + // Ext_ModifyVertex10(v, d); + // Ext_ModifyVertex11(v, d); + // Ext_ModifyVertex12(v, d); + // Ext_ModifyVertex13(v, d); + // Ext_ModifyVertex14(v, d); + // Ext_ModifyVertex15(v, d); + // Ext_ModifyVertex16(v, d); + // Ext_ModifyVertex17(v, d); + // Ext_ModifyVertex18(v, d); + // Ext_ModifyVertex19(v, d); + // Ext_ModifyVertex20(v, d); + // Ext_ModifyVertex21(v, d); + // Ext_ModifyVertex22(v, d); + // Ext_ModifyVertex23(v, d); + // Ext_ModifyVertex24(v, d); + // Ext_ModifyVertex25(v, d); + // Ext_ModifyVertex26(v, d); + // Ext_ModifyVertex27(v, d); + // Ext_ModifyVertex28(v, d); + // Ext_ModifyVertex29(v, d); + + + // #if %EXTRAV2F0REQUIREKEY% + // v2p.extraV2F0 = d.extraV2F0; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // v2p.extraV2F1 = d.extraV2F1; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // v2p.extraV2F2 = d.extraV2F2; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // v2p.extraV2F3 = d.extraV2F3; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // v2p.extraV2F4 = d.extraV2F4; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // v2p.extraV2F5 = d.extraV2F5; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // v2p.extraV2F6 = d.extraV2F6; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // v2p.extraV2F7 = d.extraV2F7; + // #endif + } + + void ChainModifyTessellatedVertex(inout VertexData v, inout VertexToPixel v2p) + { + ExtraV2F d; + ZERO_INITIALIZE(ExtraV2F, d); + ZERO_INITIALIZE(Blackboard, d.blackboard); + + // #if %EXTRAV2F0REQUIREKEY% + // d.extraV2F0 = v2p.extraV2F0; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // d.extraV2F1 = v2p.extraV2F1; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // d.extraV2F2 = v2p.extraV2F2; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // d.extraV2F3 = v2p.extraV2F3; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // d.extraV2F4 = v2p.extraV2F4; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // d.extraV2F5 = v2p.extraV2F5; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // d.extraV2F6 = v2p.extraV2F6; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // d.extraV2F7 = v2p.extraV2F7; + // #endif + + + // Ext_ModifyTessellatedVertex0(v, d); + // Ext_ModifyTessellatedVertex1(v, d); + // Ext_ModifyTessellatedVertex2(v, d); + // Ext_ModifyTessellatedVertex3(v, d); + // Ext_ModifyTessellatedVertex4(v, d); + // Ext_ModifyTessellatedVertex5(v, d); + // Ext_ModifyTessellatedVertex6(v, d); + // Ext_ModifyTessellatedVertex7(v, d); + // Ext_ModifyTessellatedVertex8(v, d); + // Ext_ModifyTessellatedVertex9(v, d); + // Ext_ModifyTessellatedVertex10(v, d); + // Ext_ModifyTessellatedVertex11(v, d); + // Ext_ModifyTessellatedVertex12(v, d); + // Ext_ModifyTessellatedVertex13(v, d); + // Ext_ModifyTessellatedVertex14(v, d); + // Ext_ModifyTessellatedVertex15(v, d); + // Ext_ModifyTessellatedVertex16(v, d); + // Ext_ModifyTessellatedVertex17(v, d); + // Ext_ModifyTessellatedVertex18(v, d); + // Ext_ModifyTessellatedVertex19(v, d); + // Ext_ModifyTessellatedVertex20(v, d); + // Ext_ModifyTessellatedVertex21(v, d); + // Ext_ModifyTessellatedVertex22(v, d); + // Ext_ModifyTessellatedVertex23(v, d); + // Ext_ModifyTessellatedVertex24(v, d); + // Ext_ModifyTessellatedVertex25(v, d); + // Ext_ModifyTessellatedVertex26(v, d); + // Ext_ModifyTessellatedVertex27(v, d); + // Ext_ModifyTessellatedVertex28(v, d); + // Ext_ModifyTessellatedVertex29(v, d); + + // #if %EXTRAV2F0REQUIREKEY% + // v2p.extraV2F0 = d.extraV2F0; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // v2p.extraV2F1 = d.extraV2F1; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // v2p.extraV2F2 = d.extraV2F2; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // v2p.extraV2F3 = d.extraV2F3; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // v2p.extraV2F4 = d.extraV2F4; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // v2p.extraV2F5 = d.extraV2F5; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // v2p.extraV2F6 = d.extraV2F6; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // v2p.extraV2F7 = d.extraV2F7; + // #endif + } + + void ChainFinalColorForward(inout Surface l, inout ShaderData d, inout half4 color) + { + // Ext_FinalColorForward0(l, d, color); + // Ext_FinalColorForward1(l, d, color); + // Ext_FinalColorForward2(l, d, color); + // Ext_FinalColorForward3(l, d, color); + // Ext_FinalColorForward4(l, d, color); + // Ext_FinalColorForward5(l, d, color); + // Ext_FinalColorForward6(l, d, color); + // Ext_FinalColorForward7(l, d, color); + // Ext_FinalColorForward8(l, d, color); + // Ext_FinalColorForward9(l, d, color); + // Ext_FinalColorForward10(l, d, color); + // Ext_FinalColorForward11(l, d, color); + // Ext_FinalColorForward12(l, d, color); + // Ext_FinalColorForward13(l, d, color); + // Ext_FinalColorForward14(l, d, color); + // Ext_FinalColorForward15(l, d, color); + // Ext_FinalColorForward16(l, d, color); + // Ext_FinalColorForward17(l, d, color); + // Ext_FinalColorForward18(l, d, color); + // Ext_FinalColorForward19(l, d, color); + // Ext_FinalColorForward20(l, d, color); + // Ext_FinalColorForward21(l, d, color); + // Ext_FinalColorForward22(l, d, color); + // Ext_FinalColorForward23(l, d, color); + // Ext_FinalColorForward24(l, d, color); + // Ext_FinalColorForward25(l, d, color); + // Ext_FinalColorForward26(l, d, color); + // Ext_FinalColorForward27(l, d, color); + // Ext_FinalColorForward28(l, d, color); + // Ext_FinalColorForward29(l, d, color); + } + + void ChainFinalGBufferStandard(inout Surface s, inout ShaderData d, inout half4 GBuffer0, inout half4 GBuffer1, inout half4 GBuffer2, inout half4 outEmission, inout half4 outShadowMask) + { + // Ext_FinalGBufferStandard0(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard1(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard2(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard3(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard4(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard5(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard6(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard7(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard8(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard9(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard10(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard11(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard12(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard13(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard14(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard15(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard16(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard17(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard18(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard19(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard20(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard21(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard22(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard23(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard24(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard25(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard26(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard27(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard28(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard29(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + } +#endif + + + + + +#if _DECALSHADER + + ShaderData CreateShaderData(SurfaceDescriptionInputs IN) + { + ShaderData d = (ShaderData)0; + d.TBNMatrix = float3x3(IN.WorldSpaceTangent, IN.WorldSpaceBiTangent, IN.WorldSpaceNormal); + d.worldSpaceNormal = IN.WorldSpaceNormal; + d.worldSpaceTangent = IN.WorldSpaceTangent; + + d.worldSpacePosition = IN.WorldSpacePosition; + d.texcoord0 = IN.uv0.xyxy; + d.screenPos = IN.ScreenPosition; + + d.worldSpaceViewDir = normalize(_WorldSpaceCameraPos - d.worldSpacePosition); + + d.tangentSpaceViewDir = mul(d.TBNMatrix, d.worldSpaceViewDir); + + // these rarely get used, so we back transform them. Usually will be stripped. + #if _HDRP + // d.localSpacePosition = mul(GetWorldToObjectMatrix(), float4(GetCameraRelativePositionWS(d.worldSpacePosition), 1)).xyz; + #else + // d.localSpacePosition = mul(GetWorldToObjectMatrix(), float4(d.worldSpacePosition, 1)).xyz; + #endif + // d.localSpaceNormal = normalize(mul((float3x3)GetWorldToObjectMatrix(), d.worldSpaceNormal)); + // d.localSpaceTangent = normalize(mul((float3x3)GetWorldToObjectMatrix(), d.worldSpaceTangent.xyz)); + + // #if %SCREENPOSREQUIREKEY% + // d.screenUV = (IN.ScreenPosition.xy / max(0.01, IN.ScreenPosition.w)); + // #endif + + return d; + } +#else + + ShaderData CreateShaderData(VertexToPixel i + #if NEED_FACING + , bool facing + #endif + ) + { + ShaderData d = (ShaderData)0; + d.clipPos = i.pos; + d.worldSpacePosition = i.worldPos; + + d.worldSpaceNormal = normalize(i.worldNormal); + d.worldSpaceTangent.xyz = normalize(i.worldTangent.xyz); + + d.tangentSign = i.worldTangent.w * unity_WorldTransformParams.w; + float3 bitangent = cross(d.worldSpaceTangent.xyz, d.worldSpaceNormal) * d.tangentSign; + + d.TBNMatrix = float3x3(d.worldSpaceTangent, -bitangent, d.worldSpaceNormal); + d.worldSpaceViewDir = normalize(_WorldSpaceCameraPos - i.worldPos); + + d.tangentSpaceViewDir = mul(d.TBNMatrix, d.worldSpaceViewDir); + d.texcoord0 = i.texcoord0; + d.texcoord1 = i.texcoord1; + d.texcoord2 = i.texcoord2; + + // #if %TEXCOORD3REQUIREKEY% + d.texcoord3 = i.texcoord3; + // #endif + + // d.isFrontFace = facing; + // #if %VERTEXCOLORREQUIREKEY% + d.vertexColor = i.vertexColor; + // #endif + + // these rarely get used, so we back transform them. Usually will be stripped. + #if _HDRP + // d.localSpacePosition = mul(GetWorldToObjectMatrix(), float4(GetCameraRelativePositionWS(i.worldPos), 1)).xyz; + #else + // d.localSpacePosition = mul(GetWorldToObjectMatrix(), float4(i.worldPos, 1)).xyz; + #endif + // d.localSpaceNormal = normalize(mul((float3x3)GetWorldToObjectMatrix(), i.worldNormal)); + // d.localSpaceTangent = normalize(mul((float3x3)GetWorldToObjectMatrix(), i.worldTangent.xyz)); + + // #if %SCREENPOSREQUIREKEY% + // d.screenPos = i.screenPos; + // d.screenUV = (i.screenPos.xy / i.screenPos.w); + // #endif + + + // #if %EXTRAV2F0REQUIREKEY% + // d.extraV2F0 = i.extraV2F0; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // d.extraV2F1 = i.extraV2F1; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // d.extraV2F2 = i.extraV2F2; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // d.extraV2F3 = i.extraV2F3; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // d.extraV2F4 = i.extraV2F4; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // d.extraV2F5 = i.extraV2F5; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // d.extraV2F6 = i.extraV2F6; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // d.extraV2F7 = i.extraV2F7; + // #endif + + return d; + } + +#endif + + + +#if (SHADERPASS == SHADERPASS_LIGHT_TRANSPORT) + + // This was not in constant buffer in original unity, so keep outiside. But should be in as ShaderRenderPass frequency + float unity_OneOverOutputBoost; + float unity_MaxOutputValue; + + CBUFFER_START(UnityMetaPass) + // x = use uv1 as raster position + // y = use uv2 as raster position + bool4 unity_MetaVertexControl; + + // x = return albedo + // y = return normal + bool4 unity_MetaFragmentControl; + CBUFFER_END + + VertexToPixel Vert(VertexData inputMesh) + { + VertexToPixel output; + ZERO_INITIALIZE(VertexToPixel, output); + UNITY_SETUP_INSTANCE_ID(inputMesh); + UNITY_TRANSFER_INSTANCE_ID(inputMesh, output); + UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(output); + + // Output UV coordinate in vertex shader + float2 uv = float2(0.0, 0.0); + + if (unity_MetaVertexControl.x) + { + uv = inputMesh.texcoord1.xy * unity_LightmapST.xy + unity_LightmapST.zw; + } + else if (unity_MetaVertexControl.y) + { + uv = inputMesh.texcoord2.xy * unity_DynamicLightmapST.xy + unity_DynamicLightmapST.zw; + } + + // OpenGL right now needs to actually use the incoming vertex position + // so we create a fake dependency on it here that haven't any impact. + output.pos = float4(uv * 2.0 - 1.0, inputMesh.vertex.z > 0 ? 1.0e-4 : 0.0, 1.0); + + output.worldPos = TransformObjectToWorld(inputMesh.vertex); + + // Normal is required for triplanar mapping + output.worldNormal = TransformObjectToWorldNormal(inputMesh.normal); + // Not required but assign to silent compiler warning + output.worldTangent = float4(1.0, 0.0, 0.0, 0.0); + + output.texcoord0 = inputMesh.texcoord0; + output.texcoord1 = inputMesh.texcoord1; + output.texcoord2 = inputMesh.texcoord2; + // #if %TEXCOORD3REQUIREKEY% + output.texcoord3 = inputMesh.texcoord3; + // #endif + // #if %VERTEXCOLORREQUIREKEY% + output.vertexColor = inputMesh.vertexColor; + // #endif + + return output; + } +#else + + #if (_PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR))) + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/ShaderVariablesMatrixDefsHDCamera.hlsl" + + void MotionVectorPositionZBias(VertexToPixel input) + { + #if UNITY_REVERSED_Z + input.pos.z -= unity_MotionVectorsParams.z * input.pos.w; + #else + input.pos.z += unity_MotionVectorsParams.z * input.pos.w; + #endif + } + + #endif + + VertexToPixel Vert(VertexData input) + { + VertexToPixel output; + ZERO_INITIALIZE(VertexToPixel, output); + + UNITY_SETUP_INSTANCE_ID(input); + UNITY_TRANSFER_INSTANCE_ID(input, output); + UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(output); + + // copy before user modification, since we'll apply that to the copy later + #if _HDRP && (_PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR))) + VertexData previousMesh = input; + #endif + + ChainModifyVertex(input, output, _Time); + + // This return the camera relative position (if enable) + float3 positionRWS = TransformObjectToWorld(input.vertex.xyz); + float3 normalWS = TransformObjectToWorldNormal(input.normal); + float4 tangentWS = float4(TransformObjectToWorldDir(input.tangent.xyz), input.tangent.w); + + + output.worldPos = GetAbsolutePositionWS(positionRWS); + output.pos = TransformWorldToHClip(positionRWS); + output.worldNormal = normalWS; + output.worldTangent = tangentWS; + + + output.texcoord0 = input.texcoord0; + output.texcoord1 = input.texcoord1; + output.texcoord2 = input.texcoord2; + + // #if %TEXCOORD3REQUIREKEY% + output.texcoord3 = input.texcoord3; + // #endif + + // #if %VERTEXCOLORREQUIREKEY% + output.vertexColor = input.vertexColor; + // #endif + + // #if %SCREENPOSREQUIREKEY% + // output.screenPos = ComputeScreenPos(output.pos, _ProjectionParams.x); + // #endif + + #if _HDRP && (_PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR))) + + #if !defined(TESSELLATION_ON) + MotionVectorPositionZBias(output); + #endif + + output.motionVectorCS = mul(UNITY_MATRIX_UNJITTERED_VP, float4(positionRWS, 1.0)); + // Note: unity_MotionVectorsParams.y is 0 is forceNoMotion is enabled + bool forceNoMotion = unity_MotionVectorsParams.y == 0.0; + if (forceNoMotion) + { + output.previousPositionCS = float4(0.0, 0.0, 0.0, 1.0); + } + else + { + bool hasDeformation = unity_MotionVectorsParams.x > 0.0; // Skin or morph target + + float3 effectivePositionOS = (hasDeformation ? previousMesh.previousPositionOS : previousMesh.vertex.xyz); + #if defined(_ADD_PRECOMPUTED_VELOCITY) + effectivePositionOS -= input.precomputedVelocity; + #endif + + + + previousMesh.vertex = float4(effectivePositionOS, 1); + VertexToPixel dummy = (VertexToPixel)0; + + ChainModifyVertex(previousMesh, dummy, _LastTimeParameters); + + float3 previousPositionRWS = TransformPreviousObjectToWorld(previousMesh.vertex.xyz); + // we might need this for skinned objects? + //float3 normalWS = TransformPreviousObjectToWorldNormal(input.normal).xyz; + + #ifdef _WRITE_TRANSPARENT_MOTION_VECTOR + if (_TransparentCameraOnlyMotionVectors > 0) + { + previousPositionRWS = positionRWS.xyz; + } + #endif // _WRITE_TRANSPARENT_MOTION_VECTOR + + output.previousPositionCS = mul(UNITY_MATRIX_PREV_VP, float4(previousPositionRWS, 1.0)); + } + #endif // _HDRP && _PASSMOTIONVECTOR || (_PASSFORWARD && defined(_WRITE_TRANSPARENT_MOTION_VECTOR)) + + + return output; + } + + +#endif + + + + + + + + #if defined(WRITE_DECAL_BUFFER) && !defined(_DISABLE_DECALS) + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/Decal/DecalPrepassBuffer.hlsl" + #endif + + FragInputs BuildFragInputs(VertexToPixel input) + { + UNITY_SETUP_INSTANCE_ID(input); + FragInputs output; + ZERO_INITIALIZE(FragInputs, output); + + // Init to some default value to make the computer quiet (else it output 'divide by zero' warning even if value is not used). + // TODO: this is a really poor workaround, but the variable is used in a bunch of places + // to compute normals which are then passed on elsewhere to compute other values... + output.tangentToWorld = k_identity3x3; + output.positionSS = input.pos; // input.positionCS is SV_Position + // BETTER SHADERS: because we transform world position into actual world space for things like + // triplanar, etc, we have to back transform it here for lighting + output.positionRWS = GetCameraRelativePositionWS(input.worldPos); + output.tangentToWorld = BuildTangentToWorld(input.worldTangent, input.worldNormal); + output.texCoord0 = input.texcoord0; + output.texCoord1 = input.texcoord1; + output.texCoord2 = input.texcoord2; + + return output; + } + + void BuildSurfaceData(FragInputs fragInputs, inout Surface surfaceDescription, float3 V, PositionInputs posInput, out SurfaceData surfaceData, out float3 bentNormalWS) + { + // setup defaults -- these are used if the graph doesn't output a value + ZERO_INITIALIZE(SurfaceData, surfaceData); + + // specularOcclusion need to be init ahead of decal to quiet the compiler that modify the SurfaceData struct + // however specularOcclusion can come from the graph, so need to be init here so it can be override. + surfaceData.specularOcclusion = 1.0; + + // copy across graph values, if defined + surfaceData.baseColor = surfaceDescription.Albedo; + surfaceData.perceptualSmoothness = surfaceDescription.Smoothness; + surfaceData.ambientOcclusion = surfaceDescription.Occlusion; + surfaceData.specularOcclusion = surfaceDescription.SpecularOcclusion; + surfaceData.metallic = surfaceDescription.Metallic; + surfaceData.subsurfaceMask = surfaceDescription.SubsurfaceMask; + surfaceData.thickness = surfaceDescription.Thickness; + surfaceData.diffusionProfileHash = asuint(surfaceDescription.DiffusionProfileHash); + #if _USESPECULAR + surfaceData.specularColor = surfaceDescription.Specular; + #endif + surfaceData.coatMask = surfaceDescription.CoatMask; + surfaceData.anisotropy = surfaceDescription.Anisotropy; + surfaceData.iridescenceMask = surfaceDescription.IridescenceMask; + surfaceData.iridescenceThickness = surfaceDescription.IridescenceThickness; + + + + #if defined(_REFRACTION_PLANE) || defined(_REFRACTION_SPHERE) || defined(_REFRACTION_THIN) + if (_EnableSSRefraction) + { + surfaceData.transmittanceMask = (1.0 - surfaceDescription.Alpha); + surfaceDescription.Alpha = 1.0; + } + else + { + surfaceData.ior = surfaceDescription.ior; + surfaceData.transmittanceColor = surfaceDescription.transmittanceColor; + surfaceData.atDistance = surfaceDescription.atDistance; + surfaceData.transmittanceMask = surfaceDescription.transmittanceMask; + surfaceDescription.Alpha = 1.0; + } + #else + surfaceData.ior = 1.0; + surfaceData.transmittanceColor = float3(1.0, 1.0, 1.0); + surfaceData.atDistance = 1.0; + surfaceData.transmittanceMask = 0.0; + #endif + + + #if defined(_ENABLE_SHADOW_MATTE) && SHADERPASS == SHADERPASS_FORWARD_UNLIT + HDShadowContext shadowContext = InitShadowContext(); + float shadow; + float3 shadow3; + // We need to recompute some coordinate not computed by default for shadow matte + posInput = GetPositionInput(fragInputs.positionSS.xy, _ScreenSize.zw, fragInputs.positionSS.z, UNITY_MATRIX_I_VP, GetWorldToViewMatrix()); + float3 upWS = normalize(fragInputs.tangentToWorld[1]); + uint renderingLayers = GetMeshRenderingLightLayer(); + ShadowLoopMin(shadowContext, posInput, upWS, asuint(_ShadowMatteFilter), renderingLayers, shadow3); + shadow = dot(shadow3, float3(1.0 / 3.0, 1.0 / 3.0, 1.0 / 3.0)); + + float4 shadowColor = (1.0 - shadow) * surfaceDescription.ShadowTint.rgba; + float localAlpha = saturate(shadowColor.a + surfaceDescription.Alpha); + + // Keep the nested lerp + // With no Color (bsdfData.color.rgb, bsdfData.color.a == 0.0f), just use ShadowColor*Color to avoid a ring of "white" around the shadow + // And mix color to consider the Color & ShadowColor alpha (from texture or/and color picker) + #ifdef _SURFACE_TYPE_TRANSPARENT + surfaceData.baseColor = lerp(shadowColor.rgb * surfaceData.baseColor, lerp(lerp(shadowColor.rgb, surfaceData.baseColor, 1.0 - surfaceDescription.ShadowTint.a), surfaceData.baseColor, shadow), surfaceDescription.Alpha); + #else + surfaceData.baseColor = lerp(lerp(shadowColor.rgb, surfaceData.baseColor, 1.0 - surfaceDescription.ShadowTint.a), surfaceData.baseColor, shadow); + #endif + localAlpha = ApplyBlendMode(surfaceData.baseColor, localAlpha).a; + + surfaceDescription.Alpha = localAlpha; + #endif + + // These static material feature allow compile time optimization + surfaceData.materialFeatures = MATERIALFEATUREFLAGS_LIT_STANDARD; + #ifdef _MATERIAL_FEATURE_SUBSURFACE_SCATTERING + surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_SUBSURFACE_SCATTERING; + #endif + + #ifdef _MATERIAL_FEATURE_TRANSMISSION + surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_TRANSMISSION; + #endif + + #ifdef _MATERIAL_FEATURE_ANISOTROPY + surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_ANISOTROPY; + #endif + + #ifdef _MATERIAL_FEATURE_IRIDESCENCE + surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_IRIDESCENCE; + #endif + + #ifdef _MATERIAL_FEATURE_SPECULAR_COLOR + surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_SPECULAR_COLOR; + #endif + + #if defined(_MATERIAL_FEATURE_CLEAR_COAT) || _CLEARCOAT + surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_CLEAR_COAT; + #endif + + #if defined (_MATERIAL_FEATURE_SPECULAR_COLOR) && defined (_ENERGY_CONSERVING_SPECULAR) + // Require to have setup baseColor + // Reproduce the energy conservation done in legacy Unity. Not ideal but better for compatibility and users can unchek it + surfaceData.baseColor *= (1.0 - Max3(surfaceData.specularColor.r, surfaceData.specularColor.g, surfaceData.specularColor.b)); + #endif + + + + // compute world space normal + #if !_WORLDSPACENORMAL + surfaceData.normalWS = mul(surfaceDescription.Normal, fragInputs.tangentToWorld); + #else + surfaceData.normalWS = surfaceDescription.Normal; + #endif + + surfaceData.geomNormalWS = fragInputs.tangentToWorld[2]; + + surfaceData.tangentWS = normalize(fragInputs.tangentToWorld[0].xyz); // The tangent is not normalize in tangentToWorld for mikkt. TODO: Check if it expected that we normalize with Morten. Tag: SURFACE_GRADIENT + + + #if HAVE_DECALS + if (_EnableDecals) + { + float alpha = 1.0; + alpha = surfaceDescription.Alpha; + + // Both uses and modifies 'surfaceData.normalWS'. + DecalSurfaceData decalSurfaceData = GetDecalSurfaceData(posInput, fragInputs.tangentToWorld[2], alpha); + ApplyDecalToSurfaceData(decalSurfaceData, fragInputs.tangentToWorld[2], surfaceData); + } + #endif + + bentNormalWS = surfaceData.normalWS; + + surfaceData.tangentWS = Orthonormalize(surfaceData.tangentWS, surfaceData.normalWS); + + #ifdef DEBUG_DISPLAY + if (_DebugMipMapMode != DEBUGMIPMAPMODE_NONE) + { + // TODO: need to update mip info + surfaceData.metallic = 0; + } + + // We need to call ApplyDebugToSurfaceData after filling the surfarcedata and before filling builtinData + // as it can modify attribute use for static lighting + ApplyDebugToSurfaceData(fragInputs.tangentToWorld, surfaceData); + #endif + + // By default we use the ambient occlusion with Tri-ace trick (apply outside) for specular occlusion. + // If user provide bent normal then we process a better term + #if defined(_SPECULAR_OCCLUSION_CUSTOM) + // Just use the value passed through via the slot (not active otherwise) + #elif defined(_SPECULAR_OCCLUSION_FROM_AO_BENT_NORMAL) + // If we have bent normal and ambient occlusion, process a specular occlusion + surfaceData.specularOcclusion = GetSpecularOcclusionFromBentAO(V, bentNormalWS, surfaceData.normalWS, surfaceData.ambientOcclusion, PerceptualSmoothnessToPerceptualRoughness(surfaceData.perceptualSmoothness)); + #elif defined(_AMBIENT_OCCLUSION) && defined(_SPECULAR_OCCLUSION_FROM_AO) + surfaceData.specularOcclusion = GetSpecularOcclusionFromAmbientOcclusion(ClampNdotV(dot(surfaceData.normalWS, V)), surfaceData.ambientOcclusion, PerceptualSmoothnessToRoughness(surfaceData.perceptualSmoothness)); + #endif + + #if defined(_ENABLE_GEOMETRIC_SPECULAR_AA) && !defined(SHADER_STAGE_RAY_TRACING) + surfaceData.perceptualSmoothness = GeometricNormalFiltering(surfaceData.perceptualSmoothness, fragInputs.tangentToWorld[2], surfaceDescription.SpecularAAScreenSpaceVariance, surfaceDescription.SpecularAAThreshold); + #endif + } + + void GetSurfaceAndBuiltinData(VertexToPixel m2ps, FragInputs fragInputs, float3 V, inout PositionInputs posInput, + out SurfaceData surfaceData, out BuiltinData builtinData, inout Surface l, inout ShaderData d + #if NEED_FACING + , bool facing + #endif + ) + { + // Removed since crossfade does not work, probably needs extra material setup. + //#if !defined(SHADER_STAGE_RAY_TRACING) && !defined(_TESSELLATION_DISPLACEMENT) + // #ifdef LOD_FADE_CROSSFADE // enable dithering LOD transition if user select CrossFade transition in LOD group + // LODDitheringTransition(ComputeFadeMaskSeed(V, posInput.positionSS), unity_LODFade.x); + // #endif + //#endif + + d = CreateShaderData(m2ps + #if NEED_FACING + , facing + #endif + ); + + l = (Surface)0; + + l.Albedo = half3(0.5, 0.5, 0.5); + l.Normal = float3(0,0,1); + l.Occlusion = 1; + l.Alpha = 1; + l.SpecularOcclusion = 1; + + #if !defined(SHADER_STAGE_RAY_TRACING) && defined(_DEPTHOFFSET_ON) + l.outputDepth = d.clipPos.z; + #endif + + ChainSurfaceFunction(l, d); + + #if !defined(SHADER_STAGE_RAY_TRACING) && defined(_DEPTHOFFSET_ON) + //posInput.deviceDepth = l.outputDepth; + #endif + + #if _UNLIT + //l.Emission = l.Albedo; + //l.Albedo = 0; + l.Normal = half3(0,0,1); + l.Occlusion = 1; + l.Metallic = 0; + l.Specular = 0; + #endif + + surfaceData.geomNormalWS = d.worldSpaceNormal; + surfaceData.tangentWS = d.worldSpaceTangent; + fragInputs.tangentToWorld = d.TBNMatrix; + + float3 bentNormalWS; + BuildSurfaceData(fragInputs, l, V, posInput, surfaceData, bentNormalWS); + + + InitBuiltinData(posInput, l.Alpha, bentNormalWS, -d.worldSpaceNormal, fragInputs.texCoord1, fragInputs.texCoord2, builtinData); + + + + builtinData.emissiveColor = l.Emission; + + #if defined(_OVERRIDE_BAKEDGI) + builtinData.bakeDiffuseLighting = l.DiffuseGI; + builtinData.backBakeDiffuseLighting = l.BackDiffuseGI; + builtinData.emissiveColor += l.SpecularGI; + #endif + + #if defined(_OVERRIDE_SHADOWMASK) + builtinData.shadowMask0 = l.ShadowMask.x; + builtinData.shadowMask1 = l.ShadowMask.y; + builtinData.shadowMask2 = l.ShadowMask.z; + builtinData.shadowMask3 = l.ShadowMask.w; + #endif + + #if defined(UNITY_VIRTUAL_TEXTURING) + builtinData.vtPackedFeedback = surfaceData.VTPackedFeedback; + #endif + + #if (SHADERPASS == SHADERPASS_DISTORTION) + //builtinData.distortion = surfaceData.Distortion; + //builtinData.distortionBlur = surfaceData.DistortionBlur; + #endif + + #ifndef SHADER_UNLIT + // PostInitBuiltinData call ApplyDebugToBuiltinData + PostInitBuiltinData(V, posInput, surfaceData, builtinData); + #else + ApplyDebugToBuiltinData(builtinData); + #endif + + RAY_TRACING_OPTIONAL_ALPHA_TEST_PASS + } + + + + #ifdef UNITY_VIRTUAL_TEXTURING + #define VT_BUFFER_TARGET SV_Target1 + #define EXTRA_BUFFER_TARGET SV_Target2 + #else + #define EXTRA_BUFFER_TARGET SV_Target1 + #endif + + + + + void Frag(VertexToPixel v2p, + #ifdef OUTPUT_SPLIT_LIGHTING + out float4 outColor : SV_Target0, // outSpecularLighting + #ifdef UNITY_VIRTUAL_TEXTURING + out float4 outVTFeedback : VT_BUFFER_TARGET, + #endif + out float4 outDiffuseLighting : EXTRA_BUFFER_TARGET, + OUTPUT_SSSBUFFER(outSSSBuffer) + #else + out float4 outColor : SV_Target0 + #ifdef UNITY_VIRTUAL_TEXTURING + ,out float4 outVTFeedback : VT_BUFFER_TARGET + #endif + #ifdef _WRITE_TRANSPARENT_MOTION_VECTOR + , out float4 outMotionVec : EXTRA_BUFFER_TARGET + #endif // _WRITE_TRANSPARENT_MOTION_VECTOR + #endif // OUTPUT_SPLIT_LIGHTING + #ifdef _DEPTHOFFSET_ON + , out float outputDepth : SV_Depth + #endif + #if NEED_FACING + , bool facing : SV_IsFrontFace + #endif + ) + { + #ifdef _WRITE_TRANSPARENT_MOTION_VECTOR + // Init outMotionVector here to solve compiler warning (potentially unitialized variable) + // It is init to the value of forceNoMotion (with 2.0) + outMotionVec = float4(2.0, 0.0, 0.0, 0.0); + #endif + + UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX(v2p); + FragInputs input = BuildFragInputs(v2p); + + // We need to readapt the SS position as our screen space positions are for a low res buffer, but we try to access a full res buffer. + input.positionSS.xy = _OffScreenRendering > 0 ? (input.positionSS.xy * _OffScreenDownsampleFactor) : input.positionSS.xy; + + uint2 tileIndex = uint2(input.positionSS.xy) / GetTileSize(); + + // input.positionSS is SV_Position + PositionInputs posInput = GetPositionInput(input.positionSS.xy, _ScreenSize.zw, input.positionSS.z, input.positionSS.w, input.positionRWS.xyz, tileIndex); + + + float3 V = GetWorldSpaceNormalizeViewDir(input.positionRWS); + + + SurfaceData surfaceData; + BuiltinData builtinData; + Surface l; + ShaderData d; + GetSurfaceAndBuiltinData(v2p, input, V, posInput, surfaceData, builtinData, l, d + #if NEED_FACING + , facing + #endif + ); + + + BSDFData bsdfData = ConvertSurfaceDataToBSDFData(input.positionSS.xy, surfaceData); + + PreLightData preLightData = GetPreLightData(V, posInput, bsdfData); + + outColor = float4(0.0, 0.0, 0.0, 0.0); + + // We need to skip lighting when doing debug pass because the debug pass is done before lighting so some buffers may not be properly initialized potentially causing crashes on PS4. + + #ifdef DEBUG_DISPLAY + // Init in debug display mode to quiet warning + #ifdef OUTPUT_SPLIT_LIGHTING + outDiffuseLighting = 0; + ENCODE_INTO_SSSBUFFER(surfaceData, posInput.positionSS, outSSSBuffer); + #endif + + + + // Same code in ShaderPassForwardUnlit.shader + // Reminder: _DebugViewMaterialArray[i] + // i==0 -> the size used in the buffer + // i>0 -> the index used (0 value means nothing) + // The index stored in this buffer could either be + // - a gBufferIndex (always stored in _DebugViewMaterialArray[1] as only one supported) + // - a property index which is different for each kind of material even if reflecting the same thing (see MaterialSharedProperty) + bool viewMaterial = false; + int bufferSize = _DebugViewMaterialArray[0].x; + if (bufferSize != 0) + { + bool needLinearToSRGB = false; + float3 result = float3(1.0, 0.0, 1.0); + + // Loop through the whole buffer + // Works because GetSurfaceDataDebug will do nothing if the index is not a known one + for (int index = 1; index <= bufferSize; index++) + { + int indexMaterialProperty = _DebugViewMaterialArray[index].x; + + // skip if not really in use + if (indexMaterialProperty != 0) + { + viewMaterial = true; + + GetPropertiesDataDebug(indexMaterialProperty, result, needLinearToSRGB); + GetVaryingsDataDebug(indexMaterialProperty, input, result, needLinearToSRGB); + GetBuiltinDataDebug(indexMaterialProperty, builtinData, posInput, result, needLinearToSRGB); + GetSurfaceDataDebug(indexMaterialProperty, surfaceData, result, needLinearToSRGB); + GetBSDFDataDebug(indexMaterialProperty, bsdfData, result, needLinearToSRGB); + } + } + + // TEMP! + // For now, the final blit in the backbuffer performs an sRGB write + // So in the meantime we apply the inverse transform to linear data to compensate. + if (!needLinearToSRGB) + result = SRGBToLinear(max(0, result)); + + outColor = float4(result, 1.0); + } + + if (!viewMaterial) + { + if (_DebugFullScreenMode == FULLSCREENDEBUGMODE_VALIDATE_DIFFUSE_COLOR || _DebugFullScreenMode == FULLSCREENDEBUGMODE_VALIDATE_SPECULAR_COLOR) + { + float3 result = float3(0.0, 0.0, 0.0); + + GetPBRValidatorDebug(surfaceData, result); + + outColor = float4(result, 1.0f); + } + else if (_DebugFullScreenMode == FULLSCREENDEBUGMODE_TRANSPARENCY_OVERDRAW) + { + float4 result = _DebugTransparencyOverdrawWeight * float4(TRANSPARENCY_OVERDRAW_COST, TRANSPARENCY_OVERDRAW_COST, TRANSPARENCY_OVERDRAW_COST, TRANSPARENCY_OVERDRAW_A); + outColor = result; + } + else + #endif + { + #ifdef _SURFACE_TYPE_TRANSPARENT + uint featureFlags = LIGHT_FEATURE_MASK_FLAGS_TRANSPARENT; + #else + uint featureFlags = LIGHT_FEATURE_MASK_FLAGS_OPAQUE; + #endif + + LightLoopOutput lightLoopOutput; + LightLoop(V, posInput, preLightData, bsdfData, builtinData, featureFlags, lightLoopOutput); + + float3 diffuseLighting = lightLoopOutput.diffuseLighting; + float3 specularLighting = lightLoopOutput.specularLighting; + + diffuseLighting *= GetCurrentExposureMultiplier(); + specularLighting *= GetCurrentExposureMultiplier(); + + #ifdef OUTPUT_SPLIT_LIGHTING + if (_EnableSubsurfaceScattering != 0 && ShouldOutputSplitLighting(bsdfData)) + { + outColor = float4(specularLighting, 1.0); + outDiffuseLighting = float4(TagLightingForSSS(diffuseLighting), 1.0); + } + else + { + outColor = float4(diffuseLighting + specularLighting, 1.0); + outDiffuseLighting = 0; + } + ENCODE_INTO_SSSBUFFER(surfaceData, posInput.positionSS, outSSSBuffer); + #else + outColor = ApplyBlendMode(diffuseLighting, specularLighting, builtinData.opacity); + outColor = EvaluateAtmosphericScattering(posInput, V, outColor); + #endif + + ChainFinalColorForward(l, d, outColor); + + #ifdef _WRITE_TRANSPARENT_MOTION_VECTOR + bool forceNoMotion = any(unity_MotionVectorsParams.yw == 0.0); + // outMotionVec is already initialize at the value of forceNoMotion (see above) + if (!forceNoMotion) + { + float2 motionVec = CalculateMotionVector(v2p.motionVectorCS, v2p.previousPositionCS); + EncodeMotionVector(motionVec * 0.5, outMotionVec); + outMotionVec.zw = 1.0; + } + #endif + } + + #ifdef DEBUG_DISPLAY + } + #endif + + #ifdef _DEPTHOFFSET_ON + outputDepth = l.outputDepth; + #endif + + #ifdef UNITY_VIRTUAL_TEXTURING + outVTFeedback = builtinData.vtPackedFeedback; + #endif + } + + ENDHLSL + } + Pass + { + // based on HDLitPass.template + Name "GBuffer" + Tags { "LightMode" = "GBuffer" } + //------------------------------------------------------------------------------------- + // Render Modes (Blend, Cull, ZTest, Stencil, etc) + //------------------------------------------------------------------------------------- + + Cull Back + ZTest [_ZTestGBuffer] + Stencil + { + WriteMask [_StencilWriteMaskGBuffer] + Ref [_StencilRefGBuffer] + CompFront Always + PassFront Replace + CompBack Always + PassBack Replace + } + + Tags { "RenderType" = "Opaque" "Queue" = "Geometry" "PreviewType" = "Plane" } + Cull [_CullingOption] + ZWrite [_ZWrite] + ZTest [_ZTestMode] + + + //------------------------------------------------------------------------------------- + // End Render Modes + //------------------------------------------------------------------------------------- + + HLSLPROGRAM + + #pragma target 4.5 + #pragma only_renderers d3d11 playstation xboxone vulkan metal switch + #pragma multi_compile_instancing + #pragma instancing_options renderinglayer + + + #pragma multi_compile _ LIGHT_LAYERS + //#pragma shader_feature _ _SURFACE_TYPE_TRANSPARENT + //#pragma shader_feature_local _BLENDMODE_OFF _BLENDMODE_ALPHA _BLENDMODE_ADD _BLENDMODE_PRE_MULTIPLY + //#pragma shader_feature_local _ _ADD_PRECOMPUTED_VELOCITY + //#pragma shader_feature_local _ _TRANSPARENT_WRITES_MOTION_VEC + //#pragma shader_feature_local _ _ENABLE_FOG_ON_TRANSPARENT + #pragma multi_compile _ DEBUG_DISPLAY + //#pragma shader_feature_local _ _DISABLE_DECALS + //#pragma shader_feature_local _ _DISABLE_SSR + //#pragma shader_feature_local _ _DISABLE_SSR_TRANSPARENT + #pragma multi_compile _ LIGHTMAP_ON + #pragma multi_compile _ DIRLIGHTMAP_COMBINED + #pragma multi_compile _ DYNAMICLIGHTMAP_ON + #pragma multi_compile _ SHADOWS_SHADOWMASK + #pragma multi_compile DECALS_OFF DECALS_3RT DECALS_4RT + //#pragma shader_feature_local _REFRACTION_OFF _REFRACTION_PLANE _REFRACTION_SPHERE _REFRACTION_THIN + + + //------------------------------------------------------------------------------------- + // Variant Definitions (active field translations to HDRP defines) + //------------------------------------------------------------------------------------- + // #define _MATERIAL_FEATURE_SUBSURFACE_SCATTERING 1 + // #define _MATERIAL_FEATURE_TRANSMISSION 1 + // #define _MATERIAL_FEATURE_ANISOTROPY 1 + // #define _MATERIAL_FEATURE_IRIDESCENCE 1 + // #define _MATERIAL_FEATURE_SPECULAR_COLOR 1 + #define _ENABLE_FOG_ON_TRANSPARENT 1 + // #define _AMBIENT_OCCLUSION 1 + // #define _SPECULAR_OCCLUSION_FROM_AO 1 + // #define _SPECULAR_OCCLUSION_FROM_AO_BENT_NORMAL 1 + // #define _SPECULAR_OCCLUSION_CUSTOM 1 + // #define _ENERGY_CONSERVING_SPECULAR 1 + // #define _ENABLE_GEOMETRIC_SPECULAR_AA 1 + // #define _HAS_REFRACTION 1 + // #define _REFRACTION_PLANE 1 + // #define _REFRACTION_SPHERE 1 + // #define _DISABLE_DECALS 1 + // #define _DISABLE_SSR 1 + // #define _ADD_PRECOMPUTED_VELOCITY + // #define _WRITE_TRANSPARENT_MOTION_VECTOR 1 + // #define _DEPTHOFFSET_ON 1 + // #define _BLENDMODE_PRESERVE_SPECULAR_LIGHTING 1 + + #define SHADERPASS SHADERPASS_GBUFFER + #define RAYTRACING_SHADER_GRAPH_DEFAULT + #define _PASSGBUFFER 1 + + + #pragma shader_feature_local GLOW_ON + #pragma shader_feature_local FADE_ON + #pragma shader_feature_local OUTBASE_ON + #pragma shader_feature_local ONLYOUTLINE_ON + #pragma shader_feature_local GRADIENT_ON + #pragma shader_feature_local GRADIENT2COL_ON + #pragma shader_feature_local RADIALGRADIENT_ON + #pragma shader_feature_local COLORSWAP_ON + #pragma shader_feature_local HSV_ON + #pragma shader_feature_local CHANGECOLOR_ON + #pragma shader_feature_local CHANGECOLOR2_ON + #pragma shader_feature_local CHANGECOLOR3_ON + #pragma shader_feature_local COLORRAMP_ON + #pragma shader_feature_local GRADIENTCOLORRAMP_ON + #pragma shader_feature_local HITEFFECT_ON + #pragma shader_feature_local NEGATIVE_ON + #pragma shader_feature_local PIXELATE_ON + #pragma shader_feature_local GREYSCALE_ON + #pragma shader_feature_local POSTERIZE_ON + #pragma shader_feature_local BLUR_ON + #pragma shader_feature_local MOTIONBLUR_ON + #pragma shader_feature_local GHOST_ON + #pragma shader_feature_local ALPHAOUTLINE_ON + #pragma shader_feature_local INNEROUTLINE_ON + #pragma shader_feature_local ONLYINNEROUTLINE_ON + #pragma shader_feature_local HOLOGRAM_ON + #pragma shader_feature_local CHROMABERR_ON + #pragma shader_feature_local GLITCH_ON + #pragma shader_feature_local FLICKER_ON + #pragma shader_feature_local SHADOW_ON + #pragma shader_feature_local SHINE_ON + #pragma shader_feature_local CONTRAST_ON + #pragma shader_feature_local OVERLAY_ON + #pragma shader_feature_local OVERLAYMULT_ON + #pragma shader_feature_local DOODLE_ON + #pragma shader_feature_local WIND_ON + #pragma shader_feature_local WAVEUV_ON + #pragma shader_feature_local ROUNDWAVEUV_ON + #pragma shader_feature_local RECTSIZE_ON + #pragma shader_feature_local OFFSETUV_ON + #pragma shader_feature_local CLIPPING_ON + #pragma shader_feature_local RADIALCLIPPING_ON + #pragma shader_feature_local TEXTURESCROLL_ON + #pragma shader_feature_local ZOOMUV_ON + #pragma shader_feature_local DISTORT_ON + #pragma shader_feature_local WARP_ON + #pragma shader_feature_local TWISTUV_ON + #pragma shader_feature_local ROTATEUV_ON + #pragma shader_feature_local POLARUV_ON + #pragma shader_feature_local FISHEYE_ON + #pragma shader_feature_local PINCH_ON + #pragma shader_feature_local SHAKEUV_ON + + #pragma shader_feature_local GLOWTEX_ON + #pragma shader_feature_local OUTTEX_ON + #pragma shader_feature_local OUTDIST_ON + #pragma shader_feature_local OUTBASE8DIR_ON + #pragma shader_feature_local OUTBASEPIXELPERF_ON + #pragma shader_feature_local COLORRAMPOUTLINE_ON + #pragma shader_feature_local GREYSCALEOUTLINE_ON + #pragma shader_feature_local POSTERIZEOUTLINE_ON + #pragma shader_feature_local BLURISHD_ON + #pragma shader_feature_local MANUALWIND_ON + #pragma shader_feature_local ATLAS_ON + #pragma shader_feature_local PREMULTIPLYALPHA_ON + + #pragma shader_feature BILBOARD_ON + #pragma shader_feature BILBOARDY_ON + + #pragma shader_feature NORMALMAP_ON + + + #define _HDRP 1 +#define _USINGTEXCOORD1 1 +#define _USINGTEXCOORD2 1 + + + #pragma vertex Vert + #pragma fragment Frag + + + //------------------------------------------------------------------------------------- + // Defines + //------------------------------------------------------------------------------------- + + + + + // useful conversion functions to make surface shader code just work + + #define UNITY_DECLARE_TEX2D(name) TEXTURE2D(name); SAMPLER(sampler##name); + #define UNITY_DECLARE_TEX2D_NOSAMPLER(name) TEXTURE2D(name); + #define UNITY_DECLARE_TEX2DARRAY(name) TEXTURE2D_ARRAY(name); SAMPLER(sampler##name); + #define UNITY_DECLARE_TEX2DARRAY_NOSAMPLER(tex) TEXTURE2D_ARRAY(tex); + + #define UNITY_SAMPLE_TEX2DARRAY(tex,coord) SAMPLE_TEXTURE2D_ARRAY(tex, sampler##tex, coord.xy, coord.z) + #define UNITY_SAMPLE_TEX2DARRAY_LOD(tex,coord,lod) SAMPLE_TEXTURE2D_ARRAY_LOD(tex, sampler##tex, coord.xy, coord.z, lod) + #define UNITY_SAMPLE_TEX2D(tex, coord) SAMPLE_TEXTURE2D(tex, sampler##tex, coord) + #define UNITY_SAMPLE_TEX2D_SAMPLER(tex, samp, coord) SAMPLE_TEXTURE2D(tex, sampler##samp, coord) + + #define UNITY_SAMPLE_TEX2D_LOD(tex,coord, lod) SAMPLE_TEXTURE2D_LOD(tex, sampler_##tex, coord, lod) + #define UNITY_SAMPLE_TEX2D_SAMPLER_LOD(tex,samplertex,coord, lod) SAMPLE_TEXTURE2D_LOD (tex, sampler##samplertex,coord, lod) + + #if defined(UNITY_COMPILER_HLSL) + #define UNITY_INITIALIZE_OUTPUT(type,name) name = (type)0; + #else + #define UNITY_INITIALIZE_OUTPUT(type,name) + #endif + + #define sampler2D_float sampler2D + #define sampler2D_half sampler2D + + #undef WorldNormalVector + #define WorldNormalVector(data, normal) mul(normal, data.TBNMatrix) + + #define UnityObjectToWorldNormal(normal) mul(GetObjectToWorldMatrix(), normal) + + + + +// HDRP Adapter stuff + #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Common.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/ShaderVariables.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/ShaderPass/FragInputs.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/ShaderPass/ShaderPass.cs.hlsl" + #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/TextureStack.hlsl" // Required to be include before we include properties as it define DECLARE_STACK_CB + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/ShaderGraphHeader.hlsl" // Need to be here for Gradient struct definition + + #ifdef RAYTRACING_SHADER_GRAPH_DEFAULT + #define RAYTRACING_SHADER_GRAPH_HIGH + #endif + + #ifdef RAYTRACING_SHADER_GRAPH_RAYTRACED + #define RAYTRACING_SHADER_GRAPH_LOW + #endif + // end + + + + + // If we use subsurface scattering, enable output split lighting (for forward pass) + #if defined(_MATERIAL_FEATURE_SUBSURFACE_SCATTERING) && !defined(_SURFACE_TYPE_TRANSPARENT) + #define OUTPUT_SPLIT_LIGHTING + #endif + + #define HAVE_RECURSIVE_RENDERING + + #if SHADERPASS == SHADERPASS_TRANSPARENT_DEPTH_PREPASS + #if !defined(_DISABLE_SSR_TRANSPARENT) && !defined(SHADER_UNLIT) + #define WRITE_NORMAL_BUFFER + #endif + #endif + + #ifndef DEBUG_DISPLAY + // In case of opaque we don't want to perform the alpha test, it is done in depth prepass and we use depth equal for ztest (setup from UI) + // Don't do it with debug display mode as it is possible there is no depth prepass in this case + #if !defined(_SURFACE_TYPE_TRANSPARENT) && defined(_ALPHATEST) + #if SHADERPASS == SHADERPASS_FORWARD + #define SHADERPASS_FORWARD_BYPASS_ALPHA_TEST + #elif SHADERPASS == SHADERPASS_GBUFFER + #define SHADERPASS_GBUFFER_BYPASS_ALPHA_TEST + #endif + #endif + #endif + + // Translate transparent motion vector define + #if defined(_TRANSPARENT_WRITES_MOTION_VEC) && defined(_SURFACE_TYPE_TRANSPARENT) + #define _WRITE_TRANSPARENT_MOTION_VECTOR + #endif + + + + + CBUFFER_START(UnityPerMaterial) + float _UseShadowThreshold; + float _BlendMode; + float _EnableBlendModePreserveSpecularLighting; + float _RayTracing; + float _RefractionModel; + + + half4 _Color; + half4 _MainTex_ST, _MainTex_TexelSize; + half _Alpha, _AlphaCutoffValue; + + #if ATLAS_ON + half _MinXUV, _MaxXUV, _MinYUV, _MaxYUV; + #endif + + #if GLOW_ON + half4 _GlowColor; + half _Glow, _GlowGlobal; + #endif + + #if HSV_ON + half _HsvShift, _HsvSaturation, _HsvBright; + #endif + + #if DISTORT_ON + half4 _DistortTex_ST; + half _DistortTexXSpeed, _DistortTexYSpeed, _DistortAmount; + #endif + + #if FADE_ON + half4 _FadeBurnColor, _FadeTex_ST, _FadeBurnTex_ST; + half _FadeAmount, _FadeBurnWidth, _FadeBurnTransition,_FadeBurnGlow; + #endif + + #if OUTBASE_ON + half4 _OutlineColor; + half _OutlineAlpha, _OutlineGlow, _OutlineWidth; + int _OutlinePixelWidth; + #endif + + #if OUTTEX_ON + half4 _OutlineTex_ST; + half _OutlineTexXSpeed, _OutlineTexYSpeed; + #endif + + #if OUTDIST_ON + half4 _OutlineDistortTex_ST; + half _OutlineDistortTexXSpeed, _OutlineDistortTexYSpeed, _OutlineDistortAmount; + #endif + + #if ALPHAOUTLINE_ON + half _AlphaOutlineGlow, _AlphaOutlinePower, _AlphaOutlineMinAlpha, _AlphaOutlineBlend; + half4 _AlphaOutlineColor; + #endif + + #if INNEROUTLINE_ON + half _InnerOutlineThickness, _InnerOutlineAlpha, _InnerOutlineGlow; + half4 _InnerOutlineColor; + #endif + + #if GRADIENT_ON + half _GradBlend, _GradBoostX, _GradBoostY; + half4 _GradTopRightCol, _GradTopLeftCol, _GradBotRightCol, _GradBotLeftCol; + #endif + + #if COLORSWAP_ON + half4 _ColorSwapRed, _ColorSwapGreen, _ColorSwapBlue; + half _ColorSwapRedLuminosity, _ColorSwapGreenLuminosity, _ColorSwapBlueLuminosity, _ColorSwapBlend; + #endif + + #if CHANGECOLOR_ON + half4 _ColorChangeNewCol, _ColorChangeTarget; + half _ColorChangeTolerance, _ColorChangeLuminosity; + #endif + #if CHANGECOLOR2_ON + half4 _ColorChangeNewCol2, _ColorChangeTarget2; + half _ColorChangeTolerance2; + #endif + #if CHANGECOLOR3_ON + half4 _ColorChangeNewCol3, _ColorChangeTarget3; + half _ColorChangeTolerance3; + #endif + + #if COLORRAMP_ON + half _ColorRampLuminosity, _ColorRampBlend; + #endif + + #if HITEFFECT_ON + half4 _HitEffectColor; + half _HitEffectGlow, _HitEffectBlend; + #endif + + #if NEGATIVE_ON + half _NegativeAmount; + #endif + + #if PIXELATE_ON + half _PixelateSize; + #endif + + #if GREYSCALE_ON + half _GreyscaleLuminosity, _GreyscaleBlend; + half4 _GreyscaleTintColor; + #endif + + #if POSTERIZE_ON + half _PosterizeNumColors, _PosterizeGamma; + #endif + + #if BLUR_ON + half _BlurIntensity; + #endif + + #if MOTIONBLUR_ON + half _MotionBlurAngle, _MotionBlurDist; + #endif + + #if GHOST_ON + half _GhostColorBoost, _GhostTransparency, _GhostBlend; + #endif + + #if HOLOGRAM_ON + half _HologramStripesAmount, _HologramMinAlpha, _HologramUnmodAmount, _HologramStripesSpeed, _HologramMaxAlpha, _HologramBlend; + half4 _HologramStripeColor; + #endif + + #if CHROMABERR_ON + half _ChromAberrAmount, _ChromAberrAlpha; + #endif + + #if GLITCH_ON + half _GlitchAmount, _GlitchSize; + #endif + + #if FLICKER_ON + half _FlickerFreq, _FlickerPercent, _FlickerAlpha; + #endif + + #if SHADOW_ON + half _ShadowX, _ShadowY, _ShadowAlpha; + half4 _ShadowColor; + #endif + + #if SHINE_ON + half4 _ShineColor; + half _ShineLocation, _ShineRotate, _ShineWidth, _ShineGlow; + #endif + + #if CONTRAST_ON + half _Contrast, _Brightness; + #endif + + #if OVERLAY_ON + half4 _OverlayTex_ST, _OverlayColor; + half _OverlayGlow, _OverlayBlend, _OverlayTextureScrollXSpeed, _OverlayTextureScrollYSpeed; + #endif + + #if DOODLE_ON + half _HandDrawnAmount, _HandDrawnSpeed; + #endif + + #if WIND_ON + half _GrassSpeed, _GrassWind, _GrassManualAnim, _GrassRadialBend; + #endif + + #if WAVEUV_ON + float _WaveAmount, _WaveSpeed, _WaveStrength, _WaveX, _WaveY; + #endif + + #if ROUNDWAVEUV_ON + half _RoundWaveStrength, _RoundWaveSpeed; + #endif + + #if RECTSIZE_ON + half _RectSize; + #endif + + #if OFFSETUV_ON + half _OffsetUvX, _OffsetUvY; + #endif + + #if CLIPPING_ON + half _ClipUvLeft, _ClipUvRight, _ClipUvUp, _ClipUvDown; + #endif + + #if RADIALCLIPPING_ON + half _RadialStartAngle, _RadialClip, _RadialClip2; + #endif + + #if TEXTURESCROLL_ON + half _TextureScrollXSpeed, _TextureScrollYSpeed; + #endif + + #if ZOOMUV_ON + half _ZoomUvAmount; + #endif + + #if WARP_ON + half _WarpStrength, _WarpSpeed, _WarpScale; + #endif + + #if TWISTUV_ON + half _TwistUvAmount, _TwistUvPosX, _TwistUvPosY, _TwistUvRadius; + #endif + + #if ROTATEUV_ON + half _RotateUvAmount; + #endif + + #if FISHEYE_ON + half _FishEyeUvAmount; + #endif + + #if PINCH_ON + half _PinchUvAmount; + #endif + + #if SHAKEUV_ON + half _ShakeUvSpeed, _ShakeUvX, _ShakeUvY; + #endif + + #if NORMALMAP_ON + half _NormalStrength; + #endif + + float _RandomSeed; + + + + + CBUFFER_END + + + + // -- Property used by ScenePickingPass + #ifdef SCENEPICKINGPASS + float4 _SelectionID; + #endif + + // -- Properties used by SceneSelectionPass + #ifdef SCENESELECTIONPASS + int _ObjectId; + int _PassValue; + #endif + + + // data across stages, stripped like the above. + struct VertexToPixel + { + float4 pos : SV_POSITION; + float3 worldPos : TEXCOORD0; + float3 worldNormal : TEXCOORD1; + float4 worldTangent : TEXCOORD2; + float4 texcoord0 : TEXCOORD3; + float4 texcoord1 : TEXCOORD4; + float4 texcoord2 : TEXCOORD5; + // #if %TEXCOORD3REQUIREKEY% + float4 texcoord3 : TEXCOORD6; + // #endif + + // #if %SCREENPOSREQUIREKEY% + // float4 screenPos : TEXCOORD7; + // #endif + + // #if %VERTEXCOLORREQUIREKEY% + float4 vertexColor : COLOR; + // #endif + + // #if %EXTRAV2F0REQUIREKEY% + // float4 extraV2F0 : TEXCOORD8; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // float4 extraV2F1 : TEXCOORD9; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // float4 extraV2F2 : TEXCOORD10; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // float4 extraV2F3 : TEXCOORD11; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // float4 extraV2F4 : TEXCOORD12; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // float4 extraV2F5 : TEXCOORD13; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // float4 extraV2F6 : TEXCOORD14; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // float4 extraV2F7 : TEXCOORD15; + // #endif + + #if UNITY_ANY_INSTANCING_ENABLED + UNITY_VERTEX_INPUT_INSTANCE_ID + #endif // UNITY_ANY_INSTANCING_ENABLED + + #if _HDRP && (_PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR))) + float4 previousPositionCS : TEXCOORD16; // Contain previous transform position (in case of skinning for example) + float4 motionVectorCS : TEXCOORD17; + #endif + + UNITY_VERTEX_OUTPUT_STEREO + }; + + + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Debug/DebugDisplay.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/Material.hlsl" + #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/NormalSurfaceGradient.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/Lit/Lit.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/BuiltinUtilities.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/MaterialUtilities.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/Decal/DecalUtilities.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/Lit/LitDecalData.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/ShaderGraphFunctions.hlsl" + + + + + + // data describing the user output of a pixel + struct Surface + { + half3 Albedo; + half Height; + half3 Normal; + half Smoothness; + half3 Emission; + half Metallic; + half3 Specular; + half Occlusion; + half SpecularPower; // for simple lighting + half Alpha; + float outputDepth; // if written, SV_Depth semantic is used. ShaderData.clipPos.z is unused value + // HDRP Only + half SpecularOcclusion; + half SubsurfaceMask; + half Thickness; + half CoatMask; + half CoatSmoothness; + half Anisotropy; + half IridescenceMask; + half IridescenceThickness; + int DiffusionProfileHash; + float SpecularAAThreshold; + float SpecularAAScreenSpaceVariance; + // requires _OVERRIDE_BAKEDGI to be defined, but is mapped in all pipelines + float3 DiffuseGI; + float3 BackDiffuseGI; + float3 SpecularGI; + float ior; + float3 transmittanceColor; + float atDistance; + float transmittanceMask; + // requires _OVERRIDE_SHADOWMASK to be defines + float4 ShadowMask; + + // for decals + float NormalAlpha; + float MAOSAlpha; + + + }; + + // Data the user declares in blackboard blocks + struct Blackboard + { + + float blackboardDummyData; + }; + + // data the user might need, this will grow to be big. But easy to strip + struct ShaderData + { + float4 clipPos; // SV_POSITION + float3 localSpacePosition; + float3 localSpaceNormal; + float3 localSpaceTangent; + + float3 worldSpacePosition; + float3 worldSpaceNormal; + float3 worldSpaceTangent; + float tangentSign; + + float3 worldSpaceViewDir; + float3 tangentSpaceViewDir; + + float4 texcoord0; + float4 texcoord1; + float4 texcoord2; + float4 texcoord3; + + float2 screenUV; + float4 screenPos; + + float4 vertexColor; + bool isFrontFace; + + float4 extraV2F0; + float4 extraV2F1; + float4 extraV2F2; + float4 extraV2F3; + float4 extraV2F4; + float4 extraV2F5; + float4 extraV2F6; + float4 extraV2F7; + + float3x3 TBNMatrix; + Blackboard blackboard; + }; + + struct VertexData + { + #if SHADER_TARGET > 30 + // uint vertexID : SV_VertexID; + #endif + float4 vertex : POSITION; + float3 normal : NORMAL; + float4 tangent : TANGENT; + float4 texcoord0 : TEXCOORD0; + + // optimize out mesh coords when not in use by user or lighting system + #if _URP && (_USINGTEXCOORD1 || _PASSMETA || _PASSFORWARD || _PASSGBUFFER) + float4 texcoord1 : TEXCOORD1; + #endif + + #if _URP && (_USINGTEXCOORD2 || _PASSMETA || ((_PASSFORWARD || _PASSGBUFFER) && defined(DYNAMICLIGHTMAP_ON))) + float4 texcoord2 : TEXCOORD2; + #endif + + #if _STANDARD && (_USINGTEXCOORD1 || (_PASSMETA || ((_PASSFORWARD || _PASSGBUFFER || _PASSFORWARDADD) && LIGHTMAP_ON))) + float4 texcoord1 : TEXCOORD1; + #endif + #if _STANDARD && (_USINGTEXCOORD2 || (_PASSMETA || ((_PASSFORWARD || _PASSGBUFFER) && DYNAMICLIGHTMAP_ON))) + float4 texcoord2 : TEXCOORD2; + #endif + + + #if _HDRP + float4 texcoord1 : TEXCOORD1; + float4 texcoord2 : TEXCOORD2; + #endif + + // #if %TEXCOORD3REQUIREKEY% + float4 texcoord3 : TEXCOORD3; + // #endif + + // #if %VERTEXCOLORREQUIREKEY% + float4 vertexColor : COLOR; + // #endif + + #if _PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR)) + float3 previousPositionOS : TEXCOORD4; // Contain previous transform position (in case of skinning for example) + #if defined (_ADD_PRECOMPUTED_VELOCITY) + float3 precomputedVelocity : TEXCOORD5; // Add Precomputed Velocity (Alembic computes velocities on runtime side). + #endif + #endif + + UNITY_VERTEX_INPUT_INSTANCE_ID + }; + + struct TessVertex + { + float4 vertex : INTERNALTESSPOS; + float3 normal : NORMAL; + float4 tangent : TANGENT; + float4 texcoord0 : TEXCOORD0; + float4 texcoord1 : TEXCOORD1; + float4 texcoord2 : TEXCOORD2; + + // #if %TEXCOORD3REQUIREKEY% + float4 texcoord3 : TEXCOORD3; + // #endif + + // #if %VERTEXCOLORREQUIREKEY% + float4 vertexColor : COLOR; + // #endif + + // #if %EXTRAV2F0REQUIREKEY% + // float4 extraV2F0 : TEXCOORD5; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // float4 extraV2F1 : TEXCOORD6; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // float4 extraV2F2 : TEXCOORD7; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // float4 extraV2F3 : TEXCOORD8; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // float4 extraV2F4 : TEXCOORD9; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // float4 extraV2F5 : TEXCOORD10; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // float4 extraV2F6 : TEXCOORD11; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // float4 extraV2F7 : TEXCOORD12; + // #endif + + #if _PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR)) + float3 previousPositionOS : TEXCOORD13; // Contain previous transform position (in case of skinning for example) + #if defined (_ADD_PRECOMPUTED_VELOCITY) + float3 precomputedVelocity : TEXCOORD14; + #endif + #endif + + UNITY_VERTEX_INPUT_INSTANCE_ID + UNITY_VERTEX_OUTPUT_STEREO + }; + + struct ExtraV2F + { + float4 extraV2F0; + float4 extraV2F1; + float4 extraV2F2; + float4 extraV2F3; + float4 extraV2F4; + float4 extraV2F5; + float4 extraV2F6; + float4 extraV2F7; + Blackboard blackboard; + float4 time; + }; + + + float3 WorldToTangentSpace(ShaderData d, float3 normal) + { + return mul(d.TBNMatrix, normal); + } + + float3 TangentToWorldSpace(ShaderData d, float3 normal) + { + return mul(normal, d.TBNMatrix); + } + + // in this case, make standard more like SRPs, because we can't fix + // unity_WorldToObject in HDRP, since it already does macro-fu there + + #if _STANDARD + float3 TransformWorldToObject(float3 p) { return mul(unity_WorldToObject, float4(p, 1)); }; + float3 TransformObjectToWorld(float3 p) { return mul(unity_ObjectToWorld, float4(p, 1)); }; + float4 TransformWorldToObject(float4 p) { return mul(unity_WorldToObject, p); }; + float4 TransformObjectToWorld(float4 p) { return mul(unity_ObjectToWorld, p); }; + float4x4 GetWorldToObjectMatrix() { return unity_WorldToObject; } + float4x4 GetObjectToWorldMatrix() { return unity_ObjectToWorld; } + #if (defined(SHADER_API_D3D11) || defined(SHADER_API_XBOXONE) || defined(UNITY_COMPILER_HLSLCC) || defined(SHADER_API_PSSL) || (SHADER_TARGET_SURFACE_ANALYSIS && !SHADER_TARGET_SURFACE_ANALYSIS_MOJOSHADER)) + #define UNITY_SAMPLE_TEX2D_LOD(tex,coord, lod) tex.SampleLevel (sampler##tex,coord, lod) + #define UNITY_SAMPLE_TEX2D_SAMPLER_LOD(tex,samplertex,coord, lod) tex.SampleLevel (sampler##samplertex,coord, lod) + #else + #define UNITY_SAMPLE_TEX2D_LOD(tex,coord,lod) tex2D (tex,coord,0,lod) + #define UNITY_SAMPLE_TEX2D_SAMPLER_LOD(tex,samplertex,coord,lod) tex2D (tex,coord,0,lod) + #endif + + #undef GetWorldToObjectMatrix() + + #define GetWorldToObjectMatrix() unity_WorldToObject + + + #endif + + float3 GetCameraWorldPosition() + { + #if _HDRP + return GetCameraRelativePositionWS(_WorldSpaceCameraPos); + #else + return _WorldSpaceCameraPos; + #endif + } + + #if _GRABPASSUSED + #if _STANDARD + TEXTURE2D(%GRABTEXTURE%); + SAMPLER(sampler_%GRABTEXTURE%); + #endif + + half3 GetSceneColor(float2 uv) + { + #if _STANDARD + return SAMPLE_TEXTURE2D(%GRABTEXTURE%, sampler_%GRABTEXTURE%, uv).rgb; + #else + return SHADERGRAPH_SAMPLE_SCENE_COLOR(uv); + #endif + } + #endif + + + + #if _STANDARD + UNITY_DECLARE_DEPTH_TEXTURE(_CameraDepthTexture); + float GetSceneDepth(float2 uv) { return SAMPLE_DEPTH_TEXTURE(_CameraDepthTexture, uv); } + float GetLinear01Depth(float2 uv) { return Linear01Depth(GetSceneDepth(uv)); } + float GetLinearEyeDepth(float2 uv) { return LinearEyeDepth(GetSceneDepth(uv)); } + #else + float GetSceneDepth(float2 uv) { return SHADERGRAPH_SAMPLE_SCENE_DEPTH(uv); } + float GetLinear01Depth(float2 uv) { return Linear01Depth(GetSceneDepth(uv), _ZBufferParams); } + float GetLinearEyeDepth(float2 uv) { return LinearEyeDepth(GetSceneDepth(uv), _ZBufferParams); } + #endif + + float3 GetWorldPositionFromDepthBuffer(float2 uv, float3 worldSpaceViewDir) + { + float eye = GetLinearEyeDepth(uv); + float3 camView = mul((float3x3)GetObjectToWorldMatrix(), transpose(mul(GetWorldToObjectMatrix(), UNITY_MATRIX_I_V)) [2].xyz); + + float dt = dot(worldSpaceViewDir, camView); + float3 div = worldSpaceViewDir/dt; + float3 wpos = (eye * div) + GetCameraWorldPosition(); + return wpos; + } + + #if _HDRP + float3 ObjectToWorldSpacePosition(float3 pos) + { + return GetAbsolutePositionWS(TransformObjectToWorld(pos)); + } + #else + float3 ObjectToWorldSpacePosition(float3 pos) + { + return TransformObjectToWorld(pos); + } + #endif + + #if _STANDARD + UNITY_DECLARE_SCREENSPACE_TEXTURE(_CameraDepthNormalsTexture); + float3 GetSceneNormal(float2 uv, float3 worldSpaceViewDir) + { + float4 depthNorms = UNITY_SAMPLE_SCREENSPACE_TEXTURE(_CameraDepthNormalsTexture, uv); + float3 norms = DecodeViewNormalStereo(depthNorms); + norms = mul((float3x3)GetWorldToViewMatrix(), norms) * 0.5 + 0.5; + return norms; + } + #elif _HDRP && !_DECALSHADER + + float3 GetSceneNormal(float2 uv, float3 worldSpaceViewDir) + { + NormalData nd; + DecodeFromNormalBuffer(_ScreenSize.xy * uv, nd); + return nd.normalWS; + } + #elif _URP + #if (SHADER_LIBRARY_VERSION_MAJOR >= 10) + #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/DeclareNormalsTexture.hlsl" + #endif + + float3 GetSceneNormal(float2 uv, float3 worldSpaceViewDir) + { + #if (SHADER_LIBRARY_VERSION_MAJOR >= 10) + return SampleSceneNormals(uv); + #else + float3 wpos = GetWorldPositionFromDepthBuffer(uv, worldSpaceViewDir); + return normalize(-cross(ddx(wpos), ddy(wpos))) * 0.5 + 0.5; + #endif + + } + #endif + + #if _HDRP + + half3 UnpackNormalmapRGorAG(half4 packednormal) + { + // This do the trick + packednormal.x *= packednormal.w; + + half3 normal; + normal.xy = packednormal.xy * 2 - 1; + normal.z = sqrt(1 - saturate(dot(normal.xy, normal.xy))); + return normal; + } + half3 UnpackNormal(half4 packednormal) + { + #if defined(UNITY_NO_DXT5nm) + return packednormal.xyz * 2 - 1; + #else + return UnpackNormalmapRGorAG(packednormal); + #endif + } + #endif + #if _HDRP || _URP + + half3 UnpackScaleNormal(half4 packednormal, half scale) + { + #ifndef UNITY_NO_DXT5nm + // Unpack normal as DXT5nm (1, y, 1, x) or BC5 (x, y, 0, 1) + // Note neutral texture like "bump" is (0, 0, 1, 1) to work with both plain RGB normal and DXT5nm/BC5 + packednormal.x *= packednormal.w; + #endif + half3 normal; + normal.xy = (packednormal.xy * 2 - 1) * scale; + normal.z = sqrt(1 - saturate(dot(normal.xy, normal.xy))); + return normal; + } + + #endif + + + void GetSun(out float3 lightDir, out float3 color) + { + lightDir = float3(0.5, 0.5, 0); + color = 1; + #if _HDRP + if (_DirectionalLightCount > 0) + { + DirectionalLightData light = _DirectionalLightDatas[0]; + lightDir = -light.forward.xyz; + color = light.color; + } + #elif _STANDARD + lightDir = normalize(_WorldSpaceLightPos0.xyz); + color = _LightColor0.rgb; + #elif _URP + Light light = GetMainLight(); + lightDir = light.direction; + color = light.color; + #endif + } + + + + + + + + + + + TEXTURE2D(_MainTex); + SAMPLER(sampler_MainTex); + + #if GLOW_ON + TEXTURE2D(_GlowTex); + SAMPLER(sampler_GlowTex); + #endif + + #if FADE_ON + TEXTURE2D(_FadeTex); + SAMPLER(sampler_FadeTex); + + TEXTURE2D(_FadeBurnTex); + SAMPLER(sampler_FadeBurnTex); + #endif + + #if DISTORT_ON + TEXTURE2D(_DistortTex); + SAMPLER(sampler_DistortTex); + #endif + + #if OUTTEX_ON + TEXTURE2D(_OutlineTex); + SAMPLER(sampler_OutlineTex); + #endif + + #if OUTDIST_ON + TEXTURE2D(_OutlineDistortTex); + SAMPLER(sampler_OutlineDistortTex); + #endif + + #if COLORSWAP_ON + TEXTURE2D(_ColorSwapTex); + SAMPLER(sampler_ColorSwapTex); + #endif + + #if COLORRAMP_ON + TEXTURE2D(_ColorRampTex); + TEXTURE2D(_ColorRampTexGradient); + SAMPLER(sampler_ColorRampTex); + SAMPLER(sampler_ColorRampTexGradient); + #endif + + #if SHINE_ON + TEXTURE2D(_ShineMask); + SAMPLER(sampler_ShineMask); + #endif + + #if OVERLAY_ON + TEXTURE2D(_OverlayTex); + SAMPLER(sampler_OverlayTex); + #endif + + #if NORMALMAP_ON + TEXTURE2D(_NormalMap); + SAMPLER(sampler_NormalMap); + #endif + + + half3 GetPixel(in int offsetX, in int offsetY, in half2 uv, in Texture2D _tex, in SamplerState _sampler) + { + half2 _uv = uv + half2(offsetX * _MainTex_TexelSize.x, offsetY * _MainTex_TexelSize.y); + half4 col = SAMPLE_TEXTURE2D(_tex, _sampler, _uv); + return col.rgb; + } + + + //BLURS------------------------------------------------------------------------- + half4 Blur(half2 uv, Texture2D source, SamplerState sampler_source, half Intensity) + { + const half2 texelSize = 1.0 / _ScreenParams.xy; + const half4 color = SAMPLE_TEXTURE2D(source, sampler_source, uv); + const half2 offset = Intensity * texelSize; + + half4 accumulatedColor = color; + half accumulatedWeight = 1.0; + for (int x = -1; x <= 1; x++) + { + for (int y = -1; y <= 1; y++) + { + const half2 sampleUV = uv + half2(x, y) * offset; + const half4 sampleColor = SAMPLE_TEXTURE2D(source, sampler_source, sampleUV); + + accumulatedColor += sampleColor; + accumulatedWeight += 1.0; + } + } + + half4 blurredColor = accumulatedColor / accumulatedWeight; + return blurredColor; + } + + half BlurHD_G(half bhqp, half x) + { + return exp(-(x * x) / (2.0 * bhqp * bhqp)); + } + half4 BlurHD(half2 uv, Texture2D source, SamplerState sampler_source, half BlurAmount, half xScale, half yScale) + { + int iterations = 16; + int halfIterations = iterations / 2; + half sigmaX = 0.1 + BlurAmount * 0.5; + half sigmaY = sigmaX; + half total = 0.0; + half4 ret = half4(0, 0, 0, 0); + for (int iy = 0; iy < iterations; ++iy) + { + half fy = BlurHD_G(sigmaY, half(iy) -half(halfIterations)); + half offsetY = half(iy - halfIterations) * 0.00390625 * xScale; + for (int ix = 0; ix < iterations; ++ix) + { + half fx = BlurHD_G(sigmaX, half(ix) - half(halfIterations)); + half offsetX = half(ix - halfIterations) * 0.00390625 * yScale; + total += fx * fy; + ret += SAMPLE_TEXTURE2D(source, sampler_source, uv + half2(offsetX, offsetY)) * fx * fy; + } + } + return ret / total; + } + //----------------------------------------------------------------------- + + + //------------------------------------------- + half RemapFloat(half inValue, half inMin, half inMax, half outMin, half outMax){ + return outMin + (inValue - inMin) * (outMax - outMin) / (inMax - inMin); + } + //------------------------------------------- + + //----------------------------------------------------------------------- + half rand(half2 seed, half offset) { + return (frac(sin(dot(seed, half2(12.9898, 78.233))) * 43758.5453) + offset) % 1.0; + } + + half rand2(half2 seed, half offset) { + return (frac(sin(dot(seed * floor(50 + (_Time.x % 1.0) * 12.), half2(127.1, 311.7))) * 43758.5453123) + offset) % 1.0; + } + + half rand2CustomTime(half2 seed, half offset, half customTime) { + return (frac(sin(dot(seed * floor(50 + (customTime % 1.0) * 12.), half2(127.1, 311.7))) * 43758.5453123) + offset) % 1.0; + } + //----------------------------------------------------------------------- + + + void Ext_ModifyVertex0 (inout VertexData v, inout ExtraV2F d) + { + //BILBOARD_ON + #if BILBOARD_ON + half3 camRight = mul((half3x3)unity_CameraToWorld, half3(1,0,0)); + half3 camUp = half3(0,1,0); + #if BILBOARDY_ON + camUp = mul((half3x3)unity_CameraToWorld, half3(0,1,0)); + #endif + half3 localPos = v.vertex.x * camRight + v.vertex.y * camUp; + v.vertex = half4(localPos, 1); + #endif + //----------------------------------------------------------- + + v.texcoord0.xy = TRANSFORM_TEX(v.texcoord0.xy, _MainTex); + half2 center = half2(0.5, 0.5); + #if ATLAS_ON + center = half2((_MaxXUV + _MinXUV) / 2.0, (_MaxYUV + _MinYUV) / 2.0); + #endif + + //POLARUV_ON + #if POLARUV_ON + v.texcoord0.xy = v.texcoord0.xy - center; + #endif + + //---------------------------------------- + + //ROTATEUV_ON + #if ROTATEUV_ON + half2 uvC = v.texcoord0.xy; + half cosAngle = cos(_RotateUvAmount); + half sinAngle = sin(_RotateUvAmount); + half2x2 rot = half2x2(cosAngle, -sinAngle, sinAngle, cosAngle); + uvC -= center; + v.texcoord0.xy = mul(rot, uvC); + v.texcoord0.xy += center; + #endif + //-------------------- + + #if RECTSIZE_ON + v.vertex.xyz += (v.vertex.xyz * (_RectSize - 1.0)); + #endif + + #if OUTTEX_ON + v.texcoord1.xy = TRANSFORM_TEX(v.texcoord0.xy, _OutlineTex); + #endif + + #if OUTDIST_ON + v.texcoord2.xy = TRANSFORM_TEX(v.texcoord0.xy, _OutlineDistortTex); + #endif + + #if DISTORT_ON + v.texcoord3.xy = TRANSFORM_TEX(v.texcoord0.xy, _DistortTex); + #endif + } + + void Ext_SurfaceFunction0 (inout Surface o, ShaderData d) + { + half randomSeed = _RandomSeed; + + float2 uvRect = d.texcoord0; + half2 center = half2(0.5, 0.5); + #if ATLAS_ON + center = half2((_MaxXUV + _MinXUV) / 2.0, (_MaxYUV + _MinYUV) / 2.0); + uvRect = half2((d.texcoord0.x - _MinXUV) / (_MaxXUV - _MinXUV), (d.texcoord0.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half2 centerTiled = half2(center.x * _MainTex_ST.x, center.y * _MainTex_ST.y); + + //CLIPPING_ON + #if CLIPPING_ON + half2 tiledUv = half2(d.texcoord0.x / _MainTex_ST.x, d.texcoord0.y / _MainTex_ST.y); + #if ATLAS_ON + tiledUv = half2((tiledUv.x - _MinXUV) / (_MaxXUV - _MinXUV), (tiledUv.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + clip((1 - _ClipUvUp) - tiledUv.y); + clip(tiledUv.y - _ClipUvDown); + clip((1 - _ClipUvRight) - tiledUv.x); + clip(tiledUv.x - _ClipUvLeft); + #endif + //---------------------------------- + + //RADIALCLIPPING_ON + #if RADIALCLIPPING_ON + half2 tiledUv2 = half2(d.texcoord0.x / _MainTex_ST.x, d.texcoord0.y / _MainTex_ST.y); + #if ATLAS_ON + tiledUv2 = half2((tiledUv2.x - _MinXUV) / (_MaxXUV - _MinXUV), (tiledUv2.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half startAngle = _RadialStartAngle - _RadialClip; + half endAngle = _RadialStartAngle + _RadialClip2; + half offset0 = clamp(0, 360, startAngle + 360); + half offset360 = clamp(0, 360, endAngle - 360); + half2 atan2Coord = half2(lerp(-1, 1, tiledUv2.x), lerp(-1, 1, tiledUv2.y)); + half atanAngle = atan2(atan2Coord.y, atan2Coord.x) * 57.3; // angle in degrees + if(atanAngle < 0) atanAngle = 360 + atanAngle; + if(atanAngle >= startAngle && atanAngle <= endAngle) discard; + if(atanAngle <= offset360) discard; + if(atanAngle >= offset0) discard; + #endif + + //----------------------------- + + //TEXTURESCROLL_ON && ATLAS_ON + #if TEXTURESCROLL_ON && ATLAS_ON + d.texcoord0.xy = half2(_MinXUV + ((_MaxXUV - _MinXUV) * (abs(((_Time.y + randomSeed) * _TextureScrollXSpeed) + uvRect.x) % 1)), + _MinYUV + ((_MaxYUV - _MinYUV) * (abs(((_Time.y + randomSeed) * _TextureScrollYSpeed) + uvRect.y) % 1))); + #endif + //---------------------------- + + //OFFSETUV_ON + #if OFFSETUV_ON + #if ATLAS_ON + d.texcoord0.xy = half2(_MinXUV + ((_MaxXUV - _MinXUV) * (abs((_OffsetUvX + uvRect.x) % 1))), + _MinYUV + ((_MaxYUV - _MinYUV) * (abs(_OffsetUvY + uvRect.y) % 1))); + #else + d.texcoord0.xy += half2(_OffsetUvX, _OffsetUvY); + #endif + #endif + + //---------------------- + + //POLARUV_ON + #if POLARUV_ON + d.texcoord0.xy = half2(atan2(d.texcoord0.y, d.texcoord0.x) / (2.0f * 3.141592653589f), length(d.texcoord0.xy)); + d.texcoord0.xy *= _MainTex_ST.xy; + #endif + + //-------------------------------------- + + //TWISTUV_ON + #if TWISTUV_ON + #if ATLAS_ON + _TwistUvPosX = ((_MaxXUV - _MinXUV) * _TwistUvPosX) + _MinXUV; + _TwistUvPosY = ((_MaxYUV - _MinYUV) * _TwistUvPosY) + _MinYUV; + #endif + half2 tempUv = d.texcoord0.xy - half2(_TwistUvPosX * _MainTex_ST.x, _TwistUvPosY * _MainTex_ST.y); + _TwistUvRadius *= (_MainTex_ST.x + _MainTex_ST.y) / 2; + half percent = (_TwistUvRadius - length(tempUv)) / _TwistUvRadius; + half theta = percent * percent * (2.0 * sin(_TwistUvAmount)) * 8.0; + half s = sin(theta); + half c = cos(theta); + half beta = max(sign(_TwistUvRadius - length(tempUv)), 0.0); + tempUv = half2(dot(tempUv, half2(c, -s)), dot(tempUv, half2(s, c))) * beta + tempUv * (1 - beta); + tempUv += half2(_TwistUvPosX * _MainTex_ST.x, _TwistUvPosY * _MainTex_ST.y); + d.texcoord0.xy = tempUv; + #endif + + //-------------------------------------------- + + //FISHEYE_ON + #if FISHEYE_ON + half bind = length(centerTiled); + half2 dF = d.texcoord0.xy - centerTiled; + half dFlen = length(dF); + half fishInt = (3.14159265359 / bind) * (_FishEyeUvAmount + 0.001); + d.texcoord0.xy = centerTiled + (dF / (max(0.0001, dFlen))) * tan(dFlen * fishInt) * bind / tan(bind * fishInt); + #endif + //--------------------------------------------- + + //PINCH_ON + #if PINCH_ON + half2 dP = d.texcoord0.xy - centerTiled; + half pinchInt = (3.141592 / length(centerTiled)) * (-_PinchUvAmount + 0.001); + d.texcoord0.xy = centerTiled + normalize(dP) * atan(length(dP) * -pinchInt * 10.0) * 0.5 / atan(-pinchInt * 5); + #endif + + //--------------------------------------------- + + //ZOOMUV_ON + #if ZOOMUV_ON + d.texcoord0.xy -= centerTiled; + d.texcoord0.xy = d.texcoord0.xy * _ZoomUvAmount; + d.texcoord0.xy += centerTiled; + #endif + + //----------------------------------------------- + + //DOODLE_ON + #if DOODLE_ON + half2 uvCopy = uvRect; + _HandDrawnSpeed = (floor((_Time.x + randomSeed) * 20 * _HandDrawnSpeed) / _HandDrawnSpeed) * _HandDrawnSpeed; + uvCopy.x = sin((uvCopy.x * _HandDrawnAmount + _HandDrawnSpeed) * 4); + uvCopy.y = cos((uvCopy.y * _HandDrawnAmount + _HandDrawnSpeed) * 4); + d.texcoord0.xy = lerp(d.texcoord0.xy, d.texcoord0.xy + uvCopy, 0.0005 * _HandDrawnAmount); + #endif + + //-------------------------- + + //SHAKEUV_ON + #if SHAKEUV_ON + half xShake = sin((_Time.x + randomSeed) * _ShakeUvSpeed * 50) * _ShakeUvX; + half yShake = cos((_Time.x + randomSeed) * _ShakeUvSpeed * 50) * _ShakeUvY; + d.texcoord0.xy += half2(xShake * 0.012, yShake * 0.01); + #endif + + //------------------------------------------- + + //RECTSIZE_ON + #if RECTSIZE_ON + d.texcoord0.xy = d.texcoord0.xy * (_RectSize).xx + (((-_RectSize * 0.5) + 0.5)).xx; + #endif + + //------------------------------------------- + + //DISTORT_ON + #if DISTORT_ON + #if ATLAS_ON + d.texcoord3.x = d.texcoord3.x * (1 / (_MaxXUV - _MinXUV)); + d.texcoord3.y = d.texcoord3.y * (1 / (_MaxYUV - _MinYUV)); + #endif + + d.texcoord3.x += ((_Time.x + _RandomSeed) * _DistortTexXSpeed) % 1; + d.texcoord3.y += ((_Time.x + _RandomSeed) * _DistortTexYSpeed) % 1; + half distortAmnt = (SAMPLE_TEXTURE2D(_DistortTex, sampler_DistortTex, d.texcoord3.xy).r - 0.5) * 0.2 * _DistortAmount; + d.texcoord0.x += distortAmnt; + d.texcoord0.y += distortAmnt; + #endif + //------------------------------------------------------- + + //WARP_ON + #if WARP_ON + half2 warpUv = half2(d.texcoord0.x / _MainTex_ST.x, d.texcoord0.y / _MainTex_ST.y); + #if ATLAS_ON + warpUv = half2((warpUv.x - _MinXUV) / (_MaxXUV - _MinXUV), (warpUv.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + const float tau = 6.283185307179586; + float xWarp = (_Time.y + randomSeed) * _WarpSpeed + warpUv.x * tau / _WarpScale; + float yWarp = (_Time.y + randomSeed) * _WarpSpeed + warpUv.y * tau / _WarpScale; + float2 warp = float2(sin(xWarp), sin(yWarp)) * _WarpStrength; + d.texcoord0.xy += warp; + #endif + + //------------------------------------------------------- + + //WAVEUV_ON + #if WAVEUV_ON + float2 uvWave = half2(_WaveX * _MainTex_ST.x, _WaveY * _MainTex_ST.y) - d.texcoord0.xy; + uvWave %= 1; + #if ATLAS_ON + uvWave = half2(_WaveX, _WaveY) - uvRect; + #endif + uvWave.x *= _ScreenParams.x / _ScreenParams.y; + float waveTime = _Time.y + randomSeed; + float angWave = (sqrt(dot(uvWave, uvWave)) * _WaveAmount) - ((waveTime * _WaveSpeed)); + d.texcoord0.xy = d.texcoord0.xy + uvWave * sin(angWave) * (_WaveStrength / 1000.0); + #endif + //---------------------------------------------------- + + //ROUNDWAVEUV_ON + #if ROUNDWAVEUV_ON + half xWave = ((0.5 * _MainTex_ST.x) - uvRect.x); + half yWave = ((0.5 * _MainTex_ST.y) - uvRect.y) * (_MainTex_TexelSize.w / _MainTex_TexelSize.z); + half ripple = -sqrt(xWave*xWave + yWave* yWave); + d.texcoord0.xy += (sin((ripple + (_Time.y + randomSeed) * (_RoundWaveSpeed/10.0)) / 0.015) * (_RoundWaveStrength/10.0)) % 1; + #endif + //---------------------------------------------------- + + + //WIND_ON + #if WIND_ON + half windOffset = sin((_Time.x + randomSeed) * _GrassSpeed * 10); + half2 windCenter = half2(0.5, 0.1); + #if ATLAS_ON + windCenter.x = ((_MaxXUV - _MinXUV) * windCenter.x) + _MinXUV; + windCenter.y = ((_MaxYUV - _MinYUV) * windCenter.y) + _MinYUV; + #endif + #if !MANUALWIND_ON + d.texcoord0.x = fmod(abs(lerp(d.texcoord0.x, d.texcoord0.x + (_GrassWind * 0.01 * windOffset), uvRect.y)), 1); + #else + d.texcoord0.x = fmod(abs(lerp(d.texcoord0.x, d.texcoord0.x + (_GrassWind * 0.01 * _GrassManualAnim), uvRect.y)), 1); + windOffset = _GrassManualAnim; + #endif + half2 delta = d.texcoord0.xy - windCenter; + half delta2 = dot(delta.xy, delta.xy); + half2 delta_offset = delta2 * windOffset; + d.texcoord0.xy = d.texcoord0.xy + half2(delta.y, -delta.x) * delta_offset * _GrassRadialBend; + #endif + + //-------------------------------------------------------- + + //TEXTURESCROLL_ON && !ATLAS_ON + #if TEXTURESCROLL_ON && !ATLAS_ON + d.texcoord0.x += ((_Time.y + randomSeed) * _TextureScrollXSpeed) % 1; + d.texcoord0.y += ((_Time.y + randomSeed) * _TextureScrollYSpeed) % 1; + #endif + //------------------------------ + + //PIXELATE_ON + #if PIXELATE_ON + half aspectRatio = _MainTex_TexelSize.x / _MainTex_TexelSize.y; + half2 pixelSize = float2(_PixelateSize, _PixelateSize * aspectRatio); + d.texcoord0.xy = floor(d.texcoord0.xy * pixelSize) / pixelSize; + #endif + //-------------- + + half4 col = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy); + half originalAlpha = col.a; + col *= d.vertexColor; + + //NORMAL MAP + #if NORMALMAP_ON + half4 normalSample = SAMPLE_TEXTURE2D(_NormalMap, sampler_NormalMap, d.texcoord0.xy); + half3 normalTS = UnpackNormal(normalSample); + normalTS.xy *= _NormalStrength; + o.Normal = normalTS; + #endif + + + //GLITCH_ON + #if GLITCH_ON + half2 uvGlitch = uvRect; + uvGlitch.y -= 0.5; + half lineNoise = pow(rand2(floor(uvGlitch * half2(24., 19.) * _GlitchSize) * 4.0, randomSeed), 3.0) * _GlitchAmount + * pow(rand2(floor(uvGlitch * half2(38., 14.) * _GlitchSize) * 4.0, randomSeed), 3.0); + col = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(lineNoise * 0.02 * rand2(half2(2.0, 1), randomSeed), 0)) * d.vertexColor; + #endif + //-------------------------------------- + + //CHROMABERR_ON + #if CHROMABERR_ON + half4 r = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(_ChromAberrAmount/10, 0)) * d.vertexColor; + half4 b = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(-_ChromAberrAmount/10, 0)) * d.vertexColor; + col = half4(r.r * r.a, col.g, b.b * b.a, max(max(r.a, b.a) * _ChromAberrAlpha, col.a)); + #endif + + //-------------------------------- + + //BLUR_ON + #if BLUR_ON + #if ATLAS_ON + #if !BLURISHD_ON + col = BlurHD(d.texcoord0.xy, _MainTex, sampler_MainTex, _BlurIntensity, (_MaxXUV - _MinXUV), (_MaxYUV - _MinYUV)) * d.vertexColor; + #else + col = Blur(d.texcoord0.xy, _MainTex, sampler_MainTex, _BlurIntensity * (_MaxXUV - _MinXUV)) * d.vertexColor; + #endif + #else + #if !BLURISHD_ON + col = BlurHD(d.texcoord0.xy, _MainTex, sampler_MainTex, _BlurIntensity, 1, 1) * d.vertexColor; + #else + col = Blur(d.texcoord0.xy, _MainTex, sampler_MainTex, _BlurIntensity) * d.vertexColor; + #endif + #endif + #endif + + //-------------------- + + //MOTIONBLUR_ON + #if MOTIONBLUR_ON + _MotionBlurAngle = _MotionBlurAngle * 3.1415926; + #define rot(n) mul(n, half2x2(cos(_MotionBlurAngle), -sin(_MotionBlurAngle), sin(_MotionBlurAngle), cos(_MotionBlurAngle))) + _MotionBlurDist = _MotionBlurDist * 0.005; + #if ATLAS_ON + _MotionBlurDist *= (_MaxXUV - _MinXUV); + #endif + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(-_MotionBlurDist, -_MotionBlurDist))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(-_MotionBlurDist * 2, -_MotionBlurDist * 2))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(-_MotionBlurDist * 3, -_MotionBlurDist * 3))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(-_MotionBlurDist * 4, -_MotionBlurDist * 4))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(_MotionBlurDist, _MotionBlurDist))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(_MotionBlurDist * 2, _MotionBlurDist * 2))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(_MotionBlurDist * 3, _MotionBlurDist * 3))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(_MotionBlurDist * 4, _MotionBlurDist * 4))); + col.rgb = col.rgb / 9; + #endif + //------------------------------------ + + //NEGATIVE_ON + #if NEGATIVE_ON + col.rgb = lerp(col.rgb, 1 - col.rgb, _NegativeAmount); + #endif + + //-------------- + half luminance = 0; + + //GREYSCALE_ON && !GREYSCALEOUTLINE_ON + #if GREYSCALE_ON && !GREYSCALEOUTLINE_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + luminance = saturate(luminance + _GreyscaleLuminosity); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _GreyscaleTintColor, _GreyscaleBlend); + #endif + //------------------------------------ + + //GHOST_ON + #if GHOST_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + half4 ghostResult; + ghostResult.a = saturate(luminance - _GhostTransparency) * col.a; + ghostResult.rgb = col.rgb * (luminance + _GhostColorBoost); + col = lerp(col, ghostResult, _GhostBlend); + #endif + //------------------------------------ + + //INNEROUTLINE_ON + #if INNEROUTLINE_ON + half3 innerT = abs(GetPixel(0, _InnerOutlineThickness, d.texcoord0.xy, _MainTex, sampler_MainTex) - GetPixel(0, -_InnerOutlineThickness, d.texcoord0.xy, _MainTex, sampler_MainTex)); + innerT += abs(GetPixel(_InnerOutlineThickness, 0, d.texcoord0.xy, _MainTex, sampler_MainTex) - GetPixel(-_InnerOutlineThickness, 0, d.texcoord0.xy, _MainTex, sampler_MainTex)); + #if !ONLYINNEROUTLINE_ON + innerT = (innerT / 2.0) * col.a * _InnerOutlineAlpha; + col.rgb += length(innerT) * _InnerOutlineColor.rgb * _InnerOutlineGlow; + #else + innerT *= col.a * _InnerOutlineAlpha; + col.rgb = length(innerT) * _InnerOutlineColor.rgb * _InnerOutlineGlow; + col.a = step(0.3, col.r+col.g+col.b); + #endif + #endif + //------------------------------------------------------- + + //HITEFFECT_ON + #if HITEFFECT_ON + col.rgb = lerp(col.rgb, _HitEffectColor.rgb * _HitEffectGlow, _HitEffectBlend); + #endif + //-------------------- + + //GRADIENT_ON + #if GRADIENT_ON + half2 tiledUvGrad = half2(uvRect.x / _MainTex_ST.x, uvRect.y / _MainTex_ST.y); + #if GRADIENT2COL_ON + _GradTopRightCol = _GradTopLeftCol; + _GradBotRightCol = _GradBotLeftCol; + #endif + #if RADIALGRADIENT_ON + half radialDist = 1 - length(tiledUvGrad - half2(0.5, 0.5)); + radialDist *= (_MainTex_TexelSize.w / _MainTex_TexelSize.z); + radialDist = saturate(_GradBoostX * radialDist); + half4 gradientResult = lerp(_GradTopLeftCol, _GradBotLeftCol, radialDist); + #else + half gradXLerpFactor = saturate(pow(tiledUvGrad.x, _GradBoostX)); + half4 gradientResult = lerp(lerp(_GradBotLeftCol, _GradBotRightCol, gradXLerpFactor), + lerp(_GradTopLeftCol, _GradTopRightCol, gradXLerpFactor), saturate(pow(tiledUvGrad.y, _GradBoostY))); + #endif + gradientResult = lerp(col, gradientResult, _GradBlend); + col.rgb = gradientResult.rgb * col.a; + col.a *= gradientResult.a; + #endif + //-------------------------------------------------------------------- + + //CONTRAST_ON + #if CONTRAST_ON + col.rgb = (col.rgb - float3(0.5, 0.5, 0.5)) * _Contrast + float3(0.5, 0.5, 0.5); + col.rgb += _Brightness; + #endif + + //------------------------------------------------------------------- + + //COLORSWAP_ON + #if COLORSWAP_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + half4 swapMask = SAMPLE_TEXTURE2D(_ColorSwapTex, sampler_ColorSwapTex, d.texcoord0.xy); + swapMask.rgb *= swapMask.a; + half3 redSwap = _ColorSwapRed * swapMask.r * saturate(luminance + _ColorSwapRedLuminosity); + half3 greenSwap = _ColorSwapGreen * swapMask.g * saturate(luminance + _ColorSwapGreenLuminosity); + half3 blueSwap = _ColorSwapBlue * swapMask.b * saturate(luminance + _ColorSwapBlueLuminosity); + swapMask.rgb = col.rgb * saturate(1 - swapMask.r - swapMask.g - swapMask.b); + col.rgb = lerp(col.rgb, swapMask.rgb + redSwap + greenSwap + blueSwap, _ColorSwapBlend); + #endif + //-------------------------------------------------------------------- + + //COLORRAMP_ON && !COLORRAMPOUTLINE_ON + #if COLORRAMP_ON && !COLORRAMPOUTLINE_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + luminance = saturate(luminance + _ColorRampLuminosity); + #if GRADIENTCOLORRAMP_ON + col.rgb = lerp(col.rgb, SAMPLE_TEXTURE2D(_ColorRampTexGradient, sampler_ColorRampTexGradient, half2(luminance, 0)).rgb, _ColorRampBlend); + #else + col.rgb = lerp(col.rgb, SAMPLE_TEXTURE2D(_ColorRampTex, sampler_ColorRampTex, half2(luminance, 0)).rgb, _ColorRampBlend); + #endif + #endif + //-------------------------------------------------------------------- + + //CHANGECOLOR_ON + #if CHANGECOLOR_ON + float3 currChangeColor = saturate(col.rgb); + luminance = 0.3 * currChangeColor.r + 0.59 * currChangeColor.g + 0.11 * currChangeColor.b; + luminance = saturate(luminance + _ColorChangeLuminosity); + half3 dif = abs(currChangeColor - _ColorChangeTarget.rgb); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _ColorChangeNewCol.rgb, + max(sign(1 - saturate(dif.x + dif.y + dif.z) - _ColorChangeTolerance), 0.0)); + #if CHANGECOLOR2_ON + dif = abs(currChangeColor - _ColorChangeTarget2.rgb); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _ColorChangeNewCol2.rgb, + max(sign(1 - saturate(dif.x + dif.y + dif.z) - _ColorChangeTolerance2), 0.0)); + #endif + #if CHANGECOLOR3_ON + dif = abs(currChangeColor - _ColorChangeTarget3.rgb); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _ColorChangeNewCol3.rgb, + max(sign(1 - saturate(dif.x + dif.y + dif.z) - _ColorChangeTolerance3), 0.0)); + #endif + #endif + //------------------------------------------------------- + + //POSTERIZE_ON && !POSTERIZEOUTLINE_ON + #if POSTERIZE_ON && !POSTERIZEOUTLINE_ON + col.rgb = pow(col.rgb, _PosterizeGamma) * _PosterizeNumColors; + col.rgb = floor(col.rgb) / _PosterizeNumColors; + col.rgb = pow(col.rgb, 1.0 / _PosterizeGamma); + #endif + //------------------------------------ + + //HSV_ON + #if HSV_ON + half3 resultHsv = half3(col.rgb); + half cosHsv = _HsvBright * _HsvSaturation * cos(_HsvShift * 3.14159265 / 180); + half sinHsv = _HsvBright * _HsvSaturation * sin(_HsvShift * 3.14159265 / 180); + resultHsv.x = (.299 * _HsvBright + .701 * cosHsv + .168 * sinHsv) * col.x + + (.587 * _HsvBright - .587 * cosHsv + .330 * sinHsv) * col.y + + (.114 * _HsvBright - .114 * cosHsv - .497 * sinHsv) * col.z; + resultHsv.y = (.299 * _HsvBright - .299 * cosHsv - .328 * sinHsv) *col.x + + (.587 * _HsvBright + .413 * cosHsv + .035 * sinHsv) * col.y + + (.114 * _HsvBright - .114 * cosHsv + .292 * sinHsv) * col.z; + resultHsv.z = (.299 * _HsvBright - .3 * cosHsv + 1.25 * sinHsv) * col.x + + (.587 * _HsvBright - .588 * cosHsv - 1.05 * sinHsv) * col.y + + (.114 * _HsvBright + .886 * cosHsv - .203 * sinHsv) * col.z; + col.rgb = resultHsv; + #endif + //------------------------------------------------------- + + //OVERLAY_ON + #if OVERLAY_ON + half2 overlayUvs = d.texcoord0.xy; + overlayUvs.x += ((_Time.y + randomSeed) * _OverlayTextureScrollXSpeed) % 1; + overlayUvs.y += ((_Time.y + randomSeed) * _OverlayTextureScrollYSpeed) % 1; + half4 overlayCol = SAMPLE_TEXTURE2D(_OverlayTex, sampler_OverlayTex, TRANSFORM_TEX(overlayUvs, _OverlayTex)); + overlayCol.rgb *= _OverlayColor.rgb * _OverlayGlow; + #if !OVERLAYMULT_ON + overlayCol.rgb *= overlayCol.a * _OverlayColor.rgb * _OverlayColor.a * _OverlayBlend; + col.rgb += overlayCol.rgb; + #else + overlayCol.a *= _OverlayColor.a; + col = lerp(col, col * overlayCol, _OverlayBlend); + #endif + #endif + + //--------------------------------- + + //OUTBASE_ON + #if OUTBASE_ON + #if OUTBASEPIXELPERF_ON + half2 destUv = half2(_OutlinePixelWidth * _MainTex_TexelSize.x, _OutlinePixelWidth * _MainTex_TexelSize.y); + #else + half2 destUv = half2(_OutlineWidth * _MainTex_TexelSize.x * 200, _OutlineWidth * _MainTex_TexelSize.y * 200); + #endif + + #if OUTDIST_ON + d.texcoord3.x += ((_Time.x + _RandomSeed) * _OutlineDistortTexXSpeed) % 1; + d.texcoord3.y += ((_Time.x + _RandomSeed) * _OutlineDistortTexYSpeed) % 1; + #if ATLAS_ON + d.texcoord3 = half2((d.texcoord3.x - _MinXUV) / (_MaxXUV - _MinXUV), (d.texcoord3.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half outDistortAmnt = (SAMPLE_TEXTURE2D(_OutlineDistortTex, sampler_OutlineDistortTex, d.texcoord3).r - 0.5) * 0.2 * _OutlineDistortAmount; + destUv.x += outDistortAmnt; + destUv.y += outDistortAmnt; + #endif + + half spriteLeft = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(destUv.x, 0)).a; + half spriteRight = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy - half2(destUv.x, 0)).a; + half spriteBottom = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(0, destUv.y)).a; + half spriteTop = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy - half2(0, destUv.y)).a; + half result = spriteLeft + spriteRight + spriteBottom + spriteTop; + + #if OUTBASE8DIR_ON + half spriteTopLeft = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(destUv.x, destUv.y)).a; + half spriteTopRight = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(-destUv.x, destUv.y)).a; + half spriteBotLeft = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(destUv.x, -destUv.y)).a; + half spriteBotRight = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(-destUv.x, -destUv.y)).a; + result = result + spriteTopLeft + spriteTopRight + spriteBotLeft + spriteBotRight; + #endif + + result = step(0.05, saturate(result)); + + #if OUTTEX_ON + d.texcoord1.x += ((_Time.x + _RandomSeed) * _OutlineTexXSpeed) % 1; + d.texcoord1.y += ((_Time.x + _RandomSeed) * _OutlineTexYSpeed) % 1; + #if ATLAS_ON + d.texcoord1 = half2((d.texcoord1.x - _MinXUV) / (_MaxXUV - _MinXUV), (d.texcoord1.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half4 tempOutColor = SAMPLE_TEXTURE2D(_OutlineTex, sampler_OutlineTex, d.texcoord1); + tempOutColor *= _OutlineColor; + _OutlineColor = tempOutColor; + #endif + + result *= (1 - originalAlpha) * _OutlineAlpha; + + half4 outline = _OutlineColor * d.vertexColor.a; + outline.rgb *= _OutlineGlow; + outline.a = result; + #if ONLYOUTLINE_ON + col = outline; + #else + col = lerp(col, outline, result); + #endif + #endif + //------------------------------------------------------- + + //FADE_ON + #if FADE_ON + half2 tiledUvFade1 = TRANSFORM_TEX(d.texcoord0, _FadeTex); + half2 tiledUvFade2 = TRANSFORM_TEX(d.texcoord0, _FadeBurnTex); + #if ATLAS_ON + tiledUvFade1 = half2((tiledUvFade1.x - _MinXUV) / (_MaxXUV - _MinXUV), (tiledUvFade1.y - _MinYUV) / (_MaxYUV - _MinYUV)); + tiledUvFade2 = half2((tiledUvFade2.x - _MinXUV) / (_MaxXUV - _MinXUV), (tiledUvFade2.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half fadeTemp = SAMPLE_TEXTURE2D(_FadeTex, sampler_FadeTex, tiledUvFade1).r; + half fade = smoothstep(_FadeAmount, _FadeAmount + _FadeBurnTransition, fadeTemp); + half fadeBurn = saturate(smoothstep(_FadeAmount - _FadeBurnWidth, _FadeAmount - _FadeBurnWidth + 0.1, fadeTemp) * _FadeAmount); + col.a *= fade; + _FadeBurnColor.rgb *= _FadeBurnGlow; + col += fadeBurn * SAMPLE_TEXTURE2D(_FadeBurnTex, sampler_FadeBurnTex, tiledUvFade2) * _FadeBurnColor * originalAlpha * (1 - col.a); + #endif + //------------------------------------------------------- + + //SHADOW_ON + #if SHADOW_ON + half shadowA = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(_ShadowX, _ShadowY)).a; + half preMultShadowMask = 1 - (saturate(shadowA - col.a) * (1 - col.a)); + col.rgb *= 1 - ((shadowA - col.a) * (1 - col.a)); + col.rgb += (_ShadowColor * shadowA) * (1 - col.a); + col.a = max(shadowA * _ShadowAlpha * d.vertexColor.a, col.a); + #endif + + //------------------------------------------------------- + + //GLOW_ON + #if GLOW_ON + half4 emission; + #if GLOWTEX_ON + emission = SAMPLE_TEXTURE2D(_GlowTex, sampler_GlowTex, d.texcoord0); + #else + emission = col; + #endif + + col.rgb *= _GlowGlobal; + emission.rgb *= emission.a * col.a * _Glow * _GlowColor; + col.rgb += emission.rgb; + #endif + //------------------------------------------------------- + + //COLORRAMP_ON && COLORRAMPOUTLINE_ON + #if COLORRAMP_ON && COLORRAMPOUTLINE_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + luminance = saturate(luminance + _ColorRampLuminosity); + #if GRADIENTCOLORRAMP_ON + col.rgb = lerp(col.rgb, SAMPLE_TEXTURE2D(_ColorRampTexGradient, sampler_ColorRampTexGradient, half2(luminance, 0)).rgb, _ColorRampBlend); + #else + col.rgb = lerp(col.rgb, SAMPLE_TEXTURE2D(_ColorRampTex, sampler_ColorRampTex, half2(luminance, 0)).rgb, _ColorRampBlend); + #endif + #endif + //--------------- + + //GREYSCALE_ON && GREYSCALEOUTLINE_ON + #if GREYSCALE_ON && GREYSCALEOUTLINE_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + luminance = saturate(luminance + _GreyscaleLuminosity); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _GreyscaleTintColor, _GreyscaleBlend); + #endif + + //----------------------------------- + + //POSTERIZE_ON && POSTERIZEOUTLINE_ON + #if POSTERIZE_ON && POSTERIZEOUTLINE_ON + col.rgb = pow(col.rgb, _PosterizeGamma) * _PosterizeNumColors; + col.rgb = floor(col.rgb) / _PosterizeNumColors; + col.rgb = pow(col.rgb, 1.0 / _PosterizeGamma); + #endif + + //----------------------------------- + + //SHINE_ON + #if SHINE_ON + half2 uvShine = uvRect; + half cosAngle = cos(_ShineRotate); + half sinAngle = sin(_ShineRotate); + half2x2 rot = half2x2(cosAngle, -sinAngle, sinAngle, cosAngle); + uvShine -= half2(0.5, 0.5); + uvShine = mul(rot, uvShine); + uvShine += half2(0.5, 0.5); + half shineMask = SAMPLE_TEXTURE2D(_ShineMask, sampler_ShineMask, d.texcoord0.xy).a; + half currentDistanceProjection = (uvShine.x + uvShine.y) / 2; + half whitePower = 1 - (abs(currentDistanceProjection - _ShineLocation) / _ShineWidth); + col.rgb += col.a * whitePower * _ShineGlow * max(sign(currentDistanceProjection - (_ShineLocation - _ShineWidth)), 0.0) + * max(sign((_ShineLocation + _ShineWidth) - currentDistanceProjection), 0.0) * _ShineColor * shineMask; + #endif + + //----------------------------------- + + //HOLOGRAM_ON + #if HOLOGRAM_ON + half totalHologram = _HologramStripesAmount + _HologramUnmodAmount; + half hologramYCoord = ((uvRect.y + (((_Time.x + randomSeed) % 1) * _HologramStripesSpeed)) % totalHologram) / totalHologram; + hologramYCoord = abs(hologramYCoord); + half alpha = RemapFloat(saturate(hologramYCoord - (_HologramUnmodAmount/totalHologram)), 0.0, 1.0, _HologramMinAlpha, saturate(_HologramMaxAlpha)); + half hologramMask = max(sign((_HologramUnmodAmount/totalHologram) - hologramYCoord), 0.0); + half4 hologramResult = col; + hologramResult.a *= lerp(alpha, 1, hologramMask); + hologramResult.rgb *= max(1, _HologramMaxAlpha * max(sign(hologramYCoord - (_HologramUnmodAmount/totalHologram)), 0.0)); + hologramMask = 1 - step(0.01,hologramMask); + hologramResult.rgb += hologramMask * _HologramStripeColor * col.a; + col = lerp(col, hologramResult, _HologramBlend); + #endif + + //----------------------------------- + + //FLICKER_ON + #if FLICKER_ON + col.a *= saturate(col.a * step(frac(0.05 + (_Time.w + randomSeed) * _FlickerFreq), 1 - _FlickerPercent) + _FlickerAlpha); + #endif + //----------------------------------- + + //ALPHACUTOFF_ON + + //ALPHAROUND_ON + + //ALPHAOUTLINE_ON + #if ALPHAOUTLINE_ON + half alphaOutlineRes = pow(1 - col.a, max(_AlphaOutlinePower, 0.0001)) * step(_AlphaOutlineMinAlpha, col.a) * _AlphaOutlineBlend; + col.rgb = lerp(col.rgb, _AlphaOutlineColor.rgb * _AlphaOutlineGlow, alphaOutlineRes); + col.a = lerp(col.a, 1, alphaOutlineRes > 1); + #endif + //------------------------------------------------------- + + //FOG_ON + + //------------------ + + col *= _Color; + o.Albedo = col; + col.a *= _Alpha; + clip(col.a - _AlphaCutoffValue - 0.01); + o.Alpha = _Color.a; + } + + + + + + void ChainSurfaceFunction(inout Surface l, inout ShaderData d) + { + Ext_SurfaceFunction0(l, d); + // Ext_SurfaceFunction1(l, d); + // Ext_SurfaceFunction2(l, d); + // Ext_SurfaceFunction3(l, d); + // Ext_SurfaceFunction4(l, d); + // Ext_SurfaceFunction5(l, d); + // Ext_SurfaceFunction6(l, d); + // Ext_SurfaceFunction7(l, d); + // Ext_SurfaceFunction8(l, d); + // Ext_SurfaceFunction9(l, d); + // Ext_SurfaceFunction10(l, d); + // Ext_SurfaceFunction11(l, d); + // Ext_SurfaceFunction12(l, d); + // Ext_SurfaceFunction13(l, d); + // Ext_SurfaceFunction14(l, d); + // Ext_SurfaceFunction15(l, d); + // Ext_SurfaceFunction16(l, d); + // Ext_SurfaceFunction17(l, d); + // Ext_SurfaceFunction18(l, d); + // Ext_SurfaceFunction19(l, d); + // Ext_SurfaceFunction20(l, d); + // Ext_SurfaceFunction21(l, d); + // Ext_SurfaceFunction22(l, d); + // Ext_SurfaceFunction23(l, d); + // Ext_SurfaceFunction24(l, d); + // Ext_SurfaceFunction25(l, d); + // Ext_SurfaceFunction26(l, d); + // Ext_SurfaceFunction27(l, d); + // Ext_SurfaceFunction28(l, d); + // Ext_SurfaceFunction29(l, d); + } + +#if !_DECALSHADER + + void ChainModifyVertex(inout VertexData v, inout VertexToPixel v2p, float4 time) + { + ExtraV2F d; + + ZERO_INITIALIZE(ExtraV2F, d); + ZERO_INITIALIZE(Blackboard, d.blackboard); + // due to motion vectors in HDRP, we need to use the last + // time in certain spots. So if you are going to use _Time to adjust vertices, + // you need to use this time or motion vectors will break. + d.time = time; + + Ext_ModifyVertex0(v, d); + // Ext_ModifyVertex1(v, d); + // Ext_ModifyVertex2(v, d); + // Ext_ModifyVertex3(v, d); + // Ext_ModifyVertex4(v, d); + // Ext_ModifyVertex5(v, d); + // Ext_ModifyVertex6(v, d); + // Ext_ModifyVertex7(v, d); + // Ext_ModifyVertex8(v, d); + // Ext_ModifyVertex9(v, d); + // Ext_ModifyVertex10(v, d); + // Ext_ModifyVertex11(v, d); + // Ext_ModifyVertex12(v, d); + // Ext_ModifyVertex13(v, d); + // Ext_ModifyVertex14(v, d); + // Ext_ModifyVertex15(v, d); + // Ext_ModifyVertex16(v, d); + // Ext_ModifyVertex17(v, d); + // Ext_ModifyVertex18(v, d); + // Ext_ModifyVertex19(v, d); + // Ext_ModifyVertex20(v, d); + // Ext_ModifyVertex21(v, d); + // Ext_ModifyVertex22(v, d); + // Ext_ModifyVertex23(v, d); + // Ext_ModifyVertex24(v, d); + // Ext_ModifyVertex25(v, d); + // Ext_ModifyVertex26(v, d); + // Ext_ModifyVertex27(v, d); + // Ext_ModifyVertex28(v, d); + // Ext_ModifyVertex29(v, d); + + + // #if %EXTRAV2F0REQUIREKEY% + // v2p.extraV2F0 = d.extraV2F0; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // v2p.extraV2F1 = d.extraV2F1; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // v2p.extraV2F2 = d.extraV2F2; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // v2p.extraV2F3 = d.extraV2F3; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // v2p.extraV2F4 = d.extraV2F4; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // v2p.extraV2F5 = d.extraV2F5; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // v2p.extraV2F6 = d.extraV2F6; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // v2p.extraV2F7 = d.extraV2F7; + // #endif + } + + void ChainModifyTessellatedVertex(inout VertexData v, inout VertexToPixel v2p) + { + ExtraV2F d; + ZERO_INITIALIZE(ExtraV2F, d); + ZERO_INITIALIZE(Blackboard, d.blackboard); + + // #if %EXTRAV2F0REQUIREKEY% + // d.extraV2F0 = v2p.extraV2F0; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // d.extraV2F1 = v2p.extraV2F1; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // d.extraV2F2 = v2p.extraV2F2; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // d.extraV2F3 = v2p.extraV2F3; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // d.extraV2F4 = v2p.extraV2F4; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // d.extraV2F5 = v2p.extraV2F5; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // d.extraV2F6 = v2p.extraV2F6; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // d.extraV2F7 = v2p.extraV2F7; + // #endif + + + // Ext_ModifyTessellatedVertex0(v, d); + // Ext_ModifyTessellatedVertex1(v, d); + // Ext_ModifyTessellatedVertex2(v, d); + // Ext_ModifyTessellatedVertex3(v, d); + // Ext_ModifyTessellatedVertex4(v, d); + // Ext_ModifyTessellatedVertex5(v, d); + // Ext_ModifyTessellatedVertex6(v, d); + // Ext_ModifyTessellatedVertex7(v, d); + // Ext_ModifyTessellatedVertex8(v, d); + // Ext_ModifyTessellatedVertex9(v, d); + // Ext_ModifyTessellatedVertex10(v, d); + // Ext_ModifyTessellatedVertex11(v, d); + // Ext_ModifyTessellatedVertex12(v, d); + // Ext_ModifyTessellatedVertex13(v, d); + // Ext_ModifyTessellatedVertex14(v, d); + // Ext_ModifyTessellatedVertex15(v, d); + // Ext_ModifyTessellatedVertex16(v, d); + // Ext_ModifyTessellatedVertex17(v, d); + // Ext_ModifyTessellatedVertex18(v, d); + // Ext_ModifyTessellatedVertex19(v, d); + // Ext_ModifyTessellatedVertex20(v, d); + // Ext_ModifyTessellatedVertex21(v, d); + // Ext_ModifyTessellatedVertex22(v, d); + // Ext_ModifyTessellatedVertex23(v, d); + // Ext_ModifyTessellatedVertex24(v, d); + // Ext_ModifyTessellatedVertex25(v, d); + // Ext_ModifyTessellatedVertex26(v, d); + // Ext_ModifyTessellatedVertex27(v, d); + // Ext_ModifyTessellatedVertex28(v, d); + // Ext_ModifyTessellatedVertex29(v, d); + + // #if %EXTRAV2F0REQUIREKEY% + // v2p.extraV2F0 = d.extraV2F0; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // v2p.extraV2F1 = d.extraV2F1; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // v2p.extraV2F2 = d.extraV2F2; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // v2p.extraV2F3 = d.extraV2F3; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // v2p.extraV2F4 = d.extraV2F4; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // v2p.extraV2F5 = d.extraV2F5; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // v2p.extraV2F6 = d.extraV2F6; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // v2p.extraV2F7 = d.extraV2F7; + // #endif + } + + void ChainFinalColorForward(inout Surface l, inout ShaderData d, inout half4 color) + { + // Ext_FinalColorForward0(l, d, color); + // Ext_FinalColorForward1(l, d, color); + // Ext_FinalColorForward2(l, d, color); + // Ext_FinalColorForward3(l, d, color); + // Ext_FinalColorForward4(l, d, color); + // Ext_FinalColorForward5(l, d, color); + // Ext_FinalColorForward6(l, d, color); + // Ext_FinalColorForward7(l, d, color); + // Ext_FinalColorForward8(l, d, color); + // Ext_FinalColorForward9(l, d, color); + // Ext_FinalColorForward10(l, d, color); + // Ext_FinalColorForward11(l, d, color); + // Ext_FinalColorForward12(l, d, color); + // Ext_FinalColorForward13(l, d, color); + // Ext_FinalColorForward14(l, d, color); + // Ext_FinalColorForward15(l, d, color); + // Ext_FinalColorForward16(l, d, color); + // Ext_FinalColorForward17(l, d, color); + // Ext_FinalColorForward18(l, d, color); + // Ext_FinalColorForward19(l, d, color); + // Ext_FinalColorForward20(l, d, color); + // Ext_FinalColorForward21(l, d, color); + // Ext_FinalColorForward22(l, d, color); + // Ext_FinalColorForward23(l, d, color); + // Ext_FinalColorForward24(l, d, color); + // Ext_FinalColorForward25(l, d, color); + // Ext_FinalColorForward26(l, d, color); + // Ext_FinalColorForward27(l, d, color); + // Ext_FinalColorForward28(l, d, color); + // Ext_FinalColorForward29(l, d, color); + } + + void ChainFinalGBufferStandard(inout Surface s, inout ShaderData d, inout half4 GBuffer0, inout half4 GBuffer1, inout half4 GBuffer2, inout half4 outEmission, inout half4 outShadowMask) + { + // Ext_FinalGBufferStandard0(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard1(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard2(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard3(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard4(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard5(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard6(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard7(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard8(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard9(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard10(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard11(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard12(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard13(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard14(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard15(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard16(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard17(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard18(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard19(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard20(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard21(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard22(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard23(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard24(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard25(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard26(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard27(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard28(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard29(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + } +#endif + + + + + +#if _DECALSHADER + + ShaderData CreateShaderData(SurfaceDescriptionInputs IN) + { + ShaderData d = (ShaderData)0; + d.TBNMatrix = float3x3(IN.WorldSpaceTangent, IN.WorldSpaceBiTangent, IN.WorldSpaceNormal); + d.worldSpaceNormal = IN.WorldSpaceNormal; + d.worldSpaceTangent = IN.WorldSpaceTangent; + + d.worldSpacePosition = IN.WorldSpacePosition; + d.texcoord0 = IN.uv0.xyxy; + d.screenPos = IN.ScreenPosition; + + d.worldSpaceViewDir = normalize(_WorldSpaceCameraPos - d.worldSpacePosition); + + d.tangentSpaceViewDir = mul(d.TBNMatrix, d.worldSpaceViewDir); + + // these rarely get used, so we back transform them. Usually will be stripped. + #if _HDRP + // d.localSpacePosition = mul(GetWorldToObjectMatrix(), float4(GetCameraRelativePositionWS(d.worldSpacePosition), 1)).xyz; + #else + // d.localSpacePosition = mul(GetWorldToObjectMatrix(), float4(d.worldSpacePosition, 1)).xyz; + #endif + // d.localSpaceNormal = normalize(mul((float3x3)GetWorldToObjectMatrix(), d.worldSpaceNormal)); + // d.localSpaceTangent = normalize(mul((float3x3)GetWorldToObjectMatrix(), d.worldSpaceTangent.xyz)); + + // #if %SCREENPOSREQUIREKEY% + // d.screenUV = (IN.ScreenPosition.xy / max(0.01, IN.ScreenPosition.w)); + // #endif + + return d; + } +#else + + ShaderData CreateShaderData(VertexToPixel i + #if NEED_FACING + , bool facing + #endif + ) + { + ShaderData d = (ShaderData)0; + d.clipPos = i.pos; + d.worldSpacePosition = i.worldPos; + + d.worldSpaceNormal = normalize(i.worldNormal); + d.worldSpaceTangent.xyz = normalize(i.worldTangent.xyz); + + d.tangentSign = i.worldTangent.w * unity_WorldTransformParams.w; + float3 bitangent = cross(d.worldSpaceTangent.xyz, d.worldSpaceNormal) * d.tangentSign; + + d.TBNMatrix = float3x3(d.worldSpaceTangent, -bitangent, d.worldSpaceNormal); + d.worldSpaceViewDir = normalize(_WorldSpaceCameraPos - i.worldPos); + + d.tangentSpaceViewDir = mul(d.TBNMatrix, d.worldSpaceViewDir); + d.texcoord0 = i.texcoord0; + d.texcoord1 = i.texcoord1; + d.texcoord2 = i.texcoord2; + + // #if %TEXCOORD3REQUIREKEY% + d.texcoord3 = i.texcoord3; + // #endif + + // d.isFrontFace = facing; + // #if %VERTEXCOLORREQUIREKEY% + d.vertexColor = i.vertexColor; + // #endif + + // these rarely get used, so we back transform them. Usually will be stripped. + #if _HDRP + // d.localSpacePosition = mul(GetWorldToObjectMatrix(), float4(GetCameraRelativePositionWS(i.worldPos), 1)).xyz; + #else + // d.localSpacePosition = mul(GetWorldToObjectMatrix(), float4(i.worldPos, 1)).xyz; + #endif + // d.localSpaceNormal = normalize(mul((float3x3)GetWorldToObjectMatrix(), i.worldNormal)); + // d.localSpaceTangent = normalize(mul((float3x3)GetWorldToObjectMatrix(), i.worldTangent.xyz)); + + // #if %SCREENPOSREQUIREKEY% + // d.screenPos = i.screenPos; + // d.screenUV = (i.screenPos.xy / i.screenPos.w); + // #endif + + + // #if %EXTRAV2F0REQUIREKEY% + // d.extraV2F0 = i.extraV2F0; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // d.extraV2F1 = i.extraV2F1; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // d.extraV2F2 = i.extraV2F2; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // d.extraV2F3 = i.extraV2F3; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // d.extraV2F4 = i.extraV2F4; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // d.extraV2F5 = i.extraV2F5; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // d.extraV2F6 = i.extraV2F6; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // d.extraV2F7 = i.extraV2F7; + // #endif + + return d; + } + +#endif + + + +#if (SHADERPASS == SHADERPASS_LIGHT_TRANSPORT) + + // This was not in constant buffer in original unity, so keep outiside. But should be in as ShaderRenderPass frequency + float unity_OneOverOutputBoost; + float unity_MaxOutputValue; + + CBUFFER_START(UnityMetaPass) + // x = use uv1 as raster position + // y = use uv2 as raster position + bool4 unity_MetaVertexControl; + + // x = return albedo + // y = return normal + bool4 unity_MetaFragmentControl; + CBUFFER_END + + VertexToPixel Vert(VertexData inputMesh) + { + VertexToPixel output; + ZERO_INITIALIZE(VertexToPixel, output); + UNITY_SETUP_INSTANCE_ID(inputMesh); + UNITY_TRANSFER_INSTANCE_ID(inputMesh, output); + UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(output); + + // Output UV coordinate in vertex shader + float2 uv = float2(0.0, 0.0); + + if (unity_MetaVertexControl.x) + { + uv = inputMesh.texcoord1.xy * unity_LightmapST.xy + unity_LightmapST.zw; + } + else if (unity_MetaVertexControl.y) + { + uv = inputMesh.texcoord2.xy * unity_DynamicLightmapST.xy + unity_DynamicLightmapST.zw; + } + + // OpenGL right now needs to actually use the incoming vertex position + // so we create a fake dependency on it here that haven't any impact. + output.pos = float4(uv * 2.0 - 1.0, inputMesh.vertex.z > 0 ? 1.0e-4 : 0.0, 1.0); + + output.worldPos = TransformObjectToWorld(inputMesh.vertex); + + // Normal is required for triplanar mapping + output.worldNormal = TransformObjectToWorldNormal(inputMesh.normal); + // Not required but assign to silent compiler warning + output.worldTangent = float4(1.0, 0.0, 0.0, 0.0); + + output.texcoord0 = inputMesh.texcoord0; + output.texcoord1 = inputMesh.texcoord1; + output.texcoord2 = inputMesh.texcoord2; + // #if %TEXCOORD3REQUIREKEY% + output.texcoord3 = inputMesh.texcoord3; + // #endif + // #if %VERTEXCOLORREQUIREKEY% + output.vertexColor = inputMesh.vertexColor; + // #endif + + return output; + } +#else + + #if (_PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR))) + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/ShaderVariablesMatrixDefsHDCamera.hlsl" + + void MotionVectorPositionZBias(VertexToPixel input) + { + #if UNITY_REVERSED_Z + input.pos.z -= unity_MotionVectorsParams.z * input.pos.w; + #else + input.pos.z += unity_MotionVectorsParams.z * input.pos.w; + #endif + } + + #endif + + VertexToPixel Vert(VertexData input) + { + VertexToPixel output; + ZERO_INITIALIZE(VertexToPixel, output); + + UNITY_SETUP_INSTANCE_ID(input); + UNITY_TRANSFER_INSTANCE_ID(input, output); + UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(output); + + // copy before user modification, since we'll apply that to the copy later + #if _HDRP && (_PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR))) + VertexData previousMesh = input; + #endif + + ChainModifyVertex(input, output, _Time); + + // This return the camera relative position (if enable) + float3 positionRWS = TransformObjectToWorld(input.vertex.xyz); + float3 normalWS = TransformObjectToWorldNormal(input.normal); + float4 tangentWS = float4(TransformObjectToWorldDir(input.tangent.xyz), input.tangent.w); + + + output.worldPos = GetAbsolutePositionWS(positionRWS); + output.pos = TransformWorldToHClip(positionRWS); + output.worldNormal = normalWS; + output.worldTangent = tangentWS; + + + output.texcoord0 = input.texcoord0; + output.texcoord1 = input.texcoord1; + output.texcoord2 = input.texcoord2; + + // #if %TEXCOORD3REQUIREKEY% + output.texcoord3 = input.texcoord3; + // #endif + + // #if %VERTEXCOLORREQUIREKEY% + output.vertexColor = input.vertexColor; + // #endif + + // #if %SCREENPOSREQUIREKEY% + // output.screenPos = ComputeScreenPos(output.pos, _ProjectionParams.x); + // #endif + + #if _HDRP && (_PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR))) + + #if !defined(TESSELLATION_ON) + MotionVectorPositionZBias(output); + #endif + + output.motionVectorCS = mul(UNITY_MATRIX_UNJITTERED_VP, float4(positionRWS, 1.0)); + // Note: unity_MotionVectorsParams.y is 0 is forceNoMotion is enabled + bool forceNoMotion = unity_MotionVectorsParams.y == 0.0; + if (forceNoMotion) + { + output.previousPositionCS = float4(0.0, 0.0, 0.0, 1.0); + } + else + { + bool hasDeformation = unity_MotionVectorsParams.x > 0.0; // Skin or morph target + + float3 effectivePositionOS = (hasDeformation ? previousMesh.previousPositionOS : previousMesh.vertex.xyz); + #if defined(_ADD_PRECOMPUTED_VELOCITY) + effectivePositionOS -= input.precomputedVelocity; + #endif + + + + previousMesh.vertex = float4(effectivePositionOS, 1); + VertexToPixel dummy = (VertexToPixel)0; + + ChainModifyVertex(previousMesh, dummy, _LastTimeParameters); + + float3 previousPositionRWS = TransformPreviousObjectToWorld(previousMesh.vertex.xyz); + // we might need this for skinned objects? + //float3 normalWS = TransformPreviousObjectToWorldNormal(input.normal).xyz; + + #ifdef _WRITE_TRANSPARENT_MOTION_VECTOR + if (_TransparentCameraOnlyMotionVectors > 0) + { + previousPositionRWS = positionRWS.xyz; + } + #endif // _WRITE_TRANSPARENT_MOTION_VECTOR + + output.previousPositionCS = mul(UNITY_MATRIX_PREV_VP, float4(previousPositionRWS, 1.0)); + } + #endif // _HDRP && _PASSMOTIONVECTOR || (_PASSFORWARD && defined(_WRITE_TRANSPARENT_MOTION_VECTOR)) + + + return output; + } + + +#endif + + + + + + + + #if defined(WRITE_DECAL_BUFFER) && !defined(_DISABLE_DECALS) + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/Decal/DecalPrepassBuffer.hlsl" + #endif + + FragInputs BuildFragInputs(VertexToPixel input) + { + UNITY_SETUP_INSTANCE_ID(input); + FragInputs output; + ZERO_INITIALIZE(FragInputs, output); + + // Init to some default value to make the computer quiet (else it output 'divide by zero' warning even if value is not used). + // TODO: this is a really poor workaround, but the variable is used in a bunch of places + // to compute normals which are then passed on elsewhere to compute other values... + output.tangentToWorld = k_identity3x3; + output.positionSS = input.pos; // input.positionCS is SV_Position + // BETTER SHADERS: because we transform world position into actual world space for things like + // triplanar, etc, we have to back transform it here for lighting + output.positionRWS = GetCameraRelativePositionWS(input.worldPos); + output.tangentToWorld = BuildTangentToWorld(input.worldTangent, input.worldNormal); + output.texCoord0 = input.texcoord0; + output.texCoord1 = input.texcoord1; + output.texCoord2 = input.texcoord2; + + return output; + } + + void BuildSurfaceData(FragInputs fragInputs, inout Surface surfaceDescription, float3 V, PositionInputs posInput, out SurfaceData surfaceData, out float3 bentNormalWS) + { + // setup defaults -- these are used if the graph doesn't output a value + ZERO_INITIALIZE(SurfaceData, surfaceData); + + // specularOcclusion need to be init ahead of decal to quiet the compiler that modify the SurfaceData struct + // however specularOcclusion can come from the graph, so need to be init here so it can be override. + surfaceData.specularOcclusion = 1.0; + + // copy across graph values, if defined + surfaceData.baseColor = surfaceDescription.Albedo; + surfaceData.perceptualSmoothness = surfaceDescription.Smoothness; + surfaceData.ambientOcclusion = surfaceDescription.Occlusion; + surfaceData.specularOcclusion = surfaceDescription.SpecularOcclusion; + surfaceData.metallic = surfaceDescription.Metallic; + surfaceData.subsurfaceMask = surfaceDescription.SubsurfaceMask; + surfaceData.thickness = surfaceDescription.Thickness; + surfaceData.diffusionProfileHash = asuint(surfaceDescription.DiffusionProfileHash); + #if _USESPECULAR + surfaceData.specularColor = surfaceDescription.Specular; + #endif + surfaceData.coatMask = surfaceDescription.CoatMask; + surfaceData.anisotropy = surfaceDescription.Anisotropy; + surfaceData.iridescenceMask = surfaceDescription.IridescenceMask; + surfaceData.iridescenceThickness = surfaceDescription.IridescenceThickness; + + + + #if defined(_REFRACTION_PLANE) || defined(_REFRACTION_SPHERE) || defined(_REFRACTION_THIN) + if (_EnableSSRefraction) + { + surfaceData.transmittanceMask = (1.0 - surfaceDescription.Alpha); + surfaceDescription.Alpha = 1.0; + } + else + { + surfaceData.ior = surfaceDescription.ior; + surfaceData.transmittanceColor = surfaceDescription.transmittanceColor; + surfaceData.atDistance = surfaceDescription.atDistance; + surfaceData.transmittanceMask = surfaceDescription.transmittanceMask; + surfaceDescription.Alpha = 1.0; + } + #else + surfaceData.ior = 1.0; + surfaceData.transmittanceColor = float3(1.0, 1.0, 1.0); + surfaceData.atDistance = 1.0; + surfaceData.transmittanceMask = 0.0; + #endif + + + #if defined(_ENABLE_SHADOW_MATTE) && SHADERPASS == SHADERPASS_FORWARD_UNLIT + HDShadowContext shadowContext = InitShadowContext(); + float shadow; + float3 shadow3; + // We need to recompute some coordinate not computed by default for shadow matte + posInput = GetPositionInput(fragInputs.positionSS.xy, _ScreenSize.zw, fragInputs.positionSS.z, UNITY_MATRIX_I_VP, GetWorldToViewMatrix()); + float3 upWS = normalize(fragInputs.tangentToWorld[1]); + uint renderingLayers = GetMeshRenderingLightLayer(); + ShadowLoopMin(shadowContext, posInput, upWS, asuint(_ShadowMatteFilter), renderingLayers, shadow3); + shadow = dot(shadow3, float3(1.0 / 3.0, 1.0 / 3.0, 1.0 / 3.0)); + + float4 shadowColor = (1.0 - shadow) * surfaceDescription.ShadowTint.rgba; + float localAlpha = saturate(shadowColor.a + surfaceDescription.Alpha); + + // Keep the nested lerp + // With no Color (bsdfData.color.rgb, bsdfData.color.a == 0.0f), just use ShadowColor*Color to avoid a ring of "white" around the shadow + // And mix color to consider the Color & ShadowColor alpha (from texture or/and color picker) + #ifdef _SURFACE_TYPE_TRANSPARENT + surfaceData.baseColor = lerp(shadowColor.rgb * surfaceData.baseColor, lerp(lerp(shadowColor.rgb, surfaceData.baseColor, 1.0 - surfaceDescription.ShadowTint.a), surfaceData.baseColor, shadow), surfaceDescription.Alpha); + #else + surfaceData.baseColor = lerp(lerp(shadowColor.rgb, surfaceData.baseColor, 1.0 - surfaceDescription.ShadowTint.a), surfaceData.baseColor, shadow); + #endif + localAlpha = ApplyBlendMode(surfaceData.baseColor, localAlpha).a; + + surfaceDescription.Alpha = localAlpha; + #endif + + // These static material feature allow compile time optimization + surfaceData.materialFeatures = MATERIALFEATUREFLAGS_LIT_STANDARD; + #ifdef _MATERIAL_FEATURE_SUBSURFACE_SCATTERING + surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_SUBSURFACE_SCATTERING; + #endif + + #ifdef _MATERIAL_FEATURE_TRANSMISSION + surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_TRANSMISSION; + #endif + + #ifdef _MATERIAL_FEATURE_ANISOTROPY + surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_ANISOTROPY; + #endif + + #ifdef _MATERIAL_FEATURE_IRIDESCENCE + surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_IRIDESCENCE; + #endif + + #ifdef _MATERIAL_FEATURE_SPECULAR_COLOR + surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_SPECULAR_COLOR; + #endif + + #if defined(_MATERIAL_FEATURE_CLEAR_COAT) || _CLEARCOAT + surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_CLEAR_COAT; + #endif + + #if defined (_MATERIAL_FEATURE_SPECULAR_COLOR) && defined (_ENERGY_CONSERVING_SPECULAR) + // Require to have setup baseColor + // Reproduce the energy conservation done in legacy Unity. Not ideal but better for compatibility and users can unchek it + surfaceData.baseColor *= (1.0 - Max3(surfaceData.specularColor.r, surfaceData.specularColor.g, surfaceData.specularColor.b)); + #endif + + + + // compute world space normal + #if !_WORLDSPACENORMAL + surfaceData.normalWS = mul(surfaceDescription.Normal, fragInputs.tangentToWorld); + #else + surfaceData.normalWS = surfaceDescription.Normal; + #endif + + surfaceData.geomNormalWS = fragInputs.tangentToWorld[2]; + + surfaceData.tangentWS = normalize(fragInputs.tangentToWorld[0].xyz); // The tangent is not normalize in tangentToWorld for mikkt. TODO: Check if it expected that we normalize with Morten. Tag: SURFACE_GRADIENT + + + #if HAVE_DECALS + if (_EnableDecals) + { + float alpha = 1.0; + alpha = surfaceDescription.Alpha; + + // Both uses and modifies 'surfaceData.normalWS'. + DecalSurfaceData decalSurfaceData = GetDecalSurfaceData(posInput, fragInputs.tangentToWorld[2], alpha); + ApplyDecalToSurfaceData(decalSurfaceData, fragInputs.tangentToWorld[2], surfaceData); + } + #endif + + bentNormalWS = surfaceData.normalWS; + + surfaceData.tangentWS = Orthonormalize(surfaceData.tangentWS, surfaceData.normalWS); + + #ifdef DEBUG_DISPLAY + if (_DebugMipMapMode != DEBUGMIPMAPMODE_NONE) + { + // TODO: need to update mip info + surfaceData.metallic = 0; + } + + // We need to call ApplyDebugToSurfaceData after filling the surfarcedata and before filling builtinData + // as it can modify attribute use for static lighting + ApplyDebugToSurfaceData(fragInputs.tangentToWorld, surfaceData); + #endif + + // By default we use the ambient occlusion with Tri-ace trick (apply outside) for specular occlusion. + // If user provide bent normal then we process a better term + #if defined(_SPECULAR_OCCLUSION_CUSTOM) + // Just use the value passed through via the slot (not active otherwise) + #elif defined(_SPECULAR_OCCLUSION_FROM_AO_BENT_NORMAL) + // If we have bent normal and ambient occlusion, process a specular occlusion + surfaceData.specularOcclusion = GetSpecularOcclusionFromBentAO(V, bentNormalWS, surfaceData.normalWS, surfaceData.ambientOcclusion, PerceptualSmoothnessToPerceptualRoughness(surfaceData.perceptualSmoothness)); + #elif defined(_AMBIENT_OCCLUSION) && defined(_SPECULAR_OCCLUSION_FROM_AO) + surfaceData.specularOcclusion = GetSpecularOcclusionFromAmbientOcclusion(ClampNdotV(dot(surfaceData.normalWS, V)), surfaceData.ambientOcclusion, PerceptualSmoothnessToRoughness(surfaceData.perceptualSmoothness)); + #endif + + #if defined(_ENABLE_GEOMETRIC_SPECULAR_AA) && !defined(SHADER_STAGE_RAY_TRACING) + surfaceData.perceptualSmoothness = GeometricNormalFiltering(surfaceData.perceptualSmoothness, fragInputs.tangentToWorld[2], surfaceDescription.SpecularAAScreenSpaceVariance, surfaceDescription.SpecularAAThreshold); + #endif + } + + void GetSurfaceAndBuiltinData(VertexToPixel m2ps, FragInputs fragInputs, float3 V, inout PositionInputs posInput, + out SurfaceData surfaceData, out BuiltinData builtinData, inout Surface l, inout ShaderData d + #if NEED_FACING + , bool facing + #endif + ) + { + // Removed since crossfade does not work, probably needs extra material setup. + //#if !defined(SHADER_STAGE_RAY_TRACING) && !defined(_TESSELLATION_DISPLACEMENT) + // #ifdef LOD_FADE_CROSSFADE // enable dithering LOD transition if user select CrossFade transition in LOD group + // LODDitheringTransition(ComputeFadeMaskSeed(V, posInput.positionSS), unity_LODFade.x); + // #endif + //#endif + + d = CreateShaderData(m2ps + #if NEED_FACING + , facing + #endif + ); + + l = (Surface)0; + + l.Albedo = half3(0.5, 0.5, 0.5); + l.Normal = float3(0,0,1); + l.Occlusion = 1; + l.Alpha = 1; + l.SpecularOcclusion = 1; + + #if !defined(SHADER_STAGE_RAY_TRACING) && defined(_DEPTHOFFSET_ON) + l.outputDepth = d.clipPos.z; + #endif + + ChainSurfaceFunction(l, d); + + #if !defined(SHADER_STAGE_RAY_TRACING) && defined(_DEPTHOFFSET_ON) + //posInput.deviceDepth = l.outputDepth; + #endif + + #if _UNLIT + //l.Emission = l.Albedo; + //l.Albedo = 0; + l.Normal = half3(0,0,1); + l.Occlusion = 1; + l.Metallic = 0; + l.Specular = 0; + #endif + + surfaceData.geomNormalWS = d.worldSpaceNormal; + surfaceData.tangentWS = d.worldSpaceTangent; + fragInputs.tangentToWorld = d.TBNMatrix; + + float3 bentNormalWS; + BuildSurfaceData(fragInputs, l, V, posInput, surfaceData, bentNormalWS); + + + InitBuiltinData(posInput, l.Alpha, bentNormalWS, -d.worldSpaceNormal, fragInputs.texCoord1, fragInputs.texCoord2, builtinData); + + + + builtinData.emissiveColor = l.Emission; + + #if defined(_OVERRIDE_BAKEDGI) + builtinData.bakeDiffuseLighting = l.DiffuseGI; + builtinData.backBakeDiffuseLighting = l.BackDiffuseGI; + builtinData.emissiveColor += l.SpecularGI; + #endif + + #if defined(_OVERRIDE_SHADOWMASK) + builtinData.shadowMask0 = l.ShadowMask.x; + builtinData.shadowMask1 = l.ShadowMask.y; + builtinData.shadowMask2 = l.ShadowMask.z; + builtinData.shadowMask3 = l.ShadowMask.w; + #endif + + #if defined(UNITY_VIRTUAL_TEXTURING) + builtinData.vtPackedFeedback = surfaceData.VTPackedFeedback; + #endif + + #if (SHADERPASS == SHADERPASS_DISTORTION) + //builtinData.distortion = surfaceData.Distortion; + //builtinData.distortionBlur = surfaceData.DistortionBlur; + #endif + + #ifndef SHADER_UNLIT + // PostInitBuiltinData call ApplyDebugToBuiltinData + PostInitBuiltinData(V, posInput, surfaceData, builtinData); + #else + ApplyDebugToBuiltinData(builtinData); + #endif + + RAY_TRACING_OPTIONAL_ALPHA_TEST_PASS + } + + void Frag( VertexToPixel v2f, + OUTPUT_GBUFFER(outGBuffer) + #ifdef _DEPTHOFFSET_ON + , out float outputDepth : SV_Depth + #endif + #if NEED_FACING + , bool facing : SV_IsFrontFace + #endif + ) + { + UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX(v2f); + FragInputs input = BuildFragInputs(v2f); + + // input.positionSS is SV_Position + PositionInputs posInput = GetPositionInput(input.positionSS.xy, _ScreenSize.zw, input.positionSS.z, input.positionSS.w, input.positionRWS); + float3 V = GetWorldSpaceNormalizeViewDir(input.positionRWS); + + SurfaceData surfaceData; + BuiltinData builtinData; + Surface l; + ShaderData d; + GetSurfaceAndBuiltinData(v2f, input, V, posInput, surfaceData, builtinData, l, d + #if NEED_FACING + , facing + #endif + ); + + + ENCODE_INTO_GBUFFER(surfaceData, builtinData, posInput.positionSS, outGBuffer); + + #ifdef _DEPTHOFFSET_ON + outputDepth = l.outputDepth; + #endif + } + + ENDHLSL + } + + Pass + { + // based on HDLitPass.template + Name "ShadowCaster" + Tags { "LightMode" = "ShadowCaster" } + + + + //------------------------------------------------------------------------------------- + // Render Modes (Blend, Cull, ZTest, Stencil, etc) + //------------------------------------------------------------------------------------- + + Cull Back + ZWrite On + ColorMask 0 + ZClip [_ZClip] + + + Tags { "RenderType" = "Opaque" "Queue" = "Geometry" "PreviewType" = "Plane" } + Cull [_CullingOption] + ZWrite [_ZWrite] + ZTest [_ZTestMode] + + + //------------------------------------------------------------------------------------- + // End Render Modes + //------------------------------------------------------------------------------------- + + HLSLPROGRAM + + #pragma target 4.5 + #pragma only_renderers d3d11 playstation xboxone vulkan metal switch + //#pragma enable_d3d11_debug_symbols + + #pragma multi_compile_instancing + #pragma instancing_options renderinglayer + + //#pragma multi_compile_local _ _ALPHATEST_ON + + + //#pragma shader_feature _ _SURFACE_TYPE_TRANSPARENT + //#pragma shader_feature_local _BLENDMODE_OFF _BLENDMODE_ALPHA _BLENDMODE_ADD _BLENDMODE_PRE_MULTIPLY + //#pragma shader_feature_local _ _ADD_PRECOMPUTED_VELOCITY + //#pragma shader_feature_local _ _TRANSPARENT_WRITES_MOTION_VEC + //#pragma shader_feature_local _ _ENABLE_FOG_ON_TRANSPARENT + //#pragma shader_feature_local _ _DISABLE_DECALS + //#pragma shader_feature_local _ _DISABLE_SSR + //#pragma shader_feature_local _ _DISABLE_SSR_TRANSPARENT + //#pragma shader_feature_local _REFRACTION_OFF _REFRACTION_PLANE _REFRACTION_SPHERE _REFRACTION_THIN + #pragma multi_compile _ WRITE_DECAL_BUFFER + //------------------------------------------------------------------------------------- + // Variant Definitions (active field translations to HDRP defines) + //------------------------------------------------------------------------------------- + // #define _MATERIAL_FEATURE_SUBSURFACE_SCATTERING 1 + // #define _MATERIAL_FEATURE_TRANSMISSION 1 + // #define _MATERIAL_FEATURE_ANISOTROPY 1 + // #define _MATERIAL_FEATURE_IRIDESCENCE 1 + // #define _MATERIAL_FEATURE_SPECULAR_COLOR 1 + #define _ENABLE_FOG_ON_TRANSPARENT 1 + // #define _AMBIENT_OCCLUSION 1 + // #define _SPECULAR_OCCLUSION_FROM_AO 1 + // #define _SPECULAR_OCCLUSION_FROM_AO_BENT_NORMAL 1 + // #define _SPECULAR_OCCLUSION_CUSTOM 1 + // #define _ENERGY_CONSERVING_SPECULAR 1 + // #define _ENABLE_GEOMETRIC_SPECULAR_AA 1 + // #define _HAS_REFRACTION 1 + // #define _REFRACTION_PLANE 1 + // #define _REFRACTION_SPHERE 1 + // #define _DISABLE_DECALS 1 + // #define _DISABLE_SSR 1 + // #define _ADD_PRECOMPUTED_VELOCITY + // #define _WRITE_TRANSPARENT_MOTION_VECTOR 1 + // #define _DEPTHOFFSET_ON 1 + // #define _BLENDMODE_PRESERVE_SPECULAR_LIGHTING 1 + + #define SHADERPASS SHADERPASS_SHADOWS + #define RAYTRACING_SHADER_GRAPH_HIGH + #define _PASSSHADOW 1 + + + #pragma shader_feature_local GLOW_ON + #pragma shader_feature_local FADE_ON + #pragma shader_feature_local OUTBASE_ON + #pragma shader_feature_local ONLYOUTLINE_ON + #pragma shader_feature_local GRADIENT_ON + #pragma shader_feature_local GRADIENT2COL_ON + #pragma shader_feature_local RADIALGRADIENT_ON + #pragma shader_feature_local COLORSWAP_ON + #pragma shader_feature_local HSV_ON + #pragma shader_feature_local CHANGECOLOR_ON + #pragma shader_feature_local CHANGECOLOR2_ON + #pragma shader_feature_local CHANGECOLOR3_ON + #pragma shader_feature_local COLORRAMP_ON + #pragma shader_feature_local GRADIENTCOLORRAMP_ON + #pragma shader_feature_local HITEFFECT_ON + #pragma shader_feature_local NEGATIVE_ON + #pragma shader_feature_local PIXELATE_ON + #pragma shader_feature_local GREYSCALE_ON + #pragma shader_feature_local POSTERIZE_ON + #pragma shader_feature_local BLUR_ON + #pragma shader_feature_local MOTIONBLUR_ON + #pragma shader_feature_local GHOST_ON + #pragma shader_feature_local ALPHAOUTLINE_ON + #pragma shader_feature_local INNEROUTLINE_ON + #pragma shader_feature_local ONLYINNEROUTLINE_ON + #pragma shader_feature_local HOLOGRAM_ON + #pragma shader_feature_local CHROMABERR_ON + #pragma shader_feature_local GLITCH_ON + #pragma shader_feature_local FLICKER_ON + #pragma shader_feature_local SHADOW_ON + #pragma shader_feature_local SHINE_ON + #pragma shader_feature_local CONTRAST_ON + #pragma shader_feature_local OVERLAY_ON + #pragma shader_feature_local OVERLAYMULT_ON + #pragma shader_feature_local DOODLE_ON + #pragma shader_feature_local WIND_ON + #pragma shader_feature_local WAVEUV_ON + #pragma shader_feature_local ROUNDWAVEUV_ON + #pragma shader_feature_local RECTSIZE_ON + #pragma shader_feature_local OFFSETUV_ON + #pragma shader_feature_local CLIPPING_ON + #pragma shader_feature_local RADIALCLIPPING_ON + #pragma shader_feature_local TEXTURESCROLL_ON + #pragma shader_feature_local ZOOMUV_ON + #pragma shader_feature_local DISTORT_ON + #pragma shader_feature_local WARP_ON + #pragma shader_feature_local TWISTUV_ON + #pragma shader_feature_local ROTATEUV_ON + #pragma shader_feature_local POLARUV_ON + #pragma shader_feature_local FISHEYE_ON + #pragma shader_feature_local PINCH_ON + #pragma shader_feature_local SHAKEUV_ON + + #pragma shader_feature_local GLOWTEX_ON + #pragma shader_feature_local OUTTEX_ON + #pragma shader_feature_local OUTDIST_ON + #pragma shader_feature_local OUTBASE8DIR_ON + #pragma shader_feature_local OUTBASEPIXELPERF_ON + #pragma shader_feature_local COLORRAMPOUTLINE_ON + #pragma shader_feature_local GREYSCALEOUTLINE_ON + #pragma shader_feature_local POSTERIZEOUTLINE_ON + #pragma shader_feature_local BLURISHD_ON + #pragma shader_feature_local MANUALWIND_ON + #pragma shader_feature_local ATLAS_ON + #pragma shader_feature_local PREMULTIPLYALPHA_ON + + #pragma shader_feature BILBOARD_ON + #pragma shader_feature BILBOARDY_ON + + #pragma shader_feature NORMALMAP_ON + + + #define _HDRP 1 +#define _USINGTEXCOORD1 1 +#define _USINGTEXCOORD2 1 + + + #pragma vertex Vert + #pragma fragment Frag + + //------------------------------------------------------------------------------------- + // Defines + //------------------------------------------------------------------------------------- + + + // useful conversion functions to make surface shader code just work + + #define UNITY_DECLARE_TEX2D(name) TEXTURE2D(name); SAMPLER(sampler##name); + #define UNITY_DECLARE_TEX2D_NOSAMPLER(name) TEXTURE2D(name); + #define UNITY_DECLARE_TEX2DARRAY(name) TEXTURE2D_ARRAY(name); SAMPLER(sampler##name); + #define UNITY_DECLARE_TEX2DARRAY_NOSAMPLER(tex) TEXTURE2D_ARRAY(tex); + + #define UNITY_SAMPLE_TEX2DARRAY(tex,coord) SAMPLE_TEXTURE2D_ARRAY(tex, sampler##tex, coord.xy, coord.z) + #define UNITY_SAMPLE_TEX2DARRAY_LOD(tex,coord,lod) SAMPLE_TEXTURE2D_ARRAY_LOD(tex, sampler##tex, coord.xy, coord.z, lod) + #define UNITY_SAMPLE_TEX2D(tex, coord) SAMPLE_TEXTURE2D(tex, sampler##tex, coord) + #define UNITY_SAMPLE_TEX2D_SAMPLER(tex, samp, coord) SAMPLE_TEXTURE2D(tex, sampler##samp, coord) + + #define UNITY_SAMPLE_TEX2D_LOD(tex,coord, lod) SAMPLE_TEXTURE2D_LOD(tex, sampler_##tex, coord, lod) + #define UNITY_SAMPLE_TEX2D_SAMPLER_LOD(tex,samplertex,coord, lod) SAMPLE_TEXTURE2D_LOD (tex, sampler##samplertex,coord, lod) + + #if defined(UNITY_COMPILER_HLSL) + #define UNITY_INITIALIZE_OUTPUT(type,name) name = (type)0; + #else + #define UNITY_INITIALIZE_OUTPUT(type,name) + #endif + + #define sampler2D_float sampler2D + #define sampler2D_half sampler2D + + #undef WorldNormalVector + #define WorldNormalVector(data, normal) mul(normal, data.TBNMatrix) + + #define UnityObjectToWorldNormal(normal) mul(GetObjectToWorldMatrix(), normal) + + + + +// HDRP Adapter stuff + #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Common.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/ShaderVariables.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/ShaderPass/FragInputs.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/ShaderPass/ShaderPass.cs.hlsl" + #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/TextureStack.hlsl" // Required to be include before we include properties as it define DECLARE_STACK_CB + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/ShaderGraphHeader.hlsl" // Need to be here for Gradient struct definition + + #ifdef RAYTRACING_SHADER_GRAPH_DEFAULT + #define RAYTRACING_SHADER_GRAPH_HIGH + #endif + + #ifdef RAYTRACING_SHADER_GRAPH_RAYTRACED + #define RAYTRACING_SHADER_GRAPH_LOW + #endif + // end + + + + + // If we use subsurface scattering, enable output split lighting (for forward pass) + #if defined(_MATERIAL_FEATURE_SUBSURFACE_SCATTERING) && !defined(_SURFACE_TYPE_TRANSPARENT) + #define OUTPUT_SPLIT_LIGHTING + #endif + + #define HAVE_RECURSIVE_RENDERING + + #if SHADERPASS == SHADERPASS_TRANSPARENT_DEPTH_PREPASS + #if !defined(_DISABLE_SSR_TRANSPARENT) && !defined(SHADER_UNLIT) + #define WRITE_NORMAL_BUFFER + #endif + #endif + + #ifndef DEBUG_DISPLAY + // In case of opaque we don't want to perform the alpha test, it is done in depth prepass and we use depth equal for ztest (setup from UI) + // Don't do it with debug display mode as it is possible there is no depth prepass in this case + #if !defined(_SURFACE_TYPE_TRANSPARENT) && defined(_ALPHATEST) + #if SHADERPASS == SHADERPASS_FORWARD + #define SHADERPASS_FORWARD_BYPASS_ALPHA_TEST + #elif SHADERPASS == SHADERPASS_GBUFFER + #define SHADERPASS_GBUFFER_BYPASS_ALPHA_TEST + #endif + #endif + #endif + + // Translate transparent motion vector define + #if defined(_TRANSPARENT_WRITES_MOTION_VEC) && defined(_SURFACE_TYPE_TRANSPARENT) + #define _WRITE_TRANSPARENT_MOTION_VECTOR + #endif + + + + + CBUFFER_START(UnityPerMaterial) + float _UseShadowThreshold; + float _BlendMode; + float _EnableBlendModePreserveSpecularLighting; + float _RayTracing; + float _RefractionModel; + + + half4 _Color; + half4 _MainTex_ST, _MainTex_TexelSize; + half _Alpha, _AlphaCutoffValue; + + #if ATLAS_ON + half _MinXUV, _MaxXUV, _MinYUV, _MaxYUV; + #endif + + #if GLOW_ON + half4 _GlowColor; + half _Glow, _GlowGlobal; + #endif + + #if HSV_ON + half _HsvShift, _HsvSaturation, _HsvBright; + #endif + + #if DISTORT_ON + half4 _DistortTex_ST; + half _DistortTexXSpeed, _DistortTexYSpeed, _DistortAmount; + #endif + + #if FADE_ON + half4 _FadeBurnColor, _FadeTex_ST, _FadeBurnTex_ST; + half _FadeAmount, _FadeBurnWidth, _FadeBurnTransition,_FadeBurnGlow; + #endif + + #if OUTBASE_ON + half4 _OutlineColor; + half _OutlineAlpha, _OutlineGlow, _OutlineWidth; + int _OutlinePixelWidth; + #endif + + #if OUTTEX_ON + half4 _OutlineTex_ST; + half _OutlineTexXSpeed, _OutlineTexYSpeed; + #endif + + #if OUTDIST_ON + half4 _OutlineDistortTex_ST; + half _OutlineDistortTexXSpeed, _OutlineDistortTexYSpeed, _OutlineDistortAmount; + #endif + + #if ALPHAOUTLINE_ON + half _AlphaOutlineGlow, _AlphaOutlinePower, _AlphaOutlineMinAlpha, _AlphaOutlineBlend; + half4 _AlphaOutlineColor; + #endif + + #if INNEROUTLINE_ON + half _InnerOutlineThickness, _InnerOutlineAlpha, _InnerOutlineGlow; + half4 _InnerOutlineColor; + #endif + + #if GRADIENT_ON + half _GradBlend, _GradBoostX, _GradBoostY; + half4 _GradTopRightCol, _GradTopLeftCol, _GradBotRightCol, _GradBotLeftCol; + #endif + + #if COLORSWAP_ON + half4 _ColorSwapRed, _ColorSwapGreen, _ColorSwapBlue; + half _ColorSwapRedLuminosity, _ColorSwapGreenLuminosity, _ColorSwapBlueLuminosity, _ColorSwapBlend; + #endif + + #if CHANGECOLOR_ON + half4 _ColorChangeNewCol, _ColorChangeTarget; + half _ColorChangeTolerance, _ColorChangeLuminosity; + #endif + #if CHANGECOLOR2_ON + half4 _ColorChangeNewCol2, _ColorChangeTarget2; + half _ColorChangeTolerance2; + #endif + #if CHANGECOLOR3_ON + half4 _ColorChangeNewCol3, _ColorChangeTarget3; + half _ColorChangeTolerance3; + #endif + + #if COLORRAMP_ON + half _ColorRampLuminosity, _ColorRampBlend; + #endif + + #if HITEFFECT_ON + half4 _HitEffectColor; + half _HitEffectGlow, _HitEffectBlend; + #endif + + #if NEGATIVE_ON + half _NegativeAmount; + #endif + + #if PIXELATE_ON + half _PixelateSize; + #endif + + #if GREYSCALE_ON + half _GreyscaleLuminosity, _GreyscaleBlend; + half4 _GreyscaleTintColor; + #endif + + #if POSTERIZE_ON + half _PosterizeNumColors, _PosterizeGamma; + #endif + + #if BLUR_ON + half _BlurIntensity; + #endif + + #if MOTIONBLUR_ON + half _MotionBlurAngle, _MotionBlurDist; + #endif + + #if GHOST_ON + half _GhostColorBoost, _GhostTransparency, _GhostBlend; + #endif + + #if HOLOGRAM_ON + half _HologramStripesAmount, _HologramMinAlpha, _HologramUnmodAmount, _HologramStripesSpeed, _HologramMaxAlpha, _HologramBlend; + half4 _HologramStripeColor; + #endif + + #if CHROMABERR_ON + half _ChromAberrAmount, _ChromAberrAlpha; + #endif + + #if GLITCH_ON + half _GlitchAmount, _GlitchSize; + #endif + + #if FLICKER_ON + half _FlickerFreq, _FlickerPercent, _FlickerAlpha; + #endif + + #if SHADOW_ON + half _ShadowX, _ShadowY, _ShadowAlpha; + half4 _ShadowColor; + #endif + + #if SHINE_ON + half4 _ShineColor; + half _ShineLocation, _ShineRotate, _ShineWidth, _ShineGlow; + #endif + + #if CONTRAST_ON + half _Contrast, _Brightness; + #endif + + #if OVERLAY_ON + half4 _OverlayTex_ST, _OverlayColor; + half _OverlayGlow, _OverlayBlend, _OverlayTextureScrollXSpeed, _OverlayTextureScrollYSpeed; + #endif + + #if DOODLE_ON + half _HandDrawnAmount, _HandDrawnSpeed; + #endif + + #if WIND_ON + half _GrassSpeed, _GrassWind, _GrassManualAnim, _GrassRadialBend; + #endif + + #if WAVEUV_ON + float _WaveAmount, _WaveSpeed, _WaveStrength, _WaveX, _WaveY; + #endif + + #if ROUNDWAVEUV_ON + half _RoundWaveStrength, _RoundWaveSpeed; + #endif + + #if RECTSIZE_ON + half _RectSize; + #endif + + #if OFFSETUV_ON + half _OffsetUvX, _OffsetUvY; + #endif + + #if CLIPPING_ON + half _ClipUvLeft, _ClipUvRight, _ClipUvUp, _ClipUvDown; + #endif + + #if RADIALCLIPPING_ON + half _RadialStartAngle, _RadialClip, _RadialClip2; + #endif + + #if TEXTURESCROLL_ON + half _TextureScrollXSpeed, _TextureScrollYSpeed; + #endif + + #if ZOOMUV_ON + half _ZoomUvAmount; + #endif + + #if WARP_ON + half _WarpStrength, _WarpSpeed, _WarpScale; + #endif + + #if TWISTUV_ON + half _TwistUvAmount, _TwistUvPosX, _TwistUvPosY, _TwistUvRadius; + #endif + + #if ROTATEUV_ON + half _RotateUvAmount; + #endif + + #if FISHEYE_ON + half _FishEyeUvAmount; + #endif + + #if PINCH_ON + half _PinchUvAmount; + #endif + + #if SHAKEUV_ON + half _ShakeUvSpeed, _ShakeUvX, _ShakeUvY; + #endif + + #if NORMALMAP_ON + half _NormalStrength; + #endif + + float _RandomSeed; + + + + + CBUFFER_END + + + + // -- Property used by ScenePickingPass + #ifdef SCENEPICKINGPASS + float4 _SelectionID; + #endif + + // -- Properties used by SceneSelectionPass + #ifdef SCENESELECTIONPASS + int _ObjectId; + int _PassValue; + #endif + + + // data across stages, stripped like the above. + struct VertexToPixel + { + float4 pos : SV_POSITION; + float3 worldPos : TEXCOORD0; + float3 worldNormal : TEXCOORD1; + float4 worldTangent : TEXCOORD2; + float4 texcoord0 : TEXCOORD3; + float4 texcoord1 : TEXCOORD4; + float4 texcoord2 : TEXCOORD5; + // #if %TEXCOORD3REQUIREKEY% + float4 texcoord3 : TEXCOORD6; + // #endif + + // #if %SCREENPOSREQUIREKEY% + // float4 screenPos : TEXCOORD7; + // #endif + + // #if %VERTEXCOLORREQUIREKEY% + float4 vertexColor : COLOR; + // #endif + + // #if %EXTRAV2F0REQUIREKEY% + // float4 extraV2F0 : TEXCOORD8; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // float4 extraV2F1 : TEXCOORD9; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // float4 extraV2F2 : TEXCOORD10; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // float4 extraV2F3 : TEXCOORD11; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // float4 extraV2F4 : TEXCOORD12; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // float4 extraV2F5 : TEXCOORD13; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // float4 extraV2F6 : TEXCOORD14; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // float4 extraV2F7 : TEXCOORD15; + // #endif + + #if UNITY_ANY_INSTANCING_ENABLED + UNITY_VERTEX_INPUT_INSTANCE_ID + #endif // UNITY_ANY_INSTANCING_ENABLED + + #if _HDRP && (_PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR))) + float4 previousPositionCS : TEXCOORD16; // Contain previous transform position (in case of skinning for example) + float4 motionVectorCS : TEXCOORD17; + #endif + + UNITY_VERTEX_OUTPUT_STEREO + }; + + + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Debug/DebugDisplay.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/Material.hlsl" + #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/NormalSurfaceGradient.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/Lit/Lit.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/BuiltinUtilities.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/MaterialUtilities.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/Decal/DecalUtilities.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/Lit/LitDecalData.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/ShaderGraphFunctions.hlsl" + + + + + // data describing the user output of a pixel + struct Surface + { + half3 Albedo; + half Height; + half3 Normal; + half Smoothness; + half3 Emission; + half Metallic; + half3 Specular; + half Occlusion; + half SpecularPower; // for simple lighting + half Alpha; + float outputDepth; // if written, SV_Depth semantic is used. ShaderData.clipPos.z is unused value + // HDRP Only + half SpecularOcclusion; + half SubsurfaceMask; + half Thickness; + half CoatMask; + half CoatSmoothness; + half Anisotropy; + half IridescenceMask; + half IridescenceThickness; + int DiffusionProfileHash; + float SpecularAAThreshold; + float SpecularAAScreenSpaceVariance; + // requires _OVERRIDE_BAKEDGI to be defined, but is mapped in all pipelines + float3 DiffuseGI; + float3 BackDiffuseGI; + float3 SpecularGI; + float ior; + float3 transmittanceColor; + float atDistance; + float transmittanceMask; + // requires _OVERRIDE_SHADOWMASK to be defines + float4 ShadowMask; + + // for decals + float NormalAlpha; + float MAOSAlpha; + + + }; + + // Data the user declares in blackboard blocks + struct Blackboard + { + + float blackboardDummyData; + }; + + // data the user might need, this will grow to be big. But easy to strip + struct ShaderData + { + float4 clipPos; // SV_POSITION + float3 localSpacePosition; + float3 localSpaceNormal; + float3 localSpaceTangent; + + float3 worldSpacePosition; + float3 worldSpaceNormal; + float3 worldSpaceTangent; + float tangentSign; + + float3 worldSpaceViewDir; + float3 tangentSpaceViewDir; + + float4 texcoord0; + float4 texcoord1; + float4 texcoord2; + float4 texcoord3; + + float2 screenUV; + float4 screenPos; + + float4 vertexColor; + bool isFrontFace; + + float4 extraV2F0; + float4 extraV2F1; + float4 extraV2F2; + float4 extraV2F3; + float4 extraV2F4; + float4 extraV2F5; + float4 extraV2F6; + float4 extraV2F7; + + float3x3 TBNMatrix; + Blackboard blackboard; + }; + + struct VertexData + { + #if SHADER_TARGET > 30 + // uint vertexID : SV_VertexID; + #endif + float4 vertex : POSITION; + float3 normal : NORMAL; + float4 tangent : TANGENT; + float4 texcoord0 : TEXCOORD0; + + // optimize out mesh coords when not in use by user or lighting system + #if _URP && (_USINGTEXCOORD1 || _PASSMETA || _PASSFORWARD || _PASSGBUFFER) + float4 texcoord1 : TEXCOORD1; + #endif + + #if _URP && (_USINGTEXCOORD2 || _PASSMETA || ((_PASSFORWARD || _PASSGBUFFER) && defined(DYNAMICLIGHTMAP_ON))) + float4 texcoord2 : TEXCOORD2; + #endif + + #if _STANDARD && (_USINGTEXCOORD1 || (_PASSMETA || ((_PASSFORWARD || _PASSGBUFFER || _PASSFORWARDADD) && LIGHTMAP_ON))) + float4 texcoord1 : TEXCOORD1; + #endif + #if _STANDARD && (_USINGTEXCOORD2 || (_PASSMETA || ((_PASSFORWARD || _PASSGBUFFER) && DYNAMICLIGHTMAP_ON))) + float4 texcoord2 : TEXCOORD2; + #endif + + + #if _HDRP + float4 texcoord1 : TEXCOORD1; + float4 texcoord2 : TEXCOORD2; + #endif + + // #if %TEXCOORD3REQUIREKEY% + float4 texcoord3 : TEXCOORD3; + // #endif + + // #if %VERTEXCOLORREQUIREKEY% + float4 vertexColor : COLOR; + // #endif + + #if _PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR)) + float3 previousPositionOS : TEXCOORD4; // Contain previous transform position (in case of skinning for example) + #if defined (_ADD_PRECOMPUTED_VELOCITY) + float3 precomputedVelocity : TEXCOORD5; // Add Precomputed Velocity (Alembic computes velocities on runtime side). + #endif + #endif + + UNITY_VERTEX_INPUT_INSTANCE_ID + }; + + struct TessVertex + { + float4 vertex : INTERNALTESSPOS; + float3 normal : NORMAL; + float4 tangent : TANGENT; + float4 texcoord0 : TEXCOORD0; + float4 texcoord1 : TEXCOORD1; + float4 texcoord2 : TEXCOORD2; + + // #if %TEXCOORD3REQUIREKEY% + float4 texcoord3 : TEXCOORD3; + // #endif + + // #if %VERTEXCOLORREQUIREKEY% + float4 vertexColor : COLOR; + // #endif + + // #if %EXTRAV2F0REQUIREKEY% + // float4 extraV2F0 : TEXCOORD5; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // float4 extraV2F1 : TEXCOORD6; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // float4 extraV2F2 : TEXCOORD7; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // float4 extraV2F3 : TEXCOORD8; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // float4 extraV2F4 : TEXCOORD9; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // float4 extraV2F5 : TEXCOORD10; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // float4 extraV2F6 : TEXCOORD11; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // float4 extraV2F7 : TEXCOORD12; + // #endif + + #if _PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR)) + float3 previousPositionOS : TEXCOORD13; // Contain previous transform position (in case of skinning for example) + #if defined (_ADD_PRECOMPUTED_VELOCITY) + float3 precomputedVelocity : TEXCOORD14; + #endif + #endif + + UNITY_VERTEX_INPUT_INSTANCE_ID + UNITY_VERTEX_OUTPUT_STEREO + }; + + struct ExtraV2F + { + float4 extraV2F0; + float4 extraV2F1; + float4 extraV2F2; + float4 extraV2F3; + float4 extraV2F4; + float4 extraV2F5; + float4 extraV2F6; + float4 extraV2F7; + Blackboard blackboard; + float4 time; + }; + + + float3 WorldToTangentSpace(ShaderData d, float3 normal) + { + return mul(d.TBNMatrix, normal); + } + + float3 TangentToWorldSpace(ShaderData d, float3 normal) + { + return mul(normal, d.TBNMatrix); + } + + // in this case, make standard more like SRPs, because we can't fix + // unity_WorldToObject in HDRP, since it already does macro-fu there + + #if _STANDARD + float3 TransformWorldToObject(float3 p) { return mul(unity_WorldToObject, float4(p, 1)); }; + float3 TransformObjectToWorld(float3 p) { return mul(unity_ObjectToWorld, float4(p, 1)); }; + float4 TransformWorldToObject(float4 p) { return mul(unity_WorldToObject, p); }; + float4 TransformObjectToWorld(float4 p) { return mul(unity_ObjectToWorld, p); }; + float4x4 GetWorldToObjectMatrix() { return unity_WorldToObject; } + float4x4 GetObjectToWorldMatrix() { return unity_ObjectToWorld; } + #if (defined(SHADER_API_D3D11) || defined(SHADER_API_XBOXONE) || defined(UNITY_COMPILER_HLSLCC) || defined(SHADER_API_PSSL) || (SHADER_TARGET_SURFACE_ANALYSIS && !SHADER_TARGET_SURFACE_ANALYSIS_MOJOSHADER)) + #define UNITY_SAMPLE_TEX2D_LOD(tex,coord, lod) tex.SampleLevel (sampler##tex,coord, lod) + #define UNITY_SAMPLE_TEX2D_SAMPLER_LOD(tex,samplertex,coord, lod) tex.SampleLevel (sampler##samplertex,coord, lod) + #else + #define UNITY_SAMPLE_TEX2D_LOD(tex,coord,lod) tex2D (tex,coord,0,lod) + #define UNITY_SAMPLE_TEX2D_SAMPLER_LOD(tex,samplertex,coord,lod) tex2D (tex,coord,0,lod) + #endif + + #undef GetWorldToObjectMatrix() + + #define GetWorldToObjectMatrix() unity_WorldToObject + + + #endif + + float3 GetCameraWorldPosition() + { + #if _HDRP + return GetCameraRelativePositionWS(_WorldSpaceCameraPos); + #else + return _WorldSpaceCameraPos; + #endif + } + + #if _GRABPASSUSED + #if _STANDARD + TEXTURE2D(%GRABTEXTURE%); + SAMPLER(sampler_%GRABTEXTURE%); + #endif + + half3 GetSceneColor(float2 uv) + { + #if _STANDARD + return SAMPLE_TEXTURE2D(%GRABTEXTURE%, sampler_%GRABTEXTURE%, uv).rgb; + #else + return SHADERGRAPH_SAMPLE_SCENE_COLOR(uv); + #endif + } + #endif + + + + #if _STANDARD + UNITY_DECLARE_DEPTH_TEXTURE(_CameraDepthTexture); + float GetSceneDepth(float2 uv) { return SAMPLE_DEPTH_TEXTURE(_CameraDepthTexture, uv); } + float GetLinear01Depth(float2 uv) { return Linear01Depth(GetSceneDepth(uv)); } + float GetLinearEyeDepth(float2 uv) { return LinearEyeDepth(GetSceneDepth(uv)); } + #else + float GetSceneDepth(float2 uv) { return SHADERGRAPH_SAMPLE_SCENE_DEPTH(uv); } + float GetLinear01Depth(float2 uv) { return Linear01Depth(GetSceneDepth(uv), _ZBufferParams); } + float GetLinearEyeDepth(float2 uv) { return LinearEyeDepth(GetSceneDepth(uv), _ZBufferParams); } + #endif + + float3 GetWorldPositionFromDepthBuffer(float2 uv, float3 worldSpaceViewDir) + { + float eye = GetLinearEyeDepth(uv); + float3 camView = mul((float3x3)GetObjectToWorldMatrix(), transpose(mul(GetWorldToObjectMatrix(), UNITY_MATRIX_I_V)) [2].xyz); + + float dt = dot(worldSpaceViewDir, camView); + float3 div = worldSpaceViewDir/dt; + float3 wpos = (eye * div) + GetCameraWorldPosition(); + return wpos; + } + + #if _HDRP + float3 ObjectToWorldSpacePosition(float3 pos) + { + return GetAbsolutePositionWS(TransformObjectToWorld(pos)); + } + #else + float3 ObjectToWorldSpacePosition(float3 pos) + { + return TransformObjectToWorld(pos); + } + #endif + + #if _STANDARD + UNITY_DECLARE_SCREENSPACE_TEXTURE(_CameraDepthNormalsTexture); + float3 GetSceneNormal(float2 uv, float3 worldSpaceViewDir) + { + float4 depthNorms = UNITY_SAMPLE_SCREENSPACE_TEXTURE(_CameraDepthNormalsTexture, uv); + float3 norms = DecodeViewNormalStereo(depthNorms); + norms = mul((float3x3)GetWorldToViewMatrix(), norms) * 0.5 + 0.5; + return norms; + } + #elif _HDRP && !_DECALSHADER + + float3 GetSceneNormal(float2 uv, float3 worldSpaceViewDir) + { + NormalData nd; + DecodeFromNormalBuffer(_ScreenSize.xy * uv, nd); + return nd.normalWS; + } + #elif _URP + #if (SHADER_LIBRARY_VERSION_MAJOR >= 10) + #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/DeclareNormalsTexture.hlsl" + #endif + + float3 GetSceneNormal(float2 uv, float3 worldSpaceViewDir) + { + #if (SHADER_LIBRARY_VERSION_MAJOR >= 10) + return SampleSceneNormals(uv); + #else + float3 wpos = GetWorldPositionFromDepthBuffer(uv, worldSpaceViewDir); + return normalize(-cross(ddx(wpos), ddy(wpos))) * 0.5 + 0.5; + #endif + + } + #endif + + #if _HDRP + + half3 UnpackNormalmapRGorAG(half4 packednormal) + { + // This do the trick + packednormal.x *= packednormal.w; + + half3 normal; + normal.xy = packednormal.xy * 2 - 1; + normal.z = sqrt(1 - saturate(dot(normal.xy, normal.xy))); + return normal; + } + half3 UnpackNormal(half4 packednormal) + { + #if defined(UNITY_NO_DXT5nm) + return packednormal.xyz * 2 - 1; + #else + return UnpackNormalmapRGorAG(packednormal); + #endif + } + #endif + #if _HDRP || _URP + + half3 UnpackScaleNormal(half4 packednormal, half scale) + { + #ifndef UNITY_NO_DXT5nm + // Unpack normal as DXT5nm (1, y, 1, x) or BC5 (x, y, 0, 1) + // Note neutral texture like "bump" is (0, 0, 1, 1) to work with both plain RGB normal and DXT5nm/BC5 + packednormal.x *= packednormal.w; + #endif + half3 normal; + normal.xy = (packednormal.xy * 2 - 1) * scale; + normal.z = sqrt(1 - saturate(dot(normal.xy, normal.xy))); + return normal; + } + + #endif + + + void GetSun(out float3 lightDir, out float3 color) + { + lightDir = float3(0.5, 0.5, 0); + color = 1; + #if _HDRP + if (_DirectionalLightCount > 0) + { + DirectionalLightData light = _DirectionalLightDatas[0]; + lightDir = -light.forward.xyz; + color = light.color; + } + #elif _STANDARD + lightDir = normalize(_WorldSpaceLightPos0.xyz); + color = _LightColor0.rgb; + #elif _URP + Light light = GetMainLight(); + lightDir = light.direction; + color = light.color; + #endif + } + + + + + + + + + + TEXTURE2D(_MainTex); + SAMPLER(sampler_MainTex); + + #if GLOW_ON + TEXTURE2D(_GlowTex); + SAMPLER(sampler_GlowTex); + #endif + + #if FADE_ON + TEXTURE2D(_FadeTex); + SAMPLER(sampler_FadeTex); + + TEXTURE2D(_FadeBurnTex); + SAMPLER(sampler_FadeBurnTex); + #endif + + #if DISTORT_ON + TEXTURE2D(_DistortTex); + SAMPLER(sampler_DistortTex); + #endif + + #if OUTTEX_ON + TEXTURE2D(_OutlineTex); + SAMPLER(sampler_OutlineTex); + #endif + + #if OUTDIST_ON + TEXTURE2D(_OutlineDistortTex); + SAMPLER(sampler_OutlineDistortTex); + #endif + + #if COLORSWAP_ON + TEXTURE2D(_ColorSwapTex); + SAMPLER(sampler_ColorSwapTex); + #endif + + #if COLORRAMP_ON + TEXTURE2D(_ColorRampTex); + TEXTURE2D(_ColorRampTexGradient); + SAMPLER(sampler_ColorRampTex); + SAMPLER(sampler_ColorRampTexGradient); + #endif + + #if SHINE_ON + TEXTURE2D(_ShineMask); + SAMPLER(sampler_ShineMask); + #endif + + #if OVERLAY_ON + TEXTURE2D(_OverlayTex); + SAMPLER(sampler_OverlayTex); + #endif + + #if NORMALMAP_ON + TEXTURE2D(_NormalMap); + SAMPLER(sampler_NormalMap); + #endif + + + half3 GetPixel(in int offsetX, in int offsetY, in half2 uv, in Texture2D _tex, in SamplerState _sampler) + { + half2 _uv = uv + half2(offsetX * _MainTex_TexelSize.x, offsetY * _MainTex_TexelSize.y); + half4 col = SAMPLE_TEXTURE2D(_tex, _sampler, _uv); + return col.rgb; + } + + + //BLURS------------------------------------------------------------------------- + half4 Blur(half2 uv, Texture2D source, SamplerState sampler_source, half Intensity) + { + const half2 texelSize = 1.0 / _ScreenParams.xy; + const half4 color = SAMPLE_TEXTURE2D(source, sampler_source, uv); + const half2 offset = Intensity * texelSize; + + half4 accumulatedColor = color; + half accumulatedWeight = 1.0; + for (int x = -1; x <= 1; x++) + { + for (int y = -1; y <= 1; y++) + { + const half2 sampleUV = uv + half2(x, y) * offset; + const half4 sampleColor = SAMPLE_TEXTURE2D(source, sampler_source, sampleUV); + + accumulatedColor += sampleColor; + accumulatedWeight += 1.0; + } + } + + half4 blurredColor = accumulatedColor / accumulatedWeight; + return blurredColor; + } + + half BlurHD_G(half bhqp, half x) + { + return exp(-(x * x) / (2.0 * bhqp * bhqp)); + } + half4 BlurHD(half2 uv, Texture2D source, SamplerState sampler_source, half BlurAmount, half xScale, half yScale) + { + int iterations = 16; + int halfIterations = iterations / 2; + half sigmaX = 0.1 + BlurAmount * 0.5; + half sigmaY = sigmaX; + half total = 0.0; + half4 ret = half4(0, 0, 0, 0); + for (int iy = 0; iy < iterations; ++iy) + { + half fy = BlurHD_G(sigmaY, half(iy) -half(halfIterations)); + half offsetY = half(iy - halfIterations) * 0.00390625 * xScale; + for (int ix = 0; ix < iterations; ++ix) + { + half fx = BlurHD_G(sigmaX, half(ix) - half(halfIterations)); + half offsetX = half(ix - halfIterations) * 0.00390625 * yScale; + total += fx * fy; + ret += SAMPLE_TEXTURE2D(source, sampler_source, uv + half2(offsetX, offsetY)) * fx * fy; + } + } + return ret / total; + } + //----------------------------------------------------------------------- + + + //------------------------------------------- + half RemapFloat(half inValue, half inMin, half inMax, half outMin, half outMax){ + return outMin + (inValue - inMin) * (outMax - outMin) / (inMax - inMin); + } + //------------------------------------------- + + //----------------------------------------------------------------------- + half rand(half2 seed, half offset) { + return (frac(sin(dot(seed, half2(12.9898, 78.233))) * 43758.5453) + offset) % 1.0; + } + + half rand2(half2 seed, half offset) { + return (frac(sin(dot(seed * floor(50 + (_Time.x % 1.0) * 12.), half2(127.1, 311.7))) * 43758.5453123) + offset) % 1.0; + } + + half rand2CustomTime(half2 seed, half offset, half customTime) { + return (frac(sin(dot(seed * floor(50 + (customTime % 1.0) * 12.), half2(127.1, 311.7))) * 43758.5453123) + offset) % 1.0; + } + //----------------------------------------------------------------------- + + + void Ext_ModifyVertex0 (inout VertexData v, inout ExtraV2F d) + { + //BILBOARD_ON + #if BILBOARD_ON + half3 camRight = mul((half3x3)unity_CameraToWorld, half3(1,0,0)); + half3 camUp = half3(0,1,0); + #if BILBOARDY_ON + camUp = mul((half3x3)unity_CameraToWorld, half3(0,1,0)); + #endif + half3 localPos = v.vertex.x * camRight + v.vertex.y * camUp; + v.vertex = half4(localPos, 1); + #endif + //----------------------------------------------------------- + + v.texcoord0.xy = TRANSFORM_TEX(v.texcoord0.xy, _MainTex); + half2 center = half2(0.5, 0.5); + #if ATLAS_ON + center = half2((_MaxXUV + _MinXUV) / 2.0, (_MaxYUV + _MinYUV) / 2.0); + #endif + + //POLARUV_ON + #if POLARUV_ON + v.texcoord0.xy = v.texcoord0.xy - center; + #endif + + //---------------------------------------- + + //ROTATEUV_ON + #if ROTATEUV_ON + half2 uvC = v.texcoord0.xy; + half cosAngle = cos(_RotateUvAmount); + half sinAngle = sin(_RotateUvAmount); + half2x2 rot = half2x2(cosAngle, -sinAngle, sinAngle, cosAngle); + uvC -= center; + v.texcoord0.xy = mul(rot, uvC); + v.texcoord0.xy += center; + #endif + //-------------------- + + #if RECTSIZE_ON + v.vertex.xyz += (v.vertex.xyz * (_RectSize - 1.0)); + #endif + + #if OUTTEX_ON + v.texcoord1.xy = TRANSFORM_TEX(v.texcoord0.xy, _OutlineTex); + #endif + + #if OUTDIST_ON + v.texcoord2.xy = TRANSFORM_TEX(v.texcoord0.xy, _OutlineDistortTex); + #endif + + #if DISTORT_ON + v.texcoord3.xy = TRANSFORM_TEX(v.texcoord0.xy, _DistortTex); + #endif + } + + void Ext_SurfaceFunction0 (inout Surface o, ShaderData d) + { + half randomSeed = _RandomSeed; + + float2 uvRect = d.texcoord0; + half2 center = half2(0.5, 0.5); + #if ATLAS_ON + center = half2((_MaxXUV + _MinXUV) / 2.0, (_MaxYUV + _MinYUV) / 2.0); + uvRect = half2((d.texcoord0.x - _MinXUV) / (_MaxXUV - _MinXUV), (d.texcoord0.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half2 centerTiled = half2(center.x * _MainTex_ST.x, center.y * _MainTex_ST.y); + + //CLIPPING_ON + #if CLIPPING_ON + half2 tiledUv = half2(d.texcoord0.x / _MainTex_ST.x, d.texcoord0.y / _MainTex_ST.y); + #if ATLAS_ON + tiledUv = half2((tiledUv.x - _MinXUV) / (_MaxXUV - _MinXUV), (tiledUv.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + clip((1 - _ClipUvUp) - tiledUv.y); + clip(tiledUv.y - _ClipUvDown); + clip((1 - _ClipUvRight) - tiledUv.x); + clip(tiledUv.x - _ClipUvLeft); + #endif + //---------------------------------- + + //RADIALCLIPPING_ON + #if RADIALCLIPPING_ON + half2 tiledUv2 = half2(d.texcoord0.x / _MainTex_ST.x, d.texcoord0.y / _MainTex_ST.y); + #if ATLAS_ON + tiledUv2 = half2((tiledUv2.x - _MinXUV) / (_MaxXUV - _MinXUV), (tiledUv2.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half startAngle = _RadialStartAngle - _RadialClip; + half endAngle = _RadialStartAngle + _RadialClip2; + half offset0 = clamp(0, 360, startAngle + 360); + half offset360 = clamp(0, 360, endAngle - 360); + half2 atan2Coord = half2(lerp(-1, 1, tiledUv2.x), lerp(-1, 1, tiledUv2.y)); + half atanAngle = atan2(atan2Coord.y, atan2Coord.x) * 57.3; // angle in degrees + if(atanAngle < 0) atanAngle = 360 + atanAngle; + if(atanAngle >= startAngle && atanAngle <= endAngle) discard; + if(atanAngle <= offset360) discard; + if(atanAngle >= offset0) discard; + #endif + + //----------------------------- + + //TEXTURESCROLL_ON && ATLAS_ON + #if TEXTURESCROLL_ON && ATLAS_ON + d.texcoord0.xy = half2(_MinXUV + ((_MaxXUV - _MinXUV) * (abs(((_Time.y + randomSeed) * _TextureScrollXSpeed) + uvRect.x) % 1)), + _MinYUV + ((_MaxYUV - _MinYUV) * (abs(((_Time.y + randomSeed) * _TextureScrollYSpeed) + uvRect.y) % 1))); + #endif + //---------------------------- + + //OFFSETUV_ON + #if OFFSETUV_ON + #if ATLAS_ON + d.texcoord0.xy = half2(_MinXUV + ((_MaxXUV - _MinXUV) * (abs((_OffsetUvX + uvRect.x) % 1))), + _MinYUV + ((_MaxYUV - _MinYUV) * (abs(_OffsetUvY + uvRect.y) % 1))); + #else + d.texcoord0.xy += half2(_OffsetUvX, _OffsetUvY); + #endif + #endif + + //---------------------- + + //POLARUV_ON + #if POLARUV_ON + d.texcoord0.xy = half2(atan2(d.texcoord0.y, d.texcoord0.x) / (2.0f * 3.141592653589f), length(d.texcoord0.xy)); + d.texcoord0.xy *= _MainTex_ST.xy; + #endif + + //-------------------------------------- + + //TWISTUV_ON + #if TWISTUV_ON + #if ATLAS_ON + _TwistUvPosX = ((_MaxXUV - _MinXUV) * _TwistUvPosX) + _MinXUV; + _TwistUvPosY = ((_MaxYUV - _MinYUV) * _TwistUvPosY) + _MinYUV; + #endif + half2 tempUv = d.texcoord0.xy - half2(_TwistUvPosX * _MainTex_ST.x, _TwistUvPosY * _MainTex_ST.y); + _TwistUvRadius *= (_MainTex_ST.x + _MainTex_ST.y) / 2; + half percent = (_TwistUvRadius - length(tempUv)) / _TwistUvRadius; + half theta = percent * percent * (2.0 * sin(_TwistUvAmount)) * 8.0; + half s = sin(theta); + half c = cos(theta); + half beta = max(sign(_TwistUvRadius - length(tempUv)), 0.0); + tempUv = half2(dot(tempUv, half2(c, -s)), dot(tempUv, half2(s, c))) * beta + tempUv * (1 - beta); + tempUv += half2(_TwistUvPosX * _MainTex_ST.x, _TwistUvPosY * _MainTex_ST.y); + d.texcoord0.xy = tempUv; + #endif + + //-------------------------------------------- + + //FISHEYE_ON + #if FISHEYE_ON + half bind = length(centerTiled); + half2 dF = d.texcoord0.xy - centerTiled; + half dFlen = length(dF); + half fishInt = (3.14159265359 / bind) * (_FishEyeUvAmount + 0.001); + d.texcoord0.xy = centerTiled + (dF / (max(0.0001, dFlen))) * tan(dFlen * fishInt) * bind / tan(bind * fishInt); + #endif + //--------------------------------------------- + + //PINCH_ON + #if PINCH_ON + half2 dP = d.texcoord0.xy - centerTiled; + half pinchInt = (3.141592 / length(centerTiled)) * (-_PinchUvAmount + 0.001); + d.texcoord0.xy = centerTiled + normalize(dP) * atan(length(dP) * -pinchInt * 10.0) * 0.5 / atan(-pinchInt * 5); + #endif + + //--------------------------------------------- + + //ZOOMUV_ON + #if ZOOMUV_ON + d.texcoord0.xy -= centerTiled; + d.texcoord0.xy = d.texcoord0.xy * _ZoomUvAmount; + d.texcoord0.xy += centerTiled; + #endif + + //----------------------------------------------- + + //DOODLE_ON + #if DOODLE_ON + half2 uvCopy = uvRect; + _HandDrawnSpeed = (floor((_Time.x + randomSeed) * 20 * _HandDrawnSpeed) / _HandDrawnSpeed) * _HandDrawnSpeed; + uvCopy.x = sin((uvCopy.x * _HandDrawnAmount + _HandDrawnSpeed) * 4); + uvCopy.y = cos((uvCopy.y * _HandDrawnAmount + _HandDrawnSpeed) * 4); + d.texcoord0.xy = lerp(d.texcoord0.xy, d.texcoord0.xy + uvCopy, 0.0005 * _HandDrawnAmount); + #endif + + //-------------------------- + + //SHAKEUV_ON + #if SHAKEUV_ON + half xShake = sin((_Time.x + randomSeed) * _ShakeUvSpeed * 50) * _ShakeUvX; + half yShake = cos((_Time.x + randomSeed) * _ShakeUvSpeed * 50) * _ShakeUvY; + d.texcoord0.xy += half2(xShake * 0.012, yShake * 0.01); + #endif + + //------------------------------------------- + + //RECTSIZE_ON + #if RECTSIZE_ON + d.texcoord0.xy = d.texcoord0.xy * (_RectSize).xx + (((-_RectSize * 0.5) + 0.5)).xx; + #endif + + //------------------------------------------- + + //DISTORT_ON + #if DISTORT_ON + #if ATLAS_ON + d.texcoord3.x = d.texcoord3.x * (1 / (_MaxXUV - _MinXUV)); + d.texcoord3.y = d.texcoord3.y * (1 / (_MaxYUV - _MinYUV)); + #endif + + d.texcoord3.x += ((_Time.x + _RandomSeed) * _DistortTexXSpeed) % 1; + d.texcoord3.y += ((_Time.x + _RandomSeed) * _DistortTexYSpeed) % 1; + half distortAmnt = (SAMPLE_TEXTURE2D(_DistortTex, sampler_DistortTex, d.texcoord3.xy).r - 0.5) * 0.2 * _DistortAmount; + d.texcoord0.x += distortAmnt; + d.texcoord0.y += distortAmnt; + #endif + //------------------------------------------------------- + + //WARP_ON + #if WARP_ON + half2 warpUv = half2(d.texcoord0.x / _MainTex_ST.x, d.texcoord0.y / _MainTex_ST.y); + #if ATLAS_ON + warpUv = half2((warpUv.x - _MinXUV) / (_MaxXUV - _MinXUV), (warpUv.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + const float tau = 6.283185307179586; + float xWarp = (_Time.y + randomSeed) * _WarpSpeed + warpUv.x * tau / _WarpScale; + float yWarp = (_Time.y + randomSeed) * _WarpSpeed + warpUv.y * tau / _WarpScale; + float2 warp = float2(sin(xWarp), sin(yWarp)) * _WarpStrength; + d.texcoord0.xy += warp; + #endif + + //------------------------------------------------------- + + //WAVEUV_ON + #if WAVEUV_ON + float2 uvWave = half2(_WaveX * _MainTex_ST.x, _WaveY * _MainTex_ST.y) - d.texcoord0.xy; + uvWave %= 1; + #if ATLAS_ON + uvWave = half2(_WaveX, _WaveY) - uvRect; + #endif + uvWave.x *= _ScreenParams.x / _ScreenParams.y; + float waveTime = _Time.y + randomSeed; + float angWave = (sqrt(dot(uvWave, uvWave)) * _WaveAmount) - ((waveTime * _WaveSpeed)); + d.texcoord0.xy = d.texcoord0.xy + uvWave * sin(angWave) * (_WaveStrength / 1000.0); + #endif + //---------------------------------------------------- + + //ROUNDWAVEUV_ON + #if ROUNDWAVEUV_ON + half xWave = ((0.5 * _MainTex_ST.x) - uvRect.x); + half yWave = ((0.5 * _MainTex_ST.y) - uvRect.y) * (_MainTex_TexelSize.w / _MainTex_TexelSize.z); + half ripple = -sqrt(xWave*xWave + yWave* yWave); + d.texcoord0.xy += (sin((ripple + (_Time.y + randomSeed) * (_RoundWaveSpeed/10.0)) / 0.015) * (_RoundWaveStrength/10.0)) % 1; + #endif + //---------------------------------------------------- + + + //WIND_ON + #if WIND_ON + half windOffset = sin((_Time.x + randomSeed) * _GrassSpeed * 10); + half2 windCenter = half2(0.5, 0.1); + #if ATLAS_ON + windCenter.x = ((_MaxXUV - _MinXUV) * windCenter.x) + _MinXUV; + windCenter.y = ((_MaxYUV - _MinYUV) * windCenter.y) + _MinYUV; + #endif + #if !MANUALWIND_ON + d.texcoord0.x = fmod(abs(lerp(d.texcoord0.x, d.texcoord0.x + (_GrassWind * 0.01 * windOffset), uvRect.y)), 1); + #else + d.texcoord0.x = fmod(abs(lerp(d.texcoord0.x, d.texcoord0.x + (_GrassWind * 0.01 * _GrassManualAnim), uvRect.y)), 1); + windOffset = _GrassManualAnim; + #endif + half2 delta = d.texcoord0.xy - windCenter; + half delta2 = dot(delta.xy, delta.xy); + half2 delta_offset = delta2 * windOffset; + d.texcoord0.xy = d.texcoord0.xy + half2(delta.y, -delta.x) * delta_offset * _GrassRadialBend; + #endif + + //-------------------------------------------------------- + + //TEXTURESCROLL_ON && !ATLAS_ON + #if TEXTURESCROLL_ON && !ATLAS_ON + d.texcoord0.x += ((_Time.y + randomSeed) * _TextureScrollXSpeed) % 1; + d.texcoord0.y += ((_Time.y + randomSeed) * _TextureScrollYSpeed) % 1; + #endif + //------------------------------ + + //PIXELATE_ON + #if PIXELATE_ON + half aspectRatio = _MainTex_TexelSize.x / _MainTex_TexelSize.y; + half2 pixelSize = float2(_PixelateSize, _PixelateSize * aspectRatio); + d.texcoord0.xy = floor(d.texcoord0.xy * pixelSize) / pixelSize; + #endif + //-------------- + + half4 col = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy); + half originalAlpha = col.a; + col *= d.vertexColor; + + //NORMAL MAP + #if NORMALMAP_ON + half4 normalSample = SAMPLE_TEXTURE2D(_NormalMap, sampler_NormalMap, d.texcoord0.xy); + half3 normalTS = UnpackNormal(normalSample); + normalTS.xy *= _NormalStrength; + o.Normal = normalTS; + #endif + + + //GLITCH_ON + #if GLITCH_ON + half2 uvGlitch = uvRect; + uvGlitch.y -= 0.5; + half lineNoise = pow(rand2(floor(uvGlitch * half2(24., 19.) * _GlitchSize) * 4.0, randomSeed), 3.0) * _GlitchAmount + * pow(rand2(floor(uvGlitch * half2(38., 14.) * _GlitchSize) * 4.0, randomSeed), 3.0); + col = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(lineNoise * 0.02 * rand2(half2(2.0, 1), randomSeed), 0)) * d.vertexColor; + #endif + //-------------------------------------- + + //CHROMABERR_ON + #if CHROMABERR_ON + half4 r = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(_ChromAberrAmount/10, 0)) * d.vertexColor; + half4 b = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(-_ChromAberrAmount/10, 0)) * d.vertexColor; + col = half4(r.r * r.a, col.g, b.b * b.a, max(max(r.a, b.a) * _ChromAberrAlpha, col.a)); + #endif + + //-------------------------------- + + //BLUR_ON + #if BLUR_ON + #if ATLAS_ON + #if !BLURISHD_ON + col = BlurHD(d.texcoord0.xy, _MainTex, sampler_MainTex, _BlurIntensity, (_MaxXUV - _MinXUV), (_MaxYUV - _MinYUV)) * d.vertexColor; + #else + col = Blur(d.texcoord0.xy, _MainTex, sampler_MainTex, _BlurIntensity * (_MaxXUV - _MinXUV)) * d.vertexColor; + #endif + #else + #if !BLURISHD_ON + col = BlurHD(d.texcoord0.xy, _MainTex, sampler_MainTex, _BlurIntensity, 1, 1) * d.vertexColor; + #else + col = Blur(d.texcoord0.xy, _MainTex, sampler_MainTex, _BlurIntensity) * d.vertexColor; + #endif + #endif + #endif + + //-------------------- + + //MOTIONBLUR_ON + #if MOTIONBLUR_ON + _MotionBlurAngle = _MotionBlurAngle * 3.1415926; + #define rot(n) mul(n, half2x2(cos(_MotionBlurAngle), -sin(_MotionBlurAngle), sin(_MotionBlurAngle), cos(_MotionBlurAngle))) + _MotionBlurDist = _MotionBlurDist * 0.005; + #if ATLAS_ON + _MotionBlurDist *= (_MaxXUV - _MinXUV); + #endif + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(-_MotionBlurDist, -_MotionBlurDist))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(-_MotionBlurDist * 2, -_MotionBlurDist * 2))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(-_MotionBlurDist * 3, -_MotionBlurDist * 3))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(-_MotionBlurDist * 4, -_MotionBlurDist * 4))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(_MotionBlurDist, _MotionBlurDist))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(_MotionBlurDist * 2, _MotionBlurDist * 2))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(_MotionBlurDist * 3, _MotionBlurDist * 3))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(_MotionBlurDist * 4, _MotionBlurDist * 4))); + col.rgb = col.rgb / 9; + #endif + //------------------------------------ + + //NEGATIVE_ON + #if NEGATIVE_ON + col.rgb = lerp(col.rgb, 1 - col.rgb, _NegativeAmount); + #endif + + //-------------- + half luminance = 0; + + //GREYSCALE_ON && !GREYSCALEOUTLINE_ON + #if GREYSCALE_ON && !GREYSCALEOUTLINE_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + luminance = saturate(luminance + _GreyscaleLuminosity); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _GreyscaleTintColor, _GreyscaleBlend); + #endif + //------------------------------------ + + //GHOST_ON + #if GHOST_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + half4 ghostResult; + ghostResult.a = saturate(luminance - _GhostTransparency) * col.a; + ghostResult.rgb = col.rgb * (luminance + _GhostColorBoost); + col = lerp(col, ghostResult, _GhostBlend); + #endif + //------------------------------------ + + //INNEROUTLINE_ON + #if INNEROUTLINE_ON + half3 innerT = abs(GetPixel(0, _InnerOutlineThickness, d.texcoord0.xy, _MainTex, sampler_MainTex) - GetPixel(0, -_InnerOutlineThickness, d.texcoord0.xy, _MainTex, sampler_MainTex)); + innerT += abs(GetPixel(_InnerOutlineThickness, 0, d.texcoord0.xy, _MainTex, sampler_MainTex) - GetPixel(-_InnerOutlineThickness, 0, d.texcoord0.xy, _MainTex, sampler_MainTex)); + #if !ONLYINNEROUTLINE_ON + innerT = (innerT / 2.0) * col.a * _InnerOutlineAlpha; + col.rgb += length(innerT) * _InnerOutlineColor.rgb * _InnerOutlineGlow; + #else + innerT *= col.a * _InnerOutlineAlpha; + col.rgb = length(innerT) * _InnerOutlineColor.rgb * _InnerOutlineGlow; + col.a = step(0.3, col.r+col.g+col.b); + #endif + #endif + //------------------------------------------------------- + + //HITEFFECT_ON + #if HITEFFECT_ON + col.rgb = lerp(col.rgb, _HitEffectColor.rgb * _HitEffectGlow, _HitEffectBlend); + #endif + //-------------------- + + //GRADIENT_ON + #if GRADIENT_ON + half2 tiledUvGrad = half2(uvRect.x / _MainTex_ST.x, uvRect.y / _MainTex_ST.y); + #if GRADIENT2COL_ON + _GradTopRightCol = _GradTopLeftCol; + _GradBotRightCol = _GradBotLeftCol; + #endif + #if RADIALGRADIENT_ON + half radialDist = 1 - length(tiledUvGrad - half2(0.5, 0.5)); + radialDist *= (_MainTex_TexelSize.w / _MainTex_TexelSize.z); + radialDist = saturate(_GradBoostX * radialDist); + half4 gradientResult = lerp(_GradTopLeftCol, _GradBotLeftCol, radialDist); + #else + half gradXLerpFactor = saturate(pow(tiledUvGrad.x, _GradBoostX)); + half4 gradientResult = lerp(lerp(_GradBotLeftCol, _GradBotRightCol, gradXLerpFactor), + lerp(_GradTopLeftCol, _GradTopRightCol, gradXLerpFactor), saturate(pow(tiledUvGrad.y, _GradBoostY))); + #endif + gradientResult = lerp(col, gradientResult, _GradBlend); + col.rgb = gradientResult.rgb * col.a; + col.a *= gradientResult.a; + #endif + //-------------------------------------------------------------------- + + //CONTRAST_ON + #if CONTRAST_ON + col.rgb = (col.rgb - float3(0.5, 0.5, 0.5)) * _Contrast + float3(0.5, 0.5, 0.5); + col.rgb += _Brightness; + #endif + + //------------------------------------------------------------------- + + //COLORSWAP_ON + #if COLORSWAP_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + half4 swapMask = SAMPLE_TEXTURE2D(_ColorSwapTex, sampler_ColorSwapTex, d.texcoord0.xy); + swapMask.rgb *= swapMask.a; + half3 redSwap = _ColorSwapRed * swapMask.r * saturate(luminance + _ColorSwapRedLuminosity); + half3 greenSwap = _ColorSwapGreen * swapMask.g * saturate(luminance + _ColorSwapGreenLuminosity); + half3 blueSwap = _ColorSwapBlue * swapMask.b * saturate(luminance + _ColorSwapBlueLuminosity); + swapMask.rgb = col.rgb * saturate(1 - swapMask.r - swapMask.g - swapMask.b); + col.rgb = lerp(col.rgb, swapMask.rgb + redSwap + greenSwap + blueSwap, _ColorSwapBlend); + #endif + //-------------------------------------------------------------------- + + //COLORRAMP_ON && !COLORRAMPOUTLINE_ON + #if COLORRAMP_ON && !COLORRAMPOUTLINE_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + luminance = saturate(luminance + _ColorRampLuminosity); + #if GRADIENTCOLORRAMP_ON + col.rgb = lerp(col.rgb, SAMPLE_TEXTURE2D(_ColorRampTexGradient, sampler_ColorRampTexGradient, half2(luminance, 0)).rgb, _ColorRampBlend); + #else + col.rgb = lerp(col.rgb, SAMPLE_TEXTURE2D(_ColorRampTex, sampler_ColorRampTex, half2(luminance, 0)).rgb, _ColorRampBlend); + #endif + #endif + //-------------------------------------------------------------------- + + //CHANGECOLOR_ON + #if CHANGECOLOR_ON + float3 currChangeColor = saturate(col.rgb); + luminance = 0.3 * currChangeColor.r + 0.59 * currChangeColor.g + 0.11 * currChangeColor.b; + luminance = saturate(luminance + _ColorChangeLuminosity); + half3 dif = abs(currChangeColor - _ColorChangeTarget.rgb); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _ColorChangeNewCol.rgb, + max(sign(1 - saturate(dif.x + dif.y + dif.z) - _ColorChangeTolerance), 0.0)); + #if CHANGECOLOR2_ON + dif = abs(currChangeColor - _ColorChangeTarget2.rgb); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _ColorChangeNewCol2.rgb, + max(sign(1 - saturate(dif.x + dif.y + dif.z) - _ColorChangeTolerance2), 0.0)); + #endif + #if CHANGECOLOR3_ON + dif = abs(currChangeColor - _ColorChangeTarget3.rgb); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _ColorChangeNewCol3.rgb, + max(sign(1 - saturate(dif.x + dif.y + dif.z) - _ColorChangeTolerance3), 0.0)); + #endif + #endif + //------------------------------------------------------- + + //POSTERIZE_ON && !POSTERIZEOUTLINE_ON + #if POSTERIZE_ON && !POSTERIZEOUTLINE_ON + col.rgb = pow(col.rgb, _PosterizeGamma) * _PosterizeNumColors; + col.rgb = floor(col.rgb) / _PosterizeNumColors; + col.rgb = pow(col.rgb, 1.0 / _PosterizeGamma); + #endif + //------------------------------------ + + //HSV_ON + #if HSV_ON + half3 resultHsv = half3(col.rgb); + half cosHsv = _HsvBright * _HsvSaturation * cos(_HsvShift * 3.14159265 / 180); + half sinHsv = _HsvBright * _HsvSaturation * sin(_HsvShift * 3.14159265 / 180); + resultHsv.x = (.299 * _HsvBright + .701 * cosHsv + .168 * sinHsv) * col.x + + (.587 * _HsvBright - .587 * cosHsv + .330 * sinHsv) * col.y + + (.114 * _HsvBright - .114 * cosHsv - .497 * sinHsv) * col.z; + resultHsv.y = (.299 * _HsvBright - .299 * cosHsv - .328 * sinHsv) *col.x + + (.587 * _HsvBright + .413 * cosHsv + .035 * sinHsv) * col.y + + (.114 * _HsvBright - .114 * cosHsv + .292 * sinHsv) * col.z; + resultHsv.z = (.299 * _HsvBright - .3 * cosHsv + 1.25 * sinHsv) * col.x + + (.587 * _HsvBright - .588 * cosHsv - 1.05 * sinHsv) * col.y + + (.114 * _HsvBright + .886 * cosHsv - .203 * sinHsv) * col.z; + col.rgb = resultHsv; + #endif + //------------------------------------------------------- + + //OVERLAY_ON + #if OVERLAY_ON + half2 overlayUvs = d.texcoord0.xy; + overlayUvs.x += ((_Time.y + randomSeed) * _OverlayTextureScrollXSpeed) % 1; + overlayUvs.y += ((_Time.y + randomSeed) * _OverlayTextureScrollYSpeed) % 1; + half4 overlayCol = SAMPLE_TEXTURE2D(_OverlayTex, sampler_OverlayTex, TRANSFORM_TEX(overlayUvs, _OverlayTex)); + overlayCol.rgb *= _OverlayColor.rgb * _OverlayGlow; + #if !OVERLAYMULT_ON + overlayCol.rgb *= overlayCol.a * _OverlayColor.rgb * _OverlayColor.a * _OverlayBlend; + col.rgb += overlayCol.rgb; + #else + overlayCol.a *= _OverlayColor.a; + col = lerp(col, col * overlayCol, _OverlayBlend); + #endif + #endif + + //--------------------------------- + + //OUTBASE_ON + #if OUTBASE_ON + #if OUTBASEPIXELPERF_ON + half2 destUv = half2(_OutlinePixelWidth * _MainTex_TexelSize.x, _OutlinePixelWidth * _MainTex_TexelSize.y); + #else + half2 destUv = half2(_OutlineWidth * _MainTex_TexelSize.x * 200, _OutlineWidth * _MainTex_TexelSize.y * 200); + #endif + + #if OUTDIST_ON + d.texcoord3.x += ((_Time.x + _RandomSeed) * _OutlineDistortTexXSpeed) % 1; + d.texcoord3.y += ((_Time.x + _RandomSeed) * _OutlineDistortTexYSpeed) % 1; + #if ATLAS_ON + d.texcoord3 = half2((d.texcoord3.x - _MinXUV) / (_MaxXUV - _MinXUV), (d.texcoord3.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half outDistortAmnt = (SAMPLE_TEXTURE2D(_OutlineDistortTex, sampler_OutlineDistortTex, d.texcoord3).r - 0.5) * 0.2 * _OutlineDistortAmount; + destUv.x += outDistortAmnt; + destUv.y += outDistortAmnt; + #endif + + half spriteLeft = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(destUv.x, 0)).a; + half spriteRight = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy - half2(destUv.x, 0)).a; + half spriteBottom = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(0, destUv.y)).a; + half spriteTop = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy - half2(0, destUv.y)).a; + half result = spriteLeft + spriteRight + spriteBottom + spriteTop; + + #if OUTBASE8DIR_ON + half spriteTopLeft = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(destUv.x, destUv.y)).a; + half spriteTopRight = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(-destUv.x, destUv.y)).a; + half spriteBotLeft = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(destUv.x, -destUv.y)).a; + half spriteBotRight = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(-destUv.x, -destUv.y)).a; + result = result + spriteTopLeft + spriteTopRight + spriteBotLeft + spriteBotRight; + #endif + + result = step(0.05, saturate(result)); + + #if OUTTEX_ON + d.texcoord1.x += ((_Time.x + _RandomSeed) * _OutlineTexXSpeed) % 1; + d.texcoord1.y += ((_Time.x + _RandomSeed) * _OutlineTexYSpeed) % 1; + #if ATLAS_ON + d.texcoord1 = half2((d.texcoord1.x - _MinXUV) / (_MaxXUV - _MinXUV), (d.texcoord1.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half4 tempOutColor = SAMPLE_TEXTURE2D(_OutlineTex, sampler_OutlineTex, d.texcoord1); + tempOutColor *= _OutlineColor; + _OutlineColor = tempOutColor; + #endif + + result *= (1 - originalAlpha) * _OutlineAlpha; + + half4 outline = _OutlineColor * d.vertexColor.a; + outline.rgb *= _OutlineGlow; + outline.a = result; + #if ONLYOUTLINE_ON + col = outline; + #else + col = lerp(col, outline, result); + #endif + #endif + //------------------------------------------------------- + + //FADE_ON + #if FADE_ON + half2 tiledUvFade1 = TRANSFORM_TEX(d.texcoord0, _FadeTex); + half2 tiledUvFade2 = TRANSFORM_TEX(d.texcoord0, _FadeBurnTex); + #if ATLAS_ON + tiledUvFade1 = half2((tiledUvFade1.x - _MinXUV) / (_MaxXUV - _MinXUV), (tiledUvFade1.y - _MinYUV) / (_MaxYUV - _MinYUV)); + tiledUvFade2 = half2((tiledUvFade2.x - _MinXUV) / (_MaxXUV - _MinXUV), (tiledUvFade2.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half fadeTemp = SAMPLE_TEXTURE2D(_FadeTex, sampler_FadeTex, tiledUvFade1).r; + half fade = smoothstep(_FadeAmount, _FadeAmount + _FadeBurnTransition, fadeTemp); + half fadeBurn = saturate(smoothstep(_FadeAmount - _FadeBurnWidth, _FadeAmount - _FadeBurnWidth + 0.1, fadeTemp) * _FadeAmount); + col.a *= fade; + _FadeBurnColor.rgb *= _FadeBurnGlow; + col += fadeBurn * SAMPLE_TEXTURE2D(_FadeBurnTex, sampler_FadeBurnTex, tiledUvFade2) * _FadeBurnColor * originalAlpha * (1 - col.a); + #endif + //------------------------------------------------------- + + //SHADOW_ON + #if SHADOW_ON + half shadowA = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(_ShadowX, _ShadowY)).a; + half preMultShadowMask = 1 - (saturate(shadowA - col.a) * (1 - col.a)); + col.rgb *= 1 - ((shadowA - col.a) * (1 - col.a)); + col.rgb += (_ShadowColor * shadowA) * (1 - col.a); + col.a = max(shadowA * _ShadowAlpha * d.vertexColor.a, col.a); + #endif + + //------------------------------------------------------- + + //GLOW_ON + #if GLOW_ON + half4 emission; + #if GLOWTEX_ON + emission = SAMPLE_TEXTURE2D(_GlowTex, sampler_GlowTex, d.texcoord0); + #else + emission = col; + #endif + + col.rgb *= _GlowGlobal; + emission.rgb *= emission.a * col.a * _Glow * _GlowColor; + col.rgb += emission.rgb; + #endif + //------------------------------------------------------- + + //COLORRAMP_ON && COLORRAMPOUTLINE_ON + #if COLORRAMP_ON && COLORRAMPOUTLINE_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + luminance = saturate(luminance + _ColorRampLuminosity); + #if GRADIENTCOLORRAMP_ON + col.rgb = lerp(col.rgb, SAMPLE_TEXTURE2D(_ColorRampTexGradient, sampler_ColorRampTexGradient, half2(luminance, 0)).rgb, _ColorRampBlend); + #else + col.rgb = lerp(col.rgb, SAMPLE_TEXTURE2D(_ColorRampTex, sampler_ColorRampTex, half2(luminance, 0)).rgb, _ColorRampBlend); + #endif + #endif + //--------------- + + //GREYSCALE_ON && GREYSCALEOUTLINE_ON + #if GREYSCALE_ON && GREYSCALEOUTLINE_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + luminance = saturate(luminance + _GreyscaleLuminosity); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _GreyscaleTintColor, _GreyscaleBlend); + #endif + + //----------------------------------- + + //POSTERIZE_ON && POSTERIZEOUTLINE_ON + #if POSTERIZE_ON && POSTERIZEOUTLINE_ON + col.rgb = pow(col.rgb, _PosterizeGamma) * _PosterizeNumColors; + col.rgb = floor(col.rgb) / _PosterizeNumColors; + col.rgb = pow(col.rgb, 1.0 / _PosterizeGamma); + #endif + + //----------------------------------- + + //SHINE_ON + #if SHINE_ON + half2 uvShine = uvRect; + half cosAngle = cos(_ShineRotate); + half sinAngle = sin(_ShineRotate); + half2x2 rot = half2x2(cosAngle, -sinAngle, sinAngle, cosAngle); + uvShine -= half2(0.5, 0.5); + uvShine = mul(rot, uvShine); + uvShine += half2(0.5, 0.5); + half shineMask = SAMPLE_TEXTURE2D(_ShineMask, sampler_ShineMask, d.texcoord0.xy).a; + half currentDistanceProjection = (uvShine.x + uvShine.y) / 2; + half whitePower = 1 - (abs(currentDistanceProjection - _ShineLocation) / _ShineWidth); + col.rgb += col.a * whitePower * _ShineGlow * max(sign(currentDistanceProjection - (_ShineLocation - _ShineWidth)), 0.0) + * max(sign((_ShineLocation + _ShineWidth) - currentDistanceProjection), 0.0) * _ShineColor * shineMask; + #endif + + //----------------------------------- + + //HOLOGRAM_ON + #if HOLOGRAM_ON + half totalHologram = _HologramStripesAmount + _HologramUnmodAmount; + half hologramYCoord = ((uvRect.y + (((_Time.x + randomSeed) % 1) * _HologramStripesSpeed)) % totalHologram) / totalHologram; + hologramYCoord = abs(hologramYCoord); + half alpha = RemapFloat(saturate(hologramYCoord - (_HologramUnmodAmount/totalHologram)), 0.0, 1.0, _HologramMinAlpha, saturate(_HologramMaxAlpha)); + half hologramMask = max(sign((_HologramUnmodAmount/totalHologram) - hologramYCoord), 0.0); + half4 hologramResult = col; + hologramResult.a *= lerp(alpha, 1, hologramMask); + hologramResult.rgb *= max(1, _HologramMaxAlpha * max(sign(hologramYCoord - (_HologramUnmodAmount/totalHologram)), 0.0)); + hologramMask = 1 - step(0.01,hologramMask); + hologramResult.rgb += hologramMask * _HologramStripeColor * col.a; + col = lerp(col, hologramResult, _HologramBlend); + #endif + + //----------------------------------- + + //FLICKER_ON + #if FLICKER_ON + col.a *= saturate(col.a * step(frac(0.05 + (_Time.w + randomSeed) * _FlickerFreq), 1 - _FlickerPercent) + _FlickerAlpha); + #endif + //----------------------------------- + + //ALPHACUTOFF_ON + + //ALPHAROUND_ON + + //ALPHAOUTLINE_ON + #if ALPHAOUTLINE_ON + half alphaOutlineRes = pow(1 - col.a, max(_AlphaOutlinePower, 0.0001)) * step(_AlphaOutlineMinAlpha, col.a) * _AlphaOutlineBlend; + col.rgb = lerp(col.rgb, _AlphaOutlineColor.rgb * _AlphaOutlineGlow, alphaOutlineRes); + col.a = lerp(col.a, 1, alphaOutlineRes > 1); + #endif + //------------------------------------------------------- + + //FOG_ON + + //------------------ + + col *= _Color; + o.Albedo = col; + col.a *= _Alpha; + clip(col.a - _AlphaCutoffValue - 0.01); + o.Alpha = _Color.a; + } + + + + + + void ChainSurfaceFunction(inout Surface l, inout ShaderData d) + { + Ext_SurfaceFunction0(l, d); + // Ext_SurfaceFunction1(l, d); + // Ext_SurfaceFunction2(l, d); + // Ext_SurfaceFunction3(l, d); + // Ext_SurfaceFunction4(l, d); + // Ext_SurfaceFunction5(l, d); + // Ext_SurfaceFunction6(l, d); + // Ext_SurfaceFunction7(l, d); + // Ext_SurfaceFunction8(l, d); + // Ext_SurfaceFunction9(l, d); + // Ext_SurfaceFunction10(l, d); + // Ext_SurfaceFunction11(l, d); + // Ext_SurfaceFunction12(l, d); + // Ext_SurfaceFunction13(l, d); + // Ext_SurfaceFunction14(l, d); + // Ext_SurfaceFunction15(l, d); + // Ext_SurfaceFunction16(l, d); + // Ext_SurfaceFunction17(l, d); + // Ext_SurfaceFunction18(l, d); + // Ext_SurfaceFunction19(l, d); + // Ext_SurfaceFunction20(l, d); + // Ext_SurfaceFunction21(l, d); + // Ext_SurfaceFunction22(l, d); + // Ext_SurfaceFunction23(l, d); + // Ext_SurfaceFunction24(l, d); + // Ext_SurfaceFunction25(l, d); + // Ext_SurfaceFunction26(l, d); + // Ext_SurfaceFunction27(l, d); + // Ext_SurfaceFunction28(l, d); + // Ext_SurfaceFunction29(l, d); + } + +#if !_DECALSHADER + + void ChainModifyVertex(inout VertexData v, inout VertexToPixel v2p, float4 time) + { + ExtraV2F d; + + ZERO_INITIALIZE(ExtraV2F, d); + ZERO_INITIALIZE(Blackboard, d.blackboard); + // due to motion vectors in HDRP, we need to use the last + // time in certain spots. So if you are going to use _Time to adjust vertices, + // you need to use this time or motion vectors will break. + d.time = time; + + Ext_ModifyVertex0(v, d); + // Ext_ModifyVertex1(v, d); + // Ext_ModifyVertex2(v, d); + // Ext_ModifyVertex3(v, d); + // Ext_ModifyVertex4(v, d); + // Ext_ModifyVertex5(v, d); + // Ext_ModifyVertex6(v, d); + // Ext_ModifyVertex7(v, d); + // Ext_ModifyVertex8(v, d); + // Ext_ModifyVertex9(v, d); + // Ext_ModifyVertex10(v, d); + // Ext_ModifyVertex11(v, d); + // Ext_ModifyVertex12(v, d); + // Ext_ModifyVertex13(v, d); + // Ext_ModifyVertex14(v, d); + // Ext_ModifyVertex15(v, d); + // Ext_ModifyVertex16(v, d); + // Ext_ModifyVertex17(v, d); + // Ext_ModifyVertex18(v, d); + // Ext_ModifyVertex19(v, d); + // Ext_ModifyVertex20(v, d); + // Ext_ModifyVertex21(v, d); + // Ext_ModifyVertex22(v, d); + // Ext_ModifyVertex23(v, d); + // Ext_ModifyVertex24(v, d); + // Ext_ModifyVertex25(v, d); + // Ext_ModifyVertex26(v, d); + // Ext_ModifyVertex27(v, d); + // Ext_ModifyVertex28(v, d); + // Ext_ModifyVertex29(v, d); + + + // #if %EXTRAV2F0REQUIREKEY% + // v2p.extraV2F0 = d.extraV2F0; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // v2p.extraV2F1 = d.extraV2F1; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // v2p.extraV2F2 = d.extraV2F2; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // v2p.extraV2F3 = d.extraV2F3; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // v2p.extraV2F4 = d.extraV2F4; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // v2p.extraV2F5 = d.extraV2F5; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // v2p.extraV2F6 = d.extraV2F6; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // v2p.extraV2F7 = d.extraV2F7; + // #endif + } + + void ChainModifyTessellatedVertex(inout VertexData v, inout VertexToPixel v2p) + { + ExtraV2F d; + ZERO_INITIALIZE(ExtraV2F, d); + ZERO_INITIALIZE(Blackboard, d.blackboard); + + // #if %EXTRAV2F0REQUIREKEY% + // d.extraV2F0 = v2p.extraV2F0; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // d.extraV2F1 = v2p.extraV2F1; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // d.extraV2F2 = v2p.extraV2F2; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // d.extraV2F3 = v2p.extraV2F3; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // d.extraV2F4 = v2p.extraV2F4; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // d.extraV2F5 = v2p.extraV2F5; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // d.extraV2F6 = v2p.extraV2F6; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // d.extraV2F7 = v2p.extraV2F7; + // #endif + + + // Ext_ModifyTessellatedVertex0(v, d); + // Ext_ModifyTessellatedVertex1(v, d); + // Ext_ModifyTessellatedVertex2(v, d); + // Ext_ModifyTessellatedVertex3(v, d); + // Ext_ModifyTessellatedVertex4(v, d); + // Ext_ModifyTessellatedVertex5(v, d); + // Ext_ModifyTessellatedVertex6(v, d); + // Ext_ModifyTessellatedVertex7(v, d); + // Ext_ModifyTessellatedVertex8(v, d); + // Ext_ModifyTessellatedVertex9(v, d); + // Ext_ModifyTessellatedVertex10(v, d); + // Ext_ModifyTessellatedVertex11(v, d); + // Ext_ModifyTessellatedVertex12(v, d); + // Ext_ModifyTessellatedVertex13(v, d); + // Ext_ModifyTessellatedVertex14(v, d); + // Ext_ModifyTessellatedVertex15(v, d); + // Ext_ModifyTessellatedVertex16(v, d); + // Ext_ModifyTessellatedVertex17(v, d); + // Ext_ModifyTessellatedVertex18(v, d); + // Ext_ModifyTessellatedVertex19(v, d); + // Ext_ModifyTessellatedVertex20(v, d); + // Ext_ModifyTessellatedVertex21(v, d); + // Ext_ModifyTessellatedVertex22(v, d); + // Ext_ModifyTessellatedVertex23(v, d); + // Ext_ModifyTessellatedVertex24(v, d); + // Ext_ModifyTessellatedVertex25(v, d); + // Ext_ModifyTessellatedVertex26(v, d); + // Ext_ModifyTessellatedVertex27(v, d); + // Ext_ModifyTessellatedVertex28(v, d); + // Ext_ModifyTessellatedVertex29(v, d); + + // #if %EXTRAV2F0REQUIREKEY% + // v2p.extraV2F0 = d.extraV2F0; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // v2p.extraV2F1 = d.extraV2F1; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // v2p.extraV2F2 = d.extraV2F2; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // v2p.extraV2F3 = d.extraV2F3; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // v2p.extraV2F4 = d.extraV2F4; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // v2p.extraV2F5 = d.extraV2F5; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // v2p.extraV2F6 = d.extraV2F6; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // v2p.extraV2F7 = d.extraV2F7; + // #endif + } + + void ChainFinalColorForward(inout Surface l, inout ShaderData d, inout half4 color) + { + // Ext_FinalColorForward0(l, d, color); + // Ext_FinalColorForward1(l, d, color); + // Ext_FinalColorForward2(l, d, color); + // Ext_FinalColorForward3(l, d, color); + // Ext_FinalColorForward4(l, d, color); + // Ext_FinalColorForward5(l, d, color); + // Ext_FinalColorForward6(l, d, color); + // Ext_FinalColorForward7(l, d, color); + // Ext_FinalColorForward8(l, d, color); + // Ext_FinalColorForward9(l, d, color); + // Ext_FinalColorForward10(l, d, color); + // Ext_FinalColorForward11(l, d, color); + // Ext_FinalColorForward12(l, d, color); + // Ext_FinalColorForward13(l, d, color); + // Ext_FinalColorForward14(l, d, color); + // Ext_FinalColorForward15(l, d, color); + // Ext_FinalColorForward16(l, d, color); + // Ext_FinalColorForward17(l, d, color); + // Ext_FinalColorForward18(l, d, color); + // Ext_FinalColorForward19(l, d, color); + // Ext_FinalColorForward20(l, d, color); + // Ext_FinalColorForward21(l, d, color); + // Ext_FinalColorForward22(l, d, color); + // Ext_FinalColorForward23(l, d, color); + // Ext_FinalColorForward24(l, d, color); + // Ext_FinalColorForward25(l, d, color); + // Ext_FinalColorForward26(l, d, color); + // Ext_FinalColorForward27(l, d, color); + // Ext_FinalColorForward28(l, d, color); + // Ext_FinalColorForward29(l, d, color); + } + + void ChainFinalGBufferStandard(inout Surface s, inout ShaderData d, inout half4 GBuffer0, inout half4 GBuffer1, inout half4 GBuffer2, inout half4 outEmission, inout half4 outShadowMask) + { + // Ext_FinalGBufferStandard0(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard1(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard2(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard3(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard4(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard5(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard6(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard7(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard8(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard9(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard10(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard11(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard12(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard13(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard14(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard15(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard16(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard17(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard18(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard19(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard20(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard21(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard22(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard23(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard24(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard25(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard26(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard27(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard28(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard29(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + } +#endif + + + + + +#if _DECALSHADER + + ShaderData CreateShaderData(SurfaceDescriptionInputs IN) + { + ShaderData d = (ShaderData)0; + d.TBNMatrix = float3x3(IN.WorldSpaceTangent, IN.WorldSpaceBiTangent, IN.WorldSpaceNormal); + d.worldSpaceNormal = IN.WorldSpaceNormal; + d.worldSpaceTangent = IN.WorldSpaceTangent; + + d.worldSpacePosition = IN.WorldSpacePosition; + d.texcoord0 = IN.uv0.xyxy; + d.screenPos = IN.ScreenPosition; + + d.worldSpaceViewDir = normalize(_WorldSpaceCameraPos - d.worldSpacePosition); + + d.tangentSpaceViewDir = mul(d.TBNMatrix, d.worldSpaceViewDir); + + // these rarely get used, so we back transform them. Usually will be stripped. + #if _HDRP + // d.localSpacePosition = mul(GetWorldToObjectMatrix(), float4(GetCameraRelativePositionWS(d.worldSpacePosition), 1)).xyz; + #else + // d.localSpacePosition = mul(GetWorldToObjectMatrix(), float4(d.worldSpacePosition, 1)).xyz; + #endif + // d.localSpaceNormal = normalize(mul((float3x3)GetWorldToObjectMatrix(), d.worldSpaceNormal)); + // d.localSpaceTangent = normalize(mul((float3x3)GetWorldToObjectMatrix(), d.worldSpaceTangent.xyz)); + + // #if %SCREENPOSREQUIREKEY% + // d.screenUV = (IN.ScreenPosition.xy / max(0.01, IN.ScreenPosition.w)); + // #endif + + return d; + } +#else + + ShaderData CreateShaderData(VertexToPixel i + #if NEED_FACING + , bool facing + #endif + ) + { + ShaderData d = (ShaderData)0; + d.clipPos = i.pos; + d.worldSpacePosition = i.worldPos; + + d.worldSpaceNormal = normalize(i.worldNormal); + d.worldSpaceTangent.xyz = normalize(i.worldTangent.xyz); + + d.tangentSign = i.worldTangent.w * unity_WorldTransformParams.w; + float3 bitangent = cross(d.worldSpaceTangent.xyz, d.worldSpaceNormal) * d.tangentSign; + + d.TBNMatrix = float3x3(d.worldSpaceTangent, -bitangent, d.worldSpaceNormal); + d.worldSpaceViewDir = normalize(_WorldSpaceCameraPos - i.worldPos); + + d.tangentSpaceViewDir = mul(d.TBNMatrix, d.worldSpaceViewDir); + d.texcoord0 = i.texcoord0; + d.texcoord1 = i.texcoord1; + d.texcoord2 = i.texcoord2; + + // #if %TEXCOORD3REQUIREKEY% + d.texcoord3 = i.texcoord3; + // #endif + + // d.isFrontFace = facing; + // #if %VERTEXCOLORREQUIREKEY% + d.vertexColor = i.vertexColor; + // #endif + + // these rarely get used, so we back transform them. Usually will be stripped. + #if _HDRP + // d.localSpacePosition = mul(GetWorldToObjectMatrix(), float4(GetCameraRelativePositionWS(i.worldPos), 1)).xyz; + #else + // d.localSpacePosition = mul(GetWorldToObjectMatrix(), float4(i.worldPos, 1)).xyz; + #endif + // d.localSpaceNormal = normalize(mul((float3x3)GetWorldToObjectMatrix(), i.worldNormal)); + // d.localSpaceTangent = normalize(mul((float3x3)GetWorldToObjectMatrix(), i.worldTangent.xyz)); + + // #if %SCREENPOSREQUIREKEY% + // d.screenPos = i.screenPos; + // d.screenUV = (i.screenPos.xy / i.screenPos.w); + // #endif + + + // #if %EXTRAV2F0REQUIREKEY% + // d.extraV2F0 = i.extraV2F0; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // d.extraV2F1 = i.extraV2F1; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // d.extraV2F2 = i.extraV2F2; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // d.extraV2F3 = i.extraV2F3; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // d.extraV2F4 = i.extraV2F4; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // d.extraV2F5 = i.extraV2F5; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // d.extraV2F6 = i.extraV2F6; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // d.extraV2F7 = i.extraV2F7; + // #endif + + return d; + } + +#endif + + + +#if (SHADERPASS == SHADERPASS_LIGHT_TRANSPORT) + + // This was not in constant buffer in original unity, so keep outiside. But should be in as ShaderRenderPass frequency + float unity_OneOverOutputBoost; + float unity_MaxOutputValue; + + CBUFFER_START(UnityMetaPass) + // x = use uv1 as raster position + // y = use uv2 as raster position + bool4 unity_MetaVertexControl; + + // x = return albedo + // y = return normal + bool4 unity_MetaFragmentControl; + CBUFFER_END + + VertexToPixel Vert(VertexData inputMesh) + { + VertexToPixel output; + ZERO_INITIALIZE(VertexToPixel, output); + UNITY_SETUP_INSTANCE_ID(inputMesh); + UNITY_TRANSFER_INSTANCE_ID(inputMesh, output); + UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(output); + + // Output UV coordinate in vertex shader + float2 uv = float2(0.0, 0.0); + + if (unity_MetaVertexControl.x) + { + uv = inputMesh.texcoord1.xy * unity_LightmapST.xy + unity_LightmapST.zw; + } + else if (unity_MetaVertexControl.y) + { + uv = inputMesh.texcoord2.xy * unity_DynamicLightmapST.xy + unity_DynamicLightmapST.zw; + } + + // OpenGL right now needs to actually use the incoming vertex position + // so we create a fake dependency on it here that haven't any impact. + output.pos = float4(uv * 2.0 - 1.0, inputMesh.vertex.z > 0 ? 1.0e-4 : 0.0, 1.0); + + output.worldPos = TransformObjectToWorld(inputMesh.vertex); + + // Normal is required for triplanar mapping + output.worldNormal = TransformObjectToWorldNormal(inputMesh.normal); + // Not required but assign to silent compiler warning + output.worldTangent = float4(1.0, 0.0, 0.0, 0.0); + + output.texcoord0 = inputMesh.texcoord0; + output.texcoord1 = inputMesh.texcoord1; + output.texcoord2 = inputMesh.texcoord2; + // #if %TEXCOORD3REQUIREKEY% + output.texcoord3 = inputMesh.texcoord3; + // #endif + // #if %VERTEXCOLORREQUIREKEY% + output.vertexColor = inputMesh.vertexColor; + // #endif + + return output; + } +#else + + #if (_PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR))) + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/ShaderVariablesMatrixDefsHDCamera.hlsl" + + void MotionVectorPositionZBias(VertexToPixel input) + { + #if UNITY_REVERSED_Z + input.pos.z -= unity_MotionVectorsParams.z * input.pos.w; + #else + input.pos.z += unity_MotionVectorsParams.z * input.pos.w; + #endif + } + + #endif + + VertexToPixel Vert(VertexData input) + { + VertexToPixel output; + ZERO_INITIALIZE(VertexToPixel, output); + + UNITY_SETUP_INSTANCE_ID(input); + UNITY_TRANSFER_INSTANCE_ID(input, output); + UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(output); + + // copy before user modification, since we'll apply that to the copy later + #if _HDRP && (_PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR))) + VertexData previousMesh = input; + #endif + + ChainModifyVertex(input, output, _Time); + + // This return the camera relative position (if enable) + float3 positionRWS = TransformObjectToWorld(input.vertex.xyz); + float3 normalWS = TransformObjectToWorldNormal(input.normal); + float4 tangentWS = float4(TransformObjectToWorldDir(input.tangent.xyz), input.tangent.w); + + + output.worldPos = GetAbsolutePositionWS(positionRWS); + output.pos = TransformWorldToHClip(positionRWS); + output.worldNormal = normalWS; + output.worldTangent = tangentWS; + + + output.texcoord0 = input.texcoord0; + output.texcoord1 = input.texcoord1; + output.texcoord2 = input.texcoord2; + + // #if %TEXCOORD3REQUIREKEY% + output.texcoord3 = input.texcoord3; + // #endif + + // #if %VERTEXCOLORREQUIREKEY% + output.vertexColor = input.vertexColor; + // #endif + + // #if %SCREENPOSREQUIREKEY% + // output.screenPos = ComputeScreenPos(output.pos, _ProjectionParams.x); + // #endif + + #if _HDRP && (_PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR))) + + #if !defined(TESSELLATION_ON) + MotionVectorPositionZBias(output); + #endif + + output.motionVectorCS = mul(UNITY_MATRIX_UNJITTERED_VP, float4(positionRWS, 1.0)); + // Note: unity_MotionVectorsParams.y is 0 is forceNoMotion is enabled + bool forceNoMotion = unity_MotionVectorsParams.y == 0.0; + if (forceNoMotion) + { + output.previousPositionCS = float4(0.0, 0.0, 0.0, 1.0); + } + else + { + bool hasDeformation = unity_MotionVectorsParams.x > 0.0; // Skin or morph target + + float3 effectivePositionOS = (hasDeformation ? previousMesh.previousPositionOS : previousMesh.vertex.xyz); + #if defined(_ADD_PRECOMPUTED_VELOCITY) + effectivePositionOS -= input.precomputedVelocity; + #endif + + + + previousMesh.vertex = float4(effectivePositionOS, 1); + VertexToPixel dummy = (VertexToPixel)0; + + ChainModifyVertex(previousMesh, dummy, _LastTimeParameters); + + float3 previousPositionRWS = TransformPreviousObjectToWorld(previousMesh.vertex.xyz); + // we might need this for skinned objects? + //float3 normalWS = TransformPreviousObjectToWorldNormal(input.normal).xyz; + + #ifdef _WRITE_TRANSPARENT_MOTION_VECTOR + if (_TransparentCameraOnlyMotionVectors > 0) + { + previousPositionRWS = positionRWS.xyz; + } + #endif // _WRITE_TRANSPARENT_MOTION_VECTOR + + output.previousPositionCS = mul(UNITY_MATRIX_PREV_VP, float4(previousPositionRWS, 1.0)); + } + #endif // _HDRP && _PASSMOTIONVECTOR || (_PASSFORWARD && defined(_WRITE_TRANSPARENT_MOTION_VECTOR)) + + + return output; + } + + +#endif + + + + + + + + #if defined(WRITE_DECAL_BUFFER) && !defined(_DISABLE_DECALS) + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/Decal/DecalPrepassBuffer.hlsl" + #endif + + FragInputs BuildFragInputs(VertexToPixel input) + { + UNITY_SETUP_INSTANCE_ID(input); + FragInputs output; + ZERO_INITIALIZE(FragInputs, output); + + // Init to some default value to make the computer quiet (else it output 'divide by zero' warning even if value is not used). + // TODO: this is a really poor workaround, but the variable is used in a bunch of places + // to compute normals which are then passed on elsewhere to compute other values... + output.tangentToWorld = k_identity3x3; + output.positionSS = input.pos; // input.positionCS is SV_Position + // BETTER SHADERS: because we transform world position into actual world space for things like + // triplanar, etc, we have to back transform it here for lighting + output.positionRWS = GetCameraRelativePositionWS(input.worldPos); + output.tangentToWorld = BuildTangentToWorld(input.worldTangent, input.worldNormal); + output.texCoord0 = input.texcoord0; + output.texCoord1 = input.texcoord1; + output.texCoord2 = input.texcoord2; + + return output; + } + + void BuildSurfaceData(FragInputs fragInputs, inout Surface surfaceDescription, float3 V, PositionInputs posInput, out SurfaceData surfaceData, out float3 bentNormalWS) + { + // setup defaults -- these are used if the graph doesn't output a value + ZERO_INITIALIZE(SurfaceData, surfaceData); + + // specularOcclusion need to be init ahead of decal to quiet the compiler that modify the SurfaceData struct + // however specularOcclusion can come from the graph, so need to be init here so it can be override. + surfaceData.specularOcclusion = 1.0; + + // copy across graph values, if defined + surfaceData.baseColor = surfaceDescription.Albedo; + surfaceData.perceptualSmoothness = surfaceDescription.Smoothness; + surfaceData.ambientOcclusion = surfaceDescription.Occlusion; + surfaceData.specularOcclusion = surfaceDescription.SpecularOcclusion; + surfaceData.metallic = surfaceDescription.Metallic; + surfaceData.subsurfaceMask = surfaceDescription.SubsurfaceMask; + surfaceData.thickness = surfaceDescription.Thickness; + surfaceData.diffusionProfileHash = asuint(surfaceDescription.DiffusionProfileHash); + #if _USESPECULAR + surfaceData.specularColor = surfaceDescription.Specular; + #endif + surfaceData.coatMask = surfaceDescription.CoatMask; + surfaceData.anisotropy = surfaceDescription.Anisotropy; + surfaceData.iridescenceMask = surfaceDescription.IridescenceMask; + surfaceData.iridescenceThickness = surfaceDescription.IridescenceThickness; + + + + #if defined(_REFRACTION_PLANE) || defined(_REFRACTION_SPHERE) || defined(_REFRACTION_THIN) + if (_EnableSSRefraction) + { + surfaceData.transmittanceMask = (1.0 - surfaceDescription.Alpha); + surfaceDescription.Alpha = 1.0; + } + else + { + surfaceData.ior = surfaceDescription.ior; + surfaceData.transmittanceColor = surfaceDescription.transmittanceColor; + surfaceData.atDistance = surfaceDescription.atDistance; + surfaceData.transmittanceMask = surfaceDescription.transmittanceMask; + surfaceDescription.Alpha = 1.0; + } + #else + surfaceData.ior = 1.0; + surfaceData.transmittanceColor = float3(1.0, 1.0, 1.0); + surfaceData.atDistance = 1.0; + surfaceData.transmittanceMask = 0.0; + #endif + + + #if defined(_ENABLE_SHADOW_MATTE) && SHADERPASS == SHADERPASS_FORWARD_UNLIT + HDShadowContext shadowContext = InitShadowContext(); + float shadow; + float3 shadow3; + // We need to recompute some coordinate not computed by default for shadow matte + posInput = GetPositionInput(fragInputs.positionSS.xy, _ScreenSize.zw, fragInputs.positionSS.z, UNITY_MATRIX_I_VP, GetWorldToViewMatrix()); + float3 upWS = normalize(fragInputs.tangentToWorld[1]); + uint renderingLayers = GetMeshRenderingLightLayer(); + ShadowLoopMin(shadowContext, posInput, upWS, asuint(_ShadowMatteFilter), renderingLayers, shadow3); + shadow = dot(shadow3, float3(1.0 / 3.0, 1.0 / 3.0, 1.0 / 3.0)); + + float4 shadowColor = (1.0 - shadow) * surfaceDescription.ShadowTint.rgba; + float localAlpha = saturate(shadowColor.a + surfaceDescription.Alpha); + + // Keep the nested lerp + // With no Color (bsdfData.color.rgb, bsdfData.color.a == 0.0f), just use ShadowColor*Color to avoid a ring of "white" around the shadow + // And mix color to consider the Color & ShadowColor alpha (from texture or/and color picker) + #ifdef _SURFACE_TYPE_TRANSPARENT + surfaceData.baseColor = lerp(shadowColor.rgb * surfaceData.baseColor, lerp(lerp(shadowColor.rgb, surfaceData.baseColor, 1.0 - surfaceDescription.ShadowTint.a), surfaceData.baseColor, shadow), surfaceDescription.Alpha); + #else + surfaceData.baseColor = lerp(lerp(shadowColor.rgb, surfaceData.baseColor, 1.0 - surfaceDescription.ShadowTint.a), surfaceData.baseColor, shadow); + #endif + localAlpha = ApplyBlendMode(surfaceData.baseColor, localAlpha).a; + + surfaceDescription.Alpha = localAlpha; + #endif + + // These static material feature allow compile time optimization + surfaceData.materialFeatures = MATERIALFEATUREFLAGS_LIT_STANDARD; + #ifdef _MATERIAL_FEATURE_SUBSURFACE_SCATTERING + surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_SUBSURFACE_SCATTERING; + #endif + + #ifdef _MATERIAL_FEATURE_TRANSMISSION + surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_TRANSMISSION; + #endif + + #ifdef _MATERIAL_FEATURE_ANISOTROPY + surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_ANISOTROPY; + #endif + + #ifdef _MATERIAL_FEATURE_IRIDESCENCE + surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_IRIDESCENCE; + #endif + + #ifdef _MATERIAL_FEATURE_SPECULAR_COLOR + surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_SPECULAR_COLOR; + #endif + + #if defined(_MATERIAL_FEATURE_CLEAR_COAT) || _CLEARCOAT + surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_CLEAR_COAT; + #endif + + #if defined (_MATERIAL_FEATURE_SPECULAR_COLOR) && defined (_ENERGY_CONSERVING_SPECULAR) + // Require to have setup baseColor + // Reproduce the energy conservation done in legacy Unity. Not ideal but better for compatibility and users can unchek it + surfaceData.baseColor *= (1.0 - Max3(surfaceData.specularColor.r, surfaceData.specularColor.g, surfaceData.specularColor.b)); + #endif + + + + // compute world space normal + #if !_WORLDSPACENORMAL + surfaceData.normalWS = mul(surfaceDescription.Normal, fragInputs.tangentToWorld); + #else + surfaceData.normalWS = surfaceDescription.Normal; + #endif + + surfaceData.geomNormalWS = fragInputs.tangentToWorld[2]; + + surfaceData.tangentWS = normalize(fragInputs.tangentToWorld[0].xyz); // The tangent is not normalize in tangentToWorld for mikkt. TODO: Check if it expected that we normalize with Morten. Tag: SURFACE_GRADIENT + + + #if HAVE_DECALS + if (_EnableDecals) + { + float alpha = 1.0; + alpha = surfaceDescription.Alpha; + + // Both uses and modifies 'surfaceData.normalWS'. + DecalSurfaceData decalSurfaceData = GetDecalSurfaceData(posInput, fragInputs.tangentToWorld[2], alpha); + ApplyDecalToSurfaceData(decalSurfaceData, fragInputs.tangentToWorld[2], surfaceData); + } + #endif + + bentNormalWS = surfaceData.normalWS; + + surfaceData.tangentWS = Orthonormalize(surfaceData.tangentWS, surfaceData.normalWS); + + #ifdef DEBUG_DISPLAY + if (_DebugMipMapMode != DEBUGMIPMAPMODE_NONE) + { + // TODO: need to update mip info + surfaceData.metallic = 0; + } + + // We need to call ApplyDebugToSurfaceData after filling the surfarcedata and before filling builtinData + // as it can modify attribute use for static lighting + ApplyDebugToSurfaceData(fragInputs.tangentToWorld, surfaceData); + #endif + + // By default we use the ambient occlusion with Tri-ace trick (apply outside) for specular occlusion. + // If user provide bent normal then we process a better term + #if defined(_SPECULAR_OCCLUSION_CUSTOM) + // Just use the value passed through via the slot (not active otherwise) + #elif defined(_SPECULAR_OCCLUSION_FROM_AO_BENT_NORMAL) + // If we have bent normal and ambient occlusion, process a specular occlusion + surfaceData.specularOcclusion = GetSpecularOcclusionFromBentAO(V, bentNormalWS, surfaceData.normalWS, surfaceData.ambientOcclusion, PerceptualSmoothnessToPerceptualRoughness(surfaceData.perceptualSmoothness)); + #elif defined(_AMBIENT_OCCLUSION) && defined(_SPECULAR_OCCLUSION_FROM_AO) + surfaceData.specularOcclusion = GetSpecularOcclusionFromAmbientOcclusion(ClampNdotV(dot(surfaceData.normalWS, V)), surfaceData.ambientOcclusion, PerceptualSmoothnessToRoughness(surfaceData.perceptualSmoothness)); + #endif + + #if defined(_ENABLE_GEOMETRIC_SPECULAR_AA) && !defined(SHADER_STAGE_RAY_TRACING) + surfaceData.perceptualSmoothness = GeometricNormalFiltering(surfaceData.perceptualSmoothness, fragInputs.tangentToWorld[2], surfaceDescription.SpecularAAScreenSpaceVariance, surfaceDescription.SpecularAAThreshold); + #endif + } + + void GetSurfaceAndBuiltinData(VertexToPixel m2ps, FragInputs fragInputs, float3 V, inout PositionInputs posInput, + out SurfaceData surfaceData, out BuiltinData builtinData, inout Surface l, inout ShaderData d + #if NEED_FACING + , bool facing + #endif + ) + { + // Removed since crossfade does not work, probably needs extra material setup. + //#if !defined(SHADER_STAGE_RAY_TRACING) && !defined(_TESSELLATION_DISPLACEMENT) + // #ifdef LOD_FADE_CROSSFADE // enable dithering LOD transition if user select CrossFade transition in LOD group + // LODDitheringTransition(ComputeFadeMaskSeed(V, posInput.positionSS), unity_LODFade.x); + // #endif + //#endif + + d = CreateShaderData(m2ps + #if NEED_FACING + , facing + #endif + ); + + l = (Surface)0; + + l.Albedo = half3(0.5, 0.5, 0.5); + l.Normal = float3(0,0,1); + l.Occlusion = 1; + l.Alpha = 1; + l.SpecularOcclusion = 1; + + #if !defined(SHADER_STAGE_RAY_TRACING) && defined(_DEPTHOFFSET_ON) + l.outputDepth = d.clipPos.z; + #endif + + ChainSurfaceFunction(l, d); + + #if !defined(SHADER_STAGE_RAY_TRACING) && defined(_DEPTHOFFSET_ON) + //posInput.deviceDepth = l.outputDepth; + #endif + + #if _UNLIT + //l.Emission = l.Albedo; + //l.Albedo = 0; + l.Normal = half3(0,0,1); + l.Occlusion = 1; + l.Metallic = 0; + l.Specular = 0; + #endif + + surfaceData.geomNormalWS = d.worldSpaceNormal; + surfaceData.tangentWS = d.worldSpaceTangent; + fragInputs.tangentToWorld = d.TBNMatrix; + + float3 bentNormalWS; + BuildSurfaceData(fragInputs, l, V, posInput, surfaceData, bentNormalWS); + + + InitBuiltinData(posInput, l.Alpha, bentNormalWS, -d.worldSpaceNormal, fragInputs.texCoord1, fragInputs.texCoord2, builtinData); + + + + builtinData.emissiveColor = l.Emission; + + #if defined(_OVERRIDE_BAKEDGI) + builtinData.bakeDiffuseLighting = l.DiffuseGI; + builtinData.backBakeDiffuseLighting = l.BackDiffuseGI; + builtinData.emissiveColor += l.SpecularGI; + #endif + + #if defined(_OVERRIDE_SHADOWMASK) + builtinData.shadowMask0 = l.ShadowMask.x; + builtinData.shadowMask1 = l.ShadowMask.y; + builtinData.shadowMask2 = l.ShadowMask.z; + builtinData.shadowMask3 = l.ShadowMask.w; + #endif + + #if defined(UNITY_VIRTUAL_TEXTURING) + builtinData.vtPackedFeedback = surfaceData.VTPackedFeedback; + #endif + + #if (SHADERPASS == SHADERPASS_DISTORTION) + //builtinData.distortion = surfaceData.Distortion; + //builtinData.distortionBlur = surfaceData.DistortionBlur; + #endif + + #ifndef SHADER_UNLIT + // PostInitBuiltinData call ApplyDebugToBuiltinData + PostInitBuiltinData(V, posInput, surfaceData, builtinData); + #else + ApplyDebugToBuiltinData(builtinData); + #endif + + RAY_TRACING_OPTIONAL_ALPHA_TEST_PASS + } + + + #if defined(WRITE_NORMAL_BUFFER) && defined(WRITE_MSAA_DEPTH) + #define SV_TARGET_DECAL SV_Target2 + #elif defined(WRITE_NORMAL_BUFFER) || defined(WRITE_MSAA_DEPTH) + #define SV_TARGET_DECAL SV_Target1 + #else + #define SV_TARGET_DECAL SV_Target0 + #endif + + + void Frag( VertexToPixel v2f + #if defined(SCENESELECTIONPASS) || defined(SCENEPICKINGPASS) + , out float4 outColor : SV_Target0 + #else + #ifdef WRITE_MSAA_DEPTH + // We need the depth color as SV_Target0 for alpha to coverage + , out float4 depthColor : SV_Target0 + #ifdef WRITE_NORMAL_BUFFER + , out float4 outNormalBuffer : SV_Target1 + #endif + #else + #ifdef WRITE_NORMAL_BUFFER + , out float4 outNormalBuffer : SV_Target0 + #endif + #endif + + // Decal buffer must be last as it is bind but we can optionally write into it (based on _DISABLE_DECALS) + #if defined(WRITE_DECAL_BUFFER) && !defined(_DISABLE_DECALS) + , out float4 outDecalBuffer : SV_TARGET_DECAL + #endif + #endif + + #if defined(_DEPTHOFFSET_ON) && !defined(SCENEPICKINGPASS) + , out float outputDepth : SV_Depth + #endif + #if NEED_FACING + , bool facing : SV_IsFrontFace + #endif + ) + { + UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX(v2f); + FragInputs input = BuildFragInputs(v2f); + + // input.positionSS is SV_Position + PositionInputs posInput = GetPositionInput(input.positionSS.xy, _ScreenSize.zw, input.positionSS.z, input.positionSS.w, input.positionRWS); + + + float3 V = GetWorldSpaceNormalizeViewDir(input.positionRWS); + + + SurfaceData surfaceData; + BuiltinData builtinData; + Surface l; + ShaderData d; + GetSurfaceAndBuiltinData(v2f, input, V, posInput, surfaceData, builtinData, l, d + #if NEED_FACING + , facing + #endif + ); + + + #ifdef _DEPTHOFFSET_ON + outputDepth = l.outputDepth; + #endif + + #ifdef SCENESELECTIONPASS + // We use depth prepass for scene selection in the editor, this code allow to output the outline correctly + outColor = float4(_ObjectId, _PassValue, 1.0, 1.0); + #elif defined(SCENEPICKINGPASS) + outColor = _SelectionID; + #else + #ifdef WRITE_MSAA_DEPTH + // In case we are rendering in MSAA, reading the an MSAA depth buffer is way too expensive. To avoid that, we export the depth to a color buffer + depthColor = v2f.pos.z; + + #ifdef _ALPHATOMASK_ON + // Alpha channel is used for alpha to coverage + depthColor.a = SharpenAlpha(builtinData.opacity, builtinData.alphaClipTreshold); + #endif // alphatomask + #endif // msaa_depth + #endif + + #if defined(WRITE_NORMAL_BUFFER) + EncodeIntoNormalBuffer(ConvertSurfaceDataToNormalData(surfaceData), outNormalBuffer); + #endif + + #if defined(WRITE_DECAL_BUFFER) && !defined(_DISABLE_DECALS) + DecalPrepassData decalPrepassData; + // We don't have the right to access SurfaceData in a shaderpass. + // However it would be painful to have to add a function like ConvertSurfaceDataToDecalPrepassData() to every Material to return geomNormalWS anyway + // Here we will put the constrain that any Material requiring to support Decal, will need to have geomNormalWS as member of surfaceData (and we already require normalWS anyway) + decalPrepassData.geomNormalWS = surfaceData.geomNormalWS; + decalPrepassData.decalLayerMask = GetMeshRenderingDecalLayer(); + EncodeIntoDecalPrepassBuffer(decalPrepassData, outDecalBuffer); + #endif + + + } + + + + + ENDHLSL + } + + Pass + { + // based on HDLitPass.template + Name "DepthOnly" + Tags { "LightMode" = "DepthOnly" } + + //------------------------------------------------------------------------------------- + // Render Modes (Blend, Cull, ZTest, Stencil, etc) + //------------------------------------------------------------------------------------- + + Cull Back + + + ZWrite On + + + // Stencil setup + Stencil + { + WriteMask [_StencilWriteMaskDepth] + Ref [_StencilRefDepth] + Comp Always + Pass Replace + } + Tags { "RenderType" = "Opaque" "Queue" = "Geometry" "PreviewType" = "Plane" } + Cull [_CullingOption] + ZWrite [_ZWrite] + ZTest [_ZTestMode] + + + //------------------------------------------------------------------------------------- + // End Render Modes + //------------------------------------------------------------------------------------- + + HLSLPROGRAM + + #pragma target 4.5 + #pragma only_renderers d3d11 playstation xboxone vulkan metal switch + //#pragma enable_d3d11_debug_symbols + + #pragma multi_compile_instancing + #pragma instancing_options renderinglayer + + + //#pragma shader_feature _ _SURFACE_TYPE_TRANSPARENT + //#pragma shader_feature_local _BLENDMODE_OFF _BLENDMODE_ALPHA _BLENDMODE_ADD _BLENDMODE_PRE_MULTIPLY + //#pragma shader_feature_local _ _ADD_PRECOMPUTED_VELOCITY + //#pragma shader_feature_local _ _TRANSPARENT_WRITES_MOTION_VEC + //#pragma shader_feature_local _ _ENABLE_FOG_ON_TRANSPARENT + //#pragma shader_feature_local _ _DISABLE_DECALS + //#pragma shader_feature_local _ _DISABLE_SSR + //#pragma shader_feature_local _ _DISABLE_SSR_TRANSPARENT + //#pragma shader_feature_local _REFRACTION_OFF _REFRACTION_PLANE _REFRACTION_SPHERE _REFRACTION_THIN + #pragma multi_compile _ WRITE_DECAL_BUFFER + //------------------------------------------------------------------------------------- + // Variant Definitions (active field translations to HDRP defines) + //------------------------------------------------------------------------------------- + // #define _MATERIAL_FEATURE_SUBSURFACE_SCATTERING 1 + // #define _MATERIAL_FEATURE_TRANSMISSION 1 + // #define _MATERIAL_FEATURE_ANISOTROPY 1 + // #define _MATERIAL_FEATURE_IRIDESCENCE 1 + // #define _MATERIAL_FEATURE_SPECULAR_COLOR 1 + #define _ENABLE_FOG_ON_TRANSPARENT 1 + // #define _AMBIENT_OCCLUSION 1 + // #define _SPECULAR_OCCLUSION_FROM_AO 1 + // #define _SPECULAR_OCCLUSION_FROM_AO_BENT_NORMAL 1 + // #define _SPECULAR_OCCLUSION_CUSTOM 1 + // #define _ENERGY_CONSERVING_SPECULAR 1 + // #define _ENABLE_GEOMETRIC_SPECULAR_AA 1 + // #define _HAS_REFRACTION 1 + // #define _REFRACTION_PLANE 1 + // #define _REFRACTION_SPHERE 1 + // #define _DISABLE_DECALS 1 + // #define _DISABLE_SSR 1 + // #define _ADD_PRECOMPUTED_VELOCITY + // #define _WRITE_TRANSPARENT_MOTION_VECTOR 1 + // #define _DEPTHOFFSET_ON 1 + // #define _BLENDMODE_PRESERVE_SPECULAR_LIGHTING 1 + + #define SHADERPASS SHADERPASS_DEPTH_ONLY + #pragma multi_compile _ WRITE_NORMAL_BUFFER + #pragma multi_compile _ WRITE_MSAA_DEPTH + #define RAYTRACING_SHADER_GRAPH_HIGH + #define _PASSDEPTH 1 + + + + #pragma shader_feature_local GLOW_ON + #pragma shader_feature_local FADE_ON + #pragma shader_feature_local OUTBASE_ON + #pragma shader_feature_local ONLYOUTLINE_ON + #pragma shader_feature_local GRADIENT_ON + #pragma shader_feature_local GRADIENT2COL_ON + #pragma shader_feature_local RADIALGRADIENT_ON + #pragma shader_feature_local COLORSWAP_ON + #pragma shader_feature_local HSV_ON + #pragma shader_feature_local CHANGECOLOR_ON + #pragma shader_feature_local CHANGECOLOR2_ON + #pragma shader_feature_local CHANGECOLOR3_ON + #pragma shader_feature_local COLORRAMP_ON + #pragma shader_feature_local GRADIENTCOLORRAMP_ON + #pragma shader_feature_local HITEFFECT_ON + #pragma shader_feature_local NEGATIVE_ON + #pragma shader_feature_local PIXELATE_ON + #pragma shader_feature_local GREYSCALE_ON + #pragma shader_feature_local POSTERIZE_ON + #pragma shader_feature_local BLUR_ON + #pragma shader_feature_local MOTIONBLUR_ON + #pragma shader_feature_local GHOST_ON + #pragma shader_feature_local ALPHAOUTLINE_ON + #pragma shader_feature_local INNEROUTLINE_ON + #pragma shader_feature_local ONLYINNEROUTLINE_ON + #pragma shader_feature_local HOLOGRAM_ON + #pragma shader_feature_local CHROMABERR_ON + #pragma shader_feature_local GLITCH_ON + #pragma shader_feature_local FLICKER_ON + #pragma shader_feature_local SHADOW_ON + #pragma shader_feature_local SHINE_ON + #pragma shader_feature_local CONTRAST_ON + #pragma shader_feature_local OVERLAY_ON + #pragma shader_feature_local OVERLAYMULT_ON + #pragma shader_feature_local DOODLE_ON + #pragma shader_feature_local WIND_ON + #pragma shader_feature_local WAVEUV_ON + #pragma shader_feature_local ROUNDWAVEUV_ON + #pragma shader_feature_local RECTSIZE_ON + #pragma shader_feature_local OFFSETUV_ON + #pragma shader_feature_local CLIPPING_ON + #pragma shader_feature_local RADIALCLIPPING_ON + #pragma shader_feature_local TEXTURESCROLL_ON + #pragma shader_feature_local ZOOMUV_ON + #pragma shader_feature_local DISTORT_ON + #pragma shader_feature_local WARP_ON + #pragma shader_feature_local TWISTUV_ON + #pragma shader_feature_local ROTATEUV_ON + #pragma shader_feature_local POLARUV_ON + #pragma shader_feature_local FISHEYE_ON + #pragma shader_feature_local PINCH_ON + #pragma shader_feature_local SHAKEUV_ON + + #pragma shader_feature_local GLOWTEX_ON + #pragma shader_feature_local OUTTEX_ON + #pragma shader_feature_local OUTDIST_ON + #pragma shader_feature_local OUTBASE8DIR_ON + #pragma shader_feature_local OUTBASEPIXELPERF_ON + #pragma shader_feature_local COLORRAMPOUTLINE_ON + #pragma shader_feature_local GREYSCALEOUTLINE_ON + #pragma shader_feature_local POSTERIZEOUTLINE_ON + #pragma shader_feature_local BLURISHD_ON + #pragma shader_feature_local MANUALWIND_ON + #pragma shader_feature_local ATLAS_ON + #pragma shader_feature_local PREMULTIPLYALPHA_ON + + #pragma shader_feature BILBOARD_ON + #pragma shader_feature BILBOARDY_ON + + #pragma shader_feature NORMALMAP_ON + + + #define _HDRP 1 +#define _USINGTEXCOORD1 1 +#define _USINGTEXCOORD2 1 + + + #pragma vertex Vert + #pragma fragment Frag + + + + // useful conversion functions to make surface shader code just work + + #define UNITY_DECLARE_TEX2D(name) TEXTURE2D(name); SAMPLER(sampler##name); + #define UNITY_DECLARE_TEX2D_NOSAMPLER(name) TEXTURE2D(name); + #define UNITY_DECLARE_TEX2DARRAY(name) TEXTURE2D_ARRAY(name); SAMPLER(sampler##name); + #define UNITY_DECLARE_TEX2DARRAY_NOSAMPLER(tex) TEXTURE2D_ARRAY(tex); + + #define UNITY_SAMPLE_TEX2DARRAY(tex,coord) SAMPLE_TEXTURE2D_ARRAY(tex, sampler##tex, coord.xy, coord.z) + #define UNITY_SAMPLE_TEX2DARRAY_LOD(tex,coord,lod) SAMPLE_TEXTURE2D_ARRAY_LOD(tex, sampler##tex, coord.xy, coord.z, lod) + #define UNITY_SAMPLE_TEX2D(tex, coord) SAMPLE_TEXTURE2D(tex, sampler##tex, coord) + #define UNITY_SAMPLE_TEX2D_SAMPLER(tex, samp, coord) SAMPLE_TEXTURE2D(tex, sampler##samp, coord) + + #define UNITY_SAMPLE_TEX2D_LOD(tex,coord, lod) SAMPLE_TEXTURE2D_LOD(tex, sampler_##tex, coord, lod) + #define UNITY_SAMPLE_TEX2D_SAMPLER_LOD(tex,samplertex,coord, lod) SAMPLE_TEXTURE2D_LOD (tex, sampler##samplertex,coord, lod) + + #if defined(UNITY_COMPILER_HLSL) + #define UNITY_INITIALIZE_OUTPUT(type,name) name = (type)0; + #else + #define UNITY_INITIALIZE_OUTPUT(type,name) + #endif + + #define sampler2D_float sampler2D + #define sampler2D_half sampler2D + + #undef WorldNormalVector + #define WorldNormalVector(data, normal) mul(normal, data.TBNMatrix) + + #define UnityObjectToWorldNormal(normal) mul(GetObjectToWorldMatrix(), normal) + + + + +// HDRP Adapter stuff + #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Common.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/ShaderVariables.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/ShaderPass/FragInputs.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/ShaderPass/ShaderPass.cs.hlsl" + #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/TextureStack.hlsl" // Required to be include before we include properties as it define DECLARE_STACK_CB + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/ShaderGraphHeader.hlsl" // Need to be here for Gradient struct definition + + #ifdef RAYTRACING_SHADER_GRAPH_DEFAULT + #define RAYTRACING_SHADER_GRAPH_HIGH + #endif + + #ifdef RAYTRACING_SHADER_GRAPH_RAYTRACED + #define RAYTRACING_SHADER_GRAPH_LOW + #endif + // end + + + + + // If we use subsurface scattering, enable output split lighting (for forward pass) + #if defined(_MATERIAL_FEATURE_SUBSURFACE_SCATTERING) && !defined(_SURFACE_TYPE_TRANSPARENT) + #define OUTPUT_SPLIT_LIGHTING + #endif + + #define HAVE_RECURSIVE_RENDERING + + #if SHADERPASS == SHADERPASS_TRANSPARENT_DEPTH_PREPASS + #if !defined(_DISABLE_SSR_TRANSPARENT) && !defined(SHADER_UNLIT) + #define WRITE_NORMAL_BUFFER + #endif + #endif + + #ifndef DEBUG_DISPLAY + // In case of opaque we don't want to perform the alpha test, it is done in depth prepass and we use depth equal for ztest (setup from UI) + // Don't do it with debug display mode as it is possible there is no depth prepass in this case + #if !defined(_SURFACE_TYPE_TRANSPARENT) && defined(_ALPHATEST) + #if SHADERPASS == SHADERPASS_FORWARD + #define SHADERPASS_FORWARD_BYPASS_ALPHA_TEST + #elif SHADERPASS == SHADERPASS_GBUFFER + #define SHADERPASS_GBUFFER_BYPASS_ALPHA_TEST + #endif + #endif + #endif + + // Translate transparent motion vector define + #if defined(_TRANSPARENT_WRITES_MOTION_VEC) && defined(_SURFACE_TYPE_TRANSPARENT) + #define _WRITE_TRANSPARENT_MOTION_VECTOR + #endif + + + + + CBUFFER_START(UnityPerMaterial) + float _UseShadowThreshold; + float _BlendMode; + float _EnableBlendModePreserveSpecularLighting; + float _RayTracing; + float _RefractionModel; + + + half4 _Color; + half4 _MainTex_ST, _MainTex_TexelSize; + half _Alpha, _AlphaCutoffValue; + + #if ATLAS_ON + half _MinXUV, _MaxXUV, _MinYUV, _MaxYUV; + #endif + + #if GLOW_ON + half4 _GlowColor; + half _Glow, _GlowGlobal; + #endif + + #if HSV_ON + half _HsvShift, _HsvSaturation, _HsvBright; + #endif + + #if DISTORT_ON + half4 _DistortTex_ST; + half _DistortTexXSpeed, _DistortTexYSpeed, _DistortAmount; + #endif + + #if FADE_ON + half4 _FadeBurnColor, _FadeTex_ST, _FadeBurnTex_ST; + half _FadeAmount, _FadeBurnWidth, _FadeBurnTransition,_FadeBurnGlow; + #endif + + #if OUTBASE_ON + half4 _OutlineColor; + half _OutlineAlpha, _OutlineGlow, _OutlineWidth; + int _OutlinePixelWidth; + #endif + + #if OUTTEX_ON + half4 _OutlineTex_ST; + half _OutlineTexXSpeed, _OutlineTexYSpeed; + #endif + + #if OUTDIST_ON + half4 _OutlineDistortTex_ST; + half _OutlineDistortTexXSpeed, _OutlineDistortTexYSpeed, _OutlineDistortAmount; + #endif + + #if ALPHAOUTLINE_ON + half _AlphaOutlineGlow, _AlphaOutlinePower, _AlphaOutlineMinAlpha, _AlphaOutlineBlend; + half4 _AlphaOutlineColor; + #endif + + #if INNEROUTLINE_ON + half _InnerOutlineThickness, _InnerOutlineAlpha, _InnerOutlineGlow; + half4 _InnerOutlineColor; + #endif + + #if GRADIENT_ON + half _GradBlend, _GradBoostX, _GradBoostY; + half4 _GradTopRightCol, _GradTopLeftCol, _GradBotRightCol, _GradBotLeftCol; + #endif + + #if COLORSWAP_ON + half4 _ColorSwapRed, _ColorSwapGreen, _ColorSwapBlue; + half _ColorSwapRedLuminosity, _ColorSwapGreenLuminosity, _ColorSwapBlueLuminosity, _ColorSwapBlend; + #endif + + #if CHANGECOLOR_ON + half4 _ColorChangeNewCol, _ColorChangeTarget; + half _ColorChangeTolerance, _ColorChangeLuminosity; + #endif + #if CHANGECOLOR2_ON + half4 _ColorChangeNewCol2, _ColorChangeTarget2; + half _ColorChangeTolerance2; + #endif + #if CHANGECOLOR3_ON + half4 _ColorChangeNewCol3, _ColorChangeTarget3; + half _ColorChangeTolerance3; + #endif + + #if COLORRAMP_ON + half _ColorRampLuminosity, _ColorRampBlend; + #endif + + #if HITEFFECT_ON + half4 _HitEffectColor; + half _HitEffectGlow, _HitEffectBlend; + #endif + + #if NEGATIVE_ON + half _NegativeAmount; + #endif + + #if PIXELATE_ON + half _PixelateSize; + #endif + + #if GREYSCALE_ON + half _GreyscaleLuminosity, _GreyscaleBlend; + half4 _GreyscaleTintColor; + #endif + + #if POSTERIZE_ON + half _PosterizeNumColors, _PosterizeGamma; + #endif + + #if BLUR_ON + half _BlurIntensity; + #endif + + #if MOTIONBLUR_ON + half _MotionBlurAngle, _MotionBlurDist; + #endif + + #if GHOST_ON + half _GhostColorBoost, _GhostTransparency, _GhostBlend; + #endif + + #if HOLOGRAM_ON + half _HologramStripesAmount, _HologramMinAlpha, _HologramUnmodAmount, _HologramStripesSpeed, _HologramMaxAlpha, _HologramBlend; + half4 _HologramStripeColor; + #endif + + #if CHROMABERR_ON + half _ChromAberrAmount, _ChromAberrAlpha; + #endif + + #if GLITCH_ON + half _GlitchAmount, _GlitchSize; + #endif + + #if FLICKER_ON + half _FlickerFreq, _FlickerPercent, _FlickerAlpha; + #endif + + #if SHADOW_ON + half _ShadowX, _ShadowY, _ShadowAlpha; + half4 _ShadowColor; + #endif + + #if SHINE_ON + half4 _ShineColor; + half _ShineLocation, _ShineRotate, _ShineWidth, _ShineGlow; + #endif + + #if CONTRAST_ON + half _Contrast, _Brightness; + #endif + + #if OVERLAY_ON + half4 _OverlayTex_ST, _OverlayColor; + half _OverlayGlow, _OverlayBlend, _OverlayTextureScrollXSpeed, _OverlayTextureScrollYSpeed; + #endif + + #if DOODLE_ON + half _HandDrawnAmount, _HandDrawnSpeed; + #endif + + #if WIND_ON + half _GrassSpeed, _GrassWind, _GrassManualAnim, _GrassRadialBend; + #endif + + #if WAVEUV_ON + float _WaveAmount, _WaveSpeed, _WaveStrength, _WaveX, _WaveY; + #endif + + #if ROUNDWAVEUV_ON + half _RoundWaveStrength, _RoundWaveSpeed; + #endif + + #if RECTSIZE_ON + half _RectSize; + #endif + + #if OFFSETUV_ON + half _OffsetUvX, _OffsetUvY; + #endif + + #if CLIPPING_ON + half _ClipUvLeft, _ClipUvRight, _ClipUvUp, _ClipUvDown; + #endif + + #if RADIALCLIPPING_ON + half _RadialStartAngle, _RadialClip, _RadialClip2; + #endif + + #if TEXTURESCROLL_ON + half _TextureScrollXSpeed, _TextureScrollYSpeed; + #endif + + #if ZOOMUV_ON + half _ZoomUvAmount; + #endif + + #if WARP_ON + half _WarpStrength, _WarpSpeed, _WarpScale; + #endif + + #if TWISTUV_ON + half _TwistUvAmount, _TwistUvPosX, _TwistUvPosY, _TwistUvRadius; + #endif + + #if ROTATEUV_ON + half _RotateUvAmount; + #endif + + #if FISHEYE_ON + half _FishEyeUvAmount; + #endif + + #if PINCH_ON + half _PinchUvAmount; + #endif + + #if SHAKEUV_ON + half _ShakeUvSpeed, _ShakeUvX, _ShakeUvY; + #endif + + #if NORMALMAP_ON + half _NormalStrength; + #endif + + float _RandomSeed; + + + + + CBUFFER_END + + + + // -- Property used by ScenePickingPass + #ifdef SCENEPICKINGPASS + float4 _SelectionID; + #endif + + // -- Properties used by SceneSelectionPass + #ifdef SCENESELECTIONPASS + int _ObjectId; + int _PassValue; + #endif + + + // data across stages, stripped like the above. + struct VertexToPixel + { + float4 pos : SV_POSITION; + float3 worldPos : TEXCOORD0; + float3 worldNormal : TEXCOORD1; + float4 worldTangent : TEXCOORD2; + float4 texcoord0 : TEXCOORD3; + float4 texcoord1 : TEXCOORD4; + float4 texcoord2 : TEXCOORD5; + // #if %TEXCOORD3REQUIREKEY% + float4 texcoord3 : TEXCOORD6; + // #endif + + // #if %SCREENPOSREQUIREKEY% + // float4 screenPos : TEXCOORD7; + // #endif + + // #if %VERTEXCOLORREQUIREKEY% + float4 vertexColor : COLOR; + // #endif + + // #if %EXTRAV2F0REQUIREKEY% + // float4 extraV2F0 : TEXCOORD8; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // float4 extraV2F1 : TEXCOORD9; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // float4 extraV2F2 : TEXCOORD10; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // float4 extraV2F3 : TEXCOORD11; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // float4 extraV2F4 : TEXCOORD12; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // float4 extraV2F5 : TEXCOORD13; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // float4 extraV2F6 : TEXCOORD14; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // float4 extraV2F7 : TEXCOORD15; + // #endif + + #if UNITY_ANY_INSTANCING_ENABLED + UNITY_VERTEX_INPUT_INSTANCE_ID + #endif // UNITY_ANY_INSTANCING_ENABLED + + #if _HDRP && (_PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR))) + float4 previousPositionCS : TEXCOORD16; // Contain previous transform position (in case of skinning for example) + float4 motionVectorCS : TEXCOORD17; + #endif + + UNITY_VERTEX_OUTPUT_STEREO + }; + + + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Debug/DebugDisplay.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/Material.hlsl" + #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/NormalSurfaceGradient.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/Lit/Lit.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/BuiltinUtilities.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/MaterialUtilities.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/Decal/DecalUtilities.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/Lit/LitDecalData.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/ShaderGraphFunctions.hlsl" + + + + + // data describing the user output of a pixel + struct Surface + { + half3 Albedo; + half Height; + half3 Normal; + half Smoothness; + half3 Emission; + half Metallic; + half3 Specular; + half Occlusion; + half SpecularPower; // for simple lighting + half Alpha; + float outputDepth; // if written, SV_Depth semantic is used. ShaderData.clipPos.z is unused value + // HDRP Only + half SpecularOcclusion; + half SubsurfaceMask; + half Thickness; + half CoatMask; + half CoatSmoothness; + half Anisotropy; + half IridescenceMask; + half IridescenceThickness; + int DiffusionProfileHash; + float SpecularAAThreshold; + float SpecularAAScreenSpaceVariance; + // requires _OVERRIDE_BAKEDGI to be defined, but is mapped in all pipelines + float3 DiffuseGI; + float3 BackDiffuseGI; + float3 SpecularGI; + float ior; + float3 transmittanceColor; + float atDistance; + float transmittanceMask; + // requires _OVERRIDE_SHADOWMASK to be defines + float4 ShadowMask; + + // for decals + float NormalAlpha; + float MAOSAlpha; + + + }; + + // Data the user declares in blackboard blocks + struct Blackboard + { + + float blackboardDummyData; + }; + + // data the user might need, this will grow to be big. But easy to strip + struct ShaderData + { + float4 clipPos; // SV_POSITION + float3 localSpacePosition; + float3 localSpaceNormal; + float3 localSpaceTangent; + + float3 worldSpacePosition; + float3 worldSpaceNormal; + float3 worldSpaceTangent; + float tangentSign; + + float3 worldSpaceViewDir; + float3 tangentSpaceViewDir; + + float4 texcoord0; + float4 texcoord1; + float4 texcoord2; + float4 texcoord3; + + float2 screenUV; + float4 screenPos; + + float4 vertexColor; + bool isFrontFace; + + float4 extraV2F0; + float4 extraV2F1; + float4 extraV2F2; + float4 extraV2F3; + float4 extraV2F4; + float4 extraV2F5; + float4 extraV2F6; + float4 extraV2F7; + + float3x3 TBNMatrix; + Blackboard blackboard; + }; + + struct VertexData + { + #if SHADER_TARGET > 30 + // uint vertexID : SV_VertexID; + #endif + float4 vertex : POSITION; + float3 normal : NORMAL; + float4 tangent : TANGENT; + float4 texcoord0 : TEXCOORD0; + + // optimize out mesh coords when not in use by user or lighting system + #if _URP && (_USINGTEXCOORD1 || _PASSMETA || _PASSFORWARD || _PASSGBUFFER) + float4 texcoord1 : TEXCOORD1; + #endif + + #if _URP && (_USINGTEXCOORD2 || _PASSMETA || ((_PASSFORWARD || _PASSGBUFFER) && defined(DYNAMICLIGHTMAP_ON))) + float4 texcoord2 : TEXCOORD2; + #endif + + #if _STANDARD && (_USINGTEXCOORD1 || (_PASSMETA || ((_PASSFORWARD || _PASSGBUFFER || _PASSFORWARDADD) && LIGHTMAP_ON))) + float4 texcoord1 : TEXCOORD1; + #endif + #if _STANDARD && (_USINGTEXCOORD2 || (_PASSMETA || ((_PASSFORWARD || _PASSGBUFFER) && DYNAMICLIGHTMAP_ON))) + float4 texcoord2 : TEXCOORD2; + #endif + + + #if _HDRP + float4 texcoord1 : TEXCOORD1; + float4 texcoord2 : TEXCOORD2; + #endif + + // #if %TEXCOORD3REQUIREKEY% + float4 texcoord3 : TEXCOORD3; + // #endif + + // #if %VERTEXCOLORREQUIREKEY% + float4 vertexColor : COLOR; + // #endif + + #if _PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR)) + float3 previousPositionOS : TEXCOORD4; // Contain previous transform position (in case of skinning for example) + #if defined (_ADD_PRECOMPUTED_VELOCITY) + float3 precomputedVelocity : TEXCOORD5; // Add Precomputed Velocity (Alembic computes velocities on runtime side). + #endif + #endif + + UNITY_VERTEX_INPUT_INSTANCE_ID + }; + + struct TessVertex + { + float4 vertex : INTERNALTESSPOS; + float3 normal : NORMAL; + float4 tangent : TANGENT; + float4 texcoord0 : TEXCOORD0; + float4 texcoord1 : TEXCOORD1; + float4 texcoord2 : TEXCOORD2; + + // #if %TEXCOORD3REQUIREKEY% + float4 texcoord3 : TEXCOORD3; + // #endif + + // #if %VERTEXCOLORREQUIREKEY% + float4 vertexColor : COLOR; + // #endif + + // #if %EXTRAV2F0REQUIREKEY% + // float4 extraV2F0 : TEXCOORD5; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // float4 extraV2F1 : TEXCOORD6; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // float4 extraV2F2 : TEXCOORD7; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // float4 extraV2F3 : TEXCOORD8; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // float4 extraV2F4 : TEXCOORD9; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // float4 extraV2F5 : TEXCOORD10; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // float4 extraV2F6 : TEXCOORD11; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // float4 extraV2F7 : TEXCOORD12; + // #endif + + #if _PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR)) + float3 previousPositionOS : TEXCOORD13; // Contain previous transform position (in case of skinning for example) + #if defined (_ADD_PRECOMPUTED_VELOCITY) + float3 precomputedVelocity : TEXCOORD14; + #endif + #endif + + UNITY_VERTEX_INPUT_INSTANCE_ID + UNITY_VERTEX_OUTPUT_STEREO + }; + + struct ExtraV2F + { + float4 extraV2F0; + float4 extraV2F1; + float4 extraV2F2; + float4 extraV2F3; + float4 extraV2F4; + float4 extraV2F5; + float4 extraV2F6; + float4 extraV2F7; + Blackboard blackboard; + float4 time; + }; + + + float3 WorldToTangentSpace(ShaderData d, float3 normal) + { + return mul(d.TBNMatrix, normal); + } + + float3 TangentToWorldSpace(ShaderData d, float3 normal) + { + return mul(normal, d.TBNMatrix); + } + + // in this case, make standard more like SRPs, because we can't fix + // unity_WorldToObject in HDRP, since it already does macro-fu there + + #if _STANDARD + float3 TransformWorldToObject(float3 p) { return mul(unity_WorldToObject, float4(p, 1)); }; + float3 TransformObjectToWorld(float3 p) { return mul(unity_ObjectToWorld, float4(p, 1)); }; + float4 TransformWorldToObject(float4 p) { return mul(unity_WorldToObject, p); }; + float4 TransformObjectToWorld(float4 p) { return mul(unity_ObjectToWorld, p); }; + float4x4 GetWorldToObjectMatrix() { return unity_WorldToObject; } + float4x4 GetObjectToWorldMatrix() { return unity_ObjectToWorld; } + #if (defined(SHADER_API_D3D11) || defined(SHADER_API_XBOXONE) || defined(UNITY_COMPILER_HLSLCC) || defined(SHADER_API_PSSL) || (SHADER_TARGET_SURFACE_ANALYSIS && !SHADER_TARGET_SURFACE_ANALYSIS_MOJOSHADER)) + #define UNITY_SAMPLE_TEX2D_LOD(tex,coord, lod) tex.SampleLevel (sampler##tex,coord, lod) + #define UNITY_SAMPLE_TEX2D_SAMPLER_LOD(tex,samplertex,coord, lod) tex.SampleLevel (sampler##samplertex,coord, lod) + #else + #define UNITY_SAMPLE_TEX2D_LOD(tex,coord,lod) tex2D (tex,coord,0,lod) + #define UNITY_SAMPLE_TEX2D_SAMPLER_LOD(tex,samplertex,coord,lod) tex2D (tex,coord,0,lod) + #endif + + #undef GetWorldToObjectMatrix() + + #define GetWorldToObjectMatrix() unity_WorldToObject + + + #endif + + float3 GetCameraWorldPosition() + { + #if _HDRP + return GetCameraRelativePositionWS(_WorldSpaceCameraPos); + #else + return _WorldSpaceCameraPos; + #endif + } + + #if _GRABPASSUSED + #if _STANDARD + TEXTURE2D(%GRABTEXTURE%); + SAMPLER(sampler_%GRABTEXTURE%); + #endif + + half3 GetSceneColor(float2 uv) + { + #if _STANDARD + return SAMPLE_TEXTURE2D(%GRABTEXTURE%, sampler_%GRABTEXTURE%, uv).rgb; + #else + return SHADERGRAPH_SAMPLE_SCENE_COLOR(uv); + #endif + } + #endif + + + + #if _STANDARD + UNITY_DECLARE_DEPTH_TEXTURE(_CameraDepthTexture); + float GetSceneDepth(float2 uv) { return SAMPLE_DEPTH_TEXTURE(_CameraDepthTexture, uv); } + float GetLinear01Depth(float2 uv) { return Linear01Depth(GetSceneDepth(uv)); } + float GetLinearEyeDepth(float2 uv) { return LinearEyeDepth(GetSceneDepth(uv)); } + #else + float GetSceneDepth(float2 uv) { return SHADERGRAPH_SAMPLE_SCENE_DEPTH(uv); } + float GetLinear01Depth(float2 uv) { return Linear01Depth(GetSceneDepth(uv), _ZBufferParams); } + float GetLinearEyeDepth(float2 uv) { return LinearEyeDepth(GetSceneDepth(uv), _ZBufferParams); } + #endif + + float3 GetWorldPositionFromDepthBuffer(float2 uv, float3 worldSpaceViewDir) + { + float eye = GetLinearEyeDepth(uv); + float3 camView = mul((float3x3)GetObjectToWorldMatrix(), transpose(mul(GetWorldToObjectMatrix(), UNITY_MATRIX_I_V)) [2].xyz); + + float dt = dot(worldSpaceViewDir, camView); + float3 div = worldSpaceViewDir/dt; + float3 wpos = (eye * div) + GetCameraWorldPosition(); + return wpos; + } + + #if _HDRP + float3 ObjectToWorldSpacePosition(float3 pos) + { + return GetAbsolutePositionWS(TransformObjectToWorld(pos)); + } + #else + float3 ObjectToWorldSpacePosition(float3 pos) + { + return TransformObjectToWorld(pos); + } + #endif + + #if _STANDARD + UNITY_DECLARE_SCREENSPACE_TEXTURE(_CameraDepthNormalsTexture); + float3 GetSceneNormal(float2 uv, float3 worldSpaceViewDir) + { + float4 depthNorms = UNITY_SAMPLE_SCREENSPACE_TEXTURE(_CameraDepthNormalsTexture, uv); + float3 norms = DecodeViewNormalStereo(depthNorms); + norms = mul((float3x3)GetWorldToViewMatrix(), norms) * 0.5 + 0.5; + return norms; + } + #elif _HDRP && !_DECALSHADER + + float3 GetSceneNormal(float2 uv, float3 worldSpaceViewDir) + { + NormalData nd; + DecodeFromNormalBuffer(_ScreenSize.xy * uv, nd); + return nd.normalWS; + } + #elif _URP + #if (SHADER_LIBRARY_VERSION_MAJOR >= 10) + #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/DeclareNormalsTexture.hlsl" + #endif + + float3 GetSceneNormal(float2 uv, float3 worldSpaceViewDir) + { + #if (SHADER_LIBRARY_VERSION_MAJOR >= 10) + return SampleSceneNormals(uv); + #else + float3 wpos = GetWorldPositionFromDepthBuffer(uv, worldSpaceViewDir); + return normalize(-cross(ddx(wpos), ddy(wpos))) * 0.5 + 0.5; + #endif + + } + #endif + + #if _HDRP + + half3 UnpackNormalmapRGorAG(half4 packednormal) + { + // This do the trick + packednormal.x *= packednormal.w; + + half3 normal; + normal.xy = packednormal.xy * 2 - 1; + normal.z = sqrt(1 - saturate(dot(normal.xy, normal.xy))); + return normal; + } + half3 UnpackNormal(half4 packednormal) + { + #if defined(UNITY_NO_DXT5nm) + return packednormal.xyz * 2 - 1; + #else + return UnpackNormalmapRGorAG(packednormal); + #endif + } + #endif + #if _HDRP || _URP + + half3 UnpackScaleNormal(half4 packednormal, half scale) + { + #ifndef UNITY_NO_DXT5nm + // Unpack normal as DXT5nm (1, y, 1, x) or BC5 (x, y, 0, 1) + // Note neutral texture like "bump" is (0, 0, 1, 1) to work with both plain RGB normal and DXT5nm/BC5 + packednormal.x *= packednormal.w; + #endif + half3 normal; + normal.xy = (packednormal.xy * 2 - 1) * scale; + normal.z = sqrt(1 - saturate(dot(normal.xy, normal.xy))); + return normal; + } + + #endif + + + void GetSun(out float3 lightDir, out float3 color) + { + lightDir = float3(0.5, 0.5, 0); + color = 1; + #if _HDRP + if (_DirectionalLightCount > 0) + { + DirectionalLightData light = _DirectionalLightDatas[0]; + lightDir = -light.forward.xyz; + color = light.color; + } + #elif _STANDARD + lightDir = normalize(_WorldSpaceLightPos0.xyz); + color = _LightColor0.rgb; + #elif _URP + Light light = GetMainLight(); + lightDir = light.direction; + color = light.color; + #endif + } + + + + + + + + + + TEXTURE2D(_MainTex); + SAMPLER(sampler_MainTex); + + #if GLOW_ON + TEXTURE2D(_GlowTex); + SAMPLER(sampler_GlowTex); + #endif + + #if FADE_ON + TEXTURE2D(_FadeTex); + SAMPLER(sampler_FadeTex); + + TEXTURE2D(_FadeBurnTex); + SAMPLER(sampler_FadeBurnTex); + #endif + + #if DISTORT_ON + TEXTURE2D(_DistortTex); + SAMPLER(sampler_DistortTex); + #endif + + #if OUTTEX_ON + TEXTURE2D(_OutlineTex); + SAMPLER(sampler_OutlineTex); + #endif + + #if OUTDIST_ON + TEXTURE2D(_OutlineDistortTex); + SAMPLER(sampler_OutlineDistortTex); + #endif + + #if COLORSWAP_ON + TEXTURE2D(_ColorSwapTex); + SAMPLER(sampler_ColorSwapTex); + #endif + + #if COLORRAMP_ON + TEXTURE2D(_ColorRampTex); + TEXTURE2D(_ColorRampTexGradient); + SAMPLER(sampler_ColorRampTex); + SAMPLER(sampler_ColorRampTexGradient); + #endif + + #if SHINE_ON + TEXTURE2D(_ShineMask); + SAMPLER(sampler_ShineMask); + #endif + + #if OVERLAY_ON + TEXTURE2D(_OverlayTex); + SAMPLER(sampler_OverlayTex); + #endif + + #if NORMALMAP_ON + TEXTURE2D(_NormalMap); + SAMPLER(sampler_NormalMap); + #endif + + + half3 GetPixel(in int offsetX, in int offsetY, in half2 uv, in Texture2D _tex, in SamplerState _sampler) + { + half2 _uv = uv + half2(offsetX * _MainTex_TexelSize.x, offsetY * _MainTex_TexelSize.y); + half4 col = SAMPLE_TEXTURE2D(_tex, _sampler, _uv); + return col.rgb; + } + + + //BLURS------------------------------------------------------------------------- + half4 Blur(half2 uv, Texture2D source, SamplerState sampler_source, half Intensity) + { + const half2 texelSize = 1.0 / _ScreenParams.xy; + const half4 color = SAMPLE_TEXTURE2D(source, sampler_source, uv); + const half2 offset = Intensity * texelSize; + + half4 accumulatedColor = color; + half accumulatedWeight = 1.0; + for (int x = -1; x <= 1; x++) + { + for (int y = -1; y <= 1; y++) + { + const half2 sampleUV = uv + half2(x, y) * offset; + const half4 sampleColor = SAMPLE_TEXTURE2D(source, sampler_source, sampleUV); + + accumulatedColor += sampleColor; + accumulatedWeight += 1.0; + } + } + + half4 blurredColor = accumulatedColor / accumulatedWeight; + return blurredColor; + } + + half BlurHD_G(half bhqp, half x) + { + return exp(-(x * x) / (2.0 * bhqp * bhqp)); + } + half4 BlurHD(half2 uv, Texture2D source, SamplerState sampler_source, half BlurAmount, half xScale, half yScale) + { + int iterations = 16; + int halfIterations = iterations / 2; + half sigmaX = 0.1 + BlurAmount * 0.5; + half sigmaY = sigmaX; + half total = 0.0; + half4 ret = half4(0, 0, 0, 0); + for (int iy = 0; iy < iterations; ++iy) + { + half fy = BlurHD_G(sigmaY, half(iy) -half(halfIterations)); + half offsetY = half(iy - halfIterations) * 0.00390625 * xScale; + for (int ix = 0; ix < iterations; ++ix) + { + half fx = BlurHD_G(sigmaX, half(ix) - half(halfIterations)); + half offsetX = half(ix - halfIterations) * 0.00390625 * yScale; + total += fx * fy; + ret += SAMPLE_TEXTURE2D(source, sampler_source, uv + half2(offsetX, offsetY)) * fx * fy; + } + } + return ret / total; + } + //----------------------------------------------------------------------- + + + //------------------------------------------- + half RemapFloat(half inValue, half inMin, half inMax, half outMin, half outMax){ + return outMin + (inValue - inMin) * (outMax - outMin) / (inMax - inMin); + } + //------------------------------------------- + + //----------------------------------------------------------------------- + half rand(half2 seed, half offset) { + return (frac(sin(dot(seed, half2(12.9898, 78.233))) * 43758.5453) + offset) % 1.0; + } + + half rand2(half2 seed, half offset) { + return (frac(sin(dot(seed * floor(50 + (_Time.x % 1.0) * 12.), half2(127.1, 311.7))) * 43758.5453123) + offset) % 1.0; + } + + half rand2CustomTime(half2 seed, half offset, half customTime) { + return (frac(sin(dot(seed * floor(50 + (customTime % 1.0) * 12.), half2(127.1, 311.7))) * 43758.5453123) + offset) % 1.0; + } + //----------------------------------------------------------------------- + + + void Ext_ModifyVertex0 (inout VertexData v, inout ExtraV2F d) + { + //BILBOARD_ON + #if BILBOARD_ON + half3 camRight = mul((half3x3)unity_CameraToWorld, half3(1,0,0)); + half3 camUp = half3(0,1,0); + #if BILBOARDY_ON + camUp = mul((half3x3)unity_CameraToWorld, half3(0,1,0)); + #endif + half3 localPos = v.vertex.x * camRight + v.vertex.y * camUp; + v.vertex = half4(localPos, 1); + #endif + //----------------------------------------------------------- + + v.texcoord0.xy = TRANSFORM_TEX(v.texcoord0.xy, _MainTex); + half2 center = half2(0.5, 0.5); + #if ATLAS_ON + center = half2((_MaxXUV + _MinXUV) / 2.0, (_MaxYUV + _MinYUV) / 2.0); + #endif + + //POLARUV_ON + #if POLARUV_ON + v.texcoord0.xy = v.texcoord0.xy - center; + #endif + + //---------------------------------------- + + //ROTATEUV_ON + #if ROTATEUV_ON + half2 uvC = v.texcoord0.xy; + half cosAngle = cos(_RotateUvAmount); + half sinAngle = sin(_RotateUvAmount); + half2x2 rot = half2x2(cosAngle, -sinAngle, sinAngle, cosAngle); + uvC -= center; + v.texcoord0.xy = mul(rot, uvC); + v.texcoord0.xy += center; + #endif + //-------------------- + + #if RECTSIZE_ON + v.vertex.xyz += (v.vertex.xyz * (_RectSize - 1.0)); + #endif + + #if OUTTEX_ON + v.texcoord1.xy = TRANSFORM_TEX(v.texcoord0.xy, _OutlineTex); + #endif + + #if OUTDIST_ON + v.texcoord2.xy = TRANSFORM_TEX(v.texcoord0.xy, _OutlineDistortTex); + #endif + + #if DISTORT_ON + v.texcoord3.xy = TRANSFORM_TEX(v.texcoord0.xy, _DistortTex); + #endif + } + + void Ext_SurfaceFunction0 (inout Surface o, ShaderData d) + { + half randomSeed = _RandomSeed; + + float2 uvRect = d.texcoord0; + half2 center = half2(0.5, 0.5); + #if ATLAS_ON + center = half2((_MaxXUV + _MinXUV) / 2.0, (_MaxYUV + _MinYUV) / 2.0); + uvRect = half2((d.texcoord0.x - _MinXUV) / (_MaxXUV - _MinXUV), (d.texcoord0.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half2 centerTiled = half2(center.x * _MainTex_ST.x, center.y * _MainTex_ST.y); + + //CLIPPING_ON + #if CLIPPING_ON + half2 tiledUv = half2(d.texcoord0.x / _MainTex_ST.x, d.texcoord0.y / _MainTex_ST.y); + #if ATLAS_ON + tiledUv = half2((tiledUv.x - _MinXUV) / (_MaxXUV - _MinXUV), (tiledUv.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + clip((1 - _ClipUvUp) - tiledUv.y); + clip(tiledUv.y - _ClipUvDown); + clip((1 - _ClipUvRight) - tiledUv.x); + clip(tiledUv.x - _ClipUvLeft); + #endif + //---------------------------------- + + //RADIALCLIPPING_ON + #if RADIALCLIPPING_ON + half2 tiledUv2 = half2(d.texcoord0.x / _MainTex_ST.x, d.texcoord0.y / _MainTex_ST.y); + #if ATLAS_ON + tiledUv2 = half2((tiledUv2.x - _MinXUV) / (_MaxXUV - _MinXUV), (tiledUv2.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half startAngle = _RadialStartAngle - _RadialClip; + half endAngle = _RadialStartAngle + _RadialClip2; + half offset0 = clamp(0, 360, startAngle + 360); + half offset360 = clamp(0, 360, endAngle - 360); + half2 atan2Coord = half2(lerp(-1, 1, tiledUv2.x), lerp(-1, 1, tiledUv2.y)); + half atanAngle = atan2(atan2Coord.y, atan2Coord.x) * 57.3; // angle in degrees + if(atanAngle < 0) atanAngle = 360 + atanAngle; + if(atanAngle >= startAngle && atanAngle <= endAngle) discard; + if(atanAngle <= offset360) discard; + if(atanAngle >= offset0) discard; + #endif + + //----------------------------- + + //TEXTURESCROLL_ON && ATLAS_ON + #if TEXTURESCROLL_ON && ATLAS_ON + d.texcoord0.xy = half2(_MinXUV + ((_MaxXUV - _MinXUV) * (abs(((_Time.y + randomSeed) * _TextureScrollXSpeed) + uvRect.x) % 1)), + _MinYUV + ((_MaxYUV - _MinYUV) * (abs(((_Time.y + randomSeed) * _TextureScrollYSpeed) + uvRect.y) % 1))); + #endif + //---------------------------- + + //OFFSETUV_ON + #if OFFSETUV_ON + #if ATLAS_ON + d.texcoord0.xy = half2(_MinXUV + ((_MaxXUV - _MinXUV) * (abs((_OffsetUvX + uvRect.x) % 1))), + _MinYUV + ((_MaxYUV - _MinYUV) * (abs(_OffsetUvY + uvRect.y) % 1))); + #else + d.texcoord0.xy += half2(_OffsetUvX, _OffsetUvY); + #endif + #endif + + //---------------------- + + //POLARUV_ON + #if POLARUV_ON + d.texcoord0.xy = half2(atan2(d.texcoord0.y, d.texcoord0.x) / (2.0f * 3.141592653589f), length(d.texcoord0.xy)); + d.texcoord0.xy *= _MainTex_ST.xy; + #endif + + //-------------------------------------- + + //TWISTUV_ON + #if TWISTUV_ON + #if ATLAS_ON + _TwistUvPosX = ((_MaxXUV - _MinXUV) * _TwistUvPosX) + _MinXUV; + _TwistUvPosY = ((_MaxYUV - _MinYUV) * _TwistUvPosY) + _MinYUV; + #endif + half2 tempUv = d.texcoord0.xy - half2(_TwistUvPosX * _MainTex_ST.x, _TwistUvPosY * _MainTex_ST.y); + _TwistUvRadius *= (_MainTex_ST.x + _MainTex_ST.y) / 2; + half percent = (_TwistUvRadius - length(tempUv)) / _TwistUvRadius; + half theta = percent * percent * (2.0 * sin(_TwistUvAmount)) * 8.0; + half s = sin(theta); + half c = cos(theta); + half beta = max(sign(_TwistUvRadius - length(tempUv)), 0.0); + tempUv = half2(dot(tempUv, half2(c, -s)), dot(tempUv, half2(s, c))) * beta + tempUv * (1 - beta); + tempUv += half2(_TwistUvPosX * _MainTex_ST.x, _TwistUvPosY * _MainTex_ST.y); + d.texcoord0.xy = tempUv; + #endif + + //-------------------------------------------- + + //FISHEYE_ON + #if FISHEYE_ON + half bind = length(centerTiled); + half2 dF = d.texcoord0.xy - centerTiled; + half dFlen = length(dF); + half fishInt = (3.14159265359 / bind) * (_FishEyeUvAmount + 0.001); + d.texcoord0.xy = centerTiled + (dF / (max(0.0001, dFlen))) * tan(dFlen * fishInt) * bind / tan(bind * fishInt); + #endif + //--------------------------------------------- + + //PINCH_ON + #if PINCH_ON + half2 dP = d.texcoord0.xy - centerTiled; + half pinchInt = (3.141592 / length(centerTiled)) * (-_PinchUvAmount + 0.001); + d.texcoord0.xy = centerTiled + normalize(dP) * atan(length(dP) * -pinchInt * 10.0) * 0.5 / atan(-pinchInt * 5); + #endif + + //--------------------------------------------- + + //ZOOMUV_ON + #if ZOOMUV_ON + d.texcoord0.xy -= centerTiled; + d.texcoord0.xy = d.texcoord0.xy * _ZoomUvAmount; + d.texcoord0.xy += centerTiled; + #endif + + //----------------------------------------------- + + //DOODLE_ON + #if DOODLE_ON + half2 uvCopy = uvRect; + _HandDrawnSpeed = (floor((_Time.x + randomSeed) * 20 * _HandDrawnSpeed) / _HandDrawnSpeed) * _HandDrawnSpeed; + uvCopy.x = sin((uvCopy.x * _HandDrawnAmount + _HandDrawnSpeed) * 4); + uvCopy.y = cos((uvCopy.y * _HandDrawnAmount + _HandDrawnSpeed) * 4); + d.texcoord0.xy = lerp(d.texcoord0.xy, d.texcoord0.xy + uvCopy, 0.0005 * _HandDrawnAmount); + #endif + + //-------------------------- + + //SHAKEUV_ON + #if SHAKEUV_ON + half xShake = sin((_Time.x + randomSeed) * _ShakeUvSpeed * 50) * _ShakeUvX; + half yShake = cos((_Time.x + randomSeed) * _ShakeUvSpeed * 50) * _ShakeUvY; + d.texcoord0.xy += half2(xShake * 0.012, yShake * 0.01); + #endif + + //------------------------------------------- + + //RECTSIZE_ON + #if RECTSIZE_ON + d.texcoord0.xy = d.texcoord0.xy * (_RectSize).xx + (((-_RectSize * 0.5) + 0.5)).xx; + #endif + + //------------------------------------------- + + //DISTORT_ON + #if DISTORT_ON + #if ATLAS_ON + d.texcoord3.x = d.texcoord3.x * (1 / (_MaxXUV - _MinXUV)); + d.texcoord3.y = d.texcoord3.y * (1 / (_MaxYUV - _MinYUV)); + #endif + + d.texcoord3.x += ((_Time.x + _RandomSeed) * _DistortTexXSpeed) % 1; + d.texcoord3.y += ((_Time.x + _RandomSeed) * _DistortTexYSpeed) % 1; + half distortAmnt = (SAMPLE_TEXTURE2D(_DistortTex, sampler_DistortTex, d.texcoord3.xy).r - 0.5) * 0.2 * _DistortAmount; + d.texcoord0.x += distortAmnt; + d.texcoord0.y += distortAmnt; + #endif + //------------------------------------------------------- + + //WARP_ON + #if WARP_ON + half2 warpUv = half2(d.texcoord0.x / _MainTex_ST.x, d.texcoord0.y / _MainTex_ST.y); + #if ATLAS_ON + warpUv = half2((warpUv.x - _MinXUV) / (_MaxXUV - _MinXUV), (warpUv.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + const float tau = 6.283185307179586; + float xWarp = (_Time.y + randomSeed) * _WarpSpeed + warpUv.x * tau / _WarpScale; + float yWarp = (_Time.y + randomSeed) * _WarpSpeed + warpUv.y * tau / _WarpScale; + float2 warp = float2(sin(xWarp), sin(yWarp)) * _WarpStrength; + d.texcoord0.xy += warp; + #endif + + //------------------------------------------------------- + + //WAVEUV_ON + #if WAVEUV_ON + float2 uvWave = half2(_WaveX * _MainTex_ST.x, _WaveY * _MainTex_ST.y) - d.texcoord0.xy; + uvWave %= 1; + #if ATLAS_ON + uvWave = half2(_WaveX, _WaveY) - uvRect; + #endif + uvWave.x *= _ScreenParams.x / _ScreenParams.y; + float waveTime = _Time.y + randomSeed; + float angWave = (sqrt(dot(uvWave, uvWave)) * _WaveAmount) - ((waveTime * _WaveSpeed)); + d.texcoord0.xy = d.texcoord0.xy + uvWave * sin(angWave) * (_WaveStrength / 1000.0); + #endif + //---------------------------------------------------- + + //ROUNDWAVEUV_ON + #if ROUNDWAVEUV_ON + half xWave = ((0.5 * _MainTex_ST.x) - uvRect.x); + half yWave = ((0.5 * _MainTex_ST.y) - uvRect.y) * (_MainTex_TexelSize.w / _MainTex_TexelSize.z); + half ripple = -sqrt(xWave*xWave + yWave* yWave); + d.texcoord0.xy += (sin((ripple + (_Time.y + randomSeed) * (_RoundWaveSpeed/10.0)) / 0.015) * (_RoundWaveStrength/10.0)) % 1; + #endif + //---------------------------------------------------- + + + //WIND_ON + #if WIND_ON + half windOffset = sin((_Time.x + randomSeed) * _GrassSpeed * 10); + half2 windCenter = half2(0.5, 0.1); + #if ATLAS_ON + windCenter.x = ((_MaxXUV - _MinXUV) * windCenter.x) + _MinXUV; + windCenter.y = ((_MaxYUV - _MinYUV) * windCenter.y) + _MinYUV; + #endif + #if !MANUALWIND_ON + d.texcoord0.x = fmod(abs(lerp(d.texcoord0.x, d.texcoord0.x + (_GrassWind * 0.01 * windOffset), uvRect.y)), 1); + #else + d.texcoord0.x = fmod(abs(lerp(d.texcoord0.x, d.texcoord0.x + (_GrassWind * 0.01 * _GrassManualAnim), uvRect.y)), 1); + windOffset = _GrassManualAnim; + #endif + half2 delta = d.texcoord0.xy - windCenter; + half delta2 = dot(delta.xy, delta.xy); + half2 delta_offset = delta2 * windOffset; + d.texcoord0.xy = d.texcoord0.xy + half2(delta.y, -delta.x) * delta_offset * _GrassRadialBend; + #endif + + //-------------------------------------------------------- + + //TEXTURESCROLL_ON && !ATLAS_ON + #if TEXTURESCROLL_ON && !ATLAS_ON + d.texcoord0.x += ((_Time.y + randomSeed) * _TextureScrollXSpeed) % 1; + d.texcoord0.y += ((_Time.y + randomSeed) * _TextureScrollYSpeed) % 1; + #endif + //------------------------------ + + //PIXELATE_ON + #if PIXELATE_ON + half aspectRatio = _MainTex_TexelSize.x / _MainTex_TexelSize.y; + half2 pixelSize = float2(_PixelateSize, _PixelateSize * aspectRatio); + d.texcoord0.xy = floor(d.texcoord0.xy * pixelSize) / pixelSize; + #endif + //-------------- + + half4 col = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy); + half originalAlpha = col.a; + col *= d.vertexColor; + + //NORMAL MAP + #if NORMALMAP_ON + half4 normalSample = SAMPLE_TEXTURE2D(_NormalMap, sampler_NormalMap, d.texcoord0.xy); + half3 normalTS = UnpackNormal(normalSample); + normalTS.xy *= _NormalStrength; + o.Normal = normalTS; + #endif + + + //GLITCH_ON + #if GLITCH_ON + half2 uvGlitch = uvRect; + uvGlitch.y -= 0.5; + half lineNoise = pow(rand2(floor(uvGlitch * half2(24., 19.) * _GlitchSize) * 4.0, randomSeed), 3.0) * _GlitchAmount + * pow(rand2(floor(uvGlitch * half2(38., 14.) * _GlitchSize) * 4.0, randomSeed), 3.0); + col = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(lineNoise * 0.02 * rand2(half2(2.0, 1), randomSeed), 0)) * d.vertexColor; + #endif + //-------------------------------------- + + //CHROMABERR_ON + #if CHROMABERR_ON + half4 r = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(_ChromAberrAmount/10, 0)) * d.vertexColor; + half4 b = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(-_ChromAberrAmount/10, 0)) * d.vertexColor; + col = half4(r.r * r.a, col.g, b.b * b.a, max(max(r.a, b.a) * _ChromAberrAlpha, col.a)); + #endif + + //-------------------------------- + + //BLUR_ON + #if BLUR_ON + #if ATLAS_ON + #if !BLURISHD_ON + col = BlurHD(d.texcoord0.xy, _MainTex, sampler_MainTex, _BlurIntensity, (_MaxXUV - _MinXUV), (_MaxYUV - _MinYUV)) * d.vertexColor; + #else + col = Blur(d.texcoord0.xy, _MainTex, sampler_MainTex, _BlurIntensity * (_MaxXUV - _MinXUV)) * d.vertexColor; + #endif + #else + #if !BLURISHD_ON + col = BlurHD(d.texcoord0.xy, _MainTex, sampler_MainTex, _BlurIntensity, 1, 1) * d.vertexColor; + #else + col = Blur(d.texcoord0.xy, _MainTex, sampler_MainTex, _BlurIntensity) * d.vertexColor; + #endif + #endif + #endif + + //-------------------- + + //MOTIONBLUR_ON + #if MOTIONBLUR_ON + _MotionBlurAngle = _MotionBlurAngle * 3.1415926; + #define rot(n) mul(n, half2x2(cos(_MotionBlurAngle), -sin(_MotionBlurAngle), sin(_MotionBlurAngle), cos(_MotionBlurAngle))) + _MotionBlurDist = _MotionBlurDist * 0.005; + #if ATLAS_ON + _MotionBlurDist *= (_MaxXUV - _MinXUV); + #endif + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(-_MotionBlurDist, -_MotionBlurDist))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(-_MotionBlurDist * 2, -_MotionBlurDist * 2))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(-_MotionBlurDist * 3, -_MotionBlurDist * 3))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(-_MotionBlurDist * 4, -_MotionBlurDist * 4))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(_MotionBlurDist, _MotionBlurDist))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(_MotionBlurDist * 2, _MotionBlurDist * 2))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(_MotionBlurDist * 3, _MotionBlurDist * 3))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(_MotionBlurDist * 4, _MotionBlurDist * 4))); + col.rgb = col.rgb / 9; + #endif + //------------------------------------ + + //NEGATIVE_ON + #if NEGATIVE_ON + col.rgb = lerp(col.rgb, 1 - col.rgb, _NegativeAmount); + #endif + + //-------------- + half luminance = 0; + + //GREYSCALE_ON && !GREYSCALEOUTLINE_ON + #if GREYSCALE_ON && !GREYSCALEOUTLINE_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + luminance = saturate(luminance + _GreyscaleLuminosity); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _GreyscaleTintColor, _GreyscaleBlend); + #endif + //------------------------------------ + + //GHOST_ON + #if GHOST_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + half4 ghostResult; + ghostResult.a = saturate(luminance - _GhostTransparency) * col.a; + ghostResult.rgb = col.rgb * (luminance + _GhostColorBoost); + col = lerp(col, ghostResult, _GhostBlend); + #endif + //------------------------------------ + + //INNEROUTLINE_ON + #if INNEROUTLINE_ON + half3 innerT = abs(GetPixel(0, _InnerOutlineThickness, d.texcoord0.xy, _MainTex, sampler_MainTex) - GetPixel(0, -_InnerOutlineThickness, d.texcoord0.xy, _MainTex, sampler_MainTex)); + innerT += abs(GetPixel(_InnerOutlineThickness, 0, d.texcoord0.xy, _MainTex, sampler_MainTex) - GetPixel(-_InnerOutlineThickness, 0, d.texcoord0.xy, _MainTex, sampler_MainTex)); + #if !ONLYINNEROUTLINE_ON + innerT = (innerT / 2.0) * col.a * _InnerOutlineAlpha; + col.rgb += length(innerT) * _InnerOutlineColor.rgb * _InnerOutlineGlow; + #else + innerT *= col.a * _InnerOutlineAlpha; + col.rgb = length(innerT) * _InnerOutlineColor.rgb * _InnerOutlineGlow; + col.a = step(0.3, col.r+col.g+col.b); + #endif + #endif + //------------------------------------------------------- + + //HITEFFECT_ON + #if HITEFFECT_ON + col.rgb = lerp(col.rgb, _HitEffectColor.rgb * _HitEffectGlow, _HitEffectBlend); + #endif + //-------------------- + + //GRADIENT_ON + #if GRADIENT_ON + half2 tiledUvGrad = half2(uvRect.x / _MainTex_ST.x, uvRect.y / _MainTex_ST.y); + #if GRADIENT2COL_ON + _GradTopRightCol = _GradTopLeftCol; + _GradBotRightCol = _GradBotLeftCol; + #endif + #if RADIALGRADIENT_ON + half radialDist = 1 - length(tiledUvGrad - half2(0.5, 0.5)); + radialDist *= (_MainTex_TexelSize.w / _MainTex_TexelSize.z); + radialDist = saturate(_GradBoostX * radialDist); + half4 gradientResult = lerp(_GradTopLeftCol, _GradBotLeftCol, radialDist); + #else + half gradXLerpFactor = saturate(pow(tiledUvGrad.x, _GradBoostX)); + half4 gradientResult = lerp(lerp(_GradBotLeftCol, _GradBotRightCol, gradXLerpFactor), + lerp(_GradTopLeftCol, _GradTopRightCol, gradXLerpFactor), saturate(pow(tiledUvGrad.y, _GradBoostY))); + #endif + gradientResult = lerp(col, gradientResult, _GradBlend); + col.rgb = gradientResult.rgb * col.a; + col.a *= gradientResult.a; + #endif + //-------------------------------------------------------------------- + + //CONTRAST_ON + #if CONTRAST_ON + col.rgb = (col.rgb - float3(0.5, 0.5, 0.5)) * _Contrast + float3(0.5, 0.5, 0.5); + col.rgb += _Brightness; + #endif + + //------------------------------------------------------------------- + + //COLORSWAP_ON + #if COLORSWAP_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + half4 swapMask = SAMPLE_TEXTURE2D(_ColorSwapTex, sampler_ColorSwapTex, d.texcoord0.xy); + swapMask.rgb *= swapMask.a; + half3 redSwap = _ColorSwapRed * swapMask.r * saturate(luminance + _ColorSwapRedLuminosity); + half3 greenSwap = _ColorSwapGreen * swapMask.g * saturate(luminance + _ColorSwapGreenLuminosity); + half3 blueSwap = _ColorSwapBlue * swapMask.b * saturate(luminance + _ColorSwapBlueLuminosity); + swapMask.rgb = col.rgb * saturate(1 - swapMask.r - swapMask.g - swapMask.b); + col.rgb = lerp(col.rgb, swapMask.rgb + redSwap + greenSwap + blueSwap, _ColorSwapBlend); + #endif + //-------------------------------------------------------------------- + + //COLORRAMP_ON && !COLORRAMPOUTLINE_ON + #if COLORRAMP_ON && !COLORRAMPOUTLINE_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + luminance = saturate(luminance + _ColorRampLuminosity); + #if GRADIENTCOLORRAMP_ON + col.rgb = lerp(col.rgb, SAMPLE_TEXTURE2D(_ColorRampTexGradient, sampler_ColorRampTexGradient, half2(luminance, 0)).rgb, _ColorRampBlend); + #else + col.rgb = lerp(col.rgb, SAMPLE_TEXTURE2D(_ColorRampTex, sampler_ColorRampTex, half2(luminance, 0)).rgb, _ColorRampBlend); + #endif + #endif + //-------------------------------------------------------------------- + + //CHANGECOLOR_ON + #if CHANGECOLOR_ON + float3 currChangeColor = saturate(col.rgb); + luminance = 0.3 * currChangeColor.r + 0.59 * currChangeColor.g + 0.11 * currChangeColor.b; + luminance = saturate(luminance + _ColorChangeLuminosity); + half3 dif = abs(currChangeColor - _ColorChangeTarget.rgb); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _ColorChangeNewCol.rgb, + max(sign(1 - saturate(dif.x + dif.y + dif.z) - _ColorChangeTolerance), 0.0)); + #if CHANGECOLOR2_ON + dif = abs(currChangeColor - _ColorChangeTarget2.rgb); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _ColorChangeNewCol2.rgb, + max(sign(1 - saturate(dif.x + dif.y + dif.z) - _ColorChangeTolerance2), 0.0)); + #endif + #if CHANGECOLOR3_ON + dif = abs(currChangeColor - _ColorChangeTarget3.rgb); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _ColorChangeNewCol3.rgb, + max(sign(1 - saturate(dif.x + dif.y + dif.z) - _ColorChangeTolerance3), 0.0)); + #endif + #endif + //------------------------------------------------------- + + //POSTERIZE_ON && !POSTERIZEOUTLINE_ON + #if POSTERIZE_ON && !POSTERIZEOUTLINE_ON + col.rgb = pow(col.rgb, _PosterizeGamma) * _PosterizeNumColors; + col.rgb = floor(col.rgb) / _PosterizeNumColors; + col.rgb = pow(col.rgb, 1.0 / _PosterizeGamma); + #endif + //------------------------------------ + + //HSV_ON + #if HSV_ON + half3 resultHsv = half3(col.rgb); + half cosHsv = _HsvBright * _HsvSaturation * cos(_HsvShift * 3.14159265 / 180); + half sinHsv = _HsvBright * _HsvSaturation * sin(_HsvShift * 3.14159265 / 180); + resultHsv.x = (.299 * _HsvBright + .701 * cosHsv + .168 * sinHsv) * col.x + + (.587 * _HsvBright - .587 * cosHsv + .330 * sinHsv) * col.y + + (.114 * _HsvBright - .114 * cosHsv - .497 * sinHsv) * col.z; + resultHsv.y = (.299 * _HsvBright - .299 * cosHsv - .328 * sinHsv) *col.x + + (.587 * _HsvBright + .413 * cosHsv + .035 * sinHsv) * col.y + + (.114 * _HsvBright - .114 * cosHsv + .292 * sinHsv) * col.z; + resultHsv.z = (.299 * _HsvBright - .3 * cosHsv + 1.25 * sinHsv) * col.x + + (.587 * _HsvBright - .588 * cosHsv - 1.05 * sinHsv) * col.y + + (.114 * _HsvBright + .886 * cosHsv - .203 * sinHsv) * col.z; + col.rgb = resultHsv; + #endif + //------------------------------------------------------- + + //OVERLAY_ON + #if OVERLAY_ON + half2 overlayUvs = d.texcoord0.xy; + overlayUvs.x += ((_Time.y + randomSeed) * _OverlayTextureScrollXSpeed) % 1; + overlayUvs.y += ((_Time.y + randomSeed) * _OverlayTextureScrollYSpeed) % 1; + half4 overlayCol = SAMPLE_TEXTURE2D(_OverlayTex, sampler_OverlayTex, TRANSFORM_TEX(overlayUvs, _OverlayTex)); + overlayCol.rgb *= _OverlayColor.rgb * _OverlayGlow; + #if !OVERLAYMULT_ON + overlayCol.rgb *= overlayCol.a * _OverlayColor.rgb * _OverlayColor.a * _OverlayBlend; + col.rgb += overlayCol.rgb; + #else + overlayCol.a *= _OverlayColor.a; + col = lerp(col, col * overlayCol, _OverlayBlend); + #endif + #endif + + //--------------------------------- + + //OUTBASE_ON + #if OUTBASE_ON + #if OUTBASEPIXELPERF_ON + half2 destUv = half2(_OutlinePixelWidth * _MainTex_TexelSize.x, _OutlinePixelWidth * _MainTex_TexelSize.y); + #else + half2 destUv = half2(_OutlineWidth * _MainTex_TexelSize.x * 200, _OutlineWidth * _MainTex_TexelSize.y * 200); + #endif + + #if OUTDIST_ON + d.texcoord3.x += ((_Time.x + _RandomSeed) * _OutlineDistortTexXSpeed) % 1; + d.texcoord3.y += ((_Time.x + _RandomSeed) * _OutlineDistortTexYSpeed) % 1; + #if ATLAS_ON + d.texcoord3 = half2((d.texcoord3.x - _MinXUV) / (_MaxXUV - _MinXUV), (d.texcoord3.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half outDistortAmnt = (SAMPLE_TEXTURE2D(_OutlineDistortTex, sampler_OutlineDistortTex, d.texcoord3).r - 0.5) * 0.2 * _OutlineDistortAmount; + destUv.x += outDistortAmnt; + destUv.y += outDistortAmnt; + #endif + + half spriteLeft = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(destUv.x, 0)).a; + half spriteRight = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy - half2(destUv.x, 0)).a; + half spriteBottom = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(0, destUv.y)).a; + half spriteTop = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy - half2(0, destUv.y)).a; + half result = spriteLeft + spriteRight + spriteBottom + spriteTop; + + #if OUTBASE8DIR_ON + half spriteTopLeft = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(destUv.x, destUv.y)).a; + half spriteTopRight = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(-destUv.x, destUv.y)).a; + half spriteBotLeft = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(destUv.x, -destUv.y)).a; + half spriteBotRight = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(-destUv.x, -destUv.y)).a; + result = result + spriteTopLeft + spriteTopRight + spriteBotLeft + spriteBotRight; + #endif + + result = step(0.05, saturate(result)); + + #if OUTTEX_ON + d.texcoord1.x += ((_Time.x + _RandomSeed) * _OutlineTexXSpeed) % 1; + d.texcoord1.y += ((_Time.x + _RandomSeed) * _OutlineTexYSpeed) % 1; + #if ATLAS_ON + d.texcoord1 = half2((d.texcoord1.x - _MinXUV) / (_MaxXUV - _MinXUV), (d.texcoord1.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half4 tempOutColor = SAMPLE_TEXTURE2D(_OutlineTex, sampler_OutlineTex, d.texcoord1); + tempOutColor *= _OutlineColor; + _OutlineColor = tempOutColor; + #endif + + result *= (1 - originalAlpha) * _OutlineAlpha; + + half4 outline = _OutlineColor * d.vertexColor.a; + outline.rgb *= _OutlineGlow; + outline.a = result; + #if ONLYOUTLINE_ON + col = outline; + #else + col = lerp(col, outline, result); + #endif + #endif + //------------------------------------------------------- + + //FADE_ON + #if FADE_ON + half2 tiledUvFade1 = TRANSFORM_TEX(d.texcoord0, _FadeTex); + half2 tiledUvFade2 = TRANSFORM_TEX(d.texcoord0, _FadeBurnTex); + #if ATLAS_ON + tiledUvFade1 = half2((tiledUvFade1.x - _MinXUV) / (_MaxXUV - _MinXUV), (tiledUvFade1.y - _MinYUV) / (_MaxYUV - _MinYUV)); + tiledUvFade2 = half2((tiledUvFade2.x - _MinXUV) / (_MaxXUV - _MinXUV), (tiledUvFade2.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half fadeTemp = SAMPLE_TEXTURE2D(_FadeTex, sampler_FadeTex, tiledUvFade1).r; + half fade = smoothstep(_FadeAmount, _FadeAmount + _FadeBurnTransition, fadeTemp); + half fadeBurn = saturate(smoothstep(_FadeAmount - _FadeBurnWidth, _FadeAmount - _FadeBurnWidth + 0.1, fadeTemp) * _FadeAmount); + col.a *= fade; + _FadeBurnColor.rgb *= _FadeBurnGlow; + col += fadeBurn * SAMPLE_TEXTURE2D(_FadeBurnTex, sampler_FadeBurnTex, tiledUvFade2) * _FadeBurnColor * originalAlpha * (1 - col.a); + #endif + //------------------------------------------------------- + + //SHADOW_ON + #if SHADOW_ON + half shadowA = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(_ShadowX, _ShadowY)).a; + half preMultShadowMask = 1 - (saturate(shadowA - col.a) * (1 - col.a)); + col.rgb *= 1 - ((shadowA - col.a) * (1 - col.a)); + col.rgb += (_ShadowColor * shadowA) * (1 - col.a); + col.a = max(shadowA * _ShadowAlpha * d.vertexColor.a, col.a); + #endif + + //------------------------------------------------------- + + //GLOW_ON + #if GLOW_ON + half4 emission; + #if GLOWTEX_ON + emission = SAMPLE_TEXTURE2D(_GlowTex, sampler_GlowTex, d.texcoord0); + #else + emission = col; + #endif + + col.rgb *= _GlowGlobal; + emission.rgb *= emission.a * col.a * _Glow * _GlowColor; + col.rgb += emission.rgb; + #endif + //------------------------------------------------------- + + //COLORRAMP_ON && COLORRAMPOUTLINE_ON + #if COLORRAMP_ON && COLORRAMPOUTLINE_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + luminance = saturate(luminance + _ColorRampLuminosity); + #if GRADIENTCOLORRAMP_ON + col.rgb = lerp(col.rgb, SAMPLE_TEXTURE2D(_ColorRampTexGradient, sampler_ColorRampTexGradient, half2(luminance, 0)).rgb, _ColorRampBlend); + #else + col.rgb = lerp(col.rgb, SAMPLE_TEXTURE2D(_ColorRampTex, sampler_ColorRampTex, half2(luminance, 0)).rgb, _ColorRampBlend); + #endif + #endif + //--------------- + + //GREYSCALE_ON && GREYSCALEOUTLINE_ON + #if GREYSCALE_ON && GREYSCALEOUTLINE_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + luminance = saturate(luminance + _GreyscaleLuminosity); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _GreyscaleTintColor, _GreyscaleBlend); + #endif + + //----------------------------------- + + //POSTERIZE_ON && POSTERIZEOUTLINE_ON + #if POSTERIZE_ON && POSTERIZEOUTLINE_ON + col.rgb = pow(col.rgb, _PosterizeGamma) * _PosterizeNumColors; + col.rgb = floor(col.rgb) / _PosterizeNumColors; + col.rgb = pow(col.rgb, 1.0 / _PosterizeGamma); + #endif + + //----------------------------------- + + //SHINE_ON + #if SHINE_ON + half2 uvShine = uvRect; + half cosAngle = cos(_ShineRotate); + half sinAngle = sin(_ShineRotate); + half2x2 rot = half2x2(cosAngle, -sinAngle, sinAngle, cosAngle); + uvShine -= half2(0.5, 0.5); + uvShine = mul(rot, uvShine); + uvShine += half2(0.5, 0.5); + half shineMask = SAMPLE_TEXTURE2D(_ShineMask, sampler_ShineMask, d.texcoord0.xy).a; + half currentDistanceProjection = (uvShine.x + uvShine.y) / 2; + half whitePower = 1 - (abs(currentDistanceProjection - _ShineLocation) / _ShineWidth); + col.rgb += col.a * whitePower * _ShineGlow * max(sign(currentDistanceProjection - (_ShineLocation - _ShineWidth)), 0.0) + * max(sign((_ShineLocation + _ShineWidth) - currentDistanceProjection), 0.0) * _ShineColor * shineMask; + #endif + + //----------------------------------- + + //HOLOGRAM_ON + #if HOLOGRAM_ON + half totalHologram = _HologramStripesAmount + _HologramUnmodAmount; + half hologramYCoord = ((uvRect.y + (((_Time.x + randomSeed) % 1) * _HologramStripesSpeed)) % totalHologram) / totalHologram; + hologramYCoord = abs(hologramYCoord); + half alpha = RemapFloat(saturate(hologramYCoord - (_HologramUnmodAmount/totalHologram)), 0.0, 1.0, _HologramMinAlpha, saturate(_HologramMaxAlpha)); + half hologramMask = max(sign((_HologramUnmodAmount/totalHologram) - hologramYCoord), 0.0); + half4 hologramResult = col; + hologramResult.a *= lerp(alpha, 1, hologramMask); + hologramResult.rgb *= max(1, _HologramMaxAlpha * max(sign(hologramYCoord - (_HologramUnmodAmount/totalHologram)), 0.0)); + hologramMask = 1 - step(0.01,hologramMask); + hologramResult.rgb += hologramMask * _HologramStripeColor * col.a; + col = lerp(col, hologramResult, _HologramBlend); + #endif + + //----------------------------------- + + //FLICKER_ON + #if FLICKER_ON + col.a *= saturate(col.a * step(frac(0.05 + (_Time.w + randomSeed) * _FlickerFreq), 1 - _FlickerPercent) + _FlickerAlpha); + #endif + //----------------------------------- + + //ALPHACUTOFF_ON + + //ALPHAROUND_ON + + //ALPHAOUTLINE_ON + #if ALPHAOUTLINE_ON + half alphaOutlineRes = pow(1 - col.a, max(_AlphaOutlinePower, 0.0001)) * step(_AlphaOutlineMinAlpha, col.a) * _AlphaOutlineBlend; + col.rgb = lerp(col.rgb, _AlphaOutlineColor.rgb * _AlphaOutlineGlow, alphaOutlineRes); + col.a = lerp(col.a, 1, alphaOutlineRes > 1); + #endif + //------------------------------------------------------- + + //FOG_ON + + //------------------ + + col *= _Color; + o.Albedo = col; + col.a *= _Alpha; + clip(col.a - _AlphaCutoffValue - 0.01); + o.Alpha = _Color.a; + } + + + + + + void ChainSurfaceFunction(inout Surface l, inout ShaderData d) + { + Ext_SurfaceFunction0(l, d); + // Ext_SurfaceFunction1(l, d); + // Ext_SurfaceFunction2(l, d); + // Ext_SurfaceFunction3(l, d); + // Ext_SurfaceFunction4(l, d); + // Ext_SurfaceFunction5(l, d); + // Ext_SurfaceFunction6(l, d); + // Ext_SurfaceFunction7(l, d); + // Ext_SurfaceFunction8(l, d); + // Ext_SurfaceFunction9(l, d); + // Ext_SurfaceFunction10(l, d); + // Ext_SurfaceFunction11(l, d); + // Ext_SurfaceFunction12(l, d); + // Ext_SurfaceFunction13(l, d); + // Ext_SurfaceFunction14(l, d); + // Ext_SurfaceFunction15(l, d); + // Ext_SurfaceFunction16(l, d); + // Ext_SurfaceFunction17(l, d); + // Ext_SurfaceFunction18(l, d); + // Ext_SurfaceFunction19(l, d); + // Ext_SurfaceFunction20(l, d); + // Ext_SurfaceFunction21(l, d); + // Ext_SurfaceFunction22(l, d); + // Ext_SurfaceFunction23(l, d); + // Ext_SurfaceFunction24(l, d); + // Ext_SurfaceFunction25(l, d); + // Ext_SurfaceFunction26(l, d); + // Ext_SurfaceFunction27(l, d); + // Ext_SurfaceFunction28(l, d); + // Ext_SurfaceFunction29(l, d); + } + +#if !_DECALSHADER + + void ChainModifyVertex(inout VertexData v, inout VertexToPixel v2p, float4 time) + { + ExtraV2F d; + + ZERO_INITIALIZE(ExtraV2F, d); + ZERO_INITIALIZE(Blackboard, d.blackboard); + // due to motion vectors in HDRP, we need to use the last + // time in certain spots. So if you are going to use _Time to adjust vertices, + // you need to use this time or motion vectors will break. + d.time = time; + + Ext_ModifyVertex0(v, d); + // Ext_ModifyVertex1(v, d); + // Ext_ModifyVertex2(v, d); + // Ext_ModifyVertex3(v, d); + // Ext_ModifyVertex4(v, d); + // Ext_ModifyVertex5(v, d); + // Ext_ModifyVertex6(v, d); + // Ext_ModifyVertex7(v, d); + // Ext_ModifyVertex8(v, d); + // Ext_ModifyVertex9(v, d); + // Ext_ModifyVertex10(v, d); + // Ext_ModifyVertex11(v, d); + // Ext_ModifyVertex12(v, d); + // Ext_ModifyVertex13(v, d); + // Ext_ModifyVertex14(v, d); + // Ext_ModifyVertex15(v, d); + // Ext_ModifyVertex16(v, d); + // Ext_ModifyVertex17(v, d); + // Ext_ModifyVertex18(v, d); + // Ext_ModifyVertex19(v, d); + // Ext_ModifyVertex20(v, d); + // Ext_ModifyVertex21(v, d); + // Ext_ModifyVertex22(v, d); + // Ext_ModifyVertex23(v, d); + // Ext_ModifyVertex24(v, d); + // Ext_ModifyVertex25(v, d); + // Ext_ModifyVertex26(v, d); + // Ext_ModifyVertex27(v, d); + // Ext_ModifyVertex28(v, d); + // Ext_ModifyVertex29(v, d); + + + // #if %EXTRAV2F0REQUIREKEY% + // v2p.extraV2F0 = d.extraV2F0; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // v2p.extraV2F1 = d.extraV2F1; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // v2p.extraV2F2 = d.extraV2F2; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // v2p.extraV2F3 = d.extraV2F3; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // v2p.extraV2F4 = d.extraV2F4; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // v2p.extraV2F5 = d.extraV2F5; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // v2p.extraV2F6 = d.extraV2F6; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // v2p.extraV2F7 = d.extraV2F7; + // #endif + } + + void ChainModifyTessellatedVertex(inout VertexData v, inout VertexToPixel v2p) + { + ExtraV2F d; + ZERO_INITIALIZE(ExtraV2F, d); + ZERO_INITIALIZE(Blackboard, d.blackboard); + + // #if %EXTRAV2F0REQUIREKEY% + // d.extraV2F0 = v2p.extraV2F0; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // d.extraV2F1 = v2p.extraV2F1; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // d.extraV2F2 = v2p.extraV2F2; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // d.extraV2F3 = v2p.extraV2F3; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // d.extraV2F4 = v2p.extraV2F4; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // d.extraV2F5 = v2p.extraV2F5; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // d.extraV2F6 = v2p.extraV2F6; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // d.extraV2F7 = v2p.extraV2F7; + // #endif + + + // Ext_ModifyTessellatedVertex0(v, d); + // Ext_ModifyTessellatedVertex1(v, d); + // Ext_ModifyTessellatedVertex2(v, d); + // Ext_ModifyTessellatedVertex3(v, d); + // Ext_ModifyTessellatedVertex4(v, d); + // Ext_ModifyTessellatedVertex5(v, d); + // Ext_ModifyTessellatedVertex6(v, d); + // Ext_ModifyTessellatedVertex7(v, d); + // Ext_ModifyTessellatedVertex8(v, d); + // Ext_ModifyTessellatedVertex9(v, d); + // Ext_ModifyTessellatedVertex10(v, d); + // Ext_ModifyTessellatedVertex11(v, d); + // Ext_ModifyTessellatedVertex12(v, d); + // Ext_ModifyTessellatedVertex13(v, d); + // Ext_ModifyTessellatedVertex14(v, d); + // Ext_ModifyTessellatedVertex15(v, d); + // Ext_ModifyTessellatedVertex16(v, d); + // Ext_ModifyTessellatedVertex17(v, d); + // Ext_ModifyTessellatedVertex18(v, d); + // Ext_ModifyTessellatedVertex19(v, d); + // Ext_ModifyTessellatedVertex20(v, d); + // Ext_ModifyTessellatedVertex21(v, d); + // Ext_ModifyTessellatedVertex22(v, d); + // Ext_ModifyTessellatedVertex23(v, d); + // Ext_ModifyTessellatedVertex24(v, d); + // Ext_ModifyTessellatedVertex25(v, d); + // Ext_ModifyTessellatedVertex26(v, d); + // Ext_ModifyTessellatedVertex27(v, d); + // Ext_ModifyTessellatedVertex28(v, d); + // Ext_ModifyTessellatedVertex29(v, d); + + // #if %EXTRAV2F0REQUIREKEY% + // v2p.extraV2F0 = d.extraV2F0; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // v2p.extraV2F1 = d.extraV2F1; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // v2p.extraV2F2 = d.extraV2F2; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // v2p.extraV2F3 = d.extraV2F3; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // v2p.extraV2F4 = d.extraV2F4; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // v2p.extraV2F5 = d.extraV2F5; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // v2p.extraV2F6 = d.extraV2F6; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // v2p.extraV2F7 = d.extraV2F7; + // #endif + } + + void ChainFinalColorForward(inout Surface l, inout ShaderData d, inout half4 color) + { + // Ext_FinalColorForward0(l, d, color); + // Ext_FinalColorForward1(l, d, color); + // Ext_FinalColorForward2(l, d, color); + // Ext_FinalColorForward3(l, d, color); + // Ext_FinalColorForward4(l, d, color); + // Ext_FinalColorForward5(l, d, color); + // Ext_FinalColorForward6(l, d, color); + // Ext_FinalColorForward7(l, d, color); + // Ext_FinalColorForward8(l, d, color); + // Ext_FinalColorForward9(l, d, color); + // Ext_FinalColorForward10(l, d, color); + // Ext_FinalColorForward11(l, d, color); + // Ext_FinalColorForward12(l, d, color); + // Ext_FinalColorForward13(l, d, color); + // Ext_FinalColorForward14(l, d, color); + // Ext_FinalColorForward15(l, d, color); + // Ext_FinalColorForward16(l, d, color); + // Ext_FinalColorForward17(l, d, color); + // Ext_FinalColorForward18(l, d, color); + // Ext_FinalColorForward19(l, d, color); + // Ext_FinalColorForward20(l, d, color); + // Ext_FinalColorForward21(l, d, color); + // Ext_FinalColorForward22(l, d, color); + // Ext_FinalColorForward23(l, d, color); + // Ext_FinalColorForward24(l, d, color); + // Ext_FinalColorForward25(l, d, color); + // Ext_FinalColorForward26(l, d, color); + // Ext_FinalColorForward27(l, d, color); + // Ext_FinalColorForward28(l, d, color); + // Ext_FinalColorForward29(l, d, color); + } + + void ChainFinalGBufferStandard(inout Surface s, inout ShaderData d, inout half4 GBuffer0, inout half4 GBuffer1, inout half4 GBuffer2, inout half4 outEmission, inout half4 outShadowMask) + { + // Ext_FinalGBufferStandard0(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard1(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard2(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard3(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard4(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard5(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard6(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard7(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard8(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard9(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard10(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard11(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard12(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard13(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard14(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard15(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard16(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard17(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard18(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard19(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard20(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard21(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard22(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard23(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard24(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard25(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard26(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard27(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard28(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard29(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + } +#endif + + + + + +#if _DECALSHADER + + ShaderData CreateShaderData(SurfaceDescriptionInputs IN) + { + ShaderData d = (ShaderData)0; + d.TBNMatrix = float3x3(IN.WorldSpaceTangent, IN.WorldSpaceBiTangent, IN.WorldSpaceNormal); + d.worldSpaceNormal = IN.WorldSpaceNormal; + d.worldSpaceTangent = IN.WorldSpaceTangent; + + d.worldSpacePosition = IN.WorldSpacePosition; + d.texcoord0 = IN.uv0.xyxy; + d.screenPos = IN.ScreenPosition; + + d.worldSpaceViewDir = normalize(_WorldSpaceCameraPos - d.worldSpacePosition); + + d.tangentSpaceViewDir = mul(d.TBNMatrix, d.worldSpaceViewDir); + + // these rarely get used, so we back transform them. Usually will be stripped. + #if _HDRP + // d.localSpacePosition = mul(GetWorldToObjectMatrix(), float4(GetCameraRelativePositionWS(d.worldSpacePosition), 1)).xyz; + #else + // d.localSpacePosition = mul(GetWorldToObjectMatrix(), float4(d.worldSpacePosition, 1)).xyz; + #endif + // d.localSpaceNormal = normalize(mul((float3x3)GetWorldToObjectMatrix(), d.worldSpaceNormal)); + // d.localSpaceTangent = normalize(mul((float3x3)GetWorldToObjectMatrix(), d.worldSpaceTangent.xyz)); + + // #if %SCREENPOSREQUIREKEY% + // d.screenUV = (IN.ScreenPosition.xy / max(0.01, IN.ScreenPosition.w)); + // #endif + + return d; + } +#else + + ShaderData CreateShaderData(VertexToPixel i + #if NEED_FACING + , bool facing + #endif + ) + { + ShaderData d = (ShaderData)0; + d.clipPos = i.pos; + d.worldSpacePosition = i.worldPos; + + d.worldSpaceNormal = normalize(i.worldNormal); + d.worldSpaceTangent.xyz = normalize(i.worldTangent.xyz); + + d.tangentSign = i.worldTangent.w * unity_WorldTransformParams.w; + float3 bitangent = cross(d.worldSpaceTangent.xyz, d.worldSpaceNormal) * d.tangentSign; + + d.TBNMatrix = float3x3(d.worldSpaceTangent, -bitangent, d.worldSpaceNormal); + d.worldSpaceViewDir = normalize(_WorldSpaceCameraPos - i.worldPos); + + d.tangentSpaceViewDir = mul(d.TBNMatrix, d.worldSpaceViewDir); + d.texcoord0 = i.texcoord0; + d.texcoord1 = i.texcoord1; + d.texcoord2 = i.texcoord2; + + // #if %TEXCOORD3REQUIREKEY% + d.texcoord3 = i.texcoord3; + // #endif + + // d.isFrontFace = facing; + // #if %VERTEXCOLORREQUIREKEY% + d.vertexColor = i.vertexColor; + // #endif + + // these rarely get used, so we back transform them. Usually will be stripped. + #if _HDRP + // d.localSpacePosition = mul(GetWorldToObjectMatrix(), float4(GetCameraRelativePositionWS(i.worldPos), 1)).xyz; + #else + // d.localSpacePosition = mul(GetWorldToObjectMatrix(), float4(i.worldPos, 1)).xyz; + #endif + // d.localSpaceNormal = normalize(mul((float3x3)GetWorldToObjectMatrix(), i.worldNormal)); + // d.localSpaceTangent = normalize(mul((float3x3)GetWorldToObjectMatrix(), i.worldTangent.xyz)); + + // #if %SCREENPOSREQUIREKEY% + // d.screenPos = i.screenPos; + // d.screenUV = (i.screenPos.xy / i.screenPos.w); + // #endif + + + // #if %EXTRAV2F0REQUIREKEY% + // d.extraV2F0 = i.extraV2F0; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // d.extraV2F1 = i.extraV2F1; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // d.extraV2F2 = i.extraV2F2; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // d.extraV2F3 = i.extraV2F3; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // d.extraV2F4 = i.extraV2F4; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // d.extraV2F5 = i.extraV2F5; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // d.extraV2F6 = i.extraV2F6; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // d.extraV2F7 = i.extraV2F7; + // #endif + + return d; + } + +#endif + + + +#if (SHADERPASS == SHADERPASS_LIGHT_TRANSPORT) + + // This was not in constant buffer in original unity, so keep outiside. But should be in as ShaderRenderPass frequency + float unity_OneOverOutputBoost; + float unity_MaxOutputValue; + + CBUFFER_START(UnityMetaPass) + // x = use uv1 as raster position + // y = use uv2 as raster position + bool4 unity_MetaVertexControl; + + // x = return albedo + // y = return normal + bool4 unity_MetaFragmentControl; + CBUFFER_END + + VertexToPixel Vert(VertexData inputMesh) + { + VertexToPixel output; + ZERO_INITIALIZE(VertexToPixel, output); + UNITY_SETUP_INSTANCE_ID(inputMesh); + UNITY_TRANSFER_INSTANCE_ID(inputMesh, output); + UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(output); + + // Output UV coordinate in vertex shader + float2 uv = float2(0.0, 0.0); + + if (unity_MetaVertexControl.x) + { + uv = inputMesh.texcoord1.xy * unity_LightmapST.xy + unity_LightmapST.zw; + } + else if (unity_MetaVertexControl.y) + { + uv = inputMesh.texcoord2.xy * unity_DynamicLightmapST.xy + unity_DynamicLightmapST.zw; + } + + // OpenGL right now needs to actually use the incoming vertex position + // so we create a fake dependency on it here that haven't any impact. + output.pos = float4(uv * 2.0 - 1.0, inputMesh.vertex.z > 0 ? 1.0e-4 : 0.0, 1.0); + + output.worldPos = TransformObjectToWorld(inputMesh.vertex); + + // Normal is required for triplanar mapping + output.worldNormal = TransformObjectToWorldNormal(inputMesh.normal); + // Not required but assign to silent compiler warning + output.worldTangent = float4(1.0, 0.0, 0.0, 0.0); + + output.texcoord0 = inputMesh.texcoord0; + output.texcoord1 = inputMesh.texcoord1; + output.texcoord2 = inputMesh.texcoord2; + // #if %TEXCOORD3REQUIREKEY% + output.texcoord3 = inputMesh.texcoord3; + // #endif + // #if %VERTEXCOLORREQUIREKEY% + output.vertexColor = inputMesh.vertexColor; + // #endif + + return output; + } +#else + + #if (_PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR))) + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/ShaderVariablesMatrixDefsHDCamera.hlsl" + + void MotionVectorPositionZBias(VertexToPixel input) + { + #if UNITY_REVERSED_Z + input.pos.z -= unity_MotionVectorsParams.z * input.pos.w; + #else + input.pos.z += unity_MotionVectorsParams.z * input.pos.w; + #endif + } + + #endif + + VertexToPixel Vert(VertexData input) + { + VertexToPixel output; + ZERO_INITIALIZE(VertexToPixel, output); + + UNITY_SETUP_INSTANCE_ID(input); + UNITY_TRANSFER_INSTANCE_ID(input, output); + UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(output); + + // copy before user modification, since we'll apply that to the copy later + #if _HDRP && (_PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR))) + VertexData previousMesh = input; + #endif + + ChainModifyVertex(input, output, _Time); + + // This return the camera relative position (if enable) + float3 positionRWS = TransformObjectToWorld(input.vertex.xyz); + float3 normalWS = TransformObjectToWorldNormal(input.normal); + float4 tangentWS = float4(TransformObjectToWorldDir(input.tangent.xyz), input.tangent.w); + + + output.worldPos = GetAbsolutePositionWS(positionRWS); + output.pos = TransformWorldToHClip(positionRWS); + output.worldNormal = normalWS; + output.worldTangent = tangentWS; + + + output.texcoord0 = input.texcoord0; + output.texcoord1 = input.texcoord1; + output.texcoord2 = input.texcoord2; + + // #if %TEXCOORD3REQUIREKEY% + output.texcoord3 = input.texcoord3; + // #endif + + // #if %VERTEXCOLORREQUIREKEY% + output.vertexColor = input.vertexColor; + // #endif + + // #if %SCREENPOSREQUIREKEY% + // output.screenPos = ComputeScreenPos(output.pos, _ProjectionParams.x); + // #endif + + #if _HDRP && (_PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR))) + + #if !defined(TESSELLATION_ON) + MotionVectorPositionZBias(output); + #endif + + output.motionVectorCS = mul(UNITY_MATRIX_UNJITTERED_VP, float4(positionRWS, 1.0)); + // Note: unity_MotionVectorsParams.y is 0 is forceNoMotion is enabled + bool forceNoMotion = unity_MotionVectorsParams.y == 0.0; + if (forceNoMotion) + { + output.previousPositionCS = float4(0.0, 0.0, 0.0, 1.0); + } + else + { + bool hasDeformation = unity_MotionVectorsParams.x > 0.0; // Skin or morph target + + float3 effectivePositionOS = (hasDeformation ? previousMesh.previousPositionOS : previousMesh.vertex.xyz); + #if defined(_ADD_PRECOMPUTED_VELOCITY) + effectivePositionOS -= input.precomputedVelocity; + #endif + + + + previousMesh.vertex = float4(effectivePositionOS, 1); + VertexToPixel dummy = (VertexToPixel)0; + + ChainModifyVertex(previousMesh, dummy, _LastTimeParameters); + + float3 previousPositionRWS = TransformPreviousObjectToWorld(previousMesh.vertex.xyz); + // we might need this for skinned objects? + //float3 normalWS = TransformPreviousObjectToWorldNormal(input.normal).xyz; + + #ifdef _WRITE_TRANSPARENT_MOTION_VECTOR + if (_TransparentCameraOnlyMotionVectors > 0) + { + previousPositionRWS = positionRWS.xyz; + } + #endif // _WRITE_TRANSPARENT_MOTION_VECTOR + + output.previousPositionCS = mul(UNITY_MATRIX_PREV_VP, float4(previousPositionRWS, 1.0)); + } + #endif // _HDRP && _PASSMOTIONVECTOR || (_PASSFORWARD && defined(_WRITE_TRANSPARENT_MOTION_VECTOR)) + + + return output; + } + + +#endif + + + + + + + + #if defined(WRITE_DECAL_BUFFER) && !defined(_DISABLE_DECALS) + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/Decal/DecalPrepassBuffer.hlsl" + #endif + + FragInputs BuildFragInputs(VertexToPixel input) + { + UNITY_SETUP_INSTANCE_ID(input); + FragInputs output; + ZERO_INITIALIZE(FragInputs, output); + + // Init to some default value to make the computer quiet (else it output 'divide by zero' warning even if value is not used). + // TODO: this is a really poor workaround, but the variable is used in a bunch of places + // to compute normals which are then passed on elsewhere to compute other values... + output.tangentToWorld = k_identity3x3; + output.positionSS = input.pos; // input.positionCS is SV_Position + // BETTER SHADERS: because we transform world position into actual world space for things like + // triplanar, etc, we have to back transform it here for lighting + output.positionRWS = GetCameraRelativePositionWS(input.worldPos); + output.tangentToWorld = BuildTangentToWorld(input.worldTangent, input.worldNormal); + output.texCoord0 = input.texcoord0; + output.texCoord1 = input.texcoord1; + output.texCoord2 = input.texcoord2; + + return output; + } + + void BuildSurfaceData(FragInputs fragInputs, inout Surface surfaceDescription, float3 V, PositionInputs posInput, out SurfaceData surfaceData, out float3 bentNormalWS) + { + // setup defaults -- these are used if the graph doesn't output a value + ZERO_INITIALIZE(SurfaceData, surfaceData); + + // specularOcclusion need to be init ahead of decal to quiet the compiler that modify the SurfaceData struct + // however specularOcclusion can come from the graph, so need to be init here so it can be override. + surfaceData.specularOcclusion = 1.0; + + // copy across graph values, if defined + surfaceData.baseColor = surfaceDescription.Albedo; + surfaceData.perceptualSmoothness = surfaceDescription.Smoothness; + surfaceData.ambientOcclusion = surfaceDescription.Occlusion; + surfaceData.specularOcclusion = surfaceDescription.SpecularOcclusion; + surfaceData.metallic = surfaceDescription.Metallic; + surfaceData.subsurfaceMask = surfaceDescription.SubsurfaceMask; + surfaceData.thickness = surfaceDescription.Thickness; + surfaceData.diffusionProfileHash = asuint(surfaceDescription.DiffusionProfileHash); + #if _USESPECULAR + surfaceData.specularColor = surfaceDescription.Specular; + #endif + surfaceData.coatMask = surfaceDescription.CoatMask; + surfaceData.anisotropy = surfaceDescription.Anisotropy; + surfaceData.iridescenceMask = surfaceDescription.IridescenceMask; + surfaceData.iridescenceThickness = surfaceDescription.IridescenceThickness; + + + + #if defined(_REFRACTION_PLANE) || defined(_REFRACTION_SPHERE) || defined(_REFRACTION_THIN) + if (_EnableSSRefraction) + { + surfaceData.transmittanceMask = (1.0 - surfaceDescription.Alpha); + surfaceDescription.Alpha = 1.0; + } + else + { + surfaceData.ior = surfaceDescription.ior; + surfaceData.transmittanceColor = surfaceDescription.transmittanceColor; + surfaceData.atDistance = surfaceDescription.atDistance; + surfaceData.transmittanceMask = surfaceDescription.transmittanceMask; + surfaceDescription.Alpha = 1.0; + } + #else + surfaceData.ior = 1.0; + surfaceData.transmittanceColor = float3(1.0, 1.0, 1.0); + surfaceData.atDistance = 1.0; + surfaceData.transmittanceMask = 0.0; + #endif + + + #if defined(_ENABLE_SHADOW_MATTE) && SHADERPASS == SHADERPASS_FORWARD_UNLIT + HDShadowContext shadowContext = InitShadowContext(); + float shadow; + float3 shadow3; + // We need to recompute some coordinate not computed by default for shadow matte + posInput = GetPositionInput(fragInputs.positionSS.xy, _ScreenSize.zw, fragInputs.positionSS.z, UNITY_MATRIX_I_VP, GetWorldToViewMatrix()); + float3 upWS = normalize(fragInputs.tangentToWorld[1]); + uint renderingLayers = GetMeshRenderingLightLayer(); + ShadowLoopMin(shadowContext, posInput, upWS, asuint(_ShadowMatteFilter), renderingLayers, shadow3); + shadow = dot(shadow3, float3(1.0 / 3.0, 1.0 / 3.0, 1.0 / 3.0)); + + float4 shadowColor = (1.0 - shadow) * surfaceDescription.ShadowTint.rgba; + float localAlpha = saturate(shadowColor.a + surfaceDescription.Alpha); + + // Keep the nested lerp + // With no Color (bsdfData.color.rgb, bsdfData.color.a == 0.0f), just use ShadowColor*Color to avoid a ring of "white" around the shadow + // And mix color to consider the Color & ShadowColor alpha (from texture or/and color picker) + #ifdef _SURFACE_TYPE_TRANSPARENT + surfaceData.baseColor = lerp(shadowColor.rgb * surfaceData.baseColor, lerp(lerp(shadowColor.rgb, surfaceData.baseColor, 1.0 - surfaceDescription.ShadowTint.a), surfaceData.baseColor, shadow), surfaceDescription.Alpha); + #else + surfaceData.baseColor = lerp(lerp(shadowColor.rgb, surfaceData.baseColor, 1.0 - surfaceDescription.ShadowTint.a), surfaceData.baseColor, shadow); + #endif + localAlpha = ApplyBlendMode(surfaceData.baseColor, localAlpha).a; + + surfaceDescription.Alpha = localAlpha; + #endif + + // These static material feature allow compile time optimization + surfaceData.materialFeatures = MATERIALFEATUREFLAGS_LIT_STANDARD; + #ifdef _MATERIAL_FEATURE_SUBSURFACE_SCATTERING + surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_SUBSURFACE_SCATTERING; + #endif + + #ifdef _MATERIAL_FEATURE_TRANSMISSION + surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_TRANSMISSION; + #endif + + #ifdef _MATERIAL_FEATURE_ANISOTROPY + surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_ANISOTROPY; + #endif + + #ifdef _MATERIAL_FEATURE_IRIDESCENCE + surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_IRIDESCENCE; + #endif + + #ifdef _MATERIAL_FEATURE_SPECULAR_COLOR + surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_SPECULAR_COLOR; + #endif + + #if defined(_MATERIAL_FEATURE_CLEAR_COAT) || _CLEARCOAT + surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_CLEAR_COAT; + #endif + + #if defined (_MATERIAL_FEATURE_SPECULAR_COLOR) && defined (_ENERGY_CONSERVING_SPECULAR) + // Require to have setup baseColor + // Reproduce the energy conservation done in legacy Unity. Not ideal but better for compatibility and users can unchek it + surfaceData.baseColor *= (1.0 - Max3(surfaceData.specularColor.r, surfaceData.specularColor.g, surfaceData.specularColor.b)); + #endif + + + + // compute world space normal + #if !_WORLDSPACENORMAL + surfaceData.normalWS = mul(surfaceDescription.Normal, fragInputs.tangentToWorld); + #else + surfaceData.normalWS = surfaceDescription.Normal; + #endif + + surfaceData.geomNormalWS = fragInputs.tangentToWorld[2]; + + surfaceData.tangentWS = normalize(fragInputs.tangentToWorld[0].xyz); // The tangent is not normalize in tangentToWorld for mikkt. TODO: Check if it expected that we normalize with Morten. Tag: SURFACE_GRADIENT + + + #if HAVE_DECALS + if (_EnableDecals) + { + float alpha = 1.0; + alpha = surfaceDescription.Alpha; + + // Both uses and modifies 'surfaceData.normalWS'. + DecalSurfaceData decalSurfaceData = GetDecalSurfaceData(posInput, fragInputs.tangentToWorld[2], alpha); + ApplyDecalToSurfaceData(decalSurfaceData, fragInputs.tangentToWorld[2], surfaceData); + } + #endif + + bentNormalWS = surfaceData.normalWS; + + surfaceData.tangentWS = Orthonormalize(surfaceData.tangentWS, surfaceData.normalWS); + + #ifdef DEBUG_DISPLAY + if (_DebugMipMapMode != DEBUGMIPMAPMODE_NONE) + { + // TODO: need to update mip info + surfaceData.metallic = 0; + } + + // We need to call ApplyDebugToSurfaceData after filling the surfarcedata and before filling builtinData + // as it can modify attribute use for static lighting + ApplyDebugToSurfaceData(fragInputs.tangentToWorld, surfaceData); + #endif + + // By default we use the ambient occlusion with Tri-ace trick (apply outside) for specular occlusion. + // If user provide bent normal then we process a better term + #if defined(_SPECULAR_OCCLUSION_CUSTOM) + // Just use the value passed through via the slot (not active otherwise) + #elif defined(_SPECULAR_OCCLUSION_FROM_AO_BENT_NORMAL) + // If we have bent normal and ambient occlusion, process a specular occlusion + surfaceData.specularOcclusion = GetSpecularOcclusionFromBentAO(V, bentNormalWS, surfaceData.normalWS, surfaceData.ambientOcclusion, PerceptualSmoothnessToPerceptualRoughness(surfaceData.perceptualSmoothness)); + #elif defined(_AMBIENT_OCCLUSION) && defined(_SPECULAR_OCCLUSION_FROM_AO) + surfaceData.specularOcclusion = GetSpecularOcclusionFromAmbientOcclusion(ClampNdotV(dot(surfaceData.normalWS, V)), surfaceData.ambientOcclusion, PerceptualSmoothnessToRoughness(surfaceData.perceptualSmoothness)); + #endif + + #if defined(_ENABLE_GEOMETRIC_SPECULAR_AA) && !defined(SHADER_STAGE_RAY_TRACING) + surfaceData.perceptualSmoothness = GeometricNormalFiltering(surfaceData.perceptualSmoothness, fragInputs.tangentToWorld[2], surfaceDescription.SpecularAAScreenSpaceVariance, surfaceDescription.SpecularAAThreshold); + #endif + } + + void GetSurfaceAndBuiltinData(VertexToPixel m2ps, FragInputs fragInputs, float3 V, inout PositionInputs posInput, + out SurfaceData surfaceData, out BuiltinData builtinData, inout Surface l, inout ShaderData d + #if NEED_FACING + , bool facing + #endif + ) + { + // Removed since crossfade does not work, probably needs extra material setup. + //#if !defined(SHADER_STAGE_RAY_TRACING) && !defined(_TESSELLATION_DISPLACEMENT) + // #ifdef LOD_FADE_CROSSFADE // enable dithering LOD transition if user select CrossFade transition in LOD group + // LODDitheringTransition(ComputeFadeMaskSeed(V, posInput.positionSS), unity_LODFade.x); + // #endif + //#endif + + d = CreateShaderData(m2ps + #if NEED_FACING + , facing + #endif + ); + + l = (Surface)0; + + l.Albedo = half3(0.5, 0.5, 0.5); + l.Normal = float3(0,0,1); + l.Occlusion = 1; + l.Alpha = 1; + l.SpecularOcclusion = 1; + + #if !defined(SHADER_STAGE_RAY_TRACING) && defined(_DEPTHOFFSET_ON) + l.outputDepth = d.clipPos.z; + #endif + + ChainSurfaceFunction(l, d); + + #if !defined(SHADER_STAGE_RAY_TRACING) && defined(_DEPTHOFFSET_ON) + //posInput.deviceDepth = l.outputDepth; + #endif + + #if _UNLIT + //l.Emission = l.Albedo; + //l.Albedo = 0; + l.Normal = half3(0,0,1); + l.Occlusion = 1; + l.Metallic = 0; + l.Specular = 0; + #endif + + surfaceData.geomNormalWS = d.worldSpaceNormal; + surfaceData.tangentWS = d.worldSpaceTangent; + fragInputs.tangentToWorld = d.TBNMatrix; + + float3 bentNormalWS; + BuildSurfaceData(fragInputs, l, V, posInput, surfaceData, bentNormalWS); + + + InitBuiltinData(posInput, l.Alpha, bentNormalWS, -d.worldSpaceNormal, fragInputs.texCoord1, fragInputs.texCoord2, builtinData); + + + + builtinData.emissiveColor = l.Emission; + + #if defined(_OVERRIDE_BAKEDGI) + builtinData.bakeDiffuseLighting = l.DiffuseGI; + builtinData.backBakeDiffuseLighting = l.BackDiffuseGI; + builtinData.emissiveColor += l.SpecularGI; + #endif + + #if defined(_OVERRIDE_SHADOWMASK) + builtinData.shadowMask0 = l.ShadowMask.x; + builtinData.shadowMask1 = l.ShadowMask.y; + builtinData.shadowMask2 = l.ShadowMask.z; + builtinData.shadowMask3 = l.ShadowMask.w; + #endif + + #if defined(UNITY_VIRTUAL_TEXTURING) + builtinData.vtPackedFeedback = surfaceData.VTPackedFeedback; + #endif + + #if (SHADERPASS == SHADERPASS_DISTORTION) + //builtinData.distortion = surfaceData.Distortion; + //builtinData.distortionBlur = surfaceData.DistortionBlur; + #endif + + #ifndef SHADER_UNLIT + // PostInitBuiltinData call ApplyDebugToBuiltinData + PostInitBuiltinData(V, posInput, surfaceData, builtinData); + #else + ApplyDebugToBuiltinData(builtinData); + #endif + + RAY_TRACING_OPTIONAL_ALPHA_TEST_PASS + } + + + #if defined(WRITE_NORMAL_BUFFER) && defined(WRITE_MSAA_DEPTH) + #define SV_TARGET_DECAL SV_Target2 + #elif defined(WRITE_NORMAL_BUFFER) || defined(WRITE_MSAA_DEPTH) + #define SV_TARGET_DECAL SV_Target1 + #else + #define SV_TARGET_DECAL SV_Target0 + #endif + + + void Frag( VertexToPixel v2p + #if defined(SCENESELECTIONPASS) || defined(SCENEPICKINGPASS) + , out float4 outColor : SV_Target0 + #else + #ifdef WRITE_MSAA_DEPTH + // We need the depth color as SV_Target0 for alpha to coverage + , out float4 depthColor : SV_Target0 + #ifdef WRITE_NORMAL_BUFFER + , out float4 outNormalBuffer : SV_Target1 + #endif + #else + #ifdef WRITE_NORMAL_BUFFER + , out float4 outNormalBuffer : SV_Target0 + #endif + #endif + + // Decal buffer must be last as it is bind but we can optionally write into it (based on _DISABLE_DECALS) + #if defined(WRITE_DECAL_BUFFER) && !defined(_DISABLE_DECALS) + , out float4 outDecalBuffer : SV_TARGET_DECAL + #endif + #endif + + #if defined(_DEPTHOFFSET_ON) && !defined(SCENEPICKINGPASS) + , out float outputDepth : SV_Depth + #endif + #if NEED_FACING + , bool facing : SV_IsFrontFace + #endif + ) + { + UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX(v2p); + FragInputs input = BuildFragInputs(v2p); + + // input.positionSS is SV_Position + PositionInputs posInput = GetPositionInput(input.positionSS.xy, _ScreenSize.zw, input.positionSS.z, input.positionSS.w, input.positionRWS); + + + float3 V = GetWorldSpaceNormalizeViewDir(input.positionRWS); + + + SurfaceData surfaceData; + BuiltinData builtinData; + Surface l; + ShaderData d; + GetSurfaceAndBuiltinData(v2p, input, V, posInput, surfaceData, builtinData, l, d + #if NEED_FACING + , facing + #endif + ); + // to prevent stripping + surfaceData.normalWS *= saturate(l.Albedo.r + 9999); + + + #ifdef _DEPTHOFFSET_ON + outputDepth = l.outputDepth; + #endif + + #ifdef SCENESELECTIONPASS + // We use depth prepass for scene selection in the editor, this code allow to output the outline correctly + outColor = float4(_ObjectId, _PassValue, 1.0, 1.0); + #elif defined(SCENEPICKINGPASS) + outColor = _SelectionID; + #else + #ifdef WRITE_MSAA_DEPTH + // In case we are rendering in MSAA, reading the an MSAA depth buffer is way too expensive. To avoid that, we export the depth to a color buffer + depthColor = v2p.pos.z; + + #ifdef _ALPHATOMASK_ON + // Alpha channel is used for alpha to coverage + depthColor.a = SharpenAlpha(builtinData.opacity, builtinData.alphaClipTreshold); + #endif // alphatomask + #endif // msaa_depth + + + #if defined(WRITE_NORMAL_BUFFER) + EncodeIntoNormalBuffer(ConvertSurfaceDataToNormalData(surfaceData), outNormalBuffer); + #endif + + #if defined(WRITE_DECAL_BUFFER) && !defined(_DISABLE_DECALS) + DecalPrepassData decalPrepassData; + // We don't have the right to access SurfaceData in a shaderpass. + // However it would be painful to have to add a function like ConvertSurfaceDataToDecalPrepassData() to every Material to return geomNormalWS anyway + // Here we will put the constrain that any Material requiring to support Decal, will need to have geomNormalWS as member of surfaceData (and we already require normalWS anyway) + decalPrepassData.geomNormalWS = surfaceData.geomNormalWS; + decalPrepassData.decalLayerMask = GetMeshRenderingDecalLayer(); + EncodeIntoDecalPrepassBuffer(decalPrepassData, outDecalBuffer); + #endif + #endif + + } + + + + ENDHLSL + } + + + + Pass + { + // based on HDLitPass.template + Name "META" + Tags { "LightMode" = "META" } + + Cull Off + + Tags { "RenderType" = "Opaque" "Queue" = "Geometry" "PreviewType" = "Plane" } + Cull [_CullingOption] + ZWrite [_ZWrite] + ZTest [_ZTestMode] + + + //------------------------------------------------------------------------------------- + // End Render Modes + //------------------------------------------------------------------------------------- + + HLSLPROGRAM + + #pragma target 4.5 + #pragma only_renderers d3d11 ps4 xboxone vulkan metal switch + //#pragma enable_d3d11_debug_symbols + + #pragma multi_compile_instancing + + //#pragma multi_compile_local _ _ALPHATEST_ON + + + + //------------------------------------------------------------------------------------- + // Variant Definitions (active field translations to HDRP defines) + //------------------------------------------------------------------------------------- + // #define _MATERIAL_FEATURE_SUBSURFACE_SCATTERING 1 + // #define _MATERIAL_FEATURE_TRANSMISSION 1 + // #define _MATERIAL_FEATURE_ANISOTROPY 1 + // #define _MATERIAL_FEATURE_IRIDESCENCE 1 + // #define _MATERIAL_FEATURE_SPECULAR_COLOR 1 + #define _ENABLE_FOG_ON_TRANSPARENT 1 + // #define _AMBIENT_OCCLUSION 1 + // #define _SPECULAR_OCCLUSION_FROM_AO 1 + // #define _SPECULAR_OCCLUSION_FROM_AO_BENT_NORMAL 1 + // #define _SPECULAR_OCCLUSION_CUSTOM 1 + // #define _ENERGY_CONSERVING_SPECULAR 1 + // #define _ENABLE_GEOMETRIC_SPECULAR_AA 1 + // #define _HAS_REFRACTION 1 + // #define _REFRACTION_PLANE 1 + // #define _REFRACTION_SPHERE 1 + // #define _DISABLE_DECALS 1 + // #define _DISABLE_SSR 1 + // #define _ADD_PRECOMPUTED_VELOCITY + // #define _WRITE_TRANSPARENT_MOTION_VECTOR 1 + // #define _DEPTHOFFSET_ON 1 + // #define _BLENDMODE_PRESERVE_SPECULAR_LIGHTING 1 + + #define SHADERPASS SHADERPASS_LIGHT_TRANSPORT + #define RAYTRACING_SHADER_GRAPH_HIGH + #define REQUIRE_DEPTH_TEXTURE + #define _PASSMETA 1 + + + + #pragma shader_feature_local GLOW_ON + #pragma shader_feature_local FADE_ON + #pragma shader_feature_local OUTBASE_ON + #pragma shader_feature_local ONLYOUTLINE_ON + #pragma shader_feature_local GRADIENT_ON + #pragma shader_feature_local GRADIENT2COL_ON + #pragma shader_feature_local RADIALGRADIENT_ON + #pragma shader_feature_local COLORSWAP_ON + #pragma shader_feature_local HSV_ON + #pragma shader_feature_local CHANGECOLOR_ON + #pragma shader_feature_local CHANGECOLOR2_ON + #pragma shader_feature_local CHANGECOLOR3_ON + #pragma shader_feature_local COLORRAMP_ON + #pragma shader_feature_local GRADIENTCOLORRAMP_ON + #pragma shader_feature_local HITEFFECT_ON + #pragma shader_feature_local NEGATIVE_ON + #pragma shader_feature_local PIXELATE_ON + #pragma shader_feature_local GREYSCALE_ON + #pragma shader_feature_local POSTERIZE_ON + #pragma shader_feature_local BLUR_ON + #pragma shader_feature_local MOTIONBLUR_ON + #pragma shader_feature_local GHOST_ON + #pragma shader_feature_local ALPHAOUTLINE_ON + #pragma shader_feature_local INNEROUTLINE_ON + #pragma shader_feature_local ONLYINNEROUTLINE_ON + #pragma shader_feature_local HOLOGRAM_ON + #pragma shader_feature_local CHROMABERR_ON + #pragma shader_feature_local GLITCH_ON + #pragma shader_feature_local FLICKER_ON + #pragma shader_feature_local SHADOW_ON + #pragma shader_feature_local SHINE_ON + #pragma shader_feature_local CONTRAST_ON + #pragma shader_feature_local OVERLAY_ON + #pragma shader_feature_local OVERLAYMULT_ON + #pragma shader_feature_local DOODLE_ON + #pragma shader_feature_local WIND_ON + #pragma shader_feature_local WAVEUV_ON + #pragma shader_feature_local ROUNDWAVEUV_ON + #pragma shader_feature_local RECTSIZE_ON + #pragma shader_feature_local OFFSETUV_ON + #pragma shader_feature_local CLIPPING_ON + #pragma shader_feature_local RADIALCLIPPING_ON + #pragma shader_feature_local TEXTURESCROLL_ON + #pragma shader_feature_local ZOOMUV_ON + #pragma shader_feature_local DISTORT_ON + #pragma shader_feature_local WARP_ON + #pragma shader_feature_local TWISTUV_ON + #pragma shader_feature_local ROTATEUV_ON + #pragma shader_feature_local POLARUV_ON + #pragma shader_feature_local FISHEYE_ON + #pragma shader_feature_local PINCH_ON + #pragma shader_feature_local SHAKEUV_ON + + #pragma shader_feature_local GLOWTEX_ON + #pragma shader_feature_local OUTTEX_ON + #pragma shader_feature_local OUTDIST_ON + #pragma shader_feature_local OUTBASE8DIR_ON + #pragma shader_feature_local OUTBASEPIXELPERF_ON + #pragma shader_feature_local COLORRAMPOUTLINE_ON + #pragma shader_feature_local GREYSCALEOUTLINE_ON + #pragma shader_feature_local POSTERIZEOUTLINE_ON + #pragma shader_feature_local BLURISHD_ON + #pragma shader_feature_local MANUALWIND_ON + #pragma shader_feature_local ATLAS_ON + #pragma shader_feature_local PREMULTIPLYALPHA_ON + + #pragma shader_feature BILBOARD_ON + #pragma shader_feature BILBOARDY_ON + + #pragma shader_feature NORMALMAP_ON + + + #define _HDRP 1 +#define _USINGTEXCOORD1 1 +#define _USINGTEXCOORD2 1 + + + #pragma vertex Vert + #pragma fragment Frag + + + + + // useful conversion functions to make surface shader code just work + + #define UNITY_DECLARE_TEX2D(name) TEXTURE2D(name); SAMPLER(sampler##name); + #define UNITY_DECLARE_TEX2D_NOSAMPLER(name) TEXTURE2D(name); + #define UNITY_DECLARE_TEX2DARRAY(name) TEXTURE2D_ARRAY(name); SAMPLER(sampler##name); + #define UNITY_DECLARE_TEX2DARRAY_NOSAMPLER(tex) TEXTURE2D_ARRAY(tex); + + #define UNITY_SAMPLE_TEX2DARRAY(tex,coord) SAMPLE_TEXTURE2D_ARRAY(tex, sampler##tex, coord.xy, coord.z) + #define UNITY_SAMPLE_TEX2DARRAY_LOD(tex,coord,lod) SAMPLE_TEXTURE2D_ARRAY_LOD(tex, sampler##tex, coord.xy, coord.z, lod) + #define UNITY_SAMPLE_TEX2D(tex, coord) SAMPLE_TEXTURE2D(tex, sampler##tex, coord) + #define UNITY_SAMPLE_TEX2D_SAMPLER(tex, samp, coord) SAMPLE_TEXTURE2D(tex, sampler##samp, coord) + + #define UNITY_SAMPLE_TEX2D_LOD(tex,coord, lod) SAMPLE_TEXTURE2D_LOD(tex, sampler_##tex, coord, lod) + #define UNITY_SAMPLE_TEX2D_SAMPLER_LOD(tex,samplertex,coord, lod) SAMPLE_TEXTURE2D_LOD (tex, sampler##samplertex,coord, lod) + + #if defined(UNITY_COMPILER_HLSL) + #define UNITY_INITIALIZE_OUTPUT(type,name) name = (type)0; + #else + #define UNITY_INITIALIZE_OUTPUT(type,name) + #endif + + #define sampler2D_float sampler2D + #define sampler2D_half sampler2D + + #undef WorldNormalVector + #define WorldNormalVector(data, normal) mul(normal, data.TBNMatrix) + + #define UnityObjectToWorldNormal(normal) mul(GetObjectToWorldMatrix(), normal) + + + + +// HDRP Adapter stuff + #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Common.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/ShaderVariables.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/ShaderPass/FragInputs.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/ShaderPass/ShaderPass.cs.hlsl" + #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/TextureStack.hlsl" // Required to be include before we include properties as it define DECLARE_STACK_CB + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/ShaderGraphHeader.hlsl" // Need to be here for Gradient struct definition + + #ifdef RAYTRACING_SHADER_GRAPH_DEFAULT + #define RAYTRACING_SHADER_GRAPH_HIGH + #endif + + #ifdef RAYTRACING_SHADER_GRAPH_RAYTRACED + #define RAYTRACING_SHADER_GRAPH_LOW + #endif + // end + + + + + // If we use subsurface scattering, enable output split lighting (for forward pass) + #if defined(_MATERIAL_FEATURE_SUBSURFACE_SCATTERING) && !defined(_SURFACE_TYPE_TRANSPARENT) + #define OUTPUT_SPLIT_LIGHTING + #endif + + #define HAVE_RECURSIVE_RENDERING + + #if SHADERPASS == SHADERPASS_TRANSPARENT_DEPTH_PREPASS + #if !defined(_DISABLE_SSR_TRANSPARENT) && !defined(SHADER_UNLIT) + #define WRITE_NORMAL_BUFFER + #endif + #endif + + #ifndef DEBUG_DISPLAY + // In case of opaque we don't want to perform the alpha test, it is done in depth prepass and we use depth equal for ztest (setup from UI) + // Don't do it with debug display mode as it is possible there is no depth prepass in this case + #if !defined(_SURFACE_TYPE_TRANSPARENT) && defined(_ALPHATEST) + #if SHADERPASS == SHADERPASS_FORWARD + #define SHADERPASS_FORWARD_BYPASS_ALPHA_TEST + #elif SHADERPASS == SHADERPASS_GBUFFER + #define SHADERPASS_GBUFFER_BYPASS_ALPHA_TEST + #endif + #endif + #endif + + // Translate transparent motion vector define + #if defined(_TRANSPARENT_WRITES_MOTION_VEC) && defined(_SURFACE_TYPE_TRANSPARENT) + #define _WRITE_TRANSPARENT_MOTION_VECTOR + #endif + + + + + CBUFFER_START(UnityPerMaterial) + float _UseShadowThreshold; + float _BlendMode; + float _EnableBlendModePreserveSpecularLighting; + float _RayTracing; + float _RefractionModel; + + + half4 _Color; + half4 _MainTex_ST, _MainTex_TexelSize; + half _Alpha, _AlphaCutoffValue; + + #if ATLAS_ON + half _MinXUV, _MaxXUV, _MinYUV, _MaxYUV; + #endif + + #if GLOW_ON + half4 _GlowColor; + half _Glow, _GlowGlobal; + #endif + + #if HSV_ON + half _HsvShift, _HsvSaturation, _HsvBright; + #endif + + #if DISTORT_ON + half4 _DistortTex_ST; + half _DistortTexXSpeed, _DistortTexYSpeed, _DistortAmount; + #endif + + #if FADE_ON + half4 _FadeBurnColor, _FadeTex_ST, _FadeBurnTex_ST; + half _FadeAmount, _FadeBurnWidth, _FadeBurnTransition,_FadeBurnGlow; + #endif + + #if OUTBASE_ON + half4 _OutlineColor; + half _OutlineAlpha, _OutlineGlow, _OutlineWidth; + int _OutlinePixelWidth; + #endif + + #if OUTTEX_ON + half4 _OutlineTex_ST; + half _OutlineTexXSpeed, _OutlineTexYSpeed; + #endif + + #if OUTDIST_ON + half4 _OutlineDistortTex_ST; + half _OutlineDistortTexXSpeed, _OutlineDistortTexYSpeed, _OutlineDistortAmount; + #endif + + #if ALPHAOUTLINE_ON + half _AlphaOutlineGlow, _AlphaOutlinePower, _AlphaOutlineMinAlpha, _AlphaOutlineBlend; + half4 _AlphaOutlineColor; + #endif + + #if INNEROUTLINE_ON + half _InnerOutlineThickness, _InnerOutlineAlpha, _InnerOutlineGlow; + half4 _InnerOutlineColor; + #endif + + #if GRADIENT_ON + half _GradBlend, _GradBoostX, _GradBoostY; + half4 _GradTopRightCol, _GradTopLeftCol, _GradBotRightCol, _GradBotLeftCol; + #endif + + #if COLORSWAP_ON + half4 _ColorSwapRed, _ColorSwapGreen, _ColorSwapBlue; + half _ColorSwapRedLuminosity, _ColorSwapGreenLuminosity, _ColorSwapBlueLuminosity, _ColorSwapBlend; + #endif + + #if CHANGECOLOR_ON + half4 _ColorChangeNewCol, _ColorChangeTarget; + half _ColorChangeTolerance, _ColorChangeLuminosity; + #endif + #if CHANGECOLOR2_ON + half4 _ColorChangeNewCol2, _ColorChangeTarget2; + half _ColorChangeTolerance2; + #endif + #if CHANGECOLOR3_ON + half4 _ColorChangeNewCol3, _ColorChangeTarget3; + half _ColorChangeTolerance3; + #endif + + #if COLORRAMP_ON + half _ColorRampLuminosity, _ColorRampBlend; + #endif + + #if HITEFFECT_ON + half4 _HitEffectColor; + half _HitEffectGlow, _HitEffectBlend; + #endif + + #if NEGATIVE_ON + half _NegativeAmount; + #endif + + #if PIXELATE_ON + half _PixelateSize; + #endif + + #if GREYSCALE_ON + half _GreyscaleLuminosity, _GreyscaleBlend; + half4 _GreyscaleTintColor; + #endif + + #if POSTERIZE_ON + half _PosterizeNumColors, _PosterizeGamma; + #endif + + #if BLUR_ON + half _BlurIntensity; + #endif + + #if MOTIONBLUR_ON + half _MotionBlurAngle, _MotionBlurDist; + #endif + + #if GHOST_ON + half _GhostColorBoost, _GhostTransparency, _GhostBlend; + #endif + + #if HOLOGRAM_ON + half _HologramStripesAmount, _HologramMinAlpha, _HologramUnmodAmount, _HologramStripesSpeed, _HologramMaxAlpha, _HologramBlend; + half4 _HologramStripeColor; + #endif + + #if CHROMABERR_ON + half _ChromAberrAmount, _ChromAberrAlpha; + #endif + + #if GLITCH_ON + half _GlitchAmount, _GlitchSize; + #endif + + #if FLICKER_ON + half _FlickerFreq, _FlickerPercent, _FlickerAlpha; + #endif + + #if SHADOW_ON + half _ShadowX, _ShadowY, _ShadowAlpha; + half4 _ShadowColor; + #endif + + #if SHINE_ON + half4 _ShineColor; + half _ShineLocation, _ShineRotate, _ShineWidth, _ShineGlow; + #endif + + #if CONTRAST_ON + half _Contrast, _Brightness; + #endif + + #if OVERLAY_ON + half4 _OverlayTex_ST, _OverlayColor; + half _OverlayGlow, _OverlayBlend, _OverlayTextureScrollXSpeed, _OverlayTextureScrollYSpeed; + #endif + + #if DOODLE_ON + half _HandDrawnAmount, _HandDrawnSpeed; + #endif + + #if WIND_ON + half _GrassSpeed, _GrassWind, _GrassManualAnim, _GrassRadialBend; + #endif + + #if WAVEUV_ON + float _WaveAmount, _WaveSpeed, _WaveStrength, _WaveX, _WaveY; + #endif + + #if ROUNDWAVEUV_ON + half _RoundWaveStrength, _RoundWaveSpeed; + #endif + + #if RECTSIZE_ON + half _RectSize; + #endif + + #if OFFSETUV_ON + half _OffsetUvX, _OffsetUvY; + #endif + + #if CLIPPING_ON + half _ClipUvLeft, _ClipUvRight, _ClipUvUp, _ClipUvDown; + #endif + + #if RADIALCLIPPING_ON + half _RadialStartAngle, _RadialClip, _RadialClip2; + #endif + + #if TEXTURESCROLL_ON + half _TextureScrollXSpeed, _TextureScrollYSpeed; + #endif + + #if ZOOMUV_ON + half _ZoomUvAmount; + #endif + + #if WARP_ON + half _WarpStrength, _WarpSpeed, _WarpScale; + #endif + + #if TWISTUV_ON + half _TwistUvAmount, _TwistUvPosX, _TwistUvPosY, _TwistUvRadius; + #endif + + #if ROTATEUV_ON + half _RotateUvAmount; + #endif + + #if FISHEYE_ON + half _FishEyeUvAmount; + #endif + + #if PINCH_ON + half _PinchUvAmount; + #endif + + #if SHAKEUV_ON + half _ShakeUvSpeed, _ShakeUvX, _ShakeUvY; + #endif + + #if NORMALMAP_ON + half _NormalStrength; + #endif + + float _RandomSeed; + + + + + CBUFFER_END + + + + // -- Property used by ScenePickingPass + #ifdef SCENEPICKINGPASS + float4 _SelectionID; + #endif + + // -- Properties used by SceneSelectionPass + #ifdef SCENESELECTIONPASS + int _ObjectId; + int _PassValue; + #endif + + + // data across stages, stripped like the above. + struct VertexToPixel + { + float4 pos : SV_POSITION; + float3 worldPos : TEXCOORD0; + float3 worldNormal : TEXCOORD1; + float4 worldTangent : TEXCOORD2; + float4 texcoord0 : TEXCOORD3; + float4 texcoord1 : TEXCOORD4; + float4 texcoord2 : TEXCOORD5; + // #if %TEXCOORD3REQUIREKEY% + float4 texcoord3 : TEXCOORD6; + // #endif + + // #if %SCREENPOSREQUIREKEY% + // float4 screenPos : TEXCOORD7; + // #endif + + // #if %VERTEXCOLORREQUIREKEY% + float4 vertexColor : COLOR; + // #endif + + // #if %EXTRAV2F0REQUIREKEY% + // float4 extraV2F0 : TEXCOORD8; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // float4 extraV2F1 : TEXCOORD9; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // float4 extraV2F2 : TEXCOORD10; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // float4 extraV2F3 : TEXCOORD11; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // float4 extraV2F4 : TEXCOORD12; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // float4 extraV2F5 : TEXCOORD13; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // float4 extraV2F6 : TEXCOORD14; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // float4 extraV2F7 : TEXCOORD15; + // #endif + + #if UNITY_ANY_INSTANCING_ENABLED + UNITY_VERTEX_INPUT_INSTANCE_ID + #endif // UNITY_ANY_INSTANCING_ENABLED + + #if _HDRP && (_PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR))) + float4 previousPositionCS : TEXCOORD16; // Contain previous transform position (in case of skinning for example) + float4 motionVectorCS : TEXCOORD17; + #endif + + UNITY_VERTEX_OUTPUT_STEREO + }; + + + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Debug/DebugDisplay.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/Material.hlsl" + #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/NormalSurfaceGradient.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/Lit/Lit.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/BuiltinUtilities.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/MaterialUtilities.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/Decal/DecalUtilities.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/Lit/LitDecalData.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/ShaderGraphFunctions.hlsl" + + + + + + // data describing the user output of a pixel + struct Surface + { + half3 Albedo; + half Height; + half3 Normal; + half Smoothness; + half3 Emission; + half Metallic; + half3 Specular; + half Occlusion; + half SpecularPower; // for simple lighting + half Alpha; + float outputDepth; // if written, SV_Depth semantic is used. ShaderData.clipPos.z is unused value + // HDRP Only + half SpecularOcclusion; + half SubsurfaceMask; + half Thickness; + half CoatMask; + half CoatSmoothness; + half Anisotropy; + half IridescenceMask; + half IridescenceThickness; + int DiffusionProfileHash; + float SpecularAAThreshold; + float SpecularAAScreenSpaceVariance; + // requires _OVERRIDE_BAKEDGI to be defined, but is mapped in all pipelines + float3 DiffuseGI; + float3 BackDiffuseGI; + float3 SpecularGI; + float ior; + float3 transmittanceColor; + float atDistance; + float transmittanceMask; + // requires _OVERRIDE_SHADOWMASK to be defines + float4 ShadowMask; + + // for decals + float NormalAlpha; + float MAOSAlpha; + + + }; + + // Data the user declares in blackboard blocks + struct Blackboard + { + + float blackboardDummyData; + }; + + // data the user might need, this will grow to be big. But easy to strip + struct ShaderData + { + float4 clipPos; // SV_POSITION + float3 localSpacePosition; + float3 localSpaceNormal; + float3 localSpaceTangent; + + float3 worldSpacePosition; + float3 worldSpaceNormal; + float3 worldSpaceTangent; + float tangentSign; + + float3 worldSpaceViewDir; + float3 tangentSpaceViewDir; + + float4 texcoord0; + float4 texcoord1; + float4 texcoord2; + float4 texcoord3; + + float2 screenUV; + float4 screenPos; + + float4 vertexColor; + bool isFrontFace; + + float4 extraV2F0; + float4 extraV2F1; + float4 extraV2F2; + float4 extraV2F3; + float4 extraV2F4; + float4 extraV2F5; + float4 extraV2F6; + float4 extraV2F7; + + float3x3 TBNMatrix; + Blackboard blackboard; + }; + + struct VertexData + { + #if SHADER_TARGET > 30 + // uint vertexID : SV_VertexID; + #endif + float4 vertex : POSITION; + float3 normal : NORMAL; + float4 tangent : TANGENT; + float4 texcoord0 : TEXCOORD0; + + // optimize out mesh coords when not in use by user or lighting system + #if _URP && (_USINGTEXCOORD1 || _PASSMETA || _PASSFORWARD || _PASSGBUFFER) + float4 texcoord1 : TEXCOORD1; + #endif + + #if _URP && (_USINGTEXCOORD2 || _PASSMETA || ((_PASSFORWARD || _PASSGBUFFER) && defined(DYNAMICLIGHTMAP_ON))) + float4 texcoord2 : TEXCOORD2; + #endif + + #if _STANDARD && (_USINGTEXCOORD1 || (_PASSMETA || ((_PASSFORWARD || _PASSGBUFFER || _PASSFORWARDADD) && LIGHTMAP_ON))) + float4 texcoord1 : TEXCOORD1; + #endif + #if _STANDARD && (_USINGTEXCOORD2 || (_PASSMETA || ((_PASSFORWARD || _PASSGBUFFER) && DYNAMICLIGHTMAP_ON))) + float4 texcoord2 : TEXCOORD2; + #endif + + + #if _HDRP + float4 texcoord1 : TEXCOORD1; + float4 texcoord2 : TEXCOORD2; + #endif + + // #if %TEXCOORD3REQUIREKEY% + float4 texcoord3 : TEXCOORD3; + // #endif + + // #if %VERTEXCOLORREQUIREKEY% + float4 vertexColor : COLOR; + // #endif + + #if _PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR)) + float3 previousPositionOS : TEXCOORD4; // Contain previous transform position (in case of skinning for example) + #if defined (_ADD_PRECOMPUTED_VELOCITY) + float3 precomputedVelocity : TEXCOORD5; // Add Precomputed Velocity (Alembic computes velocities on runtime side). + #endif + #endif + + UNITY_VERTEX_INPUT_INSTANCE_ID + }; + + struct TessVertex + { + float4 vertex : INTERNALTESSPOS; + float3 normal : NORMAL; + float4 tangent : TANGENT; + float4 texcoord0 : TEXCOORD0; + float4 texcoord1 : TEXCOORD1; + float4 texcoord2 : TEXCOORD2; + + // #if %TEXCOORD3REQUIREKEY% + float4 texcoord3 : TEXCOORD3; + // #endif + + // #if %VERTEXCOLORREQUIREKEY% + float4 vertexColor : COLOR; + // #endif + + // #if %EXTRAV2F0REQUIREKEY% + // float4 extraV2F0 : TEXCOORD5; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // float4 extraV2F1 : TEXCOORD6; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // float4 extraV2F2 : TEXCOORD7; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // float4 extraV2F3 : TEXCOORD8; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // float4 extraV2F4 : TEXCOORD9; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // float4 extraV2F5 : TEXCOORD10; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // float4 extraV2F6 : TEXCOORD11; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // float4 extraV2F7 : TEXCOORD12; + // #endif + + #if _PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR)) + float3 previousPositionOS : TEXCOORD13; // Contain previous transform position (in case of skinning for example) + #if defined (_ADD_PRECOMPUTED_VELOCITY) + float3 precomputedVelocity : TEXCOORD14; + #endif + #endif + + UNITY_VERTEX_INPUT_INSTANCE_ID + UNITY_VERTEX_OUTPUT_STEREO + }; + + struct ExtraV2F + { + float4 extraV2F0; + float4 extraV2F1; + float4 extraV2F2; + float4 extraV2F3; + float4 extraV2F4; + float4 extraV2F5; + float4 extraV2F6; + float4 extraV2F7; + Blackboard blackboard; + float4 time; + }; + + + float3 WorldToTangentSpace(ShaderData d, float3 normal) + { + return mul(d.TBNMatrix, normal); + } + + float3 TangentToWorldSpace(ShaderData d, float3 normal) + { + return mul(normal, d.TBNMatrix); + } + + // in this case, make standard more like SRPs, because we can't fix + // unity_WorldToObject in HDRP, since it already does macro-fu there + + #if _STANDARD + float3 TransformWorldToObject(float3 p) { return mul(unity_WorldToObject, float4(p, 1)); }; + float3 TransformObjectToWorld(float3 p) { return mul(unity_ObjectToWorld, float4(p, 1)); }; + float4 TransformWorldToObject(float4 p) { return mul(unity_WorldToObject, p); }; + float4 TransformObjectToWorld(float4 p) { return mul(unity_ObjectToWorld, p); }; + float4x4 GetWorldToObjectMatrix() { return unity_WorldToObject; } + float4x4 GetObjectToWorldMatrix() { return unity_ObjectToWorld; } + #if (defined(SHADER_API_D3D11) || defined(SHADER_API_XBOXONE) || defined(UNITY_COMPILER_HLSLCC) || defined(SHADER_API_PSSL) || (SHADER_TARGET_SURFACE_ANALYSIS && !SHADER_TARGET_SURFACE_ANALYSIS_MOJOSHADER)) + #define UNITY_SAMPLE_TEX2D_LOD(tex,coord, lod) tex.SampleLevel (sampler##tex,coord, lod) + #define UNITY_SAMPLE_TEX2D_SAMPLER_LOD(tex,samplertex,coord, lod) tex.SampleLevel (sampler##samplertex,coord, lod) + #else + #define UNITY_SAMPLE_TEX2D_LOD(tex,coord,lod) tex2D (tex,coord,0,lod) + #define UNITY_SAMPLE_TEX2D_SAMPLER_LOD(tex,samplertex,coord,lod) tex2D (tex,coord,0,lod) + #endif + + #undef GetWorldToObjectMatrix() + + #define GetWorldToObjectMatrix() unity_WorldToObject + + + #endif + + float3 GetCameraWorldPosition() + { + #if _HDRP + return GetCameraRelativePositionWS(_WorldSpaceCameraPos); + #else + return _WorldSpaceCameraPos; + #endif + } + + #if _GRABPASSUSED + #if _STANDARD + TEXTURE2D(%GRABTEXTURE%); + SAMPLER(sampler_%GRABTEXTURE%); + #endif + + half3 GetSceneColor(float2 uv) + { + #if _STANDARD + return SAMPLE_TEXTURE2D(%GRABTEXTURE%, sampler_%GRABTEXTURE%, uv).rgb; + #else + return SHADERGRAPH_SAMPLE_SCENE_COLOR(uv); + #endif + } + #endif + + + + #if _STANDARD + UNITY_DECLARE_DEPTH_TEXTURE(_CameraDepthTexture); + float GetSceneDepth(float2 uv) { return SAMPLE_DEPTH_TEXTURE(_CameraDepthTexture, uv); } + float GetLinear01Depth(float2 uv) { return Linear01Depth(GetSceneDepth(uv)); } + float GetLinearEyeDepth(float2 uv) { return LinearEyeDepth(GetSceneDepth(uv)); } + #else + float GetSceneDepth(float2 uv) { return SHADERGRAPH_SAMPLE_SCENE_DEPTH(uv); } + float GetLinear01Depth(float2 uv) { return Linear01Depth(GetSceneDepth(uv), _ZBufferParams); } + float GetLinearEyeDepth(float2 uv) { return LinearEyeDepth(GetSceneDepth(uv), _ZBufferParams); } + #endif + + float3 GetWorldPositionFromDepthBuffer(float2 uv, float3 worldSpaceViewDir) + { + float eye = GetLinearEyeDepth(uv); + float3 camView = mul((float3x3)GetObjectToWorldMatrix(), transpose(mul(GetWorldToObjectMatrix(), UNITY_MATRIX_I_V)) [2].xyz); + + float dt = dot(worldSpaceViewDir, camView); + float3 div = worldSpaceViewDir/dt; + float3 wpos = (eye * div) + GetCameraWorldPosition(); + return wpos; + } + + #if _HDRP + float3 ObjectToWorldSpacePosition(float3 pos) + { + return GetAbsolutePositionWS(TransformObjectToWorld(pos)); + } + #else + float3 ObjectToWorldSpacePosition(float3 pos) + { + return TransformObjectToWorld(pos); + } + #endif + + #if _STANDARD + UNITY_DECLARE_SCREENSPACE_TEXTURE(_CameraDepthNormalsTexture); + float3 GetSceneNormal(float2 uv, float3 worldSpaceViewDir) + { + float4 depthNorms = UNITY_SAMPLE_SCREENSPACE_TEXTURE(_CameraDepthNormalsTexture, uv); + float3 norms = DecodeViewNormalStereo(depthNorms); + norms = mul((float3x3)GetWorldToViewMatrix(), norms) * 0.5 + 0.5; + return norms; + } + #elif _HDRP && !_DECALSHADER + + float3 GetSceneNormal(float2 uv, float3 worldSpaceViewDir) + { + NormalData nd; + DecodeFromNormalBuffer(_ScreenSize.xy * uv, nd); + return nd.normalWS; + } + #elif _URP + #if (SHADER_LIBRARY_VERSION_MAJOR >= 10) + #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/DeclareNormalsTexture.hlsl" + #endif + + float3 GetSceneNormal(float2 uv, float3 worldSpaceViewDir) + { + #if (SHADER_LIBRARY_VERSION_MAJOR >= 10) + return SampleSceneNormals(uv); + #else + float3 wpos = GetWorldPositionFromDepthBuffer(uv, worldSpaceViewDir); + return normalize(-cross(ddx(wpos), ddy(wpos))) * 0.5 + 0.5; + #endif + + } + #endif + + #if _HDRP + + half3 UnpackNormalmapRGorAG(half4 packednormal) + { + // This do the trick + packednormal.x *= packednormal.w; + + half3 normal; + normal.xy = packednormal.xy * 2 - 1; + normal.z = sqrt(1 - saturate(dot(normal.xy, normal.xy))); + return normal; + } + half3 UnpackNormal(half4 packednormal) + { + #if defined(UNITY_NO_DXT5nm) + return packednormal.xyz * 2 - 1; + #else + return UnpackNormalmapRGorAG(packednormal); + #endif + } + #endif + #if _HDRP || _URP + + half3 UnpackScaleNormal(half4 packednormal, half scale) + { + #ifndef UNITY_NO_DXT5nm + // Unpack normal as DXT5nm (1, y, 1, x) or BC5 (x, y, 0, 1) + // Note neutral texture like "bump" is (0, 0, 1, 1) to work with both plain RGB normal and DXT5nm/BC5 + packednormal.x *= packednormal.w; + #endif + half3 normal; + normal.xy = (packednormal.xy * 2 - 1) * scale; + normal.z = sqrt(1 - saturate(dot(normal.xy, normal.xy))); + return normal; + } + + #endif + + + void GetSun(out float3 lightDir, out float3 color) + { + lightDir = float3(0.5, 0.5, 0); + color = 1; + #if _HDRP + if (_DirectionalLightCount > 0) + { + DirectionalLightData light = _DirectionalLightDatas[0]; + lightDir = -light.forward.xyz; + color = light.color; + } + #elif _STANDARD + lightDir = normalize(_WorldSpaceLightPos0.xyz); + color = _LightColor0.rgb; + #elif _URP + Light light = GetMainLight(); + lightDir = light.direction; + color = light.color; + #endif + } + + + + + + + + + + TEXTURE2D(_MainTex); + SAMPLER(sampler_MainTex); + + #if GLOW_ON + TEXTURE2D(_GlowTex); + SAMPLER(sampler_GlowTex); + #endif + + #if FADE_ON + TEXTURE2D(_FadeTex); + SAMPLER(sampler_FadeTex); + + TEXTURE2D(_FadeBurnTex); + SAMPLER(sampler_FadeBurnTex); + #endif + + #if DISTORT_ON + TEXTURE2D(_DistortTex); + SAMPLER(sampler_DistortTex); + #endif + + #if OUTTEX_ON + TEXTURE2D(_OutlineTex); + SAMPLER(sampler_OutlineTex); + #endif + + #if OUTDIST_ON + TEXTURE2D(_OutlineDistortTex); + SAMPLER(sampler_OutlineDistortTex); + #endif + + #if COLORSWAP_ON + TEXTURE2D(_ColorSwapTex); + SAMPLER(sampler_ColorSwapTex); + #endif + + #if COLORRAMP_ON + TEXTURE2D(_ColorRampTex); + TEXTURE2D(_ColorRampTexGradient); + SAMPLER(sampler_ColorRampTex); + SAMPLER(sampler_ColorRampTexGradient); + #endif + + #if SHINE_ON + TEXTURE2D(_ShineMask); + SAMPLER(sampler_ShineMask); + #endif + + #if OVERLAY_ON + TEXTURE2D(_OverlayTex); + SAMPLER(sampler_OverlayTex); + #endif + + #if NORMALMAP_ON + TEXTURE2D(_NormalMap); + SAMPLER(sampler_NormalMap); + #endif + + + half3 GetPixel(in int offsetX, in int offsetY, in half2 uv, in Texture2D _tex, in SamplerState _sampler) + { + half2 _uv = uv + half2(offsetX * _MainTex_TexelSize.x, offsetY * _MainTex_TexelSize.y); + half4 col = SAMPLE_TEXTURE2D(_tex, _sampler, _uv); + return col.rgb; + } + + + //BLURS------------------------------------------------------------------------- + half4 Blur(half2 uv, Texture2D source, SamplerState sampler_source, half Intensity) + { + const half2 texelSize = 1.0 / _ScreenParams.xy; + const half4 color = SAMPLE_TEXTURE2D(source, sampler_source, uv); + const half2 offset = Intensity * texelSize; + + half4 accumulatedColor = color; + half accumulatedWeight = 1.0; + for (int x = -1; x <= 1; x++) + { + for (int y = -1; y <= 1; y++) + { + const half2 sampleUV = uv + half2(x, y) * offset; + const half4 sampleColor = SAMPLE_TEXTURE2D(source, sampler_source, sampleUV); + + accumulatedColor += sampleColor; + accumulatedWeight += 1.0; + } + } + + half4 blurredColor = accumulatedColor / accumulatedWeight; + return blurredColor; + } + + half BlurHD_G(half bhqp, half x) + { + return exp(-(x * x) / (2.0 * bhqp * bhqp)); + } + half4 BlurHD(half2 uv, Texture2D source, SamplerState sampler_source, half BlurAmount, half xScale, half yScale) + { + int iterations = 16; + int halfIterations = iterations / 2; + half sigmaX = 0.1 + BlurAmount * 0.5; + half sigmaY = sigmaX; + half total = 0.0; + half4 ret = half4(0, 0, 0, 0); + for (int iy = 0; iy < iterations; ++iy) + { + half fy = BlurHD_G(sigmaY, half(iy) -half(halfIterations)); + half offsetY = half(iy - halfIterations) * 0.00390625 * xScale; + for (int ix = 0; ix < iterations; ++ix) + { + half fx = BlurHD_G(sigmaX, half(ix) - half(halfIterations)); + half offsetX = half(ix - halfIterations) * 0.00390625 * yScale; + total += fx * fy; + ret += SAMPLE_TEXTURE2D(source, sampler_source, uv + half2(offsetX, offsetY)) * fx * fy; + } + } + return ret / total; + } + //----------------------------------------------------------------------- + + + //------------------------------------------- + half RemapFloat(half inValue, half inMin, half inMax, half outMin, half outMax){ + return outMin + (inValue - inMin) * (outMax - outMin) / (inMax - inMin); + } + //------------------------------------------- + + //----------------------------------------------------------------------- + half rand(half2 seed, half offset) { + return (frac(sin(dot(seed, half2(12.9898, 78.233))) * 43758.5453) + offset) % 1.0; + } + + half rand2(half2 seed, half offset) { + return (frac(sin(dot(seed * floor(50 + (_Time.x % 1.0) * 12.), half2(127.1, 311.7))) * 43758.5453123) + offset) % 1.0; + } + + half rand2CustomTime(half2 seed, half offset, half customTime) { + return (frac(sin(dot(seed * floor(50 + (customTime % 1.0) * 12.), half2(127.1, 311.7))) * 43758.5453123) + offset) % 1.0; + } + //----------------------------------------------------------------------- + + + void Ext_ModifyVertex0 (inout VertexData v, inout ExtraV2F d) + { + //BILBOARD_ON + #if BILBOARD_ON + half3 camRight = mul((half3x3)unity_CameraToWorld, half3(1,0,0)); + half3 camUp = half3(0,1,0); + #if BILBOARDY_ON + camUp = mul((half3x3)unity_CameraToWorld, half3(0,1,0)); + #endif + half3 localPos = v.vertex.x * camRight + v.vertex.y * camUp; + v.vertex = half4(localPos, 1); + #endif + //----------------------------------------------------------- + + v.texcoord0.xy = TRANSFORM_TEX(v.texcoord0.xy, _MainTex); + half2 center = half2(0.5, 0.5); + #if ATLAS_ON + center = half2((_MaxXUV + _MinXUV) / 2.0, (_MaxYUV + _MinYUV) / 2.0); + #endif + + //POLARUV_ON + #if POLARUV_ON + v.texcoord0.xy = v.texcoord0.xy - center; + #endif + + //---------------------------------------- + + //ROTATEUV_ON + #if ROTATEUV_ON + half2 uvC = v.texcoord0.xy; + half cosAngle = cos(_RotateUvAmount); + half sinAngle = sin(_RotateUvAmount); + half2x2 rot = half2x2(cosAngle, -sinAngle, sinAngle, cosAngle); + uvC -= center; + v.texcoord0.xy = mul(rot, uvC); + v.texcoord0.xy += center; + #endif + //-------------------- + + #if RECTSIZE_ON + v.vertex.xyz += (v.vertex.xyz * (_RectSize - 1.0)); + #endif + + #if OUTTEX_ON + v.texcoord1.xy = TRANSFORM_TEX(v.texcoord0.xy, _OutlineTex); + #endif + + #if OUTDIST_ON + v.texcoord2.xy = TRANSFORM_TEX(v.texcoord0.xy, _OutlineDistortTex); + #endif + + #if DISTORT_ON + v.texcoord3.xy = TRANSFORM_TEX(v.texcoord0.xy, _DistortTex); + #endif + } + + void Ext_SurfaceFunction0 (inout Surface o, ShaderData d) + { + half randomSeed = _RandomSeed; + + float2 uvRect = d.texcoord0; + half2 center = half2(0.5, 0.5); + #if ATLAS_ON + center = half2((_MaxXUV + _MinXUV) / 2.0, (_MaxYUV + _MinYUV) / 2.0); + uvRect = half2((d.texcoord0.x - _MinXUV) / (_MaxXUV - _MinXUV), (d.texcoord0.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half2 centerTiled = half2(center.x * _MainTex_ST.x, center.y * _MainTex_ST.y); + + //CLIPPING_ON + #if CLIPPING_ON + half2 tiledUv = half2(d.texcoord0.x / _MainTex_ST.x, d.texcoord0.y / _MainTex_ST.y); + #if ATLAS_ON + tiledUv = half2((tiledUv.x - _MinXUV) / (_MaxXUV - _MinXUV), (tiledUv.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + clip((1 - _ClipUvUp) - tiledUv.y); + clip(tiledUv.y - _ClipUvDown); + clip((1 - _ClipUvRight) - tiledUv.x); + clip(tiledUv.x - _ClipUvLeft); + #endif + //---------------------------------- + + //RADIALCLIPPING_ON + #if RADIALCLIPPING_ON + half2 tiledUv2 = half2(d.texcoord0.x / _MainTex_ST.x, d.texcoord0.y / _MainTex_ST.y); + #if ATLAS_ON + tiledUv2 = half2((tiledUv2.x - _MinXUV) / (_MaxXUV - _MinXUV), (tiledUv2.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half startAngle = _RadialStartAngle - _RadialClip; + half endAngle = _RadialStartAngle + _RadialClip2; + half offset0 = clamp(0, 360, startAngle + 360); + half offset360 = clamp(0, 360, endAngle - 360); + half2 atan2Coord = half2(lerp(-1, 1, tiledUv2.x), lerp(-1, 1, tiledUv2.y)); + half atanAngle = atan2(atan2Coord.y, atan2Coord.x) * 57.3; // angle in degrees + if(atanAngle < 0) atanAngle = 360 + atanAngle; + if(atanAngle >= startAngle && atanAngle <= endAngle) discard; + if(atanAngle <= offset360) discard; + if(atanAngle >= offset0) discard; + #endif + + //----------------------------- + + //TEXTURESCROLL_ON && ATLAS_ON + #if TEXTURESCROLL_ON && ATLAS_ON + d.texcoord0.xy = half2(_MinXUV + ((_MaxXUV - _MinXUV) * (abs(((_Time.y + randomSeed) * _TextureScrollXSpeed) + uvRect.x) % 1)), + _MinYUV + ((_MaxYUV - _MinYUV) * (abs(((_Time.y + randomSeed) * _TextureScrollYSpeed) + uvRect.y) % 1))); + #endif + //---------------------------- + + //OFFSETUV_ON + #if OFFSETUV_ON + #if ATLAS_ON + d.texcoord0.xy = half2(_MinXUV + ((_MaxXUV - _MinXUV) * (abs((_OffsetUvX + uvRect.x) % 1))), + _MinYUV + ((_MaxYUV - _MinYUV) * (abs(_OffsetUvY + uvRect.y) % 1))); + #else + d.texcoord0.xy += half2(_OffsetUvX, _OffsetUvY); + #endif + #endif + + //---------------------- + + //POLARUV_ON + #if POLARUV_ON + d.texcoord0.xy = half2(atan2(d.texcoord0.y, d.texcoord0.x) / (2.0f * 3.141592653589f), length(d.texcoord0.xy)); + d.texcoord0.xy *= _MainTex_ST.xy; + #endif + + //-------------------------------------- + + //TWISTUV_ON + #if TWISTUV_ON + #if ATLAS_ON + _TwistUvPosX = ((_MaxXUV - _MinXUV) * _TwistUvPosX) + _MinXUV; + _TwistUvPosY = ((_MaxYUV - _MinYUV) * _TwistUvPosY) + _MinYUV; + #endif + half2 tempUv = d.texcoord0.xy - half2(_TwistUvPosX * _MainTex_ST.x, _TwistUvPosY * _MainTex_ST.y); + _TwistUvRadius *= (_MainTex_ST.x + _MainTex_ST.y) / 2; + half percent = (_TwistUvRadius - length(tempUv)) / _TwistUvRadius; + half theta = percent * percent * (2.0 * sin(_TwistUvAmount)) * 8.0; + half s = sin(theta); + half c = cos(theta); + half beta = max(sign(_TwistUvRadius - length(tempUv)), 0.0); + tempUv = half2(dot(tempUv, half2(c, -s)), dot(tempUv, half2(s, c))) * beta + tempUv * (1 - beta); + tempUv += half2(_TwistUvPosX * _MainTex_ST.x, _TwistUvPosY * _MainTex_ST.y); + d.texcoord0.xy = tempUv; + #endif + + //-------------------------------------------- + + //FISHEYE_ON + #if FISHEYE_ON + half bind = length(centerTiled); + half2 dF = d.texcoord0.xy - centerTiled; + half dFlen = length(dF); + half fishInt = (3.14159265359 / bind) * (_FishEyeUvAmount + 0.001); + d.texcoord0.xy = centerTiled + (dF / (max(0.0001, dFlen))) * tan(dFlen * fishInt) * bind / tan(bind * fishInt); + #endif + //--------------------------------------------- + + //PINCH_ON + #if PINCH_ON + half2 dP = d.texcoord0.xy - centerTiled; + half pinchInt = (3.141592 / length(centerTiled)) * (-_PinchUvAmount + 0.001); + d.texcoord0.xy = centerTiled + normalize(dP) * atan(length(dP) * -pinchInt * 10.0) * 0.5 / atan(-pinchInt * 5); + #endif + + //--------------------------------------------- + + //ZOOMUV_ON + #if ZOOMUV_ON + d.texcoord0.xy -= centerTiled; + d.texcoord0.xy = d.texcoord0.xy * _ZoomUvAmount; + d.texcoord0.xy += centerTiled; + #endif + + //----------------------------------------------- + + //DOODLE_ON + #if DOODLE_ON + half2 uvCopy = uvRect; + _HandDrawnSpeed = (floor((_Time.x + randomSeed) * 20 * _HandDrawnSpeed) / _HandDrawnSpeed) * _HandDrawnSpeed; + uvCopy.x = sin((uvCopy.x * _HandDrawnAmount + _HandDrawnSpeed) * 4); + uvCopy.y = cos((uvCopy.y * _HandDrawnAmount + _HandDrawnSpeed) * 4); + d.texcoord0.xy = lerp(d.texcoord0.xy, d.texcoord0.xy + uvCopy, 0.0005 * _HandDrawnAmount); + #endif + + //-------------------------- + + //SHAKEUV_ON + #if SHAKEUV_ON + half xShake = sin((_Time.x + randomSeed) * _ShakeUvSpeed * 50) * _ShakeUvX; + half yShake = cos((_Time.x + randomSeed) * _ShakeUvSpeed * 50) * _ShakeUvY; + d.texcoord0.xy += half2(xShake * 0.012, yShake * 0.01); + #endif + + //------------------------------------------- + + //RECTSIZE_ON + #if RECTSIZE_ON + d.texcoord0.xy = d.texcoord0.xy * (_RectSize).xx + (((-_RectSize * 0.5) + 0.5)).xx; + #endif + + //------------------------------------------- + + //DISTORT_ON + #if DISTORT_ON + #if ATLAS_ON + d.texcoord3.x = d.texcoord3.x * (1 / (_MaxXUV - _MinXUV)); + d.texcoord3.y = d.texcoord3.y * (1 / (_MaxYUV - _MinYUV)); + #endif + + d.texcoord3.x += ((_Time.x + _RandomSeed) * _DistortTexXSpeed) % 1; + d.texcoord3.y += ((_Time.x + _RandomSeed) * _DistortTexYSpeed) % 1; + half distortAmnt = (SAMPLE_TEXTURE2D(_DistortTex, sampler_DistortTex, d.texcoord3.xy).r - 0.5) * 0.2 * _DistortAmount; + d.texcoord0.x += distortAmnt; + d.texcoord0.y += distortAmnt; + #endif + //------------------------------------------------------- + + //WARP_ON + #if WARP_ON + half2 warpUv = half2(d.texcoord0.x / _MainTex_ST.x, d.texcoord0.y / _MainTex_ST.y); + #if ATLAS_ON + warpUv = half2((warpUv.x - _MinXUV) / (_MaxXUV - _MinXUV), (warpUv.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + const float tau = 6.283185307179586; + float xWarp = (_Time.y + randomSeed) * _WarpSpeed + warpUv.x * tau / _WarpScale; + float yWarp = (_Time.y + randomSeed) * _WarpSpeed + warpUv.y * tau / _WarpScale; + float2 warp = float2(sin(xWarp), sin(yWarp)) * _WarpStrength; + d.texcoord0.xy += warp; + #endif + + //------------------------------------------------------- + + //WAVEUV_ON + #if WAVEUV_ON + float2 uvWave = half2(_WaveX * _MainTex_ST.x, _WaveY * _MainTex_ST.y) - d.texcoord0.xy; + uvWave %= 1; + #if ATLAS_ON + uvWave = half2(_WaveX, _WaveY) - uvRect; + #endif + uvWave.x *= _ScreenParams.x / _ScreenParams.y; + float waveTime = _Time.y + randomSeed; + float angWave = (sqrt(dot(uvWave, uvWave)) * _WaveAmount) - ((waveTime * _WaveSpeed)); + d.texcoord0.xy = d.texcoord0.xy + uvWave * sin(angWave) * (_WaveStrength / 1000.0); + #endif + //---------------------------------------------------- + + //ROUNDWAVEUV_ON + #if ROUNDWAVEUV_ON + half xWave = ((0.5 * _MainTex_ST.x) - uvRect.x); + half yWave = ((0.5 * _MainTex_ST.y) - uvRect.y) * (_MainTex_TexelSize.w / _MainTex_TexelSize.z); + half ripple = -sqrt(xWave*xWave + yWave* yWave); + d.texcoord0.xy += (sin((ripple + (_Time.y + randomSeed) * (_RoundWaveSpeed/10.0)) / 0.015) * (_RoundWaveStrength/10.0)) % 1; + #endif + //---------------------------------------------------- + + + //WIND_ON + #if WIND_ON + half windOffset = sin((_Time.x + randomSeed) * _GrassSpeed * 10); + half2 windCenter = half2(0.5, 0.1); + #if ATLAS_ON + windCenter.x = ((_MaxXUV - _MinXUV) * windCenter.x) + _MinXUV; + windCenter.y = ((_MaxYUV - _MinYUV) * windCenter.y) + _MinYUV; + #endif + #if !MANUALWIND_ON + d.texcoord0.x = fmod(abs(lerp(d.texcoord0.x, d.texcoord0.x + (_GrassWind * 0.01 * windOffset), uvRect.y)), 1); + #else + d.texcoord0.x = fmod(abs(lerp(d.texcoord0.x, d.texcoord0.x + (_GrassWind * 0.01 * _GrassManualAnim), uvRect.y)), 1); + windOffset = _GrassManualAnim; + #endif + half2 delta = d.texcoord0.xy - windCenter; + half delta2 = dot(delta.xy, delta.xy); + half2 delta_offset = delta2 * windOffset; + d.texcoord0.xy = d.texcoord0.xy + half2(delta.y, -delta.x) * delta_offset * _GrassRadialBend; + #endif + + //-------------------------------------------------------- + + //TEXTURESCROLL_ON && !ATLAS_ON + #if TEXTURESCROLL_ON && !ATLAS_ON + d.texcoord0.x += ((_Time.y + randomSeed) * _TextureScrollXSpeed) % 1; + d.texcoord0.y += ((_Time.y + randomSeed) * _TextureScrollYSpeed) % 1; + #endif + //------------------------------ + + //PIXELATE_ON + #if PIXELATE_ON + half aspectRatio = _MainTex_TexelSize.x / _MainTex_TexelSize.y; + half2 pixelSize = float2(_PixelateSize, _PixelateSize * aspectRatio); + d.texcoord0.xy = floor(d.texcoord0.xy * pixelSize) / pixelSize; + #endif + //-------------- + + half4 col = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy); + half originalAlpha = col.a; + col *= d.vertexColor; + + //NORMAL MAP + #if NORMALMAP_ON + half4 normalSample = SAMPLE_TEXTURE2D(_NormalMap, sampler_NormalMap, d.texcoord0.xy); + half3 normalTS = UnpackNormal(normalSample); + normalTS.xy *= _NormalStrength; + o.Normal = normalTS; + #endif + + + //GLITCH_ON + #if GLITCH_ON + half2 uvGlitch = uvRect; + uvGlitch.y -= 0.5; + half lineNoise = pow(rand2(floor(uvGlitch * half2(24., 19.) * _GlitchSize) * 4.0, randomSeed), 3.0) * _GlitchAmount + * pow(rand2(floor(uvGlitch * half2(38., 14.) * _GlitchSize) * 4.0, randomSeed), 3.0); + col = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(lineNoise * 0.02 * rand2(half2(2.0, 1), randomSeed), 0)) * d.vertexColor; + #endif + //-------------------------------------- + + //CHROMABERR_ON + #if CHROMABERR_ON + half4 r = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(_ChromAberrAmount/10, 0)) * d.vertexColor; + half4 b = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(-_ChromAberrAmount/10, 0)) * d.vertexColor; + col = half4(r.r * r.a, col.g, b.b * b.a, max(max(r.a, b.a) * _ChromAberrAlpha, col.a)); + #endif + + //-------------------------------- + + //BLUR_ON + #if BLUR_ON + #if ATLAS_ON + #if !BLURISHD_ON + col = BlurHD(d.texcoord0.xy, _MainTex, sampler_MainTex, _BlurIntensity, (_MaxXUV - _MinXUV), (_MaxYUV - _MinYUV)) * d.vertexColor; + #else + col = Blur(d.texcoord0.xy, _MainTex, sampler_MainTex, _BlurIntensity * (_MaxXUV - _MinXUV)) * d.vertexColor; + #endif + #else + #if !BLURISHD_ON + col = BlurHD(d.texcoord0.xy, _MainTex, sampler_MainTex, _BlurIntensity, 1, 1) * d.vertexColor; + #else + col = Blur(d.texcoord0.xy, _MainTex, sampler_MainTex, _BlurIntensity) * d.vertexColor; + #endif + #endif + #endif + + //-------------------- + + //MOTIONBLUR_ON + #if MOTIONBLUR_ON + _MotionBlurAngle = _MotionBlurAngle * 3.1415926; + #define rot(n) mul(n, half2x2(cos(_MotionBlurAngle), -sin(_MotionBlurAngle), sin(_MotionBlurAngle), cos(_MotionBlurAngle))) + _MotionBlurDist = _MotionBlurDist * 0.005; + #if ATLAS_ON + _MotionBlurDist *= (_MaxXUV - _MinXUV); + #endif + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(-_MotionBlurDist, -_MotionBlurDist))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(-_MotionBlurDist * 2, -_MotionBlurDist * 2))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(-_MotionBlurDist * 3, -_MotionBlurDist * 3))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(-_MotionBlurDist * 4, -_MotionBlurDist * 4))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(_MotionBlurDist, _MotionBlurDist))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(_MotionBlurDist * 2, _MotionBlurDist * 2))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(_MotionBlurDist * 3, _MotionBlurDist * 3))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(_MotionBlurDist * 4, _MotionBlurDist * 4))); + col.rgb = col.rgb / 9; + #endif + //------------------------------------ + + //NEGATIVE_ON + #if NEGATIVE_ON + col.rgb = lerp(col.rgb, 1 - col.rgb, _NegativeAmount); + #endif + + //-------------- + half luminance = 0; + + //GREYSCALE_ON && !GREYSCALEOUTLINE_ON + #if GREYSCALE_ON && !GREYSCALEOUTLINE_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + luminance = saturate(luminance + _GreyscaleLuminosity); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _GreyscaleTintColor, _GreyscaleBlend); + #endif + //------------------------------------ + + //GHOST_ON + #if GHOST_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + half4 ghostResult; + ghostResult.a = saturate(luminance - _GhostTransparency) * col.a; + ghostResult.rgb = col.rgb * (luminance + _GhostColorBoost); + col = lerp(col, ghostResult, _GhostBlend); + #endif + //------------------------------------ + + //INNEROUTLINE_ON + #if INNEROUTLINE_ON + half3 innerT = abs(GetPixel(0, _InnerOutlineThickness, d.texcoord0.xy, _MainTex, sampler_MainTex) - GetPixel(0, -_InnerOutlineThickness, d.texcoord0.xy, _MainTex, sampler_MainTex)); + innerT += abs(GetPixel(_InnerOutlineThickness, 0, d.texcoord0.xy, _MainTex, sampler_MainTex) - GetPixel(-_InnerOutlineThickness, 0, d.texcoord0.xy, _MainTex, sampler_MainTex)); + #if !ONLYINNEROUTLINE_ON + innerT = (innerT / 2.0) * col.a * _InnerOutlineAlpha; + col.rgb += length(innerT) * _InnerOutlineColor.rgb * _InnerOutlineGlow; + #else + innerT *= col.a * _InnerOutlineAlpha; + col.rgb = length(innerT) * _InnerOutlineColor.rgb * _InnerOutlineGlow; + col.a = step(0.3, col.r+col.g+col.b); + #endif + #endif + //------------------------------------------------------- + + //HITEFFECT_ON + #if HITEFFECT_ON + col.rgb = lerp(col.rgb, _HitEffectColor.rgb * _HitEffectGlow, _HitEffectBlend); + #endif + //-------------------- + + //GRADIENT_ON + #if GRADIENT_ON + half2 tiledUvGrad = half2(uvRect.x / _MainTex_ST.x, uvRect.y / _MainTex_ST.y); + #if GRADIENT2COL_ON + _GradTopRightCol = _GradTopLeftCol; + _GradBotRightCol = _GradBotLeftCol; + #endif + #if RADIALGRADIENT_ON + half radialDist = 1 - length(tiledUvGrad - half2(0.5, 0.5)); + radialDist *= (_MainTex_TexelSize.w / _MainTex_TexelSize.z); + radialDist = saturate(_GradBoostX * radialDist); + half4 gradientResult = lerp(_GradTopLeftCol, _GradBotLeftCol, radialDist); + #else + half gradXLerpFactor = saturate(pow(tiledUvGrad.x, _GradBoostX)); + half4 gradientResult = lerp(lerp(_GradBotLeftCol, _GradBotRightCol, gradXLerpFactor), + lerp(_GradTopLeftCol, _GradTopRightCol, gradXLerpFactor), saturate(pow(tiledUvGrad.y, _GradBoostY))); + #endif + gradientResult = lerp(col, gradientResult, _GradBlend); + col.rgb = gradientResult.rgb * col.a; + col.a *= gradientResult.a; + #endif + //-------------------------------------------------------------------- + + //CONTRAST_ON + #if CONTRAST_ON + col.rgb = (col.rgb - float3(0.5, 0.5, 0.5)) * _Contrast + float3(0.5, 0.5, 0.5); + col.rgb += _Brightness; + #endif + + //------------------------------------------------------------------- + + //COLORSWAP_ON + #if COLORSWAP_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + half4 swapMask = SAMPLE_TEXTURE2D(_ColorSwapTex, sampler_ColorSwapTex, d.texcoord0.xy); + swapMask.rgb *= swapMask.a; + half3 redSwap = _ColorSwapRed * swapMask.r * saturate(luminance + _ColorSwapRedLuminosity); + half3 greenSwap = _ColorSwapGreen * swapMask.g * saturate(luminance + _ColorSwapGreenLuminosity); + half3 blueSwap = _ColorSwapBlue * swapMask.b * saturate(luminance + _ColorSwapBlueLuminosity); + swapMask.rgb = col.rgb * saturate(1 - swapMask.r - swapMask.g - swapMask.b); + col.rgb = lerp(col.rgb, swapMask.rgb + redSwap + greenSwap + blueSwap, _ColorSwapBlend); + #endif + //-------------------------------------------------------------------- + + //COLORRAMP_ON && !COLORRAMPOUTLINE_ON + #if COLORRAMP_ON && !COLORRAMPOUTLINE_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + luminance = saturate(luminance + _ColorRampLuminosity); + #if GRADIENTCOLORRAMP_ON + col.rgb = lerp(col.rgb, SAMPLE_TEXTURE2D(_ColorRampTexGradient, sampler_ColorRampTexGradient, half2(luminance, 0)).rgb, _ColorRampBlend); + #else + col.rgb = lerp(col.rgb, SAMPLE_TEXTURE2D(_ColorRampTex, sampler_ColorRampTex, half2(luminance, 0)).rgb, _ColorRampBlend); + #endif + #endif + //-------------------------------------------------------------------- + + //CHANGECOLOR_ON + #if CHANGECOLOR_ON + float3 currChangeColor = saturate(col.rgb); + luminance = 0.3 * currChangeColor.r + 0.59 * currChangeColor.g + 0.11 * currChangeColor.b; + luminance = saturate(luminance + _ColorChangeLuminosity); + half3 dif = abs(currChangeColor - _ColorChangeTarget.rgb); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _ColorChangeNewCol.rgb, + max(sign(1 - saturate(dif.x + dif.y + dif.z) - _ColorChangeTolerance), 0.0)); + #if CHANGECOLOR2_ON + dif = abs(currChangeColor - _ColorChangeTarget2.rgb); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _ColorChangeNewCol2.rgb, + max(sign(1 - saturate(dif.x + dif.y + dif.z) - _ColorChangeTolerance2), 0.0)); + #endif + #if CHANGECOLOR3_ON + dif = abs(currChangeColor - _ColorChangeTarget3.rgb); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _ColorChangeNewCol3.rgb, + max(sign(1 - saturate(dif.x + dif.y + dif.z) - _ColorChangeTolerance3), 0.0)); + #endif + #endif + //------------------------------------------------------- + + //POSTERIZE_ON && !POSTERIZEOUTLINE_ON + #if POSTERIZE_ON && !POSTERIZEOUTLINE_ON + col.rgb = pow(col.rgb, _PosterizeGamma) * _PosterizeNumColors; + col.rgb = floor(col.rgb) / _PosterizeNumColors; + col.rgb = pow(col.rgb, 1.0 / _PosterizeGamma); + #endif + //------------------------------------ + + //HSV_ON + #if HSV_ON + half3 resultHsv = half3(col.rgb); + half cosHsv = _HsvBright * _HsvSaturation * cos(_HsvShift * 3.14159265 / 180); + half sinHsv = _HsvBright * _HsvSaturation * sin(_HsvShift * 3.14159265 / 180); + resultHsv.x = (.299 * _HsvBright + .701 * cosHsv + .168 * sinHsv) * col.x + + (.587 * _HsvBright - .587 * cosHsv + .330 * sinHsv) * col.y + + (.114 * _HsvBright - .114 * cosHsv - .497 * sinHsv) * col.z; + resultHsv.y = (.299 * _HsvBright - .299 * cosHsv - .328 * sinHsv) *col.x + + (.587 * _HsvBright + .413 * cosHsv + .035 * sinHsv) * col.y + + (.114 * _HsvBright - .114 * cosHsv + .292 * sinHsv) * col.z; + resultHsv.z = (.299 * _HsvBright - .3 * cosHsv + 1.25 * sinHsv) * col.x + + (.587 * _HsvBright - .588 * cosHsv - 1.05 * sinHsv) * col.y + + (.114 * _HsvBright + .886 * cosHsv - .203 * sinHsv) * col.z; + col.rgb = resultHsv; + #endif + //------------------------------------------------------- + + //OVERLAY_ON + #if OVERLAY_ON + half2 overlayUvs = d.texcoord0.xy; + overlayUvs.x += ((_Time.y + randomSeed) * _OverlayTextureScrollXSpeed) % 1; + overlayUvs.y += ((_Time.y + randomSeed) * _OverlayTextureScrollYSpeed) % 1; + half4 overlayCol = SAMPLE_TEXTURE2D(_OverlayTex, sampler_OverlayTex, TRANSFORM_TEX(overlayUvs, _OverlayTex)); + overlayCol.rgb *= _OverlayColor.rgb * _OverlayGlow; + #if !OVERLAYMULT_ON + overlayCol.rgb *= overlayCol.a * _OverlayColor.rgb * _OverlayColor.a * _OverlayBlend; + col.rgb += overlayCol.rgb; + #else + overlayCol.a *= _OverlayColor.a; + col = lerp(col, col * overlayCol, _OverlayBlend); + #endif + #endif + + //--------------------------------- + + //OUTBASE_ON + #if OUTBASE_ON + #if OUTBASEPIXELPERF_ON + half2 destUv = half2(_OutlinePixelWidth * _MainTex_TexelSize.x, _OutlinePixelWidth * _MainTex_TexelSize.y); + #else + half2 destUv = half2(_OutlineWidth * _MainTex_TexelSize.x * 200, _OutlineWidth * _MainTex_TexelSize.y * 200); + #endif + + #if OUTDIST_ON + d.texcoord3.x += ((_Time.x + _RandomSeed) * _OutlineDistortTexXSpeed) % 1; + d.texcoord3.y += ((_Time.x + _RandomSeed) * _OutlineDistortTexYSpeed) % 1; + #if ATLAS_ON + d.texcoord3 = half2((d.texcoord3.x - _MinXUV) / (_MaxXUV - _MinXUV), (d.texcoord3.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half outDistortAmnt = (SAMPLE_TEXTURE2D(_OutlineDistortTex, sampler_OutlineDistortTex, d.texcoord3).r - 0.5) * 0.2 * _OutlineDistortAmount; + destUv.x += outDistortAmnt; + destUv.y += outDistortAmnt; + #endif + + half spriteLeft = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(destUv.x, 0)).a; + half spriteRight = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy - half2(destUv.x, 0)).a; + half spriteBottom = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(0, destUv.y)).a; + half spriteTop = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy - half2(0, destUv.y)).a; + half result = spriteLeft + spriteRight + spriteBottom + spriteTop; + + #if OUTBASE8DIR_ON + half spriteTopLeft = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(destUv.x, destUv.y)).a; + half spriteTopRight = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(-destUv.x, destUv.y)).a; + half spriteBotLeft = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(destUv.x, -destUv.y)).a; + half spriteBotRight = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(-destUv.x, -destUv.y)).a; + result = result + spriteTopLeft + spriteTopRight + spriteBotLeft + spriteBotRight; + #endif + + result = step(0.05, saturate(result)); + + #if OUTTEX_ON + d.texcoord1.x += ((_Time.x + _RandomSeed) * _OutlineTexXSpeed) % 1; + d.texcoord1.y += ((_Time.x + _RandomSeed) * _OutlineTexYSpeed) % 1; + #if ATLAS_ON + d.texcoord1 = half2((d.texcoord1.x - _MinXUV) / (_MaxXUV - _MinXUV), (d.texcoord1.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half4 tempOutColor = SAMPLE_TEXTURE2D(_OutlineTex, sampler_OutlineTex, d.texcoord1); + tempOutColor *= _OutlineColor; + _OutlineColor = tempOutColor; + #endif + + result *= (1 - originalAlpha) * _OutlineAlpha; + + half4 outline = _OutlineColor * d.vertexColor.a; + outline.rgb *= _OutlineGlow; + outline.a = result; + #if ONLYOUTLINE_ON + col = outline; + #else + col = lerp(col, outline, result); + #endif + #endif + //------------------------------------------------------- + + //FADE_ON + #if FADE_ON + half2 tiledUvFade1 = TRANSFORM_TEX(d.texcoord0, _FadeTex); + half2 tiledUvFade2 = TRANSFORM_TEX(d.texcoord0, _FadeBurnTex); + #if ATLAS_ON + tiledUvFade1 = half2((tiledUvFade1.x - _MinXUV) / (_MaxXUV - _MinXUV), (tiledUvFade1.y - _MinYUV) / (_MaxYUV - _MinYUV)); + tiledUvFade2 = half2((tiledUvFade2.x - _MinXUV) / (_MaxXUV - _MinXUV), (tiledUvFade2.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half fadeTemp = SAMPLE_TEXTURE2D(_FadeTex, sampler_FadeTex, tiledUvFade1).r; + half fade = smoothstep(_FadeAmount, _FadeAmount + _FadeBurnTransition, fadeTemp); + half fadeBurn = saturate(smoothstep(_FadeAmount - _FadeBurnWidth, _FadeAmount - _FadeBurnWidth + 0.1, fadeTemp) * _FadeAmount); + col.a *= fade; + _FadeBurnColor.rgb *= _FadeBurnGlow; + col += fadeBurn * SAMPLE_TEXTURE2D(_FadeBurnTex, sampler_FadeBurnTex, tiledUvFade2) * _FadeBurnColor * originalAlpha * (1 - col.a); + #endif + //------------------------------------------------------- + + //SHADOW_ON + #if SHADOW_ON + half shadowA = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(_ShadowX, _ShadowY)).a; + half preMultShadowMask = 1 - (saturate(shadowA - col.a) * (1 - col.a)); + col.rgb *= 1 - ((shadowA - col.a) * (1 - col.a)); + col.rgb += (_ShadowColor * shadowA) * (1 - col.a); + col.a = max(shadowA * _ShadowAlpha * d.vertexColor.a, col.a); + #endif + + //------------------------------------------------------- + + //GLOW_ON + #if GLOW_ON + half4 emission; + #if GLOWTEX_ON + emission = SAMPLE_TEXTURE2D(_GlowTex, sampler_GlowTex, d.texcoord0); + #else + emission = col; + #endif + + col.rgb *= _GlowGlobal; + emission.rgb *= emission.a * col.a * _Glow * _GlowColor; + col.rgb += emission.rgb; + #endif + //------------------------------------------------------- + + //COLORRAMP_ON && COLORRAMPOUTLINE_ON + #if COLORRAMP_ON && COLORRAMPOUTLINE_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + luminance = saturate(luminance + _ColorRampLuminosity); + #if GRADIENTCOLORRAMP_ON + col.rgb = lerp(col.rgb, SAMPLE_TEXTURE2D(_ColorRampTexGradient, sampler_ColorRampTexGradient, half2(luminance, 0)).rgb, _ColorRampBlend); + #else + col.rgb = lerp(col.rgb, SAMPLE_TEXTURE2D(_ColorRampTex, sampler_ColorRampTex, half2(luminance, 0)).rgb, _ColorRampBlend); + #endif + #endif + //--------------- + + //GREYSCALE_ON && GREYSCALEOUTLINE_ON + #if GREYSCALE_ON && GREYSCALEOUTLINE_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + luminance = saturate(luminance + _GreyscaleLuminosity); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _GreyscaleTintColor, _GreyscaleBlend); + #endif + + //----------------------------------- + + //POSTERIZE_ON && POSTERIZEOUTLINE_ON + #if POSTERIZE_ON && POSTERIZEOUTLINE_ON + col.rgb = pow(col.rgb, _PosterizeGamma) * _PosterizeNumColors; + col.rgb = floor(col.rgb) / _PosterizeNumColors; + col.rgb = pow(col.rgb, 1.0 / _PosterizeGamma); + #endif + + //----------------------------------- + + //SHINE_ON + #if SHINE_ON + half2 uvShine = uvRect; + half cosAngle = cos(_ShineRotate); + half sinAngle = sin(_ShineRotate); + half2x2 rot = half2x2(cosAngle, -sinAngle, sinAngle, cosAngle); + uvShine -= half2(0.5, 0.5); + uvShine = mul(rot, uvShine); + uvShine += half2(0.5, 0.5); + half shineMask = SAMPLE_TEXTURE2D(_ShineMask, sampler_ShineMask, d.texcoord0.xy).a; + half currentDistanceProjection = (uvShine.x + uvShine.y) / 2; + half whitePower = 1 - (abs(currentDistanceProjection - _ShineLocation) / _ShineWidth); + col.rgb += col.a * whitePower * _ShineGlow * max(sign(currentDistanceProjection - (_ShineLocation - _ShineWidth)), 0.0) + * max(sign((_ShineLocation + _ShineWidth) - currentDistanceProjection), 0.0) * _ShineColor * shineMask; + #endif + + //----------------------------------- + + //HOLOGRAM_ON + #if HOLOGRAM_ON + half totalHologram = _HologramStripesAmount + _HologramUnmodAmount; + half hologramYCoord = ((uvRect.y + (((_Time.x + randomSeed) % 1) * _HologramStripesSpeed)) % totalHologram) / totalHologram; + hologramYCoord = abs(hologramYCoord); + half alpha = RemapFloat(saturate(hologramYCoord - (_HologramUnmodAmount/totalHologram)), 0.0, 1.0, _HologramMinAlpha, saturate(_HologramMaxAlpha)); + half hologramMask = max(sign((_HologramUnmodAmount/totalHologram) - hologramYCoord), 0.0); + half4 hologramResult = col; + hologramResult.a *= lerp(alpha, 1, hologramMask); + hologramResult.rgb *= max(1, _HologramMaxAlpha * max(sign(hologramYCoord - (_HologramUnmodAmount/totalHologram)), 0.0)); + hologramMask = 1 - step(0.01,hologramMask); + hologramResult.rgb += hologramMask * _HologramStripeColor * col.a; + col = lerp(col, hologramResult, _HologramBlend); + #endif + + //----------------------------------- + + //FLICKER_ON + #if FLICKER_ON + col.a *= saturate(col.a * step(frac(0.05 + (_Time.w + randomSeed) * _FlickerFreq), 1 - _FlickerPercent) + _FlickerAlpha); + #endif + //----------------------------------- + + //ALPHACUTOFF_ON + + //ALPHAROUND_ON + + //ALPHAOUTLINE_ON + #if ALPHAOUTLINE_ON + half alphaOutlineRes = pow(1 - col.a, max(_AlphaOutlinePower, 0.0001)) * step(_AlphaOutlineMinAlpha, col.a) * _AlphaOutlineBlend; + col.rgb = lerp(col.rgb, _AlphaOutlineColor.rgb * _AlphaOutlineGlow, alphaOutlineRes); + col.a = lerp(col.a, 1, alphaOutlineRes > 1); + #endif + //------------------------------------------------------- + + //FOG_ON + + //------------------ + + col *= _Color; + o.Albedo = col; + col.a *= _Alpha; + clip(col.a - _AlphaCutoffValue - 0.01); + o.Alpha = _Color.a; + } + + + + + + void ChainSurfaceFunction(inout Surface l, inout ShaderData d) + { + Ext_SurfaceFunction0(l, d); + // Ext_SurfaceFunction1(l, d); + // Ext_SurfaceFunction2(l, d); + // Ext_SurfaceFunction3(l, d); + // Ext_SurfaceFunction4(l, d); + // Ext_SurfaceFunction5(l, d); + // Ext_SurfaceFunction6(l, d); + // Ext_SurfaceFunction7(l, d); + // Ext_SurfaceFunction8(l, d); + // Ext_SurfaceFunction9(l, d); + // Ext_SurfaceFunction10(l, d); + // Ext_SurfaceFunction11(l, d); + // Ext_SurfaceFunction12(l, d); + // Ext_SurfaceFunction13(l, d); + // Ext_SurfaceFunction14(l, d); + // Ext_SurfaceFunction15(l, d); + // Ext_SurfaceFunction16(l, d); + // Ext_SurfaceFunction17(l, d); + // Ext_SurfaceFunction18(l, d); + // Ext_SurfaceFunction19(l, d); + // Ext_SurfaceFunction20(l, d); + // Ext_SurfaceFunction21(l, d); + // Ext_SurfaceFunction22(l, d); + // Ext_SurfaceFunction23(l, d); + // Ext_SurfaceFunction24(l, d); + // Ext_SurfaceFunction25(l, d); + // Ext_SurfaceFunction26(l, d); + // Ext_SurfaceFunction27(l, d); + // Ext_SurfaceFunction28(l, d); + // Ext_SurfaceFunction29(l, d); + } + +#if !_DECALSHADER + + void ChainModifyVertex(inout VertexData v, inout VertexToPixel v2p, float4 time) + { + ExtraV2F d; + + ZERO_INITIALIZE(ExtraV2F, d); + ZERO_INITIALIZE(Blackboard, d.blackboard); + // due to motion vectors in HDRP, we need to use the last + // time in certain spots. So if you are going to use _Time to adjust vertices, + // you need to use this time or motion vectors will break. + d.time = time; + + Ext_ModifyVertex0(v, d); + // Ext_ModifyVertex1(v, d); + // Ext_ModifyVertex2(v, d); + // Ext_ModifyVertex3(v, d); + // Ext_ModifyVertex4(v, d); + // Ext_ModifyVertex5(v, d); + // Ext_ModifyVertex6(v, d); + // Ext_ModifyVertex7(v, d); + // Ext_ModifyVertex8(v, d); + // Ext_ModifyVertex9(v, d); + // Ext_ModifyVertex10(v, d); + // Ext_ModifyVertex11(v, d); + // Ext_ModifyVertex12(v, d); + // Ext_ModifyVertex13(v, d); + // Ext_ModifyVertex14(v, d); + // Ext_ModifyVertex15(v, d); + // Ext_ModifyVertex16(v, d); + // Ext_ModifyVertex17(v, d); + // Ext_ModifyVertex18(v, d); + // Ext_ModifyVertex19(v, d); + // Ext_ModifyVertex20(v, d); + // Ext_ModifyVertex21(v, d); + // Ext_ModifyVertex22(v, d); + // Ext_ModifyVertex23(v, d); + // Ext_ModifyVertex24(v, d); + // Ext_ModifyVertex25(v, d); + // Ext_ModifyVertex26(v, d); + // Ext_ModifyVertex27(v, d); + // Ext_ModifyVertex28(v, d); + // Ext_ModifyVertex29(v, d); + + + // #if %EXTRAV2F0REQUIREKEY% + // v2p.extraV2F0 = d.extraV2F0; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // v2p.extraV2F1 = d.extraV2F1; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // v2p.extraV2F2 = d.extraV2F2; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // v2p.extraV2F3 = d.extraV2F3; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // v2p.extraV2F4 = d.extraV2F4; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // v2p.extraV2F5 = d.extraV2F5; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // v2p.extraV2F6 = d.extraV2F6; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // v2p.extraV2F7 = d.extraV2F7; + // #endif + } + + void ChainModifyTessellatedVertex(inout VertexData v, inout VertexToPixel v2p) + { + ExtraV2F d; + ZERO_INITIALIZE(ExtraV2F, d); + ZERO_INITIALIZE(Blackboard, d.blackboard); + + // #if %EXTRAV2F0REQUIREKEY% + // d.extraV2F0 = v2p.extraV2F0; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // d.extraV2F1 = v2p.extraV2F1; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // d.extraV2F2 = v2p.extraV2F2; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // d.extraV2F3 = v2p.extraV2F3; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // d.extraV2F4 = v2p.extraV2F4; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // d.extraV2F5 = v2p.extraV2F5; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // d.extraV2F6 = v2p.extraV2F6; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // d.extraV2F7 = v2p.extraV2F7; + // #endif + + + // Ext_ModifyTessellatedVertex0(v, d); + // Ext_ModifyTessellatedVertex1(v, d); + // Ext_ModifyTessellatedVertex2(v, d); + // Ext_ModifyTessellatedVertex3(v, d); + // Ext_ModifyTessellatedVertex4(v, d); + // Ext_ModifyTessellatedVertex5(v, d); + // Ext_ModifyTessellatedVertex6(v, d); + // Ext_ModifyTessellatedVertex7(v, d); + // Ext_ModifyTessellatedVertex8(v, d); + // Ext_ModifyTessellatedVertex9(v, d); + // Ext_ModifyTessellatedVertex10(v, d); + // Ext_ModifyTessellatedVertex11(v, d); + // Ext_ModifyTessellatedVertex12(v, d); + // Ext_ModifyTessellatedVertex13(v, d); + // Ext_ModifyTessellatedVertex14(v, d); + // Ext_ModifyTessellatedVertex15(v, d); + // Ext_ModifyTessellatedVertex16(v, d); + // Ext_ModifyTessellatedVertex17(v, d); + // Ext_ModifyTessellatedVertex18(v, d); + // Ext_ModifyTessellatedVertex19(v, d); + // Ext_ModifyTessellatedVertex20(v, d); + // Ext_ModifyTessellatedVertex21(v, d); + // Ext_ModifyTessellatedVertex22(v, d); + // Ext_ModifyTessellatedVertex23(v, d); + // Ext_ModifyTessellatedVertex24(v, d); + // Ext_ModifyTessellatedVertex25(v, d); + // Ext_ModifyTessellatedVertex26(v, d); + // Ext_ModifyTessellatedVertex27(v, d); + // Ext_ModifyTessellatedVertex28(v, d); + // Ext_ModifyTessellatedVertex29(v, d); + + // #if %EXTRAV2F0REQUIREKEY% + // v2p.extraV2F0 = d.extraV2F0; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // v2p.extraV2F1 = d.extraV2F1; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // v2p.extraV2F2 = d.extraV2F2; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // v2p.extraV2F3 = d.extraV2F3; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // v2p.extraV2F4 = d.extraV2F4; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // v2p.extraV2F5 = d.extraV2F5; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // v2p.extraV2F6 = d.extraV2F6; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // v2p.extraV2F7 = d.extraV2F7; + // #endif + } + + void ChainFinalColorForward(inout Surface l, inout ShaderData d, inout half4 color) + { + // Ext_FinalColorForward0(l, d, color); + // Ext_FinalColorForward1(l, d, color); + // Ext_FinalColorForward2(l, d, color); + // Ext_FinalColorForward3(l, d, color); + // Ext_FinalColorForward4(l, d, color); + // Ext_FinalColorForward5(l, d, color); + // Ext_FinalColorForward6(l, d, color); + // Ext_FinalColorForward7(l, d, color); + // Ext_FinalColorForward8(l, d, color); + // Ext_FinalColorForward9(l, d, color); + // Ext_FinalColorForward10(l, d, color); + // Ext_FinalColorForward11(l, d, color); + // Ext_FinalColorForward12(l, d, color); + // Ext_FinalColorForward13(l, d, color); + // Ext_FinalColorForward14(l, d, color); + // Ext_FinalColorForward15(l, d, color); + // Ext_FinalColorForward16(l, d, color); + // Ext_FinalColorForward17(l, d, color); + // Ext_FinalColorForward18(l, d, color); + // Ext_FinalColorForward19(l, d, color); + // Ext_FinalColorForward20(l, d, color); + // Ext_FinalColorForward21(l, d, color); + // Ext_FinalColorForward22(l, d, color); + // Ext_FinalColorForward23(l, d, color); + // Ext_FinalColorForward24(l, d, color); + // Ext_FinalColorForward25(l, d, color); + // Ext_FinalColorForward26(l, d, color); + // Ext_FinalColorForward27(l, d, color); + // Ext_FinalColorForward28(l, d, color); + // Ext_FinalColorForward29(l, d, color); + } + + void ChainFinalGBufferStandard(inout Surface s, inout ShaderData d, inout half4 GBuffer0, inout half4 GBuffer1, inout half4 GBuffer2, inout half4 outEmission, inout half4 outShadowMask) + { + // Ext_FinalGBufferStandard0(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard1(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard2(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard3(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard4(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard5(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard6(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard7(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard8(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard9(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard10(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard11(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard12(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard13(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard14(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard15(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard16(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard17(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard18(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard19(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard20(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard21(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard22(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard23(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard24(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard25(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard26(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard27(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard28(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard29(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + } +#endif + + + + + +#if _DECALSHADER + + ShaderData CreateShaderData(SurfaceDescriptionInputs IN) + { + ShaderData d = (ShaderData)0; + d.TBNMatrix = float3x3(IN.WorldSpaceTangent, IN.WorldSpaceBiTangent, IN.WorldSpaceNormal); + d.worldSpaceNormal = IN.WorldSpaceNormal; + d.worldSpaceTangent = IN.WorldSpaceTangent; + + d.worldSpacePosition = IN.WorldSpacePosition; + d.texcoord0 = IN.uv0.xyxy; + d.screenPos = IN.ScreenPosition; + + d.worldSpaceViewDir = normalize(_WorldSpaceCameraPos - d.worldSpacePosition); + + d.tangentSpaceViewDir = mul(d.TBNMatrix, d.worldSpaceViewDir); + + // these rarely get used, so we back transform them. Usually will be stripped. + #if _HDRP + // d.localSpacePosition = mul(GetWorldToObjectMatrix(), float4(GetCameraRelativePositionWS(d.worldSpacePosition), 1)).xyz; + #else + // d.localSpacePosition = mul(GetWorldToObjectMatrix(), float4(d.worldSpacePosition, 1)).xyz; + #endif + // d.localSpaceNormal = normalize(mul((float3x3)GetWorldToObjectMatrix(), d.worldSpaceNormal)); + // d.localSpaceTangent = normalize(mul((float3x3)GetWorldToObjectMatrix(), d.worldSpaceTangent.xyz)); + + // #if %SCREENPOSREQUIREKEY% + // d.screenUV = (IN.ScreenPosition.xy / max(0.01, IN.ScreenPosition.w)); + // #endif + + return d; + } +#else + + ShaderData CreateShaderData(VertexToPixel i + #if NEED_FACING + , bool facing + #endif + ) + { + ShaderData d = (ShaderData)0; + d.clipPos = i.pos; + d.worldSpacePosition = i.worldPos; + + d.worldSpaceNormal = normalize(i.worldNormal); + d.worldSpaceTangent.xyz = normalize(i.worldTangent.xyz); + + d.tangentSign = i.worldTangent.w * unity_WorldTransformParams.w; + float3 bitangent = cross(d.worldSpaceTangent.xyz, d.worldSpaceNormal) * d.tangentSign; + + d.TBNMatrix = float3x3(d.worldSpaceTangent, -bitangent, d.worldSpaceNormal); + d.worldSpaceViewDir = normalize(_WorldSpaceCameraPos - i.worldPos); + + d.tangentSpaceViewDir = mul(d.TBNMatrix, d.worldSpaceViewDir); + d.texcoord0 = i.texcoord0; + d.texcoord1 = i.texcoord1; + d.texcoord2 = i.texcoord2; + + // #if %TEXCOORD3REQUIREKEY% + d.texcoord3 = i.texcoord3; + // #endif + + // d.isFrontFace = facing; + // #if %VERTEXCOLORREQUIREKEY% + d.vertexColor = i.vertexColor; + // #endif + + // these rarely get used, so we back transform them. Usually will be stripped. + #if _HDRP + // d.localSpacePosition = mul(GetWorldToObjectMatrix(), float4(GetCameraRelativePositionWS(i.worldPos), 1)).xyz; + #else + // d.localSpacePosition = mul(GetWorldToObjectMatrix(), float4(i.worldPos, 1)).xyz; + #endif + // d.localSpaceNormal = normalize(mul((float3x3)GetWorldToObjectMatrix(), i.worldNormal)); + // d.localSpaceTangent = normalize(mul((float3x3)GetWorldToObjectMatrix(), i.worldTangent.xyz)); + + // #if %SCREENPOSREQUIREKEY% + // d.screenPos = i.screenPos; + // d.screenUV = (i.screenPos.xy / i.screenPos.w); + // #endif + + + // #if %EXTRAV2F0REQUIREKEY% + // d.extraV2F0 = i.extraV2F0; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // d.extraV2F1 = i.extraV2F1; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // d.extraV2F2 = i.extraV2F2; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // d.extraV2F3 = i.extraV2F3; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // d.extraV2F4 = i.extraV2F4; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // d.extraV2F5 = i.extraV2F5; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // d.extraV2F6 = i.extraV2F6; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // d.extraV2F7 = i.extraV2F7; + // #endif + + return d; + } + +#endif + + + +#if (SHADERPASS == SHADERPASS_LIGHT_TRANSPORT) + + // This was not in constant buffer in original unity, so keep outiside. But should be in as ShaderRenderPass frequency + float unity_OneOverOutputBoost; + float unity_MaxOutputValue; + + CBUFFER_START(UnityMetaPass) + // x = use uv1 as raster position + // y = use uv2 as raster position + bool4 unity_MetaVertexControl; + + // x = return albedo + // y = return normal + bool4 unity_MetaFragmentControl; + CBUFFER_END + + VertexToPixel Vert(VertexData inputMesh) + { + VertexToPixel output; + ZERO_INITIALIZE(VertexToPixel, output); + UNITY_SETUP_INSTANCE_ID(inputMesh); + UNITY_TRANSFER_INSTANCE_ID(inputMesh, output); + UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(output); + + // Output UV coordinate in vertex shader + float2 uv = float2(0.0, 0.0); + + if (unity_MetaVertexControl.x) + { + uv = inputMesh.texcoord1.xy * unity_LightmapST.xy + unity_LightmapST.zw; + } + else if (unity_MetaVertexControl.y) + { + uv = inputMesh.texcoord2.xy * unity_DynamicLightmapST.xy + unity_DynamicLightmapST.zw; + } + + // OpenGL right now needs to actually use the incoming vertex position + // so we create a fake dependency on it here that haven't any impact. + output.pos = float4(uv * 2.0 - 1.0, inputMesh.vertex.z > 0 ? 1.0e-4 : 0.0, 1.0); + + output.worldPos = TransformObjectToWorld(inputMesh.vertex); + + // Normal is required for triplanar mapping + output.worldNormal = TransformObjectToWorldNormal(inputMesh.normal); + // Not required but assign to silent compiler warning + output.worldTangent = float4(1.0, 0.0, 0.0, 0.0); + + output.texcoord0 = inputMesh.texcoord0; + output.texcoord1 = inputMesh.texcoord1; + output.texcoord2 = inputMesh.texcoord2; + // #if %TEXCOORD3REQUIREKEY% + output.texcoord3 = inputMesh.texcoord3; + // #endif + // #if %VERTEXCOLORREQUIREKEY% + output.vertexColor = inputMesh.vertexColor; + // #endif + + return output; + } +#else + + #if (_PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR))) + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/ShaderVariablesMatrixDefsHDCamera.hlsl" + + void MotionVectorPositionZBias(VertexToPixel input) + { + #if UNITY_REVERSED_Z + input.pos.z -= unity_MotionVectorsParams.z * input.pos.w; + #else + input.pos.z += unity_MotionVectorsParams.z * input.pos.w; + #endif + } + + #endif + + VertexToPixel Vert(VertexData input) + { + VertexToPixel output; + ZERO_INITIALIZE(VertexToPixel, output); + + UNITY_SETUP_INSTANCE_ID(input); + UNITY_TRANSFER_INSTANCE_ID(input, output); + UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(output); + + // copy before user modification, since we'll apply that to the copy later + #if _HDRP && (_PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR))) + VertexData previousMesh = input; + #endif + + ChainModifyVertex(input, output, _Time); + + // This return the camera relative position (if enable) + float3 positionRWS = TransformObjectToWorld(input.vertex.xyz); + float3 normalWS = TransformObjectToWorldNormal(input.normal); + float4 tangentWS = float4(TransformObjectToWorldDir(input.tangent.xyz), input.tangent.w); + + + output.worldPos = GetAbsolutePositionWS(positionRWS); + output.pos = TransformWorldToHClip(positionRWS); + output.worldNormal = normalWS; + output.worldTangent = tangentWS; + + + output.texcoord0 = input.texcoord0; + output.texcoord1 = input.texcoord1; + output.texcoord2 = input.texcoord2; + + // #if %TEXCOORD3REQUIREKEY% + output.texcoord3 = input.texcoord3; + // #endif + + // #if %VERTEXCOLORREQUIREKEY% + output.vertexColor = input.vertexColor; + // #endif + + // #if %SCREENPOSREQUIREKEY% + // output.screenPos = ComputeScreenPos(output.pos, _ProjectionParams.x); + // #endif + + #if _HDRP && (_PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR))) + + #if !defined(TESSELLATION_ON) + MotionVectorPositionZBias(output); + #endif + + output.motionVectorCS = mul(UNITY_MATRIX_UNJITTERED_VP, float4(positionRWS, 1.0)); + // Note: unity_MotionVectorsParams.y is 0 is forceNoMotion is enabled + bool forceNoMotion = unity_MotionVectorsParams.y == 0.0; + if (forceNoMotion) + { + output.previousPositionCS = float4(0.0, 0.0, 0.0, 1.0); + } + else + { + bool hasDeformation = unity_MotionVectorsParams.x > 0.0; // Skin or morph target + + float3 effectivePositionOS = (hasDeformation ? previousMesh.previousPositionOS : previousMesh.vertex.xyz); + #if defined(_ADD_PRECOMPUTED_VELOCITY) + effectivePositionOS -= input.precomputedVelocity; + #endif + + + + previousMesh.vertex = float4(effectivePositionOS, 1); + VertexToPixel dummy = (VertexToPixel)0; + + ChainModifyVertex(previousMesh, dummy, _LastTimeParameters); + + float3 previousPositionRWS = TransformPreviousObjectToWorld(previousMesh.vertex.xyz); + // we might need this for skinned objects? + //float3 normalWS = TransformPreviousObjectToWorldNormal(input.normal).xyz; + + #ifdef _WRITE_TRANSPARENT_MOTION_VECTOR + if (_TransparentCameraOnlyMotionVectors > 0) + { + previousPositionRWS = positionRWS.xyz; + } + #endif // _WRITE_TRANSPARENT_MOTION_VECTOR + + output.previousPositionCS = mul(UNITY_MATRIX_PREV_VP, float4(previousPositionRWS, 1.0)); + } + #endif // _HDRP && _PASSMOTIONVECTOR || (_PASSFORWARD && defined(_WRITE_TRANSPARENT_MOTION_VECTOR)) + + + return output; + } + + +#endif + + + + + + + + #if defined(WRITE_DECAL_BUFFER) && !defined(_DISABLE_DECALS) + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/Decal/DecalPrepassBuffer.hlsl" + #endif + + FragInputs BuildFragInputs(VertexToPixel input) + { + UNITY_SETUP_INSTANCE_ID(input); + FragInputs output; + ZERO_INITIALIZE(FragInputs, output); + + // Init to some default value to make the computer quiet (else it output 'divide by zero' warning even if value is not used). + // TODO: this is a really poor workaround, but the variable is used in a bunch of places + // to compute normals which are then passed on elsewhere to compute other values... + output.tangentToWorld = k_identity3x3; + output.positionSS = input.pos; // input.positionCS is SV_Position + // BETTER SHADERS: because we transform world position into actual world space for things like + // triplanar, etc, we have to back transform it here for lighting + output.positionRWS = GetCameraRelativePositionWS(input.worldPos); + output.tangentToWorld = BuildTangentToWorld(input.worldTangent, input.worldNormal); + output.texCoord0 = input.texcoord0; + output.texCoord1 = input.texcoord1; + output.texCoord2 = input.texcoord2; + + return output; + } + + void BuildSurfaceData(FragInputs fragInputs, inout Surface surfaceDescription, float3 V, PositionInputs posInput, out SurfaceData surfaceData, out float3 bentNormalWS) + { + // setup defaults -- these are used if the graph doesn't output a value + ZERO_INITIALIZE(SurfaceData, surfaceData); + + // specularOcclusion need to be init ahead of decal to quiet the compiler that modify the SurfaceData struct + // however specularOcclusion can come from the graph, so need to be init here so it can be override. + surfaceData.specularOcclusion = 1.0; + + // copy across graph values, if defined + surfaceData.baseColor = surfaceDescription.Albedo; + surfaceData.perceptualSmoothness = surfaceDescription.Smoothness; + surfaceData.ambientOcclusion = surfaceDescription.Occlusion; + surfaceData.specularOcclusion = surfaceDescription.SpecularOcclusion; + surfaceData.metallic = surfaceDescription.Metallic; + surfaceData.subsurfaceMask = surfaceDescription.SubsurfaceMask; + surfaceData.thickness = surfaceDescription.Thickness; + surfaceData.diffusionProfileHash = asuint(surfaceDescription.DiffusionProfileHash); + #if _USESPECULAR + surfaceData.specularColor = surfaceDescription.Specular; + #endif + surfaceData.coatMask = surfaceDescription.CoatMask; + surfaceData.anisotropy = surfaceDescription.Anisotropy; + surfaceData.iridescenceMask = surfaceDescription.IridescenceMask; + surfaceData.iridescenceThickness = surfaceDescription.IridescenceThickness; + + + + #if defined(_REFRACTION_PLANE) || defined(_REFRACTION_SPHERE) || defined(_REFRACTION_THIN) + if (_EnableSSRefraction) + { + surfaceData.transmittanceMask = (1.0 - surfaceDescription.Alpha); + surfaceDescription.Alpha = 1.0; + } + else + { + surfaceData.ior = surfaceDescription.ior; + surfaceData.transmittanceColor = surfaceDescription.transmittanceColor; + surfaceData.atDistance = surfaceDescription.atDistance; + surfaceData.transmittanceMask = surfaceDescription.transmittanceMask; + surfaceDescription.Alpha = 1.0; + } + #else + surfaceData.ior = 1.0; + surfaceData.transmittanceColor = float3(1.0, 1.0, 1.0); + surfaceData.atDistance = 1.0; + surfaceData.transmittanceMask = 0.0; + #endif + + + #if defined(_ENABLE_SHADOW_MATTE) && SHADERPASS == SHADERPASS_FORWARD_UNLIT + HDShadowContext shadowContext = InitShadowContext(); + float shadow; + float3 shadow3; + // We need to recompute some coordinate not computed by default for shadow matte + posInput = GetPositionInput(fragInputs.positionSS.xy, _ScreenSize.zw, fragInputs.positionSS.z, UNITY_MATRIX_I_VP, GetWorldToViewMatrix()); + float3 upWS = normalize(fragInputs.tangentToWorld[1]); + uint renderingLayers = GetMeshRenderingLightLayer(); + ShadowLoopMin(shadowContext, posInput, upWS, asuint(_ShadowMatteFilter), renderingLayers, shadow3); + shadow = dot(shadow3, float3(1.0 / 3.0, 1.0 / 3.0, 1.0 / 3.0)); + + float4 shadowColor = (1.0 - shadow) * surfaceDescription.ShadowTint.rgba; + float localAlpha = saturate(shadowColor.a + surfaceDescription.Alpha); + + // Keep the nested lerp + // With no Color (bsdfData.color.rgb, bsdfData.color.a == 0.0f), just use ShadowColor*Color to avoid a ring of "white" around the shadow + // And mix color to consider the Color & ShadowColor alpha (from texture or/and color picker) + #ifdef _SURFACE_TYPE_TRANSPARENT + surfaceData.baseColor = lerp(shadowColor.rgb * surfaceData.baseColor, lerp(lerp(shadowColor.rgb, surfaceData.baseColor, 1.0 - surfaceDescription.ShadowTint.a), surfaceData.baseColor, shadow), surfaceDescription.Alpha); + #else + surfaceData.baseColor = lerp(lerp(shadowColor.rgb, surfaceData.baseColor, 1.0 - surfaceDescription.ShadowTint.a), surfaceData.baseColor, shadow); + #endif + localAlpha = ApplyBlendMode(surfaceData.baseColor, localAlpha).a; + + surfaceDescription.Alpha = localAlpha; + #endif + + // These static material feature allow compile time optimization + surfaceData.materialFeatures = MATERIALFEATUREFLAGS_LIT_STANDARD; + #ifdef _MATERIAL_FEATURE_SUBSURFACE_SCATTERING + surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_SUBSURFACE_SCATTERING; + #endif + + #ifdef _MATERIAL_FEATURE_TRANSMISSION + surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_TRANSMISSION; + #endif + + #ifdef _MATERIAL_FEATURE_ANISOTROPY + surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_ANISOTROPY; + #endif + + #ifdef _MATERIAL_FEATURE_IRIDESCENCE + surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_IRIDESCENCE; + #endif + + #ifdef _MATERIAL_FEATURE_SPECULAR_COLOR + surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_SPECULAR_COLOR; + #endif + + #if defined(_MATERIAL_FEATURE_CLEAR_COAT) || _CLEARCOAT + surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_CLEAR_COAT; + #endif + + #if defined (_MATERIAL_FEATURE_SPECULAR_COLOR) && defined (_ENERGY_CONSERVING_SPECULAR) + // Require to have setup baseColor + // Reproduce the energy conservation done in legacy Unity. Not ideal but better for compatibility and users can unchek it + surfaceData.baseColor *= (1.0 - Max3(surfaceData.specularColor.r, surfaceData.specularColor.g, surfaceData.specularColor.b)); + #endif + + + + // compute world space normal + #if !_WORLDSPACENORMAL + surfaceData.normalWS = mul(surfaceDescription.Normal, fragInputs.tangentToWorld); + #else + surfaceData.normalWS = surfaceDescription.Normal; + #endif + + surfaceData.geomNormalWS = fragInputs.tangentToWorld[2]; + + surfaceData.tangentWS = normalize(fragInputs.tangentToWorld[0].xyz); // The tangent is not normalize in tangentToWorld for mikkt. TODO: Check if it expected that we normalize with Morten. Tag: SURFACE_GRADIENT + + + #if HAVE_DECALS + if (_EnableDecals) + { + float alpha = 1.0; + alpha = surfaceDescription.Alpha; + + // Both uses and modifies 'surfaceData.normalWS'. + DecalSurfaceData decalSurfaceData = GetDecalSurfaceData(posInput, fragInputs.tangentToWorld[2], alpha); + ApplyDecalToSurfaceData(decalSurfaceData, fragInputs.tangentToWorld[2], surfaceData); + } + #endif + + bentNormalWS = surfaceData.normalWS; + + surfaceData.tangentWS = Orthonormalize(surfaceData.tangentWS, surfaceData.normalWS); + + #ifdef DEBUG_DISPLAY + if (_DebugMipMapMode != DEBUGMIPMAPMODE_NONE) + { + // TODO: need to update mip info + surfaceData.metallic = 0; + } + + // We need to call ApplyDebugToSurfaceData after filling the surfarcedata and before filling builtinData + // as it can modify attribute use for static lighting + ApplyDebugToSurfaceData(fragInputs.tangentToWorld, surfaceData); + #endif + + // By default we use the ambient occlusion with Tri-ace trick (apply outside) for specular occlusion. + // If user provide bent normal then we process a better term + #if defined(_SPECULAR_OCCLUSION_CUSTOM) + // Just use the value passed through via the slot (not active otherwise) + #elif defined(_SPECULAR_OCCLUSION_FROM_AO_BENT_NORMAL) + // If we have bent normal and ambient occlusion, process a specular occlusion + surfaceData.specularOcclusion = GetSpecularOcclusionFromBentAO(V, bentNormalWS, surfaceData.normalWS, surfaceData.ambientOcclusion, PerceptualSmoothnessToPerceptualRoughness(surfaceData.perceptualSmoothness)); + #elif defined(_AMBIENT_OCCLUSION) && defined(_SPECULAR_OCCLUSION_FROM_AO) + surfaceData.specularOcclusion = GetSpecularOcclusionFromAmbientOcclusion(ClampNdotV(dot(surfaceData.normalWS, V)), surfaceData.ambientOcclusion, PerceptualSmoothnessToRoughness(surfaceData.perceptualSmoothness)); + #endif + + #if defined(_ENABLE_GEOMETRIC_SPECULAR_AA) && !defined(SHADER_STAGE_RAY_TRACING) + surfaceData.perceptualSmoothness = GeometricNormalFiltering(surfaceData.perceptualSmoothness, fragInputs.tangentToWorld[2], surfaceDescription.SpecularAAScreenSpaceVariance, surfaceDescription.SpecularAAThreshold); + #endif + } + + void GetSurfaceAndBuiltinData(VertexToPixel m2ps, FragInputs fragInputs, float3 V, inout PositionInputs posInput, + out SurfaceData surfaceData, out BuiltinData builtinData, inout Surface l, inout ShaderData d + #if NEED_FACING + , bool facing + #endif + ) + { + // Removed since crossfade does not work, probably needs extra material setup. + //#if !defined(SHADER_STAGE_RAY_TRACING) && !defined(_TESSELLATION_DISPLACEMENT) + // #ifdef LOD_FADE_CROSSFADE // enable dithering LOD transition if user select CrossFade transition in LOD group + // LODDitheringTransition(ComputeFadeMaskSeed(V, posInput.positionSS), unity_LODFade.x); + // #endif + //#endif + + d = CreateShaderData(m2ps + #if NEED_FACING + , facing + #endif + ); + + l = (Surface)0; + + l.Albedo = half3(0.5, 0.5, 0.5); + l.Normal = float3(0,0,1); + l.Occlusion = 1; + l.Alpha = 1; + l.SpecularOcclusion = 1; + + #if !defined(SHADER_STAGE_RAY_TRACING) && defined(_DEPTHOFFSET_ON) + l.outputDepth = d.clipPos.z; + #endif + + ChainSurfaceFunction(l, d); + + #if !defined(SHADER_STAGE_RAY_TRACING) && defined(_DEPTHOFFSET_ON) + //posInput.deviceDepth = l.outputDepth; + #endif + + #if _UNLIT + //l.Emission = l.Albedo; + //l.Albedo = 0; + l.Normal = half3(0,0,1); + l.Occlusion = 1; + l.Metallic = 0; + l.Specular = 0; + #endif + + surfaceData.geomNormalWS = d.worldSpaceNormal; + surfaceData.tangentWS = d.worldSpaceTangent; + fragInputs.tangentToWorld = d.TBNMatrix; + + float3 bentNormalWS; + BuildSurfaceData(fragInputs, l, V, posInput, surfaceData, bentNormalWS); + + + InitBuiltinData(posInput, l.Alpha, bentNormalWS, -d.worldSpaceNormal, fragInputs.texCoord1, fragInputs.texCoord2, builtinData); + + + + builtinData.emissiveColor = l.Emission; + + #if defined(_OVERRIDE_BAKEDGI) + builtinData.bakeDiffuseLighting = l.DiffuseGI; + builtinData.backBakeDiffuseLighting = l.BackDiffuseGI; + builtinData.emissiveColor += l.SpecularGI; + #endif + + #if defined(_OVERRIDE_SHADOWMASK) + builtinData.shadowMask0 = l.ShadowMask.x; + builtinData.shadowMask1 = l.ShadowMask.y; + builtinData.shadowMask2 = l.ShadowMask.z; + builtinData.shadowMask3 = l.ShadowMask.w; + #endif + + #if defined(UNITY_VIRTUAL_TEXTURING) + builtinData.vtPackedFeedback = surfaceData.VTPackedFeedback; + #endif + + #if (SHADERPASS == SHADERPASS_DISTORTION) + //builtinData.distortion = surfaceData.Distortion; + //builtinData.distortionBlur = surfaceData.DistortionBlur; + #endif + + #ifndef SHADER_UNLIT + // PostInitBuiltinData call ApplyDebugToBuiltinData + PostInitBuiltinData(V, posInput, surfaceData, builtinData); + #else + ApplyDebugToBuiltinData(builtinData); + #endif + + RAY_TRACING_OPTIONAL_ALPHA_TEST_PASS + } + + + float4 Frag(VertexToPixel v2f + #if NEED_FACING + , bool facing : SV_IsFrontFace + #endif + ) : SV_Target + { + FragInputs input = BuildFragInputs(v2f); + + // input.positionSS is SV_Position + PositionInputs posInput = GetPositionInput(input.positionSS.xy, _ScreenSize.zw, input.positionSS.z, input.positionSS.w, input.positionRWS); + + float3 V = GetWorldSpaceNormalizeViewDir(input.positionRWS); + + SurfaceData surfaceData; + BuiltinData builtinData; + Surface l; + ShaderData d; + GetSurfaceAndBuiltinData(v2f, input, V, posInput, surfaceData, builtinData, l, d + #if NEED_FACING + , facing + #endif + ); + + // no debug apply during light transport pass + + BSDFData bsdfData = ConvertSurfaceDataToBSDFData(input.positionSS.xy, surfaceData); + LightTransportData lightTransportData = GetLightTransportData(surfaceData, builtinData, bsdfData); + + // This shader is call two times. Once for getting emissiveColor, the other time to get diffuseColor + // We use unity_MetaFragmentControl to make the distinction. + float4 res = float4(0.0, 0.0, 0.0, 1.0); + + if (unity_MetaFragmentControl.x) + { + // Apply diffuseColor Boost from LightmapSettings. + // put abs here to silent a warning, no cost, no impact as color is assume to be positive. + res.rgb = clamp(pow(abs(lightTransportData.diffuseColor), saturate(unity_OneOverOutputBoost)), 0, unity_MaxOutputValue); + } + + if (unity_MetaFragmentControl.y) + { + // emissive use HDR format + res.rgb = lightTransportData.emissiveColor; + } + + return res; + } + + + + ENDHLSL + } + + Pass + { + // based on HDLitPass.template + Name "SceneSelectionPass" + Tags { "LightMode" = "SceneSelectionPass" } + + Cull Off + ColorMask 0 + + Tags { "RenderType" = "Opaque" "Queue" = "Geometry" "PreviewType" = "Plane" } + Cull [_CullingOption] + ZWrite [_ZWrite] + ZTest [_ZTestMode] + + + HLSLPROGRAM + + #pragma target 4.5 + #pragma only_renderers d3d11 playstation xboxone vulkan metal switch + #pragma multi_compile_instancing + #pragma editor_sync_compilation + #pragma instancing_options renderinglayer + + //#pragma shader_feature _ _SURFACE_TYPE_TRANSPARENT + //#pragma shader_feature_local _BLENDMODE_OFF _BLENDMODE_ALPHA _BLENDMODE_ADD _BLENDMODE_PRE_MULTIPLY + //#pragma shader_feature_local _ _ADD_PRECOMPUTED_VELOCITY + //#pragma shader_feature_local _ _TRANSPARENT_WRITES_MOTION_VEC + //#pragma shader_feature_local _ _ENABLE_FOG_ON_TRANSPARENT + //#pragma shader_feature_local _ _DISABLE_DECALS + //#pragma shader_feature_local _ _DISABLE_SSR + //#pragma shader_feature_local _ _DISABLE_SSR_TRANSPARENT + //#pragma shader_feature_local _REFRACTION_OFF _REFRACTION_PLANE _REFRACTION_SPHERE _REFRACTION_THIN + + //------------------------------------------------------------------------------------- + // Variant Definitions (active field translations to HDRP defines) + //------------------------------------------------------------------------------------- + // #define _MATERIAL_FEATURE_SUBSURFACE_SCATTERING 1 + // #define _MATERIAL_FEATURE_TRANSMISSION 1 + // #define _MATERIAL_FEATURE_ANISOTROPY 1 + // #define _MATERIAL_FEATURE_IRIDESCENCE 1 + // #define _MATERIAL_FEATURE_SPECULAR_COLOR 1 + #define _ENABLE_FOG_ON_TRANSPARENT 1 + // #define _AMBIENT_OCCLUSION 1 + // #define _SPECULAR_OCCLUSION_FROM_AO 1 + // #define _SPECULAR_OCCLUSION_FROM_AO_BENT_NORMAL 1 + // #define _SPECULAR_OCCLUSION_CUSTOM 1 + // #define _ENERGY_CONSERVING_SPECULAR 1 + // #define _ENABLE_GEOMETRIC_SPECULAR_AA 1 + // #define _HAS_REFRACTION 1 + // #define _REFRACTION_PLANE 1 + // #define _REFRACTION_SPHERE 1 + // #define _DISABLE_DECALS 1 + // #define _DISABLE_SSR 1 + // #define _ADD_PRECOMPUTED_VELOCITY + // #define _WRITE_TRANSPARENT_MOTION_VECTOR 1 + // #define _DEPTHOFFSET_ON 1 + // #define _BLENDMODE_PRESERVE_SPECULAR_LIGHTING 1 + + #define SHADERPASS SHADERPASS_DEPTH_ONLY + #define RAYTRACING_SHADER_GRAPH_DEFAULT + #define SCENESELECTIONPASS + #define _PASSSCENESELECT 1 + + + #pragma shader_feature_local GLOW_ON + #pragma shader_feature_local FADE_ON + #pragma shader_feature_local OUTBASE_ON + #pragma shader_feature_local ONLYOUTLINE_ON + #pragma shader_feature_local GRADIENT_ON + #pragma shader_feature_local GRADIENT2COL_ON + #pragma shader_feature_local RADIALGRADIENT_ON + #pragma shader_feature_local COLORSWAP_ON + #pragma shader_feature_local HSV_ON + #pragma shader_feature_local CHANGECOLOR_ON + #pragma shader_feature_local CHANGECOLOR2_ON + #pragma shader_feature_local CHANGECOLOR3_ON + #pragma shader_feature_local COLORRAMP_ON + #pragma shader_feature_local GRADIENTCOLORRAMP_ON + #pragma shader_feature_local HITEFFECT_ON + #pragma shader_feature_local NEGATIVE_ON + #pragma shader_feature_local PIXELATE_ON + #pragma shader_feature_local GREYSCALE_ON + #pragma shader_feature_local POSTERIZE_ON + #pragma shader_feature_local BLUR_ON + #pragma shader_feature_local MOTIONBLUR_ON + #pragma shader_feature_local GHOST_ON + #pragma shader_feature_local ALPHAOUTLINE_ON + #pragma shader_feature_local INNEROUTLINE_ON + #pragma shader_feature_local ONLYINNEROUTLINE_ON + #pragma shader_feature_local HOLOGRAM_ON + #pragma shader_feature_local CHROMABERR_ON + #pragma shader_feature_local GLITCH_ON + #pragma shader_feature_local FLICKER_ON + #pragma shader_feature_local SHADOW_ON + #pragma shader_feature_local SHINE_ON + #pragma shader_feature_local CONTRAST_ON + #pragma shader_feature_local OVERLAY_ON + #pragma shader_feature_local OVERLAYMULT_ON + #pragma shader_feature_local DOODLE_ON + #pragma shader_feature_local WIND_ON + #pragma shader_feature_local WAVEUV_ON + #pragma shader_feature_local ROUNDWAVEUV_ON + #pragma shader_feature_local RECTSIZE_ON + #pragma shader_feature_local OFFSETUV_ON + #pragma shader_feature_local CLIPPING_ON + #pragma shader_feature_local RADIALCLIPPING_ON + #pragma shader_feature_local TEXTURESCROLL_ON + #pragma shader_feature_local ZOOMUV_ON + #pragma shader_feature_local DISTORT_ON + #pragma shader_feature_local WARP_ON + #pragma shader_feature_local TWISTUV_ON + #pragma shader_feature_local ROTATEUV_ON + #pragma shader_feature_local POLARUV_ON + #pragma shader_feature_local FISHEYE_ON + #pragma shader_feature_local PINCH_ON + #pragma shader_feature_local SHAKEUV_ON + + #pragma shader_feature_local GLOWTEX_ON + #pragma shader_feature_local OUTTEX_ON + #pragma shader_feature_local OUTDIST_ON + #pragma shader_feature_local OUTBASE8DIR_ON + #pragma shader_feature_local OUTBASEPIXELPERF_ON + #pragma shader_feature_local COLORRAMPOUTLINE_ON + #pragma shader_feature_local GREYSCALEOUTLINE_ON + #pragma shader_feature_local POSTERIZEOUTLINE_ON + #pragma shader_feature_local BLURISHD_ON + #pragma shader_feature_local MANUALWIND_ON + #pragma shader_feature_local ATLAS_ON + #pragma shader_feature_local PREMULTIPLYALPHA_ON + + #pragma shader_feature BILBOARD_ON + #pragma shader_feature BILBOARDY_ON + + #pragma shader_feature NORMALMAP_ON + + + #define _HDRP 1 +#define _USINGTEXCOORD1 1 +#define _USINGTEXCOORD2 1 + + + #pragma vertex Vert + #pragma fragment Frag + + + + + // useful conversion functions to make surface shader code just work + + #define UNITY_DECLARE_TEX2D(name) TEXTURE2D(name); SAMPLER(sampler##name); + #define UNITY_DECLARE_TEX2D_NOSAMPLER(name) TEXTURE2D(name); + #define UNITY_DECLARE_TEX2DARRAY(name) TEXTURE2D_ARRAY(name); SAMPLER(sampler##name); + #define UNITY_DECLARE_TEX2DARRAY_NOSAMPLER(tex) TEXTURE2D_ARRAY(tex); + + #define UNITY_SAMPLE_TEX2DARRAY(tex,coord) SAMPLE_TEXTURE2D_ARRAY(tex, sampler##tex, coord.xy, coord.z) + #define UNITY_SAMPLE_TEX2DARRAY_LOD(tex,coord,lod) SAMPLE_TEXTURE2D_ARRAY_LOD(tex, sampler##tex, coord.xy, coord.z, lod) + #define UNITY_SAMPLE_TEX2D(tex, coord) SAMPLE_TEXTURE2D(tex, sampler##tex, coord) + #define UNITY_SAMPLE_TEX2D_SAMPLER(tex, samp, coord) SAMPLE_TEXTURE2D(tex, sampler##samp, coord) + + #define UNITY_SAMPLE_TEX2D_LOD(tex,coord, lod) SAMPLE_TEXTURE2D_LOD(tex, sampler_##tex, coord, lod) + #define UNITY_SAMPLE_TEX2D_SAMPLER_LOD(tex,samplertex,coord, lod) SAMPLE_TEXTURE2D_LOD (tex, sampler##samplertex,coord, lod) + + #if defined(UNITY_COMPILER_HLSL) + #define UNITY_INITIALIZE_OUTPUT(type,name) name = (type)0; + #else + #define UNITY_INITIALIZE_OUTPUT(type,name) + #endif + + #define sampler2D_float sampler2D + #define sampler2D_half sampler2D + + #undef WorldNormalVector + #define WorldNormalVector(data, normal) mul(normal, data.TBNMatrix) + + #define UnityObjectToWorldNormal(normal) mul(GetObjectToWorldMatrix(), normal) + + + + +// HDRP Adapter stuff + #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Common.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/ShaderVariables.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/ShaderPass/FragInputs.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/ShaderPass/ShaderPass.cs.hlsl" + #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/TextureStack.hlsl" // Required to be include before we include properties as it define DECLARE_STACK_CB + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/ShaderGraphHeader.hlsl" // Need to be here for Gradient struct definition + + #ifdef RAYTRACING_SHADER_GRAPH_DEFAULT + #define RAYTRACING_SHADER_GRAPH_HIGH + #endif + + #ifdef RAYTRACING_SHADER_GRAPH_RAYTRACED + #define RAYTRACING_SHADER_GRAPH_LOW + #endif + // end + + + + + // If we use subsurface scattering, enable output split lighting (for forward pass) + #if defined(_MATERIAL_FEATURE_SUBSURFACE_SCATTERING) && !defined(_SURFACE_TYPE_TRANSPARENT) + #define OUTPUT_SPLIT_LIGHTING + #endif + + #define HAVE_RECURSIVE_RENDERING + + #if SHADERPASS == SHADERPASS_TRANSPARENT_DEPTH_PREPASS + #if !defined(_DISABLE_SSR_TRANSPARENT) && !defined(SHADER_UNLIT) + #define WRITE_NORMAL_BUFFER + #endif + #endif + + #ifndef DEBUG_DISPLAY + // In case of opaque we don't want to perform the alpha test, it is done in depth prepass and we use depth equal for ztest (setup from UI) + // Don't do it with debug display mode as it is possible there is no depth prepass in this case + #if !defined(_SURFACE_TYPE_TRANSPARENT) && defined(_ALPHATEST) + #if SHADERPASS == SHADERPASS_FORWARD + #define SHADERPASS_FORWARD_BYPASS_ALPHA_TEST + #elif SHADERPASS == SHADERPASS_GBUFFER + #define SHADERPASS_GBUFFER_BYPASS_ALPHA_TEST + #endif + #endif + #endif + + // Translate transparent motion vector define + #if defined(_TRANSPARENT_WRITES_MOTION_VEC) && defined(_SURFACE_TYPE_TRANSPARENT) + #define _WRITE_TRANSPARENT_MOTION_VECTOR + #endif + + + + + CBUFFER_START(UnityPerMaterial) + float _UseShadowThreshold; + float _BlendMode; + float _EnableBlendModePreserveSpecularLighting; + float _RayTracing; + float _RefractionModel; + + + half4 _Color; + half4 _MainTex_ST, _MainTex_TexelSize; + half _Alpha, _AlphaCutoffValue; + + #if ATLAS_ON + half _MinXUV, _MaxXUV, _MinYUV, _MaxYUV; + #endif + + #if GLOW_ON + half4 _GlowColor; + half _Glow, _GlowGlobal; + #endif + + #if HSV_ON + half _HsvShift, _HsvSaturation, _HsvBright; + #endif + + #if DISTORT_ON + half4 _DistortTex_ST; + half _DistortTexXSpeed, _DistortTexYSpeed, _DistortAmount; + #endif + + #if FADE_ON + half4 _FadeBurnColor, _FadeTex_ST, _FadeBurnTex_ST; + half _FadeAmount, _FadeBurnWidth, _FadeBurnTransition,_FadeBurnGlow; + #endif + + #if OUTBASE_ON + half4 _OutlineColor; + half _OutlineAlpha, _OutlineGlow, _OutlineWidth; + int _OutlinePixelWidth; + #endif + + #if OUTTEX_ON + half4 _OutlineTex_ST; + half _OutlineTexXSpeed, _OutlineTexYSpeed; + #endif + + #if OUTDIST_ON + half4 _OutlineDistortTex_ST; + half _OutlineDistortTexXSpeed, _OutlineDistortTexYSpeed, _OutlineDistortAmount; + #endif + + #if ALPHAOUTLINE_ON + half _AlphaOutlineGlow, _AlphaOutlinePower, _AlphaOutlineMinAlpha, _AlphaOutlineBlend; + half4 _AlphaOutlineColor; + #endif + + #if INNEROUTLINE_ON + half _InnerOutlineThickness, _InnerOutlineAlpha, _InnerOutlineGlow; + half4 _InnerOutlineColor; + #endif + + #if GRADIENT_ON + half _GradBlend, _GradBoostX, _GradBoostY; + half4 _GradTopRightCol, _GradTopLeftCol, _GradBotRightCol, _GradBotLeftCol; + #endif + + #if COLORSWAP_ON + half4 _ColorSwapRed, _ColorSwapGreen, _ColorSwapBlue; + half _ColorSwapRedLuminosity, _ColorSwapGreenLuminosity, _ColorSwapBlueLuminosity, _ColorSwapBlend; + #endif + + #if CHANGECOLOR_ON + half4 _ColorChangeNewCol, _ColorChangeTarget; + half _ColorChangeTolerance, _ColorChangeLuminosity; + #endif + #if CHANGECOLOR2_ON + half4 _ColorChangeNewCol2, _ColorChangeTarget2; + half _ColorChangeTolerance2; + #endif + #if CHANGECOLOR3_ON + half4 _ColorChangeNewCol3, _ColorChangeTarget3; + half _ColorChangeTolerance3; + #endif + + #if COLORRAMP_ON + half _ColorRampLuminosity, _ColorRampBlend; + #endif + + #if HITEFFECT_ON + half4 _HitEffectColor; + half _HitEffectGlow, _HitEffectBlend; + #endif + + #if NEGATIVE_ON + half _NegativeAmount; + #endif + + #if PIXELATE_ON + half _PixelateSize; + #endif + + #if GREYSCALE_ON + half _GreyscaleLuminosity, _GreyscaleBlend; + half4 _GreyscaleTintColor; + #endif + + #if POSTERIZE_ON + half _PosterizeNumColors, _PosterizeGamma; + #endif + + #if BLUR_ON + half _BlurIntensity; + #endif + + #if MOTIONBLUR_ON + half _MotionBlurAngle, _MotionBlurDist; + #endif + + #if GHOST_ON + half _GhostColorBoost, _GhostTransparency, _GhostBlend; + #endif + + #if HOLOGRAM_ON + half _HologramStripesAmount, _HologramMinAlpha, _HologramUnmodAmount, _HologramStripesSpeed, _HologramMaxAlpha, _HologramBlend; + half4 _HologramStripeColor; + #endif + + #if CHROMABERR_ON + half _ChromAberrAmount, _ChromAberrAlpha; + #endif + + #if GLITCH_ON + half _GlitchAmount, _GlitchSize; + #endif + + #if FLICKER_ON + half _FlickerFreq, _FlickerPercent, _FlickerAlpha; + #endif + + #if SHADOW_ON + half _ShadowX, _ShadowY, _ShadowAlpha; + half4 _ShadowColor; + #endif + + #if SHINE_ON + half4 _ShineColor; + half _ShineLocation, _ShineRotate, _ShineWidth, _ShineGlow; + #endif + + #if CONTRAST_ON + half _Contrast, _Brightness; + #endif + + #if OVERLAY_ON + half4 _OverlayTex_ST, _OverlayColor; + half _OverlayGlow, _OverlayBlend, _OverlayTextureScrollXSpeed, _OverlayTextureScrollYSpeed; + #endif + + #if DOODLE_ON + half _HandDrawnAmount, _HandDrawnSpeed; + #endif + + #if WIND_ON + half _GrassSpeed, _GrassWind, _GrassManualAnim, _GrassRadialBend; + #endif + + #if WAVEUV_ON + float _WaveAmount, _WaveSpeed, _WaveStrength, _WaveX, _WaveY; + #endif + + #if ROUNDWAVEUV_ON + half _RoundWaveStrength, _RoundWaveSpeed; + #endif + + #if RECTSIZE_ON + half _RectSize; + #endif + + #if OFFSETUV_ON + half _OffsetUvX, _OffsetUvY; + #endif + + #if CLIPPING_ON + half _ClipUvLeft, _ClipUvRight, _ClipUvUp, _ClipUvDown; + #endif + + #if RADIALCLIPPING_ON + half _RadialStartAngle, _RadialClip, _RadialClip2; + #endif + + #if TEXTURESCROLL_ON + half _TextureScrollXSpeed, _TextureScrollYSpeed; + #endif + + #if ZOOMUV_ON + half _ZoomUvAmount; + #endif + + #if WARP_ON + half _WarpStrength, _WarpSpeed, _WarpScale; + #endif + + #if TWISTUV_ON + half _TwistUvAmount, _TwistUvPosX, _TwistUvPosY, _TwistUvRadius; + #endif + + #if ROTATEUV_ON + half _RotateUvAmount; + #endif + + #if FISHEYE_ON + half _FishEyeUvAmount; + #endif + + #if PINCH_ON + half _PinchUvAmount; + #endif + + #if SHAKEUV_ON + half _ShakeUvSpeed, _ShakeUvX, _ShakeUvY; + #endif + + #if NORMALMAP_ON + half _NormalStrength; + #endif + + float _RandomSeed; + + + + + CBUFFER_END + + + + // -- Property used by ScenePickingPass + #ifdef SCENEPICKINGPASS + float4 _SelectionID; + #endif + + // -- Properties used by SceneSelectionPass + #ifdef SCENESELECTIONPASS + int _ObjectId; + int _PassValue; + #endif + + + // data across stages, stripped like the above. + struct VertexToPixel + { + float4 pos : SV_POSITION; + float3 worldPos : TEXCOORD0; + float3 worldNormal : TEXCOORD1; + float4 worldTangent : TEXCOORD2; + float4 texcoord0 : TEXCOORD3; + float4 texcoord1 : TEXCOORD4; + float4 texcoord2 : TEXCOORD5; + // #if %TEXCOORD3REQUIREKEY% + float4 texcoord3 : TEXCOORD6; + // #endif + + // #if %SCREENPOSREQUIREKEY% + // float4 screenPos : TEXCOORD7; + // #endif + + // #if %VERTEXCOLORREQUIREKEY% + float4 vertexColor : COLOR; + // #endif + + // #if %EXTRAV2F0REQUIREKEY% + // float4 extraV2F0 : TEXCOORD8; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // float4 extraV2F1 : TEXCOORD9; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // float4 extraV2F2 : TEXCOORD10; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // float4 extraV2F3 : TEXCOORD11; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // float4 extraV2F4 : TEXCOORD12; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // float4 extraV2F5 : TEXCOORD13; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // float4 extraV2F6 : TEXCOORD14; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // float4 extraV2F7 : TEXCOORD15; + // #endif + + #if UNITY_ANY_INSTANCING_ENABLED + UNITY_VERTEX_INPUT_INSTANCE_ID + #endif // UNITY_ANY_INSTANCING_ENABLED + + #if _HDRP && (_PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR))) + float4 previousPositionCS : TEXCOORD16; // Contain previous transform position (in case of skinning for example) + float4 motionVectorCS : TEXCOORD17; + #endif + + UNITY_VERTEX_OUTPUT_STEREO + }; + + + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Debug/DebugDisplay.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/Material.hlsl" + #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/NormalSurfaceGradient.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/Lit/Lit.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/BuiltinUtilities.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/MaterialUtilities.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/Decal/DecalUtilities.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/Lit/LitDecalData.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/ShaderGraphFunctions.hlsl" + + + + + // data describing the user output of a pixel + struct Surface + { + half3 Albedo; + half Height; + half3 Normal; + half Smoothness; + half3 Emission; + half Metallic; + half3 Specular; + half Occlusion; + half SpecularPower; // for simple lighting + half Alpha; + float outputDepth; // if written, SV_Depth semantic is used. ShaderData.clipPos.z is unused value + // HDRP Only + half SpecularOcclusion; + half SubsurfaceMask; + half Thickness; + half CoatMask; + half CoatSmoothness; + half Anisotropy; + half IridescenceMask; + half IridescenceThickness; + int DiffusionProfileHash; + float SpecularAAThreshold; + float SpecularAAScreenSpaceVariance; + // requires _OVERRIDE_BAKEDGI to be defined, but is mapped in all pipelines + float3 DiffuseGI; + float3 BackDiffuseGI; + float3 SpecularGI; + float ior; + float3 transmittanceColor; + float atDistance; + float transmittanceMask; + // requires _OVERRIDE_SHADOWMASK to be defines + float4 ShadowMask; + + // for decals + float NormalAlpha; + float MAOSAlpha; + + + }; + + // Data the user declares in blackboard blocks + struct Blackboard + { + + float blackboardDummyData; + }; + + // data the user might need, this will grow to be big. But easy to strip + struct ShaderData + { + float4 clipPos; // SV_POSITION + float3 localSpacePosition; + float3 localSpaceNormal; + float3 localSpaceTangent; + + float3 worldSpacePosition; + float3 worldSpaceNormal; + float3 worldSpaceTangent; + float tangentSign; + + float3 worldSpaceViewDir; + float3 tangentSpaceViewDir; + + float4 texcoord0; + float4 texcoord1; + float4 texcoord2; + float4 texcoord3; + + float2 screenUV; + float4 screenPos; + + float4 vertexColor; + bool isFrontFace; + + float4 extraV2F0; + float4 extraV2F1; + float4 extraV2F2; + float4 extraV2F3; + float4 extraV2F4; + float4 extraV2F5; + float4 extraV2F6; + float4 extraV2F7; + + float3x3 TBNMatrix; + Blackboard blackboard; + }; + + struct VertexData + { + #if SHADER_TARGET > 30 + // uint vertexID : SV_VertexID; + #endif + float4 vertex : POSITION; + float3 normal : NORMAL; + float4 tangent : TANGENT; + float4 texcoord0 : TEXCOORD0; + + // optimize out mesh coords when not in use by user or lighting system + #if _URP && (_USINGTEXCOORD1 || _PASSMETA || _PASSFORWARD || _PASSGBUFFER) + float4 texcoord1 : TEXCOORD1; + #endif + + #if _URP && (_USINGTEXCOORD2 || _PASSMETA || ((_PASSFORWARD || _PASSGBUFFER) && defined(DYNAMICLIGHTMAP_ON))) + float4 texcoord2 : TEXCOORD2; + #endif + + #if _STANDARD && (_USINGTEXCOORD1 || (_PASSMETA || ((_PASSFORWARD || _PASSGBUFFER || _PASSFORWARDADD) && LIGHTMAP_ON))) + float4 texcoord1 : TEXCOORD1; + #endif + #if _STANDARD && (_USINGTEXCOORD2 || (_PASSMETA || ((_PASSFORWARD || _PASSGBUFFER) && DYNAMICLIGHTMAP_ON))) + float4 texcoord2 : TEXCOORD2; + #endif + + + #if _HDRP + float4 texcoord1 : TEXCOORD1; + float4 texcoord2 : TEXCOORD2; + #endif + + // #if %TEXCOORD3REQUIREKEY% + float4 texcoord3 : TEXCOORD3; + // #endif + + // #if %VERTEXCOLORREQUIREKEY% + float4 vertexColor : COLOR; + // #endif + + #if _PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR)) + float3 previousPositionOS : TEXCOORD4; // Contain previous transform position (in case of skinning for example) + #if defined (_ADD_PRECOMPUTED_VELOCITY) + float3 precomputedVelocity : TEXCOORD5; // Add Precomputed Velocity (Alembic computes velocities on runtime side). + #endif + #endif + + UNITY_VERTEX_INPUT_INSTANCE_ID + }; + + struct TessVertex + { + float4 vertex : INTERNALTESSPOS; + float3 normal : NORMAL; + float4 tangent : TANGENT; + float4 texcoord0 : TEXCOORD0; + float4 texcoord1 : TEXCOORD1; + float4 texcoord2 : TEXCOORD2; + + // #if %TEXCOORD3REQUIREKEY% + float4 texcoord3 : TEXCOORD3; + // #endif + + // #if %VERTEXCOLORREQUIREKEY% + float4 vertexColor : COLOR; + // #endif + + // #if %EXTRAV2F0REQUIREKEY% + // float4 extraV2F0 : TEXCOORD5; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // float4 extraV2F1 : TEXCOORD6; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // float4 extraV2F2 : TEXCOORD7; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // float4 extraV2F3 : TEXCOORD8; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // float4 extraV2F4 : TEXCOORD9; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // float4 extraV2F5 : TEXCOORD10; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // float4 extraV2F6 : TEXCOORD11; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // float4 extraV2F7 : TEXCOORD12; + // #endif + + #if _PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR)) + float3 previousPositionOS : TEXCOORD13; // Contain previous transform position (in case of skinning for example) + #if defined (_ADD_PRECOMPUTED_VELOCITY) + float3 precomputedVelocity : TEXCOORD14; + #endif + #endif + + UNITY_VERTEX_INPUT_INSTANCE_ID + UNITY_VERTEX_OUTPUT_STEREO + }; + + struct ExtraV2F + { + float4 extraV2F0; + float4 extraV2F1; + float4 extraV2F2; + float4 extraV2F3; + float4 extraV2F4; + float4 extraV2F5; + float4 extraV2F6; + float4 extraV2F7; + Blackboard blackboard; + float4 time; + }; + + + float3 WorldToTangentSpace(ShaderData d, float3 normal) + { + return mul(d.TBNMatrix, normal); + } + + float3 TangentToWorldSpace(ShaderData d, float3 normal) + { + return mul(normal, d.TBNMatrix); + } + + // in this case, make standard more like SRPs, because we can't fix + // unity_WorldToObject in HDRP, since it already does macro-fu there + + #if _STANDARD + float3 TransformWorldToObject(float3 p) { return mul(unity_WorldToObject, float4(p, 1)); }; + float3 TransformObjectToWorld(float3 p) { return mul(unity_ObjectToWorld, float4(p, 1)); }; + float4 TransformWorldToObject(float4 p) { return mul(unity_WorldToObject, p); }; + float4 TransformObjectToWorld(float4 p) { return mul(unity_ObjectToWorld, p); }; + float4x4 GetWorldToObjectMatrix() { return unity_WorldToObject; } + float4x4 GetObjectToWorldMatrix() { return unity_ObjectToWorld; } + #if (defined(SHADER_API_D3D11) || defined(SHADER_API_XBOXONE) || defined(UNITY_COMPILER_HLSLCC) || defined(SHADER_API_PSSL) || (SHADER_TARGET_SURFACE_ANALYSIS && !SHADER_TARGET_SURFACE_ANALYSIS_MOJOSHADER)) + #define UNITY_SAMPLE_TEX2D_LOD(tex,coord, lod) tex.SampleLevel (sampler##tex,coord, lod) + #define UNITY_SAMPLE_TEX2D_SAMPLER_LOD(tex,samplertex,coord, lod) tex.SampleLevel (sampler##samplertex,coord, lod) + #else + #define UNITY_SAMPLE_TEX2D_LOD(tex,coord,lod) tex2D (tex,coord,0,lod) + #define UNITY_SAMPLE_TEX2D_SAMPLER_LOD(tex,samplertex,coord,lod) tex2D (tex,coord,0,lod) + #endif + + #undef GetWorldToObjectMatrix() + + #define GetWorldToObjectMatrix() unity_WorldToObject + + + #endif + + float3 GetCameraWorldPosition() + { + #if _HDRP + return GetCameraRelativePositionWS(_WorldSpaceCameraPos); + #else + return _WorldSpaceCameraPos; + #endif + } + + #if _GRABPASSUSED + #if _STANDARD + TEXTURE2D(%GRABTEXTURE%); + SAMPLER(sampler_%GRABTEXTURE%); + #endif + + half3 GetSceneColor(float2 uv) + { + #if _STANDARD + return SAMPLE_TEXTURE2D(%GRABTEXTURE%, sampler_%GRABTEXTURE%, uv).rgb; + #else + return SHADERGRAPH_SAMPLE_SCENE_COLOR(uv); + #endif + } + #endif + + + + #if _STANDARD + UNITY_DECLARE_DEPTH_TEXTURE(_CameraDepthTexture); + float GetSceneDepth(float2 uv) { return SAMPLE_DEPTH_TEXTURE(_CameraDepthTexture, uv); } + float GetLinear01Depth(float2 uv) { return Linear01Depth(GetSceneDepth(uv)); } + float GetLinearEyeDepth(float2 uv) { return LinearEyeDepth(GetSceneDepth(uv)); } + #else + float GetSceneDepth(float2 uv) { return SHADERGRAPH_SAMPLE_SCENE_DEPTH(uv); } + float GetLinear01Depth(float2 uv) { return Linear01Depth(GetSceneDepth(uv), _ZBufferParams); } + float GetLinearEyeDepth(float2 uv) { return LinearEyeDepth(GetSceneDepth(uv), _ZBufferParams); } + #endif + + float3 GetWorldPositionFromDepthBuffer(float2 uv, float3 worldSpaceViewDir) + { + float eye = GetLinearEyeDepth(uv); + float3 camView = mul((float3x3)GetObjectToWorldMatrix(), transpose(mul(GetWorldToObjectMatrix(), UNITY_MATRIX_I_V)) [2].xyz); + + float dt = dot(worldSpaceViewDir, camView); + float3 div = worldSpaceViewDir/dt; + float3 wpos = (eye * div) + GetCameraWorldPosition(); + return wpos; + } + + #if _HDRP + float3 ObjectToWorldSpacePosition(float3 pos) + { + return GetAbsolutePositionWS(TransformObjectToWorld(pos)); + } + #else + float3 ObjectToWorldSpacePosition(float3 pos) + { + return TransformObjectToWorld(pos); + } + #endif + + #if _STANDARD + UNITY_DECLARE_SCREENSPACE_TEXTURE(_CameraDepthNormalsTexture); + float3 GetSceneNormal(float2 uv, float3 worldSpaceViewDir) + { + float4 depthNorms = UNITY_SAMPLE_SCREENSPACE_TEXTURE(_CameraDepthNormalsTexture, uv); + float3 norms = DecodeViewNormalStereo(depthNorms); + norms = mul((float3x3)GetWorldToViewMatrix(), norms) * 0.5 + 0.5; + return norms; + } + #elif _HDRP && !_DECALSHADER + + float3 GetSceneNormal(float2 uv, float3 worldSpaceViewDir) + { + NormalData nd; + DecodeFromNormalBuffer(_ScreenSize.xy * uv, nd); + return nd.normalWS; + } + #elif _URP + #if (SHADER_LIBRARY_VERSION_MAJOR >= 10) + #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/DeclareNormalsTexture.hlsl" + #endif + + float3 GetSceneNormal(float2 uv, float3 worldSpaceViewDir) + { + #if (SHADER_LIBRARY_VERSION_MAJOR >= 10) + return SampleSceneNormals(uv); + #else + float3 wpos = GetWorldPositionFromDepthBuffer(uv, worldSpaceViewDir); + return normalize(-cross(ddx(wpos), ddy(wpos))) * 0.5 + 0.5; + #endif + + } + #endif + + #if _HDRP + + half3 UnpackNormalmapRGorAG(half4 packednormal) + { + // This do the trick + packednormal.x *= packednormal.w; + + half3 normal; + normal.xy = packednormal.xy * 2 - 1; + normal.z = sqrt(1 - saturate(dot(normal.xy, normal.xy))); + return normal; + } + half3 UnpackNormal(half4 packednormal) + { + #if defined(UNITY_NO_DXT5nm) + return packednormal.xyz * 2 - 1; + #else + return UnpackNormalmapRGorAG(packednormal); + #endif + } + #endif + #if _HDRP || _URP + + half3 UnpackScaleNormal(half4 packednormal, half scale) + { + #ifndef UNITY_NO_DXT5nm + // Unpack normal as DXT5nm (1, y, 1, x) or BC5 (x, y, 0, 1) + // Note neutral texture like "bump" is (0, 0, 1, 1) to work with both plain RGB normal and DXT5nm/BC5 + packednormal.x *= packednormal.w; + #endif + half3 normal; + normal.xy = (packednormal.xy * 2 - 1) * scale; + normal.z = sqrt(1 - saturate(dot(normal.xy, normal.xy))); + return normal; + } + + #endif + + + void GetSun(out float3 lightDir, out float3 color) + { + lightDir = float3(0.5, 0.5, 0); + color = 1; + #if _HDRP + if (_DirectionalLightCount > 0) + { + DirectionalLightData light = _DirectionalLightDatas[0]; + lightDir = -light.forward.xyz; + color = light.color; + } + #elif _STANDARD + lightDir = normalize(_WorldSpaceLightPos0.xyz); + color = _LightColor0.rgb; + #elif _URP + Light light = GetMainLight(); + lightDir = light.direction; + color = light.color; + #endif + } + + + + + + + + + + TEXTURE2D(_MainTex); + SAMPLER(sampler_MainTex); + + #if GLOW_ON + TEXTURE2D(_GlowTex); + SAMPLER(sampler_GlowTex); + #endif + + #if FADE_ON + TEXTURE2D(_FadeTex); + SAMPLER(sampler_FadeTex); + + TEXTURE2D(_FadeBurnTex); + SAMPLER(sampler_FadeBurnTex); + #endif + + #if DISTORT_ON + TEXTURE2D(_DistortTex); + SAMPLER(sampler_DistortTex); + #endif + + #if OUTTEX_ON + TEXTURE2D(_OutlineTex); + SAMPLER(sampler_OutlineTex); + #endif + + #if OUTDIST_ON + TEXTURE2D(_OutlineDistortTex); + SAMPLER(sampler_OutlineDistortTex); + #endif + + #if COLORSWAP_ON + TEXTURE2D(_ColorSwapTex); + SAMPLER(sampler_ColorSwapTex); + #endif + + #if COLORRAMP_ON + TEXTURE2D(_ColorRampTex); + TEXTURE2D(_ColorRampTexGradient); + SAMPLER(sampler_ColorRampTex); + SAMPLER(sampler_ColorRampTexGradient); + #endif + + #if SHINE_ON + TEXTURE2D(_ShineMask); + SAMPLER(sampler_ShineMask); + #endif + + #if OVERLAY_ON + TEXTURE2D(_OverlayTex); + SAMPLER(sampler_OverlayTex); + #endif + + #if NORMALMAP_ON + TEXTURE2D(_NormalMap); + SAMPLER(sampler_NormalMap); + #endif + + + half3 GetPixel(in int offsetX, in int offsetY, in half2 uv, in Texture2D _tex, in SamplerState _sampler) + { + half2 _uv = uv + half2(offsetX * _MainTex_TexelSize.x, offsetY * _MainTex_TexelSize.y); + half4 col = SAMPLE_TEXTURE2D(_tex, _sampler, _uv); + return col.rgb; + } + + + //BLURS------------------------------------------------------------------------- + half4 Blur(half2 uv, Texture2D source, SamplerState sampler_source, half Intensity) + { + const half2 texelSize = 1.0 / _ScreenParams.xy; + const half4 color = SAMPLE_TEXTURE2D(source, sampler_source, uv); + const half2 offset = Intensity * texelSize; + + half4 accumulatedColor = color; + half accumulatedWeight = 1.0; + for (int x = -1; x <= 1; x++) + { + for (int y = -1; y <= 1; y++) + { + const half2 sampleUV = uv + half2(x, y) * offset; + const half4 sampleColor = SAMPLE_TEXTURE2D(source, sampler_source, sampleUV); + + accumulatedColor += sampleColor; + accumulatedWeight += 1.0; + } + } + + half4 blurredColor = accumulatedColor / accumulatedWeight; + return blurredColor; + } + + half BlurHD_G(half bhqp, half x) + { + return exp(-(x * x) / (2.0 * bhqp * bhqp)); + } + half4 BlurHD(half2 uv, Texture2D source, SamplerState sampler_source, half BlurAmount, half xScale, half yScale) + { + int iterations = 16; + int halfIterations = iterations / 2; + half sigmaX = 0.1 + BlurAmount * 0.5; + half sigmaY = sigmaX; + half total = 0.0; + half4 ret = half4(0, 0, 0, 0); + for (int iy = 0; iy < iterations; ++iy) + { + half fy = BlurHD_G(sigmaY, half(iy) -half(halfIterations)); + half offsetY = half(iy - halfIterations) * 0.00390625 * xScale; + for (int ix = 0; ix < iterations; ++ix) + { + half fx = BlurHD_G(sigmaX, half(ix) - half(halfIterations)); + half offsetX = half(ix - halfIterations) * 0.00390625 * yScale; + total += fx * fy; + ret += SAMPLE_TEXTURE2D(source, sampler_source, uv + half2(offsetX, offsetY)) * fx * fy; + } + } + return ret / total; + } + //----------------------------------------------------------------------- + + + //------------------------------------------- + half RemapFloat(half inValue, half inMin, half inMax, half outMin, half outMax){ + return outMin + (inValue - inMin) * (outMax - outMin) / (inMax - inMin); + } + //------------------------------------------- + + //----------------------------------------------------------------------- + half rand(half2 seed, half offset) { + return (frac(sin(dot(seed, half2(12.9898, 78.233))) * 43758.5453) + offset) % 1.0; + } + + half rand2(half2 seed, half offset) { + return (frac(sin(dot(seed * floor(50 + (_Time.x % 1.0) * 12.), half2(127.1, 311.7))) * 43758.5453123) + offset) % 1.0; + } + + half rand2CustomTime(half2 seed, half offset, half customTime) { + return (frac(sin(dot(seed * floor(50 + (customTime % 1.0) * 12.), half2(127.1, 311.7))) * 43758.5453123) + offset) % 1.0; + } + //----------------------------------------------------------------------- + + + void Ext_ModifyVertex0 (inout VertexData v, inout ExtraV2F d) + { + //BILBOARD_ON + #if BILBOARD_ON + half3 camRight = mul((half3x3)unity_CameraToWorld, half3(1,0,0)); + half3 camUp = half3(0,1,0); + #if BILBOARDY_ON + camUp = mul((half3x3)unity_CameraToWorld, half3(0,1,0)); + #endif + half3 localPos = v.vertex.x * camRight + v.vertex.y * camUp; + v.vertex = half4(localPos, 1); + #endif + //----------------------------------------------------------- + + v.texcoord0.xy = TRANSFORM_TEX(v.texcoord0.xy, _MainTex); + half2 center = half2(0.5, 0.5); + #if ATLAS_ON + center = half2((_MaxXUV + _MinXUV) / 2.0, (_MaxYUV + _MinYUV) / 2.0); + #endif + + //POLARUV_ON + #if POLARUV_ON + v.texcoord0.xy = v.texcoord0.xy - center; + #endif + + //---------------------------------------- + + //ROTATEUV_ON + #if ROTATEUV_ON + half2 uvC = v.texcoord0.xy; + half cosAngle = cos(_RotateUvAmount); + half sinAngle = sin(_RotateUvAmount); + half2x2 rot = half2x2(cosAngle, -sinAngle, sinAngle, cosAngle); + uvC -= center; + v.texcoord0.xy = mul(rot, uvC); + v.texcoord0.xy += center; + #endif + //-------------------- + + #if RECTSIZE_ON + v.vertex.xyz += (v.vertex.xyz * (_RectSize - 1.0)); + #endif + + #if OUTTEX_ON + v.texcoord1.xy = TRANSFORM_TEX(v.texcoord0.xy, _OutlineTex); + #endif + + #if OUTDIST_ON + v.texcoord2.xy = TRANSFORM_TEX(v.texcoord0.xy, _OutlineDistortTex); + #endif + + #if DISTORT_ON + v.texcoord3.xy = TRANSFORM_TEX(v.texcoord0.xy, _DistortTex); + #endif + } + + void Ext_SurfaceFunction0 (inout Surface o, ShaderData d) + { + half randomSeed = _RandomSeed; + + float2 uvRect = d.texcoord0; + half2 center = half2(0.5, 0.5); + #if ATLAS_ON + center = half2((_MaxXUV + _MinXUV) / 2.0, (_MaxYUV + _MinYUV) / 2.0); + uvRect = half2((d.texcoord0.x - _MinXUV) / (_MaxXUV - _MinXUV), (d.texcoord0.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half2 centerTiled = half2(center.x * _MainTex_ST.x, center.y * _MainTex_ST.y); + + //CLIPPING_ON + #if CLIPPING_ON + half2 tiledUv = half2(d.texcoord0.x / _MainTex_ST.x, d.texcoord0.y / _MainTex_ST.y); + #if ATLAS_ON + tiledUv = half2((tiledUv.x - _MinXUV) / (_MaxXUV - _MinXUV), (tiledUv.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + clip((1 - _ClipUvUp) - tiledUv.y); + clip(tiledUv.y - _ClipUvDown); + clip((1 - _ClipUvRight) - tiledUv.x); + clip(tiledUv.x - _ClipUvLeft); + #endif + //---------------------------------- + + //RADIALCLIPPING_ON + #if RADIALCLIPPING_ON + half2 tiledUv2 = half2(d.texcoord0.x / _MainTex_ST.x, d.texcoord0.y / _MainTex_ST.y); + #if ATLAS_ON + tiledUv2 = half2((tiledUv2.x - _MinXUV) / (_MaxXUV - _MinXUV), (tiledUv2.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half startAngle = _RadialStartAngle - _RadialClip; + half endAngle = _RadialStartAngle + _RadialClip2; + half offset0 = clamp(0, 360, startAngle + 360); + half offset360 = clamp(0, 360, endAngle - 360); + half2 atan2Coord = half2(lerp(-1, 1, tiledUv2.x), lerp(-1, 1, tiledUv2.y)); + half atanAngle = atan2(atan2Coord.y, atan2Coord.x) * 57.3; // angle in degrees + if(atanAngle < 0) atanAngle = 360 + atanAngle; + if(atanAngle >= startAngle && atanAngle <= endAngle) discard; + if(atanAngle <= offset360) discard; + if(atanAngle >= offset0) discard; + #endif + + //----------------------------- + + //TEXTURESCROLL_ON && ATLAS_ON + #if TEXTURESCROLL_ON && ATLAS_ON + d.texcoord0.xy = half2(_MinXUV + ((_MaxXUV - _MinXUV) * (abs(((_Time.y + randomSeed) * _TextureScrollXSpeed) + uvRect.x) % 1)), + _MinYUV + ((_MaxYUV - _MinYUV) * (abs(((_Time.y + randomSeed) * _TextureScrollYSpeed) + uvRect.y) % 1))); + #endif + //---------------------------- + + //OFFSETUV_ON + #if OFFSETUV_ON + #if ATLAS_ON + d.texcoord0.xy = half2(_MinXUV + ((_MaxXUV - _MinXUV) * (abs((_OffsetUvX + uvRect.x) % 1))), + _MinYUV + ((_MaxYUV - _MinYUV) * (abs(_OffsetUvY + uvRect.y) % 1))); + #else + d.texcoord0.xy += half2(_OffsetUvX, _OffsetUvY); + #endif + #endif + + //---------------------- + + //POLARUV_ON + #if POLARUV_ON + d.texcoord0.xy = half2(atan2(d.texcoord0.y, d.texcoord0.x) / (2.0f * 3.141592653589f), length(d.texcoord0.xy)); + d.texcoord0.xy *= _MainTex_ST.xy; + #endif + + //-------------------------------------- + + //TWISTUV_ON + #if TWISTUV_ON + #if ATLAS_ON + _TwistUvPosX = ((_MaxXUV - _MinXUV) * _TwistUvPosX) + _MinXUV; + _TwistUvPosY = ((_MaxYUV - _MinYUV) * _TwistUvPosY) + _MinYUV; + #endif + half2 tempUv = d.texcoord0.xy - half2(_TwistUvPosX * _MainTex_ST.x, _TwistUvPosY * _MainTex_ST.y); + _TwistUvRadius *= (_MainTex_ST.x + _MainTex_ST.y) / 2; + half percent = (_TwistUvRadius - length(tempUv)) / _TwistUvRadius; + half theta = percent * percent * (2.0 * sin(_TwistUvAmount)) * 8.0; + half s = sin(theta); + half c = cos(theta); + half beta = max(sign(_TwistUvRadius - length(tempUv)), 0.0); + tempUv = half2(dot(tempUv, half2(c, -s)), dot(tempUv, half2(s, c))) * beta + tempUv * (1 - beta); + tempUv += half2(_TwistUvPosX * _MainTex_ST.x, _TwistUvPosY * _MainTex_ST.y); + d.texcoord0.xy = tempUv; + #endif + + //-------------------------------------------- + + //FISHEYE_ON + #if FISHEYE_ON + half bind = length(centerTiled); + half2 dF = d.texcoord0.xy - centerTiled; + half dFlen = length(dF); + half fishInt = (3.14159265359 / bind) * (_FishEyeUvAmount + 0.001); + d.texcoord0.xy = centerTiled + (dF / (max(0.0001, dFlen))) * tan(dFlen * fishInt) * bind / tan(bind * fishInt); + #endif + //--------------------------------------------- + + //PINCH_ON + #if PINCH_ON + half2 dP = d.texcoord0.xy - centerTiled; + half pinchInt = (3.141592 / length(centerTiled)) * (-_PinchUvAmount + 0.001); + d.texcoord0.xy = centerTiled + normalize(dP) * atan(length(dP) * -pinchInt * 10.0) * 0.5 / atan(-pinchInt * 5); + #endif + + //--------------------------------------------- + + //ZOOMUV_ON + #if ZOOMUV_ON + d.texcoord0.xy -= centerTiled; + d.texcoord0.xy = d.texcoord0.xy * _ZoomUvAmount; + d.texcoord0.xy += centerTiled; + #endif + + //----------------------------------------------- + + //DOODLE_ON + #if DOODLE_ON + half2 uvCopy = uvRect; + _HandDrawnSpeed = (floor((_Time.x + randomSeed) * 20 * _HandDrawnSpeed) / _HandDrawnSpeed) * _HandDrawnSpeed; + uvCopy.x = sin((uvCopy.x * _HandDrawnAmount + _HandDrawnSpeed) * 4); + uvCopy.y = cos((uvCopy.y * _HandDrawnAmount + _HandDrawnSpeed) * 4); + d.texcoord0.xy = lerp(d.texcoord0.xy, d.texcoord0.xy + uvCopy, 0.0005 * _HandDrawnAmount); + #endif + + //-------------------------- + + //SHAKEUV_ON + #if SHAKEUV_ON + half xShake = sin((_Time.x + randomSeed) * _ShakeUvSpeed * 50) * _ShakeUvX; + half yShake = cos((_Time.x + randomSeed) * _ShakeUvSpeed * 50) * _ShakeUvY; + d.texcoord0.xy += half2(xShake * 0.012, yShake * 0.01); + #endif + + //------------------------------------------- + + //RECTSIZE_ON + #if RECTSIZE_ON + d.texcoord0.xy = d.texcoord0.xy * (_RectSize).xx + (((-_RectSize * 0.5) + 0.5)).xx; + #endif + + //------------------------------------------- + + //DISTORT_ON + #if DISTORT_ON + #if ATLAS_ON + d.texcoord3.x = d.texcoord3.x * (1 / (_MaxXUV - _MinXUV)); + d.texcoord3.y = d.texcoord3.y * (1 / (_MaxYUV - _MinYUV)); + #endif + + d.texcoord3.x += ((_Time.x + _RandomSeed) * _DistortTexXSpeed) % 1; + d.texcoord3.y += ((_Time.x + _RandomSeed) * _DistortTexYSpeed) % 1; + half distortAmnt = (SAMPLE_TEXTURE2D(_DistortTex, sampler_DistortTex, d.texcoord3.xy).r - 0.5) * 0.2 * _DistortAmount; + d.texcoord0.x += distortAmnt; + d.texcoord0.y += distortAmnt; + #endif + //------------------------------------------------------- + + //WARP_ON + #if WARP_ON + half2 warpUv = half2(d.texcoord0.x / _MainTex_ST.x, d.texcoord0.y / _MainTex_ST.y); + #if ATLAS_ON + warpUv = half2((warpUv.x - _MinXUV) / (_MaxXUV - _MinXUV), (warpUv.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + const float tau = 6.283185307179586; + float xWarp = (_Time.y + randomSeed) * _WarpSpeed + warpUv.x * tau / _WarpScale; + float yWarp = (_Time.y + randomSeed) * _WarpSpeed + warpUv.y * tau / _WarpScale; + float2 warp = float2(sin(xWarp), sin(yWarp)) * _WarpStrength; + d.texcoord0.xy += warp; + #endif + + //------------------------------------------------------- + + //WAVEUV_ON + #if WAVEUV_ON + float2 uvWave = half2(_WaveX * _MainTex_ST.x, _WaveY * _MainTex_ST.y) - d.texcoord0.xy; + uvWave %= 1; + #if ATLAS_ON + uvWave = half2(_WaveX, _WaveY) - uvRect; + #endif + uvWave.x *= _ScreenParams.x / _ScreenParams.y; + float waveTime = _Time.y + randomSeed; + float angWave = (sqrt(dot(uvWave, uvWave)) * _WaveAmount) - ((waveTime * _WaveSpeed)); + d.texcoord0.xy = d.texcoord0.xy + uvWave * sin(angWave) * (_WaveStrength / 1000.0); + #endif + //---------------------------------------------------- + + //ROUNDWAVEUV_ON + #if ROUNDWAVEUV_ON + half xWave = ((0.5 * _MainTex_ST.x) - uvRect.x); + half yWave = ((0.5 * _MainTex_ST.y) - uvRect.y) * (_MainTex_TexelSize.w / _MainTex_TexelSize.z); + half ripple = -sqrt(xWave*xWave + yWave* yWave); + d.texcoord0.xy += (sin((ripple + (_Time.y + randomSeed) * (_RoundWaveSpeed/10.0)) / 0.015) * (_RoundWaveStrength/10.0)) % 1; + #endif + //---------------------------------------------------- + + + //WIND_ON + #if WIND_ON + half windOffset = sin((_Time.x + randomSeed) * _GrassSpeed * 10); + half2 windCenter = half2(0.5, 0.1); + #if ATLAS_ON + windCenter.x = ((_MaxXUV - _MinXUV) * windCenter.x) + _MinXUV; + windCenter.y = ((_MaxYUV - _MinYUV) * windCenter.y) + _MinYUV; + #endif + #if !MANUALWIND_ON + d.texcoord0.x = fmod(abs(lerp(d.texcoord0.x, d.texcoord0.x + (_GrassWind * 0.01 * windOffset), uvRect.y)), 1); + #else + d.texcoord0.x = fmod(abs(lerp(d.texcoord0.x, d.texcoord0.x + (_GrassWind * 0.01 * _GrassManualAnim), uvRect.y)), 1); + windOffset = _GrassManualAnim; + #endif + half2 delta = d.texcoord0.xy - windCenter; + half delta2 = dot(delta.xy, delta.xy); + half2 delta_offset = delta2 * windOffset; + d.texcoord0.xy = d.texcoord0.xy + half2(delta.y, -delta.x) * delta_offset * _GrassRadialBend; + #endif + + //-------------------------------------------------------- + + //TEXTURESCROLL_ON && !ATLAS_ON + #if TEXTURESCROLL_ON && !ATLAS_ON + d.texcoord0.x += ((_Time.y + randomSeed) * _TextureScrollXSpeed) % 1; + d.texcoord0.y += ((_Time.y + randomSeed) * _TextureScrollYSpeed) % 1; + #endif + //------------------------------ + + //PIXELATE_ON + #if PIXELATE_ON + half aspectRatio = _MainTex_TexelSize.x / _MainTex_TexelSize.y; + half2 pixelSize = float2(_PixelateSize, _PixelateSize * aspectRatio); + d.texcoord0.xy = floor(d.texcoord0.xy * pixelSize) / pixelSize; + #endif + //-------------- + + half4 col = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy); + half originalAlpha = col.a; + col *= d.vertexColor; + + //NORMAL MAP + #if NORMALMAP_ON + half4 normalSample = SAMPLE_TEXTURE2D(_NormalMap, sampler_NormalMap, d.texcoord0.xy); + half3 normalTS = UnpackNormal(normalSample); + normalTS.xy *= _NormalStrength; + o.Normal = normalTS; + #endif + + + //GLITCH_ON + #if GLITCH_ON + half2 uvGlitch = uvRect; + uvGlitch.y -= 0.5; + half lineNoise = pow(rand2(floor(uvGlitch * half2(24., 19.) * _GlitchSize) * 4.0, randomSeed), 3.0) * _GlitchAmount + * pow(rand2(floor(uvGlitch * half2(38., 14.) * _GlitchSize) * 4.0, randomSeed), 3.0); + col = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(lineNoise * 0.02 * rand2(half2(2.0, 1), randomSeed), 0)) * d.vertexColor; + #endif + //-------------------------------------- + + //CHROMABERR_ON + #if CHROMABERR_ON + half4 r = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(_ChromAberrAmount/10, 0)) * d.vertexColor; + half4 b = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(-_ChromAberrAmount/10, 0)) * d.vertexColor; + col = half4(r.r * r.a, col.g, b.b * b.a, max(max(r.a, b.a) * _ChromAberrAlpha, col.a)); + #endif + + //-------------------------------- + + //BLUR_ON + #if BLUR_ON + #if ATLAS_ON + #if !BLURISHD_ON + col = BlurHD(d.texcoord0.xy, _MainTex, sampler_MainTex, _BlurIntensity, (_MaxXUV - _MinXUV), (_MaxYUV - _MinYUV)) * d.vertexColor; + #else + col = Blur(d.texcoord0.xy, _MainTex, sampler_MainTex, _BlurIntensity * (_MaxXUV - _MinXUV)) * d.vertexColor; + #endif + #else + #if !BLURISHD_ON + col = BlurHD(d.texcoord0.xy, _MainTex, sampler_MainTex, _BlurIntensity, 1, 1) * d.vertexColor; + #else + col = Blur(d.texcoord0.xy, _MainTex, sampler_MainTex, _BlurIntensity) * d.vertexColor; + #endif + #endif + #endif + + //-------------------- + + //MOTIONBLUR_ON + #if MOTIONBLUR_ON + _MotionBlurAngle = _MotionBlurAngle * 3.1415926; + #define rot(n) mul(n, half2x2(cos(_MotionBlurAngle), -sin(_MotionBlurAngle), sin(_MotionBlurAngle), cos(_MotionBlurAngle))) + _MotionBlurDist = _MotionBlurDist * 0.005; + #if ATLAS_ON + _MotionBlurDist *= (_MaxXUV - _MinXUV); + #endif + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(-_MotionBlurDist, -_MotionBlurDist))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(-_MotionBlurDist * 2, -_MotionBlurDist * 2))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(-_MotionBlurDist * 3, -_MotionBlurDist * 3))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(-_MotionBlurDist * 4, -_MotionBlurDist * 4))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(_MotionBlurDist, _MotionBlurDist))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(_MotionBlurDist * 2, _MotionBlurDist * 2))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(_MotionBlurDist * 3, _MotionBlurDist * 3))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(_MotionBlurDist * 4, _MotionBlurDist * 4))); + col.rgb = col.rgb / 9; + #endif + //------------------------------------ + + //NEGATIVE_ON + #if NEGATIVE_ON + col.rgb = lerp(col.rgb, 1 - col.rgb, _NegativeAmount); + #endif + + //-------------- + half luminance = 0; + + //GREYSCALE_ON && !GREYSCALEOUTLINE_ON + #if GREYSCALE_ON && !GREYSCALEOUTLINE_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + luminance = saturate(luminance + _GreyscaleLuminosity); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _GreyscaleTintColor, _GreyscaleBlend); + #endif + //------------------------------------ + + //GHOST_ON + #if GHOST_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + half4 ghostResult; + ghostResult.a = saturate(luminance - _GhostTransparency) * col.a; + ghostResult.rgb = col.rgb * (luminance + _GhostColorBoost); + col = lerp(col, ghostResult, _GhostBlend); + #endif + //------------------------------------ + + //INNEROUTLINE_ON + #if INNEROUTLINE_ON + half3 innerT = abs(GetPixel(0, _InnerOutlineThickness, d.texcoord0.xy, _MainTex, sampler_MainTex) - GetPixel(0, -_InnerOutlineThickness, d.texcoord0.xy, _MainTex, sampler_MainTex)); + innerT += abs(GetPixel(_InnerOutlineThickness, 0, d.texcoord0.xy, _MainTex, sampler_MainTex) - GetPixel(-_InnerOutlineThickness, 0, d.texcoord0.xy, _MainTex, sampler_MainTex)); + #if !ONLYINNEROUTLINE_ON + innerT = (innerT / 2.0) * col.a * _InnerOutlineAlpha; + col.rgb += length(innerT) * _InnerOutlineColor.rgb * _InnerOutlineGlow; + #else + innerT *= col.a * _InnerOutlineAlpha; + col.rgb = length(innerT) * _InnerOutlineColor.rgb * _InnerOutlineGlow; + col.a = step(0.3, col.r+col.g+col.b); + #endif + #endif + //------------------------------------------------------- + + //HITEFFECT_ON + #if HITEFFECT_ON + col.rgb = lerp(col.rgb, _HitEffectColor.rgb * _HitEffectGlow, _HitEffectBlend); + #endif + //-------------------- + + //GRADIENT_ON + #if GRADIENT_ON + half2 tiledUvGrad = half2(uvRect.x / _MainTex_ST.x, uvRect.y / _MainTex_ST.y); + #if GRADIENT2COL_ON + _GradTopRightCol = _GradTopLeftCol; + _GradBotRightCol = _GradBotLeftCol; + #endif + #if RADIALGRADIENT_ON + half radialDist = 1 - length(tiledUvGrad - half2(0.5, 0.5)); + radialDist *= (_MainTex_TexelSize.w / _MainTex_TexelSize.z); + radialDist = saturate(_GradBoostX * radialDist); + half4 gradientResult = lerp(_GradTopLeftCol, _GradBotLeftCol, radialDist); + #else + half gradXLerpFactor = saturate(pow(tiledUvGrad.x, _GradBoostX)); + half4 gradientResult = lerp(lerp(_GradBotLeftCol, _GradBotRightCol, gradXLerpFactor), + lerp(_GradTopLeftCol, _GradTopRightCol, gradXLerpFactor), saturate(pow(tiledUvGrad.y, _GradBoostY))); + #endif + gradientResult = lerp(col, gradientResult, _GradBlend); + col.rgb = gradientResult.rgb * col.a; + col.a *= gradientResult.a; + #endif + //-------------------------------------------------------------------- + + //CONTRAST_ON + #if CONTRAST_ON + col.rgb = (col.rgb - float3(0.5, 0.5, 0.5)) * _Contrast + float3(0.5, 0.5, 0.5); + col.rgb += _Brightness; + #endif + + //------------------------------------------------------------------- + + //COLORSWAP_ON + #if COLORSWAP_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + half4 swapMask = SAMPLE_TEXTURE2D(_ColorSwapTex, sampler_ColorSwapTex, d.texcoord0.xy); + swapMask.rgb *= swapMask.a; + half3 redSwap = _ColorSwapRed * swapMask.r * saturate(luminance + _ColorSwapRedLuminosity); + half3 greenSwap = _ColorSwapGreen * swapMask.g * saturate(luminance + _ColorSwapGreenLuminosity); + half3 blueSwap = _ColorSwapBlue * swapMask.b * saturate(luminance + _ColorSwapBlueLuminosity); + swapMask.rgb = col.rgb * saturate(1 - swapMask.r - swapMask.g - swapMask.b); + col.rgb = lerp(col.rgb, swapMask.rgb + redSwap + greenSwap + blueSwap, _ColorSwapBlend); + #endif + //-------------------------------------------------------------------- + + //COLORRAMP_ON && !COLORRAMPOUTLINE_ON + #if COLORRAMP_ON && !COLORRAMPOUTLINE_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + luminance = saturate(luminance + _ColorRampLuminosity); + #if GRADIENTCOLORRAMP_ON + col.rgb = lerp(col.rgb, SAMPLE_TEXTURE2D(_ColorRampTexGradient, sampler_ColorRampTexGradient, half2(luminance, 0)).rgb, _ColorRampBlend); + #else + col.rgb = lerp(col.rgb, SAMPLE_TEXTURE2D(_ColorRampTex, sampler_ColorRampTex, half2(luminance, 0)).rgb, _ColorRampBlend); + #endif + #endif + //-------------------------------------------------------------------- + + //CHANGECOLOR_ON + #if CHANGECOLOR_ON + float3 currChangeColor = saturate(col.rgb); + luminance = 0.3 * currChangeColor.r + 0.59 * currChangeColor.g + 0.11 * currChangeColor.b; + luminance = saturate(luminance + _ColorChangeLuminosity); + half3 dif = abs(currChangeColor - _ColorChangeTarget.rgb); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _ColorChangeNewCol.rgb, + max(sign(1 - saturate(dif.x + dif.y + dif.z) - _ColorChangeTolerance), 0.0)); + #if CHANGECOLOR2_ON + dif = abs(currChangeColor - _ColorChangeTarget2.rgb); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _ColorChangeNewCol2.rgb, + max(sign(1 - saturate(dif.x + dif.y + dif.z) - _ColorChangeTolerance2), 0.0)); + #endif + #if CHANGECOLOR3_ON + dif = abs(currChangeColor - _ColorChangeTarget3.rgb); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _ColorChangeNewCol3.rgb, + max(sign(1 - saturate(dif.x + dif.y + dif.z) - _ColorChangeTolerance3), 0.0)); + #endif + #endif + //------------------------------------------------------- + + //POSTERIZE_ON && !POSTERIZEOUTLINE_ON + #if POSTERIZE_ON && !POSTERIZEOUTLINE_ON + col.rgb = pow(col.rgb, _PosterizeGamma) * _PosterizeNumColors; + col.rgb = floor(col.rgb) / _PosterizeNumColors; + col.rgb = pow(col.rgb, 1.0 / _PosterizeGamma); + #endif + //------------------------------------ + + //HSV_ON + #if HSV_ON + half3 resultHsv = half3(col.rgb); + half cosHsv = _HsvBright * _HsvSaturation * cos(_HsvShift * 3.14159265 / 180); + half sinHsv = _HsvBright * _HsvSaturation * sin(_HsvShift * 3.14159265 / 180); + resultHsv.x = (.299 * _HsvBright + .701 * cosHsv + .168 * sinHsv) * col.x + + (.587 * _HsvBright - .587 * cosHsv + .330 * sinHsv) * col.y + + (.114 * _HsvBright - .114 * cosHsv - .497 * sinHsv) * col.z; + resultHsv.y = (.299 * _HsvBright - .299 * cosHsv - .328 * sinHsv) *col.x + + (.587 * _HsvBright + .413 * cosHsv + .035 * sinHsv) * col.y + + (.114 * _HsvBright - .114 * cosHsv + .292 * sinHsv) * col.z; + resultHsv.z = (.299 * _HsvBright - .3 * cosHsv + 1.25 * sinHsv) * col.x + + (.587 * _HsvBright - .588 * cosHsv - 1.05 * sinHsv) * col.y + + (.114 * _HsvBright + .886 * cosHsv - .203 * sinHsv) * col.z; + col.rgb = resultHsv; + #endif + //------------------------------------------------------- + + //OVERLAY_ON + #if OVERLAY_ON + half2 overlayUvs = d.texcoord0.xy; + overlayUvs.x += ((_Time.y + randomSeed) * _OverlayTextureScrollXSpeed) % 1; + overlayUvs.y += ((_Time.y + randomSeed) * _OverlayTextureScrollYSpeed) % 1; + half4 overlayCol = SAMPLE_TEXTURE2D(_OverlayTex, sampler_OverlayTex, TRANSFORM_TEX(overlayUvs, _OverlayTex)); + overlayCol.rgb *= _OverlayColor.rgb * _OverlayGlow; + #if !OVERLAYMULT_ON + overlayCol.rgb *= overlayCol.a * _OverlayColor.rgb * _OverlayColor.a * _OverlayBlend; + col.rgb += overlayCol.rgb; + #else + overlayCol.a *= _OverlayColor.a; + col = lerp(col, col * overlayCol, _OverlayBlend); + #endif + #endif + + //--------------------------------- + + //OUTBASE_ON + #if OUTBASE_ON + #if OUTBASEPIXELPERF_ON + half2 destUv = half2(_OutlinePixelWidth * _MainTex_TexelSize.x, _OutlinePixelWidth * _MainTex_TexelSize.y); + #else + half2 destUv = half2(_OutlineWidth * _MainTex_TexelSize.x * 200, _OutlineWidth * _MainTex_TexelSize.y * 200); + #endif + + #if OUTDIST_ON + d.texcoord3.x += ((_Time.x + _RandomSeed) * _OutlineDistortTexXSpeed) % 1; + d.texcoord3.y += ((_Time.x + _RandomSeed) * _OutlineDistortTexYSpeed) % 1; + #if ATLAS_ON + d.texcoord3 = half2((d.texcoord3.x - _MinXUV) / (_MaxXUV - _MinXUV), (d.texcoord3.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half outDistortAmnt = (SAMPLE_TEXTURE2D(_OutlineDistortTex, sampler_OutlineDistortTex, d.texcoord3).r - 0.5) * 0.2 * _OutlineDistortAmount; + destUv.x += outDistortAmnt; + destUv.y += outDistortAmnt; + #endif + + half spriteLeft = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(destUv.x, 0)).a; + half spriteRight = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy - half2(destUv.x, 0)).a; + half spriteBottom = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(0, destUv.y)).a; + half spriteTop = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy - half2(0, destUv.y)).a; + half result = spriteLeft + spriteRight + spriteBottom + spriteTop; + + #if OUTBASE8DIR_ON + half spriteTopLeft = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(destUv.x, destUv.y)).a; + half spriteTopRight = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(-destUv.x, destUv.y)).a; + half spriteBotLeft = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(destUv.x, -destUv.y)).a; + half spriteBotRight = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(-destUv.x, -destUv.y)).a; + result = result + spriteTopLeft + spriteTopRight + spriteBotLeft + spriteBotRight; + #endif + + result = step(0.05, saturate(result)); + + #if OUTTEX_ON + d.texcoord1.x += ((_Time.x + _RandomSeed) * _OutlineTexXSpeed) % 1; + d.texcoord1.y += ((_Time.x + _RandomSeed) * _OutlineTexYSpeed) % 1; + #if ATLAS_ON + d.texcoord1 = half2((d.texcoord1.x - _MinXUV) / (_MaxXUV - _MinXUV), (d.texcoord1.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half4 tempOutColor = SAMPLE_TEXTURE2D(_OutlineTex, sampler_OutlineTex, d.texcoord1); + tempOutColor *= _OutlineColor; + _OutlineColor = tempOutColor; + #endif + + result *= (1 - originalAlpha) * _OutlineAlpha; + + half4 outline = _OutlineColor * d.vertexColor.a; + outline.rgb *= _OutlineGlow; + outline.a = result; + #if ONLYOUTLINE_ON + col = outline; + #else + col = lerp(col, outline, result); + #endif + #endif + //------------------------------------------------------- + + //FADE_ON + #if FADE_ON + half2 tiledUvFade1 = TRANSFORM_TEX(d.texcoord0, _FadeTex); + half2 tiledUvFade2 = TRANSFORM_TEX(d.texcoord0, _FadeBurnTex); + #if ATLAS_ON + tiledUvFade1 = half2((tiledUvFade1.x - _MinXUV) / (_MaxXUV - _MinXUV), (tiledUvFade1.y - _MinYUV) / (_MaxYUV - _MinYUV)); + tiledUvFade2 = half2((tiledUvFade2.x - _MinXUV) / (_MaxXUV - _MinXUV), (tiledUvFade2.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half fadeTemp = SAMPLE_TEXTURE2D(_FadeTex, sampler_FadeTex, tiledUvFade1).r; + half fade = smoothstep(_FadeAmount, _FadeAmount + _FadeBurnTransition, fadeTemp); + half fadeBurn = saturate(smoothstep(_FadeAmount - _FadeBurnWidth, _FadeAmount - _FadeBurnWidth + 0.1, fadeTemp) * _FadeAmount); + col.a *= fade; + _FadeBurnColor.rgb *= _FadeBurnGlow; + col += fadeBurn * SAMPLE_TEXTURE2D(_FadeBurnTex, sampler_FadeBurnTex, tiledUvFade2) * _FadeBurnColor * originalAlpha * (1 - col.a); + #endif + //------------------------------------------------------- + + //SHADOW_ON + #if SHADOW_ON + half shadowA = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(_ShadowX, _ShadowY)).a; + half preMultShadowMask = 1 - (saturate(shadowA - col.a) * (1 - col.a)); + col.rgb *= 1 - ((shadowA - col.a) * (1 - col.a)); + col.rgb += (_ShadowColor * shadowA) * (1 - col.a); + col.a = max(shadowA * _ShadowAlpha * d.vertexColor.a, col.a); + #endif + + //------------------------------------------------------- + + //GLOW_ON + #if GLOW_ON + half4 emission; + #if GLOWTEX_ON + emission = SAMPLE_TEXTURE2D(_GlowTex, sampler_GlowTex, d.texcoord0); + #else + emission = col; + #endif + + col.rgb *= _GlowGlobal; + emission.rgb *= emission.a * col.a * _Glow * _GlowColor; + col.rgb += emission.rgb; + #endif + //------------------------------------------------------- + + //COLORRAMP_ON && COLORRAMPOUTLINE_ON + #if COLORRAMP_ON && COLORRAMPOUTLINE_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + luminance = saturate(luminance + _ColorRampLuminosity); + #if GRADIENTCOLORRAMP_ON + col.rgb = lerp(col.rgb, SAMPLE_TEXTURE2D(_ColorRampTexGradient, sampler_ColorRampTexGradient, half2(luminance, 0)).rgb, _ColorRampBlend); + #else + col.rgb = lerp(col.rgb, SAMPLE_TEXTURE2D(_ColorRampTex, sampler_ColorRampTex, half2(luminance, 0)).rgb, _ColorRampBlend); + #endif + #endif + //--------------- + + //GREYSCALE_ON && GREYSCALEOUTLINE_ON + #if GREYSCALE_ON && GREYSCALEOUTLINE_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + luminance = saturate(luminance + _GreyscaleLuminosity); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _GreyscaleTintColor, _GreyscaleBlend); + #endif + + //----------------------------------- + + //POSTERIZE_ON && POSTERIZEOUTLINE_ON + #if POSTERIZE_ON && POSTERIZEOUTLINE_ON + col.rgb = pow(col.rgb, _PosterizeGamma) * _PosterizeNumColors; + col.rgb = floor(col.rgb) / _PosterizeNumColors; + col.rgb = pow(col.rgb, 1.0 / _PosterizeGamma); + #endif + + //----------------------------------- + + //SHINE_ON + #if SHINE_ON + half2 uvShine = uvRect; + half cosAngle = cos(_ShineRotate); + half sinAngle = sin(_ShineRotate); + half2x2 rot = half2x2(cosAngle, -sinAngle, sinAngle, cosAngle); + uvShine -= half2(0.5, 0.5); + uvShine = mul(rot, uvShine); + uvShine += half2(0.5, 0.5); + half shineMask = SAMPLE_TEXTURE2D(_ShineMask, sampler_ShineMask, d.texcoord0.xy).a; + half currentDistanceProjection = (uvShine.x + uvShine.y) / 2; + half whitePower = 1 - (abs(currentDistanceProjection - _ShineLocation) / _ShineWidth); + col.rgb += col.a * whitePower * _ShineGlow * max(sign(currentDistanceProjection - (_ShineLocation - _ShineWidth)), 0.0) + * max(sign((_ShineLocation + _ShineWidth) - currentDistanceProjection), 0.0) * _ShineColor * shineMask; + #endif + + //----------------------------------- + + //HOLOGRAM_ON + #if HOLOGRAM_ON + half totalHologram = _HologramStripesAmount + _HologramUnmodAmount; + half hologramYCoord = ((uvRect.y + (((_Time.x + randomSeed) % 1) * _HologramStripesSpeed)) % totalHologram) / totalHologram; + hologramYCoord = abs(hologramYCoord); + half alpha = RemapFloat(saturate(hologramYCoord - (_HologramUnmodAmount/totalHologram)), 0.0, 1.0, _HologramMinAlpha, saturate(_HologramMaxAlpha)); + half hologramMask = max(sign((_HologramUnmodAmount/totalHologram) - hologramYCoord), 0.0); + half4 hologramResult = col; + hologramResult.a *= lerp(alpha, 1, hologramMask); + hologramResult.rgb *= max(1, _HologramMaxAlpha * max(sign(hologramYCoord - (_HologramUnmodAmount/totalHologram)), 0.0)); + hologramMask = 1 - step(0.01,hologramMask); + hologramResult.rgb += hologramMask * _HologramStripeColor * col.a; + col = lerp(col, hologramResult, _HologramBlend); + #endif + + //----------------------------------- + + //FLICKER_ON + #if FLICKER_ON + col.a *= saturate(col.a * step(frac(0.05 + (_Time.w + randomSeed) * _FlickerFreq), 1 - _FlickerPercent) + _FlickerAlpha); + #endif + //----------------------------------- + + //ALPHACUTOFF_ON + + //ALPHAROUND_ON + + //ALPHAOUTLINE_ON + #if ALPHAOUTLINE_ON + half alphaOutlineRes = pow(1 - col.a, max(_AlphaOutlinePower, 0.0001)) * step(_AlphaOutlineMinAlpha, col.a) * _AlphaOutlineBlend; + col.rgb = lerp(col.rgb, _AlphaOutlineColor.rgb * _AlphaOutlineGlow, alphaOutlineRes); + col.a = lerp(col.a, 1, alphaOutlineRes > 1); + #endif + //------------------------------------------------------- + + //FOG_ON + + //------------------ + + col *= _Color; + o.Albedo = col; + col.a *= _Alpha; + clip(col.a - _AlphaCutoffValue - 0.01); + o.Alpha = _Color.a; + } + + + + + + void ChainSurfaceFunction(inout Surface l, inout ShaderData d) + { + Ext_SurfaceFunction0(l, d); + // Ext_SurfaceFunction1(l, d); + // Ext_SurfaceFunction2(l, d); + // Ext_SurfaceFunction3(l, d); + // Ext_SurfaceFunction4(l, d); + // Ext_SurfaceFunction5(l, d); + // Ext_SurfaceFunction6(l, d); + // Ext_SurfaceFunction7(l, d); + // Ext_SurfaceFunction8(l, d); + // Ext_SurfaceFunction9(l, d); + // Ext_SurfaceFunction10(l, d); + // Ext_SurfaceFunction11(l, d); + // Ext_SurfaceFunction12(l, d); + // Ext_SurfaceFunction13(l, d); + // Ext_SurfaceFunction14(l, d); + // Ext_SurfaceFunction15(l, d); + // Ext_SurfaceFunction16(l, d); + // Ext_SurfaceFunction17(l, d); + // Ext_SurfaceFunction18(l, d); + // Ext_SurfaceFunction19(l, d); + // Ext_SurfaceFunction20(l, d); + // Ext_SurfaceFunction21(l, d); + // Ext_SurfaceFunction22(l, d); + // Ext_SurfaceFunction23(l, d); + // Ext_SurfaceFunction24(l, d); + // Ext_SurfaceFunction25(l, d); + // Ext_SurfaceFunction26(l, d); + // Ext_SurfaceFunction27(l, d); + // Ext_SurfaceFunction28(l, d); + // Ext_SurfaceFunction29(l, d); + } + +#if !_DECALSHADER + + void ChainModifyVertex(inout VertexData v, inout VertexToPixel v2p, float4 time) + { + ExtraV2F d; + + ZERO_INITIALIZE(ExtraV2F, d); + ZERO_INITIALIZE(Blackboard, d.blackboard); + // due to motion vectors in HDRP, we need to use the last + // time in certain spots. So if you are going to use _Time to adjust vertices, + // you need to use this time or motion vectors will break. + d.time = time; + + Ext_ModifyVertex0(v, d); + // Ext_ModifyVertex1(v, d); + // Ext_ModifyVertex2(v, d); + // Ext_ModifyVertex3(v, d); + // Ext_ModifyVertex4(v, d); + // Ext_ModifyVertex5(v, d); + // Ext_ModifyVertex6(v, d); + // Ext_ModifyVertex7(v, d); + // Ext_ModifyVertex8(v, d); + // Ext_ModifyVertex9(v, d); + // Ext_ModifyVertex10(v, d); + // Ext_ModifyVertex11(v, d); + // Ext_ModifyVertex12(v, d); + // Ext_ModifyVertex13(v, d); + // Ext_ModifyVertex14(v, d); + // Ext_ModifyVertex15(v, d); + // Ext_ModifyVertex16(v, d); + // Ext_ModifyVertex17(v, d); + // Ext_ModifyVertex18(v, d); + // Ext_ModifyVertex19(v, d); + // Ext_ModifyVertex20(v, d); + // Ext_ModifyVertex21(v, d); + // Ext_ModifyVertex22(v, d); + // Ext_ModifyVertex23(v, d); + // Ext_ModifyVertex24(v, d); + // Ext_ModifyVertex25(v, d); + // Ext_ModifyVertex26(v, d); + // Ext_ModifyVertex27(v, d); + // Ext_ModifyVertex28(v, d); + // Ext_ModifyVertex29(v, d); + + + // #if %EXTRAV2F0REQUIREKEY% + // v2p.extraV2F0 = d.extraV2F0; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // v2p.extraV2F1 = d.extraV2F1; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // v2p.extraV2F2 = d.extraV2F2; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // v2p.extraV2F3 = d.extraV2F3; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // v2p.extraV2F4 = d.extraV2F4; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // v2p.extraV2F5 = d.extraV2F5; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // v2p.extraV2F6 = d.extraV2F6; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // v2p.extraV2F7 = d.extraV2F7; + // #endif + } + + void ChainModifyTessellatedVertex(inout VertexData v, inout VertexToPixel v2p) + { + ExtraV2F d; + ZERO_INITIALIZE(ExtraV2F, d); + ZERO_INITIALIZE(Blackboard, d.blackboard); + + // #if %EXTRAV2F0REQUIREKEY% + // d.extraV2F0 = v2p.extraV2F0; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // d.extraV2F1 = v2p.extraV2F1; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // d.extraV2F2 = v2p.extraV2F2; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // d.extraV2F3 = v2p.extraV2F3; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // d.extraV2F4 = v2p.extraV2F4; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // d.extraV2F5 = v2p.extraV2F5; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // d.extraV2F6 = v2p.extraV2F6; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // d.extraV2F7 = v2p.extraV2F7; + // #endif + + + // Ext_ModifyTessellatedVertex0(v, d); + // Ext_ModifyTessellatedVertex1(v, d); + // Ext_ModifyTessellatedVertex2(v, d); + // Ext_ModifyTessellatedVertex3(v, d); + // Ext_ModifyTessellatedVertex4(v, d); + // Ext_ModifyTessellatedVertex5(v, d); + // Ext_ModifyTessellatedVertex6(v, d); + // Ext_ModifyTessellatedVertex7(v, d); + // Ext_ModifyTessellatedVertex8(v, d); + // Ext_ModifyTessellatedVertex9(v, d); + // Ext_ModifyTessellatedVertex10(v, d); + // Ext_ModifyTessellatedVertex11(v, d); + // Ext_ModifyTessellatedVertex12(v, d); + // Ext_ModifyTessellatedVertex13(v, d); + // Ext_ModifyTessellatedVertex14(v, d); + // Ext_ModifyTessellatedVertex15(v, d); + // Ext_ModifyTessellatedVertex16(v, d); + // Ext_ModifyTessellatedVertex17(v, d); + // Ext_ModifyTessellatedVertex18(v, d); + // Ext_ModifyTessellatedVertex19(v, d); + // Ext_ModifyTessellatedVertex20(v, d); + // Ext_ModifyTessellatedVertex21(v, d); + // Ext_ModifyTessellatedVertex22(v, d); + // Ext_ModifyTessellatedVertex23(v, d); + // Ext_ModifyTessellatedVertex24(v, d); + // Ext_ModifyTessellatedVertex25(v, d); + // Ext_ModifyTessellatedVertex26(v, d); + // Ext_ModifyTessellatedVertex27(v, d); + // Ext_ModifyTessellatedVertex28(v, d); + // Ext_ModifyTessellatedVertex29(v, d); + + // #if %EXTRAV2F0REQUIREKEY% + // v2p.extraV2F0 = d.extraV2F0; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // v2p.extraV2F1 = d.extraV2F1; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // v2p.extraV2F2 = d.extraV2F2; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // v2p.extraV2F3 = d.extraV2F3; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // v2p.extraV2F4 = d.extraV2F4; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // v2p.extraV2F5 = d.extraV2F5; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // v2p.extraV2F6 = d.extraV2F6; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // v2p.extraV2F7 = d.extraV2F7; + // #endif + } + + void ChainFinalColorForward(inout Surface l, inout ShaderData d, inout half4 color) + { + // Ext_FinalColorForward0(l, d, color); + // Ext_FinalColorForward1(l, d, color); + // Ext_FinalColorForward2(l, d, color); + // Ext_FinalColorForward3(l, d, color); + // Ext_FinalColorForward4(l, d, color); + // Ext_FinalColorForward5(l, d, color); + // Ext_FinalColorForward6(l, d, color); + // Ext_FinalColorForward7(l, d, color); + // Ext_FinalColorForward8(l, d, color); + // Ext_FinalColorForward9(l, d, color); + // Ext_FinalColorForward10(l, d, color); + // Ext_FinalColorForward11(l, d, color); + // Ext_FinalColorForward12(l, d, color); + // Ext_FinalColorForward13(l, d, color); + // Ext_FinalColorForward14(l, d, color); + // Ext_FinalColorForward15(l, d, color); + // Ext_FinalColorForward16(l, d, color); + // Ext_FinalColorForward17(l, d, color); + // Ext_FinalColorForward18(l, d, color); + // Ext_FinalColorForward19(l, d, color); + // Ext_FinalColorForward20(l, d, color); + // Ext_FinalColorForward21(l, d, color); + // Ext_FinalColorForward22(l, d, color); + // Ext_FinalColorForward23(l, d, color); + // Ext_FinalColorForward24(l, d, color); + // Ext_FinalColorForward25(l, d, color); + // Ext_FinalColorForward26(l, d, color); + // Ext_FinalColorForward27(l, d, color); + // Ext_FinalColorForward28(l, d, color); + // Ext_FinalColorForward29(l, d, color); + } + + void ChainFinalGBufferStandard(inout Surface s, inout ShaderData d, inout half4 GBuffer0, inout half4 GBuffer1, inout half4 GBuffer2, inout half4 outEmission, inout half4 outShadowMask) + { + // Ext_FinalGBufferStandard0(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard1(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard2(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard3(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard4(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard5(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard6(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard7(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard8(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard9(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard10(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard11(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard12(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard13(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard14(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard15(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard16(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard17(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard18(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard19(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard20(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard21(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard22(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard23(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard24(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard25(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard26(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard27(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard28(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard29(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + } +#endif + + + + + +#if _DECALSHADER + + ShaderData CreateShaderData(SurfaceDescriptionInputs IN) + { + ShaderData d = (ShaderData)0; + d.TBNMatrix = float3x3(IN.WorldSpaceTangent, IN.WorldSpaceBiTangent, IN.WorldSpaceNormal); + d.worldSpaceNormal = IN.WorldSpaceNormal; + d.worldSpaceTangent = IN.WorldSpaceTangent; + + d.worldSpacePosition = IN.WorldSpacePosition; + d.texcoord0 = IN.uv0.xyxy; + d.screenPos = IN.ScreenPosition; + + d.worldSpaceViewDir = normalize(_WorldSpaceCameraPos - d.worldSpacePosition); + + d.tangentSpaceViewDir = mul(d.TBNMatrix, d.worldSpaceViewDir); + + // these rarely get used, so we back transform them. Usually will be stripped. + #if _HDRP + // d.localSpacePosition = mul(GetWorldToObjectMatrix(), float4(GetCameraRelativePositionWS(d.worldSpacePosition), 1)).xyz; + #else + // d.localSpacePosition = mul(GetWorldToObjectMatrix(), float4(d.worldSpacePosition, 1)).xyz; + #endif + // d.localSpaceNormal = normalize(mul((float3x3)GetWorldToObjectMatrix(), d.worldSpaceNormal)); + // d.localSpaceTangent = normalize(mul((float3x3)GetWorldToObjectMatrix(), d.worldSpaceTangent.xyz)); + + // #if %SCREENPOSREQUIREKEY% + // d.screenUV = (IN.ScreenPosition.xy / max(0.01, IN.ScreenPosition.w)); + // #endif + + return d; + } +#else + + ShaderData CreateShaderData(VertexToPixel i + #if NEED_FACING + , bool facing + #endif + ) + { + ShaderData d = (ShaderData)0; + d.clipPos = i.pos; + d.worldSpacePosition = i.worldPos; + + d.worldSpaceNormal = normalize(i.worldNormal); + d.worldSpaceTangent.xyz = normalize(i.worldTangent.xyz); + + d.tangentSign = i.worldTangent.w * unity_WorldTransformParams.w; + float3 bitangent = cross(d.worldSpaceTangent.xyz, d.worldSpaceNormal) * d.tangentSign; + + d.TBNMatrix = float3x3(d.worldSpaceTangent, -bitangent, d.worldSpaceNormal); + d.worldSpaceViewDir = normalize(_WorldSpaceCameraPos - i.worldPos); + + d.tangentSpaceViewDir = mul(d.TBNMatrix, d.worldSpaceViewDir); + d.texcoord0 = i.texcoord0; + d.texcoord1 = i.texcoord1; + d.texcoord2 = i.texcoord2; + + // #if %TEXCOORD3REQUIREKEY% + d.texcoord3 = i.texcoord3; + // #endif + + // d.isFrontFace = facing; + // #if %VERTEXCOLORREQUIREKEY% + d.vertexColor = i.vertexColor; + // #endif + + // these rarely get used, so we back transform them. Usually will be stripped. + #if _HDRP + // d.localSpacePosition = mul(GetWorldToObjectMatrix(), float4(GetCameraRelativePositionWS(i.worldPos), 1)).xyz; + #else + // d.localSpacePosition = mul(GetWorldToObjectMatrix(), float4(i.worldPos, 1)).xyz; + #endif + // d.localSpaceNormal = normalize(mul((float3x3)GetWorldToObjectMatrix(), i.worldNormal)); + // d.localSpaceTangent = normalize(mul((float3x3)GetWorldToObjectMatrix(), i.worldTangent.xyz)); + + // #if %SCREENPOSREQUIREKEY% + // d.screenPos = i.screenPos; + // d.screenUV = (i.screenPos.xy / i.screenPos.w); + // #endif + + + // #if %EXTRAV2F0REQUIREKEY% + // d.extraV2F0 = i.extraV2F0; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // d.extraV2F1 = i.extraV2F1; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // d.extraV2F2 = i.extraV2F2; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // d.extraV2F3 = i.extraV2F3; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // d.extraV2F4 = i.extraV2F4; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // d.extraV2F5 = i.extraV2F5; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // d.extraV2F6 = i.extraV2F6; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // d.extraV2F7 = i.extraV2F7; + // #endif + + return d; + } + +#endif + + + +#if (SHADERPASS == SHADERPASS_LIGHT_TRANSPORT) + + // This was not in constant buffer in original unity, so keep outiside. But should be in as ShaderRenderPass frequency + float unity_OneOverOutputBoost; + float unity_MaxOutputValue; + + CBUFFER_START(UnityMetaPass) + // x = use uv1 as raster position + // y = use uv2 as raster position + bool4 unity_MetaVertexControl; + + // x = return albedo + // y = return normal + bool4 unity_MetaFragmentControl; + CBUFFER_END + + VertexToPixel Vert(VertexData inputMesh) + { + VertexToPixel output; + ZERO_INITIALIZE(VertexToPixel, output); + UNITY_SETUP_INSTANCE_ID(inputMesh); + UNITY_TRANSFER_INSTANCE_ID(inputMesh, output); + UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(output); + + // Output UV coordinate in vertex shader + float2 uv = float2(0.0, 0.0); + + if (unity_MetaVertexControl.x) + { + uv = inputMesh.texcoord1.xy * unity_LightmapST.xy + unity_LightmapST.zw; + } + else if (unity_MetaVertexControl.y) + { + uv = inputMesh.texcoord2.xy * unity_DynamicLightmapST.xy + unity_DynamicLightmapST.zw; + } + + // OpenGL right now needs to actually use the incoming vertex position + // so we create a fake dependency on it here that haven't any impact. + output.pos = float4(uv * 2.0 - 1.0, inputMesh.vertex.z > 0 ? 1.0e-4 : 0.0, 1.0); + + output.worldPos = TransformObjectToWorld(inputMesh.vertex); + + // Normal is required for triplanar mapping + output.worldNormal = TransformObjectToWorldNormal(inputMesh.normal); + // Not required but assign to silent compiler warning + output.worldTangent = float4(1.0, 0.0, 0.0, 0.0); + + output.texcoord0 = inputMesh.texcoord0; + output.texcoord1 = inputMesh.texcoord1; + output.texcoord2 = inputMesh.texcoord2; + // #if %TEXCOORD3REQUIREKEY% + output.texcoord3 = inputMesh.texcoord3; + // #endif + // #if %VERTEXCOLORREQUIREKEY% + output.vertexColor = inputMesh.vertexColor; + // #endif + + return output; + } +#else + + #if (_PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR))) + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/ShaderVariablesMatrixDefsHDCamera.hlsl" + + void MotionVectorPositionZBias(VertexToPixel input) + { + #if UNITY_REVERSED_Z + input.pos.z -= unity_MotionVectorsParams.z * input.pos.w; + #else + input.pos.z += unity_MotionVectorsParams.z * input.pos.w; + #endif + } + + #endif + + VertexToPixel Vert(VertexData input) + { + VertexToPixel output; + ZERO_INITIALIZE(VertexToPixel, output); + + UNITY_SETUP_INSTANCE_ID(input); + UNITY_TRANSFER_INSTANCE_ID(input, output); + UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(output); + + // copy before user modification, since we'll apply that to the copy later + #if _HDRP && (_PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR))) + VertexData previousMesh = input; + #endif + + ChainModifyVertex(input, output, _Time); + + // This return the camera relative position (if enable) + float3 positionRWS = TransformObjectToWorld(input.vertex.xyz); + float3 normalWS = TransformObjectToWorldNormal(input.normal); + float4 tangentWS = float4(TransformObjectToWorldDir(input.tangent.xyz), input.tangent.w); + + + output.worldPos = GetAbsolutePositionWS(positionRWS); + output.pos = TransformWorldToHClip(positionRWS); + output.worldNormal = normalWS; + output.worldTangent = tangentWS; + + + output.texcoord0 = input.texcoord0; + output.texcoord1 = input.texcoord1; + output.texcoord2 = input.texcoord2; + + // #if %TEXCOORD3REQUIREKEY% + output.texcoord3 = input.texcoord3; + // #endif + + // #if %VERTEXCOLORREQUIREKEY% + output.vertexColor = input.vertexColor; + // #endif + + // #if %SCREENPOSREQUIREKEY% + // output.screenPos = ComputeScreenPos(output.pos, _ProjectionParams.x); + // #endif + + #if _HDRP && (_PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR))) + + #if !defined(TESSELLATION_ON) + MotionVectorPositionZBias(output); + #endif + + output.motionVectorCS = mul(UNITY_MATRIX_UNJITTERED_VP, float4(positionRWS, 1.0)); + // Note: unity_MotionVectorsParams.y is 0 is forceNoMotion is enabled + bool forceNoMotion = unity_MotionVectorsParams.y == 0.0; + if (forceNoMotion) + { + output.previousPositionCS = float4(0.0, 0.0, 0.0, 1.0); + } + else + { + bool hasDeformation = unity_MotionVectorsParams.x > 0.0; // Skin or morph target + + float3 effectivePositionOS = (hasDeformation ? previousMesh.previousPositionOS : previousMesh.vertex.xyz); + #if defined(_ADD_PRECOMPUTED_VELOCITY) + effectivePositionOS -= input.precomputedVelocity; + #endif + + + + previousMesh.vertex = float4(effectivePositionOS, 1); + VertexToPixel dummy = (VertexToPixel)0; + + ChainModifyVertex(previousMesh, dummy, _LastTimeParameters); + + float3 previousPositionRWS = TransformPreviousObjectToWorld(previousMesh.vertex.xyz); + // we might need this for skinned objects? + //float3 normalWS = TransformPreviousObjectToWorldNormal(input.normal).xyz; + + #ifdef _WRITE_TRANSPARENT_MOTION_VECTOR + if (_TransparentCameraOnlyMotionVectors > 0) + { + previousPositionRWS = positionRWS.xyz; + } + #endif // _WRITE_TRANSPARENT_MOTION_VECTOR + + output.previousPositionCS = mul(UNITY_MATRIX_PREV_VP, float4(previousPositionRWS, 1.0)); + } + #endif // _HDRP && _PASSMOTIONVECTOR || (_PASSFORWARD && defined(_WRITE_TRANSPARENT_MOTION_VECTOR)) + + + return output; + } + + +#endif + + + + + + + + #if defined(WRITE_DECAL_BUFFER) && !defined(_DISABLE_DECALS) + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/Decal/DecalPrepassBuffer.hlsl" + #endif + + FragInputs BuildFragInputs(VertexToPixel input) + { + UNITY_SETUP_INSTANCE_ID(input); + FragInputs output; + ZERO_INITIALIZE(FragInputs, output); + + // Init to some default value to make the computer quiet (else it output 'divide by zero' warning even if value is not used). + // TODO: this is a really poor workaround, but the variable is used in a bunch of places + // to compute normals which are then passed on elsewhere to compute other values... + output.tangentToWorld = k_identity3x3; + output.positionSS = input.pos; // input.positionCS is SV_Position + // BETTER SHADERS: because we transform world position into actual world space for things like + // triplanar, etc, we have to back transform it here for lighting + output.positionRWS = GetCameraRelativePositionWS(input.worldPos); + output.tangentToWorld = BuildTangentToWorld(input.worldTangent, input.worldNormal); + output.texCoord0 = input.texcoord0; + output.texCoord1 = input.texcoord1; + output.texCoord2 = input.texcoord2; + + return output; + } + + void BuildSurfaceData(FragInputs fragInputs, inout Surface surfaceDescription, float3 V, PositionInputs posInput, out SurfaceData surfaceData, out float3 bentNormalWS) + { + // setup defaults -- these are used if the graph doesn't output a value + ZERO_INITIALIZE(SurfaceData, surfaceData); + + // specularOcclusion need to be init ahead of decal to quiet the compiler that modify the SurfaceData struct + // however specularOcclusion can come from the graph, so need to be init here so it can be override. + surfaceData.specularOcclusion = 1.0; + + // copy across graph values, if defined + surfaceData.baseColor = surfaceDescription.Albedo; + surfaceData.perceptualSmoothness = surfaceDescription.Smoothness; + surfaceData.ambientOcclusion = surfaceDescription.Occlusion; + surfaceData.specularOcclusion = surfaceDescription.SpecularOcclusion; + surfaceData.metallic = surfaceDescription.Metallic; + surfaceData.subsurfaceMask = surfaceDescription.SubsurfaceMask; + surfaceData.thickness = surfaceDescription.Thickness; + surfaceData.diffusionProfileHash = asuint(surfaceDescription.DiffusionProfileHash); + #if _USESPECULAR + surfaceData.specularColor = surfaceDescription.Specular; + #endif + surfaceData.coatMask = surfaceDescription.CoatMask; + surfaceData.anisotropy = surfaceDescription.Anisotropy; + surfaceData.iridescenceMask = surfaceDescription.IridescenceMask; + surfaceData.iridescenceThickness = surfaceDescription.IridescenceThickness; + + + + #if defined(_REFRACTION_PLANE) || defined(_REFRACTION_SPHERE) || defined(_REFRACTION_THIN) + if (_EnableSSRefraction) + { + surfaceData.transmittanceMask = (1.0 - surfaceDescription.Alpha); + surfaceDescription.Alpha = 1.0; + } + else + { + surfaceData.ior = surfaceDescription.ior; + surfaceData.transmittanceColor = surfaceDescription.transmittanceColor; + surfaceData.atDistance = surfaceDescription.atDistance; + surfaceData.transmittanceMask = surfaceDescription.transmittanceMask; + surfaceDescription.Alpha = 1.0; + } + #else + surfaceData.ior = 1.0; + surfaceData.transmittanceColor = float3(1.0, 1.0, 1.0); + surfaceData.atDistance = 1.0; + surfaceData.transmittanceMask = 0.0; + #endif + + + #if defined(_ENABLE_SHADOW_MATTE) && SHADERPASS == SHADERPASS_FORWARD_UNLIT + HDShadowContext shadowContext = InitShadowContext(); + float shadow; + float3 shadow3; + // We need to recompute some coordinate not computed by default for shadow matte + posInput = GetPositionInput(fragInputs.positionSS.xy, _ScreenSize.zw, fragInputs.positionSS.z, UNITY_MATRIX_I_VP, GetWorldToViewMatrix()); + float3 upWS = normalize(fragInputs.tangentToWorld[1]); + uint renderingLayers = GetMeshRenderingLightLayer(); + ShadowLoopMin(shadowContext, posInput, upWS, asuint(_ShadowMatteFilter), renderingLayers, shadow3); + shadow = dot(shadow3, float3(1.0 / 3.0, 1.0 / 3.0, 1.0 / 3.0)); + + float4 shadowColor = (1.0 - shadow) * surfaceDescription.ShadowTint.rgba; + float localAlpha = saturate(shadowColor.a + surfaceDescription.Alpha); + + // Keep the nested lerp + // With no Color (bsdfData.color.rgb, bsdfData.color.a == 0.0f), just use ShadowColor*Color to avoid a ring of "white" around the shadow + // And mix color to consider the Color & ShadowColor alpha (from texture or/and color picker) + #ifdef _SURFACE_TYPE_TRANSPARENT + surfaceData.baseColor = lerp(shadowColor.rgb * surfaceData.baseColor, lerp(lerp(shadowColor.rgb, surfaceData.baseColor, 1.0 - surfaceDescription.ShadowTint.a), surfaceData.baseColor, shadow), surfaceDescription.Alpha); + #else + surfaceData.baseColor = lerp(lerp(shadowColor.rgb, surfaceData.baseColor, 1.0 - surfaceDescription.ShadowTint.a), surfaceData.baseColor, shadow); + #endif + localAlpha = ApplyBlendMode(surfaceData.baseColor, localAlpha).a; + + surfaceDescription.Alpha = localAlpha; + #endif + + // These static material feature allow compile time optimization + surfaceData.materialFeatures = MATERIALFEATUREFLAGS_LIT_STANDARD; + #ifdef _MATERIAL_FEATURE_SUBSURFACE_SCATTERING + surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_SUBSURFACE_SCATTERING; + #endif + + #ifdef _MATERIAL_FEATURE_TRANSMISSION + surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_TRANSMISSION; + #endif + + #ifdef _MATERIAL_FEATURE_ANISOTROPY + surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_ANISOTROPY; + #endif + + #ifdef _MATERIAL_FEATURE_IRIDESCENCE + surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_IRIDESCENCE; + #endif + + #ifdef _MATERIAL_FEATURE_SPECULAR_COLOR + surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_SPECULAR_COLOR; + #endif + + #if defined(_MATERIAL_FEATURE_CLEAR_COAT) || _CLEARCOAT + surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_CLEAR_COAT; + #endif + + #if defined (_MATERIAL_FEATURE_SPECULAR_COLOR) && defined (_ENERGY_CONSERVING_SPECULAR) + // Require to have setup baseColor + // Reproduce the energy conservation done in legacy Unity. Not ideal but better for compatibility and users can unchek it + surfaceData.baseColor *= (1.0 - Max3(surfaceData.specularColor.r, surfaceData.specularColor.g, surfaceData.specularColor.b)); + #endif + + + + // compute world space normal + #if !_WORLDSPACENORMAL + surfaceData.normalWS = mul(surfaceDescription.Normal, fragInputs.tangentToWorld); + #else + surfaceData.normalWS = surfaceDescription.Normal; + #endif + + surfaceData.geomNormalWS = fragInputs.tangentToWorld[2]; + + surfaceData.tangentWS = normalize(fragInputs.tangentToWorld[0].xyz); // The tangent is not normalize in tangentToWorld for mikkt. TODO: Check if it expected that we normalize with Morten. Tag: SURFACE_GRADIENT + + + #if HAVE_DECALS + if (_EnableDecals) + { + float alpha = 1.0; + alpha = surfaceDescription.Alpha; + + // Both uses and modifies 'surfaceData.normalWS'. + DecalSurfaceData decalSurfaceData = GetDecalSurfaceData(posInput, fragInputs.tangentToWorld[2], alpha); + ApplyDecalToSurfaceData(decalSurfaceData, fragInputs.tangentToWorld[2], surfaceData); + } + #endif + + bentNormalWS = surfaceData.normalWS; + + surfaceData.tangentWS = Orthonormalize(surfaceData.tangentWS, surfaceData.normalWS); + + #ifdef DEBUG_DISPLAY + if (_DebugMipMapMode != DEBUGMIPMAPMODE_NONE) + { + // TODO: need to update mip info + surfaceData.metallic = 0; + } + + // We need to call ApplyDebugToSurfaceData after filling the surfarcedata and before filling builtinData + // as it can modify attribute use for static lighting + ApplyDebugToSurfaceData(fragInputs.tangentToWorld, surfaceData); + #endif + + // By default we use the ambient occlusion with Tri-ace trick (apply outside) for specular occlusion. + // If user provide bent normal then we process a better term + #if defined(_SPECULAR_OCCLUSION_CUSTOM) + // Just use the value passed through via the slot (not active otherwise) + #elif defined(_SPECULAR_OCCLUSION_FROM_AO_BENT_NORMAL) + // If we have bent normal and ambient occlusion, process a specular occlusion + surfaceData.specularOcclusion = GetSpecularOcclusionFromBentAO(V, bentNormalWS, surfaceData.normalWS, surfaceData.ambientOcclusion, PerceptualSmoothnessToPerceptualRoughness(surfaceData.perceptualSmoothness)); + #elif defined(_AMBIENT_OCCLUSION) && defined(_SPECULAR_OCCLUSION_FROM_AO) + surfaceData.specularOcclusion = GetSpecularOcclusionFromAmbientOcclusion(ClampNdotV(dot(surfaceData.normalWS, V)), surfaceData.ambientOcclusion, PerceptualSmoothnessToRoughness(surfaceData.perceptualSmoothness)); + #endif + + #if defined(_ENABLE_GEOMETRIC_SPECULAR_AA) && !defined(SHADER_STAGE_RAY_TRACING) + surfaceData.perceptualSmoothness = GeometricNormalFiltering(surfaceData.perceptualSmoothness, fragInputs.tangentToWorld[2], surfaceDescription.SpecularAAScreenSpaceVariance, surfaceDescription.SpecularAAThreshold); + #endif + } + + void GetSurfaceAndBuiltinData(VertexToPixel m2ps, FragInputs fragInputs, float3 V, inout PositionInputs posInput, + out SurfaceData surfaceData, out BuiltinData builtinData, inout Surface l, inout ShaderData d + #if NEED_FACING + , bool facing + #endif + ) + { + // Removed since crossfade does not work, probably needs extra material setup. + //#if !defined(SHADER_STAGE_RAY_TRACING) && !defined(_TESSELLATION_DISPLACEMENT) + // #ifdef LOD_FADE_CROSSFADE // enable dithering LOD transition if user select CrossFade transition in LOD group + // LODDitheringTransition(ComputeFadeMaskSeed(V, posInput.positionSS), unity_LODFade.x); + // #endif + //#endif + + d = CreateShaderData(m2ps + #if NEED_FACING + , facing + #endif + ); + + l = (Surface)0; + + l.Albedo = half3(0.5, 0.5, 0.5); + l.Normal = float3(0,0,1); + l.Occlusion = 1; + l.Alpha = 1; + l.SpecularOcclusion = 1; + + #if !defined(SHADER_STAGE_RAY_TRACING) && defined(_DEPTHOFFSET_ON) + l.outputDepth = d.clipPos.z; + #endif + + ChainSurfaceFunction(l, d); + + #if !defined(SHADER_STAGE_RAY_TRACING) && defined(_DEPTHOFFSET_ON) + //posInput.deviceDepth = l.outputDepth; + #endif + + #if _UNLIT + //l.Emission = l.Albedo; + //l.Albedo = 0; + l.Normal = half3(0,0,1); + l.Occlusion = 1; + l.Metallic = 0; + l.Specular = 0; + #endif + + surfaceData.geomNormalWS = d.worldSpaceNormal; + surfaceData.tangentWS = d.worldSpaceTangent; + fragInputs.tangentToWorld = d.TBNMatrix; + + float3 bentNormalWS; + BuildSurfaceData(fragInputs, l, V, posInput, surfaceData, bentNormalWS); + + + InitBuiltinData(posInput, l.Alpha, bentNormalWS, -d.worldSpaceNormal, fragInputs.texCoord1, fragInputs.texCoord2, builtinData); + + + + builtinData.emissiveColor = l.Emission; + + #if defined(_OVERRIDE_BAKEDGI) + builtinData.bakeDiffuseLighting = l.DiffuseGI; + builtinData.backBakeDiffuseLighting = l.BackDiffuseGI; + builtinData.emissiveColor += l.SpecularGI; + #endif + + #if defined(_OVERRIDE_SHADOWMASK) + builtinData.shadowMask0 = l.ShadowMask.x; + builtinData.shadowMask1 = l.ShadowMask.y; + builtinData.shadowMask2 = l.ShadowMask.z; + builtinData.shadowMask3 = l.ShadowMask.w; + #endif + + #if defined(UNITY_VIRTUAL_TEXTURING) + builtinData.vtPackedFeedback = surfaceData.VTPackedFeedback; + #endif + + #if (SHADERPASS == SHADERPASS_DISTORTION) + //builtinData.distortion = surfaceData.Distortion; + //builtinData.distortionBlur = surfaceData.DistortionBlur; + #endif + + #ifndef SHADER_UNLIT + // PostInitBuiltinData call ApplyDebugToBuiltinData + PostInitBuiltinData(V, posInput, surfaceData, builtinData); + #else + ApplyDebugToBuiltinData(builtinData); + #endif + + RAY_TRACING_OPTIONAL_ALPHA_TEST_PASS + } + + + + void Frag( VertexToPixel IN + #ifdef WRITE_NORMAL_BUFFER + , out float4 outNormalBuffer : SV_Target0 + #ifdef WRITE_MSAA_DEPTH + , out float1 depthColor : SV_Target1 + #endif + #elif defined(WRITE_MSAA_DEPTH) // When only WRITE_MSAA_DEPTH is define and not WRITE_NORMAL_BUFFER it mean we are Unlit and only need depth, but we still have normal buffer binded + , out float4 outNormalBuffer : SV_Target0 + , out float1 depthColor : SV_Target1 + #elif defined(SCENESELECTIONPASS) + , out float4 outColor : SV_Target0 + #endif + + #ifdef _DEPTHOFFSET_ON + , out float outputDepth : SV_Depth + #endif + #if NEED_FACING + , bool facing : SV_IsFrontFace + #endif + ) + { + UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX(IN); + FragInputs input = BuildFragInputs(IN); + + // input.positionSS is SV_Position + PositionInputs posInput = GetPositionInput(input.positionSS.xy, _ScreenSize.zw, input.positionSS.z, input.positionSS.w, input.positionRWS); + + + float3 V = GetWorldSpaceNormalizeViewDir(input.positionRWS); + + + SurfaceData surfaceData; + BuiltinData builtinData; + Surface l; + ShaderData d; + GetSurfaceAndBuiltinData(IN, input, V, posInput, surfaceData, builtinData, l, d + #if NEED_FACING + , facing + #endif + ); + + + #ifdef _DEPTHOFFSET_ON + outputDepth = l.outputDepth; + #endif + + #ifdef WRITE_NORMAL_BUFFER + EncodeIntoNormalBuffer(ConvertSurfaceDataToNormalData(surfaceData), posInput.positionSS, outNormalBuffer); + #ifdef WRITE_MSAA_DEPTH + // In case we are rendering in MSAA, reading the an MSAA depth buffer is way too expensive. To avoid that, we export the depth to a color buffer + depthColor = v2f.pos.z; + #endif + #elif defined(WRITE_MSAA_DEPTH) // When we are MSAA depth only without normal buffer + // Due to the binding order of these two render targets, we need to have them both declared + outNormalBuffer = float4(0.0, 0.0, 0.0, 1.0); + // In case we are rendering in MSAA, reading the an MSAA depth buffer is way too expensive. To avoid that, we export the depth to a color buffer + depthColor = v2f.pos.z; + #elif defined(SCENESELECTIONPASS) + // We use depth prepass for scene selection in the editor, this code allow to output the outline correctly + outColor = float4(_ObjectId, _PassValue, 1.0, 1.0); + #endif + } + + ENDHLSL + } + + + Pass + { + Name "ScenePickingPass" + Tags + { + "LightMode" = "Picking" + } + + Tags { "RenderType" = "Opaque" "Queue" = "Geometry" "PreviewType" = "Plane" } + Cull [_CullingOption] + ZWrite [_ZWrite] + ZTest [_ZTestMode] + + + //------------------------------------------------------------------------------------- + // End Render Modes + //------------------------------------------------------------------------------------- + + HLSLPROGRAM + + #pragma target 4.5 + #pragma only_renderers d3d11 playstation xboxone vulkan metal switch + #pragma multi_compile_instancing + #pragma editor_sync_compilation + #pragma instancing_options renderinglayer + + //#pragma shader_feature _ _SURFACE_TYPE_TRANSPARENT + //#pragma shader_feature_local _BLENDMODE_OFF _BLENDMODE_ALPHA _BLENDMODE_ADD _BLENDMODE_PRE_MULTIPLY + //#pragma shader_feature_local _ _ADD_PRECOMPUTED_VELOCITY + //#pragma shader_feature_local _ _TRANSPARENT_WRITES_MOTION_VEC + //#pragma shader_feature_local _ _ENABLE_FOG_ON_TRANSPARENT + //#pragma shader_feature_local _ _DISABLE_DECALS + //#pragma shader_feature_local _ _DISABLE_SSR + //#pragma shader_feature_local _ _DISABLE_SSR_TRANSPARENT + //#pragma shader_feature_local _REFRACTION_OFF _REFRACTION_PLANE _REFRACTION_SPHERE _REFRACTION_THIN + #pragma multi_compile _ WRITE_DECAL_BUFFER + + + #define SHADERPASS SHADERPASS_DEPTH_ONLY + #define SCENEPICKINGPASS + + + + #pragma shader_feature_local GLOW_ON + #pragma shader_feature_local FADE_ON + #pragma shader_feature_local OUTBASE_ON + #pragma shader_feature_local ONLYOUTLINE_ON + #pragma shader_feature_local GRADIENT_ON + #pragma shader_feature_local GRADIENT2COL_ON + #pragma shader_feature_local RADIALGRADIENT_ON + #pragma shader_feature_local COLORSWAP_ON + #pragma shader_feature_local HSV_ON + #pragma shader_feature_local CHANGECOLOR_ON + #pragma shader_feature_local CHANGECOLOR2_ON + #pragma shader_feature_local CHANGECOLOR3_ON + #pragma shader_feature_local COLORRAMP_ON + #pragma shader_feature_local GRADIENTCOLORRAMP_ON + #pragma shader_feature_local HITEFFECT_ON + #pragma shader_feature_local NEGATIVE_ON + #pragma shader_feature_local PIXELATE_ON + #pragma shader_feature_local GREYSCALE_ON + #pragma shader_feature_local POSTERIZE_ON + #pragma shader_feature_local BLUR_ON + #pragma shader_feature_local MOTIONBLUR_ON + #pragma shader_feature_local GHOST_ON + #pragma shader_feature_local ALPHAOUTLINE_ON + #pragma shader_feature_local INNEROUTLINE_ON + #pragma shader_feature_local ONLYINNEROUTLINE_ON + #pragma shader_feature_local HOLOGRAM_ON + #pragma shader_feature_local CHROMABERR_ON + #pragma shader_feature_local GLITCH_ON + #pragma shader_feature_local FLICKER_ON + #pragma shader_feature_local SHADOW_ON + #pragma shader_feature_local SHINE_ON + #pragma shader_feature_local CONTRAST_ON + #pragma shader_feature_local OVERLAY_ON + #pragma shader_feature_local OVERLAYMULT_ON + #pragma shader_feature_local DOODLE_ON + #pragma shader_feature_local WIND_ON + #pragma shader_feature_local WAVEUV_ON + #pragma shader_feature_local ROUNDWAVEUV_ON + #pragma shader_feature_local RECTSIZE_ON + #pragma shader_feature_local OFFSETUV_ON + #pragma shader_feature_local CLIPPING_ON + #pragma shader_feature_local RADIALCLIPPING_ON + #pragma shader_feature_local TEXTURESCROLL_ON + #pragma shader_feature_local ZOOMUV_ON + #pragma shader_feature_local DISTORT_ON + #pragma shader_feature_local WARP_ON + #pragma shader_feature_local TWISTUV_ON + #pragma shader_feature_local ROTATEUV_ON + #pragma shader_feature_local POLARUV_ON + #pragma shader_feature_local FISHEYE_ON + #pragma shader_feature_local PINCH_ON + #pragma shader_feature_local SHAKEUV_ON + + #pragma shader_feature_local GLOWTEX_ON + #pragma shader_feature_local OUTTEX_ON + #pragma shader_feature_local OUTDIST_ON + #pragma shader_feature_local OUTBASE8DIR_ON + #pragma shader_feature_local OUTBASEPIXELPERF_ON + #pragma shader_feature_local COLORRAMPOUTLINE_ON + #pragma shader_feature_local GREYSCALEOUTLINE_ON + #pragma shader_feature_local POSTERIZEOUTLINE_ON + #pragma shader_feature_local BLURISHD_ON + #pragma shader_feature_local MANUALWIND_ON + #pragma shader_feature_local ATLAS_ON + #pragma shader_feature_local PREMULTIPLYALPHA_ON + + #pragma shader_feature BILBOARD_ON + #pragma shader_feature BILBOARDY_ON + + #pragma shader_feature NORMALMAP_ON + + + #define _HDRP 1 +#define _USINGTEXCOORD1 1 +#define _USINGTEXCOORD2 1 + + + #pragma vertex Vert + #pragma fragment Frag + + // useful conversion functions to make surface shader code just work + + #define UNITY_DECLARE_TEX2D(name) TEXTURE2D(name); SAMPLER(sampler##name); + #define UNITY_DECLARE_TEX2D_NOSAMPLER(name) TEXTURE2D(name); + #define UNITY_DECLARE_TEX2DARRAY(name) TEXTURE2D_ARRAY(name); SAMPLER(sampler##name); + #define UNITY_DECLARE_TEX2DARRAY_NOSAMPLER(tex) TEXTURE2D_ARRAY(tex); + + #define UNITY_SAMPLE_TEX2DARRAY(tex,coord) SAMPLE_TEXTURE2D_ARRAY(tex, sampler##tex, coord.xy, coord.z) + #define UNITY_SAMPLE_TEX2DARRAY_LOD(tex,coord,lod) SAMPLE_TEXTURE2D_ARRAY_LOD(tex, sampler##tex, coord.xy, coord.z, lod) + #define UNITY_SAMPLE_TEX2D(tex, coord) SAMPLE_TEXTURE2D(tex, sampler##tex, coord) + #define UNITY_SAMPLE_TEX2D_SAMPLER(tex, samp, coord) SAMPLE_TEXTURE2D(tex, sampler##samp, coord) + + #define UNITY_SAMPLE_TEX2D_LOD(tex,coord, lod) SAMPLE_TEXTURE2D_LOD(tex, sampler_##tex, coord, lod) + #define UNITY_SAMPLE_TEX2D_SAMPLER_LOD(tex,samplertex,coord, lod) SAMPLE_TEXTURE2D_LOD (tex, sampler##samplertex,coord, lod) + + #if defined(UNITY_COMPILER_HLSL) + #define UNITY_INITIALIZE_OUTPUT(type,name) name = (type)0; + #else + #define UNITY_INITIALIZE_OUTPUT(type,name) + #endif + + #define sampler2D_float sampler2D + #define sampler2D_half sampler2D + + #undef WorldNormalVector + #define WorldNormalVector(data, normal) mul(normal, data.TBNMatrix) + + #define UnityObjectToWorldNormal(normal) mul(GetObjectToWorldMatrix(), normal) + + + + +// HDRP Adapter stuff + #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Common.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/ShaderVariables.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/ShaderPass/FragInputs.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/ShaderPass/ShaderPass.cs.hlsl" + #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/TextureStack.hlsl" // Required to be include before we include properties as it define DECLARE_STACK_CB + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/ShaderGraphHeader.hlsl" // Need to be here for Gradient struct definition + + #ifdef RAYTRACING_SHADER_GRAPH_DEFAULT + #define RAYTRACING_SHADER_GRAPH_HIGH + #endif + + #ifdef RAYTRACING_SHADER_GRAPH_RAYTRACED + #define RAYTRACING_SHADER_GRAPH_LOW + #endif + // end + + + + + // If we use subsurface scattering, enable output split lighting (for forward pass) + #if defined(_MATERIAL_FEATURE_SUBSURFACE_SCATTERING) && !defined(_SURFACE_TYPE_TRANSPARENT) + #define OUTPUT_SPLIT_LIGHTING + #endif + + #define HAVE_RECURSIVE_RENDERING + + #if SHADERPASS == SHADERPASS_TRANSPARENT_DEPTH_PREPASS + #if !defined(_DISABLE_SSR_TRANSPARENT) && !defined(SHADER_UNLIT) + #define WRITE_NORMAL_BUFFER + #endif + #endif + + #ifndef DEBUG_DISPLAY + // In case of opaque we don't want to perform the alpha test, it is done in depth prepass and we use depth equal for ztest (setup from UI) + // Don't do it with debug display mode as it is possible there is no depth prepass in this case + #if !defined(_SURFACE_TYPE_TRANSPARENT) && defined(_ALPHATEST) + #if SHADERPASS == SHADERPASS_FORWARD + #define SHADERPASS_FORWARD_BYPASS_ALPHA_TEST + #elif SHADERPASS == SHADERPASS_GBUFFER + #define SHADERPASS_GBUFFER_BYPASS_ALPHA_TEST + #endif + #endif + #endif + + // Translate transparent motion vector define + #if defined(_TRANSPARENT_WRITES_MOTION_VEC) && defined(_SURFACE_TYPE_TRANSPARENT) + #define _WRITE_TRANSPARENT_MOTION_VECTOR + #endif + + + + + CBUFFER_START(UnityPerMaterial) + float _UseShadowThreshold; + float _BlendMode; + float _EnableBlendModePreserveSpecularLighting; + float _RayTracing; + float _RefractionModel; + + + half4 _Color; + half4 _MainTex_ST, _MainTex_TexelSize; + half _Alpha, _AlphaCutoffValue; + + #if ATLAS_ON + half _MinXUV, _MaxXUV, _MinYUV, _MaxYUV; + #endif + + #if GLOW_ON + half4 _GlowColor; + half _Glow, _GlowGlobal; + #endif + + #if HSV_ON + half _HsvShift, _HsvSaturation, _HsvBright; + #endif + + #if DISTORT_ON + half4 _DistortTex_ST; + half _DistortTexXSpeed, _DistortTexYSpeed, _DistortAmount; + #endif + + #if FADE_ON + half4 _FadeBurnColor, _FadeTex_ST, _FadeBurnTex_ST; + half _FadeAmount, _FadeBurnWidth, _FadeBurnTransition,_FadeBurnGlow; + #endif + + #if OUTBASE_ON + half4 _OutlineColor; + half _OutlineAlpha, _OutlineGlow, _OutlineWidth; + int _OutlinePixelWidth; + #endif + + #if OUTTEX_ON + half4 _OutlineTex_ST; + half _OutlineTexXSpeed, _OutlineTexYSpeed; + #endif + + #if OUTDIST_ON + half4 _OutlineDistortTex_ST; + half _OutlineDistortTexXSpeed, _OutlineDistortTexYSpeed, _OutlineDistortAmount; + #endif + + #if ALPHAOUTLINE_ON + half _AlphaOutlineGlow, _AlphaOutlinePower, _AlphaOutlineMinAlpha, _AlphaOutlineBlend; + half4 _AlphaOutlineColor; + #endif + + #if INNEROUTLINE_ON + half _InnerOutlineThickness, _InnerOutlineAlpha, _InnerOutlineGlow; + half4 _InnerOutlineColor; + #endif + + #if GRADIENT_ON + half _GradBlend, _GradBoostX, _GradBoostY; + half4 _GradTopRightCol, _GradTopLeftCol, _GradBotRightCol, _GradBotLeftCol; + #endif + + #if COLORSWAP_ON + half4 _ColorSwapRed, _ColorSwapGreen, _ColorSwapBlue; + half _ColorSwapRedLuminosity, _ColorSwapGreenLuminosity, _ColorSwapBlueLuminosity, _ColorSwapBlend; + #endif + + #if CHANGECOLOR_ON + half4 _ColorChangeNewCol, _ColorChangeTarget; + half _ColorChangeTolerance, _ColorChangeLuminosity; + #endif + #if CHANGECOLOR2_ON + half4 _ColorChangeNewCol2, _ColorChangeTarget2; + half _ColorChangeTolerance2; + #endif + #if CHANGECOLOR3_ON + half4 _ColorChangeNewCol3, _ColorChangeTarget3; + half _ColorChangeTolerance3; + #endif + + #if COLORRAMP_ON + half _ColorRampLuminosity, _ColorRampBlend; + #endif + + #if HITEFFECT_ON + half4 _HitEffectColor; + half _HitEffectGlow, _HitEffectBlend; + #endif + + #if NEGATIVE_ON + half _NegativeAmount; + #endif + + #if PIXELATE_ON + half _PixelateSize; + #endif + + #if GREYSCALE_ON + half _GreyscaleLuminosity, _GreyscaleBlend; + half4 _GreyscaleTintColor; + #endif + + #if POSTERIZE_ON + half _PosterizeNumColors, _PosterizeGamma; + #endif + + #if BLUR_ON + half _BlurIntensity; + #endif + + #if MOTIONBLUR_ON + half _MotionBlurAngle, _MotionBlurDist; + #endif + + #if GHOST_ON + half _GhostColorBoost, _GhostTransparency, _GhostBlend; + #endif + + #if HOLOGRAM_ON + half _HologramStripesAmount, _HologramMinAlpha, _HologramUnmodAmount, _HologramStripesSpeed, _HologramMaxAlpha, _HologramBlend; + half4 _HologramStripeColor; + #endif + + #if CHROMABERR_ON + half _ChromAberrAmount, _ChromAberrAlpha; + #endif + + #if GLITCH_ON + half _GlitchAmount, _GlitchSize; + #endif + + #if FLICKER_ON + half _FlickerFreq, _FlickerPercent, _FlickerAlpha; + #endif + + #if SHADOW_ON + half _ShadowX, _ShadowY, _ShadowAlpha; + half4 _ShadowColor; + #endif + + #if SHINE_ON + half4 _ShineColor; + half _ShineLocation, _ShineRotate, _ShineWidth, _ShineGlow; + #endif + + #if CONTRAST_ON + half _Contrast, _Brightness; + #endif + + #if OVERLAY_ON + half4 _OverlayTex_ST, _OverlayColor; + half _OverlayGlow, _OverlayBlend, _OverlayTextureScrollXSpeed, _OverlayTextureScrollYSpeed; + #endif + + #if DOODLE_ON + half _HandDrawnAmount, _HandDrawnSpeed; + #endif + + #if WIND_ON + half _GrassSpeed, _GrassWind, _GrassManualAnim, _GrassRadialBend; + #endif + + #if WAVEUV_ON + float _WaveAmount, _WaveSpeed, _WaveStrength, _WaveX, _WaveY; + #endif + + #if ROUNDWAVEUV_ON + half _RoundWaveStrength, _RoundWaveSpeed; + #endif + + #if RECTSIZE_ON + half _RectSize; + #endif + + #if OFFSETUV_ON + half _OffsetUvX, _OffsetUvY; + #endif + + #if CLIPPING_ON + half _ClipUvLeft, _ClipUvRight, _ClipUvUp, _ClipUvDown; + #endif + + #if RADIALCLIPPING_ON + half _RadialStartAngle, _RadialClip, _RadialClip2; + #endif + + #if TEXTURESCROLL_ON + half _TextureScrollXSpeed, _TextureScrollYSpeed; + #endif + + #if ZOOMUV_ON + half _ZoomUvAmount; + #endif + + #if WARP_ON + half _WarpStrength, _WarpSpeed, _WarpScale; + #endif + + #if TWISTUV_ON + half _TwistUvAmount, _TwistUvPosX, _TwistUvPosY, _TwistUvRadius; + #endif + + #if ROTATEUV_ON + half _RotateUvAmount; + #endif + + #if FISHEYE_ON + half _FishEyeUvAmount; + #endif + + #if PINCH_ON + half _PinchUvAmount; + #endif + + #if SHAKEUV_ON + half _ShakeUvSpeed, _ShakeUvX, _ShakeUvY; + #endif + + #if NORMALMAP_ON + half _NormalStrength; + #endif + + float _RandomSeed; + + + + + CBUFFER_END + + + + // -- Property used by ScenePickingPass + #ifdef SCENEPICKINGPASS + float4 _SelectionID; + #endif + + // -- Properties used by SceneSelectionPass + #ifdef SCENESELECTIONPASS + int _ObjectId; + int _PassValue; + #endif + + + // data across stages, stripped like the above. + struct VertexToPixel + { + float4 pos : SV_POSITION; + float3 worldPos : TEXCOORD0; + float3 worldNormal : TEXCOORD1; + float4 worldTangent : TEXCOORD2; + float4 texcoord0 : TEXCOORD3; + float4 texcoord1 : TEXCOORD4; + float4 texcoord2 : TEXCOORD5; + // #if %TEXCOORD3REQUIREKEY% + float4 texcoord3 : TEXCOORD6; + // #endif + + // #if %SCREENPOSREQUIREKEY% + // float4 screenPos : TEXCOORD7; + // #endif + + // #if %VERTEXCOLORREQUIREKEY% + float4 vertexColor : COLOR; + // #endif + + // #if %EXTRAV2F0REQUIREKEY% + // float4 extraV2F0 : TEXCOORD8; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // float4 extraV2F1 : TEXCOORD9; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // float4 extraV2F2 : TEXCOORD10; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // float4 extraV2F3 : TEXCOORD11; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // float4 extraV2F4 : TEXCOORD12; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // float4 extraV2F5 : TEXCOORD13; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // float4 extraV2F6 : TEXCOORD14; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // float4 extraV2F7 : TEXCOORD15; + // #endif + + #if UNITY_ANY_INSTANCING_ENABLED + UNITY_VERTEX_INPUT_INSTANCE_ID + #endif // UNITY_ANY_INSTANCING_ENABLED + + #if _HDRP && (_PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR))) + float4 previousPositionCS : TEXCOORD16; // Contain previous transform position (in case of skinning for example) + float4 motionVectorCS : TEXCOORD17; + #endif + + UNITY_VERTEX_OUTPUT_STEREO + }; + + + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Debug/DebugDisplay.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/Material.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/Lit/Lit.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/BuiltinUtilities.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/MaterialUtilities.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/ShaderGraphFunctions.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/PickingSpaceTransforms.hlsl" + + + + + // data describing the user output of a pixel + struct Surface + { + half3 Albedo; + half Height; + half3 Normal; + half Smoothness; + half3 Emission; + half Metallic; + half3 Specular; + half Occlusion; + half SpecularPower; // for simple lighting + half Alpha; + float outputDepth; // if written, SV_Depth semantic is used. ShaderData.clipPos.z is unused value + // HDRP Only + half SpecularOcclusion; + half SubsurfaceMask; + half Thickness; + half CoatMask; + half CoatSmoothness; + half Anisotropy; + half IridescenceMask; + half IridescenceThickness; + int DiffusionProfileHash; + float SpecularAAThreshold; + float SpecularAAScreenSpaceVariance; + // requires _OVERRIDE_BAKEDGI to be defined, but is mapped in all pipelines + float3 DiffuseGI; + float3 BackDiffuseGI; + float3 SpecularGI; + float ior; + float3 transmittanceColor; + float atDistance; + float transmittanceMask; + // requires _OVERRIDE_SHADOWMASK to be defines + float4 ShadowMask; + + // for decals + float NormalAlpha; + float MAOSAlpha; + + + }; + + // Data the user declares in blackboard blocks + struct Blackboard + { + + float blackboardDummyData; + }; + + // data the user might need, this will grow to be big. But easy to strip + struct ShaderData + { + float4 clipPos; // SV_POSITION + float3 localSpacePosition; + float3 localSpaceNormal; + float3 localSpaceTangent; + + float3 worldSpacePosition; + float3 worldSpaceNormal; + float3 worldSpaceTangent; + float tangentSign; + + float3 worldSpaceViewDir; + float3 tangentSpaceViewDir; + + float4 texcoord0; + float4 texcoord1; + float4 texcoord2; + float4 texcoord3; + + float2 screenUV; + float4 screenPos; + + float4 vertexColor; + bool isFrontFace; + + float4 extraV2F0; + float4 extraV2F1; + float4 extraV2F2; + float4 extraV2F3; + float4 extraV2F4; + float4 extraV2F5; + float4 extraV2F6; + float4 extraV2F7; + + float3x3 TBNMatrix; + Blackboard blackboard; + }; + + struct VertexData + { + #if SHADER_TARGET > 30 + // uint vertexID : SV_VertexID; + #endif + float4 vertex : POSITION; + float3 normal : NORMAL; + float4 tangent : TANGENT; + float4 texcoord0 : TEXCOORD0; + + // optimize out mesh coords when not in use by user or lighting system + #if _URP && (_USINGTEXCOORD1 || _PASSMETA || _PASSFORWARD || _PASSGBUFFER) + float4 texcoord1 : TEXCOORD1; + #endif + + #if _URP && (_USINGTEXCOORD2 || _PASSMETA || ((_PASSFORWARD || _PASSGBUFFER) && defined(DYNAMICLIGHTMAP_ON))) + float4 texcoord2 : TEXCOORD2; + #endif + + #if _STANDARD && (_USINGTEXCOORD1 || (_PASSMETA || ((_PASSFORWARD || _PASSGBUFFER || _PASSFORWARDADD) && LIGHTMAP_ON))) + float4 texcoord1 : TEXCOORD1; + #endif + #if _STANDARD && (_USINGTEXCOORD2 || (_PASSMETA || ((_PASSFORWARD || _PASSGBUFFER) && DYNAMICLIGHTMAP_ON))) + float4 texcoord2 : TEXCOORD2; + #endif + + + #if _HDRP + float4 texcoord1 : TEXCOORD1; + float4 texcoord2 : TEXCOORD2; + #endif + + // #if %TEXCOORD3REQUIREKEY% + float4 texcoord3 : TEXCOORD3; + // #endif + + // #if %VERTEXCOLORREQUIREKEY% + float4 vertexColor : COLOR; + // #endif + + #if _PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR)) + float3 previousPositionOS : TEXCOORD4; // Contain previous transform position (in case of skinning for example) + #if defined (_ADD_PRECOMPUTED_VELOCITY) + float3 precomputedVelocity : TEXCOORD5; // Add Precomputed Velocity (Alembic computes velocities on runtime side). + #endif + #endif + + UNITY_VERTEX_INPUT_INSTANCE_ID + }; + + struct TessVertex + { + float4 vertex : INTERNALTESSPOS; + float3 normal : NORMAL; + float4 tangent : TANGENT; + float4 texcoord0 : TEXCOORD0; + float4 texcoord1 : TEXCOORD1; + float4 texcoord2 : TEXCOORD2; + + // #if %TEXCOORD3REQUIREKEY% + float4 texcoord3 : TEXCOORD3; + // #endif + + // #if %VERTEXCOLORREQUIREKEY% + float4 vertexColor : COLOR; + // #endif + + // #if %EXTRAV2F0REQUIREKEY% + // float4 extraV2F0 : TEXCOORD5; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // float4 extraV2F1 : TEXCOORD6; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // float4 extraV2F2 : TEXCOORD7; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // float4 extraV2F3 : TEXCOORD8; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // float4 extraV2F4 : TEXCOORD9; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // float4 extraV2F5 : TEXCOORD10; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // float4 extraV2F6 : TEXCOORD11; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // float4 extraV2F7 : TEXCOORD12; + // #endif + + #if _PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR)) + float3 previousPositionOS : TEXCOORD13; // Contain previous transform position (in case of skinning for example) + #if defined (_ADD_PRECOMPUTED_VELOCITY) + float3 precomputedVelocity : TEXCOORD14; + #endif + #endif + + UNITY_VERTEX_INPUT_INSTANCE_ID + UNITY_VERTEX_OUTPUT_STEREO + }; + + struct ExtraV2F + { + float4 extraV2F0; + float4 extraV2F1; + float4 extraV2F2; + float4 extraV2F3; + float4 extraV2F4; + float4 extraV2F5; + float4 extraV2F6; + float4 extraV2F7; + Blackboard blackboard; + float4 time; + }; + + + float3 WorldToTangentSpace(ShaderData d, float3 normal) + { + return mul(d.TBNMatrix, normal); + } + + float3 TangentToWorldSpace(ShaderData d, float3 normal) + { + return mul(normal, d.TBNMatrix); + } + + // in this case, make standard more like SRPs, because we can't fix + // unity_WorldToObject in HDRP, since it already does macro-fu there + + #if _STANDARD + float3 TransformWorldToObject(float3 p) { return mul(unity_WorldToObject, float4(p, 1)); }; + float3 TransformObjectToWorld(float3 p) { return mul(unity_ObjectToWorld, float4(p, 1)); }; + float4 TransformWorldToObject(float4 p) { return mul(unity_WorldToObject, p); }; + float4 TransformObjectToWorld(float4 p) { return mul(unity_ObjectToWorld, p); }; + float4x4 GetWorldToObjectMatrix() { return unity_WorldToObject; } + float4x4 GetObjectToWorldMatrix() { return unity_ObjectToWorld; } + #if (defined(SHADER_API_D3D11) || defined(SHADER_API_XBOXONE) || defined(UNITY_COMPILER_HLSLCC) || defined(SHADER_API_PSSL) || (SHADER_TARGET_SURFACE_ANALYSIS && !SHADER_TARGET_SURFACE_ANALYSIS_MOJOSHADER)) + #define UNITY_SAMPLE_TEX2D_LOD(tex,coord, lod) tex.SampleLevel (sampler##tex,coord, lod) + #define UNITY_SAMPLE_TEX2D_SAMPLER_LOD(tex,samplertex,coord, lod) tex.SampleLevel (sampler##samplertex,coord, lod) + #else + #define UNITY_SAMPLE_TEX2D_LOD(tex,coord,lod) tex2D (tex,coord,0,lod) + #define UNITY_SAMPLE_TEX2D_SAMPLER_LOD(tex,samplertex,coord,lod) tex2D (tex,coord,0,lod) + #endif + + #undef GetWorldToObjectMatrix() + + #define GetWorldToObjectMatrix() unity_WorldToObject + + + #endif + + float3 GetCameraWorldPosition() + { + #if _HDRP + return GetCameraRelativePositionWS(_WorldSpaceCameraPos); + #else + return _WorldSpaceCameraPos; + #endif + } + + #if _GRABPASSUSED + #if _STANDARD + TEXTURE2D(%GRABTEXTURE%); + SAMPLER(sampler_%GRABTEXTURE%); + #endif + + half3 GetSceneColor(float2 uv) + { + #if _STANDARD + return SAMPLE_TEXTURE2D(%GRABTEXTURE%, sampler_%GRABTEXTURE%, uv).rgb; + #else + return SHADERGRAPH_SAMPLE_SCENE_COLOR(uv); + #endif + } + #endif + + + + #if _STANDARD + UNITY_DECLARE_DEPTH_TEXTURE(_CameraDepthTexture); + float GetSceneDepth(float2 uv) { return SAMPLE_DEPTH_TEXTURE(_CameraDepthTexture, uv); } + float GetLinear01Depth(float2 uv) { return Linear01Depth(GetSceneDepth(uv)); } + float GetLinearEyeDepth(float2 uv) { return LinearEyeDepth(GetSceneDepth(uv)); } + #else + float GetSceneDepth(float2 uv) { return SHADERGRAPH_SAMPLE_SCENE_DEPTH(uv); } + float GetLinear01Depth(float2 uv) { return Linear01Depth(GetSceneDepth(uv), _ZBufferParams); } + float GetLinearEyeDepth(float2 uv) { return LinearEyeDepth(GetSceneDepth(uv), _ZBufferParams); } + #endif + + float3 GetWorldPositionFromDepthBuffer(float2 uv, float3 worldSpaceViewDir) + { + float eye = GetLinearEyeDepth(uv); + float3 camView = mul((float3x3)GetObjectToWorldMatrix(), transpose(mul(GetWorldToObjectMatrix(), UNITY_MATRIX_I_V)) [2].xyz); + + float dt = dot(worldSpaceViewDir, camView); + float3 div = worldSpaceViewDir/dt; + float3 wpos = (eye * div) + GetCameraWorldPosition(); + return wpos; + } + + #if _HDRP + float3 ObjectToWorldSpacePosition(float3 pos) + { + return GetAbsolutePositionWS(TransformObjectToWorld(pos)); + } + #else + float3 ObjectToWorldSpacePosition(float3 pos) + { + return TransformObjectToWorld(pos); + } + #endif + + #if _STANDARD + UNITY_DECLARE_SCREENSPACE_TEXTURE(_CameraDepthNormalsTexture); + float3 GetSceneNormal(float2 uv, float3 worldSpaceViewDir) + { + float4 depthNorms = UNITY_SAMPLE_SCREENSPACE_TEXTURE(_CameraDepthNormalsTexture, uv); + float3 norms = DecodeViewNormalStereo(depthNorms); + norms = mul((float3x3)GetWorldToViewMatrix(), norms) * 0.5 + 0.5; + return norms; + } + #elif _HDRP && !_DECALSHADER + + float3 GetSceneNormal(float2 uv, float3 worldSpaceViewDir) + { + NormalData nd; + DecodeFromNormalBuffer(_ScreenSize.xy * uv, nd); + return nd.normalWS; + } + #elif _URP + #if (SHADER_LIBRARY_VERSION_MAJOR >= 10) + #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/DeclareNormalsTexture.hlsl" + #endif + + float3 GetSceneNormal(float2 uv, float3 worldSpaceViewDir) + { + #if (SHADER_LIBRARY_VERSION_MAJOR >= 10) + return SampleSceneNormals(uv); + #else + float3 wpos = GetWorldPositionFromDepthBuffer(uv, worldSpaceViewDir); + return normalize(-cross(ddx(wpos), ddy(wpos))) * 0.5 + 0.5; + #endif + + } + #endif + + #if _HDRP + + half3 UnpackNormalmapRGorAG(half4 packednormal) + { + // This do the trick + packednormal.x *= packednormal.w; + + half3 normal; + normal.xy = packednormal.xy * 2 - 1; + normal.z = sqrt(1 - saturate(dot(normal.xy, normal.xy))); + return normal; + } + half3 UnpackNormal(half4 packednormal) + { + #if defined(UNITY_NO_DXT5nm) + return packednormal.xyz * 2 - 1; + #else + return UnpackNormalmapRGorAG(packednormal); + #endif + } + #endif + #if _HDRP || _URP + + half3 UnpackScaleNormal(half4 packednormal, half scale) + { + #ifndef UNITY_NO_DXT5nm + // Unpack normal as DXT5nm (1, y, 1, x) or BC5 (x, y, 0, 1) + // Note neutral texture like "bump" is (0, 0, 1, 1) to work with both plain RGB normal and DXT5nm/BC5 + packednormal.x *= packednormal.w; + #endif + half3 normal; + normal.xy = (packednormal.xy * 2 - 1) * scale; + normal.z = sqrt(1 - saturate(dot(normal.xy, normal.xy))); + return normal; + } + + #endif + + + void GetSun(out float3 lightDir, out float3 color) + { + lightDir = float3(0.5, 0.5, 0); + color = 1; + #if _HDRP + if (_DirectionalLightCount > 0) + { + DirectionalLightData light = _DirectionalLightDatas[0]; + lightDir = -light.forward.xyz; + color = light.color; + } + #elif _STANDARD + lightDir = normalize(_WorldSpaceLightPos0.xyz); + color = _LightColor0.rgb; + #elif _URP + Light light = GetMainLight(); + lightDir = light.direction; + color = light.color; + #endif + } + + + + + + + + + + TEXTURE2D(_MainTex); + SAMPLER(sampler_MainTex); + + #if GLOW_ON + TEXTURE2D(_GlowTex); + SAMPLER(sampler_GlowTex); + #endif + + #if FADE_ON + TEXTURE2D(_FadeTex); + SAMPLER(sampler_FadeTex); + + TEXTURE2D(_FadeBurnTex); + SAMPLER(sampler_FadeBurnTex); + #endif + + #if DISTORT_ON + TEXTURE2D(_DistortTex); + SAMPLER(sampler_DistortTex); + #endif + + #if OUTTEX_ON + TEXTURE2D(_OutlineTex); + SAMPLER(sampler_OutlineTex); + #endif + + #if OUTDIST_ON + TEXTURE2D(_OutlineDistortTex); + SAMPLER(sampler_OutlineDistortTex); + #endif + + #if COLORSWAP_ON + TEXTURE2D(_ColorSwapTex); + SAMPLER(sampler_ColorSwapTex); + #endif + + #if COLORRAMP_ON + TEXTURE2D(_ColorRampTex); + TEXTURE2D(_ColorRampTexGradient); + SAMPLER(sampler_ColorRampTex); + SAMPLER(sampler_ColorRampTexGradient); + #endif + + #if SHINE_ON + TEXTURE2D(_ShineMask); + SAMPLER(sampler_ShineMask); + #endif + + #if OVERLAY_ON + TEXTURE2D(_OverlayTex); + SAMPLER(sampler_OverlayTex); + #endif + + #if NORMALMAP_ON + TEXTURE2D(_NormalMap); + SAMPLER(sampler_NormalMap); + #endif + + + half3 GetPixel(in int offsetX, in int offsetY, in half2 uv, in Texture2D _tex, in SamplerState _sampler) + { + half2 _uv = uv + half2(offsetX * _MainTex_TexelSize.x, offsetY * _MainTex_TexelSize.y); + half4 col = SAMPLE_TEXTURE2D(_tex, _sampler, _uv); + return col.rgb; + } + + + //BLURS------------------------------------------------------------------------- + half4 Blur(half2 uv, Texture2D source, SamplerState sampler_source, half Intensity) + { + const half2 texelSize = 1.0 / _ScreenParams.xy; + const half4 color = SAMPLE_TEXTURE2D(source, sampler_source, uv); + const half2 offset = Intensity * texelSize; + + half4 accumulatedColor = color; + half accumulatedWeight = 1.0; + for (int x = -1; x <= 1; x++) + { + for (int y = -1; y <= 1; y++) + { + const half2 sampleUV = uv + half2(x, y) * offset; + const half4 sampleColor = SAMPLE_TEXTURE2D(source, sampler_source, sampleUV); + + accumulatedColor += sampleColor; + accumulatedWeight += 1.0; + } + } + + half4 blurredColor = accumulatedColor / accumulatedWeight; + return blurredColor; + } + + half BlurHD_G(half bhqp, half x) + { + return exp(-(x * x) / (2.0 * bhqp * bhqp)); + } + half4 BlurHD(half2 uv, Texture2D source, SamplerState sampler_source, half BlurAmount, half xScale, half yScale) + { + int iterations = 16; + int halfIterations = iterations / 2; + half sigmaX = 0.1 + BlurAmount * 0.5; + half sigmaY = sigmaX; + half total = 0.0; + half4 ret = half4(0, 0, 0, 0); + for (int iy = 0; iy < iterations; ++iy) + { + half fy = BlurHD_G(sigmaY, half(iy) -half(halfIterations)); + half offsetY = half(iy - halfIterations) * 0.00390625 * xScale; + for (int ix = 0; ix < iterations; ++ix) + { + half fx = BlurHD_G(sigmaX, half(ix) - half(halfIterations)); + half offsetX = half(ix - halfIterations) * 0.00390625 * yScale; + total += fx * fy; + ret += SAMPLE_TEXTURE2D(source, sampler_source, uv + half2(offsetX, offsetY)) * fx * fy; + } + } + return ret / total; + } + //----------------------------------------------------------------------- + + + //------------------------------------------- + half RemapFloat(half inValue, half inMin, half inMax, half outMin, half outMax){ + return outMin + (inValue - inMin) * (outMax - outMin) / (inMax - inMin); + } + //------------------------------------------- + + //----------------------------------------------------------------------- + half rand(half2 seed, half offset) { + return (frac(sin(dot(seed, half2(12.9898, 78.233))) * 43758.5453) + offset) % 1.0; + } + + half rand2(half2 seed, half offset) { + return (frac(sin(dot(seed * floor(50 + (_Time.x % 1.0) * 12.), half2(127.1, 311.7))) * 43758.5453123) + offset) % 1.0; + } + + half rand2CustomTime(half2 seed, half offset, half customTime) { + return (frac(sin(dot(seed * floor(50 + (customTime % 1.0) * 12.), half2(127.1, 311.7))) * 43758.5453123) + offset) % 1.0; + } + //----------------------------------------------------------------------- + + + void Ext_ModifyVertex0 (inout VertexData v, inout ExtraV2F d) + { + //BILBOARD_ON + #if BILBOARD_ON + half3 camRight = mul((half3x3)unity_CameraToWorld, half3(1,0,0)); + half3 camUp = half3(0,1,0); + #if BILBOARDY_ON + camUp = mul((half3x3)unity_CameraToWorld, half3(0,1,0)); + #endif + half3 localPos = v.vertex.x * camRight + v.vertex.y * camUp; + v.vertex = half4(localPos, 1); + #endif + //----------------------------------------------------------- + + v.texcoord0.xy = TRANSFORM_TEX(v.texcoord0.xy, _MainTex); + half2 center = half2(0.5, 0.5); + #if ATLAS_ON + center = half2((_MaxXUV + _MinXUV) / 2.0, (_MaxYUV + _MinYUV) / 2.0); + #endif + + //POLARUV_ON + #if POLARUV_ON + v.texcoord0.xy = v.texcoord0.xy - center; + #endif + + //---------------------------------------- + + //ROTATEUV_ON + #if ROTATEUV_ON + half2 uvC = v.texcoord0.xy; + half cosAngle = cos(_RotateUvAmount); + half sinAngle = sin(_RotateUvAmount); + half2x2 rot = half2x2(cosAngle, -sinAngle, sinAngle, cosAngle); + uvC -= center; + v.texcoord0.xy = mul(rot, uvC); + v.texcoord0.xy += center; + #endif + //-------------------- + + #if RECTSIZE_ON + v.vertex.xyz += (v.vertex.xyz * (_RectSize - 1.0)); + #endif + + #if OUTTEX_ON + v.texcoord1.xy = TRANSFORM_TEX(v.texcoord0.xy, _OutlineTex); + #endif + + #if OUTDIST_ON + v.texcoord2.xy = TRANSFORM_TEX(v.texcoord0.xy, _OutlineDistortTex); + #endif + + #if DISTORT_ON + v.texcoord3.xy = TRANSFORM_TEX(v.texcoord0.xy, _DistortTex); + #endif + } + + void Ext_SurfaceFunction0 (inout Surface o, ShaderData d) + { + half randomSeed = _RandomSeed; + + float2 uvRect = d.texcoord0; + half2 center = half2(0.5, 0.5); + #if ATLAS_ON + center = half2((_MaxXUV + _MinXUV) / 2.0, (_MaxYUV + _MinYUV) / 2.0); + uvRect = half2((d.texcoord0.x - _MinXUV) / (_MaxXUV - _MinXUV), (d.texcoord0.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half2 centerTiled = half2(center.x * _MainTex_ST.x, center.y * _MainTex_ST.y); + + //CLIPPING_ON + #if CLIPPING_ON + half2 tiledUv = half2(d.texcoord0.x / _MainTex_ST.x, d.texcoord0.y / _MainTex_ST.y); + #if ATLAS_ON + tiledUv = half2((tiledUv.x - _MinXUV) / (_MaxXUV - _MinXUV), (tiledUv.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + clip((1 - _ClipUvUp) - tiledUv.y); + clip(tiledUv.y - _ClipUvDown); + clip((1 - _ClipUvRight) - tiledUv.x); + clip(tiledUv.x - _ClipUvLeft); + #endif + //---------------------------------- + + //RADIALCLIPPING_ON + #if RADIALCLIPPING_ON + half2 tiledUv2 = half2(d.texcoord0.x / _MainTex_ST.x, d.texcoord0.y / _MainTex_ST.y); + #if ATLAS_ON + tiledUv2 = half2((tiledUv2.x - _MinXUV) / (_MaxXUV - _MinXUV), (tiledUv2.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half startAngle = _RadialStartAngle - _RadialClip; + half endAngle = _RadialStartAngle + _RadialClip2; + half offset0 = clamp(0, 360, startAngle + 360); + half offset360 = clamp(0, 360, endAngle - 360); + half2 atan2Coord = half2(lerp(-1, 1, tiledUv2.x), lerp(-1, 1, tiledUv2.y)); + half atanAngle = atan2(atan2Coord.y, atan2Coord.x) * 57.3; // angle in degrees + if(atanAngle < 0) atanAngle = 360 + atanAngle; + if(atanAngle >= startAngle && atanAngle <= endAngle) discard; + if(atanAngle <= offset360) discard; + if(atanAngle >= offset0) discard; + #endif + + //----------------------------- + + //TEXTURESCROLL_ON && ATLAS_ON + #if TEXTURESCROLL_ON && ATLAS_ON + d.texcoord0.xy = half2(_MinXUV + ((_MaxXUV - _MinXUV) * (abs(((_Time.y + randomSeed) * _TextureScrollXSpeed) + uvRect.x) % 1)), + _MinYUV + ((_MaxYUV - _MinYUV) * (abs(((_Time.y + randomSeed) * _TextureScrollYSpeed) + uvRect.y) % 1))); + #endif + //---------------------------- + + //OFFSETUV_ON + #if OFFSETUV_ON + #if ATLAS_ON + d.texcoord0.xy = half2(_MinXUV + ((_MaxXUV - _MinXUV) * (abs((_OffsetUvX + uvRect.x) % 1))), + _MinYUV + ((_MaxYUV - _MinYUV) * (abs(_OffsetUvY + uvRect.y) % 1))); + #else + d.texcoord0.xy += half2(_OffsetUvX, _OffsetUvY); + #endif + #endif + + //---------------------- + + //POLARUV_ON + #if POLARUV_ON + d.texcoord0.xy = half2(atan2(d.texcoord0.y, d.texcoord0.x) / (2.0f * 3.141592653589f), length(d.texcoord0.xy)); + d.texcoord0.xy *= _MainTex_ST.xy; + #endif + + //-------------------------------------- + + //TWISTUV_ON + #if TWISTUV_ON + #if ATLAS_ON + _TwistUvPosX = ((_MaxXUV - _MinXUV) * _TwistUvPosX) + _MinXUV; + _TwistUvPosY = ((_MaxYUV - _MinYUV) * _TwistUvPosY) + _MinYUV; + #endif + half2 tempUv = d.texcoord0.xy - half2(_TwistUvPosX * _MainTex_ST.x, _TwistUvPosY * _MainTex_ST.y); + _TwistUvRadius *= (_MainTex_ST.x + _MainTex_ST.y) / 2; + half percent = (_TwistUvRadius - length(tempUv)) / _TwistUvRadius; + half theta = percent * percent * (2.0 * sin(_TwistUvAmount)) * 8.0; + half s = sin(theta); + half c = cos(theta); + half beta = max(sign(_TwistUvRadius - length(tempUv)), 0.0); + tempUv = half2(dot(tempUv, half2(c, -s)), dot(tempUv, half2(s, c))) * beta + tempUv * (1 - beta); + tempUv += half2(_TwistUvPosX * _MainTex_ST.x, _TwistUvPosY * _MainTex_ST.y); + d.texcoord0.xy = tempUv; + #endif + + //-------------------------------------------- + + //FISHEYE_ON + #if FISHEYE_ON + half bind = length(centerTiled); + half2 dF = d.texcoord0.xy - centerTiled; + half dFlen = length(dF); + half fishInt = (3.14159265359 / bind) * (_FishEyeUvAmount + 0.001); + d.texcoord0.xy = centerTiled + (dF / (max(0.0001, dFlen))) * tan(dFlen * fishInt) * bind / tan(bind * fishInt); + #endif + //--------------------------------------------- + + //PINCH_ON + #if PINCH_ON + half2 dP = d.texcoord0.xy - centerTiled; + half pinchInt = (3.141592 / length(centerTiled)) * (-_PinchUvAmount + 0.001); + d.texcoord0.xy = centerTiled + normalize(dP) * atan(length(dP) * -pinchInt * 10.0) * 0.5 / atan(-pinchInt * 5); + #endif + + //--------------------------------------------- + + //ZOOMUV_ON + #if ZOOMUV_ON + d.texcoord0.xy -= centerTiled; + d.texcoord0.xy = d.texcoord0.xy * _ZoomUvAmount; + d.texcoord0.xy += centerTiled; + #endif + + //----------------------------------------------- + + //DOODLE_ON + #if DOODLE_ON + half2 uvCopy = uvRect; + _HandDrawnSpeed = (floor((_Time.x + randomSeed) * 20 * _HandDrawnSpeed) / _HandDrawnSpeed) * _HandDrawnSpeed; + uvCopy.x = sin((uvCopy.x * _HandDrawnAmount + _HandDrawnSpeed) * 4); + uvCopy.y = cos((uvCopy.y * _HandDrawnAmount + _HandDrawnSpeed) * 4); + d.texcoord0.xy = lerp(d.texcoord0.xy, d.texcoord0.xy + uvCopy, 0.0005 * _HandDrawnAmount); + #endif + + //-------------------------- + + //SHAKEUV_ON + #if SHAKEUV_ON + half xShake = sin((_Time.x + randomSeed) * _ShakeUvSpeed * 50) * _ShakeUvX; + half yShake = cos((_Time.x + randomSeed) * _ShakeUvSpeed * 50) * _ShakeUvY; + d.texcoord0.xy += half2(xShake * 0.012, yShake * 0.01); + #endif + + //------------------------------------------- + + //RECTSIZE_ON + #if RECTSIZE_ON + d.texcoord0.xy = d.texcoord0.xy * (_RectSize).xx + (((-_RectSize * 0.5) + 0.5)).xx; + #endif + + //------------------------------------------- + + //DISTORT_ON + #if DISTORT_ON + #if ATLAS_ON + d.texcoord3.x = d.texcoord3.x * (1 / (_MaxXUV - _MinXUV)); + d.texcoord3.y = d.texcoord3.y * (1 / (_MaxYUV - _MinYUV)); + #endif + + d.texcoord3.x += ((_Time.x + _RandomSeed) * _DistortTexXSpeed) % 1; + d.texcoord3.y += ((_Time.x + _RandomSeed) * _DistortTexYSpeed) % 1; + half distortAmnt = (SAMPLE_TEXTURE2D(_DistortTex, sampler_DistortTex, d.texcoord3.xy).r - 0.5) * 0.2 * _DistortAmount; + d.texcoord0.x += distortAmnt; + d.texcoord0.y += distortAmnt; + #endif + //------------------------------------------------------- + + //WARP_ON + #if WARP_ON + half2 warpUv = half2(d.texcoord0.x / _MainTex_ST.x, d.texcoord0.y / _MainTex_ST.y); + #if ATLAS_ON + warpUv = half2((warpUv.x - _MinXUV) / (_MaxXUV - _MinXUV), (warpUv.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + const float tau = 6.283185307179586; + float xWarp = (_Time.y + randomSeed) * _WarpSpeed + warpUv.x * tau / _WarpScale; + float yWarp = (_Time.y + randomSeed) * _WarpSpeed + warpUv.y * tau / _WarpScale; + float2 warp = float2(sin(xWarp), sin(yWarp)) * _WarpStrength; + d.texcoord0.xy += warp; + #endif + + //------------------------------------------------------- + + //WAVEUV_ON + #if WAVEUV_ON + float2 uvWave = half2(_WaveX * _MainTex_ST.x, _WaveY * _MainTex_ST.y) - d.texcoord0.xy; + uvWave %= 1; + #if ATLAS_ON + uvWave = half2(_WaveX, _WaveY) - uvRect; + #endif + uvWave.x *= _ScreenParams.x / _ScreenParams.y; + float waveTime = _Time.y + randomSeed; + float angWave = (sqrt(dot(uvWave, uvWave)) * _WaveAmount) - ((waveTime * _WaveSpeed)); + d.texcoord0.xy = d.texcoord0.xy + uvWave * sin(angWave) * (_WaveStrength / 1000.0); + #endif + //---------------------------------------------------- + + //ROUNDWAVEUV_ON + #if ROUNDWAVEUV_ON + half xWave = ((0.5 * _MainTex_ST.x) - uvRect.x); + half yWave = ((0.5 * _MainTex_ST.y) - uvRect.y) * (_MainTex_TexelSize.w / _MainTex_TexelSize.z); + half ripple = -sqrt(xWave*xWave + yWave* yWave); + d.texcoord0.xy += (sin((ripple + (_Time.y + randomSeed) * (_RoundWaveSpeed/10.0)) / 0.015) * (_RoundWaveStrength/10.0)) % 1; + #endif + //---------------------------------------------------- + + + //WIND_ON + #if WIND_ON + half windOffset = sin((_Time.x + randomSeed) * _GrassSpeed * 10); + half2 windCenter = half2(0.5, 0.1); + #if ATLAS_ON + windCenter.x = ((_MaxXUV - _MinXUV) * windCenter.x) + _MinXUV; + windCenter.y = ((_MaxYUV - _MinYUV) * windCenter.y) + _MinYUV; + #endif + #if !MANUALWIND_ON + d.texcoord0.x = fmod(abs(lerp(d.texcoord0.x, d.texcoord0.x + (_GrassWind * 0.01 * windOffset), uvRect.y)), 1); + #else + d.texcoord0.x = fmod(abs(lerp(d.texcoord0.x, d.texcoord0.x + (_GrassWind * 0.01 * _GrassManualAnim), uvRect.y)), 1); + windOffset = _GrassManualAnim; + #endif + half2 delta = d.texcoord0.xy - windCenter; + half delta2 = dot(delta.xy, delta.xy); + half2 delta_offset = delta2 * windOffset; + d.texcoord0.xy = d.texcoord0.xy + half2(delta.y, -delta.x) * delta_offset * _GrassRadialBend; + #endif + + //-------------------------------------------------------- + + //TEXTURESCROLL_ON && !ATLAS_ON + #if TEXTURESCROLL_ON && !ATLAS_ON + d.texcoord0.x += ((_Time.y + randomSeed) * _TextureScrollXSpeed) % 1; + d.texcoord0.y += ((_Time.y + randomSeed) * _TextureScrollYSpeed) % 1; + #endif + //------------------------------ + + //PIXELATE_ON + #if PIXELATE_ON + half aspectRatio = _MainTex_TexelSize.x / _MainTex_TexelSize.y; + half2 pixelSize = float2(_PixelateSize, _PixelateSize * aspectRatio); + d.texcoord0.xy = floor(d.texcoord0.xy * pixelSize) / pixelSize; + #endif + //-------------- + + half4 col = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy); + half originalAlpha = col.a; + col *= d.vertexColor; + + //NORMAL MAP + #if NORMALMAP_ON + half4 normalSample = SAMPLE_TEXTURE2D(_NormalMap, sampler_NormalMap, d.texcoord0.xy); + half3 normalTS = UnpackNormal(normalSample); + normalTS.xy *= _NormalStrength; + o.Normal = normalTS; + #endif + + + //GLITCH_ON + #if GLITCH_ON + half2 uvGlitch = uvRect; + uvGlitch.y -= 0.5; + half lineNoise = pow(rand2(floor(uvGlitch * half2(24., 19.) * _GlitchSize) * 4.0, randomSeed), 3.0) * _GlitchAmount + * pow(rand2(floor(uvGlitch * half2(38., 14.) * _GlitchSize) * 4.0, randomSeed), 3.0); + col = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(lineNoise * 0.02 * rand2(half2(2.0, 1), randomSeed), 0)) * d.vertexColor; + #endif + //-------------------------------------- + + //CHROMABERR_ON + #if CHROMABERR_ON + half4 r = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(_ChromAberrAmount/10, 0)) * d.vertexColor; + half4 b = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(-_ChromAberrAmount/10, 0)) * d.vertexColor; + col = half4(r.r * r.a, col.g, b.b * b.a, max(max(r.a, b.a) * _ChromAberrAlpha, col.a)); + #endif + + //-------------------------------- + + //BLUR_ON + #if BLUR_ON + #if ATLAS_ON + #if !BLURISHD_ON + col = BlurHD(d.texcoord0.xy, _MainTex, sampler_MainTex, _BlurIntensity, (_MaxXUV - _MinXUV), (_MaxYUV - _MinYUV)) * d.vertexColor; + #else + col = Blur(d.texcoord0.xy, _MainTex, sampler_MainTex, _BlurIntensity * (_MaxXUV - _MinXUV)) * d.vertexColor; + #endif + #else + #if !BLURISHD_ON + col = BlurHD(d.texcoord0.xy, _MainTex, sampler_MainTex, _BlurIntensity, 1, 1) * d.vertexColor; + #else + col = Blur(d.texcoord0.xy, _MainTex, sampler_MainTex, _BlurIntensity) * d.vertexColor; + #endif + #endif + #endif + + //-------------------- + + //MOTIONBLUR_ON + #if MOTIONBLUR_ON + _MotionBlurAngle = _MotionBlurAngle * 3.1415926; + #define rot(n) mul(n, half2x2(cos(_MotionBlurAngle), -sin(_MotionBlurAngle), sin(_MotionBlurAngle), cos(_MotionBlurAngle))) + _MotionBlurDist = _MotionBlurDist * 0.005; + #if ATLAS_ON + _MotionBlurDist *= (_MaxXUV - _MinXUV); + #endif + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(-_MotionBlurDist, -_MotionBlurDist))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(-_MotionBlurDist * 2, -_MotionBlurDist * 2))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(-_MotionBlurDist * 3, -_MotionBlurDist * 3))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(-_MotionBlurDist * 4, -_MotionBlurDist * 4))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(_MotionBlurDist, _MotionBlurDist))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(_MotionBlurDist * 2, _MotionBlurDist * 2))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(_MotionBlurDist * 3, _MotionBlurDist * 3))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(_MotionBlurDist * 4, _MotionBlurDist * 4))); + col.rgb = col.rgb / 9; + #endif + //------------------------------------ + + //NEGATIVE_ON + #if NEGATIVE_ON + col.rgb = lerp(col.rgb, 1 - col.rgb, _NegativeAmount); + #endif + + //-------------- + half luminance = 0; + + //GREYSCALE_ON && !GREYSCALEOUTLINE_ON + #if GREYSCALE_ON && !GREYSCALEOUTLINE_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + luminance = saturate(luminance + _GreyscaleLuminosity); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _GreyscaleTintColor, _GreyscaleBlend); + #endif + //------------------------------------ + + //GHOST_ON + #if GHOST_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + half4 ghostResult; + ghostResult.a = saturate(luminance - _GhostTransparency) * col.a; + ghostResult.rgb = col.rgb * (luminance + _GhostColorBoost); + col = lerp(col, ghostResult, _GhostBlend); + #endif + //------------------------------------ + + //INNEROUTLINE_ON + #if INNEROUTLINE_ON + half3 innerT = abs(GetPixel(0, _InnerOutlineThickness, d.texcoord0.xy, _MainTex, sampler_MainTex) - GetPixel(0, -_InnerOutlineThickness, d.texcoord0.xy, _MainTex, sampler_MainTex)); + innerT += abs(GetPixel(_InnerOutlineThickness, 0, d.texcoord0.xy, _MainTex, sampler_MainTex) - GetPixel(-_InnerOutlineThickness, 0, d.texcoord0.xy, _MainTex, sampler_MainTex)); + #if !ONLYINNEROUTLINE_ON + innerT = (innerT / 2.0) * col.a * _InnerOutlineAlpha; + col.rgb += length(innerT) * _InnerOutlineColor.rgb * _InnerOutlineGlow; + #else + innerT *= col.a * _InnerOutlineAlpha; + col.rgb = length(innerT) * _InnerOutlineColor.rgb * _InnerOutlineGlow; + col.a = step(0.3, col.r+col.g+col.b); + #endif + #endif + //------------------------------------------------------- + + //HITEFFECT_ON + #if HITEFFECT_ON + col.rgb = lerp(col.rgb, _HitEffectColor.rgb * _HitEffectGlow, _HitEffectBlend); + #endif + //-------------------- + + //GRADIENT_ON + #if GRADIENT_ON + half2 tiledUvGrad = half2(uvRect.x / _MainTex_ST.x, uvRect.y / _MainTex_ST.y); + #if GRADIENT2COL_ON + _GradTopRightCol = _GradTopLeftCol; + _GradBotRightCol = _GradBotLeftCol; + #endif + #if RADIALGRADIENT_ON + half radialDist = 1 - length(tiledUvGrad - half2(0.5, 0.5)); + radialDist *= (_MainTex_TexelSize.w / _MainTex_TexelSize.z); + radialDist = saturate(_GradBoostX * radialDist); + half4 gradientResult = lerp(_GradTopLeftCol, _GradBotLeftCol, radialDist); + #else + half gradXLerpFactor = saturate(pow(tiledUvGrad.x, _GradBoostX)); + half4 gradientResult = lerp(lerp(_GradBotLeftCol, _GradBotRightCol, gradXLerpFactor), + lerp(_GradTopLeftCol, _GradTopRightCol, gradXLerpFactor), saturate(pow(tiledUvGrad.y, _GradBoostY))); + #endif + gradientResult = lerp(col, gradientResult, _GradBlend); + col.rgb = gradientResult.rgb * col.a; + col.a *= gradientResult.a; + #endif + //-------------------------------------------------------------------- + + //CONTRAST_ON + #if CONTRAST_ON + col.rgb = (col.rgb - float3(0.5, 0.5, 0.5)) * _Contrast + float3(0.5, 0.5, 0.5); + col.rgb += _Brightness; + #endif + + //------------------------------------------------------------------- + + //COLORSWAP_ON + #if COLORSWAP_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + half4 swapMask = SAMPLE_TEXTURE2D(_ColorSwapTex, sampler_ColorSwapTex, d.texcoord0.xy); + swapMask.rgb *= swapMask.a; + half3 redSwap = _ColorSwapRed * swapMask.r * saturate(luminance + _ColorSwapRedLuminosity); + half3 greenSwap = _ColorSwapGreen * swapMask.g * saturate(luminance + _ColorSwapGreenLuminosity); + half3 blueSwap = _ColorSwapBlue * swapMask.b * saturate(luminance + _ColorSwapBlueLuminosity); + swapMask.rgb = col.rgb * saturate(1 - swapMask.r - swapMask.g - swapMask.b); + col.rgb = lerp(col.rgb, swapMask.rgb + redSwap + greenSwap + blueSwap, _ColorSwapBlend); + #endif + //-------------------------------------------------------------------- + + //COLORRAMP_ON && !COLORRAMPOUTLINE_ON + #if COLORRAMP_ON && !COLORRAMPOUTLINE_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + luminance = saturate(luminance + _ColorRampLuminosity); + #if GRADIENTCOLORRAMP_ON + col.rgb = lerp(col.rgb, SAMPLE_TEXTURE2D(_ColorRampTexGradient, sampler_ColorRampTexGradient, half2(luminance, 0)).rgb, _ColorRampBlend); + #else + col.rgb = lerp(col.rgb, SAMPLE_TEXTURE2D(_ColorRampTex, sampler_ColorRampTex, half2(luminance, 0)).rgb, _ColorRampBlend); + #endif + #endif + //-------------------------------------------------------------------- + + //CHANGECOLOR_ON + #if CHANGECOLOR_ON + float3 currChangeColor = saturate(col.rgb); + luminance = 0.3 * currChangeColor.r + 0.59 * currChangeColor.g + 0.11 * currChangeColor.b; + luminance = saturate(luminance + _ColorChangeLuminosity); + half3 dif = abs(currChangeColor - _ColorChangeTarget.rgb); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _ColorChangeNewCol.rgb, + max(sign(1 - saturate(dif.x + dif.y + dif.z) - _ColorChangeTolerance), 0.0)); + #if CHANGECOLOR2_ON + dif = abs(currChangeColor - _ColorChangeTarget2.rgb); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _ColorChangeNewCol2.rgb, + max(sign(1 - saturate(dif.x + dif.y + dif.z) - _ColorChangeTolerance2), 0.0)); + #endif + #if CHANGECOLOR3_ON + dif = abs(currChangeColor - _ColorChangeTarget3.rgb); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _ColorChangeNewCol3.rgb, + max(sign(1 - saturate(dif.x + dif.y + dif.z) - _ColorChangeTolerance3), 0.0)); + #endif + #endif + //------------------------------------------------------- + + //POSTERIZE_ON && !POSTERIZEOUTLINE_ON + #if POSTERIZE_ON && !POSTERIZEOUTLINE_ON + col.rgb = pow(col.rgb, _PosterizeGamma) * _PosterizeNumColors; + col.rgb = floor(col.rgb) / _PosterizeNumColors; + col.rgb = pow(col.rgb, 1.0 / _PosterizeGamma); + #endif + //------------------------------------ + + //HSV_ON + #if HSV_ON + half3 resultHsv = half3(col.rgb); + half cosHsv = _HsvBright * _HsvSaturation * cos(_HsvShift * 3.14159265 / 180); + half sinHsv = _HsvBright * _HsvSaturation * sin(_HsvShift * 3.14159265 / 180); + resultHsv.x = (.299 * _HsvBright + .701 * cosHsv + .168 * sinHsv) * col.x + + (.587 * _HsvBright - .587 * cosHsv + .330 * sinHsv) * col.y + + (.114 * _HsvBright - .114 * cosHsv - .497 * sinHsv) * col.z; + resultHsv.y = (.299 * _HsvBright - .299 * cosHsv - .328 * sinHsv) *col.x + + (.587 * _HsvBright + .413 * cosHsv + .035 * sinHsv) * col.y + + (.114 * _HsvBright - .114 * cosHsv + .292 * sinHsv) * col.z; + resultHsv.z = (.299 * _HsvBright - .3 * cosHsv + 1.25 * sinHsv) * col.x + + (.587 * _HsvBright - .588 * cosHsv - 1.05 * sinHsv) * col.y + + (.114 * _HsvBright + .886 * cosHsv - .203 * sinHsv) * col.z; + col.rgb = resultHsv; + #endif + //------------------------------------------------------- + + //OVERLAY_ON + #if OVERLAY_ON + half2 overlayUvs = d.texcoord0.xy; + overlayUvs.x += ((_Time.y + randomSeed) * _OverlayTextureScrollXSpeed) % 1; + overlayUvs.y += ((_Time.y + randomSeed) * _OverlayTextureScrollYSpeed) % 1; + half4 overlayCol = SAMPLE_TEXTURE2D(_OverlayTex, sampler_OverlayTex, TRANSFORM_TEX(overlayUvs, _OverlayTex)); + overlayCol.rgb *= _OverlayColor.rgb * _OverlayGlow; + #if !OVERLAYMULT_ON + overlayCol.rgb *= overlayCol.a * _OverlayColor.rgb * _OverlayColor.a * _OverlayBlend; + col.rgb += overlayCol.rgb; + #else + overlayCol.a *= _OverlayColor.a; + col = lerp(col, col * overlayCol, _OverlayBlend); + #endif + #endif + + //--------------------------------- + + //OUTBASE_ON + #if OUTBASE_ON + #if OUTBASEPIXELPERF_ON + half2 destUv = half2(_OutlinePixelWidth * _MainTex_TexelSize.x, _OutlinePixelWidth * _MainTex_TexelSize.y); + #else + half2 destUv = half2(_OutlineWidth * _MainTex_TexelSize.x * 200, _OutlineWidth * _MainTex_TexelSize.y * 200); + #endif + + #if OUTDIST_ON + d.texcoord3.x += ((_Time.x + _RandomSeed) * _OutlineDistortTexXSpeed) % 1; + d.texcoord3.y += ((_Time.x + _RandomSeed) * _OutlineDistortTexYSpeed) % 1; + #if ATLAS_ON + d.texcoord3 = half2((d.texcoord3.x - _MinXUV) / (_MaxXUV - _MinXUV), (d.texcoord3.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half outDistortAmnt = (SAMPLE_TEXTURE2D(_OutlineDistortTex, sampler_OutlineDistortTex, d.texcoord3).r - 0.5) * 0.2 * _OutlineDistortAmount; + destUv.x += outDistortAmnt; + destUv.y += outDistortAmnt; + #endif + + half spriteLeft = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(destUv.x, 0)).a; + half spriteRight = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy - half2(destUv.x, 0)).a; + half spriteBottom = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(0, destUv.y)).a; + half spriteTop = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy - half2(0, destUv.y)).a; + half result = spriteLeft + spriteRight + spriteBottom + spriteTop; + + #if OUTBASE8DIR_ON + half spriteTopLeft = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(destUv.x, destUv.y)).a; + half spriteTopRight = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(-destUv.x, destUv.y)).a; + half spriteBotLeft = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(destUv.x, -destUv.y)).a; + half spriteBotRight = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(-destUv.x, -destUv.y)).a; + result = result + spriteTopLeft + spriteTopRight + spriteBotLeft + spriteBotRight; + #endif + + result = step(0.05, saturate(result)); + + #if OUTTEX_ON + d.texcoord1.x += ((_Time.x + _RandomSeed) * _OutlineTexXSpeed) % 1; + d.texcoord1.y += ((_Time.x + _RandomSeed) * _OutlineTexYSpeed) % 1; + #if ATLAS_ON + d.texcoord1 = half2((d.texcoord1.x - _MinXUV) / (_MaxXUV - _MinXUV), (d.texcoord1.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half4 tempOutColor = SAMPLE_TEXTURE2D(_OutlineTex, sampler_OutlineTex, d.texcoord1); + tempOutColor *= _OutlineColor; + _OutlineColor = tempOutColor; + #endif + + result *= (1 - originalAlpha) * _OutlineAlpha; + + half4 outline = _OutlineColor * d.vertexColor.a; + outline.rgb *= _OutlineGlow; + outline.a = result; + #if ONLYOUTLINE_ON + col = outline; + #else + col = lerp(col, outline, result); + #endif + #endif + //------------------------------------------------------- + + //FADE_ON + #if FADE_ON + half2 tiledUvFade1 = TRANSFORM_TEX(d.texcoord0, _FadeTex); + half2 tiledUvFade2 = TRANSFORM_TEX(d.texcoord0, _FadeBurnTex); + #if ATLAS_ON + tiledUvFade1 = half2((tiledUvFade1.x - _MinXUV) / (_MaxXUV - _MinXUV), (tiledUvFade1.y - _MinYUV) / (_MaxYUV - _MinYUV)); + tiledUvFade2 = half2((tiledUvFade2.x - _MinXUV) / (_MaxXUV - _MinXUV), (tiledUvFade2.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half fadeTemp = SAMPLE_TEXTURE2D(_FadeTex, sampler_FadeTex, tiledUvFade1).r; + half fade = smoothstep(_FadeAmount, _FadeAmount + _FadeBurnTransition, fadeTemp); + half fadeBurn = saturate(smoothstep(_FadeAmount - _FadeBurnWidth, _FadeAmount - _FadeBurnWidth + 0.1, fadeTemp) * _FadeAmount); + col.a *= fade; + _FadeBurnColor.rgb *= _FadeBurnGlow; + col += fadeBurn * SAMPLE_TEXTURE2D(_FadeBurnTex, sampler_FadeBurnTex, tiledUvFade2) * _FadeBurnColor * originalAlpha * (1 - col.a); + #endif + //------------------------------------------------------- + + //SHADOW_ON + #if SHADOW_ON + half shadowA = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(_ShadowX, _ShadowY)).a; + half preMultShadowMask = 1 - (saturate(shadowA - col.a) * (1 - col.a)); + col.rgb *= 1 - ((shadowA - col.a) * (1 - col.a)); + col.rgb += (_ShadowColor * shadowA) * (1 - col.a); + col.a = max(shadowA * _ShadowAlpha * d.vertexColor.a, col.a); + #endif + + //------------------------------------------------------- + + //GLOW_ON + #if GLOW_ON + half4 emission; + #if GLOWTEX_ON + emission = SAMPLE_TEXTURE2D(_GlowTex, sampler_GlowTex, d.texcoord0); + #else + emission = col; + #endif + + col.rgb *= _GlowGlobal; + emission.rgb *= emission.a * col.a * _Glow * _GlowColor; + col.rgb += emission.rgb; + #endif + //------------------------------------------------------- + + //COLORRAMP_ON && COLORRAMPOUTLINE_ON + #if COLORRAMP_ON && COLORRAMPOUTLINE_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + luminance = saturate(luminance + _ColorRampLuminosity); + #if GRADIENTCOLORRAMP_ON + col.rgb = lerp(col.rgb, SAMPLE_TEXTURE2D(_ColorRampTexGradient, sampler_ColorRampTexGradient, half2(luminance, 0)).rgb, _ColorRampBlend); + #else + col.rgb = lerp(col.rgb, SAMPLE_TEXTURE2D(_ColorRampTex, sampler_ColorRampTex, half2(luminance, 0)).rgb, _ColorRampBlend); + #endif + #endif + //--------------- + + //GREYSCALE_ON && GREYSCALEOUTLINE_ON + #if GREYSCALE_ON && GREYSCALEOUTLINE_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + luminance = saturate(luminance + _GreyscaleLuminosity); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _GreyscaleTintColor, _GreyscaleBlend); + #endif + + //----------------------------------- + + //POSTERIZE_ON && POSTERIZEOUTLINE_ON + #if POSTERIZE_ON && POSTERIZEOUTLINE_ON + col.rgb = pow(col.rgb, _PosterizeGamma) * _PosterizeNumColors; + col.rgb = floor(col.rgb) / _PosterizeNumColors; + col.rgb = pow(col.rgb, 1.0 / _PosterizeGamma); + #endif + + //----------------------------------- + + //SHINE_ON + #if SHINE_ON + half2 uvShine = uvRect; + half cosAngle = cos(_ShineRotate); + half sinAngle = sin(_ShineRotate); + half2x2 rot = half2x2(cosAngle, -sinAngle, sinAngle, cosAngle); + uvShine -= half2(0.5, 0.5); + uvShine = mul(rot, uvShine); + uvShine += half2(0.5, 0.5); + half shineMask = SAMPLE_TEXTURE2D(_ShineMask, sampler_ShineMask, d.texcoord0.xy).a; + half currentDistanceProjection = (uvShine.x + uvShine.y) / 2; + half whitePower = 1 - (abs(currentDistanceProjection - _ShineLocation) / _ShineWidth); + col.rgb += col.a * whitePower * _ShineGlow * max(sign(currentDistanceProjection - (_ShineLocation - _ShineWidth)), 0.0) + * max(sign((_ShineLocation + _ShineWidth) - currentDistanceProjection), 0.0) * _ShineColor * shineMask; + #endif + + //----------------------------------- + + //HOLOGRAM_ON + #if HOLOGRAM_ON + half totalHologram = _HologramStripesAmount + _HologramUnmodAmount; + half hologramYCoord = ((uvRect.y + (((_Time.x + randomSeed) % 1) * _HologramStripesSpeed)) % totalHologram) / totalHologram; + hologramYCoord = abs(hologramYCoord); + half alpha = RemapFloat(saturate(hologramYCoord - (_HologramUnmodAmount/totalHologram)), 0.0, 1.0, _HologramMinAlpha, saturate(_HologramMaxAlpha)); + half hologramMask = max(sign((_HologramUnmodAmount/totalHologram) - hologramYCoord), 0.0); + half4 hologramResult = col; + hologramResult.a *= lerp(alpha, 1, hologramMask); + hologramResult.rgb *= max(1, _HologramMaxAlpha * max(sign(hologramYCoord - (_HologramUnmodAmount/totalHologram)), 0.0)); + hologramMask = 1 - step(0.01,hologramMask); + hologramResult.rgb += hologramMask * _HologramStripeColor * col.a; + col = lerp(col, hologramResult, _HologramBlend); + #endif + + //----------------------------------- + + //FLICKER_ON + #if FLICKER_ON + col.a *= saturate(col.a * step(frac(0.05 + (_Time.w + randomSeed) * _FlickerFreq), 1 - _FlickerPercent) + _FlickerAlpha); + #endif + //----------------------------------- + + //ALPHACUTOFF_ON + + //ALPHAROUND_ON + + //ALPHAOUTLINE_ON + #if ALPHAOUTLINE_ON + half alphaOutlineRes = pow(1 - col.a, max(_AlphaOutlinePower, 0.0001)) * step(_AlphaOutlineMinAlpha, col.a) * _AlphaOutlineBlend; + col.rgb = lerp(col.rgb, _AlphaOutlineColor.rgb * _AlphaOutlineGlow, alphaOutlineRes); + col.a = lerp(col.a, 1, alphaOutlineRes > 1); + #endif + //------------------------------------------------------- + + //FOG_ON + + //------------------ + + col *= _Color; + o.Albedo = col; + col.a *= _Alpha; + clip(col.a - _AlphaCutoffValue - 0.01); + o.Alpha = _Color.a; + } + + + + + + void ChainSurfaceFunction(inout Surface l, inout ShaderData d) + { + Ext_SurfaceFunction0(l, d); + // Ext_SurfaceFunction1(l, d); + // Ext_SurfaceFunction2(l, d); + // Ext_SurfaceFunction3(l, d); + // Ext_SurfaceFunction4(l, d); + // Ext_SurfaceFunction5(l, d); + // Ext_SurfaceFunction6(l, d); + // Ext_SurfaceFunction7(l, d); + // Ext_SurfaceFunction8(l, d); + // Ext_SurfaceFunction9(l, d); + // Ext_SurfaceFunction10(l, d); + // Ext_SurfaceFunction11(l, d); + // Ext_SurfaceFunction12(l, d); + // Ext_SurfaceFunction13(l, d); + // Ext_SurfaceFunction14(l, d); + // Ext_SurfaceFunction15(l, d); + // Ext_SurfaceFunction16(l, d); + // Ext_SurfaceFunction17(l, d); + // Ext_SurfaceFunction18(l, d); + // Ext_SurfaceFunction19(l, d); + // Ext_SurfaceFunction20(l, d); + // Ext_SurfaceFunction21(l, d); + // Ext_SurfaceFunction22(l, d); + // Ext_SurfaceFunction23(l, d); + // Ext_SurfaceFunction24(l, d); + // Ext_SurfaceFunction25(l, d); + // Ext_SurfaceFunction26(l, d); + // Ext_SurfaceFunction27(l, d); + // Ext_SurfaceFunction28(l, d); + // Ext_SurfaceFunction29(l, d); + } + +#if !_DECALSHADER + + void ChainModifyVertex(inout VertexData v, inout VertexToPixel v2p, float4 time) + { + ExtraV2F d; + + ZERO_INITIALIZE(ExtraV2F, d); + ZERO_INITIALIZE(Blackboard, d.blackboard); + // due to motion vectors in HDRP, we need to use the last + // time in certain spots. So if you are going to use _Time to adjust vertices, + // you need to use this time or motion vectors will break. + d.time = time; + + Ext_ModifyVertex0(v, d); + // Ext_ModifyVertex1(v, d); + // Ext_ModifyVertex2(v, d); + // Ext_ModifyVertex3(v, d); + // Ext_ModifyVertex4(v, d); + // Ext_ModifyVertex5(v, d); + // Ext_ModifyVertex6(v, d); + // Ext_ModifyVertex7(v, d); + // Ext_ModifyVertex8(v, d); + // Ext_ModifyVertex9(v, d); + // Ext_ModifyVertex10(v, d); + // Ext_ModifyVertex11(v, d); + // Ext_ModifyVertex12(v, d); + // Ext_ModifyVertex13(v, d); + // Ext_ModifyVertex14(v, d); + // Ext_ModifyVertex15(v, d); + // Ext_ModifyVertex16(v, d); + // Ext_ModifyVertex17(v, d); + // Ext_ModifyVertex18(v, d); + // Ext_ModifyVertex19(v, d); + // Ext_ModifyVertex20(v, d); + // Ext_ModifyVertex21(v, d); + // Ext_ModifyVertex22(v, d); + // Ext_ModifyVertex23(v, d); + // Ext_ModifyVertex24(v, d); + // Ext_ModifyVertex25(v, d); + // Ext_ModifyVertex26(v, d); + // Ext_ModifyVertex27(v, d); + // Ext_ModifyVertex28(v, d); + // Ext_ModifyVertex29(v, d); + + + // #if %EXTRAV2F0REQUIREKEY% + // v2p.extraV2F0 = d.extraV2F0; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // v2p.extraV2F1 = d.extraV2F1; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // v2p.extraV2F2 = d.extraV2F2; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // v2p.extraV2F3 = d.extraV2F3; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // v2p.extraV2F4 = d.extraV2F4; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // v2p.extraV2F5 = d.extraV2F5; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // v2p.extraV2F6 = d.extraV2F6; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // v2p.extraV2F7 = d.extraV2F7; + // #endif + } + + void ChainModifyTessellatedVertex(inout VertexData v, inout VertexToPixel v2p) + { + ExtraV2F d; + ZERO_INITIALIZE(ExtraV2F, d); + ZERO_INITIALIZE(Blackboard, d.blackboard); + + // #if %EXTRAV2F0REQUIREKEY% + // d.extraV2F0 = v2p.extraV2F0; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // d.extraV2F1 = v2p.extraV2F1; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // d.extraV2F2 = v2p.extraV2F2; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // d.extraV2F3 = v2p.extraV2F3; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // d.extraV2F4 = v2p.extraV2F4; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // d.extraV2F5 = v2p.extraV2F5; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // d.extraV2F6 = v2p.extraV2F6; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // d.extraV2F7 = v2p.extraV2F7; + // #endif + + + // Ext_ModifyTessellatedVertex0(v, d); + // Ext_ModifyTessellatedVertex1(v, d); + // Ext_ModifyTessellatedVertex2(v, d); + // Ext_ModifyTessellatedVertex3(v, d); + // Ext_ModifyTessellatedVertex4(v, d); + // Ext_ModifyTessellatedVertex5(v, d); + // Ext_ModifyTessellatedVertex6(v, d); + // Ext_ModifyTessellatedVertex7(v, d); + // Ext_ModifyTessellatedVertex8(v, d); + // Ext_ModifyTessellatedVertex9(v, d); + // Ext_ModifyTessellatedVertex10(v, d); + // Ext_ModifyTessellatedVertex11(v, d); + // Ext_ModifyTessellatedVertex12(v, d); + // Ext_ModifyTessellatedVertex13(v, d); + // Ext_ModifyTessellatedVertex14(v, d); + // Ext_ModifyTessellatedVertex15(v, d); + // Ext_ModifyTessellatedVertex16(v, d); + // Ext_ModifyTessellatedVertex17(v, d); + // Ext_ModifyTessellatedVertex18(v, d); + // Ext_ModifyTessellatedVertex19(v, d); + // Ext_ModifyTessellatedVertex20(v, d); + // Ext_ModifyTessellatedVertex21(v, d); + // Ext_ModifyTessellatedVertex22(v, d); + // Ext_ModifyTessellatedVertex23(v, d); + // Ext_ModifyTessellatedVertex24(v, d); + // Ext_ModifyTessellatedVertex25(v, d); + // Ext_ModifyTessellatedVertex26(v, d); + // Ext_ModifyTessellatedVertex27(v, d); + // Ext_ModifyTessellatedVertex28(v, d); + // Ext_ModifyTessellatedVertex29(v, d); + + // #if %EXTRAV2F0REQUIREKEY% + // v2p.extraV2F0 = d.extraV2F0; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // v2p.extraV2F1 = d.extraV2F1; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // v2p.extraV2F2 = d.extraV2F2; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // v2p.extraV2F3 = d.extraV2F3; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // v2p.extraV2F4 = d.extraV2F4; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // v2p.extraV2F5 = d.extraV2F5; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // v2p.extraV2F6 = d.extraV2F6; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // v2p.extraV2F7 = d.extraV2F7; + // #endif + } + + void ChainFinalColorForward(inout Surface l, inout ShaderData d, inout half4 color) + { + // Ext_FinalColorForward0(l, d, color); + // Ext_FinalColorForward1(l, d, color); + // Ext_FinalColorForward2(l, d, color); + // Ext_FinalColorForward3(l, d, color); + // Ext_FinalColorForward4(l, d, color); + // Ext_FinalColorForward5(l, d, color); + // Ext_FinalColorForward6(l, d, color); + // Ext_FinalColorForward7(l, d, color); + // Ext_FinalColorForward8(l, d, color); + // Ext_FinalColorForward9(l, d, color); + // Ext_FinalColorForward10(l, d, color); + // Ext_FinalColorForward11(l, d, color); + // Ext_FinalColorForward12(l, d, color); + // Ext_FinalColorForward13(l, d, color); + // Ext_FinalColorForward14(l, d, color); + // Ext_FinalColorForward15(l, d, color); + // Ext_FinalColorForward16(l, d, color); + // Ext_FinalColorForward17(l, d, color); + // Ext_FinalColorForward18(l, d, color); + // Ext_FinalColorForward19(l, d, color); + // Ext_FinalColorForward20(l, d, color); + // Ext_FinalColorForward21(l, d, color); + // Ext_FinalColorForward22(l, d, color); + // Ext_FinalColorForward23(l, d, color); + // Ext_FinalColorForward24(l, d, color); + // Ext_FinalColorForward25(l, d, color); + // Ext_FinalColorForward26(l, d, color); + // Ext_FinalColorForward27(l, d, color); + // Ext_FinalColorForward28(l, d, color); + // Ext_FinalColorForward29(l, d, color); + } + + void ChainFinalGBufferStandard(inout Surface s, inout ShaderData d, inout half4 GBuffer0, inout half4 GBuffer1, inout half4 GBuffer2, inout half4 outEmission, inout half4 outShadowMask) + { + // Ext_FinalGBufferStandard0(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard1(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard2(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard3(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard4(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard5(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard6(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard7(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard8(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard9(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard10(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard11(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard12(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard13(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard14(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard15(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard16(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard17(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard18(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard19(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard20(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard21(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard22(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard23(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard24(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard25(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard26(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard27(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard28(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard29(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + } +#endif + + + + + +#if _DECALSHADER + + ShaderData CreateShaderData(SurfaceDescriptionInputs IN) + { + ShaderData d = (ShaderData)0; + d.TBNMatrix = float3x3(IN.WorldSpaceTangent, IN.WorldSpaceBiTangent, IN.WorldSpaceNormal); + d.worldSpaceNormal = IN.WorldSpaceNormal; + d.worldSpaceTangent = IN.WorldSpaceTangent; + + d.worldSpacePosition = IN.WorldSpacePosition; + d.texcoord0 = IN.uv0.xyxy; + d.screenPos = IN.ScreenPosition; + + d.worldSpaceViewDir = normalize(_WorldSpaceCameraPos - d.worldSpacePosition); + + d.tangentSpaceViewDir = mul(d.TBNMatrix, d.worldSpaceViewDir); + + // these rarely get used, so we back transform them. Usually will be stripped. + #if _HDRP + // d.localSpacePosition = mul(GetWorldToObjectMatrix(), float4(GetCameraRelativePositionWS(d.worldSpacePosition), 1)).xyz; + #else + // d.localSpacePosition = mul(GetWorldToObjectMatrix(), float4(d.worldSpacePosition, 1)).xyz; + #endif + // d.localSpaceNormal = normalize(mul((float3x3)GetWorldToObjectMatrix(), d.worldSpaceNormal)); + // d.localSpaceTangent = normalize(mul((float3x3)GetWorldToObjectMatrix(), d.worldSpaceTangent.xyz)); + + // #if %SCREENPOSREQUIREKEY% + // d.screenUV = (IN.ScreenPosition.xy / max(0.01, IN.ScreenPosition.w)); + // #endif + + return d; + } +#else + + ShaderData CreateShaderData(VertexToPixel i + #if NEED_FACING + , bool facing + #endif + ) + { + ShaderData d = (ShaderData)0; + d.clipPos = i.pos; + d.worldSpacePosition = i.worldPos; + + d.worldSpaceNormal = normalize(i.worldNormal); + d.worldSpaceTangent.xyz = normalize(i.worldTangent.xyz); + + d.tangentSign = i.worldTangent.w * unity_WorldTransformParams.w; + float3 bitangent = cross(d.worldSpaceTangent.xyz, d.worldSpaceNormal) * d.tangentSign; + + d.TBNMatrix = float3x3(d.worldSpaceTangent, -bitangent, d.worldSpaceNormal); + d.worldSpaceViewDir = normalize(_WorldSpaceCameraPos - i.worldPos); + + d.tangentSpaceViewDir = mul(d.TBNMatrix, d.worldSpaceViewDir); + d.texcoord0 = i.texcoord0; + d.texcoord1 = i.texcoord1; + d.texcoord2 = i.texcoord2; + + // #if %TEXCOORD3REQUIREKEY% + d.texcoord3 = i.texcoord3; + // #endif + + // d.isFrontFace = facing; + // #if %VERTEXCOLORREQUIREKEY% + d.vertexColor = i.vertexColor; + // #endif + + // these rarely get used, so we back transform them. Usually will be stripped. + #if _HDRP + // d.localSpacePosition = mul(GetWorldToObjectMatrix(), float4(GetCameraRelativePositionWS(i.worldPos), 1)).xyz; + #else + // d.localSpacePosition = mul(GetWorldToObjectMatrix(), float4(i.worldPos, 1)).xyz; + #endif + // d.localSpaceNormal = normalize(mul((float3x3)GetWorldToObjectMatrix(), i.worldNormal)); + // d.localSpaceTangent = normalize(mul((float3x3)GetWorldToObjectMatrix(), i.worldTangent.xyz)); + + // #if %SCREENPOSREQUIREKEY% + // d.screenPos = i.screenPos; + // d.screenUV = (i.screenPos.xy / i.screenPos.w); + // #endif + + + // #if %EXTRAV2F0REQUIREKEY% + // d.extraV2F0 = i.extraV2F0; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // d.extraV2F1 = i.extraV2F1; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // d.extraV2F2 = i.extraV2F2; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // d.extraV2F3 = i.extraV2F3; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // d.extraV2F4 = i.extraV2F4; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // d.extraV2F5 = i.extraV2F5; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // d.extraV2F6 = i.extraV2F6; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // d.extraV2F7 = i.extraV2F7; + // #endif + + return d; + } + +#endif + + + +#if (SHADERPASS == SHADERPASS_LIGHT_TRANSPORT) + + // This was not in constant buffer in original unity, so keep outiside. But should be in as ShaderRenderPass frequency + float unity_OneOverOutputBoost; + float unity_MaxOutputValue; + + CBUFFER_START(UnityMetaPass) + // x = use uv1 as raster position + // y = use uv2 as raster position + bool4 unity_MetaVertexControl; + + // x = return albedo + // y = return normal + bool4 unity_MetaFragmentControl; + CBUFFER_END + + VertexToPixel Vert(VertexData inputMesh) + { + VertexToPixel output; + ZERO_INITIALIZE(VertexToPixel, output); + UNITY_SETUP_INSTANCE_ID(inputMesh); + UNITY_TRANSFER_INSTANCE_ID(inputMesh, output); + UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(output); + + // Output UV coordinate in vertex shader + float2 uv = float2(0.0, 0.0); + + if (unity_MetaVertexControl.x) + { + uv = inputMesh.texcoord1.xy * unity_LightmapST.xy + unity_LightmapST.zw; + } + else if (unity_MetaVertexControl.y) + { + uv = inputMesh.texcoord2.xy * unity_DynamicLightmapST.xy + unity_DynamicLightmapST.zw; + } + + // OpenGL right now needs to actually use the incoming vertex position + // so we create a fake dependency on it here that haven't any impact. + output.pos = float4(uv * 2.0 - 1.0, inputMesh.vertex.z > 0 ? 1.0e-4 : 0.0, 1.0); + + output.worldPos = TransformObjectToWorld(inputMesh.vertex); + + // Normal is required for triplanar mapping + output.worldNormal = TransformObjectToWorldNormal(inputMesh.normal); + // Not required but assign to silent compiler warning + output.worldTangent = float4(1.0, 0.0, 0.0, 0.0); + + output.texcoord0 = inputMesh.texcoord0; + output.texcoord1 = inputMesh.texcoord1; + output.texcoord2 = inputMesh.texcoord2; + // #if %TEXCOORD3REQUIREKEY% + output.texcoord3 = inputMesh.texcoord3; + // #endif + // #if %VERTEXCOLORREQUIREKEY% + output.vertexColor = inputMesh.vertexColor; + // #endif + + return output; + } +#else + + #if (_PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR))) + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/ShaderVariablesMatrixDefsHDCamera.hlsl" + + void MotionVectorPositionZBias(VertexToPixel input) + { + #if UNITY_REVERSED_Z + input.pos.z -= unity_MotionVectorsParams.z * input.pos.w; + #else + input.pos.z += unity_MotionVectorsParams.z * input.pos.w; + #endif + } + + #endif + + VertexToPixel Vert(VertexData input) + { + VertexToPixel output; + ZERO_INITIALIZE(VertexToPixel, output); + + UNITY_SETUP_INSTANCE_ID(input); + UNITY_TRANSFER_INSTANCE_ID(input, output); + UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(output); + + // copy before user modification, since we'll apply that to the copy later + #if _HDRP && (_PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR))) + VertexData previousMesh = input; + #endif + + ChainModifyVertex(input, output, _Time); + + // This return the camera relative position (if enable) + float3 positionRWS = TransformObjectToWorld(input.vertex.xyz); + float3 normalWS = TransformObjectToWorldNormal(input.normal); + float4 tangentWS = float4(TransformObjectToWorldDir(input.tangent.xyz), input.tangent.w); + + + output.worldPos = GetAbsolutePositionWS(positionRWS); + output.pos = TransformWorldToHClip(positionRWS); + output.worldNormal = normalWS; + output.worldTangent = tangentWS; + + + output.texcoord0 = input.texcoord0; + output.texcoord1 = input.texcoord1; + output.texcoord2 = input.texcoord2; + + // #if %TEXCOORD3REQUIREKEY% + output.texcoord3 = input.texcoord3; + // #endif + + // #if %VERTEXCOLORREQUIREKEY% + output.vertexColor = input.vertexColor; + // #endif + + // #if %SCREENPOSREQUIREKEY% + // output.screenPos = ComputeScreenPos(output.pos, _ProjectionParams.x); + // #endif + + #if _HDRP && (_PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR))) + + #if !defined(TESSELLATION_ON) + MotionVectorPositionZBias(output); + #endif + + output.motionVectorCS = mul(UNITY_MATRIX_UNJITTERED_VP, float4(positionRWS, 1.0)); + // Note: unity_MotionVectorsParams.y is 0 is forceNoMotion is enabled + bool forceNoMotion = unity_MotionVectorsParams.y == 0.0; + if (forceNoMotion) + { + output.previousPositionCS = float4(0.0, 0.0, 0.0, 1.0); + } + else + { + bool hasDeformation = unity_MotionVectorsParams.x > 0.0; // Skin or morph target + + float3 effectivePositionOS = (hasDeformation ? previousMesh.previousPositionOS : previousMesh.vertex.xyz); + #if defined(_ADD_PRECOMPUTED_VELOCITY) + effectivePositionOS -= input.precomputedVelocity; + #endif + + + + previousMesh.vertex = float4(effectivePositionOS, 1); + VertexToPixel dummy = (VertexToPixel)0; + + ChainModifyVertex(previousMesh, dummy, _LastTimeParameters); + + float3 previousPositionRWS = TransformPreviousObjectToWorld(previousMesh.vertex.xyz); + // we might need this for skinned objects? + //float3 normalWS = TransformPreviousObjectToWorldNormal(input.normal).xyz; + + #ifdef _WRITE_TRANSPARENT_MOTION_VECTOR + if (_TransparentCameraOnlyMotionVectors > 0) + { + previousPositionRWS = positionRWS.xyz; + } + #endif // _WRITE_TRANSPARENT_MOTION_VECTOR + + output.previousPositionCS = mul(UNITY_MATRIX_PREV_VP, float4(previousPositionRWS, 1.0)); + } + #endif // _HDRP && _PASSMOTIONVECTOR || (_PASSFORWARD && defined(_WRITE_TRANSPARENT_MOTION_VECTOR)) + + + return output; + } + + +#endif + + + + + + + + #if defined(WRITE_DECAL_BUFFER) && !defined(_DISABLE_DECALS) + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/Decal/DecalPrepassBuffer.hlsl" + #endif + + FragInputs BuildFragInputs(VertexToPixel input) + { + UNITY_SETUP_INSTANCE_ID(input); + FragInputs output; + ZERO_INITIALIZE(FragInputs, output); + + // Init to some default value to make the computer quiet (else it output 'divide by zero' warning even if value is not used). + // TODO: this is a really poor workaround, but the variable is used in a bunch of places + // to compute normals which are then passed on elsewhere to compute other values... + output.tangentToWorld = k_identity3x3; + output.positionSS = input.pos; // input.positionCS is SV_Position + // BETTER SHADERS: because we transform world position into actual world space for things like + // triplanar, etc, we have to back transform it here for lighting + output.positionRWS = GetCameraRelativePositionWS(input.worldPos); + output.tangentToWorld = BuildTangentToWorld(input.worldTangent, input.worldNormal); + output.texCoord0 = input.texcoord0; + output.texCoord1 = input.texcoord1; + output.texCoord2 = input.texcoord2; + + return output; + } + + void BuildSurfaceData(FragInputs fragInputs, inout Surface surfaceDescription, float3 V, PositionInputs posInput, out SurfaceData surfaceData, out float3 bentNormalWS) + { + // setup defaults -- these are used if the graph doesn't output a value + ZERO_INITIALIZE(SurfaceData, surfaceData); + + // specularOcclusion need to be init ahead of decal to quiet the compiler that modify the SurfaceData struct + // however specularOcclusion can come from the graph, so need to be init here so it can be override. + surfaceData.specularOcclusion = 1.0; + + // copy across graph values, if defined + surfaceData.baseColor = surfaceDescription.Albedo; + surfaceData.perceptualSmoothness = surfaceDescription.Smoothness; + surfaceData.ambientOcclusion = surfaceDescription.Occlusion; + surfaceData.specularOcclusion = surfaceDescription.SpecularOcclusion; + surfaceData.metallic = surfaceDescription.Metallic; + surfaceData.subsurfaceMask = surfaceDescription.SubsurfaceMask; + surfaceData.thickness = surfaceDescription.Thickness; + surfaceData.diffusionProfileHash = asuint(surfaceDescription.DiffusionProfileHash); + #if _USESPECULAR + surfaceData.specularColor = surfaceDescription.Specular; + #endif + surfaceData.coatMask = surfaceDescription.CoatMask; + surfaceData.anisotropy = surfaceDescription.Anisotropy; + surfaceData.iridescenceMask = surfaceDescription.IridescenceMask; + surfaceData.iridescenceThickness = surfaceDescription.IridescenceThickness; + + + + #if defined(_REFRACTION_PLANE) || defined(_REFRACTION_SPHERE) || defined(_REFRACTION_THIN) + if (_EnableSSRefraction) + { + surfaceData.transmittanceMask = (1.0 - surfaceDescription.Alpha); + surfaceDescription.Alpha = 1.0; + } + else + { + surfaceData.ior = surfaceDescription.ior; + surfaceData.transmittanceColor = surfaceDescription.transmittanceColor; + surfaceData.atDistance = surfaceDescription.atDistance; + surfaceData.transmittanceMask = surfaceDescription.transmittanceMask; + surfaceDescription.Alpha = 1.0; + } + #else + surfaceData.ior = 1.0; + surfaceData.transmittanceColor = float3(1.0, 1.0, 1.0); + surfaceData.atDistance = 1.0; + surfaceData.transmittanceMask = 0.0; + #endif + + + #if defined(_ENABLE_SHADOW_MATTE) && SHADERPASS == SHADERPASS_FORWARD_UNLIT + HDShadowContext shadowContext = InitShadowContext(); + float shadow; + float3 shadow3; + // We need to recompute some coordinate not computed by default for shadow matte + posInput = GetPositionInput(fragInputs.positionSS.xy, _ScreenSize.zw, fragInputs.positionSS.z, UNITY_MATRIX_I_VP, GetWorldToViewMatrix()); + float3 upWS = normalize(fragInputs.tangentToWorld[1]); + uint renderingLayers = GetMeshRenderingLightLayer(); + ShadowLoopMin(shadowContext, posInput, upWS, asuint(_ShadowMatteFilter), renderingLayers, shadow3); + shadow = dot(shadow3, float3(1.0 / 3.0, 1.0 / 3.0, 1.0 / 3.0)); + + float4 shadowColor = (1.0 - shadow) * surfaceDescription.ShadowTint.rgba; + float localAlpha = saturate(shadowColor.a + surfaceDescription.Alpha); + + // Keep the nested lerp + // With no Color (bsdfData.color.rgb, bsdfData.color.a == 0.0f), just use ShadowColor*Color to avoid a ring of "white" around the shadow + // And mix color to consider the Color & ShadowColor alpha (from texture or/and color picker) + #ifdef _SURFACE_TYPE_TRANSPARENT + surfaceData.baseColor = lerp(shadowColor.rgb * surfaceData.baseColor, lerp(lerp(shadowColor.rgb, surfaceData.baseColor, 1.0 - surfaceDescription.ShadowTint.a), surfaceData.baseColor, shadow), surfaceDescription.Alpha); + #else + surfaceData.baseColor = lerp(lerp(shadowColor.rgb, surfaceData.baseColor, 1.0 - surfaceDescription.ShadowTint.a), surfaceData.baseColor, shadow); + #endif + localAlpha = ApplyBlendMode(surfaceData.baseColor, localAlpha).a; + + surfaceDescription.Alpha = localAlpha; + #endif + + // These static material feature allow compile time optimization + surfaceData.materialFeatures = MATERIALFEATUREFLAGS_LIT_STANDARD; + #ifdef _MATERIAL_FEATURE_SUBSURFACE_SCATTERING + surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_SUBSURFACE_SCATTERING; + #endif + + #ifdef _MATERIAL_FEATURE_TRANSMISSION + surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_TRANSMISSION; + #endif + + #ifdef _MATERIAL_FEATURE_ANISOTROPY + surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_ANISOTROPY; + #endif + + #ifdef _MATERIAL_FEATURE_IRIDESCENCE + surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_IRIDESCENCE; + #endif + + #ifdef _MATERIAL_FEATURE_SPECULAR_COLOR + surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_SPECULAR_COLOR; + #endif + + #if defined(_MATERIAL_FEATURE_CLEAR_COAT) || _CLEARCOAT + surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_CLEAR_COAT; + #endif + + #if defined (_MATERIAL_FEATURE_SPECULAR_COLOR) && defined (_ENERGY_CONSERVING_SPECULAR) + // Require to have setup baseColor + // Reproduce the energy conservation done in legacy Unity. Not ideal but better for compatibility and users can unchek it + surfaceData.baseColor *= (1.0 - Max3(surfaceData.specularColor.r, surfaceData.specularColor.g, surfaceData.specularColor.b)); + #endif + + + + // compute world space normal + #if !_WORLDSPACENORMAL + surfaceData.normalWS = mul(surfaceDescription.Normal, fragInputs.tangentToWorld); + #else + surfaceData.normalWS = surfaceDescription.Normal; + #endif + + surfaceData.geomNormalWS = fragInputs.tangentToWorld[2]; + + surfaceData.tangentWS = normalize(fragInputs.tangentToWorld[0].xyz); // The tangent is not normalize in tangentToWorld for mikkt. TODO: Check if it expected that we normalize with Morten. Tag: SURFACE_GRADIENT + + + #if HAVE_DECALS + if (_EnableDecals) + { + float alpha = 1.0; + alpha = surfaceDescription.Alpha; + + // Both uses and modifies 'surfaceData.normalWS'. + DecalSurfaceData decalSurfaceData = GetDecalSurfaceData(posInput, fragInputs.tangentToWorld[2], alpha); + ApplyDecalToSurfaceData(decalSurfaceData, fragInputs.tangentToWorld[2], surfaceData); + } + #endif + + bentNormalWS = surfaceData.normalWS; + + surfaceData.tangentWS = Orthonormalize(surfaceData.tangentWS, surfaceData.normalWS); + + #ifdef DEBUG_DISPLAY + if (_DebugMipMapMode != DEBUGMIPMAPMODE_NONE) + { + // TODO: need to update mip info + surfaceData.metallic = 0; + } + + // We need to call ApplyDebugToSurfaceData after filling the surfarcedata and before filling builtinData + // as it can modify attribute use for static lighting + ApplyDebugToSurfaceData(fragInputs.tangentToWorld, surfaceData); + #endif + + // By default we use the ambient occlusion with Tri-ace trick (apply outside) for specular occlusion. + // If user provide bent normal then we process a better term + #if defined(_SPECULAR_OCCLUSION_CUSTOM) + // Just use the value passed through via the slot (not active otherwise) + #elif defined(_SPECULAR_OCCLUSION_FROM_AO_BENT_NORMAL) + // If we have bent normal and ambient occlusion, process a specular occlusion + surfaceData.specularOcclusion = GetSpecularOcclusionFromBentAO(V, bentNormalWS, surfaceData.normalWS, surfaceData.ambientOcclusion, PerceptualSmoothnessToPerceptualRoughness(surfaceData.perceptualSmoothness)); + #elif defined(_AMBIENT_OCCLUSION) && defined(_SPECULAR_OCCLUSION_FROM_AO) + surfaceData.specularOcclusion = GetSpecularOcclusionFromAmbientOcclusion(ClampNdotV(dot(surfaceData.normalWS, V)), surfaceData.ambientOcclusion, PerceptualSmoothnessToRoughness(surfaceData.perceptualSmoothness)); + #endif + + #if defined(_ENABLE_GEOMETRIC_SPECULAR_AA) && !defined(SHADER_STAGE_RAY_TRACING) + surfaceData.perceptualSmoothness = GeometricNormalFiltering(surfaceData.perceptualSmoothness, fragInputs.tangentToWorld[2], surfaceDescription.SpecularAAScreenSpaceVariance, surfaceDescription.SpecularAAThreshold); + #endif + } + + void GetSurfaceAndBuiltinData(VertexToPixel m2ps, FragInputs fragInputs, float3 V, inout PositionInputs posInput, + out SurfaceData surfaceData, out BuiltinData builtinData, inout Surface l, inout ShaderData d + #if NEED_FACING + , bool facing + #endif + ) + { + // Removed since crossfade does not work, probably needs extra material setup. + //#if !defined(SHADER_STAGE_RAY_TRACING) && !defined(_TESSELLATION_DISPLACEMENT) + // #ifdef LOD_FADE_CROSSFADE // enable dithering LOD transition if user select CrossFade transition in LOD group + // LODDitheringTransition(ComputeFadeMaskSeed(V, posInput.positionSS), unity_LODFade.x); + // #endif + //#endif + + d = CreateShaderData(m2ps + #if NEED_FACING + , facing + #endif + ); + + l = (Surface)0; + + l.Albedo = half3(0.5, 0.5, 0.5); + l.Normal = float3(0,0,1); + l.Occlusion = 1; + l.Alpha = 1; + l.SpecularOcclusion = 1; + + #if !defined(SHADER_STAGE_RAY_TRACING) && defined(_DEPTHOFFSET_ON) + l.outputDepth = d.clipPos.z; + #endif + + ChainSurfaceFunction(l, d); + + #if !defined(SHADER_STAGE_RAY_TRACING) && defined(_DEPTHOFFSET_ON) + //posInput.deviceDepth = l.outputDepth; + #endif + + #if _UNLIT + //l.Emission = l.Albedo; + //l.Albedo = 0; + l.Normal = half3(0,0,1); + l.Occlusion = 1; + l.Metallic = 0; + l.Specular = 0; + #endif + + surfaceData.geomNormalWS = d.worldSpaceNormal; + surfaceData.tangentWS = d.worldSpaceTangent; + fragInputs.tangentToWorld = d.TBNMatrix; + + float3 bentNormalWS; + BuildSurfaceData(fragInputs, l, V, posInput, surfaceData, bentNormalWS); + + + InitBuiltinData(posInput, l.Alpha, bentNormalWS, -d.worldSpaceNormal, fragInputs.texCoord1, fragInputs.texCoord2, builtinData); + + + + builtinData.emissiveColor = l.Emission; + + #if defined(_OVERRIDE_BAKEDGI) + builtinData.bakeDiffuseLighting = l.DiffuseGI; + builtinData.backBakeDiffuseLighting = l.BackDiffuseGI; + builtinData.emissiveColor += l.SpecularGI; + #endif + + #if defined(_OVERRIDE_SHADOWMASK) + builtinData.shadowMask0 = l.ShadowMask.x; + builtinData.shadowMask1 = l.ShadowMask.y; + builtinData.shadowMask2 = l.ShadowMask.z; + builtinData.shadowMask3 = l.ShadowMask.w; + #endif + + #if defined(UNITY_VIRTUAL_TEXTURING) + builtinData.vtPackedFeedback = surfaceData.VTPackedFeedback; + #endif + + #if (SHADERPASS == SHADERPASS_DISTORTION) + //builtinData.distortion = surfaceData.Distortion; + //builtinData.distortionBlur = surfaceData.DistortionBlur; + #endif + + #ifndef SHADER_UNLIT + // PostInitBuiltinData call ApplyDebugToBuiltinData + PostInitBuiltinData(V, posInput, surfaceData, builtinData); + #else + ApplyDebugToBuiltinData(builtinData); + #endif + + RAY_TRACING_OPTIONAL_ALPHA_TEST_PASS + } + + + void Frag( VertexToPixel v2f + #if defined(SCENESELECTIONPASS) || defined(SCENEPICKINGPASS) + , out float4 outColor : SV_Target0 + #else + #ifdef WRITE_MSAA_DEPTH + // We need the depth color as SV_Target0 for alpha to coverage + , out float4 depthColor : SV_Target0 + #ifdef WRITE_NORMAL_BUFFER + , out float4 outNormalBuffer : SV_Target1 + #endif + #else + #ifdef WRITE_NORMAL_BUFFER + , out float4 outNormalBuffer : SV_Target0 + #endif + #endif + + // Decal buffer must be last as it is bind but we can optionally write into it (based on _DISABLE_DECALS) + #if defined(WRITE_DECAL_BUFFER) && !defined(_DISABLE_DECALS) + , out float4 outDecalBuffer : SV_TARGET_DECAL + #endif + #endif + #if NEED_FACING + , bool facing : SV_IsFrontFace + #endif + + ) + { + UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX(v2f); + FragInputs input = BuildFragInputs(v2f); + + // input.positionSS is SV_Position + PositionInputs posInput = GetPositionInput(input.positionSS.xy, _ScreenSize.zw, input.positionSS.z, input.positionSS.w, input.positionRWS); + + float3 V = GetWorldSpaceNormalizeViewDir(input.positionRWS); + + + SurfaceData surfaceData; + BuiltinData builtinData; + Surface l; + ShaderData d; + GetSurfaceAndBuiltinData(v2f, input, V, posInput, surfaceData, builtinData, l, d + #if NEED_FACING + , facing + #endif + ); + + + + #ifdef SCENESELECTIONPASS + // We use depth prepass for scene selection in the editor, this code allow to output the outline correctly + outColor = float4(_ObjectId, _PassValue, 1.0, 1.0); + #elif defined(SCENEPICKINGPASS) + outColor = _SelectionID; + #else + #ifdef WRITE_MSAA_DEPTH + // In case we are rendering in MSAA, reading the an MSAA depth buffer is way too expensive. To avoid that, we export the depth to a color buffer + depthColor = v2p.pos.z; + + #ifdef _ALPHATOMASK_ON + // Alpha channel is used for alpha to coverage + depthColor.a = SharpenAlpha(builtinData.opacity, builtinData.alphaClipTreshold); + #endif // alphatomask + #endif // msaa_depth + + + #if defined(WRITE_NORMAL_BUFFER) + EncodeIntoNormalBuffer(ConvertSurfaceDataToNormalData(surfaceData), outNormalBuffer); + #endif + + #if defined(WRITE_DECAL_BUFFER) && !defined(_DISABLE_DECALS) + DecalPrepassData decalPrepassData; + // We don't have the right to access SurfaceData in a shaderpass. + // However it would be painful to have to add a function like ConvertSurfaceDataToDecalPrepassData() to every Material to return geomNormalWS anyway + // Here we will put the constrain that any Material requiring to support Decal, will need to have geomNormalWS as member of surfaceData (and we already require normalWS anyway) + decalPrepassData.geomNormalWS = surfaceData.geomNormalWS; + decalPrepassData.decalLayerMask = GetMeshRenderingDecalLayer(); + EncodeIntoDecalPrepassBuffer(decalPrepassData, outDecalBuffer); + #endif + #endif + + + } + + ENDHLSL + } + + Pass + { + Name "MotionVectors" + Tags + { + "LightMode" = "MotionVectors" + } + + // Render State + Cull Back + ZWrite On + Stencil + { + WriteMask [_StencilWriteMaskMV] + Ref [_StencilRefMV] + CompFront Always + PassFront Replace + CompBack Always + PassBack Replace + } + + Tags { "RenderType" = "Opaque" "Queue" = "Geometry" "PreviewType" = "Plane" } + Cull [_CullingOption] + ZWrite [_ZWrite] + ZTest [_ZTestMode] + + + //------------------------------------------------------------------------------------- + // End Render Modes + //------------------------------------------------------------------------------------- + + HLSLPROGRAM + + #pragma target 4.5 + #pragma only_renderers d3d11 playstation xboxone vulkan metal switch + #pragma multi_compile_instancing + #pragma instancing_options renderinglayer + + + #pragma multi_compile _ WRITE_MSAA_DEPTH + //#pragma shader_feature _ _SURFACE_TYPE_TRANSPARENT + //#pragma shader_feature_local _BLENDMODE_OFF _BLENDMODE_ALPHA _BLENDMODE_ADD _BLENDMODE_PRE_MULTIPLY + //#pragma shader_feature_local _ _ADD_PRECOMPUTED_VELOCITY + //#pragma shader_feature_local _ _TRANSPARENT_WRITES_MOTION_VEC + //#pragma shader_feature_local _ _ENABLE_FOG_ON_TRANSPARENT + #pragma multi_compile _ WRITE_NORMAL_BUFFER + //#pragma shader_feature_local _ _DISABLE_DECALS + //#pragma shader_feature_local _ _DISABLE_SSR + //#pragma shader_feature_local _ _DISABLE_SSR_TRANSPARENT + #pragma multi_compile _ WRITE_DECAL_BUFFER + //#pragma shader_feature_local _REFRACTION_OFF _REFRACTION_PLANE _REFRACTION_SPHERE _REFRACTION_THIN + + + + #define SHADERPASS SHADERPASS_MOTION_VECTORS + #define RAYTRACING_SHADER_GRAPH_DEFAULT + #define VARYINGS_NEED_PASS + #define _PASSMOTIONVECTOR 1 + + + + #pragma shader_feature_local GLOW_ON + #pragma shader_feature_local FADE_ON + #pragma shader_feature_local OUTBASE_ON + #pragma shader_feature_local ONLYOUTLINE_ON + #pragma shader_feature_local GRADIENT_ON + #pragma shader_feature_local GRADIENT2COL_ON + #pragma shader_feature_local RADIALGRADIENT_ON + #pragma shader_feature_local COLORSWAP_ON + #pragma shader_feature_local HSV_ON + #pragma shader_feature_local CHANGECOLOR_ON + #pragma shader_feature_local CHANGECOLOR2_ON + #pragma shader_feature_local CHANGECOLOR3_ON + #pragma shader_feature_local COLORRAMP_ON + #pragma shader_feature_local GRADIENTCOLORRAMP_ON + #pragma shader_feature_local HITEFFECT_ON + #pragma shader_feature_local NEGATIVE_ON + #pragma shader_feature_local PIXELATE_ON + #pragma shader_feature_local GREYSCALE_ON + #pragma shader_feature_local POSTERIZE_ON + #pragma shader_feature_local BLUR_ON + #pragma shader_feature_local MOTIONBLUR_ON + #pragma shader_feature_local GHOST_ON + #pragma shader_feature_local ALPHAOUTLINE_ON + #pragma shader_feature_local INNEROUTLINE_ON + #pragma shader_feature_local ONLYINNEROUTLINE_ON + #pragma shader_feature_local HOLOGRAM_ON + #pragma shader_feature_local CHROMABERR_ON + #pragma shader_feature_local GLITCH_ON + #pragma shader_feature_local FLICKER_ON + #pragma shader_feature_local SHADOW_ON + #pragma shader_feature_local SHINE_ON + #pragma shader_feature_local CONTRAST_ON + #pragma shader_feature_local OVERLAY_ON + #pragma shader_feature_local OVERLAYMULT_ON + #pragma shader_feature_local DOODLE_ON + #pragma shader_feature_local WIND_ON + #pragma shader_feature_local WAVEUV_ON + #pragma shader_feature_local ROUNDWAVEUV_ON + #pragma shader_feature_local RECTSIZE_ON + #pragma shader_feature_local OFFSETUV_ON + #pragma shader_feature_local CLIPPING_ON + #pragma shader_feature_local RADIALCLIPPING_ON + #pragma shader_feature_local TEXTURESCROLL_ON + #pragma shader_feature_local ZOOMUV_ON + #pragma shader_feature_local DISTORT_ON + #pragma shader_feature_local WARP_ON + #pragma shader_feature_local TWISTUV_ON + #pragma shader_feature_local ROTATEUV_ON + #pragma shader_feature_local POLARUV_ON + #pragma shader_feature_local FISHEYE_ON + #pragma shader_feature_local PINCH_ON + #pragma shader_feature_local SHAKEUV_ON + + #pragma shader_feature_local GLOWTEX_ON + #pragma shader_feature_local OUTTEX_ON + #pragma shader_feature_local OUTDIST_ON + #pragma shader_feature_local OUTBASE8DIR_ON + #pragma shader_feature_local OUTBASEPIXELPERF_ON + #pragma shader_feature_local COLORRAMPOUTLINE_ON + #pragma shader_feature_local GREYSCALEOUTLINE_ON + #pragma shader_feature_local POSTERIZEOUTLINE_ON + #pragma shader_feature_local BLURISHD_ON + #pragma shader_feature_local MANUALWIND_ON + #pragma shader_feature_local ATLAS_ON + #pragma shader_feature_local PREMULTIPLYALPHA_ON + + #pragma shader_feature BILBOARD_ON + #pragma shader_feature BILBOARDY_ON + + #pragma shader_feature NORMALMAP_ON + + + #define _HDRP 1 +#define _USINGTEXCOORD1 1 +#define _USINGTEXCOORD2 1 + + + #pragma vertex Vert + #pragma fragment Frag + + // useful conversion functions to make surface shader code just work + + #define UNITY_DECLARE_TEX2D(name) TEXTURE2D(name); SAMPLER(sampler##name); + #define UNITY_DECLARE_TEX2D_NOSAMPLER(name) TEXTURE2D(name); + #define UNITY_DECLARE_TEX2DARRAY(name) TEXTURE2D_ARRAY(name); SAMPLER(sampler##name); + #define UNITY_DECLARE_TEX2DARRAY_NOSAMPLER(tex) TEXTURE2D_ARRAY(tex); + + #define UNITY_SAMPLE_TEX2DARRAY(tex,coord) SAMPLE_TEXTURE2D_ARRAY(tex, sampler##tex, coord.xy, coord.z) + #define UNITY_SAMPLE_TEX2DARRAY_LOD(tex,coord,lod) SAMPLE_TEXTURE2D_ARRAY_LOD(tex, sampler##tex, coord.xy, coord.z, lod) + #define UNITY_SAMPLE_TEX2D(tex, coord) SAMPLE_TEXTURE2D(tex, sampler##tex, coord) + #define UNITY_SAMPLE_TEX2D_SAMPLER(tex, samp, coord) SAMPLE_TEXTURE2D(tex, sampler##samp, coord) + + #define UNITY_SAMPLE_TEX2D_LOD(tex,coord, lod) SAMPLE_TEXTURE2D_LOD(tex, sampler_##tex, coord, lod) + #define UNITY_SAMPLE_TEX2D_SAMPLER_LOD(tex,samplertex,coord, lod) SAMPLE_TEXTURE2D_LOD (tex, sampler##samplertex,coord, lod) + + #if defined(UNITY_COMPILER_HLSL) + #define UNITY_INITIALIZE_OUTPUT(type,name) name = (type)0; + #else + #define UNITY_INITIALIZE_OUTPUT(type,name) + #endif + + #define sampler2D_float sampler2D + #define sampler2D_half sampler2D + + #undef WorldNormalVector + #define WorldNormalVector(data, normal) mul(normal, data.TBNMatrix) + + #define UnityObjectToWorldNormal(normal) mul(GetObjectToWorldMatrix(), normal) + + + + +// HDRP Adapter stuff + #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Common.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/ShaderVariables.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/ShaderPass/FragInputs.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/ShaderPass/ShaderPass.cs.hlsl" + #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/TextureStack.hlsl" // Required to be include before we include properties as it define DECLARE_STACK_CB + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/ShaderGraphHeader.hlsl" // Need to be here for Gradient struct definition + + #ifdef RAYTRACING_SHADER_GRAPH_DEFAULT + #define RAYTRACING_SHADER_GRAPH_HIGH + #endif + + #ifdef RAYTRACING_SHADER_GRAPH_RAYTRACED + #define RAYTRACING_SHADER_GRAPH_LOW + #endif + // end + + + + + // If we use subsurface scattering, enable output split lighting (for forward pass) + #if defined(_MATERIAL_FEATURE_SUBSURFACE_SCATTERING) && !defined(_SURFACE_TYPE_TRANSPARENT) + #define OUTPUT_SPLIT_LIGHTING + #endif + + #define HAVE_RECURSIVE_RENDERING + + #if SHADERPASS == SHADERPASS_TRANSPARENT_DEPTH_PREPASS + #if !defined(_DISABLE_SSR_TRANSPARENT) && !defined(SHADER_UNLIT) + #define WRITE_NORMAL_BUFFER + #endif + #endif + + #ifndef DEBUG_DISPLAY + // In case of opaque we don't want to perform the alpha test, it is done in depth prepass and we use depth equal for ztest (setup from UI) + // Don't do it with debug display mode as it is possible there is no depth prepass in this case + #if !defined(_SURFACE_TYPE_TRANSPARENT) && defined(_ALPHATEST) + #if SHADERPASS == SHADERPASS_FORWARD + #define SHADERPASS_FORWARD_BYPASS_ALPHA_TEST + #elif SHADERPASS == SHADERPASS_GBUFFER + #define SHADERPASS_GBUFFER_BYPASS_ALPHA_TEST + #endif + #endif + #endif + + // Translate transparent motion vector define + #if defined(_TRANSPARENT_WRITES_MOTION_VEC) && defined(_SURFACE_TYPE_TRANSPARENT) + #define _WRITE_TRANSPARENT_MOTION_VECTOR + #endif + + + + + CBUFFER_START(UnityPerMaterial) + float _UseShadowThreshold; + float _BlendMode; + float _EnableBlendModePreserveSpecularLighting; + float _RayTracing; + float _RefractionModel; + + + half4 _Color; + half4 _MainTex_ST, _MainTex_TexelSize; + half _Alpha, _AlphaCutoffValue; + + #if ATLAS_ON + half _MinXUV, _MaxXUV, _MinYUV, _MaxYUV; + #endif + + #if GLOW_ON + half4 _GlowColor; + half _Glow, _GlowGlobal; + #endif + + #if HSV_ON + half _HsvShift, _HsvSaturation, _HsvBright; + #endif + + #if DISTORT_ON + half4 _DistortTex_ST; + half _DistortTexXSpeed, _DistortTexYSpeed, _DistortAmount; + #endif + + #if FADE_ON + half4 _FadeBurnColor, _FadeTex_ST, _FadeBurnTex_ST; + half _FadeAmount, _FadeBurnWidth, _FadeBurnTransition,_FadeBurnGlow; + #endif + + #if OUTBASE_ON + half4 _OutlineColor; + half _OutlineAlpha, _OutlineGlow, _OutlineWidth; + int _OutlinePixelWidth; + #endif + + #if OUTTEX_ON + half4 _OutlineTex_ST; + half _OutlineTexXSpeed, _OutlineTexYSpeed; + #endif + + #if OUTDIST_ON + half4 _OutlineDistortTex_ST; + half _OutlineDistortTexXSpeed, _OutlineDistortTexYSpeed, _OutlineDistortAmount; + #endif + + #if ALPHAOUTLINE_ON + half _AlphaOutlineGlow, _AlphaOutlinePower, _AlphaOutlineMinAlpha, _AlphaOutlineBlend; + half4 _AlphaOutlineColor; + #endif + + #if INNEROUTLINE_ON + half _InnerOutlineThickness, _InnerOutlineAlpha, _InnerOutlineGlow; + half4 _InnerOutlineColor; + #endif + + #if GRADIENT_ON + half _GradBlend, _GradBoostX, _GradBoostY; + half4 _GradTopRightCol, _GradTopLeftCol, _GradBotRightCol, _GradBotLeftCol; + #endif + + #if COLORSWAP_ON + half4 _ColorSwapRed, _ColorSwapGreen, _ColorSwapBlue; + half _ColorSwapRedLuminosity, _ColorSwapGreenLuminosity, _ColorSwapBlueLuminosity, _ColorSwapBlend; + #endif + + #if CHANGECOLOR_ON + half4 _ColorChangeNewCol, _ColorChangeTarget; + half _ColorChangeTolerance, _ColorChangeLuminosity; + #endif + #if CHANGECOLOR2_ON + half4 _ColorChangeNewCol2, _ColorChangeTarget2; + half _ColorChangeTolerance2; + #endif + #if CHANGECOLOR3_ON + half4 _ColorChangeNewCol3, _ColorChangeTarget3; + half _ColorChangeTolerance3; + #endif + + #if COLORRAMP_ON + half _ColorRampLuminosity, _ColorRampBlend; + #endif + + #if HITEFFECT_ON + half4 _HitEffectColor; + half _HitEffectGlow, _HitEffectBlend; + #endif + + #if NEGATIVE_ON + half _NegativeAmount; + #endif + + #if PIXELATE_ON + half _PixelateSize; + #endif + + #if GREYSCALE_ON + half _GreyscaleLuminosity, _GreyscaleBlend; + half4 _GreyscaleTintColor; + #endif + + #if POSTERIZE_ON + half _PosterizeNumColors, _PosterizeGamma; + #endif + + #if BLUR_ON + half _BlurIntensity; + #endif + + #if MOTIONBLUR_ON + half _MotionBlurAngle, _MotionBlurDist; + #endif + + #if GHOST_ON + half _GhostColorBoost, _GhostTransparency, _GhostBlend; + #endif + + #if HOLOGRAM_ON + half _HologramStripesAmount, _HologramMinAlpha, _HologramUnmodAmount, _HologramStripesSpeed, _HologramMaxAlpha, _HologramBlend; + half4 _HologramStripeColor; + #endif + + #if CHROMABERR_ON + half _ChromAberrAmount, _ChromAberrAlpha; + #endif + + #if GLITCH_ON + half _GlitchAmount, _GlitchSize; + #endif + + #if FLICKER_ON + half _FlickerFreq, _FlickerPercent, _FlickerAlpha; + #endif + + #if SHADOW_ON + half _ShadowX, _ShadowY, _ShadowAlpha; + half4 _ShadowColor; + #endif + + #if SHINE_ON + half4 _ShineColor; + half _ShineLocation, _ShineRotate, _ShineWidth, _ShineGlow; + #endif + + #if CONTRAST_ON + half _Contrast, _Brightness; + #endif + + #if OVERLAY_ON + half4 _OverlayTex_ST, _OverlayColor; + half _OverlayGlow, _OverlayBlend, _OverlayTextureScrollXSpeed, _OverlayTextureScrollYSpeed; + #endif + + #if DOODLE_ON + half _HandDrawnAmount, _HandDrawnSpeed; + #endif + + #if WIND_ON + half _GrassSpeed, _GrassWind, _GrassManualAnim, _GrassRadialBend; + #endif + + #if WAVEUV_ON + float _WaveAmount, _WaveSpeed, _WaveStrength, _WaveX, _WaveY; + #endif + + #if ROUNDWAVEUV_ON + half _RoundWaveStrength, _RoundWaveSpeed; + #endif + + #if RECTSIZE_ON + half _RectSize; + #endif + + #if OFFSETUV_ON + half _OffsetUvX, _OffsetUvY; + #endif + + #if CLIPPING_ON + half _ClipUvLeft, _ClipUvRight, _ClipUvUp, _ClipUvDown; + #endif + + #if RADIALCLIPPING_ON + half _RadialStartAngle, _RadialClip, _RadialClip2; + #endif + + #if TEXTURESCROLL_ON + half _TextureScrollXSpeed, _TextureScrollYSpeed; + #endif + + #if ZOOMUV_ON + half _ZoomUvAmount; + #endif + + #if WARP_ON + half _WarpStrength, _WarpSpeed, _WarpScale; + #endif + + #if TWISTUV_ON + half _TwistUvAmount, _TwistUvPosX, _TwistUvPosY, _TwistUvRadius; + #endif + + #if ROTATEUV_ON + half _RotateUvAmount; + #endif + + #if FISHEYE_ON + half _FishEyeUvAmount; + #endif + + #if PINCH_ON + half _PinchUvAmount; + #endif + + #if SHAKEUV_ON + half _ShakeUvSpeed, _ShakeUvX, _ShakeUvY; + #endif + + #if NORMALMAP_ON + half _NormalStrength; + #endif + + float _RandomSeed; + + + + + CBUFFER_END + + + + // -- Property used by ScenePickingPass + #ifdef SCENEPICKINGPASS + float4 _SelectionID; + #endif + + // -- Properties used by SceneSelectionPass + #ifdef SCENESELECTIONPASS + int _ObjectId; + int _PassValue; + #endif + + + // data across stages, stripped like the above. + struct VertexToPixel + { + float4 pos : SV_POSITION; + float3 worldPos : TEXCOORD0; + float3 worldNormal : TEXCOORD1; + float4 worldTangent : TEXCOORD2; + float4 texcoord0 : TEXCOORD3; + float4 texcoord1 : TEXCOORD4; + float4 texcoord2 : TEXCOORD5; + // #if %TEXCOORD3REQUIREKEY% + float4 texcoord3 : TEXCOORD6; + // #endif + + // #if %SCREENPOSREQUIREKEY% + // float4 screenPos : TEXCOORD7; + // #endif + + // #if %VERTEXCOLORREQUIREKEY% + float4 vertexColor : COLOR; + // #endif + + // #if %EXTRAV2F0REQUIREKEY% + // float4 extraV2F0 : TEXCOORD8; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // float4 extraV2F1 : TEXCOORD9; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // float4 extraV2F2 : TEXCOORD10; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // float4 extraV2F3 : TEXCOORD11; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // float4 extraV2F4 : TEXCOORD12; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // float4 extraV2F5 : TEXCOORD13; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // float4 extraV2F6 : TEXCOORD14; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // float4 extraV2F7 : TEXCOORD15; + // #endif + + #if UNITY_ANY_INSTANCING_ENABLED + UNITY_VERTEX_INPUT_INSTANCE_ID + #endif // UNITY_ANY_INSTANCING_ENABLED + + #if _HDRP && (_PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR))) + float4 previousPositionCS : TEXCOORD16; // Contain previous transform position (in case of skinning for example) + float4 motionVectorCS : TEXCOORD17; + #endif + + UNITY_VERTEX_OUTPUT_STEREO + }; + + + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Debug/DebugDisplay.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/Material.hlsl" + #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/NormalSurfaceGradient.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/Lit/Lit.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/BuiltinUtilities.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/MaterialUtilities.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/Decal/DecalUtilities.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/Lit/LitDecalData.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/ShaderGraphFunctions.hlsl" + + + + // data describing the user output of a pixel + struct Surface + { + half3 Albedo; + half Height; + half3 Normal; + half Smoothness; + half3 Emission; + half Metallic; + half3 Specular; + half Occlusion; + half SpecularPower; // for simple lighting + half Alpha; + float outputDepth; // if written, SV_Depth semantic is used. ShaderData.clipPos.z is unused value + // HDRP Only + half SpecularOcclusion; + half SubsurfaceMask; + half Thickness; + half CoatMask; + half CoatSmoothness; + half Anisotropy; + half IridescenceMask; + half IridescenceThickness; + int DiffusionProfileHash; + float SpecularAAThreshold; + float SpecularAAScreenSpaceVariance; + // requires _OVERRIDE_BAKEDGI to be defined, but is mapped in all pipelines + float3 DiffuseGI; + float3 BackDiffuseGI; + float3 SpecularGI; + float ior; + float3 transmittanceColor; + float atDistance; + float transmittanceMask; + // requires _OVERRIDE_SHADOWMASK to be defines + float4 ShadowMask; + + // for decals + float NormalAlpha; + float MAOSAlpha; + + + }; + + // Data the user declares in blackboard blocks + struct Blackboard + { + + float blackboardDummyData; + }; + + // data the user might need, this will grow to be big. But easy to strip + struct ShaderData + { + float4 clipPos; // SV_POSITION + float3 localSpacePosition; + float3 localSpaceNormal; + float3 localSpaceTangent; + + float3 worldSpacePosition; + float3 worldSpaceNormal; + float3 worldSpaceTangent; + float tangentSign; + + float3 worldSpaceViewDir; + float3 tangentSpaceViewDir; + + float4 texcoord0; + float4 texcoord1; + float4 texcoord2; + float4 texcoord3; + + float2 screenUV; + float4 screenPos; + + float4 vertexColor; + bool isFrontFace; + + float4 extraV2F0; + float4 extraV2F1; + float4 extraV2F2; + float4 extraV2F3; + float4 extraV2F4; + float4 extraV2F5; + float4 extraV2F6; + float4 extraV2F7; + + float3x3 TBNMatrix; + Blackboard blackboard; + }; + + struct VertexData + { + #if SHADER_TARGET > 30 + // uint vertexID : SV_VertexID; + #endif + float4 vertex : POSITION; + float3 normal : NORMAL; + float4 tangent : TANGENT; + float4 texcoord0 : TEXCOORD0; + + // optimize out mesh coords when not in use by user or lighting system + #if _URP && (_USINGTEXCOORD1 || _PASSMETA || _PASSFORWARD || _PASSGBUFFER) + float4 texcoord1 : TEXCOORD1; + #endif + + #if _URP && (_USINGTEXCOORD2 || _PASSMETA || ((_PASSFORWARD || _PASSGBUFFER) && defined(DYNAMICLIGHTMAP_ON))) + float4 texcoord2 : TEXCOORD2; + #endif + + #if _STANDARD && (_USINGTEXCOORD1 || (_PASSMETA || ((_PASSFORWARD || _PASSGBUFFER || _PASSFORWARDADD) && LIGHTMAP_ON))) + float4 texcoord1 : TEXCOORD1; + #endif + #if _STANDARD && (_USINGTEXCOORD2 || (_PASSMETA || ((_PASSFORWARD || _PASSGBUFFER) && DYNAMICLIGHTMAP_ON))) + float4 texcoord2 : TEXCOORD2; + #endif + + + #if _HDRP + float4 texcoord1 : TEXCOORD1; + float4 texcoord2 : TEXCOORD2; + #endif + + // #if %TEXCOORD3REQUIREKEY% + float4 texcoord3 : TEXCOORD3; + // #endif + + // #if %VERTEXCOLORREQUIREKEY% + float4 vertexColor : COLOR; + // #endif + + #if _PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR)) + float3 previousPositionOS : TEXCOORD4; // Contain previous transform position (in case of skinning for example) + #if defined (_ADD_PRECOMPUTED_VELOCITY) + float3 precomputedVelocity : TEXCOORD5; // Add Precomputed Velocity (Alembic computes velocities on runtime side). + #endif + #endif + + UNITY_VERTEX_INPUT_INSTANCE_ID + }; + + struct TessVertex + { + float4 vertex : INTERNALTESSPOS; + float3 normal : NORMAL; + float4 tangent : TANGENT; + float4 texcoord0 : TEXCOORD0; + float4 texcoord1 : TEXCOORD1; + float4 texcoord2 : TEXCOORD2; + + // #if %TEXCOORD3REQUIREKEY% + float4 texcoord3 : TEXCOORD3; + // #endif + + // #if %VERTEXCOLORREQUIREKEY% + float4 vertexColor : COLOR; + // #endif + + // #if %EXTRAV2F0REQUIREKEY% + // float4 extraV2F0 : TEXCOORD5; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // float4 extraV2F1 : TEXCOORD6; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // float4 extraV2F2 : TEXCOORD7; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // float4 extraV2F3 : TEXCOORD8; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // float4 extraV2F4 : TEXCOORD9; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // float4 extraV2F5 : TEXCOORD10; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // float4 extraV2F6 : TEXCOORD11; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // float4 extraV2F7 : TEXCOORD12; + // #endif + + #if _PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR)) + float3 previousPositionOS : TEXCOORD13; // Contain previous transform position (in case of skinning for example) + #if defined (_ADD_PRECOMPUTED_VELOCITY) + float3 precomputedVelocity : TEXCOORD14; + #endif + #endif + + UNITY_VERTEX_INPUT_INSTANCE_ID + UNITY_VERTEX_OUTPUT_STEREO + }; + + struct ExtraV2F + { + float4 extraV2F0; + float4 extraV2F1; + float4 extraV2F2; + float4 extraV2F3; + float4 extraV2F4; + float4 extraV2F5; + float4 extraV2F6; + float4 extraV2F7; + Blackboard blackboard; + float4 time; + }; + + + float3 WorldToTangentSpace(ShaderData d, float3 normal) + { + return mul(d.TBNMatrix, normal); + } + + float3 TangentToWorldSpace(ShaderData d, float3 normal) + { + return mul(normal, d.TBNMatrix); + } + + // in this case, make standard more like SRPs, because we can't fix + // unity_WorldToObject in HDRP, since it already does macro-fu there + + #if _STANDARD + float3 TransformWorldToObject(float3 p) { return mul(unity_WorldToObject, float4(p, 1)); }; + float3 TransformObjectToWorld(float3 p) { return mul(unity_ObjectToWorld, float4(p, 1)); }; + float4 TransformWorldToObject(float4 p) { return mul(unity_WorldToObject, p); }; + float4 TransformObjectToWorld(float4 p) { return mul(unity_ObjectToWorld, p); }; + float4x4 GetWorldToObjectMatrix() { return unity_WorldToObject; } + float4x4 GetObjectToWorldMatrix() { return unity_ObjectToWorld; } + #if (defined(SHADER_API_D3D11) || defined(SHADER_API_XBOXONE) || defined(UNITY_COMPILER_HLSLCC) || defined(SHADER_API_PSSL) || (SHADER_TARGET_SURFACE_ANALYSIS && !SHADER_TARGET_SURFACE_ANALYSIS_MOJOSHADER)) + #define UNITY_SAMPLE_TEX2D_LOD(tex,coord, lod) tex.SampleLevel (sampler##tex,coord, lod) + #define UNITY_SAMPLE_TEX2D_SAMPLER_LOD(tex,samplertex,coord, lod) tex.SampleLevel (sampler##samplertex,coord, lod) + #else + #define UNITY_SAMPLE_TEX2D_LOD(tex,coord,lod) tex2D (tex,coord,0,lod) + #define UNITY_SAMPLE_TEX2D_SAMPLER_LOD(tex,samplertex,coord,lod) tex2D (tex,coord,0,lod) + #endif + + #undef GetWorldToObjectMatrix() + + #define GetWorldToObjectMatrix() unity_WorldToObject + + + #endif + + float3 GetCameraWorldPosition() + { + #if _HDRP + return GetCameraRelativePositionWS(_WorldSpaceCameraPos); + #else + return _WorldSpaceCameraPos; + #endif + } + + #if _GRABPASSUSED + #if _STANDARD + TEXTURE2D(%GRABTEXTURE%); + SAMPLER(sampler_%GRABTEXTURE%); + #endif + + half3 GetSceneColor(float2 uv) + { + #if _STANDARD + return SAMPLE_TEXTURE2D(%GRABTEXTURE%, sampler_%GRABTEXTURE%, uv).rgb; + #else + return SHADERGRAPH_SAMPLE_SCENE_COLOR(uv); + #endif + } + #endif + + + + #if _STANDARD + UNITY_DECLARE_DEPTH_TEXTURE(_CameraDepthTexture); + float GetSceneDepth(float2 uv) { return SAMPLE_DEPTH_TEXTURE(_CameraDepthTexture, uv); } + float GetLinear01Depth(float2 uv) { return Linear01Depth(GetSceneDepth(uv)); } + float GetLinearEyeDepth(float2 uv) { return LinearEyeDepth(GetSceneDepth(uv)); } + #else + float GetSceneDepth(float2 uv) { return SHADERGRAPH_SAMPLE_SCENE_DEPTH(uv); } + float GetLinear01Depth(float2 uv) { return Linear01Depth(GetSceneDepth(uv), _ZBufferParams); } + float GetLinearEyeDepth(float2 uv) { return LinearEyeDepth(GetSceneDepth(uv), _ZBufferParams); } + #endif + + float3 GetWorldPositionFromDepthBuffer(float2 uv, float3 worldSpaceViewDir) + { + float eye = GetLinearEyeDepth(uv); + float3 camView = mul((float3x3)GetObjectToWorldMatrix(), transpose(mul(GetWorldToObjectMatrix(), UNITY_MATRIX_I_V)) [2].xyz); + + float dt = dot(worldSpaceViewDir, camView); + float3 div = worldSpaceViewDir/dt; + float3 wpos = (eye * div) + GetCameraWorldPosition(); + return wpos; + } + + #if _HDRP + float3 ObjectToWorldSpacePosition(float3 pos) + { + return GetAbsolutePositionWS(TransformObjectToWorld(pos)); + } + #else + float3 ObjectToWorldSpacePosition(float3 pos) + { + return TransformObjectToWorld(pos); + } + #endif + + #if _STANDARD + UNITY_DECLARE_SCREENSPACE_TEXTURE(_CameraDepthNormalsTexture); + float3 GetSceneNormal(float2 uv, float3 worldSpaceViewDir) + { + float4 depthNorms = UNITY_SAMPLE_SCREENSPACE_TEXTURE(_CameraDepthNormalsTexture, uv); + float3 norms = DecodeViewNormalStereo(depthNorms); + norms = mul((float3x3)GetWorldToViewMatrix(), norms) * 0.5 + 0.5; + return norms; + } + #elif _HDRP && !_DECALSHADER + + float3 GetSceneNormal(float2 uv, float3 worldSpaceViewDir) + { + NormalData nd; + DecodeFromNormalBuffer(_ScreenSize.xy * uv, nd); + return nd.normalWS; + } + #elif _URP + #if (SHADER_LIBRARY_VERSION_MAJOR >= 10) + #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/DeclareNormalsTexture.hlsl" + #endif + + float3 GetSceneNormal(float2 uv, float3 worldSpaceViewDir) + { + #if (SHADER_LIBRARY_VERSION_MAJOR >= 10) + return SampleSceneNormals(uv); + #else + float3 wpos = GetWorldPositionFromDepthBuffer(uv, worldSpaceViewDir); + return normalize(-cross(ddx(wpos), ddy(wpos))) * 0.5 + 0.5; + #endif + + } + #endif + + #if _HDRP + + half3 UnpackNormalmapRGorAG(half4 packednormal) + { + // This do the trick + packednormal.x *= packednormal.w; + + half3 normal; + normal.xy = packednormal.xy * 2 - 1; + normal.z = sqrt(1 - saturate(dot(normal.xy, normal.xy))); + return normal; + } + half3 UnpackNormal(half4 packednormal) + { + #if defined(UNITY_NO_DXT5nm) + return packednormal.xyz * 2 - 1; + #else + return UnpackNormalmapRGorAG(packednormal); + #endif + } + #endif + #if _HDRP || _URP + + half3 UnpackScaleNormal(half4 packednormal, half scale) + { + #ifndef UNITY_NO_DXT5nm + // Unpack normal as DXT5nm (1, y, 1, x) or BC5 (x, y, 0, 1) + // Note neutral texture like "bump" is (0, 0, 1, 1) to work with both plain RGB normal and DXT5nm/BC5 + packednormal.x *= packednormal.w; + #endif + half3 normal; + normal.xy = (packednormal.xy * 2 - 1) * scale; + normal.z = sqrt(1 - saturate(dot(normal.xy, normal.xy))); + return normal; + } + + #endif + + + void GetSun(out float3 lightDir, out float3 color) + { + lightDir = float3(0.5, 0.5, 0); + color = 1; + #if _HDRP + if (_DirectionalLightCount > 0) + { + DirectionalLightData light = _DirectionalLightDatas[0]; + lightDir = -light.forward.xyz; + color = light.color; + } + #elif _STANDARD + lightDir = normalize(_WorldSpaceLightPos0.xyz); + color = _LightColor0.rgb; + #elif _URP + Light light = GetMainLight(); + lightDir = light.direction; + color = light.color; + #endif + } + + + + + + + + + + TEXTURE2D(_MainTex); + SAMPLER(sampler_MainTex); + + #if GLOW_ON + TEXTURE2D(_GlowTex); + SAMPLER(sampler_GlowTex); + #endif + + #if FADE_ON + TEXTURE2D(_FadeTex); + SAMPLER(sampler_FadeTex); + + TEXTURE2D(_FadeBurnTex); + SAMPLER(sampler_FadeBurnTex); + #endif + + #if DISTORT_ON + TEXTURE2D(_DistortTex); + SAMPLER(sampler_DistortTex); + #endif + + #if OUTTEX_ON + TEXTURE2D(_OutlineTex); + SAMPLER(sampler_OutlineTex); + #endif + + #if OUTDIST_ON + TEXTURE2D(_OutlineDistortTex); + SAMPLER(sampler_OutlineDistortTex); + #endif + + #if COLORSWAP_ON + TEXTURE2D(_ColorSwapTex); + SAMPLER(sampler_ColorSwapTex); + #endif + + #if COLORRAMP_ON + TEXTURE2D(_ColorRampTex); + TEXTURE2D(_ColorRampTexGradient); + SAMPLER(sampler_ColorRampTex); + SAMPLER(sampler_ColorRampTexGradient); + #endif + + #if SHINE_ON + TEXTURE2D(_ShineMask); + SAMPLER(sampler_ShineMask); + #endif + + #if OVERLAY_ON + TEXTURE2D(_OverlayTex); + SAMPLER(sampler_OverlayTex); + #endif + + #if NORMALMAP_ON + TEXTURE2D(_NormalMap); + SAMPLER(sampler_NormalMap); + #endif + + + half3 GetPixel(in int offsetX, in int offsetY, in half2 uv, in Texture2D _tex, in SamplerState _sampler) + { + half2 _uv = uv + half2(offsetX * _MainTex_TexelSize.x, offsetY * _MainTex_TexelSize.y); + half4 col = SAMPLE_TEXTURE2D(_tex, _sampler, _uv); + return col.rgb; + } + + + //BLURS------------------------------------------------------------------------- + half4 Blur(half2 uv, Texture2D source, SamplerState sampler_source, half Intensity) + { + const half2 texelSize = 1.0 / _ScreenParams.xy; + const half4 color = SAMPLE_TEXTURE2D(source, sampler_source, uv); + const half2 offset = Intensity * texelSize; + + half4 accumulatedColor = color; + half accumulatedWeight = 1.0; + for (int x = -1; x <= 1; x++) + { + for (int y = -1; y <= 1; y++) + { + const half2 sampleUV = uv + half2(x, y) * offset; + const half4 sampleColor = SAMPLE_TEXTURE2D(source, sampler_source, sampleUV); + + accumulatedColor += sampleColor; + accumulatedWeight += 1.0; + } + } + + half4 blurredColor = accumulatedColor / accumulatedWeight; + return blurredColor; + } + + half BlurHD_G(half bhqp, half x) + { + return exp(-(x * x) / (2.0 * bhqp * bhqp)); + } + half4 BlurHD(half2 uv, Texture2D source, SamplerState sampler_source, half BlurAmount, half xScale, half yScale) + { + int iterations = 16; + int halfIterations = iterations / 2; + half sigmaX = 0.1 + BlurAmount * 0.5; + half sigmaY = sigmaX; + half total = 0.0; + half4 ret = half4(0, 0, 0, 0); + for (int iy = 0; iy < iterations; ++iy) + { + half fy = BlurHD_G(sigmaY, half(iy) -half(halfIterations)); + half offsetY = half(iy - halfIterations) * 0.00390625 * xScale; + for (int ix = 0; ix < iterations; ++ix) + { + half fx = BlurHD_G(sigmaX, half(ix) - half(halfIterations)); + half offsetX = half(ix - halfIterations) * 0.00390625 * yScale; + total += fx * fy; + ret += SAMPLE_TEXTURE2D(source, sampler_source, uv + half2(offsetX, offsetY)) * fx * fy; + } + } + return ret / total; + } + //----------------------------------------------------------------------- + + + //------------------------------------------- + half RemapFloat(half inValue, half inMin, half inMax, half outMin, half outMax){ + return outMin + (inValue - inMin) * (outMax - outMin) / (inMax - inMin); + } + //------------------------------------------- + + //----------------------------------------------------------------------- + half rand(half2 seed, half offset) { + return (frac(sin(dot(seed, half2(12.9898, 78.233))) * 43758.5453) + offset) % 1.0; + } + + half rand2(half2 seed, half offset) { + return (frac(sin(dot(seed * floor(50 + (_Time.x % 1.0) * 12.), half2(127.1, 311.7))) * 43758.5453123) + offset) % 1.0; + } + + half rand2CustomTime(half2 seed, half offset, half customTime) { + return (frac(sin(dot(seed * floor(50 + (customTime % 1.0) * 12.), half2(127.1, 311.7))) * 43758.5453123) + offset) % 1.0; + } + //----------------------------------------------------------------------- + + + void Ext_ModifyVertex0 (inout VertexData v, inout ExtraV2F d) + { + //BILBOARD_ON + #if BILBOARD_ON + half3 camRight = mul((half3x3)unity_CameraToWorld, half3(1,0,0)); + half3 camUp = half3(0,1,0); + #if BILBOARDY_ON + camUp = mul((half3x3)unity_CameraToWorld, half3(0,1,0)); + #endif + half3 localPos = v.vertex.x * camRight + v.vertex.y * camUp; + v.vertex = half4(localPos, 1); + #endif + //----------------------------------------------------------- + + v.texcoord0.xy = TRANSFORM_TEX(v.texcoord0.xy, _MainTex); + half2 center = half2(0.5, 0.5); + #if ATLAS_ON + center = half2((_MaxXUV + _MinXUV) / 2.0, (_MaxYUV + _MinYUV) / 2.0); + #endif + + //POLARUV_ON + #if POLARUV_ON + v.texcoord0.xy = v.texcoord0.xy - center; + #endif + + //---------------------------------------- + + //ROTATEUV_ON + #if ROTATEUV_ON + half2 uvC = v.texcoord0.xy; + half cosAngle = cos(_RotateUvAmount); + half sinAngle = sin(_RotateUvAmount); + half2x2 rot = half2x2(cosAngle, -sinAngle, sinAngle, cosAngle); + uvC -= center; + v.texcoord0.xy = mul(rot, uvC); + v.texcoord0.xy += center; + #endif + //-------------------- + + #if RECTSIZE_ON + v.vertex.xyz += (v.vertex.xyz * (_RectSize - 1.0)); + #endif + + #if OUTTEX_ON + v.texcoord1.xy = TRANSFORM_TEX(v.texcoord0.xy, _OutlineTex); + #endif + + #if OUTDIST_ON + v.texcoord2.xy = TRANSFORM_TEX(v.texcoord0.xy, _OutlineDistortTex); + #endif + + #if DISTORT_ON + v.texcoord3.xy = TRANSFORM_TEX(v.texcoord0.xy, _DistortTex); + #endif + } + + void Ext_SurfaceFunction0 (inout Surface o, ShaderData d) + { + half randomSeed = _RandomSeed; + + float2 uvRect = d.texcoord0; + half2 center = half2(0.5, 0.5); + #if ATLAS_ON + center = half2((_MaxXUV + _MinXUV) / 2.0, (_MaxYUV + _MinYUV) / 2.0); + uvRect = half2((d.texcoord0.x - _MinXUV) / (_MaxXUV - _MinXUV), (d.texcoord0.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half2 centerTiled = half2(center.x * _MainTex_ST.x, center.y * _MainTex_ST.y); + + //CLIPPING_ON + #if CLIPPING_ON + half2 tiledUv = half2(d.texcoord0.x / _MainTex_ST.x, d.texcoord0.y / _MainTex_ST.y); + #if ATLAS_ON + tiledUv = half2((tiledUv.x - _MinXUV) / (_MaxXUV - _MinXUV), (tiledUv.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + clip((1 - _ClipUvUp) - tiledUv.y); + clip(tiledUv.y - _ClipUvDown); + clip((1 - _ClipUvRight) - tiledUv.x); + clip(tiledUv.x - _ClipUvLeft); + #endif + //---------------------------------- + + //RADIALCLIPPING_ON + #if RADIALCLIPPING_ON + half2 tiledUv2 = half2(d.texcoord0.x / _MainTex_ST.x, d.texcoord0.y / _MainTex_ST.y); + #if ATLAS_ON + tiledUv2 = half2((tiledUv2.x - _MinXUV) / (_MaxXUV - _MinXUV), (tiledUv2.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half startAngle = _RadialStartAngle - _RadialClip; + half endAngle = _RadialStartAngle + _RadialClip2; + half offset0 = clamp(0, 360, startAngle + 360); + half offset360 = clamp(0, 360, endAngle - 360); + half2 atan2Coord = half2(lerp(-1, 1, tiledUv2.x), lerp(-1, 1, tiledUv2.y)); + half atanAngle = atan2(atan2Coord.y, atan2Coord.x) * 57.3; // angle in degrees + if(atanAngle < 0) atanAngle = 360 + atanAngle; + if(atanAngle >= startAngle && atanAngle <= endAngle) discard; + if(atanAngle <= offset360) discard; + if(atanAngle >= offset0) discard; + #endif + + //----------------------------- + + //TEXTURESCROLL_ON && ATLAS_ON + #if TEXTURESCROLL_ON && ATLAS_ON + d.texcoord0.xy = half2(_MinXUV + ((_MaxXUV - _MinXUV) * (abs(((_Time.y + randomSeed) * _TextureScrollXSpeed) + uvRect.x) % 1)), + _MinYUV + ((_MaxYUV - _MinYUV) * (abs(((_Time.y + randomSeed) * _TextureScrollYSpeed) + uvRect.y) % 1))); + #endif + //---------------------------- + + //OFFSETUV_ON + #if OFFSETUV_ON + #if ATLAS_ON + d.texcoord0.xy = half2(_MinXUV + ((_MaxXUV - _MinXUV) * (abs((_OffsetUvX + uvRect.x) % 1))), + _MinYUV + ((_MaxYUV - _MinYUV) * (abs(_OffsetUvY + uvRect.y) % 1))); + #else + d.texcoord0.xy += half2(_OffsetUvX, _OffsetUvY); + #endif + #endif + + //---------------------- + + //POLARUV_ON + #if POLARUV_ON + d.texcoord0.xy = half2(atan2(d.texcoord0.y, d.texcoord0.x) / (2.0f * 3.141592653589f), length(d.texcoord0.xy)); + d.texcoord0.xy *= _MainTex_ST.xy; + #endif + + //-------------------------------------- + + //TWISTUV_ON + #if TWISTUV_ON + #if ATLAS_ON + _TwistUvPosX = ((_MaxXUV - _MinXUV) * _TwistUvPosX) + _MinXUV; + _TwistUvPosY = ((_MaxYUV - _MinYUV) * _TwistUvPosY) + _MinYUV; + #endif + half2 tempUv = d.texcoord0.xy - half2(_TwistUvPosX * _MainTex_ST.x, _TwistUvPosY * _MainTex_ST.y); + _TwistUvRadius *= (_MainTex_ST.x + _MainTex_ST.y) / 2; + half percent = (_TwistUvRadius - length(tempUv)) / _TwistUvRadius; + half theta = percent * percent * (2.0 * sin(_TwistUvAmount)) * 8.0; + half s = sin(theta); + half c = cos(theta); + half beta = max(sign(_TwistUvRadius - length(tempUv)), 0.0); + tempUv = half2(dot(tempUv, half2(c, -s)), dot(tempUv, half2(s, c))) * beta + tempUv * (1 - beta); + tempUv += half2(_TwistUvPosX * _MainTex_ST.x, _TwistUvPosY * _MainTex_ST.y); + d.texcoord0.xy = tempUv; + #endif + + //-------------------------------------------- + + //FISHEYE_ON + #if FISHEYE_ON + half bind = length(centerTiled); + half2 dF = d.texcoord0.xy - centerTiled; + half dFlen = length(dF); + half fishInt = (3.14159265359 / bind) * (_FishEyeUvAmount + 0.001); + d.texcoord0.xy = centerTiled + (dF / (max(0.0001, dFlen))) * tan(dFlen * fishInt) * bind / tan(bind * fishInt); + #endif + //--------------------------------------------- + + //PINCH_ON + #if PINCH_ON + half2 dP = d.texcoord0.xy - centerTiled; + half pinchInt = (3.141592 / length(centerTiled)) * (-_PinchUvAmount + 0.001); + d.texcoord0.xy = centerTiled + normalize(dP) * atan(length(dP) * -pinchInt * 10.0) * 0.5 / atan(-pinchInt * 5); + #endif + + //--------------------------------------------- + + //ZOOMUV_ON + #if ZOOMUV_ON + d.texcoord0.xy -= centerTiled; + d.texcoord0.xy = d.texcoord0.xy * _ZoomUvAmount; + d.texcoord0.xy += centerTiled; + #endif + + //----------------------------------------------- + + //DOODLE_ON + #if DOODLE_ON + half2 uvCopy = uvRect; + _HandDrawnSpeed = (floor((_Time.x + randomSeed) * 20 * _HandDrawnSpeed) / _HandDrawnSpeed) * _HandDrawnSpeed; + uvCopy.x = sin((uvCopy.x * _HandDrawnAmount + _HandDrawnSpeed) * 4); + uvCopy.y = cos((uvCopy.y * _HandDrawnAmount + _HandDrawnSpeed) * 4); + d.texcoord0.xy = lerp(d.texcoord0.xy, d.texcoord0.xy + uvCopy, 0.0005 * _HandDrawnAmount); + #endif + + //-------------------------- + + //SHAKEUV_ON + #if SHAKEUV_ON + half xShake = sin((_Time.x + randomSeed) * _ShakeUvSpeed * 50) * _ShakeUvX; + half yShake = cos((_Time.x + randomSeed) * _ShakeUvSpeed * 50) * _ShakeUvY; + d.texcoord0.xy += half2(xShake * 0.012, yShake * 0.01); + #endif + + //------------------------------------------- + + //RECTSIZE_ON + #if RECTSIZE_ON + d.texcoord0.xy = d.texcoord0.xy * (_RectSize).xx + (((-_RectSize * 0.5) + 0.5)).xx; + #endif + + //------------------------------------------- + + //DISTORT_ON + #if DISTORT_ON + #if ATLAS_ON + d.texcoord3.x = d.texcoord3.x * (1 / (_MaxXUV - _MinXUV)); + d.texcoord3.y = d.texcoord3.y * (1 / (_MaxYUV - _MinYUV)); + #endif + + d.texcoord3.x += ((_Time.x + _RandomSeed) * _DistortTexXSpeed) % 1; + d.texcoord3.y += ((_Time.x + _RandomSeed) * _DistortTexYSpeed) % 1; + half distortAmnt = (SAMPLE_TEXTURE2D(_DistortTex, sampler_DistortTex, d.texcoord3.xy).r - 0.5) * 0.2 * _DistortAmount; + d.texcoord0.x += distortAmnt; + d.texcoord0.y += distortAmnt; + #endif + //------------------------------------------------------- + + //WARP_ON + #if WARP_ON + half2 warpUv = half2(d.texcoord0.x / _MainTex_ST.x, d.texcoord0.y / _MainTex_ST.y); + #if ATLAS_ON + warpUv = half2((warpUv.x - _MinXUV) / (_MaxXUV - _MinXUV), (warpUv.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + const float tau = 6.283185307179586; + float xWarp = (_Time.y + randomSeed) * _WarpSpeed + warpUv.x * tau / _WarpScale; + float yWarp = (_Time.y + randomSeed) * _WarpSpeed + warpUv.y * tau / _WarpScale; + float2 warp = float2(sin(xWarp), sin(yWarp)) * _WarpStrength; + d.texcoord0.xy += warp; + #endif + + //------------------------------------------------------- + + //WAVEUV_ON + #if WAVEUV_ON + float2 uvWave = half2(_WaveX * _MainTex_ST.x, _WaveY * _MainTex_ST.y) - d.texcoord0.xy; + uvWave %= 1; + #if ATLAS_ON + uvWave = half2(_WaveX, _WaveY) - uvRect; + #endif + uvWave.x *= _ScreenParams.x / _ScreenParams.y; + float waveTime = _Time.y + randomSeed; + float angWave = (sqrt(dot(uvWave, uvWave)) * _WaveAmount) - ((waveTime * _WaveSpeed)); + d.texcoord0.xy = d.texcoord0.xy + uvWave * sin(angWave) * (_WaveStrength / 1000.0); + #endif + //---------------------------------------------------- + + //ROUNDWAVEUV_ON + #if ROUNDWAVEUV_ON + half xWave = ((0.5 * _MainTex_ST.x) - uvRect.x); + half yWave = ((0.5 * _MainTex_ST.y) - uvRect.y) * (_MainTex_TexelSize.w / _MainTex_TexelSize.z); + half ripple = -sqrt(xWave*xWave + yWave* yWave); + d.texcoord0.xy += (sin((ripple + (_Time.y + randomSeed) * (_RoundWaveSpeed/10.0)) / 0.015) * (_RoundWaveStrength/10.0)) % 1; + #endif + //---------------------------------------------------- + + + //WIND_ON + #if WIND_ON + half windOffset = sin((_Time.x + randomSeed) * _GrassSpeed * 10); + half2 windCenter = half2(0.5, 0.1); + #if ATLAS_ON + windCenter.x = ((_MaxXUV - _MinXUV) * windCenter.x) + _MinXUV; + windCenter.y = ((_MaxYUV - _MinYUV) * windCenter.y) + _MinYUV; + #endif + #if !MANUALWIND_ON + d.texcoord0.x = fmod(abs(lerp(d.texcoord0.x, d.texcoord0.x + (_GrassWind * 0.01 * windOffset), uvRect.y)), 1); + #else + d.texcoord0.x = fmod(abs(lerp(d.texcoord0.x, d.texcoord0.x + (_GrassWind * 0.01 * _GrassManualAnim), uvRect.y)), 1); + windOffset = _GrassManualAnim; + #endif + half2 delta = d.texcoord0.xy - windCenter; + half delta2 = dot(delta.xy, delta.xy); + half2 delta_offset = delta2 * windOffset; + d.texcoord0.xy = d.texcoord0.xy + half2(delta.y, -delta.x) * delta_offset * _GrassRadialBend; + #endif + + //-------------------------------------------------------- + + //TEXTURESCROLL_ON && !ATLAS_ON + #if TEXTURESCROLL_ON && !ATLAS_ON + d.texcoord0.x += ((_Time.y + randomSeed) * _TextureScrollXSpeed) % 1; + d.texcoord0.y += ((_Time.y + randomSeed) * _TextureScrollYSpeed) % 1; + #endif + //------------------------------ + + //PIXELATE_ON + #if PIXELATE_ON + half aspectRatio = _MainTex_TexelSize.x / _MainTex_TexelSize.y; + half2 pixelSize = float2(_PixelateSize, _PixelateSize * aspectRatio); + d.texcoord0.xy = floor(d.texcoord0.xy * pixelSize) / pixelSize; + #endif + //-------------- + + half4 col = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy); + half originalAlpha = col.a; + col *= d.vertexColor; + + //NORMAL MAP + #if NORMALMAP_ON + half4 normalSample = SAMPLE_TEXTURE2D(_NormalMap, sampler_NormalMap, d.texcoord0.xy); + half3 normalTS = UnpackNormal(normalSample); + normalTS.xy *= _NormalStrength; + o.Normal = normalTS; + #endif + + + //GLITCH_ON + #if GLITCH_ON + half2 uvGlitch = uvRect; + uvGlitch.y -= 0.5; + half lineNoise = pow(rand2(floor(uvGlitch * half2(24., 19.) * _GlitchSize) * 4.0, randomSeed), 3.0) * _GlitchAmount + * pow(rand2(floor(uvGlitch * half2(38., 14.) * _GlitchSize) * 4.0, randomSeed), 3.0); + col = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(lineNoise * 0.02 * rand2(half2(2.0, 1), randomSeed), 0)) * d.vertexColor; + #endif + //-------------------------------------- + + //CHROMABERR_ON + #if CHROMABERR_ON + half4 r = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(_ChromAberrAmount/10, 0)) * d.vertexColor; + half4 b = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(-_ChromAberrAmount/10, 0)) * d.vertexColor; + col = half4(r.r * r.a, col.g, b.b * b.a, max(max(r.a, b.a) * _ChromAberrAlpha, col.a)); + #endif + + //-------------------------------- + + //BLUR_ON + #if BLUR_ON + #if ATLAS_ON + #if !BLURISHD_ON + col = BlurHD(d.texcoord0.xy, _MainTex, sampler_MainTex, _BlurIntensity, (_MaxXUV - _MinXUV), (_MaxYUV - _MinYUV)) * d.vertexColor; + #else + col = Blur(d.texcoord0.xy, _MainTex, sampler_MainTex, _BlurIntensity * (_MaxXUV - _MinXUV)) * d.vertexColor; + #endif + #else + #if !BLURISHD_ON + col = BlurHD(d.texcoord0.xy, _MainTex, sampler_MainTex, _BlurIntensity, 1, 1) * d.vertexColor; + #else + col = Blur(d.texcoord0.xy, _MainTex, sampler_MainTex, _BlurIntensity) * d.vertexColor; + #endif + #endif + #endif + + //-------------------- + + //MOTIONBLUR_ON + #if MOTIONBLUR_ON + _MotionBlurAngle = _MotionBlurAngle * 3.1415926; + #define rot(n) mul(n, half2x2(cos(_MotionBlurAngle), -sin(_MotionBlurAngle), sin(_MotionBlurAngle), cos(_MotionBlurAngle))) + _MotionBlurDist = _MotionBlurDist * 0.005; + #if ATLAS_ON + _MotionBlurDist *= (_MaxXUV - _MinXUV); + #endif + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(-_MotionBlurDist, -_MotionBlurDist))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(-_MotionBlurDist * 2, -_MotionBlurDist * 2))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(-_MotionBlurDist * 3, -_MotionBlurDist * 3))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(-_MotionBlurDist * 4, -_MotionBlurDist * 4))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(_MotionBlurDist, _MotionBlurDist))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(_MotionBlurDist * 2, _MotionBlurDist * 2))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(_MotionBlurDist * 3, _MotionBlurDist * 3))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(_MotionBlurDist * 4, _MotionBlurDist * 4))); + col.rgb = col.rgb / 9; + #endif + //------------------------------------ + + //NEGATIVE_ON + #if NEGATIVE_ON + col.rgb = lerp(col.rgb, 1 - col.rgb, _NegativeAmount); + #endif + + //-------------- + half luminance = 0; + + //GREYSCALE_ON && !GREYSCALEOUTLINE_ON + #if GREYSCALE_ON && !GREYSCALEOUTLINE_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + luminance = saturate(luminance + _GreyscaleLuminosity); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _GreyscaleTintColor, _GreyscaleBlend); + #endif + //------------------------------------ + + //GHOST_ON + #if GHOST_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + half4 ghostResult; + ghostResult.a = saturate(luminance - _GhostTransparency) * col.a; + ghostResult.rgb = col.rgb * (luminance + _GhostColorBoost); + col = lerp(col, ghostResult, _GhostBlend); + #endif + //------------------------------------ + + //INNEROUTLINE_ON + #if INNEROUTLINE_ON + half3 innerT = abs(GetPixel(0, _InnerOutlineThickness, d.texcoord0.xy, _MainTex, sampler_MainTex) - GetPixel(0, -_InnerOutlineThickness, d.texcoord0.xy, _MainTex, sampler_MainTex)); + innerT += abs(GetPixel(_InnerOutlineThickness, 0, d.texcoord0.xy, _MainTex, sampler_MainTex) - GetPixel(-_InnerOutlineThickness, 0, d.texcoord0.xy, _MainTex, sampler_MainTex)); + #if !ONLYINNEROUTLINE_ON + innerT = (innerT / 2.0) * col.a * _InnerOutlineAlpha; + col.rgb += length(innerT) * _InnerOutlineColor.rgb * _InnerOutlineGlow; + #else + innerT *= col.a * _InnerOutlineAlpha; + col.rgb = length(innerT) * _InnerOutlineColor.rgb * _InnerOutlineGlow; + col.a = step(0.3, col.r+col.g+col.b); + #endif + #endif + //------------------------------------------------------- + + //HITEFFECT_ON + #if HITEFFECT_ON + col.rgb = lerp(col.rgb, _HitEffectColor.rgb * _HitEffectGlow, _HitEffectBlend); + #endif + //-------------------- + + //GRADIENT_ON + #if GRADIENT_ON + half2 tiledUvGrad = half2(uvRect.x / _MainTex_ST.x, uvRect.y / _MainTex_ST.y); + #if GRADIENT2COL_ON + _GradTopRightCol = _GradTopLeftCol; + _GradBotRightCol = _GradBotLeftCol; + #endif + #if RADIALGRADIENT_ON + half radialDist = 1 - length(tiledUvGrad - half2(0.5, 0.5)); + radialDist *= (_MainTex_TexelSize.w / _MainTex_TexelSize.z); + radialDist = saturate(_GradBoostX * radialDist); + half4 gradientResult = lerp(_GradTopLeftCol, _GradBotLeftCol, radialDist); + #else + half gradXLerpFactor = saturate(pow(tiledUvGrad.x, _GradBoostX)); + half4 gradientResult = lerp(lerp(_GradBotLeftCol, _GradBotRightCol, gradXLerpFactor), + lerp(_GradTopLeftCol, _GradTopRightCol, gradXLerpFactor), saturate(pow(tiledUvGrad.y, _GradBoostY))); + #endif + gradientResult = lerp(col, gradientResult, _GradBlend); + col.rgb = gradientResult.rgb * col.a; + col.a *= gradientResult.a; + #endif + //-------------------------------------------------------------------- + + //CONTRAST_ON + #if CONTRAST_ON + col.rgb = (col.rgb - float3(0.5, 0.5, 0.5)) * _Contrast + float3(0.5, 0.5, 0.5); + col.rgb += _Brightness; + #endif + + //------------------------------------------------------------------- + + //COLORSWAP_ON + #if COLORSWAP_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + half4 swapMask = SAMPLE_TEXTURE2D(_ColorSwapTex, sampler_ColorSwapTex, d.texcoord0.xy); + swapMask.rgb *= swapMask.a; + half3 redSwap = _ColorSwapRed * swapMask.r * saturate(luminance + _ColorSwapRedLuminosity); + half3 greenSwap = _ColorSwapGreen * swapMask.g * saturate(luminance + _ColorSwapGreenLuminosity); + half3 blueSwap = _ColorSwapBlue * swapMask.b * saturate(luminance + _ColorSwapBlueLuminosity); + swapMask.rgb = col.rgb * saturate(1 - swapMask.r - swapMask.g - swapMask.b); + col.rgb = lerp(col.rgb, swapMask.rgb + redSwap + greenSwap + blueSwap, _ColorSwapBlend); + #endif + //-------------------------------------------------------------------- + + //COLORRAMP_ON && !COLORRAMPOUTLINE_ON + #if COLORRAMP_ON && !COLORRAMPOUTLINE_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + luminance = saturate(luminance + _ColorRampLuminosity); + #if GRADIENTCOLORRAMP_ON + col.rgb = lerp(col.rgb, SAMPLE_TEXTURE2D(_ColorRampTexGradient, sampler_ColorRampTexGradient, half2(luminance, 0)).rgb, _ColorRampBlend); + #else + col.rgb = lerp(col.rgb, SAMPLE_TEXTURE2D(_ColorRampTex, sampler_ColorRampTex, half2(luminance, 0)).rgb, _ColorRampBlend); + #endif + #endif + //-------------------------------------------------------------------- + + //CHANGECOLOR_ON + #if CHANGECOLOR_ON + float3 currChangeColor = saturate(col.rgb); + luminance = 0.3 * currChangeColor.r + 0.59 * currChangeColor.g + 0.11 * currChangeColor.b; + luminance = saturate(luminance + _ColorChangeLuminosity); + half3 dif = abs(currChangeColor - _ColorChangeTarget.rgb); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _ColorChangeNewCol.rgb, + max(sign(1 - saturate(dif.x + dif.y + dif.z) - _ColorChangeTolerance), 0.0)); + #if CHANGECOLOR2_ON + dif = abs(currChangeColor - _ColorChangeTarget2.rgb); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _ColorChangeNewCol2.rgb, + max(sign(1 - saturate(dif.x + dif.y + dif.z) - _ColorChangeTolerance2), 0.0)); + #endif + #if CHANGECOLOR3_ON + dif = abs(currChangeColor - _ColorChangeTarget3.rgb); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _ColorChangeNewCol3.rgb, + max(sign(1 - saturate(dif.x + dif.y + dif.z) - _ColorChangeTolerance3), 0.0)); + #endif + #endif + //------------------------------------------------------- + + //POSTERIZE_ON && !POSTERIZEOUTLINE_ON + #if POSTERIZE_ON && !POSTERIZEOUTLINE_ON + col.rgb = pow(col.rgb, _PosterizeGamma) * _PosterizeNumColors; + col.rgb = floor(col.rgb) / _PosterizeNumColors; + col.rgb = pow(col.rgb, 1.0 / _PosterizeGamma); + #endif + //------------------------------------ + + //HSV_ON + #if HSV_ON + half3 resultHsv = half3(col.rgb); + half cosHsv = _HsvBright * _HsvSaturation * cos(_HsvShift * 3.14159265 / 180); + half sinHsv = _HsvBright * _HsvSaturation * sin(_HsvShift * 3.14159265 / 180); + resultHsv.x = (.299 * _HsvBright + .701 * cosHsv + .168 * sinHsv) * col.x + + (.587 * _HsvBright - .587 * cosHsv + .330 * sinHsv) * col.y + + (.114 * _HsvBright - .114 * cosHsv - .497 * sinHsv) * col.z; + resultHsv.y = (.299 * _HsvBright - .299 * cosHsv - .328 * sinHsv) *col.x + + (.587 * _HsvBright + .413 * cosHsv + .035 * sinHsv) * col.y + + (.114 * _HsvBright - .114 * cosHsv + .292 * sinHsv) * col.z; + resultHsv.z = (.299 * _HsvBright - .3 * cosHsv + 1.25 * sinHsv) * col.x + + (.587 * _HsvBright - .588 * cosHsv - 1.05 * sinHsv) * col.y + + (.114 * _HsvBright + .886 * cosHsv - .203 * sinHsv) * col.z; + col.rgb = resultHsv; + #endif + //------------------------------------------------------- + + //OVERLAY_ON + #if OVERLAY_ON + half2 overlayUvs = d.texcoord0.xy; + overlayUvs.x += ((_Time.y + randomSeed) * _OverlayTextureScrollXSpeed) % 1; + overlayUvs.y += ((_Time.y + randomSeed) * _OverlayTextureScrollYSpeed) % 1; + half4 overlayCol = SAMPLE_TEXTURE2D(_OverlayTex, sampler_OverlayTex, TRANSFORM_TEX(overlayUvs, _OverlayTex)); + overlayCol.rgb *= _OverlayColor.rgb * _OverlayGlow; + #if !OVERLAYMULT_ON + overlayCol.rgb *= overlayCol.a * _OverlayColor.rgb * _OverlayColor.a * _OverlayBlend; + col.rgb += overlayCol.rgb; + #else + overlayCol.a *= _OverlayColor.a; + col = lerp(col, col * overlayCol, _OverlayBlend); + #endif + #endif + + //--------------------------------- + + //OUTBASE_ON + #if OUTBASE_ON + #if OUTBASEPIXELPERF_ON + half2 destUv = half2(_OutlinePixelWidth * _MainTex_TexelSize.x, _OutlinePixelWidth * _MainTex_TexelSize.y); + #else + half2 destUv = half2(_OutlineWidth * _MainTex_TexelSize.x * 200, _OutlineWidth * _MainTex_TexelSize.y * 200); + #endif + + #if OUTDIST_ON + d.texcoord3.x += ((_Time.x + _RandomSeed) * _OutlineDistortTexXSpeed) % 1; + d.texcoord3.y += ((_Time.x + _RandomSeed) * _OutlineDistortTexYSpeed) % 1; + #if ATLAS_ON + d.texcoord3 = half2((d.texcoord3.x - _MinXUV) / (_MaxXUV - _MinXUV), (d.texcoord3.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half outDistortAmnt = (SAMPLE_TEXTURE2D(_OutlineDistortTex, sampler_OutlineDistortTex, d.texcoord3).r - 0.5) * 0.2 * _OutlineDistortAmount; + destUv.x += outDistortAmnt; + destUv.y += outDistortAmnt; + #endif + + half spriteLeft = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(destUv.x, 0)).a; + half spriteRight = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy - half2(destUv.x, 0)).a; + half spriteBottom = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(0, destUv.y)).a; + half spriteTop = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy - half2(0, destUv.y)).a; + half result = spriteLeft + spriteRight + spriteBottom + spriteTop; + + #if OUTBASE8DIR_ON + half spriteTopLeft = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(destUv.x, destUv.y)).a; + half spriteTopRight = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(-destUv.x, destUv.y)).a; + half spriteBotLeft = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(destUv.x, -destUv.y)).a; + half spriteBotRight = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(-destUv.x, -destUv.y)).a; + result = result + spriteTopLeft + spriteTopRight + spriteBotLeft + spriteBotRight; + #endif + + result = step(0.05, saturate(result)); + + #if OUTTEX_ON + d.texcoord1.x += ((_Time.x + _RandomSeed) * _OutlineTexXSpeed) % 1; + d.texcoord1.y += ((_Time.x + _RandomSeed) * _OutlineTexYSpeed) % 1; + #if ATLAS_ON + d.texcoord1 = half2((d.texcoord1.x - _MinXUV) / (_MaxXUV - _MinXUV), (d.texcoord1.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half4 tempOutColor = SAMPLE_TEXTURE2D(_OutlineTex, sampler_OutlineTex, d.texcoord1); + tempOutColor *= _OutlineColor; + _OutlineColor = tempOutColor; + #endif + + result *= (1 - originalAlpha) * _OutlineAlpha; + + half4 outline = _OutlineColor * d.vertexColor.a; + outline.rgb *= _OutlineGlow; + outline.a = result; + #if ONLYOUTLINE_ON + col = outline; + #else + col = lerp(col, outline, result); + #endif + #endif + //------------------------------------------------------- + + //FADE_ON + #if FADE_ON + half2 tiledUvFade1 = TRANSFORM_TEX(d.texcoord0, _FadeTex); + half2 tiledUvFade2 = TRANSFORM_TEX(d.texcoord0, _FadeBurnTex); + #if ATLAS_ON + tiledUvFade1 = half2((tiledUvFade1.x - _MinXUV) / (_MaxXUV - _MinXUV), (tiledUvFade1.y - _MinYUV) / (_MaxYUV - _MinYUV)); + tiledUvFade2 = half2((tiledUvFade2.x - _MinXUV) / (_MaxXUV - _MinXUV), (tiledUvFade2.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half fadeTemp = SAMPLE_TEXTURE2D(_FadeTex, sampler_FadeTex, tiledUvFade1).r; + half fade = smoothstep(_FadeAmount, _FadeAmount + _FadeBurnTransition, fadeTemp); + half fadeBurn = saturate(smoothstep(_FadeAmount - _FadeBurnWidth, _FadeAmount - _FadeBurnWidth + 0.1, fadeTemp) * _FadeAmount); + col.a *= fade; + _FadeBurnColor.rgb *= _FadeBurnGlow; + col += fadeBurn * SAMPLE_TEXTURE2D(_FadeBurnTex, sampler_FadeBurnTex, tiledUvFade2) * _FadeBurnColor * originalAlpha * (1 - col.a); + #endif + //------------------------------------------------------- + + //SHADOW_ON + #if SHADOW_ON + half shadowA = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(_ShadowX, _ShadowY)).a; + half preMultShadowMask = 1 - (saturate(shadowA - col.a) * (1 - col.a)); + col.rgb *= 1 - ((shadowA - col.a) * (1 - col.a)); + col.rgb += (_ShadowColor * shadowA) * (1 - col.a); + col.a = max(shadowA * _ShadowAlpha * d.vertexColor.a, col.a); + #endif + + //------------------------------------------------------- + + //GLOW_ON + #if GLOW_ON + half4 emission; + #if GLOWTEX_ON + emission = SAMPLE_TEXTURE2D(_GlowTex, sampler_GlowTex, d.texcoord0); + #else + emission = col; + #endif + + col.rgb *= _GlowGlobal; + emission.rgb *= emission.a * col.a * _Glow * _GlowColor; + col.rgb += emission.rgb; + #endif + //------------------------------------------------------- + + //COLORRAMP_ON && COLORRAMPOUTLINE_ON + #if COLORRAMP_ON && COLORRAMPOUTLINE_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + luminance = saturate(luminance + _ColorRampLuminosity); + #if GRADIENTCOLORRAMP_ON + col.rgb = lerp(col.rgb, SAMPLE_TEXTURE2D(_ColorRampTexGradient, sampler_ColorRampTexGradient, half2(luminance, 0)).rgb, _ColorRampBlend); + #else + col.rgb = lerp(col.rgb, SAMPLE_TEXTURE2D(_ColorRampTex, sampler_ColorRampTex, half2(luminance, 0)).rgb, _ColorRampBlend); + #endif + #endif + //--------------- + + //GREYSCALE_ON && GREYSCALEOUTLINE_ON + #if GREYSCALE_ON && GREYSCALEOUTLINE_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + luminance = saturate(luminance + _GreyscaleLuminosity); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _GreyscaleTintColor, _GreyscaleBlend); + #endif + + //----------------------------------- + + //POSTERIZE_ON && POSTERIZEOUTLINE_ON + #if POSTERIZE_ON && POSTERIZEOUTLINE_ON + col.rgb = pow(col.rgb, _PosterizeGamma) * _PosterizeNumColors; + col.rgb = floor(col.rgb) / _PosterizeNumColors; + col.rgb = pow(col.rgb, 1.0 / _PosterizeGamma); + #endif + + //----------------------------------- + + //SHINE_ON + #if SHINE_ON + half2 uvShine = uvRect; + half cosAngle = cos(_ShineRotate); + half sinAngle = sin(_ShineRotate); + half2x2 rot = half2x2(cosAngle, -sinAngle, sinAngle, cosAngle); + uvShine -= half2(0.5, 0.5); + uvShine = mul(rot, uvShine); + uvShine += half2(0.5, 0.5); + half shineMask = SAMPLE_TEXTURE2D(_ShineMask, sampler_ShineMask, d.texcoord0.xy).a; + half currentDistanceProjection = (uvShine.x + uvShine.y) / 2; + half whitePower = 1 - (abs(currentDistanceProjection - _ShineLocation) / _ShineWidth); + col.rgb += col.a * whitePower * _ShineGlow * max(sign(currentDistanceProjection - (_ShineLocation - _ShineWidth)), 0.0) + * max(sign((_ShineLocation + _ShineWidth) - currentDistanceProjection), 0.0) * _ShineColor * shineMask; + #endif + + //----------------------------------- + + //HOLOGRAM_ON + #if HOLOGRAM_ON + half totalHologram = _HologramStripesAmount + _HologramUnmodAmount; + half hologramYCoord = ((uvRect.y + (((_Time.x + randomSeed) % 1) * _HologramStripesSpeed)) % totalHologram) / totalHologram; + hologramYCoord = abs(hologramYCoord); + half alpha = RemapFloat(saturate(hologramYCoord - (_HologramUnmodAmount/totalHologram)), 0.0, 1.0, _HologramMinAlpha, saturate(_HologramMaxAlpha)); + half hologramMask = max(sign((_HologramUnmodAmount/totalHologram) - hologramYCoord), 0.0); + half4 hologramResult = col; + hologramResult.a *= lerp(alpha, 1, hologramMask); + hologramResult.rgb *= max(1, _HologramMaxAlpha * max(sign(hologramYCoord - (_HologramUnmodAmount/totalHologram)), 0.0)); + hologramMask = 1 - step(0.01,hologramMask); + hologramResult.rgb += hologramMask * _HologramStripeColor * col.a; + col = lerp(col, hologramResult, _HologramBlend); + #endif + + //----------------------------------- + + //FLICKER_ON + #if FLICKER_ON + col.a *= saturate(col.a * step(frac(0.05 + (_Time.w + randomSeed) * _FlickerFreq), 1 - _FlickerPercent) + _FlickerAlpha); + #endif + //----------------------------------- + + //ALPHACUTOFF_ON + + //ALPHAROUND_ON + + //ALPHAOUTLINE_ON + #if ALPHAOUTLINE_ON + half alphaOutlineRes = pow(1 - col.a, max(_AlphaOutlinePower, 0.0001)) * step(_AlphaOutlineMinAlpha, col.a) * _AlphaOutlineBlend; + col.rgb = lerp(col.rgb, _AlphaOutlineColor.rgb * _AlphaOutlineGlow, alphaOutlineRes); + col.a = lerp(col.a, 1, alphaOutlineRes > 1); + #endif + //------------------------------------------------------- + + //FOG_ON + + //------------------ + + col *= _Color; + o.Albedo = col; + col.a *= _Alpha; + clip(col.a - _AlphaCutoffValue - 0.01); + o.Alpha = _Color.a; + } + + + + + + void ChainSurfaceFunction(inout Surface l, inout ShaderData d) + { + Ext_SurfaceFunction0(l, d); + // Ext_SurfaceFunction1(l, d); + // Ext_SurfaceFunction2(l, d); + // Ext_SurfaceFunction3(l, d); + // Ext_SurfaceFunction4(l, d); + // Ext_SurfaceFunction5(l, d); + // Ext_SurfaceFunction6(l, d); + // Ext_SurfaceFunction7(l, d); + // Ext_SurfaceFunction8(l, d); + // Ext_SurfaceFunction9(l, d); + // Ext_SurfaceFunction10(l, d); + // Ext_SurfaceFunction11(l, d); + // Ext_SurfaceFunction12(l, d); + // Ext_SurfaceFunction13(l, d); + // Ext_SurfaceFunction14(l, d); + // Ext_SurfaceFunction15(l, d); + // Ext_SurfaceFunction16(l, d); + // Ext_SurfaceFunction17(l, d); + // Ext_SurfaceFunction18(l, d); + // Ext_SurfaceFunction19(l, d); + // Ext_SurfaceFunction20(l, d); + // Ext_SurfaceFunction21(l, d); + // Ext_SurfaceFunction22(l, d); + // Ext_SurfaceFunction23(l, d); + // Ext_SurfaceFunction24(l, d); + // Ext_SurfaceFunction25(l, d); + // Ext_SurfaceFunction26(l, d); + // Ext_SurfaceFunction27(l, d); + // Ext_SurfaceFunction28(l, d); + // Ext_SurfaceFunction29(l, d); + } + +#if !_DECALSHADER + + void ChainModifyVertex(inout VertexData v, inout VertexToPixel v2p, float4 time) + { + ExtraV2F d; + + ZERO_INITIALIZE(ExtraV2F, d); + ZERO_INITIALIZE(Blackboard, d.blackboard); + // due to motion vectors in HDRP, we need to use the last + // time in certain spots. So if you are going to use _Time to adjust vertices, + // you need to use this time or motion vectors will break. + d.time = time; + + Ext_ModifyVertex0(v, d); + // Ext_ModifyVertex1(v, d); + // Ext_ModifyVertex2(v, d); + // Ext_ModifyVertex3(v, d); + // Ext_ModifyVertex4(v, d); + // Ext_ModifyVertex5(v, d); + // Ext_ModifyVertex6(v, d); + // Ext_ModifyVertex7(v, d); + // Ext_ModifyVertex8(v, d); + // Ext_ModifyVertex9(v, d); + // Ext_ModifyVertex10(v, d); + // Ext_ModifyVertex11(v, d); + // Ext_ModifyVertex12(v, d); + // Ext_ModifyVertex13(v, d); + // Ext_ModifyVertex14(v, d); + // Ext_ModifyVertex15(v, d); + // Ext_ModifyVertex16(v, d); + // Ext_ModifyVertex17(v, d); + // Ext_ModifyVertex18(v, d); + // Ext_ModifyVertex19(v, d); + // Ext_ModifyVertex20(v, d); + // Ext_ModifyVertex21(v, d); + // Ext_ModifyVertex22(v, d); + // Ext_ModifyVertex23(v, d); + // Ext_ModifyVertex24(v, d); + // Ext_ModifyVertex25(v, d); + // Ext_ModifyVertex26(v, d); + // Ext_ModifyVertex27(v, d); + // Ext_ModifyVertex28(v, d); + // Ext_ModifyVertex29(v, d); + + + // #if %EXTRAV2F0REQUIREKEY% + // v2p.extraV2F0 = d.extraV2F0; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // v2p.extraV2F1 = d.extraV2F1; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // v2p.extraV2F2 = d.extraV2F2; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // v2p.extraV2F3 = d.extraV2F3; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // v2p.extraV2F4 = d.extraV2F4; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // v2p.extraV2F5 = d.extraV2F5; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // v2p.extraV2F6 = d.extraV2F6; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // v2p.extraV2F7 = d.extraV2F7; + // #endif + } + + void ChainModifyTessellatedVertex(inout VertexData v, inout VertexToPixel v2p) + { + ExtraV2F d; + ZERO_INITIALIZE(ExtraV2F, d); + ZERO_INITIALIZE(Blackboard, d.blackboard); + + // #if %EXTRAV2F0REQUIREKEY% + // d.extraV2F0 = v2p.extraV2F0; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // d.extraV2F1 = v2p.extraV2F1; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // d.extraV2F2 = v2p.extraV2F2; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // d.extraV2F3 = v2p.extraV2F3; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // d.extraV2F4 = v2p.extraV2F4; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // d.extraV2F5 = v2p.extraV2F5; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // d.extraV2F6 = v2p.extraV2F6; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // d.extraV2F7 = v2p.extraV2F7; + // #endif + + + // Ext_ModifyTessellatedVertex0(v, d); + // Ext_ModifyTessellatedVertex1(v, d); + // Ext_ModifyTessellatedVertex2(v, d); + // Ext_ModifyTessellatedVertex3(v, d); + // Ext_ModifyTessellatedVertex4(v, d); + // Ext_ModifyTessellatedVertex5(v, d); + // Ext_ModifyTessellatedVertex6(v, d); + // Ext_ModifyTessellatedVertex7(v, d); + // Ext_ModifyTessellatedVertex8(v, d); + // Ext_ModifyTessellatedVertex9(v, d); + // Ext_ModifyTessellatedVertex10(v, d); + // Ext_ModifyTessellatedVertex11(v, d); + // Ext_ModifyTessellatedVertex12(v, d); + // Ext_ModifyTessellatedVertex13(v, d); + // Ext_ModifyTessellatedVertex14(v, d); + // Ext_ModifyTessellatedVertex15(v, d); + // Ext_ModifyTessellatedVertex16(v, d); + // Ext_ModifyTessellatedVertex17(v, d); + // Ext_ModifyTessellatedVertex18(v, d); + // Ext_ModifyTessellatedVertex19(v, d); + // Ext_ModifyTessellatedVertex20(v, d); + // Ext_ModifyTessellatedVertex21(v, d); + // Ext_ModifyTessellatedVertex22(v, d); + // Ext_ModifyTessellatedVertex23(v, d); + // Ext_ModifyTessellatedVertex24(v, d); + // Ext_ModifyTessellatedVertex25(v, d); + // Ext_ModifyTessellatedVertex26(v, d); + // Ext_ModifyTessellatedVertex27(v, d); + // Ext_ModifyTessellatedVertex28(v, d); + // Ext_ModifyTessellatedVertex29(v, d); + + // #if %EXTRAV2F0REQUIREKEY% + // v2p.extraV2F0 = d.extraV2F0; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // v2p.extraV2F1 = d.extraV2F1; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // v2p.extraV2F2 = d.extraV2F2; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // v2p.extraV2F3 = d.extraV2F3; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // v2p.extraV2F4 = d.extraV2F4; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // v2p.extraV2F5 = d.extraV2F5; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // v2p.extraV2F6 = d.extraV2F6; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // v2p.extraV2F7 = d.extraV2F7; + // #endif + } + + void ChainFinalColorForward(inout Surface l, inout ShaderData d, inout half4 color) + { + // Ext_FinalColorForward0(l, d, color); + // Ext_FinalColorForward1(l, d, color); + // Ext_FinalColorForward2(l, d, color); + // Ext_FinalColorForward3(l, d, color); + // Ext_FinalColorForward4(l, d, color); + // Ext_FinalColorForward5(l, d, color); + // Ext_FinalColorForward6(l, d, color); + // Ext_FinalColorForward7(l, d, color); + // Ext_FinalColorForward8(l, d, color); + // Ext_FinalColorForward9(l, d, color); + // Ext_FinalColorForward10(l, d, color); + // Ext_FinalColorForward11(l, d, color); + // Ext_FinalColorForward12(l, d, color); + // Ext_FinalColorForward13(l, d, color); + // Ext_FinalColorForward14(l, d, color); + // Ext_FinalColorForward15(l, d, color); + // Ext_FinalColorForward16(l, d, color); + // Ext_FinalColorForward17(l, d, color); + // Ext_FinalColorForward18(l, d, color); + // Ext_FinalColorForward19(l, d, color); + // Ext_FinalColorForward20(l, d, color); + // Ext_FinalColorForward21(l, d, color); + // Ext_FinalColorForward22(l, d, color); + // Ext_FinalColorForward23(l, d, color); + // Ext_FinalColorForward24(l, d, color); + // Ext_FinalColorForward25(l, d, color); + // Ext_FinalColorForward26(l, d, color); + // Ext_FinalColorForward27(l, d, color); + // Ext_FinalColorForward28(l, d, color); + // Ext_FinalColorForward29(l, d, color); + } + + void ChainFinalGBufferStandard(inout Surface s, inout ShaderData d, inout half4 GBuffer0, inout half4 GBuffer1, inout half4 GBuffer2, inout half4 outEmission, inout half4 outShadowMask) + { + // Ext_FinalGBufferStandard0(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard1(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard2(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard3(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard4(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard5(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard6(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard7(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard8(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard9(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard10(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard11(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard12(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard13(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard14(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard15(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard16(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard17(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard18(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard19(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard20(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard21(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard22(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard23(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard24(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard25(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard26(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard27(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard28(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard29(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + } +#endif + + + + + +#if _DECALSHADER + + ShaderData CreateShaderData(SurfaceDescriptionInputs IN) + { + ShaderData d = (ShaderData)0; + d.TBNMatrix = float3x3(IN.WorldSpaceTangent, IN.WorldSpaceBiTangent, IN.WorldSpaceNormal); + d.worldSpaceNormal = IN.WorldSpaceNormal; + d.worldSpaceTangent = IN.WorldSpaceTangent; + + d.worldSpacePosition = IN.WorldSpacePosition; + d.texcoord0 = IN.uv0.xyxy; + d.screenPos = IN.ScreenPosition; + + d.worldSpaceViewDir = normalize(_WorldSpaceCameraPos - d.worldSpacePosition); + + d.tangentSpaceViewDir = mul(d.TBNMatrix, d.worldSpaceViewDir); + + // these rarely get used, so we back transform them. Usually will be stripped. + #if _HDRP + // d.localSpacePosition = mul(GetWorldToObjectMatrix(), float4(GetCameraRelativePositionWS(d.worldSpacePosition), 1)).xyz; + #else + // d.localSpacePosition = mul(GetWorldToObjectMatrix(), float4(d.worldSpacePosition, 1)).xyz; + #endif + // d.localSpaceNormal = normalize(mul((float3x3)GetWorldToObjectMatrix(), d.worldSpaceNormal)); + // d.localSpaceTangent = normalize(mul((float3x3)GetWorldToObjectMatrix(), d.worldSpaceTangent.xyz)); + + // #if %SCREENPOSREQUIREKEY% + // d.screenUV = (IN.ScreenPosition.xy / max(0.01, IN.ScreenPosition.w)); + // #endif + + return d; + } +#else + + ShaderData CreateShaderData(VertexToPixel i + #if NEED_FACING + , bool facing + #endif + ) + { + ShaderData d = (ShaderData)0; + d.clipPos = i.pos; + d.worldSpacePosition = i.worldPos; + + d.worldSpaceNormal = normalize(i.worldNormal); + d.worldSpaceTangent.xyz = normalize(i.worldTangent.xyz); + + d.tangentSign = i.worldTangent.w * unity_WorldTransformParams.w; + float3 bitangent = cross(d.worldSpaceTangent.xyz, d.worldSpaceNormal) * d.tangentSign; + + d.TBNMatrix = float3x3(d.worldSpaceTangent, -bitangent, d.worldSpaceNormal); + d.worldSpaceViewDir = normalize(_WorldSpaceCameraPos - i.worldPos); + + d.tangentSpaceViewDir = mul(d.TBNMatrix, d.worldSpaceViewDir); + d.texcoord0 = i.texcoord0; + d.texcoord1 = i.texcoord1; + d.texcoord2 = i.texcoord2; + + // #if %TEXCOORD3REQUIREKEY% + d.texcoord3 = i.texcoord3; + // #endif + + // d.isFrontFace = facing; + // #if %VERTEXCOLORREQUIREKEY% + d.vertexColor = i.vertexColor; + // #endif + + // these rarely get used, so we back transform them. Usually will be stripped. + #if _HDRP + // d.localSpacePosition = mul(GetWorldToObjectMatrix(), float4(GetCameraRelativePositionWS(i.worldPos), 1)).xyz; + #else + // d.localSpacePosition = mul(GetWorldToObjectMatrix(), float4(i.worldPos, 1)).xyz; + #endif + // d.localSpaceNormal = normalize(mul((float3x3)GetWorldToObjectMatrix(), i.worldNormal)); + // d.localSpaceTangent = normalize(mul((float3x3)GetWorldToObjectMatrix(), i.worldTangent.xyz)); + + // #if %SCREENPOSREQUIREKEY% + // d.screenPos = i.screenPos; + // d.screenUV = (i.screenPos.xy / i.screenPos.w); + // #endif + + + // #if %EXTRAV2F0REQUIREKEY% + // d.extraV2F0 = i.extraV2F0; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // d.extraV2F1 = i.extraV2F1; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // d.extraV2F2 = i.extraV2F2; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // d.extraV2F3 = i.extraV2F3; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // d.extraV2F4 = i.extraV2F4; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // d.extraV2F5 = i.extraV2F5; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // d.extraV2F6 = i.extraV2F6; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // d.extraV2F7 = i.extraV2F7; + // #endif + + return d; + } + +#endif + + + +#if (SHADERPASS == SHADERPASS_LIGHT_TRANSPORT) + + // This was not in constant buffer in original unity, so keep outiside. But should be in as ShaderRenderPass frequency + float unity_OneOverOutputBoost; + float unity_MaxOutputValue; + + CBUFFER_START(UnityMetaPass) + // x = use uv1 as raster position + // y = use uv2 as raster position + bool4 unity_MetaVertexControl; + + // x = return albedo + // y = return normal + bool4 unity_MetaFragmentControl; + CBUFFER_END + + VertexToPixel Vert(VertexData inputMesh) + { + VertexToPixel output; + ZERO_INITIALIZE(VertexToPixel, output); + UNITY_SETUP_INSTANCE_ID(inputMesh); + UNITY_TRANSFER_INSTANCE_ID(inputMesh, output); + UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(output); + + // Output UV coordinate in vertex shader + float2 uv = float2(0.0, 0.0); + + if (unity_MetaVertexControl.x) + { + uv = inputMesh.texcoord1.xy * unity_LightmapST.xy + unity_LightmapST.zw; + } + else if (unity_MetaVertexControl.y) + { + uv = inputMesh.texcoord2.xy * unity_DynamicLightmapST.xy + unity_DynamicLightmapST.zw; + } + + // OpenGL right now needs to actually use the incoming vertex position + // so we create a fake dependency on it here that haven't any impact. + output.pos = float4(uv * 2.0 - 1.0, inputMesh.vertex.z > 0 ? 1.0e-4 : 0.0, 1.0); + + output.worldPos = TransformObjectToWorld(inputMesh.vertex); + + // Normal is required for triplanar mapping + output.worldNormal = TransformObjectToWorldNormal(inputMesh.normal); + // Not required but assign to silent compiler warning + output.worldTangent = float4(1.0, 0.0, 0.0, 0.0); + + output.texcoord0 = inputMesh.texcoord0; + output.texcoord1 = inputMesh.texcoord1; + output.texcoord2 = inputMesh.texcoord2; + // #if %TEXCOORD3REQUIREKEY% + output.texcoord3 = inputMesh.texcoord3; + // #endif + // #if %VERTEXCOLORREQUIREKEY% + output.vertexColor = inputMesh.vertexColor; + // #endif + + return output; + } +#else + + #if (_PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR))) + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/ShaderVariablesMatrixDefsHDCamera.hlsl" + + void MotionVectorPositionZBias(VertexToPixel input) + { + #if UNITY_REVERSED_Z + input.pos.z -= unity_MotionVectorsParams.z * input.pos.w; + #else + input.pos.z += unity_MotionVectorsParams.z * input.pos.w; + #endif + } + + #endif + + VertexToPixel Vert(VertexData input) + { + VertexToPixel output; + ZERO_INITIALIZE(VertexToPixel, output); + + UNITY_SETUP_INSTANCE_ID(input); + UNITY_TRANSFER_INSTANCE_ID(input, output); + UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(output); + + // copy before user modification, since we'll apply that to the copy later + #if _HDRP && (_PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR))) + VertexData previousMesh = input; + #endif + + ChainModifyVertex(input, output, _Time); + + // This return the camera relative position (if enable) + float3 positionRWS = TransformObjectToWorld(input.vertex.xyz); + float3 normalWS = TransformObjectToWorldNormal(input.normal); + float4 tangentWS = float4(TransformObjectToWorldDir(input.tangent.xyz), input.tangent.w); + + + output.worldPos = GetAbsolutePositionWS(positionRWS); + output.pos = TransformWorldToHClip(positionRWS); + output.worldNormal = normalWS; + output.worldTangent = tangentWS; + + + output.texcoord0 = input.texcoord0; + output.texcoord1 = input.texcoord1; + output.texcoord2 = input.texcoord2; + + // #if %TEXCOORD3REQUIREKEY% + output.texcoord3 = input.texcoord3; + // #endif + + // #if %VERTEXCOLORREQUIREKEY% + output.vertexColor = input.vertexColor; + // #endif + + // #if %SCREENPOSREQUIREKEY% + // output.screenPos = ComputeScreenPos(output.pos, _ProjectionParams.x); + // #endif + + #if _HDRP && (_PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR))) + + #if !defined(TESSELLATION_ON) + MotionVectorPositionZBias(output); + #endif + + output.motionVectorCS = mul(UNITY_MATRIX_UNJITTERED_VP, float4(positionRWS, 1.0)); + // Note: unity_MotionVectorsParams.y is 0 is forceNoMotion is enabled + bool forceNoMotion = unity_MotionVectorsParams.y == 0.0; + if (forceNoMotion) + { + output.previousPositionCS = float4(0.0, 0.0, 0.0, 1.0); + } + else + { + bool hasDeformation = unity_MotionVectorsParams.x > 0.0; // Skin or morph target + + float3 effectivePositionOS = (hasDeformation ? previousMesh.previousPositionOS : previousMesh.vertex.xyz); + #if defined(_ADD_PRECOMPUTED_VELOCITY) + effectivePositionOS -= input.precomputedVelocity; + #endif + + + + previousMesh.vertex = float4(effectivePositionOS, 1); + VertexToPixel dummy = (VertexToPixel)0; + + ChainModifyVertex(previousMesh, dummy, _LastTimeParameters); + + float3 previousPositionRWS = TransformPreviousObjectToWorld(previousMesh.vertex.xyz); + // we might need this for skinned objects? + //float3 normalWS = TransformPreviousObjectToWorldNormal(input.normal).xyz; + + #ifdef _WRITE_TRANSPARENT_MOTION_VECTOR + if (_TransparentCameraOnlyMotionVectors > 0) + { + previousPositionRWS = positionRWS.xyz; + } + #endif // _WRITE_TRANSPARENT_MOTION_VECTOR + + output.previousPositionCS = mul(UNITY_MATRIX_PREV_VP, float4(previousPositionRWS, 1.0)); + } + #endif // _HDRP && _PASSMOTIONVECTOR || (_PASSFORWARD && defined(_WRITE_TRANSPARENT_MOTION_VECTOR)) + + + return output; + } + + +#endif + + + + + + + + #if defined(WRITE_DECAL_BUFFER) && !defined(_DISABLE_DECALS) + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/Decal/DecalPrepassBuffer.hlsl" + #endif + + FragInputs BuildFragInputs(VertexToPixel input) + { + UNITY_SETUP_INSTANCE_ID(input); + FragInputs output; + ZERO_INITIALIZE(FragInputs, output); + + // Init to some default value to make the computer quiet (else it output 'divide by zero' warning even if value is not used). + // TODO: this is a really poor workaround, but the variable is used in a bunch of places + // to compute normals which are then passed on elsewhere to compute other values... + output.tangentToWorld = k_identity3x3; + output.positionSS = input.pos; // input.positionCS is SV_Position + // BETTER SHADERS: because we transform world position into actual world space for things like + // triplanar, etc, we have to back transform it here for lighting + output.positionRWS = GetCameraRelativePositionWS(input.worldPos); + output.tangentToWorld = BuildTangentToWorld(input.worldTangent, input.worldNormal); + output.texCoord0 = input.texcoord0; + output.texCoord1 = input.texcoord1; + output.texCoord2 = input.texcoord2; + + return output; + } + + void BuildSurfaceData(FragInputs fragInputs, inout Surface surfaceDescription, float3 V, PositionInputs posInput, out SurfaceData surfaceData, out float3 bentNormalWS) + { + // setup defaults -- these are used if the graph doesn't output a value + ZERO_INITIALIZE(SurfaceData, surfaceData); + + // specularOcclusion need to be init ahead of decal to quiet the compiler that modify the SurfaceData struct + // however specularOcclusion can come from the graph, so need to be init here so it can be override. + surfaceData.specularOcclusion = 1.0; + + // copy across graph values, if defined + surfaceData.baseColor = surfaceDescription.Albedo; + surfaceData.perceptualSmoothness = surfaceDescription.Smoothness; + surfaceData.ambientOcclusion = surfaceDescription.Occlusion; + surfaceData.specularOcclusion = surfaceDescription.SpecularOcclusion; + surfaceData.metallic = surfaceDescription.Metallic; + surfaceData.subsurfaceMask = surfaceDescription.SubsurfaceMask; + surfaceData.thickness = surfaceDescription.Thickness; + surfaceData.diffusionProfileHash = asuint(surfaceDescription.DiffusionProfileHash); + #if _USESPECULAR + surfaceData.specularColor = surfaceDescription.Specular; + #endif + surfaceData.coatMask = surfaceDescription.CoatMask; + surfaceData.anisotropy = surfaceDescription.Anisotropy; + surfaceData.iridescenceMask = surfaceDescription.IridescenceMask; + surfaceData.iridescenceThickness = surfaceDescription.IridescenceThickness; + + + + #if defined(_REFRACTION_PLANE) || defined(_REFRACTION_SPHERE) || defined(_REFRACTION_THIN) + if (_EnableSSRefraction) + { + surfaceData.transmittanceMask = (1.0 - surfaceDescription.Alpha); + surfaceDescription.Alpha = 1.0; + } + else + { + surfaceData.ior = surfaceDescription.ior; + surfaceData.transmittanceColor = surfaceDescription.transmittanceColor; + surfaceData.atDistance = surfaceDescription.atDistance; + surfaceData.transmittanceMask = surfaceDescription.transmittanceMask; + surfaceDescription.Alpha = 1.0; + } + #else + surfaceData.ior = 1.0; + surfaceData.transmittanceColor = float3(1.0, 1.0, 1.0); + surfaceData.atDistance = 1.0; + surfaceData.transmittanceMask = 0.0; + #endif + + + #if defined(_ENABLE_SHADOW_MATTE) && SHADERPASS == SHADERPASS_FORWARD_UNLIT + HDShadowContext shadowContext = InitShadowContext(); + float shadow; + float3 shadow3; + // We need to recompute some coordinate not computed by default for shadow matte + posInput = GetPositionInput(fragInputs.positionSS.xy, _ScreenSize.zw, fragInputs.positionSS.z, UNITY_MATRIX_I_VP, GetWorldToViewMatrix()); + float3 upWS = normalize(fragInputs.tangentToWorld[1]); + uint renderingLayers = GetMeshRenderingLightLayer(); + ShadowLoopMin(shadowContext, posInput, upWS, asuint(_ShadowMatteFilter), renderingLayers, shadow3); + shadow = dot(shadow3, float3(1.0 / 3.0, 1.0 / 3.0, 1.0 / 3.0)); + + float4 shadowColor = (1.0 - shadow) * surfaceDescription.ShadowTint.rgba; + float localAlpha = saturate(shadowColor.a + surfaceDescription.Alpha); + + // Keep the nested lerp + // With no Color (bsdfData.color.rgb, bsdfData.color.a == 0.0f), just use ShadowColor*Color to avoid a ring of "white" around the shadow + // And mix color to consider the Color & ShadowColor alpha (from texture or/and color picker) + #ifdef _SURFACE_TYPE_TRANSPARENT + surfaceData.baseColor = lerp(shadowColor.rgb * surfaceData.baseColor, lerp(lerp(shadowColor.rgb, surfaceData.baseColor, 1.0 - surfaceDescription.ShadowTint.a), surfaceData.baseColor, shadow), surfaceDescription.Alpha); + #else + surfaceData.baseColor = lerp(lerp(shadowColor.rgb, surfaceData.baseColor, 1.0 - surfaceDescription.ShadowTint.a), surfaceData.baseColor, shadow); + #endif + localAlpha = ApplyBlendMode(surfaceData.baseColor, localAlpha).a; + + surfaceDescription.Alpha = localAlpha; + #endif + + // These static material feature allow compile time optimization + surfaceData.materialFeatures = MATERIALFEATUREFLAGS_LIT_STANDARD; + #ifdef _MATERIAL_FEATURE_SUBSURFACE_SCATTERING + surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_SUBSURFACE_SCATTERING; + #endif + + #ifdef _MATERIAL_FEATURE_TRANSMISSION + surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_TRANSMISSION; + #endif + + #ifdef _MATERIAL_FEATURE_ANISOTROPY + surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_ANISOTROPY; + #endif + + #ifdef _MATERIAL_FEATURE_IRIDESCENCE + surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_IRIDESCENCE; + #endif + + #ifdef _MATERIAL_FEATURE_SPECULAR_COLOR + surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_SPECULAR_COLOR; + #endif + + #if defined(_MATERIAL_FEATURE_CLEAR_COAT) || _CLEARCOAT + surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_CLEAR_COAT; + #endif + + #if defined (_MATERIAL_FEATURE_SPECULAR_COLOR) && defined (_ENERGY_CONSERVING_SPECULAR) + // Require to have setup baseColor + // Reproduce the energy conservation done in legacy Unity. Not ideal but better for compatibility and users can unchek it + surfaceData.baseColor *= (1.0 - Max3(surfaceData.specularColor.r, surfaceData.specularColor.g, surfaceData.specularColor.b)); + #endif + + + + // compute world space normal + #if !_WORLDSPACENORMAL + surfaceData.normalWS = mul(surfaceDescription.Normal, fragInputs.tangentToWorld); + #else + surfaceData.normalWS = surfaceDescription.Normal; + #endif + + surfaceData.geomNormalWS = fragInputs.tangentToWorld[2]; + + surfaceData.tangentWS = normalize(fragInputs.tangentToWorld[0].xyz); // The tangent is not normalize in tangentToWorld for mikkt. TODO: Check if it expected that we normalize with Morten. Tag: SURFACE_GRADIENT + + + #if HAVE_DECALS + if (_EnableDecals) + { + float alpha = 1.0; + alpha = surfaceDescription.Alpha; + + // Both uses and modifies 'surfaceData.normalWS'. + DecalSurfaceData decalSurfaceData = GetDecalSurfaceData(posInput, fragInputs.tangentToWorld[2], alpha); + ApplyDecalToSurfaceData(decalSurfaceData, fragInputs.tangentToWorld[2], surfaceData); + } + #endif + + bentNormalWS = surfaceData.normalWS; + + surfaceData.tangentWS = Orthonormalize(surfaceData.tangentWS, surfaceData.normalWS); + + #ifdef DEBUG_DISPLAY + if (_DebugMipMapMode != DEBUGMIPMAPMODE_NONE) + { + // TODO: need to update mip info + surfaceData.metallic = 0; + } + + // We need to call ApplyDebugToSurfaceData after filling the surfarcedata and before filling builtinData + // as it can modify attribute use for static lighting + ApplyDebugToSurfaceData(fragInputs.tangentToWorld, surfaceData); + #endif + + // By default we use the ambient occlusion with Tri-ace trick (apply outside) for specular occlusion. + // If user provide bent normal then we process a better term + #if defined(_SPECULAR_OCCLUSION_CUSTOM) + // Just use the value passed through via the slot (not active otherwise) + #elif defined(_SPECULAR_OCCLUSION_FROM_AO_BENT_NORMAL) + // If we have bent normal and ambient occlusion, process a specular occlusion + surfaceData.specularOcclusion = GetSpecularOcclusionFromBentAO(V, bentNormalWS, surfaceData.normalWS, surfaceData.ambientOcclusion, PerceptualSmoothnessToPerceptualRoughness(surfaceData.perceptualSmoothness)); + #elif defined(_AMBIENT_OCCLUSION) && defined(_SPECULAR_OCCLUSION_FROM_AO) + surfaceData.specularOcclusion = GetSpecularOcclusionFromAmbientOcclusion(ClampNdotV(dot(surfaceData.normalWS, V)), surfaceData.ambientOcclusion, PerceptualSmoothnessToRoughness(surfaceData.perceptualSmoothness)); + #endif + + #if defined(_ENABLE_GEOMETRIC_SPECULAR_AA) && !defined(SHADER_STAGE_RAY_TRACING) + surfaceData.perceptualSmoothness = GeometricNormalFiltering(surfaceData.perceptualSmoothness, fragInputs.tangentToWorld[2], surfaceDescription.SpecularAAScreenSpaceVariance, surfaceDescription.SpecularAAThreshold); + #endif + } + + void GetSurfaceAndBuiltinData(VertexToPixel m2ps, FragInputs fragInputs, float3 V, inout PositionInputs posInput, + out SurfaceData surfaceData, out BuiltinData builtinData, inout Surface l, inout ShaderData d + #if NEED_FACING + , bool facing + #endif + ) + { + // Removed since crossfade does not work, probably needs extra material setup. + //#if !defined(SHADER_STAGE_RAY_TRACING) && !defined(_TESSELLATION_DISPLACEMENT) + // #ifdef LOD_FADE_CROSSFADE // enable dithering LOD transition if user select CrossFade transition in LOD group + // LODDitheringTransition(ComputeFadeMaskSeed(V, posInput.positionSS), unity_LODFade.x); + // #endif + //#endif + + d = CreateShaderData(m2ps + #if NEED_FACING + , facing + #endif + ); + + l = (Surface)0; + + l.Albedo = half3(0.5, 0.5, 0.5); + l.Normal = float3(0,0,1); + l.Occlusion = 1; + l.Alpha = 1; + l.SpecularOcclusion = 1; + + #if !defined(SHADER_STAGE_RAY_TRACING) && defined(_DEPTHOFFSET_ON) + l.outputDepth = d.clipPos.z; + #endif + + ChainSurfaceFunction(l, d); + + #if !defined(SHADER_STAGE_RAY_TRACING) && defined(_DEPTHOFFSET_ON) + //posInput.deviceDepth = l.outputDepth; + #endif + + #if _UNLIT + //l.Emission = l.Albedo; + //l.Albedo = 0; + l.Normal = half3(0,0,1); + l.Occlusion = 1; + l.Metallic = 0; + l.Specular = 0; + #endif + + surfaceData.geomNormalWS = d.worldSpaceNormal; + surfaceData.tangentWS = d.worldSpaceTangent; + fragInputs.tangentToWorld = d.TBNMatrix; + + float3 bentNormalWS; + BuildSurfaceData(fragInputs, l, V, posInput, surfaceData, bentNormalWS); + + + InitBuiltinData(posInput, l.Alpha, bentNormalWS, -d.worldSpaceNormal, fragInputs.texCoord1, fragInputs.texCoord2, builtinData); + + + + builtinData.emissiveColor = l.Emission; + + #if defined(_OVERRIDE_BAKEDGI) + builtinData.bakeDiffuseLighting = l.DiffuseGI; + builtinData.backBakeDiffuseLighting = l.BackDiffuseGI; + builtinData.emissiveColor += l.SpecularGI; + #endif + + #if defined(_OVERRIDE_SHADOWMASK) + builtinData.shadowMask0 = l.ShadowMask.x; + builtinData.shadowMask1 = l.ShadowMask.y; + builtinData.shadowMask2 = l.ShadowMask.z; + builtinData.shadowMask3 = l.ShadowMask.w; + #endif + + #if defined(UNITY_VIRTUAL_TEXTURING) + builtinData.vtPackedFeedback = surfaceData.VTPackedFeedback; + #endif + + #if (SHADERPASS == SHADERPASS_DISTORTION) + //builtinData.distortion = surfaceData.Distortion; + //builtinData.distortionBlur = surfaceData.DistortionBlur; + #endif + + #ifndef SHADER_UNLIT + // PostInitBuiltinData call ApplyDebugToBuiltinData + PostInitBuiltinData(V, posInput, surfaceData, builtinData); + #else + ApplyDebugToBuiltinData(builtinData); + #endif + + RAY_TRACING_OPTIONAL_ALPHA_TEST_PASS + } + + + +#if defined(WRITE_DECAL_BUFFER) && defined(WRITE_MSAA_DEPTH) +#define SV_TARGET_NORMAL SV_Target3 +#elif defined(WRITE_DECAL_BUFFER) || defined(WRITE_MSAA_DEPTH) +#define SV_TARGET_NORMAL SV_Target2 +#else +#define SV_TARGET_NORMAL SV_Target1 +#endif + +// Caution: Motion vector pass is different from Depth prepass, it render normal buffer last instead of decal buffer last +// and thus, we force a write of 0 if _DISABLE_DECALS so we always write in the decal buffer. +// This is required as we can't make distinction between deferred (write normal buffer) and forward (write normal buffer) +// in the context of the motion vector pass. The cost is acceptable as it is only do object with motion vector (usualy skin object) +// that most of the time use Forward Material (so are already writing motion vector data). +// So note that here unlike for depth prepass we don't check && !defined(_DISABLE_DECALS) +void Frag( VertexToPixel v2f + #ifdef WRITE_MSAA_DEPTH + // We need the depth color as SV_Target0 for alpha to coverage + , out float4 depthColor : SV_Target0 + , out float4 outMotionVector : SV_Target1 + #ifdef WRITE_DECAL_BUFFER + , out float4 outDecalBuffer : SV_Target2 + #endif + #else + // When no MSAA, the motion vector is always the first buffer + , out float4 outMotionVector : SV_Target0 + #ifdef WRITE_DECAL_BUFFER + , out float4 outDecalBuffer : SV_Target1 + #endif + #endif + + // Decal buffer must be last as it is bind but we can optionally write into it (based on _DISABLE_DECALS) + #ifdef WRITE_NORMAL_BUFFER + , out float4 outNormalBuffer : SV_TARGET_NORMAL + #endif + + #ifdef _DEPTHOFFSET_ON + , out float outputDepth : SV_Depth + #endif + #if NEED_FACING + , bool facing : SV_IsFrontFace + #endif + ) + { + + FragInputs input = BuildFragInputs(v2f); + PositionInputs posInput = GetPositionInput(input.positionSS.xy, _ScreenSize.zw, input.positionSS.z, input.positionSS.w, input.positionRWS); + + float3 V = GetWorldSpaceNormalizeViewDir(input.positionRWS); + + + SurfaceData surfaceData; + BuiltinData builtinData; + Surface l; + ShaderData d; + GetSurfaceAndBuiltinData(v2f, input, V, posInput, surfaceData, builtinData, l, d + #if NEED_FACING + , facing + #endif + ); + + #ifdef _DEPTHOFFSET_ON + v2f.motionVectorCS.w += builtinData.depthOffset; + v2f.previousPositionCS.w += builtinData.depthOffset; + #endif + + // TODO: How to allow overriden motion vector from GetSurfaceAndBuiltinData ? + float2 motionVector = CalculateMotionVector(v2f.motionVectorCS, v2f.previousPositionCS); + + // Convert from Clip space (-1..1) to NDC 0..1 space. + // Note it doesn't mean we don't have negative value, we store negative or positive offset in NDC space. + // Note: ((positionCS * 0.5 + 0.5) - (v2f.previousPositionCS * 0.5 + 0.5)) = (motionVector * 0.5) + EncodeMotionVector(motionVector * 0.5, outMotionVector); + + // Note: unity_MotionVectorsParams.y is 0 is forceNoMotion is enabled + bool forceNoMotion = unity_MotionVectorsParams.y == 0.0; + + // Setting the motionVector to a value more than 2 set as a flag for "force no motion". This is valid because, given that the velocities are in NDC, + // a value of >1 can never happen naturally, unless explicitely set. + if (forceNoMotion) + outMotionVector = float4(2.0, 0.0, 0.0, 0.0); + + // Depth and Alpha to coverage + #ifdef WRITE_MSAA_DEPTH + // In case we are rendering in MSAA, reading the an MSAA depth buffer is way too expensive. To avoid that, we export the depth to a color buffer + depthColor = v2f.pos.z; + + #ifdef _ALPHATOMASK_ON + // Alpha channel is used for alpha to coverage + depthColor.a = SharpenAlpha(builtinData.opacity, builtinData.alphaClipTreshold); + #endif + #endif + + // Normal Buffer Processing + #ifdef WRITE_NORMAL_BUFFER + EncodeIntoNormalBuffer(ConvertSurfaceDataToNormalData(surfaceData), outNormalBuffer); + #endif + + #if defined(WRITE_DECAL_BUFFER) + DecalPrepassData decalPrepassData; + // Force a write in decal buffer even if decal is disab. This is a neutral value which have no impact for later pass + #ifdef _DISABLE_DECALS + ZERO_INITIALIZE(DecalPrepassData, decalPrepassData); + #else + // We don't have the right to access SurfaceData in a shaderpass. + // However it would be painful to have to add a function like ConvertSurfaceDataToDecalPrepassData() to every Material to return geomNormalWS anyway + // Here we will put the constrain that any Material requiring to support Decal, will need to have geomNormalWS as member of surfaceData (and we already require normalWS anyway) + decalPrepassData.geomNormalWS = surfaceData.geomNormalWS; + decalPrepassData.decalLayerMask = GetMeshRenderingDecalLayer(); + #endif + EncodeIntoDecalPrepassBuffer(decalPrepassData, outDecalBuffer); + #endif + + #ifdef _DEPTHOFFSET_ON + outputDepth = posInput.deviceDepth; + #endif + } + + ENDHLSL + } + + + Pass + { + Name "FullScreenDebug" + Tags + { + "LightMode" = "FullScreenDebug" + } + + // Render State + Cull Back + ZTest LEqual + ZWrite Off + + //------------------------------------------------------------------------------------- + // End Render Modes + //------------------------------------------------------------------------------------- + + HLSLPROGRAM + + #pragma target 4.5 + #pragma only_renderers d3d11 playstation xboxone vulkan metal switch + + + + //#pragma shader_feature _ _SURFACE_TYPE_TRANSPARENT + //#pragma shader_feature_local _BLENDMODE_OFF _BLENDMODE_ALPHA _BLENDMODE_ADD _BLENDMODE_PRE_MULTIPLY + //#pragma shader_feature_local _ _ADD_PRECOMPUTED_VELOCITY + //#pragma shader_feature_local _ _TRANSPARENT_WRITES_MOTION_VEC + //#pragma shader_feature_local _ _ENABLE_FOG_ON_TRANSPARENT + //#pragma shader_feature_local _ _DISABLE_DECALS + //#pragma shader_feature_local _ _DISABLE_SSR + //#pragma shader_feature_local _ _DISABLE_SSR_TRANSPARENT + //#pragma shader_feature_local _REFRACTION_OFF _REFRACTION_PLANE _REFRACTION_SPHERE _REFRACTION_THIN + + + + #define SHADERPASS SHADERPASS_FULL_SCREEN_DEBUG + #define _PASSFULLSCREENDEBUG 1 + + + #pragma shader_feature_local GLOW_ON + #pragma shader_feature_local FADE_ON + #pragma shader_feature_local OUTBASE_ON + #pragma shader_feature_local ONLYOUTLINE_ON + #pragma shader_feature_local GRADIENT_ON + #pragma shader_feature_local GRADIENT2COL_ON + #pragma shader_feature_local RADIALGRADIENT_ON + #pragma shader_feature_local COLORSWAP_ON + #pragma shader_feature_local HSV_ON + #pragma shader_feature_local CHANGECOLOR_ON + #pragma shader_feature_local CHANGECOLOR2_ON + #pragma shader_feature_local CHANGECOLOR3_ON + #pragma shader_feature_local COLORRAMP_ON + #pragma shader_feature_local GRADIENTCOLORRAMP_ON + #pragma shader_feature_local HITEFFECT_ON + #pragma shader_feature_local NEGATIVE_ON + #pragma shader_feature_local PIXELATE_ON + #pragma shader_feature_local GREYSCALE_ON + #pragma shader_feature_local POSTERIZE_ON + #pragma shader_feature_local BLUR_ON + #pragma shader_feature_local MOTIONBLUR_ON + #pragma shader_feature_local GHOST_ON + #pragma shader_feature_local ALPHAOUTLINE_ON + #pragma shader_feature_local INNEROUTLINE_ON + #pragma shader_feature_local ONLYINNEROUTLINE_ON + #pragma shader_feature_local HOLOGRAM_ON + #pragma shader_feature_local CHROMABERR_ON + #pragma shader_feature_local GLITCH_ON + #pragma shader_feature_local FLICKER_ON + #pragma shader_feature_local SHADOW_ON + #pragma shader_feature_local SHINE_ON + #pragma shader_feature_local CONTRAST_ON + #pragma shader_feature_local OVERLAY_ON + #pragma shader_feature_local OVERLAYMULT_ON + #pragma shader_feature_local DOODLE_ON + #pragma shader_feature_local WIND_ON + #pragma shader_feature_local WAVEUV_ON + #pragma shader_feature_local ROUNDWAVEUV_ON + #pragma shader_feature_local RECTSIZE_ON + #pragma shader_feature_local OFFSETUV_ON + #pragma shader_feature_local CLIPPING_ON + #pragma shader_feature_local RADIALCLIPPING_ON + #pragma shader_feature_local TEXTURESCROLL_ON + #pragma shader_feature_local ZOOMUV_ON + #pragma shader_feature_local DISTORT_ON + #pragma shader_feature_local WARP_ON + #pragma shader_feature_local TWISTUV_ON + #pragma shader_feature_local ROTATEUV_ON + #pragma shader_feature_local POLARUV_ON + #pragma shader_feature_local FISHEYE_ON + #pragma shader_feature_local PINCH_ON + #pragma shader_feature_local SHAKEUV_ON + + #pragma shader_feature_local GLOWTEX_ON + #pragma shader_feature_local OUTTEX_ON + #pragma shader_feature_local OUTDIST_ON + #pragma shader_feature_local OUTBASE8DIR_ON + #pragma shader_feature_local OUTBASEPIXELPERF_ON + #pragma shader_feature_local COLORRAMPOUTLINE_ON + #pragma shader_feature_local GREYSCALEOUTLINE_ON + #pragma shader_feature_local POSTERIZEOUTLINE_ON + #pragma shader_feature_local BLURISHD_ON + #pragma shader_feature_local MANUALWIND_ON + #pragma shader_feature_local ATLAS_ON + #pragma shader_feature_local PREMULTIPLYALPHA_ON + + #pragma shader_feature BILBOARD_ON + #pragma shader_feature BILBOARDY_ON + + #pragma shader_feature NORMALMAP_ON + + + #define _HDRP 1 +#define _USINGTEXCOORD1 1 +#define _USINGTEXCOORD2 1 + + + #pragma vertex Vert + #pragma fragment Frag + + // useful conversion functions to make surface shader code just work + + #define UNITY_DECLARE_TEX2D(name) TEXTURE2D(name); SAMPLER(sampler##name); + #define UNITY_DECLARE_TEX2D_NOSAMPLER(name) TEXTURE2D(name); + #define UNITY_DECLARE_TEX2DARRAY(name) TEXTURE2D_ARRAY(name); SAMPLER(sampler##name); + #define UNITY_DECLARE_TEX2DARRAY_NOSAMPLER(tex) TEXTURE2D_ARRAY(tex); + + #define UNITY_SAMPLE_TEX2DARRAY(tex,coord) SAMPLE_TEXTURE2D_ARRAY(tex, sampler##tex, coord.xy, coord.z) + #define UNITY_SAMPLE_TEX2DARRAY_LOD(tex,coord,lod) SAMPLE_TEXTURE2D_ARRAY_LOD(tex, sampler##tex, coord.xy, coord.z, lod) + #define UNITY_SAMPLE_TEX2D(tex, coord) SAMPLE_TEXTURE2D(tex, sampler##tex, coord) + #define UNITY_SAMPLE_TEX2D_SAMPLER(tex, samp, coord) SAMPLE_TEXTURE2D(tex, sampler##samp, coord) + + #define UNITY_SAMPLE_TEX2D_LOD(tex,coord, lod) SAMPLE_TEXTURE2D_LOD(tex, sampler_##tex, coord, lod) + #define UNITY_SAMPLE_TEX2D_SAMPLER_LOD(tex,samplertex,coord, lod) SAMPLE_TEXTURE2D_LOD (tex, sampler##samplertex,coord, lod) + + #if defined(UNITY_COMPILER_HLSL) + #define UNITY_INITIALIZE_OUTPUT(type,name) name = (type)0; + #else + #define UNITY_INITIALIZE_OUTPUT(type,name) + #endif + + #define sampler2D_float sampler2D + #define sampler2D_half sampler2D + + #undef WorldNormalVector + #define WorldNormalVector(data, normal) mul(normal, data.TBNMatrix) + + #define UnityObjectToWorldNormal(normal) mul(GetObjectToWorldMatrix(), normal) + + + + +// HDRP Adapter stuff + #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Common.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/ShaderVariables.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/ShaderPass/FragInputs.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/ShaderPass/ShaderPass.cs.hlsl" + #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/TextureStack.hlsl" // Required to be include before we include properties as it define DECLARE_STACK_CB + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/ShaderGraphHeader.hlsl" // Need to be here for Gradient struct definition + + #ifdef RAYTRACING_SHADER_GRAPH_DEFAULT + #define RAYTRACING_SHADER_GRAPH_HIGH + #endif + + #ifdef RAYTRACING_SHADER_GRAPH_RAYTRACED + #define RAYTRACING_SHADER_GRAPH_LOW + #endif + // end + + + + + // If we use subsurface scattering, enable output split lighting (for forward pass) + #if defined(_MATERIAL_FEATURE_SUBSURFACE_SCATTERING) && !defined(_SURFACE_TYPE_TRANSPARENT) + #define OUTPUT_SPLIT_LIGHTING + #endif + + #define HAVE_RECURSIVE_RENDERING + + #if SHADERPASS == SHADERPASS_TRANSPARENT_DEPTH_PREPASS + #if !defined(_DISABLE_SSR_TRANSPARENT) && !defined(SHADER_UNLIT) + #define WRITE_NORMAL_BUFFER + #endif + #endif + + #ifndef DEBUG_DISPLAY + // In case of opaque we don't want to perform the alpha test, it is done in depth prepass and we use depth equal for ztest (setup from UI) + // Don't do it with debug display mode as it is possible there is no depth prepass in this case + #if !defined(_SURFACE_TYPE_TRANSPARENT) && defined(_ALPHATEST) + #if SHADERPASS == SHADERPASS_FORWARD + #define SHADERPASS_FORWARD_BYPASS_ALPHA_TEST + #elif SHADERPASS == SHADERPASS_GBUFFER + #define SHADERPASS_GBUFFER_BYPASS_ALPHA_TEST + #endif + #endif + #endif + + // Translate transparent motion vector define + #if defined(_TRANSPARENT_WRITES_MOTION_VEC) && defined(_SURFACE_TYPE_TRANSPARENT) + #define _WRITE_TRANSPARENT_MOTION_VECTOR + #endif + + + + + CBUFFER_START(UnityPerMaterial) + float _UseShadowThreshold; + float _BlendMode; + float _EnableBlendModePreserveSpecularLighting; + float _RayTracing; + float _RefractionModel; + + + half4 _Color; + half4 _MainTex_ST, _MainTex_TexelSize; + half _Alpha, _AlphaCutoffValue; + + #if ATLAS_ON + half _MinXUV, _MaxXUV, _MinYUV, _MaxYUV; + #endif + + #if GLOW_ON + half4 _GlowColor; + half _Glow, _GlowGlobal; + #endif + + #if HSV_ON + half _HsvShift, _HsvSaturation, _HsvBright; + #endif + + #if DISTORT_ON + half4 _DistortTex_ST; + half _DistortTexXSpeed, _DistortTexYSpeed, _DistortAmount; + #endif + + #if FADE_ON + half4 _FadeBurnColor, _FadeTex_ST, _FadeBurnTex_ST; + half _FadeAmount, _FadeBurnWidth, _FadeBurnTransition,_FadeBurnGlow; + #endif + + #if OUTBASE_ON + half4 _OutlineColor; + half _OutlineAlpha, _OutlineGlow, _OutlineWidth; + int _OutlinePixelWidth; + #endif + + #if OUTTEX_ON + half4 _OutlineTex_ST; + half _OutlineTexXSpeed, _OutlineTexYSpeed; + #endif + + #if OUTDIST_ON + half4 _OutlineDistortTex_ST; + half _OutlineDistortTexXSpeed, _OutlineDistortTexYSpeed, _OutlineDistortAmount; + #endif + + #if ALPHAOUTLINE_ON + half _AlphaOutlineGlow, _AlphaOutlinePower, _AlphaOutlineMinAlpha, _AlphaOutlineBlend; + half4 _AlphaOutlineColor; + #endif + + #if INNEROUTLINE_ON + half _InnerOutlineThickness, _InnerOutlineAlpha, _InnerOutlineGlow; + half4 _InnerOutlineColor; + #endif + + #if GRADIENT_ON + half _GradBlend, _GradBoostX, _GradBoostY; + half4 _GradTopRightCol, _GradTopLeftCol, _GradBotRightCol, _GradBotLeftCol; + #endif + + #if COLORSWAP_ON + half4 _ColorSwapRed, _ColorSwapGreen, _ColorSwapBlue; + half _ColorSwapRedLuminosity, _ColorSwapGreenLuminosity, _ColorSwapBlueLuminosity, _ColorSwapBlend; + #endif + + #if CHANGECOLOR_ON + half4 _ColorChangeNewCol, _ColorChangeTarget; + half _ColorChangeTolerance, _ColorChangeLuminosity; + #endif + #if CHANGECOLOR2_ON + half4 _ColorChangeNewCol2, _ColorChangeTarget2; + half _ColorChangeTolerance2; + #endif + #if CHANGECOLOR3_ON + half4 _ColorChangeNewCol3, _ColorChangeTarget3; + half _ColorChangeTolerance3; + #endif + + #if COLORRAMP_ON + half _ColorRampLuminosity, _ColorRampBlend; + #endif + + #if HITEFFECT_ON + half4 _HitEffectColor; + half _HitEffectGlow, _HitEffectBlend; + #endif + + #if NEGATIVE_ON + half _NegativeAmount; + #endif + + #if PIXELATE_ON + half _PixelateSize; + #endif + + #if GREYSCALE_ON + half _GreyscaleLuminosity, _GreyscaleBlend; + half4 _GreyscaleTintColor; + #endif + + #if POSTERIZE_ON + half _PosterizeNumColors, _PosterizeGamma; + #endif + + #if BLUR_ON + half _BlurIntensity; + #endif + + #if MOTIONBLUR_ON + half _MotionBlurAngle, _MotionBlurDist; + #endif + + #if GHOST_ON + half _GhostColorBoost, _GhostTransparency, _GhostBlend; + #endif + + #if HOLOGRAM_ON + half _HologramStripesAmount, _HologramMinAlpha, _HologramUnmodAmount, _HologramStripesSpeed, _HologramMaxAlpha, _HologramBlend; + half4 _HologramStripeColor; + #endif + + #if CHROMABERR_ON + half _ChromAberrAmount, _ChromAberrAlpha; + #endif + + #if GLITCH_ON + half _GlitchAmount, _GlitchSize; + #endif + + #if FLICKER_ON + half _FlickerFreq, _FlickerPercent, _FlickerAlpha; + #endif + + #if SHADOW_ON + half _ShadowX, _ShadowY, _ShadowAlpha; + half4 _ShadowColor; + #endif + + #if SHINE_ON + half4 _ShineColor; + half _ShineLocation, _ShineRotate, _ShineWidth, _ShineGlow; + #endif + + #if CONTRAST_ON + half _Contrast, _Brightness; + #endif + + #if OVERLAY_ON + half4 _OverlayTex_ST, _OverlayColor; + half _OverlayGlow, _OverlayBlend, _OverlayTextureScrollXSpeed, _OverlayTextureScrollYSpeed; + #endif + + #if DOODLE_ON + half _HandDrawnAmount, _HandDrawnSpeed; + #endif + + #if WIND_ON + half _GrassSpeed, _GrassWind, _GrassManualAnim, _GrassRadialBend; + #endif + + #if WAVEUV_ON + float _WaveAmount, _WaveSpeed, _WaveStrength, _WaveX, _WaveY; + #endif + + #if ROUNDWAVEUV_ON + half _RoundWaveStrength, _RoundWaveSpeed; + #endif + + #if RECTSIZE_ON + half _RectSize; + #endif + + #if OFFSETUV_ON + half _OffsetUvX, _OffsetUvY; + #endif + + #if CLIPPING_ON + half _ClipUvLeft, _ClipUvRight, _ClipUvUp, _ClipUvDown; + #endif + + #if RADIALCLIPPING_ON + half _RadialStartAngle, _RadialClip, _RadialClip2; + #endif + + #if TEXTURESCROLL_ON + half _TextureScrollXSpeed, _TextureScrollYSpeed; + #endif + + #if ZOOMUV_ON + half _ZoomUvAmount; + #endif + + #if WARP_ON + half _WarpStrength, _WarpSpeed, _WarpScale; + #endif + + #if TWISTUV_ON + half _TwistUvAmount, _TwistUvPosX, _TwistUvPosY, _TwistUvRadius; + #endif + + #if ROTATEUV_ON + half _RotateUvAmount; + #endif + + #if FISHEYE_ON + half _FishEyeUvAmount; + #endif + + #if PINCH_ON + half _PinchUvAmount; + #endif + + #if SHAKEUV_ON + half _ShakeUvSpeed, _ShakeUvX, _ShakeUvY; + #endif + + #if NORMALMAP_ON + half _NormalStrength; + #endif + + float _RandomSeed; + + + + + CBUFFER_END + + + + // -- Property used by ScenePickingPass + #ifdef SCENEPICKINGPASS + float4 _SelectionID; + #endif + + // -- Properties used by SceneSelectionPass + #ifdef SCENESELECTIONPASS + int _ObjectId; + int _PassValue; + #endif + + + // data across stages, stripped like the above. + struct VertexToPixel + { + float4 pos : SV_POSITION; + float3 worldPos : TEXCOORD0; + float3 worldNormal : TEXCOORD1; + float4 worldTangent : TEXCOORD2; + float4 texcoord0 : TEXCOORD3; + float4 texcoord1 : TEXCOORD4; + float4 texcoord2 : TEXCOORD5; + // #if %TEXCOORD3REQUIREKEY% + float4 texcoord3 : TEXCOORD6; + // #endif + + // #if %SCREENPOSREQUIREKEY% + // float4 screenPos : TEXCOORD7; + // #endif + + // #if %VERTEXCOLORREQUIREKEY% + float4 vertexColor : COLOR; + // #endif + + // #if %EXTRAV2F0REQUIREKEY% + // float4 extraV2F0 : TEXCOORD8; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // float4 extraV2F1 : TEXCOORD9; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // float4 extraV2F2 : TEXCOORD10; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // float4 extraV2F3 : TEXCOORD11; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // float4 extraV2F4 : TEXCOORD12; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // float4 extraV2F5 : TEXCOORD13; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // float4 extraV2F6 : TEXCOORD14; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // float4 extraV2F7 : TEXCOORD15; + // #endif + + #if UNITY_ANY_INSTANCING_ENABLED + UNITY_VERTEX_INPUT_INSTANCE_ID + #endif // UNITY_ANY_INSTANCING_ENABLED + + #if _HDRP && (_PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR))) + float4 previousPositionCS : TEXCOORD16; // Contain previous transform position (in case of skinning for example) + float4 motionVectorCS : TEXCOORD17; + #endif + + UNITY_VERTEX_OUTPUT_STEREO + }; + + + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Debug/DebugDisplay.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/Material.hlsl" + #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/NormalSurfaceGradient.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/Lit/Lit.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/BuiltinUtilities.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/MaterialUtilities.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/ShaderGraphFunctions.hlsl" + + + + + // data describing the user output of a pixel + struct Surface + { + half3 Albedo; + half Height; + half3 Normal; + half Smoothness; + half3 Emission; + half Metallic; + half3 Specular; + half Occlusion; + half SpecularPower; // for simple lighting + half Alpha; + float outputDepth; // if written, SV_Depth semantic is used. ShaderData.clipPos.z is unused value + // HDRP Only + half SpecularOcclusion; + half SubsurfaceMask; + half Thickness; + half CoatMask; + half CoatSmoothness; + half Anisotropy; + half IridescenceMask; + half IridescenceThickness; + int DiffusionProfileHash; + float SpecularAAThreshold; + float SpecularAAScreenSpaceVariance; + // requires _OVERRIDE_BAKEDGI to be defined, but is mapped in all pipelines + float3 DiffuseGI; + float3 BackDiffuseGI; + float3 SpecularGI; + float ior; + float3 transmittanceColor; + float atDistance; + float transmittanceMask; + // requires _OVERRIDE_SHADOWMASK to be defines + float4 ShadowMask; + + // for decals + float NormalAlpha; + float MAOSAlpha; + + + }; + + // Data the user declares in blackboard blocks + struct Blackboard + { + + float blackboardDummyData; + }; + + // data the user might need, this will grow to be big. But easy to strip + struct ShaderData + { + float4 clipPos; // SV_POSITION + float3 localSpacePosition; + float3 localSpaceNormal; + float3 localSpaceTangent; + + float3 worldSpacePosition; + float3 worldSpaceNormal; + float3 worldSpaceTangent; + float tangentSign; + + float3 worldSpaceViewDir; + float3 tangentSpaceViewDir; + + float4 texcoord0; + float4 texcoord1; + float4 texcoord2; + float4 texcoord3; + + float2 screenUV; + float4 screenPos; + + float4 vertexColor; + bool isFrontFace; + + float4 extraV2F0; + float4 extraV2F1; + float4 extraV2F2; + float4 extraV2F3; + float4 extraV2F4; + float4 extraV2F5; + float4 extraV2F6; + float4 extraV2F7; + + float3x3 TBNMatrix; + Blackboard blackboard; + }; + + struct VertexData + { + #if SHADER_TARGET > 30 + // uint vertexID : SV_VertexID; + #endif + float4 vertex : POSITION; + float3 normal : NORMAL; + float4 tangent : TANGENT; + float4 texcoord0 : TEXCOORD0; + + // optimize out mesh coords when not in use by user or lighting system + #if _URP && (_USINGTEXCOORD1 || _PASSMETA || _PASSFORWARD || _PASSGBUFFER) + float4 texcoord1 : TEXCOORD1; + #endif + + #if _URP && (_USINGTEXCOORD2 || _PASSMETA || ((_PASSFORWARD || _PASSGBUFFER) && defined(DYNAMICLIGHTMAP_ON))) + float4 texcoord2 : TEXCOORD2; + #endif + + #if _STANDARD && (_USINGTEXCOORD1 || (_PASSMETA || ((_PASSFORWARD || _PASSGBUFFER || _PASSFORWARDADD) && LIGHTMAP_ON))) + float4 texcoord1 : TEXCOORD1; + #endif + #if _STANDARD && (_USINGTEXCOORD2 || (_PASSMETA || ((_PASSFORWARD || _PASSGBUFFER) && DYNAMICLIGHTMAP_ON))) + float4 texcoord2 : TEXCOORD2; + #endif + + + #if _HDRP + float4 texcoord1 : TEXCOORD1; + float4 texcoord2 : TEXCOORD2; + #endif + + // #if %TEXCOORD3REQUIREKEY% + float4 texcoord3 : TEXCOORD3; + // #endif + + // #if %VERTEXCOLORREQUIREKEY% + float4 vertexColor : COLOR; + // #endif + + #if _PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR)) + float3 previousPositionOS : TEXCOORD4; // Contain previous transform position (in case of skinning for example) + #if defined (_ADD_PRECOMPUTED_VELOCITY) + float3 precomputedVelocity : TEXCOORD5; // Add Precomputed Velocity (Alembic computes velocities on runtime side). + #endif + #endif + + UNITY_VERTEX_INPUT_INSTANCE_ID + }; + + struct TessVertex + { + float4 vertex : INTERNALTESSPOS; + float3 normal : NORMAL; + float4 tangent : TANGENT; + float4 texcoord0 : TEXCOORD0; + float4 texcoord1 : TEXCOORD1; + float4 texcoord2 : TEXCOORD2; + + // #if %TEXCOORD3REQUIREKEY% + float4 texcoord3 : TEXCOORD3; + // #endif + + // #if %VERTEXCOLORREQUIREKEY% + float4 vertexColor : COLOR; + // #endif + + // #if %EXTRAV2F0REQUIREKEY% + // float4 extraV2F0 : TEXCOORD5; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // float4 extraV2F1 : TEXCOORD6; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // float4 extraV2F2 : TEXCOORD7; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // float4 extraV2F3 : TEXCOORD8; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // float4 extraV2F4 : TEXCOORD9; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // float4 extraV2F5 : TEXCOORD10; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // float4 extraV2F6 : TEXCOORD11; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // float4 extraV2F7 : TEXCOORD12; + // #endif + + #if _PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR)) + float3 previousPositionOS : TEXCOORD13; // Contain previous transform position (in case of skinning for example) + #if defined (_ADD_PRECOMPUTED_VELOCITY) + float3 precomputedVelocity : TEXCOORD14; + #endif + #endif + + UNITY_VERTEX_INPUT_INSTANCE_ID + UNITY_VERTEX_OUTPUT_STEREO + }; + + struct ExtraV2F + { + float4 extraV2F0; + float4 extraV2F1; + float4 extraV2F2; + float4 extraV2F3; + float4 extraV2F4; + float4 extraV2F5; + float4 extraV2F6; + float4 extraV2F7; + Blackboard blackboard; + float4 time; + }; + + + float3 WorldToTangentSpace(ShaderData d, float3 normal) + { + return mul(d.TBNMatrix, normal); + } + + float3 TangentToWorldSpace(ShaderData d, float3 normal) + { + return mul(normal, d.TBNMatrix); + } + + // in this case, make standard more like SRPs, because we can't fix + // unity_WorldToObject in HDRP, since it already does macro-fu there + + #if _STANDARD + float3 TransformWorldToObject(float3 p) { return mul(unity_WorldToObject, float4(p, 1)); }; + float3 TransformObjectToWorld(float3 p) { return mul(unity_ObjectToWorld, float4(p, 1)); }; + float4 TransformWorldToObject(float4 p) { return mul(unity_WorldToObject, p); }; + float4 TransformObjectToWorld(float4 p) { return mul(unity_ObjectToWorld, p); }; + float4x4 GetWorldToObjectMatrix() { return unity_WorldToObject; } + float4x4 GetObjectToWorldMatrix() { return unity_ObjectToWorld; } + #if (defined(SHADER_API_D3D11) || defined(SHADER_API_XBOXONE) || defined(UNITY_COMPILER_HLSLCC) || defined(SHADER_API_PSSL) || (SHADER_TARGET_SURFACE_ANALYSIS && !SHADER_TARGET_SURFACE_ANALYSIS_MOJOSHADER)) + #define UNITY_SAMPLE_TEX2D_LOD(tex,coord, lod) tex.SampleLevel (sampler##tex,coord, lod) + #define UNITY_SAMPLE_TEX2D_SAMPLER_LOD(tex,samplertex,coord, lod) tex.SampleLevel (sampler##samplertex,coord, lod) + #else + #define UNITY_SAMPLE_TEX2D_LOD(tex,coord,lod) tex2D (tex,coord,0,lod) + #define UNITY_SAMPLE_TEX2D_SAMPLER_LOD(tex,samplertex,coord,lod) tex2D (tex,coord,0,lod) + #endif + + #undef GetWorldToObjectMatrix() + + #define GetWorldToObjectMatrix() unity_WorldToObject + + + #endif + + float3 GetCameraWorldPosition() + { + #if _HDRP + return GetCameraRelativePositionWS(_WorldSpaceCameraPos); + #else + return _WorldSpaceCameraPos; + #endif + } + + #if _GRABPASSUSED + #if _STANDARD + TEXTURE2D(%GRABTEXTURE%); + SAMPLER(sampler_%GRABTEXTURE%); + #endif + + half3 GetSceneColor(float2 uv) + { + #if _STANDARD + return SAMPLE_TEXTURE2D(%GRABTEXTURE%, sampler_%GRABTEXTURE%, uv).rgb; + #else + return SHADERGRAPH_SAMPLE_SCENE_COLOR(uv); + #endif + } + #endif + + + + #if _STANDARD + UNITY_DECLARE_DEPTH_TEXTURE(_CameraDepthTexture); + float GetSceneDepth(float2 uv) { return SAMPLE_DEPTH_TEXTURE(_CameraDepthTexture, uv); } + float GetLinear01Depth(float2 uv) { return Linear01Depth(GetSceneDepth(uv)); } + float GetLinearEyeDepth(float2 uv) { return LinearEyeDepth(GetSceneDepth(uv)); } + #else + float GetSceneDepth(float2 uv) { return SHADERGRAPH_SAMPLE_SCENE_DEPTH(uv); } + float GetLinear01Depth(float2 uv) { return Linear01Depth(GetSceneDepth(uv), _ZBufferParams); } + float GetLinearEyeDepth(float2 uv) { return LinearEyeDepth(GetSceneDepth(uv), _ZBufferParams); } + #endif + + float3 GetWorldPositionFromDepthBuffer(float2 uv, float3 worldSpaceViewDir) + { + float eye = GetLinearEyeDepth(uv); + float3 camView = mul((float3x3)GetObjectToWorldMatrix(), transpose(mul(GetWorldToObjectMatrix(), UNITY_MATRIX_I_V)) [2].xyz); + + float dt = dot(worldSpaceViewDir, camView); + float3 div = worldSpaceViewDir/dt; + float3 wpos = (eye * div) + GetCameraWorldPosition(); + return wpos; + } + + #if _HDRP + float3 ObjectToWorldSpacePosition(float3 pos) + { + return GetAbsolutePositionWS(TransformObjectToWorld(pos)); + } + #else + float3 ObjectToWorldSpacePosition(float3 pos) + { + return TransformObjectToWorld(pos); + } + #endif + + #if _STANDARD + UNITY_DECLARE_SCREENSPACE_TEXTURE(_CameraDepthNormalsTexture); + float3 GetSceneNormal(float2 uv, float3 worldSpaceViewDir) + { + float4 depthNorms = UNITY_SAMPLE_SCREENSPACE_TEXTURE(_CameraDepthNormalsTexture, uv); + float3 norms = DecodeViewNormalStereo(depthNorms); + norms = mul((float3x3)GetWorldToViewMatrix(), norms) * 0.5 + 0.5; + return norms; + } + #elif _HDRP && !_DECALSHADER + + float3 GetSceneNormal(float2 uv, float3 worldSpaceViewDir) + { + NormalData nd; + DecodeFromNormalBuffer(_ScreenSize.xy * uv, nd); + return nd.normalWS; + } + #elif _URP + #if (SHADER_LIBRARY_VERSION_MAJOR >= 10) + #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/DeclareNormalsTexture.hlsl" + #endif + + float3 GetSceneNormal(float2 uv, float3 worldSpaceViewDir) + { + #if (SHADER_LIBRARY_VERSION_MAJOR >= 10) + return SampleSceneNormals(uv); + #else + float3 wpos = GetWorldPositionFromDepthBuffer(uv, worldSpaceViewDir); + return normalize(-cross(ddx(wpos), ddy(wpos))) * 0.5 + 0.5; + #endif + + } + #endif + + #if _HDRP + + half3 UnpackNormalmapRGorAG(half4 packednormal) + { + // This do the trick + packednormal.x *= packednormal.w; + + half3 normal; + normal.xy = packednormal.xy * 2 - 1; + normal.z = sqrt(1 - saturate(dot(normal.xy, normal.xy))); + return normal; + } + half3 UnpackNormal(half4 packednormal) + { + #if defined(UNITY_NO_DXT5nm) + return packednormal.xyz * 2 - 1; + #else + return UnpackNormalmapRGorAG(packednormal); + #endif + } + #endif + #if _HDRP || _URP + + half3 UnpackScaleNormal(half4 packednormal, half scale) + { + #ifndef UNITY_NO_DXT5nm + // Unpack normal as DXT5nm (1, y, 1, x) or BC5 (x, y, 0, 1) + // Note neutral texture like "bump" is (0, 0, 1, 1) to work with both plain RGB normal and DXT5nm/BC5 + packednormal.x *= packednormal.w; + #endif + half3 normal; + normal.xy = (packednormal.xy * 2 - 1) * scale; + normal.z = sqrt(1 - saturate(dot(normal.xy, normal.xy))); + return normal; + } + + #endif + + + void GetSun(out float3 lightDir, out float3 color) + { + lightDir = float3(0.5, 0.5, 0); + color = 1; + #if _HDRP + if (_DirectionalLightCount > 0) + { + DirectionalLightData light = _DirectionalLightDatas[0]; + lightDir = -light.forward.xyz; + color = light.color; + } + #elif _STANDARD + lightDir = normalize(_WorldSpaceLightPos0.xyz); + color = _LightColor0.rgb; + #elif _URP + Light light = GetMainLight(); + lightDir = light.direction; + color = light.color; + #endif + } + + + + + + + + + + TEXTURE2D(_MainTex); + SAMPLER(sampler_MainTex); + + #if GLOW_ON + TEXTURE2D(_GlowTex); + SAMPLER(sampler_GlowTex); + #endif + + #if FADE_ON + TEXTURE2D(_FadeTex); + SAMPLER(sampler_FadeTex); + + TEXTURE2D(_FadeBurnTex); + SAMPLER(sampler_FadeBurnTex); + #endif + + #if DISTORT_ON + TEXTURE2D(_DistortTex); + SAMPLER(sampler_DistortTex); + #endif + + #if OUTTEX_ON + TEXTURE2D(_OutlineTex); + SAMPLER(sampler_OutlineTex); + #endif + + #if OUTDIST_ON + TEXTURE2D(_OutlineDistortTex); + SAMPLER(sampler_OutlineDistortTex); + #endif + + #if COLORSWAP_ON + TEXTURE2D(_ColorSwapTex); + SAMPLER(sampler_ColorSwapTex); + #endif + + #if COLORRAMP_ON + TEXTURE2D(_ColorRampTex); + TEXTURE2D(_ColorRampTexGradient); + SAMPLER(sampler_ColorRampTex); + SAMPLER(sampler_ColorRampTexGradient); + #endif + + #if SHINE_ON + TEXTURE2D(_ShineMask); + SAMPLER(sampler_ShineMask); + #endif + + #if OVERLAY_ON + TEXTURE2D(_OverlayTex); + SAMPLER(sampler_OverlayTex); + #endif + + #if NORMALMAP_ON + TEXTURE2D(_NormalMap); + SAMPLER(sampler_NormalMap); + #endif + + + half3 GetPixel(in int offsetX, in int offsetY, in half2 uv, in Texture2D _tex, in SamplerState _sampler) + { + half2 _uv = uv + half2(offsetX * _MainTex_TexelSize.x, offsetY * _MainTex_TexelSize.y); + half4 col = SAMPLE_TEXTURE2D(_tex, _sampler, _uv); + return col.rgb; + } + + + //BLURS------------------------------------------------------------------------- + half4 Blur(half2 uv, Texture2D source, SamplerState sampler_source, half Intensity) + { + const half2 texelSize = 1.0 / _ScreenParams.xy; + const half4 color = SAMPLE_TEXTURE2D(source, sampler_source, uv); + const half2 offset = Intensity * texelSize; + + half4 accumulatedColor = color; + half accumulatedWeight = 1.0; + for (int x = -1; x <= 1; x++) + { + for (int y = -1; y <= 1; y++) + { + const half2 sampleUV = uv + half2(x, y) * offset; + const half4 sampleColor = SAMPLE_TEXTURE2D(source, sampler_source, sampleUV); + + accumulatedColor += sampleColor; + accumulatedWeight += 1.0; + } + } + + half4 blurredColor = accumulatedColor / accumulatedWeight; + return blurredColor; + } + + half BlurHD_G(half bhqp, half x) + { + return exp(-(x * x) / (2.0 * bhqp * bhqp)); + } + half4 BlurHD(half2 uv, Texture2D source, SamplerState sampler_source, half BlurAmount, half xScale, half yScale) + { + int iterations = 16; + int halfIterations = iterations / 2; + half sigmaX = 0.1 + BlurAmount * 0.5; + half sigmaY = sigmaX; + half total = 0.0; + half4 ret = half4(0, 0, 0, 0); + for (int iy = 0; iy < iterations; ++iy) + { + half fy = BlurHD_G(sigmaY, half(iy) -half(halfIterations)); + half offsetY = half(iy - halfIterations) * 0.00390625 * xScale; + for (int ix = 0; ix < iterations; ++ix) + { + half fx = BlurHD_G(sigmaX, half(ix) - half(halfIterations)); + half offsetX = half(ix - halfIterations) * 0.00390625 * yScale; + total += fx * fy; + ret += SAMPLE_TEXTURE2D(source, sampler_source, uv + half2(offsetX, offsetY)) * fx * fy; + } + } + return ret / total; + } + //----------------------------------------------------------------------- + + + //------------------------------------------- + half RemapFloat(half inValue, half inMin, half inMax, half outMin, half outMax){ + return outMin + (inValue - inMin) * (outMax - outMin) / (inMax - inMin); + } + //------------------------------------------- + + //----------------------------------------------------------------------- + half rand(half2 seed, half offset) { + return (frac(sin(dot(seed, half2(12.9898, 78.233))) * 43758.5453) + offset) % 1.0; + } + + half rand2(half2 seed, half offset) { + return (frac(sin(dot(seed * floor(50 + (_Time.x % 1.0) * 12.), half2(127.1, 311.7))) * 43758.5453123) + offset) % 1.0; + } + + half rand2CustomTime(half2 seed, half offset, half customTime) { + return (frac(sin(dot(seed * floor(50 + (customTime % 1.0) * 12.), half2(127.1, 311.7))) * 43758.5453123) + offset) % 1.0; + } + //----------------------------------------------------------------------- + + + void Ext_ModifyVertex0 (inout VertexData v, inout ExtraV2F d) + { + //BILBOARD_ON + #if BILBOARD_ON + half3 camRight = mul((half3x3)unity_CameraToWorld, half3(1,0,0)); + half3 camUp = half3(0,1,0); + #if BILBOARDY_ON + camUp = mul((half3x3)unity_CameraToWorld, half3(0,1,0)); + #endif + half3 localPos = v.vertex.x * camRight + v.vertex.y * camUp; + v.vertex = half4(localPos, 1); + #endif + //----------------------------------------------------------- + + v.texcoord0.xy = TRANSFORM_TEX(v.texcoord0.xy, _MainTex); + half2 center = half2(0.5, 0.5); + #if ATLAS_ON + center = half2((_MaxXUV + _MinXUV) / 2.0, (_MaxYUV + _MinYUV) / 2.0); + #endif + + //POLARUV_ON + #if POLARUV_ON + v.texcoord0.xy = v.texcoord0.xy - center; + #endif + + //---------------------------------------- + + //ROTATEUV_ON + #if ROTATEUV_ON + half2 uvC = v.texcoord0.xy; + half cosAngle = cos(_RotateUvAmount); + half sinAngle = sin(_RotateUvAmount); + half2x2 rot = half2x2(cosAngle, -sinAngle, sinAngle, cosAngle); + uvC -= center; + v.texcoord0.xy = mul(rot, uvC); + v.texcoord0.xy += center; + #endif + //-------------------- + + #if RECTSIZE_ON + v.vertex.xyz += (v.vertex.xyz * (_RectSize - 1.0)); + #endif + + #if OUTTEX_ON + v.texcoord1.xy = TRANSFORM_TEX(v.texcoord0.xy, _OutlineTex); + #endif + + #if OUTDIST_ON + v.texcoord2.xy = TRANSFORM_TEX(v.texcoord0.xy, _OutlineDistortTex); + #endif + + #if DISTORT_ON + v.texcoord3.xy = TRANSFORM_TEX(v.texcoord0.xy, _DistortTex); + #endif + } + + void Ext_SurfaceFunction0 (inout Surface o, ShaderData d) + { + half randomSeed = _RandomSeed; + + float2 uvRect = d.texcoord0; + half2 center = half2(0.5, 0.5); + #if ATLAS_ON + center = half2((_MaxXUV + _MinXUV) / 2.0, (_MaxYUV + _MinYUV) / 2.0); + uvRect = half2((d.texcoord0.x - _MinXUV) / (_MaxXUV - _MinXUV), (d.texcoord0.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half2 centerTiled = half2(center.x * _MainTex_ST.x, center.y * _MainTex_ST.y); + + //CLIPPING_ON + #if CLIPPING_ON + half2 tiledUv = half2(d.texcoord0.x / _MainTex_ST.x, d.texcoord0.y / _MainTex_ST.y); + #if ATLAS_ON + tiledUv = half2((tiledUv.x - _MinXUV) / (_MaxXUV - _MinXUV), (tiledUv.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + clip((1 - _ClipUvUp) - tiledUv.y); + clip(tiledUv.y - _ClipUvDown); + clip((1 - _ClipUvRight) - tiledUv.x); + clip(tiledUv.x - _ClipUvLeft); + #endif + //---------------------------------- + + //RADIALCLIPPING_ON + #if RADIALCLIPPING_ON + half2 tiledUv2 = half2(d.texcoord0.x / _MainTex_ST.x, d.texcoord0.y / _MainTex_ST.y); + #if ATLAS_ON + tiledUv2 = half2((tiledUv2.x - _MinXUV) / (_MaxXUV - _MinXUV), (tiledUv2.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half startAngle = _RadialStartAngle - _RadialClip; + half endAngle = _RadialStartAngle + _RadialClip2; + half offset0 = clamp(0, 360, startAngle + 360); + half offset360 = clamp(0, 360, endAngle - 360); + half2 atan2Coord = half2(lerp(-1, 1, tiledUv2.x), lerp(-1, 1, tiledUv2.y)); + half atanAngle = atan2(atan2Coord.y, atan2Coord.x) * 57.3; // angle in degrees + if(atanAngle < 0) atanAngle = 360 + atanAngle; + if(atanAngle >= startAngle && atanAngle <= endAngle) discard; + if(atanAngle <= offset360) discard; + if(atanAngle >= offset0) discard; + #endif + + //----------------------------- + + //TEXTURESCROLL_ON && ATLAS_ON + #if TEXTURESCROLL_ON && ATLAS_ON + d.texcoord0.xy = half2(_MinXUV + ((_MaxXUV - _MinXUV) * (abs(((_Time.y + randomSeed) * _TextureScrollXSpeed) + uvRect.x) % 1)), + _MinYUV + ((_MaxYUV - _MinYUV) * (abs(((_Time.y + randomSeed) * _TextureScrollYSpeed) + uvRect.y) % 1))); + #endif + //---------------------------- + + //OFFSETUV_ON + #if OFFSETUV_ON + #if ATLAS_ON + d.texcoord0.xy = half2(_MinXUV + ((_MaxXUV - _MinXUV) * (abs((_OffsetUvX + uvRect.x) % 1))), + _MinYUV + ((_MaxYUV - _MinYUV) * (abs(_OffsetUvY + uvRect.y) % 1))); + #else + d.texcoord0.xy += half2(_OffsetUvX, _OffsetUvY); + #endif + #endif + + //---------------------- + + //POLARUV_ON + #if POLARUV_ON + d.texcoord0.xy = half2(atan2(d.texcoord0.y, d.texcoord0.x) / (2.0f * 3.141592653589f), length(d.texcoord0.xy)); + d.texcoord0.xy *= _MainTex_ST.xy; + #endif + + //-------------------------------------- + + //TWISTUV_ON + #if TWISTUV_ON + #if ATLAS_ON + _TwistUvPosX = ((_MaxXUV - _MinXUV) * _TwistUvPosX) + _MinXUV; + _TwistUvPosY = ((_MaxYUV - _MinYUV) * _TwistUvPosY) + _MinYUV; + #endif + half2 tempUv = d.texcoord0.xy - half2(_TwistUvPosX * _MainTex_ST.x, _TwistUvPosY * _MainTex_ST.y); + _TwistUvRadius *= (_MainTex_ST.x + _MainTex_ST.y) / 2; + half percent = (_TwistUvRadius - length(tempUv)) / _TwistUvRadius; + half theta = percent * percent * (2.0 * sin(_TwistUvAmount)) * 8.0; + half s = sin(theta); + half c = cos(theta); + half beta = max(sign(_TwistUvRadius - length(tempUv)), 0.0); + tempUv = half2(dot(tempUv, half2(c, -s)), dot(tempUv, half2(s, c))) * beta + tempUv * (1 - beta); + tempUv += half2(_TwistUvPosX * _MainTex_ST.x, _TwistUvPosY * _MainTex_ST.y); + d.texcoord0.xy = tempUv; + #endif + + //-------------------------------------------- + + //FISHEYE_ON + #if FISHEYE_ON + half bind = length(centerTiled); + half2 dF = d.texcoord0.xy - centerTiled; + half dFlen = length(dF); + half fishInt = (3.14159265359 / bind) * (_FishEyeUvAmount + 0.001); + d.texcoord0.xy = centerTiled + (dF / (max(0.0001, dFlen))) * tan(dFlen * fishInt) * bind / tan(bind * fishInt); + #endif + //--------------------------------------------- + + //PINCH_ON + #if PINCH_ON + half2 dP = d.texcoord0.xy - centerTiled; + half pinchInt = (3.141592 / length(centerTiled)) * (-_PinchUvAmount + 0.001); + d.texcoord0.xy = centerTiled + normalize(dP) * atan(length(dP) * -pinchInt * 10.0) * 0.5 / atan(-pinchInt * 5); + #endif + + //--------------------------------------------- + + //ZOOMUV_ON + #if ZOOMUV_ON + d.texcoord0.xy -= centerTiled; + d.texcoord0.xy = d.texcoord0.xy * _ZoomUvAmount; + d.texcoord0.xy += centerTiled; + #endif + + //----------------------------------------------- + + //DOODLE_ON + #if DOODLE_ON + half2 uvCopy = uvRect; + _HandDrawnSpeed = (floor((_Time.x + randomSeed) * 20 * _HandDrawnSpeed) / _HandDrawnSpeed) * _HandDrawnSpeed; + uvCopy.x = sin((uvCopy.x * _HandDrawnAmount + _HandDrawnSpeed) * 4); + uvCopy.y = cos((uvCopy.y * _HandDrawnAmount + _HandDrawnSpeed) * 4); + d.texcoord0.xy = lerp(d.texcoord0.xy, d.texcoord0.xy + uvCopy, 0.0005 * _HandDrawnAmount); + #endif + + //-------------------------- + + //SHAKEUV_ON + #if SHAKEUV_ON + half xShake = sin((_Time.x + randomSeed) * _ShakeUvSpeed * 50) * _ShakeUvX; + half yShake = cos((_Time.x + randomSeed) * _ShakeUvSpeed * 50) * _ShakeUvY; + d.texcoord0.xy += half2(xShake * 0.012, yShake * 0.01); + #endif + + //------------------------------------------- + + //RECTSIZE_ON + #if RECTSIZE_ON + d.texcoord0.xy = d.texcoord0.xy * (_RectSize).xx + (((-_RectSize * 0.5) + 0.5)).xx; + #endif + + //------------------------------------------- + + //DISTORT_ON + #if DISTORT_ON + #if ATLAS_ON + d.texcoord3.x = d.texcoord3.x * (1 / (_MaxXUV - _MinXUV)); + d.texcoord3.y = d.texcoord3.y * (1 / (_MaxYUV - _MinYUV)); + #endif + + d.texcoord3.x += ((_Time.x + _RandomSeed) * _DistortTexXSpeed) % 1; + d.texcoord3.y += ((_Time.x + _RandomSeed) * _DistortTexYSpeed) % 1; + half distortAmnt = (SAMPLE_TEXTURE2D(_DistortTex, sampler_DistortTex, d.texcoord3.xy).r - 0.5) * 0.2 * _DistortAmount; + d.texcoord0.x += distortAmnt; + d.texcoord0.y += distortAmnt; + #endif + //------------------------------------------------------- + + //WARP_ON + #if WARP_ON + half2 warpUv = half2(d.texcoord0.x / _MainTex_ST.x, d.texcoord0.y / _MainTex_ST.y); + #if ATLAS_ON + warpUv = half2((warpUv.x - _MinXUV) / (_MaxXUV - _MinXUV), (warpUv.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + const float tau = 6.283185307179586; + float xWarp = (_Time.y + randomSeed) * _WarpSpeed + warpUv.x * tau / _WarpScale; + float yWarp = (_Time.y + randomSeed) * _WarpSpeed + warpUv.y * tau / _WarpScale; + float2 warp = float2(sin(xWarp), sin(yWarp)) * _WarpStrength; + d.texcoord0.xy += warp; + #endif + + //------------------------------------------------------- + + //WAVEUV_ON + #if WAVEUV_ON + float2 uvWave = half2(_WaveX * _MainTex_ST.x, _WaveY * _MainTex_ST.y) - d.texcoord0.xy; + uvWave %= 1; + #if ATLAS_ON + uvWave = half2(_WaveX, _WaveY) - uvRect; + #endif + uvWave.x *= _ScreenParams.x / _ScreenParams.y; + float waveTime = _Time.y + randomSeed; + float angWave = (sqrt(dot(uvWave, uvWave)) * _WaveAmount) - ((waveTime * _WaveSpeed)); + d.texcoord0.xy = d.texcoord0.xy + uvWave * sin(angWave) * (_WaveStrength / 1000.0); + #endif + //---------------------------------------------------- + + //ROUNDWAVEUV_ON + #if ROUNDWAVEUV_ON + half xWave = ((0.5 * _MainTex_ST.x) - uvRect.x); + half yWave = ((0.5 * _MainTex_ST.y) - uvRect.y) * (_MainTex_TexelSize.w / _MainTex_TexelSize.z); + half ripple = -sqrt(xWave*xWave + yWave* yWave); + d.texcoord0.xy += (sin((ripple + (_Time.y + randomSeed) * (_RoundWaveSpeed/10.0)) / 0.015) * (_RoundWaveStrength/10.0)) % 1; + #endif + //---------------------------------------------------- + + + //WIND_ON + #if WIND_ON + half windOffset = sin((_Time.x + randomSeed) * _GrassSpeed * 10); + half2 windCenter = half2(0.5, 0.1); + #if ATLAS_ON + windCenter.x = ((_MaxXUV - _MinXUV) * windCenter.x) + _MinXUV; + windCenter.y = ((_MaxYUV - _MinYUV) * windCenter.y) + _MinYUV; + #endif + #if !MANUALWIND_ON + d.texcoord0.x = fmod(abs(lerp(d.texcoord0.x, d.texcoord0.x + (_GrassWind * 0.01 * windOffset), uvRect.y)), 1); + #else + d.texcoord0.x = fmod(abs(lerp(d.texcoord0.x, d.texcoord0.x + (_GrassWind * 0.01 * _GrassManualAnim), uvRect.y)), 1); + windOffset = _GrassManualAnim; + #endif + half2 delta = d.texcoord0.xy - windCenter; + half delta2 = dot(delta.xy, delta.xy); + half2 delta_offset = delta2 * windOffset; + d.texcoord0.xy = d.texcoord0.xy + half2(delta.y, -delta.x) * delta_offset * _GrassRadialBend; + #endif + + //-------------------------------------------------------- + + //TEXTURESCROLL_ON && !ATLAS_ON + #if TEXTURESCROLL_ON && !ATLAS_ON + d.texcoord0.x += ((_Time.y + randomSeed) * _TextureScrollXSpeed) % 1; + d.texcoord0.y += ((_Time.y + randomSeed) * _TextureScrollYSpeed) % 1; + #endif + //------------------------------ + + //PIXELATE_ON + #if PIXELATE_ON + half aspectRatio = _MainTex_TexelSize.x / _MainTex_TexelSize.y; + half2 pixelSize = float2(_PixelateSize, _PixelateSize * aspectRatio); + d.texcoord0.xy = floor(d.texcoord0.xy * pixelSize) / pixelSize; + #endif + //-------------- + + half4 col = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy); + half originalAlpha = col.a; + col *= d.vertexColor; + + //NORMAL MAP + #if NORMALMAP_ON + half4 normalSample = SAMPLE_TEXTURE2D(_NormalMap, sampler_NormalMap, d.texcoord0.xy); + half3 normalTS = UnpackNormal(normalSample); + normalTS.xy *= _NormalStrength; + o.Normal = normalTS; + #endif + + + //GLITCH_ON + #if GLITCH_ON + half2 uvGlitch = uvRect; + uvGlitch.y -= 0.5; + half lineNoise = pow(rand2(floor(uvGlitch * half2(24., 19.) * _GlitchSize) * 4.0, randomSeed), 3.0) * _GlitchAmount + * pow(rand2(floor(uvGlitch * half2(38., 14.) * _GlitchSize) * 4.0, randomSeed), 3.0); + col = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(lineNoise * 0.02 * rand2(half2(2.0, 1), randomSeed), 0)) * d.vertexColor; + #endif + //-------------------------------------- + + //CHROMABERR_ON + #if CHROMABERR_ON + half4 r = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(_ChromAberrAmount/10, 0)) * d.vertexColor; + half4 b = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(-_ChromAberrAmount/10, 0)) * d.vertexColor; + col = half4(r.r * r.a, col.g, b.b * b.a, max(max(r.a, b.a) * _ChromAberrAlpha, col.a)); + #endif + + //-------------------------------- + + //BLUR_ON + #if BLUR_ON + #if ATLAS_ON + #if !BLURISHD_ON + col = BlurHD(d.texcoord0.xy, _MainTex, sampler_MainTex, _BlurIntensity, (_MaxXUV - _MinXUV), (_MaxYUV - _MinYUV)) * d.vertexColor; + #else + col = Blur(d.texcoord0.xy, _MainTex, sampler_MainTex, _BlurIntensity * (_MaxXUV - _MinXUV)) * d.vertexColor; + #endif + #else + #if !BLURISHD_ON + col = BlurHD(d.texcoord0.xy, _MainTex, sampler_MainTex, _BlurIntensity, 1, 1) * d.vertexColor; + #else + col = Blur(d.texcoord0.xy, _MainTex, sampler_MainTex, _BlurIntensity) * d.vertexColor; + #endif + #endif + #endif + + //-------------------- + + //MOTIONBLUR_ON + #if MOTIONBLUR_ON + _MotionBlurAngle = _MotionBlurAngle * 3.1415926; + #define rot(n) mul(n, half2x2(cos(_MotionBlurAngle), -sin(_MotionBlurAngle), sin(_MotionBlurAngle), cos(_MotionBlurAngle))) + _MotionBlurDist = _MotionBlurDist * 0.005; + #if ATLAS_ON + _MotionBlurDist *= (_MaxXUV - _MinXUV); + #endif + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(-_MotionBlurDist, -_MotionBlurDist))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(-_MotionBlurDist * 2, -_MotionBlurDist * 2))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(-_MotionBlurDist * 3, -_MotionBlurDist * 3))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(-_MotionBlurDist * 4, -_MotionBlurDist * 4))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(_MotionBlurDist, _MotionBlurDist))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(_MotionBlurDist * 2, _MotionBlurDist * 2))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(_MotionBlurDist * 3, _MotionBlurDist * 3))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(_MotionBlurDist * 4, _MotionBlurDist * 4))); + col.rgb = col.rgb / 9; + #endif + //------------------------------------ + + //NEGATIVE_ON + #if NEGATIVE_ON + col.rgb = lerp(col.rgb, 1 - col.rgb, _NegativeAmount); + #endif + + //-------------- + half luminance = 0; + + //GREYSCALE_ON && !GREYSCALEOUTLINE_ON + #if GREYSCALE_ON && !GREYSCALEOUTLINE_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + luminance = saturate(luminance + _GreyscaleLuminosity); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _GreyscaleTintColor, _GreyscaleBlend); + #endif + //------------------------------------ + + //GHOST_ON + #if GHOST_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + half4 ghostResult; + ghostResult.a = saturate(luminance - _GhostTransparency) * col.a; + ghostResult.rgb = col.rgb * (luminance + _GhostColorBoost); + col = lerp(col, ghostResult, _GhostBlend); + #endif + //------------------------------------ + + //INNEROUTLINE_ON + #if INNEROUTLINE_ON + half3 innerT = abs(GetPixel(0, _InnerOutlineThickness, d.texcoord0.xy, _MainTex, sampler_MainTex) - GetPixel(0, -_InnerOutlineThickness, d.texcoord0.xy, _MainTex, sampler_MainTex)); + innerT += abs(GetPixel(_InnerOutlineThickness, 0, d.texcoord0.xy, _MainTex, sampler_MainTex) - GetPixel(-_InnerOutlineThickness, 0, d.texcoord0.xy, _MainTex, sampler_MainTex)); + #if !ONLYINNEROUTLINE_ON + innerT = (innerT / 2.0) * col.a * _InnerOutlineAlpha; + col.rgb += length(innerT) * _InnerOutlineColor.rgb * _InnerOutlineGlow; + #else + innerT *= col.a * _InnerOutlineAlpha; + col.rgb = length(innerT) * _InnerOutlineColor.rgb * _InnerOutlineGlow; + col.a = step(0.3, col.r+col.g+col.b); + #endif + #endif + //------------------------------------------------------- + + //HITEFFECT_ON + #if HITEFFECT_ON + col.rgb = lerp(col.rgb, _HitEffectColor.rgb * _HitEffectGlow, _HitEffectBlend); + #endif + //-------------------- + + //GRADIENT_ON + #if GRADIENT_ON + half2 tiledUvGrad = half2(uvRect.x / _MainTex_ST.x, uvRect.y / _MainTex_ST.y); + #if GRADIENT2COL_ON + _GradTopRightCol = _GradTopLeftCol; + _GradBotRightCol = _GradBotLeftCol; + #endif + #if RADIALGRADIENT_ON + half radialDist = 1 - length(tiledUvGrad - half2(0.5, 0.5)); + radialDist *= (_MainTex_TexelSize.w / _MainTex_TexelSize.z); + radialDist = saturate(_GradBoostX * radialDist); + half4 gradientResult = lerp(_GradTopLeftCol, _GradBotLeftCol, radialDist); + #else + half gradXLerpFactor = saturate(pow(tiledUvGrad.x, _GradBoostX)); + half4 gradientResult = lerp(lerp(_GradBotLeftCol, _GradBotRightCol, gradXLerpFactor), + lerp(_GradTopLeftCol, _GradTopRightCol, gradXLerpFactor), saturate(pow(tiledUvGrad.y, _GradBoostY))); + #endif + gradientResult = lerp(col, gradientResult, _GradBlend); + col.rgb = gradientResult.rgb * col.a; + col.a *= gradientResult.a; + #endif + //-------------------------------------------------------------------- + + //CONTRAST_ON + #if CONTRAST_ON + col.rgb = (col.rgb - float3(0.5, 0.5, 0.5)) * _Contrast + float3(0.5, 0.5, 0.5); + col.rgb += _Brightness; + #endif + + //------------------------------------------------------------------- + + //COLORSWAP_ON + #if COLORSWAP_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + half4 swapMask = SAMPLE_TEXTURE2D(_ColorSwapTex, sampler_ColorSwapTex, d.texcoord0.xy); + swapMask.rgb *= swapMask.a; + half3 redSwap = _ColorSwapRed * swapMask.r * saturate(luminance + _ColorSwapRedLuminosity); + half3 greenSwap = _ColorSwapGreen * swapMask.g * saturate(luminance + _ColorSwapGreenLuminosity); + half3 blueSwap = _ColorSwapBlue * swapMask.b * saturate(luminance + _ColorSwapBlueLuminosity); + swapMask.rgb = col.rgb * saturate(1 - swapMask.r - swapMask.g - swapMask.b); + col.rgb = lerp(col.rgb, swapMask.rgb + redSwap + greenSwap + blueSwap, _ColorSwapBlend); + #endif + //-------------------------------------------------------------------- + + //COLORRAMP_ON && !COLORRAMPOUTLINE_ON + #if COLORRAMP_ON && !COLORRAMPOUTLINE_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + luminance = saturate(luminance + _ColorRampLuminosity); + #if GRADIENTCOLORRAMP_ON + col.rgb = lerp(col.rgb, SAMPLE_TEXTURE2D(_ColorRampTexGradient, sampler_ColorRampTexGradient, half2(luminance, 0)).rgb, _ColorRampBlend); + #else + col.rgb = lerp(col.rgb, SAMPLE_TEXTURE2D(_ColorRampTex, sampler_ColorRampTex, half2(luminance, 0)).rgb, _ColorRampBlend); + #endif + #endif + //-------------------------------------------------------------------- + + //CHANGECOLOR_ON + #if CHANGECOLOR_ON + float3 currChangeColor = saturate(col.rgb); + luminance = 0.3 * currChangeColor.r + 0.59 * currChangeColor.g + 0.11 * currChangeColor.b; + luminance = saturate(luminance + _ColorChangeLuminosity); + half3 dif = abs(currChangeColor - _ColorChangeTarget.rgb); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _ColorChangeNewCol.rgb, + max(sign(1 - saturate(dif.x + dif.y + dif.z) - _ColorChangeTolerance), 0.0)); + #if CHANGECOLOR2_ON + dif = abs(currChangeColor - _ColorChangeTarget2.rgb); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _ColorChangeNewCol2.rgb, + max(sign(1 - saturate(dif.x + dif.y + dif.z) - _ColorChangeTolerance2), 0.0)); + #endif + #if CHANGECOLOR3_ON + dif = abs(currChangeColor - _ColorChangeTarget3.rgb); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _ColorChangeNewCol3.rgb, + max(sign(1 - saturate(dif.x + dif.y + dif.z) - _ColorChangeTolerance3), 0.0)); + #endif + #endif + //------------------------------------------------------- + + //POSTERIZE_ON && !POSTERIZEOUTLINE_ON + #if POSTERIZE_ON && !POSTERIZEOUTLINE_ON + col.rgb = pow(col.rgb, _PosterizeGamma) * _PosterizeNumColors; + col.rgb = floor(col.rgb) / _PosterizeNumColors; + col.rgb = pow(col.rgb, 1.0 / _PosterizeGamma); + #endif + //------------------------------------ + + //HSV_ON + #if HSV_ON + half3 resultHsv = half3(col.rgb); + half cosHsv = _HsvBright * _HsvSaturation * cos(_HsvShift * 3.14159265 / 180); + half sinHsv = _HsvBright * _HsvSaturation * sin(_HsvShift * 3.14159265 / 180); + resultHsv.x = (.299 * _HsvBright + .701 * cosHsv + .168 * sinHsv) * col.x + + (.587 * _HsvBright - .587 * cosHsv + .330 * sinHsv) * col.y + + (.114 * _HsvBright - .114 * cosHsv - .497 * sinHsv) * col.z; + resultHsv.y = (.299 * _HsvBright - .299 * cosHsv - .328 * sinHsv) *col.x + + (.587 * _HsvBright + .413 * cosHsv + .035 * sinHsv) * col.y + + (.114 * _HsvBright - .114 * cosHsv + .292 * sinHsv) * col.z; + resultHsv.z = (.299 * _HsvBright - .3 * cosHsv + 1.25 * sinHsv) * col.x + + (.587 * _HsvBright - .588 * cosHsv - 1.05 * sinHsv) * col.y + + (.114 * _HsvBright + .886 * cosHsv - .203 * sinHsv) * col.z; + col.rgb = resultHsv; + #endif + //------------------------------------------------------- + + //OVERLAY_ON + #if OVERLAY_ON + half2 overlayUvs = d.texcoord0.xy; + overlayUvs.x += ((_Time.y + randomSeed) * _OverlayTextureScrollXSpeed) % 1; + overlayUvs.y += ((_Time.y + randomSeed) * _OverlayTextureScrollYSpeed) % 1; + half4 overlayCol = SAMPLE_TEXTURE2D(_OverlayTex, sampler_OverlayTex, TRANSFORM_TEX(overlayUvs, _OverlayTex)); + overlayCol.rgb *= _OverlayColor.rgb * _OverlayGlow; + #if !OVERLAYMULT_ON + overlayCol.rgb *= overlayCol.a * _OverlayColor.rgb * _OverlayColor.a * _OverlayBlend; + col.rgb += overlayCol.rgb; + #else + overlayCol.a *= _OverlayColor.a; + col = lerp(col, col * overlayCol, _OverlayBlend); + #endif + #endif + + //--------------------------------- + + //OUTBASE_ON + #if OUTBASE_ON + #if OUTBASEPIXELPERF_ON + half2 destUv = half2(_OutlinePixelWidth * _MainTex_TexelSize.x, _OutlinePixelWidth * _MainTex_TexelSize.y); + #else + half2 destUv = half2(_OutlineWidth * _MainTex_TexelSize.x * 200, _OutlineWidth * _MainTex_TexelSize.y * 200); + #endif + + #if OUTDIST_ON + d.texcoord3.x += ((_Time.x + _RandomSeed) * _OutlineDistortTexXSpeed) % 1; + d.texcoord3.y += ((_Time.x + _RandomSeed) * _OutlineDistortTexYSpeed) % 1; + #if ATLAS_ON + d.texcoord3 = half2((d.texcoord3.x - _MinXUV) / (_MaxXUV - _MinXUV), (d.texcoord3.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half outDistortAmnt = (SAMPLE_TEXTURE2D(_OutlineDistortTex, sampler_OutlineDistortTex, d.texcoord3).r - 0.5) * 0.2 * _OutlineDistortAmount; + destUv.x += outDistortAmnt; + destUv.y += outDistortAmnt; + #endif + + half spriteLeft = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(destUv.x, 0)).a; + half spriteRight = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy - half2(destUv.x, 0)).a; + half spriteBottom = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(0, destUv.y)).a; + half spriteTop = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy - half2(0, destUv.y)).a; + half result = spriteLeft + spriteRight + spriteBottom + spriteTop; + + #if OUTBASE8DIR_ON + half spriteTopLeft = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(destUv.x, destUv.y)).a; + half spriteTopRight = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(-destUv.x, destUv.y)).a; + half spriteBotLeft = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(destUv.x, -destUv.y)).a; + half spriteBotRight = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(-destUv.x, -destUv.y)).a; + result = result + spriteTopLeft + spriteTopRight + spriteBotLeft + spriteBotRight; + #endif + + result = step(0.05, saturate(result)); + + #if OUTTEX_ON + d.texcoord1.x += ((_Time.x + _RandomSeed) * _OutlineTexXSpeed) % 1; + d.texcoord1.y += ((_Time.x + _RandomSeed) * _OutlineTexYSpeed) % 1; + #if ATLAS_ON + d.texcoord1 = half2((d.texcoord1.x - _MinXUV) / (_MaxXUV - _MinXUV), (d.texcoord1.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half4 tempOutColor = SAMPLE_TEXTURE2D(_OutlineTex, sampler_OutlineTex, d.texcoord1); + tempOutColor *= _OutlineColor; + _OutlineColor = tempOutColor; + #endif + + result *= (1 - originalAlpha) * _OutlineAlpha; + + half4 outline = _OutlineColor * d.vertexColor.a; + outline.rgb *= _OutlineGlow; + outline.a = result; + #if ONLYOUTLINE_ON + col = outline; + #else + col = lerp(col, outline, result); + #endif + #endif + //------------------------------------------------------- + + //FADE_ON + #if FADE_ON + half2 tiledUvFade1 = TRANSFORM_TEX(d.texcoord0, _FadeTex); + half2 tiledUvFade2 = TRANSFORM_TEX(d.texcoord0, _FadeBurnTex); + #if ATLAS_ON + tiledUvFade1 = half2((tiledUvFade1.x - _MinXUV) / (_MaxXUV - _MinXUV), (tiledUvFade1.y - _MinYUV) / (_MaxYUV - _MinYUV)); + tiledUvFade2 = half2((tiledUvFade2.x - _MinXUV) / (_MaxXUV - _MinXUV), (tiledUvFade2.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half fadeTemp = SAMPLE_TEXTURE2D(_FadeTex, sampler_FadeTex, tiledUvFade1).r; + half fade = smoothstep(_FadeAmount, _FadeAmount + _FadeBurnTransition, fadeTemp); + half fadeBurn = saturate(smoothstep(_FadeAmount - _FadeBurnWidth, _FadeAmount - _FadeBurnWidth + 0.1, fadeTemp) * _FadeAmount); + col.a *= fade; + _FadeBurnColor.rgb *= _FadeBurnGlow; + col += fadeBurn * SAMPLE_TEXTURE2D(_FadeBurnTex, sampler_FadeBurnTex, tiledUvFade2) * _FadeBurnColor * originalAlpha * (1 - col.a); + #endif + //------------------------------------------------------- + + //SHADOW_ON + #if SHADOW_ON + half shadowA = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(_ShadowX, _ShadowY)).a; + half preMultShadowMask = 1 - (saturate(shadowA - col.a) * (1 - col.a)); + col.rgb *= 1 - ((shadowA - col.a) * (1 - col.a)); + col.rgb += (_ShadowColor * shadowA) * (1 - col.a); + col.a = max(shadowA * _ShadowAlpha * d.vertexColor.a, col.a); + #endif + + //------------------------------------------------------- + + //GLOW_ON + #if GLOW_ON + half4 emission; + #if GLOWTEX_ON + emission = SAMPLE_TEXTURE2D(_GlowTex, sampler_GlowTex, d.texcoord0); + #else + emission = col; + #endif + + col.rgb *= _GlowGlobal; + emission.rgb *= emission.a * col.a * _Glow * _GlowColor; + col.rgb += emission.rgb; + #endif + //------------------------------------------------------- + + //COLORRAMP_ON && COLORRAMPOUTLINE_ON + #if COLORRAMP_ON && COLORRAMPOUTLINE_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + luminance = saturate(luminance + _ColorRampLuminosity); + #if GRADIENTCOLORRAMP_ON + col.rgb = lerp(col.rgb, SAMPLE_TEXTURE2D(_ColorRampTexGradient, sampler_ColorRampTexGradient, half2(luminance, 0)).rgb, _ColorRampBlend); + #else + col.rgb = lerp(col.rgb, SAMPLE_TEXTURE2D(_ColorRampTex, sampler_ColorRampTex, half2(luminance, 0)).rgb, _ColorRampBlend); + #endif + #endif + //--------------- + + //GREYSCALE_ON && GREYSCALEOUTLINE_ON + #if GREYSCALE_ON && GREYSCALEOUTLINE_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + luminance = saturate(luminance + _GreyscaleLuminosity); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _GreyscaleTintColor, _GreyscaleBlend); + #endif + + //----------------------------------- + + //POSTERIZE_ON && POSTERIZEOUTLINE_ON + #if POSTERIZE_ON && POSTERIZEOUTLINE_ON + col.rgb = pow(col.rgb, _PosterizeGamma) * _PosterizeNumColors; + col.rgb = floor(col.rgb) / _PosterizeNumColors; + col.rgb = pow(col.rgb, 1.0 / _PosterizeGamma); + #endif + + //----------------------------------- + + //SHINE_ON + #if SHINE_ON + half2 uvShine = uvRect; + half cosAngle = cos(_ShineRotate); + half sinAngle = sin(_ShineRotate); + half2x2 rot = half2x2(cosAngle, -sinAngle, sinAngle, cosAngle); + uvShine -= half2(0.5, 0.5); + uvShine = mul(rot, uvShine); + uvShine += half2(0.5, 0.5); + half shineMask = SAMPLE_TEXTURE2D(_ShineMask, sampler_ShineMask, d.texcoord0.xy).a; + half currentDistanceProjection = (uvShine.x + uvShine.y) / 2; + half whitePower = 1 - (abs(currentDistanceProjection - _ShineLocation) / _ShineWidth); + col.rgb += col.a * whitePower * _ShineGlow * max(sign(currentDistanceProjection - (_ShineLocation - _ShineWidth)), 0.0) + * max(sign((_ShineLocation + _ShineWidth) - currentDistanceProjection), 0.0) * _ShineColor * shineMask; + #endif + + //----------------------------------- + + //HOLOGRAM_ON + #if HOLOGRAM_ON + half totalHologram = _HologramStripesAmount + _HologramUnmodAmount; + half hologramYCoord = ((uvRect.y + (((_Time.x + randomSeed) % 1) * _HologramStripesSpeed)) % totalHologram) / totalHologram; + hologramYCoord = abs(hologramYCoord); + half alpha = RemapFloat(saturate(hologramYCoord - (_HologramUnmodAmount/totalHologram)), 0.0, 1.0, _HologramMinAlpha, saturate(_HologramMaxAlpha)); + half hologramMask = max(sign((_HologramUnmodAmount/totalHologram) - hologramYCoord), 0.0); + half4 hologramResult = col; + hologramResult.a *= lerp(alpha, 1, hologramMask); + hologramResult.rgb *= max(1, _HologramMaxAlpha * max(sign(hologramYCoord - (_HologramUnmodAmount/totalHologram)), 0.0)); + hologramMask = 1 - step(0.01,hologramMask); + hologramResult.rgb += hologramMask * _HologramStripeColor * col.a; + col = lerp(col, hologramResult, _HologramBlend); + #endif + + //----------------------------------- + + //FLICKER_ON + #if FLICKER_ON + col.a *= saturate(col.a * step(frac(0.05 + (_Time.w + randomSeed) * _FlickerFreq), 1 - _FlickerPercent) + _FlickerAlpha); + #endif + //----------------------------------- + + //ALPHACUTOFF_ON + + //ALPHAROUND_ON + + //ALPHAOUTLINE_ON + #if ALPHAOUTLINE_ON + half alphaOutlineRes = pow(1 - col.a, max(_AlphaOutlinePower, 0.0001)) * step(_AlphaOutlineMinAlpha, col.a) * _AlphaOutlineBlend; + col.rgb = lerp(col.rgb, _AlphaOutlineColor.rgb * _AlphaOutlineGlow, alphaOutlineRes); + col.a = lerp(col.a, 1, alphaOutlineRes > 1); + #endif + //------------------------------------------------------- + + //FOG_ON + + //------------------ + + col *= _Color; + o.Albedo = col; + col.a *= _Alpha; + clip(col.a - _AlphaCutoffValue - 0.01); + o.Alpha = _Color.a; + } + + + + + + void ChainSurfaceFunction(inout Surface l, inout ShaderData d) + { + Ext_SurfaceFunction0(l, d); + // Ext_SurfaceFunction1(l, d); + // Ext_SurfaceFunction2(l, d); + // Ext_SurfaceFunction3(l, d); + // Ext_SurfaceFunction4(l, d); + // Ext_SurfaceFunction5(l, d); + // Ext_SurfaceFunction6(l, d); + // Ext_SurfaceFunction7(l, d); + // Ext_SurfaceFunction8(l, d); + // Ext_SurfaceFunction9(l, d); + // Ext_SurfaceFunction10(l, d); + // Ext_SurfaceFunction11(l, d); + // Ext_SurfaceFunction12(l, d); + // Ext_SurfaceFunction13(l, d); + // Ext_SurfaceFunction14(l, d); + // Ext_SurfaceFunction15(l, d); + // Ext_SurfaceFunction16(l, d); + // Ext_SurfaceFunction17(l, d); + // Ext_SurfaceFunction18(l, d); + // Ext_SurfaceFunction19(l, d); + // Ext_SurfaceFunction20(l, d); + // Ext_SurfaceFunction21(l, d); + // Ext_SurfaceFunction22(l, d); + // Ext_SurfaceFunction23(l, d); + // Ext_SurfaceFunction24(l, d); + // Ext_SurfaceFunction25(l, d); + // Ext_SurfaceFunction26(l, d); + // Ext_SurfaceFunction27(l, d); + // Ext_SurfaceFunction28(l, d); + // Ext_SurfaceFunction29(l, d); + } + +#if !_DECALSHADER + + void ChainModifyVertex(inout VertexData v, inout VertexToPixel v2p, float4 time) + { + ExtraV2F d; + + ZERO_INITIALIZE(ExtraV2F, d); + ZERO_INITIALIZE(Blackboard, d.blackboard); + // due to motion vectors in HDRP, we need to use the last + // time in certain spots. So if you are going to use _Time to adjust vertices, + // you need to use this time or motion vectors will break. + d.time = time; + + Ext_ModifyVertex0(v, d); + // Ext_ModifyVertex1(v, d); + // Ext_ModifyVertex2(v, d); + // Ext_ModifyVertex3(v, d); + // Ext_ModifyVertex4(v, d); + // Ext_ModifyVertex5(v, d); + // Ext_ModifyVertex6(v, d); + // Ext_ModifyVertex7(v, d); + // Ext_ModifyVertex8(v, d); + // Ext_ModifyVertex9(v, d); + // Ext_ModifyVertex10(v, d); + // Ext_ModifyVertex11(v, d); + // Ext_ModifyVertex12(v, d); + // Ext_ModifyVertex13(v, d); + // Ext_ModifyVertex14(v, d); + // Ext_ModifyVertex15(v, d); + // Ext_ModifyVertex16(v, d); + // Ext_ModifyVertex17(v, d); + // Ext_ModifyVertex18(v, d); + // Ext_ModifyVertex19(v, d); + // Ext_ModifyVertex20(v, d); + // Ext_ModifyVertex21(v, d); + // Ext_ModifyVertex22(v, d); + // Ext_ModifyVertex23(v, d); + // Ext_ModifyVertex24(v, d); + // Ext_ModifyVertex25(v, d); + // Ext_ModifyVertex26(v, d); + // Ext_ModifyVertex27(v, d); + // Ext_ModifyVertex28(v, d); + // Ext_ModifyVertex29(v, d); + + + // #if %EXTRAV2F0REQUIREKEY% + // v2p.extraV2F0 = d.extraV2F0; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // v2p.extraV2F1 = d.extraV2F1; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // v2p.extraV2F2 = d.extraV2F2; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // v2p.extraV2F3 = d.extraV2F3; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // v2p.extraV2F4 = d.extraV2F4; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // v2p.extraV2F5 = d.extraV2F5; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // v2p.extraV2F6 = d.extraV2F6; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // v2p.extraV2F7 = d.extraV2F7; + // #endif + } + + void ChainModifyTessellatedVertex(inout VertexData v, inout VertexToPixel v2p) + { + ExtraV2F d; + ZERO_INITIALIZE(ExtraV2F, d); + ZERO_INITIALIZE(Blackboard, d.blackboard); + + // #if %EXTRAV2F0REQUIREKEY% + // d.extraV2F0 = v2p.extraV2F0; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // d.extraV2F1 = v2p.extraV2F1; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // d.extraV2F2 = v2p.extraV2F2; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // d.extraV2F3 = v2p.extraV2F3; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // d.extraV2F4 = v2p.extraV2F4; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // d.extraV2F5 = v2p.extraV2F5; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // d.extraV2F6 = v2p.extraV2F6; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // d.extraV2F7 = v2p.extraV2F7; + // #endif + + + // Ext_ModifyTessellatedVertex0(v, d); + // Ext_ModifyTessellatedVertex1(v, d); + // Ext_ModifyTessellatedVertex2(v, d); + // Ext_ModifyTessellatedVertex3(v, d); + // Ext_ModifyTessellatedVertex4(v, d); + // Ext_ModifyTessellatedVertex5(v, d); + // Ext_ModifyTessellatedVertex6(v, d); + // Ext_ModifyTessellatedVertex7(v, d); + // Ext_ModifyTessellatedVertex8(v, d); + // Ext_ModifyTessellatedVertex9(v, d); + // Ext_ModifyTessellatedVertex10(v, d); + // Ext_ModifyTessellatedVertex11(v, d); + // Ext_ModifyTessellatedVertex12(v, d); + // Ext_ModifyTessellatedVertex13(v, d); + // Ext_ModifyTessellatedVertex14(v, d); + // Ext_ModifyTessellatedVertex15(v, d); + // Ext_ModifyTessellatedVertex16(v, d); + // Ext_ModifyTessellatedVertex17(v, d); + // Ext_ModifyTessellatedVertex18(v, d); + // Ext_ModifyTessellatedVertex19(v, d); + // Ext_ModifyTessellatedVertex20(v, d); + // Ext_ModifyTessellatedVertex21(v, d); + // Ext_ModifyTessellatedVertex22(v, d); + // Ext_ModifyTessellatedVertex23(v, d); + // Ext_ModifyTessellatedVertex24(v, d); + // Ext_ModifyTessellatedVertex25(v, d); + // Ext_ModifyTessellatedVertex26(v, d); + // Ext_ModifyTessellatedVertex27(v, d); + // Ext_ModifyTessellatedVertex28(v, d); + // Ext_ModifyTessellatedVertex29(v, d); + + // #if %EXTRAV2F0REQUIREKEY% + // v2p.extraV2F0 = d.extraV2F0; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // v2p.extraV2F1 = d.extraV2F1; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // v2p.extraV2F2 = d.extraV2F2; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // v2p.extraV2F3 = d.extraV2F3; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // v2p.extraV2F4 = d.extraV2F4; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // v2p.extraV2F5 = d.extraV2F5; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // v2p.extraV2F6 = d.extraV2F6; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // v2p.extraV2F7 = d.extraV2F7; + // #endif + } + + void ChainFinalColorForward(inout Surface l, inout ShaderData d, inout half4 color) + { + // Ext_FinalColorForward0(l, d, color); + // Ext_FinalColorForward1(l, d, color); + // Ext_FinalColorForward2(l, d, color); + // Ext_FinalColorForward3(l, d, color); + // Ext_FinalColorForward4(l, d, color); + // Ext_FinalColorForward5(l, d, color); + // Ext_FinalColorForward6(l, d, color); + // Ext_FinalColorForward7(l, d, color); + // Ext_FinalColorForward8(l, d, color); + // Ext_FinalColorForward9(l, d, color); + // Ext_FinalColorForward10(l, d, color); + // Ext_FinalColorForward11(l, d, color); + // Ext_FinalColorForward12(l, d, color); + // Ext_FinalColorForward13(l, d, color); + // Ext_FinalColorForward14(l, d, color); + // Ext_FinalColorForward15(l, d, color); + // Ext_FinalColorForward16(l, d, color); + // Ext_FinalColorForward17(l, d, color); + // Ext_FinalColorForward18(l, d, color); + // Ext_FinalColorForward19(l, d, color); + // Ext_FinalColorForward20(l, d, color); + // Ext_FinalColorForward21(l, d, color); + // Ext_FinalColorForward22(l, d, color); + // Ext_FinalColorForward23(l, d, color); + // Ext_FinalColorForward24(l, d, color); + // Ext_FinalColorForward25(l, d, color); + // Ext_FinalColorForward26(l, d, color); + // Ext_FinalColorForward27(l, d, color); + // Ext_FinalColorForward28(l, d, color); + // Ext_FinalColorForward29(l, d, color); + } + + void ChainFinalGBufferStandard(inout Surface s, inout ShaderData d, inout half4 GBuffer0, inout half4 GBuffer1, inout half4 GBuffer2, inout half4 outEmission, inout half4 outShadowMask) + { + // Ext_FinalGBufferStandard0(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard1(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard2(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard3(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard4(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard5(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard6(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard7(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard8(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard9(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard10(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard11(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard12(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard13(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard14(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard15(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard16(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard17(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard18(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard19(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard20(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard21(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard22(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard23(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard24(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard25(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard26(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard27(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard28(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard29(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + } +#endif + + + + + +#if _DECALSHADER + + ShaderData CreateShaderData(SurfaceDescriptionInputs IN) + { + ShaderData d = (ShaderData)0; + d.TBNMatrix = float3x3(IN.WorldSpaceTangent, IN.WorldSpaceBiTangent, IN.WorldSpaceNormal); + d.worldSpaceNormal = IN.WorldSpaceNormal; + d.worldSpaceTangent = IN.WorldSpaceTangent; + + d.worldSpacePosition = IN.WorldSpacePosition; + d.texcoord0 = IN.uv0.xyxy; + d.screenPos = IN.ScreenPosition; + + d.worldSpaceViewDir = normalize(_WorldSpaceCameraPos - d.worldSpacePosition); + + d.tangentSpaceViewDir = mul(d.TBNMatrix, d.worldSpaceViewDir); + + // these rarely get used, so we back transform them. Usually will be stripped. + #if _HDRP + // d.localSpacePosition = mul(GetWorldToObjectMatrix(), float4(GetCameraRelativePositionWS(d.worldSpacePosition), 1)).xyz; + #else + // d.localSpacePosition = mul(GetWorldToObjectMatrix(), float4(d.worldSpacePosition, 1)).xyz; + #endif + // d.localSpaceNormal = normalize(mul((float3x3)GetWorldToObjectMatrix(), d.worldSpaceNormal)); + // d.localSpaceTangent = normalize(mul((float3x3)GetWorldToObjectMatrix(), d.worldSpaceTangent.xyz)); + + // #if %SCREENPOSREQUIREKEY% + // d.screenUV = (IN.ScreenPosition.xy / max(0.01, IN.ScreenPosition.w)); + // #endif + + return d; + } +#else + + ShaderData CreateShaderData(VertexToPixel i + #if NEED_FACING + , bool facing + #endif + ) + { + ShaderData d = (ShaderData)0; + d.clipPos = i.pos; + d.worldSpacePosition = i.worldPos; + + d.worldSpaceNormal = normalize(i.worldNormal); + d.worldSpaceTangent.xyz = normalize(i.worldTangent.xyz); + + d.tangentSign = i.worldTangent.w * unity_WorldTransformParams.w; + float3 bitangent = cross(d.worldSpaceTangent.xyz, d.worldSpaceNormal) * d.tangentSign; + + d.TBNMatrix = float3x3(d.worldSpaceTangent, -bitangent, d.worldSpaceNormal); + d.worldSpaceViewDir = normalize(_WorldSpaceCameraPos - i.worldPos); + + d.tangentSpaceViewDir = mul(d.TBNMatrix, d.worldSpaceViewDir); + d.texcoord0 = i.texcoord0; + d.texcoord1 = i.texcoord1; + d.texcoord2 = i.texcoord2; + + // #if %TEXCOORD3REQUIREKEY% + d.texcoord3 = i.texcoord3; + // #endif + + // d.isFrontFace = facing; + // #if %VERTEXCOLORREQUIREKEY% + d.vertexColor = i.vertexColor; + // #endif + + // these rarely get used, so we back transform them. Usually will be stripped. + #if _HDRP + // d.localSpacePosition = mul(GetWorldToObjectMatrix(), float4(GetCameraRelativePositionWS(i.worldPos), 1)).xyz; + #else + // d.localSpacePosition = mul(GetWorldToObjectMatrix(), float4(i.worldPos, 1)).xyz; + #endif + // d.localSpaceNormal = normalize(mul((float3x3)GetWorldToObjectMatrix(), i.worldNormal)); + // d.localSpaceTangent = normalize(mul((float3x3)GetWorldToObjectMatrix(), i.worldTangent.xyz)); + + // #if %SCREENPOSREQUIREKEY% + // d.screenPos = i.screenPos; + // d.screenUV = (i.screenPos.xy / i.screenPos.w); + // #endif + + + // #if %EXTRAV2F0REQUIREKEY% + // d.extraV2F0 = i.extraV2F0; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // d.extraV2F1 = i.extraV2F1; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // d.extraV2F2 = i.extraV2F2; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // d.extraV2F3 = i.extraV2F3; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // d.extraV2F4 = i.extraV2F4; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // d.extraV2F5 = i.extraV2F5; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // d.extraV2F6 = i.extraV2F6; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // d.extraV2F7 = i.extraV2F7; + // #endif + + return d; + } + +#endif + + + +#if (SHADERPASS == SHADERPASS_LIGHT_TRANSPORT) + + // This was not in constant buffer in original unity, so keep outiside. But should be in as ShaderRenderPass frequency + float unity_OneOverOutputBoost; + float unity_MaxOutputValue; + + CBUFFER_START(UnityMetaPass) + // x = use uv1 as raster position + // y = use uv2 as raster position + bool4 unity_MetaVertexControl; + + // x = return albedo + // y = return normal + bool4 unity_MetaFragmentControl; + CBUFFER_END + + VertexToPixel Vert(VertexData inputMesh) + { + VertexToPixel output; + ZERO_INITIALIZE(VertexToPixel, output); + UNITY_SETUP_INSTANCE_ID(inputMesh); + UNITY_TRANSFER_INSTANCE_ID(inputMesh, output); + UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(output); + + // Output UV coordinate in vertex shader + float2 uv = float2(0.0, 0.0); + + if (unity_MetaVertexControl.x) + { + uv = inputMesh.texcoord1.xy * unity_LightmapST.xy + unity_LightmapST.zw; + } + else if (unity_MetaVertexControl.y) + { + uv = inputMesh.texcoord2.xy * unity_DynamicLightmapST.xy + unity_DynamicLightmapST.zw; + } + + // OpenGL right now needs to actually use the incoming vertex position + // so we create a fake dependency on it here that haven't any impact. + output.pos = float4(uv * 2.0 - 1.0, inputMesh.vertex.z > 0 ? 1.0e-4 : 0.0, 1.0); + + output.worldPos = TransformObjectToWorld(inputMesh.vertex); + + // Normal is required for triplanar mapping + output.worldNormal = TransformObjectToWorldNormal(inputMesh.normal); + // Not required but assign to silent compiler warning + output.worldTangent = float4(1.0, 0.0, 0.0, 0.0); + + output.texcoord0 = inputMesh.texcoord0; + output.texcoord1 = inputMesh.texcoord1; + output.texcoord2 = inputMesh.texcoord2; + // #if %TEXCOORD3REQUIREKEY% + output.texcoord3 = inputMesh.texcoord3; + // #endif + // #if %VERTEXCOLORREQUIREKEY% + output.vertexColor = inputMesh.vertexColor; + // #endif + + return output; + } +#else + + #if (_PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR))) + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/ShaderVariablesMatrixDefsHDCamera.hlsl" + + void MotionVectorPositionZBias(VertexToPixel input) + { + #if UNITY_REVERSED_Z + input.pos.z -= unity_MotionVectorsParams.z * input.pos.w; + #else + input.pos.z += unity_MotionVectorsParams.z * input.pos.w; + #endif + } + + #endif + + VertexToPixel Vert(VertexData input) + { + VertexToPixel output; + ZERO_INITIALIZE(VertexToPixel, output); + + UNITY_SETUP_INSTANCE_ID(input); + UNITY_TRANSFER_INSTANCE_ID(input, output); + UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(output); + + // copy before user modification, since we'll apply that to the copy later + #if _HDRP && (_PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR))) + VertexData previousMesh = input; + #endif + + ChainModifyVertex(input, output, _Time); + + // This return the camera relative position (if enable) + float3 positionRWS = TransformObjectToWorld(input.vertex.xyz); + float3 normalWS = TransformObjectToWorldNormal(input.normal); + float4 tangentWS = float4(TransformObjectToWorldDir(input.tangent.xyz), input.tangent.w); + + + output.worldPos = GetAbsolutePositionWS(positionRWS); + output.pos = TransformWorldToHClip(positionRWS); + output.worldNormal = normalWS; + output.worldTangent = tangentWS; + + + output.texcoord0 = input.texcoord0; + output.texcoord1 = input.texcoord1; + output.texcoord2 = input.texcoord2; + + // #if %TEXCOORD3REQUIREKEY% + output.texcoord3 = input.texcoord3; + // #endif + + // #if %VERTEXCOLORREQUIREKEY% + output.vertexColor = input.vertexColor; + // #endif + + // #if %SCREENPOSREQUIREKEY% + // output.screenPos = ComputeScreenPos(output.pos, _ProjectionParams.x); + // #endif + + #if _HDRP && (_PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR))) + + #if !defined(TESSELLATION_ON) + MotionVectorPositionZBias(output); + #endif + + output.motionVectorCS = mul(UNITY_MATRIX_UNJITTERED_VP, float4(positionRWS, 1.0)); + // Note: unity_MotionVectorsParams.y is 0 is forceNoMotion is enabled + bool forceNoMotion = unity_MotionVectorsParams.y == 0.0; + if (forceNoMotion) + { + output.previousPositionCS = float4(0.0, 0.0, 0.0, 1.0); + } + else + { + bool hasDeformation = unity_MotionVectorsParams.x > 0.0; // Skin or morph target + + float3 effectivePositionOS = (hasDeformation ? previousMesh.previousPositionOS : previousMesh.vertex.xyz); + #if defined(_ADD_PRECOMPUTED_VELOCITY) + effectivePositionOS -= input.precomputedVelocity; + #endif + + + + previousMesh.vertex = float4(effectivePositionOS, 1); + VertexToPixel dummy = (VertexToPixel)0; + + ChainModifyVertex(previousMesh, dummy, _LastTimeParameters); + + float3 previousPositionRWS = TransformPreviousObjectToWorld(previousMesh.vertex.xyz); + // we might need this for skinned objects? + //float3 normalWS = TransformPreviousObjectToWorldNormal(input.normal).xyz; + + #ifdef _WRITE_TRANSPARENT_MOTION_VECTOR + if (_TransparentCameraOnlyMotionVectors > 0) + { + previousPositionRWS = positionRWS.xyz; + } + #endif // _WRITE_TRANSPARENT_MOTION_VECTOR + + output.previousPositionCS = mul(UNITY_MATRIX_PREV_VP, float4(previousPositionRWS, 1.0)); + } + #endif // _HDRP && _PASSMOTIONVECTOR || (_PASSFORWARD && defined(_WRITE_TRANSPARENT_MOTION_VECTOR)) + + + return output; + } + + +#endif + + + + + + + + #if defined(WRITE_DECAL_BUFFER) && !defined(_DISABLE_DECALS) + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/Decal/DecalPrepassBuffer.hlsl" + #endif + + FragInputs BuildFragInputs(VertexToPixel input) + { + UNITY_SETUP_INSTANCE_ID(input); + FragInputs output; + ZERO_INITIALIZE(FragInputs, output); + + // Init to some default value to make the computer quiet (else it output 'divide by zero' warning even if value is not used). + // TODO: this is a really poor workaround, but the variable is used in a bunch of places + // to compute normals which are then passed on elsewhere to compute other values... + output.tangentToWorld = k_identity3x3; + output.positionSS = input.pos; // input.positionCS is SV_Position + // BETTER SHADERS: because we transform world position into actual world space for things like + // triplanar, etc, we have to back transform it here for lighting + output.positionRWS = GetCameraRelativePositionWS(input.worldPos); + output.tangentToWorld = BuildTangentToWorld(input.worldTangent, input.worldNormal); + output.texCoord0 = input.texcoord0; + output.texCoord1 = input.texcoord1; + output.texCoord2 = input.texcoord2; + + return output; + } + + void BuildSurfaceData(FragInputs fragInputs, inout Surface surfaceDescription, float3 V, PositionInputs posInput, out SurfaceData surfaceData, out float3 bentNormalWS) + { + // setup defaults -- these are used if the graph doesn't output a value + ZERO_INITIALIZE(SurfaceData, surfaceData); + + // specularOcclusion need to be init ahead of decal to quiet the compiler that modify the SurfaceData struct + // however specularOcclusion can come from the graph, so need to be init here so it can be override. + surfaceData.specularOcclusion = 1.0; + + // copy across graph values, if defined + surfaceData.baseColor = surfaceDescription.Albedo; + surfaceData.perceptualSmoothness = surfaceDescription.Smoothness; + surfaceData.ambientOcclusion = surfaceDescription.Occlusion; + surfaceData.specularOcclusion = surfaceDescription.SpecularOcclusion; + surfaceData.metallic = surfaceDescription.Metallic; + surfaceData.subsurfaceMask = surfaceDescription.SubsurfaceMask; + surfaceData.thickness = surfaceDescription.Thickness; + surfaceData.diffusionProfileHash = asuint(surfaceDescription.DiffusionProfileHash); + #if _USESPECULAR + surfaceData.specularColor = surfaceDescription.Specular; + #endif + surfaceData.coatMask = surfaceDescription.CoatMask; + surfaceData.anisotropy = surfaceDescription.Anisotropy; + surfaceData.iridescenceMask = surfaceDescription.IridescenceMask; + surfaceData.iridescenceThickness = surfaceDescription.IridescenceThickness; + + + + #if defined(_REFRACTION_PLANE) || defined(_REFRACTION_SPHERE) || defined(_REFRACTION_THIN) + if (_EnableSSRefraction) + { + surfaceData.transmittanceMask = (1.0 - surfaceDescription.Alpha); + surfaceDescription.Alpha = 1.0; + } + else + { + surfaceData.ior = surfaceDescription.ior; + surfaceData.transmittanceColor = surfaceDescription.transmittanceColor; + surfaceData.atDistance = surfaceDescription.atDistance; + surfaceData.transmittanceMask = surfaceDescription.transmittanceMask; + surfaceDescription.Alpha = 1.0; + } + #else + surfaceData.ior = 1.0; + surfaceData.transmittanceColor = float3(1.0, 1.0, 1.0); + surfaceData.atDistance = 1.0; + surfaceData.transmittanceMask = 0.0; + #endif + + + #if defined(_ENABLE_SHADOW_MATTE) && SHADERPASS == SHADERPASS_FORWARD_UNLIT + HDShadowContext shadowContext = InitShadowContext(); + float shadow; + float3 shadow3; + // We need to recompute some coordinate not computed by default for shadow matte + posInput = GetPositionInput(fragInputs.positionSS.xy, _ScreenSize.zw, fragInputs.positionSS.z, UNITY_MATRIX_I_VP, GetWorldToViewMatrix()); + float3 upWS = normalize(fragInputs.tangentToWorld[1]); + uint renderingLayers = GetMeshRenderingLightLayer(); + ShadowLoopMin(shadowContext, posInput, upWS, asuint(_ShadowMatteFilter), renderingLayers, shadow3); + shadow = dot(shadow3, float3(1.0 / 3.0, 1.0 / 3.0, 1.0 / 3.0)); + + float4 shadowColor = (1.0 - shadow) * surfaceDescription.ShadowTint.rgba; + float localAlpha = saturate(shadowColor.a + surfaceDescription.Alpha); + + // Keep the nested lerp + // With no Color (bsdfData.color.rgb, bsdfData.color.a == 0.0f), just use ShadowColor*Color to avoid a ring of "white" around the shadow + // And mix color to consider the Color & ShadowColor alpha (from texture or/and color picker) + #ifdef _SURFACE_TYPE_TRANSPARENT + surfaceData.baseColor = lerp(shadowColor.rgb * surfaceData.baseColor, lerp(lerp(shadowColor.rgb, surfaceData.baseColor, 1.0 - surfaceDescription.ShadowTint.a), surfaceData.baseColor, shadow), surfaceDescription.Alpha); + #else + surfaceData.baseColor = lerp(lerp(shadowColor.rgb, surfaceData.baseColor, 1.0 - surfaceDescription.ShadowTint.a), surfaceData.baseColor, shadow); + #endif + localAlpha = ApplyBlendMode(surfaceData.baseColor, localAlpha).a; + + surfaceDescription.Alpha = localAlpha; + #endif + + // These static material feature allow compile time optimization + surfaceData.materialFeatures = MATERIALFEATUREFLAGS_LIT_STANDARD; + #ifdef _MATERIAL_FEATURE_SUBSURFACE_SCATTERING + surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_SUBSURFACE_SCATTERING; + #endif + + #ifdef _MATERIAL_FEATURE_TRANSMISSION + surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_TRANSMISSION; + #endif + + #ifdef _MATERIAL_FEATURE_ANISOTROPY + surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_ANISOTROPY; + #endif + + #ifdef _MATERIAL_FEATURE_IRIDESCENCE + surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_IRIDESCENCE; + #endif + + #ifdef _MATERIAL_FEATURE_SPECULAR_COLOR + surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_SPECULAR_COLOR; + #endif + + #if defined(_MATERIAL_FEATURE_CLEAR_COAT) || _CLEARCOAT + surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_CLEAR_COAT; + #endif + + #if defined (_MATERIAL_FEATURE_SPECULAR_COLOR) && defined (_ENERGY_CONSERVING_SPECULAR) + // Require to have setup baseColor + // Reproduce the energy conservation done in legacy Unity. Not ideal but better for compatibility and users can unchek it + surfaceData.baseColor *= (1.0 - Max3(surfaceData.specularColor.r, surfaceData.specularColor.g, surfaceData.specularColor.b)); + #endif + + + + // compute world space normal + #if !_WORLDSPACENORMAL + surfaceData.normalWS = mul(surfaceDescription.Normal, fragInputs.tangentToWorld); + #else + surfaceData.normalWS = surfaceDescription.Normal; + #endif + + surfaceData.geomNormalWS = fragInputs.tangentToWorld[2]; + + surfaceData.tangentWS = normalize(fragInputs.tangentToWorld[0].xyz); // The tangent is not normalize in tangentToWorld for mikkt. TODO: Check if it expected that we normalize with Morten. Tag: SURFACE_GRADIENT + + + #if HAVE_DECALS + if (_EnableDecals) + { + float alpha = 1.0; + alpha = surfaceDescription.Alpha; + + // Both uses and modifies 'surfaceData.normalWS'. + DecalSurfaceData decalSurfaceData = GetDecalSurfaceData(posInput, fragInputs.tangentToWorld[2], alpha); + ApplyDecalToSurfaceData(decalSurfaceData, fragInputs.tangentToWorld[2], surfaceData); + } + #endif + + bentNormalWS = surfaceData.normalWS; + + surfaceData.tangentWS = Orthonormalize(surfaceData.tangentWS, surfaceData.normalWS); + + #ifdef DEBUG_DISPLAY + if (_DebugMipMapMode != DEBUGMIPMAPMODE_NONE) + { + // TODO: need to update mip info + surfaceData.metallic = 0; + } + + // We need to call ApplyDebugToSurfaceData after filling the surfarcedata and before filling builtinData + // as it can modify attribute use for static lighting + ApplyDebugToSurfaceData(fragInputs.tangentToWorld, surfaceData); + #endif + + // By default we use the ambient occlusion with Tri-ace trick (apply outside) for specular occlusion. + // If user provide bent normal then we process a better term + #if defined(_SPECULAR_OCCLUSION_CUSTOM) + // Just use the value passed through via the slot (not active otherwise) + #elif defined(_SPECULAR_OCCLUSION_FROM_AO_BENT_NORMAL) + // If we have bent normal and ambient occlusion, process a specular occlusion + surfaceData.specularOcclusion = GetSpecularOcclusionFromBentAO(V, bentNormalWS, surfaceData.normalWS, surfaceData.ambientOcclusion, PerceptualSmoothnessToPerceptualRoughness(surfaceData.perceptualSmoothness)); + #elif defined(_AMBIENT_OCCLUSION) && defined(_SPECULAR_OCCLUSION_FROM_AO) + surfaceData.specularOcclusion = GetSpecularOcclusionFromAmbientOcclusion(ClampNdotV(dot(surfaceData.normalWS, V)), surfaceData.ambientOcclusion, PerceptualSmoothnessToRoughness(surfaceData.perceptualSmoothness)); + #endif + + #if defined(_ENABLE_GEOMETRIC_SPECULAR_AA) && !defined(SHADER_STAGE_RAY_TRACING) + surfaceData.perceptualSmoothness = GeometricNormalFiltering(surfaceData.perceptualSmoothness, fragInputs.tangentToWorld[2], surfaceDescription.SpecularAAScreenSpaceVariance, surfaceDescription.SpecularAAThreshold); + #endif + } + + void GetSurfaceAndBuiltinData(VertexToPixel m2ps, FragInputs fragInputs, float3 V, inout PositionInputs posInput, + out SurfaceData surfaceData, out BuiltinData builtinData, inout Surface l, inout ShaderData d + #if NEED_FACING + , bool facing + #endif + ) + { + // Removed since crossfade does not work, probably needs extra material setup. + //#if !defined(SHADER_STAGE_RAY_TRACING) && !defined(_TESSELLATION_DISPLACEMENT) + // #ifdef LOD_FADE_CROSSFADE // enable dithering LOD transition if user select CrossFade transition in LOD group + // LODDitheringTransition(ComputeFadeMaskSeed(V, posInput.positionSS), unity_LODFade.x); + // #endif + //#endif + + d = CreateShaderData(m2ps + #if NEED_FACING + , facing + #endif + ); + + l = (Surface)0; + + l.Albedo = half3(0.5, 0.5, 0.5); + l.Normal = float3(0,0,1); + l.Occlusion = 1; + l.Alpha = 1; + l.SpecularOcclusion = 1; + + #if !defined(SHADER_STAGE_RAY_TRACING) && defined(_DEPTHOFFSET_ON) + l.outputDepth = d.clipPos.z; + #endif + + ChainSurfaceFunction(l, d); + + #if !defined(SHADER_STAGE_RAY_TRACING) && defined(_DEPTHOFFSET_ON) + //posInput.deviceDepth = l.outputDepth; + #endif + + #if _UNLIT + //l.Emission = l.Albedo; + //l.Albedo = 0; + l.Normal = half3(0,0,1); + l.Occlusion = 1; + l.Metallic = 0; + l.Specular = 0; + #endif + + surfaceData.geomNormalWS = d.worldSpaceNormal; + surfaceData.tangentWS = d.worldSpaceTangent; + fragInputs.tangentToWorld = d.TBNMatrix; + + float3 bentNormalWS; + BuildSurfaceData(fragInputs, l, V, posInput, surfaceData, bentNormalWS); + + + InitBuiltinData(posInput, l.Alpha, bentNormalWS, -d.worldSpaceNormal, fragInputs.texCoord1, fragInputs.texCoord2, builtinData); + + + + builtinData.emissiveColor = l.Emission; + + #if defined(_OVERRIDE_BAKEDGI) + builtinData.bakeDiffuseLighting = l.DiffuseGI; + builtinData.backBakeDiffuseLighting = l.BackDiffuseGI; + builtinData.emissiveColor += l.SpecularGI; + #endif + + #if defined(_OVERRIDE_SHADOWMASK) + builtinData.shadowMask0 = l.ShadowMask.x; + builtinData.shadowMask1 = l.ShadowMask.y; + builtinData.shadowMask2 = l.ShadowMask.z; + builtinData.shadowMask3 = l.ShadowMask.w; + #endif + + #if defined(UNITY_VIRTUAL_TEXTURING) + builtinData.vtPackedFeedback = surfaceData.VTPackedFeedback; + #endif + + #if (SHADERPASS == SHADERPASS_DISTORTION) + //builtinData.distortion = surfaceData.Distortion; + //builtinData.distortionBlur = surfaceData.DistortionBlur; + #endif + + #ifndef SHADER_UNLIT + // PostInitBuiltinData call ApplyDebugToBuiltinData + PostInitBuiltinData(V, posInput, surfaceData, builtinData); + #else + ApplyDebugToBuiltinData(builtinData); + #endif + + RAY_TRACING_OPTIONAL_ALPHA_TEST_PASS + } + + + +#define DEBUG_DISPLAY +#include "Packages/com.unity.render-pipelines.high-definition/Runtime/Debug/DebugDisplay.hlsl" +#include "Packages/com.unity.render-pipelines.high-definition/Runtime/Debug/FullScreenDebug.hlsl" + + #if !defined(_DEPTHOFFSET_ON) + [earlydepthstencil] // quad overshading debug mode writes to UAV + #endif + void Frag(VertexToPixel v2f + #if NEED_FACING + , bool facing : SV_IsFrontFace + #endif + ) + { + UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX(v2f); + FragInputs input = BuildFragInputs(v2f); + + PositionInputs posInput = GetPositionInput(input.positionSS.xy, _ScreenSize.zw, input.positionSS.z, input.positionSS.w, input.positionRWS.xyz); + + #ifdef PLATFORM_SUPPORTS_PRIMITIVE_ID_IN_PIXEL_SHADER + if (_DebugFullScreenMode == FULLSCREENDEBUGMODE_QUAD_OVERDRAW) + { + IncrementQuadOverdrawCounter(posInput.positionSS.xy, input.primitiveID); + } + #endif + } + + ENDHLSL + } + + + + + + } + + + + CustomEditor "AllIn1SpriteShaderLitMaterialInspector" +} diff --git a/Assets/Plugins/AllIn1SpriteShader/Shaders/LitShaders/AllIn1SpriteShaderLit_BetterShader_HDRP2020.txt.meta b/Assets/Plugins/AllIn1SpriteShader/Shaders/LitShaders/AllIn1SpriteShaderLit_BetterShader_HDRP2020.txt.meta new file mode 100644 index 000000000..de80876f9 --- /dev/null +++ b/Assets/Plugins/AllIn1SpriteShader/Shaders/LitShaders/AllIn1SpriteShaderLit_BetterShader_HDRP2020.txt.meta @@ -0,0 +1,14 @@ +fileFormatVersion: 2 +guid: b8403357ed2de81489de24747f4c4e40 +TextScriptImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 156513 + packageName: All In 1 Sprite Shader + packageVersion: 4.25 + assetPath: Assets/Plugins/AllIn1SpriteShader/Shaders/LitShaders/AllIn1SpriteShaderLit_BetterShader_HDRP2020.txt + uploadId: 708810 diff --git a/Assets/Plugins/AllIn1SpriteShader/Shaders/LitShaders/AllIn1SpriteShaderLit_BetterShader_HDRP2021.txt b/Assets/Plugins/AllIn1SpriteShader/Shaders/LitShaders/AllIn1SpriteShaderLit_BetterShader_HDRP2021.txt new file mode 100644 index 000000000..56b8a21d1 --- /dev/null +++ b/Assets/Plugins/AllIn1SpriteShader/Shaders/LitShaders/AllIn1SpriteShaderLit_BetterShader_HDRP2021.txt @@ -0,0 +1,25503 @@ +//////////////////////////////////////// +// Generated with Better Shaders +// +// Auto-generated shader code, don't hand edit! +// +// Unity Version: 2019.4.16f1 +// Render Pipeline: HDRP2021 +// Platform: WindowsEditor +//////////////////////////////////////// + + +Shader "AllIn1SpriteShader/AllIn1SpriteShaderLit_BetterShader" +{ + Properties + { + + _MainTex ("Main Texture", 2D) = "white" {} //0 + _Color("Main Color", Color) = (1,1,1,1) //1 + _Alpha("General Alpha", Range(0,1)) = 1 //2 + + _GlowColor("Glow Color", Color) = (1,1,1,1) //3 + _Glow("Glow Color Intensity", Range(0,100)) = 10 //4 + _GlowGlobal("Global Glow Intensity", Range(1,100)) = 1 //5 + [NoScaleOffset] _GlowTex("Glow Texture", 2D) = "white" {} //6 + + _FadeTex("Fade Texture", 2D) = "white" {} //7 + _FadeAmount("Fade Amount", Range(-0.1,1)) = -0.1 //8 + _FadeBurnWidth("Fade Burn Width", Range(0,1)) = 0.025 //9 + _FadeBurnTransition("Burn Transition", Range(0.01,0.5)) = 0.075 //10 + _FadeBurnColor("Fade Burn Color", Color) = (1,1,0,1) //11 + _FadeBurnTex("Fade Burn Texture", 2D) = "white" {} //12 + _FadeBurnGlow("Fade Burn Glow", Range(1,250)) = 2//13 + + _OutlineColor("Outline Base Color", Color) = (1,1,1,1) //14 + _OutlineAlpha("Outline Base Alpha", Range(0,1)) = 1 //15 + _OutlineGlow("Outline Base Glow", Range(1,100)) = 1.5 //16 + _OutlineWidth("Outline Base Width", Range(0,0.2)) = 0.004 //17 + _OutlinePixelWidth("Outline Base Pixel Width", Int) = 1 //18 + + [Space] + _OutlineTex("Outline Texture", 2D) = "white" {} //19 + _OutlineTexXSpeed("Texture scroll speed X", Range(-50,50)) = 10 //20 + _OutlineTexYSpeed("Texture scroll speed Y", Range(-50,50)) = 0 //21 + + [Space] + _OutlineDistortTex("Outline Distortion Texture", 2D) = "white" {} //22 + _OutlineDistortAmount("Outline Distortion Amount", Range(0,2)) = 0.5 //23 + _OutlineDistortTexXSpeed("Distortion scroll speed X", Range(-50,50)) = 5 //24 + _OutlineDistortTexYSpeed("Distortion scroll speed Y", Range(-50,50)) = 5 //25 + + _AlphaOutlineColor("Color", Color) = (1, 1, 1, 1) //26 + _AlphaOutlineGlow("Outline Glow", Range(1,100)) = 5 //27 + _AlphaOutlinePower("Power", Range(0, 5)) = 1 // 28 + _AlphaOutlineMinAlpha("Min Alpha", Range(0, 1)) = 0 // 29 + _AlphaOutlineBlend("Blend", Range(0, 1)) = 1 // 30 + + _GradBlend("Gradient Blend", Range(0,1)) = 1 //31 + _GradTopLeftCol("Top Color", Color) = (1,0,0,1) //32 + _GradTopRightCol("Top Color 2", Color) = (1, 1, 0, 1) //33 + _GradBotLeftCol("Bot Color", Color) = (0,0,1,1) //34 + _GradBotRightCol("Bot Color 2", Color) = (0, 1, 0, 1) //35 + + [NoScaleOffset] _ColorSwapTex("Color Swap Texture", 2D) = "black" {} //36 + [HDR] _ColorSwapRed("Red Channel", Color) = (1,1,1,1) //37 + _ColorSwapRedLuminosity("Red luminosity", Range(-1,1)) = 0.5 //38 + [HDR] _ColorSwapGreen("Green Channel", Color) = (1,1,1,1) //39 + _ColorSwapGreenLuminosity("Green luminosity", Range(-1,1)) = 0.5 //40 + [HDR] _ColorSwapBlue("Blue Channel", Color) = (1,1,1,1) //41 + _ColorSwapBlueLuminosity("Blue luminosity", Range(-1,1)) = 0.5 //42 + + _HsvShift("Hue Shift", Range(0, 360)) = 180 //43 + _HsvSaturation("Saturation", Range(0, 2)) = 1 //44 + _HsvBright("Brightness", Range(0, 2)) = 1 //45 + + _HitEffectColor("Hit Effect Color", Color) = (1,1,1,1) //46 + _HitEffectGlow("Glow Intensity", Range(1,100)) = 5 //47 + [Space] + _HitEffectBlend("Hit Effect Blend", Range(0,1)) = 1 //48 + + _NegativeAmount("Negative Amount", Range(0, 1)) = 1 //49 + + _PixelateSize("Pixelate size", Range(4,512)) = 32 //50 + + [NoScaleOffset] _ColorRampTex("Color ramp Texture", 2D) = "white" {} //51 + _ColorRampLuminosity("Color ramp luminosity", Range(-1,1)) = 0 //52 + [Toggle()] _ColorRampOutline("Affects everything?", float) = 0 //53 + + _GreyscaleLuminosity("Greyscale luminosity", Range(-1,1)) = 0 //54 + [Toggle()] _GreyscaleOutline("Affects everything?", float) = 0 //55 + _GreyscaleTintColor("Greyscale Tint Color", Color) = (1,1,1,1) //56 + + _PosterizeNumColors("Number of Colors", Range(0,100)) = 8 //57 + _PosterizeGamma("Posterize Amount", Range(0.1,10)) = 0.75 //58 + [Toggle()] _PosterizeOutline("Affects everything?", float) = 0 //59 + + _BlurIntensity("Blur Intensity", Range(0,100)) = 10 //60 + [Toggle()] _BlurHD("Blur is Low Res?", float) = 0 //61 + + _MotionBlurAngle("Motion Blur Angle", Range(-1, 1)) = 0.1 //62 + _MotionBlurDist("Motion Blur Distance", Range(-3, 3)) = 1.25 //63 + + _GhostColorBoost("Ghost Color Boost", Range(0,5)) = 1 //64 + _GhostTransparency("Ghost Transparency", Range(0,1)) = 0 //65 + + _InnerOutlineColor("Inner Outline Color", Color) = (1,0,0,1) //66 + _InnerOutlineThickness("Outline Thickness", Range(0,3)) = 1 //67 + _InnerOutlineAlpha("Inner Outline Alpha", Range(0,1)) = 1 //68 + _InnerOutlineGlow("Inner Outline Glow", Range(1,250)) = 4 //69 + + _AlphaCutoffValue("Alpha cutoff value", Range(0, 1)) = 0.25 //70 + + [Toggle()] _OnlyOutline("Only render outline?", float) = 0 //71 + [Toggle()] _OnlyInnerOutline("Only render inner outline?", float) = 0 //72 + + _HologramStripesAmount("Stripes Amount", Range(0, 1)) = 0.1 //73 + _HologramUnmodAmount("Unchanged Amount", Range(0, 1)) = 0.0 //74 + _HologramStripesSpeed("Stripes Speed", Range(-20, 20)) = 4.5 //75 + _HologramMinAlpha("Min Alpha", Range(0, 1)) = 0.1 //76 + _HologramMaxAlpha("Max Alpha", Range(0, 100)) = 0.75 //77 + + _ChromAberrAmount("ChromAberr Amount", Range(0, 1)) = 1 //78 + _ChromAberrAlpha("ChromAberr Alpha", Range(0, 1)) = 0.4 //79 + + _GlitchAmount("Glitch Amount", Range(0, 20)) = 3 //80 + + _FlickerPercent("Flicker Percent", Range(0, 1)) = 0.05 //81 + _FlickerFreq("Flicker Frequency", Range(0, 5)) = 0.2 //82 + _FlickerAlpha("Flicker Alpha", Range(0, 1)) = 0 //83 + + _ShadowX("Shadow X Axis", Range(-0.5, 0.5)) = 0.1 //84 + _ShadowY("Shadow Y Axis", Range(-0.5, 0.5)) = -0.05 //85 + _ShadowAlpha("Shadow Alpha", Range(0, 1)) = 0.5 //86 + _ShadowColor("Shadow Color", Color) = (0, 0, 0, 1) //87 + + _HandDrawnAmount("Hand Drawn Amount", Range(0, 20)) = 10 //88 + _HandDrawnSpeed("Hand Drawn Speed", Range(1, 15)) = 5 //89 + + _GrassSpeed("Speed", Range(0,50)) = 2 //90 + _GrassWind("Bend amount", Range(0,50)) = 20 //91 + [Space] + [Toggle()] _GrassManualToggle("Manually animated?", float) = 0 //92 + _GrassManualAnim("Manual Anim Value", Range(-1,1)) = 1 //93 + + _WaveAmount("Wave Amount", Range(0, 25)) = 7 //94 + _WaveSpeed("Wave Speed", Range(0, 25)) = 10 //95 + _WaveStrength("Wave Strength", Range(0, 25)) = 7.5 //96 + _WaveX("Wave X Axis", Range(0, 1)) = 0 //97 + _WaveY("Wave Y Axis", Range(0, 1)) = 0.5 //98 + + _RectSize("Rect Size", Range(1, 4)) = 1 //99 + + _OffsetUvX("X axis", Range(-1, 1)) = 0 //100 + _OffsetUvY("Y axis", Range(-1, 1)) = 0 //101 + + _ClipUvLeft("Clipping Left", Range(0, 1)) = 0 //102 + _ClipUvRight("Clipping Right", Range(0, 1)) = 0 //103 + _ClipUvUp("Clipping Up", Range(0, 1)) = 0 //104 + _ClipUvDown("Clipping Down", Range(0, 1)) = 0 //105 + + _TextureScrollXSpeed("Speed X Axis", Range(-5, 5)) = 1 //106 + _TextureScrollYSpeed("Speed Y Axis", Range(-5, 5)) = 0 //107 + + _ZoomUvAmount("Zoom Amount", Range(0.1, 5)) = 0.5 //108 + + _DistortTex("Distortion Texture", 2D) = "white" {} //109 + _DistortAmount("Distortion Amount", Range(0,2)) = 0.5 //110 + _DistortTexXSpeed("Scroll speed X", Range(-50,50)) = 5 //111 + _DistortTexYSpeed("Scroll speed Y", Range(-50,50)) = 5 //112 + + _TwistUvAmount("Twist Amount", Range(0, 3.1416)) = 1 //113 + _TwistUvPosX("Twist Pos X Axis", Range(0, 1)) = 0.5 //114 + _TwistUvPosY("Twist Pos Y Axis", Range(0, 1)) = 0.5 //115 + _TwistUvRadius("Twist Radius", Range(0, 3)) = 0.75 //116 + + _RotateUvAmount("Rotate Angle(radians)", Range(0, 6.2831)) = 0 //117 + + _FishEyeUvAmount("Fish Eye Amount", Range(0, 0.5)) = 0.35 //118 + + _PinchUvAmount("Pinch Amount", Range(0, 0.5)) = 0.35 //119 + + _ShakeUvSpeed("Shake Speed", Range(0, 20)) = 2.5 //120 + _ShakeUvX("X Multiplier", Range(0, 5)) = 1.5 //121 + _ShakeUvY("Y Multiplier", Range(0, 5)) = 1 //122 + + _ColorChangeTolerance("Tolerance", Range(0, 1)) = 0.25 //123 + _ColorChangeTarget("Color to change", Color) = (1, 0, 0, 1) //124 + [HDR] _ColorChangeNewCol("New Color", Color) = (1, 1, 0, 1) //125 + _ColorChangeLuminosity("New Color Luminosity", Range(0, 1)) = 0.0 //126 + + _RoundWaveStrength("Wave Strength", Range(0, 1)) = 0.7 //127 + _RoundWaveSpeed("Wave Speed", Range(0, 5)) = 2 //128 + + [Toggle()] _BillboardY("Billboard on both axis?", float) = 0 //129 + _ZWrite ("Depth Write", Float) = 1.0 // 130 + + _MySrcMode ("SrcMode", Float) = 5 // 131 + _MyDstMode ("DstMode", Float) = 10 // 132 + + _ShineColor("Shine Color", Color) = (1,1,1,1) // 133 + _ShineLocation("Shine Location", Range(0,1)) = 0.5 // 134 + _ShineRotate("Rotate Angle(radians)", Range(0, 6.2831)) = 0 //135 + _ShineWidth("Shine Width", Range(0.05,1)) = 0.1 // 136 + _ShineGlow("Shine Glow", Range(0,100)) = 1 // 137 + [NoScaleOffset] _ShineMask("Shine Mask", 2D) = "white" {} // 138 + + _GlitchSize("Glitch Size", Range(0.25, 5)) = 1 //139 + _HologramStripeColor("Stripes Color", Color) = (0,1,1,1) //140 + _GradBoostX("Boost X axis", Range(0.1, 5)) = 1.2 //141 + _GradBoostY("Boost Y axis", Range(0.1, 5)) = 1.2 //142 + [Toggle()] _GradIsRadial("Radial Gradient?", float) = 0 //143 + _AlphaRoundThreshold("Round Threshold", Range(0.005, 1.0)) = 0.5 //144 + _GrassRadialBend("Radial Bend", Range(0.0, 5.0)) = 0.1 //145 + + _ColorChangeTolerance2("Tolerance 2", Range(0, 1)) = 0.25 //146 + _ColorChangeTarget2("Color to change 2", Color) = (1, 0, 0, 1) //147 + [HDR] _ColorChangeNewCol2("New Color 2", Color) = (1, 1, 0, 1) //148 + _ColorChangeTolerance3("Tolerance 3", Range(0, 1)) = 0.25 //149 + _ColorChangeTarget3("Color to change 3", Color) = (1, 0, 0, 1) //150 + [HDR] _ColorChangeNewCol3("New Color 3", Color) = (1, 1, 0, 1) //151 + + _Contrast ("Contrast", Range(0, 6)) = 1 // 152 + _Brightness ("Brightness", Range(-1, 1)) = 0 // 153 + + _ColorSwapBlend ("Color Swap Blend", Range(0, 1)) = 1 // 154 + _ColorRampBlend ("Color Ramp Blend", Range(0, 1)) = 1 // 155 + _GreyscaleBlend ("Greyscale Blend", Range(0, 1)) = 1 // 156 + _GhostBlend ("Ghost Blend", Range(0, 1)) = 1 // 157 + _HologramBlend ("Hologram Blend", Range(0, 1)) = 1 // 158 + + [AllIn1ShaderGradient] _ColorRampTexGradient("Color ramp Gradient", 2D) = "white" {} //159 + + _OverlayTex("Overlay Texture", 2D) = "white" {} //160 + _OverlayColor("Overlay Color", Color) = (1, 1, 1, 1) //161 + _OverlayGlow("Overlay Glow", Range(0,25)) = 1 // 162 + _OverlayBlend("Overlay Blend", Range(0, 1)) = 1 // 163 + + _RadialStartAngle("Radial Start Angle", Range(0, 360)) = 90 //164 + _RadialClip("Radial Clip", Range(0, 360)) = 45 //165 + _RadialClip2("Radial Clip 2", Range(0, 360)) = 0 //166 + + _WarpStrength("Warp Strength", Range(0, 0.1)) = 0.025 //167 + _WarpSpeed("Warp Speed", Range(0, 25)) = 8 //168 + _WarpScale("Warp Scale", Range(0.05, 3)) = 0.5 //169 + + _OverlayTextureScrollXSpeed("Speed X Axis", Range(-5, 5)) = 0.25 //170 + _OverlayTextureScrollYSpeed("Speed Y Axis", Range(-5, 5)) = 0.25 //171 + + _ZTestMode ("Z Test Mode", Float) = 4 + _CullingOption ("Culling Option", float) = 0 + + [HideInInspector] _MinXUV("_MinXUV", Range(0, 1)) = 0.0 + [HideInInspector] _MaxXUV("_MaxXUV", Range(0, 1)) = 1.0 + [HideInInspector] _MinYUV("_MinYUV", Range(0, 1)) = 0.0 + [HideInInspector] _MaxYUV("_MaxYUV", Range(0, 1)) = 1.0 + [HideInInspector] _RandomSeed("_MaxYUV", Range(0, 10000)) = 0.0 + _EditorDrawers("Editor Drawers", Int) = 6 + + [Normal][NoScaleOffset] _NormalMap("Normal Map", 2D) = "bump" {} + _NormalStrength("Normal Strength", Range(0, 15)) = 1.0 + + + + [HideInInspector]_RenderQueueType("Float", Float) = 1 + [HideInInspector][ToggleUI]_AddPrecomputedVelocity("Boolean", Float) = 0 + [HideInInspector][ToggleUI]_DepthOffsetEnable("Boolean", Float) = 0 + [HideInInspector][ToggleUI]_TransparentWritingMotionVec("Boolean", Float) = 0 + [HideInInspector][ToggleUI]_AlphaCutoffEnable("Boolean", Float) = 0 + [HideInInspector]_TransparentSortPriority("_TransparentSortPriority", Float) = 0 + [HideInInspector][ToggleUI]_UseShadowThreshold("Boolean", Float) = 0 + [HideInInspector][ToggleUI]_TransparentDepthPrepassEnable("Boolean", Float) = 0 + [HideInInspector][ToggleUI]_TransparentDepthPostpassEnable("Boolean", Float) = 0 + [HideInInspector]_SurfaceType("Float", Float) = 0 + [HideInInspector]_BlendMode("Float", Float) = 0 + [HideInInspector]_SrcBlend("Float", Float) = 1 + [HideInInspector]_DstBlend("Float", Float) = 0 + [HideInInspector]_AlphaSrcBlend("Float", Float) = 1 + [HideInInspector]_AlphaDstBlend("Float", Float) = 0 + [HideInInspector][ToggleUI]_AlphaToMask("Boolean", Float) = 0 + [HideInInspector][ToggleUI]_AlphaToMaskInspectorValue("Boolean", Float) = 0 + [HideInInspector][ToggleUI]_ZWrite("Boolean", Float) = 1 + [HideInInspector][ToggleUI]_TransparentZWrite("Boolean", Float) = 0 + [HideInInspector][ToggleUI]_EnableFogOnTransparent("Boolean", Float) = 1 + [HideInInspector]_ZTestDepthEqualForOpaque("Float", Int) = 4 + [HideInInspector][Enum(UnityEngine.Rendering.CompareFunction)]_ZTestTransparent("Float", Float) = 4 + [HideInInspector][ToggleUI]_TransparentBackfaceEnable("Boolean", Float) = 0 + [HideInInspector][ToggleUI]_RequireSplitLighting("Boolean", Float) = 0 + [HideInInspector][ToggleUI]_ReceivesSSR("Boolean", Float) = 1 + [HideInInspector][ToggleUI]_ReceivesSSRTransparent("Boolean", Float) = 0 + [HideInInspector][ToggleUI]_EnableBlendModePreserveSpecularLighting("Boolean", Float) = 1 + [HideInInspector][ToggleUI]_SupportDecals("Boolean", Float) = 1 + [HideInInspector]_StencilRef("Float", Int) = 0 + [HideInInspector]_StencilWriteMask("Float", Int) = 6 + [HideInInspector]_StencilRefDepth("Float", Int) = 8 + [HideInInspector]_StencilWriteMaskDepth("Float", Int) = 8 + [HideInInspector]_StencilRefMV("Float", Int) = 40 + [HideInInspector]_StencilWriteMaskMV("Float", Int) = 40 + [HideInInspector]_StencilRefDistortionVec("Float", Int) = 4 + [HideInInspector]_StencilWriteMaskDistortionVec("Float", Int) = 4 + [HideInInspector]_StencilWriteMaskGBuffer("Float", Int) = 14 + [HideInInspector]_StencilRefGBuffer("Float", Int) = 10 + [HideInInspector]_ZTestGBuffer("Float", Int) = 4 + [HideInInspector][ToggleUI]_RayTracing("Boolean", Float) = 0 + [HideInInspector][Enum(None, 0, Box, 1, Sphere, 2, Thin, 3)]_RefractionModel("Float", Float) = 0 + [HideInInspector][NoScaleOffset]unity_Lightmaps("unity_Lightmaps", 2DArray) = "" {} + [HideInInspector][NoScaleOffset]unity_LightmapsInd("unity_LightmapsInd", 2DArray) = "" {} + [HideInInspector][NoScaleOffset]unity_ShadowMasks("unity_ShadowMasks", 2DArray) = "" {} + } + SubShader + { + Tags { "RenderPipeline" = "HDRenderPipeline" "RenderType" = "HDLitShader" "Queue" = "Geometry+225" } + + + Pass + { + // based on HDLitPass.template + Name "Forward" + Tags { "LightMode" = "Forward" } + + + + Stencil + { + WriteMask [_StencilWriteMask] + Ref [_StencilRef] + CompFront Always + PassFront Replace + CompBack Always + PassBack Replace + } + + ColorMask [_ColorMaskTransparentVel] 1 + + Tags { "RenderType" = "Opaque" "Queue" = "Geometry" "PreviewType" = "Plane" } + Cull [_CullingOption] + ZWrite [_ZWrite] + ZTest [_ZTestMode] + + + //------------------------------------------------------------------------------------- + // End Render Modes + //------------------------------------------------------------------------------------- + + HLSLPROGRAM + + #pragma target 4.5 + #pragma only_renderers d3d11 playstation xboxone xboxseries vulkan metal switch + #pragma multi_compile_instancing + #pragma multi_compile _ DOTS_INSTANCING_ON + #pragma instancing_options renderinglayer + + + //#pragma shader_feature _ _SURFACE_TYPE_TRANSPARENT + //#pragma shader_feature_local _BLENDMODE_OFF _BLENDMODE_ALPHA _BLENDMODE_ADD _BLENDMODE_PRE_MULTIPLY + //#pragma shader_feature_local _ _ADD_PRECOMPUTED_VELOCITY + //#pragma shader_feature_local _ _TRANSPARENT_WRITES_MOTION_VEC + //#pragma shader_feature_local _ _ENABLE_FOG_ON_TRANSPARENT + #pragma multi_compile _ DEBUG_DISPLAY + //#pragma shader_feature_local _ _DISABLE_DECALS + //#pragma shader_feature_local _ _DISABLE_SSR + //#pragma shader_feature_local _ _DISABLE_SSR_TRANSPARENT + #pragma multi_compile _ LIGHTMAP_ON + #pragma multi_compile _ DIRLIGHTMAP_COMBINED + #pragma multi_compile_fragment PROBE_VOLUMES_OFF PROBE_VOLUMES_L1 PROBE_VOLUMES_L2 + #pragma multi_compile_raytracing PROBE_VOLUMES_OFF PROBE_VOLUMES_L1 PROBE_VOLUMES_L2 + #pragma multi_compile _ DYNAMICLIGHTMAP_ON + #pragma multi_compile_fragment _ SHADOWS_SHADOWMASK + #pragma multi_compile_raytracing _ SHADOWS_SHADOWMASK + #pragma multi_compile_fragment DECALS_OFF DECALS_3RT DECALS_4RT + #pragma multi_compile_fragment _ DECAL_SURFACE_GRADIENT + #pragma multi_compile_fragment SHADOW_LOW SHADOW_MEDIUM SHADOW_HIGH SHADOW_VERY_HIGH + #pragma multi_compile_fragment SCREEN_SPACE_SHADOWS_OFF SCREEN_SPACE_SHADOWS_ON + #pragma multi_compile_fragment USE_FPTL_LIGHTLIST USE_CLUSTERED_LIGHTLIST + + //#pragma shader_feature_local _REFRACTION_OFF _REFRACTION_PLANE _REFRACTION_SPHERE _REFRACTION_THIN + + + //------------------------------------------------------------------------------------- + // Variant Definitions (active field translations to HDRP defines) + //------------------------------------------------------------------------------------- + // #define _MATERIAL_FEATURE_SUBSURFACE_SCATTERING 1 + // #define _MATERIAL_FEATURE_TRANSMISSION 1 + // #define _MATERIAL_FEATURE_ANISOTROPY 1 + // #define _MATERIAL_FEATURE_IRIDESCENCE 1 + // #define _MATERIAL_FEATURE_SPECULAR_COLOR 1 + #define _ENABLE_FOG_ON_TRANSPARENT 1 + // #define _AMBIENT_OCCLUSION 1 + // #define _SPECULAR_OCCLUSION_FROM_AO 1 + // #define _SPECULAR_OCCLUSION_FROM_AO_BENT_NORMAL 1 + // #define _SPECULAR_OCCLUSION_CUSTOM 1 + // #define _ENERGY_CONSERVING_SPECULAR 1 + // #define _ENABLE_GEOMETRIC_SPECULAR_AA 1 + // #define _HAS_REFRACTION 1 + // #define _REFRACTION_PLANE 1 + // #define _REFRACTION_SPHERE 1 + // #define _DISABLE_DECALS 1 + // #define _DISABLE_SSR 1 + // #define _ADD_PRECOMPUTED_VELOCITY + // #define _WRITE_TRANSPARENT_MOTION_VECTOR 1 + // #define _DEPTHOFFSET_ON 1 + // #define _BLENDMODE_PRESERVE_SPECULAR_LIGHTING 1 + + #define SHADERPASS SHADERPASS_FORWARD + #define SUPPORT_BLENDMODE_PRESERVE_SPECULAR_LIGHTING + #define HAS_LIGHTLOOP + #define RAYTRACING_SHADER_GRAPH_DEFAULT + #define _PASSFORWARD 1 + + + #pragma shader_feature_local GLOW_ON + #pragma shader_feature_local FADE_ON + #pragma shader_feature_local OUTBASE_ON + #pragma shader_feature_local ONLYOUTLINE_ON + #pragma shader_feature_local GRADIENT_ON + #pragma shader_feature_local GRADIENT2COL_ON + #pragma shader_feature_local RADIALGRADIENT_ON + #pragma shader_feature_local COLORSWAP_ON + #pragma shader_feature_local HSV_ON + #pragma shader_feature_local CHANGECOLOR_ON + #pragma shader_feature_local CHANGECOLOR2_ON + #pragma shader_feature_local CHANGECOLOR3_ON + #pragma shader_feature_local COLORRAMP_ON + #pragma shader_feature_local GRADIENTCOLORRAMP_ON + #pragma shader_feature_local HITEFFECT_ON + #pragma shader_feature_local NEGATIVE_ON + #pragma shader_feature_local PIXELATE_ON + #pragma shader_feature_local GREYSCALE_ON + #pragma shader_feature_local POSTERIZE_ON + #pragma shader_feature_local BLUR_ON + #pragma shader_feature_local MOTIONBLUR_ON + #pragma shader_feature_local GHOST_ON + #pragma shader_feature_local ALPHAOUTLINE_ON + #pragma shader_feature_local INNEROUTLINE_ON + #pragma shader_feature_local ONLYINNEROUTLINE_ON + #pragma shader_feature_local HOLOGRAM_ON + #pragma shader_feature_local CHROMABERR_ON + #pragma shader_feature_local GLITCH_ON + #pragma shader_feature_local FLICKER_ON + #pragma shader_feature_local SHADOW_ON + #pragma shader_feature_local SHINE_ON + #pragma shader_feature_local CONTRAST_ON + #pragma shader_feature_local OVERLAY_ON + #pragma shader_feature_local OVERLAYMULT_ON + #pragma shader_feature_local DOODLE_ON + #pragma shader_feature_local WIND_ON + #pragma shader_feature_local WAVEUV_ON + #pragma shader_feature_local ROUNDWAVEUV_ON + #pragma shader_feature_local RECTSIZE_ON + #pragma shader_feature_local OFFSETUV_ON + #pragma shader_feature_local CLIPPING_ON + #pragma shader_feature_local RADIALCLIPPING_ON + #pragma shader_feature_local TEXTURESCROLL_ON + #pragma shader_feature_local ZOOMUV_ON + #pragma shader_feature_local DISTORT_ON + #pragma shader_feature_local WARP_ON + #pragma shader_feature_local TWISTUV_ON + #pragma shader_feature_local ROTATEUV_ON + #pragma shader_feature_local POLARUV_ON + #pragma shader_feature_local FISHEYE_ON + #pragma shader_feature_local PINCH_ON + #pragma shader_feature_local SHAKEUV_ON + + #pragma shader_feature_local GLOWTEX_ON + #pragma shader_feature_local OUTTEX_ON + #pragma shader_feature_local OUTDIST_ON + #pragma shader_feature_local OUTBASE8DIR_ON + #pragma shader_feature_local OUTBASEPIXELPERF_ON + #pragma shader_feature_local COLORRAMPOUTLINE_ON + #pragma shader_feature_local GREYSCALEOUTLINE_ON + #pragma shader_feature_local POSTERIZEOUTLINE_ON + #pragma shader_feature_local BLURISHD_ON + #pragma shader_feature_local MANUALWIND_ON + #pragma shader_feature_local ATLAS_ON + #pragma shader_feature_local PREMULTIPLYALPHA_ON + + #pragma shader_feature BILBOARD_ON + #pragma shader_feature BILBOARDY_ON + + #pragma shader_feature NORMALMAP_ON + + + #define _HDRP 1 +#define _USINGTEXCOORD1 1 +#define _USINGTEXCOORD2 1 + + + #pragma vertex Vert + #pragma fragment Frag + + // useful conversion functions to make surface shader code just work + + #define UNITY_DECLARE_TEX2D(name) TEXTURE2D(name); SAMPLER(sampler##name); + #define UNITY_DECLARE_TEX2D_NOSAMPLER(name) TEXTURE2D(name); + #define UNITY_DECLARE_TEX2DARRAY(name) TEXTURE2D_ARRAY(name); SAMPLER(sampler##name); + #define UNITY_DECLARE_TEX2DARRAY_NOSAMPLER(tex) TEXTURE2D_ARRAY(tex); + + #define UNITY_SAMPLE_TEX2DARRAY(tex,coord) SAMPLE_TEXTURE2D_ARRAY(tex, sampler##tex, coord.xy, coord.z) + #define UNITY_SAMPLE_TEX2DARRAY_LOD(tex,coord,lod) SAMPLE_TEXTURE2D_ARRAY_LOD(tex, sampler##tex, coord.xy, coord.z, lod) + #define UNITY_SAMPLE_TEX2D(tex, coord) SAMPLE_TEXTURE2D(tex, sampler##tex, coord) + #define UNITY_SAMPLE_TEX2D_SAMPLER(tex, samp, coord) SAMPLE_TEXTURE2D(tex, sampler##samp, coord) + + #define UNITY_SAMPLE_TEX2D_LOD(tex,coord, lod) SAMPLE_TEXTURE2D_LOD(tex, sampler_##tex, coord, lod) + #define UNITY_SAMPLE_TEX2D_SAMPLER_LOD(tex,samplertex,coord, lod) SAMPLE_TEXTURE2D_LOD (tex, sampler##samplertex,coord, lod) + + #if defined(UNITY_COMPILER_HLSL) + #define UNITY_INITIALIZE_OUTPUT(type,name) name = (type)0; + #else + #define UNITY_INITIALIZE_OUTPUT(type,name) + #endif + + #define sampler2D_float sampler2D + #define sampler2D_half sampler2D + + #undef WorldNormalVector + #define WorldNormalVector(data, normal) mul(normal, data.TBNMatrix) + + #define UnityObjectToWorldNormal(normal) mul(GetObjectToWorldMatrix(), normal) + + + + +// HDRP Adapter stuff + #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Common.hlsl" + #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Texture.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/ShaderVariables.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/ShaderPass/FragInputs.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/ShaderPass/ShaderPass.cs.hlsl" + #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/TextureStack.hlsl" // Required to be include before we include properties as it define DECLARE_STACK_CB +#if UNITY_VERSION >= UNITY_2021_3_31 + #include "Packages/com.unity.shadergraph/ShaderGraphLibrary/Functions.hlsl" // Need to be here for Gradient struct definition +#else + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/ShaderGraphHeader.hlsl" +#endif + #ifdef RAYTRACING_SHADER_GRAPH_DEFAULT + #define RAYTRACING_SHADER_GRAPH_HIGH + #endif + + #ifdef RAYTRACING_SHADER_GRAPH_RAYTRACED + #define RAYTRACING_SHADER_GRAPH_LOW + #endif + // end + + + + + // If we use subsurface scattering, enable output split lighting (for forward pass) + #if defined(_MATERIAL_FEATURE_SUBSURFACE_SCATTERING) && !defined(_SURFACE_TYPE_TRANSPARENT) + #define OUTPUT_SPLIT_LIGHTING + #endif + + #define HAVE_RECURSIVE_RENDERING + + #if SHADERPASS == SHADERPASS_TRANSPARENT_DEPTH_PREPASS + #if !defined(_DISABLE_SSR_TRANSPARENT) && !defined(SHADER_UNLIT) + #define WRITE_NORMAL_BUFFER + #endif + #endif + + #ifndef DEBUG_DISPLAY + // In case of opaque we don't want to perform the alpha test, it is done in depth prepass and we use depth equal for ztest (setup from UI) + // Don't do it with debug display mode as it is possible there is no depth prepass in this case + #if !defined(_SURFACE_TYPE_TRANSPARENT) && defined(_ALPHATEST) + #if SHADERPASS == SHADERPASS_FORWARD + #define SHADERPASS_FORWARD_BYPASS_ALPHA_TEST + #elif SHADERPASS == SHADERPASS_GBUFFER + #define SHADERPASS_GBUFFER_BYPASS_ALPHA_TEST + #endif + #endif + #endif + + // Define _DEFERRED_CAPABLE_MATERIAL for shader capable to run in deferred pass + #if defined(SHADER_LIT) && !defined(_SURFACE_TYPE_TRANSPARENT) + #define _DEFERRED_CAPABLE_MATERIAL + #endif + + // Translate transparent motion vector define + #if defined(_TRANSPARENT_WRITES_MOTION_VEC) && defined(_SURFACE_TYPE_TRANSPARENT) + #define _WRITE_TRANSPARENT_MOTION_VECTOR + #endif + + + + + CBUFFER_START(UnityPerMaterial) + float _UseShadowThreshold; + float _BlendMode; + float _EnableBlendModePreserveSpecularLighting; + float _RayTracing; + float _RefractionModel; + + + half4 _Color; + half4 _MainTex_ST, _MainTex_TexelSize; + half _Alpha, _AlphaCutoffValue; + + #if ATLAS_ON + half _MinXUV, _MaxXUV, _MinYUV, _MaxYUV; + #endif + + #if GLOW_ON + half4 _GlowColor; + half _Glow, _GlowGlobal; + #endif + + #if HSV_ON + half _HsvShift, _HsvSaturation, _HsvBright; + #endif + + #if DISTORT_ON + half4 _DistortTex_ST; + half _DistortTexXSpeed, _DistortTexYSpeed, _DistortAmount; + #endif + + #if FADE_ON + half4 _FadeBurnColor, _FadeTex_ST, _FadeBurnTex_ST; + half _FadeAmount, _FadeBurnWidth, _FadeBurnTransition,_FadeBurnGlow; + #endif + + #if OUTBASE_ON + half4 _OutlineColor; + half _OutlineAlpha, _OutlineGlow, _OutlineWidth; + int _OutlinePixelWidth; + #endif + + #if OUTTEX_ON + half4 _OutlineTex_ST; + half _OutlineTexXSpeed, _OutlineTexYSpeed; + #endif + + #if OUTDIST_ON + half4 _OutlineDistortTex_ST; + half _OutlineDistortTexXSpeed, _OutlineDistortTexYSpeed, _OutlineDistortAmount; + #endif + + #if ALPHAOUTLINE_ON + half _AlphaOutlineGlow, _AlphaOutlinePower, _AlphaOutlineMinAlpha, _AlphaOutlineBlend; + half4 _AlphaOutlineColor; + #endif + + #if INNEROUTLINE_ON + half _InnerOutlineThickness, _InnerOutlineAlpha, _InnerOutlineGlow; + half4 _InnerOutlineColor; + #endif + + #if GRADIENT_ON + half _GradBlend, _GradBoostX, _GradBoostY; + half4 _GradTopRightCol, _GradTopLeftCol, _GradBotRightCol, _GradBotLeftCol; + #endif + + #if COLORSWAP_ON + half4 _ColorSwapRed, _ColorSwapGreen, _ColorSwapBlue; + half _ColorSwapRedLuminosity, _ColorSwapGreenLuminosity, _ColorSwapBlueLuminosity, _ColorSwapBlend; + #endif + + #if CHANGECOLOR_ON + half4 _ColorChangeNewCol, _ColorChangeTarget; + half _ColorChangeTolerance, _ColorChangeLuminosity; + #endif + #if CHANGECOLOR2_ON + half4 _ColorChangeNewCol2, _ColorChangeTarget2; + half _ColorChangeTolerance2; + #endif + #if CHANGECOLOR3_ON + half4 _ColorChangeNewCol3, _ColorChangeTarget3; + half _ColorChangeTolerance3; + #endif + + #if COLORRAMP_ON + half _ColorRampLuminosity, _ColorRampBlend; + #endif + + #if HITEFFECT_ON + half4 _HitEffectColor; + half _HitEffectGlow, _HitEffectBlend; + #endif + + #if NEGATIVE_ON + half _NegativeAmount; + #endif + + #if PIXELATE_ON + half _PixelateSize; + #endif + + #if GREYSCALE_ON + half _GreyscaleLuminosity, _GreyscaleBlend; + half4 _GreyscaleTintColor; + #endif + + #if POSTERIZE_ON + half _PosterizeNumColors, _PosterizeGamma; + #endif + + #if BLUR_ON + half _BlurIntensity; + #endif + + #if MOTIONBLUR_ON + half _MotionBlurAngle, _MotionBlurDist; + #endif + + #if GHOST_ON + half _GhostColorBoost, _GhostTransparency, _GhostBlend; + #endif + + #if HOLOGRAM_ON + half _HologramStripesAmount, _HologramMinAlpha, _HologramUnmodAmount, _HologramStripesSpeed, _HologramMaxAlpha, _HologramBlend; + half4 _HologramStripeColor; + #endif + + #if CHROMABERR_ON + half _ChromAberrAmount, _ChromAberrAlpha; + #endif + + #if GLITCH_ON + half _GlitchAmount, _GlitchSize; + #endif + + #if FLICKER_ON + half _FlickerFreq, _FlickerPercent, _FlickerAlpha; + #endif + + #if SHADOW_ON + half _ShadowX, _ShadowY, _ShadowAlpha; + half4 _ShadowColor; + #endif + + #if SHINE_ON + half4 _ShineColor; + half _ShineLocation, _ShineRotate, _ShineWidth, _ShineGlow; + #endif + + #if CONTRAST_ON + half _Contrast, _Brightness; + #endif + + #if OVERLAY_ON + half4 _OverlayTex_ST, _OverlayColor; + half _OverlayGlow, _OverlayBlend, _OverlayTextureScrollXSpeed, _OverlayTextureScrollYSpeed; + #endif + + #if DOODLE_ON + half _HandDrawnAmount, _HandDrawnSpeed; + #endif + + #if WIND_ON + half _GrassSpeed, _GrassWind, _GrassManualAnim, _GrassRadialBend; + #endif + + #if WAVEUV_ON + float _WaveAmount, _WaveSpeed, _WaveStrength, _WaveX, _WaveY; + #endif + + #if ROUNDWAVEUV_ON + half _RoundWaveStrength, _RoundWaveSpeed; + #endif + + #if RECTSIZE_ON + half _RectSize; + #endif + + #if OFFSETUV_ON + half _OffsetUvX, _OffsetUvY; + #endif + + #if CLIPPING_ON + half _ClipUvLeft, _ClipUvRight, _ClipUvUp, _ClipUvDown; + #endif + + #if RADIALCLIPPING_ON + half _RadialStartAngle, _RadialClip, _RadialClip2; + #endif + + #if TEXTURESCROLL_ON + half _TextureScrollXSpeed, _TextureScrollYSpeed; + #endif + + #if ZOOMUV_ON + half _ZoomUvAmount; + #endif + + #if WARP_ON + half _WarpStrength, _WarpSpeed, _WarpScale; + #endif + + #if TWISTUV_ON + half _TwistUvAmount, _TwistUvPosX, _TwistUvPosY, _TwistUvRadius; + #endif + + #if ROTATEUV_ON + half _RotateUvAmount; + #endif + + #if FISHEYE_ON + half _FishEyeUvAmount; + #endif + + #if PINCH_ON + half _PinchUvAmount; + #endif + + #if SHAKEUV_ON + half _ShakeUvSpeed, _ShakeUvX, _ShakeUvY; + #endif + + #if NORMALMAP_ON + half _NormalStrength; + #endif + + float _RandomSeed; + + + + + CBUFFER_END + + + + // -- Property used by ScenePickingPass + #ifdef SCENEPICKINGPASS + float4 _SelectionID; + #endif + + // -- Properties used by SceneSelectionPass + #ifdef SCENESELECTIONPASS + int _ObjectId; + int _PassValue; + #endif + + + // data across stages, stripped like the above. + struct VertexToPixel + { + float4 pos : SV_POSITION; + float3 worldPos : TEXCOORD0; + float3 worldNormal : TEXCOORD1; + float4 worldTangent : TEXCOORD2; + float4 texcoord0 : TEXCOORD3; + float4 texcoord1 : TEXCOORD4; + float4 texcoord2 : TEXCOORD5; + // #if %TEXCOORD3REQUIREKEY% + float4 texcoord3 : TEXCOORD6; + // #endif + + // #if %SCREENPOSREQUIREKEY% + // float4 screenPos : TEXCOORD7; + // #endif + + // #if %VERTEXCOLORREQUIREKEY% + float4 vertexColor : COLOR; + // #endif + + // #if %EXTRAV2F0REQUIREKEY% + // float4 extraV2F0 : TEXCOORD8; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // float4 extraV2F1 : TEXCOORD9; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // float4 extraV2F2 : TEXCOORD10; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // float4 extraV2F3 : TEXCOORD11; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // float4 extraV2F4 : TEXCOORD12; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // float4 extraV2F5 : TEXCOORD13; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // float4 extraV2F6 : TEXCOORD14; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // float4 extraV2F7 : TEXCOORD15; + // #endif + + #if UNITY_ANY_INSTANCING_ENABLED + UNITY_VERTEX_INPUT_INSTANCE_ID + #endif // UNITY_ANY_INSTANCING_ENABLED + + #if _HDRP && (_PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR))) + float4 previousPositionCS : TEXCOORD16; // Contain previous transform position (in case of skinning for example) + float4 motionVectorCS : TEXCOORD17; + #endif + + UNITY_VERTEX_OUTPUT_STEREO + }; + + + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Debug/DebugDisplay.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/Material.hlsl" + #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/NormalSurfaceGradient.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Lighting/Lighting.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Lighting/LightLoop/LightLoopDef.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/Lit/Lit.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Lighting/LightLoop/LightLoop.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/BuiltinUtilities.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/MaterialUtilities.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/Decal/DecalUtilities.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/Lit/LitDecalData.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/ShaderGraphFunctions.hlsl" + + + + + // data describing the user output of a pixel + struct Surface + { + half3 Albedo; + half Height; + half3 Normal; + half Smoothness; + half3 Emission; + half Metallic; + half3 Specular; + half Occlusion; + half SpecularPower; // for simple lighting + half Alpha; + float outputDepth; // if written, SV_Depth semantic is used. ShaderData.clipPos.z is unused value + // HDRP Only + half SpecularOcclusion; + half SubsurfaceMask; + half Thickness; + half CoatMask; + half CoatSmoothness; + half Anisotropy; + half IridescenceMask; + half IridescenceThickness; + int DiffusionProfileHash; + float SpecularAAThreshold; + float SpecularAAScreenSpaceVariance; + // requires _OVERRIDE_BAKEDGI to be defined, but is mapped in all pipelines + float3 DiffuseGI; + float3 BackDiffuseGI; + float3 SpecularGI; + float ior; + float3 transmittanceColor; + float atDistance; + float transmittanceMask; + // requires _OVERRIDE_SHADOWMASK to be defines + float4 ShadowMask; + + // for decals + float NormalAlpha; + float MAOSAlpha; + + + }; + + // Data the user declares in blackboard blocks + struct Blackboard + { + + float blackboardDummyData; + }; + + // data the user might need, this will grow to be big. But easy to strip + struct ShaderData + { + float4 clipPos; // SV_POSITION + float3 localSpacePosition; + float3 localSpaceNormal; + float3 localSpaceTangent; + + float3 worldSpacePosition; + float3 worldSpaceNormal; + float3 worldSpaceTangent; + float tangentSign; + + float3 worldSpaceViewDir; + float3 tangentSpaceViewDir; + + float4 texcoord0; + float4 texcoord1; + float4 texcoord2; + float4 texcoord3; + + float2 screenUV; + float4 screenPos; + + float4 vertexColor; + bool isFrontFace; + + float4 extraV2F0; + float4 extraV2F1; + float4 extraV2F2; + float4 extraV2F3; + float4 extraV2F4; + float4 extraV2F5; + float4 extraV2F6; + float4 extraV2F7; + + float3x3 TBNMatrix; + Blackboard blackboard; + }; + + struct VertexData + { + #if SHADER_TARGET > 30 + // uint vertexID : SV_VertexID; + #endif + float4 vertex : POSITION; + float3 normal : NORMAL; + float4 tangent : TANGENT; + float4 texcoord0 : TEXCOORD0; + + // optimize out mesh coords when not in use by user or lighting system + #if _URP && (_USINGTEXCOORD1 || _PASSMETA || _PASSFORWARD || _PASSGBUFFER) + float4 texcoord1 : TEXCOORD1; + #endif + + #if _URP && (_USINGTEXCOORD2 || _PASSMETA || ((_PASSFORWARD || _PASSGBUFFER) && defined(DYNAMICLIGHTMAP_ON))) + float4 texcoord2 : TEXCOORD2; + #endif + + #if _STANDARD && (_USINGTEXCOORD1 || (_PASSMETA || ((_PASSFORWARD || _PASSGBUFFER || _PASSFORWARDADD) && LIGHTMAP_ON))) + float4 texcoord1 : TEXCOORD1; + #endif + #if _STANDARD && (_USINGTEXCOORD2 || (_PASSMETA || ((_PASSFORWARD || _PASSGBUFFER) && DYNAMICLIGHTMAP_ON))) + float4 texcoord2 : TEXCOORD2; + #endif + + + #if _HDRP + float4 texcoord1 : TEXCOORD1; + float4 texcoord2 : TEXCOORD2; + #endif + + // #if %TEXCOORD3REQUIREKEY% + float4 texcoord3 : TEXCOORD3; + // #endif + + // #if %VERTEXCOLORREQUIREKEY% + float4 vertexColor : COLOR; + // #endif + + #if _PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR)) + float3 previousPositionOS : TEXCOORD4; // Contain previous transform position (in case of skinning for example) + #if defined (_ADD_PRECOMPUTED_VELOCITY) + float3 precomputedVelocity : TEXCOORD5; // Add Precomputed Velocity (Alembic computes velocities on runtime side). + #endif + #endif + + UNITY_VERTEX_INPUT_INSTANCE_ID + }; + + struct TessVertex + { + float4 vertex : INTERNALTESSPOS; + float3 normal : NORMAL; + float4 tangent : TANGENT; + float4 texcoord0 : TEXCOORD0; + float4 texcoord1 : TEXCOORD1; + float4 texcoord2 : TEXCOORD2; + + // #if %TEXCOORD3REQUIREKEY% + float4 texcoord3 : TEXCOORD3; + // #endif + + // #if %VERTEXCOLORREQUIREKEY% + float4 vertexColor : COLOR; + // #endif + + // #if %EXTRAV2F0REQUIREKEY% + // float4 extraV2F0 : TEXCOORD5; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // float4 extraV2F1 : TEXCOORD6; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // float4 extraV2F2 : TEXCOORD7; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // float4 extraV2F3 : TEXCOORD8; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // float4 extraV2F4 : TEXCOORD9; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // float4 extraV2F5 : TEXCOORD10; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // float4 extraV2F6 : TEXCOORD11; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // float4 extraV2F7 : TEXCOORD12; + // #endif + + #if _PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR)) + float3 previousPositionOS : TEXCOORD13; // Contain previous transform position (in case of skinning for example) + #if defined (_ADD_PRECOMPUTED_VELOCITY) + float3 precomputedVelocity : TEXCOORD14; + #endif + #endif + + UNITY_VERTEX_INPUT_INSTANCE_ID + UNITY_VERTEX_OUTPUT_STEREO + }; + + struct ExtraV2F + { + float4 extraV2F0; + float4 extraV2F1; + float4 extraV2F2; + float4 extraV2F3; + float4 extraV2F4; + float4 extraV2F5; + float4 extraV2F6; + float4 extraV2F7; + Blackboard blackboard; + float4 time; + }; + + + float3 WorldToTangentSpace(ShaderData d, float3 normal) + { + return mul(d.TBNMatrix, normal); + } + + float3 TangentToWorldSpace(ShaderData d, float3 normal) + { + return mul(normal, d.TBNMatrix); + } + + // in this case, make standard more like SRPs, because we can't fix + // unity_WorldToObject in HDRP, since it already does macro-fu there + + #if _STANDARD + float3 TransformWorldToObject(float3 p) { return mul(unity_WorldToObject, float4(p, 1)); }; + float3 TransformObjectToWorld(float3 p) { return mul(unity_ObjectToWorld, float4(p, 1)); }; + float4 TransformWorldToObject(float4 p) { return mul(unity_WorldToObject, p); }; + float4 TransformObjectToWorld(float4 p) { return mul(unity_ObjectToWorld, p); }; + float4x4 GetWorldToObjectMatrix() { return unity_WorldToObject; } + float4x4 GetObjectToWorldMatrix() { return unity_ObjectToWorld; } + #if (defined(SHADER_API_D3D11) || defined(SHADER_API_XBOXONE) || defined(UNITY_COMPILER_HLSLCC) || defined(SHADER_API_PSSL) || (SHADER_TARGET_SURFACE_ANALYSIS && !SHADER_TARGET_SURFACE_ANALYSIS_MOJOSHADER)) + #define UNITY_SAMPLE_TEX2D_LOD(tex,coord, lod) tex.SampleLevel (sampler##tex,coord, lod) + #define UNITY_SAMPLE_TEX2D_SAMPLER_LOD(tex,samplertex,coord, lod) tex.SampleLevel (sampler##samplertex,coord, lod) + #else + #define UNITY_SAMPLE_TEX2D_LOD(tex,coord,lod) tex2D (tex,coord,0,lod) + #define UNITY_SAMPLE_TEX2D_SAMPLER_LOD(tex,samplertex,coord,lod) tex2D (tex,coord,0,lod) + #endif + + #undef GetWorldToObjectMatrix() + + #define GetWorldToObjectMatrix() unity_WorldToObject + + + #endif + + float3 GetCameraWorldPosition() + { + #if _HDRP + return GetCameraRelativePositionWS(_WorldSpaceCameraPos); + #else + return _WorldSpaceCameraPos; + #endif + } + + #if _GRABPASSUSED + #if _STANDARD + TEXTURE2D(%GRABTEXTURE%); + SAMPLER(sampler_%GRABTEXTURE%); + #endif + + half3 GetSceneColor(float2 uv) + { + #if _STANDARD + return SAMPLE_TEXTURE2D(%GRABTEXTURE%, sampler_%GRABTEXTURE%, uv).rgb; + #else + return SHADERGRAPH_SAMPLE_SCENE_COLOR(uv); + #endif + } + #endif + + + + #if _STANDARD + UNITY_DECLARE_DEPTH_TEXTURE(_CameraDepthTexture); + float GetSceneDepth(float2 uv) { return SAMPLE_DEPTH_TEXTURE(_CameraDepthTexture, uv); } + float GetLinear01Depth(float2 uv) { return Linear01Depth(GetSceneDepth(uv)); } + float GetLinearEyeDepth(float2 uv) { return LinearEyeDepth(GetSceneDepth(uv)); } + #else + float GetSceneDepth(float2 uv) { return SHADERGRAPH_SAMPLE_SCENE_DEPTH(uv); } + float GetLinear01Depth(float2 uv) { return Linear01Depth(GetSceneDepth(uv), _ZBufferParams); } + float GetLinearEyeDepth(float2 uv) { return LinearEyeDepth(GetSceneDepth(uv), _ZBufferParams); } + #endif + + float3 GetWorldPositionFromDepthBuffer(float2 uv, float3 worldSpaceViewDir) + { + float eye = GetLinearEyeDepth(uv); + float3 camView = mul((float3x3)GetObjectToWorldMatrix(), transpose(mul(GetWorldToObjectMatrix(), UNITY_MATRIX_I_V)) [2].xyz); + + float dt = dot(worldSpaceViewDir, camView); + float3 div = worldSpaceViewDir/dt; + float3 wpos = (eye * div) + GetCameraWorldPosition(); + return wpos; + } + + #if _HDRP + float3 ObjectToWorldSpacePosition(float3 pos) + { + return GetAbsolutePositionWS(TransformObjectToWorld(pos)); + } + #else + float3 ObjectToWorldSpacePosition(float3 pos) + { + return TransformObjectToWorld(pos); + } + #endif + + #if _STANDARD + UNITY_DECLARE_SCREENSPACE_TEXTURE(_CameraDepthNormalsTexture); + float3 GetSceneNormal(float2 uv, float3 worldSpaceViewDir) + { + float4 depthNorms = UNITY_SAMPLE_SCREENSPACE_TEXTURE(_CameraDepthNormalsTexture, uv); + float3 norms = DecodeViewNormalStereo(depthNorms); + norms = mul((float3x3)GetWorldToViewMatrix(), norms) * 0.5 + 0.5; + return norms; + } + #elif _HDRP && !_DECALSHADER + + float3 GetSceneNormal(float2 uv, float3 worldSpaceViewDir) + { + NormalData nd; + DecodeFromNormalBuffer(_ScreenSize.xy * uv, nd); + return nd.normalWS; + } + #elif _URP + #if (SHADER_LIBRARY_VERSION_MAJOR >= 10) + #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/DeclareNormalsTexture.hlsl" + #endif + + float3 GetSceneNormal(float2 uv, float3 worldSpaceViewDir) + { + #if (SHADER_LIBRARY_VERSION_MAJOR >= 10) + return SampleSceneNormals(uv); + #else + float3 wpos = GetWorldPositionFromDepthBuffer(uv, worldSpaceViewDir); + return normalize(-cross(ddx(wpos), ddy(wpos))) * 0.5 + 0.5; + #endif + + } + #endif + + #if _HDRP + + half3 UnpackNormalmapRGorAG(half4 packednormal) + { + // This do the trick + packednormal.x *= packednormal.w; + + half3 normal; + normal.xy = packednormal.xy * 2 - 1; + normal.z = sqrt(1 - saturate(dot(normal.xy, normal.xy))); + return normal; + } + half3 UnpackNormal(half4 packednormal) + { + #if defined(UNITY_NO_DXT5nm) + return packednormal.xyz * 2 - 1; + #else + return UnpackNormalmapRGorAG(packednormal); + #endif + } + #endif + #if _HDRP || _URP + + half3 UnpackScaleNormal(half4 packednormal, half scale) + { + #ifndef UNITY_NO_DXT5nm + // Unpack normal as DXT5nm (1, y, 1, x) or BC5 (x, y, 0, 1) + // Note neutral texture like "bump" is (0, 0, 1, 1) to work with both plain RGB normal and DXT5nm/BC5 + packednormal.x *= packednormal.w; + #endif + half3 normal; + normal.xy = (packednormal.xy * 2 - 1) * scale; + normal.z = sqrt(1 - saturate(dot(normal.xy, normal.xy))); + return normal; + } + + #endif + + + void GetSun(out float3 lightDir, out float3 color) + { + lightDir = float3(0.5, 0.5, 0); + color = 1; + #if _HDRP + if (_DirectionalLightCount > 0) + { + DirectionalLightData light = _DirectionalLightDatas[0]; + lightDir = -light.forward.xyz; + color = light.color; + } + #elif _STANDARD + lightDir = normalize(_WorldSpaceLightPos0.xyz); + color = _LightColor0.rgb; + #elif _URP + Light light = GetMainLight(); + lightDir = light.direction; + color = light.color; + #endif + } + + + + + + + + + + TEXTURE2D(_MainTex); + SAMPLER(sampler_MainTex); + + #if GLOW_ON + TEXTURE2D(_GlowTex); + SAMPLER(sampler_GlowTex); + #endif + + #if FADE_ON + TEXTURE2D(_FadeTex); + SAMPLER(sampler_FadeTex); + + TEXTURE2D(_FadeBurnTex); + SAMPLER(sampler_FadeBurnTex); + #endif + + #if DISTORT_ON + TEXTURE2D(_DistortTex); + SAMPLER(sampler_DistortTex); + #endif + + #if OUTTEX_ON + TEXTURE2D(_OutlineTex); + SAMPLER(sampler_OutlineTex); + #endif + + #if OUTDIST_ON + TEXTURE2D(_OutlineDistortTex); + SAMPLER(sampler_OutlineDistortTex); + #endif + + #if COLORSWAP_ON + TEXTURE2D(_ColorSwapTex); + SAMPLER(sampler_ColorSwapTex); + #endif + + #if COLORRAMP_ON + TEXTURE2D(_ColorRampTex); + TEXTURE2D(_ColorRampTexGradient); + SAMPLER(sampler_ColorRampTex); + SAMPLER(sampler_ColorRampTexGradient); + #endif + + #if SHINE_ON + TEXTURE2D(_ShineMask); + SAMPLER(sampler_ShineMask); + #endif + + #if OVERLAY_ON + TEXTURE2D(_OverlayTex); + SAMPLER(sampler_OverlayTex); + #endif + + #if NORMALMAP_ON + TEXTURE2D(_NormalMap); + SAMPLER(sampler_NormalMap); + #endif + + + half3 GetPixel(in int offsetX, in int offsetY, in half2 uv, in Texture2D _tex, in SamplerState _sampler) + { + half2 _uv = uv + half2(offsetX * _MainTex_TexelSize.x, offsetY * _MainTex_TexelSize.y); + half4 col = SAMPLE_TEXTURE2D(_tex, _sampler, _uv); + return col.rgb; + } + + + //BLURS------------------------------------------------------------------------- + half4 Blur(half2 uv, Texture2D source, SamplerState sampler_source, half Intensity) + { + const half2 texelSize = 1.0 / _ScreenParams.xy; + const half4 color = SAMPLE_TEXTURE2D(source, sampler_source, uv); + const half2 offset = Intensity * texelSize; + + half4 accumulatedColor = color; + half accumulatedWeight = 1.0; + for (int x = -1; x <= 1; x++) + { + for (int y = -1; y <= 1; y++) + { + const half2 sampleUV = uv + half2(x, y) * offset; + const half4 sampleColor = SAMPLE_TEXTURE2D(source, sampler_source, sampleUV); + + accumulatedColor += sampleColor; + accumulatedWeight += 1.0; + } + } + + half4 blurredColor = accumulatedColor / accumulatedWeight; + return blurredColor; + } + + half BlurHD_G(half bhqp, half x) + { + return exp(-(x * x) / (2.0 * bhqp * bhqp)); + } + half4 BlurHD(half2 uv, Texture2D source, SamplerState sampler_source, half BlurAmount, half xScale, half yScale) + { + int iterations = 16; + int halfIterations = iterations / 2; + half sigmaX = 0.1 + BlurAmount * 0.5; + half sigmaY = sigmaX; + half total = 0.0; + half4 ret = half4(0, 0, 0, 0); + for (int iy = 0; iy < iterations; ++iy) + { + half fy = BlurHD_G(sigmaY, half(iy) -half(halfIterations)); + half offsetY = half(iy - halfIterations) * 0.00390625 * xScale; + for (int ix = 0; ix < iterations; ++ix) + { + half fx = BlurHD_G(sigmaX, half(ix) - half(halfIterations)); + half offsetX = half(ix - halfIterations) * 0.00390625 * yScale; + total += fx * fy; + ret += SAMPLE_TEXTURE2D(source, sampler_source, uv + half2(offsetX, offsetY)) * fx * fy; + } + } + return ret / total; + } + //----------------------------------------------------------------------- + + + //------------------------------------------- + half RemapFloat(half inValue, half inMin, half inMax, half outMin, half outMax){ + return outMin + (inValue - inMin) * (outMax - outMin) / (inMax - inMin); + } + //------------------------------------------- + + //----------------------------------------------------------------------- + half rand(half2 seed, half offset) { + return (frac(sin(dot(seed, half2(12.9898, 78.233))) * 43758.5453) + offset) % 1.0; + } + + half rand2(half2 seed, half offset) { + return (frac(sin(dot(seed * floor(50 + (_Time.x % 1.0) * 12.), half2(127.1, 311.7))) * 43758.5453123) + offset) % 1.0; + } + + half rand2CustomTime(half2 seed, half offset, half customTime) { + return (frac(sin(dot(seed * floor(50 + (customTime % 1.0) * 12.), half2(127.1, 311.7))) * 43758.5453123) + offset) % 1.0; + } + //----------------------------------------------------------------------- + + + void Ext_ModifyVertex0 (inout VertexData v, inout ExtraV2F d) + { + //BILBOARD_ON + #if BILBOARD_ON + half3 camRight = mul((half3x3)unity_CameraToWorld, half3(1,0,0)); + half3 camUp = half3(0,1,0); + #if BILBOARDY_ON + camUp = mul((half3x3)unity_CameraToWorld, half3(0,1,0)); + #endif + half3 localPos = v.vertex.x * camRight + v.vertex.y * camUp; + v.vertex = half4(localPos, 1); + #endif + //----------------------------------------------------------- + + v.texcoord0.xy = TRANSFORM_TEX(v.texcoord0.xy, _MainTex); + half2 center = half2(0.5, 0.5); + #if ATLAS_ON + center = half2((_MaxXUV + _MinXUV) / 2.0, (_MaxYUV + _MinYUV) / 2.0); + #endif + + //POLARUV_ON + #if POLARUV_ON + v.texcoord0.xy = v.texcoord0.xy - center; + #endif + + //---------------------------------------- + + //ROTATEUV_ON + #if ROTATEUV_ON + half2 uvC = v.texcoord0.xy; + half cosAngle = cos(_RotateUvAmount); + half sinAngle = sin(_RotateUvAmount); + half2x2 rot = half2x2(cosAngle, -sinAngle, sinAngle, cosAngle); + uvC -= center; + v.texcoord0.xy = mul(rot, uvC); + v.texcoord0.xy += center; + #endif + //-------------------- + + #if RECTSIZE_ON + v.vertex.xyz += (v.vertex.xyz * (_RectSize - 1.0)); + #endif + + #if OUTTEX_ON + v.texcoord1.xy = TRANSFORM_TEX(v.texcoord0.xy, _OutlineTex); + #endif + + #if OUTDIST_ON + v.texcoord2.xy = TRANSFORM_TEX(v.texcoord0.xy, _OutlineDistortTex); + #endif + + #if DISTORT_ON + v.texcoord3.xy = TRANSFORM_TEX(v.texcoord0.xy, _DistortTex); + #endif + } + + void Ext_SurfaceFunction0 (inout Surface o, ShaderData d) + { + half randomSeed = _RandomSeed; + + float2 uvRect = d.texcoord0; + half2 center = half2(0.5, 0.5); + #if ATLAS_ON + center = half2((_MaxXUV + _MinXUV) / 2.0, (_MaxYUV + _MinYUV) / 2.0); + uvRect = half2((d.texcoord0.x - _MinXUV) / (_MaxXUV - _MinXUV), (d.texcoord0.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half2 centerTiled = half2(center.x * _MainTex_ST.x, center.y * _MainTex_ST.y); + + //CLIPPING_ON + #if CLIPPING_ON + half2 tiledUv = half2(d.texcoord0.x / _MainTex_ST.x, d.texcoord0.y / _MainTex_ST.y); + #if ATLAS_ON + tiledUv = half2((tiledUv.x - _MinXUV) / (_MaxXUV - _MinXUV), (tiledUv.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + clip((1 - _ClipUvUp) - tiledUv.y); + clip(tiledUv.y - _ClipUvDown); + clip((1 - _ClipUvRight) - tiledUv.x); + clip(tiledUv.x - _ClipUvLeft); + #endif + //---------------------------------- + + //RADIALCLIPPING_ON + #if RADIALCLIPPING_ON + half2 tiledUv2 = half2(d.texcoord0.x / _MainTex_ST.x, d.texcoord0.y / _MainTex_ST.y); + #if ATLAS_ON + tiledUv2 = half2((tiledUv2.x - _MinXUV) / (_MaxXUV - _MinXUV), (tiledUv2.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half startAngle = _RadialStartAngle - _RadialClip; + half endAngle = _RadialStartAngle + _RadialClip2; + half offset0 = clamp(0, 360, startAngle + 360); + half offset360 = clamp(0, 360, endAngle - 360); + half2 atan2Coord = half2(lerp(-1, 1, tiledUv2.x), lerp(-1, 1, tiledUv2.y)); + half atanAngle = atan2(atan2Coord.y, atan2Coord.x) * 57.3; // angle in degrees + if(atanAngle < 0) atanAngle = 360 + atanAngle; + if(atanAngle >= startAngle && atanAngle <= endAngle) discard; + if(atanAngle <= offset360) discard; + if(atanAngle >= offset0) discard; + #endif + + //----------------------------- + + //TEXTURESCROLL_ON && ATLAS_ON + #if TEXTURESCROLL_ON && ATLAS_ON + d.texcoord0.xy = half2(_MinXUV + ((_MaxXUV - _MinXUV) * (abs(((_Time.y + randomSeed) * _TextureScrollXSpeed) + uvRect.x) % 1)), + _MinYUV + ((_MaxYUV - _MinYUV) * (abs(((_Time.y + randomSeed) * _TextureScrollYSpeed) + uvRect.y) % 1))); + #endif + //---------------------------- + + //OFFSETUV_ON + #if OFFSETUV_ON + #if ATLAS_ON + d.texcoord0.xy = half2(_MinXUV + ((_MaxXUV - _MinXUV) * (abs((_OffsetUvX + uvRect.x) % 1))), + _MinYUV + ((_MaxYUV - _MinYUV) * (abs(_OffsetUvY + uvRect.y) % 1))); + #else + d.texcoord0.xy += half2(_OffsetUvX, _OffsetUvY); + #endif + #endif + + //---------------------- + + //POLARUV_ON + #if POLARUV_ON + d.texcoord0.xy = half2(atan2(d.texcoord0.y, d.texcoord0.x) / (2.0f * 3.141592653589f), length(d.texcoord0.xy)); + d.texcoord0.xy *= _MainTex_ST.xy; + #endif + + //-------------------------------------- + + //TWISTUV_ON + #if TWISTUV_ON + #if ATLAS_ON + _TwistUvPosX = ((_MaxXUV - _MinXUV) * _TwistUvPosX) + _MinXUV; + _TwistUvPosY = ((_MaxYUV - _MinYUV) * _TwistUvPosY) + _MinYUV; + #endif + half2 tempUv = d.texcoord0.xy - half2(_TwistUvPosX * _MainTex_ST.x, _TwistUvPosY * _MainTex_ST.y); + _TwistUvRadius *= (_MainTex_ST.x + _MainTex_ST.y) / 2; + half percent = (_TwistUvRadius - length(tempUv)) / _TwistUvRadius; + half theta = percent * percent * (2.0 * sin(_TwistUvAmount)) * 8.0; + half s = sin(theta); + half c = cos(theta); + half beta = max(sign(_TwistUvRadius - length(tempUv)), 0.0); + tempUv = half2(dot(tempUv, half2(c, -s)), dot(tempUv, half2(s, c))) * beta + tempUv * (1 - beta); + tempUv += half2(_TwistUvPosX * _MainTex_ST.x, _TwistUvPosY * _MainTex_ST.y); + d.texcoord0.xy = tempUv; + #endif + + //-------------------------------------------- + + //FISHEYE_ON + #if FISHEYE_ON + half bind = length(centerTiled); + half2 dF = d.texcoord0.xy - centerTiled; + half dFlen = length(dF); + half fishInt = (3.14159265359 / bind) * (_FishEyeUvAmount + 0.001); + d.texcoord0.xy = centerTiled + (dF / (max(0.0001, dFlen))) * tan(dFlen * fishInt) * bind / tan(bind * fishInt); + #endif + //--------------------------------------------- + + //PINCH_ON + #if PINCH_ON + half2 dP = d.texcoord0.xy - centerTiled; + half pinchInt = (3.141592 / length(centerTiled)) * (-_PinchUvAmount + 0.001); + d.texcoord0.xy = centerTiled + normalize(dP) * atan(length(dP) * -pinchInt * 10.0) * 0.5 / atan(-pinchInt * 5); + #endif + + //--------------------------------------------- + + //ZOOMUV_ON + #if ZOOMUV_ON + d.texcoord0.xy -= centerTiled; + d.texcoord0.xy = d.texcoord0.xy * _ZoomUvAmount; + d.texcoord0.xy += centerTiled; + #endif + + //----------------------------------------------- + + //DOODLE_ON + #if DOODLE_ON + half2 uvCopy = uvRect; + _HandDrawnSpeed = (floor((_Time.x + randomSeed) * 20 * _HandDrawnSpeed) / _HandDrawnSpeed) * _HandDrawnSpeed; + uvCopy.x = sin((uvCopy.x * _HandDrawnAmount + _HandDrawnSpeed) * 4); + uvCopy.y = cos((uvCopy.y * _HandDrawnAmount + _HandDrawnSpeed) * 4); + d.texcoord0.xy = lerp(d.texcoord0.xy, d.texcoord0.xy + uvCopy, 0.0005 * _HandDrawnAmount); + #endif + + //-------------------------- + + //SHAKEUV_ON + #if SHAKEUV_ON + half xShake = sin((_Time.x + randomSeed) * _ShakeUvSpeed * 50) * _ShakeUvX; + half yShake = cos((_Time.x + randomSeed) * _ShakeUvSpeed * 50) * _ShakeUvY; + d.texcoord0.xy += half2(xShake * 0.012, yShake * 0.01); + #endif + + //------------------------------------------- + + //RECTSIZE_ON + #if RECTSIZE_ON + d.texcoord0.xy = d.texcoord0.xy * (_RectSize).xx + (((-_RectSize * 0.5) + 0.5)).xx; + #endif + + //------------------------------------------- + + //DISTORT_ON + #if DISTORT_ON + #if ATLAS_ON + d.texcoord3.x = d.texcoord3.x * (1 / (_MaxXUV - _MinXUV)); + d.texcoord3.y = d.texcoord3.y * (1 / (_MaxYUV - _MinYUV)); + #endif + + d.texcoord3.x += ((_Time.x + _RandomSeed) * _DistortTexXSpeed) % 1; + d.texcoord3.y += ((_Time.x + _RandomSeed) * _DistortTexYSpeed) % 1; + half distortAmnt = (SAMPLE_TEXTURE2D(_DistortTex, sampler_DistortTex, d.texcoord3.xy).r - 0.5) * 0.2 * _DistortAmount; + d.texcoord0.x += distortAmnt; + d.texcoord0.y += distortAmnt; + #endif + //------------------------------------------------------- + + //WARP_ON + #if WARP_ON + half2 warpUv = half2(d.texcoord0.x / _MainTex_ST.x, d.texcoord0.y / _MainTex_ST.y); + #if ATLAS_ON + warpUv = half2((warpUv.x - _MinXUV) / (_MaxXUV - _MinXUV), (warpUv.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + const float tau = 6.283185307179586; + float xWarp = (_Time.y + randomSeed) * _WarpSpeed + warpUv.x * tau / _WarpScale; + float yWarp = (_Time.y + randomSeed) * _WarpSpeed + warpUv.y * tau / _WarpScale; + float2 warp = float2(sin(xWarp), sin(yWarp)) * _WarpStrength; + d.texcoord0.xy += warp; + #endif + + //------------------------------------------------------- + + //WAVEUV_ON + #if WAVEUV_ON + float2 uvWave = half2(_WaveX * _MainTex_ST.x, _WaveY * _MainTex_ST.y) - d.texcoord0.xy; + uvWave %= 1; + #if ATLAS_ON + uvWave = half2(_WaveX, _WaveY) - uvRect; + #endif + uvWave.x *= _ScreenParams.x / _ScreenParams.y; + float waveTime = _Time.y + randomSeed; + float angWave = (sqrt(dot(uvWave, uvWave)) * _WaveAmount) - ((waveTime * _WaveSpeed)); + d.texcoord0.xy = d.texcoord0.xy + uvWave * sin(angWave) * (_WaveStrength / 1000.0); + #endif + //---------------------------------------------------- + + //ROUNDWAVEUV_ON + #if ROUNDWAVEUV_ON + half xWave = ((0.5 * _MainTex_ST.x) - uvRect.x); + half yWave = ((0.5 * _MainTex_ST.y) - uvRect.y) * (_MainTex_TexelSize.w / _MainTex_TexelSize.z); + half ripple = -sqrt(xWave*xWave + yWave* yWave); + d.texcoord0.xy += (sin((ripple + (_Time.y + randomSeed) * (_RoundWaveSpeed/10.0)) / 0.015) * (_RoundWaveStrength/10.0)) % 1; + #endif + //---------------------------------------------------- + + + //WIND_ON + #if WIND_ON + half windOffset = sin((_Time.x + randomSeed) * _GrassSpeed * 10); + half2 windCenter = half2(0.5, 0.1); + #if ATLAS_ON + windCenter.x = ((_MaxXUV - _MinXUV) * windCenter.x) + _MinXUV; + windCenter.y = ((_MaxYUV - _MinYUV) * windCenter.y) + _MinYUV; + #endif + #if !MANUALWIND_ON + d.texcoord0.x = fmod(abs(lerp(d.texcoord0.x, d.texcoord0.x + (_GrassWind * 0.01 * windOffset), uvRect.y)), 1); + #else + d.texcoord0.x = fmod(abs(lerp(d.texcoord0.x, d.texcoord0.x + (_GrassWind * 0.01 * _GrassManualAnim), uvRect.y)), 1); + windOffset = _GrassManualAnim; + #endif + half2 delta = d.texcoord0.xy - windCenter; + half delta2 = dot(delta.xy, delta.xy); + half2 delta_offset = delta2 * windOffset; + d.texcoord0.xy = d.texcoord0.xy + half2(delta.y, -delta.x) * delta_offset * _GrassRadialBend; + #endif + + //-------------------------------------------------------- + + //TEXTURESCROLL_ON && !ATLAS_ON + #if TEXTURESCROLL_ON && !ATLAS_ON + d.texcoord0.x += ((_Time.y + randomSeed) * _TextureScrollXSpeed) % 1; + d.texcoord0.y += ((_Time.y + randomSeed) * _TextureScrollYSpeed) % 1; + #endif + //------------------------------ + + //PIXELATE_ON + #if PIXELATE_ON + half aspectRatio = _MainTex_TexelSize.x / _MainTex_TexelSize.y; + half2 pixelSize = float2(_PixelateSize, _PixelateSize * aspectRatio); + d.texcoord0.xy = floor(d.texcoord0.xy * pixelSize) / pixelSize; + #endif + //-------------- + + half4 col = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy); + half originalAlpha = col.a; + col *= d.vertexColor; + + //NORMAL MAP + #if NORMALMAP_ON + half4 normalSample = SAMPLE_TEXTURE2D(_NormalMap, sampler_NormalMap, d.texcoord0.xy); + half3 normalTS = UnpackNormal(normalSample); + normalTS.xy *= _NormalStrength; + o.Normal = normalTS; + #endif + + + //GLITCH_ON + #if GLITCH_ON + half2 uvGlitch = uvRect; + uvGlitch.y -= 0.5; + half lineNoise = pow(rand2(floor(uvGlitch * half2(24., 19.) * _GlitchSize) * 4.0, randomSeed), 3.0) * _GlitchAmount + * pow(rand2(floor(uvGlitch * half2(38., 14.) * _GlitchSize) * 4.0, randomSeed), 3.0); + col = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(lineNoise * 0.02 * rand2(half2(2.0, 1), randomSeed), 0)) * d.vertexColor; + #endif + //-------------------------------------- + + //CHROMABERR_ON + #if CHROMABERR_ON + half4 r = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(_ChromAberrAmount/10, 0)) * d.vertexColor; + half4 b = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(-_ChromAberrAmount/10, 0)) * d.vertexColor; + col = half4(r.r * r.a, col.g, b.b * b.a, max(max(r.a, b.a) * _ChromAberrAlpha, col.a)); + #endif + + //-------------------------------- + + //BLUR_ON + #if BLUR_ON + #if ATLAS_ON + #if !BLURISHD_ON + col = BlurHD(d.texcoord0.xy, _MainTex, sampler_MainTex, _BlurIntensity, (_MaxXUV - _MinXUV), (_MaxYUV - _MinYUV)) * d.vertexColor; + #else + col = Blur(d.texcoord0.xy, _MainTex, sampler_MainTex, _BlurIntensity * (_MaxXUV - _MinXUV)) * d.vertexColor; + #endif + #else + #if !BLURISHD_ON + col = BlurHD(d.texcoord0.xy, _MainTex, sampler_MainTex, _BlurIntensity, 1, 1) * d.vertexColor; + #else + col = Blur(d.texcoord0.xy, _MainTex, sampler_MainTex, _BlurIntensity) * d.vertexColor; + #endif + #endif + #endif + + //-------------------- + + //MOTIONBLUR_ON + #if MOTIONBLUR_ON + _MotionBlurAngle = _MotionBlurAngle * 3.1415926; + #define rot(n) mul(n, half2x2(cos(_MotionBlurAngle), -sin(_MotionBlurAngle), sin(_MotionBlurAngle), cos(_MotionBlurAngle))) + _MotionBlurDist = _MotionBlurDist * 0.005; + #if ATLAS_ON + _MotionBlurDist *= (_MaxXUV - _MinXUV); + #endif + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(-_MotionBlurDist, -_MotionBlurDist))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(-_MotionBlurDist * 2, -_MotionBlurDist * 2))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(-_MotionBlurDist * 3, -_MotionBlurDist * 3))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(-_MotionBlurDist * 4, -_MotionBlurDist * 4))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(_MotionBlurDist, _MotionBlurDist))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(_MotionBlurDist * 2, _MotionBlurDist * 2))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(_MotionBlurDist * 3, _MotionBlurDist * 3))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(_MotionBlurDist * 4, _MotionBlurDist * 4))); + col.rgb = col.rgb / 9; + #endif + //------------------------------------ + + //NEGATIVE_ON + #if NEGATIVE_ON + col.rgb = lerp(col.rgb, 1 - col.rgb, _NegativeAmount); + #endif + + //-------------- + half luminance = 0; + + //GREYSCALE_ON && !GREYSCALEOUTLINE_ON + #if GREYSCALE_ON && !GREYSCALEOUTLINE_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + luminance = saturate(luminance + _GreyscaleLuminosity); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _GreyscaleTintColor, _GreyscaleBlend); + #endif + //------------------------------------ + + //GHOST_ON + #if GHOST_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + half4 ghostResult; + ghostResult.a = saturate(luminance - _GhostTransparency) * col.a; + ghostResult.rgb = col.rgb * (luminance + _GhostColorBoost); + col = lerp(col, ghostResult, _GhostBlend); + #endif + //------------------------------------ + + //INNEROUTLINE_ON + #if INNEROUTLINE_ON + half3 innerT = abs(GetPixel(0, _InnerOutlineThickness, d.texcoord0.xy, _MainTex, sampler_MainTex) - GetPixel(0, -_InnerOutlineThickness, d.texcoord0.xy, _MainTex, sampler_MainTex)); + innerT += abs(GetPixel(_InnerOutlineThickness, 0, d.texcoord0.xy, _MainTex, sampler_MainTex) - GetPixel(-_InnerOutlineThickness, 0, d.texcoord0.xy, _MainTex, sampler_MainTex)); + #if !ONLYINNEROUTLINE_ON + innerT = (innerT / 2.0) * col.a * _InnerOutlineAlpha; + col.rgb += length(innerT) * _InnerOutlineColor.rgb * _InnerOutlineGlow; + #else + innerT *= col.a * _InnerOutlineAlpha; + col.rgb = length(innerT) * _InnerOutlineColor.rgb * _InnerOutlineGlow; + col.a = step(0.3, col.r+col.g+col.b); + #endif + #endif + //------------------------------------------------------- + + //HITEFFECT_ON + #if HITEFFECT_ON + col.rgb = lerp(col.rgb, _HitEffectColor.rgb * _HitEffectGlow, _HitEffectBlend); + #endif + //-------------------- + + //GRADIENT_ON + #if GRADIENT_ON + half2 tiledUvGrad = half2(uvRect.x / _MainTex_ST.x, uvRect.y / _MainTex_ST.y); + #if GRADIENT2COL_ON + _GradTopRightCol = _GradTopLeftCol; + _GradBotRightCol = _GradBotLeftCol; + #endif + #if RADIALGRADIENT_ON + half radialDist = 1 - length(tiledUvGrad - half2(0.5, 0.5)); + radialDist *= (_MainTex_TexelSize.w / _MainTex_TexelSize.z); + radialDist = saturate(_GradBoostX * radialDist); + half4 gradientResult = lerp(_GradTopLeftCol, _GradBotLeftCol, radialDist); + #else + half gradXLerpFactor = saturate(pow(tiledUvGrad.x, _GradBoostX)); + half4 gradientResult = lerp(lerp(_GradBotLeftCol, _GradBotRightCol, gradXLerpFactor), + lerp(_GradTopLeftCol, _GradTopRightCol, gradXLerpFactor), saturate(pow(tiledUvGrad.y, _GradBoostY))); + #endif + gradientResult = lerp(col, gradientResult, _GradBlend); + col.rgb = gradientResult.rgb * col.a; + col.a *= gradientResult.a; + #endif + //-------------------------------------------------------------------- + + //CONTRAST_ON + #if CONTRAST_ON + col.rgb = (col.rgb - float3(0.5, 0.5, 0.5)) * _Contrast + float3(0.5, 0.5, 0.5); + col.rgb += _Brightness; + #endif + + //------------------------------------------------------------------- + + //COLORSWAP_ON + #if COLORSWAP_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + half4 swapMask = SAMPLE_TEXTURE2D(_ColorSwapTex, sampler_ColorSwapTex, d.texcoord0.xy); + swapMask.rgb *= swapMask.a; + half3 redSwap = _ColorSwapRed * swapMask.r * saturate(luminance + _ColorSwapRedLuminosity); + half3 greenSwap = _ColorSwapGreen * swapMask.g * saturate(luminance + _ColorSwapGreenLuminosity); + half3 blueSwap = _ColorSwapBlue * swapMask.b * saturate(luminance + _ColorSwapBlueLuminosity); + swapMask.rgb = col.rgb * saturate(1 - swapMask.r - swapMask.g - swapMask.b); + col.rgb = lerp(col.rgb, swapMask.rgb + redSwap + greenSwap + blueSwap, _ColorSwapBlend); + #endif + //-------------------------------------------------------------------- + + //COLORRAMP_ON && !COLORRAMPOUTLINE_ON + #if COLORRAMP_ON && !COLORRAMPOUTLINE_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + luminance = saturate(luminance + _ColorRampLuminosity); + #if GRADIENTCOLORRAMP_ON + col.rgb = lerp(col.rgb, SAMPLE_TEXTURE2D(_ColorRampTexGradient, sampler_ColorRampTexGradient, half2(luminance, 0)).rgb, _ColorRampBlend); + #else + col.rgb = lerp(col.rgb, SAMPLE_TEXTURE2D(_ColorRampTex, sampler_ColorRampTex, half2(luminance, 0)).rgb, _ColorRampBlend); + #endif + #endif + //-------------------------------------------------------------------- + + //CHANGECOLOR_ON + #if CHANGECOLOR_ON + float3 currChangeColor = saturate(col.rgb); + luminance = 0.3 * currChangeColor.r + 0.59 * currChangeColor.g + 0.11 * currChangeColor.b; + luminance = saturate(luminance + _ColorChangeLuminosity); + half3 dif = abs(currChangeColor - _ColorChangeTarget.rgb); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _ColorChangeNewCol.rgb, + max(sign(1 - saturate(dif.x + dif.y + dif.z) - _ColorChangeTolerance), 0.0)); + #if CHANGECOLOR2_ON + dif = abs(currChangeColor - _ColorChangeTarget2.rgb); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _ColorChangeNewCol2.rgb, + max(sign(1 - saturate(dif.x + dif.y + dif.z) - _ColorChangeTolerance2), 0.0)); + #endif + #if CHANGECOLOR3_ON + dif = abs(currChangeColor - _ColorChangeTarget3.rgb); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _ColorChangeNewCol3.rgb, + max(sign(1 - saturate(dif.x + dif.y + dif.z) - _ColorChangeTolerance3), 0.0)); + #endif + #endif + //------------------------------------------------------- + + //POSTERIZE_ON && !POSTERIZEOUTLINE_ON + #if POSTERIZE_ON && !POSTERIZEOUTLINE_ON + col.rgb = pow(col.rgb, _PosterizeGamma) * _PosterizeNumColors; + col.rgb = floor(col.rgb) / _PosterizeNumColors; + col.rgb = pow(col.rgb, 1.0 / _PosterizeGamma); + #endif + //------------------------------------ + + //HSV_ON + #if HSV_ON + half3 resultHsv = half3(col.rgb); + half cosHsv = _HsvBright * _HsvSaturation * cos(_HsvShift * 3.14159265 / 180); + half sinHsv = _HsvBright * _HsvSaturation * sin(_HsvShift * 3.14159265 / 180); + resultHsv.x = (.299 * _HsvBright + .701 * cosHsv + .168 * sinHsv) * col.x + + (.587 * _HsvBright - .587 * cosHsv + .330 * sinHsv) * col.y + + (.114 * _HsvBright - .114 * cosHsv - .497 * sinHsv) * col.z; + resultHsv.y = (.299 * _HsvBright - .299 * cosHsv - .328 * sinHsv) *col.x + + (.587 * _HsvBright + .413 * cosHsv + .035 * sinHsv) * col.y + + (.114 * _HsvBright - .114 * cosHsv + .292 * sinHsv) * col.z; + resultHsv.z = (.299 * _HsvBright - .3 * cosHsv + 1.25 * sinHsv) * col.x + + (.587 * _HsvBright - .588 * cosHsv - 1.05 * sinHsv) * col.y + + (.114 * _HsvBright + .886 * cosHsv - .203 * sinHsv) * col.z; + col.rgb = resultHsv; + #endif + //------------------------------------------------------- + + //OVERLAY_ON + #if OVERLAY_ON + half2 overlayUvs = d.texcoord0.xy; + overlayUvs.x += ((_Time.y + randomSeed) * _OverlayTextureScrollXSpeed) % 1; + overlayUvs.y += ((_Time.y + randomSeed) * _OverlayTextureScrollYSpeed) % 1; + half4 overlayCol = SAMPLE_TEXTURE2D(_OverlayTex, sampler_OverlayTex, TRANSFORM_TEX(overlayUvs, _OverlayTex)); + overlayCol.rgb *= _OverlayColor.rgb * _OverlayGlow; + #if !OVERLAYMULT_ON + overlayCol.rgb *= overlayCol.a * _OverlayColor.rgb * _OverlayColor.a * _OverlayBlend; + col.rgb += overlayCol.rgb; + #else + overlayCol.a *= _OverlayColor.a; + col = lerp(col, col * overlayCol, _OverlayBlend); + #endif + #endif + + //--------------------------------- + + //OUTBASE_ON + #if OUTBASE_ON + #if OUTBASEPIXELPERF_ON + half2 destUv = half2(_OutlinePixelWidth * _MainTex_TexelSize.x, _OutlinePixelWidth * _MainTex_TexelSize.y); + #else + half2 destUv = half2(_OutlineWidth * _MainTex_TexelSize.x * 200, _OutlineWidth * _MainTex_TexelSize.y * 200); + #endif + + #if OUTDIST_ON + d.texcoord3.x += ((_Time.x + _RandomSeed) * _OutlineDistortTexXSpeed) % 1; + d.texcoord3.y += ((_Time.x + _RandomSeed) * _OutlineDistortTexYSpeed) % 1; + #if ATLAS_ON + d.texcoord3 = half2((d.texcoord3.x - _MinXUV) / (_MaxXUV - _MinXUV), (d.texcoord3.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half outDistortAmnt = (SAMPLE_TEXTURE2D(_OutlineDistortTex, sampler_OutlineDistortTex, d.texcoord3).r - 0.5) * 0.2 * _OutlineDistortAmount; + destUv.x += outDistortAmnt; + destUv.y += outDistortAmnt; + #endif + + half spriteLeft = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(destUv.x, 0)).a; + half spriteRight = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy - half2(destUv.x, 0)).a; + half spriteBottom = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(0, destUv.y)).a; + half spriteTop = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy - half2(0, destUv.y)).a; + half result = spriteLeft + spriteRight + spriteBottom + spriteTop; + + #if OUTBASE8DIR_ON + half spriteTopLeft = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(destUv.x, destUv.y)).a; + half spriteTopRight = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(-destUv.x, destUv.y)).a; + half spriteBotLeft = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(destUv.x, -destUv.y)).a; + half spriteBotRight = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(-destUv.x, -destUv.y)).a; + result = result + spriteTopLeft + spriteTopRight + spriteBotLeft + spriteBotRight; + #endif + + result = step(0.05, saturate(result)); + + #if OUTTEX_ON + d.texcoord1.x += ((_Time.x + _RandomSeed) * _OutlineTexXSpeed) % 1; + d.texcoord1.y += ((_Time.x + _RandomSeed) * _OutlineTexYSpeed) % 1; + #if ATLAS_ON + d.texcoord1 = half2((d.texcoord1.x - _MinXUV) / (_MaxXUV - _MinXUV), (d.texcoord1.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half4 tempOutColor = SAMPLE_TEXTURE2D(_OutlineTex, sampler_OutlineTex, d.texcoord1); + tempOutColor *= _OutlineColor; + _OutlineColor = tempOutColor; + #endif + + result *= (1 - originalAlpha) * _OutlineAlpha; + + half4 outline = _OutlineColor * d.vertexColor.a; + outline.rgb *= _OutlineGlow; + outline.a = result; + #if ONLYOUTLINE_ON + col = outline; + #else + col = lerp(col, outline, result); + #endif + #endif + //------------------------------------------------------- + + //FADE_ON + #if FADE_ON + half2 tiledUvFade1 = TRANSFORM_TEX(d.texcoord0, _FadeTex); + half2 tiledUvFade2 = TRANSFORM_TEX(d.texcoord0, _FadeBurnTex); + #if ATLAS_ON + tiledUvFade1 = half2((tiledUvFade1.x - _MinXUV) / (_MaxXUV - _MinXUV), (tiledUvFade1.y - _MinYUV) / (_MaxYUV - _MinYUV)); + tiledUvFade2 = half2((tiledUvFade2.x - _MinXUV) / (_MaxXUV - _MinXUV), (tiledUvFade2.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half fadeTemp = SAMPLE_TEXTURE2D(_FadeTex, sampler_FadeTex, tiledUvFade1).r; + half fade = smoothstep(_FadeAmount, _FadeAmount + _FadeBurnTransition, fadeTemp); + half fadeBurn = saturate(smoothstep(_FadeAmount - _FadeBurnWidth, _FadeAmount - _FadeBurnWidth + 0.1, fadeTemp) * _FadeAmount); + col.a *= fade; + _FadeBurnColor.rgb *= _FadeBurnGlow; + col += fadeBurn * SAMPLE_TEXTURE2D(_FadeBurnTex, sampler_FadeBurnTex, tiledUvFade2) * _FadeBurnColor * originalAlpha * (1 - col.a); + #endif + //------------------------------------------------------- + + //SHADOW_ON + #if SHADOW_ON + half shadowA = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(_ShadowX, _ShadowY)).a; + half preMultShadowMask = 1 - (saturate(shadowA - col.a) * (1 - col.a)); + col.rgb *= 1 - ((shadowA - col.a) * (1 - col.a)); + col.rgb += (_ShadowColor * shadowA) * (1 - col.a); + col.a = max(shadowA * _ShadowAlpha * d.vertexColor.a, col.a); + #endif + + //------------------------------------------------------- + + //GLOW_ON + #if GLOW_ON + half4 emission; + #if GLOWTEX_ON + emission = SAMPLE_TEXTURE2D(_GlowTex, sampler_GlowTex, d.texcoord0); + #else + emission = col; + #endif + + col.rgb *= _GlowGlobal; + emission.rgb *= emission.a * col.a * _Glow * _GlowColor; + col.rgb += emission.rgb; + #endif + //------------------------------------------------------- + + //COLORRAMP_ON && COLORRAMPOUTLINE_ON + #if COLORRAMP_ON && COLORRAMPOUTLINE_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + luminance = saturate(luminance + _ColorRampLuminosity); + #if GRADIENTCOLORRAMP_ON + col.rgb = lerp(col.rgb, SAMPLE_TEXTURE2D(_ColorRampTexGradient, sampler_ColorRampTexGradient, half2(luminance, 0)).rgb, _ColorRampBlend); + #else + col.rgb = lerp(col.rgb, SAMPLE_TEXTURE2D(_ColorRampTex, sampler_ColorRampTex, half2(luminance, 0)).rgb, _ColorRampBlend); + #endif + #endif + //--------------- + + //GREYSCALE_ON && GREYSCALEOUTLINE_ON + #if GREYSCALE_ON && GREYSCALEOUTLINE_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + luminance = saturate(luminance + _GreyscaleLuminosity); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _GreyscaleTintColor, _GreyscaleBlend); + #endif + + //----------------------------------- + + //POSTERIZE_ON && POSTERIZEOUTLINE_ON + #if POSTERIZE_ON && POSTERIZEOUTLINE_ON + col.rgb = pow(col.rgb, _PosterizeGamma) * _PosterizeNumColors; + col.rgb = floor(col.rgb) / _PosterizeNumColors; + col.rgb = pow(col.rgb, 1.0 / _PosterizeGamma); + #endif + + //----------------------------------- + + //SHINE_ON + #if SHINE_ON + half2 uvShine = uvRect; + half cosAngle = cos(_ShineRotate); + half sinAngle = sin(_ShineRotate); + half2x2 rot = half2x2(cosAngle, -sinAngle, sinAngle, cosAngle); + uvShine -= half2(0.5, 0.5); + uvShine = mul(rot, uvShine); + uvShine += half2(0.5, 0.5); + half shineMask = SAMPLE_TEXTURE2D(_ShineMask, sampler_ShineMask, d.texcoord0.xy).a; + half currentDistanceProjection = (uvShine.x + uvShine.y) / 2; + half whitePower = 1 - (abs(currentDistanceProjection - _ShineLocation) / _ShineWidth); + col.rgb += col.a * whitePower * _ShineGlow * max(sign(currentDistanceProjection - (_ShineLocation - _ShineWidth)), 0.0) + * max(sign((_ShineLocation + _ShineWidth) - currentDistanceProjection), 0.0) * _ShineColor * shineMask; + #endif + + //----------------------------------- + + //HOLOGRAM_ON + #if HOLOGRAM_ON + half totalHologram = _HologramStripesAmount + _HologramUnmodAmount; + half hologramYCoord = ((uvRect.y + (((_Time.x + randomSeed) % 1) * _HologramStripesSpeed)) % totalHologram) / totalHologram; + hologramYCoord = abs(hologramYCoord); + half alpha = RemapFloat(saturate(hologramYCoord - (_HologramUnmodAmount/totalHologram)), 0.0, 1.0, _HologramMinAlpha, saturate(_HologramMaxAlpha)); + half hologramMask = max(sign((_HologramUnmodAmount/totalHologram) - hologramYCoord), 0.0); + half4 hologramResult = col; + hologramResult.a *= lerp(alpha, 1, hologramMask); + hologramResult.rgb *= max(1, _HologramMaxAlpha * max(sign(hologramYCoord - (_HologramUnmodAmount/totalHologram)), 0.0)); + hologramMask = 1 - step(0.01,hologramMask); + hologramResult.rgb += hologramMask * _HologramStripeColor * col.a; + col = lerp(col, hologramResult, _HologramBlend); + #endif + + //----------------------------------- + + //FLICKER_ON + #if FLICKER_ON + col.a *= saturate(col.a * step(frac(0.05 + (_Time.w + randomSeed) * _FlickerFreq), 1 - _FlickerPercent) + _FlickerAlpha); + #endif + //----------------------------------- + + //ALPHACUTOFF_ON + + //ALPHAROUND_ON + + //ALPHAOUTLINE_ON + #if ALPHAOUTLINE_ON + half alphaOutlineRes = pow(1 - col.a, max(_AlphaOutlinePower, 0.0001)) * step(_AlphaOutlineMinAlpha, col.a) * _AlphaOutlineBlend; + col.rgb = lerp(col.rgb, _AlphaOutlineColor.rgb * _AlphaOutlineGlow, alphaOutlineRes); + col.a = lerp(col.a, 1, alphaOutlineRes > 1); + #endif + //------------------------------------------------------- + + //FOG_ON + + //------------------ + + col *= _Color; + o.Albedo = col; + col.a *= _Alpha; + clip(col.a - _AlphaCutoffValue - 0.01); + o.Alpha = _Color.a; + } + + + + + + void ChainSurfaceFunction(inout Surface l, inout ShaderData d) + { + Ext_SurfaceFunction0(l, d); + // Ext_SurfaceFunction1(l, d); + // Ext_SurfaceFunction2(l, d); + // Ext_SurfaceFunction3(l, d); + // Ext_SurfaceFunction4(l, d); + // Ext_SurfaceFunction5(l, d); + // Ext_SurfaceFunction6(l, d); + // Ext_SurfaceFunction7(l, d); + // Ext_SurfaceFunction8(l, d); + // Ext_SurfaceFunction9(l, d); + // Ext_SurfaceFunction10(l, d); + // Ext_SurfaceFunction11(l, d); + // Ext_SurfaceFunction12(l, d); + // Ext_SurfaceFunction13(l, d); + // Ext_SurfaceFunction14(l, d); + // Ext_SurfaceFunction15(l, d); + // Ext_SurfaceFunction16(l, d); + // Ext_SurfaceFunction17(l, d); + // Ext_SurfaceFunction18(l, d); + // Ext_SurfaceFunction19(l, d); + // Ext_SurfaceFunction20(l, d); + // Ext_SurfaceFunction21(l, d); + // Ext_SurfaceFunction22(l, d); + // Ext_SurfaceFunction23(l, d); + // Ext_SurfaceFunction24(l, d); + // Ext_SurfaceFunction25(l, d); + // Ext_SurfaceFunction26(l, d); + // Ext_SurfaceFunction27(l, d); + // Ext_SurfaceFunction28(l, d); + // Ext_SurfaceFunction29(l, d); + } + +#if !_DECALSHADER + + void ChainModifyVertex(inout VertexData v, inout VertexToPixel v2p, float4 time) + { + ExtraV2F d; + + ZERO_INITIALIZE(ExtraV2F, d); + ZERO_INITIALIZE(Blackboard, d.blackboard); + // due to motion vectors in HDRP, we need to use the last + // time in certain spots. So if you are going to use _Time to adjust vertices, + // you need to use this time or motion vectors will break. + d.time = time; + + Ext_ModifyVertex0(v, d); + // Ext_ModifyVertex1(v, d); + // Ext_ModifyVertex2(v, d); + // Ext_ModifyVertex3(v, d); + // Ext_ModifyVertex4(v, d); + // Ext_ModifyVertex5(v, d); + // Ext_ModifyVertex6(v, d); + // Ext_ModifyVertex7(v, d); + // Ext_ModifyVertex8(v, d); + // Ext_ModifyVertex9(v, d); + // Ext_ModifyVertex10(v, d); + // Ext_ModifyVertex11(v, d); + // Ext_ModifyVertex12(v, d); + // Ext_ModifyVertex13(v, d); + // Ext_ModifyVertex14(v, d); + // Ext_ModifyVertex15(v, d); + // Ext_ModifyVertex16(v, d); + // Ext_ModifyVertex17(v, d); + // Ext_ModifyVertex18(v, d); + // Ext_ModifyVertex19(v, d); + // Ext_ModifyVertex20(v, d); + // Ext_ModifyVertex21(v, d); + // Ext_ModifyVertex22(v, d); + // Ext_ModifyVertex23(v, d); + // Ext_ModifyVertex24(v, d); + // Ext_ModifyVertex25(v, d); + // Ext_ModifyVertex26(v, d); + // Ext_ModifyVertex27(v, d); + // Ext_ModifyVertex28(v, d); + // Ext_ModifyVertex29(v, d); + + + // #if %EXTRAV2F0REQUIREKEY% + // v2p.extraV2F0 = d.extraV2F0; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // v2p.extraV2F1 = d.extraV2F1; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // v2p.extraV2F2 = d.extraV2F2; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // v2p.extraV2F3 = d.extraV2F3; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // v2p.extraV2F4 = d.extraV2F4; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // v2p.extraV2F5 = d.extraV2F5; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // v2p.extraV2F6 = d.extraV2F6; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // v2p.extraV2F7 = d.extraV2F7; + // #endif + } + + void ChainModifyTessellatedVertex(inout VertexData v, inout VertexToPixel v2p) + { + ExtraV2F d; + ZERO_INITIALIZE(ExtraV2F, d); + ZERO_INITIALIZE(Blackboard, d.blackboard); + + // #if %EXTRAV2F0REQUIREKEY% + // d.extraV2F0 = v2p.extraV2F0; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // d.extraV2F1 = v2p.extraV2F1; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // d.extraV2F2 = v2p.extraV2F2; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // d.extraV2F3 = v2p.extraV2F3; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // d.extraV2F4 = v2p.extraV2F4; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // d.extraV2F5 = v2p.extraV2F5; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // d.extraV2F6 = v2p.extraV2F6; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // d.extraV2F7 = v2p.extraV2F7; + // #endif + + + // Ext_ModifyTessellatedVertex0(v, d); + // Ext_ModifyTessellatedVertex1(v, d); + // Ext_ModifyTessellatedVertex2(v, d); + // Ext_ModifyTessellatedVertex3(v, d); + // Ext_ModifyTessellatedVertex4(v, d); + // Ext_ModifyTessellatedVertex5(v, d); + // Ext_ModifyTessellatedVertex6(v, d); + // Ext_ModifyTessellatedVertex7(v, d); + // Ext_ModifyTessellatedVertex8(v, d); + // Ext_ModifyTessellatedVertex9(v, d); + // Ext_ModifyTessellatedVertex10(v, d); + // Ext_ModifyTessellatedVertex11(v, d); + // Ext_ModifyTessellatedVertex12(v, d); + // Ext_ModifyTessellatedVertex13(v, d); + // Ext_ModifyTessellatedVertex14(v, d); + // Ext_ModifyTessellatedVertex15(v, d); + // Ext_ModifyTessellatedVertex16(v, d); + // Ext_ModifyTessellatedVertex17(v, d); + // Ext_ModifyTessellatedVertex18(v, d); + // Ext_ModifyTessellatedVertex19(v, d); + // Ext_ModifyTessellatedVertex20(v, d); + // Ext_ModifyTessellatedVertex21(v, d); + // Ext_ModifyTessellatedVertex22(v, d); + // Ext_ModifyTessellatedVertex23(v, d); + // Ext_ModifyTessellatedVertex24(v, d); + // Ext_ModifyTessellatedVertex25(v, d); + // Ext_ModifyTessellatedVertex26(v, d); + // Ext_ModifyTessellatedVertex27(v, d); + // Ext_ModifyTessellatedVertex28(v, d); + // Ext_ModifyTessellatedVertex29(v, d); + + // #if %EXTRAV2F0REQUIREKEY% + // v2p.extraV2F0 = d.extraV2F0; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // v2p.extraV2F1 = d.extraV2F1; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // v2p.extraV2F2 = d.extraV2F2; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // v2p.extraV2F3 = d.extraV2F3; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // v2p.extraV2F4 = d.extraV2F4; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // v2p.extraV2F5 = d.extraV2F5; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // v2p.extraV2F6 = d.extraV2F6; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // v2p.extraV2F7 = d.extraV2F7; + // #endif + } + + void ChainFinalColorForward(inout Surface l, inout ShaderData d, inout half4 color) + { + // Ext_FinalColorForward0(l, d, color); + // Ext_FinalColorForward1(l, d, color); + // Ext_FinalColorForward2(l, d, color); + // Ext_FinalColorForward3(l, d, color); + // Ext_FinalColorForward4(l, d, color); + // Ext_FinalColorForward5(l, d, color); + // Ext_FinalColorForward6(l, d, color); + // Ext_FinalColorForward7(l, d, color); + // Ext_FinalColorForward8(l, d, color); + // Ext_FinalColorForward9(l, d, color); + // Ext_FinalColorForward10(l, d, color); + // Ext_FinalColorForward11(l, d, color); + // Ext_FinalColorForward12(l, d, color); + // Ext_FinalColorForward13(l, d, color); + // Ext_FinalColorForward14(l, d, color); + // Ext_FinalColorForward15(l, d, color); + // Ext_FinalColorForward16(l, d, color); + // Ext_FinalColorForward17(l, d, color); + // Ext_FinalColorForward18(l, d, color); + // Ext_FinalColorForward19(l, d, color); + // Ext_FinalColorForward20(l, d, color); + // Ext_FinalColorForward21(l, d, color); + // Ext_FinalColorForward22(l, d, color); + // Ext_FinalColorForward23(l, d, color); + // Ext_FinalColorForward24(l, d, color); + // Ext_FinalColorForward25(l, d, color); + // Ext_FinalColorForward26(l, d, color); + // Ext_FinalColorForward27(l, d, color); + // Ext_FinalColorForward28(l, d, color); + // Ext_FinalColorForward29(l, d, color); + } + + void ChainFinalGBufferStandard(inout Surface s, inout ShaderData d, inout half4 GBuffer0, inout half4 GBuffer1, inout half4 GBuffer2, inout half4 outEmission, inout half4 outShadowMask) + { + // Ext_FinalGBufferStandard0(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard1(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard2(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard3(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard4(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard5(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard6(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard7(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard8(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard9(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard10(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard11(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard12(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard13(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard14(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard15(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard16(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard17(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard18(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard19(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard20(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard21(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard22(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard23(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard24(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard25(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard26(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard27(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard28(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard29(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + } +#endif + + + + + +#if _DECALSHADER + + ShaderData CreateShaderData(SurfaceDescriptionInputs IN) + { + ShaderData d = (ShaderData)0; + d.TBNMatrix = float3x3(IN.WorldSpaceTangent, IN.WorldSpaceBiTangent, IN.WorldSpaceNormal); + d.worldSpaceNormal = IN.WorldSpaceNormal; + d.worldSpaceTangent = IN.WorldSpaceTangent; + + d.worldSpacePosition = IN.WorldSpacePosition; + d.texcoord0 = IN.uv0.xyxy; + d.screenPos = IN.ScreenPosition; + + d.worldSpaceViewDir = normalize(_WorldSpaceCameraPos - d.worldSpacePosition); + + d.tangentSpaceViewDir = mul(d.TBNMatrix, d.worldSpaceViewDir); + + // these rarely get used, so we back transform them. Usually will be stripped. + #if _HDRP + // d.localSpacePosition = mul(GetWorldToObjectMatrix(), float4(GetCameraRelativePositionWS(d.worldSpacePosition), 1)).xyz; + #else + // d.localSpacePosition = mul(GetWorldToObjectMatrix(), float4(d.worldSpacePosition, 1)).xyz; + #endif + // d.localSpaceNormal = normalize(mul((float3x3)GetWorldToObjectMatrix(), d.worldSpaceNormal)); + // d.localSpaceTangent = normalize(mul((float3x3)GetWorldToObjectMatrix(), d.worldSpaceTangent.xyz)); + + // #if %SCREENPOSREQUIREKEY% + // d.screenUV = (IN.ScreenPosition.xy / max(0.01, IN.ScreenPosition.w)); + // #endif + + return d; + } +#else + + ShaderData CreateShaderData(VertexToPixel i + #if NEED_FACING + , bool facing + #endif + ) + { + ShaderData d = (ShaderData)0; + d.clipPos = i.pos; + d.worldSpacePosition = i.worldPos; + + d.worldSpaceNormal = normalize(i.worldNormal); + d.worldSpaceTangent.xyz = normalize(i.worldTangent.xyz); + + d.tangentSign = i.worldTangent.w * unity_WorldTransformParams.w; + float3 bitangent = cross(d.worldSpaceTangent.xyz, d.worldSpaceNormal) * d.tangentSign; + + d.TBNMatrix = float3x3(d.worldSpaceTangent, -bitangent, d.worldSpaceNormal); + d.worldSpaceViewDir = normalize(_WorldSpaceCameraPos - i.worldPos); + + d.tangentSpaceViewDir = mul(d.TBNMatrix, d.worldSpaceViewDir); + d.texcoord0 = i.texcoord0; + d.texcoord1 = i.texcoord1; + d.texcoord2 = i.texcoord2; + + // #if %TEXCOORD3REQUIREKEY% + d.texcoord3 = i.texcoord3; + // #endif + + // d.isFrontFace = facing; + // #if %VERTEXCOLORREQUIREKEY% + d.vertexColor = i.vertexColor; + // #endif + + // these rarely get used, so we back transform them. Usually will be stripped. + #if _HDRP + // d.localSpacePosition = mul(GetWorldToObjectMatrix(), float4(GetCameraRelativePositionWS(i.worldPos), 1)).xyz; + #else + // d.localSpacePosition = mul(GetWorldToObjectMatrix(), float4(i.worldPos, 1)).xyz; + #endif + // d.localSpaceNormal = normalize(mul((float3x3)GetWorldToObjectMatrix(), i.worldNormal)); + // d.localSpaceTangent = normalize(mul((float3x3)GetWorldToObjectMatrix(), i.worldTangent.xyz)); + + // #if %SCREENPOSREQUIREKEY% + // d.screenPos = i.screenPos; + // d.screenUV = (i.screenPos.xy / i.screenPos.w); + // #endif + + + // #if %EXTRAV2F0REQUIREKEY% + // d.extraV2F0 = i.extraV2F0; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // d.extraV2F1 = i.extraV2F1; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // d.extraV2F2 = i.extraV2F2; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // d.extraV2F3 = i.extraV2F3; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // d.extraV2F4 = i.extraV2F4; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // d.extraV2F5 = i.extraV2F5; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // d.extraV2F6 = i.extraV2F6; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // d.extraV2F7 = i.extraV2F7; + // #endif + + return d; + } + +#endif + + + +#if (SHADERPASS == SHADERPASS_LIGHT_TRANSPORT) + + // This was not in constant buffer in original unity, so keep outiside. But should be in as ShaderRenderPass frequency + float unity_OneOverOutputBoost; + float unity_MaxOutputValue; + + CBUFFER_START(UnityMetaPass) + // x = use uv1 as raster position + // y = use uv2 as raster position + bool4 unity_MetaVertexControl; + + // x = return albedo + // y = return normal + bool4 unity_MetaFragmentControl; + CBUFFER_END + + VertexToPixel Vert(VertexData inputMesh) + { + VertexToPixel output; + ZERO_INITIALIZE(VertexToPixel, output); + UNITY_SETUP_INSTANCE_ID(inputMesh); + UNITY_TRANSFER_INSTANCE_ID(inputMesh, output); + UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(output); + + // Output UV coordinate in vertex shader + float2 uv = float2(0.0, 0.0); + + if (unity_MetaVertexControl.x) + { + uv = inputMesh.texcoord1.xy * unity_LightmapST.xy + unity_LightmapST.zw; + } + else if (unity_MetaVertexControl.y) + { + uv = inputMesh.texcoord2.xy * unity_DynamicLightmapST.xy + unity_DynamicLightmapST.zw; + } + + // OpenGL right now needs to actually use the incoming vertex position + // so we create a fake dependency on it here that haven't any impact. + output.pos = float4(uv * 2.0 - 1.0, inputMesh.vertex.z > 0 ? 1.0e-4 : 0.0, 1.0); + + output.worldPos = TransformObjectToWorld(inputMesh.vertex.xyz).xyz; + + // Normal is required for triplanar mapping + output.worldNormal = TransformObjectToWorldNormal(inputMesh.normal); + // Not required but assign to silent compiler warning + output.worldTangent = float4(1.0, 0.0, 0.0, 0.0); + + output.texcoord0 = inputMesh.texcoord0; + output.texcoord1 = inputMesh.texcoord1; + output.texcoord2 = inputMesh.texcoord2; + // #if %TEXCOORD3REQUIREKEY% + output.texcoord3 = inputMesh.texcoord3; + // #endif + // #if %VERTEXCOLORREQUIREKEY% + output.vertexColor = inputMesh.vertexColor; + // #endif + + return output; + } +#else + + #if (_PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR))) + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/ShaderVariablesMatrixDefsHDCamera.hlsl" + + void MotionVectorPositionZBias(VertexToPixel input) + { + #if UNITY_REVERSED_Z + input.pos.z -= unity_MotionVectorsParams.z * input.pos.w; + #else + input.pos.z += unity_MotionVectorsParams.z * input.pos.w; + #endif + } + + #endif + + VertexToPixel Vert(VertexData input) + { + VertexToPixel output; + ZERO_INITIALIZE(VertexToPixel, output); + + UNITY_SETUP_INSTANCE_ID(input); + UNITY_TRANSFER_INSTANCE_ID(input, output); + UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(output); + + #if _HDRP && (_PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR))) + VertexData previousMesh = input; + #endif + + ChainModifyVertex(input, output, _Time); + + // This return the camera relative position (if enable) + float3 positionRWS = TransformObjectToWorld(input.vertex.xyz); + float3 normalWS = TransformObjectToWorldNormal(input.normal); + float4 tangentWS = float4(TransformObjectToWorldDir(input.tangent.xyz), input.tangent.w); + + + output.worldPos = GetAbsolutePositionWS(positionRWS); + output.pos = TransformWorldToHClip(positionRWS); + output.worldNormal = normalWS; + output.worldTangent = tangentWS; + + + output.texcoord0 = input.texcoord0; + output.texcoord1 = input.texcoord1; + output.texcoord2 = input.texcoord2; + + // #if %TEXCOORD3REQUIREKEY% + output.texcoord3 = input.texcoord3; + // #endif + + // #if %VERTEXCOLORREQUIREKEY% + output.vertexColor = input.vertexColor; + // #endif + + // #if %SCREENPOSREQUIREKEY% + // output.screenPos = ComputeScreenPos(output.pos, _ProjectionParams.x); + // #endif + + #if _HDRP && (_PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR))) + + #if !defined(TESSELLATION_ON) + MotionVectorPositionZBias(output); + #endif + + output.motionVectorCS = mul(UNITY_MATRIX_UNJITTERED_VP, float4(positionRWS.xyz, 1.0)); + // Note: unity_MotionVectorsParams.y is 0 is forceNoMotion is enabled + bool forceNoMotion = unity_MotionVectorsParams.y == 0.0; + if (forceNoMotion) + { + output.previousPositionCS = float4(0.0, 0.0, 0.0, 1.0); + } + else + { + bool hasDeformation = unity_MotionVectorsParams.x > 0.0; // Skin or morph target + + float3 effectivePositionOS = (hasDeformation ? previousMesh.previousPositionOS : previousMesh.vertex.xyz); + #if defined(_ADD_PRECOMPUTED_VELOCITY) + effectivePositionOS -= input.precomputedVelocity; + #endif + + previousMesh.vertex = float4(effectivePositionOS, 1); + VertexToPixel dummy = (VertexToPixel)0; + + + ChainModifyVertex(previousMesh, dummy, _LastTimeParameters); + + // we might need this for skinned objects? + //float3 normalWS = TransformPreviousObjectToWorldNormal(input.normal).xyz; + float3 previousPositionRWS = TransformPreviousObjectToWorld(previousMesh.vertex.xyz); + + #ifdef _WRITE_TRANSPARENT_MOTION_VECTOR + if (_TransparentCameraOnlyMotionVectors > 0) + { + previousPositionRWS = positionRWS.xyz; + } + #endif // _WRITE_TRANSPARENT_MOTION_VECTOR + + output.previousPositionCS = mul(UNITY_MATRIX_PREV_VP, float4(previousPositionRWS, 1.0)); + } + #endif // _HDRP && _PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR)) + + + return output; + } + + +#endif + + + + + + + + #if defined(WRITE_DECAL_BUFFER) && !defined(_DISABLE_DECALS) + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/Decal/DecalPrepassBuffer.hlsl" + #endif + + FragInputs BuildFragInputs(VertexToPixel input) + { + UNITY_SETUP_INSTANCE_ID(input); + FragInputs output; + ZERO_INITIALIZE(FragInputs, output); + + // Init to some default value to make the computer quiet (else it output 'divide by zero' warning even if value is not used). + // TODO: this is a really poor workaround, but the variable is used in a bunch of places + // to compute normals which are then passed on elsewhere to compute other values... + output.tangentToWorld = k_identity3x3; + output.positionSS = input.pos; // input.positionCS is SV_Position + // BETTER SHADERS: because we transform world position into actual world space for things like + // triplanar, etc, we have to back transform it here for lighting + output.positionRWS = GetCameraRelativePositionWS(input.worldPos); + output.tangentToWorld = BuildTangentToWorld(input.worldTangent, input.worldNormal); + output.texCoord0 = input.texcoord0; + output.texCoord1 = input.texcoord1; + output.texCoord2 = input.texcoord2; + + return output; + } + + void BuildSurfaceData(FragInputs fragInputs, inout Surface surfaceDescription, float3 V, PositionInputs posInput, out SurfaceData surfaceData, out float3 bentNormalWS) + { + // setup defaults -- these are used if the graph doesn't output a value + ZERO_INITIALIZE(SurfaceData, surfaceData); + + // specularOcclusion need to be init ahead of decal to quiet the compiler that modify the SurfaceData struct + // however specularOcclusion can come from the graph, so need to be init here so it can be override. + surfaceData.specularOcclusion = 1.0; + + // copy across graph values, if defined + surfaceData.baseColor = surfaceDescription.Albedo; + surfaceData.perceptualSmoothness = surfaceDescription.Smoothness; + surfaceData.ambientOcclusion = surfaceDescription.Occlusion; + surfaceData.specularOcclusion = surfaceDescription.SpecularOcclusion; + surfaceData.metallic = surfaceDescription.Metallic; + surfaceData.subsurfaceMask = surfaceDescription.SubsurfaceMask; + surfaceData.thickness = surfaceDescription.Thickness; + surfaceData.diffusionProfileHash = asuint(surfaceDescription.DiffusionProfileHash); + #if _USESPECULAR + surfaceData.specularColor = surfaceDescription.Specular; + #endif + surfaceData.coatMask = surfaceDescription.CoatMask; + surfaceData.anisotropy = surfaceDescription.Anisotropy; + surfaceData.iridescenceMask = surfaceDescription.IridescenceMask; + surfaceData.iridescenceThickness = surfaceDescription.IridescenceThickness; + + + + #if defined(_REFRACTION_PLANE) || defined(_REFRACTION_SPHERE) || defined(_REFRACTION_THIN) + if (_EnableSSRefraction) + { + surfaceData.transmittanceMask = (1.0 - surfaceDescription.Alpha); + surfaceDescription.Alpha = 1.0; + } + else + { + surfaceData.ior = surfaceDescription.ior; + surfaceData.transmittanceColor = surfaceDescription.transmittanceColor; + surfaceData.atDistance = surfaceDescription.atDistance; + surfaceData.transmittanceMask = surfaceDescription.transmittanceMask; + surfaceDescription.Alpha = 1.0; + } + #else + surfaceData.ior = 1.0; + surfaceData.transmittanceColor = float3(1.0, 1.0, 1.0); + surfaceData.atDistance = 1.0; + surfaceData.transmittanceMask = 0.0; + #endif + + + + // These static material feature allow compile time optimization + surfaceData.materialFeatures = MATERIALFEATUREFLAGS_LIT_STANDARD; + #ifdef _MATERIAL_FEATURE_SUBSURFACE_SCATTERING + surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_SUBSURFACE_SCATTERING; + #endif + + #ifdef _MATERIAL_FEATURE_TRANSMISSION + surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_TRANSMISSION; + #endif + + #ifdef _MATERIAL_FEATURE_ANISOTROPY + surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_ANISOTROPY; + surfaceData.normalWS = float3(0, 1, 0); + #endif + + #ifdef _MATERIAL_FEATURE_IRIDESCENCE + surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_IRIDESCENCE; + #endif + + #ifdef _MATERIAL_FEATURE_SPECULAR_COLOR + surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_SPECULAR_COLOR; + #endif + + #if defined(_MATERIAL_FEATURE_CLEAR_COAT) || _CLEARCOAT + surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_CLEAR_COAT; + #endif + + #if defined (_MATERIAL_FEATURE_SPECULAR_COLOR) && defined (_ENERGY_CONSERVING_SPECULAR) + // Require to have setup baseColor + // Reproduce the energy conservation done in legacy Unity. Not ideal but better for compatibility and users can unchek it + surfaceData.baseColor *= (1.0 - Max3(surfaceData.specularColor.r, surfaceData.specularColor.g, surfaceData.specularColor.b)); + #endif + + + + // compute world space normal + #if !_WORLDSPACENORMAL + surfaceData.normalWS = mul(surfaceDescription.Normal, fragInputs.tangentToWorld); + #else + surfaceData.normalWS = surfaceDescription.Normal; + #endif + + surfaceData.geomNormalWS = fragInputs.tangentToWorld[2]; + + surfaceData.tangentWS = normalize(fragInputs.tangentToWorld[0].xyz); // The tangent is not normalize in tangentToWorld for mikkt. TODO: Check if it expected that we normalize with Morten. Tag: SURFACE_GRADIENT + + + #if HAVE_DECALS + if (_EnableDecals) + { + float alpha = 1.0; + alpha = surfaceDescription.Alpha; + + // Both uses and modifies 'surfaceData.normalWS'. + DecalSurfaceData decalSurfaceData = GetDecalSurfaceData(posInput, fragInputs.tangentToWorld[2], alpha); + ApplyDecalToSurfaceData(decalSurfaceData, fragInputs.tangentToWorld[2], surfaceData); + } + #endif + + bentNormalWS = surfaceData.normalWS; + + surfaceData.tangentWS = Orthonormalize(surfaceData.tangentWS, surfaceData.normalWS); + + #ifdef DEBUG_DISPLAY + if (_DebugMipMapMode != DEBUGMIPMAPMODE_NONE) + { + // TODO: need to update mip info + surfaceData.metallic = 0; + } + + // We need to call ApplyDebugToSurfaceData after filling the surfarcedata and before filling builtinData + // as it can modify attribute use for static lighting + ApplyDebugToSurfaceData(fragInputs.tangentToWorld, surfaceData); + #endif + + // By default we use the ambient occlusion with Tri-ace trick (apply outside) for specular occlusion. + // If user provide bent normal then we process a better term + #if defined(_SPECULAR_OCCLUSION_CUSTOM) + // Just use the value passed through via the slot (not active otherwise) + #elif defined(_SPECULAR_OCCLUSION_FROM_AO_BENT_NORMAL) + // If we have bent normal and ambient occlusion, process a specular occlusion + surfaceData.specularOcclusion = GetSpecularOcclusionFromBentAO(V, bentNormalWS, surfaceData.normalWS, surfaceData.ambientOcclusion, PerceptualSmoothnessToPerceptualRoughness(surfaceData.perceptualSmoothness)); + #elif defined(_AMBIENT_OCCLUSION) && defined(_SPECULAR_OCCLUSION_FROM_AO) + surfaceData.specularOcclusion = GetSpecularOcclusionFromAmbientOcclusion(ClampNdotV(dot(surfaceData.normalWS, V)), surfaceData.ambientOcclusion, PerceptualSmoothnessToRoughness(surfaceData.perceptualSmoothness)); + #endif + + #if defined(_ENABLE_GEOMETRIC_SPECULAR_AA) && !defined(SHADER_STAGE_RAY_TRACING) + surfaceData.perceptualSmoothness = GeometricNormalFiltering(surfaceData.perceptualSmoothness, fragInputs.tangentToWorld[2], surfaceDescription.SpecularAAScreenSpaceVariance, surfaceDescription.SpecularAAThreshold); + #endif + } + + void GetSurfaceAndBuiltinData(VertexToPixel m2ps, FragInputs fragInputs, float3 V, inout PositionInputs posInput, + out SurfaceData surfaceData, out BuiltinData builtinData, inout Surface l, inout ShaderData d + #if NEED_FACING + , bool facing + #endif + ) + { + // Removed since crossfade does not work, probably needs extra material setup. + //#if !defined(SHADER_STAGE_RAY_TRACING) && !defined(_TESSELLATION_DISPLACEMENT) + // #ifdef LOD_FADE_CROSSFADE // enable dithering LOD transition if user select CrossFade transition in LOD group + // LODDitheringTransition(ComputeFadeMaskSeed(V, posInput.positionSS), unity_LODFade.x); + // #endif + //#endif + + d = CreateShaderData(m2ps + #if NEED_FACING + , facing + #endif + ); + + l = (Surface)0; + + l.Albedo = half3(0.5, 0.5, 0.5); + l.Normal = float3(0,0,1); + l.Occlusion = 1; + l.Alpha = 1; + l.SpecularOcclusion = 1; + + #if !defined(SHADER_STAGE_RAY_TRACING) && defined(_DEPTHOFFSET_ON) + l.outputDepth = d.clipPos.z; + #endif + + ChainSurfaceFunction(l, d); + + #if !defined(SHADER_STAGE_RAY_TRACING) && defined(_DEPTHOFFSET_ON) + //posInput.deviceDepth = l.outputDepth; + #endif + + #if _UNLIT + //l.Emission = l.Albedo; + //l.Albedo = 0; + l.Normal = half3(0,0,1); + l.Occlusion = 1; + l.Metallic = 0; + l.Specular = 0; + #endif + + surfaceData.geomNormalWS = d.worldSpaceNormal; + surfaceData.tangentWS = d.worldSpaceTangent; + fragInputs.tangentToWorld = d.TBNMatrix; + + float3 bentNormalWS; + BuildSurfaceData(fragInputs, l, V, posInput, surfaceData, bentNormalWS); + + + InitBuiltinData(posInput, l.Alpha, bentNormalWS, -d.worldSpaceNormal, fragInputs.texCoord1, fragInputs.texCoord2, builtinData); + + + + builtinData.emissiveColor = l.Emission; + + #if defined(_OVERRIDE_BAKEDGI) + builtinData.bakeDiffuseLighting = l.DiffuseGI; + builtinData.backBakeDiffuseLighting = l.BackDiffuseGI; + builtinData.emissiveColor += l.SpecularGI; + #endif + + #if defined(_OVERRIDE_SHADOWMASK) + builtinData.shadowMask0 = l.ShadowMask.x; + builtinData.shadowMask1 = l.ShadowMask.y; + builtinData.shadowMask2 = l.ShadowMask.z; + builtinData.shadowMask3 = l.ShadowMask.w; + #endif + + #if defined(UNITY_VIRTUAL_TEXTURING) + builtinData.vtPackedFeedback = surfaceData.VTPackedFeedback; + #endif + + #if (SHADERPASS == SHADERPASS_DISTORTION) + builtinData.distortion = surfaceData.Distortion; + builtinData.distortionBlur = surfaceData.DistortionBlur; + #endif + + #ifndef SHADER_UNLIT + // PostInitBuiltinData call ApplyDebugToBuiltinData + PostInitBuiltinData(V, posInput, surfaceData, builtinData); + #else + ApplyDebugToBuiltinData(builtinData); + #endif + + RAY_TRACING_OPTIONAL_ALPHA_TEST_PASS + } + + + + #ifdef UNITY_VIRTUAL_TEXTURING + #define VT_BUFFER_TARGET SV_Target1 + #define EXTRA_BUFFER_TARGET SV_Target2 + #else + #define EXTRA_BUFFER_TARGET SV_Target1 + #endif + + + + + void Frag(VertexToPixel v2p, + #ifdef OUTPUT_SPLIT_LIGHTING + out float4 outColor : SV_Target0, // outSpecularLighting + #ifdef UNITY_VIRTUAL_TEXTURING + out float4 outVTFeedback : VT_BUFFER_TARGET, + #endif + out float4 outDiffuseLighting : EXTRA_BUFFER_TARGET, + OUTPUT_SSSBUFFER(outSSSBuffer) + #else + out float4 outColor : SV_Target0 + #ifdef UNITY_VIRTUAL_TEXTURING + ,out float4 outVTFeedback : VT_BUFFER_TARGET + #endif + #ifdef _WRITE_TRANSPARENT_MOTION_VECTOR + , out float4 outMotionVec : EXTRA_BUFFER_TARGET + #endif // _WRITE_TRANSPARENT_MOTION_VECTOR + #endif // OUTPUT_SPLIT_LIGHTING + #ifdef _DEPTHOFFSET_ON + , out float outputDepth : SV_Depth + #endif + #if NEED_FACING + , bool facing : SV_IsFrontFace + #endif + ) + { + #ifdef _WRITE_TRANSPARENT_MOTION_VECTOR + // Init outMotionVector here to solve compiler warning (potentially unitialized variable) + // It is init to the value of forceNoMotion (with 2.0) + outMotionVec = float4(2.0, 0.0, 0.0, 0.0); + #endif + + UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX(v2p); + FragInputs input = BuildFragInputs(v2p); + + // We need to readapt the SS position as our screen space positions are for a low res buffer, but we try to access a full res buffer. + input.positionSS.xy = _OffScreenRendering > 0 ? (input.positionSS.xy * _OffScreenDownsampleFactor) : input.positionSS.xy; + + uint2 tileIndex = uint2(input.positionSS.xy) / GetTileSize(); + + // input.positionSS is SV_Position + PositionInputs posInput = GetPositionInput(input.positionSS.xy, _ScreenSize.zw, input.positionSS.z, input.positionSS.w, input.positionRWS.xyz, tileIndex); + + + float3 V = GetWorldSpaceNormalizeViewDir(input.positionRWS); + + + SurfaceData surfaceData; + BuiltinData builtinData; + Surface l; + ShaderData d; + GetSurfaceAndBuiltinData(v2p, input, V, posInput, surfaceData, builtinData, l, d + #if NEED_FACING + , facing + #endif + ); + + + BSDFData bsdfData = ConvertSurfaceDataToBSDFData(input.positionSS.xy, surfaceData); + + PreLightData preLightData = GetPreLightData(V, posInput, bsdfData); + + outColor = float4(0.0, 0.0, 0.0, 0.0); + + // We need to skip lighting when doing debug pass because the debug pass is done before lighting so some buffers may not be properly initialized potentially causing crashes on PS4. + + #ifdef DEBUG_DISPLAY + // Init in debug display mode to quiet warning + #ifdef OUTPUT_SPLIT_LIGHTING + outDiffuseLighting = 0; + ENCODE_INTO_SSSBUFFER(surfaceData, posInput.positionSS, outSSSBuffer); + #endif + + + + // Same code in ShaderPassForwardUnlit.shader + // Reminder: _DebugViewMaterialArray[i] + // i==0 -> the size used in the buffer + // i>0 -> the index used (0 value means nothing) + // The index stored in this buffer could either be + // - a gBufferIndex (always stored in _DebugViewMaterialArray[1] as only one supported) + // - a property index which is different for each kind of material even if reflecting the same thing (see MaterialSharedProperty) + bool viewMaterial = false; + int bufferSize = _DebugViewMaterialArray[0].x; + if (bufferSize != 0) + { + bool needLinearToSRGB = false; + float3 result = float3(1.0, 0.0, 1.0); + + // Loop through the whole buffer + // Works because GetSurfaceDataDebug will do nothing if the index is not a known one + for (int index = 1; index <= bufferSize; index++) + { + int indexMaterialProperty = _DebugViewMaterialArray[index].x; + + // skip if not really in use + if (indexMaterialProperty != 0) + { + viewMaterial = true; + + GetPropertiesDataDebug(indexMaterialProperty, result, needLinearToSRGB); + GetVaryingsDataDebug(indexMaterialProperty, input, result, needLinearToSRGB); + GetBuiltinDataDebug(indexMaterialProperty, builtinData, posInput, result, needLinearToSRGB); + GetSurfaceDataDebug(indexMaterialProperty, surfaceData, result, needLinearToSRGB); + GetBSDFDataDebug(indexMaterialProperty, bsdfData, result, needLinearToSRGB); + } + } + + // TEMP! + // For now, the final blit in the backbuffer performs an sRGB write + // So in the meantime we apply the inverse transform to linear data to compensate. + if (!needLinearToSRGB) + result = SRGBToLinear(max(0, result)); + + outColor = float4(result, 1.0); + } + + if (!viewMaterial) + { + if (_DebugFullScreenMode == FULLSCREENDEBUGMODE_VALIDATE_DIFFUSE_COLOR || _DebugFullScreenMode == FULLSCREENDEBUGMODE_VALIDATE_SPECULAR_COLOR) + { + float3 result = float3(0.0, 0.0, 0.0); + + GetPBRValidatorDebug(surfaceData, result); + + outColor = float4(result, 1.0f); + } + else if (_DebugFullScreenMode == FULLSCREENDEBUGMODE_TRANSPARENCY_OVERDRAW) + { + float4 result = _DebugTransparencyOverdrawWeight * float4(TRANSPARENCY_OVERDRAW_COST, TRANSPARENCY_OVERDRAW_COST, TRANSPARENCY_OVERDRAW_COST, TRANSPARENCY_OVERDRAW_A); + outColor = result; + } + else + #endif + { + #ifdef _SURFACE_TYPE_TRANSPARENT + uint featureFlags = LIGHT_FEATURE_MASK_FLAGS_TRANSPARENT; + #else + uint featureFlags = LIGHT_FEATURE_MASK_FLAGS_OPAQUE; + #endif + + LightLoopOutput lightLoopOutput; + LightLoop(V, posInput, preLightData, bsdfData, builtinData, featureFlags, lightLoopOutput); + + float3 diffuseLighting = lightLoopOutput.diffuseLighting; + float3 specularLighting = lightLoopOutput.specularLighting; + + diffuseLighting *= GetCurrentExposureMultiplier(); + specularLighting *= GetCurrentExposureMultiplier(); + + #ifdef OUTPUT_SPLIT_LIGHTING + if (_EnableSubsurfaceScattering != 0 && ShouldOutputSplitLighting(bsdfData)) + { + outColor = float4(specularLighting, 1.0); + outDiffuseLighting = float4(TagLightingForSSS(diffuseLighting), 1.0); + } + else + { + outColor = float4(diffuseLighting + specularLighting, 1.0); + outDiffuseLighting = 0; + } + ENCODE_INTO_SSSBUFFER(surfaceData, posInput.positionSS, outSSSBuffer); + #else + outColor = ApplyBlendMode(diffuseLighting, specularLighting, builtinData.opacity); + outColor = EvaluateAtmosphericScattering(posInput, V, outColor); + #endif + + ChainFinalColorForward(l, d, outColor); + + #ifdef _WRITE_TRANSPARENT_MOTION_VECTOR + bool forceNoMotion = any(unity_MotionVectorsParams.yw == 0.0); + // outMotionVec is already initialize at the value of forceNoMotion (see above) + if (!forceNoMotion) + { + float2 motionVec = CalculateMotionVector(v2p.motionVectorCS, v2p.previousPositionCS); + EncodeMotionVector(motionVec * 0.5, outMotionVec); + outMotionVec.zw = 1.0; + } + #endif + } + + #ifdef DEBUG_DISPLAY + } + #endif + + #ifdef _DEPTHOFFSET_ON + outputDepth = l.outputDepth; + #endif + + #ifdef UNITY_VIRTUAL_TEXTURING + outVTFeedback = builtinData.vtPackedFeedback; + #endif + } + + ENDHLSL + } + Pass + { + // based on HDLitPass.template + Name "GBuffer" + Tags { "LightMode" = "GBuffer" } + //------------------------------------------------------------------------------------- + // Render Modes (Blend, Cull, ZTest, Stencil, etc) + //------------------------------------------------------------------------------------- + + Cull Back + ZTest [_ZTestGBuffer] + Stencil + { + WriteMask [_StencilWriteMaskGBuffer] + Ref [_StencilRefGBuffer] + CompFront Always + PassFront Replace + CompBack Always + PassBack Replace + } + + Tags { "RenderType" = "Opaque" "Queue" = "Geometry" "PreviewType" = "Plane" } + Cull [_CullingOption] + ZWrite [_ZWrite] + ZTest [_ZTestMode] + + + //------------------------------------------------------------------------------------- + // End Render Modes + //------------------------------------------------------------------------------------- + + HLSLPROGRAM + + #pragma target 4.5 + #pragma only_renderers d3d11 playstation xboxone xboxseries vulkan metal switch + #pragma multi_compile_instancing + #pragma multi_compile _ DOTS_INSTANCING_ON + #pragma instancing_options renderinglayer + + + #pragma multi_compile _ LIGHT_LAYERS + #pragma multi_compile_raytracing _ LIGHT_LAYERS + //#pragma shader_feature _ _SURFACE_TYPE_TRANSPARENT + //#pragma shader_feature_local _BLENDMODE_OFF _BLENDMODE_ALPHA _BLENDMODE_ADD _BLENDMODE_PRE_MULTIPLY + //#pragma shader_feature_local _ _ADD_PRECOMPUTED_VELOCITY + //#pragma shader_feature_local _ _TRANSPARENT_WRITES_MOTION_VEC + //#pragma shader_feature_local _ _ENABLE_FOG_ON_TRANSPARENT + #pragma multi_compile _ DEBUG_DISPLAY + //#pragma shader_feature_local _ _DISABLE_DECALS + //#pragma shader_feature_local _ _DISABLE_SSR + //#pragma shader_feature_local _ _DISABLE_SSR_TRANSPARENT + #pragma multi_compile _ LIGHTMAP_ON + #pragma multi_compile _ DIRLIGHTMAP_COMBINED + #pragma multi_compile_fragment PROBE_VOLUMES_OFF PROBE_VOLUMES_L1 PROBE_VOLUMES_L2 + #pragma multi_compile_raytracing PROBE_VOLUMES_OFF PROBE_VOLUMES_L1 PROBE_VOLUMES_L2 + #pragma multi_compile _ DYNAMICLIGHTMAP_ON + #pragma multi_compile_fragment _ SHADOWS_SHADOWMASK + #pragma multi_compile_raytracing _ SHADOWS_SHADOWMASK + #pragma multi_compile_fragment DECALS_OFF DECALS_3RT DECALS_4RT + #pragma multi_compile_fragment _ DECAL_SURFACE_GRADIENT + + //#pragma shader_feature_local _REFRACTION_OFF _REFRACTION_PLANE _REFRACTION_SPHERE _REFRACTION_THIN + + + //------------------------------------------------------------------------------------- + // Variant Definitions (active field translations to HDRP defines) + //------------------------------------------------------------------------------------- + // #define _MATERIAL_FEATURE_SUBSURFACE_SCATTERING 1 + // #define _MATERIAL_FEATURE_TRANSMISSION 1 + // #define _MATERIAL_FEATURE_ANISOTROPY 1 + // #define _MATERIAL_FEATURE_IRIDESCENCE 1 + // #define _MATERIAL_FEATURE_SPECULAR_COLOR 1 + #define _ENABLE_FOG_ON_TRANSPARENT 1 + // #define _AMBIENT_OCCLUSION 1 + // #define _SPECULAR_OCCLUSION_FROM_AO 1 + // #define _SPECULAR_OCCLUSION_FROM_AO_BENT_NORMAL 1 + // #define _SPECULAR_OCCLUSION_CUSTOM 1 + // #define _ENERGY_CONSERVING_SPECULAR 1 + // #define _ENABLE_GEOMETRIC_SPECULAR_AA 1 + // #define _HAS_REFRACTION 1 + // #define _REFRACTION_PLANE 1 + // #define _REFRACTION_SPHERE 1 + // #define _DISABLE_DECALS 1 + // #define _DISABLE_SSR 1 + // #define _ADD_PRECOMPUTED_VELOCITY + // #define _WRITE_TRANSPARENT_MOTION_VECTOR 1 + // #define _DEPTHOFFSET_ON 1 + // #define _BLENDMODE_PRESERVE_SPECULAR_LIGHTING 1 + + #define SHADERPASS SHADERPASS_GBUFFER + #define RAYTRACING_SHADER_GRAPH_DEFAULT + #define _PASSGBUFFER 1 + + + #pragma shader_feature_local GLOW_ON + #pragma shader_feature_local FADE_ON + #pragma shader_feature_local OUTBASE_ON + #pragma shader_feature_local ONLYOUTLINE_ON + #pragma shader_feature_local GRADIENT_ON + #pragma shader_feature_local GRADIENT2COL_ON + #pragma shader_feature_local RADIALGRADIENT_ON + #pragma shader_feature_local COLORSWAP_ON + #pragma shader_feature_local HSV_ON + #pragma shader_feature_local CHANGECOLOR_ON + #pragma shader_feature_local CHANGECOLOR2_ON + #pragma shader_feature_local CHANGECOLOR3_ON + #pragma shader_feature_local COLORRAMP_ON + #pragma shader_feature_local GRADIENTCOLORRAMP_ON + #pragma shader_feature_local HITEFFECT_ON + #pragma shader_feature_local NEGATIVE_ON + #pragma shader_feature_local PIXELATE_ON + #pragma shader_feature_local GREYSCALE_ON + #pragma shader_feature_local POSTERIZE_ON + #pragma shader_feature_local BLUR_ON + #pragma shader_feature_local MOTIONBLUR_ON + #pragma shader_feature_local GHOST_ON + #pragma shader_feature_local ALPHAOUTLINE_ON + #pragma shader_feature_local INNEROUTLINE_ON + #pragma shader_feature_local ONLYINNEROUTLINE_ON + #pragma shader_feature_local HOLOGRAM_ON + #pragma shader_feature_local CHROMABERR_ON + #pragma shader_feature_local GLITCH_ON + #pragma shader_feature_local FLICKER_ON + #pragma shader_feature_local SHADOW_ON + #pragma shader_feature_local SHINE_ON + #pragma shader_feature_local CONTRAST_ON + #pragma shader_feature_local OVERLAY_ON + #pragma shader_feature_local OVERLAYMULT_ON + #pragma shader_feature_local DOODLE_ON + #pragma shader_feature_local WIND_ON + #pragma shader_feature_local WAVEUV_ON + #pragma shader_feature_local ROUNDWAVEUV_ON + #pragma shader_feature_local RECTSIZE_ON + #pragma shader_feature_local OFFSETUV_ON + #pragma shader_feature_local CLIPPING_ON + #pragma shader_feature_local RADIALCLIPPING_ON + #pragma shader_feature_local TEXTURESCROLL_ON + #pragma shader_feature_local ZOOMUV_ON + #pragma shader_feature_local DISTORT_ON + #pragma shader_feature_local WARP_ON + #pragma shader_feature_local TWISTUV_ON + #pragma shader_feature_local ROTATEUV_ON + #pragma shader_feature_local POLARUV_ON + #pragma shader_feature_local FISHEYE_ON + #pragma shader_feature_local PINCH_ON + #pragma shader_feature_local SHAKEUV_ON + + #pragma shader_feature_local GLOWTEX_ON + #pragma shader_feature_local OUTTEX_ON + #pragma shader_feature_local OUTDIST_ON + #pragma shader_feature_local OUTBASE8DIR_ON + #pragma shader_feature_local OUTBASEPIXELPERF_ON + #pragma shader_feature_local COLORRAMPOUTLINE_ON + #pragma shader_feature_local GREYSCALEOUTLINE_ON + #pragma shader_feature_local POSTERIZEOUTLINE_ON + #pragma shader_feature_local BLURISHD_ON + #pragma shader_feature_local MANUALWIND_ON + #pragma shader_feature_local ATLAS_ON + #pragma shader_feature_local PREMULTIPLYALPHA_ON + + #pragma shader_feature BILBOARD_ON + #pragma shader_feature BILBOARDY_ON + + #pragma shader_feature NORMALMAP_ON + + + #define _HDRP 1 +#define _USINGTEXCOORD1 1 +#define _USINGTEXCOORD2 1 + + + #pragma vertex Vert + #pragma fragment Frag + + + //------------------------------------------------------------------------------------- + // Defines + //------------------------------------------------------------------------------------- + + + + + // useful conversion functions to make surface shader code just work + + #define UNITY_DECLARE_TEX2D(name) TEXTURE2D(name); SAMPLER(sampler##name); + #define UNITY_DECLARE_TEX2D_NOSAMPLER(name) TEXTURE2D(name); + #define UNITY_DECLARE_TEX2DARRAY(name) TEXTURE2D_ARRAY(name); SAMPLER(sampler##name); + #define UNITY_DECLARE_TEX2DARRAY_NOSAMPLER(tex) TEXTURE2D_ARRAY(tex); + + #define UNITY_SAMPLE_TEX2DARRAY(tex,coord) SAMPLE_TEXTURE2D_ARRAY(tex, sampler##tex, coord.xy, coord.z) + #define UNITY_SAMPLE_TEX2DARRAY_LOD(tex,coord,lod) SAMPLE_TEXTURE2D_ARRAY_LOD(tex, sampler##tex, coord.xy, coord.z, lod) + #define UNITY_SAMPLE_TEX2D(tex, coord) SAMPLE_TEXTURE2D(tex, sampler##tex, coord) + #define UNITY_SAMPLE_TEX2D_SAMPLER(tex, samp, coord) SAMPLE_TEXTURE2D(tex, sampler##samp, coord) + + #define UNITY_SAMPLE_TEX2D_LOD(tex,coord, lod) SAMPLE_TEXTURE2D_LOD(tex, sampler_##tex, coord, lod) + #define UNITY_SAMPLE_TEX2D_SAMPLER_LOD(tex,samplertex,coord, lod) SAMPLE_TEXTURE2D_LOD (tex, sampler##samplertex,coord, lod) + + #if defined(UNITY_COMPILER_HLSL) + #define UNITY_INITIALIZE_OUTPUT(type,name) name = (type)0; + #else + #define UNITY_INITIALIZE_OUTPUT(type,name) + #endif + + #define sampler2D_float sampler2D + #define sampler2D_half sampler2D + + #undef WorldNormalVector + #define WorldNormalVector(data, normal) mul(normal, data.TBNMatrix) + + #define UnityObjectToWorldNormal(normal) mul(GetObjectToWorldMatrix(), normal) + + + + +// HDRP Adapter stuff + #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Common.hlsl" + #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Texture.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/ShaderVariables.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/ShaderPass/FragInputs.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/ShaderPass/ShaderPass.cs.hlsl" + #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/TextureStack.hlsl" // Required to be include before we include properties as it define DECLARE_STACK_CB +#if UNITY_VERSION >= UNITY_2021_3_31 + #include "Packages/com.unity.shadergraph/ShaderGraphLibrary/Functions.hlsl" // Need to be here for Gradient struct definition +#else + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/ShaderGraphHeader.hlsl" +#endif + #ifdef RAYTRACING_SHADER_GRAPH_DEFAULT + #define RAYTRACING_SHADER_GRAPH_HIGH + #endif + + #ifdef RAYTRACING_SHADER_GRAPH_RAYTRACED + #define RAYTRACING_SHADER_GRAPH_LOW + #endif + // end + + + + + // If we use subsurface scattering, enable output split lighting (for forward pass) + #if defined(_MATERIAL_FEATURE_SUBSURFACE_SCATTERING) && !defined(_SURFACE_TYPE_TRANSPARENT) + #define OUTPUT_SPLIT_LIGHTING + #endif + + #define HAVE_RECURSIVE_RENDERING + + #if SHADERPASS == SHADERPASS_TRANSPARENT_DEPTH_PREPASS + #if !defined(_DISABLE_SSR_TRANSPARENT) && !defined(SHADER_UNLIT) + #define WRITE_NORMAL_BUFFER + #endif + #endif + + #ifndef DEBUG_DISPLAY + // In case of opaque we don't want to perform the alpha test, it is done in depth prepass and we use depth equal for ztest (setup from UI) + // Don't do it with debug display mode as it is possible there is no depth prepass in this case + #if !defined(_SURFACE_TYPE_TRANSPARENT) && defined(_ALPHATEST) + #if SHADERPASS == SHADERPASS_FORWARD + #define SHADERPASS_FORWARD_BYPASS_ALPHA_TEST + #elif SHADERPASS == SHADERPASS_GBUFFER + #define SHADERPASS_GBUFFER_BYPASS_ALPHA_TEST + #endif + #endif + #endif + + // Define _DEFERRED_CAPABLE_MATERIAL for shader capable to run in deferred pass + #if defined(SHADER_LIT) && !defined(_SURFACE_TYPE_TRANSPARENT) + #define _DEFERRED_CAPABLE_MATERIAL + #endif + + // Translate transparent motion vector define + #if defined(_TRANSPARENT_WRITES_MOTION_VEC) && defined(_SURFACE_TYPE_TRANSPARENT) + #define _WRITE_TRANSPARENT_MOTION_VECTOR + #endif + + + + + CBUFFER_START(UnityPerMaterial) + float _UseShadowThreshold; + float _BlendMode; + float _EnableBlendModePreserveSpecularLighting; + float _RayTracing; + float _RefractionModel; + + + half4 _Color; + half4 _MainTex_ST, _MainTex_TexelSize; + half _Alpha, _AlphaCutoffValue; + + #if ATLAS_ON + half _MinXUV, _MaxXUV, _MinYUV, _MaxYUV; + #endif + + #if GLOW_ON + half4 _GlowColor; + half _Glow, _GlowGlobal; + #endif + + #if HSV_ON + half _HsvShift, _HsvSaturation, _HsvBright; + #endif + + #if DISTORT_ON + half4 _DistortTex_ST; + half _DistortTexXSpeed, _DistortTexYSpeed, _DistortAmount; + #endif + + #if FADE_ON + half4 _FadeBurnColor, _FadeTex_ST, _FadeBurnTex_ST; + half _FadeAmount, _FadeBurnWidth, _FadeBurnTransition,_FadeBurnGlow; + #endif + + #if OUTBASE_ON + half4 _OutlineColor; + half _OutlineAlpha, _OutlineGlow, _OutlineWidth; + int _OutlinePixelWidth; + #endif + + #if OUTTEX_ON + half4 _OutlineTex_ST; + half _OutlineTexXSpeed, _OutlineTexYSpeed; + #endif + + #if OUTDIST_ON + half4 _OutlineDistortTex_ST; + half _OutlineDistortTexXSpeed, _OutlineDistortTexYSpeed, _OutlineDistortAmount; + #endif + + #if ALPHAOUTLINE_ON + half _AlphaOutlineGlow, _AlphaOutlinePower, _AlphaOutlineMinAlpha, _AlphaOutlineBlend; + half4 _AlphaOutlineColor; + #endif + + #if INNEROUTLINE_ON + half _InnerOutlineThickness, _InnerOutlineAlpha, _InnerOutlineGlow; + half4 _InnerOutlineColor; + #endif + + #if GRADIENT_ON + half _GradBlend, _GradBoostX, _GradBoostY; + half4 _GradTopRightCol, _GradTopLeftCol, _GradBotRightCol, _GradBotLeftCol; + #endif + + #if COLORSWAP_ON + half4 _ColorSwapRed, _ColorSwapGreen, _ColorSwapBlue; + half _ColorSwapRedLuminosity, _ColorSwapGreenLuminosity, _ColorSwapBlueLuminosity, _ColorSwapBlend; + #endif + + #if CHANGECOLOR_ON + half4 _ColorChangeNewCol, _ColorChangeTarget; + half _ColorChangeTolerance, _ColorChangeLuminosity; + #endif + #if CHANGECOLOR2_ON + half4 _ColorChangeNewCol2, _ColorChangeTarget2; + half _ColorChangeTolerance2; + #endif + #if CHANGECOLOR3_ON + half4 _ColorChangeNewCol3, _ColorChangeTarget3; + half _ColorChangeTolerance3; + #endif + + #if COLORRAMP_ON + half _ColorRampLuminosity, _ColorRampBlend; + #endif + + #if HITEFFECT_ON + half4 _HitEffectColor; + half _HitEffectGlow, _HitEffectBlend; + #endif + + #if NEGATIVE_ON + half _NegativeAmount; + #endif + + #if PIXELATE_ON + half _PixelateSize; + #endif + + #if GREYSCALE_ON + half _GreyscaleLuminosity, _GreyscaleBlend; + half4 _GreyscaleTintColor; + #endif + + #if POSTERIZE_ON + half _PosterizeNumColors, _PosterizeGamma; + #endif + + #if BLUR_ON + half _BlurIntensity; + #endif + + #if MOTIONBLUR_ON + half _MotionBlurAngle, _MotionBlurDist; + #endif + + #if GHOST_ON + half _GhostColorBoost, _GhostTransparency, _GhostBlend; + #endif + + #if HOLOGRAM_ON + half _HologramStripesAmount, _HologramMinAlpha, _HologramUnmodAmount, _HologramStripesSpeed, _HologramMaxAlpha, _HologramBlend; + half4 _HologramStripeColor; + #endif + + #if CHROMABERR_ON + half _ChromAberrAmount, _ChromAberrAlpha; + #endif + + #if GLITCH_ON + half _GlitchAmount, _GlitchSize; + #endif + + #if FLICKER_ON + half _FlickerFreq, _FlickerPercent, _FlickerAlpha; + #endif + + #if SHADOW_ON + half _ShadowX, _ShadowY, _ShadowAlpha; + half4 _ShadowColor; + #endif + + #if SHINE_ON + half4 _ShineColor; + half _ShineLocation, _ShineRotate, _ShineWidth, _ShineGlow; + #endif + + #if CONTRAST_ON + half _Contrast, _Brightness; + #endif + + #if OVERLAY_ON + half4 _OverlayTex_ST, _OverlayColor; + half _OverlayGlow, _OverlayBlend, _OverlayTextureScrollXSpeed, _OverlayTextureScrollYSpeed; + #endif + + #if DOODLE_ON + half _HandDrawnAmount, _HandDrawnSpeed; + #endif + + #if WIND_ON + half _GrassSpeed, _GrassWind, _GrassManualAnim, _GrassRadialBend; + #endif + + #if WAVEUV_ON + float _WaveAmount, _WaveSpeed, _WaveStrength, _WaveX, _WaveY; + #endif + + #if ROUNDWAVEUV_ON + half _RoundWaveStrength, _RoundWaveSpeed; + #endif + + #if RECTSIZE_ON + half _RectSize; + #endif + + #if OFFSETUV_ON + half _OffsetUvX, _OffsetUvY; + #endif + + #if CLIPPING_ON + half _ClipUvLeft, _ClipUvRight, _ClipUvUp, _ClipUvDown; + #endif + + #if RADIALCLIPPING_ON + half _RadialStartAngle, _RadialClip, _RadialClip2; + #endif + + #if TEXTURESCROLL_ON + half _TextureScrollXSpeed, _TextureScrollYSpeed; + #endif + + #if ZOOMUV_ON + half _ZoomUvAmount; + #endif + + #if WARP_ON + half _WarpStrength, _WarpSpeed, _WarpScale; + #endif + + #if TWISTUV_ON + half _TwistUvAmount, _TwistUvPosX, _TwistUvPosY, _TwistUvRadius; + #endif + + #if ROTATEUV_ON + half _RotateUvAmount; + #endif + + #if FISHEYE_ON + half _FishEyeUvAmount; + #endif + + #if PINCH_ON + half _PinchUvAmount; + #endif + + #if SHAKEUV_ON + half _ShakeUvSpeed, _ShakeUvX, _ShakeUvY; + #endif + + #if NORMALMAP_ON + half _NormalStrength; + #endif + + float _RandomSeed; + + + + + CBUFFER_END + + + + // -- Property used by ScenePickingPass + #ifdef SCENEPICKINGPASS + float4 _SelectionID; + #endif + + // -- Properties used by SceneSelectionPass + #ifdef SCENESELECTIONPASS + int _ObjectId; + int _PassValue; + #endif + + + // data across stages, stripped like the above. + struct VertexToPixel + { + float4 pos : SV_POSITION; + float3 worldPos : TEXCOORD0; + float3 worldNormal : TEXCOORD1; + float4 worldTangent : TEXCOORD2; + float4 texcoord0 : TEXCOORD3; + float4 texcoord1 : TEXCOORD4; + float4 texcoord2 : TEXCOORD5; + // #if %TEXCOORD3REQUIREKEY% + float4 texcoord3 : TEXCOORD6; + // #endif + + // #if %SCREENPOSREQUIREKEY% + // float4 screenPos : TEXCOORD7; + // #endif + + // #if %VERTEXCOLORREQUIREKEY% + float4 vertexColor : COLOR; + // #endif + + // #if %EXTRAV2F0REQUIREKEY% + // float4 extraV2F0 : TEXCOORD8; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // float4 extraV2F1 : TEXCOORD9; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // float4 extraV2F2 : TEXCOORD10; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // float4 extraV2F3 : TEXCOORD11; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // float4 extraV2F4 : TEXCOORD12; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // float4 extraV2F5 : TEXCOORD13; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // float4 extraV2F6 : TEXCOORD14; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // float4 extraV2F7 : TEXCOORD15; + // #endif + + #if UNITY_ANY_INSTANCING_ENABLED + UNITY_VERTEX_INPUT_INSTANCE_ID + #endif // UNITY_ANY_INSTANCING_ENABLED + + #if _HDRP && (_PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR))) + float4 previousPositionCS : TEXCOORD16; // Contain previous transform position (in case of skinning for example) + float4 motionVectorCS : TEXCOORD17; + #endif + + UNITY_VERTEX_OUTPUT_STEREO + }; + + + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Debug/DebugDisplay.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/Material.hlsl" + #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/NormalSurfaceGradient.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/Lit/Lit.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/BuiltinUtilities.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/MaterialUtilities.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/Decal/DecalUtilities.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/Lit/LitDecalData.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/ShaderGraphFunctions.hlsl" + + + + + + // data describing the user output of a pixel + struct Surface + { + half3 Albedo; + half Height; + half3 Normal; + half Smoothness; + half3 Emission; + half Metallic; + half3 Specular; + half Occlusion; + half SpecularPower; // for simple lighting + half Alpha; + float outputDepth; // if written, SV_Depth semantic is used. ShaderData.clipPos.z is unused value + // HDRP Only + half SpecularOcclusion; + half SubsurfaceMask; + half Thickness; + half CoatMask; + half CoatSmoothness; + half Anisotropy; + half IridescenceMask; + half IridescenceThickness; + int DiffusionProfileHash; + float SpecularAAThreshold; + float SpecularAAScreenSpaceVariance; + // requires _OVERRIDE_BAKEDGI to be defined, but is mapped in all pipelines + float3 DiffuseGI; + float3 BackDiffuseGI; + float3 SpecularGI; + float ior; + float3 transmittanceColor; + float atDistance; + float transmittanceMask; + // requires _OVERRIDE_SHADOWMASK to be defines + float4 ShadowMask; + + // for decals + float NormalAlpha; + float MAOSAlpha; + + + }; + + // Data the user declares in blackboard blocks + struct Blackboard + { + + float blackboardDummyData; + }; + + // data the user might need, this will grow to be big. But easy to strip + struct ShaderData + { + float4 clipPos; // SV_POSITION + float3 localSpacePosition; + float3 localSpaceNormal; + float3 localSpaceTangent; + + float3 worldSpacePosition; + float3 worldSpaceNormal; + float3 worldSpaceTangent; + float tangentSign; + + float3 worldSpaceViewDir; + float3 tangentSpaceViewDir; + + float4 texcoord0; + float4 texcoord1; + float4 texcoord2; + float4 texcoord3; + + float2 screenUV; + float4 screenPos; + + float4 vertexColor; + bool isFrontFace; + + float4 extraV2F0; + float4 extraV2F1; + float4 extraV2F2; + float4 extraV2F3; + float4 extraV2F4; + float4 extraV2F5; + float4 extraV2F6; + float4 extraV2F7; + + float3x3 TBNMatrix; + Blackboard blackboard; + }; + + struct VertexData + { + #if SHADER_TARGET > 30 + // uint vertexID : SV_VertexID; + #endif + float4 vertex : POSITION; + float3 normal : NORMAL; + float4 tangent : TANGENT; + float4 texcoord0 : TEXCOORD0; + + // optimize out mesh coords when not in use by user or lighting system + #if _URP && (_USINGTEXCOORD1 || _PASSMETA || _PASSFORWARD || _PASSGBUFFER) + float4 texcoord1 : TEXCOORD1; + #endif + + #if _URP && (_USINGTEXCOORD2 || _PASSMETA || ((_PASSFORWARD || _PASSGBUFFER) && defined(DYNAMICLIGHTMAP_ON))) + float4 texcoord2 : TEXCOORD2; + #endif + + #if _STANDARD && (_USINGTEXCOORD1 || (_PASSMETA || ((_PASSFORWARD || _PASSGBUFFER || _PASSFORWARDADD) && LIGHTMAP_ON))) + float4 texcoord1 : TEXCOORD1; + #endif + #if _STANDARD && (_USINGTEXCOORD2 || (_PASSMETA || ((_PASSFORWARD || _PASSGBUFFER) && DYNAMICLIGHTMAP_ON))) + float4 texcoord2 : TEXCOORD2; + #endif + + + #if _HDRP + float4 texcoord1 : TEXCOORD1; + float4 texcoord2 : TEXCOORD2; + #endif + + // #if %TEXCOORD3REQUIREKEY% + float4 texcoord3 : TEXCOORD3; + // #endif + + // #if %VERTEXCOLORREQUIREKEY% + float4 vertexColor : COLOR; + // #endif + + #if _PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR)) + float3 previousPositionOS : TEXCOORD4; // Contain previous transform position (in case of skinning for example) + #if defined (_ADD_PRECOMPUTED_VELOCITY) + float3 precomputedVelocity : TEXCOORD5; // Add Precomputed Velocity (Alembic computes velocities on runtime side). + #endif + #endif + + UNITY_VERTEX_INPUT_INSTANCE_ID + }; + + struct TessVertex + { + float4 vertex : INTERNALTESSPOS; + float3 normal : NORMAL; + float4 tangent : TANGENT; + float4 texcoord0 : TEXCOORD0; + float4 texcoord1 : TEXCOORD1; + float4 texcoord2 : TEXCOORD2; + + // #if %TEXCOORD3REQUIREKEY% + float4 texcoord3 : TEXCOORD3; + // #endif + + // #if %VERTEXCOLORREQUIREKEY% + float4 vertexColor : COLOR; + // #endif + + // #if %EXTRAV2F0REQUIREKEY% + // float4 extraV2F0 : TEXCOORD5; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // float4 extraV2F1 : TEXCOORD6; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // float4 extraV2F2 : TEXCOORD7; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // float4 extraV2F3 : TEXCOORD8; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // float4 extraV2F4 : TEXCOORD9; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // float4 extraV2F5 : TEXCOORD10; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // float4 extraV2F6 : TEXCOORD11; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // float4 extraV2F7 : TEXCOORD12; + // #endif + + #if _PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR)) + float3 previousPositionOS : TEXCOORD13; // Contain previous transform position (in case of skinning for example) + #if defined (_ADD_PRECOMPUTED_VELOCITY) + float3 precomputedVelocity : TEXCOORD14; + #endif + #endif + + UNITY_VERTEX_INPUT_INSTANCE_ID + UNITY_VERTEX_OUTPUT_STEREO + }; + + struct ExtraV2F + { + float4 extraV2F0; + float4 extraV2F1; + float4 extraV2F2; + float4 extraV2F3; + float4 extraV2F4; + float4 extraV2F5; + float4 extraV2F6; + float4 extraV2F7; + Blackboard blackboard; + float4 time; + }; + + + float3 WorldToTangentSpace(ShaderData d, float3 normal) + { + return mul(d.TBNMatrix, normal); + } + + float3 TangentToWorldSpace(ShaderData d, float3 normal) + { + return mul(normal, d.TBNMatrix); + } + + // in this case, make standard more like SRPs, because we can't fix + // unity_WorldToObject in HDRP, since it already does macro-fu there + + #if _STANDARD + float3 TransformWorldToObject(float3 p) { return mul(unity_WorldToObject, float4(p, 1)); }; + float3 TransformObjectToWorld(float3 p) { return mul(unity_ObjectToWorld, float4(p, 1)); }; + float4 TransformWorldToObject(float4 p) { return mul(unity_WorldToObject, p); }; + float4 TransformObjectToWorld(float4 p) { return mul(unity_ObjectToWorld, p); }; + float4x4 GetWorldToObjectMatrix() { return unity_WorldToObject; } + float4x4 GetObjectToWorldMatrix() { return unity_ObjectToWorld; } + #if (defined(SHADER_API_D3D11) || defined(SHADER_API_XBOXONE) || defined(UNITY_COMPILER_HLSLCC) || defined(SHADER_API_PSSL) || (SHADER_TARGET_SURFACE_ANALYSIS && !SHADER_TARGET_SURFACE_ANALYSIS_MOJOSHADER)) + #define UNITY_SAMPLE_TEX2D_LOD(tex,coord, lod) tex.SampleLevel (sampler##tex,coord, lod) + #define UNITY_SAMPLE_TEX2D_SAMPLER_LOD(tex,samplertex,coord, lod) tex.SampleLevel (sampler##samplertex,coord, lod) + #else + #define UNITY_SAMPLE_TEX2D_LOD(tex,coord,lod) tex2D (tex,coord,0,lod) + #define UNITY_SAMPLE_TEX2D_SAMPLER_LOD(tex,samplertex,coord,lod) tex2D (tex,coord,0,lod) + #endif + + #undef GetWorldToObjectMatrix() + + #define GetWorldToObjectMatrix() unity_WorldToObject + + + #endif + + float3 GetCameraWorldPosition() + { + #if _HDRP + return GetCameraRelativePositionWS(_WorldSpaceCameraPos); + #else + return _WorldSpaceCameraPos; + #endif + } + + #if _GRABPASSUSED + #if _STANDARD + TEXTURE2D(%GRABTEXTURE%); + SAMPLER(sampler_%GRABTEXTURE%); + #endif + + half3 GetSceneColor(float2 uv) + { + #if _STANDARD + return SAMPLE_TEXTURE2D(%GRABTEXTURE%, sampler_%GRABTEXTURE%, uv).rgb; + #else + return SHADERGRAPH_SAMPLE_SCENE_COLOR(uv); + #endif + } + #endif + + + + #if _STANDARD + UNITY_DECLARE_DEPTH_TEXTURE(_CameraDepthTexture); + float GetSceneDepth(float2 uv) { return SAMPLE_DEPTH_TEXTURE(_CameraDepthTexture, uv); } + float GetLinear01Depth(float2 uv) { return Linear01Depth(GetSceneDepth(uv)); } + float GetLinearEyeDepth(float2 uv) { return LinearEyeDepth(GetSceneDepth(uv)); } + #else + float GetSceneDepth(float2 uv) { return SHADERGRAPH_SAMPLE_SCENE_DEPTH(uv); } + float GetLinear01Depth(float2 uv) { return Linear01Depth(GetSceneDepth(uv), _ZBufferParams); } + float GetLinearEyeDepth(float2 uv) { return LinearEyeDepth(GetSceneDepth(uv), _ZBufferParams); } + #endif + + float3 GetWorldPositionFromDepthBuffer(float2 uv, float3 worldSpaceViewDir) + { + float eye = GetLinearEyeDepth(uv); + float3 camView = mul((float3x3)GetObjectToWorldMatrix(), transpose(mul(GetWorldToObjectMatrix(), UNITY_MATRIX_I_V)) [2].xyz); + + float dt = dot(worldSpaceViewDir, camView); + float3 div = worldSpaceViewDir/dt; + float3 wpos = (eye * div) + GetCameraWorldPosition(); + return wpos; + } + + #if _HDRP + float3 ObjectToWorldSpacePosition(float3 pos) + { + return GetAbsolutePositionWS(TransformObjectToWorld(pos)); + } + #else + float3 ObjectToWorldSpacePosition(float3 pos) + { + return TransformObjectToWorld(pos); + } + #endif + + #if _STANDARD + UNITY_DECLARE_SCREENSPACE_TEXTURE(_CameraDepthNormalsTexture); + float3 GetSceneNormal(float2 uv, float3 worldSpaceViewDir) + { + float4 depthNorms = UNITY_SAMPLE_SCREENSPACE_TEXTURE(_CameraDepthNormalsTexture, uv); + float3 norms = DecodeViewNormalStereo(depthNorms); + norms = mul((float3x3)GetWorldToViewMatrix(), norms) * 0.5 + 0.5; + return norms; + } + #elif _HDRP && !_DECALSHADER + + float3 GetSceneNormal(float2 uv, float3 worldSpaceViewDir) + { + NormalData nd; + DecodeFromNormalBuffer(_ScreenSize.xy * uv, nd); + return nd.normalWS; + } + #elif _URP + #if (SHADER_LIBRARY_VERSION_MAJOR >= 10) + #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/DeclareNormalsTexture.hlsl" + #endif + + float3 GetSceneNormal(float2 uv, float3 worldSpaceViewDir) + { + #if (SHADER_LIBRARY_VERSION_MAJOR >= 10) + return SampleSceneNormals(uv); + #else + float3 wpos = GetWorldPositionFromDepthBuffer(uv, worldSpaceViewDir); + return normalize(-cross(ddx(wpos), ddy(wpos))) * 0.5 + 0.5; + #endif + + } + #endif + + #if _HDRP + + half3 UnpackNormalmapRGorAG(half4 packednormal) + { + // This do the trick + packednormal.x *= packednormal.w; + + half3 normal; + normal.xy = packednormal.xy * 2 - 1; + normal.z = sqrt(1 - saturate(dot(normal.xy, normal.xy))); + return normal; + } + half3 UnpackNormal(half4 packednormal) + { + #if defined(UNITY_NO_DXT5nm) + return packednormal.xyz * 2 - 1; + #else + return UnpackNormalmapRGorAG(packednormal); + #endif + } + #endif + #if _HDRP || _URP + + half3 UnpackScaleNormal(half4 packednormal, half scale) + { + #ifndef UNITY_NO_DXT5nm + // Unpack normal as DXT5nm (1, y, 1, x) or BC5 (x, y, 0, 1) + // Note neutral texture like "bump" is (0, 0, 1, 1) to work with both plain RGB normal and DXT5nm/BC5 + packednormal.x *= packednormal.w; + #endif + half3 normal; + normal.xy = (packednormal.xy * 2 - 1) * scale; + normal.z = sqrt(1 - saturate(dot(normal.xy, normal.xy))); + return normal; + } + + #endif + + + void GetSun(out float3 lightDir, out float3 color) + { + lightDir = float3(0.5, 0.5, 0); + color = 1; + #if _HDRP + if (_DirectionalLightCount > 0) + { + DirectionalLightData light = _DirectionalLightDatas[0]; + lightDir = -light.forward.xyz; + color = light.color; + } + #elif _STANDARD + lightDir = normalize(_WorldSpaceLightPos0.xyz); + color = _LightColor0.rgb; + #elif _URP + Light light = GetMainLight(); + lightDir = light.direction; + color = light.color; + #endif + } + + + + + + + + + + + TEXTURE2D(_MainTex); + SAMPLER(sampler_MainTex); + + #if GLOW_ON + TEXTURE2D(_GlowTex); + SAMPLER(sampler_GlowTex); + #endif + + #if FADE_ON + TEXTURE2D(_FadeTex); + SAMPLER(sampler_FadeTex); + + TEXTURE2D(_FadeBurnTex); + SAMPLER(sampler_FadeBurnTex); + #endif + + #if DISTORT_ON + TEXTURE2D(_DistortTex); + SAMPLER(sampler_DistortTex); + #endif + + #if OUTTEX_ON + TEXTURE2D(_OutlineTex); + SAMPLER(sampler_OutlineTex); + #endif + + #if OUTDIST_ON + TEXTURE2D(_OutlineDistortTex); + SAMPLER(sampler_OutlineDistortTex); + #endif + + #if COLORSWAP_ON + TEXTURE2D(_ColorSwapTex); + SAMPLER(sampler_ColorSwapTex); + #endif + + #if COLORRAMP_ON + TEXTURE2D(_ColorRampTex); + TEXTURE2D(_ColorRampTexGradient); + SAMPLER(sampler_ColorRampTex); + SAMPLER(sampler_ColorRampTexGradient); + #endif + + #if SHINE_ON + TEXTURE2D(_ShineMask); + SAMPLER(sampler_ShineMask); + #endif + + #if OVERLAY_ON + TEXTURE2D(_OverlayTex); + SAMPLER(sampler_OverlayTex); + #endif + + #if NORMALMAP_ON + TEXTURE2D(_NormalMap); + SAMPLER(sampler_NormalMap); + #endif + + + half3 GetPixel(in int offsetX, in int offsetY, in half2 uv, in Texture2D _tex, in SamplerState _sampler) + { + half2 _uv = uv + half2(offsetX * _MainTex_TexelSize.x, offsetY * _MainTex_TexelSize.y); + half4 col = SAMPLE_TEXTURE2D(_tex, _sampler, _uv); + return col.rgb; + } + + + //BLURS------------------------------------------------------------------------- + half4 Blur(half2 uv, Texture2D source, SamplerState sampler_source, half Intensity) + { + const half2 texelSize = 1.0 / _ScreenParams.xy; + const half4 color = SAMPLE_TEXTURE2D(source, sampler_source, uv); + const half2 offset = Intensity * texelSize; + + half4 accumulatedColor = color; + half accumulatedWeight = 1.0; + for (int x = -1; x <= 1; x++) + { + for (int y = -1; y <= 1; y++) + { + const half2 sampleUV = uv + half2(x, y) * offset; + const half4 sampleColor = SAMPLE_TEXTURE2D(source, sampler_source, sampleUV); + + accumulatedColor += sampleColor; + accumulatedWeight += 1.0; + } + } + + half4 blurredColor = accumulatedColor / accumulatedWeight; + return blurredColor; + } + + half BlurHD_G(half bhqp, half x) + { + return exp(-(x * x) / (2.0 * bhqp * bhqp)); + } + half4 BlurHD(half2 uv, Texture2D source, SamplerState sampler_source, half BlurAmount, half xScale, half yScale) + { + int iterations = 16; + int halfIterations = iterations / 2; + half sigmaX = 0.1 + BlurAmount * 0.5; + half sigmaY = sigmaX; + half total = 0.0; + half4 ret = half4(0, 0, 0, 0); + for (int iy = 0; iy < iterations; ++iy) + { + half fy = BlurHD_G(sigmaY, half(iy) -half(halfIterations)); + half offsetY = half(iy - halfIterations) * 0.00390625 * xScale; + for (int ix = 0; ix < iterations; ++ix) + { + half fx = BlurHD_G(sigmaX, half(ix) - half(halfIterations)); + half offsetX = half(ix - halfIterations) * 0.00390625 * yScale; + total += fx * fy; + ret += SAMPLE_TEXTURE2D(source, sampler_source, uv + half2(offsetX, offsetY)) * fx * fy; + } + } + return ret / total; + } + //----------------------------------------------------------------------- + + + //------------------------------------------- + half RemapFloat(half inValue, half inMin, half inMax, half outMin, half outMax){ + return outMin + (inValue - inMin) * (outMax - outMin) / (inMax - inMin); + } + //------------------------------------------- + + //----------------------------------------------------------------------- + half rand(half2 seed, half offset) { + return (frac(sin(dot(seed, half2(12.9898, 78.233))) * 43758.5453) + offset) % 1.0; + } + + half rand2(half2 seed, half offset) { + return (frac(sin(dot(seed * floor(50 + (_Time.x % 1.0) * 12.), half2(127.1, 311.7))) * 43758.5453123) + offset) % 1.0; + } + + half rand2CustomTime(half2 seed, half offset, half customTime) { + return (frac(sin(dot(seed * floor(50 + (customTime % 1.0) * 12.), half2(127.1, 311.7))) * 43758.5453123) + offset) % 1.0; + } + //----------------------------------------------------------------------- + + + void Ext_ModifyVertex0 (inout VertexData v, inout ExtraV2F d) + { + //BILBOARD_ON + #if BILBOARD_ON + half3 camRight = mul((half3x3)unity_CameraToWorld, half3(1,0,0)); + half3 camUp = half3(0,1,0); + #if BILBOARDY_ON + camUp = mul((half3x3)unity_CameraToWorld, half3(0,1,0)); + #endif + half3 localPos = v.vertex.x * camRight + v.vertex.y * camUp; + v.vertex = half4(localPos, 1); + #endif + //----------------------------------------------------------- + + v.texcoord0.xy = TRANSFORM_TEX(v.texcoord0.xy, _MainTex); + half2 center = half2(0.5, 0.5); + #if ATLAS_ON + center = half2((_MaxXUV + _MinXUV) / 2.0, (_MaxYUV + _MinYUV) / 2.0); + #endif + + //POLARUV_ON + #if POLARUV_ON + v.texcoord0.xy = v.texcoord0.xy - center; + #endif + + //---------------------------------------- + + //ROTATEUV_ON + #if ROTATEUV_ON + half2 uvC = v.texcoord0.xy; + half cosAngle = cos(_RotateUvAmount); + half sinAngle = sin(_RotateUvAmount); + half2x2 rot = half2x2(cosAngle, -sinAngle, sinAngle, cosAngle); + uvC -= center; + v.texcoord0.xy = mul(rot, uvC); + v.texcoord0.xy += center; + #endif + //-------------------- + + #if RECTSIZE_ON + v.vertex.xyz += (v.vertex.xyz * (_RectSize - 1.0)); + #endif + + #if OUTTEX_ON + v.texcoord1.xy = TRANSFORM_TEX(v.texcoord0.xy, _OutlineTex); + #endif + + #if OUTDIST_ON + v.texcoord2.xy = TRANSFORM_TEX(v.texcoord0.xy, _OutlineDistortTex); + #endif + + #if DISTORT_ON + v.texcoord3.xy = TRANSFORM_TEX(v.texcoord0.xy, _DistortTex); + #endif + } + + void Ext_SurfaceFunction0 (inout Surface o, ShaderData d) + { + half randomSeed = _RandomSeed; + + float2 uvRect = d.texcoord0; + half2 center = half2(0.5, 0.5); + #if ATLAS_ON + center = half2((_MaxXUV + _MinXUV) / 2.0, (_MaxYUV + _MinYUV) / 2.0); + uvRect = half2((d.texcoord0.x - _MinXUV) / (_MaxXUV - _MinXUV), (d.texcoord0.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half2 centerTiled = half2(center.x * _MainTex_ST.x, center.y * _MainTex_ST.y); + + //CLIPPING_ON + #if CLIPPING_ON + half2 tiledUv = half2(d.texcoord0.x / _MainTex_ST.x, d.texcoord0.y / _MainTex_ST.y); + #if ATLAS_ON + tiledUv = half2((tiledUv.x - _MinXUV) / (_MaxXUV - _MinXUV), (tiledUv.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + clip((1 - _ClipUvUp) - tiledUv.y); + clip(tiledUv.y - _ClipUvDown); + clip((1 - _ClipUvRight) - tiledUv.x); + clip(tiledUv.x - _ClipUvLeft); + #endif + //---------------------------------- + + //RADIALCLIPPING_ON + #if RADIALCLIPPING_ON + half2 tiledUv2 = half2(d.texcoord0.x / _MainTex_ST.x, d.texcoord0.y / _MainTex_ST.y); + #if ATLAS_ON + tiledUv2 = half2((tiledUv2.x - _MinXUV) / (_MaxXUV - _MinXUV), (tiledUv2.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half startAngle = _RadialStartAngle - _RadialClip; + half endAngle = _RadialStartAngle + _RadialClip2; + half offset0 = clamp(0, 360, startAngle + 360); + half offset360 = clamp(0, 360, endAngle - 360); + half2 atan2Coord = half2(lerp(-1, 1, tiledUv2.x), lerp(-1, 1, tiledUv2.y)); + half atanAngle = atan2(atan2Coord.y, atan2Coord.x) * 57.3; // angle in degrees + if(atanAngle < 0) atanAngle = 360 + atanAngle; + if(atanAngle >= startAngle && atanAngle <= endAngle) discard; + if(atanAngle <= offset360) discard; + if(atanAngle >= offset0) discard; + #endif + + //----------------------------- + + //TEXTURESCROLL_ON && ATLAS_ON + #if TEXTURESCROLL_ON && ATLAS_ON + d.texcoord0.xy = half2(_MinXUV + ((_MaxXUV - _MinXUV) * (abs(((_Time.y + randomSeed) * _TextureScrollXSpeed) + uvRect.x) % 1)), + _MinYUV + ((_MaxYUV - _MinYUV) * (abs(((_Time.y + randomSeed) * _TextureScrollYSpeed) + uvRect.y) % 1))); + #endif + //---------------------------- + + //OFFSETUV_ON + #if OFFSETUV_ON + #if ATLAS_ON + d.texcoord0.xy = half2(_MinXUV + ((_MaxXUV - _MinXUV) * (abs((_OffsetUvX + uvRect.x) % 1))), + _MinYUV + ((_MaxYUV - _MinYUV) * (abs(_OffsetUvY + uvRect.y) % 1))); + #else + d.texcoord0.xy += half2(_OffsetUvX, _OffsetUvY); + #endif + #endif + + //---------------------- + + //POLARUV_ON + #if POLARUV_ON + d.texcoord0.xy = half2(atan2(d.texcoord0.y, d.texcoord0.x) / (2.0f * 3.141592653589f), length(d.texcoord0.xy)); + d.texcoord0.xy *= _MainTex_ST.xy; + #endif + + //-------------------------------------- + + //TWISTUV_ON + #if TWISTUV_ON + #if ATLAS_ON + _TwistUvPosX = ((_MaxXUV - _MinXUV) * _TwistUvPosX) + _MinXUV; + _TwistUvPosY = ((_MaxYUV - _MinYUV) * _TwistUvPosY) + _MinYUV; + #endif + half2 tempUv = d.texcoord0.xy - half2(_TwistUvPosX * _MainTex_ST.x, _TwistUvPosY * _MainTex_ST.y); + _TwistUvRadius *= (_MainTex_ST.x + _MainTex_ST.y) / 2; + half percent = (_TwistUvRadius - length(tempUv)) / _TwistUvRadius; + half theta = percent * percent * (2.0 * sin(_TwistUvAmount)) * 8.0; + half s = sin(theta); + half c = cos(theta); + half beta = max(sign(_TwistUvRadius - length(tempUv)), 0.0); + tempUv = half2(dot(tempUv, half2(c, -s)), dot(tempUv, half2(s, c))) * beta + tempUv * (1 - beta); + tempUv += half2(_TwistUvPosX * _MainTex_ST.x, _TwistUvPosY * _MainTex_ST.y); + d.texcoord0.xy = tempUv; + #endif + + //-------------------------------------------- + + //FISHEYE_ON + #if FISHEYE_ON + half bind = length(centerTiled); + half2 dF = d.texcoord0.xy - centerTiled; + half dFlen = length(dF); + half fishInt = (3.14159265359 / bind) * (_FishEyeUvAmount + 0.001); + d.texcoord0.xy = centerTiled + (dF / (max(0.0001, dFlen))) * tan(dFlen * fishInt) * bind / tan(bind * fishInt); + #endif + //--------------------------------------------- + + //PINCH_ON + #if PINCH_ON + half2 dP = d.texcoord0.xy - centerTiled; + half pinchInt = (3.141592 / length(centerTiled)) * (-_PinchUvAmount + 0.001); + d.texcoord0.xy = centerTiled + normalize(dP) * atan(length(dP) * -pinchInt * 10.0) * 0.5 / atan(-pinchInt * 5); + #endif + + //--------------------------------------------- + + //ZOOMUV_ON + #if ZOOMUV_ON + d.texcoord0.xy -= centerTiled; + d.texcoord0.xy = d.texcoord0.xy * _ZoomUvAmount; + d.texcoord0.xy += centerTiled; + #endif + + //----------------------------------------------- + + //DOODLE_ON + #if DOODLE_ON + half2 uvCopy = uvRect; + _HandDrawnSpeed = (floor((_Time.x + randomSeed) * 20 * _HandDrawnSpeed) / _HandDrawnSpeed) * _HandDrawnSpeed; + uvCopy.x = sin((uvCopy.x * _HandDrawnAmount + _HandDrawnSpeed) * 4); + uvCopy.y = cos((uvCopy.y * _HandDrawnAmount + _HandDrawnSpeed) * 4); + d.texcoord0.xy = lerp(d.texcoord0.xy, d.texcoord0.xy + uvCopy, 0.0005 * _HandDrawnAmount); + #endif + + //-------------------------- + + //SHAKEUV_ON + #if SHAKEUV_ON + half xShake = sin((_Time.x + randomSeed) * _ShakeUvSpeed * 50) * _ShakeUvX; + half yShake = cos((_Time.x + randomSeed) * _ShakeUvSpeed * 50) * _ShakeUvY; + d.texcoord0.xy += half2(xShake * 0.012, yShake * 0.01); + #endif + + //------------------------------------------- + + //RECTSIZE_ON + #if RECTSIZE_ON + d.texcoord0.xy = d.texcoord0.xy * (_RectSize).xx + (((-_RectSize * 0.5) + 0.5)).xx; + #endif + + //------------------------------------------- + + //DISTORT_ON + #if DISTORT_ON + #if ATLAS_ON + d.texcoord3.x = d.texcoord3.x * (1 / (_MaxXUV - _MinXUV)); + d.texcoord3.y = d.texcoord3.y * (1 / (_MaxYUV - _MinYUV)); + #endif + + d.texcoord3.x += ((_Time.x + _RandomSeed) * _DistortTexXSpeed) % 1; + d.texcoord3.y += ((_Time.x + _RandomSeed) * _DistortTexYSpeed) % 1; + half distortAmnt = (SAMPLE_TEXTURE2D(_DistortTex, sampler_DistortTex, d.texcoord3.xy).r - 0.5) * 0.2 * _DistortAmount; + d.texcoord0.x += distortAmnt; + d.texcoord0.y += distortAmnt; + #endif + //------------------------------------------------------- + + //WARP_ON + #if WARP_ON + half2 warpUv = half2(d.texcoord0.x / _MainTex_ST.x, d.texcoord0.y / _MainTex_ST.y); + #if ATLAS_ON + warpUv = half2((warpUv.x - _MinXUV) / (_MaxXUV - _MinXUV), (warpUv.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + const float tau = 6.283185307179586; + float xWarp = (_Time.y + randomSeed) * _WarpSpeed + warpUv.x * tau / _WarpScale; + float yWarp = (_Time.y + randomSeed) * _WarpSpeed + warpUv.y * tau / _WarpScale; + float2 warp = float2(sin(xWarp), sin(yWarp)) * _WarpStrength; + d.texcoord0.xy += warp; + #endif + + //------------------------------------------------------- + + //WAVEUV_ON + #if WAVEUV_ON + float2 uvWave = half2(_WaveX * _MainTex_ST.x, _WaveY * _MainTex_ST.y) - d.texcoord0.xy; + uvWave %= 1; + #if ATLAS_ON + uvWave = half2(_WaveX, _WaveY) - uvRect; + #endif + uvWave.x *= _ScreenParams.x / _ScreenParams.y; + float waveTime = _Time.y + randomSeed; + float angWave = (sqrt(dot(uvWave, uvWave)) * _WaveAmount) - ((waveTime * _WaveSpeed)); + d.texcoord0.xy = d.texcoord0.xy + uvWave * sin(angWave) * (_WaveStrength / 1000.0); + #endif + //---------------------------------------------------- + + //ROUNDWAVEUV_ON + #if ROUNDWAVEUV_ON + half xWave = ((0.5 * _MainTex_ST.x) - uvRect.x); + half yWave = ((0.5 * _MainTex_ST.y) - uvRect.y) * (_MainTex_TexelSize.w / _MainTex_TexelSize.z); + half ripple = -sqrt(xWave*xWave + yWave* yWave); + d.texcoord0.xy += (sin((ripple + (_Time.y + randomSeed) * (_RoundWaveSpeed/10.0)) / 0.015) * (_RoundWaveStrength/10.0)) % 1; + #endif + //---------------------------------------------------- + + + //WIND_ON + #if WIND_ON + half windOffset = sin((_Time.x + randomSeed) * _GrassSpeed * 10); + half2 windCenter = half2(0.5, 0.1); + #if ATLAS_ON + windCenter.x = ((_MaxXUV - _MinXUV) * windCenter.x) + _MinXUV; + windCenter.y = ((_MaxYUV - _MinYUV) * windCenter.y) + _MinYUV; + #endif + #if !MANUALWIND_ON + d.texcoord0.x = fmod(abs(lerp(d.texcoord0.x, d.texcoord0.x + (_GrassWind * 0.01 * windOffset), uvRect.y)), 1); + #else + d.texcoord0.x = fmod(abs(lerp(d.texcoord0.x, d.texcoord0.x + (_GrassWind * 0.01 * _GrassManualAnim), uvRect.y)), 1); + windOffset = _GrassManualAnim; + #endif + half2 delta = d.texcoord0.xy - windCenter; + half delta2 = dot(delta.xy, delta.xy); + half2 delta_offset = delta2 * windOffset; + d.texcoord0.xy = d.texcoord0.xy + half2(delta.y, -delta.x) * delta_offset * _GrassRadialBend; + #endif + + //-------------------------------------------------------- + + //TEXTURESCROLL_ON && !ATLAS_ON + #if TEXTURESCROLL_ON && !ATLAS_ON + d.texcoord0.x += ((_Time.y + randomSeed) * _TextureScrollXSpeed) % 1; + d.texcoord0.y += ((_Time.y + randomSeed) * _TextureScrollYSpeed) % 1; + #endif + //------------------------------ + + //PIXELATE_ON + #if PIXELATE_ON + half aspectRatio = _MainTex_TexelSize.x / _MainTex_TexelSize.y; + half2 pixelSize = float2(_PixelateSize, _PixelateSize * aspectRatio); + d.texcoord0.xy = floor(d.texcoord0.xy * pixelSize) / pixelSize; + #endif + //-------------- + + half4 col = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy); + half originalAlpha = col.a; + col *= d.vertexColor; + + //NORMAL MAP + #if NORMALMAP_ON + half4 normalSample = SAMPLE_TEXTURE2D(_NormalMap, sampler_NormalMap, d.texcoord0.xy); + half3 normalTS = UnpackNormal(normalSample); + normalTS.xy *= _NormalStrength; + o.Normal = normalTS; + #endif + + + //GLITCH_ON + #if GLITCH_ON + half2 uvGlitch = uvRect; + uvGlitch.y -= 0.5; + half lineNoise = pow(rand2(floor(uvGlitch * half2(24., 19.) * _GlitchSize) * 4.0, randomSeed), 3.0) * _GlitchAmount + * pow(rand2(floor(uvGlitch * half2(38., 14.) * _GlitchSize) * 4.0, randomSeed), 3.0); + col = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(lineNoise * 0.02 * rand2(half2(2.0, 1), randomSeed), 0)) * d.vertexColor; + #endif + //-------------------------------------- + + //CHROMABERR_ON + #if CHROMABERR_ON + half4 r = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(_ChromAberrAmount/10, 0)) * d.vertexColor; + half4 b = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(-_ChromAberrAmount/10, 0)) * d.vertexColor; + col = half4(r.r * r.a, col.g, b.b * b.a, max(max(r.a, b.a) * _ChromAberrAlpha, col.a)); + #endif + + //-------------------------------- + + //BLUR_ON + #if BLUR_ON + #if ATLAS_ON + #if !BLURISHD_ON + col = BlurHD(d.texcoord0.xy, _MainTex, sampler_MainTex, _BlurIntensity, (_MaxXUV - _MinXUV), (_MaxYUV - _MinYUV)) * d.vertexColor; + #else + col = Blur(d.texcoord0.xy, _MainTex, sampler_MainTex, _BlurIntensity * (_MaxXUV - _MinXUV)) * d.vertexColor; + #endif + #else + #if !BLURISHD_ON + col = BlurHD(d.texcoord0.xy, _MainTex, sampler_MainTex, _BlurIntensity, 1, 1) * d.vertexColor; + #else + col = Blur(d.texcoord0.xy, _MainTex, sampler_MainTex, _BlurIntensity) * d.vertexColor; + #endif + #endif + #endif + + //-------------------- + + //MOTIONBLUR_ON + #if MOTIONBLUR_ON + _MotionBlurAngle = _MotionBlurAngle * 3.1415926; + #define rot(n) mul(n, half2x2(cos(_MotionBlurAngle), -sin(_MotionBlurAngle), sin(_MotionBlurAngle), cos(_MotionBlurAngle))) + _MotionBlurDist = _MotionBlurDist * 0.005; + #if ATLAS_ON + _MotionBlurDist *= (_MaxXUV - _MinXUV); + #endif + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(-_MotionBlurDist, -_MotionBlurDist))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(-_MotionBlurDist * 2, -_MotionBlurDist * 2))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(-_MotionBlurDist * 3, -_MotionBlurDist * 3))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(-_MotionBlurDist * 4, -_MotionBlurDist * 4))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(_MotionBlurDist, _MotionBlurDist))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(_MotionBlurDist * 2, _MotionBlurDist * 2))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(_MotionBlurDist * 3, _MotionBlurDist * 3))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(_MotionBlurDist * 4, _MotionBlurDist * 4))); + col.rgb = col.rgb / 9; + #endif + //------------------------------------ + + //NEGATIVE_ON + #if NEGATIVE_ON + col.rgb = lerp(col.rgb, 1 - col.rgb, _NegativeAmount); + #endif + + //-------------- + half luminance = 0; + + //GREYSCALE_ON && !GREYSCALEOUTLINE_ON + #if GREYSCALE_ON && !GREYSCALEOUTLINE_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + luminance = saturate(luminance + _GreyscaleLuminosity); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _GreyscaleTintColor, _GreyscaleBlend); + #endif + //------------------------------------ + + //GHOST_ON + #if GHOST_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + half4 ghostResult; + ghostResult.a = saturate(luminance - _GhostTransparency) * col.a; + ghostResult.rgb = col.rgb * (luminance + _GhostColorBoost); + col = lerp(col, ghostResult, _GhostBlend); + #endif + //------------------------------------ + + //INNEROUTLINE_ON + #if INNEROUTLINE_ON + half3 innerT = abs(GetPixel(0, _InnerOutlineThickness, d.texcoord0.xy, _MainTex, sampler_MainTex) - GetPixel(0, -_InnerOutlineThickness, d.texcoord0.xy, _MainTex, sampler_MainTex)); + innerT += abs(GetPixel(_InnerOutlineThickness, 0, d.texcoord0.xy, _MainTex, sampler_MainTex) - GetPixel(-_InnerOutlineThickness, 0, d.texcoord0.xy, _MainTex, sampler_MainTex)); + #if !ONLYINNEROUTLINE_ON + innerT = (innerT / 2.0) * col.a * _InnerOutlineAlpha; + col.rgb += length(innerT) * _InnerOutlineColor.rgb * _InnerOutlineGlow; + #else + innerT *= col.a * _InnerOutlineAlpha; + col.rgb = length(innerT) * _InnerOutlineColor.rgb * _InnerOutlineGlow; + col.a = step(0.3, col.r+col.g+col.b); + #endif + #endif + //------------------------------------------------------- + + //HITEFFECT_ON + #if HITEFFECT_ON + col.rgb = lerp(col.rgb, _HitEffectColor.rgb * _HitEffectGlow, _HitEffectBlend); + #endif + //-------------------- + + //GRADIENT_ON + #if GRADIENT_ON + half2 tiledUvGrad = half2(uvRect.x / _MainTex_ST.x, uvRect.y / _MainTex_ST.y); + #if GRADIENT2COL_ON + _GradTopRightCol = _GradTopLeftCol; + _GradBotRightCol = _GradBotLeftCol; + #endif + #if RADIALGRADIENT_ON + half radialDist = 1 - length(tiledUvGrad - half2(0.5, 0.5)); + radialDist *= (_MainTex_TexelSize.w / _MainTex_TexelSize.z); + radialDist = saturate(_GradBoostX * radialDist); + half4 gradientResult = lerp(_GradTopLeftCol, _GradBotLeftCol, radialDist); + #else + half gradXLerpFactor = saturate(pow(tiledUvGrad.x, _GradBoostX)); + half4 gradientResult = lerp(lerp(_GradBotLeftCol, _GradBotRightCol, gradXLerpFactor), + lerp(_GradTopLeftCol, _GradTopRightCol, gradXLerpFactor), saturate(pow(tiledUvGrad.y, _GradBoostY))); + #endif + gradientResult = lerp(col, gradientResult, _GradBlend); + col.rgb = gradientResult.rgb * col.a; + col.a *= gradientResult.a; + #endif + //-------------------------------------------------------------------- + + //CONTRAST_ON + #if CONTRAST_ON + col.rgb = (col.rgb - float3(0.5, 0.5, 0.5)) * _Contrast + float3(0.5, 0.5, 0.5); + col.rgb += _Brightness; + #endif + + //------------------------------------------------------------------- + + //COLORSWAP_ON + #if COLORSWAP_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + half4 swapMask = SAMPLE_TEXTURE2D(_ColorSwapTex, sampler_ColorSwapTex, d.texcoord0.xy); + swapMask.rgb *= swapMask.a; + half3 redSwap = _ColorSwapRed * swapMask.r * saturate(luminance + _ColorSwapRedLuminosity); + half3 greenSwap = _ColorSwapGreen * swapMask.g * saturate(luminance + _ColorSwapGreenLuminosity); + half3 blueSwap = _ColorSwapBlue * swapMask.b * saturate(luminance + _ColorSwapBlueLuminosity); + swapMask.rgb = col.rgb * saturate(1 - swapMask.r - swapMask.g - swapMask.b); + col.rgb = lerp(col.rgb, swapMask.rgb + redSwap + greenSwap + blueSwap, _ColorSwapBlend); + #endif + //-------------------------------------------------------------------- + + //COLORRAMP_ON && !COLORRAMPOUTLINE_ON + #if COLORRAMP_ON && !COLORRAMPOUTLINE_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + luminance = saturate(luminance + _ColorRampLuminosity); + #if GRADIENTCOLORRAMP_ON + col.rgb = lerp(col.rgb, SAMPLE_TEXTURE2D(_ColorRampTexGradient, sampler_ColorRampTexGradient, half2(luminance, 0)).rgb, _ColorRampBlend); + #else + col.rgb = lerp(col.rgb, SAMPLE_TEXTURE2D(_ColorRampTex, sampler_ColorRampTex, half2(luminance, 0)).rgb, _ColorRampBlend); + #endif + #endif + //-------------------------------------------------------------------- + + //CHANGECOLOR_ON + #if CHANGECOLOR_ON + float3 currChangeColor = saturate(col.rgb); + luminance = 0.3 * currChangeColor.r + 0.59 * currChangeColor.g + 0.11 * currChangeColor.b; + luminance = saturate(luminance + _ColorChangeLuminosity); + half3 dif = abs(currChangeColor - _ColorChangeTarget.rgb); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _ColorChangeNewCol.rgb, + max(sign(1 - saturate(dif.x + dif.y + dif.z) - _ColorChangeTolerance), 0.0)); + #if CHANGECOLOR2_ON + dif = abs(currChangeColor - _ColorChangeTarget2.rgb); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _ColorChangeNewCol2.rgb, + max(sign(1 - saturate(dif.x + dif.y + dif.z) - _ColorChangeTolerance2), 0.0)); + #endif + #if CHANGECOLOR3_ON + dif = abs(currChangeColor - _ColorChangeTarget3.rgb); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _ColorChangeNewCol3.rgb, + max(sign(1 - saturate(dif.x + dif.y + dif.z) - _ColorChangeTolerance3), 0.0)); + #endif + #endif + //------------------------------------------------------- + + //POSTERIZE_ON && !POSTERIZEOUTLINE_ON + #if POSTERIZE_ON && !POSTERIZEOUTLINE_ON + col.rgb = pow(col.rgb, _PosterizeGamma) * _PosterizeNumColors; + col.rgb = floor(col.rgb) / _PosterizeNumColors; + col.rgb = pow(col.rgb, 1.0 / _PosterizeGamma); + #endif + //------------------------------------ + + //HSV_ON + #if HSV_ON + half3 resultHsv = half3(col.rgb); + half cosHsv = _HsvBright * _HsvSaturation * cos(_HsvShift * 3.14159265 / 180); + half sinHsv = _HsvBright * _HsvSaturation * sin(_HsvShift * 3.14159265 / 180); + resultHsv.x = (.299 * _HsvBright + .701 * cosHsv + .168 * sinHsv) * col.x + + (.587 * _HsvBright - .587 * cosHsv + .330 * sinHsv) * col.y + + (.114 * _HsvBright - .114 * cosHsv - .497 * sinHsv) * col.z; + resultHsv.y = (.299 * _HsvBright - .299 * cosHsv - .328 * sinHsv) *col.x + + (.587 * _HsvBright + .413 * cosHsv + .035 * sinHsv) * col.y + + (.114 * _HsvBright - .114 * cosHsv + .292 * sinHsv) * col.z; + resultHsv.z = (.299 * _HsvBright - .3 * cosHsv + 1.25 * sinHsv) * col.x + + (.587 * _HsvBright - .588 * cosHsv - 1.05 * sinHsv) * col.y + + (.114 * _HsvBright + .886 * cosHsv - .203 * sinHsv) * col.z; + col.rgb = resultHsv; + #endif + //------------------------------------------------------- + + //OVERLAY_ON + #if OVERLAY_ON + half2 overlayUvs = d.texcoord0.xy; + overlayUvs.x += ((_Time.y + randomSeed) * _OverlayTextureScrollXSpeed) % 1; + overlayUvs.y += ((_Time.y + randomSeed) * _OverlayTextureScrollYSpeed) % 1; + half4 overlayCol = SAMPLE_TEXTURE2D(_OverlayTex, sampler_OverlayTex, TRANSFORM_TEX(overlayUvs, _OverlayTex)); + overlayCol.rgb *= _OverlayColor.rgb * _OverlayGlow; + #if !OVERLAYMULT_ON + overlayCol.rgb *= overlayCol.a * _OverlayColor.rgb * _OverlayColor.a * _OverlayBlend; + col.rgb += overlayCol.rgb; + #else + overlayCol.a *= _OverlayColor.a; + col = lerp(col, col * overlayCol, _OverlayBlend); + #endif + #endif + + //--------------------------------- + + //OUTBASE_ON + #if OUTBASE_ON + #if OUTBASEPIXELPERF_ON + half2 destUv = half2(_OutlinePixelWidth * _MainTex_TexelSize.x, _OutlinePixelWidth * _MainTex_TexelSize.y); + #else + half2 destUv = half2(_OutlineWidth * _MainTex_TexelSize.x * 200, _OutlineWidth * _MainTex_TexelSize.y * 200); + #endif + + #if OUTDIST_ON + d.texcoord3.x += ((_Time.x + _RandomSeed) * _OutlineDistortTexXSpeed) % 1; + d.texcoord3.y += ((_Time.x + _RandomSeed) * _OutlineDistortTexYSpeed) % 1; + #if ATLAS_ON + d.texcoord3 = half2((d.texcoord3.x - _MinXUV) / (_MaxXUV - _MinXUV), (d.texcoord3.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half outDistortAmnt = (SAMPLE_TEXTURE2D(_OutlineDistortTex, sampler_OutlineDistortTex, d.texcoord3).r - 0.5) * 0.2 * _OutlineDistortAmount; + destUv.x += outDistortAmnt; + destUv.y += outDistortAmnt; + #endif + + half spriteLeft = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(destUv.x, 0)).a; + half spriteRight = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy - half2(destUv.x, 0)).a; + half spriteBottom = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(0, destUv.y)).a; + half spriteTop = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy - half2(0, destUv.y)).a; + half result = spriteLeft + spriteRight + spriteBottom + spriteTop; + + #if OUTBASE8DIR_ON + half spriteTopLeft = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(destUv.x, destUv.y)).a; + half spriteTopRight = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(-destUv.x, destUv.y)).a; + half spriteBotLeft = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(destUv.x, -destUv.y)).a; + half spriteBotRight = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(-destUv.x, -destUv.y)).a; + result = result + spriteTopLeft + spriteTopRight + spriteBotLeft + spriteBotRight; + #endif + + result = step(0.05, saturate(result)); + + #if OUTTEX_ON + d.texcoord1.x += ((_Time.x + _RandomSeed) * _OutlineTexXSpeed) % 1; + d.texcoord1.y += ((_Time.x + _RandomSeed) * _OutlineTexYSpeed) % 1; + #if ATLAS_ON + d.texcoord1 = half2((d.texcoord1.x - _MinXUV) / (_MaxXUV - _MinXUV), (d.texcoord1.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half4 tempOutColor = SAMPLE_TEXTURE2D(_OutlineTex, sampler_OutlineTex, d.texcoord1); + tempOutColor *= _OutlineColor; + _OutlineColor = tempOutColor; + #endif + + result *= (1 - originalAlpha) * _OutlineAlpha; + + half4 outline = _OutlineColor * d.vertexColor.a; + outline.rgb *= _OutlineGlow; + outline.a = result; + #if ONLYOUTLINE_ON + col = outline; + #else + col = lerp(col, outline, result); + #endif + #endif + //------------------------------------------------------- + + //FADE_ON + #if FADE_ON + half2 tiledUvFade1 = TRANSFORM_TEX(d.texcoord0, _FadeTex); + half2 tiledUvFade2 = TRANSFORM_TEX(d.texcoord0, _FadeBurnTex); + #if ATLAS_ON + tiledUvFade1 = half2((tiledUvFade1.x - _MinXUV) / (_MaxXUV - _MinXUV), (tiledUvFade1.y - _MinYUV) / (_MaxYUV - _MinYUV)); + tiledUvFade2 = half2((tiledUvFade2.x - _MinXUV) / (_MaxXUV - _MinXUV), (tiledUvFade2.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half fadeTemp = SAMPLE_TEXTURE2D(_FadeTex, sampler_FadeTex, tiledUvFade1).r; + half fade = smoothstep(_FadeAmount, _FadeAmount + _FadeBurnTransition, fadeTemp); + half fadeBurn = saturate(smoothstep(_FadeAmount - _FadeBurnWidth, _FadeAmount - _FadeBurnWidth + 0.1, fadeTemp) * _FadeAmount); + col.a *= fade; + _FadeBurnColor.rgb *= _FadeBurnGlow; + col += fadeBurn * SAMPLE_TEXTURE2D(_FadeBurnTex, sampler_FadeBurnTex, tiledUvFade2) * _FadeBurnColor * originalAlpha * (1 - col.a); + #endif + //------------------------------------------------------- + + //SHADOW_ON + #if SHADOW_ON + half shadowA = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(_ShadowX, _ShadowY)).a; + half preMultShadowMask = 1 - (saturate(shadowA - col.a) * (1 - col.a)); + col.rgb *= 1 - ((shadowA - col.a) * (1 - col.a)); + col.rgb += (_ShadowColor * shadowA) * (1 - col.a); + col.a = max(shadowA * _ShadowAlpha * d.vertexColor.a, col.a); + #endif + + //------------------------------------------------------- + + //GLOW_ON + #if GLOW_ON + half4 emission; + #if GLOWTEX_ON + emission = SAMPLE_TEXTURE2D(_GlowTex, sampler_GlowTex, d.texcoord0); + #else + emission = col; + #endif + + col.rgb *= _GlowGlobal; + emission.rgb *= emission.a * col.a * _Glow * _GlowColor; + col.rgb += emission.rgb; + #endif + //------------------------------------------------------- + + //COLORRAMP_ON && COLORRAMPOUTLINE_ON + #if COLORRAMP_ON && COLORRAMPOUTLINE_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + luminance = saturate(luminance + _ColorRampLuminosity); + #if GRADIENTCOLORRAMP_ON + col.rgb = lerp(col.rgb, SAMPLE_TEXTURE2D(_ColorRampTexGradient, sampler_ColorRampTexGradient, half2(luminance, 0)).rgb, _ColorRampBlend); + #else + col.rgb = lerp(col.rgb, SAMPLE_TEXTURE2D(_ColorRampTex, sampler_ColorRampTex, half2(luminance, 0)).rgb, _ColorRampBlend); + #endif + #endif + //--------------- + + //GREYSCALE_ON && GREYSCALEOUTLINE_ON + #if GREYSCALE_ON && GREYSCALEOUTLINE_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + luminance = saturate(luminance + _GreyscaleLuminosity); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _GreyscaleTintColor, _GreyscaleBlend); + #endif + + //----------------------------------- + + //POSTERIZE_ON && POSTERIZEOUTLINE_ON + #if POSTERIZE_ON && POSTERIZEOUTLINE_ON + col.rgb = pow(col.rgb, _PosterizeGamma) * _PosterizeNumColors; + col.rgb = floor(col.rgb) / _PosterizeNumColors; + col.rgb = pow(col.rgb, 1.0 / _PosterizeGamma); + #endif + + //----------------------------------- + + //SHINE_ON + #if SHINE_ON + half2 uvShine = uvRect; + half cosAngle = cos(_ShineRotate); + half sinAngle = sin(_ShineRotate); + half2x2 rot = half2x2(cosAngle, -sinAngle, sinAngle, cosAngle); + uvShine -= half2(0.5, 0.5); + uvShine = mul(rot, uvShine); + uvShine += half2(0.5, 0.5); + half shineMask = SAMPLE_TEXTURE2D(_ShineMask, sampler_ShineMask, d.texcoord0.xy).a; + half currentDistanceProjection = (uvShine.x + uvShine.y) / 2; + half whitePower = 1 - (abs(currentDistanceProjection - _ShineLocation) / _ShineWidth); + col.rgb += col.a * whitePower * _ShineGlow * max(sign(currentDistanceProjection - (_ShineLocation - _ShineWidth)), 0.0) + * max(sign((_ShineLocation + _ShineWidth) - currentDistanceProjection), 0.0) * _ShineColor * shineMask; + #endif + + //----------------------------------- + + //HOLOGRAM_ON + #if HOLOGRAM_ON + half totalHologram = _HologramStripesAmount + _HologramUnmodAmount; + half hologramYCoord = ((uvRect.y + (((_Time.x + randomSeed) % 1) * _HologramStripesSpeed)) % totalHologram) / totalHologram; + hologramYCoord = abs(hologramYCoord); + half alpha = RemapFloat(saturate(hologramYCoord - (_HologramUnmodAmount/totalHologram)), 0.0, 1.0, _HologramMinAlpha, saturate(_HologramMaxAlpha)); + half hologramMask = max(sign((_HologramUnmodAmount/totalHologram) - hologramYCoord), 0.0); + half4 hologramResult = col; + hologramResult.a *= lerp(alpha, 1, hologramMask); + hologramResult.rgb *= max(1, _HologramMaxAlpha * max(sign(hologramYCoord - (_HologramUnmodAmount/totalHologram)), 0.0)); + hologramMask = 1 - step(0.01,hologramMask); + hologramResult.rgb += hologramMask * _HologramStripeColor * col.a; + col = lerp(col, hologramResult, _HologramBlend); + #endif + + //----------------------------------- + + //FLICKER_ON + #if FLICKER_ON + col.a *= saturate(col.a * step(frac(0.05 + (_Time.w + randomSeed) * _FlickerFreq), 1 - _FlickerPercent) + _FlickerAlpha); + #endif + //----------------------------------- + + //ALPHACUTOFF_ON + + //ALPHAROUND_ON + + //ALPHAOUTLINE_ON + #if ALPHAOUTLINE_ON + half alphaOutlineRes = pow(1 - col.a, max(_AlphaOutlinePower, 0.0001)) * step(_AlphaOutlineMinAlpha, col.a) * _AlphaOutlineBlend; + col.rgb = lerp(col.rgb, _AlphaOutlineColor.rgb * _AlphaOutlineGlow, alphaOutlineRes); + col.a = lerp(col.a, 1, alphaOutlineRes > 1); + #endif + //------------------------------------------------------- + + //FOG_ON + + //------------------ + + col *= _Color; + o.Albedo = col; + col.a *= _Alpha; + clip(col.a - _AlphaCutoffValue - 0.01); + o.Alpha = _Color.a; + } + + + + + + void ChainSurfaceFunction(inout Surface l, inout ShaderData d) + { + Ext_SurfaceFunction0(l, d); + // Ext_SurfaceFunction1(l, d); + // Ext_SurfaceFunction2(l, d); + // Ext_SurfaceFunction3(l, d); + // Ext_SurfaceFunction4(l, d); + // Ext_SurfaceFunction5(l, d); + // Ext_SurfaceFunction6(l, d); + // Ext_SurfaceFunction7(l, d); + // Ext_SurfaceFunction8(l, d); + // Ext_SurfaceFunction9(l, d); + // Ext_SurfaceFunction10(l, d); + // Ext_SurfaceFunction11(l, d); + // Ext_SurfaceFunction12(l, d); + // Ext_SurfaceFunction13(l, d); + // Ext_SurfaceFunction14(l, d); + // Ext_SurfaceFunction15(l, d); + // Ext_SurfaceFunction16(l, d); + // Ext_SurfaceFunction17(l, d); + // Ext_SurfaceFunction18(l, d); + // Ext_SurfaceFunction19(l, d); + // Ext_SurfaceFunction20(l, d); + // Ext_SurfaceFunction21(l, d); + // Ext_SurfaceFunction22(l, d); + // Ext_SurfaceFunction23(l, d); + // Ext_SurfaceFunction24(l, d); + // Ext_SurfaceFunction25(l, d); + // Ext_SurfaceFunction26(l, d); + // Ext_SurfaceFunction27(l, d); + // Ext_SurfaceFunction28(l, d); + // Ext_SurfaceFunction29(l, d); + } + +#if !_DECALSHADER + + void ChainModifyVertex(inout VertexData v, inout VertexToPixel v2p, float4 time) + { + ExtraV2F d; + + ZERO_INITIALIZE(ExtraV2F, d); + ZERO_INITIALIZE(Blackboard, d.blackboard); + // due to motion vectors in HDRP, we need to use the last + // time in certain spots. So if you are going to use _Time to adjust vertices, + // you need to use this time or motion vectors will break. + d.time = time; + + Ext_ModifyVertex0(v, d); + // Ext_ModifyVertex1(v, d); + // Ext_ModifyVertex2(v, d); + // Ext_ModifyVertex3(v, d); + // Ext_ModifyVertex4(v, d); + // Ext_ModifyVertex5(v, d); + // Ext_ModifyVertex6(v, d); + // Ext_ModifyVertex7(v, d); + // Ext_ModifyVertex8(v, d); + // Ext_ModifyVertex9(v, d); + // Ext_ModifyVertex10(v, d); + // Ext_ModifyVertex11(v, d); + // Ext_ModifyVertex12(v, d); + // Ext_ModifyVertex13(v, d); + // Ext_ModifyVertex14(v, d); + // Ext_ModifyVertex15(v, d); + // Ext_ModifyVertex16(v, d); + // Ext_ModifyVertex17(v, d); + // Ext_ModifyVertex18(v, d); + // Ext_ModifyVertex19(v, d); + // Ext_ModifyVertex20(v, d); + // Ext_ModifyVertex21(v, d); + // Ext_ModifyVertex22(v, d); + // Ext_ModifyVertex23(v, d); + // Ext_ModifyVertex24(v, d); + // Ext_ModifyVertex25(v, d); + // Ext_ModifyVertex26(v, d); + // Ext_ModifyVertex27(v, d); + // Ext_ModifyVertex28(v, d); + // Ext_ModifyVertex29(v, d); + + + // #if %EXTRAV2F0REQUIREKEY% + // v2p.extraV2F0 = d.extraV2F0; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // v2p.extraV2F1 = d.extraV2F1; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // v2p.extraV2F2 = d.extraV2F2; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // v2p.extraV2F3 = d.extraV2F3; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // v2p.extraV2F4 = d.extraV2F4; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // v2p.extraV2F5 = d.extraV2F5; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // v2p.extraV2F6 = d.extraV2F6; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // v2p.extraV2F7 = d.extraV2F7; + // #endif + } + + void ChainModifyTessellatedVertex(inout VertexData v, inout VertexToPixel v2p) + { + ExtraV2F d; + ZERO_INITIALIZE(ExtraV2F, d); + ZERO_INITIALIZE(Blackboard, d.blackboard); + + // #if %EXTRAV2F0REQUIREKEY% + // d.extraV2F0 = v2p.extraV2F0; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // d.extraV2F1 = v2p.extraV2F1; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // d.extraV2F2 = v2p.extraV2F2; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // d.extraV2F3 = v2p.extraV2F3; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // d.extraV2F4 = v2p.extraV2F4; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // d.extraV2F5 = v2p.extraV2F5; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // d.extraV2F6 = v2p.extraV2F6; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // d.extraV2F7 = v2p.extraV2F7; + // #endif + + + // Ext_ModifyTessellatedVertex0(v, d); + // Ext_ModifyTessellatedVertex1(v, d); + // Ext_ModifyTessellatedVertex2(v, d); + // Ext_ModifyTessellatedVertex3(v, d); + // Ext_ModifyTessellatedVertex4(v, d); + // Ext_ModifyTessellatedVertex5(v, d); + // Ext_ModifyTessellatedVertex6(v, d); + // Ext_ModifyTessellatedVertex7(v, d); + // Ext_ModifyTessellatedVertex8(v, d); + // Ext_ModifyTessellatedVertex9(v, d); + // Ext_ModifyTessellatedVertex10(v, d); + // Ext_ModifyTessellatedVertex11(v, d); + // Ext_ModifyTessellatedVertex12(v, d); + // Ext_ModifyTessellatedVertex13(v, d); + // Ext_ModifyTessellatedVertex14(v, d); + // Ext_ModifyTessellatedVertex15(v, d); + // Ext_ModifyTessellatedVertex16(v, d); + // Ext_ModifyTessellatedVertex17(v, d); + // Ext_ModifyTessellatedVertex18(v, d); + // Ext_ModifyTessellatedVertex19(v, d); + // Ext_ModifyTessellatedVertex20(v, d); + // Ext_ModifyTessellatedVertex21(v, d); + // Ext_ModifyTessellatedVertex22(v, d); + // Ext_ModifyTessellatedVertex23(v, d); + // Ext_ModifyTessellatedVertex24(v, d); + // Ext_ModifyTessellatedVertex25(v, d); + // Ext_ModifyTessellatedVertex26(v, d); + // Ext_ModifyTessellatedVertex27(v, d); + // Ext_ModifyTessellatedVertex28(v, d); + // Ext_ModifyTessellatedVertex29(v, d); + + // #if %EXTRAV2F0REQUIREKEY% + // v2p.extraV2F0 = d.extraV2F0; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // v2p.extraV2F1 = d.extraV2F1; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // v2p.extraV2F2 = d.extraV2F2; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // v2p.extraV2F3 = d.extraV2F3; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // v2p.extraV2F4 = d.extraV2F4; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // v2p.extraV2F5 = d.extraV2F5; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // v2p.extraV2F6 = d.extraV2F6; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // v2p.extraV2F7 = d.extraV2F7; + // #endif + } + + void ChainFinalColorForward(inout Surface l, inout ShaderData d, inout half4 color) + { + // Ext_FinalColorForward0(l, d, color); + // Ext_FinalColorForward1(l, d, color); + // Ext_FinalColorForward2(l, d, color); + // Ext_FinalColorForward3(l, d, color); + // Ext_FinalColorForward4(l, d, color); + // Ext_FinalColorForward5(l, d, color); + // Ext_FinalColorForward6(l, d, color); + // Ext_FinalColorForward7(l, d, color); + // Ext_FinalColorForward8(l, d, color); + // Ext_FinalColorForward9(l, d, color); + // Ext_FinalColorForward10(l, d, color); + // Ext_FinalColorForward11(l, d, color); + // Ext_FinalColorForward12(l, d, color); + // Ext_FinalColorForward13(l, d, color); + // Ext_FinalColorForward14(l, d, color); + // Ext_FinalColorForward15(l, d, color); + // Ext_FinalColorForward16(l, d, color); + // Ext_FinalColorForward17(l, d, color); + // Ext_FinalColorForward18(l, d, color); + // Ext_FinalColorForward19(l, d, color); + // Ext_FinalColorForward20(l, d, color); + // Ext_FinalColorForward21(l, d, color); + // Ext_FinalColorForward22(l, d, color); + // Ext_FinalColorForward23(l, d, color); + // Ext_FinalColorForward24(l, d, color); + // Ext_FinalColorForward25(l, d, color); + // Ext_FinalColorForward26(l, d, color); + // Ext_FinalColorForward27(l, d, color); + // Ext_FinalColorForward28(l, d, color); + // Ext_FinalColorForward29(l, d, color); + } + + void ChainFinalGBufferStandard(inout Surface s, inout ShaderData d, inout half4 GBuffer0, inout half4 GBuffer1, inout half4 GBuffer2, inout half4 outEmission, inout half4 outShadowMask) + { + // Ext_FinalGBufferStandard0(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard1(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard2(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard3(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard4(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard5(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard6(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard7(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard8(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard9(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard10(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard11(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard12(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard13(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard14(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard15(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard16(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard17(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard18(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard19(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard20(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard21(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard22(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard23(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard24(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard25(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard26(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard27(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard28(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard29(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + } +#endif + + + + + +#if _DECALSHADER + + ShaderData CreateShaderData(SurfaceDescriptionInputs IN) + { + ShaderData d = (ShaderData)0; + d.TBNMatrix = float3x3(IN.WorldSpaceTangent, IN.WorldSpaceBiTangent, IN.WorldSpaceNormal); + d.worldSpaceNormal = IN.WorldSpaceNormal; + d.worldSpaceTangent = IN.WorldSpaceTangent; + + d.worldSpacePosition = IN.WorldSpacePosition; + d.texcoord0 = IN.uv0.xyxy; + d.screenPos = IN.ScreenPosition; + + d.worldSpaceViewDir = normalize(_WorldSpaceCameraPos - d.worldSpacePosition); + + d.tangentSpaceViewDir = mul(d.TBNMatrix, d.worldSpaceViewDir); + + // these rarely get used, so we back transform them. Usually will be stripped. + #if _HDRP + // d.localSpacePosition = mul(GetWorldToObjectMatrix(), float4(GetCameraRelativePositionWS(d.worldSpacePosition), 1)).xyz; + #else + // d.localSpacePosition = mul(GetWorldToObjectMatrix(), float4(d.worldSpacePosition, 1)).xyz; + #endif + // d.localSpaceNormal = normalize(mul((float3x3)GetWorldToObjectMatrix(), d.worldSpaceNormal)); + // d.localSpaceTangent = normalize(mul((float3x3)GetWorldToObjectMatrix(), d.worldSpaceTangent.xyz)); + + // #if %SCREENPOSREQUIREKEY% + // d.screenUV = (IN.ScreenPosition.xy / max(0.01, IN.ScreenPosition.w)); + // #endif + + return d; + } +#else + + ShaderData CreateShaderData(VertexToPixel i + #if NEED_FACING + , bool facing + #endif + ) + { + ShaderData d = (ShaderData)0; + d.clipPos = i.pos; + d.worldSpacePosition = i.worldPos; + + d.worldSpaceNormal = normalize(i.worldNormal); + d.worldSpaceTangent.xyz = normalize(i.worldTangent.xyz); + + d.tangentSign = i.worldTangent.w * unity_WorldTransformParams.w; + float3 bitangent = cross(d.worldSpaceTangent.xyz, d.worldSpaceNormal) * d.tangentSign; + + d.TBNMatrix = float3x3(d.worldSpaceTangent, -bitangent, d.worldSpaceNormal); + d.worldSpaceViewDir = normalize(_WorldSpaceCameraPos - i.worldPos); + + d.tangentSpaceViewDir = mul(d.TBNMatrix, d.worldSpaceViewDir); + d.texcoord0 = i.texcoord0; + d.texcoord1 = i.texcoord1; + d.texcoord2 = i.texcoord2; + + // #if %TEXCOORD3REQUIREKEY% + d.texcoord3 = i.texcoord3; + // #endif + + // d.isFrontFace = facing; + // #if %VERTEXCOLORREQUIREKEY% + d.vertexColor = i.vertexColor; + // #endif + + // these rarely get used, so we back transform them. Usually will be stripped. + #if _HDRP + // d.localSpacePosition = mul(GetWorldToObjectMatrix(), float4(GetCameraRelativePositionWS(i.worldPos), 1)).xyz; + #else + // d.localSpacePosition = mul(GetWorldToObjectMatrix(), float4(i.worldPos, 1)).xyz; + #endif + // d.localSpaceNormal = normalize(mul((float3x3)GetWorldToObjectMatrix(), i.worldNormal)); + // d.localSpaceTangent = normalize(mul((float3x3)GetWorldToObjectMatrix(), i.worldTangent.xyz)); + + // #if %SCREENPOSREQUIREKEY% + // d.screenPos = i.screenPos; + // d.screenUV = (i.screenPos.xy / i.screenPos.w); + // #endif + + + // #if %EXTRAV2F0REQUIREKEY% + // d.extraV2F0 = i.extraV2F0; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // d.extraV2F1 = i.extraV2F1; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // d.extraV2F2 = i.extraV2F2; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // d.extraV2F3 = i.extraV2F3; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // d.extraV2F4 = i.extraV2F4; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // d.extraV2F5 = i.extraV2F5; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // d.extraV2F6 = i.extraV2F6; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // d.extraV2F7 = i.extraV2F7; + // #endif + + return d; + } + +#endif + + + +#if (SHADERPASS == SHADERPASS_LIGHT_TRANSPORT) + + // This was not in constant buffer in original unity, so keep outiside. But should be in as ShaderRenderPass frequency + float unity_OneOverOutputBoost; + float unity_MaxOutputValue; + + CBUFFER_START(UnityMetaPass) + // x = use uv1 as raster position + // y = use uv2 as raster position + bool4 unity_MetaVertexControl; + + // x = return albedo + // y = return normal + bool4 unity_MetaFragmentControl; + CBUFFER_END + + VertexToPixel Vert(VertexData inputMesh) + { + VertexToPixel output; + ZERO_INITIALIZE(VertexToPixel, output); + UNITY_SETUP_INSTANCE_ID(inputMesh); + UNITY_TRANSFER_INSTANCE_ID(inputMesh, output); + UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(output); + + // Output UV coordinate in vertex shader + float2 uv = float2(0.0, 0.0); + + if (unity_MetaVertexControl.x) + { + uv = inputMesh.texcoord1.xy * unity_LightmapST.xy + unity_LightmapST.zw; + } + else if (unity_MetaVertexControl.y) + { + uv = inputMesh.texcoord2.xy * unity_DynamicLightmapST.xy + unity_DynamicLightmapST.zw; + } + + // OpenGL right now needs to actually use the incoming vertex position + // so we create a fake dependency on it here that haven't any impact. + output.pos = float4(uv * 2.0 - 1.0, inputMesh.vertex.z > 0 ? 1.0e-4 : 0.0, 1.0); + + output.worldPos = TransformObjectToWorld(inputMesh.vertex.xyz).xyz; + + // Normal is required for triplanar mapping + output.worldNormal = TransformObjectToWorldNormal(inputMesh.normal); + // Not required but assign to silent compiler warning + output.worldTangent = float4(1.0, 0.0, 0.0, 0.0); + + output.texcoord0 = inputMesh.texcoord0; + output.texcoord1 = inputMesh.texcoord1; + output.texcoord2 = inputMesh.texcoord2; + // #if %TEXCOORD3REQUIREKEY% + output.texcoord3 = inputMesh.texcoord3; + // #endif + // #if %VERTEXCOLORREQUIREKEY% + output.vertexColor = inputMesh.vertexColor; + // #endif + + return output; + } +#else + + #if (_PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR))) + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/ShaderVariablesMatrixDefsHDCamera.hlsl" + + void MotionVectorPositionZBias(VertexToPixel input) + { + #if UNITY_REVERSED_Z + input.pos.z -= unity_MotionVectorsParams.z * input.pos.w; + #else + input.pos.z += unity_MotionVectorsParams.z * input.pos.w; + #endif + } + + #endif + + VertexToPixel Vert(VertexData input) + { + VertexToPixel output; + ZERO_INITIALIZE(VertexToPixel, output); + + UNITY_SETUP_INSTANCE_ID(input); + UNITY_TRANSFER_INSTANCE_ID(input, output); + UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(output); + + #if _HDRP && (_PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR))) + VertexData previousMesh = input; + #endif + + ChainModifyVertex(input, output, _Time); + + // This return the camera relative position (if enable) + float3 positionRWS = TransformObjectToWorld(input.vertex.xyz); + float3 normalWS = TransformObjectToWorldNormal(input.normal); + float4 tangentWS = float4(TransformObjectToWorldDir(input.tangent.xyz), input.tangent.w); + + + output.worldPos = GetAbsolutePositionWS(positionRWS); + output.pos = TransformWorldToHClip(positionRWS); + output.worldNormal = normalWS; + output.worldTangent = tangentWS; + + + output.texcoord0 = input.texcoord0; + output.texcoord1 = input.texcoord1; + output.texcoord2 = input.texcoord2; + + // #if %TEXCOORD3REQUIREKEY% + output.texcoord3 = input.texcoord3; + // #endif + + // #if %VERTEXCOLORREQUIREKEY% + output.vertexColor = input.vertexColor; + // #endif + + // #if %SCREENPOSREQUIREKEY% + // output.screenPos = ComputeScreenPos(output.pos, _ProjectionParams.x); + // #endif + + #if _HDRP && (_PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR))) + + #if !defined(TESSELLATION_ON) + MotionVectorPositionZBias(output); + #endif + + output.motionVectorCS = mul(UNITY_MATRIX_UNJITTERED_VP, float4(positionRWS.xyz, 1.0)); + // Note: unity_MotionVectorsParams.y is 0 is forceNoMotion is enabled + bool forceNoMotion = unity_MotionVectorsParams.y == 0.0; + if (forceNoMotion) + { + output.previousPositionCS = float4(0.0, 0.0, 0.0, 1.0); + } + else + { + bool hasDeformation = unity_MotionVectorsParams.x > 0.0; // Skin or morph target + + float3 effectivePositionOS = (hasDeformation ? previousMesh.previousPositionOS : previousMesh.vertex.xyz); + #if defined(_ADD_PRECOMPUTED_VELOCITY) + effectivePositionOS -= input.precomputedVelocity; + #endif + + previousMesh.vertex = float4(effectivePositionOS, 1); + VertexToPixel dummy = (VertexToPixel)0; + + + ChainModifyVertex(previousMesh, dummy, _LastTimeParameters); + + // we might need this for skinned objects? + //float3 normalWS = TransformPreviousObjectToWorldNormal(input.normal).xyz; + float3 previousPositionRWS = TransformPreviousObjectToWorld(previousMesh.vertex.xyz); + + #ifdef _WRITE_TRANSPARENT_MOTION_VECTOR + if (_TransparentCameraOnlyMotionVectors > 0) + { + previousPositionRWS = positionRWS.xyz; + } + #endif // _WRITE_TRANSPARENT_MOTION_VECTOR + + output.previousPositionCS = mul(UNITY_MATRIX_PREV_VP, float4(previousPositionRWS, 1.0)); + } + #endif // _HDRP && _PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR)) + + + return output; + } + + +#endif + + + + + + + + #if defined(WRITE_DECAL_BUFFER) && !defined(_DISABLE_DECALS) + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/Decal/DecalPrepassBuffer.hlsl" + #endif + + FragInputs BuildFragInputs(VertexToPixel input) + { + UNITY_SETUP_INSTANCE_ID(input); + FragInputs output; + ZERO_INITIALIZE(FragInputs, output); + + // Init to some default value to make the computer quiet (else it output 'divide by zero' warning even if value is not used). + // TODO: this is a really poor workaround, but the variable is used in a bunch of places + // to compute normals which are then passed on elsewhere to compute other values... + output.tangentToWorld = k_identity3x3; + output.positionSS = input.pos; // input.positionCS is SV_Position + // BETTER SHADERS: because we transform world position into actual world space for things like + // triplanar, etc, we have to back transform it here for lighting + output.positionRWS = GetCameraRelativePositionWS(input.worldPos); + output.tangentToWorld = BuildTangentToWorld(input.worldTangent, input.worldNormal); + output.texCoord0 = input.texcoord0; + output.texCoord1 = input.texcoord1; + output.texCoord2 = input.texcoord2; + + return output; + } + + void BuildSurfaceData(FragInputs fragInputs, inout Surface surfaceDescription, float3 V, PositionInputs posInput, out SurfaceData surfaceData, out float3 bentNormalWS) + { + // setup defaults -- these are used if the graph doesn't output a value + ZERO_INITIALIZE(SurfaceData, surfaceData); + + // specularOcclusion need to be init ahead of decal to quiet the compiler that modify the SurfaceData struct + // however specularOcclusion can come from the graph, so need to be init here so it can be override. + surfaceData.specularOcclusion = 1.0; + + // copy across graph values, if defined + surfaceData.baseColor = surfaceDescription.Albedo; + surfaceData.perceptualSmoothness = surfaceDescription.Smoothness; + surfaceData.ambientOcclusion = surfaceDescription.Occlusion; + surfaceData.specularOcclusion = surfaceDescription.SpecularOcclusion; + surfaceData.metallic = surfaceDescription.Metallic; + surfaceData.subsurfaceMask = surfaceDescription.SubsurfaceMask; + surfaceData.thickness = surfaceDescription.Thickness; + surfaceData.diffusionProfileHash = asuint(surfaceDescription.DiffusionProfileHash); + #if _USESPECULAR + surfaceData.specularColor = surfaceDescription.Specular; + #endif + surfaceData.coatMask = surfaceDescription.CoatMask; + surfaceData.anisotropy = surfaceDescription.Anisotropy; + surfaceData.iridescenceMask = surfaceDescription.IridescenceMask; + surfaceData.iridescenceThickness = surfaceDescription.IridescenceThickness; + + + + #if defined(_REFRACTION_PLANE) || defined(_REFRACTION_SPHERE) || defined(_REFRACTION_THIN) + if (_EnableSSRefraction) + { + surfaceData.transmittanceMask = (1.0 - surfaceDescription.Alpha); + surfaceDescription.Alpha = 1.0; + } + else + { + surfaceData.ior = surfaceDescription.ior; + surfaceData.transmittanceColor = surfaceDescription.transmittanceColor; + surfaceData.atDistance = surfaceDescription.atDistance; + surfaceData.transmittanceMask = surfaceDescription.transmittanceMask; + surfaceDescription.Alpha = 1.0; + } + #else + surfaceData.ior = 1.0; + surfaceData.transmittanceColor = float3(1.0, 1.0, 1.0); + surfaceData.atDistance = 1.0; + surfaceData.transmittanceMask = 0.0; + #endif + + + + // These static material feature allow compile time optimization + surfaceData.materialFeatures = MATERIALFEATUREFLAGS_LIT_STANDARD; + #ifdef _MATERIAL_FEATURE_SUBSURFACE_SCATTERING + surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_SUBSURFACE_SCATTERING; + #endif + + #ifdef _MATERIAL_FEATURE_TRANSMISSION + surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_TRANSMISSION; + #endif + + #ifdef _MATERIAL_FEATURE_ANISOTROPY + surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_ANISOTROPY; + surfaceData.normalWS = float3(0, 1, 0); + #endif + + #ifdef _MATERIAL_FEATURE_IRIDESCENCE + surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_IRIDESCENCE; + #endif + + #ifdef _MATERIAL_FEATURE_SPECULAR_COLOR + surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_SPECULAR_COLOR; + #endif + + #if defined(_MATERIAL_FEATURE_CLEAR_COAT) || _CLEARCOAT + surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_CLEAR_COAT; + #endif + + #if defined (_MATERIAL_FEATURE_SPECULAR_COLOR) && defined (_ENERGY_CONSERVING_SPECULAR) + // Require to have setup baseColor + // Reproduce the energy conservation done in legacy Unity. Not ideal but better for compatibility and users can unchek it + surfaceData.baseColor *= (1.0 - Max3(surfaceData.specularColor.r, surfaceData.specularColor.g, surfaceData.specularColor.b)); + #endif + + + + // compute world space normal + #if !_WORLDSPACENORMAL + surfaceData.normalWS = mul(surfaceDescription.Normal, fragInputs.tangentToWorld); + #else + surfaceData.normalWS = surfaceDescription.Normal; + #endif + + surfaceData.geomNormalWS = fragInputs.tangentToWorld[2]; + + surfaceData.tangentWS = normalize(fragInputs.tangentToWorld[0].xyz); // The tangent is not normalize in tangentToWorld for mikkt. TODO: Check if it expected that we normalize with Morten. Tag: SURFACE_GRADIENT + + + #if HAVE_DECALS + if (_EnableDecals) + { + float alpha = 1.0; + alpha = surfaceDescription.Alpha; + + // Both uses and modifies 'surfaceData.normalWS'. + DecalSurfaceData decalSurfaceData = GetDecalSurfaceData(posInput, fragInputs.tangentToWorld[2], alpha); + ApplyDecalToSurfaceData(decalSurfaceData, fragInputs.tangentToWorld[2], surfaceData); + } + #endif + + bentNormalWS = surfaceData.normalWS; + + surfaceData.tangentWS = Orthonormalize(surfaceData.tangentWS, surfaceData.normalWS); + + #ifdef DEBUG_DISPLAY + if (_DebugMipMapMode != DEBUGMIPMAPMODE_NONE) + { + // TODO: need to update mip info + surfaceData.metallic = 0; + } + + // We need to call ApplyDebugToSurfaceData after filling the surfarcedata and before filling builtinData + // as it can modify attribute use for static lighting + ApplyDebugToSurfaceData(fragInputs.tangentToWorld, surfaceData); + #endif + + // By default we use the ambient occlusion with Tri-ace trick (apply outside) for specular occlusion. + // If user provide bent normal then we process a better term + #if defined(_SPECULAR_OCCLUSION_CUSTOM) + // Just use the value passed through via the slot (not active otherwise) + #elif defined(_SPECULAR_OCCLUSION_FROM_AO_BENT_NORMAL) + // If we have bent normal and ambient occlusion, process a specular occlusion + surfaceData.specularOcclusion = GetSpecularOcclusionFromBentAO(V, bentNormalWS, surfaceData.normalWS, surfaceData.ambientOcclusion, PerceptualSmoothnessToPerceptualRoughness(surfaceData.perceptualSmoothness)); + #elif defined(_AMBIENT_OCCLUSION) && defined(_SPECULAR_OCCLUSION_FROM_AO) + surfaceData.specularOcclusion = GetSpecularOcclusionFromAmbientOcclusion(ClampNdotV(dot(surfaceData.normalWS, V)), surfaceData.ambientOcclusion, PerceptualSmoothnessToRoughness(surfaceData.perceptualSmoothness)); + #endif + + #if defined(_ENABLE_GEOMETRIC_SPECULAR_AA) && !defined(SHADER_STAGE_RAY_TRACING) + surfaceData.perceptualSmoothness = GeometricNormalFiltering(surfaceData.perceptualSmoothness, fragInputs.tangentToWorld[2], surfaceDescription.SpecularAAScreenSpaceVariance, surfaceDescription.SpecularAAThreshold); + #endif + } + + void GetSurfaceAndBuiltinData(VertexToPixel m2ps, FragInputs fragInputs, float3 V, inout PositionInputs posInput, + out SurfaceData surfaceData, out BuiltinData builtinData, inout Surface l, inout ShaderData d + #if NEED_FACING + , bool facing + #endif + ) + { + // Removed since crossfade does not work, probably needs extra material setup. + //#if !defined(SHADER_STAGE_RAY_TRACING) && !defined(_TESSELLATION_DISPLACEMENT) + // #ifdef LOD_FADE_CROSSFADE // enable dithering LOD transition if user select CrossFade transition in LOD group + // LODDitheringTransition(ComputeFadeMaskSeed(V, posInput.positionSS), unity_LODFade.x); + // #endif + //#endif + + d = CreateShaderData(m2ps + #if NEED_FACING + , facing + #endif + ); + + l = (Surface)0; + + l.Albedo = half3(0.5, 0.5, 0.5); + l.Normal = float3(0,0,1); + l.Occlusion = 1; + l.Alpha = 1; + l.SpecularOcclusion = 1; + + #if !defined(SHADER_STAGE_RAY_TRACING) && defined(_DEPTHOFFSET_ON) + l.outputDepth = d.clipPos.z; + #endif + + ChainSurfaceFunction(l, d); + + #if !defined(SHADER_STAGE_RAY_TRACING) && defined(_DEPTHOFFSET_ON) + //posInput.deviceDepth = l.outputDepth; + #endif + + #if _UNLIT + //l.Emission = l.Albedo; + //l.Albedo = 0; + l.Normal = half3(0,0,1); + l.Occlusion = 1; + l.Metallic = 0; + l.Specular = 0; + #endif + + surfaceData.geomNormalWS = d.worldSpaceNormal; + surfaceData.tangentWS = d.worldSpaceTangent; + fragInputs.tangentToWorld = d.TBNMatrix; + + float3 bentNormalWS; + BuildSurfaceData(fragInputs, l, V, posInput, surfaceData, bentNormalWS); + + + InitBuiltinData(posInput, l.Alpha, bentNormalWS, -d.worldSpaceNormal, fragInputs.texCoord1, fragInputs.texCoord2, builtinData); + + + + builtinData.emissiveColor = l.Emission; + + #if defined(_OVERRIDE_BAKEDGI) + builtinData.bakeDiffuseLighting = l.DiffuseGI; + builtinData.backBakeDiffuseLighting = l.BackDiffuseGI; + builtinData.emissiveColor += l.SpecularGI; + #endif + + #if defined(_OVERRIDE_SHADOWMASK) + builtinData.shadowMask0 = l.ShadowMask.x; + builtinData.shadowMask1 = l.ShadowMask.y; + builtinData.shadowMask2 = l.ShadowMask.z; + builtinData.shadowMask3 = l.ShadowMask.w; + #endif + + #if defined(UNITY_VIRTUAL_TEXTURING) + builtinData.vtPackedFeedback = surfaceData.VTPackedFeedback; + #endif + + #if (SHADERPASS == SHADERPASS_DISTORTION) + builtinData.distortion = surfaceData.Distortion; + builtinData.distortionBlur = surfaceData.DistortionBlur; + #endif + + #ifndef SHADER_UNLIT + // PostInitBuiltinData call ApplyDebugToBuiltinData + PostInitBuiltinData(V, posInput, surfaceData, builtinData); + #else + ApplyDebugToBuiltinData(builtinData); + #endif + + RAY_TRACING_OPTIONAL_ALPHA_TEST_PASS + } + + void Frag( VertexToPixel v2f, + OUTPUT_GBUFFER(outGBuffer) + #ifdef _DEPTHOFFSET_ON + , out float outputDepth : SV_Depth + #endif + #if NEED_FACING + , bool facing : SV_IsFrontFace + #endif + ) + { + UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX(v2f); + FragInputs input = BuildFragInputs(v2f); + + // input.positionSS is SV_Position + PositionInputs posInput = GetPositionInput(input.positionSS.xy, _ScreenSize.zw, input.positionSS.z, input.positionSS.w, input.positionRWS); + float3 V = GetWorldSpaceNormalizeViewDir(input.positionRWS); + + SurfaceData surfaceData; + BuiltinData builtinData; + Surface l; + ShaderData d; + GetSurfaceAndBuiltinData(v2f, input, V, posInput, surfaceData, builtinData, l, d + #if NEED_FACING + , facing + #endif + ); + + + ENCODE_INTO_GBUFFER(surfaceData, builtinData, posInput.positionSS, outGBuffer); + + #ifdef _DEPTHOFFSET_ON + outputDepth = l.outputDepth; + #endif + } + + ENDHLSL + } + + Pass + { + // based on HDLitPass.template + Name "ShadowCaster" + Tags { "LightMode" = "ShadowCaster" } + + + + //------------------------------------------------------------------------------------- + // Render Modes (Blend, Cull, ZTest, Stencil, etc) + //------------------------------------------------------------------------------------- + + Cull Back + ZWrite On + ColorMask 0 + ZClip [_ZClip] + + + Tags { "RenderType" = "Opaque" "Queue" = "Geometry" "PreviewType" = "Plane" } + Cull [_CullingOption] + ZWrite [_ZWrite] + ZTest [_ZTestMode] + + + //------------------------------------------------------------------------------------- + // End Render Modes + //------------------------------------------------------------------------------------- + + HLSLPROGRAM + + #pragma target 4.5 + #pragma only_renderers d3d11 playstation xboxone vulkan metal switch + //#pragma enable_d3d11_debug_symbols + + #pragma multi_compile_instancing + #pragma instancing_options renderinglayer + #pragma multi_compile _ DOTS_INSTANCING_ON + + //#pragma multi_compile_local _ _ALPHATEST_ON + + + //#pragma shader_feature _ _SURFACE_TYPE_TRANSPARENT + //#pragma shader_feature_local _BLENDMODE_OFF _BLENDMODE_ALPHA _BLENDMODE_ADD _BLENDMODE_PRE_MULTIPLY + //#pragma shader_feature_local _ _ADD_PRECOMPUTED_VELOCITY + //#pragma shader_feature_local _ _TRANSPARENT_WRITES_MOTION_VEC + //#pragma shader_feature_local _ _ENABLE_FOG_ON_TRANSPARENT + //#pragma shader_feature_local _ _DISABLE_DECALS + //#pragma shader_feature_local _ _DISABLE_SSR + //#pragma shader_feature_local _ _DISABLE_SSR_TRANSPARENT + //#pragma shader_feature_local _REFRACTION_OFF _REFRACTION_PLANE _REFRACTION_SPHERE _REFRACTION_THIN + #pragma multi_compile _ WRITE_DECAL_BUFFER + //------------------------------------------------------------------------------------- + // Variant Definitions (active field translations to HDRP defines) + //------------------------------------------------------------------------------------- + // #define _MATERIAL_FEATURE_SUBSURFACE_SCATTERING 1 + // #define _MATERIAL_FEATURE_TRANSMISSION 1 + // #define _MATERIAL_FEATURE_ANISOTROPY 1 + // #define _MATERIAL_FEATURE_IRIDESCENCE 1 + // #define _MATERIAL_FEATURE_SPECULAR_COLOR 1 + #define _ENABLE_FOG_ON_TRANSPARENT 1 + // #define _AMBIENT_OCCLUSION 1 + // #define _SPECULAR_OCCLUSION_FROM_AO 1 + // #define _SPECULAR_OCCLUSION_FROM_AO_BENT_NORMAL 1 + // #define _SPECULAR_OCCLUSION_CUSTOM 1 + // #define _ENERGY_CONSERVING_SPECULAR 1 + // #define _ENABLE_GEOMETRIC_SPECULAR_AA 1 + // #define _HAS_REFRACTION 1 + // #define _REFRACTION_PLANE 1 + // #define _REFRACTION_SPHERE 1 + // #define _DISABLE_DECALS 1 + // #define _DISABLE_SSR 1 + // #define _ADD_PRECOMPUTED_VELOCITY + // #define _WRITE_TRANSPARENT_MOTION_VECTOR 1 + // #define _DEPTHOFFSET_ON 1 + // #define _BLENDMODE_PRESERVE_SPECULAR_LIGHTING 1 + + #define SHADERPASS SHADERPASS_SHADOWS + #define RAYTRACING_SHADER_GRAPH_HIGH + #define _PASSSHADOW 1 + + + #pragma shader_feature_local GLOW_ON + #pragma shader_feature_local FADE_ON + #pragma shader_feature_local OUTBASE_ON + #pragma shader_feature_local ONLYOUTLINE_ON + #pragma shader_feature_local GRADIENT_ON + #pragma shader_feature_local GRADIENT2COL_ON + #pragma shader_feature_local RADIALGRADIENT_ON + #pragma shader_feature_local COLORSWAP_ON + #pragma shader_feature_local HSV_ON + #pragma shader_feature_local CHANGECOLOR_ON + #pragma shader_feature_local CHANGECOLOR2_ON + #pragma shader_feature_local CHANGECOLOR3_ON + #pragma shader_feature_local COLORRAMP_ON + #pragma shader_feature_local GRADIENTCOLORRAMP_ON + #pragma shader_feature_local HITEFFECT_ON + #pragma shader_feature_local NEGATIVE_ON + #pragma shader_feature_local PIXELATE_ON + #pragma shader_feature_local GREYSCALE_ON + #pragma shader_feature_local POSTERIZE_ON + #pragma shader_feature_local BLUR_ON + #pragma shader_feature_local MOTIONBLUR_ON + #pragma shader_feature_local GHOST_ON + #pragma shader_feature_local ALPHAOUTLINE_ON + #pragma shader_feature_local INNEROUTLINE_ON + #pragma shader_feature_local ONLYINNEROUTLINE_ON + #pragma shader_feature_local HOLOGRAM_ON + #pragma shader_feature_local CHROMABERR_ON + #pragma shader_feature_local GLITCH_ON + #pragma shader_feature_local FLICKER_ON + #pragma shader_feature_local SHADOW_ON + #pragma shader_feature_local SHINE_ON + #pragma shader_feature_local CONTRAST_ON + #pragma shader_feature_local OVERLAY_ON + #pragma shader_feature_local OVERLAYMULT_ON + #pragma shader_feature_local DOODLE_ON + #pragma shader_feature_local WIND_ON + #pragma shader_feature_local WAVEUV_ON + #pragma shader_feature_local ROUNDWAVEUV_ON + #pragma shader_feature_local RECTSIZE_ON + #pragma shader_feature_local OFFSETUV_ON + #pragma shader_feature_local CLIPPING_ON + #pragma shader_feature_local RADIALCLIPPING_ON + #pragma shader_feature_local TEXTURESCROLL_ON + #pragma shader_feature_local ZOOMUV_ON + #pragma shader_feature_local DISTORT_ON + #pragma shader_feature_local WARP_ON + #pragma shader_feature_local TWISTUV_ON + #pragma shader_feature_local ROTATEUV_ON + #pragma shader_feature_local POLARUV_ON + #pragma shader_feature_local FISHEYE_ON + #pragma shader_feature_local PINCH_ON + #pragma shader_feature_local SHAKEUV_ON + + #pragma shader_feature_local GLOWTEX_ON + #pragma shader_feature_local OUTTEX_ON + #pragma shader_feature_local OUTDIST_ON + #pragma shader_feature_local OUTBASE8DIR_ON + #pragma shader_feature_local OUTBASEPIXELPERF_ON + #pragma shader_feature_local COLORRAMPOUTLINE_ON + #pragma shader_feature_local GREYSCALEOUTLINE_ON + #pragma shader_feature_local POSTERIZEOUTLINE_ON + #pragma shader_feature_local BLURISHD_ON + #pragma shader_feature_local MANUALWIND_ON + #pragma shader_feature_local ATLAS_ON + #pragma shader_feature_local PREMULTIPLYALPHA_ON + + #pragma shader_feature BILBOARD_ON + #pragma shader_feature BILBOARDY_ON + + #pragma shader_feature NORMALMAP_ON + + + #define _HDRP 1 +#define _USINGTEXCOORD1 1 +#define _USINGTEXCOORD2 1 + + + #pragma vertex Vert + #pragma fragment Frag + + //------------------------------------------------------------------------------------- + // Defines + //------------------------------------------------------------------------------------- + + + // useful conversion functions to make surface shader code just work + + #define UNITY_DECLARE_TEX2D(name) TEXTURE2D(name); SAMPLER(sampler##name); + #define UNITY_DECLARE_TEX2D_NOSAMPLER(name) TEXTURE2D(name); + #define UNITY_DECLARE_TEX2DARRAY(name) TEXTURE2D_ARRAY(name); SAMPLER(sampler##name); + #define UNITY_DECLARE_TEX2DARRAY_NOSAMPLER(tex) TEXTURE2D_ARRAY(tex); + + #define UNITY_SAMPLE_TEX2DARRAY(tex,coord) SAMPLE_TEXTURE2D_ARRAY(tex, sampler##tex, coord.xy, coord.z) + #define UNITY_SAMPLE_TEX2DARRAY_LOD(tex,coord,lod) SAMPLE_TEXTURE2D_ARRAY_LOD(tex, sampler##tex, coord.xy, coord.z, lod) + #define UNITY_SAMPLE_TEX2D(tex, coord) SAMPLE_TEXTURE2D(tex, sampler##tex, coord) + #define UNITY_SAMPLE_TEX2D_SAMPLER(tex, samp, coord) SAMPLE_TEXTURE2D(tex, sampler##samp, coord) + + #define UNITY_SAMPLE_TEX2D_LOD(tex,coord, lod) SAMPLE_TEXTURE2D_LOD(tex, sampler_##tex, coord, lod) + #define UNITY_SAMPLE_TEX2D_SAMPLER_LOD(tex,samplertex,coord, lod) SAMPLE_TEXTURE2D_LOD (tex, sampler##samplertex,coord, lod) + + #if defined(UNITY_COMPILER_HLSL) + #define UNITY_INITIALIZE_OUTPUT(type,name) name = (type)0; + #else + #define UNITY_INITIALIZE_OUTPUT(type,name) + #endif + + #define sampler2D_float sampler2D + #define sampler2D_half sampler2D + + #undef WorldNormalVector + #define WorldNormalVector(data, normal) mul(normal, data.TBNMatrix) + + #define UnityObjectToWorldNormal(normal) mul(GetObjectToWorldMatrix(), normal) + + + + +// HDRP Adapter stuff + #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Common.hlsl" + #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Texture.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/ShaderVariables.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/ShaderPass/FragInputs.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/ShaderPass/ShaderPass.cs.hlsl" + #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/TextureStack.hlsl" // Required to be include before we include properties as it define DECLARE_STACK_CB +#if UNITY_VERSION >= UNITY_2021_3_31 + #include "Packages/com.unity.shadergraph/ShaderGraphLibrary/Functions.hlsl" // Need to be here for Gradient struct definition +#else + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/ShaderGraphHeader.hlsl" +#endif + #ifdef RAYTRACING_SHADER_GRAPH_DEFAULT + #define RAYTRACING_SHADER_GRAPH_HIGH + #endif + + #ifdef RAYTRACING_SHADER_GRAPH_RAYTRACED + #define RAYTRACING_SHADER_GRAPH_LOW + #endif + // end + + + + + // If we use subsurface scattering, enable output split lighting (for forward pass) + #if defined(_MATERIAL_FEATURE_SUBSURFACE_SCATTERING) && !defined(_SURFACE_TYPE_TRANSPARENT) + #define OUTPUT_SPLIT_LIGHTING + #endif + + #define HAVE_RECURSIVE_RENDERING + + #if SHADERPASS == SHADERPASS_TRANSPARENT_DEPTH_PREPASS + #if !defined(_DISABLE_SSR_TRANSPARENT) && !defined(SHADER_UNLIT) + #define WRITE_NORMAL_BUFFER + #endif + #endif + + #ifndef DEBUG_DISPLAY + // In case of opaque we don't want to perform the alpha test, it is done in depth prepass and we use depth equal for ztest (setup from UI) + // Don't do it with debug display mode as it is possible there is no depth prepass in this case + #if !defined(_SURFACE_TYPE_TRANSPARENT) && defined(_ALPHATEST) + #if SHADERPASS == SHADERPASS_FORWARD + #define SHADERPASS_FORWARD_BYPASS_ALPHA_TEST + #elif SHADERPASS == SHADERPASS_GBUFFER + #define SHADERPASS_GBUFFER_BYPASS_ALPHA_TEST + #endif + #endif + #endif + + // Define _DEFERRED_CAPABLE_MATERIAL for shader capable to run in deferred pass + #if defined(SHADER_LIT) && !defined(_SURFACE_TYPE_TRANSPARENT) + #define _DEFERRED_CAPABLE_MATERIAL + #endif + + // Translate transparent motion vector define + #if defined(_TRANSPARENT_WRITES_MOTION_VEC) && defined(_SURFACE_TYPE_TRANSPARENT) + #define _WRITE_TRANSPARENT_MOTION_VECTOR + #endif + + + + + CBUFFER_START(UnityPerMaterial) + float _UseShadowThreshold; + float _BlendMode; + float _EnableBlendModePreserveSpecularLighting; + float _RayTracing; + float _RefractionModel; + + + half4 _Color; + half4 _MainTex_ST, _MainTex_TexelSize; + half _Alpha, _AlphaCutoffValue; + + #if ATLAS_ON + half _MinXUV, _MaxXUV, _MinYUV, _MaxYUV; + #endif + + #if GLOW_ON + half4 _GlowColor; + half _Glow, _GlowGlobal; + #endif + + #if HSV_ON + half _HsvShift, _HsvSaturation, _HsvBright; + #endif + + #if DISTORT_ON + half4 _DistortTex_ST; + half _DistortTexXSpeed, _DistortTexYSpeed, _DistortAmount; + #endif + + #if FADE_ON + half4 _FadeBurnColor, _FadeTex_ST, _FadeBurnTex_ST; + half _FadeAmount, _FadeBurnWidth, _FadeBurnTransition,_FadeBurnGlow; + #endif + + #if OUTBASE_ON + half4 _OutlineColor; + half _OutlineAlpha, _OutlineGlow, _OutlineWidth; + int _OutlinePixelWidth; + #endif + + #if OUTTEX_ON + half4 _OutlineTex_ST; + half _OutlineTexXSpeed, _OutlineTexYSpeed; + #endif + + #if OUTDIST_ON + half4 _OutlineDistortTex_ST; + half _OutlineDistortTexXSpeed, _OutlineDistortTexYSpeed, _OutlineDistortAmount; + #endif + + #if ALPHAOUTLINE_ON + half _AlphaOutlineGlow, _AlphaOutlinePower, _AlphaOutlineMinAlpha, _AlphaOutlineBlend; + half4 _AlphaOutlineColor; + #endif + + #if INNEROUTLINE_ON + half _InnerOutlineThickness, _InnerOutlineAlpha, _InnerOutlineGlow; + half4 _InnerOutlineColor; + #endif + + #if GRADIENT_ON + half _GradBlend, _GradBoostX, _GradBoostY; + half4 _GradTopRightCol, _GradTopLeftCol, _GradBotRightCol, _GradBotLeftCol; + #endif + + #if COLORSWAP_ON + half4 _ColorSwapRed, _ColorSwapGreen, _ColorSwapBlue; + half _ColorSwapRedLuminosity, _ColorSwapGreenLuminosity, _ColorSwapBlueLuminosity, _ColorSwapBlend; + #endif + + #if CHANGECOLOR_ON + half4 _ColorChangeNewCol, _ColorChangeTarget; + half _ColorChangeTolerance, _ColorChangeLuminosity; + #endif + #if CHANGECOLOR2_ON + half4 _ColorChangeNewCol2, _ColorChangeTarget2; + half _ColorChangeTolerance2; + #endif + #if CHANGECOLOR3_ON + half4 _ColorChangeNewCol3, _ColorChangeTarget3; + half _ColorChangeTolerance3; + #endif + + #if COLORRAMP_ON + half _ColorRampLuminosity, _ColorRampBlend; + #endif + + #if HITEFFECT_ON + half4 _HitEffectColor; + half _HitEffectGlow, _HitEffectBlend; + #endif + + #if NEGATIVE_ON + half _NegativeAmount; + #endif + + #if PIXELATE_ON + half _PixelateSize; + #endif + + #if GREYSCALE_ON + half _GreyscaleLuminosity, _GreyscaleBlend; + half4 _GreyscaleTintColor; + #endif + + #if POSTERIZE_ON + half _PosterizeNumColors, _PosterizeGamma; + #endif + + #if BLUR_ON + half _BlurIntensity; + #endif + + #if MOTIONBLUR_ON + half _MotionBlurAngle, _MotionBlurDist; + #endif + + #if GHOST_ON + half _GhostColorBoost, _GhostTransparency, _GhostBlend; + #endif + + #if HOLOGRAM_ON + half _HologramStripesAmount, _HologramMinAlpha, _HologramUnmodAmount, _HologramStripesSpeed, _HologramMaxAlpha, _HologramBlend; + half4 _HologramStripeColor; + #endif + + #if CHROMABERR_ON + half _ChromAberrAmount, _ChromAberrAlpha; + #endif + + #if GLITCH_ON + half _GlitchAmount, _GlitchSize; + #endif + + #if FLICKER_ON + half _FlickerFreq, _FlickerPercent, _FlickerAlpha; + #endif + + #if SHADOW_ON + half _ShadowX, _ShadowY, _ShadowAlpha; + half4 _ShadowColor; + #endif + + #if SHINE_ON + half4 _ShineColor; + half _ShineLocation, _ShineRotate, _ShineWidth, _ShineGlow; + #endif + + #if CONTRAST_ON + half _Contrast, _Brightness; + #endif + + #if OVERLAY_ON + half4 _OverlayTex_ST, _OverlayColor; + half _OverlayGlow, _OverlayBlend, _OverlayTextureScrollXSpeed, _OverlayTextureScrollYSpeed; + #endif + + #if DOODLE_ON + half _HandDrawnAmount, _HandDrawnSpeed; + #endif + + #if WIND_ON + half _GrassSpeed, _GrassWind, _GrassManualAnim, _GrassRadialBend; + #endif + + #if WAVEUV_ON + float _WaveAmount, _WaveSpeed, _WaveStrength, _WaveX, _WaveY; + #endif + + #if ROUNDWAVEUV_ON + half _RoundWaveStrength, _RoundWaveSpeed; + #endif + + #if RECTSIZE_ON + half _RectSize; + #endif + + #if OFFSETUV_ON + half _OffsetUvX, _OffsetUvY; + #endif + + #if CLIPPING_ON + half _ClipUvLeft, _ClipUvRight, _ClipUvUp, _ClipUvDown; + #endif + + #if RADIALCLIPPING_ON + half _RadialStartAngle, _RadialClip, _RadialClip2; + #endif + + #if TEXTURESCROLL_ON + half _TextureScrollXSpeed, _TextureScrollYSpeed; + #endif + + #if ZOOMUV_ON + half _ZoomUvAmount; + #endif + + #if WARP_ON + half _WarpStrength, _WarpSpeed, _WarpScale; + #endif + + #if TWISTUV_ON + half _TwistUvAmount, _TwistUvPosX, _TwistUvPosY, _TwistUvRadius; + #endif + + #if ROTATEUV_ON + half _RotateUvAmount; + #endif + + #if FISHEYE_ON + half _FishEyeUvAmount; + #endif + + #if PINCH_ON + half _PinchUvAmount; + #endif + + #if SHAKEUV_ON + half _ShakeUvSpeed, _ShakeUvX, _ShakeUvY; + #endif + + #if NORMALMAP_ON + half _NormalStrength; + #endif + + float _RandomSeed; + + + + + CBUFFER_END + + + + // -- Property used by ScenePickingPass + #ifdef SCENEPICKINGPASS + float4 _SelectionID; + #endif + + // -- Properties used by SceneSelectionPass + #ifdef SCENESELECTIONPASS + int _ObjectId; + int _PassValue; + #endif + + + // data across stages, stripped like the above. + struct VertexToPixel + { + float4 pos : SV_POSITION; + float3 worldPos : TEXCOORD0; + float3 worldNormal : TEXCOORD1; + float4 worldTangent : TEXCOORD2; + float4 texcoord0 : TEXCOORD3; + float4 texcoord1 : TEXCOORD4; + float4 texcoord2 : TEXCOORD5; + // #if %TEXCOORD3REQUIREKEY% + float4 texcoord3 : TEXCOORD6; + // #endif + + // #if %SCREENPOSREQUIREKEY% + // float4 screenPos : TEXCOORD7; + // #endif + + // #if %VERTEXCOLORREQUIREKEY% + float4 vertexColor : COLOR; + // #endif + + // #if %EXTRAV2F0REQUIREKEY% + // float4 extraV2F0 : TEXCOORD8; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // float4 extraV2F1 : TEXCOORD9; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // float4 extraV2F2 : TEXCOORD10; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // float4 extraV2F3 : TEXCOORD11; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // float4 extraV2F4 : TEXCOORD12; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // float4 extraV2F5 : TEXCOORD13; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // float4 extraV2F6 : TEXCOORD14; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // float4 extraV2F7 : TEXCOORD15; + // #endif + + #if UNITY_ANY_INSTANCING_ENABLED + UNITY_VERTEX_INPUT_INSTANCE_ID + #endif // UNITY_ANY_INSTANCING_ENABLED + + #if _HDRP && (_PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR))) + float4 previousPositionCS : TEXCOORD16; // Contain previous transform position (in case of skinning for example) + float4 motionVectorCS : TEXCOORD17; + #endif + + UNITY_VERTEX_OUTPUT_STEREO + }; + + + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Debug/DebugDisplay.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/Material.hlsl" + #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/NormalSurfaceGradient.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/Lit/Lit.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/BuiltinUtilities.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/MaterialUtilities.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/Decal/DecalUtilities.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/Lit/LitDecalData.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/ShaderGraphFunctions.hlsl" + + + + + // data describing the user output of a pixel + struct Surface + { + half3 Albedo; + half Height; + half3 Normal; + half Smoothness; + half3 Emission; + half Metallic; + half3 Specular; + half Occlusion; + half SpecularPower; // for simple lighting + half Alpha; + float outputDepth; // if written, SV_Depth semantic is used. ShaderData.clipPos.z is unused value + // HDRP Only + half SpecularOcclusion; + half SubsurfaceMask; + half Thickness; + half CoatMask; + half CoatSmoothness; + half Anisotropy; + half IridescenceMask; + half IridescenceThickness; + int DiffusionProfileHash; + float SpecularAAThreshold; + float SpecularAAScreenSpaceVariance; + // requires _OVERRIDE_BAKEDGI to be defined, but is mapped in all pipelines + float3 DiffuseGI; + float3 BackDiffuseGI; + float3 SpecularGI; + float ior; + float3 transmittanceColor; + float atDistance; + float transmittanceMask; + // requires _OVERRIDE_SHADOWMASK to be defines + float4 ShadowMask; + + // for decals + float NormalAlpha; + float MAOSAlpha; + + + }; + + // Data the user declares in blackboard blocks + struct Blackboard + { + + float blackboardDummyData; + }; + + // data the user might need, this will grow to be big. But easy to strip + struct ShaderData + { + float4 clipPos; // SV_POSITION + float3 localSpacePosition; + float3 localSpaceNormal; + float3 localSpaceTangent; + + float3 worldSpacePosition; + float3 worldSpaceNormal; + float3 worldSpaceTangent; + float tangentSign; + + float3 worldSpaceViewDir; + float3 tangentSpaceViewDir; + + float4 texcoord0; + float4 texcoord1; + float4 texcoord2; + float4 texcoord3; + + float2 screenUV; + float4 screenPos; + + float4 vertexColor; + bool isFrontFace; + + float4 extraV2F0; + float4 extraV2F1; + float4 extraV2F2; + float4 extraV2F3; + float4 extraV2F4; + float4 extraV2F5; + float4 extraV2F6; + float4 extraV2F7; + + float3x3 TBNMatrix; + Blackboard blackboard; + }; + + struct VertexData + { + #if SHADER_TARGET > 30 + // uint vertexID : SV_VertexID; + #endif + float4 vertex : POSITION; + float3 normal : NORMAL; + float4 tangent : TANGENT; + float4 texcoord0 : TEXCOORD0; + + // optimize out mesh coords when not in use by user or lighting system + #if _URP && (_USINGTEXCOORD1 || _PASSMETA || _PASSFORWARD || _PASSGBUFFER) + float4 texcoord1 : TEXCOORD1; + #endif + + #if _URP && (_USINGTEXCOORD2 || _PASSMETA || ((_PASSFORWARD || _PASSGBUFFER) && defined(DYNAMICLIGHTMAP_ON))) + float4 texcoord2 : TEXCOORD2; + #endif + + #if _STANDARD && (_USINGTEXCOORD1 || (_PASSMETA || ((_PASSFORWARD || _PASSGBUFFER || _PASSFORWARDADD) && LIGHTMAP_ON))) + float4 texcoord1 : TEXCOORD1; + #endif + #if _STANDARD && (_USINGTEXCOORD2 || (_PASSMETA || ((_PASSFORWARD || _PASSGBUFFER) && DYNAMICLIGHTMAP_ON))) + float4 texcoord2 : TEXCOORD2; + #endif + + + #if _HDRP + float4 texcoord1 : TEXCOORD1; + float4 texcoord2 : TEXCOORD2; + #endif + + // #if %TEXCOORD3REQUIREKEY% + float4 texcoord3 : TEXCOORD3; + // #endif + + // #if %VERTEXCOLORREQUIREKEY% + float4 vertexColor : COLOR; + // #endif + + #if _PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR)) + float3 previousPositionOS : TEXCOORD4; // Contain previous transform position (in case of skinning for example) + #if defined (_ADD_PRECOMPUTED_VELOCITY) + float3 precomputedVelocity : TEXCOORD5; // Add Precomputed Velocity (Alembic computes velocities on runtime side). + #endif + #endif + + UNITY_VERTEX_INPUT_INSTANCE_ID + }; + + struct TessVertex + { + float4 vertex : INTERNALTESSPOS; + float3 normal : NORMAL; + float4 tangent : TANGENT; + float4 texcoord0 : TEXCOORD0; + float4 texcoord1 : TEXCOORD1; + float4 texcoord2 : TEXCOORD2; + + // #if %TEXCOORD3REQUIREKEY% + float4 texcoord3 : TEXCOORD3; + // #endif + + // #if %VERTEXCOLORREQUIREKEY% + float4 vertexColor : COLOR; + // #endif + + // #if %EXTRAV2F0REQUIREKEY% + // float4 extraV2F0 : TEXCOORD5; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // float4 extraV2F1 : TEXCOORD6; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // float4 extraV2F2 : TEXCOORD7; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // float4 extraV2F3 : TEXCOORD8; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // float4 extraV2F4 : TEXCOORD9; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // float4 extraV2F5 : TEXCOORD10; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // float4 extraV2F6 : TEXCOORD11; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // float4 extraV2F7 : TEXCOORD12; + // #endif + + #if _PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR)) + float3 previousPositionOS : TEXCOORD13; // Contain previous transform position (in case of skinning for example) + #if defined (_ADD_PRECOMPUTED_VELOCITY) + float3 precomputedVelocity : TEXCOORD14; + #endif + #endif + + UNITY_VERTEX_INPUT_INSTANCE_ID + UNITY_VERTEX_OUTPUT_STEREO + }; + + struct ExtraV2F + { + float4 extraV2F0; + float4 extraV2F1; + float4 extraV2F2; + float4 extraV2F3; + float4 extraV2F4; + float4 extraV2F5; + float4 extraV2F6; + float4 extraV2F7; + Blackboard blackboard; + float4 time; + }; + + + float3 WorldToTangentSpace(ShaderData d, float3 normal) + { + return mul(d.TBNMatrix, normal); + } + + float3 TangentToWorldSpace(ShaderData d, float3 normal) + { + return mul(normal, d.TBNMatrix); + } + + // in this case, make standard more like SRPs, because we can't fix + // unity_WorldToObject in HDRP, since it already does macro-fu there + + #if _STANDARD + float3 TransformWorldToObject(float3 p) { return mul(unity_WorldToObject, float4(p, 1)); }; + float3 TransformObjectToWorld(float3 p) { return mul(unity_ObjectToWorld, float4(p, 1)); }; + float4 TransformWorldToObject(float4 p) { return mul(unity_WorldToObject, p); }; + float4 TransformObjectToWorld(float4 p) { return mul(unity_ObjectToWorld, p); }; + float4x4 GetWorldToObjectMatrix() { return unity_WorldToObject; } + float4x4 GetObjectToWorldMatrix() { return unity_ObjectToWorld; } + #if (defined(SHADER_API_D3D11) || defined(SHADER_API_XBOXONE) || defined(UNITY_COMPILER_HLSLCC) || defined(SHADER_API_PSSL) || (SHADER_TARGET_SURFACE_ANALYSIS && !SHADER_TARGET_SURFACE_ANALYSIS_MOJOSHADER)) + #define UNITY_SAMPLE_TEX2D_LOD(tex,coord, lod) tex.SampleLevel (sampler##tex,coord, lod) + #define UNITY_SAMPLE_TEX2D_SAMPLER_LOD(tex,samplertex,coord, lod) tex.SampleLevel (sampler##samplertex,coord, lod) + #else + #define UNITY_SAMPLE_TEX2D_LOD(tex,coord,lod) tex2D (tex,coord,0,lod) + #define UNITY_SAMPLE_TEX2D_SAMPLER_LOD(tex,samplertex,coord,lod) tex2D (tex,coord,0,lod) + #endif + + #undef GetWorldToObjectMatrix() + + #define GetWorldToObjectMatrix() unity_WorldToObject + + + #endif + + float3 GetCameraWorldPosition() + { + #if _HDRP + return GetCameraRelativePositionWS(_WorldSpaceCameraPos); + #else + return _WorldSpaceCameraPos; + #endif + } + + #if _GRABPASSUSED + #if _STANDARD + TEXTURE2D(%GRABTEXTURE%); + SAMPLER(sampler_%GRABTEXTURE%); + #endif + + half3 GetSceneColor(float2 uv) + { + #if _STANDARD + return SAMPLE_TEXTURE2D(%GRABTEXTURE%, sampler_%GRABTEXTURE%, uv).rgb; + #else + return SHADERGRAPH_SAMPLE_SCENE_COLOR(uv); + #endif + } + #endif + + + + #if _STANDARD + UNITY_DECLARE_DEPTH_TEXTURE(_CameraDepthTexture); + float GetSceneDepth(float2 uv) { return SAMPLE_DEPTH_TEXTURE(_CameraDepthTexture, uv); } + float GetLinear01Depth(float2 uv) { return Linear01Depth(GetSceneDepth(uv)); } + float GetLinearEyeDepth(float2 uv) { return LinearEyeDepth(GetSceneDepth(uv)); } + #else + float GetSceneDepth(float2 uv) { return SHADERGRAPH_SAMPLE_SCENE_DEPTH(uv); } + float GetLinear01Depth(float2 uv) { return Linear01Depth(GetSceneDepth(uv), _ZBufferParams); } + float GetLinearEyeDepth(float2 uv) { return LinearEyeDepth(GetSceneDepth(uv), _ZBufferParams); } + #endif + + float3 GetWorldPositionFromDepthBuffer(float2 uv, float3 worldSpaceViewDir) + { + float eye = GetLinearEyeDepth(uv); + float3 camView = mul((float3x3)GetObjectToWorldMatrix(), transpose(mul(GetWorldToObjectMatrix(), UNITY_MATRIX_I_V)) [2].xyz); + + float dt = dot(worldSpaceViewDir, camView); + float3 div = worldSpaceViewDir/dt; + float3 wpos = (eye * div) + GetCameraWorldPosition(); + return wpos; + } + + #if _HDRP + float3 ObjectToWorldSpacePosition(float3 pos) + { + return GetAbsolutePositionWS(TransformObjectToWorld(pos)); + } + #else + float3 ObjectToWorldSpacePosition(float3 pos) + { + return TransformObjectToWorld(pos); + } + #endif + + #if _STANDARD + UNITY_DECLARE_SCREENSPACE_TEXTURE(_CameraDepthNormalsTexture); + float3 GetSceneNormal(float2 uv, float3 worldSpaceViewDir) + { + float4 depthNorms = UNITY_SAMPLE_SCREENSPACE_TEXTURE(_CameraDepthNormalsTexture, uv); + float3 norms = DecodeViewNormalStereo(depthNorms); + norms = mul((float3x3)GetWorldToViewMatrix(), norms) * 0.5 + 0.5; + return norms; + } + #elif _HDRP && !_DECALSHADER + + float3 GetSceneNormal(float2 uv, float3 worldSpaceViewDir) + { + NormalData nd; + DecodeFromNormalBuffer(_ScreenSize.xy * uv, nd); + return nd.normalWS; + } + #elif _URP + #if (SHADER_LIBRARY_VERSION_MAJOR >= 10) + #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/DeclareNormalsTexture.hlsl" + #endif + + float3 GetSceneNormal(float2 uv, float3 worldSpaceViewDir) + { + #if (SHADER_LIBRARY_VERSION_MAJOR >= 10) + return SampleSceneNormals(uv); + #else + float3 wpos = GetWorldPositionFromDepthBuffer(uv, worldSpaceViewDir); + return normalize(-cross(ddx(wpos), ddy(wpos))) * 0.5 + 0.5; + #endif + + } + #endif + + #if _HDRP + + half3 UnpackNormalmapRGorAG(half4 packednormal) + { + // This do the trick + packednormal.x *= packednormal.w; + + half3 normal; + normal.xy = packednormal.xy * 2 - 1; + normal.z = sqrt(1 - saturate(dot(normal.xy, normal.xy))); + return normal; + } + half3 UnpackNormal(half4 packednormal) + { + #if defined(UNITY_NO_DXT5nm) + return packednormal.xyz * 2 - 1; + #else + return UnpackNormalmapRGorAG(packednormal); + #endif + } + #endif + #if _HDRP || _URP + + half3 UnpackScaleNormal(half4 packednormal, half scale) + { + #ifndef UNITY_NO_DXT5nm + // Unpack normal as DXT5nm (1, y, 1, x) or BC5 (x, y, 0, 1) + // Note neutral texture like "bump" is (0, 0, 1, 1) to work with both plain RGB normal and DXT5nm/BC5 + packednormal.x *= packednormal.w; + #endif + half3 normal; + normal.xy = (packednormal.xy * 2 - 1) * scale; + normal.z = sqrt(1 - saturate(dot(normal.xy, normal.xy))); + return normal; + } + + #endif + + + void GetSun(out float3 lightDir, out float3 color) + { + lightDir = float3(0.5, 0.5, 0); + color = 1; + #if _HDRP + if (_DirectionalLightCount > 0) + { + DirectionalLightData light = _DirectionalLightDatas[0]; + lightDir = -light.forward.xyz; + color = light.color; + } + #elif _STANDARD + lightDir = normalize(_WorldSpaceLightPos0.xyz); + color = _LightColor0.rgb; + #elif _URP + Light light = GetMainLight(); + lightDir = light.direction; + color = light.color; + #endif + } + + + + + + + + + + TEXTURE2D(_MainTex); + SAMPLER(sampler_MainTex); + + #if GLOW_ON + TEXTURE2D(_GlowTex); + SAMPLER(sampler_GlowTex); + #endif + + #if FADE_ON + TEXTURE2D(_FadeTex); + SAMPLER(sampler_FadeTex); + + TEXTURE2D(_FadeBurnTex); + SAMPLER(sampler_FadeBurnTex); + #endif + + #if DISTORT_ON + TEXTURE2D(_DistortTex); + SAMPLER(sampler_DistortTex); + #endif + + #if OUTTEX_ON + TEXTURE2D(_OutlineTex); + SAMPLER(sampler_OutlineTex); + #endif + + #if OUTDIST_ON + TEXTURE2D(_OutlineDistortTex); + SAMPLER(sampler_OutlineDistortTex); + #endif + + #if COLORSWAP_ON + TEXTURE2D(_ColorSwapTex); + SAMPLER(sampler_ColorSwapTex); + #endif + + #if COLORRAMP_ON + TEXTURE2D(_ColorRampTex); + TEXTURE2D(_ColorRampTexGradient); + SAMPLER(sampler_ColorRampTex); + SAMPLER(sampler_ColorRampTexGradient); + #endif + + #if SHINE_ON + TEXTURE2D(_ShineMask); + SAMPLER(sampler_ShineMask); + #endif + + #if OVERLAY_ON + TEXTURE2D(_OverlayTex); + SAMPLER(sampler_OverlayTex); + #endif + + #if NORMALMAP_ON + TEXTURE2D(_NormalMap); + SAMPLER(sampler_NormalMap); + #endif + + + half3 GetPixel(in int offsetX, in int offsetY, in half2 uv, in Texture2D _tex, in SamplerState _sampler) + { + half2 _uv = uv + half2(offsetX * _MainTex_TexelSize.x, offsetY * _MainTex_TexelSize.y); + half4 col = SAMPLE_TEXTURE2D(_tex, _sampler, _uv); + return col.rgb; + } + + + //BLURS------------------------------------------------------------------------- + half4 Blur(half2 uv, Texture2D source, SamplerState sampler_source, half Intensity) + { + const half2 texelSize = 1.0 / _ScreenParams.xy; + const half4 color = SAMPLE_TEXTURE2D(source, sampler_source, uv); + const half2 offset = Intensity * texelSize; + + half4 accumulatedColor = color; + half accumulatedWeight = 1.0; + for (int x = -1; x <= 1; x++) + { + for (int y = -1; y <= 1; y++) + { + const half2 sampleUV = uv + half2(x, y) * offset; + const half4 sampleColor = SAMPLE_TEXTURE2D(source, sampler_source, sampleUV); + + accumulatedColor += sampleColor; + accumulatedWeight += 1.0; + } + } + + half4 blurredColor = accumulatedColor / accumulatedWeight; + return blurredColor; + } + + half BlurHD_G(half bhqp, half x) + { + return exp(-(x * x) / (2.0 * bhqp * bhqp)); + } + half4 BlurHD(half2 uv, Texture2D source, SamplerState sampler_source, half BlurAmount, half xScale, half yScale) + { + int iterations = 16; + int halfIterations = iterations / 2; + half sigmaX = 0.1 + BlurAmount * 0.5; + half sigmaY = sigmaX; + half total = 0.0; + half4 ret = half4(0, 0, 0, 0); + for (int iy = 0; iy < iterations; ++iy) + { + half fy = BlurHD_G(sigmaY, half(iy) -half(halfIterations)); + half offsetY = half(iy - halfIterations) * 0.00390625 * xScale; + for (int ix = 0; ix < iterations; ++ix) + { + half fx = BlurHD_G(sigmaX, half(ix) - half(halfIterations)); + half offsetX = half(ix - halfIterations) * 0.00390625 * yScale; + total += fx * fy; + ret += SAMPLE_TEXTURE2D(source, sampler_source, uv + half2(offsetX, offsetY)) * fx * fy; + } + } + return ret / total; + } + //----------------------------------------------------------------------- + + + //------------------------------------------- + half RemapFloat(half inValue, half inMin, half inMax, half outMin, half outMax){ + return outMin + (inValue - inMin) * (outMax - outMin) / (inMax - inMin); + } + //------------------------------------------- + + //----------------------------------------------------------------------- + half rand(half2 seed, half offset) { + return (frac(sin(dot(seed, half2(12.9898, 78.233))) * 43758.5453) + offset) % 1.0; + } + + half rand2(half2 seed, half offset) { + return (frac(sin(dot(seed * floor(50 + (_Time.x % 1.0) * 12.), half2(127.1, 311.7))) * 43758.5453123) + offset) % 1.0; + } + + half rand2CustomTime(half2 seed, half offset, half customTime) { + return (frac(sin(dot(seed * floor(50 + (customTime % 1.0) * 12.), half2(127.1, 311.7))) * 43758.5453123) + offset) % 1.0; + } + //----------------------------------------------------------------------- + + + void Ext_ModifyVertex0 (inout VertexData v, inout ExtraV2F d) + { + //BILBOARD_ON + #if BILBOARD_ON + half3 camRight = mul((half3x3)unity_CameraToWorld, half3(1,0,0)); + half3 camUp = half3(0,1,0); + #if BILBOARDY_ON + camUp = mul((half3x3)unity_CameraToWorld, half3(0,1,0)); + #endif + half3 localPos = v.vertex.x * camRight + v.vertex.y * camUp; + v.vertex = half4(localPos, 1); + #endif + //----------------------------------------------------------- + + v.texcoord0.xy = TRANSFORM_TEX(v.texcoord0.xy, _MainTex); + half2 center = half2(0.5, 0.5); + #if ATLAS_ON + center = half2((_MaxXUV + _MinXUV) / 2.0, (_MaxYUV + _MinYUV) / 2.0); + #endif + + //POLARUV_ON + #if POLARUV_ON + v.texcoord0.xy = v.texcoord0.xy - center; + #endif + + //---------------------------------------- + + //ROTATEUV_ON + #if ROTATEUV_ON + half2 uvC = v.texcoord0.xy; + half cosAngle = cos(_RotateUvAmount); + half sinAngle = sin(_RotateUvAmount); + half2x2 rot = half2x2(cosAngle, -sinAngle, sinAngle, cosAngle); + uvC -= center; + v.texcoord0.xy = mul(rot, uvC); + v.texcoord0.xy += center; + #endif + //-------------------- + + #if RECTSIZE_ON + v.vertex.xyz += (v.vertex.xyz * (_RectSize - 1.0)); + #endif + + #if OUTTEX_ON + v.texcoord1.xy = TRANSFORM_TEX(v.texcoord0.xy, _OutlineTex); + #endif + + #if OUTDIST_ON + v.texcoord2.xy = TRANSFORM_TEX(v.texcoord0.xy, _OutlineDistortTex); + #endif + + #if DISTORT_ON + v.texcoord3.xy = TRANSFORM_TEX(v.texcoord0.xy, _DistortTex); + #endif + } + + void Ext_SurfaceFunction0 (inout Surface o, ShaderData d) + { + half randomSeed = _RandomSeed; + + float2 uvRect = d.texcoord0; + half2 center = half2(0.5, 0.5); + #if ATLAS_ON + center = half2((_MaxXUV + _MinXUV) / 2.0, (_MaxYUV + _MinYUV) / 2.0); + uvRect = half2((d.texcoord0.x - _MinXUV) / (_MaxXUV - _MinXUV), (d.texcoord0.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half2 centerTiled = half2(center.x * _MainTex_ST.x, center.y * _MainTex_ST.y); + + //CLIPPING_ON + #if CLIPPING_ON + half2 tiledUv = half2(d.texcoord0.x / _MainTex_ST.x, d.texcoord0.y / _MainTex_ST.y); + #if ATLAS_ON + tiledUv = half2((tiledUv.x - _MinXUV) / (_MaxXUV - _MinXUV), (tiledUv.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + clip((1 - _ClipUvUp) - tiledUv.y); + clip(tiledUv.y - _ClipUvDown); + clip((1 - _ClipUvRight) - tiledUv.x); + clip(tiledUv.x - _ClipUvLeft); + #endif + //---------------------------------- + + //RADIALCLIPPING_ON + #if RADIALCLIPPING_ON + half2 tiledUv2 = half2(d.texcoord0.x / _MainTex_ST.x, d.texcoord0.y / _MainTex_ST.y); + #if ATLAS_ON + tiledUv2 = half2((tiledUv2.x - _MinXUV) / (_MaxXUV - _MinXUV), (tiledUv2.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half startAngle = _RadialStartAngle - _RadialClip; + half endAngle = _RadialStartAngle + _RadialClip2; + half offset0 = clamp(0, 360, startAngle + 360); + half offset360 = clamp(0, 360, endAngle - 360); + half2 atan2Coord = half2(lerp(-1, 1, tiledUv2.x), lerp(-1, 1, tiledUv2.y)); + half atanAngle = atan2(atan2Coord.y, atan2Coord.x) * 57.3; // angle in degrees + if(atanAngle < 0) atanAngle = 360 + atanAngle; + if(atanAngle >= startAngle && atanAngle <= endAngle) discard; + if(atanAngle <= offset360) discard; + if(atanAngle >= offset0) discard; + #endif + + //----------------------------- + + //TEXTURESCROLL_ON && ATLAS_ON + #if TEXTURESCROLL_ON && ATLAS_ON + d.texcoord0.xy = half2(_MinXUV + ((_MaxXUV - _MinXUV) * (abs(((_Time.y + randomSeed) * _TextureScrollXSpeed) + uvRect.x) % 1)), + _MinYUV + ((_MaxYUV - _MinYUV) * (abs(((_Time.y + randomSeed) * _TextureScrollYSpeed) + uvRect.y) % 1))); + #endif + //---------------------------- + + //OFFSETUV_ON + #if OFFSETUV_ON + #if ATLAS_ON + d.texcoord0.xy = half2(_MinXUV + ((_MaxXUV - _MinXUV) * (abs((_OffsetUvX + uvRect.x) % 1))), + _MinYUV + ((_MaxYUV - _MinYUV) * (abs(_OffsetUvY + uvRect.y) % 1))); + #else + d.texcoord0.xy += half2(_OffsetUvX, _OffsetUvY); + #endif + #endif + + //---------------------- + + //POLARUV_ON + #if POLARUV_ON + d.texcoord0.xy = half2(atan2(d.texcoord0.y, d.texcoord0.x) / (2.0f * 3.141592653589f), length(d.texcoord0.xy)); + d.texcoord0.xy *= _MainTex_ST.xy; + #endif + + //-------------------------------------- + + //TWISTUV_ON + #if TWISTUV_ON + #if ATLAS_ON + _TwistUvPosX = ((_MaxXUV - _MinXUV) * _TwistUvPosX) + _MinXUV; + _TwistUvPosY = ((_MaxYUV - _MinYUV) * _TwistUvPosY) + _MinYUV; + #endif + half2 tempUv = d.texcoord0.xy - half2(_TwistUvPosX * _MainTex_ST.x, _TwistUvPosY * _MainTex_ST.y); + _TwistUvRadius *= (_MainTex_ST.x + _MainTex_ST.y) / 2; + half percent = (_TwistUvRadius - length(tempUv)) / _TwistUvRadius; + half theta = percent * percent * (2.0 * sin(_TwistUvAmount)) * 8.0; + half s = sin(theta); + half c = cos(theta); + half beta = max(sign(_TwistUvRadius - length(tempUv)), 0.0); + tempUv = half2(dot(tempUv, half2(c, -s)), dot(tempUv, half2(s, c))) * beta + tempUv * (1 - beta); + tempUv += half2(_TwistUvPosX * _MainTex_ST.x, _TwistUvPosY * _MainTex_ST.y); + d.texcoord0.xy = tempUv; + #endif + + //-------------------------------------------- + + //FISHEYE_ON + #if FISHEYE_ON + half bind = length(centerTiled); + half2 dF = d.texcoord0.xy - centerTiled; + half dFlen = length(dF); + half fishInt = (3.14159265359 / bind) * (_FishEyeUvAmount + 0.001); + d.texcoord0.xy = centerTiled + (dF / (max(0.0001, dFlen))) * tan(dFlen * fishInt) * bind / tan(bind * fishInt); + #endif + //--------------------------------------------- + + //PINCH_ON + #if PINCH_ON + half2 dP = d.texcoord0.xy - centerTiled; + half pinchInt = (3.141592 / length(centerTiled)) * (-_PinchUvAmount + 0.001); + d.texcoord0.xy = centerTiled + normalize(dP) * atan(length(dP) * -pinchInt * 10.0) * 0.5 / atan(-pinchInt * 5); + #endif + + //--------------------------------------------- + + //ZOOMUV_ON + #if ZOOMUV_ON + d.texcoord0.xy -= centerTiled; + d.texcoord0.xy = d.texcoord0.xy * _ZoomUvAmount; + d.texcoord0.xy += centerTiled; + #endif + + //----------------------------------------------- + + //DOODLE_ON + #if DOODLE_ON + half2 uvCopy = uvRect; + _HandDrawnSpeed = (floor((_Time.x + randomSeed) * 20 * _HandDrawnSpeed) / _HandDrawnSpeed) * _HandDrawnSpeed; + uvCopy.x = sin((uvCopy.x * _HandDrawnAmount + _HandDrawnSpeed) * 4); + uvCopy.y = cos((uvCopy.y * _HandDrawnAmount + _HandDrawnSpeed) * 4); + d.texcoord0.xy = lerp(d.texcoord0.xy, d.texcoord0.xy + uvCopy, 0.0005 * _HandDrawnAmount); + #endif + + //-------------------------- + + //SHAKEUV_ON + #if SHAKEUV_ON + half xShake = sin((_Time.x + randomSeed) * _ShakeUvSpeed * 50) * _ShakeUvX; + half yShake = cos((_Time.x + randomSeed) * _ShakeUvSpeed * 50) * _ShakeUvY; + d.texcoord0.xy += half2(xShake * 0.012, yShake * 0.01); + #endif + + //------------------------------------------- + + //RECTSIZE_ON + #if RECTSIZE_ON + d.texcoord0.xy = d.texcoord0.xy * (_RectSize).xx + (((-_RectSize * 0.5) + 0.5)).xx; + #endif + + //------------------------------------------- + + //DISTORT_ON + #if DISTORT_ON + #if ATLAS_ON + d.texcoord3.x = d.texcoord3.x * (1 / (_MaxXUV - _MinXUV)); + d.texcoord3.y = d.texcoord3.y * (1 / (_MaxYUV - _MinYUV)); + #endif + + d.texcoord3.x += ((_Time.x + _RandomSeed) * _DistortTexXSpeed) % 1; + d.texcoord3.y += ((_Time.x + _RandomSeed) * _DistortTexYSpeed) % 1; + half distortAmnt = (SAMPLE_TEXTURE2D(_DistortTex, sampler_DistortTex, d.texcoord3.xy).r - 0.5) * 0.2 * _DistortAmount; + d.texcoord0.x += distortAmnt; + d.texcoord0.y += distortAmnt; + #endif + //------------------------------------------------------- + + //WARP_ON + #if WARP_ON + half2 warpUv = half2(d.texcoord0.x / _MainTex_ST.x, d.texcoord0.y / _MainTex_ST.y); + #if ATLAS_ON + warpUv = half2((warpUv.x - _MinXUV) / (_MaxXUV - _MinXUV), (warpUv.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + const float tau = 6.283185307179586; + float xWarp = (_Time.y + randomSeed) * _WarpSpeed + warpUv.x * tau / _WarpScale; + float yWarp = (_Time.y + randomSeed) * _WarpSpeed + warpUv.y * tau / _WarpScale; + float2 warp = float2(sin(xWarp), sin(yWarp)) * _WarpStrength; + d.texcoord0.xy += warp; + #endif + + //------------------------------------------------------- + + //WAVEUV_ON + #if WAVEUV_ON + float2 uvWave = half2(_WaveX * _MainTex_ST.x, _WaveY * _MainTex_ST.y) - d.texcoord0.xy; + uvWave %= 1; + #if ATLAS_ON + uvWave = half2(_WaveX, _WaveY) - uvRect; + #endif + uvWave.x *= _ScreenParams.x / _ScreenParams.y; + float waveTime = _Time.y + randomSeed; + float angWave = (sqrt(dot(uvWave, uvWave)) * _WaveAmount) - ((waveTime * _WaveSpeed)); + d.texcoord0.xy = d.texcoord0.xy + uvWave * sin(angWave) * (_WaveStrength / 1000.0); + #endif + //---------------------------------------------------- + + //ROUNDWAVEUV_ON + #if ROUNDWAVEUV_ON + half xWave = ((0.5 * _MainTex_ST.x) - uvRect.x); + half yWave = ((0.5 * _MainTex_ST.y) - uvRect.y) * (_MainTex_TexelSize.w / _MainTex_TexelSize.z); + half ripple = -sqrt(xWave*xWave + yWave* yWave); + d.texcoord0.xy += (sin((ripple + (_Time.y + randomSeed) * (_RoundWaveSpeed/10.0)) / 0.015) * (_RoundWaveStrength/10.0)) % 1; + #endif + //---------------------------------------------------- + + + //WIND_ON + #if WIND_ON + half windOffset = sin((_Time.x + randomSeed) * _GrassSpeed * 10); + half2 windCenter = half2(0.5, 0.1); + #if ATLAS_ON + windCenter.x = ((_MaxXUV - _MinXUV) * windCenter.x) + _MinXUV; + windCenter.y = ((_MaxYUV - _MinYUV) * windCenter.y) + _MinYUV; + #endif + #if !MANUALWIND_ON + d.texcoord0.x = fmod(abs(lerp(d.texcoord0.x, d.texcoord0.x + (_GrassWind * 0.01 * windOffset), uvRect.y)), 1); + #else + d.texcoord0.x = fmod(abs(lerp(d.texcoord0.x, d.texcoord0.x + (_GrassWind * 0.01 * _GrassManualAnim), uvRect.y)), 1); + windOffset = _GrassManualAnim; + #endif + half2 delta = d.texcoord0.xy - windCenter; + half delta2 = dot(delta.xy, delta.xy); + half2 delta_offset = delta2 * windOffset; + d.texcoord0.xy = d.texcoord0.xy + half2(delta.y, -delta.x) * delta_offset * _GrassRadialBend; + #endif + + //-------------------------------------------------------- + + //TEXTURESCROLL_ON && !ATLAS_ON + #if TEXTURESCROLL_ON && !ATLAS_ON + d.texcoord0.x += ((_Time.y + randomSeed) * _TextureScrollXSpeed) % 1; + d.texcoord0.y += ((_Time.y + randomSeed) * _TextureScrollYSpeed) % 1; + #endif + //------------------------------ + + //PIXELATE_ON + #if PIXELATE_ON + half aspectRatio = _MainTex_TexelSize.x / _MainTex_TexelSize.y; + half2 pixelSize = float2(_PixelateSize, _PixelateSize * aspectRatio); + d.texcoord0.xy = floor(d.texcoord0.xy * pixelSize) / pixelSize; + #endif + //-------------- + + half4 col = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy); + half originalAlpha = col.a; + col *= d.vertexColor; + + //NORMAL MAP + #if NORMALMAP_ON + half4 normalSample = SAMPLE_TEXTURE2D(_NormalMap, sampler_NormalMap, d.texcoord0.xy); + half3 normalTS = UnpackNormal(normalSample); + normalTS.xy *= _NormalStrength; + o.Normal = normalTS; + #endif + + + //GLITCH_ON + #if GLITCH_ON + half2 uvGlitch = uvRect; + uvGlitch.y -= 0.5; + half lineNoise = pow(rand2(floor(uvGlitch * half2(24., 19.) * _GlitchSize) * 4.0, randomSeed), 3.0) * _GlitchAmount + * pow(rand2(floor(uvGlitch * half2(38., 14.) * _GlitchSize) * 4.0, randomSeed), 3.0); + col = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(lineNoise * 0.02 * rand2(half2(2.0, 1), randomSeed), 0)) * d.vertexColor; + #endif + //-------------------------------------- + + //CHROMABERR_ON + #if CHROMABERR_ON + half4 r = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(_ChromAberrAmount/10, 0)) * d.vertexColor; + half4 b = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(-_ChromAberrAmount/10, 0)) * d.vertexColor; + col = half4(r.r * r.a, col.g, b.b * b.a, max(max(r.a, b.a) * _ChromAberrAlpha, col.a)); + #endif + + //-------------------------------- + + //BLUR_ON + #if BLUR_ON + #if ATLAS_ON + #if !BLURISHD_ON + col = BlurHD(d.texcoord0.xy, _MainTex, sampler_MainTex, _BlurIntensity, (_MaxXUV - _MinXUV), (_MaxYUV - _MinYUV)) * d.vertexColor; + #else + col = Blur(d.texcoord0.xy, _MainTex, sampler_MainTex, _BlurIntensity * (_MaxXUV - _MinXUV)) * d.vertexColor; + #endif + #else + #if !BLURISHD_ON + col = BlurHD(d.texcoord0.xy, _MainTex, sampler_MainTex, _BlurIntensity, 1, 1) * d.vertexColor; + #else + col = Blur(d.texcoord0.xy, _MainTex, sampler_MainTex, _BlurIntensity) * d.vertexColor; + #endif + #endif + #endif + + //-------------------- + + //MOTIONBLUR_ON + #if MOTIONBLUR_ON + _MotionBlurAngle = _MotionBlurAngle * 3.1415926; + #define rot(n) mul(n, half2x2(cos(_MotionBlurAngle), -sin(_MotionBlurAngle), sin(_MotionBlurAngle), cos(_MotionBlurAngle))) + _MotionBlurDist = _MotionBlurDist * 0.005; + #if ATLAS_ON + _MotionBlurDist *= (_MaxXUV - _MinXUV); + #endif + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(-_MotionBlurDist, -_MotionBlurDist))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(-_MotionBlurDist * 2, -_MotionBlurDist * 2))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(-_MotionBlurDist * 3, -_MotionBlurDist * 3))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(-_MotionBlurDist * 4, -_MotionBlurDist * 4))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(_MotionBlurDist, _MotionBlurDist))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(_MotionBlurDist * 2, _MotionBlurDist * 2))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(_MotionBlurDist * 3, _MotionBlurDist * 3))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(_MotionBlurDist * 4, _MotionBlurDist * 4))); + col.rgb = col.rgb / 9; + #endif + //------------------------------------ + + //NEGATIVE_ON + #if NEGATIVE_ON + col.rgb = lerp(col.rgb, 1 - col.rgb, _NegativeAmount); + #endif + + //-------------- + half luminance = 0; + + //GREYSCALE_ON && !GREYSCALEOUTLINE_ON + #if GREYSCALE_ON && !GREYSCALEOUTLINE_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + luminance = saturate(luminance + _GreyscaleLuminosity); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _GreyscaleTintColor, _GreyscaleBlend); + #endif + //------------------------------------ + + //GHOST_ON + #if GHOST_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + half4 ghostResult; + ghostResult.a = saturate(luminance - _GhostTransparency) * col.a; + ghostResult.rgb = col.rgb * (luminance + _GhostColorBoost); + col = lerp(col, ghostResult, _GhostBlend); + #endif + //------------------------------------ + + //INNEROUTLINE_ON + #if INNEROUTLINE_ON + half3 innerT = abs(GetPixel(0, _InnerOutlineThickness, d.texcoord0.xy, _MainTex, sampler_MainTex) - GetPixel(0, -_InnerOutlineThickness, d.texcoord0.xy, _MainTex, sampler_MainTex)); + innerT += abs(GetPixel(_InnerOutlineThickness, 0, d.texcoord0.xy, _MainTex, sampler_MainTex) - GetPixel(-_InnerOutlineThickness, 0, d.texcoord0.xy, _MainTex, sampler_MainTex)); + #if !ONLYINNEROUTLINE_ON + innerT = (innerT / 2.0) * col.a * _InnerOutlineAlpha; + col.rgb += length(innerT) * _InnerOutlineColor.rgb * _InnerOutlineGlow; + #else + innerT *= col.a * _InnerOutlineAlpha; + col.rgb = length(innerT) * _InnerOutlineColor.rgb * _InnerOutlineGlow; + col.a = step(0.3, col.r+col.g+col.b); + #endif + #endif + //------------------------------------------------------- + + //HITEFFECT_ON + #if HITEFFECT_ON + col.rgb = lerp(col.rgb, _HitEffectColor.rgb * _HitEffectGlow, _HitEffectBlend); + #endif + //-------------------- + + //GRADIENT_ON + #if GRADIENT_ON + half2 tiledUvGrad = half2(uvRect.x / _MainTex_ST.x, uvRect.y / _MainTex_ST.y); + #if GRADIENT2COL_ON + _GradTopRightCol = _GradTopLeftCol; + _GradBotRightCol = _GradBotLeftCol; + #endif + #if RADIALGRADIENT_ON + half radialDist = 1 - length(tiledUvGrad - half2(0.5, 0.5)); + radialDist *= (_MainTex_TexelSize.w / _MainTex_TexelSize.z); + radialDist = saturate(_GradBoostX * radialDist); + half4 gradientResult = lerp(_GradTopLeftCol, _GradBotLeftCol, radialDist); + #else + half gradXLerpFactor = saturate(pow(tiledUvGrad.x, _GradBoostX)); + half4 gradientResult = lerp(lerp(_GradBotLeftCol, _GradBotRightCol, gradXLerpFactor), + lerp(_GradTopLeftCol, _GradTopRightCol, gradXLerpFactor), saturate(pow(tiledUvGrad.y, _GradBoostY))); + #endif + gradientResult = lerp(col, gradientResult, _GradBlend); + col.rgb = gradientResult.rgb * col.a; + col.a *= gradientResult.a; + #endif + //-------------------------------------------------------------------- + + //CONTRAST_ON + #if CONTRAST_ON + col.rgb = (col.rgb - float3(0.5, 0.5, 0.5)) * _Contrast + float3(0.5, 0.5, 0.5); + col.rgb += _Brightness; + #endif + + //------------------------------------------------------------------- + + //COLORSWAP_ON + #if COLORSWAP_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + half4 swapMask = SAMPLE_TEXTURE2D(_ColorSwapTex, sampler_ColorSwapTex, d.texcoord0.xy); + swapMask.rgb *= swapMask.a; + half3 redSwap = _ColorSwapRed * swapMask.r * saturate(luminance + _ColorSwapRedLuminosity); + half3 greenSwap = _ColorSwapGreen * swapMask.g * saturate(luminance + _ColorSwapGreenLuminosity); + half3 blueSwap = _ColorSwapBlue * swapMask.b * saturate(luminance + _ColorSwapBlueLuminosity); + swapMask.rgb = col.rgb * saturate(1 - swapMask.r - swapMask.g - swapMask.b); + col.rgb = lerp(col.rgb, swapMask.rgb + redSwap + greenSwap + blueSwap, _ColorSwapBlend); + #endif + //-------------------------------------------------------------------- + + //COLORRAMP_ON && !COLORRAMPOUTLINE_ON + #if COLORRAMP_ON && !COLORRAMPOUTLINE_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + luminance = saturate(luminance + _ColorRampLuminosity); + #if GRADIENTCOLORRAMP_ON + col.rgb = lerp(col.rgb, SAMPLE_TEXTURE2D(_ColorRampTexGradient, sampler_ColorRampTexGradient, half2(luminance, 0)).rgb, _ColorRampBlend); + #else + col.rgb = lerp(col.rgb, SAMPLE_TEXTURE2D(_ColorRampTex, sampler_ColorRampTex, half2(luminance, 0)).rgb, _ColorRampBlend); + #endif + #endif + //-------------------------------------------------------------------- + + //CHANGECOLOR_ON + #if CHANGECOLOR_ON + float3 currChangeColor = saturate(col.rgb); + luminance = 0.3 * currChangeColor.r + 0.59 * currChangeColor.g + 0.11 * currChangeColor.b; + luminance = saturate(luminance + _ColorChangeLuminosity); + half3 dif = abs(currChangeColor - _ColorChangeTarget.rgb); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _ColorChangeNewCol.rgb, + max(sign(1 - saturate(dif.x + dif.y + dif.z) - _ColorChangeTolerance), 0.0)); + #if CHANGECOLOR2_ON + dif = abs(currChangeColor - _ColorChangeTarget2.rgb); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _ColorChangeNewCol2.rgb, + max(sign(1 - saturate(dif.x + dif.y + dif.z) - _ColorChangeTolerance2), 0.0)); + #endif + #if CHANGECOLOR3_ON + dif = abs(currChangeColor - _ColorChangeTarget3.rgb); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _ColorChangeNewCol3.rgb, + max(sign(1 - saturate(dif.x + dif.y + dif.z) - _ColorChangeTolerance3), 0.0)); + #endif + #endif + //------------------------------------------------------- + + //POSTERIZE_ON && !POSTERIZEOUTLINE_ON + #if POSTERIZE_ON && !POSTERIZEOUTLINE_ON + col.rgb = pow(col.rgb, _PosterizeGamma) * _PosterizeNumColors; + col.rgb = floor(col.rgb) / _PosterizeNumColors; + col.rgb = pow(col.rgb, 1.0 / _PosterizeGamma); + #endif + //------------------------------------ + + //HSV_ON + #if HSV_ON + half3 resultHsv = half3(col.rgb); + half cosHsv = _HsvBright * _HsvSaturation * cos(_HsvShift * 3.14159265 / 180); + half sinHsv = _HsvBright * _HsvSaturation * sin(_HsvShift * 3.14159265 / 180); + resultHsv.x = (.299 * _HsvBright + .701 * cosHsv + .168 * sinHsv) * col.x + + (.587 * _HsvBright - .587 * cosHsv + .330 * sinHsv) * col.y + + (.114 * _HsvBright - .114 * cosHsv - .497 * sinHsv) * col.z; + resultHsv.y = (.299 * _HsvBright - .299 * cosHsv - .328 * sinHsv) *col.x + + (.587 * _HsvBright + .413 * cosHsv + .035 * sinHsv) * col.y + + (.114 * _HsvBright - .114 * cosHsv + .292 * sinHsv) * col.z; + resultHsv.z = (.299 * _HsvBright - .3 * cosHsv + 1.25 * sinHsv) * col.x + + (.587 * _HsvBright - .588 * cosHsv - 1.05 * sinHsv) * col.y + + (.114 * _HsvBright + .886 * cosHsv - .203 * sinHsv) * col.z; + col.rgb = resultHsv; + #endif + //------------------------------------------------------- + + //OVERLAY_ON + #if OVERLAY_ON + half2 overlayUvs = d.texcoord0.xy; + overlayUvs.x += ((_Time.y + randomSeed) * _OverlayTextureScrollXSpeed) % 1; + overlayUvs.y += ((_Time.y + randomSeed) * _OverlayTextureScrollYSpeed) % 1; + half4 overlayCol = SAMPLE_TEXTURE2D(_OverlayTex, sampler_OverlayTex, TRANSFORM_TEX(overlayUvs, _OverlayTex)); + overlayCol.rgb *= _OverlayColor.rgb * _OverlayGlow; + #if !OVERLAYMULT_ON + overlayCol.rgb *= overlayCol.a * _OverlayColor.rgb * _OverlayColor.a * _OverlayBlend; + col.rgb += overlayCol.rgb; + #else + overlayCol.a *= _OverlayColor.a; + col = lerp(col, col * overlayCol, _OverlayBlend); + #endif + #endif + + //--------------------------------- + + //OUTBASE_ON + #if OUTBASE_ON + #if OUTBASEPIXELPERF_ON + half2 destUv = half2(_OutlinePixelWidth * _MainTex_TexelSize.x, _OutlinePixelWidth * _MainTex_TexelSize.y); + #else + half2 destUv = half2(_OutlineWidth * _MainTex_TexelSize.x * 200, _OutlineWidth * _MainTex_TexelSize.y * 200); + #endif + + #if OUTDIST_ON + d.texcoord3.x += ((_Time.x + _RandomSeed) * _OutlineDistortTexXSpeed) % 1; + d.texcoord3.y += ((_Time.x + _RandomSeed) * _OutlineDistortTexYSpeed) % 1; + #if ATLAS_ON + d.texcoord3 = half2((d.texcoord3.x - _MinXUV) / (_MaxXUV - _MinXUV), (d.texcoord3.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half outDistortAmnt = (SAMPLE_TEXTURE2D(_OutlineDistortTex, sampler_OutlineDistortTex, d.texcoord3).r - 0.5) * 0.2 * _OutlineDistortAmount; + destUv.x += outDistortAmnt; + destUv.y += outDistortAmnt; + #endif + + half spriteLeft = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(destUv.x, 0)).a; + half spriteRight = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy - half2(destUv.x, 0)).a; + half spriteBottom = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(0, destUv.y)).a; + half spriteTop = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy - half2(0, destUv.y)).a; + half result = spriteLeft + spriteRight + spriteBottom + spriteTop; + + #if OUTBASE8DIR_ON + half spriteTopLeft = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(destUv.x, destUv.y)).a; + half spriteTopRight = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(-destUv.x, destUv.y)).a; + half spriteBotLeft = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(destUv.x, -destUv.y)).a; + half spriteBotRight = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(-destUv.x, -destUv.y)).a; + result = result + spriteTopLeft + spriteTopRight + spriteBotLeft + spriteBotRight; + #endif + + result = step(0.05, saturate(result)); + + #if OUTTEX_ON + d.texcoord1.x += ((_Time.x + _RandomSeed) * _OutlineTexXSpeed) % 1; + d.texcoord1.y += ((_Time.x + _RandomSeed) * _OutlineTexYSpeed) % 1; + #if ATLAS_ON + d.texcoord1 = half2((d.texcoord1.x - _MinXUV) / (_MaxXUV - _MinXUV), (d.texcoord1.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half4 tempOutColor = SAMPLE_TEXTURE2D(_OutlineTex, sampler_OutlineTex, d.texcoord1); + tempOutColor *= _OutlineColor; + _OutlineColor = tempOutColor; + #endif + + result *= (1 - originalAlpha) * _OutlineAlpha; + + half4 outline = _OutlineColor * d.vertexColor.a; + outline.rgb *= _OutlineGlow; + outline.a = result; + #if ONLYOUTLINE_ON + col = outline; + #else + col = lerp(col, outline, result); + #endif + #endif + //------------------------------------------------------- + + //FADE_ON + #if FADE_ON + half2 tiledUvFade1 = TRANSFORM_TEX(d.texcoord0, _FadeTex); + half2 tiledUvFade2 = TRANSFORM_TEX(d.texcoord0, _FadeBurnTex); + #if ATLAS_ON + tiledUvFade1 = half2((tiledUvFade1.x - _MinXUV) / (_MaxXUV - _MinXUV), (tiledUvFade1.y - _MinYUV) / (_MaxYUV - _MinYUV)); + tiledUvFade2 = half2((tiledUvFade2.x - _MinXUV) / (_MaxXUV - _MinXUV), (tiledUvFade2.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half fadeTemp = SAMPLE_TEXTURE2D(_FadeTex, sampler_FadeTex, tiledUvFade1).r; + half fade = smoothstep(_FadeAmount, _FadeAmount + _FadeBurnTransition, fadeTemp); + half fadeBurn = saturate(smoothstep(_FadeAmount - _FadeBurnWidth, _FadeAmount - _FadeBurnWidth + 0.1, fadeTemp) * _FadeAmount); + col.a *= fade; + _FadeBurnColor.rgb *= _FadeBurnGlow; + col += fadeBurn * SAMPLE_TEXTURE2D(_FadeBurnTex, sampler_FadeBurnTex, tiledUvFade2) * _FadeBurnColor * originalAlpha * (1 - col.a); + #endif + //------------------------------------------------------- + + //SHADOW_ON + #if SHADOW_ON + half shadowA = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(_ShadowX, _ShadowY)).a; + half preMultShadowMask = 1 - (saturate(shadowA - col.a) * (1 - col.a)); + col.rgb *= 1 - ((shadowA - col.a) * (1 - col.a)); + col.rgb += (_ShadowColor * shadowA) * (1 - col.a); + col.a = max(shadowA * _ShadowAlpha * d.vertexColor.a, col.a); + #endif + + //------------------------------------------------------- + + //GLOW_ON + #if GLOW_ON + half4 emission; + #if GLOWTEX_ON + emission = SAMPLE_TEXTURE2D(_GlowTex, sampler_GlowTex, d.texcoord0); + #else + emission = col; + #endif + + col.rgb *= _GlowGlobal; + emission.rgb *= emission.a * col.a * _Glow * _GlowColor; + col.rgb += emission.rgb; + #endif + //------------------------------------------------------- + + //COLORRAMP_ON && COLORRAMPOUTLINE_ON + #if COLORRAMP_ON && COLORRAMPOUTLINE_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + luminance = saturate(luminance + _ColorRampLuminosity); + #if GRADIENTCOLORRAMP_ON + col.rgb = lerp(col.rgb, SAMPLE_TEXTURE2D(_ColorRampTexGradient, sampler_ColorRampTexGradient, half2(luminance, 0)).rgb, _ColorRampBlend); + #else + col.rgb = lerp(col.rgb, SAMPLE_TEXTURE2D(_ColorRampTex, sampler_ColorRampTex, half2(luminance, 0)).rgb, _ColorRampBlend); + #endif + #endif + //--------------- + + //GREYSCALE_ON && GREYSCALEOUTLINE_ON + #if GREYSCALE_ON && GREYSCALEOUTLINE_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + luminance = saturate(luminance + _GreyscaleLuminosity); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _GreyscaleTintColor, _GreyscaleBlend); + #endif + + //----------------------------------- + + //POSTERIZE_ON && POSTERIZEOUTLINE_ON + #if POSTERIZE_ON && POSTERIZEOUTLINE_ON + col.rgb = pow(col.rgb, _PosterizeGamma) * _PosterizeNumColors; + col.rgb = floor(col.rgb) / _PosterizeNumColors; + col.rgb = pow(col.rgb, 1.0 / _PosterizeGamma); + #endif + + //----------------------------------- + + //SHINE_ON + #if SHINE_ON + half2 uvShine = uvRect; + half cosAngle = cos(_ShineRotate); + half sinAngle = sin(_ShineRotate); + half2x2 rot = half2x2(cosAngle, -sinAngle, sinAngle, cosAngle); + uvShine -= half2(0.5, 0.5); + uvShine = mul(rot, uvShine); + uvShine += half2(0.5, 0.5); + half shineMask = SAMPLE_TEXTURE2D(_ShineMask, sampler_ShineMask, d.texcoord0.xy).a; + half currentDistanceProjection = (uvShine.x + uvShine.y) / 2; + half whitePower = 1 - (abs(currentDistanceProjection - _ShineLocation) / _ShineWidth); + col.rgb += col.a * whitePower * _ShineGlow * max(sign(currentDistanceProjection - (_ShineLocation - _ShineWidth)), 0.0) + * max(sign((_ShineLocation + _ShineWidth) - currentDistanceProjection), 0.0) * _ShineColor * shineMask; + #endif + + //----------------------------------- + + //HOLOGRAM_ON + #if HOLOGRAM_ON + half totalHologram = _HologramStripesAmount + _HologramUnmodAmount; + half hologramYCoord = ((uvRect.y + (((_Time.x + randomSeed) % 1) * _HologramStripesSpeed)) % totalHologram) / totalHologram; + hologramYCoord = abs(hologramYCoord); + half alpha = RemapFloat(saturate(hologramYCoord - (_HologramUnmodAmount/totalHologram)), 0.0, 1.0, _HologramMinAlpha, saturate(_HologramMaxAlpha)); + half hologramMask = max(sign((_HologramUnmodAmount/totalHologram) - hologramYCoord), 0.0); + half4 hologramResult = col; + hologramResult.a *= lerp(alpha, 1, hologramMask); + hologramResult.rgb *= max(1, _HologramMaxAlpha * max(sign(hologramYCoord - (_HologramUnmodAmount/totalHologram)), 0.0)); + hologramMask = 1 - step(0.01,hologramMask); + hologramResult.rgb += hologramMask * _HologramStripeColor * col.a; + col = lerp(col, hologramResult, _HologramBlend); + #endif + + //----------------------------------- + + //FLICKER_ON + #if FLICKER_ON + col.a *= saturate(col.a * step(frac(0.05 + (_Time.w + randomSeed) * _FlickerFreq), 1 - _FlickerPercent) + _FlickerAlpha); + #endif + //----------------------------------- + + //ALPHACUTOFF_ON + + //ALPHAROUND_ON + + //ALPHAOUTLINE_ON + #if ALPHAOUTLINE_ON + half alphaOutlineRes = pow(1 - col.a, max(_AlphaOutlinePower, 0.0001)) * step(_AlphaOutlineMinAlpha, col.a) * _AlphaOutlineBlend; + col.rgb = lerp(col.rgb, _AlphaOutlineColor.rgb * _AlphaOutlineGlow, alphaOutlineRes); + col.a = lerp(col.a, 1, alphaOutlineRes > 1); + #endif + //------------------------------------------------------- + + //FOG_ON + + //------------------ + + col *= _Color; + o.Albedo = col; + col.a *= _Alpha; + clip(col.a - _AlphaCutoffValue - 0.01); + o.Alpha = _Color.a; + } + + + + + + void ChainSurfaceFunction(inout Surface l, inout ShaderData d) + { + Ext_SurfaceFunction0(l, d); + // Ext_SurfaceFunction1(l, d); + // Ext_SurfaceFunction2(l, d); + // Ext_SurfaceFunction3(l, d); + // Ext_SurfaceFunction4(l, d); + // Ext_SurfaceFunction5(l, d); + // Ext_SurfaceFunction6(l, d); + // Ext_SurfaceFunction7(l, d); + // Ext_SurfaceFunction8(l, d); + // Ext_SurfaceFunction9(l, d); + // Ext_SurfaceFunction10(l, d); + // Ext_SurfaceFunction11(l, d); + // Ext_SurfaceFunction12(l, d); + // Ext_SurfaceFunction13(l, d); + // Ext_SurfaceFunction14(l, d); + // Ext_SurfaceFunction15(l, d); + // Ext_SurfaceFunction16(l, d); + // Ext_SurfaceFunction17(l, d); + // Ext_SurfaceFunction18(l, d); + // Ext_SurfaceFunction19(l, d); + // Ext_SurfaceFunction20(l, d); + // Ext_SurfaceFunction21(l, d); + // Ext_SurfaceFunction22(l, d); + // Ext_SurfaceFunction23(l, d); + // Ext_SurfaceFunction24(l, d); + // Ext_SurfaceFunction25(l, d); + // Ext_SurfaceFunction26(l, d); + // Ext_SurfaceFunction27(l, d); + // Ext_SurfaceFunction28(l, d); + // Ext_SurfaceFunction29(l, d); + } + +#if !_DECALSHADER + + void ChainModifyVertex(inout VertexData v, inout VertexToPixel v2p, float4 time) + { + ExtraV2F d; + + ZERO_INITIALIZE(ExtraV2F, d); + ZERO_INITIALIZE(Blackboard, d.blackboard); + // due to motion vectors in HDRP, we need to use the last + // time in certain spots. So if you are going to use _Time to adjust vertices, + // you need to use this time or motion vectors will break. + d.time = time; + + Ext_ModifyVertex0(v, d); + // Ext_ModifyVertex1(v, d); + // Ext_ModifyVertex2(v, d); + // Ext_ModifyVertex3(v, d); + // Ext_ModifyVertex4(v, d); + // Ext_ModifyVertex5(v, d); + // Ext_ModifyVertex6(v, d); + // Ext_ModifyVertex7(v, d); + // Ext_ModifyVertex8(v, d); + // Ext_ModifyVertex9(v, d); + // Ext_ModifyVertex10(v, d); + // Ext_ModifyVertex11(v, d); + // Ext_ModifyVertex12(v, d); + // Ext_ModifyVertex13(v, d); + // Ext_ModifyVertex14(v, d); + // Ext_ModifyVertex15(v, d); + // Ext_ModifyVertex16(v, d); + // Ext_ModifyVertex17(v, d); + // Ext_ModifyVertex18(v, d); + // Ext_ModifyVertex19(v, d); + // Ext_ModifyVertex20(v, d); + // Ext_ModifyVertex21(v, d); + // Ext_ModifyVertex22(v, d); + // Ext_ModifyVertex23(v, d); + // Ext_ModifyVertex24(v, d); + // Ext_ModifyVertex25(v, d); + // Ext_ModifyVertex26(v, d); + // Ext_ModifyVertex27(v, d); + // Ext_ModifyVertex28(v, d); + // Ext_ModifyVertex29(v, d); + + + // #if %EXTRAV2F0REQUIREKEY% + // v2p.extraV2F0 = d.extraV2F0; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // v2p.extraV2F1 = d.extraV2F1; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // v2p.extraV2F2 = d.extraV2F2; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // v2p.extraV2F3 = d.extraV2F3; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // v2p.extraV2F4 = d.extraV2F4; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // v2p.extraV2F5 = d.extraV2F5; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // v2p.extraV2F6 = d.extraV2F6; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // v2p.extraV2F7 = d.extraV2F7; + // #endif + } + + void ChainModifyTessellatedVertex(inout VertexData v, inout VertexToPixel v2p) + { + ExtraV2F d; + ZERO_INITIALIZE(ExtraV2F, d); + ZERO_INITIALIZE(Blackboard, d.blackboard); + + // #if %EXTRAV2F0REQUIREKEY% + // d.extraV2F0 = v2p.extraV2F0; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // d.extraV2F1 = v2p.extraV2F1; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // d.extraV2F2 = v2p.extraV2F2; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // d.extraV2F3 = v2p.extraV2F3; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // d.extraV2F4 = v2p.extraV2F4; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // d.extraV2F5 = v2p.extraV2F5; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // d.extraV2F6 = v2p.extraV2F6; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // d.extraV2F7 = v2p.extraV2F7; + // #endif + + + // Ext_ModifyTessellatedVertex0(v, d); + // Ext_ModifyTessellatedVertex1(v, d); + // Ext_ModifyTessellatedVertex2(v, d); + // Ext_ModifyTessellatedVertex3(v, d); + // Ext_ModifyTessellatedVertex4(v, d); + // Ext_ModifyTessellatedVertex5(v, d); + // Ext_ModifyTessellatedVertex6(v, d); + // Ext_ModifyTessellatedVertex7(v, d); + // Ext_ModifyTessellatedVertex8(v, d); + // Ext_ModifyTessellatedVertex9(v, d); + // Ext_ModifyTessellatedVertex10(v, d); + // Ext_ModifyTessellatedVertex11(v, d); + // Ext_ModifyTessellatedVertex12(v, d); + // Ext_ModifyTessellatedVertex13(v, d); + // Ext_ModifyTessellatedVertex14(v, d); + // Ext_ModifyTessellatedVertex15(v, d); + // Ext_ModifyTessellatedVertex16(v, d); + // Ext_ModifyTessellatedVertex17(v, d); + // Ext_ModifyTessellatedVertex18(v, d); + // Ext_ModifyTessellatedVertex19(v, d); + // Ext_ModifyTessellatedVertex20(v, d); + // Ext_ModifyTessellatedVertex21(v, d); + // Ext_ModifyTessellatedVertex22(v, d); + // Ext_ModifyTessellatedVertex23(v, d); + // Ext_ModifyTessellatedVertex24(v, d); + // Ext_ModifyTessellatedVertex25(v, d); + // Ext_ModifyTessellatedVertex26(v, d); + // Ext_ModifyTessellatedVertex27(v, d); + // Ext_ModifyTessellatedVertex28(v, d); + // Ext_ModifyTessellatedVertex29(v, d); + + // #if %EXTRAV2F0REQUIREKEY% + // v2p.extraV2F0 = d.extraV2F0; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // v2p.extraV2F1 = d.extraV2F1; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // v2p.extraV2F2 = d.extraV2F2; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // v2p.extraV2F3 = d.extraV2F3; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // v2p.extraV2F4 = d.extraV2F4; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // v2p.extraV2F5 = d.extraV2F5; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // v2p.extraV2F6 = d.extraV2F6; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // v2p.extraV2F7 = d.extraV2F7; + // #endif + } + + void ChainFinalColorForward(inout Surface l, inout ShaderData d, inout half4 color) + { + // Ext_FinalColorForward0(l, d, color); + // Ext_FinalColorForward1(l, d, color); + // Ext_FinalColorForward2(l, d, color); + // Ext_FinalColorForward3(l, d, color); + // Ext_FinalColorForward4(l, d, color); + // Ext_FinalColorForward5(l, d, color); + // Ext_FinalColorForward6(l, d, color); + // Ext_FinalColorForward7(l, d, color); + // Ext_FinalColorForward8(l, d, color); + // Ext_FinalColorForward9(l, d, color); + // Ext_FinalColorForward10(l, d, color); + // Ext_FinalColorForward11(l, d, color); + // Ext_FinalColorForward12(l, d, color); + // Ext_FinalColorForward13(l, d, color); + // Ext_FinalColorForward14(l, d, color); + // Ext_FinalColorForward15(l, d, color); + // Ext_FinalColorForward16(l, d, color); + // Ext_FinalColorForward17(l, d, color); + // Ext_FinalColorForward18(l, d, color); + // Ext_FinalColorForward19(l, d, color); + // Ext_FinalColorForward20(l, d, color); + // Ext_FinalColorForward21(l, d, color); + // Ext_FinalColorForward22(l, d, color); + // Ext_FinalColorForward23(l, d, color); + // Ext_FinalColorForward24(l, d, color); + // Ext_FinalColorForward25(l, d, color); + // Ext_FinalColorForward26(l, d, color); + // Ext_FinalColorForward27(l, d, color); + // Ext_FinalColorForward28(l, d, color); + // Ext_FinalColorForward29(l, d, color); + } + + void ChainFinalGBufferStandard(inout Surface s, inout ShaderData d, inout half4 GBuffer0, inout half4 GBuffer1, inout half4 GBuffer2, inout half4 outEmission, inout half4 outShadowMask) + { + // Ext_FinalGBufferStandard0(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard1(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard2(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard3(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard4(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard5(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard6(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard7(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard8(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard9(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard10(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard11(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard12(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard13(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard14(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard15(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard16(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard17(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard18(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard19(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard20(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard21(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard22(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard23(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard24(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard25(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard26(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard27(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard28(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard29(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + } +#endif + + + + + +#if _DECALSHADER + + ShaderData CreateShaderData(SurfaceDescriptionInputs IN) + { + ShaderData d = (ShaderData)0; + d.TBNMatrix = float3x3(IN.WorldSpaceTangent, IN.WorldSpaceBiTangent, IN.WorldSpaceNormal); + d.worldSpaceNormal = IN.WorldSpaceNormal; + d.worldSpaceTangent = IN.WorldSpaceTangent; + + d.worldSpacePosition = IN.WorldSpacePosition; + d.texcoord0 = IN.uv0.xyxy; + d.screenPos = IN.ScreenPosition; + + d.worldSpaceViewDir = normalize(_WorldSpaceCameraPos - d.worldSpacePosition); + + d.tangentSpaceViewDir = mul(d.TBNMatrix, d.worldSpaceViewDir); + + // these rarely get used, so we back transform them. Usually will be stripped. + #if _HDRP + // d.localSpacePosition = mul(GetWorldToObjectMatrix(), float4(GetCameraRelativePositionWS(d.worldSpacePosition), 1)).xyz; + #else + // d.localSpacePosition = mul(GetWorldToObjectMatrix(), float4(d.worldSpacePosition, 1)).xyz; + #endif + // d.localSpaceNormal = normalize(mul((float3x3)GetWorldToObjectMatrix(), d.worldSpaceNormal)); + // d.localSpaceTangent = normalize(mul((float3x3)GetWorldToObjectMatrix(), d.worldSpaceTangent.xyz)); + + // #if %SCREENPOSREQUIREKEY% + // d.screenUV = (IN.ScreenPosition.xy / max(0.01, IN.ScreenPosition.w)); + // #endif + + return d; + } +#else + + ShaderData CreateShaderData(VertexToPixel i + #if NEED_FACING + , bool facing + #endif + ) + { + ShaderData d = (ShaderData)0; + d.clipPos = i.pos; + d.worldSpacePosition = i.worldPos; + + d.worldSpaceNormal = normalize(i.worldNormal); + d.worldSpaceTangent.xyz = normalize(i.worldTangent.xyz); + + d.tangentSign = i.worldTangent.w * unity_WorldTransformParams.w; + float3 bitangent = cross(d.worldSpaceTangent.xyz, d.worldSpaceNormal) * d.tangentSign; + + d.TBNMatrix = float3x3(d.worldSpaceTangent, -bitangent, d.worldSpaceNormal); + d.worldSpaceViewDir = normalize(_WorldSpaceCameraPos - i.worldPos); + + d.tangentSpaceViewDir = mul(d.TBNMatrix, d.worldSpaceViewDir); + d.texcoord0 = i.texcoord0; + d.texcoord1 = i.texcoord1; + d.texcoord2 = i.texcoord2; + + // #if %TEXCOORD3REQUIREKEY% + d.texcoord3 = i.texcoord3; + // #endif + + // d.isFrontFace = facing; + // #if %VERTEXCOLORREQUIREKEY% + d.vertexColor = i.vertexColor; + // #endif + + // these rarely get used, so we back transform them. Usually will be stripped. + #if _HDRP + // d.localSpacePosition = mul(GetWorldToObjectMatrix(), float4(GetCameraRelativePositionWS(i.worldPos), 1)).xyz; + #else + // d.localSpacePosition = mul(GetWorldToObjectMatrix(), float4(i.worldPos, 1)).xyz; + #endif + // d.localSpaceNormal = normalize(mul((float3x3)GetWorldToObjectMatrix(), i.worldNormal)); + // d.localSpaceTangent = normalize(mul((float3x3)GetWorldToObjectMatrix(), i.worldTangent.xyz)); + + // #if %SCREENPOSREQUIREKEY% + // d.screenPos = i.screenPos; + // d.screenUV = (i.screenPos.xy / i.screenPos.w); + // #endif + + + // #if %EXTRAV2F0REQUIREKEY% + // d.extraV2F0 = i.extraV2F0; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // d.extraV2F1 = i.extraV2F1; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // d.extraV2F2 = i.extraV2F2; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // d.extraV2F3 = i.extraV2F3; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // d.extraV2F4 = i.extraV2F4; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // d.extraV2F5 = i.extraV2F5; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // d.extraV2F6 = i.extraV2F6; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // d.extraV2F7 = i.extraV2F7; + // #endif + + return d; + } + +#endif + + + +#if (SHADERPASS == SHADERPASS_LIGHT_TRANSPORT) + + // This was not in constant buffer in original unity, so keep outiside. But should be in as ShaderRenderPass frequency + float unity_OneOverOutputBoost; + float unity_MaxOutputValue; + + CBUFFER_START(UnityMetaPass) + // x = use uv1 as raster position + // y = use uv2 as raster position + bool4 unity_MetaVertexControl; + + // x = return albedo + // y = return normal + bool4 unity_MetaFragmentControl; + CBUFFER_END + + VertexToPixel Vert(VertexData inputMesh) + { + VertexToPixel output; + ZERO_INITIALIZE(VertexToPixel, output); + UNITY_SETUP_INSTANCE_ID(inputMesh); + UNITY_TRANSFER_INSTANCE_ID(inputMesh, output); + UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(output); + + // Output UV coordinate in vertex shader + float2 uv = float2(0.0, 0.0); + + if (unity_MetaVertexControl.x) + { + uv = inputMesh.texcoord1.xy * unity_LightmapST.xy + unity_LightmapST.zw; + } + else if (unity_MetaVertexControl.y) + { + uv = inputMesh.texcoord2.xy * unity_DynamicLightmapST.xy + unity_DynamicLightmapST.zw; + } + + // OpenGL right now needs to actually use the incoming vertex position + // so we create a fake dependency on it here that haven't any impact. + output.pos = float4(uv * 2.0 - 1.0, inputMesh.vertex.z > 0 ? 1.0e-4 : 0.0, 1.0); + + output.worldPos = TransformObjectToWorld(inputMesh.vertex.xyz).xyz; + + // Normal is required for triplanar mapping + output.worldNormal = TransformObjectToWorldNormal(inputMesh.normal); + // Not required but assign to silent compiler warning + output.worldTangent = float4(1.0, 0.0, 0.0, 0.0); + + output.texcoord0 = inputMesh.texcoord0; + output.texcoord1 = inputMesh.texcoord1; + output.texcoord2 = inputMesh.texcoord2; + // #if %TEXCOORD3REQUIREKEY% + output.texcoord3 = inputMesh.texcoord3; + // #endif + // #if %VERTEXCOLORREQUIREKEY% + output.vertexColor = inputMesh.vertexColor; + // #endif + + return output; + } +#else + + #if (_PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR))) + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/ShaderVariablesMatrixDefsHDCamera.hlsl" + + void MotionVectorPositionZBias(VertexToPixel input) + { + #if UNITY_REVERSED_Z + input.pos.z -= unity_MotionVectorsParams.z * input.pos.w; + #else + input.pos.z += unity_MotionVectorsParams.z * input.pos.w; + #endif + } + + #endif + + VertexToPixel Vert(VertexData input) + { + VertexToPixel output; + ZERO_INITIALIZE(VertexToPixel, output); + + UNITY_SETUP_INSTANCE_ID(input); + UNITY_TRANSFER_INSTANCE_ID(input, output); + UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(output); + + #if _HDRP && (_PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR))) + VertexData previousMesh = input; + #endif + + ChainModifyVertex(input, output, _Time); + + // This return the camera relative position (if enable) + float3 positionRWS = TransformObjectToWorld(input.vertex.xyz); + float3 normalWS = TransformObjectToWorldNormal(input.normal); + float4 tangentWS = float4(TransformObjectToWorldDir(input.tangent.xyz), input.tangent.w); + + + output.worldPos = GetAbsolutePositionWS(positionRWS); + output.pos = TransformWorldToHClip(positionRWS); + output.worldNormal = normalWS; + output.worldTangent = tangentWS; + + + output.texcoord0 = input.texcoord0; + output.texcoord1 = input.texcoord1; + output.texcoord2 = input.texcoord2; + + // #if %TEXCOORD3REQUIREKEY% + output.texcoord3 = input.texcoord3; + // #endif + + // #if %VERTEXCOLORREQUIREKEY% + output.vertexColor = input.vertexColor; + // #endif + + // #if %SCREENPOSREQUIREKEY% + // output.screenPos = ComputeScreenPos(output.pos, _ProjectionParams.x); + // #endif + + #if _HDRP && (_PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR))) + + #if !defined(TESSELLATION_ON) + MotionVectorPositionZBias(output); + #endif + + output.motionVectorCS = mul(UNITY_MATRIX_UNJITTERED_VP, float4(positionRWS.xyz, 1.0)); + // Note: unity_MotionVectorsParams.y is 0 is forceNoMotion is enabled + bool forceNoMotion = unity_MotionVectorsParams.y == 0.0; + if (forceNoMotion) + { + output.previousPositionCS = float4(0.0, 0.0, 0.0, 1.0); + } + else + { + bool hasDeformation = unity_MotionVectorsParams.x > 0.0; // Skin or morph target + + float3 effectivePositionOS = (hasDeformation ? previousMesh.previousPositionOS : previousMesh.vertex.xyz); + #if defined(_ADD_PRECOMPUTED_VELOCITY) + effectivePositionOS -= input.precomputedVelocity; + #endif + + previousMesh.vertex = float4(effectivePositionOS, 1); + VertexToPixel dummy = (VertexToPixel)0; + + + ChainModifyVertex(previousMesh, dummy, _LastTimeParameters); + + // we might need this for skinned objects? + //float3 normalWS = TransformPreviousObjectToWorldNormal(input.normal).xyz; + float3 previousPositionRWS = TransformPreviousObjectToWorld(previousMesh.vertex.xyz); + + #ifdef _WRITE_TRANSPARENT_MOTION_VECTOR + if (_TransparentCameraOnlyMotionVectors > 0) + { + previousPositionRWS = positionRWS.xyz; + } + #endif // _WRITE_TRANSPARENT_MOTION_VECTOR + + output.previousPositionCS = mul(UNITY_MATRIX_PREV_VP, float4(previousPositionRWS, 1.0)); + } + #endif // _HDRP && _PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR)) + + + return output; + } + + +#endif + + + + + + + + #if defined(WRITE_DECAL_BUFFER) && !defined(_DISABLE_DECALS) + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/Decal/DecalPrepassBuffer.hlsl" + #endif + + FragInputs BuildFragInputs(VertexToPixel input) + { + UNITY_SETUP_INSTANCE_ID(input); + FragInputs output; + ZERO_INITIALIZE(FragInputs, output); + + // Init to some default value to make the computer quiet (else it output 'divide by zero' warning even if value is not used). + // TODO: this is a really poor workaround, but the variable is used in a bunch of places + // to compute normals which are then passed on elsewhere to compute other values... + output.tangentToWorld = k_identity3x3; + output.positionSS = input.pos; // input.positionCS is SV_Position + // BETTER SHADERS: because we transform world position into actual world space for things like + // triplanar, etc, we have to back transform it here for lighting + output.positionRWS = GetCameraRelativePositionWS(input.worldPos); + output.tangentToWorld = BuildTangentToWorld(input.worldTangent, input.worldNormal); + output.texCoord0 = input.texcoord0; + output.texCoord1 = input.texcoord1; + output.texCoord2 = input.texcoord2; + + return output; + } + + void BuildSurfaceData(FragInputs fragInputs, inout Surface surfaceDescription, float3 V, PositionInputs posInput, out SurfaceData surfaceData, out float3 bentNormalWS) + { + // setup defaults -- these are used if the graph doesn't output a value + ZERO_INITIALIZE(SurfaceData, surfaceData); + + // specularOcclusion need to be init ahead of decal to quiet the compiler that modify the SurfaceData struct + // however specularOcclusion can come from the graph, so need to be init here so it can be override. + surfaceData.specularOcclusion = 1.0; + + // copy across graph values, if defined + surfaceData.baseColor = surfaceDescription.Albedo; + surfaceData.perceptualSmoothness = surfaceDescription.Smoothness; + surfaceData.ambientOcclusion = surfaceDescription.Occlusion; + surfaceData.specularOcclusion = surfaceDescription.SpecularOcclusion; + surfaceData.metallic = surfaceDescription.Metallic; + surfaceData.subsurfaceMask = surfaceDescription.SubsurfaceMask; + surfaceData.thickness = surfaceDescription.Thickness; + surfaceData.diffusionProfileHash = asuint(surfaceDescription.DiffusionProfileHash); + #if _USESPECULAR + surfaceData.specularColor = surfaceDescription.Specular; + #endif + surfaceData.coatMask = surfaceDescription.CoatMask; + surfaceData.anisotropy = surfaceDescription.Anisotropy; + surfaceData.iridescenceMask = surfaceDescription.IridescenceMask; + surfaceData.iridescenceThickness = surfaceDescription.IridescenceThickness; + + + + #if defined(_REFRACTION_PLANE) || defined(_REFRACTION_SPHERE) || defined(_REFRACTION_THIN) + if (_EnableSSRefraction) + { + surfaceData.transmittanceMask = (1.0 - surfaceDescription.Alpha); + surfaceDescription.Alpha = 1.0; + } + else + { + surfaceData.ior = surfaceDescription.ior; + surfaceData.transmittanceColor = surfaceDescription.transmittanceColor; + surfaceData.atDistance = surfaceDescription.atDistance; + surfaceData.transmittanceMask = surfaceDescription.transmittanceMask; + surfaceDescription.Alpha = 1.0; + } + #else + surfaceData.ior = 1.0; + surfaceData.transmittanceColor = float3(1.0, 1.0, 1.0); + surfaceData.atDistance = 1.0; + surfaceData.transmittanceMask = 0.0; + #endif + + + + // These static material feature allow compile time optimization + surfaceData.materialFeatures = MATERIALFEATUREFLAGS_LIT_STANDARD; + #ifdef _MATERIAL_FEATURE_SUBSURFACE_SCATTERING + surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_SUBSURFACE_SCATTERING; + #endif + + #ifdef _MATERIAL_FEATURE_TRANSMISSION + surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_TRANSMISSION; + #endif + + #ifdef _MATERIAL_FEATURE_ANISOTROPY + surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_ANISOTROPY; + surfaceData.normalWS = float3(0, 1, 0); + #endif + + #ifdef _MATERIAL_FEATURE_IRIDESCENCE + surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_IRIDESCENCE; + #endif + + #ifdef _MATERIAL_FEATURE_SPECULAR_COLOR + surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_SPECULAR_COLOR; + #endif + + #if defined(_MATERIAL_FEATURE_CLEAR_COAT) || _CLEARCOAT + surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_CLEAR_COAT; + #endif + + #if defined (_MATERIAL_FEATURE_SPECULAR_COLOR) && defined (_ENERGY_CONSERVING_SPECULAR) + // Require to have setup baseColor + // Reproduce the energy conservation done in legacy Unity. Not ideal but better for compatibility and users can unchek it + surfaceData.baseColor *= (1.0 - Max3(surfaceData.specularColor.r, surfaceData.specularColor.g, surfaceData.specularColor.b)); + #endif + + + + // compute world space normal + #if !_WORLDSPACENORMAL + surfaceData.normalWS = mul(surfaceDescription.Normal, fragInputs.tangentToWorld); + #else + surfaceData.normalWS = surfaceDescription.Normal; + #endif + + surfaceData.geomNormalWS = fragInputs.tangentToWorld[2]; + + surfaceData.tangentWS = normalize(fragInputs.tangentToWorld[0].xyz); // The tangent is not normalize in tangentToWorld for mikkt. TODO: Check if it expected that we normalize with Morten. Tag: SURFACE_GRADIENT + + + #if HAVE_DECALS + if (_EnableDecals) + { + float alpha = 1.0; + alpha = surfaceDescription.Alpha; + + // Both uses and modifies 'surfaceData.normalWS'. + DecalSurfaceData decalSurfaceData = GetDecalSurfaceData(posInput, fragInputs.tangentToWorld[2], alpha); + ApplyDecalToSurfaceData(decalSurfaceData, fragInputs.tangentToWorld[2], surfaceData); + } + #endif + + bentNormalWS = surfaceData.normalWS; + + surfaceData.tangentWS = Orthonormalize(surfaceData.tangentWS, surfaceData.normalWS); + + #ifdef DEBUG_DISPLAY + if (_DebugMipMapMode != DEBUGMIPMAPMODE_NONE) + { + // TODO: need to update mip info + surfaceData.metallic = 0; + } + + // We need to call ApplyDebugToSurfaceData after filling the surfarcedata and before filling builtinData + // as it can modify attribute use for static lighting + ApplyDebugToSurfaceData(fragInputs.tangentToWorld, surfaceData); + #endif + + // By default we use the ambient occlusion with Tri-ace trick (apply outside) for specular occlusion. + // If user provide bent normal then we process a better term + #if defined(_SPECULAR_OCCLUSION_CUSTOM) + // Just use the value passed through via the slot (not active otherwise) + #elif defined(_SPECULAR_OCCLUSION_FROM_AO_BENT_NORMAL) + // If we have bent normal and ambient occlusion, process a specular occlusion + surfaceData.specularOcclusion = GetSpecularOcclusionFromBentAO(V, bentNormalWS, surfaceData.normalWS, surfaceData.ambientOcclusion, PerceptualSmoothnessToPerceptualRoughness(surfaceData.perceptualSmoothness)); + #elif defined(_AMBIENT_OCCLUSION) && defined(_SPECULAR_OCCLUSION_FROM_AO) + surfaceData.specularOcclusion = GetSpecularOcclusionFromAmbientOcclusion(ClampNdotV(dot(surfaceData.normalWS, V)), surfaceData.ambientOcclusion, PerceptualSmoothnessToRoughness(surfaceData.perceptualSmoothness)); + #endif + + #if defined(_ENABLE_GEOMETRIC_SPECULAR_AA) && !defined(SHADER_STAGE_RAY_TRACING) + surfaceData.perceptualSmoothness = GeometricNormalFiltering(surfaceData.perceptualSmoothness, fragInputs.tangentToWorld[2], surfaceDescription.SpecularAAScreenSpaceVariance, surfaceDescription.SpecularAAThreshold); + #endif + } + + void GetSurfaceAndBuiltinData(VertexToPixel m2ps, FragInputs fragInputs, float3 V, inout PositionInputs posInput, + out SurfaceData surfaceData, out BuiltinData builtinData, inout Surface l, inout ShaderData d + #if NEED_FACING + , bool facing + #endif + ) + { + // Removed since crossfade does not work, probably needs extra material setup. + //#if !defined(SHADER_STAGE_RAY_TRACING) && !defined(_TESSELLATION_DISPLACEMENT) + // #ifdef LOD_FADE_CROSSFADE // enable dithering LOD transition if user select CrossFade transition in LOD group + // LODDitheringTransition(ComputeFadeMaskSeed(V, posInput.positionSS), unity_LODFade.x); + // #endif + //#endif + + d = CreateShaderData(m2ps + #if NEED_FACING + , facing + #endif + ); + + l = (Surface)0; + + l.Albedo = half3(0.5, 0.5, 0.5); + l.Normal = float3(0,0,1); + l.Occlusion = 1; + l.Alpha = 1; + l.SpecularOcclusion = 1; + + #if !defined(SHADER_STAGE_RAY_TRACING) && defined(_DEPTHOFFSET_ON) + l.outputDepth = d.clipPos.z; + #endif + + ChainSurfaceFunction(l, d); + + #if !defined(SHADER_STAGE_RAY_TRACING) && defined(_DEPTHOFFSET_ON) + //posInput.deviceDepth = l.outputDepth; + #endif + + #if _UNLIT + //l.Emission = l.Albedo; + //l.Albedo = 0; + l.Normal = half3(0,0,1); + l.Occlusion = 1; + l.Metallic = 0; + l.Specular = 0; + #endif + + surfaceData.geomNormalWS = d.worldSpaceNormal; + surfaceData.tangentWS = d.worldSpaceTangent; + fragInputs.tangentToWorld = d.TBNMatrix; + + float3 bentNormalWS; + BuildSurfaceData(fragInputs, l, V, posInput, surfaceData, bentNormalWS); + + + InitBuiltinData(posInput, l.Alpha, bentNormalWS, -d.worldSpaceNormal, fragInputs.texCoord1, fragInputs.texCoord2, builtinData); + + + + builtinData.emissiveColor = l.Emission; + + #if defined(_OVERRIDE_BAKEDGI) + builtinData.bakeDiffuseLighting = l.DiffuseGI; + builtinData.backBakeDiffuseLighting = l.BackDiffuseGI; + builtinData.emissiveColor += l.SpecularGI; + #endif + + #if defined(_OVERRIDE_SHADOWMASK) + builtinData.shadowMask0 = l.ShadowMask.x; + builtinData.shadowMask1 = l.ShadowMask.y; + builtinData.shadowMask2 = l.ShadowMask.z; + builtinData.shadowMask3 = l.ShadowMask.w; + #endif + + #if defined(UNITY_VIRTUAL_TEXTURING) + builtinData.vtPackedFeedback = surfaceData.VTPackedFeedback; + #endif + + #if (SHADERPASS == SHADERPASS_DISTORTION) + builtinData.distortion = surfaceData.Distortion; + builtinData.distortionBlur = surfaceData.DistortionBlur; + #endif + + #ifndef SHADER_UNLIT + // PostInitBuiltinData call ApplyDebugToBuiltinData + PostInitBuiltinData(V, posInput, surfaceData, builtinData); + #else + ApplyDebugToBuiltinData(builtinData); + #endif + + RAY_TRACING_OPTIONAL_ALPHA_TEST_PASS + } + + + #if defined(WRITE_NORMAL_BUFFER) && defined(WRITE_MSAA_DEPTH) + #define SV_TARGET_DECAL SV_Target2 + #elif defined(WRITE_NORMAL_BUFFER) || defined(WRITE_MSAA_DEPTH) + #define SV_TARGET_DECAL SV_Target1 + #else + #define SV_TARGET_DECAL SV_Target0 + #endif + + + void Frag( VertexToPixel v2f + #if defined(SCENESELECTIONPASS) || defined(SCENEPICKINGPASS) + , out float4 outColor : SV_Target0 + #else + #ifdef WRITE_MSAA_DEPTH + // We need the depth color as SV_Target0 for alpha to coverage + , out float4 depthColor : SV_Target0 + #ifdef WRITE_NORMAL_BUFFER + , out float4 outNormalBuffer : SV_Target1 + #endif + #else + #ifdef WRITE_NORMAL_BUFFER + , out float4 outNormalBuffer : SV_Target0 + #endif + #endif + + // Decal buffer must be last as it is bind but we can optionally write into it (based on _DISABLE_DECALS) + #if defined(WRITE_DECAL_BUFFER) && !defined(_DISABLE_DECALS) + , out float4 outDecalBuffer : SV_TARGET_DECAL + #endif + #endif + + #if defined(_DEPTHOFFSET_ON) && !defined(SCENEPICKINGPASS) + , out float outputDepth : SV_Depth + #endif + #if NEED_FACING + , bool facing : SV_IsFrontFace + #endif + ) + { + UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX(v2f); + FragInputs input = BuildFragInputs(v2f); + + // input.positionSS is SV_Position + PositionInputs posInput = GetPositionInput(input.positionSS.xy, _ScreenSize.zw, input.positionSS.z, input.positionSS.w, input.positionRWS); + + + float3 V = GetWorldSpaceNormalizeViewDir(input.positionRWS); + + + SurfaceData surfaceData; + BuiltinData builtinData; + Surface l; + ShaderData d; + GetSurfaceAndBuiltinData(v2f, input, V, posInput, surfaceData, builtinData, l, d + #if NEED_FACING + , facing + #endif + ); + + + #ifdef _DEPTHOFFSET_ON + outputDepth = l.outputDepth; + #endif + + #ifdef SCENESELECTIONPASS + // We use depth prepass for scene selection in the editor, this code allow to output the outline correctly + outColor = float4(_ObjectId, _PassValue, 1.0, 1.0); + #elif defined(SCENEPICKINGPASS) + outColor = _SelectionID; + #else + #ifdef WRITE_MSAA_DEPTH + // In case we are rendering in MSAA, reading the an MSAA depth buffer is way too expensive. To avoid that, we export the depth to a color buffer + depthColor = v2f.pos.z; + + #ifdef _ALPHATOMASK_ON + // Alpha channel is used for alpha to coverage + depthColor.a = SharpenAlpha(builtinData.opacity, builtinData.alphaClipTreshold); + #endif // alphatomask + #endif // msaa_depth + #endif + + #if defined(WRITE_NORMAL_BUFFER) + EncodeIntoNormalBuffer(ConvertSurfaceDataToNormalData(surfaceData), outNormalBuffer); + #endif + + #if defined(WRITE_DECAL_BUFFER) && !defined(_DISABLE_DECALS) + DecalPrepassData decalPrepassData; + // We don't have the right to access SurfaceData in a shaderpass. + // However it would be painful to have to add a function like ConvertSurfaceDataToDecalPrepassData() to every Material to return geomNormalWS anyway + // Here we will put the constrain that any Material requiring to support Decal, will need to have geomNormalWS as member of surfaceData (and we already require normalWS anyway) + decalPrepassData.geomNormalWS = surfaceData.geomNormalWS; + decalPrepassData.decalLayerMask = GetMeshRenderingDecalLayer(); + EncodeIntoDecalPrepassBuffer(decalPrepassData, outDecalBuffer); + #endif + + + } + + + + + ENDHLSL + } + + Pass + { + // based on HDLitPass.template + Name "DepthOnly" + Tags { "LightMode" = "DepthOnly" } + + //------------------------------------------------------------------------------------- + // Render Modes (Blend, Cull, ZTest, Stencil, etc) + //------------------------------------------------------------------------------------- + + Cull Back + + + ZWrite On + + + // Stencil setup + Stencil + { + WriteMask [_StencilWriteMaskDepth] + Ref [_StencilRefDepth] + Comp Always + Pass Replace + } + Tags { "RenderType" = "Opaque" "Queue" = "Geometry" "PreviewType" = "Plane" } + Cull [_CullingOption] + ZWrite [_ZWrite] + ZTest [_ZTestMode] + + + //------------------------------------------------------------------------------------- + // End Render Modes + //------------------------------------------------------------------------------------- + + HLSLPROGRAM + + #pragma target 4.5 + #pragma only_renderers d3d11 playstation xboxone vulkan metal switch + //#pragma enable_d3d11_debug_symbols + + #pragma multi_compile_instancing + #pragma multi_compile _ DOTS_INSTANCING_ON + #pragma instancing_options renderinglayer + + + //#pragma shader_feature _ _SURFACE_TYPE_TRANSPARENT + //#pragma shader_feature_local _BLENDMODE_OFF _BLENDMODE_ALPHA _BLENDMODE_ADD _BLENDMODE_PRE_MULTIPLY + //#pragma shader_feature_local _ _ADD_PRECOMPUTED_VELOCITY + //#pragma shader_feature_local _ _TRANSPARENT_WRITES_MOTION_VEC + //#pragma shader_feature_local _ _ENABLE_FOG_ON_TRANSPARENT + //#pragma shader_feature_local _ _DISABLE_DECALS + //#pragma shader_feature_local _ _DISABLE_SSR + //#pragma shader_feature_local _ _DISABLE_SSR_TRANSPARENT + //#pragma shader_feature_local _REFRACTION_OFF _REFRACTION_PLANE _REFRACTION_SPHERE _REFRACTION_THIN + #pragma multi_compile _ WRITE_DECAL_BUFFER + //------------------------------------------------------------------------------------- + // Variant Definitions (active field translations to HDRP defines) + //------------------------------------------------------------------------------------- + // #define _MATERIAL_FEATURE_SUBSURFACE_SCATTERING 1 + // #define _MATERIAL_FEATURE_TRANSMISSION 1 + // #define _MATERIAL_FEATURE_ANISOTROPY 1 + // #define _MATERIAL_FEATURE_IRIDESCENCE 1 + // #define _MATERIAL_FEATURE_SPECULAR_COLOR 1 + #define _ENABLE_FOG_ON_TRANSPARENT 1 + // #define _AMBIENT_OCCLUSION 1 + // #define _SPECULAR_OCCLUSION_FROM_AO 1 + // #define _SPECULAR_OCCLUSION_FROM_AO_BENT_NORMAL 1 + // #define _SPECULAR_OCCLUSION_CUSTOM 1 + // #define _ENERGY_CONSERVING_SPECULAR 1 + // #define _ENABLE_GEOMETRIC_SPECULAR_AA 1 + // #define _HAS_REFRACTION 1 + // #define _REFRACTION_PLANE 1 + // #define _REFRACTION_SPHERE 1 + // #define _DISABLE_DECALS 1 + // #define _DISABLE_SSR 1 + // #define _ADD_PRECOMPUTED_VELOCITY + // #define _WRITE_TRANSPARENT_MOTION_VECTOR 1 + // #define _DEPTHOFFSET_ON 1 + // #define _BLENDMODE_PRESERVE_SPECULAR_LIGHTING 1 + + #define SHADERPASS SHADERPASS_DEPTH_ONLY + #pragma multi_compile _ WRITE_NORMAL_BUFFER + #pragma multi_compile _ WRITE_MSAA_DEPTH + #define RAYTRACING_SHADER_GRAPH_HIGH + #define _PASSDEPTH 1 + + + + #pragma shader_feature_local GLOW_ON + #pragma shader_feature_local FADE_ON + #pragma shader_feature_local OUTBASE_ON + #pragma shader_feature_local ONLYOUTLINE_ON + #pragma shader_feature_local GRADIENT_ON + #pragma shader_feature_local GRADIENT2COL_ON + #pragma shader_feature_local RADIALGRADIENT_ON + #pragma shader_feature_local COLORSWAP_ON + #pragma shader_feature_local HSV_ON + #pragma shader_feature_local CHANGECOLOR_ON + #pragma shader_feature_local CHANGECOLOR2_ON + #pragma shader_feature_local CHANGECOLOR3_ON + #pragma shader_feature_local COLORRAMP_ON + #pragma shader_feature_local GRADIENTCOLORRAMP_ON + #pragma shader_feature_local HITEFFECT_ON + #pragma shader_feature_local NEGATIVE_ON + #pragma shader_feature_local PIXELATE_ON + #pragma shader_feature_local GREYSCALE_ON + #pragma shader_feature_local POSTERIZE_ON + #pragma shader_feature_local BLUR_ON + #pragma shader_feature_local MOTIONBLUR_ON + #pragma shader_feature_local GHOST_ON + #pragma shader_feature_local ALPHAOUTLINE_ON + #pragma shader_feature_local INNEROUTLINE_ON + #pragma shader_feature_local ONLYINNEROUTLINE_ON + #pragma shader_feature_local HOLOGRAM_ON + #pragma shader_feature_local CHROMABERR_ON + #pragma shader_feature_local GLITCH_ON + #pragma shader_feature_local FLICKER_ON + #pragma shader_feature_local SHADOW_ON + #pragma shader_feature_local SHINE_ON + #pragma shader_feature_local CONTRAST_ON + #pragma shader_feature_local OVERLAY_ON + #pragma shader_feature_local OVERLAYMULT_ON + #pragma shader_feature_local DOODLE_ON + #pragma shader_feature_local WIND_ON + #pragma shader_feature_local WAVEUV_ON + #pragma shader_feature_local ROUNDWAVEUV_ON + #pragma shader_feature_local RECTSIZE_ON + #pragma shader_feature_local OFFSETUV_ON + #pragma shader_feature_local CLIPPING_ON + #pragma shader_feature_local RADIALCLIPPING_ON + #pragma shader_feature_local TEXTURESCROLL_ON + #pragma shader_feature_local ZOOMUV_ON + #pragma shader_feature_local DISTORT_ON + #pragma shader_feature_local WARP_ON + #pragma shader_feature_local TWISTUV_ON + #pragma shader_feature_local ROTATEUV_ON + #pragma shader_feature_local POLARUV_ON + #pragma shader_feature_local FISHEYE_ON + #pragma shader_feature_local PINCH_ON + #pragma shader_feature_local SHAKEUV_ON + + #pragma shader_feature_local GLOWTEX_ON + #pragma shader_feature_local OUTTEX_ON + #pragma shader_feature_local OUTDIST_ON + #pragma shader_feature_local OUTBASE8DIR_ON + #pragma shader_feature_local OUTBASEPIXELPERF_ON + #pragma shader_feature_local COLORRAMPOUTLINE_ON + #pragma shader_feature_local GREYSCALEOUTLINE_ON + #pragma shader_feature_local POSTERIZEOUTLINE_ON + #pragma shader_feature_local BLURISHD_ON + #pragma shader_feature_local MANUALWIND_ON + #pragma shader_feature_local ATLAS_ON + #pragma shader_feature_local PREMULTIPLYALPHA_ON + + #pragma shader_feature BILBOARD_ON + #pragma shader_feature BILBOARDY_ON + + #pragma shader_feature NORMALMAP_ON + + + #define _HDRP 1 +#define _USINGTEXCOORD1 1 +#define _USINGTEXCOORD2 1 + + + #pragma vertex Vert + #pragma fragment Frag + + + + // useful conversion functions to make surface shader code just work + + #define UNITY_DECLARE_TEX2D(name) TEXTURE2D(name); SAMPLER(sampler##name); + #define UNITY_DECLARE_TEX2D_NOSAMPLER(name) TEXTURE2D(name); + #define UNITY_DECLARE_TEX2DARRAY(name) TEXTURE2D_ARRAY(name); SAMPLER(sampler##name); + #define UNITY_DECLARE_TEX2DARRAY_NOSAMPLER(tex) TEXTURE2D_ARRAY(tex); + + #define UNITY_SAMPLE_TEX2DARRAY(tex,coord) SAMPLE_TEXTURE2D_ARRAY(tex, sampler##tex, coord.xy, coord.z) + #define UNITY_SAMPLE_TEX2DARRAY_LOD(tex,coord,lod) SAMPLE_TEXTURE2D_ARRAY_LOD(tex, sampler##tex, coord.xy, coord.z, lod) + #define UNITY_SAMPLE_TEX2D(tex, coord) SAMPLE_TEXTURE2D(tex, sampler##tex, coord) + #define UNITY_SAMPLE_TEX2D_SAMPLER(tex, samp, coord) SAMPLE_TEXTURE2D(tex, sampler##samp, coord) + + #define UNITY_SAMPLE_TEX2D_LOD(tex,coord, lod) SAMPLE_TEXTURE2D_LOD(tex, sampler_##tex, coord, lod) + #define UNITY_SAMPLE_TEX2D_SAMPLER_LOD(tex,samplertex,coord, lod) SAMPLE_TEXTURE2D_LOD (tex, sampler##samplertex,coord, lod) + + #if defined(UNITY_COMPILER_HLSL) + #define UNITY_INITIALIZE_OUTPUT(type,name) name = (type)0; + #else + #define UNITY_INITIALIZE_OUTPUT(type,name) + #endif + + #define sampler2D_float sampler2D + #define sampler2D_half sampler2D + + #undef WorldNormalVector + #define WorldNormalVector(data, normal) mul(normal, data.TBNMatrix) + + #define UnityObjectToWorldNormal(normal) mul(GetObjectToWorldMatrix(), normal) + + + + +// HDRP Adapter stuff + #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Common.hlsl" + #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Texture.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/ShaderVariables.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/ShaderPass/FragInputs.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/ShaderPass/ShaderPass.cs.hlsl" + #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/TextureStack.hlsl" // Required to be include before we include properties as it define DECLARE_STACK_CB +#if UNITY_VERSION >= UNITY_2021_3_31 + #include "Packages/com.unity.shadergraph/ShaderGraphLibrary/Functions.hlsl" // Need to be here for Gradient struct definition +#else + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/ShaderGraphHeader.hlsl" +#endif + #ifdef RAYTRACING_SHADER_GRAPH_DEFAULT + #define RAYTRACING_SHADER_GRAPH_HIGH + #endif + + #ifdef RAYTRACING_SHADER_GRAPH_RAYTRACED + #define RAYTRACING_SHADER_GRAPH_LOW + #endif + // end + + + + + // If we use subsurface scattering, enable output split lighting (for forward pass) + #if defined(_MATERIAL_FEATURE_SUBSURFACE_SCATTERING) && !defined(_SURFACE_TYPE_TRANSPARENT) + #define OUTPUT_SPLIT_LIGHTING + #endif + + #define HAVE_RECURSIVE_RENDERING + + #if SHADERPASS == SHADERPASS_TRANSPARENT_DEPTH_PREPASS + #if !defined(_DISABLE_SSR_TRANSPARENT) && !defined(SHADER_UNLIT) + #define WRITE_NORMAL_BUFFER + #endif + #endif + + #ifndef DEBUG_DISPLAY + // In case of opaque we don't want to perform the alpha test, it is done in depth prepass and we use depth equal for ztest (setup from UI) + // Don't do it with debug display mode as it is possible there is no depth prepass in this case + #if !defined(_SURFACE_TYPE_TRANSPARENT) && defined(_ALPHATEST) + #if SHADERPASS == SHADERPASS_FORWARD + #define SHADERPASS_FORWARD_BYPASS_ALPHA_TEST + #elif SHADERPASS == SHADERPASS_GBUFFER + #define SHADERPASS_GBUFFER_BYPASS_ALPHA_TEST + #endif + #endif + #endif + + // Define _DEFERRED_CAPABLE_MATERIAL for shader capable to run in deferred pass + #if defined(SHADER_LIT) && !defined(_SURFACE_TYPE_TRANSPARENT) + #define _DEFERRED_CAPABLE_MATERIAL + #endif + + // Translate transparent motion vector define + #if defined(_TRANSPARENT_WRITES_MOTION_VEC) && defined(_SURFACE_TYPE_TRANSPARENT) + #define _WRITE_TRANSPARENT_MOTION_VECTOR + #endif + + + + + CBUFFER_START(UnityPerMaterial) + float _UseShadowThreshold; + float _BlendMode; + float _EnableBlendModePreserveSpecularLighting; + float _RayTracing; + float _RefractionModel; + + + half4 _Color; + half4 _MainTex_ST, _MainTex_TexelSize; + half _Alpha, _AlphaCutoffValue; + + #if ATLAS_ON + half _MinXUV, _MaxXUV, _MinYUV, _MaxYUV; + #endif + + #if GLOW_ON + half4 _GlowColor; + half _Glow, _GlowGlobal; + #endif + + #if HSV_ON + half _HsvShift, _HsvSaturation, _HsvBright; + #endif + + #if DISTORT_ON + half4 _DistortTex_ST; + half _DistortTexXSpeed, _DistortTexYSpeed, _DistortAmount; + #endif + + #if FADE_ON + half4 _FadeBurnColor, _FadeTex_ST, _FadeBurnTex_ST; + half _FadeAmount, _FadeBurnWidth, _FadeBurnTransition,_FadeBurnGlow; + #endif + + #if OUTBASE_ON + half4 _OutlineColor; + half _OutlineAlpha, _OutlineGlow, _OutlineWidth; + int _OutlinePixelWidth; + #endif + + #if OUTTEX_ON + half4 _OutlineTex_ST; + half _OutlineTexXSpeed, _OutlineTexYSpeed; + #endif + + #if OUTDIST_ON + half4 _OutlineDistortTex_ST; + half _OutlineDistortTexXSpeed, _OutlineDistortTexYSpeed, _OutlineDistortAmount; + #endif + + #if ALPHAOUTLINE_ON + half _AlphaOutlineGlow, _AlphaOutlinePower, _AlphaOutlineMinAlpha, _AlphaOutlineBlend; + half4 _AlphaOutlineColor; + #endif + + #if INNEROUTLINE_ON + half _InnerOutlineThickness, _InnerOutlineAlpha, _InnerOutlineGlow; + half4 _InnerOutlineColor; + #endif + + #if GRADIENT_ON + half _GradBlend, _GradBoostX, _GradBoostY; + half4 _GradTopRightCol, _GradTopLeftCol, _GradBotRightCol, _GradBotLeftCol; + #endif + + #if COLORSWAP_ON + half4 _ColorSwapRed, _ColorSwapGreen, _ColorSwapBlue; + half _ColorSwapRedLuminosity, _ColorSwapGreenLuminosity, _ColorSwapBlueLuminosity, _ColorSwapBlend; + #endif + + #if CHANGECOLOR_ON + half4 _ColorChangeNewCol, _ColorChangeTarget; + half _ColorChangeTolerance, _ColorChangeLuminosity; + #endif + #if CHANGECOLOR2_ON + half4 _ColorChangeNewCol2, _ColorChangeTarget2; + half _ColorChangeTolerance2; + #endif + #if CHANGECOLOR3_ON + half4 _ColorChangeNewCol3, _ColorChangeTarget3; + half _ColorChangeTolerance3; + #endif + + #if COLORRAMP_ON + half _ColorRampLuminosity, _ColorRampBlend; + #endif + + #if HITEFFECT_ON + half4 _HitEffectColor; + half _HitEffectGlow, _HitEffectBlend; + #endif + + #if NEGATIVE_ON + half _NegativeAmount; + #endif + + #if PIXELATE_ON + half _PixelateSize; + #endif + + #if GREYSCALE_ON + half _GreyscaleLuminosity, _GreyscaleBlend; + half4 _GreyscaleTintColor; + #endif + + #if POSTERIZE_ON + half _PosterizeNumColors, _PosterizeGamma; + #endif + + #if BLUR_ON + half _BlurIntensity; + #endif + + #if MOTIONBLUR_ON + half _MotionBlurAngle, _MotionBlurDist; + #endif + + #if GHOST_ON + half _GhostColorBoost, _GhostTransparency, _GhostBlend; + #endif + + #if HOLOGRAM_ON + half _HologramStripesAmount, _HologramMinAlpha, _HologramUnmodAmount, _HologramStripesSpeed, _HologramMaxAlpha, _HologramBlend; + half4 _HologramStripeColor; + #endif + + #if CHROMABERR_ON + half _ChromAberrAmount, _ChromAberrAlpha; + #endif + + #if GLITCH_ON + half _GlitchAmount, _GlitchSize; + #endif + + #if FLICKER_ON + half _FlickerFreq, _FlickerPercent, _FlickerAlpha; + #endif + + #if SHADOW_ON + half _ShadowX, _ShadowY, _ShadowAlpha; + half4 _ShadowColor; + #endif + + #if SHINE_ON + half4 _ShineColor; + half _ShineLocation, _ShineRotate, _ShineWidth, _ShineGlow; + #endif + + #if CONTRAST_ON + half _Contrast, _Brightness; + #endif + + #if OVERLAY_ON + half4 _OverlayTex_ST, _OverlayColor; + half _OverlayGlow, _OverlayBlend, _OverlayTextureScrollXSpeed, _OverlayTextureScrollYSpeed; + #endif + + #if DOODLE_ON + half _HandDrawnAmount, _HandDrawnSpeed; + #endif + + #if WIND_ON + half _GrassSpeed, _GrassWind, _GrassManualAnim, _GrassRadialBend; + #endif + + #if WAVEUV_ON + float _WaveAmount, _WaveSpeed, _WaveStrength, _WaveX, _WaveY; + #endif + + #if ROUNDWAVEUV_ON + half _RoundWaveStrength, _RoundWaveSpeed; + #endif + + #if RECTSIZE_ON + half _RectSize; + #endif + + #if OFFSETUV_ON + half _OffsetUvX, _OffsetUvY; + #endif + + #if CLIPPING_ON + half _ClipUvLeft, _ClipUvRight, _ClipUvUp, _ClipUvDown; + #endif + + #if RADIALCLIPPING_ON + half _RadialStartAngle, _RadialClip, _RadialClip2; + #endif + + #if TEXTURESCROLL_ON + half _TextureScrollXSpeed, _TextureScrollYSpeed; + #endif + + #if ZOOMUV_ON + half _ZoomUvAmount; + #endif + + #if WARP_ON + half _WarpStrength, _WarpSpeed, _WarpScale; + #endif + + #if TWISTUV_ON + half _TwistUvAmount, _TwistUvPosX, _TwistUvPosY, _TwistUvRadius; + #endif + + #if ROTATEUV_ON + half _RotateUvAmount; + #endif + + #if FISHEYE_ON + half _FishEyeUvAmount; + #endif + + #if PINCH_ON + half _PinchUvAmount; + #endif + + #if SHAKEUV_ON + half _ShakeUvSpeed, _ShakeUvX, _ShakeUvY; + #endif + + #if NORMALMAP_ON + half _NormalStrength; + #endif + + float _RandomSeed; + + + + + CBUFFER_END + + + + // -- Property used by ScenePickingPass + #ifdef SCENEPICKINGPASS + float4 _SelectionID; + #endif + + // -- Properties used by SceneSelectionPass + #ifdef SCENESELECTIONPASS + int _ObjectId; + int _PassValue; + #endif + + + // data across stages, stripped like the above. + struct VertexToPixel + { + float4 pos : SV_POSITION; + float3 worldPos : TEXCOORD0; + float3 worldNormal : TEXCOORD1; + float4 worldTangent : TEXCOORD2; + float4 texcoord0 : TEXCOORD3; + float4 texcoord1 : TEXCOORD4; + float4 texcoord2 : TEXCOORD5; + // #if %TEXCOORD3REQUIREKEY% + float4 texcoord3 : TEXCOORD6; + // #endif + + // #if %SCREENPOSREQUIREKEY% + // float4 screenPos : TEXCOORD7; + // #endif + + // #if %VERTEXCOLORREQUIREKEY% + float4 vertexColor : COLOR; + // #endif + + // #if %EXTRAV2F0REQUIREKEY% + // float4 extraV2F0 : TEXCOORD8; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // float4 extraV2F1 : TEXCOORD9; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // float4 extraV2F2 : TEXCOORD10; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // float4 extraV2F3 : TEXCOORD11; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // float4 extraV2F4 : TEXCOORD12; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // float4 extraV2F5 : TEXCOORD13; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // float4 extraV2F6 : TEXCOORD14; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // float4 extraV2F7 : TEXCOORD15; + // #endif + + #if UNITY_ANY_INSTANCING_ENABLED + UNITY_VERTEX_INPUT_INSTANCE_ID + #endif // UNITY_ANY_INSTANCING_ENABLED + + #if _HDRP && (_PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR))) + float4 previousPositionCS : TEXCOORD16; // Contain previous transform position (in case of skinning for example) + float4 motionVectorCS : TEXCOORD17; + #endif + + UNITY_VERTEX_OUTPUT_STEREO + }; + + + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Debug/DebugDisplay.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/Material.hlsl" + #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/NormalSurfaceGradient.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/Lit/Lit.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/BuiltinUtilities.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/MaterialUtilities.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/Decal/DecalUtilities.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/Lit/LitDecalData.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/ShaderGraphFunctions.hlsl" + + + + + // data describing the user output of a pixel + struct Surface + { + half3 Albedo; + half Height; + half3 Normal; + half Smoothness; + half3 Emission; + half Metallic; + half3 Specular; + half Occlusion; + half SpecularPower; // for simple lighting + half Alpha; + float outputDepth; // if written, SV_Depth semantic is used. ShaderData.clipPos.z is unused value + // HDRP Only + half SpecularOcclusion; + half SubsurfaceMask; + half Thickness; + half CoatMask; + half CoatSmoothness; + half Anisotropy; + half IridescenceMask; + half IridescenceThickness; + int DiffusionProfileHash; + float SpecularAAThreshold; + float SpecularAAScreenSpaceVariance; + // requires _OVERRIDE_BAKEDGI to be defined, but is mapped in all pipelines + float3 DiffuseGI; + float3 BackDiffuseGI; + float3 SpecularGI; + float ior; + float3 transmittanceColor; + float atDistance; + float transmittanceMask; + // requires _OVERRIDE_SHADOWMASK to be defines + float4 ShadowMask; + + // for decals + float NormalAlpha; + float MAOSAlpha; + + + }; + + // Data the user declares in blackboard blocks + struct Blackboard + { + + float blackboardDummyData; + }; + + // data the user might need, this will grow to be big. But easy to strip + struct ShaderData + { + float4 clipPos; // SV_POSITION + float3 localSpacePosition; + float3 localSpaceNormal; + float3 localSpaceTangent; + + float3 worldSpacePosition; + float3 worldSpaceNormal; + float3 worldSpaceTangent; + float tangentSign; + + float3 worldSpaceViewDir; + float3 tangentSpaceViewDir; + + float4 texcoord0; + float4 texcoord1; + float4 texcoord2; + float4 texcoord3; + + float2 screenUV; + float4 screenPos; + + float4 vertexColor; + bool isFrontFace; + + float4 extraV2F0; + float4 extraV2F1; + float4 extraV2F2; + float4 extraV2F3; + float4 extraV2F4; + float4 extraV2F5; + float4 extraV2F6; + float4 extraV2F7; + + float3x3 TBNMatrix; + Blackboard blackboard; + }; + + struct VertexData + { + #if SHADER_TARGET > 30 + // uint vertexID : SV_VertexID; + #endif + float4 vertex : POSITION; + float3 normal : NORMAL; + float4 tangent : TANGENT; + float4 texcoord0 : TEXCOORD0; + + // optimize out mesh coords when not in use by user or lighting system + #if _URP && (_USINGTEXCOORD1 || _PASSMETA || _PASSFORWARD || _PASSGBUFFER) + float4 texcoord1 : TEXCOORD1; + #endif + + #if _URP && (_USINGTEXCOORD2 || _PASSMETA || ((_PASSFORWARD || _PASSGBUFFER) && defined(DYNAMICLIGHTMAP_ON))) + float4 texcoord2 : TEXCOORD2; + #endif + + #if _STANDARD && (_USINGTEXCOORD1 || (_PASSMETA || ((_PASSFORWARD || _PASSGBUFFER || _PASSFORWARDADD) && LIGHTMAP_ON))) + float4 texcoord1 : TEXCOORD1; + #endif + #if _STANDARD && (_USINGTEXCOORD2 || (_PASSMETA || ((_PASSFORWARD || _PASSGBUFFER) && DYNAMICLIGHTMAP_ON))) + float4 texcoord2 : TEXCOORD2; + #endif + + + #if _HDRP + float4 texcoord1 : TEXCOORD1; + float4 texcoord2 : TEXCOORD2; + #endif + + // #if %TEXCOORD3REQUIREKEY% + float4 texcoord3 : TEXCOORD3; + // #endif + + // #if %VERTEXCOLORREQUIREKEY% + float4 vertexColor : COLOR; + // #endif + + #if _PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR)) + float3 previousPositionOS : TEXCOORD4; // Contain previous transform position (in case of skinning for example) + #if defined (_ADD_PRECOMPUTED_VELOCITY) + float3 precomputedVelocity : TEXCOORD5; // Add Precomputed Velocity (Alembic computes velocities on runtime side). + #endif + #endif + + UNITY_VERTEX_INPUT_INSTANCE_ID + }; + + struct TessVertex + { + float4 vertex : INTERNALTESSPOS; + float3 normal : NORMAL; + float4 tangent : TANGENT; + float4 texcoord0 : TEXCOORD0; + float4 texcoord1 : TEXCOORD1; + float4 texcoord2 : TEXCOORD2; + + // #if %TEXCOORD3REQUIREKEY% + float4 texcoord3 : TEXCOORD3; + // #endif + + // #if %VERTEXCOLORREQUIREKEY% + float4 vertexColor : COLOR; + // #endif + + // #if %EXTRAV2F0REQUIREKEY% + // float4 extraV2F0 : TEXCOORD5; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // float4 extraV2F1 : TEXCOORD6; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // float4 extraV2F2 : TEXCOORD7; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // float4 extraV2F3 : TEXCOORD8; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // float4 extraV2F4 : TEXCOORD9; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // float4 extraV2F5 : TEXCOORD10; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // float4 extraV2F6 : TEXCOORD11; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // float4 extraV2F7 : TEXCOORD12; + // #endif + + #if _PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR)) + float3 previousPositionOS : TEXCOORD13; // Contain previous transform position (in case of skinning for example) + #if defined (_ADD_PRECOMPUTED_VELOCITY) + float3 precomputedVelocity : TEXCOORD14; + #endif + #endif + + UNITY_VERTEX_INPUT_INSTANCE_ID + UNITY_VERTEX_OUTPUT_STEREO + }; + + struct ExtraV2F + { + float4 extraV2F0; + float4 extraV2F1; + float4 extraV2F2; + float4 extraV2F3; + float4 extraV2F4; + float4 extraV2F5; + float4 extraV2F6; + float4 extraV2F7; + Blackboard blackboard; + float4 time; + }; + + + float3 WorldToTangentSpace(ShaderData d, float3 normal) + { + return mul(d.TBNMatrix, normal); + } + + float3 TangentToWorldSpace(ShaderData d, float3 normal) + { + return mul(normal, d.TBNMatrix); + } + + // in this case, make standard more like SRPs, because we can't fix + // unity_WorldToObject in HDRP, since it already does macro-fu there + + #if _STANDARD + float3 TransformWorldToObject(float3 p) { return mul(unity_WorldToObject, float4(p, 1)); }; + float3 TransformObjectToWorld(float3 p) { return mul(unity_ObjectToWorld, float4(p, 1)); }; + float4 TransformWorldToObject(float4 p) { return mul(unity_WorldToObject, p); }; + float4 TransformObjectToWorld(float4 p) { return mul(unity_ObjectToWorld, p); }; + float4x4 GetWorldToObjectMatrix() { return unity_WorldToObject; } + float4x4 GetObjectToWorldMatrix() { return unity_ObjectToWorld; } + #if (defined(SHADER_API_D3D11) || defined(SHADER_API_XBOXONE) || defined(UNITY_COMPILER_HLSLCC) || defined(SHADER_API_PSSL) || (SHADER_TARGET_SURFACE_ANALYSIS && !SHADER_TARGET_SURFACE_ANALYSIS_MOJOSHADER)) + #define UNITY_SAMPLE_TEX2D_LOD(tex,coord, lod) tex.SampleLevel (sampler##tex,coord, lod) + #define UNITY_SAMPLE_TEX2D_SAMPLER_LOD(tex,samplertex,coord, lod) tex.SampleLevel (sampler##samplertex,coord, lod) + #else + #define UNITY_SAMPLE_TEX2D_LOD(tex,coord,lod) tex2D (tex,coord,0,lod) + #define UNITY_SAMPLE_TEX2D_SAMPLER_LOD(tex,samplertex,coord,lod) tex2D (tex,coord,0,lod) + #endif + + #undef GetWorldToObjectMatrix() + + #define GetWorldToObjectMatrix() unity_WorldToObject + + + #endif + + float3 GetCameraWorldPosition() + { + #if _HDRP + return GetCameraRelativePositionWS(_WorldSpaceCameraPos); + #else + return _WorldSpaceCameraPos; + #endif + } + + #if _GRABPASSUSED + #if _STANDARD + TEXTURE2D(%GRABTEXTURE%); + SAMPLER(sampler_%GRABTEXTURE%); + #endif + + half3 GetSceneColor(float2 uv) + { + #if _STANDARD + return SAMPLE_TEXTURE2D(%GRABTEXTURE%, sampler_%GRABTEXTURE%, uv).rgb; + #else + return SHADERGRAPH_SAMPLE_SCENE_COLOR(uv); + #endif + } + #endif + + + + #if _STANDARD + UNITY_DECLARE_DEPTH_TEXTURE(_CameraDepthTexture); + float GetSceneDepth(float2 uv) { return SAMPLE_DEPTH_TEXTURE(_CameraDepthTexture, uv); } + float GetLinear01Depth(float2 uv) { return Linear01Depth(GetSceneDepth(uv)); } + float GetLinearEyeDepth(float2 uv) { return LinearEyeDepth(GetSceneDepth(uv)); } + #else + float GetSceneDepth(float2 uv) { return SHADERGRAPH_SAMPLE_SCENE_DEPTH(uv); } + float GetLinear01Depth(float2 uv) { return Linear01Depth(GetSceneDepth(uv), _ZBufferParams); } + float GetLinearEyeDepth(float2 uv) { return LinearEyeDepth(GetSceneDepth(uv), _ZBufferParams); } + #endif + + float3 GetWorldPositionFromDepthBuffer(float2 uv, float3 worldSpaceViewDir) + { + float eye = GetLinearEyeDepth(uv); + float3 camView = mul((float3x3)GetObjectToWorldMatrix(), transpose(mul(GetWorldToObjectMatrix(), UNITY_MATRIX_I_V)) [2].xyz); + + float dt = dot(worldSpaceViewDir, camView); + float3 div = worldSpaceViewDir/dt; + float3 wpos = (eye * div) + GetCameraWorldPosition(); + return wpos; + } + + #if _HDRP + float3 ObjectToWorldSpacePosition(float3 pos) + { + return GetAbsolutePositionWS(TransformObjectToWorld(pos)); + } + #else + float3 ObjectToWorldSpacePosition(float3 pos) + { + return TransformObjectToWorld(pos); + } + #endif + + #if _STANDARD + UNITY_DECLARE_SCREENSPACE_TEXTURE(_CameraDepthNormalsTexture); + float3 GetSceneNormal(float2 uv, float3 worldSpaceViewDir) + { + float4 depthNorms = UNITY_SAMPLE_SCREENSPACE_TEXTURE(_CameraDepthNormalsTexture, uv); + float3 norms = DecodeViewNormalStereo(depthNorms); + norms = mul((float3x3)GetWorldToViewMatrix(), norms) * 0.5 + 0.5; + return norms; + } + #elif _HDRP && !_DECALSHADER + + float3 GetSceneNormal(float2 uv, float3 worldSpaceViewDir) + { + NormalData nd; + DecodeFromNormalBuffer(_ScreenSize.xy * uv, nd); + return nd.normalWS; + } + #elif _URP + #if (SHADER_LIBRARY_VERSION_MAJOR >= 10) + #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/DeclareNormalsTexture.hlsl" + #endif + + float3 GetSceneNormal(float2 uv, float3 worldSpaceViewDir) + { + #if (SHADER_LIBRARY_VERSION_MAJOR >= 10) + return SampleSceneNormals(uv); + #else + float3 wpos = GetWorldPositionFromDepthBuffer(uv, worldSpaceViewDir); + return normalize(-cross(ddx(wpos), ddy(wpos))) * 0.5 + 0.5; + #endif + + } + #endif + + #if _HDRP + + half3 UnpackNormalmapRGorAG(half4 packednormal) + { + // This do the trick + packednormal.x *= packednormal.w; + + half3 normal; + normal.xy = packednormal.xy * 2 - 1; + normal.z = sqrt(1 - saturate(dot(normal.xy, normal.xy))); + return normal; + } + half3 UnpackNormal(half4 packednormal) + { + #if defined(UNITY_NO_DXT5nm) + return packednormal.xyz * 2 - 1; + #else + return UnpackNormalmapRGorAG(packednormal); + #endif + } + #endif + #if _HDRP || _URP + + half3 UnpackScaleNormal(half4 packednormal, half scale) + { + #ifndef UNITY_NO_DXT5nm + // Unpack normal as DXT5nm (1, y, 1, x) or BC5 (x, y, 0, 1) + // Note neutral texture like "bump" is (0, 0, 1, 1) to work with both plain RGB normal and DXT5nm/BC5 + packednormal.x *= packednormal.w; + #endif + half3 normal; + normal.xy = (packednormal.xy * 2 - 1) * scale; + normal.z = sqrt(1 - saturate(dot(normal.xy, normal.xy))); + return normal; + } + + #endif + + + void GetSun(out float3 lightDir, out float3 color) + { + lightDir = float3(0.5, 0.5, 0); + color = 1; + #if _HDRP + if (_DirectionalLightCount > 0) + { + DirectionalLightData light = _DirectionalLightDatas[0]; + lightDir = -light.forward.xyz; + color = light.color; + } + #elif _STANDARD + lightDir = normalize(_WorldSpaceLightPos0.xyz); + color = _LightColor0.rgb; + #elif _URP + Light light = GetMainLight(); + lightDir = light.direction; + color = light.color; + #endif + } + + + + + + + + + + TEXTURE2D(_MainTex); + SAMPLER(sampler_MainTex); + + #if GLOW_ON + TEXTURE2D(_GlowTex); + SAMPLER(sampler_GlowTex); + #endif + + #if FADE_ON + TEXTURE2D(_FadeTex); + SAMPLER(sampler_FadeTex); + + TEXTURE2D(_FadeBurnTex); + SAMPLER(sampler_FadeBurnTex); + #endif + + #if DISTORT_ON + TEXTURE2D(_DistortTex); + SAMPLER(sampler_DistortTex); + #endif + + #if OUTTEX_ON + TEXTURE2D(_OutlineTex); + SAMPLER(sampler_OutlineTex); + #endif + + #if OUTDIST_ON + TEXTURE2D(_OutlineDistortTex); + SAMPLER(sampler_OutlineDistortTex); + #endif + + #if COLORSWAP_ON + TEXTURE2D(_ColorSwapTex); + SAMPLER(sampler_ColorSwapTex); + #endif + + #if COLORRAMP_ON + TEXTURE2D(_ColorRampTex); + TEXTURE2D(_ColorRampTexGradient); + SAMPLER(sampler_ColorRampTex); + SAMPLER(sampler_ColorRampTexGradient); + #endif + + #if SHINE_ON + TEXTURE2D(_ShineMask); + SAMPLER(sampler_ShineMask); + #endif + + #if OVERLAY_ON + TEXTURE2D(_OverlayTex); + SAMPLER(sampler_OverlayTex); + #endif + + #if NORMALMAP_ON + TEXTURE2D(_NormalMap); + SAMPLER(sampler_NormalMap); + #endif + + + half3 GetPixel(in int offsetX, in int offsetY, in half2 uv, in Texture2D _tex, in SamplerState _sampler) + { + half2 _uv = uv + half2(offsetX * _MainTex_TexelSize.x, offsetY * _MainTex_TexelSize.y); + half4 col = SAMPLE_TEXTURE2D(_tex, _sampler, _uv); + return col.rgb; + } + + + //BLURS------------------------------------------------------------------------- + half4 Blur(half2 uv, Texture2D source, SamplerState sampler_source, half Intensity) + { + const half2 texelSize = 1.0 / _ScreenParams.xy; + const half4 color = SAMPLE_TEXTURE2D(source, sampler_source, uv); + const half2 offset = Intensity * texelSize; + + half4 accumulatedColor = color; + half accumulatedWeight = 1.0; + for (int x = -1; x <= 1; x++) + { + for (int y = -1; y <= 1; y++) + { + const half2 sampleUV = uv + half2(x, y) * offset; + const half4 sampleColor = SAMPLE_TEXTURE2D(source, sampler_source, sampleUV); + + accumulatedColor += sampleColor; + accumulatedWeight += 1.0; + } + } + + half4 blurredColor = accumulatedColor / accumulatedWeight; + return blurredColor; + } + + half BlurHD_G(half bhqp, half x) + { + return exp(-(x * x) / (2.0 * bhqp * bhqp)); + } + half4 BlurHD(half2 uv, Texture2D source, SamplerState sampler_source, half BlurAmount, half xScale, half yScale) + { + int iterations = 16; + int halfIterations = iterations / 2; + half sigmaX = 0.1 + BlurAmount * 0.5; + half sigmaY = sigmaX; + half total = 0.0; + half4 ret = half4(0, 0, 0, 0); + for (int iy = 0; iy < iterations; ++iy) + { + half fy = BlurHD_G(sigmaY, half(iy) -half(halfIterations)); + half offsetY = half(iy - halfIterations) * 0.00390625 * xScale; + for (int ix = 0; ix < iterations; ++ix) + { + half fx = BlurHD_G(sigmaX, half(ix) - half(halfIterations)); + half offsetX = half(ix - halfIterations) * 0.00390625 * yScale; + total += fx * fy; + ret += SAMPLE_TEXTURE2D(source, sampler_source, uv + half2(offsetX, offsetY)) * fx * fy; + } + } + return ret / total; + } + //----------------------------------------------------------------------- + + + //------------------------------------------- + half RemapFloat(half inValue, half inMin, half inMax, half outMin, half outMax){ + return outMin + (inValue - inMin) * (outMax - outMin) / (inMax - inMin); + } + //------------------------------------------- + + //----------------------------------------------------------------------- + half rand(half2 seed, half offset) { + return (frac(sin(dot(seed, half2(12.9898, 78.233))) * 43758.5453) + offset) % 1.0; + } + + half rand2(half2 seed, half offset) { + return (frac(sin(dot(seed * floor(50 + (_Time.x % 1.0) * 12.), half2(127.1, 311.7))) * 43758.5453123) + offset) % 1.0; + } + + half rand2CustomTime(half2 seed, half offset, half customTime) { + return (frac(sin(dot(seed * floor(50 + (customTime % 1.0) * 12.), half2(127.1, 311.7))) * 43758.5453123) + offset) % 1.0; + } + //----------------------------------------------------------------------- + + + void Ext_ModifyVertex0 (inout VertexData v, inout ExtraV2F d) + { + //BILBOARD_ON + #if BILBOARD_ON + half3 camRight = mul((half3x3)unity_CameraToWorld, half3(1,0,0)); + half3 camUp = half3(0,1,0); + #if BILBOARDY_ON + camUp = mul((half3x3)unity_CameraToWorld, half3(0,1,0)); + #endif + half3 localPos = v.vertex.x * camRight + v.vertex.y * camUp; + v.vertex = half4(localPos, 1); + #endif + //----------------------------------------------------------- + + v.texcoord0.xy = TRANSFORM_TEX(v.texcoord0.xy, _MainTex); + half2 center = half2(0.5, 0.5); + #if ATLAS_ON + center = half2((_MaxXUV + _MinXUV) / 2.0, (_MaxYUV + _MinYUV) / 2.0); + #endif + + //POLARUV_ON + #if POLARUV_ON + v.texcoord0.xy = v.texcoord0.xy - center; + #endif + + //---------------------------------------- + + //ROTATEUV_ON + #if ROTATEUV_ON + half2 uvC = v.texcoord0.xy; + half cosAngle = cos(_RotateUvAmount); + half sinAngle = sin(_RotateUvAmount); + half2x2 rot = half2x2(cosAngle, -sinAngle, sinAngle, cosAngle); + uvC -= center; + v.texcoord0.xy = mul(rot, uvC); + v.texcoord0.xy += center; + #endif + //-------------------- + + #if RECTSIZE_ON + v.vertex.xyz += (v.vertex.xyz * (_RectSize - 1.0)); + #endif + + #if OUTTEX_ON + v.texcoord1.xy = TRANSFORM_TEX(v.texcoord0.xy, _OutlineTex); + #endif + + #if OUTDIST_ON + v.texcoord2.xy = TRANSFORM_TEX(v.texcoord0.xy, _OutlineDistortTex); + #endif + + #if DISTORT_ON + v.texcoord3.xy = TRANSFORM_TEX(v.texcoord0.xy, _DistortTex); + #endif + } + + void Ext_SurfaceFunction0 (inout Surface o, ShaderData d) + { + half randomSeed = _RandomSeed; + + float2 uvRect = d.texcoord0; + half2 center = half2(0.5, 0.5); + #if ATLAS_ON + center = half2((_MaxXUV + _MinXUV) / 2.0, (_MaxYUV + _MinYUV) / 2.0); + uvRect = half2((d.texcoord0.x - _MinXUV) / (_MaxXUV - _MinXUV), (d.texcoord0.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half2 centerTiled = half2(center.x * _MainTex_ST.x, center.y * _MainTex_ST.y); + + //CLIPPING_ON + #if CLIPPING_ON + half2 tiledUv = half2(d.texcoord0.x / _MainTex_ST.x, d.texcoord0.y / _MainTex_ST.y); + #if ATLAS_ON + tiledUv = half2((tiledUv.x - _MinXUV) / (_MaxXUV - _MinXUV), (tiledUv.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + clip((1 - _ClipUvUp) - tiledUv.y); + clip(tiledUv.y - _ClipUvDown); + clip((1 - _ClipUvRight) - tiledUv.x); + clip(tiledUv.x - _ClipUvLeft); + #endif + //---------------------------------- + + //RADIALCLIPPING_ON + #if RADIALCLIPPING_ON + half2 tiledUv2 = half2(d.texcoord0.x / _MainTex_ST.x, d.texcoord0.y / _MainTex_ST.y); + #if ATLAS_ON + tiledUv2 = half2((tiledUv2.x - _MinXUV) / (_MaxXUV - _MinXUV), (tiledUv2.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half startAngle = _RadialStartAngle - _RadialClip; + half endAngle = _RadialStartAngle + _RadialClip2; + half offset0 = clamp(0, 360, startAngle + 360); + half offset360 = clamp(0, 360, endAngle - 360); + half2 atan2Coord = half2(lerp(-1, 1, tiledUv2.x), lerp(-1, 1, tiledUv2.y)); + half atanAngle = atan2(atan2Coord.y, atan2Coord.x) * 57.3; // angle in degrees + if(atanAngle < 0) atanAngle = 360 + atanAngle; + if(atanAngle >= startAngle && atanAngle <= endAngle) discard; + if(atanAngle <= offset360) discard; + if(atanAngle >= offset0) discard; + #endif + + //----------------------------- + + //TEXTURESCROLL_ON && ATLAS_ON + #if TEXTURESCROLL_ON && ATLAS_ON + d.texcoord0.xy = half2(_MinXUV + ((_MaxXUV - _MinXUV) * (abs(((_Time.y + randomSeed) * _TextureScrollXSpeed) + uvRect.x) % 1)), + _MinYUV + ((_MaxYUV - _MinYUV) * (abs(((_Time.y + randomSeed) * _TextureScrollYSpeed) + uvRect.y) % 1))); + #endif + //---------------------------- + + //OFFSETUV_ON + #if OFFSETUV_ON + #if ATLAS_ON + d.texcoord0.xy = half2(_MinXUV + ((_MaxXUV - _MinXUV) * (abs((_OffsetUvX + uvRect.x) % 1))), + _MinYUV + ((_MaxYUV - _MinYUV) * (abs(_OffsetUvY + uvRect.y) % 1))); + #else + d.texcoord0.xy += half2(_OffsetUvX, _OffsetUvY); + #endif + #endif + + //---------------------- + + //POLARUV_ON + #if POLARUV_ON + d.texcoord0.xy = half2(atan2(d.texcoord0.y, d.texcoord0.x) / (2.0f * 3.141592653589f), length(d.texcoord0.xy)); + d.texcoord0.xy *= _MainTex_ST.xy; + #endif + + //-------------------------------------- + + //TWISTUV_ON + #if TWISTUV_ON + #if ATLAS_ON + _TwistUvPosX = ((_MaxXUV - _MinXUV) * _TwistUvPosX) + _MinXUV; + _TwistUvPosY = ((_MaxYUV - _MinYUV) * _TwistUvPosY) + _MinYUV; + #endif + half2 tempUv = d.texcoord0.xy - half2(_TwistUvPosX * _MainTex_ST.x, _TwistUvPosY * _MainTex_ST.y); + _TwistUvRadius *= (_MainTex_ST.x + _MainTex_ST.y) / 2; + half percent = (_TwistUvRadius - length(tempUv)) / _TwistUvRadius; + half theta = percent * percent * (2.0 * sin(_TwistUvAmount)) * 8.0; + half s = sin(theta); + half c = cos(theta); + half beta = max(sign(_TwistUvRadius - length(tempUv)), 0.0); + tempUv = half2(dot(tempUv, half2(c, -s)), dot(tempUv, half2(s, c))) * beta + tempUv * (1 - beta); + tempUv += half2(_TwistUvPosX * _MainTex_ST.x, _TwistUvPosY * _MainTex_ST.y); + d.texcoord0.xy = tempUv; + #endif + + //-------------------------------------------- + + //FISHEYE_ON + #if FISHEYE_ON + half bind = length(centerTiled); + half2 dF = d.texcoord0.xy - centerTiled; + half dFlen = length(dF); + half fishInt = (3.14159265359 / bind) * (_FishEyeUvAmount + 0.001); + d.texcoord0.xy = centerTiled + (dF / (max(0.0001, dFlen))) * tan(dFlen * fishInt) * bind / tan(bind * fishInt); + #endif + //--------------------------------------------- + + //PINCH_ON + #if PINCH_ON + half2 dP = d.texcoord0.xy - centerTiled; + half pinchInt = (3.141592 / length(centerTiled)) * (-_PinchUvAmount + 0.001); + d.texcoord0.xy = centerTiled + normalize(dP) * atan(length(dP) * -pinchInt * 10.0) * 0.5 / atan(-pinchInt * 5); + #endif + + //--------------------------------------------- + + //ZOOMUV_ON + #if ZOOMUV_ON + d.texcoord0.xy -= centerTiled; + d.texcoord0.xy = d.texcoord0.xy * _ZoomUvAmount; + d.texcoord0.xy += centerTiled; + #endif + + //----------------------------------------------- + + //DOODLE_ON + #if DOODLE_ON + half2 uvCopy = uvRect; + _HandDrawnSpeed = (floor((_Time.x + randomSeed) * 20 * _HandDrawnSpeed) / _HandDrawnSpeed) * _HandDrawnSpeed; + uvCopy.x = sin((uvCopy.x * _HandDrawnAmount + _HandDrawnSpeed) * 4); + uvCopy.y = cos((uvCopy.y * _HandDrawnAmount + _HandDrawnSpeed) * 4); + d.texcoord0.xy = lerp(d.texcoord0.xy, d.texcoord0.xy + uvCopy, 0.0005 * _HandDrawnAmount); + #endif + + //-------------------------- + + //SHAKEUV_ON + #if SHAKEUV_ON + half xShake = sin((_Time.x + randomSeed) * _ShakeUvSpeed * 50) * _ShakeUvX; + half yShake = cos((_Time.x + randomSeed) * _ShakeUvSpeed * 50) * _ShakeUvY; + d.texcoord0.xy += half2(xShake * 0.012, yShake * 0.01); + #endif + + //------------------------------------------- + + //RECTSIZE_ON + #if RECTSIZE_ON + d.texcoord0.xy = d.texcoord0.xy * (_RectSize).xx + (((-_RectSize * 0.5) + 0.5)).xx; + #endif + + //------------------------------------------- + + //DISTORT_ON + #if DISTORT_ON + #if ATLAS_ON + d.texcoord3.x = d.texcoord3.x * (1 / (_MaxXUV - _MinXUV)); + d.texcoord3.y = d.texcoord3.y * (1 / (_MaxYUV - _MinYUV)); + #endif + + d.texcoord3.x += ((_Time.x + _RandomSeed) * _DistortTexXSpeed) % 1; + d.texcoord3.y += ((_Time.x + _RandomSeed) * _DistortTexYSpeed) % 1; + half distortAmnt = (SAMPLE_TEXTURE2D(_DistortTex, sampler_DistortTex, d.texcoord3.xy).r - 0.5) * 0.2 * _DistortAmount; + d.texcoord0.x += distortAmnt; + d.texcoord0.y += distortAmnt; + #endif + //------------------------------------------------------- + + //WARP_ON + #if WARP_ON + half2 warpUv = half2(d.texcoord0.x / _MainTex_ST.x, d.texcoord0.y / _MainTex_ST.y); + #if ATLAS_ON + warpUv = half2((warpUv.x - _MinXUV) / (_MaxXUV - _MinXUV), (warpUv.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + const float tau = 6.283185307179586; + float xWarp = (_Time.y + randomSeed) * _WarpSpeed + warpUv.x * tau / _WarpScale; + float yWarp = (_Time.y + randomSeed) * _WarpSpeed + warpUv.y * tau / _WarpScale; + float2 warp = float2(sin(xWarp), sin(yWarp)) * _WarpStrength; + d.texcoord0.xy += warp; + #endif + + //------------------------------------------------------- + + //WAVEUV_ON + #if WAVEUV_ON + float2 uvWave = half2(_WaveX * _MainTex_ST.x, _WaveY * _MainTex_ST.y) - d.texcoord0.xy; + uvWave %= 1; + #if ATLAS_ON + uvWave = half2(_WaveX, _WaveY) - uvRect; + #endif + uvWave.x *= _ScreenParams.x / _ScreenParams.y; + float waveTime = _Time.y + randomSeed; + float angWave = (sqrt(dot(uvWave, uvWave)) * _WaveAmount) - ((waveTime * _WaveSpeed)); + d.texcoord0.xy = d.texcoord0.xy + uvWave * sin(angWave) * (_WaveStrength / 1000.0); + #endif + //---------------------------------------------------- + + //ROUNDWAVEUV_ON + #if ROUNDWAVEUV_ON + half xWave = ((0.5 * _MainTex_ST.x) - uvRect.x); + half yWave = ((0.5 * _MainTex_ST.y) - uvRect.y) * (_MainTex_TexelSize.w / _MainTex_TexelSize.z); + half ripple = -sqrt(xWave*xWave + yWave* yWave); + d.texcoord0.xy += (sin((ripple + (_Time.y + randomSeed) * (_RoundWaveSpeed/10.0)) / 0.015) * (_RoundWaveStrength/10.0)) % 1; + #endif + //---------------------------------------------------- + + + //WIND_ON + #if WIND_ON + half windOffset = sin((_Time.x + randomSeed) * _GrassSpeed * 10); + half2 windCenter = half2(0.5, 0.1); + #if ATLAS_ON + windCenter.x = ((_MaxXUV - _MinXUV) * windCenter.x) + _MinXUV; + windCenter.y = ((_MaxYUV - _MinYUV) * windCenter.y) + _MinYUV; + #endif + #if !MANUALWIND_ON + d.texcoord0.x = fmod(abs(lerp(d.texcoord0.x, d.texcoord0.x + (_GrassWind * 0.01 * windOffset), uvRect.y)), 1); + #else + d.texcoord0.x = fmod(abs(lerp(d.texcoord0.x, d.texcoord0.x + (_GrassWind * 0.01 * _GrassManualAnim), uvRect.y)), 1); + windOffset = _GrassManualAnim; + #endif + half2 delta = d.texcoord0.xy - windCenter; + half delta2 = dot(delta.xy, delta.xy); + half2 delta_offset = delta2 * windOffset; + d.texcoord0.xy = d.texcoord0.xy + half2(delta.y, -delta.x) * delta_offset * _GrassRadialBend; + #endif + + //-------------------------------------------------------- + + //TEXTURESCROLL_ON && !ATLAS_ON + #if TEXTURESCROLL_ON && !ATLAS_ON + d.texcoord0.x += ((_Time.y + randomSeed) * _TextureScrollXSpeed) % 1; + d.texcoord0.y += ((_Time.y + randomSeed) * _TextureScrollYSpeed) % 1; + #endif + //------------------------------ + + //PIXELATE_ON + #if PIXELATE_ON + half aspectRatio = _MainTex_TexelSize.x / _MainTex_TexelSize.y; + half2 pixelSize = float2(_PixelateSize, _PixelateSize * aspectRatio); + d.texcoord0.xy = floor(d.texcoord0.xy * pixelSize) / pixelSize; + #endif + //-------------- + + half4 col = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy); + half originalAlpha = col.a; + col *= d.vertexColor; + + //NORMAL MAP + #if NORMALMAP_ON + half4 normalSample = SAMPLE_TEXTURE2D(_NormalMap, sampler_NormalMap, d.texcoord0.xy); + half3 normalTS = UnpackNormal(normalSample); + normalTS.xy *= _NormalStrength; + o.Normal = normalTS; + #endif + + + //GLITCH_ON + #if GLITCH_ON + half2 uvGlitch = uvRect; + uvGlitch.y -= 0.5; + half lineNoise = pow(rand2(floor(uvGlitch * half2(24., 19.) * _GlitchSize) * 4.0, randomSeed), 3.0) * _GlitchAmount + * pow(rand2(floor(uvGlitch * half2(38., 14.) * _GlitchSize) * 4.0, randomSeed), 3.0); + col = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(lineNoise * 0.02 * rand2(half2(2.0, 1), randomSeed), 0)) * d.vertexColor; + #endif + //-------------------------------------- + + //CHROMABERR_ON + #if CHROMABERR_ON + half4 r = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(_ChromAberrAmount/10, 0)) * d.vertexColor; + half4 b = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(-_ChromAberrAmount/10, 0)) * d.vertexColor; + col = half4(r.r * r.a, col.g, b.b * b.a, max(max(r.a, b.a) * _ChromAberrAlpha, col.a)); + #endif + + //-------------------------------- + + //BLUR_ON + #if BLUR_ON + #if ATLAS_ON + #if !BLURISHD_ON + col = BlurHD(d.texcoord0.xy, _MainTex, sampler_MainTex, _BlurIntensity, (_MaxXUV - _MinXUV), (_MaxYUV - _MinYUV)) * d.vertexColor; + #else + col = Blur(d.texcoord0.xy, _MainTex, sampler_MainTex, _BlurIntensity * (_MaxXUV - _MinXUV)) * d.vertexColor; + #endif + #else + #if !BLURISHD_ON + col = BlurHD(d.texcoord0.xy, _MainTex, sampler_MainTex, _BlurIntensity, 1, 1) * d.vertexColor; + #else + col = Blur(d.texcoord0.xy, _MainTex, sampler_MainTex, _BlurIntensity) * d.vertexColor; + #endif + #endif + #endif + + //-------------------- + + //MOTIONBLUR_ON + #if MOTIONBLUR_ON + _MotionBlurAngle = _MotionBlurAngle * 3.1415926; + #define rot(n) mul(n, half2x2(cos(_MotionBlurAngle), -sin(_MotionBlurAngle), sin(_MotionBlurAngle), cos(_MotionBlurAngle))) + _MotionBlurDist = _MotionBlurDist * 0.005; + #if ATLAS_ON + _MotionBlurDist *= (_MaxXUV - _MinXUV); + #endif + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(-_MotionBlurDist, -_MotionBlurDist))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(-_MotionBlurDist * 2, -_MotionBlurDist * 2))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(-_MotionBlurDist * 3, -_MotionBlurDist * 3))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(-_MotionBlurDist * 4, -_MotionBlurDist * 4))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(_MotionBlurDist, _MotionBlurDist))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(_MotionBlurDist * 2, _MotionBlurDist * 2))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(_MotionBlurDist * 3, _MotionBlurDist * 3))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(_MotionBlurDist * 4, _MotionBlurDist * 4))); + col.rgb = col.rgb / 9; + #endif + //------------------------------------ + + //NEGATIVE_ON + #if NEGATIVE_ON + col.rgb = lerp(col.rgb, 1 - col.rgb, _NegativeAmount); + #endif + + //-------------- + half luminance = 0; + + //GREYSCALE_ON && !GREYSCALEOUTLINE_ON + #if GREYSCALE_ON && !GREYSCALEOUTLINE_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + luminance = saturate(luminance + _GreyscaleLuminosity); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _GreyscaleTintColor, _GreyscaleBlend); + #endif + //------------------------------------ + + //GHOST_ON + #if GHOST_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + half4 ghostResult; + ghostResult.a = saturate(luminance - _GhostTransparency) * col.a; + ghostResult.rgb = col.rgb * (luminance + _GhostColorBoost); + col = lerp(col, ghostResult, _GhostBlend); + #endif + //------------------------------------ + + //INNEROUTLINE_ON + #if INNEROUTLINE_ON + half3 innerT = abs(GetPixel(0, _InnerOutlineThickness, d.texcoord0.xy, _MainTex, sampler_MainTex) - GetPixel(0, -_InnerOutlineThickness, d.texcoord0.xy, _MainTex, sampler_MainTex)); + innerT += abs(GetPixel(_InnerOutlineThickness, 0, d.texcoord0.xy, _MainTex, sampler_MainTex) - GetPixel(-_InnerOutlineThickness, 0, d.texcoord0.xy, _MainTex, sampler_MainTex)); + #if !ONLYINNEROUTLINE_ON + innerT = (innerT / 2.0) * col.a * _InnerOutlineAlpha; + col.rgb += length(innerT) * _InnerOutlineColor.rgb * _InnerOutlineGlow; + #else + innerT *= col.a * _InnerOutlineAlpha; + col.rgb = length(innerT) * _InnerOutlineColor.rgb * _InnerOutlineGlow; + col.a = step(0.3, col.r+col.g+col.b); + #endif + #endif + //------------------------------------------------------- + + //HITEFFECT_ON + #if HITEFFECT_ON + col.rgb = lerp(col.rgb, _HitEffectColor.rgb * _HitEffectGlow, _HitEffectBlend); + #endif + //-------------------- + + //GRADIENT_ON + #if GRADIENT_ON + half2 tiledUvGrad = half2(uvRect.x / _MainTex_ST.x, uvRect.y / _MainTex_ST.y); + #if GRADIENT2COL_ON + _GradTopRightCol = _GradTopLeftCol; + _GradBotRightCol = _GradBotLeftCol; + #endif + #if RADIALGRADIENT_ON + half radialDist = 1 - length(tiledUvGrad - half2(0.5, 0.5)); + radialDist *= (_MainTex_TexelSize.w / _MainTex_TexelSize.z); + radialDist = saturate(_GradBoostX * radialDist); + half4 gradientResult = lerp(_GradTopLeftCol, _GradBotLeftCol, radialDist); + #else + half gradXLerpFactor = saturate(pow(tiledUvGrad.x, _GradBoostX)); + half4 gradientResult = lerp(lerp(_GradBotLeftCol, _GradBotRightCol, gradXLerpFactor), + lerp(_GradTopLeftCol, _GradTopRightCol, gradXLerpFactor), saturate(pow(tiledUvGrad.y, _GradBoostY))); + #endif + gradientResult = lerp(col, gradientResult, _GradBlend); + col.rgb = gradientResult.rgb * col.a; + col.a *= gradientResult.a; + #endif + //-------------------------------------------------------------------- + + //CONTRAST_ON + #if CONTRAST_ON + col.rgb = (col.rgb - float3(0.5, 0.5, 0.5)) * _Contrast + float3(0.5, 0.5, 0.5); + col.rgb += _Brightness; + #endif + + //------------------------------------------------------------------- + + //COLORSWAP_ON + #if COLORSWAP_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + half4 swapMask = SAMPLE_TEXTURE2D(_ColorSwapTex, sampler_ColorSwapTex, d.texcoord0.xy); + swapMask.rgb *= swapMask.a; + half3 redSwap = _ColorSwapRed * swapMask.r * saturate(luminance + _ColorSwapRedLuminosity); + half3 greenSwap = _ColorSwapGreen * swapMask.g * saturate(luminance + _ColorSwapGreenLuminosity); + half3 blueSwap = _ColorSwapBlue * swapMask.b * saturate(luminance + _ColorSwapBlueLuminosity); + swapMask.rgb = col.rgb * saturate(1 - swapMask.r - swapMask.g - swapMask.b); + col.rgb = lerp(col.rgb, swapMask.rgb + redSwap + greenSwap + blueSwap, _ColorSwapBlend); + #endif + //-------------------------------------------------------------------- + + //COLORRAMP_ON && !COLORRAMPOUTLINE_ON + #if COLORRAMP_ON && !COLORRAMPOUTLINE_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + luminance = saturate(luminance + _ColorRampLuminosity); + #if GRADIENTCOLORRAMP_ON + col.rgb = lerp(col.rgb, SAMPLE_TEXTURE2D(_ColorRampTexGradient, sampler_ColorRampTexGradient, half2(luminance, 0)).rgb, _ColorRampBlend); + #else + col.rgb = lerp(col.rgb, SAMPLE_TEXTURE2D(_ColorRampTex, sampler_ColorRampTex, half2(luminance, 0)).rgb, _ColorRampBlend); + #endif + #endif + //-------------------------------------------------------------------- + + //CHANGECOLOR_ON + #if CHANGECOLOR_ON + float3 currChangeColor = saturate(col.rgb); + luminance = 0.3 * currChangeColor.r + 0.59 * currChangeColor.g + 0.11 * currChangeColor.b; + luminance = saturate(luminance + _ColorChangeLuminosity); + half3 dif = abs(currChangeColor - _ColorChangeTarget.rgb); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _ColorChangeNewCol.rgb, + max(sign(1 - saturate(dif.x + dif.y + dif.z) - _ColorChangeTolerance), 0.0)); + #if CHANGECOLOR2_ON + dif = abs(currChangeColor - _ColorChangeTarget2.rgb); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _ColorChangeNewCol2.rgb, + max(sign(1 - saturate(dif.x + dif.y + dif.z) - _ColorChangeTolerance2), 0.0)); + #endif + #if CHANGECOLOR3_ON + dif = abs(currChangeColor - _ColorChangeTarget3.rgb); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _ColorChangeNewCol3.rgb, + max(sign(1 - saturate(dif.x + dif.y + dif.z) - _ColorChangeTolerance3), 0.0)); + #endif + #endif + //------------------------------------------------------- + + //POSTERIZE_ON && !POSTERIZEOUTLINE_ON + #if POSTERIZE_ON && !POSTERIZEOUTLINE_ON + col.rgb = pow(col.rgb, _PosterizeGamma) * _PosterizeNumColors; + col.rgb = floor(col.rgb) / _PosterizeNumColors; + col.rgb = pow(col.rgb, 1.0 / _PosterizeGamma); + #endif + //------------------------------------ + + //HSV_ON + #if HSV_ON + half3 resultHsv = half3(col.rgb); + half cosHsv = _HsvBright * _HsvSaturation * cos(_HsvShift * 3.14159265 / 180); + half sinHsv = _HsvBright * _HsvSaturation * sin(_HsvShift * 3.14159265 / 180); + resultHsv.x = (.299 * _HsvBright + .701 * cosHsv + .168 * sinHsv) * col.x + + (.587 * _HsvBright - .587 * cosHsv + .330 * sinHsv) * col.y + + (.114 * _HsvBright - .114 * cosHsv - .497 * sinHsv) * col.z; + resultHsv.y = (.299 * _HsvBright - .299 * cosHsv - .328 * sinHsv) *col.x + + (.587 * _HsvBright + .413 * cosHsv + .035 * sinHsv) * col.y + + (.114 * _HsvBright - .114 * cosHsv + .292 * sinHsv) * col.z; + resultHsv.z = (.299 * _HsvBright - .3 * cosHsv + 1.25 * sinHsv) * col.x + + (.587 * _HsvBright - .588 * cosHsv - 1.05 * sinHsv) * col.y + + (.114 * _HsvBright + .886 * cosHsv - .203 * sinHsv) * col.z; + col.rgb = resultHsv; + #endif + //------------------------------------------------------- + + //OVERLAY_ON + #if OVERLAY_ON + half2 overlayUvs = d.texcoord0.xy; + overlayUvs.x += ((_Time.y + randomSeed) * _OverlayTextureScrollXSpeed) % 1; + overlayUvs.y += ((_Time.y + randomSeed) * _OverlayTextureScrollYSpeed) % 1; + half4 overlayCol = SAMPLE_TEXTURE2D(_OverlayTex, sampler_OverlayTex, TRANSFORM_TEX(overlayUvs, _OverlayTex)); + overlayCol.rgb *= _OverlayColor.rgb * _OverlayGlow; + #if !OVERLAYMULT_ON + overlayCol.rgb *= overlayCol.a * _OverlayColor.rgb * _OverlayColor.a * _OverlayBlend; + col.rgb += overlayCol.rgb; + #else + overlayCol.a *= _OverlayColor.a; + col = lerp(col, col * overlayCol, _OverlayBlend); + #endif + #endif + + //--------------------------------- + + //OUTBASE_ON + #if OUTBASE_ON + #if OUTBASEPIXELPERF_ON + half2 destUv = half2(_OutlinePixelWidth * _MainTex_TexelSize.x, _OutlinePixelWidth * _MainTex_TexelSize.y); + #else + half2 destUv = half2(_OutlineWidth * _MainTex_TexelSize.x * 200, _OutlineWidth * _MainTex_TexelSize.y * 200); + #endif + + #if OUTDIST_ON + d.texcoord3.x += ((_Time.x + _RandomSeed) * _OutlineDistortTexXSpeed) % 1; + d.texcoord3.y += ((_Time.x + _RandomSeed) * _OutlineDistortTexYSpeed) % 1; + #if ATLAS_ON + d.texcoord3 = half2((d.texcoord3.x - _MinXUV) / (_MaxXUV - _MinXUV), (d.texcoord3.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half outDistortAmnt = (SAMPLE_TEXTURE2D(_OutlineDistortTex, sampler_OutlineDistortTex, d.texcoord3).r - 0.5) * 0.2 * _OutlineDistortAmount; + destUv.x += outDistortAmnt; + destUv.y += outDistortAmnt; + #endif + + half spriteLeft = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(destUv.x, 0)).a; + half spriteRight = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy - half2(destUv.x, 0)).a; + half spriteBottom = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(0, destUv.y)).a; + half spriteTop = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy - half2(0, destUv.y)).a; + half result = spriteLeft + spriteRight + spriteBottom + spriteTop; + + #if OUTBASE8DIR_ON + half spriteTopLeft = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(destUv.x, destUv.y)).a; + half spriteTopRight = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(-destUv.x, destUv.y)).a; + half spriteBotLeft = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(destUv.x, -destUv.y)).a; + half spriteBotRight = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(-destUv.x, -destUv.y)).a; + result = result + spriteTopLeft + spriteTopRight + spriteBotLeft + spriteBotRight; + #endif + + result = step(0.05, saturate(result)); + + #if OUTTEX_ON + d.texcoord1.x += ((_Time.x + _RandomSeed) * _OutlineTexXSpeed) % 1; + d.texcoord1.y += ((_Time.x + _RandomSeed) * _OutlineTexYSpeed) % 1; + #if ATLAS_ON + d.texcoord1 = half2((d.texcoord1.x - _MinXUV) / (_MaxXUV - _MinXUV), (d.texcoord1.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half4 tempOutColor = SAMPLE_TEXTURE2D(_OutlineTex, sampler_OutlineTex, d.texcoord1); + tempOutColor *= _OutlineColor; + _OutlineColor = tempOutColor; + #endif + + result *= (1 - originalAlpha) * _OutlineAlpha; + + half4 outline = _OutlineColor * d.vertexColor.a; + outline.rgb *= _OutlineGlow; + outline.a = result; + #if ONLYOUTLINE_ON + col = outline; + #else + col = lerp(col, outline, result); + #endif + #endif + //------------------------------------------------------- + + //FADE_ON + #if FADE_ON + half2 tiledUvFade1 = TRANSFORM_TEX(d.texcoord0, _FadeTex); + half2 tiledUvFade2 = TRANSFORM_TEX(d.texcoord0, _FadeBurnTex); + #if ATLAS_ON + tiledUvFade1 = half2((tiledUvFade1.x - _MinXUV) / (_MaxXUV - _MinXUV), (tiledUvFade1.y - _MinYUV) / (_MaxYUV - _MinYUV)); + tiledUvFade2 = half2((tiledUvFade2.x - _MinXUV) / (_MaxXUV - _MinXUV), (tiledUvFade2.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half fadeTemp = SAMPLE_TEXTURE2D(_FadeTex, sampler_FadeTex, tiledUvFade1).r; + half fade = smoothstep(_FadeAmount, _FadeAmount + _FadeBurnTransition, fadeTemp); + half fadeBurn = saturate(smoothstep(_FadeAmount - _FadeBurnWidth, _FadeAmount - _FadeBurnWidth + 0.1, fadeTemp) * _FadeAmount); + col.a *= fade; + _FadeBurnColor.rgb *= _FadeBurnGlow; + col += fadeBurn * SAMPLE_TEXTURE2D(_FadeBurnTex, sampler_FadeBurnTex, tiledUvFade2) * _FadeBurnColor * originalAlpha * (1 - col.a); + #endif + //------------------------------------------------------- + + //SHADOW_ON + #if SHADOW_ON + half shadowA = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(_ShadowX, _ShadowY)).a; + half preMultShadowMask = 1 - (saturate(shadowA - col.a) * (1 - col.a)); + col.rgb *= 1 - ((shadowA - col.a) * (1 - col.a)); + col.rgb += (_ShadowColor * shadowA) * (1 - col.a); + col.a = max(shadowA * _ShadowAlpha * d.vertexColor.a, col.a); + #endif + + //------------------------------------------------------- + + //GLOW_ON + #if GLOW_ON + half4 emission; + #if GLOWTEX_ON + emission = SAMPLE_TEXTURE2D(_GlowTex, sampler_GlowTex, d.texcoord0); + #else + emission = col; + #endif + + col.rgb *= _GlowGlobal; + emission.rgb *= emission.a * col.a * _Glow * _GlowColor; + col.rgb += emission.rgb; + #endif + //------------------------------------------------------- + + //COLORRAMP_ON && COLORRAMPOUTLINE_ON + #if COLORRAMP_ON && COLORRAMPOUTLINE_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + luminance = saturate(luminance + _ColorRampLuminosity); + #if GRADIENTCOLORRAMP_ON + col.rgb = lerp(col.rgb, SAMPLE_TEXTURE2D(_ColorRampTexGradient, sampler_ColorRampTexGradient, half2(luminance, 0)).rgb, _ColorRampBlend); + #else + col.rgb = lerp(col.rgb, SAMPLE_TEXTURE2D(_ColorRampTex, sampler_ColorRampTex, half2(luminance, 0)).rgb, _ColorRampBlend); + #endif + #endif + //--------------- + + //GREYSCALE_ON && GREYSCALEOUTLINE_ON + #if GREYSCALE_ON && GREYSCALEOUTLINE_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + luminance = saturate(luminance + _GreyscaleLuminosity); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _GreyscaleTintColor, _GreyscaleBlend); + #endif + + //----------------------------------- + + //POSTERIZE_ON && POSTERIZEOUTLINE_ON + #if POSTERIZE_ON && POSTERIZEOUTLINE_ON + col.rgb = pow(col.rgb, _PosterizeGamma) * _PosterizeNumColors; + col.rgb = floor(col.rgb) / _PosterizeNumColors; + col.rgb = pow(col.rgb, 1.0 / _PosterizeGamma); + #endif + + //----------------------------------- + + //SHINE_ON + #if SHINE_ON + half2 uvShine = uvRect; + half cosAngle = cos(_ShineRotate); + half sinAngle = sin(_ShineRotate); + half2x2 rot = half2x2(cosAngle, -sinAngle, sinAngle, cosAngle); + uvShine -= half2(0.5, 0.5); + uvShine = mul(rot, uvShine); + uvShine += half2(0.5, 0.5); + half shineMask = SAMPLE_TEXTURE2D(_ShineMask, sampler_ShineMask, d.texcoord0.xy).a; + half currentDistanceProjection = (uvShine.x + uvShine.y) / 2; + half whitePower = 1 - (abs(currentDistanceProjection - _ShineLocation) / _ShineWidth); + col.rgb += col.a * whitePower * _ShineGlow * max(sign(currentDistanceProjection - (_ShineLocation - _ShineWidth)), 0.0) + * max(sign((_ShineLocation + _ShineWidth) - currentDistanceProjection), 0.0) * _ShineColor * shineMask; + #endif + + //----------------------------------- + + //HOLOGRAM_ON + #if HOLOGRAM_ON + half totalHologram = _HologramStripesAmount + _HologramUnmodAmount; + half hologramYCoord = ((uvRect.y + (((_Time.x + randomSeed) % 1) * _HologramStripesSpeed)) % totalHologram) / totalHologram; + hologramYCoord = abs(hologramYCoord); + half alpha = RemapFloat(saturate(hologramYCoord - (_HologramUnmodAmount/totalHologram)), 0.0, 1.0, _HologramMinAlpha, saturate(_HologramMaxAlpha)); + half hologramMask = max(sign((_HologramUnmodAmount/totalHologram) - hologramYCoord), 0.0); + half4 hologramResult = col; + hologramResult.a *= lerp(alpha, 1, hologramMask); + hologramResult.rgb *= max(1, _HologramMaxAlpha * max(sign(hologramYCoord - (_HologramUnmodAmount/totalHologram)), 0.0)); + hologramMask = 1 - step(0.01,hologramMask); + hologramResult.rgb += hologramMask * _HologramStripeColor * col.a; + col = lerp(col, hologramResult, _HologramBlend); + #endif + + //----------------------------------- + + //FLICKER_ON + #if FLICKER_ON + col.a *= saturate(col.a * step(frac(0.05 + (_Time.w + randomSeed) * _FlickerFreq), 1 - _FlickerPercent) + _FlickerAlpha); + #endif + //----------------------------------- + + //ALPHACUTOFF_ON + + //ALPHAROUND_ON + + //ALPHAOUTLINE_ON + #if ALPHAOUTLINE_ON + half alphaOutlineRes = pow(1 - col.a, max(_AlphaOutlinePower, 0.0001)) * step(_AlphaOutlineMinAlpha, col.a) * _AlphaOutlineBlend; + col.rgb = lerp(col.rgb, _AlphaOutlineColor.rgb * _AlphaOutlineGlow, alphaOutlineRes); + col.a = lerp(col.a, 1, alphaOutlineRes > 1); + #endif + //------------------------------------------------------- + + //FOG_ON + + //------------------ + + col *= _Color; + o.Albedo = col; + col.a *= _Alpha; + clip(col.a - _AlphaCutoffValue - 0.01); + o.Alpha = _Color.a; + } + + + + + + void ChainSurfaceFunction(inout Surface l, inout ShaderData d) + { + Ext_SurfaceFunction0(l, d); + // Ext_SurfaceFunction1(l, d); + // Ext_SurfaceFunction2(l, d); + // Ext_SurfaceFunction3(l, d); + // Ext_SurfaceFunction4(l, d); + // Ext_SurfaceFunction5(l, d); + // Ext_SurfaceFunction6(l, d); + // Ext_SurfaceFunction7(l, d); + // Ext_SurfaceFunction8(l, d); + // Ext_SurfaceFunction9(l, d); + // Ext_SurfaceFunction10(l, d); + // Ext_SurfaceFunction11(l, d); + // Ext_SurfaceFunction12(l, d); + // Ext_SurfaceFunction13(l, d); + // Ext_SurfaceFunction14(l, d); + // Ext_SurfaceFunction15(l, d); + // Ext_SurfaceFunction16(l, d); + // Ext_SurfaceFunction17(l, d); + // Ext_SurfaceFunction18(l, d); + // Ext_SurfaceFunction19(l, d); + // Ext_SurfaceFunction20(l, d); + // Ext_SurfaceFunction21(l, d); + // Ext_SurfaceFunction22(l, d); + // Ext_SurfaceFunction23(l, d); + // Ext_SurfaceFunction24(l, d); + // Ext_SurfaceFunction25(l, d); + // Ext_SurfaceFunction26(l, d); + // Ext_SurfaceFunction27(l, d); + // Ext_SurfaceFunction28(l, d); + // Ext_SurfaceFunction29(l, d); + } + +#if !_DECALSHADER + + void ChainModifyVertex(inout VertexData v, inout VertexToPixel v2p, float4 time) + { + ExtraV2F d; + + ZERO_INITIALIZE(ExtraV2F, d); + ZERO_INITIALIZE(Blackboard, d.blackboard); + // due to motion vectors in HDRP, we need to use the last + // time in certain spots. So if you are going to use _Time to adjust vertices, + // you need to use this time or motion vectors will break. + d.time = time; + + Ext_ModifyVertex0(v, d); + // Ext_ModifyVertex1(v, d); + // Ext_ModifyVertex2(v, d); + // Ext_ModifyVertex3(v, d); + // Ext_ModifyVertex4(v, d); + // Ext_ModifyVertex5(v, d); + // Ext_ModifyVertex6(v, d); + // Ext_ModifyVertex7(v, d); + // Ext_ModifyVertex8(v, d); + // Ext_ModifyVertex9(v, d); + // Ext_ModifyVertex10(v, d); + // Ext_ModifyVertex11(v, d); + // Ext_ModifyVertex12(v, d); + // Ext_ModifyVertex13(v, d); + // Ext_ModifyVertex14(v, d); + // Ext_ModifyVertex15(v, d); + // Ext_ModifyVertex16(v, d); + // Ext_ModifyVertex17(v, d); + // Ext_ModifyVertex18(v, d); + // Ext_ModifyVertex19(v, d); + // Ext_ModifyVertex20(v, d); + // Ext_ModifyVertex21(v, d); + // Ext_ModifyVertex22(v, d); + // Ext_ModifyVertex23(v, d); + // Ext_ModifyVertex24(v, d); + // Ext_ModifyVertex25(v, d); + // Ext_ModifyVertex26(v, d); + // Ext_ModifyVertex27(v, d); + // Ext_ModifyVertex28(v, d); + // Ext_ModifyVertex29(v, d); + + + // #if %EXTRAV2F0REQUIREKEY% + // v2p.extraV2F0 = d.extraV2F0; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // v2p.extraV2F1 = d.extraV2F1; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // v2p.extraV2F2 = d.extraV2F2; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // v2p.extraV2F3 = d.extraV2F3; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // v2p.extraV2F4 = d.extraV2F4; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // v2p.extraV2F5 = d.extraV2F5; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // v2p.extraV2F6 = d.extraV2F6; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // v2p.extraV2F7 = d.extraV2F7; + // #endif + } + + void ChainModifyTessellatedVertex(inout VertexData v, inout VertexToPixel v2p) + { + ExtraV2F d; + ZERO_INITIALIZE(ExtraV2F, d); + ZERO_INITIALIZE(Blackboard, d.blackboard); + + // #if %EXTRAV2F0REQUIREKEY% + // d.extraV2F0 = v2p.extraV2F0; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // d.extraV2F1 = v2p.extraV2F1; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // d.extraV2F2 = v2p.extraV2F2; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // d.extraV2F3 = v2p.extraV2F3; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // d.extraV2F4 = v2p.extraV2F4; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // d.extraV2F5 = v2p.extraV2F5; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // d.extraV2F6 = v2p.extraV2F6; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // d.extraV2F7 = v2p.extraV2F7; + // #endif + + + // Ext_ModifyTessellatedVertex0(v, d); + // Ext_ModifyTessellatedVertex1(v, d); + // Ext_ModifyTessellatedVertex2(v, d); + // Ext_ModifyTessellatedVertex3(v, d); + // Ext_ModifyTessellatedVertex4(v, d); + // Ext_ModifyTessellatedVertex5(v, d); + // Ext_ModifyTessellatedVertex6(v, d); + // Ext_ModifyTessellatedVertex7(v, d); + // Ext_ModifyTessellatedVertex8(v, d); + // Ext_ModifyTessellatedVertex9(v, d); + // Ext_ModifyTessellatedVertex10(v, d); + // Ext_ModifyTessellatedVertex11(v, d); + // Ext_ModifyTessellatedVertex12(v, d); + // Ext_ModifyTessellatedVertex13(v, d); + // Ext_ModifyTessellatedVertex14(v, d); + // Ext_ModifyTessellatedVertex15(v, d); + // Ext_ModifyTessellatedVertex16(v, d); + // Ext_ModifyTessellatedVertex17(v, d); + // Ext_ModifyTessellatedVertex18(v, d); + // Ext_ModifyTessellatedVertex19(v, d); + // Ext_ModifyTessellatedVertex20(v, d); + // Ext_ModifyTessellatedVertex21(v, d); + // Ext_ModifyTessellatedVertex22(v, d); + // Ext_ModifyTessellatedVertex23(v, d); + // Ext_ModifyTessellatedVertex24(v, d); + // Ext_ModifyTessellatedVertex25(v, d); + // Ext_ModifyTessellatedVertex26(v, d); + // Ext_ModifyTessellatedVertex27(v, d); + // Ext_ModifyTessellatedVertex28(v, d); + // Ext_ModifyTessellatedVertex29(v, d); + + // #if %EXTRAV2F0REQUIREKEY% + // v2p.extraV2F0 = d.extraV2F0; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // v2p.extraV2F1 = d.extraV2F1; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // v2p.extraV2F2 = d.extraV2F2; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // v2p.extraV2F3 = d.extraV2F3; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // v2p.extraV2F4 = d.extraV2F4; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // v2p.extraV2F5 = d.extraV2F5; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // v2p.extraV2F6 = d.extraV2F6; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // v2p.extraV2F7 = d.extraV2F7; + // #endif + } + + void ChainFinalColorForward(inout Surface l, inout ShaderData d, inout half4 color) + { + // Ext_FinalColorForward0(l, d, color); + // Ext_FinalColorForward1(l, d, color); + // Ext_FinalColorForward2(l, d, color); + // Ext_FinalColorForward3(l, d, color); + // Ext_FinalColorForward4(l, d, color); + // Ext_FinalColorForward5(l, d, color); + // Ext_FinalColorForward6(l, d, color); + // Ext_FinalColorForward7(l, d, color); + // Ext_FinalColorForward8(l, d, color); + // Ext_FinalColorForward9(l, d, color); + // Ext_FinalColorForward10(l, d, color); + // Ext_FinalColorForward11(l, d, color); + // Ext_FinalColorForward12(l, d, color); + // Ext_FinalColorForward13(l, d, color); + // Ext_FinalColorForward14(l, d, color); + // Ext_FinalColorForward15(l, d, color); + // Ext_FinalColorForward16(l, d, color); + // Ext_FinalColorForward17(l, d, color); + // Ext_FinalColorForward18(l, d, color); + // Ext_FinalColorForward19(l, d, color); + // Ext_FinalColorForward20(l, d, color); + // Ext_FinalColorForward21(l, d, color); + // Ext_FinalColorForward22(l, d, color); + // Ext_FinalColorForward23(l, d, color); + // Ext_FinalColorForward24(l, d, color); + // Ext_FinalColorForward25(l, d, color); + // Ext_FinalColorForward26(l, d, color); + // Ext_FinalColorForward27(l, d, color); + // Ext_FinalColorForward28(l, d, color); + // Ext_FinalColorForward29(l, d, color); + } + + void ChainFinalGBufferStandard(inout Surface s, inout ShaderData d, inout half4 GBuffer0, inout half4 GBuffer1, inout half4 GBuffer2, inout half4 outEmission, inout half4 outShadowMask) + { + // Ext_FinalGBufferStandard0(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard1(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard2(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard3(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard4(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard5(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard6(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard7(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard8(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard9(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard10(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard11(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard12(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard13(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard14(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard15(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard16(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard17(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard18(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard19(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard20(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard21(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard22(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard23(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard24(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard25(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard26(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard27(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard28(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard29(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + } +#endif + + + + + +#if _DECALSHADER + + ShaderData CreateShaderData(SurfaceDescriptionInputs IN) + { + ShaderData d = (ShaderData)0; + d.TBNMatrix = float3x3(IN.WorldSpaceTangent, IN.WorldSpaceBiTangent, IN.WorldSpaceNormal); + d.worldSpaceNormal = IN.WorldSpaceNormal; + d.worldSpaceTangent = IN.WorldSpaceTangent; + + d.worldSpacePosition = IN.WorldSpacePosition; + d.texcoord0 = IN.uv0.xyxy; + d.screenPos = IN.ScreenPosition; + + d.worldSpaceViewDir = normalize(_WorldSpaceCameraPos - d.worldSpacePosition); + + d.tangentSpaceViewDir = mul(d.TBNMatrix, d.worldSpaceViewDir); + + // these rarely get used, so we back transform them. Usually will be stripped. + #if _HDRP + // d.localSpacePosition = mul(GetWorldToObjectMatrix(), float4(GetCameraRelativePositionWS(d.worldSpacePosition), 1)).xyz; + #else + // d.localSpacePosition = mul(GetWorldToObjectMatrix(), float4(d.worldSpacePosition, 1)).xyz; + #endif + // d.localSpaceNormal = normalize(mul((float3x3)GetWorldToObjectMatrix(), d.worldSpaceNormal)); + // d.localSpaceTangent = normalize(mul((float3x3)GetWorldToObjectMatrix(), d.worldSpaceTangent.xyz)); + + // #if %SCREENPOSREQUIREKEY% + // d.screenUV = (IN.ScreenPosition.xy / max(0.01, IN.ScreenPosition.w)); + // #endif + + return d; + } +#else + + ShaderData CreateShaderData(VertexToPixel i + #if NEED_FACING + , bool facing + #endif + ) + { + ShaderData d = (ShaderData)0; + d.clipPos = i.pos; + d.worldSpacePosition = i.worldPos; + + d.worldSpaceNormal = normalize(i.worldNormal); + d.worldSpaceTangent.xyz = normalize(i.worldTangent.xyz); + + d.tangentSign = i.worldTangent.w * unity_WorldTransformParams.w; + float3 bitangent = cross(d.worldSpaceTangent.xyz, d.worldSpaceNormal) * d.tangentSign; + + d.TBNMatrix = float3x3(d.worldSpaceTangent, -bitangent, d.worldSpaceNormal); + d.worldSpaceViewDir = normalize(_WorldSpaceCameraPos - i.worldPos); + + d.tangentSpaceViewDir = mul(d.TBNMatrix, d.worldSpaceViewDir); + d.texcoord0 = i.texcoord0; + d.texcoord1 = i.texcoord1; + d.texcoord2 = i.texcoord2; + + // #if %TEXCOORD3REQUIREKEY% + d.texcoord3 = i.texcoord3; + // #endif + + // d.isFrontFace = facing; + // #if %VERTEXCOLORREQUIREKEY% + d.vertexColor = i.vertexColor; + // #endif + + // these rarely get used, so we back transform them. Usually will be stripped. + #if _HDRP + // d.localSpacePosition = mul(GetWorldToObjectMatrix(), float4(GetCameraRelativePositionWS(i.worldPos), 1)).xyz; + #else + // d.localSpacePosition = mul(GetWorldToObjectMatrix(), float4(i.worldPos, 1)).xyz; + #endif + // d.localSpaceNormal = normalize(mul((float3x3)GetWorldToObjectMatrix(), i.worldNormal)); + // d.localSpaceTangent = normalize(mul((float3x3)GetWorldToObjectMatrix(), i.worldTangent.xyz)); + + // #if %SCREENPOSREQUIREKEY% + // d.screenPos = i.screenPos; + // d.screenUV = (i.screenPos.xy / i.screenPos.w); + // #endif + + + // #if %EXTRAV2F0REQUIREKEY% + // d.extraV2F0 = i.extraV2F0; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // d.extraV2F1 = i.extraV2F1; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // d.extraV2F2 = i.extraV2F2; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // d.extraV2F3 = i.extraV2F3; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // d.extraV2F4 = i.extraV2F4; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // d.extraV2F5 = i.extraV2F5; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // d.extraV2F6 = i.extraV2F6; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // d.extraV2F7 = i.extraV2F7; + // #endif + + return d; + } + +#endif + + + +#if (SHADERPASS == SHADERPASS_LIGHT_TRANSPORT) + + // This was not in constant buffer in original unity, so keep outiside. But should be in as ShaderRenderPass frequency + float unity_OneOverOutputBoost; + float unity_MaxOutputValue; + + CBUFFER_START(UnityMetaPass) + // x = use uv1 as raster position + // y = use uv2 as raster position + bool4 unity_MetaVertexControl; + + // x = return albedo + // y = return normal + bool4 unity_MetaFragmentControl; + CBUFFER_END + + VertexToPixel Vert(VertexData inputMesh) + { + VertexToPixel output; + ZERO_INITIALIZE(VertexToPixel, output); + UNITY_SETUP_INSTANCE_ID(inputMesh); + UNITY_TRANSFER_INSTANCE_ID(inputMesh, output); + UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(output); + + // Output UV coordinate in vertex shader + float2 uv = float2(0.0, 0.0); + + if (unity_MetaVertexControl.x) + { + uv = inputMesh.texcoord1.xy * unity_LightmapST.xy + unity_LightmapST.zw; + } + else if (unity_MetaVertexControl.y) + { + uv = inputMesh.texcoord2.xy * unity_DynamicLightmapST.xy + unity_DynamicLightmapST.zw; + } + + // OpenGL right now needs to actually use the incoming vertex position + // so we create a fake dependency on it here that haven't any impact. + output.pos = float4(uv * 2.0 - 1.0, inputMesh.vertex.z > 0 ? 1.0e-4 : 0.0, 1.0); + + output.worldPos = TransformObjectToWorld(inputMesh.vertex.xyz).xyz; + + // Normal is required for triplanar mapping + output.worldNormal = TransformObjectToWorldNormal(inputMesh.normal); + // Not required but assign to silent compiler warning + output.worldTangent = float4(1.0, 0.0, 0.0, 0.0); + + output.texcoord0 = inputMesh.texcoord0; + output.texcoord1 = inputMesh.texcoord1; + output.texcoord2 = inputMesh.texcoord2; + // #if %TEXCOORD3REQUIREKEY% + output.texcoord3 = inputMesh.texcoord3; + // #endif + // #if %VERTEXCOLORREQUIREKEY% + output.vertexColor = inputMesh.vertexColor; + // #endif + + return output; + } +#else + + #if (_PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR))) + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/ShaderVariablesMatrixDefsHDCamera.hlsl" + + void MotionVectorPositionZBias(VertexToPixel input) + { + #if UNITY_REVERSED_Z + input.pos.z -= unity_MotionVectorsParams.z * input.pos.w; + #else + input.pos.z += unity_MotionVectorsParams.z * input.pos.w; + #endif + } + + #endif + + VertexToPixel Vert(VertexData input) + { + VertexToPixel output; + ZERO_INITIALIZE(VertexToPixel, output); + + UNITY_SETUP_INSTANCE_ID(input); + UNITY_TRANSFER_INSTANCE_ID(input, output); + UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(output); + + #if _HDRP && (_PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR))) + VertexData previousMesh = input; + #endif + + ChainModifyVertex(input, output, _Time); + + // This return the camera relative position (if enable) + float3 positionRWS = TransformObjectToWorld(input.vertex.xyz); + float3 normalWS = TransformObjectToWorldNormal(input.normal); + float4 tangentWS = float4(TransformObjectToWorldDir(input.tangent.xyz), input.tangent.w); + + + output.worldPos = GetAbsolutePositionWS(positionRWS); + output.pos = TransformWorldToHClip(positionRWS); + output.worldNormal = normalWS; + output.worldTangent = tangentWS; + + + output.texcoord0 = input.texcoord0; + output.texcoord1 = input.texcoord1; + output.texcoord2 = input.texcoord2; + + // #if %TEXCOORD3REQUIREKEY% + output.texcoord3 = input.texcoord3; + // #endif + + // #if %VERTEXCOLORREQUIREKEY% + output.vertexColor = input.vertexColor; + // #endif + + // #if %SCREENPOSREQUIREKEY% + // output.screenPos = ComputeScreenPos(output.pos, _ProjectionParams.x); + // #endif + + #if _HDRP && (_PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR))) + + #if !defined(TESSELLATION_ON) + MotionVectorPositionZBias(output); + #endif + + output.motionVectorCS = mul(UNITY_MATRIX_UNJITTERED_VP, float4(positionRWS.xyz, 1.0)); + // Note: unity_MotionVectorsParams.y is 0 is forceNoMotion is enabled + bool forceNoMotion = unity_MotionVectorsParams.y == 0.0; + if (forceNoMotion) + { + output.previousPositionCS = float4(0.0, 0.0, 0.0, 1.0); + } + else + { + bool hasDeformation = unity_MotionVectorsParams.x > 0.0; // Skin or morph target + + float3 effectivePositionOS = (hasDeformation ? previousMesh.previousPositionOS : previousMesh.vertex.xyz); + #if defined(_ADD_PRECOMPUTED_VELOCITY) + effectivePositionOS -= input.precomputedVelocity; + #endif + + previousMesh.vertex = float4(effectivePositionOS, 1); + VertexToPixel dummy = (VertexToPixel)0; + + + ChainModifyVertex(previousMesh, dummy, _LastTimeParameters); + + // we might need this for skinned objects? + //float3 normalWS = TransformPreviousObjectToWorldNormal(input.normal).xyz; + float3 previousPositionRWS = TransformPreviousObjectToWorld(previousMesh.vertex.xyz); + + #ifdef _WRITE_TRANSPARENT_MOTION_VECTOR + if (_TransparentCameraOnlyMotionVectors > 0) + { + previousPositionRWS = positionRWS.xyz; + } + #endif // _WRITE_TRANSPARENT_MOTION_VECTOR + + output.previousPositionCS = mul(UNITY_MATRIX_PREV_VP, float4(previousPositionRWS, 1.0)); + } + #endif // _HDRP && _PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR)) + + + return output; + } + + +#endif + + + + + + + + #if defined(WRITE_DECAL_BUFFER) && !defined(_DISABLE_DECALS) + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/Decal/DecalPrepassBuffer.hlsl" + #endif + + FragInputs BuildFragInputs(VertexToPixel input) + { + UNITY_SETUP_INSTANCE_ID(input); + FragInputs output; + ZERO_INITIALIZE(FragInputs, output); + + // Init to some default value to make the computer quiet (else it output 'divide by zero' warning even if value is not used). + // TODO: this is a really poor workaround, but the variable is used in a bunch of places + // to compute normals which are then passed on elsewhere to compute other values... + output.tangentToWorld = k_identity3x3; + output.positionSS = input.pos; // input.positionCS is SV_Position + // BETTER SHADERS: because we transform world position into actual world space for things like + // triplanar, etc, we have to back transform it here for lighting + output.positionRWS = GetCameraRelativePositionWS(input.worldPos); + output.tangentToWorld = BuildTangentToWorld(input.worldTangent, input.worldNormal); + output.texCoord0 = input.texcoord0; + output.texCoord1 = input.texcoord1; + output.texCoord2 = input.texcoord2; + + return output; + } + + void BuildSurfaceData(FragInputs fragInputs, inout Surface surfaceDescription, float3 V, PositionInputs posInput, out SurfaceData surfaceData, out float3 bentNormalWS) + { + // setup defaults -- these are used if the graph doesn't output a value + ZERO_INITIALIZE(SurfaceData, surfaceData); + + // specularOcclusion need to be init ahead of decal to quiet the compiler that modify the SurfaceData struct + // however specularOcclusion can come from the graph, so need to be init here so it can be override. + surfaceData.specularOcclusion = 1.0; + + // copy across graph values, if defined + surfaceData.baseColor = surfaceDescription.Albedo; + surfaceData.perceptualSmoothness = surfaceDescription.Smoothness; + surfaceData.ambientOcclusion = surfaceDescription.Occlusion; + surfaceData.specularOcclusion = surfaceDescription.SpecularOcclusion; + surfaceData.metallic = surfaceDescription.Metallic; + surfaceData.subsurfaceMask = surfaceDescription.SubsurfaceMask; + surfaceData.thickness = surfaceDescription.Thickness; + surfaceData.diffusionProfileHash = asuint(surfaceDescription.DiffusionProfileHash); + #if _USESPECULAR + surfaceData.specularColor = surfaceDescription.Specular; + #endif + surfaceData.coatMask = surfaceDescription.CoatMask; + surfaceData.anisotropy = surfaceDescription.Anisotropy; + surfaceData.iridescenceMask = surfaceDescription.IridescenceMask; + surfaceData.iridescenceThickness = surfaceDescription.IridescenceThickness; + + + + #if defined(_REFRACTION_PLANE) || defined(_REFRACTION_SPHERE) || defined(_REFRACTION_THIN) + if (_EnableSSRefraction) + { + surfaceData.transmittanceMask = (1.0 - surfaceDescription.Alpha); + surfaceDescription.Alpha = 1.0; + } + else + { + surfaceData.ior = surfaceDescription.ior; + surfaceData.transmittanceColor = surfaceDescription.transmittanceColor; + surfaceData.atDistance = surfaceDescription.atDistance; + surfaceData.transmittanceMask = surfaceDescription.transmittanceMask; + surfaceDescription.Alpha = 1.0; + } + #else + surfaceData.ior = 1.0; + surfaceData.transmittanceColor = float3(1.0, 1.0, 1.0); + surfaceData.atDistance = 1.0; + surfaceData.transmittanceMask = 0.0; + #endif + + + + // These static material feature allow compile time optimization + surfaceData.materialFeatures = MATERIALFEATUREFLAGS_LIT_STANDARD; + #ifdef _MATERIAL_FEATURE_SUBSURFACE_SCATTERING + surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_SUBSURFACE_SCATTERING; + #endif + + #ifdef _MATERIAL_FEATURE_TRANSMISSION + surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_TRANSMISSION; + #endif + + #ifdef _MATERIAL_FEATURE_ANISOTROPY + surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_ANISOTROPY; + surfaceData.normalWS = float3(0, 1, 0); + #endif + + #ifdef _MATERIAL_FEATURE_IRIDESCENCE + surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_IRIDESCENCE; + #endif + + #ifdef _MATERIAL_FEATURE_SPECULAR_COLOR + surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_SPECULAR_COLOR; + #endif + + #if defined(_MATERIAL_FEATURE_CLEAR_COAT) || _CLEARCOAT + surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_CLEAR_COAT; + #endif + + #if defined (_MATERIAL_FEATURE_SPECULAR_COLOR) && defined (_ENERGY_CONSERVING_SPECULAR) + // Require to have setup baseColor + // Reproduce the energy conservation done in legacy Unity. Not ideal but better for compatibility and users can unchek it + surfaceData.baseColor *= (1.0 - Max3(surfaceData.specularColor.r, surfaceData.specularColor.g, surfaceData.specularColor.b)); + #endif + + + + // compute world space normal + #if !_WORLDSPACENORMAL + surfaceData.normalWS = mul(surfaceDescription.Normal, fragInputs.tangentToWorld); + #else + surfaceData.normalWS = surfaceDescription.Normal; + #endif + + surfaceData.geomNormalWS = fragInputs.tangentToWorld[2]; + + surfaceData.tangentWS = normalize(fragInputs.tangentToWorld[0].xyz); // The tangent is not normalize in tangentToWorld for mikkt. TODO: Check if it expected that we normalize with Morten. Tag: SURFACE_GRADIENT + + + #if HAVE_DECALS + if (_EnableDecals) + { + float alpha = 1.0; + alpha = surfaceDescription.Alpha; + + // Both uses and modifies 'surfaceData.normalWS'. + DecalSurfaceData decalSurfaceData = GetDecalSurfaceData(posInput, fragInputs.tangentToWorld[2], alpha); + ApplyDecalToSurfaceData(decalSurfaceData, fragInputs.tangentToWorld[2], surfaceData); + } + #endif + + bentNormalWS = surfaceData.normalWS; + + surfaceData.tangentWS = Orthonormalize(surfaceData.tangentWS, surfaceData.normalWS); + + #ifdef DEBUG_DISPLAY + if (_DebugMipMapMode != DEBUGMIPMAPMODE_NONE) + { + // TODO: need to update mip info + surfaceData.metallic = 0; + } + + // We need to call ApplyDebugToSurfaceData after filling the surfarcedata and before filling builtinData + // as it can modify attribute use for static lighting + ApplyDebugToSurfaceData(fragInputs.tangentToWorld, surfaceData); + #endif + + // By default we use the ambient occlusion with Tri-ace trick (apply outside) for specular occlusion. + // If user provide bent normal then we process a better term + #if defined(_SPECULAR_OCCLUSION_CUSTOM) + // Just use the value passed through via the slot (not active otherwise) + #elif defined(_SPECULAR_OCCLUSION_FROM_AO_BENT_NORMAL) + // If we have bent normal and ambient occlusion, process a specular occlusion + surfaceData.specularOcclusion = GetSpecularOcclusionFromBentAO(V, bentNormalWS, surfaceData.normalWS, surfaceData.ambientOcclusion, PerceptualSmoothnessToPerceptualRoughness(surfaceData.perceptualSmoothness)); + #elif defined(_AMBIENT_OCCLUSION) && defined(_SPECULAR_OCCLUSION_FROM_AO) + surfaceData.specularOcclusion = GetSpecularOcclusionFromAmbientOcclusion(ClampNdotV(dot(surfaceData.normalWS, V)), surfaceData.ambientOcclusion, PerceptualSmoothnessToRoughness(surfaceData.perceptualSmoothness)); + #endif + + #if defined(_ENABLE_GEOMETRIC_SPECULAR_AA) && !defined(SHADER_STAGE_RAY_TRACING) + surfaceData.perceptualSmoothness = GeometricNormalFiltering(surfaceData.perceptualSmoothness, fragInputs.tangentToWorld[2], surfaceDescription.SpecularAAScreenSpaceVariance, surfaceDescription.SpecularAAThreshold); + #endif + } + + void GetSurfaceAndBuiltinData(VertexToPixel m2ps, FragInputs fragInputs, float3 V, inout PositionInputs posInput, + out SurfaceData surfaceData, out BuiltinData builtinData, inout Surface l, inout ShaderData d + #if NEED_FACING + , bool facing + #endif + ) + { + // Removed since crossfade does not work, probably needs extra material setup. + //#if !defined(SHADER_STAGE_RAY_TRACING) && !defined(_TESSELLATION_DISPLACEMENT) + // #ifdef LOD_FADE_CROSSFADE // enable dithering LOD transition if user select CrossFade transition in LOD group + // LODDitheringTransition(ComputeFadeMaskSeed(V, posInput.positionSS), unity_LODFade.x); + // #endif + //#endif + + d = CreateShaderData(m2ps + #if NEED_FACING + , facing + #endif + ); + + l = (Surface)0; + + l.Albedo = half3(0.5, 0.5, 0.5); + l.Normal = float3(0,0,1); + l.Occlusion = 1; + l.Alpha = 1; + l.SpecularOcclusion = 1; + + #if !defined(SHADER_STAGE_RAY_TRACING) && defined(_DEPTHOFFSET_ON) + l.outputDepth = d.clipPos.z; + #endif + + ChainSurfaceFunction(l, d); + + #if !defined(SHADER_STAGE_RAY_TRACING) && defined(_DEPTHOFFSET_ON) + //posInput.deviceDepth = l.outputDepth; + #endif + + #if _UNLIT + //l.Emission = l.Albedo; + //l.Albedo = 0; + l.Normal = half3(0,0,1); + l.Occlusion = 1; + l.Metallic = 0; + l.Specular = 0; + #endif + + surfaceData.geomNormalWS = d.worldSpaceNormal; + surfaceData.tangentWS = d.worldSpaceTangent; + fragInputs.tangentToWorld = d.TBNMatrix; + + float3 bentNormalWS; + BuildSurfaceData(fragInputs, l, V, posInput, surfaceData, bentNormalWS); + + + InitBuiltinData(posInput, l.Alpha, bentNormalWS, -d.worldSpaceNormal, fragInputs.texCoord1, fragInputs.texCoord2, builtinData); + + + + builtinData.emissiveColor = l.Emission; + + #if defined(_OVERRIDE_BAKEDGI) + builtinData.bakeDiffuseLighting = l.DiffuseGI; + builtinData.backBakeDiffuseLighting = l.BackDiffuseGI; + builtinData.emissiveColor += l.SpecularGI; + #endif + + #if defined(_OVERRIDE_SHADOWMASK) + builtinData.shadowMask0 = l.ShadowMask.x; + builtinData.shadowMask1 = l.ShadowMask.y; + builtinData.shadowMask2 = l.ShadowMask.z; + builtinData.shadowMask3 = l.ShadowMask.w; + #endif + + #if defined(UNITY_VIRTUAL_TEXTURING) + builtinData.vtPackedFeedback = surfaceData.VTPackedFeedback; + #endif + + #if (SHADERPASS == SHADERPASS_DISTORTION) + builtinData.distortion = surfaceData.Distortion; + builtinData.distortionBlur = surfaceData.DistortionBlur; + #endif + + #ifndef SHADER_UNLIT + // PostInitBuiltinData call ApplyDebugToBuiltinData + PostInitBuiltinData(V, posInput, surfaceData, builtinData); + #else + ApplyDebugToBuiltinData(builtinData); + #endif + + RAY_TRACING_OPTIONAL_ALPHA_TEST_PASS + } + + + #if defined(WRITE_NORMAL_BUFFER) && defined(WRITE_MSAA_DEPTH) + #define SV_TARGET_DECAL SV_Target2 + #elif defined(WRITE_NORMAL_BUFFER) || defined(WRITE_MSAA_DEPTH) + #define SV_TARGET_DECAL SV_Target1 + #else + #define SV_TARGET_DECAL SV_Target0 + #endif + + + void Frag( VertexToPixel v2p + #if defined(SCENESELECTIONPASS) || defined(SCENEPICKINGPASS) + , out float4 outColor : SV_Target0 + #else + #ifdef WRITE_MSAA_DEPTH + // We need the depth color as SV_Target0 for alpha to coverage + , out float4 depthColor : SV_Target0 + #ifdef WRITE_NORMAL_BUFFER + , out float4 outNormalBuffer : SV_Target1 + #endif + #else + #ifdef WRITE_NORMAL_BUFFER + , out float4 outNormalBuffer : SV_Target0 + #endif + #endif + + // Decal buffer must be last as it is bind but we can optionally write into it (based on _DISABLE_DECALS) + #if defined(WRITE_DECAL_BUFFER) && !defined(_DISABLE_DECALS) + , out float4 outDecalBuffer : SV_TARGET_DECAL + #endif + #endif + + #if defined(_DEPTHOFFSET_ON) && !defined(SCENEPICKINGPASS) + , out float outputDepth : SV_Depth + #endif + #if NEED_FACING + , bool facing : SV_IsFrontFace + #endif + ) + { + UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX(v2p); + FragInputs input = BuildFragInputs(v2p); + + // input.positionSS is SV_Position + PositionInputs posInput = GetPositionInput(input.positionSS.xy, _ScreenSize.zw, input.positionSS.z, input.positionSS.w, input.positionRWS); + + + float3 V = GetWorldSpaceNormalizeViewDir(input.positionRWS); + + + SurfaceData surfaceData; + BuiltinData builtinData; + Surface l; + ShaderData d; + GetSurfaceAndBuiltinData(v2p, input, V, posInput, surfaceData, builtinData, l, d + #if NEED_FACING + , facing + #endif + ); + + // to prevent stripping + surfaceData.normalWS *= saturate(l.Albedo.r + 9999); + + #ifdef _DEPTHOFFSET_ON + outputDepth = l.outputDepth; + #endif + + #ifdef SCENESELECTIONPASS + // We use depth prepass for scene selection in the editor, this code allow to output the outline correctly + outColor = float4(_ObjectId, _PassValue, 1.0, 1.0); + #elif defined(SCENEPICKINGPASS) + outColor = _SelectionID; + #else + #ifdef WRITE_MSAA_DEPTH + // In case we are rendering in MSAA, reading the an MSAA depth buffer is way too expensive. To avoid that, we export the depth to a color buffer + depthColor = v2p.pos.z; + + #ifdef _ALPHATOMASK_ON + // Alpha channel is used for alpha to coverage + depthColor.a = SharpenAlpha(builtinData.opacity, builtinData.alphaClipTreshold); + #endif // alphatomask + #endif // msaa_depth + + + #if defined(WRITE_NORMAL_BUFFER) + EncodeIntoNormalBuffer(ConvertSurfaceDataToNormalData(surfaceData), outNormalBuffer); + #endif + + #if defined(WRITE_DECAL_BUFFER) && !defined(_DISABLE_DECALS) + DecalPrepassData decalPrepassData; + // We don't have the right to access SurfaceData in a shaderpass. + // However it would be painful to have to add a function like ConvertSurfaceDataToDecalPrepassData() to every Material to return geomNormalWS anyway + // Here we will put the constrain that any Material requiring to support Decal, will need to have geomNormalWS as member of surfaceData (and we already require normalWS anyway) + decalPrepassData.geomNormalWS = surfaceData.geomNormalWS; + decalPrepassData.decalLayerMask = GetMeshRenderingDecalLayer(); + EncodeIntoDecalPrepassBuffer(decalPrepassData, outDecalBuffer); + #endif + #endif + + } + + + + ENDHLSL + } + + + + Pass + { + // based on HDLitPass.template + Name "META" + Tags { "LightMode" = "META" } + + Cull Off + + Tags { "RenderType" = "Opaque" "Queue" = "Geometry" "PreviewType" = "Plane" } + Cull [_CullingOption] + ZWrite [_ZWrite] + ZTest [_ZTestMode] + + + //------------------------------------------------------------------------------------- + // End Render Modes + //------------------------------------------------------------------------------------- + + HLSLPROGRAM + + #pragma target 4.5 + #pragma only_renderers d3d11 playstation xboxone xboxseries vulkan metal switch + + + #pragma multi_compile_instancing + + //#pragma multi_compile_local _ _ALPHATEST_ON + + + + //------------------------------------------------------------------------------------- + // Variant Definitions (active field translations to HDRP defines) + //------------------------------------------------------------------------------------- + // #define _MATERIAL_FEATURE_SUBSURFACE_SCATTERING 1 + // #define _MATERIAL_FEATURE_TRANSMISSION 1 + // #define _MATERIAL_FEATURE_ANISOTROPY 1 + // #define _MATERIAL_FEATURE_IRIDESCENCE 1 + // #define _MATERIAL_FEATURE_SPECULAR_COLOR 1 + #define _ENABLE_FOG_ON_TRANSPARENT 1 + // #define _AMBIENT_OCCLUSION 1 + // #define _SPECULAR_OCCLUSION_FROM_AO 1 + // #define _SPECULAR_OCCLUSION_FROM_AO_BENT_NORMAL 1 + // #define _SPECULAR_OCCLUSION_CUSTOM 1 + // #define _ENERGY_CONSERVING_SPECULAR 1 + // #define _ENABLE_GEOMETRIC_SPECULAR_AA 1 + // #define _HAS_REFRACTION 1 + // #define _REFRACTION_PLANE 1 + // #define _REFRACTION_SPHERE 1 + // #define _DISABLE_DECALS 1 + // #define _DISABLE_SSR 1 + // #define _ADD_PRECOMPUTED_VELOCITY + // #define _WRITE_TRANSPARENT_MOTION_VECTOR 1 + // #define _DEPTHOFFSET_ON 1 + // #define _BLENDMODE_PRESERVE_SPECULAR_LIGHTING 1 + + #define SHADERPASS SHADERPASS_LIGHT_TRANSPORT + #define RAYTRACING_SHADER_GRAPH_HIGH + #define REQUIRE_DEPTH_TEXTURE + #define _PASSMETA 1 + + + + #pragma shader_feature_local GLOW_ON + #pragma shader_feature_local FADE_ON + #pragma shader_feature_local OUTBASE_ON + #pragma shader_feature_local ONLYOUTLINE_ON + #pragma shader_feature_local GRADIENT_ON + #pragma shader_feature_local GRADIENT2COL_ON + #pragma shader_feature_local RADIALGRADIENT_ON + #pragma shader_feature_local COLORSWAP_ON + #pragma shader_feature_local HSV_ON + #pragma shader_feature_local CHANGECOLOR_ON + #pragma shader_feature_local CHANGECOLOR2_ON + #pragma shader_feature_local CHANGECOLOR3_ON + #pragma shader_feature_local COLORRAMP_ON + #pragma shader_feature_local GRADIENTCOLORRAMP_ON + #pragma shader_feature_local HITEFFECT_ON + #pragma shader_feature_local NEGATIVE_ON + #pragma shader_feature_local PIXELATE_ON + #pragma shader_feature_local GREYSCALE_ON + #pragma shader_feature_local POSTERIZE_ON + #pragma shader_feature_local BLUR_ON + #pragma shader_feature_local MOTIONBLUR_ON + #pragma shader_feature_local GHOST_ON + #pragma shader_feature_local ALPHAOUTLINE_ON + #pragma shader_feature_local INNEROUTLINE_ON + #pragma shader_feature_local ONLYINNEROUTLINE_ON + #pragma shader_feature_local HOLOGRAM_ON + #pragma shader_feature_local CHROMABERR_ON + #pragma shader_feature_local GLITCH_ON + #pragma shader_feature_local FLICKER_ON + #pragma shader_feature_local SHADOW_ON + #pragma shader_feature_local SHINE_ON + #pragma shader_feature_local CONTRAST_ON + #pragma shader_feature_local OVERLAY_ON + #pragma shader_feature_local OVERLAYMULT_ON + #pragma shader_feature_local DOODLE_ON + #pragma shader_feature_local WIND_ON + #pragma shader_feature_local WAVEUV_ON + #pragma shader_feature_local ROUNDWAVEUV_ON + #pragma shader_feature_local RECTSIZE_ON + #pragma shader_feature_local OFFSETUV_ON + #pragma shader_feature_local CLIPPING_ON + #pragma shader_feature_local RADIALCLIPPING_ON + #pragma shader_feature_local TEXTURESCROLL_ON + #pragma shader_feature_local ZOOMUV_ON + #pragma shader_feature_local DISTORT_ON + #pragma shader_feature_local WARP_ON + #pragma shader_feature_local TWISTUV_ON + #pragma shader_feature_local ROTATEUV_ON + #pragma shader_feature_local POLARUV_ON + #pragma shader_feature_local FISHEYE_ON + #pragma shader_feature_local PINCH_ON + #pragma shader_feature_local SHAKEUV_ON + + #pragma shader_feature_local GLOWTEX_ON + #pragma shader_feature_local OUTTEX_ON + #pragma shader_feature_local OUTDIST_ON + #pragma shader_feature_local OUTBASE8DIR_ON + #pragma shader_feature_local OUTBASEPIXELPERF_ON + #pragma shader_feature_local COLORRAMPOUTLINE_ON + #pragma shader_feature_local GREYSCALEOUTLINE_ON + #pragma shader_feature_local POSTERIZEOUTLINE_ON + #pragma shader_feature_local BLURISHD_ON + #pragma shader_feature_local MANUALWIND_ON + #pragma shader_feature_local ATLAS_ON + #pragma shader_feature_local PREMULTIPLYALPHA_ON + + #pragma shader_feature BILBOARD_ON + #pragma shader_feature BILBOARDY_ON + + #pragma shader_feature NORMALMAP_ON + + + #define _HDRP 1 +#define _USINGTEXCOORD1 1 +#define _USINGTEXCOORD2 1 + + + #pragma vertex Vert + #pragma fragment Frag + + + + + // useful conversion functions to make surface shader code just work + + #define UNITY_DECLARE_TEX2D(name) TEXTURE2D(name); SAMPLER(sampler##name); + #define UNITY_DECLARE_TEX2D_NOSAMPLER(name) TEXTURE2D(name); + #define UNITY_DECLARE_TEX2DARRAY(name) TEXTURE2D_ARRAY(name); SAMPLER(sampler##name); + #define UNITY_DECLARE_TEX2DARRAY_NOSAMPLER(tex) TEXTURE2D_ARRAY(tex); + + #define UNITY_SAMPLE_TEX2DARRAY(tex,coord) SAMPLE_TEXTURE2D_ARRAY(tex, sampler##tex, coord.xy, coord.z) + #define UNITY_SAMPLE_TEX2DARRAY_LOD(tex,coord,lod) SAMPLE_TEXTURE2D_ARRAY_LOD(tex, sampler##tex, coord.xy, coord.z, lod) + #define UNITY_SAMPLE_TEX2D(tex, coord) SAMPLE_TEXTURE2D(tex, sampler##tex, coord) + #define UNITY_SAMPLE_TEX2D_SAMPLER(tex, samp, coord) SAMPLE_TEXTURE2D(tex, sampler##samp, coord) + + #define UNITY_SAMPLE_TEX2D_LOD(tex,coord, lod) SAMPLE_TEXTURE2D_LOD(tex, sampler_##tex, coord, lod) + #define UNITY_SAMPLE_TEX2D_SAMPLER_LOD(tex,samplertex,coord, lod) SAMPLE_TEXTURE2D_LOD (tex, sampler##samplertex,coord, lod) + + #if defined(UNITY_COMPILER_HLSL) + #define UNITY_INITIALIZE_OUTPUT(type,name) name = (type)0; + #else + #define UNITY_INITIALIZE_OUTPUT(type,name) + #endif + + #define sampler2D_float sampler2D + #define sampler2D_half sampler2D + + #undef WorldNormalVector + #define WorldNormalVector(data, normal) mul(normal, data.TBNMatrix) + + #define UnityObjectToWorldNormal(normal) mul(GetObjectToWorldMatrix(), normal) + + + + +// HDRP Adapter stuff + #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Common.hlsl" + #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Texture.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/ShaderVariables.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/ShaderPass/FragInputs.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/ShaderPass/ShaderPass.cs.hlsl" + #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/TextureStack.hlsl" // Required to be include before we include properties as it define DECLARE_STACK_CB +#if UNITY_VERSION >= UNITY_2021_3_31 + #include "Packages/com.unity.shadergraph/ShaderGraphLibrary/Functions.hlsl" // Need to be here for Gradient struct definition +#else + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/ShaderGraphHeader.hlsl" +#endif + #ifdef RAYTRACING_SHADER_GRAPH_DEFAULT + #define RAYTRACING_SHADER_GRAPH_HIGH + #endif + + #ifdef RAYTRACING_SHADER_GRAPH_RAYTRACED + #define RAYTRACING_SHADER_GRAPH_LOW + #endif + // end + + + + + // If we use subsurface scattering, enable output split lighting (for forward pass) + #if defined(_MATERIAL_FEATURE_SUBSURFACE_SCATTERING) && !defined(_SURFACE_TYPE_TRANSPARENT) + #define OUTPUT_SPLIT_LIGHTING + #endif + + #define HAVE_RECURSIVE_RENDERING + + #if SHADERPASS == SHADERPASS_TRANSPARENT_DEPTH_PREPASS + #if !defined(_DISABLE_SSR_TRANSPARENT) && !defined(SHADER_UNLIT) + #define WRITE_NORMAL_BUFFER + #endif + #endif + + #ifndef DEBUG_DISPLAY + // In case of opaque we don't want to perform the alpha test, it is done in depth prepass and we use depth equal for ztest (setup from UI) + // Don't do it with debug display mode as it is possible there is no depth prepass in this case + #if !defined(_SURFACE_TYPE_TRANSPARENT) && defined(_ALPHATEST) + #if SHADERPASS == SHADERPASS_FORWARD + #define SHADERPASS_FORWARD_BYPASS_ALPHA_TEST + #elif SHADERPASS == SHADERPASS_GBUFFER + #define SHADERPASS_GBUFFER_BYPASS_ALPHA_TEST + #endif + #endif + #endif + + // Define _DEFERRED_CAPABLE_MATERIAL for shader capable to run in deferred pass + #if defined(SHADER_LIT) && !defined(_SURFACE_TYPE_TRANSPARENT) + #define _DEFERRED_CAPABLE_MATERIAL + #endif + + // Translate transparent motion vector define + #if defined(_TRANSPARENT_WRITES_MOTION_VEC) && defined(_SURFACE_TYPE_TRANSPARENT) + #define _WRITE_TRANSPARENT_MOTION_VECTOR + #endif + + + + + CBUFFER_START(UnityPerMaterial) + float _UseShadowThreshold; + float _BlendMode; + float _EnableBlendModePreserveSpecularLighting; + float _RayTracing; + float _RefractionModel; + + + half4 _Color; + half4 _MainTex_ST, _MainTex_TexelSize; + half _Alpha, _AlphaCutoffValue; + + #if ATLAS_ON + half _MinXUV, _MaxXUV, _MinYUV, _MaxYUV; + #endif + + #if GLOW_ON + half4 _GlowColor; + half _Glow, _GlowGlobal; + #endif + + #if HSV_ON + half _HsvShift, _HsvSaturation, _HsvBright; + #endif + + #if DISTORT_ON + half4 _DistortTex_ST; + half _DistortTexXSpeed, _DistortTexYSpeed, _DistortAmount; + #endif + + #if FADE_ON + half4 _FadeBurnColor, _FadeTex_ST, _FadeBurnTex_ST; + half _FadeAmount, _FadeBurnWidth, _FadeBurnTransition,_FadeBurnGlow; + #endif + + #if OUTBASE_ON + half4 _OutlineColor; + half _OutlineAlpha, _OutlineGlow, _OutlineWidth; + int _OutlinePixelWidth; + #endif + + #if OUTTEX_ON + half4 _OutlineTex_ST; + half _OutlineTexXSpeed, _OutlineTexYSpeed; + #endif + + #if OUTDIST_ON + half4 _OutlineDistortTex_ST; + half _OutlineDistortTexXSpeed, _OutlineDistortTexYSpeed, _OutlineDistortAmount; + #endif + + #if ALPHAOUTLINE_ON + half _AlphaOutlineGlow, _AlphaOutlinePower, _AlphaOutlineMinAlpha, _AlphaOutlineBlend; + half4 _AlphaOutlineColor; + #endif + + #if INNEROUTLINE_ON + half _InnerOutlineThickness, _InnerOutlineAlpha, _InnerOutlineGlow; + half4 _InnerOutlineColor; + #endif + + #if GRADIENT_ON + half _GradBlend, _GradBoostX, _GradBoostY; + half4 _GradTopRightCol, _GradTopLeftCol, _GradBotRightCol, _GradBotLeftCol; + #endif + + #if COLORSWAP_ON + half4 _ColorSwapRed, _ColorSwapGreen, _ColorSwapBlue; + half _ColorSwapRedLuminosity, _ColorSwapGreenLuminosity, _ColorSwapBlueLuminosity, _ColorSwapBlend; + #endif + + #if CHANGECOLOR_ON + half4 _ColorChangeNewCol, _ColorChangeTarget; + half _ColorChangeTolerance, _ColorChangeLuminosity; + #endif + #if CHANGECOLOR2_ON + half4 _ColorChangeNewCol2, _ColorChangeTarget2; + half _ColorChangeTolerance2; + #endif + #if CHANGECOLOR3_ON + half4 _ColorChangeNewCol3, _ColorChangeTarget3; + half _ColorChangeTolerance3; + #endif + + #if COLORRAMP_ON + half _ColorRampLuminosity, _ColorRampBlend; + #endif + + #if HITEFFECT_ON + half4 _HitEffectColor; + half _HitEffectGlow, _HitEffectBlend; + #endif + + #if NEGATIVE_ON + half _NegativeAmount; + #endif + + #if PIXELATE_ON + half _PixelateSize; + #endif + + #if GREYSCALE_ON + half _GreyscaleLuminosity, _GreyscaleBlend; + half4 _GreyscaleTintColor; + #endif + + #if POSTERIZE_ON + half _PosterizeNumColors, _PosterizeGamma; + #endif + + #if BLUR_ON + half _BlurIntensity; + #endif + + #if MOTIONBLUR_ON + half _MotionBlurAngle, _MotionBlurDist; + #endif + + #if GHOST_ON + half _GhostColorBoost, _GhostTransparency, _GhostBlend; + #endif + + #if HOLOGRAM_ON + half _HologramStripesAmount, _HologramMinAlpha, _HologramUnmodAmount, _HologramStripesSpeed, _HologramMaxAlpha, _HologramBlend; + half4 _HologramStripeColor; + #endif + + #if CHROMABERR_ON + half _ChromAberrAmount, _ChromAberrAlpha; + #endif + + #if GLITCH_ON + half _GlitchAmount, _GlitchSize; + #endif + + #if FLICKER_ON + half _FlickerFreq, _FlickerPercent, _FlickerAlpha; + #endif + + #if SHADOW_ON + half _ShadowX, _ShadowY, _ShadowAlpha; + half4 _ShadowColor; + #endif + + #if SHINE_ON + half4 _ShineColor; + half _ShineLocation, _ShineRotate, _ShineWidth, _ShineGlow; + #endif + + #if CONTRAST_ON + half _Contrast, _Brightness; + #endif + + #if OVERLAY_ON + half4 _OverlayTex_ST, _OverlayColor; + half _OverlayGlow, _OverlayBlend, _OverlayTextureScrollXSpeed, _OverlayTextureScrollYSpeed; + #endif + + #if DOODLE_ON + half _HandDrawnAmount, _HandDrawnSpeed; + #endif + + #if WIND_ON + half _GrassSpeed, _GrassWind, _GrassManualAnim, _GrassRadialBend; + #endif + + #if WAVEUV_ON + float _WaveAmount, _WaveSpeed, _WaveStrength, _WaveX, _WaveY; + #endif + + #if ROUNDWAVEUV_ON + half _RoundWaveStrength, _RoundWaveSpeed; + #endif + + #if RECTSIZE_ON + half _RectSize; + #endif + + #if OFFSETUV_ON + half _OffsetUvX, _OffsetUvY; + #endif + + #if CLIPPING_ON + half _ClipUvLeft, _ClipUvRight, _ClipUvUp, _ClipUvDown; + #endif + + #if RADIALCLIPPING_ON + half _RadialStartAngle, _RadialClip, _RadialClip2; + #endif + + #if TEXTURESCROLL_ON + half _TextureScrollXSpeed, _TextureScrollYSpeed; + #endif + + #if ZOOMUV_ON + half _ZoomUvAmount; + #endif + + #if WARP_ON + half _WarpStrength, _WarpSpeed, _WarpScale; + #endif + + #if TWISTUV_ON + half _TwistUvAmount, _TwistUvPosX, _TwistUvPosY, _TwistUvRadius; + #endif + + #if ROTATEUV_ON + half _RotateUvAmount; + #endif + + #if FISHEYE_ON + half _FishEyeUvAmount; + #endif + + #if PINCH_ON + half _PinchUvAmount; + #endif + + #if SHAKEUV_ON + half _ShakeUvSpeed, _ShakeUvX, _ShakeUvY; + #endif + + #if NORMALMAP_ON + half _NormalStrength; + #endif + + float _RandomSeed; + + + + + CBUFFER_END + + + + // -- Property used by ScenePickingPass + #ifdef SCENEPICKINGPASS + float4 _SelectionID; + #endif + + // -- Properties used by SceneSelectionPass + #ifdef SCENESELECTIONPASS + int _ObjectId; + int _PassValue; + #endif + + + // data across stages, stripped like the above. + struct VertexToPixel + { + float4 pos : SV_POSITION; + float3 worldPos : TEXCOORD0; + float3 worldNormal : TEXCOORD1; + float4 worldTangent : TEXCOORD2; + float4 texcoord0 : TEXCOORD3; + float4 texcoord1 : TEXCOORD4; + float4 texcoord2 : TEXCOORD5; + // #if %TEXCOORD3REQUIREKEY% + float4 texcoord3 : TEXCOORD6; + // #endif + + // #if %SCREENPOSREQUIREKEY% + // float4 screenPos : TEXCOORD7; + // #endif + + // #if %VERTEXCOLORREQUIREKEY% + float4 vertexColor : COLOR; + // #endif + + // #if %EXTRAV2F0REQUIREKEY% + // float4 extraV2F0 : TEXCOORD8; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // float4 extraV2F1 : TEXCOORD9; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // float4 extraV2F2 : TEXCOORD10; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // float4 extraV2F3 : TEXCOORD11; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // float4 extraV2F4 : TEXCOORD12; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // float4 extraV2F5 : TEXCOORD13; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // float4 extraV2F6 : TEXCOORD14; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // float4 extraV2F7 : TEXCOORD15; + // #endif + + #if UNITY_ANY_INSTANCING_ENABLED + UNITY_VERTEX_INPUT_INSTANCE_ID + #endif // UNITY_ANY_INSTANCING_ENABLED + + #if _HDRP && (_PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR))) + float4 previousPositionCS : TEXCOORD16; // Contain previous transform position (in case of skinning for example) + float4 motionVectorCS : TEXCOORD17; + #endif + + UNITY_VERTEX_OUTPUT_STEREO + }; + + + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Debug/DebugDisplay.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/Material.hlsl" + #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/NormalSurfaceGradient.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/Lit/Lit.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/BuiltinUtilities.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/MaterialUtilities.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/Decal/DecalUtilities.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/Lit/LitDecalData.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/ShaderGraphFunctions.hlsl" + + + + + + // data describing the user output of a pixel + struct Surface + { + half3 Albedo; + half Height; + half3 Normal; + half Smoothness; + half3 Emission; + half Metallic; + half3 Specular; + half Occlusion; + half SpecularPower; // for simple lighting + half Alpha; + float outputDepth; // if written, SV_Depth semantic is used. ShaderData.clipPos.z is unused value + // HDRP Only + half SpecularOcclusion; + half SubsurfaceMask; + half Thickness; + half CoatMask; + half CoatSmoothness; + half Anisotropy; + half IridescenceMask; + half IridescenceThickness; + int DiffusionProfileHash; + float SpecularAAThreshold; + float SpecularAAScreenSpaceVariance; + // requires _OVERRIDE_BAKEDGI to be defined, but is mapped in all pipelines + float3 DiffuseGI; + float3 BackDiffuseGI; + float3 SpecularGI; + float ior; + float3 transmittanceColor; + float atDistance; + float transmittanceMask; + // requires _OVERRIDE_SHADOWMASK to be defines + float4 ShadowMask; + + // for decals + float NormalAlpha; + float MAOSAlpha; + + + }; + + // Data the user declares in blackboard blocks + struct Blackboard + { + + float blackboardDummyData; + }; + + // data the user might need, this will grow to be big. But easy to strip + struct ShaderData + { + float4 clipPos; // SV_POSITION + float3 localSpacePosition; + float3 localSpaceNormal; + float3 localSpaceTangent; + + float3 worldSpacePosition; + float3 worldSpaceNormal; + float3 worldSpaceTangent; + float tangentSign; + + float3 worldSpaceViewDir; + float3 tangentSpaceViewDir; + + float4 texcoord0; + float4 texcoord1; + float4 texcoord2; + float4 texcoord3; + + float2 screenUV; + float4 screenPos; + + float4 vertexColor; + bool isFrontFace; + + float4 extraV2F0; + float4 extraV2F1; + float4 extraV2F2; + float4 extraV2F3; + float4 extraV2F4; + float4 extraV2F5; + float4 extraV2F6; + float4 extraV2F7; + + float3x3 TBNMatrix; + Blackboard blackboard; + }; + + struct VertexData + { + #if SHADER_TARGET > 30 + // uint vertexID : SV_VertexID; + #endif + float4 vertex : POSITION; + float3 normal : NORMAL; + float4 tangent : TANGENT; + float4 texcoord0 : TEXCOORD0; + + // optimize out mesh coords when not in use by user or lighting system + #if _URP && (_USINGTEXCOORD1 || _PASSMETA || _PASSFORWARD || _PASSGBUFFER) + float4 texcoord1 : TEXCOORD1; + #endif + + #if _URP && (_USINGTEXCOORD2 || _PASSMETA || ((_PASSFORWARD || _PASSGBUFFER) && defined(DYNAMICLIGHTMAP_ON))) + float4 texcoord2 : TEXCOORD2; + #endif + + #if _STANDARD && (_USINGTEXCOORD1 || (_PASSMETA || ((_PASSFORWARD || _PASSGBUFFER || _PASSFORWARDADD) && LIGHTMAP_ON))) + float4 texcoord1 : TEXCOORD1; + #endif + #if _STANDARD && (_USINGTEXCOORD2 || (_PASSMETA || ((_PASSFORWARD || _PASSGBUFFER) && DYNAMICLIGHTMAP_ON))) + float4 texcoord2 : TEXCOORD2; + #endif + + + #if _HDRP + float4 texcoord1 : TEXCOORD1; + float4 texcoord2 : TEXCOORD2; + #endif + + // #if %TEXCOORD3REQUIREKEY% + float4 texcoord3 : TEXCOORD3; + // #endif + + // #if %VERTEXCOLORREQUIREKEY% + float4 vertexColor : COLOR; + // #endif + + #if _PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR)) + float3 previousPositionOS : TEXCOORD4; // Contain previous transform position (in case of skinning for example) + #if defined (_ADD_PRECOMPUTED_VELOCITY) + float3 precomputedVelocity : TEXCOORD5; // Add Precomputed Velocity (Alembic computes velocities on runtime side). + #endif + #endif + + UNITY_VERTEX_INPUT_INSTANCE_ID + }; + + struct TessVertex + { + float4 vertex : INTERNALTESSPOS; + float3 normal : NORMAL; + float4 tangent : TANGENT; + float4 texcoord0 : TEXCOORD0; + float4 texcoord1 : TEXCOORD1; + float4 texcoord2 : TEXCOORD2; + + // #if %TEXCOORD3REQUIREKEY% + float4 texcoord3 : TEXCOORD3; + // #endif + + // #if %VERTEXCOLORREQUIREKEY% + float4 vertexColor : COLOR; + // #endif + + // #if %EXTRAV2F0REQUIREKEY% + // float4 extraV2F0 : TEXCOORD5; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // float4 extraV2F1 : TEXCOORD6; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // float4 extraV2F2 : TEXCOORD7; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // float4 extraV2F3 : TEXCOORD8; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // float4 extraV2F4 : TEXCOORD9; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // float4 extraV2F5 : TEXCOORD10; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // float4 extraV2F6 : TEXCOORD11; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // float4 extraV2F7 : TEXCOORD12; + // #endif + + #if _PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR)) + float3 previousPositionOS : TEXCOORD13; // Contain previous transform position (in case of skinning for example) + #if defined (_ADD_PRECOMPUTED_VELOCITY) + float3 precomputedVelocity : TEXCOORD14; + #endif + #endif + + UNITY_VERTEX_INPUT_INSTANCE_ID + UNITY_VERTEX_OUTPUT_STEREO + }; + + struct ExtraV2F + { + float4 extraV2F0; + float4 extraV2F1; + float4 extraV2F2; + float4 extraV2F3; + float4 extraV2F4; + float4 extraV2F5; + float4 extraV2F6; + float4 extraV2F7; + Blackboard blackboard; + float4 time; + }; + + + float3 WorldToTangentSpace(ShaderData d, float3 normal) + { + return mul(d.TBNMatrix, normal); + } + + float3 TangentToWorldSpace(ShaderData d, float3 normal) + { + return mul(normal, d.TBNMatrix); + } + + // in this case, make standard more like SRPs, because we can't fix + // unity_WorldToObject in HDRP, since it already does macro-fu there + + #if _STANDARD + float3 TransformWorldToObject(float3 p) { return mul(unity_WorldToObject, float4(p, 1)); }; + float3 TransformObjectToWorld(float3 p) { return mul(unity_ObjectToWorld, float4(p, 1)); }; + float4 TransformWorldToObject(float4 p) { return mul(unity_WorldToObject, p); }; + float4 TransformObjectToWorld(float4 p) { return mul(unity_ObjectToWorld, p); }; + float4x4 GetWorldToObjectMatrix() { return unity_WorldToObject; } + float4x4 GetObjectToWorldMatrix() { return unity_ObjectToWorld; } + #if (defined(SHADER_API_D3D11) || defined(SHADER_API_XBOXONE) || defined(UNITY_COMPILER_HLSLCC) || defined(SHADER_API_PSSL) || (SHADER_TARGET_SURFACE_ANALYSIS && !SHADER_TARGET_SURFACE_ANALYSIS_MOJOSHADER)) + #define UNITY_SAMPLE_TEX2D_LOD(tex,coord, lod) tex.SampleLevel (sampler##tex,coord, lod) + #define UNITY_SAMPLE_TEX2D_SAMPLER_LOD(tex,samplertex,coord, lod) tex.SampleLevel (sampler##samplertex,coord, lod) + #else + #define UNITY_SAMPLE_TEX2D_LOD(tex,coord,lod) tex2D (tex,coord,0,lod) + #define UNITY_SAMPLE_TEX2D_SAMPLER_LOD(tex,samplertex,coord,lod) tex2D (tex,coord,0,lod) + #endif + + #undef GetWorldToObjectMatrix() + + #define GetWorldToObjectMatrix() unity_WorldToObject + + + #endif + + float3 GetCameraWorldPosition() + { + #if _HDRP + return GetCameraRelativePositionWS(_WorldSpaceCameraPos); + #else + return _WorldSpaceCameraPos; + #endif + } + + #if _GRABPASSUSED + #if _STANDARD + TEXTURE2D(%GRABTEXTURE%); + SAMPLER(sampler_%GRABTEXTURE%); + #endif + + half3 GetSceneColor(float2 uv) + { + #if _STANDARD + return SAMPLE_TEXTURE2D(%GRABTEXTURE%, sampler_%GRABTEXTURE%, uv).rgb; + #else + return SHADERGRAPH_SAMPLE_SCENE_COLOR(uv); + #endif + } + #endif + + + + #if _STANDARD + UNITY_DECLARE_DEPTH_TEXTURE(_CameraDepthTexture); + float GetSceneDepth(float2 uv) { return SAMPLE_DEPTH_TEXTURE(_CameraDepthTexture, uv); } + float GetLinear01Depth(float2 uv) { return Linear01Depth(GetSceneDepth(uv)); } + float GetLinearEyeDepth(float2 uv) { return LinearEyeDepth(GetSceneDepth(uv)); } + #else + float GetSceneDepth(float2 uv) { return SHADERGRAPH_SAMPLE_SCENE_DEPTH(uv); } + float GetLinear01Depth(float2 uv) { return Linear01Depth(GetSceneDepth(uv), _ZBufferParams); } + float GetLinearEyeDepth(float2 uv) { return LinearEyeDepth(GetSceneDepth(uv), _ZBufferParams); } + #endif + + float3 GetWorldPositionFromDepthBuffer(float2 uv, float3 worldSpaceViewDir) + { + float eye = GetLinearEyeDepth(uv); + float3 camView = mul((float3x3)GetObjectToWorldMatrix(), transpose(mul(GetWorldToObjectMatrix(), UNITY_MATRIX_I_V)) [2].xyz); + + float dt = dot(worldSpaceViewDir, camView); + float3 div = worldSpaceViewDir/dt; + float3 wpos = (eye * div) + GetCameraWorldPosition(); + return wpos; + } + + #if _HDRP + float3 ObjectToWorldSpacePosition(float3 pos) + { + return GetAbsolutePositionWS(TransformObjectToWorld(pos)); + } + #else + float3 ObjectToWorldSpacePosition(float3 pos) + { + return TransformObjectToWorld(pos); + } + #endif + + #if _STANDARD + UNITY_DECLARE_SCREENSPACE_TEXTURE(_CameraDepthNormalsTexture); + float3 GetSceneNormal(float2 uv, float3 worldSpaceViewDir) + { + float4 depthNorms = UNITY_SAMPLE_SCREENSPACE_TEXTURE(_CameraDepthNormalsTexture, uv); + float3 norms = DecodeViewNormalStereo(depthNorms); + norms = mul((float3x3)GetWorldToViewMatrix(), norms) * 0.5 + 0.5; + return norms; + } + #elif _HDRP && !_DECALSHADER + + float3 GetSceneNormal(float2 uv, float3 worldSpaceViewDir) + { + NormalData nd; + DecodeFromNormalBuffer(_ScreenSize.xy * uv, nd); + return nd.normalWS; + } + #elif _URP + #if (SHADER_LIBRARY_VERSION_MAJOR >= 10) + #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/DeclareNormalsTexture.hlsl" + #endif + + float3 GetSceneNormal(float2 uv, float3 worldSpaceViewDir) + { + #if (SHADER_LIBRARY_VERSION_MAJOR >= 10) + return SampleSceneNormals(uv); + #else + float3 wpos = GetWorldPositionFromDepthBuffer(uv, worldSpaceViewDir); + return normalize(-cross(ddx(wpos), ddy(wpos))) * 0.5 + 0.5; + #endif + + } + #endif + + #if _HDRP + + half3 UnpackNormalmapRGorAG(half4 packednormal) + { + // This do the trick + packednormal.x *= packednormal.w; + + half3 normal; + normal.xy = packednormal.xy * 2 - 1; + normal.z = sqrt(1 - saturate(dot(normal.xy, normal.xy))); + return normal; + } + half3 UnpackNormal(half4 packednormal) + { + #if defined(UNITY_NO_DXT5nm) + return packednormal.xyz * 2 - 1; + #else + return UnpackNormalmapRGorAG(packednormal); + #endif + } + #endif + #if _HDRP || _URP + + half3 UnpackScaleNormal(half4 packednormal, half scale) + { + #ifndef UNITY_NO_DXT5nm + // Unpack normal as DXT5nm (1, y, 1, x) or BC5 (x, y, 0, 1) + // Note neutral texture like "bump" is (0, 0, 1, 1) to work with both plain RGB normal and DXT5nm/BC5 + packednormal.x *= packednormal.w; + #endif + half3 normal; + normal.xy = (packednormal.xy * 2 - 1) * scale; + normal.z = sqrt(1 - saturate(dot(normal.xy, normal.xy))); + return normal; + } + + #endif + + + void GetSun(out float3 lightDir, out float3 color) + { + lightDir = float3(0.5, 0.5, 0); + color = 1; + #if _HDRP + if (_DirectionalLightCount > 0) + { + DirectionalLightData light = _DirectionalLightDatas[0]; + lightDir = -light.forward.xyz; + color = light.color; + } + #elif _STANDARD + lightDir = normalize(_WorldSpaceLightPos0.xyz); + color = _LightColor0.rgb; + #elif _URP + Light light = GetMainLight(); + lightDir = light.direction; + color = light.color; + #endif + } + + + + + + + + + + TEXTURE2D(_MainTex); + SAMPLER(sampler_MainTex); + + #if GLOW_ON + TEXTURE2D(_GlowTex); + SAMPLER(sampler_GlowTex); + #endif + + #if FADE_ON + TEXTURE2D(_FadeTex); + SAMPLER(sampler_FadeTex); + + TEXTURE2D(_FadeBurnTex); + SAMPLER(sampler_FadeBurnTex); + #endif + + #if DISTORT_ON + TEXTURE2D(_DistortTex); + SAMPLER(sampler_DistortTex); + #endif + + #if OUTTEX_ON + TEXTURE2D(_OutlineTex); + SAMPLER(sampler_OutlineTex); + #endif + + #if OUTDIST_ON + TEXTURE2D(_OutlineDistortTex); + SAMPLER(sampler_OutlineDistortTex); + #endif + + #if COLORSWAP_ON + TEXTURE2D(_ColorSwapTex); + SAMPLER(sampler_ColorSwapTex); + #endif + + #if COLORRAMP_ON + TEXTURE2D(_ColorRampTex); + TEXTURE2D(_ColorRampTexGradient); + SAMPLER(sampler_ColorRampTex); + SAMPLER(sampler_ColorRampTexGradient); + #endif + + #if SHINE_ON + TEXTURE2D(_ShineMask); + SAMPLER(sampler_ShineMask); + #endif + + #if OVERLAY_ON + TEXTURE2D(_OverlayTex); + SAMPLER(sampler_OverlayTex); + #endif + + #if NORMALMAP_ON + TEXTURE2D(_NormalMap); + SAMPLER(sampler_NormalMap); + #endif + + + half3 GetPixel(in int offsetX, in int offsetY, in half2 uv, in Texture2D _tex, in SamplerState _sampler) + { + half2 _uv = uv + half2(offsetX * _MainTex_TexelSize.x, offsetY * _MainTex_TexelSize.y); + half4 col = SAMPLE_TEXTURE2D(_tex, _sampler, _uv); + return col.rgb; + } + + + //BLURS------------------------------------------------------------------------- + half4 Blur(half2 uv, Texture2D source, SamplerState sampler_source, half Intensity) + { + const half2 texelSize = 1.0 / _ScreenParams.xy; + const half4 color = SAMPLE_TEXTURE2D(source, sampler_source, uv); + const half2 offset = Intensity * texelSize; + + half4 accumulatedColor = color; + half accumulatedWeight = 1.0; + for (int x = -1; x <= 1; x++) + { + for (int y = -1; y <= 1; y++) + { + const half2 sampleUV = uv + half2(x, y) * offset; + const half4 sampleColor = SAMPLE_TEXTURE2D(source, sampler_source, sampleUV); + + accumulatedColor += sampleColor; + accumulatedWeight += 1.0; + } + } + + half4 blurredColor = accumulatedColor / accumulatedWeight; + return blurredColor; + } + + half BlurHD_G(half bhqp, half x) + { + return exp(-(x * x) / (2.0 * bhqp * bhqp)); + } + half4 BlurHD(half2 uv, Texture2D source, SamplerState sampler_source, half BlurAmount, half xScale, half yScale) + { + int iterations = 16; + int halfIterations = iterations / 2; + half sigmaX = 0.1 + BlurAmount * 0.5; + half sigmaY = sigmaX; + half total = 0.0; + half4 ret = half4(0, 0, 0, 0); + for (int iy = 0; iy < iterations; ++iy) + { + half fy = BlurHD_G(sigmaY, half(iy) -half(halfIterations)); + half offsetY = half(iy - halfIterations) * 0.00390625 * xScale; + for (int ix = 0; ix < iterations; ++ix) + { + half fx = BlurHD_G(sigmaX, half(ix) - half(halfIterations)); + half offsetX = half(ix - halfIterations) * 0.00390625 * yScale; + total += fx * fy; + ret += SAMPLE_TEXTURE2D(source, sampler_source, uv + half2(offsetX, offsetY)) * fx * fy; + } + } + return ret / total; + } + //----------------------------------------------------------------------- + + + //------------------------------------------- + half RemapFloat(half inValue, half inMin, half inMax, half outMin, half outMax){ + return outMin + (inValue - inMin) * (outMax - outMin) / (inMax - inMin); + } + //------------------------------------------- + + //----------------------------------------------------------------------- + half rand(half2 seed, half offset) { + return (frac(sin(dot(seed, half2(12.9898, 78.233))) * 43758.5453) + offset) % 1.0; + } + + half rand2(half2 seed, half offset) { + return (frac(sin(dot(seed * floor(50 + (_Time.x % 1.0) * 12.), half2(127.1, 311.7))) * 43758.5453123) + offset) % 1.0; + } + + half rand2CustomTime(half2 seed, half offset, half customTime) { + return (frac(sin(dot(seed * floor(50 + (customTime % 1.0) * 12.), half2(127.1, 311.7))) * 43758.5453123) + offset) % 1.0; + } + //----------------------------------------------------------------------- + + + void Ext_ModifyVertex0 (inout VertexData v, inout ExtraV2F d) + { + //BILBOARD_ON + #if BILBOARD_ON + half3 camRight = mul((half3x3)unity_CameraToWorld, half3(1,0,0)); + half3 camUp = half3(0,1,0); + #if BILBOARDY_ON + camUp = mul((half3x3)unity_CameraToWorld, half3(0,1,0)); + #endif + half3 localPos = v.vertex.x * camRight + v.vertex.y * camUp; + v.vertex = half4(localPos, 1); + #endif + //----------------------------------------------------------- + + v.texcoord0.xy = TRANSFORM_TEX(v.texcoord0.xy, _MainTex); + half2 center = half2(0.5, 0.5); + #if ATLAS_ON + center = half2((_MaxXUV + _MinXUV) / 2.0, (_MaxYUV + _MinYUV) / 2.0); + #endif + + //POLARUV_ON + #if POLARUV_ON + v.texcoord0.xy = v.texcoord0.xy - center; + #endif + + //---------------------------------------- + + //ROTATEUV_ON + #if ROTATEUV_ON + half2 uvC = v.texcoord0.xy; + half cosAngle = cos(_RotateUvAmount); + half sinAngle = sin(_RotateUvAmount); + half2x2 rot = half2x2(cosAngle, -sinAngle, sinAngle, cosAngle); + uvC -= center; + v.texcoord0.xy = mul(rot, uvC); + v.texcoord0.xy += center; + #endif + //-------------------- + + #if RECTSIZE_ON + v.vertex.xyz += (v.vertex.xyz * (_RectSize - 1.0)); + #endif + + #if OUTTEX_ON + v.texcoord1.xy = TRANSFORM_TEX(v.texcoord0.xy, _OutlineTex); + #endif + + #if OUTDIST_ON + v.texcoord2.xy = TRANSFORM_TEX(v.texcoord0.xy, _OutlineDistortTex); + #endif + + #if DISTORT_ON + v.texcoord3.xy = TRANSFORM_TEX(v.texcoord0.xy, _DistortTex); + #endif + } + + void Ext_SurfaceFunction0 (inout Surface o, ShaderData d) + { + half randomSeed = _RandomSeed; + + float2 uvRect = d.texcoord0; + half2 center = half2(0.5, 0.5); + #if ATLAS_ON + center = half2((_MaxXUV + _MinXUV) / 2.0, (_MaxYUV + _MinYUV) / 2.0); + uvRect = half2((d.texcoord0.x - _MinXUV) / (_MaxXUV - _MinXUV), (d.texcoord0.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half2 centerTiled = half2(center.x * _MainTex_ST.x, center.y * _MainTex_ST.y); + + //CLIPPING_ON + #if CLIPPING_ON + half2 tiledUv = half2(d.texcoord0.x / _MainTex_ST.x, d.texcoord0.y / _MainTex_ST.y); + #if ATLAS_ON + tiledUv = half2((tiledUv.x - _MinXUV) / (_MaxXUV - _MinXUV), (tiledUv.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + clip((1 - _ClipUvUp) - tiledUv.y); + clip(tiledUv.y - _ClipUvDown); + clip((1 - _ClipUvRight) - tiledUv.x); + clip(tiledUv.x - _ClipUvLeft); + #endif + //---------------------------------- + + //RADIALCLIPPING_ON + #if RADIALCLIPPING_ON + half2 tiledUv2 = half2(d.texcoord0.x / _MainTex_ST.x, d.texcoord0.y / _MainTex_ST.y); + #if ATLAS_ON + tiledUv2 = half2((tiledUv2.x - _MinXUV) / (_MaxXUV - _MinXUV), (tiledUv2.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half startAngle = _RadialStartAngle - _RadialClip; + half endAngle = _RadialStartAngle + _RadialClip2; + half offset0 = clamp(0, 360, startAngle + 360); + half offset360 = clamp(0, 360, endAngle - 360); + half2 atan2Coord = half2(lerp(-1, 1, tiledUv2.x), lerp(-1, 1, tiledUv2.y)); + half atanAngle = atan2(atan2Coord.y, atan2Coord.x) * 57.3; // angle in degrees + if(atanAngle < 0) atanAngle = 360 + atanAngle; + if(atanAngle >= startAngle && atanAngle <= endAngle) discard; + if(atanAngle <= offset360) discard; + if(atanAngle >= offset0) discard; + #endif + + //----------------------------- + + //TEXTURESCROLL_ON && ATLAS_ON + #if TEXTURESCROLL_ON && ATLAS_ON + d.texcoord0.xy = half2(_MinXUV + ((_MaxXUV - _MinXUV) * (abs(((_Time.y + randomSeed) * _TextureScrollXSpeed) + uvRect.x) % 1)), + _MinYUV + ((_MaxYUV - _MinYUV) * (abs(((_Time.y + randomSeed) * _TextureScrollYSpeed) + uvRect.y) % 1))); + #endif + //---------------------------- + + //OFFSETUV_ON + #if OFFSETUV_ON + #if ATLAS_ON + d.texcoord0.xy = half2(_MinXUV + ((_MaxXUV - _MinXUV) * (abs((_OffsetUvX + uvRect.x) % 1))), + _MinYUV + ((_MaxYUV - _MinYUV) * (abs(_OffsetUvY + uvRect.y) % 1))); + #else + d.texcoord0.xy += half2(_OffsetUvX, _OffsetUvY); + #endif + #endif + + //---------------------- + + //POLARUV_ON + #if POLARUV_ON + d.texcoord0.xy = half2(atan2(d.texcoord0.y, d.texcoord0.x) / (2.0f * 3.141592653589f), length(d.texcoord0.xy)); + d.texcoord0.xy *= _MainTex_ST.xy; + #endif + + //-------------------------------------- + + //TWISTUV_ON + #if TWISTUV_ON + #if ATLAS_ON + _TwistUvPosX = ((_MaxXUV - _MinXUV) * _TwistUvPosX) + _MinXUV; + _TwistUvPosY = ((_MaxYUV - _MinYUV) * _TwistUvPosY) + _MinYUV; + #endif + half2 tempUv = d.texcoord0.xy - half2(_TwistUvPosX * _MainTex_ST.x, _TwistUvPosY * _MainTex_ST.y); + _TwistUvRadius *= (_MainTex_ST.x + _MainTex_ST.y) / 2; + half percent = (_TwistUvRadius - length(tempUv)) / _TwistUvRadius; + half theta = percent * percent * (2.0 * sin(_TwistUvAmount)) * 8.0; + half s = sin(theta); + half c = cos(theta); + half beta = max(sign(_TwistUvRadius - length(tempUv)), 0.0); + tempUv = half2(dot(tempUv, half2(c, -s)), dot(tempUv, half2(s, c))) * beta + tempUv * (1 - beta); + tempUv += half2(_TwistUvPosX * _MainTex_ST.x, _TwistUvPosY * _MainTex_ST.y); + d.texcoord0.xy = tempUv; + #endif + + //-------------------------------------------- + + //FISHEYE_ON + #if FISHEYE_ON + half bind = length(centerTiled); + half2 dF = d.texcoord0.xy - centerTiled; + half dFlen = length(dF); + half fishInt = (3.14159265359 / bind) * (_FishEyeUvAmount + 0.001); + d.texcoord0.xy = centerTiled + (dF / (max(0.0001, dFlen))) * tan(dFlen * fishInt) * bind / tan(bind * fishInt); + #endif + //--------------------------------------------- + + //PINCH_ON + #if PINCH_ON + half2 dP = d.texcoord0.xy - centerTiled; + half pinchInt = (3.141592 / length(centerTiled)) * (-_PinchUvAmount + 0.001); + d.texcoord0.xy = centerTiled + normalize(dP) * atan(length(dP) * -pinchInt * 10.0) * 0.5 / atan(-pinchInt * 5); + #endif + + //--------------------------------------------- + + //ZOOMUV_ON + #if ZOOMUV_ON + d.texcoord0.xy -= centerTiled; + d.texcoord0.xy = d.texcoord0.xy * _ZoomUvAmount; + d.texcoord0.xy += centerTiled; + #endif + + //----------------------------------------------- + + //DOODLE_ON + #if DOODLE_ON + half2 uvCopy = uvRect; + _HandDrawnSpeed = (floor((_Time.x + randomSeed) * 20 * _HandDrawnSpeed) / _HandDrawnSpeed) * _HandDrawnSpeed; + uvCopy.x = sin((uvCopy.x * _HandDrawnAmount + _HandDrawnSpeed) * 4); + uvCopy.y = cos((uvCopy.y * _HandDrawnAmount + _HandDrawnSpeed) * 4); + d.texcoord0.xy = lerp(d.texcoord0.xy, d.texcoord0.xy + uvCopy, 0.0005 * _HandDrawnAmount); + #endif + + //-------------------------- + + //SHAKEUV_ON + #if SHAKEUV_ON + half xShake = sin((_Time.x + randomSeed) * _ShakeUvSpeed * 50) * _ShakeUvX; + half yShake = cos((_Time.x + randomSeed) * _ShakeUvSpeed * 50) * _ShakeUvY; + d.texcoord0.xy += half2(xShake * 0.012, yShake * 0.01); + #endif + + //------------------------------------------- + + //RECTSIZE_ON + #if RECTSIZE_ON + d.texcoord0.xy = d.texcoord0.xy * (_RectSize).xx + (((-_RectSize * 0.5) + 0.5)).xx; + #endif + + //------------------------------------------- + + //DISTORT_ON + #if DISTORT_ON + #if ATLAS_ON + d.texcoord3.x = d.texcoord3.x * (1 / (_MaxXUV - _MinXUV)); + d.texcoord3.y = d.texcoord3.y * (1 / (_MaxYUV - _MinYUV)); + #endif + + d.texcoord3.x += ((_Time.x + _RandomSeed) * _DistortTexXSpeed) % 1; + d.texcoord3.y += ((_Time.x + _RandomSeed) * _DistortTexYSpeed) % 1; + half distortAmnt = (SAMPLE_TEXTURE2D(_DistortTex, sampler_DistortTex, d.texcoord3.xy).r - 0.5) * 0.2 * _DistortAmount; + d.texcoord0.x += distortAmnt; + d.texcoord0.y += distortAmnt; + #endif + //------------------------------------------------------- + + //WARP_ON + #if WARP_ON + half2 warpUv = half2(d.texcoord0.x / _MainTex_ST.x, d.texcoord0.y / _MainTex_ST.y); + #if ATLAS_ON + warpUv = half2((warpUv.x - _MinXUV) / (_MaxXUV - _MinXUV), (warpUv.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + const float tau = 6.283185307179586; + float xWarp = (_Time.y + randomSeed) * _WarpSpeed + warpUv.x * tau / _WarpScale; + float yWarp = (_Time.y + randomSeed) * _WarpSpeed + warpUv.y * tau / _WarpScale; + float2 warp = float2(sin(xWarp), sin(yWarp)) * _WarpStrength; + d.texcoord0.xy += warp; + #endif + + //------------------------------------------------------- + + //WAVEUV_ON + #if WAVEUV_ON + float2 uvWave = half2(_WaveX * _MainTex_ST.x, _WaveY * _MainTex_ST.y) - d.texcoord0.xy; + uvWave %= 1; + #if ATLAS_ON + uvWave = half2(_WaveX, _WaveY) - uvRect; + #endif + uvWave.x *= _ScreenParams.x / _ScreenParams.y; + float waveTime = _Time.y + randomSeed; + float angWave = (sqrt(dot(uvWave, uvWave)) * _WaveAmount) - ((waveTime * _WaveSpeed)); + d.texcoord0.xy = d.texcoord0.xy + uvWave * sin(angWave) * (_WaveStrength / 1000.0); + #endif + //---------------------------------------------------- + + //ROUNDWAVEUV_ON + #if ROUNDWAVEUV_ON + half xWave = ((0.5 * _MainTex_ST.x) - uvRect.x); + half yWave = ((0.5 * _MainTex_ST.y) - uvRect.y) * (_MainTex_TexelSize.w / _MainTex_TexelSize.z); + half ripple = -sqrt(xWave*xWave + yWave* yWave); + d.texcoord0.xy += (sin((ripple + (_Time.y + randomSeed) * (_RoundWaveSpeed/10.0)) / 0.015) * (_RoundWaveStrength/10.0)) % 1; + #endif + //---------------------------------------------------- + + + //WIND_ON + #if WIND_ON + half windOffset = sin((_Time.x + randomSeed) * _GrassSpeed * 10); + half2 windCenter = half2(0.5, 0.1); + #if ATLAS_ON + windCenter.x = ((_MaxXUV - _MinXUV) * windCenter.x) + _MinXUV; + windCenter.y = ((_MaxYUV - _MinYUV) * windCenter.y) + _MinYUV; + #endif + #if !MANUALWIND_ON + d.texcoord0.x = fmod(abs(lerp(d.texcoord0.x, d.texcoord0.x + (_GrassWind * 0.01 * windOffset), uvRect.y)), 1); + #else + d.texcoord0.x = fmod(abs(lerp(d.texcoord0.x, d.texcoord0.x + (_GrassWind * 0.01 * _GrassManualAnim), uvRect.y)), 1); + windOffset = _GrassManualAnim; + #endif + half2 delta = d.texcoord0.xy - windCenter; + half delta2 = dot(delta.xy, delta.xy); + half2 delta_offset = delta2 * windOffset; + d.texcoord0.xy = d.texcoord0.xy + half2(delta.y, -delta.x) * delta_offset * _GrassRadialBend; + #endif + + //-------------------------------------------------------- + + //TEXTURESCROLL_ON && !ATLAS_ON + #if TEXTURESCROLL_ON && !ATLAS_ON + d.texcoord0.x += ((_Time.y + randomSeed) * _TextureScrollXSpeed) % 1; + d.texcoord0.y += ((_Time.y + randomSeed) * _TextureScrollYSpeed) % 1; + #endif + //------------------------------ + + //PIXELATE_ON + #if PIXELATE_ON + half aspectRatio = _MainTex_TexelSize.x / _MainTex_TexelSize.y; + half2 pixelSize = float2(_PixelateSize, _PixelateSize * aspectRatio); + d.texcoord0.xy = floor(d.texcoord0.xy * pixelSize) / pixelSize; + #endif + //-------------- + + half4 col = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy); + half originalAlpha = col.a; + col *= d.vertexColor; + + //NORMAL MAP + #if NORMALMAP_ON + half4 normalSample = SAMPLE_TEXTURE2D(_NormalMap, sampler_NormalMap, d.texcoord0.xy); + half3 normalTS = UnpackNormal(normalSample); + normalTS.xy *= _NormalStrength; + o.Normal = normalTS; + #endif + + + //GLITCH_ON + #if GLITCH_ON + half2 uvGlitch = uvRect; + uvGlitch.y -= 0.5; + half lineNoise = pow(rand2(floor(uvGlitch * half2(24., 19.) * _GlitchSize) * 4.0, randomSeed), 3.0) * _GlitchAmount + * pow(rand2(floor(uvGlitch * half2(38., 14.) * _GlitchSize) * 4.0, randomSeed), 3.0); + col = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(lineNoise * 0.02 * rand2(half2(2.0, 1), randomSeed), 0)) * d.vertexColor; + #endif + //-------------------------------------- + + //CHROMABERR_ON + #if CHROMABERR_ON + half4 r = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(_ChromAberrAmount/10, 0)) * d.vertexColor; + half4 b = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(-_ChromAberrAmount/10, 0)) * d.vertexColor; + col = half4(r.r * r.a, col.g, b.b * b.a, max(max(r.a, b.a) * _ChromAberrAlpha, col.a)); + #endif + + //-------------------------------- + + //BLUR_ON + #if BLUR_ON + #if ATLAS_ON + #if !BLURISHD_ON + col = BlurHD(d.texcoord0.xy, _MainTex, sampler_MainTex, _BlurIntensity, (_MaxXUV - _MinXUV), (_MaxYUV - _MinYUV)) * d.vertexColor; + #else + col = Blur(d.texcoord0.xy, _MainTex, sampler_MainTex, _BlurIntensity * (_MaxXUV - _MinXUV)) * d.vertexColor; + #endif + #else + #if !BLURISHD_ON + col = BlurHD(d.texcoord0.xy, _MainTex, sampler_MainTex, _BlurIntensity, 1, 1) * d.vertexColor; + #else + col = Blur(d.texcoord0.xy, _MainTex, sampler_MainTex, _BlurIntensity) * d.vertexColor; + #endif + #endif + #endif + + //-------------------- + + //MOTIONBLUR_ON + #if MOTIONBLUR_ON + _MotionBlurAngle = _MotionBlurAngle * 3.1415926; + #define rot(n) mul(n, half2x2(cos(_MotionBlurAngle), -sin(_MotionBlurAngle), sin(_MotionBlurAngle), cos(_MotionBlurAngle))) + _MotionBlurDist = _MotionBlurDist * 0.005; + #if ATLAS_ON + _MotionBlurDist *= (_MaxXUV - _MinXUV); + #endif + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(-_MotionBlurDist, -_MotionBlurDist))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(-_MotionBlurDist * 2, -_MotionBlurDist * 2))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(-_MotionBlurDist * 3, -_MotionBlurDist * 3))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(-_MotionBlurDist * 4, -_MotionBlurDist * 4))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(_MotionBlurDist, _MotionBlurDist))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(_MotionBlurDist * 2, _MotionBlurDist * 2))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(_MotionBlurDist * 3, _MotionBlurDist * 3))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(_MotionBlurDist * 4, _MotionBlurDist * 4))); + col.rgb = col.rgb / 9; + #endif + //------------------------------------ + + //NEGATIVE_ON + #if NEGATIVE_ON + col.rgb = lerp(col.rgb, 1 - col.rgb, _NegativeAmount); + #endif + + //-------------- + half luminance = 0; + + //GREYSCALE_ON && !GREYSCALEOUTLINE_ON + #if GREYSCALE_ON && !GREYSCALEOUTLINE_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + luminance = saturate(luminance + _GreyscaleLuminosity); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _GreyscaleTintColor, _GreyscaleBlend); + #endif + //------------------------------------ + + //GHOST_ON + #if GHOST_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + half4 ghostResult; + ghostResult.a = saturate(luminance - _GhostTransparency) * col.a; + ghostResult.rgb = col.rgb * (luminance + _GhostColorBoost); + col = lerp(col, ghostResult, _GhostBlend); + #endif + //------------------------------------ + + //INNEROUTLINE_ON + #if INNEROUTLINE_ON + half3 innerT = abs(GetPixel(0, _InnerOutlineThickness, d.texcoord0.xy, _MainTex, sampler_MainTex) - GetPixel(0, -_InnerOutlineThickness, d.texcoord0.xy, _MainTex, sampler_MainTex)); + innerT += abs(GetPixel(_InnerOutlineThickness, 0, d.texcoord0.xy, _MainTex, sampler_MainTex) - GetPixel(-_InnerOutlineThickness, 0, d.texcoord0.xy, _MainTex, sampler_MainTex)); + #if !ONLYINNEROUTLINE_ON + innerT = (innerT / 2.0) * col.a * _InnerOutlineAlpha; + col.rgb += length(innerT) * _InnerOutlineColor.rgb * _InnerOutlineGlow; + #else + innerT *= col.a * _InnerOutlineAlpha; + col.rgb = length(innerT) * _InnerOutlineColor.rgb * _InnerOutlineGlow; + col.a = step(0.3, col.r+col.g+col.b); + #endif + #endif + //------------------------------------------------------- + + //HITEFFECT_ON + #if HITEFFECT_ON + col.rgb = lerp(col.rgb, _HitEffectColor.rgb * _HitEffectGlow, _HitEffectBlend); + #endif + //-------------------- + + //GRADIENT_ON + #if GRADIENT_ON + half2 tiledUvGrad = half2(uvRect.x / _MainTex_ST.x, uvRect.y / _MainTex_ST.y); + #if GRADIENT2COL_ON + _GradTopRightCol = _GradTopLeftCol; + _GradBotRightCol = _GradBotLeftCol; + #endif + #if RADIALGRADIENT_ON + half radialDist = 1 - length(tiledUvGrad - half2(0.5, 0.5)); + radialDist *= (_MainTex_TexelSize.w / _MainTex_TexelSize.z); + radialDist = saturate(_GradBoostX * radialDist); + half4 gradientResult = lerp(_GradTopLeftCol, _GradBotLeftCol, radialDist); + #else + half gradXLerpFactor = saturate(pow(tiledUvGrad.x, _GradBoostX)); + half4 gradientResult = lerp(lerp(_GradBotLeftCol, _GradBotRightCol, gradXLerpFactor), + lerp(_GradTopLeftCol, _GradTopRightCol, gradXLerpFactor), saturate(pow(tiledUvGrad.y, _GradBoostY))); + #endif + gradientResult = lerp(col, gradientResult, _GradBlend); + col.rgb = gradientResult.rgb * col.a; + col.a *= gradientResult.a; + #endif + //-------------------------------------------------------------------- + + //CONTRAST_ON + #if CONTRAST_ON + col.rgb = (col.rgb - float3(0.5, 0.5, 0.5)) * _Contrast + float3(0.5, 0.5, 0.5); + col.rgb += _Brightness; + #endif + + //------------------------------------------------------------------- + + //COLORSWAP_ON + #if COLORSWAP_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + half4 swapMask = SAMPLE_TEXTURE2D(_ColorSwapTex, sampler_ColorSwapTex, d.texcoord0.xy); + swapMask.rgb *= swapMask.a; + half3 redSwap = _ColorSwapRed * swapMask.r * saturate(luminance + _ColorSwapRedLuminosity); + half3 greenSwap = _ColorSwapGreen * swapMask.g * saturate(luminance + _ColorSwapGreenLuminosity); + half3 blueSwap = _ColorSwapBlue * swapMask.b * saturate(luminance + _ColorSwapBlueLuminosity); + swapMask.rgb = col.rgb * saturate(1 - swapMask.r - swapMask.g - swapMask.b); + col.rgb = lerp(col.rgb, swapMask.rgb + redSwap + greenSwap + blueSwap, _ColorSwapBlend); + #endif + //-------------------------------------------------------------------- + + //COLORRAMP_ON && !COLORRAMPOUTLINE_ON + #if COLORRAMP_ON && !COLORRAMPOUTLINE_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + luminance = saturate(luminance + _ColorRampLuminosity); + #if GRADIENTCOLORRAMP_ON + col.rgb = lerp(col.rgb, SAMPLE_TEXTURE2D(_ColorRampTexGradient, sampler_ColorRampTexGradient, half2(luminance, 0)).rgb, _ColorRampBlend); + #else + col.rgb = lerp(col.rgb, SAMPLE_TEXTURE2D(_ColorRampTex, sampler_ColorRampTex, half2(luminance, 0)).rgb, _ColorRampBlend); + #endif + #endif + //-------------------------------------------------------------------- + + //CHANGECOLOR_ON + #if CHANGECOLOR_ON + float3 currChangeColor = saturate(col.rgb); + luminance = 0.3 * currChangeColor.r + 0.59 * currChangeColor.g + 0.11 * currChangeColor.b; + luminance = saturate(luminance + _ColorChangeLuminosity); + half3 dif = abs(currChangeColor - _ColorChangeTarget.rgb); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _ColorChangeNewCol.rgb, + max(sign(1 - saturate(dif.x + dif.y + dif.z) - _ColorChangeTolerance), 0.0)); + #if CHANGECOLOR2_ON + dif = abs(currChangeColor - _ColorChangeTarget2.rgb); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _ColorChangeNewCol2.rgb, + max(sign(1 - saturate(dif.x + dif.y + dif.z) - _ColorChangeTolerance2), 0.0)); + #endif + #if CHANGECOLOR3_ON + dif = abs(currChangeColor - _ColorChangeTarget3.rgb); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _ColorChangeNewCol3.rgb, + max(sign(1 - saturate(dif.x + dif.y + dif.z) - _ColorChangeTolerance3), 0.0)); + #endif + #endif + //------------------------------------------------------- + + //POSTERIZE_ON && !POSTERIZEOUTLINE_ON + #if POSTERIZE_ON && !POSTERIZEOUTLINE_ON + col.rgb = pow(col.rgb, _PosterizeGamma) * _PosterizeNumColors; + col.rgb = floor(col.rgb) / _PosterizeNumColors; + col.rgb = pow(col.rgb, 1.0 / _PosterizeGamma); + #endif + //------------------------------------ + + //HSV_ON + #if HSV_ON + half3 resultHsv = half3(col.rgb); + half cosHsv = _HsvBright * _HsvSaturation * cos(_HsvShift * 3.14159265 / 180); + half sinHsv = _HsvBright * _HsvSaturation * sin(_HsvShift * 3.14159265 / 180); + resultHsv.x = (.299 * _HsvBright + .701 * cosHsv + .168 * sinHsv) * col.x + + (.587 * _HsvBright - .587 * cosHsv + .330 * sinHsv) * col.y + + (.114 * _HsvBright - .114 * cosHsv - .497 * sinHsv) * col.z; + resultHsv.y = (.299 * _HsvBright - .299 * cosHsv - .328 * sinHsv) *col.x + + (.587 * _HsvBright + .413 * cosHsv + .035 * sinHsv) * col.y + + (.114 * _HsvBright - .114 * cosHsv + .292 * sinHsv) * col.z; + resultHsv.z = (.299 * _HsvBright - .3 * cosHsv + 1.25 * sinHsv) * col.x + + (.587 * _HsvBright - .588 * cosHsv - 1.05 * sinHsv) * col.y + + (.114 * _HsvBright + .886 * cosHsv - .203 * sinHsv) * col.z; + col.rgb = resultHsv; + #endif + //------------------------------------------------------- + + //OVERLAY_ON + #if OVERLAY_ON + half2 overlayUvs = d.texcoord0.xy; + overlayUvs.x += ((_Time.y + randomSeed) * _OverlayTextureScrollXSpeed) % 1; + overlayUvs.y += ((_Time.y + randomSeed) * _OverlayTextureScrollYSpeed) % 1; + half4 overlayCol = SAMPLE_TEXTURE2D(_OverlayTex, sampler_OverlayTex, TRANSFORM_TEX(overlayUvs, _OverlayTex)); + overlayCol.rgb *= _OverlayColor.rgb * _OverlayGlow; + #if !OVERLAYMULT_ON + overlayCol.rgb *= overlayCol.a * _OverlayColor.rgb * _OverlayColor.a * _OverlayBlend; + col.rgb += overlayCol.rgb; + #else + overlayCol.a *= _OverlayColor.a; + col = lerp(col, col * overlayCol, _OverlayBlend); + #endif + #endif + + //--------------------------------- + + //OUTBASE_ON + #if OUTBASE_ON + #if OUTBASEPIXELPERF_ON + half2 destUv = half2(_OutlinePixelWidth * _MainTex_TexelSize.x, _OutlinePixelWidth * _MainTex_TexelSize.y); + #else + half2 destUv = half2(_OutlineWidth * _MainTex_TexelSize.x * 200, _OutlineWidth * _MainTex_TexelSize.y * 200); + #endif + + #if OUTDIST_ON + d.texcoord3.x += ((_Time.x + _RandomSeed) * _OutlineDistortTexXSpeed) % 1; + d.texcoord3.y += ((_Time.x + _RandomSeed) * _OutlineDistortTexYSpeed) % 1; + #if ATLAS_ON + d.texcoord3 = half2((d.texcoord3.x - _MinXUV) / (_MaxXUV - _MinXUV), (d.texcoord3.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half outDistortAmnt = (SAMPLE_TEXTURE2D(_OutlineDistortTex, sampler_OutlineDistortTex, d.texcoord3).r - 0.5) * 0.2 * _OutlineDistortAmount; + destUv.x += outDistortAmnt; + destUv.y += outDistortAmnt; + #endif + + half spriteLeft = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(destUv.x, 0)).a; + half spriteRight = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy - half2(destUv.x, 0)).a; + half spriteBottom = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(0, destUv.y)).a; + half spriteTop = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy - half2(0, destUv.y)).a; + half result = spriteLeft + spriteRight + spriteBottom + spriteTop; + + #if OUTBASE8DIR_ON + half spriteTopLeft = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(destUv.x, destUv.y)).a; + half spriteTopRight = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(-destUv.x, destUv.y)).a; + half spriteBotLeft = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(destUv.x, -destUv.y)).a; + half spriteBotRight = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(-destUv.x, -destUv.y)).a; + result = result + spriteTopLeft + spriteTopRight + spriteBotLeft + spriteBotRight; + #endif + + result = step(0.05, saturate(result)); + + #if OUTTEX_ON + d.texcoord1.x += ((_Time.x + _RandomSeed) * _OutlineTexXSpeed) % 1; + d.texcoord1.y += ((_Time.x + _RandomSeed) * _OutlineTexYSpeed) % 1; + #if ATLAS_ON + d.texcoord1 = half2((d.texcoord1.x - _MinXUV) / (_MaxXUV - _MinXUV), (d.texcoord1.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half4 tempOutColor = SAMPLE_TEXTURE2D(_OutlineTex, sampler_OutlineTex, d.texcoord1); + tempOutColor *= _OutlineColor; + _OutlineColor = tempOutColor; + #endif + + result *= (1 - originalAlpha) * _OutlineAlpha; + + half4 outline = _OutlineColor * d.vertexColor.a; + outline.rgb *= _OutlineGlow; + outline.a = result; + #if ONLYOUTLINE_ON + col = outline; + #else + col = lerp(col, outline, result); + #endif + #endif + //------------------------------------------------------- + + //FADE_ON + #if FADE_ON + half2 tiledUvFade1 = TRANSFORM_TEX(d.texcoord0, _FadeTex); + half2 tiledUvFade2 = TRANSFORM_TEX(d.texcoord0, _FadeBurnTex); + #if ATLAS_ON + tiledUvFade1 = half2((tiledUvFade1.x - _MinXUV) / (_MaxXUV - _MinXUV), (tiledUvFade1.y - _MinYUV) / (_MaxYUV - _MinYUV)); + tiledUvFade2 = half2((tiledUvFade2.x - _MinXUV) / (_MaxXUV - _MinXUV), (tiledUvFade2.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half fadeTemp = SAMPLE_TEXTURE2D(_FadeTex, sampler_FadeTex, tiledUvFade1).r; + half fade = smoothstep(_FadeAmount, _FadeAmount + _FadeBurnTransition, fadeTemp); + half fadeBurn = saturate(smoothstep(_FadeAmount - _FadeBurnWidth, _FadeAmount - _FadeBurnWidth + 0.1, fadeTemp) * _FadeAmount); + col.a *= fade; + _FadeBurnColor.rgb *= _FadeBurnGlow; + col += fadeBurn * SAMPLE_TEXTURE2D(_FadeBurnTex, sampler_FadeBurnTex, tiledUvFade2) * _FadeBurnColor * originalAlpha * (1 - col.a); + #endif + //------------------------------------------------------- + + //SHADOW_ON + #if SHADOW_ON + half shadowA = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(_ShadowX, _ShadowY)).a; + half preMultShadowMask = 1 - (saturate(shadowA - col.a) * (1 - col.a)); + col.rgb *= 1 - ((shadowA - col.a) * (1 - col.a)); + col.rgb += (_ShadowColor * shadowA) * (1 - col.a); + col.a = max(shadowA * _ShadowAlpha * d.vertexColor.a, col.a); + #endif + + //------------------------------------------------------- + + //GLOW_ON + #if GLOW_ON + half4 emission; + #if GLOWTEX_ON + emission = SAMPLE_TEXTURE2D(_GlowTex, sampler_GlowTex, d.texcoord0); + #else + emission = col; + #endif + + col.rgb *= _GlowGlobal; + emission.rgb *= emission.a * col.a * _Glow * _GlowColor; + col.rgb += emission.rgb; + #endif + //------------------------------------------------------- + + //COLORRAMP_ON && COLORRAMPOUTLINE_ON + #if COLORRAMP_ON && COLORRAMPOUTLINE_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + luminance = saturate(luminance + _ColorRampLuminosity); + #if GRADIENTCOLORRAMP_ON + col.rgb = lerp(col.rgb, SAMPLE_TEXTURE2D(_ColorRampTexGradient, sampler_ColorRampTexGradient, half2(luminance, 0)).rgb, _ColorRampBlend); + #else + col.rgb = lerp(col.rgb, SAMPLE_TEXTURE2D(_ColorRampTex, sampler_ColorRampTex, half2(luminance, 0)).rgb, _ColorRampBlend); + #endif + #endif + //--------------- + + //GREYSCALE_ON && GREYSCALEOUTLINE_ON + #if GREYSCALE_ON && GREYSCALEOUTLINE_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + luminance = saturate(luminance + _GreyscaleLuminosity); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _GreyscaleTintColor, _GreyscaleBlend); + #endif + + //----------------------------------- + + //POSTERIZE_ON && POSTERIZEOUTLINE_ON + #if POSTERIZE_ON && POSTERIZEOUTLINE_ON + col.rgb = pow(col.rgb, _PosterizeGamma) * _PosterizeNumColors; + col.rgb = floor(col.rgb) / _PosterizeNumColors; + col.rgb = pow(col.rgb, 1.0 / _PosterizeGamma); + #endif + + //----------------------------------- + + //SHINE_ON + #if SHINE_ON + half2 uvShine = uvRect; + half cosAngle = cos(_ShineRotate); + half sinAngle = sin(_ShineRotate); + half2x2 rot = half2x2(cosAngle, -sinAngle, sinAngle, cosAngle); + uvShine -= half2(0.5, 0.5); + uvShine = mul(rot, uvShine); + uvShine += half2(0.5, 0.5); + half shineMask = SAMPLE_TEXTURE2D(_ShineMask, sampler_ShineMask, d.texcoord0.xy).a; + half currentDistanceProjection = (uvShine.x + uvShine.y) / 2; + half whitePower = 1 - (abs(currentDistanceProjection - _ShineLocation) / _ShineWidth); + col.rgb += col.a * whitePower * _ShineGlow * max(sign(currentDistanceProjection - (_ShineLocation - _ShineWidth)), 0.0) + * max(sign((_ShineLocation + _ShineWidth) - currentDistanceProjection), 0.0) * _ShineColor * shineMask; + #endif + + //----------------------------------- + + //HOLOGRAM_ON + #if HOLOGRAM_ON + half totalHologram = _HologramStripesAmount + _HologramUnmodAmount; + half hologramYCoord = ((uvRect.y + (((_Time.x + randomSeed) % 1) * _HologramStripesSpeed)) % totalHologram) / totalHologram; + hologramYCoord = abs(hologramYCoord); + half alpha = RemapFloat(saturate(hologramYCoord - (_HologramUnmodAmount/totalHologram)), 0.0, 1.0, _HologramMinAlpha, saturate(_HologramMaxAlpha)); + half hologramMask = max(sign((_HologramUnmodAmount/totalHologram) - hologramYCoord), 0.0); + half4 hologramResult = col; + hologramResult.a *= lerp(alpha, 1, hologramMask); + hologramResult.rgb *= max(1, _HologramMaxAlpha * max(sign(hologramYCoord - (_HologramUnmodAmount/totalHologram)), 0.0)); + hologramMask = 1 - step(0.01,hologramMask); + hologramResult.rgb += hologramMask * _HologramStripeColor * col.a; + col = lerp(col, hologramResult, _HologramBlend); + #endif + + //----------------------------------- + + //FLICKER_ON + #if FLICKER_ON + col.a *= saturate(col.a * step(frac(0.05 + (_Time.w + randomSeed) * _FlickerFreq), 1 - _FlickerPercent) + _FlickerAlpha); + #endif + //----------------------------------- + + //ALPHACUTOFF_ON + + //ALPHAROUND_ON + + //ALPHAOUTLINE_ON + #if ALPHAOUTLINE_ON + half alphaOutlineRes = pow(1 - col.a, max(_AlphaOutlinePower, 0.0001)) * step(_AlphaOutlineMinAlpha, col.a) * _AlphaOutlineBlend; + col.rgb = lerp(col.rgb, _AlphaOutlineColor.rgb * _AlphaOutlineGlow, alphaOutlineRes); + col.a = lerp(col.a, 1, alphaOutlineRes > 1); + #endif + //------------------------------------------------------- + + //FOG_ON + + //------------------ + + col *= _Color; + o.Albedo = col; + col.a *= _Alpha; + clip(col.a - _AlphaCutoffValue - 0.01); + o.Alpha = _Color.a; + } + + + + + + void ChainSurfaceFunction(inout Surface l, inout ShaderData d) + { + Ext_SurfaceFunction0(l, d); + // Ext_SurfaceFunction1(l, d); + // Ext_SurfaceFunction2(l, d); + // Ext_SurfaceFunction3(l, d); + // Ext_SurfaceFunction4(l, d); + // Ext_SurfaceFunction5(l, d); + // Ext_SurfaceFunction6(l, d); + // Ext_SurfaceFunction7(l, d); + // Ext_SurfaceFunction8(l, d); + // Ext_SurfaceFunction9(l, d); + // Ext_SurfaceFunction10(l, d); + // Ext_SurfaceFunction11(l, d); + // Ext_SurfaceFunction12(l, d); + // Ext_SurfaceFunction13(l, d); + // Ext_SurfaceFunction14(l, d); + // Ext_SurfaceFunction15(l, d); + // Ext_SurfaceFunction16(l, d); + // Ext_SurfaceFunction17(l, d); + // Ext_SurfaceFunction18(l, d); + // Ext_SurfaceFunction19(l, d); + // Ext_SurfaceFunction20(l, d); + // Ext_SurfaceFunction21(l, d); + // Ext_SurfaceFunction22(l, d); + // Ext_SurfaceFunction23(l, d); + // Ext_SurfaceFunction24(l, d); + // Ext_SurfaceFunction25(l, d); + // Ext_SurfaceFunction26(l, d); + // Ext_SurfaceFunction27(l, d); + // Ext_SurfaceFunction28(l, d); + // Ext_SurfaceFunction29(l, d); + } + +#if !_DECALSHADER + + void ChainModifyVertex(inout VertexData v, inout VertexToPixel v2p, float4 time) + { + ExtraV2F d; + + ZERO_INITIALIZE(ExtraV2F, d); + ZERO_INITIALIZE(Blackboard, d.blackboard); + // due to motion vectors in HDRP, we need to use the last + // time in certain spots. So if you are going to use _Time to adjust vertices, + // you need to use this time or motion vectors will break. + d.time = time; + + Ext_ModifyVertex0(v, d); + // Ext_ModifyVertex1(v, d); + // Ext_ModifyVertex2(v, d); + // Ext_ModifyVertex3(v, d); + // Ext_ModifyVertex4(v, d); + // Ext_ModifyVertex5(v, d); + // Ext_ModifyVertex6(v, d); + // Ext_ModifyVertex7(v, d); + // Ext_ModifyVertex8(v, d); + // Ext_ModifyVertex9(v, d); + // Ext_ModifyVertex10(v, d); + // Ext_ModifyVertex11(v, d); + // Ext_ModifyVertex12(v, d); + // Ext_ModifyVertex13(v, d); + // Ext_ModifyVertex14(v, d); + // Ext_ModifyVertex15(v, d); + // Ext_ModifyVertex16(v, d); + // Ext_ModifyVertex17(v, d); + // Ext_ModifyVertex18(v, d); + // Ext_ModifyVertex19(v, d); + // Ext_ModifyVertex20(v, d); + // Ext_ModifyVertex21(v, d); + // Ext_ModifyVertex22(v, d); + // Ext_ModifyVertex23(v, d); + // Ext_ModifyVertex24(v, d); + // Ext_ModifyVertex25(v, d); + // Ext_ModifyVertex26(v, d); + // Ext_ModifyVertex27(v, d); + // Ext_ModifyVertex28(v, d); + // Ext_ModifyVertex29(v, d); + + + // #if %EXTRAV2F0REQUIREKEY% + // v2p.extraV2F0 = d.extraV2F0; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // v2p.extraV2F1 = d.extraV2F1; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // v2p.extraV2F2 = d.extraV2F2; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // v2p.extraV2F3 = d.extraV2F3; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // v2p.extraV2F4 = d.extraV2F4; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // v2p.extraV2F5 = d.extraV2F5; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // v2p.extraV2F6 = d.extraV2F6; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // v2p.extraV2F7 = d.extraV2F7; + // #endif + } + + void ChainModifyTessellatedVertex(inout VertexData v, inout VertexToPixel v2p) + { + ExtraV2F d; + ZERO_INITIALIZE(ExtraV2F, d); + ZERO_INITIALIZE(Blackboard, d.blackboard); + + // #if %EXTRAV2F0REQUIREKEY% + // d.extraV2F0 = v2p.extraV2F0; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // d.extraV2F1 = v2p.extraV2F1; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // d.extraV2F2 = v2p.extraV2F2; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // d.extraV2F3 = v2p.extraV2F3; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // d.extraV2F4 = v2p.extraV2F4; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // d.extraV2F5 = v2p.extraV2F5; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // d.extraV2F6 = v2p.extraV2F6; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // d.extraV2F7 = v2p.extraV2F7; + // #endif + + + // Ext_ModifyTessellatedVertex0(v, d); + // Ext_ModifyTessellatedVertex1(v, d); + // Ext_ModifyTessellatedVertex2(v, d); + // Ext_ModifyTessellatedVertex3(v, d); + // Ext_ModifyTessellatedVertex4(v, d); + // Ext_ModifyTessellatedVertex5(v, d); + // Ext_ModifyTessellatedVertex6(v, d); + // Ext_ModifyTessellatedVertex7(v, d); + // Ext_ModifyTessellatedVertex8(v, d); + // Ext_ModifyTessellatedVertex9(v, d); + // Ext_ModifyTessellatedVertex10(v, d); + // Ext_ModifyTessellatedVertex11(v, d); + // Ext_ModifyTessellatedVertex12(v, d); + // Ext_ModifyTessellatedVertex13(v, d); + // Ext_ModifyTessellatedVertex14(v, d); + // Ext_ModifyTessellatedVertex15(v, d); + // Ext_ModifyTessellatedVertex16(v, d); + // Ext_ModifyTessellatedVertex17(v, d); + // Ext_ModifyTessellatedVertex18(v, d); + // Ext_ModifyTessellatedVertex19(v, d); + // Ext_ModifyTessellatedVertex20(v, d); + // Ext_ModifyTessellatedVertex21(v, d); + // Ext_ModifyTessellatedVertex22(v, d); + // Ext_ModifyTessellatedVertex23(v, d); + // Ext_ModifyTessellatedVertex24(v, d); + // Ext_ModifyTessellatedVertex25(v, d); + // Ext_ModifyTessellatedVertex26(v, d); + // Ext_ModifyTessellatedVertex27(v, d); + // Ext_ModifyTessellatedVertex28(v, d); + // Ext_ModifyTessellatedVertex29(v, d); + + // #if %EXTRAV2F0REQUIREKEY% + // v2p.extraV2F0 = d.extraV2F0; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // v2p.extraV2F1 = d.extraV2F1; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // v2p.extraV2F2 = d.extraV2F2; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // v2p.extraV2F3 = d.extraV2F3; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // v2p.extraV2F4 = d.extraV2F4; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // v2p.extraV2F5 = d.extraV2F5; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // v2p.extraV2F6 = d.extraV2F6; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // v2p.extraV2F7 = d.extraV2F7; + // #endif + } + + void ChainFinalColorForward(inout Surface l, inout ShaderData d, inout half4 color) + { + // Ext_FinalColorForward0(l, d, color); + // Ext_FinalColorForward1(l, d, color); + // Ext_FinalColorForward2(l, d, color); + // Ext_FinalColorForward3(l, d, color); + // Ext_FinalColorForward4(l, d, color); + // Ext_FinalColorForward5(l, d, color); + // Ext_FinalColorForward6(l, d, color); + // Ext_FinalColorForward7(l, d, color); + // Ext_FinalColorForward8(l, d, color); + // Ext_FinalColorForward9(l, d, color); + // Ext_FinalColorForward10(l, d, color); + // Ext_FinalColorForward11(l, d, color); + // Ext_FinalColorForward12(l, d, color); + // Ext_FinalColorForward13(l, d, color); + // Ext_FinalColorForward14(l, d, color); + // Ext_FinalColorForward15(l, d, color); + // Ext_FinalColorForward16(l, d, color); + // Ext_FinalColorForward17(l, d, color); + // Ext_FinalColorForward18(l, d, color); + // Ext_FinalColorForward19(l, d, color); + // Ext_FinalColorForward20(l, d, color); + // Ext_FinalColorForward21(l, d, color); + // Ext_FinalColorForward22(l, d, color); + // Ext_FinalColorForward23(l, d, color); + // Ext_FinalColorForward24(l, d, color); + // Ext_FinalColorForward25(l, d, color); + // Ext_FinalColorForward26(l, d, color); + // Ext_FinalColorForward27(l, d, color); + // Ext_FinalColorForward28(l, d, color); + // Ext_FinalColorForward29(l, d, color); + } + + void ChainFinalGBufferStandard(inout Surface s, inout ShaderData d, inout half4 GBuffer0, inout half4 GBuffer1, inout half4 GBuffer2, inout half4 outEmission, inout half4 outShadowMask) + { + // Ext_FinalGBufferStandard0(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard1(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard2(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard3(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard4(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard5(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard6(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard7(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard8(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard9(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard10(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard11(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard12(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard13(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard14(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard15(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard16(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard17(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard18(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard19(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard20(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard21(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard22(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard23(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard24(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard25(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard26(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard27(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard28(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard29(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + } +#endif + + + + + +#if _DECALSHADER + + ShaderData CreateShaderData(SurfaceDescriptionInputs IN) + { + ShaderData d = (ShaderData)0; + d.TBNMatrix = float3x3(IN.WorldSpaceTangent, IN.WorldSpaceBiTangent, IN.WorldSpaceNormal); + d.worldSpaceNormal = IN.WorldSpaceNormal; + d.worldSpaceTangent = IN.WorldSpaceTangent; + + d.worldSpacePosition = IN.WorldSpacePosition; + d.texcoord0 = IN.uv0.xyxy; + d.screenPos = IN.ScreenPosition; + + d.worldSpaceViewDir = normalize(_WorldSpaceCameraPos - d.worldSpacePosition); + + d.tangentSpaceViewDir = mul(d.TBNMatrix, d.worldSpaceViewDir); + + // these rarely get used, so we back transform them. Usually will be stripped. + #if _HDRP + // d.localSpacePosition = mul(GetWorldToObjectMatrix(), float4(GetCameraRelativePositionWS(d.worldSpacePosition), 1)).xyz; + #else + // d.localSpacePosition = mul(GetWorldToObjectMatrix(), float4(d.worldSpacePosition, 1)).xyz; + #endif + // d.localSpaceNormal = normalize(mul((float3x3)GetWorldToObjectMatrix(), d.worldSpaceNormal)); + // d.localSpaceTangent = normalize(mul((float3x3)GetWorldToObjectMatrix(), d.worldSpaceTangent.xyz)); + + // #if %SCREENPOSREQUIREKEY% + // d.screenUV = (IN.ScreenPosition.xy / max(0.01, IN.ScreenPosition.w)); + // #endif + + return d; + } +#else + + ShaderData CreateShaderData(VertexToPixel i + #if NEED_FACING + , bool facing + #endif + ) + { + ShaderData d = (ShaderData)0; + d.clipPos = i.pos; + d.worldSpacePosition = i.worldPos; + + d.worldSpaceNormal = normalize(i.worldNormal); + d.worldSpaceTangent.xyz = normalize(i.worldTangent.xyz); + + d.tangentSign = i.worldTangent.w * unity_WorldTransformParams.w; + float3 bitangent = cross(d.worldSpaceTangent.xyz, d.worldSpaceNormal) * d.tangentSign; + + d.TBNMatrix = float3x3(d.worldSpaceTangent, -bitangent, d.worldSpaceNormal); + d.worldSpaceViewDir = normalize(_WorldSpaceCameraPos - i.worldPos); + + d.tangentSpaceViewDir = mul(d.TBNMatrix, d.worldSpaceViewDir); + d.texcoord0 = i.texcoord0; + d.texcoord1 = i.texcoord1; + d.texcoord2 = i.texcoord2; + + // #if %TEXCOORD3REQUIREKEY% + d.texcoord3 = i.texcoord3; + // #endif + + // d.isFrontFace = facing; + // #if %VERTEXCOLORREQUIREKEY% + d.vertexColor = i.vertexColor; + // #endif + + // these rarely get used, so we back transform them. Usually will be stripped. + #if _HDRP + // d.localSpacePosition = mul(GetWorldToObjectMatrix(), float4(GetCameraRelativePositionWS(i.worldPos), 1)).xyz; + #else + // d.localSpacePosition = mul(GetWorldToObjectMatrix(), float4(i.worldPos, 1)).xyz; + #endif + // d.localSpaceNormal = normalize(mul((float3x3)GetWorldToObjectMatrix(), i.worldNormal)); + // d.localSpaceTangent = normalize(mul((float3x3)GetWorldToObjectMatrix(), i.worldTangent.xyz)); + + // #if %SCREENPOSREQUIREKEY% + // d.screenPos = i.screenPos; + // d.screenUV = (i.screenPos.xy / i.screenPos.w); + // #endif + + + // #if %EXTRAV2F0REQUIREKEY% + // d.extraV2F0 = i.extraV2F0; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // d.extraV2F1 = i.extraV2F1; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // d.extraV2F2 = i.extraV2F2; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // d.extraV2F3 = i.extraV2F3; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // d.extraV2F4 = i.extraV2F4; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // d.extraV2F5 = i.extraV2F5; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // d.extraV2F6 = i.extraV2F6; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // d.extraV2F7 = i.extraV2F7; + // #endif + + return d; + } + +#endif + + + +#if (SHADERPASS == SHADERPASS_LIGHT_TRANSPORT) + + // This was not in constant buffer in original unity, so keep outiside. But should be in as ShaderRenderPass frequency + float unity_OneOverOutputBoost; + float unity_MaxOutputValue; + + CBUFFER_START(UnityMetaPass) + // x = use uv1 as raster position + // y = use uv2 as raster position + bool4 unity_MetaVertexControl; + + // x = return albedo + // y = return normal + bool4 unity_MetaFragmentControl; + CBUFFER_END + + VertexToPixel Vert(VertexData inputMesh) + { + VertexToPixel output; + ZERO_INITIALIZE(VertexToPixel, output); + UNITY_SETUP_INSTANCE_ID(inputMesh); + UNITY_TRANSFER_INSTANCE_ID(inputMesh, output); + UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(output); + + // Output UV coordinate in vertex shader + float2 uv = float2(0.0, 0.0); + + if (unity_MetaVertexControl.x) + { + uv = inputMesh.texcoord1.xy * unity_LightmapST.xy + unity_LightmapST.zw; + } + else if (unity_MetaVertexControl.y) + { + uv = inputMesh.texcoord2.xy * unity_DynamicLightmapST.xy + unity_DynamicLightmapST.zw; + } + + // OpenGL right now needs to actually use the incoming vertex position + // so we create a fake dependency on it here that haven't any impact. + output.pos = float4(uv * 2.0 - 1.0, inputMesh.vertex.z > 0 ? 1.0e-4 : 0.0, 1.0); + + output.worldPos = TransformObjectToWorld(inputMesh.vertex.xyz).xyz; + + // Normal is required for triplanar mapping + output.worldNormal = TransformObjectToWorldNormal(inputMesh.normal); + // Not required but assign to silent compiler warning + output.worldTangent = float4(1.0, 0.0, 0.0, 0.0); + + output.texcoord0 = inputMesh.texcoord0; + output.texcoord1 = inputMesh.texcoord1; + output.texcoord2 = inputMesh.texcoord2; + // #if %TEXCOORD3REQUIREKEY% + output.texcoord3 = inputMesh.texcoord3; + // #endif + // #if %VERTEXCOLORREQUIREKEY% + output.vertexColor = inputMesh.vertexColor; + // #endif + + return output; + } +#else + + #if (_PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR))) + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/ShaderVariablesMatrixDefsHDCamera.hlsl" + + void MotionVectorPositionZBias(VertexToPixel input) + { + #if UNITY_REVERSED_Z + input.pos.z -= unity_MotionVectorsParams.z * input.pos.w; + #else + input.pos.z += unity_MotionVectorsParams.z * input.pos.w; + #endif + } + + #endif + + VertexToPixel Vert(VertexData input) + { + VertexToPixel output; + ZERO_INITIALIZE(VertexToPixel, output); + + UNITY_SETUP_INSTANCE_ID(input); + UNITY_TRANSFER_INSTANCE_ID(input, output); + UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(output); + + #if _HDRP && (_PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR))) + VertexData previousMesh = input; + #endif + + ChainModifyVertex(input, output, _Time); + + // This return the camera relative position (if enable) + float3 positionRWS = TransformObjectToWorld(input.vertex.xyz); + float3 normalWS = TransformObjectToWorldNormal(input.normal); + float4 tangentWS = float4(TransformObjectToWorldDir(input.tangent.xyz), input.tangent.w); + + + output.worldPos = GetAbsolutePositionWS(positionRWS); + output.pos = TransformWorldToHClip(positionRWS); + output.worldNormal = normalWS; + output.worldTangent = tangentWS; + + + output.texcoord0 = input.texcoord0; + output.texcoord1 = input.texcoord1; + output.texcoord2 = input.texcoord2; + + // #if %TEXCOORD3REQUIREKEY% + output.texcoord3 = input.texcoord3; + // #endif + + // #if %VERTEXCOLORREQUIREKEY% + output.vertexColor = input.vertexColor; + // #endif + + // #if %SCREENPOSREQUIREKEY% + // output.screenPos = ComputeScreenPos(output.pos, _ProjectionParams.x); + // #endif + + #if _HDRP && (_PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR))) + + #if !defined(TESSELLATION_ON) + MotionVectorPositionZBias(output); + #endif + + output.motionVectorCS = mul(UNITY_MATRIX_UNJITTERED_VP, float4(positionRWS.xyz, 1.0)); + // Note: unity_MotionVectorsParams.y is 0 is forceNoMotion is enabled + bool forceNoMotion = unity_MotionVectorsParams.y == 0.0; + if (forceNoMotion) + { + output.previousPositionCS = float4(0.0, 0.0, 0.0, 1.0); + } + else + { + bool hasDeformation = unity_MotionVectorsParams.x > 0.0; // Skin or morph target + + float3 effectivePositionOS = (hasDeformation ? previousMesh.previousPositionOS : previousMesh.vertex.xyz); + #if defined(_ADD_PRECOMPUTED_VELOCITY) + effectivePositionOS -= input.precomputedVelocity; + #endif + + previousMesh.vertex = float4(effectivePositionOS, 1); + VertexToPixel dummy = (VertexToPixel)0; + + + ChainModifyVertex(previousMesh, dummy, _LastTimeParameters); + + // we might need this for skinned objects? + //float3 normalWS = TransformPreviousObjectToWorldNormal(input.normal).xyz; + float3 previousPositionRWS = TransformPreviousObjectToWorld(previousMesh.vertex.xyz); + + #ifdef _WRITE_TRANSPARENT_MOTION_VECTOR + if (_TransparentCameraOnlyMotionVectors > 0) + { + previousPositionRWS = positionRWS.xyz; + } + #endif // _WRITE_TRANSPARENT_MOTION_VECTOR + + output.previousPositionCS = mul(UNITY_MATRIX_PREV_VP, float4(previousPositionRWS, 1.0)); + } + #endif // _HDRP && _PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR)) + + + return output; + } + + +#endif + + + + + + + + #if defined(WRITE_DECAL_BUFFER) && !defined(_DISABLE_DECALS) + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/Decal/DecalPrepassBuffer.hlsl" + #endif + + FragInputs BuildFragInputs(VertexToPixel input) + { + UNITY_SETUP_INSTANCE_ID(input); + FragInputs output; + ZERO_INITIALIZE(FragInputs, output); + + // Init to some default value to make the computer quiet (else it output 'divide by zero' warning even if value is not used). + // TODO: this is a really poor workaround, but the variable is used in a bunch of places + // to compute normals which are then passed on elsewhere to compute other values... + output.tangentToWorld = k_identity3x3; + output.positionSS = input.pos; // input.positionCS is SV_Position + // BETTER SHADERS: because we transform world position into actual world space for things like + // triplanar, etc, we have to back transform it here for lighting + output.positionRWS = GetCameraRelativePositionWS(input.worldPos); + output.tangentToWorld = BuildTangentToWorld(input.worldTangent, input.worldNormal); + output.texCoord0 = input.texcoord0; + output.texCoord1 = input.texcoord1; + output.texCoord2 = input.texcoord2; + + return output; + } + + void BuildSurfaceData(FragInputs fragInputs, inout Surface surfaceDescription, float3 V, PositionInputs posInput, out SurfaceData surfaceData, out float3 bentNormalWS) + { + // setup defaults -- these are used if the graph doesn't output a value + ZERO_INITIALIZE(SurfaceData, surfaceData); + + // specularOcclusion need to be init ahead of decal to quiet the compiler that modify the SurfaceData struct + // however specularOcclusion can come from the graph, so need to be init here so it can be override. + surfaceData.specularOcclusion = 1.0; + + // copy across graph values, if defined + surfaceData.baseColor = surfaceDescription.Albedo; + surfaceData.perceptualSmoothness = surfaceDescription.Smoothness; + surfaceData.ambientOcclusion = surfaceDescription.Occlusion; + surfaceData.specularOcclusion = surfaceDescription.SpecularOcclusion; + surfaceData.metallic = surfaceDescription.Metallic; + surfaceData.subsurfaceMask = surfaceDescription.SubsurfaceMask; + surfaceData.thickness = surfaceDescription.Thickness; + surfaceData.diffusionProfileHash = asuint(surfaceDescription.DiffusionProfileHash); + #if _USESPECULAR + surfaceData.specularColor = surfaceDescription.Specular; + #endif + surfaceData.coatMask = surfaceDescription.CoatMask; + surfaceData.anisotropy = surfaceDescription.Anisotropy; + surfaceData.iridescenceMask = surfaceDescription.IridescenceMask; + surfaceData.iridescenceThickness = surfaceDescription.IridescenceThickness; + + + + #if defined(_REFRACTION_PLANE) || defined(_REFRACTION_SPHERE) || defined(_REFRACTION_THIN) + if (_EnableSSRefraction) + { + surfaceData.transmittanceMask = (1.0 - surfaceDescription.Alpha); + surfaceDescription.Alpha = 1.0; + } + else + { + surfaceData.ior = surfaceDescription.ior; + surfaceData.transmittanceColor = surfaceDescription.transmittanceColor; + surfaceData.atDistance = surfaceDescription.atDistance; + surfaceData.transmittanceMask = surfaceDescription.transmittanceMask; + surfaceDescription.Alpha = 1.0; + } + #else + surfaceData.ior = 1.0; + surfaceData.transmittanceColor = float3(1.0, 1.0, 1.0); + surfaceData.atDistance = 1.0; + surfaceData.transmittanceMask = 0.0; + #endif + + + + // These static material feature allow compile time optimization + surfaceData.materialFeatures = MATERIALFEATUREFLAGS_LIT_STANDARD; + #ifdef _MATERIAL_FEATURE_SUBSURFACE_SCATTERING + surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_SUBSURFACE_SCATTERING; + #endif + + #ifdef _MATERIAL_FEATURE_TRANSMISSION + surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_TRANSMISSION; + #endif + + #ifdef _MATERIAL_FEATURE_ANISOTROPY + surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_ANISOTROPY; + surfaceData.normalWS = float3(0, 1, 0); + #endif + + #ifdef _MATERIAL_FEATURE_IRIDESCENCE + surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_IRIDESCENCE; + #endif + + #ifdef _MATERIAL_FEATURE_SPECULAR_COLOR + surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_SPECULAR_COLOR; + #endif + + #if defined(_MATERIAL_FEATURE_CLEAR_COAT) || _CLEARCOAT + surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_CLEAR_COAT; + #endif + + #if defined (_MATERIAL_FEATURE_SPECULAR_COLOR) && defined (_ENERGY_CONSERVING_SPECULAR) + // Require to have setup baseColor + // Reproduce the energy conservation done in legacy Unity. Not ideal but better for compatibility and users can unchek it + surfaceData.baseColor *= (1.0 - Max3(surfaceData.specularColor.r, surfaceData.specularColor.g, surfaceData.specularColor.b)); + #endif + + + + // compute world space normal + #if !_WORLDSPACENORMAL + surfaceData.normalWS = mul(surfaceDescription.Normal, fragInputs.tangentToWorld); + #else + surfaceData.normalWS = surfaceDescription.Normal; + #endif + + surfaceData.geomNormalWS = fragInputs.tangentToWorld[2]; + + surfaceData.tangentWS = normalize(fragInputs.tangentToWorld[0].xyz); // The tangent is not normalize in tangentToWorld for mikkt. TODO: Check if it expected that we normalize with Morten. Tag: SURFACE_GRADIENT + + + #if HAVE_DECALS + if (_EnableDecals) + { + float alpha = 1.0; + alpha = surfaceDescription.Alpha; + + // Both uses and modifies 'surfaceData.normalWS'. + DecalSurfaceData decalSurfaceData = GetDecalSurfaceData(posInput, fragInputs.tangentToWorld[2], alpha); + ApplyDecalToSurfaceData(decalSurfaceData, fragInputs.tangentToWorld[2], surfaceData); + } + #endif + + bentNormalWS = surfaceData.normalWS; + + surfaceData.tangentWS = Orthonormalize(surfaceData.tangentWS, surfaceData.normalWS); + + #ifdef DEBUG_DISPLAY + if (_DebugMipMapMode != DEBUGMIPMAPMODE_NONE) + { + // TODO: need to update mip info + surfaceData.metallic = 0; + } + + // We need to call ApplyDebugToSurfaceData after filling the surfarcedata and before filling builtinData + // as it can modify attribute use for static lighting + ApplyDebugToSurfaceData(fragInputs.tangentToWorld, surfaceData); + #endif + + // By default we use the ambient occlusion with Tri-ace trick (apply outside) for specular occlusion. + // If user provide bent normal then we process a better term + #if defined(_SPECULAR_OCCLUSION_CUSTOM) + // Just use the value passed through via the slot (not active otherwise) + #elif defined(_SPECULAR_OCCLUSION_FROM_AO_BENT_NORMAL) + // If we have bent normal and ambient occlusion, process a specular occlusion + surfaceData.specularOcclusion = GetSpecularOcclusionFromBentAO(V, bentNormalWS, surfaceData.normalWS, surfaceData.ambientOcclusion, PerceptualSmoothnessToPerceptualRoughness(surfaceData.perceptualSmoothness)); + #elif defined(_AMBIENT_OCCLUSION) && defined(_SPECULAR_OCCLUSION_FROM_AO) + surfaceData.specularOcclusion = GetSpecularOcclusionFromAmbientOcclusion(ClampNdotV(dot(surfaceData.normalWS, V)), surfaceData.ambientOcclusion, PerceptualSmoothnessToRoughness(surfaceData.perceptualSmoothness)); + #endif + + #if defined(_ENABLE_GEOMETRIC_SPECULAR_AA) && !defined(SHADER_STAGE_RAY_TRACING) + surfaceData.perceptualSmoothness = GeometricNormalFiltering(surfaceData.perceptualSmoothness, fragInputs.tangentToWorld[2], surfaceDescription.SpecularAAScreenSpaceVariance, surfaceDescription.SpecularAAThreshold); + #endif + } + + void GetSurfaceAndBuiltinData(VertexToPixel m2ps, FragInputs fragInputs, float3 V, inout PositionInputs posInput, + out SurfaceData surfaceData, out BuiltinData builtinData, inout Surface l, inout ShaderData d + #if NEED_FACING + , bool facing + #endif + ) + { + // Removed since crossfade does not work, probably needs extra material setup. + //#if !defined(SHADER_STAGE_RAY_TRACING) && !defined(_TESSELLATION_DISPLACEMENT) + // #ifdef LOD_FADE_CROSSFADE // enable dithering LOD transition if user select CrossFade transition in LOD group + // LODDitheringTransition(ComputeFadeMaskSeed(V, posInput.positionSS), unity_LODFade.x); + // #endif + //#endif + + d = CreateShaderData(m2ps + #if NEED_FACING + , facing + #endif + ); + + l = (Surface)0; + + l.Albedo = half3(0.5, 0.5, 0.5); + l.Normal = float3(0,0,1); + l.Occlusion = 1; + l.Alpha = 1; + l.SpecularOcclusion = 1; + + #if !defined(SHADER_STAGE_RAY_TRACING) && defined(_DEPTHOFFSET_ON) + l.outputDepth = d.clipPos.z; + #endif + + ChainSurfaceFunction(l, d); + + #if !defined(SHADER_STAGE_RAY_TRACING) && defined(_DEPTHOFFSET_ON) + //posInput.deviceDepth = l.outputDepth; + #endif + + #if _UNLIT + //l.Emission = l.Albedo; + //l.Albedo = 0; + l.Normal = half3(0,0,1); + l.Occlusion = 1; + l.Metallic = 0; + l.Specular = 0; + #endif + + surfaceData.geomNormalWS = d.worldSpaceNormal; + surfaceData.tangentWS = d.worldSpaceTangent; + fragInputs.tangentToWorld = d.TBNMatrix; + + float3 bentNormalWS; + BuildSurfaceData(fragInputs, l, V, posInput, surfaceData, bentNormalWS); + + + InitBuiltinData(posInput, l.Alpha, bentNormalWS, -d.worldSpaceNormal, fragInputs.texCoord1, fragInputs.texCoord2, builtinData); + + + + builtinData.emissiveColor = l.Emission; + + #if defined(_OVERRIDE_BAKEDGI) + builtinData.bakeDiffuseLighting = l.DiffuseGI; + builtinData.backBakeDiffuseLighting = l.BackDiffuseGI; + builtinData.emissiveColor += l.SpecularGI; + #endif + + #if defined(_OVERRIDE_SHADOWMASK) + builtinData.shadowMask0 = l.ShadowMask.x; + builtinData.shadowMask1 = l.ShadowMask.y; + builtinData.shadowMask2 = l.ShadowMask.z; + builtinData.shadowMask3 = l.ShadowMask.w; + #endif + + #if defined(UNITY_VIRTUAL_TEXTURING) + builtinData.vtPackedFeedback = surfaceData.VTPackedFeedback; + #endif + + #if (SHADERPASS == SHADERPASS_DISTORTION) + builtinData.distortion = surfaceData.Distortion; + builtinData.distortionBlur = surfaceData.DistortionBlur; + #endif + + #ifndef SHADER_UNLIT + // PostInitBuiltinData call ApplyDebugToBuiltinData + PostInitBuiltinData(V, posInput, surfaceData, builtinData); + #else + ApplyDebugToBuiltinData(builtinData); + #endif + + RAY_TRACING_OPTIONAL_ALPHA_TEST_PASS + } + + + float4 Frag(VertexToPixel v2f + #if NEED_FACING + , bool facing : SV_IsFrontFace + #endif + ) : SV_Target + { + FragInputs input = BuildFragInputs(v2f); + + // input.positionSS is SV_Position + PositionInputs posInput = GetPositionInput(input.positionSS.xy, _ScreenSize.zw, input.positionSS.z, input.positionSS.w, input.positionRWS); + + float3 V = GetWorldSpaceNormalizeViewDir(input.positionRWS); + + SurfaceData surfaceData; + BuiltinData builtinData; + Surface l; + ShaderData d; + GetSurfaceAndBuiltinData(v2f, input, V, posInput, surfaceData, builtinData, l, d + #if NEED_FACING + , facing + #endif + ); + + // no debug apply during light transport pass + + BSDFData bsdfData = ConvertSurfaceDataToBSDFData(input.positionSS.xy, surfaceData); + LightTransportData lightTransportData = GetLightTransportData(surfaceData, builtinData, bsdfData); + + // This shader is call two times. Once for getting emissiveColor, the other time to get diffuseColor + // We use unity_MetaFragmentControl to make the distinction. + float4 res = float4(0.0, 0.0, 0.0, 1.0); + + if (unity_MetaFragmentControl.x) + { + // Apply diffuseColor Boost from LightmapSettings. + // put abs here to silent a warning, no cost, no impact as color is assume to be positive. + res.rgb = clamp(pow(abs(lightTransportData.diffuseColor), saturate(unity_OneOverOutputBoost)), 0, unity_MaxOutputValue); + } + + if (unity_MetaFragmentControl.y) + { + // emissive use HDR format + res.rgb = lightTransportData.emissiveColor; + } + + return res; + } + + + + ENDHLSL + } + + Pass + { + // based on HDLitPass.template + Name "SceneSelectionPass" + Tags { "LightMode" = "SceneSelectionPass" } + + Cull Off + ColorMask 0 + + Tags { "RenderType" = "Opaque" "Queue" = "Geometry" "PreviewType" = "Plane" } + Cull [_CullingOption] + ZWrite [_ZWrite] + ZTest [_ZTestMode] + + + HLSLPROGRAM + + #pragma target 4.5 + #pragma only_renderers d3d11 playstation xboxone xboxseries vulkan metal switch + #pragma multi_compile_instancing + #pragma editor_sync_compilation + #pragma instancing_options renderinglayer + + //#pragma shader_feature _ _SURFACE_TYPE_TRANSPARENT + //#pragma shader_feature_local _BLENDMODE_OFF _BLENDMODE_ALPHA _BLENDMODE_ADD _BLENDMODE_PRE_MULTIPLY + //#pragma shader_feature_local _ _ADD_PRECOMPUTED_VELOCITY + //#pragma shader_feature_local _ _TRANSPARENT_WRITES_MOTION_VEC + //#pragma shader_feature_local _ _ENABLE_FOG_ON_TRANSPARENT + //#pragma shader_feature_local _ _DISABLE_DECALS + //#pragma shader_feature_local _ _DISABLE_SSR + //#pragma shader_feature_local _ _DISABLE_SSR_TRANSPARENT + //#pragma shader_feature_local _REFRACTION_OFF _REFRACTION_PLANE _REFRACTION_SPHERE _REFRACTION_THIN + + //------------------------------------------------------------------------------------- + // Variant Definitions (active field translations to HDRP defines) + //------------------------------------------------------------------------------------- + // #define _MATERIAL_FEATURE_SUBSURFACE_SCATTERING 1 + // #define _MATERIAL_FEATURE_TRANSMISSION 1 + // #define _MATERIAL_FEATURE_ANISOTROPY 1 + // #define _MATERIAL_FEATURE_IRIDESCENCE 1 + // #define _MATERIAL_FEATURE_SPECULAR_COLOR 1 + #define _ENABLE_FOG_ON_TRANSPARENT 1 + // #define _AMBIENT_OCCLUSION 1 + // #define _SPECULAR_OCCLUSION_FROM_AO 1 + // #define _SPECULAR_OCCLUSION_FROM_AO_BENT_NORMAL 1 + // #define _SPECULAR_OCCLUSION_CUSTOM 1 + // #define _ENERGY_CONSERVING_SPECULAR 1 + // #define _ENABLE_GEOMETRIC_SPECULAR_AA 1 + // #define _HAS_REFRACTION 1 + // #define _REFRACTION_PLANE 1 + // #define _REFRACTION_SPHERE 1 + // #define _DISABLE_DECALS 1 + // #define _DISABLE_SSR 1 + // #define _ADD_PRECOMPUTED_VELOCITY + // #define _WRITE_TRANSPARENT_MOTION_VECTOR 1 + // #define _DEPTHOFFSET_ON 1 + // #define _BLENDMODE_PRESERVE_SPECULAR_LIGHTING 1 + + #define SHADERPASS SHADERPASS_DEPTH_ONLY + #define RAYTRACING_SHADER_GRAPH_DEFAULT + #define SCENESELECTIONPASS + #define _PASSSCENESELECT 1 + + + #pragma shader_feature_local GLOW_ON + #pragma shader_feature_local FADE_ON + #pragma shader_feature_local OUTBASE_ON + #pragma shader_feature_local ONLYOUTLINE_ON + #pragma shader_feature_local GRADIENT_ON + #pragma shader_feature_local GRADIENT2COL_ON + #pragma shader_feature_local RADIALGRADIENT_ON + #pragma shader_feature_local COLORSWAP_ON + #pragma shader_feature_local HSV_ON + #pragma shader_feature_local CHANGECOLOR_ON + #pragma shader_feature_local CHANGECOLOR2_ON + #pragma shader_feature_local CHANGECOLOR3_ON + #pragma shader_feature_local COLORRAMP_ON + #pragma shader_feature_local GRADIENTCOLORRAMP_ON + #pragma shader_feature_local HITEFFECT_ON + #pragma shader_feature_local NEGATIVE_ON + #pragma shader_feature_local PIXELATE_ON + #pragma shader_feature_local GREYSCALE_ON + #pragma shader_feature_local POSTERIZE_ON + #pragma shader_feature_local BLUR_ON + #pragma shader_feature_local MOTIONBLUR_ON + #pragma shader_feature_local GHOST_ON + #pragma shader_feature_local ALPHAOUTLINE_ON + #pragma shader_feature_local INNEROUTLINE_ON + #pragma shader_feature_local ONLYINNEROUTLINE_ON + #pragma shader_feature_local HOLOGRAM_ON + #pragma shader_feature_local CHROMABERR_ON + #pragma shader_feature_local GLITCH_ON + #pragma shader_feature_local FLICKER_ON + #pragma shader_feature_local SHADOW_ON + #pragma shader_feature_local SHINE_ON + #pragma shader_feature_local CONTRAST_ON + #pragma shader_feature_local OVERLAY_ON + #pragma shader_feature_local OVERLAYMULT_ON + #pragma shader_feature_local DOODLE_ON + #pragma shader_feature_local WIND_ON + #pragma shader_feature_local WAVEUV_ON + #pragma shader_feature_local ROUNDWAVEUV_ON + #pragma shader_feature_local RECTSIZE_ON + #pragma shader_feature_local OFFSETUV_ON + #pragma shader_feature_local CLIPPING_ON + #pragma shader_feature_local RADIALCLIPPING_ON + #pragma shader_feature_local TEXTURESCROLL_ON + #pragma shader_feature_local ZOOMUV_ON + #pragma shader_feature_local DISTORT_ON + #pragma shader_feature_local WARP_ON + #pragma shader_feature_local TWISTUV_ON + #pragma shader_feature_local ROTATEUV_ON + #pragma shader_feature_local POLARUV_ON + #pragma shader_feature_local FISHEYE_ON + #pragma shader_feature_local PINCH_ON + #pragma shader_feature_local SHAKEUV_ON + + #pragma shader_feature_local GLOWTEX_ON + #pragma shader_feature_local OUTTEX_ON + #pragma shader_feature_local OUTDIST_ON + #pragma shader_feature_local OUTBASE8DIR_ON + #pragma shader_feature_local OUTBASEPIXELPERF_ON + #pragma shader_feature_local COLORRAMPOUTLINE_ON + #pragma shader_feature_local GREYSCALEOUTLINE_ON + #pragma shader_feature_local POSTERIZEOUTLINE_ON + #pragma shader_feature_local BLURISHD_ON + #pragma shader_feature_local MANUALWIND_ON + #pragma shader_feature_local ATLAS_ON + #pragma shader_feature_local PREMULTIPLYALPHA_ON + + #pragma shader_feature BILBOARD_ON + #pragma shader_feature BILBOARDY_ON + + #pragma shader_feature NORMALMAP_ON + + + #define _HDRP 1 +#define _USINGTEXCOORD1 1 +#define _USINGTEXCOORD2 1 + + + #pragma vertex Vert + #pragma fragment Frag + + + + + // useful conversion functions to make surface shader code just work + + #define UNITY_DECLARE_TEX2D(name) TEXTURE2D(name); SAMPLER(sampler##name); + #define UNITY_DECLARE_TEX2D_NOSAMPLER(name) TEXTURE2D(name); + #define UNITY_DECLARE_TEX2DARRAY(name) TEXTURE2D_ARRAY(name); SAMPLER(sampler##name); + #define UNITY_DECLARE_TEX2DARRAY_NOSAMPLER(tex) TEXTURE2D_ARRAY(tex); + + #define UNITY_SAMPLE_TEX2DARRAY(tex,coord) SAMPLE_TEXTURE2D_ARRAY(tex, sampler##tex, coord.xy, coord.z) + #define UNITY_SAMPLE_TEX2DARRAY_LOD(tex,coord,lod) SAMPLE_TEXTURE2D_ARRAY_LOD(tex, sampler##tex, coord.xy, coord.z, lod) + #define UNITY_SAMPLE_TEX2D(tex, coord) SAMPLE_TEXTURE2D(tex, sampler##tex, coord) + #define UNITY_SAMPLE_TEX2D_SAMPLER(tex, samp, coord) SAMPLE_TEXTURE2D(tex, sampler##samp, coord) + + #define UNITY_SAMPLE_TEX2D_LOD(tex,coord, lod) SAMPLE_TEXTURE2D_LOD(tex, sampler_##tex, coord, lod) + #define UNITY_SAMPLE_TEX2D_SAMPLER_LOD(tex,samplertex,coord, lod) SAMPLE_TEXTURE2D_LOD (tex, sampler##samplertex,coord, lod) + + #if defined(UNITY_COMPILER_HLSL) + #define UNITY_INITIALIZE_OUTPUT(type,name) name = (type)0; + #else + #define UNITY_INITIALIZE_OUTPUT(type,name) + #endif + + #define sampler2D_float sampler2D + #define sampler2D_half sampler2D + + #undef WorldNormalVector + #define WorldNormalVector(data, normal) mul(normal, data.TBNMatrix) + + #define UnityObjectToWorldNormal(normal) mul(GetObjectToWorldMatrix(), normal) + + + + +// HDRP Adapter stuff + #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Common.hlsl" + #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Texture.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/ShaderVariables.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/ShaderPass/FragInputs.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/ShaderPass/ShaderPass.cs.hlsl" + #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/TextureStack.hlsl" // Required to be include before we include properties as it define DECLARE_STACK_CB +#if UNITY_VERSION >= UNITY_2021_3_31 + #include "Packages/com.unity.shadergraph/ShaderGraphLibrary/Functions.hlsl" // Need to be here for Gradient struct definition +#else + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/ShaderGraphHeader.hlsl" +#endif + #ifdef RAYTRACING_SHADER_GRAPH_DEFAULT + #define RAYTRACING_SHADER_GRAPH_HIGH + #endif + + #ifdef RAYTRACING_SHADER_GRAPH_RAYTRACED + #define RAYTRACING_SHADER_GRAPH_LOW + #endif + // end + + + + + // If we use subsurface scattering, enable output split lighting (for forward pass) + #if defined(_MATERIAL_FEATURE_SUBSURFACE_SCATTERING) && !defined(_SURFACE_TYPE_TRANSPARENT) + #define OUTPUT_SPLIT_LIGHTING + #endif + + #define HAVE_RECURSIVE_RENDERING + + #if SHADERPASS == SHADERPASS_TRANSPARENT_DEPTH_PREPASS + #if !defined(_DISABLE_SSR_TRANSPARENT) && !defined(SHADER_UNLIT) + #define WRITE_NORMAL_BUFFER + #endif + #endif + + #ifndef DEBUG_DISPLAY + // In case of opaque we don't want to perform the alpha test, it is done in depth prepass and we use depth equal for ztest (setup from UI) + // Don't do it with debug display mode as it is possible there is no depth prepass in this case + #if !defined(_SURFACE_TYPE_TRANSPARENT) && defined(_ALPHATEST) + #if SHADERPASS == SHADERPASS_FORWARD + #define SHADERPASS_FORWARD_BYPASS_ALPHA_TEST + #elif SHADERPASS == SHADERPASS_GBUFFER + #define SHADERPASS_GBUFFER_BYPASS_ALPHA_TEST + #endif + #endif + #endif + + // Define _DEFERRED_CAPABLE_MATERIAL for shader capable to run in deferred pass + #if defined(SHADER_LIT) && !defined(_SURFACE_TYPE_TRANSPARENT) + #define _DEFERRED_CAPABLE_MATERIAL + #endif + + // Translate transparent motion vector define + #if defined(_TRANSPARENT_WRITES_MOTION_VEC) && defined(_SURFACE_TYPE_TRANSPARENT) + #define _WRITE_TRANSPARENT_MOTION_VECTOR + #endif + + + + + CBUFFER_START(UnityPerMaterial) + float _UseShadowThreshold; + float _BlendMode; + float _EnableBlendModePreserveSpecularLighting; + float _RayTracing; + float _RefractionModel; + + + half4 _Color; + half4 _MainTex_ST, _MainTex_TexelSize; + half _Alpha, _AlphaCutoffValue; + + #if ATLAS_ON + half _MinXUV, _MaxXUV, _MinYUV, _MaxYUV; + #endif + + #if GLOW_ON + half4 _GlowColor; + half _Glow, _GlowGlobal; + #endif + + #if HSV_ON + half _HsvShift, _HsvSaturation, _HsvBright; + #endif + + #if DISTORT_ON + half4 _DistortTex_ST; + half _DistortTexXSpeed, _DistortTexYSpeed, _DistortAmount; + #endif + + #if FADE_ON + half4 _FadeBurnColor, _FadeTex_ST, _FadeBurnTex_ST; + half _FadeAmount, _FadeBurnWidth, _FadeBurnTransition,_FadeBurnGlow; + #endif + + #if OUTBASE_ON + half4 _OutlineColor; + half _OutlineAlpha, _OutlineGlow, _OutlineWidth; + int _OutlinePixelWidth; + #endif + + #if OUTTEX_ON + half4 _OutlineTex_ST; + half _OutlineTexXSpeed, _OutlineTexYSpeed; + #endif + + #if OUTDIST_ON + half4 _OutlineDistortTex_ST; + half _OutlineDistortTexXSpeed, _OutlineDistortTexYSpeed, _OutlineDistortAmount; + #endif + + #if ALPHAOUTLINE_ON + half _AlphaOutlineGlow, _AlphaOutlinePower, _AlphaOutlineMinAlpha, _AlphaOutlineBlend; + half4 _AlphaOutlineColor; + #endif + + #if INNEROUTLINE_ON + half _InnerOutlineThickness, _InnerOutlineAlpha, _InnerOutlineGlow; + half4 _InnerOutlineColor; + #endif + + #if GRADIENT_ON + half _GradBlend, _GradBoostX, _GradBoostY; + half4 _GradTopRightCol, _GradTopLeftCol, _GradBotRightCol, _GradBotLeftCol; + #endif + + #if COLORSWAP_ON + half4 _ColorSwapRed, _ColorSwapGreen, _ColorSwapBlue; + half _ColorSwapRedLuminosity, _ColorSwapGreenLuminosity, _ColorSwapBlueLuminosity, _ColorSwapBlend; + #endif + + #if CHANGECOLOR_ON + half4 _ColorChangeNewCol, _ColorChangeTarget; + half _ColorChangeTolerance, _ColorChangeLuminosity; + #endif + #if CHANGECOLOR2_ON + half4 _ColorChangeNewCol2, _ColorChangeTarget2; + half _ColorChangeTolerance2; + #endif + #if CHANGECOLOR3_ON + half4 _ColorChangeNewCol3, _ColorChangeTarget3; + half _ColorChangeTolerance3; + #endif + + #if COLORRAMP_ON + half _ColorRampLuminosity, _ColorRampBlend; + #endif + + #if HITEFFECT_ON + half4 _HitEffectColor; + half _HitEffectGlow, _HitEffectBlend; + #endif + + #if NEGATIVE_ON + half _NegativeAmount; + #endif + + #if PIXELATE_ON + half _PixelateSize; + #endif + + #if GREYSCALE_ON + half _GreyscaleLuminosity, _GreyscaleBlend; + half4 _GreyscaleTintColor; + #endif + + #if POSTERIZE_ON + half _PosterizeNumColors, _PosterizeGamma; + #endif + + #if BLUR_ON + half _BlurIntensity; + #endif + + #if MOTIONBLUR_ON + half _MotionBlurAngle, _MotionBlurDist; + #endif + + #if GHOST_ON + half _GhostColorBoost, _GhostTransparency, _GhostBlend; + #endif + + #if HOLOGRAM_ON + half _HologramStripesAmount, _HologramMinAlpha, _HologramUnmodAmount, _HologramStripesSpeed, _HologramMaxAlpha, _HologramBlend; + half4 _HologramStripeColor; + #endif + + #if CHROMABERR_ON + half _ChromAberrAmount, _ChromAberrAlpha; + #endif + + #if GLITCH_ON + half _GlitchAmount, _GlitchSize; + #endif + + #if FLICKER_ON + half _FlickerFreq, _FlickerPercent, _FlickerAlpha; + #endif + + #if SHADOW_ON + half _ShadowX, _ShadowY, _ShadowAlpha; + half4 _ShadowColor; + #endif + + #if SHINE_ON + half4 _ShineColor; + half _ShineLocation, _ShineRotate, _ShineWidth, _ShineGlow; + #endif + + #if CONTRAST_ON + half _Contrast, _Brightness; + #endif + + #if OVERLAY_ON + half4 _OverlayTex_ST, _OverlayColor; + half _OverlayGlow, _OverlayBlend, _OverlayTextureScrollXSpeed, _OverlayTextureScrollYSpeed; + #endif + + #if DOODLE_ON + half _HandDrawnAmount, _HandDrawnSpeed; + #endif + + #if WIND_ON + half _GrassSpeed, _GrassWind, _GrassManualAnim, _GrassRadialBend; + #endif + + #if WAVEUV_ON + float _WaveAmount, _WaveSpeed, _WaveStrength, _WaveX, _WaveY; + #endif + + #if ROUNDWAVEUV_ON + half _RoundWaveStrength, _RoundWaveSpeed; + #endif + + #if RECTSIZE_ON + half _RectSize; + #endif + + #if OFFSETUV_ON + half _OffsetUvX, _OffsetUvY; + #endif + + #if CLIPPING_ON + half _ClipUvLeft, _ClipUvRight, _ClipUvUp, _ClipUvDown; + #endif + + #if RADIALCLIPPING_ON + half _RadialStartAngle, _RadialClip, _RadialClip2; + #endif + + #if TEXTURESCROLL_ON + half _TextureScrollXSpeed, _TextureScrollYSpeed; + #endif + + #if ZOOMUV_ON + half _ZoomUvAmount; + #endif + + #if WARP_ON + half _WarpStrength, _WarpSpeed, _WarpScale; + #endif + + #if TWISTUV_ON + half _TwistUvAmount, _TwistUvPosX, _TwistUvPosY, _TwistUvRadius; + #endif + + #if ROTATEUV_ON + half _RotateUvAmount; + #endif + + #if FISHEYE_ON + half _FishEyeUvAmount; + #endif + + #if PINCH_ON + half _PinchUvAmount; + #endif + + #if SHAKEUV_ON + half _ShakeUvSpeed, _ShakeUvX, _ShakeUvY; + #endif + + #if NORMALMAP_ON + half _NormalStrength; + #endif + + float _RandomSeed; + + + + + CBUFFER_END + + + + // -- Property used by ScenePickingPass + #ifdef SCENEPICKINGPASS + float4 _SelectionID; + #endif + + // -- Properties used by SceneSelectionPass + #ifdef SCENESELECTIONPASS + int _ObjectId; + int _PassValue; + #endif + + + // data across stages, stripped like the above. + struct VertexToPixel + { + float4 pos : SV_POSITION; + float3 worldPos : TEXCOORD0; + float3 worldNormal : TEXCOORD1; + float4 worldTangent : TEXCOORD2; + float4 texcoord0 : TEXCOORD3; + float4 texcoord1 : TEXCOORD4; + float4 texcoord2 : TEXCOORD5; + // #if %TEXCOORD3REQUIREKEY% + float4 texcoord3 : TEXCOORD6; + // #endif + + // #if %SCREENPOSREQUIREKEY% + // float4 screenPos : TEXCOORD7; + // #endif + + // #if %VERTEXCOLORREQUIREKEY% + float4 vertexColor : COLOR; + // #endif + + // #if %EXTRAV2F0REQUIREKEY% + // float4 extraV2F0 : TEXCOORD8; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // float4 extraV2F1 : TEXCOORD9; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // float4 extraV2F2 : TEXCOORD10; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // float4 extraV2F3 : TEXCOORD11; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // float4 extraV2F4 : TEXCOORD12; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // float4 extraV2F5 : TEXCOORD13; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // float4 extraV2F6 : TEXCOORD14; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // float4 extraV2F7 : TEXCOORD15; + // #endif + + #if UNITY_ANY_INSTANCING_ENABLED + UNITY_VERTEX_INPUT_INSTANCE_ID + #endif // UNITY_ANY_INSTANCING_ENABLED + + #if _HDRP && (_PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR))) + float4 previousPositionCS : TEXCOORD16; // Contain previous transform position (in case of skinning for example) + float4 motionVectorCS : TEXCOORD17; + #endif + + UNITY_VERTEX_OUTPUT_STEREO + }; + + + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Debug/DebugDisplay.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/Material.hlsl" + #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/NormalSurfaceGradient.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/Lit/Lit.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/BuiltinUtilities.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/MaterialUtilities.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/Decal/DecalUtilities.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/Lit/LitDecalData.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/ShaderGraphFunctions.hlsl" + + + + + // data describing the user output of a pixel + struct Surface + { + half3 Albedo; + half Height; + half3 Normal; + half Smoothness; + half3 Emission; + half Metallic; + half3 Specular; + half Occlusion; + half SpecularPower; // for simple lighting + half Alpha; + float outputDepth; // if written, SV_Depth semantic is used. ShaderData.clipPos.z is unused value + // HDRP Only + half SpecularOcclusion; + half SubsurfaceMask; + half Thickness; + half CoatMask; + half CoatSmoothness; + half Anisotropy; + half IridescenceMask; + half IridescenceThickness; + int DiffusionProfileHash; + float SpecularAAThreshold; + float SpecularAAScreenSpaceVariance; + // requires _OVERRIDE_BAKEDGI to be defined, but is mapped in all pipelines + float3 DiffuseGI; + float3 BackDiffuseGI; + float3 SpecularGI; + float ior; + float3 transmittanceColor; + float atDistance; + float transmittanceMask; + // requires _OVERRIDE_SHADOWMASK to be defines + float4 ShadowMask; + + // for decals + float NormalAlpha; + float MAOSAlpha; + + + }; + + // Data the user declares in blackboard blocks + struct Blackboard + { + + float blackboardDummyData; + }; + + // data the user might need, this will grow to be big. But easy to strip + struct ShaderData + { + float4 clipPos; // SV_POSITION + float3 localSpacePosition; + float3 localSpaceNormal; + float3 localSpaceTangent; + + float3 worldSpacePosition; + float3 worldSpaceNormal; + float3 worldSpaceTangent; + float tangentSign; + + float3 worldSpaceViewDir; + float3 tangentSpaceViewDir; + + float4 texcoord0; + float4 texcoord1; + float4 texcoord2; + float4 texcoord3; + + float2 screenUV; + float4 screenPos; + + float4 vertexColor; + bool isFrontFace; + + float4 extraV2F0; + float4 extraV2F1; + float4 extraV2F2; + float4 extraV2F3; + float4 extraV2F4; + float4 extraV2F5; + float4 extraV2F6; + float4 extraV2F7; + + float3x3 TBNMatrix; + Blackboard blackboard; + }; + + struct VertexData + { + #if SHADER_TARGET > 30 + // uint vertexID : SV_VertexID; + #endif + float4 vertex : POSITION; + float3 normal : NORMAL; + float4 tangent : TANGENT; + float4 texcoord0 : TEXCOORD0; + + // optimize out mesh coords when not in use by user or lighting system + #if _URP && (_USINGTEXCOORD1 || _PASSMETA || _PASSFORWARD || _PASSGBUFFER) + float4 texcoord1 : TEXCOORD1; + #endif + + #if _URP && (_USINGTEXCOORD2 || _PASSMETA || ((_PASSFORWARD || _PASSGBUFFER) && defined(DYNAMICLIGHTMAP_ON))) + float4 texcoord2 : TEXCOORD2; + #endif + + #if _STANDARD && (_USINGTEXCOORD1 || (_PASSMETA || ((_PASSFORWARD || _PASSGBUFFER || _PASSFORWARDADD) && LIGHTMAP_ON))) + float4 texcoord1 : TEXCOORD1; + #endif + #if _STANDARD && (_USINGTEXCOORD2 || (_PASSMETA || ((_PASSFORWARD || _PASSGBUFFER) && DYNAMICLIGHTMAP_ON))) + float4 texcoord2 : TEXCOORD2; + #endif + + + #if _HDRP + float4 texcoord1 : TEXCOORD1; + float4 texcoord2 : TEXCOORD2; + #endif + + // #if %TEXCOORD3REQUIREKEY% + float4 texcoord3 : TEXCOORD3; + // #endif + + // #if %VERTEXCOLORREQUIREKEY% + float4 vertexColor : COLOR; + // #endif + + #if _PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR)) + float3 previousPositionOS : TEXCOORD4; // Contain previous transform position (in case of skinning for example) + #if defined (_ADD_PRECOMPUTED_VELOCITY) + float3 precomputedVelocity : TEXCOORD5; // Add Precomputed Velocity (Alembic computes velocities on runtime side). + #endif + #endif + + UNITY_VERTEX_INPUT_INSTANCE_ID + }; + + struct TessVertex + { + float4 vertex : INTERNALTESSPOS; + float3 normal : NORMAL; + float4 tangent : TANGENT; + float4 texcoord0 : TEXCOORD0; + float4 texcoord1 : TEXCOORD1; + float4 texcoord2 : TEXCOORD2; + + // #if %TEXCOORD3REQUIREKEY% + float4 texcoord3 : TEXCOORD3; + // #endif + + // #if %VERTEXCOLORREQUIREKEY% + float4 vertexColor : COLOR; + // #endif + + // #if %EXTRAV2F0REQUIREKEY% + // float4 extraV2F0 : TEXCOORD5; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // float4 extraV2F1 : TEXCOORD6; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // float4 extraV2F2 : TEXCOORD7; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // float4 extraV2F3 : TEXCOORD8; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // float4 extraV2F4 : TEXCOORD9; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // float4 extraV2F5 : TEXCOORD10; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // float4 extraV2F6 : TEXCOORD11; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // float4 extraV2F7 : TEXCOORD12; + // #endif + + #if _PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR)) + float3 previousPositionOS : TEXCOORD13; // Contain previous transform position (in case of skinning for example) + #if defined (_ADD_PRECOMPUTED_VELOCITY) + float3 precomputedVelocity : TEXCOORD14; + #endif + #endif + + UNITY_VERTEX_INPUT_INSTANCE_ID + UNITY_VERTEX_OUTPUT_STEREO + }; + + struct ExtraV2F + { + float4 extraV2F0; + float4 extraV2F1; + float4 extraV2F2; + float4 extraV2F3; + float4 extraV2F4; + float4 extraV2F5; + float4 extraV2F6; + float4 extraV2F7; + Blackboard blackboard; + float4 time; + }; + + + float3 WorldToTangentSpace(ShaderData d, float3 normal) + { + return mul(d.TBNMatrix, normal); + } + + float3 TangentToWorldSpace(ShaderData d, float3 normal) + { + return mul(normal, d.TBNMatrix); + } + + // in this case, make standard more like SRPs, because we can't fix + // unity_WorldToObject in HDRP, since it already does macro-fu there + + #if _STANDARD + float3 TransformWorldToObject(float3 p) { return mul(unity_WorldToObject, float4(p, 1)); }; + float3 TransformObjectToWorld(float3 p) { return mul(unity_ObjectToWorld, float4(p, 1)); }; + float4 TransformWorldToObject(float4 p) { return mul(unity_WorldToObject, p); }; + float4 TransformObjectToWorld(float4 p) { return mul(unity_ObjectToWorld, p); }; + float4x4 GetWorldToObjectMatrix() { return unity_WorldToObject; } + float4x4 GetObjectToWorldMatrix() { return unity_ObjectToWorld; } + #if (defined(SHADER_API_D3D11) || defined(SHADER_API_XBOXONE) || defined(UNITY_COMPILER_HLSLCC) || defined(SHADER_API_PSSL) || (SHADER_TARGET_SURFACE_ANALYSIS && !SHADER_TARGET_SURFACE_ANALYSIS_MOJOSHADER)) + #define UNITY_SAMPLE_TEX2D_LOD(tex,coord, lod) tex.SampleLevel (sampler##tex,coord, lod) + #define UNITY_SAMPLE_TEX2D_SAMPLER_LOD(tex,samplertex,coord, lod) tex.SampleLevel (sampler##samplertex,coord, lod) + #else + #define UNITY_SAMPLE_TEX2D_LOD(tex,coord,lod) tex2D (tex,coord,0,lod) + #define UNITY_SAMPLE_TEX2D_SAMPLER_LOD(tex,samplertex,coord,lod) tex2D (tex,coord,0,lod) + #endif + + #undef GetWorldToObjectMatrix() + + #define GetWorldToObjectMatrix() unity_WorldToObject + + + #endif + + float3 GetCameraWorldPosition() + { + #if _HDRP + return GetCameraRelativePositionWS(_WorldSpaceCameraPos); + #else + return _WorldSpaceCameraPos; + #endif + } + + #if _GRABPASSUSED + #if _STANDARD + TEXTURE2D(%GRABTEXTURE%); + SAMPLER(sampler_%GRABTEXTURE%); + #endif + + half3 GetSceneColor(float2 uv) + { + #if _STANDARD + return SAMPLE_TEXTURE2D(%GRABTEXTURE%, sampler_%GRABTEXTURE%, uv).rgb; + #else + return SHADERGRAPH_SAMPLE_SCENE_COLOR(uv); + #endif + } + #endif + + + + #if _STANDARD + UNITY_DECLARE_DEPTH_TEXTURE(_CameraDepthTexture); + float GetSceneDepth(float2 uv) { return SAMPLE_DEPTH_TEXTURE(_CameraDepthTexture, uv); } + float GetLinear01Depth(float2 uv) { return Linear01Depth(GetSceneDepth(uv)); } + float GetLinearEyeDepth(float2 uv) { return LinearEyeDepth(GetSceneDepth(uv)); } + #else + float GetSceneDepth(float2 uv) { return SHADERGRAPH_SAMPLE_SCENE_DEPTH(uv); } + float GetLinear01Depth(float2 uv) { return Linear01Depth(GetSceneDepth(uv), _ZBufferParams); } + float GetLinearEyeDepth(float2 uv) { return LinearEyeDepth(GetSceneDepth(uv), _ZBufferParams); } + #endif + + float3 GetWorldPositionFromDepthBuffer(float2 uv, float3 worldSpaceViewDir) + { + float eye = GetLinearEyeDepth(uv); + float3 camView = mul((float3x3)GetObjectToWorldMatrix(), transpose(mul(GetWorldToObjectMatrix(), UNITY_MATRIX_I_V)) [2].xyz); + + float dt = dot(worldSpaceViewDir, camView); + float3 div = worldSpaceViewDir/dt; + float3 wpos = (eye * div) + GetCameraWorldPosition(); + return wpos; + } + + #if _HDRP + float3 ObjectToWorldSpacePosition(float3 pos) + { + return GetAbsolutePositionWS(TransformObjectToWorld(pos)); + } + #else + float3 ObjectToWorldSpacePosition(float3 pos) + { + return TransformObjectToWorld(pos); + } + #endif + + #if _STANDARD + UNITY_DECLARE_SCREENSPACE_TEXTURE(_CameraDepthNormalsTexture); + float3 GetSceneNormal(float2 uv, float3 worldSpaceViewDir) + { + float4 depthNorms = UNITY_SAMPLE_SCREENSPACE_TEXTURE(_CameraDepthNormalsTexture, uv); + float3 norms = DecodeViewNormalStereo(depthNorms); + norms = mul((float3x3)GetWorldToViewMatrix(), norms) * 0.5 + 0.5; + return norms; + } + #elif _HDRP && !_DECALSHADER + + float3 GetSceneNormal(float2 uv, float3 worldSpaceViewDir) + { + NormalData nd; + DecodeFromNormalBuffer(_ScreenSize.xy * uv, nd); + return nd.normalWS; + } + #elif _URP + #if (SHADER_LIBRARY_VERSION_MAJOR >= 10) + #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/DeclareNormalsTexture.hlsl" + #endif + + float3 GetSceneNormal(float2 uv, float3 worldSpaceViewDir) + { + #if (SHADER_LIBRARY_VERSION_MAJOR >= 10) + return SampleSceneNormals(uv); + #else + float3 wpos = GetWorldPositionFromDepthBuffer(uv, worldSpaceViewDir); + return normalize(-cross(ddx(wpos), ddy(wpos))) * 0.5 + 0.5; + #endif + + } + #endif + + #if _HDRP + + half3 UnpackNormalmapRGorAG(half4 packednormal) + { + // This do the trick + packednormal.x *= packednormal.w; + + half3 normal; + normal.xy = packednormal.xy * 2 - 1; + normal.z = sqrt(1 - saturate(dot(normal.xy, normal.xy))); + return normal; + } + half3 UnpackNormal(half4 packednormal) + { + #if defined(UNITY_NO_DXT5nm) + return packednormal.xyz * 2 - 1; + #else + return UnpackNormalmapRGorAG(packednormal); + #endif + } + #endif + #if _HDRP || _URP + + half3 UnpackScaleNormal(half4 packednormal, half scale) + { + #ifndef UNITY_NO_DXT5nm + // Unpack normal as DXT5nm (1, y, 1, x) or BC5 (x, y, 0, 1) + // Note neutral texture like "bump" is (0, 0, 1, 1) to work with both plain RGB normal and DXT5nm/BC5 + packednormal.x *= packednormal.w; + #endif + half3 normal; + normal.xy = (packednormal.xy * 2 - 1) * scale; + normal.z = sqrt(1 - saturate(dot(normal.xy, normal.xy))); + return normal; + } + + #endif + + + void GetSun(out float3 lightDir, out float3 color) + { + lightDir = float3(0.5, 0.5, 0); + color = 1; + #if _HDRP + if (_DirectionalLightCount > 0) + { + DirectionalLightData light = _DirectionalLightDatas[0]; + lightDir = -light.forward.xyz; + color = light.color; + } + #elif _STANDARD + lightDir = normalize(_WorldSpaceLightPos0.xyz); + color = _LightColor0.rgb; + #elif _URP + Light light = GetMainLight(); + lightDir = light.direction; + color = light.color; + #endif + } + + + + + + + + + + TEXTURE2D(_MainTex); + SAMPLER(sampler_MainTex); + + #if GLOW_ON + TEXTURE2D(_GlowTex); + SAMPLER(sampler_GlowTex); + #endif + + #if FADE_ON + TEXTURE2D(_FadeTex); + SAMPLER(sampler_FadeTex); + + TEXTURE2D(_FadeBurnTex); + SAMPLER(sampler_FadeBurnTex); + #endif + + #if DISTORT_ON + TEXTURE2D(_DistortTex); + SAMPLER(sampler_DistortTex); + #endif + + #if OUTTEX_ON + TEXTURE2D(_OutlineTex); + SAMPLER(sampler_OutlineTex); + #endif + + #if OUTDIST_ON + TEXTURE2D(_OutlineDistortTex); + SAMPLER(sampler_OutlineDistortTex); + #endif + + #if COLORSWAP_ON + TEXTURE2D(_ColorSwapTex); + SAMPLER(sampler_ColorSwapTex); + #endif + + #if COLORRAMP_ON + TEXTURE2D(_ColorRampTex); + TEXTURE2D(_ColorRampTexGradient); + SAMPLER(sampler_ColorRampTex); + SAMPLER(sampler_ColorRampTexGradient); + #endif + + #if SHINE_ON + TEXTURE2D(_ShineMask); + SAMPLER(sampler_ShineMask); + #endif + + #if OVERLAY_ON + TEXTURE2D(_OverlayTex); + SAMPLER(sampler_OverlayTex); + #endif + + #if NORMALMAP_ON + TEXTURE2D(_NormalMap); + SAMPLER(sampler_NormalMap); + #endif + + + half3 GetPixel(in int offsetX, in int offsetY, in half2 uv, in Texture2D _tex, in SamplerState _sampler) + { + half2 _uv = uv + half2(offsetX * _MainTex_TexelSize.x, offsetY * _MainTex_TexelSize.y); + half4 col = SAMPLE_TEXTURE2D(_tex, _sampler, _uv); + return col.rgb; + } + + + //BLURS------------------------------------------------------------------------- + half4 Blur(half2 uv, Texture2D source, SamplerState sampler_source, half Intensity) + { + const half2 texelSize = 1.0 / _ScreenParams.xy; + const half4 color = SAMPLE_TEXTURE2D(source, sampler_source, uv); + const half2 offset = Intensity * texelSize; + + half4 accumulatedColor = color; + half accumulatedWeight = 1.0; + for (int x = -1; x <= 1; x++) + { + for (int y = -1; y <= 1; y++) + { + const half2 sampleUV = uv + half2(x, y) * offset; + const half4 sampleColor = SAMPLE_TEXTURE2D(source, sampler_source, sampleUV); + + accumulatedColor += sampleColor; + accumulatedWeight += 1.0; + } + } + + half4 blurredColor = accumulatedColor / accumulatedWeight; + return blurredColor; + } + + half BlurHD_G(half bhqp, half x) + { + return exp(-(x * x) / (2.0 * bhqp * bhqp)); + } + half4 BlurHD(half2 uv, Texture2D source, SamplerState sampler_source, half BlurAmount, half xScale, half yScale) + { + int iterations = 16; + int halfIterations = iterations / 2; + half sigmaX = 0.1 + BlurAmount * 0.5; + half sigmaY = sigmaX; + half total = 0.0; + half4 ret = half4(0, 0, 0, 0); + for (int iy = 0; iy < iterations; ++iy) + { + half fy = BlurHD_G(sigmaY, half(iy) -half(halfIterations)); + half offsetY = half(iy - halfIterations) * 0.00390625 * xScale; + for (int ix = 0; ix < iterations; ++ix) + { + half fx = BlurHD_G(sigmaX, half(ix) - half(halfIterations)); + half offsetX = half(ix - halfIterations) * 0.00390625 * yScale; + total += fx * fy; + ret += SAMPLE_TEXTURE2D(source, sampler_source, uv + half2(offsetX, offsetY)) * fx * fy; + } + } + return ret / total; + } + //----------------------------------------------------------------------- + + + //------------------------------------------- + half RemapFloat(half inValue, half inMin, half inMax, half outMin, half outMax){ + return outMin + (inValue - inMin) * (outMax - outMin) / (inMax - inMin); + } + //------------------------------------------- + + //----------------------------------------------------------------------- + half rand(half2 seed, half offset) { + return (frac(sin(dot(seed, half2(12.9898, 78.233))) * 43758.5453) + offset) % 1.0; + } + + half rand2(half2 seed, half offset) { + return (frac(sin(dot(seed * floor(50 + (_Time.x % 1.0) * 12.), half2(127.1, 311.7))) * 43758.5453123) + offset) % 1.0; + } + + half rand2CustomTime(half2 seed, half offset, half customTime) { + return (frac(sin(dot(seed * floor(50 + (customTime % 1.0) * 12.), half2(127.1, 311.7))) * 43758.5453123) + offset) % 1.0; + } + //----------------------------------------------------------------------- + + + void Ext_ModifyVertex0 (inout VertexData v, inout ExtraV2F d) + { + //BILBOARD_ON + #if BILBOARD_ON + half3 camRight = mul((half3x3)unity_CameraToWorld, half3(1,0,0)); + half3 camUp = half3(0,1,0); + #if BILBOARDY_ON + camUp = mul((half3x3)unity_CameraToWorld, half3(0,1,0)); + #endif + half3 localPos = v.vertex.x * camRight + v.vertex.y * camUp; + v.vertex = half4(localPos, 1); + #endif + //----------------------------------------------------------- + + v.texcoord0.xy = TRANSFORM_TEX(v.texcoord0.xy, _MainTex); + half2 center = half2(0.5, 0.5); + #if ATLAS_ON + center = half2((_MaxXUV + _MinXUV) / 2.0, (_MaxYUV + _MinYUV) / 2.0); + #endif + + //POLARUV_ON + #if POLARUV_ON + v.texcoord0.xy = v.texcoord0.xy - center; + #endif + + //---------------------------------------- + + //ROTATEUV_ON + #if ROTATEUV_ON + half2 uvC = v.texcoord0.xy; + half cosAngle = cos(_RotateUvAmount); + half sinAngle = sin(_RotateUvAmount); + half2x2 rot = half2x2(cosAngle, -sinAngle, sinAngle, cosAngle); + uvC -= center; + v.texcoord0.xy = mul(rot, uvC); + v.texcoord0.xy += center; + #endif + //-------------------- + + #if RECTSIZE_ON + v.vertex.xyz += (v.vertex.xyz * (_RectSize - 1.0)); + #endif + + #if OUTTEX_ON + v.texcoord1.xy = TRANSFORM_TEX(v.texcoord0.xy, _OutlineTex); + #endif + + #if OUTDIST_ON + v.texcoord2.xy = TRANSFORM_TEX(v.texcoord0.xy, _OutlineDistortTex); + #endif + + #if DISTORT_ON + v.texcoord3.xy = TRANSFORM_TEX(v.texcoord0.xy, _DistortTex); + #endif + } + + void Ext_SurfaceFunction0 (inout Surface o, ShaderData d) + { + half randomSeed = _RandomSeed; + + float2 uvRect = d.texcoord0; + half2 center = half2(0.5, 0.5); + #if ATLAS_ON + center = half2((_MaxXUV + _MinXUV) / 2.0, (_MaxYUV + _MinYUV) / 2.0); + uvRect = half2((d.texcoord0.x - _MinXUV) / (_MaxXUV - _MinXUV), (d.texcoord0.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half2 centerTiled = half2(center.x * _MainTex_ST.x, center.y * _MainTex_ST.y); + + //CLIPPING_ON + #if CLIPPING_ON + half2 tiledUv = half2(d.texcoord0.x / _MainTex_ST.x, d.texcoord0.y / _MainTex_ST.y); + #if ATLAS_ON + tiledUv = half2((tiledUv.x - _MinXUV) / (_MaxXUV - _MinXUV), (tiledUv.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + clip((1 - _ClipUvUp) - tiledUv.y); + clip(tiledUv.y - _ClipUvDown); + clip((1 - _ClipUvRight) - tiledUv.x); + clip(tiledUv.x - _ClipUvLeft); + #endif + //---------------------------------- + + //RADIALCLIPPING_ON + #if RADIALCLIPPING_ON + half2 tiledUv2 = half2(d.texcoord0.x / _MainTex_ST.x, d.texcoord0.y / _MainTex_ST.y); + #if ATLAS_ON + tiledUv2 = half2((tiledUv2.x - _MinXUV) / (_MaxXUV - _MinXUV), (tiledUv2.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half startAngle = _RadialStartAngle - _RadialClip; + half endAngle = _RadialStartAngle + _RadialClip2; + half offset0 = clamp(0, 360, startAngle + 360); + half offset360 = clamp(0, 360, endAngle - 360); + half2 atan2Coord = half2(lerp(-1, 1, tiledUv2.x), lerp(-1, 1, tiledUv2.y)); + half atanAngle = atan2(atan2Coord.y, atan2Coord.x) * 57.3; // angle in degrees + if(atanAngle < 0) atanAngle = 360 + atanAngle; + if(atanAngle >= startAngle && atanAngle <= endAngle) discard; + if(atanAngle <= offset360) discard; + if(atanAngle >= offset0) discard; + #endif + + //----------------------------- + + //TEXTURESCROLL_ON && ATLAS_ON + #if TEXTURESCROLL_ON && ATLAS_ON + d.texcoord0.xy = half2(_MinXUV + ((_MaxXUV - _MinXUV) * (abs(((_Time.y + randomSeed) * _TextureScrollXSpeed) + uvRect.x) % 1)), + _MinYUV + ((_MaxYUV - _MinYUV) * (abs(((_Time.y + randomSeed) * _TextureScrollYSpeed) + uvRect.y) % 1))); + #endif + //---------------------------- + + //OFFSETUV_ON + #if OFFSETUV_ON + #if ATLAS_ON + d.texcoord0.xy = half2(_MinXUV + ((_MaxXUV - _MinXUV) * (abs((_OffsetUvX + uvRect.x) % 1))), + _MinYUV + ((_MaxYUV - _MinYUV) * (abs(_OffsetUvY + uvRect.y) % 1))); + #else + d.texcoord0.xy += half2(_OffsetUvX, _OffsetUvY); + #endif + #endif + + //---------------------- + + //POLARUV_ON + #if POLARUV_ON + d.texcoord0.xy = half2(atan2(d.texcoord0.y, d.texcoord0.x) / (2.0f * 3.141592653589f), length(d.texcoord0.xy)); + d.texcoord0.xy *= _MainTex_ST.xy; + #endif + + //-------------------------------------- + + //TWISTUV_ON + #if TWISTUV_ON + #if ATLAS_ON + _TwistUvPosX = ((_MaxXUV - _MinXUV) * _TwistUvPosX) + _MinXUV; + _TwistUvPosY = ((_MaxYUV - _MinYUV) * _TwistUvPosY) + _MinYUV; + #endif + half2 tempUv = d.texcoord0.xy - half2(_TwistUvPosX * _MainTex_ST.x, _TwistUvPosY * _MainTex_ST.y); + _TwistUvRadius *= (_MainTex_ST.x + _MainTex_ST.y) / 2; + half percent = (_TwistUvRadius - length(tempUv)) / _TwistUvRadius; + half theta = percent * percent * (2.0 * sin(_TwistUvAmount)) * 8.0; + half s = sin(theta); + half c = cos(theta); + half beta = max(sign(_TwistUvRadius - length(tempUv)), 0.0); + tempUv = half2(dot(tempUv, half2(c, -s)), dot(tempUv, half2(s, c))) * beta + tempUv * (1 - beta); + tempUv += half2(_TwistUvPosX * _MainTex_ST.x, _TwistUvPosY * _MainTex_ST.y); + d.texcoord0.xy = tempUv; + #endif + + //-------------------------------------------- + + //FISHEYE_ON + #if FISHEYE_ON + half bind = length(centerTiled); + half2 dF = d.texcoord0.xy - centerTiled; + half dFlen = length(dF); + half fishInt = (3.14159265359 / bind) * (_FishEyeUvAmount + 0.001); + d.texcoord0.xy = centerTiled + (dF / (max(0.0001, dFlen))) * tan(dFlen * fishInt) * bind / tan(bind * fishInt); + #endif + //--------------------------------------------- + + //PINCH_ON + #if PINCH_ON + half2 dP = d.texcoord0.xy - centerTiled; + half pinchInt = (3.141592 / length(centerTiled)) * (-_PinchUvAmount + 0.001); + d.texcoord0.xy = centerTiled + normalize(dP) * atan(length(dP) * -pinchInt * 10.0) * 0.5 / atan(-pinchInt * 5); + #endif + + //--------------------------------------------- + + //ZOOMUV_ON + #if ZOOMUV_ON + d.texcoord0.xy -= centerTiled; + d.texcoord0.xy = d.texcoord0.xy * _ZoomUvAmount; + d.texcoord0.xy += centerTiled; + #endif + + //----------------------------------------------- + + //DOODLE_ON + #if DOODLE_ON + half2 uvCopy = uvRect; + _HandDrawnSpeed = (floor((_Time.x + randomSeed) * 20 * _HandDrawnSpeed) / _HandDrawnSpeed) * _HandDrawnSpeed; + uvCopy.x = sin((uvCopy.x * _HandDrawnAmount + _HandDrawnSpeed) * 4); + uvCopy.y = cos((uvCopy.y * _HandDrawnAmount + _HandDrawnSpeed) * 4); + d.texcoord0.xy = lerp(d.texcoord0.xy, d.texcoord0.xy + uvCopy, 0.0005 * _HandDrawnAmount); + #endif + + //-------------------------- + + //SHAKEUV_ON + #if SHAKEUV_ON + half xShake = sin((_Time.x + randomSeed) * _ShakeUvSpeed * 50) * _ShakeUvX; + half yShake = cos((_Time.x + randomSeed) * _ShakeUvSpeed * 50) * _ShakeUvY; + d.texcoord0.xy += half2(xShake * 0.012, yShake * 0.01); + #endif + + //------------------------------------------- + + //RECTSIZE_ON + #if RECTSIZE_ON + d.texcoord0.xy = d.texcoord0.xy * (_RectSize).xx + (((-_RectSize * 0.5) + 0.5)).xx; + #endif + + //------------------------------------------- + + //DISTORT_ON + #if DISTORT_ON + #if ATLAS_ON + d.texcoord3.x = d.texcoord3.x * (1 / (_MaxXUV - _MinXUV)); + d.texcoord3.y = d.texcoord3.y * (1 / (_MaxYUV - _MinYUV)); + #endif + + d.texcoord3.x += ((_Time.x + _RandomSeed) * _DistortTexXSpeed) % 1; + d.texcoord3.y += ((_Time.x + _RandomSeed) * _DistortTexYSpeed) % 1; + half distortAmnt = (SAMPLE_TEXTURE2D(_DistortTex, sampler_DistortTex, d.texcoord3.xy).r - 0.5) * 0.2 * _DistortAmount; + d.texcoord0.x += distortAmnt; + d.texcoord0.y += distortAmnt; + #endif + //------------------------------------------------------- + + //WARP_ON + #if WARP_ON + half2 warpUv = half2(d.texcoord0.x / _MainTex_ST.x, d.texcoord0.y / _MainTex_ST.y); + #if ATLAS_ON + warpUv = half2((warpUv.x - _MinXUV) / (_MaxXUV - _MinXUV), (warpUv.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + const float tau = 6.283185307179586; + float xWarp = (_Time.y + randomSeed) * _WarpSpeed + warpUv.x * tau / _WarpScale; + float yWarp = (_Time.y + randomSeed) * _WarpSpeed + warpUv.y * tau / _WarpScale; + float2 warp = float2(sin(xWarp), sin(yWarp)) * _WarpStrength; + d.texcoord0.xy += warp; + #endif + + //------------------------------------------------------- + + //WAVEUV_ON + #if WAVEUV_ON + float2 uvWave = half2(_WaveX * _MainTex_ST.x, _WaveY * _MainTex_ST.y) - d.texcoord0.xy; + uvWave %= 1; + #if ATLAS_ON + uvWave = half2(_WaveX, _WaveY) - uvRect; + #endif + uvWave.x *= _ScreenParams.x / _ScreenParams.y; + float waveTime = _Time.y + randomSeed; + float angWave = (sqrt(dot(uvWave, uvWave)) * _WaveAmount) - ((waveTime * _WaveSpeed)); + d.texcoord0.xy = d.texcoord0.xy + uvWave * sin(angWave) * (_WaveStrength / 1000.0); + #endif + //---------------------------------------------------- + + //ROUNDWAVEUV_ON + #if ROUNDWAVEUV_ON + half xWave = ((0.5 * _MainTex_ST.x) - uvRect.x); + half yWave = ((0.5 * _MainTex_ST.y) - uvRect.y) * (_MainTex_TexelSize.w / _MainTex_TexelSize.z); + half ripple = -sqrt(xWave*xWave + yWave* yWave); + d.texcoord0.xy += (sin((ripple + (_Time.y + randomSeed) * (_RoundWaveSpeed/10.0)) / 0.015) * (_RoundWaveStrength/10.0)) % 1; + #endif + //---------------------------------------------------- + + + //WIND_ON + #if WIND_ON + half windOffset = sin((_Time.x + randomSeed) * _GrassSpeed * 10); + half2 windCenter = half2(0.5, 0.1); + #if ATLAS_ON + windCenter.x = ((_MaxXUV - _MinXUV) * windCenter.x) + _MinXUV; + windCenter.y = ((_MaxYUV - _MinYUV) * windCenter.y) + _MinYUV; + #endif + #if !MANUALWIND_ON + d.texcoord0.x = fmod(abs(lerp(d.texcoord0.x, d.texcoord0.x + (_GrassWind * 0.01 * windOffset), uvRect.y)), 1); + #else + d.texcoord0.x = fmod(abs(lerp(d.texcoord0.x, d.texcoord0.x + (_GrassWind * 0.01 * _GrassManualAnim), uvRect.y)), 1); + windOffset = _GrassManualAnim; + #endif + half2 delta = d.texcoord0.xy - windCenter; + half delta2 = dot(delta.xy, delta.xy); + half2 delta_offset = delta2 * windOffset; + d.texcoord0.xy = d.texcoord0.xy + half2(delta.y, -delta.x) * delta_offset * _GrassRadialBend; + #endif + + //-------------------------------------------------------- + + //TEXTURESCROLL_ON && !ATLAS_ON + #if TEXTURESCROLL_ON && !ATLAS_ON + d.texcoord0.x += ((_Time.y + randomSeed) * _TextureScrollXSpeed) % 1; + d.texcoord0.y += ((_Time.y + randomSeed) * _TextureScrollYSpeed) % 1; + #endif + //------------------------------ + + //PIXELATE_ON + #if PIXELATE_ON + half aspectRatio = _MainTex_TexelSize.x / _MainTex_TexelSize.y; + half2 pixelSize = float2(_PixelateSize, _PixelateSize * aspectRatio); + d.texcoord0.xy = floor(d.texcoord0.xy * pixelSize) / pixelSize; + #endif + //-------------- + + half4 col = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy); + half originalAlpha = col.a; + col *= d.vertexColor; + + //NORMAL MAP + #if NORMALMAP_ON + half4 normalSample = SAMPLE_TEXTURE2D(_NormalMap, sampler_NormalMap, d.texcoord0.xy); + half3 normalTS = UnpackNormal(normalSample); + normalTS.xy *= _NormalStrength; + o.Normal = normalTS; + #endif + + + //GLITCH_ON + #if GLITCH_ON + half2 uvGlitch = uvRect; + uvGlitch.y -= 0.5; + half lineNoise = pow(rand2(floor(uvGlitch * half2(24., 19.) * _GlitchSize) * 4.0, randomSeed), 3.0) * _GlitchAmount + * pow(rand2(floor(uvGlitch * half2(38., 14.) * _GlitchSize) * 4.0, randomSeed), 3.0); + col = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(lineNoise * 0.02 * rand2(half2(2.0, 1), randomSeed), 0)) * d.vertexColor; + #endif + //-------------------------------------- + + //CHROMABERR_ON + #if CHROMABERR_ON + half4 r = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(_ChromAberrAmount/10, 0)) * d.vertexColor; + half4 b = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(-_ChromAberrAmount/10, 0)) * d.vertexColor; + col = half4(r.r * r.a, col.g, b.b * b.a, max(max(r.a, b.a) * _ChromAberrAlpha, col.a)); + #endif + + //-------------------------------- + + //BLUR_ON + #if BLUR_ON + #if ATLAS_ON + #if !BLURISHD_ON + col = BlurHD(d.texcoord0.xy, _MainTex, sampler_MainTex, _BlurIntensity, (_MaxXUV - _MinXUV), (_MaxYUV - _MinYUV)) * d.vertexColor; + #else + col = Blur(d.texcoord0.xy, _MainTex, sampler_MainTex, _BlurIntensity * (_MaxXUV - _MinXUV)) * d.vertexColor; + #endif + #else + #if !BLURISHD_ON + col = BlurHD(d.texcoord0.xy, _MainTex, sampler_MainTex, _BlurIntensity, 1, 1) * d.vertexColor; + #else + col = Blur(d.texcoord0.xy, _MainTex, sampler_MainTex, _BlurIntensity) * d.vertexColor; + #endif + #endif + #endif + + //-------------------- + + //MOTIONBLUR_ON + #if MOTIONBLUR_ON + _MotionBlurAngle = _MotionBlurAngle * 3.1415926; + #define rot(n) mul(n, half2x2(cos(_MotionBlurAngle), -sin(_MotionBlurAngle), sin(_MotionBlurAngle), cos(_MotionBlurAngle))) + _MotionBlurDist = _MotionBlurDist * 0.005; + #if ATLAS_ON + _MotionBlurDist *= (_MaxXUV - _MinXUV); + #endif + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(-_MotionBlurDist, -_MotionBlurDist))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(-_MotionBlurDist * 2, -_MotionBlurDist * 2))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(-_MotionBlurDist * 3, -_MotionBlurDist * 3))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(-_MotionBlurDist * 4, -_MotionBlurDist * 4))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(_MotionBlurDist, _MotionBlurDist))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(_MotionBlurDist * 2, _MotionBlurDist * 2))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(_MotionBlurDist * 3, _MotionBlurDist * 3))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(_MotionBlurDist * 4, _MotionBlurDist * 4))); + col.rgb = col.rgb / 9; + #endif + //------------------------------------ + + //NEGATIVE_ON + #if NEGATIVE_ON + col.rgb = lerp(col.rgb, 1 - col.rgb, _NegativeAmount); + #endif + + //-------------- + half luminance = 0; + + //GREYSCALE_ON && !GREYSCALEOUTLINE_ON + #if GREYSCALE_ON && !GREYSCALEOUTLINE_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + luminance = saturate(luminance + _GreyscaleLuminosity); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _GreyscaleTintColor, _GreyscaleBlend); + #endif + //------------------------------------ + + //GHOST_ON + #if GHOST_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + half4 ghostResult; + ghostResult.a = saturate(luminance - _GhostTransparency) * col.a; + ghostResult.rgb = col.rgb * (luminance + _GhostColorBoost); + col = lerp(col, ghostResult, _GhostBlend); + #endif + //------------------------------------ + + //INNEROUTLINE_ON + #if INNEROUTLINE_ON + half3 innerT = abs(GetPixel(0, _InnerOutlineThickness, d.texcoord0.xy, _MainTex, sampler_MainTex) - GetPixel(0, -_InnerOutlineThickness, d.texcoord0.xy, _MainTex, sampler_MainTex)); + innerT += abs(GetPixel(_InnerOutlineThickness, 0, d.texcoord0.xy, _MainTex, sampler_MainTex) - GetPixel(-_InnerOutlineThickness, 0, d.texcoord0.xy, _MainTex, sampler_MainTex)); + #if !ONLYINNEROUTLINE_ON + innerT = (innerT / 2.0) * col.a * _InnerOutlineAlpha; + col.rgb += length(innerT) * _InnerOutlineColor.rgb * _InnerOutlineGlow; + #else + innerT *= col.a * _InnerOutlineAlpha; + col.rgb = length(innerT) * _InnerOutlineColor.rgb * _InnerOutlineGlow; + col.a = step(0.3, col.r+col.g+col.b); + #endif + #endif + //------------------------------------------------------- + + //HITEFFECT_ON + #if HITEFFECT_ON + col.rgb = lerp(col.rgb, _HitEffectColor.rgb * _HitEffectGlow, _HitEffectBlend); + #endif + //-------------------- + + //GRADIENT_ON + #if GRADIENT_ON + half2 tiledUvGrad = half2(uvRect.x / _MainTex_ST.x, uvRect.y / _MainTex_ST.y); + #if GRADIENT2COL_ON + _GradTopRightCol = _GradTopLeftCol; + _GradBotRightCol = _GradBotLeftCol; + #endif + #if RADIALGRADIENT_ON + half radialDist = 1 - length(tiledUvGrad - half2(0.5, 0.5)); + radialDist *= (_MainTex_TexelSize.w / _MainTex_TexelSize.z); + radialDist = saturate(_GradBoostX * radialDist); + half4 gradientResult = lerp(_GradTopLeftCol, _GradBotLeftCol, radialDist); + #else + half gradXLerpFactor = saturate(pow(tiledUvGrad.x, _GradBoostX)); + half4 gradientResult = lerp(lerp(_GradBotLeftCol, _GradBotRightCol, gradXLerpFactor), + lerp(_GradTopLeftCol, _GradTopRightCol, gradXLerpFactor), saturate(pow(tiledUvGrad.y, _GradBoostY))); + #endif + gradientResult = lerp(col, gradientResult, _GradBlend); + col.rgb = gradientResult.rgb * col.a; + col.a *= gradientResult.a; + #endif + //-------------------------------------------------------------------- + + //CONTRAST_ON + #if CONTRAST_ON + col.rgb = (col.rgb - float3(0.5, 0.5, 0.5)) * _Contrast + float3(0.5, 0.5, 0.5); + col.rgb += _Brightness; + #endif + + //------------------------------------------------------------------- + + //COLORSWAP_ON + #if COLORSWAP_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + half4 swapMask = SAMPLE_TEXTURE2D(_ColorSwapTex, sampler_ColorSwapTex, d.texcoord0.xy); + swapMask.rgb *= swapMask.a; + half3 redSwap = _ColorSwapRed * swapMask.r * saturate(luminance + _ColorSwapRedLuminosity); + half3 greenSwap = _ColorSwapGreen * swapMask.g * saturate(luminance + _ColorSwapGreenLuminosity); + half3 blueSwap = _ColorSwapBlue * swapMask.b * saturate(luminance + _ColorSwapBlueLuminosity); + swapMask.rgb = col.rgb * saturate(1 - swapMask.r - swapMask.g - swapMask.b); + col.rgb = lerp(col.rgb, swapMask.rgb + redSwap + greenSwap + blueSwap, _ColorSwapBlend); + #endif + //-------------------------------------------------------------------- + + //COLORRAMP_ON && !COLORRAMPOUTLINE_ON + #if COLORRAMP_ON && !COLORRAMPOUTLINE_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + luminance = saturate(luminance + _ColorRampLuminosity); + #if GRADIENTCOLORRAMP_ON + col.rgb = lerp(col.rgb, SAMPLE_TEXTURE2D(_ColorRampTexGradient, sampler_ColorRampTexGradient, half2(luminance, 0)).rgb, _ColorRampBlend); + #else + col.rgb = lerp(col.rgb, SAMPLE_TEXTURE2D(_ColorRampTex, sampler_ColorRampTex, half2(luminance, 0)).rgb, _ColorRampBlend); + #endif + #endif + //-------------------------------------------------------------------- + + //CHANGECOLOR_ON + #if CHANGECOLOR_ON + float3 currChangeColor = saturate(col.rgb); + luminance = 0.3 * currChangeColor.r + 0.59 * currChangeColor.g + 0.11 * currChangeColor.b; + luminance = saturate(luminance + _ColorChangeLuminosity); + half3 dif = abs(currChangeColor - _ColorChangeTarget.rgb); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _ColorChangeNewCol.rgb, + max(sign(1 - saturate(dif.x + dif.y + dif.z) - _ColorChangeTolerance), 0.0)); + #if CHANGECOLOR2_ON + dif = abs(currChangeColor - _ColorChangeTarget2.rgb); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _ColorChangeNewCol2.rgb, + max(sign(1 - saturate(dif.x + dif.y + dif.z) - _ColorChangeTolerance2), 0.0)); + #endif + #if CHANGECOLOR3_ON + dif = abs(currChangeColor - _ColorChangeTarget3.rgb); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _ColorChangeNewCol3.rgb, + max(sign(1 - saturate(dif.x + dif.y + dif.z) - _ColorChangeTolerance3), 0.0)); + #endif + #endif + //------------------------------------------------------- + + //POSTERIZE_ON && !POSTERIZEOUTLINE_ON + #if POSTERIZE_ON && !POSTERIZEOUTLINE_ON + col.rgb = pow(col.rgb, _PosterizeGamma) * _PosterizeNumColors; + col.rgb = floor(col.rgb) / _PosterizeNumColors; + col.rgb = pow(col.rgb, 1.0 / _PosterizeGamma); + #endif + //------------------------------------ + + //HSV_ON + #if HSV_ON + half3 resultHsv = half3(col.rgb); + half cosHsv = _HsvBright * _HsvSaturation * cos(_HsvShift * 3.14159265 / 180); + half sinHsv = _HsvBright * _HsvSaturation * sin(_HsvShift * 3.14159265 / 180); + resultHsv.x = (.299 * _HsvBright + .701 * cosHsv + .168 * sinHsv) * col.x + + (.587 * _HsvBright - .587 * cosHsv + .330 * sinHsv) * col.y + + (.114 * _HsvBright - .114 * cosHsv - .497 * sinHsv) * col.z; + resultHsv.y = (.299 * _HsvBright - .299 * cosHsv - .328 * sinHsv) *col.x + + (.587 * _HsvBright + .413 * cosHsv + .035 * sinHsv) * col.y + + (.114 * _HsvBright - .114 * cosHsv + .292 * sinHsv) * col.z; + resultHsv.z = (.299 * _HsvBright - .3 * cosHsv + 1.25 * sinHsv) * col.x + + (.587 * _HsvBright - .588 * cosHsv - 1.05 * sinHsv) * col.y + + (.114 * _HsvBright + .886 * cosHsv - .203 * sinHsv) * col.z; + col.rgb = resultHsv; + #endif + //------------------------------------------------------- + + //OVERLAY_ON + #if OVERLAY_ON + half2 overlayUvs = d.texcoord0.xy; + overlayUvs.x += ((_Time.y + randomSeed) * _OverlayTextureScrollXSpeed) % 1; + overlayUvs.y += ((_Time.y + randomSeed) * _OverlayTextureScrollYSpeed) % 1; + half4 overlayCol = SAMPLE_TEXTURE2D(_OverlayTex, sampler_OverlayTex, TRANSFORM_TEX(overlayUvs, _OverlayTex)); + overlayCol.rgb *= _OverlayColor.rgb * _OverlayGlow; + #if !OVERLAYMULT_ON + overlayCol.rgb *= overlayCol.a * _OverlayColor.rgb * _OverlayColor.a * _OverlayBlend; + col.rgb += overlayCol.rgb; + #else + overlayCol.a *= _OverlayColor.a; + col = lerp(col, col * overlayCol, _OverlayBlend); + #endif + #endif + + //--------------------------------- + + //OUTBASE_ON + #if OUTBASE_ON + #if OUTBASEPIXELPERF_ON + half2 destUv = half2(_OutlinePixelWidth * _MainTex_TexelSize.x, _OutlinePixelWidth * _MainTex_TexelSize.y); + #else + half2 destUv = half2(_OutlineWidth * _MainTex_TexelSize.x * 200, _OutlineWidth * _MainTex_TexelSize.y * 200); + #endif + + #if OUTDIST_ON + d.texcoord3.x += ((_Time.x + _RandomSeed) * _OutlineDistortTexXSpeed) % 1; + d.texcoord3.y += ((_Time.x + _RandomSeed) * _OutlineDistortTexYSpeed) % 1; + #if ATLAS_ON + d.texcoord3 = half2((d.texcoord3.x - _MinXUV) / (_MaxXUV - _MinXUV), (d.texcoord3.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half outDistortAmnt = (SAMPLE_TEXTURE2D(_OutlineDistortTex, sampler_OutlineDistortTex, d.texcoord3).r - 0.5) * 0.2 * _OutlineDistortAmount; + destUv.x += outDistortAmnt; + destUv.y += outDistortAmnt; + #endif + + half spriteLeft = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(destUv.x, 0)).a; + half spriteRight = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy - half2(destUv.x, 0)).a; + half spriteBottom = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(0, destUv.y)).a; + half spriteTop = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy - half2(0, destUv.y)).a; + half result = spriteLeft + spriteRight + spriteBottom + spriteTop; + + #if OUTBASE8DIR_ON + half spriteTopLeft = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(destUv.x, destUv.y)).a; + half spriteTopRight = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(-destUv.x, destUv.y)).a; + half spriteBotLeft = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(destUv.x, -destUv.y)).a; + half spriteBotRight = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(-destUv.x, -destUv.y)).a; + result = result + spriteTopLeft + spriteTopRight + spriteBotLeft + spriteBotRight; + #endif + + result = step(0.05, saturate(result)); + + #if OUTTEX_ON + d.texcoord1.x += ((_Time.x + _RandomSeed) * _OutlineTexXSpeed) % 1; + d.texcoord1.y += ((_Time.x + _RandomSeed) * _OutlineTexYSpeed) % 1; + #if ATLAS_ON + d.texcoord1 = half2((d.texcoord1.x - _MinXUV) / (_MaxXUV - _MinXUV), (d.texcoord1.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half4 tempOutColor = SAMPLE_TEXTURE2D(_OutlineTex, sampler_OutlineTex, d.texcoord1); + tempOutColor *= _OutlineColor; + _OutlineColor = tempOutColor; + #endif + + result *= (1 - originalAlpha) * _OutlineAlpha; + + half4 outline = _OutlineColor * d.vertexColor.a; + outline.rgb *= _OutlineGlow; + outline.a = result; + #if ONLYOUTLINE_ON + col = outline; + #else + col = lerp(col, outline, result); + #endif + #endif + //------------------------------------------------------- + + //FADE_ON + #if FADE_ON + half2 tiledUvFade1 = TRANSFORM_TEX(d.texcoord0, _FadeTex); + half2 tiledUvFade2 = TRANSFORM_TEX(d.texcoord0, _FadeBurnTex); + #if ATLAS_ON + tiledUvFade1 = half2((tiledUvFade1.x - _MinXUV) / (_MaxXUV - _MinXUV), (tiledUvFade1.y - _MinYUV) / (_MaxYUV - _MinYUV)); + tiledUvFade2 = half2((tiledUvFade2.x - _MinXUV) / (_MaxXUV - _MinXUV), (tiledUvFade2.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half fadeTemp = SAMPLE_TEXTURE2D(_FadeTex, sampler_FadeTex, tiledUvFade1).r; + half fade = smoothstep(_FadeAmount, _FadeAmount + _FadeBurnTransition, fadeTemp); + half fadeBurn = saturate(smoothstep(_FadeAmount - _FadeBurnWidth, _FadeAmount - _FadeBurnWidth + 0.1, fadeTemp) * _FadeAmount); + col.a *= fade; + _FadeBurnColor.rgb *= _FadeBurnGlow; + col += fadeBurn * SAMPLE_TEXTURE2D(_FadeBurnTex, sampler_FadeBurnTex, tiledUvFade2) * _FadeBurnColor * originalAlpha * (1 - col.a); + #endif + //------------------------------------------------------- + + //SHADOW_ON + #if SHADOW_ON + half shadowA = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(_ShadowX, _ShadowY)).a; + half preMultShadowMask = 1 - (saturate(shadowA - col.a) * (1 - col.a)); + col.rgb *= 1 - ((shadowA - col.a) * (1 - col.a)); + col.rgb += (_ShadowColor * shadowA) * (1 - col.a); + col.a = max(shadowA * _ShadowAlpha * d.vertexColor.a, col.a); + #endif + + //------------------------------------------------------- + + //GLOW_ON + #if GLOW_ON + half4 emission; + #if GLOWTEX_ON + emission = SAMPLE_TEXTURE2D(_GlowTex, sampler_GlowTex, d.texcoord0); + #else + emission = col; + #endif + + col.rgb *= _GlowGlobal; + emission.rgb *= emission.a * col.a * _Glow * _GlowColor; + col.rgb += emission.rgb; + #endif + //------------------------------------------------------- + + //COLORRAMP_ON && COLORRAMPOUTLINE_ON + #if COLORRAMP_ON && COLORRAMPOUTLINE_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + luminance = saturate(luminance + _ColorRampLuminosity); + #if GRADIENTCOLORRAMP_ON + col.rgb = lerp(col.rgb, SAMPLE_TEXTURE2D(_ColorRampTexGradient, sampler_ColorRampTexGradient, half2(luminance, 0)).rgb, _ColorRampBlend); + #else + col.rgb = lerp(col.rgb, SAMPLE_TEXTURE2D(_ColorRampTex, sampler_ColorRampTex, half2(luminance, 0)).rgb, _ColorRampBlend); + #endif + #endif + //--------------- + + //GREYSCALE_ON && GREYSCALEOUTLINE_ON + #if GREYSCALE_ON && GREYSCALEOUTLINE_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + luminance = saturate(luminance + _GreyscaleLuminosity); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _GreyscaleTintColor, _GreyscaleBlend); + #endif + + //----------------------------------- + + //POSTERIZE_ON && POSTERIZEOUTLINE_ON + #if POSTERIZE_ON && POSTERIZEOUTLINE_ON + col.rgb = pow(col.rgb, _PosterizeGamma) * _PosterizeNumColors; + col.rgb = floor(col.rgb) / _PosterizeNumColors; + col.rgb = pow(col.rgb, 1.0 / _PosterizeGamma); + #endif + + //----------------------------------- + + //SHINE_ON + #if SHINE_ON + half2 uvShine = uvRect; + half cosAngle = cos(_ShineRotate); + half sinAngle = sin(_ShineRotate); + half2x2 rot = half2x2(cosAngle, -sinAngle, sinAngle, cosAngle); + uvShine -= half2(0.5, 0.5); + uvShine = mul(rot, uvShine); + uvShine += half2(0.5, 0.5); + half shineMask = SAMPLE_TEXTURE2D(_ShineMask, sampler_ShineMask, d.texcoord0.xy).a; + half currentDistanceProjection = (uvShine.x + uvShine.y) / 2; + half whitePower = 1 - (abs(currentDistanceProjection - _ShineLocation) / _ShineWidth); + col.rgb += col.a * whitePower * _ShineGlow * max(sign(currentDistanceProjection - (_ShineLocation - _ShineWidth)), 0.0) + * max(sign((_ShineLocation + _ShineWidth) - currentDistanceProjection), 0.0) * _ShineColor * shineMask; + #endif + + //----------------------------------- + + //HOLOGRAM_ON + #if HOLOGRAM_ON + half totalHologram = _HologramStripesAmount + _HologramUnmodAmount; + half hologramYCoord = ((uvRect.y + (((_Time.x + randomSeed) % 1) * _HologramStripesSpeed)) % totalHologram) / totalHologram; + hologramYCoord = abs(hologramYCoord); + half alpha = RemapFloat(saturate(hologramYCoord - (_HologramUnmodAmount/totalHologram)), 0.0, 1.0, _HologramMinAlpha, saturate(_HologramMaxAlpha)); + half hologramMask = max(sign((_HologramUnmodAmount/totalHologram) - hologramYCoord), 0.0); + half4 hologramResult = col; + hologramResult.a *= lerp(alpha, 1, hologramMask); + hologramResult.rgb *= max(1, _HologramMaxAlpha * max(sign(hologramYCoord - (_HologramUnmodAmount/totalHologram)), 0.0)); + hologramMask = 1 - step(0.01,hologramMask); + hologramResult.rgb += hologramMask * _HologramStripeColor * col.a; + col = lerp(col, hologramResult, _HologramBlend); + #endif + + //----------------------------------- + + //FLICKER_ON + #if FLICKER_ON + col.a *= saturate(col.a * step(frac(0.05 + (_Time.w + randomSeed) * _FlickerFreq), 1 - _FlickerPercent) + _FlickerAlpha); + #endif + //----------------------------------- + + //ALPHACUTOFF_ON + + //ALPHAROUND_ON + + //ALPHAOUTLINE_ON + #if ALPHAOUTLINE_ON + half alphaOutlineRes = pow(1 - col.a, max(_AlphaOutlinePower, 0.0001)) * step(_AlphaOutlineMinAlpha, col.a) * _AlphaOutlineBlend; + col.rgb = lerp(col.rgb, _AlphaOutlineColor.rgb * _AlphaOutlineGlow, alphaOutlineRes); + col.a = lerp(col.a, 1, alphaOutlineRes > 1); + #endif + //------------------------------------------------------- + + //FOG_ON + + //------------------ + + col *= _Color; + o.Albedo = col; + col.a *= _Alpha; + clip(col.a - _AlphaCutoffValue - 0.01); + o.Alpha = _Color.a; + } + + + + + + void ChainSurfaceFunction(inout Surface l, inout ShaderData d) + { + Ext_SurfaceFunction0(l, d); + // Ext_SurfaceFunction1(l, d); + // Ext_SurfaceFunction2(l, d); + // Ext_SurfaceFunction3(l, d); + // Ext_SurfaceFunction4(l, d); + // Ext_SurfaceFunction5(l, d); + // Ext_SurfaceFunction6(l, d); + // Ext_SurfaceFunction7(l, d); + // Ext_SurfaceFunction8(l, d); + // Ext_SurfaceFunction9(l, d); + // Ext_SurfaceFunction10(l, d); + // Ext_SurfaceFunction11(l, d); + // Ext_SurfaceFunction12(l, d); + // Ext_SurfaceFunction13(l, d); + // Ext_SurfaceFunction14(l, d); + // Ext_SurfaceFunction15(l, d); + // Ext_SurfaceFunction16(l, d); + // Ext_SurfaceFunction17(l, d); + // Ext_SurfaceFunction18(l, d); + // Ext_SurfaceFunction19(l, d); + // Ext_SurfaceFunction20(l, d); + // Ext_SurfaceFunction21(l, d); + // Ext_SurfaceFunction22(l, d); + // Ext_SurfaceFunction23(l, d); + // Ext_SurfaceFunction24(l, d); + // Ext_SurfaceFunction25(l, d); + // Ext_SurfaceFunction26(l, d); + // Ext_SurfaceFunction27(l, d); + // Ext_SurfaceFunction28(l, d); + // Ext_SurfaceFunction29(l, d); + } + +#if !_DECALSHADER + + void ChainModifyVertex(inout VertexData v, inout VertexToPixel v2p, float4 time) + { + ExtraV2F d; + + ZERO_INITIALIZE(ExtraV2F, d); + ZERO_INITIALIZE(Blackboard, d.blackboard); + // due to motion vectors in HDRP, we need to use the last + // time in certain spots. So if you are going to use _Time to adjust vertices, + // you need to use this time or motion vectors will break. + d.time = time; + + Ext_ModifyVertex0(v, d); + // Ext_ModifyVertex1(v, d); + // Ext_ModifyVertex2(v, d); + // Ext_ModifyVertex3(v, d); + // Ext_ModifyVertex4(v, d); + // Ext_ModifyVertex5(v, d); + // Ext_ModifyVertex6(v, d); + // Ext_ModifyVertex7(v, d); + // Ext_ModifyVertex8(v, d); + // Ext_ModifyVertex9(v, d); + // Ext_ModifyVertex10(v, d); + // Ext_ModifyVertex11(v, d); + // Ext_ModifyVertex12(v, d); + // Ext_ModifyVertex13(v, d); + // Ext_ModifyVertex14(v, d); + // Ext_ModifyVertex15(v, d); + // Ext_ModifyVertex16(v, d); + // Ext_ModifyVertex17(v, d); + // Ext_ModifyVertex18(v, d); + // Ext_ModifyVertex19(v, d); + // Ext_ModifyVertex20(v, d); + // Ext_ModifyVertex21(v, d); + // Ext_ModifyVertex22(v, d); + // Ext_ModifyVertex23(v, d); + // Ext_ModifyVertex24(v, d); + // Ext_ModifyVertex25(v, d); + // Ext_ModifyVertex26(v, d); + // Ext_ModifyVertex27(v, d); + // Ext_ModifyVertex28(v, d); + // Ext_ModifyVertex29(v, d); + + + // #if %EXTRAV2F0REQUIREKEY% + // v2p.extraV2F0 = d.extraV2F0; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // v2p.extraV2F1 = d.extraV2F1; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // v2p.extraV2F2 = d.extraV2F2; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // v2p.extraV2F3 = d.extraV2F3; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // v2p.extraV2F4 = d.extraV2F4; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // v2p.extraV2F5 = d.extraV2F5; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // v2p.extraV2F6 = d.extraV2F6; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // v2p.extraV2F7 = d.extraV2F7; + // #endif + } + + void ChainModifyTessellatedVertex(inout VertexData v, inout VertexToPixel v2p) + { + ExtraV2F d; + ZERO_INITIALIZE(ExtraV2F, d); + ZERO_INITIALIZE(Blackboard, d.blackboard); + + // #if %EXTRAV2F0REQUIREKEY% + // d.extraV2F0 = v2p.extraV2F0; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // d.extraV2F1 = v2p.extraV2F1; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // d.extraV2F2 = v2p.extraV2F2; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // d.extraV2F3 = v2p.extraV2F3; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // d.extraV2F4 = v2p.extraV2F4; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // d.extraV2F5 = v2p.extraV2F5; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // d.extraV2F6 = v2p.extraV2F6; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // d.extraV2F7 = v2p.extraV2F7; + // #endif + + + // Ext_ModifyTessellatedVertex0(v, d); + // Ext_ModifyTessellatedVertex1(v, d); + // Ext_ModifyTessellatedVertex2(v, d); + // Ext_ModifyTessellatedVertex3(v, d); + // Ext_ModifyTessellatedVertex4(v, d); + // Ext_ModifyTessellatedVertex5(v, d); + // Ext_ModifyTessellatedVertex6(v, d); + // Ext_ModifyTessellatedVertex7(v, d); + // Ext_ModifyTessellatedVertex8(v, d); + // Ext_ModifyTessellatedVertex9(v, d); + // Ext_ModifyTessellatedVertex10(v, d); + // Ext_ModifyTessellatedVertex11(v, d); + // Ext_ModifyTessellatedVertex12(v, d); + // Ext_ModifyTessellatedVertex13(v, d); + // Ext_ModifyTessellatedVertex14(v, d); + // Ext_ModifyTessellatedVertex15(v, d); + // Ext_ModifyTessellatedVertex16(v, d); + // Ext_ModifyTessellatedVertex17(v, d); + // Ext_ModifyTessellatedVertex18(v, d); + // Ext_ModifyTessellatedVertex19(v, d); + // Ext_ModifyTessellatedVertex20(v, d); + // Ext_ModifyTessellatedVertex21(v, d); + // Ext_ModifyTessellatedVertex22(v, d); + // Ext_ModifyTessellatedVertex23(v, d); + // Ext_ModifyTessellatedVertex24(v, d); + // Ext_ModifyTessellatedVertex25(v, d); + // Ext_ModifyTessellatedVertex26(v, d); + // Ext_ModifyTessellatedVertex27(v, d); + // Ext_ModifyTessellatedVertex28(v, d); + // Ext_ModifyTessellatedVertex29(v, d); + + // #if %EXTRAV2F0REQUIREKEY% + // v2p.extraV2F0 = d.extraV2F0; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // v2p.extraV2F1 = d.extraV2F1; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // v2p.extraV2F2 = d.extraV2F2; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // v2p.extraV2F3 = d.extraV2F3; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // v2p.extraV2F4 = d.extraV2F4; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // v2p.extraV2F5 = d.extraV2F5; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // v2p.extraV2F6 = d.extraV2F6; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // v2p.extraV2F7 = d.extraV2F7; + // #endif + } + + void ChainFinalColorForward(inout Surface l, inout ShaderData d, inout half4 color) + { + // Ext_FinalColorForward0(l, d, color); + // Ext_FinalColorForward1(l, d, color); + // Ext_FinalColorForward2(l, d, color); + // Ext_FinalColorForward3(l, d, color); + // Ext_FinalColorForward4(l, d, color); + // Ext_FinalColorForward5(l, d, color); + // Ext_FinalColorForward6(l, d, color); + // Ext_FinalColorForward7(l, d, color); + // Ext_FinalColorForward8(l, d, color); + // Ext_FinalColorForward9(l, d, color); + // Ext_FinalColorForward10(l, d, color); + // Ext_FinalColorForward11(l, d, color); + // Ext_FinalColorForward12(l, d, color); + // Ext_FinalColorForward13(l, d, color); + // Ext_FinalColorForward14(l, d, color); + // Ext_FinalColorForward15(l, d, color); + // Ext_FinalColorForward16(l, d, color); + // Ext_FinalColorForward17(l, d, color); + // Ext_FinalColorForward18(l, d, color); + // Ext_FinalColorForward19(l, d, color); + // Ext_FinalColorForward20(l, d, color); + // Ext_FinalColorForward21(l, d, color); + // Ext_FinalColorForward22(l, d, color); + // Ext_FinalColorForward23(l, d, color); + // Ext_FinalColorForward24(l, d, color); + // Ext_FinalColorForward25(l, d, color); + // Ext_FinalColorForward26(l, d, color); + // Ext_FinalColorForward27(l, d, color); + // Ext_FinalColorForward28(l, d, color); + // Ext_FinalColorForward29(l, d, color); + } + + void ChainFinalGBufferStandard(inout Surface s, inout ShaderData d, inout half4 GBuffer0, inout half4 GBuffer1, inout half4 GBuffer2, inout half4 outEmission, inout half4 outShadowMask) + { + // Ext_FinalGBufferStandard0(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard1(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard2(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard3(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard4(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard5(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard6(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard7(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard8(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard9(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard10(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard11(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard12(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard13(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard14(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard15(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard16(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard17(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard18(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard19(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard20(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard21(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard22(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard23(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard24(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard25(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard26(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard27(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard28(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard29(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + } +#endif + + + + + +#if _DECALSHADER + + ShaderData CreateShaderData(SurfaceDescriptionInputs IN) + { + ShaderData d = (ShaderData)0; + d.TBNMatrix = float3x3(IN.WorldSpaceTangent, IN.WorldSpaceBiTangent, IN.WorldSpaceNormal); + d.worldSpaceNormal = IN.WorldSpaceNormal; + d.worldSpaceTangent = IN.WorldSpaceTangent; + + d.worldSpacePosition = IN.WorldSpacePosition; + d.texcoord0 = IN.uv0.xyxy; + d.screenPos = IN.ScreenPosition; + + d.worldSpaceViewDir = normalize(_WorldSpaceCameraPos - d.worldSpacePosition); + + d.tangentSpaceViewDir = mul(d.TBNMatrix, d.worldSpaceViewDir); + + // these rarely get used, so we back transform them. Usually will be stripped. + #if _HDRP + // d.localSpacePosition = mul(GetWorldToObjectMatrix(), float4(GetCameraRelativePositionWS(d.worldSpacePosition), 1)).xyz; + #else + // d.localSpacePosition = mul(GetWorldToObjectMatrix(), float4(d.worldSpacePosition, 1)).xyz; + #endif + // d.localSpaceNormal = normalize(mul((float3x3)GetWorldToObjectMatrix(), d.worldSpaceNormal)); + // d.localSpaceTangent = normalize(mul((float3x3)GetWorldToObjectMatrix(), d.worldSpaceTangent.xyz)); + + // #if %SCREENPOSREQUIREKEY% + // d.screenUV = (IN.ScreenPosition.xy / max(0.01, IN.ScreenPosition.w)); + // #endif + + return d; + } +#else + + ShaderData CreateShaderData(VertexToPixel i + #if NEED_FACING + , bool facing + #endif + ) + { + ShaderData d = (ShaderData)0; + d.clipPos = i.pos; + d.worldSpacePosition = i.worldPos; + + d.worldSpaceNormal = normalize(i.worldNormal); + d.worldSpaceTangent.xyz = normalize(i.worldTangent.xyz); + + d.tangentSign = i.worldTangent.w * unity_WorldTransformParams.w; + float3 bitangent = cross(d.worldSpaceTangent.xyz, d.worldSpaceNormal) * d.tangentSign; + + d.TBNMatrix = float3x3(d.worldSpaceTangent, -bitangent, d.worldSpaceNormal); + d.worldSpaceViewDir = normalize(_WorldSpaceCameraPos - i.worldPos); + + d.tangentSpaceViewDir = mul(d.TBNMatrix, d.worldSpaceViewDir); + d.texcoord0 = i.texcoord0; + d.texcoord1 = i.texcoord1; + d.texcoord2 = i.texcoord2; + + // #if %TEXCOORD3REQUIREKEY% + d.texcoord3 = i.texcoord3; + // #endif + + // d.isFrontFace = facing; + // #if %VERTEXCOLORREQUIREKEY% + d.vertexColor = i.vertexColor; + // #endif + + // these rarely get used, so we back transform them. Usually will be stripped. + #if _HDRP + // d.localSpacePosition = mul(GetWorldToObjectMatrix(), float4(GetCameraRelativePositionWS(i.worldPos), 1)).xyz; + #else + // d.localSpacePosition = mul(GetWorldToObjectMatrix(), float4(i.worldPos, 1)).xyz; + #endif + // d.localSpaceNormal = normalize(mul((float3x3)GetWorldToObjectMatrix(), i.worldNormal)); + // d.localSpaceTangent = normalize(mul((float3x3)GetWorldToObjectMatrix(), i.worldTangent.xyz)); + + // #if %SCREENPOSREQUIREKEY% + // d.screenPos = i.screenPos; + // d.screenUV = (i.screenPos.xy / i.screenPos.w); + // #endif + + + // #if %EXTRAV2F0REQUIREKEY% + // d.extraV2F0 = i.extraV2F0; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // d.extraV2F1 = i.extraV2F1; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // d.extraV2F2 = i.extraV2F2; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // d.extraV2F3 = i.extraV2F3; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // d.extraV2F4 = i.extraV2F4; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // d.extraV2F5 = i.extraV2F5; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // d.extraV2F6 = i.extraV2F6; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // d.extraV2F7 = i.extraV2F7; + // #endif + + return d; + } + +#endif + + + +#if (SHADERPASS == SHADERPASS_LIGHT_TRANSPORT) + + // This was not in constant buffer in original unity, so keep outiside. But should be in as ShaderRenderPass frequency + float unity_OneOverOutputBoost; + float unity_MaxOutputValue; + + CBUFFER_START(UnityMetaPass) + // x = use uv1 as raster position + // y = use uv2 as raster position + bool4 unity_MetaVertexControl; + + // x = return albedo + // y = return normal + bool4 unity_MetaFragmentControl; + CBUFFER_END + + VertexToPixel Vert(VertexData inputMesh) + { + VertexToPixel output; + ZERO_INITIALIZE(VertexToPixel, output); + UNITY_SETUP_INSTANCE_ID(inputMesh); + UNITY_TRANSFER_INSTANCE_ID(inputMesh, output); + UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(output); + + // Output UV coordinate in vertex shader + float2 uv = float2(0.0, 0.0); + + if (unity_MetaVertexControl.x) + { + uv = inputMesh.texcoord1.xy * unity_LightmapST.xy + unity_LightmapST.zw; + } + else if (unity_MetaVertexControl.y) + { + uv = inputMesh.texcoord2.xy * unity_DynamicLightmapST.xy + unity_DynamicLightmapST.zw; + } + + // OpenGL right now needs to actually use the incoming vertex position + // so we create a fake dependency on it here that haven't any impact. + output.pos = float4(uv * 2.0 - 1.0, inputMesh.vertex.z > 0 ? 1.0e-4 : 0.0, 1.0); + + output.worldPos = TransformObjectToWorld(inputMesh.vertex.xyz).xyz; + + // Normal is required for triplanar mapping + output.worldNormal = TransformObjectToWorldNormal(inputMesh.normal); + // Not required but assign to silent compiler warning + output.worldTangent = float4(1.0, 0.0, 0.0, 0.0); + + output.texcoord0 = inputMesh.texcoord0; + output.texcoord1 = inputMesh.texcoord1; + output.texcoord2 = inputMesh.texcoord2; + // #if %TEXCOORD3REQUIREKEY% + output.texcoord3 = inputMesh.texcoord3; + // #endif + // #if %VERTEXCOLORREQUIREKEY% + output.vertexColor = inputMesh.vertexColor; + // #endif + + return output; + } +#else + + #if (_PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR))) + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/ShaderVariablesMatrixDefsHDCamera.hlsl" + + void MotionVectorPositionZBias(VertexToPixel input) + { + #if UNITY_REVERSED_Z + input.pos.z -= unity_MotionVectorsParams.z * input.pos.w; + #else + input.pos.z += unity_MotionVectorsParams.z * input.pos.w; + #endif + } + + #endif + + VertexToPixel Vert(VertexData input) + { + VertexToPixel output; + ZERO_INITIALIZE(VertexToPixel, output); + + UNITY_SETUP_INSTANCE_ID(input); + UNITY_TRANSFER_INSTANCE_ID(input, output); + UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(output); + + #if _HDRP && (_PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR))) + VertexData previousMesh = input; + #endif + + ChainModifyVertex(input, output, _Time); + + // This return the camera relative position (if enable) + float3 positionRWS = TransformObjectToWorld(input.vertex.xyz); + float3 normalWS = TransformObjectToWorldNormal(input.normal); + float4 tangentWS = float4(TransformObjectToWorldDir(input.tangent.xyz), input.tangent.w); + + + output.worldPos = GetAbsolutePositionWS(positionRWS); + output.pos = TransformWorldToHClip(positionRWS); + output.worldNormal = normalWS; + output.worldTangent = tangentWS; + + + output.texcoord0 = input.texcoord0; + output.texcoord1 = input.texcoord1; + output.texcoord2 = input.texcoord2; + + // #if %TEXCOORD3REQUIREKEY% + output.texcoord3 = input.texcoord3; + // #endif + + // #if %VERTEXCOLORREQUIREKEY% + output.vertexColor = input.vertexColor; + // #endif + + // #if %SCREENPOSREQUIREKEY% + // output.screenPos = ComputeScreenPos(output.pos, _ProjectionParams.x); + // #endif + + #if _HDRP && (_PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR))) + + #if !defined(TESSELLATION_ON) + MotionVectorPositionZBias(output); + #endif + + output.motionVectorCS = mul(UNITY_MATRIX_UNJITTERED_VP, float4(positionRWS.xyz, 1.0)); + // Note: unity_MotionVectorsParams.y is 0 is forceNoMotion is enabled + bool forceNoMotion = unity_MotionVectorsParams.y == 0.0; + if (forceNoMotion) + { + output.previousPositionCS = float4(0.0, 0.0, 0.0, 1.0); + } + else + { + bool hasDeformation = unity_MotionVectorsParams.x > 0.0; // Skin or morph target + + float3 effectivePositionOS = (hasDeformation ? previousMesh.previousPositionOS : previousMesh.vertex.xyz); + #if defined(_ADD_PRECOMPUTED_VELOCITY) + effectivePositionOS -= input.precomputedVelocity; + #endif + + previousMesh.vertex = float4(effectivePositionOS, 1); + VertexToPixel dummy = (VertexToPixel)0; + + + ChainModifyVertex(previousMesh, dummy, _LastTimeParameters); + + // we might need this for skinned objects? + //float3 normalWS = TransformPreviousObjectToWorldNormal(input.normal).xyz; + float3 previousPositionRWS = TransformPreviousObjectToWorld(previousMesh.vertex.xyz); + + #ifdef _WRITE_TRANSPARENT_MOTION_VECTOR + if (_TransparentCameraOnlyMotionVectors > 0) + { + previousPositionRWS = positionRWS.xyz; + } + #endif // _WRITE_TRANSPARENT_MOTION_VECTOR + + output.previousPositionCS = mul(UNITY_MATRIX_PREV_VP, float4(previousPositionRWS, 1.0)); + } + #endif // _HDRP && _PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR)) + + + return output; + } + + +#endif + + + + + + + + #if defined(WRITE_DECAL_BUFFER) && !defined(_DISABLE_DECALS) + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/Decal/DecalPrepassBuffer.hlsl" + #endif + + FragInputs BuildFragInputs(VertexToPixel input) + { + UNITY_SETUP_INSTANCE_ID(input); + FragInputs output; + ZERO_INITIALIZE(FragInputs, output); + + // Init to some default value to make the computer quiet (else it output 'divide by zero' warning even if value is not used). + // TODO: this is a really poor workaround, but the variable is used in a bunch of places + // to compute normals which are then passed on elsewhere to compute other values... + output.tangentToWorld = k_identity3x3; + output.positionSS = input.pos; // input.positionCS is SV_Position + // BETTER SHADERS: because we transform world position into actual world space for things like + // triplanar, etc, we have to back transform it here for lighting + output.positionRWS = GetCameraRelativePositionWS(input.worldPos); + output.tangentToWorld = BuildTangentToWorld(input.worldTangent, input.worldNormal); + output.texCoord0 = input.texcoord0; + output.texCoord1 = input.texcoord1; + output.texCoord2 = input.texcoord2; + + return output; + } + + void BuildSurfaceData(FragInputs fragInputs, inout Surface surfaceDescription, float3 V, PositionInputs posInput, out SurfaceData surfaceData, out float3 bentNormalWS) + { + // setup defaults -- these are used if the graph doesn't output a value + ZERO_INITIALIZE(SurfaceData, surfaceData); + + // specularOcclusion need to be init ahead of decal to quiet the compiler that modify the SurfaceData struct + // however specularOcclusion can come from the graph, so need to be init here so it can be override. + surfaceData.specularOcclusion = 1.0; + + // copy across graph values, if defined + surfaceData.baseColor = surfaceDescription.Albedo; + surfaceData.perceptualSmoothness = surfaceDescription.Smoothness; + surfaceData.ambientOcclusion = surfaceDescription.Occlusion; + surfaceData.specularOcclusion = surfaceDescription.SpecularOcclusion; + surfaceData.metallic = surfaceDescription.Metallic; + surfaceData.subsurfaceMask = surfaceDescription.SubsurfaceMask; + surfaceData.thickness = surfaceDescription.Thickness; + surfaceData.diffusionProfileHash = asuint(surfaceDescription.DiffusionProfileHash); + #if _USESPECULAR + surfaceData.specularColor = surfaceDescription.Specular; + #endif + surfaceData.coatMask = surfaceDescription.CoatMask; + surfaceData.anisotropy = surfaceDescription.Anisotropy; + surfaceData.iridescenceMask = surfaceDescription.IridescenceMask; + surfaceData.iridescenceThickness = surfaceDescription.IridescenceThickness; + + + + #if defined(_REFRACTION_PLANE) || defined(_REFRACTION_SPHERE) || defined(_REFRACTION_THIN) + if (_EnableSSRefraction) + { + surfaceData.transmittanceMask = (1.0 - surfaceDescription.Alpha); + surfaceDescription.Alpha = 1.0; + } + else + { + surfaceData.ior = surfaceDescription.ior; + surfaceData.transmittanceColor = surfaceDescription.transmittanceColor; + surfaceData.atDistance = surfaceDescription.atDistance; + surfaceData.transmittanceMask = surfaceDescription.transmittanceMask; + surfaceDescription.Alpha = 1.0; + } + #else + surfaceData.ior = 1.0; + surfaceData.transmittanceColor = float3(1.0, 1.0, 1.0); + surfaceData.atDistance = 1.0; + surfaceData.transmittanceMask = 0.0; + #endif + + + + // These static material feature allow compile time optimization + surfaceData.materialFeatures = MATERIALFEATUREFLAGS_LIT_STANDARD; + #ifdef _MATERIAL_FEATURE_SUBSURFACE_SCATTERING + surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_SUBSURFACE_SCATTERING; + #endif + + #ifdef _MATERIAL_FEATURE_TRANSMISSION + surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_TRANSMISSION; + #endif + + #ifdef _MATERIAL_FEATURE_ANISOTROPY + surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_ANISOTROPY; + surfaceData.normalWS = float3(0, 1, 0); + #endif + + #ifdef _MATERIAL_FEATURE_IRIDESCENCE + surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_IRIDESCENCE; + #endif + + #ifdef _MATERIAL_FEATURE_SPECULAR_COLOR + surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_SPECULAR_COLOR; + #endif + + #if defined(_MATERIAL_FEATURE_CLEAR_COAT) || _CLEARCOAT + surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_CLEAR_COAT; + #endif + + #if defined (_MATERIAL_FEATURE_SPECULAR_COLOR) && defined (_ENERGY_CONSERVING_SPECULAR) + // Require to have setup baseColor + // Reproduce the energy conservation done in legacy Unity. Not ideal but better for compatibility and users can unchek it + surfaceData.baseColor *= (1.0 - Max3(surfaceData.specularColor.r, surfaceData.specularColor.g, surfaceData.specularColor.b)); + #endif + + + + // compute world space normal + #if !_WORLDSPACENORMAL + surfaceData.normalWS = mul(surfaceDescription.Normal, fragInputs.tangentToWorld); + #else + surfaceData.normalWS = surfaceDescription.Normal; + #endif + + surfaceData.geomNormalWS = fragInputs.tangentToWorld[2]; + + surfaceData.tangentWS = normalize(fragInputs.tangentToWorld[0].xyz); // The tangent is not normalize in tangentToWorld for mikkt. TODO: Check if it expected that we normalize with Morten. Tag: SURFACE_GRADIENT + + + #if HAVE_DECALS + if (_EnableDecals) + { + float alpha = 1.0; + alpha = surfaceDescription.Alpha; + + // Both uses and modifies 'surfaceData.normalWS'. + DecalSurfaceData decalSurfaceData = GetDecalSurfaceData(posInput, fragInputs.tangentToWorld[2], alpha); + ApplyDecalToSurfaceData(decalSurfaceData, fragInputs.tangentToWorld[2], surfaceData); + } + #endif + + bentNormalWS = surfaceData.normalWS; + + surfaceData.tangentWS = Orthonormalize(surfaceData.tangentWS, surfaceData.normalWS); + + #ifdef DEBUG_DISPLAY + if (_DebugMipMapMode != DEBUGMIPMAPMODE_NONE) + { + // TODO: need to update mip info + surfaceData.metallic = 0; + } + + // We need to call ApplyDebugToSurfaceData after filling the surfarcedata and before filling builtinData + // as it can modify attribute use for static lighting + ApplyDebugToSurfaceData(fragInputs.tangentToWorld, surfaceData); + #endif + + // By default we use the ambient occlusion with Tri-ace trick (apply outside) for specular occlusion. + // If user provide bent normal then we process a better term + #if defined(_SPECULAR_OCCLUSION_CUSTOM) + // Just use the value passed through via the slot (not active otherwise) + #elif defined(_SPECULAR_OCCLUSION_FROM_AO_BENT_NORMAL) + // If we have bent normal and ambient occlusion, process a specular occlusion + surfaceData.specularOcclusion = GetSpecularOcclusionFromBentAO(V, bentNormalWS, surfaceData.normalWS, surfaceData.ambientOcclusion, PerceptualSmoothnessToPerceptualRoughness(surfaceData.perceptualSmoothness)); + #elif defined(_AMBIENT_OCCLUSION) && defined(_SPECULAR_OCCLUSION_FROM_AO) + surfaceData.specularOcclusion = GetSpecularOcclusionFromAmbientOcclusion(ClampNdotV(dot(surfaceData.normalWS, V)), surfaceData.ambientOcclusion, PerceptualSmoothnessToRoughness(surfaceData.perceptualSmoothness)); + #endif + + #if defined(_ENABLE_GEOMETRIC_SPECULAR_AA) && !defined(SHADER_STAGE_RAY_TRACING) + surfaceData.perceptualSmoothness = GeometricNormalFiltering(surfaceData.perceptualSmoothness, fragInputs.tangentToWorld[2], surfaceDescription.SpecularAAScreenSpaceVariance, surfaceDescription.SpecularAAThreshold); + #endif + } + + void GetSurfaceAndBuiltinData(VertexToPixel m2ps, FragInputs fragInputs, float3 V, inout PositionInputs posInput, + out SurfaceData surfaceData, out BuiltinData builtinData, inout Surface l, inout ShaderData d + #if NEED_FACING + , bool facing + #endif + ) + { + // Removed since crossfade does not work, probably needs extra material setup. + //#if !defined(SHADER_STAGE_RAY_TRACING) && !defined(_TESSELLATION_DISPLACEMENT) + // #ifdef LOD_FADE_CROSSFADE // enable dithering LOD transition if user select CrossFade transition in LOD group + // LODDitheringTransition(ComputeFadeMaskSeed(V, posInput.positionSS), unity_LODFade.x); + // #endif + //#endif + + d = CreateShaderData(m2ps + #if NEED_FACING + , facing + #endif + ); + + l = (Surface)0; + + l.Albedo = half3(0.5, 0.5, 0.5); + l.Normal = float3(0,0,1); + l.Occlusion = 1; + l.Alpha = 1; + l.SpecularOcclusion = 1; + + #if !defined(SHADER_STAGE_RAY_TRACING) && defined(_DEPTHOFFSET_ON) + l.outputDepth = d.clipPos.z; + #endif + + ChainSurfaceFunction(l, d); + + #if !defined(SHADER_STAGE_RAY_TRACING) && defined(_DEPTHOFFSET_ON) + //posInput.deviceDepth = l.outputDepth; + #endif + + #if _UNLIT + //l.Emission = l.Albedo; + //l.Albedo = 0; + l.Normal = half3(0,0,1); + l.Occlusion = 1; + l.Metallic = 0; + l.Specular = 0; + #endif + + surfaceData.geomNormalWS = d.worldSpaceNormal; + surfaceData.tangentWS = d.worldSpaceTangent; + fragInputs.tangentToWorld = d.TBNMatrix; + + float3 bentNormalWS; + BuildSurfaceData(fragInputs, l, V, posInput, surfaceData, bentNormalWS); + + + InitBuiltinData(posInput, l.Alpha, bentNormalWS, -d.worldSpaceNormal, fragInputs.texCoord1, fragInputs.texCoord2, builtinData); + + + + builtinData.emissiveColor = l.Emission; + + #if defined(_OVERRIDE_BAKEDGI) + builtinData.bakeDiffuseLighting = l.DiffuseGI; + builtinData.backBakeDiffuseLighting = l.BackDiffuseGI; + builtinData.emissiveColor += l.SpecularGI; + #endif + + #if defined(_OVERRIDE_SHADOWMASK) + builtinData.shadowMask0 = l.ShadowMask.x; + builtinData.shadowMask1 = l.ShadowMask.y; + builtinData.shadowMask2 = l.ShadowMask.z; + builtinData.shadowMask3 = l.ShadowMask.w; + #endif + + #if defined(UNITY_VIRTUAL_TEXTURING) + builtinData.vtPackedFeedback = surfaceData.VTPackedFeedback; + #endif + + #if (SHADERPASS == SHADERPASS_DISTORTION) + builtinData.distortion = surfaceData.Distortion; + builtinData.distortionBlur = surfaceData.DistortionBlur; + #endif + + #ifndef SHADER_UNLIT + // PostInitBuiltinData call ApplyDebugToBuiltinData + PostInitBuiltinData(V, posInput, surfaceData, builtinData); + #else + ApplyDebugToBuiltinData(builtinData); + #endif + + RAY_TRACING_OPTIONAL_ALPHA_TEST_PASS + } + + + + void Frag( VertexToPixel IN + #ifdef WRITE_NORMAL_BUFFER + , out float4 outNormalBuffer : SV_Target0 + #ifdef WRITE_MSAA_DEPTH + , out float1 depthColor : SV_Target1 + #endif + #elif defined(WRITE_MSAA_DEPTH) // When only WRITE_MSAA_DEPTH is define and not WRITE_NORMAL_BUFFER it mean we are Unlit and only need depth, but we still have normal buffer binded + , out float4 outNormalBuffer : SV_Target0 + , out float1 depthColor : SV_Target1 + #elif defined(SCENESELECTIONPASS) + , out float4 outColor : SV_Target0 + #endif + + #ifdef _DEPTHOFFSET_ON + , out float outputDepth : SV_Depth + #endif + #if NEED_FACING + , bool facing : SV_IsFrontFace + #endif + ) + { + UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX(IN); + FragInputs input = BuildFragInputs(IN); + + // input.positionSS is SV_Position + PositionInputs posInput = GetPositionInput(input.positionSS.xy, _ScreenSize.zw, input.positionSS.z, input.positionSS.w, input.positionRWS); + + + float3 V = GetWorldSpaceNormalizeViewDir(input.positionRWS); + + + SurfaceData surfaceData; + BuiltinData builtinData; + Surface l; + ShaderData d; + GetSurfaceAndBuiltinData(IN, input, V, posInput, surfaceData, builtinData, l, d + #if NEED_FACING + , facing + #endif + ); + + + #ifdef _DEPTHOFFSET_ON + outputDepth = l.outputDepth; + #endif + + #ifdef WRITE_NORMAL_BUFFER + EncodeIntoNormalBuffer(ConvertSurfaceDataToNormalData(surfaceData), posInput.positionSS, outNormalBuffer); + #ifdef WRITE_MSAA_DEPTH + // In case we are rendering in MSAA, reading the an MSAA depth buffer is way too expensive. To avoid that, we export the depth to a color buffer + depthColor = v2f.pos.z; + #endif + #elif defined(WRITE_MSAA_DEPTH) // When we are MSAA depth only without normal buffer + // Due to the binding order of these two render targets, we need to have them both declared + outNormalBuffer = float4(0.0, 0.0, 0.0, 1.0); + // In case we are rendering in MSAA, reading the an MSAA depth buffer is way too expensive. To avoid that, we export the depth to a color buffer + depthColor = v2f.pos.z; + #elif defined(SCENESELECTIONPASS) + // We use depth prepass for scene selection in the editor, this code allow to output the outline correctly + outColor = float4(_ObjectId, _PassValue, 1.0, 1.0); + #endif + } + + ENDHLSL + } + + + Pass + { + Name "ScenePickingPass" + Tags + { + "LightMode" = "Picking" + } + + Tags { "RenderType" = "Opaque" "Queue" = "Geometry" "PreviewType" = "Plane" } + Cull [_CullingOption] + ZWrite [_ZWrite] + ZTest [_ZTestMode] + + + //------------------------------------------------------------------------------------- + // End Render Modes + //------------------------------------------------------------------------------------- + + HLSLPROGRAM + + #pragma target 4.5 + #pragma only_renderers d3d11 playstation xboxone xboxseries vulkan metal switch + #pragma multi_compile_instancing + #pragma editor_sync_compilation + #pragma instancing_options renderinglayer + + //#pragma shader_feature _ _SURFACE_TYPE_TRANSPARENT + //#pragma shader_feature_local _BLENDMODE_OFF _BLENDMODE_ALPHA _BLENDMODE_ADD _BLENDMODE_PRE_MULTIPLY + //#pragma shader_feature_local _ _ADD_PRECOMPUTED_VELOCITY + //#pragma shader_feature_local _ _TRANSPARENT_WRITES_MOTION_VEC + //#pragma shader_feature_local _ _ENABLE_FOG_ON_TRANSPARENT + //#pragma shader_feature_local _ _DISABLE_DECALS + //#pragma shader_feature_local _ _DISABLE_SSR + //#pragma shader_feature_local _ _DISABLE_SSR_TRANSPARENT + //#pragma shader_feature_local _REFRACTION_OFF _REFRACTION_PLANE _REFRACTION_SPHERE _REFRACTION_THIN + #pragma multi_compile _ WRITE_DECAL_BUFFER + + + #define SHADERPASS SHADERPASS_DEPTH_ONLY + #define SCENEPICKINGPASS + + + + #pragma shader_feature_local GLOW_ON + #pragma shader_feature_local FADE_ON + #pragma shader_feature_local OUTBASE_ON + #pragma shader_feature_local ONLYOUTLINE_ON + #pragma shader_feature_local GRADIENT_ON + #pragma shader_feature_local GRADIENT2COL_ON + #pragma shader_feature_local RADIALGRADIENT_ON + #pragma shader_feature_local COLORSWAP_ON + #pragma shader_feature_local HSV_ON + #pragma shader_feature_local CHANGECOLOR_ON + #pragma shader_feature_local CHANGECOLOR2_ON + #pragma shader_feature_local CHANGECOLOR3_ON + #pragma shader_feature_local COLORRAMP_ON + #pragma shader_feature_local GRADIENTCOLORRAMP_ON + #pragma shader_feature_local HITEFFECT_ON + #pragma shader_feature_local NEGATIVE_ON + #pragma shader_feature_local PIXELATE_ON + #pragma shader_feature_local GREYSCALE_ON + #pragma shader_feature_local POSTERIZE_ON + #pragma shader_feature_local BLUR_ON + #pragma shader_feature_local MOTIONBLUR_ON + #pragma shader_feature_local GHOST_ON + #pragma shader_feature_local ALPHAOUTLINE_ON + #pragma shader_feature_local INNEROUTLINE_ON + #pragma shader_feature_local ONLYINNEROUTLINE_ON + #pragma shader_feature_local HOLOGRAM_ON + #pragma shader_feature_local CHROMABERR_ON + #pragma shader_feature_local GLITCH_ON + #pragma shader_feature_local FLICKER_ON + #pragma shader_feature_local SHADOW_ON + #pragma shader_feature_local SHINE_ON + #pragma shader_feature_local CONTRAST_ON + #pragma shader_feature_local OVERLAY_ON + #pragma shader_feature_local OVERLAYMULT_ON + #pragma shader_feature_local DOODLE_ON + #pragma shader_feature_local WIND_ON + #pragma shader_feature_local WAVEUV_ON + #pragma shader_feature_local ROUNDWAVEUV_ON + #pragma shader_feature_local RECTSIZE_ON + #pragma shader_feature_local OFFSETUV_ON + #pragma shader_feature_local CLIPPING_ON + #pragma shader_feature_local RADIALCLIPPING_ON + #pragma shader_feature_local TEXTURESCROLL_ON + #pragma shader_feature_local ZOOMUV_ON + #pragma shader_feature_local DISTORT_ON + #pragma shader_feature_local WARP_ON + #pragma shader_feature_local TWISTUV_ON + #pragma shader_feature_local ROTATEUV_ON + #pragma shader_feature_local POLARUV_ON + #pragma shader_feature_local FISHEYE_ON + #pragma shader_feature_local PINCH_ON + #pragma shader_feature_local SHAKEUV_ON + + #pragma shader_feature_local GLOWTEX_ON + #pragma shader_feature_local OUTTEX_ON + #pragma shader_feature_local OUTDIST_ON + #pragma shader_feature_local OUTBASE8DIR_ON + #pragma shader_feature_local OUTBASEPIXELPERF_ON + #pragma shader_feature_local COLORRAMPOUTLINE_ON + #pragma shader_feature_local GREYSCALEOUTLINE_ON + #pragma shader_feature_local POSTERIZEOUTLINE_ON + #pragma shader_feature_local BLURISHD_ON + #pragma shader_feature_local MANUALWIND_ON + #pragma shader_feature_local ATLAS_ON + #pragma shader_feature_local PREMULTIPLYALPHA_ON + + #pragma shader_feature BILBOARD_ON + #pragma shader_feature BILBOARDY_ON + + #pragma shader_feature NORMALMAP_ON + + + #define _HDRP 1 +#define _USINGTEXCOORD1 1 +#define _USINGTEXCOORD2 1 + + + #pragma vertex Vert + #pragma fragment Frag + + // useful conversion functions to make surface shader code just work + + #define UNITY_DECLARE_TEX2D(name) TEXTURE2D(name); SAMPLER(sampler##name); + #define UNITY_DECLARE_TEX2D_NOSAMPLER(name) TEXTURE2D(name); + #define UNITY_DECLARE_TEX2DARRAY(name) TEXTURE2D_ARRAY(name); SAMPLER(sampler##name); + #define UNITY_DECLARE_TEX2DARRAY_NOSAMPLER(tex) TEXTURE2D_ARRAY(tex); + + #define UNITY_SAMPLE_TEX2DARRAY(tex,coord) SAMPLE_TEXTURE2D_ARRAY(tex, sampler##tex, coord.xy, coord.z) + #define UNITY_SAMPLE_TEX2DARRAY_LOD(tex,coord,lod) SAMPLE_TEXTURE2D_ARRAY_LOD(tex, sampler##tex, coord.xy, coord.z, lod) + #define UNITY_SAMPLE_TEX2D(tex, coord) SAMPLE_TEXTURE2D(tex, sampler##tex, coord) + #define UNITY_SAMPLE_TEX2D_SAMPLER(tex, samp, coord) SAMPLE_TEXTURE2D(tex, sampler##samp, coord) + + #define UNITY_SAMPLE_TEX2D_LOD(tex,coord, lod) SAMPLE_TEXTURE2D_LOD(tex, sampler_##tex, coord, lod) + #define UNITY_SAMPLE_TEX2D_SAMPLER_LOD(tex,samplertex,coord, lod) SAMPLE_TEXTURE2D_LOD (tex, sampler##samplertex,coord, lod) + + #if defined(UNITY_COMPILER_HLSL) + #define UNITY_INITIALIZE_OUTPUT(type,name) name = (type)0; + #else + #define UNITY_INITIALIZE_OUTPUT(type,name) + #endif + + #define sampler2D_float sampler2D + #define sampler2D_half sampler2D + + #undef WorldNormalVector + #define WorldNormalVector(data, normal) mul(normal, data.TBNMatrix) + + #define UnityObjectToWorldNormal(normal) mul(GetObjectToWorldMatrix(), normal) + + + + +// HDRP Adapter stuff + #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Common.hlsl" + #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Texture.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/ShaderVariables.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/ShaderPass/FragInputs.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/ShaderPass/ShaderPass.cs.hlsl" + #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/TextureStack.hlsl" // Required to be include before we include properties as it define DECLARE_STACK_CB +#if UNITY_VERSION >= UNITY_2021_3_31 + #include "Packages/com.unity.shadergraph/ShaderGraphLibrary/Functions.hlsl" // Need to be here for Gradient struct definition +#else + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/ShaderGraphHeader.hlsl" +#endif + #ifdef RAYTRACING_SHADER_GRAPH_DEFAULT + #define RAYTRACING_SHADER_GRAPH_HIGH + #endif + + #ifdef RAYTRACING_SHADER_GRAPH_RAYTRACED + #define RAYTRACING_SHADER_GRAPH_LOW + #endif + // end + + + + + // If we use subsurface scattering, enable output split lighting (for forward pass) + #if defined(_MATERIAL_FEATURE_SUBSURFACE_SCATTERING) && !defined(_SURFACE_TYPE_TRANSPARENT) + #define OUTPUT_SPLIT_LIGHTING + #endif + + #define HAVE_RECURSIVE_RENDERING + + #if SHADERPASS == SHADERPASS_TRANSPARENT_DEPTH_PREPASS + #if !defined(_DISABLE_SSR_TRANSPARENT) && !defined(SHADER_UNLIT) + #define WRITE_NORMAL_BUFFER + #endif + #endif + + #ifndef DEBUG_DISPLAY + // In case of opaque we don't want to perform the alpha test, it is done in depth prepass and we use depth equal for ztest (setup from UI) + // Don't do it with debug display mode as it is possible there is no depth prepass in this case + #if !defined(_SURFACE_TYPE_TRANSPARENT) && defined(_ALPHATEST) + #if SHADERPASS == SHADERPASS_FORWARD + #define SHADERPASS_FORWARD_BYPASS_ALPHA_TEST + #elif SHADERPASS == SHADERPASS_GBUFFER + #define SHADERPASS_GBUFFER_BYPASS_ALPHA_TEST + #endif + #endif + #endif + + // Define _DEFERRED_CAPABLE_MATERIAL for shader capable to run in deferred pass + #if defined(SHADER_LIT) && !defined(_SURFACE_TYPE_TRANSPARENT) + #define _DEFERRED_CAPABLE_MATERIAL + #endif + + // Translate transparent motion vector define + #if defined(_TRANSPARENT_WRITES_MOTION_VEC) && defined(_SURFACE_TYPE_TRANSPARENT) + #define _WRITE_TRANSPARENT_MOTION_VECTOR + #endif + + + + + CBUFFER_START(UnityPerMaterial) + float _UseShadowThreshold; + float _BlendMode; + float _EnableBlendModePreserveSpecularLighting; + float _RayTracing; + float _RefractionModel; + + + half4 _Color; + half4 _MainTex_ST, _MainTex_TexelSize; + half _Alpha, _AlphaCutoffValue; + + #if ATLAS_ON + half _MinXUV, _MaxXUV, _MinYUV, _MaxYUV; + #endif + + #if GLOW_ON + half4 _GlowColor; + half _Glow, _GlowGlobal; + #endif + + #if HSV_ON + half _HsvShift, _HsvSaturation, _HsvBright; + #endif + + #if DISTORT_ON + half4 _DistortTex_ST; + half _DistortTexXSpeed, _DistortTexYSpeed, _DistortAmount; + #endif + + #if FADE_ON + half4 _FadeBurnColor, _FadeTex_ST, _FadeBurnTex_ST; + half _FadeAmount, _FadeBurnWidth, _FadeBurnTransition,_FadeBurnGlow; + #endif + + #if OUTBASE_ON + half4 _OutlineColor; + half _OutlineAlpha, _OutlineGlow, _OutlineWidth; + int _OutlinePixelWidth; + #endif + + #if OUTTEX_ON + half4 _OutlineTex_ST; + half _OutlineTexXSpeed, _OutlineTexYSpeed; + #endif + + #if OUTDIST_ON + half4 _OutlineDistortTex_ST; + half _OutlineDistortTexXSpeed, _OutlineDistortTexYSpeed, _OutlineDistortAmount; + #endif + + #if ALPHAOUTLINE_ON + half _AlphaOutlineGlow, _AlphaOutlinePower, _AlphaOutlineMinAlpha, _AlphaOutlineBlend; + half4 _AlphaOutlineColor; + #endif + + #if INNEROUTLINE_ON + half _InnerOutlineThickness, _InnerOutlineAlpha, _InnerOutlineGlow; + half4 _InnerOutlineColor; + #endif + + #if GRADIENT_ON + half _GradBlend, _GradBoostX, _GradBoostY; + half4 _GradTopRightCol, _GradTopLeftCol, _GradBotRightCol, _GradBotLeftCol; + #endif + + #if COLORSWAP_ON + half4 _ColorSwapRed, _ColorSwapGreen, _ColorSwapBlue; + half _ColorSwapRedLuminosity, _ColorSwapGreenLuminosity, _ColorSwapBlueLuminosity, _ColorSwapBlend; + #endif + + #if CHANGECOLOR_ON + half4 _ColorChangeNewCol, _ColorChangeTarget; + half _ColorChangeTolerance, _ColorChangeLuminosity; + #endif + #if CHANGECOLOR2_ON + half4 _ColorChangeNewCol2, _ColorChangeTarget2; + half _ColorChangeTolerance2; + #endif + #if CHANGECOLOR3_ON + half4 _ColorChangeNewCol3, _ColorChangeTarget3; + half _ColorChangeTolerance3; + #endif + + #if COLORRAMP_ON + half _ColorRampLuminosity, _ColorRampBlend; + #endif + + #if HITEFFECT_ON + half4 _HitEffectColor; + half _HitEffectGlow, _HitEffectBlend; + #endif + + #if NEGATIVE_ON + half _NegativeAmount; + #endif + + #if PIXELATE_ON + half _PixelateSize; + #endif + + #if GREYSCALE_ON + half _GreyscaleLuminosity, _GreyscaleBlend; + half4 _GreyscaleTintColor; + #endif + + #if POSTERIZE_ON + half _PosterizeNumColors, _PosterizeGamma; + #endif + + #if BLUR_ON + half _BlurIntensity; + #endif + + #if MOTIONBLUR_ON + half _MotionBlurAngle, _MotionBlurDist; + #endif + + #if GHOST_ON + half _GhostColorBoost, _GhostTransparency, _GhostBlend; + #endif + + #if HOLOGRAM_ON + half _HologramStripesAmount, _HologramMinAlpha, _HologramUnmodAmount, _HologramStripesSpeed, _HologramMaxAlpha, _HologramBlend; + half4 _HologramStripeColor; + #endif + + #if CHROMABERR_ON + half _ChromAberrAmount, _ChromAberrAlpha; + #endif + + #if GLITCH_ON + half _GlitchAmount, _GlitchSize; + #endif + + #if FLICKER_ON + half _FlickerFreq, _FlickerPercent, _FlickerAlpha; + #endif + + #if SHADOW_ON + half _ShadowX, _ShadowY, _ShadowAlpha; + half4 _ShadowColor; + #endif + + #if SHINE_ON + half4 _ShineColor; + half _ShineLocation, _ShineRotate, _ShineWidth, _ShineGlow; + #endif + + #if CONTRAST_ON + half _Contrast, _Brightness; + #endif + + #if OVERLAY_ON + half4 _OverlayTex_ST, _OverlayColor; + half _OverlayGlow, _OverlayBlend, _OverlayTextureScrollXSpeed, _OverlayTextureScrollYSpeed; + #endif + + #if DOODLE_ON + half _HandDrawnAmount, _HandDrawnSpeed; + #endif + + #if WIND_ON + half _GrassSpeed, _GrassWind, _GrassManualAnim, _GrassRadialBend; + #endif + + #if WAVEUV_ON + float _WaveAmount, _WaveSpeed, _WaveStrength, _WaveX, _WaveY; + #endif + + #if ROUNDWAVEUV_ON + half _RoundWaveStrength, _RoundWaveSpeed; + #endif + + #if RECTSIZE_ON + half _RectSize; + #endif + + #if OFFSETUV_ON + half _OffsetUvX, _OffsetUvY; + #endif + + #if CLIPPING_ON + half _ClipUvLeft, _ClipUvRight, _ClipUvUp, _ClipUvDown; + #endif + + #if RADIALCLIPPING_ON + half _RadialStartAngle, _RadialClip, _RadialClip2; + #endif + + #if TEXTURESCROLL_ON + half _TextureScrollXSpeed, _TextureScrollYSpeed; + #endif + + #if ZOOMUV_ON + half _ZoomUvAmount; + #endif + + #if WARP_ON + half _WarpStrength, _WarpSpeed, _WarpScale; + #endif + + #if TWISTUV_ON + half _TwistUvAmount, _TwistUvPosX, _TwistUvPosY, _TwistUvRadius; + #endif + + #if ROTATEUV_ON + half _RotateUvAmount; + #endif + + #if FISHEYE_ON + half _FishEyeUvAmount; + #endif + + #if PINCH_ON + half _PinchUvAmount; + #endif + + #if SHAKEUV_ON + half _ShakeUvSpeed, _ShakeUvX, _ShakeUvY; + #endif + + #if NORMALMAP_ON + half _NormalStrength; + #endif + + float _RandomSeed; + + + + + CBUFFER_END + + + + // -- Property used by ScenePickingPass + #ifdef SCENEPICKINGPASS + float4 _SelectionID; + #endif + + // -- Properties used by SceneSelectionPass + #ifdef SCENESELECTIONPASS + int _ObjectId; + int _PassValue; + #endif + + + // data across stages, stripped like the above. + struct VertexToPixel + { + float4 pos : SV_POSITION; + float3 worldPos : TEXCOORD0; + float3 worldNormal : TEXCOORD1; + float4 worldTangent : TEXCOORD2; + float4 texcoord0 : TEXCOORD3; + float4 texcoord1 : TEXCOORD4; + float4 texcoord2 : TEXCOORD5; + // #if %TEXCOORD3REQUIREKEY% + float4 texcoord3 : TEXCOORD6; + // #endif + + // #if %SCREENPOSREQUIREKEY% + // float4 screenPos : TEXCOORD7; + // #endif + + // #if %VERTEXCOLORREQUIREKEY% + float4 vertexColor : COLOR; + // #endif + + // #if %EXTRAV2F0REQUIREKEY% + // float4 extraV2F0 : TEXCOORD8; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // float4 extraV2F1 : TEXCOORD9; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // float4 extraV2F2 : TEXCOORD10; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // float4 extraV2F3 : TEXCOORD11; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // float4 extraV2F4 : TEXCOORD12; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // float4 extraV2F5 : TEXCOORD13; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // float4 extraV2F6 : TEXCOORD14; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // float4 extraV2F7 : TEXCOORD15; + // #endif + + #if UNITY_ANY_INSTANCING_ENABLED + UNITY_VERTEX_INPUT_INSTANCE_ID + #endif // UNITY_ANY_INSTANCING_ENABLED + + #if _HDRP && (_PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR))) + float4 previousPositionCS : TEXCOORD16; // Contain previous transform position (in case of skinning for example) + float4 motionVectorCS : TEXCOORD17; + #endif + + UNITY_VERTEX_OUTPUT_STEREO + }; + + + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Debug/DebugDisplay.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/Material.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/Lit/Lit.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/BuiltinUtilities.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/MaterialUtilities.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/ShaderGraphFunctions.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/PickingSpaceTransforms.hlsl" + + + + + // data describing the user output of a pixel + struct Surface + { + half3 Albedo; + half Height; + half3 Normal; + half Smoothness; + half3 Emission; + half Metallic; + half3 Specular; + half Occlusion; + half SpecularPower; // for simple lighting + half Alpha; + float outputDepth; // if written, SV_Depth semantic is used. ShaderData.clipPos.z is unused value + // HDRP Only + half SpecularOcclusion; + half SubsurfaceMask; + half Thickness; + half CoatMask; + half CoatSmoothness; + half Anisotropy; + half IridescenceMask; + half IridescenceThickness; + int DiffusionProfileHash; + float SpecularAAThreshold; + float SpecularAAScreenSpaceVariance; + // requires _OVERRIDE_BAKEDGI to be defined, but is mapped in all pipelines + float3 DiffuseGI; + float3 BackDiffuseGI; + float3 SpecularGI; + float ior; + float3 transmittanceColor; + float atDistance; + float transmittanceMask; + // requires _OVERRIDE_SHADOWMASK to be defines + float4 ShadowMask; + + // for decals + float NormalAlpha; + float MAOSAlpha; + + + }; + + // Data the user declares in blackboard blocks + struct Blackboard + { + + float blackboardDummyData; + }; + + // data the user might need, this will grow to be big. But easy to strip + struct ShaderData + { + float4 clipPos; // SV_POSITION + float3 localSpacePosition; + float3 localSpaceNormal; + float3 localSpaceTangent; + + float3 worldSpacePosition; + float3 worldSpaceNormal; + float3 worldSpaceTangent; + float tangentSign; + + float3 worldSpaceViewDir; + float3 tangentSpaceViewDir; + + float4 texcoord0; + float4 texcoord1; + float4 texcoord2; + float4 texcoord3; + + float2 screenUV; + float4 screenPos; + + float4 vertexColor; + bool isFrontFace; + + float4 extraV2F0; + float4 extraV2F1; + float4 extraV2F2; + float4 extraV2F3; + float4 extraV2F4; + float4 extraV2F5; + float4 extraV2F6; + float4 extraV2F7; + + float3x3 TBNMatrix; + Blackboard blackboard; + }; + + struct VertexData + { + #if SHADER_TARGET > 30 + // uint vertexID : SV_VertexID; + #endif + float4 vertex : POSITION; + float3 normal : NORMAL; + float4 tangent : TANGENT; + float4 texcoord0 : TEXCOORD0; + + // optimize out mesh coords when not in use by user or lighting system + #if _URP && (_USINGTEXCOORD1 || _PASSMETA || _PASSFORWARD || _PASSGBUFFER) + float4 texcoord1 : TEXCOORD1; + #endif + + #if _URP && (_USINGTEXCOORD2 || _PASSMETA || ((_PASSFORWARD || _PASSGBUFFER) && defined(DYNAMICLIGHTMAP_ON))) + float4 texcoord2 : TEXCOORD2; + #endif + + #if _STANDARD && (_USINGTEXCOORD1 || (_PASSMETA || ((_PASSFORWARD || _PASSGBUFFER || _PASSFORWARDADD) && LIGHTMAP_ON))) + float4 texcoord1 : TEXCOORD1; + #endif + #if _STANDARD && (_USINGTEXCOORD2 || (_PASSMETA || ((_PASSFORWARD || _PASSGBUFFER) && DYNAMICLIGHTMAP_ON))) + float4 texcoord2 : TEXCOORD2; + #endif + + + #if _HDRP + float4 texcoord1 : TEXCOORD1; + float4 texcoord2 : TEXCOORD2; + #endif + + // #if %TEXCOORD3REQUIREKEY% + float4 texcoord3 : TEXCOORD3; + // #endif + + // #if %VERTEXCOLORREQUIREKEY% + float4 vertexColor : COLOR; + // #endif + + #if _PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR)) + float3 previousPositionOS : TEXCOORD4; // Contain previous transform position (in case of skinning for example) + #if defined (_ADD_PRECOMPUTED_VELOCITY) + float3 precomputedVelocity : TEXCOORD5; // Add Precomputed Velocity (Alembic computes velocities on runtime side). + #endif + #endif + + UNITY_VERTEX_INPUT_INSTANCE_ID + }; + + struct TessVertex + { + float4 vertex : INTERNALTESSPOS; + float3 normal : NORMAL; + float4 tangent : TANGENT; + float4 texcoord0 : TEXCOORD0; + float4 texcoord1 : TEXCOORD1; + float4 texcoord2 : TEXCOORD2; + + // #if %TEXCOORD3REQUIREKEY% + float4 texcoord3 : TEXCOORD3; + // #endif + + // #if %VERTEXCOLORREQUIREKEY% + float4 vertexColor : COLOR; + // #endif + + // #if %EXTRAV2F0REQUIREKEY% + // float4 extraV2F0 : TEXCOORD5; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // float4 extraV2F1 : TEXCOORD6; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // float4 extraV2F2 : TEXCOORD7; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // float4 extraV2F3 : TEXCOORD8; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // float4 extraV2F4 : TEXCOORD9; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // float4 extraV2F5 : TEXCOORD10; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // float4 extraV2F6 : TEXCOORD11; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // float4 extraV2F7 : TEXCOORD12; + // #endif + + #if _PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR)) + float3 previousPositionOS : TEXCOORD13; // Contain previous transform position (in case of skinning for example) + #if defined (_ADD_PRECOMPUTED_VELOCITY) + float3 precomputedVelocity : TEXCOORD14; + #endif + #endif + + UNITY_VERTEX_INPUT_INSTANCE_ID + UNITY_VERTEX_OUTPUT_STEREO + }; + + struct ExtraV2F + { + float4 extraV2F0; + float4 extraV2F1; + float4 extraV2F2; + float4 extraV2F3; + float4 extraV2F4; + float4 extraV2F5; + float4 extraV2F6; + float4 extraV2F7; + Blackboard blackboard; + float4 time; + }; + + + float3 WorldToTangentSpace(ShaderData d, float3 normal) + { + return mul(d.TBNMatrix, normal); + } + + float3 TangentToWorldSpace(ShaderData d, float3 normal) + { + return mul(normal, d.TBNMatrix); + } + + // in this case, make standard more like SRPs, because we can't fix + // unity_WorldToObject in HDRP, since it already does macro-fu there + + #if _STANDARD + float3 TransformWorldToObject(float3 p) { return mul(unity_WorldToObject, float4(p, 1)); }; + float3 TransformObjectToWorld(float3 p) { return mul(unity_ObjectToWorld, float4(p, 1)); }; + float4 TransformWorldToObject(float4 p) { return mul(unity_WorldToObject, p); }; + float4 TransformObjectToWorld(float4 p) { return mul(unity_ObjectToWorld, p); }; + float4x4 GetWorldToObjectMatrix() { return unity_WorldToObject; } + float4x4 GetObjectToWorldMatrix() { return unity_ObjectToWorld; } + #if (defined(SHADER_API_D3D11) || defined(SHADER_API_XBOXONE) || defined(UNITY_COMPILER_HLSLCC) || defined(SHADER_API_PSSL) || (SHADER_TARGET_SURFACE_ANALYSIS && !SHADER_TARGET_SURFACE_ANALYSIS_MOJOSHADER)) + #define UNITY_SAMPLE_TEX2D_LOD(tex,coord, lod) tex.SampleLevel (sampler##tex,coord, lod) + #define UNITY_SAMPLE_TEX2D_SAMPLER_LOD(tex,samplertex,coord, lod) tex.SampleLevel (sampler##samplertex,coord, lod) + #else + #define UNITY_SAMPLE_TEX2D_LOD(tex,coord,lod) tex2D (tex,coord,0,lod) + #define UNITY_SAMPLE_TEX2D_SAMPLER_LOD(tex,samplertex,coord,lod) tex2D (tex,coord,0,lod) + #endif + + #undef GetWorldToObjectMatrix() + + #define GetWorldToObjectMatrix() unity_WorldToObject + + + #endif + + float3 GetCameraWorldPosition() + { + #if _HDRP + return GetCameraRelativePositionWS(_WorldSpaceCameraPos); + #else + return _WorldSpaceCameraPos; + #endif + } + + #if _GRABPASSUSED + #if _STANDARD + TEXTURE2D(%GRABTEXTURE%); + SAMPLER(sampler_%GRABTEXTURE%); + #endif + + half3 GetSceneColor(float2 uv) + { + #if _STANDARD + return SAMPLE_TEXTURE2D(%GRABTEXTURE%, sampler_%GRABTEXTURE%, uv).rgb; + #else + return SHADERGRAPH_SAMPLE_SCENE_COLOR(uv); + #endif + } + #endif + + + + #if _STANDARD + UNITY_DECLARE_DEPTH_TEXTURE(_CameraDepthTexture); + float GetSceneDepth(float2 uv) { return SAMPLE_DEPTH_TEXTURE(_CameraDepthTexture, uv); } + float GetLinear01Depth(float2 uv) { return Linear01Depth(GetSceneDepth(uv)); } + float GetLinearEyeDepth(float2 uv) { return LinearEyeDepth(GetSceneDepth(uv)); } + #else + float GetSceneDepth(float2 uv) { return SHADERGRAPH_SAMPLE_SCENE_DEPTH(uv); } + float GetLinear01Depth(float2 uv) { return Linear01Depth(GetSceneDepth(uv), _ZBufferParams); } + float GetLinearEyeDepth(float2 uv) { return LinearEyeDepth(GetSceneDepth(uv), _ZBufferParams); } + #endif + + float3 GetWorldPositionFromDepthBuffer(float2 uv, float3 worldSpaceViewDir) + { + float eye = GetLinearEyeDepth(uv); + float3 camView = mul((float3x3)GetObjectToWorldMatrix(), transpose(mul(GetWorldToObjectMatrix(), UNITY_MATRIX_I_V)) [2].xyz); + + float dt = dot(worldSpaceViewDir, camView); + float3 div = worldSpaceViewDir/dt; + float3 wpos = (eye * div) + GetCameraWorldPosition(); + return wpos; + } + + #if _HDRP + float3 ObjectToWorldSpacePosition(float3 pos) + { + return GetAbsolutePositionWS(TransformObjectToWorld(pos)); + } + #else + float3 ObjectToWorldSpacePosition(float3 pos) + { + return TransformObjectToWorld(pos); + } + #endif + + #if _STANDARD + UNITY_DECLARE_SCREENSPACE_TEXTURE(_CameraDepthNormalsTexture); + float3 GetSceneNormal(float2 uv, float3 worldSpaceViewDir) + { + float4 depthNorms = UNITY_SAMPLE_SCREENSPACE_TEXTURE(_CameraDepthNormalsTexture, uv); + float3 norms = DecodeViewNormalStereo(depthNorms); + norms = mul((float3x3)GetWorldToViewMatrix(), norms) * 0.5 + 0.5; + return norms; + } + #elif _HDRP && !_DECALSHADER + + float3 GetSceneNormal(float2 uv, float3 worldSpaceViewDir) + { + NormalData nd; + DecodeFromNormalBuffer(_ScreenSize.xy * uv, nd); + return nd.normalWS; + } + #elif _URP + #if (SHADER_LIBRARY_VERSION_MAJOR >= 10) + #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/DeclareNormalsTexture.hlsl" + #endif + + float3 GetSceneNormal(float2 uv, float3 worldSpaceViewDir) + { + #if (SHADER_LIBRARY_VERSION_MAJOR >= 10) + return SampleSceneNormals(uv); + #else + float3 wpos = GetWorldPositionFromDepthBuffer(uv, worldSpaceViewDir); + return normalize(-cross(ddx(wpos), ddy(wpos))) * 0.5 + 0.5; + #endif + + } + #endif + + #if _HDRP + + half3 UnpackNormalmapRGorAG(half4 packednormal) + { + // This do the trick + packednormal.x *= packednormal.w; + + half3 normal; + normal.xy = packednormal.xy * 2 - 1; + normal.z = sqrt(1 - saturate(dot(normal.xy, normal.xy))); + return normal; + } + half3 UnpackNormal(half4 packednormal) + { + #if defined(UNITY_NO_DXT5nm) + return packednormal.xyz * 2 - 1; + #else + return UnpackNormalmapRGorAG(packednormal); + #endif + } + #endif + #if _HDRP || _URP + + half3 UnpackScaleNormal(half4 packednormal, half scale) + { + #ifndef UNITY_NO_DXT5nm + // Unpack normal as DXT5nm (1, y, 1, x) or BC5 (x, y, 0, 1) + // Note neutral texture like "bump" is (0, 0, 1, 1) to work with both plain RGB normal and DXT5nm/BC5 + packednormal.x *= packednormal.w; + #endif + half3 normal; + normal.xy = (packednormal.xy * 2 - 1) * scale; + normal.z = sqrt(1 - saturate(dot(normal.xy, normal.xy))); + return normal; + } + + #endif + + + void GetSun(out float3 lightDir, out float3 color) + { + lightDir = float3(0.5, 0.5, 0); + color = 1; + #if _HDRP + if (_DirectionalLightCount > 0) + { + DirectionalLightData light = _DirectionalLightDatas[0]; + lightDir = -light.forward.xyz; + color = light.color; + } + #elif _STANDARD + lightDir = normalize(_WorldSpaceLightPos0.xyz); + color = _LightColor0.rgb; + #elif _URP + Light light = GetMainLight(); + lightDir = light.direction; + color = light.color; + #endif + } + + + + + + + + + + TEXTURE2D(_MainTex); + SAMPLER(sampler_MainTex); + + #if GLOW_ON + TEXTURE2D(_GlowTex); + SAMPLER(sampler_GlowTex); + #endif + + #if FADE_ON + TEXTURE2D(_FadeTex); + SAMPLER(sampler_FadeTex); + + TEXTURE2D(_FadeBurnTex); + SAMPLER(sampler_FadeBurnTex); + #endif + + #if DISTORT_ON + TEXTURE2D(_DistortTex); + SAMPLER(sampler_DistortTex); + #endif + + #if OUTTEX_ON + TEXTURE2D(_OutlineTex); + SAMPLER(sampler_OutlineTex); + #endif + + #if OUTDIST_ON + TEXTURE2D(_OutlineDistortTex); + SAMPLER(sampler_OutlineDistortTex); + #endif + + #if COLORSWAP_ON + TEXTURE2D(_ColorSwapTex); + SAMPLER(sampler_ColorSwapTex); + #endif + + #if COLORRAMP_ON + TEXTURE2D(_ColorRampTex); + TEXTURE2D(_ColorRampTexGradient); + SAMPLER(sampler_ColorRampTex); + SAMPLER(sampler_ColorRampTexGradient); + #endif + + #if SHINE_ON + TEXTURE2D(_ShineMask); + SAMPLER(sampler_ShineMask); + #endif + + #if OVERLAY_ON + TEXTURE2D(_OverlayTex); + SAMPLER(sampler_OverlayTex); + #endif + + #if NORMALMAP_ON + TEXTURE2D(_NormalMap); + SAMPLER(sampler_NormalMap); + #endif + + + half3 GetPixel(in int offsetX, in int offsetY, in half2 uv, in Texture2D _tex, in SamplerState _sampler) + { + half2 _uv = uv + half2(offsetX * _MainTex_TexelSize.x, offsetY * _MainTex_TexelSize.y); + half4 col = SAMPLE_TEXTURE2D(_tex, _sampler, _uv); + return col.rgb; + } + + + //BLURS------------------------------------------------------------------------- + half4 Blur(half2 uv, Texture2D source, SamplerState sampler_source, half Intensity) + { + const half2 texelSize = 1.0 / _ScreenParams.xy; + const half4 color = SAMPLE_TEXTURE2D(source, sampler_source, uv); + const half2 offset = Intensity * texelSize; + + half4 accumulatedColor = color; + half accumulatedWeight = 1.0; + for (int x = -1; x <= 1; x++) + { + for (int y = -1; y <= 1; y++) + { + const half2 sampleUV = uv + half2(x, y) * offset; + const half4 sampleColor = SAMPLE_TEXTURE2D(source, sampler_source, sampleUV); + + accumulatedColor += sampleColor; + accumulatedWeight += 1.0; + } + } + + half4 blurredColor = accumulatedColor / accumulatedWeight; + return blurredColor; + } + + half BlurHD_G(half bhqp, half x) + { + return exp(-(x * x) / (2.0 * bhqp * bhqp)); + } + half4 BlurHD(half2 uv, Texture2D source, SamplerState sampler_source, half BlurAmount, half xScale, half yScale) + { + int iterations = 16; + int halfIterations = iterations / 2; + half sigmaX = 0.1 + BlurAmount * 0.5; + half sigmaY = sigmaX; + half total = 0.0; + half4 ret = half4(0, 0, 0, 0); + for (int iy = 0; iy < iterations; ++iy) + { + half fy = BlurHD_G(sigmaY, half(iy) -half(halfIterations)); + half offsetY = half(iy - halfIterations) * 0.00390625 * xScale; + for (int ix = 0; ix < iterations; ++ix) + { + half fx = BlurHD_G(sigmaX, half(ix) - half(halfIterations)); + half offsetX = half(ix - halfIterations) * 0.00390625 * yScale; + total += fx * fy; + ret += SAMPLE_TEXTURE2D(source, sampler_source, uv + half2(offsetX, offsetY)) * fx * fy; + } + } + return ret / total; + } + //----------------------------------------------------------------------- + + + //------------------------------------------- + half RemapFloat(half inValue, half inMin, half inMax, half outMin, half outMax){ + return outMin + (inValue - inMin) * (outMax - outMin) / (inMax - inMin); + } + //------------------------------------------- + + //----------------------------------------------------------------------- + half rand(half2 seed, half offset) { + return (frac(sin(dot(seed, half2(12.9898, 78.233))) * 43758.5453) + offset) % 1.0; + } + + half rand2(half2 seed, half offset) { + return (frac(sin(dot(seed * floor(50 + (_Time.x % 1.0) * 12.), half2(127.1, 311.7))) * 43758.5453123) + offset) % 1.0; + } + + half rand2CustomTime(half2 seed, half offset, half customTime) { + return (frac(sin(dot(seed * floor(50 + (customTime % 1.0) * 12.), half2(127.1, 311.7))) * 43758.5453123) + offset) % 1.0; + } + //----------------------------------------------------------------------- + + + void Ext_ModifyVertex0 (inout VertexData v, inout ExtraV2F d) + { + //BILBOARD_ON + #if BILBOARD_ON + half3 camRight = mul((half3x3)unity_CameraToWorld, half3(1,0,0)); + half3 camUp = half3(0,1,0); + #if BILBOARDY_ON + camUp = mul((half3x3)unity_CameraToWorld, half3(0,1,0)); + #endif + half3 localPos = v.vertex.x * camRight + v.vertex.y * camUp; + v.vertex = half4(localPos, 1); + #endif + //----------------------------------------------------------- + + v.texcoord0.xy = TRANSFORM_TEX(v.texcoord0.xy, _MainTex); + half2 center = half2(0.5, 0.5); + #if ATLAS_ON + center = half2((_MaxXUV + _MinXUV) / 2.0, (_MaxYUV + _MinYUV) / 2.0); + #endif + + //POLARUV_ON + #if POLARUV_ON + v.texcoord0.xy = v.texcoord0.xy - center; + #endif + + //---------------------------------------- + + //ROTATEUV_ON + #if ROTATEUV_ON + half2 uvC = v.texcoord0.xy; + half cosAngle = cos(_RotateUvAmount); + half sinAngle = sin(_RotateUvAmount); + half2x2 rot = half2x2(cosAngle, -sinAngle, sinAngle, cosAngle); + uvC -= center; + v.texcoord0.xy = mul(rot, uvC); + v.texcoord0.xy += center; + #endif + //-------------------- + + #if RECTSIZE_ON + v.vertex.xyz += (v.vertex.xyz * (_RectSize - 1.0)); + #endif + + #if OUTTEX_ON + v.texcoord1.xy = TRANSFORM_TEX(v.texcoord0.xy, _OutlineTex); + #endif + + #if OUTDIST_ON + v.texcoord2.xy = TRANSFORM_TEX(v.texcoord0.xy, _OutlineDistortTex); + #endif + + #if DISTORT_ON + v.texcoord3.xy = TRANSFORM_TEX(v.texcoord0.xy, _DistortTex); + #endif + } + + void Ext_SurfaceFunction0 (inout Surface o, ShaderData d) + { + half randomSeed = _RandomSeed; + + float2 uvRect = d.texcoord0; + half2 center = half2(0.5, 0.5); + #if ATLAS_ON + center = half2((_MaxXUV + _MinXUV) / 2.0, (_MaxYUV + _MinYUV) / 2.0); + uvRect = half2((d.texcoord0.x - _MinXUV) / (_MaxXUV - _MinXUV), (d.texcoord0.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half2 centerTiled = half2(center.x * _MainTex_ST.x, center.y * _MainTex_ST.y); + + //CLIPPING_ON + #if CLIPPING_ON + half2 tiledUv = half2(d.texcoord0.x / _MainTex_ST.x, d.texcoord0.y / _MainTex_ST.y); + #if ATLAS_ON + tiledUv = half2((tiledUv.x - _MinXUV) / (_MaxXUV - _MinXUV), (tiledUv.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + clip((1 - _ClipUvUp) - tiledUv.y); + clip(tiledUv.y - _ClipUvDown); + clip((1 - _ClipUvRight) - tiledUv.x); + clip(tiledUv.x - _ClipUvLeft); + #endif + //---------------------------------- + + //RADIALCLIPPING_ON + #if RADIALCLIPPING_ON + half2 tiledUv2 = half2(d.texcoord0.x / _MainTex_ST.x, d.texcoord0.y / _MainTex_ST.y); + #if ATLAS_ON + tiledUv2 = half2((tiledUv2.x - _MinXUV) / (_MaxXUV - _MinXUV), (tiledUv2.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half startAngle = _RadialStartAngle - _RadialClip; + half endAngle = _RadialStartAngle + _RadialClip2; + half offset0 = clamp(0, 360, startAngle + 360); + half offset360 = clamp(0, 360, endAngle - 360); + half2 atan2Coord = half2(lerp(-1, 1, tiledUv2.x), lerp(-1, 1, tiledUv2.y)); + half atanAngle = atan2(atan2Coord.y, atan2Coord.x) * 57.3; // angle in degrees + if(atanAngle < 0) atanAngle = 360 + atanAngle; + if(atanAngle >= startAngle && atanAngle <= endAngle) discard; + if(atanAngle <= offset360) discard; + if(atanAngle >= offset0) discard; + #endif + + //----------------------------- + + //TEXTURESCROLL_ON && ATLAS_ON + #if TEXTURESCROLL_ON && ATLAS_ON + d.texcoord0.xy = half2(_MinXUV + ((_MaxXUV - _MinXUV) * (abs(((_Time.y + randomSeed) * _TextureScrollXSpeed) + uvRect.x) % 1)), + _MinYUV + ((_MaxYUV - _MinYUV) * (abs(((_Time.y + randomSeed) * _TextureScrollYSpeed) + uvRect.y) % 1))); + #endif + //---------------------------- + + //OFFSETUV_ON + #if OFFSETUV_ON + #if ATLAS_ON + d.texcoord0.xy = half2(_MinXUV + ((_MaxXUV - _MinXUV) * (abs((_OffsetUvX + uvRect.x) % 1))), + _MinYUV + ((_MaxYUV - _MinYUV) * (abs(_OffsetUvY + uvRect.y) % 1))); + #else + d.texcoord0.xy += half2(_OffsetUvX, _OffsetUvY); + #endif + #endif + + //---------------------- + + //POLARUV_ON + #if POLARUV_ON + d.texcoord0.xy = half2(atan2(d.texcoord0.y, d.texcoord0.x) / (2.0f * 3.141592653589f), length(d.texcoord0.xy)); + d.texcoord0.xy *= _MainTex_ST.xy; + #endif + + //-------------------------------------- + + //TWISTUV_ON + #if TWISTUV_ON + #if ATLAS_ON + _TwistUvPosX = ((_MaxXUV - _MinXUV) * _TwistUvPosX) + _MinXUV; + _TwistUvPosY = ((_MaxYUV - _MinYUV) * _TwistUvPosY) + _MinYUV; + #endif + half2 tempUv = d.texcoord0.xy - half2(_TwistUvPosX * _MainTex_ST.x, _TwistUvPosY * _MainTex_ST.y); + _TwistUvRadius *= (_MainTex_ST.x + _MainTex_ST.y) / 2; + half percent = (_TwistUvRadius - length(tempUv)) / _TwistUvRadius; + half theta = percent * percent * (2.0 * sin(_TwistUvAmount)) * 8.0; + half s = sin(theta); + half c = cos(theta); + half beta = max(sign(_TwistUvRadius - length(tempUv)), 0.0); + tempUv = half2(dot(tempUv, half2(c, -s)), dot(tempUv, half2(s, c))) * beta + tempUv * (1 - beta); + tempUv += half2(_TwistUvPosX * _MainTex_ST.x, _TwistUvPosY * _MainTex_ST.y); + d.texcoord0.xy = tempUv; + #endif + + //-------------------------------------------- + + //FISHEYE_ON + #if FISHEYE_ON + half bind = length(centerTiled); + half2 dF = d.texcoord0.xy - centerTiled; + half dFlen = length(dF); + half fishInt = (3.14159265359 / bind) * (_FishEyeUvAmount + 0.001); + d.texcoord0.xy = centerTiled + (dF / (max(0.0001, dFlen))) * tan(dFlen * fishInt) * bind / tan(bind * fishInt); + #endif + //--------------------------------------------- + + //PINCH_ON + #if PINCH_ON + half2 dP = d.texcoord0.xy - centerTiled; + half pinchInt = (3.141592 / length(centerTiled)) * (-_PinchUvAmount + 0.001); + d.texcoord0.xy = centerTiled + normalize(dP) * atan(length(dP) * -pinchInt * 10.0) * 0.5 / atan(-pinchInt * 5); + #endif + + //--------------------------------------------- + + //ZOOMUV_ON + #if ZOOMUV_ON + d.texcoord0.xy -= centerTiled; + d.texcoord0.xy = d.texcoord0.xy * _ZoomUvAmount; + d.texcoord0.xy += centerTiled; + #endif + + //----------------------------------------------- + + //DOODLE_ON + #if DOODLE_ON + half2 uvCopy = uvRect; + _HandDrawnSpeed = (floor((_Time.x + randomSeed) * 20 * _HandDrawnSpeed) / _HandDrawnSpeed) * _HandDrawnSpeed; + uvCopy.x = sin((uvCopy.x * _HandDrawnAmount + _HandDrawnSpeed) * 4); + uvCopy.y = cos((uvCopy.y * _HandDrawnAmount + _HandDrawnSpeed) * 4); + d.texcoord0.xy = lerp(d.texcoord0.xy, d.texcoord0.xy + uvCopy, 0.0005 * _HandDrawnAmount); + #endif + + //-------------------------- + + //SHAKEUV_ON + #if SHAKEUV_ON + half xShake = sin((_Time.x + randomSeed) * _ShakeUvSpeed * 50) * _ShakeUvX; + half yShake = cos((_Time.x + randomSeed) * _ShakeUvSpeed * 50) * _ShakeUvY; + d.texcoord0.xy += half2(xShake * 0.012, yShake * 0.01); + #endif + + //------------------------------------------- + + //RECTSIZE_ON + #if RECTSIZE_ON + d.texcoord0.xy = d.texcoord0.xy * (_RectSize).xx + (((-_RectSize * 0.5) + 0.5)).xx; + #endif + + //------------------------------------------- + + //DISTORT_ON + #if DISTORT_ON + #if ATLAS_ON + d.texcoord3.x = d.texcoord3.x * (1 / (_MaxXUV - _MinXUV)); + d.texcoord3.y = d.texcoord3.y * (1 / (_MaxYUV - _MinYUV)); + #endif + + d.texcoord3.x += ((_Time.x + _RandomSeed) * _DistortTexXSpeed) % 1; + d.texcoord3.y += ((_Time.x + _RandomSeed) * _DistortTexYSpeed) % 1; + half distortAmnt = (SAMPLE_TEXTURE2D(_DistortTex, sampler_DistortTex, d.texcoord3.xy).r - 0.5) * 0.2 * _DistortAmount; + d.texcoord0.x += distortAmnt; + d.texcoord0.y += distortAmnt; + #endif + //------------------------------------------------------- + + //WARP_ON + #if WARP_ON + half2 warpUv = half2(d.texcoord0.x / _MainTex_ST.x, d.texcoord0.y / _MainTex_ST.y); + #if ATLAS_ON + warpUv = half2((warpUv.x - _MinXUV) / (_MaxXUV - _MinXUV), (warpUv.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + const float tau = 6.283185307179586; + float xWarp = (_Time.y + randomSeed) * _WarpSpeed + warpUv.x * tau / _WarpScale; + float yWarp = (_Time.y + randomSeed) * _WarpSpeed + warpUv.y * tau / _WarpScale; + float2 warp = float2(sin(xWarp), sin(yWarp)) * _WarpStrength; + d.texcoord0.xy += warp; + #endif + + //------------------------------------------------------- + + //WAVEUV_ON + #if WAVEUV_ON + float2 uvWave = half2(_WaveX * _MainTex_ST.x, _WaveY * _MainTex_ST.y) - d.texcoord0.xy; + uvWave %= 1; + #if ATLAS_ON + uvWave = half2(_WaveX, _WaveY) - uvRect; + #endif + uvWave.x *= _ScreenParams.x / _ScreenParams.y; + float waveTime = _Time.y + randomSeed; + float angWave = (sqrt(dot(uvWave, uvWave)) * _WaveAmount) - ((waveTime * _WaveSpeed)); + d.texcoord0.xy = d.texcoord0.xy + uvWave * sin(angWave) * (_WaveStrength / 1000.0); + #endif + //---------------------------------------------------- + + //ROUNDWAVEUV_ON + #if ROUNDWAVEUV_ON + half xWave = ((0.5 * _MainTex_ST.x) - uvRect.x); + half yWave = ((0.5 * _MainTex_ST.y) - uvRect.y) * (_MainTex_TexelSize.w / _MainTex_TexelSize.z); + half ripple = -sqrt(xWave*xWave + yWave* yWave); + d.texcoord0.xy += (sin((ripple + (_Time.y + randomSeed) * (_RoundWaveSpeed/10.0)) / 0.015) * (_RoundWaveStrength/10.0)) % 1; + #endif + //---------------------------------------------------- + + + //WIND_ON + #if WIND_ON + half windOffset = sin((_Time.x + randomSeed) * _GrassSpeed * 10); + half2 windCenter = half2(0.5, 0.1); + #if ATLAS_ON + windCenter.x = ((_MaxXUV - _MinXUV) * windCenter.x) + _MinXUV; + windCenter.y = ((_MaxYUV - _MinYUV) * windCenter.y) + _MinYUV; + #endif + #if !MANUALWIND_ON + d.texcoord0.x = fmod(abs(lerp(d.texcoord0.x, d.texcoord0.x + (_GrassWind * 0.01 * windOffset), uvRect.y)), 1); + #else + d.texcoord0.x = fmod(abs(lerp(d.texcoord0.x, d.texcoord0.x + (_GrassWind * 0.01 * _GrassManualAnim), uvRect.y)), 1); + windOffset = _GrassManualAnim; + #endif + half2 delta = d.texcoord0.xy - windCenter; + half delta2 = dot(delta.xy, delta.xy); + half2 delta_offset = delta2 * windOffset; + d.texcoord0.xy = d.texcoord0.xy + half2(delta.y, -delta.x) * delta_offset * _GrassRadialBend; + #endif + + //-------------------------------------------------------- + + //TEXTURESCROLL_ON && !ATLAS_ON + #if TEXTURESCROLL_ON && !ATLAS_ON + d.texcoord0.x += ((_Time.y + randomSeed) * _TextureScrollXSpeed) % 1; + d.texcoord0.y += ((_Time.y + randomSeed) * _TextureScrollYSpeed) % 1; + #endif + //------------------------------ + + //PIXELATE_ON + #if PIXELATE_ON + half aspectRatio = _MainTex_TexelSize.x / _MainTex_TexelSize.y; + half2 pixelSize = float2(_PixelateSize, _PixelateSize * aspectRatio); + d.texcoord0.xy = floor(d.texcoord0.xy * pixelSize) / pixelSize; + #endif + //-------------- + + half4 col = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy); + half originalAlpha = col.a; + col *= d.vertexColor; + + //NORMAL MAP + #if NORMALMAP_ON + half4 normalSample = SAMPLE_TEXTURE2D(_NormalMap, sampler_NormalMap, d.texcoord0.xy); + half3 normalTS = UnpackNormal(normalSample); + normalTS.xy *= _NormalStrength; + o.Normal = normalTS; + #endif + + + //GLITCH_ON + #if GLITCH_ON + half2 uvGlitch = uvRect; + uvGlitch.y -= 0.5; + half lineNoise = pow(rand2(floor(uvGlitch * half2(24., 19.) * _GlitchSize) * 4.0, randomSeed), 3.0) * _GlitchAmount + * pow(rand2(floor(uvGlitch * half2(38., 14.) * _GlitchSize) * 4.0, randomSeed), 3.0); + col = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(lineNoise * 0.02 * rand2(half2(2.0, 1), randomSeed), 0)) * d.vertexColor; + #endif + //-------------------------------------- + + //CHROMABERR_ON + #if CHROMABERR_ON + half4 r = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(_ChromAberrAmount/10, 0)) * d.vertexColor; + half4 b = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(-_ChromAberrAmount/10, 0)) * d.vertexColor; + col = half4(r.r * r.a, col.g, b.b * b.a, max(max(r.a, b.a) * _ChromAberrAlpha, col.a)); + #endif + + //-------------------------------- + + //BLUR_ON + #if BLUR_ON + #if ATLAS_ON + #if !BLURISHD_ON + col = BlurHD(d.texcoord0.xy, _MainTex, sampler_MainTex, _BlurIntensity, (_MaxXUV - _MinXUV), (_MaxYUV - _MinYUV)) * d.vertexColor; + #else + col = Blur(d.texcoord0.xy, _MainTex, sampler_MainTex, _BlurIntensity * (_MaxXUV - _MinXUV)) * d.vertexColor; + #endif + #else + #if !BLURISHD_ON + col = BlurHD(d.texcoord0.xy, _MainTex, sampler_MainTex, _BlurIntensity, 1, 1) * d.vertexColor; + #else + col = Blur(d.texcoord0.xy, _MainTex, sampler_MainTex, _BlurIntensity) * d.vertexColor; + #endif + #endif + #endif + + //-------------------- + + //MOTIONBLUR_ON + #if MOTIONBLUR_ON + _MotionBlurAngle = _MotionBlurAngle * 3.1415926; + #define rot(n) mul(n, half2x2(cos(_MotionBlurAngle), -sin(_MotionBlurAngle), sin(_MotionBlurAngle), cos(_MotionBlurAngle))) + _MotionBlurDist = _MotionBlurDist * 0.005; + #if ATLAS_ON + _MotionBlurDist *= (_MaxXUV - _MinXUV); + #endif + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(-_MotionBlurDist, -_MotionBlurDist))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(-_MotionBlurDist * 2, -_MotionBlurDist * 2))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(-_MotionBlurDist * 3, -_MotionBlurDist * 3))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(-_MotionBlurDist * 4, -_MotionBlurDist * 4))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(_MotionBlurDist, _MotionBlurDist))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(_MotionBlurDist * 2, _MotionBlurDist * 2))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(_MotionBlurDist * 3, _MotionBlurDist * 3))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(_MotionBlurDist * 4, _MotionBlurDist * 4))); + col.rgb = col.rgb / 9; + #endif + //------------------------------------ + + //NEGATIVE_ON + #if NEGATIVE_ON + col.rgb = lerp(col.rgb, 1 - col.rgb, _NegativeAmount); + #endif + + //-------------- + half luminance = 0; + + //GREYSCALE_ON && !GREYSCALEOUTLINE_ON + #if GREYSCALE_ON && !GREYSCALEOUTLINE_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + luminance = saturate(luminance + _GreyscaleLuminosity); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _GreyscaleTintColor, _GreyscaleBlend); + #endif + //------------------------------------ + + //GHOST_ON + #if GHOST_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + half4 ghostResult; + ghostResult.a = saturate(luminance - _GhostTransparency) * col.a; + ghostResult.rgb = col.rgb * (luminance + _GhostColorBoost); + col = lerp(col, ghostResult, _GhostBlend); + #endif + //------------------------------------ + + //INNEROUTLINE_ON + #if INNEROUTLINE_ON + half3 innerT = abs(GetPixel(0, _InnerOutlineThickness, d.texcoord0.xy, _MainTex, sampler_MainTex) - GetPixel(0, -_InnerOutlineThickness, d.texcoord0.xy, _MainTex, sampler_MainTex)); + innerT += abs(GetPixel(_InnerOutlineThickness, 0, d.texcoord0.xy, _MainTex, sampler_MainTex) - GetPixel(-_InnerOutlineThickness, 0, d.texcoord0.xy, _MainTex, sampler_MainTex)); + #if !ONLYINNEROUTLINE_ON + innerT = (innerT / 2.0) * col.a * _InnerOutlineAlpha; + col.rgb += length(innerT) * _InnerOutlineColor.rgb * _InnerOutlineGlow; + #else + innerT *= col.a * _InnerOutlineAlpha; + col.rgb = length(innerT) * _InnerOutlineColor.rgb * _InnerOutlineGlow; + col.a = step(0.3, col.r+col.g+col.b); + #endif + #endif + //------------------------------------------------------- + + //HITEFFECT_ON + #if HITEFFECT_ON + col.rgb = lerp(col.rgb, _HitEffectColor.rgb * _HitEffectGlow, _HitEffectBlend); + #endif + //-------------------- + + //GRADIENT_ON + #if GRADIENT_ON + half2 tiledUvGrad = half2(uvRect.x / _MainTex_ST.x, uvRect.y / _MainTex_ST.y); + #if GRADIENT2COL_ON + _GradTopRightCol = _GradTopLeftCol; + _GradBotRightCol = _GradBotLeftCol; + #endif + #if RADIALGRADIENT_ON + half radialDist = 1 - length(tiledUvGrad - half2(0.5, 0.5)); + radialDist *= (_MainTex_TexelSize.w / _MainTex_TexelSize.z); + radialDist = saturate(_GradBoostX * radialDist); + half4 gradientResult = lerp(_GradTopLeftCol, _GradBotLeftCol, radialDist); + #else + half gradXLerpFactor = saturate(pow(tiledUvGrad.x, _GradBoostX)); + half4 gradientResult = lerp(lerp(_GradBotLeftCol, _GradBotRightCol, gradXLerpFactor), + lerp(_GradTopLeftCol, _GradTopRightCol, gradXLerpFactor), saturate(pow(tiledUvGrad.y, _GradBoostY))); + #endif + gradientResult = lerp(col, gradientResult, _GradBlend); + col.rgb = gradientResult.rgb * col.a; + col.a *= gradientResult.a; + #endif + //-------------------------------------------------------------------- + + //CONTRAST_ON + #if CONTRAST_ON + col.rgb = (col.rgb - float3(0.5, 0.5, 0.5)) * _Contrast + float3(0.5, 0.5, 0.5); + col.rgb += _Brightness; + #endif + + //------------------------------------------------------------------- + + //COLORSWAP_ON + #if COLORSWAP_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + half4 swapMask = SAMPLE_TEXTURE2D(_ColorSwapTex, sampler_ColorSwapTex, d.texcoord0.xy); + swapMask.rgb *= swapMask.a; + half3 redSwap = _ColorSwapRed * swapMask.r * saturate(luminance + _ColorSwapRedLuminosity); + half3 greenSwap = _ColorSwapGreen * swapMask.g * saturate(luminance + _ColorSwapGreenLuminosity); + half3 blueSwap = _ColorSwapBlue * swapMask.b * saturate(luminance + _ColorSwapBlueLuminosity); + swapMask.rgb = col.rgb * saturate(1 - swapMask.r - swapMask.g - swapMask.b); + col.rgb = lerp(col.rgb, swapMask.rgb + redSwap + greenSwap + blueSwap, _ColorSwapBlend); + #endif + //-------------------------------------------------------------------- + + //COLORRAMP_ON && !COLORRAMPOUTLINE_ON + #if COLORRAMP_ON && !COLORRAMPOUTLINE_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + luminance = saturate(luminance + _ColorRampLuminosity); + #if GRADIENTCOLORRAMP_ON + col.rgb = lerp(col.rgb, SAMPLE_TEXTURE2D(_ColorRampTexGradient, sampler_ColorRampTexGradient, half2(luminance, 0)).rgb, _ColorRampBlend); + #else + col.rgb = lerp(col.rgb, SAMPLE_TEXTURE2D(_ColorRampTex, sampler_ColorRampTex, half2(luminance, 0)).rgb, _ColorRampBlend); + #endif + #endif + //-------------------------------------------------------------------- + + //CHANGECOLOR_ON + #if CHANGECOLOR_ON + float3 currChangeColor = saturate(col.rgb); + luminance = 0.3 * currChangeColor.r + 0.59 * currChangeColor.g + 0.11 * currChangeColor.b; + luminance = saturate(luminance + _ColorChangeLuminosity); + half3 dif = abs(currChangeColor - _ColorChangeTarget.rgb); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _ColorChangeNewCol.rgb, + max(sign(1 - saturate(dif.x + dif.y + dif.z) - _ColorChangeTolerance), 0.0)); + #if CHANGECOLOR2_ON + dif = abs(currChangeColor - _ColorChangeTarget2.rgb); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _ColorChangeNewCol2.rgb, + max(sign(1 - saturate(dif.x + dif.y + dif.z) - _ColorChangeTolerance2), 0.0)); + #endif + #if CHANGECOLOR3_ON + dif = abs(currChangeColor - _ColorChangeTarget3.rgb); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _ColorChangeNewCol3.rgb, + max(sign(1 - saturate(dif.x + dif.y + dif.z) - _ColorChangeTolerance3), 0.0)); + #endif + #endif + //------------------------------------------------------- + + //POSTERIZE_ON && !POSTERIZEOUTLINE_ON + #if POSTERIZE_ON && !POSTERIZEOUTLINE_ON + col.rgb = pow(col.rgb, _PosterizeGamma) * _PosterizeNumColors; + col.rgb = floor(col.rgb) / _PosterizeNumColors; + col.rgb = pow(col.rgb, 1.0 / _PosterizeGamma); + #endif + //------------------------------------ + + //HSV_ON + #if HSV_ON + half3 resultHsv = half3(col.rgb); + half cosHsv = _HsvBright * _HsvSaturation * cos(_HsvShift * 3.14159265 / 180); + half sinHsv = _HsvBright * _HsvSaturation * sin(_HsvShift * 3.14159265 / 180); + resultHsv.x = (.299 * _HsvBright + .701 * cosHsv + .168 * sinHsv) * col.x + + (.587 * _HsvBright - .587 * cosHsv + .330 * sinHsv) * col.y + + (.114 * _HsvBright - .114 * cosHsv - .497 * sinHsv) * col.z; + resultHsv.y = (.299 * _HsvBright - .299 * cosHsv - .328 * sinHsv) *col.x + + (.587 * _HsvBright + .413 * cosHsv + .035 * sinHsv) * col.y + + (.114 * _HsvBright - .114 * cosHsv + .292 * sinHsv) * col.z; + resultHsv.z = (.299 * _HsvBright - .3 * cosHsv + 1.25 * sinHsv) * col.x + + (.587 * _HsvBright - .588 * cosHsv - 1.05 * sinHsv) * col.y + + (.114 * _HsvBright + .886 * cosHsv - .203 * sinHsv) * col.z; + col.rgb = resultHsv; + #endif + //------------------------------------------------------- + + //OVERLAY_ON + #if OVERLAY_ON + half2 overlayUvs = d.texcoord0.xy; + overlayUvs.x += ((_Time.y + randomSeed) * _OverlayTextureScrollXSpeed) % 1; + overlayUvs.y += ((_Time.y + randomSeed) * _OverlayTextureScrollYSpeed) % 1; + half4 overlayCol = SAMPLE_TEXTURE2D(_OverlayTex, sampler_OverlayTex, TRANSFORM_TEX(overlayUvs, _OverlayTex)); + overlayCol.rgb *= _OverlayColor.rgb * _OverlayGlow; + #if !OVERLAYMULT_ON + overlayCol.rgb *= overlayCol.a * _OverlayColor.rgb * _OverlayColor.a * _OverlayBlend; + col.rgb += overlayCol.rgb; + #else + overlayCol.a *= _OverlayColor.a; + col = lerp(col, col * overlayCol, _OverlayBlend); + #endif + #endif + + //--------------------------------- + + //OUTBASE_ON + #if OUTBASE_ON + #if OUTBASEPIXELPERF_ON + half2 destUv = half2(_OutlinePixelWidth * _MainTex_TexelSize.x, _OutlinePixelWidth * _MainTex_TexelSize.y); + #else + half2 destUv = half2(_OutlineWidth * _MainTex_TexelSize.x * 200, _OutlineWidth * _MainTex_TexelSize.y * 200); + #endif + + #if OUTDIST_ON + d.texcoord3.x += ((_Time.x + _RandomSeed) * _OutlineDistortTexXSpeed) % 1; + d.texcoord3.y += ((_Time.x + _RandomSeed) * _OutlineDistortTexYSpeed) % 1; + #if ATLAS_ON + d.texcoord3 = half2((d.texcoord3.x - _MinXUV) / (_MaxXUV - _MinXUV), (d.texcoord3.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half outDistortAmnt = (SAMPLE_TEXTURE2D(_OutlineDistortTex, sampler_OutlineDistortTex, d.texcoord3).r - 0.5) * 0.2 * _OutlineDistortAmount; + destUv.x += outDistortAmnt; + destUv.y += outDistortAmnt; + #endif + + half spriteLeft = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(destUv.x, 0)).a; + half spriteRight = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy - half2(destUv.x, 0)).a; + half spriteBottom = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(0, destUv.y)).a; + half spriteTop = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy - half2(0, destUv.y)).a; + half result = spriteLeft + spriteRight + spriteBottom + spriteTop; + + #if OUTBASE8DIR_ON + half spriteTopLeft = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(destUv.x, destUv.y)).a; + half spriteTopRight = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(-destUv.x, destUv.y)).a; + half spriteBotLeft = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(destUv.x, -destUv.y)).a; + half spriteBotRight = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(-destUv.x, -destUv.y)).a; + result = result + spriteTopLeft + spriteTopRight + spriteBotLeft + spriteBotRight; + #endif + + result = step(0.05, saturate(result)); + + #if OUTTEX_ON + d.texcoord1.x += ((_Time.x + _RandomSeed) * _OutlineTexXSpeed) % 1; + d.texcoord1.y += ((_Time.x + _RandomSeed) * _OutlineTexYSpeed) % 1; + #if ATLAS_ON + d.texcoord1 = half2((d.texcoord1.x - _MinXUV) / (_MaxXUV - _MinXUV), (d.texcoord1.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half4 tempOutColor = SAMPLE_TEXTURE2D(_OutlineTex, sampler_OutlineTex, d.texcoord1); + tempOutColor *= _OutlineColor; + _OutlineColor = tempOutColor; + #endif + + result *= (1 - originalAlpha) * _OutlineAlpha; + + half4 outline = _OutlineColor * d.vertexColor.a; + outline.rgb *= _OutlineGlow; + outline.a = result; + #if ONLYOUTLINE_ON + col = outline; + #else + col = lerp(col, outline, result); + #endif + #endif + //------------------------------------------------------- + + //FADE_ON + #if FADE_ON + half2 tiledUvFade1 = TRANSFORM_TEX(d.texcoord0, _FadeTex); + half2 tiledUvFade2 = TRANSFORM_TEX(d.texcoord0, _FadeBurnTex); + #if ATLAS_ON + tiledUvFade1 = half2((tiledUvFade1.x - _MinXUV) / (_MaxXUV - _MinXUV), (tiledUvFade1.y - _MinYUV) / (_MaxYUV - _MinYUV)); + tiledUvFade2 = half2((tiledUvFade2.x - _MinXUV) / (_MaxXUV - _MinXUV), (tiledUvFade2.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half fadeTemp = SAMPLE_TEXTURE2D(_FadeTex, sampler_FadeTex, tiledUvFade1).r; + half fade = smoothstep(_FadeAmount, _FadeAmount + _FadeBurnTransition, fadeTemp); + half fadeBurn = saturate(smoothstep(_FadeAmount - _FadeBurnWidth, _FadeAmount - _FadeBurnWidth + 0.1, fadeTemp) * _FadeAmount); + col.a *= fade; + _FadeBurnColor.rgb *= _FadeBurnGlow; + col += fadeBurn * SAMPLE_TEXTURE2D(_FadeBurnTex, sampler_FadeBurnTex, tiledUvFade2) * _FadeBurnColor * originalAlpha * (1 - col.a); + #endif + //------------------------------------------------------- + + //SHADOW_ON + #if SHADOW_ON + half shadowA = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(_ShadowX, _ShadowY)).a; + half preMultShadowMask = 1 - (saturate(shadowA - col.a) * (1 - col.a)); + col.rgb *= 1 - ((shadowA - col.a) * (1 - col.a)); + col.rgb += (_ShadowColor * shadowA) * (1 - col.a); + col.a = max(shadowA * _ShadowAlpha * d.vertexColor.a, col.a); + #endif + + //------------------------------------------------------- + + //GLOW_ON + #if GLOW_ON + half4 emission; + #if GLOWTEX_ON + emission = SAMPLE_TEXTURE2D(_GlowTex, sampler_GlowTex, d.texcoord0); + #else + emission = col; + #endif + + col.rgb *= _GlowGlobal; + emission.rgb *= emission.a * col.a * _Glow * _GlowColor; + col.rgb += emission.rgb; + #endif + //------------------------------------------------------- + + //COLORRAMP_ON && COLORRAMPOUTLINE_ON + #if COLORRAMP_ON && COLORRAMPOUTLINE_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + luminance = saturate(luminance + _ColorRampLuminosity); + #if GRADIENTCOLORRAMP_ON + col.rgb = lerp(col.rgb, SAMPLE_TEXTURE2D(_ColorRampTexGradient, sampler_ColorRampTexGradient, half2(luminance, 0)).rgb, _ColorRampBlend); + #else + col.rgb = lerp(col.rgb, SAMPLE_TEXTURE2D(_ColorRampTex, sampler_ColorRampTex, half2(luminance, 0)).rgb, _ColorRampBlend); + #endif + #endif + //--------------- + + //GREYSCALE_ON && GREYSCALEOUTLINE_ON + #if GREYSCALE_ON && GREYSCALEOUTLINE_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + luminance = saturate(luminance + _GreyscaleLuminosity); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _GreyscaleTintColor, _GreyscaleBlend); + #endif + + //----------------------------------- + + //POSTERIZE_ON && POSTERIZEOUTLINE_ON + #if POSTERIZE_ON && POSTERIZEOUTLINE_ON + col.rgb = pow(col.rgb, _PosterizeGamma) * _PosterizeNumColors; + col.rgb = floor(col.rgb) / _PosterizeNumColors; + col.rgb = pow(col.rgb, 1.0 / _PosterizeGamma); + #endif + + //----------------------------------- + + //SHINE_ON + #if SHINE_ON + half2 uvShine = uvRect; + half cosAngle = cos(_ShineRotate); + half sinAngle = sin(_ShineRotate); + half2x2 rot = half2x2(cosAngle, -sinAngle, sinAngle, cosAngle); + uvShine -= half2(0.5, 0.5); + uvShine = mul(rot, uvShine); + uvShine += half2(0.5, 0.5); + half shineMask = SAMPLE_TEXTURE2D(_ShineMask, sampler_ShineMask, d.texcoord0.xy).a; + half currentDistanceProjection = (uvShine.x + uvShine.y) / 2; + half whitePower = 1 - (abs(currentDistanceProjection - _ShineLocation) / _ShineWidth); + col.rgb += col.a * whitePower * _ShineGlow * max(sign(currentDistanceProjection - (_ShineLocation - _ShineWidth)), 0.0) + * max(sign((_ShineLocation + _ShineWidth) - currentDistanceProjection), 0.0) * _ShineColor * shineMask; + #endif + + //----------------------------------- + + //HOLOGRAM_ON + #if HOLOGRAM_ON + half totalHologram = _HologramStripesAmount + _HologramUnmodAmount; + half hologramYCoord = ((uvRect.y + (((_Time.x + randomSeed) % 1) * _HologramStripesSpeed)) % totalHologram) / totalHologram; + hologramYCoord = abs(hologramYCoord); + half alpha = RemapFloat(saturate(hologramYCoord - (_HologramUnmodAmount/totalHologram)), 0.0, 1.0, _HologramMinAlpha, saturate(_HologramMaxAlpha)); + half hologramMask = max(sign((_HologramUnmodAmount/totalHologram) - hologramYCoord), 0.0); + half4 hologramResult = col; + hologramResult.a *= lerp(alpha, 1, hologramMask); + hologramResult.rgb *= max(1, _HologramMaxAlpha * max(sign(hologramYCoord - (_HologramUnmodAmount/totalHologram)), 0.0)); + hologramMask = 1 - step(0.01,hologramMask); + hologramResult.rgb += hologramMask * _HologramStripeColor * col.a; + col = lerp(col, hologramResult, _HologramBlend); + #endif + + //----------------------------------- + + //FLICKER_ON + #if FLICKER_ON + col.a *= saturate(col.a * step(frac(0.05 + (_Time.w + randomSeed) * _FlickerFreq), 1 - _FlickerPercent) + _FlickerAlpha); + #endif + //----------------------------------- + + //ALPHACUTOFF_ON + + //ALPHAROUND_ON + + //ALPHAOUTLINE_ON + #if ALPHAOUTLINE_ON + half alphaOutlineRes = pow(1 - col.a, max(_AlphaOutlinePower, 0.0001)) * step(_AlphaOutlineMinAlpha, col.a) * _AlphaOutlineBlend; + col.rgb = lerp(col.rgb, _AlphaOutlineColor.rgb * _AlphaOutlineGlow, alphaOutlineRes); + col.a = lerp(col.a, 1, alphaOutlineRes > 1); + #endif + //------------------------------------------------------- + + //FOG_ON + + //------------------ + + col *= _Color; + o.Albedo = col; + col.a *= _Alpha; + clip(col.a - _AlphaCutoffValue - 0.01); + o.Alpha = _Color.a; + } + + + + + + void ChainSurfaceFunction(inout Surface l, inout ShaderData d) + { + Ext_SurfaceFunction0(l, d); + // Ext_SurfaceFunction1(l, d); + // Ext_SurfaceFunction2(l, d); + // Ext_SurfaceFunction3(l, d); + // Ext_SurfaceFunction4(l, d); + // Ext_SurfaceFunction5(l, d); + // Ext_SurfaceFunction6(l, d); + // Ext_SurfaceFunction7(l, d); + // Ext_SurfaceFunction8(l, d); + // Ext_SurfaceFunction9(l, d); + // Ext_SurfaceFunction10(l, d); + // Ext_SurfaceFunction11(l, d); + // Ext_SurfaceFunction12(l, d); + // Ext_SurfaceFunction13(l, d); + // Ext_SurfaceFunction14(l, d); + // Ext_SurfaceFunction15(l, d); + // Ext_SurfaceFunction16(l, d); + // Ext_SurfaceFunction17(l, d); + // Ext_SurfaceFunction18(l, d); + // Ext_SurfaceFunction19(l, d); + // Ext_SurfaceFunction20(l, d); + // Ext_SurfaceFunction21(l, d); + // Ext_SurfaceFunction22(l, d); + // Ext_SurfaceFunction23(l, d); + // Ext_SurfaceFunction24(l, d); + // Ext_SurfaceFunction25(l, d); + // Ext_SurfaceFunction26(l, d); + // Ext_SurfaceFunction27(l, d); + // Ext_SurfaceFunction28(l, d); + // Ext_SurfaceFunction29(l, d); + } + +#if !_DECALSHADER + + void ChainModifyVertex(inout VertexData v, inout VertexToPixel v2p, float4 time) + { + ExtraV2F d; + + ZERO_INITIALIZE(ExtraV2F, d); + ZERO_INITIALIZE(Blackboard, d.blackboard); + // due to motion vectors in HDRP, we need to use the last + // time in certain spots. So if you are going to use _Time to adjust vertices, + // you need to use this time or motion vectors will break. + d.time = time; + + Ext_ModifyVertex0(v, d); + // Ext_ModifyVertex1(v, d); + // Ext_ModifyVertex2(v, d); + // Ext_ModifyVertex3(v, d); + // Ext_ModifyVertex4(v, d); + // Ext_ModifyVertex5(v, d); + // Ext_ModifyVertex6(v, d); + // Ext_ModifyVertex7(v, d); + // Ext_ModifyVertex8(v, d); + // Ext_ModifyVertex9(v, d); + // Ext_ModifyVertex10(v, d); + // Ext_ModifyVertex11(v, d); + // Ext_ModifyVertex12(v, d); + // Ext_ModifyVertex13(v, d); + // Ext_ModifyVertex14(v, d); + // Ext_ModifyVertex15(v, d); + // Ext_ModifyVertex16(v, d); + // Ext_ModifyVertex17(v, d); + // Ext_ModifyVertex18(v, d); + // Ext_ModifyVertex19(v, d); + // Ext_ModifyVertex20(v, d); + // Ext_ModifyVertex21(v, d); + // Ext_ModifyVertex22(v, d); + // Ext_ModifyVertex23(v, d); + // Ext_ModifyVertex24(v, d); + // Ext_ModifyVertex25(v, d); + // Ext_ModifyVertex26(v, d); + // Ext_ModifyVertex27(v, d); + // Ext_ModifyVertex28(v, d); + // Ext_ModifyVertex29(v, d); + + + // #if %EXTRAV2F0REQUIREKEY% + // v2p.extraV2F0 = d.extraV2F0; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // v2p.extraV2F1 = d.extraV2F1; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // v2p.extraV2F2 = d.extraV2F2; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // v2p.extraV2F3 = d.extraV2F3; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // v2p.extraV2F4 = d.extraV2F4; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // v2p.extraV2F5 = d.extraV2F5; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // v2p.extraV2F6 = d.extraV2F6; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // v2p.extraV2F7 = d.extraV2F7; + // #endif + } + + void ChainModifyTessellatedVertex(inout VertexData v, inout VertexToPixel v2p) + { + ExtraV2F d; + ZERO_INITIALIZE(ExtraV2F, d); + ZERO_INITIALIZE(Blackboard, d.blackboard); + + // #if %EXTRAV2F0REQUIREKEY% + // d.extraV2F0 = v2p.extraV2F0; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // d.extraV2F1 = v2p.extraV2F1; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // d.extraV2F2 = v2p.extraV2F2; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // d.extraV2F3 = v2p.extraV2F3; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // d.extraV2F4 = v2p.extraV2F4; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // d.extraV2F5 = v2p.extraV2F5; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // d.extraV2F6 = v2p.extraV2F6; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // d.extraV2F7 = v2p.extraV2F7; + // #endif + + + // Ext_ModifyTessellatedVertex0(v, d); + // Ext_ModifyTessellatedVertex1(v, d); + // Ext_ModifyTessellatedVertex2(v, d); + // Ext_ModifyTessellatedVertex3(v, d); + // Ext_ModifyTessellatedVertex4(v, d); + // Ext_ModifyTessellatedVertex5(v, d); + // Ext_ModifyTessellatedVertex6(v, d); + // Ext_ModifyTessellatedVertex7(v, d); + // Ext_ModifyTessellatedVertex8(v, d); + // Ext_ModifyTessellatedVertex9(v, d); + // Ext_ModifyTessellatedVertex10(v, d); + // Ext_ModifyTessellatedVertex11(v, d); + // Ext_ModifyTessellatedVertex12(v, d); + // Ext_ModifyTessellatedVertex13(v, d); + // Ext_ModifyTessellatedVertex14(v, d); + // Ext_ModifyTessellatedVertex15(v, d); + // Ext_ModifyTessellatedVertex16(v, d); + // Ext_ModifyTessellatedVertex17(v, d); + // Ext_ModifyTessellatedVertex18(v, d); + // Ext_ModifyTessellatedVertex19(v, d); + // Ext_ModifyTessellatedVertex20(v, d); + // Ext_ModifyTessellatedVertex21(v, d); + // Ext_ModifyTessellatedVertex22(v, d); + // Ext_ModifyTessellatedVertex23(v, d); + // Ext_ModifyTessellatedVertex24(v, d); + // Ext_ModifyTessellatedVertex25(v, d); + // Ext_ModifyTessellatedVertex26(v, d); + // Ext_ModifyTessellatedVertex27(v, d); + // Ext_ModifyTessellatedVertex28(v, d); + // Ext_ModifyTessellatedVertex29(v, d); + + // #if %EXTRAV2F0REQUIREKEY% + // v2p.extraV2F0 = d.extraV2F0; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // v2p.extraV2F1 = d.extraV2F1; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // v2p.extraV2F2 = d.extraV2F2; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // v2p.extraV2F3 = d.extraV2F3; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // v2p.extraV2F4 = d.extraV2F4; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // v2p.extraV2F5 = d.extraV2F5; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // v2p.extraV2F6 = d.extraV2F6; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // v2p.extraV2F7 = d.extraV2F7; + // #endif + } + + void ChainFinalColorForward(inout Surface l, inout ShaderData d, inout half4 color) + { + // Ext_FinalColorForward0(l, d, color); + // Ext_FinalColorForward1(l, d, color); + // Ext_FinalColorForward2(l, d, color); + // Ext_FinalColorForward3(l, d, color); + // Ext_FinalColorForward4(l, d, color); + // Ext_FinalColorForward5(l, d, color); + // Ext_FinalColorForward6(l, d, color); + // Ext_FinalColorForward7(l, d, color); + // Ext_FinalColorForward8(l, d, color); + // Ext_FinalColorForward9(l, d, color); + // Ext_FinalColorForward10(l, d, color); + // Ext_FinalColorForward11(l, d, color); + // Ext_FinalColorForward12(l, d, color); + // Ext_FinalColorForward13(l, d, color); + // Ext_FinalColorForward14(l, d, color); + // Ext_FinalColorForward15(l, d, color); + // Ext_FinalColorForward16(l, d, color); + // Ext_FinalColorForward17(l, d, color); + // Ext_FinalColorForward18(l, d, color); + // Ext_FinalColorForward19(l, d, color); + // Ext_FinalColorForward20(l, d, color); + // Ext_FinalColorForward21(l, d, color); + // Ext_FinalColorForward22(l, d, color); + // Ext_FinalColorForward23(l, d, color); + // Ext_FinalColorForward24(l, d, color); + // Ext_FinalColorForward25(l, d, color); + // Ext_FinalColorForward26(l, d, color); + // Ext_FinalColorForward27(l, d, color); + // Ext_FinalColorForward28(l, d, color); + // Ext_FinalColorForward29(l, d, color); + } + + void ChainFinalGBufferStandard(inout Surface s, inout ShaderData d, inout half4 GBuffer0, inout half4 GBuffer1, inout half4 GBuffer2, inout half4 outEmission, inout half4 outShadowMask) + { + // Ext_FinalGBufferStandard0(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard1(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard2(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard3(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard4(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard5(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard6(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard7(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard8(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard9(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard10(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard11(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard12(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard13(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard14(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard15(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard16(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard17(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard18(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard19(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard20(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard21(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard22(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard23(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard24(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard25(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard26(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard27(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard28(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard29(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + } +#endif + + + + + +#if _DECALSHADER + + ShaderData CreateShaderData(SurfaceDescriptionInputs IN) + { + ShaderData d = (ShaderData)0; + d.TBNMatrix = float3x3(IN.WorldSpaceTangent, IN.WorldSpaceBiTangent, IN.WorldSpaceNormal); + d.worldSpaceNormal = IN.WorldSpaceNormal; + d.worldSpaceTangent = IN.WorldSpaceTangent; + + d.worldSpacePosition = IN.WorldSpacePosition; + d.texcoord0 = IN.uv0.xyxy; + d.screenPos = IN.ScreenPosition; + + d.worldSpaceViewDir = normalize(_WorldSpaceCameraPos - d.worldSpacePosition); + + d.tangentSpaceViewDir = mul(d.TBNMatrix, d.worldSpaceViewDir); + + // these rarely get used, so we back transform them. Usually will be stripped. + #if _HDRP + // d.localSpacePosition = mul(GetWorldToObjectMatrix(), float4(GetCameraRelativePositionWS(d.worldSpacePosition), 1)).xyz; + #else + // d.localSpacePosition = mul(GetWorldToObjectMatrix(), float4(d.worldSpacePosition, 1)).xyz; + #endif + // d.localSpaceNormal = normalize(mul((float3x3)GetWorldToObjectMatrix(), d.worldSpaceNormal)); + // d.localSpaceTangent = normalize(mul((float3x3)GetWorldToObjectMatrix(), d.worldSpaceTangent.xyz)); + + // #if %SCREENPOSREQUIREKEY% + // d.screenUV = (IN.ScreenPosition.xy / max(0.01, IN.ScreenPosition.w)); + // #endif + + return d; + } +#else + + ShaderData CreateShaderData(VertexToPixel i + #if NEED_FACING + , bool facing + #endif + ) + { + ShaderData d = (ShaderData)0; + d.clipPos = i.pos; + d.worldSpacePosition = i.worldPos; + + d.worldSpaceNormal = normalize(i.worldNormal); + d.worldSpaceTangent.xyz = normalize(i.worldTangent.xyz); + + d.tangentSign = i.worldTangent.w * unity_WorldTransformParams.w; + float3 bitangent = cross(d.worldSpaceTangent.xyz, d.worldSpaceNormal) * d.tangentSign; + + d.TBNMatrix = float3x3(d.worldSpaceTangent, -bitangent, d.worldSpaceNormal); + d.worldSpaceViewDir = normalize(_WorldSpaceCameraPos - i.worldPos); + + d.tangentSpaceViewDir = mul(d.TBNMatrix, d.worldSpaceViewDir); + d.texcoord0 = i.texcoord0; + d.texcoord1 = i.texcoord1; + d.texcoord2 = i.texcoord2; + + // #if %TEXCOORD3REQUIREKEY% + d.texcoord3 = i.texcoord3; + // #endif + + // d.isFrontFace = facing; + // #if %VERTEXCOLORREQUIREKEY% + d.vertexColor = i.vertexColor; + // #endif + + // these rarely get used, so we back transform them. Usually will be stripped. + #if _HDRP + // d.localSpacePosition = mul(GetWorldToObjectMatrix(), float4(GetCameraRelativePositionWS(i.worldPos), 1)).xyz; + #else + // d.localSpacePosition = mul(GetWorldToObjectMatrix(), float4(i.worldPos, 1)).xyz; + #endif + // d.localSpaceNormal = normalize(mul((float3x3)GetWorldToObjectMatrix(), i.worldNormal)); + // d.localSpaceTangent = normalize(mul((float3x3)GetWorldToObjectMatrix(), i.worldTangent.xyz)); + + // #if %SCREENPOSREQUIREKEY% + // d.screenPos = i.screenPos; + // d.screenUV = (i.screenPos.xy / i.screenPos.w); + // #endif + + + // #if %EXTRAV2F0REQUIREKEY% + // d.extraV2F0 = i.extraV2F0; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // d.extraV2F1 = i.extraV2F1; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // d.extraV2F2 = i.extraV2F2; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // d.extraV2F3 = i.extraV2F3; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // d.extraV2F4 = i.extraV2F4; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // d.extraV2F5 = i.extraV2F5; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // d.extraV2F6 = i.extraV2F6; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // d.extraV2F7 = i.extraV2F7; + // #endif + + return d; + } + +#endif + + + +#if (SHADERPASS == SHADERPASS_LIGHT_TRANSPORT) + + // This was not in constant buffer in original unity, so keep outiside. But should be in as ShaderRenderPass frequency + float unity_OneOverOutputBoost; + float unity_MaxOutputValue; + + CBUFFER_START(UnityMetaPass) + // x = use uv1 as raster position + // y = use uv2 as raster position + bool4 unity_MetaVertexControl; + + // x = return albedo + // y = return normal + bool4 unity_MetaFragmentControl; + CBUFFER_END + + VertexToPixel Vert(VertexData inputMesh) + { + VertexToPixel output; + ZERO_INITIALIZE(VertexToPixel, output); + UNITY_SETUP_INSTANCE_ID(inputMesh); + UNITY_TRANSFER_INSTANCE_ID(inputMesh, output); + UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(output); + + // Output UV coordinate in vertex shader + float2 uv = float2(0.0, 0.0); + + if (unity_MetaVertexControl.x) + { + uv = inputMesh.texcoord1.xy * unity_LightmapST.xy + unity_LightmapST.zw; + } + else if (unity_MetaVertexControl.y) + { + uv = inputMesh.texcoord2.xy * unity_DynamicLightmapST.xy + unity_DynamicLightmapST.zw; + } + + // OpenGL right now needs to actually use the incoming vertex position + // so we create a fake dependency on it here that haven't any impact. + output.pos = float4(uv * 2.0 - 1.0, inputMesh.vertex.z > 0 ? 1.0e-4 : 0.0, 1.0); + + output.worldPos = TransformObjectToWorld(inputMesh.vertex.xyz).xyz; + + // Normal is required for triplanar mapping + output.worldNormal = TransformObjectToWorldNormal(inputMesh.normal); + // Not required but assign to silent compiler warning + output.worldTangent = float4(1.0, 0.0, 0.0, 0.0); + + output.texcoord0 = inputMesh.texcoord0; + output.texcoord1 = inputMesh.texcoord1; + output.texcoord2 = inputMesh.texcoord2; + // #if %TEXCOORD3REQUIREKEY% + output.texcoord3 = inputMesh.texcoord3; + // #endif + // #if %VERTEXCOLORREQUIREKEY% + output.vertexColor = inputMesh.vertexColor; + // #endif + + return output; + } +#else + + #if (_PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR))) + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/ShaderVariablesMatrixDefsHDCamera.hlsl" + + void MotionVectorPositionZBias(VertexToPixel input) + { + #if UNITY_REVERSED_Z + input.pos.z -= unity_MotionVectorsParams.z * input.pos.w; + #else + input.pos.z += unity_MotionVectorsParams.z * input.pos.w; + #endif + } + + #endif + + VertexToPixel Vert(VertexData input) + { + VertexToPixel output; + ZERO_INITIALIZE(VertexToPixel, output); + + UNITY_SETUP_INSTANCE_ID(input); + UNITY_TRANSFER_INSTANCE_ID(input, output); + UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(output); + + #if _HDRP && (_PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR))) + VertexData previousMesh = input; + #endif + + ChainModifyVertex(input, output, _Time); + + // This return the camera relative position (if enable) + float3 positionRWS = TransformObjectToWorld(input.vertex.xyz); + float3 normalWS = TransformObjectToWorldNormal(input.normal); + float4 tangentWS = float4(TransformObjectToWorldDir(input.tangent.xyz), input.tangent.w); + + + output.worldPos = GetAbsolutePositionWS(positionRWS); + output.pos = TransformWorldToHClip(positionRWS); + output.worldNormal = normalWS; + output.worldTangent = tangentWS; + + + output.texcoord0 = input.texcoord0; + output.texcoord1 = input.texcoord1; + output.texcoord2 = input.texcoord2; + + // #if %TEXCOORD3REQUIREKEY% + output.texcoord3 = input.texcoord3; + // #endif + + // #if %VERTEXCOLORREQUIREKEY% + output.vertexColor = input.vertexColor; + // #endif + + // #if %SCREENPOSREQUIREKEY% + // output.screenPos = ComputeScreenPos(output.pos, _ProjectionParams.x); + // #endif + + #if _HDRP && (_PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR))) + + #if !defined(TESSELLATION_ON) + MotionVectorPositionZBias(output); + #endif + + output.motionVectorCS = mul(UNITY_MATRIX_UNJITTERED_VP, float4(positionRWS.xyz, 1.0)); + // Note: unity_MotionVectorsParams.y is 0 is forceNoMotion is enabled + bool forceNoMotion = unity_MotionVectorsParams.y == 0.0; + if (forceNoMotion) + { + output.previousPositionCS = float4(0.0, 0.0, 0.0, 1.0); + } + else + { + bool hasDeformation = unity_MotionVectorsParams.x > 0.0; // Skin or morph target + + float3 effectivePositionOS = (hasDeformation ? previousMesh.previousPositionOS : previousMesh.vertex.xyz); + #if defined(_ADD_PRECOMPUTED_VELOCITY) + effectivePositionOS -= input.precomputedVelocity; + #endif + + previousMesh.vertex = float4(effectivePositionOS, 1); + VertexToPixel dummy = (VertexToPixel)0; + + + ChainModifyVertex(previousMesh, dummy, _LastTimeParameters); + + // we might need this for skinned objects? + //float3 normalWS = TransformPreviousObjectToWorldNormal(input.normal).xyz; + float3 previousPositionRWS = TransformPreviousObjectToWorld(previousMesh.vertex.xyz); + + #ifdef _WRITE_TRANSPARENT_MOTION_VECTOR + if (_TransparentCameraOnlyMotionVectors > 0) + { + previousPositionRWS = positionRWS.xyz; + } + #endif // _WRITE_TRANSPARENT_MOTION_VECTOR + + output.previousPositionCS = mul(UNITY_MATRIX_PREV_VP, float4(previousPositionRWS, 1.0)); + } + #endif // _HDRP && _PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR)) + + + return output; + } + + +#endif + + + + + + + + #if defined(WRITE_DECAL_BUFFER) && !defined(_DISABLE_DECALS) + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/Decal/DecalPrepassBuffer.hlsl" + #endif + + FragInputs BuildFragInputs(VertexToPixel input) + { + UNITY_SETUP_INSTANCE_ID(input); + FragInputs output; + ZERO_INITIALIZE(FragInputs, output); + + // Init to some default value to make the computer quiet (else it output 'divide by zero' warning even if value is not used). + // TODO: this is a really poor workaround, but the variable is used in a bunch of places + // to compute normals which are then passed on elsewhere to compute other values... + output.tangentToWorld = k_identity3x3; + output.positionSS = input.pos; // input.positionCS is SV_Position + // BETTER SHADERS: because we transform world position into actual world space for things like + // triplanar, etc, we have to back transform it here for lighting + output.positionRWS = GetCameraRelativePositionWS(input.worldPos); + output.tangentToWorld = BuildTangentToWorld(input.worldTangent, input.worldNormal); + output.texCoord0 = input.texcoord0; + output.texCoord1 = input.texcoord1; + output.texCoord2 = input.texcoord2; + + return output; + } + + void BuildSurfaceData(FragInputs fragInputs, inout Surface surfaceDescription, float3 V, PositionInputs posInput, out SurfaceData surfaceData, out float3 bentNormalWS) + { + // setup defaults -- these are used if the graph doesn't output a value + ZERO_INITIALIZE(SurfaceData, surfaceData); + + // specularOcclusion need to be init ahead of decal to quiet the compiler that modify the SurfaceData struct + // however specularOcclusion can come from the graph, so need to be init here so it can be override. + surfaceData.specularOcclusion = 1.0; + + // copy across graph values, if defined + surfaceData.baseColor = surfaceDescription.Albedo; + surfaceData.perceptualSmoothness = surfaceDescription.Smoothness; + surfaceData.ambientOcclusion = surfaceDescription.Occlusion; + surfaceData.specularOcclusion = surfaceDescription.SpecularOcclusion; + surfaceData.metallic = surfaceDescription.Metallic; + surfaceData.subsurfaceMask = surfaceDescription.SubsurfaceMask; + surfaceData.thickness = surfaceDescription.Thickness; + surfaceData.diffusionProfileHash = asuint(surfaceDescription.DiffusionProfileHash); + #if _USESPECULAR + surfaceData.specularColor = surfaceDescription.Specular; + #endif + surfaceData.coatMask = surfaceDescription.CoatMask; + surfaceData.anisotropy = surfaceDescription.Anisotropy; + surfaceData.iridescenceMask = surfaceDescription.IridescenceMask; + surfaceData.iridescenceThickness = surfaceDescription.IridescenceThickness; + + + + #if defined(_REFRACTION_PLANE) || defined(_REFRACTION_SPHERE) || defined(_REFRACTION_THIN) + if (_EnableSSRefraction) + { + surfaceData.transmittanceMask = (1.0 - surfaceDescription.Alpha); + surfaceDescription.Alpha = 1.0; + } + else + { + surfaceData.ior = surfaceDescription.ior; + surfaceData.transmittanceColor = surfaceDescription.transmittanceColor; + surfaceData.atDistance = surfaceDescription.atDistance; + surfaceData.transmittanceMask = surfaceDescription.transmittanceMask; + surfaceDescription.Alpha = 1.0; + } + #else + surfaceData.ior = 1.0; + surfaceData.transmittanceColor = float3(1.0, 1.0, 1.0); + surfaceData.atDistance = 1.0; + surfaceData.transmittanceMask = 0.0; + #endif + + + + // These static material feature allow compile time optimization + surfaceData.materialFeatures = MATERIALFEATUREFLAGS_LIT_STANDARD; + #ifdef _MATERIAL_FEATURE_SUBSURFACE_SCATTERING + surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_SUBSURFACE_SCATTERING; + #endif + + #ifdef _MATERIAL_FEATURE_TRANSMISSION + surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_TRANSMISSION; + #endif + + #ifdef _MATERIAL_FEATURE_ANISOTROPY + surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_ANISOTROPY; + surfaceData.normalWS = float3(0, 1, 0); + #endif + + #ifdef _MATERIAL_FEATURE_IRIDESCENCE + surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_IRIDESCENCE; + #endif + + #ifdef _MATERIAL_FEATURE_SPECULAR_COLOR + surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_SPECULAR_COLOR; + #endif + + #if defined(_MATERIAL_FEATURE_CLEAR_COAT) || _CLEARCOAT + surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_CLEAR_COAT; + #endif + + #if defined (_MATERIAL_FEATURE_SPECULAR_COLOR) && defined (_ENERGY_CONSERVING_SPECULAR) + // Require to have setup baseColor + // Reproduce the energy conservation done in legacy Unity. Not ideal but better for compatibility and users can unchek it + surfaceData.baseColor *= (1.0 - Max3(surfaceData.specularColor.r, surfaceData.specularColor.g, surfaceData.specularColor.b)); + #endif + + + + // compute world space normal + #if !_WORLDSPACENORMAL + surfaceData.normalWS = mul(surfaceDescription.Normal, fragInputs.tangentToWorld); + #else + surfaceData.normalWS = surfaceDescription.Normal; + #endif + + surfaceData.geomNormalWS = fragInputs.tangentToWorld[2]; + + surfaceData.tangentWS = normalize(fragInputs.tangentToWorld[0].xyz); // The tangent is not normalize in tangentToWorld for mikkt. TODO: Check if it expected that we normalize with Morten. Tag: SURFACE_GRADIENT + + + #if HAVE_DECALS + if (_EnableDecals) + { + float alpha = 1.0; + alpha = surfaceDescription.Alpha; + + // Both uses and modifies 'surfaceData.normalWS'. + DecalSurfaceData decalSurfaceData = GetDecalSurfaceData(posInput, fragInputs.tangentToWorld[2], alpha); + ApplyDecalToSurfaceData(decalSurfaceData, fragInputs.tangentToWorld[2], surfaceData); + } + #endif + + bentNormalWS = surfaceData.normalWS; + + surfaceData.tangentWS = Orthonormalize(surfaceData.tangentWS, surfaceData.normalWS); + + #ifdef DEBUG_DISPLAY + if (_DebugMipMapMode != DEBUGMIPMAPMODE_NONE) + { + // TODO: need to update mip info + surfaceData.metallic = 0; + } + + // We need to call ApplyDebugToSurfaceData after filling the surfarcedata and before filling builtinData + // as it can modify attribute use for static lighting + ApplyDebugToSurfaceData(fragInputs.tangentToWorld, surfaceData); + #endif + + // By default we use the ambient occlusion with Tri-ace trick (apply outside) for specular occlusion. + // If user provide bent normal then we process a better term + #if defined(_SPECULAR_OCCLUSION_CUSTOM) + // Just use the value passed through via the slot (not active otherwise) + #elif defined(_SPECULAR_OCCLUSION_FROM_AO_BENT_NORMAL) + // If we have bent normal and ambient occlusion, process a specular occlusion + surfaceData.specularOcclusion = GetSpecularOcclusionFromBentAO(V, bentNormalWS, surfaceData.normalWS, surfaceData.ambientOcclusion, PerceptualSmoothnessToPerceptualRoughness(surfaceData.perceptualSmoothness)); + #elif defined(_AMBIENT_OCCLUSION) && defined(_SPECULAR_OCCLUSION_FROM_AO) + surfaceData.specularOcclusion = GetSpecularOcclusionFromAmbientOcclusion(ClampNdotV(dot(surfaceData.normalWS, V)), surfaceData.ambientOcclusion, PerceptualSmoothnessToRoughness(surfaceData.perceptualSmoothness)); + #endif + + #if defined(_ENABLE_GEOMETRIC_SPECULAR_AA) && !defined(SHADER_STAGE_RAY_TRACING) + surfaceData.perceptualSmoothness = GeometricNormalFiltering(surfaceData.perceptualSmoothness, fragInputs.tangentToWorld[2], surfaceDescription.SpecularAAScreenSpaceVariance, surfaceDescription.SpecularAAThreshold); + #endif + } + + void GetSurfaceAndBuiltinData(VertexToPixel m2ps, FragInputs fragInputs, float3 V, inout PositionInputs posInput, + out SurfaceData surfaceData, out BuiltinData builtinData, inout Surface l, inout ShaderData d + #if NEED_FACING + , bool facing + #endif + ) + { + // Removed since crossfade does not work, probably needs extra material setup. + //#if !defined(SHADER_STAGE_RAY_TRACING) && !defined(_TESSELLATION_DISPLACEMENT) + // #ifdef LOD_FADE_CROSSFADE // enable dithering LOD transition if user select CrossFade transition in LOD group + // LODDitheringTransition(ComputeFadeMaskSeed(V, posInput.positionSS), unity_LODFade.x); + // #endif + //#endif + + d = CreateShaderData(m2ps + #if NEED_FACING + , facing + #endif + ); + + l = (Surface)0; + + l.Albedo = half3(0.5, 0.5, 0.5); + l.Normal = float3(0,0,1); + l.Occlusion = 1; + l.Alpha = 1; + l.SpecularOcclusion = 1; + + #if !defined(SHADER_STAGE_RAY_TRACING) && defined(_DEPTHOFFSET_ON) + l.outputDepth = d.clipPos.z; + #endif + + ChainSurfaceFunction(l, d); + + #if !defined(SHADER_STAGE_RAY_TRACING) && defined(_DEPTHOFFSET_ON) + //posInput.deviceDepth = l.outputDepth; + #endif + + #if _UNLIT + //l.Emission = l.Albedo; + //l.Albedo = 0; + l.Normal = half3(0,0,1); + l.Occlusion = 1; + l.Metallic = 0; + l.Specular = 0; + #endif + + surfaceData.geomNormalWS = d.worldSpaceNormal; + surfaceData.tangentWS = d.worldSpaceTangent; + fragInputs.tangentToWorld = d.TBNMatrix; + + float3 bentNormalWS; + BuildSurfaceData(fragInputs, l, V, posInput, surfaceData, bentNormalWS); + + + InitBuiltinData(posInput, l.Alpha, bentNormalWS, -d.worldSpaceNormal, fragInputs.texCoord1, fragInputs.texCoord2, builtinData); + + + + builtinData.emissiveColor = l.Emission; + + #if defined(_OVERRIDE_BAKEDGI) + builtinData.bakeDiffuseLighting = l.DiffuseGI; + builtinData.backBakeDiffuseLighting = l.BackDiffuseGI; + builtinData.emissiveColor += l.SpecularGI; + #endif + + #if defined(_OVERRIDE_SHADOWMASK) + builtinData.shadowMask0 = l.ShadowMask.x; + builtinData.shadowMask1 = l.ShadowMask.y; + builtinData.shadowMask2 = l.ShadowMask.z; + builtinData.shadowMask3 = l.ShadowMask.w; + #endif + + #if defined(UNITY_VIRTUAL_TEXTURING) + builtinData.vtPackedFeedback = surfaceData.VTPackedFeedback; + #endif + + #if (SHADERPASS == SHADERPASS_DISTORTION) + builtinData.distortion = surfaceData.Distortion; + builtinData.distortionBlur = surfaceData.DistortionBlur; + #endif + + #ifndef SHADER_UNLIT + // PostInitBuiltinData call ApplyDebugToBuiltinData + PostInitBuiltinData(V, posInput, surfaceData, builtinData); + #else + ApplyDebugToBuiltinData(builtinData); + #endif + + RAY_TRACING_OPTIONAL_ALPHA_TEST_PASS + } + + + void Frag( VertexToPixel v2f + #if defined(SCENESELECTIONPASS) || defined(SCENEPICKINGPASS) + , out float4 outColor : SV_Target0 + #else + #ifdef WRITE_MSAA_DEPTH + // We need the depth color as SV_Target0 for alpha to coverage + , out float4 depthColor : SV_Target0 + #ifdef WRITE_NORMAL_BUFFER + , out float4 outNormalBuffer : SV_Target1 + #endif + #else + #ifdef WRITE_NORMAL_BUFFER + , out float4 outNormalBuffer : SV_Target0 + #endif + #endif + + // Decal buffer must be last as it is bind but we can optionally write into it (based on _DISABLE_DECALS) + #if defined(WRITE_DECAL_BUFFER) && !defined(_DISABLE_DECALS) + , out float4 outDecalBuffer : SV_TARGET_DECAL + #endif + #endif + #if NEED_FACING + , bool facing : SV_IsFrontFace + #endif + + ) + { + UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX(v2f); + FragInputs input = BuildFragInputs(v2f); + + // input.positionSS is SV_Position + PositionInputs posInput = GetPositionInput(input.positionSS.xy, _ScreenSize.zw, input.positionSS.z, input.positionSS.w, input.positionRWS); + + float3 V = GetWorldSpaceNormalizeViewDir(input.positionRWS); + + + SurfaceData surfaceData; + BuiltinData builtinData; + Surface l; + ShaderData d; + GetSurfaceAndBuiltinData(v2f, input, V, posInput, surfaceData, builtinData, l, d + #if NEED_FACING + , facing + #endif + ); + + + + #ifdef SCENESELECTIONPASS + // We use depth prepass for scene selection in the editor, this code allow to output the outline correctly + outColor = float4(_ObjectId, _PassValue, 1.0, 1.0); + #elif defined(SCENEPICKINGPASS) + outColor = _SelectionID; + #else + #ifdef WRITE_MSAA_DEPTH + // In case we are rendering in MSAA, reading the an MSAA depth buffer is way too expensive. To avoid that, we export the depth to a color buffer + depthColor = v2p.pos.z; + + #ifdef _ALPHATOMASK_ON + // Alpha channel is used for alpha to coverage + depthColor.a = SharpenAlpha(builtinData.opacity, builtinData.alphaClipTreshold); + #endif // alphatomask + #endif // msaa_depth + + + #if defined(WRITE_NORMAL_BUFFER) + EncodeIntoNormalBuffer(ConvertSurfaceDataToNormalData(surfaceData), outNormalBuffer); + #endif + + #if defined(WRITE_DECAL_BUFFER) && !defined(_DISABLE_DECALS) + DecalPrepassData decalPrepassData; + // We don't have the right to access SurfaceData in a shaderpass. + // However it would be painful to have to add a function like ConvertSurfaceDataToDecalPrepassData() to every Material to return geomNormalWS anyway + // Here we will put the constrain that any Material requiring to support Decal, will need to have geomNormalWS as member of surfaceData (and we already require normalWS anyway) + decalPrepassData.geomNormalWS = surfaceData.geomNormalWS; + decalPrepassData.decalLayerMask = GetMeshRenderingDecalLayer(); + EncodeIntoDecalPrepassBuffer(decalPrepassData, outDecalBuffer); + #endif + #endif + + + } + + ENDHLSL + } + + Pass + { + Name "MotionVectors" + Tags + { + "LightMode" = "MotionVectors" + } + + // Render State + Cull Back + ZWrite On + Stencil + { + WriteMask [_StencilWriteMaskMV] + Ref [_StencilRefMV] + CompFront Always + PassFront Replace + CompBack Always + PassBack Replace + } + + Tags { "RenderType" = "Opaque" "Queue" = "Geometry" "PreviewType" = "Plane" } + Cull [_CullingOption] + ZWrite [_ZWrite] + ZTest [_ZTestMode] + + + //------------------------------------------------------------------------------------- + // End Render Modes + //------------------------------------------------------------------------------------- + + HLSLPROGRAM + + #pragma target 4.5 + #pragma only_renderers d3d11 playstation xboxone xboxseries vulkan metal switch + #pragma multi_compile_instancing + #pragma multi_compile _ DOTS_INSTANCING_ON + #pragma instancing_options renderinglayer + + + #pragma multi_compile _ WRITE_MSAA_DEPTH + //#pragma shader_feature _ _SURFACE_TYPE_TRANSPARENT + //#pragma shader_feature_local _BLENDMODE_OFF _BLENDMODE_ALPHA _BLENDMODE_ADD _BLENDMODE_PRE_MULTIPLY + //#pragma shader_feature_local _ _ADD_PRECOMPUTED_VELOCITY + //#pragma shader_feature_local _ _TRANSPARENT_WRITES_MOTION_VEC + //#pragma shader_feature_local _ _ENABLE_FOG_ON_TRANSPARENT + #pragma multi_compile _ WRITE_NORMAL_BUFFER + //#pragma shader_feature_local _ _DISABLE_DECALS + //#pragma shader_feature_local _ _DISABLE_SSR + //#pragma shader_feature_local _ _DISABLE_SSR_TRANSPARENT + #pragma multi_compile _ WRITE_DECAL_BUFFER + //#pragma shader_feature_local _REFRACTION_OFF _REFRACTION_PLANE _REFRACTION_SPHERE _REFRACTION_THIN + + + + #define SHADERPASS SHADERPASS_MOTION_VECTORS + #define RAYTRACING_SHADER_GRAPH_DEFAULT + #define VARYINGS_NEED_PASS + #define _PASSMOTIONVECTOR 1 + + + + #pragma shader_feature_local GLOW_ON + #pragma shader_feature_local FADE_ON + #pragma shader_feature_local OUTBASE_ON + #pragma shader_feature_local ONLYOUTLINE_ON + #pragma shader_feature_local GRADIENT_ON + #pragma shader_feature_local GRADIENT2COL_ON + #pragma shader_feature_local RADIALGRADIENT_ON + #pragma shader_feature_local COLORSWAP_ON + #pragma shader_feature_local HSV_ON + #pragma shader_feature_local CHANGECOLOR_ON + #pragma shader_feature_local CHANGECOLOR2_ON + #pragma shader_feature_local CHANGECOLOR3_ON + #pragma shader_feature_local COLORRAMP_ON + #pragma shader_feature_local GRADIENTCOLORRAMP_ON + #pragma shader_feature_local HITEFFECT_ON + #pragma shader_feature_local NEGATIVE_ON + #pragma shader_feature_local PIXELATE_ON + #pragma shader_feature_local GREYSCALE_ON + #pragma shader_feature_local POSTERIZE_ON + #pragma shader_feature_local BLUR_ON + #pragma shader_feature_local MOTIONBLUR_ON + #pragma shader_feature_local GHOST_ON + #pragma shader_feature_local ALPHAOUTLINE_ON + #pragma shader_feature_local INNEROUTLINE_ON + #pragma shader_feature_local ONLYINNEROUTLINE_ON + #pragma shader_feature_local HOLOGRAM_ON + #pragma shader_feature_local CHROMABERR_ON + #pragma shader_feature_local GLITCH_ON + #pragma shader_feature_local FLICKER_ON + #pragma shader_feature_local SHADOW_ON + #pragma shader_feature_local SHINE_ON + #pragma shader_feature_local CONTRAST_ON + #pragma shader_feature_local OVERLAY_ON + #pragma shader_feature_local OVERLAYMULT_ON + #pragma shader_feature_local DOODLE_ON + #pragma shader_feature_local WIND_ON + #pragma shader_feature_local WAVEUV_ON + #pragma shader_feature_local ROUNDWAVEUV_ON + #pragma shader_feature_local RECTSIZE_ON + #pragma shader_feature_local OFFSETUV_ON + #pragma shader_feature_local CLIPPING_ON + #pragma shader_feature_local RADIALCLIPPING_ON + #pragma shader_feature_local TEXTURESCROLL_ON + #pragma shader_feature_local ZOOMUV_ON + #pragma shader_feature_local DISTORT_ON + #pragma shader_feature_local WARP_ON + #pragma shader_feature_local TWISTUV_ON + #pragma shader_feature_local ROTATEUV_ON + #pragma shader_feature_local POLARUV_ON + #pragma shader_feature_local FISHEYE_ON + #pragma shader_feature_local PINCH_ON + #pragma shader_feature_local SHAKEUV_ON + + #pragma shader_feature_local GLOWTEX_ON + #pragma shader_feature_local OUTTEX_ON + #pragma shader_feature_local OUTDIST_ON + #pragma shader_feature_local OUTBASE8DIR_ON + #pragma shader_feature_local OUTBASEPIXELPERF_ON + #pragma shader_feature_local COLORRAMPOUTLINE_ON + #pragma shader_feature_local GREYSCALEOUTLINE_ON + #pragma shader_feature_local POSTERIZEOUTLINE_ON + #pragma shader_feature_local BLURISHD_ON + #pragma shader_feature_local MANUALWIND_ON + #pragma shader_feature_local ATLAS_ON + #pragma shader_feature_local PREMULTIPLYALPHA_ON + + #pragma shader_feature BILBOARD_ON + #pragma shader_feature BILBOARDY_ON + + #pragma shader_feature NORMALMAP_ON + + + #define _HDRP 1 +#define _USINGTEXCOORD1 1 +#define _USINGTEXCOORD2 1 + + + #pragma vertex Vert + #pragma fragment Frag + + // useful conversion functions to make surface shader code just work + + #define UNITY_DECLARE_TEX2D(name) TEXTURE2D(name); SAMPLER(sampler##name); + #define UNITY_DECLARE_TEX2D_NOSAMPLER(name) TEXTURE2D(name); + #define UNITY_DECLARE_TEX2DARRAY(name) TEXTURE2D_ARRAY(name); SAMPLER(sampler##name); + #define UNITY_DECLARE_TEX2DARRAY_NOSAMPLER(tex) TEXTURE2D_ARRAY(tex); + + #define UNITY_SAMPLE_TEX2DARRAY(tex,coord) SAMPLE_TEXTURE2D_ARRAY(tex, sampler##tex, coord.xy, coord.z) + #define UNITY_SAMPLE_TEX2DARRAY_LOD(tex,coord,lod) SAMPLE_TEXTURE2D_ARRAY_LOD(tex, sampler##tex, coord.xy, coord.z, lod) + #define UNITY_SAMPLE_TEX2D(tex, coord) SAMPLE_TEXTURE2D(tex, sampler##tex, coord) + #define UNITY_SAMPLE_TEX2D_SAMPLER(tex, samp, coord) SAMPLE_TEXTURE2D(tex, sampler##samp, coord) + + #define UNITY_SAMPLE_TEX2D_LOD(tex,coord, lod) SAMPLE_TEXTURE2D_LOD(tex, sampler_##tex, coord, lod) + #define UNITY_SAMPLE_TEX2D_SAMPLER_LOD(tex,samplertex,coord, lod) SAMPLE_TEXTURE2D_LOD (tex, sampler##samplertex,coord, lod) + + #if defined(UNITY_COMPILER_HLSL) + #define UNITY_INITIALIZE_OUTPUT(type,name) name = (type)0; + #else + #define UNITY_INITIALIZE_OUTPUT(type,name) + #endif + + #define sampler2D_float sampler2D + #define sampler2D_half sampler2D + + #undef WorldNormalVector + #define WorldNormalVector(data, normal) mul(normal, data.TBNMatrix) + + #define UnityObjectToWorldNormal(normal) mul(GetObjectToWorldMatrix(), normal) + + + + +// HDRP Adapter stuff + #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Common.hlsl" + #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Texture.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/ShaderVariables.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/ShaderPass/FragInputs.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/ShaderPass/ShaderPass.cs.hlsl" + #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/TextureStack.hlsl" // Required to be include before we include properties as it define DECLARE_STACK_CB +#if UNITY_VERSION >= UNITY_2021_3_31 + #include "Packages/com.unity.shadergraph/ShaderGraphLibrary/Functions.hlsl" // Need to be here for Gradient struct definition +#else + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/ShaderGraphHeader.hlsl" +#endif + #ifdef RAYTRACING_SHADER_GRAPH_DEFAULT + #define RAYTRACING_SHADER_GRAPH_HIGH + #endif + + #ifdef RAYTRACING_SHADER_GRAPH_RAYTRACED + #define RAYTRACING_SHADER_GRAPH_LOW + #endif + // end + + + + + // If we use subsurface scattering, enable output split lighting (for forward pass) + #if defined(_MATERIAL_FEATURE_SUBSURFACE_SCATTERING) && !defined(_SURFACE_TYPE_TRANSPARENT) + #define OUTPUT_SPLIT_LIGHTING + #endif + + #define HAVE_RECURSIVE_RENDERING + + #if SHADERPASS == SHADERPASS_TRANSPARENT_DEPTH_PREPASS + #if !defined(_DISABLE_SSR_TRANSPARENT) && !defined(SHADER_UNLIT) + #define WRITE_NORMAL_BUFFER + #endif + #endif + + #ifndef DEBUG_DISPLAY + // In case of opaque we don't want to perform the alpha test, it is done in depth prepass and we use depth equal for ztest (setup from UI) + // Don't do it with debug display mode as it is possible there is no depth prepass in this case + #if !defined(_SURFACE_TYPE_TRANSPARENT) && defined(_ALPHATEST) + #if SHADERPASS == SHADERPASS_FORWARD + #define SHADERPASS_FORWARD_BYPASS_ALPHA_TEST + #elif SHADERPASS == SHADERPASS_GBUFFER + #define SHADERPASS_GBUFFER_BYPASS_ALPHA_TEST + #endif + #endif + #endif + + // Define _DEFERRED_CAPABLE_MATERIAL for shader capable to run in deferred pass + #if defined(SHADER_LIT) && !defined(_SURFACE_TYPE_TRANSPARENT) + #define _DEFERRED_CAPABLE_MATERIAL + #endif + + // Translate transparent motion vector define + #if defined(_TRANSPARENT_WRITES_MOTION_VEC) && defined(_SURFACE_TYPE_TRANSPARENT) + #define _WRITE_TRANSPARENT_MOTION_VECTOR + #endif + + + + + CBUFFER_START(UnityPerMaterial) + float _UseShadowThreshold; + float _BlendMode; + float _EnableBlendModePreserveSpecularLighting; + float _RayTracing; + float _RefractionModel; + + + half4 _Color; + half4 _MainTex_ST, _MainTex_TexelSize; + half _Alpha, _AlphaCutoffValue; + + #if ATLAS_ON + half _MinXUV, _MaxXUV, _MinYUV, _MaxYUV; + #endif + + #if GLOW_ON + half4 _GlowColor; + half _Glow, _GlowGlobal; + #endif + + #if HSV_ON + half _HsvShift, _HsvSaturation, _HsvBright; + #endif + + #if DISTORT_ON + half4 _DistortTex_ST; + half _DistortTexXSpeed, _DistortTexYSpeed, _DistortAmount; + #endif + + #if FADE_ON + half4 _FadeBurnColor, _FadeTex_ST, _FadeBurnTex_ST; + half _FadeAmount, _FadeBurnWidth, _FadeBurnTransition,_FadeBurnGlow; + #endif + + #if OUTBASE_ON + half4 _OutlineColor; + half _OutlineAlpha, _OutlineGlow, _OutlineWidth; + int _OutlinePixelWidth; + #endif + + #if OUTTEX_ON + half4 _OutlineTex_ST; + half _OutlineTexXSpeed, _OutlineTexYSpeed; + #endif + + #if OUTDIST_ON + half4 _OutlineDistortTex_ST; + half _OutlineDistortTexXSpeed, _OutlineDistortTexYSpeed, _OutlineDistortAmount; + #endif + + #if ALPHAOUTLINE_ON + half _AlphaOutlineGlow, _AlphaOutlinePower, _AlphaOutlineMinAlpha, _AlphaOutlineBlend; + half4 _AlphaOutlineColor; + #endif + + #if INNEROUTLINE_ON + half _InnerOutlineThickness, _InnerOutlineAlpha, _InnerOutlineGlow; + half4 _InnerOutlineColor; + #endif + + #if GRADIENT_ON + half _GradBlend, _GradBoostX, _GradBoostY; + half4 _GradTopRightCol, _GradTopLeftCol, _GradBotRightCol, _GradBotLeftCol; + #endif + + #if COLORSWAP_ON + half4 _ColorSwapRed, _ColorSwapGreen, _ColorSwapBlue; + half _ColorSwapRedLuminosity, _ColorSwapGreenLuminosity, _ColorSwapBlueLuminosity, _ColorSwapBlend; + #endif + + #if CHANGECOLOR_ON + half4 _ColorChangeNewCol, _ColorChangeTarget; + half _ColorChangeTolerance, _ColorChangeLuminosity; + #endif + #if CHANGECOLOR2_ON + half4 _ColorChangeNewCol2, _ColorChangeTarget2; + half _ColorChangeTolerance2; + #endif + #if CHANGECOLOR3_ON + half4 _ColorChangeNewCol3, _ColorChangeTarget3; + half _ColorChangeTolerance3; + #endif + + #if COLORRAMP_ON + half _ColorRampLuminosity, _ColorRampBlend; + #endif + + #if HITEFFECT_ON + half4 _HitEffectColor; + half _HitEffectGlow, _HitEffectBlend; + #endif + + #if NEGATIVE_ON + half _NegativeAmount; + #endif + + #if PIXELATE_ON + half _PixelateSize; + #endif + + #if GREYSCALE_ON + half _GreyscaleLuminosity, _GreyscaleBlend; + half4 _GreyscaleTintColor; + #endif + + #if POSTERIZE_ON + half _PosterizeNumColors, _PosterizeGamma; + #endif + + #if BLUR_ON + half _BlurIntensity; + #endif + + #if MOTIONBLUR_ON + half _MotionBlurAngle, _MotionBlurDist; + #endif + + #if GHOST_ON + half _GhostColorBoost, _GhostTransparency, _GhostBlend; + #endif + + #if HOLOGRAM_ON + half _HologramStripesAmount, _HologramMinAlpha, _HologramUnmodAmount, _HologramStripesSpeed, _HologramMaxAlpha, _HologramBlend; + half4 _HologramStripeColor; + #endif + + #if CHROMABERR_ON + half _ChromAberrAmount, _ChromAberrAlpha; + #endif + + #if GLITCH_ON + half _GlitchAmount, _GlitchSize; + #endif + + #if FLICKER_ON + half _FlickerFreq, _FlickerPercent, _FlickerAlpha; + #endif + + #if SHADOW_ON + half _ShadowX, _ShadowY, _ShadowAlpha; + half4 _ShadowColor; + #endif + + #if SHINE_ON + half4 _ShineColor; + half _ShineLocation, _ShineRotate, _ShineWidth, _ShineGlow; + #endif + + #if CONTRAST_ON + half _Contrast, _Brightness; + #endif + + #if OVERLAY_ON + half4 _OverlayTex_ST, _OverlayColor; + half _OverlayGlow, _OverlayBlend, _OverlayTextureScrollXSpeed, _OverlayTextureScrollYSpeed; + #endif + + #if DOODLE_ON + half _HandDrawnAmount, _HandDrawnSpeed; + #endif + + #if WIND_ON + half _GrassSpeed, _GrassWind, _GrassManualAnim, _GrassRadialBend; + #endif + + #if WAVEUV_ON + float _WaveAmount, _WaveSpeed, _WaveStrength, _WaveX, _WaveY; + #endif + + #if ROUNDWAVEUV_ON + half _RoundWaveStrength, _RoundWaveSpeed; + #endif + + #if RECTSIZE_ON + half _RectSize; + #endif + + #if OFFSETUV_ON + half _OffsetUvX, _OffsetUvY; + #endif + + #if CLIPPING_ON + half _ClipUvLeft, _ClipUvRight, _ClipUvUp, _ClipUvDown; + #endif + + #if RADIALCLIPPING_ON + half _RadialStartAngle, _RadialClip, _RadialClip2; + #endif + + #if TEXTURESCROLL_ON + half _TextureScrollXSpeed, _TextureScrollYSpeed; + #endif + + #if ZOOMUV_ON + half _ZoomUvAmount; + #endif + + #if WARP_ON + half _WarpStrength, _WarpSpeed, _WarpScale; + #endif + + #if TWISTUV_ON + half _TwistUvAmount, _TwistUvPosX, _TwistUvPosY, _TwistUvRadius; + #endif + + #if ROTATEUV_ON + half _RotateUvAmount; + #endif + + #if FISHEYE_ON + half _FishEyeUvAmount; + #endif + + #if PINCH_ON + half _PinchUvAmount; + #endif + + #if SHAKEUV_ON + half _ShakeUvSpeed, _ShakeUvX, _ShakeUvY; + #endif + + #if NORMALMAP_ON + half _NormalStrength; + #endif + + float _RandomSeed; + + + + + CBUFFER_END + + + + // -- Property used by ScenePickingPass + #ifdef SCENEPICKINGPASS + float4 _SelectionID; + #endif + + // -- Properties used by SceneSelectionPass + #ifdef SCENESELECTIONPASS + int _ObjectId; + int _PassValue; + #endif + + + // data across stages, stripped like the above. + struct VertexToPixel + { + float4 pos : SV_POSITION; + float3 worldPos : TEXCOORD0; + float3 worldNormal : TEXCOORD1; + float4 worldTangent : TEXCOORD2; + float4 texcoord0 : TEXCOORD3; + float4 texcoord1 : TEXCOORD4; + float4 texcoord2 : TEXCOORD5; + // #if %TEXCOORD3REQUIREKEY% + float4 texcoord3 : TEXCOORD6; + // #endif + + // #if %SCREENPOSREQUIREKEY% + // float4 screenPos : TEXCOORD7; + // #endif + + // #if %VERTEXCOLORREQUIREKEY% + float4 vertexColor : COLOR; + // #endif + + // #if %EXTRAV2F0REQUIREKEY% + // float4 extraV2F0 : TEXCOORD8; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // float4 extraV2F1 : TEXCOORD9; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // float4 extraV2F2 : TEXCOORD10; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // float4 extraV2F3 : TEXCOORD11; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // float4 extraV2F4 : TEXCOORD12; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // float4 extraV2F5 : TEXCOORD13; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // float4 extraV2F6 : TEXCOORD14; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // float4 extraV2F7 : TEXCOORD15; + // #endif + + #if UNITY_ANY_INSTANCING_ENABLED + UNITY_VERTEX_INPUT_INSTANCE_ID + #endif // UNITY_ANY_INSTANCING_ENABLED + + #if _HDRP && (_PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR))) + float4 previousPositionCS : TEXCOORD16; // Contain previous transform position (in case of skinning for example) + float4 motionVectorCS : TEXCOORD17; + #endif + + UNITY_VERTEX_OUTPUT_STEREO + }; + + + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Debug/DebugDisplay.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/Material.hlsl" + #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/NormalSurfaceGradient.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/Lit/Lit.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/BuiltinUtilities.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/MaterialUtilities.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/Decal/DecalUtilities.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/Lit/LitDecalData.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/ShaderGraphFunctions.hlsl" + + + + // data describing the user output of a pixel + struct Surface + { + half3 Albedo; + half Height; + half3 Normal; + half Smoothness; + half3 Emission; + half Metallic; + half3 Specular; + half Occlusion; + half SpecularPower; // for simple lighting + half Alpha; + float outputDepth; // if written, SV_Depth semantic is used. ShaderData.clipPos.z is unused value + // HDRP Only + half SpecularOcclusion; + half SubsurfaceMask; + half Thickness; + half CoatMask; + half CoatSmoothness; + half Anisotropy; + half IridescenceMask; + half IridescenceThickness; + int DiffusionProfileHash; + float SpecularAAThreshold; + float SpecularAAScreenSpaceVariance; + // requires _OVERRIDE_BAKEDGI to be defined, but is mapped in all pipelines + float3 DiffuseGI; + float3 BackDiffuseGI; + float3 SpecularGI; + float ior; + float3 transmittanceColor; + float atDistance; + float transmittanceMask; + // requires _OVERRIDE_SHADOWMASK to be defines + float4 ShadowMask; + + // for decals + float NormalAlpha; + float MAOSAlpha; + + + }; + + // Data the user declares in blackboard blocks + struct Blackboard + { + + float blackboardDummyData; + }; + + // data the user might need, this will grow to be big. But easy to strip + struct ShaderData + { + float4 clipPos; // SV_POSITION + float3 localSpacePosition; + float3 localSpaceNormal; + float3 localSpaceTangent; + + float3 worldSpacePosition; + float3 worldSpaceNormal; + float3 worldSpaceTangent; + float tangentSign; + + float3 worldSpaceViewDir; + float3 tangentSpaceViewDir; + + float4 texcoord0; + float4 texcoord1; + float4 texcoord2; + float4 texcoord3; + + float2 screenUV; + float4 screenPos; + + float4 vertexColor; + bool isFrontFace; + + float4 extraV2F0; + float4 extraV2F1; + float4 extraV2F2; + float4 extraV2F3; + float4 extraV2F4; + float4 extraV2F5; + float4 extraV2F6; + float4 extraV2F7; + + float3x3 TBNMatrix; + Blackboard blackboard; + }; + + struct VertexData + { + #if SHADER_TARGET > 30 + // uint vertexID : SV_VertexID; + #endif + float4 vertex : POSITION; + float3 normal : NORMAL; + float4 tangent : TANGENT; + float4 texcoord0 : TEXCOORD0; + + // optimize out mesh coords when not in use by user or lighting system + #if _URP && (_USINGTEXCOORD1 || _PASSMETA || _PASSFORWARD || _PASSGBUFFER) + float4 texcoord1 : TEXCOORD1; + #endif + + #if _URP && (_USINGTEXCOORD2 || _PASSMETA || ((_PASSFORWARD || _PASSGBUFFER) && defined(DYNAMICLIGHTMAP_ON))) + float4 texcoord2 : TEXCOORD2; + #endif + + #if _STANDARD && (_USINGTEXCOORD1 || (_PASSMETA || ((_PASSFORWARD || _PASSGBUFFER || _PASSFORWARDADD) && LIGHTMAP_ON))) + float4 texcoord1 : TEXCOORD1; + #endif + #if _STANDARD && (_USINGTEXCOORD2 || (_PASSMETA || ((_PASSFORWARD || _PASSGBUFFER) && DYNAMICLIGHTMAP_ON))) + float4 texcoord2 : TEXCOORD2; + #endif + + + #if _HDRP + float4 texcoord1 : TEXCOORD1; + float4 texcoord2 : TEXCOORD2; + #endif + + // #if %TEXCOORD3REQUIREKEY% + float4 texcoord3 : TEXCOORD3; + // #endif + + // #if %VERTEXCOLORREQUIREKEY% + float4 vertexColor : COLOR; + // #endif + + #if _PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR)) + float3 previousPositionOS : TEXCOORD4; // Contain previous transform position (in case of skinning for example) + #if defined (_ADD_PRECOMPUTED_VELOCITY) + float3 precomputedVelocity : TEXCOORD5; // Add Precomputed Velocity (Alembic computes velocities on runtime side). + #endif + #endif + + UNITY_VERTEX_INPUT_INSTANCE_ID + }; + + struct TessVertex + { + float4 vertex : INTERNALTESSPOS; + float3 normal : NORMAL; + float4 tangent : TANGENT; + float4 texcoord0 : TEXCOORD0; + float4 texcoord1 : TEXCOORD1; + float4 texcoord2 : TEXCOORD2; + + // #if %TEXCOORD3REQUIREKEY% + float4 texcoord3 : TEXCOORD3; + // #endif + + // #if %VERTEXCOLORREQUIREKEY% + float4 vertexColor : COLOR; + // #endif + + // #if %EXTRAV2F0REQUIREKEY% + // float4 extraV2F0 : TEXCOORD5; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // float4 extraV2F1 : TEXCOORD6; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // float4 extraV2F2 : TEXCOORD7; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // float4 extraV2F3 : TEXCOORD8; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // float4 extraV2F4 : TEXCOORD9; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // float4 extraV2F5 : TEXCOORD10; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // float4 extraV2F6 : TEXCOORD11; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // float4 extraV2F7 : TEXCOORD12; + // #endif + + #if _PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR)) + float3 previousPositionOS : TEXCOORD13; // Contain previous transform position (in case of skinning for example) + #if defined (_ADD_PRECOMPUTED_VELOCITY) + float3 precomputedVelocity : TEXCOORD14; + #endif + #endif + + UNITY_VERTEX_INPUT_INSTANCE_ID + UNITY_VERTEX_OUTPUT_STEREO + }; + + struct ExtraV2F + { + float4 extraV2F0; + float4 extraV2F1; + float4 extraV2F2; + float4 extraV2F3; + float4 extraV2F4; + float4 extraV2F5; + float4 extraV2F6; + float4 extraV2F7; + Blackboard blackboard; + float4 time; + }; + + + float3 WorldToTangentSpace(ShaderData d, float3 normal) + { + return mul(d.TBNMatrix, normal); + } + + float3 TangentToWorldSpace(ShaderData d, float3 normal) + { + return mul(normal, d.TBNMatrix); + } + + // in this case, make standard more like SRPs, because we can't fix + // unity_WorldToObject in HDRP, since it already does macro-fu there + + #if _STANDARD + float3 TransformWorldToObject(float3 p) { return mul(unity_WorldToObject, float4(p, 1)); }; + float3 TransformObjectToWorld(float3 p) { return mul(unity_ObjectToWorld, float4(p, 1)); }; + float4 TransformWorldToObject(float4 p) { return mul(unity_WorldToObject, p); }; + float4 TransformObjectToWorld(float4 p) { return mul(unity_ObjectToWorld, p); }; + float4x4 GetWorldToObjectMatrix() { return unity_WorldToObject; } + float4x4 GetObjectToWorldMatrix() { return unity_ObjectToWorld; } + #if (defined(SHADER_API_D3D11) || defined(SHADER_API_XBOXONE) || defined(UNITY_COMPILER_HLSLCC) || defined(SHADER_API_PSSL) || (SHADER_TARGET_SURFACE_ANALYSIS && !SHADER_TARGET_SURFACE_ANALYSIS_MOJOSHADER)) + #define UNITY_SAMPLE_TEX2D_LOD(tex,coord, lod) tex.SampleLevel (sampler##tex,coord, lod) + #define UNITY_SAMPLE_TEX2D_SAMPLER_LOD(tex,samplertex,coord, lod) tex.SampleLevel (sampler##samplertex,coord, lod) + #else + #define UNITY_SAMPLE_TEX2D_LOD(tex,coord,lod) tex2D (tex,coord,0,lod) + #define UNITY_SAMPLE_TEX2D_SAMPLER_LOD(tex,samplertex,coord,lod) tex2D (tex,coord,0,lod) + #endif + + #undef GetWorldToObjectMatrix() + + #define GetWorldToObjectMatrix() unity_WorldToObject + + + #endif + + float3 GetCameraWorldPosition() + { + #if _HDRP + return GetCameraRelativePositionWS(_WorldSpaceCameraPos); + #else + return _WorldSpaceCameraPos; + #endif + } + + #if _GRABPASSUSED + #if _STANDARD + TEXTURE2D(%GRABTEXTURE%); + SAMPLER(sampler_%GRABTEXTURE%); + #endif + + half3 GetSceneColor(float2 uv) + { + #if _STANDARD + return SAMPLE_TEXTURE2D(%GRABTEXTURE%, sampler_%GRABTEXTURE%, uv).rgb; + #else + return SHADERGRAPH_SAMPLE_SCENE_COLOR(uv); + #endif + } + #endif + + + + #if _STANDARD + UNITY_DECLARE_DEPTH_TEXTURE(_CameraDepthTexture); + float GetSceneDepth(float2 uv) { return SAMPLE_DEPTH_TEXTURE(_CameraDepthTexture, uv); } + float GetLinear01Depth(float2 uv) { return Linear01Depth(GetSceneDepth(uv)); } + float GetLinearEyeDepth(float2 uv) { return LinearEyeDepth(GetSceneDepth(uv)); } + #else + float GetSceneDepth(float2 uv) { return SHADERGRAPH_SAMPLE_SCENE_DEPTH(uv); } + float GetLinear01Depth(float2 uv) { return Linear01Depth(GetSceneDepth(uv), _ZBufferParams); } + float GetLinearEyeDepth(float2 uv) { return LinearEyeDepth(GetSceneDepth(uv), _ZBufferParams); } + #endif + + float3 GetWorldPositionFromDepthBuffer(float2 uv, float3 worldSpaceViewDir) + { + float eye = GetLinearEyeDepth(uv); + float3 camView = mul((float3x3)GetObjectToWorldMatrix(), transpose(mul(GetWorldToObjectMatrix(), UNITY_MATRIX_I_V)) [2].xyz); + + float dt = dot(worldSpaceViewDir, camView); + float3 div = worldSpaceViewDir/dt; + float3 wpos = (eye * div) + GetCameraWorldPosition(); + return wpos; + } + + #if _HDRP + float3 ObjectToWorldSpacePosition(float3 pos) + { + return GetAbsolutePositionWS(TransformObjectToWorld(pos)); + } + #else + float3 ObjectToWorldSpacePosition(float3 pos) + { + return TransformObjectToWorld(pos); + } + #endif + + #if _STANDARD + UNITY_DECLARE_SCREENSPACE_TEXTURE(_CameraDepthNormalsTexture); + float3 GetSceneNormal(float2 uv, float3 worldSpaceViewDir) + { + float4 depthNorms = UNITY_SAMPLE_SCREENSPACE_TEXTURE(_CameraDepthNormalsTexture, uv); + float3 norms = DecodeViewNormalStereo(depthNorms); + norms = mul((float3x3)GetWorldToViewMatrix(), norms) * 0.5 + 0.5; + return norms; + } + #elif _HDRP && !_DECALSHADER + + float3 GetSceneNormal(float2 uv, float3 worldSpaceViewDir) + { + NormalData nd; + DecodeFromNormalBuffer(_ScreenSize.xy * uv, nd); + return nd.normalWS; + } + #elif _URP + #if (SHADER_LIBRARY_VERSION_MAJOR >= 10) + #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/DeclareNormalsTexture.hlsl" + #endif + + float3 GetSceneNormal(float2 uv, float3 worldSpaceViewDir) + { + #if (SHADER_LIBRARY_VERSION_MAJOR >= 10) + return SampleSceneNormals(uv); + #else + float3 wpos = GetWorldPositionFromDepthBuffer(uv, worldSpaceViewDir); + return normalize(-cross(ddx(wpos), ddy(wpos))) * 0.5 + 0.5; + #endif + + } + #endif + + #if _HDRP + + half3 UnpackNormalmapRGorAG(half4 packednormal) + { + // This do the trick + packednormal.x *= packednormal.w; + + half3 normal; + normal.xy = packednormal.xy * 2 - 1; + normal.z = sqrt(1 - saturate(dot(normal.xy, normal.xy))); + return normal; + } + half3 UnpackNormal(half4 packednormal) + { + #if defined(UNITY_NO_DXT5nm) + return packednormal.xyz * 2 - 1; + #else + return UnpackNormalmapRGorAG(packednormal); + #endif + } + #endif + #if _HDRP || _URP + + half3 UnpackScaleNormal(half4 packednormal, half scale) + { + #ifndef UNITY_NO_DXT5nm + // Unpack normal as DXT5nm (1, y, 1, x) or BC5 (x, y, 0, 1) + // Note neutral texture like "bump" is (0, 0, 1, 1) to work with both plain RGB normal and DXT5nm/BC5 + packednormal.x *= packednormal.w; + #endif + half3 normal; + normal.xy = (packednormal.xy * 2 - 1) * scale; + normal.z = sqrt(1 - saturate(dot(normal.xy, normal.xy))); + return normal; + } + + #endif + + + void GetSun(out float3 lightDir, out float3 color) + { + lightDir = float3(0.5, 0.5, 0); + color = 1; + #if _HDRP + if (_DirectionalLightCount > 0) + { + DirectionalLightData light = _DirectionalLightDatas[0]; + lightDir = -light.forward.xyz; + color = light.color; + } + #elif _STANDARD + lightDir = normalize(_WorldSpaceLightPos0.xyz); + color = _LightColor0.rgb; + #elif _URP + Light light = GetMainLight(); + lightDir = light.direction; + color = light.color; + #endif + } + + + + + + + + + + TEXTURE2D(_MainTex); + SAMPLER(sampler_MainTex); + + #if GLOW_ON + TEXTURE2D(_GlowTex); + SAMPLER(sampler_GlowTex); + #endif + + #if FADE_ON + TEXTURE2D(_FadeTex); + SAMPLER(sampler_FadeTex); + + TEXTURE2D(_FadeBurnTex); + SAMPLER(sampler_FadeBurnTex); + #endif + + #if DISTORT_ON + TEXTURE2D(_DistortTex); + SAMPLER(sampler_DistortTex); + #endif + + #if OUTTEX_ON + TEXTURE2D(_OutlineTex); + SAMPLER(sampler_OutlineTex); + #endif + + #if OUTDIST_ON + TEXTURE2D(_OutlineDistortTex); + SAMPLER(sampler_OutlineDistortTex); + #endif + + #if COLORSWAP_ON + TEXTURE2D(_ColorSwapTex); + SAMPLER(sampler_ColorSwapTex); + #endif + + #if COLORRAMP_ON + TEXTURE2D(_ColorRampTex); + TEXTURE2D(_ColorRampTexGradient); + SAMPLER(sampler_ColorRampTex); + SAMPLER(sampler_ColorRampTexGradient); + #endif + + #if SHINE_ON + TEXTURE2D(_ShineMask); + SAMPLER(sampler_ShineMask); + #endif + + #if OVERLAY_ON + TEXTURE2D(_OverlayTex); + SAMPLER(sampler_OverlayTex); + #endif + + #if NORMALMAP_ON + TEXTURE2D(_NormalMap); + SAMPLER(sampler_NormalMap); + #endif + + + half3 GetPixel(in int offsetX, in int offsetY, in half2 uv, in Texture2D _tex, in SamplerState _sampler) + { + half2 _uv = uv + half2(offsetX * _MainTex_TexelSize.x, offsetY * _MainTex_TexelSize.y); + half4 col = SAMPLE_TEXTURE2D(_tex, _sampler, _uv); + return col.rgb; + } + + + //BLURS------------------------------------------------------------------------- + half4 Blur(half2 uv, Texture2D source, SamplerState sampler_source, half Intensity) + { + const half2 texelSize = 1.0 / _ScreenParams.xy; + const half4 color = SAMPLE_TEXTURE2D(source, sampler_source, uv); + const half2 offset = Intensity * texelSize; + + half4 accumulatedColor = color; + half accumulatedWeight = 1.0; + for (int x = -1; x <= 1; x++) + { + for (int y = -1; y <= 1; y++) + { + const half2 sampleUV = uv + half2(x, y) * offset; + const half4 sampleColor = SAMPLE_TEXTURE2D(source, sampler_source, sampleUV); + + accumulatedColor += sampleColor; + accumulatedWeight += 1.0; + } + } + + half4 blurredColor = accumulatedColor / accumulatedWeight; + return blurredColor; + } + + half BlurHD_G(half bhqp, half x) + { + return exp(-(x * x) / (2.0 * bhqp * bhqp)); + } + half4 BlurHD(half2 uv, Texture2D source, SamplerState sampler_source, half BlurAmount, half xScale, half yScale) + { + int iterations = 16; + int halfIterations = iterations / 2; + half sigmaX = 0.1 + BlurAmount * 0.5; + half sigmaY = sigmaX; + half total = 0.0; + half4 ret = half4(0, 0, 0, 0); + for (int iy = 0; iy < iterations; ++iy) + { + half fy = BlurHD_G(sigmaY, half(iy) -half(halfIterations)); + half offsetY = half(iy - halfIterations) * 0.00390625 * xScale; + for (int ix = 0; ix < iterations; ++ix) + { + half fx = BlurHD_G(sigmaX, half(ix) - half(halfIterations)); + half offsetX = half(ix - halfIterations) * 0.00390625 * yScale; + total += fx * fy; + ret += SAMPLE_TEXTURE2D(source, sampler_source, uv + half2(offsetX, offsetY)) * fx * fy; + } + } + return ret / total; + } + //----------------------------------------------------------------------- + + + //------------------------------------------- + half RemapFloat(half inValue, half inMin, half inMax, half outMin, half outMax){ + return outMin + (inValue - inMin) * (outMax - outMin) / (inMax - inMin); + } + //------------------------------------------- + + //----------------------------------------------------------------------- + half rand(half2 seed, half offset) { + return (frac(sin(dot(seed, half2(12.9898, 78.233))) * 43758.5453) + offset) % 1.0; + } + + half rand2(half2 seed, half offset) { + return (frac(sin(dot(seed * floor(50 + (_Time.x % 1.0) * 12.), half2(127.1, 311.7))) * 43758.5453123) + offset) % 1.0; + } + + half rand2CustomTime(half2 seed, half offset, half customTime) { + return (frac(sin(dot(seed * floor(50 + (customTime % 1.0) * 12.), half2(127.1, 311.7))) * 43758.5453123) + offset) % 1.0; + } + //----------------------------------------------------------------------- + + + void Ext_ModifyVertex0 (inout VertexData v, inout ExtraV2F d) + { + //BILBOARD_ON + #if BILBOARD_ON + half3 camRight = mul((half3x3)unity_CameraToWorld, half3(1,0,0)); + half3 camUp = half3(0,1,0); + #if BILBOARDY_ON + camUp = mul((half3x3)unity_CameraToWorld, half3(0,1,0)); + #endif + half3 localPos = v.vertex.x * camRight + v.vertex.y * camUp; + v.vertex = half4(localPos, 1); + #endif + //----------------------------------------------------------- + + v.texcoord0.xy = TRANSFORM_TEX(v.texcoord0.xy, _MainTex); + half2 center = half2(0.5, 0.5); + #if ATLAS_ON + center = half2((_MaxXUV + _MinXUV) / 2.0, (_MaxYUV + _MinYUV) / 2.0); + #endif + + //POLARUV_ON + #if POLARUV_ON + v.texcoord0.xy = v.texcoord0.xy - center; + #endif + + //---------------------------------------- + + //ROTATEUV_ON + #if ROTATEUV_ON + half2 uvC = v.texcoord0.xy; + half cosAngle = cos(_RotateUvAmount); + half sinAngle = sin(_RotateUvAmount); + half2x2 rot = half2x2(cosAngle, -sinAngle, sinAngle, cosAngle); + uvC -= center; + v.texcoord0.xy = mul(rot, uvC); + v.texcoord0.xy += center; + #endif + //-------------------- + + #if RECTSIZE_ON + v.vertex.xyz += (v.vertex.xyz * (_RectSize - 1.0)); + #endif + + #if OUTTEX_ON + v.texcoord1.xy = TRANSFORM_TEX(v.texcoord0.xy, _OutlineTex); + #endif + + #if OUTDIST_ON + v.texcoord2.xy = TRANSFORM_TEX(v.texcoord0.xy, _OutlineDistortTex); + #endif + + #if DISTORT_ON + v.texcoord3.xy = TRANSFORM_TEX(v.texcoord0.xy, _DistortTex); + #endif + } + + void Ext_SurfaceFunction0 (inout Surface o, ShaderData d) + { + half randomSeed = _RandomSeed; + + float2 uvRect = d.texcoord0; + half2 center = half2(0.5, 0.5); + #if ATLAS_ON + center = half2((_MaxXUV + _MinXUV) / 2.0, (_MaxYUV + _MinYUV) / 2.0); + uvRect = half2((d.texcoord0.x - _MinXUV) / (_MaxXUV - _MinXUV), (d.texcoord0.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half2 centerTiled = half2(center.x * _MainTex_ST.x, center.y * _MainTex_ST.y); + + //CLIPPING_ON + #if CLIPPING_ON + half2 tiledUv = half2(d.texcoord0.x / _MainTex_ST.x, d.texcoord0.y / _MainTex_ST.y); + #if ATLAS_ON + tiledUv = half2((tiledUv.x - _MinXUV) / (_MaxXUV - _MinXUV), (tiledUv.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + clip((1 - _ClipUvUp) - tiledUv.y); + clip(tiledUv.y - _ClipUvDown); + clip((1 - _ClipUvRight) - tiledUv.x); + clip(tiledUv.x - _ClipUvLeft); + #endif + //---------------------------------- + + //RADIALCLIPPING_ON + #if RADIALCLIPPING_ON + half2 tiledUv2 = half2(d.texcoord0.x / _MainTex_ST.x, d.texcoord0.y / _MainTex_ST.y); + #if ATLAS_ON + tiledUv2 = half2((tiledUv2.x - _MinXUV) / (_MaxXUV - _MinXUV), (tiledUv2.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half startAngle = _RadialStartAngle - _RadialClip; + half endAngle = _RadialStartAngle + _RadialClip2; + half offset0 = clamp(0, 360, startAngle + 360); + half offset360 = clamp(0, 360, endAngle - 360); + half2 atan2Coord = half2(lerp(-1, 1, tiledUv2.x), lerp(-1, 1, tiledUv2.y)); + half atanAngle = atan2(atan2Coord.y, atan2Coord.x) * 57.3; // angle in degrees + if(atanAngle < 0) atanAngle = 360 + atanAngle; + if(atanAngle >= startAngle && atanAngle <= endAngle) discard; + if(atanAngle <= offset360) discard; + if(atanAngle >= offset0) discard; + #endif + + //----------------------------- + + //TEXTURESCROLL_ON && ATLAS_ON + #if TEXTURESCROLL_ON && ATLAS_ON + d.texcoord0.xy = half2(_MinXUV + ((_MaxXUV - _MinXUV) * (abs(((_Time.y + randomSeed) * _TextureScrollXSpeed) + uvRect.x) % 1)), + _MinYUV + ((_MaxYUV - _MinYUV) * (abs(((_Time.y + randomSeed) * _TextureScrollYSpeed) + uvRect.y) % 1))); + #endif + //---------------------------- + + //OFFSETUV_ON + #if OFFSETUV_ON + #if ATLAS_ON + d.texcoord0.xy = half2(_MinXUV + ((_MaxXUV - _MinXUV) * (abs((_OffsetUvX + uvRect.x) % 1))), + _MinYUV + ((_MaxYUV - _MinYUV) * (abs(_OffsetUvY + uvRect.y) % 1))); + #else + d.texcoord0.xy += half2(_OffsetUvX, _OffsetUvY); + #endif + #endif + + //---------------------- + + //POLARUV_ON + #if POLARUV_ON + d.texcoord0.xy = half2(atan2(d.texcoord0.y, d.texcoord0.x) / (2.0f * 3.141592653589f), length(d.texcoord0.xy)); + d.texcoord0.xy *= _MainTex_ST.xy; + #endif + + //-------------------------------------- + + //TWISTUV_ON + #if TWISTUV_ON + #if ATLAS_ON + _TwistUvPosX = ((_MaxXUV - _MinXUV) * _TwistUvPosX) + _MinXUV; + _TwistUvPosY = ((_MaxYUV - _MinYUV) * _TwistUvPosY) + _MinYUV; + #endif + half2 tempUv = d.texcoord0.xy - half2(_TwistUvPosX * _MainTex_ST.x, _TwistUvPosY * _MainTex_ST.y); + _TwistUvRadius *= (_MainTex_ST.x + _MainTex_ST.y) / 2; + half percent = (_TwistUvRadius - length(tempUv)) / _TwistUvRadius; + half theta = percent * percent * (2.0 * sin(_TwistUvAmount)) * 8.0; + half s = sin(theta); + half c = cos(theta); + half beta = max(sign(_TwistUvRadius - length(tempUv)), 0.0); + tempUv = half2(dot(tempUv, half2(c, -s)), dot(tempUv, half2(s, c))) * beta + tempUv * (1 - beta); + tempUv += half2(_TwistUvPosX * _MainTex_ST.x, _TwistUvPosY * _MainTex_ST.y); + d.texcoord0.xy = tempUv; + #endif + + //-------------------------------------------- + + //FISHEYE_ON + #if FISHEYE_ON + half bind = length(centerTiled); + half2 dF = d.texcoord0.xy - centerTiled; + half dFlen = length(dF); + half fishInt = (3.14159265359 / bind) * (_FishEyeUvAmount + 0.001); + d.texcoord0.xy = centerTiled + (dF / (max(0.0001, dFlen))) * tan(dFlen * fishInt) * bind / tan(bind * fishInt); + #endif + //--------------------------------------------- + + //PINCH_ON + #if PINCH_ON + half2 dP = d.texcoord0.xy - centerTiled; + half pinchInt = (3.141592 / length(centerTiled)) * (-_PinchUvAmount + 0.001); + d.texcoord0.xy = centerTiled + normalize(dP) * atan(length(dP) * -pinchInt * 10.0) * 0.5 / atan(-pinchInt * 5); + #endif + + //--------------------------------------------- + + //ZOOMUV_ON + #if ZOOMUV_ON + d.texcoord0.xy -= centerTiled; + d.texcoord0.xy = d.texcoord0.xy * _ZoomUvAmount; + d.texcoord0.xy += centerTiled; + #endif + + //----------------------------------------------- + + //DOODLE_ON + #if DOODLE_ON + half2 uvCopy = uvRect; + _HandDrawnSpeed = (floor((_Time.x + randomSeed) * 20 * _HandDrawnSpeed) / _HandDrawnSpeed) * _HandDrawnSpeed; + uvCopy.x = sin((uvCopy.x * _HandDrawnAmount + _HandDrawnSpeed) * 4); + uvCopy.y = cos((uvCopy.y * _HandDrawnAmount + _HandDrawnSpeed) * 4); + d.texcoord0.xy = lerp(d.texcoord0.xy, d.texcoord0.xy + uvCopy, 0.0005 * _HandDrawnAmount); + #endif + + //-------------------------- + + //SHAKEUV_ON + #if SHAKEUV_ON + half xShake = sin((_Time.x + randomSeed) * _ShakeUvSpeed * 50) * _ShakeUvX; + half yShake = cos((_Time.x + randomSeed) * _ShakeUvSpeed * 50) * _ShakeUvY; + d.texcoord0.xy += half2(xShake * 0.012, yShake * 0.01); + #endif + + //------------------------------------------- + + //RECTSIZE_ON + #if RECTSIZE_ON + d.texcoord0.xy = d.texcoord0.xy * (_RectSize).xx + (((-_RectSize * 0.5) + 0.5)).xx; + #endif + + //------------------------------------------- + + //DISTORT_ON + #if DISTORT_ON + #if ATLAS_ON + d.texcoord3.x = d.texcoord3.x * (1 / (_MaxXUV - _MinXUV)); + d.texcoord3.y = d.texcoord3.y * (1 / (_MaxYUV - _MinYUV)); + #endif + + d.texcoord3.x += ((_Time.x + _RandomSeed) * _DistortTexXSpeed) % 1; + d.texcoord3.y += ((_Time.x + _RandomSeed) * _DistortTexYSpeed) % 1; + half distortAmnt = (SAMPLE_TEXTURE2D(_DistortTex, sampler_DistortTex, d.texcoord3.xy).r - 0.5) * 0.2 * _DistortAmount; + d.texcoord0.x += distortAmnt; + d.texcoord0.y += distortAmnt; + #endif + //------------------------------------------------------- + + //WARP_ON + #if WARP_ON + half2 warpUv = half2(d.texcoord0.x / _MainTex_ST.x, d.texcoord0.y / _MainTex_ST.y); + #if ATLAS_ON + warpUv = half2((warpUv.x - _MinXUV) / (_MaxXUV - _MinXUV), (warpUv.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + const float tau = 6.283185307179586; + float xWarp = (_Time.y + randomSeed) * _WarpSpeed + warpUv.x * tau / _WarpScale; + float yWarp = (_Time.y + randomSeed) * _WarpSpeed + warpUv.y * tau / _WarpScale; + float2 warp = float2(sin(xWarp), sin(yWarp)) * _WarpStrength; + d.texcoord0.xy += warp; + #endif + + //------------------------------------------------------- + + //WAVEUV_ON + #if WAVEUV_ON + float2 uvWave = half2(_WaveX * _MainTex_ST.x, _WaveY * _MainTex_ST.y) - d.texcoord0.xy; + uvWave %= 1; + #if ATLAS_ON + uvWave = half2(_WaveX, _WaveY) - uvRect; + #endif + uvWave.x *= _ScreenParams.x / _ScreenParams.y; + float waveTime = _Time.y + randomSeed; + float angWave = (sqrt(dot(uvWave, uvWave)) * _WaveAmount) - ((waveTime * _WaveSpeed)); + d.texcoord0.xy = d.texcoord0.xy + uvWave * sin(angWave) * (_WaveStrength / 1000.0); + #endif + //---------------------------------------------------- + + //ROUNDWAVEUV_ON + #if ROUNDWAVEUV_ON + half xWave = ((0.5 * _MainTex_ST.x) - uvRect.x); + half yWave = ((0.5 * _MainTex_ST.y) - uvRect.y) * (_MainTex_TexelSize.w / _MainTex_TexelSize.z); + half ripple = -sqrt(xWave*xWave + yWave* yWave); + d.texcoord0.xy += (sin((ripple + (_Time.y + randomSeed) * (_RoundWaveSpeed/10.0)) / 0.015) * (_RoundWaveStrength/10.0)) % 1; + #endif + //---------------------------------------------------- + + + //WIND_ON + #if WIND_ON + half windOffset = sin((_Time.x + randomSeed) * _GrassSpeed * 10); + half2 windCenter = half2(0.5, 0.1); + #if ATLAS_ON + windCenter.x = ((_MaxXUV - _MinXUV) * windCenter.x) + _MinXUV; + windCenter.y = ((_MaxYUV - _MinYUV) * windCenter.y) + _MinYUV; + #endif + #if !MANUALWIND_ON + d.texcoord0.x = fmod(abs(lerp(d.texcoord0.x, d.texcoord0.x + (_GrassWind * 0.01 * windOffset), uvRect.y)), 1); + #else + d.texcoord0.x = fmod(abs(lerp(d.texcoord0.x, d.texcoord0.x + (_GrassWind * 0.01 * _GrassManualAnim), uvRect.y)), 1); + windOffset = _GrassManualAnim; + #endif + half2 delta = d.texcoord0.xy - windCenter; + half delta2 = dot(delta.xy, delta.xy); + half2 delta_offset = delta2 * windOffset; + d.texcoord0.xy = d.texcoord0.xy + half2(delta.y, -delta.x) * delta_offset * _GrassRadialBend; + #endif + + //-------------------------------------------------------- + + //TEXTURESCROLL_ON && !ATLAS_ON + #if TEXTURESCROLL_ON && !ATLAS_ON + d.texcoord0.x += ((_Time.y + randomSeed) * _TextureScrollXSpeed) % 1; + d.texcoord0.y += ((_Time.y + randomSeed) * _TextureScrollYSpeed) % 1; + #endif + //------------------------------ + + //PIXELATE_ON + #if PIXELATE_ON + half aspectRatio = _MainTex_TexelSize.x / _MainTex_TexelSize.y; + half2 pixelSize = float2(_PixelateSize, _PixelateSize * aspectRatio); + d.texcoord0.xy = floor(d.texcoord0.xy * pixelSize) / pixelSize; + #endif + //-------------- + + half4 col = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy); + half originalAlpha = col.a; + col *= d.vertexColor; + + //NORMAL MAP + #if NORMALMAP_ON + half4 normalSample = SAMPLE_TEXTURE2D(_NormalMap, sampler_NormalMap, d.texcoord0.xy); + half3 normalTS = UnpackNormal(normalSample); + normalTS.xy *= _NormalStrength; + o.Normal = normalTS; + #endif + + + //GLITCH_ON + #if GLITCH_ON + half2 uvGlitch = uvRect; + uvGlitch.y -= 0.5; + half lineNoise = pow(rand2(floor(uvGlitch * half2(24., 19.) * _GlitchSize) * 4.0, randomSeed), 3.0) * _GlitchAmount + * pow(rand2(floor(uvGlitch * half2(38., 14.) * _GlitchSize) * 4.0, randomSeed), 3.0); + col = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(lineNoise * 0.02 * rand2(half2(2.0, 1), randomSeed), 0)) * d.vertexColor; + #endif + //-------------------------------------- + + //CHROMABERR_ON + #if CHROMABERR_ON + half4 r = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(_ChromAberrAmount/10, 0)) * d.vertexColor; + half4 b = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(-_ChromAberrAmount/10, 0)) * d.vertexColor; + col = half4(r.r * r.a, col.g, b.b * b.a, max(max(r.a, b.a) * _ChromAberrAlpha, col.a)); + #endif + + //-------------------------------- + + //BLUR_ON + #if BLUR_ON + #if ATLAS_ON + #if !BLURISHD_ON + col = BlurHD(d.texcoord0.xy, _MainTex, sampler_MainTex, _BlurIntensity, (_MaxXUV - _MinXUV), (_MaxYUV - _MinYUV)) * d.vertexColor; + #else + col = Blur(d.texcoord0.xy, _MainTex, sampler_MainTex, _BlurIntensity * (_MaxXUV - _MinXUV)) * d.vertexColor; + #endif + #else + #if !BLURISHD_ON + col = BlurHD(d.texcoord0.xy, _MainTex, sampler_MainTex, _BlurIntensity, 1, 1) * d.vertexColor; + #else + col = Blur(d.texcoord0.xy, _MainTex, sampler_MainTex, _BlurIntensity) * d.vertexColor; + #endif + #endif + #endif + + //-------------------- + + //MOTIONBLUR_ON + #if MOTIONBLUR_ON + _MotionBlurAngle = _MotionBlurAngle * 3.1415926; + #define rot(n) mul(n, half2x2(cos(_MotionBlurAngle), -sin(_MotionBlurAngle), sin(_MotionBlurAngle), cos(_MotionBlurAngle))) + _MotionBlurDist = _MotionBlurDist * 0.005; + #if ATLAS_ON + _MotionBlurDist *= (_MaxXUV - _MinXUV); + #endif + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(-_MotionBlurDist, -_MotionBlurDist))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(-_MotionBlurDist * 2, -_MotionBlurDist * 2))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(-_MotionBlurDist * 3, -_MotionBlurDist * 3))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(-_MotionBlurDist * 4, -_MotionBlurDist * 4))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(_MotionBlurDist, _MotionBlurDist))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(_MotionBlurDist * 2, _MotionBlurDist * 2))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(_MotionBlurDist * 3, _MotionBlurDist * 3))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(_MotionBlurDist * 4, _MotionBlurDist * 4))); + col.rgb = col.rgb / 9; + #endif + //------------------------------------ + + //NEGATIVE_ON + #if NEGATIVE_ON + col.rgb = lerp(col.rgb, 1 - col.rgb, _NegativeAmount); + #endif + + //-------------- + half luminance = 0; + + //GREYSCALE_ON && !GREYSCALEOUTLINE_ON + #if GREYSCALE_ON && !GREYSCALEOUTLINE_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + luminance = saturate(luminance + _GreyscaleLuminosity); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _GreyscaleTintColor, _GreyscaleBlend); + #endif + //------------------------------------ + + //GHOST_ON + #if GHOST_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + half4 ghostResult; + ghostResult.a = saturate(luminance - _GhostTransparency) * col.a; + ghostResult.rgb = col.rgb * (luminance + _GhostColorBoost); + col = lerp(col, ghostResult, _GhostBlend); + #endif + //------------------------------------ + + //INNEROUTLINE_ON + #if INNEROUTLINE_ON + half3 innerT = abs(GetPixel(0, _InnerOutlineThickness, d.texcoord0.xy, _MainTex, sampler_MainTex) - GetPixel(0, -_InnerOutlineThickness, d.texcoord0.xy, _MainTex, sampler_MainTex)); + innerT += abs(GetPixel(_InnerOutlineThickness, 0, d.texcoord0.xy, _MainTex, sampler_MainTex) - GetPixel(-_InnerOutlineThickness, 0, d.texcoord0.xy, _MainTex, sampler_MainTex)); + #if !ONLYINNEROUTLINE_ON + innerT = (innerT / 2.0) * col.a * _InnerOutlineAlpha; + col.rgb += length(innerT) * _InnerOutlineColor.rgb * _InnerOutlineGlow; + #else + innerT *= col.a * _InnerOutlineAlpha; + col.rgb = length(innerT) * _InnerOutlineColor.rgb * _InnerOutlineGlow; + col.a = step(0.3, col.r+col.g+col.b); + #endif + #endif + //------------------------------------------------------- + + //HITEFFECT_ON + #if HITEFFECT_ON + col.rgb = lerp(col.rgb, _HitEffectColor.rgb * _HitEffectGlow, _HitEffectBlend); + #endif + //-------------------- + + //GRADIENT_ON + #if GRADIENT_ON + half2 tiledUvGrad = half2(uvRect.x / _MainTex_ST.x, uvRect.y / _MainTex_ST.y); + #if GRADIENT2COL_ON + _GradTopRightCol = _GradTopLeftCol; + _GradBotRightCol = _GradBotLeftCol; + #endif + #if RADIALGRADIENT_ON + half radialDist = 1 - length(tiledUvGrad - half2(0.5, 0.5)); + radialDist *= (_MainTex_TexelSize.w / _MainTex_TexelSize.z); + radialDist = saturate(_GradBoostX * radialDist); + half4 gradientResult = lerp(_GradTopLeftCol, _GradBotLeftCol, radialDist); + #else + half gradXLerpFactor = saturate(pow(tiledUvGrad.x, _GradBoostX)); + half4 gradientResult = lerp(lerp(_GradBotLeftCol, _GradBotRightCol, gradXLerpFactor), + lerp(_GradTopLeftCol, _GradTopRightCol, gradXLerpFactor), saturate(pow(tiledUvGrad.y, _GradBoostY))); + #endif + gradientResult = lerp(col, gradientResult, _GradBlend); + col.rgb = gradientResult.rgb * col.a; + col.a *= gradientResult.a; + #endif + //-------------------------------------------------------------------- + + //CONTRAST_ON + #if CONTRAST_ON + col.rgb = (col.rgb - float3(0.5, 0.5, 0.5)) * _Contrast + float3(0.5, 0.5, 0.5); + col.rgb += _Brightness; + #endif + + //------------------------------------------------------------------- + + //COLORSWAP_ON + #if COLORSWAP_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + half4 swapMask = SAMPLE_TEXTURE2D(_ColorSwapTex, sampler_ColorSwapTex, d.texcoord0.xy); + swapMask.rgb *= swapMask.a; + half3 redSwap = _ColorSwapRed * swapMask.r * saturate(luminance + _ColorSwapRedLuminosity); + half3 greenSwap = _ColorSwapGreen * swapMask.g * saturate(luminance + _ColorSwapGreenLuminosity); + half3 blueSwap = _ColorSwapBlue * swapMask.b * saturate(luminance + _ColorSwapBlueLuminosity); + swapMask.rgb = col.rgb * saturate(1 - swapMask.r - swapMask.g - swapMask.b); + col.rgb = lerp(col.rgb, swapMask.rgb + redSwap + greenSwap + blueSwap, _ColorSwapBlend); + #endif + //-------------------------------------------------------------------- + + //COLORRAMP_ON && !COLORRAMPOUTLINE_ON + #if COLORRAMP_ON && !COLORRAMPOUTLINE_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + luminance = saturate(luminance + _ColorRampLuminosity); + #if GRADIENTCOLORRAMP_ON + col.rgb = lerp(col.rgb, SAMPLE_TEXTURE2D(_ColorRampTexGradient, sampler_ColorRampTexGradient, half2(luminance, 0)).rgb, _ColorRampBlend); + #else + col.rgb = lerp(col.rgb, SAMPLE_TEXTURE2D(_ColorRampTex, sampler_ColorRampTex, half2(luminance, 0)).rgb, _ColorRampBlend); + #endif + #endif + //-------------------------------------------------------------------- + + //CHANGECOLOR_ON + #if CHANGECOLOR_ON + float3 currChangeColor = saturate(col.rgb); + luminance = 0.3 * currChangeColor.r + 0.59 * currChangeColor.g + 0.11 * currChangeColor.b; + luminance = saturate(luminance + _ColorChangeLuminosity); + half3 dif = abs(currChangeColor - _ColorChangeTarget.rgb); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _ColorChangeNewCol.rgb, + max(sign(1 - saturate(dif.x + dif.y + dif.z) - _ColorChangeTolerance), 0.0)); + #if CHANGECOLOR2_ON + dif = abs(currChangeColor - _ColorChangeTarget2.rgb); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _ColorChangeNewCol2.rgb, + max(sign(1 - saturate(dif.x + dif.y + dif.z) - _ColorChangeTolerance2), 0.0)); + #endif + #if CHANGECOLOR3_ON + dif = abs(currChangeColor - _ColorChangeTarget3.rgb); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _ColorChangeNewCol3.rgb, + max(sign(1 - saturate(dif.x + dif.y + dif.z) - _ColorChangeTolerance3), 0.0)); + #endif + #endif + //------------------------------------------------------- + + //POSTERIZE_ON && !POSTERIZEOUTLINE_ON + #if POSTERIZE_ON && !POSTERIZEOUTLINE_ON + col.rgb = pow(col.rgb, _PosterizeGamma) * _PosterizeNumColors; + col.rgb = floor(col.rgb) / _PosterizeNumColors; + col.rgb = pow(col.rgb, 1.0 / _PosterizeGamma); + #endif + //------------------------------------ + + //HSV_ON + #if HSV_ON + half3 resultHsv = half3(col.rgb); + half cosHsv = _HsvBright * _HsvSaturation * cos(_HsvShift * 3.14159265 / 180); + half sinHsv = _HsvBright * _HsvSaturation * sin(_HsvShift * 3.14159265 / 180); + resultHsv.x = (.299 * _HsvBright + .701 * cosHsv + .168 * sinHsv) * col.x + + (.587 * _HsvBright - .587 * cosHsv + .330 * sinHsv) * col.y + + (.114 * _HsvBright - .114 * cosHsv - .497 * sinHsv) * col.z; + resultHsv.y = (.299 * _HsvBright - .299 * cosHsv - .328 * sinHsv) *col.x + + (.587 * _HsvBright + .413 * cosHsv + .035 * sinHsv) * col.y + + (.114 * _HsvBright - .114 * cosHsv + .292 * sinHsv) * col.z; + resultHsv.z = (.299 * _HsvBright - .3 * cosHsv + 1.25 * sinHsv) * col.x + + (.587 * _HsvBright - .588 * cosHsv - 1.05 * sinHsv) * col.y + + (.114 * _HsvBright + .886 * cosHsv - .203 * sinHsv) * col.z; + col.rgb = resultHsv; + #endif + //------------------------------------------------------- + + //OVERLAY_ON + #if OVERLAY_ON + half2 overlayUvs = d.texcoord0.xy; + overlayUvs.x += ((_Time.y + randomSeed) * _OverlayTextureScrollXSpeed) % 1; + overlayUvs.y += ((_Time.y + randomSeed) * _OverlayTextureScrollYSpeed) % 1; + half4 overlayCol = SAMPLE_TEXTURE2D(_OverlayTex, sampler_OverlayTex, TRANSFORM_TEX(overlayUvs, _OverlayTex)); + overlayCol.rgb *= _OverlayColor.rgb * _OverlayGlow; + #if !OVERLAYMULT_ON + overlayCol.rgb *= overlayCol.a * _OverlayColor.rgb * _OverlayColor.a * _OverlayBlend; + col.rgb += overlayCol.rgb; + #else + overlayCol.a *= _OverlayColor.a; + col = lerp(col, col * overlayCol, _OverlayBlend); + #endif + #endif + + //--------------------------------- + + //OUTBASE_ON + #if OUTBASE_ON + #if OUTBASEPIXELPERF_ON + half2 destUv = half2(_OutlinePixelWidth * _MainTex_TexelSize.x, _OutlinePixelWidth * _MainTex_TexelSize.y); + #else + half2 destUv = half2(_OutlineWidth * _MainTex_TexelSize.x * 200, _OutlineWidth * _MainTex_TexelSize.y * 200); + #endif + + #if OUTDIST_ON + d.texcoord3.x += ((_Time.x + _RandomSeed) * _OutlineDistortTexXSpeed) % 1; + d.texcoord3.y += ((_Time.x + _RandomSeed) * _OutlineDistortTexYSpeed) % 1; + #if ATLAS_ON + d.texcoord3 = half2((d.texcoord3.x - _MinXUV) / (_MaxXUV - _MinXUV), (d.texcoord3.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half outDistortAmnt = (SAMPLE_TEXTURE2D(_OutlineDistortTex, sampler_OutlineDistortTex, d.texcoord3).r - 0.5) * 0.2 * _OutlineDistortAmount; + destUv.x += outDistortAmnt; + destUv.y += outDistortAmnt; + #endif + + half spriteLeft = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(destUv.x, 0)).a; + half spriteRight = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy - half2(destUv.x, 0)).a; + half spriteBottom = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(0, destUv.y)).a; + half spriteTop = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy - half2(0, destUv.y)).a; + half result = spriteLeft + spriteRight + spriteBottom + spriteTop; + + #if OUTBASE8DIR_ON + half spriteTopLeft = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(destUv.x, destUv.y)).a; + half spriteTopRight = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(-destUv.x, destUv.y)).a; + half spriteBotLeft = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(destUv.x, -destUv.y)).a; + half spriteBotRight = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(-destUv.x, -destUv.y)).a; + result = result + spriteTopLeft + spriteTopRight + spriteBotLeft + spriteBotRight; + #endif + + result = step(0.05, saturate(result)); + + #if OUTTEX_ON + d.texcoord1.x += ((_Time.x + _RandomSeed) * _OutlineTexXSpeed) % 1; + d.texcoord1.y += ((_Time.x + _RandomSeed) * _OutlineTexYSpeed) % 1; + #if ATLAS_ON + d.texcoord1 = half2((d.texcoord1.x - _MinXUV) / (_MaxXUV - _MinXUV), (d.texcoord1.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half4 tempOutColor = SAMPLE_TEXTURE2D(_OutlineTex, sampler_OutlineTex, d.texcoord1); + tempOutColor *= _OutlineColor; + _OutlineColor = tempOutColor; + #endif + + result *= (1 - originalAlpha) * _OutlineAlpha; + + half4 outline = _OutlineColor * d.vertexColor.a; + outline.rgb *= _OutlineGlow; + outline.a = result; + #if ONLYOUTLINE_ON + col = outline; + #else + col = lerp(col, outline, result); + #endif + #endif + //------------------------------------------------------- + + //FADE_ON + #if FADE_ON + half2 tiledUvFade1 = TRANSFORM_TEX(d.texcoord0, _FadeTex); + half2 tiledUvFade2 = TRANSFORM_TEX(d.texcoord0, _FadeBurnTex); + #if ATLAS_ON + tiledUvFade1 = half2((tiledUvFade1.x - _MinXUV) / (_MaxXUV - _MinXUV), (tiledUvFade1.y - _MinYUV) / (_MaxYUV - _MinYUV)); + tiledUvFade2 = half2((tiledUvFade2.x - _MinXUV) / (_MaxXUV - _MinXUV), (tiledUvFade2.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half fadeTemp = SAMPLE_TEXTURE2D(_FadeTex, sampler_FadeTex, tiledUvFade1).r; + half fade = smoothstep(_FadeAmount, _FadeAmount + _FadeBurnTransition, fadeTemp); + half fadeBurn = saturate(smoothstep(_FadeAmount - _FadeBurnWidth, _FadeAmount - _FadeBurnWidth + 0.1, fadeTemp) * _FadeAmount); + col.a *= fade; + _FadeBurnColor.rgb *= _FadeBurnGlow; + col += fadeBurn * SAMPLE_TEXTURE2D(_FadeBurnTex, sampler_FadeBurnTex, tiledUvFade2) * _FadeBurnColor * originalAlpha * (1 - col.a); + #endif + //------------------------------------------------------- + + //SHADOW_ON + #if SHADOW_ON + half shadowA = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(_ShadowX, _ShadowY)).a; + half preMultShadowMask = 1 - (saturate(shadowA - col.a) * (1 - col.a)); + col.rgb *= 1 - ((shadowA - col.a) * (1 - col.a)); + col.rgb += (_ShadowColor * shadowA) * (1 - col.a); + col.a = max(shadowA * _ShadowAlpha * d.vertexColor.a, col.a); + #endif + + //------------------------------------------------------- + + //GLOW_ON + #if GLOW_ON + half4 emission; + #if GLOWTEX_ON + emission = SAMPLE_TEXTURE2D(_GlowTex, sampler_GlowTex, d.texcoord0); + #else + emission = col; + #endif + + col.rgb *= _GlowGlobal; + emission.rgb *= emission.a * col.a * _Glow * _GlowColor; + col.rgb += emission.rgb; + #endif + //------------------------------------------------------- + + //COLORRAMP_ON && COLORRAMPOUTLINE_ON + #if COLORRAMP_ON && COLORRAMPOUTLINE_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + luminance = saturate(luminance + _ColorRampLuminosity); + #if GRADIENTCOLORRAMP_ON + col.rgb = lerp(col.rgb, SAMPLE_TEXTURE2D(_ColorRampTexGradient, sampler_ColorRampTexGradient, half2(luminance, 0)).rgb, _ColorRampBlend); + #else + col.rgb = lerp(col.rgb, SAMPLE_TEXTURE2D(_ColorRampTex, sampler_ColorRampTex, half2(luminance, 0)).rgb, _ColorRampBlend); + #endif + #endif + //--------------- + + //GREYSCALE_ON && GREYSCALEOUTLINE_ON + #if GREYSCALE_ON && GREYSCALEOUTLINE_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + luminance = saturate(luminance + _GreyscaleLuminosity); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _GreyscaleTintColor, _GreyscaleBlend); + #endif + + //----------------------------------- + + //POSTERIZE_ON && POSTERIZEOUTLINE_ON + #if POSTERIZE_ON && POSTERIZEOUTLINE_ON + col.rgb = pow(col.rgb, _PosterizeGamma) * _PosterizeNumColors; + col.rgb = floor(col.rgb) / _PosterizeNumColors; + col.rgb = pow(col.rgb, 1.0 / _PosterizeGamma); + #endif + + //----------------------------------- + + //SHINE_ON + #if SHINE_ON + half2 uvShine = uvRect; + half cosAngle = cos(_ShineRotate); + half sinAngle = sin(_ShineRotate); + half2x2 rot = half2x2(cosAngle, -sinAngle, sinAngle, cosAngle); + uvShine -= half2(0.5, 0.5); + uvShine = mul(rot, uvShine); + uvShine += half2(0.5, 0.5); + half shineMask = SAMPLE_TEXTURE2D(_ShineMask, sampler_ShineMask, d.texcoord0.xy).a; + half currentDistanceProjection = (uvShine.x + uvShine.y) / 2; + half whitePower = 1 - (abs(currentDistanceProjection - _ShineLocation) / _ShineWidth); + col.rgb += col.a * whitePower * _ShineGlow * max(sign(currentDistanceProjection - (_ShineLocation - _ShineWidth)), 0.0) + * max(sign((_ShineLocation + _ShineWidth) - currentDistanceProjection), 0.0) * _ShineColor * shineMask; + #endif + + //----------------------------------- + + //HOLOGRAM_ON + #if HOLOGRAM_ON + half totalHologram = _HologramStripesAmount + _HologramUnmodAmount; + half hologramYCoord = ((uvRect.y + (((_Time.x + randomSeed) % 1) * _HologramStripesSpeed)) % totalHologram) / totalHologram; + hologramYCoord = abs(hologramYCoord); + half alpha = RemapFloat(saturate(hologramYCoord - (_HologramUnmodAmount/totalHologram)), 0.0, 1.0, _HologramMinAlpha, saturate(_HologramMaxAlpha)); + half hologramMask = max(sign((_HologramUnmodAmount/totalHologram) - hologramYCoord), 0.0); + half4 hologramResult = col; + hologramResult.a *= lerp(alpha, 1, hologramMask); + hologramResult.rgb *= max(1, _HologramMaxAlpha * max(sign(hologramYCoord - (_HologramUnmodAmount/totalHologram)), 0.0)); + hologramMask = 1 - step(0.01,hologramMask); + hologramResult.rgb += hologramMask * _HologramStripeColor * col.a; + col = lerp(col, hologramResult, _HologramBlend); + #endif + + //----------------------------------- + + //FLICKER_ON + #if FLICKER_ON + col.a *= saturate(col.a * step(frac(0.05 + (_Time.w + randomSeed) * _FlickerFreq), 1 - _FlickerPercent) + _FlickerAlpha); + #endif + //----------------------------------- + + //ALPHACUTOFF_ON + + //ALPHAROUND_ON + + //ALPHAOUTLINE_ON + #if ALPHAOUTLINE_ON + half alphaOutlineRes = pow(1 - col.a, max(_AlphaOutlinePower, 0.0001)) * step(_AlphaOutlineMinAlpha, col.a) * _AlphaOutlineBlend; + col.rgb = lerp(col.rgb, _AlphaOutlineColor.rgb * _AlphaOutlineGlow, alphaOutlineRes); + col.a = lerp(col.a, 1, alphaOutlineRes > 1); + #endif + //------------------------------------------------------- + + //FOG_ON + + //------------------ + + col *= _Color; + o.Albedo = col; + col.a *= _Alpha; + clip(col.a - _AlphaCutoffValue - 0.01); + o.Alpha = _Color.a; + } + + + + + + void ChainSurfaceFunction(inout Surface l, inout ShaderData d) + { + Ext_SurfaceFunction0(l, d); + // Ext_SurfaceFunction1(l, d); + // Ext_SurfaceFunction2(l, d); + // Ext_SurfaceFunction3(l, d); + // Ext_SurfaceFunction4(l, d); + // Ext_SurfaceFunction5(l, d); + // Ext_SurfaceFunction6(l, d); + // Ext_SurfaceFunction7(l, d); + // Ext_SurfaceFunction8(l, d); + // Ext_SurfaceFunction9(l, d); + // Ext_SurfaceFunction10(l, d); + // Ext_SurfaceFunction11(l, d); + // Ext_SurfaceFunction12(l, d); + // Ext_SurfaceFunction13(l, d); + // Ext_SurfaceFunction14(l, d); + // Ext_SurfaceFunction15(l, d); + // Ext_SurfaceFunction16(l, d); + // Ext_SurfaceFunction17(l, d); + // Ext_SurfaceFunction18(l, d); + // Ext_SurfaceFunction19(l, d); + // Ext_SurfaceFunction20(l, d); + // Ext_SurfaceFunction21(l, d); + // Ext_SurfaceFunction22(l, d); + // Ext_SurfaceFunction23(l, d); + // Ext_SurfaceFunction24(l, d); + // Ext_SurfaceFunction25(l, d); + // Ext_SurfaceFunction26(l, d); + // Ext_SurfaceFunction27(l, d); + // Ext_SurfaceFunction28(l, d); + // Ext_SurfaceFunction29(l, d); + } + +#if !_DECALSHADER + + void ChainModifyVertex(inout VertexData v, inout VertexToPixel v2p, float4 time) + { + ExtraV2F d; + + ZERO_INITIALIZE(ExtraV2F, d); + ZERO_INITIALIZE(Blackboard, d.blackboard); + // due to motion vectors in HDRP, we need to use the last + // time in certain spots. So if you are going to use _Time to adjust vertices, + // you need to use this time or motion vectors will break. + d.time = time; + + Ext_ModifyVertex0(v, d); + // Ext_ModifyVertex1(v, d); + // Ext_ModifyVertex2(v, d); + // Ext_ModifyVertex3(v, d); + // Ext_ModifyVertex4(v, d); + // Ext_ModifyVertex5(v, d); + // Ext_ModifyVertex6(v, d); + // Ext_ModifyVertex7(v, d); + // Ext_ModifyVertex8(v, d); + // Ext_ModifyVertex9(v, d); + // Ext_ModifyVertex10(v, d); + // Ext_ModifyVertex11(v, d); + // Ext_ModifyVertex12(v, d); + // Ext_ModifyVertex13(v, d); + // Ext_ModifyVertex14(v, d); + // Ext_ModifyVertex15(v, d); + // Ext_ModifyVertex16(v, d); + // Ext_ModifyVertex17(v, d); + // Ext_ModifyVertex18(v, d); + // Ext_ModifyVertex19(v, d); + // Ext_ModifyVertex20(v, d); + // Ext_ModifyVertex21(v, d); + // Ext_ModifyVertex22(v, d); + // Ext_ModifyVertex23(v, d); + // Ext_ModifyVertex24(v, d); + // Ext_ModifyVertex25(v, d); + // Ext_ModifyVertex26(v, d); + // Ext_ModifyVertex27(v, d); + // Ext_ModifyVertex28(v, d); + // Ext_ModifyVertex29(v, d); + + + // #if %EXTRAV2F0REQUIREKEY% + // v2p.extraV2F0 = d.extraV2F0; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // v2p.extraV2F1 = d.extraV2F1; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // v2p.extraV2F2 = d.extraV2F2; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // v2p.extraV2F3 = d.extraV2F3; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // v2p.extraV2F4 = d.extraV2F4; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // v2p.extraV2F5 = d.extraV2F5; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // v2p.extraV2F6 = d.extraV2F6; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // v2p.extraV2F7 = d.extraV2F7; + // #endif + } + + void ChainModifyTessellatedVertex(inout VertexData v, inout VertexToPixel v2p) + { + ExtraV2F d; + ZERO_INITIALIZE(ExtraV2F, d); + ZERO_INITIALIZE(Blackboard, d.blackboard); + + // #if %EXTRAV2F0REQUIREKEY% + // d.extraV2F0 = v2p.extraV2F0; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // d.extraV2F1 = v2p.extraV2F1; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // d.extraV2F2 = v2p.extraV2F2; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // d.extraV2F3 = v2p.extraV2F3; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // d.extraV2F4 = v2p.extraV2F4; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // d.extraV2F5 = v2p.extraV2F5; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // d.extraV2F6 = v2p.extraV2F6; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // d.extraV2F7 = v2p.extraV2F7; + // #endif + + + // Ext_ModifyTessellatedVertex0(v, d); + // Ext_ModifyTessellatedVertex1(v, d); + // Ext_ModifyTessellatedVertex2(v, d); + // Ext_ModifyTessellatedVertex3(v, d); + // Ext_ModifyTessellatedVertex4(v, d); + // Ext_ModifyTessellatedVertex5(v, d); + // Ext_ModifyTessellatedVertex6(v, d); + // Ext_ModifyTessellatedVertex7(v, d); + // Ext_ModifyTessellatedVertex8(v, d); + // Ext_ModifyTessellatedVertex9(v, d); + // Ext_ModifyTessellatedVertex10(v, d); + // Ext_ModifyTessellatedVertex11(v, d); + // Ext_ModifyTessellatedVertex12(v, d); + // Ext_ModifyTessellatedVertex13(v, d); + // Ext_ModifyTessellatedVertex14(v, d); + // Ext_ModifyTessellatedVertex15(v, d); + // Ext_ModifyTessellatedVertex16(v, d); + // Ext_ModifyTessellatedVertex17(v, d); + // Ext_ModifyTessellatedVertex18(v, d); + // Ext_ModifyTessellatedVertex19(v, d); + // Ext_ModifyTessellatedVertex20(v, d); + // Ext_ModifyTessellatedVertex21(v, d); + // Ext_ModifyTessellatedVertex22(v, d); + // Ext_ModifyTessellatedVertex23(v, d); + // Ext_ModifyTessellatedVertex24(v, d); + // Ext_ModifyTessellatedVertex25(v, d); + // Ext_ModifyTessellatedVertex26(v, d); + // Ext_ModifyTessellatedVertex27(v, d); + // Ext_ModifyTessellatedVertex28(v, d); + // Ext_ModifyTessellatedVertex29(v, d); + + // #if %EXTRAV2F0REQUIREKEY% + // v2p.extraV2F0 = d.extraV2F0; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // v2p.extraV2F1 = d.extraV2F1; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // v2p.extraV2F2 = d.extraV2F2; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // v2p.extraV2F3 = d.extraV2F3; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // v2p.extraV2F4 = d.extraV2F4; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // v2p.extraV2F5 = d.extraV2F5; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // v2p.extraV2F6 = d.extraV2F6; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // v2p.extraV2F7 = d.extraV2F7; + // #endif + } + + void ChainFinalColorForward(inout Surface l, inout ShaderData d, inout half4 color) + { + // Ext_FinalColorForward0(l, d, color); + // Ext_FinalColorForward1(l, d, color); + // Ext_FinalColorForward2(l, d, color); + // Ext_FinalColorForward3(l, d, color); + // Ext_FinalColorForward4(l, d, color); + // Ext_FinalColorForward5(l, d, color); + // Ext_FinalColorForward6(l, d, color); + // Ext_FinalColorForward7(l, d, color); + // Ext_FinalColorForward8(l, d, color); + // Ext_FinalColorForward9(l, d, color); + // Ext_FinalColorForward10(l, d, color); + // Ext_FinalColorForward11(l, d, color); + // Ext_FinalColorForward12(l, d, color); + // Ext_FinalColorForward13(l, d, color); + // Ext_FinalColorForward14(l, d, color); + // Ext_FinalColorForward15(l, d, color); + // Ext_FinalColorForward16(l, d, color); + // Ext_FinalColorForward17(l, d, color); + // Ext_FinalColorForward18(l, d, color); + // Ext_FinalColorForward19(l, d, color); + // Ext_FinalColorForward20(l, d, color); + // Ext_FinalColorForward21(l, d, color); + // Ext_FinalColorForward22(l, d, color); + // Ext_FinalColorForward23(l, d, color); + // Ext_FinalColorForward24(l, d, color); + // Ext_FinalColorForward25(l, d, color); + // Ext_FinalColorForward26(l, d, color); + // Ext_FinalColorForward27(l, d, color); + // Ext_FinalColorForward28(l, d, color); + // Ext_FinalColorForward29(l, d, color); + } + + void ChainFinalGBufferStandard(inout Surface s, inout ShaderData d, inout half4 GBuffer0, inout half4 GBuffer1, inout half4 GBuffer2, inout half4 outEmission, inout half4 outShadowMask) + { + // Ext_FinalGBufferStandard0(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard1(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard2(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard3(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard4(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard5(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard6(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard7(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard8(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard9(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard10(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard11(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard12(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard13(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard14(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard15(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard16(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard17(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard18(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard19(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard20(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard21(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard22(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard23(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard24(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard25(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard26(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard27(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard28(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard29(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + } +#endif + + + + + +#if _DECALSHADER + + ShaderData CreateShaderData(SurfaceDescriptionInputs IN) + { + ShaderData d = (ShaderData)0; + d.TBNMatrix = float3x3(IN.WorldSpaceTangent, IN.WorldSpaceBiTangent, IN.WorldSpaceNormal); + d.worldSpaceNormal = IN.WorldSpaceNormal; + d.worldSpaceTangent = IN.WorldSpaceTangent; + + d.worldSpacePosition = IN.WorldSpacePosition; + d.texcoord0 = IN.uv0.xyxy; + d.screenPos = IN.ScreenPosition; + + d.worldSpaceViewDir = normalize(_WorldSpaceCameraPos - d.worldSpacePosition); + + d.tangentSpaceViewDir = mul(d.TBNMatrix, d.worldSpaceViewDir); + + // these rarely get used, so we back transform them. Usually will be stripped. + #if _HDRP + // d.localSpacePosition = mul(GetWorldToObjectMatrix(), float4(GetCameraRelativePositionWS(d.worldSpacePosition), 1)).xyz; + #else + // d.localSpacePosition = mul(GetWorldToObjectMatrix(), float4(d.worldSpacePosition, 1)).xyz; + #endif + // d.localSpaceNormal = normalize(mul((float3x3)GetWorldToObjectMatrix(), d.worldSpaceNormal)); + // d.localSpaceTangent = normalize(mul((float3x3)GetWorldToObjectMatrix(), d.worldSpaceTangent.xyz)); + + // #if %SCREENPOSREQUIREKEY% + // d.screenUV = (IN.ScreenPosition.xy / max(0.01, IN.ScreenPosition.w)); + // #endif + + return d; + } +#else + + ShaderData CreateShaderData(VertexToPixel i + #if NEED_FACING + , bool facing + #endif + ) + { + ShaderData d = (ShaderData)0; + d.clipPos = i.pos; + d.worldSpacePosition = i.worldPos; + + d.worldSpaceNormal = normalize(i.worldNormal); + d.worldSpaceTangent.xyz = normalize(i.worldTangent.xyz); + + d.tangentSign = i.worldTangent.w * unity_WorldTransformParams.w; + float3 bitangent = cross(d.worldSpaceTangent.xyz, d.worldSpaceNormal) * d.tangentSign; + + d.TBNMatrix = float3x3(d.worldSpaceTangent, -bitangent, d.worldSpaceNormal); + d.worldSpaceViewDir = normalize(_WorldSpaceCameraPos - i.worldPos); + + d.tangentSpaceViewDir = mul(d.TBNMatrix, d.worldSpaceViewDir); + d.texcoord0 = i.texcoord0; + d.texcoord1 = i.texcoord1; + d.texcoord2 = i.texcoord2; + + // #if %TEXCOORD3REQUIREKEY% + d.texcoord3 = i.texcoord3; + // #endif + + // d.isFrontFace = facing; + // #if %VERTEXCOLORREQUIREKEY% + d.vertexColor = i.vertexColor; + // #endif + + // these rarely get used, so we back transform them. Usually will be stripped. + #if _HDRP + // d.localSpacePosition = mul(GetWorldToObjectMatrix(), float4(GetCameraRelativePositionWS(i.worldPos), 1)).xyz; + #else + // d.localSpacePosition = mul(GetWorldToObjectMatrix(), float4(i.worldPos, 1)).xyz; + #endif + // d.localSpaceNormal = normalize(mul((float3x3)GetWorldToObjectMatrix(), i.worldNormal)); + // d.localSpaceTangent = normalize(mul((float3x3)GetWorldToObjectMatrix(), i.worldTangent.xyz)); + + // #if %SCREENPOSREQUIREKEY% + // d.screenPos = i.screenPos; + // d.screenUV = (i.screenPos.xy / i.screenPos.w); + // #endif + + + // #if %EXTRAV2F0REQUIREKEY% + // d.extraV2F0 = i.extraV2F0; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // d.extraV2F1 = i.extraV2F1; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // d.extraV2F2 = i.extraV2F2; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // d.extraV2F3 = i.extraV2F3; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // d.extraV2F4 = i.extraV2F4; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // d.extraV2F5 = i.extraV2F5; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // d.extraV2F6 = i.extraV2F6; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // d.extraV2F7 = i.extraV2F7; + // #endif + + return d; + } + +#endif + + + +#if (SHADERPASS == SHADERPASS_LIGHT_TRANSPORT) + + // This was not in constant buffer in original unity, so keep outiside. But should be in as ShaderRenderPass frequency + float unity_OneOverOutputBoost; + float unity_MaxOutputValue; + + CBUFFER_START(UnityMetaPass) + // x = use uv1 as raster position + // y = use uv2 as raster position + bool4 unity_MetaVertexControl; + + // x = return albedo + // y = return normal + bool4 unity_MetaFragmentControl; + CBUFFER_END + + VertexToPixel Vert(VertexData inputMesh) + { + VertexToPixel output; + ZERO_INITIALIZE(VertexToPixel, output); + UNITY_SETUP_INSTANCE_ID(inputMesh); + UNITY_TRANSFER_INSTANCE_ID(inputMesh, output); + UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(output); + + // Output UV coordinate in vertex shader + float2 uv = float2(0.0, 0.0); + + if (unity_MetaVertexControl.x) + { + uv = inputMesh.texcoord1.xy * unity_LightmapST.xy + unity_LightmapST.zw; + } + else if (unity_MetaVertexControl.y) + { + uv = inputMesh.texcoord2.xy * unity_DynamicLightmapST.xy + unity_DynamicLightmapST.zw; + } + + // OpenGL right now needs to actually use the incoming vertex position + // so we create a fake dependency on it here that haven't any impact. + output.pos = float4(uv * 2.0 - 1.0, inputMesh.vertex.z > 0 ? 1.0e-4 : 0.0, 1.0); + + output.worldPos = TransformObjectToWorld(inputMesh.vertex.xyz).xyz; + + // Normal is required for triplanar mapping + output.worldNormal = TransformObjectToWorldNormal(inputMesh.normal); + // Not required but assign to silent compiler warning + output.worldTangent = float4(1.0, 0.0, 0.0, 0.0); + + output.texcoord0 = inputMesh.texcoord0; + output.texcoord1 = inputMesh.texcoord1; + output.texcoord2 = inputMesh.texcoord2; + // #if %TEXCOORD3REQUIREKEY% + output.texcoord3 = inputMesh.texcoord3; + // #endif + // #if %VERTEXCOLORREQUIREKEY% + output.vertexColor = inputMesh.vertexColor; + // #endif + + return output; + } +#else + + #if (_PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR))) + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/ShaderVariablesMatrixDefsHDCamera.hlsl" + + void MotionVectorPositionZBias(VertexToPixel input) + { + #if UNITY_REVERSED_Z + input.pos.z -= unity_MotionVectorsParams.z * input.pos.w; + #else + input.pos.z += unity_MotionVectorsParams.z * input.pos.w; + #endif + } + + #endif + + VertexToPixel Vert(VertexData input) + { + VertexToPixel output; + ZERO_INITIALIZE(VertexToPixel, output); + + UNITY_SETUP_INSTANCE_ID(input); + UNITY_TRANSFER_INSTANCE_ID(input, output); + UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(output); + + #if _HDRP && (_PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR))) + VertexData previousMesh = input; + #endif + + ChainModifyVertex(input, output, _Time); + + // This return the camera relative position (if enable) + float3 positionRWS = TransformObjectToWorld(input.vertex.xyz); + float3 normalWS = TransformObjectToWorldNormal(input.normal); + float4 tangentWS = float4(TransformObjectToWorldDir(input.tangent.xyz), input.tangent.w); + + + output.worldPos = GetAbsolutePositionWS(positionRWS); + output.pos = TransformWorldToHClip(positionRWS); + output.worldNormal = normalWS; + output.worldTangent = tangentWS; + + + output.texcoord0 = input.texcoord0; + output.texcoord1 = input.texcoord1; + output.texcoord2 = input.texcoord2; + + // #if %TEXCOORD3REQUIREKEY% + output.texcoord3 = input.texcoord3; + // #endif + + // #if %VERTEXCOLORREQUIREKEY% + output.vertexColor = input.vertexColor; + // #endif + + // #if %SCREENPOSREQUIREKEY% + // output.screenPos = ComputeScreenPos(output.pos, _ProjectionParams.x); + // #endif + + #if _HDRP && (_PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR))) + + #if !defined(TESSELLATION_ON) + MotionVectorPositionZBias(output); + #endif + + output.motionVectorCS = mul(UNITY_MATRIX_UNJITTERED_VP, float4(positionRWS.xyz, 1.0)); + // Note: unity_MotionVectorsParams.y is 0 is forceNoMotion is enabled + bool forceNoMotion = unity_MotionVectorsParams.y == 0.0; + if (forceNoMotion) + { + output.previousPositionCS = float4(0.0, 0.0, 0.0, 1.0); + } + else + { + bool hasDeformation = unity_MotionVectorsParams.x > 0.0; // Skin or morph target + + float3 effectivePositionOS = (hasDeformation ? previousMesh.previousPositionOS : previousMesh.vertex.xyz); + #if defined(_ADD_PRECOMPUTED_VELOCITY) + effectivePositionOS -= input.precomputedVelocity; + #endif + + previousMesh.vertex = float4(effectivePositionOS, 1); + VertexToPixel dummy = (VertexToPixel)0; + + + ChainModifyVertex(previousMesh, dummy, _LastTimeParameters); + + // we might need this for skinned objects? + //float3 normalWS = TransformPreviousObjectToWorldNormal(input.normal).xyz; + float3 previousPositionRWS = TransformPreviousObjectToWorld(previousMesh.vertex.xyz); + + #ifdef _WRITE_TRANSPARENT_MOTION_VECTOR + if (_TransparentCameraOnlyMotionVectors > 0) + { + previousPositionRWS = positionRWS.xyz; + } + #endif // _WRITE_TRANSPARENT_MOTION_VECTOR + + output.previousPositionCS = mul(UNITY_MATRIX_PREV_VP, float4(previousPositionRWS, 1.0)); + } + #endif // _HDRP && _PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR)) + + + return output; + } + + +#endif + + + + + + + + #if defined(WRITE_DECAL_BUFFER) && !defined(_DISABLE_DECALS) + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/Decal/DecalPrepassBuffer.hlsl" + #endif + + FragInputs BuildFragInputs(VertexToPixel input) + { + UNITY_SETUP_INSTANCE_ID(input); + FragInputs output; + ZERO_INITIALIZE(FragInputs, output); + + // Init to some default value to make the computer quiet (else it output 'divide by zero' warning even if value is not used). + // TODO: this is a really poor workaround, but the variable is used in a bunch of places + // to compute normals which are then passed on elsewhere to compute other values... + output.tangentToWorld = k_identity3x3; + output.positionSS = input.pos; // input.positionCS is SV_Position + // BETTER SHADERS: because we transform world position into actual world space for things like + // triplanar, etc, we have to back transform it here for lighting + output.positionRWS = GetCameraRelativePositionWS(input.worldPos); + output.tangentToWorld = BuildTangentToWorld(input.worldTangent, input.worldNormal); + output.texCoord0 = input.texcoord0; + output.texCoord1 = input.texcoord1; + output.texCoord2 = input.texcoord2; + + return output; + } + + void BuildSurfaceData(FragInputs fragInputs, inout Surface surfaceDescription, float3 V, PositionInputs posInput, out SurfaceData surfaceData, out float3 bentNormalWS) + { + // setup defaults -- these are used if the graph doesn't output a value + ZERO_INITIALIZE(SurfaceData, surfaceData); + + // specularOcclusion need to be init ahead of decal to quiet the compiler that modify the SurfaceData struct + // however specularOcclusion can come from the graph, so need to be init here so it can be override. + surfaceData.specularOcclusion = 1.0; + + // copy across graph values, if defined + surfaceData.baseColor = surfaceDescription.Albedo; + surfaceData.perceptualSmoothness = surfaceDescription.Smoothness; + surfaceData.ambientOcclusion = surfaceDescription.Occlusion; + surfaceData.specularOcclusion = surfaceDescription.SpecularOcclusion; + surfaceData.metallic = surfaceDescription.Metallic; + surfaceData.subsurfaceMask = surfaceDescription.SubsurfaceMask; + surfaceData.thickness = surfaceDescription.Thickness; + surfaceData.diffusionProfileHash = asuint(surfaceDescription.DiffusionProfileHash); + #if _USESPECULAR + surfaceData.specularColor = surfaceDescription.Specular; + #endif + surfaceData.coatMask = surfaceDescription.CoatMask; + surfaceData.anisotropy = surfaceDescription.Anisotropy; + surfaceData.iridescenceMask = surfaceDescription.IridescenceMask; + surfaceData.iridescenceThickness = surfaceDescription.IridescenceThickness; + + + + #if defined(_REFRACTION_PLANE) || defined(_REFRACTION_SPHERE) || defined(_REFRACTION_THIN) + if (_EnableSSRefraction) + { + surfaceData.transmittanceMask = (1.0 - surfaceDescription.Alpha); + surfaceDescription.Alpha = 1.0; + } + else + { + surfaceData.ior = surfaceDescription.ior; + surfaceData.transmittanceColor = surfaceDescription.transmittanceColor; + surfaceData.atDistance = surfaceDescription.atDistance; + surfaceData.transmittanceMask = surfaceDescription.transmittanceMask; + surfaceDescription.Alpha = 1.0; + } + #else + surfaceData.ior = 1.0; + surfaceData.transmittanceColor = float3(1.0, 1.0, 1.0); + surfaceData.atDistance = 1.0; + surfaceData.transmittanceMask = 0.0; + #endif + + + + // These static material feature allow compile time optimization + surfaceData.materialFeatures = MATERIALFEATUREFLAGS_LIT_STANDARD; + #ifdef _MATERIAL_FEATURE_SUBSURFACE_SCATTERING + surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_SUBSURFACE_SCATTERING; + #endif + + #ifdef _MATERIAL_FEATURE_TRANSMISSION + surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_TRANSMISSION; + #endif + + #ifdef _MATERIAL_FEATURE_ANISOTROPY + surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_ANISOTROPY; + surfaceData.normalWS = float3(0, 1, 0); + #endif + + #ifdef _MATERIAL_FEATURE_IRIDESCENCE + surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_IRIDESCENCE; + #endif + + #ifdef _MATERIAL_FEATURE_SPECULAR_COLOR + surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_SPECULAR_COLOR; + #endif + + #if defined(_MATERIAL_FEATURE_CLEAR_COAT) || _CLEARCOAT + surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_CLEAR_COAT; + #endif + + #if defined (_MATERIAL_FEATURE_SPECULAR_COLOR) && defined (_ENERGY_CONSERVING_SPECULAR) + // Require to have setup baseColor + // Reproduce the energy conservation done in legacy Unity. Not ideal but better for compatibility and users can unchek it + surfaceData.baseColor *= (1.0 - Max3(surfaceData.specularColor.r, surfaceData.specularColor.g, surfaceData.specularColor.b)); + #endif + + + + // compute world space normal + #if !_WORLDSPACENORMAL + surfaceData.normalWS = mul(surfaceDescription.Normal, fragInputs.tangentToWorld); + #else + surfaceData.normalWS = surfaceDescription.Normal; + #endif + + surfaceData.geomNormalWS = fragInputs.tangentToWorld[2]; + + surfaceData.tangentWS = normalize(fragInputs.tangentToWorld[0].xyz); // The tangent is not normalize in tangentToWorld for mikkt. TODO: Check if it expected that we normalize with Morten. Tag: SURFACE_GRADIENT + + + #if HAVE_DECALS + if (_EnableDecals) + { + float alpha = 1.0; + alpha = surfaceDescription.Alpha; + + // Both uses and modifies 'surfaceData.normalWS'. + DecalSurfaceData decalSurfaceData = GetDecalSurfaceData(posInput, fragInputs.tangentToWorld[2], alpha); + ApplyDecalToSurfaceData(decalSurfaceData, fragInputs.tangentToWorld[2], surfaceData); + } + #endif + + bentNormalWS = surfaceData.normalWS; + + surfaceData.tangentWS = Orthonormalize(surfaceData.tangentWS, surfaceData.normalWS); + + #ifdef DEBUG_DISPLAY + if (_DebugMipMapMode != DEBUGMIPMAPMODE_NONE) + { + // TODO: need to update mip info + surfaceData.metallic = 0; + } + + // We need to call ApplyDebugToSurfaceData after filling the surfarcedata and before filling builtinData + // as it can modify attribute use for static lighting + ApplyDebugToSurfaceData(fragInputs.tangentToWorld, surfaceData); + #endif + + // By default we use the ambient occlusion with Tri-ace trick (apply outside) for specular occlusion. + // If user provide bent normal then we process a better term + #if defined(_SPECULAR_OCCLUSION_CUSTOM) + // Just use the value passed through via the slot (not active otherwise) + #elif defined(_SPECULAR_OCCLUSION_FROM_AO_BENT_NORMAL) + // If we have bent normal and ambient occlusion, process a specular occlusion + surfaceData.specularOcclusion = GetSpecularOcclusionFromBentAO(V, bentNormalWS, surfaceData.normalWS, surfaceData.ambientOcclusion, PerceptualSmoothnessToPerceptualRoughness(surfaceData.perceptualSmoothness)); + #elif defined(_AMBIENT_OCCLUSION) && defined(_SPECULAR_OCCLUSION_FROM_AO) + surfaceData.specularOcclusion = GetSpecularOcclusionFromAmbientOcclusion(ClampNdotV(dot(surfaceData.normalWS, V)), surfaceData.ambientOcclusion, PerceptualSmoothnessToRoughness(surfaceData.perceptualSmoothness)); + #endif + + #if defined(_ENABLE_GEOMETRIC_SPECULAR_AA) && !defined(SHADER_STAGE_RAY_TRACING) + surfaceData.perceptualSmoothness = GeometricNormalFiltering(surfaceData.perceptualSmoothness, fragInputs.tangentToWorld[2], surfaceDescription.SpecularAAScreenSpaceVariance, surfaceDescription.SpecularAAThreshold); + #endif + } + + void GetSurfaceAndBuiltinData(VertexToPixel m2ps, FragInputs fragInputs, float3 V, inout PositionInputs posInput, + out SurfaceData surfaceData, out BuiltinData builtinData, inout Surface l, inout ShaderData d + #if NEED_FACING + , bool facing + #endif + ) + { + // Removed since crossfade does not work, probably needs extra material setup. + //#if !defined(SHADER_STAGE_RAY_TRACING) && !defined(_TESSELLATION_DISPLACEMENT) + // #ifdef LOD_FADE_CROSSFADE // enable dithering LOD transition if user select CrossFade transition in LOD group + // LODDitheringTransition(ComputeFadeMaskSeed(V, posInput.positionSS), unity_LODFade.x); + // #endif + //#endif + + d = CreateShaderData(m2ps + #if NEED_FACING + , facing + #endif + ); + + l = (Surface)0; + + l.Albedo = half3(0.5, 0.5, 0.5); + l.Normal = float3(0,0,1); + l.Occlusion = 1; + l.Alpha = 1; + l.SpecularOcclusion = 1; + + #if !defined(SHADER_STAGE_RAY_TRACING) && defined(_DEPTHOFFSET_ON) + l.outputDepth = d.clipPos.z; + #endif + + ChainSurfaceFunction(l, d); + + #if !defined(SHADER_STAGE_RAY_TRACING) && defined(_DEPTHOFFSET_ON) + //posInput.deviceDepth = l.outputDepth; + #endif + + #if _UNLIT + //l.Emission = l.Albedo; + //l.Albedo = 0; + l.Normal = half3(0,0,1); + l.Occlusion = 1; + l.Metallic = 0; + l.Specular = 0; + #endif + + surfaceData.geomNormalWS = d.worldSpaceNormal; + surfaceData.tangentWS = d.worldSpaceTangent; + fragInputs.tangentToWorld = d.TBNMatrix; + + float3 bentNormalWS; + BuildSurfaceData(fragInputs, l, V, posInput, surfaceData, bentNormalWS); + + + InitBuiltinData(posInput, l.Alpha, bentNormalWS, -d.worldSpaceNormal, fragInputs.texCoord1, fragInputs.texCoord2, builtinData); + + + + builtinData.emissiveColor = l.Emission; + + #if defined(_OVERRIDE_BAKEDGI) + builtinData.bakeDiffuseLighting = l.DiffuseGI; + builtinData.backBakeDiffuseLighting = l.BackDiffuseGI; + builtinData.emissiveColor += l.SpecularGI; + #endif + + #if defined(_OVERRIDE_SHADOWMASK) + builtinData.shadowMask0 = l.ShadowMask.x; + builtinData.shadowMask1 = l.ShadowMask.y; + builtinData.shadowMask2 = l.ShadowMask.z; + builtinData.shadowMask3 = l.ShadowMask.w; + #endif + + #if defined(UNITY_VIRTUAL_TEXTURING) + builtinData.vtPackedFeedback = surfaceData.VTPackedFeedback; + #endif + + #if (SHADERPASS == SHADERPASS_DISTORTION) + builtinData.distortion = surfaceData.Distortion; + builtinData.distortionBlur = surfaceData.DistortionBlur; + #endif + + #ifndef SHADER_UNLIT + // PostInitBuiltinData call ApplyDebugToBuiltinData + PostInitBuiltinData(V, posInput, surfaceData, builtinData); + #else + ApplyDebugToBuiltinData(builtinData); + #endif + + RAY_TRACING_OPTIONAL_ALPHA_TEST_PASS + } + + + +#if defined(WRITE_DECAL_BUFFER) && defined(WRITE_MSAA_DEPTH) +#define SV_TARGET_NORMAL SV_Target3 +#elif defined(WRITE_DECAL_BUFFER) || defined(WRITE_MSAA_DEPTH) +#define SV_TARGET_NORMAL SV_Target2 +#else +#define SV_TARGET_NORMAL SV_Target1 +#endif + +// Caution: Motion vector pass is different from Depth prepass, it render normal buffer last instead of decal buffer last +// and thus, we force a write of 0 if _DISABLE_DECALS so we always write in the decal buffer. +// This is required as we can't make distinction between deferred (write normal buffer) and forward (write normal buffer) +// in the context of the motion vector pass. The cost is acceptable as it is only do object with motion vector (usualy skin object) +// that most of the time use Forward Material (so are already writing motion vector data). +// So note that here unlike for depth prepass we don't check && !defined(_DISABLE_DECALS) +void Frag( VertexToPixel v2f + #ifdef WRITE_MSAA_DEPTH + // We need the depth color as SV_Target0 for alpha to coverage + , out float4 depthColor : SV_Target0 + , out float4 outMotionVector : SV_Target1 + #ifdef WRITE_DECAL_BUFFER + , out float4 outDecalBuffer : SV_Target2 + #endif + #else + // When no MSAA, the motion vector is always the first buffer + , out float4 outMotionVector : SV_Target0 + #ifdef WRITE_DECAL_BUFFER + , out float4 outDecalBuffer : SV_Target1 + #endif + #endif + + // Decal buffer must be last as it is bind but we can optionally write into it (based on _DISABLE_DECALS) + #ifdef WRITE_NORMAL_BUFFER + , out float4 outNormalBuffer : SV_TARGET_NORMAL + #endif + + #ifdef _DEPTHOFFSET_ON + , out float outputDepth : SV_Depth + #endif + #if NEED_FACING + , bool facing : SV_IsFrontFace + #endif + ) + { + + FragInputs input = BuildFragInputs(v2f); + PositionInputs posInput = GetPositionInput(input.positionSS.xy, _ScreenSize.zw, input.positionSS.z, input.positionSS.w, input.positionRWS); + + float3 V = GetWorldSpaceNormalizeViewDir(input.positionRWS); + + + SurfaceData surfaceData; + BuiltinData builtinData; + Surface l; + ShaderData d; + GetSurfaceAndBuiltinData(v2f, input, V, posInput, surfaceData, builtinData, l, d + #if NEED_FACING + , facing + #endif + ); + + #ifdef _DEPTHOFFSET_ON + v2f.motionVectorCS.w += builtinData.depthOffset; + v2f.previousPositionCS.w += builtinData.depthOffset; + #endif + + // TODO: How to allow overriden motion vector from GetSurfaceAndBuiltinData ? + float2 motionVector = CalculateMotionVector(v2f.motionVectorCS, v2f.previousPositionCS); + + // Convert from Clip space (-1..1) to NDC 0..1 space. + // Note it doesn't mean we don't have negative value, we store negative or positive offset in NDC space. + // Note: ((positionCS * 0.5 + 0.5) - (v2f.previousPositionCS * 0.5 + 0.5)) = (motionVector * 0.5) + EncodeMotionVector(motionVector * 0.5, outMotionVector); + + // Note: unity_MotionVectorsParams.y is 0 is forceNoMotion is enabled + bool forceNoMotion = unity_MotionVectorsParams.y == 0.0; + + // Setting the motionVector to a value more than 2 set as a flag for "force no motion". This is valid because, given that the velocities are in NDC, + // a value of >1 can never happen naturally, unless explicitely set. + if (forceNoMotion) + outMotionVector = float4(2.0, 0.0, 0.0, 0.0); + + // Depth and Alpha to coverage + #ifdef WRITE_MSAA_DEPTH + // In case we are rendering in MSAA, reading the an MSAA depth buffer is way too expensive. To avoid that, we export the depth to a color buffer + depthColor = v2f.pos.z; + + #ifdef _ALPHATOMASK_ON + // Alpha channel is used for alpha to coverage + depthColor.a = SharpenAlpha(builtinData.opacity, builtinData.alphaClipTreshold); + #endif + #endif + + // Normal Buffer Processing + #ifdef WRITE_NORMAL_BUFFER + EncodeIntoNormalBuffer(ConvertSurfaceDataToNormalData(surfaceData), outNormalBuffer); + #endif + + #if defined(WRITE_DECAL_BUFFER) + DecalPrepassData decalPrepassData; + // Force a write in decal buffer even if decal is disab. This is a neutral value which have no impact for later pass + #ifdef _DISABLE_DECALS + ZERO_INITIALIZE(DecalPrepassData, decalPrepassData); + #else + // We don't have the right to access SurfaceData in a shaderpass. + // However it would be painful to have to add a function like ConvertSurfaceDataToDecalPrepassData() to every Material to return geomNormalWS anyway + // Here we will put the constrain that any Material requiring to support Decal, will need to have geomNormalWS as member of surfaceData (and we already require normalWS anyway) + decalPrepassData.geomNormalWS = surfaceData.geomNormalWS; + decalPrepassData.decalLayerMask = GetMeshRenderingDecalLayer(); + #endif + EncodeIntoDecalPrepassBuffer(decalPrepassData, outDecalBuffer); + outDecalBuffer.w = (GetMeshRenderingLightLayer() & 0x000000FF) / 255.0; + #endif + + #ifdef _DEPTHOFFSET_ON + outputDepth = posInput.deviceDepth; + #endif + } + + ENDHLSL + } + + + Pass + { + Name "FullScreenDebug" + Tags + { + "LightMode" = "FullScreenDebug" + } + + // Render State + Cull Back + ZTest LEqual + ZWrite Off + + //------------------------------------------------------------------------------------- + // End Render Modes + //------------------------------------------------------------------------------------- + + HLSLPROGRAM + + #pragma target 4.5 + #pragma only_renderers d3d11 playstation xboxone xboxseries vulkan metal switch + + + + //#pragma shader_feature _ _SURFACE_TYPE_TRANSPARENT + //#pragma shader_feature_local _BLENDMODE_OFF _BLENDMODE_ALPHA _BLENDMODE_ADD _BLENDMODE_PRE_MULTIPLY + //#pragma shader_feature_local _ _ADD_PRECOMPUTED_VELOCITY + //#pragma shader_feature_local _ _TRANSPARENT_WRITES_MOTION_VEC + //#pragma shader_feature_local _ _ENABLE_FOG_ON_TRANSPARENT + //#pragma shader_feature_local _ _DISABLE_DECALS + //#pragma shader_feature_local _ _DISABLE_SSR + //#pragma shader_feature_local _ _DISABLE_SSR_TRANSPARENT + //#pragma shader_feature_local _REFRACTION_OFF _REFRACTION_PLANE _REFRACTION_SPHERE _REFRACTION_THIN + + + + #define SHADERPASS SHADERPASS_FULL_SCREEN_DEBUG + #define _PASSFULLSCREENDEBUG 1 + + + #pragma shader_feature_local GLOW_ON + #pragma shader_feature_local FADE_ON + #pragma shader_feature_local OUTBASE_ON + #pragma shader_feature_local ONLYOUTLINE_ON + #pragma shader_feature_local GRADIENT_ON + #pragma shader_feature_local GRADIENT2COL_ON + #pragma shader_feature_local RADIALGRADIENT_ON + #pragma shader_feature_local COLORSWAP_ON + #pragma shader_feature_local HSV_ON + #pragma shader_feature_local CHANGECOLOR_ON + #pragma shader_feature_local CHANGECOLOR2_ON + #pragma shader_feature_local CHANGECOLOR3_ON + #pragma shader_feature_local COLORRAMP_ON + #pragma shader_feature_local GRADIENTCOLORRAMP_ON + #pragma shader_feature_local HITEFFECT_ON + #pragma shader_feature_local NEGATIVE_ON + #pragma shader_feature_local PIXELATE_ON + #pragma shader_feature_local GREYSCALE_ON + #pragma shader_feature_local POSTERIZE_ON + #pragma shader_feature_local BLUR_ON + #pragma shader_feature_local MOTIONBLUR_ON + #pragma shader_feature_local GHOST_ON + #pragma shader_feature_local ALPHAOUTLINE_ON + #pragma shader_feature_local INNEROUTLINE_ON + #pragma shader_feature_local ONLYINNEROUTLINE_ON + #pragma shader_feature_local HOLOGRAM_ON + #pragma shader_feature_local CHROMABERR_ON + #pragma shader_feature_local GLITCH_ON + #pragma shader_feature_local FLICKER_ON + #pragma shader_feature_local SHADOW_ON + #pragma shader_feature_local SHINE_ON + #pragma shader_feature_local CONTRAST_ON + #pragma shader_feature_local OVERLAY_ON + #pragma shader_feature_local OVERLAYMULT_ON + #pragma shader_feature_local DOODLE_ON + #pragma shader_feature_local WIND_ON + #pragma shader_feature_local WAVEUV_ON + #pragma shader_feature_local ROUNDWAVEUV_ON + #pragma shader_feature_local RECTSIZE_ON + #pragma shader_feature_local OFFSETUV_ON + #pragma shader_feature_local CLIPPING_ON + #pragma shader_feature_local RADIALCLIPPING_ON + #pragma shader_feature_local TEXTURESCROLL_ON + #pragma shader_feature_local ZOOMUV_ON + #pragma shader_feature_local DISTORT_ON + #pragma shader_feature_local WARP_ON + #pragma shader_feature_local TWISTUV_ON + #pragma shader_feature_local ROTATEUV_ON + #pragma shader_feature_local POLARUV_ON + #pragma shader_feature_local FISHEYE_ON + #pragma shader_feature_local PINCH_ON + #pragma shader_feature_local SHAKEUV_ON + + #pragma shader_feature_local GLOWTEX_ON + #pragma shader_feature_local OUTTEX_ON + #pragma shader_feature_local OUTDIST_ON + #pragma shader_feature_local OUTBASE8DIR_ON + #pragma shader_feature_local OUTBASEPIXELPERF_ON + #pragma shader_feature_local COLORRAMPOUTLINE_ON + #pragma shader_feature_local GREYSCALEOUTLINE_ON + #pragma shader_feature_local POSTERIZEOUTLINE_ON + #pragma shader_feature_local BLURISHD_ON + #pragma shader_feature_local MANUALWIND_ON + #pragma shader_feature_local ATLAS_ON + #pragma shader_feature_local PREMULTIPLYALPHA_ON + + #pragma shader_feature BILBOARD_ON + #pragma shader_feature BILBOARDY_ON + + #pragma shader_feature NORMALMAP_ON + + + #define _HDRP 1 +#define _USINGTEXCOORD1 1 +#define _USINGTEXCOORD2 1 + + + #pragma vertex Vert + #pragma fragment Frag + + // useful conversion functions to make surface shader code just work + + #define UNITY_DECLARE_TEX2D(name) TEXTURE2D(name); SAMPLER(sampler##name); + #define UNITY_DECLARE_TEX2D_NOSAMPLER(name) TEXTURE2D(name); + #define UNITY_DECLARE_TEX2DARRAY(name) TEXTURE2D_ARRAY(name); SAMPLER(sampler##name); + #define UNITY_DECLARE_TEX2DARRAY_NOSAMPLER(tex) TEXTURE2D_ARRAY(tex); + + #define UNITY_SAMPLE_TEX2DARRAY(tex,coord) SAMPLE_TEXTURE2D_ARRAY(tex, sampler##tex, coord.xy, coord.z) + #define UNITY_SAMPLE_TEX2DARRAY_LOD(tex,coord,lod) SAMPLE_TEXTURE2D_ARRAY_LOD(tex, sampler##tex, coord.xy, coord.z, lod) + #define UNITY_SAMPLE_TEX2D(tex, coord) SAMPLE_TEXTURE2D(tex, sampler##tex, coord) + #define UNITY_SAMPLE_TEX2D_SAMPLER(tex, samp, coord) SAMPLE_TEXTURE2D(tex, sampler##samp, coord) + + #define UNITY_SAMPLE_TEX2D_LOD(tex,coord, lod) SAMPLE_TEXTURE2D_LOD(tex, sampler_##tex, coord, lod) + #define UNITY_SAMPLE_TEX2D_SAMPLER_LOD(tex,samplertex,coord, lod) SAMPLE_TEXTURE2D_LOD (tex, sampler##samplertex,coord, lod) + + #if defined(UNITY_COMPILER_HLSL) + #define UNITY_INITIALIZE_OUTPUT(type,name) name = (type)0; + #else + #define UNITY_INITIALIZE_OUTPUT(type,name) + #endif + + #define sampler2D_float sampler2D + #define sampler2D_half sampler2D + + #undef WorldNormalVector + #define WorldNormalVector(data, normal) mul(normal, data.TBNMatrix) + + #define UnityObjectToWorldNormal(normal) mul(GetObjectToWorldMatrix(), normal) + + + + +// HDRP Adapter stuff + #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Common.hlsl" + #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Texture.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/ShaderVariables.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/ShaderPass/FragInputs.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/ShaderPass/ShaderPass.cs.hlsl" + #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/TextureStack.hlsl" // Required to be include before we include properties as it define DECLARE_STACK_CB +#if UNITY_VERSION >= UNITY_2021_3_31 + #include "Packages/com.unity.shadergraph/ShaderGraphLibrary/Functions.hlsl" // Need to be here for Gradient struct definition +#else + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/ShaderGraphHeader.hlsl" +#endif + #ifdef RAYTRACING_SHADER_GRAPH_DEFAULT + #define RAYTRACING_SHADER_GRAPH_HIGH + #endif + + #ifdef RAYTRACING_SHADER_GRAPH_RAYTRACED + #define RAYTRACING_SHADER_GRAPH_LOW + #endif + // end + + + + + // If we use subsurface scattering, enable output split lighting (for forward pass) + #if defined(_MATERIAL_FEATURE_SUBSURFACE_SCATTERING) && !defined(_SURFACE_TYPE_TRANSPARENT) + #define OUTPUT_SPLIT_LIGHTING + #endif + + #define HAVE_RECURSIVE_RENDERING + + #if SHADERPASS == SHADERPASS_TRANSPARENT_DEPTH_PREPASS + #if !defined(_DISABLE_SSR_TRANSPARENT) && !defined(SHADER_UNLIT) + #define WRITE_NORMAL_BUFFER + #endif + #endif + + #ifndef DEBUG_DISPLAY + // In case of opaque we don't want to perform the alpha test, it is done in depth prepass and we use depth equal for ztest (setup from UI) + // Don't do it with debug display mode as it is possible there is no depth prepass in this case + #if !defined(_SURFACE_TYPE_TRANSPARENT) && defined(_ALPHATEST) + #if SHADERPASS == SHADERPASS_FORWARD + #define SHADERPASS_FORWARD_BYPASS_ALPHA_TEST + #elif SHADERPASS == SHADERPASS_GBUFFER + #define SHADERPASS_GBUFFER_BYPASS_ALPHA_TEST + #endif + #endif + #endif + + // Define _DEFERRED_CAPABLE_MATERIAL for shader capable to run in deferred pass + #if defined(SHADER_LIT) && !defined(_SURFACE_TYPE_TRANSPARENT) + #define _DEFERRED_CAPABLE_MATERIAL + #endif + + // Translate transparent motion vector define + #if defined(_TRANSPARENT_WRITES_MOTION_VEC) && defined(_SURFACE_TYPE_TRANSPARENT) + #define _WRITE_TRANSPARENT_MOTION_VECTOR + #endif + + + + + CBUFFER_START(UnityPerMaterial) + float _UseShadowThreshold; + float _BlendMode; + float _EnableBlendModePreserveSpecularLighting; + float _RayTracing; + float _RefractionModel; + + + half4 _Color; + half4 _MainTex_ST, _MainTex_TexelSize; + half _Alpha, _AlphaCutoffValue; + + #if ATLAS_ON + half _MinXUV, _MaxXUV, _MinYUV, _MaxYUV; + #endif + + #if GLOW_ON + half4 _GlowColor; + half _Glow, _GlowGlobal; + #endif + + #if HSV_ON + half _HsvShift, _HsvSaturation, _HsvBright; + #endif + + #if DISTORT_ON + half4 _DistortTex_ST; + half _DistortTexXSpeed, _DistortTexYSpeed, _DistortAmount; + #endif + + #if FADE_ON + half4 _FadeBurnColor, _FadeTex_ST, _FadeBurnTex_ST; + half _FadeAmount, _FadeBurnWidth, _FadeBurnTransition,_FadeBurnGlow; + #endif + + #if OUTBASE_ON + half4 _OutlineColor; + half _OutlineAlpha, _OutlineGlow, _OutlineWidth; + int _OutlinePixelWidth; + #endif + + #if OUTTEX_ON + half4 _OutlineTex_ST; + half _OutlineTexXSpeed, _OutlineTexYSpeed; + #endif + + #if OUTDIST_ON + half4 _OutlineDistortTex_ST; + half _OutlineDistortTexXSpeed, _OutlineDistortTexYSpeed, _OutlineDistortAmount; + #endif + + #if ALPHAOUTLINE_ON + half _AlphaOutlineGlow, _AlphaOutlinePower, _AlphaOutlineMinAlpha, _AlphaOutlineBlend; + half4 _AlphaOutlineColor; + #endif + + #if INNEROUTLINE_ON + half _InnerOutlineThickness, _InnerOutlineAlpha, _InnerOutlineGlow; + half4 _InnerOutlineColor; + #endif + + #if GRADIENT_ON + half _GradBlend, _GradBoostX, _GradBoostY; + half4 _GradTopRightCol, _GradTopLeftCol, _GradBotRightCol, _GradBotLeftCol; + #endif + + #if COLORSWAP_ON + half4 _ColorSwapRed, _ColorSwapGreen, _ColorSwapBlue; + half _ColorSwapRedLuminosity, _ColorSwapGreenLuminosity, _ColorSwapBlueLuminosity, _ColorSwapBlend; + #endif + + #if CHANGECOLOR_ON + half4 _ColorChangeNewCol, _ColorChangeTarget; + half _ColorChangeTolerance, _ColorChangeLuminosity; + #endif + #if CHANGECOLOR2_ON + half4 _ColorChangeNewCol2, _ColorChangeTarget2; + half _ColorChangeTolerance2; + #endif + #if CHANGECOLOR3_ON + half4 _ColorChangeNewCol3, _ColorChangeTarget3; + half _ColorChangeTolerance3; + #endif + + #if COLORRAMP_ON + half _ColorRampLuminosity, _ColorRampBlend; + #endif + + #if HITEFFECT_ON + half4 _HitEffectColor; + half _HitEffectGlow, _HitEffectBlend; + #endif + + #if NEGATIVE_ON + half _NegativeAmount; + #endif + + #if PIXELATE_ON + half _PixelateSize; + #endif + + #if GREYSCALE_ON + half _GreyscaleLuminosity, _GreyscaleBlend; + half4 _GreyscaleTintColor; + #endif + + #if POSTERIZE_ON + half _PosterizeNumColors, _PosterizeGamma; + #endif + + #if BLUR_ON + half _BlurIntensity; + #endif + + #if MOTIONBLUR_ON + half _MotionBlurAngle, _MotionBlurDist; + #endif + + #if GHOST_ON + half _GhostColorBoost, _GhostTransparency, _GhostBlend; + #endif + + #if HOLOGRAM_ON + half _HologramStripesAmount, _HologramMinAlpha, _HologramUnmodAmount, _HologramStripesSpeed, _HologramMaxAlpha, _HologramBlend; + half4 _HologramStripeColor; + #endif + + #if CHROMABERR_ON + half _ChromAberrAmount, _ChromAberrAlpha; + #endif + + #if GLITCH_ON + half _GlitchAmount, _GlitchSize; + #endif + + #if FLICKER_ON + half _FlickerFreq, _FlickerPercent, _FlickerAlpha; + #endif + + #if SHADOW_ON + half _ShadowX, _ShadowY, _ShadowAlpha; + half4 _ShadowColor; + #endif + + #if SHINE_ON + half4 _ShineColor; + half _ShineLocation, _ShineRotate, _ShineWidth, _ShineGlow; + #endif + + #if CONTRAST_ON + half _Contrast, _Brightness; + #endif + + #if OVERLAY_ON + half4 _OverlayTex_ST, _OverlayColor; + half _OverlayGlow, _OverlayBlend, _OverlayTextureScrollXSpeed, _OverlayTextureScrollYSpeed; + #endif + + #if DOODLE_ON + half _HandDrawnAmount, _HandDrawnSpeed; + #endif + + #if WIND_ON + half _GrassSpeed, _GrassWind, _GrassManualAnim, _GrassRadialBend; + #endif + + #if WAVEUV_ON + float _WaveAmount, _WaveSpeed, _WaveStrength, _WaveX, _WaveY; + #endif + + #if ROUNDWAVEUV_ON + half _RoundWaveStrength, _RoundWaveSpeed; + #endif + + #if RECTSIZE_ON + half _RectSize; + #endif + + #if OFFSETUV_ON + half _OffsetUvX, _OffsetUvY; + #endif + + #if CLIPPING_ON + half _ClipUvLeft, _ClipUvRight, _ClipUvUp, _ClipUvDown; + #endif + + #if RADIALCLIPPING_ON + half _RadialStartAngle, _RadialClip, _RadialClip2; + #endif + + #if TEXTURESCROLL_ON + half _TextureScrollXSpeed, _TextureScrollYSpeed; + #endif + + #if ZOOMUV_ON + half _ZoomUvAmount; + #endif + + #if WARP_ON + half _WarpStrength, _WarpSpeed, _WarpScale; + #endif + + #if TWISTUV_ON + half _TwistUvAmount, _TwistUvPosX, _TwistUvPosY, _TwistUvRadius; + #endif + + #if ROTATEUV_ON + half _RotateUvAmount; + #endif + + #if FISHEYE_ON + half _FishEyeUvAmount; + #endif + + #if PINCH_ON + half _PinchUvAmount; + #endif + + #if SHAKEUV_ON + half _ShakeUvSpeed, _ShakeUvX, _ShakeUvY; + #endif + + #if NORMALMAP_ON + half _NormalStrength; + #endif + + float _RandomSeed; + + + + + CBUFFER_END + + + + // -- Property used by ScenePickingPass + #ifdef SCENEPICKINGPASS + float4 _SelectionID; + #endif + + // -- Properties used by SceneSelectionPass + #ifdef SCENESELECTIONPASS + int _ObjectId; + int _PassValue; + #endif + + + // data across stages, stripped like the above. + struct VertexToPixel + { + float4 pos : SV_POSITION; + float3 worldPos : TEXCOORD0; + float3 worldNormal : TEXCOORD1; + float4 worldTangent : TEXCOORD2; + float4 texcoord0 : TEXCOORD3; + float4 texcoord1 : TEXCOORD4; + float4 texcoord2 : TEXCOORD5; + // #if %TEXCOORD3REQUIREKEY% + float4 texcoord3 : TEXCOORD6; + // #endif + + // #if %SCREENPOSREQUIREKEY% + // float4 screenPos : TEXCOORD7; + // #endif + + // #if %VERTEXCOLORREQUIREKEY% + float4 vertexColor : COLOR; + // #endif + + // #if %EXTRAV2F0REQUIREKEY% + // float4 extraV2F0 : TEXCOORD8; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // float4 extraV2F1 : TEXCOORD9; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // float4 extraV2F2 : TEXCOORD10; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // float4 extraV2F3 : TEXCOORD11; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // float4 extraV2F4 : TEXCOORD12; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // float4 extraV2F5 : TEXCOORD13; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // float4 extraV2F6 : TEXCOORD14; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // float4 extraV2F7 : TEXCOORD15; + // #endif + + #if UNITY_ANY_INSTANCING_ENABLED + UNITY_VERTEX_INPUT_INSTANCE_ID + #endif // UNITY_ANY_INSTANCING_ENABLED + + #if _HDRP && (_PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR))) + float4 previousPositionCS : TEXCOORD16; // Contain previous transform position (in case of skinning for example) + float4 motionVectorCS : TEXCOORD17; + #endif + + UNITY_VERTEX_OUTPUT_STEREO + }; + + + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Debug/DebugDisplay.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/Material.hlsl" + #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/NormalSurfaceGradient.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/Lit/Lit.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/BuiltinUtilities.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/MaterialUtilities.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/ShaderGraphFunctions.hlsl" + + + + + // data describing the user output of a pixel + struct Surface + { + half3 Albedo; + half Height; + half3 Normal; + half Smoothness; + half3 Emission; + half Metallic; + half3 Specular; + half Occlusion; + half SpecularPower; // for simple lighting + half Alpha; + float outputDepth; // if written, SV_Depth semantic is used. ShaderData.clipPos.z is unused value + // HDRP Only + half SpecularOcclusion; + half SubsurfaceMask; + half Thickness; + half CoatMask; + half CoatSmoothness; + half Anisotropy; + half IridescenceMask; + half IridescenceThickness; + int DiffusionProfileHash; + float SpecularAAThreshold; + float SpecularAAScreenSpaceVariance; + // requires _OVERRIDE_BAKEDGI to be defined, but is mapped in all pipelines + float3 DiffuseGI; + float3 BackDiffuseGI; + float3 SpecularGI; + float ior; + float3 transmittanceColor; + float atDistance; + float transmittanceMask; + // requires _OVERRIDE_SHADOWMASK to be defines + float4 ShadowMask; + + // for decals + float NormalAlpha; + float MAOSAlpha; + + + }; + + // Data the user declares in blackboard blocks + struct Blackboard + { + + float blackboardDummyData; + }; + + // data the user might need, this will grow to be big. But easy to strip + struct ShaderData + { + float4 clipPos; // SV_POSITION + float3 localSpacePosition; + float3 localSpaceNormal; + float3 localSpaceTangent; + + float3 worldSpacePosition; + float3 worldSpaceNormal; + float3 worldSpaceTangent; + float tangentSign; + + float3 worldSpaceViewDir; + float3 tangentSpaceViewDir; + + float4 texcoord0; + float4 texcoord1; + float4 texcoord2; + float4 texcoord3; + + float2 screenUV; + float4 screenPos; + + float4 vertexColor; + bool isFrontFace; + + float4 extraV2F0; + float4 extraV2F1; + float4 extraV2F2; + float4 extraV2F3; + float4 extraV2F4; + float4 extraV2F5; + float4 extraV2F6; + float4 extraV2F7; + + float3x3 TBNMatrix; + Blackboard blackboard; + }; + + struct VertexData + { + #if SHADER_TARGET > 30 + // uint vertexID : SV_VertexID; + #endif + float4 vertex : POSITION; + float3 normal : NORMAL; + float4 tangent : TANGENT; + float4 texcoord0 : TEXCOORD0; + + // optimize out mesh coords when not in use by user or lighting system + #if _URP && (_USINGTEXCOORD1 || _PASSMETA || _PASSFORWARD || _PASSGBUFFER) + float4 texcoord1 : TEXCOORD1; + #endif + + #if _URP && (_USINGTEXCOORD2 || _PASSMETA || ((_PASSFORWARD || _PASSGBUFFER) && defined(DYNAMICLIGHTMAP_ON))) + float4 texcoord2 : TEXCOORD2; + #endif + + #if _STANDARD && (_USINGTEXCOORD1 || (_PASSMETA || ((_PASSFORWARD || _PASSGBUFFER || _PASSFORWARDADD) && LIGHTMAP_ON))) + float4 texcoord1 : TEXCOORD1; + #endif + #if _STANDARD && (_USINGTEXCOORD2 || (_PASSMETA || ((_PASSFORWARD || _PASSGBUFFER) && DYNAMICLIGHTMAP_ON))) + float4 texcoord2 : TEXCOORD2; + #endif + + + #if _HDRP + float4 texcoord1 : TEXCOORD1; + float4 texcoord2 : TEXCOORD2; + #endif + + // #if %TEXCOORD3REQUIREKEY% + float4 texcoord3 : TEXCOORD3; + // #endif + + // #if %VERTEXCOLORREQUIREKEY% + float4 vertexColor : COLOR; + // #endif + + #if _PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR)) + float3 previousPositionOS : TEXCOORD4; // Contain previous transform position (in case of skinning for example) + #if defined (_ADD_PRECOMPUTED_VELOCITY) + float3 precomputedVelocity : TEXCOORD5; // Add Precomputed Velocity (Alembic computes velocities on runtime side). + #endif + #endif + + UNITY_VERTEX_INPUT_INSTANCE_ID + }; + + struct TessVertex + { + float4 vertex : INTERNALTESSPOS; + float3 normal : NORMAL; + float4 tangent : TANGENT; + float4 texcoord0 : TEXCOORD0; + float4 texcoord1 : TEXCOORD1; + float4 texcoord2 : TEXCOORD2; + + // #if %TEXCOORD3REQUIREKEY% + float4 texcoord3 : TEXCOORD3; + // #endif + + // #if %VERTEXCOLORREQUIREKEY% + float4 vertexColor : COLOR; + // #endif + + // #if %EXTRAV2F0REQUIREKEY% + // float4 extraV2F0 : TEXCOORD5; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // float4 extraV2F1 : TEXCOORD6; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // float4 extraV2F2 : TEXCOORD7; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // float4 extraV2F3 : TEXCOORD8; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // float4 extraV2F4 : TEXCOORD9; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // float4 extraV2F5 : TEXCOORD10; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // float4 extraV2F6 : TEXCOORD11; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // float4 extraV2F7 : TEXCOORD12; + // #endif + + #if _PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR)) + float3 previousPositionOS : TEXCOORD13; // Contain previous transform position (in case of skinning for example) + #if defined (_ADD_PRECOMPUTED_VELOCITY) + float3 precomputedVelocity : TEXCOORD14; + #endif + #endif + + UNITY_VERTEX_INPUT_INSTANCE_ID + UNITY_VERTEX_OUTPUT_STEREO + }; + + struct ExtraV2F + { + float4 extraV2F0; + float4 extraV2F1; + float4 extraV2F2; + float4 extraV2F3; + float4 extraV2F4; + float4 extraV2F5; + float4 extraV2F6; + float4 extraV2F7; + Blackboard blackboard; + float4 time; + }; + + + float3 WorldToTangentSpace(ShaderData d, float3 normal) + { + return mul(d.TBNMatrix, normal); + } + + float3 TangentToWorldSpace(ShaderData d, float3 normal) + { + return mul(normal, d.TBNMatrix); + } + + // in this case, make standard more like SRPs, because we can't fix + // unity_WorldToObject in HDRP, since it already does macro-fu there + + #if _STANDARD + float3 TransformWorldToObject(float3 p) { return mul(unity_WorldToObject, float4(p, 1)); }; + float3 TransformObjectToWorld(float3 p) { return mul(unity_ObjectToWorld, float4(p, 1)); }; + float4 TransformWorldToObject(float4 p) { return mul(unity_WorldToObject, p); }; + float4 TransformObjectToWorld(float4 p) { return mul(unity_ObjectToWorld, p); }; + float4x4 GetWorldToObjectMatrix() { return unity_WorldToObject; } + float4x4 GetObjectToWorldMatrix() { return unity_ObjectToWorld; } + #if (defined(SHADER_API_D3D11) || defined(SHADER_API_XBOXONE) || defined(UNITY_COMPILER_HLSLCC) || defined(SHADER_API_PSSL) || (SHADER_TARGET_SURFACE_ANALYSIS && !SHADER_TARGET_SURFACE_ANALYSIS_MOJOSHADER)) + #define UNITY_SAMPLE_TEX2D_LOD(tex,coord, lod) tex.SampleLevel (sampler##tex,coord, lod) + #define UNITY_SAMPLE_TEX2D_SAMPLER_LOD(tex,samplertex,coord, lod) tex.SampleLevel (sampler##samplertex,coord, lod) + #else + #define UNITY_SAMPLE_TEX2D_LOD(tex,coord,lod) tex2D (tex,coord,0,lod) + #define UNITY_SAMPLE_TEX2D_SAMPLER_LOD(tex,samplertex,coord,lod) tex2D (tex,coord,0,lod) + #endif + + #undef GetWorldToObjectMatrix() + + #define GetWorldToObjectMatrix() unity_WorldToObject + + + #endif + + float3 GetCameraWorldPosition() + { + #if _HDRP + return GetCameraRelativePositionWS(_WorldSpaceCameraPos); + #else + return _WorldSpaceCameraPos; + #endif + } + + #if _GRABPASSUSED + #if _STANDARD + TEXTURE2D(%GRABTEXTURE%); + SAMPLER(sampler_%GRABTEXTURE%); + #endif + + half3 GetSceneColor(float2 uv) + { + #if _STANDARD + return SAMPLE_TEXTURE2D(%GRABTEXTURE%, sampler_%GRABTEXTURE%, uv).rgb; + #else + return SHADERGRAPH_SAMPLE_SCENE_COLOR(uv); + #endif + } + #endif + + + + #if _STANDARD + UNITY_DECLARE_DEPTH_TEXTURE(_CameraDepthTexture); + float GetSceneDepth(float2 uv) { return SAMPLE_DEPTH_TEXTURE(_CameraDepthTexture, uv); } + float GetLinear01Depth(float2 uv) { return Linear01Depth(GetSceneDepth(uv)); } + float GetLinearEyeDepth(float2 uv) { return LinearEyeDepth(GetSceneDepth(uv)); } + #else + float GetSceneDepth(float2 uv) { return SHADERGRAPH_SAMPLE_SCENE_DEPTH(uv); } + float GetLinear01Depth(float2 uv) { return Linear01Depth(GetSceneDepth(uv), _ZBufferParams); } + float GetLinearEyeDepth(float2 uv) { return LinearEyeDepth(GetSceneDepth(uv), _ZBufferParams); } + #endif + + float3 GetWorldPositionFromDepthBuffer(float2 uv, float3 worldSpaceViewDir) + { + float eye = GetLinearEyeDepth(uv); + float3 camView = mul((float3x3)GetObjectToWorldMatrix(), transpose(mul(GetWorldToObjectMatrix(), UNITY_MATRIX_I_V)) [2].xyz); + + float dt = dot(worldSpaceViewDir, camView); + float3 div = worldSpaceViewDir/dt; + float3 wpos = (eye * div) + GetCameraWorldPosition(); + return wpos; + } + + #if _HDRP + float3 ObjectToWorldSpacePosition(float3 pos) + { + return GetAbsolutePositionWS(TransformObjectToWorld(pos)); + } + #else + float3 ObjectToWorldSpacePosition(float3 pos) + { + return TransformObjectToWorld(pos); + } + #endif + + #if _STANDARD + UNITY_DECLARE_SCREENSPACE_TEXTURE(_CameraDepthNormalsTexture); + float3 GetSceneNormal(float2 uv, float3 worldSpaceViewDir) + { + float4 depthNorms = UNITY_SAMPLE_SCREENSPACE_TEXTURE(_CameraDepthNormalsTexture, uv); + float3 norms = DecodeViewNormalStereo(depthNorms); + norms = mul((float3x3)GetWorldToViewMatrix(), norms) * 0.5 + 0.5; + return norms; + } + #elif _HDRP && !_DECALSHADER + + float3 GetSceneNormal(float2 uv, float3 worldSpaceViewDir) + { + NormalData nd; + DecodeFromNormalBuffer(_ScreenSize.xy * uv, nd); + return nd.normalWS; + } + #elif _URP + #if (SHADER_LIBRARY_VERSION_MAJOR >= 10) + #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/DeclareNormalsTexture.hlsl" + #endif + + float3 GetSceneNormal(float2 uv, float3 worldSpaceViewDir) + { + #if (SHADER_LIBRARY_VERSION_MAJOR >= 10) + return SampleSceneNormals(uv); + #else + float3 wpos = GetWorldPositionFromDepthBuffer(uv, worldSpaceViewDir); + return normalize(-cross(ddx(wpos), ddy(wpos))) * 0.5 + 0.5; + #endif + + } + #endif + + #if _HDRP + + half3 UnpackNormalmapRGorAG(half4 packednormal) + { + // This do the trick + packednormal.x *= packednormal.w; + + half3 normal; + normal.xy = packednormal.xy * 2 - 1; + normal.z = sqrt(1 - saturate(dot(normal.xy, normal.xy))); + return normal; + } + half3 UnpackNormal(half4 packednormal) + { + #if defined(UNITY_NO_DXT5nm) + return packednormal.xyz * 2 - 1; + #else + return UnpackNormalmapRGorAG(packednormal); + #endif + } + #endif + #if _HDRP || _URP + + half3 UnpackScaleNormal(half4 packednormal, half scale) + { + #ifndef UNITY_NO_DXT5nm + // Unpack normal as DXT5nm (1, y, 1, x) or BC5 (x, y, 0, 1) + // Note neutral texture like "bump" is (0, 0, 1, 1) to work with both plain RGB normal and DXT5nm/BC5 + packednormal.x *= packednormal.w; + #endif + half3 normal; + normal.xy = (packednormal.xy * 2 - 1) * scale; + normal.z = sqrt(1 - saturate(dot(normal.xy, normal.xy))); + return normal; + } + + #endif + + + void GetSun(out float3 lightDir, out float3 color) + { + lightDir = float3(0.5, 0.5, 0); + color = 1; + #if _HDRP + if (_DirectionalLightCount > 0) + { + DirectionalLightData light = _DirectionalLightDatas[0]; + lightDir = -light.forward.xyz; + color = light.color; + } + #elif _STANDARD + lightDir = normalize(_WorldSpaceLightPos0.xyz); + color = _LightColor0.rgb; + #elif _URP + Light light = GetMainLight(); + lightDir = light.direction; + color = light.color; + #endif + } + + + + + + + + + + TEXTURE2D(_MainTex); + SAMPLER(sampler_MainTex); + + #if GLOW_ON + TEXTURE2D(_GlowTex); + SAMPLER(sampler_GlowTex); + #endif + + #if FADE_ON + TEXTURE2D(_FadeTex); + SAMPLER(sampler_FadeTex); + + TEXTURE2D(_FadeBurnTex); + SAMPLER(sampler_FadeBurnTex); + #endif + + #if DISTORT_ON + TEXTURE2D(_DistortTex); + SAMPLER(sampler_DistortTex); + #endif + + #if OUTTEX_ON + TEXTURE2D(_OutlineTex); + SAMPLER(sampler_OutlineTex); + #endif + + #if OUTDIST_ON + TEXTURE2D(_OutlineDistortTex); + SAMPLER(sampler_OutlineDistortTex); + #endif + + #if COLORSWAP_ON + TEXTURE2D(_ColorSwapTex); + SAMPLER(sampler_ColorSwapTex); + #endif + + #if COLORRAMP_ON + TEXTURE2D(_ColorRampTex); + TEXTURE2D(_ColorRampTexGradient); + SAMPLER(sampler_ColorRampTex); + SAMPLER(sampler_ColorRampTexGradient); + #endif + + #if SHINE_ON + TEXTURE2D(_ShineMask); + SAMPLER(sampler_ShineMask); + #endif + + #if OVERLAY_ON + TEXTURE2D(_OverlayTex); + SAMPLER(sampler_OverlayTex); + #endif + + #if NORMALMAP_ON + TEXTURE2D(_NormalMap); + SAMPLER(sampler_NormalMap); + #endif + + + half3 GetPixel(in int offsetX, in int offsetY, in half2 uv, in Texture2D _tex, in SamplerState _sampler) + { + half2 _uv = uv + half2(offsetX * _MainTex_TexelSize.x, offsetY * _MainTex_TexelSize.y); + half4 col = SAMPLE_TEXTURE2D(_tex, _sampler, _uv); + return col.rgb; + } + + + //BLURS------------------------------------------------------------------------- + half4 Blur(half2 uv, Texture2D source, SamplerState sampler_source, half Intensity) + { + const half2 texelSize = 1.0 / _ScreenParams.xy; + const half4 color = SAMPLE_TEXTURE2D(source, sampler_source, uv); + const half2 offset = Intensity * texelSize; + + half4 accumulatedColor = color; + half accumulatedWeight = 1.0; + for (int x = -1; x <= 1; x++) + { + for (int y = -1; y <= 1; y++) + { + const half2 sampleUV = uv + half2(x, y) * offset; + const half4 sampleColor = SAMPLE_TEXTURE2D(source, sampler_source, sampleUV); + + accumulatedColor += sampleColor; + accumulatedWeight += 1.0; + } + } + + half4 blurredColor = accumulatedColor / accumulatedWeight; + return blurredColor; + } + + half BlurHD_G(half bhqp, half x) + { + return exp(-(x * x) / (2.0 * bhqp * bhqp)); + } + half4 BlurHD(half2 uv, Texture2D source, SamplerState sampler_source, half BlurAmount, half xScale, half yScale) + { + int iterations = 16; + int halfIterations = iterations / 2; + half sigmaX = 0.1 + BlurAmount * 0.5; + half sigmaY = sigmaX; + half total = 0.0; + half4 ret = half4(0, 0, 0, 0); + for (int iy = 0; iy < iterations; ++iy) + { + half fy = BlurHD_G(sigmaY, half(iy) -half(halfIterations)); + half offsetY = half(iy - halfIterations) * 0.00390625 * xScale; + for (int ix = 0; ix < iterations; ++ix) + { + half fx = BlurHD_G(sigmaX, half(ix) - half(halfIterations)); + half offsetX = half(ix - halfIterations) * 0.00390625 * yScale; + total += fx * fy; + ret += SAMPLE_TEXTURE2D(source, sampler_source, uv + half2(offsetX, offsetY)) * fx * fy; + } + } + return ret / total; + } + //----------------------------------------------------------------------- + + + //------------------------------------------- + half RemapFloat(half inValue, half inMin, half inMax, half outMin, half outMax){ + return outMin + (inValue - inMin) * (outMax - outMin) / (inMax - inMin); + } + //------------------------------------------- + + //----------------------------------------------------------------------- + half rand(half2 seed, half offset) { + return (frac(sin(dot(seed, half2(12.9898, 78.233))) * 43758.5453) + offset) % 1.0; + } + + half rand2(half2 seed, half offset) { + return (frac(sin(dot(seed * floor(50 + (_Time.x % 1.0) * 12.), half2(127.1, 311.7))) * 43758.5453123) + offset) % 1.0; + } + + half rand2CustomTime(half2 seed, half offset, half customTime) { + return (frac(sin(dot(seed * floor(50 + (customTime % 1.0) * 12.), half2(127.1, 311.7))) * 43758.5453123) + offset) % 1.0; + } + //----------------------------------------------------------------------- + + + void Ext_ModifyVertex0 (inout VertexData v, inout ExtraV2F d) + { + //BILBOARD_ON + #if BILBOARD_ON + half3 camRight = mul((half3x3)unity_CameraToWorld, half3(1,0,0)); + half3 camUp = half3(0,1,0); + #if BILBOARDY_ON + camUp = mul((half3x3)unity_CameraToWorld, half3(0,1,0)); + #endif + half3 localPos = v.vertex.x * camRight + v.vertex.y * camUp; + v.vertex = half4(localPos, 1); + #endif + //----------------------------------------------------------- + + v.texcoord0.xy = TRANSFORM_TEX(v.texcoord0.xy, _MainTex); + half2 center = half2(0.5, 0.5); + #if ATLAS_ON + center = half2((_MaxXUV + _MinXUV) / 2.0, (_MaxYUV + _MinYUV) / 2.0); + #endif + + //POLARUV_ON + #if POLARUV_ON + v.texcoord0.xy = v.texcoord0.xy - center; + #endif + + //---------------------------------------- + + //ROTATEUV_ON + #if ROTATEUV_ON + half2 uvC = v.texcoord0.xy; + half cosAngle = cos(_RotateUvAmount); + half sinAngle = sin(_RotateUvAmount); + half2x2 rot = half2x2(cosAngle, -sinAngle, sinAngle, cosAngle); + uvC -= center; + v.texcoord0.xy = mul(rot, uvC); + v.texcoord0.xy += center; + #endif + //-------------------- + + #if RECTSIZE_ON + v.vertex.xyz += (v.vertex.xyz * (_RectSize - 1.0)); + #endif + + #if OUTTEX_ON + v.texcoord1.xy = TRANSFORM_TEX(v.texcoord0.xy, _OutlineTex); + #endif + + #if OUTDIST_ON + v.texcoord2.xy = TRANSFORM_TEX(v.texcoord0.xy, _OutlineDistortTex); + #endif + + #if DISTORT_ON + v.texcoord3.xy = TRANSFORM_TEX(v.texcoord0.xy, _DistortTex); + #endif + } + + void Ext_SurfaceFunction0 (inout Surface o, ShaderData d) + { + half randomSeed = _RandomSeed; + + float2 uvRect = d.texcoord0; + half2 center = half2(0.5, 0.5); + #if ATLAS_ON + center = half2((_MaxXUV + _MinXUV) / 2.0, (_MaxYUV + _MinYUV) / 2.0); + uvRect = half2((d.texcoord0.x - _MinXUV) / (_MaxXUV - _MinXUV), (d.texcoord0.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half2 centerTiled = half2(center.x * _MainTex_ST.x, center.y * _MainTex_ST.y); + + //CLIPPING_ON + #if CLIPPING_ON + half2 tiledUv = half2(d.texcoord0.x / _MainTex_ST.x, d.texcoord0.y / _MainTex_ST.y); + #if ATLAS_ON + tiledUv = half2((tiledUv.x - _MinXUV) / (_MaxXUV - _MinXUV), (tiledUv.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + clip((1 - _ClipUvUp) - tiledUv.y); + clip(tiledUv.y - _ClipUvDown); + clip((1 - _ClipUvRight) - tiledUv.x); + clip(tiledUv.x - _ClipUvLeft); + #endif + //---------------------------------- + + //RADIALCLIPPING_ON + #if RADIALCLIPPING_ON + half2 tiledUv2 = half2(d.texcoord0.x / _MainTex_ST.x, d.texcoord0.y / _MainTex_ST.y); + #if ATLAS_ON + tiledUv2 = half2((tiledUv2.x - _MinXUV) / (_MaxXUV - _MinXUV), (tiledUv2.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half startAngle = _RadialStartAngle - _RadialClip; + half endAngle = _RadialStartAngle + _RadialClip2; + half offset0 = clamp(0, 360, startAngle + 360); + half offset360 = clamp(0, 360, endAngle - 360); + half2 atan2Coord = half2(lerp(-1, 1, tiledUv2.x), lerp(-1, 1, tiledUv2.y)); + half atanAngle = atan2(atan2Coord.y, atan2Coord.x) * 57.3; // angle in degrees + if(atanAngle < 0) atanAngle = 360 + atanAngle; + if(atanAngle >= startAngle && atanAngle <= endAngle) discard; + if(atanAngle <= offset360) discard; + if(atanAngle >= offset0) discard; + #endif + + //----------------------------- + + //TEXTURESCROLL_ON && ATLAS_ON + #if TEXTURESCROLL_ON && ATLAS_ON + d.texcoord0.xy = half2(_MinXUV + ((_MaxXUV - _MinXUV) * (abs(((_Time.y + randomSeed) * _TextureScrollXSpeed) + uvRect.x) % 1)), + _MinYUV + ((_MaxYUV - _MinYUV) * (abs(((_Time.y + randomSeed) * _TextureScrollYSpeed) + uvRect.y) % 1))); + #endif + //---------------------------- + + //OFFSETUV_ON + #if OFFSETUV_ON + #if ATLAS_ON + d.texcoord0.xy = half2(_MinXUV + ((_MaxXUV - _MinXUV) * (abs((_OffsetUvX + uvRect.x) % 1))), + _MinYUV + ((_MaxYUV - _MinYUV) * (abs(_OffsetUvY + uvRect.y) % 1))); + #else + d.texcoord0.xy += half2(_OffsetUvX, _OffsetUvY); + #endif + #endif + + //---------------------- + + //POLARUV_ON + #if POLARUV_ON + d.texcoord0.xy = half2(atan2(d.texcoord0.y, d.texcoord0.x) / (2.0f * 3.141592653589f), length(d.texcoord0.xy)); + d.texcoord0.xy *= _MainTex_ST.xy; + #endif + + //-------------------------------------- + + //TWISTUV_ON + #if TWISTUV_ON + #if ATLAS_ON + _TwistUvPosX = ((_MaxXUV - _MinXUV) * _TwistUvPosX) + _MinXUV; + _TwistUvPosY = ((_MaxYUV - _MinYUV) * _TwistUvPosY) + _MinYUV; + #endif + half2 tempUv = d.texcoord0.xy - half2(_TwistUvPosX * _MainTex_ST.x, _TwistUvPosY * _MainTex_ST.y); + _TwistUvRadius *= (_MainTex_ST.x + _MainTex_ST.y) / 2; + half percent = (_TwistUvRadius - length(tempUv)) / _TwistUvRadius; + half theta = percent * percent * (2.0 * sin(_TwistUvAmount)) * 8.0; + half s = sin(theta); + half c = cos(theta); + half beta = max(sign(_TwistUvRadius - length(tempUv)), 0.0); + tempUv = half2(dot(tempUv, half2(c, -s)), dot(tempUv, half2(s, c))) * beta + tempUv * (1 - beta); + tempUv += half2(_TwistUvPosX * _MainTex_ST.x, _TwistUvPosY * _MainTex_ST.y); + d.texcoord0.xy = tempUv; + #endif + + //-------------------------------------------- + + //FISHEYE_ON + #if FISHEYE_ON + half bind = length(centerTiled); + half2 dF = d.texcoord0.xy - centerTiled; + half dFlen = length(dF); + half fishInt = (3.14159265359 / bind) * (_FishEyeUvAmount + 0.001); + d.texcoord0.xy = centerTiled + (dF / (max(0.0001, dFlen))) * tan(dFlen * fishInt) * bind / tan(bind * fishInt); + #endif + //--------------------------------------------- + + //PINCH_ON + #if PINCH_ON + half2 dP = d.texcoord0.xy - centerTiled; + half pinchInt = (3.141592 / length(centerTiled)) * (-_PinchUvAmount + 0.001); + d.texcoord0.xy = centerTiled + normalize(dP) * atan(length(dP) * -pinchInt * 10.0) * 0.5 / atan(-pinchInt * 5); + #endif + + //--------------------------------------------- + + //ZOOMUV_ON + #if ZOOMUV_ON + d.texcoord0.xy -= centerTiled; + d.texcoord0.xy = d.texcoord0.xy * _ZoomUvAmount; + d.texcoord0.xy += centerTiled; + #endif + + //----------------------------------------------- + + //DOODLE_ON + #if DOODLE_ON + half2 uvCopy = uvRect; + _HandDrawnSpeed = (floor((_Time.x + randomSeed) * 20 * _HandDrawnSpeed) / _HandDrawnSpeed) * _HandDrawnSpeed; + uvCopy.x = sin((uvCopy.x * _HandDrawnAmount + _HandDrawnSpeed) * 4); + uvCopy.y = cos((uvCopy.y * _HandDrawnAmount + _HandDrawnSpeed) * 4); + d.texcoord0.xy = lerp(d.texcoord0.xy, d.texcoord0.xy + uvCopy, 0.0005 * _HandDrawnAmount); + #endif + + //-------------------------- + + //SHAKEUV_ON + #if SHAKEUV_ON + half xShake = sin((_Time.x + randomSeed) * _ShakeUvSpeed * 50) * _ShakeUvX; + half yShake = cos((_Time.x + randomSeed) * _ShakeUvSpeed * 50) * _ShakeUvY; + d.texcoord0.xy += half2(xShake * 0.012, yShake * 0.01); + #endif + + //------------------------------------------- + + //RECTSIZE_ON + #if RECTSIZE_ON + d.texcoord0.xy = d.texcoord0.xy * (_RectSize).xx + (((-_RectSize * 0.5) + 0.5)).xx; + #endif + + //------------------------------------------- + + //DISTORT_ON + #if DISTORT_ON + #if ATLAS_ON + d.texcoord3.x = d.texcoord3.x * (1 / (_MaxXUV - _MinXUV)); + d.texcoord3.y = d.texcoord3.y * (1 / (_MaxYUV - _MinYUV)); + #endif + + d.texcoord3.x += ((_Time.x + _RandomSeed) * _DistortTexXSpeed) % 1; + d.texcoord3.y += ((_Time.x + _RandomSeed) * _DistortTexYSpeed) % 1; + half distortAmnt = (SAMPLE_TEXTURE2D(_DistortTex, sampler_DistortTex, d.texcoord3.xy).r - 0.5) * 0.2 * _DistortAmount; + d.texcoord0.x += distortAmnt; + d.texcoord0.y += distortAmnt; + #endif + //------------------------------------------------------- + + //WARP_ON + #if WARP_ON + half2 warpUv = half2(d.texcoord0.x / _MainTex_ST.x, d.texcoord0.y / _MainTex_ST.y); + #if ATLAS_ON + warpUv = half2((warpUv.x - _MinXUV) / (_MaxXUV - _MinXUV), (warpUv.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + const float tau = 6.283185307179586; + float xWarp = (_Time.y + randomSeed) * _WarpSpeed + warpUv.x * tau / _WarpScale; + float yWarp = (_Time.y + randomSeed) * _WarpSpeed + warpUv.y * tau / _WarpScale; + float2 warp = float2(sin(xWarp), sin(yWarp)) * _WarpStrength; + d.texcoord0.xy += warp; + #endif + + //------------------------------------------------------- + + //WAVEUV_ON + #if WAVEUV_ON + float2 uvWave = half2(_WaveX * _MainTex_ST.x, _WaveY * _MainTex_ST.y) - d.texcoord0.xy; + uvWave %= 1; + #if ATLAS_ON + uvWave = half2(_WaveX, _WaveY) - uvRect; + #endif + uvWave.x *= _ScreenParams.x / _ScreenParams.y; + float waveTime = _Time.y + randomSeed; + float angWave = (sqrt(dot(uvWave, uvWave)) * _WaveAmount) - ((waveTime * _WaveSpeed)); + d.texcoord0.xy = d.texcoord0.xy + uvWave * sin(angWave) * (_WaveStrength / 1000.0); + #endif + //---------------------------------------------------- + + //ROUNDWAVEUV_ON + #if ROUNDWAVEUV_ON + half xWave = ((0.5 * _MainTex_ST.x) - uvRect.x); + half yWave = ((0.5 * _MainTex_ST.y) - uvRect.y) * (_MainTex_TexelSize.w / _MainTex_TexelSize.z); + half ripple = -sqrt(xWave*xWave + yWave* yWave); + d.texcoord0.xy += (sin((ripple + (_Time.y + randomSeed) * (_RoundWaveSpeed/10.0)) / 0.015) * (_RoundWaveStrength/10.0)) % 1; + #endif + //---------------------------------------------------- + + + //WIND_ON + #if WIND_ON + half windOffset = sin((_Time.x + randomSeed) * _GrassSpeed * 10); + half2 windCenter = half2(0.5, 0.1); + #if ATLAS_ON + windCenter.x = ((_MaxXUV - _MinXUV) * windCenter.x) + _MinXUV; + windCenter.y = ((_MaxYUV - _MinYUV) * windCenter.y) + _MinYUV; + #endif + #if !MANUALWIND_ON + d.texcoord0.x = fmod(abs(lerp(d.texcoord0.x, d.texcoord0.x + (_GrassWind * 0.01 * windOffset), uvRect.y)), 1); + #else + d.texcoord0.x = fmod(abs(lerp(d.texcoord0.x, d.texcoord0.x + (_GrassWind * 0.01 * _GrassManualAnim), uvRect.y)), 1); + windOffset = _GrassManualAnim; + #endif + half2 delta = d.texcoord0.xy - windCenter; + half delta2 = dot(delta.xy, delta.xy); + half2 delta_offset = delta2 * windOffset; + d.texcoord0.xy = d.texcoord0.xy + half2(delta.y, -delta.x) * delta_offset * _GrassRadialBend; + #endif + + //-------------------------------------------------------- + + //TEXTURESCROLL_ON && !ATLAS_ON + #if TEXTURESCROLL_ON && !ATLAS_ON + d.texcoord0.x += ((_Time.y + randomSeed) * _TextureScrollXSpeed) % 1; + d.texcoord0.y += ((_Time.y + randomSeed) * _TextureScrollYSpeed) % 1; + #endif + //------------------------------ + + //PIXELATE_ON + #if PIXELATE_ON + half aspectRatio = _MainTex_TexelSize.x / _MainTex_TexelSize.y; + half2 pixelSize = float2(_PixelateSize, _PixelateSize * aspectRatio); + d.texcoord0.xy = floor(d.texcoord0.xy * pixelSize) / pixelSize; + #endif + //-------------- + + half4 col = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy); + half originalAlpha = col.a; + col *= d.vertexColor; + + //NORMAL MAP + #if NORMALMAP_ON + half4 normalSample = SAMPLE_TEXTURE2D(_NormalMap, sampler_NormalMap, d.texcoord0.xy); + half3 normalTS = UnpackNormal(normalSample); + normalTS.xy *= _NormalStrength; + o.Normal = normalTS; + #endif + + + //GLITCH_ON + #if GLITCH_ON + half2 uvGlitch = uvRect; + uvGlitch.y -= 0.5; + half lineNoise = pow(rand2(floor(uvGlitch * half2(24., 19.) * _GlitchSize) * 4.0, randomSeed), 3.0) * _GlitchAmount + * pow(rand2(floor(uvGlitch * half2(38., 14.) * _GlitchSize) * 4.0, randomSeed), 3.0); + col = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(lineNoise * 0.02 * rand2(half2(2.0, 1), randomSeed), 0)) * d.vertexColor; + #endif + //-------------------------------------- + + //CHROMABERR_ON + #if CHROMABERR_ON + half4 r = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(_ChromAberrAmount/10, 0)) * d.vertexColor; + half4 b = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(-_ChromAberrAmount/10, 0)) * d.vertexColor; + col = half4(r.r * r.a, col.g, b.b * b.a, max(max(r.a, b.a) * _ChromAberrAlpha, col.a)); + #endif + + //-------------------------------- + + //BLUR_ON + #if BLUR_ON + #if ATLAS_ON + #if !BLURISHD_ON + col = BlurHD(d.texcoord0.xy, _MainTex, sampler_MainTex, _BlurIntensity, (_MaxXUV - _MinXUV), (_MaxYUV - _MinYUV)) * d.vertexColor; + #else + col = Blur(d.texcoord0.xy, _MainTex, sampler_MainTex, _BlurIntensity * (_MaxXUV - _MinXUV)) * d.vertexColor; + #endif + #else + #if !BLURISHD_ON + col = BlurHD(d.texcoord0.xy, _MainTex, sampler_MainTex, _BlurIntensity, 1, 1) * d.vertexColor; + #else + col = Blur(d.texcoord0.xy, _MainTex, sampler_MainTex, _BlurIntensity) * d.vertexColor; + #endif + #endif + #endif + + //-------------------- + + //MOTIONBLUR_ON + #if MOTIONBLUR_ON + _MotionBlurAngle = _MotionBlurAngle * 3.1415926; + #define rot(n) mul(n, half2x2(cos(_MotionBlurAngle), -sin(_MotionBlurAngle), sin(_MotionBlurAngle), cos(_MotionBlurAngle))) + _MotionBlurDist = _MotionBlurDist * 0.005; + #if ATLAS_ON + _MotionBlurDist *= (_MaxXUV - _MinXUV); + #endif + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(-_MotionBlurDist, -_MotionBlurDist))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(-_MotionBlurDist * 2, -_MotionBlurDist * 2))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(-_MotionBlurDist * 3, -_MotionBlurDist * 3))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(-_MotionBlurDist * 4, -_MotionBlurDist * 4))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(_MotionBlurDist, _MotionBlurDist))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(_MotionBlurDist * 2, _MotionBlurDist * 2))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(_MotionBlurDist * 3, _MotionBlurDist * 3))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(_MotionBlurDist * 4, _MotionBlurDist * 4))); + col.rgb = col.rgb / 9; + #endif + //------------------------------------ + + //NEGATIVE_ON + #if NEGATIVE_ON + col.rgb = lerp(col.rgb, 1 - col.rgb, _NegativeAmount); + #endif + + //-------------- + half luminance = 0; + + //GREYSCALE_ON && !GREYSCALEOUTLINE_ON + #if GREYSCALE_ON && !GREYSCALEOUTLINE_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + luminance = saturate(luminance + _GreyscaleLuminosity); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _GreyscaleTintColor, _GreyscaleBlend); + #endif + //------------------------------------ + + //GHOST_ON + #if GHOST_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + half4 ghostResult; + ghostResult.a = saturate(luminance - _GhostTransparency) * col.a; + ghostResult.rgb = col.rgb * (luminance + _GhostColorBoost); + col = lerp(col, ghostResult, _GhostBlend); + #endif + //------------------------------------ + + //INNEROUTLINE_ON + #if INNEROUTLINE_ON + half3 innerT = abs(GetPixel(0, _InnerOutlineThickness, d.texcoord0.xy, _MainTex, sampler_MainTex) - GetPixel(0, -_InnerOutlineThickness, d.texcoord0.xy, _MainTex, sampler_MainTex)); + innerT += abs(GetPixel(_InnerOutlineThickness, 0, d.texcoord0.xy, _MainTex, sampler_MainTex) - GetPixel(-_InnerOutlineThickness, 0, d.texcoord0.xy, _MainTex, sampler_MainTex)); + #if !ONLYINNEROUTLINE_ON + innerT = (innerT / 2.0) * col.a * _InnerOutlineAlpha; + col.rgb += length(innerT) * _InnerOutlineColor.rgb * _InnerOutlineGlow; + #else + innerT *= col.a * _InnerOutlineAlpha; + col.rgb = length(innerT) * _InnerOutlineColor.rgb * _InnerOutlineGlow; + col.a = step(0.3, col.r+col.g+col.b); + #endif + #endif + //------------------------------------------------------- + + //HITEFFECT_ON + #if HITEFFECT_ON + col.rgb = lerp(col.rgb, _HitEffectColor.rgb * _HitEffectGlow, _HitEffectBlend); + #endif + //-------------------- + + //GRADIENT_ON + #if GRADIENT_ON + half2 tiledUvGrad = half2(uvRect.x / _MainTex_ST.x, uvRect.y / _MainTex_ST.y); + #if GRADIENT2COL_ON + _GradTopRightCol = _GradTopLeftCol; + _GradBotRightCol = _GradBotLeftCol; + #endif + #if RADIALGRADIENT_ON + half radialDist = 1 - length(tiledUvGrad - half2(0.5, 0.5)); + radialDist *= (_MainTex_TexelSize.w / _MainTex_TexelSize.z); + radialDist = saturate(_GradBoostX * radialDist); + half4 gradientResult = lerp(_GradTopLeftCol, _GradBotLeftCol, radialDist); + #else + half gradXLerpFactor = saturate(pow(tiledUvGrad.x, _GradBoostX)); + half4 gradientResult = lerp(lerp(_GradBotLeftCol, _GradBotRightCol, gradXLerpFactor), + lerp(_GradTopLeftCol, _GradTopRightCol, gradXLerpFactor), saturate(pow(tiledUvGrad.y, _GradBoostY))); + #endif + gradientResult = lerp(col, gradientResult, _GradBlend); + col.rgb = gradientResult.rgb * col.a; + col.a *= gradientResult.a; + #endif + //-------------------------------------------------------------------- + + //CONTRAST_ON + #if CONTRAST_ON + col.rgb = (col.rgb - float3(0.5, 0.5, 0.5)) * _Contrast + float3(0.5, 0.5, 0.5); + col.rgb += _Brightness; + #endif + + //------------------------------------------------------------------- + + //COLORSWAP_ON + #if COLORSWAP_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + half4 swapMask = SAMPLE_TEXTURE2D(_ColorSwapTex, sampler_ColorSwapTex, d.texcoord0.xy); + swapMask.rgb *= swapMask.a; + half3 redSwap = _ColorSwapRed * swapMask.r * saturate(luminance + _ColorSwapRedLuminosity); + half3 greenSwap = _ColorSwapGreen * swapMask.g * saturate(luminance + _ColorSwapGreenLuminosity); + half3 blueSwap = _ColorSwapBlue * swapMask.b * saturate(luminance + _ColorSwapBlueLuminosity); + swapMask.rgb = col.rgb * saturate(1 - swapMask.r - swapMask.g - swapMask.b); + col.rgb = lerp(col.rgb, swapMask.rgb + redSwap + greenSwap + blueSwap, _ColorSwapBlend); + #endif + //-------------------------------------------------------------------- + + //COLORRAMP_ON && !COLORRAMPOUTLINE_ON + #if COLORRAMP_ON && !COLORRAMPOUTLINE_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + luminance = saturate(luminance + _ColorRampLuminosity); + #if GRADIENTCOLORRAMP_ON + col.rgb = lerp(col.rgb, SAMPLE_TEXTURE2D(_ColorRampTexGradient, sampler_ColorRampTexGradient, half2(luminance, 0)).rgb, _ColorRampBlend); + #else + col.rgb = lerp(col.rgb, SAMPLE_TEXTURE2D(_ColorRampTex, sampler_ColorRampTex, half2(luminance, 0)).rgb, _ColorRampBlend); + #endif + #endif + //-------------------------------------------------------------------- + + //CHANGECOLOR_ON + #if CHANGECOLOR_ON + float3 currChangeColor = saturate(col.rgb); + luminance = 0.3 * currChangeColor.r + 0.59 * currChangeColor.g + 0.11 * currChangeColor.b; + luminance = saturate(luminance + _ColorChangeLuminosity); + half3 dif = abs(currChangeColor - _ColorChangeTarget.rgb); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _ColorChangeNewCol.rgb, + max(sign(1 - saturate(dif.x + dif.y + dif.z) - _ColorChangeTolerance), 0.0)); + #if CHANGECOLOR2_ON + dif = abs(currChangeColor - _ColorChangeTarget2.rgb); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _ColorChangeNewCol2.rgb, + max(sign(1 - saturate(dif.x + dif.y + dif.z) - _ColorChangeTolerance2), 0.0)); + #endif + #if CHANGECOLOR3_ON + dif = abs(currChangeColor - _ColorChangeTarget3.rgb); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _ColorChangeNewCol3.rgb, + max(sign(1 - saturate(dif.x + dif.y + dif.z) - _ColorChangeTolerance3), 0.0)); + #endif + #endif + //------------------------------------------------------- + + //POSTERIZE_ON && !POSTERIZEOUTLINE_ON + #if POSTERIZE_ON && !POSTERIZEOUTLINE_ON + col.rgb = pow(col.rgb, _PosterizeGamma) * _PosterizeNumColors; + col.rgb = floor(col.rgb) / _PosterizeNumColors; + col.rgb = pow(col.rgb, 1.0 / _PosterizeGamma); + #endif + //------------------------------------ + + //HSV_ON + #if HSV_ON + half3 resultHsv = half3(col.rgb); + half cosHsv = _HsvBright * _HsvSaturation * cos(_HsvShift * 3.14159265 / 180); + half sinHsv = _HsvBright * _HsvSaturation * sin(_HsvShift * 3.14159265 / 180); + resultHsv.x = (.299 * _HsvBright + .701 * cosHsv + .168 * sinHsv) * col.x + + (.587 * _HsvBright - .587 * cosHsv + .330 * sinHsv) * col.y + + (.114 * _HsvBright - .114 * cosHsv - .497 * sinHsv) * col.z; + resultHsv.y = (.299 * _HsvBright - .299 * cosHsv - .328 * sinHsv) *col.x + + (.587 * _HsvBright + .413 * cosHsv + .035 * sinHsv) * col.y + + (.114 * _HsvBright - .114 * cosHsv + .292 * sinHsv) * col.z; + resultHsv.z = (.299 * _HsvBright - .3 * cosHsv + 1.25 * sinHsv) * col.x + + (.587 * _HsvBright - .588 * cosHsv - 1.05 * sinHsv) * col.y + + (.114 * _HsvBright + .886 * cosHsv - .203 * sinHsv) * col.z; + col.rgb = resultHsv; + #endif + //------------------------------------------------------- + + //OVERLAY_ON + #if OVERLAY_ON + half2 overlayUvs = d.texcoord0.xy; + overlayUvs.x += ((_Time.y + randomSeed) * _OverlayTextureScrollXSpeed) % 1; + overlayUvs.y += ((_Time.y + randomSeed) * _OverlayTextureScrollYSpeed) % 1; + half4 overlayCol = SAMPLE_TEXTURE2D(_OverlayTex, sampler_OverlayTex, TRANSFORM_TEX(overlayUvs, _OverlayTex)); + overlayCol.rgb *= _OverlayColor.rgb * _OverlayGlow; + #if !OVERLAYMULT_ON + overlayCol.rgb *= overlayCol.a * _OverlayColor.rgb * _OverlayColor.a * _OverlayBlend; + col.rgb += overlayCol.rgb; + #else + overlayCol.a *= _OverlayColor.a; + col = lerp(col, col * overlayCol, _OverlayBlend); + #endif + #endif + + //--------------------------------- + + //OUTBASE_ON + #if OUTBASE_ON + #if OUTBASEPIXELPERF_ON + half2 destUv = half2(_OutlinePixelWidth * _MainTex_TexelSize.x, _OutlinePixelWidth * _MainTex_TexelSize.y); + #else + half2 destUv = half2(_OutlineWidth * _MainTex_TexelSize.x * 200, _OutlineWidth * _MainTex_TexelSize.y * 200); + #endif + + #if OUTDIST_ON + d.texcoord3.x += ((_Time.x + _RandomSeed) * _OutlineDistortTexXSpeed) % 1; + d.texcoord3.y += ((_Time.x + _RandomSeed) * _OutlineDistortTexYSpeed) % 1; + #if ATLAS_ON + d.texcoord3 = half2((d.texcoord3.x - _MinXUV) / (_MaxXUV - _MinXUV), (d.texcoord3.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half outDistortAmnt = (SAMPLE_TEXTURE2D(_OutlineDistortTex, sampler_OutlineDistortTex, d.texcoord3).r - 0.5) * 0.2 * _OutlineDistortAmount; + destUv.x += outDistortAmnt; + destUv.y += outDistortAmnt; + #endif + + half spriteLeft = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(destUv.x, 0)).a; + half spriteRight = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy - half2(destUv.x, 0)).a; + half spriteBottom = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(0, destUv.y)).a; + half spriteTop = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy - half2(0, destUv.y)).a; + half result = spriteLeft + spriteRight + spriteBottom + spriteTop; + + #if OUTBASE8DIR_ON + half spriteTopLeft = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(destUv.x, destUv.y)).a; + half spriteTopRight = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(-destUv.x, destUv.y)).a; + half spriteBotLeft = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(destUv.x, -destUv.y)).a; + half spriteBotRight = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(-destUv.x, -destUv.y)).a; + result = result + spriteTopLeft + spriteTopRight + spriteBotLeft + spriteBotRight; + #endif + + result = step(0.05, saturate(result)); + + #if OUTTEX_ON + d.texcoord1.x += ((_Time.x + _RandomSeed) * _OutlineTexXSpeed) % 1; + d.texcoord1.y += ((_Time.x + _RandomSeed) * _OutlineTexYSpeed) % 1; + #if ATLAS_ON + d.texcoord1 = half2((d.texcoord1.x - _MinXUV) / (_MaxXUV - _MinXUV), (d.texcoord1.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half4 tempOutColor = SAMPLE_TEXTURE2D(_OutlineTex, sampler_OutlineTex, d.texcoord1); + tempOutColor *= _OutlineColor; + _OutlineColor = tempOutColor; + #endif + + result *= (1 - originalAlpha) * _OutlineAlpha; + + half4 outline = _OutlineColor * d.vertexColor.a; + outline.rgb *= _OutlineGlow; + outline.a = result; + #if ONLYOUTLINE_ON + col = outline; + #else + col = lerp(col, outline, result); + #endif + #endif + //------------------------------------------------------- + + //FADE_ON + #if FADE_ON + half2 tiledUvFade1 = TRANSFORM_TEX(d.texcoord0, _FadeTex); + half2 tiledUvFade2 = TRANSFORM_TEX(d.texcoord0, _FadeBurnTex); + #if ATLAS_ON + tiledUvFade1 = half2((tiledUvFade1.x - _MinXUV) / (_MaxXUV - _MinXUV), (tiledUvFade1.y - _MinYUV) / (_MaxYUV - _MinYUV)); + tiledUvFade2 = half2((tiledUvFade2.x - _MinXUV) / (_MaxXUV - _MinXUV), (tiledUvFade2.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half fadeTemp = SAMPLE_TEXTURE2D(_FadeTex, sampler_FadeTex, tiledUvFade1).r; + half fade = smoothstep(_FadeAmount, _FadeAmount + _FadeBurnTransition, fadeTemp); + half fadeBurn = saturate(smoothstep(_FadeAmount - _FadeBurnWidth, _FadeAmount - _FadeBurnWidth + 0.1, fadeTemp) * _FadeAmount); + col.a *= fade; + _FadeBurnColor.rgb *= _FadeBurnGlow; + col += fadeBurn * SAMPLE_TEXTURE2D(_FadeBurnTex, sampler_FadeBurnTex, tiledUvFade2) * _FadeBurnColor * originalAlpha * (1 - col.a); + #endif + //------------------------------------------------------- + + //SHADOW_ON + #if SHADOW_ON + half shadowA = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(_ShadowX, _ShadowY)).a; + half preMultShadowMask = 1 - (saturate(shadowA - col.a) * (1 - col.a)); + col.rgb *= 1 - ((shadowA - col.a) * (1 - col.a)); + col.rgb += (_ShadowColor * shadowA) * (1 - col.a); + col.a = max(shadowA * _ShadowAlpha * d.vertexColor.a, col.a); + #endif + + //------------------------------------------------------- + + //GLOW_ON + #if GLOW_ON + half4 emission; + #if GLOWTEX_ON + emission = SAMPLE_TEXTURE2D(_GlowTex, sampler_GlowTex, d.texcoord0); + #else + emission = col; + #endif + + col.rgb *= _GlowGlobal; + emission.rgb *= emission.a * col.a * _Glow * _GlowColor; + col.rgb += emission.rgb; + #endif + //------------------------------------------------------- + + //COLORRAMP_ON && COLORRAMPOUTLINE_ON + #if COLORRAMP_ON && COLORRAMPOUTLINE_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + luminance = saturate(luminance + _ColorRampLuminosity); + #if GRADIENTCOLORRAMP_ON + col.rgb = lerp(col.rgb, SAMPLE_TEXTURE2D(_ColorRampTexGradient, sampler_ColorRampTexGradient, half2(luminance, 0)).rgb, _ColorRampBlend); + #else + col.rgb = lerp(col.rgb, SAMPLE_TEXTURE2D(_ColorRampTex, sampler_ColorRampTex, half2(luminance, 0)).rgb, _ColorRampBlend); + #endif + #endif + //--------------- + + //GREYSCALE_ON && GREYSCALEOUTLINE_ON + #if GREYSCALE_ON && GREYSCALEOUTLINE_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + luminance = saturate(luminance + _GreyscaleLuminosity); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _GreyscaleTintColor, _GreyscaleBlend); + #endif + + //----------------------------------- + + //POSTERIZE_ON && POSTERIZEOUTLINE_ON + #if POSTERIZE_ON && POSTERIZEOUTLINE_ON + col.rgb = pow(col.rgb, _PosterizeGamma) * _PosterizeNumColors; + col.rgb = floor(col.rgb) / _PosterizeNumColors; + col.rgb = pow(col.rgb, 1.0 / _PosterizeGamma); + #endif + + //----------------------------------- + + //SHINE_ON + #if SHINE_ON + half2 uvShine = uvRect; + half cosAngle = cos(_ShineRotate); + half sinAngle = sin(_ShineRotate); + half2x2 rot = half2x2(cosAngle, -sinAngle, sinAngle, cosAngle); + uvShine -= half2(0.5, 0.5); + uvShine = mul(rot, uvShine); + uvShine += half2(0.5, 0.5); + half shineMask = SAMPLE_TEXTURE2D(_ShineMask, sampler_ShineMask, d.texcoord0.xy).a; + half currentDistanceProjection = (uvShine.x + uvShine.y) / 2; + half whitePower = 1 - (abs(currentDistanceProjection - _ShineLocation) / _ShineWidth); + col.rgb += col.a * whitePower * _ShineGlow * max(sign(currentDistanceProjection - (_ShineLocation - _ShineWidth)), 0.0) + * max(sign((_ShineLocation + _ShineWidth) - currentDistanceProjection), 0.0) * _ShineColor * shineMask; + #endif + + //----------------------------------- + + //HOLOGRAM_ON + #if HOLOGRAM_ON + half totalHologram = _HologramStripesAmount + _HologramUnmodAmount; + half hologramYCoord = ((uvRect.y + (((_Time.x + randomSeed) % 1) * _HologramStripesSpeed)) % totalHologram) / totalHologram; + hologramYCoord = abs(hologramYCoord); + half alpha = RemapFloat(saturate(hologramYCoord - (_HologramUnmodAmount/totalHologram)), 0.0, 1.0, _HologramMinAlpha, saturate(_HologramMaxAlpha)); + half hologramMask = max(sign((_HologramUnmodAmount/totalHologram) - hologramYCoord), 0.0); + half4 hologramResult = col; + hologramResult.a *= lerp(alpha, 1, hologramMask); + hologramResult.rgb *= max(1, _HologramMaxAlpha * max(sign(hologramYCoord - (_HologramUnmodAmount/totalHologram)), 0.0)); + hologramMask = 1 - step(0.01,hologramMask); + hologramResult.rgb += hologramMask * _HologramStripeColor * col.a; + col = lerp(col, hologramResult, _HologramBlend); + #endif + + //----------------------------------- + + //FLICKER_ON + #if FLICKER_ON + col.a *= saturate(col.a * step(frac(0.05 + (_Time.w + randomSeed) * _FlickerFreq), 1 - _FlickerPercent) + _FlickerAlpha); + #endif + //----------------------------------- + + //ALPHACUTOFF_ON + + //ALPHAROUND_ON + + //ALPHAOUTLINE_ON + #if ALPHAOUTLINE_ON + half alphaOutlineRes = pow(1 - col.a, max(_AlphaOutlinePower, 0.0001)) * step(_AlphaOutlineMinAlpha, col.a) * _AlphaOutlineBlend; + col.rgb = lerp(col.rgb, _AlphaOutlineColor.rgb * _AlphaOutlineGlow, alphaOutlineRes); + col.a = lerp(col.a, 1, alphaOutlineRes > 1); + #endif + //------------------------------------------------------- + + //FOG_ON + + //------------------ + + col *= _Color; + o.Albedo = col; + col.a *= _Alpha; + clip(col.a - _AlphaCutoffValue - 0.01); + o.Alpha = _Color.a; + } + + + + + + void ChainSurfaceFunction(inout Surface l, inout ShaderData d) + { + Ext_SurfaceFunction0(l, d); + // Ext_SurfaceFunction1(l, d); + // Ext_SurfaceFunction2(l, d); + // Ext_SurfaceFunction3(l, d); + // Ext_SurfaceFunction4(l, d); + // Ext_SurfaceFunction5(l, d); + // Ext_SurfaceFunction6(l, d); + // Ext_SurfaceFunction7(l, d); + // Ext_SurfaceFunction8(l, d); + // Ext_SurfaceFunction9(l, d); + // Ext_SurfaceFunction10(l, d); + // Ext_SurfaceFunction11(l, d); + // Ext_SurfaceFunction12(l, d); + // Ext_SurfaceFunction13(l, d); + // Ext_SurfaceFunction14(l, d); + // Ext_SurfaceFunction15(l, d); + // Ext_SurfaceFunction16(l, d); + // Ext_SurfaceFunction17(l, d); + // Ext_SurfaceFunction18(l, d); + // Ext_SurfaceFunction19(l, d); + // Ext_SurfaceFunction20(l, d); + // Ext_SurfaceFunction21(l, d); + // Ext_SurfaceFunction22(l, d); + // Ext_SurfaceFunction23(l, d); + // Ext_SurfaceFunction24(l, d); + // Ext_SurfaceFunction25(l, d); + // Ext_SurfaceFunction26(l, d); + // Ext_SurfaceFunction27(l, d); + // Ext_SurfaceFunction28(l, d); + // Ext_SurfaceFunction29(l, d); + } + +#if !_DECALSHADER + + void ChainModifyVertex(inout VertexData v, inout VertexToPixel v2p, float4 time) + { + ExtraV2F d; + + ZERO_INITIALIZE(ExtraV2F, d); + ZERO_INITIALIZE(Blackboard, d.blackboard); + // due to motion vectors in HDRP, we need to use the last + // time in certain spots. So if you are going to use _Time to adjust vertices, + // you need to use this time or motion vectors will break. + d.time = time; + + Ext_ModifyVertex0(v, d); + // Ext_ModifyVertex1(v, d); + // Ext_ModifyVertex2(v, d); + // Ext_ModifyVertex3(v, d); + // Ext_ModifyVertex4(v, d); + // Ext_ModifyVertex5(v, d); + // Ext_ModifyVertex6(v, d); + // Ext_ModifyVertex7(v, d); + // Ext_ModifyVertex8(v, d); + // Ext_ModifyVertex9(v, d); + // Ext_ModifyVertex10(v, d); + // Ext_ModifyVertex11(v, d); + // Ext_ModifyVertex12(v, d); + // Ext_ModifyVertex13(v, d); + // Ext_ModifyVertex14(v, d); + // Ext_ModifyVertex15(v, d); + // Ext_ModifyVertex16(v, d); + // Ext_ModifyVertex17(v, d); + // Ext_ModifyVertex18(v, d); + // Ext_ModifyVertex19(v, d); + // Ext_ModifyVertex20(v, d); + // Ext_ModifyVertex21(v, d); + // Ext_ModifyVertex22(v, d); + // Ext_ModifyVertex23(v, d); + // Ext_ModifyVertex24(v, d); + // Ext_ModifyVertex25(v, d); + // Ext_ModifyVertex26(v, d); + // Ext_ModifyVertex27(v, d); + // Ext_ModifyVertex28(v, d); + // Ext_ModifyVertex29(v, d); + + + // #if %EXTRAV2F0REQUIREKEY% + // v2p.extraV2F0 = d.extraV2F0; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // v2p.extraV2F1 = d.extraV2F1; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // v2p.extraV2F2 = d.extraV2F2; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // v2p.extraV2F3 = d.extraV2F3; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // v2p.extraV2F4 = d.extraV2F4; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // v2p.extraV2F5 = d.extraV2F5; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // v2p.extraV2F6 = d.extraV2F6; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // v2p.extraV2F7 = d.extraV2F7; + // #endif + } + + void ChainModifyTessellatedVertex(inout VertexData v, inout VertexToPixel v2p) + { + ExtraV2F d; + ZERO_INITIALIZE(ExtraV2F, d); + ZERO_INITIALIZE(Blackboard, d.blackboard); + + // #if %EXTRAV2F0REQUIREKEY% + // d.extraV2F0 = v2p.extraV2F0; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // d.extraV2F1 = v2p.extraV2F1; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // d.extraV2F2 = v2p.extraV2F2; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // d.extraV2F3 = v2p.extraV2F3; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // d.extraV2F4 = v2p.extraV2F4; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // d.extraV2F5 = v2p.extraV2F5; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // d.extraV2F6 = v2p.extraV2F6; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // d.extraV2F7 = v2p.extraV2F7; + // #endif + + + // Ext_ModifyTessellatedVertex0(v, d); + // Ext_ModifyTessellatedVertex1(v, d); + // Ext_ModifyTessellatedVertex2(v, d); + // Ext_ModifyTessellatedVertex3(v, d); + // Ext_ModifyTessellatedVertex4(v, d); + // Ext_ModifyTessellatedVertex5(v, d); + // Ext_ModifyTessellatedVertex6(v, d); + // Ext_ModifyTessellatedVertex7(v, d); + // Ext_ModifyTessellatedVertex8(v, d); + // Ext_ModifyTessellatedVertex9(v, d); + // Ext_ModifyTessellatedVertex10(v, d); + // Ext_ModifyTessellatedVertex11(v, d); + // Ext_ModifyTessellatedVertex12(v, d); + // Ext_ModifyTessellatedVertex13(v, d); + // Ext_ModifyTessellatedVertex14(v, d); + // Ext_ModifyTessellatedVertex15(v, d); + // Ext_ModifyTessellatedVertex16(v, d); + // Ext_ModifyTessellatedVertex17(v, d); + // Ext_ModifyTessellatedVertex18(v, d); + // Ext_ModifyTessellatedVertex19(v, d); + // Ext_ModifyTessellatedVertex20(v, d); + // Ext_ModifyTessellatedVertex21(v, d); + // Ext_ModifyTessellatedVertex22(v, d); + // Ext_ModifyTessellatedVertex23(v, d); + // Ext_ModifyTessellatedVertex24(v, d); + // Ext_ModifyTessellatedVertex25(v, d); + // Ext_ModifyTessellatedVertex26(v, d); + // Ext_ModifyTessellatedVertex27(v, d); + // Ext_ModifyTessellatedVertex28(v, d); + // Ext_ModifyTessellatedVertex29(v, d); + + // #if %EXTRAV2F0REQUIREKEY% + // v2p.extraV2F0 = d.extraV2F0; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // v2p.extraV2F1 = d.extraV2F1; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // v2p.extraV2F2 = d.extraV2F2; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // v2p.extraV2F3 = d.extraV2F3; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // v2p.extraV2F4 = d.extraV2F4; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // v2p.extraV2F5 = d.extraV2F5; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // v2p.extraV2F6 = d.extraV2F6; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // v2p.extraV2F7 = d.extraV2F7; + // #endif + } + + void ChainFinalColorForward(inout Surface l, inout ShaderData d, inout half4 color) + { + // Ext_FinalColorForward0(l, d, color); + // Ext_FinalColorForward1(l, d, color); + // Ext_FinalColorForward2(l, d, color); + // Ext_FinalColorForward3(l, d, color); + // Ext_FinalColorForward4(l, d, color); + // Ext_FinalColorForward5(l, d, color); + // Ext_FinalColorForward6(l, d, color); + // Ext_FinalColorForward7(l, d, color); + // Ext_FinalColorForward8(l, d, color); + // Ext_FinalColorForward9(l, d, color); + // Ext_FinalColorForward10(l, d, color); + // Ext_FinalColorForward11(l, d, color); + // Ext_FinalColorForward12(l, d, color); + // Ext_FinalColorForward13(l, d, color); + // Ext_FinalColorForward14(l, d, color); + // Ext_FinalColorForward15(l, d, color); + // Ext_FinalColorForward16(l, d, color); + // Ext_FinalColorForward17(l, d, color); + // Ext_FinalColorForward18(l, d, color); + // Ext_FinalColorForward19(l, d, color); + // Ext_FinalColorForward20(l, d, color); + // Ext_FinalColorForward21(l, d, color); + // Ext_FinalColorForward22(l, d, color); + // Ext_FinalColorForward23(l, d, color); + // Ext_FinalColorForward24(l, d, color); + // Ext_FinalColorForward25(l, d, color); + // Ext_FinalColorForward26(l, d, color); + // Ext_FinalColorForward27(l, d, color); + // Ext_FinalColorForward28(l, d, color); + // Ext_FinalColorForward29(l, d, color); + } + + void ChainFinalGBufferStandard(inout Surface s, inout ShaderData d, inout half4 GBuffer0, inout half4 GBuffer1, inout half4 GBuffer2, inout half4 outEmission, inout half4 outShadowMask) + { + // Ext_FinalGBufferStandard0(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard1(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard2(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard3(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard4(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard5(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard6(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard7(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard8(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard9(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard10(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard11(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard12(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard13(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard14(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard15(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard16(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard17(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard18(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard19(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard20(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard21(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard22(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard23(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard24(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard25(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard26(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard27(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard28(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard29(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + } +#endif + + + + + +#if _DECALSHADER + + ShaderData CreateShaderData(SurfaceDescriptionInputs IN) + { + ShaderData d = (ShaderData)0; + d.TBNMatrix = float3x3(IN.WorldSpaceTangent, IN.WorldSpaceBiTangent, IN.WorldSpaceNormal); + d.worldSpaceNormal = IN.WorldSpaceNormal; + d.worldSpaceTangent = IN.WorldSpaceTangent; + + d.worldSpacePosition = IN.WorldSpacePosition; + d.texcoord0 = IN.uv0.xyxy; + d.screenPos = IN.ScreenPosition; + + d.worldSpaceViewDir = normalize(_WorldSpaceCameraPos - d.worldSpacePosition); + + d.tangentSpaceViewDir = mul(d.TBNMatrix, d.worldSpaceViewDir); + + // these rarely get used, so we back transform them. Usually will be stripped. + #if _HDRP + // d.localSpacePosition = mul(GetWorldToObjectMatrix(), float4(GetCameraRelativePositionWS(d.worldSpacePosition), 1)).xyz; + #else + // d.localSpacePosition = mul(GetWorldToObjectMatrix(), float4(d.worldSpacePosition, 1)).xyz; + #endif + // d.localSpaceNormal = normalize(mul((float3x3)GetWorldToObjectMatrix(), d.worldSpaceNormal)); + // d.localSpaceTangent = normalize(mul((float3x3)GetWorldToObjectMatrix(), d.worldSpaceTangent.xyz)); + + // #if %SCREENPOSREQUIREKEY% + // d.screenUV = (IN.ScreenPosition.xy / max(0.01, IN.ScreenPosition.w)); + // #endif + + return d; + } +#else + + ShaderData CreateShaderData(VertexToPixel i + #if NEED_FACING + , bool facing + #endif + ) + { + ShaderData d = (ShaderData)0; + d.clipPos = i.pos; + d.worldSpacePosition = i.worldPos; + + d.worldSpaceNormal = normalize(i.worldNormal); + d.worldSpaceTangent.xyz = normalize(i.worldTangent.xyz); + + d.tangentSign = i.worldTangent.w * unity_WorldTransformParams.w; + float3 bitangent = cross(d.worldSpaceTangent.xyz, d.worldSpaceNormal) * d.tangentSign; + + d.TBNMatrix = float3x3(d.worldSpaceTangent, -bitangent, d.worldSpaceNormal); + d.worldSpaceViewDir = normalize(_WorldSpaceCameraPos - i.worldPos); + + d.tangentSpaceViewDir = mul(d.TBNMatrix, d.worldSpaceViewDir); + d.texcoord0 = i.texcoord0; + d.texcoord1 = i.texcoord1; + d.texcoord2 = i.texcoord2; + + // #if %TEXCOORD3REQUIREKEY% + d.texcoord3 = i.texcoord3; + // #endif + + // d.isFrontFace = facing; + // #if %VERTEXCOLORREQUIREKEY% + d.vertexColor = i.vertexColor; + // #endif + + // these rarely get used, so we back transform them. Usually will be stripped. + #if _HDRP + // d.localSpacePosition = mul(GetWorldToObjectMatrix(), float4(GetCameraRelativePositionWS(i.worldPos), 1)).xyz; + #else + // d.localSpacePosition = mul(GetWorldToObjectMatrix(), float4(i.worldPos, 1)).xyz; + #endif + // d.localSpaceNormal = normalize(mul((float3x3)GetWorldToObjectMatrix(), i.worldNormal)); + // d.localSpaceTangent = normalize(mul((float3x3)GetWorldToObjectMatrix(), i.worldTangent.xyz)); + + // #if %SCREENPOSREQUIREKEY% + // d.screenPos = i.screenPos; + // d.screenUV = (i.screenPos.xy / i.screenPos.w); + // #endif + + + // #if %EXTRAV2F0REQUIREKEY% + // d.extraV2F0 = i.extraV2F0; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // d.extraV2F1 = i.extraV2F1; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // d.extraV2F2 = i.extraV2F2; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // d.extraV2F3 = i.extraV2F3; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // d.extraV2F4 = i.extraV2F4; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // d.extraV2F5 = i.extraV2F5; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // d.extraV2F6 = i.extraV2F6; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // d.extraV2F7 = i.extraV2F7; + // #endif + + return d; + } + +#endif + + + +#if (SHADERPASS == SHADERPASS_LIGHT_TRANSPORT) + + // This was not in constant buffer in original unity, so keep outiside. But should be in as ShaderRenderPass frequency + float unity_OneOverOutputBoost; + float unity_MaxOutputValue; + + CBUFFER_START(UnityMetaPass) + // x = use uv1 as raster position + // y = use uv2 as raster position + bool4 unity_MetaVertexControl; + + // x = return albedo + // y = return normal + bool4 unity_MetaFragmentControl; + CBUFFER_END + + VertexToPixel Vert(VertexData inputMesh) + { + VertexToPixel output; + ZERO_INITIALIZE(VertexToPixel, output); + UNITY_SETUP_INSTANCE_ID(inputMesh); + UNITY_TRANSFER_INSTANCE_ID(inputMesh, output); + UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(output); + + // Output UV coordinate in vertex shader + float2 uv = float2(0.0, 0.0); + + if (unity_MetaVertexControl.x) + { + uv = inputMesh.texcoord1.xy * unity_LightmapST.xy + unity_LightmapST.zw; + } + else if (unity_MetaVertexControl.y) + { + uv = inputMesh.texcoord2.xy * unity_DynamicLightmapST.xy + unity_DynamicLightmapST.zw; + } + + // OpenGL right now needs to actually use the incoming vertex position + // so we create a fake dependency on it here that haven't any impact. + output.pos = float4(uv * 2.0 - 1.0, inputMesh.vertex.z > 0 ? 1.0e-4 : 0.0, 1.0); + + output.worldPos = TransformObjectToWorld(inputMesh.vertex.xyz).xyz; + + // Normal is required for triplanar mapping + output.worldNormal = TransformObjectToWorldNormal(inputMesh.normal); + // Not required but assign to silent compiler warning + output.worldTangent = float4(1.0, 0.0, 0.0, 0.0); + + output.texcoord0 = inputMesh.texcoord0; + output.texcoord1 = inputMesh.texcoord1; + output.texcoord2 = inputMesh.texcoord2; + // #if %TEXCOORD3REQUIREKEY% + output.texcoord3 = inputMesh.texcoord3; + // #endif + // #if %VERTEXCOLORREQUIREKEY% + output.vertexColor = inputMesh.vertexColor; + // #endif + + return output; + } +#else + + #if (_PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR))) + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/ShaderVariablesMatrixDefsHDCamera.hlsl" + + void MotionVectorPositionZBias(VertexToPixel input) + { + #if UNITY_REVERSED_Z + input.pos.z -= unity_MotionVectorsParams.z * input.pos.w; + #else + input.pos.z += unity_MotionVectorsParams.z * input.pos.w; + #endif + } + + #endif + + VertexToPixel Vert(VertexData input) + { + VertexToPixel output; + ZERO_INITIALIZE(VertexToPixel, output); + + UNITY_SETUP_INSTANCE_ID(input); + UNITY_TRANSFER_INSTANCE_ID(input, output); + UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(output); + + #if _HDRP && (_PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR))) + VertexData previousMesh = input; + #endif + + ChainModifyVertex(input, output, _Time); + + // This return the camera relative position (if enable) + float3 positionRWS = TransformObjectToWorld(input.vertex.xyz); + float3 normalWS = TransformObjectToWorldNormal(input.normal); + float4 tangentWS = float4(TransformObjectToWorldDir(input.tangent.xyz), input.tangent.w); + + + output.worldPos = GetAbsolutePositionWS(positionRWS); + output.pos = TransformWorldToHClip(positionRWS); + output.worldNormal = normalWS; + output.worldTangent = tangentWS; + + + output.texcoord0 = input.texcoord0; + output.texcoord1 = input.texcoord1; + output.texcoord2 = input.texcoord2; + + // #if %TEXCOORD3REQUIREKEY% + output.texcoord3 = input.texcoord3; + // #endif + + // #if %VERTEXCOLORREQUIREKEY% + output.vertexColor = input.vertexColor; + // #endif + + // #if %SCREENPOSREQUIREKEY% + // output.screenPos = ComputeScreenPos(output.pos, _ProjectionParams.x); + // #endif + + #if _HDRP && (_PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR))) + + #if !defined(TESSELLATION_ON) + MotionVectorPositionZBias(output); + #endif + + output.motionVectorCS = mul(UNITY_MATRIX_UNJITTERED_VP, float4(positionRWS.xyz, 1.0)); + // Note: unity_MotionVectorsParams.y is 0 is forceNoMotion is enabled + bool forceNoMotion = unity_MotionVectorsParams.y == 0.0; + if (forceNoMotion) + { + output.previousPositionCS = float4(0.0, 0.0, 0.0, 1.0); + } + else + { + bool hasDeformation = unity_MotionVectorsParams.x > 0.0; // Skin or morph target + + float3 effectivePositionOS = (hasDeformation ? previousMesh.previousPositionOS : previousMesh.vertex.xyz); + #if defined(_ADD_PRECOMPUTED_VELOCITY) + effectivePositionOS -= input.precomputedVelocity; + #endif + + previousMesh.vertex = float4(effectivePositionOS, 1); + VertexToPixel dummy = (VertexToPixel)0; + + + ChainModifyVertex(previousMesh, dummy, _LastTimeParameters); + + // we might need this for skinned objects? + //float3 normalWS = TransformPreviousObjectToWorldNormal(input.normal).xyz; + float3 previousPositionRWS = TransformPreviousObjectToWorld(previousMesh.vertex.xyz); + + #ifdef _WRITE_TRANSPARENT_MOTION_VECTOR + if (_TransparentCameraOnlyMotionVectors > 0) + { + previousPositionRWS = positionRWS.xyz; + } + #endif // _WRITE_TRANSPARENT_MOTION_VECTOR + + output.previousPositionCS = mul(UNITY_MATRIX_PREV_VP, float4(previousPositionRWS, 1.0)); + } + #endif // _HDRP && _PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR)) + + + return output; + } + + +#endif + + + + + + + + #if defined(WRITE_DECAL_BUFFER) && !defined(_DISABLE_DECALS) + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/Decal/DecalPrepassBuffer.hlsl" + #endif + + FragInputs BuildFragInputs(VertexToPixel input) + { + UNITY_SETUP_INSTANCE_ID(input); + FragInputs output; + ZERO_INITIALIZE(FragInputs, output); + + // Init to some default value to make the computer quiet (else it output 'divide by zero' warning even if value is not used). + // TODO: this is a really poor workaround, but the variable is used in a bunch of places + // to compute normals which are then passed on elsewhere to compute other values... + output.tangentToWorld = k_identity3x3; + output.positionSS = input.pos; // input.positionCS is SV_Position + // BETTER SHADERS: because we transform world position into actual world space for things like + // triplanar, etc, we have to back transform it here for lighting + output.positionRWS = GetCameraRelativePositionWS(input.worldPos); + output.tangentToWorld = BuildTangentToWorld(input.worldTangent, input.worldNormal); + output.texCoord0 = input.texcoord0; + output.texCoord1 = input.texcoord1; + output.texCoord2 = input.texcoord2; + + return output; + } + + void BuildSurfaceData(FragInputs fragInputs, inout Surface surfaceDescription, float3 V, PositionInputs posInput, out SurfaceData surfaceData, out float3 bentNormalWS) + { + // setup defaults -- these are used if the graph doesn't output a value + ZERO_INITIALIZE(SurfaceData, surfaceData); + + // specularOcclusion need to be init ahead of decal to quiet the compiler that modify the SurfaceData struct + // however specularOcclusion can come from the graph, so need to be init here so it can be override. + surfaceData.specularOcclusion = 1.0; + + // copy across graph values, if defined + surfaceData.baseColor = surfaceDescription.Albedo; + surfaceData.perceptualSmoothness = surfaceDescription.Smoothness; + surfaceData.ambientOcclusion = surfaceDescription.Occlusion; + surfaceData.specularOcclusion = surfaceDescription.SpecularOcclusion; + surfaceData.metallic = surfaceDescription.Metallic; + surfaceData.subsurfaceMask = surfaceDescription.SubsurfaceMask; + surfaceData.thickness = surfaceDescription.Thickness; + surfaceData.diffusionProfileHash = asuint(surfaceDescription.DiffusionProfileHash); + #if _USESPECULAR + surfaceData.specularColor = surfaceDescription.Specular; + #endif + surfaceData.coatMask = surfaceDescription.CoatMask; + surfaceData.anisotropy = surfaceDescription.Anisotropy; + surfaceData.iridescenceMask = surfaceDescription.IridescenceMask; + surfaceData.iridescenceThickness = surfaceDescription.IridescenceThickness; + + + + #if defined(_REFRACTION_PLANE) || defined(_REFRACTION_SPHERE) || defined(_REFRACTION_THIN) + if (_EnableSSRefraction) + { + surfaceData.transmittanceMask = (1.0 - surfaceDescription.Alpha); + surfaceDescription.Alpha = 1.0; + } + else + { + surfaceData.ior = surfaceDescription.ior; + surfaceData.transmittanceColor = surfaceDescription.transmittanceColor; + surfaceData.atDistance = surfaceDescription.atDistance; + surfaceData.transmittanceMask = surfaceDescription.transmittanceMask; + surfaceDescription.Alpha = 1.0; + } + #else + surfaceData.ior = 1.0; + surfaceData.transmittanceColor = float3(1.0, 1.0, 1.0); + surfaceData.atDistance = 1.0; + surfaceData.transmittanceMask = 0.0; + #endif + + + + // These static material feature allow compile time optimization + surfaceData.materialFeatures = MATERIALFEATUREFLAGS_LIT_STANDARD; + #ifdef _MATERIAL_FEATURE_SUBSURFACE_SCATTERING + surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_SUBSURFACE_SCATTERING; + #endif + + #ifdef _MATERIAL_FEATURE_TRANSMISSION + surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_TRANSMISSION; + #endif + + #ifdef _MATERIAL_FEATURE_ANISOTROPY + surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_ANISOTROPY; + surfaceData.normalWS = float3(0, 1, 0); + #endif + + #ifdef _MATERIAL_FEATURE_IRIDESCENCE + surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_IRIDESCENCE; + #endif + + #ifdef _MATERIAL_FEATURE_SPECULAR_COLOR + surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_SPECULAR_COLOR; + #endif + + #if defined(_MATERIAL_FEATURE_CLEAR_COAT) || _CLEARCOAT + surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_CLEAR_COAT; + #endif + + #if defined (_MATERIAL_FEATURE_SPECULAR_COLOR) && defined (_ENERGY_CONSERVING_SPECULAR) + // Require to have setup baseColor + // Reproduce the energy conservation done in legacy Unity. Not ideal but better for compatibility and users can unchek it + surfaceData.baseColor *= (1.0 - Max3(surfaceData.specularColor.r, surfaceData.specularColor.g, surfaceData.specularColor.b)); + #endif + + + + // compute world space normal + #if !_WORLDSPACENORMAL + surfaceData.normalWS = mul(surfaceDescription.Normal, fragInputs.tangentToWorld); + #else + surfaceData.normalWS = surfaceDescription.Normal; + #endif + + surfaceData.geomNormalWS = fragInputs.tangentToWorld[2]; + + surfaceData.tangentWS = normalize(fragInputs.tangentToWorld[0].xyz); // The tangent is not normalize in tangentToWorld for mikkt. TODO: Check if it expected that we normalize with Morten. Tag: SURFACE_GRADIENT + + + #if HAVE_DECALS + if (_EnableDecals) + { + float alpha = 1.0; + alpha = surfaceDescription.Alpha; + + // Both uses and modifies 'surfaceData.normalWS'. + DecalSurfaceData decalSurfaceData = GetDecalSurfaceData(posInput, fragInputs.tangentToWorld[2], alpha); + ApplyDecalToSurfaceData(decalSurfaceData, fragInputs.tangentToWorld[2], surfaceData); + } + #endif + + bentNormalWS = surfaceData.normalWS; + + surfaceData.tangentWS = Orthonormalize(surfaceData.tangentWS, surfaceData.normalWS); + + #ifdef DEBUG_DISPLAY + if (_DebugMipMapMode != DEBUGMIPMAPMODE_NONE) + { + // TODO: need to update mip info + surfaceData.metallic = 0; + } + + // We need to call ApplyDebugToSurfaceData after filling the surfarcedata and before filling builtinData + // as it can modify attribute use for static lighting + ApplyDebugToSurfaceData(fragInputs.tangentToWorld, surfaceData); + #endif + + // By default we use the ambient occlusion with Tri-ace trick (apply outside) for specular occlusion. + // If user provide bent normal then we process a better term + #if defined(_SPECULAR_OCCLUSION_CUSTOM) + // Just use the value passed through via the slot (not active otherwise) + #elif defined(_SPECULAR_OCCLUSION_FROM_AO_BENT_NORMAL) + // If we have bent normal and ambient occlusion, process a specular occlusion + surfaceData.specularOcclusion = GetSpecularOcclusionFromBentAO(V, bentNormalWS, surfaceData.normalWS, surfaceData.ambientOcclusion, PerceptualSmoothnessToPerceptualRoughness(surfaceData.perceptualSmoothness)); + #elif defined(_AMBIENT_OCCLUSION) && defined(_SPECULAR_OCCLUSION_FROM_AO) + surfaceData.specularOcclusion = GetSpecularOcclusionFromAmbientOcclusion(ClampNdotV(dot(surfaceData.normalWS, V)), surfaceData.ambientOcclusion, PerceptualSmoothnessToRoughness(surfaceData.perceptualSmoothness)); + #endif + + #if defined(_ENABLE_GEOMETRIC_SPECULAR_AA) && !defined(SHADER_STAGE_RAY_TRACING) + surfaceData.perceptualSmoothness = GeometricNormalFiltering(surfaceData.perceptualSmoothness, fragInputs.tangentToWorld[2], surfaceDescription.SpecularAAScreenSpaceVariance, surfaceDescription.SpecularAAThreshold); + #endif + } + + void GetSurfaceAndBuiltinData(VertexToPixel m2ps, FragInputs fragInputs, float3 V, inout PositionInputs posInput, + out SurfaceData surfaceData, out BuiltinData builtinData, inout Surface l, inout ShaderData d + #if NEED_FACING + , bool facing + #endif + ) + { + // Removed since crossfade does not work, probably needs extra material setup. + //#if !defined(SHADER_STAGE_RAY_TRACING) && !defined(_TESSELLATION_DISPLACEMENT) + // #ifdef LOD_FADE_CROSSFADE // enable dithering LOD transition if user select CrossFade transition in LOD group + // LODDitheringTransition(ComputeFadeMaskSeed(V, posInput.positionSS), unity_LODFade.x); + // #endif + //#endif + + d = CreateShaderData(m2ps + #if NEED_FACING + , facing + #endif + ); + + l = (Surface)0; + + l.Albedo = half3(0.5, 0.5, 0.5); + l.Normal = float3(0,0,1); + l.Occlusion = 1; + l.Alpha = 1; + l.SpecularOcclusion = 1; + + #if !defined(SHADER_STAGE_RAY_TRACING) && defined(_DEPTHOFFSET_ON) + l.outputDepth = d.clipPos.z; + #endif + + ChainSurfaceFunction(l, d); + + #if !defined(SHADER_STAGE_RAY_TRACING) && defined(_DEPTHOFFSET_ON) + //posInput.deviceDepth = l.outputDepth; + #endif + + #if _UNLIT + //l.Emission = l.Albedo; + //l.Albedo = 0; + l.Normal = half3(0,0,1); + l.Occlusion = 1; + l.Metallic = 0; + l.Specular = 0; + #endif + + surfaceData.geomNormalWS = d.worldSpaceNormal; + surfaceData.tangentWS = d.worldSpaceTangent; + fragInputs.tangentToWorld = d.TBNMatrix; + + float3 bentNormalWS; + BuildSurfaceData(fragInputs, l, V, posInput, surfaceData, bentNormalWS); + + + InitBuiltinData(posInput, l.Alpha, bentNormalWS, -d.worldSpaceNormal, fragInputs.texCoord1, fragInputs.texCoord2, builtinData); + + + + builtinData.emissiveColor = l.Emission; + + #if defined(_OVERRIDE_BAKEDGI) + builtinData.bakeDiffuseLighting = l.DiffuseGI; + builtinData.backBakeDiffuseLighting = l.BackDiffuseGI; + builtinData.emissiveColor += l.SpecularGI; + #endif + + #if defined(_OVERRIDE_SHADOWMASK) + builtinData.shadowMask0 = l.ShadowMask.x; + builtinData.shadowMask1 = l.ShadowMask.y; + builtinData.shadowMask2 = l.ShadowMask.z; + builtinData.shadowMask3 = l.ShadowMask.w; + #endif + + #if defined(UNITY_VIRTUAL_TEXTURING) + builtinData.vtPackedFeedback = surfaceData.VTPackedFeedback; + #endif + + #if (SHADERPASS == SHADERPASS_DISTORTION) + builtinData.distortion = surfaceData.Distortion; + builtinData.distortionBlur = surfaceData.DistortionBlur; + #endif + + #ifndef SHADER_UNLIT + // PostInitBuiltinData call ApplyDebugToBuiltinData + PostInitBuiltinData(V, posInput, surfaceData, builtinData); + #else + ApplyDebugToBuiltinData(builtinData); + #endif + + RAY_TRACING_OPTIONAL_ALPHA_TEST_PASS + } + + + +#define DEBUG_DISPLAY +#include "Packages/com.unity.render-pipelines.high-definition/Runtime/Debug/DebugDisplay.hlsl" +#include "Packages/com.unity.render-pipelines.high-definition/Runtime/Debug/FullScreenDebug.hlsl" + + #if !defined(_DEPTHOFFSET_ON) + [earlydepthstencil] // quad overshading debug mode writes to UAV + #endif + void Frag(VertexToPixel v2f + #if NEED_FACING + , bool facing : SV_IsFrontFace + #endif + ) + { + UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX(v2f); + FragInputs input = BuildFragInputs(v2f); + + PositionInputs posInput = GetPositionInput(input.positionSS.xy, _ScreenSize.zw, input.positionSS.z, input.positionSS.w, input.positionRWS.xyz); + + #ifdef PLATFORM_SUPPORTS_PRIMITIVE_ID_IN_PIXEL_SHADER + if (_DebugFullScreenMode == FULLSCREENDEBUGMODE_QUAD_OVERDRAW) + { + IncrementQuadOverdrawCounter(posInput.positionSS.xy, input.primitiveID); + } + #endif + } + + ENDHLSL + } + + + + + + } + + + + CustomEditor "AllIn1SpriteShaderLitMaterialInspector" +} diff --git a/Assets/Plugins/AllIn1SpriteShader/Shaders/LitShaders/AllIn1SpriteShaderLit_BetterShader_HDRP2021.txt.meta b/Assets/Plugins/AllIn1SpriteShader/Shaders/LitShaders/AllIn1SpriteShaderLit_BetterShader_HDRP2021.txt.meta new file mode 100644 index 000000000..6c264224d --- /dev/null +++ b/Assets/Plugins/AllIn1SpriteShader/Shaders/LitShaders/AllIn1SpriteShaderLit_BetterShader_HDRP2021.txt.meta @@ -0,0 +1,14 @@ +fileFormatVersion: 2 +guid: 5545a9e4fbadc354c82bb73fb11b0af7 +TextScriptImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 156513 + packageName: All In 1 Sprite Shader + packageVersion: 4.25 + assetPath: Assets/Plugins/AllIn1SpriteShader/Shaders/LitShaders/AllIn1SpriteShaderLit_BetterShader_HDRP2021.txt + uploadId: 708810 diff --git a/Assets/Plugins/AllIn1SpriteShader/Shaders/LitShaders/AllIn1SpriteShaderLit_BetterShader_HDRP2022.txt b/Assets/Plugins/AllIn1SpriteShader/Shaders/LitShaders/AllIn1SpriteShaderLit_BetterShader_HDRP2022.txt new file mode 100644 index 000000000..c657cb0e5 --- /dev/null +++ b/Assets/Plugins/AllIn1SpriteShader/Shaders/LitShaders/AllIn1SpriteShaderLit_BetterShader_HDRP2022.txt @@ -0,0 +1,26332 @@ +//////////////////////////////////////// +// Generated with Better Shaders +// +// Auto-generated shader code, don't hand edit! +// +// Unity Version: 2019.4.16f1 +// Render Pipeline: HDRP2022 +// Platform: WindowsEditor +//////////////////////////////////////// + + +Shader "AllIn1SpriteShader/AllIn1SpriteShaderLit_BetterShader" +{ + Properties + { + + _MainTex ("Main Texture", 2D) = "white" {} //0 + _Color("Main Color", Color) = (1,1,1,1) //1 + _Alpha("General Alpha", Range(0,1)) = 1 //2 + + _GlowColor("Glow Color", Color) = (1,1,1,1) //3 + _Glow("Glow Color Intensity", Range(0,100)) = 10 //4 + _GlowGlobal("Global Glow Intensity", Range(1,100)) = 1 //5 + [NoScaleOffset] _GlowTex("Glow Texture", 2D) = "white" {} //6 + + _FadeTex("Fade Texture", 2D) = "white" {} //7 + _FadeAmount("Fade Amount", Range(-0.1,1)) = -0.1 //8 + _FadeBurnWidth("Fade Burn Width", Range(0,1)) = 0.025 //9 + _FadeBurnTransition("Burn Transition", Range(0.01,0.5)) = 0.075 //10 + _FadeBurnColor("Fade Burn Color", Color) = (1,1,0,1) //11 + _FadeBurnTex("Fade Burn Texture", 2D) = "white" {} //12 + _FadeBurnGlow("Fade Burn Glow", Range(1,250)) = 2//13 + + _OutlineColor("Outline Base Color", Color) = (1,1,1,1) //14 + _OutlineAlpha("Outline Base Alpha", Range(0,1)) = 1 //15 + _OutlineGlow("Outline Base Glow", Range(1,100)) = 1.5 //16 + _OutlineWidth("Outline Base Width", Range(0,0.2)) = 0.004 //17 + _OutlinePixelWidth("Outline Base Pixel Width", Int) = 1 //18 + + [Space] + _OutlineTex("Outline Texture", 2D) = "white" {} //19 + _OutlineTexXSpeed("Texture scroll speed X", Range(-50,50)) = 10 //20 + _OutlineTexYSpeed("Texture scroll speed Y", Range(-50,50)) = 0 //21 + + [Space] + _OutlineDistortTex("Outline Distortion Texture", 2D) = "white" {} //22 + _OutlineDistortAmount("Outline Distortion Amount", Range(0,2)) = 0.5 //23 + _OutlineDistortTexXSpeed("Distortion scroll speed X", Range(-50,50)) = 5 //24 + _OutlineDistortTexYSpeed("Distortion scroll speed Y", Range(-50,50)) = 5 //25 + + _AlphaOutlineColor("Color", Color) = (1, 1, 1, 1) //26 + _AlphaOutlineGlow("Outline Glow", Range(1,100)) = 5 //27 + _AlphaOutlinePower("Power", Range(0, 5)) = 1 // 28 + _AlphaOutlineMinAlpha("Min Alpha", Range(0, 1)) = 0 // 29 + _AlphaOutlineBlend("Blend", Range(0, 1)) = 1 // 30 + + _GradBlend("Gradient Blend", Range(0,1)) = 1 //31 + _GradTopLeftCol("Top Color", Color) = (1,0,0,1) //32 + _GradTopRightCol("Top Color 2", Color) = (1, 1, 0, 1) //33 + _GradBotLeftCol("Bot Color", Color) = (0,0,1,1) //34 + _GradBotRightCol("Bot Color 2", Color) = (0, 1, 0, 1) //35 + + [NoScaleOffset] _ColorSwapTex("Color Swap Texture", 2D) = "black" {} //36 + [HDR] _ColorSwapRed("Red Channel", Color) = (1,1,1,1) //37 + _ColorSwapRedLuminosity("Red luminosity", Range(-1,1)) = 0.5 //38 + [HDR] _ColorSwapGreen("Green Channel", Color) = (1,1,1,1) //39 + _ColorSwapGreenLuminosity("Green luminosity", Range(-1,1)) = 0.5 //40 + [HDR] _ColorSwapBlue("Blue Channel", Color) = (1,1,1,1) //41 + _ColorSwapBlueLuminosity("Blue luminosity", Range(-1,1)) = 0.5 //42 + + _HsvShift("Hue Shift", Range(0, 360)) = 180 //43 + _HsvSaturation("Saturation", Range(0, 2)) = 1 //44 + _HsvBright("Brightness", Range(0, 2)) = 1 //45 + + _HitEffectColor("Hit Effect Color", Color) = (1,1,1,1) //46 + _HitEffectGlow("Glow Intensity", Range(1,100)) = 5 //47 + [Space] + _HitEffectBlend("Hit Effect Blend", Range(0,1)) = 1 //48 + + _NegativeAmount("Negative Amount", Range(0, 1)) = 1 //49 + + _PixelateSize("Pixelate size", Range(4,512)) = 32 //50 + + [NoScaleOffset] _ColorRampTex("Color ramp Texture", 2D) = "white" {} //51 + _ColorRampLuminosity("Color ramp luminosity", Range(-1,1)) = 0 //52 + [Toggle()] _ColorRampOutline("Affects everything?", float) = 0 //53 + + _GreyscaleLuminosity("Greyscale luminosity", Range(-1,1)) = 0 //54 + [Toggle()] _GreyscaleOutline("Affects everything?", float) = 0 //55 + _GreyscaleTintColor("Greyscale Tint Color", Color) = (1,1,1,1) //56 + + _PosterizeNumColors("Number of Colors", Range(0,100)) = 8 //57 + _PosterizeGamma("Posterize Amount", Range(0.1,10)) = 0.75 //58 + [Toggle()] _PosterizeOutline("Affects everything?", float) = 0 //59 + + _BlurIntensity("Blur Intensity", Range(0,100)) = 10 //60 + [Toggle()] _BlurHD("Blur is Low Res?", float) = 0 //61 + + _MotionBlurAngle("Motion Blur Angle", Range(-1, 1)) = 0.1 //62 + _MotionBlurDist("Motion Blur Distance", Range(-3, 3)) = 1.25 //63 + + _GhostColorBoost("Ghost Color Boost", Range(0,5)) = 1 //64 + _GhostTransparency("Ghost Transparency", Range(0,1)) = 0 //65 + + _InnerOutlineColor("Inner Outline Color", Color) = (1,0,0,1) //66 + _InnerOutlineThickness("Outline Thickness", Range(0,3)) = 1 //67 + _InnerOutlineAlpha("Inner Outline Alpha", Range(0,1)) = 1 //68 + _InnerOutlineGlow("Inner Outline Glow", Range(1,250)) = 4 //69 + + _AlphaCutoffValue("Alpha cutoff value", Range(0, 1)) = 0.25 //70 + + [Toggle()] _OnlyOutline("Only render outline?", float) = 0 //71 + [Toggle()] _OnlyInnerOutline("Only render inner outline?", float) = 0 //72 + + _HologramStripesAmount("Stripes Amount", Range(0, 1)) = 0.1 //73 + _HologramUnmodAmount("Unchanged Amount", Range(0, 1)) = 0.0 //74 + _HologramStripesSpeed("Stripes Speed", Range(-20, 20)) = 4.5 //75 + _HologramMinAlpha("Min Alpha", Range(0, 1)) = 0.1 //76 + _HologramMaxAlpha("Max Alpha", Range(0, 100)) = 0.75 //77 + + _ChromAberrAmount("ChromAberr Amount", Range(0, 1)) = 1 //78 + _ChromAberrAlpha("ChromAberr Alpha", Range(0, 1)) = 0.4 //79 + + _GlitchAmount("Glitch Amount", Range(0, 20)) = 3 //80 + + _FlickerPercent("Flicker Percent", Range(0, 1)) = 0.05 //81 + _FlickerFreq("Flicker Frequency", Range(0, 5)) = 0.2 //82 + _FlickerAlpha("Flicker Alpha", Range(0, 1)) = 0 //83 + + _ShadowX("Shadow X Axis", Range(-0.5, 0.5)) = 0.1 //84 + _ShadowY("Shadow Y Axis", Range(-0.5, 0.5)) = -0.05 //85 + _ShadowAlpha("Shadow Alpha", Range(0, 1)) = 0.5 //86 + _ShadowColor("Shadow Color", Color) = (0, 0, 0, 1) //87 + + _HandDrawnAmount("Hand Drawn Amount", Range(0, 20)) = 10 //88 + _HandDrawnSpeed("Hand Drawn Speed", Range(1, 15)) = 5 //89 + + _GrassSpeed("Speed", Range(0,50)) = 2 //90 + _GrassWind("Bend amount", Range(0,50)) = 20 //91 + [Space] + [Toggle()] _GrassManualToggle("Manually animated?", float) = 0 //92 + _GrassManualAnim("Manual Anim Value", Range(-1,1)) = 1 //93 + + _WaveAmount("Wave Amount", Range(0, 25)) = 7 //94 + _WaveSpeed("Wave Speed", Range(0, 25)) = 10 //95 + _WaveStrength("Wave Strength", Range(0, 25)) = 7.5 //96 + _WaveX("Wave X Axis", Range(0, 1)) = 0 //97 + _WaveY("Wave Y Axis", Range(0, 1)) = 0.5 //98 + + _RectSize("Rect Size", Range(1, 4)) = 1 //99 + + _OffsetUvX("X axis", Range(-1, 1)) = 0 //100 + _OffsetUvY("Y axis", Range(-1, 1)) = 0 //101 + + _ClipUvLeft("Clipping Left", Range(0, 1)) = 0 //102 + _ClipUvRight("Clipping Right", Range(0, 1)) = 0 //103 + _ClipUvUp("Clipping Up", Range(0, 1)) = 0 //104 + _ClipUvDown("Clipping Down", Range(0, 1)) = 0 //105 + + _TextureScrollXSpeed("Speed X Axis", Range(-5, 5)) = 1 //106 + _TextureScrollYSpeed("Speed Y Axis", Range(-5, 5)) = 0 //107 + + _ZoomUvAmount("Zoom Amount", Range(0.1, 5)) = 0.5 //108 + + _DistortTex("Distortion Texture", 2D) = "white" {} //109 + _DistortAmount("Distortion Amount", Range(0,2)) = 0.5 //110 + _DistortTexXSpeed("Scroll speed X", Range(-50,50)) = 5 //111 + _DistortTexYSpeed("Scroll speed Y", Range(-50,50)) = 5 //112 + + _TwistUvAmount("Twist Amount", Range(0, 3.1416)) = 1 //113 + _TwistUvPosX("Twist Pos X Axis", Range(0, 1)) = 0.5 //114 + _TwistUvPosY("Twist Pos Y Axis", Range(0, 1)) = 0.5 //115 + _TwistUvRadius("Twist Radius", Range(0, 3)) = 0.75 //116 + + _RotateUvAmount("Rotate Angle(radians)", Range(0, 6.2831)) = 0 //117 + + _FishEyeUvAmount("Fish Eye Amount", Range(0, 0.5)) = 0.35 //118 + + _PinchUvAmount("Pinch Amount", Range(0, 0.5)) = 0.35 //119 + + _ShakeUvSpeed("Shake Speed", Range(0, 20)) = 2.5 //120 + _ShakeUvX("X Multiplier", Range(0, 5)) = 1.5 //121 + _ShakeUvY("Y Multiplier", Range(0, 5)) = 1 //122 + + _ColorChangeTolerance("Tolerance", Range(0, 1)) = 0.25 //123 + _ColorChangeTarget("Color to change", Color) = (1, 0, 0, 1) //124 + [HDR] _ColorChangeNewCol("New Color", Color) = (1, 1, 0, 1) //125 + _ColorChangeLuminosity("New Color Luminosity", Range(0, 1)) = 0.0 //126 + + _RoundWaveStrength("Wave Strength", Range(0, 1)) = 0.7 //127 + _RoundWaveSpeed("Wave Speed", Range(0, 5)) = 2 //128 + + [Toggle()] _BillboardY("Billboard on both axis?", float) = 0 //129 + _ZWrite ("Depth Write", Float) = 1.0 // 130 + + _MySrcMode ("SrcMode", Float) = 5 // 131 + _MyDstMode ("DstMode", Float) = 10 // 132 + + _ShineColor("Shine Color", Color) = (1,1,1,1) // 133 + _ShineLocation("Shine Location", Range(0,1)) = 0.5 // 134 + _ShineRotate("Rotate Angle(radians)", Range(0, 6.2831)) = 0 //135 + _ShineWidth("Shine Width", Range(0.05,1)) = 0.1 // 136 + _ShineGlow("Shine Glow", Range(0,100)) = 1 // 137 + [NoScaleOffset] _ShineMask("Shine Mask", 2D) = "white" {} // 138 + + _GlitchSize("Glitch Size", Range(0.25, 5)) = 1 //139 + _HologramStripeColor("Stripes Color", Color) = (0,1,1,1) //140 + _GradBoostX("Boost X axis", Range(0.1, 5)) = 1.2 //141 + _GradBoostY("Boost Y axis", Range(0.1, 5)) = 1.2 //142 + [Toggle()] _GradIsRadial("Radial Gradient?", float) = 0 //143 + _AlphaRoundThreshold("Round Threshold", Range(0.005, 1.0)) = 0.5 //144 + _GrassRadialBend("Radial Bend", Range(0.0, 5.0)) = 0.1 //145 + + _ColorChangeTolerance2("Tolerance 2", Range(0, 1)) = 0.25 //146 + _ColorChangeTarget2("Color to change 2", Color) = (1, 0, 0, 1) //147 + [HDR] _ColorChangeNewCol2("New Color 2", Color) = (1, 1, 0, 1) //148 + _ColorChangeTolerance3("Tolerance 3", Range(0, 1)) = 0.25 //149 + _ColorChangeTarget3("Color to change 3", Color) = (1, 0, 0, 1) //150 + [HDR] _ColorChangeNewCol3("New Color 3", Color) = (1, 1, 0, 1) //151 + + _Contrast ("Contrast", Range(0, 6)) = 1 // 152 + _Brightness ("Brightness", Range(-1, 1)) = 0 // 153 + + _ColorSwapBlend ("Color Swap Blend", Range(0, 1)) = 1 // 154 + _ColorRampBlend ("Color Ramp Blend", Range(0, 1)) = 1 // 155 + _GreyscaleBlend ("Greyscale Blend", Range(0, 1)) = 1 // 156 + _GhostBlend ("Ghost Blend", Range(0, 1)) = 1 // 157 + _HologramBlend ("Hologram Blend", Range(0, 1)) = 1 // 158 + + [AllIn1ShaderGradient] _ColorRampTexGradient("Color ramp Gradient", 2D) = "white" {} //159 + + _OverlayTex("Overlay Texture", 2D) = "white" {} //160 + _OverlayColor("Overlay Color", Color) = (1, 1, 1, 1) //161 + _OverlayGlow("Overlay Glow", Range(0,25)) = 1 // 162 + _OverlayBlend("Overlay Blend", Range(0, 1)) = 1 // 163 + + _RadialStartAngle("Radial Start Angle", Range(0, 360)) = 90 //164 + _RadialClip("Radial Clip", Range(0, 360)) = 45 //165 + _RadialClip2("Radial Clip 2", Range(0, 360)) = 0 //166 + + _WarpStrength("Warp Strength", Range(0, 0.1)) = 0.025 //167 + _WarpSpeed("Warp Speed", Range(0, 25)) = 8 //168 + _WarpScale("Warp Scale", Range(0.05, 3)) = 0.5 //169 + + _OverlayTextureScrollXSpeed("Speed X Axis", Range(-5, 5)) = 0.25 //170 + _OverlayTextureScrollYSpeed("Speed Y Axis", Range(-5, 5)) = 0.25 //171 + + _ZTestMode ("Z Test Mode", Float) = 4 + _CullingOption ("Culling Option", float) = 0 + + [HideInInspector] _MinXUV("_MinXUV", Range(0, 1)) = 0.0 + [HideInInspector] _MaxXUV("_MaxXUV", Range(0, 1)) = 1.0 + [HideInInspector] _MinYUV("_MinYUV", Range(0, 1)) = 0.0 + [HideInInspector] _MaxYUV("_MaxYUV", Range(0, 1)) = 1.0 + [HideInInspector] _RandomSeed("_MaxYUV", Range(0, 10000)) = 0.0 + _EditorDrawers("Editor Drawers", Int) = 6 + + [Normal][NoScaleOffset] _NormalMap("Normal Map", 2D) = "bump" {} + _NormalStrength("Normal Strength", Range(0, 15)) = 1.0 + + + + [HideInInspector]_RenderQueueType("Float", Float) = 1 + [HideInInspector][ToggleUI]_AddPrecomputedVelocity("Boolean", Float) = 0 + [HideInInspector][ToggleUI]_DepthOffsetEnable("Boolean", Float) = 0 + [HideInInspector][ToggleUI]_TransparentWritingMotionVec("Boolean", Float) = 0 + [HideInInspector][ToggleUI]_AlphaCutoffEnable("Boolean", Float) = 0 + [HideInInspector]_TransparentSortPriority("_TransparentSortPriority", Float) = 0 + [HideInInspector][ToggleUI]_UseShadowThreshold("Boolean", Float) = 0 + [HideInInspector][ToggleUI]_TransparentDepthPrepassEnable("Boolean", Float) = 0 + [HideInInspector][ToggleUI]_TransparentDepthPostpassEnable("Boolean", Float) = 0 + [HideInInspector]_SurfaceType("Float", Float) = 0 + [HideInInspector]_BlendMode("Float", Float) = 0 + [HideInInspector]_SrcBlend("Float", Float) = 1 + [HideInInspector]_DstBlend("Float", Float) = 0 + [HideInInspector]_AlphaSrcBlend("Float", Float) = 1 + [HideInInspector]_AlphaDstBlend("Float", Float) = 0 + [HideInInspector][ToggleUI]_AlphaToMask("Boolean", Float) = 0 + [HideInInspector][ToggleUI]_AlphaToMaskInspectorValue("Boolean", Float) = 0 + [HideInInspector][ToggleUI]_ZWrite("Boolean", Float) = 1 + [HideInInspector][ToggleUI]_TransparentZWrite("Boolean", Float) = 0 + [HideInInspector][ToggleUI]_EnableFogOnTransparent("Boolean", Float) = 1 + [HideInInspector]_ZTestDepthEqualForOpaque("Float", Int) = 4 + [HideInInspector][Enum(UnityEngine.Rendering.CompareFunction)]_ZTestTransparent("Float", Float) = 4 + [HideInInspector][ToggleUI]_TransparentBackfaceEnable("Boolean", Float) = 0 + [HideInInspector][ToggleUI]_RequireSplitLighting("Boolean", Float) = 0 + [HideInInspector][ToggleUI]_ReceivesSSR("Boolean", Float) = 1 + [HideInInspector][ToggleUI]_ReceivesSSRTransparent("Boolean", Float) = 0 + [HideInInspector][ToggleUI]_EnableBlendModePreserveSpecularLighting("Boolean", Float) = 1 + [HideInInspector][ToggleUI]_SupportDecals("Boolean", Float) = 1 + [HideInInspector]_StencilRef("Float", Int) = 0 + [HideInInspector]_StencilWriteMask("Float", Int) = 6 + [HideInInspector]_StencilRefDepth("Float", Int) = 8 + [HideInInspector]_StencilWriteMaskDepth("Float", Int) = 8 + [HideInInspector]_StencilRefMV("Float", Int) = 40 + [HideInInspector]_StencilWriteMaskMV("Float", Int) = 40 + [HideInInspector]_StencilRefDistortionVec("Float", Int) = 4 + [HideInInspector]_StencilWriteMaskDistortionVec("Float", Int) = 4 + [HideInInspector]_StencilWriteMaskGBuffer("Float", Int) = 14 + [HideInInspector]_StencilRefGBuffer("Float", Int) = 10 + [HideInInspector]_ZTestGBuffer("Float", Int) = 4 + [HideInInspector][ToggleUI]_RayTracing("Boolean", Float) = 0 + [HideInInspector][Enum(None, 0, Box, 1, Sphere, 2, Thin, 3)]_RefractionModel("Float", Float) = 0 + [HideInInspector][NoScaleOffset]unity_Lightmaps("unity_Lightmaps", 2DArray) = "" {} + [HideInInspector][NoScaleOffset]unity_LightmapsInd("unity_LightmapsInd", 2DArray) = "" {} + [HideInInspector][NoScaleOffset]unity_ShadowMasks("unity_ShadowMasks", 2DArray) = "" {} + } + SubShader + { + Tags { "RenderPipeline" = "HDRenderPipeline" "RenderType" = "HDLitShader" "Queue" = "Geometry+225" } + + + Pass + { + // based on HDLitPass.template + Name "Forward" + Tags { "LightMode" = "Forward" } + + + + Stencil + { + WriteMask [_StencilWriteMask] + Ref [_StencilRef] + CompFront Always + PassFront Replace + CompBack Always + PassBack Replace + } + + ColorMask [_ColorMaskTransparentVel] 1 + + Tags { "RenderType" = "Opaque" "Queue" = "Geometry" "PreviewType" = "Plane" } + Cull [_CullingOption] + ZWrite [_ZWrite] + ZTest [_ZTestMode] + + + //------------------------------------------------------------------------------------- + // End Render Modes + //------------------------------------------------------------------------------------- + + HLSLPROGRAM + + #pragma target 4.5 + #pragma multi_compile _ DOTS_INSTANCING_ON + #pragma instancing_options renderinglayer + + #pragma only_renderers d3d11 playstation xboxone xboxseries vulkan metal switch + #pragma multi_compile_instancing + + + //#pragma shader_feature _ _SURFACE_TYPE_TRANSPARENT + //#pragma shader_feature_local _BLENDMODE_OFF _BLENDMODE_ALPHA _BLENDMODE_ADD _BLENDMODE_PRE_MULTIPLY + //#pragma shader_feature_local _ _ADD_PRECOMPUTED_VELOCITY + //#pragma shader_feature_local _ _TRANSPARENT_WRITES_MOTION_VEC + //#pragma shader_feature_local _ _ENABLE_FOG_ON_TRANSPARENT + #pragma multi_compile _ DEBUG_DISPLAY + //#pragma shader_feature_local _ _DISABLE_DECALS + //#pragma shader_feature_local _ _DISABLE_SSR + //#pragma shader_feature_local _ _DISABLE_SSR_TRANSPARENT + #pragma multi_compile _ LIGHTMAP_ON + #pragma multi_compile _ DIRLIGHTMAP_COMBINED + #pragma multi_compile_fragment PROBE_VOLUMES_OFF PROBE_VOLUMES_L1 PROBE_VOLUMES_L2 + #pragma multi_compile_raytracing PROBE_VOLUMES_OFF PROBE_VOLUMES_L1 PROBE_VOLUMES_L2 + #pragma multi_compile _ DYNAMICLIGHTMAP_ON + #pragma multi_compile_fragment _ SHADOWS_SHADOWMASK + #pragma multi_compile_raytracing _ SHADOWS_SHADOWMASK + #pragma multi_compile_fragment DECALS_OFF DECALS_3RT DECALS_4RT + #pragma multi_compile_fragment _ DECAL_SURFACE_GRADIENT + #pragma multi_compile_fragment SHADOW_LOW SHADOW_MEDIUM SHADOW_HIGH + #pragma multi_compile_fragment SCREEN_SPACE_SHADOWS_OFF SCREEN_SPACE_SHADOWS_ON + #pragma multi_compile_fragment USE_FPTL_LIGHTLIST USE_CLUSTERED_LIGHTLIST + #pragma multi_compile_fragment AREA_SHADOW_MEDIUM AREA_SHADOW_HIGH + #pragma multi_compile _ LOD_FADE_CROSSFADE + + + //#pragma shader_feature_local _REFRACTION_OFF _REFRACTION_PLANE _REFRACTION_SPHERE _REFRACTION_THIN + + + //------------------------------------------------------------------------------------- + // Variant Definitions (active field translations to HDRP defines) + //------------------------------------------------------------------------------------- + // #define _MATERIAL_FEATURE_SUBSURFACE_SCATTERING 1 + // #define _MATERIAL_FEATURE_TRANSMISSION 1 + // #define _MATERIAL_FEATURE_ANISOTROPY 1 + // #define _MATERIAL_FEATURE_IRIDESCENCE 1 + // #define _MATERIAL_FEATURE_SPECULAR_COLOR 1 + #define _ENABLE_FOG_ON_TRANSPARENT 1 + // #define _AMBIENT_OCCLUSION 1 + // #define _SPECULAR_OCCLUSION_FROM_AO 1 + // #define _SPECULAR_OCCLUSION_FROM_AO_BENT_NORMAL 1 + // #define _SPECULAR_OCCLUSION_CUSTOM 1 + // #define _ENERGY_CONSERVING_SPECULAR 1 + // #define _ENABLE_GEOMETRIC_SPECULAR_AA 1 + // #define _HAS_REFRACTION 1 + // #define _REFRACTION_PLANE 1 + // #define _REFRACTION_SPHERE 1 + // #define _DISABLE_DECALS 1 + // #define _DISABLE_SSR 1 + // #define _ADD_PRECOMPUTED_VELOCITY + // #define _WRITE_TRANSPARENT_MOTION_VECTOR 1 + // #define _DEPTHOFFSET_ON 1 + // #define _BLENDMODE_PRESERVE_SPECULAR_LIGHTING 1 + + #define SHADERPASS SHADERPASS_FORWARD + #define SUPPORT_BLENDMODE_PRESERVE_SPECULAR_LIGHTING + #define HAS_LIGHTLOOP + #define RAYTRACING_SHADER_GRAPH_DEFAULT + #define _PASSFORWARD 1 + + + #pragma shader_feature_local GLOW_ON + #pragma shader_feature_local FADE_ON + #pragma shader_feature_local OUTBASE_ON + #pragma shader_feature_local ONLYOUTLINE_ON + #pragma shader_feature_local GRADIENT_ON + #pragma shader_feature_local GRADIENT2COL_ON + #pragma shader_feature_local RADIALGRADIENT_ON + #pragma shader_feature_local COLORSWAP_ON + #pragma shader_feature_local HSV_ON + #pragma shader_feature_local CHANGECOLOR_ON + #pragma shader_feature_local CHANGECOLOR2_ON + #pragma shader_feature_local CHANGECOLOR3_ON + #pragma shader_feature_local COLORRAMP_ON + #pragma shader_feature_local GRADIENTCOLORRAMP_ON + #pragma shader_feature_local HITEFFECT_ON + #pragma shader_feature_local NEGATIVE_ON + #pragma shader_feature_local PIXELATE_ON + #pragma shader_feature_local GREYSCALE_ON + #pragma shader_feature_local POSTERIZE_ON + #pragma shader_feature_local BLUR_ON + #pragma shader_feature_local MOTIONBLUR_ON + #pragma shader_feature_local GHOST_ON + #pragma shader_feature_local ALPHAOUTLINE_ON + #pragma shader_feature_local INNEROUTLINE_ON + #pragma shader_feature_local ONLYINNEROUTLINE_ON + #pragma shader_feature_local HOLOGRAM_ON + #pragma shader_feature_local CHROMABERR_ON + #pragma shader_feature_local GLITCH_ON + #pragma shader_feature_local FLICKER_ON + #pragma shader_feature_local SHADOW_ON + #pragma shader_feature_local SHINE_ON + #pragma shader_feature_local CONTRAST_ON + #pragma shader_feature_local OVERLAY_ON + #pragma shader_feature_local OVERLAYMULT_ON + #pragma shader_feature_local DOODLE_ON + #pragma shader_feature_local WIND_ON + #pragma shader_feature_local WAVEUV_ON + #pragma shader_feature_local ROUNDWAVEUV_ON + #pragma shader_feature_local RECTSIZE_ON + #pragma shader_feature_local OFFSETUV_ON + #pragma shader_feature_local CLIPPING_ON + #pragma shader_feature_local RADIALCLIPPING_ON + #pragma shader_feature_local TEXTURESCROLL_ON + #pragma shader_feature_local ZOOMUV_ON + #pragma shader_feature_local DISTORT_ON + #pragma shader_feature_local WARP_ON + #pragma shader_feature_local TWISTUV_ON + #pragma shader_feature_local ROTATEUV_ON + #pragma shader_feature_local POLARUV_ON + #pragma shader_feature_local FISHEYE_ON + #pragma shader_feature_local PINCH_ON + #pragma shader_feature_local SHAKEUV_ON + + #pragma shader_feature_local GLOWTEX_ON + #pragma shader_feature_local OUTTEX_ON + #pragma shader_feature_local OUTDIST_ON + #pragma shader_feature_local OUTBASE8DIR_ON + #pragma shader_feature_local OUTBASEPIXELPERF_ON + #pragma shader_feature_local COLORRAMPOUTLINE_ON + #pragma shader_feature_local GREYSCALEOUTLINE_ON + #pragma shader_feature_local POSTERIZEOUTLINE_ON + #pragma shader_feature_local BLURISHD_ON + #pragma shader_feature_local MANUALWIND_ON + #pragma shader_feature_local ATLAS_ON + #pragma shader_feature_local PREMULTIPLYALPHA_ON + + #pragma shader_feature BILBOARD_ON + #pragma shader_feature BILBOARDY_ON + + #pragma shader_feature NORMALMAP_ON + + + #define _HDRP 1 +#define _USINGTEXCOORD1 1 +#define _USINGTEXCOORD2 1 + + + #pragma vertex Vert + #pragma fragment Frag + + // useful conversion functions to make surface shader code just work + + #define UNITY_DECLARE_TEX2D(name) TEXTURE2D(name); SAMPLER(sampler##name); + #define UNITY_DECLARE_TEX2D_NOSAMPLER(name) TEXTURE2D(name); + #define UNITY_DECLARE_TEX2DARRAY(name) TEXTURE2D_ARRAY(name); SAMPLER(sampler##name); + #define UNITY_DECLARE_TEX2DARRAY_NOSAMPLER(tex) TEXTURE2D_ARRAY(tex); + + #define UNITY_SAMPLE_TEX2DARRAY(tex,coord) SAMPLE_TEXTURE2D_ARRAY(tex, sampler##tex, coord.xy, coord.z) + #define UNITY_SAMPLE_TEX2DARRAY_LOD(tex,coord,lod) SAMPLE_TEXTURE2D_ARRAY_LOD(tex, sampler##tex, coord.xy, coord.z, lod) + #define UNITY_SAMPLE_TEX2D(tex, coord) SAMPLE_TEXTURE2D(tex, sampler##tex, coord) + #define UNITY_SAMPLE_TEX2D_SAMPLER(tex, samp, coord) SAMPLE_TEXTURE2D(tex, sampler##samp, coord) + + #define UNITY_SAMPLE_TEX2D_LOD(tex,coord, lod) SAMPLE_TEXTURE2D_LOD(tex, sampler_##tex, coord, lod) + #define UNITY_SAMPLE_TEX2D_SAMPLER_LOD(tex,samplertex,coord, lod) SAMPLE_TEXTURE2D_LOD (tex, sampler##samplertex,coord, lod) + + #if defined(UNITY_COMPILER_HLSL) + #define UNITY_INITIALIZE_OUTPUT(type,name) name = (type)0; + #else + #define UNITY_INITIALIZE_OUTPUT(type,name) + #endif + + #define sampler2D_float sampler2D + #define sampler2D_half sampler2D + + #undef WorldNormalVector + #define WorldNormalVector(data, normal) mul(normal, data.TBNMatrix) + + #define UnityObjectToWorldNormal(normal) mul(GetObjectToWorldMatrix(), normal) + + #ifndef SHADER_STAGE_FRAGMENT + #if !defined(SHADOW_ULTRA_LOW) && !defined(SHADOW_LOW) && !defined(SHADOW_MEDIUM) && !defined(SHADOW_HIGH) // ultra low come from volumetricLighting.compute + #define SHADOW_MEDIUM + #endif + #if !defined(AREA_SHADOW_LOW) && !defined(AREA_SHADOW_MEDIUM) && !defined(AREA_SHADOW_HIGH) // low come from volumetricLighting.compute + #define AREA_SHADOW_MEDIUM + #endif + #endif + + + +// HDRP Adapter stuff + #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Common.hlsl" + #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Texture.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/ShaderVariables.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/ShaderPass/FragInputs.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/ShaderPass/ShaderPass.cs.hlsl" + #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/TextureStack.hlsl" // Required to be include before we include properties as it define DECLARE_STACK_CB + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/NormalBuffer.hlsl" + +#if UNITY_VERSION >= 202239 + #include "Packages/com.unity.shadergraph/ShaderGraphLibrary/Functions.hlsl" // Need to be here for Gradient struct definition +#else + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/ShaderGraphHeader.hlsl" +#endif + #ifdef RAYTRACING_SHADER_GRAPH_DEFAULT + #define RAYTRACING_SHADER_GRAPH_HIGH + #endif + + #ifdef RAYTRACING_SHADER_GRAPH_RAYTRACED + #define RAYTRACING_SHADER_GRAPH_LOW + #endif + // end + + + + + // If we use subsurface scattering, enable output split lighting (for forward pass) + #if defined(_MATERIAL_FEATURE_SUBSURFACE_SCATTERING) && !defined(_SURFACE_TYPE_TRANSPARENT) + #define OUTPUT_SPLIT_LIGHTING + #endif + + #define HAVE_RECURSIVE_RENDERING + + #if SHADERPASS == SHADERPASS_TRANSPARENT_DEPTH_PREPASS + #if !defined(_DISABLE_SSR_TRANSPARENT) && !defined(SHADER_UNLIT) + #define WRITE_NORMAL_BUFFER + #endif + #endif + + #ifndef DEBUG_DISPLAY + // In case of opaque we don't want to perform the alpha test, it is done in depth prepass and we use depth equal for ztest (setup from UI) + // Don't do it with debug display mode as it is possible there is no depth prepass in this case + #if !defined(_SURFACE_TYPE_TRANSPARENT) && defined(_ALPHATEST) + #if SHADERPASS == SHADERPASS_FORWARD + #define SHADERPASS_FORWARD_BYPASS_ALPHA_TEST + #elif SHADERPASS == SHADERPASS_GBUFFER + #define SHADERPASS_GBUFFER_BYPASS_ALPHA_TEST + #endif + #endif + #endif + + // Define _DEFERRED_CAPABLE_MATERIAL for shader capable to run in deferred pass + #if defined(SHADER_LIT) && !defined(_SURFACE_TYPE_TRANSPARENT) + #define _DEFERRED_CAPABLE_MATERIAL + #endif + + // Translate transparent motion vector define + #if defined(_TRANSPARENT_WRITES_MOTION_VEC) && defined(_SURFACE_TYPE_TRANSPARENT) + #define _WRITE_TRANSPARENT_MOTION_VECTOR + #endif + + + + + CBUFFER_START(UnityPerMaterial) + float _UseShadowThreshold; + float _BlendMode; + float _EnableBlendModePreserveSpecularLighting; + float _RayTracing; + float _RefractionModel; + + + half4 _Color; + half4 _MainTex_ST, _MainTex_TexelSize; + half _Alpha, _AlphaCutoffValue; + + #if ATLAS_ON + half _MinXUV, _MaxXUV, _MinYUV, _MaxYUV; + #endif + + #if GLOW_ON + half4 _GlowColor; + half _Glow, _GlowGlobal; + #endif + + #if HSV_ON + half _HsvShift, _HsvSaturation, _HsvBright; + #endif + + #if DISTORT_ON + half4 _DistortTex_ST; + half _DistortTexXSpeed, _DistortTexYSpeed, _DistortAmount; + #endif + + #if FADE_ON + half4 _FadeBurnColor, _FadeTex_ST, _FadeBurnTex_ST; + half _FadeAmount, _FadeBurnWidth, _FadeBurnTransition,_FadeBurnGlow; + #endif + + #if OUTBASE_ON + half4 _OutlineColor; + half _OutlineAlpha, _OutlineGlow, _OutlineWidth; + int _OutlinePixelWidth; + #endif + + #if OUTTEX_ON + half4 _OutlineTex_ST; + half _OutlineTexXSpeed, _OutlineTexYSpeed; + #endif + + #if OUTDIST_ON + half4 _OutlineDistortTex_ST; + half _OutlineDistortTexXSpeed, _OutlineDistortTexYSpeed, _OutlineDistortAmount; + #endif + + #if ALPHAOUTLINE_ON + half _AlphaOutlineGlow, _AlphaOutlinePower, _AlphaOutlineMinAlpha, _AlphaOutlineBlend; + half4 _AlphaOutlineColor; + #endif + + #if INNEROUTLINE_ON + half _InnerOutlineThickness, _InnerOutlineAlpha, _InnerOutlineGlow; + half4 _InnerOutlineColor; + #endif + + #if GRADIENT_ON + half _GradBlend, _GradBoostX, _GradBoostY; + half4 _GradTopRightCol, _GradTopLeftCol, _GradBotRightCol, _GradBotLeftCol; + #endif + + #if COLORSWAP_ON + half4 _ColorSwapRed, _ColorSwapGreen, _ColorSwapBlue; + half _ColorSwapRedLuminosity, _ColorSwapGreenLuminosity, _ColorSwapBlueLuminosity, _ColorSwapBlend; + #endif + + #if CHANGECOLOR_ON + half4 _ColorChangeNewCol, _ColorChangeTarget; + half _ColorChangeTolerance, _ColorChangeLuminosity; + #endif + #if CHANGECOLOR2_ON + half4 _ColorChangeNewCol2, _ColorChangeTarget2; + half _ColorChangeTolerance2; + #endif + #if CHANGECOLOR3_ON + half4 _ColorChangeNewCol3, _ColorChangeTarget3; + half _ColorChangeTolerance3; + #endif + + #if COLORRAMP_ON + half _ColorRampLuminosity, _ColorRampBlend; + #endif + + #if HITEFFECT_ON + half4 _HitEffectColor; + half _HitEffectGlow, _HitEffectBlend; + #endif + + #if NEGATIVE_ON + half _NegativeAmount; + #endif + + #if PIXELATE_ON + half _PixelateSize; + #endif + + #if GREYSCALE_ON + half _GreyscaleLuminosity, _GreyscaleBlend; + half4 _GreyscaleTintColor; + #endif + + #if POSTERIZE_ON + half _PosterizeNumColors, _PosterizeGamma; + #endif + + #if BLUR_ON + half _BlurIntensity; + #endif + + #if MOTIONBLUR_ON + half _MotionBlurAngle, _MotionBlurDist; + #endif + + #if GHOST_ON + half _GhostColorBoost, _GhostTransparency, _GhostBlend; + #endif + + #if HOLOGRAM_ON + half _HologramStripesAmount, _HologramMinAlpha, _HologramUnmodAmount, _HologramStripesSpeed, _HologramMaxAlpha, _HologramBlend; + half4 _HologramStripeColor; + #endif + + #if CHROMABERR_ON + half _ChromAberrAmount, _ChromAberrAlpha; + #endif + + #if GLITCH_ON + half _GlitchAmount, _GlitchSize; + #endif + + #if FLICKER_ON + half _FlickerFreq, _FlickerPercent, _FlickerAlpha; + #endif + + #if SHADOW_ON + half _ShadowX, _ShadowY, _ShadowAlpha; + half4 _ShadowColor; + #endif + + #if SHINE_ON + half4 _ShineColor; + half _ShineLocation, _ShineRotate, _ShineWidth, _ShineGlow; + #endif + + #if CONTRAST_ON + half _Contrast, _Brightness; + #endif + + #if OVERLAY_ON + half4 _OverlayTex_ST, _OverlayColor; + half _OverlayGlow, _OverlayBlend, _OverlayTextureScrollXSpeed, _OverlayTextureScrollYSpeed; + #endif + + #if DOODLE_ON + half _HandDrawnAmount, _HandDrawnSpeed; + #endif + + #if WIND_ON + half _GrassSpeed, _GrassWind, _GrassManualAnim, _GrassRadialBend; + #endif + + #if WAVEUV_ON + float _WaveAmount, _WaveSpeed, _WaveStrength, _WaveX, _WaveY; + #endif + + #if ROUNDWAVEUV_ON + half _RoundWaveStrength, _RoundWaveSpeed; + #endif + + #if RECTSIZE_ON + half _RectSize; + #endif + + #if OFFSETUV_ON + half _OffsetUvX, _OffsetUvY; + #endif + + #if CLIPPING_ON + half _ClipUvLeft, _ClipUvRight, _ClipUvUp, _ClipUvDown; + #endif + + #if RADIALCLIPPING_ON + half _RadialStartAngle, _RadialClip, _RadialClip2; + #endif + + #if TEXTURESCROLL_ON + half _TextureScrollXSpeed, _TextureScrollYSpeed; + #endif + + #if ZOOMUV_ON + half _ZoomUvAmount; + #endif + + #if WARP_ON + half _WarpStrength, _WarpSpeed, _WarpScale; + #endif + + #if TWISTUV_ON + half _TwistUvAmount, _TwistUvPosX, _TwistUvPosY, _TwistUvRadius; + #endif + + #if ROTATEUV_ON + half _RotateUvAmount; + #endif + + #if FISHEYE_ON + half _FishEyeUvAmount; + #endif + + #if PINCH_ON + half _PinchUvAmount; + #endif + + #if SHAKEUV_ON + half _ShakeUvSpeed, _ShakeUvX, _ShakeUvY; + #endif + + #if NORMALMAP_ON + half _NormalStrength; + #endif + + float _RandomSeed; + + + + + CBUFFER_END + + + + // -- Property used by ScenePickingPass + #ifdef SCENEPICKINGPASS + float4 _SelectionID; + #endif + + // -- Properties used by SceneSelectionPass + #ifdef SCENESELECTIONPASS + int _ObjectId; + int _PassValue; + #endif + + + // data across stages, stripped like the above. + struct VertexToPixel + { + float4 pos : SV_POSITION; + float3 worldPos : TEXCOORD0; + float3 worldNormal : TEXCOORD1; + float4 worldTangent : TEXCOORD2; + float4 texcoord0 : TEXCOORD3; + float4 texcoord1 : TEXCOORD4; + float4 texcoord2 : TEXCOORD5; + // #if %TEXCOORD3REQUIREKEY% + float4 texcoord3 : TEXCOORD6; + // #endif + + // #if %SCREENPOSREQUIREKEY% + // float4 screenPos : TEXCOORD7; + // #endif + + // #if %VERTEXCOLORREQUIREKEY% + float4 vertexColor : COLOR; + // #endif + + // #if %EXTRAV2F0REQUIREKEY% + // float4 extraV2F0 : TEXCOORD8; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // float4 extraV2F1 : TEXCOORD9; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // float4 extraV2F2 : TEXCOORD10; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // float4 extraV2F3 : TEXCOORD11; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // float4 extraV2F4 : TEXCOORD12; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // float4 extraV2F5 : TEXCOORD13; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // float4 extraV2F6 : TEXCOORD14; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // float4 extraV2F7 : TEXCOORD15; + // #endif + + #if UNITY_ANY_INSTANCING_ENABLED + UNITY_VERTEX_INPUT_INSTANCE_ID + #endif // UNITY_ANY_INSTANCING_ENABLED + + #if _HDRP && (_PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR))) + float4 previousPositionCS : TEXCOORD16; // Contain previous transform position (in case of skinning for example) + float4 motionVectorCS : TEXCOORD17; + #endif + + UNITY_VERTEX_OUTPUT_STEREO + }; + + + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Debug/DebugDisplay.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/Material.hlsl" + #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/NormalSurfaceGradient.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Lighting/Lighting.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Lighting/LightLoop/LightLoopDef.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/Lit/Lit.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Lighting/LightLoop/LightLoop.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/BuiltinUtilities.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/MaterialUtilities.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/Decal/DecalUtilities.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/Lit/LitDecalData.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/ShaderGraphFunctions.hlsl" + + + + + // data describing the user output of a pixel + struct Surface + { + half3 Albedo; + half Height; + half3 Normal; + half Smoothness; + half3 Emission; + half Metallic; + half3 Specular; + half Occlusion; + half SpecularPower; // for simple lighting + half Alpha; + float outputDepth; // if written, SV_Depth semantic is used. ShaderData.clipPos.z is unused value + // HDRP Only + half SpecularOcclusion; + half SubsurfaceMask; + half Thickness; + half CoatMask; + half CoatSmoothness; + half Anisotropy; + half IridescenceMask; + half IridescenceThickness; + int DiffusionProfileHash; + float SpecularAAThreshold; + float SpecularAAScreenSpaceVariance; + // requires _OVERRIDE_BAKEDGI to be defined, but is mapped in all pipelines + float3 DiffuseGI; + float3 BackDiffuseGI; + float3 SpecularGI; + float ior; + float3 transmittanceColor; + float atDistance; + float transmittanceMask; + // requires _OVERRIDE_SHADOWMASK to be defines + float4 ShadowMask; + + // for decals + float NormalAlpha; + float MAOSAlpha; + + + }; + + // Data the user declares in blackboard blocks + struct Blackboard + { + + float blackboardDummyData; + }; + + // data the user might need, this will grow to be big. But easy to strip + struct ShaderData + { + float4 clipPos; // SV_POSITION + float3 localSpacePosition; + float3 localSpaceNormal; + float3 localSpaceTangent; + + float3 worldSpacePosition; + float3 worldSpaceNormal; + float3 worldSpaceTangent; + float tangentSign; + + float3 worldSpaceViewDir; + float3 tangentSpaceViewDir; + + float4 texcoord0; + float4 texcoord1; + float4 texcoord2; + float4 texcoord3; + + float2 screenUV; + float4 screenPos; + + float4 vertexColor; + bool isFrontFace; + + float4 extraV2F0; + float4 extraV2F1; + float4 extraV2F2; + float4 extraV2F3; + float4 extraV2F4; + float4 extraV2F5; + float4 extraV2F6; + float4 extraV2F7; + + float3x3 TBNMatrix; + Blackboard blackboard; + }; + + struct VertexData + { + #if SHADER_TARGET > 30 + // uint vertexID : SV_VertexID; + #endif + float4 vertex : POSITION; + float3 normal : NORMAL; + float4 tangent : TANGENT; + float4 texcoord0 : TEXCOORD0; + + // optimize out mesh coords when not in use by user or lighting system + #if _URP && (_USINGTEXCOORD1 || _PASSMETA || _PASSFORWARD || _PASSGBUFFER) + float4 texcoord1 : TEXCOORD1; + #endif + + #if _URP && (_USINGTEXCOORD2 || _PASSMETA || ((_PASSFORWARD || _PASSGBUFFER) && defined(DYNAMICLIGHTMAP_ON))) + float4 texcoord2 : TEXCOORD2; + #endif + + #if _STANDARD && (_USINGTEXCOORD1 || (_PASSMETA || ((_PASSFORWARD || _PASSGBUFFER || _PASSFORWARDADD) && LIGHTMAP_ON))) + float4 texcoord1 : TEXCOORD1; + #endif + #if _STANDARD && (_USINGTEXCOORD2 || (_PASSMETA || ((_PASSFORWARD || _PASSGBUFFER) && DYNAMICLIGHTMAP_ON))) + float4 texcoord2 : TEXCOORD2; + #endif + + + #if _HDRP + float4 texcoord1 : TEXCOORD1; + float4 texcoord2 : TEXCOORD2; + #endif + + // #if %TEXCOORD3REQUIREKEY% + float4 texcoord3 : TEXCOORD3; + // #endif + + // #if %VERTEXCOLORREQUIREKEY% + float4 vertexColor : COLOR; + // #endif + + #if _PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR)) + float3 previousPositionOS : TEXCOORD4; // Contain previous transform position (in case of skinning for example) + #if defined (_ADD_PRECOMPUTED_VELOCITY) + float3 precomputedVelocity : TEXCOORD5; // Add Precomputed Velocity (Alembic computes velocities on runtime side). + #endif + #endif + + UNITY_VERTEX_INPUT_INSTANCE_ID + }; + + struct TessVertex + { + float4 vertex : INTERNALTESSPOS; + float3 normal : NORMAL; + float4 tangent : TANGENT; + float4 texcoord0 : TEXCOORD0; + float4 texcoord1 : TEXCOORD1; + float4 texcoord2 : TEXCOORD2; + + // #if %TEXCOORD3REQUIREKEY% + float4 texcoord3 : TEXCOORD3; + // #endif + + // #if %VERTEXCOLORREQUIREKEY% + float4 vertexColor : COLOR; + // #endif + + // #if %EXTRAV2F0REQUIREKEY% + // float4 extraV2F0 : TEXCOORD5; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // float4 extraV2F1 : TEXCOORD6; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // float4 extraV2F2 : TEXCOORD7; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // float4 extraV2F3 : TEXCOORD8; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // float4 extraV2F4 : TEXCOORD9; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // float4 extraV2F5 : TEXCOORD10; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // float4 extraV2F6 : TEXCOORD11; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // float4 extraV2F7 : TEXCOORD12; + // #endif + + #if _PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR)) + float3 previousPositionOS : TEXCOORD13; // Contain previous transform position (in case of skinning for example) + #if defined (_ADD_PRECOMPUTED_VELOCITY) + float3 precomputedVelocity : TEXCOORD14; + #endif + #endif + + UNITY_VERTEX_INPUT_INSTANCE_ID + UNITY_VERTEX_OUTPUT_STEREO + }; + + struct ExtraV2F + { + float4 extraV2F0; + float4 extraV2F1; + float4 extraV2F2; + float4 extraV2F3; + float4 extraV2F4; + float4 extraV2F5; + float4 extraV2F6; + float4 extraV2F7; + Blackboard blackboard; + float4 time; + }; + + + float3 WorldToTangentSpace(ShaderData d, float3 normal) + { + return mul(d.TBNMatrix, normal); + } + + float3 TangentToWorldSpace(ShaderData d, float3 normal) + { + return mul(normal, d.TBNMatrix); + } + + // in this case, make standard more like SRPs, because we can't fix + // unity_WorldToObject in HDRP, since it already does macro-fu there + + #if _STANDARD + float3 TransformWorldToObject(float3 p) { return mul(unity_WorldToObject, float4(p, 1)); }; + float3 TransformObjectToWorld(float3 p) { return mul(unity_ObjectToWorld, float4(p, 1)); }; + float4 TransformWorldToObject(float4 p) { return mul(unity_WorldToObject, p); }; + float4 TransformObjectToWorld(float4 p) { return mul(unity_ObjectToWorld, p); }; + float4x4 GetWorldToObjectMatrix() { return unity_WorldToObject; } + float4x4 GetObjectToWorldMatrix() { return unity_ObjectToWorld; } + #if (defined(SHADER_API_D3D11) || defined(SHADER_API_XBOXONE) || defined(UNITY_COMPILER_HLSLCC) || defined(SHADER_API_PSSL) || (SHADER_TARGET_SURFACE_ANALYSIS && !SHADER_TARGET_SURFACE_ANALYSIS_MOJOSHADER)) + #define UNITY_SAMPLE_TEX2D_LOD(tex,coord, lod) tex.SampleLevel (sampler##tex,coord, lod) + #define UNITY_SAMPLE_TEX2D_SAMPLER_LOD(tex,samplertex,coord, lod) tex.SampleLevel (sampler##samplertex,coord, lod) + #else + #define UNITY_SAMPLE_TEX2D_LOD(tex,coord,lod) tex2D (tex,coord,0,lod) + #define UNITY_SAMPLE_TEX2D_SAMPLER_LOD(tex,samplertex,coord,lod) tex2D (tex,coord,0,lod) + #endif + + #undef GetWorldToObjectMatrix() + + #define GetWorldToObjectMatrix() unity_WorldToObject + + + #endif + + float3 GetCameraWorldPosition() + { + #if _HDRP + return GetCameraRelativePositionWS(_WorldSpaceCameraPos); + #else + return _WorldSpaceCameraPos; + #endif + } + + #if _GRABPASSUSED + #if _STANDARD + TEXTURE2D(%GRABTEXTURE%); + SAMPLER(sampler_%GRABTEXTURE%); + #endif + + half3 GetSceneColor(float2 uv) + { + #if _STANDARD + return SAMPLE_TEXTURE2D(%GRABTEXTURE%, sampler_%GRABTEXTURE%, uv).rgb; + #else + return SHADERGRAPH_SAMPLE_SCENE_COLOR(uv); + #endif + } + #endif + + + + #if _STANDARD + UNITY_DECLARE_DEPTH_TEXTURE(_CameraDepthTexture); + float GetSceneDepth(float2 uv) { return SAMPLE_DEPTH_TEXTURE(_CameraDepthTexture, uv); } + float GetLinear01Depth(float2 uv) { return Linear01Depth(GetSceneDepth(uv)); } + float GetLinearEyeDepth(float2 uv) { return LinearEyeDepth(GetSceneDepth(uv)); } + #else + float GetSceneDepth(float2 uv) { return SHADERGRAPH_SAMPLE_SCENE_DEPTH(uv); } + float GetLinear01Depth(float2 uv) { return Linear01Depth(GetSceneDepth(uv), _ZBufferParams); } + float GetLinearEyeDepth(float2 uv) { return LinearEyeDepth(GetSceneDepth(uv), _ZBufferParams); } + #endif + + float3 GetWorldPositionFromDepthBuffer(float2 uv, float3 worldSpaceViewDir) + { + float eye = GetLinearEyeDepth(uv); + float3 camView = mul((float3x3)GetObjectToWorldMatrix(), transpose(mul(GetWorldToObjectMatrix(), UNITY_MATRIX_I_V)) [2].xyz); + + float dt = dot(worldSpaceViewDir, camView); + float3 div = worldSpaceViewDir/dt; + float3 wpos = (eye * div) + GetCameraWorldPosition(); + return wpos; + } + + #if _HDRP + float3 ObjectToWorldSpacePosition(float3 pos) + { + return GetAbsolutePositionWS(TransformObjectToWorld(pos)); + } + #else + float3 ObjectToWorldSpacePosition(float3 pos) + { + return TransformObjectToWorld(pos); + } + #endif + + #if _STANDARD + UNITY_DECLARE_SCREENSPACE_TEXTURE(_CameraDepthNormalsTexture); + float3 GetSceneNormal(float2 uv, float3 worldSpaceViewDir) + { + float4 depthNorms = UNITY_SAMPLE_SCREENSPACE_TEXTURE(_CameraDepthNormalsTexture, uv); + float3 norms = DecodeViewNormalStereo(depthNorms); + norms = mul((float3x3)GetWorldToViewMatrix(), norms) * 0.5 + 0.5; + return norms; + } + #elif _HDRP && !_DECALSHADER + + float3 GetSceneNormal(float2 uv, float3 worldSpaceViewDir) + { + NormalData nd; + DecodeFromNormalBuffer(_ScreenSize.xy * uv, nd); + return nd.normalWS; + } + #elif _URP + #if (SHADER_LIBRARY_VERSION_MAJOR >= 10) + #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/DeclareNormalsTexture.hlsl" + #endif + + float3 GetSceneNormal(float2 uv, float3 worldSpaceViewDir) + { + #if (SHADER_LIBRARY_VERSION_MAJOR >= 10) + return SampleSceneNormals(uv); + #else + float3 wpos = GetWorldPositionFromDepthBuffer(uv, worldSpaceViewDir); + return normalize(-cross(ddx(wpos), ddy(wpos))) * 0.5 + 0.5; + #endif + + } + #endif + + #if _HDRP + + half3 UnpackNormalmapRGorAG(half4 packednormal) + { + // This do the trick + packednormal.x *= packednormal.w; + + half3 normal; + normal.xy = packednormal.xy * 2 - 1; + normal.z = sqrt(1 - saturate(dot(normal.xy, normal.xy))); + return normal; + } + half3 UnpackNormal(half4 packednormal) + { + #if defined(UNITY_NO_DXT5nm) + return packednormal.xyz * 2 - 1; + #else + return UnpackNormalmapRGorAG(packednormal); + #endif + } + #endif + #if _HDRP || _URP + + half3 UnpackScaleNormal(half4 packednormal, half scale) + { + #ifndef UNITY_NO_DXT5nm + // Unpack normal as DXT5nm (1, y, 1, x) or BC5 (x, y, 0, 1) + // Note neutral texture like "bump" is (0, 0, 1, 1) to work with both plain RGB normal and DXT5nm/BC5 + packednormal.x *= packednormal.w; + #endif + half3 normal; + normal.xy = (packednormal.xy * 2 - 1) * scale; + normal.z = sqrt(1 - saturate(dot(normal.xy, normal.xy))); + return normal; + } + + #endif + + + void GetSun(out float3 lightDir, out float3 color) + { + lightDir = float3(0.5, 0.5, 0); + color = 1; + #if _HDRP + if (_DirectionalLightCount > 0) + { + DirectionalLightData light = _DirectionalLightDatas[0]; + lightDir = -light.forward.xyz; + color = light.color; + } + #elif _STANDARD + lightDir = normalize(_WorldSpaceLightPos0.xyz); + color = _LightColor0.rgb; + #elif _URP + Light light = GetMainLight(); + lightDir = light.direction; + color = light.color; + #endif + } + + + + + + + + + + TEXTURE2D(_MainTex); + SAMPLER(sampler_MainTex); + + #if GLOW_ON + TEXTURE2D(_GlowTex); + SAMPLER(sampler_GlowTex); + #endif + + #if FADE_ON + TEXTURE2D(_FadeTex); + SAMPLER(sampler_FadeTex); + + TEXTURE2D(_FadeBurnTex); + SAMPLER(sampler_FadeBurnTex); + #endif + + #if DISTORT_ON + TEXTURE2D(_DistortTex); + SAMPLER(sampler_DistortTex); + #endif + + #if OUTTEX_ON + TEXTURE2D(_OutlineTex); + SAMPLER(sampler_OutlineTex); + #endif + + #if OUTDIST_ON + TEXTURE2D(_OutlineDistortTex); + SAMPLER(sampler_OutlineDistortTex); + #endif + + #if COLORSWAP_ON + TEXTURE2D(_ColorSwapTex); + SAMPLER(sampler_ColorSwapTex); + #endif + + #if COLORRAMP_ON + TEXTURE2D(_ColorRampTex); + TEXTURE2D(_ColorRampTexGradient); + SAMPLER(sampler_ColorRampTex); + SAMPLER(sampler_ColorRampTexGradient); + #endif + + #if SHINE_ON + TEXTURE2D(_ShineMask); + SAMPLER(sampler_ShineMask); + #endif + + #if OVERLAY_ON + TEXTURE2D(_OverlayTex); + SAMPLER(sampler_OverlayTex); + #endif + + #if NORMALMAP_ON + TEXTURE2D(_NormalMap); + SAMPLER(sampler_NormalMap); + #endif + + + half3 GetPixel(in int offsetX, in int offsetY, in half2 uv, in Texture2D _tex, in SamplerState _sampler) + { + half2 _uv = uv + half2(offsetX * _MainTex_TexelSize.x, offsetY * _MainTex_TexelSize.y); + half4 col = SAMPLE_TEXTURE2D(_tex, _sampler, _uv); + return col.rgb; + } + + + //BLURS------------------------------------------------------------------------- + half4 Blur(half2 uv, Texture2D source, SamplerState sampler_source, half Intensity) + { + const half2 texelSize = 1.0 / _ScreenParams.xy; + const half4 color = SAMPLE_TEXTURE2D(source, sampler_source, uv); + const half2 offset = Intensity * texelSize; + + half4 accumulatedColor = color; + half accumulatedWeight = 1.0; + for (int x = -1; x <= 1; x++) + { + for (int y = -1; y <= 1; y++) + { + const half2 sampleUV = uv + half2(x, y) * offset; + const half4 sampleColor = SAMPLE_TEXTURE2D(source, sampler_source, sampleUV); + + accumulatedColor += sampleColor; + accumulatedWeight += 1.0; + } + } + + half4 blurredColor = accumulatedColor / accumulatedWeight; + return blurredColor; + } + + half BlurHD_G(half bhqp, half x) + { + return exp(-(x * x) / (2.0 * bhqp * bhqp)); + } + half4 BlurHD(half2 uv, Texture2D source, SamplerState sampler_source, half BlurAmount, half xScale, half yScale) + { + int iterations = 16; + int halfIterations = iterations / 2; + half sigmaX = 0.1 + BlurAmount * 0.5; + half sigmaY = sigmaX; + half total = 0.0; + half4 ret = half4(0, 0, 0, 0); + for (int iy = 0; iy < iterations; ++iy) + { + half fy = BlurHD_G(sigmaY, half(iy) -half(halfIterations)); + half offsetY = half(iy - halfIterations) * 0.00390625 * xScale; + for (int ix = 0; ix < iterations; ++ix) + { + half fx = BlurHD_G(sigmaX, half(ix) - half(halfIterations)); + half offsetX = half(ix - halfIterations) * 0.00390625 * yScale; + total += fx * fy; + ret += SAMPLE_TEXTURE2D(source, sampler_source, uv + half2(offsetX, offsetY)) * fx * fy; + } + } + return ret / total; + } + //----------------------------------------------------------------------- + + + //------------------------------------------- + half RemapFloat(half inValue, half inMin, half inMax, half outMin, half outMax){ + return outMin + (inValue - inMin) * (outMax - outMin) / (inMax - inMin); + } + //------------------------------------------- + + //----------------------------------------------------------------------- + half rand(half2 seed, half offset) { + return (frac(sin(dot(seed, half2(12.9898, 78.233))) * 43758.5453) + offset) % 1.0; + } + + half rand2(half2 seed, half offset) { + return (frac(sin(dot(seed * floor(50 + (_Time.x % 1.0) * 12.), half2(127.1, 311.7))) * 43758.5453123) + offset) % 1.0; + } + + half rand2CustomTime(half2 seed, half offset, half customTime) { + return (frac(sin(dot(seed * floor(50 + (customTime % 1.0) * 12.), half2(127.1, 311.7))) * 43758.5453123) + offset) % 1.0; + } + //----------------------------------------------------------------------- + + + void Ext_ModifyVertex0 (inout VertexData v, inout ExtraV2F d) + { + //BILBOARD_ON + #if BILBOARD_ON + half3 camRight = mul((half3x3)unity_CameraToWorld, half3(1,0,0)); + half3 camUp = half3(0,1,0); + #if BILBOARDY_ON + camUp = mul((half3x3)unity_CameraToWorld, half3(0,1,0)); + #endif + half3 localPos = v.vertex.x * camRight + v.vertex.y * camUp; + v.vertex = half4(localPos, 1); + #endif + //----------------------------------------------------------- + + v.texcoord0.xy = TRANSFORM_TEX(v.texcoord0.xy, _MainTex); + half2 center = half2(0.5, 0.5); + #if ATLAS_ON + center = half2((_MaxXUV + _MinXUV) / 2.0, (_MaxYUV + _MinYUV) / 2.0); + #endif + + //POLARUV_ON + #if POLARUV_ON + v.texcoord0.xy = v.texcoord0.xy - center; + #endif + + //---------------------------------------- + + //ROTATEUV_ON + #if ROTATEUV_ON + half2 uvC = v.texcoord0.xy; + half cosAngle = cos(_RotateUvAmount); + half sinAngle = sin(_RotateUvAmount); + half2x2 rot = half2x2(cosAngle, -sinAngle, sinAngle, cosAngle); + uvC -= center; + v.texcoord0.xy = mul(rot, uvC); + v.texcoord0.xy += center; + #endif + //-------------------- + + #if RECTSIZE_ON + v.vertex.xyz += (v.vertex.xyz * (_RectSize - 1.0)); + #endif + + #if OUTTEX_ON + v.texcoord1.xy = TRANSFORM_TEX(v.texcoord0.xy, _OutlineTex); + #endif + + #if OUTDIST_ON + v.texcoord2.xy = TRANSFORM_TEX(v.texcoord0.xy, _OutlineDistortTex); + #endif + + #if DISTORT_ON + v.texcoord3.xy = TRANSFORM_TEX(v.texcoord0.xy, _DistortTex); + #endif + } + + void Ext_SurfaceFunction0 (inout Surface o, ShaderData d) + { + half randomSeed = _RandomSeed; + + float2 uvRect = d.texcoord0; + half2 center = half2(0.5, 0.5); + #if ATLAS_ON + center = half2((_MaxXUV + _MinXUV) / 2.0, (_MaxYUV + _MinYUV) / 2.0); + uvRect = half2((d.texcoord0.x - _MinXUV) / (_MaxXUV - _MinXUV), (d.texcoord0.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half2 centerTiled = half2(center.x * _MainTex_ST.x, center.y * _MainTex_ST.y); + + //CLIPPING_ON + #if CLIPPING_ON + half2 tiledUv = half2(d.texcoord0.x / _MainTex_ST.x, d.texcoord0.y / _MainTex_ST.y); + #if ATLAS_ON + tiledUv = half2((tiledUv.x - _MinXUV) / (_MaxXUV - _MinXUV), (tiledUv.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + clip((1 - _ClipUvUp) - tiledUv.y); + clip(tiledUv.y - _ClipUvDown); + clip((1 - _ClipUvRight) - tiledUv.x); + clip(tiledUv.x - _ClipUvLeft); + #endif + //---------------------------------- + + //RADIALCLIPPING_ON + #if RADIALCLIPPING_ON + half2 tiledUv2 = half2(d.texcoord0.x / _MainTex_ST.x, d.texcoord0.y / _MainTex_ST.y); + #if ATLAS_ON + tiledUv2 = half2((tiledUv2.x - _MinXUV) / (_MaxXUV - _MinXUV), (tiledUv2.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half startAngle = _RadialStartAngle - _RadialClip; + half endAngle = _RadialStartAngle + _RadialClip2; + half offset0 = clamp(0, 360, startAngle + 360); + half offset360 = clamp(0, 360, endAngle - 360); + half2 atan2Coord = half2(lerp(-1, 1, tiledUv2.x), lerp(-1, 1, tiledUv2.y)); + half atanAngle = atan2(atan2Coord.y, atan2Coord.x) * 57.3; // angle in degrees + if(atanAngle < 0) atanAngle = 360 + atanAngle; + if(atanAngle >= startAngle && atanAngle <= endAngle) discard; + if(atanAngle <= offset360) discard; + if(atanAngle >= offset0) discard; + #endif + + //----------------------------- + + //TEXTURESCROLL_ON && ATLAS_ON + #if TEXTURESCROLL_ON && ATLAS_ON + d.texcoord0.xy = half2(_MinXUV + ((_MaxXUV - _MinXUV) * (abs(((_Time.y + randomSeed) * _TextureScrollXSpeed) + uvRect.x) % 1)), + _MinYUV + ((_MaxYUV - _MinYUV) * (abs(((_Time.y + randomSeed) * _TextureScrollYSpeed) + uvRect.y) % 1))); + #endif + //---------------------------- + + //OFFSETUV_ON + #if OFFSETUV_ON + #if ATLAS_ON + d.texcoord0.xy = half2(_MinXUV + ((_MaxXUV - _MinXUV) * (abs((_OffsetUvX + uvRect.x) % 1))), + _MinYUV + ((_MaxYUV - _MinYUV) * (abs(_OffsetUvY + uvRect.y) % 1))); + #else + d.texcoord0.xy += half2(_OffsetUvX, _OffsetUvY); + #endif + #endif + + //---------------------- + + //POLARUV_ON + #if POLARUV_ON + d.texcoord0.xy = half2(atan2(d.texcoord0.y, d.texcoord0.x) / (2.0f * 3.141592653589f), length(d.texcoord0.xy)); + d.texcoord0.xy *= _MainTex_ST.xy; + #endif + + //-------------------------------------- + + //TWISTUV_ON + #if TWISTUV_ON + #if ATLAS_ON + _TwistUvPosX = ((_MaxXUV - _MinXUV) * _TwistUvPosX) + _MinXUV; + _TwistUvPosY = ((_MaxYUV - _MinYUV) * _TwistUvPosY) + _MinYUV; + #endif + half2 tempUv = d.texcoord0.xy - half2(_TwistUvPosX * _MainTex_ST.x, _TwistUvPosY * _MainTex_ST.y); + _TwistUvRadius *= (_MainTex_ST.x + _MainTex_ST.y) / 2; + half percent = (_TwistUvRadius - length(tempUv)) / _TwistUvRadius; + half theta = percent * percent * (2.0 * sin(_TwistUvAmount)) * 8.0; + half s = sin(theta); + half c = cos(theta); + half beta = max(sign(_TwistUvRadius - length(tempUv)), 0.0); + tempUv = half2(dot(tempUv, half2(c, -s)), dot(tempUv, half2(s, c))) * beta + tempUv * (1 - beta); + tempUv += half2(_TwistUvPosX * _MainTex_ST.x, _TwistUvPosY * _MainTex_ST.y); + d.texcoord0.xy = tempUv; + #endif + + //-------------------------------------------- + + //FISHEYE_ON + #if FISHEYE_ON + half bind = length(centerTiled); + half2 dF = d.texcoord0.xy - centerTiled; + half dFlen = length(dF); + half fishInt = (3.14159265359 / bind) * (_FishEyeUvAmount + 0.001); + d.texcoord0.xy = centerTiled + (dF / (max(0.0001, dFlen))) * tan(dFlen * fishInt) * bind / tan(bind * fishInt); + #endif + //--------------------------------------------- + + //PINCH_ON + #if PINCH_ON + half2 dP = d.texcoord0.xy - centerTiled; + half pinchInt = (3.141592 / length(centerTiled)) * (-_PinchUvAmount + 0.001); + d.texcoord0.xy = centerTiled + normalize(dP) * atan(length(dP) * -pinchInt * 10.0) * 0.5 / atan(-pinchInt * 5); + #endif + + //--------------------------------------------- + + //ZOOMUV_ON + #if ZOOMUV_ON + d.texcoord0.xy -= centerTiled; + d.texcoord0.xy = d.texcoord0.xy * _ZoomUvAmount; + d.texcoord0.xy += centerTiled; + #endif + + //----------------------------------------------- + + //DOODLE_ON + #if DOODLE_ON + half2 uvCopy = uvRect; + _HandDrawnSpeed = (floor((_Time.x + randomSeed) * 20 * _HandDrawnSpeed) / _HandDrawnSpeed) * _HandDrawnSpeed; + uvCopy.x = sin((uvCopy.x * _HandDrawnAmount + _HandDrawnSpeed) * 4); + uvCopy.y = cos((uvCopy.y * _HandDrawnAmount + _HandDrawnSpeed) * 4); + d.texcoord0.xy = lerp(d.texcoord0.xy, d.texcoord0.xy + uvCopy, 0.0005 * _HandDrawnAmount); + #endif + + //-------------------------- + + //SHAKEUV_ON + #if SHAKEUV_ON + half xShake = sin((_Time.x + randomSeed) * _ShakeUvSpeed * 50) * _ShakeUvX; + half yShake = cos((_Time.x + randomSeed) * _ShakeUvSpeed * 50) * _ShakeUvY; + d.texcoord0.xy += half2(xShake * 0.012, yShake * 0.01); + #endif + + //------------------------------------------- + + //RECTSIZE_ON + #if RECTSIZE_ON + d.texcoord0.xy = d.texcoord0.xy * (_RectSize).xx + (((-_RectSize * 0.5) + 0.5)).xx; + #endif + + //------------------------------------------- + + //DISTORT_ON + #if DISTORT_ON + #if ATLAS_ON + d.texcoord3.x = d.texcoord3.x * (1 / (_MaxXUV - _MinXUV)); + d.texcoord3.y = d.texcoord3.y * (1 / (_MaxYUV - _MinYUV)); + #endif + + d.texcoord3.x += ((_Time.x + _RandomSeed) * _DistortTexXSpeed) % 1; + d.texcoord3.y += ((_Time.x + _RandomSeed) * _DistortTexYSpeed) % 1; + half distortAmnt = (SAMPLE_TEXTURE2D(_DistortTex, sampler_DistortTex, d.texcoord3.xy).r - 0.5) * 0.2 * _DistortAmount; + d.texcoord0.x += distortAmnt; + d.texcoord0.y += distortAmnt; + #endif + //------------------------------------------------------- + + //WARP_ON + #if WARP_ON + half2 warpUv = half2(d.texcoord0.x / _MainTex_ST.x, d.texcoord0.y / _MainTex_ST.y); + #if ATLAS_ON + warpUv = half2((warpUv.x - _MinXUV) / (_MaxXUV - _MinXUV), (warpUv.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + const float tau = 6.283185307179586; + float xWarp = (_Time.y + randomSeed) * _WarpSpeed + warpUv.x * tau / _WarpScale; + float yWarp = (_Time.y + randomSeed) * _WarpSpeed + warpUv.y * tau / _WarpScale; + float2 warp = float2(sin(xWarp), sin(yWarp)) * _WarpStrength; + d.texcoord0.xy += warp; + #endif + + //------------------------------------------------------- + + //WAVEUV_ON + #if WAVEUV_ON + float2 uvWave = half2(_WaveX * _MainTex_ST.x, _WaveY * _MainTex_ST.y) - d.texcoord0.xy; + uvWave %= 1; + #if ATLAS_ON + uvWave = half2(_WaveX, _WaveY) - uvRect; + #endif + uvWave.x *= _ScreenParams.x / _ScreenParams.y; + float waveTime = _Time.y + randomSeed; + float angWave = (sqrt(dot(uvWave, uvWave)) * _WaveAmount) - ((waveTime * _WaveSpeed)); + d.texcoord0.xy = d.texcoord0.xy + uvWave * sin(angWave) * (_WaveStrength / 1000.0); + #endif + //---------------------------------------------------- + + //ROUNDWAVEUV_ON + #if ROUNDWAVEUV_ON + half xWave = ((0.5 * _MainTex_ST.x) - uvRect.x); + half yWave = ((0.5 * _MainTex_ST.y) - uvRect.y) * (_MainTex_TexelSize.w / _MainTex_TexelSize.z); + half ripple = -sqrt(xWave*xWave + yWave* yWave); + d.texcoord0.xy += (sin((ripple + (_Time.y + randomSeed) * (_RoundWaveSpeed/10.0)) / 0.015) * (_RoundWaveStrength/10.0)) % 1; + #endif + //---------------------------------------------------- + + + //WIND_ON + #if WIND_ON + half windOffset = sin((_Time.x + randomSeed) * _GrassSpeed * 10); + half2 windCenter = half2(0.5, 0.1); + #if ATLAS_ON + windCenter.x = ((_MaxXUV - _MinXUV) * windCenter.x) + _MinXUV; + windCenter.y = ((_MaxYUV - _MinYUV) * windCenter.y) + _MinYUV; + #endif + #if !MANUALWIND_ON + d.texcoord0.x = fmod(abs(lerp(d.texcoord0.x, d.texcoord0.x + (_GrassWind * 0.01 * windOffset), uvRect.y)), 1); + #else + d.texcoord0.x = fmod(abs(lerp(d.texcoord0.x, d.texcoord0.x + (_GrassWind * 0.01 * _GrassManualAnim), uvRect.y)), 1); + windOffset = _GrassManualAnim; + #endif + half2 delta = d.texcoord0.xy - windCenter; + half delta2 = dot(delta.xy, delta.xy); + half2 delta_offset = delta2 * windOffset; + d.texcoord0.xy = d.texcoord0.xy + half2(delta.y, -delta.x) * delta_offset * _GrassRadialBend; + #endif + + //-------------------------------------------------------- + + //TEXTURESCROLL_ON && !ATLAS_ON + #if TEXTURESCROLL_ON && !ATLAS_ON + d.texcoord0.x += ((_Time.y + randomSeed) * _TextureScrollXSpeed) % 1; + d.texcoord0.y += ((_Time.y + randomSeed) * _TextureScrollYSpeed) % 1; + #endif + //------------------------------ + + //PIXELATE_ON + #if PIXELATE_ON + half aspectRatio = _MainTex_TexelSize.x / _MainTex_TexelSize.y; + half2 pixelSize = float2(_PixelateSize, _PixelateSize * aspectRatio); + d.texcoord0.xy = floor(d.texcoord0.xy * pixelSize) / pixelSize; + #endif + //-------------- + + half4 col = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy); + half originalAlpha = col.a; + col *= d.vertexColor; + + //NORMAL MAP + #if NORMALMAP_ON + half4 normalSample = SAMPLE_TEXTURE2D(_NormalMap, sampler_NormalMap, d.texcoord0.xy); + half3 normalTS = UnpackNormal(normalSample); + normalTS.xy *= _NormalStrength; + o.Normal = normalTS; + #endif + + + //GLITCH_ON + #if GLITCH_ON + half2 uvGlitch = uvRect; + uvGlitch.y -= 0.5; + half lineNoise = pow(rand2(floor(uvGlitch * half2(24., 19.) * _GlitchSize) * 4.0, randomSeed), 3.0) * _GlitchAmount + * pow(rand2(floor(uvGlitch * half2(38., 14.) * _GlitchSize) * 4.0, randomSeed), 3.0); + col = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(lineNoise * 0.02 * rand2(half2(2.0, 1), randomSeed), 0)) * d.vertexColor; + #endif + //-------------------------------------- + + //CHROMABERR_ON + #if CHROMABERR_ON + half4 r = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(_ChromAberrAmount/10, 0)) * d.vertexColor; + half4 b = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(-_ChromAberrAmount/10, 0)) * d.vertexColor; + col = half4(r.r * r.a, col.g, b.b * b.a, max(max(r.a, b.a) * _ChromAberrAlpha, col.a)); + #endif + + //-------------------------------- + + //BLUR_ON + #if BLUR_ON + #if ATLAS_ON + #if !BLURISHD_ON + col = BlurHD(d.texcoord0.xy, _MainTex, sampler_MainTex, _BlurIntensity, (_MaxXUV - _MinXUV), (_MaxYUV - _MinYUV)) * d.vertexColor; + #else + col = Blur(d.texcoord0.xy, _MainTex, sampler_MainTex, _BlurIntensity * (_MaxXUV - _MinXUV)) * d.vertexColor; + #endif + #else + #if !BLURISHD_ON + col = BlurHD(d.texcoord0.xy, _MainTex, sampler_MainTex, _BlurIntensity, 1, 1) * d.vertexColor; + #else + col = Blur(d.texcoord0.xy, _MainTex, sampler_MainTex, _BlurIntensity) * d.vertexColor; + #endif + #endif + #endif + + //-------------------- + + //MOTIONBLUR_ON + #if MOTIONBLUR_ON + _MotionBlurAngle = _MotionBlurAngle * 3.1415926; + #define rot(n) mul(n, half2x2(cos(_MotionBlurAngle), -sin(_MotionBlurAngle), sin(_MotionBlurAngle), cos(_MotionBlurAngle))) + _MotionBlurDist = _MotionBlurDist * 0.005; + #if ATLAS_ON + _MotionBlurDist *= (_MaxXUV - _MinXUV); + #endif + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(-_MotionBlurDist, -_MotionBlurDist))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(-_MotionBlurDist * 2, -_MotionBlurDist * 2))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(-_MotionBlurDist * 3, -_MotionBlurDist * 3))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(-_MotionBlurDist * 4, -_MotionBlurDist * 4))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(_MotionBlurDist, _MotionBlurDist))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(_MotionBlurDist * 2, _MotionBlurDist * 2))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(_MotionBlurDist * 3, _MotionBlurDist * 3))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(_MotionBlurDist * 4, _MotionBlurDist * 4))); + col.rgb = col.rgb / 9; + #endif + //------------------------------------ + + //NEGATIVE_ON + #if NEGATIVE_ON + col.rgb = lerp(col.rgb, 1 - col.rgb, _NegativeAmount); + #endif + + //-------------- + half luminance = 0; + + //GREYSCALE_ON && !GREYSCALEOUTLINE_ON + #if GREYSCALE_ON && !GREYSCALEOUTLINE_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + luminance = saturate(luminance + _GreyscaleLuminosity); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _GreyscaleTintColor, _GreyscaleBlend); + #endif + //------------------------------------ + + //GHOST_ON + #if GHOST_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + half4 ghostResult; + ghostResult.a = saturate(luminance - _GhostTransparency) * col.a; + ghostResult.rgb = col.rgb * (luminance + _GhostColorBoost); + col = lerp(col, ghostResult, _GhostBlend); + #endif + //------------------------------------ + + //INNEROUTLINE_ON + #if INNEROUTLINE_ON + half3 innerT = abs(GetPixel(0, _InnerOutlineThickness, d.texcoord0.xy, _MainTex, sampler_MainTex) - GetPixel(0, -_InnerOutlineThickness, d.texcoord0.xy, _MainTex, sampler_MainTex)); + innerT += abs(GetPixel(_InnerOutlineThickness, 0, d.texcoord0.xy, _MainTex, sampler_MainTex) - GetPixel(-_InnerOutlineThickness, 0, d.texcoord0.xy, _MainTex, sampler_MainTex)); + #if !ONLYINNEROUTLINE_ON + innerT = (innerT / 2.0) * col.a * _InnerOutlineAlpha; + col.rgb += length(innerT) * _InnerOutlineColor.rgb * _InnerOutlineGlow; + #else + innerT *= col.a * _InnerOutlineAlpha; + col.rgb = length(innerT) * _InnerOutlineColor.rgb * _InnerOutlineGlow; + col.a = step(0.3, col.r+col.g+col.b); + #endif + #endif + //------------------------------------------------------- + + //HITEFFECT_ON + #if HITEFFECT_ON + col.rgb = lerp(col.rgb, _HitEffectColor.rgb * _HitEffectGlow, _HitEffectBlend); + #endif + //-------------------- + + //GRADIENT_ON + #if GRADIENT_ON + half2 tiledUvGrad = half2(uvRect.x / _MainTex_ST.x, uvRect.y / _MainTex_ST.y); + #if GRADIENT2COL_ON + _GradTopRightCol = _GradTopLeftCol; + _GradBotRightCol = _GradBotLeftCol; + #endif + #if RADIALGRADIENT_ON + half radialDist = 1 - length(tiledUvGrad - half2(0.5, 0.5)); + radialDist *= (_MainTex_TexelSize.w / _MainTex_TexelSize.z); + radialDist = saturate(_GradBoostX * radialDist); + half4 gradientResult = lerp(_GradTopLeftCol, _GradBotLeftCol, radialDist); + #else + half gradXLerpFactor = saturate(pow(tiledUvGrad.x, _GradBoostX)); + half4 gradientResult = lerp(lerp(_GradBotLeftCol, _GradBotRightCol, gradXLerpFactor), + lerp(_GradTopLeftCol, _GradTopRightCol, gradXLerpFactor), saturate(pow(tiledUvGrad.y, _GradBoostY))); + #endif + gradientResult = lerp(col, gradientResult, _GradBlend); + col.rgb = gradientResult.rgb * col.a; + col.a *= gradientResult.a; + #endif + //-------------------------------------------------------------------- + + //CONTRAST_ON + #if CONTRAST_ON + col.rgb = (col.rgb - float3(0.5, 0.5, 0.5)) * _Contrast + float3(0.5, 0.5, 0.5); + col.rgb += _Brightness; + #endif + + //------------------------------------------------------------------- + + //COLORSWAP_ON + #if COLORSWAP_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + half4 swapMask = SAMPLE_TEXTURE2D(_ColorSwapTex, sampler_ColorSwapTex, d.texcoord0.xy); + swapMask.rgb *= swapMask.a; + half3 redSwap = _ColorSwapRed * swapMask.r * saturate(luminance + _ColorSwapRedLuminosity); + half3 greenSwap = _ColorSwapGreen * swapMask.g * saturate(luminance + _ColorSwapGreenLuminosity); + half3 blueSwap = _ColorSwapBlue * swapMask.b * saturate(luminance + _ColorSwapBlueLuminosity); + swapMask.rgb = col.rgb * saturate(1 - swapMask.r - swapMask.g - swapMask.b); + col.rgb = lerp(col.rgb, swapMask.rgb + redSwap + greenSwap + blueSwap, _ColorSwapBlend); + #endif + //-------------------------------------------------------------------- + + //COLORRAMP_ON && !COLORRAMPOUTLINE_ON + #if COLORRAMP_ON && !COLORRAMPOUTLINE_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + luminance = saturate(luminance + _ColorRampLuminosity); + #if GRADIENTCOLORRAMP_ON + col.rgb = lerp(col.rgb, SAMPLE_TEXTURE2D(_ColorRampTexGradient, sampler_ColorRampTexGradient, half2(luminance, 0)).rgb, _ColorRampBlend); + #else + col.rgb = lerp(col.rgb, SAMPLE_TEXTURE2D(_ColorRampTex, sampler_ColorRampTex, half2(luminance, 0)).rgb, _ColorRampBlend); + #endif + #endif + //-------------------------------------------------------------------- + + //CHANGECOLOR_ON + #if CHANGECOLOR_ON + float3 currChangeColor = saturate(col.rgb); + luminance = 0.3 * currChangeColor.r + 0.59 * currChangeColor.g + 0.11 * currChangeColor.b; + luminance = saturate(luminance + _ColorChangeLuminosity); + half3 dif = abs(currChangeColor - _ColorChangeTarget.rgb); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _ColorChangeNewCol.rgb, + max(sign(1 - saturate(dif.x + dif.y + dif.z) - _ColorChangeTolerance), 0.0)); + #if CHANGECOLOR2_ON + dif = abs(currChangeColor - _ColorChangeTarget2.rgb); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _ColorChangeNewCol2.rgb, + max(sign(1 - saturate(dif.x + dif.y + dif.z) - _ColorChangeTolerance2), 0.0)); + #endif + #if CHANGECOLOR3_ON + dif = abs(currChangeColor - _ColorChangeTarget3.rgb); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _ColorChangeNewCol3.rgb, + max(sign(1 - saturate(dif.x + dif.y + dif.z) - _ColorChangeTolerance3), 0.0)); + #endif + #endif + //------------------------------------------------------- + + //POSTERIZE_ON && !POSTERIZEOUTLINE_ON + #if POSTERIZE_ON && !POSTERIZEOUTLINE_ON + col.rgb = pow(col.rgb, _PosterizeGamma) * _PosterizeNumColors; + col.rgb = floor(col.rgb) / _PosterizeNumColors; + col.rgb = pow(col.rgb, 1.0 / _PosterizeGamma); + #endif + //------------------------------------ + + //HSV_ON + #if HSV_ON + half3 resultHsv = half3(col.rgb); + half cosHsv = _HsvBright * _HsvSaturation * cos(_HsvShift * 3.14159265 / 180); + half sinHsv = _HsvBright * _HsvSaturation * sin(_HsvShift * 3.14159265 / 180); + resultHsv.x = (.299 * _HsvBright + .701 * cosHsv + .168 * sinHsv) * col.x + + (.587 * _HsvBright - .587 * cosHsv + .330 * sinHsv) * col.y + + (.114 * _HsvBright - .114 * cosHsv - .497 * sinHsv) * col.z; + resultHsv.y = (.299 * _HsvBright - .299 * cosHsv - .328 * sinHsv) *col.x + + (.587 * _HsvBright + .413 * cosHsv + .035 * sinHsv) * col.y + + (.114 * _HsvBright - .114 * cosHsv + .292 * sinHsv) * col.z; + resultHsv.z = (.299 * _HsvBright - .3 * cosHsv + 1.25 * sinHsv) * col.x + + (.587 * _HsvBright - .588 * cosHsv - 1.05 * sinHsv) * col.y + + (.114 * _HsvBright + .886 * cosHsv - .203 * sinHsv) * col.z; + col.rgb = resultHsv; + #endif + //------------------------------------------------------- + + //OVERLAY_ON + #if OVERLAY_ON + half2 overlayUvs = d.texcoord0.xy; + overlayUvs.x += ((_Time.y + randomSeed) * _OverlayTextureScrollXSpeed) % 1; + overlayUvs.y += ((_Time.y + randomSeed) * _OverlayTextureScrollYSpeed) % 1; + half4 overlayCol = SAMPLE_TEXTURE2D(_OverlayTex, sampler_OverlayTex, TRANSFORM_TEX(overlayUvs, _OverlayTex)); + overlayCol.rgb *= _OverlayColor.rgb * _OverlayGlow; + #if !OVERLAYMULT_ON + overlayCol.rgb *= overlayCol.a * _OverlayColor.rgb * _OverlayColor.a * _OverlayBlend; + col.rgb += overlayCol.rgb; + #else + overlayCol.a *= _OverlayColor.a; + col = lerp(col, col * overlayCol, _OverlayBlend); + #endif + #endif + + //--------------------------------- + + //OUTBASE_ON + #if OUTBASE_ON + #if OUTBASEPIXELPERF_ON + half2 destUv = half2(_OutlinePixelWidth * _MainTex_TexelSize.x, _OutlinePixelWidth * _MainTex_TexelSize.y); + #else + half2 destUv = half2(_OutlineWidth * _MainTex_TexelSize.x * 200, _OutlineWidth * _MainTex_TexelSize.y * 200); + #endif + + #if OUTDIST_ON + d.texcoord3.x += ((_Time.x + _RandomSeed) * _OutlineDistortTexXSpeed) % 1; + d.texcoord3.y += ((_Time.x + _RandomSeed) * _OutlineDistortTexYSpeed) % 1; + #if ATLAS_ON + d.texcoord3 = half2((d.texcoord3.x - _MinXUV) / (_MaxXUV - _MinXUV), (d.texcoord3.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half outDistortAmnt = (SAMPLE_TEXTURE2D(_OutlineDistortTex, sampler_OutlineDistortTex, d.texcoord3).r - 0.5) * 0.2 * _OutlineDistortAmount; + destUv.x += outDistortAmnt; + destUv.y += outDistortAmnt; + #endif + + half spriteLeft = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(destUv.x, 0)).a; + half spriteRight = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy - half2(destUv.x, 0)).a; + half spriteBottom = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(0, destUv.y)).a; + half spriteTop = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy - half2(0, destUv.y)).a; + half result = spriteLeft + spriteRight + spriteBottom + spriteTop; + + #if OUTBASE8DIR_ON + half spriteTopLeft = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(destUv.x, destUv.y)).a; + half spriteTopRight = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(-destUv.x, destUv.y)).a; + half spriteBotLeft = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(destUv.x, -destUv.y)).a; + half spriteBotRight = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(-destUv.x, -destUv.y)).a; + result = result + spriteTopLeft + spriteTopRight + spriteBotLeft + spriteBotRight; + #endif + + result = step(0.05, saturate(result)); + + #if OUTTEX_ON + d.texcoord1.x += ((_Time.x + _RandomSeed) * _OutlineTexXSpeed) % 1; + d.texcoord1.y += ((_Time.x + _RandomSeed) * _OutlineTexYSpeed) % 1; + #if ATLAS_ON + d.texcoord1 = half2((d.texcoord1.x - _MinXUV) / (_MaxXUV - _MinXUV), (d.texcoord1.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half4 tempOutColor = SAMPLE_TEXTURE2D(_OutlineTex, sampler_OutlineTex, d.texcoord1); + tempOutColor *= _OutlineColor; + _OutlineColor = tempOutColor; + #endif + + result *= (1 - originalAlpha) * _OutlineAlpha; + + half4 outline = _OutlineColor * d.vertexColor.a; + outline.rgb *= _OutlineGlow; + outline.a = result; + #if ONLYOUTLINE_ON + col = outline; + #else + col = lerp(col, outline, result); + #endif + #endif + //------------------------------------------------------- + + //FADE_ON + #if FADE_ON + half2 tiledUvFade1 = TRANSFORM_TEX(d.texcoord0, _FadeTex); + half2 tiledUvFade2 = TRANSFORM_TEX(d.texcoord0, _FadeBurnTex); + #if ATLAS_ON + tiledUvFade1 = half2((tiledUvFade1.x - _MinXUV) / (_MaxXUV - _MinXUV), (tiledUvFade1.y - _MinYUV) / (_MaxYUV - _MinYUV)); + tiledUvFade2 = half2((tiledUvFade2.x - _MinXUV) / (_MaxXUV - _MinXUV), (tiledUvFade2.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half fadeTemp = SAMPLE_TEXTURE2D(_FadeTex, sampler_FadeTex, tiledUvFade1).r; + half fade = smoothstep(_FadeAmount, _FadeAmount + _FadeBurnTransition, fadeTemp); + half fadeBurn = saturate(smoothstep(_FadeAmount - _FadeBurnWidth, _FadeAmount - _FadeBurnWidth + 0.1, fadeTemp) * _FadeAmount); + col.a *= fade; + _FadeBurnColor.rgb *= _FadeBurnGlow; + col += fadeBurn * SAMPLE_TEXTURE2D(_FadeBurnTex, sampler_FadeBurnTex, tiledUvFade2) * _FadeBurnColor * originalAlpha * (1 - col.a); + #endif + //------------------------------------------------------- + + //SHADOW_ON + #if SHADOW_ON + half shadowA = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(_ShadowX, _ShadowY)).a; + half preMultShadowMask = 1 - (saturate(shadowA - col.a) * (1 - col.a)); + col.rgb *= 1 - ((shadowA - col.a) * (1 - col.a)); + col.rgb += (_ShadowColor * shadowA) * (1 - col.a); + col.a = max(shadowA * _ShadowAlpha * d.vertexColor.a, col.a); + #endif + + //------------------------------------------------------- + + //GLOW_ON + #if GLOW_ON + half4 emission; + #if GLOWTEX_ON + emission = SAMPLE_TEXTURE2D(_GlowTex, sampler_GlowTex, d.texcoord0); + #else + emission = col; + #endif + + col.rgb *= _GlowGlobal; + emission.rgb *= emission.a * col.a * _Glow * _GlowColor; + col.rgb += emission.rgb; + #endif + //------------------------------------------------------- + + //COLORRAMP_ON && COLORRAMPOUTLINE_ON + #if COLORRAMP_ON && COLORRAMPOUTLINE_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + luminance = saturate(luminance + _ColorRampLuminosity); + #if GRADIENTCOLORRAMP_ON + col.rgb = lerp(col.rgb, SAMPLE_TEXTURE2D(_ColorRampTexGradient, sampler_ColorRampTexGradient, half2(luminance, 0)).rgb, _ColorRampBlend); + #else + col.rgb = lerp(col.rgb, SAMPLE_TEXTURE2D(_ColorRampTex, sampler_ColorRampTex, half2(luminance, 0)).rgb, _ColorRampBlend); + #endif + #endif + //--------------- + + //GREYSCALE_ON && GREYSCALEOUTLINE_ON + #if GREYSCALE_ON && GREYSCALEOUTLINE_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + luminance = saturate(luminance + _GreyscaleLuminosity); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _GreyscaleTintColor, _GreyscaleBlend); + #endif + + //----------------------------------- + + //POSTERIZE_ON && POSTERIZEOUTLINE_ON + #if POSTERIZE_ON && POSTERIZEOUTLINE_ON + col.rgb = pow(col.rgb, _PosterizeGamma) * _PosterizeNumColors; + col.rgb = floor(col.rgb) / _PosterizeNumColors; + col.rgb = pow(col.rgb, 1.0 / _PosterizeGamma); + #endif + + //----------------------------------- + + //SHINE_ON + #if SHINE_ON + half2 uvShine = uvRect; + half cosAngle = cos(_ShineRotate); + half sinAngle = sin(_ShineRotate); + half2x2 rot = half2x2(cosAngle, -sinAngle, sinAngle, cosAngle); + uvShine -= half2(0.5, 0.5); + uvShine = mul(rot, uvShine); + uvShine += half2(0.5, 0.5); + half shineMask = SAMPLE_TEXTURE2D(_ShineMask, sampler_ShineMask, d.texcoord0.xy).a; + half currentDistanceProjection = (uvShine.x + uvShine.y) / 2; + half whitePower = 1 - (abs(currentDistanceProjection - _ShineLocation) / _ShineWidth); + col.rgb += col.a * whitePower * _ShineGlow * max(sign(currentDistanceProjection - (_ShineLocation - _ShineWidth)), 0.0) + * max(sign((_ShineLocation + _ShineWidth) - currentDistanceProjection), 0.0) * _ShineColor * shineMask; + #endif + + //----------------------------------- + + //HOLOGRAM_ON + #if HOLOGRAM_ON + half totalHologram = _HologramStripesAmount + _HologramUnmodAmount; + half hologramYCoord = ((uvRect.y + (((_Time.x + randomSeed) % 1) * _HologramStripesSpeed)) % totalHologram) / totalHologram; + hologramYCoord = abs(hologramYCoord); + half alpha = RemapFloat(saturate(hologramYCoord - (_HologramUnmodAmount/totalHologram)), 0.0, 1.0, _HologramMinAlpha, saturate(_HologramMaxAlpha)); + half hologramMask = max(sign((_HologramUnmodAmount/totalHologram) - hologramYCoord), 0.0); + half4 hologramResult = col; + hologramResult.a *= lerp(alpha, 1, hologramMask); + hologramResult.rgb *= max(1, _HologramMaxAlpha * max(sign(hologramYCoord - (_HologramUnmodAmount/totalHologram)), 0.0)); + hologramMask = 1 - step(0.01,hologramMask); + hologramResult.rgb += hologramMask * _HologramStripeColor * col.a; + col = lerp(col, hologramResult, _HologramBlend); + #endif + + //----------------------------------- + + //FLICKER_ON + #if FLICKER_ON + col.a *= saturate(col.a * step(frac(0.05 + (_Time.w + randomSeed) * _FlickerFreq), 1 - _FlickerPercent) + _FlickerAlpha); + #endif + //----------------------------------- + + //ALPHACUTOFF_ON + + //ALPHAROUND_ON + + //ALPHAOUTLINE_ON + #if ALPHAOUTLINE_ON + half alphaOutlineRes = pow(1 - col.a, max(_AlphaOutlinePower, 0.0001)) * step(_AlphaOutlineMinAlpha, col.a) * _AlphaOutlineBlend; + col.rgb = lerp(col.rgb, _AlphaOutlineColor.rgb * _AlphaOutlineGlow, alphaOutlineRes); + col.a = lerp(col.a, 1, alphaOutlineRes > 1); + #endif + //------------------------------------------------------- + + //FOG_ON + + //------------------ + + col *= _Color; + o.Albedo = col; + col.a *= _Alpha; + clip(col.a - _AlphaCutoffValue - 0.01); + o.Alpha = _Color.a; + } + + + + + + void ChainSurfaceFunction(inout Surface l, inout ShaderData d) + { + Ext_SurfaceFunction0(l, d); + // Ext_SurfaceFunction1(l, d); + // Ext_SurfaceFunction2(l, d); + // Ext_SurfaceFunction3(l, d); + // Ext_SurfaceFunction4(l, d); + // Ext_SurfaceFunction5(l, d); + // Ext_SurfaceFunction6(l, d); + // Ext_SurfaceFunction7(l, d); + // Ext_SurfaceFunction8(l, d); + // Ext_SurfaceFunction9(l, d); + // Ext_SurfaceFunction10(l, d); + // Ext_SurfaceFunction11(l, d); + // Ext_SurfaceFunction12(l, d); + // Ext_SurfaceFunction13(l, d); + // Ext_SurfaceFunction14(l, d); + // Ext_SurfaceFunction15(l, d); + // Ext_SurfaceFunction16(l, d); + // Ext_SurfaceFunction17(l, d); + // Ext_SurfaceFunction18(l, d); + // Ext_SurfaceFunction19(l, d); + // Ext_SurfaceFunction20(l, d); + // Ext_SurfaceFunction21(l, d); + // Ext_SurfaceFunction22(l, d); + // Ext_SurfaceFunction23(l, d); + // Ext_SurfaceFunction24(l, d); + // Ext_SurfaceFunction25(l, d); + // Ext_SurfaceFunction26(l, d); + // Ext_SurfaceFunction27(l, d); + // Ext_SurfaceFunction28(l, d); + // Ext_SurfaceFunction29(l, d); + } + +#if !_DECALSHADER + + void ChainModifyVertex(inout VertexData v, inout VertexToPixel v2p, float4 time) + { + ExtraV2F d; + + ZERO_INITIALIZE(ExtraV2F, d); + ZERO_INITIALIZE(Blackboard, d.blackboard); + // due to motion vectors in HDRP, we need to use the last + // time in certain spots. So if you are going to use _Time to adjust vertices, + // you need to use this time or motion vectors will break. + d.time = time; + + Ext_ModifyVertex0(v, d); + // Ext_ModifyVertex1(v, d); + // Ext_ModifyVertex2(v, d); + // Ext_ModifyVertex3(v, d); + // Ext_ModifyVertex4(v, d); + // Ext_ModifyVertex5(v, d); + // Ext_ModifyVertex6(v, d); + // Ext_ModifyVertex7(v, d); + // Ext_ModifyVertex8(v, d); + // Ext_ModifyVertex9(v, d); + // Ext_ModifyVertex10(v, d); + // Ext_ModifyVertex11(v, d); + // Ext_ModifyVertex12(v, d); + // Ext_ModifyVertex13(v, d); + // Ext_ModifyVertex14(v, d); + // Ext_ModifyVertex15(v, d); + // Ext_ModifyVertex16(v, d); + // Ext_ModifyVertex17(v, d); + // Ext_ModifyVertex18(v, d); + // Ext_ModifyVertex19(v, d); + // Ext_ModifyVertex20(v, d); + // Ext_ModifyVertex21(v, d); + // Ext_ModifyVertex22(v, d); + // Ext_ModifyVertex23(v, d); + // Ext_ModifyVertex24(v, d); + // Ext_ModifyVertex25(v, d); + // Ext_ModifyVertex26(v, d); + // Ext_ModifyVertex27(v, d); + // Ext_ModifyVertex28(v, d); + // Ext_ModifyVertex29(v, d); + + + // #if %EXTRAV2F0REQUIREKEY% + // v2p.extraV2F0 = d.extraV2F0; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // v2p.extraV2F1 = d.extraV2F1; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // v2p.extraV2F2 = d.extraV2F2; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // v2p.extraV2F3 = d.extraV2F3; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // v2p.extraV2F4 = d.extraV2F4; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // v2p.extraV2F5 = d.extraV2F5; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // v2p.extraV2F6 = d.extraV2F6; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // v2p.extraV2F7 = d.extraV2F7; + // #endif + } + + void ChainModifyTessellatedVertex(inout VertexData v, inout VertexToPixel v2p) + { + ExtraV2F d; + ZERO_INITIALIZE(ExtraV2F, d); + ZERO_INITIALIZE(Blackboard, d.blackboard); + + // #if %EXTRAV2F0REQUIREKEY% + // d.extraV2F0 = v2p.extraV2F0; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // d.extraV2F1 = v2p.extraV2F1; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // d.extraV2F2 = v2p.extraV2F2; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // d.extraV2F3 = v2p.extraV2F3; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // d.extraV2F4 = v2p.extraV2F4; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // d.extraV2F5 = v2p.extraV2F5; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // d.extraV2F6 = v2p.extraV2F6; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // d.extraV2F7 = v2p.extraV2F7; + // #endif + + + // Ext_ModifyTessellatedVertex0(v, d); + // Ext_ModifyTessellatedVertex1(v, d); + // Ext_ModifyTessellatedVertex2(v, d); + // Ext_ModifyTessellatedVertex3(v, d); + // Ext_ModifyTessellatedVertex4(v, d); + // Ext_ModifyTessellatedVertex5(v, d); + // Ext_ModifyTessellatedVertex6(v, d); + // Ext_ModifyTessellatedVertex7(v, d); + // Ext_ModifyTessellatedVertex8(v, d); + // Ext_ModifyTessellatedVertex9(v, d); + // Ext_ModifyTessellatedVertex10(v, d); + // Ext_ModifyTessellatedVertex11(v, d); + // Ext_ModifyTessellatedVertex12(v, d); + // Ext_ModifyTessellatedVertex13(v, d); + // Ext_ModifyTessellatedVertex14(v, d); + // Ext_ModifyTessellatedVertex15(v, d); + // Ext_ModifyTessellatedVertex16(v, d); + // Ext_ModifyTessellatedVertex17(v, d); + // Ext_ModifyTessellatedVertex18(v, d); + // Ext_ModifyTessellatedVertex19(v, d); + // Ext_ModifyTessellatedVertex20(v, d); + // Ext_ModifyTessellatedVertex21(v, d); + // Ext_ModifyTessellatedVertex22(v, d); + // Ext_ModifyTessellatedVertex23(v, d); + // Ext_ModifyTessellatedVertex24(v, d); + // Ext_ModifyTessellatedVertex25(v, d); + // Ext_ModifyTessellatedVertex26(v, d); + // Ext_ModifyTessellatedVertex27(v, d); + // Ext_ModifyTessellatedVertex28(v, d); + // Ext_ModifyTessellatedVertex29(v, d); + + // #if %EXTRAV2F0REQUIREKEY% + // v2p.extraV2F0 = d.extraV2F0; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // v2p.extraV2F1 = d.extraV2F1; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // v2p.extraV2F2 = d.extraV2F2; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // v2p.extraV2F3 = d.extraV2F3; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // v2p.extraV2F4 = d.extraV2F4; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // v2p.extraV2F5 = d.extraV2F5; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // v2p.extraV2F6 = d.extraV2F6; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // v2p.extraV2F7 = d.extraV2F7; + // #endif + } + + void ChainFinalColorForward(inout Surface l, inout ShaderData d, inout half4 color) + { + // Ext_FinalColorForward0(l, d, color); + // Ext_FinalColorForward1(l, d, color); + // Ext_FinalColorForward2(l, d, color); + // Ext_FinalColorForward3(l, d, color); + // Ext_FinalColorForward4(l, d, color); + // Ext_FinalColorForward5(l, d, color); + // Ext_FinalColorForward6(l, d, color); + // Ext_FinalColorForward7(l, d, color); + // Ext_FinalColorForward8(l, d, color); + // Ext_FinalColorForward9(l, d, color); + // Ext_FinalColorForward10(l, d, color); + // Ext_FinalColorForward11(l, d, color); + // Ext_FinalColorForward12(l, d, color); + // Ext_FinalColorForward13(l, d, color); + // Ext_FinalColorForward14(l, d, color); + // Ext_FinalColorForward15(l, d, color); + // Ext_FinalColorForward16(l, d, color); + // Ext_FinalColorForward17(l, d, color); + // Ext_FinalColorForward18(l, d, color); + // Ext_FinalColorForward19(l, d, color); + // Ext_FinalColorForward20(l, d, color); + // Ext_FinalColorForward21(l, d, color); + // Ext_FinalColorForward22(l, d, color); + // Ext_FinalColorForward23(l, d, color); + // Ext_FinalColorForward24(l, d, color); + // Ext_FinalColorForward25(l, d, color); + // Ext_FinalColorForward26(l, d, color); + // Ext_FinalColorForward27(l, d, color); + // Ext_FinalColorForward28(l, d, color); + // Ext_FinalColorForward29(l, d, color); + } + + void ChainFinalGBufferStandard(inout Surface s, inout ShaderData d, inout half4 GBuffer0, inout half4 GBuffer1, inout half4 GBuffer2, inout half4 outEmission, inout half4 outShadowMask) + { + // Ext_FinalGBufferStandard0(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard1(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard2(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard3(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard4(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard5(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard6(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard7(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard8(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard9(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard10(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard11(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard12(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard13(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard14(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard15(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard16(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard17(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard18(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard19(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard20(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard21(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard22(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard23(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard24(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard25(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard26(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard27(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard28(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard29(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + } +#endif + + + + + +#if _DECALSHADER + + ShaderData CreateShaderData(SurfaceDescriptionInputs IN) + { + ShaderData d = (ShaderData)0; + d.TBNMatrix = float3x3(IN.WorldSpaceTangent, IN.WorldSpaceBiTangent, IN.WorldSpaceNormal); + d.worldSpaceNormal = IN.WorldSpaceNormal; + d.worldSpaceTangent = IN.WorldSpaceTangent; + + d.worldSpacePosition = IN.WorldSpacePosition; + d.texcoord0 = IN.uv0.xyxy; + d.screenPos = IN.ScreenPosition; + + d.worldSpaceViewDir = normalize(_WorldSpaceCameraPos - d.worldSpacePosition); + + d.tangentSpaceViewDir = mul(d.TBNMatrix, d.worldSpaceViewDir); + + // these rarely get used, so we back transform them. Usually will be stripped. + #if _HDRP + // d.localSpacePosition = mul(GetWorldToObjectMatrix(), float4(GetCameraRelativePositionWS(d.worldSpacePosition), 1)).xyz; + #else + // d.localSpacePosition = mul(GetWorldToObjectMatrix(), float4(d.worldSpacePosition, 1)).xyz; + #endif + // d.localSpaceNormal = normalize(mul((float3x3)GetWorldToObjectMatrix(), d.worldSpaceNormal)); + // d.localSpaceTangent = normalize(mul((float3x3)GetWorldToObjectMatrix(), d.worldSpaceTangent.xyz)); + + // #if %SCREENPOSREQUIREKEY% + // d.screenUV = (IN.ScreenPosition.xy / max(0.01, IN.ScreenPosition.w)); + // #endif + + return d; + } +#else + + ShaderData CreateShaderData(VertexToPixel i + #if NEED_FACING + , bool facing + #endif + ) + { + ShaderData d = (ShaderData)0; + d.clipPos = i.pos; + d.worldSpacePosition = i.worldPos; + + d.worldSpaceNormal = normalize(i.worldNormal); + d.worldSpaceTangent.xyz = normalize(i.worldTangent.xyz); + + d.tangentSign = i.worldTangent.w * unity_WorldTransformParams.w; + float3 bitangent = cross(d.worldSpaceTangent.xyz, d.worldSpaceNormal) * d.tangentSign; + + d.TBNMatrix = float3x3(d.worldSpaceTangent, -bitangent, d.worldSpaceNormal); + d.worldSpaceViewDir = normalize(_WorldSpaceCameraPos - i.worldPos); + + d.tangentSpaceViewDir = mul(d.TBNMatrix, d.worldSpaceViewDir); + d.texcoord0 = i.texcoord0; + d.texcoord1 = i.texcoord1; + d.texcoord2 = i.texcoord2; + + // #if %TEXCOORD3REQUIREKEY% + d.texcoord3 = i.texcoord3; + // #endif + + // d.isFrontFace = facing; + // #if %VERTEXCOLORREQUIREKEY% + d.vertexColor = i.vertexColor; + // #endif + + // these rarely get used, so we back transform them. Usually will be stripped. + #if _HDRP + // d.localSpacePosition = mul(GetWorldToObjectMatrix(), float4(GetCameraRelativePositionWS(i.worldPos), 1)).xyz; + #else + // d.localSpacePosition = mul(GetWorldToObjectMatrix(), float4(i.worldPos, 1)).xyz; + #endif + // d.localSpaceNormal = normalize(mul((float3x3)GetWorldToObjectMatrix(), i.worldNormal)); + // d.localSpaceTangent = normalize(mul((float3x3)GetWorldToObjectMatrix(), i.worldTangent.xyz)); + + // #if %SCREENPOSREQUIREKEY% + // d.screenPos = i.screenPos; + // d.screenUV = (i.screenPos.xy / i.screenPos.w); + // #endif + + + // #if %EXTRAV2F0REQUIREKEY% + // d.extraV2F0 = i.extraV2F0; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // d.extraV2F1 = i.extraV2F1; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // d.extraV2F2 = i.extraV2F2; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // d.extraV2F3 = i.extraV2F3; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // d.extraV2F4 = i.extraV2F4; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // d.extraV2F5 = i.extraV2F5; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // d.extraV2F6 = i.extraV2F6; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // d.extraV2F7 = i.extraV2F7; + // #endif + + return d; + } + +#endif + + + +#if (SHADERPASS == SHADERPASS_LIGHT_TRANSPORT) + + // This was not in constant buffer in original unity, so keep outiside. But should be in as ShaderRenderPass frequency + float unity_OneOverOutputBoost; + float unity_MaxOutputValue; + + CBUFFER_START(UnityMetaPass) + // x = use uv1 as raster position + // y = use uv2 as raster position + bool4 unity_MetaVertexControl; + + // x = return albedo + // y = return normal + bool4 unity_MetaFragmentControl; + CBUFFER_END + + VertexToPixel Vert(VertexData inputMesh) + { + VertexToPixel output; + ZERO_INITIALIZE(VertexToPixel, output); + UNITY_SETUP_INSTANCE_ID(inputMesh); + UNITY_TRANSFER_INSTANCE_ID(inputMesh, output); + UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(output); + + // Output UV coordinate in vertex shader + float2 uv = float2(0.0, 0.0); + + if (unity_MetaVertexControl.x) + { + uv = inputMesh.texcoord1.xy * unity_LightmapST.xy + unity_LightmapST.zw; + } + else if (unity_MetaVertexControl.y) + { + uv = inputMesh.texcoord2.xy * unity_DynamicLightmapST.xy + unity_DynamicLightmapST.zw; + } + + // OpenGL right now needs to actually use the incoming vertex position + // so we create a fake dependency on it here that haven't any impact. + output.pos = float4(uv * 2.0 - 1.0, inputMesh.vertex.z > 0 ? 1.0e-4 : 0.0, 1.0); + + output.worldPos = TransformObjectToWorld(inputMesh.vertex.xyz).xyz; + + // Normal is required for triplanar mapping + output.worldNormal = TransformObjectToWorldNormal(inputMesh.normal); + // Not required but assign to silent compiler warning + output.worldTangent = float4(1.0, 0.0, 0.0, 0.0); + + output.texcoord0 = inputMesh.texcoord0; + output.texcoord1 = inputMesh.texcoord1; + output.texcoord2 = inputMesh.texcoord2; + // #if %TEXCOORD3REQUIREKEY% + output.texcoord3 = inputMesh.texcoord3; + // #endif + // #if %VERTEXCOLORREQUIREKEY% + output.vertexColor = inputMesh.vertexColor; + // #endif + + return output; + } +#else + + #if (_PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR))) + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/ShaderVariablesMatrixDefsHDCamera.hlsl" + + void MotionVectorPositionZBias(VertexToPixel input) + { + #if UNITY_REVERSED_Z + input.pos.z -= unity_MotionVectorsParams.z * input.pos.w; + #else + input.pos.z += unity_MotionVectorsParams.z * input.pos.w; + #endif + } + + #endif + + VertexToPixel Vert(VertexData input) + { + VertexToPixel output; + ZERO_INITIALIZE(VertexToPixel, output); + + UNITY_SETUP_INSTANCE_ID(input); + UNITY_TRANSFER_INSTANCE_ID(input, output); + UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(output); + + #if _HDRP && (_PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR))) + VertexData previousMesh = input; + #endif + + ChainModifyVertex(input, output, _Time); + + // This return the camera relative position (if enable) + float3 positionRWS = TransformObjectToWorld(input.vertex.xyz); + float3 normalWS = TransformObjectToWorldNormal(input.normal); + float4 tangentWS = float4(TransformObjectToWorldDir(input.tangent.xyz), input.tangent.w); + + + output.worldPos = GetAbsolutePositionWS(positionRWS); + output.pos = TransformWorldToHClip(positionRWS); + output.worldNormal = normalWS; + output.worldTangent = tangentWS; + + + output.texcoord0 = input.texcoord0; + output.texcoord1 = input.texcoord1; + output.texcoord2 = input.texcoord2; + + // #if %TEXCOORD3REQUIREKEY% + output.texcoord3 = input.texcoord3; + // #endif + + // #if %VERTEXCOLORREQUIREKEY% + output.vertexColor = input.vertexColor; + // #endif + + // #if %SCREENPOSREQUIREKEY% + // output.screenPos = ComputeScreenPos(output.pos, _ProjectionParams.x); + // #endif + + #if _HDRP && (_PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR))) + + #if !defined(TESSELLATION_ON) + MotionVectorPositionZBias(output); + #endif + + output.motionVectorCS = mul(UNITY_MATRIX_UNJITTERED_VP, float4(positionRWS.xyz, 1.0)); + // Note: unity_MotionVectorsParams.y is 0 is forceNoMotion is enabled + bool forceNoMotion = unity_MotionVectorsParams.y == 0.0; + if (forceNoMotion) + { + output.previousPositionCS = float4(0.0, 0.0, 0.0, 1.0); + } + else + { + bool hasDeformation = unity_MotionVectorsParams.x > 0.0; // Skin or morph target + + float3 effectivePositionOS = (hasDeformation ? previousMesh.previousPositionOS : previousMesh.vertex.xyz); + #if defined(_ADD_PRECOMPUTED_VELOCITY) + effectivePositionOS -= input.precomputedVelocity; + #endif + + previousMesh.vertex = float4(effectivePositionOS, 1); + VertexToPixel dummy = (VertexToPixel)0; + + + ChainModifyVertex(previousMesh, dummy, _LastTimeParameters); + + // we might need this for skinned objects? + //float3 normalWS = TransformPreviousObjectToWorldNormal(input.normal).xyz; + float3 previousPositionRWS = TransformPreviousObjectToWorld(previousMesh.vertex.xyz); + + #ifdef _WRITE_TRANSPARENT_MOTION_VECTOR + if (_TransparentCameraOnlyMotionVectors > 0) + { + previousPositionRWS = positionRWS.xyz; + } + #endif // _WRITE_TRANSPARENT_MOTION_VECTOR + + output.previousPositionCS = mul(UNITY_MATRIX_PREV_VP, float4(previousPositionRWS, 1.0)); + } + #endif // _HDRP && _PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR)) + + + return output; + } + + +#endif + + + + + + + + #if defined(WRITE_DECAL_BUFFER) && !defined(_DISABLE_DECALS) + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/Decal/DecalPrepassBuffer.hlsl" + #endif + + FragInputs BuildFragInputs(VertexToPixel input) + { + UNITY_SETUP_INSTANCE_ID(input); + FragInputs output; + ZERO_INITIALIZE(FragInputs, output); + + // Init to some default value to make the computer quiet (else it output 'divide by zero' warning even if value is not used). + // TODO: this is a really poor workaround, but the variable is used in a bunch of places + // to compute normals which are then passed on elsewhere to compute other values... + output.tangentToWorld = k_identity3x3; + output.positionSS = input.pos; // input.positionCS is SV_Position + // BETTER SHADERS: because we transform world position into actual world space for things like + // triplanar, etc, we have to back transform it here for lighting + output.positionRWS = GetCameraRelativePositionWS(input.worldPos); + output.tangentToWorld = BuildTangentToWorld(input.worldTangent, input.worldNormal); + output.texCoord0 = input.texcoord0; + output.texCoord1 = input.texcoord1; + output.texCoord2 = input.texcoord2; + + return output; + } + +#if UNITY_VERSION > UNITY_2022_3_12 + void ApplyDecalAndGetNormal(FragInputs fragInputs, PositionInputs posInput, Surface surfaceDescription, float3 normalTS, + inout SurfaceData surfaceData) + { + float3 doubleSidedConstants = GetDoubleSidedConstants(); + + #ifdef DECAL_NORMAL_BLENDING + // SG nodes don't ouptut surface gradients, so if decals require surf grad blending, we have to convert + // the normal to gradient before applying the decal. We then have to resolve the gradient back to world space + normalTS = SurfaceGradientFromTangentSpaceNormalAndFromTBN(normalTS, + fragInputs.tangentToWorld[0], fragInputs.tangentToWorld[1]); + + + #if HAVE_DECALS + if (_EnableDecals) + { + float alpha = 1.0; + alpha = surfaceDescription.Alpha; + + DecalSurfaceData decalSurfaceData = GetDecalSurfaceData(posInput, fragInputs, alpha); + ApplyDecalToSurfaceNormal(decalSurfaceData, fragInputs.tangentToWorld[2], normalTS); + ApplyDecalToSurfaceDataNoNormal(decalSurfaceData, surfaceData); + } + #endif + + GetNormalWS_SG(fragInputs, normalTS, surfaceData.normalWS, doubleSidedConstants); + #else + // normal delivered to master node + + #if HAVE_DECALS + if (_EnableDecals) + { + float alpha = 1.0; + alpha = surfaceDescription.Alpha; + + // Both uses and modifies 'surfaceData.normalWS'. + DecalSurfaceData decalSurfaceData = GetDecalSurfaceData(posInput, fragInputs, alpha); + ApplyDecalToSurfaceNormal(decalSurfaceData, surfaceData.normalWS.xyz); + ApplyDecalToSurfaceDataNoNormal(decalSurfaceData, surfaceData); + } + #endif + #endif + } +#endif + + void BuildSurfaceData(FragInputs fragInputs, inout Surface surfaceDescription, float3 V, PositionInputs posInput, out SurfaceData surfaceData, out float3 bentNormalWS) + { + // setup defaults -- these are used if the graph doesn't output a value + ZERO_INITIALIZE(SurfaceData, surfaceData); + + // specularOcclusion need to be init ahead of decal to quiet the compiler that modify the SurfaceData struct + // however specularOcclusion can come from the graph, so need to be init here so it can be override. + surfaceData.specularOcclusion = 1.0; + + // copy across graph values, if defined + surfaceData.baseColor = surfaceDescription.Albedo; + surfaceData.perceptualSmoothness = surfaceDescription.Smoothness; + surfaceData.ambientOcclusion = surfaceDescription.Occlusion; + surfaceData.specularOcclusion = surfaceDescription.SpecularOcclusion; + surfaceData.metallic = surfaceDescription.Metallic; + surfaceData.subsurfaceMask = surfaceDescription.SubsurfaceMask; + surfaceData.thickness = surfaceDescription.Thickness; + surfaceData.diffusionProfileHash = asuint(surfaceDescription.DiffusionProfileHash); + #if _USESPECULAR + surfaceData.specularColor = surfaceDescription.Specular; + #endif + surfaceData.coatMask = surfaceDescription.CoatMask; + surfaceData.anisotropy = surfaceDescription.Anisotropy; + surfaceData.iridescenceMask = surfaceDescription.IridescenceMask; + surfaceData.iridescenceThickness = surfaceDescription.IridescenceThickness; + + + + #if defined(_REFRACTION_PLANE) || defined(_REFRACTION_SPHERE) || defined(_REFRACTION_THIN) + if (_EnableSSRefraction) + { + surfaceData.transmittanceMask = (1.0 - surfaceDescription.Alpha); + surfaceDescription.Alpha = 1.0; + } + else + { + surfaceData.ior = surfaceDescription.ior; + surfaceData.transmittanceColor = surfaceDescription.transmittanceColor; + surfaceData.atDistance = surfaceDescription.atDistance; + surfaceData.transmittanceMask = surfaceDescription.transmittanceMask; + surfaceDescription.Alpha = 1.0; + } + #else + surfaceData.ior = 1.0; + surfaceData.transmittanceColor = float3(1.0, 1.0, 1.0); + surfaceData.atDistance = 1.0; + surfaceData.transmittanceMask = 0.0; + #endif + + + + // These static material feature allow compile time optimization + surfaceData.materialFeatures = MATERIALFEATUREFLAGS_LIT_STANDARD; + #ifdef _MATERIAL_FEATURE_SUBSURFACE_SCATTERING + surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_SUBSURFACE_SCATTERING; + #endif + + #ifdef _MATERIAL_FEATURE_TRANSMISSION + surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_TRANSMISSION; + #endif + + #ifdef _MATERIAL_FEATURE_ANISOTROPY + surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_ANISOTROPY; + surfaceData.normalWS = float3(0, 1, 0); + #endif + + #ifdef _MATERIAL_FEATURE_IRIDESCENCE + surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_IRIDESCENCE; + #endif + + #ifdef _MATERIAL_FEATURE_SPECULAR_COLOR + surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_SPECULAR_COLOR; + #endif + + #if defined(_MATERIAL_FEATURE_CLEAR_COAT) || _CLEARCOAT + surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_CLEAR_COAT; + #endif + + #if defined (_MATERIAL_FEATURE_SPECULAR_COLOR) && defined (_ENERGY_CONSERVING_SPECULAR) + // Require to have setup baseColor + // Reproduce the energy conservation done in legacy Unity. Not ideal but better for compatibility and users can unchek it + surfaceData.baseColor *= (1.0 - Max3(surfaceData.specularColor.r, surfaceData.specularColor.g, surfaceData.specularColor.b)); + #endif + + float3 normalTS = surfaceDescription.Normal; + #if !_WORLDSPACENORMAL + surfaceData.normalWS = mul(surfaceDescription.Normal, fragInputs.tangentToWorld); + #else + normalTS = mul(fragInputs.tangentToWorld, surfaceDescription.Normal); + surfaceData.normalWS = surfaceDescription.Normal; + #endif + + + #if UNITY_VERSION > UNITY_2022_3_12 + ApplyDecalAndGetNormal(fragInputs, posInput, surfaceDescription, normalTS, surfaceData); + #else + #ifdef DECAL_NORMAL_BLENDING + #if HAVE_DECALS + float alpha = 1.0; + alpha = surfaceDescription.Alpha; + if (_EnableDecals) + { + DecalSurfaceData decalSurfaceData = GetDecalSurfaceData(posInput, fragInputs, alpha); + ApplyDecalToSurfaceData(decalSurfaceData, fragInputs.tangentToWorld[2], surfaceData, normalTS); + } + #endif + #else + #if HAVE_DECALS + if (_EnableDecals) + { + float alpha = 1.0; + alpha = surfaceDescription.Alpha; + // Both uses and modifies 'surfaceData.normalWS'. + DecalSurfaceData decalSurfaceData = GetDecalSurfaceData(posInput, fragInputs, alpha); + ApplyDecalToSurfaceData(decalSurfaceData, fragInputs.tangentToWorld[2], surfaceData); + } + #endif + #endif + #endif + + + + surfaceData.geomNormalWS = fragInputs.tangentToWorld[2]; + + surfaceData.tangentWS = normalize(fragInputs.tangentToWorld[0].xyz); // The tangent is not normalize in tangentToWorld for mikkt. TODO: Check if it expected that we normalize with Morten. Tag: SURFACE_GRADIENT + + + bentNormalWS = surfaceData.normalWS; + + surfaceData.tangentWS = Orthonormalize(surfaceData.tangentWS, surfaceData.normalWS); + + #ifdef DEBUG_DISPLAY + if (_DebugMipMapMode != DEBUGMIPMAPMODE_NONE) + { + // TODO: need to update mip info + surfaceData.metallic = 0; + } + + // We need to call ApplyDebugToSurfaceData after filling the surfarcedata and before filling builtinData + // as it can modify attribute use for static lighting + ApplyDebugToSurfaceData(fragInputs.tangentToWorld, surfaceData); + #endif + + // By default we use the ambient occlusion with Tri-ace trick (apply outside) for specular occlusion. + // If user provide bent normal then we process a better term + #if defined(_SPECULAR_OCCLUSION_CUSTOM) + // Just use the value passed through via the slot (not active otherwise) + #elif defined(_SPECULAR_OCCLUSION_FROM_AO_BENT_NORMAL) + // If we have bent normal and ambient occlusion, process a specular occlusion + surfaceData.specularOcclusion = GetSpecularOcclusionFromBentAO(V, bentNormalWS, surfaceData.normalWS, surfaceData.ambientOcclusion, PerceptualSmoothnessToPerceptualRoughness(surfaceData.perceptualSmoothness)); + #elif defined(_AMBIENT_OCCLUSION) && defined(_SPECULAR_OCCLUSION_FROM_AO) + surfaceData.specularOcclusion = GetSpecularOcclusionFromAmbientOcclusion(ClampNdotV(dot(surfaceData.normalWS, V)), surfaceData.ambientOcclusion, PerceptualSmoothnessToRoughness(surfaceData.perceptualSmoothness)); + #endif + + #if defined(_ENABLE_GEOMETRIC_SPECULAR_AA) && !defined(SHADER_STAGE_RAY_TRACING) + surfaceData.perceptualSmoothness = GeometricNormalFiltering(surfaceData.perceptualSmoothness, fragInputs.tangentToWorld[2], surfaceDescription.SpecularAAScreenSpaceVariance, surfaceDescription.SpecularAAThreshold); + #endif + } + + void GetSurfaceAndBuiltinData(VertexToPixel m2ps, FragInputs fragInputs, float3 V, inout PositionInputs posInput, + out SurfaceData surfaceData, out BuiltinData builtinData, inout Surface l, inout ShaderData d + #if NEED_FACING + , bool facing + #endif + ) + { + // Removed since crossfade does not work, probably needs extra material setup. + //#if !defined(SHADER_STAGE_RAY_TRACING) && !defined(_TESSELLATION_DISPLACEMENT) + // #ifdef LOD_FADE_CROSSFADE // enable dithering LOD transition if user select CrossFade transition in LOD group + // LODDitheringTransition(ComputeFadeMaskSeed(V, posInput.positionSS), unity_LODFade.x); + // #endif + //#endif + + + + + d = CreateShaderData(m2ps + #if NEED_FACING + , facing + #endif + ); + + l = (Surface)0; + + l.Albedo = half3(0.5, 0.5, 0.5); + l.Normal = float3(0,0,1); + l.Occlusion = 1; + l.Alpha = 1; + l.SpecularOcclusion = 1; + + #if !defined(SHADER_STAGE_RAY_TRACING) && defined(_DEPTHOFFSET_ON) + l.outputDepth = d.clipPos.z; + #endif + + ChainSurfaceFunction(l, d); + + #if !defined(SHADER_STAGE_RAY_TRACING) && defined(_DEPTHOFFSET_ON) + posInput.deviceDepth = l.outputDepth; + #endif + + #if _UNLIT + //l.Emission = l.Albedo; + //l.Albedo = 0; + l.Normal = half3(0,0,1); + l.Occlusion = 1; + l.Metallic = 0; + l.Specular = 0; + #endif + + surfaceData.geomNormalWS = d.worldSpaceNormal; + surfaceData.tangentWS = d.worldSpaceTangent; + fragInputs.tangentToWorld = d.TBNMatrix; + + float3 bentNormalWS; + + BuildSurfaceData(fragInputs, l, V, posInput, surfaceData, bentNormalWS); + + + float4 lightmapTexCoord1 = fragInputs.texCoord1; + float4 lightmapTexCoord2 = fragInputs.texCoord2; + //#ifdef FRAG_INPUTS_USE_TEXCOORD1 + // float4 lightmapTexCoord1 = fragInputs.texCoord1; + // #else + // float4 lightmapTexCoord1 = float4(0,0,0,0); + // #endif + + // #ifdef FRAG_INPUTS_USE_TEXCOORD2 + // float4 lightmapTexCoord2 = fragInputs.texCoord2; + // #else + // float4 lightmapTexCoord2 = float4(0,0,0,0); + // #endif + + + InitBuiltinData(posInput, l.Alpha, bentNormalWS, -d.worldSpaceNormal, lightmapTexCoord1, lightmapTexCoord2, builtinData); + + + + builtinData.emissiveColor = l.Emission; + + #if defined(_OVERRIDE_BAKEDGI) + builtinData.bakeDiffuseLighting = l.DiffuseGI; + builtinData.backBakeDiffuseLighting = l.BackDiffuseGI; + builtinData.emissiveColor += l.SpecularGI; + #endif + + #if defined(_OVERRIDE_SHADOWMASK) + builtinData.shadowMask0 = l.ShadowMask.x; + builtinData.shadowMask1 = l.ShadowMask.y; + builtinData.shadowMask2 = l.ShadowMask.z; + builtinData.shadowMask3 = l.ShadowMask.w; + #endif + + #ifdef UNITY_VIRTUAL_TEXTURING + //builtinData.vtPackedFeedback = surfaceData.VTPackedFeedback; + #endif + + #if (SHADERPASS == SHADERPASS_DISTORTION) + builtinData.distortion = surfaceData.Distortion; + builtinData.distortionBlur = surfaceData.DistortionBlur; + #endif + + #ifndef SHADER_UNLIT + // PostInitBuiltinData call ApplyDebugToBuiltinData + PostInitBuiltinData(V, posInput, surfaceData, builtinData); + #else + ApplyDebugToBuiltinData(builtinData); + #endif + + RAY_TRACING_OPTIONAL_ALPHA_TEST_PASS + } + + + + #ifdef UNITY_VIRTUAL_TEXTURING + #define VT_BUFFER_TARGET SV_Target1 + #define EXTRA_BUFFER_TARGET SV_Target2 + #else + #define EXTRA_BUFFER_TARGET SV_Target1 + #endif + + + + + void Frag(VertexToPixel v2p, + #ifdef OUTPUT_SPLIT_LIGHTING + out float4 outColor : SV_Target0, // outSpecularLighting + #ifdef UNITY_VIRTUAL_TEXTURING + out float4 outVTFeedback : VT_BUFFER_TARGET, + #endif + out float4 outDiffuseLighting : EXTRA_BUFFER_TARGET, + OUTPUT_SSSBUFFER(outSSSBuffer) + #else + out float4 outColor : SV_Target0 + #ifdef UNITY_VIRTUAL_TEXTURING + ,out float4 outVTFeedback : VT_BUFFER_TARGET + #endif + #ifdef _WRITE_TRANSPARENT_MOTION_VECTOR + , out float4 outMotionVec : EXTRA_BUFFER_TARGET + #endif // _WRITE_TRANSPARENT_MOTION_VECTOR + #endif // OUTPUT_SPLIT_LIGHTING + #ifdef _DEPTHOFFSET_ON + , out float outputDepth : SV_Depth + #endif + #if NEED_FACING + , bool facing : SV_IsFrontFace + #endif + ) + { + #ifdef _WRITE_TRANSPARENT_MOTION_VECTOR + // Init outMotionVector here to solve compiler warning (potentially unitialized variable) + // It is init to the value of forceNoMotion (with 2.0) + outMotionVec = float4(2.0, 0.0, 0.0, 0.0); + #endif + + UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX(v2p); + FragInputs input = BuildFragInputs(v2p); + + // We need to readapt the SS position as our screen space positions are for a low res buffer, but we try to access a full res buffer. + input.positionSS.xy = _OffScreenRendering > 0 ? (input.positionSS.xy * _OffScreenDownsampleFactor) : input.positionSS.xy; + + uint2 tileIndex = uint2(input.positionSS.xy) / GetTileSize(); + + // input.positionSS is SV_Position + PositionInputs posInput = GetPositionInput(input.positionSS.xy, _ScreenSize.zw, input.positionSS.z, input.positionSS.w, input.positionRWS.xyz, tileIndex); + + + float3 V = GetWorldSpaceNormalizeViewDir(input.positionRWS); + + + SurfaceData surfaceData; + BuiltinData builtinData; + Surface l; + ShaderData d; + GetSurfaceAndBuiltinData(v2p, input, V, posInput, surfaceData, builtinData, l, d + #if NEED_FACING + , facing + #endif + ); + + + BSDFData bsdfData = ConvertSurfaceDataToBSDFData(input.positionSS.xy, surfaceData); + + PreLightData preLightData = GetPreLightData(V, posInput, bsdfData); + + outColor = float4(0.0, 0.0, 0.0, 0.0); + + // We need to skip lighting when doing debug pass because the debug pass is done before lighting so some buffers may not be properly initialized potentially causing crashes on PS4. + + #ifdef DEBUG_DISPLAY + // Init in debug display mode to quiet warning + #ifdef OUTPUT_SPLIT_LIGHTING + outDiffuseLighting = 0; + ENCODE_INTO_SSSBUFFER(surfaceData, posInput.positionSS, outSSSBuffer); + #endif + + + + // Same code in ShaderPassForwardUnlit.shader + // Reminder: _DebugViewMaterialArray[i] + // i==0 -> the size used in the buffer + // i>0 -> the index used (0 value means nothing) + // The index stored in this buffer could either be + // - a gBufferIndex (always stored in _DebugViewMaterialArray[1] as only one supported) + // - a property index which is different for each kind of material even if reflecting the same thing (see MaterialSharedProperty) + bool viewMaterial = false; + int bufferSize = _DebugViewMaterialArray[0].x; + if (bufferSize != 0) + { + bool needLinearToSRGB = false; + float3 result = float3(1.0, 0.0, 1.0); + + // Loop through the whole buffer + // Works because GetSurfaceDataDebug will do nothing if the index is not a known one + for (int index = 1; index <= bufferSize; index++) + { + int indexMaterialProperty = _DebugViewMaterialArray[index].x; + + // skip if not really in use + if (indexMaterialProperty != 0) + { + viewMaterial = true; + + GetPropertiesDataDebug(indexMaterialProperty, result, needLinearToSRGB); + GetVaryingsDataDebug(indexMaterialProperty, input, result, needLinearToSRGB); + GetBuiltinDataDebug(indexMaterialProperty, builtinData, posInput, result, needLinearToSRGB); + GetSurfaceDataDebug(indexMaterialProperty, surfaceData, result, needLinearToSRGB); + GetBSDFDataDebug(indexMaterialProperty, bsdfData, result, needLinearToSRGB); + } + } + + // TEMP! + // For now, the final blit in the backbuffer performs an sRGB write + // So in the meantime we apply the inverse transform to linear data to compensate. + if (!needLinearToSRGB) + result = SRGBToLinear(max(0, result)); + + outColor = float4(result, 1.0); + } + + if (!viewMaterial) + { + if (_DebugFullScreenMode == FULLSCREENDEBUGMODE_VALIDATE_DIFFUSE_COLOR || _DebugFullScreenMode == FULLSCREENDEBUGMODE_VALIDATE_SPECULAR_COLOR) + { + float3 result = float3(0.0, 0.0, 0.0); + + GetPBRValidatorDebug(surfaceData, result); + + outColor = float4(result, 1.0f); + } + else if (_DebugFullScreenMode == FULLSCREENDEBUGMODE_TRANSPARENCY_OVERDRAW) + { + float4 result = _DebugTransparencyOverdrawWeight * float4(TRANSPARENCY_OVERDRAW_COST, TRANSPARENCY_OVERDRAW_COST, TRANSPARENCY_OVERDRAW_COST, TRANSPARENCY_OVERDRAW_A); + outColor = result; + } + else + #endif + { + #ifdef _SURFACE_TYPE_TRANSPARENT + uint featureFlags = LIGHT_FEATURE_MASK_FLAGS_TRANSPARENT; + #else + uint featureFlags = LIGHT_FEATURE_MASK_FLAGS_OPAQUE; + #endif + + LightLoopOutput lightLoopOutput; + LightLoop(V, posInput, preLightData, bsdfData, builtinData, featureFlags, lightLoopOutput); + + float3 diffuseLighting = lightLoopOutput.diffuseLighting; + float3 specularLighting = lightLoopOutput.specularLighting; + + diffuseLighting *= GetCurrentExposureMultiplier(); + specularLighting *= GetCurrentExposureMultiplier(); + + #ifdef OUTPUT_SPLIT_LIGHTING + if (_EnableSubsurfaceScattering != 0 && ShouldOutputSplitLighting(bsdfData)) + { + outColor = float4(specularLighting, 1.0); + outDiffuseLighting = float4(TagLightingForSSS(diffuseLighting), 1.0); + } + else + { + outColor = float4(diffuseLighting + specularLighting, 1.0); + outDiffuseLighting = 0; + } + ENCODE_INTO_SSSBUFFER(surfaceData, posInput.positionSS, outSSSBuffer); + #else + outColor = ApplyBlendMode(diffuseLighting, specularLighting, builtinData.opacity); + outColor = EvaluateAtmosphericScattering(posInput, V, outColor); + #endif + + ChainFinalColorForward(l, d, outColor); + + #ifdef _WRITE_TRANSPARENT_MOTION_VECTOR + bool forceNoMotion = any(unity_MotionVectorsParams.yw == 0.0); + // outMotionVec is already initialize at the value of forceNoMotion (see above) + if (!forceNoMotion) + { + float2 motionVec = CalculateMotionVector(v2p.motionVectorCS, v2p.previousPositionCS); + EncodeMotionVector(motionVec * 0.5, outMotionVec); + outMotionVec.zw = 1.0; + } + #endif + } + + #ifdef DEBUG_DISPLAY + } + #endif + + #ifdef _DEPTHOFFSET_ON + outputDepth = l.outputDepth; + #endif + + #ifdef UNITY_VIRTUAL_TEXTURING + outVTFeedback = builtinData.vtPackedFeedback; + #endif + } + + ENDHLSL + } + Pass + { + // based on HDLitPass.template + Name "GBuffer" + Tags { "LightMode" = "GBuffer" } + //------------------------------------------------------------------------------------- + // Render Modes (Blend, Cull, ZTest, Stencil, etc) + //------------------------------------------------------------------------------------- + + Cull Back + ZTest [_ZTestGBuffer] + ColorMask [_LightLayersMaskBuffer4] 4 + ColorMask [_LightLayersMaskBuffer5] 5 + Stencil + { + WriteMask [_StencilWriteMaskGBuffer] + Ref [_StencilRefGBuffer] + CompFront Always + PassFront Replace + CompBack Always + PassBack Replace + } + + ColorMask [_LightLayersMaskBuffer4] 4 + ColorMask [_LightLayersMaskBuffer5] 5 + + Tags { "RenderType" = "Opaque" "Queue" = "Geometry" "PreviewType" = "Plane" } + Cull [_CullingOption] + ZWrite [_ZWrite] + ZTest [_ZTestMode] + + + //------------------------------------------------------------------------------------- + // End Render Modes + //------------------------------------------------------------------------------------- + + HLSLPROGRAM + + #pragma multi_compile _ DOTS_INSTANCING_ON + #pragma instancing_options renderinglayer + #pragma target 4.5 + + #pragma only_renderers d3d11 playstation xboxone xboxseries vulkan metal switch + #pragma multi_compile_instancing + #pragma multi_compile _ DOTS_INSTANCING_ON + #pragma multi_compile _ LOD_FADE_CROSSFADE + #pragma multi_compile _ LIGHT_LAYERS + //#pragma multi_compile_raytracing _ LIGHT_LAYERS + //#pragma shader_feature _ _SURFACE_TYPE_TRANSPARENT + //#pragma shader_feature_local _BLENDMODE_OFF _BLENDMODE_ALPHA _BLENDMODE_ADD _BLENDMODE_PRE_MULTIPLY + //#pragma shader_feature_local _ _ADD_PRECOMPUTED_VELOCITY + //#pragma shader_feature_local _ _TRANSPARENT_WRITES_MOTION_VEC + //#pragma shader_feature_local _ _ENABLE_FOG_ON_TRANSPARENT + #pragma multi_compile _ DEBUG_DISPLAY + //#pragma shader_feature_local _ _DISABLE_DECALS + //#pragma shader_feature_local _ _DISABLE_SSR + //#pragma shader_feature_local _ _DISABLE_SSR_TRANSPARENT + #pragma multi_compile _ LIGHTMAP_ON + #pragma multi_compile _ DIRLIGHTMAP_COMBINED + #pragma multi_compile_fragment PROBE_VOLUMES_OFF PROBE_VOLUMES_L1 PROBE_VOLUMES_L2 + #pragma multi_compile _ DYNAMICLIGHTMAP_ON + #pragma multi_compile_fragment _ SHADOWS_SHADOWMASK + #pragma multi_compile_fragment DECALS_OFF DECALS_3RT DECALS_4RT + #pragma multi_compile_fragment _ DECAL_SURFACE_GRADIENT + + //#pragma shader_feature_local _REFRACTION_OFF _REFRACTION_PLANE _REFRACTION_SPHERE _REFRACTION_THIN + + + //------------------------------------------------------------------------------------- + // Variant Definitions (active field translations to HDRP defines) + //------------------------------------------------------------------------------------- + // #define _MATERIAL_FEATURE_SUBSURFACE_SCATTERING 1 + // #define _MATERIAL_FEATURE_TRANSMISSION 1 + // #define _MATERIAL_FEATURE_ANISOTROPY 1 + // #define _MATERIAL_FEATURE_IRIDESCENCE 1 + // #define _MATERIAL_FEATURE_SPECULAR_COLOR 1 + #define _ENABLE_FOG_ON_TRANSPARENT 1 + // #define _AMBIENT_OCCLUSION 1 + // #define _SPECULAR_OCCLUSION_FROM_AO 1 + // #define _SPECULAR_OCCLUSION_FROM_AO_BENT_NORMAL 1 + // #define _SPECULAR_OCCLUSION_CUSTOM 1 + // #define _ENERGY_CONSERVING_SPECULAR 1 + // #define _ENABLE_GEOMETRIC_SPECULAR_AA 1 + // #define _HAS_REFRACTION 1 + // #define _REFRACTION_PLANE 1 + // #define _REFRACTION_SPHERE 1 + // #define _DISABLE_DECALS 1 + // #define _DISABLE_SSR 1 + // #define _ADD_PRECOMPUTED_VELOCITY + // #define _WRITE_TRANSPARENT_MOTION_VECTOR 1 + // #define _DEPTHOFFSET_ON 1 + // #define _BLENDMODE_PRESERVE_SPECULAR_LIGHTING 1 + + #define SHADERPASS SHADERPASS_GBUFFER + #define RAYTRACING_SHADER_GRAPH_DEFAULT + #define _PASSGBUFFER 1 + + + #pragma shader_feature_local GLOW_ON + #pragma shader_feature_local FADE_ON + #pragma shader_feature_local OUTBASE_ON + #pragma shader_feature_local ONLYOUTLINE_ON + #pragma shader_feature_local GRADIENT_ON + #pragma shader_feature_local GRADIENT2COL_ON + #pragma shader_feature_local RADIALGRADIENT_ON + #pragma shader_feature_local COLORSWAP_ON + #pragma shader_feature_local HSV_ON + #pragma shader_feature_local CHANGECOLOR_ON + #pragma shader_feature_local CHANGECOLOR2_ON + #pragma shader_feature_local CHANGECOLOR3_ON + #pragma shader_feature_local COLORRAMP_ON + #pragma shader_feature_local GRADIENTCOLORRAMP_ON + #pragma shader_feature_local HITEFFECT_ON + #pragma shader_feature_local NEGATIVE_ON + #pragma shader_feature_local PIXELATE_ON + #pragma shader_feature_local GREYSCALE_ON + #pragma shader_feature_local POSTERIZE_ON + #pragma shader_feature_local BLUR_ON + #pragma shader_feature_local MOTIONBLUR_ON + #pragma shader_feature_local GHOST_ON + #pragma shader_feature_local ALPHAOUTLINE_ON + #pragma shader_feature_local INNEROUTLINE_ON + #pragma shader_feature_local ONLYINNEROUTLINE_ON + #pragma shader_feature_local HOLOGRAM_ON + #pragma shader_feature_local CHROMABERR_ON + #pragma shader_feature_local GLITCH_ON + #pragma shader_feature_local FLICKER_ON + #pragma shader_feature_local SHADOW_ON + #pragma shader_feature_local SHINE_ON + #pragma shader_feature_local CONTRAST_ON + #pragma shader_feature_local OVERLAY_ON + #pragma shader_feature_local OVERLAYMULT_ON + #pragma shader_feature_local DOODLE_ON + #pragma shader_feature_local WIND_ON + #pragma shader_feature_local WAVEUV_ON + #pragma shader_feature_local ROUNDWAVEUV_ON + #pragma shader_feature_local RECTSIZE_ON + #pragma shader_feature_local OFFSETUV_ON + #pragma shader_feature_local CLIPPING_ON + #pragma shader_feature_local RADIALCLIPPING_ON + #pragma shader_feature_local TEXTURESCROLL_ON + #pragma shader_feature_local ZOOMUV_ON + #pragma shader_feature_local DISTORT_ON + #pragma shader_feature_local WARP_ON + #pragma shader_feature_local TWISTUV_ON + #pragma shader_feature_local ROTATEUV_ON + #pragma shader_feature_local POLARUV_ON + #pragma shader_feature_local FISHEYE_ON + #pragma shader_feature_local PINCH_ON + #pragma shader_feature_local SHAKEUV_ON + + #pragma shader_feature_local GLOWTEX_ON + #pragma shader_feature_local OUTTEX_ON + #pragma shader_feature_local OUTDIST_ON + #pragma shader_feature_local OUTBASE8DIR_ON + #pragma shader_feature_local OUTBASEPIXELPERF_ON + #pragma shader_feature_local COLORRAMPOUTLINE_ON + #pragma shader_feature_local GREYSCALEOUTLINE_ON + #pragma shader_feature_local POSTERIZEOUTLINE_ON + #pragma shader_feature_local BLURISHD_ON + #pragma shader_feature_local MANUALWIND_ON + #pragma shader_feature_local ATLAS_ON + #pragma shader_feature_local PREMULTIPLYALPHA_ON + + #pragma shader_feature BILBOARD_ON + #pragma shader_feature BILBOARDY_ON + + #pragma shader_feature NORMALMAP_ON + + + #define _HDRP 1 +#define _USINGTEXCOORD1 1 +#define _USINGTEXCOORD2 1 + + + #pragma vertex Vert + #pragma fragment Frag + + + //------------------------------------------------------------------------------------- + // Defines + //------------------------------------------------------------------------------------- + + + + + // useful conversion functions to make surface shader code just work + + #define UNITY_DECLARE_TEX2D(name) TEXTURE2D(name); SAMPLER(sampler##name); + #define UNITY_DECLARE_TEX2D_NOSAMPLER(name) TEXTURE2D(name); + #define UNITY_DECLARE_TEX2DARRAY(name) TEXTURE2D_ARRAY(name); SAMPLER(sampler##name); + #define UNITY_DECLARE_TEX2DARRAY_NOSAMPLER(tex) TEXTURE2D_ARRAY(tex); + + #define UNITY_SAMPLE_TEX2DARRAY(tex,coord) SAMPLE_TEXTURE2D_ARRAY(tex, sampler##tex, coord.xy, coord.z) + #define UNITY_SAMPLE_TEX2DARRAY_LOD(tex,coord,lod) SAMPLE_TEXTURE2D_ARRAY_LOD(tex, sampler##tex, coord.xy, coord.z, lod) + #define UNITY_SAMPLE_TEX2D(tex, coord) SAMPLE_TEXTURE2D(tex, sampler##tex, coord) + #define UNITY_SAMPLE_TEX2D_SAMPLER(tex, samp, coord) SAMPLE_TEXTURE2D(tex, sampler##samp, coord) + + #define UNITY_SAMPLE_TEX2D_LOD(tex,coord, lod) SAMPLE_TEXTURE2D_LOD(tex, sampler_##tex, coord, lod) + #define UNITY_SAMPLE_TEX2D_SAMPLER_LOD(tex,samplertex,coord, lod) SAMPLE_TEXTURE2D_LOD (tex, sampler##samplertex,coord, lod) + + #if defined(UNITY_COMPILER_HLSL) + #define UNITY_INITIALIZE_OUTPUT(type,name) name = (type)0; + #else + #define UNITY_INITIALIZE_OUTPUT(type,name) + #endif + + #define sampler2D_float sampler2D + #define sampler2D_half sampler2D + + #undef WorldNormalVector + #define WorldNormalVector(data, normal) mul(normal, data.TBNMatrix) + + #define UnityObjectToWorldNormal(normal) mul(GetObjectToWorldMatrix(), normal) + + #ifndef SHADER_STAGE_FRAGMENT + #if !defined(SHADOW_ULTRA_LOW) && !defined(SHADOW_LOW) && !defined(SHADOW_MEDIUM) && !defined(SHADOW_HIGH) // ultra low come from volumetricLighting.compute + #define SHADOW_MEDIUM + #endif + #if !defined(AREA_SHADOW_LOW) && !defined(AREA_SHADOW_MEDIUM) && !defined(AREA_SHADOW_HIGH) // low come from volumetricLighting.compute + #define AREA_SHADOW_MEDIUM + #endif + #endif + + + +// HDRP Adapter stuff + #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Common.hlsl" + #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Texture.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/ShaderVariables.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/ShaderPass/FragInputs.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/ShaderPass/ShaderPass.cs.hlsl" + #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/TextureStack.hlsl" // Required to be include before we include properties as it define DECLARE_STACK_CB + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/NormalBuffer.hlsl" + +#if UNITY_VERSION >= 202239 + #include "Packages/com.unity.shadergraph/ShaderGraphLibrary/Functions.hlsl" // Need to be here for Gradient struct definition +#else + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/ShaderGraphHeader.hlsl" +#endif + #ifdef RAYTRACING_SHADER_GRAPH_DEFAULT + #define RAYTRACING_SHADER_GRAPH_HIGH + #endif + + #ifdef RAYTRACING_SHADER_GRAPH_RAYTRACED + #define RAYTRACING_SHADER_GRAPH_LOW + #endif + // end + + + + + // If we use subsurface scattering, enable output split lighting (for forward pass) + #if defined(_MATERIAL_FEATURE_SUBSURFACE_SCATTERING) && !defined(_SURFACE_TYPE_TRANSPARENT) + #define OUTPUT_SPLIT_LIGHTING + #endif + + #define HAVE_RECURSIVE_RENDERING + + #if SHADERPASS == SHADERPASS_TRANSPARENT_DEPTH_PREPASS + #if !defined(_DISABLE_SSR_TRANSPARENT) && !defined(SHADER_UNLIT) + #define WRITE_NORMAL_BUFFER + #endif + #endif + + #ifndef DEBUG_DISPLAY + // In case of opaque we don't want to perform the alpha test, it is done in depth prepass and we use depth equal for ztest (setup from UI) + // Don't do it with debug display mode as it is possible there is no depth prepass in this case + #if !defined(_SURFACE_TYPE_TRANSPARENT) && defined(_ALPHATEST) + #if SHADERPASS == SHADERPASS_FORWARD + #define SHADERPASS_FORWARD_BYPASS_ALPHA_TEST + #elif SHADERPASS == SHADERPASS_GBUFFER + #define SHADERPASS_GBUFFER_BYPASS_ALPHA_TEST + #endif + #endif + #endif + + // Define _DEFERRED_CAPABLE_MATERIAL for shader capable to run in deferred pass + #if defined(SHADER_LIT) && !defined(_SURFACE_TYPE_TRANSPARENT) + #define _DEFERRED_CAPABLE_MATERIAL + #endif + + // Translate transparent motion vector define + #if defined(_TRANSPARENT_WRITES_MOTION_VEC) && defined(_SURFACE_TYPE_TRANSPARENT) + #define _WRITE_TRANSPARENT_MOTION_VECTOR + #endif + + + + + CBUFFER_START(UnityPerMaterial) + float _UseShadowThreshold; + float _BlendMode; + float _EnableBlendModePreserveSpecularLighting; + float _RayTracing; + float _RefractionModel; + + + half4 _Color; + half4 _MainTex_ST, _MainTex_TexelSize; + half _Alpha, _AlphaCutoffValue; + + #if ATLAS_ON + half _MinXUV, _MaxXUV, _MinYUV, _MaxYUV; + #endif + + #if GLOW_ON + half4 _GlowColor; + half _Glow, _GlowGlobal; + #endif + + #if HSV_ON + half _HsvShift, _HsvSaturation, _HsvBright; + #endif + + #if DISTORT_ON + half4 _DistortTex_ST; + half _DistortTexXSpeed, _DistortTexYSpeed, _DistortAmount; + #endif + + #if FADE_ON + half4 _FadeBurnColor, _FadeTex_ST, _FadeBurnTex_ST; + half _FadeAmount, _FadeBurnWidth, _FadeBurnTransition,_FadeBurnGlow; + #endif + + #if OUTBASE_ON + half4 _OutlineColor; + half _OutlineAlpha, _OutlineGlow, _OutlineWidth; + int _OutlinePixelWidth; + #endif + + #if OUTTEX_ON + half4 _OutlineTex_ST; + half _OutlineTexXSpeed, _OutlineTexYSpeed; + #endif + + #if OUTDIST_ON + half4 _OutlineDistortTex_ST; + half _OutlineDistortTexXSpeed, _OutlineDistortTexYSpeed, _OutlineDistortAmount; + #endif + + #if ALPHAOUTLINE_ON + half _AlphaOutlineGlow, _AlphaOutlinePower, _AlphaOutlineMinAlpha, _AlphaOutlineBlend; + half4 _AlphaOutlineColor; + #endif + + #if INNEROUTLINE_ON + half _InnerOutlineThickness, _InnerOutlineAlpha, _InnerOutlineGlow; + half4 _InnerOutlineColor; + #endif + + #if GRADIENT_ON + half _GradBlend, _GradBoostX, _GradBoostY; + half4 _GradTopRightCol, _GradTopLeftCol, _GradBotRightCol, _GradBotLeftCol; + #endif + + #if COLORSWAP_ON + half4 _ColorSwapRed, _ColorSwapGreen, _ColorSwapBlue; + half _ColorSwapRedLuminosity, _ColorSwapGreenLuminosity, _ColorSwapBlueLuminosity, _ColorSwapBlend; + #endif + + #if CHANGECOLOR_ON + half4 _ColorChangeNewCol, _ColorChangeTarget; + half _ColorChangeTolerance, _ColorChangeLuminosity; + #endif + #if CHANGECOLOR2_ON + half4 _ColorChangeNewCol2, _ColorChangeTarget2; + half _ColorChangeTolerance2; + #endif + #if CHANGECOLOR3_ON + half4 _ColorChangeNewCol3, _ColorChangeTarget3; + half _ColorChangeTolerance3; + #endif + + #if COLORRAMP_ON + half _ColorRampLuminosity, _ColorRampBlend; + #endif + + #if HITEFFECT_ON + half4 _HitEffectColor; + half _HitEffectGlow, _HitEffectBlend; + #endif + + #if NEGATIVE_ON + half _NegativeAmount; + #endif + + #if PIXELATE_ON + half _PixelateSize; + #endif + + #if GREYSCALE_ON + half _GreyscaleLuminosity, _GreyscaleBlend; + half4 _GreyscaleTintColor; + #endif + + #if POSTERIZE_ON + half _PosterizeNumColors, _PosterizeGamma; + #endif + + #if BLUR_ON + half _BlurIntensity; + #endif + + #if MOTIONBLUR_ON + half _MotionBlurAngle, _MotionBlurDist; + #endif + + #if GHOST_ON + half _GhostColorBoost, _GhostTransparency, _GhostBlend; + #endif + + #if HOLOGRAM_ON + half _HologramStripesAmount, _HologramMinAlpha, _HologramUnmodAmount, _HologramStripesSpeed, _HologramMaxAlpha, _HologramBlend; + half4 _HologramStripeColor; + #endif + + #if CHROMABERR_ON + half _ChromAberrAmount, _ChromAberrAlpha; + #endif + + #if GLITCH_ON + half _GlitchAmount, _GlitchSize; + #endif + + #if FLICKER_ON + half _FlickerFreq, _FlickerPercent, _FlickerAlpha; + #endif + + #if SHADOW_ON + half _ShadowX, _ShadowY, _ShadowAlpha; + half4 _ShadowColor; + #endif + + #if SHINE_ON + half4 _ShineColor; + half _ShineLocation, _ShineRotate, _ShineWidth, _ShineGlow; + #endif + + #if CONTRAST_ON + half _Contrast, _Brightness; + #endif + + #if OVERLAY_ON + half4 _OverlayTex_ST, _OverlayColor; + half _OverlayGlow, _OverlayBlend, _OverlayTextureScrollXSpeed, _OverlayTextureScrollYSpeed; + #endif + + #if DOODLE_ON + half _HandDrawnAmount, _HandDrawnSpeed; + #endif + + #if WIND_ON + half _GrassSpeed, _GrassWind, _GrassManualAnim, _GrassRadialBend; + #endif + + #if WAVEUV_ON + float _WaveAmount, _WaveSpeed, _WaveStrength, _WaveX, _WaveY; + #endif + + #if ROUNDWAVEUV_ON + half _RoundWaveStrength, _RoundWaveSpeed; + #endif + + #if RECTSIZE_ON + half _RectSize; + #endif + + #if OFFSETUV_ON + half _OffsetUvX, _OffsetUvY; + #endif + + #if CLIPPING_ON + half _ClipUvLeft, _ClipUvRight, _ClipUvUp, _ClipUvDown; + #endif + + #if RADIALCLIPPING_ON + half _RadialStartAngle, _RadialClip, _RadialClip2; + #endif + + #if TEXTURESCROLL_ON + half _TextureScrollXSpeed, _TextureScrollYSpeed; + #endif + + #if ZOOMUV_ON + half _ZoomUvAmount; + #endif + + #if WARP_ON + half _WarpStrength, _WarpSpeed, _WarpScale; + #endif + + #if TWISTUV_ON + half _TwistUvAmount, _TwistUvPosX, _TwistUvPosY, _TwistUvRadius; + #endif + + #if ROTATEUV_ON + half _RotateUvAmount; + #endif + + #if FISHEYE_ON + half _FishEyeUvAmount; + #endif + + #if PINCH_ON + half _PinchUvAmount; + #endif + + #if SHAKEUV_ON + half _ShakeUvSpeed, _ShakeUvX, _ShakeUvY; + #endif + + #if NORMALMAP_ON + half _NormalStrength; + #endif + + float _RandomSeed; + + + + + CBUFFER_END + + + + // -- Property used by ScenePickingPass + #ifdef SCENEPICKINGPASS + float4 _SelectionID; + #endif + + // -- Properties used by SceneSelectionPass + #ifdef SCENESELECTIONPASS + int _ObjectId; + int _PassValue; + #endif + + + // data across stages, stripped like the above. + struct VertexToPixel + { + float4 pos : SV_POSITION; + float3 worldPos : TEXCOORD0; + float3 worldNormal : TEXCOORD1; + float4 worldTangent : TEXCOORD2; + float4 texcoord0 : TEXCOORD3; + float4 texcoord1 : TEXCOORD4; + float4 texcoord2 : TEXCOORD5; + // #if %TEXCOORD3REQUIREKEY% + float4 texcoord3 : TEXCOORD6; + // #endif + + // #if %SCREENPOSREQUIREKEY% + // float4 screenPos : TEXCOORD7; + // #endif + + // #if %VERTEXCOLORREQUIREKEY% + float4 vertexColor : COLOR; + // #endif + + // #if %EXTRAV2F0REQUIREKEY% + // float4 extraV2F0 : TEXCOORD8; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // float4 extraV2F1 : TEXCOORD9; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // float4 extraV2F2 : TEXCOORD10; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // float4 extraV2F3 : TEXCOORD11; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // float4 extraV2F4 : TEXCOORD12; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // float4 extraV2F5 : TEXCOORD13; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // float4 extraV2F6 : TEXCOORD14; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // float4 extraV2F7 : TEXCOORD15; + // #endif + + #if UNITY_ANY_INSTANCING_ENABLED + UNITY_VERTEX_INPUT_INSTANCE_ID + #endif // UNITY_ANY_INSTANCING_ENABLED + + #if _HDRP && (_PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR))) + float4 previousPositionCS : TEXCOORD16; // Contain previous transform position (in case of skinning for example) + float4 motionVectorCS : TEXCOORD17; + #endif + + UNITY_VERTEX_OUTPUT_STEREO + }; + + + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Debug/DebugDisplay.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/Material.hlsl" + #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/NormalSurfaceGradient.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/Lit/Lit.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/BuiltinUtilities.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/MaterialUtilities.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/Decal/DecalUtilities.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/Lit/LitDecalData.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/ShaderGraphFunctions.hlsl" + + + + + + // data describing the user output of a pixel + struct Surface + { + half3 Albedo; + half Height; + half3 Normal; + half Smoothness; + half3 Emission; + half Metallic; + half3 Specular; + half Occlusion; + half SpecularPower; // for simple lighting + half Alpha; + float outputDepth; // if written, SV_Depth semantic is used. ShaderData.clipPos.z is unused value + // HDRP Only + half SpecularOcclusion; + half SubsurfaceMask; + half Thickness; + half CoatMask; + half CoatSmoothness; + half Anisotropy; + half IridescenceMask; + half IridescenceThickness; + int DiffusionProfileHash; + float SpecularAAThreshold; + float SpecularAAScreenSpaceVariance; + // requires _OVERRIDE_BAKEDGI to be defined, but is mapped in all pipelines + float3 DiffuseGI; + float3 BackDiffuseGI; + float3 SpecularGI; + float ior; + float3 transmittanceColor; + float atDistance; + float transmittanceMask; + // requires _OVERRIDE_SHADOWMASK to be defines + float4 ShadowMask; + + // for decals + float NormalAlpha; + float MAOSAlpha; + + + }; + + // Data the user declares in blackboard blocks + struct Blackboard + { + + float blackboardDummyData; + }; + + // data the user might need, this will grow to be big. But easy to strip + struct ShaderData + { + float4 clipPos; // SV_POSITION + float3 localSpacePosition; + float3 localSpaceNormal; + float3 localSpaceTangent; + + float3 worldSpacePosition; + float3 worldSpaceNormal; + float3 worldSpaceTangent; + float tangentSign; + + float3 worldSpaceViewDir; + float3 tangentSpaceViewDir; + + float4 texcoord0; + float4 texcoord1; + float4 texcoord2; + float4 texcoord3; + + float2 screenUV; + float4 screenPos; + + float4 vertexColor; + bool isFrontFace; + + float4 extraV2F0; + float4 extraV2F1; + float4 extraV2F2; + float4 extraV2F3; + float4 extraV2F4; + float4 extraV2F5; + float4 extraV2F6; + float4 extraV2F7; + + float3x3 TBNMatrix; + Blackboard blackboard; + }; + + struct VertexData + { + #if SHADER_TARGET > 30 + // uint vertexID : SV_VertexID; + #endif + float4 vertex : POSITION; + float3 normal : NORMAL; + float4 tangent : TANGENT; + float4 texcoord0 : TEXCOORD0; + + // optimize out mesh coords when not in use by user or lighting system + #if _URP && (_USINGTEXCOORD1 || _PASSMETA || _PASSFORWARD || _PASSGBUFFER) + float4 texcoord1 : TEXCOORD1; + #endif + + #if _URP && (_USINGTEXCOORD2 || _PASSMETA || ((_PASSFORWARD || _PASSGBUFFER) && defined(DYNAMICLIGHTMAP_ON))) + float4 texcoord2 : TEXCOORD2; + #endif + + #if _STANDARD && (_USINGTEXCOORD1 || (_PASSMETA || ((_PASSFORWARD || _PASSGBUFFER || _PASSFORWARDADD) && LIGHTMAP_ON))) + float4 texcoord1 : TEXCOORD1; + #endif + #if _STANDARD && (_USINGTEXCOORD2 || (_PASSMETA || ((_PASSFORWARD || _PASSGBUFFER) && DYNAMICLIGHTMAP_ON))) + float4 texcoord2 : TEXCOORD2; + #endif + + + #if _HDRP + float4 texcoord1 : TEXCOORD1; + float4 texcoord2 : TEXCOORD2; + #endif + + // #if %TEXCOORD3REQUIREKEY% + float4 texcoord3 : TEXCOORD3; + // #endif + + // #if %VERTEXCOLORREQUIREKEY% + float4 vertexColor : COLOR; + // #endif + + #if _PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR)) + float3 previousPositionOS : TEXCOORD4; // Contain previous transform position (in case of skinning for example) + #if defined (_ADD_PRECOMPUTED_VELOCITY) + float3 precomputedVelocity : TEXCOORD5; // Add Precomputed Velocity (Alembic computes velocities on runtime side). + #endif + #endif + + UNITY_VERTEX_INPUT_INSTANCE_ID + }; + + struct TessVertex + { + float4 vertex : INTERNALTESSPOS; + float3 normal : NORMAL; + float4 tangent : TANGENT; + float4 texcoord0 : TEXCOORD0; + float4 texcoord1 : TEXCOORD1; + float4 texcoord2 : TEXCOORD2; + + // #if %TEXCOORD3REQUIREKEY% + float4 texcoord3 : TEXCOORD3; + // #endif + + // #if %VERTEXCOLORREQUIREKEY% + float4 vertexColor : COLOR; + // #endif + + // #if %EXTRAV2F0REQUIREKEY% + // float4 extraV2F0 : TEXCOORD5; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // float4 extraV2F1 : TEXCOORD6; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // float4 extraV2F2 : TEXCOORD7; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // float4 extraV2F3 : TEXCOORD8; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // float4 extraV2F4 : TEXCOORD9; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // float4 extraV2F5 : TEXCOORD10; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // float4 extraV2F6 : TEXCOORD11; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // float4 extraV2F7 : TEXCOORD12; + // #endif + + #if _PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR)) + float3 previousPositionOS : TEXCOORD13; // Contain previous transform position (in case of skinning for example) + #if defined (_ADD_PRECOMPUTED_VELOCITY) + float3 precomputedVelocity : TEXCOORD14; + #endif + #endif + + UNITY_VERTEX_INPUT_INSTANCE_ID + UNITY_VERTEX_OUTPUT_STEREO + }; + + struct ExtraV2F + { + float4 extraV2F0; + float4 extraV2F1; + float4 extraV2F2; + float4 extraV2F3; + float4 extraV2F4; + float4 extraV2F5; + float4 extraV2F6; + float4 extraV2F7; + Blackboard blackboard; + float4 time; + }; + + + float3 WorldToTangentSpace(ShaderData d, float3 normal) + { + return mul(d.TBNMatrix, normal); + } + + float3 TangentToWorldSpace(ShaderData d, float3 normal) + { + return mul(normal, d.TBNMatrix); + } + + // in this case, make standard more like SRPs, because we can't fix + // unity_WorldToObject in HDRP, since it already does macro-fu there + + #if _STANDARD + float3 TransformWorldToObject(float3 p) { return mul(unity_WorldToObject, float4(p, 1)); }; + float3 TransformObjectToWorld(float3 p) { return mul(unity_ObjectToWorld, float4(p, 1)); }; + float4 TransformWorldToObject(float4 p) { return mul(unity_WorldToObject, p); }; + float4 TransformObjectToWorld(float4 p) { return mul(unity_ObjectToWorld, p); }; + float4x4 GetWorldToObjectMatrix() { return unity_WorldToObject; } + float4x4 GetObjectToWorldMatrix() { return unity_ObjectToWorld; } + #if (defined(SHADER_API_D3D11) || defined(SHADER_API_XBOXONE) || defined(UNITY_COMPILER_HLSLCC) || defined(SHADER_API_PSSL) || (SHADER_TARGET_SURFACE_ANALYSIS && !SHADER_TARGET_SURFACE_ANALYSIS_MOJOSHADER)) + #define UNITY_SAMPLE_TEX2D_LOD(tex,coord, lod) tex.SampleLevel (sampler##tex,coord, lod) + #define UNITY_SAMPLE_TEX2D_SAMPLER_LOD(tex,samplertex,coord, lod) tex.SampleLevel (sampler##samplertex,coord, lod) + #else + #define UNITY_SAMPLE_TEX2D_LOD(tex,coord,lod) tex2D (tex,coord,0,lod) + #define UNITY_SAMPLE_TEX2D_SAMPLER_LOD(tex,samplertex,coord,lod) tex2D (tex,coord,0,lod) + #endif + + #undef GetWorldToObjectMatrix() + + #define GetWorldToObjectMatrix() unity_WorldToObject + + + #endif + + float3 GetCameraWorldPosition() + { + #if _HDRP + return GetCameraRelativePositionWS(_WorldSpaceCameraPos); + #else + return _WorldSpaceCameraPos; + #endif + } + + #if _GRABPASSUSED + #if _STANDARD + TEXTURE2D(%GRABTEXTURE%); + SAMPLER(sampler_%GRABTEXTURE%); + #endif + + half3 GetSceneColor(float2 uv) + { + #if _STANDARD + return SAMPLE_TEXTURE2D(%GRABTEXTURE%, sampler_%GRABTEXTURE%, uv).rgb; + #else + return SHADERGRAPH_SAMPLE_SCENE_COLOR(uv); + #endif + } + #endif + + + + #if _STANDARD + UNITY_DECLARE_DEPTH_TEXTURE(_CameraDepthTexture); + float GetSceneDepth(float2 uv) { return SAMPLE_DEPTH_TEXTURE(_CameraDepthTexture, uv); } + float GetLinear01Depth(float2 uv) { return Linear01Depth(GetSceneDepth(uv)); } + float GetLinearEyeDepth(float2 uv) { return LinearEyeDepth(GetSceneDepth(uv)); } + #else + float GetSceneDepth(float2 uv) { return SHADERGRAPH_SAMPLE_SCENE_DEPTH(uv); } + float GetLinear01Depth(float2 uv) { return Linear01Depth(GetSceneDepth(uv), _ZBufferParams); } + float GetLinearEyeDepth(float2 uv) { return LinearEyeDepth(GetSceneDepth(uv), _ZBufferParams); } + #endif + + float3 GetWorldPositionFromDepthBuffer(float2 uv, float3 worldSpaceViewDir) + { + float eye = GetLinearEyeDepth(uv); + float3 camView = mul((float3x3)GetObjectToWorldMatrix(), transpose(mul(GetWorldToObjectMatrix(), UNITY_MATRIX_I_V)) [2].xyz); + + float dt = dot(worldSpaceViewDir, camView); + float3 div = worldSpaceViewDir/dt; + float3 wpos = (eye * div) + GetCameraWorldPosition(); + return wpos; + } + + #if _HDRP + float3 ObjectToWorldSpacePosition(float3 pos) + { + return GetAbsolutePositionWS(TransformObjectToWorld(pos)); + } + #else + float3 ObjectToWorldSpacePosition(float3 pos) + { + return TransformObjectToWorld(pos); + } + #endif + + #if _STANDARD + UNITY_DECLARE_SCREENSPACE_TEXTURE(_CameraDepthNormalsTexture); + float3 GetSceneNormal(float2 uv, float3 worldSpaceViewDir) + { + float4 depthNorms = UNITY_SAMPLE_SCREENSPACE_TEXTURE(_CameraDepthNormalsTexture, uv); + float3 norms = DecodeViewNormalStereo(depthNorms); + norms = mul((float3x3)GetWorldToViewMatrix(), norms) * 0.5 + 0.5; + return norms; + } + #elif _HDRP && !_DECALSHADER + + float3 GetSceneNormal(float2 uv, float3 worldSpaceViewDir) + { + NormalData nd; + DecodeFromNormalBuffer(_ScreenSize.xy * uv, nd); + return nd.normalWS; + } + #elif _URP + #if (SHADER_LIBRARY_VERSION_MAJOR >= 10) + #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/DeclareNormalsTexture.hlsl" + #endif + + float3 GetSceneNormal(float2 uv, float3 worldSpaceViewDir) + { + #if (SHADER_LIBRARY_VERSION_MAJOR >= 10) + return SampleSceneNormals(uv); + #else + float3 wpos = GetWorldPositionFromDepthBuffer(uv, worldSpaceViewDir); + return normalize(-cross(ddx(wpos), ddy(wpos))) * 0.5 + 0.5; + #endif + + } + #endif + + #if _HDRP + + half3 UnpackNormalmapRGorAG(half4 packednormal) + { + // This do the trick + packednormal.x *= packednormal.w; + + half3 normal; + normal.xy = packednormal.xy * 2 - 1; + normal.z = sqrt(1 - saturate(dot(normal.xy, normal.xy))); + return normal; + } + half3 UnpackNormal(half4 packednormal) + { + #if defined(UNITY_NO_DXT5nm) + return packednormal.xyz * 2 - 1; + #else + return UnpackNormalmapRGorAG(packednormal); + #endif + } + #endif + #if _HDRP || _URP + + half3 UnpackScaleNormal(half4 packednormal, half scale) + { + #ifndef UNITY_NO_DXT5nm + // Unpack normal as DXT5nm (1, y, 1, x) or BC5 (x, y, 0, 1) + // Note neutral texture like "bump" is (0, 0, 1, 1) to work with both plain RGB normal and DXT5nm/BC5 + packednormal.x *= packednormal.w; + #endif + half3 normal; + normal.xy = (packednormal.xy * 2 - 1) * scale; + normal.z = sqrt(1 - saturate(dot(normal.xy, normal.xy))); + return normal; + } + + #endif + + + void GetSun(out float3 lightDir, out float3 color) + { + lightDir = float3(0.5, 0.5, 0); + color = 1; + #if _HDRP + if (_DirectionalLightCount > 0) + { + DirectionalLightData light = _DirectionalLightDatas[0]; + lightDir = -light.forward.xyz; + color = light.color; + } + #elif _STANDARD + lightDir = normalize(_WorldSpaceLightPos0.xyz); + color = _LightColor0.rgb; + #elif _URP + Light light = GetMainLight(); + lightDir = light.direction; + color = light.color; + #endif + } + + + + + + + + + + + TEXTURE2D(_MainTex); + SAMPLER(sampler_MainTex); + + #if GLOW_ON + TEXTURE2D(_GlowTex); + SAMPLER(sampler_GlowTex); + #endif + + #if FADE_ON + TEXTURE2D(_FadeTex); + SAMPLER(sampler_FadeTex); + + TEXTURE2D(_FadeBurnTex); + SAMPLER(sampler_FadeBurnTex); + #endif + + #if DISTORT_ON + TEXTURE2D(_DistortTex); + SAMPLER(sampler_DistortTex); + #endif + + #if OUTTEX_ON + TEXTURE2D(_OutlineTex); + SAMPLER(sampler_OutlineTex); + #endif + + #if OUTDIST_ON + TEXTURE2D(_OutlineDistortTex); + SAMPLER(sampler_OutlineDistortTex); + #endif + + #if COLORSWAP_ON + TEXTURE2D(_ColorSwapTex); + SAMPLER(sampler_ColorSwapTex); + #endif + + #if COLORRAMP_ON + TEXTURE2D(_ColorRampTex); + TEXTURE2D(_ColorRampTexGradient); + SAMPLER(sampler_ColorRampTex); + SAMPLER(sampler_ColorRampTexGradient); + #endif + + #if SHINE_ON + TEXTURE2D(_ShineMask); + SAMPLER(sampler_ShineMask); + #endif + + #if OVERLAY_ON + TEXTURE2D(_OverlayTex); + SAMPLER(sampler_OverlayTex); + #endif + + #if NORMALMAP_ON + TEXTURE2D(_NormalMap); + SAMPLER(sampler_NormalMap); + #endif + + + half3 GetPixel(in int offsetX, in int offsetY, in half2 uv, in Texture2D _tex, in SamplerState _sampler) + { + half2 _uv = uv + half2(offsetX * _MainTex_TexelSize.x, offsetY * _MainTex_TexelSize.y); + half4 col = SAMPLE_TEXTURE2D(_tex, _sampler, _uv); + return col.rgb; + } + + + //BLURS------------------------------------------------------------------------- + half4 Blur(half2 uv, Texture2D source, SamplerState sampler_source, half Intensity) + { + const half2 texelSize = 1.0 / _ScreenParams.xy; + const half4 color = SAMPLE_TEXTURE2D(source, sampler_source, uv); + const half2 offset = Intensity * texelSize; + + half4 accumulatedColor = color; + half accumulatedWeight = 1.0; + for (int x = -1; x <= 1; x++) + { + for (int y = -1; y <= 1; y++) + { + const half2 sampleUV = uv + half2(x, y) * offset; + const half4 sampleColor = SAMPLE_TEXTURE2D(source, sampler_source, sampleUV); + + accumulatedColor += sampleColor; + accumulatedWeight += 1.0; + } + } + + half4 blurredColor = accumulatedColor / accumulatedWeight; + return blurredColor; + } + + half BlurHD_G(half bhqp, half x) + { + return exp(-(x * x) / (2.0 * bhqp * bhqp)); + } + half4 BlurHD(half2 uv, Texture2D source, SamplerState sampler_source, half BlurAmount, half xScale, half yScale) + { + int iterations = 16; + int halfIterations = iterations / 2; + half sigmaX = 0.1 + BlurAmount * 0.5; + half sigmaY = sigmaX; + half total = 0.0; + half4 ret = half4(0, 0, 0, 0); + for (int iy = 0; iy < iterations; ++iy) + { + half fy = BlurHD_G(sigmaY, half(iy) -half(halfIterations)); + half offsetY = half(iy - halfIterations) * 0.00390625 * xScale; + for (int ix = 0; ix < iterations; ++ix) + { + half fx = BlurHD_G(sigmaX, half(ix) - half(halfIterations)); + half offsetX = half(ix - halfIterations) * 0.00390625 * yScale; + total += fx * fy; + ret += SAMPLE_TEXTURE2D(source, sampler_source, uv + half2(offsetX, offsetY)) * fx * fy; + } + } + return ret / total; + } + //----------------------------------------------------------------------- + + + //------------------------------------------- + half RemapFloat(half inValue, half inMin, half inMax, half outMin, half outMax){ + return outMin + (inValue - inMin) * (outMax - outMin) / (inMax - inMin); + } + //------------------------------------------- + + //----------------------------------------------------------------------- + half rand(half2 seed, half offset) { + return (frac(sin(dot(seed, half2(12.9898, 78.233))) * 43758.5453) + offset) % 1.0; + } + + half rand2(half2 seed, half offset) { + return (frac(sin(dot(seed * floor(50 + (_Time.x % 1.0) * 12.), half2(127.1, 311.7))) * 43758.5453123) + offset) % 1.0; + } + + half rand2CustomTime(half2 seed, half offset, half customTime) { + return (frac(sin(dot(seed * floor(50 + (customTime % 1.0) * 12.), half2(127.1, 311.7))) * 43758.5453123) + offset) % 1.0; + } + //----------------------------------------------------------------------- + + + void Ext_ModifyVertex0 (inout VertexData v, inout ExtraV2F d) + { + //BILBOARD_ON + #if BILBOARD_ON + half3 camRight = mul((half3x3)unity_CameraToWorld, half3(1,0,0)); + half3 camUp = half3(0,1,0); + #if BILBOARDY_ON + camUp = mul((half3x3)unity_CameraToWorld, half3(0,1,0)); + #endif + half3 localPos = v.vertex.x * camRight + v.vertex.y * camUp; + v.vertex = half4(localPos, 1); + #endif + //----------------------------------------------------------- + + v.texcoord0.xy = TRANSFORM_TEX(v.texcoord0.xy, _MainTex); + half2 center = half2(0.5, 0.5); + #if ATLAS_ON + center = half2((_MaxXUV + _MinXUV) / 2.0, (_MaxYUV + _MinYUV) / 2.0); + #endif + + //POLARUV_ON + #if POLARUV_ON + v.texcoord0.xy = v.texcoord0.xy - center; + #endif + + //---------------------------------------- + + //ROTATEUV_ON + #if ROTATEUV_ON + half2 uvC = v.texcoord0.xy; + half cosAngle = cos(_RotateUvAmount); + half sinAngle = sin(_RotateUvAmount); + half2x2 rot = half2x2(cosAngle, -sinAngle, sinAngle, cosAngle); + uvC -= center; + v.texcoord0.xy = mul(rot, uvC); + v.texcoord0.xy += center; + #endif + //-------------------- + + #if RECTSIZE_ON + v.vertex.xyz += (v.vertex.xyz * (_RectSize - 1.0)); + #endif + + #if OUTTEX_ON + v.texcoord1.xy = TRANSFORM_TEX(v.texcoord0.xy, _OutlineTex); + #endif + + #if OUTDIST_ON + v.texcoord2.xy = TRANSFORM_TEX(v.texcoord0.xy, _OutlineDistortTex); + #endif + + #if DISTORT_ON + v.texcoord3.xy = TRANSFORM_TEX(v.texcoord0.xy, _DistortTex); + #endif + } + + void Ext_SurfaceFunction0 (inout Surface o, ShaderData d) + { + half randomSeed = _RandomSeed; + + float2 uvRect = d.texcoord0; + half2 center = half2(0.5, 0.5); + #if ATLAS_ON + center = half2((_MaxXUV + _MinXUV) / 2.0, (_MaxYUV + _MinYUV) / 2.0); + uvRect = half2((d.texcoord0.x - _MinXUV) / (_MaxXUV - _MinXUV), (d.texcoord0.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half2 centerTiled = half2(center.x * _MainTex_ST.x, center.y * _MainTex_ST.y); + + //CLIPPING_ON + #if CLIPPING_ON + half2 tiledUv = half2(d.texcoord0.x / _MainTex_ST.x, d.texcoord0.y / _MainTex_ST.y); + #if ATLAS_ON + tiledUv = half2((tiledUv.x - _MinXUV) / (_MaxXUV - _MinXUV), (tiledUv.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + clip((1 - _ClipUvUp) - tiledUv.y); + clip(tiledUv.y - _ClipUvDown); + clip((1 - _ClipUvRight) - tiledUv.x); + clip(tiledUv.x - _ClipUvLeft); + #endif + //---------------------------------- + + //RADIALCLIPPING_ON + #if RADIALCLIPPING_ON + half2 tiledUv2 = half2(d.texcoord0.x / _MainTex_ST.x, d.texcoord0.y / _MainTex_ST.y); + #if ATLAS_ON + tiledUv2 = half2((tiledUv2.x - _MinXUV) / (_MaxXUV - _MinXUV), (tiledUv2.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half startAngle = _RadialStartAngle - _RadialClip; + half endAngle = _RadialStartAngle + _RadialClip2; + half offset0 = clamp(0, 360, startAngle + 360); + half offset360 = clamp(0, 360, endAngle - 360); + half2 atan2Coord = half2(lerp(-1, 1, tiledUv2.x), lerp(-1, 1, tiledUv2.y)); + half atanAngle = atan2(atan2Coord.y, atan2Coord.x) * 57.3; // angle in degrees + if(atanAngle < 0) atanAngle = 360 + atanAngle; + if(atanAngle >= startAngle && atanAngle <= endAngle) discard; + if(atanAngle <= offset360) discard; + if(atanAngle >= offset0) discard; + #endif + + //----------------------------- + + //TEXTURESCROLL_ON && ATLAS_ON + #if TEXTURESCROLL_ON && ATLAS_ON + d.texcoord0.xy = half2(_MinXUV + ((_MaxXUV - _MinXUV) * (abs(((_Time.y + randomSeed) * _TextureScrollXSpeed) + uvRect.x) % 1)), + _MinYUV + ((_MaxYUV - _MinYUV) * (abs(((_Time.y + randomSeed) * _TextureScrollYSpeed) + uvRect.y) % 1))); + #endif + //---------------------------- + + //OFFSETUV_ON + #if OFFSETUV_ON + #if ATLAS_ON + d.texcoord0.xy = half2(_MinXUV + ((_MaxXUV - _MinXUV) * (abs((_OffsetUvX + uvRect.x) % 1))), + _MinYUV + ((_MaxYUV - _MinYUV) * (abs(_OffsetUvY + uvRect.y) % 1))); + #else + d.texcoord0.xy += half2(_OffsetUvX, _OffsetUvY); + #endif + #endif + + //---------------------- + + //POLARUV_ON + #if POLARUV_ON + d.texcoord0.xy = half2(atan2(d.texcoord0.y, d.texcoord0.x) / (2.0f * 3.141592653589f), length(d.texcoord0.xy)); + d.texcoord0.xy *= _MainTex_ST.xy; + #endif + + //-------------------------------------- + + //TWISTUV_ON + #if TWISTUV_ON + #if ATLAS_ON + _TwistUvPosX = ((_MaxXUV - _MinXUV) * _TwistUvPosX) + _MinXUV; + _TwistUvPosY = ((_MaxYUV - _MinYUV) * _TwistUvPosY) + _MinYUV; + #endif + half2 tempUv = d.texcoord0.xy - half2(_TwistUvPosX * _MainTex_ST.x, _TwistUvPosY * _MainTex_ST.y); + _TwistUvRadius *= (_MainTex_ST.x + _MainTex_ST.y) / 2; + half percent = (_TwistUvRadius - length(tempUv)) / _TwistUvRadius; + half theta = percent * percent * (2.0 * sin(_TwistUvAmount)) * 8.0; + half s = sin(theta); + half c = cos(theta); + half beta = max(sign(_TwistUvRadius - length(tempUv)), 0.0); + tempUv = half2(dot(tempUv, half2(c, -s)), dot(tempUv, half2(s, c))) * beta + tempUv * (1 - beta); + tempUv += half2(_TwistUvPosX * _MainTex_ST.x, _TwistUvPosY * _MainTex_ST.y); + d.texcoord0.xy = tempUv; + #endif + + //-------------------------------------------- + + //FISHEYE_ON + #if FISHEYE_ON + half bind = length(centerTiled); + half2 dF = d.texcoord0.xy - centerTiled; + half dFlen = length(dF); + half fishInt = (3.14159265359 / bind) * (_FishEyeUvAmount + 0.001); + d.texcoord0.xy = centerTiled + (dF / (max(0.0001, dFlen))) * tan(dFlen * fishInt) * bind / tan(bind * fishInt); + #endif + //--------------------------------------------- + + //PINCH_ON + #if PINCH_ON + half2 dP = d.texcoord0.xy - centerTiled; + half pinchInt = (3.141592 / length(centerTiled)) * (-_PinchUvAmount + 0.001); + d.texcoord0.xy = centerTiled + normalize(dP) * atan(length(dP) * -pinchInt * 10.0) * 0.5 / atan(-pinchInt * 5); + #endif + + //--------------------------------------------- + + //ZOOMUV_ON + #if ZOOMUV_ON + d.texcoord0.xy -= centerTiled; + d.texcoord0.xy = d.texcoord0.xy * _ZoomUvAmount; + d.texcoord0.xy += centerTiled; + #endif + + //----------------------------------------------- + + //DOODLE_ON + #if DOODLE_ON + half2 uvCopy = uvRect; + _HandDrawnSpeed = (floor((_Time.x + randomSeed) * 20 * _HandDrawnSpeed) / _HandDrawnSpeed) * _HandDrawnSpeed; + uvCopy.x = sin((uvCopy.x * _HandDrawnAmount + _HandDrawnSpeed) * 4); + uvCopy.y = cos((uvCopy.y * _HandDrawnAmount + _HandDrawnSpeed) * 4); + d.texcoord0.xy = lerp(d.texcoord0.xy, d.texcoord0.xy + uvCopy, 0.0005 * _HandDrawnAmount); + #endif + + //-------------------------- + + //SHAKEUV_ON + #if SHAKEUV_ON + half xShake = sin((_Time.x + randomSeed) * _ShakeUvSpeed * 50) * _ShakeUvX; + half yShake = cos((_Time.x + randomSeed) * _ShakeUvSpeed * 50) * _ShakeUvY; + d.texcoord0.xy += half2(xShake * 0.012, yShake * 0.01); + #endif + + //------------------------------------------- + + //RECTSIZE_ON + #if RECTSIZE_ON + d.texcoord0.xy = d.texcoord0.xy * (_RectSize).xx + (((-_RectSize * 0.5) + 0.5)).xx; + #endif + + //------------------------------------------- + + //DISTORT_ON + #if DISTORT_ON + #if ATLAS_ON + d.texcoord3.x = d.texcoord3.x * (1 / (_MaxXUV - _MinXUV)); + d.texcoord3.y = d.texcoord3.y * (1 / (_MaxYUV - _MinYUV)); + #endif + + d.texcoord3.x += ((_Time.x + _RandomSeed) * _DistortTexXSpeed) % 1; + d.texcoord3.y += ((_Time.x + _RandomSeed) * _DistortTexYSpeed) % 1; + half distortAmnt = (SAMPLE_TEXTURE2D(_DistortTex, sampler_DistortTex, d.texcoord3.xy).r - 0.5) * 0.2 * _DistortAmount; + d.texcoord0.x += distortAmnt; + d.texcoord0.y += distortAmnt; + #endif + //------------------------------------------------------- + + //WARP_ON + #if WARP_ON + half2 warpUv = half2(d.texcoord0.x / _MainTex_ST.x, d.texcoord0.y / _MainTex_ST.y); + #if ATLAS_ON + warpUv = half2((warpUv.x - _MinXUV) / (_MaxXUV - _MinXUV), (warpUv.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + const float tau = 6.283185307179586; + float xWarp = (_Time.y + randomSeed) * _WarpSpeed + warpUv.x * tau / _WarpScale; + float yWarp = (_Time.y + randomSeed) * _WarpSpeed + warpUv.y * tau / _WarpScale; + float2 warp = float2(sin(xWarp), sin(yWarp)) * _WarpStrength; + d.texcoord0.xy += warp; + #endif + + //------------------------------------------------------- + + //WAVEUV_ON + #if WAVEUV_ON + float2 uvWave = half2(_WaveX * _MainTex_ST.x, _WaveY * _MainTex_ST.y) - d.texcoord0.xy; + uvWave %= 1; + #if ATLAS_ON + uvWave = half2(_WaveX, _WaveY) - uvRect; + #endif + uvWave.x *= _ScreenParams.x / _ScreenParams.y; + float waveTime = _Time.y + randomSeed; + float angWave = (sqrt(dot(uvWave, uvWave)) * _WaveAmount) - ((waveTime * _WaveSpeed)); + d.texcoord0.xy = d.texcoord0.xy + uvWave * sin(angWave) * (_WaveStrength / 1000.0); + #endif + //---------------------------------------------------- + + //ROUNDWAVEUV_ON + #if ROUNDWAVEUV_ON + half xWave = ((0.5 * _MainTex_ST.x) - uvRect.x); + half yWave = ((0.5 * _MainTex_ST.y) - uvRect.y) * (_MainTex_TexelSize.w / _MainTex_TexelSize.z); + half ripple = -sqrt(xWave*xWave + yWave* yWave); + d.texcoord0.xy += (sin((ripple + (_Time.y + randomSeed) * (_RoundWaveSpeed/10.0)) / 0.015) * (_RoundWaveStrength/10.0)) % 1; + #endif + //---------------------------------------------------- + + + //WIND_ON + #if WIND_ON + half windOffset = sin((_Time.x + randomSeed) * _GrassSpeed * 10); + half2 windCenter = half2(0.5, 0.1); + #if ATLAS_ON + windCenter.x = ((_MaxXUV - _MinXUV) * windCenter.x) + _MinXUV; + windCenter.y = ((_MaxYUV - _MinYUV) * windCenter.y) + _MinYUV; + #endif + #if !MANUALWIND_ON + d.texcoord0.x = fmod(abs(lerp(d.texcoord0.x, d.texcoord0.x + (_GrassWind * 0.01 * windOffset), uvRect.y)), 1); + #else + d.texcoord0.x = fmod(abs(lerp(d.texcoord0.x, d.texcoord0.x + (_GrassWind * 0.01 * _GrassManualAnim), uvRect.y)), 1); + windOffset = _GrassManualAnim; + #endif + half2 delta = d.texcoord0.xy - windCenter; + half delta2 = dot(delta.xy, delta.xy); + half2 delta_offset = delta2 * windOffset; + d.texcoord0.xy = d.texcoord0.xy + half2(delta.y, -delta.x) * delta_offset * _GrassRadialBend; + #endif + + //-------------------------------------------------------- + + //TEXTURESCROLL_ON && !ATLAS_ON + #if TEXTURESCROLL_ON && !ATLAS_ON + d.texcoord0.x += ((_Time.y + randomSeed) * _TextureScrollXSpeed) % 1; + d.texcoord0.y += ((_Time.y + randomSeed) * _TextureScrollYSpeed) % 1; + #endif + //------------------------------ + + //PIXELATE_ON + #if PIXELATE_ON + half aspectRatio = _MainTex_TexelSize.x / _MainTex_TexelSize.y; + half2 pixelSize = float2(_PixelateSize, _PixelateSize * aspectRatio); + d.texcoord0.xy = floor(d.texcoord0.xy * pixelSize) / pixelSize; + #endif + //-------------- + + half4 col = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy); + half originalAlpha = col.a; + col *= d.vertexColor; + + //NORMAL MAP + #if NORMALMAP_ON + half4 normalSample = SAMPLE_TEXTURE2D(_NormalMap, sampler_NormalMap, d.texcoord0.xy); + half3 normalTS = UnpackNormal(normalSample); + normalTS.xy *= _NormalStrength; + o.Normal = normalTS; + #endif + + + //GLITCH_ON + #if GLITCH_ON + half2 uvGlitch = uvRect; + uvGlitch.y -= 0.5; + half lineNoise = pow(rand2(floor(uvGlitch * half2(24., 19.) * _GlitchSize) * 4.0, randomSeed), 3.0) * _GlitchAmount + * pow(rand2(floor(uvGlitch * half2(38., 14.) * _GlitchSize) * 4.0, randomSeed), 3.0); + col = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(lineNoise * 0.02 * rand2(half2(2.0, 1), randomSeed), 0)) * d.vertexColor; + #endif + //-------------------------------------- + + //CHROMABERR_ON + #if CHROMABERR_ON + half4 r = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(_ChromAberrAmount/10, 0)) * d.vertexColor; + half4 b = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(-_ChromAberrAmount/10, 0)) * d.vertexColor; + col = half4(r.r * r.a, col.g, b.b * b.a, max(max(r.a, b.a) * _ChromAberrAlpha, col.a)); + #endif + + //-------------------------------- + + //BLUR_ON + #if BLUR_ON + #if ATLAS_ON + #if !BLURISHD_ON + col = BlurHD(d.texcoord0.xy, _MainTex, sampler_MainTex, _BlurIntensity, (_MaxXUV - _MinXUV), (_MaxYUV - _MinYUV)) * d.vertexColor; + #else + col = Blur(d.texcoord0.xy, _MainTex, sampler_MainTex, _BlurIntensity * (_MaxXUV - _MinXUV)) * d.vertexColor; + #endif + #else + #if !BLURISHD_ON + col = BlurHD(d.texcoord0.xy, _MainTex, sampler_MainTex, _BlurIntensity, 1, 1) * d.vertexColor; + #else + col = Blur(d.texcoord0.xy, _MainTex, sampler_MainTex, _BlurIntensity) * d.vertexColor; + #endif + #endif + #endif + + //-------------------- + + //MOTIONBLUR_ON + #if MOTIONBLUR_ON + _MotionBlurAngle = _MotionBlurAngle * 3.1415926; + #define rot(n) mul(n, half2x2(cos(_MotionBlurAngle), -sin(_MotionBlurAngle), sin(_MotionBlurAngle), cos(_MotionBlurAngle))) + _MotionBlurDist = _MotionBlurDist * 0.005; + #if ATLAS_ON + _MotionBlurDist *= (_MaxXUV - _MinXUV); + #endif + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(-_MotionBlurDist, -_MotionBlurDist))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(-_MotionBlurDist * 2, -_MotionBlurDist * 2))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(-_MotionBlurDist * 3, -_MotionBlurDist * 3))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(-_MotionBlurDist * 4, -_MotionBlurDist * 4))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(_MotionBlurDist, _MotionBlurDist))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(_MotionBlurDist * 2, _MotionBlurDist * 2))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(_MotionBlurDist * 3, _MotionBlurDist * 3))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(_MotionBlurDist * 4, _MotionBlurDist * 4))); + col.rgb = col.rgb / 9; + #endif + //------------------------------------ + + //NEGATIVE_ON + #if NEGATIVE_ON + col.rgb = lerp(col.rgb, 1 - col.rgb, _NegativeAmount); + #endif + + //-------------- + half luminance = 0; + + //GREYSCALE_ON && !GREYSCALEOUTLINE_ON + #if GREYSCALE_ON && !GREYSCALEOUTLINE_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + luminance = saturate(luminance + _GreyscaleLuminosity); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _GreyscaleTintColor, _GreyscaleBlend); + #endif + //------------------------------------ + + //GHOST_ON + #if GHOST_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + half4 ghostResult; + ghostResult.a = saturate(luminance - _GhostTransparency) * col.a; + ghostResult.rgb = col.rgb * (luminance + _GhostColorBoost); + col = lerp(col, ghostResult, _GhostBlend); + #endif + //------------------------------------ + + //INNEROUTLINE_ON + #if INNEROUTLINE_ON + half3 innerT = abs(GetPixel(0, _InnerOutlineThickness, d.texcoord0.xy, _MainTex, sampler_MainTex) - GetPixel(0, -_InnerOutlineThickness, d.texcoord0.xy, _MainTex, sampler_MainTex)); + innerT += abs(GetPixel(_InnerOutlineThickness, 0, d.texcoord0.xy, _MainTex, sampler_MainTex) - GetPixel(-_InnerOutlineThickness, 0, d.texcoord0.xy, _MainTex, sampler_MainTex)); + #if !ONLYINNEROUTLINE_ON + innerT = (innerT / 2.0) * col.a * _InnerOutlineAlpha; + col.rgb += length(innerT) * _InnerOutlineColor.rgb * _InnerOutlineGlow; + #else + innerT *= col.a * _InnerOutlineAlpha; + col.rgb = length(innerT) * _InnerOutlineColor.rgb * _InnerOutlineGlow; + col.a = step(0.3, col.r+col.g+col.b); + #endif + #endif + //------------------------------------------------------- + + //HITEFFECT_ON + #if HITEFFECT_ON + col.rgb = lerp(col.rgb, _HitEffectColor.rgb * _HitEffectGlow, _HitEffectBlend); + #endif + //-------------------- + + //GRADIENT_ON + #if GRADIENT_ON + half2 tiledUvGrad = half2(uvRect.x / _MainTex_ST.x, uvRect.y / _MainTex_ST.y); + #if GRADIENT2COL_ON + _GradTopRightCol = _GradTopLeftCol; + _GradBotRightCol = _GradBotLeftCol; + #endif + #if RADIALGRADIENT_ON + half radialDist = 1 - length(tiledUvGrad - half2(0.5, 0.5)); + radialDist *= (_MainTex_TexelSize.w / _MainTex_TexelSize.z); + radialDist = saturate(_GradBoostX * radialDist); + half4 gradientResult = lerp(_GradTopLeftCol, _GradBotLeftCol, radialDist); + #else + half gradXLerpFactor = saturate(pow(tiledUvGrad.x, _GradBoostX)); + half4 gradientResult = lerp(lerp(_GradBotLeftCol, _GradBotRightCol, gradXLerpFactor), + lerp(_GradTopLeftCol, _GradTopRightCol, gradXLerpFactor), saturate(pow(tiledUvGrad.y, _GradBoostY))); + #endif + gradientResult = lerp(col, gradientResult, _GradBlend); + col.rgb = gradientResult.rgb * col.a; + col.a *= gradientResult.a; + #endif + //-------------------------------------------------------------------- + + //CONTRAST_ON + #if CONTRAST_ON + col.rgb = (col.rgb - float3(0.5, 0.5, 0.5)) * _Contrast + float3(0.5, 0.5, 0.5); + col.rgb += _Brightness; + #endif + + //------------------------------------------------------------------- + + //COLORSWAP_ON + #if COLORSWAP_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + half4 swapMask = SAMPLE_TEXTURE2D(_ColorSwapTex, sampler_ColorSwapTex, d.texcoord0.xy); + swapMask.rgb *= swapMask.a; + half3 redSwap = _ColorSwapRed * swapMask.r * saturate(luminance + _ColorSwapRedLuminosity); + half3 greenSwap = _ColorSwapGreen * swapMask.g * saturate(luminance + _ColorSwapGreenLuminosity); + half3 blueSwap = _ColorSwapBlue * swapMask.b * saturate(luminance + _ColorSwapBlueLuminosity); + swapMask.rgb = col.rgb * saturate(1 - swapMask.r - swapMask.g - swapMask.b); + col.rgb = lerp(col.rgb, swapMask.rgb + redSwap + greenSwap + blueSwap, _ColorSwapBlend); + #endif + //-------------------------------------------------------------------- + + //COLORRAMP_ON && !COLORRAMPOUTLINE_ON + #if COLORRAMP_ON && !COLORRAMPOUTLINE_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + luminance = saturate(luminance + _ColorRampLuminosity); + #if GRADIENTCOLORRAMP_ON + col.rgb = lerp(col.rgb, SAMPLE_TEXTURE2D(_ColorRampTexGradient, sampler_ColorRampTexGradient, half2(luminance, 0)).rgb, _ColorRampBlend); + #else + col.rgb = lerp(col.rgb, SAMPLE_TEXTURE2D(_ColorRampTex, sampler_ColorRampTex, half2(luminance, 0)).rgb, _ColorRampBlend); + #endif + #endif + //-------------------------------------------------------------------- + + //CHANGECOLOR_ON + #if CHANGECOLOR_ON + float3 currChangeColor = saturate(col.rgb); + luminance = 0.3 * currChangeColor.r + 0.59 * currChangeColor.g + 0.11 * currChangeColor.b; + luminance = saturate(luminance + _ColorChangeLuminosity); + half3 dif = abs(currChangeColor - _ColorChangeTarget.rgb); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _ColorChangeNewCol.rgb, + max(sign(1 - saturate(dif.x + dif.y + dif.z) - _ColorChangeTolerance), 0.0)); + #if CHANGECOLOR2_ON + dif = abs(currChangeColor - _ColorChangeTarget2.rgb); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _ColorChangeNewCol2.rgb, + max(sign(1 - saturate(dif.x + dif.y + dif.z) - _ColorChangeTolerance2), 0.0)); + #endif + #if CHANGECOLOR3_ON + dif = abs(currChangeColor - _ColorChangeTarget3.rgb); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _ColorChangeNewCol3.rgb, + max(sign(1 - saturate(dif.x + dif.y + dif.z) - _ColorChangeTolerance3), 0.0)); + #endif + #endif + //------------------------------------------------------- + + //POSTERIZE_ON && !POSTERIZEOUTLINE_ON + #if POSTERIZE_ON && !POSTERIZEOUTLINE_ON + col.rgb = pow(col.rgb, _PosterizeGamma) * _PosterizeNumColors; + col.rgb = floor(col.rgb) / _PosterizeNumColors; + col.rgb = pow(col.rgb, 1.0 / _PosterizeGamma); + #endif + //------------------------------------ + + //HSV_ON + #if HSV_ON + half3 resultHsv = half3(col.rgb); + half cosHsv = _HsvBright * _HsvSaturation * cos(_HsvShift * 3.14159265 / 180); + half sinHsv = _HsvBright * _HsvSaturation * sin(_HsvShift * 3.14159265 / 180); + resultHsv.x = (.299 * _HsvBright + .701 * cosHsv + .168 * sinHsv) * col.x + + (.587 * _HsvBright - .587 * cosHsv + .330 * sinHsv) * col.y + + (.114 * _HsvBright - .114 * cosHsv - .497 * sinHsv) * col.z; + resultHsv.y = (.299 * _HsvBright - .299 * cosHsv - .328 * sinHsv) *col.x + + (.587 * _HsvBright + .413 * cosHsv + .035 * sinHsv) * col.y + + (.114 * _HsvBright - .114 * cosHsv + .292 * sinHsv) * col.z; + resultHsv.z = (.299 * _HsvBright - .3 * cosHsv + 1.25 * sinHsv) * col.x + + (.587 * _HsvBright - .588 * cosHsv - 1.05 * sinHsv) * col.y + + (.114 * _HsvBright + .886 * cosHsv - .203 * sinHsv) * col.z; + col.rgb = resultHsv; + #endif + //------------------------------------------------------- + + //OVERLAY_ON + #if OVERLAY_ON + half2 overlayUvs = d.texcoord0.xy; + overlayUvs.x += ((_Time.y + randomSeed) * _OverlayTextureScrollXSpeed) % 1; + overlayUvs.y += ((_Time.y + randomSeed) * _OverlayTextureScrollYSpeed) % 1; + half4 overlayCol = SAMPLE_TEXTURE2D(_OverlayTex, sampler_OverlayTex, TRANSFORM_TEX(overlayUvs, _OverlayTex)); + overlayCol.rgb *= _OverlayColor.rgb * _OverlayGlow; + #if !OVERLAYMULT_ON + overlayCol.rgb *= overlayCol.a * _OverlayColor.rgb * _OverlayColor.a * _OverlayBlend; + col.rgb += overlayCol.rgb; + #else + overlayCol.a *= _OverlayColor.a; + col = lerp(col, col * overlayCol, _OverlayBlend); + #endif + #endif + + //--------------------------------- + + //OUTBASE_ON + #if OUTBASE_ON + #if OUTBASEPIXELPERF_ON + half2 destUv = half2(_OutlinePixelWidth * _MainTex_TexelSize.x, _OutlinePixelWidth * _MainTex_TexelSize.y); + #else + half2 destUv = half2(_OutlineWidth * _MainTex_TexelSize.x * 200, _OutlineWidth * _MainTex_TexelSize.y * 200); + #endif + + #if OUTDIST_ON + d.texcoord3.x += ((_Time.x + _RandomSeed) * _OutlineDistortTexXSpeed) % 1; + d.texcoord3.y += ((_Time.x + _RandomSeed) * _OutlineDistortTexYSpeed) % 1; + #if ATLAS_ON + d.texcoord3 = half2((d.texcoord3.x - _MinXUV) / (_MaxXUV - _MinXUV), (d.texcoord3.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half outDistortAmnt = (SAMPLE_TEXTURE2D(_OutlineDistortTex, sampler_OutlineDistortTex, d.texcoord3).r - 0.5) * 0.2 * _OutlineDistortAmount; + destUv.x += outDistortAmnt; + destUv.y += outDistortAmnt; + #endif + + half spriteLeft = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(destUv.x, 0)).a; + half spriteRight = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy - half2(destUv.x, 0)).a; + half spriteBottom = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(0, destUv.y)).a; + half spriteTop = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy - half2(0, destUv.y)).a; + half result = spriteLeft + spriteRight + spriteBottom + spriteTop; + + #if OUTBASE8DIR_ON + half spriteTopLeft = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(destUv.x, destUv.y)).a; + half spriteTopRight = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(-destUv.x, destUv.y)).a; + half spriteBotLeft = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(destUv.x, -destUv.y)).a; + half spriteBotRight = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(-destUv.x, -destUv.y)).a; + result = result + spriteTopLeft + spriteTopRight + spriteBotLeft + spriteBotRight; + #endif + + result = step(0.05, saturate(result)); + + #if OUTTEX_ON + d.texcoord1.x += ((_Time.x + _RandomSeed) * _OutlineTexXSpeed) % 1; + d.texcoord1.y += ((_Time.x + _RandomSeed) * _OutlineTexYSpeed) % 1; + #if ATLAS_ON + d.texcoord1 = half2((d.texcoord1.x - _MinXUV) / (_MaxXUV - _MinXUV), (d.texcoord1.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half4 tempOutColor = SAMPLE_TEXTURE2D(_OutlineTex, sampler_OutlineTex, d.texcoord1); + tempOutColor *= _OutlineColor; + _OutlineColor = tempOutColor; + #endif + + result *= (1 - originalAlpha) * _OutlineAlpha; + + half4 outline = _OutlineColor * d.vertexColor.a; + outline.rgb *= _OutlineGlow; + outline.a = result; + #if ONLYOUTLINE_ON + col = outline; + #else + col = lerp(col, outline, result); + #endif + #endif + //------------------------------------------------------- + + //FADE_ON + #if FADE_ON + half2 tiledUvFade1 = TRANSFORM_TEX(d.texcoord0, _FadeTex); + half2 tiledUvFade2 = TRANSFORM_TEX(d.texcoord0, _FadeBurnTex); + #if ATLAS_ON + tiledUvFade1 = half2((tiledUvFade1.x - _MinXUV) / (_MaxXUV - _MinXUV), (tiledUvFade1.y - _MinYUV) / (_MaxYUV - _MinYUV)); + tiledUvFade2 = half2((tiledUvFade2.x - _MinXUV) / (_MaxXUV - _MinXUV), (tiledUvFade2.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half fadeTemp = SAMPLE_TEXTURE2D(_FadeTex, sampler_FadeTex, tiledUvFade1).r; + half fade = smoothstep(_FadeAmount, _FadeAmount + _FadeBurnTransition, fadeTemp); + half fadeBurn = saturate(smoothstep(_FadeAmount - _FadeBurnWidth, _FadeAmount - _FadeBurnWidth + 0.1, fadeTemp) * _FadeAmount); + col.a *= fade; + _FadeBurnColor.rgb *= _FadeBurnGlow; + col += fadeBurn * SAMPLE_TEXTURE2D(_FadeBurnTex, sampler_FadeBurnTex, tiledUvFade2) * _FadeBurnColor * originalAlpha * (1 - col.a); + #endif + //------------------------------------------------------- + + //SHADOW_ON + #if SHADOW_ON + half shadowA = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(_ShadowX, _ShadowY)).a; + half preMultShadowMask = 1 - (saturate(shadowA - col.a) * (1 - col.a)); + col.rgb *= 1 - ((shadowA - col.a) * (1 - col.a)); + col.rgb += (_ShadowColor * shadowA) * (1 - col.a); + col.a = max(shadowA * _ShadowAlpha * d.vertexColor.a, col.a); + #endif + + //------------------------------------------------------- + + //GLOW_ON + #if GLOW_ON + half4 emission; + #if GLOWTEX_ON + emission = SAMPLE_TEXTURE2D(_GlowTex, sampler_GlowTex, d.texcoord0); + #else + emission = col; + #endif + + col.rgb *= _GlowGlobal; + emission.rgb *= emission.a * col.a * _Glow * _GlowColor; + col.rgb += emission.rgb; + #endif + //------------------------------------------------------- + + //COLORRAMP_ON && COLORRAMPOUTLINE_ON + #if COLORRAMP_ON && COLORRAMPOUTLINE_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + luminance = saturate(luminance + _ColorRampLuminosity); + #if GRADIENTCOLORRAMP_ON + col.rgb = lerp(col.rgb, SAMPLE_TEXTURE2D(_ColorRampTexGradient, sampler_ColorRampTexGradient, half2(luminance, 0)).rgb, _ColorRampBlend); + #else + col.rgb = lerp(col.rgb, SAMPLE_TEXTURE2D(_ColorRampTex, sampler_ColorRampTex, half2(luminance, 0)).rgb, _ColorRampBlend); + #endif + #endif + //--------------- + + //GREYSCALE_ON && GREYSCALEOUTLINE_ON + #if GREYSCALE_ON && GREYSCALEOUTLINE_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + luminance = saturate(luminance + _GreyscaleLuminosity); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _GreyscaleTintColor, _GreyscaleBlend); + #endif + + //----------------------------------- + + //POSTERIZE_ON && POSTERIZEOUTLINE_ON + #if POSTERIZE_ON && POSTERIZEOUTLINE_ON + col.rgb = pow(col.rgb, _PosterizeGamma) * _PosterizeNumColors; + col.rgb = floor(col.rgb) / _PosterizeNumColors; + col.rgb = pow(col.rgb, 1.0 / _PosterizeGamma); + #endif + + //----------------------------------- + + //SHINE_ON + #if SHINE_ON + half2 uvShine = uvRect; + half cosAngle = cos(_ShineRotate); + half sinAngle = sin(_ShineRotate); + half2x2 rot = half2x2(cosAngle, -sinAngle, sinAngle, cosAngle); + uvShine -= half2(0.5, 0.5); + uvShine = mul(rot, uvShine); + uvShine += half2(0.5, 0.5); + half shineMask = SAMPLE_TEXTURE2D(_ShineMask, sampler_ShineMask, d.texcoord0.xy).a; + half currentDistanceProjection = (uvShine.x + uvShine.y) / 2; + half whitePower = 1 - (abs(currentDistanceProjection - _ShineLocation) / _ShineWidth); + col.rgb += col.a * whitePower * _ShineGlow * max(sign(currentDistanceProjection - (_ShineLocation - _ShineWidth)), 0.0) + * max(sign((_ShineLocation + _ShineWidth) - currentDistanceProjection), 0.0) * _ShineColor * shineMask; + #endif + + //----------------------------------- + + //HOLOGRAM_ON + #if HOLOGRAM_ON + half totalHologram = _HologramStripesAmount + _HologramUnmodAmount; + half hologramYCoord = ((uvRect.y + (((_Time.x + randomSeed) % 1) * _HologramStripesSpeed)) % totalHologram) / totalHologram; + hologramYCoord = abs(hologramYCoord); + half alpha = RemapFloat(saturate(hologramYCoord - (_HologramUnmodAmount/totalHologram)), 0.0, 1.0, _HologramMinAlpha, saturate(_HologramMaxAlpha)); + half hologramMask = max(sign((_HologramUnmodAmount/totalHologram) - hologramYCoord), 0.0); + half4 hologramResult = col; + hologramResult.a *= lerp(alpha, 1, hologramMask); + hologramResult.rgb *= max(1, _HologramMaxAlpha * max(sign(hologramYCoord - (_HologramUnmodAmount/totalHologram)), 0.0)); + hologramMask = 1 - step(0.01,hologramMask); + hologramResult.rgb += hologramMask * _HologramStripeColor * col.a; + col = lerp(col, hologramResult, _HologramBlend); + #endif + + //----------------------------------- + + //FLICKER_ON + #if FLICKER_ON + col.a *= saturate(col.a * step(frac(0.05 + (_Time.w + randomSeed) * _FlickerFreq), 1 - _FlickerPercent) + _FlickerAlpha); + #endif + //----------------------------------- + + //ALPHACUTOFF_ON + + //ALPHAROUND_ON + + //ALPHAOUTLINE_ON + #if ALPHAOUTLINE_ON + half alphaOutlineRes = pow(1 - col.a, max(_AlphaOutlinePower, 0.0001)) * step(_AlphaOutlineMinAlpha, col.a) * _AlphaOutlineBlend; + col.rgb = lerp(col.rgb, _AlphaOutlineColor.rgb * _AlphaOutlineGlow, alphaOutlineRes); + col.a = lerp(col.a, 1, alphaOutlineRes > 1); + #endif + //------------------------------------------------------- + + //FOG_ON + + //------------------ + + col *= _Color; + o.Albedo = col; + col.a *= _Alpha; + clip(col.a - _AlphaCutoffValue - 0.01); + o.Alpha = _Color.a; + } + + + + + + void ChainSurfaceFunction(inout Surface l, inout ShaderData d) + { + Ext_SurfaceFunction0(l, d); + // Ext_SurfaceFunction1(l, d); + // Ext_SurfaceFunction2(l, d); + // Ext_SurfaceFunction3(l, d); + // Ext_SurfaceFunction4(l, d); + // Ext_SurfaceFunction5(l, d); + // Ext_SurfaceFunction6(l, d); + // Ext_SurfaceFunction7(l, d); + // Ext_SurfaceFunction8(l, d); + // Ext_SurfaceFunction9(l, d); + // Ext_SurfaceFunction10(l, d); + // Ext_SurfaceFunction11(l, d); + // Ext_SurfaceFunction12(l, d); + // Ext_SurfaceFunction13(l, d); + // Ext_SurfaceFunction14(l, d); + // Ext_SurfaceFunction15(l, d); + // Ext_SurfaceFunction16(l, d); + // Ext_SurfaceFunction17(l, d); + // Ext_SurfaceFunction18(l, d); + // Ext_SurfaceFunction19(l, d); + // Ext_SurfaceFunction20(l, d); + // Ext_SurfaceFunction21(l, d); + // Ext_SurfaceFunction22(l, d); + // Ext_SurfaceFunction23(l, d); + // Ext_SurfaceFunction24(l, d); + // Ext_SurfaceFunction25(l, d); + // Ext_SurfaceFunction26(l, d); + // Ext_SurfaceFunction27(l, d); + // Ext_SurfaceFunction28(l, d); + // Ext_SurfaceFunction29(l, d); + } + +#if !_DECALSHADER + + void ChainModifyVertex(inout VertexData v, inout VertexToPixel v2p, float4 time) + { + ExtraV2F d; + + ZERO_INITIALIZE(ExtraV2F, d); + ZERO_INITIALIZE(Blackboard, d.blackboard); + // due to motion vectors in HDRP, we need to use the last + // time in certain spots. So if you are going to use _Time to adjust vertices, + // you need to use this time or motion vectors will break. + d.time = time; + + Ext_ModifyVertex0(v, d); + // Ext_ModifyVertex1(v, d); + // Ext_ModifyVertex2(v, d); + // Ext_ModifyVertex3(v, d); + // Ext_ModifyVertex4(v, d); + // Ext_ModifyVertex5(v, d); + // Ext_ModifyVertex6(v, d); + // Ext_ModifyVertex7(v, d); + // Ext_ModifyVertex8(v, d); + // Ext_ModifyVertex9(v, d); + // Ext_ModifyVertex10(v, d); + // Ext_ModifyVertex11(v, d); + // Ext_ModifyVertex12(v, d); + // Ext_ModifyVertex13(v, d); + // Ext_ModifyVertex14(v, d); + // Ext_ModifyVertex15(v, d); + // Ext_ModifyVertex16(v, d); + // Ext_ModifyVertex17(v, d); + // Ext_ModifyVertex18(v, d); + // Ext_ModifyVertex19(v, d); + // Ext_ModifyVertex20(v, d); + // Ext_ModifyVertex21(v, d); + // Ext_ModifyVertex22(v, d); + // Ext_ModifyVertex23(v, d); + // Ext_ModifyVertex24(v, d); + // Ext_ModifyVertex25(v, d); + // Ext_ModifyVertex26(v, d); + // Ext_ModifyVertex27(v, d); + // Ext_ModifyVertex28(v, d); + // Ext_ModifyVertex29(v, d); + + + // #if %EXTRAV2F0REQUIREKEY% + // v2p.extraV2F0 = d.extraV2F0; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // v2p.extraV2F1 = d.extraV2F1; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // v2p.extraV2F2 = d.extraV2F2; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // v2p.extraV2F3 = d.extraV2F3; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // v2p.extraV2F4 = d.extraV2F4; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // v2p.extraV2F5 = d.extraV2F5; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // v2p.extraV2F6 = d.extraV2F6; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // v2p.extraV2F7 = d.extraV2F7; + // #endif + } + + void ChainModifyTessellatedVertex(inout VertexData v, inout VertexToPixel v2p) + { + ExtraV2F d; + ZERO_INITIALIZE(ExtraV2F, d); + ZERO_INITIALIZE(Blackboard, d.blackboard); + + // #if %EXTRAV2F0REQUIREKEY% + // d.extraV2F0 = v2p.extraV2F0; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // d.extraV2F1 = v2p.extraV2F1; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // d.extraV2F2 = v2p.extraV2F2; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // d.extraV2F3 = v2p.extraV2F3; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // d.extraV2F4 = v2p.extraV2F4; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // d.extraV2F5 = v2p.extraV2F5; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // d.extraV2F6 = v2p.extraV2F6; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // d.extraV2F7 = v2p.extraV2F7; + // #endif + + + // Ext_ModifyTessellatedVertex0(v, d); + // Ext_ModifyTessellatedVertex1(v, d); + // Ext_ModifyTessellatedVertex2(v, d); + // Ext_ModifyTessellatedVertex3(v, d); + // Ext_ModifyTessellatedVertex4(v, d); + // Ext_ModifyTessellatedVertex5(v, d); + // Ext_ModifyTessellatedVertex6(v, d); + // Ext_ModifyTessellatedVertex7(v, d); + // Ext_ModifyTessellatedVertex8(v, d); + // Ext_ModifyTessellatedVertex9(v, d); + // Ext_ModifyTessellatedVertex10(v, d); + // Ext_ModifyTessellatedVertex11(v, d); + // Ext_ModifyTessellatedVertex12(v, d); + // Ext_ModifyTessellatedVertex13(v, d); + // Ext_ModifyTessellatedVertex14(v, d); + // Ext_ModifyTessellatedVertex15(v, d); + // Ext_ModifyTessellatedVertex16(v, d); + // Ext_ModifyTessellatedVertex17(v, d); + // Ext_ModifyTessellatedVertex18(v, d); + // Ext_ModifyTessellatedVertex19(v, d); + // Ext_ModifyTessellatedVertex20(v, d); + // Ext_ModifyTessellatedVertex21(v, d); + // Ext_ModifyTessellatedVertex22(v, d); + // Ext_ModifyTessellatedVertex23(v, d); + // Ext_ModifyTessellatedVertex24(v, d); + // Ext_ModifyTessellatedVertex25(v, d); + // Ext_ModifyTessellatedVertex26(v, d); + // Ext_ModifyTessellatedVertex27(v, d); + // Ext_ModifyTessellatedVertex28(v, d); + // Ext_ModifyTessellatedVertex29(v, d); + + // #if %EXTRAV2F0REQUIREKEY% + // v2p.extraV2F0 = d.extraV2F0; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // v2p.extraV2F1 = d.extraV2F1; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // v2p.extraV2F2 = d.extraV2F2; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // v2p.extraV2F3 = d.extraV2F3; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // v2p.extraV2F4 = d.extraV2F4; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // v2p.extraV2F5 = d.extraV2F5; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // v2p.extraV2F6 = d.extraV2F6; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // v2p.extraV2F7 = d.extraV2F7; + // #endif + } + + void ChainFinalColorForward(inout Surface l, inout ShaderData d, inout half4 color) + { + // Ext_FinalColorForward0(l, d, color); + // Ext_FinalColorForward1(l, d, color); + // Ext_FinalColorForward2(l, d, color); + // Ext_FinalColorForward3(l, d, color); + // Ext_FinalColorForward4(l, d, color); + // Ext_FinalColorForward5(l, d, color); + // Ext_FinalColorForward6(l, d, color); + // Ext_FinalColorForward7(l, d, color); + // Ext_FinalColorForward8(l, d, color); + // Ext_FinalColorForward9(l, d, color); + // Ext_FinalColorForward10(l, d, color); + // Ext_FinalColorForward11(l, d, color); + // Ext_FinalColorForward12(l, d, color); + // Ext_FinalColorForward13(l, d, color); + // Ext_FinalColorForward14(l, d, color); + // Ext_FinalColorForward15(l, d, color); + // Ext_FinalColorForward16(l, d, color); + // Ext_FinalColorForward17(l, d, color); + // Ext_FinalColorForward18(l, d, color); + // Ext_FinalColorForward19(l, d, color); + // Ext_FinalColorForward20(l, d, color); + // Ext_FinalColorForward21(l, d, color); + // Ext_FinalColorForward22(l, d, color); + // Ext_FinalColorForward23(l, d, color); + // Ext_FinalColorForward24(l, d, color); + // Ext_FinalColorForward25(l, d, color); + // Ext_FinalColorForward26(l, d, color); + // Ext_FinalColorForward27(l, d, color); + // Ext_FinalColorForward28(l, d, color); + // Ext_FinalColorForward29(l, d, color); + } + + void ChainFinalGBufferStandard(inout Surface s, inout ShaderData d, inout half4 GBuffer0, inout half4 GBuffer1, inout half4 GBuffer2, inout half4 outEmission, inout half4 outShadowMask) + { + // Ext_FinalGBufferStandard0(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard1(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard2(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard3(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard4(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard5(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard6(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard7(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard8(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard9(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard10(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard11(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard12(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard13(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard14(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard15(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard16(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard17(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard18(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard19(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard20(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard21(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard22(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard23(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard24(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard25(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard26(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard27(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard28(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard29(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + } +#endif + + + + + +#if _DECALSHADER + + ShaderData CreateShaderData(SurfaceDescriptionInputs IN) + { + ShaderData d = (ShaderData)0; + d.TBNMatrix = float3x3(IN.WorldSpaceTangent, IN.WorldSpaceBiTangent, IN.WorldSpaceNormal); + d.worldSpaceNormal = IN.WorldSpaceNormal; + d.worldSpaceTangent = IN.WorldSpaceTangent; + + d.worldSpacePosition = IN.WorldSpacePosition; + d.texcoord0 = IN.uv0.xyxy; + d.screenPos = IN.ScreenPosition; + + d.worldSpaceViewDir = normalize(_WorldSpaceCameraPos - d.worldSpacePosition); + + d.tangentSpaceViewDir = mul(d.TBNMatrix, d.worldSpaceViewDir); + + // these rarely get used, so we back transform them. Usually will be stripped. + #if _HDRP + // d.localSpacePosition = mul(GetWorldToObjectMatrix(), float4(GetCameraRelativePositionWS(d.worldSpacePosition), 1)).xyz; + #else + // d.localSpacePosition = mul(GetWorldToObjectMatrix(), float4(d.worldSpacePosition, 1)).xyz; + #endif + // d.localSpaceNormal = normalize(mul((float3x3)GetWorldToObjectMatrix(), d.worldSpaceNormal)); + // d.localSpaceTangent = normalize(mul((float3x3)GetWorldToObjectMatrix(), d.worldSpaceTangent.xyz)); + + // #if %SCREENPOSREQUIREKEY% + // d.screenUV = (IN.ScreenPosition.xy / max(0.01, IN.ScreenPosition.w)); + // #endif + + return d; + } +#else + + ShaderData CreateShaderData(VertexToPixel i + #if NEED_FACING + , bool facing + #endif + ) + { + ShaderData d = (ShaderData)0; + d.clipPos = i.pos; + d.worldSpacePosition = i.worldPos; + + d.worldSpaceNormal = normalize(i.worldNormal); + d.worldSpaceTangent.xyz = normalize(i.worldTangent.xyz); + + d.tangentSign = i.worldTangent.w * unity_WorldTransformParams.w; + float3 bitangent = cross(d.worldSpaceTangent.xyz, d.worldSpaceNormal) * d.tangentSign; + + d.TBNMatrix = float3x3(d.worldSpaceTangent, -bitangent, d.worldSpaceNormal); + d.worldSpaceViewDir = normalize(_WorldSpaceCameraPos - i.worldPos); + + d.tangentSpaceViewDir = mul(d.TBNMatrix, d.worldSpaceViewDir); + d.texcoord0 = i.texcoord0; + d.texcoord1 = i.texcoord1; + d.texcoord2 = i.texcoord2; + + // #if %TEXCOORD3REQUIREKEY% + d.texcoord3 = i.texcoord3; + // #endif + + // d.isFrontFace = facing; + // #if %VERTEXCOLORREQUIREKEY% + d.vertexColor = i.vertexColor; + // #endif + + // these rarely get used, so we back transform them. Usually will be stripped. + #if _HDRP + // d.localSpacePosition = mul(GetWorldToObjectMatrix(), float4(GetCameraRelativePositionWS(i.worldPos), 1)).xyz; + #else + // d.localSpacePosition = mul(GetWorldToObjectMatrix(), float4(i.worldPos, 1)).xyz; + #endif + // d.localSpaceNormal = normalize(mul((float3x3)GetWorldToObjectMatrix(), i.worldNormal)); + // d.localSpaceTangent = normalize(mul((float3x3)GetWorldToObjectMatrix(), i.worldTangent.xyz)); + + // #if %SCREENPOSREQUIREKEY% + // d.screenPos = i.screenPos; + // d.screenUV = (i.screenPos.xy / i.screenPos.w); + // #endif + + + // #if %EXTRAV2F0REQUIREKEY% + // d.extraV2F0 = i.extraV2F0; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // d.extraV2F1 = i.extraV2F1; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // d.extraV2F2 = i.extraV2F2; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // d.extraV2F3 = i.extraV2F3; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // d.extraV2F4 = i.extraV2F4; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // d.extraV2F5 = i.extraV2F5; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // d.extraV2F6 = i.extraV2F6; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // d.extraV2F7 = i.extraV2F7; + // #endif + + return d; + } + +#endif + + + +#if (SHADERPASS == SHADERPASS_LIGHT_TRANSPORT) + + // This was not in constant buffer in original unity, so keep outiside. But should be in as ShaderRenderPass frequency + float unity_OneOverOutputBoost; + float unity_MaxOutputValue; + + CBUFFER_START(UnityMetaPass) + // x = use uv1 as raster position + // y = use uv2 as raster position + bool4 unity_MetaVertexControl; + + // x = return albedo + // y = return normal + bool4 unity_MetaFragmentControl; + CBUFFER_END + + VertexToPixel Vert(VertexData inputMesh) + { + VertexToPixel output; + ZERO_INITIALIZE(VertexToPixel, output); + UNITY_SETUP_INSTANCE_ID(inputMesh); + UNITY_TRANSFER_INSTANCE_ID(inputMesh, output); + UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(output); + + // Output UV coordinate in vertex shader + float2 uv = float2(0.0, 0.0); + + if (unity_MetaVertexControl.x) + { + uv = inputMesh.texcoord1.xy * unity_LightmapST.xy + unity_LightmapST.zw; + } + else if (unity_MetaVertexControl.y) + { + uv = inputMesh.texcoord2.xy * unity_DynamicLightmapST.xy + unity_DynamicLightmapST.zw; + } + + // OpenGL right now needs to actually use the incoming vertex position + // so we create a fake dependency on it here that haven't any impact. + output.pos = float4(uv * 2.0 - 1.0, inputMesh.vertex.z > 0 ? 1.0e-4 : 0.0, 1.0); + + output.worldPos = TransformObjectToWorld(inputMesh.vertex.xyz).xyz; + + // Normal is required for triplanar mapping + output.worldNormal = TransformObjectToWorldNormal(inputMesh.normal); + // Not required but assign to silent compiler warning + output.worldTangent = float4(1.0, 0.0, 0.0, 0.0); + + output.texcoord0 = inputMesh.texcoord0; + output.texcoord1 = inputMesh.texcoord1; + output.texcoord2 = inputMesh.texcoord2; + // #if %TEXCOORD3REQUIREKEY% + output.texcoord3 = inputMesh.texcoord3; + // #endif + // #if %VERTEXCOLORREQUIREKEY% + output.vertexColor = inputMesh.vertexColor; + // #endif + + return output; + } +#else + + #if (_PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR))) + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/ShaderVariablesMatrixDefsHDCamera.hlsl" + + void MotionVectorPositionZBias(VertexToPixel input) + { + #if UNITY_REVERSED_Z + input.pos.z -= unity_MotionVectorsParams.z * input.pos.w; + #else + input.pos.z += unity_MotionVectorsParams.z * input.pos.w; + #endif + } + + #endif + + VertexToPixel Vert(VertexData input) + { + VertexToPixel output; + ZERO_INITIALIZE(VertexToPixel, output); + + UNITY_SETUP_INSTANCE_ID(input); + UNITY_TRANSFER_INSTANCE_ID(input, output); + UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(output); + + #if _HDRP && (_PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR))) + VertexData previousMesh = input; + #endif + + ChainModifyVertex(input, output, _Time); + + // This return the camera relative position (if enable) + float3 positionRWS = TransformObjectToWorld(input.vertex.xyz); + float3 normalWS = TransformObjectToWorldNormal(input.normal); + float4 tangentWS = float4(TransformObjectToWorldDir(input.tangent.xyz), input.tangent.w); + + + output.worldPos = GetAbsolutePositionWS(positionRWS); + output.pos = TransformWorldToHClip(positionRWS); + output.worldNormal = normalWS; + output.worldTangent = tangentWS; + + + output.texcoord0 = input.texcoord0; + output.texcoord1 = input.texcoord1; + output.texcoord2 = input.texcoord2; + + // #if %TEXCOORD3REQUIREKEY% + output.texcoord3 = input.texcoord3; + // #endif + + // #if %VERTEXCOLORREQUIREKEY% + output.vertexColor = input.vertexColor; + // #endif + + // #if %SCREENPOSREQUIREKEY% + // output.screenPos = ComputeScreenPos(output.pos, _ProjectionParams.x); + // #endif + + #if _HDRP && (_PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR))) + + #if !defined(TESSELLATION_ON) + MotionVectorPositionZBias(output); + #endif + + output.motionVectorCS = mul(UNITY_MATRIX_UNJITTERED_VP, float4(positionRWS.xyz, 1.0)); + // Note: unity_MotionVectorsParams.y is 0 is forceNoMotion is enabled + bool forceNoMotion = unity_MotionVectorsParams.y == 0.0; + if (forceNoMotion) + { + output.previousPositionCS = float4(0.0, 0.0, 0.0, 1.0); + } + else + { + bool hasDeformation = unity_MotionVectorsParams.x > 0.0; // Skin or morph target + + float3 effectivePositionOS = (hasDeformation ? previousMesh.previousPositionOS : previousMesh.vertex.xyz); + #if defined(_ADD_PRECOMPUTED_VELOCITY) + effectivePositionOS -= input.precomputedVelocity; + #endif + + previousMesh.vertex = float4(effectivePositionOS, 1); + VertexToPixel dummy = (VertexToPixel)0; + + + ChainModifyVertex(previousMesh, dummy, _LastTimeParameters); + + // we might need this for skinned objects? + //float3 normalWS = TransformPreviousObjectToWorldNormal(input.normal).xyz; + float3 previousPositionRWS = TransformPreviousObjectToWorld(previousMesh.vertex.xyz); + + #ifdef _WRITE_TRANSPARENT_MOTION_VECTOR + if (_TransparentCameraOnlyMotionVectors > 0) + { + previousPositionRWS = positionRWS.xyz; + } + #endif // _WRITE_TRANSPARENT_MOTION_VECTOR + + output.previousPositionCS = mul(UNITY_MATRIX_PREV_VP, float4(previousPositionRWS, 1.0)); + } + #endif // _HDRP && _PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR)) + + + return output; + } + + +#endif + + + + + + + + #if defined(WRITE_DECAL_BUFFER) && !defined(_DISABLE_DECALS) + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/Decal/DecalPrepassBuffer.hlsl" + #endif + + FragInputs BuildFragInputs(VertexToPixel input) + { + UNITY_SETUP_INSTANCE_ID(input); + FragInputs output; + ZERO_INITIALIZE(FragInputs, output); + + // Init to some default value to make the computer quiet (else it output 'divide by zero' warning even if value is not used). + // TODO: this is a really poor workaround, but the variable is used in a bunch of places + // to compute normals which are then passed on elsewhere to compute other values... + output.tangentToWorld = k_identity3x3; + output.positionSS = input.pos; // input.positionCS is SV_Position + // BETTER SHADERS: because we transform world position into actual world space for things like + // triplanar, etc, we have to back transform it here for lighting + output.positionRWS = GetCameraRelativePositionWS(input.worldPos); + output.tangentToWorld = BuildTangentToWorld(input.worldTangent, input.worldNormal); + output.texCoord0 = input.texcoord0; + output.texCoord1 = input.texcoord1; + output.texCoord2 = input.texcoord2; + + return output; + } + +#if UNITY_VERSION > UNITY_2022_3_12 + void ApplyDecalAndGetNormal(FragInputs fragInputs, PositionInputs posInput, Surface surfaceDescription, float3 normalTS, + inout SurfaceData surfaceData) + { + float3 doubleSidedConstants = GetDoubleSidedConstants(); + + #ifdef DECAL_NORMAL_BLENDING + // SG nodes don't ouptut surface gradients, so if decals require surf grad blending, we have to convert + // the normal to gradient before applying the decal. We then have to resolve the gradient back to world space + normalTS = SurfaceGradientFromTangentSpaceNormalAndFromTBN(normalTS, + fragInputs.tangentToWorld[0], fragInputs.tangentToWorld[1]); + + + #if HAVE_DECALS + if (_EnableDecals) + { + float alpha = 1.0; + alpha = surfaceDescription.Alpha; + + DecalSurfaceData decalSurfaceData = GetDecalSurfaceData(posInput, fragInputs, alpha); + ApplyDecalToSurfaceNormal(decalSurfaceData, fragInputs.tangentToWorld[2], normalTS); + ApplyDecalToSurfaceDataNoNormal(decalSurfaceData, surfaceData); + } + #endif + + GetNormalWS_SG(fragInputs, normalTS, surfaceData.normalWS, doubleSidedConstants); + #else + // normal delivered to master node + + #if HAVE_DECALS + if (_EnableDecals) + { + float alpha = 1.0; + alpha = surfaceDescription.Alpha; + + // Both uses and modifies 'surfaceData.normalWS'. + DecalSurfaceData decalSurfaceData = GetDecalSurfaceData(posInput, fragInputs, alpha); + ApplyDecalToSurfaceNormal(decalSurfaceData, surfaceData.normalWS.xyz); + ApplyDecalToSurfaceDataNoNormal(decalSurfaceData, surfaceData); + } + #endif + #endif + } +#endif + + void BuildSurfaceData(FragInputs fragInputs, inout Surface surfaceDescription, float3 V, PositionInputs posInput, out SurfaceData surfaceData, out float3 bentNormalWS) + { + // setup defaults -- these are used if the graph doesn't output a value + ZERO_INITIALIZE(SurfaceData, surfaceData); + + // specularOcclusion need to be init ahead of decal to quiet the compiler that modify the SurfaceData struct + // however specularOcclusion can come from the graph, so need to be init here so it can be override. + surfaceData.specularOcclusion = 1.0; + + // copy across graph values, if defined + surfaceData.baseColor = surfaceDescription.Albedo; + surfaceData.perceptualSmoothness = surfaceDescription.Smoothness; + surfaceData.ambientOcclusion = surfaceDescription.Occlusion; + surfaceData.specularOcclusion = surfaceDescription.SpecularOcclusion; + surfaceData.metallic = surfaceDescription.Metallic; + surfaceData.subsurfaceMask = surfaceDescription.SubsurfaceMask; + surfaceData.thickness = surfaceDescription.Thickness; + surfaceData.diffusionProfileHash = asuint(surfaceDescription.DiffusionProfileHash); + #if _USESPECULAR + surfaceData.specularColor = surfaceDescription.Specular; + #endif + surfaceData.coatMask = surfaceDescription.CoatMask; + surfaceData.anisotropy = surfaceDescription.Anisotropy; + surfaceData.iridescenceMask = surfaceDescription.IridescenceMask; + surfaceData.iridescenceThickness = surfaceDescription.IridescenceThickness; + + + + #if defined(_REFRACTION_PLANE) || defined(_REFRACTION_SPHERE) || defined(_REFRACTION_THIN) + if (_EnableSSRefraction) + { + surfaceData.transmittanceMask = (1.0 - surfaceDescription.Alpha); + surfaceDescription.Alpha = 1.0; + } + else + { + surfaceData.ior = surfaceDescription.ior; + surfaceData.transmittanceColor = surfaceDescription.transmittanceColor; + surfaceData.atDistance = surfaceDescription.atDistance; + surfaceData.transmittanceMask = surfaceDescription.transmittanceMask; + surfaceDescription.Alpha = 1.0; + } + #else + surfaceData.ior = 1.0; + surfaceData.transmittanceColor = float3(1.0, 1.0, 1.0); + surfaceData.atDistance = 1.0; + surfaceData.transmittanceMask = 0.0; + #endif + + + + // These static material feature allow compile time optimization + surfaceData.materialFeatures = MATERIALFEATUREFLAGS_LIT_STANDARD; + #ifdef _MATERIAL_FEATURE_SUBSURFACE_SCATTERING + surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_SUBSURFACE_SCATTERING; + #endif + + #ifdef _MATERIAL_FEATURE_TRANSMISSION + surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_TRANSMISSION; + #endif + + #ifdef _MATERIAL_FEATURE_ANISOTROPY + surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_ANISOTROPY; + surfaceData.normalWS = float3(0, 1, 0); + #endif + + #ifdef _MATERIAL_FEATURE_IRIDESCENCE + surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_IRIDESCENCE; + #endif + + #ifdef _MATERIAL_FEATURE_SPECULAR_COLOR + surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_SPECULAR_COLOR; + #endif + + #if defined(_MATERIAL_FEATURE_CLEAR_COAT) || _CLEARCOAT + surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_CLEAR_COAT; + #endif + + #if defined (_MATERIAL_FEATURE_SPECULAR_COLOR) && defined (_ENERGY_CONSERVING_SPECULAR) + // Require to have setup baseColor + // Reproduce the energy conservation done in legacy Unity. Not ideal but better for compatibility and users can unchek it + surfaceData.baseColor *= (1.0 - Max3(surfaceData.specularColor.r, surfaceData.specularColor.g, surfaceData.specularColor.b)); + #endif + + float3 normalTS = surfaceDescription.Normal; + #if !_WORLDSPACENORMAL + surfaceData.normalWS = mul(surfaceDescription.Normal, fragInputs.tangentToWorld); + #else + normalTS = mul(fragInputs.tangentToWorld, surfaceDescription.Normal); + surfaceData.normalWS = surfaceDescription.Normal; + #endif + + + #if UNITY_VERSION > UNITY_2022_3_12 + ApplyDecalAndGetNormal(fragInputs, posInput, surfaceDescription, normalTS, surfaceData); + #else + #ifdef DECAL_NORMAL_BLENDING + #if HAVE_DECALS + float alpha = 1.0; + alpha = surfaceDescription.Alpha; + if (_EnableDecals) + { + DecalSurfaceData decalSurfaceData = GetDecalSurfaceData(posInput, fragInputs, alpha); + ApplyDecalToSurfaceData(decalSurfaceData, fragInputs.tangentToWorld[2], surfaceData, normalTS); + } + #endif + #else + #if HAVE_DECALS + if (_EnableDecals) + { + float alpha = 1.0; + alpha = surfaceDescription.Alpha; + // Both uses and modifies 'surfaceData.normalWS'. + DecalSurfaceData decalSurfaceData = GetDecalSurfaceData(posInput, fragInputs, alpha); + ApplyDecalToSurfaceData(decalSurfaceData, fragInputs.tangentToWorld[2], surfaceData); + } + #endif + #endif + #endif + + + + surfaceData.geomNormalWS = fragInputs.tangentToWorld[2]; + + surfaceData.tangentWS = normalize(fragInputs.tangentToWorld[0].xyz); // The tangent is not normalize in tangentToWorld for mikkt. TODO: Check if it expected that we normalize with Morten. Tag: SURFACE_GRADIENT + + + bentNormalWS = surfaceData.normalWS; + + surfaceData.tangentWS = Orthonormalize(surfaceData.tangentWS, surfaceData.normalWS); + + #ifdef DEBUG_DISPLAY + if (_DebugMipMapMode != DEBUGMIPMAPMODE_NONE) + { + // TODO: need to update mip info + surfaceData.metallic = 0; + } + + // We need to call ApplyDebugToSurfaceData after filling the surfarcedata and before filling builtinData + // as it can modify attribute use for static lighting + ApplyDebugToSurfaceData(fragInputs.tangentToWorld, surfaceData); + #endif + + // By default we use the ambient occlusion with Tri-ace trick (apply outside) for specular occlusion. + // If user provide bent normal then we process a better term + #if defined(_SPECULAR_OCCLUSION_CUSTOM) + // Just use the value passed through via the slot (not active otherwise) + #elif defined(_SPECULAR_OCCLUSION_FROM_AO_BENT_NORMAL) + // If we have bent normal and ambient occlusion, process a specular occlusion + surfaceData.specularOcclusion = GetSpecularOcclusionFromBentAO(V, bentNormalWS, surfaceData.normalWS, surfaceData.ambientOcclusion, PerceptualSmoothnessToPerceptualRoughness(surfaceData.perceptualSmoothness)); + #elif defined(_AMBIENT_OCCLUSION) && defined(_SPECULAR_OCCLUSION_FROM_AO) + surfaceData.specularOcclusion = GetSpecularOcclusionFromAmbientOcclusion(ClampNdotV(dot(surfaceData.normalWS, V)), surfaceData.ambientOcclusion, PerceptualSmoothnessToRoughness(surfaceData.perceptualSmoothness)); + #endif + + #if defined(_ENABLE_GEOMETRIC_SPECULAR_AA) && !defined(SHADER_STAGE_RAY_TRACING) + surfaceData.perceptualSmoothness = GeometricNormalFiltering(surfaceData.perceptualSmoothness, fragInputs.tangentToWorld[2], surfaceDescription.SpecularAAScreenSpaceVariance, surfaceDescription.SpecularAAThreshold); + #endif + } + + void GetSurfaceAndBuiltinData(VertexToPixel m2ps, FragInputs fragInputs, float3 V, inout PositionInputs posInput, + out SurfaceData surfaceData, out BuiltinData builtinData, inout Surface l, inout ShaderData d + #if NEED_FACING + , bool facing + #endif + ) + { + // Removed since crossfade does not work, probably needs extra material setup. + //#if !defined(SHADER_STAGE_RAY_TRACING) && !defined(_TESSELLATION_DISPLACEMENT) + // #ifdef LOD_FADE_CROSSFADE // enable dithering LOD transition if user select CrossFade transition in LOD group + // LODDitheringTransition(ComputeFadeMaskSeed(V, posInput.positionSS), unity_LODFade.x); + // #endif + //#endif + + + + + d = CreateShaderData(m2ps + #if NEED_FACING + , facing + #endif + ); + + l = (Surface)0; + + l.Albedo = half3(0.5, 0.5, 0.5); + l.Normal = float3(0,0,1); + l.Occlusion = 1; + l.Alpha = 1; + l.SpecularOcclusion = 1; + + #if !defined(SHADER_STAGE_RAY_TRACING) && defined(_DEPTHOFFSET_ON) + l.outputDepth = d.clipPos.z; + #endif + + ChainSurfaceFunction(l, d); + + #if !defined(SHADER_STAGE_RAY_TRACING) && defined(_DEPTHOFFSET_ON) + posInput.deviceDepth = l.outputDepth; + #endif + + #if _UNLIT + //l.Emission = l.Albedo; + //l.Albedo = 0; + l.Normal = half3(0,0,1); + l.Occlusion = 1; + l.Metallic = 0; + l.Specular = 0; + #endif + + surfaceData.geomNormalWS = d.worldSpaceNormal; + surfaceData.tangentWS = d.worldSpaceTangent; + fragInputs.tangentToWorld = d.TBNMatrix; + + float3 bentNormalWS; + + BuildSurfaceData(fragInputs, l, V, posInput, surfaceData, bentNormalWS); + + + float4 lightmapTexCoord1 = fragInputs.texCoord1; + float4 lightmapTexCoord2 = fragInputs.texCoord2; + //#ifdef FRAG_INPUTS_USE_TEXCOORD1 + // float4 lightmapTexCoord1 = fragInputs.texCoord1; + // #else + // float4 lightmapTexCoord1 = float4(0,0,0,0); + // #endif + + // #ifdef FRAG_INPUTS_USE_TEXCOORD2 + // float4 lightmapTexCoord2 = fragInputs.texCoord2; + // #else + // float4 lightmapTexCoord2 = float4(0,0,0,0); + // #endif + + + InitBuiltinData(posInput, l.Alpha, bentNormalWS, -d.worldSpaceNormal, lightmapTexCoord1, lightmapTexCoord2, builtinData); + + + + builtinData.emissiveColor = l.Emission; + + #if defined(_OVERRIDE_BAKEDGI) + builtinData.bakeDiffuseLighting = l.DiffuseGI; + builtinData.backBakeDiffuseLighting = l.BackDiffuseGI; + builtinData.emissiveColor += l.SpecularGI; + #endif + + #if defined(_OVERRIDE_SHADOWMASK) + builtinData.shadowMask0 = l.ShadowMask.x; + builtinData.shadowMask1 = l.ShadowMask.y; + builtinData.shadowMask2 = l.ShadowMask.z; + builtinData.shadowMask3 = l.ShadowMask.w; + #endif + + #ifdef UNITY_VIRTUAL_TEXTURING + //builtinData.vtPackedFeedback = surfaceData.VTPackedFeedback; + #endif + + #if (SHADERPASS == SHADERPASS_DISTORTION) + builtinData.distortion = surfaceData.Distortion; + builtinData.distortionBlur = surfaceData.DistortionBlur; + #endif + + #ifndef SHADER_UNLIT + // PostInitBuiltinData call ApplyDebugToBuiltinData + PostInitBuiltinData(V, posInput, surfaceData, builtinData); + #else + ApplyDebugToBuiltinData(builtinData); + #endif + + RAY_TRACING_OPTIONAL_ALPHA_TEST_PASS + } + + void Frag( VertexToPixel v2f, + OUTPUT_GBUFFER(outGBuffer) + #ifdef _DEPTHOFFSET_ON + , out float outputDepth : SV_Depth + #endif + #if NEED_FACING + , bool facing : SV_IsFrontFace + #endif + ) + { + UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX(v2f); + FragInputs input = BuildFragInputs(v2f); + + // input.positionSS is SV_Position + PositionInputs posInput = GetPositionInput(input.positionSS.xy, _ScreenSize.zw, input.positionSS.z, input.positionSS.w, input.positionRWS); + float3 V = GetWorldSpaceNormalizeViewDir(input.positionRWS); + + SurfaceData surfaceData; + BuiltinData builtinData; + Surface l; + ShaderData d; + GetSurfaceAndBuiltinData(v2f, input, V, posInput, surfaceData, builtinData, l, d + #if NEED_FACING + , facing + #endif + ); + + + ENCODE_INTO_GBUFFER(surfaceData, builtinData, posInput.positionSS, outGBuffer); + + #ifdef _DEPTHOFFSET_ON + outputDepth = l.outputDepth; + #endif + } + + ENDHLSL + } + + Pass + { + // based on HDLitPass.template + Name "ShadowCaster" + Tags { "LightMode" = "ShadowCaster" } + + + + //------------------------------------------------------------------------------------- + // Render Modes (Blend, Cull, ZTest, Stencil, etc) + //------------------------------------------------------------------------------------- + + Cull Back + ZWrite On + ColorMask 0 + ZClip [_ZClip] + + + Tags { "RenderType" = "Opaque" "Queue" = "Geometry" "PreviewType" = "Plane" } + Cull [_CullingOption] + ZWrite [_ZWrite] + ZTest [_ZTestMode] + + + //------------------------------------------------------------------------------------- + // End Render Modes + //------------------------------------------------------------------------------------- + + HLSLPROGRAM + + #pragma target 4.5 + #pragma only_renderers d3d11 playstation xboxone xboxseries vulkan metal switch + //#pragma enable_d3d11_debug_symbols + + #pragma multi_compile_instancing + #pragma instancing_options renderinglayer + #pragma multi_compile _ DOTS_INSTANCING_ON + #pragma multi_compile _ LOD_FADE_CROSSFADE + //#pragma multi_compile_local _ _ALPHATEST_ON + + + //#pragma shader_feature _ _SURFACE_TYPE_TRANSPARENT + //#pragma shader_feature_local _BLENDMODE_OFF _BLENDMODE_ALPHA _BLENDMODE_ADD _BLENDMODE_PRE_MULTIPLY + //#pragma shader_feature_local _ _ADD_PRECOMPUTED_VELOCITY + //#pragma shader_feature_local _ _TRANSPARENT_WRITES_MOTION_VEC + //#pragma shader_feature_local _ _ENABLE_FOG_ON_TRANSPARENT + //#pragma shader_feature_local _ _DISABLE_DECALS + //#pragma shader_feature_local _ _DISABLE_SSR + //#pragma shader_feature_local _ _DISABLE_SSR_TRANSPARENT + //#pragma shader_feature_local _REFRACTION_OFF _REFRACTION_PLANE _REFRACTION_SPHERE _REFRACTION_THIN + #pragma multi_compile _ WRITE_DECAL_BUFFER + //------------------------------------------------------------------------------------- + // Variant Definitions (active field translations to HDRP defines) + //------------------------------------------------------------------------------------- + // #define _MATERIAL_FEATURE_SUBSURFACE_SCATTERING 1 + // #define _MATERIAL_FEATURE_TRANSMISSION 1 + // #define _MATERIAL_FEATURE_ANISOTROPY 1 + // #define _MATERIAL_FEATURE_IRIDESCENCE 1 + // #define _MATERIAL_FEATURE_SPECULAR_COLOR 1 + #define _ENABLE_FOG_ON_TRANSPARENT 1 + // #define _AMBIENT_OCCLUSION 1 + // #define _SPECULAR_OCCLUSION_FROM_AO 1 + // #define _SPECULAR_OCCLUSION_FROM_AO_BENT_NORMAL 1 + // #define _SPECULAR_OCCLUSION_CUSTOM 1 + // #define _ENERGY_CONSERVING_SPECULAR 1 + // #define _ENABLE_GEOMETRIC_SPECULAR_AA 1 + // #define _HAS_REFRACTION 1 + // #define _REFRACTION_PLANE 1 + // #define _REFRACTION_SPHERE 1 + // #define _DISABLE_DECALS 1 + // #define _DISABLE_SSR 1 + // #define _ADD_PRECOMPUTED_VELOCITY + // #define _WRITE_TRANSPARENT_MOTION_VECTOR 1 + // #define _DEPTHOFFSET_ON 1 + // #define _BLENDMODE_PRESERVE_SPECULAR_LIGHTING 1 + + #define SHADERPASS SHADERPASS_SHADOWS + #define _PASSSHADOW 1 + + + #pragma shader_feature_local GLOW_ON + #pragma shader_feature_local FADE_ON + #pragma shader_feature_local OUTBASE_ON + #pragma shader_feature_local ONLYOUTLINE_ON + #pragma shader_feature_local GRADIENT_ON + #pragma shader_feature_local GRADIENT2COL_ON + #pragma shader_feature_local RADIALGRADIENT_ON + #pragma shader_feature_local COLORSWAP_ON + #pragma shader_feature_local HSV_ON + #pragma shader_feature_local CHANGECOLOR_ON + #pragma shader_feature_local CHANGECOLOR2_ON + #pragma shader_feature_local CHANGECOLOR3_ON + #pragma shader_feature_local COLORRAMP_ON + #pragma shader_feature_local GRADIENTCOLORRAMP_ON + #pragma shader_feature_local HITEFFECT_ON + #pragma shader_feature_local NEGATIVE_ON + #pragma shader_feature_local PIXELATE_ON + #pragma shader_feature_local GREYSCALE_ON + #pragma shader_feature_local POSTERIZE_ON + #pragma shader_feature_local BLUR_ON + #pragma shader_feature_local MOTIONBLUR_ON + #pragma shader_feature_local GHOST_ON + #pragma shader_feature_local ALPHAOUTLINE_ON + #pragma shader_feature_local INNEROUTLINE_ON + #pragma shader_feature_local ONLYINNEROUTLINE_ON + #pragma shader_feature_local HOLOGRAM_ON + #pragma shader_feature_local CHROMABERR_ON + #pragma shader_feature_local GLITCH_ON + #pragma shader_feature_local FLICKER_ON + #pragma shader_feature_local SHADOW_ON + #pragma shader_feature_local SHINE_ON + #pragma shader_feature_local CONTRAST_ON + #pragma shader_feature_local OVERLAY_ON + #pragma shader_feature_local OVERLAYMULT_ON + #pragma shader_feature_local DOODLE_ON + #pragma shader_feature_local WIND_ON + #pragma shader_feature_local WAVEUV_ON + #pragma shader_feature_local ROUNDWAVEUV_ON + #pragma shader_feature_local RECTSIZE_ON + #pragma shader_feature_local OFFSETUV_ON + #pragma shader_feature_local CLIPPING_ON + #pragma shader_feature_local RADIALCLIPPING_ON + #pragma shader_feature_local TEXTURESCROLL_ON + #pragma shader_feature_local ZOOMUV_ON + #pragma shader_feature_local DISTORT_ON + #pragma shader_feature_local WARP_ON + #pragma shader_feature_local TWISTUV_ON + #pragma shader_feature_local ROTATEUV_ON + #pragma shader_feature_local POLARUV_ON + #pragma shader_feature_local FISHEYE_ON + #pragma shader_feature_local PINCH_ON + #pragma shader_feature_local SHAKEUV_ON + + #pragma shader_feature_local GLOWTEX_ON + #pragma shader_feature_local OUTTEX_ON + #pragma shader_feature_local OUTDIST_ON + #pragma shader_feature_local OUTBASE8DIR_ON + #pragma shader_feature_local OUTBASEPIXELPERF_ON + #pragma shader_feature_local COLORRAMPOUTLINE_ON + #pragma shader_feature_local GREYSCALEOUTLINE_ON + #pragma shader_feature_local POSTERIZEOUTLINE_ON + #pragma shader_feature_local BLURISHD_ON + #pragma shader_feature_local MANUALWIND_ON + #pragma shader_feature_local ATLAS_ON + #pragma shader_feature_local PREMULTIPLYALPHA_ON + + #pragma shader_feature BILBOARD_ON + #pragma shader_feature BILBOARDY_ON + + #pragma shader_feature NORMALMAP_ON + + + #define _HDRP 1 +#define _USINGTEXCOORD1 1 +#define _USINGTEXCOORD2 1 + + + #pragma vertex Vert + #pragma fragment Frag + + //------------------------------------------------------------------------------------- + // Defines + //------------------------------------------------------------------------------------- + + + // useful conversion functions to make surface shader code just work + + #define UNITY_DECLARE_TEX2D(name) TEXTURE2D(name); SAMPLER(sampler##name); + #define UNITY_DECLARE_TEX2D_NOSAMPLER(name) TEXTURE2D(name); + #define UNITY_DECLARE_TEX2DARRAY(name) TEXTURE2D_ARRAY(name); SAMPLER(sampler##name); + #define UNITY_DECLARE_TEX2DARRAY_NOSAMPLER(tex) TEXTURE2D_ARRAY(tex); + + #define UNITY_SAMPLE_TEX2DARRAY(tex,coord) SAMPLE_TEXTURE2D_ARRAY(tex, sampler##tex, coord.xy, coord.z) + #define UNITY_SAMPLE_TEX2DARRAY_LOD(tex,coord,lod) SAMPLE_TEXTURE2D_ARRAY_LOD(tex, sampler##tex, coord.xy, coord.z, lod) + #define UNITY_SAMPLE_TEX2D(tex, coord) SAMPLE_TEXTURE2D(tex, sampler##tex, coord) + #define UNITY_SAMPLE_TEX2D_SAMPLER(tex, samp, coord) SAMPLE_TEXTURE2D(tex, sampler##samp, coord) + + #define UNITY_SAMPLE_TEX2D_LOD(tex,coord, lod) SAMPLE_TEXTURE2D_LOD(tex, sampler_##tex, coord, lod) + #define UNITY_SAMPLE_TEX2D_SAMPLER_LOD(tex,samplertex,coord, lod) SAMPLE_TEXTURE2D_LOD (tex, sampler##samplertex,coord, lod) + + #if defined(UNITY_COMPILER_HLSL) + #define UNITY_INITIALIZE_OUTPUT(type,name) name = (type)0; + #else + #define UNITY_INITIALIZE_OUTPUT(type,name) + #endif + + #define sampler2D_float sampler2D + #define sampler2D_half sampler2D + + #undef WorldNormalVector + #define WorldNormalVector(data, normal) mul(normal, data.TBNMatrix) + + #define UnityObjectToWorldNormal(normal) mul(GetObjectToWorldMatrix(), normal) + + #ifndef SHADER_STAGE_FRAGMENT + #if !defined(SHADOW_ULTRA_LOW) && !defined(SHADOW_LOW) && !defined(SHADOW_MEDIUM) && !defined(SHADOW_HIGH) // ultra low come from volumetricLighting.compute + #define SHADOW_MEDIUM + #endif + #if !defined(AREA_SHADOW_LOW) && !defined(AREA_SHADOW_MEDIUM) && !defined(AREA_SHADOW_HIGH) // low come from volumetricLighting.compute + #define AREA_SHADOW_MEDIUM + #endif + #endif + + + +// HDRP Adapter stuff + #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Common.hlsl" + #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Texture.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/ShaderVariables.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/ShaderPass/FragInputs.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/ShaderPass/ShaderPass.cs.hlsl" + #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/TextureStack.hlsl" // Required to be include before we include properties as it define DECLARE_STACK_CB + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/NormalBuffer.hlsl" + +#if UNITY_VERSION >= 202239 + #include "Packages/com.unity.shadergraph/ShaderGraphLibrary/Functions.hlsl" // Need to be here for Gradient struct definition +#else + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/ShaderGraphHeader.hlsl" +#endif + #ifdef RAYTRACING_SHADER_GRAPH_DEFAULT + #define RAYTRACING_SHADER_GRAPH_HIGH + #endif + + #ifdef RAYTRACING_SHADER_GRAPH_RAYTRACED + #define RAYTRACING_SHADER_GRAPH_LOW + #endif + // end + + + + + // If we use subsurface scattering, enable output split lighting (for forward pass) + #if defined(_MATERIAL_FEATURE_SUBSURFACE_SCATTERING) && !defined(_SURFACE_TYPE_TRANSPARENT) + #define OUTPUT_SPLIT_LIGHTING + #endif + + #define HAVE_RECURSIVE_RENDERING + + #if SHADERPASS == SHADERPASS_TRANSPARENT_DEPTH_PREPASS + #if !defined(_DISABLE_SSR_TRANSPARENT) && !defined(SHADER_UNLIT) + #define WRITE_NORMAL_BUFFER + #endif + #endif + + #ifndef DEBUG_DISPLAY + // In case of opaque we don't want to perform the alpha test, it is done in depth prepass and we use depth equal for ztest (setup from UI) + // Don't do it with debug display mode as it is possible there is no depth prepass in this case + #if !defined(_SURFACE_TYPE_TRANSPARENT) && defined(_ALPHATEST) + #if SHADERPASS == SHADERPASS_FORWARD + #define SHADERPASS_FORWARD_BYPASS_ALPHA_TEST + #elif SHADERPASS == SHADERPASS_GBUFFER + #define SHADERPASS_GBUFFER_BYPASS_ALPHA_TEST + #endif + #endif + #endif + + // Define _DEFERRED_CAPABLE_MATERIAL for shader capable to run in deferred pass + #if defined(SHADER_LIT) && !defined(_SURFACE_TYPE_TRANSPARENT) + #define _DEFERRED_CAPABLE_MATERIAL + #endif + + // Translate transparent motion vector define + #if defined(_TRANSPARENT_WRITES_MOTION_VEC) && defined(_SURFACE_TYPE_TRANSPARENT) + #define _WRITE_TRANSPARENT_MOTION_VECTOR + #endif + + + + + CBUFFER_START(UnityPerMaterial) + float _UseShadowThreshold; + float _BlendMode; + float _EnableBlendModePreserveSpecularLighting; + float _RayTracing; + float _RefractionModel; + + + half4 _Color; + half4 _MainTex_ST, _MainTex_TexelSize; + half _Alpha, _AlphaCutoffValue; + + #if ATLAS_ON + half _MinXUV, _MaxXUV, _MinYUV, _MaxYUV; + #endif + + #if GLOW_ON + half4 _GlowColor; + half _Glow, _GlowGlobal; + #endif + + #if HSV_ON + half _HsvShift, _HsvSaturation, _HsvBright; + #endif + + #if DISTORT_ON + half4 _DistortTex_ST; + half _DistortTexXSpeed, _DistortTexYSpeed, _DistortAmount; + #endif + + #if FADE_ON + half4 _FadeBurnColor, _FadeTex_ST, _FadeBurnTex_ST; + half _FadeAmount, _FadeBurnWidth, _FadeBurnTransition,_FadeBurnGlow; + #endif + + #if OUTBASE_ON + half4 _OutlineColor; + half _OutlineAlpha, _OutlineGlow, _OutlineWidth; + int _OutlinePixelWidth; + #endif + + #if OUTTEX_ON + half4 _OutlineTex_ST; + half _OutlineTexXSpeed, _OutlineTexYSpeed; + #endif + + #if OUTDIST_ON + half4 _OutlineDistortTex_ST; + half _OutlineDistortTexXSpeed, _OutlineDistortTexYSpeed, _OutlineDistortAmount; + #endif + + #if ALPHAOUTLINE_ON + half _AlphaOutlineGlow, _AlphaOutlinePower, _AlphaOutlineMinAlpha, _AlphaOutlineBlend; + half4 _AlphaOutlineColor; + #endif + + #if INNEROUTLINE_ON + half _InnerOutlineThickness, _InnerOutlineAlpha, _InnerOutlineGlow; + half4 _InnerOutlineColor; + #endif + + #if GRADIENT_ON + half _GradBlend, _GradBoostX, _GradBoostY; + half4 _GradTopRightCol, _GradTopLeftCol, _GradBotRightCol, _GradBotLeftCol; + #endif + + #if COLORSWAP_ON + half4 _ColorSwapRed, _ColorSwapGreen, _ColorSwapBlue; + half _ColorSwapRedLuminosity, _ColorSwapGreenLuminosity, _ColorSwapBlueLuminosity, _ColorSwapBlend; + #endif + + #if CHANGECOLOR_ON + half4 _ColorChangeNewCol, _ColorChangeTarget; + half _ColorChangeTolerance, _ColorChangeLuminosity; + #endif + #if CHANGECOLOR2_ON + half4 _ColorChangeNewCol2, _ColorChangeTarget2; + half _ColorChangeTolerance2; + #endif + #if CHANGECOLOR3_ON + half4 _ColorChangeNewCol3, _ColorChangeTarget3; + half _ColorChangeTolerance3; + #endif + + #if COLORRAMP_ON + half _ColorRampLuminosity, _ColorRampBlend; + #endif + + #if HITEFFECT_ON + half4 _HitEffectColor; + half _HitEffectGlow, _HitEffectBlend; + #endif + + #if NEGATIVE_ON + half _NegativeAmount; + #endif + + #if PIXELATE_ON + half _PixelateSize; + #endif + + #if GREYSCALE_ON + half _GreyscaleLuminosity, _GreyscaleBlend; + half4 _GreyscaleTintColor; + #endif + + #if POSTERIZE_ON + half _PosterizeNumColors, _PosterizeGamma; + #endif + + #if BLUR_ON + half _BlurIntensity; + #endif + + #if MOTIONBLUR_ON + half _MotionBlurAngle, _MotionBlurDist; + #endif + + #if GHOST_ON + half _GhostColorBoost, _GhostTransparency, _GhostBlend; + #endif + + #if HOLOGRAM_ON + half _HologramStripesAmount, _HologramMinAlpha, _HologramUnmodAmount, _HologramStripesSpeed, _HologramMaxAlpha, _HologramBlend; + half4 _HologramStripeColor; + #endif + + #if CHROMABERR_ON + half _ChromAberrAmount, _ChromAberrAlpha; + #endif + + #if GLITCH_ON + half _GlitchAmount, _GlitchSize; + #endif + + #if FLICKER_ON + half _FlickerFreq, _FlickerPercent, _FlickerAlpha; + #endif + + #if SHADOW_ON + half _ShadowX, _ShadowY, _ShadowAlpha; + half4 _ShadowColor; + #endif + + #if SHINE_ON + half4 _ShineColor; + half _ShineLocation, _ShineRotate, _ShineWidth, _ShineGlow; + #endif + + #if CONTRAST_ON + half _Contrast, _Brightness; + #endif + + #if OVERLAY_ON + half4 _OverlayTex_ST, _OverlayColor; + half _OverlayGlow, _OverlayBlend, _OverlayTextureScrollXSpeed, _OverlayTextureScrollYSpeed; + #endif + + #if DOODLE_ON + half _HandDrawnAmount, _HandDrawnSpeed; + #endif + + #if WIND_ON + half _GrassSpeed, _GrassWind, _GrassManualAnim, _GrassRadialBend; + #endif + + #if WAVEUV_ON + float _WaveAmount, _WaveSpeed, _WaveStrength, _WaveX, _WaveY; + #endif + + #if ROUNDWAVEUV_ON + half _RoundWaveStrength, _RoundWaveSpeed; + #endif + + #if RECTSIZE_ON + half _RectSize; + #endif + + #if OFFSETUV_ON + half _OffsetUvX, _OffsetUvY; + #endif + + #if CLIPPING_ON + half _ClipUvLeft, _ClipUvRight, _ClipUvUp, _ClipUvDown; + #endif + + #if RADIALCLIPPING_ON + half _RadialStartAngle, _RadialClip, _RadialClip2; + #endif + + #if TEXTURESCROLL_ON + half _TextureScrollXSpeed, _TextureScrollYSpeed; + #endif + + #if ZOOMUV_ON + half _ZoomUvAmount; + #endif + + #if WARP_ON + half _WarpStrength, _WarpSpeed, _WarpScale; + #endif + + #if TWISTUV_ON + half _TwistUvAmount, _TwistUvPosX, _TwistUvPosY, _TwistUvRadius; + #endif + + #if ROTATEUV_ON + half _RotateUvAmount; + #endif + + #if FISHEYE_ON + half _FishEyeUvAmount; + #endif + + #if PINCH_ON + half _PinchUvAmount; + #endif + + #if SHAKEUV_ON + half _ShakeUvSpeed, _ShakeUvX, _ShakeUvY; + #endif + + #if NORMALMAP_ON + half _NormalStrength; + #endif + + float _RandomSeed; + + + + + CBUFFER_END + + + + // -- Property used by ScenePickingPass + #ifdef SCENEPICKINGPASS + float4 _SelectionID; + #endif + + // -- Properties used by SceneSelectionPass + #ifdef SCENESELECTIONPASS + int _ObjectId; + int _PassValue; + #endif + + + // data across stages, stripped like the above. + struct VertexToPixel + { + float4 pos : SV_POSITION; + float3 worldPos : TEXCOORD0; + float3 worldNormal : TEXCOORD1; + float4 worldTangent : TEXCOORD2; + float4 texcoord0 : TEXCOORD3; + float4 texcoord1 : TEXCOORD4; + float4 texcoord2 : TEXCOORD5; + // #if %TEXCOORD3REQUIREKEY% + float4 texcoord3 : TEXCOORD6; + // #endif + + // #if %SCREENPOSREQUIREKEY% + // float4 screenPos : TEXCOORD7; + // #endif + + // #if %VERTEXCOLORREQUIREKEY% + float4 vertexColor : COLOR; + // #endif + + // #if %EXTRAV2F0REQUIREKEY% + // float4 extraV2F0 : TEXCOORD8; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // float4 extraV2F1 : TEXCOORD9; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // float4 extraV2F2 : TEXCOORD10; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // float4 extraV2F3 : TEXCOORD11; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // float4 extraV2F4 : TEXCOORD12; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // float4 extraV2F5 : TEXCOORD13; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // float4 extraV2F6 : TEXCOORD14; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // float4 extraV2F7 : TEXCOORD15; + // #endif + + #if UNITY_ANY_INSTANCING_ENABLED + UNITY_VERTEX_INPUT_INSTANCE_ID + #endif // UNITY_ANY_INSTANCING_ENABLED + + #if _HDRP && (_PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR))) + float4 previousPositionCS : TEXCOORD16; // Contain previous transform position (in case of skinning for example) + float4 motionVectorCS : TEXCOORD17; + #endif + + UNITY_VERTEX_OUTPUT_STEREO + }; + + + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Debug/DebugDisplay.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/Material.hlsl" + #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/NormalSurfaceGradient.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/Lit/Lit.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/BuiltinUtilities.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/MaterialUtilities.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/Decal/DecalUtilities.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/Lit/LitDecalData.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/ShaderGraphFunctions.hlsl" + + + + + + // data describing the user output of a pixel + struct Surface + { + half3 Albedo; + half Height; + half3 Normal; + half Smoothness; + half3 Emission; + half Metallic; + half3 Specular; + half Occlusion; + half SpecularPower; // for simple lighting + half Alpha; + float outputDepth; // if written, SV_Depth semantic is used. ShaderData.clipPos.z is unused value + // HDRP Only + half SpecularOcclusion; + half SubsurfaceMask; + half Thickness; + half CoatMask; + half CoatSmoothness; + half Anisotropy; + half IridescenceMask; + half IridescenceThickness; + int DiffusionProfileHash; + float SpecularAAThreshold; + float SpecularAAScreenSpaceVariance; + // requires _OVERRIDE_BAKEDGI to be defined, but is mapped in all pipelines + float3 DiffuseGI; + float3 BackDiffuseGI; + float3 SpecularGI; + float ior; + float3 transmittanceColor; + float atDistance; + float transmittanceMask; + // requires _OVERRIDE_SHADOWMASK to be defines + float4 ShadowMask; + + // for decals + float NormalAlpha; + float MAOSAlpha; + + + }; + + // Data the user declares in blackboard blocks + struct Blackboard + { + + float blackboardDummyData; + }; + + // data the user might need, this will grow to be big. But easy to strip + struct ShaderData + { + float4 clipPos; // SV_POSITION + float3 localSpacePosition; + float3 localSpaceNormal; + float3 localSpaceTangent; + + float3 worldSpacePosition; + float3 worldSpaceNormal; + float3 worldSpaceTangent; + float tangentSign; + + float3 worldSpaceViewDir; + float3 tangentSpaceViewDir; + + float4 texcoord0; + float4 texcoord1; + float4 texcoord2; + float4 texcoord3; + + float2 screenUV; + float4 screenPos; + + float4 vertexColor; + bool isFrontFace; + + float4 extraV2F0; + float4 extraV2F1; + float4 extraV2F2; + float4 extraV2F3; + float4 extraV2F4; + float4 extraV2F5; + float4 extraV2F6; + float4 extraV2F7; + + float3x3 TBNMatrix; + Blackboard blackboard; + }; + + struct VertexData + { + #if SHADER_TARGET > 30 + // uint vertexID : SV_VertexID; + #endif + float4 vertex : POSITION; + float3 normal : NORMAL; + float4 tangent : TANGENT; + float4 texcoord0 : TEXCOORD0; + + // optimize out mesh coords when not in use by user or lighting system + #if _URP && (_USINGTEXCOORD1 || _PASSMETA || _PASSFORWARD || _PASSGBUFFER) + float4 texcoord1 : TEXCOORD1; + #endif + + #if _URP && (_USINGTEXCOORD2 || _PASSMETA || ((_PASSFORWARD || _PASSGBUFFER) && defined(DYNAMICLIGHTMAP_ON))) + float4 texcoord2 : TEXCOORD2; + #endif + + #if _STANDARD && (_USINGTEXCOORD1 || (_PASSMETA || ((_PASSFORWARD || _PASSGBUFFER || _PASSFORWARDADD) && LIGHTMAP_ON))) + float4 texcoord1 : TEXCOORD1; + #endif + #if _STANDARD && (_USINGTEXCOORD2 || (_PASSMETA || ((_PASSFORWARD || _PASSGBUFFER) && DYNAMICLIGHTMAP_ON))) + float4 texcoord2 : TEXCOORD2; + #endif + + + #if _HDRP + float4 texcoord1 : TEXCOORD1; + float4 texcoord2 : TEXCOORD2; + #endif + + // #if %TEXCOORD3REQUIREKEY% + float4 texcoord3 : TEXCOORD3; + // #endif + + // #if %VERTEXCOLORREQUIREKEY% + float4 vertexColor : COLOR; + // #endif + + #if _PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR)) + float3 previousPositionOS : TEXCOORD4; // Contain previous transform position (in case of skinning for example) + #if defined (_ADD_PRECOMPUTED_VELOCITY) + float3 precomputedVelocity : TEXCOORD5; // Add Precomputed Velocity (Alembic computes velocities on runtime side). + #endif + #endif + + UNITY_VERTEX_INPUT_INSTANCE_ID + }; + + struct TessVertex + { + float4 vertex : INTERNALTESSPOS; + float3 normal : NORMAL; + float4 tangent : TANGENT; + float4 texcoord0 : TEXCOORD0; + float4 texcoord1 : TEXCOORD1; + float4 texcoord2 : TEXCOORD2; + + // #if %TEXCOORD3REQUIREKEY% + float4 texcoord3 : TEXCOORD3; + // #endif + + // #if %VERTEXCOLORREQUIREKEY% + float4 vertexColor : COLOR; + // #endif + + // #if %EXTRAV2F0REQUIREKEY% + // float4 extraV2F0 : TEXCOORD5; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // float4 extraV2F1 : TEXCOORD6; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // float4 extraV2F2 : TEXCOORD7; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // float4 extraV2F3 : TEXCOORD8; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // float4 extraV2F4 : TEXCOORD9; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // float4 extraV2F5 : TEXCOORD10; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // float4 extraV2F6 : TEXCOORD11; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // float4 extraV2F7 : TEXCOORD12; + // #endif + + #if _PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR)) + float3 previousPositionOS : TEXCOORD13; // Contain previous transform position (in case of skinning for example) + #if defined (_ADD_PRECOMPUTED_VELOCITY) + float3 precomputedVelocity : TEXCOORD14; + #endif + #endif + + UNITY_VERTEX_INPUT_INSTANCE_ID + UNITY_VERTEX_OUTPUT_STEREO + }; + + struct ExtraV2F + { + float4 extraV2F0; + float4 extraV2F1; + float4 extraV2F2; + float4 extraV2F3; + float4 extraV2F4; + float4 extraV2F5; + float4 extraV2F6; + float4 extraV2F7; + Blackboard blackboard; + float4 time; + }; + + + float3 WorldToTangentSpace(ShaderData d, float3 normal) + { + return mul(d.TBNMatrix, normal); + } + + float3 TangentToWorldSpace(ShaderData d, float3 normal) + { + return mul(normal, d.TBNMatrix); + } + + // in this case, make standard more like SRPs, because we can't fix + // unity_WorldToObject in HDRP, since it already does macro-fu there + + #if _STANDARD + float3 TransformWorldToObject(float3 p) { return mul(unity_WorldToObject, float4(p, 1)); }; + float3 TransformObjectToWorld(float3 p) { return mul(unity_ObjectToWorld, float4(p, 1)); }; + float4 TransformWorldToObject(float4 p) { return mul(unity_WorldToObject, p); }; + float4 TransformObjectToWorld(float4 p) { return mul(unity_ObjectToWorld, p); }; + float4x4 GetWorldToObjectMatrix() { return unity_WorldToObject; } + float4x4 GetObjectToWorldMatrix() { return unity_ObjectToWorld; } + #if (defined(SHADER_API_D3D11) || defined(SHADER_API_XBOXONE) || defined(UNITY_COMPILER_HLSLCC) || defined(SHADER_API_PSSL) || (SHADER_TARGET_SURFACE_ANALYSIS && !SHADER_TARGET_SURFACE_ANALYSIS_MOJOSHADER)) + #define UNITY_SAMPLE_TEX2D_LOD(tex,coord, lod) tex.SampleLevel (sampler##tex,coord, lod) + #define UNITY_SAMPLE_TEX2D_SAMPLER_LOD(tex,samplertex,coord, lod) tex.SampleLevel (sampler##samplertex,coord, lod) + #else + #define UNITY_SAMPLE_TEX2D_LOD(tex,coord,lod) tex2D (tex,coord,0,lod) + #define UNITY_SAMPLE_TEX2D_SAMPLER_LOD(tex,samplertex,coord,lod) tex2D (tex,coord,0,lod) + #endif + + #undef GetWorldToObjectMatrix() + + #define GetWorldToObjectMatrix() unity_WorldToObject + + + #endif + + float3 GetCameraWorldPosition() + { + #if _HDRP + return GetCameraRelativePositionWS(_WorldSpaceCameraPos); + #else + return _WorldSpaceCameraPos; + #endif + } + + #if _GRABPASSUSED + #if _STANDARD + TEXTURE2D(%GRABTEXTURE%); + SAMPLER(sampler_%GRABTEXTURE%); + #endif + + half3 GetSceneColor(float2 uv) + { + #if _STANDARD + return SAMPLE_TEXTURE2D(%GRABTEXTURE%, sampler_%GRABTEXTURE%, uv).rgb; + #else + return SHADERGRAPH_SAMPLE_SCENE_COLOR(uv); + #endif + } + #endif + + + + #if _STANDARD + UNITY_DECLARE_DEPTH_TEXTURE(_CameraDepthTexture); + float GetSceneDepth(float2 uv) { return SAMPLE_DEPTH_TEXTURE(_CameraDepthTexture, uv); } + float GetLinear01Depth(float2 uv) { return Linear01Depth(GetSceneDepth(uv)); } + float GetLinearEyeDepth(float2 uv) { return LinearEyeDepth(GetSceneDepth(uv)); } + #else + float GetSceneDepth(float2 uv) { return SHADERGRAPH_SAMPLE_SCENE_DEPTH(uv); } + float GetLinear01Depth(float2 uv) { return Linear01Depth(GetSceneDepth(uv), _ZBufferParams); } + float GetLinearEyeDepth(float2 uv) { return LinearEyeDepth(GetSceneDepth(uv), _ZBufferParams); } + #endif + + float3 GetWorldPositionFromDepthBuffer(float2 uv, float3 worldSpaceViewDir) + { + float eye = GetLinearEyeDepth(uv); + float3 camView = mul((float3x3)GetObjectToWorldMatrix(), transpose(mul(GetWorldToObjectMatrix(), UNITY_MATRIX_I_V)) [2].xyz); + + float dt = dot(worldSpaceViewDir, camView); + float3 div = worldSpaceViewDir/dt; + float3 wpos = (eye * div) + GetCameraWorldPosition(); + return wpos; + } + + #if _HDRP + float3 ObjectToWorldSpacePosition(float3 pos) + { + return GetAbsolutePositionWS(TransformObjectToWorld(pos)); + } + #else + float3 ObjectToWorldSpacePosition(float3 pos) + { + return TransformObjectToWorld(pos); + } + #endif + + #if _STANDARD + UNITY_DECLARE_SCREENSPACE_TEXTURE(_CameraDepthNormalsTexture); + float3 GetSceneNormal(float2 uv, float3 worldSpaceViewDir) + { + float4 depthNorms = UNITY_SAMPLE_SCREENSPACE_TEXTURE(_CameraDepthNormalsTexture, uv); + float3 norms = DecodeViewNormalStereo(depthNorms); + norms = mul((float3x3)GetWorldToViewMatrix(), norms) * 0.5 + 0.5; + return norms; + } + #elif _HDRP && !_DECALSHADER + + float3 GetSceneNormal(float2 uv, float3 worldSpaceViewDir) + { + NormalData nd; + DecodeFromNormalBuffer(_ScreenSize.xy * uv, nd); + return nd.normalWS; + } + #elif _URP + #if (SHADER_LIBRARY_VERSION_MAJOR >= 10) + #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/DeclareNormalsTexture.hlsl" + #endif + + float3 GetSceneNormal(float2 uv, float3 worldSpaceViewDir) + { + #if (SHADER_LIBRARY_VERSION_MAJOR >= 10) + return SampleSceneNormals(uv); + #else + float3 wpos = GetWorldPositionFromDepthBuffer(uv, worldSpaceViewDir); + return normalize(-cross(ddx(wpos), ddy(wpos))) * 0.5 + 0.5; + #endif + + } + #endif + + #if _HDRP + + half3 UnpackNormalmapRGorAG(half4 packednormal) + { + // This do the trick + packednormal.x *= packednormal.w; + + half3 normal; + normal.xy = packednormal.xy * 2 - 1; + normal.z = sqrt(1 - saturate(dot(normal.xy, normal.xy))); + return normal; + } + half3 UnpackNormal(half4 packednormal) + { + #if defined(UNITY_NO_DXT5nm) + return packednormal.xyz * 2 - 1; + #else + return UnpackNormalmapRGorAG(packednormal); + #endif + } + #endif + #if _HDRP || _URP + + half3 UnpackScaleNormal(half4 packednormal, half scale) + { + #ifndef UNITY_NO_DXT5nm + // Unpack normal as DXT5nm (1, y, 1, x) or BC5 (x, y, 0, 1) + // Note neutral texture like "bump" is (0, 0, 1, 1) to work with both plain RGB normal and DXT5nm/BC5 + packednormal.x *= packednormal.w; + #endif + half3 normal; + normal.xy = (packednormal.xy * 2 - 1) * scale; + normal.z = sqrt(1 - saturate(dot(normal.xy, normal.xy))); + return normal; + } + + #endif + + + void GetSun(out float3 lightDir, out float3 color) + { + lightDir = float3(0.5, 0.5, 0); + color = 1; + #if _HDRP + if (_DirectionalLightCount > 0) + { + DirectionalLightData light = _DirectionalLightDatas[0]; + lightDir = -light.forward.xyz; + color = light.color; + } + #elif _STANDARD + lightDir = normalize(_WorldSpaceLightPos0.xyz); + color = _LightColor0.rgb; + #elif _URP + Light light = GetMainLight(); + lightDir = light.direction; + color = light.color; + #endif + } + + + + + + + + + + TEXTURE2D(_MainTex); + SAMPLER(sampler_MainTex); + + #if GLOW_ON + TEXTURE2D(_GlowTex); + SAMPLER(sampler_GlowTex); + #endif + + #if FADE_ON + TEXTURE2D(_FadeTex); + SAMPLER(sampler_FadeTex); + + TEXTURE2D(_FadeBurnTex); + SAMPLER(sampler_FadeBurnTex); + #endif + + #if DISTORT_ON + TEXTURE2D(_DistortTex); + SAMPLER(sampler_DistortTex); + #endif + + #if OUTTEX_ON + TEXTURE2D(_OutlineTex); + SAMPLER(sampler_OutlineTex); + #endif + + #if OUTDIST_ON + TEXTURE2D(_OutlineDistortTex); + SAMPLER(sampler_OutlineDistortTex); + #endif + + #if COLORSWAP_ON + TEXTURE2D(_ColorSwapTex); + SAMPLER(sampler_ColorSwapTex); + #endif + + #if COLORRAMP_ON + TEXTURE2D(_ColorRampTex); + TEXTURE2D(_ColorRampTexGradient); + SAMPLER(sampler_ColorRampTex); + SAMPLER(sampler_ColorRampTexGradient); + #endif + + #if SHINE_ON + TEXTURE2D(_ShineMask); + SAMPLER(sampler_ShineMask); + #endif + + #if OVERLAY_ON + TEXTURE2D(_OverlayTex); + SAMPLER(sampler_OverlayTex); + #endif + + #if NORMALMAP_ON + TEXTURE2D(_NormalMap); + SAMPLER(sampler_NormalMap); + #endif + + + half3 GetPixel(in int offsetX, in int offsetY, in half2 uv, in Texture2D _tex, in SamplerState _sampler) + { + half2 _uv = uv + half2(offsetX * _MainTex_TexelSize.x, offsetY * _MainTex_TexelSize.y); + half4 col = SAMPLE_TEXTURE2D(_tex, _sampler, _uv); + return col.rgb; + } + + + //BLURS------------------------------------------------------------------------- + half4 Blur(half2 uv, Texture2D source, SamplerState sampler_source, half Intensity) + { + const half2 texelSize = 1.0 / _ScreenParams.xy; + const half4 color = SAMPLE_TEXTURE2D(source, sampler_source, uv); + const half2 offset = Intensity * texelSize; + + half4 accumulatedColor = color; + half accumulatedWeight = 1.0; + for (int x = -1; x <= 1; x++) + { + for (int y = -1; y <= 1; y++) + { + const half2 sampleUV = uv + half2(x, y) * offset; + const half4 sampleColor = SAMPLE_TEXTURE2D(source, sampler_source, sampleUV); + + accumulatedColor += sampleColor; + accumulatedWeight += 1.0; + } + } + + half4 blurredColor = accumulatedColor / accumulatedWeight; + return blurredColor; + } + + half BlurHD_G(half bhqp, half x) + { + return exp(-(x * x) / (2.0 * bhqp * bhqp)); + } + half4 BlurHD(half2 uv, Texture2D source, SamplerState sampler_source, half BlurAmount, half xScale, half yScale) + { + int iterations = 16; + int halfIterations = iterations / 2; + half sigmaX = 0.1 + BlurAmount * 0.5; + half sigmaY = sigmaX; + half total = 0.0; + half4 ret = half4(0, 0, 0, 0); + for (int iy = 0; iy < iterations; ++iy) + { + half fy = BlurHD_G(sigmaY, half(iy) -half(halfIterations)); + half offsetY = half(iy - halfIterations) * 0.00390625 * xScale; + for (int ix = 0; ix < iterations; ++ix) + { + half fx = BlurHD_G(sigmaX, half(ix) - half(halfIterations)); + half offsetX = half(ix - halfIterations) * 0.00390625 * yScale; + total += fx * fy; + ret += SAMPLE_TEXTURE2D(source, sampler_source, uv + half2(offsetX, offsetY)) * fx * fy; + } + } + return ret / total; + } + //----------------------------------------------------------------------- + + + //------------------------------------------- + half RemapFloat(half inValue, half inMin, half inMax, half outMin, half outMax){ + return outMin + (inValue - inMin) * (outMax - outMin) / (inMax - inMin); + } + //------------------------------------------- + + //----------------------------------------------------------------------- + half rand(half2 seed, half offset) { + return (frac(sin(dot(seed, half2(12.9898, 78.233))) * 43758.5453) + offset) % 1.0; + } + + half rand2(half2 seed, half offset) { + return (frac(sin(dot(seed * floor(50 + (_Time.x % 1.0) * 12.), half2(127.1, 311.7))) * 43758.5453123) + offset) % 1.0; + } + + half rand2CustomTime(half2 seed, half offset, half customTime) { + return (frac(sin(dot(seed * floor(50 + (customTime % 1.0) * 12.), half2(127.1, 311.7))) * 43758.5453123) + offset) % 1.0; + } + //----------------------------------------------------------------------- + + + void Ext_ModifyVertex0 (inout VertexData v, inout ExtraV2F d) + { + //BILBOARD_ON + #if BILBOARD_ON + half3 camRight = mul((half3x3)unity_CameraToWorld, half3(1,0,0)); + half3 camUp = half3(0,1,0); + #if BILBOARDY_ON + camUp = mul((half3x3)unity_CameraToWorld, half3(0,1,0)); + #endif + half3 localPos = v.vertex.x * camRight + v.vertex.y * camUp; + v.vertex = half4(localPos, 1); + #endif + //----------------------------------------------------------- + + v.texcoord0.xy = TRANSFORM_TEX(v.texcoord0.xy, _MainTex); + half2 center = half2(0.5, 0.5); + #if ATLAS_ON + center = half2((_MaxXUV + _MinXUV) / 2.0, (_MaxYUV + _MinYUV) / 2.0); + #endif + + //POLARUV_ON + #if POLARUV_ON + v.texcoord0.xy = v.texcoord0.xy - center; + #endif + + //---------------------------------------- + + //ROTATEUV_ON + #if ROTATEUV_ON + half2 uvC = v.texcoord0.xy; + half cosAngle = cos(_RotateUvAmount); + half sinAngle = sin(_RotateUvAmount); + half2x2 rot = half2x2(cosAngle, -sinAngle, sinAngle, cosAngle); + uvC -= center; + v.texcoord0.xy = mul(rot, uvC); + v.texcoord0.xy += center; + #endif + //-------------------- + + #if RECTSIZE_ON + v.vertex.xyz += (v.vertex.xyz * (_RectSize - 1.0)); + #endif + + #if OUTTEX_ON + v.texcoord1.xy = TRANSFORM_TEX(v.texcoord0.xy, _OutlineTex); + #endif + + #if OUTDIST_ON + v.texcoord2.xy = TRANSFORM_TEX(v.texcoord0.xy, _OutlineDistortTex); + #endif + + #if DISTORT_ON + v.texcoord3.xy = TRANSFORM_TEX(v.texcoord0.xy, _DistortTex); + #endif + } + + void Ext_SurfaceFunction0 (inout Surface o, ShaderData d) + { + half randomSeed = _RandomSeed; + + float2 uvRect = d.texcoord0; + half2 center = half2(0.5, 0.5); + #if ATLAS_ON + center = half2((_MaxXUV + _MinXUV) / 2.0, (_MaxYUV + _MinYUV) / 2.0); + uvRect = half2((d.texcoord0.x - _MinXUV) / (_MaxXUV - _MinXUV), (d.texcoord0.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half2 centerTiled = half2(center.x * _MainTex_ST.x, center.y * _MainTex_ST.y); + + //CLIPPING_ON + #if CLIPPING_ON + half2 tiledUv = half2(d.texcoord0.x / _MainTex_ST.x, d.texcoord0.y / _MainTex_ST.y); + #if ATLAS_ON + tiledUv = half2((tiledUv.x - _MinXUV) / (_MaxXUV - _MinXUV), (tiledUv.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + clip((1 - _ClipUvUp) - tiledUv.y); + clip(tiledUv.y - _ClipUvDown); + clip((1 - _ClipUvRight) - tiledUv.x); + clip(tiledUv.x - _ClipUvLeft); + #endif + //---------------------------------- + + //RADIALCLIPPING_ON + #if RADIALCLIPPING_ON + half2 tiledUv2 = half2(d.texcoord0.x / _MainTex_ST.x, d.texcoord0.y / _MainTex_ST.y); + #if ATLAS_ON + tiledUv2 = half2((tiledUv2.x - _MinXUV) / (_MaxXUV - _MinXUV), (tiledUv2.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half startAngle = _RadialStartAngle - _RadialClip; + half endAngle = _RadialStartAngle + _RadialClip2; + half offset0 = clamp(0, 360, startAngle + 360); + half offset360 = clamp(0, 360, endAngle - 360); + half2 atan2Coord = half2(lerp(-1, 1, tiledUv2.x), lerp(-1, 1, tiledUv2.y)); + half atanAngle = atan2(atan2Coord.y, atan2Coord.x) * 57.3; // angle in degrees + if(atanAngle < 0) atanAngle = 360 + atanAngle; + if(atanAngle >= startAngle && atanAngle <= endAngle) discard; + if(atanAngle <= offset360) discard; + if(atanAngle >= offset0) discard; + #endif + + //----------------------------- + + //TEXTURESCROLL_ON && ATLAS_ON + #if TEXTURESCROLL_ON && ATLAS_ON + d.texcoord0.xy = half2(_MinXUV + ((_MaxXUV - _MinXUV) * (abs(((_Time.y + randomSeed) * _TextureScrollXSpeed) + uvRect.x) % 1)), + _MinYUV + ((_MaxYUV - _MinYUV) * (abs(((_Time.y + randomSeed) * _TextureScrollYSpeed) + uvRect.y) % 1))); + #endif + //---------------------------- + + //OFFSETUV_ON + #if OFFSETUV_ON + #if ATLAS_ON + d.texcoord0.xy = half2(_MinXUV + ((_MaxXUV - _MinXUV) * (abs((_OffsetUvX + uvRect.x) % 1))), + _MinYUV + ((_MaxYUV - _MinYUV) * (abs(_OffsetUvY + uvRect.y) % 1))); + #else + d.texcoord0.xy += half2(_OffsetUvX, _OffsetUvY); + #endif + #endif + + //---------------------- + + //POLARUV_ON + #if POLARUV_ON + d.texcoord0.xy = half2(atan2(d.texcoord0.y, d.texcoord0.x) / (2.0f * 3.141592653589f), length(d.texcoord0.xy)); + d.texcoord0.xy *= _MainTex_ST.xy; + #endif + + //-------------------------------------- + + //TWISTUV_ON + #if TWISTUV_ON + #if ATLAS_ON + _TwistUvPosX = ((_MaxXUV - _MinXUV) * _TwistUvPosX) + _MinXUV; + _TwistUvPosY = ((_MaxYUV - _MinYUV) * _TwistUvPosY) + _MinYUV; + #endif + half2 tempUv = d.texcoord0.xy - half2(_TwistUvPosX * _MainTex_ST.x, _TwistUvPosY * _MainTex_ST.y); + _TwistUvRadius *= (_MainTex_ST.x + _MainTex_ST.y) / 2; + half percent = (_TwistUvRadius - length(tempUv)) / _TwistUvRadius; + half theta = percent * percent * (2.0 * sin(_TwistUvAmount)) * 8.0; + half s = sin(theta); + half c = cos(theta); + half beta = max(sign(_TwistUvRadius - length(tempUv)), 0.0); + tempUv = half2(dot(tempUv, half2(c, -s)), dot(tempUv, half2(s, c))) * beta + tempUv * (1 - beta); + tempUv += half2(_TwistUvPosX * _MainTex_ST.x, _TwistUvPosY * _MainTex_ST.y); + d.texcoord0.xy = tempUv; + #endif + + //-------------------------------------------- + + //FISHEYE_ON + #if FISHEYE_ON + half bind = length(centerTiled); + half2 dF = d.texcoord0.xy - centerTiled; + half dFlen = length(dF); + half fishInt = (3.14159265359 / bind) * (_FishEyeUvAmount + 0.001); + d.texcoord0.xy = centerTiled + (dF / (max(0.0001, dFlen))) * tan(dFlen * fishInt) * bind / tan(bind * fishInt); + #endif + //--------------------------------------------- + + //PINCH_ON + #if PINCH_ON + half2 dP = d.texcoord0.xy - centerTiled; + half pinchInt = (3.141592 / length(centerTiled)) * (-_PinchUvAmount + 0.001); + d.texcoord0.xy = centerTiled + normalize(dP) * atan(length(dP) * -pinchInt * 10.0) * 0.5 / atan(-pinchInt * 5); + #endif + + //--------------------------------------------- + + //ZOOMUV_ON + #if ZOOMUV_ON + d.texcoord0.xy -= centerTiled; + d.texcoord0.xy = d.texcoord0.xy * _ZoomUvAmount; + d.texcoord0.xy += centerTiled; + #endif + + //----------------------------------------------- + + //DOODLE_ON + #if DOODLE_ON + half2 uvCopy = uvRect; + _HandDrawnSpeed = (floor((_Time.x + randomSeed) * 20 * _HandDrawnSpeed) / _HandDrawnSpeed) * _HandDrawnSpeed; + uvCopy.x = sin((uvCopy.x * _HandDrawnAmount + _HandDrawnSpeed) * 4); + uvCopy.y = cos((uvCopy.y * _HandDrawnAmount + _HandDrawnSpeed) * 4); + d.texcoord0.xy = lerp(d.texcoord0.xy, d.texcoord0.xy + uvCopy, 0.0005 * _HandDrawnAmount); + #endif + + //-------------------------- + + //SHAKEUV_ON + #if SHAKEUV_ON + half xShake = sin((_Time.x + randomSeed) * _ShakeUvSpeed * 50) * _ShakeUvX; + half yShake = cos((_Time.x + randomSeed) * _ShakeUvSpeed * 50) * _ShakeUvY; + d.texcoord0.xy += half2(xShake * 0.012, yShake * 0.01); + #endif + + //------------------------------------------- + + //RECTSIZE_ON + #if RECTSIZE_ON + d.texcoord0.xy = d.texcoord0.xy * (_RectSize).xx + (((-_RectSize * 0.5) + 0.5)).xx; + #endif + + //------------------------------------------- + + //DISTORT_ON + #if DISTORT_ON + #if ATLAS_ON + d.texcoord3.x = d.texcoord3.x * (1 / (_MaxXUV - _MinXUV)); + d.texcoord3.y = d.texcoord3.y * (1 / (_MaxYUV - _MinYUV)); + #endif + + d.texcoord3.x += ((_Time.x + _RandomSeed) * _DistortTexXSpeed) % 1; + d.texcoord3.y += ((_Time.x + _RandomSeed) * _DistortTexYSpeed) % 1; + half distortAmnt = (SAMPLE_TEXTURE2D(_DistortTex, sampler_DistortTex, d.texcoord3.xy).r - 0.5) * 0.2 * _DistortAmount; + d.texcoord0.x += distortAmnt; + d.texcoord0.y += distortAmnt; + #endif + //------------------------------------------------------- + + //WARP_ON + #if WARP_ON + half2 warpUv = half2(d.texcoord0.x / _MainTex_ST.x, d.texcoord0.y / _MainTex_ST.y); + #if ATLAS_ON + warpUv = half2((warpUv.x - _MinXUV) / (_MaxXUV - _MinXUV), (warpUv.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + const float tau = 6.283185307179586; + float xWarp = (_Time.y + randomSeed) * _WarpSpeed + warpUv.x * tau / _WarpScale; + float yWarp = (_Time.y + randomSeed) * _WarpSpeed + warpUv.y * tau / _WarpScale; + float2 warp = float2(sin(xWarp), sin(yWarp)) * _WarpStrength; + d.texcoord0.xy += warp; + #endif + + //------------------------------------------------------- + + //WAVEUV_ON + #if WAVEUV_ON + float2 uvWave = half2(_WaveX * _MainTex_ST.x, _WaveY * _MainTex_ST.y) - d.texcoord0.xy; + uvWave %= 1; + #if ATLAS_ON + uvWave = half2(_WaveX, _WaveY) - uvRect; + #endif + uvWave.x *= _ScreenParams.x / _ScreenParams.y; + float waveTime = _Time.y + randomSeed; + float angWave = (sqrt(dot(uvWave, uvWave)) * _WaveAmount) - ((waveTime * _WaveSpeed)); + d.texcoord0.xy = d.texcoord0.xy + uvWave * sin(angWave) * (_WaveStrength / 1000.0); + #endif + //---------------------------------------------------- + + //ROUNDWAVEUV_ON + #if ROUNDWAVEUV_ON + half xWave = ((0.5 * _MainTex_ST.x) - uvRect.x); + half yWave = ((0.5 * _MainTex_ST.y) - uvRect.y) * (_MainTex_TexelSize.w / _MainTex_TexelSize.z); + half ripple = -sqrt(xWave*xWave + yWave* yWave); + d.texcoord0.xy += (sin((ripple + (_Time.y + randomSeed) * (_RoundWaveSpeed/10.0)) / 0.015) * (_RoundWaveStrength/10.0)) % 1; + #endif + //---------------------------------------------------- + + + //WIND_ON + #if WIND_ON + half windOffset = sin((_Time.x + randomSeed) * _GrassSpeed * 10); + half2 windCenter = half2(0.5, 0.1); + #if ATLAS_ON + windCenter.x = ((_MaxXUV - _MinXUV) * windCenter.x) + _MinXUV; + windCenter.y = ((_MaxYUV - _MinYUV) * windCenter.y) + _MinYUV; + #endif + #if !MANUALWIND_ON + d.texcoord0.x = fmod(abs(lerp(d.texcoord0.x, d.texcoord0.x + (_GrassWind * 0.01 * windOffset), uvRect.y)), 1); + #else + d.texcoord0.x = fmod(abs(lerp(d.texcoord0.x, d.texcoord0.x + (_GrassWind * 0.01 * _GrassManualAnim), uvRect.y)), 1); + windOffset = _GrassManualAnim; + #endif + half2 delta = d.texcoord0.xy - windCenter; + half delta2 = dot(delta.xy, delta.xy); + half2 delta_offset = delta2 * windOffset; + d.texcoord0.xy = d.texcoord0.xy + half2(delta.y, -delta.x) * delta_offset * _GrassRadialBend; + #endif + + //-------------------------------------------------------- + + //TEXTURESCROLL_ON && !ATLAS_ON + #if TEXTURESCROLL_ON && !ATLAS_ON + d.texcoord0.x += ((_Time.y + randomSeed) * _TextureScrollXSpeed) % 1; + d.texcoord0.y += ((_Time.y + randomSeed) * _TextureScrollYSpeed) % 1; + #endif + //------------------------------ + + //PIXELATE_ON + #if PIXELATE_ON + half aspectRatio = _MainTex_TexelSize.x / _MainTex_TexelSize.y; + half2 pixelSize = float2(_PixelateSize, _PixelateSize * aspectRatio); + d.texcoord0.xy = floor(d.texcoord0.xy * pixelSize) / pixelSize; + #endif + //-------------- + + half4 col = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy); + half originalAlpha = col.a; + col *= d.vertexColor; + + //NORMAL MAP + #if NORMALMAP_ON + half4 normalSample = SAMPLE_TEXTURE2D(_NormalMap, sampler_NormalMap, d.texcoord0.xy); + half3 normalTS = UnpackNormal(normalSample); + normalTS.xy *= _NormalStrength; + o.Normal = normalTS; + #endif + + + //GLITCH_ON + #if GLITCH_ON + half2 uvGlitch = uvRect; + uvGlitch.y -= 0.5; + half lineNoise = pow(rand2(floor(uvGlitch * half2(24., 19.) * _GlitchSize) * 4.0, randomSeed), 3.0) * _GlitchAmount + * pow(rand2(floor(uvGlitch * half2(38., 14.) * _GlitchSize) * 4.0, randomSeed), 3.0); + col = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(lineNoise * 0.02 * rand2(half2(2.0, 1), randomSeed), 0)) * d.vertexColor; + #endif + //-------------------------------------- + + //CHROMABERR_ON + #if CHROMABERR_ON + half4 r = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(_ChromAberrAmount/10, 0)) * d.vertexColor; + half4 b = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(-_ChromAberrAmount/10, 0)) * d.vertexColor; + col = half4(r.r * r.a, col.g, b.b * b.a, max(max(r.a, b.a) * _ChromAberrAlpha, col.a)); + #endif + + //-------------------------------- + + //BLUR_ON + #if BLUR_ON + #if ATLAS_ON + #if !BLURISHD_ON + col = BlurHD(d.texcoord0.xy, _MainTex, sampler_MainTex, _BlurIntensity, (_MaxXUV - _MinXUV), (_MaxYUV - _MinYUV)) * d.vertexColor; + #else + col = Blur(d.texcoord0.xy, _MainTex, sampler_MainTex, _BlurIntensity * (_MaxXUV - _MinXUV)) * d.vertexColor; + #endif + #else + #if !BLURISHD_ON + col = BlurHD(d.texcoord0.xy, _MainTex, sampler_MainTex, _BlurIntensity, 1, 1) * d.vertexColor; + #else + col = Blur(d.texcoord0.xy, _MainTex, sampler_MainTex, _BlurIntensity) * d.vertexColor; + #endif + #endif + #endif + + //-------------------- + + //MOTIONBLUR_ON + #if MOTIONBLUR_ON + _MotionBlurAngle = _MotionBlurAngle * 3.1415926; + #define rot(n) mul(n, half2x2(cos(_MotionBlurAngle), -sin(_MotionBlurAngle), sin(_MotionBlurAngle), cos(_MotionBlurAngle))) + _MotionBlurDist = _MotionBlurDist * 0.005; + #if ATLAS_ON + _MotionBlurDist *= (_MaxXUV - _MinXUV); + #endif + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(-_MotionBlurDist, -_MotionBlurDist))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(-_MotionBlurDist * 2, -_MotionBlurDist * 2))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(-_MotionBlurDist * 3, -_MotionBlurDist * 3))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(-_MotionBlurDist * 4, -_MotionBlurDist * 4))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(_MotionBlurDist, _MotionBlurDist))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(_MotionBlurDist * 2, _MotionBlurDist * 2))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(_MotionBlurDist * 3, _MotionBlurDist * 3))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(_MotionBlurDist * 4, _MotionBlurDist * 4))); + col.rgb = col.rgb / 9; + #endif + //------------------------------------ + + //NEGATIVE_ON + #if NEGATIVE_ON + col.rgb = lerp(col.rgb, 1 - col.rgb, _NegativeAmount); + #endif + + //-------------- + half luminance = 0; + + //GREYSCALE_ON && !GREYSCALEOUTLINE_ON + #if GREYSCALE_ON && !GREYSCALEOUTLINE_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + luminance = saturate(luminance + _GreyscaleLuminosity); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _GreyscaleTintColor, _GreyscaleBlend); + #endif + //------------------------------------ + + //GHOST_ON + #if GHOST_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + half4 ghostResult; + ghostResult.a = saturate(luminance - _GhostTransparency) * col.a; + ghostResult.rgb = col.rgb * (luminance + _GhostColorBoost); + col = lerp(col, ghostResult, _GhostBlend); + #endif + //------------------------------------ + + //INNEROUTLINE_ON + #if INNEROUTLINE_ON + half3 innerT = abs(GetPixel(0, _InnerOutlineThickness, d.texcoord0.xy, _MainTex, sampler_MainTex) - GetPixel(0, -_InnerOutlineThickness, d.texcoord0.xy, _MainTex, sampler_MainTex)); + innerT += abs(GetPixel(_InnerOutlineThickness, 0, d.texcoord0.xy, _MainTex, sampler_MainTex) - GetPixel(-_InnerOutlineThickness, 0, d.texcoord0.xy, _MainTex, sampler_MainTex)); + #if !ONLYINNEROUTLINE_ON + innerT = (innerT / 2.0) * col.a * _InnerOutlineAlpha; + col.rgb += length(innerT) * _InnerOutlineColor.rgb * _InnerOutlineGlow; + #else + innerT *= col.a * _InnerOutlineAlpha; + col.rgb = length(innerT) * _InnerOutlineColor.rgb * _InnerOutlineGlow; + col.a = step(0.3, col.r+col.g+col.b); + #endif + #endif + //------------------------------------------------------- + + //HITEFFECT_ON + #if HITEFFECT_ON + col.rgb = lerp(col.rgb, _HitEffectColor.rgb * _HitEffectGlow, _HitEffectBlend); + #endif + //-------------------- + + //GRADIENT_ON + #if GRADIENT_ON + half2 tiledUvGrad = half2(uvRect.x / _MainTex_ST.x, uvRect.y / _MainTex_ST.y); + #if GRADIENT2COL_ON + _GradTopRightCol = _GradTopLeftCol; + _GradBotRightCol = _GradBotLeftCol; + #endif + #if RADIALGRADIENT_ON + half radialDist = 1 - length(tiledUvGrad - half2(0.5, 0.5)); + radialDist *= (_MainTex_TexelSize.w / _MainTex_TexelSize.z); + radialDist = saturate(_GradBoostX * radialDist); + half4 gradientResult = lerp(_GradTopLeftCol, _GradBotLeftCol, radialDist); + #else + half gradXLerpFactor = saturate(pow(tiledUvGrad.x, _GradBoostX)); + half4 gradientResult = lerp(lerp(_GradBotLeftCol, _GradBotRightCol, gradXLerpFactor), + lerp(_GradTopLeftCol, _GradTopRightCol, gradXLerpFactor), saturate(pow(tiledUvGrad.y, _GradBoostY))); + #endif + gradientResult = lerp(col, gradientResult, _GradBlend); + col.rgb = gradientResult.rgb * col.a; + col.a *= gradientResult.a; + #endif + //-------------------------------------------------------------------- + + //CONTRAST_ON + #if CONTRAST_ON + col.rgb = (col.rgb - float3(0.5, 0.5, 0.5)) * _Contrast + float3(0.5, 0.5, 0.5); + col.rgb += _Brightness; + #endif + + //------------------------------------------------------------------- + + //COLORSWAP_ON + #if COLORSWAP_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + half4 swapMask = SAMPLE_TEXTURE2D(_ColorSwapTex, sampler_ColorSwapTex, d.texcoord0.xy); + swapMask.rgb *= swapMask.a; + half3 redSwap = _ColorSwapRed * swapMask.r * saturate(luminance + _ColorSwapRedLuminosity); + half3 greenSwap = _ColorSwapGreen * swapMask.g * saturate(luminance + _ColorSwapGreenLuminosity); + half3 blueSwap = _ColorSwapBlue * swapMask.b * saturate(luminance + _ColorSwapBlueLuminosity); + swapMask.rgb = col.rgb * saturate(1 - swapMask.r - swapMask.g - swapMask.b); + col.rgb = lerp(col.rgb, swapMask.rgb + redSwap + greenSwap + blueSwap, _ColorSwapBlend); + #endif + //-------------------------------------------------------------------- + + //COLORRAMP_ON && !COLORRAMPOUTLINE_ON + #if COLORRAMP_ON && !COLORRAMPOUTLINE_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + luminance = saturate(luminance + _ColorRampLuminosity); + #if GRADIENTCOLORRAMP_ON + col.rgb = lerp(col.rgb, SAMPLE_TEXTURE2D(_ColorRampTexGradient, sampler_ColorRampTexGradient, half2(luminance, 0)).rgb, _ColorRampBlend); + #else + col.rgb = lerp(col.rgb, SAMPLE_TEXTURE2D(_ColorRampTex, sampler_ColorRampTex, half2(luminance, 0)).rgb, _ColorRampBlend); + #endif + #endif + //-------------------------------------------------------------------- + + //CHANGECOLOR_ON + #if CHANGECOLOR_ON + float3 currChangeColor = saturate(col.rgb); + luminance = 0.3 * currChangeColor.r + 0.59 * currChangeColor.g + 0.11 * currChangeColor.b; + luminance = saturate(luminance + _ColorChangeLuminosity); + half3 dif = abs(currChangeColor - _ColorChangeTarget.rgb); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _ColorChangeNewCol.rgb, + max(sign(1 - saturate(dif.x + dif.y + dif.z) - _ColorChangeTolerance), 0.0)); + #if CHANGECOLOR2_ON + dif = abs(currChangeColor - _ColorChangeTarget2.rgb); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _ColorChangeNewCol2.rgb, + max(sign(1 - saturate(dif.x + dif.y + dif.z) - _ColorChangeTolerance2), 0.0)); + #endif + #if CHANGECOLOR3_ON + dif = abs(currChangeColor - _ColorChangeTarget3.rgb); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _ColorChangeNewCol3.rgb, + max(sign(1 - saturate(dif.x + dif.y + dif.z) - _ColorChangeTolerance3), 0.0)); + #endif + #endif + //------------------------------------------------------- + + //POSTERIZE_ON && !POSTERIZEOUTLINE_ON + #if POSTERIZE_ON && !POSTERIZEOUTLINE_ON + col.rgb = pow(col.rgb, _PosterizeGamma) * _PosterizeNumColors; + col.rgb = floor(col.rgb) / _PosterizeNumColors; + col.rgb = pow(col.rgb, 1.0 / _PosterizeGamma); + #endif + //------------------------------------ + + //HSV_ON + #if HSV_ON + half3 resultHsv = half3(col.rgb); + half cosHsv = _HsvBright * _HsvSaturation * cos(_HsvShift * 3.14159265 / 180); + half sinHsv = _HsvBright * _HsvSaturation * sin(_HsvShift * 3.14159265 / 180); + resultHsv.x = (.299 * _HsvBright + .701 * cosHsv + .168 * sinHsv) * col.x + + (.587 * _HsvBright - .587 * cosHsv + .330 * sinHsv) * col.y + + (.114 * _HsvBright - .114 * cosHsv - .497 * sinHsv) * col.z; + resultHsv.y = (.299 * _HsvBright - .299 * cosHsv - .328 * sinHsv) *col.x + + (.587 * _HsvBright + .413 * cosHsv + .035 * sinHsv) * col.y + + (.114 * _HsvBright - .114 * cosHsv + .292 * sinHsv) * col.z; + resultHsv.z = (.299 * _HsvBright - .3 * cosHsv + 1.25 * sinHsv) * col.x + + (.587 * _HsvBright - .588 * cosHsv - 1.05 * sinHsv) * col.y + + (.114 * _HsvBright + .886 * cosHsv - .203 * sinHsv) * col.z; + col.rgb = resultHsv; + #endif + //------------------------------------------------------- + + //OVERLAY_ON + #if OVERLAY_ON + half2 overlayUvs = d.texcoord0.xy; + overlayUvs.x += ((_Time.y + randomSeed) * _OverlayTextureScrollXSpeed) % 1; + overlayUvs.y += ((_Time.y + randomSeed) * _OverlayTextureScrollYSpeed) % 1; + half4 overlayCol = SAMPLE_TEXTURE2D(_OverlayTex, sampler_OverlayTex, TRANSFORM_TEX(overlayUvs, _OverlayTex)); + overlayCol.rgb *= _OverlayColor.rgb * _OverlayGlow; + #if !OVERLAYMULT_ON + overlayCol.rgb *= overlayCol.a * _OverlayColor.rgb * _OverlayColor.a * _OverlayBlend; + col.rgb += overlayCol.rgb; + #else + overlayCol.a *= _OverlayColor.a; + col = lerp(col, col * overlayCol, _OverlayBlend); + #endif + #endif + + //--------------------------------- + + //OUTBASE_ON + #if OUTBASE_ON + #if OUTBASEPIXELPERF_ON + half2 destUv = half2(_OutlinePixelWidth * _MainTex_TexelSize.x, _OutlinePixelWidth * _MainTex_TexelSize.y); + #else + half2 destUv = half2(_OutlineWidth * _MainTex_TexelSize.x * 200, _OutlineWidth * _MainTex_TexelSize.y * 200); + #endif + + #if OUTDIST_ON + d.texcoord3.x += ((_Time.x + _RandomSeed) * _OutlineDistortTexXSpeed) % 1; + d.texcoord3.y += ((_Time.x + _RandomSeed) * _OutlineDistortTexYSpeed) % 1; + #if ATLAS_ON + d.texcoord3 = half2((d.texcoord3.x - _MinXUV) / (_MaxXUV - _MinXUV), (d.texcoord3.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half outDistortAmnt = (SAMPLE_TEXTURE2D(_OutlineDistortTex, sampler_OutlineDistortTex, d.texcoord3).r - 0.5) * 0.2 * _OutlineDistortAmount; + destUv.x += outDistortAmnt; + destUv.y += outDistortAmnt; + #endif + + half spriteLeft = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(destUv.x, 0)).a; + half spriteRight = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy - half2(destUv.x, 0)).a; + half spriteBottom = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(0, destUv.y)).a; + half spriteTop = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy - half2(0, destUv.y)).a; + half result = spriteLeft + spriteRight + spriteBottom + spriteTop; + + #if OUTBASE8DIR_ON + half spriteTopLeft = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(destUv.x, destUv.y)).a; + half spriteTopRight = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(-destUv.x, destUv.y)).a; + half spriteBotLeft = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(destUv.x, -destUv.y)).a; + half spriteBotRight = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(-destUv.x, -destUv.y)).a; + result = result + spriteTopLeft + spriteTopRight + spriteBotLeft + spriteBotRight; + #endif + + result = step(0.05, saturate(result)); + + #if OUTTEX_ON + d.texcoord1.x += ((_Time.x + _RandomSeed) * _OutlineTexXSpeed) % 1; + d.texcoord1.y += ((_Time.x + _RandomSeed) * _OutlineTexYSpeed) % 1; + #if ATLAS_ON + d.texcoord1 = half2((d.texcoord1.x - _MinXUV) / (_MaxXUV - _MinXUV), (d.texcoord1.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half4 tempOutColor = SAMPLE_TEXTURE2D(_OutlineTex, sampler_OutlineTex, d.texcoord1); + tempOutColor *= _OutlineColor; + _OutlineColor = tempOutColor; + #endif + + result *= (1 - originalAlpha) * _OutlineAlpha; + + half4 outline = _OutlineColor * d.vertexColor.a; + outline.rgb *= _OutlineGlow; + outline.a = result; + #if ONLYOUTLINE_ON + col = outline; + #else + col = lerp(col, outline, result); + #endif + #endif + //------------------------------------------------------- + + //FADE_ON + #if FADE_ON + half2 tiledUvFade1 = TRANSFORM_TEX(d.texcoord0, _FadeTex); + half2 tiledUvFade2 = TRANSFORM_TEX(d.texcoord0, _FadeBurnTex); + #if ATLAS_ON + tiledUvFade1 = half2((tiledUvFade1.x - _MinXUV) / (_MaxXUV - _MinXUV), (tiledUvFade1.y - _MinYUV) / (_MaxYUV - _MinYUV)); + tiledUvFade2 = half2((tiledUvFade2.x - _MinXUV) / (_MaxXUV - _MinXUV), (tiledUvFade2.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half fadeTemp = SAMPLE_TEXTURE2D(_FadeTex, sampler_FadeTex, tiledUvFade1).r; + half fade = smoothstep(_FadeAmount, _FadeAmount + _FadeBurnTransition, fadeTemp); + half fadeBurn = saturate(smoothstep(_FadeAmount - _FadeBurnWidth, _FadeAmount - _FadeBurnWidth + 0.1, fadeTemp) * _FadeAmount); + col.a *= fade; + _FadeBurnColor.rgb *= _FadeBurnGlow; + col += fadeBurn * SAMPLE_TEXTURE2D(_FadeBurnTex, sampler_FadeBurnTex, tiledUvFade2) * _FadeBurnColor * originalAlpha * (1 - col.a); + #endif + //------------------------------------------------------- + + //SHADOW_ON + #if SHADOW_ON + half shadowA = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(_ShadowX, _ShadowY)).a; + half preMultShadowMask = 1 - (saturate(shadowA - col.a) * (1 - col.a)); + col.rgb *= 1 - ((shadowA - col.a) * (1 - col.a)); + col.rgb += (_ShadowColor * shadowA) * (1 - col.a); + col.a = max(shadowA * _ShadowAlpha * d.vertexColor.a, col.a); + #endif + + //------------------------------------------------------- + + //GLOW_ON + #if GLOW_ON + half4 emission; + #if GLOWTEX_ON + emission = SAMPLE_TEXTURE2D(_GlowTex, sampler_GlowTex, d.texcoord0); + #else + emission = col; + #endif + + col.rgb *= _GlowGlobal; + emission.rgb *= emission.a * col.a * _Glow * _GlowColor; + col.rgb += emission.rgb; + #endif + //------------------------------------------------------- + + //COLORRAMP_ON && COLORRAMPOUTLINE_ON + #if COLORRAMP_ON && COLORRAMPOUTLINE_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + luminance = saturate(luminance + _ColorRampLuminosity); + #if GRADIENTCOLORRAMP_ON + col.rgb = lerp(col.rgb, SAMPLE_TEXTURE2D(_ColorRampTexGradient, sampler_ColorRampTexGradient, half2(luminance, 0)).rgb, _ColorRampBlend); + #else + col.rgb = lerp(col.rgb, SAMPLE_TEXTURE2D(_ColorRampTex, sampler_ColorRampTex, half2(luminance, 0)).rgb, _ColorRampBlend); + #endif + #endif + //--------------- + + //GREYSCALE_ON && GREYSCALEOUTLINE_ON + #if GREYSCALE_ON && GREYSCALEOUTLINE_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + luminance = saturate(luminance + _GreyscaleLuminosity); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _GreyscaleTintColor, _GreyscaleBlend); + #endif + + //----------------------------------- + + //POSTERIZE_ON && POSTERIZEOUTLINE_ON + #if POSTERIZE_ON && POSTERIZEOUTLINE_ON + col.rgb = pow(col.rgb, _PosterizeGamma) * _PosterizeNumColors; + col.rgb = floor(col.rgb) / _PosterizeNumColors; + col.rgb = pow(col.rgb, 1.0 / _PosterizeGamma); + #endif + + //----------------------------------- + + //SHINE_ON + #if SHINE_ON + half2 uvShine = uvRect; + half cosAngle = cos(_ShineRotate); + half sinAngle = sin(_ShineRotate); + half2x2 rot = half2x2(cosAngle, -sinAngle, sinAngle, cosAngle); + uvShine -= half2(0.5, 0.5); + uvShine = mul(rot, uvShine); + uvShine += half2(0.5, 0.5); + half shineMask = SAMPLE_TEXTURE2D(_ShineMask, sampler_ShineMask, d.texcoord0.xy).a; + half currentDistanceProjection = (uvShine.x + uvShine.y) / 2; + half whitePower = 1 - (abs(currentDistanceProjection - _ShineLocation) / _ShineWidth); + col.rgb += col.a * whitePower * _ShineGlow * max(sign(currentDistanceProjection - (_ShineLocation - _ShineWidth)), 0.0) + * max(sign((_ShineLocation + _ShineWidth) - currentDistanceProjection), 0.0) * _ShineColor * shineMask; + #endif + + //----------------------------------- + + //HOLOGRAM_ON + #if HOLOGRAM_ON + half totalHologram = _HologramStripesAmount + _HologramUnmodAmount; + half hologramYCoord = ((uvRect.y + (((_Time.x + randomSeed) % 1) * _HologramStripesSpeed)) % totalHologram) / totalHologram; + hologramYCoord = abs(hologramYCoord); + half alpha = RemapFloat(saturate(hologramYCoord - (_HologramUnmodAmount/totalHologram)), 0.0, 1.0, _HologramMinAlpha, saturate(_HologramMaxAlpha)); + half hologramMask = max(sign((_HologramUnmodAmount/totalHologram) - hologramYCoord), 0.0); + half4 hologramResult = col; + hologramResult.a *= lerp(alpha, 1, hologramMask); + hologramResult.rgb *= max(1, _HologramMaxAlpha * max(sign(hologramYCoord - (_HologramUnmodAmount/totalHologram)), 0.0)); + hologramMask = 1 - step(0.01,hologramMask); + hologramResult.rgb += hologramMask * _HologramStripeColor * col.a; + col = lerp(col, hologramResult, _HologramBlend); + #endif + + //----------------------------------- + + //FLICKER_ON + #if FLICKER_ON + col.a *= saturate(col.a * step(frac(0.05 + (_Time.w + randomSeed) * _FlickerFreq), 1 - _FlickerPercent) + _FlickerAlpha); + #endif + //----------------------------------- + + //ALPHACUTOFF_ON + + //ALPHAROUND_ON + + //ALPHAOUTLINE_ON + #if ALPHAOUTLINE_ON + half alphaOutlineRes = pow(1 - col.a, max(_AlphaOutlinePower, 0.0001)) * step(_AlphaOutlineMinAlpha, col.a) * _AlphaOutlineBlend; + col.rgb = lerp(col.rgb, _AlphaOutlineColor.rgb * _AlphaOutlineGlow, alphaOutlineRes); + col.a = lerp(col.a, 1, alphaOutlineRes > 1); + #endif + //------------------------------------------------------- + + //FOG_ON + + //------------------ + + col *= _Color; + o.Albedo = col; + col.a *= _Alpha; + clip(col.a - _AlphaCutoffValue - 0.01); + o.Alpha = _Color.a; + } + + + + + + void ChainSurfaceFunction(inout Surface l, inout ShaderData d) + { + Ext_SurfaceFunction0(l, d); + // Ext_SurfaceFunction1(l, d); + // Ext_SurfaceFunction2(l, d); + // Ext_SurfaceFunction3(l, d); + // Ext_SurfaceFunction4(l, d); + // Ext_SurfaceFunction5(l, d); + // Ext_SurfaceFunction6(l, d); + // Ext_SurfaceFunction7(l, d); + // Ext_SurfaceFunction8(l, d); + // Ext_SurfaceFunction9(l, d); + // Ext_SurfaceFunction10(l, d); + // Ext_SurfaceFunction11(l, d); + // Ext_SurfaceFunction12(l, d); + // Ext_SurfaceFunction13(l, d); + // Ext_SurfaceFunction14(l, d); + // Ext_SurfaceFunction15(l, d); + // Ext_SurfaceFunction16(l, d); + // Ext_SurfaceFunction17(l, d); + // Ext_SurfaceFunction18(l, d); + // Ext_SurfaceFunction19(l, d); + // Ext_SurfaceFunction20(l, d); + // Ext_SurfaceFunction21(l, d); + // Ext_SurfaceFunction22(l, d); + // Ext_SurfaceFunction23(l, d); + // Ext_SurfaceFunction24(l, d); + // Ext_SurfaceFunction25(l, d); + // Ext_SurfaceFunction26(l, d); + // Ext_SurfaceFunction27(l, d); + // Ext_SurfaceFunction28(l, d); + // Ext_SurfaceFunction29(l, d); + } + +#if !_DECALSHADER + + void ChainModifyVertex(inout VertexData v, inout VertexToPixel v2p, float4 time) + { + ExtraV2F d; + + ZERO_INITIALIZE(ExtraV2F, d); + ZERO_INITIALIZE(Blackboard, d.blackboard); + // due to motion vectors in HDRP, we need to use the last + // time in certain spots. So if you are going to use _Time to adjust vertices, + // you need to use this time or motion vectors will break. + d.time = time; + + Ext_ModifyVertex0(v, d); + // Ext_ModifyVertex1(v, d); + // Ext_ModifyVertex2(v, d); + // Ext_ModifyVertex3(v, d); + // Ext_ModifyVertex4(v, d); + // Ext_ModifyVertex5(v, d); + // Ext_ModifyVertex6(v, d); + // Ext_ModifyVertex7(v, d); + // Ext_ModifyVertex8(v, d); + // Ext_ModifyVertex9(v, d); + // Ext_ModifyVertex10(v, d); + // Ext_ModifyVertex11(v, d); + // Ext_ModifyVertex12(v, d); + // Ext_ModifyVertex13(v, d); + // Ext_ModifyVertex14(v, d); + // Ext_ModifyVertex15(v, d); + // Ext_ModifyVertex16(v, d); + // Ext_ModifyVertex17(v, d); + // Ext_ModifyVertex18(v, d); + // Ext_ModifyVertex19(v, d); + // Ext_ModifyVertex20(v, d); + // Ext_ModifyVertex21(v, d); + // Ext_ModifyVertex22(v, d); + // Ext_ModifyVertex23(v, d); + // Ext_ModifyVertex24(v, d); + // Ext_ModifyVertex25(v, d); + // Ext_ModifyVertex26(v, d); + // Ext_ModifyVertex27(v, d); + // Ext_ModifyVertex28(v, d); + // Ext_ModifyVertex29(v, d); + + + // #if %EXTRAV2F0REQUIREKEY% + // v2p.extraV2F0 = d.extraV2F0; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // v2p.extraV2F1 = d.extraV2F1; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // v2p.extraV2F2 = d.extraV2F2; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // v2p.extraV2F3 = d.extraV2F3; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // v2p.extraV2F4 = d.extraV2F4; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // v2p.extraV2F5 = d.extraV2F5; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // v2p.extraV2F6 = d.extraV2F6; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // v2p.extraV2F7 = d.extraV2F7; + // #endif + } + + void ChainModifyTessellatedVertex(inout VertexData v, inout VertexToPixel v2p) + { + ExtraV2F d; + ZERO_INITIALIZE(ExtraV2F, d); + ZERO_INITIALIZE(Blackboard, d.blackboard); + + // #if %EXTRAV2F0REQUIREKEY% + // d.extraV2F0 = v2p.extraV2F0; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // d.extraV2F1 = v2p.extraV2F1; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // d.extraV2F2 = v2p.extraV2F2; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // d.extraV2F3 = v2p.extraV2F3; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // d.extraV2F4 = v2p.extraV2F4; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // d.extraV2F5 = v2p.extraV2F5; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // d.extraV2F6 = v2p.extraV2F6; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // d.extraV2F7 = v2p.extraV2F7; + // #endif + + + // Ext_ModifyTessellatedVertex0(v, d); + // Ext_ModifyTessellatedVertex1(v, d); + // Ext_ModifyTessellatedVertex2(v, d); + // Ext_ModifyTessellatedVertex3(v, d); + // Ext_ModifyTessellatedVertex4(v, d); + // Ext_ModifyTessellatedVertex5(v, d); + // Ext_ModifyTessellatedVertex6(v, d); + // Ext_ModifyTessellatedVertex7(v, d); + // Ext_ModifyTessellatedVertex8(v, d); + // Ext_ModifyTessellatedVertex9(v, d); + // Ext_ModifyTessellatedVertex10(v, d); + // Ext_ModifyTessellatedVertex11(v, d); + // Ext_ModifyTessellatedVertex12(v, d); + // Ext_ModifyTessellatedVertex13(v, d); + // Ext_ModifyTessellatedVertex14(v, d); + // Ext_ModifyTessellatedVertex15(v, d); + // Ext_ModifyTessellatedVertex16(v, d); + // Ext_ModifyTessellatedVertex17(v, d); + // Ext_ModifyTessellatedVertex18(v, d); + // Ext_ModifyTessellatedVertex19(v, d); + // Ext_ModifyTessellatedVertex20(v, d); + // Ext_ModifyTessellatedVertex21(v, d); + // Ext_ModifyTessellatedVertex22(v, d); + // Ext_ModifyTessellatedVertex23(v, d); + // Ext_ModifyTessellatedVertex24(v, d); + // Ext_ModifyTessellatedVertex25(v, d); + // Ext_ModifyTessellatedVertex26(v, d); + // Ext_ModifyTessellatedVertex27(v, d); + // Ext_ModifyTessellatedVertex28(v, d); + // Ext_ModifyTessellatedVertex29(v, d); + + // #if %EXTRAV2F0REQUIREKEY% + // v2p.extraV2F0 = d.extraV2F0; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // v2p.extraV2F1 = d.extraV2F1; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // v2p.extraV2F2 = d.extraV2F2; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // v2p.extraV2F3 = d.extraV2F3; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // v2p.extraV2F4 = d.extraV2F4; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // v2p.extraV2F5 = d.extraV2F5; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // v2p.extraV2F6 = d.extraV2F6; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // v2p.extraV2F7 = d.extraV2F7; + // #endif + } + + void ChainFinalColorForward(inout Surface l, inout ShaderData d, inout half4 color) + { + // Ext_FinalColorForward0(l, d, color); + // Ext_FinalColorForward1(l, d, color); + // Ext_FinalColorForward2(l, d, color); + // Ext_FinalColorForward3(l, d, color); + // Ext_FinalColorForward4(l, d, color); + // Ext_FinalColorForward5(l, d, color); + // Ext_FinalColorForward6(l, d, color); + // Ext_FinalColorForward7(l, d, color); + // Ext_FinalColorForward8(l, d, color); + // Ext_FinalColorForward9(l, d, color); + // Ext_FinalColorForward10(l, d, color); + // Ext_FinalColorForward11(l, d, color); + // Ext_FinalColorForward12(l, d, color); + // Ext_FinalColorForward13(l, d, color); + // Ext_FinalColorForward14(l, d, color); + // Ext_FinalColorForward15(l, d, color); + // Ext_FinalColorForward16(l, d, color); + // Ext_FinalColorForward17(l, d, color); + // Ext_FinalColorForward18(l, d, color); + // Ext_FinalColorForward19(l, d, color); + // Ext_FinalColorForward20(l, d, color); + // Ext_FinalColorForward21(l, d, color); + // Ext_FinalColorForward22(l, d, color); + // Ext_FinalColorForward23(l, d, color); + // Ext_FinalColorForward24(l, d, color); + // Ext_FinalColorForward25(l, d, color); + // Ext_FinalColorForward26(l, d, color); + // Ext_FinalColorForward27(l, d, color); + // Ext_FinalColorForward28(l, d, color); + // Ext_FinalColorForward29(l, d, color); + } + + void ChainFinalGBufferStandard(inout Surface s, inout ShaderData d, inout half4 GBuffer0, inout half4 GBuffer1, inout half4 GBuffer2, inout half4 outEmission, inout half4 outShadowMask) + { + // Ext_FinalGBufferStandard0(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard1(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard2(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard3(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard4(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard5(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard6(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard7(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard8(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard9(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard10(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard11(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard12(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard13(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard14(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard15(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard16(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard17(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard18(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard19(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard20(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard21(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard22(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard23(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard24(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard25(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard26(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard27(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard28(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard29(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + } +#endif + + + + + +#if _DECALSHADER + + ShaderData CreateShaderData(SurfaceDescriptionInputs IN) + { + ShaderData d = (ShaderData)0; + d.TBNMatrix = float3x3(IN.WorldSpaceTangent, IN.WorldSpaceBiTangent, IN.WorldSpaceNormal); + d.worldSpaceNormal = IN.WorldSpaceNormal; + d.worldSpaceTangent = IN.WorldSpaceTangent; + + d.worldSpacePosition = IN.WorldSpacePosition; + d.texcoord0 = IN.uv0.xyxy; + d.screenPos = IN.ScreenPosition; + + d.worldSpaceViewDir = normalize(_WorldSpaceCameraPos - d.worldSpacePosition); + + d.tangentSpaceViewDir = mul(d.TBNMatrix, d.worldSpaceViewDir); + + // these rarely get used, so we back transform them. Usually will be stripped. + #if _HDRP + // d.localSpacePosition = mul(GetWorldToObjectMatrix(), float4(GetCameraRelativePositionWS(d.worldSpacePosition), 1)).xyz; + #else + // d.localSpacePosition = mul(GetWorldToObjectMatrix(), float4(d.worldSpacePosition, 1)).xyz; + #endif + // d.localSpaceNormal = normalize(mul((float3x3)GetWorldToObjectMatrix(), d.worldSpaceNormal)); + // d.localSpaceTangent = normalize(mul((float3x3)GetWorldToObjectMatrix(), d.worldSpaceTangent.xyz)); + + // #if %SCREENPOSREQUIREKEY% + // d.screenUV = (IN.ScreenPosition.xy / max(0.01, IN.ScreenPosition.w)); + // #endif + + return d; + } +#else + + ShaderData CreateShaderData(VertexToPixel i + #if NEED_FACING + , bool facing + #endif + ) + { + ShaderData d = (ShaderData)0; + d.clipPos = i.pos; + d.worldSpacePosition = i.worldPos; + + d.worldSpaceNormal = normalize(i.worldNormal); + d.worldSpaceTangent.xyz = normalize(i.worldTangent.xyz); + + d.tangentSign = i.worldTangent.w * unity_WorldTransformParams.w; + float3 bitangent = cross(d.worldSpaceTangent.xyz, d.worldSpaceNormal) * d.tangentSign; + + d.TBNMatrix = float3x3(d.worldSpaceTangent, -bitangent, d.worldSpaceNormal); + d.worldSpaceViewDir = normalize(_WorldSpaceCameraPos - i.worldPos); + + d.tangentSpaceViewDir = mul(d.TBNMatrix, d.worldSpaceViewDir); + d.texcoord0 = i.texcoord0; + d.texcoord1 = i.texcoord1; + d.texcoord2 = i.texcoord2; + + // #if %TEXCOORD3REQUIREKEY% + d.texcoord3 = i.texcoord3; + // #endif + + // d.isFrontFace = facing; + // #if %VERTEXCOLORREQUIREKEY% + d.vertexColor = i.vertexColor; + // #endif + + // these rarely get used, so we back transform them. Usually will be stripped. + #if _HDRP + // d.localSpacePosition = mul(GetWorldToObjectMatrix(), float4(GetCameraRelativePositionWS(i.worldPos), 1)).xyz; + #else + // d.localSpacePosition = mul(GetWorldToObjectMatrix(), float4(i.worldPos, 1)).xyz; + #endif + // d.localSpaceNormal = normalize(mul((float3x3)GetWorldToObjectMatrix(), i.worldNormal)); + // d.localSpaceTangent = normalize(mul((float3x3)GetWorldToObjectMatrix(), i.worldTangent.xyz)); + + // #if %SCREENPOSREQUIREKEY% + // d.screenPos = i.screenPos; + // d.screenUV = (i.screenPos.xy / i.screenPos.w); + // #endif + + + // #if %EXTRAV2F0REQUIREKEY% + // d.extraV2F0 = i.extraV2F0; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // d.extraV2F1 = i.extraV2F1; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // d.extraV2F2 = i.extraV2F2; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // d.extraV2F3 = i.extraV2F3; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // d.extraV2F4 = i.extraV2F4; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // d.extraV2F5 = i.extraV2F5; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // d.extraV2F6 = i.extraV2F6; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // d.extraV2F7 = i.extraV2F7; + // #endif + + return d; + } + +#endif + + + +#if (SHADERPASS == SHADERPASS_LIGHT_TRANSPORT) + + // This was not in constant buffer in original unity, so keep outiside. But should be in as ShaderRenderPass frequency + float unity_OneOverOutputBoost; + float unity_MaxOutputValue; + + CBUFFER_START(UnityMetaPass) + // x = use uv1 as raster position + // y = use uv2 as raster position + bool4 unity_MetaVertexControl; + + // x = return albedo + // y = return normal + bool4 unity_MetaFragmentControl; + CBUFFER_END + + VertexToPixel Vert(VertexData inputMesh) + { + VertexToPixel output; + ZERO_INITIALIZE(VertexToPixel, output); + UNITY_SETUP_INSTANCE_ID(inputMesh); + UNITY_TRANSFER_INSTANCE_ID(inputMesh, output); + UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(output); + + // Output UV coordinate in vertex shader + float2 uv = float2(0.0, 0.0); + + if (unity_MetaVertexControl.x) + { + uv = inputMesh.texcoord1.xy * unity_LightmapST.xy + unity_LightmapST.zw; + } + else if (unity_MetaVertexControl.y) + { + uv = inputMesh.texcoord2.xy * unity_DynamicLightmapST.xy + unity_DynamicLightmapST.zw; + } + + // OpenGL right now needs to actually use the incoming vertex position + // so we create a fake dependency on it here that haven't any impact. + output.pos = float4(uv * 2.0 - 1.0, inputMesh.vertex.z > 0 ? 1.0e-4 : 0.0, 1.0); + + output.worldPos = TransformObjectToWorld(inputMesh.vertex.xyz).xyz; + + // Normal is required for triplanar mapping + output.worldNormal = TransformObjectToWorldNormal(inputMesh.normal); + // Not required but assign to silent compiler warning + output.worldTangent = float4(1.0, 0.0, 0.0, 0.0); + + output.texcoord0 = inputMesh.texcoord0; + output.texcoord1 = inputMesh.texcoord1; + output.texcoord2 = inputMesh.texcoord2; + // #if %TEXCOORD3REQUIREKEY% + output.texcoord3 = inputMesh.texcoord3; + // #endif + // #if %VERTEXCOLORREQUIREKEY% + output.vertexColor = inputMesh.vertexColor; + // #endif + + return output; + } +#else + + #if (_PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR))) + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/ShaderVariablesMatrixDefsHDCamera.hlsl" + + void MotionVectorPositionZBias(VertexToPixel input) + { + #if UNITY_REVERSED_Z + input.pos.z -= unity_MotionVectorsParams.z * input.pos.w; + #else + input.pos.z += unity_MotionVectorsParams.z * input.pos.w; + #endif + } + + #endif + + VertexToPixel Vert(VertexData input) + { + VertexToPixel output; + ZERO_INITIALIZE(VertexToPixel, output); + + UNITY_SETUP_INSTANCE_ID(input); + UNITY_TRANSFER_INSTANCE_ID(input, output); + UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(output); + + #if _HDRP && (_PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR))) + VertexData previousMesh = input; + #endif + + ChainModifyVertex(input, output, _Time); + + // This return the camera relative position (if enable) + float3 positionRWS = TransformObjectToWorld(input.vertex.xyz); + float3 normalWS = TransformObjectToWorldNormal(input.normal); + float4 tangentWS = float4(TransformObjectToWorldDir(input.tangent.xyz), input.tangent.w); + + + output.worldPos = GetAbsolutePositionWS(positionRWS); + output.pos = TransformWorldToHClip(positionRWS); + output.worldNormal = normalWS; + output.worldTangent = tangentWS; + + + output.texcoord0 = input.texcoord0; + output.texcoord1 = input.texcoord1; + output.texcoord2 = input.texcoord2; + + // #if %TEXCOORD3REQUIREKEY% + output.texcoord3 = input.texcoord3; + // #endif + + // #if %VERTEXCOLORREQUIREKEY% + output.vertexColor = input.vertexColor; + // #endif + + // #if %SCREENPOSREQUIREKEY% + // output.screenPos = ComputeScreenPos(output.pos, _ProjectionParams.x); + // #endif + + #if _HDRP && (_PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR))) + + #if !defined(TESSELLATION_ON) + MotionVectorPositionZBias(output); + #endif + + output.motionVectorCS = mul(UNITY_MATRIX_UNJITTERED_VP, float4(positionRWS.xyz, 1.0)); + // Note: unity_MotionVectorsParams.y is 0 is forceNoMotion is enabled + bool forceNoMotion = unity_MotionVectorsParams.y == 0.0; + if (forceNoMotion) + { + output.previousPositionCS = float4(0.0, 0.0, 0.0, 1.0); + } + else + { + bool hasDeformation = unity_MotionVectorsParams.x > 0.0; // Skin or morph target + + float3 effectivePositionOS = (hasDeformation ? previousMesh.previousPositionOS : previousMesh.vertex.xyz); + #if defined(_ADD_PRECOMPUTED_VELOCITY) + effectivePositionOS -= input.precomputedVelocity; + #endif + + previousMesh.vertex = float4(effectivePositionOS, 1); + VertexToPixel dummy = (VertexToPixel)0; + + + ChainModifyVertex(previousMesh, dummy, _LastTimeParameters); + + // we might need this for skinned objects? + //float3 normalWS = TransformPreviousObjectToWorldNormal(input.normal).xyz; + float3 previousPositionRWS = TransformPreviousObjectToWorld(previousMesh.vertex.xyz); + + #ifdef _WRITE_TRANSPARENT_MOTION_VECTOR + if (_TransparentCameraOnlyMotionVectors > 0) + { + previousPositionRWS = positionRWS.xyz; + } + #endif // _WRITE_TRANSPARENT_MOTION_VECTOR + + output.previousPositionCS = mul(UNITY_MATRIX_PREV_VP, float4(previousPositionRWS, 1.0)); + } + #endif // _HDRP && _PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR)) + + + return output; + } + + +#endif + + + + + + + + #if defined(WRITE_DECAL_BUFFER) && !defined(_DISABLE_DECALS) + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/Decal/DecalPrepassBuffer.hlsl" + #endif + + FragInputs BuildFragInputs(VertexToPixel input) + { + UNITY_SETUP_INSTANCE_ID(input); + FragInputs output; + ZERO_INITIALIZE(FragInputs, output); + + // Init to some default value to make the computer quiet (else it output 'divide by zero' warning even if value is not used). + // TODO: this is a really poor workaround, but the variable is used in a bunch of places + // to compute normals which are then passed on elsewhere to compute other values... + output.tangentToWorld = k_identity3x3; + output.positionSS = input.pos; // input.positionCS is SV_Position + // BETTER SHADERS: because we transform world position into actual world space for things like + // triplanar, etc, we have to back transform it here for lighting + output.positionRWS = GetCameraRelativePositionWS(input.worldPos); + output.tangentToWorld = BuildTangentToWorld(input.worldTangent, input.worldNormal); + output.texCoord0 = input.texcoord0; + output.texCoord1 = input.texcoord1; + output.texCoord2 = input.texcoord2; + + return output; + } + +#if UNITY_VERSION > UNITY_2022_3_12 + void ApplyDecalAndGetNormal(FragInputs fragInputs, PositionInputs posInput, Surface surfaceDescription, float3 normalTS, + inout SurfaceData surfaceData) + { + float3 doubleSidedConstants = GetDoubleSidedConstants(); + + #ifdef DECAL_NORMAL_BLENDING + // SG nodes don't ouptut surface gradients, so if decals require surf grad blending, we have to convert + // the normal to gradient before applying the decal. We then have to resolve the gradient back to world space + normalTS = SurfaceGradientFromTangentSpaceNormalAndFromTBN(normalTS, + fragInputs.tangentToWorld[0], fragInputs.tangentToWorld[1]); + + + #if HAVE_DECALS + if (_EnableDecals) + { + float alpha = 1.0; + alpha = surfaceDescription.Alpha; + + DecalSurfaceData decalSurfaceData = GetDecalSurfaceData(posInput, fragInputs, alpha); + ApplyDecalToSurfaceNormal(decalSurfaceData, fragInputs.tangentToWorld[2], normalTS); + ApplyDecalToSurfaceDataNoNormal(decalSurfaceData, surfaceData); + } + #endif + + GetNormalWS_SG(fragInputs, normalTS, surfaceData.normalWS, doubleSidedConstants); + #else + // normal delivered to master node + + #if HAVE_DECALS + if (_EnableDecals) + { + float alpha = 1.0; + alpha = surfaceDescription.Alpha; + + // Both uses and modifies 'surfaceData.normalWS'. + DecalSurfaceData decalSurfaceData = GetDecalSurfaceData(posInput, fragInputs, alpha); + ApplyDecalToSurfaceNormal(decalSurfaceData, surfaceData.normalWS.xyz); + ApplyDecalToSurfaceDataNoNormal(decalSurfaceData, surfaceData); + } + #endif + #endif + } +#endif + + void BuildSurfaceData(FragInputs fragInputs, inout Surface surfaceDescription, float3 V, PositionInputs posInput, out SurfaceData surfaceData, out float3 bentNormalWS) + { + // setup defaults -- these are used if the graph doesn't output a value + ZERO_INITIALIZE(SurfaceData, surfaceData); + + // specularOcclusion need to be init ahead of decal to quiet the compiler that modify the SurfaceData struct + // however specularOcclusion can come from the graph, so need to be init here so it can be override. + surfaceData.specularOcclusion = 1.0; + + // copy across graph values, if defined + surfaceData.baseColor = surfaceDescription.Albedo; + surfaceData.perceptualSmoothness = surfaceDescription.Smoothness; + surfaceData.ambientOcclusion = surfaceDescription.Occlusion; + surfaceData.specularOcclusion = surfaceDescription.SpecularOcclusion; + surfaceData.metallic = surfaceDescription.Metallic; + surfaceData.subsurfaceMask = surfaceDescription.SubsurfaceMask; + surfaceData.thickness = surfaceDescription.Thickness; + surfaceData.diffusionProfileHash = asuint(surfaceDescription.DiffusionProfileHash); + #if _USESPECULAR + surfaceData.specularColor = surfaceDescription.Specular; + #endif + surfaceData.coatMask = surfaceDescription.CoatMask; + surfaceData.anisotropy = surfaceDescription.Anisotropy; + surfaceData.iridescenceMask = surfaceDescription.IridescenceMask; + surfaceData.iridescenceThickness = surfaceDescription.IridescenceThickness; + + + + #if defined(_REFRACTION_PLANE) || defined(_REFRACTION_SPHERE) || defined(_REFRACTION_THIN) + if (_EnableSSRefraction) + { + surfaceData.transmittanceMask = (1.0 - surfaceDescription.Alpha); + surfaceDescription.Alpha = 1.0; + } + else + { + surfaceData.ior = surfaceDescription.ior; + surfaceData.transmittanceColor = surfaceDescription.transmittanceColor; + surfaceData.atDistance = surfaceDescription.atDistance; + surfaceData.transmittanceMask = surfaceDescription.transmittanceMask; + surfaceDescription.Alpha = 1.0; + } + #else + surfaceData.ior = 1.0; + surfaceData.transmittanceColor = float3(1.0, 1.0, 1.0); + surfaceData.atDistance = 1.0; + surfaceData.transmittanceMask = 0.0; + #endif + + + + // These static material feature allow compile time optimization + surfaceData.materialFeatures = MATERIALFEATUREFLAGS_LIT_STANDARD; + #ifdef _MATERIAL_FEATURE_SUBSURFACE_SCATTERING + surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_SUBSURFACE_SCATTERING; + #endif + + #ifdef _MATERIAL_FEATURE_TRANSMISSION + surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_TRANSMISSION; + #endif + + #ifdef _MATERIAL_FEATURE_ANISOTROPY + surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_ANISOTROPY; + surfaceData.normalWS = float3(0, 1, 0); + #endif + + #ifdef _MATERIAL_FEATURE_IRIDESCENCE + surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_IRIDESCENCE; + #endif + + #ifdef _MATERIAL_FEATURE_SPECULAR_COLOR + surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_SPECULAR_COLOR; + #endif + + #if defined(_MATERIAL_FEATURE_CLEAR_COAT) || _CLEARCOAT + surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_CLEAR_COAT; + #endif + + #if defined (_MATERIAL_FEATURE_SPECULAR_COLOR) && defined (_ENERGY_CONSERVING_SPECULAR) + // Require to have setup baseColor + // Reproduce the energy conservation done in legacy Unity. Not ideal but better for compatibility and users can unchek it + surfaceData.baseColor *= (1.0 - Max3(surfaceData.specularColor.r, surfaceData.specularColor.g, surfaceData.specularColor.b)); + #endif + + float3 normalTS = surfaceDescription.Normal; + #if !_WORLDSPACENORMAL + surfaceData.normalWS = mul(surfaceDescription.Normal, fragInputs.tangentToWorld); + #else + normalTS = mul(fragInputs.tangentToWorld, surfaceDescription.Normal); + surfaceData.normalWS = surfaceDescription.Normal; + #endif + + + #if UNITY_VERSION > UNITY_2022_3_12 + ApplyDecalAndGetNormal(fragInputs, posInput, surfaceDescription, normalTS, surfaceData); + #else + #ifdef DECAL_NORMAL_BLENDING + #if HAVE_DECALS + float alpha = 1.0; + alpha = surfaceDescription.Alpha; + if (_EnableDecals) + { + DecalSurfaceData decalSurfaceData = GetDecalSurfaceData(posInput, fragInputs, alpha); + ApplyDecalToSurfaceData(decalSurfaceData, fragInputs.tangentToWorld[2], surfaceData, normalTS); + } + #endif + #else + #if HAVE_DECALS + if (_EnableDecals) + { + float alpha = 1.0; + alpha = surfaceDescription.Alpha; + // Both uses and modifies 'surfaceData.normalWS'. + DecalSurfaceData decalSurfaceData = GetDecalSurfaceData(posInput, fragInputs, alpha); + ApplyDecalToSurfaceData(decalSurfaceData, fragInputs.tangentToWorld[2], surfaceData); + } + #endif + #endif + #endif + + + + surfaceData.geomNormalWS = fragInputs.tangentToWorld[2]; + + surfaceData.tangentWS = normalize(fragInputs.tangentToWorld[0].xyz); // The tangent is not normalize in tangentToWorld for mikkt. TODO: Check if it expected that we normalize with Morten. Tag: SURFACE_GRADIENT + + + bentNormalWS = surfaceData.normalWS; + + surfaceData.tangentWS = Orthonormalize(surfaceData.tangentWS, surfaceData.normalWS); + + #ifdef DEBUG_DISPLAY + if (_DebugMipMapMode != DEBUGMIPMAPMODE_NONE) + { + // TODO: need to update mip info + surfaceData.metallic = 0; + } + + // We need to call ApplyDebugToSurfaceData after filling the surfarcedata and before filling builtinData + // as it can modify attribute use for static lighting + ApplyDebugToSurfaceData(fragInputs.tangentToWorld, surfaceData); + #endif + + // By default we use the ambient occlusion with Tri-ace trick (apply outside) for specular occlusion. + // If user provide bent normal then we process a better term + #if defined(_SPECULAR_OCCLUSION_CUSTOM) + // Just use the value passed through via the slot (not active otherwise) + #elif defined(_SPECULAR_OCCLUSION_FROM_AO_BENT_NORMAL) + // If we have bent normal and ambient occlusion, process a specular occlusion + surfaceData.specularOcclusion = GetSpecularOcclusionFromBentAO(V, bentNormalWS, surfaceData.normalWS, surfaceData.ambientOcclusion, PerceptualSmoothnessToPerceptualRoughness(surfaceData.perceptualSmoothness)); + #elif defined(_AMBIENT_OCCLUSION) && defined(_SPECULAR_OCCLUSION_FROM_AO) + surfaceData.specularOcclusion = GetSpecularOcclusionFromAmbientOcclusion(ClampNdotV(dot(surfaceData.normalWS, V)), surfaceData.ambientOcclusion, PerceptualSmoothnessToRoughness(surfaceData.perceptualSmoothness)); + #endif + + #if defined(_ENABLE_GEOMETRIC_SPECULAR_AA) && !defined(SHADER_STAGE_RAY_TRACING) + surfaceData.perceptualSmoothness = GeometricNormalFiltering(surfaceData.perceptualSmoothness, fragInputs.tangentToWorld[2], surfaceDescription.SpecularAAScreenSpaceVariance, surfaceDescription.SpecularAAThreshold); + #endif + } + + void GetSurfaceAndBuiltinData(VertexToPixel m2ps, FragInputs fragInputs, float3 V, inout PositionInputs posInput, + out SurfaceData surfaceData, out BuiltinData builtinData, inout Surface l, inout ShaderData d + #if NEED_FACING + , bool facing + #endif + ) + { + // Removed since crossfade does not work, probably needs extra material setup. + //#if !defined(SHADER_STAGE_RAY_TRACING) && !defined(_TESSELLATION_DISPLACEMENT) + // #ifdef LOD_FADE_CROSSFADE // enable dithering LOD transition if user select CrossFade transition in LOD group + // LODDitheringTransition(ComputeFadeMaskSeed(V, posInput.positionSS), unity_LODFade.x); + // #endif + //#endif + + + + + d = CreateShaderData(m2ps + #if NEED_FACING + , facing + #endif + ); + + l = (Surface)0; + + l.Albedo = half3(0.5, 0.5, 0.5); + l.Normal = float3(0,0,1); + l.Occlusion = 1; + l.Alpha = 1; + l.SpecularOcclusion = 1; + + #if !defined(SHADER_STAGE_RAY_TRACING) && defined(_DEPTHOFFSET_ON) + l.outputDepth = d.clipPos.z; + #endif + + ChainSurfaceFunction(l, d); + + #if !defined(SHADER_STAGE_RAY_TRACING) && defined(_DEPTHOFFSET_ON) + posInput.deviceDepth = l.outputDepth; + #endif + + #if _UNLIT + //l.Emission = l.Albedo; + //l.Albedo = 0; + l.Normal = half3(0,0,1); + l.Occlusion = 1; + l.Metallic = 0; + l.Specular = 0; + #endif + + surfaceData.geomNormalWS = d.worldSpaceNormal; + surfaceData.tangentWS = d.worldSpaceTangent; + fragInputs.tangentToWorld = d.TBNMatrix; + + float3 bentNormalWS; + + BuildSurfaceData(fragInputs, l, V, posInput, surfaceData, bentNormalWS); + + + float4 lightmapTexCoord1 = fragInputs.texCoord1; + float4 lightmapTexCoord2 = fragInputs.texCoord2; + //#ifdef FRAG_INPUTS_USE_TEXCOORD1 + // float4 lightmapTexCoord1 = fragInputs.texCoord1; + // #else + // float4 lightmapTexCoord1 = float4(0,0,0,0); + // #endif + + // #ifdef FRAG_INPUTS_USE_TEXCOORD2 + // float4 lightmapTexCoord2 = fragInputs.texCoord2; + // #else + // float4 lightmapTexCoord2 = float4(0,0,0,0); + // #endif + + + InitBuiltinData(posInput, l.Alpha, bentNormalWS, -d.worldSpaceNormal, lightmapTexCoord1, lightmapTexCoord2, builtinData); + + + + builtinData.emissiveColor = l.Emission; + + #if defined(_OVERRIDE_BAKEDGI) + builtinData.bakeDiffuseLighting = l.DiffuseGI; + builtinData.backBakeDiffuseLighting = l.BackDiffuseGI; + builtinData.emissiveColor += l.SpecularGI; + #endif + + #if defined(_OVERRIDE_SHADOWMASK) + builtinData.shadowMask0 = l.ShadowMask.x; + builtinData.shadowMask1 = l.ShadowMask.y; + builtinData.shadowMask2 = l.ShadowMask.z; + builtinData.shadowMask3 = l.ShadowMask.w; + #endif + + #ifdef UNITY_VIRTUAL_TEXTURING + //builtinData.vtPackedFeedback = surfaceData.VTPackedFeedback; + #endif + + #if (SHADERPASS == SHADERPASS_DISTORTION) + builtinData.distortion = surfaceData.Distortion; + builtinData.distortionBlur = surfaceData.DistortionBlur; + #endif + + #ifndef SHADER_UNLIT + // PostInitBuiltinData call ApplyDebugToBuiltinData + PostInitBuiltinData(V, posInput, surfaceData, builtinData); + #else + ApplyDebugToBuiltinData(builtinData); + #endif + + RAY_TRACING_OPTIONAL_ALPHA_TEST_PASS + } + + + #if defined(WRITE_NORMAL_BUFFER) && defined(WRITE_MSAA_DEPTH) + #define SV_TARGET_DECAL SV_Target2 + #elif defined(WRITE_NORMAL_BUFFER) || defined(WRITE_MSAA_DEPTH) + #define SV_TARGET_DECAL SV_Target1 + #else + #define SV_TARGET_DECAL SV_Target0 + #endif + + + void Frag( VertexToPixel v2f + #if defined(SCENESELECTIONPASS) || defined(SCENEPICKINGPASS) + , out float4 outColor : SV_Target0 + #else + #ifdef WRITE_MSAA_DEPTH + // We need the depth color as SV_Target0 for alpha to coverage + , out float4 depthColor : SV_Target0 + #ifdef WRITE_NORMAL_BUFFER + , out float4 outNormalBuffer : SV_Target1 + #endif + #else + #ifdef WRITE_NORMAL_BUFFER + , out float4 outNormalBuffer : SV_Target0 + #endif + #endif + + // Decal buffer must be last as it is bind but we can optionally write into it (based on _DISABLE_DECALS) + #if defined(WRITE_DECAL_BUFFER) && !defined(_DISABLE_DECALS) + , out float4 outDecalBuffer : SV_TARGET_DECAL + #endif + #endif + + #if defined(_DEPTHOFFSET_ON) && !defined(SCENEPICKINGPASS) + , out float outputDepth : SV_Depth + #endif + #if NEED_FACING + , bool facing : SV_IsFrontFace + #endif + ) + { + UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX(v2f); + FragInputs input = BuildFragInputs(v2f); + + // input.positionSS is SV_Position + PositionInputs posInput = GetPositionInput(input.positionSS.xy, _ScreenSize.zw, input.positionSS.z, input.positionSS.w, input.positionRWS); + + + float3 V = GetWorldSpaceNormalizeViewDir(input.positionRWS); + + + SurfaceData surfaceData; + BuiltinData builtinData; + Surface l; + ShaderData d; + GetSurfaceAndBuiltinData(v2f, input, V, posInput, surfaceData, builtinData, l, d + #if NEED_FACING + , facing + #endif + ); + + + #ifdef _DEPTHOFFSET_ON + outputDepth = l.outputDepth; + #endif + + #ifdef SCENESELECTIONPASS + // We use depth prepass for scene selection in the editor, this code allow to output the outline correctly + outColor = float4(_ObjectId, _PassValue, 1.0, 1.0); + #elif defined(SCENEPICKINGPASS) + outColor = _SelectionID; + #else + #ifdef WRITE_MSAA_DEPTH + // In case we are rendering in MSAA, reading the an MSAA depth buffer is way too expensive. To avoid that, we export the depth to a color buffer + depthColor = v2f.pos.z; + + #ifdef _ALPHATOMASK_ON + // Alpha channel is used for alpha to coverage + depthColor.a = SharpenAlpha(builtinData.opacity, builtinData.alphaClipTreshold); + #endif // alphatomask + #endif // msaa_depth + #endif + + #if defined(WRITE_NORMAL_BUFFER) + EncodeIntoNormalBuffer(ConvertSurfaceDataToNormalData(surfaceData), outNormalBuffer); + #endif + + #if defined(WRITE_DECAL_BUFFER) && !defined(_DISABLE_DECALS) + DecalPrepassData decalPrepassData; + // We don't have the right to access SurfaceData in a shaderpass. + // However it would be painful to have to add a function like ConvertSurfaceDataToDecalPrepassData() to every Material to return geomNormalWS anyway + // Here we will put the constrain that any Material requiring to support Decal, will need to have geomNormalWS as member of surfaceData (and we already require normalWS anyway) + decalPrepassData.geomNormalWS = surfaceData.geomNormalWS; + decalPrepassData.decalLayerMask = GetMeshRenderingDecalLayer(); + EncodeIntoDecalPrepassBuffer(decalPrepassData, outDecalBuffer); + #endif + + + } + + + + + ENDHLSL + } + + Pass + { + // based on HDLitPass.template + Name "DepthOnly" + Tags { "LightMode" = "DepthOnly" } + + //------------------------------------------------------------------------------------- + // Render Modes (Blend, Cull, ZTest, Stencil, etc) + //------------------------------------------------------------------------------------- + + Cull Back + + + ZWrite On + + + // Stencil setup + Stencil + { + WriteMask [_StencilWriteMaskDepth] + Ref [_StencilRefDepth] + CompFront Always + PassFront Replace + CompBack Always + PassBack Replace + } + AlphaToMask [_AlphaCutoffEnable] + Tags { "RenderType" = "Opaque" "Queue" = "Geometry" "PreviewType" = "Plane" } + Cull [_CullingOption] + ZWrite [_ZWrite] + ZTest [_ZTestMode] + + + //------------------------------------------------------------------------------------- + // End Render Modes + //------------------------------------------------------------------------------------- + + HLSLPROGRAM + + #pragma target 4.5 + #pragma only_renderers d3d11 playstation xboxone xboxseries vulkan metal switch + //#pragma enable_d3d11_debug_symbols + + #pragma multi_compile_instancing + #pragma instancing_options renderinglayer + #pragma multi_compile _ DOTS_INSTANCING_ON + #pragma multi_compile _ LOD_FADE_CROSSFADE + + //#pragma shader_feature _ _SURFACE_TYPE_TRANSPARENT + //#pragma shader_feature_local _BLENDMODE_OFF _BLENDMODE_ALPHA _BLENDMODE_ADD _BLENDMODE_PRE_MULTIPLY + //#pragma shader_feature_local _ _ADD_PRECOMPUTED_VELOCITY + //#pragma shader_feature_local _ _TRANSPARENT_WRITES_MOTION_VEC + //#pragma shader_feature_local _ _ENABLE_FOG_ON_TRANSPARENT + //#pragma shader_feature_local _ _DISABLE_DECALS + //#pragma shader_feature_local _ _DISABLE_SSR + //#pragma shader_feature_local _ _DISABLE_SSR_TRANSPARENT + //#pragma shader_feature_local _REFRACTION_OFF _REFRACTION_PLANE _REFRACTION_SPHERE _REFRACTION_THIN + #pragma multi_compile _ WRITE_DECAL_BUFFER + //------------------------------------------------------------------------------------- + // Variant Definitions (active field translations to HDRP defines) + //------------------------------------------------------------------------------------- + // #define _MATERIAL_FEATURE_SUBSURFACE_SCATTERING 1 + // #define _MATERIAL_FEATURE_TRANSMISSION 1 + // #define _MATERIAL_FEATURE_ANISOTROPY 1 + // #define _MATERIAL_FEATURE_IRIDESCENCE 1 + // #define _MATERIAL_FEATURE_SPECULAR_COLOR 1 + #define _ENABLE_FOG_ON_TRANSPARENT 1 + // #define _AMBIENT_OCCLUSION 1 + // #define _SPECULAR_OCCLUSION_FROM_AO 1 + // #define _SPECULAR_OCCLUSION_FROM_AO_BENT_NORMAL 1 + // #define _SPECULAR_OCCLUSION_CUSTOM 1 + // #define _ENERGY_CONSERVING_SPECULAR 1 + // #define _ENABLE_GEOMETRIC_SPECULAR_AA 1 + // #define _HAS_REFRACTION 1 + // #define _REFRACTION_PLANE 1 + // #define _REFRACTION_SPHERE 1 + // #define _DISABLE_DECALS 1 + // #define _DISABLE_SSR 1 + // #define _ADD_PRECOMPUTED_VELOCITY + // #define _WRITE_TRANSPARENT_MOTION_VECTOR 1 + // #define _DEPTHOFFSET_ON 1 + // #define _BLENDMODE_PRESERVE_SPECULAR_LIGHTING 1 + + #define SHADERPASS SHADERPASS_DEPTH_ONLY + #pragma multi_compile _ WRITE_NORMAL_BUFFER + #pragma multi_compile _ WRITE_MSAA_DEPTH + #define _PASSDEPTH 1 + + + + #pragma shader_feature_local GLOW_ON + #pragma shader_feature_local FADE_ON + #pragma shader_feature_local OUTBASE_ON + #pragma shader_feature_local ONLYOUTLINE_ON + #pragma shader_feature_local GRADIENT_ON + #pragma shader_feature_local GRADIENT2COL_ON + #pragma shader_feature_local RADIALGRADIENT_ON + #pragma shader_feature_local COLORSWAP_ON + #pragma shader_feature_local HSV_ON + #pragma shader_feature_local CHANGECOLOR_ON + #pragma shader_feature_local CHANGECOLOR2_ON + #pragma shader_feature_local CHANGECOLOR3_ON + #pragma shader_feature_local COLORRAMP_ON + #pragma shader_feature_local GRADIENTCOLORRAMP_ON + #pragma shader_feature_local HITEFFECT_ON + #pragma shader_feature_local NEGATIVE_ON + #pragma shader_feature_local PIXELATE_ON + #pragma shader_feature_local GREYSCALE_ON + #pragma shader_feature_local POSTERIZE_ON + #pragma shader_feature_local BLUR_ON + #pragma shader_feature_local MOTIONBLUR_ON + #pragma shader_feature_local GHOST_ON + #pragma shader_feature_local ALPHAOUTLINE_ON + #pragma shader_feature_local INNEROUTLINE_ON + #pragma shader_feature_local ONLYINNEROUTLINE_ON + #pragma shader_feature_local HOLOGRAM_ON + #pragma shader_feature_local CHROMABERR_ON + #pragma shader_feature_local GLITCH_ON + #pragma shader_feature_local FLICKER_ON + #pragma shader_feature_local SHADOW_ON + #pragma shader_feature_local SHINE_ON + #pragma shader_feature_local CONTRAST_ON + #pragma shader_feature_local OVERLAY_ON + #pragma shader_feature_local OVERLAYMULT_ON + #pragma shader_feature_local DOODLE_ON + #pragma shader_feature_local WIND_ON + #pragma shader_feature_local WAVEUV_ON + #pragma shader_feature_local ROUNDWAVEUV_ON + #pragma shader_feature_local RECTSIZE_ON + #pragma shader_feature_local OFFSETUV_ON + #pragma shader_feature_local CLIPPING_ON + #pragma shader_feature_local RADIALCLIPPING_ON + #pragma shader_feature_local TEXTURESCROLL_ON + #pragma shader_feature_local ZOOMUV_ON + #pragma shader_feature_local DISTORT_ON + #pragma shader_feature_local WARP_ON + #pragma shader_feature_local TWISTUV_ON + #pragma shader_feature_local ROTATEUV_ON + #pragma shader_feature_local POLARUV_ON + #pragma shader_feature_local FISHEYE_ON + #pragma shader_feature_local PINCH_ON + #pragma shader_feature_local SHAKEUV_ON + + #pragma shader_feature_local GLOWTEX_ON + #pragma shader_feature_local OUTTEX_ON + #pragma shader_feature_local OUTDIST_ON + #pragma shader_feature_local OUTBASE8DIR_ON + #pragma shader_feature_local OUTBASEPIXELPERF_ON + #pragma shader_feature_local COLORRAMPOUTLINE_ON + #pragma shader_feature_local GREYSCALEOUTLINE_ON + #pragma shader_feature_local POSTERIZEOUTLINE_ON + #pragma shader_feature_local BLURISHD_ON + #pragma shader_feature_local MANUALWIND_ON + #pragma shader_feature_local ATLAS_ON + #pragma shader_feature_local PREMULTIPLYALPHA_ON + + #pragma shader_feature BILBOARD_ON + #pragma shader_feature BILBOARDY_ON + + #pragma shader_feature NORMALMAP_ON + + + #define _HDRP 1 +#define _USINGTEXCOORD1 1 +#define _USINGTEXCOORD2 1 + + + #pragma vertex Vert + #pragma fragment Frag + + + + // useful conversion functions to make surface shader code just work + + #define UNITY_DECLARE_TEX2D(name) TEXTURE2D(name); SAMPLER(sampler##name); + #define UNITY_DECLARE_TEX2D_NOSAMPLER(name) TEXTURE2D(name); + #define UNITY_DECLARE_TEX2DARRAY(name) TEXTURE2D_ARRAY(name); SAMPLER(sampler##name); + #define UNITY_DECLARE_TEX2DARRAY_NOSAMPLER(tex) TEXTURE2D_ARRAY(tex); + + #define UNITY_SAMPLE_TEX2DARRAY(tex,coord) SAMPLE_TEXTURE2D_ARRAY(tex, sampler##tex, coord.xy, coord.z) + #define UNITY_SAMPLE_TEX2DARRAY_LOD(tex,coord,lod) SAMPLE_TEXTURE2D_ARRAY_LOD(tex, sampler##tex, coord.xy, coord.z, lod) + #define UNITY_SAMPLE_TEX2D(tex, coord) SAMPLE_TEXTURE2D(tex, sampler##tex, coord) + #define UNITY_SAMPLE_TEX2D_SAMPLER(tex, samp, coord) SAMPLE_TEXTURE2D(tex, sampler##samp, coord) + + #define UNITY_SAMPLE_TEX2D_LOD(tex,coord, lod) SAMPLE_TEXTURE2D_LOD(tex, sampler_##tex, coord, lod) + #define UNITY_SAMPLE_TEX2D_SAMPLER_LOD(tex,samplertex,coord, lod) SAMPLE_TEXTURE2D_LOD (tex, sampler##samplertex,coord, lod) + + #if defined(UNITY_COMPILER_HLSL) + #define UNITY_INITIALIZE_OUTPUT(type,name) name = (type)0; + #else + #define UNITY_INITIALIZE_OUTPUT(type,name) + #endif + + #define sampler2D_float sampler2D + #define sampler2D_half sampler2D + + #undef WorldNormalVector + #define WorldNormalVector(data, normal) mul(normal, data.TBNMatrix) + + #define UnityObjectToWorldNormal(normal) mul(GetObjectToWorldMatrix(), normal) + + #ifndef SHADER_STAGE_FRAGMENT + #if !defined(SHADOW_ULTRA_LOW) && !defined(SHADOW_LOW) && !defined(SHADOW_MEDIUM) && !defined(SHADOW_HIGH) // ultra low come from volumetricLighting.compute + #define SHADOW_MEDIUM + #endif + #if !defined(AREA_SHADOW_LOW) && !defined(AREA_SHADOW_MEDIUM) && !defined(AREA_SHADOW_HIGH) // low come from volumetricLighting.compute + #define AREA_SHADOW_MEDIUM + #endif + #endif + + + +// HDRP Adapter stuff + #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Common.hlsl" + #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Texture.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/ShaderVariables.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/ShaderPass/FragInputs.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/ShaderPass/ShaderPass.cs.hlsl" + #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/TextureStack.hlsl" // Required to be include before we include properties as it define DECLARE_STACK_CB + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/NormalBuffer.hlsl" + +#if UNITY_VERSION >= 202239 + #include "Packages/com.unity.shadergraph/ShaderGraphLibrary/Functions.hlsl" // Need to be here for Gradient struct definition +#else + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/ShaderGraphHeader.hlsl" +#endif + #ifdef RAYTRACING_SHADER_GRAPH_DEFAULT + #define RAYTRACING_SHADER_GRAPH_HIGH + #endif + + #ifdef RAYTRACING_SHADER_GRAPH_RAYTRACED + #define RAYTRACING_SHADER_GRAPH_LOW + #endif + // end + + + + + // If we use subsurface scattering, enable output split lighting (for forward pass) + #if defined(_MATERIAL_FEATURE_SUBSURFACE_SCATTERING) && !defined(_SURFACE_TYPE_TRANSPARENT) + #define OUTPUT_SPLIT_LIGHTING + #endif + + #define HAVE_RECURSIVE_RENDERING + + #if SHADERPASS == SHADERPASS_TRANSPARENT_DEPTH_PREPASS + #if !defined(_DISABLE_SSR_TRANSPARENT) && !defined(SHADER_UNLIT) + #define WRITE_NORMAL_BUFFER + #endif + #endif + + #ifndef DEBUG_DISPLAY + // In case of opaque we don't want to perform the alpha test, it is done in depth prepass and we use depth equal for ztest (setup from UI) + // Don't do it with debug display mode as it is possible there is no depth prepass in this case + #if !defined(_SURFACE_TYPE_TRANSPARENT) && defined(_ALPHATEST) + #if SHADERPASS == SHADERPASS_FORWARD + #define SHADERPASS_FORWARD_BYPASS_ALPHA_TEST + #elif SHADERPASS == SHADERPASS_GBUFFER + #define SHADERPASS_GBUFFER_BYPASS_ALPHA_TEST + #endif + #endif + #endif + + // Define _DEFERRED_CAPABLE_MATERIAL for shader capable to run in deferred pass + #if defined(SHADER_LIT) && !defined(_SURFACE_TYPE_TRANSPARENT) + #define _DEFERRED_CAPABLE_MATERIAL + #endif + + // Translate transparent motion vector define + #if defined(_TRANSPARENT_WRITES_MOTION_VEC) && defined(_SURFACE_TYPE_TRANSPARENT) + #define _WRITE_TRANSPARENT_MOTION_VECTOR + #endif + + + + + CBUFFER_START(UnityPerMaterial) + float _UseShadowThreshold; + float _BlendMode; + float _EnableBlendModePreserveSpecularLighting; + float _RayTracing; + float _RefractionModel; + + + half4 _Color; + half4 _MainTex_ST, _MainTex_TexelSize; + half _Alpha, _AlphaCutoffValue; + + #if ATLAS_ON + half _MinXUV, _MaxXUV, _MinYUV, _MaxYUV; + #endif + + #if GLOW_ON + half4 _GlowColor; + half _Glow, _GlowGlobal; + #endif + + #if HSV_ON + half _HsvShift, _HsvSaturation, _HsvBright; + #endif + + #if DISTORT_ON + half4 _DistortTex_ST; + half _DistortTexXSpeed, _DistortTexYSpeed, _DistortAmount; + #endif + + #if FADE_ON + half4 _FadeBurnColor, _FadeTex_ST, _FadeBurnTex_ST; + half _FadeAmount, _FadeBurnWidth, _FadeBurnTransition,_FadeBurnGlow; + #endif + + #if OUTBASE_ON + half4 _OutlineColor; + half _OutlineAlpha, _OutlineGlow, _OutlineWidth; + int _OutlinePixelWidth; + #endif + + #if OUTTEX_ON + half4 _OutlineTex_ST; + half _OutlineTexXSpeed, _OutlineTexYSpeed; + #endif + + #if OUTDIST_ON + half4 _OutlineDistortTex_ST; + half _OutlineDistortTexXSpeed, _OutlineDistortTexYSpeed, _OutlineDistortAmount; + #endif + + #if ALPHAOUTLINE_ON + half _AlphaOutlineGlow, _AlphaOutlinePower, _AlphaOutlineMinAlpha, _AlphaOutlineBlend; + half4 _AlphaOutlineColor; + #endif + + #if INNEROUTLINE_ON + half _InnerOutlineThickness, _InnerOutlineAlpha, _InnerOutlineGlow; + half4 _InnerOutlineColor; + #endif + + #if GRADIENT_ON + half _GradBlend, _GradBoostX, _GradBoostY; + half4 _GradTopRightCol, _GradTopLeftCol, _GradBotRightCol, _GradBotLeftCol; + #endif + + #if COLORSWAP_ON + half4 _ColorSwapRed, _ColorSwapGreen, _ColorSwapBlue; + half _ColorSwapRedLuminosity, _ColorSwapGreenLuminosity, _ColorSwapBlueLuminosity, _ColorSwapBlend; + #endif + + #if CHANGECOLOR_ON + half4 _ColorChangeNewCol, _ColorChangeTarget; + half _ColorChangeTolerance, _ColorChangeLuminosity; + #endif + #if CHANGECOLOR2_ON + half4 _ColorChangeNewCol2, _ColorChangeTarget2; + half _ColorChangeTolerance2; + #endif + #if CHANGECOLOR3_ON + half4 _ColorChangeNewCol3, _ColorChangeTarget3; + half _ColorChangeTolerance3; + #endif + + #if COLORRAMP_ON + half _ColorRampLuminosity, _ColorRampBlend; + #endif + + #if HITEFFECT_ON + half4 _HitEffectColor; + half _HitEffectGlow, _HitEffectBlend; + #endif + + #if NEGATIVE_ON + half _NegativeAmount; + #endif + + #if PIXELATE_ON + half _PixelateSize; + #endif + + #if GREYSCALE_ON + half _GreyscaleLuminosity, _GreyscaleBlend; + half4 _GreyscaleTintColor; + #endif + + #if POSTERIZE_ON + half _PosterizeNumColors, _PosterizeGamma; + #endif + + #if BLUR_ON + half _BlurIntensity; + #endif + + #if MOTIONBLUR_ON + half _MotionBlurAngle, _MotionBlurDist; + #endif + + #if GHOST_ON + half _GhostColorBoost, _GhostTransparency, _GhostBlend; + #endif + + #if HOLOGRAM_ON + half _HologramStripesAmount, _HologramMinAlpha, _HologramUnmodAmount, _HologramStripesSpeed, _HologramMaxAlpha, _HologramBlend; + half4 _HologramStripeColor; + #endif + + #if CHROMABERR_ON + half _ChromAberrAmount, _ChromAberrAlpha; + #endif + + #if GLITCH_ON + half _GlitchAmount, _GlitchSize; + #endif + + #if FLICKER_ON + half _FlickerFreq, _FlickerPercent, _FlickerAlpha; + #endif + + #if SHADOW_ON + half _ShadowX, _ShadowY, _ShadowAlpha; + half4 _ShadowColor; + #endif + + #if SHINE_ON + half4 _ShineColor; + half _ShineLocation, _ShineRotate, _ShineWidth, _ShineGlow; + #endif + + #if CONTRAST_ON + half _Contrast, _Brightness; + #endif + + #if OVERLAY_ON + half4 _OverlayTex_ST, _OverlayColor; + half _OverlayGlow, _OverlayBlend, _OverlayTextureScrollXSpeed, _OverlayTextureScrollYSpeed; + #endif + + #if DOODLE_ON + half _HandDrawnAmount, _HandDrawnSpeed; + #endif + + #if WIND_ON + half _GrassSpeed, _GrassWind, _GrassManualAnim, _GrassRadialBend; + #endif + + #if WAVEUV_ON + float _WaveAmount, _WaveSpeed, _WaveStrength, _WaveX, _WaveY; + #endif + + #if ROUNDWAVEUV_ON + half _RoundWaveStrength, _RoundWaveSpeed; + #endif + + #if RECTSIZE_ON + half _RectSize; + #endif + + #if OFFSETUV_ON + half _OffsetUvX, _OffsetUvY; + #endif + + #if CLIPPING_ON + half _ClipUvLeft, _ClipUvRight, _ClipUvUp, _ClipUvDown; + #endif + + #if RADIALCLIPPING_ON + half _RadialStartAngle, _RadialClip, _RadialClip2; + #endif + + #if TEXTURESCROLL_ON + half _TextureScrollXSpeed, _TextureScrollYSpeed; + #endif + + #if ZOOMUV_ON + half _ZoomUvAmount; + #endif + + #if WARP_ON + half _WarpStrength, _WarpSpeed, _WarpScale; + #endif + + #if TWISTUV_ON + half _TwistUvAmount, _TwistUvPosX, _TwistUvPosY, _TwistUvRadius; + #endif + + #if ROTATEUV_ON + half _RotateUvAmount; + #endif + + #if FISHEYE_ON + half _FishEyeUvAmount; + #endif + + #if PINCH_ON + half _PinchUvAmount; + #endif + + #if SHAKEUV_ON + half _ShakeUvSpeed, _ShakeUvX, _ShakeUvY; + #endif + + #if NORMALMAP_ON + half _NormalStrength; + #endif + + float _RandomSeed; + + + + + CBUFFER_END + + + + // -- Property used by ScenePickingPass + #ifdef SCENEPICKINGPASS + float4 _SelectionID; + #endif + + // -- Properties used by SceneSelectionPass + #ifdef SCENESELECTIONPASS + int _ObjectId; + int _PassValue; + #endif + + + // data across stages, stripped like the above. + struct VertexToPixel + { + float4 pos : SV_POSITION; + float3 worldPos : TEXCOORD0; + float3 worldNormal : TEXCOORD1; + float4 worldTangent : TEXCOORD2; + float4 texcoord0 : TEXCOORD3; + float4 texcoord1 : TEXCOORD4; + float4 texcoord2 : TEXCOORD5; + // #if %TEXCOORD3REQUIREKEY% + float4 texcoord3 : TEXCOORD6; + // #endif + + // #if %SCREENPOSREQUIREKEY% + // float4 screenPos : TEXCOORD7; + // #endif + + // #if %VERTEXCOLORREQUIREKEY% + float4 vertexColor : COLOR; + // #endif + + // #if %EXTRAV2F0REQUIREKEY% + // float4 extraV2F0 : TEXCOORD8; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // float4 extraV2F1 : TEXCOORD9; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // float4 extraV2F2 : TEXCOORD10; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // float4 extraV2F3 : TEXCOORD11; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // float4 extraV2F4 : TEXCOORD12; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // float4 extraV2F5 : TEXCOORD13; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // float4 extraV2F6 : TEXCOORD14; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // float4 extraV2F7 : TEXCOORD15; + // #endif + + #if UNITY_ANY_INSTANCING_ENABLED + UNITY_VERTEX_INPUT_INSTANCE_ID + #endif // UNITY_ANY_INSTANCING_ENABLED + + #if _HDRP && (_PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR))) + float4 previousPositionCS : TEXCOORD16; // Contain previous transform position (in case of skinning for example) + float4 motionVectorCS : TEXCOORD17; + #endif + + UNITY_VERTEX_OUTPUT_STEREO + }; + + + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Debug/DebugDisplay.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/Material.hlsl" + #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/NormalSurfaceGradient.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/Lit/Lit.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/BuiltinUtilities.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/MaterialUtilities.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/Decal/DecalUtilities.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/Lit/LitDecalData.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/ShaderGraphFunctions.hlsl" + + + + + // data describing the user output of a pixel + struct Surface + { + half3 Albedo; + half Height; + half3 Normal; + half Smoothness; + half3 Emission; + half Metallic; + half3 Specular; + half Occlusion; + half SpecularPower; // for simple lighting + half Alpha; + float outputDepth; // if written, SV_Depth semantic is used. ShaderData.clipPos.z is unused value + // HDRP Only + half SpecularOcclusion; + half SubsurfaceMask; + half Thickness; + half CoatMask; + half CoatSmoothness; + half Anisotropy; + half IridescenceMask; + half IridescenceThickness; + int DiffusionProfileHash; + float SpecularAAThreshold; + float SpecularAAScreenSpaceVariance; + // requires _OVERRIDE_BAKEDGI to be defined, but is mapped in all pipelines + float3 DiffuseGI; + float3 BackDiffuseGI; + float3 SpecularGI; + float ior; + float3 transmittanceColor; + float atDistance; + float transmittanceMask; + // requires _OVERRIDE_SHADOWMASK to be defines + float4 ShadowMask; + + // for decals + float NormalAlpha; + float MAOSAlpha; + + + }; + + // Data the user declares in blackboard blocks + struct Blackboard + { + + float blackboardDummyData; + }; + + // data the user might need, this will grow to be big. But easy to strip + struct ShaderData + { + float4 clipPos; // SV_POSITION + float3 localSpacePosition; + float3 localSpaceNormal; + float3 localSpaceTangent; + + float3 worldSpacePosition; + float3 worldSpaceNormal; + float3 worldSpaceTangent; + float tangentSign; + + float3 worldSpaceViewDir; + float3 tangentSpaceViewDir; + + float4 texcoord0; + float4 texcoord1; + float4 texcoord2; + float4 texcoord3; + + float2 screenUV; + float4 screenPos; + + float4 vertexColor; + bool isFrontFace; + + float4 extraV2F0; + float4 extraV2F1; + float4 extraV2F2; + float4 extraV2F3; + float4 extraV2F4; + float4 extraV2F5; + float4 extraV2F6; + float4 extraV2F7; + + float3x3 TBNMatrix; + Blackboard blackboard; + }; + + struct VertexData + { + #if SHADER_TARGET > 30 + // uint vertexID : SV_VertexID; + #endif + float4 vertex : POSITION; + float3 normal : NORMAL; + float4 tangent : TANGENT; + float4 texcoord0 : TEXCOORD0; + + // optimize out mesh coords when not in use by user or lighting system + #if _URP && (_USINGTEXCOORD1 || _PASSMETA || _PASSFORWARD || _PASSGBUFFER) + float4 texcoord1 : TEXCOORD1; + #endif + + #if _URP && (_USINGTEXCOORD2 || _PASSMETA || ((_PASSFORWARD || _PASSGBUFFER) && defined(DYNAMICLIGHTMAP_ON))) + float4 texcoord2 : TEXCOORD2; + #endif + + #if _STANDARD && (_USINGTEXCOORD1 || (_PASSMETA || ((_PASSFORWARD || _PASSGBUFFER || _PASSFORWARDADD) && LIGHTMAP_ON))) + float4 texcoord1 : TEXCOORD1; + #endif + #if _STANDARD && (_USINGTEXCOORD2 || (_PASSMETA || ((_PASSFORWARD || _PASSGBUFFER) && DYNAMICLIGHTMAP_ON))) + float4 texcoord2 : TEXCOORD2; + #endif + + + #if _HDRP + float4 texcoord1 : TEXCOORD1; + float4 texcoord2 : TEXCOORD2; + #endif + + // #if %TEXCOORD3REQUIREKEY% + float4 texcoord3 : TEXCOORD3; + // #endif + + // #if %VERTEXCOLORREQUIREKEY% + float4 vertexColor : COLOR; + // #endif + + #if _PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR)) + float3 previousPositionOS : TEXCOORD4; // Contain previous transform position (in case of skinning for example) + #if defined (_ADD_PRECOMPUTED_VELOCITY) + float3 precomputedVelocity : TEXCOORD5; // Add Precomputed Velocity (Alembic computes velocities on runtime side). + #endif + #endif + + UNITY_VERTEX_INPUT_INSTANCE_ID + }; + + struct TessVertex + { + float4 vertex : INTERNALTESSPOS; + float3 normal : NORMAL; + float4 tangent : TANGENT; + float4 texcoord0 : TEXCOORD0; + float4 texcoord1 : TEXCOORD1; + float4 texcoord2 : TEXCOORD2; + + // #if %TEXCOORD3REQUIREKEY% + float4 texcoord3 : TEXCOORD3; + // #endif + + // #if %VERTEXCOLORREQUIREKEY% + float4 vertexColor : COLOR; + // #endif + + // #if %EXTRAV2F0REQUIREKEY% + // float4 extraV2F0 : TEXCOORD5; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // float4 extraV2F1 : TEXCOORD6; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // float4 extraV2F2 : TEXCOORD7; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // float4 extraV2F3 : TEXCOORD8; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // float4 extraV2F4 : TEXCOORD9; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // float4 extraV2F5 : TEXCOORD10; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // float4 extraV2F6 : TEXCOORD11; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // float4 extraV2F7 : TEXCOORD12; + // #endif + + #if _PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR)) + float3 previousPositionOS : TEXCOORD13; // Contain previous transform position (in case of skinning for example) + #if defined (_ADD_PRECOMPUTED_VELOCITY) + float3 precomputedVelocity : TEXCOORD14; + #endif + #endif + + UNITY_VERTEX_INPUT_INSTANCE_ID + UNITY_VERTEX_OUTPUT_STEREO + }; + + struct ExtraV2F + { + float4 extraV2F0; + float4 extraV2F1; + float4 extraV2F2; + float4 extraV2F3; + float4 extraV2F4; + float4 extraV2F5; + float4 extraV2F6; + float4 extraV2F7; + Blackboard blackboard; + float4 time; + }; + + + float3 WorldToTangentSpace(ShaderData d, float3 normal) + { + return mul(d.TBNMatrix, normal); + } + + float3 TangentToWorldSpace(ShaderData d, float3 normal) + { + return mul(normal, d.TBNMatrix); + } + + // in this case, make standard more like SRPs, because we can't fix + // unity_WorldToObject in HDRP, since it already does macro-fu there + + #if _STANDARD + float3 TransformWorldToObject(float3 p) { return mul(unity_WorldToObject, float4(p, 1)); }; + float3 TransformObjectToWorld(float3 p) { return mul(unity_ObjectToWorld, float4(p, 1)); }; + float4 TransformWorldToObject(float4 p) { return mul(unity_WorldToObject, p); }; + float4 TransformObjectToWorld(float4 p) { return mul(unity_ObjectToWorld, p); }; + float4x4 GetWorldToObjectMatrix() { return unity_WorldToObject; } + float4x4 GetObjectToWorldMatrix() { return unity_ObjectToWorld; } + #if (defined(SHADER_API_D3D11) || defined(SHADER_API_XBOXONE) || defined(UNITY_COMPILER_HLSLCC) || defined(SHADER_API_PSSL) || (SHADER_TARGET_SURFACE_ANALYSIS && !SHADER_TARGET_SURFACE_ANALYSIS_MOJOSHADER)) + #define UNITY_SAMPLE_TEX2D_LOD(tex,coord, lod) tex.SampleLevel (sampler##tex,coord, lod) + #define UNITY_SAMPLE_TEX2D_SAMPLER_LOD(tex,samplertex,coord, lod) tex.SampleLevel (sampler##samplertex,coord, lod) + #else + #define UNITY_SAMPLE_TEX2D_LOD(tex,coord,lod) tex2D (tex,coord,0,lod) + #define UNITY_SAMPLE_TEX2D_SAMPLER_LOD(tex,samplertex,coord,lod) tex2D (tex,coord,0,lod) + #endif + + #undef GetWorldToObjectMatrix() + + #define GetWorldToObjectMatrix() unity_WorldToObject + + + #endif + + float3 GetCameraWorldPosition() + { + #if _HDRP + return GetCameraRelativePositionWS(_WorldSpaceCameraPos); + #else + return _WorldSpaceCameraPos; + #endif + } + + #if _GRABPASSUSED + #if _STANDARD + TEXTURE2D(%GRABTEXTURE%); + SAMPLER(sampler_%GRABTEXTURE%); + #endif + + half3 GetSceneColor(float2 uv) + { + #if _STANDARD + return SAMPLE_TEXTURE2D(%GRABTEXTURE%, sampler_%GRABTEXTURE%, uv).rgb; + #else + return SHADERGRAPH_SAMPLE_SCENE_COLOR(uv); + #endif + } + #endif + + + + #if _STANDARD + UNITY_DECLARE_DEPTH_TEXTURE(_CameraDepthTexture); + float GetSceneDepth(float2 uv) { return SAMPLE_DEPTH_TEXTURE(_CameraDepthTexture, uv); } + float GetLinear01Depth(float2 uv) { return Linear01Depth(GetSceneDepth(uv)); } + float GetLinearEyeDepth(float2 uv) { return LinearEyeDepth(GetSceneDepth(uv)); } + #else + float GetSceneDepth(float2 uv) { return SHADERGRAPH_SAMPLE_SCENE_DEPTH(uv); } + float GetLinear01Depth(float2 uv) { return Linear01Depth(GetSceneDepth(uv), _ZBufferParams); } + float GetLinearEyeDepth(float2 uv) { return LinearEyeDepth(GetSceneDepth(uv), _ZBufferParams); } + #endif + + float3 GetWorldPositionFromDepthBuffer(float2 uv, float3 worldSpaceViewDir) + { + float eye = GetLinearEyeDepth(uv); + float3 camView = mul((float3x3)GetObjectToWorldMatrix(), transpose(mul(GetWorldToObjectMatrix(), UNITY_MATRIX_I_V)) [2].xyz); + + float dt = dot(worldSpaceViewDir, camView); + float3 div = worldSpaceViewDir/dt; + float3 wpos = (eye * div) + GetCameraWorldPosition(); + return wpos; + } + + #if _HDRP + float3 ObjectToWorldSpacePosition(float3 pos) + { + return GetAbsolutePositionWS(TransformObjectToWorld(pos)); + } + #else + float3 ObjectToWorldSpacePosition(float3 pos) + { + return TransformObjectToWorld(pos); + } + #endif + + #if _STANDARD + UNITY_DECLARE_SCREENSPACE_TEXTURE(_CameraDepthNormalsTexture); + float3 GetSceneNormal(float2 uv, float3 worldSpaceViewDir) + { + float4 depthNorms = UNITY_SAMPLE_SCREENSPACE_TEXTURE(_CameraDepthNormalsTexture, uv); + float3 norms = DecodeViewNormalStereo(depthNorms); + norms = mul((float3x3)GetWorldToViewMatrix(), norms) * 0.5 + 0.5; + return norms; + } + #elif _HDRP && !_DECALSHADER + + float3 GetSceneNormal(float2 uv, float3 worldSpaceViewDir) + { + NormalData nd; + DecodeFromNormalBuffer(_ScreenSize.xy * uv, nd); + return nd.normalWS; + } + #elif _URP + #if (SHADER_LIBRARY_VERSION_MAJOR >= 10) + #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/DeclareNormalsTexture.hlsl" + #endif + + float3 GetSceneNormal(float2 uv, float3 worldSpaceViewDir) + { + #if (SHADER_LIBRARY_VERSION_MAJOR >= 10) + return SampleSceneNormals(uv); + #else + float3 wpos = GetWorldPositionFromDepthBuffer(uv, worldSpaceViewDir); + return normalize(-cross(ddx(wpos), ddy(wpos))) * 0.5 + 0.5; + #endif + + } + #endif + + #if _HDRP + + half3 UnpackNormalmapRGorAG(half4 packednormal) + { + // This do the trick + packednormal.x *= packednormal.w; + + half3 normal; + normal.xy = packednormal.xy * 2 - 1; + normal.z = sqrt(1 - saturate(dot(normal.xy, normal.xy))); + return normal; + } + half3 UnpackNormal(half4 packednormal) + { + #if defined(UNITY_NO_DXT5nm) + return packednormal.xyz * 2 - 1; + #else + return UnpackNormalmapRGorAG(packednormal); + #endif + } + #endif + #if _HDRP || _URP + + half3 UnpackScaleNormal(half4 packednormal, half scale) + { + #ifndef UNITY_NO_DXT5nm + // Unpack normal as DXT5nm (1, y, 1, x) or BC5 (x, y, 0, 1) + // Note neutral texture like "bump" is (0, 0, 1, 1) to work with both plain RGB normal and DXT5nm/BC5 + packednormal.x *= packednormal.w; + #endif + half3 normal; + normal.xy = (packednormal.xy * 2 - 1) * scale; + normal.z = sqrt(1 - saturate(dot(normal.xy, normal.xy))); + return normal; + } + + #endif + + + void GetSun(out float3 lightDir, out float3 color) + { + lightDir = float3(0.5, 0.5, 0); + color = 1; + #if _HDRP + if (_DirectionalLightCount > 0) + { + DirectionalLightData light = _DirectionalLightDatas[0]; + lightDir = -light.forward.xyz; + color = light.color; + } + #elif _STANDARD + lightDir = normalize(_WorldSpaceLightPos0.xyz); + color = _LightColor0.rgb; + #elif _URP + Light light = GetMainLight(); + lightDir = light.direction; + color = light.color; + #endif + } + + + + + + + + + + TEXTURE2D(_MainTex); + SAMPLER(sampler_MainTex); + + #if GLOW_ON + TEXTURE2D(_GlowTex); + SAMPLER(sampler_GlowTex); + #endif + + #if FADE_ON + TEXTURE2D(_FadeTex); + SAMPLER(sampler_FadeTex); + + TEXTURE2D(_FadeBurnTex); + SAMPLER(sampler_FadeBurnTex); + #endif + + #if DISTORT_ON + TEXTURE2D(_DistortTex); + SAMPLER(sampler_DistortTex); + #endif + + #if OUTTEX_ON + TEXTURE2D(_OutlineTex); + SAMPLER(sampler_OutlineTex); + #endif + + #if OUTDIST_ON + TEXTURE2D(_OutlineDistortTex); + SAMPLER(sampler_OutlineDistortTex); + #endif + + #if COLORSWAP_ON + TEXTURE2D(_ColorSwapTex); + SAMPLER(sampler_ColorSwapTex); + #endif + + #if COLORRAMP_ON + TEXTURE2D(_ColorRampTex); + TEXTURE2D(_ColorRampTexGradient); + SAMPLER(sampler_ColorRampTex); + SAMPLER(sampler_ColorRampTexGradient); + #endif + + #if SHINE_ON + TEXTURE2D(_ShineMask); + SAMPLER(sampler_ShineMask); + #endif + + #if OVERLAY_ON + TEXTURE2D(_OverlayTex); + SAMPLER(sampler_OverlayTex); + #endif + + #if NORMALMAP_ON + TEXTURE2D(_NormalMap); + SAMPLER(sampler_NormalMap); + #endif + + + half3 GetPixel(in int offsetX, in int offsetY, in half2 uv, in Texture2D _tex, in SamplerState _sampler) + { + half2 _uv = uv + half2(offsetX * _MainTex_TexelSize.x, offsetY * _MainTex_TexelSize.y); + half4 col = SAMPLE_TEXTURE2D(_tex, _sampler, _uv); + return col.rgb; + } + + + //BLURS------------------------------------------------------------------------- + half4 Blur(half2 uv, Texture2D source, SamplerState sampler_source, half Intensity) + { + const half2 texelSize = 1.0 / _ScreenParams.xy; + const half4 color = SAMPLE_TEXTURE2D(source, sampler_source, uv); + const half2 offset = Intensity * texelSize; + + half4 accumulatedColor = color; + half accumulatedWeight = 1.0; + for (int x = -1; x <= 1; x++) + { + for (int y = -1; y <= 1; y++) + { + const half2 sampleUV = uv + half2(x, y) * offset; + const half4 sampleColor = SAMPLE_TEXTURE2D(source, sampler_source, sampleUV); + + accumulatedColor += sampleColor; + accumulatedWeight += 1.0; + } + } + + half4 blurredColor = accumulatedColor / accumulatedWeight; + return blurredColor; + } + + half BlurHD_G(half bhqp, half x) + { + return exp(-(x * x) / (2.0 * bhqp * bhqp)); + } + half4 BlurHD(half2 uv, Texture2D source, SamplerState sampler_source, half BlurAmount, half xScale, half yScale) + { + int iterations = 16; + int halfIterations = iterations / 2; + half sigmaX = 0.1 + BlurAmount * 0.5; + half sigmaY = sigmaX; + half total = 0.0; + half4 ret = half4(0, 0, 0, 0); + for (int iy = 0; iy < iterations; ++iy) + { + half fy = BlurHD_G(sigmaY, half(iy) -half(halfIterations)); + half offsetY = half(iy - halfIterations) * 0.00390625 * xScale; + for (int ix = 0; ix < iterations; ++ix) + { + half fx = BlurHD_G(sigmaX, half(ix) - half(halfIterations)); + half offsetX = half(ix - halfIterations) * 0.00390625 * yScale; + total += fx * fy; + ret += SAMPLE_TEXTURE2D(source, sampler_source, uv + half2(offsetX, offsetY)) * fx * fy; + } + } + return ret / total; + } + //----------------------------------------------------------------------- + + + //------------------------------------------- + half RemapFloat(half inValue, half inMin, half inMax, half outMin, half outMax){ + return outMin + (inValue - inMin) * (outMax - outMin) / (inMax - inMin); + } + //------------------------------------------- + + //----------------------------------------------------------------------- + half rand(half2 seed, half offset) { + return (frac(sin(dot(seed, half2(12.9898, 78.233))) * 43758.5453) + offset) % 1.0; + } + + half rand2(half2 seed, half offset) { + return (frac(sin(dot(seed * floor(50 + (_Time.x % 1.0) * 12.), half2(127.1, 311.7))) * 43758.5453123) + offset) % 1.0; + } + + half rand2CustomTime(half2 seed, half offset, half customTime) { + return (frac(sin(dot(seed * floor(50 + (customTime % 1.0) * 12.), half2(127.1, 311.7))) * 43758.5453123) + offset) % 1.0; + } + //----------------------------------------------------------------------- + + + void Ext_ModifyVertex0 (inout VertexData v, inout ExtraV2F d) + { + //BILBOARD_ON + #if BILBOARD_ON + half3 camRight = mul((half3x3)unity_CameraToWorld, half3(1,0,0)); + half3 camUp = half3(0,1,0); + #if BILBOARDY_ON + camUp = mul((half3x3)unity_CameraToWorld, half3(0,1,0)); + #endif + half3 localPos = v.vertex.x * camRight + v.vertex.y * camUp; + v.vertex = half4(localPos, 1); + #endif + //----------------------------------------------------------- + + v.texcoord0.xy = TRANSFORM_TEX(v.texcoord0.xy, _MainTex); + half2 center = half2(0.5, 0.5); + #if ATLAS_ON + center = half2((_MaxXUV + _MinXUV) / 2.0, (_MaxYUV + _MinYUV) / 2.0); + #endif + + //POLARUV_ON + #if POLARUV_ON + v.texcoord0.xy = v.texcoord0.xy - center; + #endif + + //---------------------------------------- + + //ROTATEUV_ON + #if ROTATEUV_ON + half2 uvC = v.texcoord0.xy; + half cosAngle = cos(_RotateUvAmount); + half sinAngle = sin(_RotateUvAmount); + half2x2 rot = half2x2(cosAngle, -sinAngle, sinAngle, cosAngle); + uvC -= center; + v.texcoord0.xy = mul(rot, uvC); + v.texcoord0.xy += center; + #endif + //-------------------- + + #if RECTSIZE_ON + v.vertex.xyz += (v.vertex.xyz * (_RectSize - 1.0)); + #endif + + #if OUTTEX_ON + v.texcoord1.xy = TRANSFORM_TEX(v.texcoord0.xy, _OutlineTex); + #endif + + #if OUTDIST_ON + v.texcoord2.xy = TRANSFORM_TEX(v.texcoord0.xy, _OutlineDistortTex); + #endif + + #if DISTORT_ON + v.texcoord3.xy = TRANSFORM_TEX(v.texcoord0.xy, _DistortTex); + #endif + } + + void Ext_SurfaceFunction0 (inout Surface o, ShaderData d) + { + half randomSeed = _RandomSeed; + + float2 uvRect = d.texcoord0; + half2 center = half2(0.5, 0.5); + #if ATLAS_ON + center = half2((_MaxXUV + _MinXUV) / 2.0, (_MaxYUV + _MinYUV) / 2.0); + uvRect = half2((d.texcoord0.x - _MinXUV) / (_MaxXUV - _MinXUV), (d.texcoord0.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half2 centerTiled = half2(center.x * _MainTex_ST.x, center.y * _MainTex_ST.y); + + //CLIPPING_ON + #if CLIPPING_ON + half2 tiledUv = half2(d.texcoord0.x / _MainTex_ST.x, d.texcoord0.y / _MainTex_ST.y); + #if ATLAS_ON + tiledUv = half2((tiledUv.x - _MinXUV) / (_MaxXUV - _MinXUV), (tiledUv.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + clip((1 - _ClipUvUp) - tiledUv.y); + clip(tiledUv.y - _ClipUvDown); + clip((1 - _ClipUvRight) - tiledUv.x); + clip(tiledUv.x - _ClipUvLeft); + #endif + //---------------------------------- + + //RADIALCLIPPING_ON + #if RADIALCLIPPING_ON + half2 tiledUv2 = half2(d.texcoord0.x / _MainTex_ST.x, d.texcoord0.y / _MainTex_ST.y); + #if ATLAS_ON + tiledUv2 = half2((tiledUv2.x - _MinXUV) / (_MaxXUV - _MinXUV), (tiledUv2.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half startAngle = _RadialStartAngle - _RadialClip; + half endAngle = _RadialStartAngle + _RadialClip2; + half offset0 = clamp(0, 360, startAngle + 360); + half offset360 = clamp(0, 360, endAngle - 360); + half2 atan2Coord = half2(lerp(-1, 1, tiledUv2.x), lerp(-1, 1, tiledUv2.y)); + half atanAngle = atan2(atan2Coord.y, atan2Coord.x) * 57.3; // angle in degrees + if(atanAngle < 0) atanAngle = 360 + atanAngle; + if(atanAngle >= startAngle && atanAngle <= endAngle) discard; + if(atanAngle <= offset360) discard; + if(atanAngle >= offset0) discard; + #endif + + //----------------------------- + + //TEXTURESCROLL_ON && ATLAS_ON + #if TEXTURESCROLL_ON && ATLAS_ON + d.texcoord0.xy = half2(_MinXUV + ((_MaxXUV - _MinXUV) * (abs(((_Time.y + randomSeed) * _TextureScrollXSpeed) + uvRect.x) % 1)), + _MinYUV + ((_MaxYUV - _MinYUV) * (abs(((_Time.y + randomSeed) * _TextureScrollYSpeed) + uvRect.y) % 1))); + #endif + //---------------------------- + + //OFFSETUV_ON + #if OFFSETUV_ON + #if ATLAS_ON + d.texcoord0.xy = half2(_MinXUV + ((_MaxXUV - _MinXUV) * (abs((_OffsetUvX + uvRect.x) % 1))), + _MinYUV + ((_MaxYUV - _MinYUV) * (abs(_OffsetUvY + uvRect.y) % 1))); + #else + d.texcoord0.xy += half2(_OffsetUvX, _OffsetUvY); + #endif + #endif + + //---------------------- + + //POLARUV_ON + #if POLARUV_ON + d.texcoord0.xy = half2(atan2(d.texcoord0.y, d.texcoord0.x) / (2.0f * 3.141592653589f), length(d.texcoord0.xy)); + d.texcoord0.xy *= _MainTex_ST.xy; + #endif + + //-------------------------------------- + + //TWISTUV_ON + #if TWISTUV_ON + #if ATLAS_ON + _TwistUvPosX = ((_MaxXUV - _MinXUV) * _TwistUvPosX) + _MinXUV; + _TwistUvPosY = ((_MaxYUV - _MinYUV) * _TwistUvPosY) + _MinYUV; + #endif + half2 tempUv = d.texcoord0.xy - half2(_TwistUvPosX * _MainTex_ST.x, _TwistUvPosY * _MainTex_ST.y); + _TwistUvRadius *= (_MainTex_ST.x + _MainTex_ST.y) / 2; + half percent = (_TwistUvRadius - length(tempUv)) / _TwistUvRadius; + half theta = percent * percent * (2.0 * sin(_TwistUvAmount)) * 8.0; + half s = sin(theta); + half c = cos(theta); + half beta = max(sign(_TwistUvRadius - length(tempUv)), 0.0); + tempUv = half2(dot(tempUv, half2(c, -s)), dot(tempUv, half2(s, c))) * beta + tempUv * (1 - beta); + tempUv += half2(_TwistUvPosX * _MainTex_ST.x, _TwistUvPosY * _MainTex_ST.y); + d.texcoord0.xy = tempUv; + #endif + + //-------------------------------------------- + + //FISHEYE_ON + #if FISHEYE_ON + half bind = length(centerTiled); + half2 dF = d.texcoord0.xy - centerTiled; + half dFlen = length(dF); + half fishInt = (3.14159265359 / bind) * (_FishEyeUvAmount + 0.001); + d.texcoord0.xy = centerTiled + (dF / (max(0.0001, dFlen))) * tan(dFlen * fishInt) * bind / tan(bind * fishInt); + #endif + //--------------------------------------------- + + //PINCH_ON + #if PINCH_ON + half2 dP = d.texcoord0.xy - centerTiled; + half pinchInt = (3.141592 / length(centerTiled)) * (-_PinchUvAmount + 0.001); + d.texcoord0.xy = centerTiled + normalize(dP) * atan(length(dP) * -pinchInt * 10.0) * 0.5 / atan(-pinchInt * 5); + #endif + + //--------------------------------------------- + + //ZOOMUV_ON + #if ZOOMUV_ON + d.texcoord0.xy -= centerTiled; + d.texcoord0.xy = d.texcoord0.xy * _ZoomUvAmount; + d.texcoord0.xy += centerTiled; + #endif + + //----------------------------------------------- + + //DOODLE_ON + #if DOODLE_ON + half2 uvCopy = uvRect; + _HandDrawnSpeed = (floor((_Time.x + randomSeed) * 20 * _HandDrawnSpeed) / _HandDrawnSpeed) * _HandDrawnSpeed; + uvCopy.x = sin((uvCopy.x * _HandDrawnAmount + _HandDrawnSpeed) * 4); + uvCopy.y = cos((uvCopy.y * _HandDrawnAmount + _HandDrawnSpeed) * 4); + d.texcoord0.xy = lerp(d.texcoord0.xy, d.texcoord0.xy + uvCopy, 0.0005 * _HandDrawnAmount); + #endif + + //-------------------------- + + //SHAKEUV_ON + #if SHAKEUV_ON + half xShake = sin((_Time.x + randomSeed) * _ShakeUvSpeed * 50) * _ShakeUvX; + half yShake = cos((_Time.x + randomSeed) * _ShakeUvSpeed * 50) * _ShakeUvY; + d.texcoord0.xy += half2(xShake * 0.012, yShake * 0.01); + #endif + + //------------------------------------------- + + //RECTSIZE_ON + #if RECTSIZE_ON + d.texcoord0.xy = d.texcoord0.xy * (_RectSize).xx + (((-_RectSize * 0.5) + 0.5)).xx; + #endif + + //------------------------------------------- + + //DISTORT_ON + #if DISTORT_ON + #if ATLAS_ON + d.texcoord3.x = d.texcoord3.x * (1 / (_MaxXUV - _MinXUV)); + d.texcoord3.y = d.texcoord3.y * (1 / (_MaxYUV - _MinYUV)); + #endif + + d.texcoord3.x += ((_Time.x + _RandomSeed) * _DistortTexXSpeed) % 1; + d.texcoord3.y += ((_Time.x + _RandomSeed) * _DistortTexYSpeed) % 1; + half distortAmnt = (SAMPLE_TEXTURE2D(_DistortTex, sampler_DistortTex, d.texcoord3.xy).r - 0.5) * 0.2 * _DistortAmount; + d.texcoord0.x += distortAmnt; + d.texcoord0.y += distortAmnt; + #endif + //------------------------------------------------------- + + //WARP_ON + #if WARP_ON + half2 warpUv = half2(d.texcoord0.x / _MainTex_ST.x, d.texcoord0.y / _MainTex_ST.y); + #if ATLAS_ON + warpUv = half2((warpUv.x - _MinXUV) / (_MaxXUV - _MinXUV), (warpUv.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + const float tau = 6.283185307179586; + float xWarp = (_Time.y + randomSeed) * _WarpSpeed + warpUv.x * tau / _WarpScale; + float yWarp = (_Time.y + randomSeed) * _WarpSpeed + warpUv.y * tau / _WarpScale; + float2 warp = float2(sin(xWarp), sin(yWarp)) * _WarpStrength; + d.texcoord0.xy += warp; + #endif + + //------------------------------------------------------- + + //WAVEUV_ON + #if WAVEUV_ON + float2 uvWave = half2(_WaveX * _MainTex_ST.x, _WaveY * _MainTex_ST.y) - d.texcoord0.xy; + uvWave %= 1; + #if ATLAS_ON + uvWave = half2(_WaveX, _WaveY) - uvRect; + #endif + uvWave.x *= _ScreenParams.x / _ScreenParams.y; + float waveTime = _Time.y + randomSeed; + float angWave = (sqrt(dot(uvWave, uvWave)) * _WaveAmount) - ((waveTime * _WaveSpeed)); + d.texcoord0.xy = d.texcoord0.xy + uvWave * sin(angWave) * (_WaveStrength / 1000.0); + #endif + //---------------------------------------------------- + + //ROUNDWAVEUV_ON + #if ROUNDWAVEUV_ON + half xWave = ((0.5 * _MainTex_ST.x) - uvRect.x); + half yWave = ((0.5 * _MainTex_ST.y) - uvRect.y) * (_MainTex_TexelSize.w / _MainTex_TexelSize.z); + half ripple = -sqrt(xWave*xWave + yWave* yWave); + d.texcoord0.xy += (sin((ripple + (_Time.y + randomSeed) * (_RoundWaveSpeed/10.0)) / 0.015) * (_RoundWaveStrength/10.0)) % 1; + #endif + //---------------------------------------------------- + + + //WIND_ON + #if WIND_ON + half windOffset = sin((_Time.x + randomSeed) * _GrassSpeed * 10); + half2 windCenter = half2(0.5, 0.1); + #if ATLAS_ON + windCenter.x = ((_MaxXUV - _MinXUV) * windCenter.x) + _MinXUV; + windCenter.y = ((_MaxYUV - _MinYUV) * windCenter.y) + _MinYUV; + #endif + #if !MANUALWIND_ON + d.texcoord0.x = fmod(abs(lerp(d.texcoord0.x, d.texcoord0.x + (_GrassWind * 0.01 * windOffset), uvRect.y)), 1); + #else + d.texcoord0.x = fmod(abs(lerp(d.texcoord0.x, d.texcoord0.x + (_GrassWind * 0.01 * _GrassManualAnim), uvRect.y)), 1); + windOffset = _GrassManualAnim; + #endif + half2 delta = d.texcoord0.xy - windCenter; + half delta2 = dot(delta.xy, delta.xy); + half2 delta_offset = delta2 * windOffset; + d.texcoord0.xy = d.texcoord0.xy + half2(delta.y, -delta.x) * delta_offset * _GrassRadialBend; + #endif + + //-------------------------------------------------------- + + //TEXTURESCROLL_ON && !ATLAS_ON + #if TEXTURESCROLL_ON && !ATLAS_ON + d.texcoord0.x += ((_Time.y + randomSeed) * _TextureScrollXSpeed) % 1; + d.texcoord0.y += ((_Time.y + randomSeed) * _TextureScrollYSpeed) % 1; + #endif + //------------------------------ + + //PIXELATE_ON + #if PIXELATE_ON + half aspectRatio = _MainTex_TexelSize.x / _MainTex_TexelSize.y; + half2 pixelSize = float2(_PixelateSize, _PixelateSize * aspectRatio); + d.texcoord0.xy = floor(d.texcoord0.xy * pixelSize) / pixelSize; + #endif + //-------------- + + half4 col = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy); + half originalAlpha = col.a; + col *= d.vertexColor; + + //NORMAL MAP + #if NORMALMAP_ON + half4 normalSample = SAMPLE_TEXTURE2D(_NormalMap, sampler_NormalMap, d.texcoord0.xy); + half3 normalTS = UnpackNormal(normalSample); + normalTS.xy *= _NormalStrength; + o.Normal = normalTS; + #endif + + + //GLITCH_ON + #if GLITCH_ON + half2 uvGlitch = uvRect; + uvGlitch.y -= 0.5; + half lineNoise = pow(rand2(floor(uvGlitch * half2(24., 19.) * _GlitchSize) * 4.0, randomSeed), 3.0) * _GlitchAmount + * pow(rand2(floor(uvGlitch * half2(38., 14.) * _GlitchSize) * 4.0, randomSeed), 3.0); + col = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(lineNoise * 0.02 * rand2(half2(2.0, 1), randomSeed), 0)) * d.vertexColor; + #endif + //-------------------------------------- + + //CHROMABERR_ON + #if CHROMABERR_ON + half4 r = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(_ChromAberrAmount/10, 0)) * d.vertexColor; + half4 b = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(-_ChromAberrAmount/10, 0)) * d.vertexColor; + col = half4(r.r * r.a, col.g, b.b * b.a, max(max(r.a, b.a) * _ChromAberrAlpha, col.a)); + #endif + + //-------------------------------- + + //BLUR_ON + #if BLUR_ON + #if ATLAS_ON + #if !BLURISHD_ON + col = BlurHD(d.texcoord0.xy, _MainTex, sampler_MainTex, _BlurIntensity, (_MaxXUV - _MinXUV), (_MaxYUV - _MinYUV)) * d.vertexColor; + #else + col = Blur(d.texcoord0.xy, _MainTex, sampler_MainTex, _BlurIntensity * (_MaxXUV - _MinXUV)) * d.vertexColor; + #endif + #else + #if !BLURISHD_ON + col = BlurHD(d.texcoord0.xy, _MainTex, sampler_MainTex, _BlurIntensity, 1, 1) * d.vertexColor; + #else + col = Blur(d.texcoord0.xy, _MainTex, sampler_MainTex, _BlurIntensity) * d.vertexColor; + #endif + #endif + #endif + + //-------------------- + + //MOTIONBLUR_ON + #if MOTIONBLUR_ON + _MotionBlurAngle = _MotionBlurAngle * 3.1415926; + #define rot(n) mul(n, half2x2(cos(_MotionBlurAngle), -sin(_MotionBlurAngle), sin(_MotionBlurAngle), cos(_MotionBlurAngle))) + _MotionBlurDist = _MotionBlurDist * 0.005; + #if ATLAS_ON + _MotionBlurDist *= (_MaxXUV - _MinXUV); + #endif + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(-_MotionBlurDist, -_MotionBlurDist))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(-_MotionBlurDist * 2, -_MotionBlurDist * 2))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(-_MotionBlurDist * 3, -_MotionBlurDist * 3))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(-_MotionBlurDist * 4, -_MotionBlurDist * 4))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(_MotionBlurDist, _MotionBlurDist))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(_MotionBlurDist * 2, _MotionBlurDist * 2))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(_MotionBlurDist * 3, _MotionBlurDist * 3))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(_MotionBlurDist * 4, _MotionBlurDist * 4))); + col.rgb = col.rgb / 9; + #endif + //------------------------------------ + + //NEGATIVE_ON + #if NEGATIVE_ON + col.rgb = lerp(col.rgb, 1 - col.rgb, _NegativeAmount); + #endif + + //-------------- + half luminance = 0; + + //GREYSCALE_ON && !GREYSCALEOUTLINE_ON + #if GREYSCALE_ON && !GREYSCALEOUTLINE_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + luminance = saturate(luminance + _GreyscaleLuminosity); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _GreyscaleTintColor, _GreyscaleBlend); + #endif + //------------------------------------ + + //GHOST_ON + #if GHOST_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + half4 ghostResult; + ghostResult.a = saturate(luminance - _GhostTransparency) * col.a; + ghostResult.rgb = col.rgb * (luminance + _GhostColorBoost); + col = lerp(col, ghostResult, _GhostBlend); + #endif + //------------------------------------ + + //INNEROUTLINE_ON + #if INNEROUTLINE_ON + half3 innerT = abs(GetPixel(0, _InnerOutlineThickness, d.texcoord0.xy, _MainTex, sampler_MainTex) - GetPixel(0, -_InnerOutlineThickness, d.texcoord0.xy, _MainTex, sampler_MainTex)); + innerT += abs(GetPixel(_InnerOutlineThickness, 0, d.texcoord0.xy, _MainTex, sampler_MainTex) - GetPixel(-_InnerOutlineThickness, 0, d.texcoord0.xy, _MainTex, sampler_MainTex)); + #if !ONLYINNEROUTLINE_ON + innerT = (innerT / 2.0) * col.a * _InnerOutlineAlpha; + col.rgb += length(innerT) * _InnerOutlineColor.rgb * _InnerOutlineGlow; + #else + innerT *= col.a * _InnerOutlineAlpha; + col.rgb = length(innerT) * _InnerOutlineColor.rgb * _InnerOutlineGlow; + col.a = step(0.3, col.r+col.g+col.b); + #endif + #endif + //------------------------------------------------------- + + //HITEFFECT_ON + #if HITEFFECT_ON + col.rgb = lerp(col.rgb, _HitEffectColor.rgb * _HitEffectGlow, _HitEffectBlend); + #endif + //-------------------- + + //GRADIENT_ON + #if GRADIENT_ON + half2 tiledUvGrad = half2(uvRect.x / _MainTex_ST.x, uvRect.y / _MainTex_ST.y); + #if GRADIENT2COL_ON + _GradTopRightCol = _GradTopLeftCol; + _GradBotRightCol = _GradBotLeftCol; + #endif + #if RADIALGRADIENT_ON + half radialDist = 1 - length(tiledUvGrad - half2(0.5, 0.5)); + radialDist *= (_MainTex_TexelSize.w / _MainTex_TexelSize.z); + radialDist = saturate(_GradBoostX * radialDist); + half4 gradientResult = lerp(_GradTopLeftCol, _GradBotLeftCol, radialDist); + #else + half gradXLerpFactor = saturate(pow(tiledUvGrad.x, _GradBoostX)); + half4 gradientResult = lerp(lerp(_GradBotLeftCol, _GradBotRightCol, gradXLerpFactor), + lerp(_GradTopLeftCol, _GradTopRightCol, gradXLerpFactor), saturate(pow(tiledUvGrad.y, _GradBoostY))); + #endif + gradientResult = lerp(col, gradientResult, _GradBlend); + col.rgb = gradientResult.rgb * col.a; + col.a *= gradientResult.a; + #endif + //-------------------------------------------------------------------- + + //CONTRAST_ON + #if CONTRAST_ON + col.rgb = (col.rgb - float3(0.5, 0.5, 0.5)) * _Contrast + float3(0.5, 0.5, 0.5); + col.rgb += _Brightness; + #endif + + //------------------------------------------------------------------- + + //COLORSWAP_ON + #if COLORSWAP_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + half4 swapMask = SAMPLE_TEXTURE2D(_ColorSwapTex, sampler_ColorSwapTex, d.texcoord0.xy); + swapMask.rgb *= swapMask.a; + half3 redSwap = _ColorSwapRed * swapMask.r * saturate(luminance + _ColorSwapRedLuminosity); + half3 greenSwap = _ColorSwapGreen * swapMask.g * saturate(luminance + _ColorSwapGreenLuminosity); + half3 blueSwap = _ColorSwapBlue * swapMask.b * saturate(luminance + _ColorSwapBlueLuminosity); + swapMask.rgb = col.rgb * saturate(1 - swapMask.r - swapMask.g - swapMask.b); + col.rgb = lerp(col.rgb, swapMask.rgb + redSwap + greenSwap + blueSwap, _ColorSwapBlend); + #endif + //-------------------------------------------------------------------- + + //COLORRAMP_ON && !COLORRAMPOUTLINE_ON + #if COLORRAMP_ON && !COLORRAMPOUTLINE_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + luminance = saturate(luminance + _ColorRampLuminosity); + #if GRADIENTCOLORRAMP_ON + col.rgb = lerp(col.rgb, SAMPLE_TEXTURE2D(_ColorRampTexGradient, sampler_ColorRampTexGradient, half2(luminance, 0)).rgb, _ColorRampBlend); + #else + col.rgb = lerp(col.rgb, SAMPLE_TEXTURE2D(_ColorRampTex, sampler_ColorRampTex, half2(luminance, 0)).rgb, _ColorRampBlend); + #endif + #endif + //-------------------------------------------------------------------- + + //CHANGECOLOR_ON + #if CHANGECOLOR_ON + float3 currChangeColor = saturate(col.rgb); + luminance = 0.3 * currChangeColor.r + 0.59 * currChangeColor.g + 0.11 * currChangeColor.b; + luminance = saturate(luminance + _ColorChangeLuminosity); + half3 dif = abs(currChangeColor - _ColorChangeTarget.rgb); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _ColorChangeNewCol.rgb, + max(sign(1 - saturate(dif.x + dif.y + dif.z) - _ColorChangeTolerance), 0.0)); + #if CHANGECOLOR2_ON + dif = abs(currChangeColor - _ColorChangeTarget2.rgb); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _ColorChangeNewCol2.rgb, + max(sign(1 - saturate(dif.x + dif.y + dif.z) - _ColorChangeTolerance2), 0.0)); + #endif + #if CHANGECOLOR3_ON + dif = abs(currChangeColor - _ColorChangeTarget3.rgb); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _ColorChangeNewCol3.rgb, + max(sign(1 - saturate(dif.x + dif.y + dif.z) - _ColorChangeTolerance3), 0.0)); + #endif + #endif + //------------------------------------------------------- + + //POSTERIZE_ON && !POSTERIZEOUTLINE_ON + #if POSTERIZE_ON && !POSTERIZEOUTLINE_ON + col.rgb = pow(col.rgb, _PosterizeGamma) * _PosterizeNumColors; + col.rgb = floor(col.rgb) / _PosterizeNumColors; + col.rgb = pow(col.rgb, 1.0 / _PosterizeGamma); + #endif + //------------------------------------ + + //HSV_ON + #if HSV_ON + half3 resultHsv = half3(col.rgb); + half cosHsv = _HsvBright * _HsvSaturation * cos(_HsvShift * 3.14159265 / 180); + half sinHsv = _HsvBright * _HsvSaturation * sin(_HsvShift * 3.14159265 / 180); + resultHsv.x = (.299 * _HsvBright + .701 * cosHsv + .168 * sinHsv) * col.x + + (.587 * _HsvBright - .587 * cosHsv + .330 * sinHsv) * col.y + + (.114 * _HsvBright - .114 * cosHsv - .497 * sinHsv) * col.z; + resultHsv.y = (.299 * _HsvBright - .299 * cosHsv - .328 * sinHsv) *col.x + + (.587 * _HsvBright + .413 * cosHsv + .035 * sinHsv) * col.y + + (.114 * _HsvBright - .114 * cosHsv + .292 * sinHsv) * col.z; + resultHsv.z = (.299 * _HsvBright - .3 * cosHsv + 1.25 * sinHsv) * col.x + + (.587 * _HsvBright - .588 * cosHsv - 1.05 * sinHsv) * col.y + + (.114 * _HsvBright + .886 * cosHsv - .203 * sinHsv) * col.z; + col.rgb = resultHsv; + #endif + //------------------------------------------------------- + + //OVERLAY_ON + #if OVERLAY_ON + half2 overlayUvs = d.texcoord0.xy; + overlayUvs.x += ((_Time.y + randomSeed) * _OverlayTextureScrollXSpeed) % 1; + overlayUvs.y += ((_Time.y + randomSeed) * _OverlayTextureScrollYSpeed) % 1; + half4 overlayCol = SAMPLE_TEXTURE2D(_OverlayTex, sampler_OverlayTex, TRANSFORM_TEX(overlayUvs, _OverlayTex)); + overlayCol.rgb *= _OverlayColor.rgb * _OverlayGlow; + #if !OVERLAYMULT_ON + overlayCol.rgb *= overlayCol.a * _OverlayColor.rgb * _OverlayColor.a * _OverlayBlend; + col.rgb += overlayCol.rgb; + #else + overlayCol.a *= _OverlayColor.a; + col = lerp(col, col * overlayCol, _OverlayBlend); + #endif + #endif + + //--------------------------------- + + //OUTBASE_ON + #if OUTBASE_ON + #if OUTBASEPIXELPERF_ON + half2 destUv = half2(_OutlinePixelWidth * _MainTex_TexelSize.x, _OutlinePixelWidth * _MainTex_TexelSize.y); + #else + half2 destUv = half2(_OutlineWidth * _MainTex_TexelSize.x * 200, _OutlineWidth * _MainTex_TexelSize.y * 200); + #endif + + #if OUTDIST_ON + d.texcoord3.x += ((_Time.x + _RandomSeed) * _OutlineDistortTexXSpeed) % 1; + d.texcoord3.y += ((_Time.x + _RandomSeed) * _OutlineDistortTexYSpeed) % 1; + #if ATLAS_ON + d.texcoord3 = half2((d.texcoord3.x - _MinXUV) / (_MaxXUV - _MinXUV), (d.texcoord3.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half outDistortAmnt = (SAMPLE_TEXTURE2D(_OutlineDistortTex, sampler_OutlineDistortTex, d.texcoord3).r - 0.5) * 0.2 * _OutlineDistortAmount; + destUv.x += outDistortAmnt; + destUv.y += outDistortAmnt; + #endif + + half spriteLeft = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(destUv.x, 0)).a; + half spriteRight = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy - half2(destUv.x, 0)).a; + half spriteBottom = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(0, destUv.y)).a; + half spriteTop = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy - half2(0, destUv.y)).a; + half result = spriteLeft + spriteRight + spriteBottom + spriteTop; + + #if OUTBASE8DIR_ON + half spriteTopLeft = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(destUv.x, destUv.y)).a; + half spriteTopRight = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(-destUv.x, destUv.y)).a; + half spriteBotLeft = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(destUv.x, -destUv.y)).a; + half spriteBotRight = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(-destUv.x, -destUv.y)).a; + result = result + spriteTopLeft + spriteTopRight + spriteBotLeft + spriteBotRight; + #endif + + result = step(0.05, saturate(result)); + + #if OUTTEX_ON + d.texcoord1.x += ((_Time.x + _RandomSeed) * _OutlineTexXSpeed) % 1; + d.texcoord1.y += ((_Time.x + _RandomSeed) * _OutlineTexYSpeed) % 1; + #if ATLAS_ON + d.texcoord1 = half2((d.texcoord1.x - _MinXUV) / (_MaxXUV - _MinXUV), (d.texcoord1.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half4 tempOutColor = SAMPLE_TEXTURE2D(_OutlineTex, sampler_OutlineTex, d.texcoord1); + tempOutColor *= _OutlineColor; + _OutlineColor = tempOutColor; + #endif + + result *= (1 - originalAlpha) * _OutlineAlpha; + + half4 outline = _OutlineColor * d.vertexColor.a; + outline.rgb *= _OutlineGlow; + outline.a = result; + #if ONLYOUTLINE_ON + col = outline; + #else + col = lerp(col, outline, result); + #endif + #endif + //------------------------------------------------------- + + //FADE_ON + #if FADE_ON + half2 tiledUvFade1 = TRANSFORM_TEX(d.texcoord0, _FadeTex); + half2 tiledUvFade2 = TRANSFORM_TEX(d.texcoord0, _FadeBurnTex); + #if ATLAS_ON + tiledUvFade1 = half2((tiledUvFade1.x - _MinXUV) / (_MaxXUV - _MinXUV), (tiledUvFade1.y - _MinYUV) / (_MaxYUV - _MinYUV)); + tiledUvFade2 = half2((tiledUvFade2.x - _MinXUV) / (_MaxXUV - _MinXUV), (tiledUvFade2.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half fadeTemp = SAMPLE_TEXTURE2D(_FadeTex, sampler_FadeTex, tiledUvFade1).r; + half fade = smoothstep(_FadeAmount, _FadeAmount + _FadeBurnTransition, fadeTemp); + half fadeBurn = saturate(smoothstep(_FadeAmount - _FadeBurnWidth, _FadeAmount - _FadeBurnWidth + 0.1, fadeTemp) * _FadeAmount); + col.a *= fade; + _FadeBurnColor.rgb *= _FadeBurnGlow; + col += fadeBurn * SAMPLE_TEXTURE2D(_FadeBurnTex, sampler_FadeBurnTex, tiledUvFade2) * _FadeBurnColor * originalAlpha * (1 - col.a); + #endif + //------------------------------------------------------- + + //SHADOW_ON + #if SHADOW_ON + half shadowA = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(_ShadowX, _ShadowY)).a; + half preMultShadowMask = 1 - (saturate(shadowA - col.a) * (1 - col.a)); + col.rgb *= 1 - ((shadowA - col.a) * (1 - col.a)); + col.rgb += (_ShadowColor * shadowA) * (1 - col.a); + col.a = max(shadowA * _ShadowAlpha * d.vertexColor.a, col.a); + #endif + + //------------------------------------------------------- + + //GLOW_ON + #if GLOW_ON + half4 emission; + #if GLOWTEX_ON + emission = SAMPLE_TEXTURE2D(_GlowTex, sampler_GlowTex, d.texcoord0); + #else + emission = col; + #endif + + col.rgb *= _GlowGlobal; + emission.rgb *= emission.a * col.a * _Glow * _GlowColor; + col.rgb += emission.rgb; + #endif + //------------------------------------------------------- + + //COLORRAMP_ON && COLORRAMPOUTLINE_ON + #if COLORRAMP_ON && COLORRAMPOUTLINE_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + luminance = saturate(luminance + _ColorRampLuminosity); + #if GRADIENTCOLORRAMP_ON + col.rgb = lerp(col.rgb, SAMPLE_TEXTURE2D(_ColorRampTexGradient, sampler_ColorRampTexGradient, half2(luminance, 0)).rgb, _ColorRampBlend); + #else + col.rgb = lerp(col.rgb, SAMPLE_TEXTURE2D(_ColorRampTex, sampler_ColorRampTex, half2(luminance, 0)).rgb, _ColorRampBlend); + #endif + #endif + //--------------- + + //GREYSCALE_ON && GREYSCALEOUTLINE_ON + #if GREYSCALE_ON && GREYSCALEOUTLINE_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + luminance = saturate(luminance + _GreyscaleLuminosity); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _GreyscaleTintColor, _GreyscaleBlend); + #endif + + //----------------------------------- + + //POSTERIZE_ON && POSTERIZEOUTLINE_ON + #if POSTERIZE_ON && POSTERIZEOUTLINE_ON + col.rgb = pow(col.rgb, _PosterizeGamma) * _PosterizeNumColors; + col.rgb = floor(col.rgb) / _PosterizeNumColors; + col.rgb = pow(col.rgb, 1.0 / _PosterizeGamma); + #endif + + //----------------------------------- + + //SHINE_ON + #if SHINE_ON + half2 uvShine = uvRect; + half cosAngle = cos(_ShineRotate); + half sinAngle = sin(_ShineRotate); + half2x2 rot = half2x2(cosAngle, -sinAngle, sinAngle, cosAngle); + uvShine -= half2(0.5, 0.5); + uvShine = mul(rot, uvShine); + uvShine += half2(0.5, 0.5); + half shineMask = SAMPLE_TEXTURE2D(_ShineMask, sampler_ShineMask, d.texcoord0.xy).a; + half currentDistanceProjection = (uvShine.x + uvShine.y) / 2; + half whitePower = 1 - (abs(currentDistanceProjection - _ShineLocation) / _ShineWidth); + col.rgb += col.a * whitePower * _ShineGlow * max(sign(currentDistanceProjection - (_ShineLocation - _ShineWidth)), 0.0) + * max(sign((_ShineLocation + _ShineWidth) - currentDistanceProjection), 0.0) * _ShineColor * shineMask; + #endif + + //----------------------------------- + + //HOLOGRAM_ON + #if HOLOGRAM_ON + half totalHologram = _HologramStripesAmount + _HologramUnmodAmount; + half hologramYCoord = ((uvRect.y + (((_Time.x + randomSeed) % 1) * _HologramStripesSpeed)) % totalHologram) / totalHologram; + hologramYCoord = abs(hologramYCoord); + half alpha = RemapFloat(saturate(hologramYCoord - (_HologramUnmodAmount/totalHologram)), 0.0, 1.0, _HologramMinAlpha, saturate(_HologramMaxAlpha)); + half hologramMask = max(sign((_HologramUnmodAmount/totalHologram) - hologramYCoord), 0.0); + half4 hologramResult = col; + hologramResult.a *= lerp(alpha, 1, hologramMask); + hologramResult.rgb *= max(1, _HologramMaxAlpha * max(sign(hologramYCoord - (_HologramUnmodAmount/totalHologram)), 0.0)); + hologramMask = 1 - step(0.01,hologramMask); + hologramResult.rgb += hologramMask * _HologramStripeColor * col.a; + col = lerp(col, hologramResult, _HologramBlend); + #endif + + //----------------------------------- + + //FLICKER_ON + #if FLICKER_ON + col.a *= saturate(col.a * step(frac(0.05 + (_Time.w + randomSeed) * _FlickerFreq), 1 - _FlickerPercent) + _FlickerAlpha); + #endif + //----------------------------------- + + //ALPHACUTOFF_ON + + //ALPHAROUND_ON + + //ALPHAOUTLINE_ON + #if ALPHAOUTLINE_ON + half alphaOutlineRes = pow(1 - col.a, max(_AlphaOutlinePower, 0.0001)) * step(_AlphaOutlineMinAlpha, col.a) * _AlphaOutlineBlend; + col.rgb = lerp(col.rgb, _AlphaOutlineColor.rgb * _AlphaOutlineGlow, alphaOutlineRes); + col.a = lerp(col.a, 1, alphaOutlineRes > 1); + #endif + //------------------------------------------------------- + + //FOG_ON + + //------------------ + + col *= _Color; + o.Albedo = col; + col.a *= _Alpha; + clip(col.a - _AlphaCutoffValue - 0.01); + o.Alpha = _Color.a; + } + + + + + + void ChainSurfaceFunction(inout Surface l, inout ShaderData d) + { + Ext_SurfaceFunction0(l, d); + // Ext_SurfaceFunction1(l, d); + // Ext_SurfaceFunction2(l, d); + // Ext_SurfaceFunction3(l, d); + // Ext_SurfaceFunction4(l, d); + // Ext_SurfaceFunction5(l, d); + // Ext_SurfaceFunction6(l, d); + // Ext_SurfaceFunction7(l, d); + // Ext_SurfaceFunction8(l, d); + // Ext_SurfaceFunction9(l, d); + // Ext_SurfaceFunction10(l, d); + // Ext_SurfaceFunction11(l, d); + // Ext_SurfaceFunction12(l, d); + // Ext_SurfaceFunction13(l, d); + // Ext_SurfaceFunction14(l, d); + // Ext_SurfaceFunction15(l, d); + // Ext_SurfaceFunction16(l, d); + // Ext_SurfaceFunction17(l, d); + // Ext_SurfaceFunction18(l, d); + // Ext_SurfaceFunction19(l, d); + // Ext_SurfaceFunction20(l, d); + // Ext_SurfaceFunction21(l, d); + // Ext_SurfaceFunction22(l, d); + // Ext_SurfaceFunction23(l, d); + // Ext_SurfaceFunction24(l, d); + // Ext_SurfaceFunction25(l, d); + // Ext_SurfaceFunction26(l, d); + // Ext_SurfaceFunction27(l, d); + // Ext_SurfaceFunction28(l, d); + // Ext_SurfaceFunction29(l, d); + } + +#if !_DECALSHADER + + void ChainModifyVertex(inout VertexData v, inout VertexToPixel v2p, float4 time) + { + ExtraV2F d; + + ZERO_INITIALIZE(ExtraV2F, d); + ZERO_INITIALIZE(Blackboard, d.blackboard); + // due to motion vectors in HDRP, we need to use the last + // time in certain spots. So if you are going to use _Time to adjust vertices, + // you need to use this time or motion vectors will break. + d.time = time; + + Ext_ModifyVertex0(v, d); + // Ext_ModifyVertex1(v, d); + // Ext_ModifyVertex2(v, d); + // Ext_ModifyVertex3(v, d); + // Ext_ModifyVertex4(v, d); + // Ext_ModifyVertex5(v, d); + // Ext_ModifyVertex6(v, d); + // Ext_ModifyVertex7(v, d); + // Ext_ModifyVertex8(v, d); + // Ext_ModifyVertex9(v, d); + // Ext_ModifyVertex10(v, d); + // Ext_ModifyVertex11(v, d); + // Ext_ModifyVertex12(v, d); + // Ext_ModifyVertex13(v, d); + // Ext_ModifyVertex14(v, d); + // Ext_ModifyVertex15(v, d); + // Ext_ModifyVertex16(v, d); + // Ext_ModifyVertex17(v, d); + // Ext_ModifyVertex18(v, d); + // Ext_ModifyVertex19(v, d); + // Ext_ModifyVertex20(v, d); + // Ext_ModifyVertex21(v, d); + // Ext_ModifyVertex22(v, d); + // Ext_ModifyVertex23(v, d); + // Ext_ModifyVertex24(v, d); + // Ext_ModifyVertex25(v, d); + // Ext_ModifyVertex26(v, d); + // Ext_ModifyVertex27(v, d); + // Ext_ModifyVertex28(v, d); + // Ext_ModifyVertex29(v, d); + + + // #if %EXTRAV2F0REQUIREKEY% + // v2p.extraV2F0 = d.extraV2F0; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // v2p.extraV2F1 = d.extraV2F1; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // v2p.extraV2F2 = d.extraV2F2; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // v2p.extraV2F3 = d.extraV2F3; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // v2p.extraV2F4 = d.extraV2F4; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // v2p.extraV2F5 = d.extraV2F5; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // v2p.extraV2F6 = d.extraV2F6; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // v2p.extraV2F7 = d.extraV2F7; + // #endif + } + + void ChainModifyTessellatedVertex(inout VertexData v, inout VertexToPixel v2p) + { + ExtraV2F d; + ZERO_INITIALIZE(ExtraV2F, d); + ZERO_INITIALIZE(Blackboard, d.blackboard); + + // #if %EXTRAV2F0REQUIREKEY% + // d.extraV2F0 = v2p.extraV2F0; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // d.extraV2F1 = v2p.extraV2F1; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // d.extraV2F2 = v2p.extraV2F2; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // d.extraV2F3 = v2p.extraV2F3; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // d.extraV2F4 = v2p.extraV2F4; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // d.extraV2F5 = v2p.extraV2F5; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // d.extraV2F6 = v2p.extraV2F6; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // d.extraV2F7 = v2p.extraV2F7; + // #endif + + + // Ext_ModifyTessellatedVertex0(v, d); + // Ext_ModifyTessellatedVertex1(v, d); + // Ext_ModifyTessellatedVertex2(v, d); + // Ext_ModifyTessellatedVertex3(v, d); + // Ext_ModifyTessellatedVertex4(v, d); + // Ext_ModifyTessellatedVertex5(v, d); + // Ext_ModifyTessellatedVertex6(v, d); + // Ext_ModifyTessellatedVertex7(v, d); + // Ext_ModifyTessellatedVertex8(v, d); + // Ext_ModifyTessellatedVertex9(v, d); + // Ext_ModifyTessellatedVertex10(v, d); + // Ext_ModifyTessellatedVertex11(v, d); + // Ext_ModifyTessellatedVertex12(v, d); + // Ext_ModifyTessellatedVertex13(v, d); + // Ext_ModifyTessellatedVertex14(v, d); + // Ext_ModifyTessellatedVertex15(v, d); + // Ext_ModifyTessellatedVertex16(v, d); + // Ext_ModifyTessellatedVertex17(v, d); + // Ext_ModifyTessellatedVertex18(v, d); + // Ext_ModifyTessellatedVertex19(v, d); + // Ext_ModifyTessellatedVertex20(v, d); + // Ext_ModifyTessellatedVertex21(v, d); + // Ext_ModifyTessellatedVertex22(v, d); + // Ext_ModifyTessellatedVertex23(v, d); + // Ext_ModifyTessellatedVertex24(v, d); + // Ext_ModifyTessellatedVertex25(v, d); + // Ext_ModifyTessellatedVertex26(v, d); + // Ext_ModifyTessellatedVertex27(v, d); + // Ext_ModifyTessellatedVertex28(v, d); + // Ext_ModifyTessellatedVertex29(v, d); + + // #if %EXTRAV2F0REQUIREKEY% + // v2p.extraV2F0 = d.extraV2F0; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // v2p.extraV2F1 = d.extraV2F1; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // v2p.extraV2F2 = d.extraV2F2; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // v2p.extraV2F3 = d.extraV2F3; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // v2p.extraV2F4 = d.extraV2F4; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // v2p.extraV2F5 = d.extraV2F5; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // v2p.extraV2F6 = d.extraV2F6; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // v2p.extraV2F7 = d.extraV2F7; + // #endif + } + + void ChainFinalColorForward(inout Surface l, inout ShaderData d, inout half4 color) + { + // Ext_FinalColorForward0(l, d, color); + // Ext_FinalColorForward1(l, d, color); + // Ext_FinalColorForward2(l, d, color); + // Ext_FinalColorForward3(l, d, color); + // Ext_FinalColorForward4(l, d, color); + // Ext_FinalColorForward5(l, d, color); + // Ext_FinalColorForward6(l, d, color); + // Ext_FinalColorForward7(l, d, color); + // Ext_FinalColorForward8(l, d, color); + // Ext_FinalColorForward9(l, d, color); + // Ext_FinalColorForward10(l, d, color); + // Ext_FinalColorForward11(l, d, color); + // Ext_FinalColorForward12(l, d, color); + // Ext_FinalColorForward13(l, d, color); + // Ext_FinalColorForward14(l, d, color); + // Ext_FinalColorForward15(l, d, color); + // Ext_FinalColorForward16(l, d, color); + // Ext_FinalColorForward17(l, d, color); + // Ext_FinalColorForward18(l, d, color); + // Ext_FinalColorForward19(l, d, color); + // Ext_FinalColorForward20(l, d, color); + // Ext_FinalColorForward21(l, d, color); + // Ext_FinalColorForward22(l, d, color); + // Ext_FinalColorForward23(l, d, color); + // Ext_FinalColorForward24(l, d, color); + // Ext_FinalColorForward25(l, d, color); + // Ext_FinalColorForward26(l, d, color); + // Ext_FinalColorForward27(l, d, color); + // Ext_FinalColorForward28(l, d, color); + // Ext_FinalColorForward29(l, d, color); + } + + void ChainFinalGBufferStandard(inout Surface s, inout ShaderData d, inout half4 GBuffer0, inout half4 GBuffer1, inout half4 GBuffer2, inout half4 outEmission, inout half4 outShadowMask) + { + // Ext_FinalGBufferStandard0(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard1(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard2(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard3(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard4(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard5(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard6(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard7(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard8(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard9(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard10(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard11(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard12(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard13(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard14(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard15(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard16(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard17(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard18(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard19(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard20(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard21(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard22(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard23(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard24(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard25(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard26(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard27(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard28(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard29(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + } +#endif + + + + + +#if _DECALSHADER + + ShaderData CreateShaderData(SurfaceDescriptionInputs IN) + { + ShaderData d = (ShaderData)0; + d.TBNMatrix = float3x3(IN.WorldSpaceTangent, IN.WorldSpaceBiTangent, IN.WorldSpaceNormal); + d.worldSpaceNormal = IN.WorldSpaceNormal; + d.worldSpaceTangent = IN.WorldSpaceTangent; + + d.worldSpacePosition = IN.WorldSpacePosition; + d.texcoord0 = IN.uv0.xyxy; + d.screenPos = IN.ScreenPosition; + + d.worldSpaceViewDir = normalize(_WorldSpaceCameraPos - d.worldSpacePosition); + + d.tangentSpaceViewDir = mul(d.TBNMatrix, d.worldSpaceViewDir); + + // these rarely get used, so we back transform them. Usually will be stripped. + #if _HDRP + // d.localSpacePosition = mul(GetWorldToObjectMatrix(), float4(GetCameraRelativePositionWS(d.worldSpacePosition), 1)).xyz; + #else + // d.localSpacePosition = mul(GetWorldToObjectMatrix(), float4(d.worldSpacePosition, 1)).xyz; + #endif + // d.localSpaceNormal = normalize(mul((float3x3)GetWorldToObjectMatrix(), d.worldSpaceNormal)); + // d.localSpaceTangent = normalize(mul((float3x3)GetWorldToObjectMatrix(), d.worldSpaceTangent.xyz)); + + // #if %SCREENPOSREQUIREKEY% + // d.screenUV = (IN.ScreenPosition.xy / max(0.01, IN.ScreenPosition.w)); + // #endif + + return d; + } +#else + + ShaderData CreateShaderData(VertexToPixel i + #if NEED_FACING + , bool facing + #endif + ) + { + ShaderData d = (ShaderData)0; + d.clipPos = i.pos; + d.worldSpacePosition = i.worldPos; + + d.worldSpaceNormal = normalize(i.worldNormal); + d.worldSpaceTangent.xyz = normalize(i.worldTangent.xyz); + + d.tangentSign = i.worldTangent.w * unity_WorldTransformParams.w; + float3 bitangent = cross(d.worldSpaceTangent.xyz, d.worldSpaceNormal) * d.tangentSign; + + d.TBNMatrix = float3x3(d.worldSpaceTangent, -bitangent, d.worldSpaceNormal); + d.worldSpaceViewDir = normalize(_WorldSpaceCameraPos - i.worldPos); + + d.tangentSpaceViewDir = mul(d.TBNMatrix, d.worldSpaceViewDir); + d.texcoord0 = i.texcoord0; + d.texcoord1 = i.texcoord1; + d.texcoord2 = i.texcoord2; + + // #if %TEXCOORD3REQUIREKEY% + d.texcoord3 = i.texcoord3; + // #endif + + // d.isFrontFace = facing; + // #if %VERTEXCOLORREQUIREKEY% + d.vertexColor = i.vertexColor; + // #endif + + // these rarely get used, so we back transform them. Usually will be stripped. + #if _HDRP + // d.localSpacePosition = mul(GetWorldToObjectMatrix(), float4(GetCameraRelativePositionWS(i.worldPos), 1)).xyz; + #else + // d.localSpacePosition = mul(GetWorldToObjectMatrix(), float4(i.worldPos, 1)).xyz; + #endif + // d.localSpaceNormal = normalize(mul((float3x3)GetWorldToObjectMatrix(), i.worldNormal)); + // d.localSpaceTangent = normalize(mul((float3x3)GetWorldToObjectMatrix(), i.worldTangent.xyz)); + + // #if %SCREENPOSREQUIREKEY% + // d.screenPos = i.screenPos; + // d.screenUV = (i.screenPos.xy / i.screenPos.w); + // #endif + + + // #if %EXTRAV2F0REQUIREKEY% + // d.extraV2F0 = i.extraV2F0; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // d.extraV2F1 = i.extraV2F1; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // d.extraV2F2 = i.extraV2F2; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // d.extraV2F3 = i.extraV2F3; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // d.extraV2F4 = i.extraV2F4; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // d.extraV2F5 = i.extraV2F5; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // d.extraV2F6 = i.extraV2F6; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // d.extraV2F7 = i.extraV2F7; + // #endif + + return d; + } + +#endif + + + +#if (SHADERPASS == SHADERPASS_LIGHT_TRANSPORT) + + // This was not in constant buffer in original unity, so keep outiside. But should be in as ShaderRenderPass frequency + float unity_OneOverOutputBoost; + float unity_MaxOutputValue; + + CBUFFER_START(UnityMetaPass) + // x = use uv1 as raster position + // y = use uv2 as raster position + bool4 unity_MetaVertexControl; + + // x = return albedo + // y = return normal + bool4 unity_MetaFragmentControl; + CBUFFER_END + + VertexToPixel Vert(VertexData inputMesh) + { + VertexToPixel output; + ZERO_INITIALIZE(VertexToPixel, output); + UNITY_SETUP_INSTANCE_ID(inputMesh); + UNITY_TRANSFER_INSTANCE_ID(inputMesh, output); + UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(output); + + // Output UV coordinate in vertex shader + float2 uv = float2(0.0, 0.0); + + if (unity_MetaVertexControl.x) + { + uv = inputMesh.texcoord1.xy * unity_LightmapST.xy + unity_LightmapST.zw; + } + else if (unity_MetaVertexControl.y) + { + uv = inputMesh.texcoord2.xy * unity_DynamicLightmapST.xy + unity_DynamicLightmapST.zw; + } + + // OpenGL right now needs to actually use the incoming vertex position + // so we create a fake dependency on it here that haven't any impact. + output.pos = float4(uv * 2.0 - 1.0, inputMesh.vertex.z > 0 ? 1.0e-4 : 0.0, 1.0); + + output.worldPos = TransformObjectToWorld(inputMesh.vertex.xyz).xyz; + + // Normal is required for triplanar mapping + output.worldNormal = TransformObjectToWorldNormal(inputMesh.normal); + // Not required but assign to silent compiler warning + output.worldTangent = float4(1.0, 0.0, 0.0, 0.0); + + output.texcoord0 = inputMesh.texcoord0; + output.texcoord1 = inputMesh.texcoord1; + output.texcoord2 = inputMesh.texcoord2; + // #if %TEXCOORD3REQUIREKEY% + output.texcoord3 = inputMesh.texcoord3; + // #endif + // #if %VERTEXCOLORREQUIREKEY% + output.vertexColor = inputMesh.vertexColor; + // #endif + + return output; + } +#else + + #if (_PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR))) + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/ShaderVariablesMatrixDefsHDCamera.hlsl" + + void MotionVectorPositionZBias(VertexToPixel input) + { + #if UNITY_REVERSED_Z + input.pos.z -= unity_MotionVectorsParams.z * input.pos.w; + #else + input.pos.z += unity_MotionVectorsParams.z * input.pos.w; + #endif + } + + #endif + + VertexToPixel Vert(VertexData input) + { + VertexToPixel output; + ZERO_INITIALIZE(VertexToPixel, output); + + UNITY_SETUP_INSTANCE_ID(input); + UNITY_TRANSFER_INSTANCE_ID(input, output); + UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(output); + + #if _HDRP && (_PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR))) + VertexData previousMesh = input; + #endif + + ChainModifyVertex(input, output, _Time); + + // This return the camera relative position (if enable) + float3 positionRWS = TransformObjectToWorld(input.vertex.xyz); + float3 normalWS = TransformObjectToWorldNormal(input.normal); + float4 tangentWS = float4(TransformObjectToWorldDir(input.tangent.xyz), input.tangent.w); + + + output.worldPos = GetAbsolutePositionWS(positionRWS); + output.pos = TransformWorldToHClip(positionRWS); + output.worldNormal = normalWS; + output.worldTangent = tangentWS; + + + output.texcoord0 = input.texcoord0; + output.texcoord1 = input.texcoord1; + output.texcoord2 = input.texcoord2; + + // #if %TEXCOORD3REQUIREKEY% + output.texcoord3 = input.texcoord3; + // #endif + + // #if %VERTEXCOLORREQUIREKEY% + output.vertexColor = input.vertexColor; + // #endif + + // #if %SCREENPOSREQUIREKEY% + // output.screenPos = ComputeScreenPos(output.pos, _ProjectionParams.x); + // #endif + + #if _HDRP && (_PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR))) + + #if !defined(TESSELLATION_ON) + MotionVectorPositionZBias(output); + #endif + + output.motionVectorCS = mul(UNITY_MATRIX_UNJITTERED_VP, float4(positionRWS.xyz, 1.0)); + // Note: unity_MotionVectorsParams.y is 0 is forceNoMotion is enabled + bool forceNoMotion = unity_MotionVectorsParams.y == 0.0; + if (forceNoMotion) + { + output.previousPositionCS = float4(0.0, 0.0, 0.0, 1.0); + } + else + { + bool hasDeformation = unity_MotionVectorsParams.x > 0.0; // Skin or morph target + + float3 effectivePositionOS = (hasDeformation ? previousMesh.previousPositionOS : previousMesh.vertex.xyz); + #if defined(_ADD_PRECOMPUTED_VELOCITY) + effectivePositionOS -= input.precomputedVelocity; + #endif + + previousMesh.vertex = float4(effectivePositionOS, 1); + VertexToPixel dummy = (VertexToPixel)0; + + + ChainModifyVertex(previousMesh, dummy, _LastTimeParameters); + + // we might need this for skinned objects? + //float3 normalWS = TransformPreviousObjectToWorldNormal(input.normal).xyz; + float3 previousPositionRWS = TransformPreviousObjectToWorld(previousMesh.vertex.xyz); + + #ifdef _WRITE_TRANSPARENT_MOTION_VECTOR + if (_TransparentCameraOnlyMotionVectors > 0) + { + previousPositionRWS = positionRWS.xyz; + } + #endif // _WRITE_TRANSPARENT_MOTION_VECTOR + + output.previousPositionCS = mul(UNITY_MATRIX_PREV_VP, float4(previousPositionRWS, 1.0)); + } + #endif // _HDRP && _PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR)) + + + return output; + } + + +#endif + + + + + + + + #if defined(WRITE_DECAL_BUFFER) && !defined(_DISABLE_DECALS) + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/Decal/DecalPrepassBuffer.hlsl" + #endif + + FragInputs BuildFragInputs(VertexToPixel input) + { + UNITY_SETUP_INSTANCE_ID(input); + FragInputs output; + ZERO_INITIALIZE(FragInputs, output); + + // Init to some default value to make the computer quiet (else it output 'divide by zero' warning even if value is not used). + // TODO: this is a really poor workaround, but the variable is used in a bunch of places + // to compute normals which are then passed on elsewhere to compute other values... + output.tangentToWorld = k_identity3x3; + output.positionSS = input.pos; // input.positionCS is SV_Position + // BETTER SHADERS: because we transform world position into actual world space for things like + // triplanar, etc, we have to back transform it here for lighting + output.positionRWS = GetCameraRelativePositionWS(input.worldPos); + output.tangentToWorld = BuildTangentToWorld(input.worldTangent, input.worldNormal); + output.texCoord0 = input.texcoord0; + output.texCoord1 = input.texcoord1; + output.texCoord2 = input.texcoord2; + + return output; + } + +#if UNITY_VERSION > UNITY_2022_3_12 + void ApplyDecalAndGetNormal(FragInputs fragInputs, PositionInputs posInput, Surface surfaceDescription, float3 normalTS, + inout SurfaceData surfaceData) + { + float3 doubleSidedConstants = GetDoubleSidedConstants(); + + #ifdef DECAL_NORMAL_BLENDING + // SG nodes don't ouptut surface gradients, so if decals require surf grad blending, we have to convert + // the normal to gradient before applying the decal. We then have to resolve the gradient back to world space + normalTS = SurfaceGradientFromTangentSpaceNormalAndFromTBN(normalTS, + fragInputs.tangentToWorld[0], fragInputs.tangentToWorld[1]); + + + #if HAVE_DECALS + if (_EnableDecals) + { + float alpha = 1.0; + alpha = surfaceDescription.Alpha; + + DecalSurfaceData decalSurfaceData = GetDecalSurfaceData(posInput, fragInputs, alpha); + ApplyDecalToSurfaceNormal(decalSurfaceData, fragInputs.tangentToWorld[2], normalTS); + ApplyDecalToSurfaceDataNoNormal(decalSurfaceData, surfaceData); + } + #endif + + GetNormalWS_SG(fragInputs, normalTS, surfaceData.normalWS, doubleSidedConstants); + #else + // normal delivered to master node + + #if HAVE_DECALS + if (_EnableDecals) + { + float alpha = 1.0; + alpha = surfaceDescription.Alpha; + + // Both uses and modifies 'surfaceData.normalWS'. + DecalSurfaceData decalSurfaceData = GetDecalSurfaceData(posInput, fragInputs, alpha); + ApplyDecalToSurfaceNormal(decalSurfaceData, surfaceData.normalWS.xyz); + ApplyDecalToSurfaceDataNoNormal(decalSurfaceData, surfaceData); + } + #endif + #endif + } +#endif + + void BuildSurfaceData(FragInputs fragInputs, inout Surface surfaceDescription, float3 V, PositionInputs posInput, out SurfaceData surfaceData, out float3 bentNormalWS) + { + // setup defaults -- these are used if the graph doesn't output a value + ZERO_INITIALIZE(SurfaceData, surfaceData); + + // specularOcclusion need to be init ahead of decal to quiet the compiler that modify the SurfaceData struct + // however specularOcclusion can come from the graph, so need to be init here so it can be override. + surfaceData.specularOcclusion = 1.0; + + // copy across graph values, if defined + surfaceData.baseColor = surfaceDescription.Albedo; + surfaceData.perceptualSmoothness = surfaceDescription.Smoothness; + surfaceData.ambientOcclusion = surfaceDescription.Occlusion; + surfaceData.specularOcclusion = surfaceDescription.SpecularOcclusion; + surfaceData.metallic = surfaceDescription.Metallic; + surfaceData.subsurfaceMask = surfaceDescription.SubsurfaceMask; + surfaceData.thickness = surfaceDescription.Thickness; + surfaceData.diffusionProfileHash = asuint(surfaceDescription.DiffusionProfileHash); + #if _USESPECULAR + surfaceData.specularColor = surfaceDescription.Specular; + #endif + surfaceData.coatMask = surfaceDescription.CoatMask; + surfaceData.anisotropy = surfaceDescription.Anisotropy; + surfaceData.iridescenceMask = surfaceDescription.IridescenceMask; + surfaceData.iridescenceThickness = surfaceDescription.IridescenceThickness; + + + + #if defined(_REFRACTION_PLANE) || defined(_REFRACTION_SPHERE) || defined(_REFRACTION_THIN) + if (_EnableSSRefraction) + { + surfaceData.transmittanceMask = (1.0 - surfaceDescription.Alpha); + surfaceDescription.Alpha = 1.0; + } + else + { + surfaceData.ior = surfaceDescription.ior; + surfaceData.transmittanceColor = surfaceDescription.transmittanceColor; + surfaceData.atDistance = surfaceDescription.atDistance; + surfaceData.transmittanceMask = surfaceDescription.transmittanceMask; + surfaceDescription.Alpha = 1.0; + } + #else + surfaceData.ior = 1.0; + surfaceData.transmittanceColor = float3(1.0, 1.0, 1.0); + surfaceData.atDistance = 1.0; + surfaceData.transmittanceMask = 0.0; + #endif + + + + // These static material feature allow compile time optimization + surfaceData.materialFeatures = MATERIALFEATUREFLAGS_LIT_STANDARD; + #ifdef _MATERIAL_FEATURE_SUBSURFACE_SCATTERING + surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_SUBSURFACE_SCATTERING; + #endif + + #ifdef _MATERIAL_FEATURE_TRANSMISSION + surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_TRANSMISSION; + #endif + + #ifdef _MATERIAL_FEATURE_ANISOTROPY + surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_ANISOTROPY; + surfaceData.normalWS = float3(0, 1, 0); + #endif + + #ifdef _MATERIAL_FEATURE_IRIDESCENCE + surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_IRIDESCENCE; + #endif + + #ifdef _MATERIAL_FEATURE_SPECULAR_COLOR + surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_SPECULAR_COLOR; + #endif + + #if defined(_MATERIAL_FEATURE_CLEAR_COAT) || _CLEARCOAT + surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_CLEAR_COAT; + #endif + + #if defined (_MATERIAL_FEATURE_SPECULAR_COLOR) && defined (_ENERGY_CONSERVING_SPECULAR) + // Require to have setup baseColor + // Reproduce the energy conservation done in legacy Unity. Not ideal but better for compatibility and users can unchek it + surfaceData.baseColor *= (1.0 - Max3(surfaceData.specularColor.r, surfaceData.specularColor.g, surfaceData.specularColor.b)); + #endif + + float3 normalTS = surfaceDescription.Normal; + #if !_WORLDSPACENORMAL + surfaceData.normalWS = mul(surfaceDescription.Normal, fragInputs.tangentToWorld); + #else + normalTS = mul(fragInputs.tangentToWorld, surfaceDescription.Normal); + surfaceData.normalWS = surfaceDescription.Normal; + #endif + + + #if UNITY_VERSION > UNITY_2022_3_12 + ApplyDecalAndGetNormal(fragInputs, posInput, surfaceDescription, normalTS, surfaceData); + #else + #ifdef DECAL_NORMAL_BLENDING + #if HAVE_DECALS + float alpha = 1.0; + alpha = surfaceDescription.Alpha; + if (_EnableDecals) + { + DecalSurfaceData decalSurfaceData = GetDecalSurfaceData(posInput, fragInputs, alpha); + ApplyDecalToSurfaceData(decalSurfaceData, fragInputs.tangentToWorld[2], surfaceData, normalTS); + } + #endif + #else + #if HAVE_DECALS + if (_EnableDecals) + { + float alpha = 1.0; + alpha = surfaceDescription.Alpha; + // Both uses and modifies 'surfaceData.normalWS'. + DecalSurfaceData decalSurfaceData = GetDecalSurfaceData(posInput, fragInputs, alpha); + ApplyDecalToSurfaceData(decalSurfaceData, fragInputs.tangentToWorld[2], surfaceData); + } + #endif + #endif + #endif + + + + surfaceData.geomNormalWS = fragInputs.tangentToWorld[2]; + + surfaceData.tangentWS = normalize(fragInputs.tangentToWorld[0].xyz); // The tangent is not normalize in tangentToWorld for mikkt. TODO: Check if it expected that we normalize with Morten. Tag: SURFACE_GRADIENT + + + bentNormalWS = surfaceData.normalWS; + + surfaceData.tangentWS = Orthonormalize(surfaceData.tangentWS, surfaceData.normalWS); + + #ifdef DEBUG_DISPLAY + if (_DebugMipMapMode != DEBUGMIPMAPMODE_NONE) + { + // TODO: need to update mip info + surfaceData.metallic = 0; + } + + // We need to call ApplyDebugToSurfaceData after filling the surfarcedata and before filling builtinData + // as it can modify attribute use for static lighting + ApplyDebugToSurfaceData(fragInputs.tangentToWorld, surfaceData); + #endif + + // By default we use the ambient occlusion with Tri-ace trick (apply outside) for specular occlusion. + // If user provide bent normal then we process a better term + #if defined(_SPECULAR_OCCLUSION_CUSTOM) + // Just use the value passed through via the slot (not active otherwise) + #elif defined(_SPECULAR_OCCLUSION_FROM_AO_BENT_NORMAL) + // If we have bent normal and ambient occlusion, process a specular occlusion + surfaceData.specularOcclusion = GetSpecularOcclusionFromBentAO(V, bentNormalWS, surfaceData.normalWS, surfaceData.ambientOcclusion, PerceptualSmoothnessToPerceptualRoughness(surfaceData.perceptualSmoothness)); + #elif defined(_AMBIENT_OCCLUSION) && defined(_SPECULAR_OCCLUSION_FROM_AO) + surfaceData.specularOcclusion = GetSpecularOcclusionFromAmbientOcclusion(ClampNdotV(dot(surfaceData.normalWS, V)), surfaceData.ambientOcclusion, PerceptualSmoothnessToRoughness(surfaceData.perceptualSmoothness)); + #endif + + #if defined(_ENABLE_GEOMETRIC_SPECULAR_AA) && !defined(SHADER_STAGE_RAY_TRACING) + surfaceData.perceptualSmoothness = GeometricNormalFiltering(surfaceData.perceptualSmoothness, fragInputs.tangentToWorld[2], surfaceDescription.SpecularAAScreenSpaceVariance, surfaceDescription.SpecularAAThreshold); + #endif + } + + void GetSurfaceAndBuiltinData(VertexToPixel m2ps, FragInputs fragInputs, float3 V, inout PositionInputs posInput, + out SurfaceData surfaceData, out BuiltinData builtinData, inout Surface l, inout ShaderData d + #if NEED_FACING + , bool facing + #endif + ) + { + // Removed since crossfade does not work, probably needs extra material setup. + //#if !defined(SHADER_STAGE_RAY_TRACING) && !defined(_TESSELLATION_DISPLACEMENT) + // #ifdef LOD_FADE_CROSSFADE // enable dithering LOD transition if user select CrossFade transition in LOD group + // LODDitheringTransition(ComputeFadeMaskSeed(V, posInput.positionSS), unity_LODFade.x); + // #endif + //#endif + + + + + d = CreateShaderData(m2ps + #if NEED_FACING + , facing + #endif + ); + + l = (Surface)0; + + l.Albedo = half3(0.5, 0.5, 0.5); + l.Normal = float3(0,0,1); + l.Occlusion = 1; + l.Alpha = 1; + l.SpecularOcclusion = 1; + + #if !defined(SHADER_STAGE_RAY_TRACING) && defined(_DEPTHOFFSET_ON) + l.outputDepth = d.clipPos.z; + #endif + + ChainSurfaceFunction(l, d); + + #if !defined(SHADER_STAGE_RAY_TRACING) && defined(_DEPTHOFFSET_ON) + posInput.deviceDepth = l.outputDepth; + #endif + + #if _UNLIT + //l.Emission = l.Albedo; + //l.Albedo = 0; + l.Normal = half3(0,0,1); + l.Occlusion = 1; + l.Metallic = 0; + l.Specular = 0; + #endif + + surfaceData.geomNormalWS = d.worldSpaceNormal; + surfaceData.tangentWS = d.worldSpaceTangent; + fragInputs.tangentToWorld = d.TBNMatrix; + + float3 bentNormalWS; + + BuildSurfaceData(fragInputs, l, V, posInput, surfaceData, bentNormalWS); + + + float4 lightmapTexCoord1 = fragInputs.texCoord1; + float4 lightmapTexCoord2 = fragInputs.texCoord2; + //#ifdef FRAG_INPUTS_USE_TEXCOORD1 + // float4 lightmapTexCoord1 = fragInputs.texCoord1; + // #else + // float4 lightmapTexCoord1 = float4(0,0,0,0); + // #endif + + // #ifdef FRAG_INPUTS_USE_TEXCOORD2 + // float4 lightmapTexCoord2 = fragInputs.texCoord2; + // #else + // float4 lightmapTexCoord2 = float4(0,0,0,0); + // #endif + + + InitBuiltinData(posInput, l.Alpha, bentNormalWS, -d.worldSpaceNormal, lightmapTexCoord1, lightmapTexCoord2, builtinData); + + + + builtinData.emissiveColor = l.Emission; + + #if defined(_OVERRIDE_BAKEDGI) + builtinData.bakeDiffuseLighting = l.DiffuseGI; + builtinData.backBakeDiffuseLighting = l.BackDiffuseGI; + builtinData.emissiveColor += l.SpecularGI; + #endif + + #if defined(_OVERRIDE_SHADOWMASK) + builtinData.shadowMask0 = l.ShadowMask.x; + builtinData.shadowMask1 = l.ShadowMask.y; + builtinData.shadowMask2 = l.ShadowMask.z; + builtinData.shadowMask3 = l.ShadowMask.w; + #endif + + #ifdef UNITY_VIRTUAL_TEXTURING + //builtinData.vtPackedFeedback = surfaceData.VTPackedFeedback; + #endif + + #if (SHADERPASS == SHADERPASS_DISTORTION) + builtinData.distortion = surfaceData.Distortion; + builtinData.distortionBlur = surfaceData.DistortionBlur; + #endif + + #ifndef SHADER_UNLIT + // PostInitBuiltinData call ApplyDebugToBuiltinData + PostInitBuiltinData(V, posInput, surfaceData, builtinData); + #else + ApplyDebugToBuiltinData(builtinData); + #endif + + RAY_TRACING_OPTIONAL_ALPHA_TEST_PASS + } + + + + #if defined(WRITE_NORMAL_BUFFER) && defined(WRITE_MSAA_DEPTH) + #define SV_TARGET_DECAL SV_Target2 + #elif defined(WRITE_NORMAL_BUFFER) || defined(WRITE_MSAA_DEPTH) + #define SV_TARGET_DECAL SV_Target1 + #else + #define SV_TARGET_DECAL SV_Target0 + #endif + + + void Frag( VertexToPixel v2p + #if defined(SCENESELECTIONPASS) || defined(SCENEPICKINGPASS) + , out float4 outColor : SV_Target0 + #else + #ifdef WRITE_MSAA_DEPTH + // We need the depth color as SV_Target0 for alpha to coverage + , out float4 depthColor : SV_Target0 + #ifdef WRITE_NORMAL_BUFFER + , out float4 outNormalBuffer : SV_Target1 + #endif + #else + #ifdef WRITE_NORMAL_BUFFER + , out float4 outNormalBuffer : SV_Target0 + #endif + #endif + + // Decal buffer must be last as it is bind but we can optionally write into it (based on _DISABLE_DECALS) + #if defined(WRITE_DECAL_BUFFER) && !defined(_DISABLE_DECALS) + , out float4 outDecalBuffer : SV_TARGET_DECAL + #endif + #endif + + #if defined(_DEPTHOFFSET_ON) && !defined(SCENEPICKINGPASS) + , out float outputDepth : DEPTH_OFFSET_SEMANTIC + #endif + #if NEED_FACING + , bool facing : SV_IsFrontFace + #endif + ) + { + UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX(v2p); + FragInputs input = BuildFragInputs(v2p); + + // input.positionSS is SV_Position + PositionInputs posInput = GetPositionInput(input.positionSS.xy, _ScreenSize.zw, input.positionSS.z, input.positionSS.w, input.positionRWS); + + float3 V = GetWorldSpaceNormalizeViewDir(input.positionRWS); + + + SurfaceData surfaceData; + BuiltinData builtinData; + Surface l; + ShaderData d; + GetSurfaceAndBuiltinData(v2p, input, V, posInput, surfaceData, builtinData, l, d + #if NEED_FACING + , facing + #endif + ); + + // to prevent stripping + surfaceData.normalWS *= saturate(l.Albedo.r + 9999); + + #ifdef _DEPTHOFFSET_ON + outputDepth = l.outputDepth; + #endif + + #ifdef SCENESELECTIONPASS + // We use depth prepass for scene selection in the editor, this code allow to output the outline correctly + outColor = float4(_ObjectId, _PassValue, 1.0, 1.0); + #elif defined(SCENEPICKINGPASS) + outColor = unity_SelectionID; + #else + #ifdef WRITE_MSAA_DEPTH + // In case we are rendering in MSAA, reading the an MSAA depth buffer is way too expensive. To avoid that, we export the depth to a color buffer + depthColor = v2p.pos.z; + + #ifdef _ALPHATOMASK_ON + // Alpha channel is used for alpha to coverage + depthColor.a = SharpenAlpha(builtinData.opacity, builtinData.alphaClipTreshold); + #endif // alphatomask + #endif // msaa_depth + + + #if defined(WRITE_NORMAL_BUFFER) + EncodeIntoNormalBuffer(ConvertSurfaceDataToNormalData(surfaceData), outNormalBuffer); + #endif + + #if defined(WRITE_DECAL_BUFFER) && !defined(_DISABLE_DECALS) + DecalPrepassData decalPrepassData; + // We don't have the right to access SurfaceData in a shaderpass. + // However it would be painful to have to add a function like ConvertSurfaceDataToDecalPrepassData() to every Material to return geomNormalWS anyway + // Here we will put the constrain that any Material requiring to support Decal, will need to have geomNormalWS as member of surfaceData (and we already require normalWS anyway) + decalPrepassData.geomNormalWS = surfaceData.geomNormalWS; + decalPrepassData.decalLayerMask = GetMeshRenderingDecalLayer(); + EncodeIntoDecalPrepassBuffer(decalPrepassData, outDecalBuffer); + #endif + #endif + + } + + + + ENDHLSL + } + + + + Pass + { + // based on HDLitPass.template + Name "META" + Tags { "LightMode" = "META" } + + Cull Off + + Tags { "RenderType" = "Opaque" "Queue" = "Geometry" "PreviewType" = "Plane" } + Cull [_CullingOption] + ZWrite [_ZWrite] + ZTest [_ZTestMode] + + + //------------------------------------------------------------------------------------- + // End Render Modes + //------------------------------------------------------------------------------------- + + HLSLPROGRAM + + #pragma target 4.5 + #pragma only_renderers d3d11 playstation xboxone xboxseries vulkan metal switch + + + #pragma multi_compile_instancing + + //#pragma multi_compile_local _ _ALPHATEST_ON + + + + //------------------------------------------------------------------------------------- + // Variant Definitions (active field translations to HDRP defines) + //------------------------------------------------------------------------------------- + // #define _MATERIAL_FEATURE_SUBSURFACE_SCATTERING 1 + // #define _MATERIAL_FEATURE_TRANSMISSION 1 + // #define _MATERIAL_FEATURE_ANISOTROPY 1 + // #define _MATERIAL_FEATURE_IRIDESCENCE 1 + // #define _MATERIAL_FEATURE_SPECULAR_COLOR 1 + #define _ENABLE_FOG_ON_TRANSPARENT 1 + // #define _AMBIENT_OCCLUSION 1 + // #define _SPECULAR_OCCLUSION_FROM_AO 1 + // #define _SPECULAR_OCCLUSION_FROM_AO_BENT_NORMAL 1 + // #define _SPECULAR_OCCLUSION_CUSTOM 1 + // #define _ENERGY_CONSERVING_SPECULAR 1 + // #define _ENABLE_GEOMETRIC_SPECULAR_AA 1 + // #define _HAS_REFRACTION 1 + // #define _REFRACTION_PLANE 1 + // #define _REFRACTION_SPHERE 1 + // #define _DISABLE_DECALS 1 + // #define _DISABLE_SSR 1 + // #define _ADD_PRECOMPUTED_VELOCITY + // #define _WRITE_TRANSPARENT_MOTION_VECTOR 1 + // #define _DEPTHOFFSET_ON 1 + // #define _BLENDMODE_PRESERVE_SPECULAR_LIGHTING 1 + + #define SHADERPASS SHADERPASS_LIGHT_TRANSPORT + #define RAYTRACING_SHADER_GRAPH_HIGH + #define REQUIRE_DEPTH_TEXTURE + #define _PASSMETA 1 + #pragma multi_compile _ LOD_FADE_CROSSFADE + + + #pragma shader_feature_local GLOW_ON + #pragma shader_feature_local FADE_ON + #pragma shader_feature_local OUTBASE_ON + #pragma shader_feature_local ONLYOUTLINE_ON + #pragma shader_feature_local GRADIENT_ON + #pragma shader_feature_local GRADIENT2COL_ON + #pragma shader_feature_local RADIALGRADIENT_ON + #pragma shader_feature_local COLORSWAP_ON + #pragma shader_feature_local HSV_ON + #pragma shader_feature_local CHANGECOLOR_ON + #pragma shader_feature_local CHANGECOLOR2_ON + #pragma shader_feature_local CHANGECOLOR3_ON + #pragma shader_feature_local COLORRAMP_ON + #pragma shader_feature_local GRADIENTCOLORRAMP_ON + #pragma shader_feature_local HITEFFECT_ON + #pragma shader_feature_local NEGATIVE_ON + #pragma shader_feature_local PIXELATE_ON + #pragma shader_feature_local GREYSCALE_ON + #pragma shader_feature_local POSTERIZE_ON + #pragma shader_feature_local BLUR_ON + #pragma shader_feature_local MOTIONBLUR_ON + #pragma shader_feature_local GHOST_ON + #pragma shader_feature_local ALPHAOUTLINE_ON + #pragma shader_feature_local INNEROUTLINE_ON + #pragma shader_feature_local ONLYINNEROUTLINE_ON + #pragma shader_feature_local HOLOGRAM_ON + #pragma shader_feature_local CHROMABERR_ON + #pragma shader_feature_local GLITCH_ON + #pragma shader_feature_local FLICKER_ON + #pragma shader_feature_local SHADOW_ON + #pragma shader_feature_local SHINE_ON + #pragma shader_feature_local CONTRAST_ON + #pragma shader_feature_local OVERLAY_ON + #pragma shader_feature_local OVERLAYMULT_ON + #pragma shader_feature_local DOODLE_ON + #pragma shader_feature_local WIND_ON + #pragma shader_feature_local WAVEUV_ON + #pragma shader_feature_local ROUNDWAVEUV_ON + #pragma shader_feature_local RECTSIZE_ON + #pragma shader_feature_local OFFSETUV_ON + #pragma shader_feature_local CLIPPING_ON + #pragma shader_feature_local RADIALCLIPPING_ON + #pragma shader_feature_local TEXTURESCROLL_ON + #pragma shader_feature_local ZOOMUV_ON + #pragma shader_feature_local DISTORT_ON + #pragma shader_feature_local WARP_ON + #pragma shader_feature_local TWISTUV_ON + #pragma shader_feature_local ROTATEUV_ON + #pragma shader_feature_local POLARUV_ON + #pragma shader_feature_local FISHEYE_ON + #pragma shader_feature_local PINCH_ON + #pragma shader_feature_local SHAKEUV_ON + + #pragma shader_feature_local GLOWTEX_ON + #pragma shader_feature_local OUTTEX_ON + #pragma shader_feature_local OUTDIST_ON + #pragma shader_feature_local OUTBASE8DIR_ON + #pragma shader_feature_local OUTBASEPIXELPERF_ON + #pragma shader_feature_local COLORRAMPOUTLINE_ON + #pragma shader_feature_local GREYSCALEOUTLINE_ON + #pragma shader_feature_local POSTERIZEOUTLINE_ON + #pragma shader_feature_local BLURISHD_ON + #pragma shader_feature_local MANUALWIND_ON + #pragma shader_feature_local ATLAS_ON + #pragma shader_feature_local PREMULTIPLYALPHA_ON + + #pragma shader_feature BILBOARD_ON + #pragma shader_feature BILBOARDY_ON + + #pragma shader_feature NORMALMAP_ON + + + #define _HDRP 1 +#define _USINGTEXCOORD1 1 +#define _USINGTEXCOORD2 1 + + + #pragma vertex Vert + #pragma fragment Frag + + + + + // useful conversion functions to make surface shader code just work + + #define UNITY_DECLARE_TEX2D(name) TEXTURE2D(name); SAMPLER(sampler##name); + #define UNITY_DECLARE_TEX2D_NOSAMPLER(name) TEXTURE2D(name); + #define UNITY_DECLARE_TEX2DARRAY(name) TEXTURE2D_ARRAY(name); SAMPLER(sampler##name); + #define UNITY_DECLARE_TEX2DARRAY_NOSAMPLER(tex) TEXTURE2D_ARRAY(tex); + + #define UNITY_SAMPLE_TEX2DARRAY(tex,coord) SAMPLE_TEXTURE2D_ARRAY(tex, sampler##tex, coord.xy, coord.z) + #define UNITY_SAMPLE_TEX2DARRAY_LOD(tex,coord,lod) SAMPLE_TEXTURE2D_ARRAY_LOD(tex, sampler##tex, coord.xy, coord.z, lod) + #define UNITY_SAMPLE_TEX2D(tex, coord) SAMPLE_TEXTURE2D(tex, sampler##tex, coord) + #define UNITY_SAMPLE_TEX2D_SAMPLER(tex, samp, coord) SAMPLE_TEXTURE2D(tex, sampler##samp, coord) + + #define UNITY_SAMPLE_TEX2D_LOD(tex,coord, lod) SAMPLE_TEXTURE2D_LOD(tex, sampler_##tex, coord, lod) + #define UNITY_SAMPLE_TEX2D_SAMPLER_LOD(tex,samplertex,coord, lod) SAMPLE_TEXTURE2D_LOD (tex, sampler##samplertex,coord, lod) + + #if defined(UNITY_COMPILER_HLSL) + #define UNITY_INITIALIZE_OUTPUT(type,name) name = (type)0; + #else + #define UNITY_INITIALIZE_OUTPUT(type,name) + #endif + + #define sampler2D_float sampler2D + #define sampler2D_half sampler2D + + #undef WorldNormalVector + #define WorldNormalVector(data, normal) mul(normal, data.TBNMatrix) + + #define UnityObjectToWorldNormal(normal) mul(GetObjectToWorldMatrix(), normal) + + #ifndef SHADER_STAGE_FRAGMENT + #if !defined(SHADOW_ULTRA_LOW) && !defined(SHADOW_LOW) && !defined(SHADOW_MEDIUM) && !defined(SHADOW_HIGH) // ultra low come from volumetricLighting.compute + #define SHADOW_MEDIUM + #endif + #if !defined(AREA_SHADOW_LOW) && !defined(AREA_SHADOW_MEDIUM) && !defined(AREA_SHADOW_HIGH) // low come from volumetricLighting.compute + #define AREA_SHADOW_MEDIUM + #endif + #endif + + + +// HDRP Adapter stuff + #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Common.hlsl" + #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Texture.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/ShaderVariables.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/ShaderPass/FragInputs.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/ShaderPass/ShaderPass.cs.hlsl" + #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/TextureStack.hlsl" // Required to be include before we include properties as it define DECLARE_STACK_CB + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/NormalBuffer.hlsl" + +#if UNITY_VERSION >= 202239 + #include "Packages/com.unity.shadergraph/ShaderGraphLibrary/Functions.hlsl" // Need to be here for Gradient struct definition +#else + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/ShaderGraphHeader.hlsl" +#endif + #ifdef RAYTRACING_SHADER_GRAPH_DEFAULT + #define RAYTRACING_SHADER_GRAPH_HIGH + #endif + + #ifdef RAYTRACING_SHADER_GRAPH_RAYTRACED + #define RAYTRACING_SHADER_GRAPH_LOW + #endif + // end + + + + + // If we use subsurface scattering, enable output split lighting (for forward pass) + #if defined(_MATERIAL_FEATURE_SUBSURFACE_SCATTERING) && !defined(_SURFACE_TYPE_TRANSPARENT) + #define OUTPUT_SPLIT_LIGHTING + #endif + + #define HAVE_RECURSIVE_RENDERING + + #if SHADERPASS == SHADERPASS_TRANSPARENT_DEPTH_PREPASS + #if !defined(_DISABLE_SSR_TRANSPARENT) && !defined(SHADER_UNLIT) + #define WRITE_NORMAL_BUFFER + #endif + #endif + + #ifndef DEBUG_DISPLAY + // In case of opaque we don't want to perform the alpha test, it is done in depth prepass and we use depth equal for ztest (setup from UI) + // Don't do it with debug display mode as it is possible there is no depth prepass in this case + #if !defined(_SURFACE_TYPE_TRANSPARENT) && defined(_ALPHATEST) + #if SHADERPASS == SHADERPASS_FORWARD + #define SHADERPASS_FORWARD_BYPASS_ALPHA_TEST + #elif SHADERPASS == SHADERPASS_GBUFFER + #define SHADERPASS_GBUFFER_BYPASS_ALPHA_TEST + #endif + #endif + #endif + + // Define _DEFERRED_CAPABLE_MATERIAL for shader capable to run in deferred pass + #if defined(SHADER_LIT) && !defined(_SURFACE_TYPE_TRANSPARENT) + #define _DEFERRED_CAPABLE_MATERIAL + #endif + + // Translate transparent motion vector define + #if defined(_TRANSPARENT_WRITES_MOTION_VEC) && defined(_SURFACE_TYPE_TRANSPARENT) + #define _WRITE_TRANSPARENT_MOTION_VECTOR + #endif + + + + + CBUFFER_START(UnityPerMaterial) + float _UseShadowThreshold; + float _BlendMode; + float _EnableBlendModePreserveSpecularLighting; + float _RayTracing; + float _RefractionModel; + + + half4 _Color; + half4 _MainTex_ST, _MainTex_TexelSize; + half _Alpha, _AlphaCutoffValue; + + #if ATLAS_ON + half _MinXUV, _MaxXUV, _MinYUV, _MaxYUV; + #endif + + #if GLOW_ON + half4 _GlowColor; + half _Glow, _GlowGlobal; + #endif + + #if HSV_ON + half _HsvShift, _HsvSaturation, _HsvBright; + #endif + + #if DISTORT_ON + half4 _DistortTex_ST; + half _DistortTexXSpeed, _DistortTexYSpeed, _DistortAmount; + #endif + + #if FADE_ON + half4 _FadeBurnColor, _FadeTex_ST, _FadeBurnTex_ST; + half _FadeAmount, _FadeBurnWidth, _FadeBurnTransition,_FadeBurnGlow; + #endif + + #if OUTBASE_ON + half4 _OutlineColor; + half _OutlineAlpha, _OutlineGlow, _OutlineWidth; + int _OutlinePixelWidth; + #endif + + #if OUTTEX_ON + half4 _OutlineTex_ST; + half _OutlineTexXSpeed, _OutlineTexYSpeed; + #endif + + #if OUTDIST_ON + half4 _OutlineDistortTex_ST; + half _OutlineDistortTexXSpeed, _OutlineDistortTexYSpeed, _OutlineDistortAmount; + #endif + + #if ALPHAOUTLINE_ON + half _AlphaOutlineGlow, _AlphaOutlinePower, _AlphaOutlineMinAlpha, _AlphaOutlineBlend; + half4 _AlphaOutlineColor; + #endif + + #if INNEROUTLINE_ON + half _InnerOutlineThickness, _InnerOutlineAlpha, _InnerOutlineGlow; + half4 _InnerOutlineColor; + #endif + + #if GRADIENT_ON + half _GradBlend, _GradBoostX, _GradBoostY; + half4 _GradTopRightCol, _GradTopLeftCol, _GradBotRightCol, _GradBotLeftCol; + #endif + + #if COLORSWAP_ON + half4 _ColorSwapRed, _ColorSwapGreen, _ColorSwapBlue; + half _ColorSwapRedLuminosity, _ColorSwapGreenLuminosity, _ColorSwapBlueLuminosity, _ColorSwapBlend; + #endif + + #if CHANGECOLOR_ON + half4 _ColorChangeNewCol, _ColorChangeTarget; + half _ColorChangeTolerance, _ColorChangeLuminosity; + #endif + #if CHANGECOLOR2_ON + half4 _ColorChangeNewCol2, _ColorChangeTarget2; + half _ColorChangeTolerance2; + #endif + #if CHANGECOLOR3_ON + half4 _ColorChangeNewCol3, _ColorChangeTarget3; + half _ColorChangeTolerance3; + #endif + + #if COLORRAMP_ON + half _ColorRampLuminosity, _ColorRampBlend; + #endif + + #if HITEFFECT_ON + half4 _HitEffectColor; + half _HitEffectGlow, _HitEffectBlend; + #endif + + #if NEGATIVE_ON + half _NegativeAmount; + #endif + + #if PIXELATE_ON + half _PixelateSize; + #endif + + #if GREYSCALE_ON + half _GreyscaleLuminosity, _GreyscaleBlend; + half4 _GreyscaleTintColor; + #endif + + #if POSTERIZE_ON + half _PosterizeNumColors, _PosterizeGamma; + #endif + + #if BLUR_ON + half _BlurIntensity; + #endif + + #if MOTIONBLUR_ON + half _MotionBlurAngle, _MotionBlurDist; + #endif + + #if GHOST_ON + half _GhostColorBoost, _GhostTransparency, _GhostBlend; + #endif + + #if HOLOGRAM_ON + half _HologramStripesAmount, _HologramMinAlpha, _HologramUnmodAmount, _HologramStripesSpeed, _HologramMaxAlpha, _HologramBlend; + half4 _HologramStripeColor; + #endif + + #if CHROMABERR_ON + half _ChromAberrAmount, _ChromAberrAlpha; + #endif + + #if GLITCH_ON + half _GlitchAmount, _GlitchSize; + #endif + + #if FLICKER_ON + half _FlickerFreq, _FlickerPercent, _FlickerAlpha; + #endif + + #if SHADOW_ON + half _ShadowX, _ShadowY, _ShadowAlpha; + half4 _ShadowColor; + #endif + + #if SHINE_ON + half4 _ShineColor; + half _ShineLocation, _ShineRotate, _ShineWidth, _ShineGlow; + #endif + + #if CONTRAST_ON + half _Contrast, _Brightness; + #endif + + #if OVERLAY_ON + half4 _OverlayTex_ST, _OverlayColor; + half _OverlayGlow, _OverlayBlend, _OverlayTextureScrollXSpeed, _OverlayTextureScrollYSpeed; + #endif + + #if DOODLE_ON + half _HandDrawnAmount, _HandDrawnSpeed; + #endif + + #if WIND_ON + half _GrassSpeed, _GrassWind, _GrassManualAnim, _GrassRadialBend; + #endif + + #if WAVEUV_ON + float _WaveAmount, _WaveSpeed, _WaveStrength, _WaveX, _WaveY; + #endif + + #if ROUNDWAVEUV_ON + half _RoundWaveStrength, _RoundWaveSpeed; + #endif + + #if RECTSIZE_ON + half _RectSize; + #endif + + #if OFFSETUV_ON + half _OffsetUvX, _OffsetUvY; + #endif + + #if CLIPPING_ON + half _ClipUvLeft, _ClipUvRight, _ClipUvUp, _ClipUvDown; + #endif + + #if RADIALCLIPPING_ON + half _RadialStartAngle, _RadialClip, _RadialClip2; + #endif + + #if TEXTURESCROLL_ON + half _TextureScrollXSpeed, _TextureScrollYSpeed; + #endif + + #if ZOOMUV_ON + half _ZoomUvAmount; + #endif + + #if WARP_ON + half _WarpStrength, _WarpSpeed, _WarpScale; + #endif + + #if TWISTUV_ON + half _TwistUvAmount, _TwistUvPosX, _TwistUvPosY, _TwistUvRadius; + #endif + + #if ROTATEUV_ON + half _RotateUvAmount; + #endif + + #if FISHEYE_ON + half _FishEyeUvAmount; + #endif + + #if PINCH_ON + half _PinchUvAmount; + #endif + + #if SHAKEUV_ON + half _ShakeUvSpeed, _ShakeUvX, _ShakeUvY; + #endif + + #if NORMALMAP_ON + half _NormalStrength; + #endif + + float _RandomSeed; + + + + + CBUFFER_END + + + + // -- Property used by ScenePickingPass + #ifdef SCENEPICKINGPASS + float4 _SelectionID; + #endif + + // -- Properties used by SceneSelectionPass + #ifdef SCENESELECTIONPASS + int _ObjectId; + int _PassValue; + #endif + + + // data across stages, stripped like the above. + struct VertexToPixel + { + float4 pos : SV_POSITION; + float3 worldPos : TEXCOORD0; + float3 worldNormal : TEXCOORD1; + float4 worldTangent : TEXCOORD2; + float4 texcoord0 : TEXCOORD3; + float4 texcoord1 : TEXCOORD4; + float4 texcoord2 : TEXCOORD5; + // #if %TEXCOORD3REQUIREKEY% + float4 texcoord3 : TEXCOORD6; + // #endif + + // #if %SCREENPOSREQUIREKEY% + // float4 screenPos : TEXCOORD7; + // #endif + + // #if %VERTEXCOLORREQUIREKEY% + float4 vertexColor : COLOR; + // #endif + + // #if %EXTRAV2F0REQUIREKEY% + // float4 extraV2F0 : TEXCOORD8; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // float4 extraV2F1 : TEXCOORD9; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // float4 extraV2F2 : TEXCOORD10; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // float4 extraV2F3 : TEXCOORD11; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // float4 extraV2F4 : TEXCOORD12; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // float4 extraV2F5 : TEXCOORD13; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // float4 extraV2F6 : TEXCOORD14; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // float4 extraV2F7 : TEXCOORD15; + // #endif + + #if UNITY_ANY_INSTANCING_ENABLED + UNITY_VERTEX_INPUT_INSTANCE_ID + #endif // UNITY_ANY_INSTANCING_ENABLED + + #if _HDRP && (_PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR))) + float4 previousPositionCS : TEXCOORD16; // Contain previous transform position (in case of skinning for example) + float4 motionVectorCS : TEXCOORD17; + #endif + + UNITY_VERTEX_OUTPUT_STEREO + }; + + + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Debug/DebugDisplay.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/Material.hlsl" + #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/NormalSurfaceGradient.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/Lit/Lit.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/BuiltinUtilities.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/MaterialUtilities.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/Decal/DecalUtilities.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/Lit/LitDecalData.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/ShaderGraphFunctions.hlsl" + + + + + + // data describing the user output of a pixel + struct Surface + { + half3 Albedo; + half Height; + half3 Normal; + half Smoothness; + half3 Emission; + half Metallic; + half3 Specular; + half Occlusion; + half SpecularPower; // for simple lighting + half Alpha; + float outputDepth; // if written, SV_Depth semantic is used. ShaderData.clipPos.z is unused value + // HDRP Only + half SpecularOcclusion; + half SubsurfaceMask; + half Thickness; + half CoatMask; + half CoatSmoothness; + half Anisotropy; + half IridescenceMask; + half IridescenceThickness; + int DiffusionProfileHash; + float SpecularAAThreshold; + float SpecularAAScreenSpaceVariance; + // requires _OVERRIDE_BAKEDGI to be defined, but is mapped in all pipelines + float3 DiffuseGI; + float3 BackDiffuseGI; + float3 SpecularGI; + float ior; + float3 transmittanceColor; + float atDistance; + float transmittanceMask; + // requires _OVERRIDE_SHADOWMASK to be defines + float4 ShadowMask; + + // for decals + float NormalAlpha; + float MAOSAlpha; + + + }; + + // Data the user declares in blackboard blocks + struct Blackboard + { + + float blackboardDummyData; + }; + + // data the user might need, this will grow to be big. But easy to strip + struct ShaderData + { + float4 clipPos; // SV_POSITION + float3 localSpacePosition; + float3 localSpaceNormal; + float3 localSpaceTangent; + + float3 worldSpacePosition; + float3 worldSpaceNormal; + float3 worldSpaceTangent; + float tangentSign; + + float3 worldSpaceViewDir; + float3 tangentSpaceViewDir; + + float4 texcoord0; + float4 texcoord1; + float4 texcoord2; + float4 texcoord3; + + float2 screenUV; + float4 screenPos; + + float4 vertexColor; + bool isFrontFace; + + float4 extraV2F0; + float4 extraV2F1; + float4 extraV2F2; + float4 extraV2F3; + float4 extraV2F4; + float4 extraV2F5; + float4 extraV2F6; + float4 extraV2F7; + + float3x3 TBNMatrix; + Blackboard blackboard; + }; + + struct VertexData + { + #if SHADER_TARGET > 30 + // uint vertexID : SV_VertexID; + #endif + float4 vertex : POSITION; + float3 normal : NORMAL; + float4 tangent : TANGENT; + float4 texcoord0 : TEXCOORD0; + + // optimize out mesh coords when not in use by user or lighting system + #if _URP && (_USINGTEXCOORD1 || _PASSMETA || _PASSFORWARD || _PASSGBUFFER) + float4 texcoord1 : TEXCOORD1; + #endif + + #if _URP && (_USINGTEXCOORD2 || _PASSMETA || ((_PASSFORWARD || _PASSGBUFFER) && defined(DYNAMICLIGHTMAP_ON))) + float4 texcoord2 : TEXCOORD2; + #endif + + #if _STANDARD && (_USINGTEXCOORD1 || (_PASSMETA || ((_PASSFORWARD || _PASSGBUFFER || _PASSFORWARDADD) && LIGHTMAP_ON))) + float4 texcoord1 : TEXCOORD1; + #endif + #if _STANDARD && (_USINGTEXCOORD2 || (_PASSMETA || ((_PASSFORWARD || _PASSGBUFFER) && DYNAMICLIGHTMAP_ON))) + float4 texcoord2 : TEXCOORD2; + #endif + + + #if _HDRP + float4 texcoord1 : TEXCOORD1; + float4 texcoord2 : TEXCOORD2; + #endif + + // #if %TEXCOORD3REQUIREKEY% + float4 texcoord3 : TEXCOORD3; + // #endif + + // #if %VERTEXCOLORREQUIREKEY% + float4 vertexColor : COLOR; + // #endif + + #if _PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR)) + float3 previousPositionOS : TEXCOORD4; // Contain previous transform position (in case of skinning for example) + #if defined (_ADD_PRECOMPUTED_VELOCITY) + float3 precomputedVelocity : TEXCOORD5; // Add Precomputed Velocity (Alembic computes velocities on runtime side). + #endif + #endif + + UNITY_VERTEX_INPUT_INSTANCE_ID + }; + + struct TessVertex + { + float4 vertex : INTERNALTESSPOS; + float3 normal : NORMAL; + float4 tangent : TANGENT; + float4 texcoord0 : TEXCOORD0; + float4 texcoord1 : TEXCOORD1; + float4 texcoord2 : TEXCOORD2; + + // #if %TEXCOORD3REQUIREKEY% + float4 texcoord3 : TEXCOORD3; + // #endif + + // #if %VERTEXCOLORREQUIREKEY% + float4 vertexColor : COLOR; + // #endif + + // #if %EXTRAV2F0REQUIREKEY% + // float4 extraV2F0 : TEXCOORD5; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // float4 extraV2F1 : TEXCOORD6; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // float4 extraV2F2 : TEXCOORD7; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // float4 extraV2F3 : TEXCOORD8; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // float4 extraV2F4 : TEXCOORD9; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // float4 extraV2F5 : TEXCOORD10; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // float4 extraV2F6 : TEXCOORD11; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // float4 extraV2F7 : TEXCOORD12; + // #endif + + #if _PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR)) + float3 previousPositionOS : TEXCOORD13; // Contain previous transform position (in case of skinning for example) + #if defined (_ADD_PRECOMPUTED_VELOCITY) + float3 precomputedVelocity : TEXCOORD14; + #endif + #endif + + UNITY_VERTEX_INPUT_INSTANCE_ID + UNITY_VERTEX_OUTPUT_STEREO + }; + + struct ExtraV2F + { + float4 extraV2F0; + float4 extraV2F1; + float4 extraV2F2; + float4 extraV2F3; + float4 extraV2F4; + float4 extraV2F5; + float4 extraV2F6; + float4 extraV2F7; + Blackboard blackboard; + float4 time; + }; + + + float3 WorldToTangentSpace(ShaderData d, float3 normal) + { + return mul(d.TBNMatrix, normal); + } + + float3 TangentToWorldSpace(ShaderData d, float3 normal) + { + return mul(normal, d.TBNMatrix); + } + + // in this case, make standard more like SRPs, because we can't fix + // unity_WorldToObject in HDRP, since it already does macro-fu there + + #if _STANDARD + float3 TransformWorldToObject(float3 p) { return mul(unity_WorldToObject, float4(p, 1)); }; + float3 TransformObjectToWorld(float3 p) { return mul(unity_ObjectToWorld, float4(p, 1)); }; + float4 TransformWorldToObject(float4 p) { return mul(unity_WorldToObject, p); }; + float4 TransformObjectToWorld(float4 p) { return mul(unity_ObjectToWorld, p); }; + float4x4 GetWorldToObjectMatrix() { return unity_WorldToObject; } + float4x4 GetObjectToWorldMatrix() { return unity_ObjectToWorld; } + #if (defined(SHADER_API_D3D11) || defined(SHADER_API_XBOXONE) || defined(UNITY_COMPILER_HLSLCC) || defined(SHADER_API_PSSL) || (SHADER_TARGET_SURFACE_ANALYSIS && !SHADER_TARGET_SURFACE_ANALYSIS_MOJOSHADER)) + #define UNITY_SAMPLE_TEX2D_LOD(tex,coord, lod) tex.SampleLevel (sampler##tex,coord, lod) + #define UNITY_SAMPLE_TEX2D_SAMPLER_LOD(tex,samplertex,coord, lod) tex.SampleLevel (sampler##samplertex,coord, lod) + #else + #define UNITY_SAMPLE_TEX2D_LOD(tex,coord,lod) tex2D (tex,coord,0,lod) + #define UNITY_SAMPLE_TEX2D_SAMPLER_LOD(tex,samplertex,coord,lod) tex2D (tex,coord,0,lod) + #endif + + #undef GetWorldToObjectMatrix() + + #define GetWorldToObjectMatrix() unity_WorldToObject + + + #endif + + float3 GetCameraWorldPosition() + { + #if _HDRP + return GetCameraRelativePositionWS(_WorldSpaceCameraPos); + #else + return _WorldSpaceCameraPos; + #endif + } + + #if _GRABPASSUSED + #if _STANDARD + TEXTURE2D(%GRABTEXTURE%); + SAMPLER(sampler_%GRABTEXTURE%); + #endif + + half3 GetSceneColor(float2 uv) + { + #if _STANDARD + return SAMPLE_TEXTURE2D(%GRABTEXTURE%, sampler_%GRABTEXTURE%, uv).rgb; + #else + return SHADERGRAPH_SAMPLE_SCENE_COLOR(uv); + #endif + } + #endif + + + + #if _STANDARD + UNITY_DECLARE_DEPTH_TEXTURE(_CameraDepthTexture); + float GetSceneDepth(float2 uv) { return SAMPLE_DEPTH_TEXTURE(_CameraDepthTexture, uv); } + float GetLinear01Depth(float2 uv) { return Linear01Depth(GetSceneDepth(uv)); } + float GetLinearEyeDepth(float2 uv) { return LinearEyeDepth(GetSceneDepth(uv)); } + #else + float GetSceneDepth(float2 uv) { return SHADERGRAPH_SAMPLE_SCENE_DEPTH(uv); } + float GetLinear01Depth(float2 uv) { return Linear01Depth(GetSceneDepth(uv), _ZBufferParams); } + float GetLinearEyeDepth(float2 uv) { return LinearEyeDepth(GetSceneDepth(uv), _ZBufferParams); } + #endif + + float3 GetWorldPositionFromDepthBuffer(float2 uv, float3 worldSpaceViewDir) + { + float eye = GetLinearEyeDepth(uv); + float3 camView = mul((float3x3)GetObjectToWorldMatrix(), transpose(mul(GetWorldToObjectMatrix(), UNITY_MATRIX_I_V)) [2].xyz); + + float dt = dot(worldSpaceViewDir, camView); + float3 div = worldSpaceViewDir/dt; + float3 wpos = (eye * div) + GetCameraWorldPosition(); + return wpos; + } + + #if _HDRP + float3 ObjectToWorldSpacePosition(float3 pos) + { + return GetAbsolutePositionWS(TransformObjectToWorld(pos)); + } + #else + float3 ObjectToWorldSpacePosition(float3 pos) + { + return TransformObjectToWorld(pos); + } + #endif + + #if _STANDARD + UNITY_DECLARE_SCREENSPACE_TEXTURE(_CameraDepthNormalsTexture); + float3 GetSceneNormal(float2 uv, float3 worldSpaceViewDir) + { + float4 depthNorms = UNITY_SAMPLE_SCREENSPACE_TEXTURE(_CameraDepthNormalsTexture, uv); + float3 norms = DecodeViewNormalStereo(depthNorms); + norms = mul((float3x3)GetWorldToViewMatrix(), norms) * 0.5 + 0.5; + return norms; + } + #elif _HDRP && !_DECALSHADER + + float3 GetSceneNormal(float2 uv, float3 worldSpaceViewDir) + { + NormalData nd; + DecodeFromNormalBuffer(_ScreenSize.xy * uv, nd); + return nd.normalWS; + } + #elif _URP + #if (SHADER_LIBRARY_VERSION_MAJOR >= 10) + #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/DeclareNormalsTexture.hlsl" + #endif + + float3 GetSceneNormal(float2 uv, float3 worldSpaceViewDir) + { + #if (SHADER_LIBRARY_VERSION_MAJOR >= 10) + return SampleSceneNormals(uv); + #else + float3 wpos = GetWorldPositionFromDepthBuffer(uv, worldSpaceViewDir); + return normalize(-cross(ddx(wpos), ddy(wpos))) * 0.5 + 0.5; + #endif + + } + #endif + + #if _HDRP + + half3 UnpackNormalmapRGorAG(half4 packednormal) + { + // This do the trick + packednormal.x *= packednormal.w; + + half3 normal; + normal.xy = packednormal.xy * 2 - 1; + normal.z = sqrt(1 - saturate(dot(normal.xy, normal.xy))); + return normal; + } + half3 UnpackNormal(half4 packednormal) + { + #if defined(UNITY_NO_DXT5nm) + return packednormal.xyz * 2 - 1; + #else + return UnpackNormalmapRGorAG(packednormal); + #endif + } + #endif + #if _HDRP || _URP + + half3 UnpackScaleNormal(half4 packednormal, half scale) + { + #ifndef UNITY_NO_DXT5nm + // Unpack normal as DXT5nm (1, y, 1, x) or BC5 (x, y, 0, 1) + // Note neutral texture like "bump" is (0, 0, 1, 1) to work with both plain RGB normal and DXT5nm/BC5 + packednormal.x *= packednormal.w; + #endif + half3 normal; + normal.xy = (packednormal.xy * 2 - 1) * scale; + normal.z = sqrt(1 - saturate(dot(normal.xy, normal.xy))); + return normal; + } + + #endif + + + void GetSun(out float3 lightDir, out float3 color) + { + lightDir = float3(0.5, 0.5, 0); + color = 1; + #if _HDRP + if (_DirectionalLightCount > 0) + { + DirectionalLightData light = _DirectionalLightDatas[0]; + lightDir = -light.forward.xyz; + color = light.color; + } + #elif _STANDARD + lightDir = normalize(_WorldSpaceLightPos0.xyz); + color = _LightColor0.rgb; + #elif _URP + Light light = GetMainLight(); + lightDir = light.direction; + color = light.color; + #endif + } + + + + + + + + + + TEXTURE2D(_MainTex); + SAMPLER(sampler_MainTex); + + #if GLOW_ON + TEXTURE2D(_GlowTex); + SAMPLER(sampler_GlowTex); + #endif + + #if FADE_ON + TEXTURE2D(_FadeTex); + SAMPLER(sampler_FadeTex); + + TEXTURE2D(_FadeBurnTex); + SAMPLER(sampler_FadeBurnTex); + #endif + + #if DISTORT_ON + TEXTURE2D(_DistortTex); + SAMPLER(sampler_DistortTex); + #endif + + #if OUTTEX_ON + TEXTURE2D(_OutlineTex); + SAMPLER(sampler_OutlineTex); + #endif + + #if OUTDIST_ON + TEXTURE2D(_OutlineDistortTex); + SAMPLER(sampler_OutlineDistortTex); + #endif + + #if COLORSWAP_ON + TEXTURE2D(_ColorSwapTex); + SAMPLER(sampler_ColorSwapTex); + #endif + + #if COLORRAMP_ON + TEXTURE2D(_ColorRampTex); + TEXTURE2D(_ColorRampTexGradient); + SAMPLER(sampler_ColorRampTex); + SAMPLER(sampler_ColorRampTexGradient); + #endif + + #if SHINE_ON + TEXTURE2D(_ShineMask); + SAMPLER(sampler_ShineMask); + #endif + + #if OVERLAY_ON + TEXTURE2D(_OverlayTex); + SAMPLER(sampler_OverlayTex); + #endif + + #if NORMALMAP_ON + TEXTURE2D(_NormalMap); + SAMPLER(sampler_NormalMap); + #endif + + + half3 GetPixel(in int offsetX, in int offsetY, in half2 uv, in Texture2D _tex, in SamplerState _sampler) + { + half2 _uv = uv + half2(offsetX * _MainTex_TexelSize.x, offsetY * _MainTex_TexelSize.y); + half4 col = SAMPLE_TEXTURE2D(_tex, _sampler, _uv); + return col.rgb; + } + + + //BLURS------------------------------------------------------------------------- + half4 Blur(half2 uv, Texture2D source, SamplerState sampler_source, half Intensity) + { + const half2 texelSize = 1.0 / _ScreenParams.xy; + const half4 color = SAMPLE_TEXTURE2D(source, sampler_source, uv); + const half2 offset = Intensity * texelSize; + + half4 accumulatedColor = color; + half accumulatedWeight = 1.0; + for (int x = -1; x <= 1; x++) + { + for (int y = -1; y <= 1; y++) + { + const half2 sampleUV = uv + half2(x, y) * offset; + const half4 sampleColor = SAMPLE_TEXTURE2D(source, sampler_source, sampleUV); + + accumulatedColor += sampleColor; + accumulatedWeight += 1.0; + } + } + + half4 blurredColor = accumulatedColor / accumulatedWeight; + return blurredColor; + } + + half BlurHD_G(half bhqp, half x) + { + return exp(-(x * x) / (2.0 * bhqp * bhqp)); + } + half4 BlurHD(half2 uv, Texture2D source, SamplerState sampler_source, half BlurAmount, half xScale, half yScale) + { + int iterations = 16; + int halfIterations = iterations / 2; + half sigmaX = 0.1 + BlurAmount * 0.5; + half sigmaY = sigmaX; + half total = 0.0; + half4 ret = half4(0, 0, 0, 0); + for (int iy = 0; iy < iterations; ++iy) + { + half fy = BlurHD_G(sigmaY, half(iy) -half(halfIterations)); + half offsetY = half(iy - halfIterations) * 0.00390625 * xScale; + for (int ix = 0; ix < iterations; ++ix) + { + half fx = BlurHD_G(sigmaX, half(ix) - half(halfIterations)); + half offsetX = half(ix - halfIterations) * 0.00390625 * yScale; + total += fx * fy; + ret += SAMPLE_TEXTURE2D(source, sampler_source, uv + half2(offsetX, offsetY)) * fx * fy; + } + } + return ret / total; + } + //----------------------------------------------------------------------- + + + //------------------------------------------- + half RemapFloat(half inValue, half inMin, half inMax, half outMin, half outMax){ + return outMin + (inValue - inMin) * (outMax - outMin) / (inMax - inMin); + } + //------------------------------------------- + + //----------------------------------------------------------------------- + half rand(half2 seed, half offset) { + return (frac(sin(dot(seed, half2(12.9898, 78.233))) * 43758.5453) + offset) % 1.0; + } + + half rand2(half2 seed, half offset) { + return (frac(sin(dot(seed * floor(50 + (_Time.x % 1.0) * 12.), half2(127.1, 311.7))) * 43758.5453123) + offset) % 1.0; + } + + half rand2CustomTime(half2 seed, half offset, half customTime) { + return (frac(sin(dot(seed * floor(50 + (customTime % 1.0) * 12.), half2(127.1, 311.7))) * 43758.5453123) + offset) % 1.0; + } + //----------------------------------------------------------------------- + + + void Ext_ModifyVertex0 (inout VertexData v, inout ExtraV2F d) + { + //BILBOARD_ON + #if BILBOARD_ON + half3 camRight = mul((half3x3)unity_CameraToWorld, half3(1,0,0)); + half3 camUp = half3(0,1,0); + #if BILBOARDY_ON + camUp = mul((half3x3)unity_CameraToWorld, half3(0,1,0)); + #endif + half3 localPos = v.vertex.x * camRight + v.vertex.y * camUp; + v.vertex = half4(localPos, 1); + #endif + //----------------------------------------------------------- + + v.texcoord0.xy = TRANSFORM_TEX(v.texcoord0.xy, _MainTex); + half2 center = half2(0.5, 0.5); + #if ATLAS_ON + center = half2((_MaxXUV + _MinXUV) / 2.0, (_MaxYUV + _MinYUV) / 2.0); + #endif + + //POLARUV_ON + #if POLARUV_ON + v.texcoord0.xy = v.texcoord0.xy - center; + #endif + + //---------------------------------------- + + //ROTATEUV_ON + #if ROTATEUV_ON + half2 uvC = v.texcoord0.xy; + half cosAngle = cos(_RotateUvAmount); + half sinAngle = sin(_RotateUvAmount); + half2x2 rot = half2x2(cosAngle, -sinAngle, sinAngle, cosAngle); + uvC -= center; + v.texcoord0.xy = mul(rot, uvC); + v.texcoord0.xy += center; + #endif + //-------------------- + + #if RECTSIZE_ON + v.vertex.xyz += (v.vertex.xyz * (_RectSize - 1.0)); + #endif + + #if OUTTEX_ON + v.texcoord1.xy = TRANSFORM_TEX(v.texcoord0.xy, _OutlineTex); + #endif + + #if OUTDIST_ON + v.texcoord2.xy = TRANSFORM_TEX(v.texcoord0.xy, _OutlineDistortTex); + #endif + + #if DISTORT_ON + v.texcoord3.xy = TRANSFORM_TEX(v.texcoord0.xy, _DistortTex); + #endif + } + + void Ext_SurfaceFunction0 (inout Surface o, ShaderData d) + { + half randomSeed = _RandomSeed; + + float2 uvRect = d.texcoord0; + half2 center = half2(0.5, 0.5); + #if ATLAS_ON + center = half2((_MaxXUV + _MinXUV) / 2.0, (_MaxYUV + _MinYUV) / 2.0); + uvRect = half2((d.texcoord0.x - _MinXUV) / (_MaxXUV - _MinXUV), (d.texcoord0.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half2 centerTiled = half2(center.x * _MainTex_ST.x, center.y * _MainTex_ST.y); + + //CLIPPING_ON + #if CLIPPING_ON + half2 tiledUv = half2(d.texcoord0.x / _MainTex_ST.x, d.texcoord0.y / _MainTex_ST.y); + #if ATLAS_ON + tiledUv = half2((tiledUv.x - _MinXUV) / (_MaxXUV - _MinXUV), (tiledUv.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + clip((1 - _ClipUvUp) - tiledUv.y); + clip(tiledUv.y - _ClipUvDown); + clip((1 - _ClipUvRight) - tiledUv.x); + clip(tiledUv.x - _ClipUvLeft); + #endif + //---------------------------------- + + //RADIALCLIPPING_ON + #if RADIALCLIPPING_ON + half2 tiledUv2 = half2(d.texcoord0.x / _MainTex_ST.x, d.texcoord0.y / _MainTex_ST.y); + #if ATLAS_ON + tiledUv2 = half2((tiledUv2.x - _MinXUV) / (_MaxXUV - _MinXUV), (tiledUv2.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half startAngle = _RadialStartAngle - _RadialClip; + half endAngle = _RadialStartAngle + _RadialClip2; + half offset0 = clamp(0, 360, startAngle + 360); + half offset360 = clamp(0, 360, endAngle - 360); + half2 atan2Coord = half2(lerp(-1, 1, tiledUv2.x), lerp(-1, 1, tiledUv2.y)); + half atanAngle = atan2(atan2Coord.y, atan2Coord.x) * 57.3; // angle in degrees + if(atanAngle < 0) atanAngle = 360 + atanAngle; + if(atanAngle >= startAngle && atanAngle <= endAngle) discard; + if(atanAngle <= offset360) discard; + if(atanAngle >= offset0) discard; + #endif + + //----------------------------- + + //TEXTURESCROLL_ON && ATLAS_ON + #if TEXTURESCROLL_ON && ATLAS_ON + d.texcoord0.xy = half2(_MinXUV + ((_MaxXUV - _MinXUV) * (abs(((_Time.y + randomSeed) * _TextureScrollXSpeed) + uvRect.x) % 1)), + _MinYUV + ((_MaxYUV - _MinYUV) * (abs(((_Time.y + randomSeed) * _TextureScrollYSpeed) + uvRect.y) % 1))); + #endif + //---------------------------- + + //OFFSETUV_ON + #if OFFSETUV_ON + #if ATLAS_ON + d.texcoord0.xy = half2(_MinXUV + ((_MaxXUV - _MinXUV) * (abs((_OffsetUvX + uvRect.x) % 1))), + _MinYUV + ((_MaxYUV - _MinYUV) * (abs(_OffsetUvY + uvRect.y) % 1))); + #else + d.texcoord0.xy += half2(_OffsetUvX, _OffsetUvY); + #endif + #endif + + //---------------------- + + //POLARUV_ON + #if POLARUV_ON + d.texcoord0.xy = half2(atan2(d.texcoord0.y, d.texcoord0.x) / (2.0f * 3.141592653589f), length(d.texcoord0.xy)); + d.texcoord0.xy *= _MainTex_ST.xy; + #endif + + //-------------------------------------- + + //TWISTUV_ON + #if TWISTUV_ON + #if ATLAS_ON + _TwistUvPosX = ((_MaxXUV - _MinXUV) * _TwistUvPosX) + _MinXUV; + _TwistUvPosY = ((_MaxYUV - _MinYUV) * _TwistUvPosY) + _MinYUV; + #endif + half2 tempUv = d.texcoord0.xy - half2(_TwistUvPosX * _MainTex_ST.x, _TwistUvPosY * _MainTex_ST.y); + _TwistUvRadius *= (_MainTex_ST.x + _MainTex_ST.y) / 2; + half percent = (_TwistUvRadius - length(tempUv)) / _TwistUvRadius; + half theta = percent * percent * (2.0 * sin(_TwistUvAmount)) * 8.0; + half s = sin(theta); + half c = cos(theta); + half beta = max(sign(_TwistUvRadius - length(tempUv)), 0.0); + tempUv = half2(dot(tempUv, half2(c, -s)), dot(tempUv, half2(s, c))) * beta + tempUv * (1 - beta); + tempUv += half2(_TwistUvPosX * _MainTex_ST.x, _TwistUvPosY * _MainTex_ST.y); + d.texcoord0.xy = tempUv; + #endif + + //-------------------------------------------- + + //FISHEYE_ON + #if FISHEYE_ON + half bind = length(centerTiled); + half2 dF = d.texcoord0.xy - centerTiled; + half dFlen = length(dF); + half fishInt = (3.14159265359 / bind) * (_FishEyeUvAmount + 0.001); + d.texcoord0.xy = centerTiled + (dF / (max(0.0001, dFlen))) * tan(dFlen * fishInt) * bind / tan(bind * fishInt); + #endif + //--------------------------------------------- + + //PINCH_ON + #if PINCH_ON + half2 dP = d.texcoord0.xy - centerTiled; + half pinchInt = (3.141592 / length(centerTiled)) * (-_PinchUvAmount + 0.001); + d.texcoord0.xy = centerTiled + normalize(dP) * atan(length(dP) * -pinchInt * 10.0) * 0.5 / atan(-pinchInt * 5); + #endif + + //--------------------------------------------- + + //ZOOMUV_ON + #if ZOOMUV_ON + d.texcoord0.xy -= centerTiled; + d.texcoord0.xy = d.texcoord0.xy * _ZoomUvAmount; + d.texcoord0.xy += centerTiled; + #endif + + //----------------------------------------------- + + //DOODLE_ON + #if DOODLE_ON + half2 uvCopy = uvRect; + _HandDrawnSpeed = (floor((_Time.x + randomSeed) * 20 * _HandDrawnSpeed) / _HandDrawnSpeed) * _HandDrawnSpeed; + uvCopy.x = sin((uvCopy.x * _HandDrawnAmount + _HandDrawnSpeed) * 4); + uvCopy.y = cos((uvCopy.y * _HandDrawnAmount + _HandDrawnSpeed) * 4); + d.texcoord0.xy = lerp(d.texcoord0.xy, d.texcoord0.xy + uvCopy, 0.0005 * _HandDrawnAmount); + #endif + + //-------------------------- + + //SHAKEUV_ON + #if SHAKEUV_ON + half xShake = sin((_Time.x + randomSeed) * _ShakeUvSpeed * 50) * _ShakeUvX; + half yShake = cos((_Time.x + randomSeed) * _ShakeUvSpeed * 50) * _ShakeUvY; + d.texcoord0.xy += half2(xShake * 0.012, yShake * 0.01); + #endif + + //------------------------------------------- + + //RECTSIZE_ON + #if RECTSIZE_ON + d.texcoord0.xy = d.texcoord0.xy * (_RectSize).xx + (((-_RectSize * 0.5) + 0.5)).xx; + #endif + + //------------------------------------------- + + //DISTORT_ON + #if DISTORT_ON + #if ATLAS_ON + d.texcoord3.x = d.texcoord3.x * (1 / (_MaxXUV - _MinXUV)); + d.texcoord3.y = d.texcoord3.y * (1 / (_MaxYUV - _MinYUV)); + #endif + + d.texcoord3.x += ((_Time.x + _RandomSeed) * _DistortTexXSpeed) % 1; + d.texcoord3.y += ((_Time.x + _RandomSeed) * _DistortTexYSpeed) % 1; + half distortAmnt = (SAMPLE_TEXTURE2D(_DistortTex, sampler_DistortTex, d.texcoord3.xy).r - 0.5) * 0.2 * _DistortAmount; + d.texcoord0.x += distortAmnt; + d.texcoord0.y += distortAmnt; + #endif + //------------------------------------------------------- + + //WARP_ON + #if WARP_ON + half2 warpUv = half2(d.texcoord0.x / _MainTex_ST.x, d.texcoord0.y / _MainTex_ST.y); + #if ATLAS_ON + warpUv = half2((warpUv.x - _MinXUV) / (_MaxXUV - _MinXUV), (warpUv.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + const float tau = 6.283185307179586; + float xWarp = (_Time.y + randomSeed) * _WarpSpeed + warpUv.x * tau / _WarpScale; + float yWarp = (_Time.y + randomSeed) * _WarpSpeed + warpUv.y * tau / _WarpScale; + float2 warp = float2(sin(xWarp), sin(yWarp)) * _WarpStrength; + d.texcoord0.xy += warp; + #endif + + //------------------------------------------------------- + + //WAVEUV_ON + #if WAVEUV_ON + float2 uvWave = half2(_WaveX * _MainTex_ST.x, _WaveY * _MainTex_ST.y) - d.texcoord0.xy; + uvWave %= 1; + #if ATLAS_ON + uvWave = half2(_WaveX, _WaveY) - uvRect; + #endif + uvWave.x *= _ScreenParams.x / _ScreenParams.y; + float waveTime = _Time.y + randomSeed; + float angWave = (sqrt(dot(uvWave, uvWave)) * _WaveAmount) - ((waveTime * _WaveSpeed)); + d.texcoord0.xy = d.texcoord0.xy + uvWave * sin(angWave) * (_WaveStrength / 1000.0); + #endif + //---------------------------------------------------- + + //ROUNDWAVEUV_ON + #if ROUNDWAVEUV_ON + half xWave = ((0.5 * _MainTex_ST.x) - uvRect.x); + half yWave = ((0.5 * _MainTex_ST.y) - uvRect.y) * (_MainTex_TexelSize.w / _MainTex_TexelSize.z); + half ripple = -sqrt(xWave*xWave + yWave* yWave); + d.texcoord0.xy += (sin((ripple + (_Time.y + randomSeed) * (_RoundWaveSpeed/10.0)) / 0.015) * (_RoundWaveStrength/10.0)) % 1; + #endif + //---------------------------------------------------- + + + //WIND_ON + #if WIND_ON + half windOffset = sin((_Time.x + randomSeed) * _GrassSpeed * 10); + half2 windCenter = half2(0.5, 0.1); + #if ATLAS_ON + windCenter.x = ((_MaxXUV - _MinXUV) * windCenter.x) + _MinXUV; + windCenter.y = ((_MaxYUV - _MinYUV) * windCenter.y) + _MinYUV; + #endif + #if !MANUALWIND_ON + d.texcoord0.x = fmod(abs(lerp(d.texcoord0.x, d.texcoord0.x + (_GrassWind * 0.01 * windOffset), uvRect.y)), 1); + #else + d.texcoord0.x = fmod(abs(lerp(d.texcoord0.x, d.texcoord0.x + (_GrassWind * 0.01 * _GrassManualAnim), uvRect.y)), 1); + windOffset = _GrassManualAnim; + #endif + half2 delta = d.texcoord0.xy - windCenter; + half delta2 = dot(delta.xy, delta.xy); + half2 delta_offset = delta2 * windOffset; + d.texcoord0.xy = d.texcoord0.xy + half2(delta.y, -delta.x) * delta_offset * _GrassRadialBend; + #endif + + //-------------------------------------------------------- + + //TEXTURESCROLL_ON && !ATLAS_ON + #if TEXTURESCROLL_ON && !ATLAS_ON + d.texcoord0.x += ((_Time.y + randomSeed) * _TextureScrollXSpeed) % 1; + d.texcoord0.y += ((_Time.y + randomSeed) * _TextureScrollYSpeed) % 1; + #endif + //------------------------------ + + //PIXELATE_ON + #if PIXELATE_ON + half aspectRatio = _MainTex_TexelSize.x / _MainTex_TexelSize.y; + half2 pixelSize = float2(_PixelateSize, _PixelateSize * aspectRatio); + d.texcoord0.xy = floor(d.texcoord0.xy * pixelSize) / pixelSize; + #endif + //-------------- + + half4 col = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy); + half originalAlpha = col.a; + col *= d.vertexColor; + + //NORMAL MAP + #if NORMALMAP_ON + half4 normalSample = SAMPLE_TEXTURE2D(_NormalMap, sampler_NormalMap, d.texcoord0.xy); + half3 normalTS = UnpackNormal(normalSample); + normalTS.xy *= _NormalStrength; + o.Normal = normalTS; + #endif + + + //GLITCH_ON + #if GLITCH_ON + half2 uvGlitch = uvRect; + uvGlitch.y -= 0.5; + half lineNoise = pow(rand2(floor(uvGlitch * half2(24., 19.) * _GlitchSize) * 4.0, randomSeed), 3.0) * _GlitchAmount + * pow(rand2(floor(uvGlitch * half2(38., 14.) * _GlitchSize) * 4.0, randomSeed), 3.0); + col = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(lineNoise * 0.02 * rand2(half2(2.0, 1), randomSeed), 0)) * d.vertexColor; + #endif + //-------------------------------------- + + //CHROMABERR_ON + #if CHROMABERR_ON + half4 r = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(_ChromAberrAmount/10, 0)) * d.vertexColor; + half4 b = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(-_ChromAberrAmount/10, 0)) * d.vertexColor; + col = half4(r.r * r.a, col.g, b.b * b.a, max(max(r.a, b.a) * _ChromAberrAlpha, col.a)); + #endif + + //-------------------------------- + + //BLUR_ON + #if BLUR_ON + #if ATLAS_ON + #if !BLURISHD_ON + col = BlurHD(d.texcoord0.xy, _MainTex, sampler_MainTex, _BlurIntensity, (_MaxXUV - _MinXUV), (_MaxYUV - _MinYUV)) * d.vertexColor; + #else + col = Blur(d.texcoord0.xy, _MainTex, sampler_MainTex, _BlurIntensity * (_MaxXUV - _MinXUV)) * d.vertexColor; + #endif + #else + #if !BLURISHD_ON + col = BlurHD(d.texcoord0.xy, _MainTex, sampler_MainTex, _BlurIntensity, 1, 1) * d.vertexColor; + #else + col = Blur(d.texcoord0.xy, _MainTex, sampler_MainTex, _BlurIntensity) * d.vertexColor; + #endif + #endif + #endif + + //-------------------- + + //MOTIONBLUR_ON + #if MOTIONBLUR_ON + _MotionBlurAngle = _MotionBlurAngle * 3.1415926; + #define rot(n) mul(n, half2x2(cos(_MotionBlurAngle), -sin(_MotionBlurAngle), sin(_MotionBlurAngle), cos(_MotionBlurAngle))) + _MotionBlurDist = _MotionBlurDist * 0.005; + #if ATLAS_ON + _MotionBlurDist *= (_MaxXUV - _MinXUV); + #endif + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(-_MotionBlurDist, -_MotionBlurDist))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(-_MotionBlurDist * 2, -_MotionBlurDist * 2))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(-_MotionBlurDist * 3, -_MotionBlurDist * 3))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(-_MotionBlurDist * 4, -_MotionBlurDist * 4))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(_MotionBlurDist, _MotionBlurDist))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(_MotionBlurDist * 2, _MotionBlurDist * 2))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(_MotionBlurDist * 3, _MotionBlurDist * 3))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(_MotionBlurDist * 4, _MotionBlurDist * 4))); + col.rgb = col.rgb / 9; + #endif + //------------------------------------ + + //NEGATIVE_ON + #if NEGATIVE_ON + col.rgb = lerp(col.rgb, 1 - col.rgb, _NegativeAmount); + #endif + + //-------------- + half luminance = 0; + + //GREYSCALE_ON && !GREYSCALEOUTLINE_ON + #if GREYSCALE_ON && !GREYSCALEOUTLINE_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + luminance = saturate(luminance + _GreyscaleLuminosity); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _GreyscaleTintColor, _GreyscaleBlend); + #endif + //------------------------------------ + + //GHOST_ON + #if GHOST_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + half4 ghostResult; + ghostResult.a = saturate(luminance - _GhostTransparency) * col.a; + ghostResult.rgb = col.rgb * (luminance + _GhostColorBoost); + col = lerp(col, ghostResult, _GhostBlend); + #endif + //------------------------------------ + + //INNEROUTLINE_ON + #if INNEROUTLINE_ON + half3 innerT = abs(GetPixel(0, _InnerOutlineThickness, d.texcoord0.xy, _MainTex, sampler_MainTex) - GetPixel(0, -_InnerOutlineThickness, d.texcoord0.xy, _MainTex, sampler_MainTex)); + innerT += abs(GetPixel(_InnerOutlineThickness, 0, d.texcoord0.xy, _MainTex, sampler_MainTex) - GetPixel(-_InnerOutlineThickness, 0, d.texcoord0.xy, _MainTex, sampler_MainTex)); + #if !ONLYINNEROUTLINE_ON + innerT = (innerT / 2.0) * col.a * _InnerOutlineAlpha; + col.rgb += length(innerT) * _InnerOutlineColor.rgb * _InnerOutlineGlow; + #else + innerT *= col.a * _InnerOutlineAlpha; + col.rgb = length(innerT) * _InnerOutlineColor.rgb * _InnerOutlineGlow; + col.a = step(0.3, col.r+col.g+col.b); + #endif + #endif + //------------------------------------------------------- + + //HITEFFECT_ON + #if HITEFFECT_ON + col.rgb = lerp(col.rgb, _HitEffectColor.rgb * _HitEffectGlow, _HitEffectBlend); + #endif + //-------------------- + + //GRADIENT_ON + #if GRADIENT_ON + half2 tiledUvGrad = half2(uvRect.x / _MainTex_ST.x, uvRect.y / _MainTex_ST.y); + #if GRADIENT2COL_ON + _GradTopRightCol = _GradTopLeftCol; + _GradBotRightCol = _GradBotLeftCol; + #endif + #if RADIALGRADIENT_ON + half radialDist = 1 - length(tiledUvGrad - half2(0.5, 0.5)); + radialDist *= (_MainTex_TexelSize.w / _MainTex_TexelSize.z); + radialDist = saturate(_GradBoostX * radialDist); + half4 gradientResult = lerp(_GradTopLeftCol, _GradBotLeftCol, radialDist); + #else + half gradXLerpFactor = saturate(pow(tiledUvGrad.x, _GradBoostX)); + half4 gradientResult = lerp(lerp(_GradBotLeftCol, _GradBotRightCol, gradXLerpFactor), + lerp(_GradTopLeftCol, _GradTopRightCol, gradXLerpFactor), saturate(pow(tiledUvGrad.y, _GradBoostY))); + #endif + gradientResult = lerp(col, gradientResult, _GradBlend); + col.rgb = gradientResult.rgb * col.a; + col.a *= gradientResult.a; + #endif + //-------------------------------------------------------------------- + + //CONTRAST_ON + #if CONTRAST_ON + col.rgb = (col.rgb - float3(0.5, 0.5, 0.5)) * _Contrast + float3(0.5, 0.5, 0.5); + col.rgb += _Brightness; + #endif + + //------------------------------------------------------------------- + + //COLORSWAP_ON + #if COLORSWAP_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + half4 swapMask = SAMPLE_TEXTURE2D(_ColorSwapTex, sampler_ColorSwapTex, d.texcoord0.xy); + swapMask.rgb *= swapMask.a; + half3 redSwap = _ColorSwapRed * swapMask.r * saturate(luminance + _ColorSwapRedLuminosity); + half3 greenSwap = _ColorSwapGreen * swapMask.g * saturate(luminance + _ColorSwapGreenLuminosity); + half3 blueSwap = _ColorSwapBlue * swapMask.b * saturate(luminance + _ColorSwapBlueLuminosity); + swapMask.rgb = col.rgb * saturate(1 - swapMask.r - swapMask.g - swapMask.b); + col.rgb = lerp(col.rgb, swapMask.rgb + redSwap + greenSwap + blueSwap, _ColorSwapBlend); + #endif + //-------------------------------------------------------------------- + + //COLORRAMP_ON && !COLORRAMPOUTLINE_ON + #if COLORRAMP_ON && !COLORRAMPOUTLINE_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + luminance = saturate(luminance + _ColorRampLuminosity); + #if GRADIENTCOLORRAMP_ON + col.rgb = lerp(col.rgb, SAMPLE_TEXTURE2D(_ColorRampTexGradient, sampler_ColorRampTexGradient, half2(luminance, 0)).rgb, _ColorRampBlend); + #else + col.rgb = lerp(col.rgb, SAMPLE_TEXTURE2D(_ColorRampTex, sampler_ColorRampTex, half2(luminance, 0)).rgb, _ColorRampBlend); + #endif + #endif + //-------------------------------------------------------------------- + + //CHANGECOLOR_ON + #if CHANGECOLOR_ON + float3 currChangeColor = saturate(col.rgb); + luminance = 0.3 * currChangeColor.r + 0.59 * currChangeColor.g + 0.11 * currChangeColor.b; + luminance = saturate(luminance + _ColorChangeLuminosity); + half3 dif = abs(currChangeColor - _ColorChangeTarget.rgb); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _ColorChangeNewCol.rgb, + max(sign(1 - saturate(dif.x + dif.y + dif.z) - _ColorChangeTolerance), 0.0)); + #if CHANGECOLOR2_ON + dif = abs(currChangeColor - _ColorChangeTarget2.rgb); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _ColorChangeNewCol2.rgb, + max(sign(1 - saturate(dif.x + dif.y + dif.z) - _ColorChangeTolerance2), 0.0)); + #endif + #if CHANGECOLOR3_ON + dif = abs(currChangeColor - _ColorChangeTarget3.rgb); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _ColorChangeNewCol3.rgb, + max(sign(1 - saturate(dif.x + dif.y + dif.z) - _ColorChangeTolerance3), 0.0)); + #endif + #endif + //------------------------------------------------------- + + //POSTERIZE_ON && !POSTERIZEOUTLINE_ON + #if POSTERIZE_ON && !POSTERIZEOUTLINE_ON + col.rgb = pow(col.rgb, _PosterizeGamma) * _PosterizeNumColors; + col.rgb = floor(col.rgb) / _PosterizeNumColors; + col.rgb = pow(col.rgb, 1.0 / _PosterizeGamma); + #endif + //------------------------------------ + + //HSV_ON + #if HSV_ON + half3 resultHsv = half3(col.rgb); + half cosHsv = _HsvBright * _HsvSaturation * cos(_HsvShift * 3.14159265 / 180); + half sinHsv = _HsvBright * _HsvSaturation * sin(_HsvShift * 3.14159265 / 180); + resultHsv.x = (.299 * _HsvBright + .701 * cosHsv + .168 * sinHsv) * col.x + + (.587 * _HsvBright - .587 * cosHsv + .330 * sinHsv) * col.y + + (.114 * _HsvBright - .114 * cosHsv - .497 * sinHsv) * col.z; + resultHsv.y = (.299 * _HsvBright - .299 * cosHsv - .328 * sinHsv) *col.x + + (.587 * _HsvBright + .413 * cosHsv + .035 * sinHsv) * col.y + + (.114 * _HsvBright - .114 * cosHsv + .292 * sinHsv) * col.z; + resultHsv.z = (.299 * _HsvBright - .3 * cosHsv + 1.25 * sinHsv) * col.x + + (.587 * _HsvBright - .588 * cosHsv - 1.05 * sinHsv) * col.y + + (.114 * _HsvBright + .886 * cosHsv - .203 * sinHsv) * col.z; + col.rgb = resultHsv; + #endif + //------------------------------------------------------- + + //OVERLAY_ON + #if OVERLAY_ON + half2 overlayUvs = d.texcoord0.xy; + overlayUvs.x += ((_Time.y + randomSeed) * _OverlayTextureScrollXSpeed) % 1; + overlayUvs.y += ((_Time.y + randomSeed) * _OverlayTextureScrollYSpeed) % 1; + half4 overlayCol = SAMPLE_TEXTURE2D(_OverlayTex, sampler_OverlayTex, TRANSFORM_TEX(overlayUvs, _OverlayTex)); + overlayCol.rgb *= _OverlayColor.rgb * _OverlayGlow; + #if !OVERLAYMULT_ON + overlayCol.rgb *= overlayCol.a * _OverlayColor.rgb * _OverlayColor.a * _OverlayBlend; + col.rgb += overlayCol.rgb; + #else + overlayCol.a *= _OverlayColor.a; + col = lerp(col, col * overlayCol, _OverlayBlend); + #endif + #endif + + //--------------------------------- + + //OUTBASE_ON + #if OUTBASE_ON + #if OUTBASEPIXELPERF_ON + half2 destUv = half2(_OutlinePixelWidth * _MainTex_TexelSize.x, _OutlinePixelWidth * _MainTex_TexelSize.y); + #else + half2 destUv = half2(_OutlineWidth * _MainTex_TexelSize.x * 200, _OutlineWidth * _MainTex_TexelSize.y * 200); + #endif + + #if OUTDIST_ON + d.texcoord3.x += ((_Time.x + _RandomSeed) * _OutlineDistortTexXSpeed) % 1; + d.texcoord3.y += ((_Time.x + _RandomSeed) * _OutlineDistortTexYSpeed) % 1; + #if ATLAS_ON + d.texcoord3 = half2((d.texcoord3.x - _MinXUV) / (_MaxXUV - _MinXUV), (d.texcoord3.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half outDistortAmnt = (SAMPLE_TEXTURE2D(_OutlineDistortTex, sampler_OutlineDistortTex, d.texcoord3).r - 0.5) * 0.2 * _OutlineDistortAmount; + destUv.x += outDistortAmnt; + destUv.y += outDistortAmnt; + #endif + + half spriteLeft = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(destUv.x, 0)).a; + half spriteRight = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy - half2(destUv.x, 0)).a; + half spriteBottom = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(0, destUv.y)).a; + half spriteTop = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy - half2(0, destUv.y)).a; + half result = spriteLeft + spriteRight + spriteBottom + spriteTop; + + #if OUTBASE8DIR_ON + half spriteTopLeft = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(destUv.x, destUv.y)).a; + half spriteTopRight = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(-destUv.x, destUv.y)).a; + half spriteBotLeft = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(destUv.x, -destUv.y)).a; + half spriteBotRight = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(-destUv.x, -destUv.y)).a; + result = result + spriteTopLeft + spriteTopRight + spriteBotLeft + spriteBotRight; + #endif + + result = step(0.05, saturate(result)); + + #if OUTTEX_ON + d.texcoord1.x += ((_Time.x + _RandomSeed) * _OutlineTexXSpeed) % 1; + d.texcoord1.y += ((_Time.x + _RandomSeed) * _OutlineTexYSpeed) % 1; + #if ATLAS_ON + d.texcoord1 = half2((d.texcoord1.x - _MinXUV) / (_MaxXUV - _MinXUV), (d.texcoord1.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half4 tempOutColor = SAMPLE_TEXTURE2D(_OutlineTex, sampler_OutlineTex, d.texcoord1); + tempOutColor *= _OutlineColor; + _OutlineColor = tempOutColor; + #endif + + result *= (1 - originalAlpha) * _OutlineAlpha; + + half4 outline = _OutlineColor * d.vertexColor.a; + outline.rgb *= _OutlineGlow; + outline.a = result; + #if ONLYOUTLINE_ON + col = outline; + #else + col = lerp(col, outline, result); + #endif + #endif + //------------------------------------------------------- + + //FADE_ON + #if FADE_ON + half2 tiledUvFade1 = TRANSFORM_TEX(d.texcoord0, _FadeTex); + half2 tiledUvFade2 = TRANSFORM_TEX(d.texcoord0, _FadeBurnTex); + #if ATLAS_ON + tiledUvFade1 = half2((tiledUvFade1.x - _MinXUV) / (_MaxXUV - _MinXUV), (tiledUvFade1.y - _MinYUV) / (_MaxYUV - _MinYUV)); + tiledUvFade2 = half2((tiledUvFade2.x - _MinXUV) / (_MaxXUV - _MinXUV), (tiledUvFade2.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half fadeTemp = SAMPLE_TEXTURE2D(_FadeTex, sampler_FadeTex, tiledUvFade1).r; + half fade = smoothstep(_FadeAmount, _FadeAmount + _FadeBurnTransition, fadeTemp); + half fadeBurn = saturate(smoothstep(_FadeAmount - _FadeBurnWidth, _FadeAmount - _FadeBurnWidth + 0.1, fadeTemp) * _FadeAmount); + col.a *= fade; + _FadeBurnColor.rgb *= _FadeBurnGlow; + col += fadeBurn * SAMPLE_TEXTURE2D(_FadeBurnTex, sampler_FadeBurnTex, tiledUvFade2) * _FadeBurnColor * originalAlpha * (1 - col.a); + #endif + //------------------------------------------------------- + + //SHADOW_ON + #if SHADOW_ON + half shadowA = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(_ShadowX, _ShadowY)).a; + half preMultShadowMask = 1 - (saturate(shadowA - col.a) * (1 - col.a)); + col.rgb *= 1 - ((shadowA - col.a) * (1 - col.a)); + col.rgb += (_ShadowColor * shadowA) * (1 - col.a); + col.a = max(shadowA * _ShadowAlpha * d.vertexColor.a, col.a); + #endif + + //------------------------------------------------------- + + //GLOW_ON + #if GLOW_ON + half4 emission; + #if GLOWTEX_ON + emission = SAMPLE_TEXTURE2D(_GlowTex, sampler_GlowTex, d.texcoord0); + #else + emission = col; + #endif + + col.rgb *= _GlowGlobal; + emission.rgb *= emission.a * col.a * _Glow * _GlowColor; + col.rgb += emission.rgb; + #endif + //------------------------------------------------------- + + //COLORRAMP_ON && COLORRAMPOUTLINE_ON + #if COLORRAMP_ON && COLORRAMPOUTLINE_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + luminance = saturate(luminance + _ColorRampLuminosity); + #if GRADIENTCOLORRAMP_ON + col.rgb = lerp(col.rgb, SAMPLE_TEXTURE2D(_ColorRampTexGradient, sampler_ColorRampTexGradient, half2(luminance, 0)).rgb, _ColorRampBlend); + #else + col.rgb = lerp(col.rgb, SAMPLE_TEXTURE2D(_ColorRampTex, sampler_ColorRampTex, half2(luminance, 0)).rgb, _ColorRampBlend); + #endif + #endif + //--------------- + + //GREYSCALE_ON && GREYSCALEOUTLINE_ON + #if GREYSCALE_ON && GREYSCALEOUTLINE_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + luminance = saturate(luminance + _GreyscaleLuminosity); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _GreyscaleTintColor, _GreyscaleBlend); + #endif + + //----------------------------------- + + //POSTERIZE_ON && POSTERIZEOUTLINE_ON + #if POSTERIZE_ON && POSTERIZEOUTLINE_ON + col.rgb = pow(col.rgb, _PosterizeGamma) * _PosterizeNumColors; + col.rgb = floor(col.rgb) / _PosterizeNumColors; + col.rgb = pow(col.rgb, 1.0 / _PosterizeGamma); + #endif + + //----------------------------------- + + //SHINE_ON + #if SHINE_ON + half2 uvShine = uvRect; + half cosAngle = cos(_ShineRotate); + half sinAngle = sin(_ShineRotate); + half2x2 rot = half2x2(cosAngle, -sinAngle, sinAngle, cosAngle); + uvShine -= half2(0.5, 0.5); + uvShine = mul(rot, uvShine); + uvShine += half2(0.5, 0.5); + half shineMask = SAMPLE_TEXTURE2D(_ShineMask, sampler_ShineMask, d.texcoord0.xy).a; + half currentDistanceProjection = (uvShine.x + uvShine.y) / 2; + half whitePower = 1 - (abs(currentDistanceProjection - _ShineLocation) / _ShineWidth); + col.rgb += col.a * whitePower * _ShineGlow * max(sign(currentDistanceProjection - (_ShineLocation - _ShineWidth)), 0.0) + * max(sign((_ShineLocation + _ShineWidth) - currentDistanceProjection), 0.0) * _ShineColor * shineMask; + #endif + + //----------------------------------- + + //HOLOGRAM_ON + #if HOLOGRAM_ON + half totalHologram = _HologramStripesAmount + _HologramUnmodAmount; + half hologramYCoord = ((uvRect.y + (((_Time.x + randomSeed) % 1) * _HologramStripesSpeed)) % totalHologram) / totalHologram; + hologramYCoord = abs(hologramYCoord); + half alpha = RemapFloat(saturate(hologramYCoord - (_HologramUnmodAmount/totalHologram)), 0.0, 1.0, _HologramMinAlpha, saturate(_HologramMaxAlpha)); + half hologramMask = max(sign((_HologramUnmodAmount/totalHologram) - hologramYCoord), 0.0); + half4 hologramResult = col; + hologramResult.a *= lerp(alpha, 1, hologramMask); + hologramResult.rgb *= max(1, _HologramMaxAlpha * max(sign(hologramYCoord - (_HologramUnmodAmount/totalHologram)), 0.0)); + hologramMask = 1 - step(0.01,hologramMask); + hologramResult.rgb += hologramMask * _HologramStripeColor * col.a; + col = lerp(col, hologramResult, _HologramBlend); + #endif + + //----------------------------------- + + //FLICKER_ON + #if FLICKER_ON + col.a *= saturate(col.a * step(frac(0.05 + (_Time.w + randomSeed) * _FlickerFreq), 1 - _FlickerPercent) + _FlickerAlpha); + #endif + //----------------------------------- + + //ALPHACUTOFF_ON + + //ALPHAROUND_ON + + //ALPHAOUTLINE_ON + #if ALPHAOUTLINE_ON + half alphaOutlineRes = pow(1 - col.a, max(_AlphaOutlinePower, 0.0001)) * step(_AlphaOutlineMinAlpha, col.a) * _AlphaOutlineBlend; + col.rgb = lerp(col.rgb, _AlphaOutlineColor.rgb * _AlphaOutlineGlow, alphaOutlineRes); + col.a = lerp(col.a, 1, alphaOutlineRes > 1); + #endif + //------------------------------------------------------- + + //FOG_ON + + //------------------ + + col *= _Color; + o.Albedo = col; + col.a *= _Alpha; + clip(col.a - _AlphaCutoffValue - 0.01); + o.Alpha = _Color.a; + } + + + + + + void ChainSurfaceFunction(inout Surface l, inout ShaderData d) + { + Ext_SurfaceFunction0(l, d); + // Ext_SurfaceFunction1(l, d); + // Ext_SurfaceFunction2(l, d); + // Ext_SurfaceFunction3(l, d); + // Ext_SurfaceFunction4(l, d); + // Ext_SurfaceFunction5(l, d); + // Ext_SurfaceFunction6(l, d); + // Ext_SurfaceFunction7(l, d); + // Ext_SurfaceFunction8(l, d); + // Ext_SurfaceFunction9(l, d); + // Ext_SurfaceFunction10(l, d); + // Ext_SurfaceFunction11(l, d); + // Ext_SurfaceFunction12(l, d); + // Ext_SurfaceFunction13(l, d); + // Ext_SurfaceFunction14(l, d); + // Ext_SurfaceFunction15(l, d); + // Ext_SurfaceFunction16(l, d); + // Ext_SurfaceFunction17(l, d); + // Ext_SurfaceFunction18(l, d); + // Ext_SurfaceFunction19(l, d); + // Ext_SurfaceFunction20(l, d); + // Ext_SurfaceFunction21(l, d); + // Ext_SurfaceFunction22(l, d); + // Ext_SurfaceFunction23(l, d); + // Ext_SurfaceFunction24(l, d); + // Ext_SurfaceFunction25(l, d); + // Ext_SurfaceFunction26(l, d); + // Ext_SurfaceFunction27(l, d); + // Ext_SurfaceFunction28(l, d); + // Ext_SurfaceFunction29(l, d); + } + +#if !_DECALSHADER + + void ChainModifyVertex(inout VertexData v, inout VertexToPixel v2p, float4 time) + { + ExtraV2F d; + + ZERO_INITIALIZE(ExtraV2F, d); + ZERO_INITIALIZE(Blackboard, d.blackboard); + // due to motion vectors in HDRP, we need to use the last + // time in certain spots. So if you are going to use _Time to adjust vertices, + // you need to use this time or motion vectors will break. + d.time = time; + + Ext_ModifyVertex0(v, d); + // Ext_ModifyVertex1(v, d); + // Ext_ModifyVertex2(v, d); + // Ext_ModifyVertex3(v, d); + // Ext_ModifyVertex4(v, d); + // Ext_ModifyVertex5(v, d); + // Ext_ModifyVertex6(v, d); + // Ext_ModifyVertex7(v, d); + // Ext_ModifyVertex8(v, d); + // Ext_ModifyVertex9(v, d); + // Ext_ModifyVertex10(v, d); + // Ext_ModifyVertex11(v, d); + // Ext_ModifyVertex12(v, d); + // Ext_ModifyVertex13(v, d); + // Ext_ModifyVertex14(v, d); + // Ext_ModifyVertex15(v, d); + // Ext_ModifyVertex16(v, d); + // Ext_ModifyVertex17(v, d); + // Ext_ModifyVertex18(v, d); + // Ext_ModifyVertex19(v, d); + // Ext_ModifyVertex20(v, d); + // Ext_ModifyVertex21(v, d); + // Ext_ModifyVertex22(v, d); + // Ext_ModifyVertex23(v, d); + // Ext_ModifyVertex24(v, d); + // Ext_ModifyVertex25(v, d); + // Ext_ModifyVertex26(v, d); + // Ext_ModifyVertex27(v, d); + // Ext_ModifyVertex28(v, d); + // Ext_ModifyVertex29(v, d); + + + // #if %EXTRAV2F0REQUIREKEY% + // v2p.extraV2F0 = d.extraV2F0; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // v2p.extraV2F1 = d.extraV2F1; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // v2p.extraV2F2 = d.extraV2F2; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // v2p.extraV2F3 = d.extraV2F3; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // v2p.extraV2F4 = d.extraV2F4; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // v2p.extraV2F5 = d.extraV2F5; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // v2p.extraV2F6 = d.extraV2F6; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // v2p.extraV2F7 = d.extraV2F7; + // #endif + } + + void ChainModifyTessellatedVertex(inout VertexData v, inout VertexToPixel v2p) + { + ExtraV2F d; + ZERO_INITIALIZE(ExtraV2F, d); + ZERO_INITIALIZE(Blackboard, d.blackboard); + + // #if %EXTRAV2F0REQUIREKEY% + // d.extraV2F0 = v2p.extraV2F0; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // d.extraV2F1 = v2p.extraV2F1; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // d.extraV2F2 = v2p.extraV2F2; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // d.extraV2F3 = v2p.extraV2F3; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // d.extraV2F4 = v2p.extraV2F4; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // d.extraV2F5 = v2p.extraV2F5; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // d.extraV2F6 = v2p.extraV2F6; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // d.extraV2F7 = v2p.extraV2F7; + // #endif + + + // Ext_ModifyTessellatedVertex0(v, d); + // Ext_ModifyTessellatedVertex1(v, d); + // Ext_ModifyTessellatedVertex2(v, d); + // Ext_ModifyTessellatedVertex3(v, d); + // Ext_ModifyTessellatedVertex4(v, d); + // Ext_ModifyTessellatedVertex5(v, d); + // Ext_ModifyTessellatedVertex6(v, d); + // Ext_ModifyTessellatedVertex7(v, d); + // Ext_ModifyTessellatedVertex8(v, d); + // Ext_ModifyTessellatedVertex9(v, d); + // Ext_ModifyTessellatedVertex10(v, d); + // Ext_ModifyTessellatedVertex11(v, d); + // Ext_ModifyTessellatedVertex12(v, d); + // Ext_ModifyTessellatedVertex13(v, d); + // Ext_ModifyTessellatedVertex14(v, d); + // Ext_ModifyTessellatedVertex15(v, d); + // Ext_ModifyTessellatedVertex16(v, d); + // Ext_ModifyTessellatedVertex17(v, d); + // Ext_ModifyTessellatedVertex18(v, d); + // Ext_ModifyTessellatedVertex19(v, d); + // Ext_ModifyTessellatedVertex20(v, d); + // Ext_ModifyTessellatedVertex21(v, d); + // Ext_ModifyTessellatedVertex22(v, d); + // Ext_ModifyTessellatedVertex23(v, d); + // Ext_ModifyTessellatedVertex24(v, d); + // Ext_ModifyTessellatedVertex25(v, d); + // Ext_ModifyTessellatedVertex26(v, d); + // Ext_ModifyTessellatedVertex27(v, d); + // Ext_ModifyTessellatedVertex28(v, d); + // Ext_ModifyTessellatedVertex29(v, d); + + // #if %EXTRAV2F0REQUIREKEY% + // v2p.extraV2F0 = d.extraV2F0; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // v2p.extraV2F1 = d.extraV2F1; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // v2p.extraV2F2 = d.extraV2F2; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // v2p.extraV2F3 = d.extraV2F3; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // v2p.extraV2F4 = d.extraV2F4; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // v2p.extraV2F5 = d.extraV2F5; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // v2p.extraV2F6 = d.extraV2F6; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // v2p.extraV2F7 = d.extraV2F7; + // #endif + } + + void ChainFinalColorForward(inout Surface l, inout ShaderData d, inout half4 color) + { + // Ext_FinalColorForward0(l, d, color); + // Ext_FinalColorForward1(l, d, color); + // Ext_FinalColorForward2(l, d, color); + // Ext_FinalColorForward3(l, d, color); + // Ext_FinalColorForward4(l, d, color); + // Ext_FinalColorForward5(l, d, color); + // Ext_FinalColorForward6(l, d, color); + // Ext_FinalColorForward7(l, d, color); + // Ext_FinalColorForward8(l, d, color); + // Ext_FinalColorForward9(l, d, color); + // Ext_FinalColorForward10(l, d, color); + // Ext_FinalColorForward11(l, d, color); + // Ext_FinalColorForward12(l, d, color); + // Ext_FinalColorForward13(l, d, color); + // Ext_FinalColorForward14(l, d, color); + // Ext_FinalColorForward15(l, d, color); + // Ext_FinalColorForward16(l, d, color); + // Ext_FinalColorForward17(l, d, color); + // Ext_FinalColorForward18(l, d, color); + // Ext_FinalColorForward19(l, d, color); + // Ext_FinalColorForward20(l, d, color); + // Ext_FinalColorForward21(l, d, color); + // Ext_FinalColorForward22(l, d, color); + // Ext_FinalColorForward23(l, d, color); + // Ext_FinalColorForward24(l, d, color); + // Ext_FinalColorForward25(l, d, color); + // Ext_FinalColorForward26(l, d, color); + // Ext_FinalColorForward27(l, d, color); + // Ext_FinalColorForward28(l, d, color); + // Ext_FinalColorForward29(l, d, color); + } + + void ChainFinalGBufferStandard(inout Surface s, inout ShaderData d, inout half4 GBuffer0, inout half4 GBuffer1, inout half4 GBuffer2, inout half4 outEmission, inout half4 outShadowMask) + { + // Ext_FinalGBufferStandard0(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard1(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard2(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard3(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard4(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard5(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard6(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard7(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard8(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard9(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard10(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard11(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard12(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard13(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard14(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard15(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard16(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard17(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard18(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard19(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard20(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard21(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard22(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard23(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard24(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard25(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard26(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard27(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard28(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard29(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + } +#endif + + + + + +#if _DECALSHADER + + ShaderData CreateShaderData(SurfaceDescriptionInputs IN) + { + ShaderData d = (ShaderData)0; + d.TBNMatrix = float3x3(IN.WorldSpaceTangent, IN.WorldSpaceBiTangent, IN.WorldSpaceNormal); + d.worldSpaceNormal = IN.WorldSpaceNormal; + d.worldSpaceTangent = IN.WorldSpaceTangent; + + d.worldSpacePosition = IN.WorldSpacePosition; + d.texcoord0 = IN.uv0.xyxy; + d.screenPos = IN.ScreenPosition; + + d.worldSpaceViewDir = normalize(_WorldSpaceCameraPos - d.worldSpacePosition); + + d.tangentSpaceViewDir = mul(d.TBNMatrix, d.worldSpaceViewDir); + + // these rarely get used, so we back transform them. Usually will be stripped. + #if _HDRP + // d.localSpacePosition = mul(GetWorldToObjectMatrix(), float4(GetCameraRelativePositionWS(d.worldSpacePosition), 1)).xyz; + #else + // d.localSpacePosition = mul(GetWorldToObjectMatrix(), float4(d.worldSpacePosition, 1)).xyz; + #endif + // d.localSpaceNormal = normalize(mul((float3x3)GetWorldToObjectMatrix(), d.worldSpaceNormal)); + // d.localSpaceTangent = normalize(mul((float3x3)GetWorldToObjectMatrix(), d.worldSpaceTangent.xyz)); + + // #if %SCREENPOSREQUIREKEY% + // d.screenUV = (IN.ScreenPosition.xy / max(0.01, IN.ScreenPosition.w)); + // #endif + + return d; + } +#else + + ShaderData CreateShaderData(VertexToPixel i + #if NEED_FACING + , bool facing + #endif + ) + { + ShaderData d = (ShaderData)0; + d.clipPos = i.pos; + d.worldSpacePosition = i.worldPos; + + d.worldSpaceNormal = normalize(i.worldNormal); + d.worldSpaceTangent.xyz = normalize(i.worldTangent.xyz); + + d.tangentSign = i.worldTangent.w * unity_WorldTransformParams.w; + float3 bitangent = cross(d.worldSpaceTangent.xyz, d.worldSpaceNormal) * d.tangentSign; + + d.TBNMatrix = float3x3(d.worldSpaceTangent, -bitangent, d.worldSpaceNormal); + d.worldSpaceViewDir = normalize(_WorldSpaceCameraPos - i.worldPos); + + d.tangentSpaceViewDir = mul(d.TBNMatrix, d.worldSpaceViewDir); + d.texcoord0 = i.texcoord0; + d.texcoord1 = i.texcoord1; + d.texcoord2 = i.texcoord2; + + // #if %TEXCOORD3REQUIREKEY% + d.texcoord3 = i.texcoord3; + // #endif + + // d.isFrontFace = facing; + // #if %VERTEXCOLORREQUIREKEY% + d.vertexColor = i.vertexColor; + // #endif + + // these rarely get used, so we back transform them. Usually will be stripped. + #if _HDRP + // d.localSpacePosition = mul(GetWorldToObjectMatrix(), float4(GetCameraRelativePositionWS(i.worldPos), 1)).xyz; + #else + // d.localSpacePosition = mul(GetWorldToObjectMatrix(), float4(i.worldPos, 1)).xyz; + #endif + // d.localSpaceNormal = normalize(mul((float3x3)GetWorldToObjectMatrix(), i.worldNormal)); + // d.localSpaceTangent = normalize(mul((float3x3)GetWorldToObjectMatrix(), i.worldTangent.xyz)); + + // #if %SCREENPOSREQUIREKEY% + // d.screenPos = i.screenPos; + // d.screenUV = (i.screenPos.xy / i.screenPos.w); + // #endif + + + // #if %EXTRAV2F0REQUIREKEY% + // d.extraV2F0 = i.extraV2F0; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // d.extraV2F1 = i.extraV2F1; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // d.extraV2F2 = i.extraV2F2; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // d.extraV2F3 = i.extraV2F3; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // d.extraV2F4 = i.extraV2F4; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // d.extraV2F5 = i.extraV2F5; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // d.extraV2F6 = i.extraV2F6; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // d.extraV2F7 = i.extraV2F7; + // #endif + + return d; + } + +#endif + + + +#if (SHADERPASS == SHADERPASS_LIGHT_TRANSPORT) + + // This was not in constant buffer in original unity, so keep outiside. But should be in as ShaderRenderPass frequency + float unity_OneOverOutputBoost; + float unity_MaxOutputValue; + + CBUFFER_START(UnityMetaPass) + // x = use uv1 as raster position + // y = use uv2 as raster position + bool4 unity_MetaVertexControl; + + // x = return albedo + // y = return normal + bool4 unity_MetaFragmentControl; + CBUFFER_END + + VertexToPixel Vert(VertexData inputMesh) + { + VertexToPixel output; + ZERO_INITIALIZE(VertexToPixel, output); + UNITY_SETUP_INSTANCE_ID(inputMesh); + UNITY_TRANSFER_INSTANCE_ID(inputMesh, output); + UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(output); + + // Output UV coordinate in vertex shader + float2 uv = float2(0.0, 0.0); + + if (unity_MetaVertexControl.x) + { + uv = inputMesh.texcoord1.xy * unity_LightmapST.xy + unity_LightmapST.zw; + } + else if (unity_MetaVertexControl.y) + { + uv = inputMesh.texcoord2.xy * unity_DynamicLightmapST.xy + unity_DynamicLightmapST.zw; + } + + // OpenGL right now needs to actually use the incoming vertex position + // so we create a fake dependency on it here that haven't any impact. + output.pos = float4(uv * 2.0 - 1.0, inputMesh.vertex.z > 0 ? 1.0e-4 : 0.0, 1.0); + + output.worldPos = TransformObjectToWorld(inputMesh.vertex.xyz).xyz; + + // Normal is required for triplanar mapping + output.worldNormal = TransformObjectToWorldNormal(inputMesh.normal); + // Not required but assign to silent compiler warning + output.worldTangent = float4(1.0, 0.0, 0.0, 0.0); + + output.texcoord0 = inputMesh.texcoord0; + output.texcoord1 = inputMesh.texcoord1; + output.texcoord2 = inputMesh.texcoord2; + // #if %TEXCOORD3REQUIREKEY% + output.texcoord3 = inputMesh.texcoord3; + // #endif + // #if %VERTEXCOLORREQUIREKEY% + output.vertexColor = inputMesh.vertexColor; + // #endif + + return output; + } +#else + + #if (_PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR))) + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/ShaderVariablesMatrixDefsHDCamera.hlsl" + + void MotionVectorPositionZBias(VertexToPixel input) + { + #if UNITY_REVERSED_Z + input.pos.z -= unity_MotionVectorsParams.z * input.pos.w; + #else + input.pos.z += unity_MotionVectorsParams.z * input.pos.w; + #endif + } + + #endif + + VertexToPixel Vert(VertexData input) + { + VertexToPixel output; + ZERO_INITIALIZE(VertexToPixel, output); + + UNITY_SETUP_INSTANCE_ID(input); + UNITY_TRANSFER_INSTANCE_ID(input, output); + UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(output); + + #if _HDRP && (_PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR))) + VertexData previousMesh = input; + #endif + + ChainModifyVertex(input, output, _Time); + + // This return the camera relative position (if enable) + float3 positionRWS = TransformObjectToWorld(input.vertex.xyz); + float3 normalWS = TransformObjectToWorldNormal(input.normal); + float4 tangentWS = float4(TransformObjectToWorldDir(input.tangent.xyz), input.tangent.w); + + + output.worldPos = GetAbsolutePositionWS(positionRWS); + output.pos = TransformWorldToHClip(positionRWS); + output.worldNormal = normalWS; + output.worldTangent = tangentWS; + + + output.texcoord0 = input.texcoord0; + output.texcoord1 = input.texcoord1; + output.texcoord2 = input.texcoord2; + + // #if %TEXCOORD3REQUIREKEY% + output.texcoord3 = input.texcoord3; + // #endif + + // #if %VERTEXCOLORREQUIREKEY% + output.vertexColor = input.vertexColor; + // #endif + + // #if %SCREENPOSREQUIREKEY% + // output.screenPos = ComputeScreenPos(output.pos, _ProjectionParams.x); + // #endif + + #if _HDRP && (_PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR))) + + #if !defined(TESSELLATION_ON) + MotionVectorPositionZBias(output); + #endif + + output.motionVectorCS = mul(UNITY_MATRIX_UNJITTERED_VP, float4(positionRWS.xyz, 1.0)); + // Note: unity_MotionVectorsParams.y is 0 is forceNoMotion is enabled + bool forceNoMotion = unity_MotionVectorsParams.y == 0.0; + if (forceNoMotion) + { + output.previousPositionCS = float4(0.0, 0.0, 0.0, 1.0); + } + else + { + bool hasDeformation = unity_MotionVectorsParams.x > 0.0; // Skin or morph target + + float3 effectivePositionOS = (hasDeformation ? previousMesh.previousPositionOS : previousMesh.vertex.xyz); + #if defined(_ADD_PRECOMPUTED_VELOCITY) + effectivePositionOS -= input.precomputedVelocity; + #endif + + previousMesh.vertex = float4(effectivePositionOS, 1); + VertexToPixel dummy = (VertexToPixel)0; + + + ChainModifyVertex(previousMesh, dummy, _LastTimeParameters); + + // we might need this for skinned objects? + //float3 normalWS = TransformPreviousObjectToWorldNormal(input.normal).xyz; + float3 previousPositionRWS = TransformPreviousObjectToWorld(previousMesh.vertex.xyz); + + #ifdef _WRITE_TRANSPARENT_MOTION_VECTOR + if (_TransparentCameraOnlyMotionVectors > 0) + { + previousPositionRWS = positionRWS.xyz; + } + #endif // _WRITE_TRANSPARENT_MOTION_VECTOR + + output.previousPositionCS = mul(UNITY_MATRIX_PREV_VP, float4(previousPositionRWS, 1.0)); + } + #endif // _HDRP && _PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR)) + + + return output; + } + + +#endif + + + + + + + + #if defined(WRITE_DECAL_BUFFER) && !defined(_DISABLE_DECALS) + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/Decal/DecalPrepassBuffer.hlsl" + #endif + + FragInputs BuildFragInputs(VertexToPixel input) + { + UNITY_SETUP_INSTANCE_ID(input); + FragInputs output; + ZERO_INITIALIZE(FragInputs, output); + + // Init to some default value to make the computer quiet (else it output 'divide by zero' warning even if value is not used). + // TODO: this is a really poor workaround, but the variable is used in a bunch of places + // to compute normals which are then passed on elsewhere to compute other values... + output.tangentToWorld = k_identity3x3; + output.positionSS = input.pos; // input.positionCS is SV_Position + // BETTER SHADERS: because we transform world position into actual world space for things like + // triplanar, etc, we have to back transform it here for lighting + output.positionRWS = GetCameraRelativePositionWS(input.worldPos); + output.tangentToWorld = BuildTangentToWorld(input.worldTangent, input.worldNormal); + output.texCoord0 = input.texcoord0; + output.texCoord1 = input.texcoord1; + output.texCoord2 = input.texcoord2; + + return output; + } + +#if UNITY_VERSION > UNITY_2022_3_12 + void ApplyDecalAndGetNormal(FragInputs fragInputs, PositionInputs posInput, Surface surfaceDescription, float3 normalTS, + inout SurfaceData surfaceData) + { + float3 doubleSidedConstants = GetDoubleSidedConstants(); + + #ifdef DECAL_NORMAL_BLENDING + // SG nodes don't ouptut surface gradients, so if decals require surf grad blending, we have to convert + // the normal to gradient before applying the decal. We then have to resolve the gradient back to world space + normalTS = SurfaceGradientFromTangentSpaceNormalAndFromTBN(normalTS, + fragInputs.tangentToWorld[0], fragInputs.tangentToWorld[1]); + + + #if HAVE_DECALS + if (_EnableDecals) + { + float alpha = 1.0; + alpha = surfaceDescription.Alpha; + + DecalSurfaceData decalSurfaceData = GetDecalSurfaceData(posInput, fragInputs, alpha); + ApplyDecalToSurfaceNormal(decalSurfaceData, fragInputs.tangentToWorld[2], normalTS); + ApplyDecalToSurfaceDataNoNormal(decalSurfaceData, surfaceData); + } + #endif + + GetNormalWS_SG(fragInputs, normalTS, surfaceData.normalWS, doubleSidedConstants); + #else + // normal delivered to master node + + #if HAVE_DECALS + if (_EnableDecals) + { + float alpha = 1.0; + alpha = surfaceDescription.Alpha; + + // Both uses and modifies 'surfaceData.normalWS'. + DecalSurfaceData decalSurfaceData = GetDecalSurfaceData(posInput, fragInputs, alpha); + ApplyDecalToSurfaceNormal(decalSurfaceData, surfaceData.normalWS.xyz); + ApplyDecalToSurfaceDataNoNormal(decalSurfaceData, surfaceData); + } + #endif + #endif + } +#endif + + void BuildSurfaceData(FragInputs fragInputs, inout Surface surfaceDescription, float3 V, PositionInputs posInput, out SurfaceData surfaceData, out float3 bentNormalWS) + { + // setup defaults -- these are used if the graph doesn't output a value + ZERO_INITIALIZE(SurfaceData, surfaceData); + + // specularOcclusion need to be init ahead of decal to quiet the compiler that modify the SurfaceData struct + // however specularOcclusion can come from the graph, so need to be init here so it can be override. + surfaceData.specularOcclusion = 1.0; + + // copy across graph values, if defined + surfaceData.baseColor = surfaceDescription.Albedo; + surfaceData.perceptualSmoothness = surfaceDescription.Smoothness; + surfaceData.ambientOcclusion = surfaceDescription.Occlusion; + surfaceData.specularOcclusion = surfaceDescription.SpecularOcclusion; + surfaceData.metallic = surfaceDescription.Metallic; + surfaceData.subsurfaceMask = surfaceDescription.SubsurfaceMask; + surfaceData.thickness = surfaceDescription.Thickness; + surfaceData.diffusionProfileHash = asuint(surfaceDescription.DiffusionProfileHash); + #if _USESPECULAR + surfaceData.specularColor = surfaceDescription.Specular; + #endif + surfaceData.coatMask = surfaceDescription.CoatMask; + surfaceData.anisotropy = surfaceDescription.Anisotropy; + surfaceData.iridescenceMask = surfaceDescription.IridescenceMask; + surfaceData.iridescenceThickness = surfaceDescription.IridescenceThickness; + + + + #if defined(_REFRACTION_PLANE) || defined(_REFRACTION_SPHERE) || defined(_REFRACTION_THIN) + if (_EnableSSRefraction) + { + surfaceData.transmittanceMask = (1.0 - surfaceDescription.Alpha); + surfaceDescription.Alpha = 1.0; + } + else + { + surfaceData.ior = surfaceDescription.ior; + surfaceData.transmittanceColor = surfaceDescription.transmittanceColor; + surfaceData.atDistance = surfaceDescription.atDistance; + surfaceData.transmittanceMask = surfaceDescription.transmittanceMask; + surfaceDescription.Alpha = 1.0; + } + #else + surfaceData.ior = 1.0; + surfaceData.transmittanceColor = float3(1.0, 1.0, 1.0); + surfaceData.atDistance = 1.0; + surfaceData.transmittanceMask = 0.0; + #endif + + + + // These static material feature allow compile time optimization + surfaceData.materialFeatures = MATERIALFEATUREFLAGS_LIT_STANDARD; + #ifdef _MATERIAL_FEATURE_SUBSURFACE_SCATTERING + surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_SUBSURFACE_SCATTERING; + #endif + + #ifdef _MATERIAL_FEATURE_TRANSMISSION + surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_TRANSMISSION; + #endif + + #ifdef _MATERIAL_FEATURE_ANISOTROPY + surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_ANISOTROPY; + surfaceData.normalWS = float3(0, 1, 0); + #endif + + #ifdef _MATERIAL_FEATURE_IRIDESCENCE + surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_IRIDESCENCE; + #endif + + #ifdef _MATERIAL_FEATURE_SPECULAR_COLOR + surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_SPECULAR_COLOR; + #endif + + #if defined(_MATERIAL_FEATURE_CLEAR_COAT) || _CLEARCOAT + surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_CLEAR_COAT; + #endif + + #if defined (_MATERIAL_FEATURE_SPECULAR_COLOR) && defined (_ENERGY_CONSERVING_SPECULAR) + // Require to have setup baseColor + // Reproduce the energy conservation done in legacy Unity. Not ideal but better for compatibility and users can unchek it + surfaceData.baseColor *= (1.0 - Max3(surfaceData.specularColor.r, surfaceData.specularColor.g, surfaceData.specularColor.b)); + #endif + + float3 normalTS = surfaceDescription.Normal; + #if !_WORLDSPACENORMAL + surfaceData.normalWS = mul(surfaceDescription.Normal, fragInputs.tangentToWorld); + #else + normalTS = mul(fragInputs.tangentToWorld, surfaceDescription.Normal); + surfaceData.normalWS = surfaceDescription.Normal; + #endif + + + #if UNITY_VERSION > UNITY_2022_3_12 + ApplyDecalAndGetNormal(fragInputs, posInput, surfaceDescription, normalTS, surfaceData); + #else + #ifdef DECAL_NORMAL_BLENDING + #if HAVE_DECALS + float alpha = 1.0; + alpha = surfaceDescription.Alpha; + if (_EnableDecals) + { + DecalSurfaceData decalSurfaceData = GetDecalSurfaceData(posInput, fragInputs, alpha); + ApplyDecalToSurfaceData(decalSurfaceData, fragInputs.tangentToWorld[2], surfaceData, normalTS); + } + #endif + #else + #if HAVE_DECALS + if (_EnableDecals) + { + float alpha = 1.0; + alpha = surfaceDescription.Alpha; + // Both uses and modifies 'surfaceData.normalWS'. + DecalSurfaceData decalSurfaceData = GetDecalSurfaceData(posInput, fragInputs, alpha); + ApplyDecalToSurfaceData(decalSurfaceData, fragInputs.tangentToWorld[2], surfaceData); + } + #endif + #endif + #endif + + + + surfaceData.geomNormalWS = fragInputs.tangentToWorld[2]; + + surfaceData.tangentWS = normalize(fragInputs.tangentToWorld[0].xyz); // The tangent is not normalize in tangentToWorld for mikkt. TODO: Check if it expected that we normalize with Morten. Tag: SURFACE_GRADIENT + + + bentNormalWS = surfaceData.normalWS; + + surfaceData.tangentWS = Orthonormalize(surfaceData.tangentWS, surfaceData.normalWS); + + #ifdef DEBUG_DISPLAY + if (_DebugMipMapMode != DEBUGMIPMAPMODE_NONE) + { + // TODO: need to update mip info + surfaceData.metallic = 0; + } + + // We need to call ApplyDebugToSurfaceData after filling the surfarcedata and before filling builtinData + // as it can modify attribute use for static lighting + ApplyDebugToSurfaceData(fragInputs.tangentToWorld, surfaceData); + #endif + + // By default we use the ambient occlusion with Tri-ace trick (apply outside) for specular occlusion. + // If user provide bent normal then we process a better term + #if defined(_SPECULAR_OCCLUSION_CUSTOM) + // Just use the value passed through via the slot (not active otherwise) + #elif defined(_SPECULAR_OCCLUSION_FROM_AO_BENT_NORMAL) + // If we have bent normal and ambient occlusion, process a specular occlusion + surfaceData.specularOcclusion = GetSpecularOcclusionFromBentAO(V, bentNormalWS, surfaceData.normalWS, surfaceData.ambientOcclusion, PerceptualSmoothnessToPerceptualRoughness(surfaceData.perceptualSmoothness)); + #elif defined(_AMBIENT_OCCLUSION) && defined(_SPECULAR_OCCLUSION_FROM_AO) + surfaceData.specularOcclusion = GetSpecularOcclusionFromAmbientOcclusion(ClampNdotV(dot(surfaceData.normalWS, V)), surfaceData.ambientOcclusion, PerceptualSmoothnessToRoughness(surfaceData.perceptualSmoothness)); + #endif + + #if defined(_ENABLE_GEOMETRIC_SPECULAR_AA) && !defined(SHADER_STAGE_RAY_TRACING) + surfaceData.perceptualSmoothness = GeometricNormalFiltering(surfaceData.perceptualSmoothness, fragInputs.tangentToWorld[2], surfaceDescription.SpecularAAScreenSpaceVariance, surfaceDescription.SpecularAAThreshold); + #endif + } + + void GetSurfaceAndBuiltinData(VertexToPixel m2ps, FragInputs fragInputs, float3 V, inout PositionInputs posInput, + out SurfaceData surfaceData, out BuiltinData builtinData, inout Surface l, inout ShaderData d + #if NEED_FACING + , bool facing + #endif + ) + { + // Removed since crossfade does not work, probably needs extra material setup. + //#if !defined(SHADER_STAGE_RAY_TRACING) && !defined(_TESSELLATION_DISPLACEMENT) + // #ifdef LOD_FADE_CROSSFADE // enable dithering LOD transition if user select CrossFade transition in LOD group + // LODDitheringTransition(ComputeFadeMaskSeed(V, posInput.positionSS), unity_LODFade.x); + // #endif + //#endif + + + + + d = CreateShaderData(m2ps + #if NEED_FACING + , facing + #endif + ); + + l = (Surface)0; + + l.Albedo = half3(0.5, 0.5, 0.5); + l.Normal = float3(0,0,1); + l.Occlusion = 1; + l.Alpha = 1; + l.SpecularOcclusion = 1; + + #if !defined(SHADER_STAGE_RAY_TRACING) && defined(_DEPTHOFFSET_ON) + l.outputDepth = d.clipPos.z; + #endif + + ChainSurfaceFunction(l, d); + + #if !defined(SHADER_STAGE_RAY_TRACING) && defined(_DEPTHOFFSET_ON) + posInput.deviceDepth = l.outputDepth; + #endif + + #if _UNLIT + //l.Emission = l.Albedo; + //l.Albedo = 0; + l.Normal = half3(0,0,1); + l.Occlusion = 1; + l.Metallic = 0; + l.Specular = 0; + #endif + + surfaceData.geomNormalWS = d.worldSpaceNormal; + surfaceData.tangentWS = d.worldSpaceTangent; + fragInputs.tangentToWorld = d.TBNMatrix; + + float3 bentNormalWS; + + BuildSurfaceData(fragInputs, l, V, posInput, surfaceData, bentNormalWS); + + + float4 lightmapTexCoord1 = fragInputs.texCoord1; + float4 lightmapTexCoord2 = fragInputs.texCoord2; + //#ifdef FRAG_INPUTS_USE_TEXCOORD1 + // float4 lightmapTexCoord1 = fragInputs.texCoord1; + // #else + // float4 lightmapTexCoord1 = float4(0,0,0,0); + // #endif + + // #ifdef FRAG_INPUTS_USE_TEXCOORD2 + // float4 lightmapTexCoord2 = fragInputs.texCoord2; + // #else + // float4 lightmapTexCoord2 = float4(0,0,0,0); + // #endif + + + InitBuiltinData(posInput, l.Alpha, bentNormalWS, -d.worldSpaceNormal, lightmapTexCoord1, lightmapTexCoord2, builtinData); + + + + builtinData.emissiveColor = l.Emission; + + #if defined(_OVERRIDE_BAKEDGI) + builtinData.bakeDiffuseLighting = l.DiffuseGI; + builtinData.backBakeDiffuseLighting = l.BackDiffuseGI; + builtinData.emissiveColor += l.SpecularGI; + #endif + + #if defined(_OVERRIDE_SHADOWMASK) + builtinData.shadowMask0 = l.ShadowMask.x; + builtinData.shadowMask1 = l.ShadowMask.y; + builtinData.shadowMask2 = l.ShadowMask.z; + builtinData.shadowMask3 = l.ShadowMask.w; + #endif + + #ifdef UNITY_VIRTUAL_TEXTURING + //builtinData.vtPackedFeedback = surfaceData.VTPackedFeedback; + #endif + + #if (SHADERPASS == SHADERPASS_DISTORTION) + builtinData.distortion = surfaceData.Distortion; + builtinData.distortionBlur = surfaceData.DistortionBlur; + #endif + + #ifndef SHADER_UNLIT + // PostInitBuiltinData call ApplyDebugToBuiltinData + PostInitBuiltinData(V, posInput, surfaceData, builtinData); + #else + ApplyDebugToBuiltinData(builtinData); + #endif + + RAY_TRACING_OPTIONAL_ALPHA_TEST_PASS + } + + + float4 Frag(VertexToPixel v2f + #if NEED_FACING + , bool facing : SV_IsFrontFace + #endif + ) : SV_Target + { + FragInputs input = BuildFragInputs(v2f); + + // input.positionSS is SV_Position + PositionInputs posInput = GetPositionInput(input.positionSS.xy, _ScreenSize.zw, input.positionSS.z, input.positionSS.w, input.positionRWS); + + float3 V = GetWorldSpaceNormalizeViewDir(input.positionRWS); + + SurfaceData surfaceData; + BuiltinData builtinData; + Surface l; + ShaderData d; + GetSurfaceAndBuiltinData(v2f, input, V, posInput, surfaceData, builtinData, l, d + #if NEED_FACING + , facing + #endif + ); + + // no debug apply during light transport pass + + BSDFData bsdfData = ConvertSurfaceDataToBSDFData(input.positionSS.xy, surfaceData); + LightTransportData lightTransportData = GetLightTransportData(surfaceData, builtinData, bsdfData); + + // This shader is call two times. Once for getting emissiveColor, the other time to get diffuseColor + // We use unity_MetaFragmentControl to make the distinction. + float4 res = float4(0.0, 0.0, 0.0, 1.0); + + if (unity_MetaFragmentControl.x) + { + // Apply diffuseColor Boost from LightmapSettings. + // put abs here to silent a warning, no cost, no impact as color is assume to be positive. + res.rgb = clamp(pow(abs(lightTransportData.diffuseColor), saturate(unity_OneOverOutputBoost)), 0, unity_MaxOutputValue); + } + + if (unity_MetaFragmentControl.y) + { + // emissive use HDR format + res.rgb = lightTransportData.emissiveColor; + } + + return res; + } + + + + ENDHLSL + } + + Pass + { + // based on HDLitPass.template + Name "SceneSelectionPass" + Tags { "LightMode" = "SceneSelectionPass" } + + Cull Off + ColorMask 0 + + Tags { "RenderType" = "Opaque" "Queue" = "Geometry" "PreviewType" = "Plane" } + Cull [_CullingOption] + ZWrite [_ZWrite] + ZTest [_ZTestMode] + + + HLSLPROGRAM + + #pragma target 4.5 + #pragma only_renderers d3d11 playstation xboxone xboxseries vulkan metal switch + #pragma multi_compile_instancing + #pragma editor_sync_compilation + #pragma instancing_options renderinglayer + + //#pragma shader_feature _ _SURFACE_TYPE_TRANSPARENT + //#pragma shader_feature_local _BLENDMODE_OFF _BLENDMODE_ALPHA _BLENDMODE_ADD _BLENDMODE_PRE_MULTIPLY + //#pragma shader_feature_local _ _ADD_PRECOMPUTED_VELOCITY + //#pragma shader_feature_local _ _TRANSPARENT_WRITES_MOTION_VEC + //#pragma shader_feature_local _ _ENABLE_FOG_ON_TRANSPARENT + //#pragma shader_feature_local _ _DISABLE_DECALS + //#pragma shader_feature_local _ _DISABLE_SSR + //#pragma shader_feature_local _ _DISABLE_SSR_TRANSPARENT + //#pragma shader_feature_local _REFRACTION_OFF _REFRACTION_PLANE _REFRACTION_SPHERE _REFRACTION_THIN + + //------------------------------------------------------------------------------------- + // Variant Definitions (active field translations to HDRP defines) + //------------------------------------------------------------------------------------- + // #define _MATERIAL_FEATURE_SUBSURFACE_SCATTERING 1 + // #define _MATERIAL_FEATURE_TRANSMISSION 1 + // #define _MATERIAL_FEATURE_ANISOTROPY 1 + // #define _MATERIAL_FEATURE_IRIDESCENCE 1 + // #define _MATERIAL_FEATURE_SPECULAR_COLOR 1 + #define _ENABLE_FOG_ON_TRANSPARENT 1 + // #define _AMBIENT_OCCLUSION 1 + // #define _SPECULAR_OCCLUSION_FROM_AO 1 + // #define _SPECULAR_OCCLUSION_FROM_AO_BENT_NORMAL 1 + // #define _SPECULAR_OCCLUSION_CUSTOM 1 + // #define _ENERGY_CONSERVING_SPECULAR 1 + // #define _ENABLE_GEOMETRIC_SPECULAR_AA 1 + // #define _HAS_REFRACTION 1 + // #define _REFRACTION_PLANE 1 + // #define _REFRACTION_SPHERE 1 + // #define _DISABLE_DECALS 1 + // #define _DISABLE_SSR 1 + // #define _ADD_PRECOMPUTED_VELOCITY + // #define _WRITE_TRANSPARENT_MOTION_VECTOR 1 + // #define _DEPTHOFFSET_ON 1 + // #define _BLENDMODE_PRESERVE_SPECULAR_LIGHTING 1 + + #define SHADERPASS SHADERPASS_DEPTH_ONLY + #define RAYTRACING_SHADER_GRAPH_DEFAULT + #define SCENESELECTIONPASS + #define _PASSSCENESELECT 1 + + + #pragma shader_feature_local GLOW_ON + #pragma shader_feature_local FADE_ON + #pragma shader_feature_local OUTBASE_ON + #pragma shader_feature_local ONLYOUTLINE_ON + #pragma shader_feature_local GRADIENT_ON + #pragma shader_feature_local GRADIENT2COL_ON + #pragma shader_feature_local RADIALGRADIENT_ON + #pragma shader_feature_local COLORSWAP_ON + #pragma shader_feature_local HSV_ON + #pragma shader_feature_local CHANGECOLOR_ON + #pragma shader_feature_local CHANGECOLOR2_ON + #pragma shader_feature_local CHANGECOLOR3_ON + #pragma shader_feature_local COLORRAMP_ON + #pragma shader_feature_local GRADIENTCOLORRAMP_ON + #pragma shader_feature_local HITEFFECT_ON + #pragma shader_feature_local NEGATIVE_ON + #pragma shader_feature_local PIXELATE_ON + #pragma shader_feature_local GREYSCALE_ON + #pragma shader_feature_local POSTERIZE_ON + #pragma shader_feature_local BLUR_ON + #pragma shader_feature_local MOTIONBLUR_ON + #pragma shader_feature_local GHOST_ON + #pragma shader_feature_local ALPHAOUTLINE_ON + #pragma shader_feature_local INNEROUTLINE_ON + #pragma shader_feature_local ONLYINNEROUTLINE_ON + #pragma shader_feature_local HOLOGRAM_ON + #pragma shader_feature_local CHROMABERR_ON + #pragma shader_feature_local GLITCH_ON + #pragma shader_feature_local FLICKER_ON + #pragma shader_feature_local SHADOW_ON + #pragma shader_feature_local SHINE_ON + #pragma shader_feature_local CONTRAST_ON + #pragma shader_feature_local OVERLAY_ON + #pragma shader_feature_local OVERLAYMULT_ON + #pragma shader_feature_local DOODLE_ON + #pragma shader_feature_local WIND_ON + #pragma shader_feature_local WAVEUV_ON + #pragma shader_feature_local ROUNDWAVEUV_ON + #pragma shader_feature_local RECTSIZE_ON + #pragma shader_feature_local OFFSETUV_ON + #pragma shader_feature_local CLIPPING_ON + #pragma shader_feature_local RADIALCLIPPING_ON + #pragma shader_feature_local TEXTURESCROLL_ON + #pragma shader_feature_local ZOOMUV_ON + #pragma shader_feature_local DISTORT_ON + #pragma shader_feature_local WARP_ON + #pragma shader_feature_local TWISTUV_ON + #pragma shader_feature_local ROTATEUV_ON + #pragma shader_feature_local POLARUV_ON + #pragma shader_feature_local FISHEYE_ON + #pragma shader_feature_local PINCH_ON + #pragma shader_feature_local SHAKEUV_ON + + #pragma shader_feature_local GLOWTEX_ON + #pragma shader_feature_local OUTTEX_ON + #pragma shader_feature_local OUTDIST_ON + #pragma shader_feature_local OUTBASE8DIR_ON + #pragma shader_feature_local OUTBASEPIXELPERF_ON + #pragma shader_feature_local COLORRAMPOUTLINE_ON + #pragma shader_feature_local GREYSCALEOUTLINE_ON + #pragma shader_feature_local POSTERIZEOUTLINE_ON + #pragma shader_feature_local BLURISHD_ON + #pragma shader_feature_local MANUALWIND_ON + #pragma shader_feature_local ATLAS_ON + #pragma shader_feature_local PREMULTIPLYALPHA_ON + + #pragma shader_feature BILBOARD_ON + #pragma shader_feature BILBOARDY_ON + + #pragma shader_feature NORMALMAP_ON + + + #define _HDRP 1 +#define _USINGTEXCOORD1 1 +#define _USINGTEXCOORD2 1 + + + #pragma vertex Vert + #pragma fragment Frag + + + + + // useful conversion functions to make surface shader code just work + + #define UNITY_DECLARE_TEX2D(name) TEXTURE2D(name); SAMPLER(sampler##name); + #define UNITY_DECLARE_TEX2D_NOSAMPLER(name) TEXTURE2D(name); + #define UNITY_DECLARE_TEX2DARRAY(name) TEXTURE2D_ARRAY(name); SAMPLER(sampler##name); + #define UNITY_DECLARE_TEX2DARRAY_NOSAMPLER(tex) TEXTURE2D_ARRAY(tex); + + #define UNITY_SAMPLE_TEX2DARRAY(tex,coord) SAMPLE_TEXTURE2D_ARRAY(tex, sampler##tex, coord.xy, coord.z) + #define UNITY_SAMPLE_TEX2DARRAY_LOD(tex,coord,lod) SAMPLE_TEXTURE2D_ARRAY_LOD(tex, sampler##tex, coord.xy, coord.z, lod) + #define UNITY_SAMPLE_TEX2D(tex, coord) SAMPLE_TEXTURE2D(tex, sampler##tex, coord) + #define UNITY_SAMPLE_TEX2D_SAMPLER(tex, samp, coord) SAMPLE_TEXTURE2D(tex, sampler##samp, coord) + + #define UNITY_SAMPLE_TEX2D_LOD(tex,coord, lod) SAMPLE_TEXTURE2D_LOD(tex, sampler_##tex, coord, lod) + #define UNITY_SAMPLE_TEX2D_SAMPLER_LOD(tex,samplertex,coord, lod) SAMPLE_TEXTURE2D_LOD (tex, sampler##samplertex,coord, lod) + + #if defined(UNITY_COMPILER_HLSL) + #define UNITY_INITIALIZE_OUTPUT(type,name) name = (type)0; + #else + #define UNITY_INITIALIZE_OUTPUT(type,name) + #endif + + #define sampler2D_float sampler2D + #define sampler2D_half sampler2D + + #undef WorldNormalVector + #define WorldNormalVector(data, normal) mul(normal, data.TBNMatrix) + + #define UnityObjectToWorldNormal(normal) mul(GetObjectToWorldMatrix(), normal) + + #ifndef SHADER_STAGE_FRAGMENT + #if !defined(SHADOW_ULTRA_LOW) && !defined(SHADOW_LOW) && !defined(SHADOW_MEDIUM) && !defined(SHADOW_HIGH) // ultra low come from volumetricLighting.compute + #define SHADOW_MEDIUM + #endif + #if !defined(AREA_SHADOW_LOW) && !defined(AREA_SHADOW_MEDIUM) && !defined(AREA_SHADOW_HIGH) // low come from volumetricLighting.compute + #define AREA_SHADOW_MEDIUM + #endif + #endif + + + +// HDRP Adapter stuff + #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Common.hlsl" + #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Texture.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/ShaderVariables.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/ShaderPass/FragInputs.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/ShaderPass/ShaderPass.cs.hlsl" + #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/TextureStack.hlsl" // Required to be include before we include properties as it define DECLARE_STACK_CB + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/NormalBuffer.hlsl" + +#if UNITY_VERSION >= 202239 + #include "Packages/com.unity.shadergraph/ShaderGraphLibrary/Functions.hlsl" // Need to be here for Gradient struct definition +#else + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/ShaderGraphHeader.hlsl" +#endif + #ifdef RAYTRACING_SHADER_GRAPH_DEFAULT + #define RAYTRACING_SHADER_GRAPH_HIGH + #endif + + #ifdef RAYTRACING_SHADER_GRAPH_RAYTRACED + #define RAYTRACING_SHADER_GRAPH_LOW + #endif + // end + + + + + // If we use subsurface scattering, enable output split lighting (for forward pass) + #if defined(_MATERIAL_FEATURE_SUBSURFACE_SCATTERING) && !defined(_SURFACE_TYPE_TRANSPARENT) + #define OUTPUT_SPLIT_LIGHTING + #endif + + #define HAVE_RECURSIVE_RENDERING + + #if SHADERPASS == SHADERPASS_TRANSPARENT_DEPTH_PREPASS + #if !defined(_DISABLE_SSR_TRANSPARENT) && !defined(SHADER_UNLIT) + #define WRITE_NORMAL_BUFFER + #endif + #endif + + #ifndef DEBUG_DISPLAY + // In case of opaque we don't want to perform the alpha test, it is done in depth prepass and we use depth equal for ztest (setup from UI) + // Don't do it with debug display mode as it is possible there is no depth prepass in this case + #if !defined(_SURFACE_TYPE_TRANSPARENT) && defined(_ALPHATEST) + #if SHADERPASS == SHADERPASS_FORWARD + #define SHADERPASS_FORWARD_BYPASS_ALPHA_TEST + #elif SHADERPASS == SHADERPASS_GBUFFER + #define SHADERPASS_GBUFFER_BYPASS_ALPHA_TEST + #endif + #endif + #endif + + // Define _DEFERRED_CAPABLE_MATERIAL for shader capable to run in deferred pass + #if defined(SHADER_LIT) && !defined(_SURFACE_TYPE_TRANSPARENT) + #define _DEFERRED_CAPABLE_MATERIAL + #endif + + // Translate transparent motion vector define + #if defined(_TRANSPARENT_WRITES_MOTION_VEC) && defined(_SURFACE_TYPE_TRANSPARENT) + #define _WRITE_TRANSPARENT_MOTION_VECTOR + #endif + + + + + CBUFFER_START(UnityPerMaterial) + float _UseShadowThreshold; + float _BlendMode; + float _EnableBlendModePreserveSpecularLighting; + float _RayTracing; + float _RefractionModel; + + + half4 _Color; + half4 _MainTex_ST, _MainTex_TexelSize; + half _Alpha, _AlphaCutoffValue; + + #if ATLAS_ON + half _MinXUV, _MaxXUV, _MinYUV, _MaxYUV; + #endif + + #if GLOW_ON + half4 _GlowColor; + half _Glow, _GlowGlobal; + #endif + + #if HSV_ON + half _HsvShift, _HsvSaturation, _HsvBright; + #endif + + #if DISTORT_ON + half4 _DistortTex_ST; + half _DistortTexXSpeed, _DistortTexYSpeed, _DistortAmount; + #endif + + #if FADE_ON + half4 _FadeBurnColor, _FadeTex_ST, _FadeBurnTex_ST; + half _FadeAmount, _FadeBurnWidth, _FadeBurnTransition,_FadeBurnGlow; + #endif + + #if OUTBASE_ON + half4 _OutlineColor; + half _OutlineAlpha, _OutlineGlow, _OutlineWidth; + int _OutlinePixelWidth; + #endif + + #if OUTTEX_ON + half4 _OutlineTex_ST; + half _OutlineTexXSpeed, _OutlineTexYSpeed; + #endif + + #if OUTDIST_ON + half4 _OutlineDistortTex_ST; + half _OutlineDistortTexXSpeed, _OutlineDistortTexYSpeed, _OutlineDistortAmount; + #endif + + #if ALPHAOUTLINE_ON + half _AlphaOutlineGlow, _AlphaOutlinePower, _AlphaOutlineMinAlpha, _AlphaOutlineBlend; + half4 _AlphaOutlineColor; + #endif + + #if INNEROUTLINE_ON + half _InnerOutlineThickness, _InnerOutlineAlpha, _InnerOutlineGlow; + half4 _InnerOutlineColor; + #endif + + #if GRADIENT_ON + half _GradBlend, _GradBoostX, _GradBoostY; + half4 _GradTopRightCol, _GradTopLeftCol, _GradBotRightCol, _GradBotLeftCol; + #endif + + #if COLORSWAP_ON + half4 _ColorSwapRed, _ColorSwapGreen, _ColorSwapBlue; + half _ColorSwapRedLuminosity, _ColorSwapGreenLuminosity, _ColorSwapBlueLuminosity, _ColorSwapBlend; + #endif + + #if CHANGECOLOR_ON + half4 _ColorChangeNewCol, _ColorChangeTarget; + half _ColorChangeTolerance, _ColorChangeLuminosity; + #endif + #if CHANGECOLOR2_ON + half4 _ColorChangeNewCol2, _ColorChangeTarget2; + half _ColorChangeTolerance2; + #endif + #if CHANGECOLOR3_ON + half4 _ColorChangeNewCol3, _ColorChangeTarget3; + half _ColorChangeTolerance3; + #endif + + #if COLORRAMP_ON + half _ColorRampLuminosity, _ColorRampBlend; + #endif + + #if HITEFFECT_ON + half4 _HitEffectColor; + half _HitEffectGlow, _HitEffectBlend; + #endif + + #if NEGATIVE_ON + half _NegativeAmount; + #endif + + #if PIXELATE_ON + half _PixelateSize; + #endif + + #if GREYSCALE_ON + half _GreyscaleLuminosity, _GreyscaleBlend; + half4 _GreyscaleTintColor; + #endif + + #if POSTERIZE_ON + half _PosterizeNumColors, _PosterizeGamma; + #endif + + #if BLUR_ON + half _BlurIntensity; + #endif + + #if MOTIONBLUR_ON + half _MotionBlurAngle, _MotionBlurDist; + #endif + + #if GHOST_ON + half _GhostColorBoost, _GhostTransparency, _GhostBlend; + #endif + + #if HOLOGRAM_ON + half _HologramStripesAmount, _HologramMinAlpha, _HologramUnmodAmount, _HologramStripesSpeed, _HologramMaxAlpha, _HologramBlend; + half4 _HologramStripeColor; + #endif + + #if CHROMABERR_ON + half _ChromAberrAmount, _ChromAberrAlpha; + #endif + + #if GLITCH_ON + half _GlitchAmount, _GlitchSize; + #endif + + #if FLICKER_ON + half _FlickerFreq, _FlickerPercent, _FlickerAlpha; + #endif + + #if SHADOW_ON + half _ShadowX, _ShadowY, _ShadowAlpha; + half4 _ShadowColor; + #endif + + #if SHINE_ON + half4 _ShineColor; + half _ShineLocation, _ShineRotate, _ShineWidth, _ShineGlow; + #endif + + #if CONTRAST_ON + half _Contrast, _Brightness; + #endif + + #if OVERLAY_ON + half4 _OverlayTex_ST, _OverlayColor; + half _OverlayGlow, _OverlayBlend, _OverlayTextureScrollXSpeed, _OverlayTextureScrollYSpeed; + #endif + + #if DOODLE_ON + half _HandDrawnAmount, _HandDrawnSpeed; + #endif + + #if WIND_ON + half _GrassSpeed, _GrassWind, _GrassManualAnim, _GrassRadialBend; + #endif + + #if WAVEUV_ON + float _WaveAmount, _WaveSpeed, _WaveStrength, _WaveX, _WaveY; + #endif + + #if ROUNDWAVEUV_ON + half _RoundWaveStrength, _RoundWaveSpeed; + #endif + + #if RECTSIZE_ON + half _RectSize; + #endif + + #if OFFSETUV_ON + half _OffsetUvX, _OffsetUvY; + #endif + + #if CLIPPING_ON + half _ClipUvLeft, _ClipUvRight, _ClipUvUp, _ClipUvDown; + #endif + + #if RADIALCLIPPING_ON + half _RadialStartAngle, _RadialClip, _RadialClip2; + #endif + + #if TEXTURESCROLL_ON + half _TextureScrollXSpeed, _TextureScrollYSpeed; + #endif + + #if ZOOMUV_ON + half _ZoomUvAmount; + #endif + + #if WARP_ON + half _WarpStrength, _WarpSpeed, _WarpScale; + #endif + + #if TWISTUV_ON + half _TwistUvAmount, _TwistUvPosX, _TwistUvPosY, _TwistUvRadius; + #endif + + #if ROTATEUV_ON + half _RotateUvAmount; + #endif + + #if FISHEYE_ON + half _FishEyeUvAmount; + #endif + + #if PINCH_ON + half _PinchUvAmount; + #endif + + #if SHAKEUV_ON + half _ShakeUvSpeed, _ShakeUvX, _ShakeUvY; + #endif + + #if NORMALMAP_ON + half _NormalStrength; + #endif + + float _RandomSeed; + + + + + CBUFFER_END + + + + // -- Property used by ScenePickingPass + #ifdef SCENEPICKINGPASS + float4 _SelectionID; + #endif + + // -- Properties used by SceneSelectionPass + #ifdef SCENESELECTIONPASS + int _ObjectId; + int _PassValue; + #endif + + + // data across stages, stripped like the above. + struct VertexToPixel + { + float4 pos : SV_POSITION; + float3 worldPos : TEXCOORD0; + float3 worldNormal : TEXCOORD1; + float4 worldTangent : TEXCOORD2; + float4 texcoord0 : TEXCOORD3; + float4 texcoord1 : TEXCOORD4; + float4 texcoord2 : TEXCOORD5; + // #if %TEXCOORD3REQUIREKEY% + float4 texcoord3 : TEXCOORD6; + // #endif + + // #if %SCREENPOSREQUIREKEY% + // float4 screenPos : TEXCOORD7; + // #endif + + // #if %VERTEXCOLORREQUIREKEY% + float4 vertexColor : COLOR; + // #endif + + // #if %EXTRAV2F0REQUIREKEY% + // float4 extraV2F0 : TEXCOORD8; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // float4 extraV2F1 : TEXCOORD9; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // float4 extraV2F2 : TEXCOORD10; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // float4 extraV2F3 : TEXCOORD11; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // float4 extraV2F4 : TEXCOORD12; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // float4 extraV2F5 : TEXCOORD13; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // float4 extraV2F6 : TEXCOORD14; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // float4 extraV2F7 : TEXCOORD15; + // #endif + + #if UNITY_ANY_INSTANCING_ENABLED + UNITY_VERTEX_INPUT_INSTANCE_ID + #endif // UNITY_ANY_INSTANCING_ENABLED + + #if _HDRP && (_PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR))) + float4 previousPositionCS : TEXCOORD16; // Contain previous transform position (in case of skinning for example) + float4 motionVectorCS : TEXCOORD17; + #endif + + UNITY_VERTEX_OUTPUT_STEREO + }; + + + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Debug/DebugDisplay.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/Material.hlsl" + #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/NormalSurfaceGradient.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/Lit/Lit.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/BuiltinUtilities.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/MaterialUtilities.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/Decal/DecalUtilities.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/Lit/LitDecalData.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/ShaderGraphFunctions.hlsl" + + + + + // data describing the user output of a pixel + struct Surface + { + half3 Albedo; + half Height; + half3 Normal; + half Smoothness; + half3 Emission; + half Metallic; + half3 Specular; + half Occlusion; + half SpecularPower; // for simple lighting + half Alpha; + float outputDepth; // if written, SV_Depth semantic is used. ShaderData.clipPos.z is unused value + // HDRP Only + half SpecularOcclusion; + half SubsurfaceMask; + half Thickness; + half CoatMask; + half CoatSmoothness; + half Anisotropy; + half IridescenceMask; + half IridescenceThickness; + int DiffusionProfileHash; + float SpecularAAThreshold; + float SpecularAAScreenSpaceVariance; + // requires _OVERRIDE_BAKEDGI to be defined, but is mapped in all pipelines + float3 DiffuseGI; + float3 BackDiffuseGI; + float3 SpecularGI; + float ior; + float3 transmittanceColor; + float atDistance; + float transmittanceMask; + // requires _OVERRIDE_SHADOWMASK to be defines + float4 ShadowMask; + + // for decals + float NormalAlpha; + float MAOSAlpha; + + + }; + + // Data the user declares in blackboard blocks + struct Blackboard + { + + float blackboardDummyData; + }; + + // data the user might need, this will grow to be big. But easy to strip + struct ShaderData + { + float4 clipPos; // SV_POSITION + float3 localSpacePosition; + float3 localSpaceNormal; + float3 localSpaceTangent; + + float3 worldSpacePosition; + float3 worldSpaceNormal; + float3 worldSpaceTangent; + float tangentSign; + + float3 worldSpaceViewDir; + float3 tangentSpaceViewDir; + + float4 texcoord0; + float4 texcoord1; + float4 texcoord2; + float4 texcoord3; + + float2 screenUV; + float4 screenPos; + + float4 vertexColor; + bool isFrontFace; + + float4 extraV2F0; + float4 extraV2F1; + float4 extraV2F2; + float4 extraV2F3; + float4 extraV2F4; + float4 extraV2F5; + float4 extraV2F6; + float4 extraV2F7; + + float3x3 TBNMatrix; + Blackboard blackboard; + }; + + struct VertexData + { + #if SHADER_TARGET > 30 + // uint vertexID : SV_VertexID; + #endif + float4 vertex : POSITION; + float3 normal : NORMAL; + float4 tangent : TANGENT; + float4 texcoord0 : TEXCOORD0; + + // optimize out mesh coords when not in use by user or lighting system + #if _URP && (_USINGTEXCOORD1 || _PASSMETA || _PASSFORWARD || _PASSGBUFFER) + float4 texcoord1 : TEXCOORD1; + #endif + + #if _URP && (_USINGTEXCOORD2 || _PASSMETA || ((_PASSFORWARD || _PASSGBUFFER) && defined(DYNAMICLIGHTMAP_ON))) + float4 texcoord2 : TEXCOORD2; + #endif + + #if _STANDARD && (_USINGTEXCOORD1 || (_PASSMETA || ((_PASSFORWARD || _PASSGBUFFER || _PASSFORWARDADD) && LIGHTMAP_ON))) + float4 texcoord1 : TEXCOORD1; + #endif + #if _STANDARD && (_USINGTEXCOORD2 || (_PASSMETA || ((_PASSFORWARD || _PASSGBUFFER) && DYNAMICLIGHTMAP_ON))) + float4 texcoord2 : TEXCOORD2; + #endif + + + #if _HDRP + float4 texcoord1 : TEXCOORD1; + float4 texcoord2 : TEXCOORD2; + #endif + + // #if %TEXCOORD3REQUIREKEY% + float4 texcoord3 : TEXCOORD3; + // #endif + + // #if %VERTEXCOLORREQUIREKEY% + float4 vertexColor : COLOR; + // #endif + + #if _PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR)) + float3 previousPositionOS : TEXCOORD4; // Contain previous transform position (in case of skinning for example) + #if defined (_ADD_PRECOMPUTED_VELOCITY) + float3 precomputedVelocity : TEXCOORD5; // Add Precomputed Velocity (Alembic computes velocities on runtime side). + #endif + #endif + + UNITY_VERTEX_INPUT_INSTANCE_ID + }; + + struct TessVertex + { + float4 vertex : INTERNALTESSPOS; + float3 normal : NORMAL; + float4 tangent : TANGENT; + float4 texcoord0 : TEXCOORD0; + float4 texcoord1 : TEXCOORD1; + float4 texcoord2 : TEXCOORD2; + + // #if %TEXCOORD3REQUIREKEY% + float4 texcoord3 : TEXCOORD3; + // #endif + + // #if %VERTEXCOLORREQUIREKEY% + float4 vertexColor : COLOR; + // #endif + + // #if %EXTRAV2F0REQUIREKEY% + // float4 extraV2F0 : TEXCOORD5; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // float4 extraV2F1 : TEXCOORD6; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // float4 extraV2F2 : TEXCOORD7; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // float4 extraV2F3 : TEXCOORD8; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // float4 extraV2F4 : TEXCOORD9; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // float4 extraV2F5 : TEXCOORD10; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // float4 extraV2F6 : TEXCOORD11; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // float4 extraV2F7 : TEXCOORD12; + // #endif + + #if _PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR)) + float3 previousPositionOS : TEXCOORD13; // Contain previous transform position (in case of skinning for example) + #if defined (_ADD_PRECOMPUTED_VELOCITY) + float3 precomputedVelocity : TEXCOORD14; + #endif + #endif + + UNITY_VERTEX_INPUT_INSTANCE_ID + UNITY_VERTEX_OUTPUT_STEREO + }; + + struct ExtraV2F + { + float4 extraV2F0; + float4 extraV2F1; + float4 extraV2F2; + float4 extraV2F3; + float4 extraV2F4; + float4 extraV2F5; + float4 extraV2F6; + float4 extraV2F7; + Blackboard blackboard; + float4 time; + }; + + + float3 WorldToTangentSpace(ShaderData d, float3 normal) + { + return mul(d.TBNMatrix, normal); + } + + float3 TangentToWorldSpace(ShaderData d, float3 normal) + { + return mul(normal, d.TBNMatrix); + } + + // in this case, make standard more like SRPs, because we can't fix + // unity_WorldToObject in HDRP, since it already does macro-fu there + + #if _STANDARD + float3 TransformWorldToObject(float3 p) { return mul(unity_WorldToObject, float4(p, 1)); }; + float3 TransformObjectToWorld(float3 p) { return mul(unity_ObjectToWorld, float4(p, 1)); }; + float4 TransformWorldToObject(float4 p) { return mul(unity_WorldToObject, p); }; + float4 TransformObjectToWorld(float4 p) { return mul(unity_ObjectToWorld, p); }; + float4x4 GetWorldToObjectMatrix() { return unity_WorldToObject; } + float4x4 GetObjectToWorldMatrix() { return unity_ObjectToWorld; } + #if (defined(SHADER_API_D3D11) || defined(SHADER_API_XBOXONE) || defined(UNITY_COMPILER_HLSLCC) || defined(SHADER_API_PSSL) || (SHADER_TARGET_SURFACE_ANALYSIS && !SHADER_TARGET_SURFACE_ANALYSIS_MOJOSHADER)) + #define UNITY_SAMPLE_TEX2D_LOD(tex,coord, lod) tex.SampleLevel (sampler##tex,coord, lod) + #define UNITY_SAMPLE_TEX2D_SAMPLER_LOD(tex,samplertex,coord, lod) tex.SampleLevel (sampler##samplertex,coord, lod) + #else + #define UNITY_SAMPLE_TEX2D_LOD(tex,coord,lod) tex2D (tex,coord,0,lod) + #define UNITY_SAMPLE_TEX2D_SAMPLER_LOD(tex,samplertex,coord,lod) tex2D (tex,coord,0,lod) + #endif + + #undef GetWorldToObjectMatrix() + + #define GetWorldToObjectMatrix() unity_WorldToObject + + + #endif + + float3 GetCameraWorldPosition() + { + #if _HDRP + return GetCameraRelativePositionWS(_WorldSpaceCameraPos); + #else + return _WorldSpaceCameraPos; + #endif + } + + #if _GRABPASSUSED + #if _STANDARD + TEXTURE2D(%GRABTEXTURE%); + SAMPLER(sampler_%GRABTEXTURE%); + #endif + + half3 GetSceneColor(float2 uv) + { + #if _STANDARD + return SAMPLE_TEXTURE2D(%GRABTEXTURE%, sampler_%GRABTEXTURE%, uv).rgb; + #else + return SHADERGRAPH_SAMPLE_SCENE_COLOR(uv); + #endif + } + #endif + + + + #if _STANDARD + UNITY_DECLARE_DEPTH_TEXTURE(_CameraDepthTexture); + float GetSceneDepth(float2 uv) { return SAMPLE_DEPTH_TEXTURE(_CameraDepthTexture, uv); } + float GetLinear01Depth(float2 uv) { return Linear01Depth(GetSceneDepth(uv)); } + float GetLinearEyeDepth(float2 uv) { return LinearEyeDepth(GetSceneDepth(uv)); } + #else + float GetSceneDepth(float2 uv) { return SHADERGRAPH_SAMPLE_SCENE_DEPTH(uv); } + float GetLinear01Depth(float2 uv) { return Linear01Depth(GetSceneDepth(uv), _ZBufferParams); } + float GetLinearEyeDepth(float2 uv) { return LinearEyeDepth(GetSceneDepth(uv), _ZBufferParams); } + #endif + + float3 GetWorldPositionFromDepthBuffer(float2 uv, float3 worldSpaceViewDir) + { + float eye = GetLinearEyeDepth(uv); + float3 camView = mul((float3x3)GetObjectToWorldMatrix(), transpose(mul(GetWorldToObjectMatrix(), UNITY_MATRIX_I_V)) [2].xyz); + + float dt = dot(worldSpaceViewDir, camView); + float3 div = worldSpaceViewDir/dt; + float3 wpos = (eye * div) + GetCameraWorldPosition(); + return wpos; + } + + #if _HDRP + float3 ObjectToWorldSpacePosition(float3 pos) + { + return GetAbsolutePositionWS(TransformObjectToWorld(pos)); + } + #else + float3 ObjectToWorldSpacePosition(float3 pos) + { + return TransformObjectToWorld(pos); + } + #endif + + #if _STANDARD + UNITY_DECLARE_SCREENSPACE_TEXTURE(_CameraDepthNormalsTexture); + float3 GetSceneNormal(float2 uv, float3 worldSpaceViewDir) + { + float4 depthNorms = UNITY_SAMPLE_SCREENSPACE_TEXTURE(_CameraDepthNormalsTexture, uv); + float3 norms = DecodeViewNormalStereo(depthNorms); + norms = mul((float3x3)GetWorldToViewMatrix(), norms) * 0.5 + 0.5; + return norms; + } + #elif _HDRP && !_DECALSHADER + + float3 GetSceneNormal(float2 uv, float3 worldSpaceViewDir) + { + NormalData nd; + DecodeFromNormalBuffer(_ScreenSize.xy * uv, nd); + return nd.normalWS; + } + #elif _URP + #if (SHADER_LIBRARY_VERSION_MAJOR >= 10) + #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/DeclareNormalsTexture.hlsl" + #endif + + float3 GetSceneNormal(float2 uv, float3 worldSpaceViewDir) + { + #if (SHADER_LIBRARY_VERSION_MAJOR >= 10) + return SampleSceneNormals(uv); + #else + float3 wpos = GetWorldPositionFromDepthBuffer(uv, worldSpaceViewDir); + return normalize(-cross(ddx(wpos), ddy(wpos))) * 0.5 + 0.5; + #endif + + } + #endif + + #if _HDRP + + half3 UnpackNormalmapRGorAG(half4 packednormal) + { + // This do the trick + packednormal.x *= packednormal.w; + + half3 normal; + normal.xy = packednormal.xy * 2 - 1; + normal.z = sqrt(1 - saturate(dot(normal.xy, normal.xy))); + return normal; + } + half3 UnpackNormal(half4 packednormal) + { + #if defined(UNITY_NO_DXT5nm) + return packednormal.xyz * 2 - 1; + #else + return UnpackNormalmapRGorAG(packednormal); + #endif + } + #endif + #if _HDRP || _URP + + half3 UnpackScaleNormal(half4 packednormal, half scale) + { + #ifndef UNITY_NO_DXT5nm + // Unpack normal as DXT5nm (1, y, 1, x) or BC5 (x, y, 0, 1) + // Note neutral texture like "bump" is (0, 0, 1, 1) to work with both plain RGB normal and DXT5nm/BC5 + packednormal.x *= packednormal.w; + #endif + half3 normal; + normal.xy = (packednormal.xy * 2 - 1) * scale; + normal.z = sqrt(1 - saturate(dot(normal.xy, normal.xy))); + return normal; + } + + #endif + + + void GetSun(out float3 lightDir, out float3 color) + { + lightDir = float3(0.5, 0.5, 0); + color = 1; + #if _HDRP + if (_DirectionalLightCount > 0) + { + DirectionalLightData light = _DirectionalLightDatas[0]; + lightDir = -light.forward.xyz; + color = light.color; + } + #elif _STANDARD + lightDir = normalize(_WorldSpaceLightPos0.xyz); + color = _LightColor0.rgb; + #elif _URP + Light light = GetMainLight(); + lightDir = light.direction; + color = light.color; + #endif + } + + + + + + + + + + TEXTURE2D(_MainTex); + SAMPLER(sampler_MainTex); + + #if GLOW_ON + TEXTURE2D(_GlowTex); + SAMPLER(sampler_GlowTex); + #endif + + #if FADE_ON + TEXTURE2D(_FadeTex); + SAMPLER(sampler_FadeTex); + + TEXTURE2D(_FadeBurnTex); + SAMPLER(sampler_FadeBurnTex); + #endif + + #if DISTORT_ON + TEXTURE2D(_DistortTex); + SAMPLER(sampler_DistortTex); + #endif + + #if OUTTEX_ON + TEXTURE2D(_OutlineTex); + SAMPLER(sampler_OutlineTex); + #endif + + #if OUTDIST_ON + TEXTURE2D(_OutlineDistortTex); + SAMPLER(sampler_OutlineDistortTex); + #endif + + #if COLORSWAP_ON + TEXTURE2D(_ColorSwapTex); + SAMPLER(sampler_ColorSwapTex); + #endif + + #if COLORRAMP_ON + TEXTURE2D(_ColorRampTex); + TEXTURE2D(_ColorRampTexGradient); + SAMPLER(sampler_ColorRampTex); + SAMPLER(sampler_ColorRampTexGradient); + #endif + + #if SHINE_ON + TEXTURE2D(_ShineMask); + SAMPLER(sampler_ShineMask); + #endif + + #if OVERLAY_ON + TEXTURE2D(_OverlayTex); + SAMPLER(sampler_OverlayTex); + #endif + + #if NORMALMAP_ON + TEXTURE2D(_NormalMap); + SAMPLER(sampler_NormalMap); + #endif + + + half3 GetPixel(in int offsetX, in int offsetY, in half2 uv, in Texture2D _tex, in SamplerState _sampler) + { + half2 _uv = uv + half2(offsetX * _MainTex_TexelSize.x, offsetY * _MainTex_TexelSize.y); + half4 col = SAMPLE_TEXTURE2D(_tex, _sampler, _uv); + return col.rgb; + } + + + //BLURS------------------------------------------------------------------------- + half4 Blur(half2 uv, Texture2D source, SamplerState sampler_source, half Intensity) + { + const half2 texelSize = 1.0 / _ScreenParams.xy; + const half4 color = SAMPLE_TEXTURE2D(source, sampler_source, uv); + const half2 offset = Intensity * texelSize; + + half4 accumulatedColor = color; + half accumulatedWeight = 1.0; + for (int x = -1; x <= 1; x++) + { + for (int y = -1; y <= 1; y++) + { + const half2 sampleUV = uv + half2(x, y) * offset; + const half4 sampleColor = SAMPLE_TEXTURE2D(source, sampler_source, sampleUV); + + accumulatedColor += sampleColor; + accumulatedWeight += 1.0; + } + } + + half4 blurredColor = accumulatedColor / accumulatedWeight; + return blurredColor; + } + + half BlurHD_G(half bhqp, half x) + { + return exp(-(x * x) / (2.0 * bhqp * bhqp)); + } + half4 BlurHD(half2 uv, Texture2D source, SamplerState sampler_source, half BlurAmount, half xScale, half yScale) + { + int iterations = 16; + int halfIterations = iterations / 2; + half sigmaX = 0.1 + BlurAmount * 0.5; + half sigmaY = sigmaX; + half total = 0.0; + half4 ret = half4(0, 0, 0, 0); + for (int iy = 0; iy < iterations; ++iy) + { + half fy = BlurHD_G(sigmaY, half(iy) -half(halfIterations)); + half offsetY = half(iy - halfIterations) * 0.00390625 * xScale; + for (int ix = 0; ix < iterations; ++ix) + { + half fx = BlurHD_G(sigmaX, half(ix) - half(halfIterations)); + half offsetX = half(ix - halfIterations) * 0.00390625 * yScale; + total += fx * fy; + ret += SAMPLE_TEXTURE2D(source, sampler_source, uv + half2(offsetX, offsetY)) * fx * fy; + } + } + return ret / total; + } + //----------------------------------------------------------------------- + + + //------------------------------------------- + half RemapFloat(half inValue, half inMin, half inMax, half outMin, half outMax){ + return outMin + (inValue - inMin) * (outMax - outMin) / (inMax - inMin); + } + //------------------------------------------- + + //----------------------------------------------------------------------- + half rand(half2 seed, half offset) { + return (frac(sin(dot(seed, half2(12.9898, 78.233))) * 43758.5453) + offset) % 1.0; + } + + half rand2(half2 seed, half offset) { + return (frac(sin(dot(seed * floor(50 + (_Time.x % 1.0) * 12.), half2(127.1, 311.7))) * 43758.5453123) + offset) % 1.0; + } + + half rand2CustomTime(half2 seed, half offset, half customTime) { + return (frac(sin(dot(seed * floor(50 + (customTime % 1.0) * 12.), half2(127.1, 311.7))) * 43758.5453123) + offset) % 1.0; + } + //----------------------------------------------------------------------- + + + void Ext_ModifyVertex0 (inout VertexData v, inout ExtraV2F d) + { + //BILBOARD_ON + #if BILBOARD_ON + half3 camRight = mul((half3x3)unity_CameraToWorld, half3(1,0,0)); + half3 camUp = half3(0,1,0); + #if BILBOARDY_ON + camUp = mul((half3x3)unity_CameraToWorld, half3(0,1,0)); + #endif + half3 localPos = v.vertex.x * camRight + v.vertex.y * camUp; + v.vertex = half4(localPos, 1); + #endif + //----------------------------------------------------------- + + v.texcoord0.xy = TRANSFORM_TEX(v.texcoord0.xy, _MainTex); + half2 center = half2(0.5, 0.5); + #if ATLAS_ON + center = half2((_MaxXUV + _MinXUV) / 2.0, (_MaxYUV + _MinYUV) / 2.0); + #endif + + //POLARUV_ON + #if POLARUV_ON + v.texcoord0.xy = v.texcoord0.xy - center; + #endif + + //---------------------------------------- + + //ROTATEUV_ON + #if ROTATEUV_ON + half2 uvC = v.texcoord0.xy; + half cosAngle = cos(_RotateUvAmount); + half sinAngle = sin(_RotateUvAmount); + half2x2 rot = half2x2(cosAngle, -sinAngle, sinAngle, cosAngle); + uvC -= center; + v.texcoord0.xy = mul(rot, uvC); + v.texcoord0.xy += center; + #endif + //-------------------- + + #if RECTSIZE_ON + v.vertex.xyz += (v.vertex.xyz * (_RectSize - 1.0)); + #endif + + #if OUTTEX_ON + v.texcoord1.xy = TRANSFORM_TEX(v.texcoord0.xy, _OutlineTex); + #endif + + #if OUTDIST_ON + v.texcoord2.xy = TRANSFORM_TEX(v.texcoord0.xy, _OutlineDistortTex); + #endif + + #if DISTORT_ON + v.texcoord3.xy = TRANSFORM_TEX(v.texcoord0.xy, _DistortTex); + #endif + } + + void Ext_SurfaceFunction0 (inout Surface o, ShaderData d) + { + half randomSeed = _RandomSeed; + + float2 uvRect = d.texcoord0; + half2 center = half2(0.5, 0.5); + #if ATLAS_ON + center = half2((_MaxXUV + _MinXUV) / 2.0, (_MaxYUV + _MinYUV) / 2.0); + uvRect = half2((d.texcoord0.x - _MinXUV) / (_MaxXUV - _MinXUV), (d.texcoord0.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half2 centerTiled = half2(center.x * _MainTex_ST.x, center.y * _MainTex_ST.y); + + //CLIPPING_ON + #if CLIPPING_ON + half2 tiledUv = half2(d.texcoord0.x / _MainTex_ST.x, d.texcoord0.y / _MainTex_ST.y); + #if ATLAS_ON + tiledUv = half2((tiledUv.x - _MinXUV) / (_MaxXUV - _MinXUV), (tiledUv.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + clip((1 - _ClipUvUp) - tiledUv.y); + clip(tiledUv.y - _ClipUvDown); + clip((1 - _ClipUvRight) - tiledUv.x); + clip(tiledUv.x - _ClipUvLeft); + #endif + //---------------------------------- + + //RADIALCLIPPING_ON + #if RADIALCLIPPING_ON + half2 tiledUv2 = half2(d.texcoord0.x / _MainTex_ST.x, d.texcoord0.y / _MainTex_ST.y); + #if ATLAS_ON + tiledUv2 = half2((tiledUv2.x - _MinXUV) / (_MaxXUV - _MinXUV), (tiledUv2.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half startAngle = _RadialStartAngle - _RadialClip; + half endAngle = _RadialStartAngle + _RadialClip2; + half offset0 = clamp(0, 360, startAngle + 360); + half offset360 = clamp(0, 360, endAngle - 360); + half2 atan2Coord = half2(lerp(-1, 1, tiledUv2.x), lerp(-1, 1, tiledUv2.y)); + half atanAngle = atan2(atan2Coord.y, atan2Coord.x) * 57.3; // angle in degrees + if(atanAngle < 0) atanAngle = 360 + atanAngle; + if(atanAngle >= startAngle && atanAngle <= endAngle) discard; + if(atanAngle <= offset360) discard; + if(atanAngle >= offset0) discard; + #endif + + //----------------------------- + + //TEXTURESCROLL_ON && ATLAS_ON + #if TEXTURESCROLL_ON && ATLAS_ON + d.texcoord0.xy = half2(_MinXUV + ((_MaxXUV - _MinXUV) * (abs(((_Time.y + randomSeed) * _TextureScrollXSpeed) + uvRect.x) % 1)), + _MinYUV + ((_MaxYUV - _MinYUV) * (abs(((_Time.y + randomSeed) * _TextureScrollYSpeed) + uvRect.y) % 1))); + #endif + //---------------------------- + + //OFFSETUV_ON + #if OFFSETUV_ON + #if ATLAS_ON + d.texcoord0.xy = half2(_MinXUV + ((_MaxXUV - _MinXUV) * (abs((_OffsetUvX + uvRect.x) % 1))), + _MinYUV + ((_MaxYUV - _MinYUV) * (abs(_OffsetUvY + uvRect.y) % 1))); + #else + d.texcoord0.xy += half2(_OffsetUvX, _OffsetUvY); + #endif + #endif + + //---------------------- + + //POLARUV_ON + #if POLARUV_ON + d.texcoord0.xy = half2(atan2(d.texcoord0.y, d.texcoord0.x) / (2.0f * 3.141592653589f), length(d.texcoord0.xy)); + d.texcoord0.xy *= _MainTex_ST.xy; + #endif + + //-------------------------------------- + + //TWISTUV_ON + #if TWISTUV_ON + #if ATLAS_ON + _TwistUvPosX = ((_MaxXUV - _MinXUV) * _TwistUvPosX) + _MinXUV; + _TwistUvPosY = ((_MaxYUV - _MinYUV) * _TwistUvPosY) + _MinYUV; + #endif + half2 tempUv = d.texcoord0.xy - half2(_TwistUvPosX * _MainTex_ST.x, _TwistUvPosY * _MainTex_ST.y); + _TwistUvRadius *= (_MainTex_ST.x + _MainTex_ST.y) / 2; + half percent = (_TwistUvRadius - length(tempUv)) / _TwistUvRadius; + half theta = percent * percent * (2.0 * sin(_TwistUvAmount)) * 8.0; + half s = sin(theta); + half c = cos(theta); + half beta = max(sign(_TwistUvRadius - length(tempUv)), 0.0); + tempUv = half2(dot(tempUv, half2(c, -s)), dot(tempUv, half2(s, c))) * beta + tempUv * (1 - beta); + tempUv += half2(_TwistUvPosX * _MainTex_ST.x, _TwistUvPosY * _MainTex_ST.y); + d.texcoord0.xy = tempUv; + #endif + + //-------------------------------------------- + + //FISHEYE_ON + #if FISHEYE_ON + half bind = length(centerTiled); + half2 dF = d.texcoord0.xy - centerTiled; + half dFlen = length(dF); + half fishInt = (3.14159265359 / bind) * (_FishEyeUvAmount + 0.001); + d.texcoord0.xy = centerTiled + (dF / (max(0.0001, dFlen))) * tan(dFlen * fishInt) * bind / tan(bind * fishInt); + #endif + //--------------------------------------------- + + //PINCH_ON + #if PINCH_ON + half2 dP = d.texcoord0.xy - centerTiled; + half pinchInt = (3.141592 / length(centerTiled)) * (-_PinchUvAmount + 0.001); + d.texcoord0.xy = centerTiled + normalize(dP) * atan(length(dP) * -pinchInt * 10.0) * 0.5 / atan(-pinchInt * 5); + #endif + + //--------------------------------------------- + + //ZOOMUV_ON + #if ZOOMUV_ON + d.texcoord0.xy -= centerTiled; + d.texcoord0.xy = d.texcoord0.xy * _ZoomUvAmount; + d.texcoord0.xy += centerTiled; + #endif + + //----------------------------------------------- + + //DOODLE_ON + #if DOODLE_ON + half2 uvCopy = uvRect; + _HandDrawnSpeed = (floor((_Time.x + randomSeed) * 20 * _HandDrawnSpeed) / _HandDrawnSpeed) * _HandDrawnSpeed; + uvCopy.x = sin((uvCopy.x * _HandDrawnAmount + _HandDrawnSpeed) * 4); + uvCopy.y = cos((uvCopy.y * _HandDrawnAmount + _HandDrawnSpeed) * 4); + d.texcoord0.xy = lerp(d.texcoord0.xy, d.texcoord0.xy + uvCopy, 0.0005 * _HandDrawnAmount); + #endif + + //-------------------------- + + //SHAKEUV_ON + #if SHAKEUV_ON + half xShake = sin((_Time.x + randomSeed) * _ShakeUvSpeed * 50) * _ShakeUvX; + half yShake = cos((_Time.x + randomSeed) * _ShakeUvSpeed * 50) * _ShakeUvY; + d.texcoord0.xy += half2(xShake * 0.012, yShake * 0.01); + #endif + + //------------------------------------------- + + //RECTSIZE_ON + #if RECTSIZE_ON + d.texcoord0.xy = d.texcoord0.xy * (_RectSize).xx + (((-_RectSize * 0.5) + 0.5)).xx; + #endif + + //------------------------------------------- + + //DISTORT_ON + #if DISTORT_ON + #if ATLAS_ON + d.texcoord3.x = d.texcoord3.x * (1 / (_MaxXUV - _MinXUV)); + d.texcoord3.y = d.texcoord3.y * (1 / (_MaxYUV - _MinYUV)); + #endif + + d.texcoord3.x += ((_Time.x + _RandomSeed) * _DistortTexXSpeed) % 1; + d.texcoord3.y += ((_Time.x + _RandomSeed) * _DistortTexYSpeed) % 1; + half distortAmnt = (SAMPLE_TEXTURE2D(_DistortTex, sampler_DistortTex, d.texcoord3.xy).r - 0.5) * 0.2 * _DistortAmount; + d.texcoord0.x += distortAmnt; + d.texcoord0.y += distortAmnt; + #endif + //------------------------------------------------------- + + //WARP_ON + #if WARP_ON + half2 warpUv = half2(d.texcoord0.x / _MainTex_ST.x, d.texcoord0.y / _MainTex_ST.y); + #if ATLAS_ON + warpUv = half2((warpUv.x - _MinXUV) / (_MaxXUV - _MinXUV), (warpUv.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + const float tau = 6.283185307179586; + float xWarp = (_Time.y + randomSeed) * _WarpSpeed + warpUv.x * tau / _WarpScale; + float yWarp = (_Time.y + randomSeed) * _WarpSpeed + warpUv.y * tau / _WarpScale; + float2 warp = float2(sin(xWarp), sin(yWarp)) * _WarpStrength; + d.texcoord0.xy += warp; + #endif + + //------------------------------------------------------- + + //WAVEUV_ON + #if WAVEUV_ON + float2 uvWave = half2(_WaveX * _MainTex_ST.x, _WaveY * _MainTex_ST.y) - d.texcoord0.xy; + uvWave %= 1; + #if ATLAS_ON + uvWave = half2(_WaveX, _WaveY) - uvRect; + #endif + uvWave.x *= _ScreenParams.x / _ScreenParams.y; + float waveTime = _Time.y + randomSeed; + float angWave = (sqrt(dot(uvWave, uvWave)) * _WaveAmount) - ((waveTime * _WaveSpeed)); + d.texcoord0.xy = d.texcoord0.xy + uvWave * sin(angWave) * (_WaveStrength / 1000.0); + #endif + //---------------------------------------------------- + + //ROUNDWAVEUV_ON + #if ROUNDWAVEUV_ON + half xWave = ((0.5 * _MainTex_ST.x) - uvRect.x); + half yWave = ((0.5 * _MainTex_ST.y) - uvRect.y) * (_MainTex_TexelSize.w / _MainTex_TexelSize.z); + half ripple = -sqrt(xWave*xWave + yWave* yWave); + d.texcoord0.xy += (sin((ripple + (_Time.y + randomSeed) * (_RoundWaveSpeed/10.0)) / 0.015) * (_RoundWaveStrength/10.0)) % 1; + #endif + //---------------------------------------------------- + + + //WIND_ON + #if WIND_ON + half windOffset = sin((_Time.x + randomSeed) * _GrassSpeed * 10); + half2 windCenter = half2(0.5, 0.1); + #if ATLAS_ON + windCenter.x = ((_MaxXUV - _MinXUV) * windCenter.x) + _MinXUV; + windCenter.y = ((_MaxYUV - _MinYUV) * windCenter.y) + _MinYUV; + #endif + #if !MANUALWIND_ON + d.texcoord0.x = fmod(abs(lerp(d.texcoord0.x, d.texcoord0.x + (_GrassWind * 0.01 * windOffset), uvRect.y)), 1); + #else + d.texcoord0.x = fmod(abs(lerp(d.texcoord0.x, d.texcoord0.x + (_GrassWind * 0.01 * _GrassManualAnim), uvRect.y)), 1); + windOffset = _GrassManualAnim; + #endif + half2 delta = d.texcoord0.xy - windCenter; + half delta2 = dot(delta.xy, delta.xy); + half2 delta_offset = delta2 * windOffset; + d.texcoord0.xy = d.texcoord0.xy + half2(delta.y, -delta.x) * delta_offset * _GrassRadialBend; + #endif + + //-------------------------------------------------------- + + //TEXTURESCROLL_ON && !ATLAS_ON + #if TEXTURESCROLL_ON && !ATLAS_ON + d.texcoord0.x += ((_Time.y + randomSeed) * _TextureScrollXSpeed) % 1; + d.texcoord0.y += ((_Time.y + randomSeed) * _TextureScrollYSpeed) % 1; + #endif + //------------------------------ + + //PIXELATE_ON + #if PIXELATE_ON + half aspectRatio = _MainTex_TexelSize.x / _MainTex_TexelSize.y; + half2 pixelSize = float2(_PixelateSize, _PixelateSize * aspectRatio); + d.texcoord0.xy = floor(d.texcoord0.xy * pixelSize) / pixelSize; + #endif + //-------------- + + half4 col = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy); + half originalAlpha = col.a; + col *= d.vertexColor; + + //NORMAL MAP + #if NORMALMAP_ON + half4 normalSample = SAMPLE_TEXTURE2D(_NormalMap, sampler_NormalMap, d.texcoord0.xy); + half3 normalTS = UnpackNormal(normalSample); + normalTS.xy *= _NormalStrength; + o.Normal = normalTS; + #endif + + + //GLITCH_ON + #if GLITCH_ON + half2 uvGlitch = uvRect; + uvGlitch.y -= 0.5; + half lineNoise = pow(rand2(floor(uvGlitch * half2(24., 19.) * _GlitchSize) * 4.0, randomSeed), 3.0) * _GlitchAmount + * pow(rand2(floor(uvGlitch * half2(38., 14.) * _GlitchSize) * 4.0, randomSeed), 3.0); + col = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(lineNoise * 0.02 * rand2(half2(2.0, 1), randomSeed), 0)) * d.vertexColor; + #endif + //-------------------------------------- + + //CHROMABERR_ON + #if CHROMABERR_ON + half4 r = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(_ChromAberrAmount/10, 0)) * d.vertexColor; + half4 b = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(-_ChromAberrAmount/10, 0)) * d.vertexColor; + col = half4(r.r * r.a, col.g, b.b * b.a, max(max(r.a, b.a) * _ChromAberrAlpha, col.a)); + #endif + + //-------------------------------- + + //BLUR_ON + #if BLUR_ON + #if ATLAS_ON + #if !BLURISHD_ON + col = BlurHD(d.texcoord0.xy, _MainTex, sampler_MainTex, _BlurIntensity, (_MaxXUV - _MinXUV), (_MaxYUV - _MinYUV)) * d.vertexColor; + #else + col = Blur(d.texcoord0.xy, _MainTex, sampler_MainTex, _BlurIntensity * (_MaxXUV - _MinXUV)) * d.vertexColor; + #endif + #else + #if !BLURISHD_ON + col = BlurHD(d.texcoord0.xy, _MainTex, sampler_MainTex, _BlurIntensity, 1, 1) * d.vertexColor; + #else + col = Blur(d.texcoord0.xy, _MainTex, sampler_MainTex, _BlurIntensity) * d.vertexColor; + #endif + #endif + #endif + + //-------------------- + + //MOTIONBLUR_ON + #if MOTIONBLUR_ON + _MotionBlurAngle = _MotionBlurAngle * 3.1415926; + #define rot(n) mul(n, half2x2(cos(_MotionBlurAngle), -sin(_MotionBlurAngle), sin(_MotionBlurAngle), cos(_MotionBlurAngle))) + _MotionBlurDist = _MotionBlurDist * 0.005; + #if ATLAS_ON + _MotionBlurDist *= (_MaxXUV - _MinXUV); + #endif + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(-_MotionBlurDist, -_MotionBlurDist))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(-_MotionBlurDist * 2, -_MotionBlurDist * 2))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(-_MotionBlurDist * 3, -_MotionBlurDist * 3))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(-_MotionBlurDist * 4, -_MotionBlurDist * 4))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(_MotionBlurDist, _MotionBlurDist))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(_MotionBlurDist * 2, _MotionBlurDist * 2))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(_MotionBlurDist * 3, _MotionBlurDist * 3))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(_MotionBlurDist * 4, _MotionBlurDist * 4))); + col.rgb = col.rgb / 9; + #endif + //------------------------------------ + + //NEGATIVE_ON + #if NEGATIVE_ON + col.rgb = lerp(col.rgb, 1 - col.rgb, _NegativeAmount); + #endif + + //-------------- + half luminance = 0; + + //GREYSCALE_ON && !GREYSCALEOUTLINE_ON + #if GREYSCALE_ON && !GREYSCALEOUTLINE_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + luminance = saturate(luminance + _GreyscaleLuminosity); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _GreyscaleTintColor, _GreyscaleBlend); + #endif + //------------------------------------ + + //GHOST_ON + #if GHOST_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + half4 ghostResult; + ghostResult.a = saturate(luminance - _GhostTransparency) * col.a; + ghostResult.rgb = col.rgb * (luminance + _GhostColorBoost); + col = lerp(col, ghostResult, _GhostBlend); + #endif + //------------------------------------ + + //INNEROUTLINE_ON + #if INNEROUTLINE_ON + half3 innerT = abs(GetPixel(0, _InnerOutlineThickness, d.texcoord0.xy, _MainTex, sampler_MainTex) - GetPixel(0, -_InnerOutlineThickness, d.texcoord0.xy, _MainTex, sampler_MainTex)); + innerT += abs(GetPixel(_InnerOutlineThickness, 0, d.texcoord0.xy, _MainTex, sampler_MainTex) - GetPixel(-_InnerOutlineThickness, 0, d.texcoord0.xy, _MainTex, sampler_MainTex)); + #if !ONLYINNEROUTLINE_ON + innerT = (innerT / 2.0) * col.a * _InnerOutlineAlpha; + col.rgb += length(innerT) * _InnerOutlineColor.rgb * _InnerOutlineGlow; + #else + innerT *= col.a * _InnerOutlineAlpha; + col.rgb = length(innerT) * _InnerOutlineColor.rgb * _InnerOutlineGlow; + col.a = step(0.3, col.r+col.g+col.b); + #endif + #endif + //------------------------------------------------------- + + //HITEFFECT_ON + #if HITEFFECT_ON + col.rgb = lerp(col.rgb, _HitEffectColor.rgb * _HitEffectGlow, _HitEffectBlend); + #endif + //-------------------- + + //GRADIENT_ON + #if GRADIENT_ON + half2 tiledUvGrad = half2(uvRect.x / _MainTex_ST.x, uvRect.y / _MainTex_ST.y); + #if GRADIENT2COL_ON + _GradTopRightCol = _GradTopLeftCol; + _GradBotRightCol = _GradBotLeftCol; + #endif + #if RADIALGRADIENT_ON + half radialDist = 1 - length(tiledUvGrad - half2(0.5, 0.5)); + radialDist *= (_MainTex_TexelSize.w / _MainTex_TexelSize.z); + radialDist = saturate(_GradBoostX * radialDist); + half4 gradientResult = lerp(_GradTopLeftCol, _GradBotLeftCol, radialDist); + #else + half gradXLerpFactor = saturate(pow(tiledUvGrad.x, _GradBoostX)); + half4 gradientResult = lerp(lerp(_GradBotLeftCol, _GradBotRightCol, gradXLerpFactor), + lerp(_GradTopLeftCol, _GradTopRightCol, gradXLerpFactor), saturate(pow(tiledUvGrad.y, _GradBoostY))); + #endif + gradientResult = lerp(col, gradientResult, _GradBlend); + col.rgb = gradientResult.rgb * col.a; + col.a *= gradientResult.a; + #endif + //-------------------------------------------------------------------- + + //CONTRAST_ON + #if CONTRAST_ON + col.rgb = (col.rgb - float3(0.5, 0.5, 0.5)) * _Contrast + float3(0.5, 0.5, 0.5); + col.rgb += _Brightness; + #endif + + //------------------------------------------------------------------- + + //COLORSWAP_ON + #if COLORSWAP_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + half4 swapMask = SAMPLE_TEXTURE2D(_ColorSwapTex, sampler_ColorSwapTex, d.texcoord0.xy); + swapMask.rgb *= swapMask.a; + half3 redSwap = _ColorSwapRed * swapMask.r * saturate(luminance + _ColorSwapRedLuminosity); + half3 greenSwap = _ColorSwapGreen * swapMask.g * saturate(luminance + _ColorSwapGreenLuminosity); + half3 blueSwap = _ColorSwapBlue * swapMask.b * saturate(luminance + _ColorSwapBlueLuminosity); + swapMask.rgb = col.rgb * saturate(1 - swapMask.r - swapMask.g - swapMask.b); + col.rgb = lerp(col.rgb, swapMask.rgb + redSwap + greenSwap + blueSwap, _ColorSwapBlend); + #endif + //-------------------------------------------------------------------- + + //COLORRAMP_ON && !COLORRAMPOUTLINE_ON + #if COLORRAMP_ON && !COLORRAMPOUTLINE_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + luminance = saturate(luminance + _ColorRampLuminosity); + #if GRADIENTCOLORRAMP_ON + col.rgb = lerp(col.rgb, SAMPLE_TEXTURE2D(_ColorRampTexGradient, sampler_ColorRampTexGradient, half2(luminance, 0)).rgb, _ColorRampBlend); + #else + col.rgb = lerp(col.rgb, SAMPLE_TEXTURE2D(_ColorRampTex, sampler_ColorRampTex, half2(luminance, 0)).rgb, _ColorRampBlend); + #endif + #endif + //-------------------------------------------------------------------- + + //CHANGECOLOR_ON + #if CHANGECOLOR_ON + float3 currChangeColor = saturate(col.rgb); + luminance = 0.3 * currChangeColor.r + 0.59 * currChangeColor.g + 0.11 * currChangeColor.b; + luminance = saturate(luminance + _ColorChangeLuminosity); + half3 dif = abs(currChangeColor - _ColorChangeTarget.rgb); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _ColorChangeNewCol.rgb, + max(sign(1 - saturate(dif.x + dif.y + dif.z) - _ColorChangeTolerance), 0.0)); + #if CHANGECOLOR2_ON + dif = abs(currChangeColor - _ColorChangeTarget2.rgb); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _ColorChangeNewCol2.rgb, + max(sign(1 - saturate(dif.x + dif.y + dif.z) - _ColorChangeTolerance2), 0.0)); + #endif + #if CHANGECOLOR3_ON + dif = abs(currChangeColor - _ColorChangeTarget3.rgb); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _ColorChangeNewCol3.rgb, + max(sign(1 - saturate(dif.x + dif.y + dif.z) - _ColorChangeTolerance3), 0.0)); + #endif + #endif + //------------------------------------------------------- + + //POSTERIZE_ON && !POSTERIZEOUTLINE_ON + #if POSTERIZE_ON && !POSTERIZEOUTLINE_ON + col.rgb = pow(col.rgb, _PosterizeGamma) * _PosterizeNumColors; + col.rgb = floor(col.rgb) / _PosterizeNumColors; + col.rgb = pow(col.rgb, 1.0 / _PosterizeGamma); + #endif + //------------------------------------ + + //HSV_ON + #if HSV_ON + half3 resultHsv = half3(col.rgb); + half cosHsv = _HsvBright * _HsvSaturation * cos(_HsvShift * 3.14159265 / 180); + half sinHsv = _HsvBright * _HsvSaturation * sin(_HsvShift * 3.14159265 / 180); + resultHsv.x = (.299 * _HsvBright + .701 * cosHsv + .168 * sinHsv) * col.x + + (.587 * _HsvBright - .587 * cosHsv + .330 * sinHsv) * col.y + + (.114 * _HsvBright - .114 * cosHsv - .497 * sinHsv) * col.z; + resultHsv.y = (.299 * _HsvBright - .299 * cosHsv - .328 * sinHsv) *col.x + + (.587 * _HsvBright + .413 * cosHsv + .035 * sinHsv) * col.y + + (.114 * _HsvBright - .114 * cosHsv + .292 * sinHsv) * col.z; + resultHsv.z = (.299 * _HsvBright - .3 * cosHsv + 1.25 * sinHsv) * col.x + + (.587 * _HsvBright - .588 * cosHsv - 1.05 * sinHsv) * col.y + + (.114 * _HsvBright + .886 * cosHsv - .203 * sinHsv) * col.z; + col.rgb = resultHsv; + #endif + //------------------------------------------------------- + + //OVERLAY_ON + #if OVERLAY_ON + half2 overlayUvs = d.texcoord0.xy; + overlayUvs.x += ((_Time.y + randomSeed) * _OverlayTextureScrollXSpeed) % 1; + overlayUvs.y += ((_Time.y + randomSeed) * _OverlayTextureScrollYSpeed) % 1; + half4 overlayCol = SAMPLE_TEXTURE2D(_OverlayTex, sampler_OverlayTex, TRANSFORM_TEX(overlayUvs, _OverlayTex)); + overlayCol.rgb *= _OverlayColor.rgb * _OverlayGlow; + #if !OVERLAYMULT_ON + overlayCol.rgb *= overlayCol.a * _OverlayColor.rgb * _OverlayColor.a * _OverlayBlend; + col.rgb += overlayCol.rgb; + #else + overlayCol.a *= _OverlayColor.a; + col = lerp(col, col * overlayCol, _OverlayBlend); + #endif + #endif + + //--------------------------------- + + //OUTBASE_ON + #if OUTBASE_ON + #if OUTBASEPIXELPERF_ON + half2 destUv = half2(_OutlinePixelWidth * _MainTex_TexelSize.x, _OutlinePixelWidth * _MainTex_TexelSize.y); + #else + half2 destUv = half2(_OutlineWidth * _MainTex_TexelSize.x * 200, _OutlineWidth * _MainTex_TexelSize.y * 200); + #endif + + #if OUTDIST_ON + d.texcoord3.x += ((_Time.x + _RandomSeed) * _OutlineDistortTexXSpeed) % 1; + d.texcoord3.y += ((_Time.x + _RandomSeed) * _OutlineDistortTexYSpeed) % 1; + #if ATLAS_ON + d.texcoord3 = half2((d.texcoord3.x - _MinXUV) / (_MaxXUV - _MinXUV), (d.texcoord3.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half outDistortAmnt = (SAMPLE_TEXTURE2D(_OutlineDistortTex, sampler_OutlineDistortTex, d.texcoord3).r - 0.5) * 0.2 * _OutlineDistortAmount; + destUv.x += outDistortAmnt; + destUv.y += outDistortAmnt; + #endif + + half spriteLeft = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(destUv.x, 0)).a; + half spriteRight = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy - half2(destUv.x, 0)).a; + half spriteBottom = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(0, destUv.y)).a; + half spriteTop = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy - half2(0, destUv.y)).a; + half result = spriteLeft + spriteRight + spriteBottom + spriteTop; + + #if OUTBASE8DIR_ON + half spriteTopLeft = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(destUv.x, destUv.y)).a; + half spriteTopRight = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(-destUv.x, destUv.y)).a; + half spriteBotLeft = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(destUv.x, -destUv.y)).a; + half spriteBotRight = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(-destUv.x, -destUv.y)).a; + result = result + spriteTopLeft + spriteTopRight + spriteBotLeft + spriteBotRight; + #endif + + result = step(0.05, saturate(result)); + + #if OUTTEX_ON + d.texcoord1.x += ((_Time.x + _RandomSeed) * _OutlineTexXSpeed) % 1; + d.texcoord1.y += ((_Time.x + _RandomSeed) * _OutlineTexYSpeed) % 1; + #if ATLAS_ON + d.texcoord1 = half2((d.texcoord1.x - _MinXUV) / (_MaxXUV - _MinXUV), (d.texcoord1.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half4 tempOutColor = SAMPLE_TEXTURE2D(_OutlineTex, sampler_OutlineTex, d.texcoord1); + tempOutColor *= _OutlineColor; + _OutlineColor = tempOutColor; + #endif + + result *= (1 - originalAlpha) * _OutlineAlpha; + + half4 outline = _OutlineColor * d.vertexColor.a; + outline.rgb *= _OutlineGlow; + outline.a = result; + #if ONLYOUTLINE_ON + col = outline; + #else + col = lerp(col, outline, result); + #endif + #endif + //------------------------------------------------------- + + //FADE_ON + #if FADE_ON + half2 tiledUvFade1 = TRANSFORM_TEX(d.texcoord0, _FadeTex); + half2 tiledUvFade2 = TRANSFORM_TEX(d.texcoord0, _FadeBurnTex); + #if ATLAS_ON + tiledUvFade1 = half2((tiledUvFade1.x - _MinXUV) / (_MaxXUV - _MinXUV), (tiledUvFade1.y - _MinYUV) / (_MaxYUV - _MinYUV)); + tiledUvFade2 = half2((tiledUvFade2.x - _MinXUV) / (_MaxXUV - _MinXUV), (tiledUvFade2.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half fadeTemp = SAMPLE_TEXTURE2D(_FadeTex, sampler_FadeTex, tiledUvFade1).r; + half fade = smoothstep(_FadeAmount, _FadeAmount + _FadeBurnTransition, fadeTemp); + half fadeBurn = saturate(smoothstep(_FadeAmount - _FadeBurnWidth, _FadeAmount - _FadeBurnWidth + 0.1, fadeTemp) * _FadeAmount); + col.a *= fade; + _FadeBurnColor.rgb *= _FadeBurnGlow; + col += fadeBurn * SAMPLE_TEXTURE2D(_FadeBurnTex, sampler_FadeBurnTex, tiledUvFade2) * _FadeBurnColor * originalAlpha * (1 - col.a); + #endif + //------------------------------------------------------- + + //SHADOW_ON + #if SHADOW_ON + half shadowA = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(_ShadowX, _ShadowY)).a; + half preMultShadowMask = 1 - (saturate(shadowA - col.a) * (1 - col.a)); + col.rgb *= 1 - ((shadowA - col.a) * (1 - col.a)); + col.rgb += (_ShadowColor * shadowA) * (1 - col.a); + col.a = max(shadowA * _ShadowAlpha * d.vertexColor.a, col.a); + #endif + + //------------------------------------------------------- + + //GLOW_ON + #if GLOW_ON + half4 emission; + #if GLOWTEX_ON + emission = SAMPLE_TEXTURE2D(_GlowTex, sampler_GlowTex, d.texcoord0); + #else + emission = col; + #endif + + col.rgb *= _GlowGlobal; + emission.rgb *= emission.a * col.a * _Glow * _GlowColor; + col.rgb += emission.rgb; + #endif + //------------------------------------------------------- + + //COLORRAMP_ON && COLORRAMPOUTLINE_ON + #if COLORRAMP_ON && COLORRAMPOUTLINE_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + luminance = saturate(luminance + _ColorRampLuminosity); + #if GRADIENTCOLORRAMP_ON + col.rgb = lerp(col.rgb, SAMPLE_TEXTURE2D(_ColorRampTexGradient, sampler_ColorRampTexGradient, half2(luminance, 0)).rgb, _ColorRampBlend); + #else + col.rgb = lerp(col.rgb, SAMPLE_TEXTURE2D(_ColorRampTex, sampler_ColorRampTex, half2(luminance, 0)).rgb, _ColorRampBlend); + #endif + #endif + //--------------- + + //GREYSCALE_ON && GREYSCALEOUTLINE_ON + #if GREYSCALE_ON && GREYSCALEOUTLINE_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + luminance = saturate(luminance + _GreyscaleLuminosity); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _GreyscaleTintColor, _GreyscaleBlend); + #endif + + //----------------------------------- + + //POSTERIZE_ON && POSTERIZEOUTLINE_ON + #if POSTERIZE_ON && POSTERIZEOUTLINE_ON + col.rgb = pow(col.rgb, _PosterizeGamma) * _PosterizeNumColors; + col.rgb = floor(col.rgb) / _PosterizeNumColors; + col.rgb = pow(col.rgb, 1.0 / _PosterizeGamma); + #endif + + //----------------------------------- + + //SHINE_ON + #if SHINE_ON + half2 uvShine = uvRect; + half cosAngle = cos(_ShineRotate); + half sinAngle = sin(_ShineRotate); + half2x2 rot = half2x2(cosAngle, -sinAngle, sinAngle, cosAngle); + uvShine -= half2(0.5, 0.5); + uvShine = mul(rot, uvShine); + uvShine += half2(0.5, 0.5); + half shineMask = SAMPLE_TEXTURE2D(_ShineMask, sampler_ShineMask, d.texcoord0.xy).a; + half currentDistanceProjection = (uvShine.x + uvShine.y) / 2; + half whitePower = 1 - (abs(currentDistanceProjection - _ShineLocation) / _ShineWidth); + col.rgb += col.a * whitePower * _ShineGlow * max(sign(currentDistanceProjection - (_ShineLocation - _ShineWidth)), 0.0) + * max(sign((_ShineLocation + _ShineWidth) - currentDistanceProjection), 0.0) * _ShineColor * shineMask; + #endif + + //----------------------------------- + + //HOLOGRAM_ON + #if HOLOGRAM_ON + half totalHologram = _HologramStripesAmount + _HologramUnmodAmount; + half hologramYCoord = ((uvRect.y + (((_Time.x + randomSeed) % 1) * _HologramStripesSpeed)) % totalHologram) / totalHologram; + hologramYCoord = abs(hologramYCoord); + half alpha = RemapFloat(saturate(hologramYCoord - (_HologramUnmodAmount/totalHologram)), 0.0, 1.0, _HologramMinAlpha, saturate(_HologramMaxAlpha)); + half hologramMask = max(sign((_HologramUnmodAmount/totalHologram) - hologramYCoord), 0.0); + half4 hologramResult = col; + hologramResult.a *= lerp(alpha, 1, hologramMask); + hologramResult.rgb *= max(1, _HologramMaxAlpha * max(sign(hologramYCoord - (_HologramUnmodAmount/totalHologram)), 0.0)); + hologramMask = 1 - step(0.01,hologramMask); + hologramResult.rgb += hologramMask * _HologramStripeColor * col.a; + col = lerp(col, hologramResult, _HologramBlend); + #endif + + //----------------------------------- + + //FLICKER_ON + #if FLICKER_ON + col.a *= saturate(col.a * step(frac(0.05 + (_Time.w + randomSeed) * _FlickerFreq), 1 - _FlickerPercent) + _FlickerAlpha); + #endif + //----------------------------------- + + //ALPHACUTOFF_ON + + //ALPHAROUND_ON + + //ALPHAOUTLINE_ON + #if ALPHAOUTLINE_ON + half alphaOutlineRes = pow(1 - col.a, max(_AlphaOutlinePower, 0.0001)) * step(_AlphaOutlineMinAlpha, col.a) * _AlphaOutlineBlend; + col.rgb = lerp(col.rgb, _AlphaOutlineColor.rgb * _AlphaOutlineGlow, alphaOutlineRes); + col.a = lerp(col.a, 1, alphaOutlineRes > 1); + #endif + //------------------------------------------------------- + + //FOG_ON + + //------------------ + + col *= _Color; + o.Albedo = col; + col.a *= _Alpha; + clip(col.a - _AlphaCutoffValue - 0.01); + o.Alpha = _Color.a; + } + + + + + + void ChainSurfaceFunction(inout Surface l, inout ShaderData d) + { + Ext_SurfaceFunction0(l, d); + // Ext_SurfaceFunction1(l, d); + // Ext_SurfaceFunction2(l, d); + // Ext_SurfaceFunction3(l, d); + // Ext_SurfaceFunction4(l, d); + // Ext_SurfaceFunction5(l, d); + // Ext_SurfaceFunction6(l, d); + // Ext_SurfaceFunction7(l, d); + // Ext_SurfaceFunction8(l, d); + // Ext_SurfaceFunction9(l, d); + // Ext_SurfaceFunction10(l, d); + // Ext_SurfaceFunction11(l, d); + // Ext_SurfaceFunction12(l, d); + // Ext_SurfaceFunction13(l, d); + // Ext_SurfaceFunction14(l, d); + // Ext_SurfaceFunction15(l, d); + // Ext_SurfaceFunction16(l, d); + // Ext_SurfaceFunction17(l, d); + // Ext_SurfaceFunction18(l, d); + // Ext_SurfaceFunction19(l, d); + // Ext_SurfaceFunction20(l, d); + // Ext_SurfaceFunction21(l, d); + // Ext_SurfaceFunction22(l, d); + // Ext_SurfaceFunction23(l, d); + // Ext_SurfaceFunction24(l, d); + // Ext_SurfaceFunction25(l, d); + // Ext_SurfaceFunction26(l, d); + // Ext_SurfaceFunction27(l, d); + // Ext_SurfaceFunction28(l, d); + // Ext_SurfaceFunction29(l, d); + } + +#if !_DECALSHADER + + void ChainModifyVertex(inout VertexData v, inout VertexToPixel v2p, float4 time) + { + ExtraV2F d; + + ZERO_INITIALIZE(ExtraV2F, d); + ZERO_INITIALIZE(Blackboard, d.blackboard); + // due to motion vectors in HDRP, we need to use the last + // time in certain spots. So if you are going to use _Time to adjust vertices, + // you need to use this time or motion vectors will break. + d.time = time; + + Ext_ModifyVertex0(v, d); + // Ext_ModifyVertex1(v, d); + // Ext_ModifyVertex2(v, d); + // Ext_ModifyVertex3(v, d); + // Ext_ModifyVertex4(v, d); + // Ext_ModifyVertex5(v, d); + // Ext_ModifyVertex6(v, d); + // Ext_ModifyVertex7(v, d); + // Ext_ModifyVertex8(v, d); + // Ext_ModifyVertex9(v, d); + // Ext_ModifyVertex10(v, d); + // Ext_ModifyVertex11(v, d); + // Ext_ModifyVertex12(v, d); + // Ext_ModifyVertex13(v, d); + // Ext_ModifyVertex14(v, d); + // Ext_ModifyVertex15(v, d); + // Ext_ModifyVertex16(v, d); + // Ext_ModifyVertex17(v, d); + // Ext_ModifyVertex18(v, d); + // Ext_ModifyVertex19(v, d); + // Ext_ModifyVertex20(v, d); + // Ext_ModifyVertex21(v, d); + // Ext_ModifyVertex22(v, d); + // Ext_ModifyVertex23(v, d); + // Ext_ModifyVertex24(v, d); + // Ext_ModifyVertex25(v, d); + // Ext_ModifyVertex26(v, d); + // Ext_ModifyVertex27(v, d); + // Ext_ModifyVertex28(v, d); + // Ext_ModifyVertex29(v, d); + + + // #if %EXTRAV2F0REQUIREKEY% + // v2p.extraV2F0 = d.extraV2F0; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // v2p.extraV2F1 = d.extraV2F1; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // v2p.extraV2F2 = d.extraV2F2; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // v2p.extraV2F3 = d.extraV2F3; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // v2p.extraV2F4 = d.extraV2F4; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // v2p.extraV2F5 = d.extraV2F5; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // v2p.extraV2F6 = d.extraV2F6; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // v2p.extraV2F7 = d.extraV2F7; + // #endif + } + + void ChainModifyTessellatedVertex(inout VertexData v, inout VertexToPixel v2p) + { + ExtraV2F d; + ZERO_INITIALIZE(ExtraV2F, d); + ZERO_INITIALIZE(Blackboard, d.blackboard); + + // #if %EXTRAV2F0REQUIREKEY% + // d.extraV2F0 = v2p.extraV2F0; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // d.extraV2F1 = v2p.extraV2F1; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // d.extraV2F2 = v2p.extraV2F2; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // d.extraV2F3 = v2p.extraV2F3; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // d.extraV2F4 = v2p.extraV2F4; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // d.extraV2F5 = v2p.extraV2F5; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // d.extraV2F6 = v2p.extraV2F6; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // d.extraV2F7 = v2p.extraV2F7; + // #endif + + + // Ext_ModifyTessellatedVertex0(v, d); + // Ext_ModifyTessellatedVertex1(v, d); + // Ext_ModifyTessellatedVertex2(v, d); + // Ext_ModifyTessellatedVertex3(v, d); + // Ext_ModifyTessellatedVertex4(v, d); + // Ext_ModifyTessellatedVertex5(v, d); + // Ext_ModifyTessellatedVertex6(v, d); + // Ext_ModifyTessellatedVertex7(v, d); + // Ext_ModifyTessellatedVertex8(v, d); + // Ext_ModifyTessellatedVertex9(v, d); + // Ext_ModifyTessellatedVertex10(v, d); + // Ext_ModifyTessellatedVertex11(v, d); + // Ext_ModifyTessellatedVertex12(v, d); + // Ext_ModifyTessellatedVertex13(v, d); + // Ext_ModifyTessellatedVertex14(v, d); + // Ext_ModifyTessellatedVertex15(v, d); + // Ext_ModifyTessellatedVertex16(v, d); + // Ext_ModifyTessellatedVertex17(v, d); + // Ext_ModifyTessellatedVertex18(v, d); + // Ext_ModifyTessellatedVertex19(v, d); + // Ext_ModifyTessellatedVertex20(v, d); + // Ext_ModifyTessellatedVertex21(v, d); + // Ext_ModifyTessellatedVertex22(v, d); + // Ext_ModifyTessellatedVertex23(v, d); + // Ext_ModifyTessellatedVertex24(v, d); + // Ext_ModifyTessellatedVertex25(v, d); + // Ext_ModifyTessellatedVertex26(v, d); + // Ext_ModifyTessellatedVertex27(v, d); + // Ext_ModifyTessellatedVertex28(v, d); + // Ext_ModifyTessellatedVertex29(v, d); + + // #if %EXTRAV2F0REQUIREKEY% + // v2p.extraV2F0 = d.extraV2F0; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // v2p.extraV2F1 = d.extraV2F1; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // v2p.extraV2F2 = d.extraV2F2; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // v2p.extraV2F3 = d.extraV2F3; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // v2p.extraV2F4 = d.extraV2F4; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // v2p.extraV2F5 = d.extraV2F5; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // v2p.extraV2F6 = d.extraV2F6; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // v2p.extraV2F7 = d.extraV2F7; + // #endif + } + + void ChainFinalColorForward(inout Surface l, inout ShaderData d, inout half4 color) + { + // Ext_FinalColorForward0(l, d, color); + // Ext_FinalColorForward1(l, d, color); + // Ext_FinalColorForward2(l, d, color); + // Ext_FinalColorForward3(l, d, color); + // Ext_FinalColorForward4(l, d, color); + // Ext_FinalColorForward5(l, d, color); + // Ext_FinalColorForward6(l, d, color); + // Ext_FinalColorForward7(l, d, color); + // Ext_FinalColorForward8(l, d, color); + // Ext_FinalColorForward9(l, d, color); + // Ext_FinalColorForward10(l, d, color); + // Ext_FinalColorForward11(l, d, color); + // Ext_FinalColorForward12(l, d, color); + // Ext_FinalColorForward13(l, d, color); + // Ext_FinalColorForward14(l, d, color); + // Ext_FinalColorForward15(l, d, color); + // Ext_FinalColorForward16(l, d, color); + // Ext_FinalColorForward17(l, d, color); + // Ext_FinalColorForward18(l, d, color); + // Ext_FinalColorForward19(l, d, color); + // Ext_FinalColorForward20(l, d, color); + // Ext_FinalColorForward21(l, d, color); + // Ext_FinalColorForward22(l, d, color); + // Ext_FinalColorForward23(l, d, color); + // Ext_FinalColorForward24(l, d, color); + // Ext_FinalColorForward25(l, d, color); + // Ext_FinalColorForward26(l, d, color); + // Ext_FinalColorForward27(l, d, color); + // Ext_FinalColorForward28(l, d, color); + // Ext_FinalColorForward29(l, d, color); + } + + void ChainFinalGBufferStandard(inout Surface s, inout ShaderData d, inout half4 GBuffer0, inout half4 GBuffer1, inout half4 GBuffer2, inout half4 outEmission, inout half4 outShadowMask) + { + // Ext_FinalGBufferStandard0(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard1(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard2(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard3(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard4(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard5(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard6(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard7(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard8(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard9(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard10(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard11(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard12(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard13(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard14(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard15(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard16(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard17(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard18(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard19(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard20(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard21(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard22(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard23(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard24(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard25(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard26(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard27(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard28(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard29(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + } +#endif + + + + + +#if _DECALSHADER + + ShaderData CreateShaderData(SurfaceDescriptionInputs IN) + { + ShaderData d = (ShaderData)0; + d.TBNMatrix = float3x3(IN.WorldSpaceTangent, IN.WorldSpaceBiTangent, IN.WorldSpaceNormal); + d.worldSpaceNormal = IN.WorldSpaceNormal; + d.worldSpaceTangent = IN.WorldSpaceTangent; + + d.worldSpacePosition = IN.WorldSpacePosition; + d.texcoord0 = IN.uv0.xyxy; + d.screenPos = IN.ScreenPosition; + + d.worldSpaceViewDir = normalize(_WorldSpaceCameraPos - d.worldSpacePosition); + + d.tangentSpaceViewDir = mul(d.TBNMatrix, d.worldSpaceViewDir); + + // these rarely get used, so we back transform them. Usually will be stripped. + #if _HDRP + // d.localSpacePosition = mul(GetWorldToObjectMatrix(), float4(GetCameraRelativePositionWS(d.worldSpacePosition), 1)).xyz; + #else + // d.localSpacePosition = mul(GetWorldToObjectMatrix(), float4(d.worldSpacePosition, 1)).xyz; + #endif + // d.localSpaceNormal = normalize(mul((float3x3)GetWorldToObjectMatrix(), d.worldSpaceNormal)); + // d.localSpaceTangent = normalize(mul((float3x3)GetWorldToObjectMatrix(), d.worldSpaceTangent.xyz)); + + // #if %SCREENPOSREQUIREKEY% + // d.screenUV = (IN.ScreenPosition.xy / max(0.01, IN.ScreenPosition.w)); + // #endif + + return d; + } +#else + + ShaderData CreateShaderData(VertexToPixel i + #if NEED_FACING + , bool facing + #endif + ) + { + ShaderData d = (ShaderData)0; + d.clipPos = i.pos; + d.worldSpacePosition = i.worldPos; + + d.worldSpaceNormal = normalize(i.worldNormal); + d.worldSpaceTangent.xyz = normalize(i.worldTangent.xyz); + + d.tangentSign = i.worldTangent.w * unity_WorldTransformParams.w; + float3 bitangent = cross(d.worldSpaceTangent.xyz, d.worldSpaceNormal) * d.tangentSign; + + d.TBNMatrix = float3x3(d.worldSpaceTangent, -bitangent, d.worldSpaceNormal); + d.worldSpaceViewDir = normalize(_WorldSpaceCameraPos - i.worldPos); + + d.tangentSpaceViewDir = mul(d.TBNMatrix, d.worldSpaceViewDir); + d.texcoord0 = i.texcoord0; + d.texcoord1 = i.texcoord1; + d.texcoord2 = i.texcoord2; + + // #if %TEXCOORD3REQUIREKEY% + d.texcoord3 = i.texcoord3; + // #endif + + // d.isFrontFace = facing; + // #if %VERTEXCOLORREQUIREKEY% + d.vertexColor = i.vertexColor; + // #endif + + // these rarely get used, so we back transform them. Usually will be stripped. + #if _HDRP + // d.localSpacePosition = mul(GetWorldToObjectMatrix(), float4(GetCameraRelativePositionWS(i.worldPos), 1)).xyz; + #else + // d.localSpacePosition = mul(GetWorldToObjectMatrix(), float4(i.worldPos, 1)).xyz; + #endif + // d.localSpaceNormal = normalize(mul((float3x3)GetWorldToObjectMatrix(), i.worldNormal)); + // d.localSpaceTangent = normalize(mul((float3x3)GetWorldToObjectMatrix(), i.worldTangent.xyz)); + + // #if %SCREENPOSREQUIREKEY% + // d.screenPos = i.screenPos; + // d.screenUV = (i.screenPos.xy / i.screenPos.w); + // #endif + + + // #if %EXTRAV2F0REQUIREKEY% + // d.extraV2F0 = i.extraV2F0; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // d.extraV2F1 = i.extraV2F1; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // d.extraV2F2 = i.extraV2F2; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // d.extraV2F3 = i.extraV2F3; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // d.extraV2F4 = i.extraV2F4; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // d.extraV2F5 = i.extraV2F5; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // d.extraV2F6 = i.extraV2F6; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // d.extraV2F7 = i.extraV2F7; + // #endif + + return d; + } + +#endif + + + +#if (SHADERPASS == SHADERPASS_LIGHT_TRANSPORT) + + // This was not in constant buffer in original unity, so keep outiside. But should be in as ShaderRenderPass frequency + float unity_OneOverOutputBoost; + float unity_MaxOutputValue; + + CBUFFER_START(UnityMetaPass) + // x = use uv1 as raster position + // y = use uv2 as raster position + bool4 unity_MetaVertexControl; + + // x = return albedo + // y = return normal + bool4 unity_MetaFragmentControl; + CBUFFER_END + + VertexToPixel Vert(VertexData inputMesh) + { + VertexToPixel output; + ZERO_INITIALIZE(VertexToPixel, output); + UNITY_SETUP_INSTANCE_ID(inputMesh); + UNITY_TRANSFER_INSTANCE_ID(inputMesh, output); + UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(output); + + // Output UV coordinate in vertex shader + float2 uv = float2(0.0, 0.0); + + if (unity_MetaVertexControl.x) + { + uv = inputMesh.texcoord1.xy * unity_LightmapST.xy + unity_LightmapST.zw; + } + else if (unity_MetaVertexControl.y) + { + uv = inputMesh.texcoord2.xy * unity_DynamicLightmapST.xy + unity_DynamicLightmapST.zw; + } + + // OpenGL right now needs to actually use the incoming vertex position + // so we create a fake dependency on it here that haven't any impact. + output.pos = float4(uv * 2.0 - 1.0, inputMesh.vertex.z > 0 ? 1.0e-4 : 0.0, 1.0); + + output.worldPos = TransformObjectToWorld(inputMesh.vertex.xyz).xyz; + + // Normal is required for triplanar mapping + output.worldNormal = TransformObjectToWorldNormal(inputMesh.normal); + // Not required but assign to silent compiler warning + output.worldTangent = float4(1.0, 0.0, 0.0, 0.0); + + output.texcoord0 = inputMesh.texcoord0; + output.texcoord1 = inputMesh.texcoord1; + output.texcoord2 = inputMesh.texcoord2; + // #if %TEXCOORD3REQUIREKEY% + output.texcoord3 = inputMesh.texcoord3; + // #endif + // #if %VERTEXCOLORREQUIREKEY% + output.vertexColor = inputMesh.vertexColor; + // #endif + + return output; + } +#else + + #if (_PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR))) + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/ShaderVariablesMatrixDefsHDCamera.hlsl" + + void MotionVectorPositionZBias(VertexToPixel input) + { + #if UNITY_REVERSED_Z + input.pos.z -= unity_MotionVectorsParams.z * input.pos.w; + #else + input.pos.z += unity_MotionVectorsParams.z * input.pos.w; + #endif + } + + #endif + + VertexToPixel Vert(VertexData input) + { + VertexToPixel output; + ZERO_INITIALIZE(VertexToPixel, output); + + UNITY_SETUP_INSTANCE_ID(input); + UNITY_TRANSFER_INSTANCE_ID(input, output); + UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(output); + + #if _HDRP && (_PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR))) + VertexData previousMesh = input; + #endif + + ChainModifyVertex(input, output, _Time); + + // This return the camera relative position (if enable) + float3 positionRWS = TransformObjectToWorld(input.vertex.xyz); + float3 normalWS = TransformObjectToWorldNormal(input.normal); + float4 tangentWS = float4(TransformObjectToWorldDir(input.tangent.xyz), input.tangent.w); + + + output.worldPos = GetAbsolutePositionWS(positionRWS); + output.pos = TransformWorldToHClip(positionRWS); + output.worldNormal = normalWS; + output.worldTangent = tangentWS; + + + output.texcoord0 = input.texcoord0; + output.texcoord1 = input.texcoord1; + output.texcoord2 = input.texcoord2; + + // #if %TEXCOORD3REQUIREKEY% + output.texcoord3 = input.texcoord3; + // #endif + + // #if %VERTEXCOLORREQUIREKEY% + output.vertexColor = input.vertexColor; + // #endif + + // #if %SCREENPOSREQUIREKEY% + // output.screenPos = ComputeScreenPos(output.pos, _ProjectionParams.x); + // #endif + + #if _HDRP && (_PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR))) + + #if !defined(TESSELLATION_ON) + MotionVectorPositionZBias(output); + #endif + + output.motionVectorCS = mul(UNITY_MATRIX_UNJITTERED_VP, float4(positionRWS.xyz, 1.0)); + // Note: unity_MotionVectorsParams.y is 0 is forceNoMotion is enabled + bool forceNoMotion = unity_MotionVectorsParams.y == 0.0; + if (forceNoMotion) + { + output.previousPositionCS = float4(0.0, 0.0, 0.0, 1.0); + } + else + { + bool hasDeformation = unity_MotionVectorsParams.x > 0.0; // Skin or morph target + + float3 effectivePositionOS = (hasDeformation ? previousMesh.previousPositionOS : previousMesh.vertex.xyz); + #if defined(_ADD_PRECOMPUTED_VELOCITY) + effectivePositionOS -= input.precomputedVelocity; + #endif + + previousMesh.vertex = float4(effectivePositionOS, 1); + VertexToPixel dummy = (VertexToPixel)0; + + + ChainModifyVertex(previousMesh, dummy, _LastTimeParameters); + + // we might need this for skinned objects? + //float3 normalWS = TransformPreviousObjectToWorldNormal(input.normal).xyz; + float3 previousPositionRWS = TransformPreviousObjectToWorld(previousMesh.vertex.xyz); + + #ifdef _WRITE_TRANSPARENT_MOTION_VECTOR + if (_TransparentCameraOnlyMotionVectors > 0) + { + previousPositionRWS = positionRWS.xyz; + } + #endif // _WRITE_TRANSPARENT_MOTION_VECTOR + + output.previousPositionCS = mul(UNITY_MATRIX_PREV_VP, float4(previousPositionRWS, 1.0)); + } + #endif // _HDRP && _PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR)) + + + return output; + } + + +#endif + + + + + + + + #if defined(WRITE_DECAL_BUFFER) && !defined(_DISABLE_DECALS) + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/Decal/DecalPrepassBuffer.hlsl" + #endif + + FragInputs BuildFragInputs(VertexToPixel input) + { + UNITY_SETUP_INSTANCE_ID(input); + FragInputs output; + ZERO_INITIALIZE(FragInputs, output); + + // Init to some default value to make the computer quiet (else it output 'divide by zero' warning even if value is not used). + // TODO: this is a really poor workaround, but the variable is used in a bunch of places + // to compute normals which are then passed on elsewhere to compute other values... + output.tangentToWorld = k_identity3x3; + output.positionSS = input.pos; // input.positionCS is SV_Position + // BETTER SHADERS: because we transform world position into actual world space for things like + // triplanar, etc, we have to back transform it here for lighting + output.positionRWS = GetCameraRelativePositionWS(input.worldPos); + output.tangentToWorld = BuildTangentToWorld(input.worldTangent, input.worldNormal); + output.texCoord0 = input.texcoord0; + output.texCoord1 = input.texcoord1; + output.texCoord2 = input.texcoord2; + + return output; + } + +#if UNITY_VERSION > UNITY_2022_3_12 + void ApplyDecalAndGetNormal(FragInputs fragInputs, PositionInputs posInput, Surface surfaceDescription, float3 normalTS, + inout SurfaceData surfaceData) + { + float3 doubleSidedConstants = GetDoubleSidedConstants(); + + #ifdef DECAL_NORMAL_BLENDING + // SG nodes don't ouptut surface gradients, so if decals require surf grad blending, we have to convert + // the normal to gradient before applying the decal. We then have to resolve the gradient back to world space + normalTS = SurfaceGradientFromTangentSpaceNormalAndFromTBN(normalTS, + fragInputs.tangentToWorld[0], fragInputs.tangentToWorld[1]); + + + #if HAVE_DECALS + if (_EnableDecals) + { + float alpha = 1.0; + alpha = surfaceDescription.Alpha; + + DecalSurfaceData decalSurfaceData = GetDecalSurfaceData(posInput, fragInputs, alpha); + ApplyDecalToSurfaceNormal(decalSurfaceData, fragInputs.tangentToWorld[2], normalTS); + ApplyDecalToSurfaceDataNoNormal(decalSurfaceData, surfaceData); + } + #endif + + GetNormalWS_SG(fragInputs, normalTS, surfaceData.normalWS, doubleSidedConstants); + #else + // normal delivered to master node + + #if HAVE_DECALS + if (_EnableDecals) + { + float alpha = 1.0; + alpha = surfaceDescription.Alpha; + + // Both uses and modifies 'surfaceData.normalWS'. + DecalSurfaceData decalSurfaceData = GetDecalSurfaceData(posInput, fragInputs, alpha); + ApplyDecalToSurfaceNormal(decalSurfaceData, surfaceData.normalWS.xyz); + ApplyDecalToSurfaceDataNoNormal(decalSurfaceData, surfaceData); + } + #endif + #endif + } +#endif + + void BuildSurfaceData(FragInputs fragInputs, inout Surface surfaceDescription, float3 V, PositionInputs posInput, out SurfaceData surfaceData, out float3 bentNormalWS) + { + // setup defaults -- these are used if the graph doesn't output a value + ZERO_INITIALIZE(SurfaceData, surfaceData); + + // specularOcclusion need to be init ahead of decal to quiet the compiler that modify the SurfaceData struct + // however specularOcclusion can come from the graph, so need to be init here so it can be override. + surfaceData.specularOcclusion = 1.0; + + // copy across graph values, if defined + surfaceData.baseColor = surfaceDescription.Albedo; + surfaceData.perceptualSmoothness = surfaceDescription.Smoothness; + surfaceData.ambientOcclusion = surfaceDescription.Occlusion; + surfaceData.specularOcclusion = surfaceDescription.SpecularOcclusion; + surfaceData.metallic = surfaceDescription.Metallic; + surfaceData.subsurfaceMask = surfaceDescription.SubsurfaceMask; + surfaceData.thickness = surfaceDescription.Thickness; + surfaceData.diffusionProfileHash = asuint(surfaceDescription.DiffusionProfileHash); + #if _USESPECULAR + surfaceData.specularColor = surfaceDescription.Specular; + #endif + surfaceData.coatMask = surfaceDescription.CoatMask; + surfaceData.anisotropy = surfaceDescription.Anisotropy; + surfaceData.iridescenceMask = surfaceDescription.IridescenceMask; + surfaceData.iridescenceThickness = surfaceDescription.IridescenceThickness; + + + + #if defined(_REFRACTION_PLANE) || defined(_REFRACTION_SPHERE) || defined(_REFRACTION_THIN) + if (_EnableSSRefraction) + { + surfaceData.transmittanceMask = (1.0 - surfaceDescription.Alpha); + surfaceDescription.Alpha = 1.0; + } + else + { + surfaceData.ior = surfaceDescription.ior; + surfaceData.transmittanceColor = surfaceDescription.transmittanceColor; + surfaceData.atDistance = surfaceDescription.atDistance; + surfaceData.transmittanceMask = surfaceDescription.transmittanceMask; + surfaceDescription.Alpha = 1.0; + } + #else + surfaceData.ior = 1.0; + surfaceData.transmittanceColor = float3(1.0, 1.0, 1.0); + surfaceData.atDistance = 1.0; + surfaceData.transmittanceMask = 0.0; + #endif + + + + // These static material feature allow compile time optimization + surfaceData.materialFeatures = MATERIALFEATUREFLAGS_LIT_STANDARD; + #ifdef _MATERIAL_FEATURE_SUBSURFACE_SCATTERING + surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_SUBSURFACE_SCATTERING; + #endif + + #ifdef _MATERIAL_FEATURE_TRANSMISSION + surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_TRANSMISSION; + #endif + + #ifdef _MATERIAL_FEATURE_ANISOTROPY + surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_ANISOTROPY; + surfaceData.normalWS = float3(0, 1, 0); + #endif + + #ifdef _MATERIAL_FEATURE_IRIDESCENCE + surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_IRIDESCENCE; + #endif + + #ifdef _MATERIAL_FEATURE_SPECULAR_COLOR + surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_SPECULAR_COLOR; + #endif + + #if defined(_MATERIAL_FEATURE_CLEAR_COAT) || _CLEARCOAT + surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_CLEAR_COAT; + #endif + + #if defined (_MATERIAL_FEATURE_SPECULAR_COLOR) && defined (_ENERGY_CONSERVING_SPECULAR) + // Require to have setup baseColor + // Reproduce the energy conservation done in legacy Unity. Not ideal but better for compatibility and users can unchek it + surfaceData.baseColor *= (1.0 - Max3(surfaceData.specularColor.r, surfaceData.specularColor.g, surfaceData.specularColor.b)); + #endif + + float3 normalTS = surfaceDescription.Normal; + #if !_WORLDSPACENORMAL + surfaceData.normalWS = mul(surfaceDescription.Normal, fragInputs.tangentToWorld); + #else + normalTS = mul(fragInputs.tangentToWorld, surfaceDescription.Normal); + surfaceData.normalWS = surfaceDescription.Normal; + #endif + + + #if UNITY_VERSION > UNITY_2022_3_12 + ApplyDecalAndGetNormal(fragInputs, posInput, surfaceDescription, normalTS, surfaceData); + #else + #ifdef DECAL_NORMAL_BLENDING + #if HAVE_DECALS + float alpha = 1.0; + alpha = surfaceDescription.Alpha; + if (_EnableDecals) + { + DecalSurfaceData decalSurfaceData = GetDecalSurfaceData(posInput, fragInputs, alpha); + ApplyDecalToSurfaceData(decalSurfaceData, fragInputs.tangentToWorld[2], surfaceData, normalTS); + } + #endif + #else + #if HAVE_DECALS + if (_EnableDecals) + { + float alpha = 1.0; + alpha = surfaceDescription.Alpha; + // Both uses and modifies 'surfaceData.normalWS'. + DecalSurfaceData decalSurfaceData = GetDecalSurfaceData(posInput, fragInputs, alpha); + ApplyDecalToSurfaceData(decalSurfaceData, fragInputs.tangentToWorld[2], surfaceData); + } + #endif + #endif + #endif + + + + surfaceData.geomNormalWS = fragInputs.tangentToWorld[2]; + + surfaceData.tangentWS = normalize(fragInputs.tangentToWorld[0].xyz); // The tangent is not normalize in tangentToWorld for mikkt. TODO: Check if it expected that we normalize with Morten. Tag: SURFACE_GRADIENT + + + bentNormalWS = surfaceData.normalWS; + + surfaceData.tangentWS = Orthonormalize(surfaceData.tangentWS, surfaceData.normalWS); + + #ifdef DEBUG_DISPLAY + if (_DebugMipMapMode != DEBUGMIPMAPMODE_NONE) + { + // TODO: need to update mip info + surfaceData.metallic = 0; + } + + // We need to call ApplyDebugToSurfaceData after filling the surfarcedata and before filling builtinData + // as it can modify attribute use for static lighting + ApplyDebugToSurfaceData(fragInputs.tangentToWorld, surfaceData); + #endif + + // By default we use the ambient occlusion with Tri-ace trick (apply outside) for specular occlusion. + // If user provide bent normal then we process a better term + #if defined(_SPECULAR_OCCLUSION_CUSTOM) + // Just use the value passed through via the slot (not active otherwise) + #elif defined(_SPECULAR_OCCLUSION_FROM_AO_BENT_NORMAL) + // If we have bent normal and ambient occlusion, process a specular occlusion + surfaceData.specularOcclusion = GetSpecularOcclusionFromBentAO(V, bentNormalWS, surfaceData.normalWS, surfaceData.ambientOcclusion, PerceptualSmoothnessToPerceptualRoughness(surfaceData.perceptualSmoothness)); + #elif defined(_AMBIENT_OCCLUSION) && defined(_SPECULAR_OCCLUSION_FROM_AO) + surfaceData.specularOcclusion = GetSpecularOcclusionFromAmbientOcclusion(ClampNdotV(dot(surfaceData.normalWS, V)), surfaceData.ambientOcclusion, PerceptualSmoothnessToRoughness(surfaceData.perceptualSmoothness)); + #endif + + #if defined(_ENABLE_GEOMETRIC_SPECULAR_AA) && !defined(SHADER_STAGE_RAY_TRACING) + surfaceData.perceptualSmoothness = GeometricNormalFiltering(surfaceData.perceptualSmoothness, fragInputs.tangentToWorld[2], surfaceDescription.SpecularAAScreenSpaceVariance, surfaceDescription.SpecularAAThreshold); + #endif + } + + void GetSurfaceAndBuiltinData(VertexToPixel m2ps, FragInputs fragInputs, float3 V, inout PositionInputs posInput, + out SurfaceData surfaceData, out BuiltinData builtinData, inout Surface l, inout ShaderData d + #if NEED_FACING + , bool facing + #endif + ) + { + // Removed since crossfade does not work, probably needs extra material setup. + //#if !defined(SHADER_STAGE_RAY_TRACING) && !defined(_TESSELLATION_DISPLACEMENT) + // #ifdef LOD_FADE_CROSSFADE // enable dithering LOD transition if user select CrossFade transition in LOD group + // LODDitheringTransition(ComputeFadeMaskSeed(V, posInput.positionSS), unity_LODFade.x); + // #endif + //#endif + + + + + d = CreateShaderData(m2ps + #if NEED_FACING + , facing + #endif + ); + + l = (Surface)0; + + l.Albedo = half3(0.5, 0.5, 0.5); + l.Normal = float3(0,0,1); + l.Occlusion = 1; + l.Alpha = 1; + l.SpecularOcclusion = 1; + + #if !defined(SHADER_STAGE_RAY_TRACING) && defined(_DEPTHOFFSET_ON) + l.outputDepth = d.clipPos.z; + #endif + + ChainSurfaceFunction(l, d); + + #if !defined(SHADER_STAGE_RAY_TRACING) && defined(_DEPTHOFFSET_ON) + posInput.deviceDepth = l.outputDepth; + #endif + + #if _UNLIT + //l.Emission = l.Albedo; + //l.Albedo = 0; + l.Normal = half3(0,0,1); + l.Occlusion = 1; + l.Metallic = 0; + l.Specular = 0; + #endif + + surfaceData.geomNormalWS = d.worldSpaceNormal; + surfaceData.tangentWS = d.worldSpaceTangent; + fragInputs.tangentToWorld = d.TBNMatrix; + + float3 bentNormalWS; + + BuildSurfaceData(fragInputs, l, V, posInput, surfaceData, bentNormalWS); + + + float4 lightmapTexCoord1 = fragInputs.texCoord1; + float4 lightmapTexCoord2 = fragInputs.texCoord2; + //#ifdef FRAG_INPUTS_USE_TEXCOORD1 + // float4 lightmapTexCoord1 = fragInputs.texCoord1; + // #else + // float4 lightmapTexCoord1 = float4(0,0,0,0); + // #endif + + // #ifdef FRAG_INPUTS_USE_TEXCOORD2 + // float4 lightmapTexCoord2 = fragInputs.texCoord2; + // #else + // float4 lightmapTexCoord2 = float4(0,0,0,0); + // #endif + + + InitBuiltinData(posInput, l.Alpha, bentNormalWS, -d.worldSpaceNormal, lightmapTexCoord1, lightmapTexCoord2, builtinData); + + + + builtinData.emissiveColor = l.Emission; + + #if defined(_OVERRIDE_BAKEDGI) + builtinData.bakeDiffuseLighting = l.DiffuseGI; + builtinData.backBakeDiffuseLighting = l.BackDiffuseGI; + builtinData.emissiveColor += l.SpecularGI; + #endif + + #if defined(_OVERRIDE_SHADOWMASK) + builtinData.shadowMask0 = l.ShadowMask.x; + builtinData.shadowMask1 = l.ShadowMask.y; + builtinData.shadowMask2 = l.ShadowMask.z; + builtinData.shadowMask3 = l.ShadowMask.w; + #endif + + #ifdef UNITY_VIRTUAL_TEXTURING + //builtinData.vtPackedFeedback = surfaceData.VTPackedFeedback; + #endif + + #if (SHADERPASS == SHADERPASS_DISTORTION) + builtinData.distortion = surfaceData.Distortion; + builtinData.distortionBlur = surfaceData.DistortionBlur; + #endif + + #ifndef SHADER_UNLIT + // PostInitBuiltinData call ApplyDebugToBuiltinData + PostInitBuiltinData(V, posInput, surfaceData, builtinData); + #else + ApplyDebugToBuiltinData(builtinData); + #endif + + RAY_TRACING_OPTIONAL_ALPHA_TEST_PASS + } + + + + void Frag( VertexToPixel IN + #ifdef WRITE_NORMAL_BUFFER + , out float4 outNormalBuffer : SV_Target0 + #ifdef WRITE_MSAA_DEPTH + , out float1 depthColor : SV_Target1 + #endif + #elif defined(WRITE_MSAA_DEPTH) // When only WRITE_MSAA_DEPTH is define and not WRITE_NORMAL_BUFFER it mean we are Unlit and only need depth, but we still have normal buffer binded + , out float4 outNormalBuffer : SV_Target0 + , out float1 depthColor : SV_Target1 + #elif defined(SCENESELECTIONPASS) + , out float4 outColor : SV_Target0 + #endif + + #ifdef _DEPTHOFFSET_ON + , out float outputDepth : SV_Depth + #endif + #if NEED_FACING + , bool facing : SV_IsFrontFace + #endif + ) + { + UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX(IN); + FragInputs input = BuildFragInputs(IN); + + // input.positionSS is SV_Position + PositionInputs posInput = GetPositionInput(input.positionSS.xy, _ScreenSize.zw, input.positionSS.z, input.positionSS.w, input.positionRWS); + + + float3 V = GetWorldSpaceNormalizeViewDir(input.positionRWS); + + + SurfaceData surfaceData; + BuiltinData builtinData; + Surface l; + ShaderData d; + GetSurfaceAndBuiltinData(IN, input, V, posInput, surfaceData, builtinData, l, d + #if NEED_FACING + , facing + #endif + ); + + + #ifdef _DEPTHOFFSET_ON + outputDepth = l.outputDepth; + #endif + + #ifdef WRITE_NORMAL_BUFFER + EncodeIntoNormalBuffer(ConvertSurfaceDataToNormalData(surfaceData), posInput.positionSS, outNormalBuffer); + #ifdef WRITE_MSAA_DEPTH + // In case we are rendering in MSAA, reading the an MSAA depth buffer is way too expensive. To avoid that, we export the depth to a color buffer + depthColor = v2f.pos.z; + #endif + #elif defined(WRITE_MSAA_DEPTH) // When we are MSAA depth only without normal buffer + // Due to the binding order of these two render targets, we need to have them both declared + outNormalBuffer = float4(0.0, 0.0, 0.0, 1.0); + // In case we are rendering in MSAA, reading the an MSAA depth buffer is way too expensive. To avoid that, we export the depth to a color buffer + depthColor = v2f.pos.z; + #elif defined(SCENESELECTIONPASS) + // We use depth prepass for scene selection in the editor, this code allow to output the outline correctly + outColor = float4(_ObjectId, _PassValue, 1.0, 1.0); + #endif + } + + ENDHLSL + } + + + Pass + { + Name "ScenePickingPass" + Tags + { + "LightMode" = "Picking" + } + + Tags { "RenderType" = "Opaque" "Queue" = "Geometry" "PreviewType" = "Plane" } + Cull [_CullingOption] + ZWrite [_ZWrite] + ZTest [_ZTestMode] + + + //------------------------------------------------------------------------------------- + // End Render Modes + //------------------------------------------------------------------------------------- + + HLSLPROGRAM + + #pragma target 4.5 + #pragma only_renderers d3d11 playstation xboxone xboxseries vulkan metal switch + #pragma multi_compile_instancing + #pragma editor_sync_compilation + #pragma instancing_options renderinglayer + + //#pragma shader_feature _ _SURFACE_TYPE_TRANSPARENT + //#pragma shader_feature_local _BLENDMODE_OFF _BLENDMODE_ALPHA _BLENDMODE_ADD _BLENDMODE_PRE_MULTIPLY + //#pragma shader_feature_local _ _ADD_PRECOMPUTED_VELOCITY + //#pragma shader_feature_local _ _TRANSPARENT_WRITES_MOTION_VEC + //#pragma shader_feature_local _ _ENABLE_FOG_ON_TRANSPARENT + //#pragma shader_feature_local _ _DISABLE_DECALS + //#pragma shader_feature_local _ _DISABLE_SSR + //#pragma shader_feature_local _ _DISABLE_SSR_TRANSPARENT + //#pragma shader_feature_local _REFRACTION_OFF _REFRACTION_PLANE _REFRACTION_SPHERE _REFRACTION_THIN + #pragma multi_compile _ WRITE_DECAL_BUFFER + #pragma multi_compile _ LOD_FADE_CROSSFADE + + #define SHADERPASS SHADERPASS_DEPTH_ONLY + #define SCENEPICKINGPASS + + + + #pragma shader_feature_local GLOW_ON + #pragma shader_feature_local FADE_ON + #pragma shader_feature_local OUTBASE_ON + #pragma shader_feature_local ONLYOUTLINE_ON + #pragma shader_feature_local GRADIENT_ON + #pragma shader_feature_local GRADIENT2COL_ON + #pragma shader_feature_local RADIALGRADIENT_ON + #pragma shader_feature_local COLORSWAP_ON + #pragma shader_feature_local HSV_ON + #pragma shader_feature_local CHANGECOLOR_ON + #pragma shader_feature_local CHANGECOLOR2_ON + #pragma shader_feature_local CHANGECOLOR3_ON + #pragma shader_feature_local COLORRAMP_ON + #pragma shader_feature_local GRADIENTCOLORRAMP_ON + #pragma shader_feature_local HITEFFECT_ON + #pragma shader_feature_local NEGATIVE_ON + #pragma shader_feature_local PIXELATE_ON + #pragma shader_feature_local GREYSCALE_ON + #pragma shader_feature_local POSTERIZE_ON + #pragma shader_feature_local BLUR_ON + #pragma shader_feature_local MOTIONBLUR_ON + #pragma shader_feature_local GHOST_ON + #pragma shader_feature_local ALPHAOUTLINE_ON + #pragma shader_feature_local INNEROUTLINE_ON + #pragma shader_feature_local ONLYINNEROUTLINE_ON + #pragma shader_feature_local HOLOGRAM_ON + #pragma shader_feature_local CHROMABERR_ON + #pragma shader_feature_local GLITCH_ON + #pragma shader_feature_local FLICKER_ON + #pragma shader_feature_local SHADOW_ON + #pragma shader_feature_local SHINE_ON + #pragma shader_feature_local CONTRAST_ON + #pragma shader_feature_local OVERLAY_ON + #pragma shader_feature_local OVERLAYMULT_ON + #pragma shader_feature_local DOODLE_ON + #pragma shader_feature_local WIND_ON + #pragma shader_feature_local WAVEUV_ON + #pragma shader_feature_local ROUNDWAVEUV_ON + #pragma shader_feature_local RECTSIZE_ON + #pragma shader_feature_local OFFSETUV_ON + #pragma shader_feature_local CLIPPING_ON + #pragma shader_feature_local RADIALCLIPPING_ON + #pragma shader_feature_local TEXTURESCROLL_ON + #pragma shader_feature_local ZOOMUV_ON + #pragma shader_feature_local DISTORT_ON + #pragma shader_feature_local WARP_ON + #pragma shader_feature_local TWISTUV_ON + #pragma shader_feature_local ROTATEUV_ON + #pragma shader_feature_local POLARUV_ON + #pragma shader_feature_local FISHEYE_ON + #pragma shader_feature_local PINCH_ON + #pragma shader_feature_local SHAKEUV_ON + + #pragma shader_feature_local GLOWTEX_ON + #pragma shader_feature_local OUTTEX_ON + #pragma shader_feature_local OUTDIST_ON + #pragma shader_feature_local OUTBASE8DIR_ON + #pragma shader_feature_local OUTBASEPIXELPERF_ON + #pragma shader_feature_local COLORRAMPOUTLINE_ON + #pragma shader_feature_local GREYSCALEOUTLINE_ON + #pragma shader_feature_local POSTERIZEOUTLINE_ON + #pragma shader_feature_local BLURISHD_ON + #pragma shader_feature_local MANUALWIND_ON + #pragma shader_feature_local ATLAS_ON + #pragma shader_feature_local PREMULTIPLYALPHA_ON + + #pragma shader_feature BILBOARD_ON + #pragma shader_feature BILBOARDY_ON + + #pragma shader_feature NORMALMAP_ON + + + #define _HDRP 1 +#define _USINGTEXCOORD1 1 +#define _USINGTEXCOORD2 1 + + + #pragma vertex Vert + #pragma fragment Frag + + // useful conversion functions to make surface shader code just work + + #define UNITY_DECLARE_TEX2D(name) TEXTURE2D(name); SAMPLER(sampler##name); + #define UNITY_DECLARE_TEX2D_NOSAMPLER(name) TEXTURE2D(name); + #define UNITY_DECLARE_TEX2DARRAY(name) TEXTURE2D_ARRAY(name); SAMPLER(sampler##name); + #define UNITY_DECLARE_TEX2DARRAY_NOSAMPLER(tex) TEXTURE2D_ARRAY(tex); + + #define UNITY_SAMPLE_TEX2DARRAY(tex,coord) SAMPLE_TEXTURE2D_ARRAY(tex, sampler##tex, coord.xy, coord.z) + #define UNITY_SAMPLE_TEX2DARRAY_LOD(tex,coord,lod) SAMPLE_TEXTURE2D_ARRAY_LOD(tex, sampler##tex, coord.xy, coord.z, lod) + #define UNITY_SAMPLE_TEX2D(tex, coord) SAMPLE_TEXTURE2D(tex, sampler##tex, coord) + #define UNITY_SAMPLE_TEX2D_SAMPLER(tex, samp, coord) SAMPLE_TEXTURE2D(tex, sampler##samp, coord) + + #define UNITY_SAMPLE_TEX2D_LOD(tex,coord, lod) SAMPLE_TEXTURE2D_LOD(tex, sampler_##tex, coord, lod) + #define UNITY_SAMPLE_TEX2D_SAMPLER_LOD(tex,samplertex,coord, lod) SAMPLE_TEXTURE2D_LOD (tex, sampler##samplertex,coord, lod) + + #if defined(UNITY_COMPILER_HLSL) + #define UNITY_INITIALIZE_OUTPUT(type,name) name = (type)0; + #else + #define UNITY_INITIALIZE_OUTPUT(type,name) + #endif + + #define sampler2D_float sampler2D + #define sampler2D_half sampler2D + + #undef WorldNormalVector + #define WorldNormalVector(data, normal) mul(normal, data.TBNMatrix) + + #define UnityObjectToWorldNormal(normal) mul(GetObjectToWorldMatrix(), normal) + + #ifndef SHADER_STAGE_FRAGMENT + #if !defined(SHADOW_ULTRA_LOW) && !defined(SHADOW_LOW) && !defined(SHADOW_MEDIUM) && !defined(SHADOW_HIGH) // ultra low come from volumetricLighting.compute + #define SHADOW_MEDIUM + #endif + #if !defined(AREA_SHADOW_LOW) && !defined(AREA_SHADOW_MEDIUM) && !defined(AREA_SHADOW_HIGH) // low come from volumetricLighting.compute + #define AREA_SHADOW_MEDIUM + #endif + #endif + + + +// HDRP Adapter stuff + #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Common.hlsl" + #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Texture.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/ShaderVariables.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/ShaderPass/FragInputs.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/ShaderPass/ShaderPass.cs.hlsl" + #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/TextureStack.hlsl" // Required to be include before we include properties as it define DECLARE_STACK_CB + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/NormalBuffer.hlsl" + +#if UNITY_VERSION >= 202239 + #include "Packages/com.unity.shadergraph/ShaderGraphLibrary/Functions.hlsl" // Need to be here for Gradient struct definition +#else + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/ShaderGraphHeader.hlsl" +#endif + #ifdef RAYTRACING_SHADER_GRAPH_DEFAULT + #define RAYTRACING_SHADER_GRAPH_HIGH + #endif + + #ifdef RAYTRACING_SHADER_GRAPH_RAYTRACED + #define RAYTRACING_SHADER_GRAPH_LOW + #endif + // end + + + + + // If we use subsurface scattering, enable output split lighting (for forward pass) + #if defined(_MATERIAL_FEATURE_SUBSURFACE_SCATTERING) && !defined(_SURFACE_TYPE_TRANSPARENT) + #define OUTPUT_SPLIT_LIGHTING + #endif + + #define HAVE_RECURSIVE_RENDERING + + #if SHADERPASS == SHADERPASS_TRANSPARENT_DEPTH_PREPASS + #if !defined(_DISABLE_SSR_TRANSPARENT) && !defined(SHADER_UNLIT) + #define WRITE_NORMAL_BUFFER + #endif + #endif + + #ifndef DEBUG_DISPLAY + // In case of opaque we don't want to perform the alpha test, it is done in depth prepass and we use depth equal for ztest (setup from UI) + // Don't do it with debug display mode as it is possible there is no depth prepass in this case + #if !defined(_SURFACE_TYPE_TRANSPARENT) && defined(_ALPHATEST) + #if SHADERPASS == SHADERPASS_FORWARD + #define SHADERPASS_FORWARD_BYPASS_ALPHA_TEST + #elif SHADERPASS == SHADERPASS_GBUFFER + #define SHADERPASS_GBUFFER_BYPASS_ALPHA_TEST + #endif + #endif + #endif + + // Define _DEFERRED_CAPABLE_MATERIAL for shader capable to run in deferred pass + #if defined(SHADER_LIT) && !defined(_SURFACE_TYPE_TRANSPARENT) + #define _DEFERRED_CAPABLE_MATERIAL + #endif + + // Translate transparent motion vector define + #if defined(_TRANSPARENT_WRITES_MOTION_VEC) && defined(_SURFACE_TYPE_TRANSPARENT) + #define _WRITE_TRANSPARENT_MOTION_VECTOR + #endif + + + + + CBUFFER_START(UnityPerMaterial) + float _UseShadowThreshold; + float _BlendMode; + float _EnableBlendModePreserveSpecularLighting; + float _RayTracing; + float _RefractionModel; + + + half4 _Color; + half4 _MainTex_ST, _MainTex_TexelSize; + half _Alpha, _AlphaCutoffValue; + + #if ATLAS_ON + half _MinXUV, _MaxXUV, _MinYUV, _MaxYUV; + #endif + + #if GLOW_ON + half4 _GlowColor; + half _Glow, _GlowGlobal; + #endif + + #if HSV_ON + half _HsvShift, _HsvSaturation, _HsvBright; + #endif + + #if DISTORT_ON + half4 _DistortTex_ST; + half _DistortTexXSpeed, _DistortTexYSpeed, _DistortAmount; + #endif + + #if FADE_ON + half4 _FadeBurnColor, _FadeTex_ST, _FadeBurnTex_ST; + half _FadeAmount, _FadeBurnWidth, _FadeBurnTransition,_FadeBurnGlow; + #endif + + #if OUTBASE_ON + half4 _OutlineColor; + half _OutlineAlpha, _OutlineGlow, _OutlineWidth; + int _OutlinePixelWidth; + #endif + + #if OUTTEX_ON + half4 _OutlineTex_ST; + half _OutlineTexXSpeed, _OutlineTexYSpeed; + #endif + + #if OUTDIST_ON + half4 _OutlineDistortTex_ST; + half _OutlineDistortTexXSpeed, _OutlineDistortTexYSpeed, _OutlineDistortAmount; + #endif + + #if ALPHAOUTLINE_ON + half _AlphaOutlineGlow, _AlphaOutlinePower, _AlphaOutlineMinAlpha, _AlphaOutlineBlend; + half4 _AlphaOutlineColor; + #endif + + #if INNEROUTLINE_ON + half _InnerOutlineThickness, _InnerOutlineAlpha, _InnerOutlineGlow; + half4 _InnerOutlineColor; + #endif + + #if GRADIENT_ON + half _GradBlend, _GradBoostX, _GradBoostY; + half4 _GradTopRightCol, _GradTopLeftCol, _GradBotRightCol, _GradBotLeftCol; + #endif + + #if COLORSWAP_ON + half4 _ColorSwapRed, _ColorSwapGreen, _ColorSwapBlue; + half _ColorSwapRedLuminosity, _ColorSwapGreenLuminosity, _ColorSwapBlueLuminosity, _ColorSwapBlend; + #endif + + #if CHANGECOLOR_ON + half4 _ColorChangeNewCol, _ColorChangeTarget; + half _ColorChangeTolerance, _ColorChangeLuminosity; + #endif + #if CHANGECOLOR2_ON + half4 _ColorChangeNewCol2, _ColorChangeTarget2; + half _ColorChangeTolerance2; + #endif + #if CHANGECOLOR3_ON + half4 _ColorChangeNewCol3, _ColorChangeTarget3; + half _ColorChangeTolerance3; + #endif + + #if COLORRAMP_ON + half _ColorRampLuminosity, _ColorRampBlend; + #endif + + #if HITEFFECT_ON + half4 _HitEffectColor; + half _HitEffectGlow, _HitEffectBlend; + #endif + + #if NEGATIVE_ON + half _NegativeAmount; + #endif + + #if PIXELATE_ON + half _PixelateSize; + #endif + + #if GREYSCALE_ON + half _GreyscaleLuminosity, _GreyscaleBlend; + half4 _GreyscaleTintColor; + #endif + + #if POSTERIZE_ON + half _PosterizeNumColors, _PosterizeGamma; + #endif + + #if BLUR_ON + half _BlurIntensity; + #endif + + #if MOTIONBLUR_ON + half _MotionBlurAngle, _MotionBlurDist; + #endif + + #if GHOST_ON + half _GhostColorBoost, _GhostTransparency, _GhostBlend; + #endif + + #if HOLOGRAM_ON + half _HologramStripesAmount, _HologramMinAlpha, _HologramUnmodAmount, _HologramStripesSpeed, _HologramMaxAlpha, _HologramBlend; + half4 _HologramStripeColor; + #endif + + #if CHROMABERR_ON + half _ChromAberrAmount, _ChromAberrAlpha; + #endif + + #if GLITCH_ON + half _GlitchAmount, _GlitchSize; + #endif + + #if FLICKER_ON + half _FlickerFreq, _FlickerPercent, _FlickerAlpha; + #endif + + #if SHADOW_ON + half _ShadowX, _ShadowY, _ShadowAlpha; + half4 _ShadowColor; + #endif + + #if SHINE_ON + half4 _ShineColor; + half _ShineLocation, _ShineRotate, _ShineWidth, _ShineGlow; + #endif + + #if CONTRAST_ON + half _Contrast, _Brightness; + #endif + + #if OVERLAY_ON + half4 _OverlayTex_ST, _OverlayColor; + half _OverlayGlow, _OverlayBlend, _OverlayTextureScrollXSpeed, _OverlayTextureScrollYSpeed; + #endif + + #if DOODLE_ON + half _HandDrawnAmount, _HandDrawnSpeed; + #endif + + #if WIND_ON + half _GrassSpeed, _GrassWind, _GrassManualAnim, _GrassRadialBend; + #endif + + #if WAVEUV_ON + float _WaveAmount, _WaveSpeed, _WaveStrength, _WaveX, _WaveY; + #endif + + #if ROUNDWAVEUV_ON + half _RoundWaveStrength, _RoundWaveSpeed; + #endif + + #if RECTSIZE_ON + half _RectSize; + #endif + + #if OFFSETUV_ON + half _OffsetUvX, _OffsetUvY; + #endif + + #if CLIPPING_ON + half _ClipUvLeft, _ClipUvRight, _ClipUvUp, _ClipUvDown; + #endif + + #if RADIALCLIPPING_ON + half _RadialStartAngle, _RadialClip, _RadialClip2; + #endif + + #if TEXTURESCROLL_ON + half _TextureScrollXSpeed, _TextureScrollYSpeed; + #endif + + #if ZOOMUV_ON + half _ZoomUvAmount; + #endif + + #if WARP_ON + half _WarpStrength, _WarpSpeed, _WarpScale; + #endif + + #if TWISTUV_ON + half _TwistUvAmount, _TwistUvPosX, _TwistUvPosY, _TwistUvRadius; + #endif + + #if ROTATEUV_ON + half _RotateUvAmount; + #endif + + #if FISHEYE_ON + half _FishEyeUvAmount; + #endif + + #if PINCH_ON + half _PinchUvAmount; + #endif + + #if SHAKEUV_ON + half _ShakeUvSpeed, _ShakeUvX, _ShakeUvY; + #endif + + #if NORMALMAP_ON + half _NormalStrength; + #endif + + float _RandomSeed; + + + + + CBUFFER_END + + + + // -- Property used by ScenePickingPass + #ifdef SCENEPICKINGPASS + float4 _SelectionID; + #endif + + // -- Properties used by SceneSelectionPass + #ifdef SCENESELECTIONPASS + int _ObjectId; + int _PassValue; + #endif + + + // data across stages, stripped like the above. + struct VertexToPixel + { + float4 pos : SV_POSITION; + float3 worldPos : TEXCOORD0; + float3 worldNormal : TEXCOORD1; + float4 worldTangent : TEXCOORD2; + float4 texcoord0 : TEXCOORD3; + float4 texcoord1 : TEXCOORD4; + float4 texcoord2 : TEXCOORD5; + // #if %TEXCOORD3REQUIREKEY% + float4 texcoord3 : TEXCOORD6; + // #endif + + // #if %SCREENPOSREQUIREKEY% + // float4 screenPos : TEXCOORD7; + // #endif + + // #if %VERTEXCOLORREQUIREKEY% + float4 vertexColor : COLOR; + // #endif + + // #if %EXTRAV2F0REQUIREKEY% + // float4 extraV2F0 : TEXCOORD8; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // float4 extraV2F1 : TEXCOORD9; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // float4 extraV2F2 : TEXCOORD10; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // float4 extraV2F3 : TEXCOORD11; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // float4 extraV2F4 : TEXCOORD12; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // float4 extraV2F5 : TEXCOORD13; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // float4 extraV2F6 : TEXCOORD14; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // float4 extraV2F7 : TEXCOORD15; + // #endif + + #if UNITY_ANY_INSTANCING_ENABLED + UNITY_VERTEX_INPUT_INSTANCE_ID + #endif // UNITY_ANY_INSTANCING_ENABLED + + #if _HDRP && (_PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR))) + float4 previousPositionCS : TEXCOORD16; // Contain previous transform position (in case of skinning for example) + float4 motionVectorCS : TEXCOORD17; + #endif + + UNITY_VERTEX_OUTPUT_STEREO + }; + + + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Debug/DebugDisplay.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/Material.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/Lit/Lit.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/BuiltinUtilities.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/MaterialUtilities.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/ShaderGraphFunctions.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/PickingSpaceTransforms.hlsl" + + + + + // data describing the user output of a pixel + struct Surface + { + half3 Albedo; + half Height; + half3 Normal; + half Smoothness; + half3 Emission; + half Metallic; + half3 Specular; + half Occlusion; + half SpecularPower; // for simple lighting + half Alpha; + float outputDepth; // if written, SV_Depth semantic is used. ShaderData.clipPos.z is unused value + // HDRP Only + half SpecularOcclusion; + half SubsurfaceMask; + half Thickness; + half CoatMask; + half CoatSmoothness; + half Anisotropy; + half IridescenceMask; + half IridescenceThickness; + int DiffusionProfileHash; + float SpecularAAThreshold; + float SpecularAAScreenSpaceVariance; + // requires _OVERRIDE_BAKEDGI to be defined, but is mapped in all pipelines + float3 DiffuseGI; + float3 BackDiffuseGI; + float3 SpecularGI; + float ior; + float3 transmittanceColor; + float atDistance; + float transmittanceMask; + // requires _OVERRIDE_SHADOWMASK to be defines + float4 ShadowMask; + + // for decals + float NormalAlpha; + float MAOSAlpha; + + + }; + + // Data the user declares in blackboard blocks + struct Blackboard + { + + float blackboardDummyData; + }; + + // data the user might need, this will grow to be big. But easy to strip + struct ShaderData + { + float4 clipPos; // SV_POSITION + float3 localSpacePosition; + float3 localSpaceNormal; + float3 localSpaceTangent; + + float3 worldSpacePosition; + float3 worldSpaceNormal; + float3 worldSpaceTangent; + float tangentSign; + + float3 worldSpaceViewDir; + float3 tangentSpaceViewDir; + + float4 texcoord0; + float4 texcoord1; + float4 texcoord2; + float4 texcoord3; + + float2 screenUV; + float4 screenPos; + + float4 vertexColor; + bool isFrontFace; + + float4 extraV2F0; + float4 extraV2F1; + float4 extraV2F2; + float4 extraV2F3; + float4 extraV2F4; + float4 extraV2F5; + float4 extraV2F6; + float4 extraV2F7; + + float3x3 TBNMatrix; + Blackboard blackboard; + }; + + struct VertexData + { + #if SHADER_TARGET > 30 + // uint vertexID : SV_VertexID; + #endif + float4 vertex : POSITION; + float3 normal : NORMAL; + float4 tangent : TANGENT; + float4 texcoord0 : TEXCOORD0; + + // optimize out mesh coords when not in use by user or lighting system + #if _URP && (_USINGTEXCOORD1 || _PASSMETA || _PASSFORWARD || _PASSGBUFFER) + float4 texcoord1 : TEXCOORD1; + #endif + + #if _URP && (_USINGTEXCOORD2 || _PASSMETA || ((_PASSFORWARD || _PASSGBUFFER) && defined(DYNAMICLIGHTMAP_ON))) + float4 texcoord2 : TEXCOORD2; + #endif + + #if _STANDARD && (_USINGTEXCOORD1 || (_PASSMETA || ((_PASSFORWARD || _PASSGBUFFER || _PASSFORWARDADD) && LIGHTMAP_ON))) + float4 texcoord1 : TEXCOORD1; + #endif + #if _STANDARD && (_USINGTEXCOORD2 || (_PASSMETA || ((_PASSFORWARD || _PASSGBUFFER) && DYNAMICLIGHTMAP_ON))) + float4 texcoord2 : TEXCOORD2; + #endif + + + #if _HDRP + float4 texcoord1 : TEXCOORD1; + float4 texcoord2 : TEXCOORD2; + #endif + + // #if %TEXCOORD3REQUIREKEY% + float4 texcoord3 : TEXCOORD3; + // #endif + + // #if %VERTEXCOLORREQUIREKEY% + float4 vertexColor : COLOR; + // #endif + + #if _PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR)) + float3 previousPositionOS : TEXCOORD4; // Contain previous transform position (in case of skinning for example) + #if defined (_ADD_PRECOMPUTED_VELOCITY) + float3 precomputedVelocity : TEXCOORD5; // Add Precomputed Velocity (Alembic computes velocities on runtime side). + #endif + #endif + + UNITY_VERTEX_INPUT_INSTANCE_ID + }; + + struct TessVertex + { + float4 vertex : INTERNALTESSPOS; + float3 normal : NORMAL; + float4 tangent : TANGENT; + float4 texcoord0 : TEXCOORD0; + float4 texcoord1 : TEXCOORD1; + float4 texcoord2 : TEXCOORD2; + + // #if %TEXCOORD3REQUIREKEY% + float4 texcoord3 : TEXCOORD3; + // #endif + + // #if %VERTEXCOLORREQUIREKEY% + float4 vertexColor : COLOR; + // #endif + + // #if %EXTRAV2F0REQUIREKEY% + // float4 extraV2F0 : TEXCOORD5; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // float4 extraV2F1 : TEXCOORD6; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // float4 extraV2F2 : TEXCOORD7; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // float4 extraV2F3 : TEXCOORD8; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // float4 extraV2F4 : TEXCOORD9; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // float4 extraV2F5 : TEXCOORD10; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // float4 extraV2F6 : TEXCOORD11; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // float4 extraV2F7 : TEXCOORD12; + // #endif + + #if _PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR)) + float3 previousPositionOS : TEXCOORD13; // Contain previous transform position (in case of skinning for example) + #if defined (_ADD_PRECOMPUTED_VELOCITY) + float3 precomputedVelocity : TEXCOORD14; + #endif + #endif + + UNITY_VERTEX_INPUT_INSTANCE_ID + UNITY_VERTEX_OUTPUT_STEREO + }; + + struct ExtraV2F + { + float4 extraV2F0; + float4 extraV2F1; + float4 extraV2F2; + float4 extraV2F3; + float4 extraV2F4; + float4 extraV2F5; + float4 extraV2F6; + float4 extraV2F7; + Blackboard blackboard; + float4 time; + }; + + + float3 WorldToTangentSpace(ShaderData d, float3 normal) + { + return mul(d.TBNMatrix, normal); + } + + float3 TangentToWorldSpace(ShaderData d, float3 normal) + { + return mul(normal, d.TBNMatrix); + } + + // in this case, make standard more like SRPs, because we can't fix + // unity_WorldToObject in HDRP, since it already does macro-fu there + + #if _STANDARD + float3 TransformWorldToObject(float3 p) { return mul(unity_WorldToObject, float4(p, 1)); }; + float3 TransformObjectToWorld(float3 p) { return mul(unity_ObjectToWorld, float4(p, 1)); }; + float4 TransformWorldToObject(float4 p) { return mul(unity_WorldToObject, p); }; + float4 TransformObjectToWorld(float4 p) { return mul(unity_ObjectToWorld, p); }; + float4x4 GetWorldToObjectMatrix() { return unity_WorldToObject; } + float4x4 GetObjectToWorldMatrix() { return unity_ObjectToWorld; } + #if (defined(SHADER_API_D3D11) || defined(SHADER_API_XBOXONE) || defined(UNITY_COMPILER_HLSLCC) || defined(SHADER_API_PSSL) || (SHADER_TARGET_SURFACE_ANALYSIS && !SHADER_TARGET_SURFACE_ANALYSIS_MOJOSHADER)) + #define UNITY_SAMPLE_TEX2D_LOD(tex,coord, lod) tex.SampleLevel (sampler##tex,coord, lod) + #define UNITY_SAMPLE_TEX2D_SAMPLER_LOD(tex,samplertex,coord, lod) tex.SampleLevel (sampler##samplertex,coord, lod) + #else + #define UNITY_SAMPLE_TEX2D_LOD(tex,coord,lod) tex2D (tex,coord,0,lod) + #define UNITY_SAMPLE_TEX2D_SAMPLER_LOD(tex,samplertex,coord,lod) tex2D (tex,coord,0,lod) + #endif + + #undef GetWorldToObjectMatrix() + + #define GetWorldToObjectMatrix() unity_WorldToObject + + + #endif + + float3 GetCameraWorldPosition() + { + #if _HDRP + return GetCameraRelativePositionWS(_WorldSpaceCameraPos); + #else + return _WorldSpaceCameraPos; + #endif + } + + #if _GRABPASSUSED + #if _STANDARD + TEXTURE2D(%GRABTEXTURE%); + SAMPLER(sampler_%GRABTEXTURE%); + #endif + + half3 GetSceneColor(float2 uv) + { + #if _STANDARD + return SAMPLE_TEXTURE2D(%GRABTEXTURE%, sampler_%GRABTEXTURE%, uv).rgb; + #else + return SHADERGRAPH_SAMPLE_SCENE_COLOR(uv); + #endif + } + #endif + + + + #if _STANDARD + UNITY_DECLARE_DEPTH_TEXTURE(_CameraDepthTexture); + float GetSceneDepth(float2 uv) { return SAMPLE_DEPTH_TEXTURE(_CameraDepthTexture, uv); } + float GetLinear01Depth(float2 uv) { return Linear01Depth(GetSceneDepth(uv)); } + float GetLinearEyeDepth(float2 uv) { return LinearEyeDepth(GetSceneDepth(uv)); } + #else + float GetSceneDepth(float2 uv) { return SHADERGRAPH_SAMPLE_SCENE_DEPTH(uv); } + float GetLinear01Depth(float2 uv) { return Linear01Depth(GetSceneDepth(uv), _ZBufferParams); } + float GetLinearEyeDepth(float2 uv) { return LinearEyeDepth(GetSceneDepth(uv), _ZBufferParams); } + #endif + + float3 GetWorldPositionFromDepthBuffer(float2 uv, float3 worldSpaceViewDir) + { + float eye = GetLinearEyeDepth(uv); + float3 camView = mul((float3x3)GetObjectToWorldMatrix(), transpose(mul(GetWorldToObjectMatrix(), UNITY_MATRIX_I_V)) [2].xyz); + + float dt = dot(worldSpaceViewDir, camView); + float3 div = worldSpaceViewDir/dt; + float3 wpos = (eye * div) + GetCameraWorldPosition(); + return wpos; + } + + #if _HDRP + float3 ObjectToWorldSpacePosition(float3 pos) + { + return GetAbsolutePositionWS(TransformObjectToWorld(pos)); + } + #else + float3 ObjectToWorldSpacePosition(float3 pos) + { + return TransformObjectToWorld(pos); + } + #endif + + #if _STANDARD + UNITY_DECLARE_SCREENSPACE_TEXTURE(_CameraDepthNormalsTexture); + float3 GetSceneNormal(float2 uv, float3 worldSpaceViewDir) + { + float4 depthNorms = UNITY_SAMPLE_SCREENSPACE_TEXTURE(_CameraDepthNormalsTexture, uv); + float3 norms = DecodeViewNormalStereo(depthNorms); + norms = mul((float3x3)GetWorldToViewMatrix(), norms) * 0.5 + 0.5; + return norms; + } + #elif _HDRP && !_DECALSHADER + + float3 GetSceneNormal(float2 uv, float3 worldSpaceViewDir) + { + NormalData nd; + DecodeFromNormalBuffer(_ScreenSize.xy * uv, nd); + return nd.normalWS; + } + #elif _URP + #if (SHADER_LIBRARY_VERSION_MAJOR >= 10) + #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/DeclareNormalsTexture.hlsl" + #endif + + float3 GetSceneNormal(float2 uv, float3 worldSpaceViewDir) + { + #if (SHADER_LIBRARY_VERSION_MAJOR >= 10) + return SampleSceneNormals(uv); + #else + float3 wpos = GetWorldPositionFromDepthBuffer(uv, worldSpaceViewDir); + return normalize(-cross(ddx(wpos), ddy(wpos))) * 0.5 + 0.5; + #endif + + } + #endif + + #if _HDRP + + half3 UnpackNormalmapRGorAG(half4 packednormal) + { + // This do the trick + packednormal.x *= packednormal.w; + + half3 normal; + normal.xy = packednormal.xy * 2 - 1; + normal.z = sqrt(1 - saturate(dot(normal.xy, normal.xy))); + return normal; + } + half3 UnpackNormal(half4 packednormal) + { + #if defined(UNITY_NO_DXT5nm) + return packednormal.xyz * 2 - 1; + #else + return UnpackNormalmapRGorAG(packednormal); + #endif + } + #endif + #if _HDRP || _URP + + half3 UnpackScaleNormal(half4 packednormal, half scale) + { + #ifndef UNITY_NO_DXT5nm + // Unpack normal as DXT5nm (1, y, 1, x) or BC5 (x, y, 0, 1) + // Note neutral texture like "bump" is (0, 0, 1, 1) to work with both plain RGB normal and DXT5nm/BC5 + packednormal.x *= packednormal.w; + #endif + half3 normal; + normal.xy = (packednormal.xy * 2 - 1) * scale; + normal.z = sqrt(1 - saturate(dot(normal.xy, normal.xy))); + return normal; + } + + #endif + + + void GetSun(out float3 lightDir, out float3 color) + { + lightDir = float3(0.5, 0.5, 0); + color = 1; + #if _HDRP + if (_DirectionalLightCount > 0) + { + DirectionalLightData light = _DirectionalLightDatas[0]; + lightDir = -light.forward.xyz; + color = light.color; + } + #elif _STANDARD + lightDir = normalize(_WorldSpaceLightPos0.xyz); + color = _LightColor0.rgb; + #elif _URP + Light light = GetMainLight(); + lightDir = light.direction; + color = light.color; + #endif + } + + + + + + + + + + TEXTURE2D(_MainTex); + SAMPLER(sampler_MainTex); + + #if GLOW_ON + TEXTURE2D(_GlowTex); + SAMPLER(sampler_GlowTex); + #endif + + #if FADE_ON + TEXTURE2D(_FadeTex); + SAMPLER(sampler_FadeTex); + + TEXTURE2D(_FadeBurnTex); + SAMPLER(sampler_FadeBurnTex); + #endif + + #if DISTORT_ON + TEXTURE2D(_DistortTex); + SAMPLER(sampler_DistortTex); + #endif + + #if OUTTEX_ON + TEXTURE2D(_OutlineTex); + SAMPLER(sampler_OutlineTex); + #endif + + #if OUTDIST_ON + TEXTURE2D(_OutlineDistortTex); + SAMPLER(sampler_OutlineDistortTex); + #endif + + #if COLORSWAP_ON + TEXTURE2D(_ColorSwapTex); + SAMPLER(sampler_ColorSwapTex); + #endif + + #if COLORRAMP_ON + TEXTURE2D(_ColorRampTex); + TEXTURE2D(_ColorRampTexGradient); + SAMPLER(sampler_ColorRampTex); + SAMPLER(sampler_ColorRampTexGradient); + #endif + + #if SHINE_ON + TEXTURE2D(_ShineMask); + SAMPLER(sampler_ShineMask); + #endif + + #if OVERLAY_ON + TEXTURE2D(_OverlayTex); + SAMPLER(sampler_OverlayTex); + #endif + + #if NORMALMAP_ON + TEXTURE2D(_NormalMap); + SAMPLER(sampler_NormalMap); + #endif + + + half3 GetPixel(in int offsetX, in int offsetY, in half2 uv, in Texture2D _tex, in SamplerState _sampler) + { + half2 _uv = uv + half2(offsetX * _MainTex_TexelSize.x, offsetY * _MainTex_TexelSize.y); + half4 col = SAMPLE_TEXTURE2D(_tex, _sampler, _uv); + return col.rgb; + } + + + //BLURS------------------------------------------------------------------------- + half4 Blur(half2 uv, Texture2D source, SamplerState sampler_source, half Intensity) + { + const half2 texelSize = 1.0 / _ScreenParams.xy; + const half4 color = SAMPLE_TEXTURE2D(source, sampler_source, uv); + const half2 offset = Intensity * texelSize; + + half4 accumulatedColor = color; + half accumulatedWeight = 1.0; + for (int x = -1; x <= 1; x++) + { + for (int y = -1; y <= 1; y++) + { + const half2 sampleUV = uv + half2(x, y) * offset; + const half4 sampleColor = SAMPLE_TEXTURE2D(source, sampler_source, sampleUV); + + accumulatedColor += sampleColor; + accumulatedWeight += 1.0; + } + } + + half4 blurredColor = accumulatedColor / accumulatedWeight; + return blurredColor; + } + + half BlurHD_G(half bhqp, half x) + { + return exp(-(x * x) / (2.0 * bhqp * bhqp)); + } + half4 BlurHD(half2 uv, Texture2D source, SamplerState sampler_source, half BlurAmount, half xScale, half yScale) + { + int iterations = 16; + int halfIterations = iterations / 2; + half sigmaX = 0.1 + BlurAmount * 0.5; + half sigmaY = sigmaX; + half total = 0.0; + half4 ret = half4(0, 0, 0, 0); + for (int iy = 0; iy < iterations; ++iy) + { + half fy = BlurHD_G(sigmaY, half(iy) -half(halfIterations)); + half offsetY = half(iy - halfIterations) * 0.00390625 * xScale; + for (int ix = 0; ix < iterations; ++ix) + { + half fx = BlurHD_G(sigmaX, half(ix) - half(halfIterations)); + half offsetX = half(ix - halfIterations) * 0.00390625 * yScale; + total += fx * fy; + ret += SAMPLE_TEXTURE2D(source, sampler_source, uv + half2(offsetX, offsetY)) * fx * fy; + } + } + return ret / total; + } + //----------------------------------------------------------------------- + + + //------------------------------------------- + half RemapFloat(half inValue, half inMin, half inMax, half outMin, half outMax){ + return outMin + (inValue - inMin) * (outMax - outMin) / (inMax - inMin); + } + //------------------------------------------- + + //----------------------------------------------------------------------- + half rand(half2 seed, half offset) { + return (frac(sin(dot(seed, half2(12.9898, 78.233))) * 43758.5453) + offset) % 1.0; + } + + half rand2(half2 seed, half offset) { + return (frac(sin(dot(seed * floor(50 + (_Time.x % 1.0) * 12.), half2(127.1, 311.7))) * 43758.5453123) + offset) % 1.0; + } + + half rand2CustomTime(half2 seed, half offset, half customTime) { + return (frac(sin(dot(seed * floor(50 + (customTime % 1.0) * 12.), half2(127.1, 311.7))) * 43758.5453123) + offset) % 1.0; + } + //----------------------------------------------------------------------- + + + void Ext_ModifyVertex0 (inout VertexData v, inout ExtraV2F d) + { + //BILBOARD_ON + #if BILBOARD_ON + half3 camRight = mul((half3x3)unity_CameraToWorld, half3(1,0,0)); + half3 camUp = half3(0,1,0); + #if BILBOARDY_ON + camUp = mul((half3x3)unity_CameraToWorld, half3(0,1,0)); + #endif + half3 localPos = v.vertex.x * camRight + v.vertex.y * camUp; + v.vertex = half4(localPos, 1); + #endif + //----------------------------------------------------------- + + v.texcoord0.xy = TRANSFORM_TEX(v.texcoord0.xy, _MainTex); + half2 center = half2(0.5, 0.5); + #if ATLAS_ON + center = half2((_MaxXUV + _MinXUV) / 2.0, (_MaxYUV + _MinYUV) / 2.0); + #endif + + //POLARUV_ON + #if POLARUV_ON + v.texcoord0.xy = v.texcoord0.xy - center; + #endif + + //---------------------------------------- + + //ROTATEUV_ON + #if ROTATEUV_ON + half2 uvC = v.texcoord0.xy; + half cosAngle = cos(_RotateUvAmount); + half sinAngle = sin(_RotateUvAmount); + half2x2 rot = half2x2(cosAngle, -sinAngle, sinAngle, cosAngle); + uvC -= center; + v.texcoord0.xy = mul(rot, uvC); + v.texcoord0.xy += center; + #endif + //-------------------- + + #if RECTSIZE_ON + v.vertex.xyz += (v.vertex.xyz * (_RectSize - 1.0)); + #endif + + #if OUTTEX_ON + v.texcoord1.xy = TRANSFORM_TEX(v.texcoord0.xy, _OutlineTex); + #endif + + #if OUTDIST_ON + v.texcoord2.xy = TRANSFORM_TEX(v.texcoord0.xy, _OutlineDistortTex); + #endif + + #if DISTORT_ON + v.texcoord3.xy = TRANSFORM_TEX(v.texcoord0.xy, _DistortTex); + #endif + } + + void Ext_SurfaceFunction0 (inout Surface o, ShaderData d) + { + half randomSeed = _RandomSeed; + + float2 uvRect = d.texcoord0; + half2 center = half2(0.5, 0.5); + #if ATLAS_ON + center = half2((_MaxXUV + _MinXUV) / 2.0, (_MaxYUV + _MinYUV) / 2.0); + uvRect = half2((d.texcoord0.x - _MinXUV) / (_MaxXUV - _MinXUV), (d.texcoord0.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half2 centerTiled = half2(center.x * _MainTex_ST.x, center.y * _MainTex_ST.y); + + //CLIPPING_ON + #if CLIPPING_ON + half2 tiledUv = half2(d.texcoord0.x / _MainTex_ST.x, d.texcoord0.y / _MainTex_ST.y); + #if ATLAS_ON + tiledUv = half2((tiledUv.x - _MinXUV) / (_MaxXUV - _MinXUV), (tiledUv.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + clip((1 - _ClipUvUp) - tiledUv.y); + clip(tiledUv.y - _ClipUvDown); + clip((1 - _ClipUvRight) - tiledUv.x); + clip(tiledUv.x - _ClipUvLeft); + #endif + //---------------------------------- + + //RADIALCLIPPING_ON + #if RADIALCLIPPING_ON + half2 tiledUv2 = half2(d.texcoord0.x / _MainTex_ST.x, d.texcoord0.y / _MainTex_ST.y); + #if ATLAS_ON + tiledUv2 = half2((tiledUv2.x - _MinXUV) / (_MaxXUV - _MinXUV), (tiledUv2.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half startAngle = _RadialStartAngle - _RadialClip; + half endAngle = _RadialStartAngle + _RadialClip2; + half offset0 = clamp(0, 360, startAngle + 360); + half offset360 = clamp(0, 360, endAngle - 360); + half2 atan2Coord = half2(lerp(-1, 1, tiledUv2.x), lerp(-1, 1, tiledUv2.y)); + half atanAngle = atan2(atan2Coord.y, atan2Coord.x) * 57.3; // angle in degrees + if(atanAngle < 0) atanAngle = 360 + atanAngle; + if(atanAngle >= startAngle && atanAngle <= endAngle) discard; + if(atanAngle <= offset360) discard; + if(atanAngle >= offset0) discard; + #endif + + //----------------------------- + + //TEXTURESCROLL_ON && ATLAS_ON + #if TEXTURESCROLL_ON && ATLAS_ON + d.texcoord0.xy = half2(_MinXUV + ((_MaxXUV - _MinXUV) * (abs(((_Time.y + randomSeed) * _TextureScrollXSpeed) + uvRect.x) % 1)), + _MinYUV + ((_MaxYUV - _MinYUV) * (abs(((_Time.y + randomSeed) * _TextureScrollYSpeed) + uvRect.y) % 1))); + #endif + //---------------------------- + + //OFFSETUV_ON + #if OFFSETUV_ON + #if ATLAS_ON + d.texcoord0.xy = half2(_MinXUV + ((_MaxXUV - _MinXUV) * (abs((_OffsetUvX + uvRect.x) % 1))), + _MinYUV + ((_MaxYUV - _MinYUV) * (abs(_OffsetUvY + uvRect.y) % 1))); + #else + d.texcoord0.xy += half2(_OffsetUvX, _OffsetUvY); + #endif + #endif + + //---------------------- + + //POLARUV_ON + #if POLARUV_ON + d.texcoord0.xy = half2(atan2(d.texcoord0.y, d.texcoord0.x) / (2.0f * 3.141592653589f), length(d.texcoord0.xy)); + d.texcoord0.xy *= _MainTex_ST.xy; + #endif + + //-------------------------------------- + + //TWISTUV_ON + #if TWISTUV_ON + #if ATLAS_ON + _TwistUvPosX = ((_MaxXUV - _MinXUV) * _TwistUvPosX) + _MinXUV; + _TwistUvPosY = ((_MaxYUV - _MinYUV) * _TwistUvPosY) + _MinYUV; + #endif + half2 tempUv = d.texcoord0.xy - half2(_TwistUvPosX * _MainTex_ST.x, _TwistUvPosY * _MainTex_ST.y); + _TwistUvRadius *= (_MainTex_ST.x + _MainTex_ST.y) / 2; + half percent = (_TwistUvRadius - length(tempUv)) / _TwistUvRadius; + half theta = percent * percent * (2.0 * sin(_TwistUvAmount)) * 8.0; + half s = sin(theta); + half c = cos(theta); + half beta = max(sign(_TwistUvRadius - length(tempUv)), 0.0); + tempUv = half2(dot(tempUv, half2(c, -s)), dot(tempUv, half2(s, c))) * beta + tempUv * (1 - beta); + tempUv += half2(_TwistUvPosX * _MainTex_ST.x, _TwistUvPosY * _MainTex_ST.y); + d.texcoord0.xy = tempUv; + #endif + + //-------------------------------------------- + + //FISHEYE_ON + #if FISHEYE_ON + half bind = length(centerTiled); + half2 dF = d.texcoord0.xy - centerTiled; + half dFlen = length(dF); + half fishInt = (3.14159265359 / bind) * (_FishEyeUvAmount + 0.001); + d.texcoord0.xy = centerTiled + (dF / (max(0.0001, dFlen))) * tan(dFlen * fishInt) * bind / tan(bind * fishInt); + #endif + //--------------------------------------------- + + //PINCH_ON + #if PINCH_ON + half2 dP = d.texcoord0.xy - centerTiled; + half pinchInt = (3.141592 / length(centerTiled)) * (-_PinchUvAmount + 0.001); + d.texcoord0.xy = centerTiled + normalize(dP) * atan(length(dP) * -pinchInt * 10.0) * 0.5 / atan(-pinchInt * 5); + #endif + + //--------------------------------------------- + + //ZOOMUV_ON + #if ZOOMUV_ON + d.texcoord0.xy -= centerTiled; + d.texcoord0.xy = d.texcoord0.xy * _ZoomUvAmount; + d.texcoord0.xy += centerTiled; + #endif + + //----------------------------------------------- + + //DOODLE_ON + #if DOODLE_ON + half2 uvCopy = uvRect; + _HandDrawnSpeed = (floor((_Time.x + randomSeed) * 20 * _HandDrawnSpeed) / _HandDrawnSpeed) * _HandDrawnSpeed; + uvCopy.x = sin((uvCopy.x * _HandDrawnAmount + _HandDrawnSpeed) * 4); + uvCopy.y = cos((uvCopy.y * _HandDrawnAmount + _HandDrawnSpeed) * 4); + d.texcoord0.xy = lerp(d.texcoord0.xy, d.texcoord0.xy + uvCopy, 0.0005 * _HandDrawnAmount); + #endif + + //-------------------------- + + //SHAKEUV_ON + #if SHAKEUV_ON + half xShake = sin((_Time.x + randomSeed) * _ShakeUvSpeed * 50) * _ShakeUvX; + half yShake = cos((_Time.x + randomSeed) * _ShakeUvSpeed * 50) * _ShakeUvY; + d.texcoord0.xy += half2(xShake * 0.012, yShake * 0.01); + #endif + + //------------------------------------------- + + //RECTSIZE_ON + #if RECTSIZE_ON + d.texcoord0.xy = d.texcoord0.xy * (_RectSize).xx + (((-_RectSize * 0.5) + 0.5)).xx; + #endif + + //------------------------------------------- + + //DISTORT_ON + #if DISTORT_ON + #if ATLAS_ON + d.texcoord3.x = d.texcoord3.x * (1 / (_MaxXUV - _MinXUV)); + d.texcoord3.y = d.texcoord3.y * (1 / (_MaxYUV - _MinYUV)); + #endif + + d.texcoord3.x += ((_Time.x + _RandomSeed) * _DistortTexXSpeed) % 1; + d.texcoord3.y += ((_Time.x + _RandomSeed) * _DistortTexYSpeed) % 1; + half distortAmnt = (SAMPLE_TEXTURE2D(_DistortTex, sampler_DistortTex, d.texcoord3.xy).r - 0.5) * 0.2 * _DistortAmount; + d.texcoord0.x += distortAmnt; + d.texcoord0.y += distortAmnt; + #endif + //------------------------------------------------------- + + //WARP_ON + #if WARP_ON + half2 warpUv = half2(d.texcoord0.x / _MainTex_ST.x, d.texcoord0.y / _MainTex_ST.y); + #if ATLAS_ON + warpUv = half2((warpUv.x - _MinXUV) / (_MaxXUV - _MinXUV), (warpUv.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + const float tau = 6.283185307179586; + float xWarp = (_Time.y + randomSeed) * _WarpSpeed + warpUv.x * tau / _WarpScale; + float yWarp = (_Time.y + randomSeed) * _WarpSpeed + warpUv.y * tau / _WarpScale; + float2 warp = float2(sin(xWarp), sin(yWarp)) * _WarpStrength; + d.texcoord0.xy += warp; + #endif + + //------------------------------------------------------- + + //WAVEUV_ON + #if WAVEUV_ON + float2 uvWave = half2(_WaveX * _MainTex_ST.x, _WaveY * _MainTex_ST.y) - d.texcoord0.xy; + uvWave %= 1; + #if ATLAS_ON + uvWave = half2(_WaveX, _WaveY) - uvRect; + #endif + uvWave.x *= _ScreenParams.x / _ScreenParams.y; + float waveTime = _Time.y + randomSeed; + float angWave = (sqrt(dot(uvWave, uvWave)) * _WaveAmount) - ((waveTime * _WaveSpeed)); + d.texcoord0.xy = d.texcoord0.xy + uvWave * sin(angWave) * (_WaveStrength / 1000.0); + #endif + //---------------------------------------------------- + + //ROUNDWAVEUV_ON + #if ROUNDWAVEUV_ON + half xWave = ((0.5 * _MainTex_ST.x) - uvRect.x); + half yWave = ((0.5 * _MainTex_ST.y) - uvRect.y) * (_MainTex_TexelSize.w / _MainTex_TexelSize.z); + half ripple = -sqrt(xWave*xWave + yWave* yWave); + d.texcoord0.xy += (sin((ripple + (_Time.y + randomSeed) * (_RoundWaveSpeed/10.0)) / 0.015) * (_RoundWaveStrength/10.0)) % 1; + #endif + //---------------------------------------------------- + + + //WIND_ON + #if WIND_ON + half windOffset = sin((_Time.x + randomSeed) * _GrassSpeed * 10); + half2 windCenter = half2(0.5, 0.1); + #if ATLAS_ON + windCenter.x = ((_MaxXUV - _MinXUV) * windCenter.x) + _MinXUV; + windCenter.y = ((_MaxYUV - _MinYUV) * windCenter.y) + _MinYUV; + #endif + #if !MANUALWIND_ON + d.texcoord0.x = fmod(abs(lerp(d.texcoord0.x, d.texcoord0.x + (_GrassWind * 0.01 * windOffset), uvRect.y)), 1); + #else + d.texcoord0.x = fmod(abs(lerp(d.texcoord0.x, d.texcoord0.x + (_GrassWind * 0.01 * _GrassManualAnim), uvRect.y)), 1); + windOffset = _GrassManualAnim; + #endif + half2 delta = d.texcoord0.xy - windCenter; + half delta2 = dot(delta.xy, delta.xy); + half2 delta_offset = delta2 * windOffset; + d.texcoord0.xy = d.texcoord0.xy + half2(delta.y, -delta.x) * delta_offset * _GrassRadialBend; + #endif + + //-------------------------------------------------------- + + //TEXTURESCROLL_ON && !ATLAS_ON + #if TEXTURESCROLL_ON && !ATLAS_ON + d.texcoord0.x += ((_Time.y + randomSeed) * _TextureScrollXSpeed) % 1; + d.texcoord0.y += ((_Time.y + randomSeed) * _TextureScrollYSpeed) % 1; + #endif + //------------------------------ + + //PIXELATE_ON + #if PIXELATE_ON + half aspectRatio = _MainTex_TexelSize.x / _MainTex_TexelSize.y; + half2 pixelSize = float2(_PixelateSize, _PixelateSize * aspectRatio); + d.texcoord0.xy = floor(d.texcoord0.xy * pixelSize) / pixelSize; + #endif + //-------------- + + half4 col = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy); + half originalAlpha = col.a; + col *= d.vertexColor; + + //NORMAL MAP + #if NORMALMAP_ON + half4 normalSample = SAMPLE_TEXTURE2D(_NormalMap, sampler_NormalMap, d.texcoord0.xy); + half3 normalTS = UnpackNormal(normalSample); + normalTS.xy *= _NormalStrength; + o.Normal = normalTS; + #endif + + + //GLITCH_ON + #if GLITCH_ON + half2 uvGlitch = uvRect; + uvGlitch.y -= 0.5; + half lineNoise = pow(rand2(floor(uvGlitch * half2(24., 19.) * _GlitchSize) * 4.0, randomSeed), 3.0) * _GlitchAmount + * pow(rand2(floor(uvGlitch * half2(38., 14.) * _GlitchSize) * 4.0, randomSeed), 3.0); + col = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(lineNoise * 0.02 * rand2(half2(2.0, 1), randomSeed), 0)) * d.vertexColor; + #endif + //-------------------------------------- + + //CHROMABERR_ON + #if CHROMABERR_ON + half4 r = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(_ChromAberrAmount/10, 0)) * d.vertexColor; + half4 b = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(-_ChromAberrAmount/10, 0)) * d.vertexColor; + col = half4(r.r * r.a, col.g, b.b * b.a, max(max(r.a, b.a) * _ChromAberrAlpha, col.a)); + #endif + + //-------------------------------- + + //BLUR_ON + #if BLUR_ON + #if ATLAS_ON + #if !BLURISHD_ON + col = BlurHD(d.texcoord0.xy, _MainTex, sampler_MainTex, _BlurIntensity, (_MaxXUV - _MinXUV), (_MaxYUV - _MinYUV)) * d.vertexColor; + #else + col = Blur(d.texcoord0.xy, _MainTex, sampler_MainTex, _BlurIntensity * (_MaxXUV - _MinXUV)) * d.vertexColor; + #endif + #else + #if !BLURISHD_ON + col = BlurHD(d.texcoord0.xy, _MainTex, sampler_MainTex, _BlurIntensity, 1, 1) * d.vertexColor; + #else + col = Blur(d.texcoord0.xy, _MainTex, sampler_MainTex, _BlurIntensity) * d.vertexColor; + #endif + #endif + #endif + + //-------------------- + + //MOTIONBLUR_ON + #if MOTIONBLUR_ON + _MotionBlurAngle = _MotionBlurAngle * 3.1415926; + #define rot(n) mul(n, half2x2(cos(_MotionBlurAngle), -sin(_MotionBlurAngle), sin(_MotionBlurAngle), cos(_MotionBlurAngle))) + _MotionBlurDist = _MotionBlurDist * 0.005; + #if ATLAS_ON + _MotionBlurDist *= (_MaxXUV - _MinXUV); + #endif + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(-_MotionBlurDist, -_MotionBlurDist))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(-_MotionBlurDist * 2, -_MotionBlurDist * 2))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(-_MotionBlurDist * 3, -_MotionBlurDist * 3))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(-_MotionBlurDist * 4, -_MotionBlurDist * 4))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(_MotionBlurDist, _MotionBlurDist))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(_MotionBlurDist * 2, _MotionBlurDist * 2))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(_MotionBlurDist * 3, _MotionBlurDist * 3))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(_MotionBlurDist * 4, _MotionBlurDist * 4))); + col.rgb = col.rgb / 9; + #endif + //------------------------------------ + + //NEGATIVE_ON + #if NEGATIVE_ON + col.rgb = lerp(col.rgb, 1 - col.rgb, _NegativeAmount); + #endif + + //-------------- + half luminance = 0; + + //GREYSCALE_ON && !GREYSCALEOUTLINE_ON + #if GREYSCALE_ON && !GREYSCALEOUTLINE_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + luminance = saturate(luminance + _GreyscaleLuminosity); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _GreyscaleTintColor, _GreyscaleBlend); + #endif + //------------------------------------ + + //GHOST_ON + #if GHOST_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + half4 ghostResult; + ghostResult.a = saturate(luminance - _GhostTransparency) * col.a; + ghostResult.rgb = col.rgb * (luminance + _GhostColorBoost); + col = lerp(col, ghostResult, _GhostBlend); + #endif + //------------------------------------ + + //INNEROUTLINE_ON + #if INNEROUTLINE_ON + half3 innerT = abs(GetPixel(0, _InnerOutlineThickness, d.texcoord0.xy, _MainTex, sampler_MainTex) - GetPixel(0, -_InnerOutlineThickness, d.texcoord0.xy, _MainTex, sampler_MainTex)); + innerT += abs(GetPixel(_InnerOutlineThickness, 0, d.texcoord0.xy, _MainTex, sampler_MainTex) - GetPixel(-_InnerOutlineThickness, 0, d.texcoord0.xy, _MainTex, sampler_MainTex)); + #if !ONLYINNEROUTLINE_ON + innerT = (innerT / 2.0) * col.a * _InnerOutlineAlpha; + col.rgb += length(innerT) * _InnerOutlineColor.rgb * _InnerOutlineGlow; + #else + innerT *= col.a * _InnerOutlineAlpha; + col.rgb = length(innerT) * _InnerOutlineColor.rgb * _InnerOutlineGlow; + col.a = step(0.3, col.r+col.g+col.b); + #endif + #endif + //------------------------------------------------------- + + //HITEFFECT_ON + #if HITEFFECT_ON + col.rgb = lerp(col.rgb, _HitEffectColor.rgb * _HitEffectGlow, _HitEffectBlend); + #endif + //-------------------- + + //GRADIENT_ON + #if GRADIENT_ON + half2 tiledUvGrad = half2(uvRect.x / _MainTex_ST.x, uvRect.y / _MainTex_ST.y); + #if GRADIENT2COL_ON + _GradTopRightCol = _GradTopLeftCol; + _GradBotRightCol = _GradBotLeftCol; + #endif + #if RADIALGRADIENT_ON + half radialDist = 1 - length(tiledUvGrad - half2(0.5, 0.5)); + radialDist *= (_MainTex_TexelSize.w / _MainTex_TexelSize.z); + radialDist = saturate(_GradBoostX * radialDist); + half4 gradientResult = lerp(_GradTopLeftCol, _GradBotLeftCol, radialDist); + #else + half gradXLerpFactor = saturate(pow(tiledUvGrad.x, _GradBoostX)); + half4 gradientResult = lerp(lerp(_GradBotLeftCol, _GradBotRightCol, gradXLerpFactor), + lerp(_GradTopLeftCol, _GradTopRightCol, gradXLerpFactor), saturate(pow(tiledUvGrad.y, _GradBoostY))); + #endif + gradientResult = lerp(col, gradientResult, _GradBlend); + col.rgb = gradientResult.rgb * col.a; + col.a *= gradientResult.a; + #endif + //-------------------------------------------------------------------- + + //CONTRAST_ON + #if CONTRAST_ON + col.rgb = (col.rgb - float3(0.5, 0.5, 0.5)) * _Contrast + float3(0.5, 0.5, 0.5); + col.rgb += _Brightness; + #endif + + //------------------------------------------------------------------- + + //COLORSWAP_ON + #if COLORSWAP_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + half4 swapMask = SAMPLE_TEXTURE2D(_ColorSwapTex, sampler_ColorSwapTex, d.texcoord0.xy); + swapMask.rgb *= swapMask.a; + half3 redSwap = _ColorSwapRed * swapMask.r * saturate(luminance + _ColorSwapRedLuminosity); + half3 greenSwap = _ColorSwapGreen * swapMask.g * saturate(luminance + _ColorSwapGreenLuminosity); + half3 blueSwap = _ColorSwapBlue * swapMask.b * saturate(luminance + _ColorSwapBlueLuminosity); + swapMask.rgb = col.rgb * saturate(1 - swapMask.r - swapMask.g - swapMask.b); + col.rgb = lerp(col.rgb, swapMask.rgb + redSwap + greenSwap + blueSwap, _ColorSwapBlend); + #endif + //-------------------------------------------------------------------- + + //COLORRAMP_ON && !COLORRAMPOUTLINE_ON + #if COLORRAMP_ON && !COLORRAMPOUTLINE_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + luminance = saturate(luminance + _ColorRampLuminosity); + #if GRADIENTCOLORRAMP_ON + col.rgb = lerp(col.rgb, SAMPLE_TEXTURE2D(_ColorRampTexGradient, sampler_ColorRampTexGradient, half2(luminance, 0)).rgb, _ColorRampBlend); + #else + col.rgb = lerp(col.rgb, SAMPLE_TEXTURE2D(_ColorRampTex, sampler_ColorRampTex, half2(luminance, 0)).rgb, _ColorRampBlend); + #endif + #endif + //-------------------------------------------------------------------- + + //CHANGECOLOR_ON + #if CHANGECOLOR_ON + float3 currChangeColor = saturate(col.rgb); + luminance = 0.3 * currChangeColor.r + 0.59 * currChangeColor.g + 0.11 * currChangeColor.b; + luminance = saturate(luminance + _ColorChangeLuminosity); + half3 dif = abs(currChangeColor - _ColorChangeTarget.rgb); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _ColorChangeNewCol.rgb, + max(sign(1 - saturate(dif.x + dif.y + dif.z) - _ColorChangeTolerance), 0.0)); + #if CHANGECOLOR2_ON + dif = abs(currChangeColor - _ColorChangeTarget2.rgb); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _ColorChangeNewCol2.rgb, + max(sign(1 - saturate(dif.x + dif.y + dif.z) - _ColorChangeTolerance2), 0.0)); + #endif + #if CHANGECOLOR3_ON + dif = abs(currChangeColor - _ColorChangeTarget3.rgb); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _ColorChangeNewCol3.rgb, + max(sign(1 - saturate(dif.x + dif.y + dif.z) - _ColorChangeTolerance3), 0.0)); + #endif + #endif + //------------------------------------------------------- + + //POSTERIZE_ON && !POSTERIZEOUTLINE_ON + #if POSTERIZE_ON && !POSTERIZEOUTLINE_ON + col.rgb = pow(col.rgb, _PosterizeGamma) * _PosterizeNumColors; + col.rgb = floor(col.rgb) / _PosterizeNumColors; + col.rgb = pow(col.rgb, 1.0 / _PosterizeGamma); + #endif + //------------------------------------ + + //HSV_ON + #if HSV_ON + half3 resultHsv = half3(col.rgb); + half cosHsv = _HsvBright * _HsvSaturation * cos(_HsvShift * 3.14159265 / 180); + half sinHsv = _HsvBright * _HsvSaturation * sin(_HsvShift * 3.14159265 / 180); + resultHsv.x = (.299 * _HsvBright + .701 * cosHsv + .168 * sinHsv) * col.x + + (.587 * _HsvBright - .587 * cosHsv + .330 * sinHsv) * col.y + + (.114 * _HsvBright - .114 * cosHsv - .497 * sinHsv) * col.z; + resultHsv.y = (.299 * _HsvBright - .299 * cosHsv - .328 * sinHsv) *col.x + + (.587 * _HsvBright + .413 * cosHsv + .035 * sinHsv) * col.y + + (.114 * _HsvBright - .114 * cosHsv + .292 * sinHsv) * col.z; + resultHsv.z = (.299 * _HsvBright - .3 * cosHsv + 1.25 * sinHsv) * col.x + + (.587 * _HsvBright - .588 * cosHsv - 1.05 * sinHsv) * col.y + + (.114 * _HsvBright + .886 * cosHsv - .203 * sinHsv) * col.z; + col.rgb = resultHsv; + #endif + //------------------------------------------------------- + + //OVERLAY_ON + #if OVERLAY_ON + half2 overlayUvs = d.texcoord0.xy; + overlayUvs.x += ((_Time.y + randomSeed) * _OverlayTextureScrollXSpeed) % 1; + overlayUvs.y += ((_Time.y + randomSeed) * _OverlayTextureScrollYSpeed) % 1; + half4 overlayCol = SAMPLE_TEXTURE2D(_OverlayTex, sampler_OverlayTex, TRANSFORM_TEX(overlayUvs, _OverlayTex)); + overlayCol.rgb *= _OverlayColor.rgb * _OverlayGlow; + #if !OVERLAYMULT_ON + overlayCol.rgb *= overlayCol.a * _OverlayColor.rgb * _OverlayColor.a * _OverlayBlend; + col.rgb += overlayCol.rgb; + #else + overlayCol.a *= _OverlayColor.a; + col = lerp(col, col * overlayCol, _OverlayBlend); + #endif + #endif + + //--------------------------------- + + //OUTBASE_ON + #if OUTBASE_ON + #if OUTBASEPIXELPERF_ON + half2 destUv = half2(_OutlinePixelWidth * _MainTex_TexelSize.x, _OutlinePixelWidth * _MainTex_TexelSize.y); + #else + half2 destUv = half2(_OutlineWidth * _MainTex_TexelSize.x * 200, _OutlineWidth * _MainTex_TexelSize.y * 200); + #endif + + #if OUTDIST_ON + d.texcoord3.x += ((_Time.x + _RandomSeed) * _OutlineDistortTexXSpeed) % 1; + d.texcoord3.y += ((_Time.x + _RandomSeed) * _OutlineDistortTexYSpeed) % 1; + #if ATLAS_ON + d.texcoord3 = half2((d.texcoord3.x - _MinXUV) / (_MaxXUV - _MinXUV), (d.texcoord3.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half outDistortAmnt = (SAMPLE_TEXTURE2D(_OutlineDistortTex, sampler_OutlineDistortTex, d.texcoord3).r - 0.5) * 0.2 * _OutlineDistortAmount; + destUv.x += outDistortAmnt; + destUv.y += outDistortAmnt; + #endif + + half spriteLeft = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(destUv.x, 0)).a; + half spriteRight = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy - half2(destUv.x, 0)).a; + half spriteBottom = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(0, destUv.y)).a; + half spriteTop = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy - half2(0, destUv.y)).a; + half result = spriteLeft + spriteRight + spriteBottom + spriteTop; + + #if OUTBASE8DIR_ON + half spriteTopLeft = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(destUv.x, destUv.y)).a; + half spriteTopRight = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(-destUv.x, destUv.y)).a; + half spriteBotLeft = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(destUv.x, -destUv.y)).a; + half spriteBotRight = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(-destUv.x, -destUv.y)).a; + result = result + spriteTopLeft + spriteTopRight + spriteBotLeft + spriteBotRight; + #endif + + result = step(0.05, saturate(result)); + + #if OUTTEX_ON + d.texcoord1.x += ((_Time.x + _RandomSeed) * _OutlineTexXSpeed) % 1; + d.texcoord1.y += ((_Time.x + _RandomSeed) * _OutlineTexYSpeed) % 1; + #if ATLAS_ON + d.texcoord1 = half2((d.texcoord1.x - _MinXUV) / (_MaxXUV - _MinXUV), (d.texcoord1.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half4 tempOutColor = SAMPLE_TEXTURE2D(_OutlineTex, sampler_OutlineTex, d.texcoord1); + tempOutColor *= _OutlineColor; + _OutlineColor = tempOutColor; + #endif + + result *= (1 - originalAlpha) * _OutlineAlpha; + + half4 outline = _OutlineColor * d.vertexColor.a; + outline.rgb *= _OutlineGlow; + outline.a = result; + #if ONLYOUTLINE_ON + col = outline; + #else + col = lerp(col, outline, result); + #endif + #endif + //------------------------------------------------------- + + //FADE_ON + #if FADE_ON + half2 tiledUvFade1 = TRANSFORM_TEX(d.texcoord0, _FadeTex); + half2 tiledUvFade2 = TRANSFORM_TEX(d.texcoord0, _FadeBurnTex); + #if ATLAS_ON + tiledUvFade1 = half2((tiledUvFade1.x - _MinXUV) / (_MaxXUV - _MinXUV), (tiledUvFade1.y - _MinYUV) / (_MaxYUV - _MinYUV)); + tiledUvFade2 = half2((tiledUvFade2.x - _MinXUV) / (_MaxXUV - _MinXUV), (tiledUvFade2.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half fadeTemp = SAMPLE_TEXTURE2D(_FadeTex, sampler_FadeTex, tiledUvFade1).r; + half fade = smoothstep(_FadeAmount, _FadeAmount + _FadeBurnTransition, fadeTemp); + half fadeBurn = saturate(smoothstep(_FadeAmount - _FadeBurnWidth, _FadeAmount - _FadeBurnWidth + 0.1, fadeTemp) * _FadeAmount); + col.a *= fade; + _FadeBurnColor.rgb *= _FadeBurnGlow; + col += fadeBurn * SAMPLE_TEXTURE2D(_FadeBurnTex, sampler_FadeBurnTex, tiledUvFade2) * _FadeBurnColor * originalAlpha * (1 - col.a); + #endif + //------------------------------------------------------- + + //SHADOW_ON + #if SHADOW_ON + half shadowA = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(_ShadowX, _ShadowY)).a; + half preMultShadowMask = 1 - (saturate(shadowA - col.a) * (1 - col.a)); + col.rgb *= 1 - ((shadowA - col.a) * (1 - col.a)); + col.rgb += (_ShadowColor * shadowA) * (1 - col.a); + col.a = max(shadowA * _ShadowAlpha * d.vertexColor.a, col.a); + #endif + + //------------------------------------------------------- + + //GLOW_ON + #if GLOW_ON + half4 emission; + #if GLOWTEX_ON + emission = SAMPLE_TEXTURE2D(_GlowTex, sampler_GlowTex, d.texcoord0); + #else + emission = col; + #endif + + col.rgb *= _GlowGlobal; + emission.rgb *= emission.a * col.a * _Glow * _GlowColor; + col.rgb += emission.rgb; + #endif + //------------------------------------------------------- + + //COLORRAMP_ON && COLORRAMPOUTLINE_ON + #if COLORRAMP_ON && COLORRAMPOUTLINE_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + luminance = saturate(luminance + _ColorRampLuminosity); + #if GRADIENTCOLORRAMP_ON + col.rgb = lerp(col.rgb, SAMPLE_TEXTURE2D(_ColorRampTexGradient, sampler_ColorRampTexGradient, half2(luminance, 0)).rgb, _ColorRampBlend); + #else + col.rgb = lerp(col.rgb, SAMPLE_TEXTURE2D(_ColorRampTex, sampler_ColorRampTex, half2(luminance, 0)).rgb, _ColorRampBlend); + #endif + #endif + //--------------- + + //GREYSCALE_ON && GREYSCALEOUTLINE_ON + #if GREYSCALE_ON && GREYSCALEOUTLINE_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + luminance = saturate(luminance + _GreyscaleLuminosity); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _GreyscaleTintColor, _GreyscaleBlend); + #endif + + //----------------------------------- + + //POSTERIZE_ON && POSTERIZEOUTLINE_ON + #if POSTERIZE_ON && POSTERIZEOUTLINE_ON + col.rgb = pow(col.rgb, _PosterizeGamma) * _PosterizeNumColors; + col.rgb = floor(col.rgb) / _PosterizeNumColors; + col.rgb = pow(col.rgb, 1.0 / _PosterizeGamma); + #endif + + //----------------------------------- + + //SHINE_ON + #if SHINE_ON + half2 uvShine = uvRect; + half cosAngle = cos(_ShineRotate); + half sinAngle = sin(_ShineRotate); + half2x2 rot = half2x2(cosAngle, -sinAngle, sinAngle, cosAngle); + uvShine -= half2(0.5, 0.5); + uvShine = mul(rot, uvShine); + uvShine += half2(0.5, 0.5); + half shineMask = SAMPLE_TEXTURE2D(_ShineMask, sampler_ShineMask, d.texcoord0.xy).a; + half currentDistanceProjection = (uvShine.x + uvShine.y) / 2; + half whitePower = 1 - (abs(currentDistanceProjection - _ShineLocation) / _ShineWidth); + col.rgb += col.a * whitePower * _ShineGlow * max(sign(currentDistanceProjection - (_ShineLocation - _ShineWidth)), 0.0) + * max(sign((_ShineLocation + _ShineWidth) - currentDistanceProjection), 0.0) * _ShineColor * shineMask; + #endif + + //----------------------------------- + + //HOLOGRAM_ON + #if HOLOGRAM_ON + half totalHologram = _HologramStripesAmount + _HologramUnmodAmount; + half hologramYCoord = ((uvRect.y + (((_Time.x + randomSeed) % 1) * _HologramStripesSpeed)) % totalHologram) / totalHologram; + hologramYCoord = abs(hologramYCoord); + half alpha = RemapFloat(saturate(hologramYCoord - (_HologramUnmodAmount/totalHologram)), 0.0, 1.0, _HologramMinAlpha, saturate(_HologramMaxAlpha)); + half hologramMask = max(sign((_HologramUnmodAmount/totalHologram) - hologramYCoord), 0.0); + half4 hologramResult = col; + hologramResult.a *= lerp(alpha, 1, hologramMask); + hologramResult.rgb *= max(1, _HologramMaxAlpha * max(sign(hologramYCoord - (_HologramUnmodAmount/totalHologram)), 0.0)); + hologramMask = 1 - step(0.01,hologramMask); + hologramResult.rgb += hologramMask * _HologramStripeColor * col.a; + col = lerp(col, hologramResult, _HologramBlend); + #endif + + //----------------------------------- + + //FLICKER_ON + #if FLICKER_ON + col.a *= saturate(col.a * step(frac(0.05 + (_Time.w + randomSeed) * _FlickerFreq), 1 - _FlickerPercent) + _FlickerAlpha); + #endif + //----------------------------------- + + //ALPHACUTOFF_ON + + //ALPHAROUND_ON + + //ALPHAOUTLINE_ON + #if ALPHAOUTLINE_ON + half alphaOutlineRes = pow(1 - col.a, max(_AlphaOutlinePower, 0.0001)) * step(_AlphaOutlineMinAlpha, col.a) * _AlphaOutlineBlend; + col.rgb = lerp(col.rgb, _AlphaOutlineColor.rgb * _AlphaOutlineGlow, alphaOutlineRes); + col.a = lerp(col.a, 1, alphaOutlineRes > 1); + #endif + //------------------------------------------------------- + + //FOG_ON + + //------------------ + + col *= _Color; + o.Albedo = col; + col.a *= _Alpha; + clip(col.a - _AlphaCutoffValue - 0.01); + o.Alpha = _Color.a; + } + + + + + + void ChainSurfaceFunction(inout Surface l, inout ShaderData d) + { + Ext_SurfaceFunction0(l, d); + // Ext_SurfaceFunction1(l, d); + // Ext_SurfaceFunction2(l, d); + // Ext_SurfaceFunction3(l, d); + // Ext_SurfaceFunction4(l, d); + // Ext_SurfaceFunction5(l, d); + // Ext_SurfaceFunction6(l, d); + // Ext_SurfaceFunction7(l, d); + // Ext_SurfaceFunction8(l, d); + // Ext_SurfaceFunction9(l, d); + // Ext_SurfaceFunction10(l, d); + // Ext_SurfaceFunction11(l, d); + // Ext_SurfaceFunction12(l, d); + // Ext_SurfaceFunction13(l, d); + // Ext_SurfaceFunction14(l, d); + // Ext_SurfaceFunction15(l, d); + // Ext_SurfaceFunction16(l, d); + // Ext_SurfaceFunction17(l, d); + // Ext_SurfaceFunction18(l, d); + // Ext_SurfaceFunction19(l, d); + // Ext_SurfaceFunction20(l, d); + // Ext_SurfaceFunction21(l, d); + // Ext_SurfaceFunction22(l, d); + // Ext_SurfaceFunction23(l, d); + // Ext_SurfaceFunction24(l, d); + // Ext_SurfaceFunction25(l, d); + // Ext_SurfaceFunction26(l, d); + // Ext_SurfaceFunction27(l, d); + // Ext_SurfaceFunction28(l, d); + // Ext_SurfaceFunction29(l, d); + } + +#if !_DECALSHADER + + void ChainModifyVertex(inout VertexData v, inout VertexToPixel v2p, float4 time) + { + ExtraV2F d; + + ZERO_INITIALIZE(ExtraV2F, d); + ZERO_INITIALIZE(Blackboard, d.blackboard); + // due to motion vectors in HDRP, we need to use the last + // time in certain spots. So if you are going to use _Time to adjust vertices, + // you need to use this time or motion vectors will break. + d.time = time; + + Ext_ModifyVertex0(v, d); + // Ext_ModifyVertex1(v, d); + // Ext_ModifyVertex2(v, d); + // Ext_ModifyVertex3(v, d); + // Ext_ModifyVertex4(v, d); + // Ext_ModifyVertex5(v, d); + // Ext_ModifyVertex6(v, d); + // Ext_ModifyVertex7(v, d); + // Ext_ModifyVertex8(v, d); + // Ext_ModifyVertex9(v, d); + // Ext_ModifyVertex10(v, d); + // Ext_ModifyVertex11(v, d); + // Ext_ModifyVertex12(v, d); + // Ext_ModifyVertex13(v, d); + // Ext_ModifyVertex14(v, d); + // Ext_ModifyVertex15(v, d); + // Ext_ModifyVertex16(v, d); + // Ext_ModifyVertex17(v, d); + // Ext_ModifyVertex18(v, d); + // Ext_ModifyVertex19(v, d); + // Ext_ModifyVertex20(v, d); + // Ext_ModifyVertex21(v, d); + // Ext_ModifyVertex22(v, d); + // Ext_ModifyVertex23(v, d); + // Ext_ModifyVertex24(v, d); + // Ext_ModifyVertex25(v, d); + // Ext_ModifyVertex26(v, d); + // Ext_ModifyVertex27(v, d); + // Ext_ModifyVertex28(v, d); + // Ext_ModifyVertex29(v, d); + + + // #if %EXTRAV2F0REQUIREKEY% + // v2p.extraV2F0 = d.extraV2F0; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // v2p.extraV2F1 = d.extraV2F1; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // v2p.extraV2F2 = d.extraV2F2; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // v2p.extraV2F3 = d.extraV2F3; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // v2p.extraV2F4 = d.extraV2F4; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // v2p.extraV2F5 = d.extraV2F5; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // v2p.extraV2F6 = d.extraV2F6; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // v2p.extraV2F7 = d.extraV2F7; + // #endif + } + + void ChainModifyTessellatedVertex(inout VertexData v, inout VertexToPixel v2p) + { + ExtraV2F d; + ZERO_INITIALIZE(ExtraV2F, d); + ZERO_INITIALIZE(Blackboard, d.blackboard); + + // #if %EXTRAV2F0REQUIREKEY% + // d.extraV2F0 = v2p.extraV2F0; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // d.extraV2F1 = v2p.extraV2F1; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // d.extraV2F2 = v2p.extraV2F2; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // d.extraV2F3 = v2p.extraV2F3; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // d.extraV2F4 = v2p.extraV2F4; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // d.extraV2F5 = v2p.extraV2F5; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // d.extraV2F6 = v2p.extraV2F6; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // d.extraV2F7 = v2p.extraV2F7; + // #endif + + + // Ext_ModifyTessellatedVertex0(v, d); + // Ext_ModifyTessellatedVertex1(v, d); + // Ext_ModifyTessellatedVertex2(v, d); + // Ext_ModifyTessellatedVertex3(v, d); + // Ext_ModifyTessellatedVertex4(v, d); + // Ext_ModifyTessellatedVertex5(v, d); + // Ext_ModifyTessellatedVertex6(v, d); + // Ext_ModifyTessellatedVertex7(v, d); + // Ext_ModifyTessellatedVertex8(v, d); + // Ext_ModifyTessellatedVertex9(v, d); + // Ext_ModifyTessellatedVertex10(v, d); + // Ext_ModifyTessellatedVertex11(v, d); + // Ext_ModifyTessellatedVertex12(v, d); + // Ext_ModifyTessellatedVertex13(v, d); + // Ext_ModifyTessellatedVertex14(v, d); + // Ext_ModifyTessellatedVertex15(v, d); + // Ext_ModifyTessellatedVertex16(v, d); + // Ext_ModifyTessellatedVertex17(v, d); + // Ext_ModifyTessellatedVertex18(v, d); + // Ext_ModifyTessellatedVertex19(v, d); + // Ext_ModifyTessellatedVertex20(v, d); + // Ext_ModifyTessellatedVertex21(v, d); + // Ext_ModifyTessellatedVertex22(v, d); + // Ext_ModifyTessellatedVertex23(v, d); + // Ext_ModifyTessellatedVertex24(v, d); + // Ext_ModifyTessellatedVertex25(v, d); + // Ext_ModifyTessellatedVertex26(v, d); + // Ext_ModifyTessellatedVertex27(v, d); + // Ext_ModifyTessellatedVertex28(v, d); + // Ext_ModifyTessellatedVertex29(v, d); + + // #if %EXTRAV2F0REQUIREKEY% + // v2p.extraV2F0 = d.extraV2F0; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // v2p.extraV2F1 = d.extraV2F1; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // v2p.extraV2F2 = d.extraV2F2; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // v2p.extraV2F3 = d.extraV2F3; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // v2p.extraV2F4 = d.extraV2F4; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // v2p.extraV2F5 = d.extraV2F5; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // v2p.extraV2F6 = d.extraV2F6; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // v2p.extraV2F7 = d.extraV2F7; + // #endif + } + + void ChainFinalColorForward(inout Surface l, inout ShaderData d, inout half4 color) + { + // Ext_FinalColorForward0(l, d, color); + // Ext_FinalColorForward1(l, d, color); + // Ext_FinalColorForward2(l, d, color); + // Ext_FinalColorForward3(l, d, color); + // Ext_FinalColorForward4(l, d, color); + // Ext_FinalColorForward5(l, d, color); + // Ext_FinalColorForward6(l, d, color); + // Ext_FinalColorForward7(l, d, color); + // Ext_FinalColorForward8(l, d, color); + // Ext_FinalColorForward9(l, d, color); + // Ext_FinalColorForward10(l, d, color); + // Ext_FinalColorForward11(l, d, color); + // Ext_FinalColorForward12(l, d, color); + // Ext_FinalColorForward13(l, d, color); + // Ext_FinalColorForward14(l, d, color); + // Ext_FinalColorForward15(l, d, color); + // Ext_FinalColorForward16(l, d, color); + // Ext_FinalColorForward17(l, d, color); + // Ext_FinalColorForward18(l, d, color); + // Ext_FinalColorForward19(l, d, color); + // Ext_FinalColorForward20(l, d, color); + // Ext_FinalColorForward21(l, d, color); + // Ext_FinalColorForward22(l, d, color); + // Ext_FinalColorForward23(l, d, color); + // Ext_FinalColorForward24(l, d, color); + // Ext_FinalColorForward25(l, d, color); + // Ext_FinalColorForward26(l, d, color); + // Ext_FinalColorForward27(l, d, color); + // Ext_FinalColorForward28(l, d, color); + // Ext_FinalColorForward29(l, d, color); + } + + void ChainFinalGBufferStandard(inout Surface s, inout ShaderData d, inout half4 GBuffer0, inout half4 GBuffer1, inout half4 GBuffer2, inout half4 outEmission, inout half4 outShadowMask) + { + // Ext_FinalGBufferStandard0(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard1(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard2(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard3(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard4(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard5(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard6(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard7(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard8(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard9(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard10(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard11(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard12(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard13(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard14(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard15(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard16(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard17(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard18(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard19(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard20(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard21(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard22(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard23(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard24(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard25(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard26(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard27(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard28(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard29(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + } +#endif + + + + + +#if _DECALSHADER + + ShaderData CreateShaderData(SurfaceDescriptionInputs IN) + { + ShaderData d = (ShaderData)0; + d.TBNMatrix = float3x3(IN.WorldSpaceTangent, IN.WorldSpaceBiTangent, IN.WorldSpaceNormal); + d.worldSpaceNormal = IN.WorldSpaceNormal; + d.worldSpaceTangent = IN.WorldSpaceTangent; + + d.worldSpacePosition = IN.WorldSpacePosition; + d.texcoord0 = IN.uv0.xyxy; + d.screenPos = IN.ScreenPosition; + + d.worldSpaceViewDir = normalize(_WorldSpaceCameraPos - d.worldSpacePosition); + + d.tangentSpaceViewDir = mul(d.TBNMatrix, d.worldSpaceViewDir); + + // these rarely get used, so we back transform them. Usually will be stripped. + #if _HDRP + // d.localSpacePosition = mul(GetWorldToObjectMatrix(), float4(GetCameraRelativePositionWS(d.worldSpacePosition), 1)).xyz; + #else + // d.localSpacePosition = mul(GetWorldToObjectMatrix(), float4(d.worldSpacePosition, 1)).xyz; + #endif + // d.localSpaceNormal = normalize(mul((float3x3)GetWorldToObjectMatrix(), d.worldSpaceNormal)); + // d.localSpaceTangent = normalize(mul((float3x3)GetWorldToObjectMatrix(), d.worldSpaceTangent.xyz)); + + // #if %SCREENPOSREQUIREKEY% + // d.screenUV = (IN.ScreenPosition.xy / max(0.01, IN.ScreenPosition.w)); + // #endif + + return d; + } +#else + + ShaderData CreateShaderData(VertexToPixel i + #if NEED_FACING + , bool facing + #endif + ) + { + ShaderData d = (ShaderData)0; + d.clipPos = i.pos; + d.worldSpacePosition = i.worldPos; + + d.worldSpaceNormal = normalize(i.worldNormal); + d.worldSpaceTangent.xyz = normalize(i.worldTangent.xyz); + + d.tangentSign = i.worldTangent.w * unity_WorldTransformParams.w; + float3 bitangent = cross(d.worldSpaceTangent.xyz, d.worldSpaceNormal) * d.tangentSign; + + d.TBNMatrix = float3x3(d.worldSpaceTangent, -bitangent, d.worldSpaceNormal); + d.worldSpaceViewDir = normalize(_WorldSpaceCameraPos - i.worldPos); + + d.tangentSpaceViewDir = mul(d.TBNMatrix, d.worldSpaceViewDir); + d.texcoord0 = i.texcoord0; + d.texcoord1 = i.texcoord1; + d.texcoord2 = i.texcoord2; + + // #if %TEXCOORD3REQUIREKEY% + d.texcoord3 = i.texcoord3; + // #endif + + // d.isFrontFace = facing; + // #if %VERTEXCOLORREQUIREKEY% + d.vertexColor = i.vertexColor; + // #endif + + // these rarely get used, so we back transform them. Usually will be stripped. + #if _HDRP + // d.localSpacePosition = mul(GetWorldToObjectMatrix(), float4(GetCameraRelativePositionWS(i.worldPos), 1)).xyz; + #else + // d.localSpacePosition = mul(GetWorldToObjectMatrix(), float4(i.worldPos, 1)).xyz; + #endif + // d.localSpaceNormal = normalize(mul((float3x3)GetWorldToObjectMatrix(), i.worldNormal)); + // d.localSpaceTangent = normalize(mul((float3x3)GetWorldToObjectMatrix(), i.worldTangent.xyz)); + + // #if %SCREENPOSREQUIREKEY% + // d.screenPos = i.screenPos; + // d.screenUV = (i.screenPos.xy / i.screenPos.w); + // #endif + + + // #if %EXTRAV2F0REQUIREKEY% + // d.extraV2F0 = i.extraV2F0; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // d.extraV2F1 = i.extraV2F1; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // d.extraV2F2 = i.extraV2F2; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // d.extraV2F3 = i.extraV2F3; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // d.extraV2F4 = i.extraV2F4; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // d.extraV2F5 = i.extraV2F5; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // d.extraV2F6 = i.extraV2F6; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // d.extraV2F7 = i.extraV2F7; + // #endif + + return d; + } + +#endif + + + +#if (SHADERPASS == SHADERPASS_LIGHT_TRANSPORT) + + // This was not in constant buffer in original unity, so keep outiside. But should be in as ShaderRenderPass frequency + float unity_OneOverOutputBoost; + float unity_MaxOutputValue; + + CBUFFER_START(UnityMetaPass) + // x = use uv1 as raster position + // y = use uv2 as raster position + bool4 unity_MetaVertexControl; + + // x = return albedo + // y = return normal + bool4 unity_MetaFragmentControl; + CBUFFER_END + + VertexToPixel Vert(VertexData inputMesh) + { + VertexToPixel output; + ZERO_INITIALIZE(VertexToPixel, output); + UNITY_SETUP_INSTANCE_ID(inputMesh); + UNITY_TRANSFER_INSTANCE_ID(inputMesh, output); + UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(output); + + // Output UV coordinate in vertex shader + float2 uv = float2(0.0, 0.0); + + if (unity_MetaVertexControl.x) + { + uv = inputMesh.texcoord1.xy * unity_LightmapST.xy + unity_LightmapST.zw; + } + else if (unity_MetaVertexControl.y) + { + uv = inputMesh.texcoord2.xy * unity_DynamicLightmapST.xy + unity_DynamicLightmapST.zw; + } + + // OpenGL right now needs to actually use the incoming vertex position + // so we create a fake dependency on it here that haven't any impact. + output.pos = float4(uv * 2.0 - 1.0, inputMesh.vertex.z > 0 ? 1.0e-4 : 0.0, 1.0); + + output.worldPos = TransformObjectToWorld(inputMesh.vertex.xyz).xyz; + + // Normal is required for triplanar mapping + output.worldNormal = TransformObjectToWorldNormal(inputMesh.normal); + // Not required but assign to silent compiler warning + output.worldTangent = float4(1.0, 0.0, 0.0, 0.0); + + output.texcoord0 = inputMesh.texcoord0; + output.texcoord1 = inputMesh.texcoord1; + output.texcoord2 = inputMesh.texcoord2; + // #if %TEXCOORD3REQUIREKEY% + output.texcoord3 = inputMesh.texcoord3; + // #endif + // #if %VERTEXCOLORREQUIREKEY% + output.vertexColor = inputMesh.vertexColor; + // #endif + + return output; + } +#else + + #if (_PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR))) + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/ShaderVariablesMatrixDefsHDCamera.hlsl" + + void MotionVectorPositionZBias(VertexToPixel input) + { + #if UNITY_REVERSED_Z + input.pos.z -= unity_MotionVectorsParams.z * input.pos.w; + #else + input.pos.z += unity_MotionVectorsParams.z * input.pos.w; + #endif + } + + #endif + + VertexToPixel Vert(VertexData input) + { + VertexToPixel output; + ZERO_INITIALIZE(VertexToPixel, output); + + UNITY_SETUP_INSTANCE_ID(input); + UNITY_TRANSFER_INSTANCE_ID(input, output); + UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(output); + + #if _HDRP && (_PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR))) + VertexData previousMesh = input; + #endif + + ChainModifyVertex(input, output, _Time); + + // This return the camera relative position (if enable) + float3 positionRWS = TransformObjectToWorld(input.vertex.xyz); + float3 normalWS = TransformObjectToWorldNormal(input.normal); + float4 tangentWS = float4(TransformObjectToWorldDir(input.tangent.xyz), input.tangent.w); + + + output.worldPos = GetAbsolutePositionWS(positionRWS); + output.pos = TransformWorldToHClip(positionRWS); + output.worldNormal = normalWS; + output.worldTangent = tangentWS; + + + output.texcoord0 = input.texcoord0; + output.texcoord1 = input.texcoord1; + output.texcoord2 = input.texcoord2; + + // #if %TEXCOORD3REQUIREKEY% + output.texcoord3 = input.texcoord3; + // #endif + + // #if %VERTEXCOLORREQUIREKEY% + output.vertexColor = input.vertexColor; + // #endif + + // #if %SCREENPOSREQUIREKEY% + // output.screenPos = ComputeScreenPos(output.pos, _ProjectionParams.x); + // #endif + + #if _HDRP && (_PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR))) + + #if !defined(TESSELLATION_ON) + MotionVectorPositionZBias(output); + #endif + + output.motionVectorCS = mul(UNITY_MATRIX_UNJITTERED_VP, float4(positionRWS.xyz, 1.0)); + // Note: unity_MotionVectorsParams.y is 0 is forceNoMotion is enabled + bool forceNoMotion = unity_MotionVectorsParams.y == 0.0; + if (forceNoMotion) + { + output.previousPositionCS = float4(0.0, 0.0, 0.0, 1.0); + } + else + { + bool hasDeformation = unity_MotionVectorsParams.x > 0.0; // Skin or morph target + + float3 effectivePositionOS = (hasDeformation ? previousMesh.previousPositionOS : previousMesh.vertex.xyz); + #if defined(_ADD_PRECOMPUTED_VELOCITY) + effectivePositionOS -= input.precomputedVelocity; + #endif + + previousMesh.vertex = float4(effectivePositionOS, 1); + VertexToPixel dummy = (VertexToPixel)0; + + + ChainModifyVertex(previousMesh, dummy, _LastTimeParameters); + + // we might need this for skinned objects? + //float3 normalWS = TransformPreviousObjectToWorldNormal(input.normal).xyz; + float3 previousPositionRWS = TransformPreviousObjectToWorld(previousMesh.vertex.xyz); + + #ifdef _WRITE_TRANSPARENT_MOTION_VECTOR + if (_TransparentCameraOnlyMotionVectors > 0) + { + previousPositionRWS = positionRWS.xyz; + } + #endif // _WRITE_TRANSPARENT_MOTION_VECTOR + + output.previousPositionCS = mul(UNITY_MATRIX_PREV_VP, float4(previousPositionRWS, 1.0)); + } + #endif // _HDRP && _PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR)) + + + return output; + } + + +#endif + + + + + + + + #if defined(WRITE_DECAL_BUFFER) && !defined(_DISABLE_DECALS) + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/Decal/DecalPrepassBuffer.hlsl" + #endif + + FragInputs BuildFragInputs(VertexToPixel input) + { + UNITY_SETUP_INSTANCE_ID(input); + FragInputs output; + ZERO_INITIALIZE(FragInputs, output); + + // Init to some default value to make the computer quiet (else it output 'divide by zero' warning even if value is not used). + // TODO: this is a really poor workaround, but the variable is used in a bunch of places + // to compute normals which are then passed on elsewhere to compute other values... + output.tangentToWorld = k_identity3x3; + output.positionSS = input.pos; // input.positionCS is SV_Position + // BETTER SHADERS: because we transform world position into actual world space for things like + // triplanar, etc, we have to back transform it here for lighting + output.positionRWS = GetCameraRelativePositionWS(input.worldPos); + output.tangentToWorld = BuildTangentToWorld(input.worldTangent, input.worldNormal); + output.texCoord0 = input.texcoord0; + output.texCoord1 = input.texcoord1; + output.texCoord2 = input.texcoord2; + + return output; + } + +#if UNITY_VERSION > UNITY_2022_3_12 + void ApplyDecalAndGetNormal(FragInputs fragInputs, PositionInputs posInput, Surface surfaceDescription, float3 normalTS, + inout SurfaceData surfaceData) + { + float3 doubleSidedConstants = GetDoubleSidedConstants(); + + #ifdef DECAL_NORMAL_BLENDING + // SG nodes don't ouptut surface gradients, so if decals require surf grad blending, we have to convert + // the normal to gradient before applying the decal. We then have to resolve the gradient back to world space + normalTS = SurfaceGradientFromTangentSpaceNormalAndFromTBN(normalTS, + fragInputs.tangentToWorld[0], fragInputs.tangentToWorld[1]); + + + #if HAVE_DECALS + if (_EnableDecals) + { + float alpha = 1.0; + alpha = surfaceDescription.Alpha; + + DecalSurfaceData decalSurfaceData = GetDecalSurfaceData(posInput, fragInputs, alpha); + ApplyDecalToSurfaceNormal(decalSurfaceData, fragInputs.tangentToWorld[2], normalTS); + ApplyDecalToSurfaceDataNoNormal(decalSurfaceData, surfaceData); + } + #endif + + GetNormalWS_SG(fragInputs, normalTS, surfaceData.normalWS, doubleSidedConstants); + #else + // normal delivered to master node + + #if HAVE_DECALS + if (_EnableDecals) + { + float alpha = 1.0; + alpha = surfaceDescription.Alpha; + + // Both uses and modifies 'surfaceData.normalWS'. + DecalSurfaceData decalSurfaceData = GetDecalSurfaceData(posInput, fragInputs, alpha); + ApplyDecalToSurfaceNormal(decalSurfaceData, surfaceData.normalWS.xyz); + ApplyDecalToSurfaceDataNoNormal(decalSurfaceData, surfaceData); + } + #endif + #endif + } +#endif + + void BuildSurfaceData(FragInputs fragInputs, inout Surface surfaceDescription, float3 V, PositionInputs posInput, out SurfaceData surfaceData, out float3 bentNormalWS) + { + // setup defaults -- these are used if the graph doesn't output a value + ZERO_INITIALIZE(SurfaceData, surfaceData); + + // specularOcclusion need to be init ahead of decal to quiet the compiler that modify the SurfaceData struct + // however specularOcclusion can come from the graph, so need to be init here so it can be override. + surfaceData.specularOcclusion = 1.0; + + // copy across graph values, if defined + surfaceData.baseColor = surfaceDescription.Albedo; + surfaceData.perceptualSmoothness = surfaceDescription.Smoothness; + surfaceData.ambientOcclusion = surfaceDescription.Occlusion; + surfaceData.specularOcclusion = surfaceDescription.SpecularOcclusion; + surfaceData.metallic = surfaceDescription.Metallic; + surfaceData.subsurfaceMask = surfaceDescription.SubsurfaceMask; + surfaceData.thickness = surfaceDescription.Thickness; + surfaceData.diffusionProfileHash = asuint(surfaceDescription.DiffusionProfileHash); + #if _USESPECULAR + surfaceData.specularColor = surfaceDescription.Specular; + #endif + surfaceData.coatMask = surfaceDescription.CoatMask; + surfaceData.anisotropy = surfaceDescription.Anisotropy; + surfaceData.iridescenceMask = surfaceDescription.IridescenceMask; + surfaceData.iridescenceThickness = surfaceDescription.IridescenceThickness; + + + + #if defined(_REFRACTION_PLANE) || defined(_REFRACTION_SPHERE) || defined(_REFRACTION_THIN) + if (_EnableSSRefraction) + { + surfaceData.transmittanceMask = (1.0 - surfaceDescription.Alpha); + surfaceDescription.Alpha = 1.0; + } + else + { + surfaceData.ior = surfaceDescription.ior; + surfaceData.transmittanceColor = surfaceDescription.transmittanceColor; + surfaceData.atDistance = surfaceDescription.atDistance; + surfaceData.transmittanceMask = surfaceDescription.transmittanceMask; + surfaceDescription.Alpha = 1.0; + } + #else + surfaceData.ior = 1.0; + surfaceData.transmittanceColor = float3(1.0, 1.0, 1.0); + surfaceData.atDistance = 1.0; + surfaceData.transmittanceMask = 0.0; + #endif + + + + // These static material feature allow compile time optimization + surfaceData.materialFeatures = MATERIALFEATUREFLAGS_LIT_STANDARD; + #ifdef _MATERIAL_FEATURE_SUBSURFACE_SCATTERING + surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_SUBSURFACE_SCATTERING; + #endif + + #ifdef _MATERIAL_FEATURE_TRANSMISSION + surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_TRANSMISSION; + #endif + + #ifdef _MATERIAL_FEATURE_ANISOTROPY + surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_ANISOTROPY; + surfaceData.normalWS = float3(0, 1, 0); + #endif + + #ifdef _MATERIAL_FEATURE_IRIDESCENCE + surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_IRIDESCENCE; + #endif + + #ifdef _MATERIAL_FEATURE_SPECULAR_COLOR + surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_SPECULAR_COLOR; + #endif + + #if defined(_MATERIAL_FEATURE_CLEAR_COAT) || _CLEARCOAT + surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_CLEAR_COAT; + #endif + + #if defined (_MATERIAL_FEATURE_SPECULAR_COLOR) && defined (_ENERGY_CONSERVING_SPECULAR) + // Require to have setup baseColor + // Reproduce the energy conservation done in legacy Unity. Not ideal but better for compatibility and users can unchek it + surfaceData.baseColor *= (1.0 - Max3(surfaceData.specularColor.r, surfaceData.specularColor.g, surfaceData.specularColor.b)); + #endif + + float3 normalTS = surfaceDescription.Normal; + #if !_WORLDSPACENORMAL + surfaceData.normalWS = mul(surfaceDescription.Normal, fragInputs.tangentToWorld); + #else + normalTS = mul(fragInputs.tangentToWorld, surfaceDescription.Normal); + surfaceData.normalWS = surfaceDescription.Normal; + #endif + + + #if UNITY_VERSION > UNITY_2022_3_12 + ApplyDecalAndGetNormal(fragInputs, posInput, surfaceDescription, normalTS, surfaceData); + #else + #ifdef DECAL_NORMAL_BLENDING + #if HAVE_DECALS + float alpha = 1.0; + alpha = surfaceDescription.Alpha; + if (_EnableDecals) + { + DecalSurfaceData decalSurfaceData = GetDecalSurfaceData(posInput, fragInputs, alpha); + ApplyDecalToSurfaceData(decalSurfaceData, fragInputs.tangentToWorld[2], surfaceData, normalTS); + } + #endif + #else + #if HAVE_DECALS + if (_EnableDecals) + { + float alpha = 1.0; + alpha = surfaceDescription.Alpha; + // Both uses and modifies 'surfaceData.normalWS'. + DecalSurfaceData decalSurfaceData = GetDecalSurfaceData(posInput, fragInputs, alpha); + ApplyDecalToSurfaceData(decalSurfaceData, fragInputs.tangentToWorld[2], surfaceData); + } + #endif + #endif + #endif + + + + surfaceData.geomNormalWS = fragInputs.tangentToWorld[2]; + + surfaceData.tangentWS = normalize(fragInputs.tangentToWorld[0].xyz); // The tangent is not normalize in tangentToWorld for mikkt. TODO: Check if it expected that we normalize with Morten. Tag: SURFACE_GRADIENT + + + bentNormalWS = surfaceData.normalWS; + + surfaceData.tangentWS = Orthonormalize(surfaceData.tangentWS, surfaceData.normalWS); + + #ifdef DEBUG_DISPLAY + if (_DebugMipMapMode != DEBUGMIPMAPMODE_NONE) + { + // TODO: need to update mip info + surfaceData.metallic = 0; + } + + // We need to call ApplyDebugToSurfaceData after filling the surfarcedata and before filling builtinData + // as it can modify attribute use for static lighting + ApplyDebugToSurfaceData(fragInputs.tangentToWorld, surfaceData); + #endif + + // By default we use the ambient occlusion with Tri-ace trick (apply outside) for specular occlusion. + // If user provide bent normal then we process a better term + #if defined(_SPECULAR_OCCLUSION_CUSTOM) + // Just use the value passed through via the slot (not active otherwise) + #elif defined(_SPECULAR_OCCLUSION_FROM_AO_BENT_NORMAL) + // If we have bent normal and ambient occlusion, process a specular occlusion + surfaceData.specularOcclusion = GetSpecularOcclusionFromBentAO(V, bentNormalWS, surfaceData.normalWS, surfaceData.ambientOcclusion, PerceptualSmoothnessToPerceptualRoughness(surfaceData.perceptualSmoothness)); + #elif defined(_AMBIENT_OCCLUSION) && defined(_SPECULAR_OCCLUSION_FROM_AO) + surfaceData.specularOcclusion = GetSpecularOcclusionFromAmbientOcclusion(ClampNdotV(dot(surfaceData.normalWS, V)), surfaceData.ambientOcclusion, PerceptualSmoothnessToRoughness(surfaceData.perceptualSmoothness)); + #endif + + #if defined(_ENABLE_GEOMETRIC_SPECULAR_AA) && !defined(SHADER_STAGE_RAY_TRACING) + surfaceData.perceptualSmoothness = GeometricNormalFiltering(surfaceData.perceptualSmoothness, fragInputs.tangentToWorld[2], surfaceDescription.SpecularAAScreenSpaceVariance, surfaceDescription.SpecularAAThreshold); + #endif + } + + void GetSurfaceAndBuiltinData(VertexToPixel m2ps, FragInputs fragInputs, float3 V, inout PositionInputs posInput, + out SurfaceData surfaceData, out BuiltinData builtinData, inout Surface l, inout ShaderData d + #if NEED_FACING + , bool facing + #endif + ) + { + // Removed since crossfade does not work, probably needs extra material setup. + //#if !defined(SHADER_STAGE_RAY_TRACING) && !defined(_TESSELLATION_DISPLACEMENT) + // #ifdef LOD_FADE_CROSSFADE // enable dithering LOD transition if user select CrossFade transition in LOD group + // LODDitheringTransition(ComputeFadeMaskSeed(V, posInput.positionSS), unity_LODFade.x); + // #endif + //#endif + + + + + d = CreateShaderData(m2ps + #if NEED_FACING + , facing + #endif + ); + + l = (Surface)0; + + l.Albedo = half3(0.5, 0.5, 0.5); + l.Normal = float3(0,0,1); + l.Occlusion = 1; + l.Alpha = 1; + l.SpecularOcclusion = 1; + + #if !defined(SHADER_STAGE_RAY_TRACING) && defined(_DEPTHOFFSET_ON) + l.outputDepth = d.clipPos.z; + #endif + + ChainSurfaceFunction(l, d); + + #if !defined(SHADER_STAGE_RAY_TRACING) && defined(_DEPTHOFFSET_ON) + posInput.deviceDepth = l.outputDepth; + #endif + + #if _UNLIT + //l.Emission = l.Albedo; + //l.Albedo = 0; + l.Normal = half3(0,0,1); + l.Occlusion = 1; + l.Metallic = 0; + l.Specular = 0; + #endif + + surfaceData.geomNormalWS = d.worldSpaceNormal; + surfaceData.tangentWS = d.worldSpaceTangent; + fragInputs.tangentToWorld = d.TBNMatrix; + + float3 bentNormalWS; + + BuildSurfaceData(fragInputs, l, V, posInput, surfaceData, bentNormalWS); + + + float4 lightmapTexCoord1 = fragInputs.texCoord1; + float4 lightmapTexCoord2 = fragInputs.texCoord2; + //#ifdef FRAG_INPUTS_USE_TEXCOORD1 + // float4 lightmapTexCoord1 = fragInputs.texCoord1; + // #else + // float4 lightmapTexCoord1 = float4(0,0,0,0); + // #endif + + // #ifdef FRAG_INPUTS_USE_TEXCOORD2 + // float4 lightmapTexCoord2 = fragInputs.texCoord2; + // #else + // float4 lightmapTexCoord2 = float4(0,0,0,0); + // #endif + + + InitBuiltinData(posInput, l.Alpha, bentNormalWS, -d.worldSpaceNormal, lightmapTexCoord1, lightmapTexCoord2, builtinData); + + + + builtinData.emissiveColor = l.Emission; + + #if defined(_OVERRIDE_BAKEDGI) + builtinData.bakeDiffuseLighting = l.DiffuseGI; + builtinData.backBakeDiffuseLighting = l.BackDiffuseGI; + builtinData.emissiveColor += l.SpecularGI; + #endif + + #if defined(_OVERRIDE_SHADOWMASK) + builtinData.shadowMask0 = l.ShadowMask.x; + builtinData.shadowMask1 = l.ShadowMask.y; + builtinData.shadowMask2 = l.ShadowMask.z; + builtinData.shadowMask3 = l.ShadowMask.w; + #endif + + #ifdef UNITY_VIRTUAL_TEXTURING + //builtinData.vtPackedFeedback = surfaceData.VTPackedFeedback; + #endif + + #if (SHADERPASS == SHADERPASS_DISTORTION) + builtinData.distortion = surfaceData.Distortion; + builtinData.distortionBlur = surfaceData.DistortionBlur; + #endif + + #ifndef SHADER_UNLIT + // PostInitBuiltinData call ApplyDebugToBuiltinData + PostInitBuiltinData(V, posInput, surfaceData, builtinData); + #else + ApplyDebugToBuiltinData(builtinData); + #endif + + RAY_TRACING_OPTIONAL_ALPHA_TEST_PASS + } + + + void Frag( VertexToPixel v2f + #if defined(SCENESELECTIONPASS) || defined(SCENEPICKINGPASS) + , out float4 outColor : SV_Target0 + #else + #ifdef WRITE_MSAA_DEPTH + // We need the depth color as SV_Target0 for alpha to coverage + , out float4 depthColor : SV_Target0 + #ifdef WRITE_NORMAL_BUFFER + , out float4 outNormalBuffer : SV_Target1 + #endif + #else + #ifdef WRITE_NORMAL_BUFFER + , out float4 outNormalBuffer : SV_Target0 + #endif + #endif + + // Decal buffer must be last as it is bind but we can optionally write into it (based on _DISABLE_DECALS) + #if defined(WRITE_DECAL_BUFFER) && !defined(_DISABLE_DECALS) + , out float4 outDecalBuffer : SV_TARGET_DECAL + #endif + #endif + #if NEED_FACING + , bool facing : SV_IsFrontFace + #endif + + ) + { + UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX(v2f); + FragInputs input = BuildFragInputs(v2f); + + // input.positionSS is SV_Position + PositionInputs posInput = GetPositionInput(input.positionSS.xy, _ScreenSize.zw, input.positionSS.z, input.positionSS.w, input.positionRWS); + + float3 V = GetWorldSpaceNormalizeViewDir(input.positionRWS); + + + SurfaceData surfaceData; + BuiltinData builtinData; + Surface l; + ShaderData d; + GetSurfaceAndBuiltinData(v2f, input, V, posInput, surfaceData, builtinData, l, d + #if NEED_FACING + , facing + #endif + ); + + + + #ifdef SCENESELECTIONPASS + // We use depth prepass for scene selection in the editor, this code allow to output the outline correctly + outColor = float4(_ObjectId, _PassValue, 1.0, 1.0); + #elif defined(SCENEPICKINGPASS) + outColor = _SelectionID; + #else + #ifdef WRITE_MSAA_DEPTH + // In case we are rendering in MSAA, reading the an MSAA depth buffer is way too expensive. To avoid that, we export the depth to a color buffer + depthColor = v2p.pos.z; + + #ifdef _ALPHATOMASK_ON + // Alpha channel is used for alpha to coverage + depthColor.a = SharpenAlpha(builtinData.opacity, builtinData.alphaClipTreshold); + #endif // alphatomask + #endif // msaa_depth + + + #if defined(WRITE_NORMAL_BUFFER) + EncodeIntoNormalBuffer(ConvertSurfaceDataToNormalData(surfaceData), outNormalBuffer); + #endif + + #if defined(WRITE_DECAL_BUFFER) && !defined(_DISABLE_DECALS) + DecalPrepassData decalPrepassData; + // We don't have the right to access SurfaceData in a shaderpass. + // However it would be painful to have to add a function like ConvertSurfaceDataToDecalPrepassData() to every Material to return geomNormalWS anyway + // Here we will put the constrain that any Material requiring to support Decal, will need to have geomNormalWS as member of surfaceData (and we already require normalWS anyway) + decalPrepassData.geomNormalWS = surfaceData.geomNormalWS; + decalPrepassData.decalLayerMask = GetMeshRenderingDecalLayer(); + EncodeIntoDecalPrepassBuffer(decalPrepassData, outDecalBuffer); + #endif + #endif + + + } + + ENDHLSL + } + + Pass + { + Name "MotionVectors" + Tags + { + "LightMode" = "MotionVectors" + } + + // Render State + Cull Back + ZWrite On + Stencil + { + WriteMask [_StencilWriteMaskMV] + Ref [_StencilRefMV] + CompFront Always + PassFront Replace + CompBack Always + PassBack Replace + } + + Tags { "RenderType" = "Opaque" "Queue" = "Geometry" "PreviewType" = "Plane" } + Cull [_CullingOption] + ZWrite [_ZWrite] + ZTest [_ZTestMode] + + + //------------------------------------------------------------------------------------- + // End Render Modes + //------------------------------------------------------------------------------------- + + HLSLPROGRAM + + #pragma target 4.5 + #pragma only_renderers d3d11 playstation xboxone xboxseries vulkan metal switch + #pragma multi_compile_instancing + #pragma multi_compile _ DOTS_INSTANCING_ON + #pragma instancing_options renderinglayer + #pragma multi_compile _ LOD_FADE_CROSSFADE + + #pragma multi_compile _ WRITE_MSAA_DEPTH + //#pragma shader_feature _ _SURFACE_TYPE_TRANSPARENT + //#pragma shader_feature_local _BLENDMODE_OFF _BLENDMODE_ALPHA _BLENDMODE_ADD _BLENDMODE_PRE_MULTIPLY + //#pragma shader_feature_local _ _ADD_PRECOMPUTED_VELOCITY + //#pragma shader_feature_local _ _TRANSPARENT_WRITES_MOTION_VEC + //#pragma shader_feature_local _ _ENABLE_FOG_ON_TRANSPARENT + #pragma multi_compile _ WRITE_NORMAL_BUFFER + //#pragma shader_feature_local _ _DISABLE_DECALS + //#pragma shader_feature_local _ _DISABLE_SSR + //#pragma shader_feature_local _ _DISABLE_SSR_TRANSPARENT + #pragma multi_compile _ WRITE_DECAL_BUFFER + //#pragma shader_feature_local _REFRACTION_OFF _REFRACTION_PLANE _REFRACTION_SPHERE _REFRACTION_THIN + + + + #define SHADERPASS SHADERPASS_MOTION_VECTORS + #define RAYTRACING_SHADER_GRAPH_DEFAULT + #define VARYINGS_NEED_PASS + #define _PASSMOTIONVECTOR 1 + + + + #pragma shader_feature_local GLOW_ON + #pragma shader_feature_local FADE_ON + #pragma shader_feature_local OUTBASE_ON + #pragma shader_feature_local ONLYOUTLINE_ON + #pragma shader_feature_local GRADIENT_ON + #pragma shader_feature_local GRADIENT2COL_ON + #pragma shader_feature_local RADIALGRADIENT_ON + #pragma shader_feature_local COLORSWAP_ON + #pragma shader_feature_local HSV_ON + #pragma shader_feature_local CHANGECOLOR_ON + #pragma shader_feature_local CHANGECOLOR2_ON + #pragma shader_feature_local CHANGECOLOR3_ON + #pragma shader_feature_local COLORRAMP_ON + #pragma shader_feature_local GRADIENTCOLORRAMP_ON + #pragma shader_feature_local HITEFFECT_ON + #pragma shader_feature_local NEGATIVE_ON + #pragma shader_feature_local PIXELATE_ON + #pragma shader_feature_local GREYSCALE_ON + #pragma shader_feature_local POSTERIZE_ON + #pragma shader_feature_local BLUR_ON + #pragma shader_feature_local MOTIONBLUR_ON + #pragma shader_feature_local GHOST_ON + #pragma shader_feature_local ALPHAOUTLINE_ON + #pragma shader_feature_local INNEROUTLINE_ON + #pragma shader_feature_local ONLYINNEROUTLINE_ON + #pragma shader_feature_local HOLOGRAM_ON + #pragma shader_feature_local CHROMABERR_ON + #pragma shader_feature_local GLITCH_ON + #pragma shader_feature_local FLICKER_ON + #pragma shader_feature_local SHADOW_ON + #pragma shader_feature_local SHINE_ON + #pragma shader_feature_local CONTRAST_ON + #pragma shader_feature_local OVERLAY_ON + #pragma shader_feature_local OVERLAYMULT_ON + #pragma shader_feature_local DOODLE_ON + #pragma shader_feature_local WIND_ON + #pragma shader_feature_local WAVEUV_ON + #pragma shader_feature_local ROUNDWAVEUV_ON + #pragma shader_feature_local RECTSIZE_ON + #pragma shader_feature_local OFFSETUV_ON + #pragma shader_feature_local CLIPPING_ON + #pragma shader_feature_local RADIALCLIPPING_ON + #pragma shader_feature_local TEXTURESCROLL_ON + #pragma shader_feature_local ZOOMUV_ON + #pragma shader_feature_local DISTORT_ON + #pragma shader_feature_local WARP_ON + #pragma shader_feature_local TWISTUV_ON + #pragma shader_feature_local ROTATEUV_ON + #pragma shader_feature_local POLARUV_ON + #pragma shader_feature_local FISHEYE_ON + #pragma shader_feature_local PINCH_ON + #pragma shader_feature_local SHAKEUV_ON + + #pragma shader_feature_local GLOWTEX_ON + #pragma shader_feature_local OUTTEX_ON + #pragma shader_feature_local OUTDIST_ON + #pragma shader_feature_local OUTBASE8DIR_ON + #pragma shader_feature_local OUTBASEPIXELPERF_ON + #pragma shader_feature_local COLORRAMPOUTLINE_ON + #pragma shader_feature_local GREYSCALEOUTLINE_ON + #pragma shader_feature_local POSTERIZEOUTLINE_ON + #pragma shader_feature_local BLURISHD_ON + #pragma shader_feature_local MANUALWIND_ON + #pragma shader_feature_local ATLAS_ON + #pragma shader_feature_local PREMULTIPLYALPHA_ON + + #pragma shader_feature BILBOARD_ON + #pragma shader_feature BILBOARDY_ON + + #pragma shader_feature NORMALMAP_ON + + + #define _HDRP 1 +#define _USINGTEXCOORD1 1 +#define _USINGTEXCOORD2 1 + + + #pragma vertex Vert + #pragma fragment Frag + + // useful conversion functions to make surface shader code just work + + #define UNITY_DECLARE_TEX2D(name) TEXTURE2D(name); SAMPLER(sampler##name); + #define UNITY_DECLARE_TEX2D_NOSAMPLER(name) TEXTURE2D(name); + #define UNITY_DECLARE_TEX2DARRAY(name) TEXTURE2D_ARRAY(name); SAMPLER(sampler##name); + #define UNITY_DECLARE_TEX2DARRAY_NOSAMPLER(tex) TEXTURE2D_ARRAY(tex); + + #define UNITY_SAMPLE_TEX2DARRAY(tex,coord) SAMPLE_TEXTURE2D_ARRAY(tex, sampler##tex, coord.xy, coord.z) + #define UNITY_SAMPLE_TEX2DARRAY_LOD(tex,coord,lod) SAMPLE_TEXTURE2D_ARRAY_LOD(tex, sampler##tex, coord.xy, coord.z, lod) + #define UNITY_SAMPLE_TEX2D(tex, coord) SAMPLE_TEXTURE2D(tex, sampler##tex, coord) + #define UNITY_SAMPLE_TEX2D_SAMPLER(tex, samp, coord) SAMPLE_TEXTURE2D(tex, sampler##samp, coord) + + #define UNITY_SAMPLE_TEX2D_LOD(tex,coord, lod) SAMPLE_TEXTURE2D_LOD(tex, sampler_##tex, coord, lod) + #define UNITY_SAMPLE_TEX2D_SAMPLER_LOD(tex,samplertex,coord, lod) SAMPLE_TEXTURE2D_LOD (tex, sampler##samplertex,coord, lod) + + #if defined(UNITY_COMPILER_HLSL) + #define UNITY_INITIALIZE_OUTPUT(type,name) name = (type)0; + #else + #define UNITY_INITIALIZE_OUTPUT(type,name) + #endif + + #define sampler2D_float sampler2D + #define sampler2D_half sampler2D + + #undef WorldNormalVector + #define WorldNormalVector(data, normal) mul(normal, data.TBNMatrix) + + #define UnityObjectToWorldNormal(normal) mul(GetObjectToWorldMatrix(), normal) + + #ifndef SHADER_STAGE_FRAGMENT + #if !defined(SHADOW_ULTRA_LOW) && !defined(SHADOW_LOW) && !defined(SHADOW_MEDIUM) && !defined(SHADOW_HIGH) // ultra low come from volumetricLighting.compute + #define SHADOW_MEDIUM + #endif + #if !defined(AREA_SHADOW_LOW) && !defined(AREA_SHADOW_MEDIUM) && !defined(AREA_SHADOW_HIGH) // low come from volumetricLighting.compute + #define AREA_SHADOW_MEDIUM + #endif + #endif + + + +// HDRP Adapter stuff + #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Common.hlsl" + #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Texture.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/ShaderVariables.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/ShaderPass/FragInputs.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/ShaderPass/ShaderPass.cs.hlsl" + #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/TextureStack.hlsl" // Required to be include before we include properties as it define DECLARE_STACK_CB + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/NormalBuffer.hlsl" + +#if UNITY_VERSION >= 202239 + #include "Packages/com.unity.shadergraph/ShaderGraphLibrary/Functions.hlsl" // Need to be here for Gradient struct definition +#else + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/ShaderGraphHeader.hlsl" +#endif + #ifdef RAYTRACING_SHADER_GRAPH_DEFAULT + #define RAYTRACING_SHADER_GRAPH_HIGH + #endif + + #ifdef RAYTRACING_SHADER_GRAPH_RAYTRACED + #define RAYTRACING_SHADER_GRAPH_LOW + #endif + // end + + + + + // If we use subsurface scattering, enable output split lighting (for forward pass) + #if defined(_MATERIAL_FEATURE_SUBSURFACE_SCATTERING) && !defined(_SURFACE_TYPE_TRANSPARENT) + #define OUTPUT_SPLIT_LIGHTING + #endif + + #define HAVE_RECURSIVE_RENDERING + + #if SHADERPASS == SHADERPASS_TRANSPARENT_DEPTH_PREPASS + #if !defined(_DISABLE_SSR_TRANSPARENT) && !defined(SHADER_UNLIT) + #define WRITE_NORMAL_BUFFER + #endif + #endif + + #ifndef DEBUG_DISPLAY + // In case of opaque we don't want to perform the alpha test, it is done in depth prepass and we use depth equal for ztest (setup from UI) + // Don't do it with debug display mode as it is possible there is no depth prepass in this case + #if !defined(_SURFACE_TYPE_TRANSPARENT) && defined(_ALPHATEST) + #if SHADERPASS == SHADERPASS_FORWARD + #define SHADERPASS_FORWARD_BYPASS_ALPHA_TEST + #elif SHADERPASS == SHADERPASS_GBUFFER + #define SHADERPASS_GBUFFER_BYPASS_ALPHA_TEST + #endif + #endif + #endif + + // Define _DEFERRED_CAPABLE_MATERIAL for shader capable to run in deferred pass + #if defined(SHADER_LIT) && !defined(_SURFACE_TYPE_TRANSPARENT) + #define _DEFERRED_CAPABLE_MATERIAL + #endif + + // Translate transparent motion vector define + #if defined(_TRANSPARENT_WRITES_MOTION_VEC) && defined(_SURFACE_TYPE_TRANSPARENT) + #define _WRITE_TRANSPARENT_MOTION_VECTOR + #endif + + + + + CBUFFER_START(UnityPerMaterial) + float _UseShadowThreshold; + float _BlendMode; + float _EnableBlendModePreserveSpecularLighting; + float _RayTracing; + float _RefractionModel; + + + half4 _Color; + half4 _MainTex_ST, _MainTex_TexelSize; + half _Alpha, _AlphaCutoffValue; + + #if ATLAS_ON + half _MinXUV, _MaxXUV, _MinYUV, _MaxYUV; + #endif + + #if GLOW_ON + half4 _GlowColor; + half _Glow, _GlowGlobal; + #endif + + #if HSV_ON + half _HsvShift, _HsvSaturation, _HsvBright; + #endif + + #if DISTORT_ON + half4 _DistortTex_ST; + half _DistortTexXSpeed, _DistortTexYSpeed, _DistortAmount; + #endif + + #if FADE_ON + half4 _FadeBurnColor, _FadeTex_ST, _FadeBurnTex_ST; + half _FadeAmount, _FadeBurnWidth, _FadeBurnTransition,_FadeBurnGlow; + #endif + + #if OUTBASE_ON + half4 _OutlineColor; + half _OutlineAlpha, _OutlineGlow, _OutlineWidth; + int _OutlinePixelWidth; + #endif + + #if OUTTEX_ON + half4 _OutlineTex_ST; + half _OutlineTexXSpeed, _OutlineTexYSpeed; + #endif + + #if OUTDIST_ON + half4 _OutlineDistortTex_ST; + half _OutlineDistortTexXSpeed, _OutlineDistortTexYSpeed, _OutlineDistortAmount; + #endif + + #if ALPHAOUTLINE_ON + half _AlphaOutlineGlow, _AlphaOutlinePower, _AlphaOutlineMinAlpha, _AlphaOutlineBlend; + half4 _AlphaOutlineColor; + #endif + + #if INNEROUTLINE_ON + half _InnerOutlineThickness, _InnerOutlineAlpha, _InnerOutlineGlow; + half4 _InnerOutlineColor; + #endif + + #if GRADIENT_ON + half _GradBlend, _GradBoostX, _GradBoostY; + half4 _GradTopRightCol, _GradTopLeftCol, _GradBotRightCol, _GradBotLeftCol; + #endif + + #if COLORSWAP_ON + half4 _ColorSwapRed, _ColorSwapGreen, _ColorSwapBlue; + half _ColorSwapRedLuminosity, _ColorSwapGreenLuminosity, _ColorSwapBlueLuminosity, _ColorSwapBlend; + #endif + + #if CHANGECOLOR_ON + half4 _ColorChangeNewCol, _ColorChangeTarget; + half _ColorChangeTolerance, _ColorChangeLuminosity; + #endif + #if CHANGECOLOR2_ON + half4 _ColorChangeNewCol2, _ColorChangeTarget2; + half _ColorChangeTolerance2; + #endif + #if CHANGECOLOR3_ON + half4 _ColorChangeNewCol3, _ColorChangeTarget3; + half _ColorChangeTolerance3; + #endif + + #if COLORRAMP_ON + half _ColorRampLuminosity, _ColorRampBlend; + #endif + + #if HITEFFECT_ON + half4 _HitEffectColor; + half _HitEffectGlow, _HitEffectBlend; + #endif + + #if NEGATIVE_ON + half _NegativeAmount; + #endif + + #if PIXELATE_ON + half _PixelateSize; + #endif + + #if GREYSCALE_ON + half _GreyscaleLuminosity, _GreyscaleBlend; + half4 _GreyscaleTintColor; + #endif + + #if POSTERIZE_ON + half _PosterizeNumColors, _PosterizeGamma; + #endif + + #if BLUR_ON + half _BlurIntensity; + #endif + + #if MOTIONBLUR_ON + half _MotionBlurAngle, _MotionBlurDist; + #endif + + #if GHOST_ON + half _GhostColorBoost, _GhostTransparency, _GhostBlend; + #endif + + #if HOLOGRAM_ON + half _HologramStripesAmount, _HologramMinAlpha, _HologramUnmodAmount, _HologramStripesSpeed, _HologramMaxAlpha, _HologramBlend; + half4 _HologramStripeColor; + #endif + + #if CHROMABERR_ON + half _ChromAberrAmount, _ChromAberrAlpha; + #endif + + #if GLITCH_ON + half _GlitchAmount, _GlitchSize; + #endif + + #if FLICKER_ON + half _FlickerFreq, _FlickerPercent, _FlickerAlpha; + #endif + + #if SHADOW_ON + half _ShadowX, _ShadowY, _ShadowAlpha; + half4 _ShadowColor; + #endif + + #if SHINE_ON + half4 _ShineColor; + half _ShineLocation, _ShineRotate, _ShineWidth, _ShineGlow; + #endif + + #if CONTRAST_ON + half _Contrast, _Brightness; + #endif + + #if OVERLAY_ON + half4 _OverlayTex_ST, _OverlayColor; + half _OverlayGlow, _OverlayBlend, _OverlayTextureScrollXSpeed, _OverlayTextureScrollYSpeed; + #endif + + #if DOODLE_ON + half _HandDrawnAmount, _HandDrawnSpeed; + #endif + + #if WIND_ON + half _GrassSpeed, _GrassWind, _GrassManualAnim, _GrassRadialBend; + #endif + + #if WAVEUV_ON + float _WaveAmount, _WaveSpeed, _WaveStrength, _WaveX, _WaveY; + #endif + + #if ROUNDWAVEUV_ON + half _RoundWaveStrength, _RoundWaveSpeed; + #endif + + #if RECTSIZE_ON + half _RectSize; + #endif + + #if OFFSETUV_ON + half _OffsetUvX, _OffsetUvY; + #endif + + #if CLIPPING_ON + half _ClipUvLeft, _ClipUvRight, _ClipUvUp, _ClipUvDown; + #endif + + #if RADIALCLIPPING_ON + half _RadialStartAngle, _RadialClip, _RadialClip2; + #endif + + #if TEXTURESCROLL_ON + half _TextureScrollXSpeed, _TextureScrollYSpeed; + #endif + + #if ZOOMUV_ON + half _ZoomUvAmount; + #endif + + #if WARP_ON + half _WarpStrength, _WarpSpeed, _WarpScale; + #endif + + #if TWISTUV_ON + half _TwistUvAmount, _TwistUvPosX, _TwistUvPosY, _TwistUvRadius; + #endif + + #if ROTATEUV_ON + half _RotateUvAmount; + #endif + + #if FISHEYE_ON + half _FishEyeUvAmount; + #endif + + #if PINCH_ON + half _PinchUvAmount; + #endif + + #if SHAKEUV_ON + half _ShakeUvSpeed, _ShakeUvX, _ShakeUvY; + #endif + + #if NORMALMAP_ON + half _NormalStrength; + #endif + + float _RandomSeed; + + + + + CBUFFER_END + + + + // -- Property used by ScenePickingPass + #ifdef SCENEPICKINGPASS + float4 _SelectionID; + #endif + + // -- Properties used by SceneSelectionPass + #ifdef SCENESELECTIONPASS + int _ObjectId; + int _PassValue; + #endif + + + // data across stages, stripped like the above. + struct VertexToPixel + { + float4 pos : SV_POSITION; + float3 worldPos : TEXCOORD0; + float3 worldNormal : TEXCOORD1; + float4 worldTangent : TEXCOORD2; + float4 texcoord0 : TEXCOORD3; + float4 texcoord1 : TEXCOORD4; + float4 texcoord2 : TEXCOORD5; + // #if %TEXCOORD3REQUIREKEY% + float4 texcoord3 : TEXCOORD6; + // #endif + + // #if %SCREENPOSREQUIREKEY% + // float4 screenPos : TEXCOORD7; + // #endif + + // #if %VERTEXCOLORREQUIREKEY% + float4 vertexColor : COLOR; + // #endif + + // #if %EXTRAV2F0REQUIREKEY% + // float4 extraV2F0 : TEXCOORD8; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // float4 extraV2F1 : TEXCOORD9; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // float4 extraV2F2 : TEXCOORD10; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // float4 extraV2F3 : TEXCOORD11; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // float4 extraV2F4 : TEXCOORD12; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // float4 extraV2F5 : TEXCOORD13; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // float4 extraV2F6 : TEXCOORD14; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // float4 extraV2F7 : TEXCOORD15; + // #endif + + #if UNITY_ANY_INSTANCING_ENABLED + UNITY_VERTEX_INPUT_INSTANCE_ID + #endif // UNITY_ANY_INSTANCING_ENABLED + + #if _HDRP && (_PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR))) + float4 previousPositionCS : TEXCOORD16; // Contain previous transform position (in case of skinning for example) + float4 motionVectorCS : TEXCOORD17; + #endif + + UNITY_VERTEX_OUTPUT_STEREO + }; + + + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Debug/DebugDisplay.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/Material.hlsl" + #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/NormalSurfaceGradient.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/Lit/Lit.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/BuiltinUtilities.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/MaterialUtilities.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/Decal/DecalUtilities.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/Lit/LitDecalData.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/ShaderGraphFunctions.hlsl" + + + + // data describing the user output of a pixel + struct Surface + { + half3 Albedo; + half Height; + half3 Normal; + half Smoothness; + half3 Emission; + half Metallic; + half3 Specular; + half Occlusion; + half SpecularPower; // for simple lighting + half Alpha; + float outputDepth; // if written, SV_Depth semantic is used. ShaderData.clipPos.z is unused value + // HDRP Only + half SpecularOcclusion; + half SubsurfaceMask; + half Thickness; + half CoatMask; + half CoatSmoothness; + half Anisotropy; + half IridescenceMask; + half IridescenceThickness; + int DiffusionProfileHash; + float SpecularAAThreshold; + float SpecularAAScreenSpaceVariance; + // requires _OVERRIDE_BAKEDGI to be defined, but is mapped in all pipelines + float3 DiffuseGI; + float3 BackDiffuseGI; + float3 SpecularGI; + float ior; + float3 transmittanceColor; + float atDistance; + float transmittanceMask; + // requires _OVERRIDE_SHADOWMASK to be defines + float4 ShadowMask; + + // for decals + float NormalAlpha; + float MAOSAlpha; + + + }; + + // Data the user declares in blackboard blocks + struct Blackboard + { + + float blackboardDummyData; + }; + + // data the user might need, this will grow to be big. But easy to strip + struct ShaderData + { + float4 clipPos; // SV_POSITION + float3 localSpacePosition; + float3 localSpaceNormal; + float3 localSpaceTangent; + + float3 worldSpacePosition; + float3 worldSpaceNormal; + float3 worldSpaceTangent; + float tangentSign; + + float3 worldSpaceViewDir; + float3 tangentSpaceViewDir; + + float4 texcoord0; + float4 texcoord1; + float4 texcoord2; + float4 texcoord3; + + float2 screenUV; + float4 screenPos; + + float4 vertexColor; + bool isFrontFace; + + float4 extraV2F0; + float4 extraV2F1; + float4 extraV2F2; + float4 extraV2F3; + float4 extraV2F4; + float4 extraV2F5; + float4 extraV2F6; + float4 extraV2F7; + + float3x3 TBNMatrix; + Blackboard blackboard; + }; + + struct VertexData + { + #if SHADER_TARGET > 30 + // uint vertexID : SV_VertexID; + #endif + float4 vertex : POSITION; + float3 normal : NORMAL; + float4 tangent : TANGENT; + float4 texcoord0 : TEXCOORD0; + + // optimize out mesh coords when not in use by user or lighting system + #if _URP && (_USINGTEXCOORD1 || _PASSMETA || _PASSFORWARD || _PASSGBUFFER) + float4 texcoord1 : TEXCOORD1; + #endif + + #if _URP && (_USINGTEXCOORD2 || _PASSMETA || ((_PASSFORWARD || _PASSGBUFFER) && defined(DYNAMICLIGHTMAP_ON))) + float4 texcoord2 : TEXCOORD2; + #endif + + #if _STANDARD && (_USINGTEXCOORD1 || (_PASSMETA || ((_PASSFORWARD || _PASSGBUFFER || _PASSFORWARDADD) && LIGHTMAP_ON))) + float4 texcoord1 : TEXCOORD1; + #endif + #if _STANDARD && (_USINGTEXCOORD2 || (_PASSMETA || ((_PASSFORWARD || _PASSGBUFFER) && DYNAMICLIGHTMAP_ON))) + float4 texcoord2 : TEXCOORD2; + #endif + + + #if _HDRP + float4 texcoord1 : TEXCOORD1; + float4 texcoord2 : TEXCOORD2; + #endif + + // #if %TEXCOORD3REQUIREKEY% + float4 texcoord3 : TEXCOORD3; + // #endif + + // #if %VERTEXCOLORREQUIREKEY% + float4 vertexColor : COLOR; + // #endif + + #if _PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR)) + float3 previousPositionOS : TEXCOORD4; // Contain previous transform position (in case of skinning for example) + #if defined (_ADD_PRECOMPUTED_VELOCITY) + float3 precomputedVelocity : TEXCOORD5; // Add Precomputed Velocity (Alembic computes velocities on runtime side). + #endif + #endif + + UNITY_VERTEX_INPUT_INSTANCE_ID + }; + + struct TessVertex + { + float4 vertex : INTERNALTESSPOS; + float3 normal : NORMAL; + float4 tangent : TANGENT; + float4 texcoord0 : TEXCOORD0; + float4 texcoord1 : TEXCOORD1; + float4 texcoord2 : TEXCOORD2; + + // #if %TEXCOORD3REQUIREKEY% + float4 texcoord3 : TEXCOORD3; + // #endif + + // #if %VERTEXCOLORREQUIREKEY% + float4 vertexColor : COLOR; + // #endif + + // #if %EXTRAV2F0REQUIREKEY% + // float4 extraV2F0 : TEXCOORD5; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // float4 extraV2F1 : TEXCOORD6; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // float4 extraV2F2 : TEXCOORD7; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // float4 extraV2F3 : TEXCOORD8; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // float4 extraV2F4 : TEXCOORD9; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // float4 extraV2F5 : TEXCOORD10; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // float4 extraV2F6 : TEXCOORD11; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // float4 extraV2F7 : TEXCOORD12; + // #endif + + #if _PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR)) + float3 previousPositionOS : TEXCOORD13; // Contain previous transform position (in case of skinning for example) + #if defined (_ADD_PRECOMPUTED_VELOCITY) + float3 precomputedVelocity : TEXCOORD14; + #endif + #endif + + UNITY_VERTEX_INPUT_INSTANCE_ID + UNITY_VERTEX_OUTPUT_STEREO + }; + + struct ExtraV2F + { + float4 extraV2F0; + float4 extraV2F1; + float4 extraV2F2; + float4 extraV2F3; + float4 extraV2F4; + float4 extraV2F5; + float4 extraV2F6; + float4 extraV2F7; + Blackboard blackboard; + float4 time; + }; + + + float3 WorldToTangentSpace(ShaderData d, float3 normal) + { + return mul(d.TBNMatrix, normal); + } + + float3 TangentToWorldSpace(ShaderData d, float3 normal) + { + return mul(normal, d.TBNMatrix); + } + + // in this case, make standard more like SRPs, because we can't fix + // unity_WorldToObject in HDRP, since it already does macro-fu there + + #if _STANDARD + float3 TransformWorldToObject(float3 p) { return mul(unity_WorldToObject, float4(p, 1)); }; + float3 TransformObjectToWorld(float3 p) { return mul(unity_ObjectToWorld, float4(p, 1)); }; + float4 TransformWorldToObject(float4 p) { return mul(unity_WorldToObject, p); }; + float4 TransformObjectToWorld(float4 p) { return mul(unity_ObjectToWorld, p); }; + float4x4 GetWorldToObjectMatrix() { return unity_WorldToObject; } + float4x4 GetObjectToWorldMatrix() { return unity_ObjectToWorld; } + #if (defined(SHADER_API_D3D11) || defined(SHADER_API_XBOXONE) || defined(UNITY_COMPILER_HLSLCC) || defined(SHADER_API_PSSL) || (SHADER_TARGET_SURFACE_ANALYSIS && !SHADER_TARGET_SURFACE_ANALYSIS_MOJOSHADER)) + #define UNITY_SAMPLE_TEX2D_LOD(tex,coord, lod) tex.SampleLevel (sampler##tex,coord, lod) + #define UNITY_SAMPLE_TEX2D_SAMPLER_LOD(tex,samplertex,coord, lod) tex.SampleLevel (sampler##samplertex,coord, lod) + #else + #define UNITY_SAMPLE_TEX2D_LOD(tex,coord,lod) tex2D (tex,coord,0,lod) + #define UNITY_SAMPLE_TEX2D_SAMPLER_LOD(tex,samplertex,coord,lod) tex2D (tex,coord,0,lod) + #endif + + #undef GetWorldToObjectMatrix() + + #define GetWorldToObjectMatrix() unity_WorldToObject + + + #endif + + float3 GetCameraWorldPosition() + { + #if _HDRP + return GetCameraRelativePositionWS(_WorldSpaceCameraPos); + #else + return _WorldSpaceCameraPos; + #endif + } + + #if _GRABPASSUSED + #if _STANDARD + TEXTURE2D(%GRABTEXTURE%); + SAMPLER(sampler_%GRABTEXTURE%); + #endif + + half3 GetSceneColor(float2 uv) + { + #if _STANDARD + return SAMPLE_TEXTURE2D(%GRABTEXTURE%, sampler_%GRABTEXTURE%, uv).rgb; + #else + return SHADERGRAPH_SAMPLE_SCENE_COLOR(uv); + #endif + } + #endif + + + + #if _STANDARD + UNITY_DECLARE_DEPTH_TEXTURE(_CameraDepthTexture); + float GetSceneDepth(float2 uv) { return SAMPLE_DEPTH_TEXTURE(_CameraDepthTexture, uv); } + float GetLinear01Depth(float2 uv) { return Linear01Depth(GetSceneDepth(uv)); } + float GetLinearEyeDepth(float2 uv) { return LinearEyeDepth(GetSceneDepth(uv)); } + #else + float GetSceneDepth(float2 uv) { return SHADERGRAPH_SAMPLE_SCENE_DEPTH(uv); } + float GetLinear01Depth(float2 uv) { return Linear01Depth(GetSceneDepth(uv), _ZBufferParams); } + float GetLinearEyeDepth(float2 uv) { return LinearEyeDepth(GetSceneDepth(uv), _ZBufferParams); } + #endif + + float3 GetWorldPositionFromDepthBuffer(float2 uv, float3 worldSpaceViewDir) + { + float eye = GetLinearEyeDepth(uv); + float3 camView = mul((float3x3)GetObjectToWorldMatrix(), transpose(mul(GetWorldToObjectMatrix(), UNITY_MATRIX_I_V)) [2].xyz); + + float dt = dot(worldSpaceViewDir, camView); + float3 div = worldSpaceViewDir/dt; + float3 wpos = (eye * div) + GetCameraWorldPosition(); + return wpos; + } + + #if _HDRP + float3 ObjectToWorldSpacePosition(float3 pos) + { + return GetAbsolutePositionWS(TransformObjectToWorld(pos)); + } + #else + float3 ObjectToWorldSpacePosition(float3 pos) + { + return TransformObjectToWorld(pos); + } + #endif + + #if _STANDARD + UNITY_DECLARE_SCREENSPACE_TEXTURE(_CameraDepthNormalsTexture); + float3 GetSceneNormal(float2 uv, float3 worldSpaceViewDir) + { + float4 depthNorms = UNITY_SAMPLE_SCREENSPACE_TEXTURE(_CameraDepthNormalsTexture, uv); + float3 norms = DecodeViewNormalStereo(depthNorms); + norms = mul((float3x3)GetWorldToViewMatrix(), norms) * 0.5 + 0.5; + return norms; + } + #elif _HDRP && !_DECALSHADER + + float3 GetSceneNormal(float2 uv, float3 worldSpaceViewDir) + { + NormalData nd; + DecodeFromNormalBuffer(_ScreenSize.xy * uv, nd); + return nd.normalWS; + } + #elif _URP + #if (SHADER_LIBRARY_VERSION_MAJOR >= 10) + #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/DeclareNormalsTexture.hlsl" + #endif + + float3 GetSceneNormal(float2 uv, float3 worldSpaceViewDir) + { + #if (SHADER_LIBRARY_VERSION_MAJOR >= 10) + return SampleSceneNormals(uv); + #else + float3 wpos = GetWorldPositionFromDepthBuffer(uv, worldSpaceViewDir); + return normalize(-cross(ddx(wpos), ddy(wpos))) * 0.5 + 0.5; + #endif + + } + #endif + + #if _HDRP + + half3 UnpackNormalmapRGorAG(half4 packednormal) + { + // This do the trick + packednormal.x *= packednormal.w; + + half3 normal; + normal.xy = packednormal.xy * 2 - 1; + normal.z = sqrt(1 - saturate(dot(normal.xy, normal.xy))); + return normal; + } + half3 UnpackNormal(half4 packednormal) + { + #if defined(UNITY_NO_DXT5nm) + return packednormal.xyz * 2 - 1; + #else + return UnpackNormalmapRGorAG(packednormal); + #endif + } + #endif + #if _HDRP || _URP + + half3 UnpackScaleNormal(half4 packednormal, half scale) + { + #ifndef UNITY_NO_DXT5nm + // Unpack normal as DXT5nm (1, y, 1, x) or BC5 (x, y, 0, 1) + // Note neutral texture like "bump" is (0, 0, 1, 1) to work with both plain RGB normal and DXT5nm/BC5 + packednormal.x *= packednormal.w; + #endif + half3 normal; + normal.xy = (packednormal.xy * 2 - 1) * scale; + normal.z = sqrt(1 - saturate(dot(normal.xy, normal.xy))); + return normal; + } + + #endif + + + void GetSun(out float3 lightDir, out float3 color) + { + lightDir = float3(0.5, 0.5, 0); + color = 1; + #if _HDRP + if (_DirectionalLightCount > 0) + { + DirectionalLightData light = _DirectionalLightDatas[0]; + lightDir = -light.forward.xyz; + color = light.color; + } + #elif _STANDARD + lightDir = normalize(_WorldSpaceLightPos0.xyz); + color = _LightColor0.rgb; + #elif _URP + Light light = GetMainLight(); + lightDir = light.direction; + color = light.color; + #endif + } + + + + + + + + + + TEXTURE2D(_MainTex); + SAMPLER(sampler_MainTex); + + #if GLOW_ON + TEXTURE2D(_GlowTex); + SAMPLER(sampler_GlowTex); + #endif + + #if FADE_ON + TEXTURE2D(_FadeTex); + SAMPLER(sampler_FadeTex); + + TEXTURE2D(_FadeBurnTex); + SAMPLER(sampler_FadeBurnTex); + #endif + + #if DISTORT_ON + TEXTURE2D(_DistortTex); + SAMPLER(sampler_DistortTex); + #endif + + #if OUTTEX_ON + TEXTURE2D(_OutlineTex); + SAMPLER(sampler_OutlineTex); + #endif + + #if OUTDIST_ON + TEXTURE2D(_OutlineDistortTex); + SAMPLER(sampler_OutlineDistortTex); + #endif + + #if COLORSWAP_ON + TEXTURE2D(_ColorSwapTex); + SAMPLER(sampler_ColorSwapTex); + #endif + + #if COLORRAMP_ON + TEXTURE2D(_ColorRampTex); + TEXTURE2D(_ColorRampTexGradient); + SAMPLER(sampler_ColorRampTex); + SAMPLER(sampler_ColorRampTexGradient); + #endif + + #if SHINE_ON + TEXTURE2D(_ShineMask); + SAMPLER(sampler_ShineMask); + #endif + + #if OVERLAY_ON + TEXTURE2D(_OverlayTex); + SAMPLER(sampler_OverlayTex); + #endif + + #if NORMALMAP_ON + TEXTURE2D(_NormalMap); + SAMPLER(sampler_NormalMap); + #endif + + + half3 GetPixel(in int offsetX, in int offsetY, in half2 uv, in Texture2D _tex, in SamplerState _sampler) + { + half2 _uv = uv + half2(offsetX * _MainTex_TexelSize.x, offsetY * _MainTex_TexelSize.y); + half4 col = SAMPLE_TEXTURE2D(_tex, _sampler, _uv); + return col.rgb; + } + + + //BLURS------------------------------------------------------------------------- + half4 Blur(half2 uv, Texture2D source, SamplerState sampler_source, half Intensity) + { + const half2 texelSize = 1.0 / _ScreenParams.xy; + const half4 color = SAMPLE_TEXTURE2D(source, sampler_source, uv); + const half2 offset = Intensity * texelSize; + + half4 accumulatedColor = color; + half accumulatedWeight = 1.0; + for (int x = -1; x <= 1; x++) + { + for (int y = -1; y <= 1; y++) + { + const half2 sampleUV = uv + half2(x, y) * offset; + const half4 sampleColor = SAMPLE_TEXTURE2D(source, sampler_source, sampleUV); + + accumulatedColor += sampleColor; + accumulatedWeight += 1.0; + } + } + + half4 blurredColor = accumulatedColor / accumulatedWeight; + return blurredColor; + } + + half BlurHD_G(half bhqp, half x) + { + return exp(-(x * x) / (2.0 * bhqp * bhqp)); + } + half4 BlurHD(half2 uv, Texture2D source, SamplerState sampler_source, half BlurAmount, half xScale, half yScale) + { + int iterations = 16; + int halfIterations = iterations / 2; + half sigmaX = 0.1 + BlurAmount * 0.5; + half sigmaY = sigmaX; + half total = 0.0; + half4 ret = half4(0, 0, 0, 0); + for (int iy = 0; iy < iterations; ++iy) + { + half fy = BlurHD_G(sigmaY, half(iy) -half(halfIterations)); + half offsetY = half(iy - halfIterations) * 0.00390625 * xScale; + for (int ix = 0; ix < iterations; ++ix) + { + half fx = BlurHD_G(sigmaX, half(ix) - half(halfIterations)); + half offsetX = half(ix - halfIterations) * 0.00390625 * yScale; + total += fx * fy; + ret += SAMPLE_TEXTURE2D(source, sampler_source, uv + half2(offsetX, offsetY)) * fx * fy; + } + } + return ret / total; + } + //----------------------------------------------------------------------- + + + //------------------------------------------- + half RemapFloat(half inValue, half inMin, half inMax, half outMin, half outMax){ + return outMin + (inValue - inMin) * (outMax - outMin) / (inMax - inMin); + } + //------------------------------------------- + + //----------------------------------------------------------------------- + half rand(half2 seed, half offset) { + return (frac(sin(dot(seed, half2(12.9898, 78.233))) * 43758.5453) + offset) % 1.0; + } + + half rand2(half2 seed, half offset) { + return (frac(sin(dot(seed * floor(50 + (_Time.x % 1.0) * 12.), half2(127.1, 311.7))) * 43758.5453123) + offset) % 1.0; + } + + half rand2CustomTime(half2 seed, half offset, half customTime) { + return (frac(sin(dot(seed * floor(50 + (customTime % 1.0) * 12.), half2(127.1, 311.7))) * 43758.5453123) + offset) % 1.0; + } + //----------------------------------------------------------------------- + + + void Ext_ModifyVertex0 (inout VertexData v, inout ExtraV2F d) + { + //BILBOARD_ON + #if BILBOARD_ON + half3 camRight = mul((half3x3)unity_CameraToWorld, half3(1,0,0)); + half3 camUp = half3(0,1,0); + #if BILBOARDY_ON + camUp = mul((half3x3)unity_CameraToWorld, half3(0,1,0)); + #endif + half3 localPos = v.vertex.x * camRight + v.vertex.y * camUp; + v.vertex = half4(localPos, 1); + #endif + //----------------------------------------------------------- + + v.texcoord0.xy = TRANSFORM_TEX(v.texcoord0.xy, _MainTex); + half2 center = half2(0.5, 0.5); + #if ATLAS_ON + center = half2((_MaxXUV + _MinXUV) / 2.0, (_MaxYUV + _MinYUV) / 2.0); + #endif + + //POLARUV_ON + #if POLARUV_ON + v.texcoord0.xy = v.texcoord0.xy - center; + #endif + + //---------------------------------------- + + //ROTATEUV_ON + #if ROTATEUV_ON + half2 uvC = v.texcoord0.xy; + half cosAngle = cos(_RotateUvAmount); + half sinAngle = sin(_RotateUvAmount); + half2x2 rot = half2x2(cosAngle, -sinAngle, sinAngle, cosAngle); + uvC -= center; + v.texcoord0.xy = mul(rot, uvC); + v.texcoord0.xy += center; + #endif + //-------------------- + + #if RECTSIZE_ON + v.vertex.xyz += (v.vertex.xyz * (_RectSize - 1.0)); + #endif + + #if OUTTEX_ON + v.texcoord1.xy = TRANSFORM_TEX(v.texcoord0.xy, _OutlineTex); + #endif + + #if OUTDIST_ON + v.texcoord2.xy = TRANSFORM_TEX(v.texcoord0.xy, _OutlineDistortTex); + #endif + + #if DISTORT_ON + v.texcoord3.xy = TRANSFORM_TEX(v.texcoord0.xy, _DistortTex); + #endif + } + + void Ext_SurfaceFunction0 (inout Surface o, ShaderData d) + { + half randomSeed = _RandomSeed; + + float2 uvRect = d.texcoord0; + half2 center = half2(0.5, 0.5); + #if ATLAS_ON + center = half2((_MaxXUV + _MinXUV) / 2.0, (_MaxYUV + _MinYUV) / 2.0); + uvRect = half2((d.texcoord0.x - _MinXUV) / (_MaxXUV - _MinXUV), (d.texcoord0.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half2 centerTiled = half2(center.x * _MainTex_ST.x, center.y * _MainTex_ST.y); + + //CLIPPING_ON + #if CLIPPING_ON + half2 tiledUv = half2(d.texcoord0.x / _MainTex_ST.x, d.texcoord0.y / _MainTex_ST.y); + #if ATLAS_ON + tiledUv = half2((tiledUv.x - _MinXUV) / (_MaxXUV - _MinXUV), (tiledUv.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + clip((1 - _ClipUvUp) - tiledUv.y); + clip(tiledUv.y - _ClipUvDown); + clip((1 - _ClipUvRight) - tiledUv.x); + clip(tiledUv.x - _ClipUvLeft); + #endif + //---------------------------------- + + //RADIALCLIPPING_ON + #if RADIALCLIPPING_ON + half2 tiledUv2 = half2(d.texcoord0.x / _MainTex_ST.x, d.texcoord0.y / _MainTex_ST.y); + #if ATLAS_ON + tiledUv2 = half2((tiledUv2.x - _MinXUV) / (_MaxXUV - _MinXUV), (tiledUv2.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half startAngle = _RadialStartAngle - _RadialClip; + half endAngle = _RadialStartAngle + _RadialClip2; + half offset0 = clamp(0, 360, startAngle + 360); + half offset360 = clamp(0, 360, endAngle - 360); + half2 atan2Coord = half2(lerp(-1, 1, tiledUv2.x), lerp(-1, 1, tiledUv2.y)); + half atanAngle = atan2(atan2Coord.y, atan2Coord.x) * 57.3; // angle in degrees + if(atanAngle < 0) atanAngle = 360 + atanAngle; + if(atanAngle >= startAngle && atanAngle <= endAngle) discard; + if(atanAngle <= offset360) discard; + if(atanAngle >= offset0) discard; + #endif + + //----------------------------- + + //TEXTURESCROLL_ON && ATLAS_ON + #if TEXTURESCROLL_ON && ATLAS_ON + d.texcoord0.xy = half2(_MinXUV + ((_MaxXUV - _MinXUV) * (abs(((_Time.y + randomSeed) * _TextureScrollXSpeed) + uvRect.x) % 1)), + _MinYUV + ((_MaxYUV - _MinYUV) * (abs(((_Time.y + randomSeed) * _TextureScrollYSpeed) + uvRect.y) % 1))); + #endif + //---------------------------- + + //OFFSETUV_ON + #if OFFSETUV_ON + #if ATLAS_ON + d.texcoord0.xy = half2(_MinXUV + ((_MaxXUV - _MinXUV) * (abs((_OffsetUvX + uvRect.x) % 1))), + _MinYUV + ((_MaxYUV - _MinYUV) * (abs(_OffsetUvY + uvRect.y) % 1))); + #else + d.texcoord0.xy += half2(_OffsetUvX, _OffsetUvY); + #endif + #endif + + //---------------------- + + //POLARUV_ON + #if POLARUV_ON + d.texcoord0.xy = half2(atan2(d.texcoord0.y, d.texcoord0.x) / (2.0f * 3.141592653589f), length(d.texcoord0.xy)); + d.texcoord0.xy *= _MainTex_ST.xy; + #endif + + //-------------------------------------- + + //TWISTUV_ON + #if TWISTUV_ON + #if ATLAS_ON + _TwistUvPosX = ((_MaxXUV - _MinXUV) * _TwistUvPosX) + _MinXUV; + _TwistUvPosY = ((_MaxYUV - _MinYUV) * _TwistUvPosY) + _MinYUV; + #endif + half2 tempUv = d.texcoord0.xy - half2(_TwistUvPosX * _MainTex_ST.x, _TwistUvPosY * _MainTex_ST.y); + _TwistUvRadius *= (_MainTex_ST.x + _MainTex_ST.y) / 2; + half percent = (_TwistUvRadius - length(tempUv)) / _TwistUvRadius; + half theta = percent * percent * (2.0 * sin(_TwistUvAmount)) * 8.0; + half s = sin(theta); + half c = cos(theta); + half beta = max(sign(_TwistUvRadius - length(tempUv)), 0.0); + tempUv = half2(dot(tempUv, half2(c, -s)), dot(tempUv, half2(s, c))) * beta + tempUv * (1 - beta); + tempUv += half2(_TwistUvPosX * _MainTex_ST.x, _TwistUvPosY * _MainTex_ST.y); + d.texcoord0.xy = tempUv; + #endif + + //-------------------------------------------- + + //FISHEYE_ON + #if FISHEYE_ON + half bind = length(centerTiled); + half2 dF = d.texcoord0.xy - centerTiled; + half dFlen = length(dF); + half fishInt = (3.14159265359 / bind) * (_FishEyeUvAmount + 0.001); + d.texcoord0.xy = centerTiled + (dF / (max(0.0001, dFlen))) * tan(dFlen * fishInt) * bind / tan(bind * fishInt); + #endif + //--------------------------------------------- + + //PINCH_ON + #if PINCH_ON + half2 dP = d.texcoord0.xy - centerTiled; + half pinchInt = (3.141592 / length(centerTiled)) * (-_PinchUvAmount + 0.001); + d.texcoord0.xy = centerTiled + normalize(dP) * atan(length(dP) * -pinchInt * 10.0) * 0.5 / atan(-pinchInt * 5); + #endif + + //--------------------------------------------- + + //ZOOMUV_ON + #if ZOOMUV_ON + d.texcoord0.xy -= centerTiled; + d.texcoord0.xy = d.texcoord0.xy * _ZoomUvAmount; + d.texcoord0.xy += centerTiled; + #endif + + //----------------------------------------------- + + //DOODLE_ON + #if DOODLE_ON + half2 uvCopy = uvRect; + _HandDrawnSpeed = (floor((_Time.x + randomSeed) * 20 * _HandDrawnSpeed) / _HandDrawnSpeed) * _HandDrawnSpeed; + uvCopy.x = sin((uvCopy.x * _HandDrawnAmount + _HandDrawnSpeed) * 4); + uvCopy.y = cos((uvCopy.y * _HandDrawnAmount + _HandDrawnSpeed) * 4); + d.texcoord0.xy = lerp(d.texcoord0.xy, d.texcoord0.xy + uvCopy, 0.0005 * _HandDrawnAmount); + #endif + + //-------------------------- + + //SHAKEUV_ON + #if SHAKEUV_ON + half xShake = sin((_Time.x + randomSeed) * _ShakeUvSpeed * 50) * _ShakeUvX; + half yShake = cos((_Time.x + randomSeed) * _ShakeUvSpeed * 50) * _ShakeUvY; + d.texcoord0.xy += half2(xShake * 0.012, yShake * 0.01); + #endif + + //------------------------------------------- + + //RECTSIZE_ON + #if RECTSIZE_ON + d.texcoord0.xy = d.texcoord0.xy * (_RectSize).xx + (((-_RectSize * 0.5) + 0.5)).xx; + #endif + + //------------------------------------------- + + //DISTORT_ON + #if DISTORT_ON + #if ATLAS_ON + d.texcoord3.x = d.texcoord3.x * (1 / (_MaxXUV - _MinXUV)); + d.texcoord3.y = d.texcoord3.y * (1 / (_MaxYUV - _MinYUV)); + #endif + + d.texcoord3.x += ((_Time.x + _RandomSeed) * _DistortTexXSpeed) % 1; + d.texcoord3.y += ((_Time.x + _RandomSeed) * _DistortTexYSpeed) % 1; + half distortAmnt = (SAMPLE_TEXTURE2D(_DistortTex, sampler_DistortTex, d.texcoord3.xy).r - 0.5) * 0.2 * _DistortAmount; + d.texcoord0.x += distortAmnt; + d.texcoord0.y += distortAmnt; + #endif + //------------------------------------------------------- + + //WARP_ON + #if WARP_ON + half2 warpUv = half2(d.texcoord0.x / _MainTex_ST.x, d.texcoord0.y / _MainTex_ST.y); + #if ATLAS_ON + warpUv = half2((warpUv.x - _MinXUV) / (_MaxXUV - _MinXUV), (warpUv.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + const float tau = 6.283185307179586; + float xWarp = (_Time.y + randomSeed) * _WarpSpeed + warpUv.x * tau / _WarpScale; + float yWarp = (_Time.y + randomSeed) * _WarpSpeed + warpUv.y * tau / _WarpScale; + float2 warp = float2(sin(xWarp), sin(yWarp)) * _WarpStrength; + d.texcoord0.xy += warp; + #endif + + //------------------------------------------------------- + + //WAVEUV_ON + #if WAVEUV_ON + float2 uvWave = half2(_WaveX * _MainTex_ST.x, _WaveY * _MainTex_ST.y) - d.texcoord0.xy; + uvWave %= 1; + #if ATLAS_ON + uvWave = half2(_WaveX, _WaveY) - uvRect; + #endif + uvWave.x *= _ScreenParams.x / _ScreenParams.y; + float waveTime = _Time.y + randomSeed; + float angWave = (sqrt(dot(uvWave, uvWave)) * _WaveAmount) - ((waveTime * _WaveSpeed)); + d.texcoord0.xy = d.texcoord0.xy + uvWave * sin(angWave) * (_WaveStrength / 1000.0); + #endif + //---------------------------------------------------- + + //ROUNDWAVEUV_ON + #if ROUNDWAVEUV_ON + half xWave = ((0.5 * _MainTex_ST.x) - uvRect.x); + half yWave = ((0.5 * _MainTex_ST.y) - uvRect.y) * (_MainTex_TexelSize.w / _MainTex_TexelSize.z); + half ripple = -sqrt(xWave*xWave + yWave* yWave); + d.texcoord0.xy += (sin((ripple + (_Time.y + randomSeed) * (_RoundWaveSpeed/10.0)) / 0.015) * (_RoundWaveStrength/10.0)) % 1; + #endif + //---------------------------------------------------- + + + //WIND_ON + #if WIND_ON + half windOffset = sin((_Time.x + randomSeed) * _GrassSpeed * 10); + half2 windCenter = half2(0.5, 0.1); + #if ATLAS_ON + windCenter.x = ((_MaxXUV - _MinXUV) * windCenter.x) + _MinXUV; + windCenter.y = ((_MaxYUV - _MinYUV) * windCenter.y) + _MinYUV; + #endif + #if !MANUALWIND_ON + d.texcoord0.x = fmod(abs(lerp(d.texcoord0.x, d.texcoord0.x + (_GrassWind * 0.01 * windOffset), uvRect.y)), 1); + #else + d.texcoord0.x = fmod(abs(lerp(d.texcoord0.x, d.texcoord0.x + (_GrassWind * 0.01 * _GrassManualAnim), uvRect.y)), 1); + windOffset = _GrassManualAnim; + #endif + half2 delta = d.texcoord0.xy - windCenter; + half delta2 = dot(delta.xy, delta.xy); + half2 delta_offset = delta2 * windOffset; + d.texcoord0.xy = d.texcoord0.xy + half2(delta.y, -delta.x) * delta_offset * _GrassRadialBend; + #endif + + //-------------------------------------------------------- + + //TEXTURESCROLL_ON && !ATLAS_ON + #if TEXTURESCROLL_ON && !ATLAS_ON + d.texcoord0.x += ((_Time.y + randomSeed) * _TextureScrollXSpeed) % 1; + d.texcoord0.y += ((_Time.y + randomSeed) * _TextureScrollYSpeed) % 1; + #endif + //------------------------------ + + //PIXELATE_ON + #if PIXELATE_ON + half aspectRatio = _MainTex_TexelSize.x / _MainTex_TexelSize.y; + half2 pixelSize = float2(_PixelateSize, _PixelateSize * aspectRatio); + d.texcoord0.xy = floor(d.texcoord0.xy * pixelSize) / pixelSize; + #endif + //-------------- + + half4 col = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy); + half originalAlpha = col.a; + col *= d.vertexColor; + + //NORMAL MAP + #if NORMALMAP_ON + half4 normalSample = SAMPLE_TEXTURE2D(_NormalMap, sampler_NormalMap, d.texcoord0.xy); + half3 normalTS = UnpackNormal(normalSample); + normalTS.xy *= _NormalStrength; + o.Normal = normalTS; + #endif + + + //GLITCH_ON + #if GLITCH_ON + half2 uvGlitch = uvRect; + uvGlitch.y -= 0.5; + half lineNoise = pow(rand2(floor(uvGlitch * half2(24., 19.) * _GlitchSize) * 4.0, randomSeed), 3.0) * _GlitchAmount + * pow(rand2(floor(uvGlitch * half2(38., 14.) * _GlitchSize) * 4.0, randomSeed), 3.0); + col = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(lineNoise * 0.02 * rand2(half2(2.0, 1), randomSeed), 0)) * d.vertexColor; + #endif + //-------------------------------------- + + //CHROMABERR_ON + #if CHROMABERR_ON + half4 r = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(_ChromAberrAmount/10, 0)) * d.vertexColor; + half4 b = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(-_ChromAberrAmount/10, 0)) * d.vertexColor; + col = half4(r.r * r.a, col.g, b.b * b.a, max(max(r.a, b.a) * _ChromAberrAlpha, col.a)); + #endif + + //-------------------------------- + + //BLUR_ON + #if BLUR_ON + #if ATLAS_ON + #if !BLURISHD_ON + col = BlurHD(d.texcoord0.xy, _MainTex, sampler_MainTex, _BlurIntensity, (_MaxXUV - _MinXUV), (_MaxYUV - _MinYUV)) * d.vertexColor; + #else + col = Blur(d.texcoord0.xy, _MainTex, sampler_MainTex, _BlurIntensity * (_MaxXUV - _MinXUV)) * d.vertexColor; + #endif + #else + #if !BLURISHD_ON + col = BlurHD(d.texcoord0.xy, _MainTex, sampler_MainTex, _BlurIntensity, 1, 1) * d.vertexColor; + #else + col = Blur(d.texcoord0.xy, _MainTex, sampler_MainTex, _BlurIntensity) * d.vertexColor; + #endif + #endif + #endif + + //-------------------- + + //MOTIONBLUR_ON + #if MOTIONBLUR_ON + _MotionBlurAngle = _MotionBlurAngle * 3.1415926; + #define rot(n) mul(n, half2x2(cos(_MotionBlurAngle), -sin(_MotionBlurAngle), sin(_MotionBlurAngle), cos(_MotionBlurAngle))) + _MotionBlurDist = _MotionBlurDist * 0.005; + #if ATLAS_ON + _MotionBlurDist *= (_MaxXUV - _MinXUV); + #endif + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(-_MotionBlurDist, -_MotionBlurDist))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(-_MotionBlurDist * 2, -_MotionBlurDist * 2))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(-_MotionBlurDist * 3, -_MotionBlurDist * 3))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(-_MotionBlurDist * 4, -_MotionBlurDist * 4))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(_MotionBlurDist, _MotionBlurDist))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(_MotionBlurDist * 2, _MotionBlurDist * 2))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(_MotionBlurDist * 3, _MotionBlurDist * 3))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(_MotionBlurDist * 4, _MotionBlurDist * 4))); + col.rgb = col.rgb / 9; + #endif + //------------------------------------ + + //NEGATIVE_ON + #if NEGATIVE_ON + col.rgb = lerp(col.rgb, 1 - col.rgb, _NegativeAmount); + #endif + + //-------------- + half luminance = 0; + + //GREYSCALE_ON && !GREYSCALEOUTLINE_ON + #if GREYSCALE_ON && !GREYSCALEOUTLINE_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + luminance = saturate(luminance + _GreyscaleLuminosity); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _GreyscaleTintColor, _GreyscaleBlend); + #endif + //------------------------------------ + + //GHOST_ON + #if GHOST_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + half4 ghostResult; + ghostResult.a = saturate(luminance - _GhostTransparency) * col.a; + ghostResult.rgb = col.rgb * (luminance + _GhostColorBoost); + col = lerp(col, ghostResult, _GhostBlend); + #endif + //------------------------------------ + + //INNEROUTLINE_ON + #if INNEROUTLINE_ON + half3 innerT = abs(GetPixel(0, _InnerOutlineThickness, d.texcoord0.xy, _MainTex, sampler_MainTex) - GetPixel(0, -_InnerOutlineThickness, d.texcoord0.xy, _MainTex, sampler_MainTex)); + innerT += abs(GetPixel(_InnerOutlineThickness, 0, d.texcoord0.xy, _MainTex, sampler_MainTex) - GetPixel(-_InnerOutlineThickness, 0, d.texcoord0.xy, _MainTex, sampler_MainTex)); + #if !ONLYINNEROUTLINE_ON + innerT = (innerT / 2.0) * col.a * _InnerOutlineAlpha; + col.rgb += length(innerT) * _InnerOutlineColor.rgb * _InnerOutlineGlow; + #else + innerT *= col.a * _InnerOutlineAlpha; + col.rgb = length(innerT) * _InnerOutlineColor.rgb * _InnerOutlineGlow; + col.a = step(0.3, col.r+col.g+col.b); + #endif + #endif + //------------------------------------------------------- + + //HITEFFECT_ON + #if HITEFFECT_ON + col.rgb = lerp(col.rgb, _HitEffectColor.rgb * _HitEffectGlow, _HitEffectBlend); + #endif + //-------------------- + + //GRADIENT_ON + #if GRADIENT_ON + half2 tiledUvGrad = half2(uvRect.x / _MainTex_ST.x, uvRect.y / _MainTex_ST.y); + #if GRADIENT2COL_ON + _GradTopRightCol = _GradTopLeftCol; + _GradBotRightCol = _GradBotLeftCol; + #endif + #if RADIALGRADIENT_ON + half radialDist = 1 - length(tiledUvGrad - half2(0.5, 0.5)); + radialDist *= (_MainTex_TexelSize.w / _MainTex_TexelSize.z); + radialDist = saturate(_GradBoostX * radialDist); + half4 gradientResult = lerp(_GradTopLeftCol, _GradBotLeftCol, radialDist); + #else + half gradXLerpFactor = saturate(pow(tiledUvGrad.x, _GradBoostX)); + half4 gradientResult = lerp(lerp(_GradBotLeftCol, _GradBotRightCol, gradXLerpFactor), + lerp(_GradTopLeftCol, _GradTopRightCol, gradXLerpFactor), saturate(pow(tiledUvGrad.y, _GradBoostY))); + #endif + gradientResult = lerp(col, gradientResult, _GradBlend); + col.rgb = gradientResult.rgb * col.a; + col.a *= gradientResult.a; + #endif + //-------------------------------------------------------------------- + + //CONTRAST_ON + #if CONTRAST_ON + col.rgb = (col.rgb - float3(0.5, 0.5, 0.5)) * _Contrast + float3(0.5, 0.5, 0.5); + col.rgb += _Brightness; + #endif + + //------------------------------------------------------------------- + + //COLORSWAP_ON + #if COLORSWAP_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + half4 swapMask = SAMPLE_TEXTURE2D(_ColorSwapTex, sampler_ColorSwapTex, d.texcoord0.xy); + swapMask.rgb *= swapMask.a; + half3 redSwap = _ColorSwapRed * swapMask.r * saturate(luminance + _ColorSwapRedLuminosity); + half3 greenSwap = _ColorSwapGreen * swapMask.g * saturate(luminance + _ColorSwapGreenLuminosity); + half3 blueSwap = _ColorSwapBlue * swapMask.b * saturate(luminance + _ColorSwapBlueLuminosity); + swapMask.rgb = col.rgb * saturate(1 - swapMask.r - swapMask.g - swapMask.b); + col.rgb = lerp(col.rgb, swapMask.rgb + redSwap + greenSwap + blueSwap, _ColorSwapBlend); + #endif + //-------------------------------------------------------------------- + + //COLORRAMP_ON && !COLORRAMPOUTLINE_ON + #if COLORRAMP_ON && !COLORRAMPOUTLINE_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + luminance = saturate(luminance + _ColorRampLuminosity); + #if GRADIENTCOLORRAMP_ON + col.rgb = lerp(col.rgb, SAMPLE_TEXTURE2D(_ColorRampTexGradient, sampler_ColorRampTexGradient, half2(luminance, 0)).rgb, _ColorRampBlend); + #else + col.rgb = lerp(col.rgb, SAMPLE_TEXTURE2D(_ColorRampTex, sampler_ColorRampTex, half2(luminance, 0)).rgb, _ColorRampBlend); + #endif + #endif + //-------------------------------------------------------------------- + + //CHANGECOLOR_ON + #if CHANGECOLOR_ON + float3 currChangeColor = saturate(col.rgb); + luminance = 0.3 * currChangeColor.r + 0.59 * currChangeColor.g + 0.11 * currChangeColor.b; + luminance = saturate(luminance + _ColorChangeLuminosity); + half3 dif = abs(currChangeColor - _ColorChangeTarget.rgb); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _ColorChangeNewCol.rgb, + max(sign(1 - saturate(dif.x + dif.y + dif.z) - _ColorChangeTolerance), 0.0)); + #if CHANGECOLOR2_ON + dif = abs(currChangeColor - _ColorChangeTarget2.rgb); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _ColorChangeNewCol2.rgb, + max(sign(1 - saturate(dif.x + dif.y + dif.z) - _ColorChangeTolerance2), 0.0)); + #endif + #if CHANGECOLOR3_ON + dif = abs(currChangeColor - _ColorChangeTarget3.rgb); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _ColorChangeNewCol3.rgb, + max(sign(1 - saturate(dif.x + dif.y + dif.z) - _ColorChangeTolerance3), 0.0)); + #endif + #endif + //------------------------------------------------------- + + //POSTERIZE_ON && !POSTERIZEOUTLINE_ON + #if POSTERIZE_ON && !POSTERIZEOUTLINE_ON + col.rgb = pow(col.rgb, _PosterizeGamma) * _PosterizeNumColors; + col.rgb = floor(col.rgb) / _PosterizeNumColors; + col.rgb = pow(col.rgb, 1.0 / _PosterizeGamma); + #endif + //------------------------------------ + + //HSV_ON + #if HSV_ON + half3 resultHsv = half3(col.rgb); + half cosHsv = _HsvBright * _HsvSaturation * cos(_HsvShift * 3.14159265 / 180); + half sinHsv = _HsvBright * _HsvSaturation * sin(_HsvShift * 3.14159265 / 180); + resultHsv.x = (.299 * _HsvBright + .701 * cosHsv + .168 * sinHsv) * col.x + + (.587 * _HsvBright - .587 * cosHsv + .330 * sinHsv) * col.y + + (.114 * _HsvBright - .114 * cosHsv - .497 * sinHsv) * col.z; + resultHsv.y = (.299 * _HsvBright - .299 * cosHsv - .328 * sinHsv) *col.x + + (.587 * _HsvBright + .413 * cosHsv + .035 * sinHsv) * col.y + + (.114 * _HsvBright - .114 * cosHsv + .292 * sinHsv) * col.z; + resultHsv.z = (.299 * _HsvBright - .3 * cosHsv + 1.25 * sinHsv) * col.x + + (.587 * _HsvBright - .588 * cosHsv - 1.05 * sinHsv) * col.y + + (.114 * _HsvBright + .886 * cosHsv - .203 * sinHsv) * col.z; + col.rgb = resultHsv; + #endif + //------------------------------------------------------- + + //OVERLAY_ON + #if OVERLAY_ON + half2 overlayUvs = d.texcoord0.xy; + overlayUvs.x += ((_Time.y + randomSeed) * _OverlayTextureScrollXSpeed) % 1; + overlayUvs.y += ((_Time.y + randomSeed) * _OverlayTextureScrollYSpeed) % 1; + half4 overlayCol = SAMPLE_TEXTURE2D(_OverlayTex, sampler_OverlayTex, TRANSFORM_TEX(overlayUvs, _OverlayTex)); + overlayCol.rgb *= _OverlayColor.rgb * _OverlayGlow; + #if !OVERLAYMULT_ON + overlayCol.rgb *= overlayCol.a * _OverlayColor.rgb * _OverlayColor.a * _OverlayBlend; + col.rgb += overlayCol.rgb; + #else + overlayCol.a *= _OverlayColor.a; + col = lerp(col, col * overlayCol, _OverlayBlend); + #endif + #endif + + //--------------------------------- + + //OUTBASE_ON + #if OUTBASE_ON + #if OUTBASEPIXELPERF_ON + half2 destUv = half2(_OutlinePixelWidth * _MainTex_TexelSize.x, _OutlinePixelWidth * _MainTex_TexelSize.y); + #else + half2 destUv = half2(_OutlineWidth * _MainTex_TexelSize.x * 200, _OutlineWidth * _MainTex_TexelSize.y * 200); + #endif + + #if OUTDIST_ON + d.texcoord3.x += ((_Time.x + _RandomSeed) * _OutlineDistortTexXSpeed) % 1; + d.texcoord3.y += ((_Time.x + _RandomSeed) * _OutlineDistortTexYSpeed) % 1; + #if ATLAS_ON + d.texcoord3 = half2((d.texcoord3.x - _MinXUV) / (_MaxXUV - _MinXUV), (d.texcoord3.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half outDistortAmnt = (SAMPLE_TEXTURE2D(_OutlineDistortTex, sampler_OutlineDistortTex, d.texcoord3).r - 0.5) * 0.2 * _OutlineDistortAmount; + destUv.x += outDistortAmnt; + destUv.y += outDistortAmnt; + #endif + + half spriteLeft = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(destUv.x, 0)).a; + half spriteRight = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy - half2(destUv.x, 0)).a; + half spriteBottom = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(0, destUv.y)).a; + half spriteTop = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy - half2(0, destUv.y)).a; + half result = spriteLeft + spriteRight + spriteBottom + spriteTop; + + #if OUTBASE8DIR_ON + half spriteTopLeft = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(destUv.x, destUv.y)).a; + half spriteTopRight = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(-destUv.x, destUv.y)).a; + half spriteBotLeft = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(destUv.x, -destUv.y)).a; + half spriteBotRight = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(-destUv.x, -destUv.y)).a; + result = result + spriteTopLeft + spriteTopRight + spriteBotLeft + spriteBotRight; + #endif + + result = step(0.05, saturate(result)); + + #if OUTTEX_ON + d.texcoord1.x += ((_Time.x + _RandomSeed) * _OutlineTexXSpeed) % 1; + d.texcoord1.y += ((_Time.x + _RandomSeed) * _OutlineTexYSpeed) % 1; + #if ATLAS_ON + d.texcoord1 = half2((d.texcoord1.x - _MinXUV) / (_MaxXUV - _MinXUV), (d.texcoord1.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half4 tempOutColor = SAMPLE_TEXTURE2D(_OutlineTex, sampler_OutlineTex, d.texcoord1); + tempOutColor *= _OutlineColor; + _OutlineColor = tempOutColor; + #endif + + result *= (1 - originalAlpha) * _OutlineAlpha; + + half4 outline = _OutlineColor * d.vertexColor.a; + outline.rgb *= _OutlineGlow; + outline.a = result; + #if ONLYOUTLINE_ON + col = outline; + #else + col = lerp(col, outline, result); + #endif + #endif + //------------------------------------------------------- + + //FADE_ON + #if FADE_ON + half2 tiledUvFade1 = TRANSFORM_TEX(d.texcoord0, _FadeTex); + half2 tiledUvFade2 = TRANSFORM_TEX(d.texcoord0, _FadeBurnTex); + #if ATLAS_ON + tiledUvFade1 = half2((tiledUvFade1.x - _MinXUV) / (_MaxXUV - _MinXUV), (tiledUvFade1.y - _MinYUV) / (_MaxYUV - _MinYUV)); + tiledUvFade2 = half2((tiledUvFade2.x - _MinXUV) / (_MaxXUV - _MinXUV), (tiledUvFade2.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half fadeTemp = SAMPLE_TEXTURE2D(_FadeTex, sampler_FadeTex, tiledUvFade1).r; + half fade = smoothstep(_FadeAmount, _FadeAmount + _FadeBurnTransition, fadeTemp); + half fadeBurn = saturate(smoothstep(_FadeAmount - _FadeBurnWidth, _FadeAmount - _FadeBurnWidth + 0.1, fadeTemp) * _FadeAmount); + col.a *= fade; + _FadeBurnColor.rgb *= _FadeBurnGlow; + col += fadeBurn * SAMPLE_TEXTURE2D(_FadeBurnTex, sampler_FadeBurnTex, tiledUvFade2) * _FadeBurnColor * originalAlpha * (1 - col.a); + #endif + //------------------------------------------------------- + + //SHADOW_ON + #if SHADOW_ON + half shadowA = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(_ShadowX, _ShadowY)).a; + half preMultShadowMask = 1 - (saturate(shadowA - col.a) * (1 - col.a)); + col.rgb *= 1 - ((shadowA - col.a) * (1 - col.a)); + col.rgb += (_ShadowColor * shadowA) * (1 - col.a); + col.a = max(shadowA * _ShadowAlpha * d.vertexColor.a, col.a); + #endif + + //------------------------------------------------------- + + //GLOW_ON + #if GLOW_ON + half4 emission; + #if GLOWTEX_ON + emission = SAMPLE_TEXTURE2D(_GlowTex, sampler_GlowTex, d.texcoord0); + #else + emission = col; + #endif + + col.rgb *= _GlowGlobal; + emission.rgb *= emission.a * col.a * _Glow * _GlowColor; + col.rgb += emission.rgb; + #endif + //------------------------------------------------------- + + //COLORRAMP_ON && COLORRAMPOUTLINE_ON + #if COLORRAMP_ON && COLORRAMPOUTLINE_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + luminance = saturate(luminance + _ColorRampLuminosity); + #if GRADIENTCOLORRAMP_ON + col.rgb = lerp(col.rgb, SAMPLE_TEXTURE2D(_ColorRampTexGradient, sampler_ColorRampTexGradient, half2(luminance, 0)).rgb, _ColorRampBlend); + #else + col.rgb = lerp(col.rgb, SAMPLE_TEXTURE2D(_ColorRampTex, sampler_ColorRampTex, half2(luminance, 0)).rgb, _ColorRampBlend); + #endif + #endif + //--------------- + + //GREYSCALE_ON && GREYSCALEOUTLINE_ON + #if GREYSCALE_ON && GREYSCALEOUTLINE_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + luminance = saturate(luminance + _GreyscaleLuminosity); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _GreyscaleTintColor, _GreyscaleBlend); + #endif + + //----------------------------------- + + //POSTERIZE_ON && POSTERIZEOUTLINE_ON + #if POSTERIZE_ON && POSTERIZEOUTLINE_ON + col.rgb = pow(col.rgb, _PosterizeGamma) * _PosterizeNumColors; + col.rgb = floor(col.rgb) / _PosterizeNumColors; + col.rgb = pow(col.rgb, 1.0 / _PosterizeGamma); + #endif + + //----------------------------------- + + //SHINE_ON + #if SHINE_ON + half2 uvShine = uvRect; + half cosAngle = cos(_ShineRotate); + half sinAngle = sin(_ShineRotate); + half2x2 rot = half2x2(cosAngle, -sinAngle, sinAngle, cosAngle); + uvShine -= half2(0.5, 0.5); + uvShine = mul(rot, uvShine); + uvShine += half2(0.5, 0.5); + half shineMask = SAMPLE_TEXTURE2D(_ShineMask, sampler_ShineMask, d.texcoord0.xy).a; + half currentDistanceProjection = (uvShine.x + uvShine.y) / 2; + half whitePower = 1 - (abs(currentDistanceProjection - _ShineLocation) / _ShineWidth); + col.rgb += col.a * whitePower * _ShineGlow * max(sign(currentDistanceProjection - (_ShineLocation - _ShineWidth)), 0.0) + * max(sign((_ShineLocation + _ShineWidth) - currentDistanceProjection), 0.0) * _ShineColor * shineMask; + #endif + + //----------------------------------- + + //HOLOGRAM_ON + #if HOLOGRAM_ON + half totalHologram = _HologramStripesAmount + _HologramUnmodAmount; + half hologramYCoord = ((uvRect.y + (((_Time.x + randomSeed) % 1) * _HologramStripesSpeed)) % totalHologram) / totalHologram; + hologramYCoord = abs(hologramYCoord); + half alpha = RemapFloat(saturate(hologramYCoord - (_HologramUnmodAmount/totalHologram)), 0.0, 1.0, _HologramMinAlpha, saturate(_HologramMaxAlpha)); + half hologramMask = max(sign((_HologramUnmodAmount/totalHologram) - hologramYCoord), 0.0); + half4 hologramResult = col; + hologramResult.a *= lerp(alpha, 1, hologramMask); + hologramResult.rgb *= max(1, _HologramMaxAlpha * max(sign(hologramYCoord - (_HologramUnmodAmount/totalHologram)), 0.0)); + hologramMask = 1 - step(0.01,hologramMask); + hologramResult.rgb += hologramMask * _HologramStripeColor * col.a; + col = lerp(col, hologramResult, _HologramBlend); + #endif + + //----------------------------------- + + //FLICKER_ON + #if FLICKER_ON + col.a *= saturate(col.a * step(frac(0.05 + (_Time.w + randomSeed) * _FlickerFreq), 1 - _FlickerPercent) + _FlickerAlpha); + #endif + //----------------------------------- + + //ALPHACUTOFF_ON + + //ALPHAROUND_ON + + //ALPHAOUTLINE_ON + #if ALPHAOUTLINE_ON + half alphaOutlineRes = pow(1 - col.a, max(_AlphaOutlinePower, 0.0001)) * step(_AlphaOutlineMinAlpha, col.a) * _AlphaOutlineBlend; + col.rgb = lerp(col.rgb, _AlphaOutlineColor.rgb * _AlphaOutlineGlow, alphaOutlineRes); + col.a = lerp(col.a, 1, alphaOutlineRes > 1); + #endif + //------------------------------------------------------- + + //FOG_ON + + //------------------ + + col *= _Color; + o.Albedo = col; + col.a *= _Alpha; + clip(col.a - _AlphaCutoffValue - 0.01); + o.Alpha = _Color.a; + } + + + + + + void ChainSurfaceFunction(inout Surface l, inout ShaderData d) + { + Ext_SurfaceFunction0(l, d); + // Ext_SurfaceFunction1(l, d); + // Ext_SurfaceFunction2(l, d); + // Ext_SurfaceFunction3(l, d); + // Ext_SurfaceFunction4(l, d); + // Ext_SurfaceFunction5(l, d); + // Ext_SurfaceFunction6(l, d); + // Ext_SurfaceFunction7(l, d); + // Ext_SurfaceFunction8(l, d); + // Ext_SurfaceFunction9(l, d); + // Ext_SurfaceFunction10(l, d); + // Ext_SurfaceFunction11(l, d); + // Ext_SurfaceFunction12(l, d); + // Ext_SurfaceFunction13(l, d); + // Ext_SurfaceFunction14(l, d); + // Ext_SurfaceFunction15(l, d); + // Ext_SurfaceFunction16(l, d); + // Ext_SurfaceFunction17(l, d); + // Ext_SurfaceFunction18(l, d); + // Ext_SurfaceFunction19(l, d); + // Ext_SurfaceFunction20(l, d); + // Ext_SurfaceFunction21(l, d); + // Ext_SurfaceFunction22(l, d); + // Ext_SurfaceFunction23(l, d); + // Ext_SurfaceFunction24(l, d); + // Ext_SurfaceFunction25(l, d); + // Ext_SurfaceFunction26(l, d); + // Ext_SurfaceFunction27(l, d); + // Ext_SurfaceFunction28(l, d); + // Ext_SurfaceFunction29(l, d); + } + +#if !_DECALSHADER + + void ChainModifyVertex(inout VertexData v, inout VertexToPixel v2p, float4 time) + { + ExtraV2F d; + + ZERO_INITIALIZE(ExtraV2F, d); + ZERO_INITIALIZE(Blackboard, d.blackboard); + // due to motion vectors in HDRP, we need to use the last + // time in certain spots. So if you are going to use _Time to adjust vertices, + // you need to use this time or motion vectors will break. + d.time = time; + + Ext_ModifyVertex0(v, d); + // Ext_ModifyVertex1(v, d); + // Ext_ModifyVertex2(v, d); + // Ext_ModifyVertex3(v, d); + // Ext_ModifyVertex4(v, d); + // Ext_ModifyVertex5(v, d); + // Ext_ModifyVertex6(v, d); + // Ext_ModifyVertex7(v, d); + // Ext_ModifyVertex8(v, d); + // Ext_ModifyVertex9(v, d); + // Ext_ModifyVertex10(v, d); + // Ext_ModifyVertex11(v, d); + // Ext_ModifyVertex12(v, d); + // Ext_ModifyVertex13(v, d); + // Ext_ModifyVertex14(v, d); + // Ext_ModifyVertex15(v, d); + // Ext_ModifyVertex16(v, d); + // Ext_ModifyVertex17(v, d); + // Ext_ModifyVertex18(v, d); + // Ext_ModifyVertex19(v, d); + // Ext_ModifyVertex20(v, d); + // Ext_ModifyVertex21(v, d); + // Ext_ModifyVertex22(v, d); + // Ext_ModifyVertex23(v, d); + // Ext_ModifyVertex24(v, d); + // Ext_ModifyVertex25(v, d); + // Ext_ModifyVertex26(v, d); + // Ext_ModifyVertex27(v, d); + // Ext_ModifyVertex28(v, d); + // Ext_ModifyVertex29(v, d); + + + // #if %EXTRAV2F0REQUIREKEY% + // v2p.extraV2F0 = d.extraV2F0; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // v2p.extraV2F1 = d.extraV2F1; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // v2p.extraV2F2 = d.extraV2F2; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // v2p.extraV2F3 = d.extraV2F3; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // v2p.extraV2F4 = d.extraV2F4; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // v2p.extraV2F5 = d.extraV2F5; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // v2p.extraV2F6 = d.extraV2F6; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // v2p.extraV2F7 = d.extraV2F7; + // #endif + } + + void ChainModifyTessellatedVertex(inout VertexData v, inout VertexToPixel v2p) + { + ExtraV2F d; + ZERO_INITIALIZE(ExtraV2F, d); + ZERO_INITIALIZE(Blackboard, d.blackboard); + + // #if %EXTRAV2F0REQUIREKEY% + // d.extraV2F0 = v2p.extraV2F0; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // d.extraV2F1 = v2p.extraV2F1; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // d.extraV2F2 = v2p.extraV2F2; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // d.extraV2F3 = v2p.extraV2F3; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // d.extraV2F4 = v2p.extraV2F4; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // d.extraV2F5 = v2p.extraV2F5; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // d.extraV2F6 = v2p.extraV2F6; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // d.extraV2F7 = v2p.extraV2F7; + // #endif + + + // Ext_ModifyTessellatedVertex0(v, d); + // Ext_ModifyTessellatedVertex1(v, d); + // Ext_ModifyTessellatedVertex2(v, d); + // Ext_ModifyTessellatedVertex3(v, d); + // Ext_ModifyTessellatedVertex4(v, d); + // Ext_ModifyTessellatedVertex5(v, d); + // Ext_ModifyTessellatedVertex6(v, d); + // Ext_ModifyTessellatedVertex7(v, d); + // Ext_ModifyTessellatedVertex8(v, d); + // Ext_ModifyTessellatedVertex9(v, d); + // Ext_ModifyTessellatedVertex10(v, d); + // Ext_ModifyTessellatedVertex11(v, d); + // Ext_ModifyTessellatedVertex12(v, d); + // Ext_ModifyTessellatedVertex13(v, d); + // Ext_ModifyTessellatedVertex14(v, d); + // Ext_ModifyTessellatedVertex15(v, d); + // Ext_ModifyTessellatedVertex16(v, d); + // Ext_ModifyTessellatedVertex17(v, d); + // Ext_ModifyTessellatedVertex18(v, d); + // Ext_ModifyTessellatedVertex19(v, d); + // Ext_ModifyTessellatedVertex20(v, d); + // Ext_ModifyTessellatedVertex21(v, d); + // Ext_ModifyTessellatedVertex22(v, d); + // Ext_ModifyTessellatedVertex23(v, d); + // Ext_ModifyTessellatedVertex24(v, d); + // Ext_ModifyTessellatedVertex25(v, d); + // Ext_ModifyTessellatedVertex26(v, d); + // Ext_ModifyTessellatedVertex27(v, d); + // Ext_ModifyTessellatedVertex28(v, d); + // Ext_ModifyTessellatedVertex29(v, d); + + // #if %EXTRAV2F0REQUIREKEY% + // v2p.extraV2F0 = d.extraV2F0; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // v2p.extraV2F1 = d.extraV2F1; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // v2p.extraV2F2 = d.extraV2F2; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // v2p.extraV2F3 = d.extraV2F3; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // v2p.extraV2F4 = d.extraV2F4; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // v2p.extraV2F5 = d.extraV2F5; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // v2p.extraV2F6 = d.extraV2F6; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // v2p.extraV2F7 = d.extraV2F7; + // #endif + } + + void ChainFinalColorForward(inout Surface l, inout ShaderData d, inout half4 color) + { + // Ext_FinalColorForward0(l, d, color); + // Ext_FinalColorForward1(l, d, color); + // Ext_FinalColorForward2(l, d, color); + // Ext_FinalColorForward3(l, d, color); + // Ext_FinalColorForward4(l, d, color); + // Ext_FinalColorForward5(l, d, color); + // Ext_FinalColorForward6(l, d, color); + // Ext_FinalColorForward7(l, d, color); + // Ext_FinalColorForward8(l, d, color); + // Ext_FinalColorForward9(l, d, color); + // Ext_FinalColorForward10(l, d, color); + // Ext_FinalColorForward11(l, d, color); + // Ext_FinalColorForward12(l, d, color); + // Ext_FinalColorForward13(l, d, color); + // Ext_FinalColorForward14(l, d, color); + // Ext_FinalColorForward15(l, d, color); + // Ext_FinalColorForward16(l, d, color); + // Ext_FinalColorForward17(l, d, color); + // Ext_FinalColorForward18(l, d, color); + // Ext_FinalColorForward19(l, d, color); + // Ext_FinalColorForward20(l, d, color); + // Ext_FinalColorForward21(l, d, color); + // Ext_FinalColorForward22(l, d, color); + // Ext_FinalColorForward23(l, d, color); + // Ext_FinalColorForward24(l, d, color); + // Ext_FinalColorForward25(l, d, color); + // Ext_FinalColorForward26(l, d, color); + // Ext_FinalColorForward27(l, d, color); + // Ext_FinalColorForward28(l, d, color); + // Ext_FinalColorForward29(l, d, color); + } + + void ChainFinalGBufferStandard(inout Surface s, inout ShaderData d, inout half4 GBuffer0, inout half4 GBuffer1, inout half4 GBuffer2, inout half4 outEmission, inout half4 outShadowMask) + { + // Ext_FinalGBufferStandard0(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard1(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard2(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard3(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard4(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard5(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard6(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard7(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard8(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard9(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard10(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard11(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard12(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard13(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard14(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard15(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard16(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard17(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard18(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard19(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard20(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard21(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard22(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard23(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard24(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard25(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard26(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard27(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard28(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard29(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + } +#endif + + + + + +#if _DECALSHADER + + ShaderData CreateShaderData(SurfaceDescriptionInputs IN) + { + ShaderData d = (ShaderData)0; + d.TBNMatrix = float3x3(IN.WorldSpaceTangent, IN.WorldSpaceBiTangent, IN.WorldSpaceNormal); + d.worldSpaceNormal = IN.WorldSpaceNormal; + d.worldSpaceTangent = IN.WorldSpaceTangent; + + d.worldSpacePosition = IN.WorldSpacePosition; + d.texcoord0 = IN.uv0.xyxy; + d.screenPos = IN.ScreenPosition; + + d.worldSpaceViewDir = normalize(_WorldSpaceCameraPos - d.worldSpacePosition); + + d.tangentSpaceViewDir = mul(d.TBNMatrix, d.worldSpaceViewDir); + + // these rarely get used, so we back transform them. Usually will be stripped. + #if _HDRP + // d.localSpacePosition = mul(GetWorldToObjectMatrix(), float4(GetCameraRelativePositionWS(d.worldSpacePosition), 1)).xyz; + #else + // d.localSpacePosition = mul(GetWorldToObjectMatrix(), float4(d.worldSpacePosition, 1)).xyz; + #endif + // d.localSpaceNormal = normalize(mul((float3x3)GetWorldToObjectMatrix(), d.worldSpaceNormal)); + // d.localSpaceTangent = normalize(mul((float3x3)GetWorldToObjectMatrix(), d.worldSpaceTangent.xyz)); + + // #if %SCREENPOSREQUIREKEY% + // d.screenUV = (IN.ScreenPosition.xy / max(0.01, IN.ScreenPosition.w)); + // #endif + + return d; + } +#else + + ShaderData CreateShaderData(VertexToPixel i + #if NEED_FACING + , bool facing + #endif + ) + { + ShaderData d = (ShaderData)0; + d.clipPos = i.pos; + d.worldSpacePosition = i.worldPos; + + d.worldSpaceNormal = normalize(i.worldNormal); + d.worldSpaceTangent.xyz = normalize(i.worldTangent.xyz); + + d.tangentSign = i.worldTangent.w * unity_WorldTransformParams.w; + float3 bitangent = cross(d.worldSpaceTangent.xyz, d.worldSpaceNormal) * d.tangentSign; + + d.TBNMatrix = float3x3(d.worldSpaceTangent, -bitangent, d.worldSpaceNormal); + d.worldSpaceViewDir = normalize(_WorldSpaceCameraPos - i.worldPos); + + d.tangentSpaceViewDir = mul(d.TBNMatrix, d.worldSpaceViewDir); + d.texcoord0 = i.texcoord0; + d.texcoord1 = i.texcoord1; + d.texcoord2 = i.texcoord2; + + // #if %TEXCOORD3REQUIREKEY% + d.texcoord3 = i.texcoord3; + // #endif + + // d.isFrontFace = facing; + // #if %VERTEXCOLORREQUIREKEY% + d.vertexColor = i.vertexColor; + // #endif + + // these rarely get used, so we back transform them. Usually will be stripped. + #if _HDRP + // d.localSpacePosition = mul(GetWorldToObjectMatrix(), float4(GetCameraRelativePositionWS(i.worldPos), 1)).xyz; + #else + // d.localSpacePosition = mul(GetWorldToObjectMatrix(), float4(i.worldPos, 1)).xyz; + #endif + // d.localSpaceNormal = normalize(mul((float3x3)GetWorldToObjectMatrix(), i.worldNormal)); + // d.localSpaceTangent = normalize(mul((float3x3)GetWorldToObjectMatrix(), i.worldTangent.xyz)); + + // #if %SCREENPOSREQUIREKEY% + // d.screenPos = i.screenPos; + // d.screenUV = (i.screenPos.xy / i.screenPos.w); + // #endif + + + // #if %EXTRAV2F0REQUIREKEY% + // d.extraV2F0 = i.extraV2F0; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // d.extraV2F1 = i.extraV2F1; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // d.extraV2F2 = i.extraV2F2; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // d.extraV2F3 = i.extraV2F3; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // d.extraV2F4 = i.extraV2F4; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // d.extraV2F5 = i.extraV2F5; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // d.extraV2F6 = i.extraV2F6; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // d.extraV2F7 = i.extraV2F7; + // #endif + + return d; + } + +#endif + + + +#if (SHADERPASS == SHADERPASS_LIGHT_TRANSPORT) + + // This was not in constant buffer in original unity, so keep outiside. But should be in as ShaderRenderPass frequency + float unity_OneOverOutputBoost; + float unity_MaxOutputValue; + + CBUFFER_START(UnityMetaPass) + // x = use uv1 as raster position + // y = use uv2 as raster position + bool4 unity_MetaVertexControl; + + // x = return albedo + // y = return normal + bool4 unity_MetaFragmentControl; + CBUFFER_END + + VertexToPixel Vert(VertexData inputMesh) + { + VertexToPixel output; + ZERO_INITIALIZE(VertexToPixel, output); + UNITY_SETUP_INSTANCE_ID(inputMesh); + UNITY_TRANSFER_INSTANCE_ID(inputMesh, output); + UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(output); + + // Output UV coordinate in vertex shader + float2 uv = float2(0.0, 0.0); + + if (unity_MetaVertexControl.x) + { + uv = inputMesh.texcoord1.xy * unity_LightmapST.xy + unity_LightmapST.zw; + } + else if (unity_MetaVertexControl.y) + { + uv = inputMesh.texcoord2.xy * unity_DynamicLightmapST.xy + unity_DynamicLightmapST.zw; + } + + // OpenGL right now needs to actually use the incoming vertex position + // so we create a fake dependency on it here that haven't any impact. + output.pos = float4(uv * 2.0 - 1.0, inputMesh.vertex.z > 0 ? 1.0e-4 : 0.0, 1.0); + + output.worldPos = TransformObjectToWorld(inputMesh.vertex.xyz).xyz; + + // Normal is required for triplanar mapping + output.worldNormal = TransformObjectToWorldNormal(inputMesh.normal); + // Not required but assign to silent compiler warning + output.worldTangent = float4(1.0, 0.0, 0.0, 0.0); + + output.texcoord0 = inputMesh.texcoord0; + output.texcoord1 = inputMesh.texcoord1; + output.texcoord2 = inputMesh.texcoord2; + // #if %TEXCOORD3REQUIREKEY% + output.texcoord3 = inputMesh.texcoord3; + // #endif + // #if %VERTEXCOLORREQUIREKEY% + output.vertexColor = inputMesh.vertexColor; + // #endif + + return output; + } +#else + + #if (_PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR))) + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/ShaderVariablesMatrixDefsHDCamera.hlsl" + + void MotionVectorPositionZBias(VertexToPixel input) + { + #if UNITY_REVERSED_Z + input.pos.z -= unity_MotionVectorsParams.z * input.pos.w; + #else + input.pos.z += unity_MotionVectorsParams.z * input.pos.w; + #endif + } + + #endif + + VertexToPixel Vert(VertexData input) + { + VertexToPixel output; + ZERO_INITIALIZE(VertexToPixel, output); + + UNITY_SETUP_INSTANCE_ID(input); + UNITY_TRANSFER_INSTANCE_ID(input, output); + UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(output); + + #if _HDRP && (_PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR))) + VertexData previousMesh = input; + #endif + + ChainModifyVertex(input, output, _Time); + + // This return the camera relative position (if enable) + float3 positionRWS = TransformObjectToWorld(input.vertex.xyz); + float3 normalWS = TransformObjectToWorldNormal(input.normal); + float4 tangentWS = float4(TransformObjectToWorldDir(input.tangent.xyz), input.tangent.w); + + + output.worldPos = GetAbsolutePositionWS(positionRWS); + output.pos = TransformWorldToHClip(positionRWS); + output.worldNormal = normalWS; + output.worldTangent = tangentWS; + + + output.texcoord0 = input.texcoord0; + output.texcoord1 = input.texcoord1; + output.texcoord2 = input.texcoord2; + + // #if %TEXCOORD3REQUIREKEY% + output.texcoord3 = input.texcoord3; + // #endif + + // #if %VERTEXCOLORREQUIREKEY% + output.vertexColor = input.vertexColor; + // #endif + + // #if %SCREENPOSREQUIREKEY% + // output.screenPos = ComputeScreenPos(output.pos, _ProjectionParams.x); + // #endif + + #if _HDRP && (_PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR))) + + #if !defined(TESSELLATION_ON) + MotionVectorPositionZBias(output); + #endif + + output.motionVectorCS = mul(UNITY_MATRIX_UNJITTERED_VP, float4(positionRWS.xyz, 1.0)); + // Note: unity_MotionVectorsParams.y is 0 is forceNoMotion is enabled + bool forceNoMotion = unity_MotionVectorsParams.y == 0.0; + if (forceNoMotion) + { + output.previousPositionCS = float4(0.0, 0.0, 0.0, 1.0); + } + else + { + bool hasDeformation = unity_MotionVectorsParams.x > 0.0; // Skin or morph target + + float3 effectivePositionOS = (hasDeformation ? previousMesh.previousPositionOS : previousMesh.vertex.xyz); + #if defined(_ADD_PRECOMPUTED_VELOCITY) + effectivePositionOS -= input.precomputedVelocity; + #endif + + previousMesh.vertex = float4(effectivePositionOS, 1); + VertexToPixel dummy = (VertexToPixel)0; + + + ChainModifyVertex(previousMesh, dummy, _LastTimeParameters); + + // we might need this for skinned objects? + //float3 normalWS = TransformPreviousObjectToWorldNormal(input.normal).xyz; + float3 previousPositionRWS = TransformPreviousObjectToWorld(previousMesh.vertex.xyz); + + #ifdef _WRITE_TRANSPARENT_MOTION_VECTOR + if (_TransparentCameraOnlyMotionVectors > 0) + { + previousPositionRWS = positionRWS.xyz; + } + #endif // _WRITE_TRANSPARENT_MOTION_VECTOR + + output.previousPositionCS = mul(UNITY_MATRIX_PREV_VP, float4(previousPositionRWS, 1.0)); + } + #endif // _HDRP && _PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR)) + + + return output; + } + + +#endif + + + + + + + + #if defined(WRITE_DECAL_BUFFER) && !defined(_DISABLE_DECALS) + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/Decal/DecalPrepassBuffer.hlsl" + #endif + + FragInputs BuildFragInputs(VertexToPixel input) + { + UNITY_SETUP_INSTANCE_ID(input); + FragInputs output; + ZERO_INITIALIZE(FragInputs, output); + + // Init to some default value to make the computer quiet (else it output 'divide by zero' warning even if value is not used). + // TODO: this is a really poor workaround, but the variable is used in a bunch of places + // to compute normals which are then passed on elsewhere to compute other values... + output.tangentToWorld = k_identity3x3; + output.positionSS = input.pos; // input.positionCS is SV_Position + // BETTER SHADERS: because we transform world position into actual world space for things like + // triplanar, etc, we have to back transform it here for lighting + output.positionRWS = GetCameraRelativePositionWS(input.worldPos); + output.tangentToWorld = BuildTangentToWorld(input.worldTangent, input.worldNormal); + output.texCoord0 = input.texcoord0; + output.texCoord1 = input.texcoord1; + output.texCoord2 = input.texcoord2; + + return output; + } + +#if UNITY_VERSION > UNITY_2022_3_12 + void ApplyDecalAndGetNormal(FragInputs fragInputs, PositionInputs posInput, Surface surfaceDescription, float3 normalTS, + inout SurfaceData surfaceData) + { + float3 doubleSidedConstants = GetDoubleSidedConstants(); + + #ifdef DECAL_NORMAL_BLENDING + // SG nodes don't ouptut surface gradients, so if decals require surf grad blending, we have to convert + // the normal to gradient before applying the decal. We then have to resolve the gradient back to world space + normalTS = SurfaceGradientFromTangentSpaceNormalAndFromTBN(normalTS, + fragInputs.tangentToWorld[0], fragInputs.tangentToWorld[1]); + + + #if HAVE_DECALS + if (_EnableDecals) + { + float alpha = 1.0; + alpha = surfaceDescription.Alpha; + + DecalSurfaceData decalSurfaceData = GetDecalSurfaceData(posInput, fragInputs, alpha); + ApplyDecalToSurfaceNormal(decalSurfaceData, fragInputs.tangentToWorld[2], normalTS); + ApplyDecalToSurfaceDataNoNormal(decalSurfaceData, surfaceData); + } + #endif + + GetNormalWS_SG(fragInputs, normalTS, surfaceData.normalWS, doubleSidedConstants); + #else + // normal delivered to master node + + #if HAVE_DECALS + if (_EnableDecals) + { + float alpha = 1.0; + alpha = surfaceDescription.Alpha; + + // Both uses and modifies 'surfaceData.normalWS'. + DecalSurfaceData decalSurfaceData = GetDecalSurfaceData(posInput, fragInputs, alpha); + ApplyDecalToSurfaceNormal(decalSurfaceData, surfaceData.normalWS.xyz); + ApplyDecalToSurfaceDataNoNormal(decalSurfaceData, surfaceData); + } + #endif + #endif + } +#endif + + void BuildSurfaceData(FragInputs fragInputs, inout Surface surfaceDescription, float3 V, PositionInputs posInput, out SurfaceData surfaceData, out float3 bentNormalWS) + { + // setup defaults -- these are used if the graph doesn't output a value + ZERO_INITIALIZE(SurfaceData, surfaceData); + + // specularOcclusion need to be init ahead of decal to quiet the compiler that modify the SurfaceData struct + // however specularOcclusion can come from the graph, so need to be init here so it can be override. + surfaceData.specularOcclusion = 1.0; + + // copy across graph values, if defined + surfaceData.baseColor = surfaceDescription.Albedo; + surfaceData.perceptualSmoothness = surfaceDescription.Smoothness; + surfaceData.ambientOcclusion = surfaceDescription.Occlusion; + surfaceData.specularOcclusion = surfaceDescription.SpecularOcclusion; + surfaceData.metallic = surfaceDescription.Metallic; + surfaceData.subsurfaceMask = surfaceDescription.SubsurfaceMask; + surfaceData.thickness = surfaceDescription.Thickness; + surfaceData.diffusionProfileHash = asuint(surfaceDescription.DiffusionProfileHash); + #if _USESPECULAR + surfaceData.specularColor = surfaceDescription.Specular; + #endif + surfaceData.coatMask = surfaceDescription.CoatMask; + surfaceData.anisotropy = surfaceDescription.Anisotropy; + surfaceData.iridescenceMask = surfaceDescription.IridescenceMask; + surfaceData.iridescenceThickness = surfaceDescription.IridescenceThickness; + + + + #if defined(_REFRACTION_PLANE) || defined(_REFRACTION_SPHERE) || defined(_REFRACTION_THIN) + if (_EnableSSRefraction) + { + surfaceData.transmittanceMask = (1.0 - surfaceDescription.Alpha); + surfaceDescription.Alpha = 1.0; + } + else + { + surfaceData.ior = surfaceDescription.ior; + surfaceData.transmittanceColor = surfaceDescription.transmittanceColor; + surfaceData.atDistance = surfaceDescription.atDistance; + surfaceData.transmittanceMask = surfaceDescription.transmittanceMask; + surfaceDescription.Alpha = 1.0; + } + #else + surfaceData.ior = 1.0; + surfaceData.transmittanceColor = float3(1.0, 1.0, 1.0); + surfaceData.atDistance = 1.0; + surfaceData.transmittanceMask = 0.0; + #endif + + + + // These static material feature allow compile time optimization + surfaceData.materialFeatures = MATERIALFEATUREFLAGS_LIT_STANDARD; + #ifdef _MATERIAL_FEATURE_SUBSURFACE_SCATTERING + surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_SUBSURFACE_SCATTERING; + #endif + + #ifdef _MATERIAL_FEATURE_TRANSMISSION + surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_TRANSMISSION; + #endif + + #ifdef _MATERIAL_FEATURE_ANISOTROPY + surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_ANISOTROPY; + surfaceData.normalWS = float3(0, 1, 0); + #endif + + #ifdef _MATERIAL_FEATURE_IRIDESCENCE + surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_IRIDESCENCE; + #endif + + #ifdef _MATERIAL_FEATURE_SPECULAR_COLOR + surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_SPECULAR_COLOR; + #endif + + #if defined(_MATERIAL_FEATURE_CLEAR_COAT) || _CLEARCOAT + surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_CLEAR_COAT; + #endif + + #if defined (_MATERIAL_FEATURE_SPECULAR_COLOR) && defined (_ENERGY_CONSERVING_SPECULAR) + // Require to have setup baseColor + // Reproduce the energy conservation done in legacy Unity. Not ideal but better for compatibility and users can unchek it + surfaceData.baseColor *= (1.0 - Max3(surfaceData.specularColor.r, surfaceData.specularColor.g, surfaceData.specularColor.b)); + #endif + + float3 normalTS = surfaceDescription.Normal; + #if !_WORLDSPACENORMAL + surfaceData.normalWS = mul(surfaceDescription.Normal, fragInputs.tangentToWorld); + #else + normalTS = mul(fragInputs.tangentToWorld, surfaceDescription.Normal); + surfaceData.normalWS = surfaceDescription.Normal; + #endif + + + #if UNITY_VERSION > UNITY_2022_3_12 + ApplyDecalAndGetNormal(fragInputs, posInput, surfaceDescription, normalTS, surfaceData); + #else + #ifdef DECAL_NORMAL_BLENDING + #if HAVE_DECALS + float alpha = 1.0; + alpha = surfaceDescription.Alpha; + if (_EnableDecals) + { + DecalSurfaceData decalSurfaceData = GetDecalSurfaceData(posInput, fragInputs, alpha); + ApplyDecalToSurfaceData(decalSurfaceData, fragInputs.tangentToWorld[2], surfaceData, normalTS); + } + #endif + #else + #if HAVE_DECALS + if (_EnableDecals) + { + float alpha = 1.0; + alpha = surfaceDescription.Alpha; + // Both uses and modifies 'surfaceData.normalWS'. + DecalSurfaceData decalSurfaceData = GetDecalSurfaceData(posInput, fragInputs, alpha); + ApplyDecalToSurfaceData(decalSurfaceData, fragInputs.tangentToWorld[2], surfaceData); + } + #endif + #endif + #endif + + + + surfaceData.geomNormalWS = fragInputs.tangentToWorld[2]; + + surfaceData.tangentWS = normalize(fragInputs.tangentToWorld[0].xyz); // The tangent is not normalize in tangentToWorld for mikkt. TODO: Check if it expected that we normalize with Morten. Tag: SURFACE_GRADIENT + + + bentNormalWS = surfaceData.normalWS; + + surfaceData.tangentWS = Orthonormalize(surfaceData.tangentWS, surfaceData.normalWS); + + #ifdef DEBUG_DISPLAY + if (_DebugMipMapMode != DEBUGMIPMAPMODE_NONE) + { + // TODO: need to update mip info + surfaceData.metallic = 0; + } + + // We need to call ApplyDebugToSurfaceData after filling the surfarcedata and before filling builtinData + // as it can modify attribute use for static lighting + ApplyDebugToSurfaceData(fragInputs.tangentToWorld, surfaceData); + #endif + + // By default we use the ambient occlusion with Tri-ace trick (apply outside) for specular occlusion. + // If user provide bent normal then we process a better term + #if defined(_SPECULAR_OCCLUSION_CUSTOM) + // Just use the value passed through via the slot (not active otherwise) + #elif defined(_SPECULAR_OCCLUSION_FROM_AO_BENT_NORMAL) + // If we have bent normal and ambient occlusion, process a specular occlusion + surfaceData.specularOcclusion = GetSpecularOcclusionFromBentAO(V, bentNormalWS, surfaceData.normalWS, surfaceData.ambientOcclusion, PerceptualSmoothnessToPerceptualRoughness(surfaceData.perceptualSmoothness)); + #elif defined(_AMBIENT_OCCLUSION) && defined(_SPECULAR_OCCLUSION_FROM_AO) + surfaceData.specularOcclusion = GetSpecularOcclusionFromAmbientOcclusion(ClampNdotV(dot(surfaceData.normalWS, V)), surfaceData.ambientOcclusion, PerceptualSmoothnessToRoughness(surfaceData.perceptualSmoothness)); + #endif + + #if defined(_ENABLE_GEOMETRIC_SPECULAR_AA) && !defined(SHADER_STAGE_RAY_TRACING) + surfaceData.perceptualSmoothness = GeometricNormalFiltering(surfaceData.perceptualSmoothness, fragInputs.tangentToWorld[2], surfaceDescription.SpecularAAScreenSpaceVariance, surfaceDescription.SpecularAAThreshold); + #endif + } + + void GetSurfaceAndBuiltinData(VertexToPixel m2ps, FragInputs fragInputs, float3 V, inout PositionInputs posInput, + out SurfaceData surfaceData, out BuiltinData builtinData, inout Surface l, inout ShaderData d + #if NEED_FACING + , bool facing + #endif + ) + { + // Removed since crossfade does not work, probably needs extra material setup. + //#if !defined(SHADER_STAGE_RAY_TRACING) && !defined(_TESSELLATION_DISPLACEMENT) + // #ifdef LOD_FADE_CROSSFADE // enable dithering LOD transition if user select CrossFade transition in LOD group + // LODDitheringTransition(ComputeFadeMaskSeed(V, posInput.positionSS), unity_LODFade.x); + // #endif + //#endif + + + + + d = CreateShaderData(m2ps + #if NEED_FACING + , facing + #endif + ); + + l = (Surface)0; + + l.Albedo = half3(0.5, 0.5, 0.5); + l.Normal = float3(0,0,1); + l.Occlusion = 1; + l.Alpha = 1; + l.SpecularOcclusion = 1; + + #if !defined(SHADER_STAGE_RAY_TRACING) && defined(_DEPTHOFFSET_ON) + l.outputDepth = d.clipPos.z; + #endif + + ChainSurfaceFunction(l, d); + + #if !defined(SHADER_STAGE_RAY_TRACING) && defined(_DEPTHOFFSET_ON) + posInput.deviceDepth = l.outputDepth; + #endif + + #if _UNLIT + //l.Emission = l.Albedo; + //l.Albedo = 0; + l.Normal = half3(0,0,1); + l.Occlusion = 1; + l.Metallic = 0; + l.Specular = 0; + #endif + + surfaceData.geomNormalWS = d.worldSpaceNormal; + surfaceData.tangentWS = d.worldSpaceTangent; + fragInputs.tangentToWorld = d.TBNMatrix; + + float3 bentNormalWS; + + BuildSurfaceData(fragInputs, l, V, posInput, surfaceData, bentNormalWS); + + + float4 lightmapTexCoord1 = fragInputs.texCoord1; + float4 lightmapTexCoord2 = fragInputs.texCoord2; + //#ifdef FRAG_INPUTS_USE_TEXCOORD1 + // float4 lightmapTexCoord1 = fragInputs.texCoord1; + // #else + // float4 lightmapTexCoord1 = float4(0,0,0,0); + // #endif + + // #ifdef FRAG_INPUTS_USE_TEXCOORD2 + // float4 lightmapTexCoord2 = fragInputs.texCoord2; + // #else + // float4 lightmapTexCoord2 = float4(0,0,0,0); + // #endif + + + InitBuiltinData(posInput, l.Alpha, bentNormalWS, -d.worldSpaceNormal, lightmapTexCoord1, lightmapTexCoord2, builtinData); + + + + builtinData.emissiveColor = l.Emission; + + #if defined(_OVERRIDE_BAKEDGI) + builtinData.bakeDiffuseLighting = l.DiffuseGI; + builtinData.backBakeDiffuseLighting = l.BackDiffuseGI; + builtinData.emissiveColor += l.SpecularGI; + #endif + + #if defined(_OVERRIDE_SHADOWMASK) + builtinData.shadowMask0 = l.ShadowMask.x; + builtinData.shadowMask1 = l.ShadowMask.y; + builtinData.shadowMask2 = l.ShadowMask.z; + builtinData.shadowMask3 = l.ShadowMask.w; + #endif + + #ifdef UNITY_VIRTUAL_TEXTURING + //builtinData.vtPackedFeedback = surfaceData.VTPackedFeedback; + #endif + + #if (SHADERPASS == SHADERPASS_DISTORTION) + builtinData.distortion = surfaceData.Distortion; + builtinData.distortionBlur = surfaceData.DistortionBlur; + #endif + + #ifndef SHADER_UNLIT + // PostInitBuiltinData call ApplyDebugToBuiltinData + PostInitBuiltinData(V, posInput, surfaceData, builtinData); + #else + ApplyDebugToBuiltinData(builtinData); + #endif + + RAY_TRACING_OPTIONAL_ALPHA_TEST_PASS + } + + + +#if defined(WRITE_DECAL_BUFFER) && defined(WRITE_MSAA_DEPTH) +#define SV_TARGET_NORMAL SV_Target3 +#elif defined(WRITE_DECAL_BUFFER) || defined(WRITE_MSAA_DEPTH) +#define SV_TARGET_NORMAL SV_Target2 +#else +#define SV_TARGET_NORMAL SV_Target1 +#endif + +// Caution: Motion vector pass is different from Depth prepass, it render normal buffer last instead of decal buffer last +// and thus, we force a write of 0 if _DISABLE_DECALS so we always write in the decal buffer. +// This is required as we can't make distinction between deferred (write normal buffer) and forward (write normal buffer) +// in the context of the motion vector pass. The cost is acceptable as it is only do object with motion vector (usualy skin object) +// that most of the time use Forward Material (so are already writing motion vector data). +// So note that here unlike for depth prepass we don't check && !defined(_DISABLE_DECALS) +void Frag( VertexToPixel v2f + #ifdef WRITE_MSAA_DEPTH + // We need the depth color as SV_Target0 for alpha to coverage + , out float4 depthColor : SV_Target0 + , out float4 outMotionVector : SV_Target1 + #ifdef WRITE_DECAL_BUFFER + , out float4 outDecalBuffer : SV_Target2 + #endif + #else + // When no MSAA, the motion vector is always the first buffer + , out float4 outMotionVector : SV_Target0 + #ifdef WRITE_DECAL_BUFFER + , out float4 outDecalBuffer : SV_Target1 + #endif + #endif + + // Decal buffer must be last as it is bind but we can optionally write into it (based on _DISABLE_DECALS) + #ifdef WRITE_NORMAL_BUFFER + , out float4 outNormalBuffer : SV_TARGET_NORMAL + #endif + + #ifdef _DEPTHOFFSET_ON + , out float outputDepth : SV_Depth + #endif + #if NEED_FACING + , bool facing : SV_IsFrontFace + #endif + ) + { + + FragInputs input = BuildFragInputs(v2f); + PositionInputs posInput = GetPositionInput(input.positionSS.xy, _ScreenSize.zw, input.positionSS.z, input.positionSS.w, input.positionRWS); + + float3 V = GetWorldSpaceNormalizeViewDir(input.positionRWS); + + + SurfaceData surfaceData; + BuiltinData builtinData; + Surface l; + ShaderData d; + GetSurfaceAndBuiltinData(v2f, input, V, posInput, surfaceData, builtinData, l, d + #if NEED_FACING + , facing + #endif + ); + + #ifdef _DEPTHOFFSET_ON + v2f.motionVectorCS.w += builtinData.depthOffset; + v2f.previousPositionCS.w += builtinData.depthOffset; + #endif + + // TODO: How to allow overriden motion vector from GetSurfaceAndBuiltinData ? + float2 motionVector = CalculateMotionVector(v2f.motionVectorCS, v2f.previousPositionCS); + + // Convert from Clip space (-1..1) to NDC 0..1 space. + // Note it doesn't mean we don't have negative value, we store negative or positive offset in NDC space. + // Note: ((positionCS * 0.5 + 0.5) - (v2f.previousPositionCS * 0.5 + 0.5)) = (motionVector * 0.5) + EncodeMotionVector(motionVector * 0.5, outMotionVector); + + // Note: unity_MotionVectorsParams.y is 0 is forceNoMotion is enabled + bool forceNoMotion = unity_MotionVectorsParams.y == 0.0; + + // Setting the motionVector to a value more than 2 set as a flag for "force no motion". This is valid because, given that the velocities are in NDC, + // a value of >1 can never happen naturally, unless explicitely set. + if (forceNoMotion) + outMotionVector = float4(2.0, 0.0, 0.0, 0.0); + + // Depth and Alpha to coverage + #ifdef WRITE_MSAA_DEPTH + // In case we are rendering in MSAA, reading the an MSAA depth buffer is way too expensive. To avoid that, we export the depth to a color buffer + depthColor = v2f.pos.z; + + #ifdef _ALPHATOMASK_ON + // Alpha channel is used for alpha to coverage + depthColor.a = SharpenAlpha(builtinData.opacity, builtinData.alphaClipTreshold); + #endif + #endif + + // Normal Buffer Processing + #ifdef WRITE_NORMAL_BUFFER + EncodeIntoNormalBuffer(ConvertSurfaceDataToNormalData(surfaceData), outNormalBuffer); + #endif + + #if defined(WRITE_DECAL_BUFFER) + DecalPrepassData decalPrepassData; + // Force a write in decal buffer even if decal is disab. This is a neutral value which have no impact for later pass + #ifdef _DISABLE_DECALS + ZERO_INITIALIZE(DecalPrepassData, decalPrepassData); + #else + // We don't have the right to access SurfaceData in a shaderpass. + // However it would be painful to have to add a function like ConvertSurfaceDataToDecalPrepassData() to every Material to return geomNormalWS anyway + // Here we will put the constrain that any Material requiring to support Decal, will need to have geomNormalWS as member of surfaceData (and we already require normalWS anyway) + decalPrepassData.geomNormalWS = surfaceData.geomNormalWS; + decalPrepassData.decalLayerMask = GetMeshRenderingDecalLayer(); + #endif + EncodeIntoDecalPrepassBuffer(decalPrepassData, outDecalBuffer); + outDecalBuffer.w = (GetMeshRenderingLightLayer() & 0x000000FF) / 255.0; + #endif + + #ifdef _DEPTHOFFSET_ON + outputDepth = posInput.deviceDepth; + #endif + } + + ENDHLSL + } + + + Pass + { + Name "FullScreenDebug" + Tags + { + "LightMode" = "FullScreenDebug" + } + + // Render State + Cull Back + ZTest LEqual + ZWrite Off + + //------------------------------------------------------------------------------------- + // End Render Modes + //------------------------------------------------------------------------------------- + + HLSLPROGRAM + + #pragma target 4.5 + #pragma only_renderers d3d11 playstation xboxone xboxseries vulkan metal switch + + + + //#pragma shader_feature _ _SURFACE_TYPE_TRANSPARENT + //#pragma shader_feature_local _BLENDMODE_OFF _BLENDMODE_ALPHA _BLENDMODE_ADD _BLENDMODE_PRE_MULTIPLY + //#pragma shader_feature_local _ _ADD_PRECOMPUTED_VELOCITY + //#pragma shader_feature_local _ _TRANSPARENT_WRITES_MOTION_VEC + //#pragma shader_feature_local _ _ENABLE_FOG_ON_TRANSPARENT + //#pragma shader_feature_local _ _DISABLE_DECALS + //#pragma shader_feature_local _ _DISABLE_SSR + //#pragma shader_feature_local _ _DISABLE_SSR_TRANSPARENT + //#pragma shader_feature_local _REFRACTION_OFF _REFRACTION_PLANE _REFRACTION_SPHERE _REFRACTION_THIN + #pragma multi_compile _ LOD_FADE_CROSSFADE + + + #define SHADERPASS SHADERPASS_FULL_SCREEN_DEBUG + #define _PASSFULLSCREENDEBUG 1 + + + #pragma shader_feature_local GLOW_ON + #pragma shader_feature_local FADE_ON + #pragma shader_feature_local OUTBASE_ON + #pragma shader_feature_local ONLYOUTLINE_ON + #pragma shader_feature_local GRADIENT_ON + #pragma shader_feature_local GRADIENT2COL_ON + #pragma shader_feature_local RADIALGRADIENT_ON + #pragma shader_feature_local COLORSWAP_ON + #pragma shader_feature_local HSV_ON + #pragma shader_feature_local CHANGECOLOR_ON + #pragma shader_feature_local CHANGECOLOR2_ON + #pragma shader_feature_local CHANGECOLOR3_ON + #pragma shader_feature_local COLORRAMP_ON + #pragma shader_feature_local GRADIENTCOLORRAMP_ON + #pragma shader_feature_local HITEFFECT_ON + #pragma shader_feature_local NEGATIVE_ON + #pragma shader_feature_local PIXELATE_ON + #pragma shader_feature_local GREYSCALE_ON + #pragma shader_feature_local POSTERIZE_ON + #pragma shader_feature_local BLUR_ON + #pragma shader_feature_local MOTIONBLUR_ON + #pragma shader_feature_local GHOST_ON + #pragma shader_feature_local ALPHAOUTLINE_ON + #pragma shader_feature_local INNEROUTLINE_ON + #pragma shader_feature_local ONLYINNEROUTLINE_ON + #pragma shader_feature_local HOLOGRAM_ON + #pragma shader_feature_local CHROMABERR_ON + #pragma shader_feature_local GLITCH_ON + #pragma shader_feature_local FLICKER_ON + #pragma shader_feature_local SHADOW_ON + #pragma shader_feature_local SHINE_ON + #pragma shader_feature_local CONTRAST_ON + #pragma shader_feature_local OVERLAY_ON + #pragma shader_feature_local OVERLAYMULT_ON + #pragma shader_feature_local DOODLE_ON + #pragma shader_feature_local WIND_ON + #pragma shader_feature_local WAVEUV_ON + #pragma shader_feature_local ROUNDWAVEUV_ON + #pragma shader_feature_local RECTSIZE_ON + #pragma shader_feature_local OFFSETUV_ON + #pragma shader_feature_local CLIPPING_ON + #pragma shader_feature_local RADIALCLIPPING_ON + #pragma shader_feature_local TEXTURESCROLL_ON + #pragma shader_feature_local ZOOMUV_ON + #pragma shader_feature_local DISTORT_ON + #pragma shader_feature_local WARP_ON + #pragma shader_feature_local TWISTUV_ON + #pragma shader_feature_local ROTATEUV_ON + #pragma shader_feature_local POLARUV_ON + #pragma shader_feature_local FISHEYE_ON + #pragma shader_feature_local PINCH_ON + #pragma shader_feature_local SHAKEUV_ON + + #pragma shader_feature_local GLOWTEX_ON + #pragma shader_feature_local OUTTEX_ON + #pragma shader_feature_local OUTDIST_ON + #pragma shader_feature_local OUTBASE8DIR_ON + #pragma shader_feature_local OUTBASEPIXELPERF_ON + #pragma shader_feature_local COLORRAMPOUTLINE_ON + #pragma shader_feature_local GREYSCALEOUTLINE_ON + #pragma shader_feature_local POSTERIZEOUTLINE_ON + #pragma shader_feature_local BLURISHD_ON + #pragma shader_feature_local MANUALWIND_ON + #pragma shader_feature_local ATLAS_ON + #pragma shader_feature_local PREMULTIPLYALPHA_ON + + #pragma shader_feature BILBOARD_ON + #pragma shader_feature BILBOARDY_ON + + #pragma shader_feature NORMALMAP_ON + + + #define _HDRP 1 +#define _USINGTEXCOORD1 1 +#define _USINGTEXCOORD2 1 + + + #pragma vertex Vert + #pragma fragment Frag + + // useful conversion functions to make surface shader code just work + + #define UNITY_DECLARE_TEX2D(name) TEXTURE2D(name); SAMPLER(sampler##name); + #define UNITY_DECLARE_TEX2D_NOSAMPLER(name) TEXTURE2D(name); + #define UNITY_DECLARE_TEX2DARRAY(name) TEXTURE2D_ARRAY(name); SAMPLER(sampler##name); + #define UNITY_DECLARE_TEX2DARRAY_NOSAMPLER(tex) TEXTURE2D_ARRAY(tex); + + #define UNITY_SAMPLE_TEX2DARRAY(tex,coord) SAMPLE_TEXTURE2D_ARRAY(tex, sampler##tex, coord.xy, coord.z) + #define UNITY_SAMPLE_TEX2DARRAY_LOD(tex,coord,lod) SAMPLE_TEXTURE2D_ARRAY_LOD(tex, sampler##tex, coord.xy, coord.z, lod) + #define UNITY_SAMPLE_TEX2D(tex, coord) SAMPLE_TEXTURE2D(tex, sampler##tex, coord) + #define UNITY_SAMPLE_TEX2D_SAMPLER(tex, samp, coord) SAMPLE_TEXTURE2D(tex, sampler##samp, coord) + + #define UNITY_SAMPLE_TEX2D_LOD(tex,coord, lod) SAMPLE_TEXTURE2D_LOD(tex, sampler_##tex, coord, lod) + #define UNITY_SAMPLE_TEX2D_SAMPLER_LOD(tex,samplertex,coord, lod) SAMPLE_TEXTURE2D_LOD (tex, sampler##samplertex,coord, lod) + + #if defined(UNITY_COMPILER_HLSL) + #define UNITY_INITIALIZE_OUTPUT(type,name) name = (type)0; + #else + #define UNITY_INITIALIZE_OUTPUT(type,name) + #endif + + #define sampler2D_float sampler2D + #define sampler2D_half sampler2D + + #undef WorldNormalVector + #define WorldNormalVector(data, normal) mul(normal, data.TBNMatrix) + + #define UnityObjectToWorldNormal(normal) mul(GetObjectToWorldMatrix(), normal) + + #ifndef SHADER_STAGE_FRAGMENT + #if !defined(SHADOW_ULTRA_LOW) && !defined(SHADOW_LOW) && !defined(SHADOW_MEDIUM) && !defined(SHADOW_HIGH) // ultra low come from volumetricLighting.compute + #define SHADOW_MEDIUM + #endif + #if !defined(AREA_SHADOW_LOW) && !defined(AREA_SHADOW_MEDIUM) && !defined(AREA_SHADOW_HIGH) // low come from volumetricLighting.compute + #define AREA_SHADOW_MEDIUM + #endif + #endif + + + +// HDRP Adapter stuff + #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Common.hlsl" + #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Texture.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/ShaderVariables.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/ShaderPass/FragInputs.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/ShaderPass/ShaderPass.cs.hlsl" + #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/TextureStack.hlsl" // Required to be include before we include properties as it define DECLARE_STACK_CB + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/NormalBuffer.hlsl" + +#if UNITY_VERSION >= 202239 + #include "Packages/com.unity.shadergraph/ShaderGraphLibrary/Functions.hlsl" // Need to be here for Gradient struct definition +#else + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/ShaderGraphHeader.hlsl" +#endif + #ifdef RAYTRACING_SHADER_GRAPH_DEFAULT + #define RAYTRACING_SHADER_GRAPH_HIGH + #endif + + #ifdef RAYTRACING_SHADER_GRAPH_RAYTRACED + #define RAYTRACING_SHADER_GRAPH_LOW + #endif + // end + + + + + // If we use subsurface scattering, enable output split lighting (for forward pass) + #if defined(_MATERIAL_FEATURE_SUBSURFACE_SCATTERING) && !defined(_SURFACE_TYPE_TRANSPARENT) + #define OUTPUT_SPLIT_LIGHTING + #endif + + #define HAVE_RECURSIVE_RENDERING + + #if SHADERPASS == SHADERPASS_TRANSPARENT_DEPTH_PREPASS + #if !defined(_DISABLE_SSR_TRANSPARENT) && !defined(SHADER_UNLIT) + #define WRITE_NORMAL_BUFFER + #endif + #endif + + #ifndef DEBUG_DISPLAY + // In case of opaque we don't want to perform the alpha test, it is done in depth prepass and we use depth equal for ztest (setup from UI) + // Don't do it with debug display mode as it is possible there is no depth prepass in this case + #if !defined(_SURFACE_TYPE_TRANSPARENT) && defined(_ALPHATEST) + #if SHADERPASS == SHADERPASS_FORWARD + #define SHADERPASS_FORWARD_BYPASS_ALPHA_TEST + #elif SHADERPASS == SHADERPASS_GBUFFER + #define SHADERPASS_GBUFFER_BYPASS_ALPHA_TEST + #endif + #endif + #endif + + // Define _DEFERRED_CAPABLE_MATERIAL for shader capable to run in deferred pass + #if defined(SHADER_LIT) && !defined(_SURFACE_TYPE_TRANSPARENT) + #define _DEFERRED_CAPABLE_MATERIAL + #endif + + // Translate transparent motion vector define + #if defined(_TRANSPARENT_WRITES_MOTION_VEC) && defined(_SURFACE_TYPE_TRANSPARENT) + #define _WRITE_TRANSPARENT_MOTION_VECTOR + #endif + + + + + CBUFFER_START(UnityPerMaterial) + float _UseShadowThreshold; + float _BlendMode; + float _EnableBlendModePreserveSpecularLighting; + float _RayTracing; + float _RefractionModel; + + + half4 _Color; + half4 _MainTex_ST, _MainTex_TexelSize; + half _Alpha, _AlphaCutoffValue; + + #if ATLAS_ON + half _MinXUV, _MaxXUV, _MinYUV, _MaxYUV; + #endif + + #if GLOW_ON + half4 _GlowColor; + half _Glow, _GlowGlobal; + #endif + + #if HSV_ON + half _HsvShift, _HsvSaturation, _HsvBright; + #endif + + #if DISTORT_ON + half4 _DistortTex_ST; + half _DistortTexXSpeed, _DistortTexYSpeed, _DistortAmount; + #endif + + #if FADE_ON + half4 _FadeBurnColor, _FadeTex_ST, _FadeBurnTex_ST; + half _FadeAmount, _FadeBurnWidth, _FadeBurnTransition,_FadeBurnGlow; + #endif + + #if OUTBASE_ON + half4 _OutlineColor; + half _OutlineAlpha, _OutlineGlow, _OutlineWidth; + int _OutlinePixelWidth; + #endif + + #if OUTTEX_ON + half4 _OutlineTex_ST; + half _OutlineTexXSpeed, _OutlineTexYSpeed; + #endif + + #if OUTDIST_ON + half4 _OutlineDistortTex_ST; + half _OutlineDistortTexXSpeed, _OutlineDistortTexYSpeed, _OutlineDistortAmount; + #endif + + #if ALPHAOUTLINE_ON + half _AlphaOutlineGlow, _AlphaOutlinePower, _AlphaOutlineMinAlpha, _AlphaOutlineBlend; + half4 _AlphaOutlineColor; + #endif + + #if INNEROUTLINE_ON + half _InnerOutlineThickness, _InnerOutlineAlpha, _InnerOutlineGlow; + half4 _InnerOutlineColor; + #endif + + #if GRADIENT_ON + half _GradBlend, _GradBoostX, _GradBoostY; + half4 _GradTopRightCol, _GradTopLeftCol, _GradBotRightCol, _GradBotLeftCol; + #endif + + #if COLORSWAP_ON + half4 _ColorSwapRed, _ColorSwapGreen, _ColorSwapBlue; + half _ColorSwapRedLuminosity, _ColorSwapGreenLuminosity, _ColorSwapBlueLuminosity, _ColorSwapBlend; + #endif + + #if CHANGECOLOR_ON + half4 _ColorChangeNewCol, _ColorChangeTarget; + half _ColorChangeTolerance, _ColorChangeLuminosity; + #endif + #if CHANGECOLOR2_ON + half4 _ColorChangeNewCol2, _ColorChangeTarget2; + half _ColorChangeTolerance2; + #endif + #if CHANGECOLOR3_ON + half4 _ColorChangeNewCol3, _ColorChangeTarget3; + half _ColorChangeTolerance3; + #endif + + #if COLORRAMP_ON + half _ColorRampLuminosity, _ColorRampBlend; + #endif + + #if HITEFFECT_ON + half4 _HitEffectColor; + half _HitEffectGlow, _HitEffectBlend; + #endif + + #if NEGATIVE_ON + half _NegativeAmount; + #endif + + #if PIXELATE_ON + half _PixelateSize; + #endif + + #if GREYSCALE_ON + half _GreyscaleLuminosity, _GreyscaleBlend; + half4 _GreyscaleTintColor; + #endif + + #if POSTERIZE_ON + half _PosterizeNumColors, _PosterizeGamma; + #endif + + #if BLUR_ON + half _BlurIntensity; + #endif + + #if MOTIONBLUR_ON + half _MotionBlurAngle, _MotionBlurDist; + #endif + + #if GHOST_ON + half _GhostColorBoost, _GhostTransparency, _GhostBlend; + #endif + + #if HOLOGRAM_ON + half _HologramStripesAmount, _HologramMinAlpha, _HologramUnmodAmount, _HologramStripesSpeed, _HologramMaxAlpha, _HologramBlend; + half4 _HologramStripeColor; + #endif + + #if CHROMABERR_ON + half _ChromAberrAmount, _ChromAberrAlpha; + #endif + + #if GLITCH_ON + half _GlitchAmount, _GlitchSize; + #endif + + #if FLICKER_ON + half _FlickerFreq, _FlickerPercent, _FlickerAlpha; + #endif + + #if SHADOW_ON + half _ShadowX, _ShadowY, _ShadowAlpha; + half4 _ShadowColor; + #endif + + #if SHINE_ON + half4 _ShineColor; + half _ShineLocation, _ShineRotate, _ShineWidth, _ShineGlow; + #endif + + #if CONTRAST_ON + half _Contrast, _Brightness; + #endif + + #if OVERLAY_ON + half4 _OverlayTex_ST, _OverlayColor; + half _OverlayGlow, _OverlayBlend, _OverlayTextureScrollXSpeed, _OverlayTextureScrollYSpeed; + #endif + + #if DOODLE_ON + half _HandDrawnAmount, _HandDrawnSpeed; + #endif + + #if WIND_ON + half _GrassSpeed, _GrassWind, _GrassManualAnim, _GrassRadialBend; + #endif + + #if WAVEUV_ON + float _WaveAmount, _WaveSpeed, _WaveStrength, _WaveX, _WaveY; + #endif + + #if ROUNDWAVEUV_ON + half _RoundWaveStrength, _RoundWaveSpeed; + #endif + + #if RECTSIZE_ON + half _RectSize; + #endif + + #if OFFSETUV_ON + half _OffsetUvX, _OffsetUvY; + #endif + + #if CLIPPING_ON + half _ClipUvLeft, _ClipUvRight, _ClipUvUp, _ClipUvDown; + #endif + + #if RADIALCLIPPING_ON + half _RadialStartAngle, _RadialClip, _RadialClip2; + #endif + + #if TEXTURESCROLL_ON + half _TextureScrollXSpeed, _TextureScrollYSpeed; + #endif + + #if ZOOMUV_ON + half _ZoomUvAmount; + #endif + + #if WARP_ON + half _WarpStrength, _WarpSpeed, _WarpScale; + #endif + + #if TWISTUV_ON + half _TwistUvAmount, _TwistUvPosX, _TwistUvPosY, _TwistUvRadius; + #endif + + #if ROTATEUV_ON + half _RotateUvAmount; + #endif + + #if FISHEYE_ON + half _FishEyeUvAmount; + #endif + + #if PINCH_ON + half _PinchUvAmount; + #endif + + #if SHAKEUV_ON + half _ShakeUvSpeed, _ShakeUvX, _ShakeUvY; + #endif + + #if NORMALMAP_ON + half _NormalStrength; + #endif + + float _RandomSeed; + + + + + CBUFFER_END + + + + // -- Property used by ScenePickingPass + #ifdef SCENEPICKINGPASS + float4 _SelectionID; + #endif + + // -- Properties used by SceneSelectionPass + #ifdef SCENESELECTIONPASS + int _ObjectId; + int _PassValue; + #endif + + + // data across stages, stripped like the above. + struct VertexToPixel + { + float4 pos : SV_POSITION; + float3 worldPos : TEXCOORD0; + float3 worldNormal : TEXCOORD1; + float4 worldTangent : TEXCOORD2; + float4 texcoord0 : TEXCOORD3; + float4 texcoord1 : TEXCOORD4; + float4 texcoord2 : TEXCOORD5; + // #if %TEXCOORD3REQUIREKEY% + float4 texcoord3 : TEXCOORD6; + // #endif + + // #if %SCREENPOSREQUIREKEY% + // float4 screenPos : TEXCOORD7; + // #endif + + // #if %VERTEXCOLORREQUIREKEY% + float4 vertexColor : COLOR; + // #endif + + // #if %EXTRAV2F0REQUIREKEY% + // float4 extraV2F0 : TEXCOORD8; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // float4 extraV2F1 : TEXCOORD9; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // float4 extraV2F2 : TEXCOORD10; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // float4 extraV2F3 : TEXCOORD11; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // float4 extraV2F4 : TEXCOORD12; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // float4 extraV2F5 : TEXCOORD13; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // float4 extraV2F6 : TEXCOORD14; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // float4 extraV2F7 : TEXCOORD15; + // #endif + + #if UNITY_ANY_INSTANCING_ENABLED + UNITY_VERTEX_INPUT_INSTANCE_ID + #endif // UNITY_ANY_INSTANCING_ENABLED + + #if _HDRP && (_PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR))) + float4 previousPositionCS : TEXCOORD16; // Contain previous transform position (in case of skinning for example) + float4 motionVectorCS : TEXCOORD17; + #endif + + UNITY_VERTEX_OUTPUT_STEREO + }; + + + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Debug/DebugDisplay.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/Material.hlsl" + #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/NormalSurfaceGradient.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/Lit/Lit.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/BuiltinUtilities.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/MaterialUtilities.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/ShaderGraphFunctions.hlsl" + + + + + // data describing the user output of a pixel + struct Surface + { + half3 Albedo; + half Height; + half3 Normal; + half Smoothness; + half3 Emission; + half Metallic; + half3 Specular; + half Occlusion; + half SpecularPower; // for simple lighting + half Alpha; + float outputDepth; // if written, SV_Depth semantic is used. ShaderData.clipPos.z is unused value + // HDRP Only + half SpecularOcclusion; + half SubsurfaceMask; + half Thickness; + half CoatMask; + half CoatSmoothness; + half Anisotropy; + half IridescenceMask; + half IridescenceThickness; + int DiffusionProfileHash; + float SpecularAAThreshold; + float SpecularAAScreenSpaceVariance; + // requires _OVERRIDE_BAKEDGI to be defined, but is mapped in all pipelines + float3 DiffuseGI; + float3 BackDiffuseGI; + float3 SpecularGI; + float ior; + float3 transmittanceColor; + float atDistance; + float transmittanceMask; + // requires _OVERRIDE_SHADOWMASK to be defines + float4 ShadowMask; + + // for decals + float NormalAlpha; + float MAOSAlpha; + + + }; + + // Data the user declares in blackboard blocks + struct Blackboard + { + + float blackboardDummyData; + }; + + // data the user might need, this will grow to be big. But easy to strip + struct ShaderData + { + float4 clipPos; // SV_POSITION + float3 localSpacePosition; + float3 localSpaceNormal; + float3 localSpaceTangent; + + float3 worldSpacePosition; + float3 worldSpaceNormal; + float3 worldSpaceTangent; + float tangentSign; + + float3 worldSpaceViewDir; + float3 tangentSpaceViewDir; + + float4 texcoord0; + float4 texcoord1; + float4 texcoord2; + float4 texcoord3; + + float2 screenUV; + float4 screenPos; + + float4 vertexColor; + bool isFrontFace; + + float4 extraV2F0; + float4 extraV2F1; + float4 extraV2F2; + float4 extraV2F3; + float4 extraV2F4; + float4 extraV2F5; + float4 extraV2F6; + float4 extraV2F7; + + float3x3 TBNMatrix; + Blackboard blackboard; + }; + + struct VertexData + { + #if SHADER_TARGET > 30 + // uint vertexID : SV_VertexID; + #endif + float4 vertex : POSITION; + float3 normal : NORMAL; + float4 tangent : TANGENT; + float4 texcoord0 : TEXCOORD0; + + // optimize out mesh coords when not in use by user or lighting system + #if _URP && (_USINGTEXCOORD1 || _PASSMETA || _PASSFORWARD || _PASSGBUFFER) + float4 texcoord1 : TEXCOORD1; + #endif + + #if _URP && (_USINGTEXCOORD2 || _PASSMETA || ((_PASSFORWARD || _PASSGBUFFER) && defined(DYNAMICLIGHTMAP_ON))) + float4 texcoord2 : TEXCOORD2; + #endif + + #if _STANDARD && (_USINGTEXCOORD1 || (_PASSMETA || ((_PASSFORWARD || _PASSGBUFFER || _PASSFORWARDADD) && LIGHTMAP_ON))) + float4 texcoord1 : TEXCOORD1; + #endif + #if _STANDARD && (_USINGTEXCOORD2 || (_PASSMETA || ((_PASSFORWARD || _PASSGBUFFER) && DYNAMICLIGHTMAP_ON))) + float4 texcoord2 : TEXCOORD2; + #endif + + + #if _HDRP + float4 texcoord1 : TEXCOORD1; + float4 texcoord2 : TEXCOORD2; + #endif + + // #if %TEXCOORD3REQUIREKEY% + float4 texcoord3 : TEXCOORD3; + // #endif + + // #if %VERTEXCOLORREQUIREKEY% + float4 vertexColor : COLOR; + // #endif + + #if _PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR)) + float3 previousPositionOS : TEXCOORD4; // Contain previous transform position (in case of skinning for example) + #if defined (_ADD_PRECOMPUTED_VELOCITY) + float3 precomputedVelocity : TEXCOORD5; // Add Precomputed Velocity (Alembic computes velocities on runtime side). + #endif + #endif + + UNITY_VERTEX_INPUT_INSTANCE_ID + }; + + struct TessVertex + { + float4 vertex : INTERNALTESSPOS; + float3 normal : NORMAL; + float4 tangent : TANGENT; + float4 texcoord0 : TEXCOORD0; + float4 texcoord1 : TEXCOORD1; + float4 texcoord2 : TEXCOORD2; + + // #if %TEXCOORD3REQUIREKEY% + float4 texcoord3 : TEXCOORD3; + // #endif + + // #if %VERTEXCOLORREQUIREKEY% + float4 vertexColor : COLOR; + // #endif + + // #if %EXTRAV2F0REQUIREKEY% + // float4 extraV2F0 : TEXCOORD5; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // float4 extraV2F1 : TEXCOORD6; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // float4 extraV2F2 : TEXCOORD7; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // float4 extraV2F3 : TEXCOORD8; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // float4 extraV2F4 : TEXCOORD9; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // float4 extraV2F5 : TEXCOORD10; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // float4 extraV2F6 : TEXCOORD11; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // float4 extraV2F7 : TEXCOORD12; + // #endif + + #if _PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR)) + float3 previousPositionOS : TEXCOORD13; // Contain previous transform position (in case of skinning for example) + #if defined (_ADD_PRECOMPUTED_VELOCITY) + float3 precomputedVelocity : TEXCOORD14; + #endif + #endif + + UNITY_VERTEX_INPUT_INSTANCE_ID + UNITY_VERTEX_OUTPUT_STEREO + }; + + struct ExtraV2F + { + float4 extraV2F0; + float4 extraV2F1; + float4 extraV2F2; + float4 extraV2F3; + float4 extraV2F4; + float4 extraV2F5; + float4 extraV2F6; + float4 extraV2F7; + Blackboard blackboard; + float4 time; + }; + + + float3 WorldToTangentSpace(ShaderData d, float3 normal) + { + return mul(d.TBNMatrix, normal); + } + + float3 TangentToWorldSpace(ShaderData d, float3 normal) + { + return mul(normal, d.TBNMatrix); + } + + // in this case, make standard more like SRPs, because we can't fix + // unity_WorldToObject in HDRP, since it already does macro-fu there + + #if _STANDARD + float3 TransformWorldToObject(float3 p) { return mul(unity_WorldToObject, float4(p, 1)); }; + float3 TransformObjectToWorld(float3 p) { return mul(unity_ObjectToWorld, float4(p, 1)); }; + float4 TransformWorldToObject(float4 p) { return mul(unity_WorldToObject, p); }; + float4 TransformObjectToWorld(float4 p) { return mul(unity_ObjectToWorld, p); }; + float4x4 GetWorldToObjectMatrix() { return unity_WorldToObject; } + float4x4 GetObjectToWorldMatrix() { return unity_ObjectToWorld; } + #if (defined(SHADER_API_D3D11) || defined(SHADER_API_XBOXONE) || defined(UNITY_COMPILER_HLSLCC) || defined(SHADER_API_PSSL) || (SHADER_TARGET_SURFACE_ANALYSIS && !SHADER_TARGET_SURFACE_ANALYSIS_MOJOSHADER)) + #define UNITY_SAMPLE_TEX2D_LOD(tex,coord, lod) tex.SampleLevel (sampler##tex,coord, lod) + #define UNITY_SAMPLE_TEX2D_SAMPLER_LOD(tex,samplertex,coord, lod) tex.SampleLevel (sampler##samplertex,coord, lod) + #else + #define UNITY_SAMPLE_TEX2D_LOD(tex,coord,lod) tex2D (tex,coord,0,lod) + #define UNITY_SAMPLE_TEX2D_SAMPLER_LOD(tex,samplertex,coord,lod) tex2D (tex,coord,0,lod) + #endif + + #undef GetWorldToObjectMatrix() + + #define GetWorldToObjectMatrix() unity_WorldToObject + + + #endif + + float3 GetCameraWorldPosition() + { + #if _HDRP + return GetCameraRelativePositionWS(_WorldSpaceCameraPos); + #else + return _WorldSpaceCameraPos; + #endif + } + + #if _GRABPASSUSED + #if _STANDARD + TEXTURE2D(%GRABTEXTURE%); + SAMPLER(sampler_%GRABTEXTURE%); + #endif + + half3 GetSceneColor(float2 uv) + { + #if _STANDARD + return SAMPLE_TEXTURE2D(%GRABTEXTURE%, sampler_%GRABTEXTURE%, uv).rgb; + #else + return SHADERGRAPH_SAMPLE_SCENE_COLOR(uv); + #endif + } + #endif + + + + #if _STANDARD + UNITY_DECLARE_DEPTH_TEXTURE(_CameraDepthTexture); + float GetSceneDepth(float2 uv) { return SAMPLE_DEPTH_TEXTURE(_CameraDepthTexture, uv); } + float GetLinear01Depth(float2 uv) { return Linear01Depth(GetSceneDepth(uv)); } + float GetLinearEyeDepth(float2 uv) { return LinearEyeDepth(GetSceneDepth(uv)); } + #else + float GetSceneDepth(float2 uv) { return SHADERGRAPH_SAMPLE_SCENE_DEPTH(uv); } + float GetLinear01Depth(float2 uv) { return Linear01Depth(GetSceneDepth(uv), _ZBufferParams); } + float GetLinearEyeDepth(float2 uv) { return LinearEyeDepth(GetSceneDepth(uv), _ZBufferParams); } + #endif + + float3 GetWorldPositionFromDepthBuffer(float2 uv, float3 worldSpaceViewDir) + { + float eye = GetLinearEyeDepth(uv); + float3 camView = mul((float3x3)GetObjectToWorldMatrix(), transpose(mul(GetWorldToObjectMatrix(), UNITY_MATRIX_I_V)) [2].xyz); + + float dt = dot(worldSpaceViewDir, camView); + float3 div = worldSpaceViewDir/dt; + float3 wpos = (eye * div) + GetCameraWorldPosition(); + return wpos; + } + + #if _HDRP + float3 ObjectToWorldSpacePosition(float3 pos) + { + return GetAbsolutePositionWS(TransformObjectToWorld(pos)); + } + #else + float3 ObjectToWorldSpacePosition(float3 pos) + { + return TransformObjectToWorld(pos); + } + #endif + + #if _STANDARD + UNITY_DECLARE_SCREENSPACE_TEXTURE(_CameraDepthNormalsTexture); + float3 GetSceneNormal(float2 uv, float3 worldSpaceViewDir) + { + float4 depthNorms = UNITY_SAMPLE_SCREENSPACE_TEXTURE(_CameraDepthNormalsTexture, uv); + float3 norms = DecodeViewNormalStereo(depthNorms); + norms = mul((float3x3)GetWorldToViewMatrix(), norms) * 0.5 + 0.5; + return norms; + } + #elif _HDRP && !_DECALSHADER + + float3 GetSceneNormal(float2 uv, float3 worldSpaceViewDir) + { + NormalData nd; + DecodeFromNormalBuffer(_ScreenSize.xy * uv, nd); + return nd.normalWS; + } + #elif _URP + #if (SHADER_LIBRARY_VERSION_MAJOR >= 10) + #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/DeclareNormalsTexture.hlsl" + #endif + + float3 GetSceneNormal(float2 uv, float3 worldSpaceViewDir) + { + #if (SHADER_LIBRARY_VERSION_MAJOR >= 10) + return SampleSceneNormals(uv); + #else + float3 wpos = GetWorldPositionFromDepthBuffer(uv, worldSpaceViewDir); + return normalize(-cross(ddx(wpos), ddy(wpos))) * 0.5 + 0.5; + #endif + + } + #endif + + #if _HDRP + + half3 UnpackNormalmapRGorAG(half4 packednormal) + { + // This do the trick + packednormal.x *= packednormal.w; + + half3 normal; + normal.xy = packednormal.xy * 2 - 1; + normal.z = sqrt(1 - saturate(dot(normal.xy, normal.xy))); + return normal; + } + half3 UnpackNormal(half4 packednormal) + { + #if defined(UNITY_NO_DXT5nm) + return packednormal.xyz * 2 - 1; + #else + return UnpackNormalmapRGorAG(packednormal); + #endif + } + #endif + #if _HDRP || _URP + + half3 UnpackScaleNormal(half4 packednormal, half scale) + { + #ifndef UNITY_NO_DXT5nm + // Unpack normal as DXT5nm (1, y, 1, x) or BC5 (x, y, 0, 1) + // Note neutral texture like "bump" is (0, 0, 1, 1) to work with both plain RGB normal and DXT5nm/BC5 + packednormal.x *= packednormal.w; + #endif + half3 normal; + normal.xy = (packednormal.xy * 2 - 1) * scale; + normal.z = sqrt(1 - saturate(dot(normal.xy, normal.xy))); + return normal; + } + + #endif + + + void GetSun(out float3 lightDir, out float3 color) + { + lightDir = float3(0.5, 0.5, 0); + color = 1; + #if _HDRP + if (_DirectionalLightCount > 0) + { + DirectionalLightData light = _DirectionalLightDatas[0]; + lightDir = -light.forward.xyz; + color = light.color; + } + #elif _STANDARD + lightDir = normalize(_WorldSpaceLightPos0.xyz); + color = _LightColor0.rgb; + #elif _URP + Light light = GetMainLight(); + lightDir = light.direction; + color = light.color; + #endif + } + + + + + + + + + + TEXTURE2D(_MainTex); + SAMPLER(sampler_MainTex); + + #if GLOW_ON + TEXTURE2D(_GlowTex); + SAMPLER(sampler_GlowTex); + #endif + + #if FADE_ON + TEXTURE2D(_FadeTex); + SAMPLER(sampler_FadeTex); + + TEXTURE2D(_FadeBurnTex); + SAMPLER(sampler_FadeBurnTex); + #endif + + #if DISTORT_ON + TEXTURE2D(_DistortTex); + SAMPLER(sampler_DistortTex); + #endif + + #if OUTTEX_ON + TEXTURE2D(_OutlineTex); + SAMPLER(sampler_OutlineTex); + #endif + + #if OUTDIST_ON + TEXTURE2D(_OutlineDistortTex); + SAMPLER(sampler_OutlineDistortTex); + #endif + + #if COLORSWAP_ON + TEXTURE2D(_ColorSwapTex); + SAMPLER(sampler_ColorSwapTex); + #endif + + #if COLORRAMP_ON + TEXTURE2D(_ColorRampTex); + TEXTURE2D(_ColorRampTexGradient); + SAMPLER(sampler_ColorRampTex); + SAMPLER(sampler_ColorRampTexGradient); + #endif + + #if SHINE_ON + TEXTURE2D(_ShineMask); + SAMPLER(sampler_ShineMask); + #endif + + #if OVERLAY_ON + TEXTURE2D(_OverlayTex); + SAMPLER(sampler_OverlayTex); + #endif + + #if NORMALMAP_ON + TEXTURE2D(_NormalMap); + SAMPLER(sampler_NormalMap); + #endif + + + half3 GetPixel(in int offsetX, in int offsetY, in half2 uv, in Texture2D _tex, in SamplerState _sampler) + { + half2 _uv = uv + half2(offsetX * _MainTex_TexelSize.x, offsetY * _MainTex_TexelSize.y); + half4 col = SAMPLE_TEXTURE2D(_tex, _sampler, _uv); + return col.rgb; + } + + + //BLURS------------------------------------------------------------------------- + half4 Blur(half2 uv, Texture2D source, SamplerState sampler_source, half Intensity) + { + const half2 texelSize = 1.0 / _ScreenParams.xy; + const half4 color = SAMPLE_TEXTURE2D(source, sampler_source, uv); + const half2 offset = Intensity * texelSize; + + half4 accumulatedColor = color; + half accumulatedWeight = 1.0; + for (int x = -1; x <= 1; x++) + { + for (int y = -1; y <= 1; y++) + { + const half2 sampleUV = uv + half2(x, y) * offset; + const half4 sampleColor = SAMPLE_TEXTURE2D(source, sampler_source, sampleUV); + + accumulatedColor += sampleColor; + accumulatedWeight += 1.0; + } + } + + half4 blurredColor = accumulatedColor / accumulatedWeight; + return blurredColor; + } + + half BlurHD_G(half bhqp, half x) + { + return exp(-(x * x) / (2.0 * bhqp * bhqp)); + } + half4 BlurHD(half2 uv, Texture2D source, SamplerState sampler_source, half BlurAmount, half xScale, half yScale) + { + int iterations = 16; + int halfIterations = iterations / 2; + half sigmaX = 0.1 + BlurAmount * 0.5; + half sigmaY = sigmaX; + half total = 0.0; + half4 ret = half4(0, 0, 0, 0); + for (int iy = 0; iy < iterations; ++iy) + { + half fy = BlurHD_G(sigmaY, half(iy) -half(halfIterations)); + half offsetY = half(iy - halfIterations) * 0.00390625 * xScale; + for (int ix = 0; ix < iterations; ++ix) + { + half fx = BlurHD_G(sigmaX, half(ix) - half(halfIterations)); + half offsetX = half(ix - halfIterations) * 0.00390625 * yScale; + total += fx * fy; + ret += SAMPLE_TEXTURE2D(source, sampler_source, uv + half2(offsetX, offsetY)) * fx * fy; + } + } + return ret / total; + } + //----------------------------------------------------------------------- + + + //------------------------------------------- + half RemapFloat(half inValue, half inMin, half inMax, half outMin, half outMax){ + return outMin + (inValue - inMin) * (outMax - outMin) / (inMax - inMin); + } + //------------------------------------------- + + //----------------------------------------------------------------------- + half rand(half2 seed, half offset) { + return (frac(sin(dot(seed, half2(12.9898, 78.233))) * 43758.5453) + offset) % 1.0; + } + + half rand2(half2 seed, half offset) { + return (frac(sin(dot(seed * floor(50 + (_Time.x % 1.0) * 12.), half2(127.1, 311.7))) * 43758.5453123) + offset) % 1.0; + } + + half rand2CustomTime(half2 seed, half offset, half customTime) { + return (frac(sin(dot(seed * floor(50 + (customTime % 1.0) * 12.), half2(127.1, 311.7))) * 43758.5453123) + offset) % 1.0; + } + //----------------------------------------------------------------------- + + + void Ext_ModifyVertex0 (inout VertexData v, inout ExtraV2F d) + { + //BILBOARD_ON + #if BILBOARD_ON + half3 camRight = mul((half3x3)unity_CameraToWorld, half3(1,0,0)); + half3 camUp = half3(0,1,0); + #if BILBOARDY_ON + camUp = mul((half3x3)unity_CameraToWorld, half3(0,1,0)); + #endif + half3 localPos = v.vertex.x * camRight + v.vertex.y * camUp; + v.vertex = half4(localPos, 1); + #endif + //----------------------------------------------------------- + + v.texcoord0.xy = TRANSFORM_TEX(v.texcoord0.xy, _MainTex); + half2 center = half2(0.5, 0.5); + #if ATLAS_ON + center = half2((_MaxXUV + _MinXUV) / 2.0, (_MaxYUV + _MinYUV) / 2.0); + #endif + + //POLARUV_ON + #if POLARUV_ON + v.texcoord0.xy = v.texcoord0.xy - center; + #endif + + //---------------------------------------- + + //ROTATEUV_ON + #if ROTATEUV_ON + half2 uvC = v.texcoord0.xy; + half cosAngle = cos(_RotateUvAmount); + half sinAngle = sin(_RotateUvAmount); + half2x2 rot = half2x2(cosAngle, -sinAngle, sinAngle, cosAngle); + uvC -= center; + v.texcoord0.xy = mul(rot, uvC); + v.texcoord0.xy += center; + #endif + //-------------------- + + #if RECTSIZE_ON + v.vertex.xyz += (v.vertex.xyz * (_RectSize - 1.0)); + #endif + + #if OUTTEX_ON + v.texcoord1.xy = TRANSFORM_TEX(v.texcoord0.xy, _OutlineTex); + #endif + + #if OUTDIST_ON + v.texcoord2.xy = TRANSFORM_TEX(v.texcoord0.xy, _OutlineDistortTex); + #endif + + #if DISTORT_ON + v.texcoord3.xy = TRANSFORM_TEX(v.texcoord0.xy, _DistortTex); + #endif + } + + void Ext_SurfaceFunction0 (inout Surface o, ShaderData d) + { + half randomSeed = _RandomSeed; + + float2 uvRect = d.texcoord0; + half2 center = half2(0.5, 0.5); + #if ATLAS_ON + center = half2((_MaxXUV + _MinXUV) / 2.0, (_MaxYUV + _MinYUV) / 2.0); + uvRect = half2((d.texcoord0.x - _MinXUV) / (_MaxXUV - _MinXUV), (d.texcoord0.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half2 centerTiled = half2(center.x * _MainTex_ST.x, center.y * _MainTex_ST.y); + + //CLIPPING_ON + #if CLIPPING_ON + half2 tiledUv = half2(d.texcoord0.x / _MainTex_ST.x, d.texcoord0.y / _MainTex_ST.y); + #if ATLAS_ON + tiledUv = half2((tiledUv.x - _MinXUV) / (_MaxXUV - _MinXUV), (tiledUv.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + clip((1 - _ClipUvUp) - tiledUv.y); + clip(tiledUv.y - _ClipUvDown); + clip((1 - _ClipUvRight) - tiledUv.x); + clip(tiledUv.x - _ClipUvLeft); + #endif + //---------------------------------- + + //RADIALCLIPPING_ON + #if RADIALCLIPPING_ON + half2 tiledUv2 = half2(d.texcoord0.x / _MainTex_ST.x, d.texcoord0.y / _MainTex_ST.y); + #if ATLAS_ON + tiledUv2 = half2((tiledUv2.x - _MinXUV) / (_MaxXUV - _MinXUV), (tiledUv2.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half startAngle = _RadialStartAngle - _RadialClip; + half endAngle = _RadialStartAngle + _RadialClip2; + half offset0 = clamp(0, 360, startAngle + 360); + half offset360 = clamp(0, 360, endAngle - 360); + half2 atan2Coord = half2(lerp(-1, 1, tiledUv2.x), lerp(-1, 1, tiledUv2.y)); + half atanAngle = atan2(atan2Coord.y, atan2Coord.x) * 57.3; // angle in degrees + if(atanAngle < 0) atanAngle = 360 + atanAngle; + if(atanAngle >= startAngle && atanAngle <= endAngle) discard; + if(atanAngle <= offset360) discard; + if(atanAngle >= offset0) discard; + #endif + + //----------------------------- + + //TEXTURESCROLL_ON && ATLAS_ON + #if TEXTURESCROLL_ON && ATLAS_ON + d.texcoord0.xy = half2(_MinXUV + ((_MaxXUV - _MinXUV) * (abs(((_Time.y + randomSeed) * _TextureScrollXSpeed) + uvRect.x) % 1)), + _MinYUV + ((_MaxYUV - _MinYUV) * (abs(((_Time.y + randomSeed) * _TextureScrollYSpeed) + uvRect.y) % 1))); + #endif + //---------------------------- + + //OFFSETUV_ON + #if OFFSETUV_ON + #if ATLAS_ON + d.texcoord0.xy = half2(_MinXUV + ((_MaxXUV - _MinXUV) * (abs((_OffsetUvX + uvRect.x) % 1))), + _MinYUV + ((_MaxYUV - _MinYUV) * (abs(_OffsetUvY + uvRect.y) % 1))); + #else + d.texcoord0.xy += half2(_OffsetUvX, _OffsetUvY); + #endif + #endif + + //---------------------- + + //POLARUV_ON + #if POLARUV_ON + d.texcoord0.xy = half2(atan2(d.texcoord0.y, d.texcoord0.x) / (2.0f * 3.141592653589f), length(d.texcoord0.xy)); + d.texcoord0.xy *= _MainTex_ST.xy; + #endif + + //-------------------------------------- + + //TWISTUV_ON + #if TWISTUV_ON + #if ATLAS_ON + _TwistUvPosX = ((_MaxXUV - _MinXUV) * _TwistUvPosX) + _MinXUV; + _TwistUvPosY = ((_MaxYUV - _MinYUV) * _TwistUvPosY) + _MinYUV; + #endif + half2 tempUv = d.texcoord0.xy - half2(_TwistUvPosX * _MainTex_ST.x, _TwistUvPosY * _MainTex_ST.y); + _TwistUvRadius *= (_MainTex_ST.x + _MainTex_ST.y) / 2; + half percent = (_TwistUvRadius - length(tempUv)) / _TwistUvRadius; + half theta = percent * percent * (2.0 * sin(_TwistUvAmount)) * 8.0; + half s = sin(theta); + half c = cos(theta); + half beta = max(sign(_TwistUvRadius - length(tempUv)), 0.0); + tempUv = half2(dot(tempUv, half2(c, -s)), dot(tempUv, half2(s, c))) * beta + tempUv * (1 - beta); + tempUv += half2(_TwistUvPosX * _MainTex_ST.x, _TwistUvPosY * _MainTex_ST.y); + d.texcoord0.xy = tempUv; + #endif + + //-------------------------------------------- + + //FISHEYE_ON + #if FISHEYE_ON + half bind = length(centerTiled); + half2 dF = d.texcoord0.xy - centerTiled; + half dFlen = length(dF); + half fishInt = (3.14159265359 / bind) * (_FishEyeUvAmount + 0.001); + d.texcoord0.xy = centerTiled + (dF / (max(0.0001, dFlen))) * tan(dFlen * fishInt) * bind / tan(bind * fishInt); + #endif + //--------------------------------------------- + + //PINCH_ON + #if PINCH_ON + half2 dP = d.texcoord0.xy - centerTiled; + half pinchInt = (3.141592 / length(centerTiled)) * (-_PinchUvAmount + 0.001); + d.texcoord0.xy = centerTiled + normalize(dP) * atan(length(dP) * -pinchInt * 10.0) * 0.5 / atan(-pinchInt * 5); + #endif + + //--------------------------------------------- + + //ZOOMUV_ON + #if ZOOMUV_ON + d.texcoord0.xy -= centerTiled; + d.texcoord0.xy = d.texcoord0.xy * _ZoomUvAmount; + d.texcoord0.xy += centerTiled; + #endif + + //----------------------------------------------- + + //DOODLE_ON + #if DOODLE_ON + half2 uvCopy = uvRect; + _HandDrawnSpeed = (floor((_Time.x + randomSeed) * 20 * _HandDrawnSpeed) / _HandDrawnSpeed) * _HandDrawnSpeed; + uvCopy.x = sin((uvCopy.x * _HandDrawnAmount + _HandDrawnSpeed) * 4); + uvCopy.y = cos((uvCopy.y * _HandDrawnAmount + _HandDrawnSpeed) * 4); + d.texcoord0.xy = lerp(d.texcoord0.xy, d.texcoord0.xy + uvCopy, 0.0005 * _HandDrawnAmount); + #endif + + //-------------------------- + + //SHAKEUV_ON + #if SHAKEUV_ON + half xShake = sin((_Time.x + randomSeed) * _ShakeUvSpeed * 50) * _ShakeUvX; + half yShake = cos((_Time.x + randomSeed) * _ShakeUvSpeed * 50) * _ShakeUvY; + d.texcoord0.xy += half2(xShake * 0.012, yShake * 0.01); + #endif + + //------------------------------------------- + + //RECTSIZE_ON + #if RECTSIZE_ON + d.texcoord0.xy = d.texcoord0.xy * (_RectSize).xx + (((-_RectSize * 0.5) + 0.5)).xx; + #endif + + //------------------------------------------- + + //DISTORT_ON + #if DISTORT_ON + #if ATLAS_ON + d.texcoord3.x = d.texcoord3.x * (1 / (_MaxXUV - _MinXUV)); + d.texcoord3.y = d.texcoord3.y * (1 / (_MaxYUV - _MinYUV)); + #endif + + d.texcoord3.x += ((_Time.x + _RandomSeed) * _DistortTexXSpeed) % 1; + d.texcoord3.y += ((_Time.x + _RandomSeed) * _DistortTexYSpeed) % 1; + half distortAmnt = (SAMPLE_TEXTURE2D(_DistortTex, sampler_DistortTex, d.texcoord3.xy).r - 0.5) * 0.2 * _DistortAmount; + d.texcoord0.x += distortAmnt; + d.texcoord0.y += distortAmnt; + #endif + //------------------------------------------------------- + + //WARP_ON + #if WARP_ON + half2 warpUv = half2(d.texcoord0.x / _MainTex_ST.x, d.texcoord0.y / _MainTex_ST.y); + #if ATLAS_ON + warpUv = half2((warpUv.x - _MinXUV) / (_MaxXUV - _MinXUV), (warpUv.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + const float tau = 6.283185307179586; + float xWarp = (_Time.y + randomSeed) * _WarpSpeed + warpUv.x * tau / _WarpScale; + float yWarp = (_Time.y + randomSeed) * _WarpSpeed + warpUv.y * tau / _WarpScale; + float2 warp = float2(sin(xWarp), sin(yWarp)) * _WarpStrength; + d.texcoord0.xy += warp; + #endif + + //------------------------------------------------------- + + //WAVEUV_ON + #if WAVEUV_ON + float2 uvWave = half2(_WaveX * _MainTex_ST.x, _WaveY * _MainTex_ST.y) - d.texcoord0.xy; + uvWave %= 1; + #if ATLAS_ON + uvWave = half2(_WaveX, _WaveY) - uvRect; + #endif + uvWave.x *= _ScreenParams.x / _ScreenParams.y; + float waveTime = _Time.y + randomSeed; + float angWave = (sqrt(dot(uvWave, uvWave)) * _WaveAmount) - ((waveTime * _WaveSpeed)); + d.texcoord0.xy = d.texcoord0.xy + uvWave * sin(angWave) * (_WaveStrength / 1000.0); + #endif + //---------------------------------------------------- + + //ROUNDWAVEUV_ON + #if ROUNDWAVEUV_ON + half xWave = ((0.5 * _MainTex_ST.x) - uvRect.x); + half yWave = ((0.5 * _MainTex_ST.y) - uvRect.y) * (_MainTex_TexelSize.w / _MainTex_TexelSize.z); + half ripple = -sqrt(xWave*xWave + yWave* yWave); + d.texcoord0.xy += (sin((ripple + (_Time.y + randomSeed) * (_RoundWaveSpeed/10.0)) / 0.015) * (_RoundWaveStrength/10.0)) % 1; + #endif + //---------------------------------------------------- + + + //WIND_ON + #if WIND_ON + half windOffset = sin((_Time.x + randomSeed) * _GrassSpeed * 10); + half2 windCenter = half2(0.5, 0.1); + #if ATLAS_ON + windCenter.x = ((_MaxXUV - _MinXUV) * windCenter.x) + _MinXUV; + windCenter.y = ((_MaxYUV - _MinYUV) * windCenter.y) + _MinYUV; + #endif + #if !MANUALWIND_ON + d.texcoord0.x = fmod(abs(lerp(d.texcoord0.x, d.texcoord0.x + (_GrassWind * 0.01 * windOffset), uvRect.y)), 1); + #else + d.texcoord0.x = fmod(abs(lerp(d.texcoord0.x, d.texcoord0.x + (_GrassWind * 0.01 * _GrassManualAnim), uvRect.y)), 1); + windOffset = _GrassManualAnim; + #endif + half2 delta = d.texcoord0.xy - windCenter; + half delta2 = dot(delta.xy, delta.xy); + half2 delta_offset = delta2 * windOffset; + d.texcoord0.xy = d.texcoord0.xy + half2(delta.y, -delta.x) * delta_offset * _GrassRadialBend; + #endif + + //-------------------------------------------------------- + + //TEXTURESCROLL_ON && !ATLAS_ON + #if TEXTURESCROLL_ON && !ATLAS_ON + d.texcoord0.x += ((_Time.y + randomSeed) * _TextureScrollXSpeed) % 1; + d.texcoord0.y += ((_Time.y + randomSeed) * _TextureScrollYSpeed) % 1; + #endif + //------------------------------ + + //PIXELATE_ON + #if PIXELATE_ON + half aspectRatio = _MainTex_TexelSize.x / _MainTex_TexelSize.y; + half2 pixelSize = float2(_PixelateSize, _PixelateSize * aspectRatio); + d.texcoord0.xy = floor(d.texcoord0.xy * pixelSize) / pixelSize; + #endif + //-------------- + + half4 col = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy); + half originalAlpha = col.a; + col *= d.vertexColor; + + //NORMAL MAP + #if NORMALMAP_ON + half4 normalSample = SAMPLE_TEXTURE2D(_NormalMap, sampler_NormalMap, d.texcoord0.xy); + half3 normalTS = UnpackNormal(normalSample); + normalTS.xy *= _NormalStrength; + o.Normal = normalTS; + #endif + + + //GLITCH_ON + #if GLITCH_ON + half2 uvGlitch = uvRect; + uvGlitch.y -= 0.5; + half lineNoise = pow(rand2(floor(uvGlitch * half2(24., 19.) * _GlitchSize) * 4.0, randomSeed), 3.0) * _GlitchAmount + * pow(rand2(floor(uvGlitch * half2(38., 14.) * _GlitchSize) * 4.0, randomSeed), 3.0); + col = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(lineNoise * 0.02 * rand2(half2(2.0, 1), randomSeed), 0)) * d.vertexColor; + #endif + //-------------------------------------- + + //CHROMABERR_ON + #if CHROMABERR_ON + half4 r = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(_ChromAberrAmount/10, 0)) * d.vertexColor; + half4 b = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(-_ChromAberrAmount/10, 0)) * d.vertexColor; + col = half4(r.r * r.a, col.g, b.b * b.a, max(max(r.a, b.a) * _ChromAberrAlpha, col.a)); + #endif + + //-------------------------------- + + //BLUR_ON + #if BLUR_ON + #if ATLAS_ON + #if !BLURISHD_ON + col = BlurHD(d.texcoord0.xy, _MainTex, sampler_MainTex, _BlurIntensity, (_MaxXUV - _MinXUV), (_MaxYUV - _MinYUV)) * d.vertexColor; + #else + col = Blur(d.texcoord0.xy, _MainTex, sampler_MainTex, _BlurIntensity * (_MaxXUV - _MinXUV)) * d.vertexColor; + #endif + #else + #if !BLURISHD_ON + col = BlurHD(d.texcoord0.xy, _MainTex, sampler_MainTex, _BlurIntensity, 1, 1) * d.vertexColor; + #else + col = Blur(d.texcoord0.xy, _MainTex, sampler_MainTex, _BlurIntensity) * d.vertexColor; + #endif + #endif + #endif + + //-------------------- + + //MOTIONBLUR_ON + #if MOTIONBLUR_ON + _MotionBlurAngle = _MotionBlurAngle * 3.1415926; + #define rot(n) mul(n, half2x2(cos(_MotionBlurAngle), -sin(_MotionBlurAngle), sin(_MotionBlurAngle), cos(_MotionBlurAngle))) + _MotionBlurDist = _MotionBlurDist * 0.005; + #if ATLAS_ON + _MotionBlurDist *= (_MaxXUV - _MinXUV); + #endif + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(-_MotionBlurDist, -_MotionBlurDist))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(-_MotionBlurDist * 2, -_MotionBlurDist * 2))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(-_MotionBlurDist * 3, -_MotionBlurDist * 3))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(-_MotionBlurDist * 4, -_MotionBlurDist * 4))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(_MotionBlurDist, _MotionBlurDist))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(_MotionBlurDist * 2, _MotionBlurDist * 2))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(_MotionBlurDist * 3, _MotionBlurDist * 3))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(_MotionBlurDist * 4, _MotionBlurDist * 4))); + col.rgb = col.rgb / 9; + #endif + //------------------------------------ + + //NEGATIVE_ON + #if NEGATIVE_ON + col.rgb = lerp(col.rgb, 1 - col.rgb, _NegativeAmount); + #endif + + //-------------- + half luminance = 0; + + //GREYSCALE_ON && !GREYSCALEOUTLINE_ON + #if GREYSCALE_ON && !GREYSCALEOUTLINE_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + luminance = saturate(luminance + _GreyscaleLuminosity); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _GreyscaleTintColor, _GreyscaleBlend); + #endif + //------------------------------------ + + //GHOST_ON + #if GHOST_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + half4 ghostResult; + ghostResult.a = saturate(luminance - _GhostTransparency) * col.a; + ghostResult.rgb = col.rgb * (luminance + _GhostColorBoost); + col = lerp(col, ghostResult, _GhostBlend); + #endif + //------------------------------------ + + //INNEROUTLINE_ON + #if INNEROUTLINE_ON + half3 innerT = abs(GetPixel(0, _InnerOutlineThickness, d.texcoord0.xy, _MainTex, sampler_MainTex) - GetPixel(0, -_InnerOutlineThickness, d.texcoord0.xy, _MainTex, sampler_MainTex)); + innerT += abs(GetPixel(_InnerOutlineThickness, 0, d.texcoord0.xy, _MainTex, sampler_MainTex) - GetPixel(-_InnerOutlineThickness, 0, d.texcoord0.xy, _MainTex, sampler_MainTex)); + #if !ONLYINNEROUTLINE_ON + innerT = (innerT / 2.0) * col.a * _InnerOutlineAlpha; + col.rgb += length(innerT) * _InnerOutlineColor.rgb * _InnerOutlineGlow; + #else + innerT *= col.a * _InnerOutlineAlpha; + col.rgb = length(innerT) * _InnerOutlineColor.rgb * _InnerOutlineGlow; + col.a = step(0.3, col.r+col.g+col.b); + #endif + #endif + //------------------------------------------------------- + + //HITEFFECT_ON + #if HITEFFECT_ON + col.rgb = lerp(col.rgb, _HitEffectColor.rgb * _HitEffectGlow, _HitEffectBlend); + #endif + //-------------------- + + //GRADIENT_ON + #if GRADIENT_ON + half2 tiledUvGrad = half2(uvRect.x / _MainTex_ST.x, uvRect.y / _MainTex_ST.y); + #if GRADIENT2COL_ON + _GradTopRightCol = _GradTopLeftCol; + _GradBotRightCol = _GradBotLeftCol; + #endif + #if RADIALGRADIENT_ON + half radialDist = 1 - length(tiledUvGrad - half2(0.5, 0.5)); + radialDist *= (_MainTex_TexelSize.w / _MainTex_TexelSize.z); + radialDist = saturate(_GradBoostX * radialDist); + half4 gradientResult = lerp(_GradTopLeftCol, _GradBotLeftCol, radialDist); + #else + half gradXLerpFactor = saturate(pow(tiledUvGrad.x, _GradBoostX)); + half4 gradientResult = lerp(lerp(_GradBotLeftCol, _GradBotRightCol, gradXLerpFactor), + lerp(_GradTopLeftCol, _GradTopRightCol, gradXLerpFactor), saturate(pow(tiledUvGrad.y, _GradBoostY))); + #endif + gradientResult = lerp(col, gradientResult, _GradBlend); + col.rgb = gradientResult.rgb * col.a; + col.a *= gradientResult.a; + #endif + //-------------------------------------------------------------------- + + //CONTRAST_ON + #if CONTRAST_ON + col.rgb = (col.rgb - float3(0.5, 0.5, 0.5)) * _Contrast + float3(0.5, 0.5, 0.5); + col.rgb += _Brightness; + #endif + + //------------------------------------------------------------------- + + //COLORSWAP_ON + #if COLORSWAP_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + half4 swapMask = SAMPLE_TEXTURE2D(_ColorSwapTex, sampler_ColorSwapTex, d.texcoord0.xy); + swapMask.rgb *= swapMask.a; + half3 redSwap = _ColorSwapRed * swapMask.r * saturate(luminance + _ColorSwapRedLuminosity); + half3 greenSwap = _ColorSwapGreen * swapMask.g * saturate(luminance + _ColorSwapGreenLuminosity); + half3 blueSwap = _ColorSwapBlue * swapMask.b * saturate(luminance + _ColorSwapBlueLuminosity); + swapMask.rgb = col.rgb * saturate(1 - swapMask.r - swapMask.g - swapMask.b); + col.rgb = lerp(col.rgb, swapMask.rgb + redSwap + greenSwap + blueSwap, _ColorSwapBlend); + #endif + //-------------------------------------------------------------------- + + //COLORRAMP_ON && !COLORRAMPOUTLINE_ON + #if COLORRAMP_ON && !COLORRAMPOUTLINE_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + luminance = saturate(luminance + _ColorRampLuminosity); + #if GRADIENTCOLORRAMP_ON + col.rgb = lerp(col.rgb, SAMPLE_TEXTURE2D(_ColorRampTexGradient, sampler_ColorRampTexGradient, half2(luminance, 0)).rgb, _ColorRampBlend); + #else + col.rgb = lerp(col.rgb, SAMPLE_TEXTURE2D(_ColorRampTex, sampler_ColorRampTex, half2(luminance, 0)).rgb, _ColorRampBlend); + #endif + #endif + //-------------------------------------------------------------------- + + //CHANGECOLOR_ON + #if CHANGECOLOR_ON + float3 currChangeColor = saturate(col.rgb); + luminance = 0.3 * currChangeColor.r + 0.59 * currChangeColor.g + 0.11 * currChangeColor.b; + luminance = saturate(luminance + _ColorChangeLuminosity); + half3 dif = abs(currChangeColor - _ColorChangeTarget.rgb); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _ColorChangeNewCol.rgb, + max(sign(1 - saturate(dif.x + dif.y + dif.z) - _ColorChangeTolerance), 0.0)); + #if CHANGECOLOR2_ON + dif = abs(currChangeColor - _ColorChangeTarget2.rgb); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _ColorChangeNewCol2.rgb, + max(sign(1 - saturate(dif.x + dif.y + dif.z) - _ColorChangeTolerance2), 0.0)); + #endif + #if CHANGECOLOR3_ON + dif = abs(currChangeColor - _ColorChangeTarget3.rgb); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _ColorChangeNewCol3.rgb, + max(sign(1 - saturate(dif.x + dif.y + dif.z) - _ColorChangeTolerance3), 0.0)); + #endif + #endif + //------------------------------------------------------- + + //POSTERIZE_ON && !POSTERIZEOUTLINE_ON + #if POSTERIZE_ON && !POSTERIZEOUTLINE_ON + col.rgb = pow(col.rgb, _PosterizeGamma) * _PosterizeNumColors; + col.rgb = floor(col.rgb) / _PosterizeNumColors; + col.rgb = pow(col.rgb, 1.0 / _PosterizeGamma); + #endif + //------------------------------------ + + //HSV_ON + #if HSV_ON + half3 resultHsv = half3(col.rgb); + half cosHsv = _HsvBright * _HsvSaturation * cos(_HsvShift * 3.14159265 / 180); + half sinHsv = _HsvBright * _HsvSaturation * sin(_HsvShift * 3.14159265 / 180); + resultHsv.x = (.299 * _HsvBright + .701 * cosHsv + .168 * sinHsv) * col.x + + (.587 * _HsvBright - .587 * cosHsv + .330 * sinHsv) * col.y + + (.114 * _HsvBright - .114 * cosHsv - .497 * sinHsv) * col.z; + resultHsv.y = (.299 * _HsvBright - .299 * cosHsv - .328 * sinHsv) *col.x + + (.587 * _HsvBright + .413 * cosHsv + .035 * sinHsv) * col.y + + (.114 * _HsvBright - .114 * cosHsv + .292 * sinHsv) * col.z; + resultHsv.z = (.299 * _HsvBright - .3 * cosHsv + 1.25 * sinHsv) * col.x + + (.587 * _HsvBright - .588 * cosHsv - 1.05 * sinHsv) * col.y + + (.114 * _HsvBright + .886 * cosHsv - .203 * sinHsv) * col.z; + col.rgb = resultHsv; + #endif + //------------------------------------------------------- + + //OVERLAY_ON + #if OVERLAY_ON + half2 overlayUvs = d.texcoord0.xy; + overlayUvs.x += ((_Time.y + randomSeed) * _OverlayTextureScrollXSpeed) % 1; + overlayUvs.y += ((_Time.y + randomSeed) * _OverlayTextureScrollYSpeed) % 1; + half4 overlayCol = SAMPLE_TEXTURE2D(_OverlayTex, sampler_OverlayTex, TRANSFORM_TEX(overlayUvs, _OverlayTex)); + overlayCol.rgb *= _OverlayColor.rgb * _OverlayGlow; + #if !OVERLAYMULT_ON + overlayCol.rgb *= overlayCol.a * _OverlayColor.rgb * _OverlayColor.a * _OverlayBlend; + col.rgb += overlayCol.rgb; + #else + overlayCol.a *= _OverlayColor.a; + col = lerp(col, col * overlayCol, _OverlayBlend); + #endif + #endif + + //--------------------------------- + + //OUTBASE_ON + #if OUTBASE_ON + #if OUTBASEPIXELPERF_ON + half2 destUv = half2(_OutlinePixelWidth * _MainTex_TexelSize.x, _OutlinePixelWidth * _MainTex_TexelSize.y); + #else + half2 destUv = half2(_OutlineWidth * _MainTex_TexelSize.x * 200, _OutlineWidth * _MainTex_TexelSize.y * 200); + #endif + + #if OUTDIST_ON + d.texcoord3.x += ((_Time.x + _RandomSeed) * _OutlineDistortTexXSpeed) % 1; + d.texcoord3.y += ((_Time.x + _RandomSeed) * _OutlineDistortTexYSpeed) % 1; + #if ATLAS_ON + d.texcoord3 = half2((d.texcoord3.x - _MinXUV) / (_MaxXUV - _MinXUV), (d.texcoord3.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half outDistortAmnt = (SAMPLE_TEXTURE2D(_OutlineDistortTex, sampler_OutlineDistortTex, d.texcoord3).r - 0.5) * 0.2 * _OutlineDistortAmount; + destUv.x += outDistortAmnt; + destUv.y += outDistortAmnt; + #endif + + half spriteLeft = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(destUv.x, 0)).a; + half spriteRight = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy - half2(destUv.x, 0)).a; + half spriteBottom = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(0, destUv.y)).a; + half spriteTop = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy - half2(0, destUv.y)).a; + half result = spriteLeft + spriteRight + spriteBottom + spriteTop; + + #if OUTBASE8DIR_ON + half spriteTopLeft = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(destUv.x, destUv.y)).a; + half spriteTopRight = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(-destUv.x, destUv.y)).a; + half spriteBotLeft = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(destUv.x, -destUv.y)).a; + half spriteBotRight = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(-destUv.x, -destUv.y)).a; + result = result + spriteTopLeft + spriteTopRight + spriteBotLeft + spriteBotRight; + #endif + + result = step(0.05, saturate(result)); + + #if OUTTEX_ON + d.texcoord1.x += ((_Time.x + _RandomSeed) * _OutlineTexXSpeed) % 1; + d.texcoord1.y += ((_Time.x + _RandomSeed) * _OutlineTexYSpeed) % 1; + #if ATLAS_ON + d.texcoord1 = half2((d.texcoord1.x - _MinXUV) / (_MaxXUV - _MinXUV), (d.texcoord1.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half4 tempOutColor = SAMPLE_TEXTURE2D(_OutlineTex, sampler_OutlineTex, d.texcoord1); + tempOutColor *= _OutlineColor; + _OutlineColor = tempOutColor; + #endif + + result *= (1 - originalAlpha) * _OutlineAlpha; + + half4 outline = _OutlineColor * d.vertexColor.a; + outline.rgb *= _OutlineGlow; + outline.a = result; + #if ONLYOUTLINE_ON + col = outline; + #else + col = lerp(col, outline, result); + #endif + #endif + //------------------------------------------------------- + + //FADE_ON + #if FADE_ON + half2 tiledUvFade1 = TRANSFORM_TEX(d.texcoord0, _FadeTex); + half2 tiledUvFade2 = TRANSFORM_TEX(d.texcoord0, _FadeBurnTex); + #if ATLAS_ON + tiledUvFade1 = half2((tiledUvFade1.x - _MinXUV) / (_MaxXUV - _MinXUV), (tiledUvFade1.y - _MinYUV) / (_MaxYUV - _MinYUV)); + tiledUvFade2 = half2((tiledUvFade2.x - _MinXUV) / (_MaxXUV - _MinXUV), (tiledUvFade2.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half fadeTemp = SAMPLE_TEXTURE2D(_FadeTex, sampler_FadeTex, tiledUvFade1).r; + half fade = smoothstep(_FadeAmount, _FadeAmount + _FadeBurnTransition, fadeTemp); + half fadeBurn = saturate(smoothstep(_FadeAmount - _FadeBurnWidth, _FadeAmount - _FadeBurnWidth + 0.1, fadeTemp) * _FadeAmount); + col.a *= fade; + _FadeBurnColor.rgb *= _FadeBurnGlow; + col += fadeBurn * SAMPLE_TEXTURE2D(_FadeBurnTex, sampler_FadeBurnTex, tiledUvFade2) * _FadeBurnColor * originalAlpha * (1 - col.a); + #endif + //------------------------------------------------------- + + //SHADOW_ON + #if SHADOW_ON + half shadowA = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(_ShadowX, _ShadowY)).a; + half preMultShadowMask = 1 - (saturate(shadowA - col.a) * (1 - col.a)); + col.rgb *= 1 - ((shadowA - col.a) * (1 - col.a)); + col.rgb += (_ShadowColor * shadowA) * (1 - col.a); + col.a = max(shadowA * _ShadowAlpha * d.vertexColor.a, col.a); + #endif + + //------------------------------------------------------- + + //GLOW_ON + #if GLOW_ON + half4 emission; + #if GLOWTEX_ON + emission = SAMPLE_TEXTURE2D(_GlowTex, sampler_GlowTex, d.texcoord0); + #else + emission = col; + #endif + + col.rgb *= _GlowGlobal; + emission.rgb *= emission.a * col.a * _Glow * _GlowColor; + col.rgb += emission.rgb; + #endif + //------------------------------------------------------- + + //COLORRAMP_ON && COLORRAMPOUTLINE_ON + #if COLORRAMP_ON && COLORRAMPOUTLINE_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + luminance = saturate(luminance + _ColorRampLuminosity); + #if GRADIENTCOLORRAMP_ON + col.rgb = lerp(col.rgb, SAMPLE_TEXTURE2D(_ColorRampTexGradient, sampler_ColorRampTexGradient, half2(luminance, 0)).rgb, _ColorRampBlend); + #else + col.rgb = lerp(col.rgb, SAMPLE_TEXTURE2D(_ColorRampTex, sampler_ColorRampTex, half2(luminance, 0)).rgb, _ColorRampBlend); + #endif + #endif + //--------------- + + //GREYSCALE_ON && GREYSCALEOUTLINE_ON + #if GREYSCALE_ON && GREYSCALEOUTLINE_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + luminance = saturate(luminance + _GreyscaleLuminosity); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _GreyscaleTintColor, _GreyscaleBlend); + #endif + + //----------------------------------- + + //POSTERIZE_ON && POSTERIZEOUTLINE_ON + #if POSTERIZE_ON && POSTERIZEOUTLINE_ON + col.rgb = pow(col.rgb, _PosterizeGamma) * _PosterizeNumColors; + col.rgb = floor(col.rgb) / _PosterizeNumColors; + col.rgb = pow(col.rgb, 1.0 / _PosterizeGamma); + #endif + + //----------------------------------- + + //SHINE_ON + #if SHINE_ON + half2 uvShine = uvRect; + half cosAngle = cos(_ShineRotate); + half sinAngle = sin(_ShineRotate); + half2x2 rot = half2x2(cosAngle, -sinAngle, sinAngle, cosAngle); + uvShine -= half2(0.5, 0.5); + uvShine = mul(rot, uvShine); + uvShine += half2(0.5, 0.5); + half shineMask = SAMPLE_TEXTURE2D(_ShineMask, sampler_ShineMask, d.texcoord0.xy).a; + half currentDistanceProjection = (uvShine.x + uvShine.y) / 2; + half whitePower = 1 - (abs(currentDistanceProjection - _ShineLocation) / _ShineWidth); + col.rgb += col.a * whitePower * _ShineGlow * max(sign(currentDistanceProjection - (_ShineLocation - _ShineWidth)), 0.0) + * max(sign((_ShineLocation + _ShineWidth) - currentDistanceProjection), 0.0) * _ShineColor * shineMask; + #endif + + //----------------------------------- + + //HOLOGRAM_ON + #if HOLOGRAM_ON + half totalHologram = _HologramStripesAmount + _HologramUnmodAmount; + half hologramYCoord = ((uvRect.y + (((_Time.x + randomSeed) % 1) * _HologramStripesSpeed)) % totalHologram) / totalHologram; + hologramYCoord = abs(hologramYCoord); + half alpha = RemapFloat(saturate(hologramYCoord - (_HologramUnmodAmount/totalHologram)), 0.0, 1.0, _HologramMinAlpha, saturate(_HologramMaxAlpha)); + half hologramMask = max(sign((_HologramUnmodAmount/totalHologram) - hologramYCoord), 0.0); + half4 hologramResult = col; + hologramResult.a *= lerp(alpha, 1, hologramMask); + hologramResult.rgb *= max(1, _HologramMaxAlpha * max(sign(hologramYCoord - (_HologramUnmodAmount/totalHologram)), 0.0)); + hologramMask = 1 - step(0.01,hologramMask); + hologramResult.rgb += hologramMask * _HologramStripeColor * col.a; + col = lerp(col, hologramResult, _HologramBlend); + #endif + + //----------------------------------- + + //FLICKER_ON + #if FLICKER_ON + col.a *= saturate(col.a * step(frac(0.05 + (_Time.w + randomSeed) * _FlickerFreq), 1 - _FlickerPercent) + _FlickerAlpha); + #endif + //----------------------------------- + + //ALPHACUTOFF_ON + + //ALPHAROUND_ON + + //ALPHAOUTLINE_ON + #if ALPHAOUTLINE_ON + half alphaOutlineRes = pow(1 - col.a, max(_AlphaOutlinePower, 0.0001)) * step(_AlphaOutlineMinAlpha, col.a) * _AlphaOutlineBlend; + col.rgb = lerp(col.rgb, _AlphaOutlineColor.rgb * _AlphaOutlineGlow, alphaOutlineRes); + col.a = lerp(col.a, 1, alphaOutlineRes > 1); + #endif + //------------------------------------------------------- + + //FOG_ON + + //------------------ + + col *= _Color; + o.Albedo = col; + col.a *= _Alpha; + clip(col.a - _AlphaCutoffValue - 0.01); + o.Alpha = _Color.a; + } + + + + + + void ChainSurfaceFunction(inout Surface l, inout ShaderData d) + { + Ext_SurfaceFunction0(l, d); + // Ext_SurfaceFunction1(l, d); + // Ext_SurfaceFunction2(l, d); + // Ext_SurfaceFunction3(l, d); + // Ext_SurfaceFunction4(l, d); + // Ext_SurfaceFunction5(l, d); + // Ext_SurfaceFunction6(l, d); + // Ext_SurfaceFunction7(l, d); + // Ext_SurfaceFunction8(l, d); + // Ext_SurfaceFunction9(l, d); + // Ext_SurfaceFunction10(l, d); + // Ext_SurfaceFunction11(l, d); + // Ext_SurfaceFunction12(l, d); + // Ext_SurfaceFunction13(l, d); + // Ext_SurfaceFunction14(l, d); + // Ext_SurfaceFunction15(l, d); + // Ext_SurfaceFunction16(l, d); + // Ext_SurfaceFunction17(l, d); + // Ext_SurfaceFunction18(l, d); + // Ext_SurfaceFunction19(l, d); + // Ext_SurfaceFunction20(l, d); + // Ext_SurfaceFunction21(l, d); + // Ext_SurfaceFunction22(l, d); + // Ext_SurfaceFunction23(l, d); + // Ext_SurfaceFunction24(l, d); + // Ext_SurfaceFunction25(l, d); + // Ext_SurfaceFunction26(l, d); + // Ext_SurfaceFunction27(l, d); + // Ext_SurfaceFunction28(l, d); + // Ext_SurfaceFunction29(l, d); + } + +#if !_DECALSHADER + + void ChainModifyVertex(inout VertexData v, inout VertexToPixel v2p, float4 time) + { + ExtraV2F d; + + ZERO_INITIALIZE(ExtraV2F, d); + ZERO_INITIALIZE(Blackboard, d.blackboard); + // due to motion vectors in HDRP, we need to use the last + // time in certain spots. So if you are going to use _Time to adjust vertices, + // you need to use this time or motion vectors will break. + d.time = time; + + Ext_ModifyVertex0(v, d); + // Ext_ModifyVertex1(v, d); + // Ext_ModifyVertex2(v, d); + // Ext_ModifyVertex3(v, d); + // Ext_ModifyVertex4(v, d); + // Ext_ModifyVertex5(v, d); + // Ext_ModifyVertex6(v, d); + // Ext_ModifyVertex7(v, d); + // Ext_ModifyVertex8(v, d); + // Ext_ModifyVertex9(v, d); + // Ext_ModifyVertex10(v, d); + // Ext_ModifyVertex11(v, d); + // Ext_ModifyVertex12(v, d); + // Ext_ModifyVertex13(v, d); + // Ext_ModifyVertex14(v, d); + // Ext_ModifyVertex15(v, d); + // Ext_ModifyVertex16(v, d); + // Ext_ModifyVertex17(v, d); + // Ext_ModifyVertex18(v, d); + // Ext_ModifyVertex19(v, d); + // Ext_ModifyVertex20(v, d); + // Ext_ModifyVertex21(v, d); + // Ext_ModifyVertex22(v, d); + // Ext_ModifyVertex23(v, d); + // Ext_ModifyVertex24(v, d); + // Ext_ModifyVertex25(v, d); + // Ext_ModifyVertex26(v, d); + // Ext_ModifyVertex27(v, d); + // Ext_ModifyVertex28(v, d); + // Ext_ModifyVertex29(v, d); + + + // #if %EXTRAV2F0REQUIREKEY% + // v2p.extraV2F0 = d.extraV2F0; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // v2p.extraV2F1 = d.extraV2F1; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // v2p.extraV2F2 = d.extraV2F2; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // v2p.extraV2F3 = d.extraV2F3; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // v2p.extraV2F4 = d.extraV2F4; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // v2p.extraV2F5 = d.extraV2F5; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // v2p.extraV2F6 = d.extraV2F6; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // v2p.extraV2F7 = d.extraV2F7; + // #endif + } + + void ChainModifyTessellatedVertex(inout VertexData v, inout VertexToPixel v2p) + { + ExtraV2F d; + ZERO_INITIALIZE(ExtraV2F, d); + ZERO_INITIALIZE(Blackboard, d.blackboard); + + // #if %EXTRAV2F0REQUIREKEY% + // d.extraV2F0 = v2p.extraV2F0; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // d.extraV2F1 = v2p.extraV2F1; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // d.extraV2F2 = v2p.extraV2F2; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // d.extraV2F3 = v2p.extraV2F3; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // d.extraV2F4 = v2p.extraV2F4; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // d.extraV2F5 = v2p.extraV2F5; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // d.extraV2F6 = v2p.extraV2F6; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // d.extraV2F7 = v2p.extraV2F7; + // #endif + + + // Ext_ModifyTessellatedVertex0(v, d); + // Ext_ModifyTessellatedVertex1(v, d); + // Ext_ModifyTessellatedVertex2(v, d); + // Ext_ModifyTessellatedVertex3(v, d); + // Ext_ModifyTessellatedVertex4(v, d); + // Ext_ModifyTessellatedVertex5(v, d); + // Ext_ModifyTessellatedVertex6(v, d); + // Ext_ModifyTessellatedVertex7(v, d); + // Ext_ModifyTessellatedVertex8(v, d); + // Ext_ModifyTessellatedVertex9(v, d); + // Ext_ModifyTessellatedVertex10(v, d); + // Ext_ModifyTessellatedVertex11(v, d); + // Ext_ModifyTessellatedVertex12(v, d); + // Ext_ModifyTessellatedVertex13(v, d); + // Ext_ModifyTessellatedVertex14(v, d); + // Ext_ModifyTessellatedVertex15(v, d); + // Ext_ModifyTessellatedVertex16(v, d); + // Ext_ModifyTessellatedVertex17(v, d); + // Ext_ModifyTessellatedVertex18(v, d); + // Ext_ModifyTessellatedVertex19(v, d); + // Ext_ModifyTessellatedVertex20(v, d); + // Ext_ModifyTessellatedVertex21(v, d); + // Ext_ModifyTessellatedVertex22(v, d); + // Ext_ModifyTessellatedVertex23(v, d); + // Ext_ModifyTessellatedVertex24(v, d); + // Ext_ModifyTessellatedVertex25(v, d); + // Ext_ModifyTessellatedVertex26(v, d); + // Ext_ModifyTessellatedVertex27(v, d); + // Ext_ModifyTessellatedVertex28(v, d); + // Ext_ModifyTessellatedVertex29(v, d); + + // #if %EXTRAV2F0REQUIREKEY% + // v2p.extraV2F0 = d.extraV2F0; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // v2p.extraV2F1 = d.extraV2F1; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // v2p.extraV2F2 = d.extraV2F2; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // v2p.extraV2F3 = d.extraV2F3; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // v2p.extraV2F4 = d.extraV2F4; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // v2p.extraV2F5 = d.extraV2F5; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // v2p.extraV2F6 = d.extraV2F6; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // v2p.extraV2F7 = d.extraV2F7; + // #endif + } + + void ChainFinalColorForward(inout Surface l, inout ShaderData d, inout half4 color) + { + // Ext_FinalColorForward0(l, d, color); + // Ext_FinalColorForward1(l, d, color); + // Ext_FinalColorForward2(l, d, color); + // Ext_FinalColorForward3(l, d, color); + // Ext_FinalColorForward4(l, d, color); + // Ext_FinalColorForward5(l, d, color); + // Ext_FinalColorForward6(l, d, color); + // Ext_FinalColorForward7(l, d, color); + // Ext_FinalColorForward8(l, d, color); + // Ext_FinalColorForward9(l, d, color); + // Ext_FinalColorForward10(l, d, color); + // Ext_FinalColorForward11(l, d, color); + // Ext_FinalColorForward12(l, d, color); + // Ext_FinalColorForward13(l, d, color); + // Ext_FinalColorForward14(l, d, color); + // Ext_FinalColorForward15(l, d, color); + // Ext_FinalColorForward16(l, d, color); + // Ext_FinalColorForward17(l, d, color); + // Ext_FinalColorForward18(l, d, color); + // Ext_FinalColorForward19(l, d, color); + // Ext_FinalColorForward20(l, d, color); + // Ext_FinalColorForward21(l, d, color); + // Ext_FinalColorForward22(l, d, color); + // Ext_FinalColorForward23(l, d, color); + // Ext_FinalColorForward24(l, d, color); + // Ext_FinalColorForward25(l, d, color); + // Ext_FinalColorForward26(l, d, color); + // Ext_FinalColorForward27(l, d, color); + // Ext_FinalColorForward28(l, d, color); + // Ext_FinalColorForward29(l, d, color); + } + + void ChainFinalGBufferStandard(inout Surface s, inout ShaderData d, inout half4 GBuffer0, inout half4 GBuffer1, inout half4 GBuffer2, inout half4 outEmission, inout half4 outShadowMask) + { + // Ext_FinalGBufferStandard0(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard1(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard2(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard3(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard4(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard5(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard6(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard7(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard8(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard9(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard10(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard11(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard12(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard13(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard14(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard15(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard16(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard17(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard18(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard19(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard20(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard21(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard22(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard23(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard24(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard25(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard26(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard27(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard28(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard29(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + } +#endif + + + + + +#if _DECALSHADER + + ShaderData CreateShaderData(SurfaceDescriptionInputs IN) + { + ShaderData d = (ShaderData)0; + d.TBNMatrix = float3x3(IN.WorldSpaceTangent, IN.WorldSpaceBiTangent, IN.WorldSpaceNormal); + d.worldSpaceNormal = IN.WorldSpaceNormal; + d.worldSpaceTangent = IN.WorldSpaceTangent; + + d.worldSpacePosition = IN.WorldSpacePosition; + d.texcoord0 = IN.uv0.xyxy; + d.screenPos = IN.ScreenPosition; + + d.worldSpaceViewDir = normalize(_WorldSpaceCameraPos - d.worldSpacePosition); + + d.tangentSpaceViewDir = mul(d.TBNMatrix, d.worldSpaceViewDir); + + // these rarely get used, so we back transform them. Usually will be stripped. + #if _HDRP + // d.localSpacePosition = mul(GetWorldToObjectMatrix(), float4(GetCameraRelativePositionWS(d.worldSpacePosition), 1)).xyz; + #else + // d.localSpacePosition = mul(GetWorldToObjectMatrix(), float4(d.worldSpacePosition, 1)).xyz; + #endif + // d.localSpaceNormal = normalize(mul((float3x3)GetWorldToObjectMatrix(), d.worldSpaceNormal)); + // d.localSpaceTangent = normalize(mul((float3x3)GetWorldToObjectMatrix(), d.worldSpaceTangent.xyz)); + + // #if %SCREENPOSREQUIREKEY% + // d.screenUV = (IN.ScreenPosition.xy / max(0.01, IN.ScreenPosition.w)); + // #endif + + return d; + } +#else + + ShaderData CreateShaderData(VertexToPixel i + #if NEED_FACING + , bool facing + #endif + ) + { + ShaderData d = (ShaderData)0; + d.clipPos = i.pos; + d.worldSpacePosition = i.worldPos; + + d.worldSpaceNormal = normalize(i.worldNormal); + d.worldSpaceTangent.xyz = normalize(i.worldTangent.xyz); + + d.tangentSign = i.worldTangent.w * unity_WorldTransformParams.w; + float3 bitangent = cross(d.worldSpaceTangent.xyz, d.worldSpaceNormal) * d.tangentSign; + + d.TBNMatrix = float3x3(d.worldSpaceTangent, -bitangent, d.worldSpaceNormal); + d.worldSpaceViewDir = normalize(_WorldSpaceCameraPos - i.worldPos); + + d.tangentSpaceViewDir = mul(d.TBNMatrix, d.worldSpaceViewDir); + d.texcoord0 = i.texcoord0; + d.texcoord1 = i.texcoord1; + d.texcoord2 = i.texcoord2; + + // #if %TEXCOORD3REQUIREKEY% + d.texcoord3 = i.texcoord3; + // #endif + + // d.isFrontFace = facing; + // #if %VERTEXCOLORREQUIREKEY% + d.vertexColor = i.vertexColor; + // #endif + + // these rarely get used, so we back transform them. Usually will be stripped. + #if _HDRP + // d.localSpacePosition = mul(GetWorldToObjectMatrix(), float4(GetCameraRelativePositionWS(i.worldPos), 1)).xyz; + #else + // d.localSpacePosition = mul(GetWorldToObjectMatrix(), float4(i.worldPos, 1)).xyz; + #endif + // d.localSpaceNormal = normalize(mul((float3x3)GetWorldToObjectMatrix(), i.worldNormal)); + // d.localSpaceTangent = normalize(mul((float3x3)GetWorldToObjectMatrix(), i.worldTangent.xyz)); + + // #if %SCREENPOSREQUIREKEY% + // d.screenPos = i.screenPos; + // d.screenUV = (i.screenPos.xy / i.screenPos.w); + // #endif + + + // #if %EXTRAV2F0REQUIREKEY% + // d.extraV2F0 = i.extraV2F0; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // d.extraV2F1 = i.extraV2F1; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // d.extraV2F2 = i.extraV2F2; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // d.extraV2F3 = i.extraV2F3; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // d.extraV2F4 = i.extraV2F4; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // d.extraV2F5 = i.extraV2F5; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // d.extraV2F6 = i.extraV2F6; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // d.extraV2F7 = i.extraV2F7; + // #endif + + return d; + } + +#endif + + + +#if (SHADERPASS == SHADERPASS_LIGHT_TRANSPORT) + + // This was not in constant buffer in original unity, so keep outiside. But should be in as ShaderRenderPass frequency + float unity_OneOverOutputBoost; + float unity_MaxOutputValue; + + CBUFFER_START(UnityMetaPass) + // x = use uv1 as raster position + // y = use uv2 as raster position + bool4 unity_MetaVertexControl; + + // x = return albedo + // y = return normal + bool4 unity_MetaFragmentControl; + CBUFFER_END + + VertexToPixel Vert(VertexData inputMesh) + { + VertexToPixel output; + ZERO_INITIALIZE(VertexToPixel, output); + UNITY_SETUP_INSTANCE_ID(inputMesh); + UNITY_TRANSFER_INSTANCE_ID(inputMesh, output); + UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(output); + + // Output UV coordinate in vertex shader + float2 uv = float2(0.0, 0.0); + + if (unity_MetaVertexControl.x) + { + uv = inputMesh.texcoord1.xy * unity_LightmapST.xy + unity_LightmapST.zw; + } + else if (unity_MetaVertexControl.y) + { + uv = inputMesh.texcoord2.xy * unity_DynamicLightmapST.xy + unity_DynamicLightmapST.zw; + } + + // OpenGL right now needs to actually use the incoming vertex position + // so we create a fake dependency on it here that haven't any impact. + output.pos = float4(uv * 2.0 - 1.0, inputMesh.vertex.z > 0 ? 1.0e-4 : 0.0, 1.0); + + output.worldPos = TransformObjectToWorld(inputMesh.vertex.xyz).xyz; + + // Normal is required for triplanar mapping + output.worldNormal = TransformObjectToWorldNormal(inputMesh.normal); + // Not required but assign to silent compiler warning + output.worldTangent = float4(1.0, 0.0, 0.0, 0.0); + + output.texcoord0 = inputMesh.texcoord0; + output.texcoord1 = inputMesh.texcoord1; + output.texcoord2 = inputMesh.texcoord2; + // #if %TEXCOORD3REQUIREKEY% + output.texcoord3 = inputMesh.texcoord3; + // #endif + // #if %VERTEXCOLORREQUIREKEY% + output.vertexColor = inputMesh.vertexColor; + // #endif + + return output; + } +#else + + #if (_PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR))) + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/ShaderVariablesMatrixDefsHDCamera.hlsl" + + void MotionVectorPositionZBias(VertexToPixel input) + { + #if UNITY_REVERSED_Z + input.pos.z -= unity_MotionVectorsParams.z * input.pos.w; + #else + input.pos.z += unity_MotionVectorsParams.z * input.pos.w; + #endif + } + + #endif + + VertexToPixel Vert(VertexData input) + { + VertexToPixel output; + ZERO_INITIALIZE(VertexToPixel, output); + + UNITY_SETUP_INSTANCE_ID(input); + UNITY_TRANSFER_INSTANCE_ID(input, output); + UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(output); + + #if _HDRP && (_PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR))) + VertexData previousMesh = input; + #endif + + ChainModifyVertex(input, output, _Time); + + // This return the camera relative position (if enable) + float3 positionRWS = TransformObjectToWorld(input.vertex.xyz); + float3 normalWS = TransformObjectToWorldNormal(input.normal); + float4 tangentWS = float4(TransformObjectToWorldDir(input.tangent.xyz), input.tangent.w); + + + output.worldPos = GetAbsolutePositionWS(positionRWS); + output.pos = TransformWorldToHClip(positionRWS); + output.worldNormal = normalWS; + output.worldTangent = tangentWS; + + + output.texcoord0 = input.texcoord0; + output.texcoord1 = input.texcoord1; + output.texcoord2 = input.texcoord2; + + // #if %TEXCOORD3REQUIREKEY% + output.texcoord3 = input.texcoord3; + // #endif + + // #if %VERTEXCOLORREQUIREKEY% + output.vertexColor = input.vertexColor; + // #endif + + // #if %SCREENPOSREQUIREKEY% + // output.screenPos = ComputeScreenPos(output.pos, _ProjectionParams.x); + // #endif + + #if _HDRP && (_PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR))) + + #if !defined(TESSELLATION_ON) + MotionVectorPositionZBias(output); + #endif + + output.motionVectorCS = mul(UNITY_MATRIX_UNJITTERED_VP, float4(positionRWS.xyz, 1.0)); + // Note: unity_MotionVectorsParams.y is 0 is forceNoMotion is enabled + bool forceNoMotion = unity_MotionVectorsParams.y == 0.0; + if (forceNoMotion) + { + output.previousPositionCS = float4(0.0, 0.0, 0.0, 1.0); + } + else + { + bool hasDeformation = unity_MotionVectorsParams.x > 0.0; // Skin or morph target + + float3 effectivePositionOS = (hasDeformation ? previousMesh.previousPositionOS : previousMesh.vertex.xyz); + #if defined(_ADD_PRECOMPUTED_VELOCITY) + effectivePositionOS -= input.precomputedVelocity; + #endif + + previousMesh.vertex = float4(effectivePositionOS, 1); + VertexToPixel dummy = (VertexToPixel)0; + + + ChainModifyVertex(previousMesh, dummy, _LastTimeParameters); + + // we might need this for skinned objects? + //float3 normalWS = TransformPreviousObjectToWorldNormal(input.normal).xyz; + float3 previousPositionRWS = TransformPreviousObjectToWorld(previousMesh.vertex.xyz); + + #ifdef _WRITE_TRANSPARENT_MOTION_VECTOR + if (_TransparentCameraOnlyMotionVectors > 0) + { + previousPositionRWS = positionRWS.xyz; + } + #endif // _WRITE_TRANSPARENT_MOTION_VECTOR + + output.previousPositionCS = mul(UNITY_MATRIX_PREV_VP, float4(previousPositionRWS, 1.0)); + } + #endif // _HDRP && _PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR)) + + + return output; + } + + +#endif + + + + + + + + #if defined(WRITE_DECAL_BUFFER) && !defined(_DISABLE_DECALS) + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/Decal/DecalPrepassBuffer.hlsl" + #endif + + FragInputs BuildFragInputs(VertexToPixel input) + { + UNITY_SETUP_INSTANCE_ID(input); + FragInputs output; + ZERO_INITIALIZE(FragInputs, output); + + // Init to some default value to make the computer quiet (else it output 'divide by zero' warning even if value is not used). + // TODO: this is a really poor workaround, but the variable is used in a bunch of places + // to compute normals which are then passed on elsewhere to compute other values... + output.tangentToWorld = k_identity3x3; + output.positionSS = input.pos; // input.positionCS is SV_Position + // BETTER SHADERS: because we transform world position into actual world space for things like + // triplanar, etc, we have to back transform it here for lighting + output.positionRWS = GetCameraRelativePositionWS(input.worldPos); + output.tangentToWorld = BuildTangentToWorld(input.worldTangent, input.worldNormal); + output.texCoord0 = input.texcoord0; + output.texCoord1 = input.texcoord1; + output.texCoord2 = input.texcoord2; + + return output; + } + +#if UNITY_VERSION > UNITY_2022_3_12 + void ApplyDecalAndGetNormal(FragInputs fragInputs, PositionInputs posInput, Surface surfaceDescription, float3 normalTS, + inout SurfaceData surfaceData) + { + float3 doubleSidedConstants = GetDoubleSidedConstants(); + + #ifdef DECAL_NORMAL_BLENDING + // SG nodes don't ouptut surface gradients, so if decals require surf grad blending, we have to convert + // the normal to gradient before applying the decal. We then have to resolve the gradient back to world space + normalTS = SurfaceGradientFromTangentSpaceNormalAndFromTBN(normalTS, + fragInputs.tangentToWorld[0], fragInputs.tangentToWorld[1]); + + + #if HAVE_DECALS + if (_EnableDecals) + { + float alpha = 1.0; + alpha = surfaceDescription.Alpha; + + DecalSurfaceData decalSurfaceData = GetDecalSurfaceData(posInput, fragInputs, alpha); + ApplyDecalToSurfaceNormal(decalSurfaceData, fragInputs.tangentToWorld[2], normalTS); + ApplyDecalToSurfaceDataNoNormal(decalSurfaceData, surfaceData); + } + #endif + + GetNormalWS_SG(fragInputs, normalTS, surfaceData.normalWS, doubleSidedConstants); + #else + // normal delivered to master node + + #if HAVE_DECALS + if (_EnableDecals) + { + float alpha = 1.0; + alpha = surfaceDescription.Alpha; + + // Both uses and modifies 'surfaceData.normalWS'. + DecalSurfaceData decalSurfaceData = GetDecalSurfaceData(posInput, fragInputs, alpha); + ApplyDecalToSurfaceNormal(decalSurfaceData, surfaceData.normalWS.xyz); + ApplyDecalToSurfaceDataNoNormal(decalSurfaceData, surfaceData); + } + #endif + #endif + } +#endif + + void BuildSurfaceData(FragInputs fragInputs, inout Surface surfaceDescription, float3 V, PositionInputs posInput, out SurfaceData surfaceData, out float3 bentNormalWS) + { + // setup defaults -- these are used if the graph doesn't output a value + ZERO_INITIALIZE(SurfaceData, surfaceData); + + // specularOcclusion need to be init ahead of decal to quiet the compiler that modify the SurfaceData struct + // however specularOcclusion can come from the graph, so need to be init here so it can be override. + surfaceData.specularOcclusion = 1.0; + + // copy across graph values, if defined + surfaceData.baseColor = surfaceDescription.Albedo; + surfaceData.perceptualSmoothness = surfaceDescription.Smoothness; + surfaceData.ambientOcclusion = surfaceDescription.Occlusion; + surfaceData.specularOcclusion = surfaceDescription.SpecularOcclusion; + surfaceData.metallic = surfaceDescription.Metallic; + surfaceData.subsurfaceMask = surfaceDescription.SubsurfaceMask; + surfaceData.thickness = surfaceDescription.Thickness; + surfaceData.diffusionProfileHash = asuint(surfaceDescription.DiffusionProfileHash); + #if _USESPECULAR + surfaceData.specularColor = surfaceDescription.Specular; + #endif + surfaceData.coatMask = surfaceDescription.CoatMask; + surfaceData.anisotropy = surfaceDescription.Anisotropy; + surfaceData.iridescenceMask = surfaceDescription.IridescenceMask; + surfaceData.iridescenceThickness = surfaceDescription.IridescenceThickness; + + + + #if defined(_REFRACTION_PLANE) || defined(_REFRACTION_SPHERE) || defined(_REFRACTION_THIN) + if (_EnableSSRefraction) + { + surfaceData.transmittanceMask = (1.0 - surfaceDescription.Alpha); + surfaceDescription.Alpha = 1.0; + } + else + { + surfaceData.ior = surfaceDescription.ior; + surfaceData.transmittanceColor = surfaceDescription.transmittanceColor; + surfaceData.atDistance = surfaceDescription.atDistance; + surfaceData.transmittanceMask = surfaceDescription.transmittanceMask; + surfaceDescription.Alpha = 1.0; + } + #else + surfaceData.ior = 1.0; + surfaceData.transmittanceColor = float3(1.0, 1.0, 1.0); + surfaceData.atDistance = 1.0; + surfaceData.transmittanceMask = 0.0; + #endif + + + + // These static material feature allow compile time optimization + surfaceData.materialFeatures = MATERIALFEATUREFLAGS_LIT_STANDARD; + #ifdef _MATERIAL_FEATURE_SUBSURFACE_SCATTERING + surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_SUBSURFACE_SCATTERING; + #endif + + #ifdef _MATERIAL_FEATURE_TRANSMISSION + surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_TRANSMISSION; + #endif + + #ifdef _MATERIAL_FEATURE_ANISOTROPY + surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_ANISOTROPY; + surfaceData.normalWS = float3(0, 1, 0); + #endif + + #ifdef _MATERIAL_FEATURE_IRIDESCENCE + surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_IRIDESCENCE; + #endif + + #ifdef _MATERIAL_FEATURE_SPECULAR_COLOR + surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_SPECULAR_COLOR; + #endif + + #if defined(_MATERIAL_FEATURE_CLEAR_COAT) || _CLEARCOAT + surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_CLEAR_COAT; + #endif + + #if defined (_MATERIAL_FEATURE_SPECULAR_COLOR) && defined (_ENERGY_CONSERVING_SPECULAR) + // Require to have setup baseColor + // Reproduce the energy conservation done in legacy Unity. Not ideal but better for compatibility and users can unchek it + surfaceData.baseColor *= (1.0 - Max3(surfaceData.specularColor.r, surfaceData.specularColor.g, surfaceData.specularColor.b)); + #endif + + float3 normalTS = surfaceDescription.Normal; + #if !_WORLDSPACENORMAL + surfaceData.normalWS = mul(surfaceDescription.Normal, fragInputs.tangentToWorld); + #else + normalTS = mul(fragInputs.tangentToWorld, surfaceDescription.Normal); + surfaceData.normalWS = surfaceDescription.Normal; + #endif + + + #if UNITY_VERSION > UNITY_2022_3_12 + ApplyDecalAndGetNormal(fragInputs, posInput, surfaceDescription, normalTS, surfaceData); + #else + #ifdef DECAL_NORMAL_BLENDING + #if HAVE_DECALS + float alpha = 1.0; + alpha = surfaceDescription.Alpha; + if (_EnableDecals) + { + DecalSurfaceData decalSurfaceData = GetDecalSurfaceData(posInput, fragInputs, alpha); + ApplyDecalToSurfaceData(decalSurfaceData, fragInputs.tangentToWorld[2], surfaceData, normalTS); + } + #endif + #else + #if HAVE_DECALS + if (_EnableDecals) + { + float alpha = 1.0; + alpha = surfaceDescription.Alpha; + // Both uses and modifies 'surfaceData.normalWS'. + DecalSurfaceData decalSurfaceData = GetDecalSurfaceData(posInput, fragInputs, alpha); + ApplyDecalToSurfaceData(decalSurfaceData, fragInputs.tangentToWorld[2], surfaceData); + } + #endif + #endif + #endif + + + + surfaceData.geomNormalWS = fragInputs.tangentToWorld[2]; + + surfaceData.tangentWS = normalize(fragInputs.tangentToWorld[0].xyz); // The tangent is not normalize in tangentToWorld for mikkt. TODO: Check if it expected that we normalize with Morten. Tag: SURFACE_GRADIENT + + + bentNormalWS = surfaceData.normalWS; + + surfaceData.tangentWS = Orthonormalize(surfaceData.tangentWS, surfaceData.normalWS); + + #ifdef DEBUG_DISPLAY + if (_DebugMipMapMode != DEBUGMIPMAPMODE_NONE) + { + // TODO: need to update mip info + surfaceData.metallic = 0; + } + + // We need to call ApplyDebugToSurfaceData after filling the surfarcedata and before filling builtinData + // as it can modify attribute use for static lighting + ApplyDebugToSurfaceData(fragInputs.tangentToWorld, surfaceData); + #endif + + // By default we use the ambient occlusion with Tri-ace trick (apply outside) for specular occlusion. + // If user provide bent normal then we process a better term + #if defined(_SPECULAR_OCCLUSION_CUSTOM) + // Just use the value passed through via the slot (not active otherwise) + #elif defined(_SPECULAR_OCCLUSION_FROM_AO_BENT_NORMAL) + // If we have bent normal and ambient occlusion, process a specular occlusion + surfaceData.specularOcclusion = GetSpecularOcclusionFromBentAO(V, bentNormalWS, surfaceData.normalWS, surfaceData.ambientOcclusion, PerceptualSmoothnessToPerceptualRoughness(surfaceData.perceptualSmoothness)); + #elif defined(_AMBIENT_OCCLUSION) && defined(_SPECULAR_OCCLUSION_FROM_AO) + surfaceData.specularOcclusion = GetSpecularOcclusionFromAmbientOcclusion(ClampNdotV(dot(surfaceData.normalWS, V)), surfaceData.ambientOcclusion, PerceptualSmoothnessToRoughness(surfaceData.perceptualSmoothness)); + #endif + + #if defined(_ENABLE_GEOMETRIC_SPECULAR_AA) && !defined(SHADER_STAGE_RAY_TRACING) + surfaceData.perceptualSmoothness = GeometricNormalFiltering(surfaceData.perceptualSmoothness, fragInputs.tangentToWorld[2], surfaceDescription.SpecularAAScreenSpaceVariance, surfaceDescription.SpecularAAThreshold); + #endif + } + + void GetSurfaceAndBuiltinData(VertexToPixel m2ps, FragInputs fragInputs, float3 V, inout PositionInputs posInput, + out SurfaceData surfaceData, out BuiltinData builtinData, inout Surface l, inout ShaderData d + #if NEED_FACING + , bool facing + #endif + ) + { + // Removed since crossfade does not work, probably needs extra material setup. + //#if !defined(SHADER_STAGE_RAY_TRACING) && !defined(_TESSELLATION_DISPLACEMENT) + // #ifdef LOD_FADE_CROSSFADE // enable dithering LOD transition if user select CrossFade transition in LOD group + // LODDitheringTransition(ComputeFadeMaskSeed(V, posInput.positionSS), unity_LODFade.x); + // #endif + //#endif + + + + + d = CreateShaderData(m2ps + #if NEED_FACING + , facing + #endif + ); + + l = (Surface)0; + + l.Albedo = half3(0.5, 0.5, 0.5); + l.Normal = float3(0,0,1); + l.Occlusion = 1; + l.Alpha = 1; + l.SpecularOcclusion = 1; + + #if !defined(SHADER_STAGE_RAY_TRACING) && defined(_DEPTHOFFSET_ON) + l.outputDepth = d.clipPos.z; + #endif + + ChainSurfaceFunction(l, d); + + #if !defined(SHADER_STAGE_RAY_TRACING) && defined(_DEPTHOFFSET_ON) + posInput.deviceDepth = l.outputDepth; + #endif + + #if _UNLIT + //l.Emission = l.Albedo; + //l.Albedo = 0; + l.Normal = half3(0,0,1); + l.Occlusion = 1; + l.Metallic = 0; + l.Specular = 0; + #endif + + surfaceData.geomNormalWS = d.worldSpaceNormal; + surfaceData.tangentWS = d.worldSpaceTangent; + fragInputs.tangentToWorld = d.TBNMatrix; + + float3 bentNormalWS; + + BuildSurfaceData(fragInputs, l, V, posInput, surfaceData, bentNormalWS); + + + float4 lightmapTexCoord1 = fragInputs.texCoord1; + float4 lightmapTexCoord2 = fragInputs.texCoord2; + //#ifdef FRAG_INPUTS_USE_TEXCOORD1 + // float4 lightmapTexCoord1 = fragInputs.texCoord1; + // #else + // float4 lightmapTexCoord1 = float4(0,0,0,0); + // #endif + + // #ifdef FRAG_INPUTS_USE_TEXCOORD2 + // float4 lightmapTexCoord2 = fragInputs.texCoord2; + // #else + // float4 lightmapTexCoord2 = float4(0,0,0,0); + // #endif + + + InitBuiltinData(posInput, l.Alpha, bentNormalWS, -d.worldSpaceNormal, lightmapTexCoord1, lightmapTexCoord2, builtinData); + + + + builtinData.emissiveColor = l.Emission; + + #if defined(_OVERRIDE_BAKEDGI) + builtinData.bakeDiffuseLighting = l.DiffuseGI; + builtinData.backBakeDiffuseLighting = l.BackDiffuseGI; + builtinData.emissiveColor += l.SpecularGI; + #endif + + #if defined(_OVERRIDE_SHADOWMASK) + builtinData.shadowMask0 = l.ShadowMask.x; + builtinData.shadowMask1 = l.ShadowMask.y; + builtinData.shadowMask2 = l.ShadowMask.z; + builtinData.shadowMask3 = l.ShadowMask.w; + #endif + + #ifdef UNITY_VIRTUAL_TEXTURING + //builtinData.vtPackedFeedback = surfaceData.VTPackedFeedback; + #endif + + #if (SHADERPASS == SHADERPASS_DISTORTION) + builtinData.distortion = surfaceData.Distortion; + builtinData.distortionBlur = surfaceData.DistortionBlur; + #endif + + #ifndef SHADER_UNLIT + // PostInitBuiltinData call ApplyDebugToBuiltinData + PostInitBuiltinData(V, posInput, surfaceData, builtinData); + #else + ApplyDebugToBuiltinData(builtinData); + #endif + + RAY_TRACING_OPTIONAL_ALPHA_TEST_PASS + } + + + +#define DEBUG_DISPLAY +#include "Packages/com.unity.render-pipelines.high-definition/Runtime/Debug/DebugDisplay.hlsl" +#include "Packages/com.unity.render-pipelines.high-definition/Runtime/Debug/FullScreenDebug.hlsl" + + #if !defined(_DEPTHOFFSET_ON) + [earlydepthstencil] // quad overshading debug mode writes to UAV + #endif + void Frag(VertexToPixel v2f + #if NEED_FACING + , bool facing : SV_IsFrontFace + #endif + ) + { + UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX(v2f); + FragInputs input = BuildFragInputs(v2f); + + PositionInputs posInput = GetPositionInput(input.positionSS.xy, _ScreenSize.zw, input.positionSS.z, input.positionSS.w, input.positionRWS.xyz); + + #ifdef PLATFORM_SUPPORTS_PRIMITIVE_ID_IN_PIXEL_SHADER + if (_DebugFullScreenMode == FULLSCREENDEBUGMODE_QUAD_OVERDRAW) + { + IncrementQuadOverdrawCounter(posInput.positionSS.xy, input.primitiveID); + } + #endif + } + + ENDHLSL + } + + + + + + } + + + + CustomEditor "AllIn1SpriteShaderLitMaterialInspector" +} diff --git a/Assets/Plugins/AllIn1SpriteShader/Shaders/LitShaders/AllIn1SpriteShaderLit_BetterShader_HDRP2022.txt.meta b/Assets/Plugins/AllIn1SpriteShader/Shaders/LitShaders/AllIn1SpriteShaderLit_BetterShader_HDRP2022.txt.meta new file mode 100644 index 000000000..58dffc415 --- /dev/null +++ b/Assets/Plugins/AllIn1SpriteShader/Shaders/LitShaders/AllIn1SpriteShaderLit_BetterShader_HDRP2022.txt.meta @@ -0,0 +1,14 @@ +fileFormatVersion: 2 +guid: f92b26827dd1dcc45b0edccd67279b1d +TextScriptImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 156513 + packageName: All In 1 Sprite Shader + packageVersion: 4.25 + assetPath: Assets/Plugins/AllIn1SpriteShader/Shaders/LitShaders/AllIn1SpriteShaderLit_BetterShader_HDRP2022.txt + uploadId: 708810 diff --git a/Assets/Plugins/AllIn1SpriteShader/Shaders/LitShaders/AllIn1SpriteShaderLit_BetterShader_HDRP2023.txt b/Assets/Plugins/AllIn1SpriteShader/Shaders/LitShaders/AllIn1SpriteShaderLit_BetterShader_HDRP2023.txt new file mode 100644 index 000000000..b4f8e577d --- /dev/null +++ b/Assets/Plugins/AllIn1SpriteShader/Shaders/LitShaders/AllIn1SpriteShaderLit_BetterShader_HDRP2023.txt @@ -0,0 +1,26383 @@ +//////////////////////////////////////// +// Generated with Better Shaders +// +// Auto-generated shader code, don't hand edit! +// +// Unity Version: 2019.4.16f1 +// Render Pipeline: HDRP2023 +// Platform: WindowsEditor +//////////////////////////////////////// + + +Shader "AllIn1SpriteShader/AllIn1SpriteShaderLit_BetterShader" +{ + Properties + { + + _MainTex ("Main Texture", 2D) = "white" {} //0 + _Color("Main Color", Color) = (1,1,1,1) //1 + _Alpha("General Alpha", Range(0,1)) = 1 //2 + + _GlowColor("Glow Color", Color) = (1,1,1,1) //3 + _Glow("Glow Color Intensity", Range(0,100)) = 10 //4 + _GlowGlobal("Global Glow Intensity", Range(1,100)) = 1 //5 + [NoScaleOffset] _GlowTex("Glow Texture", 2D) = "white" {} //6 + + _FadeTex("Fade Texture", 2D) = "white" {} //7 + _FadeAmount("Fade Amount", Range(-0.1,1)) = -0.1 //8 + _FadeBurnWidth("Fade Burn Width", Range(0,1)) = 0.025 //9 + _FadeBurnTransition("Burn Transition", Range(0.01,0.5)) = 0.075 //10 + _FadeBurnColor("Fade Burn Color", Color) = (1,1,0,1) //11 + _FadeBurnTex("Fade Burn Texture", 2D) = "white" {} //12 + _FadeBurnGlow("Fade Burn Glow", Range(1,250)) = 2//13 + + _OutlineColor("Outline Base Color", Color) = (1,1,1,1) //14 + _OutlineAlpha("Outline Base Alpha", Range(0,1)) = 1 //15 + _OutlineGlow("Outline Base Glow", Range(1,100)) = 1.5 //16 + _OutlineWidth("Outline Base Width", Range(0,0.2)) = 0.004 //17 + _OutlinePixelWidth("Outline Base Pixel Width", Int) = 1 //18 + + [Space] + _OutlineTex("Outline Texture", 2D) = "white" {} //19 + _OutlineTexXSpeed("Texture scroll speed X", Range(-50,50)) = 10 //20 + _OutlineTexYSpeed("Texture scroll speed Y", Range(-50,50)) = 0 //21 + + [Space] + _OutlineDistortTex("Outline Distortion Texture", 2D) = "white" {} //22 + _OutlineDistortAmount("Outline Distortion Amount", Range(0,2)) = 0.5 //23 + _OutlineDistortTexXSpeed("Distortion scroll speed X", Range(-50,50)) = 5 //24 + _OutlineDistortTexYSpeed("Distortion scroll speed Y", Range(-50,50)) = 5 //25 + + _AlphaOutlineColor("Color", Color) = (1, 1, 1, 1) //26 + _AlphaOutlineGlow("Outline Glow", Range(1,100)) = 5 //27 + _AlphaOutlinePower("Power", Range(0, 5)) = 1 // 28 + _AlphaOutlineMinAlpha("Min Alpha", Range(0, 1)) = 0 // 29 + _AlphaOutlineBlend("Blend", Range(0, 1)) = 1 // 30 + + _GradBlend("Gradient Blend", Range(0,1)) = 1 //31 + _GradTopLeftCol("Top Color", Color) = (1,0,0,1) //32 + _GradTopRightCol("Top Color 2", Color) = (1, 1, 0, 1) //33 + _GradBotLeftCol("Bot Color", Color) = (0,0,1,1) //34 + _GradBotRightCol("Bot Color 2", Color) = (0, 1, 0, 1) //35 + + [NoScaleOffset] _ColorSwapTex("Color Swap Texture", 2D) = "black" {} //36 + [HDR] _ColorSwapRed("Red Channel", Color) = (1,1,1,1) //37 + _ColorSwapRedLuminosity("Red luminosity", Range(-1,1)) = 0.5 //38 + [HDR] _ColorSwapGreen("Green Channel", Color) = (1,1,1,1) //39 + _ColorSwapGreenLuminosity("Green luminosity", Range(-1,1)) = 0.5 //40 + [HDR] _ColorSwapBlue("Blue Channel", Color) = (1,1,1,1) //41 + _ColorSwapBlueLuminosity("Blue luminosity", Range(-1,1)) = 0.5 //42 + + _HsvShift("Hue Shift", Range(0, 360)) = 180 //43 + _HsvSaturation("Saturation", Range(0, 2)) = 1 //44 + _HsvBright("Brightness", Range(0, 2)) = 1 //45 + + _HitEffectColor("Hit Effect Color", Color) = (1,1,1,1) //46 + _HitEffectGlow("Glow Intensity", Range(1,100)) = 5 //47 + [Space] + _HitEffectBlend("Hit Effect Blend", Range(0,1)) = 1 //48 + + _NegativeAmount("Negative Amount", Range(0, 1)) = 1 //49 + + _PixelateSize("Pixelate size", Range(4,512)) = 32 //50 + + [NoScaleOffset] _ColorRampTex("Color ramp Texture", 2D) = "white" {} //51 + _ColorRampLuminosity("Color ramp luminosity", Range(-1,1)) = 0 //52 + [Toggle()] _ColorRampOutline("Affects everything?", float) = 0 //53 + + _GreyscaleLuminosity("Greyscale luminosity", Range(-1,1)) = 0 //54 + [Toggle()] _GreyscaleOutline("Affects everything?", float) = 0 //55 + _GreyscaleTintColor("Greyscale Tint Color", Color) = (1,1,1,1) //56 + + _PosterizeNumColors("Number of Colors", Range(0,100)) = 8 //57 + _PosterizeGamma("Posterize Amount", Range(0.1,10)) = 0.75 //58 + [Toggle()] _PosterizeOutline("Affects everything?", float) = 0 //59 + + _BlurIntensity("Blur Intensity", Range(0,100)) = 10 //60 + [Toggle()] _BlurHD("Blur is Low Res?", float) = 0 //61 + + _MotionBlurAngle("Motion Blur Angle", Range(-1, 1)) = 0.1 //62 + _MotionBlurDist("Motion Blur Distance", Range(-3, 3)) = 1.25 //63 + + _GhostColorBoost("Ghost Color Boost", Range(0,5)) = 1 //64 + _GhostTransparency("Ghost Transparency", Range(0,1)) = 0 //65 + + _InnerOutlineColor("Inner Outline Color", Color) = (1,0,0,1) //66 + _InnerOutlineThickness("Outline Thickness", Range(0,3)) = 1 //67 + _InnerOutlineAlpha("Inner Outline Alpha", Range(0,1)) = 1 //68 + _InnerOutlineGlow("Inner Outline Glow", Range(1,250)) = 4 //69 + + _AlphaCutoffValue("Alpha cutoff value", Range(0, 1)) = 0.25 //70 + + [Toggle()] _OnlyOutline("Only render outline?", float) = 0 //71 + [Toggle()] _OnlyInnerOutline("Only render inner outline?", float) = 0 //72 + + _HologramStripesAmount("Stripes Amount", Range(0, 1)) = 0.1 //73 + _HologramUnmodAmount("Unchanged Amount", Range(0, 1)) = 0.0 //74 + _HologramStripesSpeed("Stripes Speed", Range(-20, 20)) = 4.5 //75 + _HologramMinAlpha("Min Alpha", Range(0, 1)) = 0.1 //76 + _HologramMaxAlpha("Max Alpha", Range(0, 100)) = 0.75 //77 + + _ChromAberrAmount("ChromAberr Amount", Range(0, 1)) = 1 //78 + _ChromAberrAlpha("ChromAberr Alpha", Range(0, 1)) = 0.4 //79 + + _GlitchAmount("Glitch Amount", Range(0, 20)) = 3 //80 + + _FlickerPercent("Flicker Percent", Range(0, 1)) = 0.05 //81 + _FlickerFreq("Flicker Frequency", Range(0, 5)) = 0.2 //82 + _FlickerAlpha("Flicker Alpha", Range(0, 1)) = 0 //83 + + _ShadowX("Shadow X Axis", Range(-0.5, 0.5)) = 0.1 //84 + _ShadowY("Shadow Y Axis", Range(-0.5, 0.5)) = -0.05 //85 + _ShadowAlpha("Shadow Alpha", Range(0, 1)) = 0.5 //86 + _ShadowColor("Shadow Color", Color) = (0, 0, 0, 1) //87 + + _HandDrawnAmount("Hand Drawn Amount", Range(0, 20)) = 10 //88 + _HandDrawnSpeed("Hand Drawn Speed", Range(1, 15)) = 5 //89 + + _GrassSpeed("Speed", Range(0,50)) = 2 //90 + _GrassWind("Bend amount", Range(0,50)) = 20 //91 + [Space] + [Toggle()] _GrassManualToggle("Manually animated?", float) = 0 //92 + _GrassManualAnim("Manual Anim Value", Range(-1,1)) = 1 //93 + + _WaveAmount("Wave Amount", Range(0, 25)) = 7 //94 + _WaveSpeed("Wave Speed", Range(0, 25)) = 10 //95 + _WaveStrength("Wave Strength", Range(0, 25)) = 7.5 //96 + _WaveX("Wave X Axis", Range(0, 1)) = 0 //97 + _WaveY("Wave Y Axis", Range(0, 1)) = 0.5 //98 + + _RectSize("Rect Size", Range(1, 4)) = 1 //99 + + _OffsetUvX("X axis", Range(-1, 1)) = 0 //100 + _OffsetUvY("Y axis", Range(-1, 1)) = 0 //101 + + _ClipUvLeft("Clipping Left", Range(0, 1)) = 0 //102 + _ClipUvRight("Clipping Right", Range(0, 1)) = 0 //103 + _ClipUvUp("Clipping Up", Range(0, 1)) = 0 //104 + _ClipUvDown("Clipping Down", Range(0, 1)) = 0 //105 + + _TextureScrollXSpeed("Speed X Axis", Range(-5, 5)) = 1 //106 + _TextureScrollYSpeed("Speed Y Axis", Range(-5, 5)) = 0 //107 + + _ZoomUvAmount("Zoom Amount", Range(0.1, 5)) = 0.5 //108 + + _DistortTex("Distortion Texture", 2D) = "white" {} //109 + _DistortAmount("Distortion Amount", Range(0,2)) = 0.5 //110 + _DistortTexXSpeed("Scroll speed X", Range(-50,50)) = 5 //111 + _DistortTexYSpeed("Scroll speed Y", Range(-50,50)) = 5 //112 + + _TwistUvAmount("Twist Amount", Range(0, 3.1416)) = 1 //113 + _TwistUvPosX("Twist Pos X Axis", Range(0, 1)) = 0.5 //114 + _TwistUvPosY("Twist Pos Y Axis", Range(0, 1)) = 0.5 //115 + _TwistUvRadius("Twist Radius", Range(0, 3)) = 0.75 //116 + + _RotateUvAmount("Rotate Angle(radians)", Range(0, 6.2831)) = 0 //117 + + _FishEyeUvAmount("Fish Eye Amount", Range(0, 0.5)) = 0.35 //118 + + _PinchUvAmount("Pinch Amount", Range(0, 0.5)) = 0.35 //119 + + _ShakeUvSpeed("Shake Speed", Range(0, 20)) = 2.5 //120 + _ShakeUvX("X Multiplier", Range(0, 5)) = 1.5 //121 + _ShakeUvY("Y Multiplier", Range(0, 5)) = 1 //122 + + _ColorChangeTolerance("Tolerance", Range(0, 1)) = 0.25 //123 + _ColorChangeTarget("Color to change", Color) = (1, 0, 0, 1) //124 + [HDR] _ColorChangeNewCol("New Color", Color) = (1, 1, 0, 1) //125 + _ColorChangeLuminosity("New Color Luminosity", Range(0, 1)) = 0.0 //126 + + _RoundWaveStrength("Wave Strength", Range(0, 1)) = 0.7 //127 + _RoundWaveSpeed("Wave Speed", Range(0, 5)) = 2 //128 + + [Toggle()] _BillboardY("Billboard on both axis?", float) = 0 //129 + _ZWrite ("Depth Write", Float) = 1.0 // 130 + + _MySrcMode ("SrcMode", Float) = 5 // 131 + _MyDstMode ("DstMode", Float) = 10 // 132 + + _ShineColor("Shine Color", Color) = (1,1,1,1) // 133 + _ShineLocation("Shine Location", Range(0,1)) = 0.5 // 134 + _ShineRotate("Rotate Angle(radians)", Range(0, 6.2831)) = 0 //135 + _ShineWidth("Shine Width", Range(0.05,1)) = 0.1 // 136 + _ShineGlow("Shine Glow", Range(0,100)) = 1 // 137 + [NoScaleOffset] _ShineMask("Shine Mask", 2D) = "white" {} // 138 + + _GlitchSize("Glitch Size", Range(0.25, 5)) = 1 //139 + _HologramStripeColor("Stripes Color", Color) = (0,1,1,1) //140 + _GradBoostX("Boost X axis", Range(0.1, 5)) = 1.2 //141 + _GradBoostY("Boost Y axis", Range(0.1, 5)) = 1.2 //142 + [Toggle()] _GradIsRadial("Radial Gradient?", float) = 0 //143 + _AlphaRoundThreshold("Round Threshold", Range(0.005, 1.0)) = 0.5 //144 + _GrassRadialBend("Radial Bend", Range(0.0, 5.0)) = 0.1 //145 + + _ColorChangeTolerance2("Tolerance 2", Range(0, 1)) = 0.25 //146 + _ColorChangeTarget2("Color to change 2", Color) = (1, 0, 0, 1) //147 + [HDR] _ColorChangeNewCol2("New Color 2", Color) = (1, 1, 0, 1) //148 + _ColorChangeTolerance3("Tolerance 3", Range(0, 1)) = 0.25 //149 + _ColorChangeTarget3("Color to change 3", Color) = (1, 0, 0, 1) //150 + [HDR] _ColorChangeNewCol3("New Color 3", Color) = (1, 1, 0, 1) //151 + + _Contrast ("Contrast", Range(0, 6)) = 1 // 152 + _Brightness ("Brightness", Range(-1, 1)) = 0 // 153 + + _ColorSwapBlend ("Color Swap Blend", Range(0, 1)) = 1 // 154 + _ColorRampBlend ("Color Ramp Blend", Range(0, 1)) = 1 // 155 + _GreyscaleBlend ("Greyscale Blend", Range(0, 1)) = 1 // 156 + _GhostBlend ("Ghost Blend", Range(0, 1)) = 1 // 157 + _HologramBlend ("Hologram Blend", Range(0, 1)) = 1 // 158 + + [AllIn1ShaderGradient] _ColorRampTexGradient("Color ramp Gradient", 2D) = "white" {} //159 + + _OverlayTex("Overlay Texture", 2D) = "white" {} //160 + _OverlayColor("Overlay Color", Color) = (1, 1, 1, 1) //161 + _OverlayGlow("Overlay Glow", Range(0,25)) = 1 // 162 + _OverlayBlend("Overlay Blend", Range(0, 1)) = 1 // 163 + + _RadialStartAngle("Radial Start Angle", Range(0, 360)) = 90 //164 + _RadialClip("Radial Clip", Range(0, 360)) = 45 //165 + _RadialClip2("Radial Clip 2", Range(0, 360)) = 0 //166 + + _WarpStrength("Warp Strength", Range(0, 0.1)) = 0.025 //167 + _WarpSpeed("Warp Speed", Range(0, 25)) = 8 //168 + _WarpScale("Warp Scale", Range(0.05, 3)) = 0.5 //169 + + _OverlayTextureScrollXSpeed("Speed X Axis", Range(-5, 5)) = 0.25 //170 + _OverlayTextureScrollYSpeed("Speed Y Axis", Range(-5, 5)) = 0.25 //171 + + _ZTestMode ("Z Test Mode", Float) = 4 + _CullingOption ("Culling Option", float) = 0 + + [HideInInspector] _MinXUV("_MinXUV", Range(0, 1)) = 0.0 + [HideInInspector] _MaxXUV("_MaxXUV", Range(0, 1)) = 1.0 + [HideInInspector] _MinYUV("_MinYUV", Range(0, 1)) = 0.0 + [HideInInspector] _MaxYUV("_MaxYUV", Range(0, 1)) = 1.0 + [HideInInspector] _RandomSeed("_MaxYUV", Range(0, 10000)) = 0.0 + _EditorDrawers("Editor Drawers", Int) = 6 + + [Normal][NoScaleOffset] _NormalMap("Normal Map", 2D) = "bump" {} + _NormalStrength("Normal Strength", Range(0, 15)) = 1.0 + + + + [HideInInspector]_RenderQueueType("Float", Float) = 1 + [HideInInspector][ToggleUI]_AddPrecomputedVelocity("Boolean", Float) = 0 + [HideInInspector][ToggleUI]_DepthOffsetEnable("Boolean", Float) = 0 + [HideInInspector][ToggleUI]_TransparentWritingMotionVec("Boolean", Float) = 0 + [HideInInspector][ToggleUI]_AlphaCutoffEnable("Boolean", Float) = 0 + [HideInInspector]_TransparentSortPriority("_TransparentSortPriority", Float) = 0 + [HideInInspector][ToggleUI]_UseShadowThreshold("Boolean", Float) = 0 + [HideInInspector][ToggleUI]_TransparentDepthPrepassEnable("Boolean", Float) = 0 + [HideInInspector][ToggleUI]_TransparentDepthPostpassEnable("Boolean", Float) = 0 + [HideInInspector]_SurfaceType("Float", Float) = 0 + [HideInInspector]_BlendMode("Float", Float) = 0 + [HideInInspector]_SrcBlend("Float", Float) = 1 + [HideInInspector]_DstBlend("Float", Float) = 0 + [HideInInspector]_AlphaSrcBlend("Float", Float) = 1 + [HideInInspector]_AlphaDstBlend("Float", Float) = 0 + [HideInInspector][ToggleUI]_AlphaToMask("Boolean", Float) = 0 + [HideInInspector][ToggleUI]_AlphaToMaskInspectorValue("Boolean", Float) = 0 + [HideInInspector][ToggleUI]_ZWrite("Boolean", Float) = 1 + [HideInInspector][ToggleUI]_TransparentZWrite("Boolean", Float) = 0 + [HideInInspector][ToggleUI]_EnableFogOnTransparent("Boolean", Float) = 1 + [HideInInspector]_ZTestDepthEqualForOpaque("Float", Int) = 4 + [HideInInspector][Enum(UnityEngine.Rendering.CompareFunction)]_ZTestTransparent("Float", Float) = 4 + [HideInInspector][ToggleUI]_TransparentBackfaceEnable("Boolean", Float) = 0 + [HideInInspector][ToggleUI]_RequireSplitLighting("Boolean", Float) = 0 + [HideInInspector][ToggleUI]_ReceivesSSR("Boolean", Float) = 1 + [HideInInspector][ToggleUI]_ReceivesSSRTransparent("Boolean", Float) = 0 + [HideInInspector][ToggleUI]_EnableBlendModePreserveSpecularLighting("Boolean", Float) = 1 + [HideInInspector][ToggleUI]_SupportDecals("Boolean", Float) = 1 + [HideInInspector]_StencilRef("Float", Int) = 0 + [HideInInspector]_StencilWriteMask("Float", Int) = 6 + [HideInInspector]_StencilRefDepth("Float", Int) = 8 + [HideInInspector]_StencilWriteMaskDepth("Float", Int) = 8 + [HideInInspector]_StencilRefMV("Float", Int) = 40 + [HideInInspector]_StencilWriteMaskMV("Float", Int) = 40 + [HideInInspector]_StencilRefDistortionVec("Float", Int) = 4 + [HideInInspector]_StencilWriteMaskDistortionVec("Float", Int) = 4 + [HideInInspector]_StencilWriteMaskGBuffer("Float", Int) = 14 + [HideInInspector]_StencilRefGBuffer("Float", Int) = 10 + [HideInInspector]_ZTestGBuffer("Float", Int) = 4 + [HideInInspector][ToggleUI]_RayTracing("Boolean", Float) = 0 + [HideInInspector][Enum(None, 0, Box, 1, Sphere, 2, Thin, 3)]_RefractionModel("Float", Float) = 0 + [HideInInspector][NoScaleOffset]unity_Lightmaps("unity_Lightmaps", 2DArray) = "" {} + [HideInInspector][NoScaleOffset]unity_LightmapsInd("unity_LightmapsInd", 2DArray) = "" {} + [HideInInspector][NoScaleOffset]unity_ShadowMasks("unity_ShadowMasks", 2DArray) = "" {} + } + SubShader + { + Tags { "RenderPipeline" = "HDRenderPipeline" "RenderType" = "HDLitShader" "Queue" = "Geometry+225" } + + + Pass + { + // based on HDLitPass.template + Name "Forward" + Tags { "LightMode" = "Forward" } + + + + Stencil + { + WriteMask [_StencilWriteMask] + Ref [_StencilRef] + CompFront Always + PassFront Replace + CompBack Always + PassBack Replace + } + + ColorMask [_ColorMaskTransparentVel] 1 + + Tags { "RenderType" = "Opaque" "Queue" = "Geometry" "PreviewType" = "Plane" } + Cull [_CullingOption] + ZWrite [_ZWrite] + ZTest [_ZTestMode] + + + //------------------------------------------------------------------------------------- + // End Render Modes + //------------------------------------------------------------------------------------- + + HLSLPROGRAM + + #pragma target 4.5 + #pragma multi_compile _ DOTS_INSTANCING_ON + #pragma instancing_options renderinglayer + + #pragma only_renderers d3d11 playstation xboxone xboxseries vulkan metal switch + #pragma multi_compile_instancing + + + //#pragma shader_feature _ _SURFACE_TYPE_TRANSPARENT + //#pragma shader_feature_local _BLENDMODE_OFF _BLENDMODE_ALPHA _BLENDMODE_ADD _BLENDMODE_PRE_MULTIPLY + //#pragma shader_feature_local _ _ADD_PRECOMPUTED_VELOCITY + //#pragma shader_feature_local _ _TRANSPARENT_WRITES_MOTION_VEC + //#pragma shader_feature_local _ _ENABLE_FOG_ON_TRANSPARENT + #pragma multi_compile _ DEBUG_DISPLAY + //#pragma shader_feature_local _ _DISABLE_DECALS + //#pragma shader_feature_local _ _DISABLE_SSR + //#pragma shader_feature_local _ _DISABLE_SSR_TRANSPARENT + #pragma multi_compile _ LIGHTMAP_ON + #pragma multi_compile _ DIRLIGHTMAP_COMBINED + #pragma multi_compile_fragment PROBE_VOLUMES_OFF PROBE_VOLUMES_L1 PROBE_VOLUMES_L2 + #pragma multi_compile _ DYNAMICLIGHTMAP_ON + #pragma multi_compile_fragment _ SHADOWS_SHADOWMASK + #pragma multi_compile_fragment DECALS_OFF DECALS_3RT DECALS_4RT + #pragma multi_compile_fragment _ DECAL_SURFACE_GRADIENT + #pragma multi_compile_fragment SHADOW_LOW SHADOW_MEDIUM SHADOW_HIGH + #pragma multi_compile_fragment SCREEN_SPACE_SHADOWS_OFF SCREEN_SPACE_SHADOWS_ON + #pragma multi_compile_fragment USE_FPTL_LIGHTLIST USE_CLUSTERED_LIGHTLIST + #pragma multi_compile_fragment AREA_SHADOW_MEDIUM AREA_SHADOW_HIGH + #pragma multi_compile _ LOD_FADE_CROSSFADE + #pragma multi_compile _ USE_LEGACY_LIGHTMAPS + + + //#pragma shader_feature_local _REFRACTION_OFF _REFRACTION_PLANE _REFRACTION_SPHERE _REFRACTION_THIN + + + //------------------------------------------------------------------------------------- + // Variant Definitions (active field translations to HDRP defines) + //------------------------------------------------------------------------------------- + // #define _MATERIAL_FEATURE_SUBSURFACE_SCATTERING 1 + // #define _MATERIAL_FEATURE_TRANSMISSION 1 + // #define _MATERIAL_FEATURE_ANISOTROPY 1 + // #define _MATERIAL_FEATURE_IRIDESCENCE 1 + // #define _MATERIAL_FEATURE_SPECULAR_COLOR 1 + #define _ENABLE_FOG_ON_TRANSPARENT 1 + // #define _AMBIENT_OCCLUSION 1 + // #define _SPECULAR_OCCLUSION_FROM_AO 1 + // #define _SPECULAR_OCCLUSION_FROM_AO_BENT_NORMAL 1 + // #define _SPECULAR_OCCLUSION_CUSTOM 1 + // #define _ENERGY_CONSERVING_SPECULAR 1 + // #define _ENABLE_GEOMETRIC_SPECULAR_AA 1 + // #define _HAS_REFRACTION 1 + // #define _REFRACTION_PLANE 1 + // #define _REFRACTION_SPHERE 1 + // #define _DISABLE_DECALS 1 + // #define _DISABLE_SSR 1 + // #define _ADD_PRECOMPUTED_VELOCITY + // #define _WRITE_TRANSPARENT_MOTION_VECTOR 1 + // #define _DEPTHOFFSET_ON 1 + // #define _BLENDMODE_PRESERVE_SPECULAR_LIGHTING 1 + + #define SHADERPASS SHADERPASS_FORWARD + #define SUPPORT_BLENDMODE_PRESERVE_SPECULAR_LIGHTING + #define HAS_LIGHTLOOP + #define RAYTRACING_SHADER_GRAPH_DEFAULT + #define _PASSFORWARD 1 + + + #pragma shader_feature_local GLOW_ON + #pragma shader_feature_local FADE_ON + #pragma shader_feature_local OUTBASE_ON + #pragma shader_feature_local ONLYOUTLINE_ON + #pragma shader_feature_local GRADIENT_ON + #pragma shader_feature_local GRADIENT2COL_ON + #pragma shader_feature_local RADIALGRADIENT_ON + #pragma shader_feature_local COLORSWAP_ON + #pragma shader_feature_local HSV_ON + #pragma shader_feature_local CHANGECOLOR_ON + #pragma shader_feature_local CHANGECOLOR2_ON + #pragma shader_feature_local CHANGECOLOR3_ON + #pragma shader_feature_local COLORRAMP_ON + #pragma shader_feature_local GRADIENTCOLORRAMP_ON + #pragma shader_feature_local HITEFFECT_ON + #pragma shader_feature_local NEGATIVE_ON + #pragma shader_feature_local PIXELATE_ON + #pragma shader_feature_local GREYSCALE_ON + #pragma shader_feature_local POSTERIZE_ON + #pragma shader_feature_local BLUR_ON + #pragma shader_feature_local MOTIONBLUR_ON + #pragma shader_feature_local GHOST_ON + #pragma shader_feature_local ALPHAOUTLINE_ON + #pragma shader_feature_local INNEROUTLINE_ON + #pragma shader_feature_local ONLYINNEROUTLINE_ON + #pragma shader_feature_local HOLOGRAM_ON + #pragma shader_feature_local CHROMABERR_ON + #pragma shader_feature_local GLITCH_ON + #pragma shader_feature_local FLICKER_ON + #pragma shader_feature_local SHADOW_ON + #pragma shader_feature_local SHINE_ON + #pragma shader_feature_local CONTRAST_ON + #pragma shader_feature_local OVERLAY_ON + #pragma shader_feature_local OVERLAYMULT_ON + #pragma shader_feature_local DOODLE_ON + #pragma shader_feature_local WIND_ON + #pragma shader_feature_local WAVEUV_ON + #pragma shader_feature_local ROUNDWAVEUV_ON + #pragma shader_feature_local RECTSIZE_ON + #pragma shader_feature_local OFFSETUV_ON + #pragma shader_feature_local CLIPPING_ON + #pragma shader_feature_local RADIALCLIPPING_ON + #pragma shader_feature_local TEXTURESCROLL_ON + #pragma shader_feature_local ZOOMUV_ON + #pragma shader_feature_local DISTORT_ON + #pragma shader_feature_local WARP_ON + #pragma shader_feature_local TWISTUV_ON + #pragma shader_feature_local ROTATEUV_ON + #pragma shader_feature_local POLARUV_ON + #pragma shader_feature_local FISHEYE_ON + #pragma shader_feature_local PINCH_ON + #pragma shader_feature_local SHAKEUV_ON + + #pragma shader_feature_local GLOWTEX_ON + #pragma shader_feature_local OUTTEX_ON + #pragma shader_feature_local OUTDIST_ON + #pragma shader_feature_local OUTBASE8DIR_ON + #pragma shader_feature_local OUTBASEPIXELPERF_ON + #pragma shader_feature_local COLORRAMPOUTLINE_ON + #pragma shader_feature_local GREYSCALEOUTLINE_ON + #pragma shader_feature_local POSTERIZEOUTLINE_ON + #pragma shader_feature_local BLURISHD_ON + #pragma shader_feature_local MANUALWIND_ON + #pragma shader_feature_local ATLAS_ON + #pragma shader_feature_local PREMULTIPLYALPHA_ON + + #pragma shader_feature BILBOARD_ON + #pragma shader_feature BILBOARDY_ON + + #pragma shader_feature NORMALMAP_ON + + + #define _HDRP 1 +#define _USINGTEXCOORD1 1 +#define _USINGTEXCOORD2 1 + + + #pragma vertex Vert + #pragma fragment Frag + + // useful conversion functions to make surface shader code just work + + #define UNITY_DECLARE_TEX2D(name) TEXTURE2D(name); SAMPLER(sampler##name); + #define UNITY_DECLARE_TEX2D_NOSAMPLER(name) TEXTURE2D(name); + #define UNITY_DECLARE_TEX2DARRAY(name) TEXTURE2D_ARRAY(name); SAMPLER(sampler##name); + #define UNITY_DECLARE_TEX2DARRAY_NOSAMPLER(tex) TEXTURE2D_ARRAY(tex); + + #define UNITY_SAMPLE_TEX2DARRAY(tex,coord) SAMPLE_TEXTURE2D_ARRAY(tex, sampler##tex, coord.xy, coord.z) + #define UNITY_SAMPLE_TEX2DARRAY_LOD(tex,coord,lod) SAMPLE_TEXTURE2D_ARRAY_LOD(tex, sampler##tex, coord.xy, coord.z, lod) + #define UNITY_SAMPLE_TEX2D(tex, coord) SAMPLE_TEXTURE2D(tex, sampler##tex, coord) + #define UNITY_SAMPLE_TEX2D_SAMPLER(tex, samp, coord) SAMPLE_TEXTURE2D(tex, sampler##samp, coord) + + #define UNITY_SAMPLE_TEX2D_LOD(tex,coord, lod) SAMPLE_TEXTURE2D_LOD(tex, sampler_##tex, coord, lod) + #define UNITY_SAMPLE_TEX2D_SAMPLER_LOD(tex,samplertex,coord, lod) SAMPLE_TEXTURE2D_LOD (tex, sampler##samplertex,coord, lod) + + #if defined(UNITY_COMPILER_HLSL) + #define UNITY_INITIALIZE_OUTPUT(type,name) name = (type)0; + #else + #define UNITY_INITIALIZE_OUTPUT(type,name) + #endif + + #define sampler2D_float sampler2D + #define sampler2D_half sampler2D + + #undef WorldNormalVector + #define WorldNormalVector(data, normal) mul(normal, data.TBNMatrix) + + #define UnityObjectToWorldNormal(normal) mul(GetObjectToWorldMatrix(), normal) + + #ifndef SHADER_STAGE_FRAGMENT + #if !defined(SHADOW_ULTRA_LOW) && !defined(SHADOW_LOW) && !defined(SHADOW_MEDIUM) && !defined(SHADOW_HIGH) // ultra low come from volumetricLighting.compute + #define SHADOW_MEDIUM + #endif + #if !defined(AREA_SHADOW_LOW) && !defined(AREA_SHADOW_MEDIUM) && !defined(AREA_SHADOW_HIGH) // low come from volumetricLighting.compute + #define AREA_SHADOW_MEDIUM + #endif + #endif + + + +// HDRP Adapter stuff + #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Common.hlsl" + #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Common.hlsl" + #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/GeometricTools.hlsl" // Required by Tessellation.hlsl + #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Tessellation.hlsl" + #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Texture.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/ShaderVariables.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/ShaderPass/ShaderPass.cs.hlsl" + #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/TextureStack.hlsl" // Required to be include before we include properties as it define DECLARE_STACK_CB + #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/DebugMipmapStreamingMacros.hlsl" // Required before including properties as it defines UNITY_TEXTURE_STREAMING_DEBUG_VARS + // Always include Shader Graph version + // Always include last to avoid double macros + #include "Packages/com.unity.shadergraph/ShaderGraphLibrary/Functions.hlsl" // Need to be here for Gradient struct definition + + +#include "Packages/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/ShaderPass/FragInputs.hlsl" + + + + #ifdef RAYTRACING_SHADER_GRAPH_DEFAULT + #define RAYTRACING_SHADER_GRAPH_HIGH + #endif + + #ifdef RAYTRACING_SHADER_GRAPH_RAYTRACED + #define RAYTRACING_SHADER_GRAPH_LOW + #endif + // end + + + + + // If we use subsurface scattering, enable output split lighting (for forward pass) + #if defined(_MATERIAL_FEATURE_SUBSURFACE_SCATTERING) && !defined(_SURFACE_TYPE_TRANSPARENT) + #define OUTPUT_SPLIT_LIGHTING + #endif + + #define HAVE_RECURSIVE_RENDERING + + #if SHADERPASS == SHADERPASS_TRANSPARENT_DEPTH_PREPASS + #if !defined(_DISABLE_SSR_TRANSPARENT) && !defined(SHADER_UNLIT) + #define WRITE_NORMAL_BUFFER + #endif + #endif + + #ifndef DEBUG_DISPLAY + // In case of opaque we don't want to perform the alpha test, it is done in depth prepass and we use depth equal for ztest (setup from UI) + // Don't do it with debug display mode as it is possible there is no depth prepass in this case + #if !defined(_SURFACE_TYPE_TRANSPARENT) && defined(_ALPHATEST) + #if SHADERPASS == SHADERPASS_FORWARD + #define SHADERPASS_FORWARD_BYPASS_ALPHA_TEST + #elif SHADERPASS == SHADERPASS_GBUFFER + #define SHADERPASS_GBUFFER_BYPASS_ALPHA_TEST + #endif + #endif + #endif + + // Define _DEFERRED_CAPABLE_MATERIAL for shader capable to run in deferred pass + #if defined(SHADER_LIT) && !defined(_SURFACE_TYPE_TRANSPARENT) + #define _DEFERRED_CAPABLE_MATERIAL + #endif + + // Translate transparent motion vector define + #if defined(_TRANSPARENT_WRITES_MOTION_VEC) && defined(_SURFACE_TYPE_TRANSPARENT) + #define _WRITE_TRANSPARENT_MOTION_VECTOR + #endif + + + + + CBUFFER_START(UnityPerMaterial) + float _UseShadowThreshold; + float _BlendMode; + float _EnableBlendModePreserveSpecularLighting; + float _RayTracing; + float _RefractionModel; + + + half4 _Color; + half4 _MainTex_ST, _MainTex_TexelSize; + half _Alpha, _AlphaCutoffValue; + + #if ATLAS_ON + half _MinXUV, _MaxXUV, _MinYUV, _MaxYUV; + #endif + + #if GLOW_ON + half4 _GlowColor; + half _Glow, _GlowGlobal; + #endif + + #if HSV_ON + half _HsvShift, _HsvSaturation, _HsvBright; + #endif + + #if DISTORT_ON + half4 _DistortTex_ST; + half _DistortTexXSpeed, _DistortTexYSpeed, _DistortAmount; + #endif + + #if FADE_ON + half4 _FadeBurnColor, _FadeTex_ST, _FadeBurnTex_ST; + half _FadeAmount, _FadeBurnWidth, _FadeBurnTransition,_FadeBurnGlow; + #endif + + #if OUTBASE_ON + half4 _OutlineColor; + half _OutlineAlpha, _OutlineGlow, _OutlineWidth; + int _OutlinePixelWidth; + #endif + + #if OUTTEX_ON + half4 _OutlineTex_ST; + half _OutlineTexXSpeed, _OutlineTexYSpeed; + #endif + + #if OUTDIST_ON + half4 _OutlineDistortTex_ST; + half _OutlineDistortTexXSpeed, _OutlineDistortTexYSpeed, _OutlineDistortAmount; + #endif + + #if ALPHAOUTLINE_ON + half _AlphaOutlineGlow, _AlphaOutlinePower, _AlphaOutlineMinAlpha, _AlphaOutlineBlend; + half4 _AlphaOutlineColor; + #endif + + #if INNEROUTLINE_ON + half _InnerOutlineThickness, _InnerOutlineAlpha, _InnerOutlineGlow; + half4 _InnerOutlineColor; + #endif + + #if GRADIENT_ON + half _GradBlend, _GradBoostX, _GradBoostY; + half4 _GradTopRightCol, _GradTopLeftCol, _GradBotRightCol, _GradBotLeftCol; + #endif + + #if COLORSWAP_ON + half4 _ColorSwapRed, _ColorSwapGreen, _ColorSwapBlue; + half _ColorSwapRedLuminosity, _ColorSwapGreenLuminosity, _ColorSwapBlueLuminosity, _ColorSwapBlend; + #endif + + #if CHANGECOLOR_ON + half4 _ColorChangeNewCol, _ColorChangeTarget; + half _ColorChangeTolerance, _ColorChangeLuminosity; + #endif + #if CHANGECOLOR2_ON + half4 _ColorChangeNewCol2, _ColorChangeTarget2; + half _ColorChangeTolerance2; + #endif + #if CHANGECOLOR3_ON + half4 _ColorChangeNewCol3, _ColorChangeTarget3; + half _ColorChangeTolerance3; + #endif + + #if COLORRAMP_ON + half _ColorRampLuminosity, _ColorRampBlend; + #endif + + #if HITEFFECT_ON + half4 _HitEffectColor; + half _HitEffectGlow, _HitEffectBlend; + #endif + + #if NEGATIVE_ON + half _NegativeAmount; + #endif + + #if PIXELATE_ON + half _PixelateSize; + #endif + + #if GREYSCALE_ON + half _GreyscaleLuminosity, _GreyscaleBlend; + half4 _GreyscaleTintColor; + #endif + + #if POSTERIZE_ON + half _PosterizeNumColors, _PosterizeGamma; + #endif + + #if BLUR_ON + half _BlurIntensity; + #endif + + #if MOTIONBLUR_ON + half _MotionBlurAngle, _MotionBlurDist; + #endif + + #if GHOST_ON + half _GhostColorBoost, _GhostTransparency, _GhostBlend; + #endif + + #if HOLOGRAM_ON + half _HologramStripesAmount, _HologramMinAlpha, _HologramUnmodAmount, _HologramStripesSpeed, _HologramMaxAlpha, _HologramBlend; + half4 _HologramStripeColor; + #endif + + #if CHROMABERR_ON + half _ChromAberrAmount, _ChromAberrAlpha; + #endif + + #if GLITCH_ON + half _GlitchAmount, _GlitchSize; + #endif + + #if FLICKER_ON + half _FlickerFreq, _FlickerPercent, _FlickerAlpha; + #endif + + #if SHADOW_ON + half _ShadowX, _ShadowY, _ShadowAlpha; + half4 _ShadowColor; + #endif + + #if SHINE_ON + half4 _ShineColor; + half _ShineLocation, _ShineRotate, _ShineWidth, _ShineGlow; + #endif + + #if CONTRAST_ON + half _Contrast, _Brightness; + #endif + + #if OVERLAY_ON + half4 _OverlayTex_ST, _OverlayColor; + half _OverlayGlow, _OverlayBlend, _OverlayTextureScrollXSpeed, _OverlayTextureScrollYSpeed; + #endif + + #if DOODLE_ON + half _HandDrawnAmount, _HandDrawnSpeed; + #endif + + #if WIND_ON + half _GrassSpeed, _GrassWind, _GrassManualAnim, _GrassRadialBend; + #endif + + #if WAVEUV_ON + float _WaveAmount, _WaveSpeed, _WaveStrength, _WaveX, _WaveY; + #endif + + #if ROUNDWAVEUV_ON + half _RoundWaveStrength, _RoundWaveSpeed; + #endif + + #if RECTSIZE_ON + half _RectSize; + #endif + + #if OFFSETUV_ON + half _OffsetUvX, _OffsetUvY; + #endif + + #if CLIPPING_ON + half _ClipUvLeft, _ClipUvRight, _ClipUvUp, _ClipUvDown; + #endif + + #if RADIALCLIPPING_ON + half _RadialStartAngle, _RadialClip, _RadialClip2; + #endif + + #if TEXTURESCROLL_ON + half _TextureScrollXSpeed, _TextureScrollYSpeed; + #endif + + #if ZOOMUV_ON + half _ZoomUvAmount; + #endif + + #if WARP_ON + half _WarpStrength, _WarpSpeed, _WarpScale; + #endif + + #if TWISTUV_ON + half _TwistUvAmount, _TwistUvPosX, _TwistUvPosY, _TwistUvRadius; + #endif + + #if ROTATEUV_ON + half _RotateUvAmount; + #endif + + #if FISHEYE_ON + half _FishEyeUvAmount; + #endif + + #if PINCH_ON + half _PinchUvAmount; + #endif + + #if SHAKEUV_ON + half _ShakeUvSpeed, _ShakeUvX, _ShakeUvY; + #endif + + #if NORMALMAP_ON + half _NormalStrength; + #endif + + float _RandomSeed; + + + + + CBUFFER_END + + + + // -- Property used by ScenePickingPass + #ifdef SCENEPICKINGPASS + float4 _SelectionID; + #endif + + // -- Properties used by SceneSelectionPass + #ifdef SCENESELECTIONPASS + int _ObjectId; + int _PassValue; + #endif + + + // data across stages, stripped like the above. + struct VertexToPixel + { + float4 pos : SV_POSITION; + float3 worldPos : TEXCOORD0; + float3 worldNormal : TEXCOORD1; + float4 worldTangent : TEXCOORD2; + float4 texcoord0 : TEXCOORD3; + float4 texcoord1 : TEXCOORD4; + float4 texcoord2 : TEXCOORD5; + // #if %TEXCOORD3REQUIREKEY% + float4 texcoord3 : TEXCOORD6; + // #endif + + // #if %SCREENPOSREQUIREKEY% + // float4 screenPos : TEXCOORD7; + // #endif + + // #if %VERTEXCOLORREQUIREKEY% + float4 vertexColor : COLOR; + // #endif + + // #if %EXTRAV2F0REQUIREKEY% + // float4 extraV2F0 : TEXCOORD8; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // float4 extraV2F1 : TEXCOORD9; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // float4 extraV2F2 : TEXCOORD10; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // float4 extraV2F3 : TEXCOORD11; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // float4 extraV2F4 : TEXCOORD12; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // float4 extraV2F5 : TEXCOORD13; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // float4 extraV2F6 : TEXCOORD14; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // float4 extraV2F7 : TEXCOORD15; + // #endif + + #if UNITY_ANY_INSTANCING_ENABLED + UNITY_VERTEX_INPUT_INSTANCE_ID + #endif // UNITY_ANY_INSTANCING_ENABLED + + #if _HDRP && (_PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR))) + float4 previousPositionCS : TEXCOORD16; // Contain previous transform position (in case of skinning for example) + float4 motionVectorCS : TEXCOORD17; + #endif + + UNITY_VERTEX_OUTPUT_STEREO + }; + + + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Debug/DebugDisplay.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/Material.hlsl" + #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/NormalSurfaceGradient.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Lighting/Lighting.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Lighting/LightLoop/LightLoopDef.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/Lit/Lit.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Lighting/LightLoop/LightLoop.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/BuiltinUtilities.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/MaterialUtilities.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/Decal/DecalUtilities.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/Lit/LitDecalData.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/ShaderGraphFunctions.hlsl" + + + + + // data describing the user output of a pixel + struct Surface + { + half3 Albedo; + half Height; + half3 Normal; + half Smoothness; + half3 Emission; + half Metallic; + half3 Specular; + half Occlusion; + half SpecularPower; // for simple lighting + half Alpha; + float outputDepth; // if written, SV_Depth semantic is used. ShaderData.clipPos.z is unused value + // HDRP Only + half SpecularOcclusion; + half SubsurfaceMask; + half Thickness; + half CoatMask; + half CoatSmoothness; + half Anisotropy; + half IridescenceMask; + half IridescenceThickness; + int DiffusionProfileHash; + float SpecularAAThreshold; + float SpecularAAScreenSpaceVariance; + // requires _OVERRIDE_BAKEDGI to be defined, but is mapped in all pipelines + float3 DiffuseGI; + float3 BackDiffuseGI; + float3 SpecularGI; + float ior; + float3 transmittanceColor; + float atDistance; + float transmittanceMask; + // requires _OVERRIDE_SHADOWMASK to be defines + float4 ShadowMask; + + // for decals + float NormalAlpha; + float MAOSAlpha; + + + }; + + // Data the user declares in blackboard blocks + struct Blackboard + { + + float blackboardDummyData; + }; + + // data the user might need, this will grow to be big. But easy to strip + struct ShaderData + { + float4 clipPos; // SV_POSITION + float3 localSpacePosition; + float3 localSpaceNormal; + float3 localSpaceTangent; + + float3 worldSpacePosition; + float3 worldSpaceNormal; + float3 worldSpaceTangent; + float tangentSign; + + float3 worldSpaceViewDir; + float3 tangentSpaceViewDir; + + float4 texcoord0; + float4 texcoord1; + float4 texcoord2; + float4 texcoord3; + + float2 screenUV; + float4 screenPos; + + float4 vertexColor; + bool isFrontFace; + + float4 extraV2F0; + float4 extraV2F1; + float4 extraV2F2; + float4 extraV2F3; + float4 extraV2F4; + float4 extraV2F5; + float4 extraV2F6; + float4 extraV2F7; + + float3x3 TBNMatrix; + Blackboard blackboard; + }; + + struct VertexData + { + #if SHADER_TARGET > 30 + // uint vertexID : SV_VertexID; + #endif + float4 vertex : POSITION; + float3 normal : NORMAL; + float4 tangent : TANGENT; + float4 texcoord0 : TEXCOORD0; + + // optimize out mesh coords when not in use by user or lighting system + #if _URP && (_USINGTEXCOORD1 || _PASSMETA || _PASSFORWARD || _PASSGBUFFER) + float4 texcoord1 : TEXCOORD1; + #endif + + #if _URP && (_USINGTEXCOORD2 || _PASSMETA || ((_PASSFORWARD || _PASSGBUFFER) && defined(DYNAMICLIGHTMAP_ON))) + float4 texcoord2 : TEXCOORD2; + #endif + + #if _STANDARD && (_USINGTEXCOORD1 || (_PASSMETA || ((_PASSFORWARD || _PASSGBUFFER || _PASSFORWARDADD) && LIGHTMAP_ON))) + float4 texcoord1 : TEXCOORD1; + #endif + #if _STANDARD && (_USINGTEXCOORD2 || (_PASSMETA || ((_PASSFORWARD || _PASSGBUFFER) && DYNAMICLIGHTMAP_ON))) + float4 texcoord2 : TEXCOORD2; + #endif + + + #if _HDRP + float4 texcoord1 : TEXCOORD1; + float4 texcoord2 : TEXCOORD2; + #endif + + // #if %TEXCOORD3REQUIREKEY% + float4 texcoord3 : TEXCOORD3; + // #endif + + // #if %VERTEXCOLORREQUIREKEY% + float4 vertexColor : COLOR; + // #endif + + #if _PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR)) + float3 previousPositionOS : TEXCOORD4; // Contain previous transform position (in case of skinning for example) + #if defined (_ADD_PRECOMPUTED_VELOCITY) + float3 precomputedVelocity : TEXCOORD5; // Add Precomputed Velocity (Alembic computes velocities on runtime side). + #endif + #endif + + UNITY_VERTEX_INPUT_INSTANCE_ID + }; + + struct TessVertex + { + float4 vertex : INTERNALTESSPOS; + float3 normal : NORMAL; + float4 tangent : TANGENT; + float4 texcoord0 : TEXCOORD0; + float4 texcoord1 : TEXCOORD1; + float4 texcoord2 : TEXCOORD2; + + // #if %TEXCOORD3REQUIREKEY% + float4 texcoord3 : TEXCOORD3; + // #endif + + // #if %VERTEXCOLORREQUIREKEY% + float4 vertexColor : COLOR; + // #endif + + // #if %EXTRAV2F0REQUIREKEY% + // float4 extraV2F0 : TEXCOORD5; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // float4 extraV2F1 : TEXCOORD6; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // float4 extraV2F2 : TEXCOORD7; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // float4 extraV2F3 : TEXCOORD8; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // float4 extraV2F4 : TEXCOORD9; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // float4 extraV2F5 : TEXCOORD10; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // float4 extraV2F6 : TEXCOORD11; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // float4 extraV2F7 : TEXCOORD12; + // #endif + + #if _PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR)) + float3 previousPositionOS : TEXCOORD13; // Contain previous transform position (in case of skinning for example) + #if defined (_ADD_PRECOMPUTED_VELOCITY) + float3 precomputedVelocity : TEXCOORD14; + #endif + #endif + + UNITY_VERTEX_INPUT_INSTANCE_ID + UNITY_VERTEX_OUTPUT_STEREO + }; + + struct ExtraV2F + { + float4 extraV2F0; + float4 extraV2F1; + float4 extraV2F2; + float4 extraV2F3; + float4 extraV2F4; + float4 extraV2F5; + float4 extraV2F6; + float4 extraV2F7; + Blackboard blackboard; + float4 time; + }; + + + float3 WorldToTangentSpace(ShaderData d, float3 normal) + { + return mul(d.TBNMatrix, normal); + } + + float3 TangentToWorldSpace(ShaderData d, float3 normal) + { + return mul(normal, d.TBNMatrix); + } + + // in this case, make standard more like SRPs, because we can't fix + // unity_WorldToObject in HDRP, since it already does macro-fu there + + #if _STANDARD + float3 TransformWorldToObject(float3 p) { return mul(unity_WorldToObject, float4(p, 1)); }; + float3 TransformObjectToWorld(float3 p) { return mul(unity_ObjectToWorld, float4(p, 1)); }; + float4 TransformWorldToObject(float4 p) { return mul(unity_WorldToObject, p); }; + float4 TransformObjectToWorld(float4 p) { return mul(unity_ObjectToWorld, p); }; + float4x4 GetWorldToObjectMatrix() { return unity_WorldToObject; } + float4x4 GetObjectToWorldMatrix() { return unity_ObjectToWorld; } + #if (defined(SHADER_API_D3D11) || defined(SHADER_API_XBOXONE) || defined(UNITY_COMPILER_HLSLCC) || defined(SHADER_API_PSSL) || (SHADER_TARGET_SURFACE_ANALYSIS && !SHADER_TARGET_SURFACE_ANALYSIS_MOJOSHADER)) + #define UNITY_SAMPLE_TEX2D_LOD(tex,coord, lod) tex.SampleLevel (sampler##tex,coord, lod) + #define UNITY_SAMPLE_TEX2D_SAMPLER_LOD(tex,samplertex,coord, lod) tex.SampleLevel (sampler##samplertex,coord, lod) + #else + #define UNITY_SAMPLE_TEX2D_LOD(tex,coord,lod) tex2D (tex,coord,0,lod) + #define UNITY_SAMPLE_TEX2D_SAMPLER_LOD(tex,samplertex,coord,lod) tex2D (tex,coord,0,lod) + #endif + + #undef GetWorldToObjectMatrix() + + #define GetWorldToObjectMatrix() unity_WorldToObject + + + #endif + + float3 GetCameraWorldPosition() + { + #if _HDRP + return GetCameraRelativePositionWS(_WorldSpaceCameraPos); + #else + return _WorldSpaceCameraPos; + #endif + } + + #if _GRABPASSUSED + #if _STANDARD + TEXTURE2D(%GRABTEXTURE%); + SAMPLER(sampler_%GRABTEXTURE%); + #endif + + half3 GetSceneColor(float2 uv) + { + #if _STANDARD + return SAMPLE_TEXTURE2D(%GRABTEXTURE%, sampler_%GRABTEXTURE%, uv).rgb; + #else + return SHADERGRAPH_SAMPLE_SCENE_COLOR(uv); + #endif + } + #endif + + + + #if _STANDARD + UNITY_DECLARE_DEPTH_TEXTURE(_CameraDepthTexture); + float GetSceneDepth(float2 uv) { return SAMPLE_DEPTH_TEXTURE(_CameraDepthTexture, uv); } + float GetLinear01Depth(float2 uv) { return Linear01Depth(GetSceneDepth(uv)); } + float GetLinearEyeDepth(float2 uv) { return LinearEyeDepth(GetSceneDepth(uv)); } + #else + float GetSceneDepth(float2 uv) { return SHADERGRAPH_SAMPLE_SCENE_DEPTH(uv); } + float GetLinear01Depth(float2 uv) { return Linear01Depth(GetSceneDepth(uv), _ZBufferParams); } + float GetLinearEyeDepth(float2 uv) { return LinearEyeDepth(GetSceneDepth(uv), _ZBufferParams); } + #endif + + float3 GetWorldPositionFromDepthBuffer(float2 uv, float3 worldSpaceViewDir) + { + float eye = GetLinearEyeDepth(uv); + float3 camView = mul((float3x3)GetObjectToWorldMatrix(), transpose(mul(GetWorldToObjectMatrix(), UNITY_MATRIX_I_V)) [2].xyz); + + float dt = dot(worldSpaceViewDir, camView); + float3 div = worldSpaceViewDir/dt; + float3 wpos = (eye * div) + GetCameraWorldPosition(); + return wpos; + } + + #if _HDRP + float3 ObjectToWorldSpacePosition(float3 pos) + { + return GetAbsolutePositionWS(TransformObjectToWorld(pos)); + } + #else + float3 ObjectToWorldSpacePosition(float3 pos) + { + return TransformObjectToWorld(pos); + } + #endif + + #if _STANDARD + UNITY_DECLARE_SCREENSPACE_TEXTURE(_CameraDepthNormalsTexture); + float3 GetSceneNormal(float2 uv, float3 worldSpaceViewDir) + { + float4 depthNorms = UNITY_SAMPLE_SCREENSPACE_TEXTURE(_CameraDepthNormalsTexture, uv); + float3 norms = DecodeViewNormalStereo(depthNorms); + norms = mul((float3x3)GetWorldToViewMatrix(), norms) * 0.5 + 0.5; + return norms; + } + #elif _HDRP && !_DECALSHADER + + float3 GetSceneNormal(float2 uv, float3 worldSpaceViewDir) + { + NormalData nd; + DecodeFromNormalBuffer(_ScreenSize.xy * uv, nd); + return nd.normalWS; + } + #elif _URP + #if (SHADER_LIBRARY_VERSION_MAJOR >= 10) + #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/DeclareNormalsTexture.hlsl" + #endif + + float3 GetSceneNormal(float2 uv, float3 worldSpaceViewDir) + { + #if (SHADER_LIBRARY_VERSION_MAJOR >= 10) + return SampleSceneNormals(uv); + #else + float3 wpos = GetWorldPositionFromDepthBuffer(uv, worldSpaceViewDir); + return normalize(-cross(ddx(wpos), ddy(wpos))) * 0.5 + 0.5; + #endif + + } + #endif + + #if _HDRP + + half3 UnpackNormalmapRGorAG(half4 packednormal) + { + // This do the trick + packednormal.x *= packednormal.w; + + half3 normal; + normal.xy = packednormal.xy * 2 - 1; + normal.z = sqrt(1 - saturate(dot(normal.xy, normal.xy))); + return normal; + } + half3 UnpackNormal(half4 packednormal) + { + #if defined(UNITY_NO_DXT5nm) + return packednormal.xyz * 2 - 1; + #else + return UnpackNormalmapRGorAG(packednormal); + #endif + } + #endif + #if _HDRP || _URP + + half3 UnpackScaleNormal(half4 packednormal, half scale) + { + #ifndef UNITY_NO_DXT5nm + // Unpack normal as DXT5nm (1, y, 1, x) or BC5 (x, y, 0, 1) + // Note neutral texture like "bump" is (0, 0, 1, 1) to work with both plain RGB normal and DXT5nm/BC5 + packednormal.x *= packednormal.w; + #endif + half3 normal; + normal.xy = (packednormal.xy * 2 - 1) * scale; + normal.z = sqrt(1 - saturate(dot(normal.xy, normal.xy))); + return normal; + } + + #endif + + + void GetSun(out float3 lightDir, out float3 color) + { + lightDir = float3(0.5, 0.5, 0); + color = 1; + #if _HDRP + if (_DirectionalLightCount > 0) + { + DirectionalLightData light = _DirectionalLightDatas[0]; + lightDir = -light.forward.xyz; + color = light.color; + } + #elif _STANDARD + lightDir = normalize(_WorldSpaceLightPos0.xyz); + color = _LightColor0.rgb; + #elif _URP + Light light = GetMainLight(); + lightDir = light.direction; + color = light.color; + #endif + } + + + + + + + + + + TEXTURE2D(_MainTex); + SAMPLER(sampler_MainTex); + + #if GLOW_ON + TEXTURE2D(_GlowTex); + SAMPLER(sampler_GlowTex); + #endif + + #if FADE_ON + TEXTURE2D(_FadeTex); + SAMPLER(sampler_FadeTex); + + TEXTURE2D(_FadeBurnTex); + SAMPLER(sampler_FadeBurnTex); + #endif + + #if DISTORT_ON + TEXTURE2D(_DistortTex); + SAMPLER(sampler_DistortTex); + #endif + + #if OUTTEX_ON + TEXTURE2D(_OutlineTex); + SAMPLER(sampler_OutlineTex); + #endif + + #if OUTDIST_ON + TEXTURE2D(_OutlineDistortTex); + SAMPLER(sampler_OutlineDistortTex); + #endif + + #if COLORSWAP_ON + TEXTURE2D(_ColorSwapTex); + SAMPLER(sampler_ColorSwapTex); + #endif + + #if COLORRAMP_ON + TEXTURE2D(_ColorRampTex); + TEXTURE2D(_ColorRampTexGradient); + SAMPLER(sampler_ColorRampTex); + SAMPLER(sampler_ColorRampTexGradient); + #endif + + #if SHINE_ON + TEXTURE2D(_ShineMask); + SAMPLER(sampler_ShineMask); + #endif + + #if OVERLAY_ON + TEXTURE2D(_OverlayTex); + SAMPLER(sampler_OverlayTex); + #endif + + #if NORMALMAP_ON + TEXTURE2D(_NormalMap); + SAMPLER(sampler_NormalMap); + #endif + + + half3 GetPixel(in int offsetX, in int offsetY, in half2 uv, in Texture2D _tex, in SamplerState _sampler) + { + half2 _uv = uv + half2(offsetX * _MainTex_TexelSize.x, offsetY * _MainTex_TexelSize.y); + half4 col = SAMPLE_TEXTURE2D(_tex, _sampler, _uv); + return col.rgb; + } + + + //BLURS------------------------------------------------------------------------- + half4 Blur(half2 uv, Texture2D source, SamplerState sampler_source, half Intensity) + { + const half2 texelSize = 1.0 / _ScreenParams.xy; + const half4 color = SAMPLE_TEXTURE2D(source, sampler_source, uv); + const half2 offset = Intensity * texelSize; + + half4 accumulatedColor = color; + half accumulatedWeight = 1.0; + for (int x = -1; x <= 1; x++) + { + for (int y = -1; y <= 1; y++) + { + const half2 sampleUV = uv + half2(x, y) * offset; + const half4 sampleColor = SAMPLE_TEXTURE2D(source, sampler_source, sampleUV); + + accumulatedColor += sampleColor; + accumulatedWeight += 1.0; + } + } + + half4 blurredColor = accumulatedColor / accumulatedWeight; + return blurredColor; + } + + half BlurHD_G(half bhqp, half x) + { + return exp(-(x * x) / (2.0 * bhqp * bhqp)); + } + half4 BlurHD(half2 uv, Texture2D source, SamplerState sampler_source, half BlurAmount, half xScale, half yScale) + { + int iterations = 16; + int halfIterations = iterations / 2; + half sigmaX = 0.1 + BlurAmount * 0.5; + half sigmaY = sigmaX; + half total = 0.0; + half4 ret = half4(0, 0, 0, 0); + for (int iy = 0; iy < iterations; ++iy) + { + half fy = BlurHD_G(sigmaY, half(iy) -half(halfIterations)); + half offsetY = half(iy - halfIterations) * 0.00390625 * xScale; + for (int ix = 0; ix < iterations; ++ix) + { + half fx = BlurHD_G(sigmaX, half(ix) - half(halfIterations)); + half offsetX = half(ix - halfIterations) * 0.00390625 * yScale; + total += fx * fy; + ret += SAMPLE_TEXTURE2D(source, sampler_source, uv + half2(offsetX, offsetY)) * fx * fy; + } + } + return ret / total; + } + //----------------------------------------------------------------------- + + + //------------------------------------------- + half RemapFloat(half inValue, half inMin, half inMax, half outMin, half outMax){ + return outMin + (inValue - inMin) * (outMax - outMin) / (inMax - inMin); + } + //------------------------------------------- + + //----------------------------------------------------------------------- + half rand(half2 seed, half offset) { + return (frac(sin(dot(seed, half2(12.9898, 78.233))) * 43758.5453) + offset) % 1.0; + } + + half rand2(half2 seed, half offset) { + return (frac(sin(dot(seed * floor(50 + (_Time.x % 1.0) * 12.), half2(127.1, 311.7))) * 43758.5453123) + offset) % 1.0; + } + + half rand2CustomTime(half2 seed, half offset, half customTime) { + return (frac(sin(dot(seed * floor(50 + (customTime % 1.0) * 12.), half2(127.1, 311.7))) * 43758.5453123) + offset) % 1.0; + } + //----------------------------------------------------------------------- + + + void Ext_ModifyVertex0 (inout VertexData v, inout ExtraV2F d) + { + //BILBOARD_ON + #if BILBOARD_ON + half3 camRight = mul((half3x3)unity_CameraToWorld, half3(1,0,0)); + half3 camUp = half3(0,1,0); + #if BILBOARDY_ON + camUp = mul((half3x3)unity_CameraToWorld, half3(0,1,0)); + #endif + half3 localPos = v.vertex.x * camRight + v.vertex.y * camUp; + v.vertex = half4(localPos, 1); + #endif + //----------------------------------------------------------- + + v.texcoord0.xy = TRANSFORM_TEX(v.texcoord0.xy, _MainTex); + half2 center = half2(0.5, 0.5); + #if ATLAS_ON + center = half2((_MaxXUV + _MinXUV) / 2.0, (_MaxYUV + _MinYUV) / 2.0); + #endif + + //POLARUV_ON + #if POLARUV_ON + v.texcoord0.xy = v.texcoord0.xy - center; + #endif + + //---------------------------------------- + + //ROTATEUV_ON + #if ROTATEUV_ON + half2 uvC = v.texcoord0.xy; + half cosAngle = cos(_RotateUvAmount); + half sinAngle = sin(_RotateUvAmount); + half2x2 rot = half2x2(cosAngle, -sinAngle, sinAngle, cosAngle); + uvC -= center; + v.texcoord0.xy = mul(rot, uvC); + v.texcoord0.xy += center; + #endif + //-------------------- + + #if RECTSIZE_ON + v.vertex.xyz += (v.vertex.xyz * (_RectSize - 1.0)); + #endif + + #if OUTTEX_ON + v.texcoord1.xy = TRANSFORM_TEX(v.texcoord0.xy, _OutlineTex); + #endif + + #if OUTDIST_ON + v.texcoord2.xy = TRANSFORM_TEX(v.texcoord0.xy, _OutlineDistortTex); + #endif + + #if DISTORT_ON + v.texcoord3.xy = TRANSFORM_TEX(v.texcoord0.xy, _DistortTex); + #endif + } + + void Ext_SurfaceFunction0 (inout Surface o, ShaderData d) + { + half randomSeed = _RandomSeed; + + float2 uvRect = d.texcoord0; + half2 center = half2(0.5, 0.5); + #if ATLAS_ON + center = half2((_MaxXUV + _MinXUV) / 2.0, (_MaxYUV + _MinYUV) / 2.0); + uvRect = half2((d.texcoord0.x - _MinXUV) / (_MaxXUV - _MinXUV), (d.texcoord0.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half2 centerTiled = half2(center.x * _MainTex_ST.x, center.y * _MainTex_ST.y); + + //CLIPPING_ON + #if CLIPPING_ON + half2 tiledUv = half2(d.texcoord0.x / _MainTex_ST.x, d.texcoord0.y / _MainTex_ST.y); + #if ATLAS_ON + tiledUv = half2((tiledUv.x - _MinXUV) / (_MaxXUV - _MinXUV), (tiledUv.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + clip((1 - _ClipUvUp) - tiledUv.y); + clip(tiledUv.y - _ClipUvDown); + clip((1 - _ClipUvRight) - tiledUv.x); + clip(tiledUv.x - _ClipUvLeft); + #endif + //---------------------------------- + + //RADIALCLIPPING_ON + #if RADIALCLIPPING_ON + half2 tiledUv2 = half2(d.texcoord0.x / _MainTex_ST.x, d.texcoord0.y / _MainTex_ST.y); + #if ATLAS_ON + tiledUv2 = half2((tiledUv2.x - _MinXUV) / (_MaxXUV - _MinXUV), (tiledUv2.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half startAngle = _RadialStartAngle - _RadialClip; + half endAngle = _RadialStartAngle + _RadialClip2; + half offset0 = clamp(0, 360, startAngle + 360); + half offset360 = clamp(0, 360, endAngle - 360); + half2 atan2Coord = half2(lerp(-1, 1, tiledUv2.x), lerp(-1, 1, tiledUv2.y)); + half atanAngle = atan2(atan2Coord.y, atan2Coord.x) * 57.3; // angle in degrees + if(atanAngle < 0) atanAngle = 360 + atanAngle; + if(atanAngle >= startAngle && atanAngle <= endAngle) discard; + if(atanAngle <= offset360) discard; + if(atanAngle >= offset0) discard; + #endif + + //----------------------------- + + //TEXTURESCROLL_ON && ATLAS_ON + #if TEXTURESCROLL_ON && ATLAS_ON + d.texcoord0.xy = half2(_MinXUV + ((_MaxXUV - _MinXUV) * (abs(((_Time.y + randomSeed) * _TextureScrollXSpeed) + uvRect.x) % 1)), + _MinYUV + ((_MaxYUV - _MinYUV) * (abs(((_Time.y + randomSeed) * _TextureScrollYSpeed) + uvRect.y) % 1))); + #endif + //---------------------------- + + //OFFSETUV_ON + #if OFFSETUV_ON + #if ATLAS_ON + d.texcoord0.xy = half2(_MinXUV + ((_MaxXUV - _MinXUV) * (abs((_OffsetUvX + uvRect.x) % 1))), + _MinYUV + ((_MaxYUV - _MinYUV) * (abs(_OffsetUvY + uvRect.y) % 1))); + #else + d.texcoord0.xy += half2(_OffsetUvX, _OffsetUvY); + #endif + #endif + + //---------------------- + + //POLARUV_ON + #if POLARUV_ON + d.texcoord0.xy = half2(atan2(d.texcoord0.y, d.texcoord0.x) / (2.0f * 3.141592653589f), length(d.texcoord0.xy)); + d.texcoord0.xy *= _MainTex_ST.xy; + #endif + + //-------------------------------------- + + //TWISTUV_ON + #if TWISTUV_ON + #if ATLAS_ON + _TwistUvPosX = ((_MaxXUV - _MinXUV) * _TwistUvPosX) + _MinXUV; + _TwistUvPosY = ((_MaxYUV - _MinYUV) * _TwistUvPosY) + _MinYUV; + #endif + half2 tempUv = d.texcoord0.xy - half2(_TwistUvPosX * _MainTex_ST.x, _TwistUvPosY * _MainTex_ST.y); + _TwistUvRadius *= (_MainTex_ST.x + _MainTex_ST.y) / 2; + half percent = (_TwistUvRadius - length(tempUv)) / _TwistUvRadius; + half theta = percent * percent * (2.0 * sin(_TwistUvAmount)) * 8.0; + half s = sin(theta); + half c = cos(theta); + half beta = max(sign(_TwistUvRadius - length(tempUv)), 0.0); + tempUv = half2(dot(tempUv, half2(c, -s)), dot(tempUv, half2(s, c))) * beta + tempUv * (1 - beta); + tempUv += half2(_TwistUvPosX * _MainTex_ST.x, _TwistUvPosY * _MainTex_ST.y); + d.texcoord0.xy = tempUv; + #endif + + //-------------------------------------------- + + //FISHEYE_ON + #if FISHEYE_ON + half bind = length(centerTiled); + half2 dF = d.texcoord0.xy - centerTiled; + half dFlen = length(dF); + half fishInt = (3.14159265359 / bind) * (_FishEyeUvAmount + 0.001); + d.texcoord0.xy = centerTiled + (dF / (max(0.0001, dFlen))) * tan(dFlen * fishInt) * bind / tan(bind * fishInt); + #endif + //--------------------------------------------- + + //PINCH_ON + #if PINCH_ON + half2 dP = d.texcoord0.xy - centerTiled; + half pinchInt = (3.141592 / length(centerTiled)) * (-_PinchUvAmount + 0.001); + d.texcoord0.xy = centerTiled + normalize(dP) * atan(length(dP) * -pinchInt * 10.0) * 0.5 / atan(-pinchInt * 5); + #endif + + //--------------------------------------------- + + //ZOOMUV_ON + #if ZOOMUV_ON + d.texcoord0.xy -= centerTiled; + d.texcoord0.xy = d.texcoord0.xy * _ZoomUvAmount; + d.texcoord0.xy += centerTiled; + #endif + + //----------------------------------------------- + + //DOODLE_ON + #if DOODLE_ON + half2 uvCopy = uvRect; + _HandDrawnSpeed = (floor((_Time.x + randomSeed) * 20 * _HandDrawnSpeed) / _HandDrawnSpeed) * _HandDrawnSpeed; + uvCopy.x = sin((uvCopy.x * _HandDrawnAmount + _HandDrawnSpeed) * 4); + uvCopy.y = cos((uvCopy.y * _HandDrawnAmount + _HandDrawnSpeed) * 4); + d.texcoord0.xy = lerp(d.texcoord0.xy, d.texcoord0.xy + uvCopy, 0.0005 * _HandDrawnAmount); + #endif + + //-------------------------- + + //SHAKEUV_ON + #if SHAKEUV_ON + half xShake = sin((_Time.x + randomSeed) * _ShakeUvSpeed * 50) * _ShakeUvX; + half yShake = cos((_Time.x + randomSeed) * _ShakeUvSpeed * 50) * _ShakeUvY; + d.texcoord0.xy += half2(xShake * 0.012, yShake * 0.01); + #endif + + //------------------------------------------- + + //RECTSIZE_ON + #if RECTSIZE_ON + d.texcoord0.xy = d.texcoord0.xy * (_RectSize).xx + (((-_RectSize * 0.5) + 0.5)).xx; + #endif + + //------------------------------------------- + + //DISTORT_ON + #if DISTORT_ON + #if ATLAS_ON + d.texcoord3.x = d.texcoord3.x * (1 / (_MaxXUV - _MinXUV)); + d.texcoord3.y = d.texcoord3.y * (1 / (_MaxYUV - _MinYUV)); + #endif + + d.texcoord3.x += ((_Time.x + _RandomSeed) * _DistortTexXSpeed) % 1; + d.texcoord3.y += ((_Time.x + _RandomSeed) * _DistortTexYSpeed) % 1; + half distortAmnt = (SAMPLE_TEXTURE2D(_DistortTex, sampler_DistortTex, d.texcoord3.xy).r - 0.5) * 0.2 * _DistortAmount; + d.texcoord0.x += distortAmnt; + d.texcoord0.y += distortAmnt; + #endif + //------------------------------------------------------- + + //WARP_ON + #if WARP_ON + half2 warpUv = half2(d.texcoord0.x / _MainTex_ST.x, d.texcoord0.y / _MainTex_ST.y); + #if ATLAS_ON + warpUv = half2((warpUv.x - _MinXUV) / (_MaxXUV - _MinXUV), (warpUv.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + const float tau = 6.283185307179586; + float xWarp = (_Time.y + randomSeed) * _WarpSpeed + warpUv.x * tau / _WarpScale; + float yWarp = (_Time.y + randomSeed) * _WarpSpeed + warpUv.y * tau / _WarpScale; + float2 warp = float2(sin(xWarp), sin(yWarp)) * _WarpStrength; + d.texcoord0.xy += warp; + #endif + + //------------------------------------------------------- + + //WAVEUV_ON + #if WAVEUV_ON + float2 uvWave = half2(_WaveX * _MainTex_ST.x, _WaveY * _MainTex_ST.y) - d.texcoord0.xy; + uvWave %= 1; + #if ATLAS_ON + uvWave = half2(_WaveX, _WaveY) - uvRect; + #endif + uvWave.x *= _ScreenParams.x / _ScreenParams.y; + float waveTime = _Time.y + randomSeed; + float angWave = (sqrt(dot(uvWave, uvWave)) * _WaveAmount) - ((waveTime * _WaveSpeed)); + d.texcoord0.xy = d.texcoord0.xy + uvWave * sin(angWave) * (_WaveStrength / 1000.0); + #endif + //---------------------------------------------------- + + //ROUNDWAVEUV_ON + #if ROUNDWAVEUV_ON + half xWave = ((0.5 * _MainTex_ST.x) - uvRect.x); + half yWave = ((0.5 * _MainTex_ST.y) - uvRect.y) * (_MainTex_TexelSize.w / _MainTex_TexelSize.z); + half ripple = -sqrt(xWave*xWave + yWave* yWave); + d.texcoord0.xy += (sin((ripple + (_Time.y + randomSeed) * (_RoundWaveSpeed/10.0)) / 0.015) * (_RoundWaveStrength/10.0)) % 1; + #endif + //---------------------------------------------------- + + + //WIND_ON + #if WIND_ON + half windOffset = sin((_Time.x + randomSeed) * _GrassSpeed * 10); + half2 windCenter = half2(0.5, 0.1); + #if ATLAS_ON + windCenter.x = ((_MaxXUV - _MinXUV) * windCenter.x) + _MinXUV; + windCenter.y = ((_MaxYUV - _MinYUV) * windCenter.y) + _MinYUV; + #endif + #if !MANUALWIND_ON + d.texcoord0.x = fmod(abs(lerp(d.texcoord0.x, d.texcoord0.x + (_GrassWind * 0.01 * windOffset), uvRect.y)), 1); + #else + d.texcoord0.x = fmod(abs(lerp(d.texcoord0.x, d.texcoord0.x + (_GrassWind * 0.01 * _GrassManualAnim), uvRect.y)), 1); + windOffset = _GrassManualAnim; + #endif + half2 delta = d.texcoord0.xy - windCenter; + half delta2 = dot(delta.xy, delta.xy); + half2 delta_offset = delta2 * windOffset; + d.texcoord0.xy = d.texcoord0.xy + half2(delta.y, -delta.x) * delta_offset * _GrassRadialBend; + #endif + + //-------------------------------------------------------- + + //TEXTURESCROLL_ON && !ATLAS_ON + #if TEXTURESCROLL_ON && !ATLAS_ON + d.texcoord0.x += ((_Time.y + randomSeed) * _TextureScrollXSpeed) % 1; + d.texcoord0.y += ((_Time.y + randomSeed) * _TextureScrollYSpeed) % 1; + #endif + //------------------------------ + + //PIXELATE_ON + #if PIXELATE_ON + half aspectRatio = _MainTex_TexelSize.x / _MainTex_TexelSize.y; + half2 pixelSize = float2(_PixelateSize, _PixelateSize * aspectRatio); + d.texcoord0.xy = floor(d.texcoord0.xy * pixelSize) / pixelSize; + #endif + //-------------- + + half4 col = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy); + half originalAlpha = col.a; + col *= d.vertexColor; + + //NORMAL MAP + #if NORMALMAP_ON + half4 normalSample = SAMPLE_TEXTURE2D(_NormalMap, sampler_NormalMap, d.texcoord0.xy); + half3 normalTS = UnpackNormal(normalSample); + normalTS.xy *= _NormalStrength; + o.Normal = normalTS; + #endif + + + //GLITCH_ON + #if GLITCH_ON + half2 uvGlitch = uvRect; + uvGlitch.y -= 0.5; + half lineNoise = pow(rand2(floor(uvGlitch * half2(24., 19.) * _GlitchSize) * 4.0, randomSeed), 3.0) * _GlitchAmount + * pow(rand2(floor(uvGlitch * half2(38., 14.) * _GlitchSize) * 4.0, randomSeed), 3.0); + col = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(lineNoise * 0.02 * rand2(half2(2.0, 1), randomSeed), 0)) * d.vertexColor; + #endif + //-------------------------------------- + + //CHROMABERR_ON + #if CHROMABERR_ON + half4 r = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(_ChromAberrAmount/10, 0)) * d.vertexColor; + half4 b = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(-_ChromAberrAmount/10, 0)) * d.vertexColor; + col = half4(r.r * r.a, col.g, b.b * b.a, max(max(r.a, b.a) * _ChromAberrAlpha, col.a)); + #endif + + //-------------------------------- + + //BLUR_ON + #if BLUR_ON + #if ATLAS_ON + #if !BLURISHD_ON + col = BlurHD(d.texcoord0.xy, _MainTex, sampler_MainTex, _BlurIntensity, (_MaxXUV - _MinXUV), (_MaxYUV - _MinYUV)) * d.vertexColor; + #else + col = Blur(d.texcoord0.xy, _MainTex, sampler_MainTex, _BlurIntensity * (_MaxXUV - _MinXUV)) * d.vertexColor; + #endif + #else + #if !BLURISHD_ON + col = BlurHD(d.texcoord0.xy, _MainTex, sampler_MainTex, _BlurIntensity, 1, 1) * d.vertexColor; + #else + col = Blur(d.texcoord0.xy, _MainTex, sampler_MainTex, _BlurIntensity) * d.vertexColor; + #endif + #endif + #endif + + //-------------------- + + //MOTIONBLUR_ON + #if MOTIONBLUR_ON + _MotionBlurAngle = _MotionBlurAngle * 3.1415926; + #define rot(n) mul(n, half2x2(cos(_MotionBlurAngle), -sin(_MotionBlurAngle), sin(_MotionBlurAngle), cos(_MotionBlurAngle))) + _MotionBlurDist = _MotionBlurDist * 0.005; + #if ATLAS_ON + _MotionBlurDist *= (_MaxXUV - _MinXUV); + #endif + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(-_MotionBlurDist, -_MotionBlurDist))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(-_MotionBlurDist * 2, -_MotionBlurDist * 2))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(-_MotionBlurDist * 3, -_MotionBlurDist * 3))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(-_MotionBlurDist * 4, -_MotionBlurDist * 4))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(_MotionBlurDist, _MotionBlurDist))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(_MotionBlurDist * 2, _MotionBlurDist * 2))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(_MotionBlurDist * 3, _MotionBlurDist * 3))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(_MotionBlurDist * 4, _MotionBlurDist * 4))); + col.rgb = col.rgb / 9; + #endif + //------------------------------------ + + //NEGATIVE_ON + #if NEGATIVE_ON + col.rgb = lerp(col.rgb, 1 - col.rgb, _NegativeAmount); + #endif + + //-------------- + half luminance = 0; + + //GREYSCALE_ON && !GREYSCALEOUTLINE_ON + #if GREYSCALE_ON && !GREYSCALEOUTLINE_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + luminance = saturate(luminance + _GreyscaleLuminosity); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _GreyscaleTintColor, _GreyscaleBlend); + #endif + //------------------------------------ + + //GHOST_ON + #if GHOST_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + half4 ghostResult; + ghostResult.a = saturate(luminance - _GhostTransparency) * col.a; + ghostResult.rgb = col.rgb * (luminance + _GhostColorBoost); + col = lerp(col, ghostResult, _GhostBlend); + #endif + //------------------------------------ + + //INNEROUTLINE_ON + #if INNEROUTLINE_ON + half3 innerT = abs(GetPixel(0, _InnerOutlineThickness, d.texcoord0.xy, _MainTex, sampler_MainTex) - GetPixel(0, -_InnerOutlineThickness, d.texcoord0.xy, _MainTex, sampler_MainTex)); + innerT += abs(GetPixel(_InnerOutlineThickness, 0, d.texcoord0.xy, _MainTex, sampler_MainTex) - GetPixel(-_InnerOutlineThickness, 0, d.texcoord0.xy, _MainTex, sampler_MainTex)); + #if !ONLYINNEROUTLINE_ON + innerT = (innerT / 2.0) * col.a * _InnerOutlineAlpha; + col.rgb += length(innerT) * _InnerOutlineColor.rgb * _InnerOutlineGlow; + #else + innerT *= col.a * _InnerOutlineAlpha; + col.rgb = length(innerT) * _InnerOutlineColor.rgb * _InnerOutlineGlow; + col.a = step(0.3, col.r+col.g+col.b); + #endif + #endif + //------------------------------------------------------- + + //HITEFFECT_ON + #if HITEFFECT_ON + col.rgb = lerp(col.rgb, _HitEffectColor.rgb * _HitEffectGlow, _HitEffectBlend); + #endif + //-------------------- + + //GRADIENT_ON + #if GRADIENT_ON + half2 tiledUvGrad = half2(uvRect.x / _MainTex_ST.x, uvRect.y / _MainTex_ST.y); + #if GRADIENT2COL_ON + _GradTopRightCol = _GradTopLeftCol; + _GradBotRightCol = _GradBotLeftCol; + #endif + #if RADIALGRADIENT_ON + half radialDist = 1 - length(tiledUvGrad - half2(0.5, 0.5)); + radialDist *= (_MainTex_TexelSize.w / _MainTex_TexelSize.z); + radialDist = saturate(_GradBoostX * radialDist); + half4 gradientResult = lerp(_GradTopLeftCol, _GradBotLeftCol, radialDist); + #else + half gradXLerpFactor = saturate(pow(tiledUvGrad.x, _GradBoostX)); + half4 gradientResult = lerp(lerp(_GradBotLeftCol, _GradBotRightCol, gradXLerpFactor), + lerp(_GradTopLeftCol, _GradTopRightCol, gradXLerpFactor), saturate(pow(tiledUvGrad.y, _GradBoostY))); + #endif + gradientResult = lerp(col, gradientResult, _GradBlend); + col.rgb = gradientResult.rgb * col.a; + col.a *= gradientResult.a; + #endif + //-------------------------------------------------------------------- + + //CONTRAST_ON + #if CONTRAST_ON + col.rgb = (col.rgb - float3(0.5, 0.5, 0.5)) * _Contrast + float3(0.5, 0.5, 0.5); + col.rgb += _Brightness; + #endif + + //------------------------------------------------------------------- + + //COLORSWAP_ON + #if COLORSWAP_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + half4 swapMask = SAMPLE_TEXTURE2D(_ColorSwapTex, sampler_ColorSwapTex, d.texcoord0.xy); + swapMask.rgb *= swapMask.a; + half3 redSwap = _ColorSwapRed * swapMask.r * saturate(luminance + _ColorSwapRedLuminosity); + half3 greenSwap = _ColorSwapGreen * swapMask.g * saturate(luminance + _ColorSwapGreenLuminosity); + half3 blueSwap = _ColorSwapBlue * swapMask.b * saturate(luminance + _ColorSwapBlueLuminosity); + swapMask.rgb = col.rgb * saturate(1 - swapMask.r - swapMask.g - swapMask.b); + col.rgb = lerp(col.rgb, swapMask.rgb + redSwap + greenSwap + blueSwap, _ColorSwapBlend); + #endif + //-------------------------------------------------------------------- + + //COLORRAMP_ON && !COLORRAMPOUTLINE_ON + #if COLORRAMP_ON && !COLORRAMPOUTLINE_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + luminance = saturate(luminance + _ColorRampLuminosity); + #if GRADIENTCOLORRAMP_ON + col.rgb = lerp(col.rgb, SAMPLE_TEXTURE2D(_ColorRampTexGradient, sampler_ColorRampTexGradient, half2(luminance, 0)).rgb, _ColorRampBlend); + #else + col.rgb = lerp(col.rgb, SAMPLE_TEXTURE2D(_ColorRampTex, sampler_ColorRampTex, half2(luminance, 0)).rgb, _ColorRampBlend); + #endif + #endif + //-------------------------------------------------------------------- + + //CHANGECOLOR_ON + #if CHANGECOLOR_ON + float3 currChangeColor = saturate(col.rgb); + luminance = 0.3 * currChangeColor.r + 0.59 * currChangeColor.g + 0.11 * currChangeColor.b; + luminance = saturate(luminance + _ColorChangeLuminosity); + half3 dif = abs(currChangeColor - _ColorChangeTarget.rgb); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _ColorChangeNewCol.rgb, + max(sign(1 - saturate(dif.x + dif.y + dif.z) - _ColorChangeTolerance), 0.0)); + #if CHANGECOLOR2_ON + dif = abs(currChangeColor - _ColorChangeTarget2.rgb); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _ColorChangeNewCol2.rgb, + max(sign(1 - saturate(dif.x + dif.y + dif.z) - _ColorChangeTolerance2), 0.0)); + #endif + #if CHANGECOLOR3_ON + dif = abs(currChangeColor - _ColorChangeTarget3.rgb); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _ColorChangeNewCol3.rgb, + max(sign(1 - saturate(dif.x + dif.y + dif.z) - _ColorChangeTolerance3), 0.0)); + #endif + #endif + //------------------------------------------------------- + + //POSTERIZE_ON && !POSTERIZEOUTLINE_ON + #if POSTERIZE_ON && !POSTERIZEOUTLINE_ON + col.rgb = pow(col.rgb, _PosterizeGamma) * _PosterizeNumColors; + col.rgb = floor(col.rgb) / _PosterizeNumColors; + col.rgb = pow(col.rgb, 1.0 / _PosterizeGamma); + #endif + //------------------------------------ + + //HSV_ON + #if HSV_ON + half3 resultHsv = half3(col.rgb); + half cosHsv = _HsvBright * _HsvSaturation * cos(_HsvShift * 3.14159265 / 180); + half sinHsv = _HsvBright * _HsvSaturation * sin(_HsvShift * 3.14159265 / 180); + resultHsv.x = (.299 * _HsvBright + .701 * cosHsv + .168 * sinHsv) * col.x + + (.587 * _HsvBright - .587 * cosHsv + .330 * sinHsv) * col.y + + (.114 * _HsvBright - .114 * cosHsv - .497 * sinHsv) * col.z; + resultHsv.y = (.299 * _HsvBright - .299 * cosHsv - .328 * sinHsv) *col.x + + (.587 * _HsvBright + .413 * cosHsv + .035 * sinHsv) * col.y + + (.114 * _HsvBright - .114 * cosHsv + .292 * sinHsv) * col.z; + resultHsv.z = (.299 * _HsvBright - .3 * cosHsv + 1.25 * sinHsv) * col.x + + (.587 * _HsvBright - .588 * cosHsv - 1.05 * sinHsv) * col.y + + (.114 * _HsvBright + .886 * cosHsv - .203 * sinHsv) * col.z; + col.rgb = resultHsv; + #endif + //------------------------------------------------------- + + //OVERLAY_ON + #if OVERLAY_ON + half2 overlayUvs = d.texcoord0.xy; + overlayUvs.x += ((_Time.y + randomSeed) * _OverlayTextureScrollXSpeed) % 1; + overlayUvs.y += ((_Time.y + randomSeed) * _OverlayTextureScrollYSpeed) % 1; + half4 overlayCol = SAMPLE_TEXTURE2D(_OverlayTex, sampler_OverlayTex, TRANSFORM_TEX(overlayUvs, _OverlayTex)); + overlayCol.rgb *= _OverlayColor.rgb * _OverlayGlow; + #if !OVERLAYMULT_ON + overlayCol.rgb *= overlayCol.a * _OverlayColor.rgb * _OverlayColor.a * _OverlayBlend; + col.rgb += overlayCol.rgb; + #else + overlayCol.a *= _OverlayColor.a; + col = lerp(col, col * overlayCol, _OverlayBlend); + #endif + #endif + + //--------------------------------- + + //OUTBASE_ON + #if OUTBASE_ON + #if OUTBASEPIXELPERF_ON + half2 destUv = half2(_OutlinePixelWidth * _MainTex_TexelSize.x, _OutlinePixelWidth * _MainTex_TexelSize.y); + #else + half2 destUv = half2(_OutlineWidth * _MainTex_TexelSize.x * 200, _OutlineWidth * _MainTex_TexelSize.y * 200); + #endif + + #if OUTDIST_ON + d.texcoord3.x += ((_Time.x + _RandomSeed) * _OutlineDistortTexXSpeed) % 1; + d.texcoord3.y += ((_Time.x + _RandomSeed) * _OutlineDistortTexYSpeed) % 1; + #if ATLAS_ON + d.texcoord3 = half2((d.texcoord3.x - _MinXUV) / (_MaxXUV - _MinXUV), (d.texcoord3.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half outDistortAmnt = (SAMPLE_TEXTURE2D(_OutlineDistortTex, sampler_OutlineDistortTex, d.texcoord3).r - 0.5) * 0.2 * _OutlineDistortAmount; + destUv.x += outDistortAmnt; + destUv.y += outDistortAmnt; + #endif + + half spriteLeft = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(destUv.x, 0)).a; + half spriteRight = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy - half2(destUv.x, 0)).a; + half spriteBottom = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(0, destUv.y)).a; + half spriteTop = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy - half2(0, destUv.y)).a; + half result = spriteLeft + spriteRight + spriteBottom + spriteTop; + + #if OUTBASE8DIR_ON + half spriteTopLeft = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(destUv.x, destUv.y)).a; + half spriteTopRight = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(-destUv.x, destUv.y)).a; + half spriteBotLeft = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(destUv.x, -destUv.y)).a; + half spriteBotRight = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(-destUv.x, -destUv.y)).a; + result = result + spriteTopLeft + spriteTopRight + spriteBotLeft + spriteBotRight; + #endif + + result = step(0.05, saturate(result)); + + #if OUTTEX_ON + d.texcoord1.x += ((_Time.x + _RandomSeed) * _OutlineTexXSpeed) % 1; + d.texcoord1.y += ((_Time.x + _RandomSeed) * _OutlineTexYSpeed) % 1; + #if ATLAS_ON + d.texcoord1 = half2((d.texcoord1.x - _MinXUV) / (_MaxXUV - _MinXUV), (d.texcoord1.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half4 tempOutColor = SAMPLE_TEXTURE2D(_OutlineTex, sampler_OutlineTex, d.texcoord1); + tempOutColor *= _OutlineColor; + _OutlineColor = tempOutColor; + #endif + + result *= (1 - originalAlpha) * _OutlineAlpha; + + half4 outline = _OutlineColor * d.vertexColor.a; + outline.rgb *= _OutlineGlow; + outline.a = result; + #if ONLYOUTLINE_ON + col = outline; + #else + col = lerp(col, outline, result); + #endif + #endif + //------------------------------------------------------- + + //FADE_ON + #if FADE_ON + half2 tiledUvFade1 = TRANSFORM_TEX(d.texcoord0, _FadeTex); + half2 tiledUvFade2 = TRANSFORM_TEX(d.texcoord0, _FadeBurnTex); + #if ATLAS_ON + tiledUvFade1 = half2((tiledUvFade1.x - _MinXUV) / (_MaxXUV - _MinXUV), (tiledUvFade1.y - _MinYUV) / (_MaxYUV - _MinYUV)); + tiledUvFade2 = half2((tiledUvFade2.x - _MinXUV) / (_MaxXUV - _MinXUV), (tiledUvFade2.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half fadeTemp = SAMPLE_TEXTURE2D(_FadeTex, sampler_FadeTex, tiledUvFade1).r; + half fade = smoothstep(_FadeAmount, _FadeAmount + _FadeBurnTransition, fadeTemp); + half fadeBurn = saturate(smoothstep(_FadeAmount - _FadeBurnWidth, _FadeAmount - _FadeBurnWidth + 0.1, fadeTemp) * _FadeAmount); + col.a *= fade; + _FadeBurnColor.rgb *= _FadeBurnGlow; + col += fadeBurn * SAMPLE_TEXTURE2D(_FadeBurnTex, sampler_FadeBurnTex, tiledUvFade2) * _FadeBurnColor * originalAlpha * (1 - col.a); + #endif + //------------------------------------------------------- + + //SHADOW_ON + #if SHADOW_ON + half shadowA = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(_ShadowX, _ShadowY)).a; + half preMultShadowMask = 1 - (saturate(shadowA - col.a) * (1 - col.a)); + col.rgb *= 1 - ((shadowA - col.a) * (1 - col.a)); + col.rgb += (_ShadowColor * shadowA) * (1 - col.a); + col.a = max(shadowA * _ShadowAlpha * d.vertexColor.a, col.a); + #endif + + //------------------------------------------------------- + + //GLOW_ON + #if GLOW_ON + half4 emission; + #if GLOWTEX_ON + emission = SAMPLE_TEXTURE2D(_GlowTex, sampler_GlowTex, d.texcoord0); + #else + emission = col; + #endif + + col.rgb *= _GlowGlobal; + emission.rgb *= emission.a * col.a * _Glow * _GlowColor; + col.rgb += emission.rgb; + #endif + //------------------------------------------------------- + + //COLORRAMP_ON && COLORRAMPOUTLINE_ON + #if COLORRAMP_ON && COLORRAMPOUTLINE_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + luminance = saturate(luminance + _ColorRampLuminosity); + #if GRADIENTCOLORRAMP_ON + col.rgb = lerp(col.rgb, SAMPLE_TEXTURE2D(_ColorRampTexGradient, sampler_ColorRampTexGradient, half2(luminance, 0)).rgb, _ColorRampBlend); + #else + col.rgb = lerp(col.rgb, SAMPLE_TEXTURE2D(_ColorRampTex, sampler_ColorRampTex, half2(luminance, 0)).rgb, _ColorRampBlend); + #endif + #endif + //--------------- + + //GREYSCALE_ON && GREYSCALEOUTLINE_ON + #if GREYSCALE_ON && GREYSCALEOUTLINE_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + luminance = saturate(luminance + _GreyscaleLuminosity); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _GreyscaleTintColor, _GreyscaleBlend); + #endif + + //----------------------------------- + + //POSTERIZE_ON && POSTERIZEOUTLINE_ON + #if POSTERIZE_ON && POSTERIZEOUTLINE_ON + col.rgb = pow(col.rgb, _PosterizeGamma) * _PosterizeNumColors; + col.rgb = floor(col.rgb) / _PosterizeNumColors; + col.rgb = pow(col.rgb, 1.0 / _PosterizeGamma); + #endif + + //----------------------------------- + + //SHINE_ON + #if SHINE_ON + half2 uvShine = uvRect; + half cosAngle = cos(_ShineRotate); + half sinAngle = sin(_ShineRotate); + half2x2 rot = half2x2(cosAngle, -sinAngle, sinAngle, cosAngle); + uvShine -= half2(0.5, 0.5); + uvShine = mul(rot, uvShine); + uvShine += half2(0.5, 0.5); + half shineMask = SAMPLE_TEXTURE2D(_ShineMask, sampler_ShineMask, d.texcoord0.xy).a; + half currentDistanceProjection = (uvShine.x + uvShine.y) / 2; + half whitePower = 1 - (abs(currentDistanceProjection - _ShineLocation) / _ShineWidth); + col.rgb += col.a * whitePower * _ShineGlow * max(sign(currentDistanceProjection - (_ShineLocation - _ShineWidth)), 0.0) + * max(sign((_ShineLocation + _ShineWidth) - currentDistanceProjection), 0.0) * _ShineColor * shineMask; + #endif + + //----------------------------------- + + //HOLOGRAM_ON + #if HOLOGRAM_ON + half totalHologram = _HologramStripesAmount + _HologramUnmodAmount; + half hologramYCoord = ((uvRect.y + (((_Time.x + randomSeed) % 1) * _HologramStripesSpeed)) % totalHologram) / totalHologram; + hologramYCoord = abs(hologramYCoord); + half alpha = RemapFloat(saturate(hologramYCoord - (_HologramUnmodAmount/totalHologram)), 0.0, 1.0, _HologramMinAlpha, saturate(_HologramMaxAlpha)); + half hologramMask = max(sign((_HologramUnmodAmount/totalHologram) - hologramYCoord), 0.0); + half4 hologramResult = col; + hologramResult.a *= lerp(alpha, 1, hologramMask); + hologramResult.rgb *= max(1, _HologramMaxAlpha * max(sign(hologramYCoord - (_HologramUnmodAmount/totalHologram)), 0.0)); + hologramMask = 1 - step(0.01,hologramMask); + hologramResult.rgb += hologramMask * _HologramStripeColor * col.a; + col = lerp(col, hologramResult, _HologramBlend); + #endif + + //----------------------------------- + + //FLICKER_ON + #if FLICKER_ON + col.a *= saturate(col.a * step(frac(0.05 + (_Time.w + randomSeed) * _FlickerFreq), 1 - _FlickerPercent) + _FlickerAlpha); + #endif + //----------------------------------- + + //ALPHACUTOFF_ON + + //ALPHAROUND_ON + + //ALPHAOUTLINE_ON + #if ALPHAOUTLINE_ON + half alphaOutlineRes = pow(1 - col.a, max(_AlphaOutlinePower, 0.0001)) * step(_AlphaOutlineMinAlpha, col.a) * _AlphaOutlineBlend; + col.rgb = lerp(col.rgb, _AlphaOutlineColor.rgb * _AlphaOutlineGlow, alphaOutlineRes); + col.a = lerp(col.a, 1, alphaOutlineRes > 1); + #endif + //------------------------------------------------------- + + //FOG_ON + + //------------------ + + col *= _Color; + o.Albedo = col; + col.a *= _Alpha; + clip(col.a - _AlphaCutoffValue - 0.01); + o.Alpha = _Color.a; + } + + + + + + void ChainSurfaceFunction(inout Surface l, inout ShaderData d) + { + Ext_SurfaceFunction0(l, d); + // Ext_SurfaceFunction1(l, d); + // Ext_SurfaceFunction2(l, d); + // Ext_SurfaceFunction3(l, d); + // Ext_SurfaceFunction4(l, d); + // Ext_SurfaceFunction5(l, d); + // Ext_SurfaceFunction6(l, d); + // Ext_SurfaceFunction7(l, d); + // Ext_SurfaceFunction8(l, d); + // Ext_SurfaceFunction9(l, d); + // Ext_SurfaceFunction10(l, d); + // Ext_SurfaceFunction11(l, d); + // Ext_SurfaceFunction12(l, d); + // Ext_SurfaceFunction13(l, d); + // Ext_SurfaceFunction14(l, d); + // Ext_SurfaceFunction15(l, d); + // Ext_SurfaceFunction16(l, d); + // Ext_SurfaceFunction17(l, d); + // Ext_SurfaceFunction18(l, d); + // Ext_SurfaceFunction19(l, d); + // Ext_SurfaceFunction20(l, d); + // Ext_SurfaceFunction21(l, d); + // Ext_SurfaceFunction22(l, d); + // Ext_SurfaceFunction23(l, d); + // Ext_SurfaceFunction24(l, d); + // Ext_SurfaceFunction25(l, d); + // Ext_SurfaceFunction26(l, d); + // Ext_SurfaceFunction27(l, d); + // Ext_SurfaceFunction28(l, d); + // Ext_SurfaceFunction29(l, d); + } + +#if !_DECALSHADER + + void ChainModifyVertex(inout VertexData v, inout VertexToPixel v2p, float4 time) + { + ExtraV2F d; + + ZERO_INITIALIZE(ExtraV2F, d); + ZERO_INITIALIZE(Blackboard, d.blackboard); + // due to motion vectors in HDRP, we need to use the last + // time in certain spots. So if you are going to use _Time to adjust vertices, + // you need to use this time or motion vectors will break. + d.time = time; + + Ext_ModifyVertex0(v, d); + // Ext_ModifyVertex1(v, d); + // Ext_ModifyVertex2(v, d); + // Ext_ModifyVertex3(v, d); + // Ext_ModifyVertex4(v, d); + // Ext_ModifyVertex5(v, d); + // Ext_ModifyVertex6(v, d); + // Ext_ModifyVertex7(v, d); + // Ext_ModifyVertex8(v, d); + // Ext_ModifyVertex9(v, d); + // Ext_ModifyVertex10(v, d); + // Ext_ModifyVertex11(v, d); + // Ext_ModifyVertex12(v, d); + // Ext_ModifyVertex13(v, d); + // Ext_ModifyVertex14(v, d); + // Ext_ModifyVertex15(v, d); + // Ext_ModifyVertex16(v, d); + // Ext_ModifyVertex17(v, d); + // Ext_ModifyVertex18(v, d); + // Ext_ModifyVertex19(v, d); + // Ext_ModifyVertex20(v, d); + // Ext_ModifyVertex21(v, d); + // Ext_ModifyVertex22(v, d); + // Ext_ModifyVertex23(v, d); + // Ext_ModifyVertex24(v, d); + // Ext_ModifyVertex25(v, d); + // Ext_ModifyVertex26(v, d); + // Ext_ModifyVertex27(v, d); + // Ext_ModifyVertex28(v, d); + // Ext_ModifyVertex29(v, d); + + + // #if %EXTRAV2F0REQUIREKEY% + // v2p.extraV2F0 = d.extraV2F0; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // v2p.extraV2F1 = d.extraV2F1; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // v2p.extraV2F2 = d.extraV2F2; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // v2p.extraV2F3 = d.extraV2F3; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // v2p.extraV2F4 = d.extraV2F4; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // v2p.extraV2F5 = d.extraV2F5; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // v2p.extraV2F6 = d.extraV2F6; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // v2p.extraV2F7 = d.extraV2F7; + // #endif + } + + void ChainModifyTessellatedVertex(inout VertexData v, inout VertexToPixel v2p) + { + ExtraV2F d; + ZERO_INITIALIZE(ExtraV2F, d); + ZERO_INITIALIZE(Blackboard, d.blackboard); + + // #if %EXTRAV2F0REQUIREKEY% + // d.extraV2F0 = v2p.extraV2F0; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // d.extraV2F1 = v2p.extraV2F1; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // d.extraV2F2 = v2p.extraV2F2; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // d.extraV2F3 = v2p.extraV2F3; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // d.extraV2F4 = v2p.extraV2F4; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // d.extraV2F5 = v2p.extraV2F5; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // d.extraV2F6 = v2p.extraV2F6; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // d.extraV2F7 = v2p.extraV2F7; + // #endif + + + // Ext_ModifyTessellatedVertex0(v, d); + // Ext_ModifyTessellatedVertex1(v, d); + // Ext_ModifyTessellatedVertex2(v, d); + // Ext_ModifyTessellatedVertex3(v, d); + // Ext_ModifyTessellatedVertex4(v, d); + // Ext_ModifyTessellatedVertex5(v, d); + // Ext_ModifyTessellatedVertex6(v, d); + // Ext_ModifyTessellatedVertex7(v, d); + // Ext_ModifyTessellatedVertex8(v, d); + // Ext_ModifyTessellatedVertex9(v, d); + // Ext_ModifyTessellatedVertex10(v, d); + // Ext_ModifyTessellatedVertex11(v, d); + // Ext_ModifyTessellatedVertex12(v, d); + // Ext_ModifyTessellatedVertex13(v, d); + // Ext_ModifyTessellatedVertex14(v, d); + // Ext_ModifyTessellatedVertex15(v, d); + // Ext_ModifyTessellatedVertex16(v, d); + // Ext_ModifyTessellatedVertex17(v, d); + // Ext_ModifyTessellatedVertex18(v, d); + // Ext_ModifyTessellatedVertex19(v, d); + // Ext_ModifyTessellatedVertex20(v, d); + // Ext_ModifyTessellatedVertex21(v, d); + // Ext_ModifyTessellatedVertex22(v, d); + // Ext_ModifyTessellatedVertex23(v, d); + // Ext_ModifyTessellatedVertex24(v, d); + // Ext_ModifyTessellatedVertex25(v, d); + // Ext_ModifyTessellatedVertex26(v, d); + // Ext_ModifyTessellatedVertex27(v, d); + // Ext_ModifyTessellatedVertex28(v, d); + // Ext_ModifyTessellatedVertex29(v, d); + + // #if %EXTRAV2F0REQUIREKEY% + // v2p.extraV2F0 = d.extraV2F0; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // v2p.extraV2F1 = d.extraV2F1; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // v2p.extraV2F2 = d.extraV2F2; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // v2p.extraV2F3 = d.extraV2F3; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // v2p.extraV2F4 = d.extraV2F4; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // v2p.extraV2F5 = d.extraV2F5; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // v2p.extraV2F6 = d.extraV2F6; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // v2p.extraV2F7 = d.extraV2F7; + // #endif + } + + void ChainFinalColorForward(inout Surface l, inout ShaderData d, inout half4 color) + { + // Ext_FinalColorForward0(l, d, color); + // Ext_FinalColorForward1(l, d, color); + // Ext_FinalColorForward2(l, d, color); + // Ext_FinalColorForward3(l, d, color); + // Ext_FinalColorForward4(l, d, color); + // Ext_FinalColorForward5(l, d, color); + // Ext_FinalColorForward6(l, d, color); + // Ext_FinalColorForward7(l, d, color); + // Ext_FinalColorForward8(l, d, color); + // Ext_FinalColorForward9(l, d, color); + // Ext_FinalColorForward10(l, d, color); + // Ext_FinalColorForward11(l, d, color); + // Ext_FinalColorForward12(l, d, color); + // Ext_FinalColorForward13(l, d, color); + // Ext_FinalColorForward14(l, d, color); + // Ext_FinalColorForward15(l, d, color); + // Ext_FinalColorForward16(l, d, color); + // Ext_FinalColorForward17(l, d, color); + // Ext_FinalColorForward18(l, d, color); + // Ext_FinalColorForward19(l, d, color); + // Ext_FinalColorForward20(l, d, color); + // Ext_FinalColorForward21(l, d, color); + // Ext_FinalColorForward22(l, d, color); + // Ext_FinalColorForward23(l, d, color); + // Ext_FinalColorForward24(l, d, color); + // Ext_FinalColorForward25(l, d, color); + // Ext_FinalColorForward26(l, d, color); + // Ext_FinalColorForward27(l, d, color); + // Ext_FinalColorForward28(l, d, color); + // Ext_FinalColorForward29(l, d, color); + } + + void ChainFinalGBufferStandard(inout Surface s, inout ShaderData d, inout half4 GBuffer0, inout half4 GBuffer1, inout half4 GBuffer2, inout half4 outEmission, inout half4 outShadowMask) + { + // Ext_FinalGBufferStandard0(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard1(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard2(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard3(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard4(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard5(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard6(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard7(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard8(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard9(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard10(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard11(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard12(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard13(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard14(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard15(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard16(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard17(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard18(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard19(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard20(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard21(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard22(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard23(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard24(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard25(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard26(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard27(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard28(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard29(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + } +#endif + + + + + +#if _DECALSHADER + + ShaderData CreateShaderData(SurfaceDescriptionInputs IN) + { + ShaderData d = (ShaderData)0; + d.TBNMatrix = float3x3(IN.WorldSpaceTangent, IN.WorldSpaceBiTangent, IN.WorldSpaceNormal); + d.worldSpaceNormal = IN.WorldSpaceNormal; + d.worldSpaceTangent = IN.WorldSpaceTangent; + + d.worldSpacePosition = IN.WorldSpacePosition; + d.texcoord0 = IN.uv0.xyxy; + d.screenPos = IN.ScreenPosition; + + d.worldSpaceViewDir = normalize(_WorldSpaceCameraPos - d.worldSpacePosition); + + d.tangentSpaceViewDir = mul(d.TBNMatrix, d.worldSpaceViewDir); + + // these rarely get used, so we back transform them. Usually will be stripped. + #if _HDRP + // d.localSpacePosition = mul(GetWorldToObjectMatrix(), float4(GetCameraRelativePositionWS(d.worldSpacePosition), 1)).xyz; + #else + // d.localSpacePosition = mul(GetWorldToObjectMatrix(), float4(d.worldSpacePosition, 1)).xyz; + #endif + // d.localSpaceNormal = normalize(mul((float3x3)GetWorldToObjectMatrix(), d.worldSpaceNormal)); + // d.localSpaceTangent = normalize(mul((float3x3)GetWorldToObjectMatrix(), d.worldSpaceTangent.xyz)); + + // #if %SCREENPOSREQUIREKEY% + // d.screenUV = (IN.ScreenPosition.xy / max(0.01, IN.ScreenPosition.w)); + // #endif + + return d; + } +#else + + ShaderData CreateShaderData(VertexToPixel i + #if NEED_FACING + , bool facing + #endif + ) + { + ShaderData d = (ShaderData)0; + d.clipPos = i.pos; + d.worldSpacePosition = i.worldPos; + + d.worldSpaceNormal = normalize(i.worldNormal); + d.worldSpaceTangent.xyz = normalize(i.worldTangent.xyz); + + d.tangentSign = i.worldTangent.w * unity_WorldTransformParams.w; + float3 bitangent = cross(d.worldSpaceTangent.xyz, d.worldSpaceNormal) * d.tangentSign; + + d.TBNMatrix = float3x3(d.worldSpaceTangent, -bitangent, d.worldSpaceNormal); + d.worldSpaceViewDir = normalize(_WorldSpaceCameraPos - i.worldPos); + + d.tangentSpaceViewDir = mul(d.TBNMatrix, d.worldSpaceViewDir); + d.texcoord0 = i.texcoord0; + d.texcoord1 = i.texcoord1; + d.texcoord2 = i.texcoord2; + + // #if %TEXCOORD3REQUIREKEY% + d.texcoord3 = i.texcoord3; + // #endif + + // d.isFrontFace = facing; + // #if %VERTEXCOLORREQUIREKEY% + d.vertexColor = i.vertexColor; + // #endif + + // these rarely get used, so we back transform them. Usually will be stripped. + #if _HDRP + // d.localSpacePosition = mul(GetWorldToObjectMatrix(), float4(GetCameraRelativePositionWS(i.worldPos), 1)).xyz; + #else + // d.localSpacePosition = mul(GetWorldToObjectMatrix(), float4(i.worldPos, 1)).xyz; + #endif + // d.localSpaceNormal = normalize(mul((float3x3)GetWorldToObjectMatrix(), i.worldNormal)); + // d.localSpaceTangent = normalize(mul((float3x3)GetWorldToObjectMatrix(), i.worldTangent.xyz)); + + // #if %SCREENPOSREQUIREKEY% + // d.screenPos = i.screenPos; + // d.screenUV = (i.screenPos.xy / i.screenPos.w); + // #endif + + + // #if %EXTRAV2F0REQUIREKEY% + // d.extraV2F0 = i.extraV2F0; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // d.extraV2F1 = i.extraV2F1; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // d.extraV2F2 = i.extraV2F2; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // d.extraV2F3 = i.extraV2F3; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // d.extraV2F4 = i.extraV2F4; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // d.extraV2F5 = i.extraV2F5; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // d.extraV2F6 = i.extraV2F6; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // d.extraV2F7 = i.extraV2F7; + // #endif + + return d; + } + +#endif + + + +#if (SHADERPASS == SHADERPASS_LIGHT_TRANSPORT) + + // This was not in constant buffer in original unity, so keep outiside. But should be in as ShaderRenderPass frequency + float unity_OneOverOutputBoost; + float unity_MaxOutputValue; + + CBUFFER_START(UnityMetaPass) + // x = use uv1 as raster position + // y = use uv2 as raster position + bool4 unity_MetaVertexControl; + + // x = return albedo + // y = return normal + bool4 unity_MetaFragmentControl; + CBUFFER_END + + VertexToPixel Vert(VertexData inputMesh) + { + VertexToPixel output; + ZERO_INITIALIZE(VertexToPixel, output); + UNITY_SETUP_INSTANCE_ID(inputMesh); + UNITY_TRANSFER_INSTANCE_ID(inputMesh, output); + UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(output); + + // Output UV coordinate in vertex shader + float2 uv = float2(0.0, 0.0); + + if (unity_MetaVertexControl.x) + { + uv = inputMesh.texcoord1.xy * unity_LightmapST.xy + unity_LightmapST.zw; + } + else if (unity_MetaVertexControl.y) + { + uv = inputMesh.texcoord2.xy * unity_DynamicLightmapST.xy + unity_DynamicLightmapST.zw; + } + + // OpenGL right now needs to actually use the incoming vertex position + // so we create a fake dependency on it here that haven't any impact. + output.pos = float4(uv * 2.0 - 1.0, inputMesh.vertex.z > 0 ? 1.0e-4 : 0.0, 1.0); + + output.worldPos = TransformObjectToWorld(inputMesh.vertex.xyz).xyz; + + // Normal is required for triplanar mapping + output.worldNormal = TransformObjectToWorldNormal(inputMesh.normal); + // Not required but assign to silent compiler warning + output.worldTangent = float4(1.0, 0.0, 0.0, 0.0); + + output.texcoord0 = inputMesh.texcoord0; + output.texcoord1 = inputMesh.texcoord1; + output.texcoord2 = inputMesh.texcoord2; + // #if %TEXCOORD3REQUIREKEY% + output.texcoord3 = inputMesh.texcoord3; + // #endif + // #if %VERTEXCOLORREQUIREKEY% + output.vertexColor = inputMesh.vertexColor; + // #endif + + return output; + } +#else + + #if (_PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR))) + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/ShaderVariablesMatrixDefsHDCamera.hlsl" + + void MotionVectorPositionZBias(VertexToPixel input) + { + #if UNITY_REVERSED_Z + input.pos.z -= unity_MotionVectorsParams.z * input.pos.w; + #else + input.pos.z += unity_MotionVectorsParams.z * input.pos.w; + #endif + } + + #endif + + VertexToPixel Vert(VertexData input) + { + VertexToPixel output; + ZERO_INITIALIZE(VertexToPixel, output); + + UNITY_SETUP_INSTANCE_ID(input); + UNITY_TRANSFER_INSTANCE_ID(input, output); + UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(output); + + #if _HDRP && (_PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR))) + VertexData previousMesh = input; + #endif + + ChainModifyVertex(input, output, _Time); + + // This return the camera relative position (if enable) + float3 positionRWS = TransformObjectToWorld(input.vertex.xyz); + float3 normalWS = TransformObjectToWorldNormal(input.normal); + float4 tangentWS = float4(TransformObjectToWorldDir(input.tangent.xyz), input.tangent.w); + + + output.worldPos = GetAbsolutePositionWS(positionRWS); + output.pos = TransformWorldToHClip(positionRWS); + output.worldNormal = normalWS; + output.worldTangent = tangentWS; + + + output.texcoord0 = input.texcoord0; + output.texcoord1 = input.texcoord1; + output.texcoord2 = input.texcoord2; + + // #if %TEXCOORD3REQUIREKEY% + output.texcoord3 = input.texcoord3; + // #endif + + // #if %VERTEXCOLORREQUIREKEY% + output.vertexColor = input.vertexColor; + // #endif + + // #if %SCREENPOSREQUIREKEY% + // output.screenPos = ComputeScreenPos(output.pos, _ProjectionParams.x); + // #endif + + #if _HDRP && (_PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR))) + + #if !defined(TESSELLATION_ON) + MotionVectorPositionZBias(output); + #endif + + output.motionVectorCS = mul(UNITY_MATRIX_UNJITTERED_VP, float4(positionRWS.xyz, 1.0)); + // Note: unity_MotionVectorsParams.y is 0 is forceNoMotion is enabled + bool forceNoMotion = unity_MotionVectorsParams.y == 0.0; + if (forceNoMotion) + { + output.previousPositionCS = float4(0.0, 0.0, 0.0, 1.0); + } + else + { + bool hasDeformation = unity_MotionVectorsParams.x > 0.0; // Skin or morph target + + float3 effectivePositionOS = (hasDeformation ? previousMesh.previousPositionOS : previousMesh.vertex.xyz); + #if defined(_ADD_PRECOMPUTED_VELOCITY) + effectivePositionOS -= input.precomputedVelocity; + #endif + + previousMesh.vertex = float4(effectivePositionOS, 1); + VertexToPixel dummy = (VertexToPixel)0; + + + ChainModifyVertex(previousMesh, dummy, _LastTimeParameters); + + // we might need this for skinned objects? + //float3 normalWS = TransformPreviousObjectToWorldNormal(input.normal).xyz; + float3 previousPositionRWS = TransformPreviousObjectToWorld(previousMesh.vertex.xyz); + + #ifdef _WRITE_TRANSPARENT_MOTION_VECTOR + if (_TransparentCameraOnlyMotionVectors > 0) + { + previousPositionRWS = positionRWS.xyz; + } + #endif // _WRITE_TRANSPARENT_MOTION_VECTOR + + output.previousPositionCS = mul(UNITY_MATRIX_PREV_VP, float4(previousPositionRWS, 1.0)); + } + #endif // _HDRP && _PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR)) + + + return output; + } + + +#endif + + + + + + + + #if defined(WRITE_DECAL_BUFFER) && !defined(_DISABLE_DECALS) + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/Decal/DecalPrepassBuffer.hlsl" + #endif + + FragInputs BuildFragInputs(VertexToPixel input) + { + UNITY_SETUP_INSTANCE_ID(input); + FragInputs output; + ZERO_INITIALIZE(FragInputs, output); + + // Init to some default value to make the computer quiet (else it output 'divide by zero' warning even if value is not used). + // TODO: this is a really poor workaround, but the variable is used in a bunch of places + // to compute normals which are then passed on elsewhere to compute other values... + output.tangentToWorld = k_identity3x3; + output.positionSS = input.pos; // input.positionCS is SV_Position + // BETTER SHADERS: because we transform world position into actual world space for things like + // triplanar, etc, we have to back transform it here for lighting + output.positionRWS = GetCameraRelativePositionWS(input.worldPos); + output.tangentToWorld = BuildTangentToWorld(input.worldTangent, input.worldNormal); + output.texCoord0 = input.texcoord0; + output.texCoord1 = input.texcoord1; + output.texCoord2 = input.texcoord2; + + return output; + } + +#if UNITY_VERSION > UNITY_2022_3_12 + void ApplyDecalAndGetNormal(FragInputs fragInputs, PositionInputs posInput, Surface surfaceDescription, float3 normalTS, + inout SurfaceData surfaceData) + { + float3 doubleSidedConstants = GetDoubleSidedConstants(); + + #ifdef DECAL_NORMAL_BLENDING + // SG nodes don't ouptut surface gradients, so if decals require surf grad blending, we have to convert + // the normal to gradient before applying the decal. We then have to resolve the gradient back to world space + normalTS = SurfaceGradientFromTangentSpaceNormalAndFromTBN(normalTS, + fragInputs.tangentToWorld[0], fragInputs.tangentToWorld[1]); + + + #if HAVE_DECALS + if (_EnableDecals) + { + float alpha = 1.0; + alpha = surfaceDescription.Alpha; + + DecalSurfaceData decalSurfaceData = GetDecalSurfaceData(posInput, fragInputs, alpha); + ApplyDecalToSurfaceNormal(decalSurfaceData, fragInputs.tangentToWorld[2], normalTS); + ApplyDecalToSurfaceDataNoNormal(decalSurfaceData, surfaceData); + } + #endif + + GetNormalWS_SG(fragInputs, normalTS, surfaceData.normalWS, doubleSidedConstants); + #else + // normal delivered to master node + + #if HAVE_DECALS + if (_EnableDecals) + { + float alpha = 1.0; + alpha = surfaceDescription.Alpha; + + // Both uses and modifies 'surfaceData.normalWS'. + DecalSurfaceData decalSurfaceData = GetDecalSurfaceData(posInput, fragInputs, alpha); + ApplyDecalToSurfaceNormal(decalSurfaceData, surfaceData.normalWS.xyz); + ApplyDecalToSurfaceDataNoNormal(decalSurfaceData, surfaceData); + } + #endif + #endif + } +#endif + + void BuildSurfaceData(FragInputs fragInputs, inout Surface surfaceDescription, float3 V, PositionInputs posInput, out SurfaceData surfaceData, out float3 bentNormalWS) + { + // setup defaults -- these are used if the graph doesn't output a value + ZERO_INITIALIZE(SurfaceData, surfaceData); + + // specularOcclusion need to be init ahead of decal to quiet the compiler that modify the SurfaceData struct + // however specularOcclusion can come from the graph, so need to be init here so it can be override. + surfaceData.specularOcclusion = 1.0; + + // copy across graph values, if defined + surfaceData.baseColor = surfaceDescription.Albedo; + surfaceData.perceptualSmoothness = surfaceDescription.Smoothness; + surfaceData.ambientOcclusion = surfaceDescription.Occlusion; + surfaceData.specularOcclusion = surfaceDescription.SpecularOcclusion; + surfaceData.metallic = surfaceDescription.Metallic; + surfaceData.subsurfaceMask = surfaceDescription.SubsurfaceMask; + surfaceData.thickness = surfaceDescription.Thickness; + surfaceData.diffusionProfileHash = asuint(surfaceDescription.DiffusionProfileHash); + #if _USESPECULAR + surfaceData.specularColor = surfaceDescription.Specular; + #endif + surfaceData.coatMask = surfaceDescription.CoatMask; + surfaceData.anisotropy = surfaceDescription.Anisotropy; + surfaceData.iridescenceMask = surfaceDescription.IridescenceMask; + surfaceData.iridescenceThickness = surfaceDescription.IridescenceThickness; + + + + #if defined(_REFRACTION_PLANE) || defined(_REFRACTION_SPHERE) || defined(_REFRACTION_THIN) + if (_EnableSSRefraction) + { + surfaceData.transmittanceMask = (1.0 - surfaceDescription.Alpha); + surfaceDescription.Alpha = 1.0; + } + else + { + surfaceData.ior = surfaceDescription.ior; + surfaceData.transmittanceColor = surfaceDescription.transmittanceColor; + surfaceData.atDistance = surfaceDescription.atDistance; + surfaceData.transmittanceMask = surfaceDescription.transmittanceMask; + surfaceDescription.Alpha = 1.0; + } + #else + surfaceData.ior = 1.0; + surfaceData.transmittanceColor = float3(1.0, 1.0, 1.0); + surfaceData.atDistance = 1.0; + surfaceData.transmittanceMask = 0.0; + #endif + + + + // These static material feature allow compile time optimization + surfaceData.materialFeatures = MATERIALFEATUREFLAGS_LIT_STANDARD; + #ifdef _MATERIAL_FEATURE_SUBSURFACE_SCATTERING + surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_SUBSURFACE_SCATTERING; + #endif + + #ifdef _MATERIAL_FEATURE_TRANSMISSION + surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_TRANSMISSION; + #endif + + #ifdef _MATERIAL_FEATURE_ANISOTROPY + surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_ANISOTROPY; + surfaceData.normalWS = float3(0, 1, 0); + #endif + + #ifdef _MATERIAL_FEATURE_IRIDESCENCE + surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_IRIDESCENCE; + #endif + + #ifdef _MATERIAL_FEATURE_SPECULAR_COLOR + surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_SPECULAR_COLOR; + #endif + + #if defined(_MATERIAL_FEATURE_CLEAR_COAT) || _CLEARCOAT + surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_CLEAR_COAT; + #endif + + #if defined (_MATERIAL_FEATURE_SPECULAR_COLOR) && defined (_ENERGY_CONSERVING_SPECULAR) + // Require to have setup baseColor + // Reproduce the energy conservation done in legacy Unity. Not ideal but better for compatibility and users can unchek it + surfaceData.baseColor *= (1.0 - Max3(surfaceData.specularColor.r, surfaceData.specularColor.g, surfaceData.specularColor.b)); + #endif + + float3 normalTS = surfaceDescription.Normal; + #if !_WORLDSPACENORMAL + surfaceData.normalWS = mul(surfaceDescription.Normal, fragInputs.tangentToWorld); + #else + normalTS = mul(fragInputs.tangentToWorld, surfaceDescription.Normal); + surfaceData.normalWS = surfaceDescription.Normal; + #endif + + + #if UNITY_VERSION > UNITY_2022_3_12 + ApplyDecalAndGetNormal(fragInputs, posInput, surfaceDescription, normalTS, surfaceData); + #else + #ifdef DECAL_NORMAL_BLENDING + #if HAVE_DECALS + float alpha = 1.0; + alpha = surfaceDescription.Alpha; + if (_EnableDecals) + { + DecalSurfaceData decalSurfaceData = GetDecalSurfaceData(posInput, fragInputs, alpha); + ApplyDecalToSurfaceData(decalSurfaceData, fragInputs.tangentToWorld[2], surfaceData, normalTS); + } + #endif + #else + #if HAVE_DECALS + if (_EnableDecals) + { + float alpha = 1.0; + alpha = surfaceDescription.Alpha; + // Both uses and modifies 'surfaceData.normalWS'. + DecalSurfaceData decalSurfaceData = GetDecalSurfaceData(posInput, fragInputs, alpha); + ApplyDecalToSurfaceData(decalSurfaceData, fragInputs.tangentToWorld[2], surfaceData); + } + #endif + #endif + #endif + + + + surfaceData.geomNormalWS = fragInputs.tangentToWorld[2]; + + surfaceData.tangentWS = normalize(fragInputs.tangentToWorld[0].xyz); // The tangent is not normalize in tangentToWorld for mikkt. TODO: Check if it expected that we normalize with Morten. Tag: SURFACE_GRADIENT + + + bentNormalWS = surfaceData.normalWS; + + surfaceData.tangentWS = Orthonormalize(surfaceData.tangentWS, surfaceData.normalWS); + + #ifdef DEBUG_DISPLAY + if (_DebugMipMapMode != DEBUGMIPMAPMODE_NONE) + { + // TODO: need to update mip info + surfaceData.metallic = 0; + } + + // We need to call ApplyDebugToSurfaceData after filling the surfarcedata and before filling builtinData + // as it can modify attribute use for static lighting + ApplyDebugToSurfaceData(fragInputs.tangentToWorld, surfaceData); + #endif + + // By default we use the ambient occlusion with Tri-ace trick (apply outside) for specular occlusion. + // If user provide bent normal then we process a better term + #if defined(_SPECULAR_OCCLUSION_CUSTOM) + // Just use the value passed through via the slot (not active otherwise) + #elif defined(_SPECULAR_OCCLUSION_FROM_AO_BENT_NORMAL) + // If we have bent normal and ambient occlusion, process a specular occlusion + surfaceData.specularOcclusion = GetSpecularOcclusionFromBentAO(V, bentNormalWS, surfaceData.normalWS, surfaceData.ambientOcclusion, PerceptualSmoothnessToPerceptualRoughness(surfaceData.perceptualSmoothness)); + #elif defined(_AMBIENT_OCCLUSION) && defined(_SPECULAR_OCCLUSION_FROM_AO) + surfaceData.specularOcclusion = GetSpecularOcclusionFromAmbientOcclusion(ClampNdotV(dot(surfaceData.normalWS, V)), surfaceData.ambientOcclusion, PerceptualSmoothnessToRoughness(surfaceData.perceptualSmoothness)); + #endif + + #if defined(_ENABLE_GEOMETRIC_SPECULAR_AA) && !defined(SHADER_STAGE_RAY_TRACING) + surfaceData.perceptualSmoothness = GeometricNormalFiltering(surfaceData.perceptualSmoothness, fragInputs.tangentToWorld[2], surfaceDescription.SpecularAAScreenSpaceVariance, surfaceDescription.SpecularAAThreshold); + #endif + } + + void GetSurfaceAndBuiltinData(VertexToPixel m2ps, FragInputs fragInputs, float3 V, inout PositionInputs posInput, + out SurfaceData surfaceData, out BuiltinData builtinData, inout Surface l, inout ShaderData d + #if NEED_FACING + , bool facing + #endif + ) + { + // Removed since crossfade does not work, probably needs extra material setup. + //#if !defined(SHADER_STAGE_RAY_TRACING) && !defined(_TESSELLATION_DISPLACEMENT) + // #ifdef LOD_FADE_CROSSFADE // enable dithering LOD transition if user select CrossFade transition in LOD group + // LODDitheringTransition(ComputeFadeMaskSeed(V, posInput.positionSS), unity_LODFade.x); + // #endif + //#endif + + + + + d = CreateShaderData(m2ps + #if NEED_FACING + , facing + #endif + ); + + l = (Surface)0; + + l.Albedo = half3(0.5, 0.5, 0.5); + l.Normal = float3(0,0,1); + l.Occlusion = 1; + l.Alpha = 1; + l.SpecularOcclusion = 1; + + #if !defined(SHADER_STAGE_RAY_TRACING) && defined(_DEPTHOFFSET_ON) + l.outputDepth = d.clipPos.z; + #endif + + ChainSurfaceFunction(l, d); + + #if !defined(SHADER_STAGE_RAY_TRACING) && defined(_DEPTHOFFSET_ON) + posInput.deviceDepth = l.outputDepth; + #endif + + #if _UNLIT + //l.Emission = l.Albedo; + //l.Albedo = 0; + l.Normal = half3(0,0,1); + l.Occlusion = 1; + l.Metallic = 0; + l.Specular = 0; + #endif + + surfaceData.geomNormalWS = d.worldSpaceNormal; + surfaceData.tangentWS = d.worldSpaceTangent; + fragInputs.tangentToWorld = d.TBNMatrix; + + float3 bentNormalWS; + + BuildSurfaceData(fragInputs, l, V, posInput, surfaceData, bentNormalWS); + + + float4 lightmapTexCoord1 = fragInputs.texCoord1; + float4 lightmapTexCoord2 = fragInputs.texCoord2; + //#ifdef FRAG_INPUTS_USE_TEXCOORD1 + // float4 lightmapTexCoord1 = fragInputs.texCoord1; + // #else + // float4 lightmapTexCoord1 = float4(0,0,0,0); + // #endif + + // #ifdef FRAG_INPUTS_USE_TEXCOORD2 + // float4 lightmapTexCoord2 = fragInputs.texCoord2; + // #else + // float4 lightmapTexCoord2 = float4(0,0,0,0); + // #endif + + + InitBuiltinData(posInput, l.Alpha, bentNormalWS, -d.worldSpaceNormal, lightmapTexCoord1, lightmapTexCoord2, builtinData); + + + + builtinData.emissiveColor = l.Emission; + + #if defined(_OVERRIDE_BAKEDGI) + builtinData.bakeDiffuseLighting = l.DiffuseGI; + builtinData.backBakeDiffuseLighting = l.BackDiffuseGI; + builtinData.emissiveColor += l.SpecularGI; + #endif + + #if defined(_OVERRIDE_SHADOWMASK) + builtinData.shadowMask0 = l.ShadowMask.x; + builtinData.shadowMask1 = l.ShadowMask.y; + builtinData.shadowMask2 = l.ShadowMask.z; + builtinData.shadowMask3 = l.ShadowMask.w; + #endif + + #ifdef UNITY_VIRTUAL_TEXTURING + //builtinData.vtPackedFeedback = surfaceData.VTPackedFeedback; + #endif + + #if (SHADERPASS == SHADERPASS_DISTORTION) + builtinData.distortion = surfaceData.Distortion; + builtinData.distortionBlur = surfaceData.DistortionBlur; + #endif + + #ifndef SHADER_UNLIT + // PostInitBuiltinData call ApplyDebugToBuiltinData + PostInitBuiltinData(V, posInput, surfaceData, builtinData); + #else + ApplyDebugToBuiltinData(builtinData); + #endif + + RAY_TRACING_OPTIONAL_ALPHA_TEST_PASS + } + + + + #ifdef UNITY_VIRTUAL_TEXTURING + #define VT_BUFFER_TARGET SV_Target1 + #define EXTRA_BUFFER_TARGET SV_Target2 + #else + #define EXTRA_BUFFER_TARGET SV_Target1 + #endif + + + + + void Frag(VertexToPixel v2p, + #ifdef OUTPUT_SPLIT_LIGHTING + out float4 outColor : SV_Target0, // outSpecularLighting + #ifdef UNITY_VIRTUAL_TEXTURING + out float4 outVTFeedback : VT_BUFFER_TARGET, + #endif + out float4 outDiffuseLighting : EXTRA_BUFFER_TARGET, + OUTPUT_SSSBUFFER(outSSSBuffer) + #else + out float4 outColor : SV_Target0 + #ifdef UNITY_VIRTUAL_TEXTURING + ,out float4 outVTFeedback : VT_BUFFER_TARGET + #endif + #ifdef _WRITE_TRANSPARENT_MOTION_VECTOR + , out float4 outMotionVec : EXTRA_BUFFER_TARGET + #endif // _WRITE_TRANSPARENT_MOTION_VECTOR + #endif // OUTPUT_SPLIT_LIGHTING + #ifdef _DEPTHOFFSET_ON + , out float outputDepth : SV_Depth + #endif + #if NEED_FACING + , bool facing : SV_IsFrontFace + #endif + ) + { + #ifdef _WRITE_TRANSPARENT_MOTION_VECTOR + // Init outMotionVector here to solve compiler warning (potentially unitialized variable) + // It is init to the value of forceNoMotion (with 2.0) + outMotionVec = float4(2.0, 0.0, 0.0, 0.0); + #endif + + UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX(v2p); + FragInputs input = BuildFragInputs(v2p); + + // We need to readapt the SS position as our screen space positions are for a low res buffer, but we try to access a full res buffer. + input.positionSS.xy = _OffScreenRendering > 0 ? (input.positionSS.xy * _OffScreenDownsampleFactor) : input.positionSS.xy; + + uint2 tileIndex = uint2(input.positionSS.xy) / GetTileSize(); + + // input.positionSS is SV_Position + PositionInputs posInput = GetPositionInput(input.positionSS.xy, _ScreenSize.zw, input.positionSS.z, input.positionSS.w, input.positionRWS.xyz, tileIndex); + + + float3 V = GetWorldSpaceNormalizeViewDir(input.positionRWS); + + + SurfaceData surfaceData; + BuiltinData builtinData; + Surface l; + ShaderData d; + GetSurfaceAndBuiltinData(v2p, input, V, posInput, surfaceData, builtinData, l, d + #if NEED_FACING + , facing + #endif + ); + + + BSDFData bsdfData = ConvertSurfaceDataToBSDFData(input.positionSS.xy, surfaceData); + + PreLightData preLightData = GetPreLightData(V, posInput, bsdfData); + + outColor = float4(0.0, 0.0, 0.0, 0.0); + + // We need to skip lighting when doing debug pass because the debug pass is done before lighting so some buffers may not be properly initialized potentially causing crashes on PS4. + + #ifdef DEBUG_DISPLAY + // Init in debug display mode to quiet warning + #ifdef OUTPUT_SPLIT_LIGHTING + outDiffuseLighting = 0; + ENCODE_INTO_SSSBUFFER(surfaceData, posInput.positionSS, outSSSBuffer); + #endif + + + + // Same code in ShaderPassForwardUnlit.shader + // Reminder: _DebugViewMaterialArray[i] + // i==0 -> the size used in the buffer + // i>0 -> the index used (0 value means nothing) + // The index stored in this buffer could either be + // - a gBufferIndex (always stored in _DebugViewMaterialArray[1] as only one supported) + // - a property index which is different for each kind of material even if reflecting the same thing (see MaterialSharedProperty) + bool viewMaterial = false; + int bufferSize = _DebugViewMaterialArray[0].x; + if (bufferSize != 0) + { + bool needLinearToSRGB = false; + float3 result = float3(1.0, 0.0, 1.0); + + // Loop through the whole buffer + // Works because GetSurfaceDataDebug will do nothing if the index is not a known one + for (int index = 1; index <= bufferSize; index++) + { + int indexMaterialProperty = _DebugViewMaterialArray[index].x; + + // skip if not really in use + if (indexMaterialProperty != 0) + { + viewMaterial = true; + + GetPropertiesDataDebug(indexMaterialProperty, result, needLinearToSRGB); + GetVaryingsDataDebug(indexMaterialProperty, input, result, needLinearToSRGB); + GetBuiltinDataDebug(indexMaterialProperty, builtinData, posInput, result, needLinearToSRGB); + GetSurfaceDataDebug(indexMaterialProperty, surfaceData, result, needLinearToSRGB); + GetBSDFDataDebug(indexMaterialProperty, bsdfData, result, needLinearToSRGB); + } + } + + // TEMP! + // For now, the final blit in the backbuffer performs an sRGB write + // So in the meantime we apply the inverse transform to linear data to compensate. + if (!needLinearToSRGB) + result = SRGBToLinear(max(0, result)); + + outColor = float4(result, 1.0); + } + + if (!viewMaterial) + { + if (_DebugFullScreenMode == FULLSCREENDEBUGMODE_VALIDATE_DIFFUSE_COLOR || _DebugFullScreenMode == FULLSCREENDEBUGMODE_VALIDATE_SPECULAR_COLOR) + { + float3 result = float3(0.0, 0.0, 0.0); + + GetPBRValidatorDebug(surfaceData, result); + + outColor = float4(result, 1.0f); + } + else if (_DebugFullScreenMode == FULLSCREENDEBUGMODE_TRANSPARENCY_OVERDRAW) + { + float4 result = _DebugTransparencyOverdrawWeight * float4(TRANSPARENCY_OVERDRAW_COST, TRANSPARENCY_OVERDRAW_COST, TRANSPARENCY_OVERDRAW_COST, TRANSPARENCY_OVERDRAW_A); + outColor = result; + } + else + #endif + { + #ifdef _SURFACE_TYPE_TRANSPARENT + uint featureFlags = LIGHT_FEATURE_MASK_FLAGS_TRANSPARENT; + #else + uint featureFlags = LIGHT_FEATURE_MASK_FLAGS_OPAQUE; + #endif + + LightLoopOutput lightLoopOutput; + LightLoop(V, posInput, preLightData, bsdfData, builtinData, featureFlags, lightLoopOutput); + + float3 diffuseLighting = lightLoopOutput.diffuseLighting; + float3 specularLighting = lightLoopOutput.specularLighting; + + diffuseLighting *= GetCurrentExposureMultiplier(); + specularLighting *= GetCurrentExposureMultiplier(); + + #ifdef OUTPUT_SPLIT_LIGHTING + if (_EnableSubsurfaceScattering != 0 && ShouldOutputSplitLighting(bsdfData)) + { + outColor = float4(specularLighting, 1.0); + outDiffuseLighting = float4(TagLightingForSSS(diffuseLighting), 1.0); + } + else + { + outColor = float4(diffuseLighting + specularLighting, 1.0); + outDiffuseLighting = 0; + } + ENCODE_INTO_SSSBUFFER(surfaceData, posInput.positionSS, outSSSBuffer); + #else + outColor = ApplyBlendMode(diffuseLighting, specularLighting, builtinData.opacity); + outColor = EvaluateAtmosphericScattering(posInput, V, outColor); + #endif + + ChainFinalColorForward(l, d, outColor); + + #ifdef _WRITE_TRANSPARENT_MOTION_VECTOR + bool forceNoMotion = any(unity_MotionVectorsParams.yw == 0.0); + // outMotionVec is already initialize at the value of forceNoMotion (see above) + if (!forceNoMotion) + { + float2 motionVec = CalculateMotionVector(v2p.motionVectorCS, v2p.previousPositionCS); + EncodeMotionVector(motionVec * 0.5, outMotionVec); + outMotionVec.zw = 1.0; + } + #endif + } + + #ifdef DEBUG_DISPLAY + } + #endif + + #ifdef _DEPTHOFFSET_ON + outputDepth = l.outputDepth; + #endif + + #ifdef UNITY_VIRTUAL_TEXTURING + outVTFeedback = builtinData.vtPackedFeedback; + #endif + } + + ENDHLSL + } + Pass + { + // based on HDLitPass.template + Name "GBuffer" + Tags { "LightMode" = "GBuffer" } + //------------------------------------------------------------------------------------- + // Render Modes (Blend, Cull, ZTest, Stencil, etc) + //------------------------------------------------------------------------------------- + + Cull Back + ZTest [_ZTestGBuffer] + Stencil + { + WriteMask [_StencilWriteMaskGBuffer] + Ref [_StencilRefGBuffer] + CompFront Always + PassFront Replace + CompBack Always + PassBack Replace + } + + Tags { "RenderType" = "Opaque" "Queue" = "Geometry" "PreviewType" = "Plane" } + Cull [_CullingOption] + ZWrite [_ZWrite] + ZTest [_ZTestMode] + + + //------------------------------------------------------------------------------------- + // End Render Modes + //------------------------------------------------------------------------------------- + + HLSLPROGRAM + + #pragma multi_compile _ DOTS_INSTANCING_ON + #pragma instancing_options renderinglayer + #pragma target 4.5 + + #pragma only_renderers d3d11 playstation xboxone xboxseries vulkan metal switch + #pragma multi_compile_instancing + #pragma multi_compile _ LOD_FADE_CROSSFADE + #pragma multi_compile_fragment _ RENDERING_LAYERS + //#pragma multi_compile_raytracing _ LIGHT_LAYERS + //#pragma shader_feature _ _SURFACE_TYPE_TRANSPARENT + //#pragma shader_feature_local _BLENDMODE_OFF _BLENDMODE_ALPHA _BLENDMODE_ADD _BLENDMODE_PRE_MULTIPLY + //#pragma shader_feature_local _ _ADD_PRECOMPUTED_VELOCITY + //#pragma shader_feature_local _ _TRANSPARENT_WRITES_MOTION_VEC + //#pragma shader_feature_local _ _ENABLE_FOG_ON_TRANSPARENT + #pragma multi_compile _ DEBUG_DISPLAY + //#pragma shader_feature_local _ _DISABLE_DECALS + //#pragma shader_feature_local _ _DISABLE_SSR + //#pragma shader_feature_local _ _DISABLE_SSR_TRANSPARENT + #pragma multi_compile _ LIGHTMAP_ON + #pragma multi_compile _ DIRLIGHTMAP_COMBINED + #pragma multi_compile_fragment PROBE_VOLUMES_OFF PROBE_VOLUMES_L1 PROBE_VOLUMES_L2 + #pragma multi_compile _ DYNAMICLIGHTMAP_ON + #pragma multi_compile_fragment _ SHADOWS_SHADOWMASK + #pragma multi_compile_fragment DECALS_OFF DECALS_3RT DECALS_4RT + #pragma multi_compile_fragment _ DECAL_SURFACE_GRADIENT + #pragma multi_compile _ USE_LEGACY_LIGHTMAPS + //#pragma shader_feature_local _REFRACTION_OFF _REFRACTION_PLANE _REFRACTION_SPHERE _REFRACTION_THIN + + + //------------------------------------------------------------------------------------- + // Variant Definitions (active field translations to HDRP defines) + //------------------------------------------------------------------------------------- + // #define _MATERIAL_FEATURE_SUBSURFACE_SCATTERING 1 + // #define _MATERIAL_FEATURE_TRANSMISSION 1 + // #define _MATERIAL_FEATURE_ANISOTROPY 1 + // #define _MATERIAL_FEATURE_IRIDESCENCE 1 + // #define _MATERIAL_FEATURE_SPECULAR_COLOR 1 + #define _ENABLE_FOG_ON_TRANSPARENT 1 + // #define _AMBIENT_OCCLUSION 1 + // #define _SPECULAR_OCCLUSION_FROM_AO 1 + // #define _SPECULAR_OCCLUSION_FROM_AO_BENT_NORMAL 1 + // #define _SPECULAR_OCCLUSION_CUSTOM 1 + // #define _ENERGY_CONSERVING_SPECULAR 1 + // #define _ENABLE_GEOMETRIC_SPECULAR_AA 1 + // #define _HAS_REFRACTION 1 + // #define _REFRACTION_PLANE 1 + // #define _REFRACTION_SPHERE 1 + // #define _DISABLE_DECALS 1 + // #define _DISABLE_SSR 1 + // #define _ADD_PRECOMPUTED_VELOCITY + // #define _WRITE_TRANSPARENT_MOTION_VECTOR 1 + // #define _DEPTHOFFSET_ON 1 + // #define _BLENDMODE_PRESERVE_SPECULAR_LIGHTING 1 + + #define SHADERPASS SHADERPASS_GBUFFER + #define RAYTRACING_SHADER_GRAPH_DEFAULT + #define _PASSGBUFFER 1 + + + #pragma shader_feature_local GLOW_ON + #pragma shader_feature_local FADE_ON + #pragma shader_feature_local OUTBASE_ON + #pragma shader_feature_local ONLYOUTLINE_ON + #pragma shader_feature_local GRADIENT_ON + #pragma shader_feature_local GRADIENT2COL_ON + #pragma shader_feature_local RADIALGRADIENT_ON + #pragma shader_feature_local COLORSWAP_ON + #pragma shader_feature_local HSV_ON + #pragma shader_feature_local CHANGECOLOR_ON + #pragma shader_feature_local CHANGECOLOR2_ON + #pragma shader_feature_local CHANGECOLOR3_ON + #pragma shader_feature_local COLORRAMP_ON + #pragma shader_feature_local GRADIENTCOLORRAMP_ON + #pragma shader_feature_local HITEFFECT_ON + #pragma shader_feature_local NEGATIVE_ON + #pragma shader_feature_local PIXELATE_ON + #pragma shader_feature_local GREYSCALE_ON + #pragma shader_feature_local POSTERIZE_ON + #pragma shader_feature_local BLUR_ON + #pragma shader_feature_local MOTIONBLUR_ON + #pragma shader_feature_local GHOST_ON + #pragma shader_feature_local ALPHAOUTLINE_ON + #pragma shader_feature_local INNEROUTLINE_ON + #pragma shader_feature_local ONLYINNEROUTLINE_ON + #pragma shader_feature_local HOLOGRAM_ON + #pragma shader_feature_local CHROMABERR_ON + #pragma shader_feature_local GLITCH_ON + #pragma shader_feature_local FLICKER_ON + #pragma shader_feature_local SHADOW_ON + #pragma shader_feature_local SHINE_ON + #pragma shader_feature_local CONTRAST_ON + #pragma shader_feature_local OVERLAY_ON + #pragma shader_feature_local OVERLAYMULT_ON + #pragma shader_feature_local DOODLE_ON + #pragma shader_feature_local WIND_ON + #pragma shader_feature_local WAVEUV_ON + #pragma shader_feature_local ROUNDWAVEUV_ON + #pragma shader_feature_local RECTSIZE_ON + #pragma shader_feature_local OFFSETUV_ON + #pragma shader_feature_local CLIPPING_ON + #pragma shader_feature_local RADIALCLIPPING_ON + #pragma shader_feature_local TEXTURESCROLL_ON + #pragma shader_feature_local ZOOMUV_ON + #pragma shader_feature_local DISTORT_ON + #pragma shader_feature_local WARP_ON + #pragma shader_feature_local TWISTUV_ON + #pragma shader_feature_local ROTATEUV_ON + #pragma shader_feature_local POLARUV_ON + #pragma shader_feature_local FISHEYE_ON + #pragma shader_feature_local PINCH_ON + #pragma shader_feature_local SHAKEUV_ON + + #pragma shader_feature_local GLOWTEX_ON + #pragma shader_feature_local OUTTEX_ON + #pragma shader_feature_local OUTDIST_ON + #pragma shader_feature_local OUTBASE8DIR_ON + #pragma shader_feature_local OUTBASEPIXELPERF_ON + #pragma shader_feature_local COLORRAMPOUTLINE_ON + #pragma shader_feature_local GREYSCALEOUTLINE_ON + #pragma shader_feature_local POSTERIZEOUTLINE_ON + #pragma shader_feature_local BLURISHD_ON + #pragma shader_feature_local MANUALWIND_ON + #pragma shader_feature_local ATLAS_ON + #pragma shader_feature_local PREMULTIPLYALPHA_ON + + #pragma shader_feature BILBOARD_ON + #pragma shader_feature BILBOARDY_ON + + #pragma shader_feature NORMALMAP_ON + + + #define _HDRP 1 +#define _USINGTEXCOORD1 1 +#define _USINGTEXCOORD2 1 + + + #pragma vertex Vert + #pragma fragment Frag + + + //------------------------------------------------------------------------------------- + // Defines + //------------------------------------------------------------------------------------- + + + + + // useful conversion functions to make surface shader code just work + + #define UNITY_DECLARE_TEX2D(name) TEXTURE2D(name); SAMPLER(sampler##name); + #define UNITY_DECLARE_TEX2D_NOSAMPLER(name) TEXTURE2D(name); + #define UNITY_DECLARE_TEX2DARRAY(name) TEXTURE2D_ARRAY(name); SAMPLER(sampler##name); + #define UNITY_DECLARE_TEX2DARRAY_NOSAMPLER(tex) TEXTURE2D_ARRAY(tex); + + #define UNITY_SAMPLE_TEX2DARRAY(tex,coord) SAMPLE_TEXTURE2D_ARRAY(tex, sampler##tex, coord.xy, coord.z) + #define UNITY_SAMPLE_TEX2DARRAY_LOD(tex,coord,lod) SAMPLE_TEXTURE2D_ARRAY_LOD(tex, sampler##tex, coord.xy, coord.z, lod) + #define UNITY_SAMPLE_TEX2D(tex, coord) SAMPLE_TEXTURE2D(tex, sampler##tex, coord) + #define UNITY_SAMPLE_TEX2D_SAMPLER(tex, samp, coord) SAMPLE_TEXTURE2D(tex, sampler##samp, coord) + + #define UNITY_SAMPLE_TEX2D_LOD(tex,coord, lod) SAMPLE_TEXTURE2D_LOD(tex, sampler_##tex, coord, lod) + #define UNITY_SAMPLE_TEX2D_SAMPLER_LOD(tex,samplertex,coord, lod) SAMPLE_TEXTURE2D_LOD (tex, sampler##samplertex,coord, lod) + + #if defined(UNITY_COMPILER_HLSL) + #define UNITY_INITIALIZE_OUTPUT(type,name) name = (type)0; + #else + #define UNITY_INITIALIZE_OUTPUT(type,name) + #endif + + #define sampler2D_float sampler2D + #define sampler2D_half sampler2D + + #undef WorldNormalVector + #define WorldNormalVector(data, normal) mul(normal, data.TBNMatrix) + + #define UnityObjectToWorldNormal(normal) mul(GetObjectToWorldMatrix(), normal) + + #ifndef SHADER_STAGE_FRAGMENT + #if !defined(SHADOW_ULTRA_LOW) && !defined(SHADOW_LOW) && !defined(SHADOW_MEDIUM) && !defined(SHADOW_HIGH) // ultra low come from volumetricLighting.compute + #define SHADOW_MEDIUM + #endif + #if !defined(AREA_SHADOW_LOW) && !defined(AREA_SHADOW_MEDIUM) && !defined(AREA_SHADOW_HIGH) // low come from volumetricLighting.compute + #define AREA_SHADOW_MEDIUM + #endif + #endif + + + +// HDRP Adapter stuff + #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Common.hlsl" + #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Common.hlsl" + #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/GeometricTools.hlsl" // Required by Tessellation.hlsl + #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Tessellation.hlsl" + #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Texture.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/ShaderVariables.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/ShaderPass/ShaderPass.cs.hlsl" + #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/TextureStack.hlsl" // Required to be include before we include properties as it define DECLARE_STACK_CB + #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/DebugMipmapStreamingMacros.hlsl" // Required before including properties as it defines UNITY_TEXTURE_STREAMING_DEBUG_VARS + // Always include Shader Graph version + // Always include last to avoid double macros + #include "Packages/com.unity.shadergraph/ShaderGraphLibrary/Functions.hlsl" // Need to be here for Gradient struct definition + + +#include "Packages/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/ShaderPass/FragInputs.hlsl" + + + + #ifdef RAYTRACING_SHADER_GRAPH_DEFAULT + #define RAYTRACING_SHADER_GRAPH_HIGH + #endif + + #ifdef RAYTRACING_SHADER_GRAPH_RAYTRACED + #define RAYTRACING_SHADER_GRAPH_LOW + #endif + // end + + + + + // If we use subsurface scattering, enable output split lighting (for forward pass) + #if defined(_MATERIAL_FEATURE_SUBSURFACE_SCATTERING) && !defined(_SURFACE_TYPE_TRANSPARENT) + #define OUTPUT_SPLIT_LIGHTING + #endif + + #define HAVE_RECURSIVE_RENDERING + + #if SHADERPASS == SHADERPASS_TRANSPARENT_DEPTH_PREPASS + #if !defined(_DISABLE_SSR_TRANSPARENT) && !defined(SHADER_UNLIT) + #define WRITE_NORMAL_BUFFER + #endif + #endif + + #ifndef DEBUG_DISPLAY + // In case of opaque we don't want to perform the alpha test, it is done in depth prepass and we use depth equal for ztest (setup from UI) + // Don't do it with debug display mode as it is possible there is no depth prepass in this case + #if !defined(_SURFACE_TYPE_TRANSPARENT) && defined(_ALPHATEST) + #if SHADERPASS == SHADERPASS_FORWARD + #define SHADERPASS_FORWARD_BYPASS_ALPHA_TEST + #elif SHADERPASS == SHADERPASS_GBUFFER + #define SHADERPASS_GBUFFER_BYPASS_ALPHA_TEST + #endif + #endif + #endif + + // Define _DEFERRED_CAPABLE_MATERIAL for shader capable to run in deferred pass + #if defined(SHADER_LIT) && !defined(_SURFACE_TYPE_TRANSPARENT) + #define _DEFERRED_CAPABLE_MATERIAL + #endif + + // Translate transparent motion vector define + #if defined(_TRANSPARENT_WRITES_MOTION_VEC) && defined(_SURFACE_TYPE_TRANSPARENT) + #define _WRITE_TRANSPARENT_MOTION_VECTOR + #endif + + + + + CBUFFER_START(UnityPerMaterial) + float _UseShadowThreshold; + float _BlendMode; + float _EnableBlendModePreserveSpecularLighting; + float _RayTracing; + float _RefractionModel; + + + half4 _Color; + half4 _MainTex_ST, _MainTex_TexelSize; + half _Alpha, _AlphaCutoffValue; + + #if ATLAS_ON + half _MinXUV, _MaxXUV, _MinYUV, _MaxYUV; + #endif + + #if GLOW_ON + half4 _GlowColor; + half _Glow, _GlowGlobal; + #endif + + #if HSV_ON + half _HsvShift, _HsvSaturation, _HsvBright; + #endif + + #if DISTORT_ON + half4 _DistortTex_ST; + half _DistortTexXSpeed, _DistortTexYSpeed, _DistortAmount; + #endif + + #if FADE_ON + half4 _FadeBurnColor, _FadeTex_ST, _FadeBurnTex_ST; + half _FadeAmount, _FadeBurnWidth, _FadeBurnTransition,_FadeBurnGlow; + #endif + + #if OUTBASE_ON + half4 _OutlineColor; + half _OutlineAlpha, _OutlineGlow, _OutlineWidth; + int _OutlinePixelWidth; + #endif + + #if OUTTEX_ON + half4 _OutlineTex_ST; + half _OutlineTexXSpeed, _OutlineTexYSpeed; + #endif + + #if OUTDIST_ON + half4 _OutlineDistortTex_ST; + half _OutlineDistortTexXSpeed, _OutlineDistortTexYSpeed, _OutlineDistortAmount; + #endif + + #if ALPHAOUTLINE_ON + half _AlphaOutlineGlow, _AlphaOutlinePower, _AlphaOutlineMinAlpha, _AlphaOutlineBlend; + half4 _AlphaOutlineColor; + #endif + + #if INNEROUTLINE_ON + half _InnerOutlineThickness, _InnerOutlineAlpha, _InnerOutlineGlow; + half4 _InnerOutlineColor; + #endif + + #if GRADIENT_ON + half _GradBlend, _GradBoostX, _GradBoostY; + half4 _GradTopRightCol, _GradTopLeftCol, _GradBotRightCol, _GradBotLeftCol; + #endif + + #if COLORSWAP_ON + half4 _ColorSwapRed, _ColorSwapGreen, _ColorSwapBlue; + half _ColorSwapRedLuminosity, _ColorSwapGreenLuminosity, _ColorSwapBlueLuminosity, _ColorSwapBlend; + #endif + + #if CHANGECOLOR_ON + half4 _ColorChangeNewCol, _ColorChangeTarget; + half _ColorChangeTolerance, _ColorChangeLuminosity; + #endif + #if CHANGECOLOR2_ON + half4 _ColorChangeNewCol2, _ColorChangeTarget2; + half _ColorChangeTolerance2; + #endif + #if CHANGECOLOR3_ON + half4 _ColorChangeNewCol3, _ColorChangeTarget3; + half _ColorChangeTolerance3; + #endif + + #if COLORRAMP_ON + half _ColorRampLuminosity, _ColorRampBlend; + #endif + + #if HITEFFECT_ON + half4 _HitEffectColor; + half _HitEffectGlow, _HitEffectBlend; + #endif + + #if NEGATIVE_ON + half _NegativeAmount; + #endif + + #if PIXELATE_ON + half _PixelateSize; + #endif + + #if GREYSCALE_ON + half _GreyscaleLuminosity, _GreyscaleBlend; + half4 _GreyscaleTintColor; + #endif + + #if POSTERIZE_ON + half _PosterizeNumColors, _PosterizeGamma; + #endif + + #if BLUR_ON + half _BlurIntensity; + #endif + + #if MOTIONBLUR_ON + half _MotionBlurAngle, _MotionBlurDist; + #endif + + #if GHOST_ON + half _GhostColorBoost, _GhostTransparency, _GhostBlend; + #endif + + #if HOLOGRAM_ON + half _HologramStripesAmount, _HologramMinAlpha, _HologramUnmodAmount, _HologramStripesSpeed, _HologramMaxAlpha, _HologramBlend; + half4 _HologramStripeColor; + #endif + + #if CHROMABERR_ON + half _ChromAberrAmount, _ChromAberrAlpha; + #endif + + #if GLITCH_ON + half _GlitchAmount, _GlitchSize; + #endif + + #if FLICKER_ON + half _FlickerFreq, _FlickerPercent, _FlickerAlpha; + #endif + + #if SHADOW_ON + half _ShadowX, _ShadowY, _ShadowAlpha; + half4 _ShadowColor; + #endif + + #if SHINE_ON + half4 _ShineColor; + half _ShineLocation, _ShineRotate, _ShineWidth, _ShineGlow; + #endif + + #if CONTRAST_ON + half _Contrast, _Brightness; + #endif + + #if OVERLAY_ON + half4 _OverlayTex_ST, _OverlayColor; + half _OverlayGlow, _OverlayBlend, _OverlayTextureScrollXSpeed, _OverlayTextureScrollYSpeed; + #endif + + #if DOODLE_ON + half _HandDrawnAmount, _HandDrawnSpeed; + #endif + + #if WIND_ON + half _GrassSpeed, _GrassWind, _GrassManualAnim, _GrassRadialBend; + #endif + + #if WAVEUV_ON + float _WaveAmount, _WaveSpeed, _WaveStrength, _WaveX, _WaveY; + #endif + + #if ROUNDWAVEUV_ON + half _RoundWaveStrength, _RoundWaveSpeed; + #endif + + #if RECTSIZE_ON + half _RectSize; + #endif + + #if OFFSETUV_ON + half _OffsetUvX, _OffsetUvY; + #endif + + #if CLIPPING_ON + half _ClipUvLeft, _ClipUvRight, _ClipUvUp, _ClipUvDown; + #endif + + #if RADIALCLIPPING_ON + half _RadialStartAngle, _RadialClip, _RadialClip2; + #endif + + #if TEXTURESCROLL_ON + half _TextureScrollXSpeed, _TextureScrollYSpeed; + #endif + + #if ZOOMUV_ON + half _ZoomUvAmount; + #endif + + #if WARP_ON + half _WarpStrength, _WarpSpeed, _WarpScale; + #endif + + #if TWISTUV_ON + half _TwistUvAmount, _TwistUvPosX, _TwistUvPosY, _TwistUvRadius; + #endif + + #if ROTATEUV_ON + half _RotateUvAmount; + #endif + + #if FISHEYE_ON + half _FishEyeUvAmount; + #endif + + #if PINCH_ON + half _PinchUvAmount; + #endif + + #if SHAKEUV_ON + half _ShakeUvSpeed, _ShakeUvX, _ShakeUvY; + #endif + + #if NORMALMAP_ON + half _NormalStrength; + #endif + + float _RandomSeed; + + + + + CBUFFER_END + + + + // -- Property used by ScenePickingPass + #ifdef SCENEPICKINGPASS + float4 _SelectionID; + #endif + + // -- Properties used by SceneSelectionPass + #ifdef SCENESELECTIONPASS + int _ObjectId; + int _PassValue; + #endif + + + // data across stages, stripped like the above. + struct VertexToPixel + { + float4 pos : SV_POSITION; + float3 worldPos : TEXCOORD0; + float3 worldNormal : TEXCOORD1; + float4 worldTangent : TEXCOORD2; + float4 texcoord0 : TEXCOORD3; + float4 texcoord1 : TEXCOORD4; + float4 texcoord2 : TEXCOORD5; + // #if %TEXCOORD3REQUIREKEY% + float4 texcoord3 : TEXCOORD6; + // #endif + + // #if %SCREENPOSREQUIREKEY% + // float4 screenPos : TEXCOORD7; + // #endif + + // #if %VERTEXCOLORREQUIREKEY% + float4 vertexColor : COLOR; + // #endif + + // #if %EXTRAV2F0REQUIREKEY% + // float4 extraV2F0 : TEXCOORD8; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // float4 extraV2F1 : TEXCOORD9; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // float4 extraV2F2 : TEXCOORD10; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // float4 extraV2F3 : TEXCOORD11; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // float4 extraV2F4 : TEXCOORD12; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // float4 extraV2F5 : TEXCOORD13; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // float4 extraV2F6 : TEXCOORD14; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // float4 extraV2F7 : TEXCOORD15; + // #endif + + #if UNITY_ANY_INSTANCING_ENABLED + UNITY_VERTEX_INPUT_INSTANCE_ID + #endif // UNITY_ANY_INSTANCING_ENABLED + + #if _HDRP && (_PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR))) + float4 previousPositionCS : TEXCOORD16; // Contain previous transform position (in case of skinning for example) + float4 motionVectorCS : TEXCOORD17; + #endif + + UNITY_VERTEX_OUTPUT_STEREO + }; + + + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Debug/DebugDisplay.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/Material.hlsl" + #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/NormalSurfaceGradient.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/Lit/Lit.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/BuiltinUtilities.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/MaterialUtilities.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/Decal/DecalUtilities.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/Lit/LitDecalData.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/ShaderGraphFunctions.hlsl" + + + + + + // data describing the user output of a pixel + struct Surface + { + half3 Albedo; + half Height; + half3 Normal; + half Smoothness; + half3 Emission; + half Metallic; + half3 Specular; + half Occlusion; + half SpecularPower; // for simple lighting + half Alpha; + float outputDepth; // if written, SV_Depth semantic is used. ShaderData.clipPos.z is unused value + // HDRP Only + half SpecularOcclusion; + half SubsurfaceMask; + half Thickness; + half CoatMask; + half CoatSmoothness; + half Anisotropy; + half IridescenceMask; + half IridescenceThickness; + int DiffusionProfileHash; + float SpecularAAThreshold; + float SpecularAAScreenSpaceVariance; + // requires _OVERRIDE_BAKEDGI to be defined, but is mapped in all pipelines + float3 DiffuseGI; + float3 BackDiffuseGI; + float3 SpecularGI; + float ior; + float3 transmittanceColor; + float atDistance; + float transmittanceMask; + // requires _OVERRIDE_SHADOWMASK to be defines + float4 ShadowMask; + + // for decals + float NormalAlpha; + float MAOSAlpha; + + + }; + + // Data the user declares in blackboard blocks + struct Blackboard + { + + float blackboardDummyData; + }; + + // data the user might need, this will grow to be big. But easy to strip + struct ShaderData + { + float4 clipPos; // SV_POSITION + float3 localSpacePosition; + float3 localSpaceNormal; + float3 localSpaceTangent; + + float3 worldSpacePosition; + float3 worldSpaceNormal; + float3 worldSpaceTangent; + float tangentSign; + + float3 worldSpaceViewDir; + float3 tangentSpaceViewDir; + + float4 texcoord0; + float4 texcoord1; + float4 texcoord2; + float4 texcoord3; + + float2 screenUV; + float4 screenPos; + + float4 vertexColor; + bool isFrontFace; + + float4 extraV2F0; + float4 extraV2F1; + float4 extraV2F2; + float4 extraV2F3; + float4 extraV2F4; + float4 extraV2F5; + float4 extraV2F6; + float4 extraV2F7; + + float3x3 TBNMatrix; + Blackboard blackboard; + }; + + struct VertexData + { + #if SHADER_TARGET > 30 + // uint vertexID : SV_VertexID; + #endif + float4 vertex : POSITION; + float3 normal : NORMAL; + float4 tangent : TANGENT; + float4 texcoord0 : TEXCOORD0; + + // optimize out mesh coords when not in use by user or lighting system + #if _URP && (_USINGTEXCOORD1 || _PASSMETA || _PASSFORWARD || _PASSGBUFFER) + float4 texcoord1 : TEXCOORD1; + #endif + + #if _URP && (_USINGTEXCOORD2 || _PASSMETA || ((_PASSFORWARD || _PASSGBUFFER) && defined(DYNAMICLIGHTMAP_ON))) + float4 texcoord2 : TEXCOORD2; + #endif + + #if _STANDARD && (_USINGTEXCOORD1 || (_PASSMETA || ((_PASSFORWARD || _PASSGBUFFER || _PASSFORWARDADD) && LIGHTMAP_ON))) + float4 texcoord1 : TEXCOORD1; + #endif + #if _STANDARD && (_USINGTEXCOORD2 || (_PASSMETA || ((_PASSFORWARD || _PASSGBUFFER) && DYNAMICLIGHTMAP_ON))) + float4 texcoord2 : TEXCOORD2; + #endif + + + #if _HDRP + float4 texcoord1 : TEXCOORD1; + float4 texcoord2 : TEXCOORD2; + #endif + + // #if %TEXCOORD3REQUIREKEY% + float4 texcoord3 : TEXCOORD3; + // #endif + + // #if %VERTEXCOLORREQUIREKEY% + float4 vertexColor : COLOR; + // #endif + + #if _PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR)) + float3 previousPositionOS : TEXCOORD4; // Contain previous transform position (in case of skinning for example) + #if defined (_ADD_PRECOMPUTED_VELOCITY) + float3 precomputedVelocity : TEXCOORD5; // Add Precomputed Velocity (Alembic computes velocities on runtime side). + #endif + #endif + + UNITY_VERTEX_INPUT_INSTANCE_ID + }; + + struct TessVertex + { + float4 vertex : INTERNALTESSPOS; + float3 normal : NORMAL; + float4 tangent : TANGENT; + float4 texcoord0 : TEXCOORD0; + float4 texcoord1 : TEXCOORD1; + float4 texcoord2 : TEXCOORD2; + + // #if %TEXCOORD3REQUIREKEY% + float4 texcoord3 : TEXCOORD3; + // #endif + + // #if %VERTEXCOLORREQUIREKEY% + float4 vertexColor : COLOR; + // #endif + + // #if %EXTRAV2F0REQUIREKEY% + // float4 extraV2F0 : TEXCOORD5; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // float4 extraV2F1 : TEXCOORD6; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // float4 extraV2F2 : TEXCOORD7; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // float4 extraV2F3 : TEXCOORD8; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // float4 extraV2F4 : TEXCOORD9; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // float4 extraV2F5 : TEXCOORD10; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // float4 extraV2F6 : TEXCOORD11; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // float4 extraV2F7 : TEXCOORD12; + // #endif + + #if _PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR)) + float3 previousPositionOS : TEXCOORD13; // Contain previous transform position (in case of skinning for example) + #if defined (_ADD_PRECOMPUTED_VELOCITY) + float3 precomputedVelocity : TEXCOORD14; + #endif + #endif + + UNITY_VERTEX_INPUT_INSTANCE_ID + UNITY_VERTEX_OUTPUT_STEREO + }; + + struct ExtraV2F + { + float4 extraV2F0; + float4 extraV2F1; + float4 extraV2F2; + float4 extraV2F3; + float4 extraV2F4; + float4 extraV2F5; + float4 extraV2F6; + float4 extraV2F7; + Blackboard blackboard; + float4 time; + }; + + + float3 WorldToTangentSpace(ShaderData d, float3 normal) + { + return mul(d.TBNMatrix, normal); + } + + float3 TangentToWorldSpace(ShaderData d, float3 normal) + { + return mul(normal, d.TBNMatrix); + } + + // in this case, make standard more like SRPs, because we can't fix + // unity_WorldToObject in HDRP, since it already does macro-fu there + + #if _STANDARD + float3 TransformWorldToObject(float3 p) { return mul(unity_WorldToObject, float4(p, 1)); }; + float3 TransformObjectToWorld(float3 p) { return mul(unity_ObjectToWorld, float4(p, 1)); }; + float4 TransformWorldToObject(float4 p) { return mul(unity_WorldToObject, p); }; + float4 TransformObjectToWorld(float4 p) { return mul(unity_ObjectToWorld, p); }; + float4x4 GetWorldToObjectMatrix() { return unity_WorldToObject; } + float4x4 GetObjectToWorldMatrix() { return unity_ObjectToWorld; } + #if (defined(SHADER_API_D3D11) || defined(SHADER_API_XBOXONE) || defined(UNITY_COMPILER_HLSLCC) || defined(SHADER_API_PSSL) || (SHADER_TARGET_SURFACE_ANALYSIS && !SHADER_TARGET_SURFACE_ANALYSIS_MOJOSHADER)) + #define UNITY_SAMPLE_TEX2D_LOD(tex,coord, lod) tex.SampleLevel (sampler##tex,coord, lod) + #define UNITY_SAMPLE_TEX2D_SAMPLER_LOD(tex,samplertex,coord, lod) tex.SampleLevel (sampler##samplertex,coord, lod) + #else + #define UNITY_SAMPLE_TEX2D_LOD(tex,coord,lod) tex2D (tex,coord,0,lod) + #define UNITY_SAMPLE_TEX2D_SAMPLER_LOD(tex,samplertex,coord,lod) tex2D (tex,coord,0,lod) + #endif + + #undef GetWorldToObjectMatrix() + + #define GetWorldToObjectMatrix() unity_WorldToObject + + + #endif + + float3 GetCameraWorldPosition() + { + #if _HDRP + return GetCameraRelativePositionWS(_WorldSpaceCameraPos); + #else + return _WorldSpaceCameraPos; + #endif + } + + #if _GRABPASSUSED + #if _STANDARD + TEXTURE2D(%GRABTEXTURE%); + SAMPLER(sampler_%GRABTEXTURE%); + #endif + + half3 GetSceneColor(float2 uv) + { + #if _STANDARD + return SAMPLE_TEXTURE2D(%GRABTEXTURE%, sampler_%GRABTEXTURE%, uv).rgb; + #else + return SHADERGRAPH_SAMPLE_SCENE_COLOR(uv); + #endif + } + #endif + + + + #if _STANDARD + UNITY_DECLARE_DEPTH_TEXTURE(_CameraDepthTexture); + float GetSceneDepth(float2 uv) { return SAMPLE_DEPTH_TEXTURE(_CameraDepthTexture, uv); } + float GetLinear01Depth(float2 uv) { return Linear01Depth(GetSceneDepth(uv)); } + float GetLinearEyeDepth(float2 uv) { return LinearEyeDepth(GetSceneDepth(uv)); } + #else + float GetSceneDepth(float2 uv) { return SHADERGRAPH_SAMPLE_SCENE_DEPTH(uv); } + float GetLinear01Depth(float2 uv) { return Linear01Depth(GetSceneDepth(uv), _ZBufferParams); } + float GetLinearEyeDepth(float2 uv) { return LinearEyeDepth(GetSceneDepth(uv), _ZBufferParams); } + #endif + + float3 GetWorldPositionFromDepthBuffer(float2 uv, float3 worldSpaceViewDir) + { + float eye = GetLinearEyeDepth(uv); + float3 camView = mul((float3x3)GetObjectToWorldMatrix(), transpose(mul(GetWorldToObjectMatrix(), UNITY_MATRIX_I_V)) [2].xyz); + + float dt = dot(worldSpaceViewDir, camView); + float3 div = worldSpaceViewDir/dt; + float3 wpos = (eye * div) + GetCameraWorldPosition(); + return wpos; + } + + #if _HDRP + float3 ObjectToWorldSpacePosition(float3 pos) + { + return GetAbsolutePositionWS(TransformObjectToWorld(pos)); + } + #else + float3 ObjectToWorldSpacePosition(float3 pos) + { + return TransformObjectToWorld(pos); + } + #endif + + #if _STANDARD + UNITY_DECLARE_SCREENSPACE_TEXTURE(_CameraDepthNormalsTexture); + float3 GetSceneNormal(float2 uv, float3 worldSpaceViewDir) + { + float4 depthNorms = UNITY_SAMPLE_SCREENSPACE_TEXTURE(_CameraDepthNormalsTexture, uv); + float3 norms = DecodeViewNormalStereo(depthNorms); + norms = mul((float3x3)GetWorldToViewMatrix(), norms) * 0.5 + 0.5; + return norms; + } + #elif _HDRP && !_DECALSHADER + + float3 GetSceneNormal(float2 uv, float3 worldSpaceViewDir) + { + NormalData nd; + DecodeFromNormalBuffer(_ScreenSize.xy * uv, nd); + return nd.normalWS; + } + #elif _URP + #if (SHADER_LIBRARY_VERSION_MAJOR >= 10) + #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/DeclareNormalsTexture.hlsl" + #endif + + float3 GetSceneNormal(float2 uv, float3 worldSpaceViewDir) + { + #if (SHADER_LIBRARY_VERSION_MAJOR >= 10) + return SampleSceneNormals(uv); + #else + float3 wpos = GetWorldPositionFromDepthBuffer(uv, worldSpaceViewDir); + return normalize(-cross(ddx(wpos), ddy(wpos))) * 0.5 + 0.5; + #endif + + } + #endif + + #if _HDRP + + half3 UnpackNormalmapRGorAG(half4 packednormal) + { + // This do the trick + packednormal.x *= packednormal.w; + + half3 normal; + normal.xy = packednormal.xy * 2 - 1; + normal.z = sqrt(1 - saturate(dot(normal.xy, normal.xy))); + return normal; + } + half3 UnpackNormal(half4 packednormal) + { + #if defined(UNITY_NO_DXT5nm) + return packednormal.xyz * 2 - 1; + #else + return UnpackNormalmapRGorAG(packednormal); + #endif + } + #endif + #if _HDRP || _URP + + half3 UnpackScaleNormal(half4 packednormal, half scale) + { + #ifndef UNITY_NO_DXT5nm + // Unpack normal as DXT5nm (1, y, 1, x) or BC5 (x, y, 0, 1) + // Note neutral texture like "bump" is (0, 0, 1, 1) to work with both plain RGB normal and DXT5nm/BC5 + packednormal.x *= packednormal.w; + #endif + half3 normal; + normal.xy = (packednormal.xy * 2 - 1) * scale; + normal.z = sqrt(1 - saturate(dot(normal.xy, normal.xy))); + return normal; + } + + #endif + + + void GetSun(out float3 lightDir, out float3 color) + { + lightDir = float3(0.5, 0.5, 0); + color = 1; + #if _HDRP + if (_DirectionalLightCount > 0) + { + DirectionalLightData light = _DirectionalLightDatas[0]; + lightDir = -light.forward.xyz; + color = light.color; + } + #elif _STANDARD + lightDir = normalize(_WorldSpaceLightPos0.xyz); + color = _LightColor0.rgb; + #elif _URP + Light light = GetMainLight(); + lightDir = light.direction; + color = light.color; + #endif + } + + + + + + + + + + + TEXTURE2D(_MainTex); + SAMPLER(sampler_MainTex); + + #if GLOW_ON + TEXTURE2D(_GlowTex); + SAMPLER(sampler_GlowTex); + #endif + + #if FADE_ON + TEXTURE2D(_FadeTex); + SAMPLER(sampler_FadeTex); + + TEXTURE2D(_FadeBurnTex); + SAMPLER(sampler_FadeBurnTex); + #endif + + #if DISTORT_ON + TEXTURE2D(_DistortTex); + SAMPLER(sampler_DistortTex); + #endif + + #if OUTTEX_ON + TEXTURE2D(_OutlineTex); + SAMPLER(sampler_OutlineTex); + #endif + + #if OUTDIST_ON + TEXTURE2D(_OutlineDistortTex); + SAMPLER(sampler_OutlineDistortTex); + #endif + + #if COLORSWAP_ON + TEXTURE2D(_ColorSwapTex); + SAMPLER(sampler_ColorSwapTex); + #endif + + #if COLORRAMP_ON + TEXTURE2D(_ColorRampTex); + TEXTURE2D(_ColorRampTexGradient); + SAMPLER(sampler_ColorRampTex); + SAMPLER(sampler_ColorRampTexGradient); + #endif + + #if SHINE_ON + TEXTURE2D(_ShineMask); + SAMPLER(sampler_ShineMask); + #endif + + #if OVERLAY_ON + TEXTURE2D(_OverlayTex); + SAMPLER(sampler_OverlayTex); + #endif + + #if NORMALMAP_ON + TEXTURE2D(_NormalMap); + SAMPLER(sampler_NormalMap); + #endif + + + half3 GetPixel(in int offsetX, in int offsetY, in half2 uv, in Texture2D _tex, in SamplerState _sampler) + { + half2 _uv = uv + half2(offsetX * _MainTex_TexelSize.x, offsetY * _MainTex_TexelSize.y); + half4 col = SAMPLE_TEXTURE2D(_tex, _sampler, _uv); + return col.rgb; + } + + + //BLURS------------------------------------------------------------------------- + half4 Blur(half2 uv, Texture2D source, SamplerState sampler_source, half Intensity) + { + const half2 texelSize = 1.0 / _ScreenParams.xy; + const half4 color = SAMPLE_TEXTURE2D(source, sampler_source, uv); + const half2 offset = Intensity * texelSize; + + half4 accumulatedColor = color; + half accumulatedWeight = 1.0; + for (int x = -1; x <= 1; x++) + { + for (int y = -1; y <= 1; y++) + { + const half2 sampleUV = uv + half2(x, y) * offset; + const half4 sampleColor = SAMPLE_TEXTURE2D(source, sampler_source, sampleUV); + + accumulatedColor += sampleColor; + accumulatedWeight += 1.0; + } + } + + half4 blurredColor = accumulatedColor / accumulatedWeight; + return blurredColor; + } + + half BlurHD_G(half bhqp, half x) + { + return exp(-(x * x) / (2.0 * bhqp * bhqp)); + } + half4 BlurHD(half2 uv, Texture2D source, SamplerState sampler_source, half BlurAmount, half xScale, half yScale) + { + int iterations = 16; + int halfIterations = iterations / 2; + half sigmaX = 0.1 + BlurAmount * 0.5; + half sigmaY = sigmaX; + half total = 0.0; + half4 ret = half4(0, 0, 0, 0); + for (int iy = 0; iy < iterations; ++iy) + { + half fy = BlurHD_G(sigmaY, half(iy) -half(halfIterations)); + half offsetY = half(iy - halfIterations) * 0.00390625 * xScale; + for (int ix = 0; ix < iterations; ++ix) + { + half fx = BlurHD_G(sigmaX, half(ix) - half(halfIterations)); + half offsetX = half(ix - halfIterations) * 0.00390625 * yScale; + total += fx * fy; + ret += SAMPLE_TEXTURE2D(source, sampler_source, uv + half2(offsetX, offsetY)) * fx * fy; + } + } + return ret / total; + } + //----------------------------------------------------------------------- + + + //------------------------------------------- + half RemapFloat(half inValue, half inMin, half inMax, half outMin, half outMax){ + return outMin + (inValue - inMin) * (outMax - outMin) / (inMax - inMin); + } + //------------------------------------------- + + //----------------------------------------------------------------------- + half rand(half2 seed, half offset) { + return (frac(sin(dot(seed, half2(12.9898, 78.233))) * 43758.5453) + offset) % 1.0; + } + + half rand2(half2 seed, half offset) { + return (frac(sin(dot(seed * floor(50 + (_Time.x % 1.0) * 12.), half2(127.1, 311.7))) * 43758.5453123) + offset) % 1.0; + } + + half rand2CustomTime(half2 seed, half offset, half customTime) { + return (frac(sin(dot(seed * floor(50 + (customTime % 1.0) * 12.), half2(127.1, 311.7))) * 43758.5453123) + offset) % 1.0; + } + //----------------------------------------------------------------------- + + + void Ext_ModifyVertex0 (inout VertexData v, inout ExtraV2F d) + { + //BILBOARD_ON + #if BILBOARD_ON + half3 camRight = mul((half3x3)unity_CameraToWorld, half3(1,0,0)); + half3 camUp = half3(0,1,0); + #if BILBOARDY_ON + camUp = mul((half3x3)unity_CameraToWorld, half3(0,1,0)); + #endif + half3 localPos = v.vertex.x * camRight + v.vertex.y * camUp; + v.vertex = half4(localPos, 1); + #endif + //----------------------------------------------------------- + + v.texcoord0.xy = TRANSFORM_TEX(v.texcoord0.xy, _MainTex); + half2 center = half2(0.5, 0.5); + #if ATLAS_ON + center = half2((_MaxXUV + _MinXUV) / 2.0, (_MaxYUV + _MinYUV) / 2.0); + #endif + + //POLARUV_ON + #if POLARUV_ON + v.texcoord0.xy = v.texcoord0.xy - center; + #endif + + //---------------------------------------- + + //ROTATEUV_ON + #if ROTATEUV_ON + half2 uvC = v.texcoord0.xy; + half cosAngle = cos(_RotateUvAmount); + half sinAngle = sin(_RotateUvAmount); + half2x2 rot = half2x2(cosAngle, -sinAngle, sinAngle, cosAngle); + uvC -= center; + v.texcoord0.xy = mul(rot, uvC); + v.texcoord0.xy += center; + #endif + //-------------------- + + #if RECTSIZE_ON + v.vertex.xyz += (v.vertex.xyz * (_RectSize - 1.0)); + #endif + + #if OUTTEX_ON + v.texcoord1.xy = TRANSFORM_TEX(v.texcoord0.xy, _OutlineTex); + #endif + + #if OUTDIST_ON + v.texcoord2.xy = TRANSFORM_TEX(v.texcoord0.xy, _OutlineDistortTex); + #endif + + #if DISTORT_ON + v.texcoord3.xy = TRANSFORM_TEX(v.texcoord0.xy, _DistortTex); + #endif + } + + void Ext_SurfaceFunction0 (inout Surface o, ShaderData d) + { + half randomSeed = _RandomSeed; + + float2 uvRect = d.texcoord0; + half2 center = half2(0.5, 0.5); + #if ATLAS_ON + center = half2((_MaxXUV + _MinXUV) / 2.0, (_MaxYUV + _MinYUV) / 2.0); + uvRect = half2((d.texcoord0.x - _MinXUV) / (_MaxXUV - _MinXUV), (d.texcoord0.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half2 centerTiled = half2(center.x * _MainTex_ST.x, center.y * _MainTex_ST.y); + + //CLIPPING_ON + #if CLIPPING_ON + half2 tiledUv = half2(d.texcoord0.x / _MainTex_ST.x, d.texcoord0.y / _MainTex_ST.y); + #if ATLAS_ON + tiledUv = half2((tiledUv.x - _MinXUV) / (_MaxXUV - _MinXUV), (tiledUv.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + clip((1 - _ClipUvUp) - tiledUv.y); + clip(tiledUv.y - _ClipUvDown); + clip((1 - _ClipUvRight) - tiledUv.x); + clip(tiledUv.x - _ClipUvLeft); + #endif + //---------------------------------- + + //RADIALCLIPPING_ON + #if RADIALCLIPPING_ON + half2 tiledUv2 = half2(d.texcoord0.x / _MainTex_ST.x, d.texcoord0.y / _MainTex_ST.y); + #if ATLAS_ON + tiledUv2 = half2((tiledUv2.x - _MinXUV) / (_MaxXUV - _MinXUV), (tiledUv2.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half startAngle = _RadialStartAngle - _RadialClip; + half endAngle = _RadialStartAngle + _RadialClip2; + half offset0 = clamp(0, 360, startAngle + 360); + half offset360 = clamp(0, 360, endAngle - 360); + half2 atan2Coord = half2(lerp(-1, 1, tiledUv2.x), lerp(-1, 1, tiledUv2.y)); + half atanAngle = atan2(atan2Coord.y, atan2Coord.x) * 57.3; // angle in degrees + if(atanAngle < 0) atanAngle = 360 + atanAngle; + if(atanAngle >= startAngle && atanAngle <= endAngle) discard; + if(atanAngle <= offset360) discard; + if(atanAngle >= offset0) discard; + #endif + + //----------------------------- + + //TEXTURESCROLL_ON && ATLAS_ON + #if TEXTURESCROLL_ON && ATLAS_ON + d.texcoord0.xy = half2(_MinXUV + ((_MaxXUV - _MinXUV) * (abs(((_Time.y + randomSeed) * _TextureScrollXSpeed) + uvRect.x) % 1)), + _MinYUV + ((_MaxYUV - _MinYUV) * (abs(((_Time.y + randomSeed) * _TextureScrollYSpeed) + uvRect.y) % 1))); + #endif + //---------------------------- + + //OFFSETUV_ON + #if OFFSETUV_ON + #if ATLAS_ON + d.texcoord0.xy = half2(_MinXUV + ((_MaxXUV - _MinXUV) * (abs((_OffsetUvX + uvRect.x) % 1))), + _MinYUV + ((_MaxYUV - _MinYUV) * (abs(_OffsetUvY + uvRect.y) % 1))); + #else + d.texcoord0.xy += half2(_OffsetUvX, _OffsetUvY); + #endif + #endif + + //---------------------- + + //POLARUV_ON + #if POLARUV_ON + d.texcoord0.xy = half2(atan2(d.texcoord0.y, d.texcoord0.x) / (2.0f * 3.141592653589f), length(d.texcoord0.xy)); + d.texcoord0.xy *= _MainTex_ST.xy; + #endif + + //-------------------------------------- + + //TWISTUV_ON + #if TWISTUV_ON + #if ATLAS_ON + _TwistUvPosX = ((_MaxXUV - _MinXUV) * _TwistUvPosX) + _MinXUV; + _TwistUvPosY = ((_MaxYUV - _MinYUV) * _TwistUvPosY) + _MinYUV; + #endif + half2 tempUv = d.texcoord0.xy - half2(_TwistUvPosX * _MainTex_ST.x, _TwistUvPosY * _MainTex_ST.y); + _TwistUvRadius *= (_MainTex_ST.x + _MainTex_ST.y) / 2; + half percent = (_TwistUvRadius - length(tempUv)) / _TwistUvRadius; + half theta = percent * percent * (2.0 * sin(_TwistUvAmount)) * 8.0; + half s = sin(theta); + half c = cos(theta); + half beta = max(sign(_TwistUvRadius - length(tempUv)), 0.0); + tempUv = half2(dot(tempUv, half2(c, -s)), dot(tempUv, half2(s, c))) * beta + tempUv * (1 - beta); + tempUv += half2(_TwistUvPosX * _MainTex_ST.x, _TwistUvPosY * _MainTex_ST.y); + d.texcoord0.xy = tempUv; + #endif + + //-------------------------------------------- + + //FISHEYE_ON + #if FISHEYE_ON + half bind = length(centerTiled); + half2 dF = d.texcoord0.xy - centerTiled; + half dFlen = length(dF); + half fishInt = (3.14159265359 / bind) * (_FishEyeUvAmount + 0.001); + d.texcoord0.xy = centerTiled + (dF / (max(0.0001, dFlen))) * tan(dFlen * fishInt) * bind / tan(bind * fishInt); + #endif + //--------------------------------------------- + + //PINCH_ON + #if PINCH_ON + half2 dP = d.texcoord0.xy - centerTiled; + half pinchInt = (3.141592 / length(centerTiled)) * (-_PinchUvAmount + 0.001); + d.texcoord0.xy = centerTiled + normalize(dP) * atan(length(dP) * -pinchInt * 10.0) * 0.5 / atan(-pinchInt * 5); + #endif + + //--------------------------------------------- + + //ZOOMUV_ON + #if ZOOMUV_ON + d.texcoord0.xy -= centerTiled; + d.texcoord0.xy = d.texcoord0.xy * _ZoomUvAmount; + d.texcoord0.xy += centerTiled; + #endif + + //----------------------------------------------- + + //DOODLE_ON + #if DOODLE_ON + half2 uvCopy = uvRect; + _HandDrawnSpeed = (floor((_Time.x + randomSeed) * 20 * _HandDrawnSpeed) / _HandDrawnSpeed) * _HandDrawnSpeed; + uvCopy.x = sin((uvCopy.x * _HandDrawnAmount + _HandDrawnSpeed) * 4); + uvCopy.y = cos((uvCopy.y * _HandDrawnAmount + _HandDrawnSpeed) * 4); + d.texcoord0.xy = lerp(d.texcoord0.xy, d.texcoord0.xy + uvCopy, 0.0005 * _HandDrawnAmount); + #endif + + //-------------------------- + + //SHAKEUV_ON + #if SHAKEUV_ON + half xShake = sin((_Time.x + randomSeed) * _ShakeUvSpeed * 50) * _ShakeUvX; + half yShake = cos((_Time.x + randomSeed) * _ShakeUvSpeed * 50) * _ShakeUvY; + d.texcoord0.xy += half2(xShake * 0.012, yShake * 0.01); + #endif + + //------------------------------------------- + + //RECTSIZE_ON + #if RECTSIZE_ON + d.texcoord0.xy = d.texcoord0.xy * (_RectSize).xx + (((-_RectSize * 0.5) + 0.5)).xx; + #endif + + //------------------------------------------- + + //DISTORT_ON + #if DISTORT_ON + #if ATLAS_ON + d.texcoord3.x = d.texcoord3.x * (1 / (_MaxXUV - _MinXUV)); + d.texcoord3.y = d.texcoord3.y * (1 / (_MaxYUV - _MinYUV)); + #endif + + d.texcoord3.x += ((_Time.x + _RandomSeed) * _DistortTexXSpeed) % 1; + d.texcoord3.y += ((_Time.x + _RandomSeed) * _DistortTexYSpeed) % 1; + half distortAmnt = (SAMPLE_TEXTURE2D(_DistortTex, sampler_DistortTex, d.texcoord3.xy).r - 0.5) * 0.2 * _DistortAmount; + d.texcoord0.x += distortAmnt; + d.texcoord0.y += distortAmnt; + #endif + //------------------------------------------------------- + + //WARP_ON + #if WARP_ON + half2 warpUv = half2(d.texcoord0.x / _MainTex_ST.x, d.texcoord0.y / _MainTex_ST.y); + #if ATLAS_ON + warpUv = half2((warpUv.x - _MinXUV) / (_MaxXUV - _MinXUV), (warpUv.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + const float tau = 6.283185307179586; + float xWarp = (_Time.y + randomSeed) * _WarpSpeed + warpUv.x * tau / _WarpScale; + float yWarp = (_Time.y + randomSeed) * _WarpSpeed + warpUv.y * tau / _WarpScale; + float2 warp = float2(sin(xWarp), sin(yWarp)) * _WarpStrength; + d.texcoord0.xy += warp; + #endif + + //------------------------------------------------------- + + //WAVEUV_ON + #if WAVEUV_ON + float2 uvWave = half2(_WaveX * _MainTex_ST.x, _WaveY * _MainTex_ST.y) - d.texcoord0.xy; + uvWave %= 1; + #if ATLAS_ON + uvWave = half2(_WaveX, _WaveY) - uvRect; + #endif + uvWave.x *= _ScreenParams.x / _ScreenParams.y; + float waveTime = _Time.y + randomSeed; + float angWave = (sqrt(dot(uvWave, uvWave)) * _WaveAmount) - ((waveTime * _WaveSpeed)); + d.texcoord0.xy = d.texcoord0.xy + uvWave * sin(angWave) * (_WaveStrength / 1000.0); + #endif + //---------------------------------------------------- + + //ROUNDWAVEUV_ON + #if ROUNDWAVEUV_ON + half xWave = ((0.5 * _MainTex_ST.x) - uvRect.x); + half yWave = ((0.5 * _MainTex_ST.y) - uvRect.y) * (_MainTex_TexelSize.w / _MainTex_TexelSize.z); + half ripple = -sqrt(xWave*xWave + yWave* yWave); + d.texcoord0.xy += (sin((ripple + (_Time.y + randomSeed) * (_RoundWaveSpeed/10.0)) / 0.015) * (_RoundWaveStrength/10.0)) % 1; + #endif + //---------------------------------------------------- + + + //WIND_ON + #if WIND_ON + half windOffset = sin((_Time.x + randomSeed) * _GrassSpeed * 10); + half2 windCenter = half2(0.5, 0.1); + #if ATLAS_ON + windCenter.x = ((_MaxXUV - _MinXUV) * windCenter.x) + _MinXUV; + windCenter.y = ((_MaxYUV - _MinYUV) * windCenter.y) + _MinYUV; + #endif + #if !MANUALWIND_ON + d.texcoord0.x = fmod(abs(lerp(d.texcoord0.x, d.texcoord0.x + (_GrassWind * 0.01 * windOffset), uvRect.y)), 1); + #else + d.texcoord0.x = fmod(abs(lerp(d.texcoord0.x, d.texcoord0.x + (_GrassWind * 0.01 * _GrassManualAnim), uvRect.y)), 1); + windOffset = _GrassManualAnim; + #endif + half2 delta = d.texcoord0.xy - windCenter; + half delta2 = dot(delta.xy, delta.xy); + half2 delta_offset = delta2 * windOffset; + d.texcoord0.xy = d.texcoord0.xy + half2(delta.y, -delta.x) * delta_offset * _GrassRadialBend; + #endif + + //-------------------------------------------------------- + + //TEXTURESCROLL_ON && !ATLAS_ON + #if TEXTURESCROLL_ON && !ATLAS_ON + d.texcoord0.x += ((_Time.y + randomSeed) * _TextureScrollXSpeed) % 1; + d.texcoord0.y += ((_Time.y + randomSeed) * _TextureScrollYSpeed) % 1; + #endif + //------------------------------ + + //PIXELATE_ON + #if PIXELATE_ON + half aspectRatio = _MainTex_TexelSize.x / _MainTex_TexelSize.y; + half2 pixelSize = float2(_PixelateSize, _PixelateSize * aspectRatio); + d.texcoord0.xy = floor(d.texcoord0.xy * pixelSize) / pixelSize; + #endif + //-------------- + + half4 col = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy); + half originalAlpha = col.a; + col *= d.vertexColor; + + //NORMAL MAP + #if NORMALMAP_ON + half4 normalSample = SAMPLE_TEXTURE2D(_NormalMap, sampler_NormalMap, d.texcoord0.xy); + half3 normalTS = UnpackNormal(normalSample); + normalTS.xy *= _NormalStrength; + o.Normal = normalTS; + #endif + + + //GLITCH_ON + #if GLITCH_ON + half2 uvGlitch = uvRect; + uvGlitch.y -= 0.5; + half lineNoise = pow(rand2(floor(uvGlitch * half2(24., 19.) * _GlitchSize) * 4.0, randomSeed), 3.0) * _GlitchAmount + * pow(rand2(floor(uvGlitch * half2(38., 14.) * _GlitchSize) * 4.0, randomSeed), 3.0); + col = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(lineNoise * 0.02 * rand2(half2(2.0, 1), randomSeed), 0)) * d.vertexColor; + #endif + //-------------------------------------- + + //CHROMABERR_ON + #if CHROMABERR_ON + half4 r = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(_ChromAberrAmount/10, 0)) * d.vertexColor; + half4 b = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(-_ChromAberrAmount/10, 0)) * d.vertexColor; + col = half4(r.r * r.a, col.g, b.b * b.a, max(max(r.a, b.a) * _ChromAberrAlpha, col.a)); + #endif + + //-------------------------------- + + //BLUR_ON + #if BLUR_ON + #if ATLAS_ON + #if !BLURISHD_ON + col = BlurHD(d.texcoord0.xy, _MainTex, sampler_MainTex, _BlurIntensity, (_MaxXUV - _MinXUV), (_MaxYUV - _MinYUV)) * d.vertexColor; + #else + col = Blur(d.texcoord0.xy, _MainTex, sampler_MainTex, _BlurIntensity * (_MaxXUV - _MinXUV)) * d.vertexColor; + #endif + #else + #if !BLURISHD_ON + col = BlurHD(d.texcoord0.xy, _MainTex, sampler_MainTex, _BlurIntensity, 1, 1) * d.vertexColor; + #else + col = Blur(d.texcoord0.xy, _MainTex, sampler_MainTex, _BlurIntensity) * d.vertexColor; + #endif + #endif + #endif + + //-------------------- + + //MOTIONBLUR_ON + #if MOTIONBLUR_ON + _MotionBlurAngle = _MotionBlurAngle * 3.1415926; + #define rot(n) mul(n, half2x2(cos(_MotionBlurAngle), -sin(_MotionBlurAngle), sin(_MotionBlurAngle), cos(_MotionBlurAngle))) + _MotionBlurDist = _MotionBlurDist * 0.005; + #if ATLAS_ON + _MotionBlurDist *= (_MaxXUV - _MinXUV); + #endif + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(-_MotionBlurDist, -_MotionBlurDist))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(-_MotionBlurDist * 2, -_MotionBlurDist * 2))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(-_MotionBlurDist * 3, -_MotionBlurDist * 3))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(-_MotionBlurDist * 4, -_MotionBlurDist * 4))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(_MotionBlurDist, _MotionBlurDist))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(_MotionBlurDist * 2, _MotionBlurDist * 2))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(_MotionBlurDist * 3, _MotionBlurDist * 3))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(_MotionBlurDist * 4, _MotionBlurDist * 4))); + col.rgb = col.rgb / 9; + #endif + //------------------------------------ + + //NEGATIVE_ON + #if NEGATIVE_ON + col.rgb = lerp(col.rgb, 1 - col.rgb, _NegativeAmount); + #endif + + //-------------- + half luminance = 0; + + //GREYSCALE_ON && !GREYSCALEOUTLINE_ON + #if GREYSCALE_ON && !GREYSCALEOUTLINE_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + luminance = saturate(luminance + _GreyscaleLuminosity); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _GreyscaleTintColor, _GreyscaleBlend); + #endif + //------------------------------------ + + //GHOST_ON + #if GHOST_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + half4 ghostResult; + ghostResult.a = saturate(luminance - _GhostTransparency) * col.a; + ghostResult.rgb = col.rgb * (luminance + _GhostColorBoost); + col = lerp(col, ghostResult, _GhostBlend); + #endif + //------------------------------------ + + //INNEROUTLINE_ON + #if INNEROUTLINE_ON + half3 innerT = abs(GetPixel(0, _InnerOutlineThickness, d.texcoord0.xy, _MainTex, sampler_MainTex) - GetPixel(0, -_InnerOutlineThickness, d.texcoord0.xy, _MainTex, sampler_MainTex)); + innerT += abs(GetPixel(_InnerOutlineThickness, 0, d.texcoord0.xy, _MainTex, sampler_MainTex) - GetPixel(-_InnerOutlineThickness, 0, d.texcoord0.xy, _MainTex, sampler_MainTex)); + #if !ONLYINNEROUTLINE_ON + innerT = (innerT / 2.0) * col.a * _InnerOutlineAlpha; + col.rgb += length(innerT) * _InnerOutlineColor.rgb * _InnerOutlineGlow; + #else + innerT *= col.a * _InnerOutlineAlpha; + col.rgb = length(innerT) * _InnerOutlineColor.rgb * _InnerOutlineGlow; + col.a = step(0.3, col.r+col.g+col.b); + #endif + #endif + //------------------------------------------------------- + + //HITEFFECT_ON + #if HITEFFECT_ON + col.rgb = lerp(col.rgb, _HitEffectColor.rgb * _HitEffectGlow, _HitEffectBlend); + #endif + //-------------------- + + //GRADIENT_ON + #if GRADIENT_ON + half2 tiledUvGrad = half2(uvRect.x / _MainTex_ST.x, uvRect.y / _MainTex_ST.y); + #if GRADIENT2COL_ON + _GradTopRightCol = _GradTopLeftCol; + _GradBotRightCol = _GradBotLeftCol; + #endif + #if RADIALGRADIENT_ON + half radialDist = 1 - length(tiledUvGrad - half2(0.5, 0.5)); + radialDist *= (_MainTex_TexelSize.w / _MainTex_TexelSize.z); + radialDist = saturate(_GradBoostX * radialDist); + half4 gradientResult = lerp(_GradTopLeftCol, _GradBotLeftCol, radialDist); + #else + half gradXLerpFactor = saturate(pow(tiledUvGrad.x, _GradBoostX)); + half4 gradientResult = lerp(lerp(_GradBotLeftCol, _GradBotRightCol, gradXLerpFactor), + lerp(_GradTopLeftCol, _GradTopRightCol, gradXLerpFactor), saturate(pow(tiledUvGrad.y, _GradBoostY))); + #endif + gradientResult = lerp(col, gradientResult, _GradBlend); + col.rgb = gradientResult.rgb * col.a; + col.a *= gradientResult.a; + #endif + //-------------------------------------------------------------------- + + //CONTRAST_ON + #if CONTRAST_ON + col.rgb = (col.rgb - float3(0.5, 0.5, 0.5)) * _Contrast + float3(0.5, 0.5, 0.5); + col.rgb += _Brightness; + #endif + + //------------------------------------------------------------------- + + //COLORSWAP_ON + #if COLORSWAP_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + half4 swapMask = SAMPLE_TEXTURE2D(_ColorSwapTex, sampler_ColorSwapTex, d.texcoord0.xy); + swapMask.rgb *= swapMask.a; + half3 redSwap = _ColorSwapRed * swapMask.r * saturate(luminance + _ColorSwapRedLuminosity); + half3 greenSwap = _ColorSwapGreen * swapMask.g * saturate(luminance + _ColorSwapGreenLuminosity); + half3 blueSwap = _ColorSwapBlue * swapMask.b * saturate(luminance + _ColorSwapBlueLuminosity); + swapMask.rgb = col.rgb * saturate(1 - swapMask.r - swapMask.g - swapMask.b); + col.rgb = lerp(col.rgb, swapMask.rgb + redSwap + greenSwap + blueSwap, _ColorSwapBlend); + #endif + //-------------------------------------------------------------------- + + //COLORRAMP_ON && !COLORRAMPOUTLINE_ON + #if COLORRAMP_ON && !COLORRAMPOUTLINE_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + luminance = saturate(luminance + _ColorRampLuminosity); + #if GRADIENTCOLORRAMP_ON + col.rgb = lerp(col.rgb, SAMPLE_TEXTURE2D(_ColorRampTexGradient, sampler_ColorRampTexGradient, half2(luminance, 0)).rgb, _ColorRampBlend); + #else + col.rgb = lerp(col.rgb, SAMPLE_TEXTURE2D(_ColorRampTex, sampler_ColorRampTex, half2(luminance, 0)).rgb, _ColorRampBlend); + #endif + #endif + //-------------------------------------------------------------------- + + //CHANGECOLOR_ON + #if CHANGECOLOR_ON + float3 currChangeColor = saturate(col.rgb); + luminance = 0.3 * currChangeColor.r + 0.59 * currChangeColor.g + 0.11 * currChangeColor.b; + luminance = saturate(luminance + _ColorChangeLuminosity); + half3 dif = abs(currChangeColor - _ColorChangeTarget.rgb); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _ColorChangeNewCol.rgb, + max(sign(1 - saturate(dif.x + dif.y + dif.z) - _ColorChangeTolerance), 0.0)); + #if CHANGECOLOR2_ON + dif = abs(currChangeColor - _ColorChangeTarget2.rgb); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _ColorChangeNewCol2.rgb, + max(sign(1 - saturate(dif.x + dif.y + dif.z) - _ColorChangeTolerance2), 0.0)); + #endif + #if CHANGECOLOR3_ON + dif = abs(currChangeColor - _ColorChangeTarget3.rgb); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _ColorChangeNewCol3.rgb, + max(sign(1 - saturate(dif.x + dif.y + dif.z) - _ColorChangeTolerance3), 0.0)); + #endif + #endif + //------------------------------------------------------- + + //POSTERIZE_ON && !POSTERIZEOUTLINE_ON + #if POSTERIZE_ON && !POSTERIZEOUTLINE_ON + col.rgb = pow(col.rgb, _PosterizeGamma) * _PosterizeNumColors; + col.rgb = floor(col.rgb) / _PosterizeNumColors; + col.rgb = pow(col.rgb, 1.0 / _PosterizeGamma); + #endif + //------------------------------------ + + //HSV_ON + #if HSV_ON + half3 resultHsv = half3(col.rgb); + half cosHsv = _HsvBright * _HsvSaturation * cos(_HsvShift * 3.14159265 / 180); + half sinHsv = _HsvBright * _HsvSaturation * sin(_HsvShift * 3.14159265 / 180); + resultHsv.x = (.299 * _HsvBright + .701 * cosHsv + .168 * sinHsv) * col.x + + (.587 * _HsvBright - .587 * cosHsv + .330 * sinHsv) * col.y + + (.114 * _HsvBright - .114 * cosHsv - .497 * sinHsv) * col.z; + resultHsv.y = (.299 * _HsvBright - .299 * cosHsv - .328 * sinHsv) *col.x + + (.587 * _HsvBright + .413 * cosHsv + .035 * sinHsv) * col.y + + (.114 * _HsvBright - .114 * cosHsv + .292 * sinHsv) * col.z; + resultHsv.z = (.299 * _HsvBright - .3 * cosHsv + 1.25 * sinHsv) * col.x + + (.587 * _HsvBright - .588 * cosHsv - 1.05 * sinHsv) * col.y + + (.114 * _HsvBright + .886 * cosHsv - .203 * sinHsv) * col.z; + col.rgb = resultHsv; + #endif + //------------------------------------------------------- + + //OVERLAY_ON + #if OVERLAY_ON + half2 overlayUvs = d.texcoord0.xy; + overlayUvs.x += ((_Time.y + randomSeed) * _OverlayTextureScrollXSpeed) % 1; + overlayUvs.y += ((_Time.y + randomSeed) * _OverlayTextureScrollYSpeed) % 1; + half4 overlayCol = SAMPLE_TEXTURE2D(_OverlayTex, sampler_OverlayTex, TRANSFORM_TEX(overlayUvs, _OverlayTex)); + overlayCol.rgb *= _OverlayColor.rgb * _OverlayGlow; + #if !OVERLAYMULT_ON + overlayCol.rgb *= overlayCol.a * _OverlayColor.rgb * _OverlayColor.a * _OverlayBlend; + col.rgb += overlayCol.rgb; + #else + overlayCol.a *= _OverlayColor.a; + col = lerp(col, col * overlayCol, _OverlayBlend); + #endif + #endif + + //--------------------------------- + + //OUTBASE_ON + #if OUTBASE_ON + #if OUTBASEPIXELPERF_ON + half2 destUv = half2(_OutlinePixelWidth * _MainTex_TexelSize.x, _OutlinePixelWidth * _MainTex_TexelSize.y); + #else + half2 destUv = half2(_OutlineWidth * _MainTex_TexelSize.x * 200, _OutlineWidth * _MainTex_TexelSize.y * 200); + #endif + + #if OUTDIST_ON + d.texcoord3.x += ((_Time.x + _RandomSeed) * _OutlineDistortTexXSpeed) % 1; + d.texcoord3.y += ((_Time.x + _RandomSeed) * _OutlineDistortTexYSpeed) % 1; + #if ATLAS_ON + d.texcoord3 = half2((d.texcoord3.x - _MinXUV) / (_MaxXUV - _MinXUV), (d.texcoord3.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half outDistortAmnt = (SAMPLE_TEXTURE2D(_OutlineDistortTex, sampler_OutlineDistortTex, d.texcoord3).r - 0.5) * 0.2 * _OutlineDistortAmount; + destUv.x += outDistortAmnt; + destUv.y += outDistortAmnt; + #endif + + half spriteLeft = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(destUv.x, 0)).a; + half spriteRight = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy - half2(destUv.x, 0)).a; + half spriteBottom = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(0, destUv.y)).a; + half spriteTop = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy - half2(0, destUv.y)).a; + half result = spriteLeft + spriteRight + spriteBottom + spriteTop; + + #if OUTBASE8DIR_ON + half spriteTopLeft = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(destUv.x, destUv.y)).a; + half spriteTopRight = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(-destUv.x, destUv.y)).a; + half spriteBotLeft = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(destUv.x, -destUv.y)).a; + half spriteBotRight = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(-destUv.x, -destUv.y)).a; + result = result + spriteTopLeft + spriteTopRight + spriteBotLeft + spriteBotRight; + #endif + + result = step(0.05, saturate(result)); + + #if OUTTEX_ON + d.texcoord1.x += ((_Time.x + _RandomSeed) * _OutlineTexXSpeed) % 1; + d.texcoord1.y += ((_Time.x + _RandomSeed) * _OutlineTexYSpeed) % 1; + #if ATLAS_ON + d.texcoord1 = half2((d.texcoord1.x - _MinXUV) / (_MaxXUV - _MinXUV), (d.texcoord1.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half4 tempOutColor = SAMPLE_TEXTURE2D(_OutlineTex, sampler_OutlineTex, d.texcoord1); + tempOutColor *= _OutlineColor; + _OutlineColor = tempOutColor; + #endif + + result *= (1 - originalAlpha) * _OutlineAlpha; + + half4 outline = _OutlineColor * d.vertexColor.a; + outline.rgb *= _OutlineGlow; + outline.a = result; + #if ONLYOUTLINE_ON + col = outline; + #else + col = lerp(col, outline, result); + #endif + #endif + //------------------------------------------------------- + + //FADE_ON + #if FADE_ON + half2 tiledUvFade1 = TRANSFORM_TEX(d.texcoord0, _FadeTex); + half2 tiledUvFade2 = TRANSFORM_TEX(d.texcoord0, _FadeBurnTex); + #if ATLAS_ON + tiledUvFade1 = half2((tiledUvFade1.x - _MinXUV) / (_MaxXUV - _MinXUV), (tiledUvFade1.y - _MinYUV) / (_MaxYUV - _MinYUV)); + tiledUvFade2 = half2((tiledUvFade2.x - _MinXUV) / (_MaxXUV - _MinXUV), (tiledUvFade2.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half fadeTemp = SAMPLE_TEXTURE2D(_FadeTex, sampler_FadeTex, tiledUvFade1).r; + half fade = smoothstep(_FadeAmount, _FadeAmount + _FadeBurnTransition, fadeTemp); + half fadeBurn = saturate(smoothstep(_FadeAmount - _FadeBurnWidth, _FadeAmount - _FadeBurnWidth + 0.1, fadeTemp) * _FadeAmount); + col.a *= fade; + _FadeBurnColor.rgb *= _FadeBurnGlow; + col += fadeBurn * SAMPLE_TEXTURE2D(_FadeBurnTex, sampler_FadeBurnTex, tiledUvFade2) * _FadeBurnColor * originalAlpha * (1 - col.a); + #endif + //------------------------------------------------------- + + //SHADOW_ON + #if SHADOW_ON + half shadowA = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(_ShadowX, _ShadowY)).a; + half preMultShadowMask = 1 - (saturate(shadowA - col.a) * (1 - col.a)); + col.rgb *= 1 - ((shadowA - col.a) * (1 - col.a)); + col.rgb += (_ShadowColor * shadowA) * (1 - col.a); + col.a = max(shadowA * _ShadowAlpha * d.vertexColor.a, col.a); + #endif + + //------------------------------------------------------- + + //GLOW_ON + #if GLOW_ON + half4 emission; + #if GLOWTEX_ON + emission = SAMPLE_TEXTURE2D(_GlowTex, sampler_GlowTex, d.texcoord0); + #else + emission = col; + #endif + + col.rgb *= _GlowGlobal; + emission.rgb *= emission.a * col.a * _Glow * _GlowColor; + col.rgb += emission.rgb; + #endif + //------------------------------------------------------- + + //COLORRAMP_ON && COLORRAMPOUTLINE_ON + #if COLORRAMP_ON && COLORRAMPOUTLINE_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + luminance = saturate(luminance + _ColorRampLuminosity); + #if GRADIENTCOLORRAMP_ON + col.rgb = lerp(col.rgb, SAMPLE_TEXTURE2D(_ColorRampTexGradient, sampler_ColorRampTexGradient, half2(luminance, 0)).rgb, _ColorRampBlend); + #else + col.rgb = lerp(col.rgb, SAMPLE_TEXTURE2D(_ColorRampTex, sampler_ColorRampTex, half2(luminance, 0)).rgb, _ColorRampBlend); + #endif + #endif + //--------------- + + //GREYSCALE_ON && GREYSCALEOUTLINE_ON + #if GREYSCALE_ON && GREYSCALEOUTLINE_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + luminance = saturate(luminance + _GreyscaleLuminosity); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _GreyscaleTintColor, _GreyscaleBlend); + #endif + + //----------------------------------- + + //POSTERIZE_ON && POSTERIZEOUTLINE_ON + #if POSTERIZE_ON && POSTERIZEOUTLINE_ON + col.rgb = pow(col.rgb, _PosterizeGamma) * _PosterizeNumColors; + col.rgb = floor(col.rgb) / _PosterizeNumColors; + col.rgb = pow(col.rgb, 1.0 / _PosterizeGamma); + #endif + + //----------------------------------- + + //SHINE_ON + #if SHINE_ON + half2 uvShine = uvRect; + half cosAngle = cos(_ShineRotate); + half sinAngle = sin(_ShineRotate); + half2x2 rot = half2x2(cosAngle, -sinAngle, sinAngle, cosAngle); + uvShine -= half2(0.5, 0.5); + uvShine = mul(rot, uvShine); + uvShine += half2(0.5, 0.5); + half shineMask = SAMPLE_TEXTURE2D(_ShineMask, sampler_ShineMask, d.texcoord0.xy).a; + half currentDistanceProjection = (uvShine.x + uvShine.y) / 2; + half whitePower = 1 - (abs(currentDistanceProjection - _ShineLocation) / _ShineWidth); + col.rgb += col.a * whitePower * _ShineGlow * max(sign(currentDistanceProjection - (_ShineLocation - _ShineWidth)), 0.0) + * max(sign((_ShineLocation + _ShineWidth) - currentDistanceProjection), 0.0) * _ShineColor * shineMask; + #endif + + //----------------------------------- + + //HOLOGRAM_ON + #if HOLOGRAM_ON + half totalHologram = _HologramStripesAmount + _HologramUnmodAmount; + half hologramYCoord = ((uvRect.y + (((_Time.x + randomSeed) % 1) * _HologramStripesSpeed)) % totalHologram) / totalHologram; + hologramYCoord = abs(hologramYCoord); + half alpha = RemapFloat(saturate(hologramYCoord - (_HologramUnmodAmount/totalHologram)), 0.0, 1.0, _HologramMinAlpha, saturate(_HologramMaxAlpha)); + half hologramMask = max(sign((_HologramUnmodAmount/totalHologram) - hologramYCoord), 0.0); + half4 hologramResult = col; + hologramResult.a *= lerp(alpha, 1, hologramMask); + hologramResult.rgb *= max(1, _HologramMaxAlpha * max(sign(hologramYCoord - (_HologramUnmodAmount/totalHologram)), 0.0)); + hologramMask = 1 - step(0.01,hologramMask); + hologramResult.rgb += hologramMask * _HologramStripeColor * col.a; + col = lerp(col, hologramResult, _HologramBlend); + #endif + + //----------------------------------- + + //FLICKER_ON + #if FLICKER_ON + col.a *= saturate(col.a * step(frac(0.05 + (_Time.w + randomSeed) * _FlickerFreq), 1 - _FlickerPercent) + _FlickerAlpha); + #endif + //----------------------------------- + + //ALPHACUTOFF_ON + + //ALPHAROUND_ON + + //ALPHAOUTLINE_ON + #if ALPHAOUTLINE_ON + half alphaOutlineRes = pow(1 - col.a, max(_AlphaOutlinePower, 0.0001)) * step(_AlphaOutlineMinAlpha, col.a) * _AlphaOutlineBlend; + col.rgb = lerp(col.rgb, _AlphaOutlineColor.rgb * _AlphaOutlineGlow, alphaOutlineRes); + col.a = lerp(col.a, 1, alphaOutlineRes > 1); + #endif + //------------------------------------------------------- + + //FOG_ON + + //------------------ + + col *= _Color; + o.Albedo = col; + col.a *= _Alpha; + clip(col.a - _AlphaCutoffValue - 0.01); + o.Alpha = _Color.a; + } + + + + + + void ChainSurfaceFunction(inout Surface l, inout ShaderData d) + { + Ext_SurfaceFunction0(l, d); + // Ext_SurfaceFunction1(l, d); + // Ext_SurfaceFunction2(l, d); + // Ext_SurfaceFunction3(l, d); + // Ext_SurfaceFunction4(l, d); + // Ext_SurfaceFunction5(l, d); + // Ext_SurfaceFunction6(l, d); + // Ext_SurfaceFunction7(l, d); + // Ext_SurfaceFunction8(l, d); + // Ext_SurfaceFunction9(l, d); + // Ext_SurfaceFunction10(l, d); + // Ext_SurfaceFunction11(l, d); + // Ext_SurfaceFunction12(l, d); + // Ext_SurfaceFunction13(l, d); + // Ext_SurfaceFunction14(l, d); + // Ext_SurfaceFunction15(l, d); + // Ext_SurfaceFunction16(l, d); + // Ext_SurfaceFunction17(l, d); + // Ext_SurfaceFunction18(l, d); + // Ext_SurfaceFunction19(l, d); + // Ext_SurfaceFunction20(l, d); + // Ext_SurfaceFunction21(l, d); + // Ext_SurfaceFunction22(l, d); + // Ext_SurfaceFunction23(l, d); + // Ext_SurfaceFunction24(l, d); + // Ext_SurfaceFunction25(l, d); + // Ext_SurfaceFunction26(l, d); + // Ext_SurfaceFunction27(l, d); + // Ext_SurfaceFunction28(l, d); + // Ext_SurfaceFunction29(l, d); + } + +#if !_DECALSHADER + + void ChainModifyVertex(inout VertexData v, inout VertexToPixel v2p, float4 time) + { + ExtraV2F d; + + ZERO_INITIALIZE(ExtraV2F, d); + ZERO_INITIALIZE(Blackboard, d.blackboard); + // due to motion vectors in HDRP, we need to use the last + // time in certain spots. So if you are going to use _Time to adjust vertices, + // you need to use this time or motion vectors will break. + d.time = time; + + Ext_ModifyVertex0(v, d); + // Ext_ModifyVertex1(v, d); + // Ext_ModifyVertex2(v, d); + // Ext_ModifyVertex3(v, d); + // Ext_ModifyVertex4(v, d); + // Ext_ModifyVertex5(v, d); + // Ext_ModifyVertex6(v, d); + // Ext_ModifyVertex7(v, d); + // Ext_ModifyVertex8(v, d); + // Ext_ModifyVertex9(v, d); + // Ext_ModifyVertex10(v, d); + // Ext_ModifyVertex11(v, d); + // Ext_ModifyVertex12(v, d); + // Ext_ModifyVertex13(v, d); + // Ext_ModifyVertex14(v, d); + // Ext_ModifyVertex15(v, d); + // Ext_ModifyVertex16(v, d); + // Ext_ModifyVertex17(v, d); + // Ext_ModifyVertex18(v, d); + // Ext_ModifyVertex19(v, d); + // Ext_ModifyVertex20(v, d); + // Ext_ModifyVertex21(v, d); + // Ext_ModifyVertex22(v, d); + // Ext_ModifyVertex23(v, d); + // Ext_ModifyVertex24(v, d); + // Ext_ModifyVertex25(v, d); + // Ext_ModifyVertex26(v, d); + // Ext_ModifyVertex27(v, d); + // Ext_ModifyVertex28(v, d); + // Ext_ModifyVertex29(v, d); + + + // #if %EXTRAV2F0REQUIREKEY% + // v2p.extraV2F0 = d.extraV2F0; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // v2p.extraV2F1 = d.extraV2F1; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // v2p.extraV2F2 = d.extraV2F2; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // v2p.extraV2F3 = d.extraV2F3; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // v2p.extraV2F4 = d.extraV2F4; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // v2p.extraV2F5 = d.extraV2F5; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // v2p.extraV2F6 = d.extraV2F6; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // v2p.extraV2F7 = d.extraV2F7; + // #endif + } + + void ChainModifyTessellatedVertex(inout VertexData v, inout VertexToPixel v2p) + { + ExtraV2F d; + ZERO_INITIALIZE(ExtraV2F, d); + ZERO_INITIALIZE(Blackboard, d.blackboard); + + // #if %EXTRAV2F0REQUIREKEY% + // d.extraV2F0 = v2p.extraV2F0; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // d.extraV2F1 = v2p.extraV2F1; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // d.extraV2F2 = v2p.extraV2F2; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // d.extraV2F3 = v2p.extraV2F3; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // d.extraV2F4 = v2p.extraV2F4; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // d.extraV2F5 = v2p.extraV2F5; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // d.extraV2F6 = v2p.extraV2F6; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // d.extraV2F7 = v2p.extraV2F7; + // #endif + + + // Ext_ModifyTessellatedVertex0(v, d); + // Ext_ModifyTessellatedVertex1(v, d); + // Ext_ModifyTessellatedVertex2(v, d); + // Ext_ModifyTessellatedVertex3(v, d); + // Ext_ModifyTessellatedVertex4(v, d); + // Ext_ModifyTessellatedVertex5(v, d); + // Ext_ModifyTessellatedVertex6(v, d); + // Ext_ModifyTessellatedVertex7(v, d); + // Ext_ModifyTessellatedVertex8(v, d); + // Ext_ModifyTessellatedVertex9(v, d); + // Ext_ModifyTessellatedVertex10(v, d); + // Ext_ModifyTessellatedVertex11(v, d); + // Ext_ModifyTessellatedVertex12(v, d); + // Ext_ModifyTessellatedVertex13(v, d); + // Ext_ModifyTessellatedVertex14(v, d); + // Ext_ModifyTessellatedVertex15(v, d); + // Ext_ModifyTessellatedVertex16(v, d); + // Ext_ModifyTessellatedVertex17(v, d); + // Ext_ModifyTessellatedVertex18(v, d); + // Ext_ModifyTessellatedVertex19(v, d); + // Ext_ModifyTessellatedVertex20(v, d); + // Ext_ModifyTessellatedVertex21(v, d); + // Ext_ModifyTessellatedVertex22(v, d); + // Ext_ModifyTessellatedVertex23(v, d); + // Ext_ModifyTessellatedVertex24(v, d); + // Ext_ModifyTessellatedVertex25(v, d); + // Ext_ModifyTessellatedVertex26(v, d); + // Ext_ModifyTessellatedVertex27(v, d); + // Ext_ModifyTessellatedVertex28(v, d); + // Ext_ModifyTessellatedVertex29(v, d); + + // #if %EXTRAV2F0REQUIREKEY% + // v2p.extraV2F0 = d.extraV2F0; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // v2p.extraV2F1 = d.extraV2F1; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // v2p.extraV2F2 = d.extraV2F2; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // v2p.extraV2F3 = d.extraV2F3; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // v2p.extraV2F4 = d.extraV2F4; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // v2p.extraV2F5 = d.extraV2F5; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // v2p.extraV2F6 = d.extraV2F6; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // v2p.extraV2F7 = d.extraV2F7; + // #endif + } + + void ChainFinalColorForward(inout Surface l, inout ShaderData d, inout half4 color) + { + // Ext_FinalColorForward0(l, d, color); + // Ext_FinalColorForward1(l, d, color); + // Ext_FinalColorForward2(l, d, color); + // Ext_FinalColorForward3(l, d, color); + // Ext_FinalColorForward4(l, d, color); + // Ext_FinalColorForward5(l, d, color); + // Ext_FinalColorForward6(l, d, color); + // Ext_FinalColorForward7(l, d, color); + // Ext_FinalColorForward8(l, d, color); + // Ext_FinalColorForward9(l, d, color); + // Ext_FinalColorForward10(l, d, color); + // Ext_FinalColorForward11(l, d, color); + // Ext_FinalColorForward12(l, d, color); + // Ext_FinalColorForward13(l, d, color); + // Ext_FinalColorForward14(l, d, color); + // Ext_FinalColorForward15(l, d, color); + // Ext_FinalColorForward16(l, d, color); + // Ext_FinalColorForward17(l, d, color); + // Ext_FinalColorForward18(l, d, color); + // Ext_FinalColorForward19(l, d, color); + // Ext_FinalColorForward20(l, d, color); + // Ext_FinalColorForward21(l, d, color); + // Ext_FinalColorForward22(l, d, color); + // Ext_FinalColorForward23(l, d, color); + // Ext_FinalColorForward24(l, d, color); + // Ext_FinalColorForward25(l, d, color); + // Ext_FinalColorForward26(l, d, color); + // Ext_FinalColorForward27(l, d, color); + // Ext_FinalColorForward28(l, d, color); + // Ext_FinalColorForward29(l, d, color); + } + + void ChainFinalGBufferStandard(inout Surface s, inout ShaderData d, inout half4 GBuffer0, inout half4 GBuffer1, inout half4 GBuffer2, inout half4 outEmission, inout half4 outShadowMask) + { + // Ext_FinalGBufferStandard0(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard1(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard2(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard3(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard4(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard5(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard6(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard7(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard8(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard9(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard10(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard11(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard12(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard13(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard14(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard15(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard16(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard17(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard18(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard19(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard20(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard21(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard22(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard23(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard24(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard25(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard26(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard27(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard28(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard29(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + } +#endif + + + + + +#if _DECALSHADER + + ShaderData CreateShaderData(SurfaceDescriptionInputs IN) + { + ShaderData d = (ShaderData)0; + d.TBNMatrix = float3x3(IN.WorldSpaceTangent, IN.WorldSpaceBiTangent, IN.WorldSpaceNormal); + d.worldSpaceNormal = IN.WorldSpaceNormal; + d.worldSpaceTangent = IN.WorldSpaceTangent; + + d.worldSpacePosition = IN.WorldSpacePosition; + d.texcoord0 = IN.uv0.xyxy; + d.screenPos = IN.ScreenPosition; + + d.worldSpaceViewDir = normalize(_WorldSpaceCameraPos - d.worldSpacePosition); + + d.tangentSpaceViewDir = mul(d.TBNMatrix, d.worldSpaceViewDir); + + // these rarely get used, so we back transform them. Usually will be stripped. + #if _HDRP + // d.localSpacePosition = mul(GetWorldToObjectMatrix(), float4(GetCameraRelativePositionWS(d.worldSpacePosition), 1)).xyz; + #else + // d.localSpacePosition = mul(GetWorldToObjectMatrix(), float4(d.worldSpacePosition, 1)).xyz; + #endif + // d.localSpaceNormal = normalize(mul((float3x3)GetWorldToObjectMatrix(), d.worldSpaceNormal)); + // d.localSpaceTangent = normalize(mul((float3x3)GetWorldToObjectMatrix(), d.worldSpaceTangent.xyz)); + + // #if %SCREENPOSREQUIREKEY% + // d.screenUV = (IN.ScreenPosition.xy / max(0.01, IN.ScreenPosition.w)); + // #endif + + return d; + } +#else + + ShaderData CreateShaderData(VertexToPixel i + #if NEED_FACING + , bool facing + #endif + ) + { + ShaderData d = (ShaderData)0; + d.clipPos = i.pos; + d.worldSpacePosition = i.worldPos; + + d.worldSpaceNormal = normalize(i.worldNormal); + d.worldSpaceTangent.xyz = normalize(i.worldTangent.xyz); + + d.tangentSign = i.worldTangent.w * unity_WorldTransformParams.w; + float3 bitangent = cross(d.worldSpaceTangent.xyz, d.worldSpaceNormal) * d.tangentSign; + + d.TBNMatrix = float3x3(d.worldSpaceTangent, -bitangent, d.worldSpaceNormal); + d.worldSpaceViewDir = normalize(_WorldSpaceCameraPos - i.worldPos); + + d.tangentSpaceViewDir = mul(d.TBNMatrix, d.worldSpaceViewDir); + d.texcoord0 = i.texcoord0; + d.texcoord1 = i.texcoord1; + d.texcoord2 = i.texcoord2; + + // #if %TEXCOORD3REQUIREKEY% + d.texcoord3 = i.texcoord3; + // #endif + + // d.isFrontFace = facing; + // #if %VERTEXCOLORREQUIREKEY% + d.vertexColor = i.vertexColor; + // #endif + + // these rarely get used, so we back transform them. Usually will be stripped. + #if _HDRP + // d.localSpacePosition = mul(GetWorldToObjectMatrix(), float4(GetCameraRelativePositionWS(i.worldPos), 1)).xyz; + #else + // d.localSpacePosition = mul(GetWorldToObjectMatrix(), float4(i.worldPos, 1)).xyz; + #endif + // d.localSpaceNormal = normalize(mul((float3x3)GetWorldToObjectMatrix(), i.worldNormal)); + // d.localSpaceTangent = normalize(mul((float3x3)GetWorldToObjectMatrix(), i.worldTangent.xyz)); + + // #if %SCREENPOSREQUIREKEY% + // d.screenPos = i.screenPos; + // d.screenUV = (i.screenPos.xy / i.screenPos.w); + // #endif + + + // #if %EXTRAV2F0REQUIREKEY% + // d.extraV2F0 = i.extraV2F0; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // d.extraV2F1 = i.extraV2F1; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // d.extraV2F2 = i.extraV2F2; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // d.extraV2F3 = i.extraV2F3; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // d.extraV2F4 = i.extraV2F4; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // d.extraV2F5 = i.extraV2F5; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // d.extraV2F6 = i.extraV2F6; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // d.extraV2F7 = i.extraV2F7; + // #endif + + return d; + } + +#endif + + + +#if (SHADERPASS == SHADERPASS_LIGHT_TRANSPORT) + + // This was not in constant buffer in original unity, so keep outiside. But should be in as ShaderRenderPass frequency + float unity_OneOverOutputBoost; + float unity_MaxOutputValue; + + CBUFFER_START(UnityMetaPass) + // x = use uv1 as raster position + // y = use uv2 as raster position + bool4 unity_MetaVertexControl; + + // x = return albedo + // y = return normal + bool4 unity_MetaFragmentControl; + CBUFFER_END + + VertexToPixel Vert(VertexData inputMesh) + { + VertexToPixel output; + ZERO_INITIALIZE(VertexToPixel, output); + UNITY_SETUP_INSTANCE_ID(inputMesh); + UNITY_TRANSFER_INSTANCE_ID(inputMesh, output); + UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(output); + + // Output UV coordinate in vertex shader + float2 uv = float2(0.0, 0.0); + + if (unity_MetaVertexControl.x) + { + uv = inputMesh.texcoord1.xy * unity_LightmapST.xy + unity_LightmapST.zw; + } + else if (unity_MetaVertexControl.y) + { + uv = inputMesh.texcoord2.xy * unity_DynamicLightmapST.xy + unity_DynamicLightmapST.zw; + } + + // OpenGL right now needs to actually use the incoming vertex position + // so we create a fake dependency on it here that haven't any impact. + output.pos = float4(uv * 2.0 - 1.0, inputMesh.vertex.z > 0 ? 1.0e-4 : 0.0, 1.0); + + output.worldPos = TransformObjectToWorld(inputMesh.vertex.xyz).xyz; + + // Normal is required for triplanar mapping + output.worldNormal = TransformObjectToWorldNormal(inputMesh.normal); + // Not required but assign to silent compiler warning + output.worldTangent = float4(1.0, 0.0, 0.0, 0.0); + + output.texcoord0 = inputMesh.texcoord0; + output.texcoord1 = inputMesh.texcoord1; + output.texcoord2 = inputMesh.texcoord2; + // #if %TEXCOORD3REQUIREKEY% + output.texcoord3 = inputMesh.texcoord3; + // #endif + // #if %VERTEXCOLORREQUIREKEY% + output.vertexColor = inputMesh.vertexColor; + // #endif + + return output; + } +#else + + #if (_PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR))) + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/ShaderVariablesMatrixDefsHDCamera.hlsl" + + void MotionVectorPositionZBias(VertexToPixel input) + { + #if UNITY_REVERSED_Z + input.pos.z -= unity_MotionVectorsParams.z * input.pos.w; + #else + input.pos.z += unity_MotionVectorsParams.z * input.pos.w; + #endif + } + + #endif + + VertexToPixel Vert(VertexData input) + { + VertexToPixel output; + ZERO_INITIALIZE(VertexToPixel, output); + + UNITY_SETUP_INSTANCE_ID(input); + UNITY_TRANSFER_INSTANCE_ID(input, output); + UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(output); + + #if _HDRP && (_PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR))) + VertexData previousMesh = input; + #endif + + ChainModifyVertex(input, output, _Time); + + // This return the camera relative position (if enable) + float3 positionRWS = TransformObjectToWorld(input.vertex.xyz); + float3 normalWS = TransformObjectToWorldNormal(input.normal); + float4 tangentWS = float4(TransformObjectToWorldDir(input.tangent.xyz), input.tangent.w); + + + output.worldPos = GetAbsolutePositionWS(positionRWS); + output.pos = TransformWorldToHClip(positionRWS); + output.worldNormal = normalWS; + output.worldTangent = tangentWS; + + + output.texcoord0 = input.texcoord0; + output.texcoord1 = input.texcoord1; + output.texcoord2 = input.texcoord2; + + // #if %TEXCOORD3REQUIREKEY% + output.texcoord3 = input.texcoord3; + // #endif + + // #if %VERTEXCOLORREQUIREKEY% + output.vertexColor = input.vertexColor; + // #endif + + // #if %SCREENPOSREQUIREKEY% + // output.screenPos = ComputeScreenPos(output.pos, _ProjectionParams.x); + // #endif + + #if _HDRP && (_PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR))) + + #if !defined(TESSELLATION_ON) + MotionVectorPositionZBias(output); + #endif + + output.motionVectorCS = mul(UNITY_MATRIX_UNJITTERED_VP, float4(positionRWS.xyz, 1.0)); + // Note: unity_MotionVectorsParams.y is 0 is forceNoMotion is enabled + bool forceNoMotion = unity_MotionVectorsParams.y == 0.0; + if (forceNoMotion) + { + output.previousPositionCS = float4(0.0, 0.0, 0.0, 1.0); + } + else + { + bool hasDeformation = unity_MotionVectorsParams.x > 0.0; // Skin or morph target + + float3 effectivePositionOS = (hasDeformation ? previousMesh.previousPositionOS : previousMesh.vertex.xyz); + #if defined(_ADD_PRECOMPUTED_VELOCITY) + effectivePositionOS -= input.precomputedVelocity; + #endif + + previousMesh.vertex = float4(effectivePositionOS, 1); + VertexToPixel dummy = (VertexToPixel)0; + + + ChainModifyVertex(previousMesh, dummy, _LastTimeParameters); + + // we might need this for skinned objects? + //float3 normalWS = TransformPreviousObjectToWorldNormal(input.normal).xyz; + float3 previousPositionRWS = TransformPreviousObjectToWorld(previousMesh.vertex.xyz); + + #ifdef _WRITE_TRANSPARENT_MOTION_VECTOR + if (_TransparentCameraOnlyMotionVectors > 0) + { + previousPositionRWS = positionRWS.xyz; + } + #endif // _WRITE_TRANSPARENT_MOTION_VECTOR + + output.previousPositionCS = mul(UNITY_MATRIX_PREV_VP, float4(previousPositionRWS, 1.0)); + } + #endif // _HDRP && _PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR)) + + + return output; + } + + +#endif + + + + + + + + #if defined(WRITE_DECAL_BUFFER) && !defined(_DISABLE_DECALS) + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/Decal/DecalPrepassBuffer.hlsl" + #endif + + FragInputs BuildFragInputs(VertexToPixel input) + { + UNITY_SETUP_INSTANCE_ID(input); + FragInputs output; + ZERO_INITIALIZE(FragInputs, output); + + // Init to some default value to make the computer quiet (else it output 'divide by zero' warning even if value is not used). + // TODO: this is a really poor workaround, but the variable is used in a bunch of places + // to compute normals which are then passed on elsewhere to compute other values... + output.tangentToWorld = k_identity3x3; + output.positionSS = input.pos; // input.positionCS is SV_Position + // BETTER SHADERS: because we transform world position into actual world space for things like + // triplanar, etc, we have to back transform it here for lighting + output.positionRWS = GetCameraRelativePositionWS(input.worldPos); + output.tangentToWorld = BuildTangentToWorld(input.worldTangent, input.worldNormal); + output.texCoord0 = input.texcoord0; + output.texCoord1 = input.texcoord1; + output.texCoord2 = input.texcoord2; + + return output; + } + +#if UNITY_VERSION > UNITY_2022_3_12 + void ApplyDecalAndGetNormal(FragInputs fragInputs, PositionInputs posInput, Surface surfaceDescription, float3 normalTS, + inout SurfaceData surfaceData) + { + float3 doubleSidedConstants = GetDoubleSidedConstants(); + + #ifdef DECAL_NORMAL_BLENDING + // SG nodes don't ouptut surface gradients, so if decals require surf grad blending, we have to convert + // the normal to gradient before applying the decal. We then have to resolve the gradient back to world space + normalTS = SurfaceGradientFromTangentSpaceNormalAndFromTBN(normalTS, + fragInputs.tangentToWorld[0], fragInputs.tangentToWorld[1]); + + + #if HAVE_DECALS + if (_EnableDecals) + { + float alpha = 1.0; + alpha = surfaceDescription.Alpha; + + DecalSurfaceData decalSurfaceData = GetDecalSurfaceData(posInput, fragInputs, alpha); + ApplyDecalToSurfaceNormal(decalSurfaceData, fragInputs.tangentToWorld[2], normalTS); + ApplyDecalToSurfaceDataNoNormal(decalSurfaceData, surfaceData); + } + #endif + + GetNormalWS_SG(fragInputs, normalTS, surfaceData.normalWS, doubleSidedConstants); + #else + // normal delivered to master node + + #if HAVE_DECALS + if (_EnableDecals) + { + float alpha = 1.0; + alpha = surfaceDescription.Alpha; + + // Both uses and modifies 'surfaceData.normalWS'. + DecalSurfaceData decalSurfaceData = GetDecalSurfaceData(posInput, fragInputs, alpha); + ApplyDecalToSurfaceNormal(decalSurfaceData, surfaceData.normalWS.xyz); + ApplyDecalToSurfaceDataNoNormal(decalSurfaceData, surfaceData); + } + #endif + #endif + } +#endif + + void BuildSurfaceData(FragInputs fragInputs, inout Surface surfaceDescription, float3 V, PositionInputs posInput, out SurfaceData surfaceData, out float3 bentNormalWS) + { + // setup defaults -- these are used if the graph doesn't output a value + ZERO_INITIALIZE(SurfaceData, surfaceData); + + // specularOcclusion need to be init ahead of decal to quiet the compiler that modify the SurfaceData struct + // however specularOcclusion can come from the graph, so need to be init here so it can be override. + surfaceData.specularOcclusion = 1.0; + + // copy across graph values, if defined + surfaceData.baseColor = surfaceDescription.Albedo; + surfaceData.perceptualSmoothness = surfaceDescription.Smoothness; + surfaceData.ambientOcclusion = surfaceDescription.Occlusion; + surfaceData.specularOcclusion = surfaceDescription.SpecularOcclusion; + surfaceData.metallic = surfaceDescription.Metallic; + surfaceData.subsurfaceMask = surfaceDescription.SubsurfaceMask; + surfaceData.thickness = surfaceDescription.Thickness; + surfaceData.diffusionProfileHash = asuint(surfaceDescription.DiffusionProfileHash); + #if _USESPECULAR + surfaceData.specularColor = surfaceDescription.Specular; + #endif + surfaceData.coatMask = surfaceDescription.CoatMask; + surfaceData.anisotropy = surfaceDescription.Anisotropy; + surfaceData.iridescenceMask = surfaceDescription.IridescenceMask; + surfaceData.iridescenceThickness = surfaceDescription.IridescenceThickness; + + + + #if defined(_REFRACTION_PLANE) || defined(_REFRACTION_SPHERE) || defined(_REFRACTION_THIN) + if (_EnableSSRefraction) + { + surfaceData.transmittanceMask = (1.0 - surfaceDescription.Alpha); + surfaceDescription.Alpha = 1.0; + } + else + { + surfaceData.ior = surfaceDescription.ior; + surfaceData.transmittanceColor = surfaceDescription.transmittanceColor; + surfaceData.atDistance = surfaceDescription.atDistance; + surfaceData.transmittanceMask = surfaceDescription.transmittanceMask; + surfaceDescription.Alpha = 1.0; + } + #else + surfaceData.ior = 1.0; + surfaceData.transmittanceColor = float3(1.0, 1.0, 1.0); + surfaceData.atDistance = 1.0; + surfaceData.transmittanceMask = 0.0; + #endif + + + + // These static material feature allow compile time optimization + surfaceData.materialFeatures = MATERIALFEATUREFLAGS_LIT_STANDARD; + #ifdef _MATERIAL_FEATURE_SUBSURFACE_SCATTERING + surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_SUBSURFACE_SCATTERING; + #endif + + #ifdef _MATERIAL_FEATURE_TRANSMISSION + surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_TRANSMISSION; + #endif + + #ifdef _MATERIAL_FEATURE_ANISOTROPY + surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_ANISOTROPY; + surfaceData.normalWS = float3(0, 1, 0); + #endif + + #ifdef _MATERIAL_FEATURE_IRIDESCENCE + surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_IRIDESCENCE; + #endif + + #ifdef _MATERIAL_FEATURE_SPECULAR_COLOR + surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_SPECULAR_COLOR; + #endif + + #if defined(_MATERIAL_FEATURE_CLEAR_COAT) || _CLEARCOAT + surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_CLEAR_COAT; + #endif + + #if defined (_MATERIAL_FEATURE_SPECULAR_COLOR) && defined (_ENERGY_CONSERVING_SPECULAR) + // Require to have setup baseColor + // Reproduce the energy conservation done in legacy Unity. Not ideal but better for compatibility and users can unchek it + surfaceData.baseColor *= (1.0 - Max3(surfaceData.specularColor.r, surfaceData.specularColor.g, surfaceData.specularColor.b)); + #endif + + float3 normalTS = surfaceDescription.Normal; + #if !_WORLDSPACENORMAL + surfaceData.normalWS = mul(surfaceDescription.Normal, fragInputs.tangentToWorld); + #else + normalTS = mul(fragInputs.tangentToWorld, surfaceDescription.Normal); + surfaceData.normalWS = surfaceDescription.Normal; + #endif + + + #if UNITY_VERSION > UNITY_2022_3_12 + ApplyDecalAndGetNormal(fragInputs, posInput, surfaceDescription, normalTS, surfaceData); + #else + #ifdef DECAL_NORMAL_BLENDING + #if HAVE_DECALS + float alpha = 1.0; + alpha = surfaceDescription.Alpha; + if (_EnableDecals) + { + DecalSurfaceData decalSurfaceData = GetDecalSurfaceData(posInput, fragInputs, alpha); + ApplyDecalToSurfaceData(decalSurfaceData, fragInputs.tangentToWorld[2], surfaceData, normalTS); + } + #endif + #else + #if HAVE_DECALS + if (_EnableDecals) + { + float alpha = 1.0; + alpha = surfaceDescription.Alpha; + // Both uses and modifies 'surfaceData.normalWS'. + DecalSurfaceData decalSurfaceData = GetDecalSurfaceData(posInput, fragInputs, alpha); + ApplyDecalToSurfaceData(decalSurfaceData, fragInputs.tangentToWorld[2], surfaceData); + } + #endif + #endif + #endif + + + + surfaceData.geomNormalWS = fragInputs.tangentToWorld[2]; + + surfaceData.tangentWS = normalize(fragInputs.tangentToWorld[0].xyz); // The tangent is not normalize in tangentToWorld for mikkt. TODO: Check if it expected that we normalize with Morten. Tag: SURFACE_GRADIENT + + + bentNormalWS = surfaceData.normalWS; + + surfaceData.tangentWS = Orthonormalize(surfaceData.tangentWS, surfaceData.normalWS); + + #ifdef DEBUG_DISPLAY + if (_DebugMipMapMode != DEBUGMIPMAPMODE_NONE) + { + // TODO: need to update mip info + surfaceData.metallic = 0; + } + + // We need to call ApplyDebugToSurfaceData after filling the surfarcedata and before filling builtinData + // as it can modify attribute use for static lighting + ApplyDebugToSurfaceData(fragInputs.tangentToWorld, surfaceData); + #endif + + // By default we use the ambient occlusion with Tri-ace trick (apply outside) for specular occlusion. + // If user provide bent normal then we process a better term + #if defined(_SPECULAR_OCCLUSION_CUSTOM) + // Just use the value passed through via the slot (not active otherwise) + #elif defined(_SPECULAR_OCCLUSION_FROM_AO_BENT_NORMAL) + // If we have bent normal and ambient occlusion, process a specular occlusion + surfaceData.specularOcclusion = GetSpecularOcclusionFromBentAO(V, bentNormalWS, surfaceData.normalWS, surfaceData.ambientOcclusion, PerceptualSmoothnessToPerceptualRoughness(surfaceData.perceptualSmoothness)); + #elif defined(_AMBIENT_OCCLUSION) && defined(_SPECULAR_OCCLUSION_FROM_AO) + surfaceData.specularOcclusion = GetSpecularOcclusionFromAmbientOcclusion(ClampNdotV(dot(surfaceData.normalWS, V)), surfaceData.ambientOcclusion, PerceptualSmoothnessToRoughness(surfaceData.perceptualSmoothness)); + #endif + + #if defined(_ENABLE_GEOMETRIC_SPECULAR_AA) && !defined(SHADER_STAGE_RAY_TRACING) + surfaceData.perceptualSmoothness = GeometricNormalFiltering(surfaceData.perceptualSmoothness, fragInputs.tangentToWorld[2], surfaceDescription.SpecularAAScreenSpaceVariance, surfaceDescription.SpecularAAThreshold); + #endif + } + + void GetSurfaceAndBuiltinData(VertexToPixel m2ps, FragInputs fragInputs, float3 V, inout PositionInputs posInput, + out SurfaceData surfaceData, out BuiltinData builtinData, inout Surface l, inout ShaderData d + #if NEED_FACING + , bool facing + #endif + ) + { + // Removed since crossfade does not work, probably needs extra material setup. + //#if !defined(SHADER_STAGE_RAY_TRACING) && !defined(_TESSELLATION_DISPLACEMENT) + // #ifdef LOD_FADE_CROSSFADE // enable dithering LOD transition if user select CrossFade transition in LOD group + // LODDitheringTransition(ComputeFadeMaskSeed(V, posInput.positionSS), unity_LODFade.x); + // #endif + //#endif + + + + + d = CreateShaderData(m2ps + #if NEED_FACING + , facing + #endif + ); + + l = (Surface)0; + + l.Albedo = half3(0.5, 0.5, 0.5); + l.Normal = float3(0,0,1); + l.Occlusion = 1; + l.Alpha = 1; + l.SpecularOcclusion = 1; + + #if !defined(SHADER_STAGE_RAY_TRACING) && defined(_DEPTHOFFSET_ON) + l.outputDepth = d.clipPos.z; + #endif + + ChainSurfaceFunction(l, d); + + #if !defined(SHADER_STAGE_RAY_TRACING) && defined(_DEPTHOFFSET_ON) + posInput.deviceDepth = l.outputDepth; + #endif + + #if _UNLIT + //l.Emission = l.Albedo; + //l.Albedo = 0; + l.Normal = half3(0,0,1); + l.Occlusion = 1; + l.Metallic = 0; + l.Specular = 0; + #endif + + surfaceData.geomNormalWS = d.worldSpaceNormal; + surfaceData.tangentWS = d.worldSpaceTangent; + fragInputs.tangentToWorld = d.TBNMatrix; + + float3 bentNormalWS; + + BuildSurfaceData(fragInputs, l, V, posInput, surfaceData, bentNormalWS); + + + float4 lightmapTexCoord1 = fragInputs.texCoord1; + float4 lightmapTexCoord2 = fragInputs.texCoord2; + //#ifdef FRAG_INPUTS_USE_TEXCOORD1 + // float4 lightmapTexCoord1 = fragInputs.texCoord1; + // #else + // float4 lightmapTexCoord1 = float4(0,0,0,0); + // #endif + + // #ifdef FRAG_INPUTS_USE_TEXCOORD2 + // float4 lightmapTexCoord2 = fragInputs.texCoord2; + // #else + // float4 lightmapTexCoord2 = float4(0,0,0,0); + // #endif + + + InitBuiltinData(posInput, l.Alpha, bentNormalWS, -d.worldSpaceNormal, lightmapTexCoord1, lightmapTexCoord2, builtinData); + + + + builtinData.emissiveColor = l.Emission; + + #if defined(_OVERRIDE_BAKEDGI) + builtinData.bakeDiffuseLighting = l.DiffuseGI; + builtinData.backBakeDiffuseLighting = l.BackDiffuseGI; + builtinData.emissiveColor += l.SpecularGI; + #endif + + #if defined(_OVERRIDE_SHADOWMASK) + builtinData.shadowMask0 = l.ShadowMask.x; + builtinData.shadowMask1 = l.ShadowMask.y; + builtinData.shadowMask2 = l.ShadowMask.z; + builtinData.shadowMask3 = l.ShadowMask.w; + #endif + + #ifdef UNITY_VIRTUAL_TEXTURING + //builtinData.vtPackedFeedback = surfaceData.VTPackedFeedback; + #endif + + #if (SHADERPASS == SHADERPASS_DISTORTION) + builtinData.distortion = surfaceData.Distortion; + builtinData.distortionBlur = surfaceData.DistortionBlur; + #endif + + #ifndef SHADER_UNLIT + // PostInitBuiltinData call ApplyDebugToBuiltinData + PostInitBuiltinData(V, posInput, surfaceData, builtinData); + #else + ApplyDebugToBuiltinData(builtinData); + #endif + + RAY_TRACING_OPTIONAL_ALPHA_TEST_PASS + } + + void Frag( VertexToPixel v2f, + OUTPUT_GBUFFER(outGBuffer) + #ifdef _DEPTHOFFSET_ON + , out float outputDepth : SV_Depth + #endif + #if NEED_FACING + , bool facing : SV_IsFrontFace + #endif + ) + { + UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX(v2f); + FragInputs input = BuildFragInputs(v2f); + + // input.positionSS is SV_Position + PositionInputs posInput = GetPositionInput(input.positionSS.xy, _ScreenSize.zw, input.positionSS.z, input.positionSS.w, input.positionRWS); + float3 V = GetWorldSpaceNormalizeViewDir(input.positionRWS); + + SurfaceData surfaceData; + BuiltinData builtinData; + Surface l; + ShaderData d; + GetSurfaceAndBuiltinData(v2f, input, V, posInput, surfaceData, builtinData, l, d + #if NEED_FACING + , facing + #endif + ); + + + ENCODE_INTO_GBUFFER(surfaceData, builtinData, posInput.positionSS, outGBuffer); + + #ifdef _DEPTHOFFSET_ON + outputDepth = l.outputDepth; + #endif + } + + ENDHLSL + } + + Pass + { + // based on HDLitPass.template + Name "ShadowCaster" + Tags { "LightMode" = "ShadowCaster" } + + + + //------------------------------------------------------------------------------------- + // Render Modes (Blend, Cull, ZTest, Stencil, etc) + //------------------------------------------------------------------------------------- + + Cull Back + ZWrite On + ColorMask 0 + ZClip [_ZClip] + + + Tags { "RenderType" = "Opaque" "Queue" = "Geometry" "PreviewType" = "Plane" } + Cull [_CullingOption] + ZWrite [_ZWrite] + ZTest [_ZTestMode] + + + //------------------------------------------------------------------------------------- + // End Render Modes + //------------------------------------------------------------------------------------- + + HLSLPROGRAM + + #pragma target 4.5 + #pragma only_renderers d3d11 playstation xboxone xboxseries vulkan metal switch + //#pragma enable_d3d11_debug_symbols + + #pragma multi_compile_instancing + #pragma instancing_options renderinglayer + #pragma multi_compile _ DOTS_INSTANCING_ON + #pragma multi_compile _ LOD_FADE_CROSSFADE + //#pragma multi_compile_local _ _ALPHATEST_ON + + + //#pragma shader_feature _ _SURFACE_TYPE_TRANSPARENT + //#pragma shader_feature_local _BLENDMODE_OFF _BLENDMODE_ALPHA _BLENDMODE_ADD _BLENDMODE_PRE_MULTIPLY + //#pragma shader_feature_local _ _ADD_PRECOMPUTED_VELOCITY + //#pragma shader_feature_local _ _TRANSPARENT_WRITES_MOTION_VEC + //#pragma shader_feature_local _ _ENABLE_FOG_ON_TRANSPARENT + //#pragma shader_feature_local _ _DISABLE_DECALS + //#pragma shader_feature_local _ _DISABLE_SSR + //#pragma shader_feature_local _ _DISABLE_SSR_TRANSPARENT + //#pragma shader_feature_local _REFRACTION_OFF _REFRACTION_PLANE _REFRACTION_SPHERE _REFRACTION_THIN + #pragma multi_compile _ WRITE_DECAL_BUFFER + //------------------------------------------------------------------------------------- + // Variant Definitions (active field translations to HDRP defines) + //------------------------------------------------------------------------------------- + // #define _MATERIAL_FEATURE_SUBSURFACE_SCATTERING 1 + // #define _MATERIAL_FEATURE_TRANSMISSION 1 + // #define _MATERIAL_FEATURE_ANISOTROPY 1 + // #define _MATERIAL_FEATURE_IRIDESCENCE 1 + // #define _MATERIAL_FEATURE_SPECULAR_COLOR 1 + #define _ENABLE_FOG_ON_TRANSPARENT 1 + // #define _AMBIENT_OCCLUSION 1 + // #define _SPECULAR_OCCLUSION_FROM_AO 1 + // #define _SPECULAR_OCCLUSION_FROM_AO_BENT_NORMAL 1 + // #define _SPECULAR_OCCLUSION_CUSTOM 1 + // #define _ENERGY_CONSERVING_SPECULAR 1 + // #define _ENABLE_GEOMETRIC_SPECULAR_AA 1 + // #define _HAS_REFRACTION 1 + // #define _REFRACTION_PLANE 1 + // #define _REFRACTION_SPHERE 1 + // #define _DISABLE_DECALS 1 + // #define _DISABLE_SSR 1 + // #define _ADD_PRECOMPUTED_VELOCITY + // #define _WRITE_TRANSPARENT_MOTION_VECTOR 1 + // #define _DEPTHOFFSET_ON 1 + // #define _BLENDMODE_PRESERVE_SPECULAR_LIGHTING 1 + + #define SHADERPASS SHADERPASS_SHADOWS + #define _PASSSHADOW 1 + + + #pragma shader_feature_local GLOW_ON + #pragma shader_feature_local FADE_ON + #pragma shader_feature_local OUTBASE_ON + #pragma shader_feature_local ONLYOUTLINE_ON + #pragma shader_feature_local GRADIENT_ON + #pragma shader_feature_local GRADIENT2COL_ON + #pragma shader_feature_local RADIALGRADIENT_ON + #pragma shader_feature_local COLORSWAP_ON + #pragma shader_feature_local HSV_ON + #pragma shader_feature_local CHANGECOLOR_ON + #pragma shader_feature_local CHANGECOLOR2_ON + #pragma shader_feature_local CHANGECOLOR3_ON + #pragma shader_feature_local COLORRAMP_ON + #pragma shader_feature_local GRADIENTCOLORRAMP_ON + #pragma shader_feature_local HITEFFECT_ON + #pragma shader_feature_local NEGATIVE_ON + #pragma shader_feature_local PIXELATE_ON + #pragma shader_feature_local GREYSCALE_ON + #pragma shader_feature_local POSTERIZE_ON + #pragma shader_feature_local BLUR_ON + #pragma shader_feature_local MOTIONBLUR_ON + #pragma shader_feature_local GHOST_ON + #pragma shader_feature_local ALPHAOUTLINE_ON + #pragma shader_feature_local INNEROUTLINE_ON + #pragma shader_feature_local ONLYINNEROUTLINE_ON + #pragma shader_feature_local HOLOGRAM_ON + #pragma shader_feature_local CHROMABERR_ON + #pragma shader_feature_local GLITCH_ON + #pragma shader_feature_local FLICKER_ON + #pragma shader_feature_local SHADOW_ON + #pragma shader_feature_local SHINE_ON + #pragma shader_feature_local CONTRAST_ON + #pragma shader_feature_local OVERLAY_ON + #pragma shader_feature_local OVERLAYMULT_ON + #pragma shader_feature_local DOODLE_ON + #pragma shader_feature_local WIND_ON + #pragma shader_feature_local WAVEUV_ON + #pragma shader_feature_local ROUNDWAVEUV_ON + #pragma shader_feature_local RECTSIZE_ON + #pragma shader_feature_local OFFSETUV_ON + #pragma shader_feature_local CLIPPING_ON + #pragma shader_feature_local RADIALCLIPPING_ON + #pragma shader_feature_local TEXTURESCROLL_ON + #pragma shader_feature_local ZOOMUV_ON + #pragma shader_feature_local DISTORT_ON + #pragma shader_feature_local WARP_ON + #pragma shader_feature_local TWISTUV_ON + #pragma shader_feature_local ROTATEUV_ON + #pragma shader_feature_local POLARUV_ON + #pragma shader_feature_local FISHEYE_ON + #pragma shader_feature_local PINCH_ON + #pragma shader_feature_local SHAKEUV_ON + + #pragma shader_feature_local GLOWTEX_ON + #pragma shader_feature_local OUTTEX_ON + #pragma shader_feature_local OUTDIST_ON + #pragma shader_feature_local OUTBASE8DIR_ON + #pragma shader_feature_local OUTBASEPIXELPERF_ON + #pragma shader_feature_local COLORRAMPOUTLINE_ON + #pragma shader_feature_local GREYSCALEOUTLINE_ON + #pragma shader_feature_local POSTERIZEOUTLINE_ON + #pragma shader_feature_local BLURISHD_ON + #pragma shader_feature_local MANUALWIND_ON + #pragma shader_feature_local ATLAS_ON + #pragma shader_feature_local PREMULTIPLYALPHA_ON + + #pragma shader_feature BILBOARD_ON + #pragma shader_feature BILBOARDY_ON + + #pragma shader_feature NORMALMAP_ON + + + #define _HDRP 1 +#define _USINGTEXCOORD1 1 +#define _USINGTEXCOORD2 1 + + + #pragma vertex Vert + #pragma fragment Frag + + //------------------------------------------------------------------------------------- + // Defines + //------------------------------------------------------------------------------------- + + + // useful conversion functions to make surface shader code just work + + #define UNITY_DECLARE_TEX2D(name) TEXTURE2D(name); SAMPLER(sampler##name); + #define UNITY_DECLARE_TEX2D_NOSAMPLER(name) TEXTURE2D(name); + #define UNITY_DECLARE_TEX2DARRAY(name) TEXTURE2D_ARRAY(name); SAMPLER(sampler##name); + #define UNITY_DECLARE_TEX2DARRAY_NOSAMPLER(tex) TEXTURE2D_ARRAY(tex); + + #define UNITY_SAMPLE_TEX2DARRAY(tex,coord) SAMPLE_TEXTURE2D_ARRAY(tex, sampler##tex, coord.xy, coord.z) + #define UNITY_SAMPLE_TEX2DARRAY_LOD(tex,coord,lod) SAMPLE_TEXTURE2D_ARRAY_LOD(tex, sampler##tex, coord.xy, coord.z, lod) + #define UNITY_SAMPLE_TEX2D(tex, coord) SAMPLE_TEXTURE2D(tex, sampler##tex, coord) + #define UNITY_SAMPLE_TEX2D_SAMPLER(tex, samp, coord) SAMPLE_TEXTURE2D(tex, sampler##samp, coord) + + #define UNITY_SAMPLE_TEX2D_LOD(tex,coord, lod) SAMPLE_TEXTURE2D_LOD(tex, sampler_##tex, coord, lod) + #define UNITY_SAMPLE_TEX2D_SAMPLER_LOD(tex,samplertex,coord, lod) SAMPLE_TEXTURE2D_LOD (tex, sampler##samplertex,coord, lod) + + #if defined(UNITY_COMPILER_HLSL) + #define UNITY_INITIALIZE_OUTPUT(type,name) name = (type)0; + #else + #define UNITY_INITIALIZE_OUTPUT(type,name) + #endif + + #define sampler2D_float sampler2D + #define sampler2D_half sampler2D + + #undef WorldNormalVector + #define WorldNormalVector(data, normal) mul(normal, data.TBNMatrix) + + #define UnityObjectToWorldNormal(normal) mul(GetObjectToWorldMatrix(), normal) + + #ifndef SHADER_STAGE_FRAGMENT + #if !defined(SHADOW_ULTRA_LOW) && !defined(SHADOW_LOW) && !defined(SHADOW_MEDIUM) && !defined(SHADOW_HIGH) // ultra low come from volumetricLighting.compute + #define SHADOW_MEDIUM + #endif + #if !defined(AREA_SHADOW_LOW) && !defined(AREA_SHADOW_MEDIUM) && !defined(AREA_SHADOW_HIGH) // low come from volumetricLighting.compute + #define AREA_SHADOW_MEDIUM + #endif + #endif + + + +// HDRP Adapter stuff + #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Common.hlsl" + #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Common.hlsl" + #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/GeometricTools.hlsl" // Required by Tessellation.hlsl + #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Tessellation.hlsl" + #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Texture.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/ShaderVariables.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/ShaderPass/ShaderPass.cs.hlsl" + #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/TextureStack.hlsl" // Required to be include before we include properties as it define DECLARE_STACK_CB + #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/DebugMipmapStreamingMacros.hlsl" // Required before including properties as it defines UNITY_TEXTURE_STREAMING_DEBUG_VARS + // Always include Shader Graph version + // Always include last to avoid double macros + #include "Packages/com.unity.shadergraph/ShaderGraphLibrary/Functions.hlsl" // Need to be here for Gradient struct definition + + +#include "Packages/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/ShaderPass/FragInputs.hlsl" + + + + #ifdef RAYTRACING_SHADER_GRAPH_DEFAULT + #define RAYTRACING_SHADER_GRAPH_HIGH + #endif + + #ifdef RAYTRACING_SHADER_GRAPH_RAYTRACED + #define RAYTRACING_SHADER_GRAPH_LOW + #endif + // end + + + + + // If we use subsurface scattering, enable output split lighting (for forward pass) + #if defined(_MATERIAL_FEATURE_SUBSURFACE_SCATTERING) && !defined(_SURFACE_TYPE_TRANSPARENT) + #define OUTPUT_SPLIT_LIGHTING + #endif + + #define HAVE_RECURSIVE_RENDERING + + #if SHADERPASS == SHADERPASS_TRANSPARENT_DEPTH_PREPASS + #if !defined(_DISABLE_SSR_TRANSPARENT) && !defined(SHADER_UNLIT) + #define WRITE_NORMAL_BUFFER + #endif + #endif + + #ifndef DEBUG_DISPLAY + // In case of opaque we don't want to perform the alpha test, it is done in depth prepass and we use depth equal for ztest (setup from UI) + // Don't do it with debug display mode as it is possible there is no depth prepass in this case + #if !defined(_SURFACE_TYPE_TRANSPARENT) && defined(_ALPHATEST) + #if SHADERPASS == SHADERPASS_FORWARD + #define SHADERPASS_FORWARD_BYPASS_ALPHA_TEST + #elif SHADERPASS == SHADERPASS_GBUFFER + #define SHADERPASS_GBUFFER_BYPASS_ALPHA_TEST + #endif + #endif + #endif + + // Define _DEFERRED_CAPABLE_MATERIAL for shader capable to run in deferred pass + #if defined(SHADER_LIT) && !defined(_SURFACE_TYPE_TRANSPARENT) + #define _DEFERRED_CAPABLE_MATERIAL + #endif + + // Translate transparent motion vector define + #if defined(_TRANSPARENT_WRITES_MOTION_VEC) && defined(_SURFACE_TYPE_TRANSPARENT) + #define _WRITE_TRANSPARENT_MOTION_VECTOR + #endif + + + + + CBUFFER_START(UnityPerMaterial) + float _UseShadowThreshold; + float _BlendMode; + float _EnableBlendModePreserveSpecularLighting; + float _RayTracing; + float _RefractionModel; + + + half4 _Color; + half4 _MainTex_ST, _MainTex_TexelSize; + half _Alpha, _AlphaCutoffValue; + + #if ATLAS_ON + half _MinXUV, _MaxXUV, _MinYUV, _MaxYUV; + #endif + + #if GLOW_ON + half4 _GlowColor; + half _Glow, _GlowGlobal; + #endif + + #if HSV_ON + half _HsvShift, _HsvSaturation, _HsvBright; + #endif + + #if DISTORT_ON + half4 _DistortTex_ST; + half _DistortTexXSpeed, _DistortTexYSpeed, _DistortAmount; + #endif + + #if FADE_ON + half4 _FadeBurnColor, _FadeTex_ST, _FadeBurnTex_ST; + half _FadeAmount, _FadeBurnWidth, _FadeBurnTransition,_FadeBurnGlow; + #endif + + #if OUTBASE_ON + half4 _OutlineColor; + half _OutlineAlpha, _OutlineGlow, _OutlineWidth; + int _OutlinePixelWidth; + #endif + + #if OUTTEX_ON + half4 _OutlineTex_ST; + half _OutlineTexXSpeed, _OutlineTexYSpeed; + #endif + + #if OUTDIST_ON + half4 _OutlineDistortTex_ST; + half _OutlineDistortTexXSpeed, _OutlineDistortTexYSpeed, _OutlineDistortAmount; + #endif + + #if ALPHAOUTLINE_ON + half _AlphaOutlineGlow, _AlphaOutlinePower, _AlphaOutlineMinAlpha, _AlphaOutlineBlend; + half4 _AlphaOutlineColor; + #endif + + #if INNEROUTLINE_ON + half _InnerOutlineThickness, _InnerOutlineAlpha, _InnerOutlineGlow; + half4 _InnerOutlineColor; + #endif + + #if GRADIENT_ON + half _GradBlend, _GradBoostX, _GradBoostY; + half4 _GradTopRightCol, _GradTopLeftCol, _GradBotRightCol, _GradBotLeftCol; + #endif + + #if COLORSWAP_ON + half4 _ColorSwapRed, _ColorSwapGreen, _ColorSwapBlue; + half _ColorSwapRedLuminosity, _ColorSwapGreenLuminosity, _ColorSwapBlueLuminosity, _ColorSwapBlend; + #endif + + #if CHANGECOLOR_ON + half4 _ColorChangeNewCol, _ColorChangeTarget; + half _ColorChangeTolerance, _ColorChangeLuminosity; + #endif + #if CHANGECOLOR2_ON + half4 _ColorChangeNewCol2, _ColorChangeTarget2; + half _ColorChangeTolerance2; + #endif + #if CHANGECOLOR3_ON + half4 _ColorChangeNewCol3, _ColorChangeTarget3; + half _ColorChangeTolerance3; + #endif + + #if COLORRAMP_ON + half _ColorRampLuminosity, _ColorRampBlend; + #endif + + #if HITEFFECT_ON + half4 _HitEffectColor; + half _HitEffectGlow, _HitEffectBlend; + #endif + + #if NEGATIVE_ON + half _NegativeAmount; + #endif + + #if PIXELATE_ON + half _PixelateSize; + #endif + + #if GREYSCALE_ON + half _GreyscaleLuminosity, _GreyscaleBlend; + half4 _GreyscaleTintColor; + #endif + + #if POSTERIZE_ON + half _PosterizeNumColors, _PosterizeGamma; + #endif + + #if BLUR_ON + half _BlurIntensity; + #endif + + #if MOTIONBLUR_ON + half _MotionBlurAngle, _MotionBlurDist; + #endif + + #if GHOST_ON + half _GhostColorBoost, _GhostTransparency, _GhostBlend; + #endif + + #if HOLOGRAM_ON + half _HologramStripesAmount, _HologramMinAlpha, _HologramUnmodAmount, _HologramStripesSpeed, _HologramMaxAlpha, _HologramBlend; + half4 _HologramStripeColor; + #endif + + #if CHROMABERR_ON + half _ChromAberrAmount, _ChromAberrAlpha; + #endif + + #if GLITCH_ON + half _GlitchAmount, _GlitchSize; + #endif + + #if FLICKER_ON + half _FlickerFreq, _FlickerPercent, _FlickerAlpha; + #endif + + #if SHADOW_ON + half _ShadowX, _ShadowY, _ShadowAlpha; + half4 _ShadowColor; + #endif + + #if SHINE_ON + half4 _ShineColor; + half _ShineLocation, _ShineRotate, _ShineWidth, _ShineGlow; + #endif + + #if CONTRAST_ON + half _Contrast, _Brightness; + #endif + + #if OVERLAY_ON + half4 _OverlayTex_ST, _OverlayColor; + half _OverlayGlow, _OverlayBlend, _OverlayTextureScrollXSpeed, _OverlayTextureScrollYSpeed; + #endif + + #if DOODLE_ON + half _HandDrawnAmount, _HandDrawnSpeed; + #endif + + #if WIND_ON + half _GrassSpeed, _GrassWind, _GrassManualAnim, _GrassRadialBend; + #endif + + #if WAVEUV_ON + float _WaveAmount, _WaveSpeed, _WaveStrength, _WaveX, _WaveY; + #endif + + #if ROUNDWAVEUV_ON + half _RoundWaveStrength, _RoundWaveSpeed; + #endif + + #if RECTSIZE_ON + half _RectSize; + #endif + + #if OFFSETUV_ON + half _OffsetUvX, _OffsetUvY; + #endif + + #if CLIPPING_ON + half _ClipUvLeft, _ClipUvRight, _ClipUvUp, _ClipUvDown; + #endif + + #if RADIALCLIPPING_ON + half _RadialStartAngle, _RadialClip, _RadialClip2; + #endif + + #if TEXTURESCROLL_ON + half _TextureScrollXSpeed, _TextureScrollYSpeed; + #endif + + #if ZOOMUV_ON + half _ZoomUvAmount; + #endif + + #if WARP_ON + half _WarpStrength, _WarpSpeed, _WarpScale; + #endif + + #if TWISTUV_ON + half _TwistUvAmount, _TwistUvPosX, _TwistUvPosY, _TwistUvRadius; + #endif + + #if ROTATEUV_ON + half _RotateUvAmount; + #endif + + #if FISHEYE_ON + half _FishEyeUvAmount; + #endif + + #if PINCH_ON + half _PinchUvAmount; + #endif + + #if SHAKEUV_ON + half _ShakeUvSpeed, _ShakeUvX, _ShakeUvY; + #endif + + #if NORMALMAP_ON + half _NormalStrength; + #endif + + float _RandomSeed; + + + + + CBUFFER_END + + + + // -- Property used by ScenePickingPass + #ifdef SCENEPICKINGPASS + float4 _SelectionID; + #endif + + // -- Properties used by SceneSelectionPass + #ifdef SCENESELECTIONPASS + int _ObjectId; + int _PassValue; + #endif + + + // data across stages, stripped like the above. + struct VertexToPixel + { + float4 pos : SV_POSITION; + float3 worldPos : TEXCOORD0; + float3 worldNormal : TEXCOORD1; + float4 worldTangent : TEXCOORD2; + float4 texcoord0 : TEXCOORD3; + float4 texcoord1 : TEXCOORD4; + float4 texcoord2 : TEXCOORD5; + // #if %TEXCOORD3REQUIREKEY% + float4 texcoord3 : TEXCOORD6; + // #endif + + // #if %SCREENPOSREQUIREKEY% + // float4 screenPos : TEXCOORD7; + // #endif + + // #if %VERTEXCOLORREQUIREKEY% + float4 vertexColor : COLOR; + // #endif + + // #if %EXTRAV2F0REQUIREKEY% + // float4 extraV2F0 : TEXCOORD8; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // float4 extraV2F1 : TEXCOORD9; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // float4 extraV2F2 : TEXCOORD10; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // float4 extraV2F3 : TEXCOORD11; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // float4 extraV2F4 : TEXCOORD12; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // float4 extraV2F5 : TEXCOORD13; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // float4 extraV2F6 : TEXCOORD14; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // float4 extraV2F7 : TEXCOORD15; + // #endif + + #if UNITY_ANY_INSTANCING_ENABLED + UNITY_VERTEX_INPUT_INSTANCE_ID + #endif // UNITY_ANY_INSTANCING_ENABLED + + #if _HDRP && (_PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR))) + float4 previousPositionCS : TEXCOORD16; // Contain previous transform position (in case of skinning for example) + float4 motionVectorCS : TEXCOORD17; + #endif + + UNITY_VERTEX_OUTPUT_STEREO + }; + + + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Debug/DebugDisplay.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/Material.hlsl" + #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/NormalSurfaceGradient.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/Lit/Lit.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/BuiltinUtilities.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/MaterialUtilities.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/Decal/DecalUtilities.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/Lit/LitDecalData.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/ShaderGraphFunctions.hlsl" + + + + + + // data describing the user output of a pixel + struct Surface + { + half3 Albedo; + half Height; + half3 Normal; + half Smoothness; + half3 Emission; + half Metallic; + half3 Specular; + half Occlusion; + half SpecularPower; // for simple lighting + half Alpha; + float outputDepth; // if written, SV_Depth semantic is used. ShaderData.clipPos.z is unused value + // HDRP Only + half SpecularOcclusion; + half SubsurfaceMask; + half Thickness; + half CoatMask; + half CoatSmoothness; + half Anisotropy; + half IridescenceMask; + half IridescenceThickness; + int DiffusionProfileHash; + float SpecularAAThreshold; + float SpecularAAScreenSpaceVariance; + // requires _OVERRIDE_BAKEDGI to be defined, but is mapped in all pipelines + float3 DiffuseGI; + float3 BackDiffuseGI; + float3 SpecularGI; + float ior; + float3 transmittanceColor; + float atDistance; + float transmittanceMask; + // requires _OVERRIDE_SHADOWMASK to be defines + float4 ShadowMask; + + // for decals + float NormalAlpha; + float MAOSAlpha; + + + }; + + // Data the user declares in blackboard blocks + struct Blackboard + { + + float blackboardDummyData; + }; + + // data the user might need, this will grow to be big. But easy to strip + struct ShaderData + { + float4 clipPos; // SV_POSITION + float3 localSpacePosition; + float3 localSpaceNormal; + float3 localSpaceTangent; + + float3 worldSpacePosition; + float3 worldSpaceNormal; + float3 worldSpaceTangent; + float tangentSign; + + float3 worldSpaceViewDir; + float3 tangentSpaceViewDir; + + float4 texcoord0; + float4 texcoord1; + float4 texcoord2; + float4 texcoord3; + + float2 screenUV; + float4 screenPos; + + float4 vertexColor; + bool isFrontFace; + + float4 extraV2F0; + float4 extraV2F1; + float4 extraV2F2; + float4 extraV2F3; + float4 extraV2F4; + float4 extraV2F5; + float4 extraV2F6; + float4 extraV2F7; + + float3x3 TBNMatrix; + Blackboard blackboard; + }; + + struct VertexData + { + #if SHADER_TARGET > 30 + // uint vertexID : SV_VertexID; + #endif + float4 vertex : POSITION; + float3 normal : NORMAL; + float4 tangent : TANGENT; + float4 texcoord0 : TEXCOORD0; + + // optimize out mesh coords when not in use by user or lighting system + #if _URP && (_USINGTEXCOORD1 || _PASSMETA || _PASSFORWARD || _PASSGBUFFER) + float4 texcoord1 : TEXCOORD1; + #endif + + #if _URP && (_USINGTEXCOORD2 || _PASSMETA || ((_PASSFORWARD || _PASSGBUFFER) && defined(DYNAMICLIGHTMAP_ON))) + float4 texcoord2 : TEXCOORD2; + #endif + + #if _STANDARD && (_USINGTEXCOORD1 || (_PASSMETA || ((_PASSFORWARD || _PASSGBUFFER || _PASSFORWARDADD) && LIGHTMAP_ON))) + float4 texcoord1 : TEXCOORD1; + #endif + #if _STANDARD && (_USINGTEXCOORD2 || (_PASSMETA || ((_PASSFORWARD || _PASSGBUFFER) && DYNAMICLIGHTMAP_ON))) + float4 texcoord2 : TEXCOORD2; + #endif + + + #if _HDRP + float4 texcoord1 : TEXCOORD1; + float4 texcoord2 : TEXCOORD2; + #endif + + // #if %TEXCOORD3REQUIREKEY% + float4 texcoord3 : TEXCOORD3; + // #endif + + // #if %VERTEXCOLORREQUIREKEY% + float4 vertexColor : COLOR; + // #endif + + #if _PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR)) + float3 previousPositionOS : TEXCOORD4; // Contain previous transform position (in case of skinning for example) + #if defined (_ADD_PRECOMPUTED_VELOCITY) + float3 precomputedVelocity : TEXCOORD5; // Add Precomputed Velocity (Alembic computes velocities on runtime side). + #endif + #endif + + UNITY_VERTEX_INPUT_INSTANCE_ID + }; + + struct TessVertex + { + float4 vertex : INTERNALTESSPOS; + float3 normal : NORMAL; + float4 tangent : TANGENT; + float4 texcoord0 : TEXCOORD0; + float4 texcoord1 : TEXCOORD1; + float4 texcoord2 : TEXCOORD2; + + // #if %TEXCOORD3REQUIREKEY% + float4 texcoord3 : TEXCOORD3; + // #endif + + // #if %VERTEXCOLORREQUIREKEY% + float4 vertexColor : COLOR; + // #endif + + // #if %EXTRAV2F0REQUIREKEY% + // float4 extraV2F0 : TEXCOORD5; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // float4 extraV2F1 : TEXCOORD6; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // float4 extraV2F2 : TEXCOORD7; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // float4 extraV2F3 : TEXCOORD8; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // float4 extraV2F4 : TEXCOORD9; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // float4 extraV2F5 : TEXCOORD10; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // float4 extraV2F6 : TEXCOORD11; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // float4 extraV2F7 : TEXCOORD12; + // #endif + + #if _PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR)) + float3 previousPositionOS : TEXCOORD13; // Contain previous transform position (in case of skinning for example) + #if defined (_ADD_PRECOMPUTED_VELOCITY) + float3 precomputedVelocity : TEXCOORD14; + #endif + #endif + + UNITY_VERTEX_INPUT_INSTANCE_ID + UNITY_VERTEX_OUTPUT_STEREO + }; + + struct ExtraV2F + { + float4 extraV2F0; + float4 extraV2F1; + float4 extraV2F2; + float4 extraV2F3; + float4 extraV2F4; + float4 extraV2F5; + float4 extraV2F6; + float4 extraV2F7; + Blackboard blackboard; + float4 time; + }; + + + float3 WorldToTangentSpace(ShaderData d, float3 normal) + { + return mul(d.TBNMatrix, normal); + } + + float3 TangentToWorldSpace(ShaderData d, float3 normal) + { + return mul(normal, d.TBNMatrix); + } + + // in this case, make standard more like SRPs, because we can't fix + // unity_WorldToObject in HDRP, since it already does macro-fu there + + #if _STANDARD + float3 TransformWorldToObject(float3 p) { return mul(unity_WorldToObject, float4(p, 1)); }; + float3 TransformObjectToWorld(float3 p) { return mul(unity_ObjectToWorld, float4(p, 1)); }; + float4 TransformWorldToObject(float4 p) { return mul(unity_WorldToObject, p); }; + float4 TransformObjectToWorld(float4 p) { return mul(unity_ObjectToWorld, p); }; + float4x4 GetWorldToObjectMatrix() { return unity_WorldToObject; } + float4x4 GetObjectToWorldMatrix() { return unity_ObjectToWorld; } + #if (defined(SHADER_API_D3D11) || defined(SHADER_API_XBOXONE) || defined(UNITY_COMPILER_HLSLCC) || defined(SHADER_API_PSSL) || (SHADER_TARGET_SURFACE_ANALYSIS && !SHADER_TARGET_SURFACE_ANALYSIS_MOJOSHADER)) + #define UNITY_SAMPLE_TEX2D_LOD(tex,coord, lod) tex.SampleLevel (sampler##tex,coord, lod) + #define UNITY_SAMPLE_TEX2D_SAMPLER_LOD(tex,samplertex,coord, lod) tex.SampleLevel (sampler##samplertex,coord, lod) + #else + #define UNITY_SAMPLE_TEX2D_LOD(tex,coord,lod) tex2D (tex,coord,0,lod) + #define UNITY_SAMPLE_TEX2D_SAMPLER_LOD(tex,samplertex,coord,lod) tex2D (tex,coord,0,lod) + #endif + + #undef GetWorldToObjectMatrix() + + #define GetWorldToObjectMatrix() unity_WorldToObject + + + #endif + + float3 GetCameraWorldPosition() + { + #if _HDRP + return GetCameraRelativePositionWS(_WorldSpaceCameraPos); + #else + return _WorldSpaceCameraPos; + #endif + } + + #if _GRABPASSUSED + #if _STANDARD + TEXTURE2D(%GRABTEXTURE%); + SAMPLER(sampler_%GRABTEXTURE%); + #endif + + half3 GetSceneColor(float2 uv) + { + #if _STANDARD + return SAMPLE_TEXTURE2D(%GRABTEXTURE%, sampler_%GRABTEXTURE%, uv).rgb; + #else + return SHADERGRAPH_SAMPLE_SCENE_COLOR(uv); + #endif + } + #endif + + + + #if _STANDARD + UNITY_DECLARE_DEPTH_TEXTURE(_CameraDepthTexture); + float GetSceneDepth(float2 uv) { return SAMPLE_DEPTH_TEXTURE(_CameraDepthTexture, uv); } + float GetLinear01Depth(float2 uv) { return Linear01Depth(GetSceneDepth(uv)); } + float GetLinearEyeDepth(float2 uv) { return LinearEyeDepth(GetSceneDepth(uv)); } + #else + float GetSceneDepth(float2 uv) { return SHADERGRAPH_SAMPLE_SCENE_DEPTH(uv); } + float GetLinear01Depth(float2 uv) { return Linear01Depth(GetSceneDepth(uv), _ZBufferParams); } + float GetLinearEyeDepth(float2 uv) { return LinearEyeDepth(GetSceneDepth(uv), _ZBufferParams); } + #endif + + float3 GetWorldPositionFromDepthBuffer(float2 uv, float3 worldSpaceViewDir) + { + float eye = GetLinearEyeDepth(uv); + float3 camView = mul((float3x3)GetObjectToWorldMatrix(), transpose(mul(GetWorldToObjectMatrix(), UNITY_MATRIX_I_V)) [2].xyz); + + float dt = dot(worldSpaceViewDir, camView); + float3 div = worldSpaceViewDir/dt; + float3 wpos = (eye * div) + GetCameraWorldPosition(); + return wpos; + } + + #if _HDRP + float3 ObjectToWorldSpacePosition(float3 pos) + { + return GetAbsolutePositionWS(TransformObjectToWorld(pos)); + } + #else + float3 ObjectToWorldSpacePosition(float3 pos) + { + return TransformObjectToWorld(pos); + } + #endif + + #if _STANDARD + UNITY_DECLARE_SCREENSPACE_TEXTURE(_CameraDepthNormalsTexture); + float3 GetSceneNormal(float2 uv, float3 worldSpaceViewDir) + { + float4 depthNorms = UNITY_SAMPLE_SCREENSPACE_TEXTURE(_CameraDepthNormalsTexture, uv); + float3 norms = DecodeViewNormalStereo(depthNorms); + norms = mul((float3x3)GetWorldToViewMatrix(), norms) * 0.5 + 0.5; + return norms; + } + #elif _HDRP && !_DECALSHADER + + float3 GetSceneNormal(float2 uv, float3 worldSpaceViewDir) + { + NormalData nd; + DecodeFromNormalBuffer(_ScreenSize.xy * uv, nd); + return nd.normalWS; + } + #elif _URP + #if (SHADER_LIBRARY_VERSION_MAJOR >= 10) + #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/DeclareNormalsTexture.hlsl" + #endif + + float3 GetSceneNormal(float2 uv, float3 worldSpaceViewDir) + { + #if (SHADER_LIBRARY_VERSION_MAJOR >= 10) + return SampleSceneNormals(uv); + #else + float3 wpos = GetWorldPositionFromDepthBuffer(uv, worldSpaceViewDir); + return normalize(-cross(ddx(wpos), ddy(wpos))) * 0.5 + 0.5; + #endif + + } + #endif + + #if _HDRP + + half3 UnpackNormalmapRGorAG(half4 packednormal) + { + // This do the trick + packednormal.x *= packednormal.w; + + half3 normal; + normal.xy = packednormal.xy * 2 - 1; + normal.z = sqrt(1 - saturate(dot(normal.xy, normal.xy))); + return normal; + } + half3 UnpackNormal(half4 packednormal) + { + #if defined(UNITY_NO_DXT5nm) + return packednormal.xyz * 2 - 1; + #else + return UnpackNormalmapRGorAG(packednormal); + #endif + } + #endif + #if _HDRP || _URP + + half3 UnpackScaleNormal(half4 packednormal, half scale) + { + #ifndef UNITY_NO_DXT5nm + // Unpack normal as DXT5nm (1, y, 1, x) or BC5 (x, y, 0, 1) + // Note neutral texture like "bump" is (0, 0, 1, 1) to work with both plain RGB normal and DXT5nm/BC5 + packednormal.x *= packednormal.w; + #endif + half3 normal; + normal.xy = (packednormal.xy * 2 - 1) * scale; + normal.z = sqrt(1 - saturate(dot(normal.xy, normal.xy))); + return normal; + } + + #endif + + + void GetSun(out float3 lightDir, out float3 color) + { + lightDir = float3(0.5, 0.5, 0); + color = 1; + #if _HDRP + if (_DirectionalLightCount > 0) + { + DirectionalLightData light = _DirectionalLightDatas[0]; + lightDir = -light.forward.xyz; + color = light.color; + } + #elif _STANDARD + lightDir = normalize(_WorldSpaceLightPos0.xyz); + color = _LightColor0.rgb; + #elif _URP + Light light = GetMainLight(); + lightDir = light.direction; + color = light.color; + #endif + } + + + + + + + + + + TEXTURE2D(_MainTex); + SAMPLER(sampler_MainTex); + + #if GLOW_ON + TEXTURE2D(_GlowTex); + SAMPLER(sampler_GlowTex); + #endif + + #if FADE_ON + TEXTURE2D(_FadeTex); + SAMPLER(sampler_FadeTex); + + TEXTURE2D(_FadeBurnTex); + SAMPLER(sampler_FadeBurnTex); + #endif + + #if DISTORT_ON + TEXTURE2D(_DistortTex); + SAMPLER(sampler_DistortTex); + #endif + + #if OUTTEX_ON + TEXTURE2D(_OutlineTex); + SAMPLER(sampler_OutlineTex); + #endif + + #if OUTDIST_ON + TEXTURE2D(_OutlineDistortTex); + SAMPLER(sampler_OutlineDistortTex); + #endif + + #if COLORSWAP_ON + TEXTURE2D(_ColorSwapTex); + SAMPLER(sampler_ColorSwapTex); + #endif + + #if COLORRAMP_ON + TEXTURE2D(_ColorRampTex); + TEXTURE2D(_ColorRampTexGradient); + SAMPLER(sampler_ColorRampTex); + SAMPLER(sampler_ColorRampTexGradient); + #endif + + #if SHINE_ON + TEXTURE2D(_ShineMask); + SAMPLER(sampler_ShineMask); + #endif + + #if OVERLAY_ON + TEXTURE2D(_OverlayTex); + SAMPLER(sampler_OverlayTex); + #endif + + #if NORMALMAP_ON + TEXTURE2D(_NormalMap); + SAMPLER(sampler_NormalMap); + #endif + + + half3 GetPixel(in int offsetX, in int offsetY, in half2 uv, in Texture2D _tex, in SamplerState _sampler) + { + half2 _uv = uv + half2(offsetX * _MainTex_TexelSize.x, offsetY * _MainTex_TexelSize.y); + half4 col = SAMPLE_TEXTURE2D(_tex, _sampler, _uv); + return col.rgb; + } + + + //BLURS------------------------------------------------------------------------- + half4 Blur(half2 uv, Texture2D source, SamplerState sampler_source, half Intensity) + { + const half2 texelSize = 1.0 / _ScreenParams.xy; + const half4 color = SAMPLE_TEXTURE2D(source, sampler_source, uv); + const half2 offset = Intensity * texelSize; + + half4 accumulatedColor = color; + half accumulatedWeight = 1.0; + for (int x = -1; x <= 1; x++) + { + for (int y = -1; y <= 1; y++) + { + const half2 sampleUV = uv + half2(x, y) * offset; + const half4 sampleColor = SAMPLE_TEXTURE2D(source, sampler_source, sampleUV); + + accumulatedColor += sampleColor; + accumulatedWeight += 1.0; + } + } + + half4 blurredColor = accumulatedColor / accumulatedWeight; + return blurredColor; + } + + half BlurHD_G(half bhqp, half x) + { + return exp(-(x * x) / (2.0 * bhqp * bhqp)); + } + half4 BlurHD(half2 uv, Texture2D source, SamplerState sampler_source, half BlurAmount, half xScale, half yScale) + { + int iterations = 16; + int halfIterations = iterations / 2; + half sigmaX = 0.1 + BlurAmount * 0.5; + half sigmaY = sigmaX; + half total = 0.0; + half4 ret = half4(0, 0, 0, 0); + for (int iy = 0; iy < iterations; ++iy) + { + half fy = BlurHD_G(sigmaY, half(iy) -half(halfIterations)); + half offsetY = half(iy - halfIterations) * 0.00390625 * xScale; + for (int ix = 0; ix < iterations; ++ix) + { + half fx = BlurHD_G(sigmaX, half(ix) - half(halfIterations)); + half offsetX = half(ix - halfIterations) * 0.00390625 * yScale; + total += fx * fy; + ret += SAMPLE_TEXTURE2D(source, sampler_source, uv + half2(offsetX, offsetY)) * fx * fy; + } + } + return ret / total; + } + //----------------------------------------------------------------------- + + + //------------------------------------------- + half RemapFloat(half inValue, half inMin, half inMax, half outMin, half outMax){ + return outMin + (inValue - inMin) * (outMax - outMin) / (inMax - inMin); + } + //------------------------------------------- + + //----------------------------------------------------------------------- + half rand(half2 seed, half offset) { + return (frac(sin(dot(seed, half2(12.9898, 78.233))) * 43758.5453) + offset) % 1.0; + } + + half rand2(half2 seed, half offset) { + return (frac(sin(dot(seed * floor(50 + (_Time.x % 1.0) * 12.), half2(127.1, 311.7))) * 43758.5453123) + offset) % 1.0; + } + + half rand2CustomTime(half2 seed, half offset, half customTime) { + return (frac(sin(dot(seed * floor(50 + (customTime % 1.0) * 12.), half2(127.1, 311.7))) * 43758.5453123) + offset) % 1.0; + } + //----------------------------------------------------------------------- + + + void Ext_ModifyVertex0 (inout VertexData v, inout ExtraV2F d) + { + //BILBOARD_ON + #if BILBOARD_ON + half3 camRight = mul((half3x3)unity_CameraToWorld, half3(1,0,0)); + half3 camUp = half3(0,1,0); + #if BILBOARDY_ON + camUp = mul((half3x3)unity_CameraToWorld, half3(0,1,0)); + #endif + half3 localPos = v.vertex.x * camRight + v.vertex.y * camUp; + v.vertex = half4(localPos, 1); + #endif + //----------------------------------------------------------- + + v.texcoord0.xy = TRANSFORM_TEX(v.texcoord0.xy, _MainTex); + half2 center = half2(0.5, 0.5); + #if ATLAS_ON + center = half2((_MaxXUV + _MinXUV) / 2.0, (_MaxYUV + _MinYUV) / 2.0); + #endif + + //POLARUV_ON + #if POLARUV_ON + v.texcoord0.xy = v.texcoord0.xy - center; + #endif + + //---------------------------------------- + + //ROTATEUV_ON + #if ROTATEUV_ON + half2 uvC = v.texcoord0.xy; + half cosAngle = cos(_RotateUvAmount); + half sinAngle = sin(_RotateUvAmount); + half2x2 rot = half2x2(cosAngle, -sinAngle, sinAngle, cosAngle); + uvC -= center; + v.texcoord0.xy = mul(rot, uvC); + v.texcoord0.xy += center; + #endif + //-------------------- + + #if RECTSIZE_ON + v.vertex.xyz += (v.vertex.xyz * (_RectSize - 1.0)); + #endif + + #if OUTTEX_ON + v.texcoord1.xy = TRANSFORM_TEX(v.texcoord0.xy, _OutlineTex); + #endif + + #if OUTDIST_ON + v.texcoord2.xy = TRANSFORM_TEX(v.texcoord0.xy, _OutlineDistortTex); + #endif + + #if DISTORT_ON + v.texcoord3.xy = TRANSFORM_TEX(v.texcoord0.xy, _DistortTex); + #endif + } + + void Ext_SurfaceFunction0 (inout Surface o, ShaderData d) + { + half randomSeed = _RandomSeed; + + float2 uvRect = d.texcoord0; + half2 center = half2(0.5, 0.5); + #if ATLAS_ON + center = half2((_MaxXUV + _MinXUV) / 2.0, (_MaxYUV + _MinYUV) / 2.0); + uvRect = half2((d.texcoord0.x - _MinXUV) / (_MaxXUV - _MinXUV), (d.texcoord0.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half2 centerTiled = half2(center.x * _MainTex_ST.x, center.y * _MainTex_ST.y); + + //CLIPPING_ON + #if CLIPPING_ON + half2 tiledUv = half2(d.texcoord0.x / _MainTex_ST.x, d.texcoord0.y / _MainTex_ST.y); + #if ATLAS_ON + tiledUv = half2((tiledUv.x - _MinXUV) / (_MaxXUV - _MinXUV), (tiledUv.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + clip((1 - _ClipUvUp) - tiledUv.y); + clip(tiledUv.y - _ClipUvDown); + clip((1 - _ClipUvRight) - tiledUv.x); + clip(tiledUv.x - _ClipUvLeft); + #endif + //---------------------------------- + + //RADIALCLIPPING_ON + #if RADIALCLIPPING_ON + half2 tiledUv2 = half2(d.texcoord0.x / _MainTex_ST.x, d.texcoord0.y / _MainTex_ST.y); + #if ATLAS_ON + tiledUv2 = half2((tiledUv2.x - _MinXUV) / (_MaxXUV - _MinXUV), (tiledUv2.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half startAngle = _RadialStartAngle - _RadialClip; + half endAngle = _RadialStartAngle + _RadialClip2; + half offset0 = clamp(0, 360, startAngle + 360); + half offset360 = clamp(0, 360, endAngle - 360); + half2 atan2Coord = half2(lerp(-1, 1, tiledUv2.x), lerp(-1, 1, tiledUv2.y)); + half atanAngle = atan2(atan2Coord.y, atan2Coord.x) * 57.3; // angle in degrees + if(atanAngle < 0) atanAngle = 360 + atanAngle; + if(atanAngle >= startAngle && atanAngle <= endAngle) discard; + if(atanAngle <= offset360) discard; + if(atanAngle >= offset0) discard; + #endif + + //----------------------------- + + //TEXTURESCROLL_ON && ATLAS_ON + #if TEXTURESCROLL_ON && ATLAS_ON + d.texcoord0.xy = half2(_MinXUV + ((_MaxXUV - _MinXUV) * (abs(((_Time.y + randomSeed) * _TextureScrollXSpeed) + uvRect.x) % 1)), + _MinYUV + ((_MaxYUV - _MinYUV) * (abs(((_Time.y + randomSeed) * _TextureScrollYSpeed) + uvRect.y) % 1))); + #endif + //---------------------------- + + //OFFSETUV_ON + #if OFFSETUV_ON + #if ATLAS_ON + d.texcoord0.xy = half2(_MinXUV + ((_MaxXUV - _MinXUV) * (abs((_OffsetUvX + uvRect.x) % 1))), + _MinYUV + ((_MaxYUV - _MinYUV) * (abs(_OffsetUvY + uvRect.y) % 1))); + #else + d.texcoord0.xy += half2(_OffsetUvX, _OffsetUvY); + #endif + #endif + + //---------------------- + + //POLARUV_ON + #if POLARUV_ON + d.texcoord0.xy = half2(atan2(d.texcoord0.y, d.texcoord0.x) / (2.0f * 3.141592653589f), length(d.texcoord0.xy)); + d.texcoord0.xy *= _MainTex_ST.xy; + #endif + + //-------------------------------------- + + //TWISTUV_ON + #if TWISTUV_ON + #if ATLAS_ON + _TwistUvPosX = ((_MaxXUV - _MinXUV) * _TwistUvPosX) + _MinXUV; + _TwistUvPosY = ((_MaxYUV - _MinYUV) * _TwistUvPosY) + _MinYUV; + #endif + half2 tempUv = d.texcoord0.xy - half2(_TwistUvPosX * _MainTex_ST.x, _TwistUvPosY * _MainTex_ST.y); + _TwistUvRadius *= (_MainTex_ST.x + _MainTex_ST.y) / 2; + half percent = (_TwistUvRadius - length(tempUv)) / _TwistUvRadius; + half theta = percent * percent * (2.0 * sin(_TwistUvAmount)) * 8.0; + half s = sin(theta); + half c = cos(theta); + half beta = max(sign(_TwistUvRadius - length(tempUv)), 0.0); + tempUv = half2(dot(tempUv, half2(c, -s)), dot(tempUv, half2(s, c))) * beta + tempUv * (1 - beta); + tempUv += half2(_TwistUvPosX * _MainTex_ST.x, _TwistUvPosY * _MainTex_ST.y); + d.texcoord0.xy = tempUv; + #endif + + //-------------------------------------------- + + //FISHEYE_ON + #if FISHEYE_ON + half bind = length(centerTiled); + half2 dF = d.texcoord0.xy - centerTiled; + half dFlen = length(dF); + half fishInt = (3.14159265359 / bind) * (_FishEyeUvAmount + 0.001); + d.texcoord0.xy = centerTiled + (dF / (max(0.0001, dFlen))) * tan(dFlen * fishInt) * bind / tan(bind * fishInt); + #endif + //--------------------------------------------- + + //PINCH_ON + #if PINCH_ON + half2 dP = d.texcoord0.xy - centerTiled; + half pinchInt = (3.141592 / length(centerTiled)) * (-_PinchUvAmount + 0.001); + d.texcoord0.xy = centerTiled + normalize(dP) * atan(length(dP) * -pinchInt * 10.0) * 0.5 / atan(-pinchInt * 5); + #endif + + //--------------------------------------------- + + //ZOOMUV_ON + #if ZOOMUV_ON + d.texcoord0.xy -= centerTiled; + d.texcoord0.xy = d.texcoord0.xy * _ZoomUvAmount; + d.texcoord0.xy += centerTiled; + #endif + + //----------------------------------------------- + + //DOODLE_ON + #if DOODLE_ON + half2 uvCopy = uvRect; + _HandDrawnSpeed = (floor((_Time.x + randomSeed) * 20 * _HandDrawnSpeed) / _HandDrawnSpeed) * _HandDrawnSpeed; + uvCopy.x = sin((uvCopy.x * _HandDrawnAmount + _HandDrawnSpeed) * 4); + uvCopy.y = cos((uvCopy.y * _HandDrawnAmount + _HandDrawnSpeed) * 4); + d.texcoord0.xy = lerp(d.texcoord0.xy, d.texcoord0.xy + uvCopy, 0.0005 * _HandDrawnAmount); + #endif + + //-------------------------- + + //SHAKEUV_ON + #if SHAKEUV_ON + half xShake = sin((_Time.x + randomSeed) * _ShakeUvSpeed * 50) * _ShakeUvX; + half yShake = cos((_Time.x + randomSeed) * _ShakeUvSpeed * 50) * _ShakeUvY; + d.texcoord0.xy += half2(xShake * 0.012, yShake * 0.01); + #endif + + //------------------------------------------- + + //RECTSIZE_ON + #if RECTSIZE_ON + d.texcoord0.xy = d.texcoord0.xy * (_RectSize).xx + (((-_RectSize * 0.5) + 0.5)).xx; + #endif + + //------------------------------------------- + + //DISTORT_ON + #if DISTORT_ON + #if ATLAS_ON + d.texcoord3.x = d.texcoord3.x * (1 / (_MaxXUV - _MinXUV)); + d.texcoord3.y = d.texcoord3.y * (1 / (_MaxYUV - _MinYUV)); + #endif + + d.texcoord3.x += ((_Time.x + _RandomSeed) * _DistortTexXSpeed) % 1; + d.texcoord3.y += ((_Time.x + _RandomSeed) * _DistortTexYSpeed) % 1; + half distortAmnt = (SAMPLE_TEXTURE2D(_DistortTex, sampler_DistortTex, d.texcoord3.xy).r - 0.5) * 0.2 * _DistortAmount; + d.texcoord0.x += distortAmnt; + d.texcoord0.y += distortAmnt; + #endif + //------------------------------------------------------- + + //WARP_ON + #if WARP_ON + half2 warpUv = half2(d.texcoord0.x / _MainTex_ST.x, d.texcoord0.y / _MainTex_ST.y); + #if ATLAS_ON + warpUv = half2((warpUv.x - _MinXUV) / (_MaxXUV - _MinXUV), (warpUv.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + const float tau = 6.283185307179586; + float xWarp = (_Time.y + randomSeed) * _WarpSpeed + warpUv.x * tau / _WarpScale; + float yWarp = (_Time.y + randomSeed) * _WarpSpeed + warpUv.y * tau / _WarpScale; + float2 warp = float2(sin(xWarp), sin(yWarp)) * _WarpStrength; + d.texcoord0.xy += warp; + #endif + + //------------------------------------------------------- + + //WAVEUV_ON + #if WAVEUV_ON + float2 uvWave = half2(_WaveX * _MainTex_ST.x, _WaveY * _MainTex_ST.y) - d.texcoord0.xy; + uvWave %= 1; + #if ATLAS_ON + uvWave = half2(_WaveX, _WaveY) - uvRect; + #endif + uvWave.x *= _ScreenParams.x / _ScreenParams.y; + float waveTime = _Time.y + randomSeed; + float angWave = (sqrt(dot(uvWave, uvWave)) * _WaveAmount) - ((waveTime * _WaveSpeed)); + d.texcoord0.xy = d.texcoord0.xy + uvWave * sin(angWave) * (_WaveStrength / 1000.0); + #endif + //---------------------------------------------------- + + //ROUNDWAVEUV_ON + #if ROUNDWAVEUV_ON + half xWave = ((0.5 * _MainTex_ST.x) - uvRect.x); + half yWave = ((0.5 * _MainTex_ST.y) - uvRect.y) * (_MainTex_TexelSize.w / _MainTex_TexelSize.z); + half ripple = -sqrt(xWave*xWave + yWave* yWave); + d.texcoord0.xy += (sin((ripple + (_Time.y + randomSeed) * (_RoundWaveSpeed/10.0)) / 0.015) * (_RoundWaveStrength/10.0)) % 1; + #endif + //---------------------------------------------------- + + + //WIND_ON + #if WIND_ON + half windOffset = sin((_Time.x + randomSeed) * _GrassSpeed * 10); + half2 windCenter = half2(0.5, 0.1); + #if ATLAS_ON + windCenter.x = ((_MaxXUV - _MinXUV) * windCenter.x) + _MinXUV; + windCenter.y = ((_MaxYUV - _MinYUV) * windCenter.y) + _MinYUV; + #endif + #if !MANUALWIND_ON + d.texcoord0.x = fmod(abs(lerp(d.texcoord0.x, d.texcoord0.x + (_GrassWind * 0.01 * windOffset), uvRect.y)), 1); + #else + d.texcoord0.x = fmod(abs(lerp(d.texcoord0.x, d.texcoord0.x + (_GrassWind * 0.01 * _GrassManualAnim), uvRect.y)), 1); + windOffset = _GrassManualAnim; + #endif + half2 delta = d.texcoord0.xy - windCenter; + half delta2 = dot(delta.xy, delta.xy); + half2 delta_offset = delta2 * windOffset; + d.texcoord0.xy = d.texcoord0.xy + half2(delta.y, -delta.x) * delta_offset * _GrassRadialBend; + #endif + + //-------------------------------------------------------- + + //TEXTURESCROLL_ON && !ATLAS_ON + #if TEXTURESCROLL_ON && !ATLAS_ON + d.texcoord0.x += ((_Time.y + randomSeed) * _TextureScrollXSpeed) % 1; + d.texcoord0.y += ((_Time.y + randomSeed) * _TextureScrollYSpeed) % 1; + #endif + //------------------------------ + + //PIXELATE_ON + #if PIXELATE_ON + half aspectRatio = _MainTex_TexelSize.x / _MainTex_TexelSize.y; + half2 pixelSize = float2(_PixelateSize, _PixelateSize * aspectRatio); + d.texcoord0.xy = floor(d.texcoord0.xy * pixelSize) / pixelSize; + #endif + //-------------- + + half4 col = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy); + half originalAlpha = col.a; + col *= d.vertexColor; + + //NORMAL MAP + #if NORMALMAP_ON + half4 normalSample = SAMPLE_TEXTURE2D(_NormalMap, sampler_NormalMap, d.texcoord0.xy); + half3 normalTS = UnpackNormal(normalSample); + normalTS.xy *= _NormalStrength; + o.Normal = normalTS; + #endif + + + //GLITCH_ON + #if GLITCH_ON + half2 uvGlitch = uvRect; + uvGlitch.y -= 0.5; + half lineNoise = pow(rand2(floor(uvGlitch * half2(24., 19.) * _GlitchSize) * 4.0, randomSeed), 3.0) * _GlitchAmount + * pow(rand2(floor(uvGlitch * half2(38., 14.) * _GlitchSize) * 4.0, randomSeed), 3.0); + col = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(lineNoise * 0.02 * rand2(half2(2.0, 1), randomSeed), 0)) * d.vertexColor; + #endif + //-------------------------------------- + + //CHROMABERR_ON + #if CHROMABERR_ON + half4 r = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(_ChromAberrAmount/10, 0)) * d.vertexColor; + half4 b = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(-_ChromAberrAmount/10, 0)) * d.vertexColor; + col = half4(r.r * r.a, col.g, b.b * b.a, max(max(r.a, b.a) * _ChromAberrAlpha, col.a)); + #endif + + //-------------------------------- + + //BLUR_ON + #if BLUR_ON + #if ATLAS_ON + #if !BLURISHD_ON + col = BlurHD(d.texcoord0.xy, _MainTex, sampler_MainTex, _BlurIntensity, (_MaxXUV - _MinXUV), (_MaxYUV - _MinYUV)) * d.vertexColor; + #else + col = Blur(d.texcoord0.xy, _MainTex, sampler_MainTex, _BlurIntensity * (_MaxXUV - _MinXUV)) * d.vertexColor; + #endif + #else + #if !BLURISHD_ON + col = BlurHD(d.texcoord0.xy, _MainTex, sampler_MainTex, _BlurIntensity, 1, 1) * d.vertexColor; + #else + col = Blur(d.texcoord0.xy, _MainTex, sampler_MainTex, _BlurIntensity) * d.vertexColor; + #endif + #endif + #endif + + //-------------------- + + //MOTIONBLUR_ON + #if MOTIONBLUR_ON + _MotionBlurAngle = _MotionBlurAngle * 3.1415926; + #define rot(n) mul(n, half2x2(cos(_MotionBlurAngle), -sin(_MotionBlurAngle), sin(_MotionBlurAngle), cos(_MotionBlurAngle))) + _MotionBlurDist = _MotionBlurDist * 0.005; + #if ATLAS_ON + _MotionBlurDist *= (_MaxXUV - _MinXUV); + #endif + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(-_MotionBlurDist, -_MotionBlurDist))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(-_MotionBlurDist * 2, -_MotionBlurDist * 2))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(-_MotionBlurDist * 3, -_MotionBlurDist * 3))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(-_MotionBlurDist * 4, -_MotionBlurDist * 4))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(_MotionBlurDist, _MotionBlurDist))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(_MotionBlurDist * 2, _MotionBlurDist * 2))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(_MotionBlurDist * 3, _MotionBlurDist * 3))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(_MotionBlurDist * 4, _MotionBlurDist * 4))); + col.rgb = col.rgb / 9; + #endif + //------------------------------------ + + //NEGATIVE_ON + #if NEGATIVE_ON + col.rgb = lerp(col.rgb, 1 - col.rgb, _NegativeAmount); + #endif + + //-------------- + half luminance = 0; + + //GREYSCALE_ON && !GREYSCALEOUTLINE_ON + #if GREYSCALE_ON && !GREYSCALEOUTLINE_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + luminance = saturate(luminance + _GreyscaleLuminosity); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _GreyscaleTintColor, _GreyscaleBlend); + #endif + //------------------------------------ + + //GHOST_ON + #if GHOST_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + half4 ghostResult; + ghostResult.a = saturate(luminance - _GhostTransparency) * col.a; + ghostResult.rgb = col.rgb * (luminance + _GhostColorBoost); + col = lerp(col, ghostResult, _GhostBlend); + #endif + //------------------------------------ + + //INNEROUTLINE_ON + #if INNEROUTLINE_ON + half3 innerT = abs(GetPixel(0, _InnerOutlineThickness, d.texcoord0.xy, _MainTex, sampler_MainTex) - GetPixel(0, -_InnerOutlineThickness, d.texcoord0.xy, _MainTex, sampler_MainTex)); + innerT += abs(GetPixel(_InnerOutlineThickness, 0, d.texcoord0.xy, _MainTex, sampler_MainTex) - GetPixel(-_InnerOutlineThickness, 0, d.texcoord0.xy, _MainTex, sampler_MainTex)); + #if !ONLYINNEROUTLINE_ON + innerT = (innerT / 2.0) * col.a * _InnerOutlineAlpha; + col.rgb += length(innerT) * _InnerOutlineColor.rgb * _InnerOutlineGlow; + #else + innerT *= col.a * _InnerOutlineAlpha; + col.rgb = length(innerT) * _InnerOutlineColor.rgb * _InnerOutlineGlow; + col.a = step(0.3, col.r+col.g+col.b); + #endif + #endif + //------------------------------------------------------- + + //HITEFFECT_ON + #if HITEFFECT_ON + col.rgb = lerp(col.rgb, _HitEffectColor.rgb * _HitEffectGlow, _HitEffectBlend); + #endif + //-------------------- + + //GRADIENT_ON + #if GRADIENT_ON + half2 tiledUvGrad = half2(uvRect.x / _MainTex_ST.x, uvRect.y / _MainTex_ST.y); + #if GRADIENT2COL_ON + _GradTopRightCol = _GradTopLeftCol; + _GradBotRightCol = _GradBotLeftCol; + #endif + #if RADIALGRADIENT_ON + half radialDist = 1 - length(tiledUvGrad - half2(0.5, 0.5)); + radialDist *= (_MainTex_TexelSize.w / _MainTex_TexelSize.z); + radialDist = saturate(_GradBoostX * radialDist); + half4 gradientResult = lerp(_GradTopLeftCol, _GradBotLeftCol, radialDist); + #else + half gradXLerpFactor = saturate(pow(tiledUvGrad.x, _GradBoostX)); + half4 gradientResult = lerp(lerp(_GradBotLeftCol, _GradBotRightCol, gradXLerpFactor), + lerp(_GradTopLeftCol, _GradTopRightCol, gradXLerpFactor), saturate(pow(tiledUvGrad.y, _GradBoostY))); + #endif + gradientResult = lerp(col, gradientResult, _GradBlend); + col.rgb = gradientResult.rgb * col.a; + col.a *= gradientResult.a; + #endif + //-------------------------------------------------------------------- + + //CONTRAST_ON + #if CONTRAST_ON + col.rgb = (col.rgb - float3(0.5, 0.5, 0.5)) * _Contrast + float3(0.5, 0.5, 0.5); + col.rgb += _Brightness; + #endif + + //------------------------------------------------------------------- + + //COLORSWAP_ON + #if COLORSWAP_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + half4 swapMask = SAMPLE_TEXTURE2D(_ColorSwapTex, sampler_ColorSwapTex, d.texcoord0.xy); + swapMask.rgb *= swapMask.a; + half3 redSwap = _ColorSwapRed * swapMask.r * saturate(luminance + _ColorSwapRedLuminosity); + half3 greenSwap = _ColorSwapGreen * swapMask.g * saturate(luminance + _ColorSwapGreenLuminosity); + half3 blueSwap = _ColorSwapBlue * swapMask.b * saturate(luminance + _ColorSwapBlueLuminosity); + swapMask.rgb = col.rgb * saturate(1 - swapMask.r - swapMask.g - swapMask.b); + col.rgb = lerp(col.rgb, swapMask.rgb + redSwap + greenSwap + blueSwap, _ColorSwapBlend); + #endif + //-------------------------------------------------------------------- + + //COLORRAMP_ON && !COLORRAMPOUTLINE_ON + #if COLORRAMP_ON && !COLORRAMPOUTLINE_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + luminance = saturate(luminance + _ColorRampLuminosity); + #if GRADIENTCOLORRAMP_ON + col.rgb = lerp(col.rgb, SAMPLE_TEXTURE2D(_ColorRampTexGradient, sampler_ColorRampTexGradient, half2(luminance, 0)).rgb, _ColorRampBlend); + #else + col.rgb = lerp(col.rgb, SAMPLE_TEXTURE2D(_ColorRampTex, sampler_ColorRampTex, half2(luminance, 0)).rgb, _ColorRampBlend); + #endif + #endif + //-------------------------------------------------------------------- + + //CHANGECOLOR_ON + #if CHANGECOLOR_ON + float3 currChangeColor = saturate(col.rgb); + luminance = 0.3 * currChangeColor.r + 0.59 * currChangeColor.g + 0.11 * currChangeColor.b; + luminance = saturate(luminance + _ColorChangeLuminosity); + half3 dif = abs(currChangeColor - _ColorChangeTarget.rgb); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _ColorChangeNewCol.rgb, + max(sign(1 - saturate(dif.x + dif.y + dif.z) - _ColorChangeTolerance), 0.0)); + #if CHANGECOLOR2_ON + dif = abs(currChangeColor - _ColorChangeTarget2.rgb); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _ColorChangeNewCol2.rgb, + max(sign(1 - saturate(dif.x + dif.y + dif.z) - _ColorChangeTolerance2), 0.0)); + #endif + #if CHANGECOLOR3_ON + dif = abs(currChangeColor - _ColorChangeTarget3.rgb); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _ColorChangeNewCol3.rgb, + max(sign(1 - saturate(dif.x + dif.y + dif.z) - _ColorChangeTolerance3), 0.0)); + #endif + #endif + //------------------------------------------------------- + + //POSTERIZE_ON && !POSTERIZEOUTLINE_ON + #if POSTERIZE_ON && !POSTERIZEOUTLINE_ON + col.rgb = pow(col.rgb, _PosterizeGamma) * _PosterizeNumColors; + col.rgb = floor(col.rgb) / _PosterizeNumColors; + col.rgb = pow(col.rgb, 1.0 / _PosterizeGamma); + #endif + //------------------------------------ + + //HSV_ON + #if HSV_ON + half3 resultHsv = half3(col.rgb); + half cosHsv = _HsvBright * _HsvSaturation * cos(_HsvShift * 3.14159265 / 180); + half sinHsv = _HsvBright * _HsvSaturation * sin(_HsvShift * 3.14159265 / 180); + resultHsv.x = (.299 * _HsvBright + .701 * cosHsv + .168 * sinHsv) * col.x + + (.587 * _HsvBright - .587 * cosHsv + .330 * sinHsv) * col.y + + (.114 * _HsvBright - .114 * cosHsv - .497 * sinHsv) * col.z; + resultHsv.y = (.299 * _HsvBright - .299 * cosHsv - .328 * sinHsv) *col.x + + (.587 * _HsvBright + .413 * cosHsv + .035 * sinHsv) * col.y + + (.114 * _HsvBright - .114 * cosHsv + .292 * sinHsv) * col.z; + resultHsv.z = (.299 * _HsvBright - .3 * cosHsv + 1.25 * sinHsv) * col.x + + (.587 * _HsvBright - .588 * cosHsv - 1.05 * sinHsv) * col.y + + (.114 * _HsvBright + .886 * cosHsv - .203 * sinHsv) * col.z; + col.rgb = resultHsv; + #endif + //------------------------------------------------------- + + //OVERLAY_ON + #if OVERLAY_ON + half2 overlayUvs = d.texcoord0.xy; + overlayUvs.x += ((_Time.y + randomSeed) * _OverlayTextureScrollXSpeed) % 1; + overlayUvs.y += ((_Time.y + randomSeed) * _OverlayTextureScrollYSpeed) % 1; + half4 overlayCol = SAMPLE_TEXTURE2D(_OverlayTex, sampler_OverlayTex, TRANSFORM_TEX(overlayUvs, _OverlayTex)); + overlayCol.rgb *= _OverlayColor.rgb * _OverlayGlow; + #if !OVERLAYMULT_ON + overlayCol.rgb *= overlayCol.a * _OverlayColor.rgb * _OverlayColor.a * _OverlayBlend; + col.rgb += overlayCol.rgb; + #else + overlayCol.a *= _OverlayColor.a; + col = lerp(col, col * overlayCol, _OverlayBlend); + #endif + #endif + + //--------------------------------- + + //OUTBASE_ON + #if OUTBASE_ON + #if OUTBASEPIXELPERF_ON + half2 destUv = half2(_OutlinePixelWidth * _MainTex_TexelSize.x, _OutlinePixelWidth * _MainTex_TexelSize.y); + #else + half2 destUv = half2(_OutlineWidth * _MainTex_TexelSize.x * 200, _OutlineWidth * _MainTex_TexelSize.y * 200); + #endif + + #if OUTDIST_ON + d.texcoord3.x += ((_Time.x + _RandomSeed) * _OutlineDistortTexXSpeed) % 1; + d.texcoord3.y += ((_Time.x + _RandomSeed) * _OutlineDistortTexYSpeed) % 1; + #if ATLAS_ON + d.texcoord3 = half2((d.texcoord3.x - _MinXUV) / (_MaxXUV - _MinXUV), (d.texcoord3.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half outDistortAmnt = (SAMPLE_TEXTURE2D(_OutlineDistortTex, sampler_OutlineDistortTex, d.texcoord3).r - 0.5) * 0.2 * _OutlineDistortAmount; + destUv.x += outDistortAmnt; + destUv.y += outDistortAmnt; + #endif + + half spriteLeft = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(destUv.x, 0)).a; + half spriteRight = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy - half2(destUv.x, 0)).a; + half spriteBottom = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(0, destUv.y)).a; + half spriteTop = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy - half2(0, destUv.y)).a; + half result = spriteLeft + spriteRight + spriteBottom + spriteTop; + + #if OUTBASE8DIR_ON + half spriteTopLeft = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(destUv.x, destUv.y)).a; + half spriteTopRight = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(-destUv.x, destUv.y)).a; + half spriteBotLeft = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(destUv.x, -destUv.y)).a; + half spriteBotRight = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(-destUv.x, -destUv.y)).a; + result = result + spriteTopLeft + spriteTopRight + spriteBotLeft + spriteBotRight; + #endif + + result = step(0.05, saturate(result)); + + #if OUTTEX_ON + d.texcoord1.x += ((_Time.x + _RandomSeed) * _OutlineTexXSpeed) % 1; + d.texcoord1.y += ((_Time.x + _RandomSeed) * _OutlineTexYSpeed) % 1; + #if ATLAS_ON + d.texcoord1 = half2((d.texcoord1.x - _MinXUV) / (_MaxXUV - _MinXUV), (d.texcoord1.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half4 tempOutColor = SAMPLE_TEXTURE2D(_OutlineTex, sampler_OutlineTex, d.texcoord1); + tempOutColor *= _OutlineColor; + _OutlineColor = tempOutColor; + #endif + + result *= (1 - originalAlpha) * _OutlineAlpha; + + half4 outline = _OutlineColor * d.vertexColor.a; + outline.rgb *= _OutlineGlow; + outline.a = result; + #if ONLYOUTLINE_ON + col = outline; + #else + col = lerp(col, outline, result); + #endif + #endif + //------------------------------------------------------- + + //FADE_ON + #if FADE_ON + half2 tiledUvFade1 = TRANSFORM_TEX(d.texcoord0, _FadeTex); + half2 tiledUvFade2 = TRANSFORM_TEX(d.texcoord0, _FadeBurnTex); + #if ATLAS_ON + tiledUvFade1 = half2((tiledUvFade1.x - _MinXUV) / (_MaxXUV - _MinXUV), (tiledUvFade1.y - _MinYUV) / (_MaxYUV - _MinYUV)); + tiledUvFade2 = half2((tiledUvFade2.x - _MinXUV) / (_MaxXUV - _MinXUV), (tiledUvFade2.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half fadeTemp = SAMPLE_TEXTURE2D(_FadeTex, sampler_FadeTex, tiledUvFade1).r; + half fade = smoothstep(_FadeAmount, _FadeAmount + _FadeBurnTransition, fadeTemp); + half fadeBurn = saturate(smoothstep(_FadeAmount - _FadeBurnWidth, _FadeAmount - _FadeBurnWidth + 0.1, fadeTemp) * _FadeAmount); + col.a *= fade; + _FadeBurnColor.rgb *= _FadeBurnGlow; + col += fadeBurn * SAMPLE_TEXTURE2D(_FadeBurnTex, sampler_FadeBurnTex, tiledUvFade2) * _FadeBurnColor * originalAlpha * (1 - col.a); + #endif + //------------------------------------------------------- + + //SHADOW_ON + #if SHADOW_ON + half shadowA = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(_ShadowX, _ShadowY)).a; + half preMultShadowMask = 1 - (saturate(shadowA - col.a) * (1 - col.a)); + col.rgb *= 1 - ((shadowA - col.a) * (1 - col.a)); + col.rgb += (_ShadowColor * shadowA) * (1 - col.a); + col.a = max(shadowA * _ShadowAlpha * d.vertexColor.a, col.a); + #endif + + //------------------------------------------------------- + + //GLOW_ON + #if GLOW_ON + half4 emission; + #if GLOWTEX_ON + emission = SAMPLE_TEXTURE2D(_GlowTex, sampler_GlowTex, d.texcoord0); + #else + emission = col; + #endif + + col.rgb *= _GlowGlobal; + emission.rgb *= emission.a * col.a * _Glow * _GlowColor; + col.rgb += emission.rgb; + #endif + //------------------------------------------------------- + + //COLORRAMP_ON && COLORRAMPOUTLINE_ON + #if COLORRAMP_ON && COLORRAMPOUTLINE_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + luminance = saturate(luminance + _ColorRampLuminosity); + #if GRADIENTCOLORRAMP_ON + col.rgb = lerp(col.rgb, SAMPLE_TEXTURE2D(_ColorRampTexGradient, sampler_ColorRampTexGradient, half2(luminance, 0)).rgb, _ColorRampBlend); + #else + col.rgb = lerp(col.rgb, SAMPLE_TEXTURE2D(_ColorRampTex, sampler_ColorRampTex, half2(luminance, 0)).rgb, _ColorRampBlend); + #endif + #endif + //--------------- + + //GREYSCALE_ON && GREYSCALEOUTLINE_ON + #if GREYSCALE_ON && GREYSCALEOUTLINE_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + luminance = saturate(luminance + _GreyscaleLuminosity); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _GreyscaleTintColor, _GreyscaleBlend); + #endif + + //----------------------------------- + + //POSTERIZE_ON && POSTERIZEOUTLINE_ON + #if POSTERIZE_ON && POSTERIZEOUTLINE_ON + col.rgb = pow(col.rgb, _PosterizeGamma) * _PosterizeNumColors; + col.rgb = floor(col.rgb) / _PosterizeNumColors; + col.rgb = pow(col.rgb, 1.0 / _PosterizeGamma); + #endif + + //----------------------------------- + + //SHINE_ON + #if SHINE_ON + half2 uvShine = uvRect; + half cosAngle = cos(_ShineRotate); + half sinAngle = sin(_ShineRotate); + half2x2 rot = half2x2(cosAngle, -sinAngle, sinAngle, cosAngle); + uvShine -= half2(0.5, 0.5); + uvShine = mul(rot, uvShine); + uvShine += half2(0.5, 0.5); + half shineMask = SAMPLE_TEXTURE2D(_ShineMask, sampler_ShineMask, d.texcoord0.xy).a; + half currentDistanceProjection = (uvShine.x + uvShine.y) / 2; + half whitePower = 1 - (abs(currentDistanceProjection - _ShineLocation) / _ShineWidth); + col.rgb += col.a * whitePower * _ShineGlow * max(sign(currentDistanceProjection - (_ShineLocation - _ShineWidth)), 0.0) + * max(sign((_ShineLocation + _ShineWidth) - currentDistanceProjection), 0.0) * _ShineColor * shineMask; + #endif + + //----------------------------------- + + //HOLOGRAM_ON + #if HOLOGRAM_ON + half totalHologram = _HologramStripesAmount + _HologramUnmodAmount; + half hologramYCoord = ((uvRect.y + (((_Time.x + randomSeed) % 1) * _HologramStripesSpeed)) % totalHologram) / totalHologram; + hologramYCoord = abs(hologramYCoord); + half alpha = RemapFloat(saturate(hologramYCoord - (_HologramUnmodAmount/totalHologram)), 0.0, 1.0, _HologramMinAlpha, saturate(_HologramMaxAlpha)); + half hologramMask = max(sign((_HologramUnmodAmount/totalHologram) - hologramYCoord), 0.0); + half4 hologramResult = col; + hologramResult.a *= lerp(alpha, 1, hologramMask); + hologramResult.rgb *= max(1, _HologramMaxAlpha * max(sign(hologramYCoord - (_HologramUnmodAmount/totalHologram)), 0.0)); + hologramMask = 1 - step(0.01,hologramMask); + hologramResult.rgb += hologramMask * _HologramStripeColor * col.a; + col = lerp(col, hologramResult, _HologramBlend); + #endif + + //----------------------------------- + + //FLICKER_ON + #if FLICKER_ON + col.a *= saturate(col.a * step(frac(0.05 + (_Time.w + randomSeed) * _FlickerFreq), 1 - _FlickerPercent) + _FlickerAlpha); + #endif + //----------------------------------- + + //ALPHACUTOFF_ON + + //ALPHAROUND_ON + + //ALPHAOUTLINE_ON + #if ALPHAOUTLINE_ON + half alphaOutlineRes = pow(1 - col.a, max(_AlphaOutlinePower, 0.0001)) * step(_AlphaOutlineMinAlpha, col.a) * _AlphaOutlineBlend; + col.rgb = lerp(col.rgb, _AlphaOutlineColor.rgb * _AlphaOutlineGlow, alphaOutlineRes); + col.a = lerp(col.a, 1, alphaOutlineRes > 1); + #endif + //------------------------------------------------------- + + //FOG_ON + + //------------------ + + col *= _Color; + o.Albedo = col; + col.a *= _Alpha; + clip(col.a - _AlphaCutoffValue - 0.01); + o.Alpha = _Color.a; + } + + + + + + void ChainSurfaceFunction(inout Surface l, inout ShaderData d) + { + Ext_SurfaceFunction0(l, d); + // Ext_SurfaceFunction1(l, d); + // Ext_SurfaceFunction2(l, d); + // Ext_SurfaceFunction3(l, d); + // Ext_SurfaceFunction4(l, d); + // Ext_SurfaceFunction5(l, d); + // Ext_SurfaceFunction6(l, d); + // Ext_SurfaceFunction7(l, d); + // Ext_SurfaceFunction8(l, d); + // Ext_SurfaceFunction9(l, d); + // Ext_SurfaceFunction10(l, d); + // Ext_SurfaceFunction11(l, d); + // Ext_SurfaceFunction12(l, d); + // Ext_SurfaceFunction13(l, d); + // Ext_SurfaceFunction14(l, d); + // Ext_SurfaceFunction15(l, d); + // Ext_SurfaceFunction16(l, d); + // Ext_SurfaceFunction17(l, d); + // Ext_SurfaceFunction18(l, d); + // Ext_SurfaceFunction19(l, d); + // Ext_SurfaceFunction20(l, d); + // Ext_SurfaceFunction21(l, d); + // Ext_SurfaceFunction22(l, d); + // Ext_SurfaceFunction23(l, d); + // Ext_SurfaceFunction24(l, d); + // Ext_SurfaceFunction25(l, d); + // Ext_SurfaceFunction26(l, d); + // Ext_SurfaceFunction27(l, d); + // Ext_SurfaceFunction28(l, d); + // Ext_SurfaceFunction29(l, d); + } + +#if !_DECALSHADER + + void ChainModifyVertex(inout VertexData v, inout VertexToPixel v2p, float4 time) + { + ExtraV2F d; + + ZERO_INITIALIZE(ExtraV2F, d); + ZERO_INITIALIZE(Blackboard, d.blackboard); + // due to motion vectors in HDRP, we need to use the last + // time in certain spots. So if you are going to use _Time to adjust vertices, + // you need to use this time or motion vectors will break. + d.time = time; + + Ext_ModifyVertex0(v, d); + // Ext_ModifyVertex1(v, d); + // Ext_ModifyVertex2(v, d); + // Ext_ModifyVertex3(v, d); + // Ext_ModifyVertex4(v, d); + // Ext_ModifyVertex5(v, d); + // Ext_ModifyVertex6(v, d); + // Ext_ModifyVertex7(v, d); + // Ext_ModifyVertex8(v, d); + // Ext_ModifyVertex9(v, d); + // Ext_ModifyVertex10(v, d); + // Ext_ModifyVertex11(v, d); + // Ext_ModifyVertex12(v, d); + // Ext_ModifyVertex13(v, d); + // Ext_ModifyVertex14(v, d); + // Ext_ModifyVertex15(v, d); + // Ext_ModifyVertex16(v, d); + // Ext_ModifyVertex17(v, d); + // Ext_ModifyVertex18(v, d); + // Ext_ModifyVertex19(v, d); + // Ext_ModifyVertex20(v, d); + // Ext_ModifyVertex21(v, d); + // Ext_ModifyVertex22(v, d); + // Ext_ModifyVertex23(v, d); + // Ext_ModifyVertex24(v, d); + // Ext_ModifyVertex25(v, d); + // Ext_ModifyVertex26(v, d); + // Ext_ModifyVertex27(v, d); + // Ext_ModifyVertex28(v, d); + // Ext_ModifyVertex29(v, d); + + + // #if %EXTRAV2F0REQUIREKEY% + // v2p.extraV2F0 = d.extraV2F0; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // v2p.extraV2F1 = d.extraV2F1; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // v2p.extraV2F2 = d.extraV2F2; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // v2p.extraV2F3 = d.extraV2F3; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // v2p.extraV2F4 = d.extraV2F4; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // v2p.extraV2F5 = d.extraV2F5; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // v2p.extraV2F6 = d.extraV2F6; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // v2p.extraV2F7 = d.extraV2F7; + // #endif + } + + void ChainModifyTessellatedVertex(inout VertexData v, inout VertexToPixel v2p) + { + ExtraV2F d; + ZERO_INITIALIZE(ExtraV2F, d); + ZERO_INITIALIZE(Blackboard, d.blackboard); + + // #if %EXTRAV2F0REQUIREKEY% + // d.extraV2F0 = v2p.extraV2F0; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // d.extraV2F1 = v2p.extraV2F1; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // d.extraV2F2 = v2p.extraV2F2; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // d.extraV2F3 = v2p.extraV2F3; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // d.extraV2F4 = v2p.extraV2F4; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // d.extraV2F5 = v2p.extraV2F5; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // d.extraV2F6 = v2p.extraV2F6; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // d.extraV2F7 = v2p.extraV2F7; + // #endif + + + // Ext_ModifyTessellatedVertex0(v, d); + // Ext_ModifyTessellatedVertex1(v, d); + // Ext_ModifyTessellatedVertex2(v, d); + // Ext_ModifyTessellatedVertex3(v, d); + // Ext_ModifyTessellatedVertex4(v, d); + // Ext_ModifyTessellatedVertex5(v, d); + // Ext_ModifyTessellatedVertex6(v, d); + // Ext_ModifyTessellatedVertex7(v, d); + // Ext_ModifyTessellatedVertex8(v, d); + // Ext_ModifyTessellatedVertex9(v, d); + // Ext_ModifyTessellatedVertex10(v, d); + // Ext_ModifyTessellatedVertex11(v, d); + // Ext_ModifyTessellatedVertex12(v, d); + // Ext_ModifyTessellatedVertex13(v, d); + // Ext_ModifyTessellatedVertex14(v, d); + // Ext_ModifyTessellatedVertex15(v, d); + // Ext_ModifyTessellatedVertex16(v, d); + // Ext_ModifyTessellatedVertex17(v, d); + // Ext_ModifyTessellatedVertex18(v, d); + // Ext_ModifyTessellatedVertex19(v, d); + // Ext_ModifyTessellatedVertex20(v, d); + // Ext_ModifyTessellatedVertex21(v, d); + // Ext_ModifyTessellatedVertex22(v, d); + // Ext_ModifyTessellatedVertex23(v, d); + // Ext_ModifyTessellatedVertex24(v, d); + // Ext_ModifyTessellatedVertex25(v, d); + // Ext_ModifyTessellatedVertex26(v, d); + // Ext_ModifyTessellatedVertex27(v, d); + // Ext_ModifyTessellatedVertex28(v, d); + // Ext_ModifyTessellatedVertex29(v, d); + + // #if %EXTRAV2F0REQUIREKEY% + // v2p.extraV2F0 = d.extraV2F0; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // v2p.extraV2F1 = d.extraV2F1; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // v2p.extraV2F2 = d.extraV2F2; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // v2p.extraV2F3 = d.extraV2F3; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // v2p.extraV2F4 = d.extraV2F4; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // v2p.extraV2F5 = d.extraV2F5; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // v2p.extraV2F6 = d.extraV2F6; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // v2p.extraV2F7 = d.extraV2F7; + // #endif + } + + void ChainFinalColorForward(inout Surface l, inout ShaderData d, inout half4 color) + { + // Ext_FinalColorForward0(l, d, color); + // Ext_FinalColorForward1(l, d, color); + // Ext_FinalColorForward2(l, d, color); + // Ext_FinalColorForward3(l, d, color); + // Ext_FinalColorForward4(l, d, color); + // Ext_FinalColorForward5(l, d, color); + // Ext_FinalColorForward6(l, d, color); + // Ext_FinalColorForward7(l, d, color); + // Ext_FinalColorForward8(l, d, color); + // Ext_FinalColorForward9(l, d, color); + // Ext_FinalColorForward10(l, d, color); + // Ext_FinalColorForward11(l, d, color); + // Ext_FinalColorForward12(l, d, color); + // Ext_FinalColorForward13(l, d, color); + // Ext_FinalColorForward14(l, d, color); + // Ext_FinalColorForward15(l, d, color); + // Ext_FinalColorForward16(l, d, color); + // Ext_FinalColorForward17(l, d, color); + // Ext_FinalColorForward18(l, d, color); + // Ext_FinalColorForward19(l, d, color); + // Ext_FinalColorForward20(l, d, color); + // Ext_FinalColorForward21(l, d, color); + // Ext_FinalColorForward22(l, d, color); + // Ext_FinalColorForward23(l, d, color); + // Ext_FinalColorForward24(l, d, color); + // Ext_FinalColorForward25(l, d, color); + // Ext_FinalColorForward26(l, d, color); + // Ext_FinalColorForward27(l, d, color); + // Ext_FinalColorForward28(l, d, color); + // Ext_FinalColorForward29(l, d, color); + } + + void ChainFinalGBufferStandard(inout Surface s, inout ShaderData d, inout half4 GBuffer0, inout half4 GBuffer1, inout half4 GBuffer2, inout half4 outEmission, inout half4 outShadowMask) + { + // Ext_FinalGBufferStandard0(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard1(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard2(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard3(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard4(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard5(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard6(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard7(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard8(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard9(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard10(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard11(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard12(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard13(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard14(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard15(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard16(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard17(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard18(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard19(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard20(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard21(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard22(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard23(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard24(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard25(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard26(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard27(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard28(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard29(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + } +#endif + + + + + +#if _DECALSHADER + + ShaderData CreateShaderData(SurfaceDescriptionInputs IN) + { + ShaderData d = (ShaderData)0; + d.TBNMatrix = float3x3(IN.WorldSpaceTangent, IN.WorldSpaceBiTangent, IN.WorldSpaceNormal); + d.worldSpaceNormal = IN.WorldSpaceNormal; + d.worldSpaceTangent = IN.WorldSpaceTangent; + + d.worldSpacePosition = IN.WorldSpacePosition; + d.texcoord0 = IN.uv0.xyxy; + d.screenPos = IN.ScreenPosition; + + d.worldSpaceViewDir = normalize(_WorldSpaceCameraPos - d.worldSpacePosition); + + d.tangentSpaceViewDir = mul(d.TBNMatrix, d.worldSpaceViewDir); + + // these rarely get used, so we back transform them. Usually will be stripped. + #if _HDRP + // d.localSpacePosition = mul(GetWorldToObjectMatrix(), float4(GetCameraRelativePositionWS(d.worldSpacePosition), 1)).xyz; + #else + // d.localSpacePosition = mul(GetWorldToObjectMatrix(), float4(d.worldSpacePosition, 1)).xyz; + #endif + // d.localSpaceNormal = normalize(mul((float3x3)GetWorldToObjectMatrix(), d.worldSpaceNormal)); + // d.localSpaceTangent = normalize(mul((float3x3)GetWorldToObjectMatrix(), d.worldSpaceTangent.xyz)); + + // #if %SCREENPOSREQUIREKEY% + // d.screenUV = (IN.ScreenPosition.xy / max(0.01, IN.ScreenPosition.w)); + // #endif + + return d; + } +#else + + ShaderData CreateShaderData(VertexToPixel i + #if NEED_FACING + , bool facing + #endif + ) + { + ShaderData d = (ShaderData)0; + d.clipPos = i.pos; + d.worldSpacePosition = i.worldPos; + + d.worldSpaceNormal = normalize(i.worldNormal); + d.worldSpaceTangent.xyz = normalize(i.worldTangent.xyz); + + d.tangentSign = i.worldTangent.w * unity_WorldTransformParams.w; + float3 bitangent = cross(d.worldSpaceTangent.xyz, d.worldSpaceNormal) * d.tangentSign; + + d.TBNMatrix = float3x3(d.worldSpaceTangent, -bitangent, d.worldSpaceNormal); + d.worldSpaceViewDir = normalize(_WorldSpaceCameraPos - i.worldPos); + + d.tangentSpaceViewDir = mul(d.TBNMatrix, d.worldSpaceViewDir); + d.texcoord0 = i.texcoord0; + d.texcoord1 = i.texcoord1; + d.texcoord2 = i.texcoord2; + + // #if %TEXCOORD3REQUIREKEY% + d.texcoord3 = i.texcoord3; + // #endif + + // d.isFrontFace = facing; + // #if %VERTEXCOLORREQUIREKEY% + d.vertexColor = i.vertexColor; + // #endif + + // these rarely get used, so we back transform them. Usually will be stripped. + #if _HDRP + // d.localSpacePosition = mul(GetWorldToObjectMatrix(), float4(GetCameraRelativePositionWS(i.worldPos), 1)).xyz; + #else + // d.localSpacePosition = mul(GetWorldToObjectMatrix(), float4(i.worldPos, 1)).xyz; + #endif + // d.localSpaceNormal = normalize(mul((float3x3)GetWorldToObjectMatrix(), i.worldNormal)); + // d.localSpaceTangent = normalize(mul((float3x3)GetWorldToObjectMatrix(), i.worldTangent.xyz)); + + // #if %SCREENPOSREQUIREKEY% + // d.screenPos = i.screenPos; + // d.screenUV = (i.screenPos.xy / i.screenPos.w); + // #endif + + + // #if %EXTRAV2F0REQUIREKEY% + // d.extraV2F0 = i.extraV2F0; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // d.extraV2F1 = i.extraV2F1; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // d.extraV2F2 = i.extraV2F2; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // d.extraV2F3 = i.extraV2F3; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // d.extraV2F4 = i.extraV2F4; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // d.extraV2F5 = i.extraV2F5; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // d.extraV2F6 = i.extraV2F6; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // d.extraV2F7 = i.extraV2F7; + // #endif + + return d; + } + +#endif + + + +#if (SHADERPASS == SHADERPASS_LIGHT_TRANSPORT) + + // This was not in constant buffer in original unity, so keep outiside. But should be in as ShaderRenderPass frequency + float unity_OneOverOutputBoost; + float unity_MaxOutputValue; + + CBUFFER_START(UnityMetaPass) + // x = use uv1 as raster position + // y = use uv2 as raster position + bool4 unity_MetaVertexControl; + + // x = return albedo + // y = return normal + bool4 unity_MetaFragmentControl; + CBUFFER_END + + VertexToPixel Vert(VertexData inputMesh) + { + VertexToPixel output; + ZERO_INITIALIZE(VertexToPixel, output); + UNITY_SETUP_INSTANCE_ID(inputMesh); + UNITY_TRANSFER_INSTANCE_ID(inputMesh, output); + UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(output); + + // Output UV coordinate in vertex shader + float2 uv = float2(0.0, 0.0); + + if (unity_MetaVertexControl.x) + { + uv = inputMesh.texcoord1.xy * unity_LightmapST.xy + unity_LightmapST.zw; + } + else if (unity_MetaVertexControl.y) + { + uv = inputMesh.texcoord2.xy * unity_DynamicLightmapST.xy + unity_DynamicLightmapST.zw; + } + + // OpenGL right now needs to actually use the incoming vertex position + // so we create a fake dependency on it here that haven't any impact. + output.pos = float4(uv * 2.0 - 1.0, inputMesh.vertex.z > 0 ? 1.0e-4 : 0.0, 1.0); + + output.worldPos = TransformObjectToWorld(inputMesh.vertex.xyz).xyz; + + // Normal is required for triplanar mapping + output.worldNormal = TransformObjectToWorldNormal(inputMesh.normal); + // Not required but assign to silent compiler warning + output.worldTangent = float4(1.0, 0.0, 0.0, 0.0); + + output.texcoord0 = inputMesh.texcoord0; + output.texcoord1 = inputMesh.texcoord1; + output.texcoord2 = inputMesh.texcoord2; + // #if %TEXCOORD3REQUIREKEY% + output.texcoord3 = inputMesh.texcoord3; + // #endif + // #if %VERTEXCOLORREQUIREKEY% + output.vertexColor = inputMesh.vertexColor; + // #endif + + return output; + } +#else + + #if (_PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR))) + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/ShaderVariablesMatrixDefsHDCamera.hlsl" + + void MotionVectorPositionZBias(VertexToPixel input) + { + #if UNITY_REVERSED_Z + input.pos.z -= unity_MotionVectorsParams.z * input.pos.w; + #else + input.pos.z += unity_MotionVectorsParams.z * input.pos.w; + #endif + } + + #endif + + VertexToPixel Vert(VertexData input) + { + VertexToPixel output; + ZERO_INITIALIZE(VertexToPixel, output); + + UNITY_SETUP_INSTANCE_ID(input); + UNITY_TRANSFER_INSTANCE_ID(input, output); + UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(output); + + #if _HDRP && (_PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR))) + VertexData previousMesh = input; + #endif + + ChainModifyVertex(input, output, _Time); + + // This return the camera relative position (if enable) + float3 positionRWS = TransformObjectToWorld(input.vertex.xyz); + float3 normalWS = TransformObjectToWorldNormal(input.normal); + float4 tangentWS = float4(TransformObjectToWorldDir(input.tangent.xyz), input.tangent.w); + + + output.worldPos = GetAbsolutePositionWS(positionRWS); + output.pos = TransformWorldToHClip(positionRWS); + output.worldNormal = normalWS; + output.worldTangent = tangentWS; + + + output.texcoord0 = input.texcoord0; + output.texcoord1 = input.texcoord1; + output.texcoord2 = input.texcoord2; + + // #if %TEXCOORD3REQUIREKEY% + output.texcoord3 = input.texcoord3; + // #endif + + // #if %VERTEXCOLORREQUIREKEY% + output.vertexColor = input.vertexColor; + // #endif + + // #if %SCREENPOSREQUIREKEY% + // output.screenPos = ComputeScreenPos(output.pos, _ProjectionParams.x); + // #endif + + #if _HDRP && (_PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR))) + + #if !defined(TESSELLATION_ON) + MotionVectorPositionZBias(output); + #endif + + output.motionVectorCS = mul(UNITY_MATRIX_UNJITTERED_VP, float4(positionRWS.xyz, 1.0)); + // Note: unity_MotionVectorsParams.y is 0 is forceNoMotion is enabled + bool forceNoMotion = unity_MotionVectorsParams.y == 0.0; + if (forceNoMotion) + { + output.previousPositionCS = float4(0.0, 0.0, 0.0, 1.0); + } + else + { + bool hasDeformation = unity_MotionVectorsParams.x > 0.0; // Skin or morph target + + float3 effectivePositionOS = (hasDeformation ? previousMesh.previousPositionOS : previousMesh.vertex.xyz); + #if defined(_ADD_PRECOMPUTED_VELOCITY) + effectivePositionOS -= input.precomputedVelocity; + #endif + + previousMesh.vertex = float4(effectivePositionOS, 1); + VertexToPixel dummy = (VertexToPixel)0; + + + ChainModifyVertex(previousMesh, dummy, _LastTimeParameters); + + // we might need this for skinned objects? + //float3 normalWS = TransformPreviousObjectToWorldNormal(input.normal).xyz; + float3 previousPositionRWS = TransformPreviousObjectToWorld(previousMesh.vertex.xyz); + + #ifdef _WRITE_TRANSPARENT_MOTION_VECTOR + if (_TransparentCameraOnlyMotionVectors > 0) + { + previousPositionRWS = positionRWS.xyz; + } + #endif // _WRITE_TRANSPARENT_MOTION_VECTOR + + output.previousPositionCS = mul(UNITY_MATRIX_PREV_VP, float4(previousPositionRWS, 1.0)); + } + #endif // _HDRP && _PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR)) + + + return output; + } + + +#endif + + + + + + + + #if defined(WRITE_DECAL_BUFFER) && !defined(_DISABLE_DECALS) + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/Decal/DecalPrepassBuffer.hlsl" + #endif + + FragInputs BuildFragInputs(VertexToPixel input) + { + UNITY_SETUP_INSTANCE_ID(input); + FragInputs output; + ZERO_INITIALIZE(FragInputs, output); + + // Init to some default value to make the computer quiet (else it output 'divide by zero' warning even if value is not used). + // TODO: this is a really poor workaround, but the variable is used in a bunch of places + // to compute normals which are then passed on elsewhere to compute other values... + output.tangentToWorld = k_identity3x3; + output.positionSS = input.pos; // input.positionCS is SV_Position + // BETTER SHADERS: because we transform world position into actual world space for things like + // triplanar, etc, we have to back transform it here for lighting + output.positionRWS = GetCameraRelativePositionWS(input.worldPos); + output.tangentToWorld = BuildTangentToWorld(input.worldTangent, input.worldNormal); + output.texCoord0 = input.texcoord0; + output.texCoord1 = input.texcoord1; + output.texCoord2 = input.texcoord2; + + return output; + } + +#if UNITY_VERSION > UNITY_2022_3_12 + void ApplyDecalAndGetNormal(FragInputs fragInputs, PositionInputs posInput, Surface surfaceDescription, float3 normalTS, + inout SurfaceData surfaceData) + { + float3 doubleSidedConstants = GetDoubleSidedConstants(); + + #ifdef DECAL_NORMAL_BLENDING + // SG nodes don't ouptut surface gradients, so if decals require surf grad blending, we have to convert + // the normal to gradient before applying the decal. We then have to resolve the gradient back to world space + normalTS = SurfaceGradientFromTangentSpaceNormalAndFromTBN(normalTS, + fragInputs.tangentToWorld[0], fragInputs.tangentToWorld[1]); + + + #if HAVE_DECALS + if (_EnableDecals) + { + float alpha = 1.0; + alpha = surfaceDescription.Alpha; + + DecalSurfaceData decalSurfaceData = GetDecalSurfaceData(posInput, fragInputs, alpha); + ApplyDecalToSurfaceNormal(decalSurfaceData, fragInputs.tangentToWorld[2], normalTS); + ApplyDecalToSurfaceDataNoNormal(decalSurfaceData, surfaceData); + } + #endif + + GetNormalWS_SG(fragInputs, normalTS, surfaceData.normalWS, doubleSidedConstants); + #else + // normal delivered to master node + + #if HAVE_DECALS + if (_EnableDecals) + { + float alpha = 1.0; + alpha = surfaceDescription.Alpha; + + // Both uses and modifies 'surfaceData.normalWS'. + DecalSurfaceData decalSurfaceData = GetDecalSurfaceData(posInput, fragInputs, alpha); + ApplyDecalToSurfaceNormal(decalSurfaceData, surfaceData.normalWS.xyz); + ApplyDecalToSurfaceDataNoNormal(decalSurfaceData, surfaceData); + } + #endif + #endif + } +#endif + + void BuildSurfaceData(FragInputs fragInputs, inout Surface surfaceDescription, float3 V, PositionInputs posInput, out SurfaceData surfaceData, out float3 bentNormalWS) + { + // setup defaults -- these are used if the graph doesn't output a value + ZERO_INITIALIZE(SurfaceData, surfaceData); + + // specularOcclusion need to be init ahead of decal to quiet the compiler that modify the SurfaceData struct + // however specularOcclusion can come from the graph, so need to be init here so it can be override. + surfaceData.specularOcclusion = 1.0; + + // copy across graph values, if defined + surfaceData.baseColor = surfaceDescription.Albedo; + surfaceData.perceptualSmoothness = surfaceDescription.Smoothness; + surfaceData.ambientOcclusion = surfaceDescription.Occlusion; + surfaceData.specularOcclusion = surfaceDescription.SpecularOcclusion; + surfaceData.metallic = surfaceDescription.Metallic; + surfaceData.subsurfaceMask = surfaceDescription.SubsurfaceMask; + surfaceData.thickness = surfaceDescription.Thickness; + surfaceData.diffusionProfileHash = asuint(surfaceDescription.DiffusionProfileHash); + #if _USESPECULAR + surfaceData.specularColor = surfaceDescription.Specular; + #endif + surfaceData.coatMask = surfaceDescription.CoatMask; + surfaceData.anisotropy = surfaceDescription.Anisotropy; + surfaceData.iridescenceMask = surfaceDescription.IridescenceMask; + surfaceData.iridescenceThickness = surfaceDescription.IridescenceThickness; + + + + #if defined(_REFRACTION_PLANE) || defined(_REFRACTION_SPHERE) || defined(_REFRACTION_THIN) + if (_EnableSSRefraction) + { + surfaceData.transmittanceMask = (1.0 - surfaceDescription.Alpha); + surfaceDescription.Alpha = 1.0; + } + else + { + surfaceData.ior = surfaceDescription.ior; + surfaceData.transmittanceColor = surfaceDescription.transmittanceColor; + surfaceData.atDistance = surfaceDescription.atDistance; + surfaceData.transmittanceMask = surfaceDescription.transmittanceMask; + surfaceDescription.Alpha = 1.0; + } + #else + surfaceData.ior = 1.0; + surfaceData.transmittanceColor = float3(1.0, 1.0, 1.0); + surfaceData.atDistance = 1.0; + surfaceData.transmittanceMask = 0.0; + #endif + + + + // These static material feature allow compile time optimization + surfaceData.materialFeatures = MATERIALFEATUREFLAGS_LIT_STANDARD; + #ifdef _MATERIAL_FEATURE_SUBSURFACE_SCATTERING + surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_SUBSURFACE_SCATTERING; + #endif + + #ifdef _MATERIAL_FEATURE_TRANSMISSION + surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_TRANSMISSION; + #endif + + #ifdef _MATERIAL_FEATURE_ANISOTROPY + surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_ANISOTROPY; + surfaceData.normalWS = float3(0, 1, 0); + #endif + + #ifdef _MATERIAL_FEATURE_IRIDESCENCE + surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_IRIDESCENCE; + #endif + + #ifdef _MATERIAL_FEATURE_SPECULAR_COLOR + surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_SPECULAR_COLOR; + #endif + + #if defined(_MATERIAL_FEATURE_CLEAR_COAT) || _CLEARCOAT + surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_CLEAR_COAT; + #endif + + #if defined (_MATERIAL_FEATURE_SPECULAR_COLOR) && defined (_ENERGY_CONSERVING_SPECULAR) + // Require to have setup baseColor + // Reproduce the energy conservation done in legacy Unity. Not ideal but better for compatibility and users can unchek it + surfaceData.baseColor *= (1.0 - Max3(surfaceData.specularColor.r, surfaceData.specularColor.g, surfaceData.specularColor.b)); + #endif + + float3 normalTS = surfaceDescription.Normal; + #if !_WORLDSPACENORMAL + surfaceData.normalWS = mul(surfaceDescription.Normal, fragInputs.tangentToWorld); + #else + normalTS = mul(fragInputs.tangentToWorld, surfaceDescription.Normal); + surfaceData.normalWS = surfaceDescription.Normal; + #endif + + + #if UNITY_VERSION > UNITY_2022_3_12 + ApplyDecalAndGetNormal(fragInputs, posInput, surfaceDescription, normalTS, surfaceData); + #else + #ifdef DECAL_NORMAL_BLENDING + #if HAVE_DECALS + float alpha = 1.0; + alpha = surfaceDescription.Alpha; + if (_EnableDecals) + { + DecalSurfaceData decalSurfaceData = GetDecalSurfaceData(posInput, fragInputs, alpha); + ApplyDecalToSurfaceData(decalSurfaceData, fragInputs.tangentToWorld[2], surfaceData, normalTS); + } + #endif + #else + #if HAVE_DECALS + if (_EnableDecals) + { + float alpha = 1.0; + alpha = surfaceDescription.Alpha; + // Both uses and modifies 'surfaceData.normalWS'. + DecalSurfaceData decalSurfaceData = GetDecalSurfaceData(posInput, fragInputs, alpha); + ApplyDecalToSurfaceData(decalSurfaceData, fragInputs.tangentToWorld[2], surfaceData); + } + #endif + #endif + #endif + + + + surfaceData.geomNormalWS = fragInputs.tangentToWorld[2]; + + surfaceData.tangentWS = normalize(fragInputs.tangentToWorld[0].xyz); // The tangent is not normalize in tangentToWorld for mikkt. TODO: Check if it expected that we normalize with Morten. Tag: SURFACE_GRADIENT + + + bentNormalWS = surfaceData.normalWS; + + surfaceData.tangentWS = Orthonormalize(surfaceData.tangentWS, surfaceData.normalWS); + + #ifdef DEBUG_DISPLAY + if (_DebugMipMapMode != DEBUGMIPMAPMODE_NONE) + { + // TODO: need to update mip info + surfaceData.metallic = 0; + } + + // We need to call ApplyDebugToSurfaceData after filling the surfarcedata and before filling builtinData + // as it can modify attribute use for static lighting + ApplyDebugToSurfaceData(fragInputs.tangentToWorld, surfaceData); + #endif + + // By default we use the ambient occlusion with Tri-ace trick (apply outside) for specular occlusion. + // If user provide bent normal then we process a better term + #if defined(_SPECULAR_OCCLUSION_CUSTOM) + // Just use the value passed through via the slot (not active otherwise) + #elif defined(_SPECULAR_OCCLUSION_FROM_AO_BENT_NORMAL) + // If we have bent normal and ambient occlusion, process a specular occlusion + surfaceData.specularOcclusion = GetSpecularOcclusionFromBentAO(V, bentNormalWS, surfaceData.normalWS, surfaceData.ambientOcclusion, PerceptualSmoothnessToPerceptualRoughness(surfaceData.perceptualSmoothness)); + #elif defined(_AMBIENT_OCCLUSION) && defined(_SPECULAR_OCCLUSION_FROM_AO) + surfaceData.specularOcclusion = GetSpecularOcclusionFromAmbientOcclusion(ClampNdotV(dot(surfaceData.normalWS, V)), surfaceData.ambientOcclusion, PerceptualSmoothnessToRoughness(surfaceData.perceptualSmoothness)); + #endif + + #if defined(_ENABLE_GEOMETRIC_SPECULAR_AA) && !defined(SHADER_STAGE_RAY_TRACING) + surfaceData.perceptualSmoothness = GeometricNormalFiltering(surfaceData.perceptualSmoothness, fragInputs.tangentToWorld[2], surfaceDescription.SpecularAAScreenSpaceVariance, surfaceDescription.SpecularAAThreshold); + #endif + } + + void GetSurfaceAndBuiltinData(VertexToPixel m2ps, FragInputs fragInputs, float3 V, inout PositionInputs posInput, + out SurfaceData surfaceData, out BuiltinData builtinData, inout Surface l, inout ShaderData d + #if NEED_FACING + , bool facing + #endif + ) + { + // Removed since crossfade does not work, probably needs extra material setup. + //#if !defined(SHADER_STAGE_RAY_TRACING) && !defined(_TESSELLATION_DISPLACEMENT) + // #ifdef LOD_FADE_CROSSFADE // enable dithering LOD transition if user select CrossFade transition in LOD group + // LODDitheringTransition(ComputeFadeMaskSeed(V, posInput.positionSS), unity_LODFade.x); + // #endif + //#endif + + + + + d = CreateShaderData(m2ps + #if NEED_FACING + , facing + #endif + ); + + l = (Surface)0; + + l.Albedo = half3(0.5, 0.5, 0.5); + l.Normal = float3(0,0,1); + l.Occlusion = 1; + l.Alpha = 1; + l.SpecularOcclusion = 1; + + #if !defined(SHADER_STAGE_RAY_TRACING) && defined(_DEPTHOFFSET_ON) + l.outputDepth = d.clipPos.z; + #endif + + ChainSurfaceFunction(l, d); + + #if !defined(SHADER_STAGE_RAY_TRACING) && defined(_DEPTHOFFSET_ON) + posInput.deviceDepth = l.outputDepth; + #endif + + #if _UNLIT + //l.Emission = l.Albedo; + //l.Albedo = 0; + l.Normal = half3(0,0,1); + l.Occlusion = 1; + l.Metallic = 0; + l.Specular = 0; + #endif + + surfaceData.geomNormalWS = d.worldSpaceNormal; + surfaceData.tangentWS = d.worldSpaceTangent; + fragInputs.tangentToWorld = d.TBNMatrix; + + float3 bentNormalWS; + + BuildSurfaceData(fragInputs, l, V, posInput, surfaceData, bentNormalWS); + + + float4 lightmapTexCoord1 = fragInputs.texCoord1; + float4 lightmapTexCoord2 = fragInputs.texCoord2; + //#ifdef FRAG_INPUTS_USE_TEXCOORD1 + // float4 lightmapTexCoord1 = fragInputs.texCoord1; + // #else + // float4 lightmapTexCoord1 = float4(0,0,0,0); + // #endif + + // #ifdef FRAG_INPUTS_USE_TEXCOORD2 + // float4 lightmapTexCoord2 = fragInputs.texCoord2; + // #else + // float4 lightmapTexCoord2 = float4(0,0,0,0); + // #endif + + + InitBuiltinData(posInput, l.Alpha, bentNormalWS, -d.worldSpaceNormal, lightmapTexCoord1, lightmapTexCoord2, builtinData); + + + + builtinData.emissiveColor = l.Emission; + + #if defined(_OVERRIDE_BAKEDGI) + builtinData.bakeDiffuseLighting = l.DiffuseGI; + builtinData.backBakeDiffuseLighting = l.BackDiffuseGI; + builtinData.emissiveColor += l.SpecularGI; + #endif + + #if defined(_OVERRIDE_SHADOWMASK) + builtinData.shadowMask0 = l.ShadowMask.x; + builtinData.shadowMask1 = l.ShadowMask.y; + builtinData.shadowMask2 = l.ShadowMask.z; + builtinData.shadowMask3 = l.ShadowMask.w; + #endif + + #ifdef UNITY_VIRTUAL_TEXTURING + //builtinData.vtPackedFeedback = surfaceData.VTPackedFeedback; + #endif + + #if (SHADERPASS == SHADERPASS_DISTORTION) + builtinData.distortion = surfaceData.Distortion; + builtinData.distortionBlur = surfaceData.DistortionBlur; + #endif + + #ifndef SHADER_UNLIT + // PostInitBuiltinData call ApplyDebugToBuiltinData + PostInitBuiltinData(V, posInput, surfaceData, builtinData); + #else + ApplyDebugToBuiltinData(builtinData); + #endif + + RAY_TRACING_OPTIONAL_ALPHA_TEST_PASS + } + + + #if defined(WRITE_NORMAL_BUFFER) && defined(WRITE_MSAA_DEPTH) + #define SV_TARGET_DECAL SV_Target2 + #elif defined(WRITE_NORMAL_BUFFER) || defined(WRITE_MSAA_DEPTH) + #define SV_TARGET_DECAL SV_Target1 + #else + #define SV_TARGET_DECAL SV_Target0 + #endif + + + void Frag( VertexToPixel v2f + #if defined(SCENESELECTIONPASS) || defined(SCENEPICKINGPASS) + , out float4 outColor : SV_Target0 + #else + #ifdef WRITE_MSAA_DEPTH + // We need the depth color as SV_Target0 for alpha to coverage + , out float4 depthColor : SV_Target0 + #ifdef WRITE_NORMAL_BUFFER + , out float4 outNormalBuffer : SV_Target1 + #endif + #else + #ifdef WRITE_NORMAL_BUFFER + , out float4 outNormalBuffer : SV_Target0 + #endif + #endif + + // Decal buffer must be last as it is bind but we can optionally write into it (based on _DISABLE_DECALS) + #if defined(WRITE_DECAL_BUFFER) && !defined(_DISABLE_DECALS) + , out float4 outDecalBuffer : SV_TARGET_DECAL + #endif + #endif + + #if defined(_DEPTHOFFSET_ON) && !defined(SCENEPICKINGPASS) + , out float outputDepth : SV_Depth + #endif + #if NEED_FACING + , bool facing : SV_IsFrontFace + #endif + ) + { + UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX(v2f); + FragInputs input = BuildFragInputs(v2f); + + // input.positionSS is SV_Position + PositionInputs posInput = GetPositionInput(input.positionSS.xy, _ScreenSize.zw, input.positionSS.z, input.positionSS.w, input.positionRWS); + + + float3 V = GetWorldSpaceNormalizeViewDir(input.positionRWS); + + + SurfaceData surfaceData; + BuiltinData builtinData; + Surface l; + ShaderData d; + GetSurfaceAndBuiltinData(v2f, input, V, posInput, surfaceData, builtinData, l, d + #if NEED_FACING + , facing + #endif + ); + + + #ifdef _DEPTHOFFSET_ON + outputDepth = l.outputDepth; + #endif + + #ifdef SCENESELECTIONPASS + // We use depth prepass for scene selection in the editor, this code allow to output the outline correctly + outColor = float4(_ObjectId, _PassValue, 1.0, 1.0); + #elif defined(SCENEPICKINGPASS) + outColor = _SelectionID; + #else + #ifdef WRITE_MSAA_DEPTH + // In case we are rendering in MSAA, reading the an MSAA depth buffer is way too expensive. To avoid that, we export the depth to a color buffer + depthColor = v2f.pos.z; + + #ifdef _ALPHATOMASK_ON + // Alpha channel is used for alpha to coverage + depthColor.a = SharpenAlpha(builtinData.opacity, builtinData.alphaClipTreshold); + #endif // alphatomask + #endif // msaa_depth + #endif + + #if defined(WRITE_NORMAL_BUFFER) + EncodeIntoNormalBuffer(ConvertSurfaceDataToNormalData(surfaceData), outNormalBuffer); + #endif + + #if (defined(WRITE_DECAL_BUFFER) && !defined(_DISABLE_DECALS)) || defined(WRITE_RENDERING_LAYER) + DecalPrepassData decalPrepassData; + #ifdef _DISABLE_DECALS + ZERO_INITIALIZE(DecalPrepassData, decalPrepassData); + #else + // We don't have the right to access SurfaceData in a shaderpass. + // However it would be painful to have to add a function like ConvertSurfaceDataToDecalPrepassData() to every Material to return geomNormalWS anyway + // Here we will put the constrain that any Material requiring to support Decal, will need to have geomNormalWS as member of surfaceData (and we already require normalWS anyway) + decalPrepassData.geomNormalWS = surfaceData.geomNormalWS; + #endif + decalPrepassData.renderingLayerMask = GetMeshRenderingLayerMask(); + EncodeIntoDecalPrepassBuffer(decalPrepassData, outDecalBuffer); + #endif + + + } + + + + + ENDHLSL + } + + Pass + { + // based on HDLitPass.template + Name "DepthOnly" + Tags { "LightMode" = "DepthOnly" } + + //------------------------------------------------------------------------------------- + // Render Modes (Blend, Cull, ZTest, Stencil, etc) + //------------------------------------------------------------------------------------- + + Cull Back + + + ZWrite On + + + // Stencil setup + Stencil + { + WriteMask [_StencilWriteMaskDepth] + Ref [_StencilRefDepth] + CompFront Always + PassFront Replace + CompBack Always + PassBack Replace + } + AlphaToMask [_AlphaCutoffEnable] + Tags { "RenderType" = "Opaque" "Queue" = "Geometry" "PreviewType" = "Plane" } + Cull [_CullingOption] + ZWrite [_ZWrite] + ZTest [_ZTestMode] + + + //------------------------------------------------------------------------------------- + // End Render Modes + //------------------------------------------------------------------------------------- + + HLSLPROGRAM + + #pragma target 4.5 + #pragma only_renderers d3d11 playstation xboxone xboxseries vulkan metal switch + //#pragma enable_d3d11_debug_symbols + + #pragma multi_compile_instancing + #pragma instancing_options renderinglayer + #pragma multi_compile _ DOTS_INSTANCING_ON + #pragma multi_compile _ LOD_FADE_CROSSFADE + + //#pragma shader_feature _ _SURFACE_TYPE_TRANSPARENT + //#pragma shader_feature_local _BLENDMODE_OFF _BLENDMODE_ALPHA _BLENDMODE_ADD _BLENDMODE_PRE_MULTIPLY + //#pragma shader_feature_local _ _ADD_PRECOMPUTED_VELOCITY + //#pragma shader_feature_local _ _TRANSPARENT_WRITES_MOTION_VEC + //#pragma shader_feature_local _ _ENABLE_FOG_ON_TRANSPARENT + //#pragma shader_feature_local _ _DISABLE_DECALS + //#pragma shader_feature_local _ _DISABLE_SSR + //#pragma shader_feature_local _ _DISABLE_SSR_TRANSPARENT + //#pragma shader_feature_local _REFRACTION_OFF _REFRACTION_PLANE _REFRACTION_SPHERE _REFRACTION_THIN + #pragma multi_compile _ WRITE_DECAL_BUFFER + //------------------------------------------------------------------------------------- + // Variant Definitions (active field translations to HDRP defines) + //------------------------------------------------------------------------------------- + // #define _MATERIAL_FEATURE_SUBSURFACE_SCATTERING 1 + // #define _MATERIAL_FEATURE_TRANSMISSION 1 + // #define _MATERIAL_FEATURE_ANISOTROPY 1 + // #define _MATERIAL_FEATURE_IRIDESCENCE 1 + // #define _MATERIAL_FEATURE_SPECULAR_COLOR 1 + #define _ENABLE_FOG_ON_TRANSPARENT 1 + // #define _AMBIENT_OCCLUSION 1 + // #define _SPECULAR_OCCLUSION_FROM_AO 1 + // #define _SPECULAR_OCCLUSION_FROM_AO_BENT_NORMAL 1 + // #define _SPECULAR_OCCLUSION_CUSTOM 1 + // #define _ENERGY_CONSERVING_SPECULAR 1 + // #define _ENABLE_GEOMETRIC_SPECULAR_AA 1 + // #define _HAS_REFRACTION 1 + // #define _REFRACTION_PLANE 1 + // #define _REFRACTION_SPHERE 1 + // #define _DISABLE_DECALS 1 + // #define _DISABLE_SSR 1 + // #define _ADD_PRECOMPUTED_VELOCITY + // #define _WRITE_TRANSPARENT_MOTION_VECTOR 1 + // #define _DEPTHOFFSET_ON 1 + // #define _BLENDMODE_PRESERVE_SPECULAR_LIGHTING 1 + + #define SHADERPASS SHADERPASS_DEPTH_ONLY + #pragma multi_compile _ WRITE_NORMAL_BUFFER + #pragma multi_compile _ WRITE_MSAA_DEPTH + #define _PASSDEPTH 1 + + + + #pragma shader_feature_local GLOW_ON + #pragma shader_feature_local FADE_ON + #pragma shader_feature_local OUTBASE_ON + #pragma shader_feature_local ONLYOUTLINE_ON + #pragma shader_feature_local GRADIENT_ON + #pragma shader_feature_local GRADIENT2COL_ON + #pragma shader_feature_local RADIALGRADIENT_ON + #pragma shader_feature_local COLORSWAP_ON + #pragma shader_feature_local HSV_ON + #pragma shader_feature_local CHANGECOLOR_ON + #pragma shader_feature_local CHANGECOLOR2_ON + #pragma shader_feature_local CHANGECOLOR3_ON + #pragma shader_feature_local COLORRAMP_ON + #pragma shader_feature_local GRADIENTCOLORRAMP_ON + #pragma shader_feature_local HITEFFECT_ON + #pragma shader_feature_local NEGATIVE_ON + #pragma shader_feature_local PIXELATE_ON + #pragma shader_feature_local GREYSCALE_ON + #pragma shader_feature_local POSTERIZE_ON + #pragma shader_feature_local BLUR_ON + #pragma shader_feature_local MOTIONBLUR_ON + #pragma shader_feature_local GHOST_ON + #pragma shader_feature_local ALPHAOUTLINE_ON + #pragma shader_feature_local INNEROUTLINE_ON + #pragma shader_feature_local ONLYINNEROUTLINE_ON + #pragma shader_feature_local HOLOGRAM_ON + #pragma shader_feature_local CHROMABERR_ON + #pragma shader_feature_local GLITCH_ON + #pragma shader_feature_local FLICKER_ON + #pragma shader_feature_local SHADOW_ON + #pragma shader_feature_local SHINE_ON + #pragma shader_feature_local CONTRAST_ON + #pragma shader_feature_local OVERLAY_ON + #pragma shader_feature_local OVERLAYMULT_ON + #pragma shader_feature_local DOODLE_ON + #pragma shader_feature_local WIND_ON + #pragma shader_feature_local WAVEUV_ON + #pragma shader_feature_local ROUNDWAVEUV_ON + #pragma shader_feature_local RECTSIZE_ON + #pragma shader_feature_local OFFSETUV_ON + #pragma shader_feature_local CLIPPING_ON + #pragma shader_feature_local RADIALCLIPPING_ON + #pragma shader_feature_local TEXTURESCROLL_ON + #pragma shader_feature_local ZOOMUV_ON + #pragma shader_feature_local DISTORT_ON + #pragma shader_feature_local WARP_ON + #pragma shader_feature_local TWISTUV_ON + #pragma shader_feature_local ROTATEUV_ON + #pragma shader_feature_local POLARUV_ON + #pragma shader_feature_local FISHEYE_ON + #pragma shader_feature_local PINCH_ON + #pragma shader_feature_local SHAKEUV_ON + + #pragma shader_feature_local GLOWTEX_ON + #pragma shader_feature_local OUTTEX_ON + #pragma shader_feature_local OUTDIST_ON + #pragma shader_feature_local OUTBASE8DIR_ON + #pragma shader_feature_local OUTBASEPIXELPERF_ON + #pragma shader_feature_local COLORRAMPOUTLINE_ON + #pragma shader_feature_local GREYSCALEOUTLINE_ON + #pragma shader_feature_local POSTERIZEOUTLINE_ON + #pragma shader_feature_local BLURISHD_ON + #pragma shader_feature_local MANUALWIND_ON + #pragma shader_feature_local ATLAS_ON + #pragma shader_feature_local PREMULTIPLYALPHA_ON + + #pragma shader_feature BILBOARD_ON + #pragma shader_feature BILBOARDY_ON + + #pragma shader_feature NORMALMAP_ON + + + #define _HDRP 1 +#define _USINGTEXCOORD1 1 +#define _USINGTEXCOORD2 1 + + + #pragma vertex Vert + #pragma fragment Frag + + + + // useful conversion functions to make surface shader code just work + + #define UNITY_DECLARE_TEX2D(name) TEXTURE2D(name); SAMPLER(sampler##name); + #define UNITY_DECLARE_TEX2D_NOSAMPLER(name) TEXTURE2D(name); + #define UNITY_DECLARE_TEX2DARRAY(name) TEXTURE2D_ARRAY(name); SAMPLER(sampler##name); + #define UNITY_DECLARE_TEX2DARRAY_NOSAMPLER(tex) TEXTURE2D_ARRAY(tex); + + #define UNITY_SAMPLE_TEX2DARRAY(tex,coord) SAMPLE_TEXTURE2D_ARRAY(tex, sampler##tex, coord.xy, coord.z) + #define UNITY_SAMPLE_TEX2DARRAY_LOD(tex,coord,lod) SAMPLE_TEXTURE2D_ARRAY_LOD(tex, sampler##tex, coord.xy, coord.z, lod) + #define UNITY_SAMPLE_TEX2D(tex, coord) SAMPLE_TEXTURE2D(tex, sampler##tex, coord) + #define UNITY_SAMPLE_TEX2D_SAMPLER(tex, samp, coord) SAMPLE_TEXTURE2D(tex, sampler##samp, coord) + + #define UNITY_SAMPLE_TEX2D_LOD(tex,coord, lod) SAMPLE_TEXTURE2D_LOD(tex, sampler_##tex, coord, lod) + #define UNITY_SAMPLE_TEX2D_SAMPLER_LOD(tex,samplertex,coord, lod) SAMPLE_TEXTURE2D_LOD (tex, sampler##samplertex,coord, lod) + + #if defined(UNITY_COMPILER_HLSL) + #define UNITY_INITIALIZE_OUTPUT(type,name) name = (type)0; + #else + #define UNITY_INITIALIZE_OUTPUT(type,name) + #endif + + #define sampler2D_float sampler2D + #define sampler2D_half sampler2D + + #undef WorldNormalVector + #define WorldNormalVector(data, normal) mul(normal, data.TBNMatrix) + + #define UnityObjectToWorldNormal(normal) mul(GetObjectToWorldMatrix(), normal) + + #ifndef SHADER_STAGE_FRAGMENT + #if !defined(SHADOW_ULTRA_LOW) && !defined(SHADOW_LOW) && !defined(SHADOW_MEDIUM) && !defined(SHADOW_HIGH) // ultra low come from volumetricLighting.compute + #define SHADOW_MEDIUM + #endif + #if !defined(AREA_SHADOW_LOW) && !defined(AREA_SHADOW_MEDIUM) && !defined(AREA_SHADOW_HIGH) // low come from volumetricLighting.compute + #define AREA_SHADOW_MEDIUM + #endif + #endif + + + +// HDRP Adapter stuff + #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Common.hlsl" + #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Common.hlsl" + #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/GeometricTools.hlsl" // Required by Tessellation.hlsl + #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Tessellation.hlsl" + #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Texture.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/ShaderVariables.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/ShaderPass/ShaderPass.cs.hlsl" + #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/TextureStack.hlsl" // Required to be include before we include properties as it define DECLARE_STACK_CB + #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/DebugMipmapStreamingMacros.hlsl" // Required before including properties as it defines UNITY_TEXTURE_STREAMING_DEBUG_VARS + // Always include Shader Graph version + // Always include last to avoid double macros + #include "Packages/com.unity.shadergraph/ShaderGraphLibrary/Functions.hlsl" // Need to be here for Gradient struct definition + + +#include "Packages/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/ShaderPass/FragInputs.hlsl" + + + + #ifdef RAYTRACING_SHADER_GRAPH_DEFAULT + #define RAYTRACING_SHADER_GRAPH_HIGH + #endif + + #ifdef RAYTRACING_SHADER_GRAPH_RAYTRACED + #define RAYTRACING_SHADER_GRAPH_LOW + #endif + // end + + + + + // If we use subsurface scattering, enable output split lighting (for forward pass) + #if defined(_MATERIAL_FEATURE_SUBSURFACE_SCATTERING) && !defined(_SURFACE_TYPE_TRANSPARENT) + #define OUTPUT_SPLIT_LIGHTING + #endif + + #define HAVE_RECURSIVE_RENDERING + + #if SHADERPASS == SHADERPASS_TRANSPARENT_DEPTH_PREPASS + #if !defined(_DISABLE_SSR_TRANSPARENT) && !defined(SHADER_UNLIT) + #define WRITE_NORMAL_BUFFER + #endif + #endif + + #ifndef DEBUG_DISPLAY + // In case of opaque we don't want to perform the alpha test, it is done in depth prepass and we use depth equal for ztest (setup from UI) + // Don't do it with debug display mode as it is possible there is no depth prepass in this case + #if !defined(_SURFACE_TYPE_TRANSPARENT) && defined(_ALPHATEST) + #if SHADERPASS == SHADERPASS_FORWARD + #define SHADERPASS_FORWARD_BYPASS_ALPHA_TEST + #elif SHADERPASS == SHADERPASS_GBUFFER + #define SHADERPASS_GBUFFER_BYPASS_ALPHA_TEST + #endif + #endif + #endif + + // Define _DEFERRED_CAPABLE_MATERIAL for shader capable to run in deferred pass + #if defined(SHADER_LIT) && !defined(_SURFACE_TYPE_TRANSPARENT) + #define _DEFERRED_CAPABLE_MATERIAL + #endif + + // Translate transparent motion vector define + #if defined(_TRANSPARENT_WRITES_MOTION_VEC) && defined(_SURFACE_TYPE_TRANSPARENT) + #define _WRITE_TRANSPARENT_MOTION_VECTOR + #endif + + + + + CBUFFER_START(UnityPerMaterial) + float _UseShadowThreshold; + float _BlendMode; + float _EnableBlendModePreserveSpecularLighting; + float _RayTracing; + float _RefractionModel; + + + half4 _Color; + half4 _MainTex_ST, _MainTex_TexelSize; + half _Alpha, _AlphaCutoffValue; + + #if ATLAS_ON + half _MinXUV, _MaxXUV, _MinYUV, _MaxYUV; + #endif + + #if GLOW_ON + half4 _GlowColor; + half _Glow, _GlowGlobal; + #endif + + #if HSV_ON + half _HsvShift, _HsvSaturation, _HsvBright; + #endif + + #if DISTORT_ON + half4 _DistortTex_ST; + half _DistortTexXSpeed, _DistortTexYSpeed, _DistortAmount; + #endif + + #if FADE_ON + half4 _FadeBurnColor, _FadeTex_ST, _FadeBurnTex_ST; + half _FadeAmount, _FadeBurnWidth, _FadeBurnTransition,_FadeBurnGlow; + #endif + + #if OUTBASE_ON + half4 _OutlineColor; + half _OutlineAlpha, _OutlineGlow, _OutlineWidth; + int _OutlinePixelWidth; + #endif + + #if OUTTEX_ON + half4 _OutlineTex_ST; + half _OutlineTexXSpeed, _OutlineTexYSpeed; + #endif + + #if OUTDIST_ON + half4 _OutlineDistortTex_ST; + half _OutlineDistortTexXSpeed, _OutlineDistortTexYSpeed, _OutlineDistortAmount; + #endif + + #if ALPHAOUTLINE_ON + half _AlphaOutlineGlow, _AlphaOutlinePower, _AlphaOutlineMinAlpha, _AlphaOutlineBlend; + half4 _AlphaOutlineColor; + #endif + + #if INNEROUTLINE_ON + half _InnerOutlineThickness, _InnerOutlineAlpha, _InnerOutlineGlow; + half4 _InnerOutlineColor; + #endif + + #if GRADIENT_ON + half _GradBlend, _GradBoostX, _GradBoostY; + half4 _GradTopRightCol, _GradTopLeftCol, _GradBotRightCol, _GradBotLeftCol; + #endif + + #if COLORSWAP_ON + half4 _ColorSwapRed, _ColorSwapGreen, _ColorSwapBlue; + half _ColorSwapRedLuminosity, _ColorSwapGreenLuminosity, _ColorSwapBlueLuminosity, _ColorSwapBlend; + #endif + + #if CHANGECOLOR_ON + half4 _ColorChangeNewCol, _ColorChangeTarget; + half _ColorChangeTolerance, _ColorChangeLuminosity; + #endif + #if CHANGECOLOR2_ON + half4 _ColorChangeNewCol2, _ColorChangeTarget2; + half _ColorChangeTolerance2; + #endif + #if CHANGECOLOR3_ON + half4 _ColorChangeNewCol3, _ColorChangeTarget3; + half _ColorChangeTolerance3; + #endif + + #if COLORRAMP_ON + half _ColorRampLuminosity, _ColorRampBlend; + #endif + + #if HITEFFECT_ON + half4 _HitEffectColor; + half _HitEffectGlow, _HitEffectBlend; + #endif + + #if NEGATIVE_ON + half _NegativeAmount; + #endif + + #if PIXELATE_ON + half _PixelateSize; + #endif + + #if GREYSCALE_ON + half _GreyscaleLuminosity, _GreyscaleBlend; + half4 _GreyscaleTintColor; + #endif + + #if POSTERIZE_ON + half _PosterizeNumColors, _PosterizeGamma; + #endif + + #if BLUR_ON + half _BlurIntensity; + #endif + + #if MOTIONBLUR_ON + half _MotionBlurAngle, _MotionBlurDist; + #endif + + #if GHOST_ON + half _GhostColorBoost, _GhostTransparency, _GhostBlend; + #endif + + #if HOLOGRAM_ON + half _HologramStripesAmount, _HologramMinAlpha, _HologramUnmodAmount, _HologramStripesSpeed, _HologramMaxAlpha, _HologramBlend; + half4 _HologramStripeColor; + #endif + + #if CHROMABERR_ON + half _ChromAberrAmount, _ChromAberrAlpha; + #endif + + #if GLITCH_ON + half _GlitchAmount, _GlitchSize; + #endif + + #if FLICKER_ON + half _FlickerFreq, _FlickerPercent, _FlickerAlpha; + #endif + + #if SHADOW_ON + half _ShadowX, _ShadowY, _ShadowAlpha; + half4 _ShadowColor; + #endif + + #if SHINE_ON + half4 _ShineColor; + half _ShineLocation, _ShineRotate, _ShineWidth, _ShineGlow; + #endif + + #if CONTRAST_ON + half _Contrast, _Brightness; + #endif + + #if OVERLAY_ON + half4 _OverlayTex_ST, _OverlayColor; + half _OverlayGlow, _OverlayBlend, _OverlayTextureScrollXSpeed, _OverlayTextureScrollYSpeed; + #endif + + #if DOODLE_ON + half _HandDrawnAmount, _HandDrawnSpeed; + #endif + + #if WIND_ON + half _GrassSpeed, _GrassWind, _GrassManualAnim, _GrassRadialBend; + #endif + + #if WAVEUV_ON + float _WaveAmount, _WaveSpeed, _WaveStrength, _WaveX, _WaveY; + #endif + + #if ROUNDWAVEUV_ON + half _RoundWaveStrength, _RoundWaveSpeed; + #endif + + #if RECTSIZE_ON + half _RectSize; + #endif + + #if OFFSETUV_ON + half _OffsetUvX, _OffsetUvY; + #endif + + #if CLIPPING_ON + half _ClipUvLeft, _ClipUvRight, _ClipUvUp, _ClipUvDown; + #endif + + #if RADIALCLIPPING_ON + half _RadialStartAngle, _RadialClip, _RadialClip2; + #endif + + #if TEXTURESCROLL_ON + half _TextureScrollXSpeed, _TextureScrollYSpeed; + #endif + + #if ZOOMUV_ON + half _ZoomUvAmount; + #endif + + #if WARP_ON + half _WarpStrength, _WarpSpeed, _WarpScale; + #endif + + #if TWISTUV_ON + half _TwistUvAmount, _TwistUvPosX, _TwistUvPosY, _TwistUvRadius; + #endif + + #if ROTATEUV_ON + half _RotateUvAmount; + #endif + + #if FISHEYE_ON + half _FishEyeUvAmount; + #endif + + #if PINCH_ON + half _PinchUvAmount; + #endif + + #if SHAKEUV_ON + half _ShakeUvSpeed, _ShakeUvX, _ShakeUvY; + #endif + + #if NORMALMAP_ON + half _NormalStrength; + #endif + + float _RandomSeed; + + + + + CBUFFER_END + + + + // -- Property used by ScenePickingPass + #ifdef SCENEPICKINGPASS + float4 _SelectionID; + #endif + + // -- Properties used by SceneSelectionPass + #ifdef SCENESELECTIONPASS + int _ObjectId; + int _PassValue; + #endif + + + // data across stages, stripped like the above. + struct VertexToPixel + { + float4 pos : SV_POSITION; + float3 worldPos : TEXCOORD0; + float3 worldNormal : TEXCOORD1; + float4 worldTangent : TEXCOORD2; + float4 texcoord0 : TEXCOORD3; + float4 texcoord1 : TEXCOORD4; + float4 texcoord2 : TEXCOORD5; + // #if %TEXCOORD3REQUIREKEY% + float4 texcoord3 : TEXCOORD6; + // #endif + + // #if %SCREENPOSREQUIREKEY% + // float4 screenPos : TEXCOORD7; + // #endif + + // #if %VERTEXCOLORREQUIREKEY% + float4 vertexColor : COLOR; + // #endif + + // #if %EXTRAV2F0REQUIREKEY% + // float4 extraV2F0 : TEXCOORD8; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // float4 extraV2F1 : TEXCOORD9; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // float4 extraV2F2 : TEXCOORD10; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // float4 extraV2F3 : TEXCOORD11; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // float4 extraV2F4 : TEXCOORD12; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // float4 extraV2F5 : TEXCOORD13; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // float4 extraV2F6 : TEXCOORD14; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // float4 extraV2F7 : TEXCOORD15; + // #endif + + #if UNITY_ANY_INSTANCING_ENABLED + UNITY_VERTEX_INPUT_INSTANCE_ID + #endif // UNITY_ANY_INSTANCING_ENABLED + + #if _HDRP && (_PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR))) + float4 previousPositionCS : TEXCOORD16; // Contain previous transform position (in case of skinning for example) + float4 motionVectorCS : TEXCOORD17; + #endif + + UNITY_VERTEX_OUTPUT_STEREO + }; + + + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Debug/DebugDisplay.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/Material.hlsl" + #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/NormalSurfaceGradient.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/Lit/Lit.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/BuiltinUtilities.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/MaterialUtilities.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/Decal/DecalUtilities.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/Lit/LitDecalData.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/ShaderGraphFunctions.hlsl" + + + + + // data describing the user output of a pixel + struct Surface + { + half3 Albedo; + half Height; + half3 Normal; + half Smoothness; + half3 Emission; + half Metallic; + half3 Specular; + half Occlusion; + half SpecularPower; // for simple lighting + half Alpha; + float outputDepth; // if written, SV_Depth semantic is used. ShaderData.clipPos.z is unused value + // HDRP Only + half SpecularOcclusion; + half SubsurfaceMask; + half Thickness; + half CoatMask; + half CoatSmoothness; + half Anisotropy; + half IridescenceMask; + half IridescenceThickness; + int DiffusionProfileHash; + float SpecularAAThreshold; + float SpecularAAScreenSpaceVariance; + // requires _OVERRIDE_BAKEDGI to be defined, but is mapped in all pipelines + float3 DiffuseGI; + float3 BackDiffuseGI; + float3 SpecularGI; + float ior; + float3 transmittanceColor; + float atDistance; + float transmittanceMask; + // requires _OVERRIDE_SHADOWMASK to be defines + float4 ShadowMask; + + // for decals + float NormalAlpha; + float MAOSAlpha; + + + }; + + // Data the user declares in blackboard blocks + struct Blackboard + { + + float blackboardDummyData; + }; + + // data the user might need, this will grow to be big. But easy to strip + struct ShaderData + { + float4 clipPos; // SV_POSITION + float3 localSpacePosition; + float3 localSpaceNormal; + float3 localSpaceTangent; + + float3 worldSpacePosition; + float3 worldSpaceNormal; + float3 worldSpaceTangent; + float tangentSign; + + float3 worldSpaceViewDir; + float3 tangentSpaceViewDir; + + float4 texcoord0; + float4 texcoord1; + float4 texcoord2; + float4 texcoord3; + + float2 screenUV; + float4 screenPos; + + float4 vertexColor; + bool isFrontFace; + + float4 extraV2F0; + float4 extraV2F1; + float4 extraV2F2; + float4 extraV2F3; + float4 extraV2F4; + float4 extraV2F5; + float4 extraV2F6; + float4 extraV2F7; + + float3x3 TBNMatrix; + Blackboard blackboard; + }; + + struct VertexData + { + #if SHADER_TARGET > 30 + // uint vertexID : SV_VertexID; + #endif + float4 vertex : POSITION; + float3 normal : NORMAL; + float4 tangent : TANGENT; + float4 texcoord0 : TEXCOORD0; + + // optimize out mesh coords when not in use by user or lighting system + #if _URP && (_USINGTEXCOORD1 || _PASSMETA || _PASSFORWARD || _PASSGBUFFER) + float4 texcoord1 : TEXCOORD1; + #endif + + #if _URP && (_USINGTEXCOORD2 || _PASSMETA || ((_PASSFORWARD || _PASSGBUFFER) && defined(DYNAMICLIGHTMAP_ON))) + float4 texcoord2 : TEXCOORD2; + #endif + + #if _STANDARD && (_USINGTEXCOORD1 || (_PASSMETA || ((_PASSFORWARD || _PASSGBUFFER || _PASSFORWARDADD) && LIGHTMAP_ON))) + float4 texcoord1 : TEXCOORD1; + #endif + #if _STANDARD && (_USINGTEXCOORD2 || (_PASSMETA || ((_PASSFORWARD || _PASSGBUFFER) && DYNAMICLIGHTMAP_ON))) + float4 texcoord2 : TEXCOORD2; + #endif + + + #if _HDRP + float4 texcoord1 : TEXCOORD1; + float4 texcoord2 : TEXCOORD2; + #endif + + // #if %TEXCOORD3REQUIREKEY% + float4 texcoord3 : TEXCOORD3; + // #endif + + // #if %VERTEXCOLORREQUIREKEY% + float4 vertexColor : COLOR; + // #endif + + #if _PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR)) + float3 previousPositionOS : TEXCOORD4; // Contain previous transform position (in case of skinning for example) + #if defined (_ADD_PRECOMPUTED_VELOCITY) + float3 precomputedVelocity : TEXCOORD5; // Add Precomputed Velocity (Alembic computes velocities on runtime side). + #endif + #endif + + UNITY_VERTEX_INPUT_INSTANCE_ID + }; + + struct TessVertex + { + float4 vertex : INTERNALTESSPOS; + float3 normal : NORMAL; + float4 tangent : TANGENT; + float4 texcoord0 : TEXCOORD0; + float4 texcoord1 : TEXCOORD1; + float4 texcoord2 : TEXCOORD2; + + // #if %TEXCOORD3REQUIREKEY% + float4 texcoord3 : TEXCOORD3; + // #endif + + // #if %VERTEXCOLORREQUIREKEY% + float4 vertexColor : COLOR; + // #endif + + // #if %EXTRAV2F0REQUIREKEY% + // float4 extraV2F0 : TEXCOORD5; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // float4 extraV2F1 : TEXCOORD6; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // float4 extraV2F2 : TEXCOORD7; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // float4 extraV2F3 : TEXCOORD8; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // float4 extraV2F4 : TEXCOORD9; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // float4 extraV2F5 : TEXCOORD10; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // float4 extraV2F6 : TEXCOORD11; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // float4 extraV2F7 : TEXCOORD12; + // #endif + + #if _PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR)) + float3 previousPositionOS : TEXCOORD13; // Contain previous transform position (in case of skinning for example) + #if defined (_ADD_PRECOMPUTED_VELOCITY) + float3 precomputedVelocity : TEXCOORD14; + #endif + #endif + + UNITY_VERTEX_INPUT_INSTANCE_ID + UNITY_VERTEX_OUTPUT_STEREO + }; + + struct ExtraV2F + { + float4 extraV2F0; + float4 extraV2F1; + float4 extraV2F2; + float4 extraV2F3; + float4 extraV2F4; + float4 extraV2F5; + float4 extraV2F6; + float4 extraV2F7; + Blackboard blackboard; + float4 time; + }; + + + float3 WorldToTangentSpace(ShaderData d, float3 normal) + { + return mul(d.TBNMatrix, normal); + } + + float3 TangentToWorldSpace(ShaderData d, float3 normal) + { + return mul(normal, d.TBNMatrix); + } + + // in this case, make standard more like SRPs, because we can't fix + // unity_WorldToObject in HDRP, since it already does macro-fu there + + #if _STANDARD + float3 TransformWorldToObject(float3 p) { return mul(unity_WorldToObject, float4(p, 1)); }; + float3 TransformObjectToWorld(float3 p) { return mul(unity_ObjectToWorld, float4(p, 1)); }; + float4 TransformWorldToObject(float4 p) { return mul(unity_WorldToObject, p); }; + float4 TransformObjectToWorld(float4 p) { return mul(unity_ObjectToWorld, p); }; + float4x4 GetWorldToObjectMatrix() { return unity_WorldToObject; } + float4x4 GetObjectToWorldMatrix() { return unity_ObjectToWorld; } + #if (defined(SHADER_API_D3D11) || defined(SHADER_API_XBOXONE) || defined(UNITY_COMPILER_HLSLCC) || defined(SHADER_API_PSSL) || (SHADER_TARGET_SURFACE_ANALYSIS && !SHADER_TARGET_SURFACE_ANALYSIS_MOJOSHADER)) + #define UNITY_SAMPLE_TEX2D_LOD(tex,coord, lod) tex.SampleLevel (sampler##tex,coord, lod) + #define UNITY_SAMPLE_TEX2D_SAMPLER_LOD(tex,samplertex,coord, lod) tex.SampleLevel (sampler##samplertex,coord, lod) + #else + #define UNITY_SAMPLE_TEX2D_LOD(tex,coord,lod) tex2D (tex,coord,0,lod) + #define UNITY_SAMPLE_TEX2D_SAMPLER_LOD(tex,samplertex,coord,lod) tex2D (tex,coord,0,lod) + #endif + + #undef GetWorldToObjectMatrix() + + #define GetWorldToObjectMatrix() unity_WorldToObject + + + #endif + + float3 GetCameraWorldPosition() + { + #if _HDRP + return GetCameraRelativePositionWS(_WorldSpaceCameraPos); + #else + return _WorldSpaceCameraPos; + #endif + } + + #if _GRABPASSUSED + #if _STANDARD + TEXTURE2D(%GRABTEXTURE%); + SAMPLER(sampler_%GRABTEXTURE%); + #endif + + half3 GetSceneColor(float2 uv) + { + #if _STANDARD + return SAMPLE_TEXTURE2D(%GRABTEXTURE%, sampler_%GRABTEXTURE%, uv).rgb; + #else + return SHADERGRAPH_SAMPLE_SCENE_COLOR(uv); + #endif + } + #endif + + + + #if _STANDARD + UNITY_DECLARE_DEPTH_TEXTURE(_CameraDepthTexture); + float GetSceneDepth(float2 uv) { return SAMPLE_DEPTH_TEXTURE(_CameraDepthTexture, uv); } + float GetLinear01Depth(float2 uv) { return Linear01Depth(GetSceneDepth(uv)); } + float GetLinearEyeDepth(float2 uv) { return LinearEyeDepth(GetSceneDepth(uv)); } + #else + float GetSceneDepth(float2 uv) { return SHADERGRAPH_SAMPLE_SCENE_DEPTH(uv); } + float GetLinear01Depth(float2 uv) { return Linear01Depth(GetSceneDepth(uv), _ZBufferParams); } + float GetLinearEyeDepth(float2 uv) { return LinearEyeDepth(GetSceneDepth(uv), _ZBufferParams); } + #endif + + float3 GetWorldPositionFromDepthBuffer(float2 uv, float3 worldSpaceViewDir) + { + float eye = GetLinearEyeDepth(uv); + float3 camView = mul((float3x3)GetObjectToWorldMatrix(), transpose(mul(GetWorldToObjectMatrix(), UNITY_MATRIX_I_V)) [2].xyz); + + float dt = dot(worldSpaceViewDir, camView); + float3 div = worldSpaceViewDir/dt; + float3 wpos = (eye * div) + GetCameraWorldPosition(); + return wpos; + } + + #if _HDRP + float3 ObjectToWorldSpacePosition(float3 pos) + { + return GetAbsolutePositionWS(TransformObjectToWorld(pos)); + } + #else + float3 ObjectToWorldSpacePosition(float3 pos) + { + return TransformObjectToWorld(pos); + } + #endif + + #if _STANDARD + UNITY_DECLARE_SCREENSPACE_TEXTURE(_CameraDepthNormalsTexture); + float3 GetSceneNormal(float2 uv, float3 worldSpaceViewDir) + { + float4 depthNorms = UNITY_SAMPLE_SCREENSPACE_TEXTURE(_CameraDepthNormalsTexture, uv); + float3 norms = DecodeViewNormalStereo(depthNorms); + norms = mul((float3x3)GetWorldToViewMatrix(), norms) * 0.5 + 0.5; + return norms; + } + #elif _HDRP && !_DECALSHADER + + float3 GetSceneNormal(float2 uv, float3 worldSpaceViewDir) + { + NormalData nd; + DecodeFromNormalBuffer(_ScreenSize.xy * uv, nd); + return nd.normalWS; + } + #elif _URP + #if (SHADER_LIBRARY_VERSION_MAJOR >= 10) + #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/DeclareNormalsTexture.hlsl" + #endif + + float3 GetSceneNormal(float2 uv, float3 worldSpaceViewDir) + { + #if (SHADER_LIBRARY_VERSION_MAJOR >= 10) + return SampleSceneNormals(uv); + #else + float3 wpos = GetWorldPositionFromDepthBuffer(uv, worldSpaceViewDir); + return normalize(-cross(ddx(wpos), ddy(wpos))) * 0.5 + 0.5; + #endif + + } + #endif + + #if _HDRP + + half3 UnpackNormalmapRGorAG(half4 packednormal) + { + // This do the trick + packednormal.x *= packednormal.w; + + half3 normal; + normal.xy = packednormal.xy * 2 - 1; + normal.z = sqrt(1 - saturate(dot(normal.xy, normal.xy))); + return normal; + } + half3 UnpackNormal(half4 packednormal) + { + #if defined(UNITY_NO_DXT5nm) + return packednormal.xyz * 2 - 1; + #else + return UnpackNormalmapRGorAG(packednormal); + #endif + } + #endif + #if _HDRP || _URP + + half3 UnpackScaleNormal(half4 packednormal, half scale) + { + #ifndef UNITY_NO_DXT5nm + // Unpack normal as DXT5nm (1, y, 1, x) or BC5 (x, y, 0, 1) + // Note neutral texture like "bump" is (0, 0, 1, 1) to work with both plain RGB normal and DXT5nm/BC5 + packednormal.x *= packednormal.w; + #endif + half3 normal; + normal.xy = (packednormal.xy * 2 - 1) * scale; + normal.z = sqrt(1 - saturate(dot(normal.xy, normal.xy))); + return normal; + } + + #endif + + + void GetSun(out float3 lightDir, out float3 color) + { + lightDir = float3(0.5, 0.5, 0); + color = 1; + #if _HDRP + if (_DirectionalLightCount > 0) + { + DirectionalLightData light = _DirectionalLightDatas[0]; + lightDir = -light.forward.xyz; + color = light.color; + } + #elif _STANDARD + lightDir = normalize(_WorldSpaceLightPos0.xyz); + color = _LightColor0.rgb; + #elif _URP + Light light = GetMainLight(); + lightDir = light.direction; + color = light.color; + #endif + } + + + + + + + + + + TEXTURE2D(_MainTex); + SAMPLER(sampler_MainTex); + + #if GLOW_ON + TEXTURE2D(_GlowTex); + SAMPLER(sampler_GlowTex); + #endif + + #if FADE_ON + TEXTURE2D(_FadeTex); + SAMPLER(sampler_FadeTex); + + TEXTURE2D(_FadeBurnTex); + SAMPLER(sampler_FadeBurnTex); + #endif + + #if DISTORT_ON + TEXTURE2D(_DistortTex); + SAMPLER(sampler_DistortTex); + #endif + + #if OUTTEX_ON + TEXTURE2D(_OutlineTex); + SAMPLER(sampler_OutlineTex); + #endif + + #if OUTDIST_ON + TEXTURE2D(_OutlineDistortTex); + SAMPLER(sampler_OutlineDistortTex); + #endif + + #if COLORSWAP_ON + TEXTURE2D(_ColorSwapTex); + SAMPLER(sampler_ColorSwapTex); + #endif + + #if COLORRAMP_ON + TEXTURE2D(_ColorRampTex); + TEXTURE2D(_ColorRampTexGradient); + SAMPLER(sampler_ColorRampTex); + SAMPLER(sampler_ColorRampTexGradient); + #endif + + #if SHINE_ON + TEXTURE2D(_ShineMask); + SAMPLER(sampler_ShineMask); + #endif + + #if OVERLAY_ON + TEXTURE2D(_OverlayTex); + SAMPLER(sampler_OverlayTex); + #endif + + #if NORMALMAP_ON + TEXTURE2D(_NormalMap); + SAMPLER(sampler_NormalMap); + #endif + + + half3 GetPixel(in int offsetX, in int offsetY, in half2 uv, in Texture2D _tex, in SamplerState _sampler) + { + half2 _uv = uv + half2(offsetX * _MainTex_TexelSize.x, offsetY * _MainTex_TexelSize.y); + half4 col = SAMPLE_TEXTURE2D(_tex, _sampler, _uv); + return col.rgb; + } + + + //BLURS------------------------------------------------------------------------- + half4 Blur(half2 uv, Texture2D source, SamplerState sampler_source, half Intensity) + { + const half2 texelSize = 1.0 / _ScreenParams.xy; + const half4 color = SAMPLE_TEXTURE2D(source, sampler_source, uv); + const half2 offset = Intensity * texelSize; + + half4 accumulatedColor = color; + half accumulatedWeight = 1.0; + for (int x = -1; x <= 1; x++) + { + for (int y = -1; y <= 1; y++) + { + const half2 sampleUV = uv + half2(x, y) * offset; + const half4 sampleColor = SAMPLE_TEXTURE2D(source, sampler_source, sampleUV); + + accumulatedColor += sampleColor; + accumulatedWeight += 1.0; + } + } + + half4 blurredColor = accumulatedColor / accumulatedWeight; + return blurredColor; + } + + half BlurHD_G(half bhqp, half x) + { + return exp(-(x * x) / (2.0 * bhqp * bhqp)); + } + half4 BlurHD(half2 uv, Texture2D source, SamplerState sampler_source, half BlurAmount, half xScale, half yScale) + { + int iterations = 16; + int halfIterations = iterations / 2; + half sigmaX = 0.1 + BlurAmount * 0.5; + half sigmaY = sigmaX; + half total = 0.0; + half4 ret = half4(0, 0, 0, 0); + for (int iy = 0; iy < iterations; ++iy) + { + half fy = BlurHD_G(sigmaY, half(iy) -half(halfIterations)); + half offsetY = half(iy - halfIterations) * 0.00390625 * xScale; + for (int ix = 0; ix < iterations; ++ix) + { + half fx = BlurHD_G(sigmaX, half(ix) - half(halfIterations)); + half offsetX = half(ix - halfIterations) * 0.00390625 * yScale; + total += fx * fy; + ret += SAMPLE_TEXTURE2D(source, sampler_source, uv + half2(offsetX, offsetY)) * fx * fy; + } + } + return ret / total; + } + //----------------------------------------------------------------------- + + + //------------------------------------------- + half RemapFloat(half inValue, half inMin, half inMax, half outMin, half outMax){ + return outMin + (inValue - inMin) * (outMax - outMin) / (inMax - inMin); + } + //------------------------------------------- + + //----------------------------------------------------------------------- + half rand(half2 seed, half offset) { + return (frac(sin(dot(seed, half2(12.9898, 78.233))) * 43758.5453) + offset) % 1.0; + } + + half rand2(half2 seed, half offset) { + return (frac(sin(dot(seed * floor(50 + (_Time.x % 1.0) * 12.), half2(127.1, 311.7))) * 43758.5453123) + offset) % 1.0; + } + + half rand2CustomTime(half2 seed, half offset, half customTime) { + return (frac(sin(dot(seed * floor(50 + (customTime % 1.0) * 12.), half2(127.1, 311.7))) * 43758.5453123) + offset) % 1.0; + } + //----------------------------------------------------------------------- + + + void Ext_ModifyVertex0 (inout VertexData v, inout ExtraV2F d) + { + //BILBOARD_ON + #if BILBOARD_ON + half3 camRight = mul((half3x3)unity_CameraToWorld, half3(1,0,0)); + half3 camUp = half3(0,1,0); + #if BILBOARDY_ON + camUp = mul((half3x3)unity_CameraToWorld, half3(0,1,0)); + #endif + half3 localPos = v.vertex.x * camRight + v.vertex.y * camUp; + v.vertex = half4(localPos, 1); + #endif + //----------------------------------------------------------- + + v.texcoord0.xy = TRANSFORM_TEX(v.texcoord0.xy, _MainTex); + half2 center = half2(0.5, 0.5); + #if ATLAS_ON + center = half2((_MaxXUV + _MinXUV) / 2.0, (_MaxYUV + _MinYUV) / 2.0); + #endif + + //POLARUV_ON + #if POLARUV_ON + v.texcoord0.xy = v.texcoord0.xy - center; + #endif + + //---------------------------------------- + + //ROTATEUV_ON + #if ROTATEUV_ON + half2 uvC = v.texcoord0.xy; + half cosAngle = cos(_RotateUvAmount); + half sinAngle = sin(_RotateUvAmount); + half2x2 rot = half2x2(cosAngle, -sinAngle, sinAngle, cosAngle); + uvC -= center; + v.texcoord0.xy = mul(rot, uvC); + v.texcoord0.xy += center; + #endif + //-------------------- + + #if RECTSIZE_ON + v.vertex.xyz += (v.vertex.xyz * (_RectSize - 1.0)); + #endif + + #if OUTTEX_ON + v.texcoord1.xy = TRANSFORM_TEX(v.texcoord0.xy, _OutlineTex); + #endif + + #if OUTDIST_ON + v.texcoord2.xy = TRANSFORM_TEX(v.texcoord0.xy, _OutlineDistortTex); + #endif + + #if DISTORT_ON + v.texcoord3.xy = TRANSFORM_TEX(v.texcoord0.xy, _DistortTex); + #endif + } + + void Ext_SurfaceFunction0 (inout Surface o, ShaderData d) + { + half randomSeed = _RandomSeed; + + float2 uvRect = d.texcoord0; + half2 center = half2(0.5, 0.5); + #if ATLAS_ON + center = half2((_MaxXUV + _MinXUV) / 2.0, (_MaxYUV + _MinYUV) / 2.0); + uvRect = half2((d.texcoord0.x - _MinXUV) / (_MaxXUV - _MinXUV), (d.texcoord0.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half2 centerTiled = half2(center.x * _MainTex_ST.x, center.y * _MainTex_ST.y); + + //CLIPPING_ON + #if CLIPPING_ON + half2 tiledUv = half2(d.texcoord0.x / _MainTex_ST.x, d.texcoord0.y / _MainTex_ST.y); + #if ATLAS_ON + tiledUv = half2((tiledUv.x - _MinXUV) / (_MaxXUV - _MinXUV), (tiledUv.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + clip((1 - _ClipUvUp) - tiledUv.y); + clip(tiledUv.y - _ClipUvDown); + clip((1 - _ClipUvRight) - tiledUv.x); + clip(tiledUv.x - _ClipUvLeft); + #endif + //---------------------------------- + + //RADIALCLIPPING_ON + #if RADIALCLIPPING_ON + half2 tiledUv2 = half2(d.texcoord0.x / _MainTex_ST.x, d.texcoord0.y / _MainTex_ST.y); + #if ATLAS_ON + tiledUv2 = half2((tiledUv2.x - _MinXUV) / (_MaxXUV - _MinXUV), (tiledUv2.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half startAngle = _RadialStartAngle - _RadialClip; + half endAngle = _RadialStartAngle + _RadialClip2; + half offset0 = clamp(0, 360, startAngle + 360); + half offset360 = clamp(0, 360, endAngle - 360); + half2 atan2Coord = half2(lerp(-1, 1, tiledUv2.x), lerp(-1, 1, tiledUv2.y)); + half atanAngle = atan2(atan2Coord.y, atan2Coord.x) * 57.3; // angle in degrees + if(atanAngle < 0) atanAngle = 360 + atanAngle; + if(atanAngle >= startAngle && atanAngle <= endAngle) discard; + if(atanAngle <= offset360) discard; + if(atanAngle >= offset0) discard; + #endif + + //----------------------------- + + //TEXTURESCROLL_ON && ATLAS_ON + #if TEXTURESCROLL_ON && ATLAS_ON + d.texcoord0.xy = half2(_MinXUV + ((_MaxXUV - _MinXUV) * (abs(((_Time.y + randomSeed) * _TextureScrollXSpeed) + uvRect.x) % 1)), + _MinYUV + ((_MaxYUV - _MinYUV) * (abs(((_Time.y + randomSeed) * _TextureScrollYSpeed) + uvRect.y) % 1))); + #endif + //---------------------------- + + //OFFSETUV_ON + #if OFFSETUV_ON + #if ATLAS_ON + d.texcoord0.xy = half2(_MinXUV + ((_MaxXUV - _MinXUV) * (abs((_OffsetUvX + uvRect.x) % 1))), + _MinYUV + ((_MaxYUV - _MinYUV) * (abs(_OffsetUvY + uvRect.y) % 1))); + #else + d.texcoord0.xy += half2(_OffsetUvX, _OffsetUvY); + #endif + #endif + + //---------------------- + + //POLARUV_ON + #if POLARUV_ON + d.texcoord0.xy = half2(atan2(d.texcoord0.y, d.texcoord0.x) / (2.0f * 3.141592653589f), length(d.texcoord0.xy)); + d.texcoord0.xy *= _MainTex_ST.xy; + #endif + + //-------------------------------------- + + //TWISTUV_ON + #if TWISTUV_ON + #if ATLAS_ON + _TwistUvPosX = ((_MaxXUV - _MinXUV) * _TwistUvPosX) + _MinXUV; + _TwistUvPosY = ((_MaxYUV - _MinYUV) * _TwistUvPosY) + _MinYUV; + #endif + half2 tempUv = d.texcoord0.xy - half2(_TwistUvPosX * _MainTex_ST.x, _TwistUvPosY * _MainTex_ST.y); + _TwistUvRadius *= (_MainTex_ST.x + _MainTex_ST.y) / 2; + half percent = (_TwistUvRadius - length(tempUv)) / _TwistUvRadius; + half theta = percent * percent * (2.0 * sin(_TwistUvAmount)) * 8.0; + half s = sin(theta); + half c = cos(theta); + half beta = max(sign(_TwistUvRadius - length(tempUv)), 0.0); + tempUv = half2(dot(tempUv, half2(c, -s)), dot(tempUv, half2(s, c))) * beta + tempUv * (1 - beta); + tempUv += half2(_TwistUvPosX * _MainTex_ST.x, _TwistUvPosY * _MainTex_ST.y); + d.texcoord0.xy = tempUv; + #endif + + //-------------------------------------------- + + //FISHEYE_ON + #if FISHEYE_ON + half bind = length(centerTiled); + half2 dF = d.texcoord0.xy - centerTiled; + half dFlen = length(dF); + half fishInt = (3.14159265359 / bind) * (_FishEyeUvAmount + 0.001); + d.texcoord0.xy = centerTiled + (dF / (max(0.0001, dFlen))) * tan(dFlen * fishInt) * bind / tan(bind * fishInt); + #endif + //--------------------------------------------- + + //PINCH_ON + #if PINCH_ON + half2 dP = d.texcoord0.xy - centerTiled; + half pinchInt = (3.141592 / length(centerTiled)) * (-_PinchUvAmount + 0.001); + d.texcoord0.xy = centerTiled + normalize(dP) * atan(length(dP) * -pinchInt * 10.0) * 0.5 / atan(-pinchInt * 5); + #endif + + //--------------------------------------------- + + //ZOOMUV_ON + #if ZOOMUV_ON + d.texcoord0.xy -= centerTiled; + d.texcoord0.xy = d.texcoord0.xy * _ZoomUvAmount; + d.texcoord0.xy += centerTiled; + #endif + + //----------------------------------------------- + + //DOODLE_ON + #if DOODLE_ON + half2 uvCopy = uvRect; + _HandDrawnSpeed = (floor((_Time.x + randomSeed) * 20 * _HandDrawnSpeed) / _HandDrawnSpeed) * _HandDrawnSpeed; + uvCopy.x = sin((uvCopy.x * _HandDrawnAmount + _HandDrawnSpeed) * 4); + uvCopy.y = cos((uvCopy.y * _HandDrawnAmount + _HandDrawnSpeed) * 4); + d.texcoord0.xy = lerp(d.texcoord0.xy, d.texcoord0.xy + uvCopy, 0.0005 * _HandDrawnAmount); + #endif + + //-------------------------- + + //SHAKEUV_ON + #if SHAKEUV_ON + half xShake = sin((_Time.x + randomSeed) * _ShakeUvSpeed * 50) * _ShakeUvX; + half yShake = cos((_Time.x + randomSeed) * _ShakeUvSpeed * 50) * _ShakeUvY; + d.texcoord0.xy += half2(xShake * 0.012, yShake * 0.01); + #endif + + //------------------------------------------- + + //RECTSIZE_ON + #if RECTSIZE_ON + d.texcoord0.xy = d.texcoord0.xy * (_RectSize).xx + (((-_RectSize * 0.5) + 0.5)).xx; + #endif + + //------------------------------------------- + + //DISTORT_ON + #if DISTORT_ON + #if ATLAS_ON + d.texcoord3.x = d.texcoord3.x * (1 / (_MaxXUV - _MinXUV)); + d.texcoord3.y = d.texcoord3.y * (1 / (_MaxYUV - _MinYUV)); + #endif + + d.texcoord3.x += ((_Time.x + _RandomSeed) * _DistortTexXSpeed) % 1; + d.texcoord3.y += ((_Time.x + _RandomSeed) * _DistortTexYSpeed) % 1; + half distortAmnt = (SAMPLE_TEXTURE2D(_DistortTex, sampler_DistortTex, d.texcoord3.xy).r - 0.5) * 0.2 * _DistortAmount; + d.texcoord0.x += distortAmnt; + d.texcoord0.y += distortAmnt; + #endif + //------------------------------------------------------- + + //WARP_ON + #if WARP_ON + half2 warpUv = half2(d.texcoord0.x / _MainTex_ST.x, d.texcoord0.y / _MainTex_ST.y); + #if ATLAS_ON + warpUv = half2((warpUv.x - _MinXUV) / (_MaxXUV - _MinXUV), (warpUv.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + const float tau = 6.283185307179586; + float xWarp = (_Time.y + randomSeed) * _WarpSpeed + warpUv.x * tau / _WarpScale; + float yWarp = (_Time.y + randomSeed) * _WarpSpeed + warpUv.y * tau / _WarpScale; + float2 warp = float2(sin(xWarp), sin(yWarp)) * _WarpStrength; + d.texcoord0.xy += warp; + #endif + + //------------------------------------------------------- + + //WAVEUV_ON + #if WAVEUV_ON + float2 uvWave = half2(_WaveX * _MainTex_ST.x, _WaveY * _MainTex_ST.y) - d.texcoord0.xy; + uvWave %= 1; + #if ATLAS_ON + uvWave = half2(_WaveX, _WaveY) - uvRect; + #endif + uvWave.x *= _ScreenParams.x / _ScreenParams.y; + float waveTime = _Time.y + randomSeed; + float angWave = (sqrt(dot(uvWave, uvWave)) * _WaveAmount) - ((waveTime * _WaveSpeed)); + d.texcoord0.xy = d.texcoord0.xy + uvWave * sin(angWave) * (_WaveStrength / 1000.0); + #endif + //---------------------------------------------------- + + //ROUNDWAVEUV_ON + #if ROUNDWAVEUV_ON + half xWave = ((0.5 * _MainTex_ST.x) - uvRect.x); + half yWave = ((0.5 * _MainTex_ST.y) - uvRect.y) * (_MainTex_TexelSize.w / _MainTex_TexelSize.z); + half ripple = -sqrt(xWave*xWave + yWave* yWave); + d.texcoord0.xy += (sin((ripple + (_Time.y + randomSeed) * (_RoundWaveSpeed/10.0)) / 0.015) * (_RoundWaveStrength/10.0)) % 1; + #endif + //---------------------------------------------------- + + + //WIND_ON + #if WIND_ON + half windOffset = sin((_Time.x + randomSeed) * _GrassSpeed * 10); + half2 windCenter = half2(0.5, 0.1); + #if ATLAS_ON + windCenter.x = ((_MaxXUV - _MinXUV) * windCenter.x) + _MinXUV; + windCenter.y = ((_MaxYUV - _MinYUV) * windCenter.y) + _MinYUV; + #endif + #if !MANUALWIND_ON + d.texcoord0.x = fmod(abs(lerp(d.texcoord0.x, d.texcoord0.x + (_GrassWind * 0.01 * windOffset), uvRect.y)), 1); + #else + d.texcoord0.x = fmod(abs(lerp(d.texcoord0.x, d.texcoord0.x + (_GrassWind * 0.01 * _GrassManualAnim), uvRect.y)), 1); + windOffset = _GrassManualAnim; + #endif + half2 delta = d.texcoord0.xy - windCenter; + half delta2 = dot(delta.xy, delta.xy); + half2 delta_offset = delta2 * windOffset; + d.texcoord0.xy = d.texcoord0.xy + half2(delta.y, -delta.x) * delta_offset * _GrassRadialBend; + #endif + + //-------------------------------------------------------- + + //TEXTURESCROLL_ON && !ATLAS_ON + #if TEXTURESCROLL_ON && !ATLAS_ON + d.texcoord0.x += ((_Time.y + randomSeed) * _TextureScrollXSpeed) % 1; + d.texcoord0.y += ((_Time.y + randomSeed) * _TextureScrollYSpeed) % 1; + #endif + //------------------------------ + + //PIXELATE_ON + #if PIXELATE_ON + half aspectRatio = _MainTex_TexelSize.x / _MainTex_TexelSize.y; + half2 pixelSize = float2(_PixelateSize, _PixelateSize * aspectRatio); + d.texcoord0.xy = floor(d.texcoord0.xy * pixelSize) / pixelSize; + #endif + //-------------- + + half4 col = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy); + half originalAlpha = col.a; + col *= d.vertexColor; + + //NORMAL MAP + #if NORMALMAP_ON + half4 normalSample = SAMPLE_TEXTURE2D(_NormalMap, sampler_NormalMap, d.texcoord0.xy); + half3 normalTS = UnpackNormal(normalSample); + normalTS.xy *= _NormalStrength; + o.Normal = normalTS; + #endif + + + //GLITCH_ON + #if GLITCH_ON + half2 uvGlitch = uvRect; + uvGlitch.y -= 0.5; + half lineNoise = pow(rand2(floor(uvGlitch * half2(24., 19.) * _GlitchSize) * 4.0, randomSeed), 3.0) * _GlitchAmount + * pow(rand2(floor(uvGlitch * half2(38., 14.) * _GlitchSize) * 4.0, randomSeed), 3.0); + col = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(lineNoise * 0.02 * rand2(half2(2.0, 1), randomSeed), 0)) * d.vertexColor; + #endif + //-------------------------------------- + + //CHROMABERR_ON + #if CHROMABERR_ON + half4 r = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(_ChromAberrAmount/10, 0)) * d.vertexColor; + half4 b = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(-_ChromAberrAmount/10, 0)) * d.vertexColor; + col = half4(r.r * r.a, col.g, b.b * b.a, max(max(r.a, b.a) * _ChromAberrAlpha, col.a)); + #endif + + //-------------------------------- + + //BLUR_ON + #if BLUR_ON + #if ATLAS_ON + #if !BLURISHD_ON + col = BlurHD(d.texcoord0.xy, _MainTex, sampler_MainTex, _BlurIntensity, (_MaxXUV - _MinXUV), (_MaxYUV - _MinYUV)) * d.vertexColor; + #else + col = Blur(d.texcoord0.xy, _MainTex, sampler_MainTex, _BlurIntensity * (_MaxXUV - _MinXUV)) * d.vertexColor; + #endif + #else + #if !BLURISHD_ON + col = BlurHD(d.texcoord0.xy, _MainTex, sampler_MainTex, _BlurIntensity, 1, 1) * d.vertexColor; + #else + col = Blur(d.texcoord0.xy, _MainTex, sampler_MainTex, _BlurIntensity) * d.vertexColor; + #endif + #endif + #endif + + //-------------------- + + //MOTIONBLUR_ON + #if MOTIONBLUR_ON + _MotionBlurAngle = _MotionBlurAngle * 3.1415926; + #define rot(n) mul(n, half2x2(cos(_MotionBlurAngle), -sin(_MotionBlurAngle), sin(_MotionBlurAngle), cos(_MotionBlurAngle))) + _MotionBlurDist = _MotionBlurDist * 0.005; + #if ATLAS_ON + _MotionBlurDist *= (_MaxXUV - _MinXUV); + #endif + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(-_MotionBlurDist, -_MotionBlurDist))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(-_MotionBlurDist * 2, -_MotionBlurDist * 2))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(-_MotionBlurDist * 3, -_MotionBlurDist * 3))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(-_MotionBlurDist * 4, -_MotionBlurDist * 4))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(_MotionBlurDist, _MotionBlurDist))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(_MotionBlurDist * 2, _MotionBlurDist * 2))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(_MotionBlurDist * 3, _MotionBlurDist * 3))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(_MotionBlurDist * 4, _MotionBlurDist * 4))); + col.rgb = col.rgb / 9; + #endif + //------------------------------------ + + //NEGATIVE_ON + #if NEGATIVE_ON + col.rgb = lerp(col.rgb, 1 - col.rgb, _NegativeAmount); + #endif + + //-------------- + half luminance = 0; + + //GREYSCALE_ON && !GREYSCALEOUTLINE_ON + #if GREYSCALE_ON && !GREYSCALEOUTLINE_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + luminance = saturate(luminance + _GreyscaleLuminosity); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _GreyscaleTintColor, _GreyscaleBlend); + #endif + //------------------------------------ + + //GHOST_ON + #if GHOST_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + half4 ghostResult; + ghostResult.a = saturate(luminance - _GhostTransparency) * col.a; + ghostResult.rgb = col.rgb * (luminance + _GhostColorBoost); + col = lerp(col, ghostResult, _GhostBlend); + #endif + //------------------------------------ + + //INNEROUTLINE_ON + #if INNEROUTLINE_ON + half3 innerT = abs(GetPixel(0, _InnerOutlineThickness, d.texcoord0.xy, _MainTex, sampler_MainTex) - GetPixel(0, -_InnerOutlineThickness, d.texcoord0.xy, _MainTex, sampler_MainTex)); + innerT += abs(GetPixel(_InnerOutlineThickness, 0, d.texcoord0.xy, _MainTex, sampler_MainTex) - GetPixel(-_InnerOutlineThickness, 0, d.texcoord0.xy, _MainTex, sampler_MainTex)); + #if !ONLYINNEROUTLINE_ON + innerT = (innerT / 2.0) * col.a * _InnerOutlineAlpha; + col.rgb += length(innerT) * _InnerOutlineColor.rgb * _InnerOutlineGlow; + #else + innerT *= col.a * _InnerOutlineAlpha; + col.rgb = length(innerT) * _InnerOutlineColor.rgb * _InnerOutlineGlow; + col.a = step(0.3, col.r+col.g+col.b); + #endif + #endif + //------------------------------------------------------- + + //HITEFFECT_ON + #if HITEFFECT_ON + col.rgb = lerp(col.rgb, _HitEffectColor.rgb * _HitEffectGlow, _HitEffectBlend); + #endif + //-------------------- + + //GRADIENT_ON + #if GRADIENT_ON + half2 tiledUvGrad = half2(uvRect.x / _MainTex_ST.x, uvRect.y / _MainTex_ST.y); + #if GRADIENT2COL_ON + _GradTopRightCol = _GradTopLeftCol; + _GradBotRightCol = _GradBotLeftCol; + #endif + #if RADIALGRADIENT_ON + half radialDist = 1 - length(tiledUvGrad - half2(0.5, 0.5)); + radialDist *= (_MainTex_TexelSize.w / _MainTex_TexelSize.z); + radialDist = saturate(_GradBoostX * radialDist); + half4 gradientResult = lerp(_GradTopLeftCol, _GradBotLeftCol, radialDist); + #else + half gradXLerpFactor = saturate(pow(tiledUvGrad.x, _GradBoostX)); + half4 gradientResult = lerp(lerp(_GradBotLeftCol, _GradBotRightCol, gradXLerpFactor), + lerp(_GradTopLeftCol, _GradTopRightCol, gradXLerpFactor), saturate(pow(tiledUvGrad.y, _GradBoostY))); + #endif + gradientResult = lerp(col, gradientResult, _GradBlend); + col.rgb = gradientResult.rgb * col.a; + col.a *= gradientResult.a; + #endif + //-------------------------------------------------------------------- + + //CONTRAST_ON + #if CONTRAST_ON + col.rgb = (col.rgb - float3(0.5, 0.5, 0.5)) * _Contrast + float3(0.5, 0.5, 0.5); + col.rgb += _Brightness; + #endif + + //------------------------------------------------------------------- + + //COLORSWAP_ON + #if COLORSWAP_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + half4 swapMask = SAMPLE_TEXTURE2D(_ColorSwapTex, sampler_ColorSwapTex, d.texcoord0.xy); + swapMask.rgb *= swapMask.a; + half3 redSwap = _ColorSwapRed * swapMask.r * saturate(luminance + _ColorSwapRedLuminosity); + half3 greenSwap = _ColorSwapGreen * swapMask.g * saturate(luminance + _ColorSwapGreenLuminosity); + half3 blueSwap = _ColorSwapBlue * swapMask.b * saturate(luminance + _ColorSwapBlueLuminosity); + swapMask.rgb = col.rgb * saturate(1 - swapMask.r - swapMask.g - swapMask.b); + col.rgb = lerp(col.rgb, swapMask.rgb + redSwap + greenSwap + blueSwap, _ColorSwapBlend); + #endif + //-------------------------------------------------------------------- + + //COLORRAMP_ON && !COLORRAMPOUTLINE_ON + #if COLORRAMP_ON && !COLORRAMPOUTLINE_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + luminance = saturate(luminance + _ColorRampLuminosity); + #if GRADIENTCOLORRAMP_ON + col.rgb = lerp(col.rgb, SAMPLE_TEXTURE2D(_ColorRampTexGradient, sampler_ColorRampTexGradient, half2(luminance, 0)).rgb, _ColorRampBlend); + #else + col.rgb = lerp(col.rgb, SAMPLE_TEXTURE2D(_ColorRampTex, sampler_ColorRampTex, half2(luminance, 0)).rgb, _ColorRampBlend); + #endif + #endif + //-------------------------------------------------------------------- + + //CHANGECOLOR_ON + #if CHANGECOLOR_ON + float3 currChangeColor = saturate(col.rgb); + luminance = 0.3 * currChangeColor.r + 0.59 * currChangeColor.g + 0.11 * currChangeColor.b; + luminance = saturate(luminance + _ColorChangeLuminosity); + half3 dif = abs(currChangeColor - _ColorChangeTarget.rgb); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _ColorChangeNewCol.rgb, + max(sign(1 - saturate(dif.x + dif.y + dif.z) - _ColorChangeTolerance), 0.0)); + #if CHANGECOLOR2_ON + dif = abs(currChangeColor - _ColorChangeTarget2.rgb); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _ColorChangeNewCol2.rgb, + max(sign(1 - saturate(dif.x + dif.y + dif.z) - _ColorChangeTolerance2), 0.0)); + #endif + #if CHANGECOLOR3_ON + dif = abs(currChangeColor - _ColorChangeTarget3.rgb); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _ColorChangeNewCol3.rgb, + max(sign(1 - saturate(dif.x + dif.y + dif.z) - _ColorChangeTolerance3), 0.0)); + #endif + #endif + //------------------------------------------------------- + + //POSTERIZE_ON && !POSTERIZEOUTLINE_ON + #if POSTERIZE_ON && !POSTERIZEOUTLINE_ON + col.rgb = pow(col.rgb, _PosterizeGamma) * _PosterizeNumColors; + col.rgb = floor(col.rgb) / _PosterizeNumColors; + col.rgb = pow(col.rgb, 1.0 / _PosterizeGamma); + #endif + //------------------------------------ + + //HSV_ON + #if HSV_ON + half3 resultHsv = half3(col.rgb); + half cosHsv = _HsvBright * _HsvSaturation * cos(_HsvShift * 3.14159265 / 180); + half sinHsv = _HsvBright * _HsvSaturation * sin(_HsvShift * 3.14159265 / 180); + resultHsv.x = (.299 * _HsvBright + .701 * cosHsv + .168 * sinHsv) * col.x + + (.587 * _HsvBright - .587 * cosHsv + .330 * sinHsv) * col.y + + (.114 * _HsvBright - .114 * cosHsv - .497 * sinHsv) * col.z; + resultHsv.y = (.299 * _HsvBright - .299 * cosHsv - .328 * sinHsv) *col.x + + (.587 * _HsvBright + .413 * cosHsv + .035 * sinHsv) * col.y + + (.114 * _HsvBright - .114 * cosHsv + .292 * sinHsv) * col.z; + resultHsv.z = (.299 * _HsvBright - .3 * cosHsv + 1.25 * sinHsv) * col.x + + (.587 * _HsvBright - .588 * cosHsv - 1.05 * sinHsv) * col.y + + (.114 * _HsvBright + .886 * cosHsv - .203 * sinHsv) * col.z; + col.rgb = resultHsv; + #endif + //------------------------------------------------------- + + //OVERLAY_ON + #if OVERLAY_ON + half2 overlayUvs = d.texcoord0.xy; + overlayUvs.x += ((_Time.y + randomSeed) * _OverlayTextureScrollXSpeed) % 1; + overlayUvs.y += ((_Time.y + randomSeed) * _OverlayTextureScrollYSpeed) % 1; + half4 overlayCol = SAMPLE_TEXTURE2D(_OverlayTex, sampler_OverlayTex, TRANSFORM_TEX(overlayUvs, _OverlayTex)); + overlayCol.rgb *= _OverlayColor.rgb * _OverlayGlow; + #if !OVERLAYMULT_ON + overlayCol.rgb *= overlayCol.a * _OverlayColor.rgb * _OverlayColor.a * _OverlayBlend; + col.rgb += overlayCol.rgb; + #else + overlayCol.a *= _OverlayColor.a; + col = lerp(col, col * overlayCol, _OverlayBlend); + #endif + #endif + + //--------------------------------- + + //OUTBASE_ON + #if OUTBASE_ON + #if OUTBASEPIXELPERF_ON + half2 destUv = half2(_OutlinePixelWidth * _MainTex_TexelSize.x, _OutlinePixelWidth * _MainTex_TexelSize.y); + #else + half2 destUv = half2(_OutlineWidth * _MainTex_TexelSize.x * 200, _OutlineWidth * _MainTex_TexelSize.y * 200); + #endif + + #if OUTDIST_ON + d.texcoord3.x += ((_Time.x + _RandomSeed) * _OutlineDistortTexXSpeed) % 1; + d.texcoord3.y += ((_Time.x + _RandomSeed) * _OutlineDistortTexYSpeed) % 1; + #if ATLAS_ON + d.texcoord3 = half2((d.texcoord3.x - _MinXUV) / (_MaxXUV - _MinXUV), (d.texcoord3.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half outDistortAmnt = (SAMPLE_TEXTURE2D(_OutlineDistortTex, sampler_OutlineDistortTex, d.texcoord3).r - 0.5) * 0.2 * _OutlineDistortAmount; + destUv.x += outDistortAmnt; + destUv.y += outDistortAmnt; + #endif + + half spriteLeft = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(destUv.x, 0)).a; + half spriteRight = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy - half2(destUv.x, 0)).a; + half spriteBottom = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(0, destUv.y)).a; + half spriteTop = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy - half2(0, destUv.y)).a; + half result = spriteLeft + spriteRight + spriteBottom + spriteTop; + + #if OUTBASE8DIR_ON + half spriteTopLeft = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(destUv.x, destUv.y)).a; + half spriteTopRight = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(-destUv.x, destUv.y)).a; + half spriteBotLeft = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(destUv.x, -destUv.y)).a; + half spriteBotRight = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(-destUv.x, -destUv.y)).a; + result = result + spriteTopLeft + spriteTopRight + spriteBotLeft + spriteBotRight; + #endif + + result = step(0.05, saturate(result)); + + #if OUTTEX_ON + d.texcoord1.x += ((_Time.x + _RandomSeed) * _OutlineTexXSpeed) % 1; + d.texcoord1.y += ((_Time.x + _RandomSeed) * _OutlineTexYSpeed) % 1; + #if ATLAS_ON + d.texcoord1 = half2((d.texcoord1.x - _MinXUV) / (_MaxXUV - _MinXUV), (d.texcoord1.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half4 tempOutColor = SAMPLE_TEXTURE2D(_OutlineTex, sampler_OutlineTex, d.texcoord1); + tempOutColor *= _OutlineColor; + _OutlineColor = tempOutColor; + #endif + + result *= (1 - originalAlpha) * _OutlineAlpha; + + half4 outline = _OutlineColor * d.vertexColor.a; + outline.rgb *= _OutlineGlow; + outline.a = result; + #if ONLYOUTLINE_ON + col = outline; + #else + col = lerp(col, outline, result); + #endif + #endif + //------------------------------------------------------- + + //FADE_ON + #if FADE_ON + half2 tiledUvFade1 = TRANSFORM_TEX(d.texcoord0, _FadeTex); + half2 tiledUvFade2 = TRANSFORM_TEX(d.texcoord0, _FadeBurnTex); + #if ATLAS_ON + tiledUvFade1 = half2((tiledUvFade1.x - _MinXUV) / (_MaxXUV - _MinXUV), (tiledUvFade1.y - _MinYUV) / (_MaxYUV - _MinYUV)); + tiledUvFade2 = half2((tiledUvFade2.x - _MinXUV) / (_MaxXUV - _MinXUV), (tiledUvFade2.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half fadeTemp = SAMPLE_TEXTURE2D(_FadeTex, sampler_FadeTex, tiledUvFade1).r; + half fade = smoothstep(_FadeAmount, _FadeAmount + _FadeBurnTransition, fadeTemp); + half fadeBurn = saturate(smoothstep(_FadeAmount - _FadeBurnWidth, _FadeAmount - _FadeBurnWidth + 0.1, fadeTemp) * _FadeAmount); + col.a *= fade; + _FadeBurnColor.rgb *= _FadeBurnGlow; + col += fadeBurn * SAMPLE_TEXTURE2D(_FadeBurnTex, sampler_FadeBurnTex, tiledUvFade2) * _FadeBurnColor * originalAlpha * (1 - col.a); + #endif + //------------------------------------------------------- + + //SHADOW_ON + #if SHADOW_ON + half shadowA = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(_ShadowX, _ShadowY)).a; + half preMultShadowMask = 1 - (saturate(shadowA - col.a) * (1 - col.a)); + col.rgb *= 1 - ((shadowA - col.a) * (1 - col.a)); + col.rgb += (_ShadowColor * shadowA) * (1 - col.a); + col.a = max(shadowA * _ShadowAlpha * d.vertexColor.a, col.a); + #endif + + //------------------------------------------------------- + + //GLOW_ON + #if GLOW_ON + half4 emission; + #if GLOWTEX_ON + emission = SAMPLE_TEXTURE2D(_GlowTex, sampler_GlowTex, d.texcoord0); + #else + emission = col; + #endif + + col.rgb *= _GlowGlobal; + emission.rgb *= emission.a * col.a * _Glow * _GlowColor; + col.rgb += emission.rgb; + #endif + //------------------------------------------------------- + + //COLORRAMP_ON && COLORRAMPOUTLINE_ON + #if COLORRAMP_ON && COLORRAMPOUTLINE_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + luminance = saturate(luminance + _ColorRampLuminosity); + #if GRADIENTCOLORRAMP_ON + col.rgb = lerp(col.rgb, SAMPLE_TEXTURE2D(_ColorRampTexGradient, sampler_ColorRampTexGradient, half2(luminance, 0)).rgb, _ColorRampBlend); + #else + col.rgb = lerp(col.rgb, SAMPLE_TEXTURE2D(_ColorRampTex, sampler_ColorRampTex, half2(luminance, 0)).rgb, _ColorRampBlend); + #endif + #endif + //--------------- + + //GREYSCALE_ON && GREYSCALEOUTLINE_ON + #if GREYSCALE_ON && GREYSCALEOUTLINE_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + luminance = saturate(luminance + _GreyscaleLuminosity); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _GreyscaleTintColor, _GreyscaleBlend); + #endif + + //----------------------------------- + + //POSTERIZE_ON && POSTERIZEOUTLINE_ON + #if POSTERIZE_ON && POSTERIZEOUTLINE_ON + col.rgb = pow(col.rgb, _PosterizeGamma) * _PosterizeNumColors; + col.rgb = floor(col.rgb) / _PosterizeNumColors; + col.rgb = pow(col.rgb, 1.0 / _PosterizeGamma); + #endif + + //----------------------------------- + + //SHINE_ON + #if SHINE_ON + half2 uvShine = uvRect; + half cosAngle = cos(_ShineRotate); + half sinAngle = sin(_ShineRotate); + half2x2 rot = half2x2(cosAngle, -sinAngle, sinAngle, cosAngle); + uvShine -= half2(0.5, 0.5); + uvShine = mul(rot, uvShine); + uvShine += half2(0.5, 0.5); + half shineMask = SAMPLE_TEXTURE2D(_ShineMask, sampler_ShineMask, d.texcoord0.xy).a; + half currentDistanceProjection = (uvShine.x + uvShine.y) / 2; + half whitePower = 1 - (abs(currentDistanceProjection - _ShineLocation) / _ShineWidth); + col.rgb += col.a * whitePower * _ShineGlow * max(sign(currentDistanceProjection - (_ShineLocation - _ShineWidth)), 0.0) + * max(sign((_ShineLocation + _ShineWidth) - currentDistanceProjection), 0.0) * _ShineColor * shineMask; + #endif + + //----------------------------------- + + //HOLOGRAM_ON + #if HOLOGRAM_ON + half totalHologram = _HologramStripesAmount + _HologramUnmodAmount; + half hologramYCoord = ((uvRect.y + (((_Time.x + randomSeed) % 1) * _HologramStripesSpeed)) % totalHologram) / totalHologram; + hologramYCoord = abs(hologramYCoord); + half alpha = RemapFloat(saturate(hologramYCoord - (_HologramUnmodAmount/totalHologram)), 0.0, 1.0, _HologramMinAlpha, saturate(_HologramMaxAlpha)); + half hologramMask = max(sign((_HologramUnmodAmount/totalHologram) - hologramYCoord), 0.0); + half4 hologramResult = col; + hologramResult.a *= lerp(alpha, 1, hologramMask); + hologramResult.rgb *= max(1, _HologramMaxAlpha * max(sign(hologramYCoord - (_HologramUnmodAmount/totalHologram)), 0.0)); + hologramMask = 1 - step(0.01,hologramMask); + hologramResult.rgb += hologramMask * _HologramStripeColor * col.a; + col = lerp(col, hologramResult, _HologramBlend); + #endif + + //----------------------------------- + + //FLICKER_ON + #if FLICKER_ON + col.a *= saturate(col.a * step(frac(0.05 + (_Time.w + randomSeed) * _FlickerFreq), 1 - _FlickerPercent) + _FlickerAlpha); + #endif + //----------------------------------- + + //ALPHACUTOFF_ON + + //ALPHAROUND_ON + + //ALPHAOUTLINE_ON + #if ALPHAOUTLINE_ON + half alphaOutlineRes = pow(1 - col.a, max(_AlphaOutlinePower, 0.0001)) * step(_AlphaOutlineMinAlpha, col.a) * _AlphaOutlineBlend; + col.rgb = lerp(col.rgb, _AlphaOutlineColor.rgb * _AlphaOutlineGlow, alphaOutlineRes); + col.a = lerp(col.a, 1, alphaOutlineRes > 1); + #endif + //------------------------------------------------------- + + //FOG_ON + + //------------------ + + col *= _Color; + o.Albedo = col; + col.a *= _Alpha; + clip(col.a - _AlphaCutoffValue - 0.01); + o.Alpha = _Color.a; + } + + + + + + void ChainSurfaceFunction(inout Surface l, inout ShaderData d) + { + Ext_SurfaceFunction0(l, d); + // Ext_SurfaceFunction1(l, d); + // Ext_SurfaceFunction2(l, d); + // Ext_SurfaceFunction3(l, d); + // Ext_SurfaceFunction4(l, d); + // Ext_SurfaceFunction5(l, d); + // Ext_SurfaceFunction6(l, d); + // Ext_SurfaceFunction7(l, d); + // Ext_SurfaceFunction8(l, d); + // Ext_SurfaceFunction9(l, d); + // Ext_SurfaceFunction10(l, d); + // Ext_SurfaceFunction11(l, d); + // Ext_SurfaceFunction12(l, d); + // Ext_SurfaceFunction13(l, d); + // Ext_SurfaceFunction14(l, d); + // Ext_SurfaceFunction15(l, d); + // Ext_SurfaceFunction16(l, d); + // Ext_SurfaceFunction17(l, d); + // Ext_SurfaceFunction18(l, d); + // Ext_SurfaceFunction19(l, d); + // Ext_SurfaceFunction20(l, d); + // Ext_SurfaceFunction21(l, d); + // Ext_SurfaceFunction22(l, d); + // Ext_SurfaceFunction23(l, d); + // Ext_SurfaceFunction24(l, d); + // Ext_SurfaceFunction25(l, d); + // Ext_SurfaceFunction26(l, d); + // Ext_SurfaceFunction27(l, d); + // Ext_SurfaceFunction28(l, d); + // Ext_SurfaceFunction29(l, d); + } + +#if !_DECALSHADER + + void ChainModifyVertex(inout VertexData v, inout VertexToPixel v2p, float4 time) + { + ExtraV2F d; + + ZERO_INITIALIZE(ExtraV2F, d); + ZERO_INITIALIZE(Blackboard, d.blackboard); + // due to motion vectors in HDRP, we need to use the last + // time in certain spots. So if you are going to use _Time to adjust vertices, + // you need to use this time or motion vectors will break. + d.time = time; + + Ext_ModifyVertex0(v, d); + // Ext_ModifyVertex1(v, d); + // Ext_ModifyVertex2(v, d); + // Ext_ModifyVertex3(v, d); + // Ext_ModifyVertex4(v, d); + // Ext_ModifyVertex5(v, d); + // Ext_ModifyVertex6(v, d); + // Ext_ModifyVertex7(v, d); + // Ext_ModifyVertex8(v, d); + // Ext_ModifyVertex9(v, d); + // Ext_ModifyVertex10(v, d); + // Ext_ModifyVertex11(v, d); + // Ext_ModifyVertex12(v, d); + // Ext_ModifyVertex13(v, d); + // Ext_ModifyVertex14(v, d); + // Ext_ModifyVertex15(v, d); + // Ext_ModifyVertex16(v, d); + // Ext_ModifyVertex17(v, d); + // Ext_ModifyVertex18(v, d); + // Ext_ModifyVertex19(v, d); + // Ext_ModifyVertex20(v, d); + // Ext_ModifyVertex21(v, d); + // Ext_ModifyVertex22(v, d); + // Ext_ModifyVertex23(v, d); + // Ext_ModifyVertex24(v, d); + // Ext_ModifyVertex25(v, d); + // Ext_ModifyVertex26(v, d); + // Ext_ModifyVertex27(v, d); + // Ext_ModifyVertex28(v, d); + // Ext_ModifyVertex29(v, d); + + + // #if %EXTRAV2F0REQUIREKEY% + // v2p.extraV2F0 = d.extraV2F0; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // v2p.extraV2F1 = d.extraV2F1; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // v2p.extraV2F2 = d.extraV2F2; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // v2p.extraV2F3 = d.extraV2F3; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // v2p.extraV2F4 = d.extraV2F4; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // v2p.extraV2F5 = d.extraV2F5; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // v2p.extraV2F6 = d.extraV2F6; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // v2p.extraV2F7 = d.extraV2F7; + // #endif + } + + void ChainModifyTessellatedVertex(inout VertexData v, inout VertexToPixel v2p) + { + ExtraV2F d; + ZERO_INITIALIZE(ExtraV2F, d); + ZERO_INITIALIZE(Blackboard, d.blackboard); + + // #if %EXTRAV2F0REQUIREKEY% + // d.extraV2F0 = v2p.extraV2F0; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // d.extraV2F1 = v2p.extraV2F1; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // d.extraV2F2 = v2p.extraV2F2; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // d.extraV2F3 = v2p.extraV2F3; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // d.extraV2F4 = v2p.extraV2F4; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // d.extraV2F5 = v2p.extraV2F5; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // d.extraV2F6 = v2p.extraV2F6; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // d.extraV2F7 = v2p.extraV2F7; + // #endif + + + // Ext_ModifyTessellatedVertex0(v, d); + // Ext_ModifyTessellatedVertex1(v, d); + // Ext_ModifyTessellatedVertex2(v, d); + // Ext_ModifyTessellatedVertex3(v, d); + // Ext_ModifyTessellatedVertex4(v, d); + // Ext_ModifyTessellatedVertex5(v, d); + // Ext_ModifyTessellatedVertex6(v, d); + // Ext_ModifyTessellatedVertex7(v, d); + // Ext_ModifyTessellatedVertex8(v, d); + // Ext_ModifyTessellatedVertex9(v, d); + // Ext_ModifyTessellatedVertex10(v, d); + // Ext_ModifyTessellatedVertex11(v, d); + // Ext_ModifyTessellatedVertex12(v, d); + // Ext_ModifyTessellatedVertex13(v, d); + // Ext_ModifyTessellatedVertex14(v, d); + // Ext_ModifyTessellatedVertex15(v, d); + // Ext_ModifyTessellatedVertex16(v, d); + // Ext_ModifyTessellatedVertex17(v, d); + // Ext_ModifyTessellatedVertex18(v, d); + // Ext_ModifyTessellatedVertex19(v, d); + // Ext_ModifyTessellatedVertex20(v, d); + // Ext_ModifyTessellatedVertex21(v, d); + // Ext_ModifyTessellatedVertex22(v, d); + // Ext_ModifyTessellatedVertex23(v, d); + // Ext_ModifyTessellatedVertex24(v, d); + // Ext_ModifyTessellatedVertex25(v, d); + // Ext_ModifyTessellatedVertex26(v, d); + // Ext_ModifyTessellatedVertex27(v, d); + // Ext_ModifyTessellatedVertex28(v, d); + // Ext_ModifyTessellatedVertex29(v, d); + + // #if %EXTRAV2F0REQUIREKEY% + // v2p.extraV2F0 = d.extraV2F0; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // v2p.extraV2F1 = d.extraV2F1; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // v2p.extraV2F2 = d.extraV2F2; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // v2p.extraV2F3 = d.extraV2F3; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // v2p.extraV2F4 = d.extraV2F4; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // v2p.extraV2F5 = d.extraV2F5; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // v2p.extraV2F6 = d.extraV2F6; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // v2p.extraV2F7 = d.extraV2F7; + // #endif + } + + void ChainFinalColorForward(inout Surface l, inout ShaderData d, inout half4 color) + { + // Ext_FinalColorForward0(l, d, color); + // Ext_FinalColorForward1(l, d, color); + // Ext_FinalColorForward2(l, d, color); + // Ext_FinalColorForward3(l, d, color); + // Ext_FinalColorForward4(l, d, color); + // Ext_FinalColorForward5(l, d, color); + // Ext_FinalColorForward6(l, d, color); + // Ext_FinalColorForward7(l, d, color); + // Ext_FinalColorForward8(l, d, color); + // Ext_FinalColorForward9(l, d, color); + // Ext_FinalColorForward10(l, d, color); + // Ext_FinalColorForward11(l, d, color); + // Ext_FinalColorForward12(l, d, color); + // Ext_FinalColorForward13(l, d, color); + // Ext_FinalColorForward14(l, d, color); + // Ext_FinalColorForward15(l, d, color); + // Ext_FinalColorForward16(l, d, color); + // Ext_FinalColorForward17(l, d, color); + // Ext_FinalColorForward18(l, d, color); + // Ext_FinalColorForward19(l, d, color); + // Ext_FinalColorForward20(l, d, color); + // Ext_FinalColorForward21(l, d, color); + // Ext_FinalColorForward22(l, d, color); + // Ext_FinalColorForward23(l, d, color); + // Ext_FinalColorForward24(l, d, color); + // Ext_FinalColorForward25(l, d, color); + // Ext_FinalColorForward26(l, d, color); + // Ext_FinalColorForward27(l, d, color); + // Ext_FinalColorForward28(l, d, color); + // Ext_FinalColorForward29(l, d, color); + } + + void ChainFinalGBufferStandard(inout Surface s, inout ShaderData d, inout half4 GBuffer0, inout half4 GBuffer1, inout half4 GBuffer2, inout half4 outEmission, inout half4 outShadowMask) + { + // Ext_FinalGBufferStandard0(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard1(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard2(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard3(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard4(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard5(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard6(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard7(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard8(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard9(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard10(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard11(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard12(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard13(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard14(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard15(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard16(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard17(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard18(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard19(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard20(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard21(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard22(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard23(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard24(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard25(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard26(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard27(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard28(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard29(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + } +#endif + + + + + +#if _DECALSHADER + + ShaderData CreateShaderData(SurfaceDescriptionInputs IN) + { + ShaderData d = (ShaderData)0; + d.TBNMatrix = float3x3(IN.WorldSpaceTangent, IN.WorldSpaceBiTangent, IN.WorldSpaceNormal); + d.worldSpaceNormal = IN.WorldSpaceNormal; + d.worldSpaceTangent = IN.WorldSpaceTangent; + + d.worldSpacePosition = IN.WorldSpacePosition; + d.texcoord0 = IN.uv0.xyxy; + d.screenPos = IN.ScreenPosition; + + d.worldSpaceViewDir = normalize(_WorldSpaceCameraPos - d.worldSpacePosition); + + d.tangentSpaceViewDir = mul(d.TBNMatrix, d.worldSpaceViewDir); + + // these rarely get used, so we back transform them. Usually will be stripped. + #if _HDRP + // d.localSpacePosition = mul(GetWorldToObjectMatrix(), float4(GetCameraRelativePositionWS(d.worldSpacePosition), 1)).xyz; + #else + // d.localSpacePosition = mul(GetWorldToObjectMatrix(), float4(d.worldSpacePosition, 1)).xyz; + #endif + // d.localSpaceNormal = normalize(mul((float3x3)GetWorldToObjectMatrix(), d.worldSpaceNormal)); + // d.localSpaceTangent = normalize(mul((float3x3)GetWorldToObjectMatrix(), d.worldSpaceTangent.xyz)); + + // #if %SCREENPOSREQUIREKEY% + // d.screenUV = (IN.ScreenPosition.xy / max(0.01, IN.ScreenPosition.w)); + // #endif + + return d; + } +#else + + ShaderData CreateShaderData(VertexToPixel i + #if NEED_FACING + , bool facing + #endif + ) + { + ShaderData d = (ShaderData)0; + d.clipPos = i.pos; + d.worldSpacePosition = i.worldPos; + + d.worldSpaceNormal = normalize(i.worldNormal); + d.worldSpaceTangent.xyz = normalize(i.worldTangent.xyz); + + d.tangentSign = i.worldTangent.w * unity_WorldTransformParams.w; + float3 bitangent = cross(d.worldSpaceTangent.xyz, d.worldSpaceNormal) * d.tangentSign; + + d.TBNMatrix = float3x3(d.worldSpaceTangent, -bitangent, d.worldSpaceNormal); + d.worldSpaceViewDir = normalize(_WorldSpaceCameraPos - i.worldPos); + + d.tangentSpaceViewDir = mul(d.TBNMatrix, d.worldSpaceViewDir); + d.texcoord0 = i.texcoord0; + d.texcoord1 = i.texcoord1; + d.texcoord2 = i.texcoord2; + + // #if %TEXCOORD3REQUIREKEY% + d.texcoord3 = i.texcoord3; + // #endif + + // d.isFrontFace = facing; + // #if %VERTEXCOLORREQUIREKEY% + d.vertexColor = i.vertexColor; + // #endif + + // these rarely get used, so we back transform them. Usually will be stripped. + #if _HDRP + // d.localSpacePosition = mul(GetWorldToObjectMatrix(), float4(GetCameraRelativePositionWS(i.worldPos), 1)).xyz; + #else + // d.localSpacePosition = mul(GetWorldToObjectMatrix(), float4(i.worldPos, 1)).xyz; + #endif + // d.localSpaceNormal = normalize(mul((float3x3)GetWorldToObjectMatrix(), i.worldNormal)); + // d.localSpaceTangent = normalize(mul((float3x3)GetWorldToObjectMatrix(), i.worldTangent.xyz)); + + // #if %SCREENPOSREQUIREKEY% + // d.screenPos = i.screenPos; + // d.screenUV = (i.screenPos.xy / i.screenPos.w); + // #endif + + + // #if %EXTRAV2F0REQUIREKEY% + // d.extraV2F0 = i.extraV2F0; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // d.extraV2F1 = i.extraV2F1; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // d.extraV2F2 = i.extraV2F2; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // d.extraV2F3 = i.extraV2F3; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // d.extraV2F4 = i.extraV2F4; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // d.extraV2F5 = i.extraV2F5; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // d.extraV2F6 = i.extraV2F6; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // d.extraV2F7 = i.extraV2F7; + // #endif + + return d; + } + +#endif + + + +#if (SHADERPASS == SHADERPASS_LIGHT_TRANSPORT) + + // This was not in constant buffer in original unity, so keep outiside. But should be in as ShaderRenderPass frequency + float unity_OneOverOutputBoost; + float unity_MaxOutputValue; + + CBUFFER_START(UnityMetaPass) + // x = use uv1 as raster position + // y = use uv2 as raster position + bool4 unity_MetaVertexControl; + + // x = return albedo + // y = return normal + bool4 unity_MetaFragmentControl; + CBUFFER_END + + VertexToPixel Vert(VertexData inputMesh) + { + VertexToPixel output; + ZERO_INITIALIZE(VertexToPixel, output); + UNITY_SETUP_INSTANCE_ID(inputMesh); + UNITY_TRANSFER_INSTANCE_ID(inputMesh, output); + UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(output); + + // Output UV coordinate in vertex shader + float2 uv = float2(0.0, 0.0); + + if (unity_MetaVertexControl.x) + { + uv = inputMesh.texcoord1.xy * unity_LightmapST.xy + unity_LightmapST.zw; + } + else if (unity_MetaVertexControl.y) + { + uv = inputMesh.texcoord2.xy * unity_DynamicLightmapST.xy + unity_DynamicLightmapST.zw; + } + + // OpenGL right now needs to actually use the incoming vertex position + // so we create a fake dependency on it here that haven't any impact. + output.pos = float4(uv * 2.0 - 1.0, inputMesh.vertex.z > 0 ? 1.0e-4 : 0.0, 1.0); + + output.worldPos = TransformObjectToWorld(inputMesh.vertex.xyz).xyz; + + // Normal is required for triplanar mapping + output.worldNormal = TransformObjectToWorldNormal(inputMesh.normal); + // Not required but assign to silent compiler warning + output.worldTangent = float4(1.0, 0.0, 0.0, 0.0); + + output.texcoord0 = inputMesh.texcoord0; + output.texcoord1 = inputMesh.texcoord1; + output.texcoord2 = inputMesh.texcoord2; + // #if %TEXCOORD3REQUIREKEY% + output.texcoord3 = inputMesh.texcoord3; + // #endif + // #if %VERTEXCOLORREQUIREKEY% + output.vertexColor = inputMesh.vertexColor; + // #endif + + return output; + } +#else + + #if (_PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR))) + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/ShaderVariablesMatrixDefsHDCamera.hlsl" + + void MotionVectorPositionZBias(VertexToPixel input) + { + #if UNITY_REVERSED_Z + input.pos.z -= unity_MotionVectorsParams.z * input.pos.w; + #else + input.pos.z += unity_MotionVectorsParams.z * input.pos.w; + #endif + } + + #endif + + VertexToPixel Vert(VertexData input) + { + VertexToPixel output; + ZERO_INITIALIZE(VertexToPixel, output); + + UNITY_SETUP_INSTANCE_ID(input); + UNITY_TRANSFER_INSTANCE_ID(input, output); + UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(output); + + #if _HDRP && (_PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR))) + VertexData previousMesh = input; + #endif + + ChainModifyVertex(input, output, _Time); + + // This return the camera relative position (if enable) + float3 positionRWS = TransformObjectToWorld(input.vertex.xyz); + float3 normalWS = TransformObjectToWorldNormal(input.normal); + float4 tangentWS = float4(TransformObjectToWorldDir(input.tangent.xyz), input.tangent.w); + + + output.worldPos = GetAbsolutePositionWS(positionRWS); + output.pos = TransformWorldToHClip(positionRWS); + output.worldNormal = normalWS; + output.worldTangent = tangentWS; + + + output.texcoord0 = input.texcoord0; + output.texcoord1 = input.texcoord1; + output.texcoord2 = input.texcoord2; + + // #if %TEXCOORD3REQUIREKEY% + output.texcoord3 = input.texcoord3; + // #endif + + // #if %VERTEXCOLORREQUIREKEY% + output.vertexColor = input.vertexColor; + // #endif + + // #if %SCREENPOSREQUIREKEY% + // output.screenPos = ComputeScreenPos(output.pos, _ProjectionParams.x); + // #endif + + #if _HDRP && (_PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR))) + + #if !defined(TESSELLATION_ON) + MotionVectorPositionZBias(output); + #endif + + output.motionVectorCS = mul(UNITY_MATRIX_UNJITTERED_VP, float4(positionRWS.xyz, 1.0)); + // Note: unity_MotionVectorsParams.y is 0 is forceNoMotion is enabled + bool forceNoMotion = unity_MotionVectorsParams.y == 0.0; + if (forceNoMotion) + { + output.previousPositionCS = float4(0.0, 0.0, 0.0, 1.0); + } + else + { + bool hasDeformation = unity_MotionVectorsParams.x > 0.0; // Skin or morph target + + float3 effectivePositionOS = (hasDeformation ? previousMesh.previousPositionOS : previousMesh.vertex.xyz); + #if defined(_ADD_PRECOMPUTED_VELOCITY) + effectivePositionOS -= input.precomputedVelocity; + #endif + + previousMesh.vertex = float4(effectivePositionOS, 1); + VertexToPixel dummy = (VertexToPixel)0; + + + ChainModifyVertex(previousMesh, dummy, _LastTimeParameters); + + // we might need this for skinned objects? + //float3 normalWS = TransformPreviousObjectToWorldNormal(input.normal).xyz; + float3 previousPositionRWS = TransformPreviousObjectToWorld(previousMesh.vertex.xyz); + + #ifdef _WRITE_TRANSPARENT_MOTION_VECTOR + if (_TransparentCameraOnlyMotionVectors > 0) + { + previousPositionRWS = positionRWS.xyz; + } + #endif // _WRITE_TRANSPARENT_MOTION_VECTOR + + output.previousPositionCS = mul(UNITY_MATRIX_PREV_VP, float4(previousPositionRWS, 1.0)); + } + #endif // _HDRP && _PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR)) + + + return output; + } + + +#endif + + + + + + + + #if defined(WRITE_DECAL_BUFFER) && !defined(_DISABLE_DECALS) + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/Decal/DecalPrepassBuffer.hlsl" + #endif + + FragInputs BuildFragInputs(VertexToPixel input) + { + UNITY_SETUP_INSTANCE_ID(input); + FragInputs output; + ZERO_INITIALIZE(FragInputs, output); + + // Init to some default value to make the computer quiet (else it output 'divide by zero' warning even if value is not used). + // TODO: this is a really poor workaround, but the variable is used in a bunch of places + // to compute normals which are then passed on elsewhere to compute other values... + output.tangentToWorld = k_identity3x3; + output.positionSS = input.pos; // input.positionCS is SV_Position + // BETTER SHADERS: because we transform world position into actual world space for things like + // triplanar, etc, we have to back transform it here for lighting + output.positionRWS = GetCameraRelativePositionWS(input.worldPos); + output.tangentToWorld = BuildTangentToWorld(input.worldTangent, input.worldNormal); + output.texCoord0 = input.texcoord0; + output.texCoord1 = input.texcoord1; + output.texCoord2 = input.texcoord2; + + return output; + } + +#if UNITY_VERSION > UNITY_2022_3_12 + void ApplyDecalAndGetNormal(FragInputs fragInputs, PositionInputs posInput, Surface surfaceDescription, float3 normalTS, + inout SurfaceData surfaceData) + { + float3 doubleSidedConstants = GetDoubleSidedConstants(); + + #ifdef DECAL_NORMAL_BLENDING + // SG nodes don't ouptut surface gradients, so if decals require surf grad blending, we have to convert + // the normal to gradient before applying the decal. We then have to resolve the gradient back to world space + normalTS = SurfaceGradientFromTangentSpaceNormalAndFromTBN(normalTS, + fragInputs.tangentToWorld[0], fragInputs.tangentToWorld[1]); + + + #if HAVE_DECALS + if (_EnableDecals) + { + float alpha = 1.0; + alpha = surfaceDescription.Alpha; + + DecalSurfaceData decalSurfaceData = GetDecalSurfaceData(posInput, fragInputs, alpha); + ApplyDecalToSurfaceNormal(decalSurfaceData, fragInputs.tangentToWorld[2], normalTS); + ApplyDecalToSurfaceDataNoNormal(decalSurfaceData, surfaceData); + } + #endif + + GetNormalWS_SG(fragInputs, normalTS, surfaceData.normalWS, doubleSidedConstants); + #else + // normal delivered to master node + + #if HAVE_DECALS + if (_EnableDecals) + { + float alpha = 1.0; + alpha = surfaceDescription.Alpha; + + // Both uses and modifies 'surfaceData.normalWS'. + DecalSurfaceData decalSurfaceData = GetDecalSurfaceData(posInput, fragInputs, alpha); + ApplyDecalToSurfaceNormal(decalSurfaceData, surfaceData.normalWS.xyz); + ApplyDecalToSurfaceDataNoNormal(decalSurfaceData, surfaceData); + } + #endif + #endif + } +#endif + + void BuildSurfaceData(FragInputs fragInputs, inout Surface surfaceDescription, float3 V, PositionInputs posInput, out SurfaceData surfaceData, out float3 bentNormalWS) + { + // setup defaults -- these are used if the graph doesn't output a value + ZERO_INITIALIZE(SurfaceData, surfaceData); + + // specularOcclusion need to be init ahead of decal to quiet the compiler that modify the SurfaceData struct + // however specularOcclusion can come from the graph, so need to be init here so it can be override. + surfaceData.specularOcclusion = 1.0; + + // copy across graph values, if defined + surfaceData.baseColor = surfaceDescription.Albedo; + surfaceData.perceptualSmoothness = surfaceDescription.Smoothness; + surfaceData.ambientOcclusion = surfaceDescription.Occlusion; + surfaceData.specularOcclusion = surfaceDescription.SpecularOcclusion; + surfaceData.metallic = surfaceDescription.Metallic; + surfaceData.subsurfaceMask = surfaceDescription.SubsurfaceMask; + surfaceData.thickness = surfaceDescription.Thickness; + surfaceData.diffusionProfileHash = asuint(surfaceDescription.DiffusionProfileHash); + #if _USESPECULAR + surfaceData.specularColor = surfaceDescription.Specular; + #endif + surfaceData.coatMask = surfaceDescription.CoatMask; + surfaceData.anisotropy = surfaceDescription.Anisotropy; + surfaceData.iridescenceMask = surfaceDescription.IridescenceMask; + surfaceData.iridescenceThickness = surfaceDescription.IridescenceThickness; + + + + #if defined(_REFRACTION_PLANE) || defined(_REFRACTION_SPHERE) || defined(_REFRACTION_THIN) + if (_EnableSSRefraction) + { + surfaceData.transmittanceMask = (1.0 - surfaceDescription.Alpha); + surfaceDescription.Alpha = 1.0; + } + else + { + surfaceData.ior = surfaceDescription.ior; + surfaceData.transmittanceColor = surfaceDescription.transmittanceColor; + surfaceData.atDistance = surfaceDescription.atDistance; + surfaceData.transmittanceMask = surfaceDescription.transmittanceMask; + surfaceDescription.Alpha = 1.0; + } + #else + surfaceData.ior = 1.0; + surfaceData.transmittanceColor = float3(1.0, 1.0, 1.0); + surfaceData.atDistance = 1.0; + surfaceData.transmittanceMask = 0.0; + #endif + + + + // These static material feature allow compile time optimization + surfaceData.materialFeatures = MATERIALFEATUREFLAGS_LIT_STANDARD; + #ifdef _MATERIAL_FEATURE_SUBSURFACE_SCATTERING + surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_SUBSURFACE_SCATTERING; + #endif + + #ifdef _MATERIAL_FEATURE_TRANSMISSION + surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_TRANSMISSION; + #endif + + #ifdef _MATERIAL_FEATURE_ANISOTROPY + surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_ANISOTROPY; + surfaceData.normalWS = float3(0, 1, 0); + #endif + + #ifdef _MATERIAL_FEATURE_IRIDESCENCE + surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_IRIDESCENCE; + #endif + + #ifdef _MATERIAL_FEATURE_SPECULAR_COLOR + surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_SPECULAR_COLOR; + #endif + + #if defined(_MATERIAL_FEATURE_CLEAR_COAT) || _CLEARCOAT + surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_CLEAR_COAT; + #endif + + #if defined (_MATERIAL_FEATURE_SPECULAR_COLOR) && defined (_ENERGY_CONSERVING_SPECULAR) + // Require to have setup baseColor + // Reproduce the energy conservation done in legacy Unity. Not ideal but better for compatibility and users can unchek it + surfaceData.baseColor *= (1.0 - Max3(surfaceData.specularColor.r, surfaceData.specularColor.g, surfaceData.specularColor.b)); + #endif + + float3 normalTS = surfaceDescription.Normal; + #if !_WORLDSPACENORMAL + surfaceData.normalWS = mul(surfaceDescription.Normal, fragInputs.tangentToWorld); + #else + normalTS = mul(fragInputs.tangentToWorld, surfaceDescription.Normal); + surfaceData.normalWS = surfaceDescription.Normal; + #endif + + + #if UNITY_VERSION > UNITY_2022_3_12 + ApplyDecalAndGetNormal(fragInputs, posInput, surfaceDescription, normalTS, surfaceData); + #else + #ifdef DECAL_NORMAL_BLENDING + #if HAVE_DECALS + float alpha = 1.0; + alpha = surfaceDescription.Alpha; + if (_EnableDecals) + { + DecalSurfaceData decalSurfaceData = GetDecalSurfaceData(posInput, fragInputs, alpha); + ApplyDecalToSurfaceData(decalSurfaceData, fragInputs.tangentToWorld[2], surfaceData, normalTS); + } + #endif + #else + #if HAVE_DECALS + if (_EnableDecals) + { + float alpha = 1.0; + alpha = surfaceDescription.Alpha; + // Both uses and modifies 'surfaceData.normalWS'. + DecalSurfaceData decalSurfaceData = GetDecalSurfaceData(posInput, fragInputs, alpha); + ApplyDecalToSurfaceData(decalSurfaceData, fragInputs.tangentToWorld[2], surfaceData); + } + #endif + #endif + #endif + + + + surfaceData.geomNormalWS = fragInputs.tangentToWorld[2]; + + surfaceData.tangentWS = normalize(fragInputs.tangentToWorld[0].xyz); // The tangent is not normalize in tangentToWorld for mikkt. TODO: Check if it expected that we normalize with Morten. Tag: SURFACE_GRADIENT + + + bentNormalWS = surfaceData.normalWS; + + surfaceData.tangentWS = Orthonormalize(surfaceData.tangentWS, surfaceData.normalWS); + + #ifdef DEBUG_DISPLAY + if (_DebugMipMapMode != DEBUGMIPMAPMODE_NONE) + { + // TODO: need to update mip info + surfaceData.metallic = 0; + } + + // We need to call ApplyDebugToSurfaceData after filling the surfarcedata and before filling builtinData + // as it can modify attribute use for static lighting + ApplyDebugToSurfaceData(fragInputs.tangentToWorld, surfaceData); + #endif + + // By default we use the ambient occlusion with Tri-ace trick (apply outside) for specular occlusion. + // If user provide bent normal then we process a better term + #if defined(_SPECULAR_OCCLUSION_CUSTOM) + // Just use the value passed through via the slot (not active otherwise) + #elif defined(_SPECULAR_OCCLUSION_FROM_AO_BENT_NORMAL) + // If we have bent normal and ambient occlusion, process a specular occlusion + surfaceData.specularOcclusion = GetSpecularOcclusionFromBentAO(V, bentNormalWS, surfaceData.normalWS, surfaceData.ambientOcclusion, PerceptualSmoothnessToPerceptualRoughness(surfaceData.perceptualSmoothness)); + #elif defined(_AMBIENT_OCCLUSION) && defined(_SPECULAR_OCCLUSION_FROM_AO) + surfaceData.specularOcclusion = GetSpecularOcclusionFromAmbientOcclusion(ClampNdotV(dot(surfaceData.normalWS, V)), surfaceData.ambientOcclusion, PerceptualSmoothnessToRoughness(surfaceData.perceptualSmoothness)); + #endif + + #if defined(_ENABLE_GEOMETRIC_SPECULAR_AA) && !defined(SHADER_STAGE_RAY_TRACING) + surfaceData.perceptualSmoothness = GeometricNormalFiltering(surfaceData.perceptualSmoothness, fragInputs.tangentToWorld[2], surfaceDescription.SpecularAAScreenSpaceVariance, surfaceDescription.SpecularAAThreshold); + #endif + } + + void GetSurfaceAndBuiltinData(VertexToPixel m2ps, FragInputs fragInputs, float3 V, inout PositionInputs posInput, + out SurfaceData surfaceData, out BuiltinData builtinData, inout Surface l, inout ShaderData d + #if NEED_FACING + , bool facing + #endif + ) + { + // Removed since crossfade does not work, probably needs extra material setup. + //#if !defined(SHADER_STAGE_RAY_TRACING) && !defined(_TESSELLATION_DISPLACEMENT) + // #ifdef LOD_FADE_CROSSFADE // enable dithering LOD transition if user select CrossFade transition in LOD group + // LODDitheringTransition(ComputeFadeMaskSeed(V, posInput.positionSS), unity_LODFade.x); + // #endif + //#endif + + + + + d = CreateShaderData(m2ps + #if NEED_FACING + , facing + #endif + ); + + l = (Surface)0; + + l.Albedo = half3(0.5, 0.5, 0.5); + l.Normal = float3(0,0,1); + l.Occlusion = 1; + l.Alpha = 1; + l.SpecularOcclusion = 1; + + #if !defined(SHADER_STAGE_RAY_TRACING) && defined(_DEPTHOFFSET_ON) + l.outputDepth = d.clipPos.z; + #endif + + ChainSurfaceFunction(l, d); + + #if !defined(SHADER_STAGE_RAY_TRACING) && defined(_DEPTHOFFSET_ON) + posInput.deviceDepth = l.outputDepth; + #endif + + #if _UNLIT + //l.Emission = l.Albedo; + //l.Albedo = 0; + l.Normal = half3(0,0,1); + l.Occlusion = 1; + l.Metallic = 0; + l.Specular = 0; + #endif + + surfaceData.geomNormalWS = d.worldSpaceNormal; + surfaceData.tangentWS = d.worldSpaceTangent; + fragInputs.tangentToWorld = d.TBNMatrix; + + float3 bentNormalWS; + + BuildSurfaceData(fragInputs, l, V, posInput, surfaceData, bentNormalWS); + + + float4 lightmapTexCoord1 = fragInputs.texCoord1; + float4 lightmapTexCoord2 = fragInputs.texCoord2; + //#ifdef FRAG_INPUTS_USE_TEXCOORD1 + // float4 lightmapTexCoord1 = fragInputs.texCoord1; + // #else + // float4 lightmapTexCoord1 = float4(0,0,0,0); + // #endif + + // #ifdef FRAG_INPUTS_USE_TEXCOORD2 + // float4 lightmapTexCoord2 = fragInputs.texCoord2; + // #else + // float4 lightmapTexCoord2 = float4(0,0,0,0); + // #endif + + + InitBuiltinData(posInput, l.Alpha, bentNormalWS, -d.worldSpaceNormal, lightmapTexCoord1, lightmapTexCoord2, builtinData); + + + + builtinData.emissiveColor = l.Emission; + + #if defined(_OVERRIDE_BAKEDGI) + builtinData.bakeDiffuseLighting = l.DiffuseGI; + builtinData.backBakeDiffuseLighting = l.BackDiffuseGI; + builtinData.emissiveColor += l.SpecularGI; + #endif + + #if defined(_OVERRIDE_SHADOWMASK) + builtinData.shadowMask0 = l.ShadowMask.x; + builtinData.shadowMask1 = l.ShadowMask.y; + builtinData.shadowMask2 = l.ShadowMask.z; + builtinData.shadowMask3 = l.ShadowMask.w; + #endif + + #ifdef UNITY_VIRTUAL_TEXTURING + //builtinData.vtPackedFeedback = surfaceData.VTPackedFeedback; + #endif + + #if (SHADERPASS == SHADERPASS_DISTORTION) + builtinData.distortion = surfaceData.Distortion; + builtinData.distortionBlur = surfaceData.DistortionBlur; + #endif + + #ifndef SHADER_UNLIT + // PostInitBuiltinData call ApplyDebugToBuiltinData + PostInitBuiltinData(V, posInput, surfaceData, builtinData); + #else + ApplyDebugToBuiltinData(builtinData); + #endif + + RAY_TRACING_OPTIONAL_ALPHA_TEST_PASS + } + + + + #if defined(WRITE_NORMAL_BUFFER) && defined(WRITE_MSAA_DEPTH) + #define SV_TARGET_DECAL SV_Target2 + #elif defined(WRITE_NORMAL_BUFFER) || defined(WRITE_MSAA_DEPTH) + #define SV_TARGET_DECAL SV_Target1 + #else + #define SV_TARGET_DECAL SV_Target0 + #endif + + + void Frag( VertexToPixel v2p + #if defined(SCENESELECTIONPASS) || defined(SCENEPICKINGPASS) + , out float4 outColor : SV_Target0 + #else + #ifdef WRITE_MSAA_DEPTH + // We need the depth color as SV_Target0 for alpha to coverage + , out float4 depthColor : SV_Target0 + #ifdef WRITE_NORMAL_BUFFER + , out float4 outNormalBuffer : SV_Target1 + #endif + #else + #ifdef WRITE_NORMAL_BUFFER + , out float4 outNormalBuffer : SV_Target0 + #endif + #endif + + // Decal buffer must be last as it is bind but we can optionally write into it (based on _DISABLE_DECALS) + #if defined(WRITE_DECAL_BUFFER) && !defined(_DISABLE_DECALS) + , out float4 outDecalBuffer : SV_TARGET_DECAL + #endif + #endif + + #if defined(_DEPTHOFFSET_ON) && !defined(SCENEPICKINGPASS) + , out float outputDepth : DEPTH_OFFSET_SEMANTIC + #endif + #if NEED_FACING + , bool facing : SV_IsFrontFace + #endif + ) + { + UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX(v2p); + FragInputs input = BuildFragInputs(v2p); + + // input.positionSS is SV_Position + PositionInputs posInput = GetPositionInput(input.positionSS.xy, _ScreenSize.zw, input.positionSS.z, input.positionSS.w, input.positionRWS); + + float3 V = GetWorldSpaceNormalizeViewDir(input.positionRWS); + + + SurfaceData surfaceData; + BuiltinData builtinData; + Surface l; + ShaderData d; + GetSurfaceAndBuiltinData(v2p, input, V, posInput, surfaceData, builtinData, l, d + #if NEED_FACING + , facing + #endif + ); + + // to prevent stripping + surfaceData.normalWS *= saturate(l.Albedo.r + 9999); + + #ifdef _DEPTHOFFSET_ON + outputDepth = l.outputDepth; + #endif + + #ifdef SCENESELECTIONPASS + // We use depth prepass for scene selection in the editor, this code allow to output the outline correctly + outColor = float4(_ObjectId, _PassValue, 1.0, 1.0); + #elif defined(SCENEPICKINGPASS) + outColor = unity_SelectionID; + #else + #ifdef WRITE_MSAA_DEPTH + // In case we are rendering in MSAA, reading the an MSAA depth buffer is way too expensive. To avoid that, we export the depth to a color buffer + depthColor = v2p.pos.z; + + #ifdef _ALPHATOMASK_ON + // Alpha channel is used for alpha to coverage + depthColor.a = SharpenAlpha(builtinData.opacity, builtinData.alphaClipTreshold); + #endif // alphatomask + #endif // msaa_depth + + + #if defined(WRITE_NORMAL_BUFFER) + EncodeIntoNormalBuffer(ConvertSurfaceDataToNormalData(surfaceData), outNormalBuffer); + #endif + + #if (defined(WRITE_DECAL_BUFFER) && !defined(_DISABLE_DECALS)) || defined(WRITE_RENDERING_LAYER) + DecalPrepassData decalPrepassData; + #ifdef _DISABLE_DECALS + ZERO_INITIALIZE(DecalPrepassData, decalPrepassData); + #else + // We don't have the right to access SurfaceData in a shaderpass. + // However it would be painful to have to add a function like ConvertSurfaceDataToDecalPrepassData() to every Material to return geomNormalWS anyway + // Here we will put the constrain that any Material requiring to support Decal, will need to have geomNormalWS as member of surfaceData (and we already require normalWS anyway) + decalPrepassData.geomNormalWS = surfaceData.geomNormalWS; + #endif + decalPrepassData.renderingLayerMask = GetMeshRenderingLayerMask(); + EncodeIntoDecalPrepassBuffer(decalPrepassData, outDecalBuffer); + #endif + #endif + + } + + + + ENDHLSL + } + + + + Pass + { + // based on HDLitPass.template + Name "META" + Tags { "LightMode" = "META" } + + Cull Off + + Tags { "RenderType" = "Opaque" "Queue" = "Geometry" "PreviewType" = "Plane" } + Cull [_CullingOption] + ZWrite [_ZWrite] + ZTest [_ZTestMode] + + + //------------------------------------------------------------------------------------- + // End Render Modes + //------------------------------------------------------------------------------------- + + HLSLPROGRAM + + #pragma target 4.5 + #pragma only_renderers d3d11 playstation xboxone xboxseries vulkan metal switch + + #pragma multi_compile _ DOTS_INSTANCING_ON + #pragma instancing_options renderinglayer + #pragma multi_compile_instancing + + //#pragma multi_compile_local _ _ALPHATEST_ON + #pragma multi_compile _ LOD_FADE_CROSSFADE + + + //------------------------------------------------------------------------------------- + // Variant Definitions (active field translations to HDRP defines) + //------------------------------------------------------------------------------------- + // #define _MATERIAL_FEATURE_SUBSURFACE_SCATTERING 1 + // #define _MATERIAL_FEATURE_TRANSMISSION 1 + // #define _MATERIAL_FEATURE_ANISOTROPY 1 + // #define _MATERIAL_FEATURE_IRIDESCENCE 1 + // #define _MATERIAL_FEATURE_SPECULAR_COLOR 1 + #define _ENABLE_FOG_ON_TRANSPARENT 1 + // #define _AMBIENT_OCCLUSION 1 + // #define _SPECULAR_OCCLUSION_FROM_AO 1 + // #define _SPECULAR_OCCLUSION_FROM_AO_BENT_NORMAL 1 + // #define _SPECULAR_OCCLUSION_CUSTOM 1 + // #define _ENERGY_CONSERVING_SPECULAR 1 + // #define _ENABLE_GEOMETRIC_SPECULAR_AA 1 + // #define _HAS_REFRACTION 1 + // #define _REFRACTION_PLANE 1 + // #define _REFRACTION_SPHERE 1 + // #define _DISABLE_DECALS 1 + // #define _DISABLE_SSR 1 + // #define _ADD_PRECOMPUTED_VELOCITY + // #define _WRITE_TRANSPARENT_MOTION_VECTOR 1 + // #define _DEPTHOFFSET_ON 1 + // #define _BLENDMODE_PRESERVE_SPECULAR_LIGHTING 1 + + #define SHADERPASS SHADERPASS_LIGHT_TRANSPORT + #define RAYTRACING_SHADER_GRAPH_HIGH + #define REQUIRE_DEPTH_TEXTURE + #define _PASSMETA 1 + + + #pragma shader_feature_local GLOW_ON + #pragma shader_feature_local FADE_ON + #pragma shader_feature_local OUTBASE_ON + #pragma shader_feature_local ONLYOUTLINE_ON + #pragma shader_feature_local GRADIENT_ON + #pragma shader_feature_local GRADIENT2COL_ON + #pragma shader_feature_local RADIALGRADIENT_ON + #pragma shader_feature_local COLORSWAP_ON + #pragma shader_feature_local HSV_ON + #pragma shader_feature_local CHANGECOLOR_ON + #pragma shader_feature_local CHANGECOLOR2_ON + #pragma shader_feature_local CHANGECOLOR3_ON + #pragma shader_feature_local COLORRAMP_ON + #pragma shader_feature_local GRADIENTCOLORRAMP_ON + #pragma shader_feature_local HITEFFECT_ON + #pragma shader_feature_local NEGATIVE_ON + #pragma shader_feature_local PIXELATE_ON + #pragma shader_feature_local GREYSCALE_ON + #pragma shader_feature_local POSTERIZE_ON + #pragma shader_feature_local BLUR_ON + #pragma shader_feature_local MOTIONBLUR_ON + #pragma shader_feature_local GHOST_ON + #pragma shader_feature_local ALPHAOUTLINE_ON + #pragma shader_feature_local INNEROUTLINE_ON + #pragma shader_feature_local ONLYINNEROUTLINE_ON + #pragma shader_feature_local HOLOGRAM_ON + #pragma shader_feature_local CHROMABERR_ON + #pragma shader_feature_local GLITCH_ON + #pragma shader_feature_local FLICKER_ON + #pragma shader_feature_local SHADOW_ON + #pragma shader_feature_local SHINE_ON + #pragma shader_feature_local CONTRAST_ON + #pragma shader_feature_local OVERLAY_ON + #pragma shader_feature_local OVERLAYMULT_ON + #pragma shader_feature_local DOODLE_ON + #pragma shader_feature_local WIND_ON + #pragma shader_feature_local WAVEUV_ON + #pragma shader_feature_local ROUNDWAVEUV_ON + #pragma shader_feature_local RECTSIZE_ON + #pragma shader_feature_local OFFSETUV_ON + #pragma shader_feature_local CLIPPING_ON + #pragma shader_feature_local RADIALCLIPPING_ON + #pragma shader_feature_local TEXTURESCROLL_ON + #pragma shader_feature_local ZOOMUV_ON + #pragma shader_feature_local DISTORT_ON + #pragma shader_feature_local WARP_ON + #pragma shader_feature_local TWISTUV_ON + #pragma shader_feature_local ROTATEUV_ON + #pragma shader_feature_local POLARUV_ON + #pragma shader_feature_local FISHEYE_ON + #pragma shader_feature_local PINCH_ON + #pragma shader_feature_local SHAKEUV_ON + + #pragma shader_feature_local GLOWTEX_ON + #pragma shader_feature_local OUTTEX_ON + #pragma shader_feature_local OUTDIST_ON + #pragma shader_feature_local OUTBASE8DIR_ON + #pragma shader_feature_local OUTBASEPIXELPERF_ON + #pragma shader_feature_local COLORRAMPOUTLINE_ON + #pragma shader_feature_local GREYSCALEOUTLINE_ON + #pragma shader_feature_local POSTERIZEOUTLINE_ON + #pragma shader_feature_local BLURISHD_ON + #pragma shader_feature_local MANUALWIND_ON + #pragma shader_feature_local ATLAS_ON + #pragma shader_feature_local PREMULTIPLYALPHA_ON + + #pragma shader_feature BILBOARD_ON + #pragma shader_feature BILBOARDY_ON + + #pragma shader_feature NORMALMAP_ON + + + #define _HDRP 1 +#define _USINGTEXCOORD1 1 +#define _USINGTEXCOORD2 1 + + + #pragma vertex Vert + #pragma fragment Frag + + + + + // useful conversion functions to make surface shader code just work + + #define UNITY_DECLARE_TEX2D(name) TEXTURE2D(name); SAMPLER(sampler##name); + #define UNITY_DECLARE_TEX2D_NOSAMPLER(name) TEXTURE2D(name); + #define UNITY_DECLARE_TEX2DARRAY(name) TEXTURE2D_ARRAY(name); SAMPLER(sampler##name); + #define UNITY_DECLARE_TEX2DARRAY_NOSAMPLER(tex) TEXTURE2D_ARRAY(tex); + + #define UNITY_SAMPLE_TEX2DARRAY(tex,coord) SAMPLE_TEXTURE2D_ARRAY(tex, sampler##tex, coord.xy, coord.z) + #define UNITY_SAMPLE_TEX2DARRAY_LOD(tex,coord,lod) SAMPLE_TEXTURE2D_ARRAY_LOD(tex, sampler##tex, coord.xy, coord.z, lod) + #define UNITY_SAMPLE_TEX2D(tex, coord) SAMPLE_TEXTURE2D(tex, sampler##tex, coord) + #define UNITY_SAMPLE_TEX2D_SAMPLER(tex, samp, coord) SAMPLE_TEXTURE2D(tex, sampler##samp, coord) + + #define UNITY_SAMPLE_TEX2D_LOD(tex,coord, lod) SAMPLE_TEXTURE2D_LOD(tex, sampler_##tex, coord, lod) + #define UNITY_SAMPLE_TEX2D_SAMPLER_LOD(tex,samplertex,coord, lod) SAMPLE_TEXTURE2D_LOD (tex, sampler##samplertex,coord, lod) + + #if defined(UNITY_COMPILER_HLSL) + #define UNITY_INITIALIZE_OUTPUT(type,name) name = (type)0; + #else + #define UNITY_INITIALIZE_OUTPUT(type,name) + #endif + + #define sampler2D_float sampler2D + #define sampler2D_half sampler2D + + #undef WorldNormalVector + #define WorldNormalVector(data, normal) mul(normal, data.TBNMatrix) + + #define UnityObjectToWorldNormal(normal) mul(GetObjectToWorldMatrix(), normal) + + #ifndef SHADER_STAGE_FRAGMENT + #if !defined(SHADOW_ULTRA_LOW) && !defined(SHADOW_LOW) && !defined(SHADOW_MEDIUM) && !defined(SHADOW_HIGH) // ultra low come from volumetricLighting.compute + #define SHADOW_MEDIUM + #endif + #if !defined(AREA_SHADOW_LOW) && !defined(AREA_SHADOW_MEDIUM) && !defined(AREA_SHADOW_HIGH) // low come from volumetricLighting.compute + #define AREA_SHADOW_MEDIUM + #endif + #endif + + + +// HDRP Adapter stuff + #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Common.hlsl" + #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Common.hlsl" + #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/GeometricTools.hlsl" // Required by Tessellation.hlsl + #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Tessellation.hlsl" + #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Texture.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/ShaderVariables.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/ShaderPass/ShaderPass.cs.hlsl" + #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/TextureStack.hlsl" // Required to be include before we include properties as it define DECLARE_STACK_CB + #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/DebugMipmapStreamingMacros.hlsl" // Required before including properties as it defines UNITY_TEXTURE_STREAMING_DEBUG_VARS + // Always include Shader Graph version + // Always include last to avoid double macros + #include "Packages/com.unity.shadergraph/ShaderGraphLibrary/Functions.hlsl" // Need to be here for Gradient struct definition + + +#include "Packages/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/ShaderPass/FragInputs.hlsl" + + + + #ifdef RAYTRACING_SHADER_GRAPH_DEFAULT + #define RAYTRACING_SHADER_GRAPH_HIGH + #endif + + #ifdef RAYTRACING_SHADER_GRAPH_RAYTRACED + #define RAYTRACING_SHADER_GRAPH_LOW + #endif + // end + + + + + // If we use subsurface scattering, enable output split lighting (for forward pass) + #if defined(_MATERIAL_FEATURE_SUBSURFACE_SCATTERING) && !defined(_SURFACE_TYPE_TRANSPARENT) + #define OUTPUT_SPLIT_LIGHTING + #endif + + #define HAVE_RECURSIVE_RENDERING + + #if SHADERPASS == SHADERPASS_TRANSPARENT_DEPTH_PREPASS + #if !defined(_DISABLE_SSR_TRANSPARENT) && !defined(SHADER_UNLIT) + #define WRITE_NORMAL_BUFFER + #endif + #endif + + #ifndef DEBUG_DISPLAY + // In case of opaque we don't want to perform the alpha test, it is done in depth prepass and we use depth equal for ztest (setup from UI) + // Don't do it with debug display mode as it is possible there is no depth prepass in this case + #if !defined(_SURFACE_TYPE_TRANSPARENT) && defined(_ALPHATEST) + #if SHADERPASS == SHADERPASS_FORWARD + #define SHADERPASS_FORWARD_BYPASS_ALPHA_TEST + #elif SHADERPASS == SHADERPASS_GBUFFER + #define SHADERPASS_GBUFFER_BYPASS_ALPHA_TEST + #endif + #endif + #endif + + // Define _DEFERRED_CAPABLE_MATERIAL for shader capable to run in deferred pass + #if defined(SHADER_LIT) && !defined(_SURFACE_TYPE_TRANSPARENT) + #define _DEFERRED_CAPABLE_MATERIAL + #endif + + // Translate transparent motion vector define + #if defined(_TRANSPARENT_WRITES_MOTION_VEC) && defined(_SURFACE_TYPE_TRANSPARENT) + #define _WRITE_TRANSPARENT_MOTION_VECTOR + #endif + + + + + CBUFFER_START(UnityPerMaterial) + float _UseShadowThreshold; + float _BlendMode; + float _EnableBlendModePreserveSpecularLighting; + float _RayTracing; + float _RefractionModel; + + + half4 _Color; + half4 _MainTex_ST, _MainTex_TexelSize; + half _Alpha, _AlphaCutoffValue; + + #if ATLAS_ON + half _MinXUV, _MaxXUV, _MinYUV, _MaxYUV; + #endif + + #if GLOW_ON + half4 _GlowColor; + half _Glow, _GlowGlobal; + #endif + + #if HSV_ON + half _HsvShift, _HsvSaturation, _HsvBright; + #endif + + #if DISTORT_ON + half4 _DistortTex_ST; + half _DistortTexXSpeed, _DistortTexYSpeed, _DistortAmount; + #endif + + #if FADE_ON + half4 _FadeBurnColor, _FadeTex_ST, _FadeBurnTex_ST; + half _FadeAmount, _FadeBurnWidth, _FadeBurnTransition,_FadeBurnGlow; + #endif + + #if OUTBASE_ON + half4 _OutlineColor; + half _OutlineAlpha, _OutlineGlow, _OutlineWidth; + int _OutlinePixelWidth; + #endif + + #if OUTTEX_ON + half4 _OutlineTex_ST; + half _OutlineTexXSpeed, _OutlineTexYSpeed; + #endif + + #if OUTDIST_ON + half4 _OutlineDistortTex_ST; + half _OutlineDistortTexXSpeed, _OutlineDistortTexYSpeed, _OutlineDistortAmount; + #endif + + #if ALPHAOUTLINE_ON + half _AlphaOutlineGlow, _AlphaOutlinePower, _AlphaOutlineMinAlpha, _AlphaOutlineBlend; + half4 _AlphaOutlineColor; + #endif + + #if INNEROUTLINE_ON + half _InnerOutlineThickness, _InnerOutlineAlpha, _InnerOutlineGlow; + half4 _InnerOutlineColor; + #endif + + #if GRADIENT_ON + half _GradBlend, _GradBoostX, _GradBoostY; + half4 _GradTopRightCol, _GradTopLeftCol, _GradBotRightCol, _GradBotLeftCol; + #endif + + #if COLORSWAP_ON + half4 _ColorSwapRed, _ColorSwapGreen, _ColorSwapBlue; + half _ColorSwapRedLuminosity, _ColorSwapGreenLuminosity, _ColorSwapBlueLuminosity, _ColorSwapBlend; + #endif + + #if CHANGECOLOR_ON + half4 _ColorChangeNewCol, _ColorChangeTarget; + half _ColorChangeTolerance, _ColorChangeLuminosity; + #endif + #if CHANGECOLOR2_ON + half4 _ColorChangeNewCol2, _ColorChangeTarget2; + half _ColorChangeTolerance2; + #endif + #if CHANGECOLOR3_ON + half4 _ColorChangeNewCol3, _ColorChangeTarget3; + half _ColorChangeTolerance3; + #endif + + #if COLORRAMP_ON + half _ColorRampLuminosity, _ColorRampBlend; + #endif + + #if HITEFFECT_ON + half4 _HitEffectColor; + half _HitEffectGlow, _HitEffectBlend; + #endif + + #if NEGATIVE_ON + half _NegativeAmount; + #endif + + #if PIXELATE_ON + half _PixelateSize; + #endif + + #if GREYSCALE_ON + half _GreyscaleLuminosity, _GreyscaleBlend; + half4 _GreyscaleTintColor; + #endif + + #if POSTERIZE_ON + half _PosterizeNumColors, _PosterizeGamma; + #endif + + #if BLUR_ON + half _BlurIntensity; + #endif + + #if MOTIONBLUR_ON + half _MotionBlurAngle, _MotionBlurDist; + #endif + + #if GHOST_ON + half _GhostColorBoost, _GhostTransparency, _GhostBlend; + #endif + + #if HOLOGRAM_ON + half _HologramStripesAmount, _HologramMinAlpha, _HologramUnmodAmount, _HologramStripesSpeed, _HologramMaxAlpha, _HologramBlend; + half4 _HologramStripeColor; + #endif + + #if CHROMABERR_ON + half _ChromAberrAmount, _ChromAberrAlpha; + #endif + + #if GLITCH_ON + half _GlitchAmount, _GlitchSize; + #endif + + #if FLICKER_ON + half _FlickerFreq, _FlickerPercent, _FlickerAlpha; + #endif + + #if SHADOW_ON + half _ShadowX, _ShadowY, _ShadowAlpha; + half4 _ShadowColor; + #endif + + #if SHINE_ON + half4 _ShineColor; + half _ShineLocation, _ShineRotate, _ShineWidth, _ShineGlow; + #endif + + #if CONTRAST_ON + half _Contrast, _Brightness; + #endif + + #if OVERLAY_ON + half4 _OverlayTex_ST, _OverlayColor; + half _OverlayGlow, _OverlayBlend, _OverlayTextureScrollXSpeed, _OverlayTextureScrollYSpeed; + #endif + + #if DOODLE_ON + half _HandDrawnAmount, _HandDrawnSpeed; + #endif + + #if WIND_ON + half _GrassSpeed, _GrassWind, _GrassManualAnim, _GrassRadialBend; + #endif + + #if WAVEUV_ON + float _WaveAmount, _WaveSpeed, _WaveStrength, _WaveX, _WaveY; + #endif + + #if ROUNDWAVEUV_ON + half _RoundWaveStrength, _RoundWaveSpeed; + #endif + + #if RECTSIZE_ON + half _RectSize; + #endif + + #if OFFSETUV_ON + half _OffsetUvX, _OffsetUvY; + #endif + + #if CLIPPING_ON + half _ClipUvLeft, _ClipUvRight, _ClipUvUp, _ClipUvDown; + #endif + + #if RADIALCLIPPING_ON + half _RadialStartAngle, _RadialClip, _RadialClip2; + #endif + + #if TEXTURESCROLL_ON + half _TextureScrollXSpeed, _TextureScrollYSpeed; + #endif + + #if ZOOMUV_ON + half _ZoomUvAmount; + #endif + + #if WARP_ON + half _WarpStrength, _WarpSpeed, _WarpScale; + #endif + + #if TWISTUV_ON + half _TwistUvAmount, _TwistUvPosX, _TwistUvPosY, _TwistUvRadius; + #endif + + #if ROTATEUV_ON + half _RotateUvAmount; + #endif + + #if FISHEYE_ON + half _FishEyeUvAmount; + #endif + + #if PINCH_ON + half _PinchUvAmount; + #endif + + #if SHAKEUV_ON + half _ShakeUvSpeed, _ShakeUvX, _ShakeUvY; + #endif + + #if NORMALMAP_ON + half _NormalStrength; + #endif + + float _RandomSeed; + + + + + CBUFFER_END + + + + // -- Property used by ScenePickingPass + #ifdef SCENEPICKINGPASS + float4 _SelectionID; + #endif + + // -- Properties used by SceneSelectionPass + #ifdef SCENESELECTIONPASS + int _ObjectId; + int _PassValue; + #endif + + + // data across stages, stripped like the above. + struct VertexToPixel + { + float4 pos : SV_POSITION; + float3 worldPos : TEXCOORD0; + float3 worldNormal : TEXCOORD1; + float4 worldTangent : TEXCOORD2; + float4 texcoord0 : TEXCOORD3; + float4 texcoord1 : TEXCOORD4; + float4 texcoord2 : TEXCOORD5; + // #if %TEXCOORD3REQUIREKEY% + float4 texcoord3 : TEXCOORD6; + // #endif + + // #if %SCREENPOSREQUIREKEY% + // float4 screenPos : TEXCOORD7; + // #endif + + // #if %VERTEXCOLORREQUIREKEY% + float4 vertexColor : COLOR; + // #endif + + // #if %EXTRAV2F0REQUIREKEY% + // float4 extraV2F0 : TEXCOORD8; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // float4 extraV2F1 : TEXCOORD9; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // float4 extraV2F2 : TEXCOORD10; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // float4 extraV2F3 : TEXCOORD11; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // float4 extraV2F4 : TEXCOORD12; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // float4 extraV2F5 : TEXCOORD13; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // float4 extraV2F6 : TEXCOORD14; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // float4 extraV2F7 : TEXCOORD15; + // #endif + + #if UNITY_ANY_INSTANCING_ENABLED + UNITY_VERTEX_INPUT_INSTANCE_ID + #endif // UNITY_ANY_INSTANCING_ENABLED + + #if _HDRP && (_PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR))) + float4 previousPositionCS : TEXCOORD16; // Contain previous transform position (in case of skinning for example) + float4 motionVectorCS : TEXCOORD17; + #endif + + UNITY_VERTEX_OUTPUT_STEREO + }; + + + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/PickingSpaceTransforms.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Debug/DebugDisplay.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/Material.hlsl" + #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/NormalSurfaceGradient.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/Lit/Lit.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/BuiltinUtilities.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/MaterialUtilities.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/Decal/DecalUtilities.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/Lit/LitDecalData.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/ShaderGraphFunctions.hlsl" + + + + + + // data describing the user output of a pixel + struct Surface + { + half3 Albedo; + half Height; + half3 Normal; + half Smoothness; + half3 Emission; + half Metallic; + half3 Specular; + half Occlusion; + half SpecularPower; // for simple lighting + half Alpha; + float outputDepth; // if written, SV_Depth semantic is used. ShaderData.clipPos.z is unused value + // HDRP Only + half SpecularOcclusion; + half SubsurfaceMask; + half Thickness; + half CoatMask; + half CoatSmoothness; + half Anisotropy; + half IridescenceMask; + half IridescenceThickness; + int DiffusionProfileHash; + float SpecularAAThreshold; + float SpecularAAScreenSpaceVariance; + // requires _OVERRIDE_BAKEDGI to be defined, but is mapped in all pipelines + float3 DiffuseGI; + float3 BackDiffuseGI; + float3 SpecularGI; + float ior; + float3 transmittanceColor; + float atDistance; + float transmittanceMask; + // requires _OVERRIDE_SHADOWMASK to be defines + float4 ShadowMask; + + // for decals + float NormalAlpha; + float MAOSAlpha; + + + }; + + // Data the user declares in blackboard blocks + struct Blackboard + { + + float blackboardDummyData; + }; + + // data the user might need, this will grow to be big. But easy to strip + struct ShaderData + { + float4 clipPos; // SV_POSITION + float3 localSpacePosition; + float3 localSpaceNormal; + float3 localSpaceTangent; + + float3 worldSpacePosition; + float3 worldSpaceNormal; + float3 worldSpaceTangent; + float tangentSign; + + float3 worldSpaceViewDir; + float3 tangentSpaceViewDir; + + float4 texcoord0; + float4 texcoord1; + float4 texcoord2; + float4 texcoord3; + + float2 screenUV; + float4 screenPos; + + float4 vertexColor; + bool isFrontFace; + + float4 extraV2F0; + float4 extraV2F1; + float4 extraV2F2; + float4 extraV2F3; + float4 extraV2F4; + float4 extraV2F5; + float4 extraV2F6; + float4 extraV2F7; + + float3x3 TBNMatrix; + Blackboard blackboard; + }; + + struct VertexData + { + #if SHADER_TARGET > 30 + // uint vertexID : SV_VertexID; + #endif + float4 vertex : POSITION; + float3 normal : NORMAL; + float4 tangent : TANGENT; + float4 texcoord0 : TEXCOORD0; + + // optimize out mesh coords when not in use by user or lighting system + #if _URP && (_USINGTEXCOORD1 || _PASSMETA || _PASSFORWARD || _PASSGBUFFER) + float4 texcoord1 : TEXCOORD1; + #endif + + #if _URP && (_USINGTEXCOORD2 || _PASSMETA || ((_PASSFORWARD || _PASSGBUFFER) && defined(DYNAMICLIGHTMAP_ON))) + float4 texcoord2 : TEXCOORD2; + #endif + + #if _STANDARD && (_USINGTEXCOORD1 || (_PASSMETA || ((_PASSFORWARD || _PASSGBUFFER || _PASSFORWARDADD) && LIGHTMAP_ON))) + float4 texcoord1 : TEXCOORD1; + #endif + #if _STANDARD && (_USINGTEXCOORD2 || (_PASSMETA || ((_PASSFORWARD || _PASSGBUFFER) && DYNAMICLIGHTMAP_ON))) + float4 texcoord2 : TEXCOORD2; + #endif + + + #if _HDRP + float4 texcoord1 : TEXCOORD1; + float4 texcoord2 : TEXCOORD2; + #endif + + // #if %TEXCOORD3REQUIREKEY% + float4 texcoord3 : TEXCOORD3; + // #endif + + // #if %VERTEXCOLORREQUIREKEY% + float4 vertexColor : COLOR; + // #endif + + #if _PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR)) + float3 previousPositionOS : TEXCOORD4; // Contain previous transform position (in case of skinning for example) + #if defined (_ADD_PRECOMPUTED_VELOCITY) + float3 precomputedVelocity : TEXCOORD5; // Add Precomputed Velocity (Alembic computes velocities on runtime side). + #endif + #endif + + UNITY_VERTEX_INPUT_INSTANCE_ID + }; + + struct TessVertex + { + float4 vertex : INTERNALTESSPOS; + float3 normal : NORMAL; + float4 tangent : TANGENT; + float4 texcoord0 : TEXCOORD0; + float4 texcoord1 : TEXCOORD1; + float4 texcoord2 : TEXCOORD2; + + // #if %TEXCOORD3REQUIREKEY% + float4 texcoord3 : TEXCOORD3; + // #endif + + // #if %VERTEXCOLORREQUIREKEY% + float4 vertexColor : COLOR; + // #endif + + // #if %EXTRAV2F0REQUIREKEY% + // float4 extraV2F0 : TEXCOORD5; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // float4 extraV2F1 : TEXCOORD6; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // float4 extraV2F2 : TEXCOORD7; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // float4 extraV2F3 : TEXCOORD8; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // float4 extraV2F4 : TEXCOORD9; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // float4 extraV2F5 : TEXCOORD10; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // float4 extraV2F6 : TEXCOORD11; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // float4 extraV2F7 : TEXCOORD12; + // #endif + + #if _PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR)) + float3 previousPositionOS : TEXCOORD13; // Contain previous transform position (in case of skinning for example) + #if defined (_ADD_PRECOMPUTED_VELOCITY) + float3 precomputedVelocity : TEXCOORD14; + #endif + #endif + + UNITY_VERTEX_INPUT_INSTANCE_ID + UNITY_VERTEX_OUTPUT_STEREO + }; + + struct ExtraV2F + { + float4 extraV2F0; + float4 extraV2F1; + float4 extraV2F2; + float4 extraV2F3; + float4 extraV2F4; + float4 extraV2F5; + float4 extraV2F6; + float4 extraV2F7; + Blackboard blackboard; + float4 time; + }; + + + float3 WorldToTangentSpace(ShaderData d, float3 normal) + { + return mul(d.TBNMatrix, normal); + } + + float3 TangentToWorldSpace(ShaderData d, float3 normal) + { + return mul(normal, d.TBNMatrix); + } + + // in this case, make standard more like SRPs, because we can't fix + // unity_WorldToObject in HDRP, since it already does macro-fu there + + #if _STANDARD + float3 TransformWorldToObject(float3 p) { return mul(unity_WorldToObject, float4(p, 1)); }; + float3 TransformObjectToWorld(float3 p) { return mul(unity_ObjectToWorld, float4(p, 1)); }; + float4 TransformWorldToObject(float4 p) { return mul(unity_WorldToObject, p); }; + float4 TransformObjectToWorld(float4 p) { return mul(unity_ObjectToWorld, p); }; + float4x4 GetWorldToObjectMatrix() { return unity_WorldToObject; } + float4x4 GetObjectToWorldMatrix() { return unity_ObjectToWorld; } + #if (defined(SHADER_API_D3D11) || defined(SHADER_API_XBOXONE) || defined(UNITY_COMPILER_HLSLCC) || defined(SHADER_API_PSSL) || (SHADER_TARGET_SURFACE_ANALYSIS && !SHADER_TARGET_SURFACE_ANALYSIS_MOJOSHADER)) + #define UNITY_SAMPLE_TEX2D_LOD(tex,coord, lod) tex.SampleLevel (sampler##tex,coord, lod) + #define UNITY_SAMPLE_TEX2D_SAMPLER_LOD(tex,samplertex,coord, lod) tex.SampleLevel (sampler##samplertex,coord, lod) + #else + #define UNITY_SAMPLE_TEX2D_LOD(tex,coord,lod) tex2D (tex,coord,0,lod) + #define UNITY_SAMPLE_TEX2D_SAMPLER_LOD(tex,samplertex,coord,lod) tex2D (tex,coord,0,lod) + #endif + + #undef GetWorldToObjectMatrix() + + #define GetWorldToObjectMatrix() unity_WorldToObject + + + #endif + + float3 GetCameraWorldPosition() + { + #if _HDRP + return GetCameraRelativePositionWS(_WorldSpaceCameraPos); + #else + return _WorldSpaceCameraPos; + #endif + } + + #if _GRABPASSUSED + #if _STANDARD + TEXTURE2D(%GRABTEXTURE%); + SAMPLER(sampler_%GRABTEXTURE%); + #endif + + half3 GetSceneColor(float2 uv) + { + #if _STANDARD + return SAMPLE_TEXTURE2D(%GRABTEXTURE%, sampler_%GRABTEXTURE%, uv).rgb; + #else + return SHADERGRAPH_SAMPLE_SCENE_COLOR(uv); + #endif + } + #endif + + + + #if _STANDARD + UNITY_DECLARE_DEPTH_TEXTURE(_CameraDepthTexture); + float GetSceneDepth(float2 uv) { return SAMPLE_DEPTH_TEXTURE(_CameraDepthTexture, uv); } + float GetLinear01Depth(float2 uv) { return Linear01Depth(GetSceneDepth(uv)); } + float GetLinearEyeDepth(float2 uv) { return LinearEyeDepth(GetSceneDepth(uv)); } + #else + float GetSceneDepth(float2 uv) { return SHADERGRAPH_SAMPLE_SCENE_DEPTH(uv); } + float GetLinear01Depth(float2 uv) { return Linear01Depth(GetSceneDepth(uv), _ZBufferParams); } + float GetLinearEyeDepth(float2 uv) { return LinearEyeDepth(GetSceneDepth(uv), _ZBufferParams); } + #endif + + float3 GetWorldPositionFromDepthBuffer(float2 uv, float3 worldSpaceViewDir) + { + float eye = GetLinearEyeDepth(uv); + float3 camView = mul((float3x3)GetObjectToWorldMatrix(), transpose(mul(GetWorldToObjectMatrix(), UNITY_MATRIX_I_V)) [2].xyz); + + float dt = dot(worldSpaceViewDir, camView); + float3 div = worldSpaceViewDir/dt; + float3 wpos = (eye * div) + GetCameraWorldPosition(); + return wpos; + } + + #if _HDRP + float3 ObjectToWorldSpacePosition(float3 pos) + { + return GetAbsolutePositionWS(TransformObjectToWorld(pos)); + } + #else + float3 ObjectToWorldSpacePosition(float3 pos) + { + return TransformObjectToWorld(pos); + } + #endif + + #if _STANDARD + UNITY_DECLARE_SCREENSPACE_TEXTURE(_CameraDepthNormalsTexture); + float3 GetSceneNormal(float2 uv, float3 worldSpaceViewDir) + { + float4 depthNorms = UNITY_SAMPLE_SCREENSPACE_TEXTURE(_CameraDepthNormalsTexture, uv); + float3 norms = DecodeViewNormalStereo(depthNorms); + norms = mul((float3x3)GetWorldToViewMatrix(), norms) * 0.5 + 0.5; + return norms; + } + #elif _HDRP && !_DECALSHADER + + float3 GetSceneNormal(float2 uv, float3 worldSpaceViewDir) + { + NormalData nd; + DecodeFromNormalBuffer(_ScreenSize.xy * uv, nd); + return nd.normalWS; + } + #elif _URP + #if (SHADER_LIBRARY_VERSION_MAJOR >= 10) + #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/DeclareNormalsTexture.hlsl" + #endif + + float3 GetSceneNormal(float2 uv, float3 worldSpaceViewDir) + { + #if (SHADER_LIBRARY_VERSION_MAJOR >= 10) + return SampleSceneNormals(uv); + #else + float3 wpos = GetWorldPositionFromDepthBuffer(uv, worldSpaceViewDir); + return normalize(-cross(ddx(wpos), ddy(wpos))) * 0.5 + 0.5; + #endif + + } + #endif + + #if _HDRP + + half3 UnpackNormalmapRGorAG(half4 packednormal) + { + // This do the trick + packednormal.x *= packednormal.w; + + half3 normal; + normal.xy = packednormal.xy * 2 - 1; + normal.z = sqrt(1 - saturate(dot(normal.xy, normal.xy))); + return normal; + } + half3 UnpackNormal(half4 packednormal) + { + #if defined(UNITY_NO_DXT5nm) + return packednormal.xyz * 2 - 1; + #else + return UnpackNormalmapRGorAG(packednormal); + #endif + } + #endif + #if _HDRP || _URP + + half3 UnpackScaleNormal(half4 packednormal, half scale) + { + #ifndef UNITY_NO_DXT5nm + // Unpack normal as DXT5nm (1, y, 1, x) or BC5 (x, y, 0, 1) + // Note neutral texture like "bump" is (0, 0, 1, 1) to work with both plain RGB normal and DXT5nm/BC5 + packednormal.x *= packednormal.w; + #endif + half3 normal; + normal.xy = (packednormal.xy * 2 - 1) * scale; + normal.z = sqrt(1 - saturate(dot(normal.xy, normal.xy))); + return normal; + } + + #endif + + + void GetSun(out float3 lightDir, out float3 color) + { + lightDir = float3(0.5, 0.5, 0); + color = 1; + #if _HDRP + if (_DirectionalLightCount > 0) + { + DirectionalLightData light = _DirectionalLightDatas[0]; + lightDir = -light.forward.xyz; + color = light.color; + } + #elif _STANDARD + lightDir = normalize(_WorldSpaceLightPos0.xyz); + color = _LightColor0.rgb; + #elif _URP + Light light = GetMainLight(); + lightDir = light.direction; + color = light.color; + #endif + } + + + + + + + + + + TEXTURE2D(_MainTex); + SAMPLER(sampler_MainTex); + + #if GLOW_ON + TEXTURE2D(_GlowTex); + SAMPLER(sampler_GlowTex); + #endif + + #if FADE_ON + TEXTURE2D(_FadeTex); + SAMPLER(sampler_FadeTex); + + TEXTURE2D(_FadeBurnTex); + SAMPLER(sampler_FadeBurnTex); + #endif + + #if DISTORT_ON + TEXTURE2D(_DistortTex); + SAMPLER(sampler_DistortTex); + #endif + + #if OUTTEX_ON + TEXTURE2D(_OutlineTex); + SAMPLER(sampler_OutlineTex); + #endif + + #if OUTDIST_ON + TEXTURE2D(_OutlineDistortTex); + SAMPLER(sampler_OutlineDistortTex); + #endif + + #if COLORSWAP_ON + TEXTURE2D(_ColorSwapTex); + SAMPLER(sampler_ColorSwapTex); + #endif + + #if COLORRAMP_ON + TEXTURE2D(_ColorRampTex); + TEXTURE2D(_ColorRampTexGradient); + SAMPLER(sampler_ColorRampTex); + SAMPLER(sampler_ColorRampTexGradient); + #endif + + #if SHINE_ON + TEXTURE2D(_ShineMask); + SAMPLER(sampler_ShineMask); + #endif + + #if OVERLAY_ON + TEXTURE2D(_OverlayTex); + SAMPLER(sampler_OverlayTex); + #endif + + #if NORMALMAP_ON + TEXTURE2D(_NormalMap); + SAMPLER(sampler_NormalMap); + #endif + + + half3 GetPixel(in int offsetX, in int offsetY, in half2 uv, in Texture2D _tex, in SamplerState _sampler) + { + half2 _uv = uv + half2(offsetX * _MainTex_TexelSize.x, offsetY * _MainTex_TexelSize.y); + half4 col = SAMPLE_TEXTURE2D(_tex, _sampler, _uv); + return col.rgb; + } + + + //BLURS------------------------------------------------------------------------- + half4 Blur(half2 uv, Texture2D source, SamplerState sampler_source, half Intensity) + { + const half2 texelSize = 1.0 / _ScreenParams.xy; + const half4 color = SAMPLE_TEXTURE2D(source, sampler_source, uv); + const half2 offset = Intensity * texelSize; + + half4 accumulatedColor = color; + half accumulatedWeight = 1.0; + for (int x = -1; x <= 1; x++) + { + for (int y = -1; y <= 1; y++) + { + const half2 sampleUV = uv + half2(x, y) * offset; + const half4 sampleColor = SAMPLE_TEXTURE2D(source, sampler_source, sampleUV); + + accumulatedColor += sampleColor; + accumulatedWeight += 1.0; + } + } + + half4 blurredColor = accumulatedColor / accumulatedWeight; + return blurredColor; + } + + half BlurHD_G(half bhqp, half x) + { + return exp(-(x * x) / (2.0 * bhqp * bhqp)); + } + half4 BlurHD(half2 uv, Texture2D source, SamplerState sampler_source, half BlurAmount, half xScale, half yScale) + { + int iterations = 16; + int halfIterations = iterations / 2; + half sigmaX = 0.1 + BlurAmount * 0.5; + half sigmaY = sigmaX; + half total = 0.0; + half4 ret = half4(0, 0, 0, 0); + for (int iy = 0; iy < iterations; ++iy) + { + half fy = BlurHD_G(sigmaY, half(iy) -half(halfIterations)); + half offsetY = half(iy - halfIterations) * 0.00390625 * xScale; + for (int ix = 0; ix < iterations; ++ix) + { + half fx = BlurHD_G(sigmaX, half(ix) - half(halfIterations)); + half offsetX = half(ix - halfIterations) * 0.00390625 * yScale; + total += fx * fy; + ret += SAMPLE_TEXTURE2D(source, sampler_source, uv + half2(offsetX, offsetY)) * fx * fy; + } + } + return ret / total; + } + //----------------------------------------------------------------------- + + + //------------------------------------------- + half RemapFloat(half inValue, half inMin, half inMax, half outMin, half outMax){ + return outMin + (inValue - inMin) * (outMax - outMin) / (inMax - inMin); + } + //------------------------------------------- + + //----------------------------------------------------------------------- + half rand(half2 seed, half offset) { + return (frac(sin(dot(seed, half2(12.9898, 78.233))) * 43758.5453) + offset) % 1.0; + } + + half rand2(half2 seed, half offset) { + return (frac(sin(dot(seed * floor(50 + (_Time.x % 1.0) * 12.), half2(127.1, 311.7))) * 43758.5453123) + offset) % 1.0; + } + + half rand2CustomTime(half2 seed, half offset, half customTime) { + return (frac(sin(dot(seed * floor(50 + (customTime % 1.0) * 12.), half2(127.1, 311.7))) * 43758.5453123) + offset) % 1.0; + } + //----------------------------------------------------------------------- + + + void Ext_ModifyVertex0 (inout VertexData v, inout ExtraV2F d) + { + //BILBOARD_ON + #if BILBOARD_ON + half3 camRight = mul((half3x3)unity_CameraToWorld, half3(1,0,0)); + half3 camUp = half3(0,1,0); + #if BILBOARDY_ON + camUp = mul((half3x3)unity_CameraToWorld, half3(0,1,0)); + #endif + half3 localPos = v.vertex.x * camRight + v.vertex.y * camUp; + v.vertex = half4(localPos, 1); + #endif + //----------------------------------------------------------- + + v.texcoord0.xy = TRANSFORM_TEX(v.texcoord0.xy, _MainTex); + half2 center = half2(0.5, 0.5); + #if ATLAS_ON + center = half2((_MaxXUV + _MinXUV) / 2.0, (_MaxYUV + _MinYUV) / 2.0); + #endif + + //POLARUV_ON + #if POLARUV_ON + v.texcoord0.xy = v.texcoord0.xy - center; + #endif + + //---------------------------------------- + + //ROTATEUV_ON + #if ROTATEUV_ON + half2 uvC = v.texcoord0.xy; + half cosAngle = cos(_RotateUvAmount); + half sinAngle = sin(_RotateUvAmount); + half2x2 rot = half2x2(cosAngle, -sinAngle, sinAngle, cosAngle); + uvC -= center; + v.texcoord0.xy = mul(rot, uvC); + v.texcoord0.xy += center; + #endif + //-------------------- + + #if RECTSIZE_ON + v.vertex.xyz += (v.vertex.xyz * (_RectSize - 1.0)); + #endif + + #if OUTTEX_ON + v.texcoord1.xy = TRANSFORM_TEX(v.texcoord0.xy, _OutlineTex); + #endif + + #if OUTDIST_ON + v.texcoord2.xy = TRANSFORM_TEX(v.texcoord0.xy, _OutlineDistortTex); + #endif + + #if DISTORT_ON + v.texcoord3.xy = TRANSFORM_TEX(v.texcoord0.xy, _DistortTex); + #endif + } + + void Ext_SurfaceFunction0 (inout Surface o, ShaderData d) + { + half randomSeed = _RandomSeed; + + float2 uvRect = d.texcoord0; + half2 center = half2(0.5, 0.5); + #if ATLAS_ON + center = half2((_MaxXUV + _MinXUV) / 2.0, (_MaxYUV + _MinYUV) / 2.0); + uvRect = half2((d.texcoord0.x - _MinXUV) / (_MaxXUV - _MinXUV), (d.texcoord0.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half2 centerTiled = half2(center.x * _MainTex_ST.x, center.y * _MainTex_ST.y); + + //CLIPPING_ON + #if CLIPPING_ON + half2 tiledUv = half2(d.texcoord0.x / _MainTex_ST.x, d.texcoord0.y / _MainTex_ST.y); + #if ATLAS_ON + tiledUv = half2((tiledUv.x - _MinXUV) / (_MaxXUV - _MinXUV), (tiledUv.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + clip((1 - _ClipUvUp) - tiledUv.y); + clip(tiledUv.y - _ClipUvDown); + clip((1 - _ClipUvRight) - tiledUv.x); + clip(tiledUv.x - _ClipUvLeft); + #endif + //---------------------------------- + + //RADIALCLIPPING_ON + #if RADIALCLIPPING_ON + half2 tiledUv2 = half2(d.texcoord0.x / _MainTex_ST.x, d.texcoord0.y / _MainTex_ST.y); + #if ATLAS_ON + tiledUv2 = half2((tiledUv2.x - _MinXUV) / (_MaxXUV - _MinXUV), (tiledUv2.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half startAngle = _RadialStartAngle - _RadialClip; + half endAngle = _RadialStartAngle + _RadialClip2; + half offset0 = clamp(0, 360, startAngle + 360); + half offset360 = clamp(0, 360, endAngle - 360); + half2 atan2Coord = half2(lerp(-1, 1, tiledUv2.x), lerp(-1, 1, tiledUv2.y)); + half atanAngle = atan2(atan2Coord.y, atan2Coord.x) * 57.3; // angle in degrees + if(atanAngle < 0) atanAngle = 360 + atanAngle; + if(atanAngle >= startAngle && atanAngle <= endAngle) discard; + if(atanAngle <= offset360) discard; + if(atanAngle >= offset0) discard; + #endif + + //----------------------------- + + //TEXTURESCROLL_ON && ATLAS_ON + #if TEXTURESCROLL_ON && ATLAS_ON + d.texcoord0.xy = half2(_MinXUV + ((_MaxXUV - _MinXUV) * (abs(((_Time.y + randomSeed) * _TextureScrollXSpeed) + uvRect.x) % 1)), + _MinYUV + ((_MaxYUV - _MinYUV) * (abs(((_Time.y + randomSeed) * _TextureScrollYSpeed) + uvRect.y) % 1))); + #endif + //---------------------------- + + //OFFSETUV_ON + #if OFFSETUV_ON + #if ATLAS_ON + d.texcoord0.xy = half2(_MinXUV + ((_MaxXUV - _MinXUV) * (abs((_OffsetUvX + uvRect.x) % 1))), + _MinYUV + ((_MaxYUV - _MinYUV) * (abs(_OffsetUvY + uvRect.y) % 1))); + #else + d.texcoord0.xy += half2(_OffsetUvX, _OffsetUvY); + #endif + #endif + + //---------------------- + + //POLARUV_ON + #if POLARUV_ON + d.texcoord0.xy = half2(atan2(d.texcoord0.y, d.texcoord0.x) / (2.0f * 3.141592653589f), length(d.texcoord0.xy)); + d.texcoord0.xy *= _MainTex_ST.xy; + #endif + + //-------------------------------------- + + //TWISTUV_ON + #if TWISTUV_ON + #if ATLAS_ON + _TwistUvPosX = ((_MaxXUV - _MinXUV) * _TwistUvPosX) + _MinXUV; + _TwistUvPosY = ((_MaxYUV - _MinYUV) * _TwistUvPosY) + _MinYUV; + #endif + half2 tempUv = d.texcoord0.xy - half2(_TwistUvPosX * _MainTex_ST.x, _TwistUvPosY * _MainTex_ST.y); + _TwistUvRadius *= (_MainTex_ST.x + _MainTex_ST.y) / 2; + half percent = (_TwistUvRadius - length(tempUv)) / _TwistUvRadius; + half theta = percent * percent * (2.0 * sin(_TwistUvAmount)) * 8.0; + half s = sin(theta); + half c = cos(theta); + half beta = max(sign(_TwistUvRadius - length(tempUv)), 0.0); + tempUv = half2(dot(tempUv, half2(c, -s)), dot(tempUv, half2(s, c))) * beta + tempUv * (1 - beta); + tempUv += half2(_TwistUvPosX * _MainTex_ST.x, _TwistUvPosY * _MainTex_ST.y); + d.texcoord0.xy = tempUv; + #endif + + //-------------------------------------------- + + //FISHEYE_ON + #if FISHEYE_ON + half bind = length(centerTiled); + half2 dF = d.texcoord0.xy - centerTiled; + half dFlen = length(dF); + half fishInt = (3.14159265359 / bind) * (_FishEyeUvAmount + 0.001); + d.texcoord0.xy = centerTiled + (dF / (max(0.0001, dFlen))) * tan(dFlen * fishInt) * bind / tan(bind * fishInt); + #endif + //--------------------------------------------- + + //PINCH_ON + #if PINCH_ON + half2 dP = d.texcoord0.xy - centerTiled; + half pinchInt = (3.141592 / length(centerTiled)) * (-_PinchUvAmount + 0.001); + d.texcoord0.xy = centerTiled + normalize(dP) * atan(length(dP) * -pinchInt * 10.0) * 0.5 / atan(-pinchInt * 5); + #endif + + //--------------------------------------------- + + //ZOOMUV_ON + #if ZOOMUV_ON + d.texcoord0.xy -= centerTiled; + d.texcoord0.xy = d.texcoord0.xy * _ZoomUvAmount; + d.texcoord0.xy += centerTiled; + #endif + + //----------------------------------------------- + + //DOODLE_ON + #if DOODLE_ON + half2 uvCopy = uvRect; + _HandDrawnSpeed = (floor((_Time.x + randomSeed) * 20 * _HandDrawnSpeed) / _HandDrawnSpeed) * _HandDrawnSpeed; + uvCopy.x = sin((uvCopy.x * _HandDrawnAmount + _HandDrawnSpeed) * 4); + uvCopy.y = cos((uvCopy.y * _HandDrawnAmount + _HandDrawnSpeed) * 4); + d.texcoord0.xy = lerp(d.texcoord0.xy, d.texcoord0.xy + uvCopy, 0.0005 * _HandDrawnAmount); + #endif + + //-------------------------- + + //SHAKEUV_ON + #if SHAKEUV_ON + half xShake = sin((_Time.x + randomSeed) * _ShakeUvSpeed * 50) * _ShakeUvX; + half yShake = cos((_Time.x + randomSeed) * _ShakeUvSpeed * 50) * _ShakeUvY; + d.texcoord0.xy += half2(xShake * 0.012, yShake * 0.01); + #endif + + //------------------------------------------- + + //RECTSIZE_ON + #if RECTSIZE_ON + d.texcoord0.xy = d.texcoord0.xy * (_RectSize).xx + (((-_RectSize * 0.5) + 0.5)).xx; + #endif + + //------------------------------------------- + + //DISTORT_ON + #if DISTORT_ON + #if ATLAS_ON + d.texcoord3.x = d.texcoord3.x * (1 / (_MaxXUV - _MinXUV)); + d.texcoord3.y = d.texcoord3.y * (1 / (_MaxYUV - _MinYUV)); + #endif + + d.texcoord3.x += ((_Time.x + _RandomSeed) * _DistortTexXSpeed) % 1; + d.texcoord3.y += ((_Time.x + _RandomSeed) * _DistortTexYSpeed) % 1; + half distortAmnt = (SAMPLE_TEXTURE2D(_DistortTex, sampler_DistortTex, d.texcoord3.xy).r - 0.5) * 0.2 * _DistortAmount; + d.texcoord0.x += distortAmnt; + d.texcoord0.y += distortAmnt; + #endif + //------------------------------------------------------- + + //WARP_ON + #if WARP_ON + half2 warpUv = half2(d.texcoord0.x / _MainTex_ST.x, d.texcoord0.y / _MainTex_ST.y); + #if ATLAS_ON + warpUv = half2((warpUv.x - _MinXUV) / (_MaxXUV - _MinXUV), (warpUv.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + const float tau = 6.283185307179586; + float xWarp = (_Time.y + randomSeed) * _WarpSpeed + warpUv.x * tau / _WarpScale; + float yWarp = (_Time.y + randomSeed) * _WarpSpeed + warpUv.y * tau / _WarpScale; + float2 warp = float2(sin(xWarp), sin(yWarp)) * _WarpStrength; + d.texcoord0.xy += warp; + #endif + + //------------------------------------------------------- + + //WAVEUV_ON + #if WAVEUV_ON + float2 uvWave = half2(_WaveX * _MainTex_ST.x, _WaveY * _MainTex_ST.y) - d.texcoord0.xy; + uvWave %= 1; + #if ATLAS_ON + uvWave = half2(_WaveX, _WaveY) - uvRect; + #endif + uvWave.x *= _ScreenParams.x / _ScreenParams.y; + float waveTime = _Time.y + randomSeed; + float angWave = (sqrt(dot(uvWave, uvWave)) * _WaveAmount) - ((waveTime * _WaveSpeed)); + d.texcoord0.xy = d.texcoord0.xy + uvWave * sin(angWave) * (_WaveStrength / 1000.0); + #endif + //---------------------------------------------------- + + //ROUNDWAVEUV_ON + #if ROUNDWAVEUV_ON + half xWave = ((0.5 * _MainTex_ST.x) - uvRect.x); + half yWave = ((0.5 * _MainTex_ST.y) - uvRect.y) * (_MainTex_TexelSize.w / _MainTex_TexelSize.z); + half ripple = -sqrt(xWave*xWave + yWave* yWave); + d.texcoord0.xy += (sin((ripple + (_Time.y + randomSeed) * (_RoundWaveSpeed/10.0)) / 0.015) * (_RoundWaveStrength/10.0)) % 1; + #endif + //---------------------------------------------------- + + + //WIND_ON + #if WIND_ON + half windOffset = sin((_Time.x + randomSeed) * _GrassSpeed * 10); + half2 windCenter = half2(0.5, 0.1); + #if ATLAS_ON + windCenter.x = ((_MaxXUV - _MinXUV) * windCenter.x) + _MinXUV; + windCenter.y = ((_MaxYUV - _MinYUV) * windCenter.y) + _MinYUV; + #endif + #if !MANUALWIND_ON + d.texcoord0.x = fmod(abs(lerp(d.texcoord0.x, d.texcoord0.x + (_GrassWind * 0.01 * windOffset), uvRect.y)), 1); + #else + d.texcoord0.x = fmod(abs(lerp(d.texcoord0.x, d.texcoord0.x + (_GrassWind * 0.01 * _GrassManualAnim), uvRect.y)), 1); + windOffset = _GrassManualAnim; + #endif + half2 delta = d.texcoord0.xy - windCenter; + half delta2 = dot(delta.xy, delta.xy); + half2 delta_offset = delta2 * windOffset; + d.texcoord0.xy = d.texcoord0.xy + half2(delta.y, -delta.x) * delta_offset * _GrassRadialBend; + #endif + + //-------------------------------------------------------- + + //TEXTURESCROLL_ON && !ATLAS_ON + #if TEXTURESCROLL_ON && !ATLAS_ON + d.texcoord0.x += ((_Time.y + randomSeed) * _TextureScrollXSpeed) % 1; + d.texcoord0.y += ((_Time.y + randomSeed) * _TextureScrollYSpeed) % 1; + #endif + //------------------------------ + + //PIXELATE_ON + #if PIXELATE_ON + half aspectRatio = _MainTex_TexelSize.x / _MainTex_TexelSize.y; + half2 pixelSize = float2(_PixelateSize, _PixelateSize * aspectRatio); + d.texcoord0.xy = floor(d.texcoord0.xy * pixelSize) / pixelSize; + #endif + //-------------- + + half4 col = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy); + half originalAlpha = col.a; + col *= d.vertexColor; + + //NORMAL MAP + #if NORMALMAP_ON + half4 normalSample = SAMPLE_TEXTURE2D(_NormalMap, sampler_NormalMap, d.texcoord0.xy); + half3 normalTS = UnpackNormal(normalSample); + normalTS.xy *= _NormalStrength; + o.Normal = normalTS; + #endif + + + //GLITCH_ON + #if GLITCH_ON + half2 uvGlitch = uvRect; + uvGlitch.y -= 0.5; + half lineNoise = pow(rand2(floor(uvGlitch * half2(24., 19.) * _GlitchSize) * 4.0, randomSeed), 3.0) * _GlitchAmount + * pow(rand2(floor(uvGlitch * half2(38., 14.) * _GlitchSize) * 4.0, randomSeed), 3.0); + col = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(lineNoise * 0.02 * rand2(half2(2.0, 1), randomSeed), 0)) * d.vertexColor; + #endif + //-------------------------------------- + + //CHROMABERR_ON + #if CHROMABERR_ON + half4 r = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(_ChromAberrAmount/10, 0)) * d.vertexColor; + half4 b = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(-_ChromAberrAmount/10, 0)) * d.vertexColor; + col = half4(r.r * r.a, col.g, b.b * b.a, max(max(r.a, b.a) * _ChromAberrAlpha, col.a)); + #endif + + //-------------------------------- + + //BLUR_ON + #if BLUR_ON + #if ATLAS_ON + #if !BLURISHD_ON + col = BlurHD(d.texcoord0.xy, _MainTex, sampler_MainTex, _BlurIntensity, (_MaxXUV - _MinXUV), (_MaxYUV - _MinYUV)) * d.vertexColor; + #else + col = Blur(d.texcoord0.xy, _MainTex, sampler_MainTex, _BlurIntensity * (_MaxXUV - _MinXUV)) * d.vertexColor; + #endif + #else + #if !BLURISHD_ON + col = BlurHD(d.texcoord0.xy, _MainTex, sampler_MainTex, _BlurIntensity, 1, 1) * d.vertexColor; + #else + col = Blur(d.texcoord0.xy, _MainTex, sampler_MainTex, _BlurIntensity) * d.vertexColor; + #endif + #endif + #endif + + //-------------------- + + //MOTIONBLUR_ON + #if MOTIONBLUR_ON + _MotionBlurAngle = _MotionBlurAngle * 3.1415926; + #define rot(n) mul(n, half2x2(cos(_MotionBlurAngle), -sin(_MotionBlurAngle), sin(_MotionBlurAngle), cos(_MotionBlurAngle))) + _MotionBlurDist = _MotionBlurDist * 0.005; + #if ATLAS_ON + _MotionBlurDist *= (_MaxXUV - _MinXUV); + #endif + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(-_MotionBlurDist, -_MotionBlurDist))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(-_MotionBlurDist * 2, -_MotionBlurDist * 2))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(-_MotionBlurDist * 3, -_MotionBlurDist * 3))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(-_MotionBlurDist * 4, -_MotionBlurDist * 4))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(_MotionBlurDist, _MotionBlurDist))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(_MotionBlurDist * 2, _MotionBlurDist * 2))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(_MotionBlurDist * 3, _MotionBlurDist * 3))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(_MotionBlurDist * 4, _MotionBlurDist * 4))); + col.rgb = col.rgb / 9; + #endif + //------------------------------------ + + //NEGATIVE_ON + #if NEGATIVE_ON + col.rgb = lerp(col.rgb, 1 - col.rgb, _NegativeAmount); + #endif + + //-------------- + half luminance = 0; + + //GREYSCALE_ON && !GREYSCALEOUTLINE_ON + #if GREYSCALE_ON && !GREYSCALEOUTLINE_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + luminance = saturate(luminance + _GreyscaleLuminosity); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _GreyscaleTintColor, _GreyscaleBlend); + #endif + //------------------------------------ + + //GHOST_ON + #if GHOST_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + half4 ghostResult; + ghostResult.a = saturate(luminance - _GhostTransparency) * col.a; + ghostResult.rgb = col.rgb * (luminance + _GhostColorBoost); + col = lerp(col, ghostResult, _GhostBlend); + #endif + //------------------------------------ + + //INNEROUTLINE_ON + #if INNEROUTLINE_ON + half3 innerT = abs(GetPixel(0, _InnerOutlineThickness, d.texcoord0.xy, _MainTex, sampler_MainTex) - GetPixel(0, -_InnerOutlineThickness, d.texcoord0.xy, _MainTex, sampler_MainTex)); + innerT += abs(GetPixel(_InnerOutlineThickness, 0, d.texcoord0.xy, _MainTex, sampler_MainTex) - GetPixel(-_InnerOutlineThickness, 0, d.texcoord0.xy, _MainTex, sampler_MainTex)); + #if !ONLYINNEROUTLINE_ON + innerT = (innerT / 2.0) * col.a * _InnerOutlineAlpha; + col.rgb += length(innerT) * _InnerOutlineColor.rgb * _InnerOutlineGlow; + #else + innerT *= col.a * _InnerOutlineAlpha; + col.rgb = length(innerT) * _InnerOutlineColor.rgb * _InnerOutlineGlow; + col.a = step(0.3, col.r+col.g+col.b); + #endif + #endif + //------------------------------------------------------- + + //HITEFFECT_ON + #if HITEFFECT_ON + col.rgb = lerp(col.rgb, _HitEffectColor.rgb * _HitEffectGlow, _HitEffectBlend); + #endif + //-------------------- + + //GRADIENT_ON + #if GRADIENT_ON + half2 tiledUvGrad = half2(uvRect.x / _MainTex_ST.x, uvRect.y / _MainTex_ST.y); + #if GRADIENT2COL_ON + _GradTopRightCol = _GradTopLeftCol; + _GradBotRightCol = _GradBotLeftCol; + #endif + #if RADIALGRADIENT_ON + half radialDist = 1 - length(tiledUvGrad - half2(0.5, 0.5)); + radialDist *= (_MainTex_TexelSize.w / _MainTex_TexelSize.z); + radialDist = saturate(_GradBoostX * radialDist); + half4 gradientResult = lerp(_GradTopLeftCol, _GradBotLeftCol, radialDist); + #else + half gradXLerpFactor = saturate(pow(tiledUvGrad.x, _GradBoostX)); + half4 gradientResult = lerp(lerp(_GradBotLeftCol, _GradBotRightCol, gradXLerpFactor), + lerp(_GradTopLeftCol, _GradTopRightCol, gradXLerpFactor), saturate(pow(tiledUvGrad.y, _GradBoostY))); + #endif + gradientResult = lerp(col, gradientResult, _GradBlend); + col.rgb = gradientResult.rgb * col.a; + col.a *= gradientResult.a; + #endif + //-------------------------------------------------------------------- + + //CONTRAST_ON + #if CONTRAST_ON + col.rgb = (col.rgb - float3(0.5, 0.5, 0.5)) * _Contrast + float3(0.5, 0.5, 0.5); + col.rgb += _Brightness; + #endif + + //------------------------------------------------------------------- + + //COLORSWAP_ON + #if COLORSWAP_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + half4 swapMask = SAMPLE_TEXTURE2D(_ColorSwapTex, sampler_ColorSwapTex, d.texcoord0.xy); + swapMask.rgb *= swapMask.a; + half3 redSwap = _ColorSwapRed * swapMask.r * saturate(luminance + _ColorSwapRedLuminosity); + half3 greenSwap = _ColorSwapGreen * swapMask.g * saturate(luminance + _ColorSwapGreenLuminosity); + half3 blueSwap = _ColorSwapBlue * swapMask.b * saturate(luminance + _ColorSwapBlueLuminosity); + swapMask.rgb = col.rgb * saturate(1 - swapMask.r - swapMask.g - swapMask.b); + col.rgb = lerp(col.rgb, swapMask.rgb + redSwap + greenSwap + blueSwap, _ColorSwapBlend); + #endif + //-------------------------------------------------------------------- + + //COLORRAMP_ON && !COLORRAMPOUTLINE_ON + #if COLORRAMP_ON && !COLORRAMPOUTLINE_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + luminance = saturate(luminance + _ColorRampLuminosity); + #if GRADIENTCOLORRAMP_ON + col.rgb = lerp(col.rgb, SAMPLE_TEXTURE2D(_ColorRampTexGradient, sampler_ColorRampTexGradient, half2(luminance, 0)).rgb, _ColorRampBlend); + #else + col.rgb = lerp(col.rgb, SAMPLE_TEXTURE2D(_ColorRampTex, sampler_ColorRampTex, half2(luminance, 0)).rgb, _ColorRampBlend); + #endif + #endif + //-------------------------------------------------------------------- + + //CHANGECOLOR_ON + #if CHANGECOLOR_ON + float3 currChangeColor = saturate(col.rgb); + luminance = 0.3 * currChangeColor.r + 0.59 * currChangeColor.g + 0.11 * currChangeColor.b; + luminance = saturate(luminance + _ColorChangeLuminosity); + half3 dif = abs(currChangeColor - _ColorChangeTarget.rgb); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _ColorChangeNewCol.rgb, + max(sign(1 - saturate(dif.x + dif.y + dif.z) - _ColorChangeTolerance), 0.0)); + #if CHANGECOLOR2_ON + dif = abs(currChangeColor - _ColorChangeTarget2.rgb); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _ColorChangeNewCol2.rgb, + max(sign(1 - saturate(dif.x + dif.y + dif.z) - _ColorChangeTolerance2), 0.0)); + #endif + #if CHANGECOLOR3_ON + dif = abs(currChangeColor - _ColorChangeTarget3.rgb); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _ColorChangeNewCol3.rgb, + max(sign(1 - saturate(dif.x + dif.y + dif.z) - _ColorChangeTolerance3), 0.0)); + #endif + #endif + //------------------------------------------------------- + + //POSTERIZE_ON && !POSTERIZEOUTLINE_ON + #if POSTERIZE_ON && !POSTERIZEOUTLINE_ON + col.rgb = pow(col.rgb, _PosterizeGamma) * _PosterizeNumColors; + col.rgb = floor(col.rgb) / _PosterizeNumColors; + col.rgb = pow(col.rgb, 1.0 / _PosterizeGamma); + #endif + //------------------------------------ + + //HSV_ON + #if HSV_ON + half3 resultHsv = half3(col.rgb); + half cosHsv = _HsvBright * _HsvSaturation * cos(_HsvShift * 3.14159265 / 180); + half sinHsv = _HsvBright * _HsvSaturation * sin(_HsvShift * 3.14159265 / 180); + resultHsv.x = (.299 * _HsvBright + .701 * cosHsv + .168 * sinHsv) * col.x + + (.587 * _HsvBright - .587 * cosHsv + .330 * sinHsv) * col.y + + (.114 * _HsvBright - .114 * cosHsv - .497 * sinHsv) * col.z; + resultHsv.y = (.299 * _HsvBright - .299 * cosHsv - .328 * sinHsv) *col.x + + (.587 * _HsvBright + .413 * cosHsv + .035 * sinHsv) * col.y + + (.114 * _HsvBright - .114 * cosHsv + .292 * sinHsv) * col.z; + resultHsv.z = (.299 * _HsvBright - .3 * cosHsv + 1.25 * sinHsv) * col.x + + (.587 * _HsvBright - .588 * cosHsv - 1.05 * sinHsv) * col.y + + (.114 * _HsvBright + .886 * cosHsv - .203 * sinHsv) * col.z; + col.rgb = resultHsv; + #endif + //------------------------------------------------------- + + //OVERLAY_ON + #if OVERLAY_ON + half2 overlayUvs = d.texcoord0.xy; + overlayUvs.x += ((_Time.y + randomSeed) * _OverlayTextureScrollXSpeed) % 1; + overlayUvs.y += ((_Time.y + randomSeed) * _OverlayTextureScrollYSpeed) % 1; + half4 overlayCol = SAMPLE_TEXTURE2D(_OverlayTex, sampler_OverlayTex, TRANSFORM_TEX(overlayUvs, _OverlayTex)); + overlayCol.rgb *= _OverlayColor.rgb * _OverlayGlow; + #if !OVERLAYMULT_ON + overlayCol.rgb *= overlayCol.a * _OverlayColor.rgb * _OverlayColor.a * _OverlayBlend; + col.rgb += overlayCol.rgb; + #else + overlayCol.a *= _OverlayColor.a; + col = lerp(col, col * overlayCol, _OverlayBlend); + #endif + #endif + + //--------------------------------- + + //OUTBASE_ON + #if OUTBASE_ON + #if OUTBASEPIXELPERF_ON + half2 destUv = half2(_OutlinePixelWidth * _MainTex_TexelSize.x, _OutlinePixelWidth * _MainTex_TexelSize.y); + #else + half2 destUv = half2(_OutlineWidth * _MainTex_TexelSize.x * 200, _OutlineWidth * _MainTex_TexelSize.y * 200); + #endif + + #if OUTDIST_ON + d.texcoord3.x += ((_Time.x + _RandomSeed) * _OutlineDistortTexXSpeed) % 1; + d.texcoord3.y += ((_Time.x + _RandomSeed) * _OutlineDistortTexYSpeed) % 1; + #if ATLAS_ON + d.texcoord3 = half2((d.texcoord3.x - _MinXUV) / (_MaxXUV - _MinXUV), (d.texcoord3.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half outDistortAmnt = (SAMPLE_TEXTURE2D(_OutlineDistortTex, sampler_OutlineDistortTex, d.texcoord3).r - 0.5) * 0.2 * _OutlineDistortAmount; + destUv.x += outDistortAmnt; + destUv.y += outDistortAmnt; + #endif + + half spriteLeft = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(destUv.x, 0)).a; + half spriteRight = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy - half2(destUv.x, 0)).a; + half spriteBottom = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(0, destUv.y)).a; + half spriteTop = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy - half2(0, destUv.y)).a; + half result = spriteLeft + spriteRight + spriteBottom + spriteTop; + + #if OUTBASE8DIR_ON + half spriteTopLeft = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(destUv.x, destUv.y)).a; + half spriteTopRight = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(-destUv.x, destUv.y)).a; + half spriteBotLeft = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(destUv.x, -destUv.y)).a; + half spriteBotRight = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(-destUv.x, -destUv.y)).a; + result = result + spriteTopLeft + spriteTopRight + spriteBotLeft + spriteBotRight; + #endif + + result = step(0.05, saturate(result)); + + #if OUTTEX_ON + d.texcoord1.x += ((_Time.x + _RandomSeed) * _OutlineTexXSpeed) % 1; + d.texcoord1.y += ((_Time.x + _RandomSeed) * _OutlineTexYSpeed) % 1; + #if ATLAS_ON + d.texcoord1 = half2((d.texcoord1.x - _MinXUV) / (_MaxXUV - _MinXUV), (d.texcoord1.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half4 tempOutColor = SAMPLE_TEXTURE2D(_OutlineTex, sampler_OutlineTex, d.texcoord1); + tempOutColor *= _OutlineColor; + _OutlineColor = tempOutColor; + #endif + + result *= (1 - originalAlpha) * _OutlineAlpha; + + half4 outline = _OutlineColor * d.vertexColor.a; + outline.rgb *= _OutlineGlow; + outline.a = result; + #if ONLYOUTLINE_ON + col = outline; + #else + col = lerp(col, outline, result); + #endif + #endif + //------------------------------------------------------- + + //FADE_ON + #if FADE_ON + half2 tiledUvFade1 = TRANSFORM_TEX(d.texcoord0, _FadeTex); + half2 tiledUvFade2 = TRANSFORM_TEX(d.texcoord0, _FadeBurnTex); + #if ATLAS_ON + tiledUvFade1 = half2((tiledUvFade1.x - _MinXUV) / (_MaxXUV - _MinXUV), (tiledUvFade1.y - _MinYUV) / (_MaxYUV - _MinYUV)); + tiledUvFade2 = half2((tiledUvFade2.x - _MinXUV) / (_MaxXUV - _MinXUV), (tiledUvFade2.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half fadeTemp = SAMPLE_TEXTURE2D(_FadeTex, sampler_FadeTex, tiledUvFade1).r; + half fade = smoothstep(_FadeAmount, _FadeAmount + _FadeBurnTransition, fadeTemp); + half fadeBurn = saturate(smoothstep(_FadeAmount - _FadeBurnWidth, _FadeAmount - _FadeBurnWidth + 0.1, fadeTemp) * _FadeAmount); + col.a *= fade; + _FadeBurnColor.rgb *= _FadeBurnGlow; + col += fadeBurn * SAMPLE_TEXTURE2D(_FadeBurnTex, sampler_FadeBurnTex, tiledUvFade2) * _FadeBurnColor * originalAlpha * (1 - col.a); + #endif + //------------------------------------------------------- + + //SHADOW_ON + #if SHADOW_ON + half shadowA = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(_ShadowX, _ShadowY)).a; + half preMultShadowMask = 1 - (saturate(shadowA - col.a) * (1 - col.a)); + col.rgb *= 1 - ((shadowA - col.a) * (1 - col.a)); + col.rgb += (_ShadowColor * shadowA) * (1 - col.a); + col.a = max(shadowA * _ShadowAlpha * d.vertexColor.a, col.a); + #endif + + //------------------------------------------------------- + + //GLOW_ON + #if GLOW_ON + half4 emission; + #if GLOWTEX_ON + emission = SAMPLE_TEXTURE2D(_GlowTex, sampler_GlowTex, d.texcoord0); + #else + emission = col; + #endif + + col.rgb *= _GlowGlobal; + emission.rgb *= emission.a * col.a * _Glow * _GlowColor; + col.rgb += emission.rgb; + #endif + //------------------------------------------------------- + + //COLORRAMP_ON && COLORRAMPOUTLINE_ON + #if COLORRAMP_ON && COLORRAMPOUTLINE_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + luminance = saturate(luminance + _ColorRampLuminosity); + #if GRADIENTCOLORRAMP_ON + col.rgb = lerp(col.rgb, SAMPLE_TEXTURE2D(_ColorRampTexGradient, sampler_ColorRampTexGradient, half2(luminance, 0)).rgb, _ColorRampBlend); + #else + col.rgb = lerp(col.rgb, SAMPLE_TEXTURE2D(_ColorRampTex, sampler_ColorRampTex, half2(luminance, 0)).rgb, _ColorRampBlend); + #endif + #endif + //--------------- + + //GREYSCALE_ON && GREYSCALEOUTLINE_ON + #if GREYSCALE_ON && GREYSCALEOUTLINE_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + luminance = saturate(luminance + _GreyscaleLuminosity); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _GreyscaleTintColor, _GreyscaleBlend); + #endif + + //----------------------------------- + + //POSTERIZE_ON && POSTERIZEOUTLINE_ON + #if POSTERIZE_ON && POSTERIZEOUTLINE_ON + col.rgb = pow(col.rgb, _PosterizeGamma) * _PosterizeNumColors; + col.rgb = floor(col.rgb) / _PosterizeNumColors; + col.rgb = pow(col.rgb, 1.0 / _PosterizeGamma); + #endif + + //----------------------------------- + + //SHINE_ON + #if SHINE_ON + half2 uvShine = uvRect; + half cosAngle = cos(_ShineRotate); + half sinAngle = sin(_ShineRotate); + half2x2 rot = half2x2(cosAngle, -sinAngle, sinAngle, cosAngle); + uvShine -= half2(0.5, 0.5); + uvShine = mul(rot, uvShine); + uvShine += half2(0.5, 0.5); + half shineMask = SAMPLE_TEXTURE2D(_ShineMask, sampler_ShineMask, d.texcoord0.xy).a; + half currentDistanceProjection = (uvShine.x + uvShine.y) / 2; + half whitePower = 1 - (abs(currentDistanceProjection - _ShineLocation) / _ShineWidth); + col.rgb += col.a * whitePower * _ShineGlow * max(sign(currentDistanceProjection - (_ShineLocation - _ShineWidth)), 0.0) + * max(sign((_ShineLocation + _ShineWidth) - currentDistanceProjection), 0.0) * _ShineColor * shineMask; + #endif + + //----------------------------------- + + //HOLOGRAM_ON + #if HOLOGRAM_ON + half totalHologram = _HologramStripesAmount + _HologramUnmodAmount; + half hologramYCoord = ((uvRect.y + (((_Time.x + randomSeed) % 1) * _HologramStripesSpeed)) % totalHologram) / totalHologram; + hologramYCoord = abs(hologramYCoord); + half alpha = RemapFloat(saturate(hologramYCoord - (_HologramUnmodAmount/totalHologram)), 0.0, 1.0, _HologramMinAlpha, saturate(_HologramMaxAlpha)); + half hologramMask = max(sign((_HologramUnmodAmount/totalHologram) - hologramYCoord), 0.0); + half4 hologramResult = col; + hologramResult.a *= lerp(alpha, 1, hologramMask); + hologramResult.rgb *= max(1, _HologramMaxAlpha * max(sign(hologramYCoord - (_HologramUnmodAmount/totalHologram)), 0.0)); + hologramMask = 1 - step(0.01,hologramMask); + hologramResult.rgb += hologramMask * _HologramStripeColor * col.a; + col = lerp(col, hologramResult, _HologramBlend); + #endif + + //----------------------------------- + + //FLICKER_ON + #if FLICKER_ON + col.a *= saturate(col.a * step(frac(0.05 + (_Time.w + randomSeed) * _FlickerFreq), 1 - _FlickerPercent) + _FlickerAlpha); + #endif + //----------------------------------- + + //ALPHACUTOFF_ON + + //ALPHAROUND_ON + + //ALPHAOUTLINE_ON + #if ALPHAOUTLINE_ON + half alphaOutlineRes = pow(1 - col.a, max(_AlphaOutlinePower, 0.0001)) * step(_AlphaOutlineMinAlpha, col.a) * _AlphaOutlineBlend; + col.rgb = lerp(col.rgb, _AlphaOutlineColor.rgb * _AlphaOutlineGlow, alphaOutlineRes); + col.a = lerp(col.a, 1, alphaOutlineRes > 1); + #endif + //------------------------------------------------------- + + //FOG_ON + + //------------------ + + col *= _Color; + o.Albedo = col; + col.a *= _Alpha; + clip(col.a - _AlphaCutoffValue - 0.01); + o.Alpha = _Color.a; + } + + + + + + void ChainSurfaceFunction(inout Surface l, inout ShaderData d) + { + Ext_SurfaceFunction0(l, d); + // Ext_SurfaceFunction1(l, d); + // Ext_SurfaceFunction2(l, d); + // Ext_SurfaceFunction3(l, d); + // Ext_SurfaceFunction4(l, d); + // Ext_SurfaceFunction5(l, d); + // Ext_SurfaceFunction6(l, d); + // Ext_SurfaceFunction7(l, d); + // Ext_SurfaceFunction8(l, d); + // Ext_SurfaceFunction9(l, d); + // Ext_SurfaceFunction10(l, d); + // Ext_SurfaceFunction11(l, d); + // Ext_SurfaceFunction12(l, d); + // Ext_SurfaceFunction13(l, d); + // Ext_SurfaceFunction14(l, d); + // Ext_SurfaceFunction15(l, d); + // Ext_SurfaceFunction16(l, d); + // Ext_SurfaceFunction17(l, d); + // Ext_SurfaceFunction18(l, d); + // Ext_SurfaceFunction19(l, d); + // Ext_SurfaceFunction20(l, d); + // Ext_SurfaceFunction21(l, d); + // Ext_SurfaceFunction22(l, d); + // Ext_SurfaceFunction23(l, d); + // Ext_SurfaceFunction24(l, d); + // Ext_SurfaceFunction25(l, d); + // Ext_SurfaceFunction26(l, d); + // Ext_SurfaceFunction27(l, d); + // Ext_SurfaceFunction28(l, d); + // Ext_SurfaceFunction29(l, d); + } + +#if !_DECALSHADER + + void ChainModifyVertex(inout VertexData v, inout VertexToPixel v2p, float4 time) + { + ExtraV2F d; + + ZERO_INITIALIZE(ExtraV2F, d); + ZERO_INITIALIZE(Blackboard, d.blackboard); + // due to motion vectors in HDRP, we need to use the last + // time in certain spots. So if you are going to use _Time to adjust vertices, + // you need to use this time or motion vectors will break. + d.time = time; + + Ext_ModifyVertex0(v, d); + // Ext_ModifyVertex1(v, d); + // Ext_ModifyVertex2(v, d); + // Ext_ModifyVertex3(v, d); + // Ext_ModifyVertex4(v, d); + // Ext_ModifyVertex5(v, d); + // Ext_ModifyVertex6(v, d); + // Ext_ModifyVertex7(v, d); + // Ext_ModifyVertex8(v, d); + // Ext_ModifyVertex9(v, d); + // Ext_ModifyVertex10(v, d); + // Ext_ModifyVertex11(v, d); + // Ext_ModifyVertex12(v, d); + // Ext_ModifyVertex13(v, d); + // Ext_ModifyVertex14(v, d); + // Ext_ModifyVertex15(v, d); + // Ext_ModifyVertex16(v, d); + // Ext_ModifyVertex17(v, d); + // Ext_ModifyVertex18(v, d); + // Ext_ModifyVertex19(v, d); + // Ext_ModifyVertex20(v, d); + // Ext_ModifyVertex21(v, d); + // Ext_ModifyVertex22(v, d); + // Ext_ModifyVertex23(v, d); + // Ext_ModifyVertex24(v, d); + // Ext_ModifyVertex25(v, d); + // Ext_ModifyVertex26(v, d); + // Ext_ModifyVertex27(v, d); + // Ext_ModifyVertex28(v, d); + // Ext_ModifyVertex29(v, d); + + + // #if %EXTRAV2F0REQUIREKEY% + // v2p.extraV2F0 = d.extraV2F0; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // v2p.extraV2F1 = d.extraV2F1; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // v2p.extraV2F2 = d.extraV2F2; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // v2p.extraV2F3 = d.extraV2F3; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // v2p.extraV2F4 = d.extraV2F4; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // v2p.extraV2F5 = d.extraV2F5; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // v2p.extraV2F6 = d.extraV2F6; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // v2p.extraV2F7 = d.extraV2F7; + // #endif + } + + void ChainModifyTessellatedVertex(inout VertexData v, inout VertexToPixel v2p) + { + ExtraV2F d; + ZERO_INITIALIZE(ExtraV2F, d); + ZERO_INITIALIZE(Blackboard, d.blackboard); + + // #if %EXTRAV2F0REQUIREKEY% + // d.extraV2F0 = v2p.extraV2F0; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // d.extraV2F1 = v2p.extraV2F1; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // d.extraV2F2 = v2p.extraV2F2; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // d.extraV2F3 = v2p.extraV2F3; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // d.extraV2F4 = v2p.extraV2F4; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // d.extraV2F5 = v2p.extraV2F5; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // d.extraV2F6 = v2p.extraV2F6; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // d.extraV2F7 = v2p.extraV2F7; + // #endif + + + // Ext_ModifyTessellatedVertex0(v, d); + // Ext_ModifyTessellatedVertex1(v, d); + // Ext_ModifyTessellatedVertex2(v, d); + // Ext_ModifyTessellatedVertex3(v, d); + // Ext_ModifyTessellatedVertex4(v, d); + // Ext_ModifyTessellatedVertex5(v, d); + // Ext_ModifyTessellatedVertex6(v, d); + // Ext_ModifyTessellatedVertex7(v, d); + // Ext_ModifyTessellatedVertex8(v, d); + // Ext_ModifyTessellatedVertex9(v, d); + // Ext_ModifyTessellatedVertex10(v, d); + // Ext_ModifyTessellatedVertex11(v, d); + // Ext_ModifyTessellatedVertex12(v, d); + // Ext_ModifyTessellatedVertex13(v, d); + // Ext_ModifyTessellatedVertex14(v, d); + // Ext_ModifyTessellatedVertex15(v, d); + // Ext_ModifyTessellatedVertex16(v, d); + // Ext_ModifyTessellatedVertex17(v, d); + // Ext_ModifyTessellatedVertex18(v, d); + // Ext_ModifyTessellatedVertex19(v, d); + // Ext_ModifyTessellatedVertex20(v, d); + // Ext_ModifyTessellatedVertex21(v, d); + // Ext_ModifyTessellatedVertex22(v, d); + // Ext_ModifyTessellatedVertex23(v, d); + // Ext_ModifyTessellatedVertex24(v, d); + // Ext_ModifyTessellatedVertex25(v, d); + // Ext_ModifyTessellatedVertex26(v, d); + // Ext_ModifyTessellatedVertex27(v, d); + // Ext_ModifyTessellatedVertex28(v, d); + // Ext_ModifyTessellatedVertex29(v, d); + + // #if %EXTRAV2F0REQUIREKEY% + // v2p.extraV2F0 = d.extraV2F0; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // v2p.extraV2F1 = d.extraV2F1; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // v2p.extraV2F2 = d.extraV2F2; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // v2p.extraV2F3 = d.extraV2F3; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // v2p.extraV2F4 = d.extraV2F4; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // v2p.extraV2F5 = d.extraV2F5; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // v2p.extraV2F6 = d.extraV2F6; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // v2p.extraV2F7 = d.extraV2F7; + // #endif + } + + void ChainFinalColorForward(inout Surface l, inout ShaderData d, inout half4 color) + { + // Ext_FinalColorForward0(l, d, color); + // Ext_FinalColorForward1(l, d, color); + // Ext_FinalColorForward2(l, d, color); + // Ext_FinalColorForward3(l, d, color); + // Ext_FinalColorForward4(l, d, color); + // Ext_FinalColorForward5(l, d, color); + // Ext_FinalColorForward6(l, d, color); + // Ext_FinalColorForward7(l, d, color); + // Ext_FinalColorForward8(l, d, color); + // Ext_FinalColorForward9(l, d, color); + // Ext_FinalColorForward10(l, d, color); + // Ext_FinalColorForward11(l, d, color); + // Ext_FinalColorForward12(l, d, color); + // Ext_FinalColorForward13(l, d, color); + // Ext_FinalColorForward14(l, d, color); + // Ext_FinalColorForward15(l, d, color); + // Ext_FinalColorForward16(l, d, color); + // Ext_FinalColorForward17(l, d, color); + // Ext_FinalColorForward18(l, d, color); + // Ext_FinalColorForward19(l, d, color); + // Ext_FinalColorForward20(l, d, color); + // Ext_FinalColorForward21(l, d, color); + // Ext_FinalColorForward22(l, d, color); + // Ext_FinalColorForward23(l, d, color); + // Ext_FinalColorForward24(l, d, color); + // Ext_FinalColorForward25(l, d, color); + // Ext_FinalColorForward26(l, d, color); + // Ext_FinalColorForward27(l, d, color); + // Ext_FinalColorForward28(l, d, color); + // Ext_FinalColorForward29(l, d, color); + } + + void ChainFinalGBufferStandard(inout Surface s, inout ShaderData d, inout half4 GBuffer0, inout half4 GBuffer1, inout half4 GBuffer2, inout half4 outEmission, inout half4 outShadowMask) + { + // Ext_FinalGBufferStandard0(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard1(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard2(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard3(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard4(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard5(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard6(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard7(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard8(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard9(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard10(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard11(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard12(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard13(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard14(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard15(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard16(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard17(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard18(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard19(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard20(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard21(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard22(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard23(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard24(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard25(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard26(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard27(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard28(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard29(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + } +#endif + + + + + +#if _DECALSHADER + + ShaderData CreateShaderData(SurfaceDescriptionInputs IN) + { + ShaderData d = (ShaderData)0; + d.TBNMatrix = float3x3(IN.WorldSpaceTangent, IN.WorldSpaceBiTangent, IN.WorldSpaceNormal); + d.worldSpaceNormal = IN.WorldSpaceNormal; + d.worldSpaceTangent = IN.WorldSpaceTangent; + + d.worldSpacePosition = IN.WorldSpacePosition; + d.texcoord0 = IN.uv0.xyxy; + d.screenPos = IN.ScreenPosition; + + d.worldSpaceViewDir = normalize(_WorldSpaceCameraPos - d.worldSpacePosition); + + d.tangentSpaceViewDir = mul(d.TBNMatrix, d.worldSpaceViewDir); + + // these rarely get used, so we back transform them. Usually will be stripped. + #if _HDRP + // d.localSpacePosition = mul(GetWorldToObjectMatrix(), float4(GetCameraRelativePositionWS(d.worldSpacePosition), 1)).xyz; + #else + // d.localSpacePosition = mul(GetWorldToObjectMatrix(), float4(d.worldSpacePosition, 1)).xyz; + #endif + // d.localSpaceNormal = normalize(mul((float3x3)GetWorldToObjectMatrix(), d.worldSpaceNormal)); + // d.localSpaceTangent = normalize(mul((float3x3)GetWorldToObjectMatrix(), d.worldSpaceTangent.xyz)); + + // #if %SCREENPOSREQUIREKEY% + // d.screenUV = (IN.ScreenPosition.xy / max(0.01, IN.ScreenPosition.w)); + // #endif + + return d; + } +#else + + ShaderData CreateShaderData(VertexToPixel i + #if NEED_FACING + , bool facing + #endif + ) + { + ShaderData d = (ShaderData)0; + d.clipPos = i.pos; + d.worldSpacePosition = i.worldPos; + + d.worldSpaceNormal = normalize(i.worldNormal); + d.worldSpaceTangent.xyz = normalize(i.worldTangent.xyz); + + d.tangentSign = i.worldTangent.w * unity_WorldTransformParams.w; + float3 bitangent = cross(d.worldSpaceTangent.xyz, d.worldSpaceNormal) * d.tangentSign; + + d.TBNMatrix = float3x3(d.worldSpaceTangent, -bitangent, d.worldSpaceNormal); + d.worldSpaceViewDir = normalize(_WorldSpaceCameraPos - i.worldPos); + + d.tangentSpaceViewDir = mul(d.TBNMatrix, d.worldSpaceViewDir); + d.texcoord0 = i.texcoord0; + d.texcoord1 = i.texcoord1; + d.texcoord2 = i.texcoord2; + + // #if %TEXCOORD3REQUIREKEY% + d.texcoord3 = i.texcoord3; + // #endif + + // d.isFrontFace = facing; + // #if %VERTEXCOLORREQUIREKEY% + d.vertexColor = i.vertexColor; + // #endif + + // these rarely get used, so we back transform them. Usually will be stripped. + #if _HDRP + // d.localSpacePosition = mul(GetWorldToObjectMatrix(), float4(GetCameraRelativePositionWS(i.worldPos), 1)).xyz; + #else + // d.localSpacePosition = mul(GetWorldToObjectMatrix(), float4(i.worldPos, 1)).xyz; + #endif + // d.localSpaceNormal = normalize(mul((float3x3)GetWorldToObjectMatrix(), i.worldNormal)); + // d.localSpaceTangent = normalize(mul((float3x3)GetWorldToObjectMatrix(), i.worldTangent.xyz)); + + // #if %SCREENPOSREQUIREKEY% + // d.screenPos = i.screenPos; + // d.screenUV = (i.screenPos.xy / i.screenPos.w); + // #endif + + + // #if %EXTRAV2F0REQUIREKEY% + // d.extraV2F0 = i.extraV2F0; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // d.extraV2F1 = i.extraV2F1; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // d.extraV2F2 = i.extraV2F2; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // d.extraV2F3 = i.extraV2F3; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // d.extraV2F4 = i.extraV2F4; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // d.extraV2F5 = i.extraV2F5; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // d.extraV2F6 = i.extraV2F6; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // d.extraV2F7 = i.extraV2F7; + // #endif + + return d; + } + +#endif + + + +#if (SHADERPASS == SHADERPASS_LIGHT_TRANSPORT) + + // This was not in constant buffer in original unity, so keep outiside. But should be in as ShaderRenderPass frequency + float unity_OneOverOutputBoost; + float unity_MaxOutputValue; + + CBUFFER_START(UnityMetaPass) + // x = use uv1 as raster position + // y = use uv2 as raster position + bool4 unity_MetaVertexControl; + + // x = return albedo + // y = return normal + bool4 unity_MetaFragmentControl; + CBUFFER_END + + VertexToPixel Vert(VertexData inputMesh) + { + VertexToPixel output; + ZERO_INITIALIZE(VertexToPixel, output); + UNITY_SETUP_INSTANCE_ID(inputMesh); + UNITY_TRANSFER_INSTANCE_ID(inputMesh, output); + UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(output); + + // Output UV coordinate in vertex shader + float2 uv = float2(0.0, 0.0); + + if (unity_MetaVertexControl.x) + { + uv = inputMesh.texcoord1.xy * unity_LightmapST.xy + unity_LightmapST.zw; + } + else if (unity_MetaVertexControl.y) + { + uv = inputMesh.texcoord2.xy * unity_DynamicLightmapST.xy + unity_DynamicLightmapST.zw; + } + + // OpenGL right now needs to actually use the incoming vertex position + // so we create a fake dependency on it here that haven't any impact. + output.pos = float4(uv * 2.0 - 1.0, inputMesh.vertex.z > 0 ? 1.0e-4 : 0.0, 1.0); + + output.worldPos = TransformObjectToWorld(inputMesh.vertex.xyz).xyz; + + // Normal is required for triplanar mapping + output.worldNormal = TransformObjectToWorldNormal(inputMesh.normal); + // Not required but assign to silent compiler warning + output.worldTangent = float4(1.0, 0.0, 0.0, 0.0); + + output.texcoord0 = inputMesh.texcoord0; + output.texcoord1 = inputMesh.texcoord1; + output.texcoord2 = inputMesh.texcoord2; + // #if %TEXCOORD3REQUIREKEY% + output.texcoord3 = inputMesh.texcoord3; + // #endif + // #if %VERTEXCOLORREQUIREKEY% + output.vertexColor = inputMesh.vertexColor; + // #endif + + return output; + } +#else + + #if (_PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR))) + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/ShaderVariablesMatrixDefsHDCamera.hlsl" + + void MotionVectorPositionZBias(VertexToPixel input) + { + #if UNITY_REVERSED_Z + input.pos.z -= unity_MotionVectorsParams.z * input.pos.w; + #else + input.pos.z += unity_MotionVectorsParams.z * input.pos.w; + #endif + } + + #endif + + VertexToPixel Vert(VertexData input) + { + VertexToPixel output; + ZERO_INITIALIZE(VertexToPixel, output); + + UNITY_SETUP_INSTANCE_ID(input); + UNITY_TRANSFER_INSTANCE_ID(input, output); + UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(output); + + #if _HDRP && (_PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR))) + VertexData previousMesh = input; + #endif + + ChainModifyVertex(input, output, _Time); + + // This return the camera relative position (if enable) + float3 positionRWS = TransformObjectToWorld(input.vertex.xyz); + float3 normalWS = TransformObjectToWorldNormal(input.normal); + float4 tangentWS = float4(TransformObjectToWorldDir(input.tangent.xyz), input.tangent.w); + + + output.worldPos = GetAbsolutePositionWS(positionRWS); + output.pos = TransformWorldToHClip(positionRWS); + output.worldNormal = normalWS; + output.worldTangent = tangentWS; + + + output.texcoord0 = input.texcoord0; + output.texcoord1 = input.texcoord1; + output.texcoord2 = input.texcoord2; + + // #if %TEXCOORD3REQUIREKEY% + output.texcoord3 = input.texcoord3; + // #endif + + // #if %VERTEXCOLORREQUIREKEY% + output.vertexColor = input.vertexColor; + // #endif + + // #if %SCREENPOSREQUIREKEY% + // output.screenPos = ComputeScreenPos(output.pos, _ProjectionParams.x); + // #endif + + #if _HDRP && (_PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR))) + + #if !defined(TESSELLATION_ON) + MotionVectorPositionZBias(output); + #endif + + output.motionVectorCS = mul(UNITY_MATRIX_UNJITTERED_VP, float4(positionRWS.xyz, 1.0)); + // Note: unity_MotionVectorsParams.y is 0 is forceNoMotion is enabled + bool forceNoMotion = unity_MotionVectorsParams.y == 0.0; + if (forceNoMotion) + { + output.previousPositionCS = float4(0.0, 0.0, 0.0, 1.0); + } + else + { + bool hasDeformation = unity_MotionVectorsParams.x > 0.0; // Skin or morph target + + float3 effectivePositionOS = (hasDeformation ? previousMesh.previousPositionOS : previousMesh.vertex.xyz); + #if defined(_ADD_PRECOMPUTED_VELOCITY) + effectivePositionOS -= input.precomputedVelocity; + #endif + + previousMesh.vertex = float4(effectivePositionOS, 1); + VertexToPixel dummy = (VertexToPixel)0; + + + ChainModifyVertex(previousMesh, dummy, _LastTimeParameters); + + // we might need this for skinned objects? + //float3 normalWS = TransformPreviousObjectToWorldNormal(input.normal).xyz; + float3 previousPositionRWS = TransformPreviousObjectToWorld(previousMesh.vertex.xyz); + + #ifdef _WRITE_TRANSPARENT_MOTION_VECTOR + if (_TransparentCameraOnlyMotionVectors > 0) + { + previousPositionRWS = positionRWS.xyz; + } + #endif // _WRITE_TRANSPARENT_MOTION_VECTOR + + output.previousPositionCS = mul(UNITY_MATRIX_PREV_VP, float4(previousPositionRWS, 1.0)); + } + #endif // _HDRP && _PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR)) + + + return output; + } + + +#endif + + + + + + + + #if defined(WRITE_DECAL_BUFFER) && !defined(_DISABLE_DECALS) + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/Decal/DecalPrepassBuffer.hlsl" + #endif + + FragInputs BuildFragInputs(VertexToPixel input) + { + UNITY_SETUP_INSTANCE_ID(input); + FragInputs output; + ZERO_INITIALIZE(FragInputs, output); + + // Init to some default value to make the computer quiet (else it output 'divide by zero' warning even if value is not used). + // TODO: this is a really poor workaround, but the variable is used in a bunch of places + // to compute normals which are then passed on elsewhere to compute other values... + output.tangentToWorld = k_identity3x3; + output.positionSS = input.pos; // input.positionCS is SV_Position + // BETTER SHADERS: because we transform world position into actual world space for things like + // triplanar, etc, we have to back transform it here for lighting + output.positionRWS = GetCameraRelativePositionWS(input.worldPos); + output.tangentToWorld = BuildTangentToWorld(input.worldTangent, input.worldNormal); + output.texCoord0 = input.texcoord0; + output.texCoord1 = input.texcoord1; + output.texCoord2 = input.texcoord2; + + return output; + } + +#if UNITY_VERSION > UNITY_2022_3_12 + void ApplyDecalAndGetNormal(FragInputs fragInputs, PositionInputs posInput, Surface surfaceDescription, float3 normalTS, + inout SurfaceData surfaceData) + { + float3 doubleSidedConstants = GetDoubleSidedConstants(); + + #ifdef DECAL_NORMAL_BLENDING + // SG nodes don't ouptut surface gradients, so if decals require surf grad blending, we have to convert + // the normal to gradient before applying the decal. We then have to resolve the gradient back to world space + normalTS = SurfaceGradientFromTangentSpaceNormalAndFromTBN(normalTS, + fragInputs.tangentToWorld[0], fragInputs.tangentToWorld[1]); + + + #if HAVE_DECALS + if (_EnableDecals) + { + float alpha = 1.0; + alpha = surfaceDescription.Alpha; + + DecalSurfaceData decalSurfaceData = GetDecalSurfaceData(posInput, fragInputs, alpha); + ApplyDecalToSurfaceNormal(decalSurfaceData, fragInputs.tangentToWorld[2], normalTS); + ApplyDecalToSurfaceDataNoNormal(decalSurfaceData, surfaceData); + } + #endif + + GetNormalWS_SG(fragInputs, normalTS, surfaceData.normalWS, doubleSidedConstants); + #else + // normal delivered to master node + + #if HAVE_DECALS + if (_EnableDecals) + { + float alpha = 1.0; + alpha = surfaceDescription.Alpha; + + // Both uses and modifies 'surfaceData.normalWS'. + DecalSurfaceData decalSurfaceData = GetDecalSurfaceData(posInput, fragInputs, alpha); + ApplyDecalToSurfaceNormal(decalSurfaceData, surfaceData.normalWS.xyz); + ApplyDecalToSurfaceDataNoNormal(decalSurfaceData, surfaceData); + } + #endif + #endif + } +#endif + + void BuildSurfaceData(FragInputs fragInputs, inout Surface surfaceDescription, float3 V, PositionInputs posInput, out SurfaceData surfaceData, out float3 bentNormalWS) + { + // setup defaults -- these are used if the graph doesn't output a value + ZERO_INITIALIZE(SurfaceData, surfaceData); + + // specularOcclusion need to be init ahead of decal to quiet the compiler that modify the SurfaceData struct + // however specularOcclusion can come from the graph, so need to be init here so it can be override. + surfaceData.specularOcclusion = 1.0; + + // copy across graph values, if defined + surfaceData.baseColor = surfaceDescription.Albedo; + surfaceData.perceptualSmoothness = surfaceDescription.Smoothness; + surfaceData.ambientOcclusion = surfaceDescription.Occlusion; + surfaceData.specularOcclusion = surfaceDescription.SpecularOcclusion; + surfaceData.metallic = surfaceDescription.Metallic; + surfaceData.subsurfaceMask = surfaceDescription.SubsurfaceMask; + surfaceData.thickness = surfaceDescription.Thickness; + surfaceData.diffusionProfileHash = asuint(surfaceDescription.DiffusionProfileHash); + #if _USESPECULAR + surfaceData.specularColor = surfaceDescription.Specular; + #endif + surfaceData.coatMask = surfaceDescription.CoatMask; + surfaceData.anisotropy = surfaceDescription.Anisotropy; + surfaceData.iridescenceMask = surfaceDescription.IridescenceMask; + surfaceData.iridescenceThickness = surfaceDescription.IridescenceThickness; + + + + #if defined(_REFRACTION_PLANE) || defined(_REFRACTION_SPHERE) || defined(_REFRACTION_THIN) + if (_EnableSSRefraction) + { + surfaceData.transmittanceMask = (1.0 - surfaceDescription.Alpha); + surfaceDescription.Alpha = 1.0; + } + else + { + surfaceData.ior = surfaceDescription.ior; + surfaceData.transmittanceColor = surfaceDescription.transmittanceColor; + surfaceData.atDistance = surfaceDescription.atDistance; + surfaceData.transmittanceMask = surfaceDescription.transmittanceMask; + surfaceDescription.Alpha = 1.0; + } + #else + surfaceData.ior = 1.0; + surfaceData.transmittanceColor = float3(1.0, 1.0, 1.0); + surfaceData.atDistance = 1.0; + surfaceData.transmittanceMask = 0.0; + #endif + + + + // These static material feature allow compile time optimization + surfaceData.materialFeatures = MATERIALFEATUREFLAGS_LIT_STANDARD; + #ifdef _MATERIAL_FEATURE_SUBSURFACE_SCATTERING + surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_SUBSURFACE_SCATTERING; + #endif + + #ifdef _MATERIAL_FEATURE_TRANSMISSION + surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_TRANSMISSION; + #endif + + #ifdef _MATERIAL_FEATURE_ANISOTROPY + surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_ANISOTROPY; + surfaceData.normalWS = float3(0, 1, 0); + #endif + + #ifdef _MATERIAL_FEATURE_IRIDESCENCE + surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_IRIDESCENCE; + #endif + + #ifdef _MATERIAL_FEATURE_SPECULAR_COLOR + surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_SPECULAR_COLOR; + #endif + + #if defined(_MATERIAL_FEATURE_CLEAR_COAT) || _CLEARCOAT + surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_CLEAR_COAT; + #endif + + #if defined (_MATERIAL_FEATURE_SPECULAR_COLOR) && defined (_ENERGY_CONSERVING_SPECULAR) + // Require to have setup baseColor + // Reproduce the energy conservation done in legacy Unity. Not ideal but better for compatibility and users can unchek it + surfaceData.baseColor *= (1.0 - Max3(surfaceData.specularColor.r, surfaceData.specularColor.g, surfaceData.specularColor.b)); + #endif + + float3 normalTS = surfaceDescription.Normal; + #if !_WORLDSPACENORMAL + surfaceData.normalWS = mul(surfaceDescription.Normal, fragInputs.tangentToWorld); + #else + normalTS = mul(fragInputs.tangentToWorld, surfaceDescription.Normal); + surfaceData.normalWS = surfaceDescription.Normal; + #endif + + + #if UNITY_VERSION > UNITY_2022_3_12 + ApplyDecalAndGetNormal(fragInputs, posInput, surfaceDescription, normalTS, surfaceData); + #else + #ifdef DECAL_NORMAL_BLENDING + #if HAVE_DECALS + float alpha = 1.0; + alpha = surfaceDescription.Alpha; + if (_EnableDecals) + { + DecalSurfaceData decalSurfaceData = GetDecalSurfaceData(posInput, fragInputs, alpha); + ApplyDecalToSurfaceData(decalSurfaceData, fragInputs.tangentToWorld[2], surfaceData, normalTS); + } + #endif + #else + #if HAVE_DECALS + if (_EnableDecals) + { + float alpha = 1.0; + alpha = surfaceDescription.Alpha; + // Both uses and modifies 'surfaceData.normalWS'. + DecalSurfaceData decalSurfaceData = GetDecalSurfaceData(posInput, fragInputs, alpha); + ApplyDecalToSurfaceData(decalSurfaceData, fragInputs.tangentToWorld[2], surfaceData); + } + #endif + #endif + #endif + + + + surfaceData.geomNormalWS = fragInputs.tangentToWorld[2]; + + surfaceData.tangentWS = normalize(fragInputs.tangentToWorld[0].xyz); // The tangent is not normalize in tangentToWorld for mikkt. TODO: Check if it expected that we normalize with Morten. Tag: SURFACE_GRADIENT + + + bentNormalWS = surfaceData.normalWS; + + surfaceData.tangentWS = Orthonormalize(surfaceData.tangentWS, surfaceData.normalWS); + + #ifdef DEBUG_DISPLAY + if (_DebugMipMapMode != DEBUGMIPMAPMODE_NONE) + { + // TODO: need to update mip info + surfaceData.metallic = 0; + } + + // We need to call ApplyDebugToSurfaceData after filling the surfarcedata and before filling builtinData + // as it can modify attribute use for static lighting + ApplyDebugToSurfaceData(fragInputs.tangentToWorld, surfaceData); + #endif + + // By default we use the ambient occlusion with Tri-ace trick (apply outside) for specular occlusion. + // If user provide bent normal then we process a better term + #if defined(_SPECULAR_OCCLUSION_CUSTOM) + // Just use the value passed through via the slot (not active otherwise) + #elif defined(_SPECULAR_OCCLUSION_FROM_AO_BENT_NORMAL) + // If we have bent normal and ambient occlusion, process a specular occlusion + surfaceData.specularOcclusion = GetSpecularOcclusionFromBentAO(V, bentNormalWS, surfaceData.normalWS, surfaceData.ambientOcclusion, PerceptualSmoothnessToPerceptualRoughness(surfaceData.perceptualSmoothness)); + #elif defined(_AMBIENT_OCCLUSION) && defined(_SPECULAR_OCCLUSION_FROM_AO) + surfaceData.specularOcclusion = GetSpecularOcclusionFromAmbientOcclusion(ClampNdotV(dot(surfaceData.normalWS, V)), surfaceData.ambientOcclusion, PerceptualSmoothnessToRoughness(surfaceData.perceptualSmoothness)); + #endif + + #if defined(_ENABLE_GEOMETRIC_SPECULAR_AA) && !defined(SHADER_STAGE_RAY_TRACING) + surfaceData.perceptualSmoothness = GeometricNormalFiltering(surfaceData.perceptualSmoothness, fragInputs.tangentToWorld[2], surfaceDescription.SpecularAAScreenSpaceVariance, surfaceDescription.SpecularAAThreshold); + #endif + } + + void GetSurfaceAndBuiltinData(VertexToPixel m2ps, FragInputs fragInputs, float3 V, inout PositionInputs posInput, + out SurfaceData surfaceData, out BuiltinData builtinData, inout Surface l, inout ShaderData d + #if NEED_FACING + , bool facing + #endif + ) + { + // Removed since crossfade does not work, probably needs extra material setup. + //#if !defined(SHADER_STAGE_RAY_TRACING) && !defined(_TESSELLATION_DISPLACEMENT) + // #ifdef LOD_FADE_CROSSFADE // enable dithering LOD transition if user select CrossFade transition in LOD group + // LODDitheringTransition(ComputeFadeMaskSeed(V, posInput.positionSS), unity_LODFade.x); + // #endif + //#endif + + + + + d = CreateShaderData(m2ps + #if NEED_FACING + , facing + #endif + ); + + l = (Surface)0; + + l.Albedo = half3(0.5, 0.5, 0.5); + l.Normal = float3(0,0,1); + l.Occlusion = 1; + l.Alpha = 1; + l.SpecularOcclusion = 1; + + #if !defined(SHADER_STAGE_RAY_TRACING) && defined(_DEPTHOFFSET_ON) + l.outputDepth = d.clipPos.z; + #endif + + ChainSurfaceFunction(l, d); + + #if !defined(SHADER_STAGE_RAY_TRACING) && defined(_DEPTHOFFSET_ON) + posInput.deviceDepth = l.outputDepth; + #endif + + #if _UNLIT + //l.Emission = l.Albedo; + //l.Albedo = 0; + l.Normal = half3(0,0,1); + l.Occlusion = 1; + l.Metallic = 0; + l.Specular = 0; + #endif + + surfaceData.geomNormalWS = d.worldSpaceNormal; + surfaceData.tangentWS = d.worldSpaceTangent; + fragInputs.tangentToWorld = d.TBNMatrix; + + float3 bentNormalWS; + + BuildSurfaceData(fragInputs, l, V, posInput, surfaceData, bentNormalWS); + + + float4 lightmapTexCoord1 = fragInputs.texCoord1; + float4 lightmapTexCoord2 = fragInputs.texCoord2; + //#ifdef FRAG_INPUTS_USE_TEXCOORD1 + // float4 lightmapTexCoord1 = fragInputs.texCoord1; + // #else + // float4 lightmapTexCoord1 = float4(0,0,0,0); + // #endif + + // #ifdef FRAG_INPUTS_USE_TEXCOORD2 + // float4 lightmapTexCoord2 = fragInputs.texCoord2; + // #else + // float4 lightmapTexCoord2 = float4(0,0,0,0); + // #endif + + + InitBuiltinData(posInput, l.Alpha, bentNormalWS, -d.worldSpaceNormal, lightmapTexCoord1, lightmapTexCoord2, builtinData); + + + + builtinData.emissiveColor = l.Emission; + + #if defined(_OVERRIDE_BAKEDGI) + builtinData.bakeDiffuseLighting = l.DiffuseGI; + builtinData.backBakeDiffuseLighting = l.BackDiffuseGI; + builtinData.emissiveColor += l.SpecularGI; + #endif + + #if defined(_OVERRIDE_SHADOWMASK) + builtinData.shadowMask0 = l.ShadowMask.x; + builtinData.shadowMask1 = l.ShadowMask.y; + builtinData.shadowMask2 = l.ShadowMask.z; + builtinData.shadowMask3 = l.ShadowMask.w; + #endif + + #ifdef UNITY_VIRTUAL_TEXTURING + //builtinData.vtPackedFeedback = surfaceData.VTPackedFeedback; + #endif + + #if (SHADERPASS == SHADERPASS_DISTORTION) + builtinData.distortion = surfaceData.Distortion; + builtinData.distortionBlur = surfaceData.DistortionBlur; + #endif + + #ifndef SHADER_UNLIT + // PostInitBuiltinData call ApplyDebugToBuiltinData + PostInitBuiltinData(V, posInput, surfaceData, builtinData); + #else + ApplyDebugToBuiltinData(builtinData); + #endif + + RAY_TRACING_OPTIONAL_ALPHA_TEST_PASS + } + + + float4 Frag(VertexToPixel v2f + #if NEED_FACING + , bool facing : SV_IsFrontFace + #endif + ) : SV_Target + { + FragInputs input = BuildFragInputs(v2f); + + // input.positionSS is SV_Position + PositionInputs posInput = GetPositionInput(input.positionSS.xy, _ScreenSize.zw, input.positionSS.z, input.positionSS.w, input.positionRWS); + + float3 V = GetWorldSpaceNormalizeViewDir(input.positionRWS); + + SurfaceData surfaceData; + BuiltinData builtinData; + Surface l; + ShaderData d; + GetSurfaceAndBuiltinData(v2f, input, V, posInput, surfaceData, builtinData, l, d + #if NEED_FACING + , facing + #endif + ); + + // no debug apply during light transport pass + + BSDFData bsdfData = ConvertSurfaceDataToBSDFData(input.positionSS.xy, surfaceData); + LightTransportData lightTransportData = GetLightTransportData(surfaceData, builtinData, bsdfData); + + // This shader is call two times. Once for getting emissiveColor, the other time to get diffuseColor + // We use unity_MetaFragmentControl to make the distinction. + float4 res = float4(0.0, 0.0, 0.0, 1.0); + + if (unity_MetaFragmentControl.x) + { + // Apply diffuseColor Boost from LightmapSettings. + // put abs here to silent a warning, no cost, no impact as color is assume to be positive. + res.rgb = clamp(pow(abs(lightTransportData.diffuseColor), saturate(unity_OneOverOutputBoost)), 0, unity_MaxOutputValue); + } + + if (unity_MetaFragmentControl.y) + { + // emissive use HDR format + res.rgb = lightTransportData.emissiveColor; + } + + return res; + } + + + + ENDHLSL + } + + Pass + { + // based on HDLitPass.template + Name "SceneSelectionPass" + Tags { "LightMode" = "SceneSelectionPass" } + + Cull Off + ColorMask 0 + + Tags { "RenderType" = "Opaque" "Queue" = "Geometry" "PreviewType" = "Plane" } + Cull [_CullingOption] + ZWrite [_ZWrite] + ZTest [_ZTestMode] + + + HLSLPROGRAM + + #pragma target 4.5 + #pragma only_renderers d3d11 playstation xboxone xboxseries vulkan metal switch + #pragma multi_compile_instancing + #pragma editor_sync_compilation + #pragma instancing_options renderinglayer + + //#pragma shader_feature _ _SURFACE_TYPE_TRANSPARENT + //#pragma shader_feature_local _BLENDMODE_OFF _BLENDMODE_ALPHA _BLENDMODE_ADD _BLENDMODE_PRE_MULTIPLY + //#pragma shader_feature_local _ _ADD_PRECOMPUTED_VELOCITY + //#pragma shader_feature_local _ _TRANSPARENT_WRITES_MOTION_VEC + //#pragma shader_feature_local _ _ENABLE_FOG_ON_TRANSPARENT + //#pragma shader_feature_local _ _DISABLE_DECALS + //#pragma shader_feature_local _ _DISABLE_SSR + //#pragma shader_feature_local _ _DISABLE_SSR_TRANSPARENT + //#pragma shader_feature_local _REFRACTION_OFF _REFRACTION_PLANE _REFRACTION_SPHERE _REFRACTION_THIN + + //------------------------------------------------------------------------------------- + // Variant Definitions (active field translations to HDRP defines) + //------------------------------------------------------------------------------------- + // #define _MATERIAL_FEATURE_SUBSURFACE_SCATTERING 1 + // #define _MATERIAL_FEATURE_TRANSMISSION 1 + // #define _MATERIAL_FEATURE_ANISOTROPY 1 + // #define _MATERIAL_FEATURE_IRIDESCENCE 1 + // #define _MATERIAL_FEATURE_SPECULAR_COLOR 1 + #define _ENABLE_FOG_ON_TRANSPARENT 1 + // #define _AMBIENT_OCCLUSION 1 + // #define _SPECULAR_OCCLUSION_FROM_AO 1 + // #define _SPECULAR_OCCLUSION_FROM_AO_BENT_NORMAL 1 + // #define _SPECULAR_OCCLUSION_CUSTOM 1 + // #define _ENERGY_CONSERVING_SPECULAR 1 + // #define _ENABLE_GEOMETRIC_SPECULAR_AA 1 + // #define _HAS_REFRACTION 1 + // #define _REFRACTION_PLANE 1 + // #define _REFRACTION_SPHERE 1 + // #define _DISABLE_DECALS 1 + // #define _DISABLE_SSR 1 + // #define _ADD_PRECOMPUTED_VELOCITY + // #define _WRITE_TRANSPARENT_MOTION_VECTOR 1 + // #define _DEPTHOFFSET_ON 1 + // #define _BLENDMODE_PRESERVE_SPECULAR_LIGHTING 1 + + #define SHADERPASS SHADERPASS_DEPTH_ONLY + #define RAYTRACING_SHADER_GRAPH_DEFAULT + #define SCENESELECTIONPASS + #define _PASSSCENESELECT 1 + + + #pragma shader_feature_local GLOW_ON + #pragma shader_feature_local FADE_ON + #pragma shader_feature_local OUTBASE_ON + #pragma shader_feature_local ONLYOUTLINE_ON + #pragma shader_feature_local GRADIENT_ON + #pragma shader_feature_local GRADIENT2COL_ON + #pragma shader_feature_local RADIALGRADIENT_ON + #pragma shader_feature_local COLORSWAP_ON + #pragma shader_feature_local HSV_ON + #pragma shader_feature_local CHANGECOLOR_ON + #pragma shader_feature_local CHANGECOLOR2_ON + #pragma shader_feature_local CHANGECOLOR3_ON + #pragma shader_feature_local COLORRAMP_ON + #pragma shader_feature_local GRADIENTCOLORRAMP_ON + #pragma shader_feature_local HITEFFECT_ON + #pragma shader_feature_local NEGATIVE_ON + #pragma shader_feature_local PIXELATE_ON + #pragma shader_feature_local GREYSCALE_ON + #pragma shader_feature_local POSTERIZE_ON + #pragma shader_feature_local BLUR_ON + #pragma shader_feature_local MOTIONBLUR_ON + #pragma shader_feature_local GHOST_ON + #pragma shader_feature_local ALPHAOUTLINE_ON + #pragma shader_feature_local INNEROUTLINE_ON + #pragma shader_feature_local ONLYINNEROUTLINE_ON + #pragma shader_feature_local HOLOGRAM_ON + #pragma shader_feature_local CHROMABERR_ON + #pragma shader_feature_local GLITCH_ON + #pragma shader_feature_local FLICKER_ON + #pragma shader_feature_local SHADOW_ON + #pragma shader_feature_local SHINE_ON + #pragma shader_feature_local CONTRAST_ON + #pragma shader_feature_local OVERLAY_ON + #pragma shader_feature_local OVERLAYMULT_ON + #pragma shader_feature_local DOODLE_ON + #pragma shader_feature_local WIND_ON + #pragma shader_feature_local WAVEUV_ON + #pragma shader_feature_local ROUNDWAVEUV_ON + #pragma shader_feature_local RECTSIZE_ON + #pragma shader_feature_local OFFSETUV_ON + #pragma shader_feature_local CLIPPING_ON + #pragma shader_feature_local RADIALCLIPPING_ON + #pragma shader_feature_local TEXTURESCROLL_ON + #pragma shader_feature_local ZOOMUV_ON + #pragma shader_feature_local DISTORT_ON + #pragma shader_feature_local WARP_ON + #pragma shader_feature_local TWISTUV_ON + #pragma shader_feature_local ROTATEUV_ON + #pragma shader_feature_local POLARUV_ON + #pragma shader_feature_local FISHEYE_ON + #pragma shader_feature_local PINCH_ON + #pragma shader_feature_local SHAKEUV_ON + + #pragma shader_feature_local GLOWTEX_ON + #pragma shader_feature_local OUTTEX_ON + #pragma shader_feature_local OUTDIST_ON + #pragma shader_feature_local OUTBASE8DIR_ON + #pragma shader_feature_local OUTBASEPIXELPERF_ON + #pragma shader_feature_local COLORRAMPOUTLINE_ON + #pragma shader_feature_local GREYSCALEOUTLINE_ON + #pragma shader_feature_local POSTERIZEOUTLINE_ON + #pragma shader_feature_local BLURISHD_ON + #pragma shader_feature_local MANUALWIND_ON + #pragma shader_feature_local ATLAS_ON + #pragma shader_feature_local PREMULTIPLYALPHA_ON + + #pragma shader_feature BILBOARD_ON + #pragma shader_feature BILBOARDY_ON + + #pragma shader_feature NORMALMAP_ON + + + #define _HDRP 1 +#define _USINGTEXCOORD1 1 +#define _USINGTEXCOORD2 1 + + + #pragma vertex Vert + #pragma fragment Frag + + + + + // useful conversion functions to make surface shader code just work + + #define UNITY_DECLARE_TEX2D(name) TEXTURE2D(name); SAMPLER(sampler##name); + #define UNITY_DECLARE_TEX2D_NOSAMPLER(name) TEXTURE2D(name); + #define UNITY_DECLARE_TEX2DARRAY(name) TEXTURE2D_ARRAY(name); SAMPLER(sampler##name); + #define UNITY_DECLARE_TEX2DARRAY_NOSAMPLER(tex) TEXTURE2D_ARRAY(tex); + + #define UNITY_SAMPLE_TEX2DARRAY(tex,coord) SAMPLE_TEXTURE2D_ARRAY(tex, sampler##tex, coord.xy, coord.z) + #define UNITY_SAMPLE_TEX2DARRAY_LOD(tex,coord,lod) SAMPLE_TEXTURE2D_ARRAY_LOD(tex, sampler##tex, coord.xy, coord.z, lod) + #define UNITY_SAMPLE_TEX2D(tex, coord) SAMPLE_TEXTURE2D(tex, sampler##tex, coord) + #define UNITY_SAMPLE_TEX2D_SAMPLER(tex, samp, coord) SAMPLE_TEXTURE2D(tex, sampler##samp, coord) + + #define UNITY_SAMPLE_TEX2D_LOD(tex,coord, lod) SAMPLE_TEXTURE2D_LOD(tex, sampler_##tex, coord, lod) + #define UNITY_SAMPLE_TEX2D_SAMPLER_LOD(tex,samplertex,coord, lod) SAMPLE_TEXTURE2D_LOD (tex, sampler##samplertex,coord, lod) + + #if defined(UNITY_COMPILER_HLSL) + #define UNITY_INITIALIZE_OUTPUT(type,name) name = (type)0; + #else + #define UNITY_INITIALIZE_OUTPUT(type,name) + #endif + + #define sampler2D_float sampler2D + #define sampler2D_half sampler2D + + #undef WorldNormalVector + #define WorldNormalVector(data, normal) mul(normal, data.TBNMatrix) + + #define UnityObjectToWorldNormal(normal) mul(GetObjectToWorldMatrix(), normal) + + #ifndef SHADER_STAGE_FRAGMENT + #if !defined(SHADOW_ULTRA_LOW) && !defined(SHADOW_LOW) && !defined(SHADOW_MEDIUM) && !defined(SHADOW_HIGH) // ultra low come from volumetricLighting.compute + #define SHADOW_MEDIUM + #endif + #if !defined(AREA_SHADOW_LOW) && !defined(AREA_SHADOW_MEDIUM) && !defined(AREA_SHADOW_HIGH) // low come from volumetricLighting.compute + #define AREA_SHADOW_MEDIUM + #endif + #endif + + + +// HDRP Adapter stuff + #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Common.hlsl" + #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Common.hlsl" + #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/GeometricTools.hlsl" // Required by Tessellation.hlsl + #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Tessellation.hlsl" + #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Texture.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/ShaderVariables.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/ShaderPass/ShaderPass.cs.hlsl" + #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/TextureStack.hlsl" // Required to be include before we include properties as it define DECLARE_STACK_CB + #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/DebugMipmapStreamingMacros.hlsl" // Required before including properties as it defines UNITY_TEXTURE_STREAMING_DEBUG_VARS + // Always include Shader Graph version + // Always include last to avoid double macros + #include "Packages/com.unity.shadergraph/ShaderGraphLibrary/Functions.hlsl" // Need to be here for Gradient struct definition + + +#include "Packages/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/ShaderPass/FragInputs.hlsl" + + + + #ifdef RAYTRACING_SHADER_GRAPH_DEFAULT + #define RAYTRACING_SHADER_GRAPH_HIGH + #endif + + #ifdef RAYTRACING_SHADER_GRAPH_RAYTRACED + #define RAYTRACING_SHADER_GRAPH_LOW + #endif + // end + + + + + // If we use subsurface scattering, enable output split lighting (for forward pass) + #if defined(_MATERIAL_FEATURE_SUBSURFACE_SCATTERING) && !defined(_SURFACE_TYPE_TRANSPARENT) + #define OUTPUT_SPLIT_LIGHTING + #endif + + #define HAVE_RECURSIVE_RENDERING + + #if SHADERPASS == SHADERPASS_TRANSPARENT_DEPTH_PREPASS + #if !defined(_DISABLE_SSR_TRANSPARENT) && !defined(SHADER_UNLIT) + #define WRITE_NORMAL_BUFFER + #endif + #endif + + #ifndef DEBUG_DISPLAY + // In case of opaque we don't want to perform the alpha test, it is done in depth prepass and we use depth equal for ztest (setup from UI) + // Don't do it with debug display mode as it is possible there is no depth prepass in this case + #if !defined(_SURFACE_TYPE_TRANSPARENT) && defined(_ALPHATEST) + #if SHADERPASS == SHADERPASS_FORWARD + #define SHADERPASS_FORWARD_BYPASS_ALPHA_TEST + #elif SHADERPASS == SHADERPASS_GBUFFER + #define SHADERPASS_GBUFFER_BYPASS_ALPHA_TEST + #endif + #endif + #endif + + // Define _DEFERRED_CAPABLE_MATERIAL for shader capable to run in deferred pass + #if defined(SHADER_LIT) && !defined(_SURFACE_TYPE_TRANSPARENT) + #define _DEFERRED_CAPABLE_MATERIAL + #endif + + // Translate transparent motion vector define + #if defined(_TRANSPARENT_WRITES_MOTION_VEC) && defined(_SURFACE_TYPE_TRANSPARENT) + #define _WRITE_TRANSPARENT_MOTION_VECTOR + #endif + + + + + CBUFFER_START(UnityPerMaterial) + float _UseShadowThreshold; + float _BlendMode; + float _EnableBlendModePreserveSpecularLighting; + float _RayTracing; + float _RefractionModel; + + + half4 _Color; + half4 _MainTex_ST, _MainTex_TexelSize; + half _Alpha, _AlphaCutoffValue; + + #if ATLAS_ON + half _MinXUV, _MaxXUV, _MinYUV, _MaxYUV; + #endif + + #if GLOW_ON + half4 _GlowColor; + half _Glow, _GlowGlobal; + #endif + + #if HSV_ON + half _HsvShift, _HsvSaturation, _HsvBright; + #endif + + #if DISTORT_ON + half4 _DistortTex_ST; + half _DistortTexXSpeed, _DistortTexYSpeed, _DistortAmount; + #endif + + #if FADE_ON + half4 _FadeBurnColor, _FadeTex_ST, _FadeBurnTex_ST; + half _FadeAmount, _FadeBurnWidth, _FadeBurnTransition,_FadeBurnGlow; + #endif + + #if OUTBASE_ON + half4 _OutlineColor; + half _OutlineAlpha, _OutlineGlow, _OutlineWidth; + int _OutlinePixelWidth; + #endif + + #if OUTTEX_ON + half4 _OutlineTex_ST; + half _OutlineTexXSpeed, _OutlineTexYSpeed; + #endif + + #if OUTDIST_ON + half4 _OutlineDistortTex_ST; + half _OutlineDistortTexXSpeed, _OutlineDistortTexYSpeed, _OutlineDistortAmount; + #endif + + #if ALPHAOUTLINE_ON + half _AlphaOutlineGlow, _AlphaOutlinePower, _AlphaOutlineMinAlpha, _AlphaOutlineBlend; + half4 _AlphaOutlineColor; + #endif + + #if INNEROUTLINE_ON + half _InnerOutlineThickness, _InnerOutlineAlpha, _InnerOutlineGlow; + half4 _InnerOutlineColor; + #endif + + #if GRADIENT_ON + half _GradBlend, _GradBoostX, _GradBoostY; + half4 _GradTopRightCol, _GradTopLeftCol, _GradBotRightCol, _GradBotLeftCol; + #endif + + #if COLORSWAP_ON + half4 _ColorSwapRed, _ColorSwapGreen, _ColorSwapBlue; + half _ColorSwapRedLuminosity, _ColorSwapGreenLuminosity, _ColorSwapBlueLuminosity, _ColorSwapBlend; + #endif + + #if CHANGECOLOR_ON + half4 _ColorChangeNewCol, _ColorChangeTarget; + half _ColorChangeTolerance, _ColorChangeLuminosity; + #endif + #if CHANGECOLOR2_ON + half4 _ColorChangeNewCol2, _ColorChangeTarget2; + half _ColorChangeTolerance2; + #endif + #if CHANGECOLOR3_ON + half4 _ColorChangeNewCol3, _ColorChangeTarget3; + half _ColorChangeTolerance3; + #endif + + #if COLORRAMP_ON + half _ColorRampLuminosity, _ColorRampBlend; + #endif + + #if HITEFFECT_ON + half4 _HitEffectColor; + half _HitEffectGlow, _HitEffectBlend; + #endif + + #if NEGATIVE_ON + half _NegativeAmount; + #endif + + #if PIXELATE_ON + half _PixelateSize; + #endif + + #if GREYSCALE_ON + half _GreyscaleLuminosity, _GreyscaleBlend; + half4 _GreyscaleTintColor; + #endif + + #if POSTERIZE_ON + half _PosterizeNumColors, _PosterizeGamma; + #endif + + #if BLUR_ON + half _BlurIntensity; + #endif + + #if MOTIONBLUR_ON + half _MotionBlurAngle, _MotionBlurDist; + #endif + + #if GHOST_ON + half _GhostColorBoost, _GhostTransparency, _GhostBlend; + #endif + + #if HOLOGRAM_ON + half _HologramStripesAmount, _HologramMinAlpha, _HologramUnmodAmount, _HologramStripesSpeed, _HologramMaxAlpha, _HologramBlend; + half4 _HologramStripeColor; + #endif + + #if CHROMABERR_ON + half _ChromAberrAmount, _ChromAberrAlpha; + #endif + + #if GLITCH_ON + half _GlitchAmount, _GlitchSize; + #endif + + #if FLICKER_ON + half _FlickerFreq, _FlickerPercent, _FlickerAlpha; + #endif + + #if SHADOW_ON + half _ShadowX, _ShadowY, _ShadowAlpha; + half4 _ShadowColor; + #endif + + #if SHINE_ON + half4 _ShineColor; + half _ShineLocation, _ShineRotate, _ShineWidth, _ShineGlow; + #endif + + #if CONTRAST_ON + half _Contrast, _Brightness; + #endif + + #if OVERLAY_ON + half4 _OverlayTex_ST, _OverlayColor; + half _OverlayGlow, _OverlayBlend, _OverlayTextureScrollXSpeed, _OverlayTextureScrollYSpeed; + #endif + + #if DOODLE_ON + half _HandDrawnAmount, _HandDrawnSpeed; + #endif + + #if WIND_ON + half _GrassSpeed, _GrassWind, _GrassManualAnim, _GrassRadialBend; + #endif + + #if WAVEUV_ON + float _WaveAmount, _WaveSpeed, _WaveStrength, _WaveX, _WaveY; + #endif + + #if ROUNDWAVEUV_ON + half _RoundWaveStrength, _RoundWaveSpeed; + #endif + + #if RECTSIZE_ON + half _RectSize; + #endif + + #if OFFSETUV_ON + half _OffsetUvX, _OffsetUvY; + #endif + + #if CLIPPING_ON + half _ClipUvLeft, _ClipUvRight, _ClipUvUp, _ClipUvDown; + #endif + + #if RADIALCLIPPING_ON + half _RadialStartAngle, _RadialClip, _RadialClip2; + #endif + + #if TEXTURESCROLL_ON + half _TextureScrollXSpeed, _TextureScrollYSpeed; + #endif + + #if ZOOMUV_ON + half _ZoomUvAmount; + #endif + + #if WARP_ON + half _WarpStrength, _WarpSpeed, _WarpScale; + #endif + + #if TWISTUV_ON + half _TwistUvAmount, _TwistUvPosX, _TwistUvPosY, _TwistUvRadius; + #endif + + #if ROTATEUV_ON + half _RotateUvAmount; + #endif + + #if FISHEYE_ON + half _FishEyeUvAmount; + #endif + + #if PINCH_ON + half _PinchUvAmount; + #endif + + #if SHAKEUV_ON + half _ShakeUvSpeed, _ShakeUvX, _ShakeUvY; + #endif + + #if NORMALMAP_ON + half _NormalStrength; + #endif + + float _RandomSeed; + + + + + CBUFFER_END + + + + // -- Property used by ScenePickingPass + #ifdef SCENEPICKINGPASS + float4 _SelectionID; + #endif + + // -- Properties used by SceneSelectionPass + #ifdef SCENESELECTIONPASS + int _ObjectId; + int _PassValue; + #endif + + + // data across stages, stripped like the above. + struct VertexToPixel + { + float4 pos : SV_POSITION; + float3 worldPos : TEXCOORD0; + float3 worldNormal : TEXCOORD1; + float4 worldTangent : TEXCOORD2; + float4 texcoord0 : TEXCOORD3; + float4 texcoord1 : TEXCOORD4; + float4 texcoord2 : TEXCOORD5; + // #if %TEXCOORD3REQUIREKEY% + float4 texcoord3 : TEXCOORD6; + // #endif + + // #if %SCREENPOSREQUIREKEY% + // float4 screenPos : TEXCOORD7; + // #endif + + // #if %VERTEXCOLORREQUIREKEY% + float4 vertexColor : COLOR; + // #endif + + // #if %EXTRAV2F0REQUIREKEY% + // float4 extraV2F0 : TEXCOORD8; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // float4 extraV2F1 : TEXCOORD9; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // float4 extraV2F2 : TEXCOORD10; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // float4 extraV2F3 : TEXCOORD11; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // float4 extraV2F4 : TEXCOORD12; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // float4 extraV2F5 : TEXCOORD13; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // float4 extraV2F6 : TEXCOORD14; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // float4 extraV2F7 : TEXCOORD15; + // #endif + + #if UNITY_ANY_INSTANCING_ENABLED + UNITY_VERTEX_INPUT_INSTANCE_ID + #endif // UNITY_ANY_INSTANCING_ENABLED + + #if _HDRP && (_PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR))) + float4 previousPositionCS : TEXCOORD16; // Contain previous transform position (in case of skinning for example) + float4 motionVectorCS : TEXCOORD17; + #endif + + UNITY_VERTEX_OUTPUT_STEREO + }; + + + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Debug/DebugDisplay.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/Material.hlsl" + #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/NormalSurfaceGradient.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/Lit/Lit.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/BuiltinUtilities.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/MaterialUtilities.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/Decal/DecalUtilities.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/Lit/LitDecalData.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/ShaderGraphFunctions.hlsl" + + + + + // data describing the user output of a pixel + struct Surface + { + half3 Albedo; + half Height; + half3 Normal; + half Smoothness; + half3 Emission; + half Metallic; + half3 Specular; + half Occlusion; + half SpecularPower; // for simple lighting + half Alpha; + float outputDepth; // if written, SV_Depth semantic is used. ShaderData.clipPos.z is unused value + // HDRP Only + half SpecularOcclusion; + half SubsurfaceMask; + half Thickness; + half CoatMask; + half CoatSmoothness; + half Anisotropy; + half IridescenceMask; + half IridescenceThickness; + int DiffusionProfileHash; + float SpecularAAThreshold; + float SpecularAAScreenSpaceVariance; + // requires _OVERRIDE_BAKEDGI to be defined, but is mapped in all pipelines + float3 DiffuseGI; + float3 BackDiffuseGI; + float3 SpecularGI; + float ior; + float3 transmittanceColor; + float atDistance; + float transmittanceMask; + // requires _OVERRIDE_SHADOWMASK to be defines + float4 ShadowMask; + + // for decals + float NormalAlpha; + float MAOSAlpha; + + + }; + + // Data the user declares in blackboard blocks + struct Blackboard + { + + float blackboardDummyData; + }; + + // data the user might need, this will grow to be big. But easy to strip + struct ShaderData + { + float4 clipPos; // SV_POSITION + float3 localSpacePosition; + float3 localSpaceNormal; + float3 localSpaceTangent; + + float3 worldSpacePosition; + float3 worldSpaceNormal; + float3 worldSpaceTangent; + float tangentSign; + + float3 worldSpaceViewDir; + float3 tangentSpaceViewDir; + + float4 texcoord0; + float4 texcoord1; + float4 texcoord2; + float4 texcoord3; + + float2 screenUV; + float4 screenPos; + + float4 vertexColor; + bool isFrontFace; + + float4 extraV2F0; + float4 extraV2F1; + float4 extraV2F2; + float4 extraV2F3; + float4 extraV2F4; + float4 extraV2F5; + float4 extraV2F6; + float4 extraV2F7; + + float3x3 TBNMatrix; + Blackboard blackboard; + }; + + struct VertexData + { + #if SHADER_TARGET > 30 + // uint vertexID : SV_VertexID; + #endif + float4 vertex : POSITION; + float3 normal : NORMAL; + float4 tangent : TANGENT; + float4 texcoord0 : TEXCOORD0; + + // optimize out mesh coords when not in use by user or lighting system + #if _URP && (_USINGTEXCOORD1 || _PASSMETA || _PASSFORWARD || _PASSGBUFFER) + float4 texcoord1 : TEXCOORD1; + #endif + + #if _URP && (_USINGTEXCOORD2 || _PASSMETA || ((_PASSFORWARD || _PASSGBUFFER) && defined(DYNAMICLIGHTMAP_ON))) + float4 texcoord2 : TEXCOORD2; + #endif + + #if _STANDARD && (_USINGTEXCOORD1 || (_PASSMETA || ((_PASSFORWARD || _PASSGBUFFER || _PASSFORWARDADD) && LIGHTMAP_ON))) + float4 texcoord1 : TEXCOORD1; + #endif + #if _STANDARD && (_USINGTEXCOORD2 || (_PASSMETA || ((_PASSFORWARD || _PASSGBUFFER) && DYNAMICLIGHTMAP_ON))) + float4 texcoord2 : TEXCOORD2; + #endif + + + #if _HDRP + float4 texcoord1 : TEXCOORD1; + float4 texcoord2 : TEXCOORD2; + #endif + + // #if %TEXCOORD3REQUIREKEY% + float4 texcoord3 : TEXCOORD3; + // #endif + + // #if %VERTEXCOLORREQUIREKEY% + float4 vertexColor : COLOR; + // #endif + + #if _PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR)) + float3 previousPositionOS : TEXCOORD4; // Contain previous transform position (in case of skinning for example) + #if defined (_ADD_PRECOMPUTED_VELOCITY) + float3 precomputedVelocity : TEXCOORD5; // Add Precomputed Velocity (Alembic computes velocities on runtime side). + #endif + #endif + + UNITY_VERTEX_INPUT_INSTANCE_ID + }; + + struct TessVertex + { + float4 vertex : INTERNALTESSPOS; + float3 normal : NORMAL; + float4 tangent : TANGENT; + float4 texcoord0 : TEXCOORD0; + float4 texcoord1 : TEXCOORD1; + float4 texcoord2 : TEXCOORD2; + + // #if %TEXCOORD3REQUIREKEY% + float4 texcoord3 : TEXCOORD3; + // #endif + + // #if %VERTEXCOLORREQUIREKEY% + float4 vertexColor : COLOR; + // #endif + + // #if %EXTRAV2F0REQUIREKEY% + // float4 extraV2F0 : TEXCOORD5; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // float4 extraV2F1 : TEXCOORD6; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // float4 extraV2F2 : TEXCOORD7; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // float4 extraV2F3 : TEXCOORD8; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // float4 extraV2F4 : TEXCOORD9; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // float4 extraV2F5 : TEXCOORD10; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // float4 extraV2F6 : TEXCOORD11; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // float4 extraV2F7 : TEXCOORD12; + // #endif + + #if _PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR)) + float3 previousPositionOS : TEXCOORD13; // Contain previous transform position (in case of skinning for example) + #if defined (_ADD_PRECOMPUTED_VELOCITY) + float3 precomputedVelocity : TEXCOORD14; + #endif + #endif + + UNITY_VERTEX_INPUT_INSTANCE_ID + UNITY_VERTEX_OUTPUT_STEREO + }; + + struct ExtraV2F + { + float4 extraV2F0; + float4 extraV2F1; + float4 extraV2F2; + float4 extraV2F3; + float4 extraV2F4; + float4 extraV2F5; + float4 extraV2F6; + float4 extraV2F7; + Blackboard blackboard; + float4 time; + }; + + + float3 WorldToTangentSpace(ShaderData d, float3 normal) + { + return mul(d.TBNMatrix, normal); + } + + float3 TangentToWorldSpace(ShaderData d, float3 normal) + { + return mul(normal, d.TBNMatrix); + } + + // in this case, make standard more like SRPs, because we can't fix + // unity_WorldToObject in HDRP, since it already does macro-fu there + + #if _STANDARD + float3 TransformWorldToObject(float3 p) { return mul(unity_WorldToObject, float4(p, 1)); }; + float3 TransformObjectToWorld(float3 p) { return mul(unity_ObjectToWorld, float4(p, 1)); }; + float4 TransformWorldToObject(float4 p) { return mul(unity_WorldToObject, p); }; + float4 TransformObjectToWorld(float4 p) { return mul(unity_ObjectToWorld, p); }; + float4x4 GetWorldToObjectMatrix() { return unity_WorldToObject; } + float4x4 GetObjectToWorldMatrix() { return unity_ObjectToWorld; } + #if (defined(SHADER_API_D3D11) || defined(SHADER_API_XBOXONE) || defined(UNITY_COMPILER_HLSLCC) || defined(SHADER_API_PSSL) || (SHADER_TARGET_SURFACE_ANALYSIS && !SHADER_TARGET_SURFACE_ANALYSIS_MOJOSHADER)) + #define UNITY_SAMPLE_TEX2D_LOD(tex,coord, lod) tex.SampleLevel (sampler##tex,coord, lod) + #define UNITY_SAMPLE_TEX2D_SAMPLER_LOD(tex,samplertex,coord, lod) tex.SampleLevel (sampler##samplertex,coord, lod) + #else + #define UNITY_SAMPLE_TEX2D_LOD(tex,coord,lod) tex2D (tex,coord,0,lod) + #define UNITY_SAMPLE_TEX2D_SAMPLER_LOD(tex,samplertex,coord,lod) tex2D (tex,coord,0,lod) + #endif + + #undef GetWorldToObjectMatrix() + + #define GetWorldToObjectMatrix() unity_WorldToObject + + + #endif + + float3 GetCameraWorldPosition() + { + #if _HDRP + return GetCameraRelativePositionWS(_WorldSpaceCameraPos); + #else + return _WorldSpaceCameraPos; + #endif + } + + #if _GRABPASSUSED + #if _STANDARD + TEXTURE2D(%GRABTEXTURE%); + SAMPLER(sampler_%GRABTEXTURE%); + #endif + + half3 GetSceneColor(float2 uv) + { + #if _STANDARD + return SAMPLE_TEXTURE2D(%GRABTEXTURE%, sampler_%GRABTEXTURE%, uv).rgb; + #else + return SHADERGRAPH_SAMPLE_SCENE_COLOR(uv); + #endif + } + #endif + + + + #if _STANDARD + UNITY_DECLARE_DEPTH_TEXTURE(_CameraDepthTexture); + float GetSceneDepth(float2 uv) { return SAMPLE_DEPTH_TEXTURE(_CameraDepthTexture, uv); } + float GetLinear01Depth(float2 uv) { return Linear01Depth(GetSceneDepth(uv)); } + float GetLinearEyeDepth(float2 uv) { return LinearEyeDepth(GetSceneDepth(uv)); } + #else + float GetSceneDepth(float2 uv) { return SHADERGRAPH_SAMPLE_SCENE_DEPTH(uv); } + float GetLinear01Depth(float2 uv) { return Linear01Depth(GetSceneDepth(uv), _ZBufferParams); } + float GetLinearEyeDepth(float2 uv) { return LinearEyeDepth(GetSceneDepth(uv), _ZBufferParams); } + #endif + + float3 GetWorldPositionFromDepthBuffer(float2 uv, float3 worldSpaceViewDir) + { + float eye = GetLinearEyeDepth(uv); + float3 camView = mul((float3x3)GetObjectToWorldMatrix(), transpose(mul(GetWorldToObjectMatrix(), UNITY_MATRIX_I_V)) [2].xyz); + + float dt = dot(worldSpaceViewDir, camView); + float3 div = worldSpaceViewDir/dt; + float3 wpos = (eye * div) + GetCameraWorldPosition(); + return wpos; + } + + #if _HDRP + float3 ObjectToWorldSpacePosition(float3 pos) + { + return GetAbsolutePositionWS(TransformObjectToWorld(pos)); + } + #else + float3 ObjectToWorldSpacePosition(float3 pos) + { + return TransformObjectToWorld(pos); + } + #endif + + #if _STANDARD + UNITY_DECLARE_SCREENSPACE_TEXTURE(_CameraDepthNormalsTexture); + float3 GetSceneNormal(float2 uv, float3 worldSpaceViewDir) + { + float4 depthNorms = UNITY_SAMPLE_SCREENSPACE_TEXTURE(_CameraDepthNormalsTexture, uv); + float3 norms = DecodeViewNormalStereo(depthNorms); + norms = mul((float3x3)GetWorldToViewMatrix(), norms) * 0.5 + 0.5; + return norms; + } + #elif _HDRP && !_DECALSHADER + + float3 GetSceneNormal(float2 uv, float3 worldSpaceViewDir) + { + NormalData nd; + DecodeFromNormalBuffer(_ScreenSize.xy * uv, nd); + return nd.normalWS; + } + #elif _URP + #if (SHADER_LIBRARY_VERSION_MAJOR >= 10) + #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/DeclareNormalsTexture.hlsl" + #endif + + float3 GetSceneNormal(float2 uv, float3 worldSpaceViewDir) + { + #if (SHADER_LIBRARY_VERSION_MAJOR >= 10) + return SampleSceneNormals(uv); + #else + float3 wpos = GetWorldPositionFromDepthBuffer(uv, worldSpaceViewDir); + return normalize(-cross(ddx(wpos), ddy(wpos))) * 0.5 + 0.5; + #endif + + } + #endif + + #if _HDRP + + half3 UnpackNormalmapRGorAG(half4 packednormal) + { + // This do the trick + packednormal.x *= packednormal.w; + + half3 normal; + normal.xy = packednormal.xy * 2 - 1; + normal.z = sqrt(1 - saturate(dot(normal.xy, normal.xy))); + return normal; + } + half3 UnpackNormal(half4 packednormal) + { + #if defined(UNITY_NO_DXT5nm) + return packednormal.xyz * 2 - 1; + #else + return UnpackNormalmapRGorAG(packednormal); + #endif + } + #endif + #if _HDRP || _URP + + half3 UnpackScaleNormal(half4 packednormal, half scale) + { + #ifndef UNITY_NO_DXT5nm + // Unpack normal as DXT5nm (1, y, 1, x) or BC5 (x, y, 0, 1) + // Note neutral texture like "bump" is (0, 0, 1, 1) to work with both plain RGB normal and DXT5nm/BC5 + packednormal.x *= packednormal.w; + #endif + half3 normal; + normal.xy = (packednormal.xy * 2 - 1) * scale; + normal.z = sqrt(1 - saturate(dot(normal.xy, normal.xy))); + return normal; + } + + #endif + + + void GetSun(out float3 lightDir, out float3 color) + { + lightDir = float3(0.5, 0.5, 0); + color = 1; + #if _HDRP + if (_DirectionalLightCount > 0) + { + DirectionalLightData light = _DirectionalLightDatas[0]; + lightDir = -light.forward.xyz; + color = light.color; + } + #elif _STANDARD + lightDir = normalize(_WorldSpaceLightPos0.xyz); + color = _LightColor0.rgb; + #elif _URP + Light light = GetMainLight(); + lightDir = light.direction; + color = light.color; + #endif + } + + + + + + + + + + TEXTURE2D(_MainTex); + SAMPLER(sampler_MainTex); + + #if GLOW_ON + TEXTURE2D(_GlowTex); + SAMPLER(sampler_GlowTex); + #endif + + #if FADE_ON + TEXTURE2D(_FadeTex); + SAMPLER(sampler_FadeTex); + + TEXTURE2D(_FadeBurnTex); + SAMPLER(sampler_FadeBurnTex); + #endif + + #if DISTORT_ON + TEXTURE2D(_DistortTex); + SAMPLER(sampler_DistortTex); + #endif + + #if OUTTEX_ON + TEXTURE2D(_OutlineTex); + SAMPLER(sampler_OutlineTex); + #endif + + #if OUTDIST_ON + TEXTURE2D(_OutlineDistortTex); + SAMPLER(sampler_OutlineDistortTex); + #endif + + #if COLORSWAP_ON + TEXTURE2D(_ColorSwapTex); + SAMPLER(sampler_ColorSwapTex); + #endif + + #if COLORRAMP_ON + TEXTURE2D(_ColorRampTex); + TEXTURE2D(_ColorRampTexGradient); + SAMPLER(sampler_ColorRampTex); + SAMPLER(sampler_ColorRampTexGradient); + #endif + + #if SHINE_ON + TEXTURE2D(_ShineMask); + SAMPLER(sampler_ShineMask); + #endif + + #if OVERLAY_ON + TEXTURE2D(_OverlayTex); + SAMPLER(sampler_OverlayTex); + #endif + + #if NORMALMAP_ON + TEXTURE2D(_NormalMap); + SAMPLER(sampler_NormalMap); + #endif + + + half3 GetPixel(in int offsetX, in int offsetY, in half2 uv, in Texture2D _tex, in SamplerState _sampler) + { + half2 _uv = uv + half2(offsetX * _MainTex_TexelSize.x, offsetY * _MainTex_TexelSize.y); + half4 col = SAMPLE_TEXTURE2D(_tex, _sampler, _uv); + return col.rgb; + } + + + //BLURS------------------------------------------------------------------------- + half4 Blur(half2 uv, Texture2D source, SamplerState sampler_source, half Intensity) + { + const half2 texelSize = 1.0 / _ScreenParams.xy; + const half4 color = SAMPLE_TEXTURE2D(source, sampler_source, uv); + const half2 offset = Intensity * texelSize; + + half4 accumulatedColor = color; + half accumulatedWeight = 1.0; + for (int x = -1; x <= 1; x++) + { + for (int y = -1; y <= 1; y++) + { + const half2 sampleUV = uv + half2(x, y) * offset; + const half4 sampleColor = SAMPLE_TEXTURE2D(source, sampler_source, sampleUV); + + accumulatedColor += sampleColor; + accumulatedWeight += 1.0; + } + } + + half4 blurredColor = accumulatedColor / accumulatedWeight; + return blurredColor; + } + + half BlurHD_G(half bhqp, half x) + { + return exp(-(x * x) / (2.0 * bhqp * bhqp)); + } + half4 BlurHD(half2 uv, Texture2D source, SamplerState sampler_source, half BlurAmount, half xScale, half yScale) + { + int iterations = 16; + int halfIterations = iterations / 2; + half sigmaX = 0.1 + BlurAmount * 0.5; + half sigmaY = sigmaX; + half total = 0.0; + half4 ret = half4(0, 0, 0, 0); + for (int iy = 0; iy < iterations; ++iy) + { + half fy = BlurHD_G(sigmaY, half(iy) -half(halfIterations)); + half offsetY = half(iy - halfIterations) * 0.00390625 * xScale; + for (int ix = 0; ix < iterations; ++ix) + { + half fx = BlurHD_G(sigmaX, half(ix) - half(halfIterations)); + half offsetX = half(ix - halfIterations) * 0.00390625 * yScale; + total += fx * fy; + ret += SAMPLE_TEXTURE2D(source, sampler_source, uv + half2(offsetX, offsetY)) * fx * fy; + } + } + return ret / total; + } + //----------------------------------------------------------------------- + + + //------------------------------------------- + half RemapFloat(half inValue, half inMin, half inMax, half outMin, half outMax){ + return outMin + (inValue - inMin) * (outMax - outMin) / (inMax - inMin); + } + //------------------------------------------- + + //----------------------------------------------------------------------- + half rand(half2 seed, half offset) { + return (frac(sin(dot(seed, half2(12.9898, 78.233))) * 43758.5453) + offset) % 1.0; + } + + half rand2(half2 seed, half offset) { + return (frac(sin(dot(seed * floor(50 + (_Time.x % 1.0) * 12.), half2(127.1, 311.7))) * 43758.5453123) + offset) % 1.0; + } + + half rand2CustomTime(half2 seed, half offset, half customTime) { + return (frac(sin(dot(seed * floor(50 + (customTime % 1.0) * 12.), half2(127.1, 311.7))) * 43758.5453123) + offset) % 1.0; + } + //----------------------------------------------------------------------- + + + void Ext_ModifyVertex0 (inout VertexData v, inout ExtraV2F d) + { + //BILBOARD_ON + #if BILBOARD_ON + half3 camRight = mul((half3x3)unity_CameraToWorld, half3(1,0,0)); + half3 camUp = half3(0,1,0); + #if BILBOARDY_ON + camUp = mul((half3x3)unity_CameraToWorld, half3(0,1,0)); + #endif + half3 localPos = v.vertex.x * camRight + v.vertex.y * camUp; + v.vertex = half4(localPos, 1); + #endif + //----------------------------------------------------------- + + v.texcoord0.xy = TRANSFORM_TEX(v.texcoord0.xy, _MainTex); + half2 center = half2(0.5, 0.5); + #if ATLAS_ON + center = half2((_MaxXUV + _MinXUV) / 2.0, (_MaxYUV + _MinYUV) / 2.0); + #endif + + //POLARUV_ON + #if POLARUV_ON + v.texcoord0.xy = v.texcoord0.xy - center; + #endif + + //---------------------------------------- + + //ROTATEUV_ON + #if ROTATEUV_ON + half2 uvC = v.texcoord0.xy; + half cosAngle = cos(_RotateUvAmount); + half sinAngle = sin(_RotateUvAmount); + half2x2 rot = half2x2(cosAngle, -sinAngle, sinAngle, cosAngle); + uvC -= center; + v.texcoord0.xy = mul(rot, uvC); + v.texcoord0.xy += center; + #endif + //-------------------- + + #if RECTSIZE_ON + v.vertex.xyz += (v.vertex.xyz * (_RectSize - 1.0)); + #endif + + #if OUTTEX_ON + v.texcoord1.xy = TRANSFORM_TEX(v.texcoord0.xy, _OutlineTex); + #endif + + #if OUTDIST_ON + v.texcoord2.xy = TRANSFORM_TEX(v.texcoord0.xy, _OutlineDistortTex); + #endif + + #if DISTORT_ON + v.texcoord3.xy = TRANSFORM_TEX(v.texcoord0.xy, _DistortTex); + #endif + } + + void Ext_SurfaceFunction0 (inout Surface o, ShaderData d) + { + half randomSeed = _RandomSeed; + + float2 uvRect = d.texcoord0; + half2 center = half2(0.5, 0.5); + #if ATLAS_ON + center = half2((_MaxXUV + _MinXUV) / 2.0, (_MaxYUV + _MinYUV) / 2.0); + uvRect = half2((d.texcoord0.x - _MinXUV) / (_MaxXUV - _MinXUV), (d.texcoord0.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half2 centerTiled = half2(center.x * _MainTex_ST.x, center.y * _MainTex_ST.y); + + //CLIPPING_ON + #if CLIPPING_ON + half2 tiledUv = half2(d.texcoord0.x / _MainTex_ST.x, d.texcoord0.y / _MainTex_ST.y); + #if ATLAS_ON + tiledUv = half2((tiledUv.x - _MinXUV) / (_MaxXUV - _MinXUV), (tiledUv.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + clip((1 - _ClipUvUp) - tiledUv.y); + clip(tiledUv.y - _ClipUvDown); + clip((1 - _ClipUvRight) - tiledUv.x); + clip(tiledUv.x - _ClipUvLeft); + #endif + //---------------------------------- + + //RADIALCLIPPING_ON + #if RADIALCLIPPING_ON + half2 tiledUv2 = half2(d.texcoord0.x / _MainTex_ST.x, d.texcoord0.y / _MainTex_ST.y); + #if ATLAS_ON + tiledUv2 = half2((tiledUv2.x - _MinXUV) / (_MaxXUV - _MinXUV), (tiledUv2.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half startAngle = _RadialStartAngle - _RadialClip; + half endAngle = _RadialStartAngle + _RadialClip2; + half offset0 = clamp(0, 360, startAngle + 360); + half offset360 = clamp(0, 360, endAngle - 360); + half2 atan2Coord = half2(lerp(-1, 1, tiledUv2.x), lerp(-1, 1, tiledUv2.y)); + half atanAngle = atan2(atan2Coord.y, atan2Coord.x) * 57.3; // angle in degrees + if(atanAngle < 0) atanAngle = 360 + atanAngle; + if(atanAngle >= startAngle && atanAngle <= endAngle) discard; + if(atanAngle <= offset360) discard; + if(atanAngle >= offset0) discard; + #endif + + //----------------------------- + + //TEXTURESCROLL_ON && ATLAS_ON + #if TEXTURESCROLL_ON && ATLAS_ON + d.texcoord0.xy = half2(_MinXUV + ((_MaxXUV - _MinXUV) * (abs(((_Time.y + randomSeed) * _TextureScrollXSpeed) + uvRect.x) % 1)), + _MinYUV + ((_MaxYUV - _MinYUV) * (abs(((_Time.y + randomSeed) * _TextureScrollYSpeed) + uvRect.y) % 1))); + #endif + //---------------------------- + + //OFFSETUV_ON + #if OFFSETUV_ON + #if ATLAS_ON + d.texcoord0.xy = half2(_MinXUV + ((_MaxXUV - _MinXUV) * (abs((_OffsetUvX + uvRect.x) % 1))), + _MinYUV + ((_MaxYUV - _MinYUV) * (abs(_OffsetUvY + uvRect.y) % 1))); + #else + d.texcoord0.xy += half2(_OffsetUvX, _OffsetUvY); + #endif + #endif + + //---------------------- + + //POLARUV_ON + #if POLARUV_ON + d.texcoord0.xy = half2(atan2(d.texcoord0.y, d.texcoord0.x) / (2.0f * 3.141592653589f), length(d.texcoord0.xy)); + d.texcoord0.xy *= _MainTex_ST.xy; + #endif + + //-------------------------------------- + + //TWISTUV_ON + #if TWISTUV_ON + #if ATLAS_ON + _TwistUvPosX = ((_MaxXUV - _MinXUV) * _TwistUvPosX) + _MinXUV; + _TwistUvPosY = ((_MaxYUV - _MinYUV) * _TwistUvPosY) + _MinYUV; + #endif + half2 tempUv = d.texcoord0.xy - half2(_TwistUvPosX * _MainTex_ST.x, _TwistUvPosY * _MainTex_ST.y); + _TwistUvRadius *= (_MainTex_ST.x + _MainTex_ST.y) / 2; + half percent = (_TwistUvRadius - length(tempUv)) / _TwistUvRadius; + half theta = percent * percent * (2.0 * sin(_TwistUvAmount)) * 8.0; + half s = sin(theta); + half c = cos(theta); + half beta = max(sign(_TwistUvRadius - length(tempUv)), 0.0); + tempUv = half2(dot(tempUv, half2(c, -s)), dot(tempUv, half2(s, c))) * beta + tempUv * (1 - beta); + tempUv += half2(_TwistUvPosX * _MainTex_ST.x, _TwistUvPosY * _MainTex_ST.y); + d.texcoord0.xy = tempUv; + #endif + + //-------------------------------------------- + + //FISHEYE_ON + #if FISHEYE_ON + half bind = length(centerTiled); + half2 dF = d.texcoord0.xy - centerTiled; + half dFlen = length(dF); + half fishInt = (3.14159265359 / bind) * (_FishEyeUvAmount + 0.001); + d.texcoord0.xy = centerTiled + (dF / (max(0.0001, dFlen))) * tan(dFlen * fishInt) * bind / tan(bind * fishInt); + #endif + //--------------------------------------------- + + //PINCH_ON + #if PINCH_ON + half2 dP = d.texcoord0.xy - centerTiled; + half pinchInt = (3.141592 / length(centerTiled)) * (-_PinchUvAmount + 0.001); + d.texcoord0.xy = centerTiled + normalize(dP) * atan(length(dP) * -pinchInt * 10.0) * 0.5 / atan(-pinchInt * 5); + #endif + + //--------------------------------------------- + + //ZOOMUV_ON + #if ZOOMUV_ON + d.texcoord0.xy -= centerTiled; + d.texcoord0.xy = d.texcoord0.xy * _ZoomUvAmount; + d.texcoord0.xy += centerTiled; + #endif + + //----------------------------------------------- + + //DOODLE_ON + #if DOODLE_ON + half2 uvCopy = uvRect; + _HandDrawnSpeed = (floor((_Time.x + randomSeed) * 20 * _HandDrawnSpeed) / _HandDrawnSpeed) * _HandDrawnSpeed; + uvCopy.x = sin((uvCopy.x * _HandDrawnAmount + _HandDrawnSpeed) * 4); + uvCopy.y = cos((uvCopy.y * _HandDrawnAmount + _HandDrawnSpeed) * 4); + d.texcoord0.xy = lerp(d.texcoord0.xy, d.texcoord0.xy + uvCopy, 0.0005 * _HandDrawnAmount); + #endif + + //-------------------------- + + //SHAKEUV_ON + #if SHAKEUV_ON + half xShake = sin((_Time.x + randomSeed) * _ShakeUvSpeed * 50) * _ShakeUvX; + half yShake = cos((_Time.x + randomSeed) * _ShakeUvSpeed * 50) * _ShakeUvY; + d.texcoord0.xy += half2(xShake * 0.012, yShake * 0.01); + #endif + + //------------------------------------------- + + //RECTSIZE_ON + #if RECTSIZE_ON + d.texcoord0.xy = d.texcoord0.xy * (_RectSize).xx + (((-_RectSize * 0.5) + 0.5)).xx; + #endif + + //------------------------------------------- + + //DISTORT_ON + #if DISTORT_ON + #if ATLAS_ON + d.texcoord3.x = d.texcoord3.x * (1 / (_MaxXUV - _MinXUV)); + d.texcoord3.y = d.texcoord3.y * (1 / (_MaxYUV - _MinYUV)); + #endif + + d.texcoord3.x += ((_Time.x + _RandomSeed) * _DistortTexXSpeed) % 1; + d.texcoord3.y += ((_Time.x + _RandomSeed) * _DistortTexYSpeed) % 1; + half distortAmnt = (SAMPLE_TEXTURE2D(_DistortTex, sampler_DistortTex, d.texcoord3.xy).r - 0.5) * 0.2 * _DistortAmount; + d.texcoord0.x += distortAmnt; + d.texcoord0.y += distortAmnt; + #endif + //------------------------------------------------------- + + //WARP_ON + #if WARP_ON + half2 warpUv = half2(d.texcoord0.x / _MainTex_ST.x, d.texcoord0.y / _MainTex_ST.y); + #if ATLAS_ON + warpUv = half2((warpUv.x - _MinXUV) / (_MaxXUV - _MinXUV), (warpUv.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + const float tau = 6.283185307179586; + float xWarp = (_Time.y + randomSeed) * _WarpSpeed + warpUv.x * tau / _WarpScale; + float yWarp = (_Time.y + randomSeed) * _WarpSpeed + warpUv.y * tau / _WarpScale; + float2 warp = float2(sin(xWarp), sin(yWarp)) * _WarpStrength; + d.texcoord0.xy += warp; + #endif + + //------------------------------------------------------- + + //WAVEUV_ON + #if WAVEUV_ON + float2 uvWave = half2(_WaveX * _MainTex_ST.x, _WaveY * _MainTex_ST.y) - d.texcoord0.xy; + uvWave %= 1; + #if ATLAS_ON + uvWave = half2(_WaveX, _WaveY) - uvRect; + #endif + uvWave.x *= _ScreenParams.x / _ScreenParams.y; + float waveTime = _Time.y + randomSeed; + float angWave = (sqrt(dot(uvWave, uvWave)) * _WaveAmount) - ((waveTime * _WaveSpeed)); + d.texcoord0.xy = d.texcoord0.xy + uvWave * sin(angWave) * (_WaveStrength / 1000.0); + #endif + //---------------------------------------------------- + + //ROUNDWAVEUV_ON + #if ROUNDWAVEUV_ON + half xWave = ((0.5 * _MainTex_ST.x) - uvRect.x); + half yWave = ((0.5 * _MainTex_ST.y) - uvRect.y) * (_MainTex_TexelSize.w / _MainTex_TexelSize.z); + half ripple = -sqrt(xWave*xWave + yWave* yWave); + d.texcoord0.xy += (sin((ripple + (_Time.y + randomSeed) * (_RoundWaveSpeed/10.0)) / 0.015) * (_RoundWaveStrength/10.0)) % 1; + #endif + //---------------------------------------------------- + + + //WIND_ON + #if WIND_ON + half windOffset = sin((_Time.x + randomSeed) * _GrassSpeed * 10); + half2 windCenter = half2(0.5, 0.1); + #if ATLAS_ON + windCenter.x = ((_MaxXUV - _MinXUV) * windCenter.x) + _MinXUV; + windCenter.y = ((_MaxYUV - _MinYUV) * windCenter.y) + _MinYUV; + #endif + #if !MANUALWIND_ON + d.texcoord0.x = fmod(abs(lerp(d.texcoord0.x, d.texcoord0.x + (_GrassWind * 0.01 * windOffset), uvRect.y)), 1); + #else + d.texcoord0.x = fmod(abs(lerp(d.texcoord0.x, d.texcoord0.x + (_GrassWind * 0.01 * _GrassManualAnim), uvRect.y)), 1); + windOffset = _GrassManualAnim; + #endif + half2 delta = d.texcoord0.xy - windCenter; + half delta2 = dot(delta.xy, delta.xy); + half2 delta_offset = delta2 * windOffset; + d.texcoord0.xy = d.texcoord0.xy + half2(delta.y, -delta.x) * delta_offset * _GrassRadialBend; + #endif + + //-------------------------------------------------------- + + //TEXTURESCROLL_ON && !ATLAS_ON + #if TEXTURESCROLL_ON && !ATLAS_ON + d.texcoord0.x += ((_Time.y + randomSeed) * _TextureScrollXSpeed) % 1; + d.texcoord0.y += ((_Time.y + randomSeed) * _TextureScrollYSpeed) % 1; + #endif + //------------------------------ + + //PIXELATE_ON + #if PIXELATE_ON + half aspectRatio = _MainTex_TexelSize.x / _MainTex_TexelSize.y; + half2 pixelSize = float2(_PixelateSize, _PixelateSize * aspectRatio); + d.texcoord0.xy = floor(d.texcoord0.xy * pixelSize) / pixelSize; + #endif + //-------------- + + half4 col = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy); + half originalAlpha = col.a; + col *= d.vertexColor; + + //NORMAL MAP + #if NORMALMAP_ON + half4 normalSample = SAMPLE_TEXTURE2D(_NormalMap, sampler_NormalMap, d.texcoord0.xy); + half3 normalTS = UnpackNormal(normalSample); + normalTS.xy *= _NormalStrength; + o.Normal = normalTS; + #endif + + + //GLITCH_ON + #if GLITCH_ON + half2 uvGlitch = uvRect; + uvGlitch.y -= 0.5; + half lineNoise = pow(rand2(floor(uvGlitch * half2(24., 19.) * _GlitchSize) * 4.0, randomSeed), 3.0) * _GlitchAmount + * pow(rand2(floor(uvGlitch * half2(38., 14.) * _GlitchSize) * 4.0, randomSeed), 3.0); + col = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(lineNoise * 0.02 * rand2(half2(2.0, 1), randomSeed), 0)) * d.vertexColor; + #endif + //-------------------------------------- + + //CHROMABERR_ON + #if CHROMABERR_ON + half4 r = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(_ChromAberrAmount/10, 0)) * d.vertexColor; + half4 b = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(-_ChromAberrAmount/10, 0)) * d.vertexColor; + col = half4(r.r * r.a, col.g, b.b * b.a, max(max(r.a, b.a) * _ChromAberrAlpha, col.a)); + #endif + + //-------------------------------- + + //BLUR_ON + #if BLUR_ON + #if ATLAS_ON + #if !BLURISHD_ON + col = BlurHD(d.texcoord0.xy, _MainTex, sampler_MainTex, _BlurIntensity, (_MaxXUV - _MinXUV), (_MaxYUV - _MinYUV)) * d.vertexColor; + #else + col = Blur(d.texcoord0.xy, _MainTex, sampler_MainTex, _BlurIntensity * (_MaxXUV - _MinXUV)) * d.vertexColor; + #endif + #else + #if !BLURISHD_ON + col = BlurHD(d.texcoord0.xy, _MainTex, sampler_MainTex, _BlurIntensity, 1, 1) * d.vertexColor; + #else + col = Blur(d.texcoord0.xy, _MainTex, sampler_MainTex, _BlurIntensity) * d.vertexColor; + #endif + #endif + #endif + + //-------------------- + + //MOTIONBLUR_ON + #if MOTIONBLUR_ON + _MotionBlurAngle = _MotionBlurAngle * 3.1415926; + #define rot(n) mul(n, half2x2(cos(_MotionBlurAngle), -sin(_MotionBlurAngle), sin(_MotionBlurAngle), cos(_MotionBlurAngle))) + _MotionBlurDist = _MotionBlurDist * 0.005; + #if ATLAS_ON + _MotionBlurDist *= (_MaxXUV - _MinXUV); + #endif + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(-_MotionBlurDist, -_MotionBlurDist))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(-_MotionBlurDist * 2, -_MotionBlurDist * 2))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(-_MotionBlurDist * 3, -_MotionBlurDist * 3))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(-_MotionBlurDist * 4, -_MotionBlurDist * 4))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(_MotionBlurDist, _MotionBlurDist))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(_MotionBlurDist * 2, _MotionBlurDist * 2))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(_MotionBlurDist * 3, _MotionBlurDist * 3))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(_MotionBlurDist * 4, _MotionBlurDist * 4))); + col.rgb = col.rgb / 9; + #endif + //------------------------------------ + + //NEGATIVE_ON + #if NEGATIVE_ON + col.rgb = lerp(col.rgb, 1 - col.rgb, _NegativeAmount); + #endif + + //-------------- + half luminance = 0; + + //GREYSCALE_ON && !GREYSCALEOUTLINE_ON + #if GREYSCALE_ON && !GREYSCALEOUTLINE_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + luminance = saturate(luminance + _GreyscaleLuminosity); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _GreyscaleTintColor, _GreyscaleBlend); + #endif + //------------------------------------ + + //GHOST_ON + #if GHOST_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + half4 ghostResult; + ghostResult.a = saturate(luminance - _GhostTransparency) * col.a; + ghostResult.rgb = col.rgb * (luminance + _GhostColorBoost); + col = lerp(col, ghostResult, _GhostBlend); + #endif + //------------------------------------ + + //INNEROUTLINE_ON + #if INNEROUTLINE_ON + half3 innerT = abs(GetPixel(0, _InnerOutlineThickness, d.texcoord0.xy, _MainTex, sampler_MainTex) - GetPixel(0, -_InnerOutlineThickness, d.texcoord0.xy, _MainTex, sampler_MainTex)); + innerT += abs(GetPixel(_InnerOutlineThickness, 0, d.texcoord0.xy, _MainTex, sampler_MainTex) - GetPixel(-_InnerOutlineThickness, 0, d.texcoord0.xy, _MainTex, sampler_MainTex)); + #if !ONLYINNEROUTLINE_ON + innerT = (innerT / 2.0) * col.a * _InnerOutlineAlpha; + col.rgb += length(innerT) * _InnerOutlineColor.rgb * _InnerOutlineGlow; + #else + innerT *= col.a * _InnerOutlineAlpha; + col.rgb = length(innerT) * _InnerOutlineColor.rgb * _InnerOutlineGlow; + col.a = step(0.3, col.r+col.g+col.b); + #endif + #endif + //------------------------------------------------------- + + //HITEFFECT_ON + #if HITEFFECT_ON + col.rgb = lerp(col.rgb, _HitEffectColor.rgb * _HitEffectGlow, _HitEffectBlend); + #endif + //-------------------- + + //GRADIENT_ON + #if GRADIENT_ON + half2 tiledUvGrad = half2(uvRect.x / _MainTex_ST.x, uvRect.y / _MainTex_ST.y); + #if GRADIENT2COL_ON + _GradTopRightCol = _GradTopLeftCol; + _GradBotRightCol = _GradBotLeftCol; + #endif + #if RADIALGRADIENT_ON + half radialDist = 1 - length(tiledUvGrad - half2(0.5, 0.5)); + radialDist *= (_MainTex_TexelSize.w / _MainTex_TexelSize.z); + radialDist = saturate(_GradBoostX * radialDist); + half4 gradientResult = lerp(_GradTopLeftCol, _GradBotLeftCol, radialDist); + #else + half gradXLerpFactor = saturate(pow(tiledUvGrad.x, _GradBoostX)); + half4 gradientResult = lerp(lerp(_GradBotLeftCol, _GradBotRightCol, gradXLerpFactor), + lerp(_GradTopLeftCol, _GradTopRightCol, gradXLerpFactor), saturate(pow(tiledUvGrad.y, _GradBoostY))); + #endif + gradientResult = lerp(col, gradientResult, _GradBlend); + col.rgb = gradientResult.rgb * col.a; + col.a *= gradientResult.a; + #endif + //-------------------------------------------------------------------- + + //CONTRAST_ON + #if CONTRAST_ON + col.rgb = (col.rgb - float3(0.5, 0.5, 0.5)) * _Contrast + float3(0.5, 0.5, 0.5); + col.rgb += _Brightness; + #endif + + //------------------------------------------------------------------- + + //COLORSWAP_ON + #if COLORSWAP_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + half4 swapMask = SAMPLE_TEXTURE2D(_ColorSwapTex, sampler_ColorSwapTex, d.texcoord0.xy); + swapMask.rgb *= swapMask.a; + half3 redSwap = _ColorSwapRed * swapMask.r * saturate(luminance + _ColorSwapRedLuminosity); + half3 greenSwap = _ColorSwapGreen * swapMask.g * saturate(luminance + _ColorSwapGreenLuminosity); + half3 blueSwap = _ColorSwapBlue * swapMask.b * saturate(luminance + _ColorSwapBlueLuminosity); + swapMask.rgb = col.rgb * saturate(1 - swapMask.r - swapMask.g - swapMask.b); + col.rgb = lerp(col.rgb, swapMask.rgb + redSwap + greenSwap + blueSwap, _ColorSwapBlend); + #endif + //-------------------------------------------------------------------- + + //COLORRAMP_ON && !COLORRAMPOUTLINE_ON + #if COLORRAMP_ON && !COLORRAMPOUTLINE_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + luminance = saturate(luminance + _ColorRampLuminosity); + #if GRADIENTCOLORRAMP_ON + col.rgb = lerp(col.rgb, SAMPLE_TEXTURE2D(_ColorRampTexGradient, sampler_ColorRampTexGradient, half2(luminance, 0)).rgb, _ColorRampBlend); + #else + col.rgb = lerp(col.rgb, SAMPLE_TEXTURE2D(_ColorRampTex, sampler_ColorRampTex, half2(luminance, 0)).rgb, _ColorRampBlend); + #endif + #endif + //-------------------------------------------------------------------- + + //CHANGECOLOR_ON + #if CHANGECOLOR_ON + float3 currChangeColor = saturate(col.rgb); + luminance = 0.3 * currChangeColor.r + 0.59 * currChangeColor.g + 0.11 * currChangeColor.b; + luminance = saturate(luminance + _ColorChangeLuminosity); + half3 dif = abs(currChangeColor - _ColorChangeTarget.rgb); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _ColorChangeNewCol.rgb, + max(sign(1 - saturate(dif.x + dif.y + dif.z) - _ColorChangeTolerance), 0.0)); + #if CHANGECOLOR2_ON + dif = abs(currChangeColor - _ColorChangeTarget2.rgb); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _ColorChangeNewCol2.rgb, + max(sign(1 - saturate(dif.x + dif.y + dif.z) - _ColorChangeTolerance2), 0.0)); + #endif + #if CHANGECOLOR3_ON + dif = abs(currChangeColor - _ColorChangeTarget3.rgb); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _ColorChangeNewCol3.rgb, + max(sign(1 - saturate(dif.x + dif.y + dif.z) - _ColorChangeTolerance3), 0.0)); + #endif + #endif + //------------------------------------------------------- + + //POSTERIZE_ON && !POSTERIZEOUTLINE_ON + #if POSTERIZE_ON && !POSTERIZEOUTLINE_ON + col.rgb = pow(col.rgb, _PosterizeGamma) * _PosterizeNumColors; + col.rgb = floor(col.rgb) / _PosterizeNumColors; + col.rgb = pow(col.rgb, 1.0 / _PosterizeGamma); + #endif + //------------------------------------ + + //HSV_ON + #if HSV_ON + half3 resultHsv = half3(col.rgb); + half cosHsv = _HsvBright * _HsvSaturation * cos(_HsvShift * 3.14159265 / 180); + half sinHsv = _HsvBright * _HsvSaturation * sin(_HsvShift * 3.14159265 / 180); + resultHsv.x = (.299 * _HsvBright + .701 * cosHsv + .168 * sinHsv) * col.x + + (.587 * _HsvBright - .587 * cosHsv + .330 * sinHsv) * col.y + + (.114 * _HsvBright - .114 * cosHsv - .497 * sinHsv) * col.z; + resultHsv.y = (.299 * _HsvBright - .299 * cosHsv - .328 * sinHsv) *col.x + + (.587 * _HsvBright + .413 * cosHsv + .035 * sinHsv) * col.y + + (.114 * _HsvBright - .114 * cosHsv + .292 * sinHsv) * col.z; + resultHsv.z = (.299 * _HsvBright - .3 * cosHsv + 1.25 * sinHsv) * col.x + + (.587 * _HsvBright - .588 * cosHsv - 1.05 * sinHsv) * col.y + + (.114 * _HsvBright + .886 * cosHsv - .203 * sinHsv) * col.z; + col.rgb = resultHsv; + #endif + //------------------------------------------------------- + + //OVERLAY_ON + #if OVERLAY_ON + half2 overlayUvs = d.texcoord0.xy; + overlayUvs.x += ((_Time.y + randomSeed) * _OverlayTextureScrollXSpeed) % 1; + overlayUvs.y += ((_Time.y + randomSeed) * _OverlayTextureScrollYSpeed) % 1; + half4 overlayCol = SAMPLE_TEXTURE2D(_OverlayTex, sampler_OverlayTex, TRANSFORM_TEX(overlayUvs, _OverlayTex)); + overlayCol.rgb *= _OverlayColor.rgb * _OverlayGlow; + #if !OVERLAYMULT_ON + overlayCol.rgb *= overlayCol.a * _OverlayColor.rgb * _OverlayColor.a * _OverlayBlend; + col.rgb += overlayCol.rgb; + #else + overlayCol.a *= _OverlayColor.a; + col = lerp(col, col * overlayCol, _OverlayBlend); + #endif + #endif + + //--------------------------------- + + //OUTBASE_ON + #if OUTBASE_ON + #if OUTBASEPIXELPERF_ON + half2 destUv = half2(_OutlinePixelWidth * _MainTex_TexelSize.x, _OutlinePixelWidth * _MainTex_TexelSize.y); + #else + half2 destUv = half2(_OutlineWidth * _MainTex_TexelSize.x * 200, _OutlineWidth * _MainTex_TexelSize.y * 200); + #endif + + #if OUTDIST_ON + d.texcoord3.x += ((_Time.x + _RandomSeed) * _OutlineDistortTexXSpeed) % 1; + d.texcoord3.y += ((_Time.x + _RandomSeed) * _OutlineDistortTexYSpeed) % 1; + #if ATLAS_ON + d.texcoord3 = half2((d.texcoord3.x - _MinXUV) / (_MaxXUV - _MinXUV), (d.texcoord3.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half outDistortAmnt = (SAMPLE_TEXTURE2D(_OutlineDistortTex, sampler_OutlineDistortTex, d.texcoord3).r - 0.5) * 0.2 * _OutlineDistortAmount; + destUv.x += outDistortAmnt; + destUv.y += outDistortAmnt; + #endif + + half spriteLeft = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(destUv.x, 0)).a; + half spriteRight = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy - half2(destUv.x, 0)).a; + half spriteBottom = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(0, destUv.y)).a; + half spriteTop = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy - half2(0, destUv.y)).a; + half result = spriteLeft + spriteRight + spriteBottom + spriteTop; + + #if OUTBASE8DIR_ON + half spriteTopLeft = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(destUv.x, destUv.y)).a; + half spriteTopRight = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(-destUv.x, destUv.y)).a; + half spriteBotLeft = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(destUv.x, -destUv.y)).a; + half spriteBotRight = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(-destUv.x, -destUv.y)).a; + result = result + spriteTopLeft + spriteTopRight + spriteBotLeft + spriteBotRight; + #endif + + result = step(0.05, saturate(result)); + + #if OUTTEX_ON + d.texcoord1.x += ((_Time.x + _RandomSeed) * _OutlineTexXSpeed) % 1; + d.texcoord1.y += ((_Time.x + _RandomSeed) * _OutlineTexYSpeed) % 1; + #if ATLAS_ON + d.texcoord1 = half2((d.texcoord1.x - _MinXUV) / (_MaxXUV - _MinXUV), (d.texcoord1.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half4 tempOutColor = SAMPLE_TEXTURE2D(_OutlineTex, sampler_OutlineTex, d.texcoord1); + tempOutColor *= _OutlineColor; + _OutlineColor = tempOutColor; + #endif + + result *= (1 - originalAlpha) * _OutlineAlpha; + + half4 outline = _OutlineColor * d.vertexColor.a; + outline.rgb *= _OutlineGlow; + outline.a = result; + #if ONLYOUTLINE_ON + col = outline; + #else + col = lerp(col, outline, result); + #endif + #endif + //------------------------------------------------------- + + //FADE_ON + #if FADE_ON + half2 tiledUvFade1 = TRANSFORM_TEX(d.texcoord0, _FadeTex); + half2 tiledUvFade2 = TRANSFORM_TEX(d.texcoord0, _FadeBurnTex); + #if ATLAS_ON + tiledUvFade1 = half2((tiledUvFade1.x - _MinXUV) / (_MaxXUV - _MinXUV), (tiledUvFade1.y - _MinYUV) / (_MaxYUV - _MinYUV)); + tiledUvFade2 = half2((tiledUvFade2.x - _MinXUV) / (_MaxXUV - _MinXUV), (tiledUvFade2.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half fadeTemp = SAMPLE_TEXTURE2D(_FadeTex, sampler_FadeTex, tiledUvFade1).r; + half fade = smoothstep(_FadeAmount, _FadeAmount + _FadeBurnTransition, fadeTemp); + half fadeBurn = saturate(smoothstep(_FadeAmount - _FadeBurnWidth, _FadeAmount - _FadeBurnWidth + 0.1, fadeTemp) * _FadeAmount); + col.a *= fade; + _FadeBurnColor.rgb *= _FadeBurnGlow; + col += fadeBurn * SAMPLE_TEXTURE2D(_FadeBurnTex, sampler_FadeBurnTex, tiledUvFade2) * _FadeBurnColor * originalAlpha * (1 - col.a); + #endif + //------------------------------------------------------- + + //SHADOW_ON + #if SHADOW_ON + half shadowA = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(_ShadowX, _ShadowY)).a; + half preMultShadowMask = 1 - (saturate(shadowA - col.a) * (1 - col.a)); + col.rgb *= 1 - ((shadowA - col.a) * (1 - col.a)); + col.rgb += (_ShadowColor * shadowA) * (1 - col.a); + col.a = max(shadowA * _ShadowAlpha * d.vertexColor.a, col.a); + #endif + + //------------------------------------------------------- + + //GLOW_ON + #if GLOW_ON + half4 emission; + #if GLOWTEX_ON + emission = SAMPLE_TEXTURE2D(_GlowTex, sampler_GlowTex, d.texcoord0); + #else + emission = col; + #endif + + col.rgb *= _GlowGlobal; + emission.rgb *= emission.a * col.a * _Glow * _GlowColor; + col.rgb += emission.rgb; + #endif + //------------------------------------------------------- + + //COLORRAMP_ON && COLORRAMPOUTLINE_ON + #if COLORRAMP_ON && COLORRAMPOUTLINE_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + luminance = saturate(luminance + _ColorRampLuminosity); + #if GRADIENTCOLORRAMP_ON + col.rgb = lerp(col.rgb, SAMPLE_TEXTURE2D(_ColorRampTexGradient, sampler_ColorRampTexGradient, half2(luminance, 0)).rgb, _ColorRampBlend); + #else + col.rgb = lerp(col.rgb, SAMPLE_TEXTURE2D(_ColorRampTex, sampler_ColorRampTex, half2(luminance, 0)).rgb, _ColorRampBlend); + #endif + #endif + //--------------- + + //GREYSCALE_ON && GREYSCALEOUTLINE_ON + #if GREYSCALE_ON && GREYSCALEOUTLINE_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + luminance = saturate(luminance + _GreyscaleLuminosity); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _GreyscaleTintColor, _GreyscaleBlend); + #endif + + //----------------------------------- + + //POSTERIZE_ON && POSTERIZEOUTLINE_ON + #if POSTERIZE_ON && POSTERIZEOUTLINE_ON + col.rgb = pow(col.rgb, _PosterizeGamma) * _PosterizeNumColors; + col.rgb = floor(col.rgb) / _PosterizeNumColors; + col.rgb = pow(col.rgb, 1.0 / _PosterizeGamma); + #endif + + //----------------------------------- + + //SHINE_ON + #if SHINE_ON + half2 uvShine = uvRect; + half cosAngle = cos(_ShineRotate); + half sinAngle = sin(_ShineRotate); + half2x2 rot = half2x2(cosAngle, -sinAngle, sinAngle, cosAngle); + uvShine -= half2(0.5, 0.5); + uvShine = mul(rot, uvShine); + uvShine += half2(0.5, 0.5); + half shineMask = SAMPLE_TEXTURE2D(_ShineMask, sampler_ShineMask, d.texcoord0.xy).a; + half currentDistanceProjection = (uvShine.x + uvShine.y) / 2; + half whitePower = 1 - (abs(currentDistanceProjection - _ShineLocation) / _ShineWidth); + col.rgb += col.a * whitePower * _ShineGlow * max(sign(currentDistanceProjection - (_ShineLocation - _ShineWidth)), 0.0) + * max(sign((_ShineLocation + _ShineWidth) - currentDistanceProjection), 0.0) * _ShineColor * shineMask; + #endif + + //----------------------------------- + + //HOLOGRAM_ON + #if HOLOGRAM_ON + half totalHologram = _HologramStripesAmount + _HologramUnmodAmount; + half hologramYCoord = ((uvRect.y + (((_Time.x + randomSeed) % 1) * _HologramStripesSpeed)) % totalHologram) / totalHologram; + hologramYCoord = abs(hologramYCoord); + half alpha = RemapFloat(saturate(hologramYCoord - (_HologramUnmodAmount/totalHologram)), 0.0, 1.0, _HologramMinAlpha, saturate(_HologramMaxAlpha)); + half hologramMask = max(sign((_HologramUnmodAmount/totalHologram) - hologramYCoord), 0.0); + half4 hologramResult = col; + hologramResult.a *= lerp(alpha, 1, hologramMask); + hologramResult.rgb *= max(1, _HologramMaxAlpha * max(sign(hologramYCoord - (_HologramUnmodAmount/totalHologram)), 0.0)); + hologramMask = 1 - step(0.01,hologramMask); + hologramResult.rgb += hologramMask * _HologramStripeColor * col.a; + col = lerp(col, hologramResult, _HologramBlend); + #endif + + //----------------------------------- + + //FLICKER_ON + #if FLICKER_ON + col.a *= saturate(col.a * step(frac(0.05 + (_Time.w + randomSeed) * _FlickerFreq), 1 - _FlickerPercent) + _FlickerAlpha); + #endif + //----------------------------------- + + //ALPHACUTOFF_ON + + //ALPHAROUND_ON + + //ALPHAOUTLINE_ON + #if ALPHAOUTLINE_ON + half alphaOutlineRes = pow(1 - col.a, max(_AlphaOutlinePower, 0.0001)) * step(_AlphaOutlineMinAlpha, col.a) * _AlphaOutlineBlend; + col.rgb = lerp(col.rgb, _AlphaOutlineColor.rgb * _AlphaOutlineGlow, alphaOutlineRes); + col.a = lerp(col.a, 1, alphaOutlineRes > 1); + #endif + //------------------------------------------------------- + + //FOG_ON + + //------------------ + + col *= _Color; + o.Albedo = col; + col.a *= _Alpha; + clip(col.a - _AlphaCutoffValue - 0.01); + o.Alpha = _Color.a; + } + + + + + + void ChainSurfaceFunction(inout Surface l, inout ShaderData d) + { + Ext_SurfaceFunction0(l, d); + // Ext_SurfaceFunction1(l, d); + // Ext_SurfaceFunction2(l, d); + // Ext_SurfaceFunction3(l, d); + // Ext_SurfaceFunction4(l, d); + // Ext_SurfaceFunction5(l, d); + // Ext_SurfaceFunction6(l, d); + // Ext_SurfaceFunction7(l, d); + // Ext_SurfaceFunction8(l, d); + // Ext_SurfaceFunction9(l, d); + // Ext_SurfaceFunction10(l, d); + // Ext_SurfaceFunction11(l, d); + // Ext_SurfaceFunction12(l, d); + // Ext_SurfaceFunction13(l, d); + // Ext_SurfaceFunction14(l, d); + // Ext_SurfaceFunction15(l, d); + // Ext_SurfaceFunction16(l, d); + // Ext_SurfaceFunction17(l, d); + // Ext_SurfaceFunction18(l, d); + // Ext_SurfaceFunction19(l, d); + // Ext_SurfaceFunction20(l, d); + // Ext_SurfaceFunction21(l, d); + // Ext_SurfaceFunction22(l, d); + // Ext_SurfaceFunction23(l, d); + // Ext_SurfaceFunction24(l, d); + // Ext_SurfaceFunction25(l, d); + // Ext_SurfaceFunction26(l, d); + // Ext_SurfaceFunction27(l, d); + // Ext_SurfaceFunction28(l, d); + // Ext_SurfaceFunction29(l, d); + } + +#if !_DECALSHADER + + void ChainModifyVertex(inout VertexData v, inout VertexToPixel v2p, float4 time) + { + ExtraV2F d; + + ZERO_INITIALIZE(ExtraV2F, d); + ZERO_INITIALIZE(Blackboard, d.blackboard); + // due to motion vectors in HDRP, we need to use the last + // time in certain spots. So if you are going to use _Time to adjust vertices, + // you need to use this time or motion vectors will break. + d.time = time; + + Ext_ModifyVertex0(v, d); + // Ext_ModifyVertex1(v, d); + // Ext_ModifyVertex2(v, d); + // Ext_ModifyVertex3(v, d); + // Ext_ModifyVertex4(v, d); + // Ext_ModifyVertex5(v, d); + // Ext_ModifyVertex6(v, d); + // Ext_ModifyVertex7(v, d); + // Ext_ModifyVertex8(v, d); + // Ext_ModifyVertex9(v, d); + // Ext_ModifyVertex10(v, d); + // Ext_ModifyVertex11(v, d); + // Ext_ModifyVertex12(v, d); + // Ext_ModifyVertex13(v, d); + // Ext_ModifyVertex14(v, d); + // Ext_ModifyVertex15(v, d); + // Ext_ModifyVertex16(v, d); + // Ext_ModifyVertex17(v, d); + // Ext_ModifyVertex18(v, d); + // Ext_ModifyVertex19(v, d); + // Ext_ModifyVertex20(v, d); + // Ext_ModifyVertex21(v, d); + // Ext_ModifyVertex22(v, d); + // Ext_ModifyVertex23(v, d); + // Ext_ModifyVertex24(v, d); + // Ext_ModifyVertex25(v, d); + // Ext_ModifyVertex26(v, d); + // Ext_ModifyVertex27(v, d); + // Ext_ModifyVertex28(v, d); + // Ext_ModifyVertex29(v, d); + + + // #if %EXTRAV2F0REQUIREKEY% + // v2p.extraV2F0 = d.extraV2F0; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // v2p.extraV2F1 = d.extraV2F1; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // v2p.extraV2F2 = d.extraV2F2; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // v2p.extraV2F3 = d.extraV2F3; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // v2p.extraV2F4 = d.extraV2F4; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // v2p.extraV2F5 = d.extraV2F5; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // v2p.extraV2F6 = d.extraV2F6; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // v2p.extraV2F7 = d.extraV2F7; + // #endif + } + + void ChainModifyTessellatedVertex(inout VertexData v, inout VertexToPixel v2p) + { + ExtraV2F d; + ZERO_INITIALIZE(ExtraV2F, d); + ZERO_INITIALIZE(Blackboard, d.blackboard); + + // #if %EXTRAV2F0REQUIREKEY% + // d.extraV2F0 = v2p.extraV2F0; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // d.extraV2F1 = v2p.extraV2F1; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // d.extraV2F2 = v2p.extraV2F2; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // d.extraV2F3 = v2p.extraV2F3; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // d.extraV2F4 = v2p.extraV2F4; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // d.extraV2F5 = v2p.extraV2F5; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // d.extraV2F6 = v2p.extraV2F6; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // d.extraV2F7 = v2p.extraV2F7; + // #endif + + + // Ext_ModifyTessellatedVertex0(v, d); + // Ext_ModifyTessellatedVertex1(v, d); + // Ext_ModifyTessellatedVertex2(v, d); + // Ext_ModifyTessellatedVertex3(v, d); + // Ext_ModifyTessellatedVertex4(v, d); + // Ext_ModifyTessellatedVertex5(v, d); + // Ext_ModifyTessellatedVertex6(v, d); + // Ext_ModifyTessellatedVertex7(v, d); + // Ext_ModifyTessellatedVertex8(v, d); + // Ext_ModifyTessellatedVertex9(v, d); + // Ext_ModifyTessellatedVertex10(v, d); + // Ext_ModifyTessellatedVertex11(v, d); + // Ext_ModifyTessellatedVertex12(v, d); + // Ext_ModifyTessellatedVertex13(v, d); + // Ext_ModifyTessellatedVertex14(v, d); + // Ext_ModifyTessellatedVertex15(v, d); + // Ext_ModifyTessellatedVertex16(v, d); + // Ext_ModifyTessellatedVertex17(v, d); + // Ext_ModifyTessellatedVertex18(v, d); + // Ext_ModifyTessellatedVertex19(v, d); + // Ext_ModifyTessellatedVertex20(v, d); + // Ext_ModifyTessellatedVertex21(v, d); + // Ext_ModifyTessellatedVertex22(v, d); + // Ext_ModifyTessellatedVertex23(v, d); + // Ext_ModifyTessellatedVertex24(v, d); + // Ext_ModifyTessellatedVertex25(v, d); + // Ext_ModifyTessellatedVertex26(v, d); + // Ext_ModifyTessellatedVertex27(v, d); + // Ext_ModifyTessellatedVertex28(v, d); + // Ext_ModifyTessellatedVertex29(v, d); + + // #if %EXTRAV2F0REQUIREKEY% + // v2p.extraV2F0 = d.extraV2F0; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // v2p.extraV2F1 = d.extraV2F1; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // v2p.extraV2F2 = d.extraV2F2; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // v2p.extraV2F3 = d.extraV2F3; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // v2p.extraV2F4 = d.extraV2F4; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // v2p.extraV2F5 = d.extraV2F5; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // v2p.extraV2F6 = d.extraV2F6; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // v2p.extraV2F7 = d.extraV2F7; + // #endif + } + + void ChainFinalColorForward(inout Surface l, inout ShaderData d, inout half4 color) + { + // Ext_FinalColorForward0(l, d, color); + // Ext_FinalColorForward1(l, d, color); + // Ext_FinalColorForward2(l, d, color); + // Ext_FinalColorForward3(l, d, color); + // Ext_FinalColorForward4(l, d, color); + // Ext_FinalColorForward5(l, d, color); + // Ext_FinalColorForward6(l, d, color); + // Ext_FinalColorForward7(l, d, color); + // Ext_FinalColorForward8(l, d, color); + // Ext_FinalColorForward9(l, d, color); + // Ext_FinalColorForward10(l, d, color); + // Ext_FinalColorForward11(l, d, color); + // Ext_FinalColorForward12(l, d, color); + // Ext_FinalColorForward13(l, d, color); + // Ext_FinalColorForward14(l, d, color); + // Ext_FinalColorForward15(l, d, color); + // Ext_FinalColorForward16(l, d, color); + // Ext_FinalColorForward17(l, d, color); + // Ext_FinalColorForward18(l, d, color); + // Ext_FinalColorForward19(l, d, color); + // Ext_FinalColorForward20(l, d, color); + // Ext_FinalColorForward21(l, d, color); + // Ext_FinalColorForward22(l, d, color); + // Ext_FinalColorForward23(l, d, color); + // Ext_FinalColorForward24(l, d, color); + // Ext_FinalColorForward25(l, d, color); + // Ext_FinalColorForward26(l, d, color); + // Ext_FinalColorForward27(l, d, color); + // Ext_FinalColorForward28(l, d, color); + // Ext_FinalColorForward29(l, d, color); + } + + void ChainFinalGBufferStandard(inout Surface s, inout ShaderData d, inout half4 GBuffer0, inout half4 GBuffer1, inout half4 GBuffer2, inout half4 outEmission, inout half4 outShadowMask) + { + // Ext_FinalGBufferStandard0(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard1(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard2(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard3(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard4(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard5(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard6(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard7(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard8(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard9(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard10(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard11(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard12(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard13(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard14(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard15(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard16(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard17(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard18(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard19(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard20(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard21(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard22(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard23(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard24(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard25(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard26(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard27(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard28(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard29(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + } +#endif + + + + + +#if _DECALSHADER + + ShaderData CreateShaderData(SurfaceDescriptionInputs IN) + { + ShaderData d = (ShaderData)0; + d.TBNMatrix = float3x3(IN.WorldSpaceTangent, IN.WorldSpaceBiTangent, IN.WorldSpaceNormal); + d.worldSpaceNormal = IN.WorldSpaceNormal; + d.worldSpaceTangent = IN.WorldSpaceTangent; + + d.worldSpacePosition = IN.WorldSpacePosition; + d.texcoord0 = IN.uv0.xyxy; + d.screenPos = IN.ScreenPosition; + + d.worldSpaceViewDir = normalize(_WorldSpaceCameraPos - d.worldSpacePosition); + + d.tangentSpaceViewDir = mul(d.TBNMatrix, d.worldSpaceViewDir); + + // these rarely get used, so we back transform them. Usually will be stripped. + #if _HDRP + // d.localSpacePosition = mul(GetWorldToObjectMatrix(), float4(GetCameraRelativePositionWS(d.worldSpacePosition), 1)).xyz; + #else + // d.localSpacePosition = mul(GetWorldToObjectMatrix(), float4(d.worldSpacePosition, 1)).xyz; + #endif + // d.localSpaceNormal = normalize(mul((float3x3)GetWorldToObjectMatrix(), d.worldSpaceNormal)); + // d.localSpaceTangent = normalize(mul((float3x3)GetWorldToObjectMatrix(), d.worldSpaceTangent.xyz)); + + // #if %SCREENPOSREQUIREKEY% + // d.screenUV = (IN.ScreenPosition.xy / max(0.01, IN.ScreenPosition.w)); + // #endif + + return d; + } +#else + + ShaderData CreateShaderData(VertexToPixel i + #if NEED_FACING + , bool facing + #endif + ) + { + ShaderData d = (ShaderData)0; + d.clipPos = i.pos; + d.worldSpacePosition = i.worldPos; + + d.worldSpaceNormal = normalize(i.worldNormal); + d.worldSpaceTangent.xyz = normalize(i.worldTangent.xyz); + + d.tangentSign = i.worldTangent.w * unity_WorldTransformParams.w; + float3 bitangent = cross(d.worldSpaceTangent.xyz, d.worldSpaceNormal) * d.tangentSign; + + d.TBNMatrix = float3x3(d.worldSpaceTangent, -bitangent, d.worldSpaceNormal); + d.worldSpaceViewDir = normalize(_WorldSpaceCameraPos - i.worldPos); + + d.tangentSpaceViewDir = mul(d.TBNMatrix, d.worldSpaceViewDir); + d.texcoord0 = i.texcoord0; + d.texcoord1 = i.texcoord1; + d.texcoord2 = i.texcoord2; + + // #if %TEXCOORD3REQUIREKEY% + d.texcoord3 = i.texcoord3; + // #endif + + // d.isFrontFace = facing; + // #if %VERTEXCOLORREQUIREKEY% + d.vertexColor = i.vertexColor; + // #endif + + // these rarely get used, so we back transform them. Usually will be stripped. + #if _HDRP + // d.localSpacePosition = mul(GetWorldToObjectMatrix(), float4(GetCameraRelativePositionWS(i.worldPos), 1)).xyz; + #else + // d.localSpacePosition = mul(GetWorldToObjectMatrix(), float4(i.worldPos, 1)).xyz; + #endif + // d.localSpaceNormal = normalize(mul((float3x3)GetWorldToObjectMatrix(), i.worldNormal)); + // d.localSpaceTangent = normalize(mul((float3x3)GetWorldToObjectMatrix(), i.worldTangent.xyz)); + + // #if %SCREENPOSREQUIREKEY% + // d.screenPos = i.screenPos; + // d.screenUV = (i.screenPos.xy / i.screenPos.w); + // #endif + + + // #if %EXTRAV2F0REQUIREKEY% + // d.extraV2F0 = i.extraV2F0; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // d.extraV2F1 = i.extraV2F1; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // d.extraV2F2 = i.extraV2F2; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // d.extraV2F3 = i.extraV2F3; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // d.extraV2F4 = i.extraV2F4; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // d.extraV2F5 = i.extraV2F5; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // d.extraV2F6 = i.extraV2F6; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // d.extraV2F7 = i.extraV2F7; + // #endif + + return d; + } + +#endif + + + +#if (SHADERPASS == SHADERPASS_LIGHT_TRANSPORT) + + // This was not in constant buffer in original unity, so keep outiside. But should be in as ShaderRenderPass frequency + float unity_OneOverOutputBoost; + float unity_MaxOutputValue; + + CBUFFER_START(UnityMetaPass) + // x = use uv1 as raster position + // y = use uv2 as raster position + bool4 unity_MetaVertexControl; + + // x = return albedo + // y = return normal + bool4 unity_MetaFragmentControl; + CBUFFER_END + + VertexToPixel Vert(VertexData inputMesh) + { + VertexToPixel output; + ZERO_INITIALIZE(VertexToPixel, output); + UNITY_SETUP_INSTANCE_ID(inputMesh); + UNITY_TRANSFER_INSTANCE_ID(inputMesh, output); + UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(output); + + // Output UV coordinate in vertex shader + float2 uv = float2(0.0, 0.0); + + if (unity_MetaVertexControl.x) + { + uv = inputMesh.texcoord1.xy * unity_LightmapST.xy + unity_LightmapST.zw; + } + else if (unity_MetaVertexControl.y) + { + uv = inputMesh.texcoord2.xy * unity_DynamicLightmapST.xy + unity_DynamicLightmapST.zw; + } + + // OpenGL right now needs to actually use the incoming vertex position + // so we create a fake dependency on it here that haven't any impact. + output.pos = float4(uv * 2.0 - 1.0, inputMesh.vertex.z > 0 ? 1.0e-4 : 0.0, 1.0); + + output.worldPos = TransformObjectToWorld(inputMesh.vertex.xyz).xyz; + + // Normal is required for triplanar mapping + output.worldNormal = TransformObjectToWorldNormal(inputMesh.normal); + // Not required but assign to silent compiler warning + output.worldTangent = float4(1.0, 0.0, 0.0, 0.0); + + output.texcoord0 = inputMesh.texcoord0; + output.texcoord1 = inputMesh.texcoord1; + output.texcoord2 = inputMesh.texcoord2; + // #if %TEXCOORD3REQUIREKEY% + output.texcoord3 = inputMesh.texcoord3; + // #endif + // #if %VERTEXCOLORREQUIREKEY% + output.vertexColor = inputMesh.vertexColor; + // #endif + + return output; + } +#else + + #if (_PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR))) + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/ShaderVariablesMatrixDefsHDCamera.hlsl" + + void MotionVectorPositionZBias(VertexToPixel input) + { + #if UNITY_REVERSED_Z + input.pos.z -= unity_MotionVectorsParams.z * input.pos.w; + #else + input.pos.z += unity_MotionVectorsParams.z * input.pos.w; + #endif + } + + #endif + + VertexToPixel Vert(VertexData input) + { + VertexToPixel output; + ZERO_INITIALIZE(VertexToPixel, output); + + UNITY_SETUP_INSTANCE_ID(input); + UNITY_TRANSFER_INSTANCE_ID(input, output); + UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(output); + + #if _HDRP && (_PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR))) + VertexData previousMesh = input; + #endif + + ChainModifyVertex(input, output, _Time); + + // This return the camera relative position (if enable) + float3 positionRWS = TransformObjectToWorld(input.vertex.xyz); + float3 normalWS = TransformObjectToWorldNormal(input.normal); + float4 tangentWS = float4(TransformObjectToWorldDir(input.tangent.xyz), input.tangent.w); + + + output.worldPos = GetAbsolutePositionWS(positionRWS); + output.pos = TransformWorldToHClip(positionRWS); + output.worldNormal = normalWS; + output.worldTangent = tangentWS; + + + output.texcoord0 = input.texcoord0; + output.texcoord1 = input.texcoord1; + output.texcoord2 = input.texcoord2; + + // #if %TEXCOORD3REQUIREKEY% + output.texcoord3 = input.texcoord3; + // #endif + + // #if %VERTEXCOLORREQUIREKEY% + output.vertexColor = input.vertexColor; + // #endif + + // #if %SCREENPOSREQUIREKEY% + // output.screenPos = ComputeScreenPos(output.pos, _ProjectionParams.x); + // #endif + + #if _HDRP && (_PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR))) + + #if !defined(TESSELLATION_ON) + MotionVectorPositionZBias(output); + #endif + + output.motionVectorCS = mul(UNITY_MATRIX_UNJITTERED_VP, float4(positionRWS.xyz, 1.0)); + // Note: unity_MotionVectorsParams.y is 0 is forceNoMotion is enabled + bool forceNoMotion = unity_MotionVectorsParams.y == 0.0; + if (forceNoMotion) + { + output.previousPositionCS = float4(0.0, 0.0, 0.0, 1.0); + } + else + { + bool hasDeformation = unity_MotionVectorsParams.x > 0.0; // Skin or morph target + + float3 effectivePositionOS = (hasDeformation ? previousMesh.previousPositionOS : previousMesh.vertex.xyz); + #if defined(_ADD_PRECOMPUTED_VELOCITY) + effectivePositionOS -= input.precomputedVelocity; + #endif + + previousMesh.vertex = float4(effectivePositionOS, 1); + VertexToPixel dummy = (VertexToPixel)0; + + + ChainModifyVertex(previousMesh, dummy, _LastTimeParameters); + + // we might need this for skinned objects? + //float3 normalWS = TransformPreviousObjectToWorldNormal(input.normal).xyz; + float3 previousPositionRWS = TransformPreviousObjectToWorld(previousMesh.vertex.xyz); + + #ifdef _WRITE_TRANSPARENT_MOTION_VECTOR + if (_TransparentCameraOnlyMotionVectors > 0) + { + previousPositionRWS = positionRWS.xyz; + } + #endif // _WRITE_TRANSPARENT_MOTION_VECTOR + + output.previousPositionCS = mul(UNITY_MATRIX_PREV_VP, float4(previousPositionRWS, 1.0)); + } + #endif // _HDRP && _PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR)) + + + return output; + } + + +#endif + + + + + + + + #if defined(WRITE_DECAL_BUFFER) && !defined(_DISABLE_DECALS) + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/Decal/DecalPrepassBuffer.hlsl" + #endif + + FragInputs BuildFragInputs(VertexToPixel input) + { + UNITY_SETUP_INSTANCE_ID(input); + FragInputs output; + ZERO_INITIALIZE(FragInputs, output); + + // Init to some default value to make the computer quiet (else it output 'divide by zero' warning even if value is not used). + // TODO: this is a really poor workaround, but the variable is used in a bunch of places + // to compute normals which are then passed on elsewhere to compute other values... + output.tangentToWorld = k_identity3x3; + output.positionSS = input.pos; // input.positionCS is SV_Position + // BETTER SHADERS: because we transform world position into actual world space for things like + // triplanar, etc, we have to back transform it here for lighting + output.positionRWS = GetCameraRelativePositionWS(input.worldPos); + output.tangentToWorld = BuildTangentToWorld(input.worldTangent, input.worldNormal); + output.texCoord0 = input.texcoord0; + output.texCoord1 = input.texcoord1; + output.texCoord2 = input.texcoord2; + + return output; + } + +#if UNITY_VERSION > UNITY_2022_3_12 + void ApplyDecalAndGetNormal(FragInputs fragInputs, PositionInputs posInput, Surface surfaceDescription, float3 normalTS, + inout SurfaceData surfaceData) + { + float3 doubleSidedConstants = GetDoubleSidedConstants(); + + #ifdef DECAL_NORMAL_BLENDING + // SG nodes don't ouptut surface gradients, so if decals require surf grad blending, we have to convert + // the normal to gradient before applying the decal. We then have to resolve the gradient back to world space + normalTS = SurfaceGradientFromTangentSpaceNormalAndFromTBN(normalTS, + fragInputs.tangentToWorld[0], fragInputs.tangentToWorld[1]); + + + #if HAVE_DECALS + if (_EnableDecals) + { + float alpha = 1.0; + alpha = surfaceDescription.Alpha; + + DecalSurfaceData decalSurfaceData = GetDecalSurfaceData(posInput, fragInputs, alpha); + ApplyDecalToSurfaceNormal(decalSurfaceData, fragInputs.tangentToWorld[2], normalTS); + ApplyDecalToSurfaceDataNoNormal(decalSurfaceData, surfaceData); + } + #endif + + GetNormalWS_SG(fragInputs, normalTS, surfaceData.normalWS, doubleSidedConstants); + #else + // normal delivered to master node + + #if HAVE_DECALS + if (_EnableDecals) + { + float alpha = 1.0; + alpha = surfaceDescription.Alpha; + + // Both uses and modifies 'surfaceData.normalWS'. + DecalSurfaceData decalSurfaceData = GetDecalSurfaceData(posInput, fragInputs, alpha); + ApplyDecalToSurfaceNormal(decalSurfaceData, surfaceData.normalWS.xyz); + ApplyDecalToSurfaceDataNoNormal(decalSurfaceData, surfaceData); + } + #endif + #endif + } +#endif + + void BuildSurfaceData(FragInputs fragInputs, inout Surface surfaceDescription, float3 V, PositionInputs posInput, out SurfaceData surfaceData, out float3 bentNormalWS) + { + // setup defaults -- these are used if the graph doesn't output a value + ZERO_INITIALIZE(SurfaceData, surfaceData); + + // specularOcclusion need to be init ahead of decal to quiet the compiler that modify the SurfaceData struct + // however specularOcclusion can come from the graph, so need to be init here so it can be override. + surfaceData.specularOcclusion = 1.0; + + // copy across graph values, if defined + surfaceData.baseColor = surfaceDescription.Albedo; + surfaceData.perceptualSmoothness = surfaceDescription.Smoothness; + surfaceData.ambientOcclusion = surfaceDescription.Occlusion; + surfaceData.specularOcclusion = surfaceDescription.SpecularOcclusion; + surfaceData.metallic = surfaceDescription.Metallic; + surfaceData.subsurfaceMask = surfaceDescription.SubsurfaceMask; + surfaceData.thickness = surfaceDescription.Thickness; + surfaceData.diffusionProfileHash = asuint(surfaceDescription.DiffusionProfileHash); + #if _USESPECULAR + surfaceData.specularColor = surfaceDescription.Specular; + #endif + surfaceData.coatMask = surfaceDescription.CoatMask; + surfaceData.anisotropy = surfaceDescription.Anisotropy; + surfaceData.iridescenceMask = surfaceDescription.IridescenceMask; + surfaceData.iridescenceThickness = surfaceDescription.IridescenceThickness; + + + + #if defined(_REFRACTION_PLANE) || defined(_REFRACTION_SPHERE) || defined(_REFRACTION_THIN) + if (_EnableSSRefraction) + { + surfaceData.transmittanceMask = (1.0 - surfaceDescription.Alpha); + surfaceDescription.Alpha = 1.0; + } + else + { + surfaceData.ior = surfaceDescription.ior; + surfaceData.transmittanceColor = surfaceDescription.transmittanceColor; + surfaceData.atDistance = surfaceDescription.atDistance; + surfaceData.transmittanceMask = surfaceDescription.transmittanceMask; + surfaceDescription.Alpha = 1.0; + } + #else + surfaceData.ior = 1.0; + surfaceData.transmittanceColor = float3(1.0, 1.0, 1.0); + surfaceData.atDistance = 1.0; + surfaceData.transmittanceMask = 0.0; + #endif + + + + // These static material feature allow compile time optimization + surfaceData.materialFeatures = MATERIALFEATUREFLAGS_LIT_STANDARD; + #ifdef _MATERIAL_FEATURE_SUBSURFACE_SCATTERING + surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_SUBSURFACE_SCATTERING; + #endif + + #ifdef _MATERIAL_FEATURE_TRANSMISSION + surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_TRANSMISSION; + #endif + + #ifdef _MATERIAL_FEATURE_ANISOTROPY + surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_ANISOTROPY; + surfaceData.normalWS = float3(0, 1, 0); + #endif + + #ifdef _MATERIAL_FEATURE_IRIDESCENCE + surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_IRIDESCENCE; + #endif + + #ifdef _MATERIAL_FEATURE_SPECULAR_COLOR + surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_SPECULAR_COLOR; + #endif + + #if defined(_MATERIAL_FEATURE_CLEAR_COAT) || _CLEARCOAT + surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_CLEAR_COAT; + #endif + + #if defined (_MATERIAL_FEATURE_SPECULAR_COLOR) && defined (_ENERGY_CONSERVING_SPECULAR) + // Require to have setup baseColor + // Reproduce the energy conservation done in legacy Unity. Not ideal but better for compatibility and users can unchek it + surfaceData.baseColor *= (1.0 - Max3(surfaceData.specularColor.r, surfaceData.specularColor.g, surfaceData.specularColor.b)); + #endif + + float3 normalTS = surfaceDescription.Normal; + #if !_WORLDSPACENORMAL + surfaceData.normalWS = mul(surfaceDescription.Normal, fragInputs.tangentToWorld); + #else + normalTS = mul(fragInputs.tangentToWorld, surfaceDescription.Normal); + surfaceData.normalWS = surfaceDescription.Normal; + #endif + + + #if UNITY_VERSION > UNITY_2022_3_12 + ApplyDecalAndGetNormal(fragInputs, posInput, surfaceDescription, normalTS, surfaceData); + #else + #ifdef DECAL_NORMAL_BLENDING + #if HAVE_DECALS + float alpha = 1.0; + alpha = surfaceDescription.Alpha; + if (_EnableDecals) + { + DecalSurfaceData decalSurfaceData = GetDecalSurfaceData(posInput, fragInputs, alpha); + ApplyDecalToSurfaceData(decalSurfaceData, fragInputs.tangentToWorld[2], surfaceData, normalTS); + } + #endif + #else + #if HAVE_DECALS + if (_EnableDecals) + { + float alpha = 1.0; + alpha = surfaceDescription.Alpha; + // Both uses and modifies 'surfaceData.normalWS'. + DecalSurfaceData decalSurfaceData = GetDecalSurfaceData(posInput, fragInputs, alpha); + ApplyDecalToSurfaceData(decalSurfaceData, fragInputs.tangentToWorld[2], surfaceData); + } + #endif + #endif + #endif + + + + surfaceData.geomNormalWS = fragInputs.tangentToWorld[2]; + + surfaceData.tangentWS = normalize(fragInputs.tangentToWorld[0].xyz); // The tangent is not normalize in tangentToWorld for mikkt. TODO: Check if it expected that we normalize with Morten. Tag: SURFACE_GRADIENT + + + bentNormalWS = surfaceData.normalWS; + + surfaceData.tangentWS = Orthonormalize(surfaceData.tangentWS, surfaceData.normalWS); + + #ifdef DEBUG_DISPLAY + if (_DebugMipMapMode != DEBUGMIPMAPMODE_NONE) + { + // TODO: need to update mip info + surfaceData.metallic = 0; + } + + // We need to call ApplyDebugToSurfaceData after filling the surfarcedata and before filling builtinData + // as it can modify attribute use for static lighting + ApplyDebugToSurfaceData(fragInputs.tangentToWorld, surfaceData); + #endif + + // By default we use the ambient occlusion with Tri-ace trick (apply outside) for specular occlusion. + // If user provide bent normal then we process a better term + #if defined(_SPECULAR_OCCLUSION_CUSTOM) + // Just use the value passed through via the slot (not active otherwise) + #elif defined(_SPECULAR_OCCLUSION_FROM_AO_BENT_NORMAL) + // If we have bent normal and ambient occlusion, process a specular occlusion + surfaceData.specularOcclusion = GetSpecularOcclusionFromBentAO(V, bentNormalWS, surfaceData.normalWS, surfaceData.ambientOcclusion, PerceptualSmoothnessToPerceptualRoughness(surfaceData.perceptualSmoothness)); + #elif defined(_AMBIENT_OCCLUSION) && defined(_SPECULAR_OCCLUSION_FROM_AO) + surfaceData.specularOcclusion = GetSpecularOcclusionFromAmbientOcclusion(ClampNdotV(dot(surfaceData.normalWS, V)), surfaceData.ambientOcclusion, PerceptualSmoothnessToRoughness(surfaceData.perceptualSmoothness)); + #endif + + #if defined(_ENABLE_GEOMETRIC_SPECULAR_AA) && !defined(SHADER_STAGE_RAY_TRACING) + surfaceData.perceptualSmoothness = GeometricNormalFiltering(surfaceData.perceptualSmoothness, fragInputs.tangentToWorld[2], surfaceDescription.SpecularAAScreenSpaceVariance, surfaceDescription.SpecularAAThreshold); + #endif + } + + void GetSurfaceAndBuiltinData(VertexToPixel m2ps, FragInputs fragInputs, float3 V, inout PositionInputs posInput, + out SurfaceData surfaceData, out BuiltinData builtinData, inout Surface l, inout ShaderData d + #if NEED_FACING + , bool facing + #endif + ) + { + // Removed since crossfade does not work, probably needs extra material setup. + //#if !defined(SHADER_STAGE_RAY_TRACING) && !defined(_TESSELLATION_DISPLACEMENT) + // #ifdef LOD_FADE_CROSSFADE // enable dithering LOD transition if user select CrossFade transition in LOD group + // LODDitheringTransition(ComputeFadeMaskSeed(V, posInput.positionSS), unity_LODFade.x); + // #endif + //#endif + + + + + d = CreateShaderData(m2ps + #if NEED_FACING + , facing + #endif + ); + + l = (Surface)0; + + l.Albedo = half3(0.5, 0.5, 0.5); + l.Normal = float3(0,0,1); + l.Occlusion = 1; + l.Alpha = 1; + l.SpecularOcclusion = 1; + + #if !defined(SHADER_STAGE_RAY_TRACING) && defined(_DEPTHOFFSET_ON) + l.outputDepth = d.clipPos.z; + #endif + + ChainSurfaceFunction(l, d); + + #if !defined(SHADER_STAGE_RAY_TRACING) && defined(_DEPTHOFFSET_ON) + posInput.deviceDepth = l.outputDepth; + #endif + + #if _UNLIT + //l.Emission = l.Albedo; + //l.Albedo = 0; + l.Normal = half3(0,0,1); + l.Occlusion = 1; + l.Metallic = 0; + l.Specular = 0; + #endif + + surfaceData.geomNormalWS = d.worldSpaceNormal; + surfaceData.tangentWS = d.worldSpaceTangent; + fragInputs.tangentToWorld = d.TBNMatrix; + + float3 bentNormalWS; + + BuildSurfaceData(fragInputs, l, V, posInput, surfaceData, bentNormalWS); + + + float4 lightmapTexCoord1 = fragInputs.texCoord1; + float4 lightmapTexCoord2 = fragInputs.texCoord2; + //#ifdef FRAG_INPUTS_USE_TEXCOORD1 + // float4 lightmapTexCoord1 = fragInputs.texCoord1; + // #else + // float4 lightmapTexCoord1 = float4(0,0,0,0); + // #endif + + // #ifdef FRAG_INPUTS_USE_TEXCOORD2 + // float4 lightmapTexCoord2 = fragInputs.texCoord2; + // #else + // float4 lightmapTexCoord2 = float4(0,0,0,0); + // #endif + + + InitBuiltinData(posInput, l.Alpha, bentNormalWS, -d.worldSpaceNormal, lightmapTexCoord1, lightmapTexCoord2, builtinData); + + + + builtinData.emissiveColor = l.Emission; + + #if defined(_OVERRIDE_BAKEDGI) + builtinData.bakeDiffuseLighting = l.DiffuseGI; + builtinData.backBakeDiffuseLighting = l.BackDiffuseGI; + builtinData.emissiveColor += l.SpecularGI; + #endif + + #if defined(_OVERRIDE_SHADOWMASK) + builtinData.shadowMask0 = l.ShadowMask.x; + builtinData.shadowMask1 = l.ShadowMask.y; + builtinData.shadowMask2 = l.ShadowMask.z; + builtinData.shadowMask3 = l.ShadowMask.w; + #endif + + #ifdef UNITY_VIRTUAL_TEXTURING + //builtinData.vtPackedFeedback = surfaceData.VTPackedFeedback; + #endif + + #if (SHADERPASS == SHADERPASS_DISTORTION) + builtinData.distortion = surfaceData.Distortion; + builtinData.distortionBlur = surfaceData.DistortionBlur; + #endif + + #ifndef SHADER_UNLIT + // PostInitBuiltinData call ApplyDebugToBuiltinData + PostInitBuiltinData(V, posInput, surfaceData, builtinData); + #else + ApplyDebugToBuiltinData(builtinData); + #endif + + RAY_TRACING_OPTIONAL_ALPHA_TEST_PASS + } + + + + void Frag( VertexToPixel IN + #ifdef WRITE_NORMAL_BUFFER + , out float4 outNormalBuffer : SV_Target0 + #ifdef WRITE_MSAA_DEPTH + , out float1 depthColor : SV_Target1 + #endif + #elif defined(WRITE_MSAA_DEPTH) // When only WRITE_MSAA_DEPTH is define and not WRITE_NORMAL_BUFFER it mean we are Unlit and only need depth, but we still have normal buffer binded + , out float4 outNormalBuffer : SV_Target0 + , out float1 depthColor : SV_Target1 + #elif defined(SCENESELECTIONPASS) + , out float4 outColor : SV_Target0 + #endif + + #ifdef _DEPTHOFFSET_ON + , out float outputDepth : SV_Depth + #endif + #if NEED_FACING + , bool facing : SV_IsFrontFace + #endif + ) + { + UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX(IN); + FragInputs input = BuildFragInputs(IN); + + // input.positionSS is SV_Position + PositionInputs posInput = GetPositionInput(input.positionSS.xy, _ScreenSize.zw, input.positionSS.z, input.positionSS.w, input.positionRWS); + + + float3 V = GetWorldSpaceNormalizeViewDir(input.positionRWS); + + + SurfaceData surfaceData; + BuiltinData builtinData; + Surface l; + ShaderData d; + GetSurfaceAndBuiltinData(IN, input, V, posInput, surfaceData, builtinData, l, d + #if NEED_FACING + , facing + #endif + ); + + + #ifdef _DEPTHOFFSET_ON + outputDepth = l.outputDepth; + #endif + + #ifdef WRITE_NORMAL_BUFFER + EncodeIntoNormalBuffer(ConvertSurfaceDataToNormalData(surfaceData), posInput.positionSS, outNormalBuffer); + #ifdef WRITE_MSAA_DEPTH + // In case we are rendering in MSAA, reading the an MSAA depth buffer is way too expensive. To avoid that, we export the depth to a color buffer + depthColor = v2f.pos.z; + #endif + #elif defined(WRITE_MSAA_DEPTH) // When we are MSAA depth only without normal buffer + // Due to the binding order of these two render targets, we need to have them both declared + outNormalBuffer = float4(0.0, 0.0, 0.0, 1.0); + // In case we are rendering in MSAA, reading the an MSAA depth buffer is way too expensive. To avoid that, we export the depth to a color buffer + depthColor = v2f.pos.z; + #elif defined(SCENESELECTIONPASS) + // We use depth prepass for scene selection in the editor, this code allow to output the outline correctly + outColor = float4(_ObjectId, _PassValue, 1.0, 1.0); + #endif + } + + ENDHLSL + } + + + Pass + { + Name "ScenePickingPass" + Tags + { + "LightMode" = "Picking" + } + + Tags { "RenderType" = "Opaque" "Queue" = "Geometry" "PreviewType" = "Plane" } + Cull [_CullingOption] + ZWrite [_ZWrite] + ZTest [_ZTestMode] + + + //------------------------------------------------------------------------------------- + // End Render Modes + //------------------------------------------------------------------------------------- + + HLSLPROGRAM + + #pragma target 4.5 + #pragma only_renderers d3d11 playstation xboxone xboxseries vulkan metal switch + #pragma multi_compile_instancing + #pragma editor_sync_compilation + #pragma instancing_options renderinglayer + + //#pragma shader_feature _ _SURFACE_TYPE_TRANSPARENT + //#pragma shader_feature_local _BLENDMODE_OFF _BLENDMODE_ALPHA _BLENDMODE_ADD _BLENDMODE_PRE_MULTIPLY + //#pragma shader_feature_local _ _ADD_PRECOMPUTED_VELOCITY + //#pragma shader_feature_local _ _TRANSPARENT_WRITES_MOTION_VEC + //#pragma shader_feature_local _ _ENABLE_FOG_ON_TRANSPARENT + //#pragma shader_feature_local _ _DISABLE_DECALS + //#pragma shader_feature_local _ _DISABLE_SSR + //#pragma shader_feature_local _ _DISABLE_SSR_TRANSPARENT + //#pragma shader_feature_local _REFRACTION_OFF _REFRACTION_PLANE _REFRACTION_SPHERE _REFRACTION_THIN + #pragma multi_compile _ WRITE_DECAL_BUFFER + #pragma multi_compile _ LOD_FADE_CROSSFADE + + #define SHADERPASS SHADERPASS_DEPTH_ONLY + #define SCENEPICKINGPASS + + + + #pragma shader_feature_local GLOW_ON + #pragma shader_feature_local FADE_ON + #pragma shader_feature_local OUTBASE_ON + #pragma shader_feature_local ONLYOUTLINE_ON + #pragma shader_feature_local GRADIENT_ON + #pragma shader_feature_local GRADIENT2COL_ON + #pragma shader_feature_local RADIALGRADIENT_ON + #pragma shader_feature_local COLORSWAP_ON + #pragma shader_feature_local HSV_ON + #pragma shader_feature_local CHANGECOLOR_ON + #pragma shader_feature_local CHANGECOLOR2_ON + #pragma shader_feature_local CHANGECOLOR3_ON + #pragma shader_feature_local COLORRAMP_ON + #pragma shader_feature_local GRADIENTCOLORRAMP_ON + #pragma shader_feature_local HITEFFECT_ON + #pragma shader_feature_local NEGATIVE_ON + #pragma shader_feature_local PIXELATE_ON + #pragma shader_feature_local GREYSCALE_ON + #pragma shader_feature_local POSTERIZE_ON + #pragma shader_feature_local BLUR_ON + #pragma shader_feature_local MOTIONBLUR_ON + #pragma shader_feature_local GHOST_ON + #pragma shader_feature_local ALPHAOUTLINE_ON + #pragma shader_feature_local INNEROUTLINE_ON + #pragma shader_feature_local ONLYINNEROUTLINE_ON + #pragma shader_feature_local HOLOGRAM_ON + #pragma shader_feature_local CHROMABERR_ON + #pragma shader_feature_local GLITCH_ON + #pragma shader_feature_local FLICKER_ON + #pragma shader_feature_local SHADOW_ON + #pragma shader_feature_local SHINE_ON + #pragma shader_feature_local CONTRAST_ON + #pragma shader_feature_local OVERLAY_ON + #pragma shader_feature_local OVERLAYMULT_ON + #pragma shader_feature_local DOODLE_ON + #pragma shader_feature_local WIND_ON + #pragma shader_feature_local WAVEUV_ON + #pragma shader_feature_local ROUNDWAVEUV_ON + #pragma shader_feature_local RECTSIZE_ON + #pragma shader_feature_local OFFSETUV_ON + #pragma shader_feature_local CLIPPING_ON + #pragma shader_feature_local RADIALCLIPPING_ON + #pragma shader_feature_local TEXTURESCROLL_ON + #pragma shader_feature_local ZOOMUV_ON + #pragma shader_feature_local DISTORT_ON + #pragma shader_feature_local WARP_ON + #pragma shader_feature_local TWISTUV_ON + #pragma shader_feature_local ROTATEUV_ON + #pragma shader_feature_local POLARUV_ON + #pragma shader_feature_local FISHEYE_ON + #pragma shader_feature_local PINCH_ON + #pragma shader_feature_local SHAKEUV_ON + + #pragma shader_feature_local GLOWTEX_ON + #pragma shader_feature_local OUTTEX_ON + #pragma shader_feature_local OUTDIST_ON + #pragma shader_feature_local OUTBASE8DIR_ON + #pragma shader_feature_local OUTBASEPIXELPERF_ON + #pragma shader_feature_local COLORRAMPOUTLINE_ON + #pragma shader_feature_local GREYSCALEOUTLINE_ON + #pragma shader_feature_local POSTERIZEOUTLINE_ON + #pragma shader_feature_local BLURISHD_ON + #pragma shader_feature_local MANUALWIND_ON + #pragma shader_feature_local ATLAS_ON + #pragma shader_feature_local PREMULTIPLYALPHA_ON + + #pragma shader_feature BILBOARD_ON + #pragma shader_feature BILBOARDY_ON + + #pragma shader_feature NORMALMAP_ON + + + #define _HDRP 1 +#define _USINGTEXCOORD1 1 +#define _USINGTEXCOORD2 1 + + + #pragma vertex Vert + #pragma fragment Frag + + // useful conversion functions to make surface shader code just work + + #define UNITY_DECLARE_TEX2D(name) TEXTURE2D(name); SAMPLER(sampler##name); + #define UNITY_DECLARE_TEX2D_NOSAMPLER(name) TEXTURE2D(name); + #define UNITY_DECLARE_TEX2DARRAY(name) TEXTURE2D_ARRAY(name); SAMPLER(sampler##name); + #define UNITY_DECLARE_TEX2DARRAY_NOSAMPLER(tex) TEXTURE2D_ARRAY(tex); + + #define UNITY_SAMPLE_TEX2DARRAY(tex,coord) SAMPLE_TEXTURE2D_ARRAY(tex, sampler##tex, coord.xy, coord.z) + #define UNITY_SAMPLE_TEX2DARRAY_LOD(tex,coord,lod) SAMPLE_TEXTURE2D_ARRAY_LOD(tex, sampler##tex, coord.xy, coord.z, lod) + #define UNITY_SAMPLE_TEX2D(tex, coord) SAMPLE_TEXTURE2D(tex, sampler##tex, coord) + #define UNITY_SAMPLE_TEX2D_SAMPLER(tex, samp, coord) SAMPLE_TEXTURE2D(tex, sampler##samp, coord) + + #define UNITY_SAMPLE_TEX2D_LOD(tex,coord, lod) SAMPLE_TEXTURE2D_LOD(tex, sampler_##tex, coord, lod) + #define UNITY_SAMPLE_TEX2D_SAMPLER_LOD(tex,samplertex,coord, lod) SAMPLE_TEXTURE2D_LOD (tex, sampler##samplertex,coord, lod) + + #if defined(UNITY_COMPILER_HLSL) + #define UNITY_INITIALIZE_OUTPUT(type,name) name = (type)0; + #else + #define UNITY_INITIALIZE_OUTPUT(type,name) + #endif + + #define sampler2D_float sampler2D + #define sampler2D_half sampler2D + + #undef WorldNormalVector + #define WorldNormalVector(data, normal) mul(normal, data.TBNMatrix) + + #define UnityObjectToWorldNormal(normal) mul(GetObjectToWorldMatrix(), normal) + + #ifndef SHADER_STAGE_FRAGMENT + #if !defined(SHADOW_ULTRA_LOW) && !defined(SHADOW_LOW) && !defined(SHADOW_MEDIUM) && !defined(SHADOW_HIGH) // ultra low come from volumetricLighting.compute + #define SHADOW_MEDIUM + #endif + #if !defined(AREA_SHADOW_LOW) && !defined(AREA_SHADOW_MEDIUM) && !defined(AREA_SHADOW_HIGH) // low come from volumetricLighting.compute + #define AREA_SHADOW_MEDIUM + #endif + #endif + + + +// HDRP Adapter stuff + #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Common.hlsl" + #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Common.hlsl" + #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/GeometricTools.hlsl" // Required by Tessellation.hlsl + #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Tessellation.hlsl" + #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Texture.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/ShaderVariables.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/ShaderPass/ShaderPass.cs.hlsl" + #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/TextureStack.hlsl" // Required to be include before we include properties as it define DECLARE_STACK_CB + #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/DebugMipmapStreamingMacros.hlsl" // Required before including properties as it defines UNITY_TEXTURE_STREAMING_DEBUG_VARS + // Always include Shader Graph version + // Always include last to avoid double macros + #include "Packages/com.unity.shadergraph/ShaderGraphLibrary/Functions.hlsl" // Need to be here for Gradient struct definition + + +#include "Packages/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/ShaderPass/FragInputs.hlsl" + + + + #ifdef RAYTRACING_SHADER_GRAPH_DEFAULT + #define RAYTRACING_SHADER_GRAPH_HIGH + #endif + + #ifdef RAYTRACING_SHADER_GRAPH_RAYTRACED + #define RAYTRACING_SHADER_GRAPH_LOW + #endif + // end + + + + + // If we use subsurface scattering, enable output split lighting (for forward pass) + #if defined(_MATERIAL_FEATURE_SUBSURFACE_SCATTERING) && !defined(_SURFACE_TYPE_TRANSPARENT) + #define OUTPUT_SPLIT_LIGHTING + #endif + + #define HAVE_RECURSIVE_RENDERING + + #if SHADERPASS == SHADERPASS_TRANSPARENT_DEPTH_PREPASS + #if !defined(_DISABLE_SSR_TRANSPARENT) && !defined(SHADER_UNLIT) + #define WRITE_NORMAL_BUFFER + #endif + #endif + + #ifndef DEBUG_DISPLAY + // In case of opaque we don't want to perform the alpha test, it is done in depth prepass and we use depth equal for ztest (setup from UI) + // Don't do it with debug display mode as it is possible there is no depth prepass in this case + #if !defined(_SURFACE_TYPE_TRANSPARENT) && defined(_ALPHATEST) + #if SHADERPASS == SHADERPASS_FORWARD + #define SHADERPASS_FORWARD_BYPASS_ALPHA_TEST + #elif SHADERPASS == SHADERPASS_GBUFFER + #define SHADERPASS_GBUFFER_BYPASS_ALPHA_TEST + #endif + #endif + #endif + + // Define _DEFERRED_CAPABLE_MATERIAL for shader capable to run in deferred pass + #if defined(SHADER_LIT) && !defined(_SURFACE_TYPE_TRANSPARENT) + #define _DEFERRED_CAPABLE_MATERIAL + #endif + + // Translate transparent motion vector define + #if defined(_TRANSPARENT_WRITES_MOTION_VEC) && defined(_SURFACE_TYPE_TRANSPARENT) + #define _WRITE_TRANSPARENT_MOTION_VECTOR + #endif + + + + + CBUFFER_START(UnityPerMaterial) + float _UseShadowThreshold; + float _BlendMode; + float _EnableBlendModePreserveSpecularLighting; + float _RayTracing; + float _RefractionModel; + + + half4 _Color; + half4 _MainTex_ST, _MainTex_TexelSize; + half _Alpha, _AlphaCutoffValue; + + #if ATLAS_ON + half _MinXUV, _MaxXUV, _MinYUV, _MaxYUV; + #endif + + #if GLOW_ON + half4 _GlowColor; + half _Glow, _GlowGlobal; + #endif + + #if HSV_ON + half _HsvShift, _HsvSaturation, _HsvBright; + #endif + + #if DISTORT_ON + half4 _DistortTex_ST; + half _DistortTexXSpeed, _DistortTexYSpeed, _DistortAmount; + #endif + + #if FADE_ON + half4 _FadeBurnColor, _FadeTex_ST, _FadeBurnTex_ST; + half _FadeAmount, _FadeBurnWidth, _FadeBurnTransition,_FadeBurnGlow; + #endif + + #if OUTBASE_ON + half4 _OutlineColor; + half _OutlineAlpha, _OutlineGlow, _OutlineWidth; + int _OutlinePixelWidth; + #endif + + #if OUTTEX_ON + half4 _OutlineTex_ST; + half _OutlineTexXSpeed, _OutlineTexYSpeed; + #endif + + #if OUTDIST_ON + half4 _OutlineDistortTex_ST; + half _OutlineDistortTexXSpeed, _OutlineDistortTexYSpeed, _OutlineDistortAmount; + #endif + + #if ALPHAOUTLINE_ON + half _AlphaOutlineGlow, _AlphaOutlinePower, _AlphaOutlineMinAlpha, _AlphaOutlineBlend; + half4 _AlphaOutlineColor; + #endif + + #if INNEROUTLINE_ON + half _InnerOutlineThickness, _InnerOutlineAlpha, _InnerOutlineGlow; + half4 _InnerOutlineColor; + #endif + + #if GRADIENT_ON + half _GradBlend, _GradBoostX, _GradBoostY; + half4 _GradTopRightCol, _GradTopLeftCol, _GradBotRightCol, _GradBotLeftCol; + #endif + + #if COLORSWAP_ON + half4 _ColorSwapRed, _ColorSwapGreen, _ColorSwapBlue; + half _ColorSwapRedLuminosity, _ColorSwapGreenLuminosity, _ColorSwapBlueLuminosity, _ColorSwapBlend; + #endif + + #if CHANGECOLOR_ON + half4 _ColorChangeNewCol, _ColorChangeTarget; + half _ColorChangeTolerance, _ColorChangeLuminosity; + #endif + #if CHANGECOLOR2_ON + half4 _ColorChangeNewCol2, _ColorChangeTarget2; + half _ColorChangeTolerance2; + #endif + #if CHANGECOLOR3_ON + half4 _ColorChangeNewCol3, _ColorChangeTarget3; + half _ColorChangeTolerance3; + #endif + + #if COLORRAMP_ON + half _ColorRampLuminosity, _ColorRampBlend; + #endif + + #if HITEFFECT_ON + half4 _HitEffectColor; + half _HitEffectGlow, _HitEffectBlend; + #endif + + #if NEGATIVE_ON + half _NegativeAmount; + #endif + + #if PIXELATE_ON + half _PixelateSize; + #endif + + #if GREYSCALE_ON + half _GreyscaleLuminosity, _GreyscaleBlend; + half4 _GreyscaleTintColor; + #endif + + #if POSTERIZE_ON + half _PosterizeNumColors, _PosterizeGamma; + #endif + + #if BLUR_ON + half _BlurIntensity; + #endif + + #if MOTIONBLUR_ON + half _MotionBlurAngle, _MotionBlurDist; + #endif + + #if GHOST_ON + half _GhostColorBoost, _GhostTransparency, _GhostBlend; + #endif + + #if HOLOGRAM_ON + half _HologramStripesAmount, _HologramMinAlpha, _HologramUnmodAmount, _HologramStripesSpeed, _HologramMaxAlpha, _HologramBlend; + half4 _HologramStripeColor; + #endif + + #if CHROMABERR_ON + half _ChromAberrAmount, _ChromAberrAlpha; + #endif + + #if GLITCH_ON + half _GlitchAmount, _GlitchSize; + #endif + + #if FLICKER_ON + half _FlickerFreq, _FlickerPercent, _FlickerAlpha; + #endif + + #if SHADOW_ON + half _ShadowX, _ShadowY, _ShadowAlpha; + half4 _ShadowColor; + #endif + + #if SHINE_ON + half4 _ShineColor; + half _ShineLocation, _ShineRotate, _ShineWidth, _ShineGlow; + #endif + + #if CONTRAST_ON + half _Contrast, _Brightness; + #endif + + #if OVERLAY_ON + half4 _OverlayTex_ST, _OverlayColor; + half _OverlayGlow, _OverlayBlend, _OverlayTextureScrollXSpeed, _OverlayTextureScrollYSpeed; + #endif + + #if DOODLE_ON + half _HandDrawnAmount, _HandDrawnSpeed; + #endif + + #if WIND_ON + half _GrassSpeed, _GrassWind, _GrassManualAnim, _GrassRadialBend; + #endif + + #if WAVEUV_ON + float _WaveAmount, _WaveSpeed, _WaveStrength, _WaveX, _WaveY; + #endif + + #if ROUNDWAVEUV_ON + half _RoundWaveStrength, _RoundWaveSpeed; + #endif + + #if RECTSIZE_ON + half _RectSize; + #endif + + #if OFFSETUV_ON + half _OffsetUvX, _OffsetUvY; + #endif + + #if CLIPPING_ON + half _ClipUvLeft, _ClipUvRight, _ClipUvUp, _ClipUvDown; + #endif + + #if RADIALCLIPPING_ON + half _RadialStartAngle, _RadialClip, _RadialClip2; + #endif + + #if TEXTURESCROLL_ON + half _TextureScrollXSpeed, _TextureScrollYSpeed; + #endif + + #if ZOOMUV_ON + half _ZoomUvAmount; + #endif + + #if WARP_ON + half _WarpStrength, _WarpSpeed, _WarpScale; + #endif + + #if TWISTUV_ON + half _TwistUvAmount, _TwistUvPosX, _TwistUvPosY, _TwistUvRadius; + #endif + + #if ROTATEUV_ON + half _RotateUvAmount; + #endif + + #if FISHEYE_ON + half _FishEyeUvAmount; + #endif + + #if PINCH_ON + half _PinchUvAmount; + #endif + + #if SHAKEUV_ON + half _ShakeUvSpeed, _ShakeUvX, _ShakeUvY; + #endif + + #if NORMALMAP_ON + half _NormalStrength; + #endif + + float _RandomSeed; + + + + + CBUFFER_END + + + + // -- Property used by ScenePickingPass + #ifdef SCENEPICKINGPASS + float4 _SelectionID; + #endif + + // -- Properties used by SceneSelectionPass + #ifdef SCENESELECTIONPASS + int _ObjectId; + int _PassValue; + #endif + + + // data across stages, stripped like the above. + struct VertexToPixel + { + float4 pos : SV_POSITION; + float3 worldPos : TEXCOORD0; + float3 worldNormal : TEXCOORD1; + float4 worldTangent : TEXCOORD2; + float4 texcoord0 : TEXCOORD3; + float4 texcoord1 : TEXCOORD4; + float4 texcoord2 : TEXCOORD5; + // #if %TEXCOORD3REQUIREKEY% + float4 texcoord3 : TEXCOORD6; + // #endif + + // #if %SCREENPOSREQUIREKEY% + // float4 screenPos : TEXCOORD7; + // #endif + + // #if %VERTEXCOLORREQUIREKEY% + float4 vertexColor : COLOR; + // #endif + + // #if %EXTRAV2F0REQUIREKEY% + // float4 extraV2F0 : TEXCOORD8; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // float4 extraV2F1 : TEXCOORD9; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // float4 extraV2F2 : TEXCOORD10; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // float4 extraV2F3 : TEXCOORD11; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // float4 extraV2F4 : TEXCOORD12; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // float4 extraV2F5 : TEXCOORD13; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // float4 extraV2F6 : TEXCOORD14; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // float4 extraV2F7 : TEXCOORD15; + // #endif + + #if UNITY_ANY_INSTANCING_ENABLED + UNITY_VERTEX_INPUT_INSTANCE_ID + #endif // UNITY_ANY_INSTANCING_ENABLED + + #if _HDRP && (_PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR))) + float4 previousPositionCS : TEXCOORD16; // Contain previous transform position (in case of skinning for example) + float4 motionVectorCS : TEXCOORD17; + #endif + + UNITY_VERTEX_OUTPUT_STEREO + }; + + + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Debug/DebugDisplay.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/Material.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/Lit/Lit.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/BuiltinUtilities.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/MaterialUtilities.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/ShaderGraphFunctions.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/PickingSpaceTransforms.hlsl" + + + + + // data describing the user output of a pixel + struct Surface + { + half3 Albedo; + half Height; + half3 Normal; + half Smoothness; + half3 Emission; + half Metallic; + half3 Specular; + half Occlusion; + half SpecularPower; // for simple lighting + half Alpha; + float outputDepth; // if written, SV_Depth semantic is used. ShaderData.clipPos.z is unused value + // HDRP Only + half SpecularOcclusion; + half SubsurfaceMask; + half Thickness; + half CoatMask; + half CoatSmoothness; + half Anisotropy; + half IridescenceMask; + half IridescenceThickness; + int DiffusionProfileHash; + float SpecularAAThreshold; + float SpecularAAScreenSpaceVariance; + // requires _OVERRIDE_BAKEDGI to be defined, but is mapped in all pipelines + float3 DiffuseGI; + float3 BackDiffuseGI; + float3 SpecularGI; + float ior; + float3 transmittanceColor; + float atDistance; + float transmittanceMask; + // requires _OVERRIDE_SHADOWMASK to be defines + float4 ShadowMask; + + // for decals + float NormalAlpha; + float MAOSAlpha; + + + }; + + // Data the user declares in blackboard blocks + struct Blackboard + { + + float blackboardDummyData; + }; + + // data the user might need, this will grow to be big. But easy to strip + struct ShaderData + { + float4 clipPos; // SV_POSITION + float3 localSpacePosition; + float3 localSpaceNormal; + float3 localSpaceTangent; + + float3 worldSpacePosition; + float3 worldSpaceNormal; + float3 worldSpaceTangent; + float tangentSign; + + float3 worldSpaceViewDir; + float3 tangentSpaceViewDir; + + float4 texcoord0; + float4 texcoord1; + float4 texcoord2; + float4 texcoord3; + + float2 screenUV; + float4 screenPos; + + float4 vertexColor; + bool isFrontFace; + + float4 extraV2F0; + float4 extraV2F1; + float4 extraV2F2; + float4 extraV2F3; + float4 extraV2F4; + float4 extraV2F5; + float4 extraV2F6; + float4 extraV2F7; + + float3x3 TBNMatrix; + Blackboard blackboard; + }; + + struct VertexData + { + #if SHADER_TARGET > 30 + // uint vertexID : SV_VertexID; + #endif + float4 vertex : POSITION; + float3 normal : NORMAL; + float4 tangent : TANGENT; + float4 texcoord0 : TEXCOORD0; + + // optimize out mesh coords when not in use by user or lighting system + #if _URP && (_USINGTEXCOORD1 || _PASSMETA || _PASSFORWARD || _PASSGBUFFER) + float4 texcoord1 : TEXCOORD1; + #endif + + #if _URP && (_USINGTEXCOORD2 || _PASSMETA || ((_PASSFORWARD || _PASSGBUFFER) && defined(DYNAMICLIGHTMAP_ON))) + float4 texcoord2 : TEXCOORD2; + #endif + + #if _STANDARD && (_USINGTEXCOORD1 || (_PASSMETA || ((_PASSFORWARD || _PASSGBUFFER || _PASSFORWARDADD) && LIGHTMAP_ON))) + float4 texcoord1 : TEXCOORD1; + #endif + #if _STANDARD && (_USINGTEXCOORD2 || (_PASSMETA || ((_PASSFORWARD || _PASSGBUFFER) && DYNAMICLIGHTMAP_ON))) + float4 texcoord2 : TEXCOORD2; + #endif + + + #if _HDRP + float4 texcoord1 : TEXCOORD1; + float4 texcoord2 : TEXCOORD2; + #endif + + // #if %TEXCOORD3REQUIREKEY% + float4 texcoord3 : TEXCOORD3; + // #endif + + // #if %VERTEXCOLORREQUIREKEY% + float4 vertexColor : COLOR; + // #endif + + #if _PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR)) + float3 previousPositionOS : TEXCOORD4; // Contain previous transform position (in case of skinning for example) + #if defined (_ADD_PRECOMPUTED_VELOCITY) + float3 precomputedVelocity : TEXCOORD5; // Add Precomputed Velocity (Alembic computes velocities on runtime side). + #endif + #endif + + UNITY_VERTEX_INPUT_INSTANCE_ID + }; + + struct TessVertex + { + float4 vertex : INTERNALTESSPOS; + float3 normal : NORMAL; + float4 tangent : TANGENT; + float4 texcoord0 : TEXCOORD0; + float4 texcoord1 : TEXCOORD1; + float4 texcoord2 : TEXCOORD2; + + // #if %TEXCOORD3REQUIREKEY% + float4 texcoord3 : TEXCOORD3; + // #endif + + // #if %VERTEXCOLORREQUIREKEY% + float4 vertexColor : COLOR; + // #endif + + // #if %EXTRAV2F0REQUIREKEY% + // float4 extraV2F0 : TEXCOORD5; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // float4 extraV2F1 : TEXCOORD6; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // float4 extraV2F2 : TEXCOORD7; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // float4 extraV2F3 : TEXCOORD8; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // float4 extraV2F4 : TEXCOORD9; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // float4 extraV2F5 : TEXCOORD10; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // float4 extraV2F6 : TEXCOORD11; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // float4 extraV2F7 : TEXCOORD12; + // #endif + + #if _PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR)) + float3 previousPositionOS : TEXCOORD13; // Contain previous transform position (in case of skinning for example) + #if defined (_ADD_PRECOMPUTED_VELOCITY) + float3 precomputedVelocity : TEXCOORD14; + #endif + #endif + + UNITY_VERTEX_INPUT_INSTANCE_ID + UNITY_VERTEX_OUTPUT_STEREO + }; + + struct ExtraV2F + { + float4 extraV2F0; + float4 extraV2F1; + float4 extraV2F2; + float4 extraV2F3; + float4 extraV2F4; + float4 extraV2F5; + float4 extraV2F6; + float4 extraV2F7; + Blackboard blackboard; + float4 time; + }; + + + float3 WorldToTangentSpace(ShaderData d, float3 normal) + { + return mul(d.TBNMatrix, normal); + } + + float3 TangentToWorldSpace(ShaderData d, float3 normal) + { + return mul(normal, d.TBNMatrix); + } + + // in this case, make standard more like SRPs, because we can't fix + // unity_WorldToObject in HDRP, since it already does macro-fu there + + #if _STANDARD + float3 TransformWorldToObject(float3 p) { return mul(unity_WorldToObject, float4(p, 1)); }; + float3 TransformObjectToWorld(float3 p) { return mul(unity_ObjectToWorld, float4(p, 1)); }; + float4 TransformWorldToObject(float4 p) { return mul(unity_WorldToObject, p); }; + float4 TransformObjectToWorld(float4 p) { return mul(unity_ObjectToWorld, p); }; + float4x4 GetWorldToObjectMatrix() { return unity_WorldToObject; } + float4x4 GetObjectToWorldMatrix() { return unity_ObjectToWorld; } + #if (defined(SHADER_API_D3D11) || defined(SHADER_API_XBOXONE) || defined(UNITY_COMPILER_HLSLCC) || defined(SHADER_API_PSSL) || (SHADER_TARGET_SURFACE_ANALYSIS && !SHADER_TARGET_SURFACE_ANALYSIS_MOJOSHADER)) + #define UNITY_SAMPLE_TEX2D_LOD(tex,coord, lod) tex.SampleLevel (sampler##tex,coord, lod) + #define UNITY_SAMPLE_TEX2D_SAMPLER_LOD(tex,samplertex,coord, lod) tex.SampleLevel (sampler##samplertex,coord, lod) + #else + #define UNITY_SAMPLE_TEX2D_LOD(tex,coord,lod) tex2D (tex,coord,0,lod) + #define UNITY_SAMPLE_TEX2D_SAMPLER_LOD(tex,samplertex,coord,lod) tex2D (tex,coord,0,lod) + #endif + + #undef GetWorldToObjectMatrix() + + #define GetWorldToObjectMatrix() unity_WorldToObject + + + #endif + + float3 GetCameraWorldPosition() + { + #if _HDRP + return GetCameraRelativePositionWS(_WorldSpaceCameraPos); + #else + return _WorldSpaceCameraPos; + #endif + } + + #if _GRABPASSUSED + #if _STANDARD + TEXTURE2D(%GRABTEXTURE%); + SAMPLER(sampler_%GRABTEXTURE%); + #endif + + half3 GetSceneColor(float2 uv) + { + #if _STANDARD + return SAMPLE_TEXTURE2D(%GRABTEXTURE%, sampler_%GRABTEXTURE%, uv).rgb; + #else + return SHADERGRAPH_SAMPLE_SCENE_COLOR(uv); + #endif + } + #endif + + + + #if _STANDARD + UNITY_DECLARE_DEPTH_TEXTURE(_CameraDepthTexture); + float GetSceneDepth(float2 uv) { return SAMPLE_DEPTH_TEXTURE(_CameraDepthTexture, uv); } + float GetLinear01Depth(float2 uv) { return Linear01Depth(GetSceneDepth(uv)); } + float GetLinearEyeDepth(float2 uv) { return LinearEyeDepth(GetSceneDepth(uv)); } + #else + float GetSceneDepth(float2 uv) { return SHADERGRAPH_SAMPLE_SCENE_DEPTH(uv); } + float GetLinear01Depth(float2 uv) { return Linear01Depth(GetSceneDepth(uv), _ZBufferParams); } + float GetLinearEyeDepth(float2 uv) { return LinearEyeDepth(GetSceneDepth(uv), _ZBufferParams); } + #endif + + float3 GetWorldPositionFromDepthBuffer(float2 uv, float3 worldSpaceViewDir) + { + float eye = GetLinearEyeDepth(uv); + float3 camView = mul((float3x3)GetObjectToWorldMatrix(), transpose(mul(GetWorldToObjectMatrix(), UNITY_MATRIX_I_V)) [2].xyz); + + float dt = dot(worldSpaceViewDir, camView); + float3 div = worldSpaceViewDir/dt; + float3 wpos = (eye * div) + GetCameraWorldPosition(); + return wpos; + } + + #if _HDRP + float3 ObjectToWorldSpacePosition(float3 pos) + { + return GetAbsolutePositionWS(TransformObjectToWorld(pos)); + } + #else + float3 ObjectToWorldSpacePosition(float3 pos) + { + return TransformObjectToWorld(pos); + } + #endif + + #if _STANDARD + UNITY_DECLARE_SCREENSPACE_TEXTURE(_CameraDepthNormalsTexture); + float3 GetSceneNormal(float2 uv, float3 worldSpaceViewDir) + { + float4 depthNorms = UNITY_SAMPLE_SCREENSPACE_TEXTURE(_CameraDepthNormalsTexture, uv); + float3 norms = DecodeViewNormalStereo(depthNorms); + norms = mul((float3x3)GetWorldToViewMatrix(), norms) * 0.5 + 0.5; + return norms; + } + #elif _HDRP && !_DECALSHADER + + float3 GetSceneNormal(float2 uv, float3 worldSpaceViewDir) + { + NormalData nd; + DecodeFromNormalBuffer(_ScreenSize.xy * uv, nd); + return nd.normalWS; + } + #elif _URP + #if (SHADER_LIBRARY_VERSION_MAJOR >= 10) + #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/DeclareNormalsTexture.hlsl" + #endif + + float3 GetSceneNormal(float2 uv, float3 worldSpaceViewDir) + { + #if (SHADER_LIBRARY_VERSION_MAJOR >= 10) + return SampleSceneNormals(uv); + #else + float3 wpos = GetWorldPositionFromDepthBuffer(uv, worldSpaceViewDir); + return normalize(-cross(ddx(wpos), ddy(wpos))) * 0.5 + 0.5; + #endif + + } + #endif + + #if _HDRP + + half3 UnpackNormalmapRGorAG(half4 packednormal) + { + // This do the trick + packednormal.x *= packednormal.w; + + half3 normal; + normal.xy = packednormal.xy * 2 - 1; + normal.z = sqrt(1 - saturate(dot(normal.xy, normal.xy))); + return normal; + } + half3 UnpackNormal(half4 packednormal) + { + #if defined(UNITY_NO_DXT5nm) + return packednormal.xyz * 2 - 1; + #else + return UnpackNormalmapRGorAG(packednormal); + #endif + } + #endif + #if _HDRP || _URP + + half3 UnpackScaleNormal(half4 packednormal, half scale) + { + #ifndef UNITY_NO_DXT5nm + // Unpack normal as DXT5nm (1, y, 1, x) or BC5 (x, y, 0, 1) + // Note neutral texture like "bump" is (0, 0, 1, 1) to work with both plain RGB normal and DXT5nm/BC5 + packednormal.x *= packednormal.w; + #endif + half3 normal; + normal.xy = (packednormal.xy * 2 - 1) * scale; + normal.z = sqrt(1 - saturate(dot(normal.xy, normal.xy))); + return normal; + } + + #endif + + + void GetSun(out float3 lightDir, out float3 color) + { + lightDir = float3(0.5, 0.5, 0); + color = 1; + #if _HDRP + if (_DirectionalLightCount > 0) + { + DirectionalLightData light = _DirectionalLightDatas[0]; + lightDir = -light.forward.xyz; + color = light.color; + } + #elif _STANDARD + lightDir = normalize(_WorldSpaceLightPos0.xyz); + color = _LightColor0.rgb; + #elif _URP + Light light = GetMainLight(); + lightDir = light.direction; + color = light.color; + #endif + } + + + + + + + + + + TEXTURE2D(_MainTex); + SAMPLER(sampler_MainTex); + + #if GLOW_ON + TEXTURE2D(_GlowTex); + SAMPLER(sampler_GlowTex); + #endif + + #if FADE_ON + TEXTURE2D(_FadeTex); + SAMPLER(sampler_FadeTex); + + TEXTURE2D(_FadeBurnTex); + SAMPLER(sampler_FadeBurnTex); + #endif + + #if DISTORT_ON + TEXTURE2D(_DistortTex); + SAMPLER(sampler_DistortTex); + #endif + + #if OUTTEX_ON + TEXTURE2D(_OutlineTex); + SAMPLER(sampler_OutlineTex); + #endif + + #if OUTDIST_ON + TEXTURE2D(_OutlineDistortTex); + SAMPLER(sampler_OutlineDistortTex); + #endif + + #if COLORSWAP_ON + TEXTURE2D(_ColorSwapTex); + SAMPLER(sampler_ColorSwapTex); + #endif + + #if COLORRAMP_ON + TEXTURE2D(_ColorRampTex); + TEXTURE2D(_ColorRampTexGradient); + SAMPLER(sampler_ColorRampTex); + SAMPLER(sampler_ColorRampTexGradient); + #endif + + #if SHINE_ON + TEXTURE2D(_ShineMask); + SAMPLER(sampler_ShineMask); + #endif + + #if OVERLAY_ON + TEXTURE2D(_OverlayTex); + SAMPLER(sampler_OverlayTex); + #endif + + #if NORMALMAP_ON + TEXTURE2D(_NormalMap); + SAMPLER(sampler_NormalMap); + #endif + + + half3 GetPixel(in int offsetX, in int offsetY, in half2 uv, in Texture2D _tex, in SamplerState _sampler) + { + half2 _uv = uv + half2(offsetX * _MainTex_TexelSize.x, offsetY * _MainTex_TexelSize.y); + half4 col = SAMPLE_TEXTURE2D(_tex, _sampler, _uv); + return col.rgb; + } + + + //BLURS------------------------------------------------------------------------- + half4 Blur(half2 uv, Texture2D source, SamplerState sampler_source, half Intensity) + { + const half2 texelSize = 1.0 / _ScreenParams.xy; + const half4 color = SAMPLE_TEXTURE2D(source, sampler_source, uv); + const half2 offset = Intensity * texelSize; + + half4 accumulatedColor = color; + half accumulatedWeight = 1.0; + for (int x = -1; x <= 1; x++) + { + for (int y = -1; y <= 1; y++) + { + const half2 sampleUV = uv + half2(x, y) * offset; + const half4 sampleColor = SAMPLE_TEXTURE2D(source, sampler_source, sampleUV); + + accumulatedColor += sampleColor; + accumulatedWeight += 1.0; + } + } + + half4 blurredColor = accumulatedColor / accumulatedWeight; + return blurredColor; + } + + half BlurHD_G(half bhqp, half x) + { + return exp(-(x * x) / (2.0 * bhqp * bhqp)); + } + half4 BlurHD(half2 uv, Texture2D source, SamplerState sampler_source, half BlurAmount, half xScale, half yScale) + { + int iterations = 16; + int halfIterations = iterations / 2; + half sigmaX = 0.1 + BlurAmount * 0.5; + half sigmaY = sigmaX; + half total = 0.0; + half4 ret = half4(0, 0, 0, 0); + for (int iy = 0; iy < iterations; ++iy) + { + half fy = BlurHD_G(sigmaY, half(iy) -half(halfIterations)); + half offsetY = half(iy - halfIterations) * 0.00390625 * xScale; + for (int ix = 0; ix < iterations; ++ix) + { + half fx = BlurHD_G(sigmaX, half(ix) - half(halfIterations)); + half offsetX = half(ix - halfIterations) * 0.00390625 * yScale; + total += fx * fy; + ret += SAMPLE_TEXTURE2D(source, sampler_source, uv + half2(offsetX, offsetY)) * fx * fy; + } + } + return ret / total; + } + //----------------------------------------------------------------------- + + + //------------------------------------------- + half RemapFloat(half inValue, half inMin, half inMax, half outMin, half outMax){ + return outMin + (inValue - inMin) * (outMax - outMin) / (inMax - inMin); + } + //------------------------------------------- + + //----------------------------------------------------------------------- + half rand(half2 seed, half offset) { + return (frac(sin(dot(seed, half2(12.9898, 78.233))) * 43758.5453) + offset) % 1.0; + } + + half rand2(half2 seed, half offset) { + return (frac(sin(dot(seed * floor(50 + (_Time.x % 1.0) * 12.), half2(127.1, 311.7))) * 43758.5453123) + offset) % 1.0; + } + + half rand2CustomTime(half2 seed, half offset, half customTime) { + return (frac(sin(dot(seed * floor(50 + (customTime % 1.0) * 12.), half2(127.1, 311.7))) * 43758.5453123) + offset) % 1.0; + } + //----------------------------------------------------------------------- + + + void Ext_ModifyVertex0 (inout VertexData v, inout ExtraV2F d) + { + //BILBOARD_ON + #if BILBOARD_ON + half3 camRight = mul((half3x3)unity_CameraToWorld, half3(1,0,0)); + half3 camUp = half3(0,1,0); + #if BILBOARDY_ON + camUp = mul((half3x3)unity_CameraToWorld, half3(0,1,0)); + #endif + half3 localPos = v.vertex.x * camRight + v.vertex.y * camUp; + v.vertex = half4(localPos, 1); + #endif + //----------------------------------------------------------- + + v.texcoord0.xy = TRANSFORM_TEX(v.texcoord0.xy, _MainTex); + half2 center = half2(0.5, 0.5); + #if ATLAS_ON + center = half2((_MaxXUV + _MinXUV) / 2.0, (_MaxYUV + _MinYUV) / 2.0); + #endif + + //POLARUV_ON + #if POLARUV_ON + v.texcoord0.xy = v.texcoord0.xy - center; + #endif + + //---------------------------------------- + + //ROTATEUV_ON + #if ROTATEUV_ON + half2 uvC = v.texcoord0.xy; + half cosAngle = cos(_RotateUvAmount); + half sinAngle = sin(_RotateUvAmount); + half2x2 rot = half2x2(cosAngle, -sinAngle, sinAngle, cosAngle); + uvC -= center; + v.texcoord0.xy = mul(rot, uvC); + v.texcoord0.xy += center; + #endif + //-------------------- + + #if RECTSIZE_ON + v.vertex.xyz += (v.vertex.xyz * (_RectSize - 1.0)); + #endif + + #if OUTTEX_ON + v.texcoord1.xy = TRANSFORM_TEX(v.texcoord0.xy, _OutlineTex); + #endif + + #if OUTDIST_ON + v.texcoord2.xy = TRANSFORM_TEX(v.texcoord0.xy, _OutlineDistortTex); + #endif + + #if DISTORT_ON + v.texcoord3.xy = TRANSFORM_TEX(v.texcoord0.xy, _DistortTex); + #endif + } + + void Ext_SurfaceFunction0 (inout Surface o, ShaderData d) + { + half randomSeed = _RandomSeed; + + float2 uvRect = d.texcoord0; + half2 center = half2(0.5, 0.5); + #if ATLAS_ON + center = half2((_MaxXUV + _MinXUV) / 2.0, (_MaxYUV + _MinYUV) / 2.0); + uvRect = half2((d.texcoord0.x - _MinXUV) / (_MaxXUV - _MinXUV), (d.texcoord0.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half2 centerTiled = half2(center.x * _MainTex_ST.x, center.y * _MainTex_ST.y); + + //CLIPPING_ON + #if CLIPPING_ON + half2 tiledUv = half2(d.texcoord0.x / _MainTex_ST.x, d.texcoord0.y / _MainTex_ST.y); + #if ATLAS_ON + tiledUv = half2((tiledUv.x - _MinXUV) / (_MaxXUV - _MinXUV), (tiledUv.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + clip((1 - _ClipUvUp) - tiledUv.y); + clip(tiledUv.y - _ClipUvDown); + clip((1 - _ClipUvRight) - tiledUv.x); + clip(tiledUv.x - _ClipUvLeft); + #endif + //---------------------------------- + + //RADIALCLIPPING_ON + #if RADIALCLIPPING_ON + half2 tiledUv2 = half2(d.texcoord0.x / _MainTex_ST.x, d.texcoord0.y / _MainTex_ST.y); + #if ATLAS_ON + tiledUv2 = half2((tiledUv2.x - _MinXUV) / (_MaxXUV - _MinXUV), (tiledUv2.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half startAngle = _RadialStartAngle - _RadialClip; + half endAngle = _RadialStartAngle + _RadialClip2; + half offset0 = clamp(0, 360, startAngle + 360); + half offset360 = clamp(0, 360, endAngle - 360); + half2 atan2Coord = half2(lerp(-1, 1, tiledUv2.x), lerp(-1, 1, tiledUv2.y)); + half atanAngle = atan2(atan2Coord.y, atan2Coord.x) * 57.3; // angle in degrees + if(atanAngle < 0) atanAngle = 360 + atanAngle; + if(atanAngle >= startAngle && atanAngle <= endAngle) discard; + if(atanAngle <= offset360) discard; + if(atanAngle >= offset0) discard; + #endif + + //----------------------------- + + //TEXTURESCROLL_ON && ATLAS_ON + #if TEXTURESCROLL_ON && ATLAS_ON + d.texcoord0.xy = half2(_MinXUV + ((_MaxXUV - _MinXUV) * (abs(((_Time.y + randomSeed) * _TextureScrollXSpeed) + uvRect.x) % 1)), + _MinYUV + ((_MaxYUV - _MinYUV) * (abs(((_Time.y + randomSeed) * _TextureScrollYSpeed) + uvRect.y) % 1))); + #endif + //---------------------------- + + //OFFSETUV_ON + #if OFFSETUV_ON + #if ATLAS_ON + d.texcoord0.xy = half2(_MinXUV + ((_MaxXUV - _MinXUV) * (abs((_OffsetUvX + uvRect.x) % 1))), + _MinYUV + ((_MaxYUV - _MinYUV) * (abs(_OffsetUvY + uvRect.y) % 1))); + #else + d.texcoord0.xy += half2(_OffsetUvX, _OffsetUvY); + #endif + #endif + + //---------------------- + + //POLARUV_ON + #if POLARUV_ON + d.texcoord0.xy = half2(atan2(d.texcoord0.y, d.texcoord0.x) / (2.0f * 3.141592653589f), length(d.texcoord0.xy)); + d.texcoord0.xy *= _MainTex_ST.xy; + #endif + + //-------------------------------------- + + //TWISTUV_ON + #if TWISTUV_ON + #if ATLAS_ON + _TwistUvPosX = ((_MaxXUV - _MinXUV) * _TwistUvPosX) + _MinXUV; + _TwistUvPosY = ((_MaxYUV - _MinYUV) * _TwistUvPosY) + _MinYUV; + #endif + half2 tempUv = d.texcoord0.xy - half2(_TwistUvPosX * _MainTex_ST.x, _TwistUvPosY * _MainTex_ST.y); + _TwistUvRadius *= (_MainTex_ST.x + _MainTex_ST.y) / 2; + half percent = (_TwistUvRadius - length(tempUv)) / _TwistUvRadius; + half theta = percent * percent * (2.0 * sin(_TwistUvAmount)) * 8.0; + half s = sin(theta); + half c = cos(theta); + half beta = max(sign(_TwistUvRadius - length(tempUv)), 0.0); + tempUv = half2(dot(tempUv, half2(c, -s)), dot(tempUv, half2(s, c))) * beta + tempUv * (1 - beta); + tempUv += half2(_TwistUvPosX * _MainTex_ST.x, _TwistUvPosY * _MainTex_ST.y); + d.texcoord0.xy = tempUv; + #endif + + //-------------------------------------------- + + //FISHEYE_ON + #if FISHEYE_ON + half bind = length(centerTiled); + half2 dF = d.texcoord0.xy - centerTiled; + half dFlen = length(dF); + half fishInt = (3.14159265359 / bind) * (_FishEyeUvAmount + 0.001); + d.texcoord0.xy = centerTiled + (dF / (max(0.0001, dFlen))) * tan(dFlen * fishInt) * bind / tan(bind * fishInt); + #endif + //--------------------------------------------- + + //PINCH_ON + #if PINCH_ON + half2 dP = d.texcoord0.xy - centerTiled; + half pinchInt = (3.141592 / length(centerTiled)) * (-_PinchUvAmount + 0.001); + d.texcoord0.xy = centerTiled + normalize(dP) * atan(length(dP) * -pinchInt * 10.0) * 0.5 / atan(-pinchInt * 5); + #endif + + //--------------------------------------------- + + //ZOOMUV_ON + #if ZOOMUV_ON + d.texcoord0.xy -= centerTiled; + d.texcoord0.xy = d.texcoord0.xy * _ZoomUvAmount; + d.texcoord0.xy += centerTiled; + #endif + + //----------------------------------------------- + + //DOODLE_ON + #if DOODLE_ON + half2 uvCopy = uvRect; + _HandDrawnSpeed = (floor((_Time.x + randomSeed) * 20 * _HandDrawnSpeed) / _HandDrawnSpeed) * _HandDrawnSpeed; + uvCopy.x = sin((uvCopy.x * _HandDrawnAmount + _HandDrawnSpeed) * 4); + uvCopy.y = cos((uvCopy.y * _HandDrawnAmount + _HandDrawnSpeed) * 4); + d.texcoord0.xy = lerp(d.texcoord0.xy, d.texcoord0.xy + uvCopy, 0.0005 * _HandDrawnAmount); + #endif + + //-------------------------- + + //SHAKEUV_ON + #if SHAKEUV_ON + half xShake = sin((_Time.x + randomSeed) * _ShakeUvSpeed * 50) * _ShakeUvX; + half yShake = cos((_Time.x + randomSeed) * _ShakeUvSpeed * 50) * _ShakeUvY; + d.texcoord0.xy += half2(xShake * 0.012, yShake * 0.01); + #endif + + //------------------------------------------- + + //RECTSIZE_ON + #if RECTSIZE_ON + d.texcoord0.xy = d.texcoord0.xy * (_RectSize).xx + (((-_RectSize * 0.5) + 0.5)).xx; + #endif + + //------------------------------------------- + + //DISTORT_ON + #if DISTORT_ON + #if ATLAS_ON + d.texcoord3.x = d.texcoord3.x * (1 / (_MaxXUV - _MinXUV)); + d.texcoord3.y = d.texcoord3.y * (1 / (_MaxYUV - _MinYUV)); + #endif + + d.texcoord3.x += ((_Time.x + _RandomSeed) * _DistortTexXSpeed) % 1; + d.texcoord3.y += ((_Time.x + _RandomSeed) * _DistortTexYSpeed) % 1; + half distortAmnt = (SAMPLE_TEXTURE2D(_DistortTex, sampler_DistortTex, d.texcoord3.xy).r - 0.5) * 0.2 * _DistortAmount; + d.texcoord0.x += distortAmnt; + d.texcoord0.y += distortAmnt; + #endif + //------------------------------------------------------- + + //WARP_ON + #if WARP_ON + half2 warpUv = half2(d.texcoord0.x / _MainTex_ST.x, d.texcoord0.y / _MainTex_ST.y); + #if ATLAS_ON + warpUv = half2((warpUv.x - _MinXUV) / (_MaxXUV - _MinXUV), (warpUv.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + const float tau = 6.283185307179586; + float xWarp = (_Time.y + randomSeed) * _WarpSpeed + warpUv.x * tau / _WarpScale; + float yWarp = (_Time.y + randomSeed) * _WarpSpeed + warpUv.y * tau / _WarpScale; + float2 warp = float2(sin(xWarp), sin(yWarp)) * _WarpStrength; + d.texcoord0.xy += warp; + #endif + + //------------------------------------------------------- + + //WAVEUV_ON + #if WAVEUV_ON + float2 uvWave = half2(_WaveX * _MainTex_ST.x, _WaveY * _MainTex_ST.y) - d.texcoord0.xy; + uvWave %= 1; + #if ATLAS_ON + uvWave = half2(_WaveX, _WaveY) - uvRect; + #endif + uvWave.x *= _ScreenParams.x / _ScreenParams.y; + float waveTime = _Time.y + randomSeed; + float angWave = (sqrt(dot(uvWave, uvWave)) * _WaveAmount) - ((waveTime * _WaveSpeed)); + d.texcoord0.xy = d.texcoord0.xy + uvWave * sin(angWave) * (_WaveStrength / 1000.0); + #endif + //---------------------------------------------------- + + //ROUNDWAVEUV_ON + #if ROUNDWAVEUV_ON + half xWave = ((0.5 * _MainTex_ST.x) - uvRect.x); + half yWave = ((0.5 * _MainTex_ST.y) - uvRect.y) * (_MainTex_TexelSize.w / _MainTex_TexelSize.z); + half ripple = -sqrt(xWave*xWave + yWave* yWave); + d.texcoord0.xy += (sin((ripple + (_Time.y + randomSeed) * (_RoundWaveSpeed/10.0)) / 0.015) * (_RoundWaveStrength/10.0)) % 1; + #endif + //---------------------------------------------------- + + + //WIND_ON + #if WIND_ON + half windOffset = sin((_Time.x + randomSeed) * _GrassSpeed * 10); + half2 windCenter = half2(0.5, 0.1); + #if ATLAS_ON + windCenter.x = ((_MaxXUV - _MinXUV) * windCenter.x) + _MinXUV; + windCenter.y = ((_MaxYUV - _MinYUV) * windCenter.y) + _MinYUV; + #endif + #if !MANUALWIND_ON + d.texcoord0.x = fmod(abs(lerp(d.texcoord0.x, d.texcoord0.x + (_GrassWind * 0.01 * windOffset), uvRect.y)), 1); + #else + d.texcoord0.x = fmod(abs(lerp(d.texcoord0.x, d.texcoord0.x + (_GrassWind * 0.01 * _GrassManualAnim), uvRect.y)), 1); + windOffset = _GrassManualAnim; + #endif + half2 delta = d.texcoord0.xy - windCenter; + half delta2 = dot(delta.xy, delta.xy); + half2 delta_offset = delta2 * windOffset; + d.texcoord0.xy = d.texcoord0.xy + half2(delta.y, -delta.x) * delta_offset * _GrassRadialBend; + #endif + + //-------------------------------------------------------- + + //TEXTURESCROLL_ON && !ATLAS_ON + #if TEXTURESCROLL_ON && !ATLAS_ON + d.texcoord0.x += ((_Time.y + randomSeed) * _TextureScrollXSpeed) % 1; + d.texcoord0.y += ((_Time.y + randomSeed) * _TextureScrollYSpeed) % 1; + #endif + //------------------------------ + + //PIXELATE_ON + #if PIXELATE_ON + half aspectRatio = _MainTex_TexelSize.x / _MainTex_TexelSize.y; + half2 pixelSize = float2(_PixelateSize, _PixelateSize * aspectRatio); + d.texcoord0.xy = floor(d.texcoord0.xy * pixelSize) / pixelSize; + #endif + //-------------- + + half4 col = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy); + half originalAlpha = col.a; + col *= d.vertexColor; + + //NORMAL MAP + #if NORMALMAP_ON + half4 normalSample = SAMPLE_TEXTURE2D(_NormalMap, sampler_NormalMap, d.texcoord0.xy); + half3 normalTS = UnpackNormal(normalSample); + normalTS.xy *= _NormalStrength; + o.Normal = normalTS; + #endif + + + //GLITCH_ON + #if GLITCH_ON + half2 uvGlitch = uvRect; + uvGlitch.y -= 0.5; + half lineNoise = pow(rand2(floor(uvGlitch * half2(24., 19.) * _GlitchSize) * 4.0, randomSeed), 3.0) * _GlitchAmount + * pow(rand2(floor(uvGlitch * half2(38., 14.) * _GlitchSize) * 4.0, randomSeed), 3.0); + col = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(lineNoise * 0.02 * rand2(half2(2.0, 1), randomSeed), 0)) * d.vertexColor; + #endif + //-------------------------------------- + + //CHROMABERR_ON + #if CHROMABERR_ON + half4 r = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(_ChromAberrAmount/10, 0)) * d.vertexColor; + half4 b = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(-_ChromAberrAmount/10, 0)) * d.vertexColor; + col = half4(r.r * r.a, col.g, b.b * b.a, max(max(r.a, b.a) * _ChromAberrAlpha, col.a)); + #endif + + //-------------------------------- + + //BLUR_ON + #if BLUR_ON + #if ATLAS_ON + #if !BLURISHD_ON + col = BlurHD(d.texcoord0.xy, _MainTex, sampler_MainTex, _BlurIntensity, (_MaxXUV - _MinXUV), (_MaxYUV - _MinYUV)) * d.vertexColor; + #else + col = Blur(d.texcoord0.xy, _MainTex, sampler_MainTex, _BlurIntensity * (_MaxXUV - _MinXUV)) * d.vertexColor; + #endif + #else + #if !BLURISHD_ON + col = BlurHD(d.texcoord0.xy, _MainTex, sampler_MainTex, _BlurIntensity, 1, 1) * d.vertexColor; + #else + col = Blur(d.texcoord0.xy, _MainTex, sampler_MainTex, _BlurIntensity) * d.vertexColor; + #endif + #endif + #endif + + //-------------------- + + //MOTIONBLUR_ON + #if MOTIONBLUR_ON + _MotionBlurAngle = _MotionBlurAngle * 3.1415926; + #define rot(n) mul(n, half2x2(cos(_MotionBlurAngle), -sin(_MotionBlurAngle), sin(_MotionBlurAngle), cos(_MotionBlurAngle))) + _MotionBlurDist = _MotionBlurDist * 0.005; + #if ATLAS_ON + _MotionBlurDist *= (_MaxXUV - _MinXUV); + #endif + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(-_MotionBlurDist, -_MotionBlurDist))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(-_MotionBlurDist * 2, -_MotionBlurDist * 2))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(-_MotionBlurDist * 3, -_MotionBlurDist * 3))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(-_MotionBlurDist * 4, -_MotionBlurDist * 4))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(_MotionBlurDist, _MotionBlurDist))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(_MotionBlurDist * 2, _MotionBlurDist * 2))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(_MotionBlurDist * 3, _MotionBlurDist * 3))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(_MotionBlurDist * 4, _MotionBlurDist * 4))); + col.rgb = col.rgb / 9; + #endif + //------------------------------------ + + //NEGATIVE_ON + #if NEGATIVE_ON + col.rgb = lerp(col.rgb, 1 - col.rgb, _NegativeAmount); + #endif + + //-------------- + half luminance = 0; + + //GREYSCALE_ON && !GREYSCALEOUTLINE_ON + #if GREYSCALE_ON && !GREYSCALEOUTLINE_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + luminance = saturate(luminance + _GreyscaleLuminosity); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _GreyscaleTintColor, _GreyscaleBlend); + #endif + //------------------------------------ + + //GHOST_ON + #if GHOST_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + half4 ghostResult; + ghostResult.a = saturate(luminance - _GhostTransparency) * col.a; + ghostResult.rgb = col.rgb * (luminance + _GhostColorBoost); + col = lerp(col, ghostResult, _GhostBlend); + #endif + //------------------------------------ + + //INNEROUTLINE_ON + #if INNEROUTLINE_ON + half3 innerT = abs(GetPixel(0, _InnerOutlineThickness, d.texcoord0.xy, _MainTex, sampler_MainTex) - GetPixel(0, -_InnerOutlineThickness, d.texcoord0.xy, _MainTex, sampler_MainTex)); + innerT += abs(GetPixel(_InnerOutlineThickness, 0, d.texcoord0.xy, _MainTex, sampler_MainTex) - GetPixel(-_InnerOutlineThickness, 0, d.texcoord0.xy, _MainTex, sampler_MainTex)); + #if !ONLYINNEROUTLINE_ON + innerT = (innerT / 2.0) * col.a * _InnerOutlineAlpha; + col.rgb += length(innerT) * _InnerOutlineColor.rgb * _InnerOutlineGlow; + #else + innerT *= col.a * _InnerOutlineAlpha; + col.rgb = length(innerT) * _InnerOutlineColor.rgb * _InnerOutlineGlow; + col.a = step(0.3, col.r+col.g+col.b); + #endif + #endif + //------------------------------------------------------- + + //HITEFFECT_ON + #if HITEFFECT_ON + col.rgb = lerp(col.rgb, _HitEffectColor.rgb * _HitEffectGlow, _HitEffectBlend); + #endif + //-------------------- + + //GRADIENT_ON + #if GRADIENT_ON + half2 tiledUvGrad = half2(uvRect.x / _MainTex_ST.x, uvRect.y / _MainTex_ST.y); + #if GRADIENT2COL_ON + _GradTopRightCol = _GradTopLeftCol; + _GradBotRightCol = _GradBotLeftCol; + #endif + #if RADIALGRADIENT_ON + half radialDist = 1 - length(tiledUvGrad - half2(0.5, 0.5)); + radialDist *= (_MainTex_TexelSize.w / _MainTex_TexelSize.z); + radialDist = saturate(_GradBoostX * radialDist); + half4 gradientResult = lerp(_GradTopLeftCol, _GradBotLeftCol, radialDist); + #else + half gradXLerpFactor = saturate(pow(tiledUvGrad.x, _GradBoostX)); + half4 gradientResult = lerp(lerp(_GradBotLeftCol, _GradBotRightCol, gradXLerpFactor), + lerp(_GradTopLeftCol, _GradTopRightCol, gradXLerpFactor), saturate(pow(tiledUvGrad.y, _GradBoostY))); + #endif + gradientResult = lerp(col, gradientResult, _GradBlend); + col.rgb = gradientResult.rgb * col.a; + col.a *= gradientResult.a; + #endif + //-------------------------------------------------------------------- + + //CONTRAST_ON + #if CONTRAST_ON + col.rgb = (col.rgb - float3(0.5, 0.5, 0.5)) * _Contrast + float3(0.5, 0.5, 0.5); + col.rgb += _Brightness; + #endif + + //------------------------------------------------------------------- + + //COLORSWAP_ON + #if COLORSWAP_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + half4 swapMask = SAMPLE_TEXTURE2D(_ColorSwapTex, sampler_ColorSwapTex, d.texcoord0.xy); + swapMask.rgb *= swapMask.a; + half3 redSwap = _ColorSwapRed * swapMask.r * saturate(luminance + _ColorSwapRedLuminosity); + half3 greenSwap = _ColorSwapGreen * swapMask.g * saturate(luminance + _ColorSwapGreenLuminosity); + half3 blueSwap = _ColorSwapBlue * swapMask.b * saturate(luminance + _ColorSwapBlueLuminosity); + swapMask.rgb = col.rgb * saturate(1 - swapMask.r - swapMask.g - swapMask.b); + col.rgb = lerp(col.rgb, swapMask.rgb + redSwap + greenSwap + blueSwap, _ColorSwapBlend); + #endif + //-------------------------------------------------------------------- + + //COLORRAMP_ON && !COLORRAMPOUTLINE_ON + #if COLORRAMP_ON && !COLORRAMPOUTLINE_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + luminance = saturate(luminance + _ColorRampLuminosity); + #if GRADIENTCOLORRAMP_ON + col.rgb = lerp(col.rgb, SAMPLE_TEXTURE2D(_ColorRampTexGradient, sampler_ColorRampTexGradient, half2(luminance, 0)).rgb, _ColorRampBlend); + #else + col.rgb = lerp(col.rgb, SAMPLE_TEXTURE2D(_ColorRampTex, sampler_ColorRampTex, half2(luminance, 0)).rgb, _ColorRampBlend); + #endif + #endif + //-------------------------------------------------------------------- + + //CHANGECOLOR_ON + #if CHANGECOLOR_ON + float3 currChangeColor = saturate(col.rgb); + luminance = 0.3 * currChangeColor.r + 0.59 * currChangeColor.g + 0.11 * currChangeColor.b; + luminance = saturate(luminance + _ColorChangeLuminosity); + half3 dif = abs(currChangeColor - _ColorChangeTarget.rgb); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _ColorChangeNewCol.rgb, + max(sign(1 - saturate(dif.x + dif.y + dif.z) - _ColorChangeTolerance), 0.0)); + #if CHANGECOLOR2_ON + dif = abs(currChangeColor - _ColorChangeTarget2.rgb); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _ColorChangeNewCol2.rgb, + max(sign(1 - saturate(dif.x + dif.y + dif.z) - _ColorChangeTolerance2), 0.0)); + #endif + #if CHANGECOLOR3_ON + dif = abs(currChangeColor - _ColorChangeTarget3.rgb); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _ColorChangeNewCol3.rgb, + max(sign(1 - saturate(dif.x + dif.y + dif.z) - _ColorChangeTolerance3), 0.0)); + #endif + #endif + //------------------------------------------------------- + + //POSTERIZE_ON && !POSTERIZEOUTLINE_ON + #if POSTERIZE_ON && !POSTERIZEOUTLINE_ON + col.rgb = pow(col.rgb, _PosterizeGamma) * _PosterizeNumColors; + col.rgb = floor(col.rgb) / _PosterizeNumColors; + col.rgb = pow(col.rgb, 1.0 / _PosterizeGamma); + #endif + //------------------------------------ + + //HSV_ON + #if HSV_ON + half3 resultHsv = half3(col.rgb); + half cosHsv = _HsvBright * _HsvSaturation * cos(_HsvShift * 3.14159265 / 180); + half sinHsv = _HsvBright * _HsvSaturation * sin(_HsvShift * 3.14159265 / 180); + resultHsv.x = (.299 * _HsvBright + .701 * cosHsv + .168 * sinHsv) * col.x + + (.587 * _HsvBright - .587 * cosHsv + .330 * sinHsv) * col.y + + (.114 * _HsvBright - .114 * cosHsv - .497 * sinHsv) * col.z; + resultHsv.y = (.299 * _HsvBright - .299 * cosHsv - .328 * sinHsv) *col.x + + (.587 * _HsvBright + .413 * cosHsv + .035 * sinHsv) * col.y + + (.114 * _HsvBright - .114 * cosHsv + .292 * sinHsv) * col.z; + resultHsv.z = (.299 * _HsvBright - .3 * cosHsv + 1.25 * sinHsv) * col.x + + (.587 * _HsvBright - .588 * cosHsv - 1.05 * sinHsv) * col.y + + (.114 * _HsvBright + .886 * cosHsv - .203 * sinHsv) * col.z; + col.rgb = resultHsv; + #endif + //------------------------------------------------------- + + //OVERLAY_ON + #if OVERLAY_ON + half2 overlayUvs = d.texcoord0.xy; + overlayUvs.x += ((_Time.y + randomSeed) * _OverlayTextureScrollXSpeed) % 1; + overlayUvs.y += ((_Time.y + randomSeed) * _OverlayTextureScrollYSpeed) % 1; + half4 overlayCol = SAMPLE_TEXTURE2D(_OverlayTex, sampler_OverlayTex, TRANSFORM_TEX(overlayUvs, _OverlayTex)); + overlayCol.rgb *= _OverlayColor.rgb * _OverlayGlow; + #if !OVERLAYMULT_ON + overlayCol.rgb *= overlayCol.a * _OverlayColor.rgb * _OverlayColor.a * _OverlayBlend; + col.rgb += overlayCol.rgb; + #else + overlayCol.a *= _OverlayColor.a; + col = lerp(col, col * overlayCol, _OverlayBlend); + #endif + #endif + + //--------------------------------- + + //OUTBASE_ON + #if OUTBASE_ON + #if OUTBASEPIXELPERF_ON + half2 destUv = half2(_OutlinePixelWidth * _MainTex_TexelSize.x, _OutlinePixelWidth * _MainTex_TexelSize.y); + #else + half2 destUv = half2(_OutlineWidth * _MainTex_TexelSize.x * 200, _OutlineWidth * _MainTex_TexelSize.y * 200); + #endif + + #if OUTDIST_ON + d.texcoord3.x += ((_Time.x + _RandomSeed) * _OutlineDistortTexXSpeed) % 1; + d.texcoord3.y += ((_Time.x + _RandomSeed) * _OutlineDistortTexYSpeed) % 1; + #if ATLAS_ON + d.texcoord3 = half2((d.texcoord3.x - _MinXUV) / (_MaxXUV - _MinXUV), (d.texcoord3.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half outDistortAmnt = (SAMPLE_TEXTURE2D(_OutlineDistortTex, sampler_OutlineDistortTex, d.texcoord3).r - 0.5) * 0.2 * _OutlineDistortAmount; + destUv.x += outDistortAmnt; + destUv.y += outDistortAmnt; + #endif + + half spriteLeft = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(destUv.x, 0)).a; + half spriteRight = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy - half2(destUv.x, 0)).a; + half spriteBottom = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(0, destUv.y)).a; + half spriteTop = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy - half2(0, destUv.y)).a; + half result = spriteLeft + spriteRight + spriteBottom + spriteTop; + + #if OUTBASE8DIR_ON + half spriteTopLeft = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(destUv.x, destUv.y)).a; + half spriteTopRight = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(-destUv.x, destUv.y)).a; + half spriteBotLeft = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(destUv.x, -destUv.y)).a; + half spriteBotRight = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(-destUv.x, -destUv.y)).a; + result = result + spriteTopLeft + spriteTopRight + spriteBotLeft + spriteBotRight; + #endif + + result = step(0.05, saturate(result)); + + #if OUTTEX_ON + d.texcoord1.x += ((_Time.x + _RandomSeed) * _OutlineTexXSpeed) % 1; + d.texcoord1.y += ((_Time.x + _RandomSeed) * _OutlineTexYSpeed) % 1; + #if ATLAS_ON + d.texcoord1 = half2((d.texcoord1.x - _MinXUV) / (_MaxXUV - _MinXUV), (d.texcoord1.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half4 tempOutColor = SAMPLE_TEXTURE2D(_OutlineTex, sampler_OutlineTex, d.texcoord1); + tempOutColor *= _OutlineColor; + _OutlineColor = tempOutColor; + #endif + + result *= (1 - originalAlpha) * _OutlineAlpha; + + half4 outline = _OutlineColor * d.vertexColor.a; + outline.rgb *= _OutlineGlow; + outline.a = result; + #if ONLYOUTLINE_ON + col = outline; + #else + col = lerp(col, outline, result); + #endif + #endif + //------------------------------------------------------- + + //FADE_ON + #if FADE_ON + half2 tiledUvFade1 = TRANSFORM_TEX(d.texcoord0, _FadeTex); + half2 tiledUvFade2 = TRANSFORM_TEX(d.texcoord0, _FadeBurnTex); + #if ATLAS_ON + tiledUvFade1 = half2((tiledUvFade1.x - _MinXUV) / (_MaxXUV - _MinXUV), (tiledUvFade1.y - _MinYUV) / (_MaxYUV - _MinYUV)); + tiledUvFade2 = half2((tiledUvFade2.x - _MinXUV) / (_MaxXUV - _MinXUV), (tiledUvFade2.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half fadeTemp = SAMPLE_TEXTURE2D(_FadeTex, sampler_FadeTex, tiledUvFade1).r; + half fade = smoothstep(_FadeAmount, _FadeAmount + _FadeBurnTransition, fadeTemp); + half fadeBurn = saturate(smoothstep(_FadeAmount - _FadeBurnWidth, _FadeAmount - _FadeBurnWidth + 0.1, fadeTemp) * _FadeAmount); + col.a *= fade; + _FadeBurnColor.rgb *= _FadeBurnGlow; + col += fadeBurn * SAMPLE_TEXTURE2D(_FadeBurnTex, sampler_FadeBurnTex, tiledUvFade2) * _FadeBurnColor * originalAlpha * (1 - col.a); + #endif + //------------------------------------------------------- + + //SHADOW_ON + #if SHADOW_ON + half shadowA = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(_ShadowX, _ShadowY)).a; + half preMultShadowMask = 1 - (saturate(shadowA - col.a) * (1 - col.a)); + col.rgb *= 1 - ((shadowA - col.a) * (1 - col.a)); + col.rgb += (_ShadowColor * shadowA) * (1 - col.a); + col.a = max(shadowA * _ShadowAlpha * d.vertexColor.a, col.a); + #endif + + //------------------------------------------------------- + + //GLOW_ON + #if GLOW_ON + half4 emission; + #if GLOWTEX_ON + emission = SAMPLE_TEXTURE2D(_GlowTex, sampler_GlowTex, d.texcoord0); + #else + emission = col; + #endif + + col.rgb *= _GlowGlobal; + emission.rgb *= emission.a * col.a * _Glow * _GlowColor; + col.rgb += emission.rgb; + #endif + //------------------------------------------------------- + + //COLORRAMP_ON && COLORRAMPOUTLINE_ON + #if COLORRAMP_ON && COLORRAMPOUTLINE_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + luminance = saturate(luminance + _ColorRampLuminosity); + #if GRADIENTCOLORRAMP_ON + col.rgb = lerp(col.rgb, SAMPLE_TEXTURE2D(_ColorRampTexGradient, sampler_ColorRampTexGradient, half2(luminance, 0)).rgb, _ColorRampBlend); + #else + col.rgb = lerp(col.rgb, SAMPLE_TEXTURE2D(_ColorRampTex, sampler_ColorRampTex, half2(luminance, 0)).rgb, _ColorRampBlend); + #endif + #endif + //--------------- + + //GREYSCALE_ON && GREYSCALEOUTLINE_ON + #if GREYSCALE_ON && GREYSCALEOUTLINE_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + luminance = saturate(luminance + _GreyscaleLuminosity); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _GreyscaleTintColor, _GreyscaleBlend); + #endif + + //----------------------------------- + + //POSTERIZE_ON && POSTERIZEOUTLINE_ON + #if POSTERIZE_ON && POSTERIZEOUTLINE_ON + col.rgb = pow(col.rgb, _PosterizeGamma) * _PosterizeNumColors; + col.rgb = floor(col.rgb) / _PosterizeNumColors; + col.rgb = pow(col.rgb, 1.0 / _PosterizeGamma); + #endif + + //----------------------------------- + + //SHINE_ON + #if SHINE_ON + half2 uvShine = uvRect; + half cosAngle = cos(_ShineRotate); + half sinAngle = sin(_ShineRotate); + half2x2 rot = half2x2(cosAngle, -sinAngle, sinAngle, cosAngle); + uvShine -= half2(0.5, 0.5); + uvShine = mul(rot, uvShine); + uvShine += half2(0.5, 0.5); + half shineMask = SAMPLE_TEXTURE2D(_ShineMask, sampler_ShineMask, d.texcoord0.xy).a; + half currentDistanceProjection = (uvShine.x + uvShine.y) / 2; + half whitePower = 1 - (abs(currentDistanceProjection - _ShineLocation) / _ShineWidth); + col.rgb += col.a * whitePower * _ShineGlow * max(sign(currentDistanceProjection - (_ShineLocation - _ShineWidth)), 0.0) + * max(sign((_ShineLocation + _ShineWidth) - currentDistanceProjection), 0.0) * _ShineColor * shineMask; + #endif + + //----------------------------------- + + //HOLOGRAM_ON + #if HOLOGRAM_ON + half totalHologram = _HologramStripesAmount + _HologramUnmodAmount; + half hologramYCoord = ((uvRect.y + (((_Time.x + randomSeed) % 1) * _HologramStripesSpeed)) % totalHologram) / totalHologram; + hologramYCoord = abs(hologramYCoord); + half alpha = RemapFloat(saturate(hologramYCoord - (_HologramUnmodAmount/totalHologram)), 0.0, 1.0, _HologramMinAlpha, saturate(_HologramMaxAlpha)); + half hologramMask = max(sign((_HologramUnmodAmount/totalHologram) - hologramYCoord), 0.0); + half4 hologramResult = col; + hologramResult.a *= lerp(alpha, 1, hologramMask); + hologramResult.rgb *= max(1, _HologramMaxAlpha * max(sign(hologramYCoord - (_HologramUnmodAmount/totalHologram)), 0.0)); + hologramMask = 1 - step(0.01,hologramMask); + hologramResult.rgb += hologramMask * _HologramStripeColor * col.a; + col = lerp(col, hologramResult, _HologramBlend); + #endif + + //----------------------------------- + + //FLICKER_ON + #if FLICKER_ON + col.a *= saturate(col.a * step(frac(0.05 + (_Time.w + randomSeed) * _FlickerFreq), 1 - _FlickerPercent) + _FlickerAlpha); + #endif + //----------------------------------- + + //ALPHACUTOFF_ON + + //ALPHAROUND_ON + + //ALPHAOUTLINE_ON + #if ALPHAOUTLINE_ON + half alphaOutlineRes = pow(1 - col.a, max(_AlphaOutlinePower, 0.0001)) * step(_AlphaOutlineMinAlpha, col.a) * _AlphaOutlineBlend; + col.rgb = lerp(col.rgb, _AlphaOutlineColor.rgb * _AlphaOutlineGlow, alphaOutlineRes); + col.a = lerp(col.a, 1, alphaOutlineRes > 1); + #endif + //------------------------------------------------------- + + //FOG_ON + + //------------------ + + col *= _Color; + o.Albedo = col; + col.a *= _Alpha; + clip(col.a - _AlphaCutoffValue - 0.01); + o.Alpha = _Color.a; + } + + + + + + void ChainSurfaceFunction(inout Surface l, inout ShaderData d) + { + Ext_SurfaceFunction0(l, d); + // Ext_SurfaceFunction1(l, d); + // Ext_SurfaceFunction2(l, d); + // Ext_SurfaceFunction3(l, d); + // Ext_SurfaceFunction4(l, d); + // Ext_SurfaceFunction5(l, d); + // Ext_SurfaceFunction6(l, d); + // Ext_SurfaceFunction7(l, d); + // Ext_SurfaceFunction8(l, d); + // Ext_SurfaceFunction9(l, d); + // Ext_SurfaceFunction10(l, d); + // Ext_SurfaceFunction11(l, d); + // Ext_SurfaceFunction12(l, d); + // Ext_SurfaceFunction13(l, d); + // Ext_SurfaceFunction14(l, d); + // Ext_SurfaceFunction15(l, d); + // Ext_SurfaceFunction16(l, d); + // Ext_SurfaceFunction17(l, d); + // Ext_SurfaceFunction18(l, d); + // Ext_SurfaceFunction19(l, d); + // Ext_SurfaceFunction20(l, d); + // Ext_SurfaceFunction21(l, d); + // Ext_SurfaceFunction22(l, d); + // Ext_SurfaceFunction23(l, d); + // Ext_SurfaceFunction24(l, d); + // Ext_SurfaceFunction25(l, d); + // Ext_SurfaceFunction26(l, d); + // Ext_SurfaceFunction27(l, d); + // Ext_SurfaceFunction28(l, d); + // Ext_SurfaceFunction29(l, d); + } + +#if !_DECALSHADER + + void ChainModifyVertex(inout VertexData v, inout VertexToPixel v2p, float4 time) + { + ExtraV2F d; + + ZERO_INITIALIZE(ExtraV2F, d); + ZERO_INITIALIZE(Blackboard, d.blackboard); + // due to motion vectors in HDRP, we need to use the last + // time in certain spots. So if you are going to use _Time to adjust vertices, + // you need to use this time or motion vectors will break. + d.time = time; + + Ext_ModifyVertex0(v, d); + // Ext_ModifyVertex1(v, d); + // Ext_ModifyVertex2(v, d); + // Ext_ModifyVertex3(v, d); + // Ext_ModifyVertex4(v, d); + // Ext_ModifyVertex5(v, d); + // Ext_ModifyVertex6(v, d); + // Ext_ModifyVertex7(v, d); + // Ext_ModifyVertex8(v, d); + // Ext_ModifyVertex9(v, d); + // Ext_ModifyVertex10(v, d); + // Ext_ModifyVertex11(v, d); + // Ext_ModifyVertex12(v, d); + // Ext_ModifyVertex13(v, d); + // Ext_ModifyVertex14(v, d); + // Ext_ModifyVertex15(v, d); + // Ext_ModifyVertex16(v, d); + // Ext_ModifyVertex17(v, d); + // Ext_ModifyVertex18(v, d); + // Ext_ModifyVertex19(v, d); + // Ext_ModifyVertex20(v, d); + // Ext_ModifyVertex21(v, d); + // Ext_ModifyVertex22(v, d); + // Ext_ModifyVertex23(v, d); + // Ext_ModifyVertex24(v, d); + // Ext_ModifyVertex25(v, d); + // Ext_ModifyVertex26(v, d); + // Ext_ModifyVertex27(v, d); + // Ext_ModifyVertex28(v, d); + // Ext_ModifyVertex29(v, d); + + + // #if %EXTRAV2F0REQUIREKEY% + // v2p.extraV2F0 = d.extraV2F0; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // v2p.extraV2F1 = d.extraV2F1; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // v2p.extraV2F2 = d.extraV2F2; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // v2p.extraV2F3 = d.extraV2F3; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // v2p.extraV2F4 = d.extraV2F4; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // v2p.extraV2F5 = d.extraV2F5; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // v2p.extraV2F6 = d.extraV2F6; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // v2p.extraV2F7 = d.extraV2F7; + // #endif + } + + void ChainModifyTessellatedVertex(inout VertexData v, inout VertexToPixel v2p) + { + ExtraV2F d; + ZERO_INITIALIZE(ExtraV2F, d); + ZERO_INITIALIZE(Blackboard, d.blackboard); + + // #if %EXTRAV2F0REQUIREKEY% + // d.extraV2F0 = v2p.extraV2F0; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // d.extraV2F1 = v2p.extraV2F1; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // d.extraV2F2 = v2p.extraV2F2; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // d.extraV2F3 = v2p.extraV2F3; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // d.extraV2F4 = v2p.extraV2F4; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // d.extraV2F5 = v2p.extraV2F5; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // d.extraV2F6 = v2p.extraV2F6; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // d.extraV2F7 = v2p.extraV2F7; + // #endif + + + // Ext_ModifyTessellatedVertex0(v, d); + // Ext_ModifyTessellatedVertex1(v, d); + // Ext_ModifyTessellatedVertex2(v, d); + // Ext_ModifyTessellatedVertex3(v, d); + // Ext_ModifyTessellatedVertex4(v, d); + // Ext_ModifyTessellatedVertex5(v, d); + // Ext_ModifyTessellatedVertex6(v, d); + // Ext_ModifyTessellatedVertex7(v, d); + // Ext_ModifyTessellatedVertex8(v, d); + // Ext_ModifyTessellatedVertex9(v, d); + // Ext_ModifyTessellatedVertex10(v, d); + // Ext_ModifyTessellatedVertex11(v, d); + // Ext_ModifyTessellatedVertex12(v, d); + // Ext_ModifyTessellatedVertex13(v, d); + // Ext_ModifyTessellatedVertex14(v, d); + // Ext_ModifyTessellatedVertex15(v, d); + // Ext_ModifyTessellatedVertex16(v, d); + // Ext_ModifyTessellatedVertex17(v, d); + // Ext_ModifyTessellatedVertex18(v, d); + // Ext_ModifyTessellatedVertex19(v, d); + // Ext_ModifyTessellatedVertex20(v, d); + // Ext_ModifyTessellatedVertex21(v, d); + // Ext_ModifyTessellatedVertex22(v, d); + // Ext_ModifyTessellatedVertex23(v, d); + // Ext_ModifyTessellatedVertex24(v, d); + // Ext_ModifyTessellatedVertex25(v, d); + // Ext_ModifyTessellatedVertex26(v, d); + // Ext_ModifyTessellatedVertex27(v, d); + // Ext_ModifyTessellatedVertex28(v, d); + // Ext_ModifyTessellatedVertex29(v, d); + + // #if %EXTRAV2F0REQUIREKEY% + // v2p.extraV2F0 = d.extraV2F0; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // v2p.extraV2F1 = d.extraV2F1; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // v2p.extraV2F2 = d.extraV2F2; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // v2p.extraV2F3 = d.extraV2F3; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // v2p.extraV2F4 = d.extraV2F4; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // v2p.extraV2F5 = d.extraV2F5; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // v2p.extraV2F6 = d.extraV2F6; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // v2p.extraV2F7 = d.extraV2F7; + // #endif + } + + void ChainFinalColorForward(inout Surface l, inout ShaderData d, inout half4 color) + { + // Ext_FinalColorForward0(l, d, color); + // Ext_FinalColorForward1(l, d, color); + // Ext_FinalColorForward2(l, d, color); + // Ext_FinalColorForward3(l, d, color); + // Ext_FinalColorForward4(l, d, color); + // Ext_FinalColorForward5(l, d, color); + // Ext_FinalColorForward6(l, d, color); + // Ext_FinalColorForward7(l, d, color); + // Ext_FinalColorForward8(l, d, color); + // Ext_FinalColorForward9(l, d, color); + // Ext_FinalColorForward10(l, d, color); + // Ext_FinalColorForward11(l, d, color); + // Ext_FinalColorForward12(l, d, color); + // Ext_FinalColorForward13(l, d, color); + // Ext_FinalColorForward14(l, d, color); + // Ext_FinalColorForward15(l, d, color); + // Ext_FinalColorForward16(l, d, color); + // Ext_FinalColorForward17(l, d, color); + // Ext_FinalColorForward18(l, d, color); + // Ext_FinalColorForward19(l, d, color); + // Ext_FinalColorForward20(l, d, color); + // Ext_FinalColorForward21(l, d, color); + // Ext_FinalColorForward22(l, d, color); + // Ext_FinalColorForward23(l, d, color); + // Ext_FinalColorForward24(l, d, color); + // Ext_FinalColorForward25(l, d, color); + // Ext_FinalColorForward26(l, d, color); + // Ext_FinalColorForward27(l, d, color); + // Ext_FinalColorForward28(l, d, color); + // Ext_FinalColorForward29(l, d, color); + } + + void ChainFinalGBufferStandard(inout Surface s, inout ShaderData d, inout half4 GBuffer0, inout half4 GBuffer1, inout half4 GBuffer2, inout half4 outEmission, inout half4 outShadowMask) + { + // Ext_FinalGBufferStandard0(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard1(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard2(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard3(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard4(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard5(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard6(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard7(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard8(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard9(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard10(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard11(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard12(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard13(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard14(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard15(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard16(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard17(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard18(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard19(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard20(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard21(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard22(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard23(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard24(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard25(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard26(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard27(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard28(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard29(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + } +#endif + + + + + +#if _DECALSHADER + + ShaderData CreateShaderData(SurfaceDescriptionInputs IN) + { + ShaderData d = (ShaderData)0; + d.TBNMatrix = float3x3(IN.WorldSpaceTangent, IN.WorldSpaceBiTangent, IN.WorldSpaceNormal); + d.worldSpaceNormal = IN.WorldSpaceNormal; + d.worldSpaceTangent = IN.WorldSpaceTangent; + + d.worldSpacePosition = IN.WorldSpacePosition; + d.texcoord0 = IN.uv0.xyxy; + d.screenPos = IN.ScreenPosition; + + d.worldSpaceViewDir = normalize(_WorldSpaceCameraPos - d.worldSpacePosition); + + d.tangentSpaceViewDir = mul(d.TBNMatrix, d.worldSpaceViewDir); + + // these rarely get used, so we back transform them. Usually will be stripped. + #if _HDRP + // d.localSpacePosition = mul(GetWorldToObjectMatrix(), float4(GetCameraRelativePositionWS(d.worldSpacePosition), 1)).xyz; + #else + // d.localSpacePosition = mul(GetWorldToObjectMatrix(), float4(d.worldSpacePosition, 1)).xyz; + #endif + // d.localSpaceNormal = normalize(mul((float3x3)GetWorldToObjectMatrix(), d.worldSpaceNormal)); + // d.localSpaceTangent = normalize(mul((float3x3)GetWorldToObjectMatrix(), d.worldSpaceTangent.xyz)); + + // #if %SCREENPOSREQUIREKEY% + // d.screenUV = (IN.ScreenPosition.xy / max(0.01, IN.ScreenPosition.w)); + // #endif + + return d; + } +#else + + ShaderData CreateShaderData(VertexToPixel i + #if NEED_FACING + , bool facing + #endif + ) + { + ShaderData d = (ShaderData)0; + d.clipPos = i.pos; + d.worldSpacePosition = i.worldPos; + + d.worldSpaceNormal = normalize(i.worldNormal); + d.worldSpaceTangent.xyz = normalize(i.worldTangent.xyz); + + d.tangentSign = i.worldTangent.w * unity_WorldTransformParams.w; + float3 bitangent = cross(d.worldSpaceTangent.xyz, d.worldSpaceNormal) * d.tangentSign; + + d.TBNMatrix = float3x3(d.worldSpaceTangent, -bitangent, d.worldSpaceNormal); + d.worldSpaceViewDir = normalize(_WorldSpaceCameraPos - i.worldPos); + + d.tangentSpaceViewDir = mul(d.TBNMatrix, d.worldSpaceViewDir); + d.texcoord0 = i.texcoord0; + d.texcoord1 = i.texcoord1; + d.texcoord2 = i.texcoord2; + + // #if %TEXCOORD3REQUIREKEY% + d.texcoord3 = i.texcoord3; + // #endif + + // d.isFrontFace = facing; + // #if %VERTEXCOLORREQUIREKEY% + d.vertexColor = i.vertexColor; + // #endif + + // these rarely get used, so we back transform them. Usually will be stripped. + #if _HDRP + // d.localSpacePosition = mul(GetWorldToObjectMatrix(), float4(GetCameraRelativePositionWS(i.worldPos), 1)).xyz; + #else + // d.localSpacePosition = mul(GetWorldToObjectMatrix(), float4(i.worldPos, 1)).xyz; + #endif + // d.localSpaceNormal = normalize(mul((float3x3)GetWorldToObjectMatrix(), i.worldNormal)); + // d.localSpaceTangent = normalize(mul((float3x3)GetWorldToObjectMatrix(), i.worldTangent.xyz)); + + // #if %SCREENPOSREQUIREKEY% + // d.screenPos = i.screenPos; + // d.screenUV = (i.screenPos.xy / i.screenPos.w); + // #endif + + + // #if %EXTRAV2F0REQUIREKEY% + // d.extraV2F0 = i.extraV2F0; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // d.extraV2F1 = i.extraV2F1; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // d.extraV2F2 = i.extraV2F2; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // d.extraV2F3 = i.extraV2F3; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // d.extraV2F4 = i.extraV2F4; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // d.extraV2F5 = i.extraV2F5; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // d.extraV2F6 = i.extraV2F6; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // d.extraV2F7 = i.extraV2F7; + // #endif + + return d; + } + +#endif + + + +#if (SHADERPASS == SHADERPASS_LIGHT_TRANSPORT) + + // This was not in constant buffer in original unity, so keep outiside. But should be in as ShaderRenderPass frequency + float unity_OneOverOutputBoost; + float unity_MaxOutputValue; + + CBUFFER_START(UnityMetaPass) + // x = use uv1 as raster position + // y = use uv2 as raster position + bool4 unity_MetaVertexControl; + + // x = return albedo + // y = return normal + bool4 unity_MetaFragmentControl; + CBUFFER_END + + VertexToPixel Vert(VertexData inputMesh) + { + VertexToPixel output; + ZERO_INITIALIZE(VertexToPixel, output); + UNITY_SETUP_INSTANCE_ID(inputMesh); + UNITY_TRANSFER_INSTANCE_ID(inputMesh, output); + UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(output); + + // Output UV coordinate in vertex shader + float2 uv = float2(0.0, 0.0); + + if (unity_MetaVertexControl.x) + { + uv = inputMesh.texcoord1.xy * unity_LightmapST.xy + unity_LightmapST.zw; + } + else if (unity_MetaVertexControl.y) + { + uv = inputMesh.texcoord2.xy * unity_DynamicLightmapST.xy + unity_DynamicLightmapST.zw; + } + + // OpenGL right now needs to actually use the incoming vertex position + // so we create a fake dependency on it here that haven't any impact. + output.pos = float4(uv * 2.0 - 1.0, inputMesh.vertex.z > 0 ? 1.0e-4 : 0.0, 1.0); + + output.worldPos = TransformObjectToWorld(inputMesh.vertex.xyz).xyz; + + // Normal is required for triplanar mapping + output.worldNormal = TransformObjectToWorldNormal(inputMesh.normal); + // Not required but assign to silent compiler warning + output.worldTangent = float4(1.0, 0.0, 0.0, 0.0); + + output.texcoord0 = inputMesh.texcoord0; + output.texcoord1 = inputMesh.texcoord1; + output.texcoord2 = inputMesh.texcoord2; + // #if %TEXCOORD3REQUIREKEY% + output.texcoord3 = inputMesh.texcoord3; + // #endif + // #if %VERTEXCOLORREQUIREKEY% + output.vertexColor = inputMesh.vertexColor; + // #endif + + return output; + } +#else + + #if (_PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR))) + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/ShaderVariablesMatrixDefsHDCamera.hlsl" + + void MotionVectorPositionZBias(VertexToPixel input) + { + #if UNITY_REVERSED_Z + input.pos.z -= unity_MotionVectorsParams.z * input.pos.w; + #else + input.pos.z += unity_MotionVectorsParams.z * input.pos.w; + #endif + } + + #endif + + VertexToPixel Vert(VertexData input) + { + VertexToPixel output; + ZERO_INITIALIZE(VertexToPixel, output); + + UNITY_SETUP_INSTANCE_ID(input); + UNITY_TRANSFER_INSTANCE_ID(input, output); + UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(output); + + #if _HDRP && (_PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR))) + VertexData previousMesh = input; + #endif + + ChainModifyVertex(input, output, _Time); + + // This return the camera relative position (if enable) + float3 positionRWS = TransformObjectToWorld(input.vertex.xyz); + float3 normalWS = TransformObjectToWorldNormal(input.normal); + float4 tangentWS = float4(TransformObjectToWorldDir(input.tangent.xyz), input.tangent.w); + + + output.worldPos = GetAbsolutePositionWS(positionRWS); + output.pos = TransformWorldToHClip(positionRWS); + output.worldNormal = normalWS; + output.worldTangent = tangentWS; + + + output.texcoord0 = input.texcoord0; + output.texcoord1 = input.texcoord1; + output.texcoord2 = input.texcoord2; + + // #if %TEXCOORD3REQUIREKEY% + output.texcoord3 = input.texcoord3; + // #endif + + // #if %VERTEXCOLORREQUIREKEY% + output.vertexColor = input.vertexColor; + // #endif + + // #if %SCREENPOSREQUIREKEY% + // output.screenPos = ComputeScreenPos(output.pos, _ProjectionParams.x); + // #endif + + #if _HDRP && (_PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR))) + + #if !defined(TESSELLATION_ON) + MotionVectorPositionZBias(output); + #endif + + output.motionVectorCS = mul(UNITY_MATRIX_UNJITTERED_VP, float4(positionRWS.xyz, 1.0)); + // Note: unity_MotionVectorsParams.y is 0 is forceNoMotion is enabled + bool forceNoMotion = unity_MotionVectorsParams.y == 0.0; + if (forceNoMotion) + { + output.previousPositionCS = float4(0.0, 0.0, 0.0, 1.0); + } + else + { + bool hasDeformation = unity_MotionVectorsParams.x > 0.0; // Skin or morph target + + float3 effectivePositionOS = (hasDeformation ? previousMesh.previousPositionOS : previousMesh.vertex.xyz); + #if defined(_ADD_PRECOMPUTED_VELOCITY) + effectivePositionOS -= input.precomputedVelocity; + #endif + + previousMesh.vertex = float4(effectivePositionOS, 1); + VertexToPixel dummy = (VertexToPixel)0; + + + ChainModifyVertex(previousMesh, dummy, _LastTimeParameters); + + // we might need this for skinned objects? + //float3 normalWS = TransformPreviousObjectToWorldNormal(input.normal).xyz; + float3 previousPositionRWS = TransformPreviousObjectToWorld(previousMesh.vertex.xyz); + + #ifdef _WRITE_TRANSPARENT_MOTION_VECTOR + if (_TransparentCameraOnlyMotionVectors > 0) + { + previousPositionRWS = positionRWS.xyz; + } + #endif // _WRITE_TRANSPARENT_MOTION_VECTOR + + output.previousPositionCS = mul(UNITY_MATRIX_PREV_VP, float4(previousPositionRWS, 1.0)); + } + #endif // _HDRP && _PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR)) + + + return output; + } + + +#endif + + + + + + + + #if defined(WRITE_DECAL_BUFFER) && !defined(_DISABLE_DECALS) + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/Decal/DecalPrepassBuffer.hlsl" + #endif + + FragInputs BuildFragInputs(VertexToPixel input) + { + UNITY_SETUP_INSTANCE_ID(input); + FragInputs output; + ZERO_INITIALIZE(FragInputs, output); + + // Init to some default value to make the computer quiet (else it output 'divide by zero' warning even if value is not used). + // TODO: this is a really poor workaround, but the variable is used in a bunch of places + // to compute normals which are then passed on elsewhere to compute other values... + output.tangentToWorld = k_identity3x3; + output.positionSS = input.pos; // input.positionCS is SV_Position + // BETTER SHADERS: because we transform world position into actual world space for things like + // triplanar, etc, we have to back transform it here for lighting + output.positionRWS = GetCameraRelativePositionWS(input.worldPos); + output.tangentToWorld = BuildTangentToWorld(input.worldTangent, input.worldNormal); + output.texCoord0 = input.texcoord0; + output.texCoord1 = input.texcoord1; + output.texCoord2 = input.texcoord2; + + return output; + } + +#if UNITY_VERSION > UNITY_2022_3_12 + void ApplyDecalAndGetNormal(FragInputs fragInputs, PositionInputs posInput, Surface surfaceDescription, float3 normalTS, + inout SurfaceData surfaceData) + { + float3 doubleSidedConstants = GetDoubleSidedConstants(); + + #ifdef DECAL_NORMAL_BLENDING + // SG nodes don't ouptut surface gradients, so if decals require surf grad blending, we have to convert + // the normal to gradient before applying the decal. We then have to resolve the gradient back to world space + normalTS = SurfaceGradientFromTangentSpaceNormalAndFromTBN(normalTS, + fragInputs.tangentToWorld[0], fragInputs.tangentToWorld[1]); + + + #if HAVE_DECALS + if (_EnableDecals) + { + float alpha = 1.0; + alpha = surfaceDescription.Alpha; + + DecalSurfaceData decalSurfaceData = GetDecalSurfaceData(posInput, fragInputs, alpha); + ApplyDecalToSurfaceNormal(decalSurfaceData, fragInputs.tangentToWorld[2], normalTS); + ApplyDecalToSurfaceDataNoNormal(decalSurfaceData, surfaceData); + } + #endif + + GetNormalWS_SG(fragInputs, normalTS, surfaceData.normalWS, doubleSidedConstants); + #else + // normal delivered to master node + + #if HAVE_DECALS + if (_EnableDecals) + { + float alpha = 1.0; + alpha = surfaceDescription.Alpha; + + // Both uses and modifies 'surfaceData.normalWS'. + DecalSurfaceData decalSurfaceData = GetDecalSurfaceData(posInput, fragInputs, alpha); + ApplyDecalToSurfaceNormal(decalSurfaceData, surfaceData.normalWS.xyz); + ApplyDecalToSurfaceDataNoNormal(decalSurfaceData, surfaceData); + } + #endif + #endif + } +#endif + + void BuildSurfaceData(FragInputs fragInputs, inout Surface surfaceDescription, float3 V, PositionInputs posInput, out SurfaceData surfaceData, out float3 bentNormalWS) + { + // setup defaults -- these are used if the graph doesn't output a value + ZERO_INITIALIZE(SurfaceData, surfaceData); + + // specularOcclusion need to be init ahead of decal to quiet the compiler that modify the SurfaceData struct + // however specularOcclusion can come from the graph, so need to be init here so it can be override. + surfaceData.specularOcclusion = 1.0; + + // copy across graph values, if defined + surfaceData.baseColor = surfaceDescription.Albedo; + surfaceData.perceptualSmoothness = surfaceDescription.Smoothness; + surfaceData.ambientOcclusion = surfaceDescription.Occlusion; + surfaceData.specularOcclusion = surfaceDescription.SpecularOcclusion; + surfaceData.metallic = surfaceDescription.Metallic; + surfaceData.subsurfaceMask = surfaceDescription.SubsurfaceMask; + surfaceData.thickness = surfaceDescription.Thickness; + surfaceData.diffusionProfileHash = asuint(surfaceDescription.DiffusionProfileHash); + #if _USESPECULAR + surfaceData.specularColor = surfaceDescription.Specular; + #endif + surfaceData.coatMask = surfaceDescription.CoatMask; + surfaceData.anisotropy = surfaceDescription.Anisotropy; + surfaceData.iridescenceMask = surfaceDescription.IridescenceMask; + surfaceData.iridescenceThickness = surfaceDescription.IridescenceThickness; + + + + #if defined(_REFRACTION_PLANE) || defined(_REFRACTION_SPHERE) || defined(_REFRACTION_THIN) + if (_EnableSSRefraction) + { + surfaceData.transmittanceMask = (1.0 - surfaceDescription.Alpha); + surfaceDescription.Alpha = 1.0; + } + else + { + surfaceData.ior = surfaceDescription.ior; + surfaceData.transmittanceColor = surfaceDescription.transmittanceColor; + surfaceData.atDistance = surfaceDescription.atDistance; + surfaceData.transmittanceMask = surfaceDescription.transmittanceMask; + surfaceDescription.Alpha = 1.0; + } + #else + surfaceData.ior = 1.0; + surfaceData.transmittanceColor = float3(1.0, 1.0, 1.0); + surfaceData.atDistance = 1.0; + surfaceData.transmittanceMask = 0.0; + #endif + + + + // These static material feature allow compile time optimization + surfaceData.materialFeatures = MATERIALFEATUREFLAGS_LIT_STANDARD; + #ifdef _MATERIAL_FEATURE_SUBSURFACE_SCATTERING + surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_SUBSURFACE_SCATTERING; + #endif + + #ifdef _MATERIAL_FEATURE_TRANSMISSION + surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_TRANSMISSION; + #endif + + #ifdef _MATERIAL_FEATURE_ANISOTROPY + surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_ANISOTROPY; + surfaceData.normalWS = float3(0, 1, 0); + #endif + + #ifdef _MATERIAL_FEATURE_IRIDESCENCE + surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_IRIDESCENCE; + #endif + + #ifdef _MATERIAL_FEATURE_SPECULAR_COLOR + surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_SPECULAR_COLOR; + #endif + + #if defined(_MATERIAL_FEATURE_CLEAR_COAT) || _CLEARCOAT + surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_CLEAR_COAT; + #endif + + #if defined (_MATERIAL_FEATURE_SPECULAR_COLOR) && defined (_ENERGY_CONSERVING_SPECULAR) + // Require to have setup baseColor + // Reproduce the energy conservation done in legacy Unity. Not ideal but better for compatibility and users can unchek it + surfaceData.baseColor *= (1.0 - Max3(surfaceData.specularColor.r, surfaceData.specularColor.g, surfaceData.specularColor.b)); + #endif + + float3 normalTS = surfaceDescription.Normal; + #if !_WORLDSPACENORMAL + surfaceData.normalWS = mul(surfaceDescription.Normal, fragInputs.tangentToWorld); + #else + normalTS = mul(fragInputs.tangentToWorld, surfaceDescription.Normal); + surfaceData.normalWS = surfaceDescription.Normal; + #endif + + + #if UNITY_VERSION > UNITY_2022_3_12 + ApplyDecalAndGetNormal(fragInputs, posInput, surfaceDescription, normalTS, surfaceData); + #else + #ifdef DECAL_NORMAL_BLENDING + #if HAVE_DECALS + float alpha = 1.0; + alpha = surfaceDescription.Alpha; + if (_EnableDecals) + { + DecalSurfaceData decalSurfaceData = GetDecalSurfaceData(posInput, fragInputs, alpha); + ApplyDecalToSurfaceData(decalSurfaceData, fragInputs.tangentToWorld[2], surfaceData, normalTS); + } + #endif + #else + #if HAVE_DECALS + if (_EnableDecals) + { + float alpha = 1.0; + alpha = surfaceDescription.Alpha; + // Both uses and modifies 'surfaceData.normalWS'. + DecalSurfaceData decalSurfaceData = GetDecalSurfaceData(posInput, fragInputs, alpha); + ApplyDecalToSurfaceData(decalSurfaceData, fragInputs.tangentToWorld[2], surfaceData); + } + #endif + #endif + #endif + + + + surfaceData.geomNormalWS = fragInputs.tangentToWorld[2]; + + surfaceData.tangentWS = normalize(fragInputs.tangentToWorld[0].xyz); // The tangent is not normalize in tangentToWorld for mikkt. TODO: Check if it expected that we normalize with Morten. Tag: SURFACE_GRADIENT + + + bentNormalWS = surfaceData.normalWS; + + surfaceData.tangentWS = Orthonormalize(surfaceData.tangentWS, surfaceData.normalWS); + + #ifdef DEBUG_DISPLAY + if (_DebugMipMapMode != DEBUGMIPMAPMODE_NONE) + { + // TODO: need to update mip info + surfaceData.metallic = 0; + } + + // We need to call ApplyDebugToSurfaceData after filling the surfarcedata and before filling builtinData + // as it can modify attribute use for static lighting + ApplyDebugToSurfaceData(fragInputs.tangentToWorld, surfaceData); + #endif + + // By default we use the ambient occlusion with Tri-ace trick (apply outside) for specular occlusion. + // If user provide bent normal then we process a better term + #if defined(_SPECULAR_OCCLUSION_CUSTOM) + // Just use the value passed through via the slot (not active otherwise) + #elif defined(_SPECULAR_OCCLUSION_FROM_AO_BENT_NORMAL) + // If we have bent normal and ambient occlusion, process a specular occlusion + surfaceData.specularOcclusion = GetSpecularOcclusionFromBentAO(V, bentNormalWS, surfaceData.normalWS, surfaceData.ambientOcclusion, PerceptualSmoothnessToPerceptualRoughness(surfaceData.perceptualSmoothness)); + #elif defined(_AMBIENT_OCCLUSION) && defined(_SPECULAR_OCCLUSION_FROM_AO) + surfaceData.specularOcclusion = GetSpecularOcclusionFromAmbientOcclusion(ClampNdotV(dot(surfaceData.normalWS, V)), surfaceData.ambientOcclusion, PerceptualSmoothnessToRoughness(surfaceData.perceptualSmoothness)); + #endif + + #if defined(_ENABLE_GEOMETRIC_SPECULAR_AA) && !defined(SHADER_STAGE_RAY_TRACING) + surfaceData.perceptualSmoothness = GeometricNormalFiltering(surfaceData.perceptualSmoothness, fragInputs.tangentToWorld[2], surfaceDescription.SpecularAAScreenSpaceVariance, surfaceDescription.SpecularAAThreshold); + #endif + } + + void GetSurfaceAndBuiltinData(VertexToPixel m2ps, FragInputs fragInputs, float3 V, inout PositionInputs posInput, + out SurfaceData surfaceData, out BuiltinData builtinData, inout Surface l, inout ShaderData d + #if NEED_FACING + , bool facing + #endif + ) + { + // Removed since crossfade does not work, probably needs extra material setup. + //#if !defined(SHADER_STAGE_RAY_TRACING) && !defined(_TESSELLATION_DISPLACEMENT) + // #ifdef LOD_FADE_CROSSFADE // enable dithering LOD transition if user select CrossFade transition in LOD group + // LODDitheringTransition(ComputeFadeMaskSeed(V, posInput.positionSS), unity_LODFade.x); + // #endif + //#endif + + + + + d = CreateShaderData(m2ps + #if NEED_FACING + , facing + #endif + ); + + l = (Surface)0; + + l.Albedo = half3(0.5, 0.5, 0.5); + l.Normal = float3(0,0,1); + l.Occlusion = 1; + l.Alpha = 1; + l.SpecularOcclusion = 1; + + #if !defined(SHADER_STAGE_RAY_TRACING) && defined(_DEPTHOFFSET_ON) + l.outputDepth = d.clipPos.z; + #endif + + ChainSurfaceFunction(l, d); + + #if !defined(SHADER_STAGE_RAY_TRACING) && defined(_DEPTHOFFSET_ON) + posInput.deviceDepth = l.outputDepth; + #endif + + #if _UNLIT + //l.Emission = l.Albedo; + //l.Albedo = 0; + l.Normal = half3(0,0,1); + l.Occlusion = 1; + l.Metallic = 0; + l.Specular = 0; + #endif + + surfaceData.geomNormalWS = d.worldSpaceNormal; + surfaceData.tangentWS = d.worldSpaceTangent; + fragInputs.tangentToWorld = d.TBNMatrix; + + float3 bentNormalWS; + + BuildSurfaceData(fragInputs, l, V, posInput, surfaceData, bentNormalWS); + + + float4 lightmapTexCoord1 = fragInputs.texCoord1; + float4 lightmapTexCoord2 = fragInputs.texCoord2; + //#ifdef FRAG_INPUTS_USE_TEXCOORD1 + // float4 lightmapTexCoord1 = fragInputs.texCoord1; + // #else + // float4 lightmapTexCoord1 = float4(0,0,0,0); + // #endif + + // #ifdef FRAG_INPUTS_USE_TEXCOORD2 + // float4 lightmapTexCoord2 = fragInputs.texCoord2; + // #else + // float4 lightmapTexCoord2 = float4(0,0,0,0); + // #endif + + + InitBuiltinData(posInput, l.Alpha, bentNormalWS, -d.worldSpaceNormal, lightmapTexCoord1, lightmapTexCoord2, builtinData); + + + + builtinData.emissiveColor = l.Emission; + + #if defined(_OVERRIDE_BAKEDGI) + builtinData.bakeDiffuseLighting = l.DiffuseGI; + builtinData.backBakeDiffuseLighting = l.BackDiffuseGI; + builtinData.emissiveColor += l.SpecularGI; + #endif + + #if defined(_OVERRIDE_SHADOWMASK) + builtinData.shadowMask0 = l.ShadowMask.x; + builtinData.shadowMask1 = l.ShadowMask.y; + builtinData.shadowMask2 = l.ShadowMask.z; + builtinData.shadowMask3 = l.ShadowMask.w; + #endif + + #ifdef UNITY_VIRTUAL_TEXTURING + //builtinData.vtPackedFeedback = surfaceData.VTPackedFeedback; + #endif + + #if (SHADERPASS == SHADERPASS_DISTORTION) + builtinData.distortion = surfaceData.Distortion; + builtinData.distortionBlur = surfaceData.DistortionBlur; + #endif + + #ifndef SHADER_UNLIT + // PostInitBuiltinData call ApplyDebugToBuiltinData + PostInitBuiltinData(V, posInput, surfaceData, builtinData); + #else + ApplyDebugToBuiltinData(builtinData); + #endif + + RAY_TRACING_OPTIONAL_ALPHA_TEST_PASS + } + + + void Frag( VertexToPixel v2f + #if defined(SCENESELECTIONPASS) || defined(SCENEPICKINGPASS) + , out float4 outColor : SV_Target0 + #else + #ifdef WRITE_MSAA_DEPTH + // We need the depth color as SV_Target0 for alpha to coverage + , out float4 depthColor : SV_Target0 + #ifdef WRITE_NORMAL_BUFFER + , out float4 outNormalBuffer : SV_Target1 + #endif + #else + #ifdef WRITE_NORMAL_BUFFER + , out float4 outNormalBuffer : SV_Target0 + #endif + #endif + + // Decal buffer must be last as it is bind but we can optionally write into it (based on _DISABLE_DECALS) + #if defined(WRITE_DECAL_BUFFER) && !defined(_DISABLE_DECALS) + , out float4 outDecalBuffer : SV_TARGET_DECAL + #endif + #endif + #if NEED_FACING + , bool facing : SV_IsFrontFace + #endif + + ) + { + UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX(v2f); + FragInputs input = BuildFragInputs(v2f); + + // input.positionSS is SV_Position + PositionInputs posInput = GetPositionInput(input.positionSS.xy, _ScreenSize.zw, input.positionSS.z, input.positionSS.w, input.positionRWS); + + float3 V = GetWorldSpaceNormalizeViewDir(input.positionRWS); + + + SurfaceData surfaceData; + BuiltinData builtinData; + Surface l; + ShaderData d; + GetSurfaceAndBuiltinData(v2f, input, V, posInput, surfaceData, builtinData, l, d + #if NEED_FACING + , facing + #endif + ); + + + + #ifdef SCENESELECTIONPASS + // We use depth prepass for scene selection in the editor, this code allow to output the outline correctly + outColor = float4(_ObjectId, _PassValue, 1.0, 1.0); + #elif defined(SCENEPICKINGPASS) + outColor = _SelectionID; + #else + #ifdef WRITE_MSAA_DEPTH + // In case we are rendering in MSAA, reading the an MSAA depth buffer is way too expensive. To avoid that, we export the depth to a color buffer + depthColor = v2p.pos.z; + + #ifdef _ALPHATOMASK_ON + // Alpha channel is used for alpha to coverage + depthColor.a = SharpenAlpha(builtinData.opacity, builtinData.alphaClipTreshold); + #endif // alphatomask + #endif // msaa_depth + + + #if defined(WRITE_NORMAL_BUFFER) + EncodeIntoNormalBuffer(ConvertSurfaceDataToNormalData(surfaceData), outNormalBuffer); + #endif + + #if (defined(WRITE_DECAL_BUFFER) && !defined(_DISABLE_DECALS)) || defined(WRITE_RENDERING_LAYER) + DecalPrepassData decalPrepassData; + #ifdef _DISABLE_DECALS + ZERO_INITIALIZE(DecalPrepassData, decalPrepassData); + #else + // We don't have the right to access SurfaceData in a shaderpass. + // However it would be painful to have to add a function like ConvertSurfaceDataToDecalPrepassData() to every Material to return geomNormalWS anyway + // Here we will put the constrain that any Material requiring to support Decal, will need to have geomNormalWS as member of surfaceData (and we already require normalWS anyway) + decalPrepassData.geomNormalWS = surfaceData.geomNormalWS; + #endif + decalPrepassData.renderingLayerMask = GetMeshRenderingLayerMask(); + EncodeIntoDecalPrepassBuffer(decalPrepassData, outDecalBuffer); + #endif + #endif + + + } + + ENDHLSL + } + + Pass + { + Name "MotionVectors" + Tags + { + "LightMode" = "MotionVectors" + } + + // Render State + Cull Back + ZWrite On + Stencil + { + WriteMask [_StencilWriteMaskMV] + Ref [_StencilRefMV] + CompFront Always + PassFront Replace + CompBack Always + PassBack Replace + } + + Tags { "RenderType" = "Opaque" "Queue" = "Geometry" "PreviewType" = "Plane" } + Cull [_CullingOption] + ZWrite [_ZWrite] + ZTest [_ZTestMode] + + + //------------------------------------------------------------------------------------- + // End Render Modes + //------------------------------------------------------------------------------------- + + HLSLPROGRAM + + #pragma target 4.5 + #pragma only_renderers d3d11 playstation xboxone xboxseries vulkan metal switch + #pragma multi_compile_instancing + #pragma multi_compile _ DOTS_INSTANCING_ON + #pragma instancing_options renderinglayer + #pragma multi_compile _ LOD_FADE_CROSSFADE + + #pragma multi_compile _ WRITE_MSAA_DEPTH + //#pragma shader_feature _ _SURFACE_TYPE_TRANSPARENT + //#pragma shader_feature_local _BLENDMODE_OFF _BLENDMODE_ALPHA _BLENDMODE_ADD _BLENDMODE_PRE_MULTIPLY + //#pragma shader_feature_local _ _ADD_PRECOMPUTED_VELOCITY + //#pragma shader_feature_local _ _TRANSPARENT_WRITES_MOTION_VEC + //#pragma shader_feature_local _ _ENABLE_FOG_ON_TRANSPARENT + #pragma multi_compile _ WRITE_NORMAL_BUFFER + //#pragma shader_feature_local _ _DISABLE_DECALS + //#pragma shader_feature_local _ _DISABLE_SSR + //#pragma shader_feature_local _ _DISABLE_SSR_TRANSPARENT + #pragma multi_compile _ WRITE_DECAL_BUFFER + //#pragma shader_feature_local _REFRACTION_OFF _REFRACTION_PLANE _REFRACTION_SPHERE _REFRACTION_THIN + + + + #define SHADERPASS SHADERPASS_MOTION_VECTORS + #define RAYTRACING_SHADER_GRAPH_DEFAULT + #define VARYINGS_NEED_PASS + #define _PASSMOTIONVECTOR 1 + + + + #pragma shader_feature_local GLOW_ON + #pragma shader_feature_local FADE_ON + #pragma shader_feature_local OUTBASE_ON + #pragma shader_feature_local ONLYOUTLINE_ON + #pragma shader_feature_local GRADIENT_ON + #pragma shader_feature_local GRADIENT2COL_ON + #pragma shader_feature_local RADIALGRADIENT_ON + #pragma shader_feature_local COLORSWAP_ON + #pragma shader_feature_local HSV_ON + #pragma shader_feature_local CHANGECOLOR_ON + #pragma shader_feature_local CHANGECOLOR2_ON + #pragma shader_feature_local CHANGECOLOR3_ON + #pragma shader_feature_local COLORRAMP_ON + #pragma shader_feature_local GRADIENTCOLORRAMP_ON + #pragma shader_feature_local HITEFFECT_ON + #pragma shader_feature_local NEGATIVE_ON + #pragma shader_feature_local PIXELATE_ON + #pragma shader_feature_local GREYSCALE_ON + #pragma shader_feature_local POSTERIZE_ON + #pragma shader_feature_local BLUR_ON + #pragma shader_feature_local MOTIONBLUR_ON + #pragma shader_feature_local GHOST_ON + #pragma shader_feature_local ALPHAOUTLINE_ON + #pragma shader_feature_local INNEROUTLINE_ON + #pragma shader_feature_local ONLYINNEROUTLINE_ON + #pragma shader_feature_local HOLOGRAM_ON + #pragma shader_feature_local CHROMABERR_ON + #pragma shader_feature_local GLITCH_ON + #pragma shader_feature_local FLICKER_ON + #pragma shader_feature_local SHADOW_ON + #pragma shader_feature_local SHINE_ON + #pragma shader_feature_local CONTRAST_ON + #pragma shader_feature_local OVERLAY_ON + #pragma shader_feature_local OVERLAYMULT_ON + #pragma shader_feature_local DOODLE_ON + #pragma shader_feature_local WIND_ON + #pragma shader_feature_local WAVEUV_ON + #pragma shader_feature_local ROUNDWAVEUV_ON + #pragma shader_feature_local RECTSIZE_ON + #pragma shader_feature_local OFFSETUV_ON + #pragma shader_feature_local CLIPPING_ON + #pragma shader_feature_local RADIALCLIPPING_ON + #pragma shader_feature_local TEXTURESCROLL_ON + #pragma shader_feature_local ZOOMUV_ON + #pragma shader_feature_local DISTORT_ON + #pragma shader_feature_local WARP_ON + #pragma shader_feature_local TWISTUV_ON + #pragma shader_feature_local ROTATEUV_ON + #pragma shader_feature_local POLARUV_ON + #pragma shader_feature_local FISHEYE_ON + #pragma shader_feature_local PINCH_ON + #pragma shader_feature_local SHAKEUV_ON + + #pragma shader_feature_local GLOWTEX_ON + #pragma shader_feature_local OUTTEX_ON + #pragma shader_feature_local OUTDIST_ON + #pragma shader_feature_local OUTBASE8DIR_ON + #pragma shader_feature_local OUTBASEPIXELPERF_ON + #pragma shader_feature_local COLORRAMPOUTLINE_ON + #pragma shader_feature_local GREYSCALEOUTLINE_ON + #pragma shader_feature_local POSTERIZEOUTLINE_ON + #pragma shader_feature_local BLURISHD_ON + #pragma shader_feature_local MANUALWIND_ON + #pragma shader_feature_local ATLAS_ON + #pragma shader_feature_local PREMULTIPLYALPHA_ON + + #pragma shader_feature BILBOARD_ON + #pragma shader_feature BILBOARDY_ON + + #pragma shader_feature NORMALMAP_ON + + + #define _HDRP 1 +#define _USINGTEXCOORD1 1 +#define _USINGTEXCOORD2 1 + + + #pragma vertex Vert + #pragma fragment Frag + + // useful conversion functions to make surface shader code just work + + #define UNITY_DECLARE_TEX2D(name) TEXTURE2D(name); SAMPLER(sampler##name); + #define UNITY_DECLARE_TEX2D_NOSAMPLER(name) TEXTURE2D(name); + #define UNITY_DECLARE_TEX2DARRAY(name) TEXTURE2D_ARRAY(name); SAMPLER(sampler##name); + #define UNITY_DECLARE_TEX2DARRAY_NOSAMPLER(tex) TEXTURE2D_ARRAY(tex); + + #define UNITY_SAMPLE_TEX2DARRAY(tex,coord) SAMPLE_TEXTURE2D_ARRAY(tex, sampler##tex, coord.xy, coord.z) + #define UNITY_SAMPLE_TEX2DARRAY_LOD(tex,coord,lod) SAMPLE_TEXTURE2D_ARRAY_LOD(tex, sampler##tex, coord.xy, coord.z, lod) + #define UNITY_SAMPLE_TEX2D(tex, coord) SAMPLE_TEXTURE2D(tex, sampler##tex, coord) + #define UNITY_SAMPLE_TEX2D_SAMPLER(tex, samp, coord) SAMPLE_TEXTURE2D(tex, sampler##samp, coord) + + #define UNITY_SAMPLE_TEX2D_LOD(tex,coord, lod) SAMPLE_TEXTURE2D_LOD(tex, sampler_##tex, coord, lod) + #define UNITY_SAMPLE_TEX2D_SAMPLER_LOD(tex,samplertex,coord, lod) SAMPLE_TEXTURE2D_LOD (tex, sampler##samplertex,coord, lod) + + #if defined(UNITY_COMPILER_HLSL) + #define UNITY_INITIALIZE_OUTPUT(type,name) name = (type)0; + #else + #define UNITY_INITIALIZE_OUTPUT(type,name) + #endif + + #define sampler2D_float sampler2D + #define sampler2D_half sampler2D + + #undef WorldNormalVector + #define WorldNormalVector(data, normal) mul(normal, data.TBNMatrix) + + #define UnityObjectToWorldNormal(normal) mul(GetObjectToWorldMatrix(), normal) + + #ifndef SHADER_STAGE_FRAGMENT + #if !defined(SHADOW_ULTRA_LOW) && !defined(SHADOW_LOW) && !defined(SHADOW_MEDIUM) && !defined(SHADOW_HIGH) // ultra low come from volumetricLighting.compute + #define SHADOW_MEDIUM + #endif + #if !defined(AREA_SHADOW_LOW) && !defined(AREA_SHADOW_MEDIUM) && !defined(AREA_SHADOW_HIGH) // low come from volumetricLighting.compute + #define AREA_SHADOW_MEDIUM + #endif + #endif + + + +// HDRP Adapter stuff + #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Common.hlsl" + #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Common.hlsl" + #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/GeometricTools.hlsl" // Required by Tessellation.hlsl + #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Tessellation.hlsl" + #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Texture.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/ShaderVariables.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/ShaderPass/ShaderPass.cs.hlsl" + #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/TextureStack.hlsl" // Required to be include before we include properties as it define DECLARE_STACK_CB + #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/DebugMipmapStreamingMacros.hlsl" // Required before including properties as it defines UNITY_TEXTURE_STREAMING_DEBUG_VARS + // Always include Shader Graph version + // Always include last to avoid double macros + #include "Packages/com.unity.shadergraph/ShaderGraphLibrary/Functions.hlsl" // Need to be here for Gradient struct definition + + +#include "Packages/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/ShaderPass/FragInputs.hlsl" + + + + #ifdef RAYTRACING_SHADER_GRAPH_DEFAULT + #define RAYTRACING_SHADER_GRAPH_HIGH + #endif + + #ifdef RAYTRACING_SHADER_GRAPH_RAYTRACED + #define RAYTRACING_SHADER_GRAPH_LOW + #endif + // end + + + + + // If we use subsurface scattering, enable output split lighting (for forward pass) + #if defined(_MATERIAL_FEATURE_SUBSURFACE_SCATTERING) && !defined(_SURFACE_TYPE_TRANSPARENT) + #define OUTPUT_SPLIT_LIGHTING + #endif + + #define HAVE_RECURSIVE_RENDERING + + #if SHADERPASS == SHADERPASS_TRANSPARENT_DEPTH_PREPASS + #if !defined(_DISABLE_SSR_TRANSPARENT) && !defined(SHADER_UNLIT) + #define WRITE_NORMAL_BUFFER + #endif + #endif + + #ifndef DEBUG_DISPLAY + // In case of opaque we don't want to perform the alpha test, it is done in depth prepass and we use depth equal for ztest (setup from UI) + // Don't do it with debug display mode as it is possible there is no depth prepass in this case + #if !defined(_SURFACE_TYPE_TRANSPARENT) && defined(_ALPHATEST) + #if SHADERPASS == SHADERPASS_FORWARD + #define SHADERPASS_FORWARD_BYPASS_ALPHA_TEST + #elif SHADERPASS == SHADERPASS_GBUFFER + #define SHADERPASS_GBUFFER_BYPASS_ALPHA_TEST + #endif + #endif + #endif + + // Define _DEFERRED_CAPABLE_MATERIAL for shader capable to run in deferred pass + #if defined(SHADER_LIT) && !defined(_SURFACE_TYPE_TRANSPARENT) + #define _DEFERRED_CAPABLE_MATERIAL + #endif + + // Translate transparent motion vector define + #if defined(_TRANSPARENT_WRITES_MOTION_VEC) && defined(_SURFACE_TYPE_TRANSPARENT) + #define _WRITE_TRANSPARENT_MOTION_VECTOR + #endif + + + + + CBUFFER_START(UnityPerMaterial) + float _UseShadowThreshold; + float _BlendMode; + float _EnableBlendModePreserveSpecularLighting; + float _RayTracing; + float _RefractionModel; + + + half4 _Color; + half4 _MainTex_ST, _MainTex_TexelSize; + half _Alpha, _AlphaCutoffValue; + + #if ATLAS_ON + half _MinXUV, _MaxXUV, _MinYUV, _MaxYUV; + #endif + + #if GLOW_ON + half4 _GlowColor; + half _Glow, _GlowGlobal; + #endif + + #if HSV_ON + half _HsvShift, _HsvSaturation, _HsvBright; + #endif + + #if DISTORT_ON + half4 _DistortTex_ST; + half _DistortTexXSpeed, _DistortTexYSpeed, _DistortAmount; + #endif + + #if FADE_ON + half4 _FadeBurnColor, _FadeTex_ST, _FadeBurnTex_ST; + half _FadeAmount, _FadeBurnWidth, _FadeBurnTransition,_FadeBurnGlow; + #endif + + #if OUTBASE_ON + half4 _OutlineColor; + half _OutlineAlpha, _OutlineGlow, _OutlineWidth; + int _OutlinePixelWidth; + #endif + + #if OUTTEX_ON + half4 _OutlineTex_ST; + half _OutlineTexXSpeed, _OutlineTexYSpeed; + #endif + + #if OUTDIST_ON + half4 _OutlineDistortTex_ST; + half _OutlineDistortTexXSpeed, _OutlineDistortTexYSpeed, _OutlineDistortAmount; + #endif + + #if ALPHAOUTLINE_ON + half _AlphaOutlineGlow, _AlphaOutlinePower, _AlphaOutlineMinAlpha, _AlphaOutlineBlend; + half4 _AlphaOutlineColor; + #endif + + #if INNEROUTLINE_ON + half _InnerOutlineThickness, _InnerOutlineAlpha, _InnerOutlineGlow; + half4 _InnerOutlineColor; + #endif + + #if GRADIENT_ON + half _GradBlend, _GradBoostX, _GradBoostY; + half4 _GradTopRightCol, _GradTopLeftCol, _GradBotRightCol, _GradBotLeftCol; + #endif + + #if COLORSWAP_ON + half4 _ColorSwapRed, _ColorSwapGreen, _ColorSwapBlue; + half _ColorSwapRedLuminosity, _ColorSwapGreenLuminosity, _ColorSwapBlueLuminosity, _ColorSwapBlend; + #endif + + #if CHANGECOLOR_ON + half4 _ColorChangeNewCol, _ColorChangeTarget; + half _ColorChangeTolerance, _ColorChangeLuminosity; + #endif + #if CHANGECOLOR2_ON + half4 _ColorChangeNewCol2, _ColorChangeTarget2; + half _ColorChangeTolerance2; + #endif + #if CHANGECOLOR3_ON + half4 _ColorChangeNewCol3, _ColorChangeTarget3; + half _ColorChangeTolerance3; + #endif + + #if COLORRAMP_ON + half _ColorRampLuminosity, _ColorRampBlend; + #endif + + #if HITEFFECT_ON + half4 _HitEffectColor; + half _HitEffectGlow, _HitEffectBlend; + #endif + + #if NEGATIVE_ON + half _NegativeAmount; + #endif + + #if PIXELATE_ON + half _PixelateSize; + #endif + + #if GREYSCALE_ON + half _GreyscaleLuminosity, _GreyscaleBlend; + half4 _GreyscaleTintColor; + #endif + + #if POSTERIZE_ON + half _PosterizeNumColors, _PosterizeGamma; + #endif + + #if BLUR_ON + half _BlurIntensity; + #endif + + #if MOTIONBLUR_ON + half _MotionBlurAngle, _MotionBlurDist; + #endif + + #if GHOST_ON + half _GhostColorBoost, _GhostTransparency, _GhostBlend; + #endif + + #if HOLOGRAM_ON + half _HologramStripesAmount, _HologramMinAlpha, _HologramUnmodAmount, _HologramStripesSpeed, _HologramMaxAlpha, _HologramBlend; + half4 _HologramStripeColor; + #endif + + #if CHROMABERR_ON + half _ChromAberrAmount, _ChromAberrAlpha; + #endif + + #if GLITCH_ON + half _GlitchAmount, _GlitchSize; + #endif + + #if FLICKER_ON + half _FlickerFreq, _FlickerPercent, _FlickerAlpha; + #endif + + #if SHADOW_ON + half _ShadowX, _ShadowY, _ShadowAlpha; + half4 _ShadowColor; + #endif + + #if SHINE_ON + half4 _ShineColor; + half _ShineLocation, _ShineRotate, _ShineWidth, _ShineGlow; + #endif + + #if CONTRAST_ON + half _Contrast, _Brightness; + #endif + + #if OVERLAY_ON + half4 _OverlayTex_ST, _OverlayColor; + half _OverlayGlow, _OverlayBlend, _OverlayTextureScrollXSpeed, _OverlayTextureScrollYSpeed; + #endif + + #if DOODLE_ON + half _HandDrawnAmount, _HandDrawnSpeed; + #endif + + #if WIND_ON + half _GrassSpeed, _GrassWind, _GrassManualAnim, _GrassRadialBend; + #endif + + #if WAVEUV_ON + float _WaveAmount, _WaveSpeed, _WaveStrength, _WaveX, _WaveY; + #endif + + #if ROUNDWAVEUV_ON + half _RoundWaveStrength, _RoundWaveSpeed; + #endif + + #if RECTSIZE_ON + half _RectSize; + #endif + + #if OFFSETUV_ON + half _OffsetUvX, _OffsetUvY; + #endif + + #if CLIPPING_ON + half _ClipUvLeft, _ClipUvRight, _ClipUvUp, _ClipUvDown; + #endif + + #if RADIALCLIPPING_ON + half _RadialStartAngle, _RadialClip, _RadialClip2; + #endif + + #if TEXTURESCROLL_ON + half _TextureScrollXSpeed, _TextureScrollYSpeed; + #endif + + #if ZOOMUV_ON + half _ZoomUvAmount; + #endif + + #if WARP_ON + half _WarpStrength, _WarpSpeed, _WarpScale; + #endif + + #if TWISTUV_ON + half _TwistUvAmount, _TwistUvPosX, _TwistUvPosY, _TwistUvRadius; + #endif + + #if ROTATEUV_ON + half _RotateUvAmount; + #endif + + #if FISHEYE_ON + half _FishEyeUvAmount; + #endif + + #if PINCH_ON + half _PinchUvAmount; + #endif + + #if SHAKEUV_ON + half _ShakeUvSpeed, _ShakeUvX, _ShakeUvY; + #endif + + #if NORMALMAP_ON + half _NormalStrength; + #endif + + float _RandomSeed; + + + + + CBUFFER_END + + + + // -- Property used by ScenePickingPass + #ifdef SCENEPICKINGPASS + float4 _SelectionID; + #endif + + // -- Properties used by SceneSelectionPass + #ifdef SCENESELECTIONPASS + int _ObjectId; + int _PassValue; + #endif + + + // data across stages, stripped like the above. + struct VertexToPixel + { + float4 pos : SV_POSITION; + float3 worldPos : TEXCOORD0; + float3 worldNormal : TEXCOORD1; + float4 worldTangent : TEXCOORD2; + float4 texcoord0 : TEXCOORD3; + float4 texcoord1 : TEXCOORD4; + float4 texcoord2 : TEXCOORD5; + // #if %TEXCOORD3REQUIREKEY% + float4 texcoord3 : TEXCOORD6; + // #endif + + // #if %SCREENPOSREQUIREKEY% + // float4 screenPos : TEXCOORD7; + // #endif + + // #if %VERTEXCOLORREQUIREKEY% + float4 vertexColor : COLOR; + // #endif + + // #if %EXTRAV2F0REQUIREKEY% + // float4 extraV2F0 : TEXCOORD8; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // float4 extraV2F1 : TEXCOORD9; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // float4 extraV2F2 : TEXCOORD10; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // float4 extraV2F3 : TEXCOORD11; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // float4 extraV2F4 : TEXCOORD12; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // float4 extraV2F5 : TEXCOORD13; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // float4 extraV2F6 : TEXCOORD14; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // float4 extraV2F7 : TEXCOORD15; + // #endif + + #if UNITY_ANY_INSTANCING_ENABLED + UNITY_VERTEX_INPUT_INSTANCE_ID + #endif // UNITY_ANY_INSTANCING_ENABLED + + #if _HDRP && (_PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR))) + float4 previousPositionCS : TEXCOORD16; // Contain previous transform position (in case of skinning for example) + float4 motionVectorCS : TEXCOORD17; + #endif + + UNITY_VERTEX_OUTPUT_STEREO + }; + + + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Debug/DebugDisplay.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/Material.hlsl" + #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/NormalSurfaceGradient.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/Lit/Lit.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/BuiltinUtilities.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/MaterialUtilities.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/Decal/DecalUtilities.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/Lit/LitDecalData.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/ShaderGraphFunctions.hlsl" + + + + // data describing the user output of a pixel + struct Surface + { + half3 Albedo; + half Height; + half3 Normal; + half Smoothness; + half3 Emission; + half Metallic; + half3 Specular; + half Occlusion; + half SpecularPower; // for simple lighting + half Alpha; + float outputDepth; // if written, SV_Depth semantic is used. ShaderData.clipPos.z is unused value + // HDRP Only + half SpecularOcclusion; + half SubsurfaceMask; + half Thickness; + half CoatMask; + half CoatSmoothness; + half Anisotropy; + half IridescenceMask; + half IridescenceThickness; + int DiffusionProfileHash; + float SpecularAAThreshold; + float SpecularAAScreenSpaceVariance; + // requires _OVERRIDE_BAKEDGI to be defined, but is mapped in all pipelines + float3 DiffuseGI; + float3 BackDiffuseGI; + float3 SpecularGI; + float ior; + float3 transmittanceColor; + float atDistance; + float transmittanceMask; + // requires _OVERRIDE_SHADOWMASK to be defines + float4 ShadowMask; + + // for decals + float NormalAlpha; + float MAOSAlpha; + + + }; + + // Data the user declares in blackboard blocks + struct Blackboard + { + + float blackboardDummyData; + }; + + // data the user might need, this will grow to be big. But easy to strip + struct ShaderData + { + float4 clipPos; // SV_POSITION + float3 localSpacePosition; + float3 localSpaceNormal; + float3 localSpaceTangent; + + float3 worldSpacePosition; + float3 worldSpaceNormal; + float3 worldSpaceTangent; + float tangentSign; + + float3 worldSpaceViewDir; + float3 tangentSpaceViewDir; + + float4 texcoord0; + float4 texcoord1; + float4 texcoord2; + float4 texcoord3; + + float2 screenUV; + float4 screenPos; + + float4 vertexColor; + bool isFrontFace; + + float4 extraV2F0; + float4 extraV2F1; + float4 extraV2F2; + float4 extraV2F3; + float4 extraV2F4; + float4 extraV2F5; + float4 extraV2F6; + float4 extraV2F7; + + float3x3 TBNMatrix; + Blackboard blackboard; + }; + + struct VertexData + { + #if SHADER_TARGET > 30 + // uint vertexID : SV_VertexID; + #endif + float4 vertex : POSITION; + float3 normal : NORMAL; + float4 tangent : TANGENT; + float4 texcoord0 : TEXCOORD0; + + // optimize out mesh coords when not in use by user or lighting system + #if _URP && (_USINGTEXCOORD1 || _PASSMETA || _PASSFORWARD || _PASSGBUFFER) + float4 texcoord1 : TEXCOORD1; + #endif + + #if _URP && (_USINGTEXCOORD2 || _PASSMETA || ((_PASSFORWARD || _PASSGBUFFER) && defined(DYNAMICLIGHTMAP_ON))) + float4 texcoord2 : TEXCOORD2; + #endif + + #if _STANDARD && (_USINGTEXCOORD1 || (_PASSMETA || ((_PASSFORWARD || _PASSGBUFFER || _PASSFORWARDADD) && LIGHTMAP_ON))) + float4 texcoord1 : TEXCOORD1; + #endif + #if _STANDARD && (_USINGTEXCOORD2 || (_PASSMETA || ((_PASSFORWARD || _PASSGBUFFER) && DYNAMICLIGHTMAP_ON))) + float4 texcoord2 : TEXCOORD2; + #endif + + + #if _HDRP + float4 texcoord1 : TEXCOORD1; + float4 texcoord2 : TEXCOORD2; + #endif + + // #if %TEXCOORD3REQUIREKEY% + float4 texcoord3 : TEXCOORD3; + // #endif + + // #if %VERTEXCOLORREQUIREKEY% + float4 vertexColor : COLOR; + // #endif + + #if _PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR)) + float3 previousPositionOS : TEXCOORD4; // Contain previous transform position (in case of skinning for example) + #if defined (_ADD_PRECOMPUTED_VELOCITY) + float3 precomputedVelocity : TEXCOORD5; // Add Precomputed Velocity (Alembic computes velocities on runtime side). + #endif + #endif + + UNITY_VERTEX_INPUT_INSTANCE_ID + }; + + struct TessVertex + { + float4 vertex : INTERNALTESSPOS; + float3 normal : NORMAL; + float4 tangent : TANGENT; + float4 texcoord0 : TEXCOORD0; + float4 texcoord1 : TEXCOORD1; + float4 texcoord2 : TEXCOORD2; + + // #if %TEXCOORD3REQUIREKEY% + float4 texcoord3 : TEXCOORD3; + // #endif + + // #if %VERTEXCOLORREQUIREKEY% + float4 vertexColor : COLOR; + // #endif + + // #if %EXTRAV2F0REQUIREKEY% + // float4 extraV2F0 : TEXCOORD5; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // float4 extraV2F1 : TEXCOORD6; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // float4 extraV2F2 : TEXCOORD7; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // float4 extraV2F3 : TEXCOORD8; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // float4 extraV2F4 : TEXCOORD9; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // float4 extraV2F5 : TEXCOORD10; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // float4 extraV2F6 : TEXCOORD11; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // float4 extraV2F7 : TEXCOORD12; + // #endif + + #if _PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR)) + float3 previousPositionOS : TEXCOORD13; // Contain previous transform position (in case of skinning for example) + #if defined (_ADD_PRECOMPUTED_VELOCITY) + float3 precomputedVelocity : TEXCOORD14; + #endif + #endif + + UNITY_VERTEX_INPUT_INSTANCE_ID + UNITY_VERTEX_OUTPUT_STEREO + }; + + struct ExtraV2F + { + float4 extraV2F0; + float4 extraV2F1; + float4 extraV2F2; + float4 extraV2F3; + float4 extraV2F4; + float4 extraV2F5; + float4 extraV2F6; + float4 extraV2F7; + Blackboard blackboard; + float4 time; + }; + + + float3 WorldToTangentSpace(ShaderData d, float3 normal) + { + return mul(d.TBNMatrix, normal); + } + + float3 TangentToWorldSpace(ShaderData d, float3 normal) + { + return mul(normal, d.TBNMatrix); + } + + // in this case, make standard more like SRPs, because we can't fix + // unity_WorldToObject in HDRP, since it already does macro-fu there + + #if _STANDARD + float3 TransformWorldToObject(float3 p) { return mul(unity_WorldToObject, float4(p, 1)); }; + float3 TransformObjectToWorld(float3 p) { return mul(unity_ObjectToWorld, float4(p, 1)); }; + float4 TransformWorldToObject(float4 p) { return mul(unity_WorldToObject, p); }; + float4 TransformObjectToWorld(float4 p) { return mul(unity_ObjectToWorld, p); }; + float4x4 GetWorldToObjectMatrix() { return unity_WorldToObject; } + float4x4 GetObjectToWorldMatrix() { return unity_ObjectToWorld; } + #if (defined(SHADER_API_D3D11) || defined(SHADER_API_XBOXONE) || defined(UNITY_COMPILER_HLSLCC) || defined(SHADER_API_PSSL) || (SHADER_TARGET_SURFACE_ANALYSIS && !SHADER_TARGET_SURFACE_ANALYSIS_MOJOSHADER)) + #define UNITY_SAMPLE_TEX2D_LOD(tex,coord, lod) tex.SampleLevel (sampler##tex,coord, lod) + #define UNITY_SAMPLE_TEX2D_SAMPLER_LOD(tex,samplertex,coord, lod) tex.SampleLevel (sampler##samplertex,coord, lod) + #else + #define UNITY_SAMPLE_TEX2D_LOD(tex,coord,lod) tex2D (tex,coord,0,lod) + #define UNITY_SAMPLE_TEX2D_SAMPLER_LOD(tex,samplertex,coord,lod) tex2D (tex,coord,0,lod) + #endif + + #undef GetWorldToObjectMatrix() + + #define GetWorldToObjectMatrix() unity_WorldToObject + + + #endif + + float3 GetCameraWorldPosition() + { + #if _HDRP + return GetCameraRelativePositionWS(_WorldSpaceCameraPos); + #else + return _WorldSpaceCameraPos; + #endif + } + + #if _GRABPASSUSED + #if _STANDARD + TEXTURE2D(%GRABTEXTURE%); + SAMPLER(sampler_%GRABTEXTURE%); + #endif + + half3 GetSceneColor(float2 uv) + { + #if _STANDARD + return SAMPLE_TEXTURE2D(%GRABTEXTURE%, sampler_%GRABTEXTURE%, uv).rgb; + #else + return SHADERGRAPH_SAMPLE_SCENE_COLOR(uv); + #endif + } + #endif + + + + #if _STANDARD + UNITY_DECLARE_DEPTH_TEXTURE(_CameraDepthTexture); + float GetSceneDepth(float2 uv) { return SAMPLE_DEPTH_TEXTURE(_CameraDepthTexture, uv); } + float GetLinear01Depth(float2 uv) { return Linear01Depth(GetSceneDepth(uv)); } + float GetLinearEyeDepth(float2 uv) { return LinearEyeDepth(GetSceneDepth(uv)); } + #else + float GetSceneDepth(float2 uv) { return SHADERGRAPH_SAMPLE_SCENE_DEPTH(uv); } + float GetLinear01Depth(float2 uv) { return Linear01Depth(GetSceneDepth(uv), _ZBufferParams); } + float GetLinearEyeDepth(float2 uv) { return LinearEyeDepth(GetSceneDepth(uv), _ZBufferParams); } + #endif + + float3 GetWorldPositionFromDepthBuffer(float2 uv, float3 worldSpaceViewDir) + { + float eye = GetLinearEyeDepth(uv); + float3 camView = mul((float3x3)GetObjectToWorldMatrix(), transpose(mul(GetWorldToObjectMatrix(), UNITY_MATRIX_I_V)) [2].xyz); + + float dt = dot(worldSpaceViewDir, camView); + float3 div = worldSpaceViewDir/dt; + float3 wpos = (eye * div) + GetCameraWorldPosition(); + return wpos; + } + + #if _HDRP + float3 ObjectToWorldSpacePosition(float3 pos) + { + return GetAbsolutePositionWS(TransformObjectToWorld(pos)); + } + #else + float3 ObjectToWorldSpacePosition(float3 pos) + { + return TransformObjectToWorld(pos); + } + #endif + + #if _STANDARD + UNITY_DECLARE_SCREENSPACE_TEXTURE(_CameraDepthNormalsTexture); + float3 GetSceneNormal(float2 uv, float3 worldSpaceViewDir) + { + float4 depthNorms = UNITY_SAMPLE_SCREENSPACE_TEXTURE(_CameraDepthNormalsTexture, uv); + float3 norms = DecodeViewNormalStereo(depthNorms); + norms = mul((float3x3)GetWorldToViewMatrix(), norms) * 0.5 + 0.5; + return norms; + } + #elif _HDRP && !_DECALSHADER + + float3 GetSceneNormal(float2 uv, float3 worldSpaceViewDir) + { + NormalData nd; + DecodeFromNormalBuffer(_ScreenSize.xy * uv, nd); + return nd.normalWS; + } + #elif _URP + #if (SHADER_LIBRARY_VERSION_MAJOR >= 10) + #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/DeclareNormalsTexture.hlsl" + #endif + + float3 GetSceneNormal(float2 uv, float3 worldSpaceViewDir) + { + #if (SHADER_LIBRARY_VERSION_MAJOR >= 10) + return SampleSceneNormals(uv); + #else + float3 wpos = GetWorldPositionFromDepthBuffer(uv, worldSpaceViewDir); + return normalize(-cross(ddx(wpos), ddy(wpos))) * 0.5 + 0.5; + #endif + + } + #endif + + #if _HDRP + + half3 UnpackNormalmapRGorAG(half4 packednormal) + { + // This do the trick + packednormal.x *= packednormal.w; + + half3 normal; + normal.xy = packednormal.xy * 2 - 1; + normal.z = sqrt(1 - saturate(dot(normal.xy, normal.xy))); + return normal; + } + half3 UnpackNormal(half4 packednormal) + { + #if defined(UNITY_NO_DXT5nm) + return packednormal.xyz * 2 - 1; + #else + return UnpackNormalmapRGorAG(packednormal); + #endif + } + #endif + #if _HDRP || _URP + + half3 UnpackScaleNormal(half4 packednormal, half scale) + { + #ifndef UNITY_NO_DXT5nm + // Unpack normal as DXT5nm (1, y, 1, x) or BC5 (x, y, 0, 1) + // Note neutral texture like "bump" is (0, 0, 1, 1) to work with both plain RGB normal and DXT5nm/BC5 + packednormal.x *= packednormal.w; + #endif + half3 normal; + normal.xy = (packednormal.xy * 2 - 1) * scale; + normal.z = sqrt(1 - saturate(dot(normal.xy, normal.xy))); + return normal; + } + + #endif + + + void GetSun(out float3 lightDir, out float3 color) + { + lightDir = float3(0.5, 0.5, 0); + color = 1; + #if _HDRP + if (_DirectionalLightCount > 0) + { + DirectionalLightData light = _DirectionalLightDatas[0]; + lightDir = -light.forward.xyz; + color = light.color; + } + #elif _STANDARD + lightDir = normalize(_WorldSpaceLightPos0.xyz); + color = _LightColor0.rgb; + #elif _URP + Light light = GetMainLight(); + lightDir = light.direction; + color = light.color; + #endif + } + + + + + + + + + + TEXTURE2D(_MainTex); + SAMPLER(sampler_MainTex); + + #if GLOW_ON + TEXTURE2D(_GlowTex); + SAMPLER(sampler_GlowTex); + #endif + + #if FADE_ON + TEXTURE2D(_FadeTex); + SAMPLER(sampler_FadeTex); + + TEXTURE2D(_FadeBurnTex); + SAMPLER(sampler_FadeBurnTex); + #endif + + #if DISTORT_ON + TEXTURE2D(_DistortTex); + SAMPLER(sampler_DistortTex); + #endif + + #if OUTTEX_ON + TEXTURE2D(_OutlineTex); + SAMPLER(sampler_OutlineTex); + #endif + + #if OUTDIST_ON + TEXTURE2D(_OutlineDistortTex); + SAMPLER(sampler_OutlineDistortTex); + #endif + + #if COLORSWAP_ON + TEXTURE2D(_ColorSwapTex); + SAMPLER(sampler_ColorSwapTex); + #endif + + #if COLORRAMP_ON + TEXTURE2D(_ColorRampTex); + TEXTURE2D(_ColorRampTexGradient); + SAMPLER(sampler_ColorRampTex); + SAMPLER(sampler_ColorRampTexGradient); + #endif + + #if SHINE_ON + TEXTURE2D(_ShineMask); + SAMPLER(sampler_ShineMask); + #endif + + #if OVERLAY_ON + TEXTURE2D(_OverlayTex); + SAMPLER(sampler_OverlayTex); + #endif + + #if NORMALMAP_ON + TEXTURE2D(_NormalMap); + SAMPLER(sampler_NormalMap); + #endif + + + half3 GetPixel(in int offsetX, in int offsetY, in half2 uv, in Texture2D _tex, in SamplerState _sampler) + { + half2 _uv = uv + half2(offsetX * _MainTex_TexelSize.x, offsetY * _MainTex_TexelSize.y); + half4 col = SAMPLE_TEXTURE2D(_tex, _sampler, _uv); + return col.rgb; + } + + + //BLURS------------------------------------------------------------------------- + half4 Blur(half2 uv, Texture2D source, SamplerState sampler_source, half Intensity) + { + const half2 texelSize = 1.0 / _ScreenParams.xy; + const half4 color = SAMPLE_TEXTURE2D(source, sampler_source, uv); + const half2 offset = Intensity * texelSize; + + half4 accumulatedColor = color; + half accumulatedWeight = 1.0; + for (int x = -1; x <= 1; x++) + { + for (int y = -1; y <= 1; y++) + { + const half2 sampleUV = uv + half2(x, y) * offset; + const half4 sampleColor = SAMPLE_TEXTURE2D(source, sampler_source, sampleUV); + + accumulatedColor += sampleColor; + accumulatedWeight += 1.0; + } + } + + half4 blurredColor = accumulatedColor / accumulatedWeight; + return blurredColor; + } + + half BlurHD_G(half bhqp, half x) + { + return exp(-(x * x) / (2.0 * bhqp * bhqp)); + } + half4 BlurHD(half2 uv, Texture2D source, SamplerState sampler_source, half BlurAmount, half xScale, half yScale) + { + int iterations = 16; + int halfIterations = iterations / 2; + half sigmaX = 0.1 + BlurAmount * 0.5; + half sigmaY = sigmaX; + half total = 0.0; + half4 ret = half4(0, 0, 0, 0); + for (int iy = 0; iy < iterations; ++iy) + { + half fy = BlurHD_G(sigmaY, half(iy) -half(halfIterations)); + half offsetY = half(iy - halfIterations) * 0.00390625 * xScale; + for (int ix = 0; ix < iterations; ++ix) + { + half fx = BlurHD_G(sigmaX, half(ix) - half(halfIterations)); + half offsetX = half(ix - halfIterations) * 0.00390625 * yScale; + total += fx * fy; + ret += SAMPLE_TEXTURE2D(source, sampler_source, uv + half2(offsetX, offsetY)) * fx * fy; + } + } + return ret / total; + } + //----------------------------------------------------------------------- + + + //------------------------------------------- + half RemapFloat(half inValue, half inMin, half inMax, half outMin, half outMax){ + return outMin + (inValue - inMin) * (outMax - outMin) / (inMax - inMin); + } + //------------------------------------------- + + //----------------------------------------------------------------------- + half rand(half2 seed, half offset) { + return (frac(sin(dot(seed, half2(12.9898, 78.233))) * 43758.5453) + offset) % 1.0; + } + + half rand2(half2 seed, half offset) { + return (frac(sin(dot(seed * floor(50 + (_Time.x % 1.0) * 12.), half2(127.1, 311.7))) * 43758.5453123) + offset) % 1.0; + } + + half rand2CustomTime(half2 seed, half offset, half customTime) { + return (frac(sin(dot(seed * floor(50 + (customTime % 1.0) * 12.), half2(127.1, 311.7))) * 43758.5453123) + offset) % 1.0; + } + //----------------------------------------------------------------------- + + + void Ext_ModifyVertex0 (inout VertexData v, inout ExtraV2F d) + { + //BILBOARD_ON + #if BILBOARD_ON + half3 camRight = mul((half3x3)unity_CameraToWorld, half3(1,0,0)); + half3 camUp = half3(0,1,0); + #if BILBOARDY_ON + camUp = mul((half3x3)unity_CameraToWorld, half3(0,1,0)); + #endif + half3 localPos = v.vertex.x * camRight + v.vertex.y * camUp; + v.vertex = half4(localPos, 1); + #endif + //----------------------------------------------------------- + + v.texcoord0.xy = TRANSFORM_TEX(v.texcoord0.xy, _MainTex); + half2 center = half2(0.5, 0.5); + #if ATLAS_ON + center = half2((_MaxXUV + _MinXUV) / 2.0, (_MaxYUV + _MinYUV) / 2.0); + #endif + + //POLARUV_ON + #if POLARUV_ON + v.texcoord0.xy = v.texcoord0.xy - center; + #endif + + //---------------------------------------- + + //ROTATEUV_ON + #if ROTATEUV_ON + half2 uvC = v.texcoord0.xy; + half cosAngle = cos(_RotateUvAmount); + half sinAngle = sin(_RotateUvAmount); + half2x2 rot = half2x2(cosAngle, -sinAngle, sinAngle, cosAngle); + uvC -= center; + v.texcoord0.xy = mul(rot, uvC); + v.texcoord0.xy += center; + #endif + //-------------------- + + #if RECTSIZE_ON + v.vertex.xyz += (v.vertex.xyz * (_RectSize - 1.0)); + #endif + + #if OUTTEX_ON + v.texcoord1.xy = TRANSFORM_TEX(v.texcoord0.xy, _OutlineTex); + #endif + + #if OUTDIST_ON + v.texcoord2.xy = TRANSFORM_TEX(v.texcoord0.xy, _OutlineDistortTex); + #endif + + #if DISTORT_ON + v.texcoord3.xy = TRANSFORM_TEX(v.texcoord0.xy, _DistortTex); + #endif + } + + void Ext_SurfaceFunction0 (inout Surface o, ShaderData d) + { + half randomSeed = _RandomSeed; + + float2 uvRect = d.texcoord0; + half2 center = half2(0.5, 0.5); + #if ATLAS_ON + center = half2((_MaxXUV + _MinXUV) / 2.0, (_MaxYUV + _MinYUV) / 2.0); + uvRect = half2((d.texcoord0.x - _MinXUV) / (_MaxXUV - _MinXUV), (d.texcoord0.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half2 centerTiled = half2(center.x * _MainTex_ST.x, center.y * _MainTex_ST.y); + + //CLIPPING_ON + #if CLIPPING_ON + half2 tiledUv = half2(d.texcoord0.x / _MainTex_ST.x, d.texcoord0.y / _MainTex_ST.y); + #if ATLAS_ON + tiledUv = half2((tiledUv.x - _MinXUV) / (_MaxXUV - _MinXUV), (tiledUv.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + clip((1 - _ClipUvUp) - tiledUv.y); + clip(tiledUv.y - _ClipUvDown); + clip((1 - _ClipUvRight) - tiledUv.x); + clip(tiledUv.x - _ClipUvLeft); + #endif + //---------------------------------- + + //RADIALCLIPPING_ON + #if RADIALCLIPPING_ON + half2 tiledUv2 = half2(d.texcoord0.x / _MainTex_ST.x, d.texcoord0.y / _MainTex_ST.y); + #if ATLAS_ON + tiledUv2 = half2((tiledUv2.x - _MinXUV) / (_MaxXUV - _MinXUV), (tiledUv2.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half startAngle = _RadialStartAngle - _RadialClip; + half endAngle = _RadialStartAngle + _RadialClip2; + half offset0 = clamp(0, 360, startAngle + 360); + half offset360 = clamp(0, 360, endAngle - 360); + half2 atan2Coord = half2(lerp(-1, 1, tiledUv2.x), lerp(-1, 1, tiledUv2.y)); + half atanAngle = atan2(atan2Coord.y, atan2Coord.x) * 57.3; // angle in degrees + if(atanAngle < 0) atanAngle = 360 + atanAngle; + if(atanAngle >= startAngle && atanAngle <= endAngle) discard; + if(atanAngle <= offset360) discard; + if(atanAngle >= offset0) discard; + #endif + + //----------------------------- + + //TEXTURESCROLL_ON && ATLAS_ON + #if TEXTURESCROLL_ON && ATLAS_ON + d.texcoord0.xy = half2(_MinXUV + ((_MaxXUV - _MinXUV) * (abs(((_Time.y + randomSeed) * _TextureScrollXSpeed) + uvRect.x) % 1)), + _MinYUV + ((_MaxYUV - _MinYUV) * (abs(((_Time.y + randomSeed) * _TextureScrollYSpeed) + uvRect.y) % 1))); + #endif + //---------------------------- + + //OFFSETUV_ON + #if OFFSETUV_ON + #if ATLAS_ON + d.texcoord0.xy = half2(_MinXUV + ((_MaxXUV - _MinXUV) * (abs((_OffsetUvX + uvRect.x) % 1))), + _MinYUV + ((_MaxYUV - _MinYUV) * (abs(_OffsetUvY + uvRect.y) % 1))); + #else + d.texcoord0.xy += half2(_OffsetUvX, _OffsetUvY); + #endif + #endif + + //---------------------- + + //POLARUV_ON + #if POLARUV_ON + d.texcoord0.xy = half2(atan2(d.texcoord0.y, d.texcoord0.x) / (2.0f * 3.141592653589f), length(d.texcoord0.xy)); + d.texcoord0.xy *= _MainTex_ST.xy; + #endif + + //-------------------------------------- + + //TWISTUV_ON + #if TWISTUV_ON + #if ATLAS_ON + _TwistUvPosX = ((_MaxXUV - _MinXUV) * _TwistUvPosX) + _MinXUV; + _TwistUvPosY = ((_MaxYUV - _MinYUV) * _TwistUvPosY) + _MinYUV; + #endif + half2 tempUv = d.texcoord0.xy - half2(_TwistUvPosX * _MainTex_ST.x, _TwistUvPosY * _MainTex_ST.y); + _TwistUvRadius *= (_MainTex_ST.x + _MainTex_ST.y) / 2; + half percent = (_TwistUvRadius - length(tempUv)) / _TwistUvRadius; + half theta = percent * percent * (2.0 * sin(_TwistUvAmount)) * 8.0; + half s = sin(theta); + half c = cos(theta); + half beta = max(sign(_TwistUvRadius - length(tempUv)), 0.0); + tempUv = half2(dot(tempUv, half2(c, -s)), dot(tempUv, half2(s, c))) * beta + tempUv * (1 - beta); + tempUv += half2(_TwistUvPosX * _MainTex_ST.x, _TwistUvPosY * _MainTex_ST.y); + d.texcoord0.xy = tempUv; + #endif + + //-------------------------------------------- + + //FISHEYE_ON + #if FISHEYE_ON + half bind = length(centerTiled); + half2 dF = d.texcoord0.xy - centerTiled; + half dFlen = length(dF); + half fishInt = (3.14159265359 / bind) * (_FishEyeUvAmount + 0.001); + d.texcoord0.xy = centerTiled + (dF / (max(0.0001, dFlen))) * tan(dFlen * fishInt) * bind / tan(bind * fishInt); + #endif + //--------------------------------------------- + + //PINCH_ON + #if PINCH_ON + half2 dP = d.texcoord0.xy - centerTiled; + half pinchInt = (3.141592 / length(centerTiled)) * (-_PinchUvAmount + 0.001); + d.texcoord0.xy = centerTiled + normalize(dP) * atan(length(dP) * -pinchInt * 10.0) * 0.5 / atan(-pinchInt * 5); + #endif + + //--------------------------------------------- + + //ZOOMUV_ON + #if ZOOMUV_ON + d.texcoord0.xy -= centerTiled; + d.texcoord0.xy = d.texcoord0.xy * _ZoomUvAmount; + d.texcoord0.xy += centerTiled; + #endif + + //----------------------------------------------- + + //DOODLE_ON + #if DOODLE_ON + half2 uvCopy = uvRect; + _HandDrawnSpeed = (floor((_Time.x + randomSeed) * 20 * _HandDrawnSpeed) / _HandDrawnSpeed) * _HandDrawnSpeed; + uvCopy.x = sin((uvCopy.x * _HandDrawnAmount + _HandDrawnSpeed) * 4); + uvCopy.y = cos((uvCopy.y * _HandDrawnAmount + _HandDrawnSpeed) * 4); + d.texcoord0.xy = lerp(d.texcoord0.xy, d.texcoord0.xy + uvCopy, 0.0005 * _HandDrawnAmount); + #endif + + //-------------------------- + + //SHAKEUV_ON + #if SHAKEUV_ON + half xShake = sin((_Time.x + randomSeed) * _ShakeUvSpeed * 50) * _ShakeUvX; + half yShake = cos((_Time.x + randomSeed) * _ShakeUvSpeed * 50) * _ShakeUvY; + d.texcoord0.xy += half2(xShake * 0.012, yShake * 0.01); + #endif + + //------------------------------------------- + + //RECTSIZE_ON + #if RECTSIZE_ON + d.texcoord0.xy = d.texcoord0.xy * (_RectSize).xx + (((-_RectSize * 0.5) + 0.5)).xx; + #endif + + //------------------------------------------- + + //DISTORT_ON + #if DISTORT_ON + #if ATLAS_ON + d.texcoord3.x = d.texcoord3.x * (1 / (_MaxXUV - _MinXUV)); + d.texcoord3.y = d.texcoord3.y * (1 / (_MaxYUV - _MinYUV)); + #endif + + d.texcoord3.x += ((_Time.x + _RandomSeed) * _DistortTexXSpeed) % 1; + d.texcoord3.y += ((_Time.x + _RandomSeed) * _DistortTexYSpeed) % 1; + half distortAmnt = (SAMPLE_TEXTURE2D(_DistortTex, sampler_DistortTex, d.texcoord3.xy).r - 0.5) * 0.2 * _DistortAmount; + d.texcoord0.x += distortAmnt; + d.texcoord0.y += distortAmnt; + #endif + //------------------------------------------------------- + + //WARP_ON + #if WARP_ON + half2 warpUv = half2(d.texcoord0.x / _MainTex_ST.x, d.texcoord0.y / _MainTex_ST.y); + #if ATLAS_ON + warpUv = half2((warpUv.x - _MinXUV) / (_MaxXUV - _MinXUV), (warpUv.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + const float tau = 6.283185307179586; + float xWarp = (_Time.y + randomSeed) * _WarpSpeed + warpUv.x * tau / _WarpScale; + float yWarp = (_Time.y + randomSeed) * _WarpSpeed + warpUv.y * tau / _WarpScale; + float2 warp = float2(sin(xWarp), sin(yWarp)) * _WarpStrength; + d.texcoord0.xy += warp; + #endif + + //------------------------------------------------------- + + //WAVEUV_ON + #if WAVEUV_ON + float2 uvWave = half2(_WaveX * _MainTex_ST.x, _WaveY * _MainTex_ST.y) - d.texcoord0.xy; + uvWave %= 1; + #if ATLAS_ON + uvWave = half2(_WaveX, _WaveY) - uvRect; + #endif + uvWave.x *= _ScreenParams.x / _ScreenParams.y; + float waveTime = _Time.y + randomSeed; + float angWave = (sqrt(dot(uvWave, uvWave)) * _WaveAmount) - ((waveTime * _WaveSpeed)); + d.texcoord0.xy = d.texcoord0.xy + uvWave * sin(angWave) * (_WaveStrength / 1000.0); + #endif + //---------------------------------------------------- + + //ROUNDWAVEUV_ON + #if ROUNDWAVEUV_ON + half xWave = ((0.5 * _MainTex_ST.x) - uvRect.x); + half yWave = ((0.5 * _MainTex_ST.y) - uvRect.y) * (_MainTex_TexelSize.w / _MainTex_TexelSize.z); + half ripple = -sqrt(xWave*xWave + yWave* yWave); + d.texcoord0.xy += (sin((ripple + (_Time.y + randomSeed) * (_RoundWaveSpeed/10.0)) / 0.015) * (_RoundWaveStrength/10.0)) % 1; + #endif + //---------------------------------------------------- + + + //WIND_ON + #if WIND_ON + half windOffset = sin((_Time.x + randomSeed) * _GrassSpeed * 10); + half2 windCenter = half2(0.5, 0.1); + #if ATLAS_ON + windCenter.x = ((_MaxXUV - _MinXUV) * windCenter.x) + _MinXUV; + windCenter.y = ((_MaxYUV - _MinYUV) * windCenter.y) + _MinYUV; + #endif + #if !MANUALWIND_ON + d.texcoord0.x = fmod(abs(lerp(d.texcoord0.x, d.texcoord0.x + (_GrassWind * 0.01 * windOffset), uvRect.y)), 1); + #else + d.texcoord0.x = fmod(abs(lerp(d.texcoord0.x, d.texcoord0.x + (_GrassWind * 0.01 * _GrassManualAnim), uvRect.y)), 1); + windOffset = _GrassManualAnim; + #endif + half2 delta = d.texcoord0.xy - windCenter; + half delta2 = dot(delta.xy, delta.xy); + half2 delta_offset = delta2 * windOffset; + d.texcoord0.xy = d.texcoord0.xy + half2(delta.y, -delta.x) * delta_offset * _GrassRadialBend; + #endif + + //-------------------------------------------------------- + + //TEXTURESCROLL_ON && !ATLAS_ON + #if TEXTURESCROLL_ON && !ATLAS_ON + d.texcoord0.x += ((_Time.y + randomSeed) * _TextureScrollXSpeed) % 1; + d.texcoord0.y += ((_Time.y + randomSeed) * _TextureScrollYSpeed) % 1; + #endif + //------------------------------ + + //PIXELATE_ON + #if PIXELATE_ON + half aspectRatio = _MainTex_TexelSize.x / _MainTex_TexelSize.y; + half2 pixelSize = float2(_PixelateSize, _PixelateSize * aspectRatio); + d.texcoord0.xy = floor(d.texcoord0.xy * pixelSize) / pixelSize; + #endif + //-------------- + + half4 col = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy); + half originalAlpha = col.a; + col *= d.vertexColor; + + //NORMAL MAP + #if NORMALMAP_ON + half4 normalSample = SAMPLE_TEXTURE2D(_NormalMap, sampler_NormalMap, d.texcoord0.xy); + half3 normalTS = UnpackNormal(normalSample); + normalTS.xy *= _NormalStrength; + o.Normal = normalTS; + #endif + + + //GLITCH_ON + #if GLITCH_ON + half2 uvGlitch = uvRect; + uvGlitch.y -= 0.5; + half lineNoise = pow(rand2(floor(uvGlitch * half2(24., 19.) * _GlitchSize) * 4.0, randomSeed), 3.0) * _GlitchAmount + * pow(rand2(floor(uvGlitch * half2(38., 14.) * _GlitchSize) * 4.0, randomSeed), 3.0); + col = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(lineNoise * 0.02 * rand2(half2(2.0, 1), randomSeed), 0)) * d.vertexColor; + #endif + //-------------------------------------- + + //CHROMABERR_ON + #if CHROMABERR_ON + half4 r = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(_ChromAberrAmount/10, 0)) * d.vertexColor; + half4 b = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(-_ChromAberrAmount/10, 0)) * d.vertexColor; + col = half4(r.r * r.a, col.g, b.b * b.a, max(max(r.a, b.a) * _ChromAberrAlpha, col.a)); + #endif + + //-------------------------------- + + //BLUR_ON + #if BLUR_ON + #if ATLAS_ON + #if !BLURISHD_ON + col = BlurHD(d.texcoord0.xy, _MainTex, sampler_MainTex, _BlurIntensity, (_MaxXUV - _MinXUV), (_MaxYUV - _MinYUV)) * d.vertexColor; + #else + col = Blur(d.texcoord0.xy, _MainTex, sampler_MainTex, _BlurIntensity * (_MaxXUV - _MinXUV)) * d.vertexColor; + #endif + #else + #if !BLURISHD_ON + col = BlurHD(d.texcoord0.xy, _MainTex, sampler_MainTex, _BlurIntensity, 1, 1) * d.vertexColor; + #else + col = Blur(d.texcoord0.xy, _MainTex, sampler_MainTex, _BlurIntensity) * d.vertexColor; + #endif + #endif + #endif + + //-------------------- + + //MOTIONBLUR_ON + #if MOTIONBLUR_ON + _MotionBlurAngle = _MotionBlurAngle * 3.1415926; + #define rot(n) mul(n, half2x2(cos(_MotionBlurAngle), -sin(_MotionBlurAngle), sin(_MotionBlurAngle), cos(_MotionBlurAngle))) + _MotionBlurDist = _MotionBlurDist * 0.005; + #if ATLAS_ON + _MotionBlurDist *= (_MaxXUV - _MinXUV); + #endif + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(-_MotionBlurDist, -_MotionBlurDist))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(-_MotionBlurDist * 2, -_MotionBlurDist * 2))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(-_MotionBlurDist * 3, -_MotionBlurDist * 3))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(-_MotionBlurDist * 4, -_MotionBlurDist * 4))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(_MotionBlurDist, _MotionBlurDist))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(_MotionBlurDist * 2, _MotionBlurDist * 2))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(_MotionBlurDist * 3, _MotionBlurDist * 3))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(_MotionBlurDist * 4, _MotionBlurDist * 4))); + col.rgb = col.rgb / 9; + #endif + //------------------------------------ + + //NEGATIVE_ON + #if NEGATIVE_ON + col.rgb = lerp(col.rgb, 1 - col.rgb, _NegativeAmount); + #endif + + //-------------- + half luminance = 0; + + //GREYSCALE_ON && !GREYSCALEOUTLINE_ON + #if GREYSCALE_ON && !GREYSCALEOUTLINE_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + luminance = saturate(luminance + _GreyscaleLuminosity); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _GreyscaleTintColor, _GreyscaleBlend); + #endif + //------------------------------------ + + //GHOST_ON + #if GHOST_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + half4 ghostResult; + ghostResult.a = saturate(luminance - _GhostTransparency) * col.a; + ghostResult.rgb = col.rgb * (luminance + _GhostColorBoost); + col = lerp(col, ghostResult, _GhostBlend); + #endif + //------------------------------------ + + //INNEROUTLINE_ON + #if INNEROUTLINE_ON + half3 innerT = abs(GetPixel(0, _InnerOutlineThickness, d.texcoord0.xy, _MainTex, sampler_MainTex) - GetPixel(0, -_InnerOutlineThickness, d.texcoord0.xy, _MainTex, sampler_MainTex)); + innerT += abs(GetPixel(_InnerOutlineThickness, 0, d.texcoord0.xy, _MainTex, sampler_MainTex) - GetPixel(-_InnerOutlineThickness, 0, d.texcoord0.xy, _MainTex, sampler_MainTex)); + #if !ONLYINNEROUTLINE_ON + innerT = (innerT / 2.0) * col.a * _InnerOutlineAlpha; + col.rgb += length(innerT) * _InnerOutlineColor.rgb * _InnerOutlineGlow; + #else + innerT *= col.a * _InnerOutlineAlpha; + col.rgb = length(innerT) * _InnerOutlineColor.rgb * _InnerOutlineGlow; + col.a = step(0.3, col.r+col.g+col.b); + #endif + #endif + //------------------------------------------------------- + + //HITEFFECT_ON + #if HITEFFECT_ON + col.rgb = lerp(col.rgb, _HitEffectColor.rgb * _HitEffectGlow, _HitEffectBlend); + #endif + //-------------------- + + //GRADIENT_ON + #if GRADIENT_ON + half2 tiledUvGrad = half2(uvRect.x / _MainTex_ST.x, uvRect.y / _MainTex_ST.y); + #if GRADIENT2COL_ON + _GradTopRightCol = _GradTopLeftCol; + _GradBotRightCol = _GradBotLeftCol; + #endif + #if RADIALGRADIENT_ON + half radialDist = 1 - length(tiledUvGrad - half2(0.5, 0.5)); + radialDist *= (_MainTex_TexelSize.w / _MainTex_TexelSize.z); + radialDist = saturate(_GradBoostX * radialDist); + half4 gradientResult = lerp(_GradTopLeftCol, _GradBotLeftCol, radialDist); + #else + half gradXLerpFactor = saturate(pow(tiledUvGrad.x, _GradBoostX)); + half4 gradientResult = lerp(lerp(_GradBotLeftCol, _GradBotRightCol, gradXLerpFactor), + lerp(_GradTopLeftCol, _GradTopRightCol, gradXLerpFactor), saturate(pow(tiledUvGrad.y, _GradBoostY))); + #endif + gradientResult = lerp(col, gradientResult, _GradBlend); + col.rgb = gradientResult.rgb * col.a; + col.a *= gradientResult.a; + #endif + //-------------------------------------------------------------------- + + //CONTRAST_ON + #if CONTRAST_ON + col.rgb = (col.rgb - float3(0.5, 0.5, 0.5)) * _Contrast + float3(0.5, 0.5, 0.5); + col.rgb += _Brightness; + #endif + + //------------------------------------------------------------------- + + //COLORSWAP_ON + #if COLORSWAP_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + half4 swapMask = SAMPLE_TEXTURE2D(_ColorSwapTex, sampler_ColorSwapTex, d.texcoord0.xy); + swapMask.rgb *= swapMask.a; + half3 redSwap = _ColorSwapRed * swapMask.r * saturate(luminance + _ColorSwapRedLuminosity); + half3 greenSwap = _ColorSwapGreen * swapMask.g * saturate(luminance + _ColorSwapGreenLuminosity); + half3 blueSwap = _ColorSwapBlue * swapMask.b * saturate(luminance + _ColorSwapBlueLuminosity); + swapMask.rgb = col.rgb * saturate(1 - swapMask.r - swapMask.g - swapMask.b); + col.rgb = lerp(col.rgb, swapMask.rgb + redSwap + greenSwap + blueSwap, _ColorSwapBlend); + #endif + //-------------------------------------------------------------------- + + //COLORRAMP_ON && !COLORRAMPOUTLINE_ON + #if COLORRAMP_ON && !COLORRAMPOUTLINE_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + luminance = saturate(luminance + _ColorRampLuminosity); + #if GRADIENTCOLORRAMP_ON + col.rgb = lerp(col.rgb, SAMPLE_TEXTURE2D(_ColorRampTexGradient, sampler_ColorRampTexGradient, half2(luminance, 0)).rgb, _ColorRampBlend); + #else + col.rgb = lerp(col.rgb, SAMPLE_TEXTURE2D(_ColorRampTex, sampler_ColorRampTex, half2(luminance, 0)).rgb, _ColorRampBlend); + #endif + #endif + //-------------------------------------------------------------------- + + //CHANGECOLOR_ON + #if CHANGECOLOR_ON + float3 currChangeColor = saturate(col.rgb); + luminance = 0.3 * currChangeColor.r + 0.59 * currChangeColor.g + 0.11 * currChangeColor.b; + luminance = saturate(luminance + _ColorChangeLuminosity); + half3 dif = abs(currChangeColor - _ColorChangeTarget.rgb); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _ColorChangeNewCol.rgb, + max(sign(1 - saturate(dif.x + dif.y + dif.z) - _ColorChangeTolerance), 0.0)); + #if CHANGECOLOR2_ON + dif = abs(currChangeColor - _ColorChangeTarget2.rgb); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _ColorChangeNewCol2.rgb, + max(sign(1 - saturate(dif.x + dif.y + dif.z) - _ColorChangeTolerance2), 0.0)); + #endif + #if CHANGECOLOR3_ON + dif = abs(currChangeColor - _ColorChangeTarget3.rgb); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _ColorChangeNewCol3.rgb, + max(sign(1 - saturate(dif.x + dif.y + dif.z) - _ColorChangeTolerance3), 0.0)); + #endif + #endif + //------------------------------------------------------- + + //POSTERIZE_ON && !POSTERIZEOUTLINE_ON + #if POSTERIZE_ON && !POSTERIZEOUTLINE_ON + col.rgb = pow(col.rgb, _PosterizeGamma) * _PosterizeNumColors; + col.rgb = floor(col.rgb) / _PosterizeNumColors; + col.rgb = pow(col.rgb, 1.0 / _PosterizeGamma); + #endif + //------------------------------------ + + //HSV_ON + #if HSV_ON + half3 resultHsv = half3(col.rgb); + half cosHsv = _HsvBright * _HsvSaturation * cos(_HsvShift * 3.14159265 / 180); + half sinHsv = _HsvBright * _HsvSaturation * sin(_HsvShift * 3.14159265 / 180); + resultHsv.x = (.299 * _HsvBright + .701 * cosHsv + .168 * sinHsv) * col.x + + (.587 * _HsvBright - .587 * cosHsv + .330 * sinHsv) * col.y + + (.114 * _HsvBright - .114 * cosHsv - .497 * sinHsv) * col.z; + resultHsv.y = (.299 * _HsvBright - .299 * cosHsv - .328 * sinHsv) *col.x + + (.587 * _HsvBright + .413 * cosHsv + .035 * sinHsv) * col.y + + (.114 * _HsvBright - .114 * cosHsv + .292 * sinHsv) * col.z; + resultHsv.z = (.299 * _HsvBright - .3 * cosHsv + 1.25 * sinHsv) * col.x + + (.587 * _HsvBright - .588 * cosHsv - 1.05 * sinHsv) * col.y + + (.114 * _HsvBright + .886 * cosHsv - .203 * sinHsv) * col.z; + col.rgb = resultHsv; + #endif + //------------------------------------------------------- + + //OVERLAY_ON + #if OVERLAY_ON + half2 overlayUvs = d.texcoord0.xy; + overlayUvs.x += ((_Time.y + randomSeed) * _OverlayTextureScrollXSpeed) % 1; + overlayUvs.y += ((_Time.y + randomSeed) * _OverlayTextureScrollYSpeed) % 1; + half4 overlayCol = SAMPLE_TEXTURE2D(_OverlayTex, sampler_OverlayTex, TRANSFORM_TEX(overlayUvs, _OverlayTex)); + overlayCol.rgb *= _OverlayColor.rgb * _OverlayGlow; + #if !OVERLAYMULT_ON + overlayCol.rgb *= overlayCol.a * _OverlayColor.rgb * _OverlayColor.a * _OverlayBlend; + col.rgb += overlayCol.rgb; + #else + overlayCol.a *= _OverlayColor.a; + col = lerp(col, col * overlayCol, _OverlayBlend); + #endif + #endif + + //--------------------------------- + + //OUTBASE_ON + #if OUTBASE_ON + #if OUTBASEPIXELPERF_ON + half2 destUv = half2(_OutlinePixelWidth * _MainTex_TexelSize.x, _OutlinePixelWidth * _MainTex_TexelSize.y); + #else + half2 destUv = half2(_OutlineWidth * _MainTex_TexelSize.x * 200, _OutlineWidth * _MainTex_TexelSize.y * 200); + #endif + + #if OUTDIST_ON + d.texcoord3.x += ((_Time.x + _RandomSeed) * _OutlineDistortTexXSpeed) % 1; + d.texcoord3.y += ((_Time.x + _RandomSeed) * _OutlineDistortTexYSpeed) % 1; + #if ATLAS_ON + d.texcoord3 = half2((d.texcoord3.x - _MinXUV) / (_MaxXUV - _MinXUV), (d.texcoord3.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half outDistortAmnt = (SAMPLE_TEXTURE2D(_OutlineDistortTex, sampler_OutlineDistortTex, d.texcoord3).r - 0.5) * 0.2 * _OutlineDistortAmount; + destUv.x += outDistortAmnt; + destUv.y += outDistortAmnt; + #endif + + half spriteLeft = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(destUv.x, 0)).a; + half spriteRight = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy - half2(destUv.x, 0)).a; + half spriteBottom = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(0, destUv.y)).a; + half spriteTop = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy - half2(0, destUv.y)).a; + half result = spriteLeft + spriteRight + spriteBottom + spriteTop; + + #if OUTBASE8DIR_ON + half spriteTopLeft = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(destUv.x, destUv.y)).a; + half spriteTopRight = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(-destUv.x, destUv.y)).a; + half spriteBotLeft = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(destUv.x, -destUv.y)).a; + half spriteBotRight = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(-destUv.x, -destUv.y)).a; + result = result + spriteTopLeft + spriteTopRight + spriteBotLeft + spriteBotRight; + #endif + + result = step(0.05, saturate(result)); + + #if OUTTEX_ON + d.texcoord1.x += ((_Time.x + _RandomSeed) * _OutlineTexXSpeed) % 1; + d.texcoord1.y += ((_Time.x + _RandomSeed) * _OutlineTexYSpeed) % 1; + #if ATLAS_ON + d.texcoord1 = half2((d.texcoord1.x - _MinXUV) / (_MaxXUV - _MinXUV), (d.texcoord1.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half4 tempOutColor = SAMPLE_TEXTURE2D(_OutlineTex, sampler_OutlineTex, d.texcoord1); + tempOutColor *= _OutlineColor; + _OutlineColor = tempOutColor; + #endif + + result *= (1 - originalAlpha) * _OutlineAlpha; + + half4 outline = _OutlineColor * d.vertexColor.a; + outline.rgb *= _OutlineGlow; + outline.a = result; + #if ONLYOUTLINE_ON + col = outline; + #else + col = lerp(col, outline, result); + #endif + #endif + //------------------------------------------------------- + + //FADE_ON + #if FADE_ON + half2 tiledUvFade1 = TRANSFORM_TEX(d.texcoord0, _FadeTex); + half2 tiledUvFade2 = TRANSFORM_TEX(d.texcoord0, _FadeBurnTex); + #if ATLAS_ON + tiledUvFade1 = half2((tiledUvFade1.x - _MinXUV) / (_MaxXUV - _MinXUV), (tiledUvFade1.y - _MinYUV) / (_MaxYUV - _MinYUV)); + tiledUvFade2 = half2((tiledUvFade2.x - _MinXUV) / (_MaxXUV - _MinXUV), (tiledUvFade2.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half fadeTemp = SAMPLE_TEXTURE2D(_FadeTex, sampler_FadeTex, tiledUvFade1).r; + half fade = smoothstep(_FadeAmount, _FadeAmount + _FadeBurnTransition, fadeTemp); + half fadeBurn = saturate(smoothstep(_FadeAmount - _FadeBurnWidth, _FadeAmount - _FadeBurnWidth + 0.1, fadeTemp) * _FadeAmount); + col.a *= fade; + _FadeBurnColor.rgb *= _FadeBurnGlow; + col += fadeBurn * SAMPLE_TEXTURE2D(_FadeBurnTex, sampler_FadeBurnTex, tiledUvFade2) * _FadeBurnColor * originalAlpha * (1 - col.a); + #endif + //------------------------------------------------------- + + //SHADOW_ON + #if SHADOW_ON + half shadowA = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(_ShadowX, _ShadowY)).a; + half preMultShadowMask = 1 - (saturate(shadowA - col.a) * (1 - col.a)); + col.rgb *= 1 - ((shadowA - col.a) * (1 - col.a)); + col.rgb += (_ShadowColor * shadowA) * (1 - col.a); + col.a = max(shadowA * _ShadowAlpha * d.vertexColor.a, col.a); + #endif + + //------------------------------------------------------- + + //GLOW_ON + #if GLOW_ON + half4 emission; + #if GLOWTEX_ON + emission = SAMPLE_TEXTURE2D(_GlowTex, sampler_GlowTex, d.texcoord0); + #else + emission = col; + #endif + + col.rgb *= _GlowGlobal; + emission.rgb *= emission.a * col.a * _Glow * _GlowColor; + col.rgb += emission.rgb; + #endif + //------------------------------------------------------- + + //COLORRAMP_ON && COLORRAMPOUTLINE_ON + #if COLORRAMP_ON && COLORRAMPOUTLINE_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + luminance = saturate(luminance + _ColorRampLuminosity); + #if GRADIENTCOLORRAMP_ON + col.rgb = lerp(col.rgb, SAMPLE_TEXTURE2D(_ColorRampTexGradient, sampler_ColorRampTexGradient, half2(luminance, 0)).rgb, _ColorRampBlend); + #else + col.rgb = lerp(col.rgb, SAMPLE_TEXTURE2D(_ColorRampTex, sampler_ColorRampTex, half2(luminance, 0)).rgb, _ColorRampBlend); + #endif + #endif + //--------------- + + //GREYSCALE_ON && GREYSCALEOUTLINE_ON + #if GREYSCALE_ON && GREYSCALEOUTLINE_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + luminance = saturate(luminance + _GreyscaleLuminosity); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _GreyscaleTintColor, _GreyscaleBlend); + #endif + + //----------------------------------- + + //POSTERIZE_ON && POSTERIZEOUTLINE_ON + #if POSTERIZE_ON && POSTERIZEOUTLINE_ON + col.rgb = pow(col.rgb, _PosterizeGamma) * _PosterizeNumColors; + col.rgb = floor(col.rgb) / _PosterizeNumColors; + col.rgb = pow(col.rgb, 1.0 / _PosterizeGamma); + #endif + + //----------------------------------- + + //SHINE_ON + #if SHINE_ON + half2 uvShine = uvRect; + half cosAngle = cos(_ShineRotate); + half sinAngle = sin(_ShineRotate); + half2x2 rot = half2x2(cosAngle, -sinAngle, sinAngle, cosAngle); + uvShine -= half2(0.5, 0.5); + uvShine = mul(rot, uvShine); + uvShine += half2(0.5, 0.5); + half shineMask = SAMPLE_TEXTURE2D(_ShineMask, sampler_ShineMask, d.texcoord0.xy).a; + half currentDistanceProjection = (uvShine.x + uvShine.y) / 2; + half whitePower = 1 - (abs(currentDistanceProjection - _ShineLocation) / _ShineWidth); + col.rgb += col.a * whitePower * _ShineGlow * max(sign(currentDistanceProjection - (_ShineLocation - _ShineWidth)), 0.0) + * max(sign((_ShineLocation + _ShineWidth) - currentDistanceProjection), 0.0) * _ShineColor * shineMask; + #endif + + //----------------------------------- + + //HOLOGRAM_ON + #if HOLOGRAM_ON + half totalHologram = _HologramStripesAmount + _HologramUnmodAmount; + half hologramYCoord = ((uvRect.y + (((_Time.x + randomSeed) % 1) * _HologramStripesSpeed)) % totalHologram) / totalHologram; + hologramYCoord = abs(hologramYCoord); + half alpha = RemapFloat(saturate(hologramYCoord - (_HologramUnmodAmount/totalHologram)), 0.0, 1.0, _HologramMinAlpha, saturate(_HologramMaxAlpha)); + half hologramMask = max(sign((_HologramUnmodAmount/totalHologram) - hologramYCoord), 0.0); + half4 hologramResult = col; + hologramResult.a *= lerp(alpha, 1, hologramMask); + hologramResult.rgb *= max(1, _HologramMaxAlpha * max(sign(hologramYCoord - (_HologramUnmodAmount/totalHologram)), 0.0)); + hologramMask = 1 - step(0.01,hologramMask); + hologramResult.rgb += hologramMask * _HologramStripeColor * col.a; + col = lerp(col, hologramResult, _HologramBlend); + #endif + + //----------------------------------- + + //FLICKER_ON + #if FLICKER_ON + col.a *= saturate(col.a * step(frac(0.05 + (_Time.w + randomSeed) * _FlickerFreq), 1 - _FlickerPercent) + _FlickerAlpha); + #endif + //----------------------------------- + + //ALPHACUTOFF_ON + + //ALPHAROUND_ON + + //ALPHAOUTLINE_ON + #if ALPHAOUTLINE_ON + half alphaOutlineRes = pow(1 - col.a, max(_AlphaOutlinePower, 0.0001)) * step(_AlphaOutlineMinAlpha, col.a) * _AlphaOutlineBlend; + col.rgb = lerp(col.rgb, _AlphaOutlineColor.rgb * _AlphaOutlineGlow, alphaOutlineRes); + col.a = lerp(col.a, 1, alphaOutlineRes > 1); + #endif + //------------------------------------------------------- + + //FOG_ON + + //------------------ + + col *= _Color; + o.Albedo = col; + col.a *= _Alpha; + clip(col.a - _AlphaCutoffValue - 0.01); + o.Alpha = _Color.a; + } + + + + + + void ChainSurfaceFunction(inout Surface l, inout ShaderData d) + { + Ext_SurfaceFunction0(l, d); + // Ext_SurfaceFunction1(l, d); + // Ext_SurfaceFunction2(l, d); + // Ext_SurfaceFunction3(l, d); + // Ext_SurfaceFunction4(l, d); + // Ext_SurfaceFunction5(l, d); + // Ext_SurfaceFunction6(l, d); + // Ext_SurfaceFunction7(l, d); + // Ext_SurfaceFunction8(l, d); + // Ext_SurfaceFunction9(l, d); + // Ext_SurfaceFunction10(l, d); + // Ext_SurfaceFunction11(l, d); + // Ext_SurfaceFunction12(l, d); + // Ext_SurfaceFunction13(l, d); + // Ext_SurfaceFunction14(l, d); + // Ext_SurfaceFunction15(l, d); + // Ext_SurfaceFunction16(l, d); + // Ext_SurfaceFunction17(l, d); + // Ext_SurfaceFunction18(l, d); + // Ext_SurfaceFunction19(l, d); + // Ext_SurfaceFunction20(l, d); + // Ext_SurfaceFunction21(l, d); + // Ext_SurfaceFunction22(l, d); + // Ext_SurfaceFunction23(l, d); + // Ext_SurfaceFunction24(l, d); + // Ext_SurfaceFunction25(l, d); + // Ext_SurfaceFunction26(l, d); + // Ext_SurfaceFunction27(l, d); + // Ext_SurfaceFunction28(l, d); + // Ext_SurfaceFunction29(l, d); + } + +#if !_DECALSHADER + + void ChainModifyVertex(inout VertexData v, inout VertexToPixel v2p, float4 time) + { + ExtraV2F d; + + ZERO_INITIALIZE(ExtraV2F, d); + ZERO_INITIALIZE(Blackboard, d.blackboard); + // due to motion vectors in HDRP, we need to use the last + // time in certain spots. So if you are going to use _Time to adjust vertices, + // you need to use this time or motion vectors will break. + d.time = time; + + Ext_ModifyVertex0(v, d); + // Ext_ModifyVertex1(v, d); + // Ext_ModifyVertex2(v, d); + // Ext_ModifyVertex3(v, d); + // Ext_ModifyVertex4(v, d); + // Ext_ModifyVertex5(v, d); + // Ext_ModifyVertex6(v, d); + // Ext_ModifyVertex7(v, d); + // Ext_ModifyVertex8(v, d); + // Ext_ModifyVertex9(v, d); + // Ext_ModifyVertex10(v, d); + // Ext_ModifyVertex11(v, d); + // Ext_ModifyVertex12(v, d); + // Ext_ModifyVertex13(v, d); + // Ext_ModifyVertex14(v, d); + // Ext_ModifyVertex15(v, d); + // Ext_ModifyVertex16(v, d); + // Ext_ModifyVertex17(v, d); + // Ext_ModifyVertex18(v, d); + // Ext_ModifyVertex19(v, d); + // Ext_ModifyVertex20(v, d); + // Ext_ModifyVertex21(v, d); + // Ext_ModifyVertex22(v, d); + // Ext_ModifyVertex23(v, d); + // Ext_ModifyVertex24(v, d); + // Ext_ModifyVertex25(v, d); + // Ext_ModifyVertex26(v, d); + // Ext_ModifyVertex27(v, d); + // Ext_ModifyVertex28(v, d); + // Ext_ModifyVertex29(v, d); + + + // #if %EXTRAV2F0REQUIREKEY% + // v2p.extraV2F0 = d.extraV2F0; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // v2p.extraV2F1 = d.extraV2F1; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // v2p.extraV2F2 = d.extraV2F2; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // v2p.extraV2F3 = d.extraV2F3; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // v2p.extraV2F4 = d.extraV2F4; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // v2p.extraV2F5 = d.extraV2F5; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // v2p.extraV2F6 = d.extraV2F6; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // v2p.extraV2F7 = d.extraV2F7; + // #endif + } + + void ChainModifyTessellatedVertex(inout VertexData v, inout VertexToPixel v2p) + { + ExtraV2F d; + ZERO_INITIALIZE(ExtraV2F, d); + ZERO_INITIALIZE(Blackboard, d.blackboard); + + // #if %EXTRAV2F0REQUIREKEY% + // d.extraV2F0 = v2p.extraV2F0; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // d.extraV2F1 = v2p.extraV2F1; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // d.extraV2F2 = v2p.extraV2F2; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // d.extraV2F3 = v2p.extraV2F3; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // d.extraV2F4 = v2p.extraV2F4; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // d.extraV2F5 = v2p.extraV2F5; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // d.extraV2F6 = v2p.extraV2F6; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // d.extraV2F7 = v2p.extraV2F7; + // #endif + + + // Ext_ModifyTessellatedVertex0(v, d); + // Ext_ModifyTessellatedVertex1(v, d); + // Ext_ModifyTessellatedVertex2(v, d); + // Ext_ModifyTessellatedVertex3(v, d); + // Ext_ModifyTessellatedVertex4(v, d); + // Ext_ModifyTessellatedVertex5(v, d); + // Ext_ModifyTessellatedVertex6(v, d); + // Ext_ModifyTessellatedVertex7(v, d); + // Ext_ModifyTessellatedVertex8(v, d); + // Ext_ModifyTessellatedVertex9(v, d); + // Ext_ModifyTessellatedVertex10(v, d); + // Ext_ModifyTessellatedVertex11(v, d); + // Ext_ModifyTessellatedVertex12(v, d); + // Ext_ModifyTessellatedVertex13(v, d); + // Ext_ModifyTessellatedVertex14(v, d); + // Ext_ModifyTessellatedVertex15(v, d); + // Ext_ModifyTessellatedVertex16(v, d); + // Ext_ModifyTessellatedVertex17(v, d); + // Ext_ModifyTessellatedVertex18(v, d); + // Ext_ModifyTessellatedVertex19(v, d); + // Ext_ModifyTessellatedVertex20(v, d); + // Ext_ModifyTessellatedVertex21(v, d); + // Ext_ModifyTessellatedVertex22(v, d); + // Ext_ModifyTessellatedVertex23(v, d); + // Ext_ModifyTessellatedVertex24(v, d); + // Ext_ModifyTessellatedVertex25(v, d); + // Ext_ModifyTessellatedVertex26(v, d); + // Ext_ModifyTessellatedVertex27(v, d); + // Ext_ModifyTessellatedVertex28(v, d); + // Ext_ModifyTessellatedVertex29(v, d); + + // #if %EXTRAV2F0REQUIREKEY% + // v2p.extraV2F0 = d.extraV2F0; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // v2p.extraV2F1 = d.extraV2F1; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // v2p.extraV2F2 = d.extraV2F2; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // v2p.extraV2F3 = d.extraV2F3; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // v2p.extraV2F4 = d.extraV2F4; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // v2p.extraV2F5 = d.extraV2F5; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // v2p.extraV2F6 = d.extraV2F6; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // v2p.extraV2F7 = d.extraV2F7; + // #endif + } + + void ChainFinalColorForward(inout Surface l, inout ShaderData d, inout half4 color) + { + // Ext_FinalColorForward0(l, d, color); + // Ext_FinalColorForward1(l, d, color); + // Ext_FinalColorForward2(l, d, color); + // Ext_FinalColorForward3(l, d, color); + // Ext_FinalColorForward4(l, d, color); + // Ext_FinalColorForward5(l, d, color); + // Ext_FinalColorForward6(l, d, color); + // Ext_FinalColorForward7(l, d, color); + // Ext_FinalColorForward8(l, d, color); + // Ext_FinalColorForward9(l, d, color); + // Ext_FinalColorForward10(l, d, color); + // Ext_FinalColorForward11(l, d, color); + // Ext_FinalColorForward12(l, d, color); + // Ext_FinalColorForward13(l, d, color); + // Ext_FinalColorForward14(l, d, color); + // Ext_FinalColorForward15(l, d, color); + // Ext_FinalColorForward16(l, d, color); + // Ext_FinalColorForward17(l, d, color); + // Ext_FinalColorForward18(l, d, color); + // Ext_FinalColorForward19(l, d, color); + // Ext_FinalColorForward20(l, d, color); + // Ext_FinalColorForward21(l, d, color); + // Ext_FinalColorForward22(l, d, color); + // Ext_FinalColorForward23(l, d, color); + // Ext_FinalColorForward24(l, d, color); + // Ext_FinalColorForward25(l, d, color); + // Ext_FinalColorForward26(l, d, color); + // Ext_FinalColorForward27(l, d, color); + // Ext_FinalColorForward28(l, d, color); + // Ext_FinalColorForward29(l, d, color); + } + + void ChainFinalGBufferStandard(inout Surface s, inout ShaderData d, inout half4 GBuffer0, inout half4 GBuffer1, inout half4 GBuffer2, inout half4 outEmission, inout half4 outShadowMask) + { + // Ext_FinalGBufferStandard0(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard1(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard2(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard3(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard4(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard5(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard6(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard7(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard8(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard9(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard10(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard11(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard12(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard13(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard14(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard15(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard16(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard17(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard18(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard19(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard20(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard21(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard22(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard23(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard24(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard25(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard26(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard27(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard28(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard29(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + } +#endif + + + + + +#if _DECALSHADER + + ShaderData CreateShaderData(SurfaceDescriptionInputs IN) + { + ShaderData d = (ShaderData)0; + d.TBNMatrix = float3x3(IN.WorldSpaceTangent, IN.WorldSpaceBiTangent, IN.WorldSpaceNormal); + d.worldSpaceNormal = IN.WorldSpaceNormal; + d.worldSpaceTangent = IN.WorldSpaceTangent; + + d.worldSpacePosition = IN.WorldSpacePosition; + d.texcoord0 = IN.uv0.xyxy; + d.screenPos = IN.ScreenPosition; + + d.worldSpaceViewDir = normalize(_WorldSpaceCameraPos - d.worldSpacePosition); + + d.tangentSpaceViewDir = mul(d.TBNMatrix, d.worldSpaceViewDir); + + // these rarely get used, so we back transform them. Usually will be stripped. + #if _HDRP + // d.localSpacePosition = mul(GetWorldToObjectMatrix(), float4(GetCameraRelativePositionWS(d.worldSpacePosition), 1)).xyz; + #else + // d.localSpacePosition = mul(GetWorldToObjectMatrix(), float4(d.worldSpacePosition, 1)).xyz; + #endif + // d.localSpaceNormal = normalize(mul((float3x3)GetWorldToObjectMatrix(), d.worldSpaceNormal)); + // d.localSpaceTangent = normalize(mul((float3x3)GetWorldToObjectMatrix(), d.worldSpaceTangent.xyz)); + + // #if %SCREENPOSREQUIREKEY% + // d.screenUV = (IN.ScreenPosition.xy / max(0.01, IN.ScreenPosition.w)); + // #endif + + return d; + } +#else + + ShaderData CreateShaderData(VertexToPixel i + #if NEED_FACING + , bool facing + #endif + ) + { + ShaderData d = (ShaderData)0; + d.clipPos = i.pos; + d.worldSpacePosition = i.worldPos; + + d.worldSpaceNormal = normalize(i.worldNormal); + d.worldSpaceTangent.xyz = normalize(i.worldTangent.xyz); + + d.tangentSign = i.worldTangent.w * unity_WorldTransformParams.w; + float3 bitangent = cross(d.worldSpaceTangent.xyz, d.worldSpaceNormal) * d.tangentSign; + + d.TBNMatrix = float3x3(d.worldSpaceTangent, -bitangent, d.worldSpaceNormal); + d.worldSpaceViewDir = normalize(_WorldSpaceCameraPos - i.worldPos); + + d.tangentSpaceViewDir = mul(d.TBNMatrix, d.worldSpaceViewDir); + d.texcoord0 = i.texcoord0; + d.texcoord1 = i.texcoord1; + d.texcoord2 = i.texcoord2; + + // #if %TEXCOORD3REQUIREKEY% + d.texcoord3 = i.texcoord3; + // #endif + + // d.isFrontFace = facing; + // #if %VERTEXCOLORREQUIREKEY% + d.vertexColor = i.vertexColor; + // #endif + + // these rarely get used, so we back transform them. Usually will be stripped. + #if _HDRP + // d.localSpacePosition = mul(GetWorldToObjectMatrix(), float4(GetCameraRelativePositionWS(i.worldPos), 1)).xyz; + #else + // d.localSpacePosition = mul(GetWorldToObjectMatrix(), float4(i.worldPos, 1)).xyz; + #endif + // d.localSpaceNormal = normalize(mul((float3x3)GetWorldToObjectMatrix(), i.worldNormal)); + // d.localSpaceTangent = normalize(mul((float3x3)GetWorldToObjectMatrix(), i.worldTangent.xyz)); + + // #if %SCREENPOSREQUIREKEY% + // d.screenPos = i.screenPos; + // d.screenUV = (i.screenPos.xy / i.screenPos.w); + // #endif + + + // #if %EXTRAV2F0REQUIREKEY% + // d.extraV2F0 = i.extraV2F0; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // d.extraV2F1 = i.extraV2F1; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // d.extraV2F2 = i.extraV2F2; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // d.extraV2F3 = i.extraV2F3; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // d.extraV2F4 = i.extraV2F4; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // d.extraV2F5 = i.extraV2F5; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // d.extraV2F6 = i.extraV2F6; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // d.extraV2F7 = i.extraV2F7; + // #endif + + return d; + } + +#endif + + + +#if (SHADERPASS == SHADERPASS_LIGHT_TRANSPORT) + + // This was not in constant buffer in original unity, so keep outiside. But should be in as ShaderRenderPass frequency + float unity_OneOverOutputBoost; + float unity_MaxOutputValue; + + CBUFFER_START(UnityMetaPass) + // x = use uv1 as raster position + // y = use uv2 as raster position + bool4 unity_MetaVertexControl; + + // x = return albedo + // y = return normal + bool4 unity_MetaFragmentControl; + CBUFFER_END + + VertexToPixel Vert(VertexData inputMesh) + { + VertexToPixel output; + ZERO_INITIALIZE(VertexToPixel, output); + UNITY_SETUP_INSTANCE_ID(inputMesh); + UNITY_TRANSFER_INSTANCE_ID(inputMesh, output); + UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(output); + + // Output UV coordinate in vertex shader + float2 uv = float2(0.0, 0.0); + + if (unity_MetaVertexControl.x) + { + uv = inputMesh.texcoord1.xy * unity_LightmapST.xy + unity_LightmapST.zw; + } + else if (unity_MetaVertexControl.y) + { + uv = inputMesh.texcoord2.xy * unity_DynamicLightmapST.xy + unity_DynamicLightmapST.zw; + } + + // OpenGL right now needs to actually use the incoming vertex position + // so we create a fake dependency on it here that haven't any impact. + output.pos = float4(uv * 2.0 - 1.0, inputMesh.vertex.z > 0 ? 1.0e-4 : 0.0, 1.0); + + output.worldPos = TransformObjectToWorld(inputMesh.vertex.xyz).xyz; + + // Normal is required for triplanar mapping + output.worldNormal = TransformObjectToWorldNormal(inputMesh.normal); + // Not required but assign to silent compiler warning + output.worldTangent = float4(1.0, 0.0, 0.0, 0.0); + + output.texcoord0 = inputMesh.texcoord0; + output.texcoord1 = inputMesh.texcoord1; + output.texcoord2 = inputMesh.texcoord2; + // #if %TEXCOORD3REQUIREKEY% + output.texcoord3 = inputMesh.texcoord3; + // #endif + // #if %VERTEXCOLORREQUIREKEY% + output.vertexColor = inputMesh.vertexColor; + // #endif + + return output; + } +#else + + #if (_PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR))) + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/ShaderVariablesMatrixDefsHDCamera.hlsl" + + void MotionVectorPositionZBias(VertexToPixel input) + { + #if UNITY_REVERSED_Z + input.pos.z -= unity_MotionVectorsParams.z * input.pos.w; + #else + input.pos.z += unity_MotionVectorsParams.z * input.pos.w; + #endif + } + + #endif + + VertexToPixel Vert(VertexData input) + { + VertexToPixel output; + ZERO_INITIALIZE(VertexToPixel, output); + + UNITY_SETUP_INSTANCE_ID(input); + UNITY_TRANSFER_INSTANCE_ID(input, output); + UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(output); + + #if _HDRP && (_PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR))) + VertexData previousMesh = input; + #endif + + ChainModifyVertex(input, output, _Time); + + // This return the camera relative position (if enable) + float3 positionRWS = TransformObjectToWorld(input.vertex.xyz); + float3 normalWS = TransformObjectToWorldNormal(input.normal); + float4 tangentWS = float4(TransformObjectToWorldDir(input.tangent.xyz), input.tangent.w); + + + output.worldPos = GetAbsolutePositionWS(positionRWS); + output.pos = TransformWorldToHClip(positionRWS); + output.worldNormal = normalWS; + output.worldTangent = tangentWS; + + + output.texcoord0 = input.texcoord0; + output.texcoord1 = input.texcoord1; + output.texcoord2 = input.texcoord2; + + // #if %TEXCOORD3REQUIREKEY% + output.texcoord3 = input.texcoord3; + // #endif + + // #if %VERTEXCOLORREQUIREKEY% + output.vertexColor = input.vertexColor; + // #endif + + // #if %SCREENPOSREQUIREKEY% + // output.screenPos = ComputeScreenPos(output.pos, _ProjectionParams.x); + // #endif + + #if _HDRP && (_PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR))) + + #if !defined(TESSELLATION_ON) + MotionVectorPositionZBias(output); + #endif + + output.motionVectorCS = mul(UNITY_MATRIX_UNJITTERED_VP, float4(positionRWS.xyz, 1.0)); + // Note: unity_MotionVectorsParams.y is 0 is forceNoMotion is enabled + bool forceNoMotion = unity_MotionVectorsParams.y == 0.0; + if (forceNoMotion) + { + output.previousPositionCS = float4(0.0, 0.0, 0.0, 1.0); + } + else + { + bool hasDeformation = unity_MotionVectorsParams.x > 0.0; // Skin or morph target + + float3 effectivePositionOS = (hasDeformation ? previousMesh.previousPositionOS : previousMesh.vertex.xyz); + #if defined(_ADD_PRECOMPUTED_VELOCITY) + effectivePositionOS -= input.precomputedVelocity; + #endif + + previousMesh.vertex = float4(effectivePositionOS, 1); + VertexToPixel dummy = (VertexToPixel)0; + + + ChainModifyVertex(previousMesh, dummy, _LastTimeParameters); + + // we might need this for skinned objects? + //float3 normalWS = TransformPreviousObjectToWorldNormal(input.normal).xyz; + float3 previousPositionRWS = TransformPreviousObjectToWorld(previousMesh.vertex.xyz); + + #ifdef _WRITE_TRANSPARENT_MOTION_VECTOR + if (_TransparentCameraOnlyMotionVectors > 0) + { + previousPositionRWS = positionRWS.xyz; + } + #endif // _WRITE_TRANSPARENT_MOTION_VECTOR + + output.previousPositionCS = mul(UNITY_MATRIX_PREV_VP, float4(previousPositionRWS, 1.0)); + } + #endif // _HDRP && _PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR)) + + + return output; + } + + +#endif + + + + + + + + #if defined(WRITE_DECAL_BUFFER) && !defined(_DISABLE_DECALS) + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/Decal/DecalPrepassBuffer.hlsl" + #endif + + FragInputs BuildFragInputs(VertexToPixel input) + { + UNITY_SETUP_INSTANCE_ID(input); + FragInputs output; + ZERO_INITIALIZE(FragInputs, output); + + // Init to some default value to make the computer quiet (else it output 'divide by zero' warning even if value is not used). + // TODO: this is a really poor workaround, but the variable is used in a bunch of places + // to compute normals which are then passed on elsewhere to compute other values... + output.tangentToWorld = k_identity3x3; + output.positionSS = input.pos; // input.positionCS is SV_Position + // BETTER SHADERS: because we transform world position into actual world space for things like + // triplanar, etc, we have to back transform it here for lighting + output.positionRWS = GetCameraRelativePositionWS(input.worldPos); + output.tangentToWorld = BuildTangentToWorld(input.worldTangent, input.worldNormal); + output.texCoord0 = input.texcoord0; + output.texCoord1 = input.texcoord1; + output.texCoord2 = input.texcoord2; + + return output; + } + +#if UNITY_VERSION > UNITY_2022_3_12 + void ApplyDecalAndGetNormal(FragInputs fragInputs, PositionInputs posInput, Surface surfaceDescription, float3 normalTS, + inout SurfaceData surfaceData) + { + float3 doubleSidedConstants = GetDoubleSidedConstants(); + + #ifdef DECAL_NORMAL_BLENDING + // SG nodes don't ouptut surface gradients, so if decals require surf grad blending, we have to convert + // the normal to gradient before applying the decal. We then have to resolve the gradient back to world space + normalTS = SurfaceGradientFromTangentSpaceNormalAndFromTBN(normalTS, + fragInputs.tangentToWorld[0], fragInputs.tangentToWorld[1]); + + + #if HAVE_DECALS + if (_EnableDecals) + { + float alpha = 1.0; + alpha = surfaceDescription.Alpha; + + DecalSurfaceData decalSurfaceData = GetDecalSurfaceData(posInput, fragInputs, alpha); + ApplyDecalToSurfaceNormal(decalSurfaceData, fragInputs.tangentToWorld[2], normalTS); + ApplyDecalToSurfaceDataNoNormal(decalSurfaceData, surfaceData); + } + #endif + + GetNormalWS_SG(fragInputs, normalTS, surfaceData.normalWS, doubleSidedConstants); + #else + // normal delivered to master node + + #if HAVE_DECALS + if (_EnableDecals) + { + float alpha = 1.0; + alpha = surfaceDescription.Alpha; + + // Both uses and modifies 'surfaceData.normalWS'. + DecalSurfaceData decalSurfaceData = GetDecalSurfaceData(posInput, fragInputs, alpha); + ApplyDecalToSurfaceNormal(decalSurfaceData, surfaceData.normalWS.xyz); + ApplyDecalToSurfaceDataNoNormal(decalSurfaceData, surfaceData); + } + #endif + #endif + } +#endif + + void BuildSurfaceData(FragInputs fragInputs, inout Surface surfaceDescription, float3 V, PositionInputs posInput, out SurfaceData surfaceData, out float3 bentNormalWS) + { + // setup defaults -- these are used if the graph doesn't output a value + ZERO_INITIALIZE(SurfaceData, surfaceData); + + // specularOcclusion need to be init ahead of decal to quiet the compiler that modify the SurfaceData struct + // however specularOcclusion can come from the graph, so need to be init here so it can be override. + surfaceData.specularOcclusion = 1.0; + + // copy across graph values, if defined + surfaceData.baseColor = surfaceDescription.Albedo; + surfaceData.perceptualSmoothness = surfaceDescription.Smoothness; + surfaceData.ambientOcclusion = surfaceDescription.Occlusion; + surfaceData.specularOcclusion = surfaceDescription.SpecularOcclusion; + surfaceData.metallic = surfaceDescription.Metallic; + surfaceData.subsurfaceMask = surfaceDescription.SubsurfaceMask; + surfaceData.thickness = surfaceDescription.Thickness; + surfaceData.diffusionProfileHash = asuint(surfaceDescription.DiffusionProfileHash); + #if _USESPECULAR + surfaceData.specularColor = surfaceDescription.Specular; + #endif + surfaceData.coatMask = surfaceDescription.CoatMask; + surfaceData.anisotropy = surfaceDescription.Anisotropy; + surfaceData.iridescenceMask = surfaceDescription.IridescenceMask; + surfaceData.iridescenceThickness = surfaceDescription.IridescenceThickness; + + + + #if defined(_REFRACTION_PLANE) || defined(_REFRACTION_SPHERE) || defined(_REFRACTION_THIN) + if (_EnableSSRefraction) + { + surfaceData.transmittanceMask = (1.0 - surfaceDescription.Alpha); + surfaceDescription.Alpha = 1.0; + } + else + { + surfaceData.ior = surfaceDescription.ior; + surfaceData.transmittanceColor = surfaceDescription.transmittanceColor; + surfaceData.atDistance = surfaceDescription.atDistance; + surfaceData.transmittanceMask = surfaceDescription.transmittanceMask; + surfaceDescription.Alpha = 1.0; + } + #else + surfaceData.ior = 1.0; + surfaceData.transmittanceColor = float3(1.0, 1.0, 1.0); + surfaceData.atDistance = 1.0; + surfaceData.transmittanceMask = 0.0; + #endif + + + + // These static material feature allow compile time optimization + surfaceData.materialFeatures = MATERIALFEATUREFLAGS_LIT_STANDARD; + #ifdef _MATERIAL_FEATURE_SUBSURFACE_SCATTERING + surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_SUBSURFACE_SCATTERING; + #endif + + #ifdef _MATERIAL_FEATURE_TRANSMISSION + surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_TRANSMISSION; + #endif + + #ifdef _MATERIAL_FEATURE_ANISOTROPY + surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_ANISOTROPY; + surfaceData.normalWS = float3(0, 1, 0); + #endif + + #ifdef _MATERIAL_FEATURE_IRIDESCENCE + surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_IRIDESCENCE; + #endif + + #ifdef _MATERIAL_FEATURE_SPECULAR_COLOR + surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_SPECULAR_COLOR; + #endif + + #if defined(_MATERIAL_FEATURE_CLEAR_COAT) || _CLEARCOAT + surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_CLEAR_COAT; + #endif + + #if defined (_MATERIAL_FEATURE_SPECULAR_COLOR) && defined (_ENERGY_CONSERVING_SPECULAR) + // Require to have setup baseColor + // Reproduce the energy conservation done in legacy Unity. Not ideal but better for compatibility and users can unchek it + surfaceData.baseColor *= (1.0 - Max3(surfaceData.specularColor.r, surfaceData.specularColor.g, surfaceData.specularColor.b)); + #endif + + float3 normalTS = surfaceDescription.Normal; + #if !_WORLDSPACENORMAL + surfaceData.normalWS = mul(surfaceDescription.Normal, fragInputs.tangentToWorld); + #else + normalTS = mul(fragInputs.tangentToWorld, surfaceDescription.Normal); + surfaceData.normalWS = surfaceDescription.Normal; + #endif + + + #if UNITY_VERSION > UNITY_2022_3_12 + ApplyDecalAndGetNormal(fragInputs, posInput, surfaceDescription, normalTS, surfaceData); + #else + #ifdef DECAL_NORMAL_BLENDING + #if HAVE_DECALS + float alpha = 1.0; + alpha = surfaceDescription.Alpha; + if (_EnableDecals) + { + DecalSurfaceData decalSurfaceData = GetDecalSurfaceData(posInput, fragInputs, alpha); + ApplyDecalToSurfaceData(decalSurfaceData, fragInputs.tangentToWorld[2], surfaceData, normalTS); + } + #endif + #else + #if HAVE_DECALS + if (_EnableDecals) + { + float alpha = 1.0; + alpha = surfaceDescription.Alpha; + // Both uses and modifies 'surfaceData.normalWS'. + DecalSurfaceData decalSurfaceData = GetDecalSurfaceData(posInput, fragInputs, alpha); + ApplyDecalToSurfaceData(decalSurfaceData, fragInputs.tangentToWorld[2], surfaceData); + } + #endif + #endif + #endif + + + + surfaceData.geomNormalWS = fragInputs.tangentToWorld[2]; + + surfaceData.tangentWS = normalize(fragInputs.tangentToWorld[0].xyz); // The tangent is not normalize in tangentToWorld for mikkt. TODO: Check if it expected that we normalize with Morten. Tag: SURFACE_GRADIENT + + + bentNormalWS = surfaceData.normalWS; + + surfaceData.tangentWS = Orthonormalize(surfaceData.tangentWS, surfaceData.normalWS); + + #ifdef DEBUG_DISPLAY + if (_DebugMipMapMode != DEBUGMIPMAPMODE_NONE) + { + // TODO: need to update mip info + surfaceData.metallic = 0; + } + + // We need to call ApplyDebugToSurfaceData after filling the surfarcedata and before filling builtinData + // as it can modify attribute use for static lighting + ApplyDebugToSurfaceData(fragInputs.tangentToWorld, surfaceData); + #endif + + // By default we use the ambient occlusion with Tri-ace trick (apply outside) for specular occlusion. + // If user provide bent normal then we process a better term + #if defined(_SPECULAR_OCCLUSION_CUSTOM) + // Just use the value passed through via the slot (not active otherwise) + #elif defined(_SPECULAR_OCCLUSION_FROM_AO_BENT_NORMAL) + // If we have bent normal and ambient occlusion, process a specular occlusion + surfaceData.specularOcclusion = GetSpecularOcclusionFromBentAO(V, bentNormalWS, surfaceData.normalWS, surfaceData.ambientOcclusion, PerceptualSmoothnessToPerceptualRoughness(surfaceData.perceptualSmoothness)); + #elif defined(_AMBIENT_OCCLUSION) && defined(_SPECULAR_OCCLUSION_FROM_AO) + surfaceData.specularOcclusion = GetSpecularOcclusionFromAmbientOcclusion(ClampNdotV(dot(surfaceData.normalWS, V)), surfaceData.ambientOcclusion, PerceptualSmoothnessToRoughness(surfaceData.perceptualSmoothness)); + #endif + + #if defined(_ENABLE_GEOMETRIC_SPECULAR_AA) && !defined(SHADER_STAGE_RAY_TRACING) + surfaceData.perceptualSmoothness = GeometricNormalFiltering(surfaceData.perceptualSmoothness, fragInputs.tangentToWorld[2], surfaceDescription.SpecularAAScreenSpaceVariance, surfaceDescription.SpecularAAThreshold); + #endif + } + + void GetSurfaceAndBuiltinData(VertexToPixel m2ps, FragInputs fragInputs, float3 V, inout PositionInputs posInput, + out SurfaceData surfaceData, out BuiltinData builtinData, inout Surface l, inout ShaderData d + #if NEED_FACING + , bool facing + #endif + ) + { + // Removed since crossfade does not work, probably needs extra material setup. + //#if !defined(SHADER_STAGE_RAY_TRACING) && !defined(_TESSELLATION_DISPLACEMENT) + // #ifdef LOD_FADE_CROSSFADE // enable dithering LOD transition if user select CrossFade transition in LOD group + // LODDitheringTransition(ComputeFadeMaskSeed(V, posInput.positionSS), unity_LODFade.x); + // #endif + //#endif + + + + + d = CreateShaderData(m2ps + #if NEED_FACING + , facing + #endif + ); + + l = (Surface)0; + + l.Albedo = half3(0.5, 0.5, 0.5); + l.Normal = float3(0,0,1); + l.Occlusion = 1; + l.Alpha = 1; + l.SpecularOcclusion = 1; + + #if !defined(SHADER_STAGE_RAY_TRACING) && defined(_DEPTHOFFSET_ON) + l.outputDepth = d.clipPos.z; + #endif + + ChainSurfaceFunction(l, d); + + #if !defined(SHADER_STAGE_RAY_TRACING) && defined(_DEPTHOFFSET_ON) + posInput.deviceDepth = l.outputDepth; + #endif + + #if _UNLIT + //l.Emission = l.Albedo; + //l.Albedo = 0; + l.Normal = half3(0,0,1); + l.Occlusion = 1; + l.Metallic = 0; + l.Specular = 0; + #endif + + surfaceData.geomNormalWS = d.worldSpaceNormal; + surfaceData.tangentWS = d.worldSpaceTangent; + fragInputs.tangentToWorld = d.TBNMatrix; + + float3 bentNormalWS; + + BuildSurfaceData(fragInputs, l, V, posInput, surfaceData, bentNormalWS); + + + float4 lightmapTexCoord1 = fragInputs.texCoord1; + float4 lightmapTexCoord2 = fragInputs.texCoord2; + //#ifdef FRAG_INPUTS_USE_TEXCOORD1 + // float4 lightmapTexCoord1 = fragInputs.texCoord1; + // #else + // float4 lightmapTexCoord1 = float4(0,0,0,0); + // #endif + + // #ifdef FRAG_INPUTS_USE_TEXCOORD2 + // float4 lightmapTexCoord2 = fragInputs.texCoord2; + // #else + // float4 lightmapTexCoord2 = float4(0,0,0,0); + // #endif + + + InitBuiltinData(posInput, l.Alpha, bentNormalWS, -d.worldSpaceNormal, lightmapTexCoord1, lightmapTexCoord2, builtinData); + + + + builtinData.emissiveColor = l.Emission; + + #if defined(_OVERRIDE_BAKEDGI) + builtinData.bakeDiffuseLighting = l.DiffuseGI; + builtinData.backBakeDiffuseLighting = l.BackDiffuseGI; + builtinData.emissiveColor += l.SpecularGI; + #endif + + #if defined(_OVERRIDE_SHADOWMASK) + builtinData.shadowMask0 = l.ShadowMask.x; + builtinData.shadowMask1 = l.ShadowMask.y; + builtinData.shadowMask2 = l.ShadowMask.z; + builtinData.shadowMask3 = l.ShadowMask.w; + #endif + + #ifdef UNITY_VIRTUAL_TEXTURING + //builtinData.vtPackedFeedback = surfaceData.VTPackedFeedback; + #endif + + #if (SHADERPASS == SHADERPASS_DISTORTION) + builtinData.distortion = surfaceData.Distortion; + builtinData.distortionBlur = surfaceData.DistortionBlur; + #endif + + #ifndef SHADER_UNLIT + // PostInitBuiltinData call ApplyDebugToBuiltinData + PostInitBuiltinData(V, posInput, surfaceData, builtinData); + #else + ApplyDebugToBuiltinData(builtinData); + #endif + + RAY_TRACING_OPTIONAL_ALPHA_TEST_PASS + } + + + +#if defined(WRITE_DECAL_BUFFER) && defined(WRITE_MSAA_DEPTH) +#define SV_TARGET_NORMAL SV_Target3 +#elif defined(WRITE_DECAL_BUFFER) || defined(WRITE_MSAA_DEPTH) +#define SV_TARGET_NORMAL SV_Target2 +#else +#define SV_TARGET_NORMAL SV_Target1 +#endif + +// Caution: Motion vector pass is different from Depth prepass, it render normal buffer last instead of decal buffer last +// and thus, we force a write of 0 if _DISABLE_DECALS so we always write in the decal buffer. +// This is required as we can't make distinction between deferred (write normal buffer) and forward (write normal buffer) +// in the context of the motion vector pass. The cost is acceptable as it is only do object with motion vector (usualy skin object) +// that most of the time use Forward Material (so are already writing motion vector data). +// So note that here unlike for depth prepass we don't check && !defined(_DISABLE_DECALS) +void Frag( VertexToPixel v2f + #ifdef WRITE_MSAA_DEPTH + // We need the depth color as SV_Target0 for alpha to coverage + , out float4 depthColor : SV_Target0 + , out float4 outMotionVector : SV_Target1 + #ifdef WRITE_DECAL_BUFFER + , out float4 outDecalBuffer : SV_Target2 + #endif + #else + // When no MSAA, the motion vector is always the first buffer + , out float4 outMotionVector : SV_Target0 + #ifdef WRITE_DECAL_BUFFER + , out float4 outDecalBuffer : SV_Target1 + #endif + #endif + + // Decal buffer must be last as it is bind but we can optionally write into it (based on _DISABLE_DECALS) + #ifdef WRITE_NORMAL_BUFFER + , out float4 outNormalBuffer : SV_TARGET_NORMAL + #endif + + #ifdef _DEPTHOFFSET_ON + , out float outputDepth : SV_Depth + #endif + #if NEED_FACING + , bool facing : SV_IsFrontFace + #endif + ) + { + + FragInputs input = BuildFragInputs(v2f); + PositionInputs posInput = GetPositionInput(input.positionSS.xy, _ScreenSize.zw, input.positionSS.z, input.positionSS.w, input.positionRWS); + + float3 V = GetWorldSpaceNormalizeViewDir(input.positionRWS); + + + SurfaceData surfaceData; + BuiltinData builtinData; + Surface l; + ShaderData d; + GetSurfaceAndBuiltinData(v2f, input, V, posInput, surfaceData, builtinData, l, d + #if NEED_FACING + , facing + #endif + ); + + #ifdef _DEPTHOFFSET_ON + v2f.motionVectorCS.w += builtinData.depthOffset; + v2f.previousPositionCS.w += builtinData.depthOffset; + #endif + + // TODO: How to allow overriden motion vector from GetSurfaceAndBuiltinData ? + float2 motionVector = CalculateMotionVector(v2f.motionVectorCS, v2f.previousPositionCS); + + // Convert from Clip space (-1..1) to NDC 0..1 space. + // Note it doesn't mean we don't have negative value, we store negative or positive offset in NDC space. + // Note: ((positionCS * 0.5 + 0.5) - (v2f.previousPositionCS * 0.5 + 0.5)) = (motionVector * 0.5) + EncodeMotionVector(motionVector * 0.5, outMotionVector); + + // Note: unity_MotionVectorsParams.y is 0 is forceNoMotion is enabled + bool forceNoMotion = unity_MotionVectorsParams.y == 0.0; + + // Setting the motionVector to a value more than 2 set as a flag for "force no motion". This is valid because, given that the velocities are in NDC, + // a value of >1 can never happen naturally, unless explicitely set. + if (forceNoMotion) + outMotionVector = float4(2.0, 0.0, 0.0, 0.0); + + // Depth and Alpha to coverage + #ifdef WRITE_MSAA_DEPTH + // In case we are rendering in MSAA, reading the an MSAA depth buffer is way too expensive. To avoid that, we export the depth to a color buffer + depthColor = v2f.pos.z; + + #ifdef _ALPHATOMASK_ON + // Alpha channel is used for alpha to coverage + depthColor.a = SharpenAlpha(builtinData.opacity, builtinData.alphaClipTreshold); + #endif + #endif + + // Normal Buffer Processing + #ifdef WRITE_NORMAL_BUFFER + EncodeIntoNormalBuffer(ConvertSurfaceDataToNormalData(surfaceData), outNormalBuffer); + #endif + + #if defined(WRITE_DECAL_BUFFER) + DecalPrepassData decalPrepassData; + // Force a write in decal buffer even if decal is disab. This is a neutral value which have no impact for later pass + #ifdef _DISABLE_DECALS + ZERO_INITIALIZE(DecalPrepassData, decalPrepassData); + #else + // We don't have the right to access SurfaceData in a shaderpass. + // However it would be painful to have to add a function like ConvertSurfaceDataToDecalPrepassData() to every Material to return geomNormalWS anyway + // Here we will put the constrain that any Material requiring to support Decal, will need to have geomNormalWS as member of surfaceData (and we already require normalWS anyway) + decalPrepassData.geomNormalWS = surfaceData.geomNormalWS; + decalPrepassData.renderingLayerMask = GetMeshRenderingLayerMask(); + #endif + EncodeIntoDecalPrepassBuffer(decalPrepassData, outDecalBuffer); + outDecalBuffer.w = (GetMeshRenderingLayerMask() & 0x000000FF) / 255.0; + #endif + + #ifdef _DEPTHOFFSET_ON + outputDepth = posInput.deviceDepth; + #endif + } + + ENDHLSL + } + + + Pass + { + Name "FullScreenDebug" + Tags + { + "LightMode" = "FullScreenDebug" + } + + // Render State + Cull Back + ZTest LEqual + ZWrite Off + + //------------------------------------------------------------------------------------- + // End Render Modes + //------------------------------------------------------------------------------------- + + HLSLPROGRAM + + #pragma target 4.5 + #pragma only_renderers d3d11 playstation xboxone xboxseries vulkan metal switch + + + + //#pragma shader_feature _ _SURFACE_TYPE_TRANSPARENT + //#pragma shader_feature_local _BLENDMODE_OFF _BLENDMODE_ALPHA _BLENDMODE_ADD _BLENDMODE_PRE_MULTIPLY + //#pragma shader_feature_local _ _ADD_PRECOMPUTED_VELOCITY + //#pragma shader_feature_local _ _TRANSPARENT_WRITES_MOTION_VEC + //#pragma shader_feature_local _ _ENABLE_FOG_ON_TRANSPARENT + //#pragma shader_feature_local _ _DISABLE_DECALS + //#pragma shader_feature_local _ _DISABLE_SSR + //#pragma shader_feature_local _ _DISABLE_SSR_TRANSPARENT + //#pragma shader_feature_local _REFRACTION_OFF _REFRACTION_PLANE _REFRACTION_SPHERE _REFRACTION_THIN + #pragma multi_compile _ LOD_FADE_CROSSFADE + + + #define SHADERPASS SHADERPASS_FULL_SCREEN_DEBUG + #define _PASSFULLSCREENDEBUG 1 + + + #pragma shader_feature_local GLOW_ON + #pragma shader_feature_local FADE_ON + #pragma shader_feature_local OUTBASE_ON + #pragma shader_feature_local ONLYOUTLINE_ON + #pragma shader_feature_local GRADIENT_ON + #pragma shader_feature_local GRADIENT2COL_ON + #pragma shader_feature_local RADIALGRADIENT_ON + #pragma shader_feature_local COLORSWAP_ON + #pragma shader_feature_local HSV_ON + #pragma shader_feature_local CHANGECOLOR_ON + #pragma shader_feature_local CHANGECOLOR2_ON + #pragma shader_feature_local CHANGECOLOR3_ON + #pragma shader_feature_local COLORRAMP_ON + #pragma shader_feature_local GRADIENTCOLORRAMP_ON + #pragma shader_feature_local HITEFFECT_ON + #pragma shader_feature_local NEGATIVE_ON + #pragma shader_feature_local PIXELATE_ON + #pragma shader_feature_local GREYSCALE_ON + #pragma shader_feature_local POSTERIZE_ON + #pragma shader_feature_local BLUR_ON + #pragma shader_feature_local MOTIONBLUR_ON + #pragma shader_feature_local GHOST_ON + #pragma shader_feature_local ALPHAOUTLINE_ON + #pragma shader_feature_local INNEROUTLINE_ON + #pragma shader_feature_local ONLYINNEROUTLINE_ON + #pragma shader_feature_local HOLOGRAM_ON + #pragma shader_feature_local CHROMABERR_ON + #pragma shader_feature_local GLITCH_ON + #pragma shader_feature_local FLICKER_ON + #pragma shader_feature_local SHADOW_ON + #pragma shader_feature_local SHINE_ON + #pragma shader_feature_local CONTRAST_ON + #pragma shader_feature_local OVERLAY_ON + #pragma shader_feature_local OVERLAYMULT_ON + #pragma shader_feature_local DOODLE_ON + #pragma shader_feature_local WIND_ON + #pragma shader_feature_local WAVEUV_ON + #pragma shader_feature_local ROUNDWAVEUV_ON + #pragma shader_feature_local RECTSIZE_ON + #pragma shader_feature_local OFFSETUV_ON + #pragma shader_feature_local CLIPPING_ON + #pragma shader_feature_local RADIALCLIPPING_ON + #pragma shader_feature_local TEXTURESCROLL_ON + #pragma shader_feature_local ZOOMUV_ON + #pragma shader_feature_local DISTORT_ON + #pragma shader_feature_local WARP_ON + #pragma shader_feature_local TWISTUV_ON + #pragma shader_feature_local ROTATEUV_ON + #pragma shader_feature_local POLARUV_ON + #pragma shader_feature_local FISHEYE_ON + #pragma shader_feature_local PINCH_ON + #pragma shader_feature_local SHAKEUV_ON + + #pragma shader_feature_local GLOWTEX_ON + #pragma shader_feature_local OUTTEX_ON + #pragma shader_feature_local OUTDIST_ON + #pragma shader_feature_local OUTBASE8DIR_ON + #pragma shader_feature_local OUTBASEPIXELPERF_ON + #pragma shader_feature_local COLORRAMPOUTLINE_ON + #pragma shader_feature_local GREYSCALEOUTLINE_ON + #pragma shader_feature_local POSTERIZEOUTLINE_ON + #pragma shader_feature_local BLURISHD_ON + #pragma shader_feature_local MANUALWIND_ON + #pragma shader_feature_local ATLAS_ON + #pragma shader_feature_local PREMULTIPLYALPHA_ON + + #pragma shader_feature BILBOARD_ON + #pragma shader_feature BILBOARDY_ON + + #pragma shader_feature NORMALMAP_ON + + + #define _HDRP 1 +#define _USINGTEXCOORD1 1 +#define _USINGTEXCOORD2 1 + + + #pragma vertex Vert + #pragma fragment Frag + + // useful conversion functions to make surface shader code just work + + #define UNITY_DECLARE_TEX2D(name) TEXTURE2D(name); SAMPLER(sampler##name); + #define UNITY_DECLARE_TEX2D_NOSAMPLER(name) TEXTURE2D(name); + #define UNITY_DECLARE_TEX2DARRAY(name) TEXTURE2D_ARRAY(name); SAMPLER(sampler##name); + #define UNITY_DECLARE_TEX2DARRAY_NOSAMPLER(tex) TEXTURE2D_ARRAY(tex); + + #define UNITY_SAMPLE_TEX2DARRAY(tex,coord) SAMPLE_TEXTURE2D_ARRAY(tex, sampler##tex, coord.xy, coord.z) + #define UNITY_SAMPLE_TEX2DARRAY_LOD(tex,coord,lod) SAMPLE_TEXTURE2D_ARRAY_LOD(tex, sampler##tex, coord.xy, coord.z, lod) + #define UNITY_SAMPLE_TEX2D(tex, coord) SAMPLE_TEXTURE2D(tex, sampler##tex, coord) + #define UNITY_SAMPLE_TEX2D_SAMPLER(tex, samp, coord) SAMPLE_TEXTURE2D(tex, sampler##samp, coord) + + #define UNITY_SAMPLE_TEX2D_LOD(tex,coord, lod) SAMPLE_TEXTURE2D_LOD(tex, sampler_##tex, coord, lod) + #define UNITY_SAMPLE_TEX2D_SAMPLER_LOD(tex,samplertex,coord, lod) SAMPLE_TEXTURE2D_LOD (tex, sampler##samplertex,coord, lod) + + #if defined(UNITY_COMPILER_HLSL) + #define UNITY_INITIALIZE_OUTPUT(type,name) name = (type)0; + #else + #define UNITY_INITIALIZE_OUTPUT(type,name) + #endif + + #define sampler2D_float sampler2D + #define sampler2D_half sampler2D + + #undef WorldNormalVector + #define WorldNormalVector(data, normal) mul(normal, data.TBNMatrix) + + #define UnityObjectToWorldNormal(normal) mul(GetObjectToWorldMatrix(), normal) + + #ifndef SHADER_STAGE_FRAGMENT + #if !defined(SHADOW_ULTRA_LOW) && !defined(SHADOW_LOW) && !defined(SHADOW_MEDIUM) && !defined(SHADOW_HIGH) // ultra low come from volumetricLighting.compute + #define SHADOW_MEDIUM + #endif + #if !defined(AREA_SHADOW_LOW) && !defined(AREA_SHADOW_MEDIUM) && !defined(AREA_SHADOW_HIGH) // low come from volumetricLighting.compute + #define AREA_SHADOW_MEDIUM + #endif + #endif + + + +// HDRP Adapter stuff + #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Common.hlsl" + #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Common.hlsl" + #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/GeometricTools.hlsl" // Required by Tessellation.hlsl + #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Tessellation.hlsl" + #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Texture.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/ShaderVariables.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/ShaderPass/ShaderPass.cs.hlsl" + #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/TextureStack.hlsl" // Required to be include before we include properties as it define DECLARE_STACK_CB + #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/DebugMipmapStreamingMacros.hlsl" // Required before including properties as it defines UNITY_TEXTURE_STREAMING_DEBUG_VARS + // Always include Shader Graph version + // Always include last to avoid double macros + #include "Packages/com.unity.shadergraph/ShaderGraphLibrary/Functions.hlsl" // Need to be here for Gradient struct definition + + +#include "Packages/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/ShaderPass/FragInputs.hlsl" + + + + #ifdef RAYTRACING_SHADER_GRAPH_DEFAULT + #define RAYTRACING_SHADER_GRAPH_HIGH + #endif + + #ifdef RAYTRACING_SHADER_GRAPH_RAYTRACED + #define RAYTRACING_SHADER_GRAPH_LOW + #endif + // end + + + + + // If we use subsurface scattering, enable output split lighting (for forward pass) + #if defined(_MATERIAL_FEATURE_SUBSURFACE_SCATTERING) && !defined(_SURFACE_TYPE_TRANSPARENT) + #define OUTPUT_SPLIT_LIGHTING + #endif + + #define HAVE_RECURSIVE_RENDERING + + #if SHADERPASS == SHADERPASS_TRANSPARENT_DEPTH_PREPASS + #if !defined(_DISABLE_SSR_TRANSPARENT) && !defined(SHADER_UNLIT) + #define WRITE_NORMAL_BUFFER + #endif + #endif + + #ifndef DEBUG_DISPLAY + // In case of opaque we don't want to perform the alpha test, it is done in depth prepass and we use depth equal for ztest (setup from UI) + // Don't do it with debug display mode as it is possible there is no depth prepass in this case + #if !defined(_SURFACE_TYPE_TRANSPARENT) && defined(_ALPHATEST) + #if SHADERPASS == SHADERPASS_FORWARD + #define SHADERPASS_FORWARD_BYPASS_ALPHA_TEST + #elif SHADERPASS == SHADERPASS_GBUFFER + #define SHADERPASS_GBUFFER_BYPASS_ALPHA_TEST + #endif + #endif + #endif + + // Define _DEFERRED_CAPABLE_MATERIAL for shader capable to run in deferred pass + #if defined(SHADER_LIT) && !defined(_SURFACE_TYPE_TRANSPARENT) + #define _DEFERRED_CAPABLE_MATERIAL + #endif + + // Translate transparent motion vector define + #if defined(_TRANSPARENT_WRITES_MOTION_VEC) && defined(_SURFACE_TYPE_TRANSPARENT) + #define _WRITE_TRANSPARENT_MOTION_VECTOR + #endif + + + + + CBUFFER_START(UnityPerMaterial) + float _UseShadowThreshold; + float _BlendMode; + float _EnableBlendModePreserveSpecularLighting; + float _RayTracing; + float _RefractionModel; + + + half4 _Color; + half4 _MainTex_ST, _MainTex_TexelSize; + half _Alpha, _AlphaCutoffValue; + + #if ATLAS_ON + half _MinXUV, _MaxXUV, _MinYUV, _MaxYUV; + #endif + + #if GLOW_ON + half4 _GlowColor; + half _Glow, _GlowGlobal; + #endif + + #if HSV_ON + half _HsvShift, _HsvSaturation, _HsvBright; + #endif + + #if DISTORT_ON + half4 _DistortTex_ST; + half _DistortTexXSpeed, _DistortTexYSpeed, _DistortAmount; + #endif + + #if FADE_ON + half4 _FadeBurnColor, _FadeTex_ST, _FadeBurnTex_ST; + half _FadeAmount, _FadeBurnWidth, _FadeBurnTransition,_FadeBurnGlow; + #endif + + #if OUTBASE_ON + half4 _OutlineColor; + half _OutlineAlpha, _OutlineGlow, _OutlineWidth; + int _OutlinePixelWidth; + #endif + + #if OUTTEX_ON + half4 _OutlineTex_ST; + half _OutlineTexXSpeed, _OutlineTexYSpeed; + #endif + + #if OUTDIST_ON + half4 _OutlineDistortTex_ST; + half _OutlineDistortTexXSpeed, _OutlineDistortTexYSpeed, _OutlineDistortAmount; + #endif + + #if ALPHAOUTLINE_ON + half _AlphaOutlineGlow, _AlphaOutlinePower, _AlphaOutlineMinAlpha, _AlphaOutlineBlend; + half4 _AlphaOutlineColor; + #endif + + #if INNEROUTLINE_ON + half _InnerOutlineThickness, _InnerOutlineAlpha, _InnerOutlineGlow; + half4 _InnerOutlineColor; + #endif + + #if GRADIENT_ON + half _GradBlend, _GradBoostX, _GradBoostY; + half4 _GradTopRightCol, _GradTopLeftCol, _GradBotRightCol, _GradBotLeftCol; + #endif + + #if COLORSWAP_ON + half4 _ColorSwapRed, _ColorSwapGreen, _ColorSwapBlue; + half _ColorSwapRedLuminosity, _ColorSwapGreenLuminosity, _ColorSwapBlueLuminosity, _ColorSwapBlend; + #endif + + #if CHANGECOLOR_ON + half4 _ColorChangeNewCol, _ColorChangeTarget; + half _ColorChangeTolerance, _ColorChangeLuminosity; + #endif + #if CHANGECOLOR2_ON + half4 _ColorChangeNewCol2, _ColorChangeTarget2; + half _ColorChangeTolerance2; + #endif + #if CHANGECOLOR3_ON + half4 _ColorChangeNewCol3, _ColorChangeTarget3; + half _ColorChangeTolerance3; + #endif + + #if COLORRAMP_ON + half _ColorRampLuminosity, _ColorRampBlend; + #endif + + #if HITEFFECT_ON + half4 _HitEffectColor; + half _HitEffectGlow, _HitEffectBlend; + #endif + + #if NEGATIVE_ON + half _NegativeAmount; + #endif + + #if PIXELATE_ON + half _PixelateSize; + #endif + + #if GREYSCALE_ON + half _GreyscaleLuminosity, _GreyscaleBlend; + half4 _GreyscaleTintColor; + #endif + + #if POSTERIZE_ON + half _PosterizeNumColors, _PosterizeGamma; + #endif + + #if BLUR_ON + half _BlurIntensity; + #endif + + #if MOTIONBLUR_ON + half _MotionBlurAngle, _MotionBlurDist; + #endif + + #if GHOST_ON + half _GhostColorBoost, _GhostTransparency, _GhostBlend; + #endif + + #if HOLOGRAM_ON + half _HologramStripesAmount, _HologramMinAlpha, _HologramUnmodAmount, _HologramStripesSpeed, _HologramMaxAlpha, _HologramBlend; + half4 _HologramStripeColor; + #endif + + #if CHROMABERR_ON + half _ChromAberrAmount, _ChromAberrAlpha; + #endif + + #if GLITCH_ON + half _GlitchAmount, _GlitchSize; + #endif + + #if FLICKER_ON + half _FlickerFreq, _FlickerPercent, _FlickerAlpha; + #endif + + #if SHADOW_ON + half _ShadowX, _ShadowY, _ShadowAlpha; + half4 _ShadowColor; + #endif + + #if SHINE_ON + half4 _ShineColor; + half _ShineLocation, _ShineRotate, _ShineWidth, _ShineGlow; + #endif + + #if CONTRAST_ON + half _Contrast, _Brightness; + #endif + + #if OVERLAY_ON + half4 _OverlayTex_ST, _OverlayColor; + half _OverlayGlow, _OverlayBlend, _OverlayTextureScrollXSpeed, _OverlayTextureScrollYSpeed; + #endif + + #if DOODLE_ON + half _HandDrawnAmount, _HandDrawnSpeed; + #endif + + #if WIND_ON + half _GrassSpeed, _GrassWind, _GrassManualAnim, _GrassRadialBend; + #endif + + #if WAVEUV_ON + float _WaveAmount, _WaveSpeed, _WaveStrength, _WaveX, _WaveY; + #endif + + #if ROUNDWAVEUV_ON + half _RoundWaveStrength, _RoundWaveSpeed; + #endif + + #if RECTSIZE_ON + half _RectSize; + #endif + + #if OFFSETUV_ON + half _OffsetUvX, _OffsetUvY; + #endif + + #if CLIPPING_ON + half _ClipUvLeft, _ClipUvRight, _ClipUvUp, _ClipUvDown; + #endif + + #if RADIALCLIPPING_ON + half _RadialStartAngle, _RadialClip, _RadialClip2; + #endif + + #if TEXTURESCROLL_ON + half _TextureScrollXSpeed, _TextureScrollYSpeed; + #endif + + #if ZOOMUV_ON + half _ZoomUvAmount; + #endif + + #if WARP_ON + half _WarpStrength, _WarpSpeed, _WarpScale; + #endif + + #if TWISTUV_ON + half _TwistUvAmount, _TwistUvPosX, _TwistUvPosY, _TwistUvRadius; + #endif + + #if ROTATEUV_ON + half _RotateUvAmount; + #endif + + #if FISHEYE_ON + half _FishEyeUvAmount; + #endif + + #if PINCH_ON + half _PinchUvAmount; + #endif + + #if SHAKEUV_ON + half _ShakeUvSpeed, _ShakeUvX, _ShakeUvY; + #endif + + #if NORMALMAP_ON + half _NormalStrength; + #endif + + float _RandomSeed; + + + + + CBUFFER_END + + + + // -- Property used by ScenePickingPass + #ifdef SCENEPICKINGPASS + float4 _SelectionID; + #endif + + // -- Properties used by SceneSelectionPass + #ifdef SCENESELECTIONPASS + int _ObjectId; + int _PassValue; + #endif + + + // data across stages, stripped like the above. + struct VertexToPixel + { + float4 pos : SV_POSITION; + float3 worldPos : TEXCOORD0; + float3 worldNormal : TEXCOORD1; + float4 worldTangent : TEXCOORD2; + float4 texcoord0 : TEXCOORD3; + float4 texcoord1 : TEXCOORD4; + float4 texcoord2 : TEXCOORD5; + // #if %TEXCOORD3REQUIREKEY% + float4 texcoord3 : TEXCOORD6; + // #endif + + // #if %SCREENPOSREQUIREKEY% + // float4 screenPos : TEXCOORD7; + // #endif + + // #if %VERTEXCOLORREQUIREKEY% + float4 vertexColor : COLOR; + // #endif + + // #if %EXTRAV2F0REQUIREKEY% + // float4 extraV2F0 : TEXCOORD8; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // float4 extraV2F1 : TEXCOORD9; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // float4 extraV2F2 : TEXCOORD10; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // float4 extraV2F3 : TEXCOORD11; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // float4 extraV2F4 : TEXCOORD12; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // float4 extraV2F5 : TEXCOORD13; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // float4 extraV2F6 : TEXCOORD14; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // float4 extraV2F7 : TEXCOORD15; + // #endif + + #if UNITY_ANY_INSTANCING_ENABLED + UNITY_VERTEX_INPUT_INSTANCE_ID + #endif // UNITY_ANY_INSTANCING_ENABLED + + #if _HDRP && (_PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR))) + float4 previousPositionCS : TEXCOORD16; // Contain previous transform position (in case of skinning for example) + float4 motionVectorCS : TEXCOORD17; + #endif + + UNITY_VERTEX_OUTPUT_STEREO + }; + + + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Debug/DebugDisplay.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/Material.hlsl" + #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/NormalSurfaceGradient.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/Lit/Lit.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/BuiltinUtilities.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/MaterialUtilities.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/ShaderGraphFunctions.hlsl" + + + + + // data describing the user output of a pixel + struct Surface + { + half3 Albedo; + half Height; + half3 Normal; + half Smoothness; + half3 Emission; + half Metallic; + half3 Specular; + half Occlusion; + half SpecularPower; // for simple lighting + half Alpha; + float outputDepth; // if written, SV_Depth semantic is used. ShaderData.clipPos.z is unused value + // HDRP Only + half SpecularOcclusion; + half SubsurfaceMask; + half Thickness; + half CoatMask; + half CoatSmoothness; + half Anisotropy; + half IridescenceMask; + half IridescenceThickness; + int DiffusionProfileHash; + float SpecularAAThreshold; + float SpecularAAScreenSpaceVariance; + // requires _OVERRIDE_BAKEDGI to be defined, but is mapped in all pipelines + float3 DiffuseGI; + float3 BackDiffuseGI; + float3 SpecularGI; + float ior; + float3 transmittanceColor; + float atDistance; + float transmittanceMask; + // requires _OVERRIDE_SHADOWMASK to be defines + float4 ShadowMask; + + // for decals + float NormalAlpha; + float MAOSAlpha; + + + }; + + // Data the user declares in blackboard blocks + struct Blackboard + { + + float blackboardDummyData; + }; + + // data the user might need, this will grow to be big. But easy to strip + struct ShaderData + { + float4 clipPos; // SV_POSITION + float3 localSpacePosition; + float3 localSpaceNormal; + float3 localSpaceTangent; + + float3 worldSpacePosition; + float3 worldSpaceNormal; + float3 worldSpaceTangent; + float tangentSign; + + float3 worldSpaceViewDir; + float3 tangentSpaceViewDir; + + float4 texcoord0; + float4 texcoord1; + float4 texcoord2; + float4 texcoord3; + + float2 screenUV; + float4 screenPos; + + float4 vertexColor; + bool isFrontFace; + + float4 extraV2F0; + float4 extraV2F1; + float4 extraV2F2; + float4 extraV2F3; + float4 extraV2F4; + float4 extraV2F5; + float4 extraV2F6; + float4 extraV2F7; + + float3x3 TBNMatrix; + Blackboard blackboard; + }; + + struct VertexData + { + #if SHADER_TARGET > 30 + // uint vertexID : SV_VertexID; + #endif + float4 vertex : POSITION; + float3 normal : NORMAL; + float4 tangent : TANGENT; + float4 texcoord0 : TEXCOORD0; + + // optimize out mesh coords when not in use by user or lighting system + #if _URP && (_USINGTEXCOORD1 || _PASSMETA || _PASSFORWARD || _PASSGBUFFER) + float4 texcoord1 : TEXCOORD1; + #endif + + #if _URP && (_USINGTEXCOORD2 || _PASSMETA || ((_PASSFORWARD || _PASSGBUFFER) && defined(DYNAMICLIGHTMAP_ON))) + float4 texcoord2 : TEXCOORD2; + #endif + + #if _STANDARD && (_USINGTEXCOORD1 || (_PASSMETA || ((_PASSFORWARD || _PASSGBUFFER || _PASSFORWARDADD) && LIGHTMAP_ON))) + float4 texcoord1 : TEXCOORD1; + #endif + #if _STANDARD && (_USINGTEXCOORD2 || (_PASSMETA || ((_PASSFORWARD || _PASSGBUFFER) && DYNAMICLIGHTMAP_ON))) + float4 texcoord2 : TEXCOORD2; + #endif + + + #if _HDRP + float4 texcoord1 : TEXCOORD1; + float4 texcoord2 : TEXCOORD2; + #endif + + // #if %TEXCOORD3REQUIREKEY% + float4 texcoord3 : TEXCOORD3; + // #endif + + // #if %VERTEXCOLORREQUIREKEY% + float4 vertexColor : COLOR; + // #endif + + #if _PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR)) + float3 previousPositionOS : TEXCOORD4; // Contain previous transform position (in case of skinning for example) + #if defined (_ADD_PRECOMPUTED_VELOCITY) + float3 precomputedVelocity : TEXCOORD5; // Add Precomputed Velocity (Alembic computes velocities on runtime side). + #endif + #endif + + UNITY_VERTEX_INPUT_INSTANCE_ID + }; + + struct TessVertex + { + float4 vertex : INTERNALTESSPOS; + float3 normal : NORMAL; + float4 tangent : TANGENT; + float4 texcoord0 : TEXCOORD0; + float4 texcoord1 : TEXCOORD1; + float4 texcoord2 : TEXCOORD2; + + // #if %TEXCOORD3REQUIREKEY% + float4 texcoord3 : TEXCOORD3; + // #endif + + // #if %VERTEXCOLORREQUIREKEY% + float4 vertexColor : COLOR; + // #endif + + // #if %EXTRAV2F0REQUIREKEY% + // float4 extraV2F0 : TEXCOORD5; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // float4 extraV2F1 : TEXCOORD6; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // float4 extraV2F2 : TEXCOORD7; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // float4 extraV2F3 : TEXCOORD8; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // float4 extraV2F4 : TEXCOORD9; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // float4 extraV2F5 : TEXCOORD10; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // float4 extraV2F6 : TEXCOORD11; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // float4 extraV2F7 : TEXCOORD12; + // #endif + + #if _PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR)) + float3 previousPositionOS : TEXCOORD13; // Contain previous transform position (in case of skinning for example) + #if defined (_ADD_PRECOMPUTED_VELOCITY) + float3 precomputedVelocity : TEXCOORD14; + #endif + #endif + + UNITY_VERTEX_INPUT_INSTANCE_ID + UNITY_VERTEX_OUTPUT_STEREO + }; + + struct ExtraV2F + { + float4 extraV2F0; + float4 extraV2F1; + float4 extraV2F2; + float4 extraV2F3; + float4 extraV2F4; + float4 extraV2F5; + float4 extraV2F6; + float4 extraV2F7; + Blackboard blackboard; + float4 time; + }; + + + float3 WorldToTangentSpace(ShaderData d, float3 normal) + { + return mul(d.TBNMatrix, normal); + } + + float3 TangentToWorldSpace(ShaderData d, float3 normal) + { + return mul(normal, d.TBNMatrix); + } + + // in this case, make standard more like SRPs, because we can't fix + // unity_WorldToObject in HDRP, since it already does macro-fu there + + #if _STANDARD + float3 TransformWorldToObject(float3 p) { return mul(unity_WorldToObject, float4(p, 1)); }; + float3 TransformObjectToWorld(float3 p) { return mul(unity_ObjectToWorld, float4(p, 1)); }; + float4 TransformWorldToObject(float4 p) { return mul(unity_WorldToObject, p); }; + float4 TransformObjectToWorld(float4 p) { return mul(unity_ObjectToWorld, p); }; + float4x4 GetWorldToObjectMatrix() { return unity_WorldToObject; } + float4x4 GetObjectToWorldMatrix() { return unity_ObjectToWorld; } + #if (defined(SHADER_API_D3D11) || defined(SHADER_API_XBOXONE) || defined(UNITY_COMPILER_HLSLCC) || defined(SHADER_API_PSSL) || (SHADER_TARGET_SURFACE_ANALYSIS && !SHADER_TARGET_SURFACE_ANALYSIS_MOJOSHADER)) + #define UNITY_SAMPLE_TEX2D_LOD(tex,coord, lod) tex.SampleLevel (sampler##tex,coord, lod) + #define UNITY_SAMPLE_TEX2D_SAMPLER_LOD(tex,samplertex,coord, lod) tex.SampleLevel (sampler##samplertex,coord, lod) + #else + #define UNITY_SAMPLE_TEX2D_LOD(tex,coord,lod) tex2D (tex,coord,0,lod) + #define UNITY_SAMPLE_TEX2D_SAMPLER_LOD(tex,samplertex,coord,lod) tex2D (tex,coord,0,lod) + #endif + + #undef GetWorldToObjectMatrix() + + #define GetWorldToObjectMatrix() unity_WorldToObject + + + #endif + + float3 GetCameraWorldPosition() + { + #if _HDRP + return GetCameraRelativePositionWS(_WorldSpaceCameraPos); + #else + return _WorldSpaceCameraPos; + #endif + } + + #if _GRABPASSUSED + #if _STANDARD + TEXTURE2D(%GRABTEXTURE%); + SAMPLER(sampler_%GRABTEXTURE%); + #endif + + half3 GetSceneColor(float2 uv) + { + #if _STANDARD + return SAMPLE_TEXTURE2D(%GRABTEXTURE%, sampler_%GRABTEXTURE%, uv).rgb; + #else + return SHADERGRAPH_SAMPLE_SCENE_COLOR(uv); + #endif + } + #endif + + + + #if _STANDARD + UNITY_DECLARE_DEPTH_TEXTURE(_CameraDepthTexture); + float GetSceneDepth(float2 uv) { return SAMPLE_DEPTH_TEXTURE(_CameraDepthTexture, uv); } + float GetLinear01Depth(float2 uv) { return Linear01Depth(GetSceneDepth(uv)); } + float GetLinearEyeDepth(float2 uv) { return LinearEyeDepth(GetSceneDepth(uv)); } + #else + float GetSceneDepth(float2 uv) { return SHADERGRAPH_SAMPLE_SCENE_DEPTH(uv); } + float GetLinear01Depth(float2 uv) { return Linear01Depth(GetSceneDepth(uv), _ZBufferParams); } + float GetLinearEyeDepth(float2 uv) { return LinearEyeDepth(GetSceneDepth(uv), _ZBufferParams); } + #endif + + float3 GetWorldPositionFromDepthBuffer(float2 uv, float3 worldSpaceViewDir) + { + float eye = GetLinearEyeDepth(uv); + float3 camView = mul((float3x3)GetObjectToWorldMatrix(), transpose(mul(GetWorldToObjectMatrix(), UNITY_MATRIX_I_V)) [2].xyz); + + float dt = dot(worldSpaceViewDir, camView); + float3 div = worldSpaceViewDir/dt; + float3 wpos = (eye * div) + GetCameraWorldPosition(); + return wpos; + } + + #if _HDRP + float3 ObjectToWorldSpacePosition(float3 pos) + { + return GetAbsolutePositionWS(TransformObjectToWorld(pos)); + } + #else + float3 ObjectToWorldSpacePosition(float3 pos) + { + return TransformObjectToWorld(pos); + } + #endif + + #if _STANDARD + UNITY_DECLARE_SCREENSPACE_TEXTURE(_CameraDepthNormalsTexture); + float3 GetSceneNormal(float2 uv, float3 worldSpaceViewDir) + { + float4 depthNorms = UNITY_SAMPLE_SCREENSPACE_TEXTURE(_CameraDepthNormalsTexture, uv); + float3 norms = DecodeViewNormalStereo(depthNorms); + norms = mul((float3x3)GetWorldToViewMatrix(), norms) * 0.5 + 0.5; + return norms; + } + #elif _HDRP && !_DECALSHADER + + float3 GetSceneNormal(float2 uv, float3 worldSpaceViewDir) + { + NormalData nd; + DecodeFromNormalBuffer(_ScreenSize.xy * uv, nd); + return nd.normalWS; + } + #elif _URP + #if (SHADER_LIBRARY_VERSION_MAJOR >= 10) + #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/DeclareNormalsTexture.hlsl" + #endif + + float3 GetSceneNormal(float2 uv, float3 worldSpaceViewDir) + { + #if (SHADER_LIBRARY_VERSION_MAJOR >= 10) + return SampleSceneNormals(uv); + #else + float3 wpos = GetWorldPositionFromDepthBuffer(uv, worldSpaceViewDir); + return normalize(-cross(ddx(wpos), ddy(wpos))) * 0.5 + 0.5; + #endif + + } + #endif + + #if _HDRP + + half3 UnpackNormalmapRGorAG(half4 packednormal) + { + // This do the trick + packednormal.x *= packednormal.w; + + half3 normal; + normal.xy = packednormal.xy * 2 - 1; + normal.z = sqrt(1 - saturate(dot(normal.xy, normal.xy))); + return normal; + } + half3 UnpackNormal(half4 packednormal) + { + #if defined(UNITY_NO_DXT5nm) + return packednormal.xyz * 2 - 1; + #else + return UnpackNormalmapRGorAG(packednormal); + #endif + } + #endif + #if _HDRP || _URP + + half3 UnpackScaleNormal(half4 packednormal, half scale) + { + #ifndef UNITY_NO_DXT5nm + // Unpack normal as DXT5nm (1, y, 1, x) or BC5 (x, y, 0, 1) + // Note neutral texture like "bump" is (0, 0, 1, 1) to work with both plain RGB normal and DXT5nm/BC5 + packednormal.x *= packednormal.w; + #endif + half3 normal; + normal.xy = (packednormal.xy * 2 - 1) * scale; + normal.z = sqrt(1 - saturate(dot(normal.xy, normal.xy))); + return normal; + } + + #endif + + + void GetSun(out float3 lightDir, out float3 color) + { + lightDir = float3(0.5, 0.5, 0); + color = 1; + #if _HDRP + if (_DirectionalLightCount > 0) + { + DirectionalLightData light = _DirectionalLightDatas[0]; + lightDir = -light.forward.xyz; + color = light.color; + } + #elif _STANDARD + lightDir = normalize(_WorldSpaceLightPos0.xyz); + color = _LightColor0.rgb; + #elif _URP + Light light = GetMainLight(); + lightDir = light.direction; + color = light.color; + #endif + } + + + + + + + + + + TEXTURE2D(_MainTex); + SAMPLER(sampler_MainTex); + + #if GLOW_ON + TEXTURE2D(_GlowTex); + SAMPLER(sampler_GlowTex); + #endif + + #if FADE_ON + TEXTURE2D(_FadeTex); + SAMPLER(sampler_FadeTex); + + TEXTURE2D(_FadeBurnTex); + SAMPLER(sampler_FadeBurnTex); + #endif + + #if DISTORT_ON + TEXTURE2D(_DistortTex); + SAMPLER(sampler_DistortTex); + #endif + + #if OUTTEX_ON + TEXTURE2D(_OutlineTex); + SAMPLER(sampler_OutlineTex); + #endif + + #if OUTDIST_ON + TEXTURE2D(_OutlineDistortTex); + SAMPLER(sampler_OutlineDistortTex); + #endif + + #if COLORSWAP_ON + TEXTURE2D(_ColorSwapTex); + SAMPLER(sampler_ColorSwapTex); + #endif + + #if COLORRAMP_ON + TEXTURE2D(_ColorRampTex); + TEXTURE2D(_ColorRampTexGradient); + SAMPLER(sampler_ColorRampTex); + SAMPLER(sampler_ColorRampTexGradient); + #endif + + #if SHINE_ON + TEXTURE2D(_ShineMask); + SAMPLER(sampler_ShineMask); + #endif + + #if OVERLAY_ON + TEXTURE2D(_OverlayTex); + SAMPLER(sampler_OverlayTex); + #endif + + #if NORMALMAP_ON + TEXTURE2D(_NormalMap); + SAMPLER(sampler_NormalMap); + #endif + + + half3 GetPixel(in int offsetX, in int offsetY, in half2 uv, in Texture2D _tex, in SamplerState _sampler) + { + half2 _uv = uv + half2(offsetX * _MainTex_TexelSize.x, offsetY * _MainTex_TexelSize.y); + half4 col = SAMPLE_TEXTURE2D(_tex, _sampler, _uv); + return col.rgb; + } + + + //BLURS------------------------------------------------------------------------- + half4 Blur(half2 uv, Texture2D source, SamplerState sampler_source, half Intensity) + { + const half2 texelSize = 1.0 / _ScreenParams.xy; + const half4 color = SAMPLE_TEXTURE2D(source, sampler_source, uv); + const half2 offset = Intensity * texelSize; + + half4 accumulatedColor = color; + half accumulatedWeight = 1.0; + for (int x = -1; x <= 1; x++) + { + for (int y = -1; y <= 1; y++) + { + const half2 sampleUV = uv + half2(x, y) * offset; + const half4 sampleColor = SAMPLE_TEXTURE2D(source, sampler_source, sampleUV); + + accumulatedColor += sampleColor; + accumulatedWeight += 1.0; + } + } + + half4 blurredColor = accumulatedColor / accumulatedWeight; + return blurredColor; + } + + half BlurHD_G(half bhqp, half x) + { + return exp(-(x * x) / (2.0 * bhqp * bhqp)); + } + half4 BlurHD(half2 uv, Texture2D source, SamplerState sampler_source, half BlurAmount, half xScale, half yScale) + { + int iterations = 16; + int halfIterations = iterations / 2; + half sigmaX = 0.1 + BlurAmount * 0.5; + half sigmaY = sigmaX; + half total = 0.0; + half4 ret = half4(0, 0, 0, 0); + for (int iy = 0; iy < iterations; ++iy) + { + half fy = BlurHD_G(sigmaY, half(iy) -half(halfIterations)); + half offsetY = half(iy - halfIterations) * 0.00390625 * xScale; + for (int ix = 0; ix < iterations; ++ix) + { + half fx = BlurHD_G(sigmaX, half(ix) - half(halfIterations)); + half offsetX = half(ix - halfIterations) * 0.00390625 * yScale; + total += fx * fy; + ret += SAMPLE_TEXTURE2D(source, sampler_source, uv + half2(offsetX, offsetY)) * fx * fy; + } + } + return ret / total; + } + //----------------------------------------------------------------------- + + + //------------------------------------------- + half RemapFloat(half inValue, half inMin, half inMax, half outMin, half outMax){ + return outMin + (inValue - inMin) * (outMax - outMin) / (inMax - inMin); + } + //------------------------------------------- + + //----------------------------------------------------------------------- + half rand(half2 seed, half offset) { + return (frac(sin(dot(seed, half2(12.9898, 78.233))) * 43758.5453) + offset) % 1.0; + } + + half rand2(half2 seed, half offset) { + return (frac(sin(dot(seed * floor(50 + (_Time.x % 1.0) * 12.), half2(127.1, 311.7))) * 43758.5453123) + offset) % 1.0; + } + + half rand2CustomTime(half2 seed, half offset, half customTime) { + return (frac(sin(dot(seed * floor(50 + (customTime % 1.0) * 12.), half2(127.1, 311.7))) * 43758.5453123) + offset) % 1.0; + } + //----------------------------------------------------------------------- + + + void Ext_ModifyVertex0 (inout VertexData v, inout ExtraV2F d) + { + //BILBOARD_ON + #if BILBOARD_ON + half3 camRight = mul((half3x3)unity_CameraToWorld, half3(1,0,0)); + half3 camUp = half3(0,1,0); + #if BILBOARDY_ON + camUp = mul((half3x3)unity_CameraToWorld, half3(0,1,0)); + #endif + half3 localPos = v.vertex.x * camRight + v.vertex.y * camUp; + v.vertex = half4(localPos, 1); + #endif + //----------------------------------------------------------- + + v.texcoord0.xy = TRANSFORM_TEX(v.texcoord0.xy, _MainTex); + half2 center = half2(0.5, 0.5); + #if ATLAS_ON + center = half2((_MaxXUV + _MinXUV) / 2.0, (_MaxYUV + _MinYUV) / 2.0); + #endif + + //POLARUV_ON + #if POLARUV_ON + v.texcoord0.xy = v.texcoord0.xy - center; + #endif + + //---------------------------------------- + + //ROTATEUV_ON + #if ROTATEUV_ON + half2 uvC = v.texcoord0.xy; + half cosAngle = cos(_RotateUvAmount); + half sinAngle = sin(_RotateUvAmount); + half2x2 rot = half2x2(cosAngle, -sinAngle, sinAngle, cosAngle); + uvC -= center; + v.texcoord0.xy = mul(rot, uvC); + v.texcoord0.xy += center; + #endif + //-------------------- + + #if RECTSIZE_ON + v.vertex.xyz += (v.vertex.xyz * (_RectSize - 1.0)); + #endif + + #if OUTTEX_ON + v.texcoord1.xy = TRANSFORM_TEX(v.texcoord0.xy, _OutlineTex); + #endif + + #if OUTDIST_ON + v.texcoord2.xy = TRANSFORM_TEX(v.texcoord0.xy, _OutlineDistortTex); + #endif + + #if DISTORT_ON + v.texcoord3.xy = TRANSFORM_TEX(v.texcoord0.xy, _DistortTex); + #endif + } + + void Ext_SurfaceFunction0 (inout Surface o, ShaderData d) + { + half randomSeed = _RandomSeed; + + float2 uvRect = d.texcoord0; + half2 center = half2(0.5, 0.5); + #if ATLAS_ON + center = half2((_MaxXUV + _MinXUV) / 2.0, (_MaxYUV + _MinYUV) / 2.0); + uvRect = half2((d.texcoord0.x - _MinXUV) / (_MaxXUV - _MinXUV), (d.texcoord0.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half2 centerTiled = half2(center.x * _MainTex_ST.x, center.y * _MainTex_ST.y); + + //CLIPPING_ON + #if CLIPPING_ON + half2 tiledUv = half2(d.texcoord0.x / _MainTex_ST.x, d.texcoord0.y / _MainTex_ST.y); + #if ATLAS_ON + tiledUv = half2((tiledUv.x - _MinXUV) / (_MaxXUV - _MinXUV), (tiledUv.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + clip((1 - _ClipUvUp) - tiledUv.y); + clip(tiledUv.y - _ClipUvDown); + clip((1 - _ClipUvRight) - tiledUv.x); + clip(tiledUv.x - _ClipUvLeft); + #endif + //---------------------------------- + + //RADIALCLIPPING_ON + #if RADIALCLIPPING_ON + half2 tiledUv2 = half2(d.texcoord0.x / _MainTex_ST.x, d.texcoord0.y / _MainTex_ST.y); + #if ATLAS_ON + tiledUv2 = half2((tiledUv2.x - _MinXUV) / (_MaxXUV - _MinXUV), (tiledUv2.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half startAngle = _RadialStartAngle - _RadialClip; + half endAngle = _RadialStartAngle + _RadialClip2; + half offset0 = clamp(0, 360, startAngle + 360); + half offset360 = clamp(0, 360, endAngle - 360); + half2 atan2Coord = half2(lerp(-1, 1, tiledUv2.x), lerp(-1, 1, tiledUv2.y)); + half atanAngle = atan2(atan2Coord.y, atan2Coord.x) * 57.3; // angle in degrees + if(atanAngle < 0) atanAngle = 360 + atanAngle; + if(atanAngle >= startAngle && atanAngle <= endAngle) discard; + if(atanAngle <= offset360) discard; + if(atanAngle >= offset0) discard; + #endif + + //----------------------------- + + //TEXTURESCROLL_ON && ATLAS_ON + #if TEXTURESCROLL_ON && ATLAS_ON + d.texcoord0.xy = half2(_MinXUV + ((_MaxXUV - _MinXUV) * (abs(((_Time.y + randomSeed) * _TextureScrollXSpeed) + uvRect.x) % 1)), + _MinYUV + ((_MaxYUV - _MinYUV) * (abs(((_Time.y + randomSeed) * _TextureScrollYSpeed) + uvRect.y) % 1))); + #endif + //---------------------------- + + //OFFSETUV_ON + #if OFFSETUV_ON + #if ATLAS_ON + d.texcoord0.xy = half2(_MinXUV + ((_MaxXUV - _MinXUV) * (abs((_OffsetUvX + uvRect.x) % 1))), + _MinYUV + ((_MaxYUV - _MinYUV) * (abs(_OffsetUvY + uvRect.y) % 1))); + #else + d.texcoord0.xy += half2(_OffsetUvX, _OffsetUvY); + #endif + #endif + + //---------------------- + + //POLARUV_ON + #if POLARUV_ON + d.texcoord0.xy = half2(atan2(d.texcoord0.y, d.texcoord0.x) / (2.0f * 3.141592653589f), length(d.texcoord0.xy)); + d.texcoord0.xy *= _MainTex_ST.xy; + #endif + + //-------------------------------------- + + //TWISTUV_ON + #if TWISTUV_ON + #if ATLAS_ON + _TwistUvPosX = ((_MaxXUV - _MinXUV) * _TwistUvPosX) + _MinXUV; + _TwistUvPosY = ((_MaxYUV - _MinYUV) * _TwistUvPosY) + _MinYUV; + #endif + half2 tempUv = d.texcoord0.xy - half2(_TwistUvPosX * _MainTex_ST.x, _TwistUvPosY * _MainTex_ST.y); + _TwistUvRadius *= (_MainTex_ST.x + _MainTex_ST.y) / 2; + half percent = (_TwistUvRadius - length(tempUv)) / _TwistUvRadius; + half theta = percent * percent * (2.0 * sin(_TwistUvAmount)) * 8.0; + half s = sin(theta); + half c = cos(theta); + half beta = max(sign(_TwistUvRadius - length(tempUv)), 0.0); + tempUv = half2(dot(tempUv, half2(c, -s)), dot(tempUv, half2(s, c))) * beta + tempUv * (1 - beta); + tempUv += half2(_TwistUvPosX * _MainTex_ST.x, _TwistUvPosY * _MainTex_ST.y); + d.texcoord0.xy = tempUv; + #endif + + //-------------------------------------------- + + //FISHEYE_ON + #if FISHEYE_ON + half bind = length(centerTiled); + half2 dF = d.texcoord0.xy - centerTiled; + half dFlen = length(dF); + half fishInt = (3.14159265359 / bind) * (_FishEyeUvAmount + 0.001); + d.texcoord0.xy = centerTiled + (dF / (max(0.0001, dFlen))) * tan(dFlen * fishInt) * bind / tan(bind * fishInt); + #endif + //--------------------------------------------- + + //PINCH_ON + #if PINCH_ON + half2 dP = d.texcoord0.xy - centerTiled; + half pinchInt = (3.141592 / length(centerTiled)) * (-_PinchUvAmount + 0.001); + d.texcoord0.xy = centerTiled + normalize(dP) * atan(length(dP) * -pinchInt * 10.0) * 0.5 / atan(-pinchInt * 5); + #endif + + //--------------------------------------------- + + //ZOOMUV_ON + #if ZOOMUV_ON + d.texcoord0.xy -= centerTiled; + d.texcoord0.xy = d.texcoord0.xy * _ZoomUvAmount; + d.texcoord0.xy += centerTiled; + #endif + + //----------------------------------------------- + + //DOODLE_ON + #if DOODLE_ON + half2 uvCopy = uvRect; + _HandDrawnSpeed = (floor((_Time.x + randomSeed) * 20 * _HandDrawnSpeed) / _HandDrawnSpeed) * _HandDrawnSpeed; + uvCopy.x = sin((uvCopy.x * _HandDrawnAmount + _HandDrawnSpeed) * 4); + uvCopy.y = cos((uvCopy.y * _HandDrawnAmount + _HandDrawnSpeed) * 4); + d.texcoord0.xy = lerp(d.texcoord0.xy, d.texcoord0.xy + uvCopy, 0.0005 * _HandDrawnAmount); + #endif + + //-------------------------- + + //SHAKEUV_ON + #if SHAKEUV_ON + half xShake = sin((_Time.x + randomSeed) * _ShakeUvSpeed * 50) * _ShakeUvX; + half yShake = cos((_Time.x + randomSeed) * _ShakeUvSpeed * 50) * _ShakeUvY; + d.texcoord0.xy += half2(xShake * 0.012, yShake * 0.01); + #endif + + //------------------------------------------- + + //RECTSIZE_ON + #if RECTSIZE_ON + d.texcoord0.xy = d.texcoord0.xy * (_RectSize).xx + (((-_RectSize * 0.5) + 0.5)).xx; + #endif + + //------------------------------------------- + + //DISTORT_ON + #if DISTORT_ON + #if ATLAS_ON + d.texcoord3.x = d.texcoord3.x * (1 / (_MaxXUV - _MinXUV)); + d.texcoord3.y = d.texcoord3.y * (1 / (_MaxYUV - _MinYUV)); + #endif + + d.texcoord3.x += ((_Time.x + _RandomSeed) * _DistortTexXSpeed) % 1; + d.texcoord3.y += ((_Time.x + _RandomSeed) * _DistortTexYSpeed) % 1; + half distortAmnt = (SAMPLE_TEXTURE2D(_DistortTex, sampler_DistortTex, d.texcoord3.xy).r - 0.5) * 0.2 * _DistortAmount; + d.texcoord0.x += distortAmnt; + d.texcoord0.y += distortAmnt; + #endif + //------------------------------------------------------- + + //WARP_ON + #if WARP_ON + half2 warpUv = half2(d.texcoord0.x / _MainTex_ST.x, d.texcoord0.y / _MainTex_ST.y); + #if ATLAS_ON + warpUv = half2((warpUv.x - _MinXUV) / (_MaxXUV - _MinXUV), (warpUv.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + const float tau = 6.283185307179586; + float xWarp = (_Time.y + randomSeed) * _WarpSpeed + warpUv.x * tau / _WarpScale; + float yWarp = (_Time.y + randomSeed) * _WarpSpeed + warpUv.y * tau / _WarpScale; + float2 warp = float2(sin(xWarp), sin(yWarp)) * _WarpStrength; + d.texcoord0.xy += warp; + #endif + + //------------------------------------------------------- + + //WAVEUV_ON + #if WAVEUV_ON + float2 uvWave = half2(_WaveX * _MainTex_ST.x, _WaveY * _MainTex_ST.y) - d.texcoord0.xy; + uvWave %= 1; + #if ATLAS_ON + uvWave = half2(_WaveX, _WaveY) - uvRect; + #endif + uvWave.x *= _ScreenParams.x / _ScreenParams.y; + float waveTime = _Time.y + randomSeed; + float angWave = (sqrt(dot(uvWave, uvWave)) * _WaveAmount) - ((waveTime * _WaveSpeed)); + d.texcoord0.xy = d.texcoord0.xy + uvWave * sin(angWave) * (_WaveStrength / 1000.0); + #endif + //---------------------------------------------------- + + //ROUNDWAVEUV_ON + #if ROUNDWAVEUV_ON + half xWave = ((0.5 * _MainTex_ST.x) - uvRect.x); + half yWave = ((0.5 * _MainTex_ST.y) - uvRect.y) * (_MainTex_TexelSize.w / _MainTex_TexelSize.z); + half ripple = -sqrt(xWave*xWave + yWave* yWave); + d.texcoord0.xy += (sin((ripple + (_Time.y + randomSeed) * (_RoundWaveSpeed/10.0)) / 0.015) * (_RoundWaveStrength/10.0)) % 1; + #endif + //---------------------------------------------------- + + + //WIND_ON + #if WIND_ON + half windOffset = sin((_Time.x + randomSeed) * _GrassSpeed * 10); + half2 windCenter = half2(0.5, 0.1); + #if ATLAS_ON + windCenter.x = ((_MaxXUV - _MinXUV) * windCenter.x) + _MinXUV; + windCenter.y = ((_MaxYUV - _MinYUV) * windCenter.y) + _MinYUV; + #endif + #if !MANUALWIND_ON + d.texcoord0.x = fmod(abs(lerp(d.texcoord0.x, d.texcoord0.x + (_GrassWind * 0.01 * windOffset), uvRect.y)), 1); + #else + d.texcoord0.x = fmod(abs(lerp(d.texcoord0.x, d.texcoord0.x + (_GrassWind * 0.01 * _GrassManualAnim), uvRect.y)), 1); + windOffset = _GrassManualAnim; + #endif + half2 delta = d.texcoord0.xy - windCenter; + half delta2 = dot(delta.xy, delta.xy); + half2 delta_offset = delta2 * windOffset; + d.texcoord0.xy = d.texcoord0.xy + half2(delta.y, -delta.x) * delta_offset * _GrassRadialBend; + #endif + + //-------------------------------------------------------- + + //TEXTURESCROLL_ON && !ATLAS_ON + #if TEXTURESCROLL_ON && !ATLAS_ON + d.texcoord0.x += ((_Time.y + randomSeed) * _TextureScrollXSpeed) % 1; + d.texcoord0.y += ((_Time.y + randomSeed) * _TextureScrollYSpeed) % 1; + #endif + //------------------------------ + + //PIXELATE_ON + #if PIXELATE_ON + half aspectRatio = _MainTex_TexelSize.x / _MainTex_TexelSize.y; + half2 pixelSize = float2(_PixelateSize, _PixelateSize * aspectRatio); + d.texcoord0.xy = floor(d.texcoord0.xy * pixelSize) / pixelSize; + #endif + //-------------- + + half4 col = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy); + half originalAlpha = col.a; + col *= d.vertexColor; + + //NORMAL MAP + #if NORMALMAP_ON + half4 normalSample = SAMPLE_TEXTURE2D(_NormalMap, sampler_NormalMap, d.texcoord0.xy); + half3 normalTS = UnpackNormal(normalSample); + normalTS.xy *= _NormalStrength; + o.Normal = normalTS; + #endif + + + //GLITCH_ON + #if GLITCH_ON + half2 uvGlitch = uvRect; + uvGlitch.y -= 0.5; + half lineNoise = pow(rand2(floor(uvGlitch * half2(24., 19.) * _GlitchSize) * 4.0, randomSeed), 3.0) * _GlitchAmount + * pow(rand2(floor(uvGlitch * half2(38., 14.) * _GlitchSize) * 4.0, randomSeed), 3.0); + col = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(lineNoise * 0.02 * rand2(half2(2.0, 1), randomSeed), 0)) * d.vertexColor; + #endif + //-------------------------------------- + + //CHROMABERR_ON + #if CHROMABERR_ON + half4 r = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(_ChromAberrAmount/10, 0)) * d.vertexColor; + half4 b = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(-_ChromAberrAmount/10, 0)) * d.vertexColor; + col = half4(r.r * r.a, col.g, b.b * b.a, max(max(r.a, b.a) * _ChromAberrAlpha, col.a)); + #endif + + //-------------------------------- + + //BLUR_ON + #if BLUR_ON + #if ATLAS_ON + #if !BLURISHD_ON + col = BlurHD(d.texcoord0.xy, _MainTex, sampler_MainTex, _BlurIntensity, (_MaxXUV - _MinXUV), (_MaxYUV - _MinYUV)) * d.vertexColor; + #else + col = Blur(d.texcoord0.xy, _MainTex, sampler_MainTex, _BlurIntensity * (_MaxXUV - _MinXUV)) * d.vertexColor; + #endif + #else + #if !BLURISHD_ON + col = BlurHD(d.texcoord0.xy, _MainTex, sampler_MainTex, _BlurIntensity, 1, 1) * d.vertexColor; + #else + col = Blur(d.texcoord0.xy, _MainTex, sampler_MainTex, _BlurIntensity) * d.vertexColor; + #endif + #endif + #endif + + //-------------------- + + //MOTIONBLUR_ON + #if MOTIONBLUR_ON + _MotionBlurAngle = _MotionBlurAngle * 3.1415926; + #define rot(n) mul(n, half2x2(cos(_MotionBlurAngle), -sin(_MotionBlurAngle), sin(_MotionBlurAngle), cos(_MotionBlurAngle))) + _MotionBlurDist = _MotionBlurDist * 0.005; + #if ATLAS_ON + _MotionBlurDist *= (_MaxXUV - _MinXUV); + #endif + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(-_MotionBlurDist, -_MotionBlurDist))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(-_MotionBlurDist * 2, -_MotionBlurDist * 2))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(-_MotionBlurDist * 3, -_MotionBlurDist * 3))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(-_MotionBlurDist * 4, -_MotionBlurDist * 4))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(_MotionBlurDist, _MotionBlurDist))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(_MotionBlurDist * 2, _MotionBlurDist * 2))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(_MotionBlurDist * 3, _MotionBlurDist * 3))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(_MotionBlurDist * 4, _MotionBlurDist * 4))); + col.rgb = col.rgb / 9; + #endif + //------------------------------------ + + //NEGATIVE_ON + #if NEGATIVE_ON + col.rgb = lerp(col.rgb, 1 - col.rgb, _NegativeAmount); + #endif + + //-------------- + half luminance = 0; + + //GREYSCALE_ON && !GREYSCALEOUTLINE_ON + #if GREYSCALE_ON && !GREYSCALEOUTLINE_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + luminance = saturate(luminance + _GreyscaleLuminosity); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _GreyscaleTintColor, _GreyscaleBlend); + #endif + //------------------------------------ + + //GHOST_ON + #if GHOST_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + half4 ghostResult; + ghostResult.a = saturate(luminance - _GhostTransparency) * col.a; + ghostResult.rgb = col.rgb * (luminance + _GhostColorBoost); + col = lerp(col, ghostResult, _GhostBlend); + #endif + //------------------------------------ + + //INNEROUTLINE_ON + #if INNEROUTLINE_ON + half3 innerT = abs(GetPixel(0, _InnerOutlineThickness, d.texcoord0.xy, _MainTex, sampler_MainTex) - GetPixel(0, -_InnerOutlineThickness, d.texcoord0.xy, _MainTex, sampler_MainTex)); + innerT += abs(GetPixel(_InnerOutlineThickness, 0, d.texcoord0.xy, _MainTex, sampler_MainTex) - GetPixel(-_InnerOutlineThickness, 0, d.texcoord0.xy, _MainTex, sampler_MainTex)); + #if !ONLYINNEROUTLINE_ON + innerT = (innerT / 2.0) * col.a * _InnerOutlineAlpha; + col.rgb += length(innerT) * _InnerOutlineColor.rgb * _InnerOutlineGlow; + #else + innerT *= col.a * _InnerOutlineAlpha; + col.rgb = length(innerT) * _InnerOutlineColor.rgb * _InnerOutlineGlow; + col.a = step(0.3, col.r+col.g+col.b); + #endif + #endif + //------------------------------------------------------- + + //HITEFFECT_ON + #if HITEFFECT_ON + col.rgb = lerp(col.rgb, _HitEffectColor.rgb * _HitEffectGlow, _HitEffectBlend); + #endif + //-------------------- + + //GRADIENT_ON + #if GRADIENT_ON + half2 tiledUvGrad = half2(uvRect.x / _MainTex_ST.x, uvRect.y / _MainTex_ST.y); + #if GRADIENT2COL_ON + _GradTopRightCol = _GradTopLeftCol; + _GradBotRightCol = _GradBotLeftCol; + #endif + #if RADIALGRADIENT_ON + half radialDist = 1 - length(tiledUvGrad - half2(0.5, 0.5)); + radialDist *= (_MainTex_TexelSize.w / _MainTex_TexelSize.z); + radialDist = saturate(_GradBoostX * radialDist); + half4 gradientResult = lerp(_GradTopLeftCol, _GradBotLeftCol, radialDist); + #else + half gradXLerpFactor = saturate(pow(tiledUvGrad.x, _GradBoostX)); + half4 gradientResult = lerp(lerp(_GradBotLeftCol, _GradBotRightCol, gradXLerpFactor), + lerp(_GradTopLeftCol, _GradTopRightCol, gradXLerpFactor), saturate(pow(tiledUvGrad.y, _GradBoostY))); + #endif + gradientResult = lerp(col, gradientResult, _GradBlend); + col.rgb = gradientResult.rgb * col.a; + col.a *= gradientResult.a; + #endif + //-------------------------------------------------------------------- + + //CONTRAST_ON + #if CONTRAST_ON + col.rgb = (col.rgb - float3(0.5, 0.5, 0.5)) * _Contrast + float3(0.5, 0.5, 0.5); + col.rgb += _Brightness; + #endif + + //------------------------------------------------------------------- + + //COLORSWAP_ON + #if COLORSWAP_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + half4 swapMask = SAMPLE_TEXTURE2D(_ColorSwapTex, sampler_ColorSwapTex, d.texcoord0.xy); + swapMask.rgb *= swapMask.a; + half3 redSwap = _ColorSwapRed * swapMask.r * saturate(luminance + _ColorSwapRedLuminosity); + half3 greenSwap = _ColorSwapGreen * swapMask.g * saturate(luminance + _ColorSwapGreenLuminosity); + half3 blueSwap = _ColorSwapBlue * swapMask.b * saturate(luminance + _ColorSwapBlueLuminosity); + swapMask.rgb = col.rgb * saturate(1 - swapMask.r - swapMask.g - swapMask.b); + col.rgb = lerp(col.rgb, swapMask.rgb + redSwap + greenSwap + blueSwap, _ColorSwapBlend); + #endif + //-------------------------------------------------------------------- + + //COLORRAMP_ON && !COLORRAMPOUTLINE_ON + #if COLORRAMP_ON && !COLORRAMPOUTLINE_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + luminance = saturate(luminance + _ColorRampLuminosity); + #if GRADIENTCOLORRAMP_ON + col.rgb = lerp(col.rgb, SAMPLE_TEXTURE2D(_ColorRampTexGradient, sampler_ColorRampTexGradient, half2(luminance, 0)).rgb, _ColorRampBlend); + #else + col.rgb = lerp(col.rgb, SAMPLE_TEXTURE2D(_ColorRampTex, sampler_ColorRampTex, half2(luminance, 0)).rgb, _ColorRampBlend); + #endif + #endif + //-------------------------------------------------------------------- + + //CHANGECOLOR_ON + #if CHANGECOLOR_ON + float3 currChangeColor = saturate(col.rgb); + luminance = 0.3 * currChangeColor.r + 0.59 * currChangeColor.g + 0.11 * currChangeColor.b; + luminance = saturate(luminance + _ColorChangeLuminosity); + half3 dif = abs(currChangeColor - _ColorChangeTarget.rgb); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _ColorChangeNewCol.rgb, + max(sign(1 - saturate(dif.x + dif.y + dif.z) - _ColorChangeTolerance), 0.0)); + #if CHANGECOLOR2_ON + dif = abs(currChangeColor - _ColorChangeTarget2.rgb); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _ColorChangeNewCol2.rgb, + max(sign(1 - saturate(dif.x + dif.y + dif.z) - _ColorChangeTolerance2), 0.0)); + #endif + #if CHANGECOLOR3_ON + dif = abs(currChangeColor - _ColorChangeTarget3.rgb); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _ColorChangeNewCol3.rgb, + max(sign(1 - saturate(dif.x + dif.y + dif.z) - _ColorChangeTolerance3), 0.0)); + #endif + #endif + //------------------------------------------------------- + + //POSTERIZE_ON && !POSTERIZEOUTLINE_ON + #if POSTERIZE_ON && !POSTERIZEOUTLINE_ON + col.rgb = pow(col.rgb, _PosterizeGamma) * _PosterizeNumColors; + col.rgb = floor(col.rgb) / _PosterizeNumColors; + col.rgb = pow(col.rgb, 1.0 / _PosterizeGamma); + #endif + //------------------------------------ + + //HSV_ON + #if HSV_ON + half3 resultHsv = half3(col.rgb); + half cosHsv = _HsvBright * _HsvSaturation * cos(_HsvShift * 3.14159265 / 180); + half sinHsv = _HsvBright * _HsvSaturation * sin(_HsvShift * 3.14159265 / 180); + resultHsv.x = (.299 * _HsvBright + .701 * cosHsv + .168 * sinHsv) * col.x + + (.587 * _HsvBright - .587 * cosHsv + .330 * sinHsv) * col.y + + (.114 * _HsvBright - .114 * cosHsv - .497 * sinHsv) * col.z; + resultHsv.y = (.299 * _HsvBright - .299 * cosHsv - .328 * sinHsv) *col.x + + (.587 * _HsvBright + .413 * cosHsv + .035 * sinHsv) * col.y + + (.114 * _HsvBright - .114 * cosHsv + .292 * sinHsv) * col.z; + resultHsv.z = (.299 * _HsvBright - .3 * cosHsv + 1.25 * sinHsv) * col.x + + (.587 * _HsvBright - .588 * cosHsv - 1.05 * sinHsv) * col.y + + (.114 * _HsvBright + .886 * cosHsv - .203 * sinHsv) * col.z; + col.rgb = resultHsv; + #endif + //------------------------------------------------------- + + //OVERLAY_ON + #if OVERLAY_ON + half2 overlayUvs = d.texcoord0.xy; + overlayUvs.x += ((_Time.y + randomSeed) * _OverlayTextureScrollXSpeed) % 1; + overlayUvs.y += ((_Time.y + randomSeed) * _OverlayTextureScrollYSpeed) % 1; + half4 overlayCol = SAMPLE_TEXTURE2D(_OverlayTex, sampler_OverlayTex, TRANSFORM_TEX(overlayUvs, _OverlayTex)); + overlayCol.rgb *= _OverlayColor.rgb * _OverlayGlow; + #if !OVERLAYMULT_ON + overlayCol.rgb *= overlayCol.a * _OverlayColor.rgb * _OverlayColor.a * _OverlayBlend; + col.rgb += overlayCol.rgb; + #else + overlayCol.a *= _OverlayColor.a; + col = lerp(col, col * overlayCol, _OverlayBlend); + #endif + #endif + + //--------------------------------- + + //OUTBASE_ON + #if OUTBASE_ON + #if OUTBASEPIXELPERF_ON + half2 destUv = half2(_OutlinePixelWidth * _MainTex_TexelSize.x, _OutlinePixelWidth * _MainTex_TexelSize.y); + #else + half2 destUv = half2(_OutlineWidth * _MainTex_TexelSize.x * 200, _OutlineWidth * _MainTex_TexelSize.y * 200); + #endif + + #if OUTDIST_ON + d.texcoord3.x += ((_Time.x + _RandomSeed) * _OutlineDistortTexXSpeed) % 1; + d.texcoord3.y += ((_Time.x + _RandomSeed) * _OutlineDistortTexYSpeed) % 1; + #if ATLAS_ON + d.texcoord3 = half2((d.texcoord3.x - _MinXUV) / (_MaxXUV - _MinXUV), (d.texcoord3.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half outDistortAmnt = (SAMPLE_TEXTURE2D(_OutlineDistortTex, sampler_OutlineDistortTex, d.texcoord3).r - 0.5) * 0.2 * _OutlineDistortAmount; + destUv.x += outDistortAmnt; + destUv.y += outDistortAmnt; + #endif + + half spriteLeft = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(destUv.x, 0)).a; + half spriteRight = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy - half2(destUv.x, 0)).a; + half spriteBottom = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(0, destUv.y)).a; + half spriteTop = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy - half2(0, destUv.y)).a; + half result = spriteLeft + spriteRight + spriteBottom + spriteTop; + + #if OUTBASE8DIR_ON + half spriteTopLeft = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(destUv.x, destUv.y)).a; + half spriteTopRight = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(-destUv.x, destUv.y)).a; + half spriteBotLeft = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(destUv.x, -destUv.y)).a; + half spriteBotRight = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(-destUv.x, -destUv.y)).a; + result = result + spriteTopLeft + spriteTopRight + spriteBotLeft + spriteBotRight; + #endif + + result = step(0.05, saturate(result)); + + #if OUTTEX_ON + d.texcoord1.x += ((_Time.x + _RandomSeed) * _OutlineTexXSpeed) % 1; + d.texcoord1.y += ((_Time.x + _RandomSeed) * _OutlineTexYSpeed) % 1; + #if ATLAS_ON + d.texcoord1 = half2((d.texcoord1.x - _MinXUV) / (_MaxXUV - _MinXUV), (d.texcoord1.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half4 tempOutColor = SAMPLE_TEXTURE2D(_OutlineTex, sampler_OutlineTex, d.texcoord1); + tempOutColor *= _OutlineColor; + _OutlineColor = tempOutColor; + #endif + + result *= (1 - originalAlpha) * _OutlineAlpha; + + half4 outline = _OutlineColor * d.vertexColor.a; + outline.rgb *= _OutlineGlow; + outline.a = result; + #if ONLYOUTLINE_ON + col = outline; + #else + col = lerp(col, outline, result); + #endif + #endif + //------------------------------------------------------- + + //FADE_ON + #if FADE_ON + half2 tiledUvFade1 = TRANSFORM_TEX(d.texcoord0, _FadeTex); + half2 tiledUvFade2 = TRANSFORM_TEX(d.texcoord0, _FadeBurnTex); + #if ATLAS_ON + tiledUvFade1 = half2((tiledUvFade1.x - _MinXUV) / (_MaxXUV - _MinXUV), (tiledUvFade1.y - _MinYUV) / (_MaxYUV - _MinYUV)); + tiledUvFade2 = half2((tiledUvFade2.x - _MinXUV) / (_MaxXUV - _MinXUV), (tiledUvFade2.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half fadeTemp = SAMPLE_TEXTURE2D(_FadeTex, sampler_FadeTex, tiledUvFade1).r; + half fade = smoothstep(_FadeAmount, _FadeAmount + _FadeBurnTransition, fadeTemp); + half fadeBurn = saturate(smoothstep(_FadeAmount - _FadeBurnWidth, _FadeAmount - _FadeBurnWidth + 0.1, fadeTemp) * _FadeAmount); + col.a *= fade; + _FadeBurnColor.rgb *= _FadeBurnGlow; + col += fadeBurn * SAMPLE_TEXTURE2D(_FadeBurnTex, sampler_FadeBurnTex, tiledUvFade2) * _FadeBurnColor * originalAlpha * (1 - col.a); + #endif + //------------------------------------------------------- + + //SHADOW_ON + #if SHADOW_ON + half shadowA = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(_ShadowX, _ShadowY)).a; + half preMultShadowMask = 1 - (saturate(shadowA - col.a) * (1 - col.a)); + col.rgb *= 1 - ((shadowA - col.a) * (1 - col.a)); + col.rgb += (_ShadowColor * shadowA) * (1 - col.a); + col.a = max(shadowA * _ShadowAlpha * d.vertexColor.a, col.a); + #endif + + //------------------------------------------------------- + + //GLOW_ON + #if GLOW_ON + half4 emission; + #if GLOWTEX_ON + emission = SAMPLE_TEXTURE2D(_GlowTex, sampler_GlowTex, d.texcoord0); + #else + emission = col; + #endif + + col.rgb *= _GlowGlobal; + emission.rgb *= emission.a * col.a * _Glow * _GlowColor; + col.rgb += emission.rgb; + #endif + //------------------------------------------------------- + + //COLORRAMP_ON && COLORRAMPOUTLINE_ON + #if COLORRAMP_ON && COLORRAMPOUTLINE_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + luminance = saturate(luminance + _ColorRampLuminosity); + #if GRADIENTCOLORRAMP_ON + col.rgb = lerp(col.rgb, SAMPLE_TEXTURE2D(_ColorRampTexGradient, sampler_ColorRampTexGradient, half2(luminance, 0)).rgb, _ColorRampBlend); + #else + col.rgb = lerp(col.rgb, SAMPLE_TEXTURE2D(_ColorRampTex, sampler_ColorRampTex, half2(luminance, 0)).rgb, _ColorRampBlend); + #endif + #endif + //--------------- + + //GREYSCALE_ON && GREYSCALEOUTLINE_ON + #if GREYSCALE_ON && GREYSCALEOUTLINE_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + luminance = saturate(luminance + _GreyscaleLuminosity); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _GreyscaleTintColor, _GreyscaleBlend); + #endif + + //----------------------------------- + + //POSTERIZE_ON && POSTERIZEOUTLINE_ON + #if POSTERIZE_ON && POSTERIZEOUTLINE_ON + col.rgb = pow(col.rgb, _PosterizeGamma) * _PosterizeNumColors; + col.rgb = floor(col.rgb) / _PosterizeNumColors; + col.rgb = pow(col.rgb, 1.0 / _PosterizeGamma); + #endif + + //----------------------------------- + + //SHINE_ON + #if SHINE_ON + half2 uvShine = uvRect; + half cosAngle = cos(_ShineRotate); + half sinAngle = sin(_ShineRotate); + half2x2 rot = half2x2(cosAngle, -sinAngle, sinAngle, cosAngle); + uvShine -= half2(0.5, 0.5); + uvShine = mul(rot, uvShine); + uvShine += half2(0.5, 0.5); + half shineMask = SAMPLE_TEXTURE2D(_ShineMask, sampler_ShineMask, d.texcoord0.xy).a; + half currentDistanceProjection = (uvShine.x + uvShine.y) / 2; + half whitePower = 1 - (abs(currentDistanceProjection - _ShineLocation) / _ShineWidth); + col.rgb += col.a * whitePower * _ShineGlow * max(sign(currentDistanceProjection - (_ShineLocation - _ShineWidth)), 0.0) + * max(sign((_ShineLocation + _ShineWidth) - currentDistanceProjection), 0.0) * _ShineColor * shineMask; + #endif + + //----------------------------------- + + //HOLOGRAM_ON + #if HOLOGRAM_ON + half totalHologram = _HologramStripesAmount + _HologramUnmodAmount; + half hologramYCoord = ((uvRect.y + (((_Time.x + randomSeed) % 1) * _HologramStripesSpeed)) % totalHologram) / totalHologram; + hologramYCoord = abs(hologramYCoord); + half alpha = RemapFloat(saturate(hologramYCoord - (_HologramUnmodAmount/totalHologram)), 0.0, 1.0, _HologramMinAlpha, saturate(_HologramMaxAlpha)); + half hologramMask = max(sign((_HologramUnmodAmount/totalHologram) - hologramYCoord), 0.0); + half4 hologramResult = col; + hologramResult.a *= lerp(alpha, 1, hologramMask); + hologramResult.rgb *= max(1, _HologramMaxAlpha * max(sign(hologramYCoord - (_HologramUnmodAmount/totalHologram)), 0.0)); + hologramMask = 1 - step(0.01,hologramMask); + hologramResult.rgb += hologramMask * _HologramStripeColor * col.a; + col = lerp(col, hologramResult, _HologramBlend); + #endif + + //----------------------------------- + + //FLICKER_ON + #if FLICKER_ON + col.a *= saturate(col.a * step(frac(0.05 + (_Time.w + randomSeed) * _FlickerFreq), 1 - _FlickerPercent) + _FlickerAlpha); + #endif + //----------------------------------- + + //ALPHACUTOFF_ON + + //ALPHAROUND_ON + + //ALPHAOUTLINE_ON + #if ALPHAOUTLINE_ON + half alphaOutlineRes = pow(1 - col.a, max(_AlphaOutlinePower, 0.0001)) * step(_AlphaOutlineMinAlpha, col.a) * _AlphaOutlineBlend; + col.rgb = lerp(col.rgb, _AlphaOutlineColor.rgb * _AlphaOutlineGlow, alphaOutlineRes); + col.a = lerp(col.a, 1, alphaOutlineRes > 1); + #endif + //------------------------------------------------------- + + //FOG_ON + + //------------------ + + col *= _Color; + o.Albedo = col; + col.a *= _Alpha; + clip(col.a - _AlphaCutoffValue - 0.01); + o.Alpha = _Color.a; + } + + + + + + void ChainSurfaceFunction(inout Surface l, inout ShaderData d) + { + Ext_SurfaceFunction0(l, d); + // Ext_SurfaceFunction1(l, d); + // Ext_SurfaceFunction2(l, d); + // Ext_SurfaceFunction3(l, d); + // Ext_SurfaceFunction4(l, d); + // Ext_SurfaceFunction5(l, d); + // Ext_SurfaceFunction6(l, d); + // Ext_SurfaceFunction7(l, d); + // Ext_SurfaceFunction8(l, d); + // Ext_SurfaceFunction9(l, d); + // Ext_SurfaceFunction10(l, d); + // Ext_SurfaceFunction11(l, d); + // Ext_SurfaceFunction12(l, d); + // Ext_SurfaceFunction13(l, d); + // Ext_SurfaceFunction14(l, d); + // Ext_SurfaceFunction15(l, d); + // Ext_SurfaceFunction16(l, d); + // Ext_SurfaceFunction17(l, d); + // Ext_SurfaceFunction18(l, d); + // Ext_SurfaceFunction19(l, d); + // Ext_SurfaceFunction20(l, d); + // Ext_SurfaceFunction21(l, d); + // Ext_SurfaceFunction22(l, d); + // Ext_SurfaceFunction23(l, d); + // Ext_SurfaceFunction24(l, d); + // Ext_SurfaceFunction25(l, d); + // Ext_SurfaceFunction26(l, d); + // Ext_SurfaceFunction27(l, d); + // Ext_SurfaceFunction28(l, d); + // Ext_SurfaceFunction29(l, d); + } + +#if !_DECALSHADER + + void ChainModifyVertex(inout VertexData v, inout VertexToPixel v2p, float4 time) + { + ExtraV2F d; + + ZERO_INITIALIZE(ExtraV2F, d); + ZERO_INITIALIZE(Blackboard, d.blackboard); + // due to motion vectors in HDRP, we need to use the last + // time in certain spots. So if you are going to use _Time to adjust vertices, + // you need to use this time or motion vectors will break. + d.time = time; + + Ext_ModifyVertex0(v, d); + // Ext_ModifyVertex1(v, d); + // Ext_ModifyVertex2(v, d); + // Ext_ModifyVertex3(v, d); + // Ext_ModifyVertex4(v, d); + // Ext_ModifyVertex5(v, d); + // Ext_ModifyVertex6(v, d); + // Ext_ModifyVertex7(v, d); + // Ext_ModifyVertex8(v, d); + // Ext_ModifyVertex9(v, d); + // Ext_ModifyVertex10(v, d); + // Ext_ModifyVertex11(v, d); + // Ext_ModifyVertex12(v, d); + // Ext_ModifyVertex13(v, d); + // Ext_ModifyVertex14(v, d); + // Ext_ModifyVertex15(v, d); + // Ext_ModifyVertex16(v, d); + // Ext_ModifyVertex17(v, d); + // Ext_ModifyVertex18(v, d); + // Ext_ModifyVertex19(v, d); + // Ext_ModifyVertex20(v, d); + // Ext_ModifyVertex21(v, d); + // Ext_ModifyVertex22(v, d); + // Ext_ModifyVertex23(v, d); + // Ext_ModifyVertex24(v, d); + // Ext_ModifyVertex25(v, d); + // Ext_ModifyVertex26(v, d); + // Ext_ModifyVertex27(v, d); + // Ext_ModifyVertex28(v, d); + // Ext_ModifyVertex29(v, d); + + + // #if %EXTRAV2F0REQUIREKEY% + // v2p.extraV2F0 = d.extraV2F0; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // v2p.extraV2F1 = d.extraV2F1; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // v2p.extraV2F2 = d.extraV2F2; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // v2p.extraV2F3 = d.extraV2F3; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // v2p.extraV2F4 = d.extraV2F4; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // v2p.extraV2F5 = d.extraV2F5; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // v2p.extraV2F6 = d.extraV2F6; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // v2p.extraV2F7 = d.extraV2F7; + // #endif + } + + void ChainModifyTessellatedVertex(inout VertexData v, inout VertexToPixel v2p) + { + ExtraV2F d; + ZERO_INITIALIZE(ExtraV2F, d); + ZERO_INITIALIZE(Blackboard, d.blackboard); + + // #if %EXTRAV2F0REQUIREKEY% + // d.extraV2F0 = v2p.extraV2F0; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // d.extraV2F1 = v2p.extraV2F1; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // d.extraV2F2 = v2p.extraV2F2; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // d.extraV2F3 = v2p.extraV2F3; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // d.extraV2F4 = v2p.extraV2F4; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // d.extraV2F5 = v2p.extraV2F5; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // d.extraV2F6 = v2p.extraV2F6; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // d.extraV2F7 = v2p.extraV2F7; + // #endif + + + // Ext_ModifyTessellatedVertex0(v, d); + // Ext_ModifyTessellatedVertex1(v, d); + // Ext_ModifyTessellatedVertex2(v, d); + // Ext_ModifyTessellatedVertex3(v, d); + // Ext_ModifyTessellatedVertex4(v, d); + // Ext_ModifyTessellatedVertex5(v, d); + // Ext_ModifyTessellatedVertex6(v, d); + // Ext_ModifyTessellatedVertex7(v, d); + // Ext_ModifyTessellatedVertex8(v, d); + // Ext_ModifyTessellatedVertex9(v, d); + // Ext_ModifyTessellatedVertex10(v, d); + // Ext_ModifyTessellatedVertex11(v, d); + // Ext_ModifyTessellatedVertex12(v, d); + // Ext_ModifyTessellatedVertex13(v, d); + // Ext_ModifyTessellatedVertex14(v, d); + // Ext_ModifyTessellatedVertex15(v, d); + // Ext_ModifyTessellatedVertex16(v, d); + // Ext_ModifyTessellatedVertex17(v, d); + // Ext_ModifyTessellatedVertex18(v, d); + // Ext_ModifyTessellatedVertex19(v, d); + // Ext_ModifyTessellatedVertex20(v, d); + // Ext_ModifyTessellatedVertex21(v, d); + // Ext_ModifyTessellatedVertex22(v, d); + // Ext_ModifyTessellatedVertex23(v, d); + // Ext_ModifyTessellatedVertex24(v, d); + // Ext_ModifyTessellatedVertex25(v, d); + // Ext_ModifyTessellatedVertex26(v, d); + // Ext_ModifyTessellatedVertex27(v, d); + // Ext_ModifyTessellatedVertex28(v, d); + // Ext_ModifyTessellatedVertex29(v, d); + + // #if %EXTRAV2F0REQUIREKEY% + // v2p.extraV2F0 = d.extraV2F0; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // v2p.extraV2F1 = d.extraV2F1; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // v2p.extraV2F2 = d.extraV2F2; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // v2p.extraV2F3 = d.extraV2F3; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // v2p.extraV2F4 = d.extraV2F4; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // v2p.extraV2F5 = d.extraV2F5; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // v2p.extraV2F6 = d.extraV2F6; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // v2p.extraV2F7 = d.extraV2F7; + // #endif + } + + void ChainFinalColorForward(inout Surface l, inout ShaderData d, inout half4 color) + { + // Ext_FinalColorForward0(l, d, color); + // Ext_FinalColorForward1(l, d, color); + // Ext_FinalColorForward2(l, d, color); + // Ext_FinalColorForward3(l, d, color); + // Ext_FinalColorForward4(l, d, color); + // Ext_FinalColorForward5(l, d, color); + // Ext_FinalColorForward6(l, d, color); + // Ext_FinalColorForward7(l, d, color); + // Ext_FinalColorForward8(l, d, color); + // Ext_FinalColorForward9(l, d, color); + // Ext_FinalColorForward10(l, d, color); + // Ext_FinalColorForward11(l, d, color); + // Ext_FinalColorForward12(l, d, color); + // Ext_FinalColorForward13(l, d, color); + // Ext_FinalColorForward14(l, d, color); + // Ext_FinalColorForward15(l, d, color); + // Ext_FinalColorForward16(l, d, color); + // Ext_FinalColorForward17(l, d, color); + // Ext_FinalColorForward18(l, d, color); + // Ext_FinalColorForward19(l, d, color); + // Ext_FinalColorForward20(l, d, color); + // Ext_FinalColorForward21(l, d, color); + // Ext_FinalColorForward22(l, d, color); + // Ext_FinalColorForward23(l, d, color); + // Ext_FinalColorForward24(l, d, color); + // Ext_FinalColorForward25(l, d, color); + // Ext_FinalColorForward26(l, d, color); + // Ext_FinalColorForward27(l, d, color); + // Ext_FinalColorForward28(l, d, color); + // Ext_FinalColorForward29(l, d, color); + } + + void ChainFinalGBufferStandard(inout Surface s, inout ShaderData d, inout half4 GBuffer0, inout half4 GBuffer1, inout half4 GBuffer2, inout half4 outEmission, inout half4 outShadowMask) + { + // Ext_FinalGBufferStandard0(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard1(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard2(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard3(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard4(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard5(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard6(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard7(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard8(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard9(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard10(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard11(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard12(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard13(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard14(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard15(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard16(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard17(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard18(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard19(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard20(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard21(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard22(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard23(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard24(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard25(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard26(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard27(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard28(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard29(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + } +#endif + + + + + +#if _DECALSHADER + + ShaderData CreateShaderData(SurfaceDescriptionInputs IN) + { + ShaderData d = (ShaderData)0; + d.TBNMatrix = float3x3(IN.WorldSpaceTangent, IN.WorldSpaceBiTangent, IN.WorldSpaceNormal); + d.worldSpaceNormal = IN.WorldSpaceNormal; + d.worldSpaceTangent = IN.WorldSpaceTangent; + + d.worldSpacePosition = IN.WorldSpacePosition; + d.texcoord0 = IN.uv0.xyxy; + d.screenPos = IN.ScreenPosition; + + d.worldSpaceViewDir = normalize(_WorldSpaceCameraPos - d.worldSpacePosition); + + d.tangentSpaceViewDir = mul(d.TBNMatrix, d.worldSpaceViewDir); + + // these rarely get used, so we back transform them. Usually will be stripped. + #if _HDRP + // d.localSpacePosition = mul(GetWorldToObjectMatrix(), float4(GetCameraRelativePositionWS(d.worldSpacePosition), 1)).xyz; + #else + // d.localSpacePosition = mul(GetWorldToObjectMatrix(), float4(d.worldSpacePosition, 1)).xyz; + #endif + // d.localSpaceNormal = normalize(mul((float3x3)GetWorldToObjectMatrix(), d.worldSpaceNormal)); + // d.localSpaceTangent = normalize(mul((float3x3)GetWorldToObjectMatrix(), d.worldSpaceTangent.xyz)); + + // #if %SCREENPOSREQUIREKEY% + // d.screenUV = (IN.ScreenPosition.xy / max(0.01, IN.ScreenPosition.w)); + // #endif + + return d; + } +#else + + ShaderData CreateShaderData(VertexToPixel i + #if NEED_FACING + , bool facing + #endif + ) + { + ShaderData d = (ShaderData)0; + d.clipPos = i.pos; + d.worldSpacePosition = i.worldPos; + + d.worldSpaceNormal = normalize(i.worldNormal); + d.worldSpaceTangent.xyz = normalize(i.worldTangent.xyz); + + d.tangentSign = i.worldTangent.w * unity_WorldTransformParams.w; + float3 bitangent = cross(d.worldSpaceTangent.xyz, d.worldSpaceNormal) * d.tangentSign; + + d.TBNMatrix = float3x3(d.worldSpaceTangent, -bitangent, d.worldSpaceNormal); + d.worldSpaceViewDir = normalize(_WorldSpaceCameraPos - i.worldPos); + + d.tangentSpaceViewDir = mul(d.TBNMatrix, d.worldSpaceViewDir); + d.texcoord0 = i.texcoord0; + d.texcoord1 = i.texcoord1; + d.texcoord2 = i.texcoord2; + + // #if %TEXCOORD3REQUIREKEY% + d.texcoord3 = i.texcoord3; + // #endif + + // d.isFrontFace = facing; + // #if %VERTEXCOLORREQUIREKEY% + d.vertexColor = i.vertexColor; + // #endif + + // these rarely get used, so we back transform them. Usually will be stripped. + #if _HDRP + // d.localSpacePosition = mul(GetWorldToObjectMatrix(), float4(GetCameraRelativePositionWS(i.worldPos), 1)).xyz; + #else + // d.localSpacePosition = mul(GetWorldToObjectMatrix(), float4(i.worldPos, 1)).xyz; + #endif + // d.localSpaceNormal = normalize(mul((float3x3)GetWorldToObjectMatrix(), i.worldNormal)); + // d.localSpaceTangent = normalize(mul((float3x3)GetWorldToObjectMatrix(), i.worldTangent.xyz)); + + // #if %SCREENPOSREQUIREKEY% + // d.screenPos = i.screenPos; + // d.screenUV = (i.screenPos.xy / i.screenPos.w); + // #endif + + + // #if %EXTRAV2F0REQUIREKEY% + // d.extraV2F0 = i.extraV2F0; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // d.extraV2F1 = i.extraV2F1; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // d.extraV2F2 = i.extraV2F2; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // d.extraV2F3 = i.extraV2F3; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // d.extraV2F4 = i.extraV2F4; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // d.extraV2F5 = i.extraV2F5; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // d.extraV2F6 = i.extraV2F6; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // d.extraV2F7 = i.extraV2F7; + // #endif + + return d; + } + +#endif + + + +#if (SHADERPASS == SHADERPASS_LIGHT_TRANSPORT) + + // This was not in constant buffer in original unity, so keep outiside. But should be in as ShaderRenderPass frequency + float unity_OneOverOutputBoost; + float unity_MaxOutputValue; + + CBUFFER_START(UnityMetaPass) + // x = use uv1 as raster position + // y = use uv2 as raster position + bool4 unity_MetaVertexControl; + + // x = return albedo + // y = return normal + bool4 unity_MetaFragmentControl; + CBUFFER_END + + VertexToPixel Vert(VertexData inputMesh) + { + VertexToPixel output; + ZERO_INITIALIZE(VertexToPixel, output); + UNITY_SETUP_INSTANCE_ID(inputMesh); + UNITY_TRANSFER_INSTANCE_ID(inputMesh, output); + UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(output); + + // Output UV coordinate in vertex shader + float2 uv = float2(0.0, 0.0); + + if (unity_MetaVertexControl.x) + { + uv = inputMesh.texcoord1.xy * unity_LightmapST.xy + unity_LightmapST.zw; + } + else if (unity_MetaVertexControl.y) + { + uv = inputMesh.texcoord2.xy * unity_DynamicLightmapST.xy + unity_DynamicLightmapST.zw; + } + + // OpenGL right now needs to actually use the incoming vertex position + // so we create a fake dependency on it here that haven't any impact. + output.pos = float4(uv * 2.0 - 1.0, inputMesh.vertex.z > 0 ? 1.0e-4 : 0.0, 1.0); + + output.worldPos = TransformObjectToWorld(inputMesh.vertex.xyz).xyz; + + // Normal is required for triplanar mapping + output.worldNormal = TransformObjectToWorldNormal(inputMesh.normal); + // Not required but assign to silent compiler warning + output.worldTangent = float4(1.0, 0.0, 0.0, 0.0); + + output.texcoord0 = inputMesh.texcoord0; + output.texcoord1 = inputMesh.texcoord1; + output.texcoord2 = inputMesh.texcoord2; + // #if %TEXCOORD3REQUIREKEY% + output.texcoord3 = inputMesh.texcoord3; + // #endif + // #if %VERTEXCOLORREQUIREKEY% + output.vertexColor = inputMesh.vertexColor; + // #endif + + return output; + } +#else + + #if (_PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR))) + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/ShaderVariablesMatrixDefsHDCamera.hlsl" + + void MotionVectorPositionZBias(VertexToPixel input) + { + #if UNITY_REVERSED_Z + input.pos.z -= unity_MotionVectorsParams.z * input.pos.w; + #else + input.pos.z += unity_MotionVectorsParams.z * input.pos.w; + #endif + } + + #endif + + VertexToPixel Vert(VertexData input) + { + VertexToPixel output; + ZERO_INITIALIZE(VertexToPixel, output); + + UNITY_SETUP_INSTANCE_ID(input); + UNITY_TRANSFER_INSTANCE_ID(input, output); + UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(output); + + #if _HDRP && (_PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR))) + VertexData previousMesh = input; + #endif + + ChainModifyVertex(input, output, _Time); + + // This return the camera relative position (if enable) + float3 positionRWS = TransformObjectToWorld(input.vertex.xyz); + float3 normalWS = TransformObjectToWorldNormal(input.normal); + float4 tangentWS = float4(TransformObjectToWorldDir(input.tangent.xyz), input.tangent.w); + + + output.worldPos = GetAbsolutePositionWS(positionRWS); + output.pos = TransformWorldToHClip(positionRWS); + output.worldNormal = normalWS; + output.worldTangent = tangentWS; + + + output.texcoord0 = input.texcoord0; + output.texcoord1 = input.texcoord1; + output.texcoord2 = input.texcoord2; + + // #if %TEXCOORD3REQUIREKEY% + output.texcoord3 = input.texcoord3; + // #endif + + // #if %VERTEXCOLORREQUIREKEY% + output.vertexColor = input.vertexColor; + // #endif + + // #if %SCREENPOSREQUIREKEY% + // output.screenPos = ComputeScreenPos(output.pos, _ProjectionParams.x); + // #endif + + #if _HDRP && (_PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR))) + + #if !defined(TESSELLATION_ON) + MotionVectorPositionZBias(output); + #endif + + output.motionVectorCS = mul(UNITY_MATRIX_UNJITTERED_VP, float4(positionRWS.xyz, 1.0)); + // Note: unity_MotionVectorsParams.y is 0 is forceNoMotion is enabled + bool forceNoMotion = unity_MotionVectorsParams.y == 0.0; + if (forceNoMotion) + { + output.previousPositionCS = float4(0.0, 0.0, 0.0, 1.0); + } + else + { + bool hasDeformation = unity_MotionVectorsParams.x > 0.0; // Skin or morph target + + float3 effectivePositionOS = (hasDeformation ? previousMesh.previousPositionOS : previousMesh.vertex.xyz); + #if defined(_ADD_PRECOMPUTED_VELOCITY) + effectivePositionOS -= input.precomputedVelocity; + #endif + + previousMesh.vertex = float4(effectivePositionOS, 1); + VertexToPixel dummy = (VertexToPixel)0; + + + ChainModifyVertex(previousMesh, dummy, _LastTimeParameters); + + // we might need this for skinned objects? + //float3 normalWS = TransformPreviousObjectToWorldNormal(input.normal).xyz; + float3 previousPositionRWS = TransformPreviousObjectToWorld(previousMesh.vertex.xyz); + + #ifdef _WRITE_TRANSPARENT_MOTION_VECTOR + if (_TransparentCameraOnlyMotionVectors > 0) + { + previousPositionRWS = positionRWS.xyz; + } + #endif // _WRITE_TRANSPARENT_MOTION_VECTOR + + output.previousPositionCS = mul(UNITY_MATRIX_PREV_VP, float4(previousPositionRWS, 1.0)); + } + #endif // _HDRP && _PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR)) + + + return output; + } + + +#endif + + + + + + + + #if defined(WRITE_DECAL_BUFFER) && !defined(_DISABLE_DECALS) + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/Decal/DecalPrepassBuffer.hlsl" + #endif + + FragInputs BuildFragInputs(VertexToPixel input) + { + UNITY_SETUP_INSTANCE_ID(input); + FragInputs output; + ZERO_INITIALIZE(FragInputs, output); + + // Init to some default value to make the computer quiet (else it output 'divide by zero' warning even if value is not used). + // TODO: this is a really poor workaround, but the variable is used in a bunch of places + // to compute normals which are then passed on elsewhere to compute other values... + output.tangentToWorld = k_identity3x3; + output.positionSS = input.pos; // input.positionCS is SV_Position + // BETTER SHADERS: because we transform world position into actual world space for things like + // triplanar, etc, we have to back transform it here for lighting + output.positionRWS = GetCameraRelativePositionWS(input.worldPos); + output.tangentToWorld = BuildTangentToWorld(input.worldTangent, input.worldNormal); + output.texCoord0 = input.texcoord0; + output.texCoord1 = input.texcoord1; + output.texCoord2 = input.texcoord2; + + return output; + } + +#if UNITY_VERSION > UNITY_2022_3_12 + void ApplyDecalAndGetNormal(FragInputs fragInputs, PositionInputs posInput, Surface surfaceDescription, float3 normalTS, + inout SurfaceData surfaceData) + { + float3 doubleSidedConstants = GetDoubleSidedConstants(); + + #ifdef DECAL_NORMAL_BLENDING + // SG nodes don't ouptut surface gradients, so if decals require surf grad blending, we have to convert + // the normal to gradient before applying the decal. We then have to resolve the gradient back to world space + normalTS = SurfaceGradientFromTangentSpaceNormalAndFromTBN(normalTS, + fragInputs.tangentToWorld[0], fragInputs.tangentToWorld[1]); + + + #if HAVE_DECALS + if (_EnableDecals) + { + float alpha = 1.0; + alpha = surfaceDescription.Alpha; + + DecalSurfaceData decalSurfaceData = GetDecalSurfaceData(posInput, fragInputs, alpha); + ApplyDecalToSurfaceNormal(decalSurfaceData, fragInputs.tangentToWorld[2], normalTS); + ApplyDecalToSurfaceDataNoNormal(decalSurfaceData, surfaceData); + } + #endif + + GetNormalWS_SG(fragInputs, normalTS, surfaceData.normalWS, doubleSidedConstants); + #else + // normal delivered to master node + + #if HAVE_DECALS + if (_EnableDecals) + { + float alpha = 1.0; + alpha = surfaceDescription.Alpha; + + // Both uses and modifies 'surfaceData.normalWS'. + DecalSurfaceData decalSurfaceData = GetDecalSurfaceData(posInput, fragInputs, alpha); + ApplyDecalToSurfaceNormal(decalSurfaceData, surfaceData.normalWS.xyz); + ApplyDecalToSurfaceDataNoNormal(decalSurfaceData, surfaceData); + } + #endif + #endif + } +#endif + + void BuildSurfaceData(FragInputs fragInputs, inout Surface surfaceDescription, float3 V, PositionInputs posInput, out SurfaceData surfaceData, out float3 bentNormalWS) + { + // setup defaults -- these are used if the graph doesn't output a value + ZERO_INITIALIZE(SurfaceData, surfaceData); + + // specularOcclusion need to be init ahead of decal to quiet the compiler that modify the SurfaceData struct + // however specularOcclusion can come from the graph, so need to be init here so it can be override. + surfaceData.specularOcclusion = 1.0; + + // copy across graph values, if defined + surfaceData.baseColor = surfaceDescription.Albedo; + surfaceData.perceptualSmoothness = surfaceDescription.Smoothness; + surfaceData.ambientOcclusion = surfaceDescription.Occlusion; + surfaceData.specularOcclusion = surfaceDescription.SpecularOcclusion; + surfaceData.metallic = surfaceDescription.Metallic; + surfaceData.subsurfaceMask = surfaceDescription.SubsurfaceMask; + surfaceData.thickness = surfaceDescription.Thickness; + surfaceData.diffusionProfileHash = asuint(surfaceDescription.DiffusionProfileHash); + #if _USESPECULAR + surfaceData.specularColor = surfaceDescription.Specular; + #endif + surfaceData.coatMask = surfaceDescription.CoatMask; + surfaceData.anisotropy = surfaceDescription.Anisotropy; + surfaceData.iridescenceMask = surfaceDescription.IridescenceMask; + surfaceData.iridescenceThickness = surfaceDescription.IridescenceThickness; + + + + #if defined(_REFRACTION_PLANE) || defined(_REFRACTION_SPHERE) || defined(_REFRACTION_THIN) + if (_EnableSSRefraction) + { + surfaceData.transmittanceMask = (1.0 - surfaceDescription.Alpha); + surfaceDescription.Alpha = 1.0; + } + else + { + surfaceData.ior = surfaceDescription.ior; + surfaceData.transmittanceColor = surfaceDescription.transmittanceColor; + surfaceData.atDistance = surfaceDescription.atDistance; + surfaceData.transmittanceMask = surfaceDescription.transmittanceMask; + surfaceDescription.Alpha = 1.0; + } + #else + surfaceData.ior = 1.0; + surfaceData.transmittanceColor = float3(1.0, 1.0, 1.0); + surfaceData.atDistance = 1.0; + surfaceData.transmittanceMask = 0.0; + #endif + + + + // These static material feature allow compile time optimization + surfaceData.materialFeatures = MATERIALFEATUREFLAGS_LIT_STANDARD; + #ifdef _MATERIAL_FEATURE_SUBSURFACE_SCATTERING + surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_SUBSURFACE_SCATTERING; + #endif + + #ifdef _MATERIAL_FEATURE_TRANSMISSION + surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_TRANSMISSION; + #endif + + #ifdef _MATERIAL_FEATURE_ANISOTROPY + surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_ANISOTROPY; + surfaceData.normalWS = float3(0, 1, 0); + #endif + + #ifdef _MATERIAL_FEATURE_IRIDESCENCE + surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_IRIDESCENCE; + #endif + + #ifdef _MATERIAL_FEATURE_SPECULAR_COLOR + surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_SPECULAR_COLOR; + #endif + + #if defined(_MATERIAL_FEATURE_CLEAR_COAT) || _CLEARCOAT + surfaceData.materialFeatures |= MATERIALFEATUREFLAGS_LIT_CLEAR_COAT; + #endif + + #if defined (_MATERIAL_FEATURE_SPECULAR_COLOR) && defined (_ENERGY_CONSERVING_SPECULAR) + // Require to have setup baseColor + // Reproduce the energy conservation done in legacy Unity. Not ideal but better for compatibility and users can unchek it + surfaceData.baseColor *= (1.0 - Max3(surfaceData.specularColor.r, surfaceData.specularColor.g, surfaceData.specularColor.b)); + #endif + + float3 normalTS = surfaceDescription.Normal; + #if !_WORLDSPACENORMAL + surfaceData.normalWS = mul(surfaceDescription.Normal, fragInputs.tangentToWorld); + #else + normalTS = mul(fragInputs.tangentToWorld, surfaceDescription.Normal); + surfaceData.normalWS = surfaceDescription.Normal; + #endif + + + #if UNITY_VERSION > UNITY_2022_3_12 + ApplyDecalAndGetNormal(fragInputs, posInput, surfaceDescription, normalTS, surfaceData); + #else + #ifdef DECAL_NORMAL_BLENDING + #if HAVE_DECALS + float alpha = 1.0; + alpha = surfaceDescription.Alpha; + if (_EnableDecals) + { + DecalSurfaceData decalSurfaceData = GetDecalSurfaceData(posInput, fragInputs, alpha); + ApplyDecalToSurfaceData(decalSurfaceData, fragInputs.tangentToWorld[2], surfaceData, normalTS); + } + #endif + #else + #if HAVE_DECALS + if (_EnableDecals) + { + float alpha = 1.0; + alpha = surfaceDescription.Alpha; + // Both uses and modifies 'surfaceData.normalWS'. + DecalSurfaceData decalSurfaceData = GetDecalSurfaceData(posInput, fragInputs, alpha); + ApplyDecalToSurfaceData(decalSurfaceData, fragInputs.tangentToWorld[2], surfaceData); + } + #endif + #endif + #endif + + + + surfaceData.geomNormalWS = fragInputs.tangentToWorld[2]; + + surfaceData.tangentWS = normalize(fragInputs.tangentToWorld[0].xyz); // The tangent is not normalize in tangentToWorld for mikkt. TODO: Check if it expected that we normalize with Morten. Tag: SURFACE_GRADIENT + + + bentNormalWS = surfaceData.normalWS; + + surfaceData.tangentWS = Orthonormalize(surfaceData.tangentWS, surfaceData.normalWS); + + #ifdef DEBUG_DISPLAY + if (_DebugMipMapMode != DEBUGMIPMAPMODE_NONE) + { + // TODO: need to update mip info + surfaceData.metallic = 0; + } + + // We need to call ApplyDebugToSurfaceData after filling the surfarcedata and before filling builtinData + // as it can modify attribute use for static lighting + ApplyDebugToSurfaceData(fragInputs.tangentToWorld, surfaceData); + #endif + + // By default we use the ambient occlusion with Tri-ace trick (apply outside) for specular occlusion. + // If user provide bent normal then we process a better term + #if defined(_SPECULAR_OCCLUSION_CUSTOM) + // Just use the value passed through via the slot (not active otherwise) + #elif defined(_SPECULAR_OCCLUSION_FROM_AO_BENT_NORMAL) + // If we have bent normal and ambient occlusion, process a specular occlusion + surfaceData.specularOcclusion = GetSpecularOcclusionFromBentAO(V, bentNormalWS, surfaceData.normalWS, surfaceData.ambientOcclusion, PerceptualSmoothnessToPerceptualRoughness(surfaceData.perceptualSmoothness)); + #elif defined(_AMBIENT_OCCLUSION) && defined(_SPECULAR_OCCLUSION_FROM_AO) + surfaceData.specularOcclusion = GetSpecularOcclusionFromAmbientOcclusion(ClampNdotV(dot(surfaceData.normalWS, V)), surfaceData.ambientOcclusion, PerceptualSmoothnessToRoughness(surfaceData.perceptualSmoothness)); + #endif + + #if defined(_ENABLE_GEOMETRIC_SPECULAR_AA) && !defined(SHADER_STAGE_RAY_TRACING) + surfaceData.perceptualSmoothness = GeometricNormalFiltering(surfaceData.perceptualSmoothness, fragInputs.tangentToWorld[2], surfaceDescription.SpecularAAScreenSpaceVariance, surfaceDescription.SpecularAAThreshold); + #endif + } + + void GetSurfaceAndBuiltinData(VertexToPixel m2ps, FragInputs fragInputs, float3 V, inout PositionInputs posInput, + out SurfaceData surfaceData, out BuiltinData builtinData, inout Surface l, inout ShaderData d + #if NEED_FACING + , bool facing + #endif + ) + { + // Removed since crossfade does not work, probably needs extra material setup. + //#if !defined(SHADER_STAGE_RAY_TRACING) && !defined(_TESSELLATION_DISPLACEMENT) + // #ifdef LOD_FADE_CROSSFADE // enable dithering LOD transition if user select CrossFade transition in LOD group + // LODDitheringTransition(ComputeFadeMaskSeed(V, posInput.positionSS), unity_LODFade.x); + // #endif + //#endif + + + + + d = CreateShaderData(m2ps + #if NEED_FACING + , facing + #endif + ); + + l = (Surface)0; + + l.Albedo = half3(0.5, 0.5, 0.5); + l.Normal = float3(0,0,1); + l.Occlusion = 1; + l.Alpha = 1; + l.SpecularOcclusion = 1; + + #if !defined(SHADER_STAGE_RAY_TRACING) && defined(_DEPTHOFFSET_ON) + l.outputDepth = d.clipPos.z; + #endif + + ChainSurfaceFunction(l, d); + + #if !defined(SHADER_STAGE_RAY_TRACING) && defined(_DEPTHOFFSET_ON) + posInput.deviceDepth = l.outputDepth; + #endif + + #if _UNLIT + //l.Emission = l.Albedo; + //l.Albedo = 0; + l.Normal = half3(0,0,1); + l.Occlusion = 1; + l.Metallic = 0; + l.Specular = 0; + #endif + + surfaceData.geomNormalWS = d.worldSpaceNormal; + surfaceData.tangentWS = d.worldSpaceTangent; + fragInputs.tangentToWorld = d.TBNMatrix; + + float3 bentNormalWS; + + BuildSurfaceData(fragInputs, l, V, posInput, surfaceData, bentNormalWS); + + + float4 lightmapTexCoord1 = fragInputs.texCoord1; + float4 lightmapTexCoord2 = fragInputs.texCoord2; + //#ifdef FRAG_INPUTS_USE_TEXCOORD1 + // float4 lightmapTexCoord1 = fragInputs.texCoord1; + // #else + // float4 lightmapTexCoord1 = float4(0,0,0,0); + // #endif + + // #ifdef FRAG_INPUTS_USE_TEXCOORD2 + // float4 lightmapTexCoord2 = fragInputs.texCoord2; + // #else + // float4 lightmapTexCoord2 = float4(0,0,0,0); + // #endif + + + InitBuiltinData(posInput, l.Alpha, bentNormalWS, -d.worldSpaceNormal, lightmapTexCoord1, lightmapTexCoord2, builtinData); + + + + builtinData.emissiveColor = l.Emission; + + #if defined(_OVERRIDE_BAKEDGI) + builtinData.bakeDiffuseLighting = l.DiffuseGI; + builtinData.backBakeDiffuseLighting = l.BackDiffuseGI; + builtinData.emissiveColor += l.SpecularGI; + #endif + + #if defined(_OVERRIDE_SHADOWMASK) + builtinData.shadowMask0 = l.ShadowMask.x; + builtinData.shadowMask1 = l.ShadowMask.y; + builtinData.shadowMask2 = l.ShadowMask.z; + builtinData.shadowMask3 = l.ShadowMask.w; + #endif + + #ifdef UNITY_VIRTUAL_TEXTURING + //builtinData.vtPackedFeedback = surfaceData.VTPackedFeedback; + #endif + + #if (SHADERPASS == SHADERPASS_DISTORTION) + builtinData.distortion = surfaceData.Distortion; + builtinData.distortionBlur = surfaceData.DistortionBlur; + #endif + + #ifndef SHADER_UNLIT + // PostInitBuiltinData call ApplyDebugToBuiltinData + PostInitBuiltinData(V, posInput, surfaceData, builtinData); + #else + ApplyDebugToBuiltinData(builtinData); + #endif + + RAY_TRACING_OPTIONAL_ALPHA_TEST_PASS + } + + + +#define DEBUG_DISPLAY +#include "Packages/com.unity.render-pipelines.high-definition/Runtime/Debug/DebugDisplay.hlsl" +#include "Packages/com.unity.render-pipelines.high-definition/Runtime/Debug/FullScreenDebug.hlsl" + + #if !defined(_DEPTHOFFSET_ON) + [earlydepthstencil] // quad overshading debug mode writes to UAV + #endif + void Frag(VertexToPixel v2f + #if NEED_FACING + , bool facing : SV_IsFrontFace + #endif + ) + { + UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX(v2f); + FragInputs input = BuildFragInputs(v2f); + + PositionInputs posInput = GetPositionInput(input.positionSS.xy, _ScreenSize.zw, input.positionSS.z, input.positionSS.w, input.positionRWS.xyz); + + #ifdef PLATFORM_SUPPORTS_PRIMITIVE_ID_IN_PIXEL_SHADER + if (_DebugFullScreenMode == FULLSCREENDEBUGMODE_QUAD_OVERDRAW) + { + IncrementQuadOverdrawCounter(posInput.positionSS.xy, input.primitiveID); + } + #endif + } + + ENDHLSL + } + + + + + + } + + + + CustomEditor "AllIn1SpriteShaderLitMaterialInspector" +} diff --git a/Assets/Plugins/AllIn1SpriteShader/Shaders/LitShaders/AllIn1SpriteShaderLit_BetterShader_HDRP2023.txt.meta b/Assets/Plugins/AllIn1SpriteShader/Shaders/LitShaders/AllIn1SpriteShaderLit_BetterShader_HDRP2023.txt.meta new file mode 100644 index 000000000..31351d847 --- /dev/null +++ b/Assets/Plugins/AllIn1SpriteShader/Shaders/LitShaders/AllIn1SpriteShaderLit_BetterShader_HDRP2023.txt.meta @@ -0,0 +1,14 @@ +fileFormatVersion: 2 +guid: a1f8afb0017813b4aac0394c15f9f2a5 +TextScriptImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 156513 + packageName: All In 1 Sprite Shader + packageVersion: 4.25 + assetPath: Assets/Plugins/AllIn1SpriteShader/Shaders/LitShaders/AllIn1SpriteShaderLit_BetterShader_HDRP2023.txt + uploadId: 708810 diff --git a/Assets/Plugins/AllIn1SpriteShader/Shaders/LitShaders/AllIn1SpriteShaderLit_BetterShader_Standard.txt b/Assets/Plugins/AllIn1SpriteShader/Shaders/LitShaders/AllIn1SpriteShaderLit_BetterShader_Standard.txt new file mode 100644 index 000000000..81196587f --- /dev/null +++ b/Assets/Plugins/AllIn1SpriteShader/Shaders/LitShaders/AllIn1SpriteShaderLit_BetterShader_Standard.txt @@ -0,0 +1,17688 @@ +//////////////////////////////////////// +// Generated with Better Shaders +// +// Auto-generated shader code, don't hand edit! +// +// Unity Version: 2019.4.16f1 +// Render Pipeline: Standard +// Platform: WindowsEditor +//////////////////////////////////////// + + +Shader "AllIn1SpriteShader/AllIn1SpriteShaderLit_BetterShader" +{ + Properties + { + + _MainTex ("Main Texture", 2D) = "white" {} //0 + _Color("Main Color", Color) = (1,1,1,1) //1 + _Alpha("General Alpha", Range(0,1)) = 1 //2 + + _GlowColor("Glow Color", Color) = (1,1,1,1) //3 + _Glow("Glow Color Intensity", Range(0,100)) = 10 //4 + _GlowGlobal("Global Glow Intensity", Range(1,100)) = 1 //5 + [NoScaleOffset] _GlowTex("Glow Texture", 2D) = "white" {} //6 + + _FadeTex("Fade Texture", 2D) = "white" {} //7 + _FadeAmount("Fade Amount", Range(-0.1,1)) = -0.1 //8 + _FadeBurnWidth("Fade Burn Width", Range(0,1)) = 0.025 //9 + _FadeBurnTransition("Burn Transition", Range(0.01,0.5)) = 0.075 //10 + _FadeBurnColor("Fade Burn Color", Color) = (1,1,0,1) //11 + _FadeBurnTex("Fade Burn Texture", 2D) = "white" {} //12 + _FadeBurnGlow("Fade Burn Glow", Range(1,250)) = 2//13 + + _OutlineColor("Outline Base Color", Color) = (1,1,1,1) //14 + _OutlineAlpha("Outline Base Alpha", Range(0,1)) = 1 //15 + _OutlineGlow("Outline Base Glow", Range(1,100)) = 1.5 //16 + _OutlineWidth("Outline Base Width", Range(0,0.2)) = 0.004 //17 + _OutlinePixelWidth("Outline Base Pixel Width", Int) = 1 //18 + + [Space] + _OutlineTex("Outline Texture", 2D) = "white" {} //19 + _OutlineTexXSpeed("Texture scroll speed X", Range(-50,50)) = 10 //20 + _OutlineTexYSpeed("Texture scroll speed Y", Range(-50,50)) = 0 //21 + + [Space] + _OutlineDistortTex("Outline Distortion Texture", 2D) = "white" {} //22 + _OutlineDistortAmount("Outline Distortion Amount", Range(0,2)) = 0.5 //23 + _OutlineDistortTexXSpeed("Distortion scroll speed X", Range(-50,50)) = 5 //24 + _OutlineDistortTexYSpeed("Distortion scroll speed Y", Range(-50,50)) = 5 //25 + + _AlphaOutlineColor("Color", Color) = (1, 1, 1, 1) //26 + _AlphaOutlineGlow("Outline Glow", Range(1,100)) = 5 //27 + _AlphaOutlinePower("Power", Range(0, 5)) = 1 // 28 + _AlphaOutlineMinAlpha("Min Alpha", Range(0, 1)) = 0 // 29 + _AlphaOutlineBlend("Blend", Range(0, 1)) = 1 // 30 + + _GradBlend("Gradient Blend", Range(0,1)) = 1 //31 + _GradTopLeftCol("Top Color", Color) = (1,0,0,1) //32 + _GradTopRightCol("Top Color 2", Color) = (1, 1, 0, 1) //33 + _GradBotLeftCol("Bot Color", Color) = (0,0,1,1) //34 + _GradBotRightCol("Bot Color 2", Color) = (0, 1, 0, 1) //35 + + [NoScaleOffset] _ColorSwapTex("Color Swap Texture", 2D) = "black" {} //36 + [HDR] _ColorSwapRed("Red Channel", Color) = (1,1,1,1) //37 + _ColorSwapRedLuminosity("Red luminosity", Range(-1,1)) = 0.5 //38 + [HDR] _ColorSwapGreen("Green Channel", Color) = (1,1,1,1) //39 + _ColorSwapGreenLuminosity("Green luminosity", Range(-1,1)) = 0.5 //40 + [HDR] _ColorSwapBlue("Blue Channel", Color) = (1,1,1,1) //41 + _ColorSwapBlueLuminosity("Blue luminosity", Range(-1,1)) = 0.5 //42 + + _HsvShift("Hue Shift", Range(0, 360)) = 180 //43 + _HsvSaturation("Saturation", Range(0, 2)) = 1 //44 + _HsvBright("Brightness", Range(0, 2)) = 1 //45 + + _HitEffectColor("Hit Effect Color", Color) = (1,1,1,1) //46 + _HitEffectGlow("Glow Intensity", Range(1,100)) = 5 //47 + [Space] + _HitEffectBlend("Hit Effect Blend", Range(0,1)) = 1 //48 + + _NegativeAmount("Negative Amount", Range(0, 1)) = 1 //49 + + _PixelateSize("Pixelate size", Range(4,512)) = 32 //50 + + [NoScaleOffset] _ColorRampTex("Color ramp Texture", 2D) = "white" {} //51 + _ColorRampLuminosity("Color ramp luminosity", Range(-1,1)) = 0 //52 + [Toggle()] _ColorRampOutline("Affects everything?", float) = 0 //53 + + _GreyscaleLuminosity("Greyscale luminosity", Range(-1,1)) = 0 //54 + [Toggle()] _GreyscaleOutline("Affects everything?", float) = 0 //55 + _GreyscaleTintColor("Greyscale Tint Color", Color) = (1,1,1,1) //56 + + _PosterizeNumColors("Number of Colors", Range(0,100)) = 8 //57 + _PosterizeGamma("Posterize Amount", Range(0.1,10)) = 0.75 //58 + [Toggle()] _PosterizeOutline("Affects everything?", float) = 0 //59 + + _BlurIntensity("Blur Intensity", Range(0,100)) = 10 //60 + [Toggle()] _BlurHD("Blur is Low Res?", float) = 0 //61 + + _MotionBlurAngle("Motion Blur Angle", Range(-1, 1)) = 0.1 //62 + _MotionBlurDist("Motion Blur Distance", Range(-3, 3)) = 1.25 //63 + + _GhostColorBoost("Ghost Color Boost", Range(0,5)) = 1 //64 + _GhostTransparency("Ghost Transparency", Range(0,1)) = 0 //65 + + _InnerOutlineColor("Inner Outline Color", Color) = (1,0,0,1) //66 + _InnerOutlineThickness("Outline Thickness", Range(0,3)) = 1 //67 + _InnerOutlineAlpha("Inner Outline Alpha", Range(0,1)) = 1 //68 + _InnerOutlineGlow("Inner Outline Glow", Range(1,250)) = 4 //69 + + _AlphaCutoffValue("Alpha cutoff value", Range(0, 1)) = 0.25 //70 + + [Toggle()] _OnlyOutline("Only render outline?", float) = 0 //71 + [Toggle()] _OnlyInnerOutline("Only render inner outline?", float) = 0 //72 + + _HologramStripesAmount("Stripes Amount", Range(0, 1)) = 0.1 //73 + _HologramUnmodAmount("Unchanged Amount", Range(0, 1)) = 0.0 //74 + _HologramStripesSpeed("Stripes Speed", Range(-20, 20)) = 4.5 //75 + _HologramMinAlpha("Min Alpha", Range(0, 1)) = 0.1 //76 + _HologramMaxAlpha("Max Alpha", Range(0, 100)) = 0.75 //77 + + _ChromAberrAmount("ChromAberr Amount", Range(0, 1)) = 1 //78 + _ChromAberrAlpha("ChromAberr Alpha", Range(0, 1)) = 0.4 //79 + + _GlitchAmount("Glitch Amount", Range(0, 20)) = 3 //80 + + _FlickerPercent("Flicker Percent", Range(0, 1)) = 0.05 //81 + _FlickerFreq("Flicker Frequency", Range(0, 5)) = 0.2 //82 + _FlickerAlpha("Flicker Alpha", Range(0, 1)) = 0 //83 + + _ShadowX("Shadow X Axis", Range(-0.5, 0.5)) = 0.1 //84 + _ShadowY("Shadow Y Axis", Range(-0.5, 0.5)) = -0.05 //85 + _ShadowAlpha("Shadow Alpha", Range(0, 1)) = 0.5 //86 + _ShadowColor("Shadow Color", Color) = (0, 0, 0, 1) //87 + + _HandDrawnAmount("Hand Drawn Amount", Range(0, 20)) = 10 //88 + _HandDrawnSpeed("Hand Drawn Speed", Range(1, 15)) = 5 //89 + + _GrassSpeed("Speed", Range(0,50)) = 2 //90 + _GrassWind("Bend amount", Range(0,50)) = 20 //91 + [Space] + [Toggle()] _GrassManualToggle("Manually animated?", float) = 0 //92 + _GrassManualAnim("Manual Anim Value", Range(-1,1)) = 1 //93 + + _WaveAmount("Wave Amount", Range(0, 25)) = 7 //94 + _WaveSpeed("Wave Speed", Range(0, 25)) = 10 //95 + _WaveStrength("Wave Strength", Range(0, 25)) = 7.5 //96 + _WaveX("Wave X Axis", Range(0, 1)) = 0 //97 + _WaveY("Wave Y Axis", Range(0, 1)) = 0.5 //98 + + _RectSize("Rect Size", Range(1, 4)) = 1 //99 + + _OffsetUvX("X axis", Range(-1, 1)) = 0 //100 + _OffsetUvY("Y axis", Range(-1, 1)) = 0 //101 + + _ClipUvLeft("Clipping Left", Range(0, 1)) = 0 //102 + _ClipUvRight("Clipping Right", Range(0, 1)) = 0 //103 + _ClipUvUp("Clipping Up", Range(0, 1)) = 0 //104 + _ClipUvDown("Clipping Down", Range(0, 1)) = 0 //105 + + _TextureScrollXSpeed("Speed X Axis", Range(-5, 5)) = 1 //106 + _TextureScrollYSpeed("Speed Y Axis", Range(-5, 5)) = 0 //107 + + _ZoomUvAmount("Zoom Amount", Range(0.1, 5)) = 0.5 //108 + + _DistortTex("Distortion Texture", 2D) = "white" {} //109 + _DistortAmount("Distortion Amount", Range(0,2)) = 0.5 //110 + _DistortTexXSpeed("Scroll speed X", Range(-50,50)) = 5 //111 + _DistortTexYSpeed("Scroll speed Y", Range(-50,50)) = 5 //112 + + _TwistUvAmount("Twist Amount", Range(0, 3.1416)) = 1 //113 + _TwistUvPosX("Twist Pos X Axis", Range(0, 1)) = 0.5 //114 + _TwistUvPosY("Twist Pos Y Axis", Range(0, 1)) = 0.5 //115 + _TwistUvRadius("Twist Radius", Range(0, 3)) = 0.75 //116 + + _RotateUvAmount("Rotate Angle(radians)", Range(0, 6.2831)) = 0 //117 + + _FishEyeUvAmount("Fish Eye Amount", Range(0, 0.5)) = 0.35 //118 + + _PinchUvAmount("Pinch Amount", Range(0, 0.5)) = 0.35 //119 + + _ShakeUvSpeed("Shake Speed", Range(0, 20)) = 2.5 //120 + _ShakeUvX("X Multiplier", Range(0, 5)) = 1.5 //121 + _ShakeUvY("Y Multiplier", Range(0, 5)) = 1 //122 + + _ColorChangeTolerance("Tolerance", Range(0, 1)) = 0.25 //123 + _ColorChangeTarget("Color to change", Color) = (1, 0, 0, 1) //124 + [HDR] _ColorChangeNewCol("New Color", Color) = (1, 1, 0, 1) //125 + _ColorChangeLuminosity("New Color Luminosity", Range(0, 1)) = 0.0 //126 + + _RoundWaveStrength("Wave Strength", Range(0, 1)) = 0.7 //127 + _RoundWaveSpeed("Wave Speed", Range(0, 5)) = 2 //128 + + [Toggle()] _BillboardY("Billboard on both axis?", float) = 0 //129 + _ZWrite ("Depth Write", Float) = 1.0 // 130 + + _MySrcMode ("SrcMode", Float) = 5 // 131 + _MyDstMode ("DstMode", Float) = 10 // 132 + + _ShineColor("Shine Color", Color) = (1,1,1,1) // 133 + _ShineLocation("Shine Location", Range(0,1)) = 0.5 // 134 + _ShineRotate("Rotate Angle(radians)", Range(0, 6.2831)) = 0 //135 + _ShineWidth("Shine Width", Range(0.05,1)) = 0.1 // 136 + _ShineGlow("Shine Glow", Range(0,100)) = 1 // 137 + [NoScaleOffset] _ShineMask("Shine Mask", 2D) = "white" {} // 138 + + _GlitchSize("Glitch Size", Range(0.25, 5)) = 1 //139 + _HologramStripeColor("Stripes Color", Color) = (0,1,1,1) //140 + _GradBoostX("Boost X axis", Range(0.1, 5)) = 1.2 //141 + _GradBoostY("Boost Y axis", Range(0.1, 5)) = 1.2 //142 + [Toggle()] _GradIsRadial("Radial Gradient?", float) = 0 //143 + _AlphaRoundThreshold("Round Threshold", Range(0.005, 1.0)) = 0.5 //144 + _GrassRadialBend("Radial Bend", Range(0.0, 5.0)) = 0.1 //145 + + _ColorChangeTolerance2("Tolerance 2", Range(0, 1)) = 0.25 //146 + _ColorChangeTarget2("Color to change 2", Color) = (1, 0, 0, 1) //147 + [HDR] _ColorChangeNewCol2("New Color 2", Color) = (1, 1, 0, 1) //148 + _ColorChangeTolerance3("Tolerance 3", Range(0, 1)) = 0.25 //149 + _ColorChangeTarget3("Color to change 3", Color) = (1, 0, 0, 1) //150 + [HDR] _ColorChangeNewCol3("New Color 3", Color) = (1, 1, 0, 1) //151 + + _Contrast ("Contrast", Range(0, 6)) = 1 // 152 + _Brightness ("Brightness", Range(-1, 1)) = 0 // 153 + + _ColorSwapBlend ("Color Swap Blend", Range(0, 1)) = 1 // 154 + _ColorRampBlend ("Color Ramp Blend", Range(0, 1)) = 1 // 155 + _GreyscaleBlend ("Greyscale Blend", Range(0, 1)) = 1 // 156 + _GhostBlend ("Ghost Blend", Range(0, 1)) = 1 // 157 + _HologramBlend ("Hologram Blend", Range(0, 1)) = 1 // 158 + + [AllIn1ShaderGradient] _ColorRampTexGradient("Color ramp Gradient", 2D) = "white" {} //159 + + _OverlayTex("Overlay Texture", 2D) = "white" {} //160 + _OverlayColor("Overlay Color", Color) = (1, 1, 1, 1) //161 + _OverlayGlow("Overlay Glow", Range(0,25)) = 1 // 162 + _OverlayBlend("Overlay Blend", Range(0, 1)) = 1 // 163 + + _RadialStartAngle("Radial Start Angle", Range(0, 360)) = 90 //164 + _RadialClip("Radial Clip", Range(0, 360)) = 45 //165 + _RadialClip2("Radial Clip 2", Range(0, 360)) = 0 //166 + + _WarpStrength("Warp Strength", Range(0, 0.1)) = 0.025 //167 + _WarpSpeed("Warp Speed", Range(0, 25)) = 8 //168 + _WarpScale("Warp Scale", Range(0.05, 3)) = 0.5 //169 + + _OverlayTextureScrollXSpeed("Speed X Axis", Range(-5, 5)) = 0.25 //170 + _OverlayTextureScrollYSpeed("Speed Y Axis", Range(-5, 5)) = 0.25 //171 + + _ZTestMode ("Z Test Mode", Float) = 4 + _CullingOption ("Culling Option", float) = 0 + + [HideInInspector] _MinXUV("_MinXUV", Range(0, 1)) = 0.0 + [HideInInspector] _MaxXUV("_MaxXUV", Range(0, 1)) = 1.0 + [HideInInspector] _MinYUV("_MinYUV", Range(0, 1)) = 0.0 + [HideInInspector] _MaxYUV("_MaxYUV", Range(0, 1)) = 1.0 + [HideInInspector] _RandomSeed("_MaxYUV", Range(0, 10000)) = 0.0 + _EditorDrawers("Editor Drawers", Int) = 6 + + [Normal][NoScaleOffset] _NormalMap("Normal Map", 2D) = "bump" {} + _NormalStrength("Normal Strength", Range(0, 15)) = 1.0 + + + } + SubShader + { + Tags { "RenderType" = "Opaque" "Queue" = "Geometry" } + + + + Pass + { + Name "FORWARD" + Tags { "LightMode" = "ForwardBase" } + + Tags { "RenderType" = "Opaque" "Queue" = "Geometry" "PreviewType" = "Plane" } + Cull [_CullingOption] + ZWrite [_ZWrite] + ZTest [_ZTestMode] + + + CGPROGRAM + // compile directives + #pragma vertex Vert + #pragma fragment Frag + + #pragma target 3.0 + #pragma multi_compile_instancing + #pragma multi_compile_fog + #pragma multi_compile_fwdbase + #include "HLSLSupport.cginc" + #define UNITY_INSTANCED_LOD_FADE + #define UNITY_INSTANCED_SH + #define UNITY_INSTANCED_LIGHTMAPSTS + + #include "UnityShaderVariables.cginc" + #include "UnityShaderUtilities.cginc" + // -------- variant for: + + #include "UnityCG.cginc" + #include "Lighting.cginc" + #include "UnityPBSLighting.cginc" + #include "AutoLight.cginc" + #define SHADER_PASS SHADERPASS_FORWARD + #define _PASSFORWARD 1 + + + #pragma shader_feature_local GLOW_ON + #pragma shader_feature_local FADE_ON + #pragma shader_feature_local OUTBASE_ON + #pragma shader_feature_local ONLYOUTLINE_ON + #pragma shader_feature_local GRADIENT_ON + #pragma shader_feature_local GRADIENT2COL_ON + #pragma shader_feature_local RADIALGRADIENT_ON + #pragma shader_feature_local COLORSWAP_ON + #pragma shader_feature_local HSV_ON + #pragma shader_feature_local CHANGECOLOR_ON + #pragma shader_feature_local CHANGECOLOR2_ON + #pragma shader_feature_local CHANGECOLOR3_ON + #pragma shader_feature_local COLORRAMP_ON + #pragma shader_feature_local GRADIENTCOLORRAMP_ON + #pragma shader_feature_local HITEFFECT_ON + #pragma shader_feature_local NEGATIVE_ON + #pragma shader_feature_local PIXELATE_ON + #pragma shader_feature_local GREYSCALE_ON + #pragma shader_feature_local POSTERIZE_ON + #pragma shader_feature_local BLUR_ON + #pragma shader_feature_local MOTIONBLUR_ON + #pragma shader_feature_local GHOST_ON + #pragma shader_feature_local ALPHAOUTLINE_ON + #pragma shader_feature_local INNEROUTLINE_ON + #pragma shader_feature_local ONLYINNEROUTLINE_ON + #pragma shader_feature_local HOLOGRAM_ON + #pragma shader_feature_local CHROMABERR_ON + #pragma shader_feature_local GLITCH_ON + #pragma shader_feature_local FLICKER_ON + #pragma shader_feature_local SHADOW_ON + #pragma shader_feature_local SHINE_ON + #pragma shader_feature_local CONTRAST_ON + #pragma shader_feature_local OVERLAY_ON + #pragma shader_feature_local OVERLAYMULT_ON + #pragma shader_feature_local DOODLE_ON + #pragma shader_feature_local WIND_ON + #pragma shader_feature_local WAVEUV_ON + #pragma shader_feature_local ROUNDWAVEUV_ON + #pragma shader_feature_local RECTSIZE_ON + #pragma shader_feature_local OFFSETUV_ON + #pragma shader_feature_local CLIPPING_ON + #pragma shader_feature_local RADIALCLIPPING_ON + #pragma shader_feature_local TEXTURESCROLL_ON + #pragma shader_feature_local ZOOMUV_ON + #pragma shader_feature_local DISTORT_ON + #pragma shader_feature_local WARP_ON + #pragma shader_feature_local TWISTUV_ON + #pragma shader_feature_local ROTATEUV_ON + #pragma shader_feature_local POLARUV_ON + #pragma shader_feature_local FISHEYE_ON + #pragma shader_feature_local PINCH_ON + #pragma shader_feature_local SHAKEUV_ON + + #pragma shader_feature_local GLOWTEX_ON + #pragma shader_feature_local OUTTEX_ON + #pragma shader_feature_local OUTDIST_ON + #pragma shader_feature_local OUTBASE8DIR_ON + #pragma shader_feature_local OUTBASEPIXELPERF_ON + #pragma shader_feature_local COLORRAMPOUTLINE_ON + #pragma shader_feature_local GREYSCALEOUTLINE_ON + #pragma shader_feature_local POSTERIZEOUTLINE_ON + #pragma shader_feature_local BLURISHD_ON + #pragma shader_feature_local MANUALWIND_ON + #pragma shader_feature_local ATLAS_ON + #pragma shader_feature_local PREMULTIPLYALPHA_ON + + #pragma shader_feature BILBOARD_ON + #pragma shader_feature BILBOARDY_ON + + #pragma shader_feature NORMALMAP_ON + + + #define _STANDARD 1 +// If your looking in here and thinking WTF, yeah, I know. These are taken from the SRPs, to allow us to use the same +// texturing library they use. However, since they are not included in the standard pipeline by default, there is no +// way to include them in and they have to be inlined, since someone could copy this shader onto another machine without +// Better Shaders installed. Unfortunate, but I'd rather do this and have a nice library for texture sampling instead +// of the patchy one Unity provides being inlined/emulated in HDRP/URP. Strangely, PSSL and XBoxOne libraries are not +// included in the standard SRP code, but they are in tons of Unity own projects on the web, so I grabbed them from there. + +#if defined(SHADER_API_GAMECORE) + + #define ZERO_INITIALIZE(type, name) name = (type)0; + #define ZERO_INITIALIZE_ARRAY(type, name, arraySize) { for (int arrayIndex = 0; arrayIndex < arraySize; arrayIndex++) { name[arrayIndex] = (type)0; } } + + // Texture util abstraction + + #define CALCULATE_TEXTURE2D_LOD(textureName, samplerName, coord2) textureName.CalculateLevelOfDetail(samplerName, coord2) + + // Texture abstraction + + #define TEXTURE2D(textureName) Texture2D textureName + #define TEXTURE2D_ARRAY(textureName) Texture2DArray textureName + #define TEXTURECUBE(textureName) TextureCube textureName + #define TEXTURECUBE_ARRAY(textureName) TextureCubeArray textureName + #define TEXTURE3D(textureName) Texture3D textureName + + #define TEXTURE2D_FLOAT(textureName) TEXTURE2D(textureName) + #define TEXTURE2D_ARRAY_FLOAT(textureName) TEXTURE2D_ARRAY(textureName) + #define TEXTURECUBE_FLOAT(textureName) TEXTURECUBE(textureName) + #define TEXTURECUBE_ARRAY_FLOAT(textureName) TEXTURECUBE_ARRAY(textureName) + #define TEXTURE3D_FLOAT(textureName) TEXTURE3D(textureName) + + #define TEXTURE2D_HALF(textureName) TEXTURE2D(textureName) + #define TEXTURE2D_ARRAY_HALF(textureName) TEXTURE2D_ARRAY(textureName) + #define TEXTURECUBE_HALF(textureName) TEXTURECUBE(textureName) + #define TEXTURECUBE_ARRAY_HALF(textureName) TEXTURECUBE_ARRAY(textureName) + #define TEXTURE3D_HALF(textureName) TEXTURE3D(textureName) + + #define TEXTURE2D_SHADOW(textureName) TEXTURE2D(textureName) + #define TEXTURE2D_ARRAY_SHADOW(textureName) TEXTURE2D_ARRAY(textureName) + #define TEXTURECUBE_SHADOW(textureName) TEXTURECUBE(textureName) + #define TEXTURECUBE_ARRAY_SHADOW(textureName) TEXTURECUBE_ARRAY(textureName) + + #define RW_TEXTURE2D(type, textureName) RWTexture2D textureName + #define RW_TEXTURE2D_ARRAY(type, textureName) RWTexture2DArray textureName + #define RW_TEXTURE3D(type, textureName) RWTexture3D textureName + + #define SAMPLER(samplerName) SamplerState samplerName + #define SAMPLER_CMP(samplerName) SamplerComparisonState samplerName + #define ASSIGN_SAMPLER(samplerName, samplerValue) samplerName = samplerValue + + #define TEXTURE2D_PARAM(textureName, samplerName) TEXTURE2D(textureName), SAMPLER(samplerName) + #define TEXTURE2D_ARRAY_PARAM(textureName, samplerName) TEXTURE2D_ARRAY(textureName), SAMPLER(samplerName) + #define TEXTURECUBE_PARAM(textureName, samplerName) TEXTURECUBE(textureName), SAMPLER(samplerName) + #define TEXTURECUBE_ARRAY_PARAM(textureName, samplerName) TEXTURECUBE_ARRAY(textureName), SAMPLER(samplerName) + #define TEXTURE3D_PARAM(textureName, samplerName) TEXTURE3D(textureName), SAMPLER(samplerName) + + #define TEXTURE2D_SHADOW_PARAM(textureName, samplerName) TEXTURE2D(textureName), SAMPLER_CMP(samplerName) + #define TEXTURE2D_ARRAY_SHADOW_PARAM(textureName, samplerName) TEXTURE2D_ARRAY(textureName), SAMPLER_CMP(samplerName) + #define TEXTURECUBE_SHADOW_PARAM(textureName, samplerName) TEXTURECUBE(textureName), SAMPLER_CMP(samplerName) + #define TEXTURECUBE_ARRAY_SHADOW_PARAM(textureName, samplerName) TEXTURECUBE_ARRAY(textureName), SAMPLER_CMP(samplerName) + + #define TEXTURE2D_ARGS(textureName, samplerName) textureName, samplerName + #define TEXTURE2D_ARRAY_ARGS(textureName, samplerName) textureName, samplerName + #define TEXTURECUBE_ARGS(textureName, samplerName) textureName, samplerName + #define TEXTURECUBE_ARRAY_ARGS(textureName, samplerName) textureName, samplerName + #define TEXTURE3D_ARGS(textureName, samplerName) textureName, samplerName + + #define TEXTURE2D_SHADOW_ARGS(textureName, samplerName) textureName, samplerName + #define TEXTURE2D_ARRAY_SHADOW_ARGS(textureName, samplerName) textureName, samplerName + #define TEXTURECUBE_SHADOW_ARGS(textureName, samplerName) textureName, samplerName + #define TEXTURECUBE_ARRAY_SHADOW_ARGS(textureName, samplerName) textureName, samplerName + + #define PLATFORM_SAMPLE_TEXTURE2D(textureName, samplerName, coord2) textureName.Sample(samplerName, coord2) + #define PLATFORM_SAMPLE_TEXTURE2D_LOD(textureName, samplerName, coord2, lod) textureName.SampleLevel(samplerName, coord2, lod) + #define PLATFORM_SAMPLE_TEXTURE2D_BIAS(textureName, samplerName, coord2, bias) textureName.SampleBias(samplerName, coord2, bias) + #define PLATFORM_SAMPLE_TEXTURE2D_GRAD(textureName, samplerName, coord2, dpdx, dpdy) textureName.SampleGrad(samplerName, coord2, dpdx, dpdy) + #define PLATFORM_SAMPLE_TEXTURE2D_ARRAY(textureName, samplerName, coord2, index) textureName.Sample(samplerName, float3(coord2, index)) + #define PLATFORM_SAMPLE_TEXTURE2D_ARRAY_LOD(textureName, samplerName, coord2, index, lod) textureName.SampleLevel(samplerName, float3(coord2, index), lod) + #define PLATFORM_SAMPLE_TEXTURE2D_ARRAY_BIAS(textureName, samplerName, coord2, index, bias) textureName.SampleBias(samplerName, float3(coord2, index), bias) + #define PLATFORM_SAMPLE_TEXTURE2D_ARRAY_GRAD(textureName, samplerName, coord2, index, dpdx, dpdy) textureName.SampleGrad(samplerName, float3(coord2, index), dpdx, dpdy) + #define PLATFORM_SAMPLE_TEXTURECUBE(textureName, samplerName, coord3) textureName.Sample(samplerName, coord3) + #define PLATFORM_SAMPLE_TEXTURECUBE_LOD(textureName, samplerName, coord3, lod) textureName.SampleLevel(samplerName, coord3, lod) + #define PLATFORM_SAMPLE_TEXTURECUBE_BIAS(textureName, samplerName, coord3, bias) textureName.SampleBias(samplerName, coord3, bias) + #define PLATFORM_SAMPLE_TEXTURECUBE_ARRAY(textureName, samplerName, coord3, index) textureName.Sample(samplerName, float4(coord3, index)) + #define PLATFORM_SAMPLE_TEXTURECUBE_ARRAY_LOD(textureName, samplerName, coord3, index, lod) textureName.SampleLevel(samplerName, float4(coord3, index), lod) + #define PLATFORM_SAMPLE_TEXTURECUBE_ARRAY_BIAS(textureName, samplerName, coord3, index, bias) textureName.SampleBias(samplerName, float4(coord3, index), bias) + #define PLATFORM_SAMPLE_TEXTURE3D(textureName, samplerName, coord3) textureName.Sample(samplerName, coord3) + #define PLATFORM_SAMPLE_TEXTURE3D_LOD(textureName, samplerName, coord3, lod) textureName.SampleLevel(samplerName, coord3, lod) + + #define SAMPLE_TEXTURE2D(textureName, samplerName, coord2) PLATFORM_SAMPLE_TEXTURE2D(textureName, samplerName, coord2) + #define SAMPLE_TEXTURE2D_LOD(textureName, samplerName, coord2, lod) PLATFORM_SAMPLE_TEXTURE2D_LOD(textureName, samplerName, coord2, lod) + #define SAMPLE_TEXTURE2D_BIAS(textureName, samplerName, coord2, bias) PLATFORM_SAMPLE_TEXTURE2D_BIAS(textureName, samplerName, coord2, bias) + #define SAMPLE_TEXTURE2D_GRAD(textureName, samplerName, coord2, dpdx, dpdy) PLATFORM_SAMPLE_TEXTURE2D_GRAD(textureName, samplerName, coord2, dpdx, dpdy) + #define SAMPLE_TEXTURE2D_ARRAY(textureName, samplerName, coord2, index) PLATFORM_SAMPLE_TEXTURE2D_ARRAY(textureName, samplerName, coord2, index) + #define SAMPLE_TEXTURE2D_ARRAY_LOD(textureName, samplerName, coord2, index, lod) PLATFORM_SAMPLE_TEXTURE2D_ARRAY_LOD(textureName, samplerName, coord2, index, lod) + #define SAMPLE_TEXTURE2D_ARRAY_BIAS(textureName, samplerName, coord2, index, bias) PLATFORM_SAMPLE_TEXTURE2D_ARRAY_BIAS(textureName, samplerName, coord2, index, bias) + #define SAMPLE_TEXTURE2D_ARRAY_GRAD(textureName, samplerName, coord2, index, dpdx, dpdy) PLATFORM_SAMPLE_TEXTURE2D_ARRAY_GRAD(textureName, samplerName, coord2, index, dpdx, dpdy) + #define SAMPLE_TEXTURECUBE(textureName, samplerName, coord3) PLATFORM_SAMPLE_TEXTURECUBE(textureName, samplerName, coord3) + #define SAMPLE_TEXTURECUBE_LOD(textureName, samplerName, coord3, lod) PLATFORM_SAMPLE_TEXTURECUBE_LOD(textureName, samplerName, coord3, lod) + #define SAMPLE_TEXTURECUBE_BIAS(textureName, samplerName, coord3, bias) PLATFORM_SAMPLE_TEXTURECUBE_BIAS(textureName, samplerName, coord3, bias) + #define SAMPLE_TEXTURECUBE_ARRAY(textureName, samplerName, coord3, index) PLATFORM_SAMPLE_TEXTURECUBE_ARRAY(textureName, samplerName, coord3, index) + #define SAMPLE_TEXTURECUBE_ARRAY_LOD(textureName, samplerName, coord3, index, lod) PLATFORM_SAMPLE_TEXTURECUBE_ARRAY_LOD(textureName, samplerName, coord3, index, lod) + #define SAMPLE_TEXTURECUBE_ARRAY_BIAS(textureName, samplerName, coord3, index, bias) PLATFORM_SAMPLE_TEXTURECUBE_ARRAY_BIAS(textureName, samplerName, coord3, index, bias) + #define SAMPLE_TEXTURE3D(textureName, samplerName, coord3) PLATFORM_SAMPLE_TEXTURE3D(textureName, samplerName, coord3) + #define SAMPLE_TEXTURE3D_LOD(textureName, samplerName, coord3, lod) PLATFORM_SAMPLE_TEXTURE3D_LOD(textureName, samplerName, coord3, lod) + + #define SAMPLE_TEXTURE2D_SHADOW(textureName, samplerName, coord3) textureName.SampleCmpLevelZero(samplerName, (coord3).xy, (coord3).z) + #define SAMPLE_TEXTURE2D_ARRAY_SHADOW(textureName, samplerName, coord3, index) textureName.SampleCmpLevelZero(samplerName, float3((coord3).xy, index), (coord3).z) + #define SAMPLE_TEXTURECUBE_SHADOW(textureName, samplerName, coord4) textureName.SampleCmpLevelZero(samplerName, (coord4).xyz, (coord4).w) + #define SAMPLE_TEXTURECUBE_ARRAY_SHADOW(textureName, samplerName, coord4, index) textureName.SampleCmpLevelZero(samplerName, float4((coord4).xyz, index), (coord4).w) + + #define SAMPLE_DEPTH_TEXTURE(textureName, samplerName, coord2) SAMPLE_TEXTURE2D(textureName, samplerName, coord2).r + #define SAMPLE_DEPTH_TEXTURE_LOD(textureName, samplerName, coord2, lod) SAMPLE_TEXTURE2D_LOD(textureName, samplerName, coord2, lod).r + + #define LOAD_TEXTURE2D(textureName, unCoord2) textureName.Load(int3(unCoord2, 0)) + #define LOAD_TEXTURE2D_LOD(textureName, unCoord2, lod) textureName.Load(int3(unCoord2, lod)) + #define LOAD_TEXTURE2D_MSAA(textureName, unCoord2, sampleIndex) textureName.Load(unCoord2, sampleIndex) + #define LOAD_TEXTURE2D_ARRAY(textureName, unCoord2, index) textureName.Load(int4(unCoord2, index, 0)) + #define LOAD_TEXTURE2D_ARRAY_MSAA(textureName, unCoord2, index, sampleIndex) textureName.Load(int3(unCoord2, index), sampleIndex) + #define LOAD_TEXTURE2D_ARRAY_LOD(textureName, unCoord2, index, lod) textureName.Load(int4(unCoord2, index, lod)) + #define LOAD_TEXTURE3D(textureName, unCoord3) textureName.Load(int4(unCoord3, 0)) + #define LOAD_TEXTURE3D_LOD(textureName, unCoord3, lod) textureName.Load(int4(unCoord3, lod)) + + #define PLATFORM_SUPPORT_GATHER + #define GATHER_TEXTURE2D(textureName, samplerName, coord2) textureName.Gather(samplerName, coord2) + #define GATHER_TEXTURE2D_ARRAY(textureName, samplerName, coord2, index) textureName.Gather(samplerName, float3(coord2, index)) + #define GATHER_TEXTURECUBE(textureName, samplerName, coord3) textureName.Gather(samplerName, coord3) + #define GATHER_TEXTURECUBE_ARRAY(textureName, samplerName, coord3, index) textureName.Gather(samplerName, float4(coord3, index)) + #define GATHER_RED_TEXTURE2D(textureName, samplerName, coord2) textureName.GatherRed(samplerName, coord2) + #define GATHER_GREEN_TEXTURE2D(textureName, samplerName, coord2) textureName.GatherGreen(samplerName, coord2) + #define GATHER_BLUE_TEXTURE2D(textureName, samplerName, coord2) textureName.GatherBlue(samplerName, coord2) + #define GATHER_ALPHA_TEXTURE2D(textureName, samplerName, coord2) textureName.GatherAlpha(samplerName, coord2) + + +#elif defined(SHADER_API_XBOXONE) + + // Initialize arbitrary structure with zero values. + // Do not exist on some platform, in this case we need to have a standard name that call a function that will initialize all parameters to 0 + #define ZERO_INITIALIZE(type, name) name = (type)0; + #define ZERO_INITIALIZE_ARRAY(type, name, arraySize) { for (int arrayIndex = 0; arrayIndex < arraySize; arrayIndex++) { name[arrayIndex] = (type)0; } } + + // Texture util abstraction + + #define CALCULATE_TEXTURE2D_LOD(textureName, samplerName, coord2) textureName.CalculateLevelOfDetail(samplerName, coord2) + + // Texture abstraction + + #define TEXTURE2D(textureName) Texture2D textureName + #define TEXTURE2D_ARRAY(textureName) Texture2DArray textureName + #define TEXTURECUBE(textureName) TextureCube textureName + #define TEXTURECUBE_ARRAY(textureName) TextureCubeArray textureName + #define TEXTURE3D(textureName) Texture3D textureName + + #define TEXTURE2D_FLOAT(textureName) TEXTURE2D(textureName) + #define TEXTURE2D_ARRAY_FLOAT(textureName) TEXTURE2D_ARRAY(textureName) + #define TEXTURECUBE_FLOAT(textureName) TEXTURECUBE(textureName) + #define TEXTURECUBE_ARRAY_FLOAT(textureName) TEXTURECUBE_ARRAY(textureName) + #define TEXTURE3D_FLOAT(textureName) TEXTURE3D(textureName) + + #define TEXTURE2D_HALF(textureName) TEXTURE2D(textureName) + #define TEXTURE2D_ARRAY_HALF(textureName) TEXTURE2D_ARRAY(textureName) + #define TEXTURECUBE_HALF(textureName) TEXTURECUBE(textureName) + #define TEXTURECUBE_ARRAY_HALF(textureName) TEXTURECUBE_ARRAY(textureName) + #define TEXTURE3D_HALF(textureName) TEXTURE3D(textureName) + + #define TEXTURE2D_SHADOW(textureName) TEXTURE2D(textureName) + #define TEXTURE2D_ARRAY_SHADOW(textureName) TEXTURE2D_ARRAY(textureName) + #define TEXTURECUBE_SHADOW(textureName) TEXTURECUBE(textureName) + #define TEXTURECUBE_ARRAY_SHADOW(textureName) TEXTURECUBE_ARRAY(textureName) + + #define RW_TEXTURE2D(type, textureName) RWTexture2D textureName + #define RW_TEXTURE2D_ARRAY(type, textureName) RWTexture2DArray textureName + #define RW_TEXTURE3D(type, textureName) RWTexture3D textureName + + #define SAMPLER(samplerName) SamplerState samplerName + #define SAMPLER_CMP(samplerName) SamplerComparisonState samplerName + + #define TEXTURE2D_PARAM(textureName, samplerName) TEXTURE2D(textureName), SAMPLER(samplerName) + #define TEXTURE2D_ARRAY_PARAM(textureName, samplerName) TEXTURE2D_ARRAY(textureName), SAMPLER(samplerName) + #define TEXTURECUBE_PARAM(textureName, samplerName) TEXTURECUBE(textureName), SAMPLER(samplerName) + #define TEXTURECUBE_ARRAY_PARAM(textureName, samplerName) TEXTURECUBE_ARRAY(textureName), SAMPLER(samplerName) + #define TEXTURE3D_PARAM(textureName, samplerName) TEXTURE3D(textureName), SAMPLER(samplerName) + + #define TEXTURE2D_SHADOW_PARAM(textureName, samplerName) TEXTURE2D(textureName), SAMPLER_CMP(samplerName) + #define TEXTURE2D_ARRAY_SHADOW_PARAM(textureName, samplerName) TEXTURE2D_ARRAY(textureName), SAMPLER_CMP(samplerName) + #define TEXTURECUBE_SHADOW_PARAM(textureName, samplerName) TEXTURECUBE(textureName), SAMPLER_CMP(samplerName) + #define TEXTURECUBE_ARRAY_SHADOW_PARAM(textureName, samplerName) TEXTURECUBE_ARRAY(textureName), SAMPLER_CMP(samplerName) + + #define TEXTURE2D_ARGS(textureName, samplerName) textureName, samplerName + #define TEXTURE2D_ARRAY_ARGS(textureName, samplerName) textureName, samplerName + #define TEXTURECUBE_ARGS(textureName, samplerName) textureName, samplerName + #define TEXTURECUBE_ARRAY_ARGS(textureName, samplerName) textureName, samplerName + #define TEXTURE3D_ARGS(textureName, samplerName) textureName, samplerName + + #define TEXTURE2D_SHADOW_ARGS(textureName, samplerName) textureName, samplerName + #define TEXTURE2D_ARRAY_SHADOW_ARGS(textureName, samplerName) textureName, samplerName + #define TEXTURECUBE_SHADOW_ARGS(textureName, samplerName) textureName, samplerName + #define TEXTURECUBE_ARRAY_SHADOW_ARGS(textureName, samplerName) textureName, samplerName + + #define SAMPLE_TEXTURE2D(textureName, samplerName, coord2) textureName.Sample(samplerName, coord2) + #define SAMPLE_TEXTURE2D_LOD(textureName, samplerName, coord2, lod) textureName.SampleLevel(samplerName, coord2, lod) + #define SAMPLE_TEXTURE2D_BIAS(textureName, samplerName, coord2, bias) textureName.SampleBias(samplerName, coord2, bias) + #define SAMPLE_TEXTURE2D_GRAD(textureName, samplerName, coord2, dpdx, dpdy) textureName.SampleGrad(samplerName, coord2, dpdx, dpdy) + #define SAMPLE_TEXTURE2D_ARRAY(textureName, samplerName, coord2, index) textureName.Sample(samplerName, float3(coord2, index)) + #define SAMPLE_TEXTURE2D_ARRAY_LOD(textureName, samplerName, coord2, index, lod) textureName.SampleLevel(samplerName, float3(coord2, index), lod) + #define SAMPLE_TEXTURE2D_ARRAY_BIAS(textureName, samplerName, coord2, index, bias) textureName.SampleBias(samplerName, float3(coord2, index), bias) + #define SAMPLE_TEXTURE2D_ARRAY_GRAD(textureName, samplerName, coord2, index, dpdx, dpdy) textureName.SampleGrad(samplerName, float3(coord2, index), dpdx, dpdy) + #define SAMPLE_TEXTURECUBE(textureName, samplerName, coord3) textureName.Sample(samplerName, coord3) + #define SAMPLE_TEXTURECUBE_LOD(textureName, samplerName, coord3, lod) textureName.SampleLevel(samplerName, coord3, lod) + #define SAMPLE_TEXTURECUBE_BIAS(textureName, samplerName, coord3, bias) textureName.SampleBias(samplerName, coord3, bias) + #define SAMPLE_TEXTURECUBE_ARRAY(textureName, samplerName, coord3, index) textureName.Sample(samplerName, float4(coord3, index)) + #define SAMPLE_TEXTURECUBE_ARRAY_LOD(textureName, samplerName, coord3, index, lod) textureName.SampleLevel(samplerName, float4(coord3, index), lod) + #define SAMPLE_TEXTURECUBE_ARRAY_BIAS(textureName, samplerName, coord3, index, bias) textureName.SampleBias(samplerName, float4(coord3, index), bias) + #define SAMPLE_TEXTURE3D(textureName, samplerName, coord3) textureName.Sample(samplerName, coord3) + #define SAMPLE_TEXTURE3D_LOD(textureName, samplerName, coord3, lod) textureName.SampleLevel(samplerName, coord3, lod) + + #define SAMPLE_TEXTURE2D_SHADOW(textureName, samplerName, coord3) textureName.SampleCmpLevelZero(samplerName, (coord3).xy, (coord3).z) + #define SAMPLE_TEXTURE2D_ARRAY_SHADOW(textureName, samplerName, coord3, index) textureName.SampleCmpLevelZero(samplerName, float3((coord3).xy, index), (coord3).z) + #define SAMPLE_TEXTURECUBE_SHADOW(textureName, samplerName, coord4) textureName.SampleCmpLevelZero(samplerName, (coord4).xyz, (coord4).w) + #define SAMPLE_TEXTURECUBE_ARRAY_SHADOW(textureName, samplerName, coord4, index) textureName.SampleCmpLevelZero(samplerName, float4((coord4).xyz, index), (coord4).w) + + #define LOAD_TEXTURE2D(textureName, unCoord2) textureName.Load(int3(unCoord2, 0)) + #define LOAD_TEXTURE2D_LOD(textureName, unCoord2, lod) textureName.Load(int3(unCoord2, lod)) + #define LOAD_TEXTURE2D_MSAA(textureName, unCoord2, sampleIndex) textureName.Load(unCoord2, sampleIndex) + #define LOAD_TEXTURE2D_ARRAY(textureName, unCoord2, index) textureName.Load(int4(unCoord2, index, 0)) + #define LOAD_TEXTURE2D_ARRAY_MSAA(textureName, unCoord2, index, sampleIndex) textureName.Load(int3(unCoord2, index), sampleIndex) + #define LOAD_TEXTURE2D_ARRAY_LOD(textureName, unCoord2, index, lod) textureName.Load(int4(unCoord2, index, lod)) + #define LOAD_TEXTURE3D(textureName, unCoord3) textureName.Load(int4(unCoord3, 0)) + #define LOAD_TEXTURE3D_LOD(textureName, unCoord3, lod) textureName.Load(int4(unCoord3, lod)) + + #define PLATFORM_SUPPORT_GATHER + #define GATHER_TEXTURE2D(textureName, samplerName, coord2) textureName.Gather(samplerName, coord2) + #define GATHER_TEXTURE2D_ARRAY(textureName, samplerName, coord2, index) textureName.Gather(samplerName, float3(coord2, index)) + #define GATHER_TEXTURECUBE(textureName, samplerName, coord3) textureName.Gather(samplerName, coord3) + #define GATHER_TEXTURECUBE_ARRAY(textureName, samplerName, coord3, index) textureName.Gather(samplerName, float4(coord3, index)) + #define GATHER_RED_TEXTURE2D(textureName, samplerName, coord2) textureName.GatherRed(samplerName, coord2) + #define GATHER_GREEN_TEXTURE2D(textureName, samplerName, coord2) textureName.GatherGreen(samplerName, coord2) + #define GATHER_BLUE_TEXTURE2D(textureName, samplerName, coord2) textureName.GatherBlue(samplerName, coord2) + #define GATHER_ALPHA_TEXTURE2D(textureName, samplerName, coord2) textureName.GatherAlpha(samplerName, coord2) + + +#elif defined(SHADER_API_PSSL) + + // Initialize arbitrary structure with zero values. + // Do not exist on some platform, in this case we need to have a standard name that call a function that will initialize all parameters to 0 + #define ZERO_INITIALIZE(type, name) name = (type)0; + #define ZERO_INITIALIZE_ARRAY(type, name, arraySize) { for (int arrayIndex = 0; arrayIndex < arraySize; arrayIndex++) { name[arrayIndex] = (type)0; } } + + // Texture util abstraction + + #define CALCULATE_TEXTURE2D_LOD(textureName, samplerName, coord2) textureName.GetLOD(samplerName, coord2) + + // Texture abstraction + + #define TEXTURE2D(textureName) Texture2D textureName + #define TEXTURE2D_ARRAY(textureName) Texture2DArray textureName + #define TEXTURECUBE(textureName) TextureCube textureName + #define TEXTURECUBE_ARRAY(textureName) TextureCubeArray textureName + #define TEXTURE3D(textureName) Texture3D textureName + + #define TEXTURE2D_FLOAT(textureName) TEXTURE2D(textureName) + #define TEXTURE2D_ARRAY_FLOAT(textureName) TEXTURE2D_ARRAY(textureName) + #define TEXTURECUBE_FLOAT(textureName) TEXTURECUBE(textureName) + #define TEXTURECUBE_ARRAY_FLOAT(textureName) TEXTURECUBE_ARRAY(textureName) + #define TEXTURE3D_FLOAT(textureName) TEXTURE3D(textureName) + + #define TEXTURE2D_HALF(textureName) TEXTURE2D(textureName) + #define TEXTURE2D_ARRAY_HALF(textureName) TEXTURE2D_ARRAY(textureName) + #define TEXTURECUBE_HALF(textureName) TEXTURECUBE(textureName) + #define TEXTURECUBE_ARRAY_HALF(textureName) TEXTURECUBE_ARRAY(textureName) + #define TEXTURE3D_HALF(textureName) TEXTURE3D(textureName) + + #define TEXTURE2D_SHADOW(textureName) TEXTURE2D(textureName) + #define TEXTURE2D_ARRAY_SHADOW(textureName) TEXTURE2D_ARRAY(textureName) + #define TEXTURECUBE_SHADOW(textureName) TEXTURECUBE(textureName) + #define TEXTURECUBE_ARRAY_SHADOW(textureName) TEXTURECUBE_ARRAY(textureName) + + #define RW_TEXTURE2D(type, textureName) RW_Texture2D textureName + #define RW_TEXTURE2D_ARRAY(type, textureName) RW_Texture2D_Array textureName + #define RW_TEXTURE3D(type, textureName) RW_Texture3D textureName + + #define SAMPLER(samplerName) SamplerState samplerName + #define SAMPLER_CMP(samplerName) SamplerComparisonState samplerName + + #define TEXTURE2D_PARAM(textureName, samplerName) TEXTURE2D(textureName), SAMPLER(samplerName) + #define TEXTURE2D_ARRAY_PARAM(textureName, samplerName) TEXTURE2D_ARRAY(textureName), SAMPLER(samplerName) + #define TEXTURECUBE_PARAM(textureName, samplerName) TEXTURECUBE(textureName), SAMPLER(samplerName) + #define TEXTURECUBE_ARRAY_PARAM(textureName, samplerName) TEXTURECUBE_ARRAY(textureName), SAMPLER(samplerName) + #define TEXTURE3D_PARAM(textureName, samplerName) TEXTURE3D(textureName), SAMPLER(samplerName) + + #define TEXTURE2D_SHADOW_PARAM(textureName, samplerName) TEXTURE2D(textureName), SAMPLER_CMP(samplerName) + #define TEXTURE2D_ARRAY_SHADOW_PARAM(textureName, samplerName) TEXTURE2D_ARRAY(textureName), SAMPLER_CMP(samplerName) + #define TEXTURECUBE_SHADOW_PARAM(textureName, samplerName) TEXTURECUBE(textureName), SAMPLER_CMP(samplerName) + #define TEXTURECUBE_ARRAY_SHADOW_PARAM(textureName, samplerName) TEXTURECUBE_ARRAY(textureName), SAMPLER_CMP(samplerName) + + #define TEXTURE2D_ARGS(textureName, samplerName) textureName, samplerName + #define TEXTURE2D_ARRAY_ARGS(textureName, samplerName) textureName, samplerName + #define TEXTURECUBE_ARGS(textureName, samplerName) textureName, samplerName + #define TEXTURECUBE_ARRAY_ARGS(textureName, samplerName) textureName, samplerName + #define TEXTURE3D_ARGS(textureName, samplerName) textureName, samplerName + + #define TEXTURE2D_SHADOW_ARGS(textureName, samplerName) textureName, samplerName + #define TEXTURE2D_ARRAY_SHADOW_ARGS(textureName, samplerName) textureName, samplerName + #define TEXTURECUBE_SHADOW_ARGS(textureName, samplerName) textureName, samplerName + #define TEXTURECUBE_ARRAY_SHADOW_ARGS(textureName, samplerName) textureName, samplerName + + #define SAMPLE_TEXTURE2D(textureName, samplerName, coord2) textureName.Sample(samplerName, coord2) + #define SAMPLE_TEXTURE2D_LOD(textureName, samplerName, coord2, lod) textureName.SampleLevel(samplerName, coord2, lod) + #define SAMPLE_TEXTURE2D_BIAS(textureName, samplerName, coord2, bias) textureName.SampleBias(samplerName, coord2, bias) + #define SAMPLE_TEXTURE2D_GRAD(textureName, samplerName, coord2, dpdx, dpdy) textureName.SampleGrad(samplerName, coord2, dpdx, dpdy) + #define SAMPLE_TEXTURE2D_ARRAY(textureName, samplerName, coord2, index) textureName.Sample(samplerName, float3(coord2, index)) + #define SAMPLE_TEXTURE2D_ARRAY_LOD(textureName, samplerName, coord2, index, lod) textureName.SampleLevel(samplerName, float3(coord2, index), lod) + #define SAMPLE_TEXTURE2D_ARRAY_BIAS(textureName, samplerName, coord2, index, bias) textureName.SampleBias(samplerName, float3(coord2, index), bias) + #define SAMPLE_TEXTURE2D_ARRAY_GRAD(textureName, samplerName, coord2, index, dpdx, dpdy) textureName.SampleGrad(samplerName, float3(coord2, index), dpdx, dpdy) + #define SAMPLE_TEXTURECUBE(textureName, samplerName, coord3) textureName.Sample(samplerName, coord3) + #define SAMPLE_TEXTURECUBE_LOD(textureName, samplerName, coord3, lod) textureName.SampleLevel(samplerName, coord3, lod) + #define SAMPLE_TEXTURECUBE_BIAS(textureName, samplerName, coord3, bias) textureName.SampleBias(samplerName, coord3, bias) + #define SAMPLE_TEXTURECUBE_ARRAY(textureName, samplerName, coord3, index) textureName.Sample(samplerName, float4(coord3, index)) + #define SAMPLE_TEXTURECUBE_ARRAY_LOD(textureName, samplerName, coord3, index, lod) textureName.SampleLevel(samplerName, float4(coord3, index), lod) + #define SAMPLE_TEXTURECUBE_ARRAY_BIAS(textureName, samplerName, coord3, index, bias) textureName.SampleBias(samplerName, float4(coord3, index), bias) + #define SAMPLE_TEXTURE3D(textureName, samplerName, coord3) textureName.Sample(samplerName, coord3) + #define SAMPLE_TEXTURE3D_LOD(textureName, samplerName, coord3, lod) textureName.SampleLevel(samplerName, coord3, lod) + + #define SAMPLE_TEXTURE2D_SHADOW(textureName, samplerName, coord3) textureName.SampleCmpLevelZero(samplerName, (coord3).xy, (coord3).z) + #define SAMPLE_TEXTURE2D_ARRAY_SHADOW(textureName, samplerName, coord3, index) textureName.SampleCmpLevelZero(samplerName, float3((coord3).xy, index), (coord3).z) + #define SAMPLE_TEXTURECUBE_SHADOW(textureName, samplerName, coord4) textureName.SampleCmpLevelZero(samplerName, (coord4).xyz, (coord4).w) + #define SAMPLE_TEXTURECUBE_ARRAY_SHADOW(textureName, samplerName, coord4, index) textureName.SampleCmpLevelZero(samplerName, float4((coord4).xyz, index), (coord4).w) + + #define LOAD_TEXTURE2D(textureName, unCoord2) textureName.Load(int3(unCoord2, 0)) + #define LOAD_TEXTURE2D_LOD(textureName, unCoord2, lod) textureName.Load(int3(unCoord2, lod)) + #define LOAD_TEXTURE2D_MSAA(textureName, unCoord2, sampleIndex) textureName.Load(unCoord2, sampleIndex) + #define LOAD_TEXTURE2D_ARRAY(textureName, unCoord2, index) textureName.Load(int4(unCoord2, index, 0)) + #define LOAD_TEXTURE2D_ARRAY_MSAA(textureName, unCoord2, index, sampleIndex) textureName.Load(int3(unCoord2, index), sampleIndex) + #define LOAD_TEXTURE2D_ARRAY_LOD(textureName, unCoord2, index, lod) textureName.Load(int4(unCoord2, index, lod)) + #define LOAD_TEXTURE3D(textureName, unCoord3) textureName.Load(int4(unCoord3, 0)) + #define LOAD_TEXTURE3D_LOD(textureName, unCoord3, lod) textureName.Load(int4(unCoord3, lod)) + + #define PLATFORM_SUPPORT_GATHER + #define GATHER_TEXTURE2D(textureName, samplerName, coord2) textureName.Gather(samplerName, coord2) + #define GATHER_TEXTURE2D_ARRAY(textureName, samplerName, coord2, index) textureName.Gather(samplerName, float3(coord2, index)) + #define GATHER_TEXTURECUBE(textureName, samplerName, coord3) textureName.Gather(samplerName, coord3) + #define GATHER_TEXTURECUBE_ARRAY(textureName, samplerName, coord3, index) textureName.Gather(samplerName, float4(coord3, index)) + #define GATHER_RED_TEXTURE2D(textureName, samplerName, coord2) textureName.GatherRed(samplerName, coord2) + #define GATHER_GREEN_TEXTURE2D(textureName, samplerName, coord2) textureName.GatherGreen(samplerName, coord2) + #define GATHER_BLUE_TEXTURE2D(textureName, samplerName, coord2) textureName.GatherBlue(samplerName, coord2) + #define GATHER_ALPHA_TEXTURE2D(textureName, samplerName, coord2) textureName.GatherAlpha(samplerName, coord2) + + + +#elif defined(SHADER_API_D3D11) + + // Initialize arbitrary structure with zero values. + // Do not exist on some platform, in this case we need to have a standard name that call a function that will initialize all parameters to 0 + #define ZERO_INITIALIZE(type, name) name = (type)0; + #define ZERO_INITIALIZE_ARRAY(type, name, arraySize) { for (int arrayIndex = 0; arrayIndex < arraySize; arrayIndex++) { name[arrayIndex] = (type)0; } } + + // Texture util abstraction + + #define CALCULATE_TEXTURE2D_LOD(textureName, samplerName, coord2) textureName.CalculateLevelOfDetail(samplerName, coord2) + + // Texture abstraction + + #define TEXTURE2D(textureName) Texture2D textureName + #define TEXTURE2D_ARRAY(textureName) Texture2DArray textureName + #define TEXTURECUBE(textureName) TextureCube textureName + #define TEXTURECUBE_ARRAY(textureName) TextureCubeArray textureName + #define TEXTURE3D(textureName) Texture3D textureName + + #define TEXTURE2D_FLOAT(textureName) TEXTURE2D(textureName) + #define TEXTURE2D_ARRAY_FLOAT(textureName) TEXTURE2D_ARRAY(textureName) + #define TEXTURECUBE_FLOAT(textureName) TEXTURECUBE(textureName) + #define TEXTURECUBE_ARRAY_FLOAT(textureName) TEXTURECUBE_ARRAY(textureName) + #define TEXTURE3D_FLOAT(textureName) TEXTURE3D(textureName) + + #define TEXTURE2D_HALF(textureName) TEXTURE2D(textureName) + #define TEXTURE2D_ARRAY_HALF(textureName) TEXTURE2D_ARRAY(textureName) + #define TEXTURECUBE_HALF(textureName) TEXTURECUBE(textureName) + #define TEXTURECUBE_ARRAY_HALF(textureName) TEXTURECUBE_ARRAY(textureName) + #define TEXTURE3D_HALF(textureName) TEXTURE3D(textureName) + + #define TEXTURE2D_SHADOW(textureName) TEXTURE2D(textureName) + #define TEXTURE2D_ARRAY_SHADOW(textureName) TEXTURE2D_ARRAY(textureName) + #define TEXTURECUBE_SHADOW(textureName) TEXTURECUBE(textureName) + #define TEXTURECUBE_ARRAY_SHADOW(textureName) TEXTURECUBE_ARRAY(textureName) + + #define RW_TEXTURE2D(type, textureName) RWTexture2D textureName + #define RW_TEXTURE2D_ARRAY(type, textureName) RWTexture2DArray textureName + #define RW_TEXTURE3D(type, textureName) RWTexture3D textureName + + #define SAMPLER(samplerName) SamplerState samplerName + #define SAMPLER_CMP(samplerName) SamplerComparisonState samplerName + + #define TEXTURE2D_PARAM(textureName, samplerName) TEXTURE2D(textureName), SAMPLER(samplerName) + #define TEXTURE2D_ARRAY_PARAM(textureName, samplerName) TEXTURE2D_ARRAY(textureName), SAMPLER(samplerName) + #define TEXTURECUBE_PARAM(textureName, samplerName) TEXTURECUBE(textureName), SAMPLER(samplerName) + #define TEXTURECUBE_ARRAY_PARAM(textureName, samplerName) TEXTURECUBE_ARRAY(textureName), SAMPLER(samplerName) + #define TEXTURE3D_PARAM(textureName, samplerName) TEXTURE3D(textureName), SAMPLER(samplerName) + + #define TEXTURE2D_SHADOW_PARAM(textureName, samplerName) TEXTURE2D(textureName), SAMPLER_CMP(samplerName) + #define TEXTURE2D_ARRAY_SHADOW_PARAM(textureName, samplerName) TEXTURE2D_ARRAY(textureName), SAMPLER_CMP(samplerName) + #define TEXTURECUBE_SHADOW_PARAM(textureName, samplerName) TEXTURECUBE(textureName), SAMPLER_CMP(samplerName) + #define TEXTURECUBE_ARRAY_SHADOW_PARAM(textureName, samplerName) TEXTURECUBE_ARRAY(textureName), SAMPLER_CMP(samplerName) + + #define TEXTURE2D_ARGS(textureName, samplerName) textureName, samplerName + #define TEXTURE2D_ARRAY_ARGS(textureName, samplerName) textureName, samplerName + #define TEXTURECUBE_ARGS(textureName, samplerName) textureName, samplerName + #define TEXTURECUBE_ARRAY_ARGS(textureName, samplerName) textureName, samplerName + #define TEXTURE3D_ARGS(textureName, samplerName) textureName, samplerName + + #define TEXTURE2D_SHADOW_ARGS(textureName, samplerName) textureName, samplerName + #define TEXTURE2D_ARRAY_SHADOW_ARGS(textureName, samplerName) textureName, samplerName + #define TEXTURECUBE_SHADOW_ARGS(textureName, samplerName) textureName, samplerName + #define TEXTURECUBE_ARRAY_SHADOW_ARGS(textureName, samplerName) textureName, samplerName + + #define SAMPLE_TEXTURE2D(textureName, samplerName, coord2) textureName.Sample(samplerName, coord2) + #define SAMPLE_TEXTURE2D_LOD(textureName, samplerName, coord2, lod) textureName.SampleLevel(samplerName, coord2, lod) + #define SAMPLE_TEXTURE2D_BIAS(textureName, samplerName, coord2, bias) textureName.SampleBias(samplerName, coord2, bias) + #define SAMPLE_TEXTURE2D_GRAD(textureName, samplerName, coord2, dpdx, dpdy) textureName.SampleGrad(samplerName, coord2, dpdx, dpdy) + #define SAMPLE_TEXTURE2D_ARRAY(textureName, samplerName, coord2, index) textureName.Sample(samplerName, float3(coord2, index)) + #define SAMPLE_TEXTURE2D_ARRAY_LOD(textureName, samplerName, coord2, index, lod) textureName.SampleLevel(samplerName, float3(coord2, index), lod) + #define SAMPLE_TEXTURE2D_ARRAY_BIAS(textureName, samplerName, coord2, index, bias) textureName.SampleBias(samplerName, float3(coord2, index), bias) + #define SAMPLE_TEXTURE2D_ARRAY_GRAD(textureName, samplerName, coord2, index, dpdx, dpdy) textureName.SampleGrad(samplerName, float3(coord2, index), dpdx, dpdy) + #define SAMPLE_TEXTURECUBE(textureName, samplerName, coord3) textureName.Sample(samplerName, coord3) + #define SAMPLE_TEXTURECUBE_LOD(textureName, samplerName, coord3, lod) textureName.SampleLevel(samplerName, coord3, lod) + #define SAMPLE_TEXTURECUBE_BIAS(textureName, samplerName, coord3, bias) textureName.SampleBias(samplerName, coord3, bias) + #define SAMPLE_TEXTURECUBE_ARRAY(textureName, samplerName, coord3, index) textureName.Sample(samplerName, float4(coord3, index)) + #define SAMPLE_TEXTURECUBE_ARRAY_LOD(textureName, samplerName, coord3, index, lod) textureName.SampleLevel(samplerName, float4(coord3, index), lod) + #define SAMPLE_TEXTURECUBE_ARRAY_BIAS(textureName, samplerName, coord3, index, bias) textureName.SampleBias(samplerName, float4(coord3, index), bias) + #define SAMPLE_TEXTURE3D(textureName, samplerName, coord3) textureName.Sample(samplerName, coord3) + #define SAMPLE_TEXTURE3D_LOD(textureName, samplerName, coord3, lod) textureName.SampleLevel(samplerName, coord3, lod) + + #define SAMPLE_TEXTURE2D_SHADOW(textureName, samplerName, coord3) textureName.SampleCmpLevelZero(samplerName, (coord3).xy, (coord3).z) + #define SAMPLE_TEXTURE2D_ARRAY_SHADOW(textureName, samplerName, coord3, index) textureName.SampleCmpLevelZero(samplerName, float3((coord3).xy, index), (coord3).z) + #define SAMPLE_TEXTURECUBE_SHADOW(textureName, samplerName, coord4) textureName.SampleCmpLevelZero(samplerName, (coord4).xyz, (coord4).w) + #define SAMPLE_TEXTURECUBE_ARRAY_SHADOW(textureName, samplerName, coord4, index) textureName.SampleCmpLevelZero(samplerName, float4((coord4).xyz, index), (coord4).w) + + #define LOAD_TEXTURE2D(textureName, unCoord2) textureName.Load(int3(unCoord2, 0)) + #define LOAD_TEXTURE2D_LOD(textureName, unCoord2, lod) textureName.Load(int3(unCoord2, lod)) + #define LOAD_TEXTURE2D_MSAA(textureName, unCoord2, sampleIndex) textureName.Load(unCoord2, sampleIndex) + #define LOAD_TEXTURE2D_ARRAY(textureName, unCoord2, index) textureName.Load(int4(unCoord2, index, 0)) + #define LOAD_TEXTURE2D_ARRAY_MSAA(textureName, unCoord2, index, sampleIndex) textureName.Load(int3(unCoord2, index), sampleIndex) + #define LOAD_TEXTURE2D_ARRAY_LOD(textureName, unCoord2, index, lod) textureName.Load(int4(unCoord2, index, lod)) + #define LOAD_TEXTURE3D(textureName, unCoord3) textureName.Load(int4(unCoord3, 0)) + #define LOAD_TEXTURE3D_LOD(textureName, unCoord3, lod) textureName.Load(int4(unCoord3, lod)) + + #define PLATFORM_SUPPORT_GATHER + #define GATHER_TEXTURE2D(textureName, samplerName, coord2) textureName.Gather(samplerName, coord2) + #define GATHER_TEXTURE2D_ARRAY(textureName, samplerName, coord2, index) textureName.Gather(samplerName, float3(coord2, index)) + #define GATHER_TEXTURECUBE(textureName, samplerName, coord3) textureName.Gather(samplerName, coord3) + #define GATHER_TEXTURECUBE_ARRAY(textureName, samplerName, coord3, index) textureName.Gather(samplerName, float4(coord3, index)) + #define GATHER_RED_TEXTURE2D(textureName, samplerName, coord2) textureName.GatherRed(samplerName, coord2) + #define GATHER_GREEN_TEXTURE2D(textureName, samplerName, coord2) textureName.GatherGreen(samplerName, coord2) + #define GATHER_BLUE_TEXTURE2D(textureName, samplerName, coord2) textureName.GatherBlue(samplerName, coord2) + #define GATHER_ALPHA_TEXTURE2D(textureName, samplerName, coord2) textureName.GatherAlpha(samplerName, coord2) + +#elif defined(SHADER_API_METAL) + + // Initialize arbitrary structure with zero values. + // Do not exist on some platform, in this case we need to have a standard name that call a function that will initialize all parameters to 0 + #define ZERO_INITIALIZE(type, name) name = (type)0; + #define ZERO_INITIALIZE_ARRAY(type, name, arraySize) { for (int arrayIndex = 0; arrayIndex < arraySize; arrayIndex++) { name[arrayIndex] = (type)0; } } + + // Texture util abstraction + + #define CALCULATE_TEXTURE2D_LOD(textureName, samplerName, coord2) textureName.CalculateLevelOfDetail(samplerName, coord2) + + // Texture abstraction + + #define TEXTURE2D(textureName) Texture2D textureName + #define TEXTURE2D_ARRAY(textureName) Texture2DArray textureName + #define TEXTURECUBE(textureName) TextureCube textureName + #define TEXTURECUBE_ARRAY(textureName) TextureCubeArray textureName + #define TEXTURE3D(textureName) Texture3D textureName + + #define TEXTURE2D_FLOAT(textureName) Texture2D_float textureName + #define TEXTURE2D_ARRAY_FLOAT(textureName) Texture2DArray textureName // no support to _float on Array, it's being added + #define TEXTURECUBE_FLOAT(textureName) TextureCube_float textureName + #define TEXTURECUBE_ARRAY_FLOAT(textureName) TextureCubeArray textureName // no support to _float on Array, it's being added + #define TEXTURE3D_FLOAT(textureName) Texture3D_float textureName + + #define TEXTURE2D_HALF(textureName) Texture2D_half textureName + #define TEXTURE2D_ARRAY_HALF(textureName) Texture2DArray textureName // no support to _float on Array, it's being added + #define TEXTURECUBE_HALF(textureName) TextureCube_half textureName + #define TEXTURECUBE_ARRAY_HALF(textureName) TextureCubeArray textureName // no support to _float on Array, it's being added + #define TEXTURE3D_HALF(textureName) Texture3D_half textureName + + #define TEXTURE2D_SHADOW(textureName) TEXTURE2D(textureName) + #define TEXTURE2D_ARRAY_SHADOW(textureName) TEXTURE2D_ARRAY(textureName) + #define TEXTURECUBE_SHADOW(textureName) TEXTURECUBE(textureName) + #define TEXTURECUBE_ARRAY_SHADOW(textureName) TEXTURECUBE_ARRAY(textureName) + + #define RW_TEXTURE2D(type, textureName) RWTexture2D textureName + #define RW_TEXTURE2D_ARRAY(type, textureName) RWTexture2DArray textureName + #define RW_TEXTURE3D(type, textureName) RWTexture3D textureName + + #define SAMPLER(samplerName) SamplerState samplerName + #define SAMPLER_CMP(samplerName) SamplerComparisonState samplerName + + #define TEXTURE2D_PARAM(textureName, samplerName) TEXTURE2D(textureName), SAMPLER(samplerName) + #define TEXTURE2D_ARRAY_PARAM(textureName, samplerName) TEXTURE2D_ARRAY(textureName), SAMPLER(samplerName) + #define TEXTURECUBE_PARAM(textureName, samplerName) TEXTURECUBE(textureName), SAMPLER(samplerName) + #define TEXTURECUBE_ARRAY_PARAM(textureName, samplerName) TEXTURECUBE_ARRAY(textureName), SAMPLER(samplerName) + #define TEXTURE3D_PARAM(textureName, samplerName) TEXTURE3D(textureName), SAMPLER(samplerName) + + #define TEXTURE2D_SHADOW_PARAM(textureName, samplerName) TEXTURE2D(textureName), SAMPLER_CMP(samplerName) + #define TEXTURE2D_ARRAY_SHADOW_PARAM(textureName, samplerName) TEXTURE2D_ARRAY(textureName), SAMPLER_CMP(samplerName) + #define TEXTURECUBE_SHADOW_PARAM(textureName, samplerName) TEXTURECUBE(textureName), SAMPLER_CMP(samplerName) + #define TEXTURECUBE_ARRAY_SHADOW_PARAM(textureName, samplerName) TEXTURECUBE_ARRAY(textureName), SAMPLER_CMP(samplerName) + + #define TEXTURE2D_ARGS(textureName, samplerName) textureName, samplerName + #define TEXTURE2D_ARRAY_ARGS(textureName, samplerName) textureName, samplerName + #define TEXTURECUBE_ARGS(textureName, samplerName) textureName, samplerName + #define TEXTURECUBE_ARRAY_ARGS(textureName, samplerName) textureName, samplerName + #define TEXTURE3D_ARGS(textureName, samplerName) textureName, samplerName + + #define TEXTURE2D_SHADOW_ARGS(textureName, samplerName) textureName, samplerName + #define TEXTURE2D_ARRAY_SHADOW_ARGS(textureName, samplerName) textureName, samplerName + #define TEXTURECUBE_SHADOW_ARGS(textureName, samplerName) textureName, samplerName + #define TEXTURECUBE_ARRAY_SHADOW_ARGS(textureName, samplerName) textureName, samplerName + + #define SAMPLE_TEXTURE2D(textureName, samplerName, coord2) textureName.Sample(samplerName, coord2) + #define SAMPLE_TEXTURE2D_LOD(textureName, samplerName, coord2, lod) textureName.SampleLevel(samplerName, coord2, lod) + #define SAMPLE_TEXTURE2D_BIAS(textureName, samplerName, coord2, bias) textureName.SampleBias(samplerName, coord2, bias) + #define SAMPLE_TEXTURE2D_GRAD(textureName, samplerName, coord2, dpdx, dpdy) textureName.SampleGrad(samplerName, coord2, dpdx, dpdy) + #define SAMPLE_TEXTURE2D_ARRAY(textureName, samplerName, coord2, index) textureName.Sample(samplerName, float3(coord2, index)) + #define SAMPLE_TEXTURE2D_ARRAY_LOD(textureName, samplerName, coord2, index, lod) textureName.SampleLevel(samplerName, float3(coord2, index), lod) + #define SAMPLE_TEXTURE2D_ARRAY_BIAS(textureName, samplerName, coord2, index, bias) textureName.SampleBias(samplerName, float3(coord2, index), bias) + #define SAMPLE_TEXTURE2D_ARRAY_GRAD(textureName, samplerName, coord2, index, dpdx, dpdy) textureName.SampleGrad(samplerName, float3(coord2, index), dpdx, dpdy) + #define SAMPLE_TEXTURECUBE(textureName, samplerName, coord3) textureName.Sample(samplerName, coord3) + #define SAMPLE_TEXTURECUBE_LOD(textureName, samplerName, coord3, lod) textureName.SampleLevel(samplerName, coord3, lod) + #define SAMPLE_TEXTURECUBE_BIAS(textureName, samplerName, coord3, bias) textureName.SampleBias(samplerName, coord3, bias) + #define SAMPLE_TEXTURECUBE_ARRAY(textureName, samplerName, coord3, index) textureName.Sample(samplerName, float4(coord3, index)) + #define SAMPLE_TEXTURECUBE_ARRAY_LOD(textureName, samplerName, coord3, index, lod) textureName.SampleLevel(samplerName, float4(coord3, index), lod) + #define SAMPLE_TEXTURECUBE_ARRAY_BIAS(textureName, samplerName, coord3, index, bias) textureName.SampleBias(samplerName, float4(coord3, index), bias) + #define SAMPLE_TEXTURE3D(textureName, samplerName, coord3) textureName.Sample(samplerName, coord3) + #define SAMPLE_TEXTURE3D_LOD(textureName, samplerName, coord3, lod) textureName.SampleLevel(samplerName, coord3, lod) + + #define SAMPLE_TEXTURE2D_SHADOW(textureName, samplerName, coord3) textureName.SampleCmpLevelZero(samplerName, (coord3).xy, (coord3).z) + #define SAMPLE_TEXTURE2D_ARRAY_SHADOW(textureName, samplerName, coord3, index) textureName.SampleCmpLevelZero(samplerName, float3((coord3).xy, index), (coord3).z) + #define SAMPLE_TEXTURECUBE_SHADOW(textureName, samplerName, coord4) textureName.SampleCmpLevelZero(samplerName, (coord4).xyz, (coord4).w) + #define SAMPLE_TEXTURECUBE_ARRAY_SHADOW(textureName, samplerName, coord4, index) textureName.SampleCmpLevelZero(samplerName, float4((coord4).xyz, index), (coord4).w) + + #define LOAD_TEXTURE2D(textureName, unCoord2) textureName.Load(int3(unCoord2, 0)) + #define LOAD_TEXTURE2D_LOD(textureName, unCoord2, lod) textureName.Load(int3(unCoord2, lod)) + #define LOAD_TEXTURE2D_MSAA(textureName, unCoord2, sampleIndex) textureName.Load(unCoord2, sampleIndex) + #define LOAD_TEXTURE2D_ARRAY(textureName, unCoord2, index) textureName.Load(int4(unCoord2, index, 0)) + #define LOAD_TEXTURE2D_ARRAY_MSAA(textureName, unCoord2, index, sampleIndex) textureName.Load(int3(unCoord2, index), sampleIndex) + #define LOAD_TEXTURE2D_ARRAY_LOD(textureName, unCoord2, index, lod) textureName.Load(int4(unCoord2, index, lod)) + #define LOAD_TEXTURE3D(textureName, unCoord3) textureName.Load(int4(unCoord3, 0)) + #define LOAD_TEXTURE3D_LOD(textureName, unCoord3, lod) textureName.Load(int4(unCoord3, lod)) + + #define PLATFORM_SUPPORT_GATHER + #define GATHER_TEXTURE2D(textureName, samplerName, coord2) textureName.Gather(samplerName, coord2) + #define GATHER_TEXTURE2D_ARRAY(textureName, samplerName, coord2, index) textureName.Gather(samplerName, float3(coord2, index)) + #define GATHER_TEXTURECUBE(textureName, samplerName, coord3) textureName.Gather(samplerName, coord3) + #define GATHER_TEXTURECUBE_ARRAY(textureName, samplerName, coord3, index) textureName.Gather(samplerName, float4(coord3, index)) + #define GATHER_RED_TEXTURE2D(textureName, samplerName, coord2) textureName.GatherRed(samplerName, coord2) + #define GATHER_GREEN_TEXTURE2D(textureName, samplerName, coord2) textureName.GatherGreen(samplerName, coord2) + #define GATHER_BLUE_TEXTURE2D(textureName, samplerName, coord2) textureName.GatherBlue(samplerName, coord2) + #define GATHER_ALPHA_TEXTURE2D(textureName, samplerName, coord2) textureName.GatherAlpha(samplerName, coord2) + +#elif defined(SHADER_API_VULKAN) +// This file assume SHADER_API_VULKAN is defined + // TODO: This is a straight copy from D3D11.hlsl. Go through all this stuff and adjust where needed. + + + // Initialize arbitrary structure with zero values. + // Do not exist on some platform, in this case we need to have a standard name that call a function that will initialize all parameters to 0 + #define ZERO_INITIALIZE(type, name) name = (type)0; + #define ZERO_INITIALIZE_ARRAY(type, name, arraySize) { for (int arrayIndex = 0; arrayIndex < arraySize; arrayIndex++) { name[arrayIndex] = (type)0; } } + + // Texture util abstraction + + #define CALCULATE_TEXTURE2D_LOD(textureName, samplerName, coord2) textureName.CalculateLevelOfDetail(samplerName, coord2) + + // Texture abstraction + + #define TEXTURE2D(textureName) Texture2D textureName + #define TEXTURE2D_ARRAY(textureName) Texture2DArray textureName + #define TEXTURECUBE(textureName) TextureCube textureName + #define TEXTURECUBE_ARRAY(textureName) TextureCubeArray textureName + #define TEXTURE3D(textureName) Texture3D textureName + + #define TEXTURE2D_FLOAT(textureName) Texture2D_float textureName + #define TEXTURE2D_ARRAY_FLOAT(textureName) Texture2DArray textureName // no support to _float on Array, it's being added + #define TEXTURECUBE_FLOAT(textureName) TextureCube_float textureName + #define TEXTURECUBE_ARRAY_FLOAT(textureName) TextureCubeArray textureName // no support to _float on Array, it's being added + #define TEXTURE3D_FLOAT(textureName) Texture3D_float textureName + + #define TEXTURE2D_HALF(textureName) Texture2D_half textureName + #define TEXTURE2D_ARRAY_HALF(textureName) Texture2DArray textureName // no support to _float on Array, it's being added + #define TEXTURECUBE_HALF(textureName) TextureCube_half textureName + #define TEXTURECUBE_ARRAY_HALF(textureName) TextureCubeArray textureName // no support to _float on Array, it's being added + #define TEXTURE3D_HALF(textureName) Texture3D_half textureName + + #define TEXTURE2D_SHADOW(textureName) TEXTURE2D(textureName) + #define TEXTURE2D_ARRAY_SHADOW(textureName) TEXTURE2D_ARRAY(textureName) + #define TEXTURECUBE_SHADOW(textureName) TEXTURECUBE(textureName) + #define TEXTURECUBE_ARRAY_SHADOW(textureName) TEXTURECUBE_ARRAY(textureName) + + #define RW_TEXTURE2D(type, textureName) RWTexture2D textureName + #define RW_TEXTURE2D_ARRAY(type, textureName) RWTexture2DArray textureName + #define RW_TEXTURE3D(type, textureName) RWTexture3D textureName + + #define SAMPLER(samplerName) SamplerState samplerName + #define SAMPLER_CMP(samplerName) SamplerComparisonState samplerName + + #define TEXTURE2D_PARAM(textureName, samplerName) TEXTURE2D(textureName), SAMPLER(samplerName) + #define TEXTURE2D_ARRAY_PARAM(textureName, samplerName) TEXTURE2D_ARRAY(textureName), SAMPLER(samplerName) + #define TEXTURECUBE_PARAM(textureName, samplerName) TEXTURECUBE(textureName), SAMPLER(samplerName) + #define TEXTURECUBE_ARRAY_PARAM(textureName, samplerName) TEXTURECUBE_ARRAY(textureName), SAMPLER(samplerName) + #define TEXTURE3D_PARAM(textureName, samplerName) TEXTURE3D(textureName), SAMPLER(samplerName) + + #define TEXTURE2D_SHADOW_PARAM(textureName, samplerName) TEXTURE2D(textureName), SAMPLER_CMP(samplerName) + #define TEXTURE2D_ARRAY_SHADOW_PARAM(textureName, samplerName) TEXTURE2D_ARRAY(textureName), SAMPLER_CMP(samplerName) + #define TEXTURECUBE_SHADOW_PARAM(textureName, samplerName) TEXTURECUBE(textureName), SAMPLER_CMP(samplerName) + #define TEXTURECUBE_ARRAY_SHADOW_PARAM(textureName, samplerName) TEXTURECUBE_ARRAY(textureName), SAMPLER_CMP(samplerName) + + #define TEXTURE2D_ARGS(textureName, samplerName) textureName, samplerName + #define TEXTURE2D_ARRAY_ARGS(textureName, samplerName) textureName, samplerName + #define TEXTURECUBE_ARGS(textureName, samplerName) textureName, samplerName + #define TEXTURECUBE_ARRAY_ARGS(textureName, samplerName) textureName, samplerName + #define TEXTURE3D_ARGS(textureName, samplerName) textureName, samplerName + + #define TEXTURE2D_SHADOW_ARGS(textureName, samplerName) textureName, samplerName + #define TEXTURE2D_ARRAY_SHADOW_ARGS(textureName, samplerName) textureName, samplerName + #define TEXTURECUBE_SHADOW_ARGS(textureName, samplerName) textureName, samplerName + #define TEXTURECUBE_ARRAY_SHADOW_ARGS(textureName, samplerName) textureName, samplerName + + #define SAMPLE_TEXTURE2D(textureName, samplerName, coord2) textureName.Sample(samplerName, coord2) + #define SAMPLE_TEXTURE2D_LOD(textureName, samplerName, coord2, lod) textureName.SampleLevel(samplerName, coord2, lod) + #define SAMPLE_TEXTURE2D_BIAS(textureName, samplerName, coord2, bias) textureName.SampleBias(samplerName, coord2, bias) + #define SAMPLE_TEXTURE2D_GRAD(textureName, samplerName, coord2, dpdx, dpdy) textureName.SampleGrad(samplerName, coord2, dpdx, dpdy) + #define SAMPLE_TEXTURE2D_ARRAY(textureName, samplerName, coord2, index) textureName.Sample(samplerName, float3(coord2, index)) + #define SAMPLE_TEXTURE2D_ARRAY_LOD(textureName, samplerName, coord2, index, lod) textureName.SampleLevel(samplerName, float3(coord2, index), lod) + #define SAMPLE_TEXTURE2D_ARRAY_BIAS(textureName, samplerName, coord2, index, bias) textureName.SampleBias(samplerName, float3(coord2, index), bias) + #define SAMPLE_TEXTURE2D_ARRAY_GRAD(textureName, samplerName, coord2, index, dpdx, dpdy) textureName.SampleGrad(samplerName, float3(coord2, index), dpdx, dpdy) + #define SAMPLE_TEXTURECUBE(textureName, samplerName, coord3) textureName.Sample(samplerName, coord3) + #define SAMPLE_TEXTURECUBE_LOD(textureName, samplerName, coord3, lod) textureName.SampleLevel(samplerName, coord3, lod) + #define SAMPLE_TEXTURECUBE_BIAS(textureName, samplerName, coord3, bias) textureName.SampleBias(samplerName, coord3, bias) + #define SAMPLE_TEXTURECUBE_ARRAY(textureName, samplerName, coord3, index) textureName.Sample(samplerName, float4(coord3, index)) + #define SAMPLE_TEXTURECUBE_ARRAY_LOD(textureName, samplerName, coord3, index, lod) textureName.SampleLevel(samplerName, float4(coord3, index), lod) + #define SAMPLE_TEXTURECUBE_ARRAY_BIAS(textureName, samplerName, coord3, index, bias) textureName.SampleBias(samplerName, float4(coord3, index), bias) + #define SAMPLE_TEXTURE3D(textureName, samplerName, coord3) textureName.Sample(samplerName, coord3) + #define SAMPLE_TEXTURE3D_LOD(textureName, samplerName, coord3, lod) textureName.SampleLevel(samplerName, coord3, lod) + + #define SAMPLE_TEXTURE2D_SHADOW(textureName, samplerName, coord3) textureName.SampleCmpLevelZero(samplerName, (coord3).xy, (coord3).z) + #define SAMPLE_TEXTURE2D_ARRAY_SHADOW(textureName, samplerName, coord3, index) textureName.SampleCmpLevelZero(samplerName, float3((coord3).xy, index), (coord3).z) + #define SAMPLE_TEXTURECUBE_SHADOW(textureName, samplerName, coord4) textureName.SampleCmpLevelZero(samplerName, (coord4).xyz, (coord4).w) + #define SAMPLE_TEXTURECUBE_ARRAY_SHADOW(textureName, samplerName, coord4, index) textureName.SampleCmpLevelZero(samplerName, float4((coord4).xyz, index), (coord4).w) + + #define LOAD_TEXTURE2D(textureName, unCoord2) textureName.Load(int3(unCoord2, 0)) + #define LOAD_TEXTURE2D_LOD(textureName, unCoord2, lod) textureName.Load(int3(unCoord2, lod)) + #define LOAD_TEXTURE2D_MSAA(textureName, unCoord2, sampleIndex) textureName.Load(unCoord2, sampleIndex) + #define LOAD_TEXTURE2D_ARRAY(textureName, unCoord2, index) textureName.Load(int4(unCoord2, index, 0)) + #define LOAD_TEXTURE2D_ARRAY_MSAA(textureName, unCoord2, index, sampleIndex) textureName.Load(int3(unCoord2, index), sampleIndex) + #define LOAD_TEXTURE2D_ARRAY_LOD(textureName, unCoord2, index, lod) textureName.Load(int4(unCoord2, index, lod)) + #define LOAD_TEXTURE3D(textureName, unCoord3) textureName.Load(int4(unCoord3, 0)) + #define LOAD_TEXTURE3D_LOD(textureName, unCoord3, lod) textureName.Load(int4(unCoord3, lod)) + + #define PLATFORM_SUPPORT_GATHER + #define GATHER_TEXTURE2D(textureName, samplerName, coord2) textureName.Gather(samplerName, coord2) + #define GATHER_TEXTURE2D_ARRAY(textureName, samplerName, coord2, index) textureName.Gather(samplerName, float3(coord2, index)) + #define GATHER_TEXTURECUBE(textureName, samplerName, coord3) textureName.Gather(samplerName, coord3) + #define GATHER_TEXTURECUBE_ARRAY(textureName, samplerName, coord3, index) textureName.Gather(samplerName, float4(coord3, index)) + #define GATHER_RED_TEXTURE2D(textureName, samplerName, coord2) textureName.GatherRed(samplerName, coord2) + #define GATHER_GREEN_TEXTURE2D(textureName, samplerName, coord2) textureName.GatherGreen(samplerName, coord2) + #define GATHER_BLUE_TEXTURE2D(textureName, samplerName, coord2) textureName.GatherBlue(samplerName, coord2) + #define GATHER_ALPHA_TEXTURE2D(textureName, samplerName, coord2) textureName.GatherAlpha(samplerName, coord2) + +#elif defined(SHADER_API_SWITCH) + // This file assume SHADER_API_SWITCH is defined + + // Initialize arbitrary structure with zero values. + // Do not exist on some platform, in this case we need to have a standard name that call a function that will initialize all parameters to 0 + #define ZERO_INITIALIZE(type, name) name = (type)0; + #define ZERO_INITIALIZE_ARRAY(type, name, arraySize) { for (int arrayIndex = 0; arrayIndex < arraySize; arrayIndex++) { name[arrayIndex] = (type)0; } } + + // Texture util abstraction + + #define CALCULATE_TEXTURE2D_LOD(textureName, samplerName, coord2) textureName.CalculateLevelOfDetail(samplerName, coord2) + + // Texture abstraction + + #define TEXTURE2D(textureName) Texture2D textureName + #define TEXTURE2D_ARRAY(textureName) Texture2DArray textureName + #define TEXTURECUBE(textureName) TextureCube textureName + #define TEXTURECUBE_ARRAY(textureName) TextureCubeArray textureName + #define TEXTURE3D(textureName) Texture3D textureName + + #define TEXTURE2D_FLOAT(textureName) Texture2D_float textureName + #define TEXTURE2D_ARRAY_FLOAT(textureName) Texture2DArray textureName // no support to _float on Array, it's being added + #define TEXTURECUBE_FLOAT(textureName) TextureCube_float textureName + #define TEXTURECUBE_ARRAY_FLOAT(textureName) TextureCubeArray textureName // no support to _float on Array, it's being added + #define TEXTURE3D_FLOAT(textureName) Texture3D_float textureName + + #define TEXTURE2D_HALF(textureName) Texture2D_half textureName + #define TEXTURE2D_ARRAY_HALF(textureName) Texture2DArray textureName // no support to _float on Array, it's being added + #define TEXTURECUBE_HALF(textureName) TextureCube_half textureName + #define TEXTURECUBE_ARRAY_HALF(textureName) TextureCubeArray textureName // no support to _float on Array, it's being added + #define TEXTURE3D_HALF(textureName) Texture3D_half textureName + + #define TEXTURE2D_SHADOW(textureName) TEXTURE2D(textureName) + #define TEXTURE2D_ARRAY_SHADOW(textureName) TEXTURE2D_ARRAY(textureName) + #define TEXTURECUBE_SHADOW(textureName) TEXTURECUBE(textureName) + #define TEXTURECUBE_ARRAY_SHADOW(textureName) TEXTURECUBE_ARRAY(textureName) + + #define RW_TEXTURE2D(type, textureName) RWTexture2D textureName + #define RW_TEXTURE2D_ARRAY(type, textureName) RWTexture2DArray textureName + #define RW_TEXTURE3D(type, textureName) RWTexture3D textureName + + #define SAMPLER(samplerName) SamplerState samplerName + #define SAMPLER_CMP(samplerName) SamplerComparisonState samplerName + + #define TEXTURE2D_PARAM(textureName, samplerName) TEXTURE2D(textureName), SAMPLER(samplerName) + #define TEXTURE2D_ARRAY_PARAM(textureName, samplerName) TEXTURE2D_ARRAY(textureName), SAMPLER(samplerName) + #define TEXTURECUBE_PARAM(textureName, samplerName) TEXTURECUBE(textureName), SAMPLER(samplerName) + #define TEXTURECUBE_ARRAY_PARAM(textureName, samplerName) TEXTURECUBE_ARRAY(textureName), SAMPLER(samplerName) + #define TEXTURE3D_PARAM(textureName, samplerName) TEXTURE3D(textureName), SAMPLER(samplerName) + + #define TEXTURE2D_SHADOW_PARAM(textureName, samplerName) TEXTURE2D(textureName), SAMPLER_CMP(samplerName) + #define TEXTURE2D_ARRAY_SHADOW_PARAM(textureName, samplerName) TEXTURE2D_ARRAY(textureName), SAMPLER_CMP(samplerName) + #define TEXTURECUBE_SHADOW_PARAM(textureName, samplerName) TEXTURECUBE(textureName), SAMPLER_CMP(samplerName) + #define TEXTURECUBE_ARRAY_SHADOW_PARAM(textureName, samplerName) TEXTURECUBE_ARRAY(textureName), SAMPLER_CMP(samplerName) + + #define TEXTURE2D_ARGS(textureName, samplerName) textureName, samplerName + #define TEXTURE2D_ARRAY_ARGS(textureName, samplerName) textureName, samplerName + #define TEXTURECUBE_ARGS(textureName, samplerName) textureName, samplerName + #define TEXTURECUBE_ARRAY_ARGS(textureName, samplerName) textureName, samplerName + #define TEXTURE3D_ARGS(textureName, samplerName) textureName, samplerName + + #define TEXTURE2D_SHADOW_ARGS(textureName, samplerName) textureName, samplerName + #define TEXTURE2D_ARRAY_SHADOW_ARGS(textureName, samplerName) textureName, samplerName + #define TEXTURECUBE_SHADOW_ARGS(textureName, samplerName) textureName, samplerName + #define TEXTURECUBE_ARRAY_SHADOW_ARGS(textureName, samplerName) textureName, samplerName + + #define SAMPLE_TEXTURE2D(textureName, samplerName, coord2) textureName.Sample(samplerName, coord2) + #define SAMPLE_TEXTURE2D_LOD(textureName, samplerName, coord2, lod) textureName.SampleLevel(samplerName, coord2, lod) + #define SAMPLE_TEXTURE2D_BIAS(textureName, samplerName, coord2, bias) textureName.SampleBias(samplerName, coord2, bias) + #define SAMPLE_TEXTURE2D_GRAD(textureName, samplerName, coord2, dpdx, dpdy) textureName.SampleGrad(samplerName, coord2, dpdx, dpdy) + #define SAMPLE_TEXTURE2D_ARRAY(textureName, samplerName, coord2, index) textureName.Sample(samplerName, float3(coord2, index)) + #define SAMPLE_TEXTURE2D_ARRAY_LOD(textureName, samplerName, coord2, index, lod) textureName.SampleLevel(samplerName, float3(coord2, index), lod) + #define SAMPLE_TEXTURE2D_ARRAY_BIAS(textureName, samplerName, coord2, index, bias) textureName.SampleBias(samplerName, float3(coord2, index), bias) + #define SAMPLE_TEXTURE2D_ARRAY_GRAD(textureName, samplerName, coord2, index, dpdx, dpdy) textureName.SampleGrad(samplerName, float3(coord2, index), dpdx, dpdy) + #define SAMPLE_TEXTURECUBE(textureName, samplerName, coord3) textureName.Sample(samplerName, coord3) + #define SAMPLE_TEXTURECUBE_LOD(textureName, samplerName, coord3, lod) textureName.SampleLevel(samplerName, coord3, lod) + #define SAMPLE_TEXTURECUBE_BIAS(textureName, samplerName, coord3, bias) textureName.SampleBias(samplerName, coord3, bias) + #define SAMPLE_TEXTURECUBE_ARRAY(textureName, samplerName, coord3, index) textureName.Sample(samplerName, float4(coord3, index)) + #define SAMPLE_TEXTURECUBE_ARRAY_LOD(textureName, samplerName, coord3, index, lod) textureName.SampleLevel(samplerName, float4(coord3, index), lod) + #define SAMPLE_TEXTURECUBE_ARRAY_BIAS(textureName, samplerName, coord3, index, bias) textureName.SampleBias(samplerName, float4(coord3, index), bias) + #define SAMPLE_TEXTURE3D(textureName, samplerName, coord3) textureName.Sample(samplerName, coord3) + #define SAMPLE_TEXTURE3D_LOD(textureName, samplerName, coord3, lod) textureName.SampleLevel(samplerName, coord3, lod) + + #define SAMPLE_TEXTURE2D_SHADOW(textureName, samplerName, coord3) textureName.SampleCmpLevelZero(samplerName, (coord3).xy, (coord3).z) + #define SAMPLE_TEXTURE2D_ARRAY_SHADOW(textureName, samplerName, coord3, index) textureName.SampleCmpLevelZero(samplerName, float3((coord3).xy, index), (coord3).z) + #define SAMPLE_TEXTURECUBE_SHADOW(textureName, samplerName, coord4) textureName.SampleCmpLevelZero(samplerName, (coord4).xyz, (coord4).w) + #define SAMPLE_TEXTURECUBE_ARRAY_SHADOW(textureName, samplerName, coord4, index) textureName.SampleCmpLevelZero(samplerName, float4((coord4).xyz, index), (coord4).w) + + + #define LOAD_TEXTURE2D(textureName, unCoord2) textureName.Load(int3(unCoord2, 0)) + #define LOAD_TEXTURE2D_LOD(textureName, unCoord2, lod) textureName.Load(int3(unCoord2, lod)) + #define LOAD_TEXTURE2D_MSAA(textureName, unCoord2, sampleIndex) textureName.Load(unCoord2, sampleIndex) + #define LOAD_TEXTURE2D_ARRAY(textureName, unCoord2, index) textureName.Load(int4(unCoord2, index, 0)) + #define LOAD_TEXTURE2D_ARRAY_LOD(textureName, unCoord2, index, lod) textureName.Load(int4(unCoord2, index, lod)) + #define LOAD_TEXTURE3D(textureName, unCoord3) textureName.Load(int4(unCoord3, 0)) + #define LOAD_TEXTURE3D_LOD(textureName, unCoord3, lod) textureName.Load(int4(unCoord3, lod)) + + #define PLATFORM_SUPPORT_GATHER + #define GATHER_TEXTURE2D(textureName, samplerName, coord2) textureName.Gather(samplerName, coord2) + #define GATHER_TEXTURE2D_ARRAY(textureName, samplerName, coord2, index) textureName.Gather(samplerName, float3(coord2, index)) + #define GATHER_TEXTURECUBE(textureName, samplerName, coord3) textureName.Gather(samplerName, coord3) + #define GATHER_TEXTURECUBE_ARRAY(textureName, samplerName, coord3, index) textureName.Gather(samplerName, float4(coord3, index)) + #define GATHER_RED_TEXTURE2D(textureName, samplerName, coord2) textureName.GatherRed(samplerName, coord2) + #define GATHER_GREEN_TEXTURE2D(textureName, samplerName, coord2) textureName.GatherGreen(samplerName, coord2) + #define GATHER_BLUE_TEXTURE2D(textureName, samplerName, coord2) textureName.GatherBlue(samplerName, coord2) + #define GATHER_ALPHA_TEXTURE2D(textureName, samplerName, coord2) textureName.GatherAlpha(samplerName, coord2) + +#elif defined(SHADER_API_GLCORE) + + // OpenGL 4.1 SM 5.0 https://docs.unity3d.com/Manual/SL-ShaderCompileTargets.html + #if (SHADER_TARGET >= 46) + #define OPENGL4_1_SM5 1 + #else + #define OPENGL4_1_SM5 0 + #endif + + // Initialize arbitrary structure with zero values. + // Do not exist on some platform, in this case we need to have a standard name that call a function that will initialize all parameters to 0 + #define ZERO_INITIALIZE(type, name) name = (type)0; + #define ZERO_INITIALIZE_ARRAY(type, name, arraySize) { for (int arrayIndex = 0; arrayIndex < arraySize; arrayIndex++) { name[arrayIndex] = (type)0; } } + + // Texture util abstraction + + #define CALCULATE_TEXTURE2D_LOD(textureName, samplerName, coord2) textureName.CalculateLevelOfDetail(samplerName, coord2) + + // Texture abstraction + + #define TEXTURE2D(textureName) Texture2D textureName + #define TEXTURE2D_ARRAY(textureName) Texture2DArray textureName + #define TEXTURECUBE(textureName) TextureCube textureName + #define TEXTURECUBE_ARRAY(textureName) TextureCubeArray textureName + #define TEXTURE3D(textureName) Texture3D textureName + + #define TEXTURE2D_FLOAT(textureName) TEXTURE2D(textureName) + #define TEXTURE2D_ARRAY_FLOAT(textureName) TEXTURE2D_ARRAY(textureName) + #define TEXTURECUBE_FLOAT(textureName) TEXTURECUBE(textureName) + #define TEXTURECUBE_ARRAY_FLOAT(textureName) TEXTURECUBE_ARRAY(textureName) + #define TEXTURE3D_FLOAT(textureName) TEXTURE3D(textureName) + + #define TEXTURE2D_HALF(textureName) TEXTURE2D(textureName) + #define TEXTURE2D_ARRAY_HALF(textureName) TEXTURE2D_ARRAY(textureName) + #define TEXTURECUBE_HALF(textureName) TEXTURECUBE(textureName) + #define TEXTURECUBE_ARRAY_HALF(textureName) TEXTURECUBE_ARRAY(textureName) + #define TEXTURE3D_HALF(textureName) TEXTURE3D(textureName) + + #define TEXTURE2D_SHADOW(textureName) TEXTURE2D(textureName) + #define TEXTURE2D_ARRAY_SHADOW(textureName) TEXTURE2D_ARRAY(textureName) + #define TEXTURECUBE_SHADOW(textureName) TEXTURECUBE(textureName) + #define TEXTURECUBE_ARRAY_SHADOW(textureName) TEXTURECUBE_ARRAY(textureName) + + #define RW_TEXTURE2D(type, textureName) RWTexture2D textureName + #define RW_TEXTURE2D_ARRAY(type, textureName) RWTexture2DArray textureName + #define RW_TEXTURE3D(type, textureName) RWTexture3D textureName + + #define SAMPLER(samplerName) SamplerState samplerName + #define SAMPLER_CMP(samplerName) SamplerComparisonState samplerName + + #define TEXTURE2D_PARAM(textureName, samplerName) TEXTURE2D(textureName), SAMPLER(samplerName) + #define TEXTURE2D_ARRAY_PARAM(textureName, samplerName) TEXTURE2D_ARRAY(textureName), SAMPLER(samplerName) + #define TEXTURECUBE_PARAM(textureName, samplerName) TEXTURECUBE(textureName), SAMPLER(samplerName) + #define TEXTURECUBE_ARRAY_PARAM(textureName, samplerName) TEXTURECUBE_ARRAY(textureName), SAMPLER(samplerName) + #define TEXTURE3D_PARAM(textureName, samplerName) TEXTURE3D(textureName), SAMPLER(samplerName) + + #define TEXTURE2D_SHADOW_PARAM(textureName, samplerName) TEXTURE2D(textureName), SAMPLER_CMP(samplerName) + #define TEXTURE2D_ARRAY_SHADOW_PARAM(textureName, samplerName) TEXTURE2D_ARRAY(textureName), SAMPLER_CMP(samplerName) + #define TEXTURECUBE_SHADOW_PARAM(textureName, samplerName) TEXTURECUBE(textureName), SAMPLER_CMP(samplerName) + #define TEXTURECUBE_ARRAY_SHADOW_PARAM(textureName, samplerName) TEXTURECUBE_ARRAY(textureName), SAMPLER_CMP(samplerName) + + #define TEXTURE2D_ARGS(textureName, samplerName) textureName, samplerName + #define TEXTURE2D_ARRAY_ARGS(textureName, samplerName) textureName, samplerName + #define TEXTURECUBE_ARGS(textureName, samplerName) textureName, samplerName + #define TEXTURECUBE_ARRAY_ARGS(textureName, samplerName) textureName, samplerName + #define TEXTURE3D_ARGS(textureName, samplerName) textureName, samplerName + + #define TEXTURE2D_SHADOW_ARGS(textureName, samplerName) textureName, samplerName + #define TEXTURE2D_ARRAY_SHADOW_ARGS(textureName, samplerName) textureName, samplerName + #define TEXTURECUBE_SHADOW_ARGS(textureName, samplerName) textureName, samplerName + #define TEXTURECUBE_ARRAY_SHADOW_ARGS(textureName, samplerName) textureName, samplerName + + #define SAMPLE_TEXTURE2D(textureName, samplerName, coord2) textureName.Sample(samplerName, coord2) + #define SAMPLE_TEXTURE2D_LOD(textureName, samplerName, coord2, lod) textureName.SampleLevel(samplerName, coord2, lod) + #define SAMPLE_TEXTURE2D_BIAS(textureName, samplerName, coord2, bias) textureName.SampleBias(samplerName, coord2, bias) + #define SAMPLE_TEXTURE2D_GRAD(textureName, samplerName, coord2, ddx, ddy) textureName.SampleGrad(samplerName, coord2, ddx, ddy) + #define SAMPLE_TEXTURE2D_ARRAY(textureName, samplerName, coord2, index) textureName.Sample(samplerName, float3(coord2, index)) + #define SAMPLE_TEXTURE2D_ARRAY_LOD(textureName, samplerName, coord2, index, lod) textureName.SampleLevel(samplerName, float3(coord2, index), lod) + #define SAMPLE_TEXTURE2D_ARRAY_BIAS(textureName, samplerName, coord2, index, bias) textureName.SampleBias(samplerName, float3(coord2, index), bias) + #define SAMPLE_TEXTURE2D_ARRAY_GRAD(textureName, samplerName, coord2, index, dpdx, dpdy) textureName.SampleGrad(samplerName, float3(coord2, index), dpdx, dpdy) + #define SAMPLE_TEXTURECUBE(textureName, samplerName, coord3) textureName.Sample(samplerName, coord3) + #define SAMPLE_TEXTURECUBE_LOD(textureName, samplerName, coord3, lod) textureName.SampleLevel(samplerName, coord3, lod) + #define SAMPLE_TEXTURECUBE_BIAS(textureName, samplerName, coord3, bias) textureName.SampleBias(samplerName, coord3, bias) + #ifdef UNITY_NO_CUBEMAP_ARRAY + #define SAMPLE_TEXTURECUBE_ARRAY(textureName, samplerName, coord3, index) ERROR_ON_UNSUPPORTED_FUNCTION(SAMPLE_TEXTURECUBE_ARRAY) + #define SAMPLE_TEXTURECUBE_ARRAY_LOD(textureName, samplerName, coord3, index, lod) ERROR_ON_UNSUPPORTED_FUNCTION(SAMPLE_TEXTURECUBE_ARRAY_LOD) + #define SAMPLE_TEXTURECUBE_ARRAY_LOD(textureName, samplerName, coord3, index, bias) ERROR_ON_UNSUPPORTED_FUNCTION(SAMPLE_TEXTURECUBE_ARRAY_LOD) + #else + #define SAMPLE_TEXTURECUBE_ARRAY(textureName, samplerName, coord3, index) textureName.Sample(samplerName, float4(coord3, index)) + #define SAMPLE_TEXTURECUBE_ARRAY_LOD(textureName, samplerName, coord3, index, lod) textureName.SampleLevel(samplerName, float4(coord3, index), lod) + #define SAMPLE_TEXTURECUBE_ARRAY_BIAS(textureName, samplerName, coord3, index, bias)textureName.SampleBias(samplerName, float4(coord3, index), bias) + #endif + #define SAMPLE_TEXTURE3D(textureName, samplerName, coord3) textureName.Sample(samplerName, coord3) + #define SAMPLE_TEXTURE3D_LOD(textureName, samplerName, coord3, lod) textureName.SampleLevel(samplerName, coord3, lod) + + #define SAMPLE_TEXTURE2D_SHADOW(textureName, samplerName, coord3) textureName.SampleCmpLevelZero(samplerName, (coord3).xy, (coord3).z) + #define SAMPLE_TEXTURE2D_ARRAY_SHADOW(textureName, samplerName, coord3, index) textureName.SampleCmpLevelZero(samplerName, float3((coord3).xy, index), (coord3).z) + #define SAMPLE_TEXTURECUBE_SHADOW(textureName, samplerName, coord4) textureName.SampleCmpLevelZero(samplerName, (coord4).xyz, (coord4).w) + #define SAMPLE_TEXTURECUBE_ARRAY_SHADOW(textureName, samplerName, coord4, index) textureName.SampleCmpLevelZero(samplerName, float4((coord4).xyz, index), (coord4).w) + + #define LOAD_TEXTURE2D(textureName, unCoord2) textureName.Load(int3(unCoord2, 0)) + #define LOAD_TEXTURE2D_LOD(textureName, unCoord2, lod) textureName.Load(int3(unCoord2, lod)) + #define LOAD_TEXTURE2D_MSAA(textureName, unCoord2, sampleIndex) textureName.Load(unCoord2, sampleIndex) + #define LOAD_TEXTURE2D_ARRAY(textureName, unCoord2, index) textureName.Load(int4(unCoord2, index, 0)) + #define LOAD_TEXTURE2D_ARRAY_MSAA(textureName, unCoord2, index, sampleIndex) textureName.Load(int3(unCoord2, index), sampleIndex) + #define LOAD_TEXTURE2D_ARRAY_LOD(textureName, unCoord2, index, lod) textureName.Load(int4(unCoord2, index, lod)) + + #if OPENGL4_1_SM5 + #define PLATFORM_SUPPORT_GATHER + #define GATHER_TEXTURE2D(textureName, samplerName, coord2) textureName.Gather(samplerName, coord2) + #define GATHER_TEXTURE2D_ARRAY(textureName, samplerName, coord2, index) textureName.Gather(samplerName, float3(coord2, index)) + #define GATHER_TEXTURECUBE(textureName, samplerName, coord3) textureName.Gather(samplerName, coord3) + #define GATHER_TEXTURECUBE_ARRAY(textureName, samplerName, coord3, index) textureName.Gather(samplerName, float4(coord3, index)) + #else + #define GATHER_TEXTURE2D(textureName, samplerName, coord2) ERROR_ON_UNSUPPORTED_FUNCTION(GATHER_TEXTURE2D) + #define GATHER_TEXTURE2D_ARRAY(textureName, samplerName, coord2, index) ERROR_ON_UNSUPPORTED_FUNCTION(GATHER_TEXTURE2D_ARRAY) + #define GATHER_TEXTURECUBE(textureName, samplerName, coord3) ERROR_ON_UNSUPPORTED_FUNCTION(GATHER_TEXTURECUBE) + #define GATHER_TEXTURECUBE_ARRAY(textureName, samplerName, coord3, index) ERROR_ON_UNSUPPORTED_FUNCTION(GATHER_TEXTURECUBE_ARRAY) + #endif + + + #elif defined(SHADER_API_GLES3) + + // GLES 3.1 + AEP shader feature https://docs.unity3d.com/Manual/SL-ShaderCompileTargets.html + #if (SHADER_TARGET >= 40) + #define GLES3_1_AEP 1 + #else + #define GLES3_1_AEP 0 + #endif + + // Initialize arbitrary structure with zero values. + // Do not exist on some platform, in this case we need to have a standard name that call a function that will initialize all parameters to 0 + #define ZERO_INITIALIZE(type, name) name = (type)0; + #define ZERO_INITIALIZE_ARRAY(type, name, arraySize) { for (int arrayIndex = 0; arrayIndex < arraySize; arrayIndex++) { name[arrayIndex] = (type)0; } } + + // Texture util abstraction + + #define CALCULATE_TEXTURE2D_LOD(textureName, samplerName, coord2) textureName.CalculateLevelOfDetail(samplerName, coord2) + + // Texture abstraction + + #define TEXTURE2D(textureName) Texture2D textureName + #define TEXTURE2D_ARRAY(textureName) Texture2DArray textureName + #define TEXTURECUBE(textureName) TextureCube textureName + #define TEXTURECUBE_ARRAY(textureName) TextureCubeArray textureName + #define TEXTURE3D(textureName) Texture3D textureName + + #define TEXTURE2D_FLOAT(textureName) Texture2D_float textureName + #define TEXTURE2D_ARRAY_FLOAT(textureName) Texture2DArray textureName // no support to _float on Array, it's being added + #define TEXTURECUBE_FLOAT(textureName) TextureCube_float textureName + #define TEXTURECUBE_ARRAY_FLOAT(textureName) TextureCubeArray textureName // no support to _float on Array, it's being added + #define TEXTURE3D_FLOAT(textureName) Texture3D_float textureName + + #define TEXTURE2D_HALF(textureName) Texture2D_half textureName + #define TEXTURE2D_ARRAY_HALF(textureName) Texture2DArray textureName // no support to _float on Array, it's being added + #define TEXTURECUBE_HALF(textureName) TextureCube_half textureName + #define TEXTURECUBE_ARRAY_HALF(textureName) TextureCubeArray textureName // no support to _float on Array, it's being added + #define TEXTURE3D_HALF(textureName) Texture3D_half textureName + + #define TEXTURE2D_SHADOW(textureName) TEXTURE2D(textureName) + #define TEXTURE2D_ARRAY_SHADOW(textureName) TEXTURE2D_ARRAY(textureName) + #define TEXTURECUBE_SHADOW(textureName) TEXTURECUBE(textureName) + #define TEXTURECUBE_ARRAY_SHADOW(textureName) TEXTURECUBE_ARRAY(textureName) + + #if GLES3_1_AEP + #define RW_TEXTURE2D(type, textureName) RWTexture2D textureName + #define RW_TEXTURE2D_ARRAY(type, textureName) RWTexture2DArray textureName + #define RW_TEXTURE3D(type, textureName) RWTexture3D textureName + #else + #define RW_TEXTURE2D(type, textureName) ERROR_ON_UNSUPPORTED_FUNCTION(RWTexture2D) + #define RW_TEXTURE2D_ARRAY(type, textureName) ERROR_ON_UNSUPPORTED_FUNCTION(RWTexture2DArray) + #define RW_TEXTURE3D(type, textureName) ERROR_ON_UNSUPPORTED_FUNCTION(RWTexture3D) + #endif + + #define SAMPLER(samplerName) SamplerState samplerName + #define SAMPLER_CMP(samplerName) SamplerComparisonState samplerName + + #define TEXTURE2D_PARAM(textureName, samplerName) TEXTURE2D(textureName), SAMPLER(samplerName) + #define TEXTURE2D_ARRAY_PARAM(textureName, samplerName) TEXTURE2D_ARRAY(textureName), SAMPLER(samplerName) + #define TEXTURECUBE_PARAM(textureName, samplerName) TEXTURECUBE(textureName), SAMPLER(samplerName) + #define TEXTURECUBE_ARRAY_PARAM(textureName, samplerName) TEXTURECUBE_ARRAY(textureName), SAMPLER(samplerName) + #define TEXTURE3D_PARAM(textureName, samplerName) TEXTURE3D(textureName), SAMPLER(samplerName) + + #define TEXTURE2D_SHADOW_PARAM(textureName, samplerName) TEXTURE2D(textureName), SAMPLER_CMP(samplerName) + #define TEXTURE2D_ARRAY_SHADOW_PARAM(textureName, samplerName) TEXTURE2D_ARRAY(textureName), SAMPLER_CMP(samplerName) + #define TEXTURECUBE_SHADOW_PARAM(textureName, samplerName) TEXTURECUBE(textureName), SAMPLER_CMP(samplerName) + #define TEXTURECUBE_ARRAY_SHADOW_PARAM(textureName, samplerName) TEXTURECUBE_ARRAY(textureName), SAMPLER_CMP(samplerName) + + #define TEXTURE2D_ARGS(textureName, samplerName) textureName, samplerName + #define TEXTURE2D_ARRAY_ARGS(textureName, samplerName) textureName, samplerName + #define TEXTURECUBE_ARGS(textureName, samplerName) textureName, samplerName + #define TEXTURECUBE_ARRAY_ARGS(textureName, samplerName) textureName, samplerName + #define TEXTURE3D_ARGS(textureName, samplerName) textureName, samplerName + + #define TEXTURE2D_SHADOW_ARGS(textureName, samplerName) textureName, samplerName + #define TEXTURE2D_ARRAY_SHADOW_ARGS(textureName, samplerName) textureName, samplerName + #define TEXTURECUBE_SHADOW_ARGS(textureName, samplerName) textureName, samplerName + #define TEXTURECUBE_ARRAY_SHADOW_ARGS(textureName, samplerName) textureName, samplerName + + #define SAMPLE_TEXTURE2D(textureName, samplerName, coord2) textureName.Sample(samplerName, coord2) + #define SAMPLE_TEXTURE2D_LOD(textureName, samplerName, coord2, lod) textureName.SampleLevel(samplerName, coord2, lod) + #define SAMPLE_TEXTURE2D_BIAS(textureName, samplerName, coord2, bias) textureName.SampleBias(samplerName, coord2, bias) + #define SAMPLE_TEXTURE2D_GRAD(textureName, samplerName, coord2, ddx, ddy) textureName.SampleGrad(samplerName, coord2, ddx, ddy) + #define SAMPLE_TEXTURE2D_ARRAY(textureName, samplerName, coord2, index) textureName.Sample(samplerName, float3(coord2, index)) + #define SAMPLE_TEXTURE2D_ARRAY_LOD(textureName, samplerName, coord2, index, lod) textureName.SampleLevel(samplerName, float3(coord2, index), lod) + #define SAMPLE_TEXTURE2D_ARRAY_BIAS(textureName, samplerName, coord2, index, bias) textureName.SampleBias(samplerName, float3(coord2, index), bias) + #define SAMPLE_TEXTURE2D_ARRAY_GRAD(textureName, samplerName, coord2, index, dpdx, dpdy) textureName.SampleGrad(samplerName, float3(coord2, index), dpdx, dpdy) + #define SAMPLE_TEXTURECUBE(textureName, samplerName, coord3) textureName.Sample(samplerName, coord3) + #define SAMPLE_TEXTURECUBE_LOD(textureName, samplerName, coord3, lod) textureName.SampleLevel(samplerName, coord3, lod) + #define SAMPLE_TEXTURECUBE_BIAS(textureName, samplerName, coord3, bias) textureName.SampleBias(samplerName, coord3, bias) + + #ifdef UNITY_NO_CUBEMAP_ARRAY + #define SAMPLE_TEXTURECUBE_ARRAY(textureName, samplerName, coord3, index) ERROR_ON_UNSUPPORTED_FUNCTION(SAMPLE_TEXTURECUBE_ARRAY) + #define SAMPLE_TEXTURECUBE_ARRAY_LOD(textureName, samplerName, coord3, index, lod) ERROR_ON_UNSUPPORTED_FUNCTION(SAMPLE_TEXTURECUBE_ARRAY_LOD) + #define SAMPLE_TEXTURECUBE_ARRAY_BIAS(textureName, samplerName, coord3, index, bias)ERROR_ON_UNSUPPORTED_FUNCTION(SAMPLE_TEXTURECUBE_ARRAY_BIAS) + #else + #define SAMPLE_TEXTURECUBE_ARRAY(textureName, samplerName, coord3, index) textureName.Sample(samplerName, float4(coord3, index)) + #define SAMPLE_TEXTURECUBE_ARRAY_LOD(textureName, samplerName, coord3, index, lod) textureName.SampleLevel(samplerName, float4(coord3, index), lod) + #define SAMPLE_TEXTURECUBE_ARRAY_BIAS(textureName, samplerName, coord3, index, bias)textureName.SampleBias(samplerName, float4(coord3, index), bias) + #endif + + #define SAMPLE_TEXTURE3D(textureName, samplerName, coord3) textureName.Sample(samplerName, coord3) + #define SAMPLE_TEXTURE3D_LOD(textureName, samplerName, coord3, lod) textureName.SampleLevel(samplerName, coord3, lod) + + #define SAMPLE_TEXTURE2D_SHADOW(textureName, samplerName, coord3) textureName.SampleCmpLevelZero(samplerName, (coord3).xy, (coord3).z) + #define SAMPLE_TEXTURE2D_ARRAY_SHADOW(textureName, samplerName, coord3, index) textureName.SampleCmpLevelZero(samplerName, float3((coord3).xy, index), (coord3).z) + #define SAMPLE_TEXTURECUBE_SHADOW(textureName, samplerName, coord4) textureName.SampleCmpLevelZero(samplerName, (coord4).xyz, (coord4).w) + #define SAMPLE_TEXTURECUBE_ARRAY_SHADOW(textureName, samplerName, coord4, index) textureName.SampleCmpLevelZero(samplerName, float4((coord4).xyz, index), (coord4).w) + + + #define LOAD_TEXTURE2D(textureName, unCoord2) textureName.Load(int3(unCoord2, 0)) + #define LOAD_TEXTURE2D_LOD(textureName, unCoord2, lod) textureName.Load(int3(unCoord2, lod)) + #define LOAD_TEXTURE2D_MSAA(textureName, unCoord2, sampleIndex) textureName.Load(unCoord2, sampleIndex) + #define LOAD_TEXTURE2D_ARRAY(textureName, unCoord2, index) textureName.Load(int4(unCoord2, index, 0)) + #define LOAD_TEXTURE2D_ARRAY_MSAA(textureName, unCoord2, index, sampleIndex) textureName.Load(int3(unCoord2, index), sampleIndex) + #define LOAD_TEXTURE2D_ARRAY_LOD(textureName, unCoord2, index, lod) textureName.Load(int4(unCoord2, index, lod)) + #define LOAD_TEXTURE3D(textureName, unCoord3) textureName.Load(int4(unCoord3, 0)) + #define LOAD_TEXTURE3D_LOD(textureName, unCoord3, lod) textureName.Load(int4(unCoord3, lod)) + + #if GLES3_1_AEP + #define PLATFORM_SUPPORT_GATHER + #define GATHER_TEXTURE2D(textureName, samplerName, coord2) textureName.Gather(samplerName, coord2) + #define GATHER_TEXTURE2D_ARRAY(textureName, samplerName, coord2, index) textureName.Gather(samplerName, float3(coord2, index)) + #define GATHER_TEXTURECUBE(textureName, samplerName, coord3) textureName.Gather(samplerName, coord3) + #define GATHER_TEXTURECUBE_ARRAY(textureName, samplerName, coord3, index) textureName.Gather(samplerName, float4(coord3, index)) + #define GATHER_RED_TEXTURE2D(textureName, samplerName, coord2) textureName.GatherRed(samplerName, coord2) + #define GATHER_GREEN_TEXTURE2D(textureName, samplerName, coord2) textureName.GatherGreen(samplerName, coord2) + #define GATHER_BLUE_TEXTURE2D(textureName, samplerName, coord2) textureName.GatherBlue(samplerName, coord2) + #define GATHER_ALPHA_TEXTURE2D(textureName, samplerName, coord2) textureName.GatherAlpha(samplerName, coord2) + #else + #define GATHER_TEXTURE2D(textureName, samplerName, coord2) ERROR_ON_UNSUPPORTED_FUNCTION(GATHER_TEXTURE2D) + #define GATHER_TEXTURE2D_ARRAY(textureName, samplerName, coord2, index) ERROR_ON_UNSUPPORTED_FUNCTION(GATHER_TEXTURE2D_ARRAY) + #define GATHER_TEXTURECUBE(textureName, samplerName, coord3) ERROR_ON_UNSUPPORTED_FUNCTION(GATHER_TEXTURECUBE) + #define GATHER_TEXTURECUBE_ARRAY(textureName, samplerName, coord3, index) ERROR_ON_UNSUPPORTED_FUNCTION(GATHER_TEXTURECUBE_ARRAY) + #define GATHER_RED_TEXTURE2D(textureName, samplerName, coord2) ERROR_ON_UNSUPPORTED_FUNCTION(GATHER_RED_TEXTURE2D) + #define GATHER_GREEN_TEXTURE2D(textureName, samplerName, coord2) ERROR_ON_UNSUPPORTED_FUNCTION(GATHER_GREEN_TEXTURE2D) + #define GATHER_BLUE_TEXTURE2D(textureName, samplerName, coord2) ERROR_ON_UNSUPPORTED_FUNCTION(GATHER_BLUE_TEXTURE2D) + #define GATHER_ALPHA_TEXTURE2D(textureName, samplerName, coord2) ERROR_ON_UNSUPPORTED_FUNCTION(GATHER_ALPHA_TEXTURE2D) + #endif + + +#elif defined(SHADER_API_GLES) + + + #define uint int + + #define rcp(x) 1.0 / (x) + #define ddx_fine ddx + #define ddy_fine ddy + #define asfloat + #define asuint(x) asint(x) + #define f32tof16 + #define f16tof32 + + #define ERROR_ON_UNSUPPORTED_FUNCTION(funcName) #error #funcName is not supported on GLES 2.0 + + // Initialize arbitrary structure with zero values. + // Do not exist on some platform, in this case we need to have a standard name that call a function that will initialize all parameters to 0 + #define ZERO_INITIALIZE(type, name) name = (type)0; + #define ZERO_INITIALIZE_ARRAY(type, name, arraySize) { for (int arrayIndex = 0; arrayIndex < arraySize; arrayIndex++) { name[arrayIndex] = (type)0; } } + + + // Texture util abstraction + + #define CALCULATE_TEXTURE2D_LOD(textureName, samplerName, coord2) #error calculate Level of Detail not supported in GLES2 + + // Texture abstraction + + #define TEXTURE2D(textureName) sampler2D textureName + #define TEXTURE2D_ARRAY(textureName) samplerCUBE textureName // No support to texture2DArray + #define TEXTURECUBE(textureName) samplerCUBE textureName + #define TEXTURECUBE_ARRAY(textureName) samplerCUBE textureName // No supoport to textureCubeArray and can't emulate with texture2DArray + #define TEXTURE3D(textureName) sampler3D textureName + + #define TEXTURE2D_FLOAT(textureName) sampler2D_float textureName + #define TEXTURE2D_ARRAY_FLOAT(textureName) TEXTURECUBE_FLOAT(textureName) // No support to texture2DArray + #define TEXTURECUBE_FLOAT(textureName) samplerCUBE_float textureName + #define TEXTURECUBE_ARRAY_FLOAT(textureName) TEXTURECUBE_FLOAT(textureName) // No support to textureCubeArray + #define TEXTURE3D_FLOAT(textureName) sampler3D_float textureName + + #define TEXTURE2D_HALF(textureName) sampler2D_half textureName + #define TEXTURE2D_ARRAY_HALF(textureName) TEXTURECUBE_HALF(textureName) // No support to texture2DArray + #define TEXTURECUBE_HALF(textureName) samplerCUBE_half textureName + #define TEXTURECUBE_ARRAY_HALF(textureName) TEXTURECUBE_HALF(textureName) // No support to textureCubeArray + #define TEXTURE3D_HALF(textureName) sampler3D_half textureName + + #define TEXTURE2D_SHADOW(textureName) SHADOW2D_TEXTURE_AND_SAMPLER textureName + #define TEXTURE2D_ARRAY_SHADOW(textureName) TEXTURECUBE_SHADOW(textureName) // No support to texture array + #define TEXTURECUBE_SHADOW(textureName) SHADOWCUBE_TEXTURE_AND_SAMPLER textureName + #define TEXTURECUBE_ARRAY_SHADOW(textureName) TEXTURECUBE_SHADOW(textureName) // No support to texture array + + #define RW_TEXTURE2D(type, textureNam) ERROR_ON_UNSUPPORTED_FUNCTION(RWTexture2D) + #define RW_TEXTURE2D_ARRAY(type, textureName) ERROR_ON_UNSUPPORTED_FUNCTION(RWTexture2DArray) + #define RW_TEXTURE3D(type, textureNam) ERROR_ON_UNSUPPORTED_FUNCTION(RWTexture3D) + + #define SAMPLER(samplerName) + #define SAMPLER_CMP(samplerName) + + #define TEXTURE2D_PARAM(textureName, samplerName) sampler2D textureName + #define TEXTURE2D_ARRAY_PARAM(textureName, samplerName) samplerCUBE textureName + #define TEXTURECUBE_PARAM(textureName, samplerName) samplerCUBE textureName + #define TEXTURECUBE_ARRAY_PARAM(textureName, samplerName) samplerCUBE textureName + #define TEXTURE3D_PARAM(textureName, samplerName) sampler3D textureName + #define TEXTURE2D_SHADOW_PARAM(textureName, samplerName) SHADOW2D_TEXTURE_AND_SAMPLER textureName + #define TEXTURE2D_ARRAY_SHADOW_PARAM(textureName, samplerName) SHADOWCUBE_TEXTURE_AND_SAMPLER textureName + #define TEXTURECUBE_SHADOW_PARAM(textureName, samplerName) SHADOWCUBE_TEXTURE_AND_SAMPLER textureName + + #define TEXTURE2D_ARGS(textureName, samplerName) textureName + #define TEXTURE2D_ARRAY_ARGS(textureName, samplerName) textureName + #define TEXTURECUBE_ARGS(textureName, samplerName) textureName + #define TEXTURECUBE_ARRAY_ARGS(textureName, samplerName) textureName + #define TEXTURE3D_ARGS(textureName, samplerName) textureName + #define TEXTURE2D_SHADOW_ARGS(textureName, samplerName) textureName + #define TEXTURE2D_ARRAY_SHADOW_ARGS(textureName, samplerName) textureName + #define TEXTURECUBE_SHADOW_ARGS(textureName, samplerName) textureName + + #define SAMPLE_TEXTURE2D(textureName, samplerName, coord2) tex2D(textureName, coord2) + + #if (SHADER_TARGET >= 30) + #define SAMPLE_TEXTURE2D_LOD(textureName, samplerName, coord2, lod) tex2Dlod(textureName, float4(coord2, 0, lod)) + #else + // No lod support. Very poor approximation with bias. + #define SAMPLE_TEXTURE2D_LOD(textureName, samplerName, coord2, lod) SAMPLE_TEXTURE2D_BIAS(textureName, samplerName, coord2, lod) + #endif + + #define SAMPLE_TEXTURE2D_BIAS(textureName, samplerName, coord2, bias) tex2Dbias(textureName, float4(coord2, 0, bias)) + #define SAMPLE_TEXTURE2D_GRAD(textureName, samplerName, coord2, ddx, ddy) SAMPLE_TEXTURE2D(textureName, samplerName, coord2) + #define SAMPLE_TEXTURE2D_ARRAY(textureName, samplerName, coord2, index) ERROR_ON_UNSUPPORTED_FUNCTION(SAMPLE_TEXTURE2D_ARRAY) + #define SAMPLE_TEXTURE2D_ARRAY_LOD(textureName, samplerName, coord2, index, lod) ERROR_ON_UNSUPPORTED_FUNCTION(SAMPLE_TEXTURE2D_ARRAY_LOD) + #define SAMPLE_TEXTURE2D_ARRAY_BIAS(textureName, samplerName, coord2, index, bias) ERROR_ON_UNSUPPORTED_FUNCTION(SAMPLE_TEXTURE2D_ARRAY_BIAS) + #define SAMPLE_TEXTURE2D_ARRAY_GRAD(textureName, samplerName, coord2, index, dpdx, dpdy) ERROR_ON_UNSUPPORTED_FUNCTION(SAMPLE_TEXTURE2D_ARRAY_GRAD) + #define SAMPLE_TEXTURECUBE(textureName, samplerName, coord3) texCUBE(textureName, coord3) + // No lod support. Very poor approximation with bias. + #define SAMPLE_TEXTURECUBE_LOD(textureName, samplerName, coord3, lod) SAMPLE_TEXTURECUBE_BIAS(textureName, samplerName, coord3, lod) + #define SAMPLE_TEXTURECUBE_BIAS(textureName, samplerName, coord3, bias) texCUBEbias(textureName, float4(coord3, bias)) + #define SAMPLE_TEXTURECUBE_ARRAY(textureName, samplerName, coord3, index) ERROR_ON_UNSUPPORTED_FUNCTION(SAMPLE_TEXTURECUBE_ARRAY) + #define SAMPLE_TEXTURECUBE_ARRAY_LOD(textureName, samplerName, coord3, index, lod) ERROR_ON_UNSUPPORTED_FUNCTION(SAMPLE_TEXTURECUBE_ARRAY_LOD) + #define SAMPLE_TEXTURECUBE_ARRAY_BIAS(textureName, samplerName, coord3, index, bias) ERROR_ON_UNSUPPORTED_FUNCTION(SAMPLE_TEXTURECUBE_ARRAY_BIAS) + #define SAMPLE_TEXTURE3D(textureName, samplerName, coord3) tex3D(textureName, coord3) + #define SAMPLE_TEXTURE3D_LOD(textureName, samplerName, coord3, lod) ERROR_ON_UNSUPPORTED_FUNCTION(SAMPLE_TEXTURE3D_LOD) + + #define SAMPLE_TEXTURE2D_SHADOW(textureName, samplerName, coord3) SHADOW2D_SAMPLE(textureName, samplerName, coord3) + #define SAMPLE_TEXTURE2D_ARRAY_SHADOW(textureName, samplerName, coord3, index) ERROR_ON_UNSUPPORTED_FUNCTION(SAMPLE_TEXTURE2D_ARRAY_SHADOW) + #define SAMPLE_TEXTURECUBE_SHADOW(textureName, samplerName, coord4) SHADOWCUBE_SAMPLE(textureName, samplerName, coord4) + #define SAMPLE_TEXTURECUBE_ARRAY_SHADOW(textureName, samplerName, coord4, index) ERROR_ON_UNSUPPORTED_FUNCTION(SAMPLE_TEXTURECUBE_ARRAY_SHADOW) + + + // Not supported. Can't define as error because shader library is calling these functions. + #define LOAD_TEXTURE2D(textureName, unCoord2) half4(0, 0, 0, 0) + #define LOAD_TEXTURE2D_LOD(textureName, unCoord2, lod) half4(0, 0, 0, 0) + #define LOAD_TEXTURE2D_MSAA(textureName, unCoord2, sampleIndex) half4(0, 0, 0, 0) + #define LOAD_TEXTURE2D_ARRAY(textureName, unCoord2, index) half4(0, 0, 0, 0) + #define LOAD_TEXTURE2D_ARRAY_MSAA(textureName, unCoord2, index, sampleIndex) half4(0, 0, 0, 0) + #define LOAD_TEXTURE2D_ARRAY_LOD(textureName, unCoord2, index, lod) half4(0, 0, 0, 0) + #define LOAD_TEXTURE3D(textureName, unCoord3) ERROR_ON_UNSUPPORTED_FUNCTION(LOAD_TEXTURE3D) + #define LOAD_TEXTURE3D_LOD(textureName, unCoord3, lod) ERROR_ON_UNSUPPORTED_FUNCTION(LOAD_TEXTURE3D_LOD) + + // Gather not supported. Fallback to regular texture sampling. + #define GATHER_TEXTURE2D(textureName, samplerName, coord2) ERROR_ON_UNSUPPORTED_FUNCTION(GATHER_TEXTURE2D) + #define GATHER_TEXTURE2D_ARRAY(textureName, samplerName, coord2, index) ERROR_ON_UNSUPPORTED_FUNCTION(GATHER_TEXTURE2D_ARRAY) + #define GATHER_TEXTURECUBE(textureName, samplerName, coord3) ERROR_ON_UNSUPPORTED_FUNCTION(GATHER_TEXTURECUBE) + #define GATHER_TEXTURECUBE_ARRAY(textureName, samplerName, coord3, index) ERROR_ON_UNSUPPORTED_FUNCTION(GATHER_TEXTURECUBE_ARRAY) + #define GATHER_RED_TEXTURE2D(textureName, samplerName, coord2) ERROR_ON_UNSUPPORTED_FUNCTION(GATHER_RED_TEXTURE2D) + #define GATHER_GREEN_TEXTURE2D(textureName, samplerName, coord2) ERROR_ON_UNSUPPORTED_FUNCTION(GATHER_GREEN_TEXTURE2D) + #define GATHER_BLUE_TEXTURE2D(textureName, samplerName, coord2) ERROR_ON_UNSUPPORTED_FUNCTION(GATHER_BLUE_TEXTURE2D) + #define GATHER_ALPHA_TEXTURE2D(textureName, samplerName, coord2) ERROR_ON_UNSUPPORTED_FUNCTION(GATHER_ALPHA_TEXTURE2D) + +#else +#error unsupported shader api +#endif + + + + +// default flow control attributes +#ifndef UNITY_BRANCH +# define UNITY_BRANCH +#endif +#ifndef UNITY_FLATTEN +# define UNITY_FLATTEN +#endif +#ifndef UNITY_UNROLL +# define UNITY_UNROLL +#endif +#ifndef UNITY_UNROLLX +# define UNITY_UNROLLX(_x) +#endif +#ifndef UNITY_LOOP +# define UNITY_LOOP +#endif + + + +#define _USINGTEXCOORD1 1 +#define _USINGTEXCOORD2 1 + + + // data across stages, stripped like the above. + struct VertexToPixel + { + UNITY_POSITION(pos); + float3 worldPos : TEXCOORD0; + float3 worldNormal : TEXCOORD1; + float4 worldTangent : TEXCOORD2; + float4 texcoord0 : TEXCOORD3; + float4 texcoord1 : TEXCOORD4; + float4 texcoord2 : TEXCOORD5; + // #if %TEXCOORD3REQUIREKEY% + float4 texcoord3 : TEXCOORD6; + // #endif + + // #if %SCREENPOSREQUIREKEY% + // float4 screenPos : TEXCOORD7; + // #endif + + float4 lmap : TEXCOORD8; + #if UNITY_SHOULD_SAMPLE_SH + half3 sh : TEXCOORD9; // SH + #endif + #ifdef LIGHTMAP_ON + UNITY_LIGHTING_COORDS(10,11) + UNITY_FOG_COORDS(12) + #else + UNITY_FOG_COORDS(10) + UNITY_SHADOW_COORDS(11) + #endif + + // #if %VERTEXCOLORREQUIREKEY% + float4 vertexColor : COLOR; + // #endif + + // #if %EXTRAV2F0REQUIREKEY% + // float4 extraV2F0 : TEXCOORD13; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // float4 extraV2F1 : TEXCOORD14; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // float4 extraV2F2 : TEXCOORD15; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // float4 extraV2F3 : TEXCOORD16; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // float4 extraV2F4 : TEXCOORD17; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // float4 extraV2F5 : TEXCOORD18; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // float4 extraV2F6 : TEXCOORD19; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // float4 extraV2F7 : TEXCOORD20; + // #endif + + + UNITY_VERTEX_INPUT_INSTANCE_ID + UNITY_VERTEX_OUTPUT_STEREO + }; + + + + // data describing the user output of a pixel + struct Surface + { + half3 Albedo; + half Height; + half3 Normal; + half Smoothness; + half3 Emission; + half Metallic; + half3 Specular; + half Occlusion; + half SpecularPower; // for simple lighting + half Alpha; + float outputDepth; // if written, SV_Depth semantic is used. ShaderData.clipPos.z is unused value + // HDRP Only + half SpecularOcclusion; + half SubsurfaceMask; + half Thickness; + half CoatMask; + half CoatSmoothness; + half Anisotropy; + half IridescenceMask; + half IridescenceThickness; + int DiffusionProfileHash; + float SpecularAAThreshold; + float SpecularAAScreenSpaceVariance; + // requires _OVERRIDE_BAKEDGI to be defined, but is mapped in all pipelines + float3 DiffuseGI; + float3 BackDiffuseGI; + float3 SpecularGI; + float ior; + float3 transmittanceColor; + float atDistance; + float transmittanceMask; + // requires _OVERRIDE_SHADOWMASK to be defines + float4 ShadowMask; + + // for decals + float NormalAlpha; + float MAOSAlpha; + + + }; + + // Data the user declares in blackboard blocks + struct Blackboard + { + + float blackboardDummyData; + }; + + // data the user might need, this will grow to be big. But easy to strip + struct ShaderData + { + float4 clipPos; // SV_POSITION + float3 localSpacePosition; + float3 localSpaceNormal; + float3 localSpaceTangent; + + float3 worldSpacePosition; + float3 worldSpaceNormal; + float3 worldSpaceTangent; + float tangentSign; + + float3 worldSpaceViewDir; + float3 tangentSpaceViewDir; + + float4 texcoord0; + float4 texcoord1; + float4 texcoord2; + float4 texcoord3; + + float2 screenUV; + float4 screenPos; + + float4 vertexColor; + bool isFrontFace; + + float4 extraV2F0; + float4 extraV2F1; + float4 extraV2F2; + float4 extraV2F3; + float4 extraV2F4; + float4 extraV2F5; + float4 extraV2F6; + float4 extraV2F7; + + float3x3 TBNMatrix; + Blackboard blackboard; + }; + + struct VertexData + { + #if SHADER_TARGET > 30 + // uint vertexID : SV_VertexID; + #endif + float4 vertex : POSITION; + float3 normal : NORMAL; + float4 tangent : TANGENT; + float4 texcoord0 : TEXCOORD0; + + // optimize out mesh coords when not in use by user or lighting system + #if _URP && (_USINGTEXCOORD1 || _PASSMETA || _PASSFORWARD || _PASSGBUFFER) + float4 texcoord1 : TEXCOORD1; + #endif + + #if _URP && (_USINGTEXCOORD2 || _PASSMETA || ((_PASSFORWARD || _PASSGBUFFER) && defined(DYNAMICLIGHTMAP_ON))) + float4 texcoord2 : TEXCOORD2; + #endif + + #if _STANDARD && (_USINGTEXCOORD1 || (_PASSMETA || ((_PASSFORWARD || _PASSGBUFFER || _PASSFORWARDADD) && LIGHTMAP_ON))) + float4 texcoord1 : TEXCOORD1; + #endif + #if _STANDARD && (_USINGTEXCOORD2 || (_PASSMETA || ((_PASSFORWARD || _PASSGBUFFER) && DYNAMICLIGHTMAP_ON))) + float4 texcoord2 : TEXCOORD2; + #endif + + + #if _HDRP + float4 texcoord1 : TEXCOORD1; + float4 texcoord2 : TEXCOORD2; + #endif + + // #if %TEXCOORD3REQUIREKEY% + float4 texcoord3 : TEXCOORD3; + // #endif + + // #if %VERTEXCOLORREQUIREKEY% + float4 vertexColor : COLOR; + // #endif + + #if _PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR)) + float3 previousPositionOS : TEXCOORD4; // Contain previous transform position (in case of skinning for example) + #if defined (_ADD_PRECOMPUTED_VELOCITY) + float3 precomputedVelocity : TEXCOORD5; // Add Precomputed Velocity (Alembic computes velocities on runtime side). + #endif + #endif + + UNITY_VERTEX_INPUT_INSTANCE_ID + }; + + struct TessVertex + { + float4 vertex : INTERNALTESSPOS; + float3 normal : NORMAL; + float4 tangent : TANGENT; + float4 texcoord0 : TEXCOORD0; + float4 texcoord1 : TEXCOORD1; + float4 texcoord2 : TEXCOORD2; + + // #if %TEXCOORD3REQUIREKEY% + float4 texcoord3 : TEXCOORD3; + // #endif + + // #if %VERTEXCOLORREQUIREKEY% + float4 vertexColor : COLOR; + // #endif + + // #if %EXTRAV2F0REQUIREKEY% + // float4 extraV2F0 : TEXCOORD5; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // float4 extraV2F1 : TEXCOORD6; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // float4 extraV2F2 : TEXCOORD7; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // float4 extraV2F3 : TEXCOORD8; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // float4 extraV2F4 : TEXCOORD9; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // float4 extraV2F5 : TEXCOORD10; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // float4 extraV2F6 : TEXCOORD11; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // float4 extraV2F7 : TEXCOORD12; + // #endif + + #if _PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR)) + float3 previousPositionOS : TEXCOORD13; // Contain previous transform position (in case of skinning for example) + #if defined (_ADD_PRECOMPUTED_VELOCITY) + float3 precomputedVelocity : TEXCOORD14; + #endif + #endif + + UNITY_VERTEX_INPUT_INSTANCE_ID + UNITY_VERTEX_OUTPUT_STEREO + }; + + struct ExtraV2F + { + float4 extraV2F0; + float4 extraV2F1; + float4 extraV2F2; + float4 extraV2F3; + float4 extraV2F4; + float4 extraV2F5; + float4 extraV2F6; + float4 extraV2F7; + Blackboard blackboard; + float4 time; + }; + + + float3 WorldToTangentSpace(ShaderData d, float3 normal) + { + return mul(d.TBNMatrix, normal); + } + + float3 TangentToWorldSpace(ShaderData d, float3 normal) + { + return mul(normal, d.TBNMatrix); + } + + // in this case, make standard more like SRPs, because we can't fix + // unity_WorldToObject in HDRP, since it already does macro-fu there + + #if _STANDARD + float3 TransformWorldToObject(float3 p) { return mul(unity_WorldToObject, float4(p, 1)); }; + float3 TransformObjectToWorld(float3 p) { return mul(unity_ObjectToWorld, float4(p, 1)); }; + float4 TransformWorldToObject(float4 p) { return mul(unity_WorldToObject, p); }; + float4 TransformObjectToWorld(float4 p) { return mul(unity_ObjectToWorld, p); }; + float4x4 GetWorldToObjectMatrix() { return unity_WorldToObject; } + float4x4 GetObjectToWorldMatrix() { return unity_ObjectToWorld; } + #if (defined(SHADER_API_D3D11) || defined(SHADER_API_XBOXONE) || defined(UNITY_COMPILER_HLSLCC) || defined(SHADER_API_PSSL) || (SHADER_TARGET_SURFACE_ANALYSIS && !SHADER_TARGET_SURFACE_ANALYSIS_MOJOSHADER)) + #define UNITY_SAMPLE_TEX2D_LOD(tex,coord, lod) tex.SampleLevel (sampler##tex,coord, lod) + #define UNITY_SAMPLE_TEX2D_SAMPLER_LOD(tex,samplertex,coord, lod) tex.SampleLevel (sampler##samplertex,coord, lod) + #else + #define UNITY_SAMPLE_TEX2D_LOD(tex,coord,lod) tex2D (tex,coord,0,lod) + #define UNITY_SAMPLE_TEX2D_SAMPLER_LOD(tex,samplertex,coord,lod) tex2D (tex,coord,0,lod) + #endif + + #undef UNITY_MATRIX_I_M + + #define UNITY_MATRIX_I_M unity_WorldToObject + + + #endif + + float3 GetCameraWorldPosition() + { + #if _HDRP + return GetCameraRelativePositionWS(_WorldSpaceCameraPos); + #else + return _WorldSpaceCameraPos; + #endif + } + + #if _GRABPASSUSED + #if _STANDARD + TEXTURE2D(%GRABTEXTURE%); + SAMPLER(sampler_%GRABTEXTURE%); + #endif + + half3 GetSceneColor(float2 uv) + { + #if _STANDARD + return SAMPLE_TEXTURE2D(%GRABTEXTURE%, sampler_%GRABTEXTURE%, uv).rgb; + #else + return SHADERGRAPH_SAMPLE_SCENE_COLOR(uv); + #endif + } + #endif + + + + #if _STANDARD + UNITY_DECLARE_DEPTH_TEXTURE(_CameraDepthTexture); + float GetSceneDepth(float2 uv) { return SAMPLE_DEPTH_TEXTURE(_CameraDepthTexture, uv); } + float GetLinear01Depth(float2 uv) { return Linear01Depth(GetSceneDepth(uv)); } + float GetLinearEyeDepth(float2 uv) { return LinearEyeDepth(GetSceneDepth(uv)); } + #else + float GetSceneDepth(float2 uv) { return SHADERGRAPH_SAMPLE_SCENE_DEPTH(uv); } + float GetLinear01Depth(float2 uv) { return Linear01Depth(GetSceneDepth(uv), _ZBufferParams); } + float GetLinearEyeDepth(float2 uv) { return LinearEyeDepth(GetSceneDepth(uv), _ZBufferParams); } + #endif + + float3 GetWorldPositionFromDepthBuffer(float2 uv, float3 worldSpaceViewDir) + { + float eye = GetLinearEyeDepth(uv); + float3 camView = mul((float3x3)UNITY_MATRIX_M, transpose(mul(UNITY_MATRIX_I_M, UNITY_MATRIX_I_V)) [2].xyz); + + float dt = dot(worldSpaceViewDir, camView); + float3 div = worldSpaceViewDir/dt; + float3 wpos = (eye * div) + GetCameraWorldPosition(); + return wpos; + } + + #if _HDRP + float3 ObjectToWorldSpacePosition(float3 pos) + { + return GetAbsolutePositionWS(TransformObjectToWorld(pos)); + } + #else + float3 ObjectToWorldSpacePosition(float3 pos) + { + return TransformObjectToWorld(pos); + } + #endif + + #if _STANDARD + UNITY_DECLARE_SCREENSPACE_TEXTURE(_CameraDepthNormalsTexture); + float3 GetSceneNormal(float2 uv, float3 worldSpaceViewDir) + { + float4 depthNorms = UNITY_SAMPLE_SCREENSPACE_TEXTURE(_CameraDepthNormalsTexture, uv); + float3 norms = DecodeViewNormalStereo(depthNorms); + norms = mul((float3x3)UNITY_MATRIX_V, norms) * 0.5 + 0.5; + return norms; + } + #elif _HDRP && !_DECALSHADER + + float3 GetSceneNormal(float2 uv, float3 worldSpaceViewDir) + { + NormalData nd; + DecodeFromNormalBuffer(_ScreenSize.xy * uv, nd); + return nd.normalWS; + } + #elif _URP + #if (SHADER_LIBRARY_VERSION_MAJOR >= 10) + #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/DeclareNormalsTexture.hlsl" + #endif + + float3 GetSceneNormal(float2 uv, float3 worldSpaceViewDir) + { + #if (SHADER_LIBRARY_VERSION_MAJOR >= 10) + return SampleSceneNormals(uv); + #else + float3 wpos = GetWorldPositionFromDepthBuffer(uv, worldSpaceViewDir); + return normalize(-cross(ddx(wpos), ddy(wpos))) * 0.5 + 0.5; + #endif + + } + #endif + + #if _HDRP + + half3 UnpackNormalmapRGorAG(half4 packednormal) + { + // This do the trick + packednormal.x *= packednormal.w; + + half3 normal; + normal.xy = packednormal.xy * 2 - 1; + normal.z = sqrt(1 - saturate(dot(normal.xy, normal.xy))); + return normal; + } + half3 UnpackNormal(half4 packednormal) + { + #if defined(UNITY_NO_DXT5nm) + return packednormal.xyz * 2 - 1; + #else + return UnpackNormalmapRGorAG(packednormal); + #endif + } + #endif + #if _HDRP || _URP + + half3 UnpackScaleNormal(half4 packednormal, half scale) + { + #ifndef UNITY_NO_DXT5nm + // Unpack normal as DXT5nm (1, y, 1, x) or BC5 (x, y, 0, 1) + // Note neutral texture like "bump" is (0, 0, 1, 1) to work with both plain RGB normal and DXT5nm/BC5 + packednormal.x *= packednormal.w; + #endif + half3 normal; + normal.xy = (packednormal.xy * 2 - 1) * scale; + normal.z = sqrt(1 - saturate(dot(normal.xy, normal.xy))); + return normal; + } + + #endif + + + void GetSun(out float3 lightDir, out float3 color) + { + lightDir = float3(0.5, 0.5, 0); + color = 1; + #if _HDRP + if (_DirectionalLightCount > 0) + { + DirectionalLightData light = _DirectionalLightDatas[0]; + lightDir = -light.forward.xyz; + color = light.color; + } + #elif _STANDARD + lightDir = normalize(_WorldSpaceLightPos0.xyz); + color = _LightColor0.rgb; + #elif _URP + Light light = GetMainLight(); + lightDir = light.direction; + color = light.color; + #endif + } + + + + + half4 _Color; + half4 _MainTex_ST, _MainTex_TexelSize; + half _Alpha, _AlphaCutoffValue; + + #if ATLAS_ON + half _MinXUV, _MaxXUV, _MinYUV, _MaxYUV; + #endif + + #if GLOW_ON + half4 _GlowColor; + half _Glow, _GlowGlobal; + #endif + + #if HSV_ON + half _HsvShift, _HsvSaturation, _HsvBright; + #endif + + #if DISTORT_ON + half4 _DistortTex_ST; + half _DistortTexXSpeed, _DistortTexYSpeed, _DistortAmount; + #endif + + #if FADE_ON + half4 _FadeBurnColor, _FadeTex_ST, _FadeBurnTex_ST; + half _FadeAmount, _FadeBurnWidth, _FadeBurnTransition,_FadeBurnGlow; + #endif + + #if OUTBASE_ON + half4 _OutlineColor; + half _OutlineAlpha, _OutlineGlow, _OutlineWidth; + int _OutlinePixelWidth; + #endif + + #if OUTTEX_ON + half4 _OutlineTex_ST; + half _OutlineTexXSpeed, _OutlineTexYSpeed; + #endif + + #if OUTDIST_ON + half4 _OutlineDistortTex_ST; + half _OutlineDistortTexXSpeed, _OutlineDistortTexYSpeed, _OutlineDistortAmount; + #endif + + #if ALPHAOUTLINE_ON + half _AlphaOutlineGlow, _AlphaOutlinePower, _AlphaOutlineMinAlpha, _AlphaOutlineBlend; + half4 _AlphaOutlineColor; + #endif + + #if INNEROUTLINE_ON + half _InnerOutlineThickness, _InnerOutlineAlpha, _InnerOutlineGlow; + half4 _InnerOutlineColor; + #endif + + #if GRADIENT_ON + half _GradBlend, _GradBoostX, _GradBoostY; + half4 _GradTopRightCol, _GradTopLeftCol, _GradBotRightCol, _GradBotLeftCol; + #endif + + #if COLORSWAP_ON + half4 _ColorSwapRed, _ColorSwapGreen, _ColorSwapBlue; + half _ColorSwapRedLuminosity, _ColorSwapGreenLuminosity, _ColorSwapBlueLuminosity, _ColorSwapBlend; + #endif + + #if CHANGECOLOR_ON + half4 _ColorChangeNewCol, _ColorChangeTarget; + half _ColorChangeTolerance, _ColorChangeLuminosity; + #endif + #if CHANGECOLOR2_ON + half4 _ColorChangeNewCol2, _ColorChangeTarget2; + half _ColorChangeTolerance2; + #endif + #if CHANGECOLOR3_ON + half4 _ColorChangeNewCol3, _ColorChangeTarget3; + half _ColorChangeTolerance3; + #endif + + #if COLORRAMP_ON + half _ColorRampLuminosity, _ColorRampBlend; + #endif + + #if HITEFFECT_ON + half4 _HitEffectColor; + half _HitEffectGlow, _HitEffectBlend; + #endif + + #if NEGATIVE_ON + half _NegativeAmount; + #endif + + #if PIXELATE_ON + half _PixelateSize; + #endif + + #if GREYSCALE_ON + half _GreyscaleLuminosity, _GreyscaleBlend; + half4 _GreyscaleTintColor; + #endif + + #if POSTERIZE_ON + half _PosterizeNumColors, _PosterizeGamma; + #endif + + #if BLUR_ON + half _BlurIntensity; + #endif + + #if MOTIONBLUR_ON + half _MotionBlurAngle, _MotionBlurDist; + #endif + + #if GHOST_ON + half _GhostColorBoost, _GhostTransparency, _GhostBlend; + #endif + + #if HOLOGRAM_ON + half _HologramStripesAmount, _HologramMinAlpha, _HologramUnmodAmount, _HologramStripesSpeed, _HologramMaxAlpha, _HologramBlend; + half4 _HologramStripeColor; + #endif + + #if CHROMABERR_ON + half _ChromAberrAmount, _ChromAberrAlpha; + #endif + + #if GLITCH_ON + half _GlitchAmount, _GlitchSize; + #endif + + #if FLICKER_ON + half _FlickerFreq, _FlickerPercent, _FlickerAlpha; + #endif + + #if SHADOW_ON + half _ShadowX, _ShadowY, _ShadowAlpha; + half4 _ShadowColor; + #endif + + #if SHINE_ON + half4 _ShineColor; + half _ShineLocation, _ShineRotate, _ShineWidth, _ShineGlow; + #endif + + #if CONTRAST_ON + half _Contrast, _Brightness; + #endif + + #if OVERLAY_ON + half4 _OverlayTex_ST, _OverlayColor; + half _OverlayGlow, _OverlayBlend, _OverlayTextureScrollXSpeed, _OverlayTextureScrollYSpeed; + #endif + + #if DOODLE_ON + half _HandDrawnAmount, _HandDrawnSpeed; + #endif + + #if WIND_ON + half _GrassSpeed, _GrassWind, _GrassManualAnim, _GrassRadialBend; + #endif + + #if WAVEUV_ON + float _WaveAmount, _WaveSpeed, _WaveStrength, _WaveX, _WaveY; + #endif + + #if ROUNDWAVEUV_ON + half _RoundWaveStrength, _RoundWaveSpeed; + #endif + + #if RECTSIZE_ON + half _RectSize; + #endif + + #if OFFSETUV_ON + half _OffsetUvX, _OffsetUvY; + #endif + + #if CLIPPING_ON + half _ClipUvLeft, _ClipUvRight, _ClipUvUp, _ClipUvDown; + #endif + + #if RADIALCLIPPING_ON + half _RadialStartAngle, _RadialClip, _RadialClip2; + #endif + + #if TEXTURESCROLL_ON + half _TextureScrollXSpeed, _TextureScrollYSpeed; + #endif + + #if ZOOMUV_ON + half _ZoomUvAmount; + #endif + + #if WARP_ON + half _WarpStrength, _WarpSpeed, _WarpScale; + #endif + + #if TWISTUV_ON + half _TwistUvAmount, _TwistUvPosX, _TwistUvPosY, _TwistUvRadius; + #endif + + #if ROTATEUV_ON + half _RotateUvAmount; + #endif + + #if FISHEYE_ON + half _FishEyeUvAmount; + #endif + + #if PINCH_ON + half _PinchUvAmount; + #endif + + #if SHAKEUV_ON + half _ShakeUvSpeed, _ShakeUvX, _ShakeUvY; + #endif + + #if NORMALMAP_ON + half _NormalStrength; + #endif + + float _RandomSeed; + + + + + + + + + + + TEXTURE2D(_MainTex); + SAMPLER(sampler_MainTex); + + #if GLOW_ON + TEXTURE2D(_GlowTex); + SAMPLER(sampler_GlowTex); + #endif + + #if FADE_ON + TEXTURE2D(_FadeTex); + SAMPLER(sampler_FadeTex); + + TEXTURE2D(_FadeBurnTex); + SAMPLER(sampler_FadeBurnTex); + #endif + + #if DISTORT_ON + TEXTURE2D(_DistortTex); + SAMPLER(sampler_DistortTex); + #endif + + #if OUTTEX_ON + TEXTURE2D(_OutlineTex); + SAMPLER(sampler_OutlineTex); + #endif + + #if OUTDIST_ON + TEXTURE2D(_OutlineDistortTex); + SAMPLER(sampler_OutlineDistortTex); + #endif + + #if COLORSWAP_ON + TEXTURE2D(_ColorSwapTex); + SAMPLER(sampler_ColorSwapTex); + #endif + + #if COLORRAMP_ON + TEXTURE2D(_ColorRampTex); + TEXTURE2D(_ColorRampTexGradient); + SAMPLER(sampler_ColorRampTex); + SAMPLER(sampler_ColorRampTexGradient); + #endif + + #if SHINE_ON + TEXTURE2D(_ShineMask); + SAMPLER(sampler_ShineMask); + #endif + + #if OVERLAY_ON + TEXTURE2D(_OverlayTex); + SAMPLER(sampler_OverlayTex); + #endif + + #if NORMALMAP_ON + TEXTURE2D(_NormalMap); + SAMPLER(sampler_NormalMap); + #endif + + + half3 GetPixel(in int offsetX, in int offsetY, in half2 uv, in Texture2D _tex, in SamplerState _sampler) + { + half2 _uv = uv + half2(offsetX * _MainTex_TexelSize.x, offsetY * _MainTex_TexelSize.y); + half4 col = SAMPLE_TEXTURE2D(_tex, _sampler, _uv); + return col.rgb; + } + + + //BLURS------------------------------------------------------------------------- + half4 Blur(half2 uv, Texture2D source, SamplerState sampler_source, half Intensity) + { + const half2 texelSize = 1.0 / _ScreenParams.xy; + const half4 color = SAMPLE_TEXTURE2D(source, sampler_source, uv); + const half2 offset = Intensity * texelSize; + + half4 accumulatedColor = color; + half accumulatedWeight = 1.0; + for (int x = -1; x <= 1; x++) + { + for (int y = -1; y <= 1; y++) + { + const half2 sampleUV = uv + half2(x, y) * offset; + const half4 sampleColor = SAMPLE_TEXTURE2D(source, sampler_source, sampleUV); + + accumulatedColor += sampleColor; + accumulatedWeight += 1.0; + } + } + + half4 blurredColor = accumulatedColor / accumulatedWeight; + return blurredColor; + } + + half BlurHD_G(half bhqp, half x) + { + return exp(-(x * x) / (2.0 * bhqp * bhqp)); + } + half4 BlurHD(half2 uv, Texture2D source, SamplerState sampler_source, half BlurAmount, half xScale, half yScale) + { + int iterations = 16; + int halfIterations = iterations / 2; + half sigmaX = 0.1 + BlurAmount * 0.5; + half sigmaY = sigmaX; + half total = 0.0; + half4 ret = half4(0, 0, 0, 0); + for (int iy = 0; iy < iterations; ++iy) + { + half fy = BlurHD_G(sigmaY, half(iy) -half(halfIterations)); + half offsetY = half(iy - halfIterations) * 0.00390625 * xScale; + for (int ix = 0; ix < iterations; ++ix) + { + half fx = BlurHD_G(sigmaX, half(ix) - half(halfIterations)); + half offsetX = half(ix - halfIterations) * 0.00390625 * yScale; + total += fx * fy; + ret += SAMPLE_TEXTURE2D(source, sampler_source, uv + half2(offsetX, offsetY)) * fx * fy; + } + } + return ret / total; + } + //----------------------------------------------------------------------- + + + //------------------------------------------- + half RemapFloat(half inValue, half inMin, half inMax, half outMin, half outMax){ + return outMin + (inValue - inMin) * (outMax - outMin) / (inMax - inMin); + } + //------------------------------------------- + + //----------------------------------------------------------------------- + half rand(half2 seed, half offset) { + return (frac(sin(dot(seed, half2(12.9898, 78.233))) * 43758.5453) + offset) % 1.0; + } + + half rand2(half2 seed, half offset) { + return (frac(sin(dot(seed * floor(50 + (_Time.x % 1.0) * 12.), half2(127.1, 311.7))) * 43758.5453123) + offset) % 1.0; + } + + half rand2CustomTime(half2 seed, half offset, half customTime) { + return (frac(sin(dot(seed * floor(50 + (customTime % 1.0) * 12.), half2(127.1, 311.7))) * 43758.5453123) + offset) % 1.0; + } + //----------------------------------------------------------------------- + + + void Ext_ModifyVertex0 (inout VertexData v, inout ExtraV2F d) + { + //BILBOARD_ON + #if BILBOARD_ON + half3 camRight = mul((half3x3)unity_CameraToWorld, half3(1,0,0)); + half3 camUp = half3(0,1,0); + #if BILBOARDY_ON + camUp = mul((half3x3)unity_CameraToWorld, half3(0,1,0)); + #endif + half3 localPos = v.vertex.x * camRight + v.vertex.y * camUp; + v.vertex = half4(localPos, 1); + #endif + //----------------------------------------------------------- + + v.texcoord0.xy = TRANSFORM_TEX(v.texcoord0.xy, _MainTex); + half2 center = half2(0.5, 0.5); + #if ATLAS_ON + center = half2((_MaxXUV + _MinXUV) / 2.0, (_MaxYUV + _MinYUV) / 2.0); + #endif + + //POLARUV_ON + #if POLARUV_ON + v.texcoord0.xy = v.texcoord0.xy - center; + #endif + + //---------------------------------------- + + //ROTATEUV_ON + #if ROTATEUV_ON + half2 uvC = v.texcoord0.xy; + half cosAngle = cos(_RotateUvAmount); + half sinAngle = sin(_RotateUvAmount); + half2x2 rot = half2x2(cosAngle, -sinAngle, sinAngle, cosAngle); + uvC -= center; + v.texcoord0.xy = mul(rot, uvC); + v.texcoord0.xy += center; + #endif + //-------------------- + + #if RECTSIZE_ON + v.vertex.xyz += (v.vertex.xyz * (_RectSize - 1.0)); + #endif + + #if OUTTEX_ON + v.texcoord1.xy = TRANSFORM_TEX(v.texcoord0.xy, _OutlineTex); + #endif + + #if OUTDIST_ON + v.texcoord2.xy = TRANSFORM_TEX(v.texcoord0.xy, _OutlineDistortTex); + #endif + + #if DISTORT_ON + v.texcoord3.xy = TRANSFORM_TEX(v.texcoord0.xy, _DistortTex); + #endif + } + + void Ext_SurfaceFunction0 (inout Surface o, ShaderData d) + { + half randomSeed = _RandomSeed; + + float2 uvRect = d.texcoord0; + half2 center = half2(0.5, 0.5); + #if ATLAS_ON + center = half2((_MaxXUV + _MinXUV) / 2.0, (_MaxYUV + _MinYUV) / 2.0); + uvRect = half2((d.texcoord0.x - _MinXUV) / (_MaxXUV - _MinXUV), (d.texcoord0.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half2 centerTiled = half2(center.x * _MainTex_ST.x, center.y * _MainTex_ST.y); + + //CLIPPING_ON + #if CLIPPING_ON + half2 tiledUv = half2(d.texcoord0.x / _MainTex_ST.x, d.texcoord0.y / _MainTex_ST.y); + #if ATLAS_ON + tiledUv = half2((tiledUv.x - _MinXUV) / (_MaxXUV - _MinXUV), (tiledUv.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + clip((1 - _ClipUvUp) - tiledUv.y); + clip(tiledUv.y - _ClipUvDown); + clip((1 - _ClipUvRight) - tiledUv.x); + clip(tiledUv.x - _ClipUvLeft); + #endif + //---------------------------------- + + //RADIALCLIPPING_ON + #if RADIALCLIPPING_ON + half2 tiledUv2 = half2(d.texcoord0.x / _MainTex_ST.x, d.texcoord0.y / _MainTex_ST.y); + #if ATLAS_ON + tiledUv2 = half2((tiledUv2.x - _MinXUV) / (_MaxXUV - _MinXUV), (tiledUv2.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half startAngle = _RadialStartAngle - _RadialClip; + half endAngle = _RadialStartAngle + _RadialClip2; + half offset0 = clamp(0, 360, startAngle + 360); + half offset360 = clamp(0, 360, endAngle - 360); + half2 atan2Coord = half2(lerp(-1, 1, tiledUv2.x), lerp(-1, 1, tiledUv2.y)); + half atanAngle = atan2(atan2Coord.y, atan2Coord.x) * 57.3; // angle in degrees + if(atanAngle < 0) atanAngle = 360 + atanAngle; + if(atanAngle >= startAngle && atanAngle <= endAngle) discard; + if(atanAngle <= offset360) discard; + if(atanAngle >= offset0) discard; + #endif + + //----------------------------- + + //TEXTURESCROLL_ON && ATLAS_ON + #if TEXTURESCROLL_ON && ATLAS_ON + d.texcoord0.xy = half2(_MinXUV + ((_MaxXUV - _MinXUV) * (abs(((_Time.y + randomSeed) * _TextureScrollXSpeed) + uvRect.x) % 1)), + _MinYUV + ((_MaxYUV - _MinYUV) * (abs(((_Time.y + randomSeed) * _TextureScrollYSpeed) + uvRect.y) % 1))); + #endif + //---------------------------- + + //OFFSETUV_ON + #if OFFSETUV_ON + #if ATLAS_ON + d.texcoord0.xy = half2(_MinXUV + ((_MaxXUV - _MinXUV) * (abs((_OffsetUvX + uvRect.x) % 1))), + _MinYUV + ((_MaxYUV - _MinYUV) * (abs(_OffsetUvY + uvRect.y) % 1))); + #else + d.texcoord0.xy += half2(_OffsetUvX, _OffsetUvY); + #endif + #endif + + //---------------------- + + //POLARUV_ON + #if POLARUV_ON + d.texcoord0.xy = half2(atan2(d.texcoord0.y, d.texcoord0.x) / (2.0f * 3.141592653589f), length(d.texcoord0.xy)); + d.texcoord0.xy *= _MainTex_ST.xy; + #endif + + //-------------------------------------- + + //TWISTUV_ON + #if TWISTUV_ON + #if ATLAS_ON + _TwistUvPosX = ((_MaxXUV - _MinXUV) * _TwistUvPosX) + _MinXUV; + _TwistUvPosY = ((_MaxYUV - _MinYUV) * _TwistUvPosY) + _MinYUV; + #endif + half2 tempUv = d.texcoord0.xy - half2(_TwistUvPosX * _MainTex_ST.x, _TwistUvPosY * _MainTex_ST.y); + _TwistUvRadius *= (_MainTex_ST.x + _MainTex_ST.y) / 2; + half percent = (_TwistUvRadius - length(tempUv)) / _TwistUvRadius; + half theta = percent * percent * (2.0 * sin(_TwistUvAmount)) * 8.0; + half s = sin(theta); + half c = cos(theta); + half beta = max(sign(_TwistUvRadius - length(tempUv)), 0.0); + tempUv = half2(dot(tempUv, half2(c, -s)), dot(tempUv, half2(s, c))) * beta + tempUv * (1 - beta); + tempUv += half2(_TwistUvPosX * _MainTex_ST.x, _TwistUvPosY * _MainTex_ST.y); + d.texcoord0.xy = tempUv; + #endif + + //-------------------------------------------- + + //FISHEYE_ON + #if FISHEYE_ON + half bind = length(centerTiled); + half2 dF = d.texcoord0.xy - centerTiled; + half dFlen = length(dF); + half fishInt = (3.14159265359 / bind) * (_FishEyeUvAmount + 0.001); + d.texcoord0.xy = centerTiled + (dF / (max(0.0001, dFlen))) * tan(dFlen * fishInt) * bind / tan(bind * fishInt); + #endif + //--------------------------------------------- + + //PINCH_ON + #if PINCH_ON + half2 dP = d.texcoord0.xy - centerTiled; + half pinchInt = (3.141592 / length(centerTiled)) * (-_PinchUvAmount + 0.001); + d.texcoord0.xy = centerTiled + normalize(dP) * atan(length(dP) * -pinchInt * 10.0) * 0.5 / atan(-pinchInt * 5); + #endif + + //--------------------------------------------- + + //ZOOMUV_ON + #if ZOOMUV_ON + d.texcoord0.xy -= centerTiled; + d.texcoord0.xy = d.texcoord0.xy * _ZoomUvAmount; + d.texcoord0.xy += centerTiled; + #endif + + //----------------------------------------------- + + //DOODLE_ON + #if DOODLE_ON + half2 uvCopy = uvRect; + _HandDrawnSpeed = (floor((_Time.x + randomSeed) * 20 * _HandDrawnSpeed) / _HandDrawnSpeed) * _HandDrawnSpeed; + uvCopy.x = sin((uvCopy.x * _HandDrawnAmount + _HandDrawnSpeed) * 4); + uvCopy.y = cos((uvCopy.y * _HandDrawnAmount + _HandDrawnSpeed) * 4); + d.texcoord0.xy = lerp(d.texcoord0.xy, d.texcoord0.xy + uvCopy, 0.0005 * _HandDrawnAmount); + #endif + + //-------------------------- + + //SHAKEUV_ON + #if SHAKEUV_ON + half xShake = sin((_Time.x + randomSeed) * _ShakeUvSpeed * 50) * _ShakeUvX; + half yShake = cos((_Time.x + randomSeed) * _ShakeUvSpeed * 50) * _ShakeUvY; + d.texcoord0.xy += half2(xShake * 0.012, yShake * 0.01); + #endif + + //------------------------------------------- + + //RECTSIZE_ON + #if RECTSIZE_ON + d.texcoord0.xy = d.texcoord0.xy * (_RectSize).xx + (((-_RectSize * 0.5) + 0.5)).xx; + #endif + + //------------------------------------------- + + //DISTORT_ON + #if DISTORT_ON + #if ATLAS_ON + d.texcoord3.x = d.texcoord3.x * (1 / (_MaxXUV - _MinXUV)); + d.texcoord3.y = d.texcoord3.y * (1 / (_MaxYUV - _MinYUV)); + #endif + + d.texcoord3.x += ((_Time.x + _RandomSeed) * _DistortTexXSpeed) % 1; + d.texcoord3.y += ((_Time.x + _RandomSeed) * _DistortTexYSpeed) % 1; + half distortAmnt = (SAMPLE_TEXTURE2D(_DistortTex, sampler_DistortTex, d.texcoord3.xy).r - 0.5) * 0.2 * _DistortAmount; + d.texcoord0.x += distortAmnt; + d.texcoord0.y += distortAmnt; + #endif + //------------------------------------------------------- + + //WARP_ON + #if WARP_ON + half2 warpUv = half2(d.texcoord0.x / _MainTex_ST.x, d.texcoord0.y / _MainTex_ST.y); + #if ATLAS_ON + warpUv = half2((warpUv.x - _MinXUV) / (_MaxXUV - _MinXUV), (warpUv.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + const float tau = 6.283185307179586; + float xWarp = (_Time.y + randomSeed) * _WarpSpeed + warpUv.x * tau / _WarpScale; + float yWarp = (_Time.y + randomSeed) * _WarpSpeed + warpUv.y * tau / _WarpScale; + float2 warp = float2(sin(xWarp), sin(yWarp)) * _WarpStrength; + d.texcoord0.xy += warp; + #endif + + //------------------------------------------------------- + + //WAVEUV_ON + #if WAVEUV_ON + float2 uvWave = half2(_WaveX * _MainTex_ST.x, _WaveY * _MainTex_ST.y) - d.texcoord0.xy; + uvWave %= 1; + #if ATLAS_ON + uvWave = half2(_WaveX, _WaveY) - uvRect; + #endif + uvWave.x *= _ScreenParams.x / _ScreenParams.y; + float waveTime = _Time.y + randomSeed; + float angWave = (sqrt(dot(uvWave, uvWave)) * _WaveAmount) - ((waveTime * _WaveSpeed)); + d.texcoord0.xy = d.texcoord0.xy + uvWave * sin(angWave) * (_WaveStrength / 1000.0); + #endif + //---------------------------------------------------- + + //ROUNDWAVEUV_ON + #if ROUNDWAVEUV_ON + half xWave = ((0.5 * _MainTex_ST.x) - uvRect.x); + half yWave = ((0.5 * _MainTex_ST.y) - uvRect.y) * (_MainTex_TexelSize.w / _MainTex_TexelSize.z); + half ripple = -sqrt(xWave*xWave + yWave* yWave); + d.texcoord0.xy += (sin((ripple + (_Time.y + randomSeed) * (_RoundWaveSpeed/10.0)) / 0.015) * (_RoundWaveStrength/10.0)) % 1; + #endif + //---------------------------------------------------- + + + //WIND_ON + #if WIND_ON + half windOffset = sin((_Time.x + randomSeed) * _GrassSpeed * 10); + half2 windCenter = half2(0.5, 0.1); + #if ATLAS_ON + windCenter.x = ((_MaxXUV - _MinXUV) * windCenter.x) + _MinXUV; + windCenter.y = ((_MaxYUV - _MinYUV) * windCenter.y) + _MinYUV; + #endif + #if !MANUALWIND_ON + d.texcoord0.x = fmod(abs(lerp(d.texcoord0.x, d.texcoord0.x + (_GrassWind * 0.01 * windOffset), uvRect.y)), 1); + #else + d.texcoord0.x = fmod(abs(lerp(d.texcoord0.x, d.texcoord0.x + (_GrassWind * 0.01 * _GrassManualAnim), uvRect.y)), 1); + windOffset = _GrassManualAnim; + #endif + half2 delta = d.texcoord0.xy - windCenter; + half delta2 = dot(delta.xy, delta.xy); + half2 delta_offset = delta2 * windOffset; + d.texcoord0.xy = d.texcoord0.xy + half2(delta.y, -delta.x) * delta_offset * _GrassRadialBend; + #endif + + //-------------------------------------------------------- + + //TEXTURESCROLL_ON && !ATLAS_ON + #if TEXTURESCROLL_ON && !ATLAS_ON + d.texcoord0.x += ((_Time.y + randomSeed) * _TextureScrollXSpeed) % 1; + d.texcoord0.y += ((_Time.y + randomSeed) * _TextureScrollYSpeed) % 1; + #endif + //------------------------------ + + //PIXELATE_ON + #if PIXELATE_ON + half aspectRatio = _MainTex_TexelSize.x / _MainTex_TexelSize.y; + half2 pixelSize = float2(_PixelateSize, _PixelateSize * aspectRatio); + d.texcoord0.xy = floor(d.texcoord0.xy * pixelSize) / pixelSize; + #endif + //-------------- + + half4 col = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy); + half originalAlpha = col.a; + col *= d.vertexColor; + + //NORMAL MAP + #if NORMALMAP_ON + half4 normalSample = SAMPLE_TEXTURE2D(_NormalMap, sampler_NormalMap, d.texcoord0.xy); + half3 normalTS = UnpackNormal(normalSample); + normalTS.xy *= _NormalStrength; + o.Normal = normalTS; + #endif + + + //GLITCH_ON + #if GLITCH_ON + half2 uvGlitch = uvRect; + uvGlitch.y -= 0.5; + half lineNoise = pow(rand2(floor(uvGlitch * half2(24., 19.) * _GlitchSize) * 4.0, randomSeed), 3.0) * _GlitchAmount + * pow(rand2(floor(uvGlitch * half2(38., 14.) * _GlitchSize) * 4.0, randomSeed), 3.0); + col = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(lineNoise * 0.02 * rand2(half2(2.0, 1), randomSeed), 0)) * d.vertexColor; + #endif + //-------------------------------------- + + //CHROMABERR_ON + #if CHROMABERR_ON + half4 r = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(_ChromAberrAmount/10, 0)) * d.vertexColor; + half4 b = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(-_ChromAberrAmount/10, 0)) * d.vertexColor; + col = half4(r.r * r.a, col.g, b.b * b.a, max(max(r.a, b.a) * _ChromAberrAlpha, col.a)); + #endif + + //-------------------------------- + + //BLUR_ON + #if BLUR_ON + #if ATLAS_ON + #if !BLURISHD_ON + col = BlurHD(d.texcoord0.xy, _MainTex, sampler_MainTex, _BlurIntensity, (_MaxXUV - _MinXUV), (_MaxYUV - _MinYUV)) * d.vertexColor; + #else + col = Blur(d.texcoord0.xy, _MainTex, sampler_MainTex, _BlurIntensity * (_MaxXUV - _MinXUV)) * d.vertexColor; + #endif + #else + #if !BLURISHD_ON + col = BlurHD(d.texcoord0.xy, _MainTex, sampler_MainTex, _BlurIntensity, 1, 1) * d.vertexColor; + #else + col = Blur(d.texcoord0.xy, _MainTex, sampler_MainTex, _BlurIntensity) * d.vertexColor; + #endif + #endif + #endif + + //-------------------- + + //MOTIONBLUR_ON + #if MOTIONBLUR_ON + _MotionBlurAngle = _MotionBlurAngle * 3.1415926; + #define rot(n) mul(n, half2x2(cos(_MotionBlurAngle), -sin(_MotionBlurAngle), sin(_MotionBlurAngle), cos(_MotionBlurAngle))) + _MotionBlurDist = _MotionBlurDist * 0.005; + #if ATLAS_ON + _MotionBlurDist *= (_MaxXUV - _MinXUV); + #endif + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(-_MotionBlurDist, -_MotionBlurDist))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(-_MotionBlurDist * 2, -_MotionBlurDist * 2))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(-_MotionBlurDist * 3, -_MotionBlurDist * 3))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(-_MotionBlurDist * 4, -_MotionBlurDist * 4))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(_MotionBlurDist, _MotionBlurDist))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(_MotionBlurDist * 2, _MotionBlurDist * 2))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(_MotionBlurDist * 3, _MotionBlurDist * 3))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(_MotionBlurDist * 4, _MotionBlurDist * 4))); + col.rgb = col.rgb / 9; + #endif + //------------------------------------ + + //NEGATIVE_ON + #if NEGATIVE_ON + col.rgb = lerp(col.rgb, 1 - col.rgb, _NegativeAmount); + #endif + + //-------------- + half luminance = 0; + + //GREYSCALE_ON && !GREYSCALEOUTLINE_ON + #if GREYSCALE_ON && !GREYSCALEOUTLINE_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + luminance = saturate(luminance + _GreyscaleLuminosity); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _GreyscaleTintColor, _GreyscaleBlend); + #endif + //------------------------------------ + + //GHOST_ON + #if GHOST_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + half4 ghostResult; + ghostResult.a = saturate(luminance - _GhostTransparency) * col.a; + ghostResult.rgb = col.rgb * (luminance + _GhostColorBoost); + col = lerp(col, ghostResult, _GhostBlend); + #endif + //------------------------------------ + + //INNEROUTLINE_ON + #if INNEROUTLINE_ON + half3 innerT = abs(GetPixel(0, _InnerOutlineThickness, d.texcoord0.xy, _MainTex, sampler_MainTex) - GetPixel(0, -_InnerOutlineThickness, d.texcoord0.xy, _MainTex, sampler_MainTex)); + innerT += abs(GetPixel(_InnerOutlineThickness, 0, d.texcoord0.xy, _MainTex, sampler_MainTex) - GetPixel(-_InnerOutlineThickness, 0, d.texcoord0.xy, _MainTex, sampler_MainTex)); + #if !ONLYINNEROUTLINE_ON + innerT = (innerT / 2.0) * col.a * _InnerOutlineAlpha; + col.rgb += length(innerT) * _InnerOutlineColor.rgb * _InnerOutlineGlow; + #else + innerT *= col.a * _InnerOutlineAlpha; + col.rgb = length(innerT) * _InnerOutlineColor.rgb * _InnerOutlineGlow; + col.a = step(0.3, col.r+col.g+col.b); + #endif + #endif + //------------------------------------------------------- + + //HITEFFECT_ON + #if HITEFFECT_ON + col.rgb = lerp(col.rgb, _HitEffectColor.rgb * _HitEffectGlow, _HitEffectBlend); + #endif + //-------------------- + + //GRADIENT_ON + #if GRADIENT_ON + half2 tiledUvGrad = half2(uvRect.x / _MainTex_ST.x, uvRect.y / _MainTex_ST.y); + #if GRADIENT2COL_ON + _GradTopRightCol = _GradTopLeftCol; + _GradBotRightCol = _GradBotLeftCol; + #endif + #if RADIALGRADIENT_ON + half radialDist = 1 - length(tiledUvGrad - half2(0.5, 0.5)); + radialDist *= (_MainTex_TexelSize.w / _MainTex_TexelSize.z); + radialDist = saturate(_GradBoostX * radialDist); + half4 gradientResult = lerp(_GradTopLeftCol, _GradBotLeftCol, radialDist); + #else + half gradXLerpFactor = saturate(pow(tiledUvGrad.x, _GradBoostX)); + half4 gradientResult = lerp(lerp(_GradBotLeftCol, _GradBotRightCol, gradXLerpFactor), + lerp(_GradTopLeftCol, _GradTopRightCol, gradXLerpFactor), saturate(pow(tiledUvGrad.y, _GradBoostY))); + #endif + gradientResult = lerp(col, gradientResult, _GradBlend); + col.rgb = gradientResult.rgb * col.a; + col.a *= gradientResult.a; + #endif + //-------------------------------------------------------------------- + + //CONTRAST_ON + #if CONTRAST_ON + col.rgb = (col.rgb - float3(0.5, 0.5, 0.5)) * _Contrast + float3(0.5, 0.5, 0.5); + col.rgb += _Brightness; + #endif + + //------------------------------------------------------------------- + + //COLORSWAP_ON + #if COLORSWAP_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + half4 swapMask = SAMPLE_TEXTURE2D(_ColorSwapTex, sampler_ColorSwapTex, d.texcoord0.xy); + swapMask.rgb *= swapMask.a; + half3 redSwap = _ColorSwapRed * swapMask.r * saturate(luminance + _ColorSwapRedLuminosity); + half3 greenSwap = _ColorSwapGreen * swapMask.g * saturate(luminance + _ColorSwapGreenLuminosity); + half3 blueSwap = _ColorSwapBlue * swapMask.b * saturate(luminance + _ColorSwapBlueLuminosity); + swapMask.rgb = col.rgb * saturate(1 - swapMask.r - swapMask.g - swapMask.b); + col.rgb = lerp(col.rgb, swapMask.rgb + redSwap + greenSwap + blueSwap, _ColorSwapBlend); + #endif + //-------------------------------------------------------------------- + + //COLORRAMP_ON && !COLORRAMPOUTLINE_ON + #if COLORRAMP_ON && !COLORRAMPOUTLINE_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + luminance = saturate(luminance + _ColorRampLuminosity); + #if GRADIENTCOLORRAMP_ON + col.rgb = lerp(col.rgb, SAMPLE_TEXTURE2D(_ColorRampTexGradient, sampler_ColorRampTexGradient, half2(luminance, 0)).rgb, _ColorRampBlend); + #else + col.rgb = lerp(col.rgb, SAMPLE_TEXTURE2D(_ColorRampTex, sampler_ColorRampTex, half2(luminance, 0)).rgb, _ColorRampBlend); + #endif + #endif + //-------------------------------------------------------------------- + + //CHANGECOLOR_ON + #if CHANGECOLOR_ON + float3 currChangeColor = saturate(col.rgb); + luminance = 0.3 * currChangeColor.r + 0.59 * currChangeColor.g + 0.11 * currChangeColor.b; + luminance = saturate(luminance + _ColorChangeLuminosity); + half3 dif = abs(currChangeColor - _ColorChangeTarget.rgb); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _ColorChangeNewCol.rgb, + max(sign(1 - saturate(dif.x + dif.y + dif.z) - _ColorChangeTolerance), 0.0)); + #if CHANGECOLOR2_ON + dif = abs(currChangeColor - _ColorChangeTarget2.rgb); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _ColorChangeNewCol2.rgb, + max(sign(1 - saturate(dif.x + dif.y + dif.z) - _ColorChangeTolerance2), 0.0)); + #endif + #if CHANGECOLOR3_ON + dif = abs(currChangeColor - _ColorChangeTarget3.rgb); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _ColorChangeNewCol3.rgb, + max(sign(1 - saturate(dif.x + dif.y + dif.z) - _ColorChangeTolerance3), 0.0)); + #endif + #endif + //------------------------------------------------------- + + //POSTERIZE_ON && !POSTERIZEOUTLINE_ON + #if POSTERIZE_ON && !POSTERIZEOUTLINE_ON + col.rgb = pow(col.rgb, _PosterizeGamma) * _PosterizeNumColors; + col.rgb = floor(col.rgb) / _PosterizeNumColors; + col.rgb = pow(col.rgb, 1.0 / _PosterizeGamma); + #endif + //------------------------------------ + + //HSV_ON + #if HSV_ON + half3 resultHsv = half3(col.rgb); + half cosHsv = _HsvBright * _HsvSaturation * cos(_HsvShift * 3.14159265 / 180); + half sinHsv = _HsvBright * _HsvSaturation * sin(_HsvShift * 3.14159265 / 180); + resultHsv.x = (.299 * _HsvBright + .701 * cosHsv + .168 * sinHsv) * col.x + + (.587 * _HsvBright - .587 * cosHsv + .330 * sinHsv) * col.y + + (.114 * _HsvBright - .114 * cosHsv - .497 * sinHsv) * col.z; + resultHsv.y = (.299 * _HsvBright - .299 * cosHsv - .328 * sinHsv) *col.x + + (.587 * _HsvBright + .413 * cosHsv + .035 * sinHsv) * col.y + + (.114 * _HsvBright - .114 * cosHsv + .292 * sinHsv) * col.z; + resultHsv.z = (.299 * _HsvBright - .3 * cosHsv + 1.25 * sinHsv) * col.x + + (.587 * _HsvBright - .588 * cosHsv - 1.05 * sinHsv) * col.y + + (.114 * _HsvBright + .886 * cosHsv - .203 * sinHsv) * col.z; + col.rgb = resultHsv; + #endif + //------------------------------------------------------- + + //OVERLAY_ON + #if OVERLAY_ON + half2 overlayUvs = d.texcoord0.xy; + overlayUvs.x += ((_Time.y + randomSeed) * _OverlayTextureScrollXSpeed) % 1; + overlayUvs.y += ((_Time.y + randomSeed) * _OverlayTextureScrollYSpeed) % 1; + half4 overlayCol = SAMPLE_TEXTURE2D(_OverlayTex, sampler_OverlayTex, TRANSFORM_TEX(overlayUvs, _OverlayTex)); + overlayCol.rgb *= _OverlayColor.rgb * _OverlayGlow; + #if !OVERLAYMULT_ON + overlayCol.rgb *= overlayCol.a * _OverlayColor.rgb * _OverlayColor.a * _OverlayBlend; + col.rgb += overlayCol.rgb; + #else + overlayCol.a *= _OverlayColor.a; + col = lerp(col, col * overlayCol, _OverlayBlend); + #endif + #endif + + //--------------------------------- + + //OUTBASE_ON + #if OUTBASE_ON + #if OUTBASEPIXELPERF_ON + half2 destUv = half2(_OutlinePixelWidth * _MainTex_TexelSize.x, _OutlinePixelWidth * _MainTex_TexelSize.y); + #else + half2 destUv = half2(_OutlineWidth * _MainTex_TexelSize.x * 200, _OutlineWidth * _MainTex_TexelSize.y * 200); + #endif + + #if OUTDIST_ON + d.texcoord3.x += ((_Time.x + _RandomSeed) * _OutlineDistortTexXSpeed) % 1; + d.texcoord3.y += ((_Time.x + _RandomSeed) * _OutlineDistortTexYSpeed) % 1; + #if ATLAS_ON + d.texcoord3 = half2((d.texcoord3.x - _MinXUV) / (_MaxXUV - _MinXUV), (d.texcoord3.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half outDistortAmnt = (SAMPLE_TEXTURE2D(_OutlineDistortTex, sampler_OutlineDistortTex, d.texcoord3).r - 0.5) * 0.2 * _OutlineDistortAmount; + destUv.x += outDistortAmnt; + destUv.y += outDistortAmnt; + #endif + + half spriteLeft = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(destUv.x, 0)).a; + half spriteRight = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy - half2(destUv.x, 0)).a; + half spriteBottom = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(0, destUv.y)).a; + half spriteTop = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy - half2(0, destUv.y)).a; + half result = spriteLeft + spriteRight + spriteBottom + spriteTop; + + #if OUTBASE8DIR_ON + half spriteTopLeft = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(destUv.x, destUv.y)).a; + half spriteTopRight = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(-destUv.x, destUv.y)).a; + half spriteBotLeft = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(destUv.x, -destUv.y)).a; + half spriteBotRight = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(-destUv.x, -destUv.y)).a; + result = result + spriteTopLeft + spriteTopRight + spriteBotLeft + spriteBotRight; + #endif + + result = step(0.05, saturate(result)); + + #if OUTTEX_ON + d.texcoord1.x += ((_Time.x + _RandomSeed) * _OutlineTexXSpeed) % 1; + d.texcoord1.y += ((_Time.x + _RandomSeed) * _OutlineTexYSpeed) % 1; + #if ATLAS_ON + d.texcoord1 = half2((d.texcoord1.x - _MinXUV) / (_MaxXUV - _MinXUV), (d.texcoord1.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half4 tempOutColor = SAMPLE_TEXTURE2D(_OutlineTex, sampler_OutlineTex, d.texcoord1); + tempOutColor *= _OutlineColor; + _OutlineColor = tempOutColor; + #endif + + result *= (1 - originalAlpha) * _OutlineAlpha; + + half4 outline = _OutlineColor * d.vertexColor.a; + outline.rgb *= _OutlineGlow; + outline.a = result; + #if ONLYOUTLINE_ON + col = outline; + #else + col = lerp(col, outline, result); + #endif + #endif + //------------------------------------------------------- + + //FADE_ON + #if FADE_ON + half2 tiledUvFade1 = TRANSFORM_TEX(d.texcoord0, _FadeTex); + half2 tiledUvFade2 = TRANSFORM_TEX(d.texcoord0, _FadeBurnTex); + #if ATLAS_ON + tiledUvFade1 = half2((tiledUvFade1.x - _MinXUV) / (_MaxXUV - _MinXUV), (tiledUvFade1.y - _MinYUV) / (_MaxYUV - _MinYUV)); + tiledUvFade2 = half2((tiledUvFade2.x - _MinXUV) / (_MaxXUV - _MinXUV), (tiledUvFade2.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half fadeTemp = SAMPLE_TEXTURE2D(_FadeTex, sampler_FadeTex, tiledUvFade1).r; + half fade = smoothstep(_FadeAmount, _FadeAmount + _FadeBurnTransition, fadeTemp); + half fadeBurn = saturate(smoothstep(_FadeAmount - _FadeBurnWidth, _FadeAmount - _FadeBurnWidth + 0.1, fadeTemp) * _FadeAmount); + col.a *= fade; + _FadeBurnColor.rgb *= _FadeBurnGlow; + col += fadeBurn * SAMPLE_TEXTURE2D(_FadeBurnTex, sampler_FadeBurnTex, tiledUvFade2) * _FadeBurnColor * originalAlpha * (1 - col.a); + #endif + //------------------------------------------------------- + + //SHADOW_ON + #if SHADOW_ON + half shadowA = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(_ShadowX, _ShadowY)).a; + half preMultShadowMask = 1 - (saturate(shadowA - col.a) * (1 - col.a)); + col.rgb *= 1 - ((shadowA - col.a) * (1 - col.a)); + col.rgb += (_ShadowColor * shadowA) * (1 - col.a); + col.a = max(shadowA * _ShadowAlpha * d.vertexColor.a, col.a); + #endif + + //------------------------------------------------------- + + //GLOW_ON + #if GLOW_ON + half4 emission; + #if GLOWTEX_ON + emission = SAMPLE_TEXTURE2D(_GlowTex, sampler_GlowTex, d.texcoord0); + #else + emission = col; + #endif + + col.rgb *= _GlowGlobal; + emission.rgb *= emission.a * col.a * _Glow * _GlowColor; + col.rgb += emission.rgb; + #endif + //------------------------------------------------------- + + //COLORRAMP_ON && COLORRAMPOUTLINE_ON + #if COLORRAMP_ON && COLORRAMPOUTLINE_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + luminance = saturate(luminance + _ColorRampLuminosity); + #if GRADIENTCOLORRAMP_ON + col.rgb = lerp(col.rgb, SAMPLE_TEXTURE2D(_ColorRampTexGradient, sampler_ColorRampTexGradient, half2(luminance, 0)).rgb, _ColorRampBlend); + #else + col.rgb = lerp(col.rgb, SAMPLE_TEXTURE2D(_ColorRampTex, sampler_ColorRampTex, half2(luminance, 0)).rgb, _ColorRampBlend); + #endif + #endif + //--------------- + + //GREYSCALE_ON && GREYSCALEOUTLINE_ON + #if GREYSCALE_ON && GREYSCALEOUTLINE_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + luminance = saturate(luminance + _GreyscaleLuminosity); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _GreyscaleTintColor, _GreyscaleBlend); + #endif + + //----------------------------------- + + //POSTERIZE_ON && POSTERIZEOUTLINE_ON + #if POSTERIZE_ON && POSTERIZEOUTLINE_ON + col.rgb = pow(col.rgb, _PosterizeGamma) * _PosterizeNumColors; + col.rgb = floor(col.rgb) / _PosterizeNumColors; + col.rgb = pow(col.rgb, 1.0 / _PosterizeGamma); + #endif + + //----------------------------------- + + //SHINE_ON + #if SHINE_ON + half2 uvShine = uvRect; + half cosAngle = cos(_ShineRotate); + half sinAngle = sin(_ShineRotate); + half2x2 rot = half2x2(cosAngle, -sinAngle, sinAngle, cosAngle); + uvShine -= half2(0.5, 0.5); + uvShine = mul(rot, uvShine); + uvShine += half2(0.5, 0.5); + half shineMask = SAMPLE_TEXTURE2D(_ShineMask, sampler_ShineMask, d.texcoord0.xy).a; + half currentDistanceProjection = (uvShine.x + uvShine.y) / 2; + half whitePower = 1 - (abs(currentDistanceProjection - _ShineLocation) / _ShineWidth); + col.rgb += col.a * whitePower * _ShineGlow * max(sign(currentDistanceProjection - (_ShineLocation - _ShineWidth)), 0.0) + * max(sign((_ShineLocation + _ShineWidth) - currentDistanceProjection), 0.0) * _ShineColor * shineMask; + #endif + + //----------------------------------- + + //HOLOGRAM_ON + #if HOLOGRAM_ON + half totalHologram = _HologramStripesAmount + _HologramUnmodAmount; + half hologramYCoord = ((uvRect.y + (((_Time.x + randomSeed) % 1) * _HologramStripesSpeed)) % totalHologram) / totalHologram; + hologramYCoord = abs(hologramYCoord); + half alpha = RemapFloat(saturate(hologramYCoord - (_HologramUnmodAmount/totalHologram)), 0.0, 1.0, _HologramMinAlpha, saturate(_HologramMaxAlpha)); + half hologramMask = max(sign((_HologramUnmodAmount/totalHologram) - hologramYCoord), 0.0); + half4 hologramResult = col; + hologramResult.a *= lerp(alpha, 1, hologramMask); + hologramResult.rgb *= max(1, _HologramMaxAlpha * max(sign(hologramYCoord - (_HologramUnmodAmount/totalHologram)), 0.0)); + hologramMask = 1 - step(0.01,hologramMask); + hologramResult.rgb += hologramMask * _HologramStripeColor * col.a; + col = lerp(col, hologramResult, _HologramBlend); + #endif + + //----------------------------------- + + //FLICKER_ON + #if FLICKER_ON + col.a *= saturate(col.a * step(frac(0.05 + (_Time.w + randomSeed) * _FlickerFreq), 1 - _FlickerPercent) + _FlickerAlpha); + #endif + //----------------------------------- + + //ALPHACUTOFF_ON + + //ALPHAROUND_ON + + //ALPHAOUTLINE_ON + #if ALPHAOUTLINE_ON + half alphaOutlineRes = pow(1 - col.a, max(_AlphaOutlinePower, 0.0001)) * step(_AlphaOutlineMinAlpha, col.a) * _AlphaOutlineBlend; + col.rgb = lerp(col.rgb, _AlphaOutlineColor.rgb * _AlphaOutlineGlow, alphaOutlineRes); + col.a = lerp(col.a, 1, alphaOutlineRes > 1); + #endif + //------------------------------------------------------- + + //FOG_ON + + //------------------ + + col *= _Color; + o.Albedo = col; + col.a *= _Alpha; + clip(col.a - _AlphaCutoffValue - 0.01); + o.Alpha = _Color.a; + } + + + + + + void ChainSurfaceFunction(inout Surface l, inout ShaderData d) + { + Ext_SurfaceFunction0(l, d); + // Ext_SurfaceFunction1(l, d); + // Ext_SurfaceFunction2(l, d); + // Ext_SurfaceFunction3(l, d); + // Ext_SurfaceFunction4(l, d); + // Ext_SurfaceFunction5(l, d); + // Ext_SurfaceFunction6(l, d); + // Ext_SurfaceFunction7(l, d); + // Ext_SurfaceFunction8(l, d); + // Ext_SurfaceFunction9(l, d); + // Ext_SurfaceFunction10(l, d); + // Ext_SurfaceFunction11(l, d); + // Ext_SurfaceFunction12(l, d); + // Ext_SurfaceFunction13(l, d); + // Ext_SurfaceFunction14(l, d); + // Ext_SurfaceFunction15(l, d); + // Ext_SurfaceFunction16(l, d); + // Ext_SurfaceFunction17(l, d); + // Ext_SurfaceFunction18(l, d); + // Ext_SurfaceFunction19(l, d); + // Ext_SurfaceFunction20(l, d); + // Ext_SurfaceFunction21(l, d); + // Ext_SurfaceFunction22(l, d); + // Ext_SurfaceFunction23(l, d); + // Ext_SurfaceFunction24(l, d); + // Ext_SurfaceFunction25(l, d); + // Ext_SurfaceFunction26(l, d); + // Ext_SurfaceFunction27(l, d); + // Ext_SurfaceFunction28(l, d); + // Ext_SurfaceFunction29(l, d); + } + +#if !_DECALSHADER + + void ChainModifyVertex(inout VertexData v, inout VertexToPixel v2p, float4 time) + { + ExtraV2F d; + + ZERO_INITIALIZE(ExtraV2F, d); + ZERO_INITIALIZE(Blackboard, d.blackboard); + // due to motion vectors in HDRP, we need to use the last + // time in certain spots. So if you are going to use _Time to adjust vertices, + // you need to use this time or motion vectors will break. + d.time = time; + + Ext_ModifyVertex0(v, d); + // Ext_ModifyVertex1(v, d); + // Ext_ModifyVertex2(v, d); + // Ext_ModifyVertex3(v, d); + // Ext_ModifyVertex4(v, d); + // Ext_ModifyVertex5(v, d); + // Ext_ModifyVertex6(v, d); + // Ext_ModifyVertex7(v, d); + // Ext_ModifyVertex8(v, d); + // Ext_ModifyVertex9(v, d); + // Ext_ModifyVertex10(v, d); + // Ext_ModifyVertex11(v, d); + // Ext_ModifyVertex12(v, d); + // Ext_ModifyVertex13(v, d); + // Ext_ModifyVertex14(v, d); + // Ext_ModifyVertex15(v, d); + // Ext_ModifyVertex16(v, d); + // Ext_ModifyVertex17(v, d); + // Ext_ModifyVertex18(v, d); + // Ext_ModifyVertex19(v, d); + // Ext_ModifyVertex20(v, d); + // Ext_ModifyVertex21(v, d); + // Ext_ModifyVertex22(v, d); + // Ext_ModifyVertex23(v, d); + // Ext_ModifyVertex24(v, d); + // Ext_ModifyVertex25(v, d); + // Ext_ModifyVertex26(v, d); + // Ext_ModifyVertex27(v, d); + // Ext_ModifyVertex28(v, d); + // Ext_ModifyVertex29(v, d); + + + // #if %EXTRAV2F0REQUIREKEY% + // v2p.extraV2F0 = d.extraV2F0; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // v2p.extraV2F1 = d.extraV2F1; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // v2p.extraV2F2 = d.extraV2F2; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // v2p.extraV2F3 = d.extraV2F3; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // v2p.extraV2F4 = d.extraV2F4; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // v2p.extraV2F5 = d.extraV2F5; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // v2p.extraV2F6 = d.extraV2F6; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // v2p.extraV2F7 = d.extraV2F7; + // #endif + } + + void ChainModifyTessellatedVertex(inout VertexData v, inout VertexToPixel v2p) + { + ExtraV2F d; + ZERO_INITIALIZE(ExtraV2F, d); + ZERO_INITIALIZE(Blackboard, d.blackboard); + + // #if %EXTRAV2F0REQUIREKEY% + // d.extraV2F0 = v2p.extraV2F0; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // d.extraV2F1 = v2p.extraV2F1; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // d.extraV2F2 = v2p.extraV2F2; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // d.extraV2F3 = v2p.extraV2F3; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // d.extraV2F4 = v2p.extraV2F4; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // d.extraV2F5 = v2p.extraV2F5; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // d.extraV2F6 = v2p.extraV2F6; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // d.extraV2F7 = v2p.extraV2F7; + // #endif + + + // Ext_ModifyTessellatedVertex0(v, d); + // Ext_ModifyTessellatedVertex1(v, d); + // Ext_ModifyTessellatedVertex2(v, d); + // Ext_ModifyTessellatedVertex3(v, d); + // Ext_ModifyTessellatedVertex4(v, d); + // Ext_ModifyTessellatedVertex5(v, d); + // Ext_ModifyTessellatedVertex6(v, d); + // Ext_ModifyTessellatedVertex7(v, d); + // Ext_ModifyTessellatedVertex8(v, d); + // Ext_ModifyTessellatedVertex9(v, d); + // Ext_ModifyTessellatedVertex10(v, d); + // Ext_ModifyTessellatedVertex11(v, d); + // Ext_ModifyTessellatedVertex12(v, d); + // Ext_ModifyTessellatedVertex13(v, d); + // Ext_ModifyTessellatedVertex14(v, d); + // Ext_ModifyTessellatedVertex15(v, d); + // Ext_ModifyTessellatedVertex16(v, d); + // Ext_ModifyTessellatedVertex17(v, d); + // Ext_ModifyTessellatedVertex18(v, d); + // Ext_ModifyTessellatedVertex19(v, d); + // Ext_ModifyTessellatedVertex20(v, d); + // Ext_ModifyTessellatedVertex21(v, d); + // Ext_ModifyTessellatedVertex22(v, d); + // Ext_ModifyTessellatedVertex23(v, d); + // Ext_ModifyTessellatedVertex24(v, d); + // Ext_ModifyTessellatedVertex25(v, d); + // Ext_ModifyTessellatedVertex26(v, d); + // Ext_ModifyTessellatedVertex27(v, d); + // Ext_ModifyTessellatedVertex28(v, d); + // Ext_ModifyTessellatedVertex29(v, d); + + // #if %EXTRAV2F0REQUIREKEY% + // v2p.extraV2F0 = d.extraV2F0; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // v2p.extraV2F1 = d.extraV2F1; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // v2p.extraV2F2 = d.extraV2F2; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // v2p.extraV2F3 = d.extraV2F3; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // v2p.extraV2F4 = d.extraV2F4; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // v2p.extraV2F5 = d.extraV2F5; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // v2p.extraV2F6 = d.extraV2F6; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // v2p.extraV2F7 = d.extraV2F7; + // #endif + } + + void ChainFinalColorForward(inout Surface l, inout ShaderData d, inout half4 color) + { + // Ext_FinalColorForward0(l, d, color); + // Ext_FinalColorForward1(l, d, color); + // Ext_FinalColorForward2(l, d, color); + // Ext_FinalColorForward3(l, d, color); + // Ext_FinalColorForward4(l, d, color); + // Ext_FinalColorForward5(l, d, color); + // Ext_FinalColorForward6(l, d, color); + // Ext_FinalColorForward7(l, d, color); + // Ext_FinalColorForward8(l, d, color); + // Ext_FinalColorForward9(l, d, color); + // Ext_FinalColorForward10(l, d, color); + // Ext_FinalColorForward11(l, d, color); + // Ext_FinalColorForward12(l, d, color); + // Ext_FinalColorForward13(l, d, color); + // Ext_FinalColorForward14(l, d, color); + // Ext_FinalColorForward15(l, d, color); + // Ext_FinalColorForward16(l, d, color); + // Ext_FinalColorForward17(l, d, color); + // Ext_FinalColorForward18(l, d, color); + // Ext_FinalColorForward19(l, d, color); + // Ext_FinalColorForward20(l, d, color); + // Ext_FinalColorForward21(l, d, color); + // Ext_FinalColorForward22(l, d, color); + // Ext_FinalColorForward23(l, d, color); + // Ext_FinalColorForward24(l, d, color); + // Ext_FinalColorForward25(l, d, color); + // Ext_FinalColorForward26(l, d, color); + // Ext_FinalColorForward27(l, d, color); + // Ext_FinalColorForward28(l, d, color); + // Ext_FinalColorForward29(l, d, color); + } + + void ChainFinalGBufferStandard(inout Surface s, inout ShaderData d, inout half4 GBuffer0, inout half4 GBuffer1, inout half4 GBuffer2, inout half4 outEmission, inout half4 outShadowMask) + { + // Ext_FinalGBufferStandard0(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard1(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard2(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard3(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard4(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard5(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard6(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard7(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard8(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard9(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard10(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard11(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard12(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard13(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard14(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard15(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard16(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard17(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard18(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard19(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard20(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard21(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard22(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard23(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard24(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard25(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard26(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard27(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard28(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard29(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + } +#endif + + + + + +#if _DECALSHADER + + ShaderData CreateShaderData(SurfaceDescriptionInputs IN) + { + ShaderData d = (ShaderData)0; + d.TBNMatrix = float3x3(IN.WorldSpaceTangent, IN.WorldSpaceBiTangent, IN.WorldSpaceNormal); + d.worldSpaceNormal = IN.WorldSpaceNormal; + d.worldSpaceTangent = IN.WorldSpaceTangent; + + d.worldSpacePosition = IN.WorldSpacePosition; + d.texcoord0 = IN.uv0.xyxy; + d.screenPos = IN.ScreenPosition; + + d.worldSpaceViewDir = normalize(_WorldSpaceCameraPos - d.worldSpacePosition); + + d.tangentSpaceViewDir = mul(d.TBNMatrix, d.worldSpaceViewDir); + + // these rarely get used, so we back transform them. Usually will be stripped. + #if _HDRP + // d.localSpacePosition = mul(GetWorldToObjectMatrix(), float4(GetCameraRelativePositionWS(d.worldSpacePosition), 1)).xyz; + #else + // d.localSpacePosition = mul(GetWorldToObjectMatrix(), float4(d.worldSpacePosition, 1)).xyz; + #endif + // d.localSpaceNormal = normalize(mul((float3x3)GetWorldToObjectMatrix(), d.worldSpaceNormal)); + // d.localSpaceTangent = normalize(mul((float3x3)GetWorldToObjectMatrix(), d.worldSpaceTangent.xyz)); + + // #if %SCREENPOSREQUIREKEY% + // d.screenUV = (IN.ScreenPosition.xy / max(0.01, IN.ScreenPosition.w)); + // #endif + + return d; + } +#else + + ShaderData CreateShaderData(VertexToPixel i + #if NEED_FACING + , bool facing + #endif + ) + { + ShaderData d = (ShaderData)0; + d.clipPos = i.pos; + d.worldSpacePosition = i.worldPos; + + d.worldSpaceNormal = normalize(i.worldNormal); + d.worldSpaceTangent.xyz = normalize(i.worldTangent.xyz); + + d.tangentSign = i.worldTangent.w * unity_WorldTransformParams.w; + float3 bitangent = cross(d.worldSpaceTangent.xyz, d.worldSpaceNormal) * d.tangentSign; + + d.TBNMatrix = float3x3(d.worldSpaceTangent, -bitangent, d.worldSpaceNormal); + d.worldSpaceViewDir = normalize(_WorldSpaceCameraPos - i.worldPos); + + d.tangentSpaceViewDir = mul(d.TBNMatrix, d.worldSpaceViewDir); + d.texcoord0 = i.texcoord0; + d.texcoord1 = i.texcoord1; + d.texcoord2 = i.texcoord2; + + // #if %TEXCOORD3REQUIREKEY% + d.texcoord3 = i.texcoord3; + // #endif + + // d.isFrontFace = facing; + // #if %VERTEXCOLORREQUIREKEY% + d.vertexColor = i.vertexColor; + // #endif + + // these rarely get used, so we back transform them. Usually will be stripped. + #if _HDRP + // d.localSpacePosition = mul(GetWorldToObjectMatrix(), float4(GetCameraRelativePositionWS(i.worldPos), 1)).xyz; + #else + // d.localSpacePosition = mul(GetWorldToObjectMatrix(), float4(i.worldPos, 1)).xyz; + #endif + // d.localSpaceNormal = normalize(mul((float3x3)GetWorldToObjectMatrix(), i.worldNormal)); + // d.localSpaceTangent = normalize(mul((float3x3)GetWorldToObjectMatrix(), i.worldTangent.xyz)); + + // #if %SCREENPOSREQUIREKEY% + // d.screenPos = i.screenPos; + // d.screenUV = (i.screenPos.xy / i.screenPos.w); + // #endif + + + // #if %EXTRAV2F0REQUIREKEY% + // d.extraV2F0 = i.extraV2F0; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // d.extraV2F1 = i.extraV2F1; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // d.extraV2F2 = i.extraV2F2; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // d.extraV2F3 = i.extraV2F3; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // d.extraV2F4 = i.extraV2F4; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // d.extraV2F5 = i.extraV2F5; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // d.extraV2F6 = i.extraV2F6; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // d.extraV2F7 = i.extraV2F7; + // #endif + + return d; + } + +#endif + + // vertex shader + VertexToPixel Vert (VertexData v) + { + UNITY_SETUP_INSTANCE_ID(v); + VertexToPixel o; + UNITY_INITIALIZE_OUTPUT(VertexToPixel,o); + UNITY_TRANSFER_INSTANCE_ID(v,o); + UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o); + +#if !_TESSELLATION_ON + ChainModifyVertex(v, o, _Time); +#endif + + o.pos = UnityObjectToClipPos(v.vertex); + o.texcoord0 = v.texcoord0; + o.texcoord1 = v.texcoord1; + o.texcoord2 = v.texcoord2; + + // #if %TEXCOORD3REQUIREKEY% + o.texcoord3 = v.texcoord3; + // #endif + + // #if %VERTEXCOLORREQUIREKEY% + o.vertexColor = v.vertexColor; + // #endif + + // #if %SCREENPOSREQUIREKEY% + // o.screenPos = ComputeScreenPos(o.pos); + // #endif + + o.worldPos = mul(GetObjectToWorldMatrix(), v.vertex).xyz; + o.worldNormal = UnityObjectToWorldNormal(v.normal); + o.worldTangent = float4(UnityObjectToWorldDir(v.tangent.xyz), v.tangent.w); + + + #ifdef DYNAMICLIGHTMAP_ON + o.lmap.zw = v.texcoord2.xy * unity_DynamicLightmapST.xy + unity_DynamicLightmapST.zw; + #endif + #ifdef LIGHTMAP_ON + o.lmap.xy = v.texcoord1.xy * unity_LightmapST.xy + unity_LightmapST.zw; + #endif + + // SH/ambient and vertex lights + #ifndef LIGHTMAP_ON + #if UNITY_SHOULD_SAMPLE_SH && !UNITY_SAMPLE_FULL_SH_PER_PIXEL + o.sh = 0; + // Approximated illumination from non-important point lights + #ifdef VERTEXLIGHT_ON + o.sh += Shade4PointLights ( + unity_4LightPosX0, unity_4LightPosY0, unity_4LightPosZ0, + unity_LightColor[0].rgb, unity_LightColor[1].rgb, unity_LightColor[2].rgb, unity_LightColor[3].rgb, + unity_4LightAtten0, o.worldPos, o.worldNormal); + #endif + o.sh = ShadeSHPerVertex (o.worldNormal, o.sh); + #endif + #endif // !LIGHTMAP_ON + + UNITY_TRANSFER_LIGHTING(o,v.texcoord1.xy); // pass shadow and, possibly, light cookie coordinates to pixel shader + #ifdef FOG_COMBINED_WITH_TSPACE + UNITY_TRANSFER_FOG_COMBINED_WITH_TSPACE(o,o.pos); // pass fog coordinates to pixel shader + #elif defined FOG_COMBINED_WITH_WORLD_POS + UNITY_TRANSFER_FOG_COMBINED_WITH_WORLD_POS(o,o.pos); // pass fog coordinates to pixel shader + #else + UNITY_TRANSFER_FOG(o,o.pos); // pass fog coordinates to pixel shader + #endif + + return o; + } + + + + // fragment shader + fixed4 Frag (VertexToPixel IN + #ifdef _DEPTHOFFSET_ON + , out float outputDepth : SV_Depth + #endif + #if NEED_FACING + , bool facing : SV_IsFrontFace + #endif + ) : SV_Target + { + UNITY_SETUP_INSTANCE_ID(IN); + // prepare and unpack data + #ifdef FOG_COMBINED_WITH_TSPACE + UNITY_EXTRACT_FOG_FROM_TSPACE(IN); + #elif defined FOG_COMBINED_WITH_WORLD_POS + UNITY_EXTRACT_FOG_FROM_WORLD_POS(IN); + #else + UNITY_EXTRACT_FOG(IN); + #endif + + ShaderData d = CreateShaderData(IN + #if NEED_FACING + , facing + #endif + ); + Surface l = (Surface)0; + + + #ifdef _DEPTHOFFSET_ON + l.outputDepth = outputDepth; + #endif + + + + l.Albedo = half3(0.5, 0.5, 0.5); + l.Normal = float3(0,0,1); + l.Occlusion = 1; + l.Alpha = 1; + + ChainSurfaceFunction(l, d); + + + + #ifdef _DEPTHOFFSET_ON + outputDepth = l.outputDepth; + #endif + + + #ifndef USING_DIRECTIONAL_LIGHT + fixed3 lightDir = normalize(UnityWorldSpaceLightDir(d.worldSpacePosition)); + #else + fixed3 lightDir = _WorldSpaceLightPos0.xyz; + #endif + float3 worldViewDir = normalize(UnityWorldSpaceViewDir(d.worldSpacePosition)); + + // compute lighting & shadowing factor + UNITY_LIGHT_ATTENUATION(atten, IN, d.worldSpacePosition) + + #if _USESPECULAR || _USESPECULARWORKFLOW || _SPECULARFROMMETALLIC + #ifdef UNITY_COMPILER_HLSL + SurfaceOutputStandardSpecular o = (SurfaceOutputStandardSpecular)0; + #else + SurfaceOutputStandardSpecular o; + #endif + o.Specular = l.Specular; + o.Occlusion = l.Occlusion; + o.Smoothness = l.Smoothness; + #elif _BDRFLAMBERT || _BDRF3 || _SIMPLELIT + #ifdef UNITY_COMPILER_HLSL + SurfaceOutput o = (SurfaceOutput)0; + #else + SurfaceOutput o; + #endif + + o.Specular = l.Specular; + o.Gloss = l.Smoothness; + _SpecColor.rgb = l.Specular; // fucking hell Unity, wtf.. + #else + #ifdef UNITY_COMPILER_HLSL + SurfaceOutputStandard o = (SurfaceOutputStandard)0; + #else + SurfaceOutputStandard o; + #endif + o.Smoothness = l.Smoothness; + o.Metallic = l.Metallic; + o.Occlusion = l.Occlusion; + #endif + + o.Albedo = l.Albedo; + o.Emission = l.Emission; + o.Alpha = l.Alpha; + #if _WORLDSPACENORMAL + o.Normal = l.Normal; + #else + o.Normal = normalize(TangentToWorldSpace(d, l.Normal)); + #endif + + fixed4 c = 0; + // Setup lighting environment + UnityGI gi; + UNITY_INITIALIZE_OUTPUT(UnityGI, gi); + gi.indirect.diffuse = 0; + gi.indirect.specular = 0; + gi.light.color = _LightColor0.rgb; + gi.light.dir = lightDir; + // Call GI (lightmaps/SH/reflections) lighting function + UnityGIInput giInput; + UNITY_INITIALIZE_OUTPUT(UnityGIInput, giInput); + giInput.light = gi.light; + giInput.worldPos = d.worldSpacePosition; + giInput.worldViewDir = worldViewDir; + giInput.atten = atten; + #if defined(LIGHTMAP_ON) || defined(DYNAMICLIGHTMAP_ON) + giInput.lightmapUV = IN.lmap; + #else + giInput.lightmapUV = 0.0; + #endif + #if UNITY_SHOULD_SAMPLE_SH && !UNITY_SAMPLE_FULL_SH_PER_PIXEL + giInput.ambient = IN.sh; + #else + giInput.ambient.rgb = 0.0; + #endif + giInput.probeHDR[0] = unity_SpecCube0_HDR; + giInput.probeHDR[1] = unity_SpecCube1_HDR; + #if defined(UNITY_SPECCUBE_BLENDING) || defined(UNITY_SPECCUBE_BOX_PROJECTION) + giInput.boxMin[0] = unity_SpecCube0_BoxMin; // .w holds lerp value for blending + #endif + #ifdef UNITY_SPECCUBE_BOX_PROJECTION + giInput.boxMax[0] = unity_SpecCube0_BoxMax; + giInput.probePosition[0] = unity_SpecCube0_ProbePosition; + giInput.boxMax[1] = unity_SpecCube1_BoxMax; + giInput.boxMin[1] = unity_SpecCube1_BoxMin; + giInput.probePosition[1] = unity_SpecCube1_ProbePosition; + #endif + + + + #if defined(_OVERRIDE_SHADOWMASK) + float4 mulColor = saturate(dot(l.ShadowMask, unity_OcclusionMaskSelector)); + gi.light.color *= mulColor; + giInput.light.color *= mulColor; + #endif + + #if _UNLIT + c.rgb = l.Albedo; + c.a = l.Alpha; + #elif _BDRF3 || _SIMPLELIT + LightingBlinnPhong_GI(o, giInput, gi); + #if defined(_OVERRIDE_BAKEDGI) + gi.indirect.diffuse = l.DiffuseGI; + gi.indirect.specular = l.SpecularGI; + #endif + c += LightingBlinnPhong (o, d.worldSpaceViewDir, gi); + #elif _USESPECULAR || _USESPECULARWORKFLOW || _SPECULARFROMMETALLIC + LightingStandardSpecular_GI(o, giInput, gi); + #if defined(_OVERRIDE_BAKEDGI) + gi.indirect.diffuse = l.DiffuseGI; + gi.indirect.specular = l.SpecularGI; + #endif + c += LightingStandardSpecular (o, d.worldSpaceViewDir, gi); + #else + LightingStandard_GI(o, giInput, gi); + #if defined(_OVERRIDE_BAKEDGI) + gi.indirect.diffuse = l.DiffuseGI; + gi.indirect.specular = l.SpecularGI; + #endif + c += LightingStandard (o, d.worldSpaceViewDir, gi); + #endif + + c.rgb += o.Emission; + + ChainFinalColorForward(l, d, c); + + #if !DISABLEFOG + UNITY_APPLY_FOG(_unity_fogCoord, c); // apply fog + #endif + + + return c; + } + + ENDCG + + } + + + + // ---- deferred shading pass: + Pass + { + Name "DEFERRED" + Tags { "LightMode" = "Deferred" } + + Tags { "RenderType" = "Opaque" "Queue" = "Geometry" "PreviewType" = "Plane" } + Cull [_CullingOption] + ZWrite [_ZWrite] + ZTest [_ZTestMode] + + + CGPROGRAM + + #pragma vertex Vert + #pragma fragment Frag + + // compile directives + #pragma target 3.0 + #pragma multi_compile_instancing + #pragma exclude_renderers nomrt + #pragma skip_variants FOG_LINEAR FOG_EXP FOG_EXP2 + #pragma multi_compile_prepassfinal + #include "HLSLSupport.cginc" + #define UNITY_INSTANCED_LOD_FADE + #define UNITY_INSTANCED_SH + #define UNITY_INSTANCED_LIGHTMAPSTS + #include "UnityShaderVariables.cginc" + #include "UnityShaderUtilities.cginc" + #include "UnityCG.cginc" + #include "Lighting.cginc" + #include "UnityPBSLighting.cginc" + + #define _PASSGBUFFER 1 + + + #pragma shader_feature_local GLOW_ON + #pragma shader_feature_local FADE_ON + #pragma shader_feature_local OUTBASE_ON + #pragma shader_feature_local ONLYOUTLINE_ON + #pragma shader_feature_local GRADIENT_ON + #pragma shader_feature_local GRADIENT2COL_ON + #pragma shader_feature_local RADIALGRADIENT_ON + #pragma shader_feature_local COLORSWAP_ON + #pragma shader_feature_local HSV_ON + #pragma shader_feature_local CHANGECOLOR_ON + #pragma shader_feature_local CHANGECOLOR2_ON + #pragma shader_feature_local CHANGECOLOR3_ON + #pragma shader_feature_local COLORRAMP_ON + #pragma shader_feature_local GRADIENTCOLORRAMP_ON + #pragma shader_feature_local HITEFFECT_ON + #pragma shader_feature_local NEGATIVE_ON + #pragma shader_feature_local PIXELATE_ON + #pragma shader_feature_local GREYSCALE_ON + #pragma shader_feature_local POSTERIZE_ON + #pragma shader_feature_local BLUR_ON + #pragma shader_feature_local MOTIONBLUR_ON + #pragma shader_feature_local GHOST_ON + #pragma shader_feature_local ALPHAOUTLINE_ON + #pragma shader_feature_local INNEROUTLINE_ON + #pragma shader_feature_local ONLYINNEROUTLINE_ON + #pragma shader_feature_local HOLOGRAM_ON + #pragma shader_feature_local CHROMABERR_ON + #pragma shader_feature_local GLITCH_ON + #pragma shader_feature_local FLICKER_ON + #pragma shader_feature_local SHADOW_ON + #pragma shader_feature_local SHINE_ON + #pragma shader_feature_local CONTRAST_ON + #pragma shader_feature_local OVERLAY_ON + #pragma shader_feature_local OVERLAYMULT_ON + #pragma shader_feature_local DOODLE_ON + #pragma shader_feature_local WIND_ON + #pragma shader_feature_local WAVEUV_ON + #pragma shader_feature_local ROUNDWAVEUV_ON + #pragma shader_feature_local RECTSIZE_ON + #pragma shader_feature_local OFFSETUV_ON + #pragma shader_feature_local CLIPPING_ON + #pragma shader_feature_local RADIALCLIPPING_ON + #pragma shader_feature_local TEXTURESCROLL_ON + #pragma shader_feature_local ZOOMUV_ON + #pragma shader_feature_local DISTORT_ON + #pragma shader_feature_local WARP_ON + #pragma shader_feature_local TWISTUV_ON + #pragma shader_feature_local ROTATEUV_ON + #pragma shader_feature_local POLARUV_ON + #pragma shader_feature_local FISHEYE_ON + #pragma shader_feature_local PINCH_ON + #pragma shader_feature_local SHAKEUV_ON + + #pragma shader_feature_local GLOWTEX_ON + #pragma shader_feature_local OUTTEX_ON + #pragma shader_feature_local OUTDIST_ON + #pragma shader_feature_local OUTBASE8DIR_ON + #pragma shader_feature_local OUTBASEPIXELPERF_ON + #pragma shader_feature_local COLORRAMPOUTLINE_ON + #pragma shader_feature_local GREYSCALEOUTLINE_ON + #pragma shader_feature_local POSTERIZEOUTLINE_ON + #pragma shader_feature_local BLURISHD_ON + #pragma shader_feature_local MANUALWIND_ON + #pragma shader_feature_local ATLAS_ON + #pragma shader_feature_local PREMULTIPLYALPHA_ON + + #pragma shader_feature BILBOARD_ON + #pragma shader_feature BILBOARDY_ON + + #pragma shader_feature NORMALMAP_ON + + + #define _STANDARD 1 +// If your looking in here and thinking WTF, yeah, I know. These are taken from the SRPs, to allow us to use the same +// texturing library they use. However, since they are not included in the standard pipeline by default, there is no +// way to include them in and they have to be inlined, since someone could copy this shader onto another machine without +// Better Shaders installed. Unfortunate, but I'd rather do this and have a nice library for texture sampling instead +// of the patchy one Unity provides being inlined/emulated in HDRP/URP. Strangely, PSSL and XBoxOne libraries are not +// included in the standard SRP code, but they are in tons of Unity own projects on the web, so I grabbed them from there. + +#if defined(SHADER_API_GAMECORE) + + #define ZERO_INITIALIZE(type, name) name = (type)0; + #define ZERO_INITIALIZE_ARRAY(type, name, arraySize) { for (int arrayIndex = 0; arrayIndex < arraySize; arrayIndex++) { name[arrayIndex] = (type)0; } } + + // Texture util abstraction + + #define CALCULATE_TEXTURE2D_LOD(textureName, samplerName, coord2) textureName.CalculateLevelOfDetail(samplerName, coord2) + + // Texture abstraction + + #define TEXTURE2D(textureName) Texture2D textureName + #define TEXTURE2D_ARRAY(textureName) Texture2DArray textureName + #define TEXTURECUBE(textureName) TextureCube textureName + #define TEXTURECUBE_ARRAY(textureName) TextureCubeArray textureName + #define TEXTURE3D(textureName) Texture3D textureName + + #define TEXTURE2D_FLOAT(textureName) TEXTURE2D(textureName) + #define TEXTURE2D_ARRAY_FLOAT(textureName) TEXTURE2D_ARRAY(textureName) + #define TEXTURECUBE_FLOAT(textureName) TEXTURECUBE(textureName) + #define TEXTURECUBE_ARRAY_FLOAT(textureName) TEXTURECUBE_ARRAY(textureName) + #define TEXTURE3D_FLOAT(textureName) TEXTURE3D(textureName) + + #define TEXTURE2D_HALF(textureName) TEXTURE2D(textureName) + #define TEXTURE2D_ARRAY_HALF(textureName) TEXTURE2D_ARRAY(textureName) + #define TEXTURECUBE_HALF(textureName) TEXTURECUBE(textureName) + #define TEXTURECUBE_ARRAY_HALF(textureName) TEXTURECUBE_ARRAY(textureName) + #define TEXTURE3D_HALF(textureName) TEXTURE3D(textureName) + + #define TEXTURE2D_SHADOW(textureName) TEXTURE2D(textureName) + #define TEXTURE2D_ARRAY_SHADOW(textureName) TEXTURE2D_ARRAY(textureName) + #define TEXTURECUBE_SHADOW(textureName) TEXTURECUBE(textureName) + #define TEXTURECUBE_ARRAY_SHADOW(textureName) TEXTURECUBE_ARRAY(textureName) + + #define RW_TEXTURE2D(type, textureName) RWTexture2D textureName + #define RW_TEXTURE2D_ARRAY(type, textureName) RWTexture2DArray textureName + #define RW_TEXTURE3D(type, textureName) RWTexture3D textureName + + #define SAMPLER(samplerName) SamplerState samplerName + #define SAMPLER_CMP(samplerName) SamplerComparisonState samplerName + #define ASSIGN_SAMPLER(samplerName, samplerValue) samplerName = samplerValue + + #define TEXTURE2D_PARAM(textureName, samplerName) TEXTURE2D(textureName), SAMPLER(samplerName) + #define TEXTURE2D_ARRAY_PARAM(textureName, samplerName) TEXTURE2D_ARRAY(textureName), SAMPLER(samplerName) + #define TEXTURECUBE_PARAM(textureName, samplerName) TEXTURECUBE(textureName), SAMPLER(samplerName) + #define TEXTURECUBE_ARRAY_PARAM(textureName, samplerName) TEXTURECUBE_ARRAY(textureName), SAMPLER(samplerName) + #define TEXTURE3D_PARAM(textureName, samplerName) TEXTURE3D(textureName), SAMPLER(samplerName) + + #define TEXTURE2D_SHADOW_PARAM(textureName, samplerName) TEXTURE2D(textureName), SAMPLER_CMP(samplerName) + #define TEXTURE2D_ARRAY_SHADOW_PARAM(textureName, samplerName) TEXTURE2D_ARRAY(textureName), SAMPLER_CMP(samplerName) + #define TEXTURECUBE_SHADOW_PARAM(textureName, samplerName) TEXTURECUBE(textureName), SAMPLER_CMP(samplerName) + #define TEXTURECUBE_ARRAY_SHADOW_PARAM(textureName, samplerName) TEXTURECUBE_ARRAY(textureName), SAMPLER_CMP(samplerName) + + #define TEXTURE2D_ARGS(textureName, samplerName) textureName, samplerName + #define TEXTURE2D_ARRAY_ARGS(textureName, samplerName) textureName, samplerName + #define TEXTURECUBE_ARGS(textureName, samplerName) textureName, samplerName + #define TEXTURECUBE_ARRAY_ARGS(textureName, samplerName) textureName, samplerName + #define TEXTURE3D_ARGS(textureName, samplerName) textureName, samplerName + + #define TEXTURE2D_SHADOW_ARGS(textureName, samplerName) textureName, samplerName + #define TEXTURE2D_ARRAY_SHADOW_ARGS(textureName, samplerName) textureName, samplerName + #define TEXTURECUBE_SHADOW_ARGS(textureName, samplerName) textureName, samplerName + #define TEXTURECUBE_ARRAY_SHADOW_ARGS(textureName, samplerName) textureName, samplerName + + #define PLATFORM_SAMPLE_TEXTURE2D(textureName, samplerName, coord2) textureName.Sample(samplerName, coord2) + #define PLATFORM_SAMPLE_TEXTURE2D_LOD(textureName, samplerName, coord2, lod) textureName.SampleLevel(samplerName, coord2, lod) + #define PLATFORM_SAMPLE_TEXTURE2D_BIAS(textureName, samplerName, coord2, bias) textureName.SampleBias(samplerName, coord2, bias) + #define PLATFORM_SAMPLE_TEXTURE2D_GRAD(textureName, samplerName, coord2, dpdx, dpdy) textureName.SampleGrad(samplerName, coord2, dpdx, dpdy) + #define PLATFORM_SAMPLE_TEXTURE2D_ARRAY(textureName, samplerName, coord2, index) textureName.Sample(samplerName, float3(coord2, index)) + #define PLATFORM_SAMPLE_TEXTURE2D_ARRAY_LOD(textureName, samplerName, coord2, index, lod) textureName.SampleLevel(samplerName, float3(coord2, index), lod) + #define PLATFORM_SAMPLE_TEXTURE2D_ARRAY_BIAS(textureName, samplerName, coord2, index, bias) textureName.SampleBias(samplerName, float3(coord2, index), bias) + #define PLATFORM_SAMPLE_TEXTURE2D_ARRAY_GRAD(textureName, samplerName, coord2, index, dpdx, dpdy) textureName.SampleGrad(samplerName, float3(coord2, index), dpdx, dpdy) + #define PLATFORM_SAMPLE_TEXTURECUBE(textureName, samplerName, coord3) textureName.Sample(samplerName, coord3) + #define PLATFORM_SAMPLE_TEXTURECUBE_LOD(textureName, samplerName, coord3, lod) textureName.SampleLevel(samplerName, coord3, lod) + #define PLATFORM_SAMPLE_TEXTURECUBE_BIAS(textureName, samplerName, coord3, bias) textureName.SampleBias(samplerName, coord3, bias) + #define PLATFORM_SAMPLE_TEXTURECUBE_ARRAY(textureName, samplerName, coord3, index) textureName.Sample(samplerName, float4(coord3, index)) + #define PLATFORM_SAMPLE_TEXTURECUBE_ARRAY_LOD(textureName, samplerName, coord3, index, lod) textureName.SampleLevel(samplerName, float4(coord3, index), lod) + #define PLATFORM_SAMPLE_TEXTURECUBE_ARRAY_BIAS(textureName, samplerName, coord3, index, bias) textureName.SampleBias(samplerName, float4(coord3, index), bias) + #define PLATFORM_SAMPLE_TEXTURE3D(textureName, samplerName, coord3) textureName.Sample(samplerName, coord3) + #define PLATFORM_SAMPLE_TEXTURE3D_LOD(textureName, samplerName, coord3, lod) textureName.SampleLevel(samplerName, coord3, lod) + + #define SAMPLE_TEXTURE2D(textureName, samplerName, coord2) PLATFORM_SAMPLE_TEXTURE2D(textureName, samplerName, coord2) + #define SAMPLE_TEXTURE2D_LOD(textureName, samplerName, coord2, lod) PLATFORM_SAMPLE_TEXTURE2D_LOD(textureName, samplerName, coord2, lod) + #define SAMPLE_TEXTURE2D_BIAS(textureName, samplerName, coord2, bias) PLATFORM_SAMPLE_TEXTURE2D_BIAS(textureName, samplerName, coord2, bias) + #define SAMPLE_TEXTURE2D_GRAD(textureName, samplerName, coord2, dpdx, dpdy) PLATFORM_SAMPLE_TEXTURE2D_GRAD(textureName, samplerName, coord2, dpdx, dpdy) + #define SAMPLE_TEXTURE2D_ARRAY(textureName, samplerName, coord2, index) PLATFORM_SAMPLE_TEXTURE2D_ARRAY(textureName, samplerName, coord2, index) + #define SAMPLE_TEXTURE2D_ARRAY_LOD(textureName, samplerName, coord2, index, lod) PLATFORM_SAMPLE_TEXTURE2D_ARRAY_LOD(textureName, samplerName, coord2, index, lod) + #define SAMPLE_TEXTURE2D_ARRAY_BIAS(textureName, samplerName, coord2, index, bias) PLATFORM_SAMPLE_TEXTURE2D_ARRAY_BIAS(textureName, samplerName, coord2, index, bias) + #define SAMPLE_TEXTURE2D_ARRAY_GRAD(textureName, samplerName, coord2, index, dpdx, dpdy) PLATFORM_SAMPLE_TEXTURE2D_ARRAY_GRAD(textureName, samplerName, coord2, index, dpdx, dpdy) + #define SAMPLE_TEXTURECUBE(textureName, samplerName, coord3) PLATFORM_SAMPLE_TEXTURECUBE(textureName, samplerName, coord3) + #define SAMPLE_TEXTURECUBE_LOD(textureName, samplerName, coord3, lod) PLATFORM_SAMPLE_TEXTURECUBE_LOD(textureName, samplerName, coord3, lod) + #define SAMPLE_TEXTURECUBE_BIAS(textureName, samplerName, coord3, bias) PLATFORM_SAMPLE_TEXTURECUBE_BIAS(textureName, samplerName, coord3, bias) + #define SAMPLE_TEXTURECUBE_ARRAY(textureName, samplerName, coord3, index) PLATFORM_SAMPLE_TEXTURECUBE_ARRAY(textureName, samplerName, coord3, index) + #define SAMPLE_TEXTURECUBE_ARRAY_LOD(textureName, samplerName, coord3, index, lod) PLATFORM_SAMPLE_TEXTURECUBE_ARRAY_LOD(textureName, samplerName, coord3, index, lod) + #define SAMPLE_TEXTURECUBE_ARRAY_BIAS(textureName, samplerName, coord3, index, bias) PLATFORM_SAMPLE_TEXTURECUBE_ARRAY_BIAS(textureName, samplerName, coord3, index, bias) + #define SAMPLE_TEXTURE3D(textureName, samplerName, coord3) PLATFORM_SAMPLE_TEXTURE3D(textureName, samplerName, coord3) + #define SAMPLE_TEXTURE3D_LOD(textureName, samplerName, coord3, lod) PLATFORM_SAMPLE_TEXTURE3D_LOD(textureName, samplerName, coord3, lod) + + #define SAMPLE_TEXTURE2D_SHADOW(textureName, samplerName, coord3) textureName.SampleCmpLevelZero(samplerName, (coord3).xy, (coord3).z) + #define SAMPLE_TEXTURE2D_ARRAY_SHADOW(textureName, samplerName, coord3, index) textureName.SampleCmpLevelZero(samplerName, float3((coord3).xy, index), (coord3).z) + #define SAMPLE_TEXTURECUBE_SHADOW(textureName, samplerName, coord4) textureName.SampleCmpLevelZero(samplerName, (coord4).xyz, (coord4).w) + #define SAMPLE_TEXTURECUBE_ARRAY_SHADOW(textureName, samplerName, coord4, index) textureName.SampleCmpLevelZero(samplerName, float4((coord4).xyz, index), (coord4).w) + + #define SAMPLE_DEPTH_TEXTURE(textureName, samplerName, coord2) SAMPLE_TEXTURE2D(textureName, samplerName, coord2).r + #define SAMPLE_DEPTH_TEXTURE_LOD(textureName, samplerName, coord2, lod) SAMPLE_TEXTURE2D_LOD(textureName, samplerName, coord2, lod).r + + #define LOAD_TEXTURE2D(textureName, unCoord2) textureName.Load(int3(unCoord2, 0)) + #define LOAD_TEXTURE2D_LOD(textureName, unCoord2, lod) textureName.Load(int3(unCoord2, lod)) + #define LOAD_TEXTURE2D_MSAA(textureName, unCoord2, sampleIndex) textureName.Load(unCoord2, sampleIndex) + #define LOAD_TEXTURE2D_ARRAY(textureName, unCoord2, index) textureName.Load(int4(unCoord2, index, 0)) + #define LOAD_TEXTURE2D_ARRAY_MSAA(textureName, unCoord2, index, sampleIndex) textureName.Load(int3(unCoord2, index), sampleIndex) + #define LOAD_TEXTURE2D_ARRAY_LOD(textureName, unCoord2, index, lod) textureName.Load(int4(unCoord2, index, lod)) + #define LOAD_TEXTURE3D(textureName, unCoord3) textureName.Load(int4(unCoord3, 0)) + #define LOAD_TEXTURE3D_LOD(textureName, unCoord3, lod) textureName.Load(int4(unCoord3, lod)) + + #define PLATFORM_SUPPORT_GATHER + #define GATHER_TEXTURE2D(textureName, samplerName, coord2) textureName.Gather(samplerName, coord2) + #define GATHER_TEXTURE2D_ARRAY(textureName, samplerName, coord2, index) textureName.Gather(samplerName, float3(coord2, index)) + #define GATHER_TEXTURECUBE(textureName, samplerName, coord3) textureName.Gather(samplerName, coord3) + #define GATHER_TEXTURECUBE_ARRAY(textureName, samplerName, coord3, index) textureName.Gather(samplerName, float4(coord3, index)) + #define GATHER_RED_TEXTURE2D(textureName, samplerName, coord2) textureName.GatherRed(samplerName, coord2) + #define GATHER_GREEN_TEXTURE2D(textureName, samplerName, coord2) textureName.GatherGreen(samplerName, coord2) + #define GATHER_BLUE_TEXTURE2D(textureName, samplerName, coord2) textureName.GatherBlue(samplerName, coord2) + #define GATHER_ALPHA_TEXTURE2D(textureName, samplerName, coord2) textureName.GatherAlpha(samplerName, coord2) + + +#elif defined(SHADER_API_XBOXONE) + + // Initialize arbitrary structure with zero values. + // Do not exist on some platform, in this case we need to have a standard name that call a function that will initialize all parameters to 0 + #define ZERO_INITIALIZE(type, name) name = (type)0; + #define ZERO_INITIALIZE_ARRAY(type, name, arraySize) { for (int arrayIndex = 0; arrayIndex < arraySize; arrayIndex++) { name[arrayIndex] = (type)0; } } + + // Texture util abstraction + + #define CALCULATE_TEXTURE2D_LOD(textureName, samplerName, coord2) textureName.CalculateLevelOfDetail(samplerName, coord2) + + // Texture abstraction + + #define TEXTURE2D(textureName) Texture2D textureName + #define TEXTURE2D_ARRAY(textureName) Texture2DArray textureName + #define TEXTURECUBE(textureName) TextureCube textureName + #define TEXTURECUBE_ARRAY(textureName) TextureCubeArray textureName + #define TEXTURE3D(textureName) Texture3D textureName + + #define TEXTURE2D_FLOAT(textureName) TEXTURE2D(textureName) + #define TEXTURE2D_ARRAY_FLOAT(textureName) TEXTURE2D_ARRAY(textureName) + #define TEXTURECUBE_FLOAT(textureName) TEXTURECUBE(textureName) + #define TEXTURECUBE_ARRAY_FLOAT(textureName) TEXTURECUBE_ARRAY(textureName) + #define TEXTURE3D_FLOAT(textureName) TEXTURE3D(textureName) + + #define TEXTURE2D_HALF(textureName) TEXTURE2D(textureName) + #define TEXTURE2D_ARRAY_HALF(textureName) TEXTURE2D_ARRAY(textureName) + #define TEXTURECUBE_HALF(textureName) TEXTURECUBE(textureName) + #define TEXTURECUBE_ARRAY_HALF(textureName) TEXTURECUBE_ARRAY(textureName) + #define TEXTURE3D_HALF(textureName) TEXTURE3D(textureName) + + #define TEXTURE2D_SHADOW(textureName) TEXTURE2D(textureName) + #define TEXTURE2D_ARRAY_SHADOW(textureName) TEXTURE2D_ARRAY(textureName) + #define TEXTURECUBE_SHADOW(textureName) TEXTURECUBE(textureName) + #define TEXTURECUBE_ARRAY_SHADOW(textureName) TEXTURECUBE_ARRAY(textureName) + + #define RW_TEXTURE2D(type, textureName) RWTexture2D textureName + #define RW_TEXTURE2D_ARRAY(type, textureName) RWTexture2DArray textureName + #define RW_TEXTURE3D(type, textureName) RWTexture3D textureName + + #define SAMPLER(samplerName) SamplerState samplerName + #define SAMPLER_CMP(samplerName) SamplerComparisonState samplerName + + #define TEXTURE2D_PARAM(textureName, samplerName) TEXTURE2D(textureName), SAMPLER(samplerName) + #define TEXTURE2D_ARRAY_PARAM(textureName, samplerName) TEXTURE2D_ARRAY(textureName), SAMPLER(samplerName) + #define TEXTURECUBE_PARAM(textureName, samplerName) TEXTURECUBE(textureName), SAMPLER(samplerName) + #define TEXTURECUBE_ARRAY_PARAM(textureName, samplerName) TEXTURECUBE_ARRAY(textureName), SAMPLER(samplerName) + #define TEXTURE3D_PARAM(textureName, samplerName) TEXTURE3D(textureName), SAMPLER(samplerName) + + #define TEXTURE2D_SHADOW_PARAM(textureName, samplerName) TEXTURE2D(textureName), SAMPLER_CMP(samplerName) + #define TEXTURE2D_ARRAY_SHADOW_PARAM(textureName, samplerName) TEXTURE2D_ARRAY(textureName), SAMPLER_CMP(samplerName) + #define TEXTURECUBE_SHADOW_PARAM(textureName, samplerName) TEXTURECUBE(textureName), SAMPLER_CMP(samplerName) + #define TEXTURECUBE_ARRAY_SHADOW_PARAM(textureName, samplerName) TEXTURECUBE_ARRAY(textureName), SAMPLER_CMP(samplerName) + + #define TEXTURE2D_ARGS(textureName, samplerName) textureName, samplerName + #define TEXTURE2D_ARRAY_ARGS(textureName, samplerName) textureName, samplerName + #define TEXTURECUBE_ARGS(textureName, samplerName) textureName, samplerName + #define TEXTURECUBE_ARRAY_ARGS(textureName, samplerName) textureName, samplerName + #define TEXTURE3D_ARGS(textureName, samplerName) textureName, samplerName + + #define TEXTURE2D_SHADOW_ARGS(textureName, samplerName) textureName, samplerName + #define TEXTURE2D_ARRAY_SHADOW_ARGS(textureName, samplerName) textureName, samplerName + #define TEXTURECUBE_SHADOW_ARGS(textureName, samplerName) textureName, samplerName + #define TEXTURECUBE_ARRAY_SHADOW_ARGS(textureName, samplerName) textureName, samplerName + + #define SAMPLE_TEXTURE2D(textureName, samplerName, coord2) textureName.Sample(samplerName, coord2) + #define SAMPLE_TEXTURE2D_LOD(textureName, samplerName, coord2, lod) textureName.SampleLevel(samplerName, coord2, lod) + #define SAMPLE_TEXTURE2D_BIAS(textureName, samplerName, coord2, bias) textureName.SampleBias(samplerName, coord2, bias) + #define SAMPLE_TEXTURE2D_GRAD(textureName, samplerName, coord2, dpdx, dpdy) textureName.SampleGrad(samplerName, coord2, dpdx, dpdy) + #define SAMPLE_TEXTURE2D_ARRAY(textureName, samplerName, coord2, index) textureName.Sample(samplerName, float3(coord2, index)) + #define SAMPLE_TEXTURE2D_ARRAY_LOD(textureName, samplerName, coord2, index, lod) textureName.SampleLevel(samplerName, float3(coord2, index), lod) + #define SAMPLE_TEXTURE2D_ARRAY_BIAS(textureName, samplerName, coord2, index, bias) textureName.SampleBias(samplerName, float3(coord2, index), bias) + #define SAMPLE_TEXTURE2D_ARRAY_GRAD(textureName, samplerName, coord2, index, dpdx, dpdy) textureName.SampleGrad(samplerName, float3(coord2, index), dpdx, dpdy) + #define SAMPLE_TEXTURECUBE(textureName, samplerName, coord3) textureName.Sample(samplerName, coord3) + #define SAMPLE_TEXTURECUBE_LOD(textureName, samplerName, coord3, lod) textureName.SampleLevel(samplerName, coord3, lod) + #define SAMPLE_TEXTURECUBE_BIAS(textureName, samplerName, coord3, bias) textureName.SampleBias(samplerName, coord3, bias) + #define SAMPLE_TEXTURECUBE_ARRAY(textureName, samplerName, coord3, index) textureName.Sample(samplerName, float4(coord3, index)) + #define SAMPLE_TEXTURECUBE_ARRAY_LOD(textureName, samplerName, coord3, index, lod) textureName.SampleLevel(samplerName, float4(coord3, index), lod) + #define SAMPLE_TEXTURECUBE_ARRAY_BIAS(textureName, samplerName, coord3, index, bias) textureName.SampleBias(samplerName, float4(coord3, index), bias) + #define SAMPLE_TEXTURE3D(textureName, samplerName, coord3) textureName.Sample(samplerName, coord3) + #define SAMPLE_TEXTURE3D_LOD(textureName, samplerName, coord3, lod) textureName.SampleLevel(samplerName, coord3, lod) + + #define SAMPLE_TEXTURE2D_SHADOW(textureName, samplerName, coord3) textureName.SampleCmpLevelZero(samplerName, (coord3).xy, (coord3).z) + #define SAMPLE_TEXTURE2D_ARRAY_SHADOW(textureName, samplerName, coord3, index) textureName.SampleCmpLevelZero(samplerName, float3((coord3).xy, index), (coord3).z) + #define SAMPLE_TEXTURECUBE_SHADOW(textureName, samplerName, coord4) textureName.SampleCmpLevelZero(samplerName, (coord4).xyz, (coord4).w) + #define SAMPLE_TEXTURECUBE_ARRAY_SHADOW(textureName, samplerName, coord4, index) textureName.SampleCmpLevelZero(samplerName, float4((coord4).xyz, index), (coord4).w) + + #define LOAD_TEXTURE2D(textureName, unCoord2) textureName.Load(int3(unCoord2, 0)) + #define LOAD_TEXTURE2D_LOD(textureName, unCoord2, lod) textureName.Load(int3(unCoord2, lod)) + #define LOAD_TEXTURE2D_MSAA(textureName, unCoord2, sampleIndex) textureName.Load(unCoord2, sampleIndex) + #define LOAD_TEXTURE2D_ARRAY(textureName, unCoord2, index) textureName.Load(int4(unCoord2, index, 0)) + #define LOAD_TEXTURE2D_ARRAY_MSAA(textureName, unCoord2, index, sampleIndex) textureName.Load(int3(unCoord2, index), sampleIndex) + #define LOAD_TEXTURE2D_ARRAY_LOD(textureName, unCoord2, index, lod) textureName.Load(int4(unCoord2, index, lod)) + #define LOAD_TEXTURE3D(textureName, unCoord3) textureName.Load(int4(unCoord3, 0)) + #define LOAD_TEXTURE3D_LOD(textureName, unCoord3, lod) textureName.Load(int4(unCoord3, lod)) + + #define PLATFORM_SUPPORT_GATHER + #define GATHER_TEXTURE2D(textureName, samplerName, coord2) textureName.Gather(samplerName, coord2) + #define GATHER_TEXTURE2D_ARRAY(textureName, samplerName, coord2, index) textureName.Gather(samplerName, float3(coord2, index)) + #define GATHER_TEXTURECUBE(textureName, samplerName, coord3) textureName.Gather(samplerName, coord3) + #define GATHER_TEXTURECUBE_ARRAY(textureName, samplerName, coord3, index) textureName.Gather(samplerName, float4(coord3, index)) + #define GATHER_RED_TEXTURE2D(textureName, samplerName, coord2) textureName.GatherRed(samplerName, coord2) + #define GATHER_GREEN_TEXTURE2D(textureName, samplerName, coord2) textureName.GatherGreen(samplerName, coord2) + #define GATHER_BLUE_TEXTURE2D(textureName, samplerName, coord2) textureName.GatherBlue(samplerName, coord2) + #define GATHER_ALPHA_TEXTURE2D(textureName, samplerName, coord2) textureName.GatherAlpha(samplerName, coord2) + + +#elif defined(SHADER_API_PSSL) + + // Initialize arbitrary structure with zero values. + // Do not exist on some platform, in this case we need to have a standard name that call a function that will initialize all parameters to 0 + #define ZERO_INITIALIZE(type, name) name = (type)0; + #define ZERO_INITIALIZE_ARRAY(type, name, arraySize) { for (int arrayIndex = 0; arrayIndex < arraySize; arrayIndex++) { name[arrayIndex] = (type)0; } } + + // Texture util abstraction + + #define CALCULATE_TEXTURE2D_LOD(textureName, samplerName, coord2) textureName.GetLOD(samplerName, coord2) + + // Texture abstraction + + #define TEXTURE2D(textureName) Texture2D textureName + #define TEXTURE2D_ARRAY(textureName) Texture2DArray textureName + #define TEXTURECUBE(textureName) TextureCube textureName + #define TEXTURECUBE_ARRAY(textureName) TextureCubeArray textureName + #define TEXTURE3D(textureName) Texture3D textureName + + #define TEXTURE2D_FLOAT(textureName) TEXTURE2D(textureName) + #define TEXTURE2D_ARRAY_FLOAT(textureName) TEXTURE2D_ARRAY(textureName) + #define TEXTURECUBE_FLOAT(textureName) TEXTURECUBE(textureName) + #define TEXTURECUBE_ARRAY_FLOAT(textureName) TEXTURECUBE_ARRAY(textureName) + #define TEXTURE3D_FLOAT(textureName) TEXTURE3D(textureName) + + #define TEXTURE2D_HALF(textureName) TEXTURE2D(textureName) + #define TEXTURE2D_ARRAY_HALF(textureName) TEXTURE2D_ARRAY(textureName) + #define TEXTURECUBE_HALF(textureName) TEXTURECUBE(textureName) + #define TEXTURECUBE_ARRAY_HALF(textureName) TEXTURECUBE_ARRAY(textureName) + #define TEXTURE3D_HALF(textureName) TEXTURE3D(textureName) + + #define TEXTURE2D_SHADOW(textureName) TEXTURE2D(textureName) + #define TEXTURE2D_ARRAY_SHADOW(textureName) TEXTURE2D_ARRAY(textureName) + #define TEXTURECUBE_SHADOW(textureName) TEXTURECUBE(textureName) + #define TEXTURECUBE_ARRAY_SHADOW(textureName) TEXTURECUBE_ARRAY(textureName) + + #define RW_TEXTURE2D(type, textureName) RW_Texture2D textureName + #define RW_TEXTURE2D_ARRAY(type, textureName) RW_Texture2D_Array textureName + #define RW_TEXTURE3D(type, textureName) RW_Texture3D textureName + + #define SAMPLER(samplerName) SamplerState samplerName + #define SAMPLER_CMP(samplerName) SamplerComparisonState samplerName + + #define TEXTURE2D_PARAM(textureName, samplerName) TEXTURE2D(textureName), SAMPLER(samplerName) + #define TEXTURE2D_ARRAY_PARAM(textureName, samplerName) TEXTURE2D_ARRAY(textureName), SAMPLER(samplerName) + #define TEXTURECUBE_PARAM(textureName, samplerName) TEXTURECUBE(textureName), SAMPLER(samplerName) + #define TEXTURECUBE_ARRAY_PARAM(textureName, samplerName) TEXTURECUBE_ARRAY(textureName), SAMPLER(samplerName) + #define TEXTURE3D_PARAM(textureName, samplerName) TEXTURE3D(textureName), SAMPLER(samplerName) + + #define TEXTURE2D_SHADOW_PARAM(textureName, samplerName) TEXTURE2D(textureName), SAMPLER_CMP(samplerName) + #define TEXTURE2D_ARRAY_SHADOW_PARAM(textureName, samplerName) TEXTURE2D_ARRAY(textureName), SAMPLER_CMP(samplerName) + #define TEXTURECUBE_SHADOW_PARAM(textureName, samplerName) TEXTURECUBE(textureName), SAMPLER_CMP(samplerName) + #define TEXTURECUBE_ARRAY_SHADOW_PARAM(textureName, samplerName) TEXTURECUBE_ARRAY(textureName), SAMPLER_CMP(samplerName) + + #define TEXTURE2D_ARGS(textureName, samplerName) textureName, samplerName + #define TEXTURE2D_ARRAY_ARGS(textureName, samplerName) textureName, samplerName + #define TEXTURECUBE_ARGS(textureName, samplerName) textureName, samplerName + #define TEXTURECUBE_ARRAY_ARGS(textureName, samplerName) textureName, samplerName + #define TEXTURE3D_ARGS(textureName, samplerName) textureName, samplerName + + #define TEXTURE2D_SHADOW_ARGS(textureName, samplerName) textureName, samplerName + #define TEXTURE2D_ARRAY_SHADOW_ARGS(textureName, samplerName) textureName, samplerName + #define TEXTURECUBE_SHADOW_ARGS(textureName, samplerName) textureName, samplerName + #define TEXTURECUBE_ARRAY_SHADOW_ARGS(textureName, samplerName) textureName, samplerName + + #define SAMPLE_TEXTURE2D(textureName, samplerName, coord2) textureName.Sample(samplerName, coord2) + #define SAMPLE_TEXTURE2D_LOD(textureName, samplerName, coord2, lod) textureName.SampleLevel(samplerName, coord2, lod) + #define SAMPLE_TEXTURE2D_BIAS(textureName, samplerName, coord2, bias) textureName.SampleBias(samplerName, coord2, bias) + #define SAMPLE_TEXTURE2D_GRAD(textureName, samplerName, coord2, dpdx, dpdy) textureName.SampleGrad(samplerName, coord2, dpdx, dpdy) + #define SAMPLE_TEXTURE2D_ARRAY(textureName, samplerName, coord2, index) textureName.Sample(samplerName, float3(coord2, index)) + #define SAMPLE_TEXTURE2D_ARRAY_LOD(textureName, samplerName, coord2, index, lod) textureName.SampleLevel(samplerName, float3(coord2, index), lod) + #define SAMPLE_TEXTURE2D_ARRAY_BIAS(textureName, samplerName, coord2, index, bias) textureName.SampleBias(samplerName, float3(coord2, index), bias) + #define SAMPLE_TEXTURE2D_ARRAY_GRAD(textureName, samplerName, coord2, index, dpdx, dpdy) textureName.SampleGrad(samplerName, float3(coord2, index), dpdx, dpdy) + #define SAMPLE_TEXTURECUBE(textureName, samplerName, coord3) textureName.Sample(samplerName, coord3) + #define SAMPLE_TEXTURECUBE_LOD(textureName, samplerName, coord3, lod) textureName.SampleLevel(samplerName, coord3, lod) + #define SAMPLE_TEXTURECUBE_BIAS(textureName, samplerName, coord3, bias) textureName.SampleBias(samplerName, coord3, bias) + #define SAMPLE_TEXTURECUBE_ARRAY(textureName, samplerName, coord3, index) textureName.Sample(samplerName, float4(coord3, index)) + #define SAMPLE_TEXTURECUBE_ARRAY_LOD(textureName, samplerName, coord3, index, lod) textureName.SampleLevel(samplerName, float4(coord3, index), lod) + #define SAMPLE_TEXTURECUBE_ARRAY_BIAS(textureName, samplerName, coord3, index, bias) textureName.SampleBias(samplerName, float4(coord3, index), bias) + #define SAMPLE_TEXTURE3D(textureName, samplerName, coord3) textureName.Sample(samplerName, coord3) + #define SAMPLE_TEXTURE3D_LOD(textureName, samplerName, coord3, lod) textureName.SampleLevel(samplerName, coord3, lod) + + #define SAMPLE_TEXTURE2D_SHADOW(textureName, samplerName, coord3) textureName.SampleCmpLevelZero(samplerName, (coord3).xy, (coord3).z) + #define SAMPLE_TEXTURE2D_ARRAY_SHADOW(textureName, samplerName, coord3, index) textureName.SampleCmpLevelZero(samplerName, float3((coord3).xy, index), (coord3).z) + #define SAMPLE_TEXTURECUBE_SHADOW(textureName, samplerName, coord4) textureName.SampleCmpLevelZero(samplerName, (coord4).xyz, (coord4).w) + #define SAMPLE_TEXTURECUBE_ARRAY_SHADOW(textureName, samplerName, coord4, index) textureName.SampleCmpLevelZero(samplerName, float4((coord4).xyz, index), (coord4).w) + + #define LOAD_TEXTURE2D(textureName, unCoord2) textureName.Load(int3(unCoord2, 0)) + #define LOAD_TEXTURE2D_LOD(textureName, unCoord2, lod) textureName.Load(int3(unCoord2, lod)) + #define LOAD_TEXTURE2D_MSAA(textureName, unCoord2, sampleIndex) textureName.Load(unCoord2, sampleIndex) + #define LOAD_TEXTURE2D_ARRAY(textureName, unCoord2, index) textureName.Load(int4(unCoord2, index, 0)) + #define LOAD_TEXTURE2D_ARRAY_MSAA(textureName, unCoord2, index, sampleIndex) textureName.Load(int3(unCoord2, index), sampleIndex) + #define LOAD_TEXTURE2D_ARRAY_LOD(textureName, unCoord2, index, lod) textureName.Load(int4(unCoord2, index, lod)) + #define LOAD_TEXTURE3D(textureName, unCoord3) textureName.Load(int4(unCoord3, 0)) + #define LOAD_TEXTURE3D_LOD(textureName, unCoord3, lod) textureName.Load(int4(unCoord3, lod)) + + #define PLATFORM_SUPPORT_GATHER + #define GATHER_TEXTURE2D(textureName, samplerName, coord2) textureName.Gather(samplerName, coord2) + #define GATHER_TEXTURE2D_ARRAY(textureName, samplerName, coord2, index) textureName.Gather(samplerName, float3(coord2, index)) + #define GATHER_TEXTURECUBE(textureName, samplerName, coord3) textureName.Gather(samplerName, coord3) + #define GATHER_TEXTURECUBE_ARRAY(textureName, samplerName, coord3, index) textureName.Gather(samplerName, float4(coord3, index)) + #define GATHER_RED_TEXTURE2D(textureName, samplerName, coord2) textureName.GatherRed(samplerName, coord2) + #define GATHER_GREEN_TEXTURE2D(textureName, samplerName, coord2) textureName.GatherGreen(samplerName, coord2) + #define GATHER_BLUE_TEXTURE2D(textureName, samplerName, coord2) textureName.GatherBlue(samplerName, coord2) + #define GATHER_ALPHA_TEXTURE2D(textureName, samplerName, coord2) textureName.GatherAlpha(samplerName, coord2) + + + +#elif defined(SHADER_API_D3D11) + + // Initialize arbitrary structure with zero values. + // Do not exist on some platform, in this case we need to have a standard name that call a function that will initialize all parameters to 0 + #define ZERO_INITIALIZE(type, name) name = (type)0; + #define ZERO_INITIALIZE_ARRAY(type, name, arraySize) { for (int arrayIndex = 0; arrayIndex < arraySize; arrayIndex++) { name[arrayIndex] = (type)0; } } + + // Texture util abstraction + + #define CALCULATE_TEXTURE2D_LOD(textureName, samplerName, coord2) textureName.CalculateLevelOfDetail(samplerName, coord2) + + // Texture abstraction + + #define TEXTURE2D(textureName) Texture2D textureName + #define TEXTURE2D_ARRAY(textureName) Texture2DArray textureName + #define TEXTURECUBE(textureName) TextureCube textureName + #define TEXTURECUBE_ARRAY(textureName) TextureCubeArray textureName + #define TEXTURE3D(textureName) Texture3D textureName + + #define TEXTURE2D_FLOAT(textureName) TEXTURE2D(textureName) + #define TEXTURE2D_ARRAY_FLOAT(textureName) TEXTURE2D_ARRAY(textureName) + #define TEXTURECUBE_FLOAT(textureName) TEXTURECUBE(textureName) + #define TEXTURECUBE_ARRAY_FLOAT(textureName) TEXTURECUBE_ARRAY(textureName) + #define TEXTURE3D_FLOAT(textureName) TEXTURE3D(textureName) + + #define TEXTURE2D_HALF(textureName) TEXTURE2D(textureName) + #define TEXTURE2D_ARRAY_HALF(textureName) TEXTURE2D_ARRAY(textureName) + #define TEXTURECUBE_HALF(textureName) TEXTURECUBE(textureName) + #define TEXTURECUBE_ARRAY_HALF(textureName) TEXTURECUBE_ARRAY(textureName) + #define TEXTURE3D_HALF(textureName) TEXTURE3D(textureName) + + #define TEXTURE2D_SHADOW(textureName) TEXTURE2D(textureName) + #define TEXTURE2D_ARRAY_SHADOW(textureName) TEXTURE2D_ARRAY(textureName) + #define TEXTURECUBE_SHADOW(textureName) TEXTURECUBE(textureName) + #define TEXTURECUBE_ARRAY_SHADOW(textureName) TEXTURECUBE_ARRAY(textureName) + + #define RW_TEXTURE2D(type, textureName) RWTexture2D textureName + #define RW_TEXTURE2D_ARRAY(type, textureName) RWTexture2DArray textureName + #define RW_TEXTURE3D(type, textureName) RWTexture3D textureName + + #define SAMPLER(samplerName) SamplerState samplerName + #define SAMPLER_CMP(samplerName) SamplerComparisonState samplerName + + #define TEXTURE2D_PARAM(textureName, samplerName) TEXTURE2D(textureName), SAMPLER(samplerName) + #define TEXTURE2D_ARRAY_PARAM(textureName, samplerName) TEXTURE2D_ARRAY(textureName), SAMPLER(samplerName) + #define TEXTURECUBE_PARAM(textureName, samplerName) TEXTURECUBE(textureName), SAMPLER(samplerName) + #define TEXTURECUBE_ARRAY_PARAM(textureName, samplerName) TEXTURECUBE_ARRAY(textureName), SAMPLER(samplerName) + #define TEXTURE3D_PARAM(textureName, samplerName) TEXTURE3D(textureName), SAMPLER(samplerName) + + #define TEXTURE2D_SHADOW_PARAM(textureName, samplerName) TEXTURE2D(textureName), SAMPLER_CMP(samplerName) + #define TEXTURE2D_ARRAY_SHADOW_PARAM(textureName, samplerName) TEXTURE2D_ARRAY(textureName), SAMPLER_CMP(samplerName) + #define TEXTURECUBE_SHADOW_PARAM(textureName, samplerName) TEXTURECUBE(textureName), SAMPLER_CMP(samplerName) + #define TEXTURECUBE_ARRAY_SHADOW_PARAM(textureName, samplerName) TEXTURECUBE_ARRAY(textureName), SAMPLER_CMP(samplerName) + + #define TEXTURE2D_ARGS(textureName, samplerName) textureName, samplerName + #define TEXTURE2D_ARRAY_ARGS(textureName, samplerName) textureName, samplerName + #define TEXTURECUBE_ARGS(textureName, samplerName) textureName, samplerName + #define TEXTURECUBE_ARRAY_ARGS(textureName, samplerName) textureName, samplerName + #define TEXTURE3D_ARGS(textureName, samplerName) textureName, samplerName + + #define TEXTURE2D_SHADOW_ARGS(textureName, samplerName) textureName, samplerName + #define TEXTURE2D_ARRAY_SHADOW_ARGS(textureName, samplerName) textureName, samplerName + #define TEXTURECUBE_SHADOW_ARGS(textureName, samplerName) textureName, samplerName + #define TEXTURECUBE_ARRAY_SHADOW_ARGS(textureName, samplerName) textureName, samplerName + + #define SAMPLE_TEXTURE2D(textureName, samplerName, coord2) textureName.Sample(samplerName, coord2) + #define SAMPLE_TEXTURE2D_LOD(textureName, samplerName, coord2, lod) textureName.SampleLevel(samplerName, coord2, lod) + #define SAMPLE_TEXTURE2D_BIAS(textureName, samplerName, coord2, bias) textureName.SampleBias(samplerName, coord2, bias) + #define SAMPLE_TEXTURE2D_GRAD(textureName, samplerName, coord2, dpdx, dpdy) textureName.SampleGrad(samplerName, coord2, dpdx, dpdy) + #define SAMPLE_TEXTURE2D_ARRAY(textureName, samplerName, coord2, index) textureName.Sample(samplerName, float3(coord2, index)) + #define SAMPLE_TEXTURE2D_ARRAY_LOD(textureName, samplerName, coord2, index, lod) textureName.SampleLevel(samplerName, float3(coord2, index), lod) + #define SAMPLE_TEXTURE2D_ARRAY_BIAS(textureName, samplerName, coord2, index, bias) textureName.SampleBias(samplerName, float3(coord2, index), bias) + #define SAMPLE_TEXTURE2D_ARRAY_GRAD(textureName, samplerName, coord2, index, dpdx, dpdy) textureName.SampleGrad(samplerName, float3(coord2, index), dpdx, dpdy) + #define SAMPLE_TEXTURECUBE(textureName, samplerName, coord3) textureName.Sample(samplerName, coord3) + #define SAMPLE_TEXTURECUBE_LOD(textureName, samplerName, coord3, lod) textureName.SampleLevel(samplerName, coord3, lod) + #define SAMPLE_TEXTURECUBE_BIAS(textureName, samplerName, coord3, bias) textureName.SampleBias(samplerName, coord3, bias) + #define SAMPLE_TEXTURECUBE_ARRAY(textureName, samplerName, coord3, index) textureName.Sample(samplerName, float4(coord3, index)) + #define SAMPLE_TEXTURECUBE_ARRAY_LOD(textureName, samplerName, coord3, index, lod) textureName.SampleLevel(samplerName, float4(coord3, index), lod) + #define SAMPLE_TEXTURECUBE_ARRAY_BIAS(textureName, samplerName, coord3, index, bias) textureName.SampleBias(samplerName, float4(coord3, index), bias) + #define SAMPLE_TEXTURE3D(textureName, samplerName, coord3) textureName.Sample(samplerName, coord3) + #define SAMPLE_TEXTURE3D_LOD(textureName, samplerName, coord3, lod) textureName.SampleLevel(samplerName, coord3, lod) + + #define SAMPLE_TEXTURE2D_SHADOW(textureName, samplerName, coord3) textureName.SampleCmpLevelZero(samplerName, (coord3).xy, (coord3).z) + #define SAMPLE_TEXTURE2D_ARRAY_SHADOW(textureName, samplerName, coord3, index) textureName.SampleCmpLevelZero(samplerName, float3((coord3).xy, index), (coord3).z) + #define SAMPLE_TEXTURECUBE_SHADOW(textureName, samplerName, coord4) textureName.SampleCmpLevelZero(samplerName, (coord4).xyz, (coord4).w) + #define SAMPLE_TEXTURECUBE_ARRAY_SHADOW(textureName, samplerName, coord4, index) textureName.SampleCmpLevelZero(samplerName, float4((coord4).xyz, index), (coord4).w) + + #define LOAD_TEXTURE2D(textureName, unCoord2) textureName.Load(int3(unCoord2, 0)) + #define LOAD_TEXTURE2D_LOD(textureName, unCoord2, lod) textureName.Load(int3(unCoord2, lod)) + #define LOAD_TEXTURE2D_MSAA(textureName, unCoord2, sampleIndex) textureName.Load(unCoord2, sampleIndex) + #define LOAD_TEXTURE2D_ARRAY(textureName, unCoord2, index) textureName.Load(int4(unCoord2, index, 0)) + #define LOAD_TEXTURE2D_ARRAY_MSAA(textureName, unCoord2, index, sampleIndex) textureName.Load(int3(unCoord2, index), sampleIndex) + #define LOAD_TEXTURE2D_ARRAY_LOD(textureName, unCoord2, index, lod) textureName.Load(int4(unCoord2, index, lod)) + #define LOAD_TEXTURE3D(textureName, unCoord3) textureName.Load(int4(unCoord3, 0)) + #define LOAD_TEXTURE3D_LOD(textureName, unCoord3, lod) textureName.Load(int4(unCoord3, lod)) + + #define PLATFORM_SUPPORT_GATHER + #define GATHER_TEXTURE2D(textureName, samplerName, coord2) textureName.Gather(samplerName, coord2) + #define GATHER_TEXTURE2D_ARRAY(textureName, samplerName, coord2, index) textureName.Gather(samplerName, float3(coord2, index)) + #define GATHER_TEXTURECUBE(textureName, samplerName, coord3) textureName.Gather(samplerName, coord3) + #define GATHER_TEXTURECUBE_ARRAY(textureName, samplerName, coord3, index) textureName.Gather(samplerName, float4(coord3, index)) + #define GATHER_RED_TEXTURE2D(textureName, samplerName, coord2) textureName.GatherRed(samplerName, coord2) + #define GATHER_GREEN_TEXTURE2D(textureName, samplerName, coord2) textureName.GatherGreen(samplerName, coord2) + #define GATHER_BLUE_TEXTURE2D(textureName, samplerName, coord2) textureName.GatherBlue(samplerName, coord2) + #define GATHER_ALPHA_TEXTURE2D(textureName, samplerName, coord2) textureName.GatherAlpha(samplerName, coord2) + +#elif defined(SHADER_API_METAL) + + // Initialize arbitrary structure with zero values. + // Do not exist on some platform, in this case we need to have a standard name that call a function that will initialize all parameters to 0 + #define ZERO_INITIALIZE(type, name) name = (type)0; + #define ZERO_INITIALIZE_ARRAY(type, name, arraySize) { for (int arrayIndex = 0; arrayIndex < arraySize; arrayIndex++) { name[arrayIndex] = (type)0; } } + + // Texture util abstraction + + #define CALCULATE_TEXTURE2D_LOD(textureName, samplerName, coord2) textureName.CalculateLevelOfDetail(samplerName, coord2) + + // Texture abstraction + + #define TEXTURE2D(textureName) Texture2D textureName + #define TEXTURE2D_ARRAY(textureName) Texture2DArray textureName + #define TEXTURECUBE(textureName) TextureCube textureName + #define TEXTURECUBE_ARRAY(textureName) TextureCubeArray textureName + #define TEXTURE3D(textureName) Texture3D textureName + + #define TEXTURE2D_FLOAT(textureName) Texture2D_float textureName + #define TEXTURE2D_ARRAY_FLOAT(textureName) Texture2DArray textureName // no support to _float on Array, it's being added + #define TEXTURECUBE_FLOAT(textureName) TextureCube_float textureName + #define TEXTURECUBE_ARRAY_FLOAT(textureName) TextureCubeArray textureName // no support to _float on Array, it's being added + #define TEXTURE3D_FLOAT(textureName) Texture3D_float textureName + + #define TEXTURE2D_HALF(textureName) Texture2D_half textureName + #define TEXTURE2D_ARRAY_HALF(textureName) Texture2DArray textureName // no support to _float on Array, it's being added + #define TEXTURECUBE_HALF(textureName) TextureCube_half textureName + #define TEXTURECUBE_ARRAY_HALF(textureName) TextureCubeArray textureName // no support to _float on Array, it's being added + #define TEXTURE3D_HALF(textureName) Texture3D_half textureName + + #define TEXTURE2D_SHADOW(textureName) TEXTURE2D(textureName) + #define TEXTURE2D_ARRAY_SHADOW(textureName) TEXTURE2D_ARRAY(textureName) + #define TEXTURECUBE_SHADOW(textureName) TEXTURECUBE(textureName) + #define TEXTURECUBE_ARRAY_SHADOW(textureName) TEXTURECUBE_ARRAY(textureName) + + #define RW_TEXTURE2D(type, textureName) RWTexture2D textureName + #define RW_TEXTURE2D_ARRAY(type, textureName) RWTexture2DArray textureName + #define RW_TEXTURE3D(type, textureName) RWTexture3D textureName + + #define SAMPLER(samplerName) SamplerState samplerName + #define SAMPLER_CMP(samplerName) SamplerComparisonState samplerName + + #define TEXTURE2D_PARAM(textureName, samplerName) TEXTURE2D(textureName), SAMPLER(samplerName) + #define TEXTURE2D_ARRAY_PARAM(textureName, samplerName) TEXTURE2D_ARRAY(textureName), SAMPLER(samplerName) + #define TEXTURECUBE_PARAM(textureName, samplerName) TEXTURECUBE(textureName), SAMPLER(samplerName) + #define TEXTURECUBE_ARRAY_PARAM(textureName, samplerName) TEXTURECUBE_ARRAY(textureName), SAMPLER(samplerName) + #define TEXTURE3D_PARAM(textureName, samplerName) TEXTURE3D(textureName), SAMPLER(samplerName) + + #define TEXTURE2D_SHADOW_PARAM(textureName, samplerName) TEXTURE2D(textureName), SAMPLER_CMP(samplerName) + #define TEXTURE2D_ARRAY_SHADOW_PARAM(textureName, samplerName) TEXTURE2D_ARRAY(textureName), SAMPLER_CMP(samplerName) + #define TEXTURECUBE_SHADOW_PARAM(textureName, samplerName) TEXTURECUBE(textureName), SAMPLER_CMP(samplerName) + #define TEXTURECUBE_ARRAY_SHADOW_PARAM(textureName, samplerName) TEXTURECUBE_ARRAY(textureName), SAMPLER_CMP(samplerName) + + #define TEXTURE2D_ARGS(textureName, samplerName) textureName, samplerName + #define TEXTURE2D_ARRAY_ARGS(textureName, samplerName) textureName, samplerName + #define TEXTURECUBE_ARGS(textureName, samplerName) textureName, samplerName + #define TEXTURECUBE_ARRAY_ARGS(textureName, samplerName) textureName, samplerName + #define TEXTURE3D_ARGS(textureName, samplerName) textureName, samplerName + + #define TEXTURE2D_SHADOW_ARGS(textureName, samplerName) textureName, samplerName + #define TEXTURE2D_ARRAY_SHADOW_ARGS(textureName, samplerName) textureName, samplerName + #define TEXTURECUBE_SHADOW_ARGS(textureName, samplerName) textureName, samplerName + #define TEXTURECUBE_ARRAY_SHADOW_ARGS(textureName, samplerName) textureName, samplerName + + #define SAMPLE_TEXTURE2D(textureName, samplerName, coord2) textureName.Sample(samplerName, coord2) + #define SAMPLE_TEXTURE2D_LOD(textureName, samplerName, coord2, lod) textureName.SampleLevel(samplerName, coord2, lod) + #define SAMPLE_TEXTURE2D_BIAS(textureName, samplerName, coord2, bias) textureName.SampleBias(samplerName, coord2, bias) + #define SAMPLE_TEXTURE2D_GRAD(textureName, samplerName, coord2, dpdx, dpdy) textureName.SampleGrad(samplerName, coord2, dpdx, dpdy) + #define SAMPLE_TEXTURE2D_ARRAY(textureName, samplerName, coord2, index) textureName.Sample(samplerName, float3(coord2, index)) + #define SAMPLE_TEXTURE2D_ARRAY_LOD(textureName, samplerName, coord2, index, lod) textureName.SampleLevel(samplerName, float3(coord2, index), lod) + #define SAMPLE_TEXTURE2D_ARRAY_BIAS(textureName, samplerName, coord2, index, bias) textureName.SampleBias(samplerName, float3(coord2, index), bias) + #define SAMPLE_TEXTURE2D_ARRAY_GRAD(textureName, samplerName, coord2, index, dpdx, dpdy) textureName.SampleGrad(samplerName, float3(coord2, index), dpdx, dpdy) + #define SAMPLE_TEXTURECUBE(textureName, samplerName, coord3) textureName.Sample(samplerName, coord3) + #define SAMPLE_TEXTURECUBE_LOD(textureName, samplerName, coord3, lod) textureName.SampleLevel(samplerName, coord3, lod) + #define SAMPLE_TEXTURECUBE_BIAS(textureName, samplerName, coord3, bias) textureName.SampleBias(samplerName, coord3, bias) + #define SAMPLE_TEXTURECUBE_ARRAY(textureName, samplerName, coord3, index) textureName.Sample(samplerName, float4(coord3, index)) + #define SAMPLE_TEXTURECUBE_ARRAY_LOD(textureName, samplerName, coord3, index, lod) textureName.SampleLevel(samplerName, float4(coord3, index), lod) + #define SAMPLE_TEXTURECUBE_ARRAY_BIAS(textureName, samplerName, coord3, index, bias) textureName.SampleBias(samplerName, float4(coord3, index), bias) + #define SAMPLE_TEXTURE3D(textureName, samplerName, coord3) textureName.Sample(samplerName, coord3) + #define SAMPLE_TEXTURE3D_LOD(textureName, samplerName, coord3, lod) textureName.SampleLevel(samplerName, coord3, lod) + + #define SAMPLE_TEXTURE2D_SHADOW(textureName, samplerName, coord3) textureName.SampleCmpLevelZero(samplerName, (coord3).xy, (coord3).z) + #define SAMPLE_TEXTURE2D_ARRAY_SHADOW(textureName, samplerName, coord3, index) textureName.SampleCmpLevelZero(samplerName, float3((coord3).xy, index), (coord3).z) + #define SAMPLE_TEXTURECUBE_SHADOW(textureName, samplerName, coord4) textureName.SampleCmpLevelZero(samplerName, (coord4).xyz, (coord4).w) + #define SAMPLE_TEXTURECUBE_ARRAY_SHADOW(textureName, samplerName, coord4, index) textureName.SampleCmpLevelZero(samplerName, float4((coord4).xyz, index), (coord4).w) + + #define LOAD_TEXTURE2D(textureName, unCoord2) textureName.Load(int3(unCoord2, 0)) + #define LOAD_TEXTURE2D_LOD(textureName, unCoord2, lod) textureName.Load(int3(unCoord2, lod)) + #define LOAD_TEXTURE2D_MSAA(textureName, unCoord2, sampleIndex) textureName.Load(unCoord2, sampleIndex) + #define LOAD_TEXTURE2D_ARRAY(textureName, unCoord2, index) textureName.Load(int4(unCoord2, index, 0)) + #define LOAD_TEXTURE2D_ARRAY_MSAA(textureName, unCoord2, index, sampleIndex) textureName.Load(int3(unCoord2, index), sampleIndex) + #define LOAD_TEXTURE2D_ARRAY_LOD(textureName, unCoord2, index, lod) textureName.Load(int4(unCoord2, index, lod)) + #define LOAD_TEXTURE3D(textureName, unCoord3) textureName.Load(int4(unCoord3, 0)) + #define LOAD_TEXTURE3D_LOD(textureName, unCoord3, lod) textureName.Load(int4(unCoord3, lod)) + + #define PLATFORM_SUPPORT_GATHER + #define GATHER_TEXTURE2D(textureName, samplerName, coord2) textureName.Gather(samplerName, coord2) + #define GATHER_TEXTURE2D_ARRAY(textureName, samplerName, coord2, index) textureName.Gather(samplerName, float3(coord2, index)) + #define GATHER_TEXTURECUBE(textureName, samplerName, coord3) textureName.Gather(samplerName, coord3) + #define GATHER_TEXTURECUBE_ARRAY(textureName, samplerName, coord3, index) textureName.Gather(samplerName, float4(coord3, index)) + #define GATHER_RED_TEXTURE2D(textureName, samplerName, coord2) textureName.GatherRed(samplerName, coord2) + #define GATHER_GREEN_TEXTURE2D(textureName, samplerName, coord2) textureName.GatherGreen(samplerName, coord2) + #define GATHER_BLUE_TEXTURE2D(textureName, samplerName, coord2) textureName.GatherBlue(samplerName, coord2) + #define GATHER_ALPHA_TEXTURE2D(textureName, samplerName, coord2) textureName.GatherAlpha(samplerName, coord2) + +#elif defined(SHADER_API_VULKAN) +// This file assume SHADER_API_VULKAN is defined + // TODO: This is a straight copy from D3D11.hlsl. Go through all this stuff and adjust where needed. + + + // Initialize arbitrary structure with zero values. + // Do not exist on some platform, in this case we need to have a standard name that call a function that will initialize all parameters to 0 + #define ZERO_INITIALIZE(type, name) name = (type)0; + #define ZERO_INITIALIZE_ARRAY(type, name, arraySize) { for (int arrayIndex = 0; arrayIndex < arraySize; arrayIndex++) { name[arrayIndex] = (type)0; } } + + // Texture util abstraction + + #define CALCULATE_TEXTURE2D_LOD(textureName, samplerName, coord2) textureName.CalculateLevelOfDetail(samplerName, coord2) + + // Texture abstraction + + #define TEXTURE2D(textureName) Texture2D textureName + #define TEXTURE2D_ARRAY(textureName) Texture2DArray textureName + #define TEXTURECUBE(textureName) TextureCube textureName + #define TEXTURECUBE_ARRAY(textureName) TextureCubeArray textureName + #define TEXTURE3D(textureName) Texture3D textureName + + #define TEXTURE2D_FLOAT(textureName) Texture2D_float textureName + #define TEXTURE2D_ARRAY_FLOAT(textureName) Texture2DArray textureName // no support to _float on Array, it's being added + #define TEXTURECUBE_FLOAT(textureName) TextureCube_float textureName + #define TEXTURECUBE_ARRAY_FLOAT(textureName) TextureCubeArray textureName // no support to _float on Array, it's being added + #define TEXTURE3D_FLOAT(textureName) Texture3D_float textureName + + #define TEXTURE2D_HALF(textureName) Texture2D_half textureName + #define TEXTURE2D_ARRAY_HALF(textureName) Texture2DArray textureName // no support to _float on Array, it's being added + #define TEXTURECUBE_HALF(textureName) TextureCube_half textureName + #define TEXTURECUBE_ARRAY_HALF(textureName) TextureCubeArray textureName // no support to _float on Array, it's being added + #define TEXTURE3D_HALF(textureName) Texture3D_half textureName + + #define TEXTURE2D_SHADOW(textureName) TEXTURE2D(textureName) + #define TEXTURE2D_ARRAY_SHADOW(textureName) TEXTURE2D_ARRAY(textureName) + #define TEXTURECUBE_SHADOW(textureName) TEXTURECUBE(textureName) + #define TEXTURECUBE_ARRAY_SHADOW(textureName) TEXTURECUBE_ARRAY(textureName) + + #define RW_TEXTURE2D(type, textureName) RWTexture2D textureName + #define RW_TEXTURE2D_ARRAY(type, textureName) RWTexture2DArray textureName + #define RW_TEXTURE3D(type, textureName) RWTexture3D textureName + + #define SAMPLER(samplerName) SamplerState samplerName + #define SAMPLER_CMP(samplerName) SamplerComparisonState samplerName + + #define TEXTURE2D_PARAM(textureName, samplerName) TEXTURE2D(textureName), SAMPLER(samplerName) + #define TEXTURE2D_ARRAY_PARAM(textureName, samplerName) TEXTURE2D_ARRAY(textureName), SAMPLER(samplerName) + #define TEXTURECUBE_PARAM(textureName, samplerName) TEXTURECUBE(textureName), SAMPLER(samplerName) + #define TEXTURECUBE_ARRAY_PARAM(textureName, samplerName) TEXTURECUBE_ARRAY(textureName), SAMPLER(samplerName) + #define TEXTURE3D_PARAM(textureName, samplerName) TEXTURE3D(textureName), SAMPLER(samplerName) + + #define TEXTURE2D_SHADOW_PARAM(textureName, samplerName) TEXTURE2D(textureName), SAMPLER_CMP(samplerName) + #define TEXTURE2D_ARRAY_SHADOW_PARAM(textureName, samplerName) TEXTURE2D_ARRAY(textureName), SAMPLER_CMP(samplerName) + #define TEXTURECUBE_SHADOW_PARAM(textureName, samplerName) TEXTURECUBE(textureName), SAMPLER_CMP(samplerName) + #define TEXTURECUBE_ARRAY_SHADOW_PARAM(textureName, samplerName) TEXTURECUBE_ARRAY(textureName), SAMPLER_CMP(samplerName) + + #define TEXTURE2D_ARGS(textureName, samplerName) textureName, samplerName + #define TEXTURE2D_ARRAY_ARGS(textureName, samplerName) textureName, samplerName + #define TEXTURECUBE_ARGS(textureName, samplerName) textureName, samplerName + #define TEXTURECUBE_ARRAY_ARGS(textureName, samplerName) textureName, samplerName + #define TEXTURE3D_ARGS(textureName, samplerName) textureName, samplerName + + #define TEXTURE2D_SHADOW_ARGS(textureName, samplerName) textureName, samplerName + #define TEXTURE2D_ARRAY_SHADOW_ARGS(textureName, samplerName) textureName, samplerName + #define TEXTURECUBE_SHADOW_ARGS(textureName, samplerName) textureName, samplerName + #define TEXTURECUBE_ARRAY_SHADOW_ARGS(textureName, samplerName) textureName, samplerName + + #define SAMPLE_TEXTURE2D(textureName, samplerName, coord2) textureName.Sample(samplerName, coord2) + #define SAMPLE_TEXTURE2D_LOD(textureName, samplerName, coord2, lod) textureName.SampleLevel(samplerName, coord2, lod) + #define SAMPLE_TEXTURE2D_BIAS(textureName, samplerName, coord2, bias) textureName.SampleBias(samplerName, coord2, bias) + #define SAMPLE_TEXTURE2D_GRAD(textureName, samplerName, coord2, dpdx, dpdy) textureName.SampleGrad(samplerName, coord2, dpdx, dpdy) + #define SAMPLE_TEXTURE2D_ARRAY(textureName, samplerName, coord2, index) textureName.Sample(samplerName, float3(coord2, index)) + #define SAMPLE_TEXTURE2D_ARRAY_LOD(textureName, samplerName, coord2, index, lod) textureName.SampleLevel(samplerName, float3(coord2, index), lod) + #define SAMPLE_TEXTURE2D_ARRAY_BIAS(textureName, samplerName, coord2, index, bias) textureName.SampleBias(samplerName, float3(coord2, index), bias) + #define SAMPLE_TEXTURE2D_ARRAY_GRAD(textureName, samplerName, coord2, index, dpdx, dpdy) textureName.SampleGrad(samplerName, float3(coord2, index), dpdx, dpdy) + #define SAMPLE_TEXTURECUBE(textureName, samplerName, coord3) textureName.Sample(samplerName, coord3) + #define SAMPLE_TEXTURECUBE_LOD(textureName, samplerName, coord3, lod) textureName.SampleLevel(samplerName, coord3, lod) + #define SAMPLE_TEXTURECUBE_BIAS(textureName, samplerName, coord3, bias) textureName.SampleBias(samplerName, coord3, bias) + #define SAMPLE_TEXTURECUBE_ARRAY(textureName, samplerName, coord3, index) textureName.Sample(samplerName, float4(coord3, index)) + #define SAMPLE_TEXTURECUBE_ARRAY_LOD(textureName, samplerName, coord3, index, lod) textureName.SampleLevel(samplerName, float4(coord3, index), lod) + #define SAMPLE_TEXTURECUBE_ARRAY_BIAS(textureName, samplerName, coord3, index, bias) textureName.SampleBias(samplerName, float4(coord3, index), bias) + #define SAMPLE_TEXTURE3D(textureName, samplerName, coord3) textureName.Sample(samplerName, coord3) + #define SAMPLE_TEXTURE3D_LOD(textureName, samplerName, coord3, lod) textureName.SampleLevel(samplerName, coord3, lod) + + #define SAMPLE_TEXTURE2D_SHADOW(textureName, samplerName, coord3) textureName.SampleCmpLevelZero(samplerName, (coord3).xy, (coord3).z) + #define SAMPLE_TEXTURE2D_ARRAY_SHADOW(textureName, samplerName, coord3, index) textureName.SampleCmpLevelZero(samplerName, float3((coord3).xy, index), (coord3).z) + #define SAMPLE_TEXTURECUBE_SHADOW(textureName, samplerName, coord4) textureName.SampleCmpLevelZero(samplerName, (coord4).xyz, (coord4).w) + #define SAMPLE_TEXTURECUBE_ARRAY_SHADOW(textureName, samplerName, coord4, index) textureName.SampleCmpLevelZero(samplerName, float4((coord4).xyz, index), (coord4).w) + + #define LOAD_TEXTURE2D(textureName, unCoord2) textureName.Load(int3(unCoord2, 0)) + #define LOAD_TEXTURE2D_LOD(textureName, unCoord2, lod) textureName.Load(int3(unCoord2, lod)) + #define LOAD_TEXTURE2D_MSAA(textureName, unCoord2, sampleIndex) textureName.Load(unCoord2, sampleIndex) + #define LOAD_TEXTURE2D_ARRAY(textureName, unCoord2, index) textureName.Load(int4(unCoord2, index, 0)) + #define LOAD_TEXTURE2D_ARRAY_MSAA(textureName, unCoord2, index, sampleIndex) textureName.Load(int3(unCoord2, index), sampleIndex) + #define LOAD_TEXTURE2D_ARRAY_LOD(textureName, unCoord2, index, lod) textureName.Load(int4(unCoord2, index, lod)) + #define LOAD_TEXTURE3D(textureName, unCoord3) textureName.Load(int4(unCoord3, 0)) + #define LOAD_TEXTURE3D_LOD(textureName, unCoord3, lod) textureName.Load(int4(unCoord3, lod)) + + #define PLATFORM_SUPPORT_GATHER + #define GATHER_TEXTURE2D(textureName, samplerName, coord2) textureName.Gather(samplerName, coord2) + #define GATHER_TEXTURE2D_ARRAY(textureName, samplerName, coord2, index) textureName.Gather(samplerName, float3(coord2, index)) + #define GATHER_TEXTURECUBE(textureName, samplerName, coord3) textureName.Gather(samplerName, coord3) + #define GATHER_TEXTURECUBE_ARRAY(textureName, samplerName, coord3, index) textureName.Gather(samplerName, float4(coord3, index)) + #define GATHER_RED_TEXTURE2D(textureName, samplerName, coord2) textureName.GatherRed(samplerName, coord2) + #define GATHER_GREEN_TEXTURE2D(textureName, samplerName, coord2) textureName.GatherGreen(samplerName, coord2) + #define GATHER_BLUE_TEXTURE2D(textureName, samplerName, coord2) textureName.GatherBlue(samplerName, coord2) + #define GATHER_ALPHA_TEXTURE2D(textureName, samplerName, coord2) textureName.GatherAlpha(samplerName, coord2) + +#elif defined(SHADER_API_SWITCH) + // This file assume SHADER_API_SWITCH is defined + + // Initialize arbitrary structure with zero values. + // Do not exist on some platform, in this case we need to have a standard name that call a function that will initialize all parameters to 0 + #define ZERO_INITIALIZE(type, name) name = (type)0; + #define ZERO_INITIALIZE_ARRAY(type, name, arraySize) { for (int arrayIndex = 0; arrayIndex < arraySize; arrayIndex++) { name[arrayIndex] = (type)0; } } + + // Texture util abstraction + + #define CALCULATE_TEXTURE2D_LOD(textureName, samplerName, coord2) textureName.CalculateLevelOfDetail(samplerName, coord2) + + // Texture abstraction + + #define TEXTURE2D(textureName) Texture2D textureName + #define TEXTURE2D_ARRAY(textureName) Texture2DArray textureName + #define TEXTURECUBE(textureName) TextureCube textureName + #define TEXTURECUBE_ARRAY(textureName) TextureCubeArray textureName + #define TEXTURE3D(textureName) Texture3D textureName + + #define TEXTURE2D_FLOAT(textureName) Texture2D_float textureName + #define TEXTURE2D_ARRAY_FLOAT(textureName) Texture2DArray textureName // no support to _float on Array, it's being added + #define TEXTURECUBE_FLOAT(textureName) TextureCube_float textureName + #define TEXTURECUBE_ARRAY_FLOAT(textureName) TextureCubeArray textureName // no support to _float on Array, it's being added + #define TEXTURE3D_FLOAT(textureName) Texture3D_float textureName + + #define TEXTURE2D_HALF(textureName) Texture2D_half textureName + #define TEXTURE2D_ARRAY_HALF(textureName) Texture2DArray textureName // no support to _float on Array, it's being added + #define TEXTURECUBE_HALF(textureName) TextureCube_half textureName + #define TEXTURECUBE_ARRAY_HALF(textureName) TextureCubeArray textureName // no support to _float on Array, it's being added + #define TEXTURE3D_HALF(textureName) Texture3D_half textureName + + #define TEXTURE2D_SHADOW(textureName) TEXTURE2D(textureName) + #define TEXTURE2D_ARRAY_SHADOW(textureName) TEXTURE2D_ARRAY(textureName) + #define TEXTURECUBE_SHADOW(textureName) TEXTURECUBE(textureName) + #define TEXTURECUBE_ARRAY_SHADOW(textureName) TEXTURECUBE_ARRAY(textureName) + + #define RW_TEXTURE2D(type, textureName) RWTexture2D textureName + #define RW_TEXTURE2D_ARRAY(type, textureName) RWTexture2DArray textureName + #define RW_TEXTURE3D(type, textureName) RWTexture3D textureName + + #define SAMPLER(samplerName) SamplerState samplerName + #define SAMPLER_CMP(samplerName) SamplerComparisonState samplerName + + #define TEXTURE2D_PARAM(textureName, samplerName) TEXTURE2D(textureName), SAMPLER(samplerName) + #define TEXTURE2D_ARRAY_PARAM(textureName, samplerName) TEXTURE2D_ARRAY(textureName), SAMPLER(samplerName) + #define TEXTURECUBE_PARAM(textureName, samplerName) TEXTURECUBE(textureName), SAMPLER(samplerName) + #define TEXTURECUBE_ARRAY_PARAM(textureName, samplerName) TEXTURECUBE_ARRAY(textureName), SAMPLER(samplerName) + #define TEXTURE3D_PARAM(textureName, samplerName) TEXTURE3D(textureName), SAMPLER(samplerName) + + #define TEXTURE2D_SHADOW_PARAM(textureName, samplerName) TEXTURE2D(textureName), SAMPLER_CMP(samplerName) + #define TEXTURE2D_ARRAY_SHADOW_PARAM(textureName, samplerName) TEXTURE2D_ARRAY(textureName), SAMPLER_CMP(samplerName) + #define TEXTURECUBE_SHADOW_PARAM(textureName, samplerName) TEXTURECUBE(textureName), SAMPLER_CMP(samplerName) + #define TEXTURECUBE_ARRAY_SHADOW_PARAM(textureName, samplerName) TEXTURECUBE_ARRAY(textureName), SAMPLER_CMP(samplerName) + + #define TEXTURE2D_ARGS(textureName, samplerName) textureName, samplerName + #define TEXTURE2D_ARRAY_ARGS(textureName, samplerName) textureName, samplerName + #define TEXTURECUBE_ARGS(textureName, samplerName) textureName, samplerName + #define TEXTURECUBE_ARRAY_ARGS(textureName, samplerName) textureName, samplerName + #define TEXTURE3D_ARGS(textureName, samplerName) textureName, samplerName + + #define TEXTURE2D_SHADOW_ARGS(textureName, samplerName) textureName, samplerName + #define TEXTURE2D_ARRAY_SHADOW_ARGS(textureName, samplerName) textureName, samplerName + #define TEXTURECUBE_SHADOW_ARGS(textureName, samplerName) textureName, samplerName + #define TEXTURECUBE_ARRAY_SHADOW_ARGS(textureName, samplerName) textureName, samplerName + + #define SAMPLE_TEXTURE2D(textureName, samplerName, coord2) textureName.Sample(samplerName, coord2) + #define SAMPLE_TEXTURE2D_LOD(textureName, samplerName, coord2, lod) textureName.SampleLevel(samplerName, coord2, lod) + #define SAMPLE_TEXTURE2D_BIAS(textureName, samplerName, coord2, bias) textureName.SampleBias(samplerName, coord2, bias) + #define SAMPLE_TEXTURE2D_GRAD(textureName, samplerName, coord2, dpdx, dpdy) textureName.SampleGrad(samplerName, coord2, dpdx, dpdy) + #define SAMPLE_TEXTURE2D_ARRAY(textureName, samplerName, coord2, index) textureName.Sample(samplerName, float3(coord2, index)) + #define SAMPLE_TEXTURE2D_ARRAY_LOD(textureName, samplerName, coord2, index, lod) textureName.SampleLevel(samplerName, float3(coord2, index), lod) + #define SAMPLE_TEXTURE2D_ARRAY_BIAS(textureName, samplerName, coord2, index, bias) textureName.SampleBias(samplerName, float3(coord2, index), bias) + #define SAMPLE_TEXTURE2D_ARRAY_GRAD(textureName, samplerName, coord2, index, dpdx, dpdy) textureName.SampleGrad(samplerName, float3(coord2, index), dpdx, dpdy) + #define SAMPLE_TEXTURECUBE(textureName, samplerName, coord3) textureName.Sample(samplerName, coord3) + #define SAMPLE_TEXTURECUBE_LOD(textureName, samplerName, coord3, lod) textureName.SampleLevel(samplerName, coord3, lod) + #define SAMPLE_TEXTURECUBE_BIAS(textureName, samplerName, coord3, bias) textureName.SampleBias(samplerName, coord3, bias) + #define SAMPLE_TEXTURECUBE_ARRAY(textureName, samplerName, coord3, index) textureName.Sample(samplerName, float4(coord3, index)) + #define SAMPLE_TEXTURECUBE_ARRAY_LOD(textureName, samplerName, coord3, index, lod) textureName.SampleLevel(samplerName, float4(coord3, index), lod) + #define SAMPLE_TEXTURECUBE_ARRAY_BIAS(textureName, samplerName, coord3, index, bias) textureName.SampleBias(samplerName, float4(coord3, index), bias) + #define SAMPLE_TEXTURE3D(textureName, samplerName, coord3) textureName.Sample(samplerName, coord3) + #define SAMPLE_TEXTURE3D_LOD(textureName, samplerName, coord3, lod) textureName.SampleLevel(samplerName, coord3, lod) + + #define SAMPLE_TEXTURE2D_SHADOW(textureName, samplerName, coord3) textureName.SampleCmpLevelZero(samplerName, (coord3).xy, (coord3).z) + #define SAMPLE_TEXTURE2D_ARRAY_SHADOW(textureName, samplerName, coord3, index) textureName.SampleCmpLevelZero(samplerName, float3((coord3).xy, index), (coord3).z) + #define SAMPLE_TEXTURECUBE_SHADOW(textureName, samplerName, coord4) textureName.SampleCmpLevelZero(samplerName, (coord4).xyz, (coord4).w) + #define SAMPLE_TEXTURECUBE_ARRAY_SHADOW(textureName, samplerName, coord4, index) textureName.SampleCmpLevelZero(samplerName, float4((coord4).xyz, index), (coord4).w) + + + #define LOAD_TEXTURE2D(textureName, unCoord2) textureName.Load(int3(unCoord2, 0)) + #define LOAD_TEXTURE2D_LOD(textureName, unCoord2, lod) textureName.Load(int3(unCoord2, lod)) + #define LOAD_TEXTURE2D_MSAA(textureName, unCoord2, sampleIndex) textureName.Load(unCoord2, sampleIndex) + #define LOAD_TEXTURE2D_ARRAY(textureName, unCoord2, index) textureName.Load(int4(unCoord2, index, 0)) + #define LOAD_TEXTURE2D_ARRAY_LOD(textureName, unCoord2, index, lod) textureName.Load(int4(unCoord2, index, lod)) + #define LOAD_TEXTURE3D(textureName, unCoord3) textureName.Load(int4(unCoord3, 0)) + #define LOAD_TEXTURE3D_LOD(textureName, unCoord3, lod) textureName.Load(int4(unCoord3, lod)) + + #define PLATFORM_SUPPORT_GATHER + #define GATHER_TEXTURE2D(textureName, samplerName, coord2) textureName.Gather(samplerName, coord2) + #define GATHER_TEXTURE2D_ARRAY(textureName, samplerName, coord2, index) textureName.Gather(samplerName, float3(coord2, index)) + #define GATHER_TEXTURECUBE(textureName, samplerName, coord3) textureName.Gather(samplerName, coord3) + #define GATHER_TEXTURECUBE_ARRAY(textureName, samplerName, coord3, index) textureName.Gather(samplerName, float4(coord3, index)) + #define GATHER_RED_TEXTURE2D(textureName, samplerName, coord2) textureName.GatherRed(samplerName, coord2) + #define GATHER_GREEN_TEXTURE2D(textureName, samplerName, coord2) textureName.GatherGreen(samplerName, coord2) + #define GATHER_BLUE_TEXTURE2D(textureName, samplerName, coord2) textureName.GatherBlue(samplerName, coord2) + #define GATHER_ALPHA_TEXTURE2D(textureName, samplerName, coord2) textureName.GatherAlpha(samplerName, coord2) + +#elif defined(SHADER_API_GLCORE) + + // OpenGL 4.1 SM 5.0 https://docs.unity3d.com/Manual/SL-ShaderCompileTargets.html + #if (SHADER_TARGET >= 46) + #define OPENGL4_1_SM5 1 + #else + #define OPENGL4_1_SM5 0 + #endif + + // Initialize arbitrary structure with zero values. + // Do not exist on some platform, in this case we need to have a standard name that call a function that will initialize all parameters to 0 + #define ZERO_INITIALIZE(type, name) name = (type)0; + #define ZERO_INITIALIZE_ARRAY(type, name, arraySize) { for (int arrayIndex = 0; arrayIndex < arraySize; arrayIndex++) { name[arrayIndex] = (type)0; } } + + // Texture util abstraction + + #define CALCULATE_TEXTURE2D_LOD(textureName, samplerName, coord2) textureName.CalculateLevelOfDetail(samplerName, coord2) + + // Texture abstraction + + #define TEXTURE2D(textureName) Texture2D textureName + #define TEXTURE2D_ARRAY(textureName) Texture2DArray textureName + #define TEXTURECUBE(textureName) TextureCube textureName + #define TEXTURECUBE_ARRAY(textureName) TextureCubeArray textureName + #define TEXTURE3D(textureName) Texture3D textureName + + #define TEXTURE2D_FLOAT(textureName) TEXTURE2D(textureName) + #define TEXTURE2D_ARRAY_FLOAT(textureName) TEXTURE2D_ARRAY(textureName) + #define TEXTURECUBE_FLOAT(textureName) TEXTURECUBE(textureName) + #define TEXTURECUBE_ARRAY_FLOAT(textureName) TEXTURECUBE_ARRAY(textureName) + #define TEXTURE3D_FLOAT(textureName) TEXTURE3D(textureName) + + #define TEXTURE2D_HALF(textureName) TEXTURE2D(textureName) + #define TEXTURE2D_ARRAY_HALF(textureName) TEXTURE2D_ARRAY(textureName) + #define TEXTURECUBE_HALF(textureName) TEXTURECUBE(textureName) + #define TEXTURECUBE_ARRAY_HALF(textureName) TEXTURECUBE_ARRAY(textureName) + #define TEXTURE3D_HALF(textureName) TEXTURE3D(textureName) + + #define TEXTURE2D_SHADOW(textureName) TEXTURE2D(textureName) + #define TEXTURE2D_ARRAY_SHADOW(textureName) TEXTURE2D_ARRAY(textureName) + #define TEXTURECUBE_SHADOW(textureName) TEXTURECUBE(textureName) + #define TEXTURECUBE_ARRAY_SHADOW(textureName) TEXTURECUBE_ARRAY(textureName) + + #define RW_TEXTURE2D(type, textureName) RWTexture2D textureName + #define RW_TEXTURE2D_ARRAY(type, textureName) RWTexture2DArray textureName + #define RW_TEXTURE3D(type, textureName) RWTexture3D textureName + + #define SAMPLER(samplerName) SamplerState samplerName + #define SAMPLER_CMP(samplerName) SamplerComparisonState samplerName + + #define TEXTURE2D_PARAM(textureName, samplerName) TEXTURE2D(textureName), SAMPLER(samplerName) + #define TEXTURE2D_ARRAY_PARAM(textureName, samplerName) TEXTURE2D_ARRAY(textureName), SAMPLER(samplerName) + #define TEXTURECUBE_PARAM(textureName, samplerName) TEXTURECUBE(textureName), SAMPLER(samplerName) + #define TEXTURECUBE_ARRAY_PARAM(textureName, samplerName) TEXTURECUBE_ARRAY(textureName), SAMPLER(samplerName) + #define TEXTURE3D_PARAM(textureName, samplerName) TEXTURE3D(textureName), SAMPLER(samplerName) + + #define TEXTURE2D_SHADOW_PARAM(textureName, samplerName) TEXTURE2D(textureName), SAMPLER_CMP(samplerName) + #define TEXTURE2D_ARRAY_SHADOW_PARAM(textureName, samplerName) TEXTURE2D_ARRAY(textureName), SAMPLER_CMP(samplerName) + #define TEXTURECUBE_SHADOW_PARAM(textureName, samplerName) TEXTURECUBE(textureName), SAMPLER_CMP(samplerName) + #define TEXTURECUBE_ARRAY_SHADOW_PARAM(textureName, samplerName) TEXTURECUBE_ARRAY(textureName), SAMPLER_CMP(samplerName) + + #define TEXTURE2D_ARGS(textureName, samplerName) textureName, samplerName + #define TEXTURE2D_ARRAY_ARGS(textureName, samplerName) textureName, samplerName + #define TEXTURECUBE_ARGS(textureName, samplerName) textureName, samplerName + #define TEXTURECUBE_ARRAY_ARGS(textureName, samplerName) textureName, samplerName + #define TEXTURE3D_ARGS(textureName, samplerName) textureName, samplerName + + #define TEXTURE2D_SHADOW_ARGS(textureName, samplerName) textureName, samplerName + #define TEXTURE2D_ARRAY_SHADOW_ARGS(textureName, samplerName) textureName, samplerName + #define TEXTURECUBE_SHADOW_ARGS(textureName, samplerName) textureName, samplerName + #define TEXTURECUBE_ARRAY_SHADOW_ARGS(textureName, samplerName) textureName, samplerName + + #define SAMPLE_TEXTURE2D(textureName, samplerName, coord2) textureName.Sample(samplerName, coord2) + #define SAMPLE_TEXTURE2D_LOD(textureName, samplerName, coord2, lod) textureName.SampleLevel(samplerName, coord2, lod) + #define SAMPLE_TEXTURE2D_BIAS(textureName, samplerName, coord2, bias) textureName.SampleBias(samplerName, coord2, bias) + #define SAMPLE_TEXTURE2D_GRAD(textureName, samplerName, coord2, ddx, ddy) textureName.SampleGrad(samplerName, coord2, ddx, ddy) + #define SAMPLE_TEXTURE2D_ARRAY(textureName, samplerName, coord2, index) textureName.Sample(samplerName, float3(coord2, index)) + #define SAMPLE_TEXTURE2D_ARRAY_LOD(textureName, samplerName, coord2, index, lod) textureName.SampleLevel(samplerName, float3(coord2, index), lod) + #define SAMPLE_TEXTURE2D_ARRAY_BIAS(textureName, samplerName, coord2, index, bias) textureName.SampleBias(samplerName, float3(coord2, index), bias) + #define SAMPLE_TEXTURE2D_ARRAY_GRAD(textureName, samplerName, coord2, index, dpdx, dpdy) textureName.SampleGrad(samplerName, float3(coord2, index), dpdx, dpdy) + #define SAMPLE_TEXTURECUBE(textureName, samplerName, coord3) textureName.Sample(samplerName, coord3) + #define SAMPLE_TEXTURECUBE_LOD(textureName, samplerName, coord3, lod) textureName.SampleLevel(samplerName, coord3, lod) + #define SAMPLE_TEXTURECUBE_BIAS(textureName, samplerName, coord3, bias) textureName.SampleBias(samplerName, coord3, bias) + #ifdef UNITY_NO_CUBEMAP_ARRAY + #define SAMPLE_TEXTURECUBE_ARRAY(textureName, samplerName, coord3, index) ERROR_ON_UNSUPPORTED_FUNCTION(SAMPLE_TEXTURECUBE_ARRAY) + #define SAMPLE_TEXTURECUBE_ARRAY_LOD(textureName, samplerName, coord3, index, lod) ERROR_ON_UNSUPPORTED_FUNCTION(SAMPLE_TEXTURECUBE_ARRAY_LOD) + #define SAMPLE_TEXTURECUBE_ARRAY_LOD(textureName, samplerName, coord3, index, bias) ERROR_ON_UNSUPPORTED_FUNCTION(SAMPLE_TEXTURECUBE_ARRAY_LOD) + #else + #define SAMPLE_TEXTURECUBE_ARRAY(textureName, samplerName, coord3, index) textureName.Sample(samplerName, float4(coord3, index)) + #define SAMPLE_TEXTURECUBE_ARRAY_LOD(textureName, samplerName, coord3, index, lod) textureName.SampleLevel(samplerName, float4(coord3, index), lod) + #define SAMPLE_TEXTURECUBE_ARRAY_BIAS(textureName, samplerName, coord3, index, bias)textureName.SampleBias(samplerName, float4(coord3, index), bias) + #endif + #define SAMPLE_TEXTURE3D(textureName, samplerName, coord3) textureName.Sample(samplerName, coord3) + #define SAMPLE_TEXTURE3D_LOD(textureName, samplerName, coord3, lod) textureName.SampleLevel(samplerName, coord3, lod) + + #define SAMPLE_TEXTURE2D_SHADOW(textureName, samplerName, coord3) textureName.SampleCmpLevelZero(samplerName, (coord3).xy, (coord3).z) + #define SAMPLE_TEXTURE2D_ARRAY_SHADOW(textureName, samplerName, coord3, index) textureName.SampleCmpLevelZero(samplerName, float3((coord3).xy, index), (coord3).z) + #define SAMPLE_TEXTURECUBE_SHADOW(textureName, samplerName, coord4) textureName.SampleCmpLevelZero(samplerName, (coord4).xyz, (coord4).w) + #define SAMPLE_TEXTURECUBE_ARRAY_SHADOW(textureName, samplerName, coord4, index) textureName.SampleCmpLevelZero(samplerName, float4((coord4).xyz, index), (coord4).w) + + #define LOAD_TEXTURE2D(textureName, unCoord2) textureName.Load(int3(unCoord2, 0)) + #define LOAD_TEXTURE2D_LOD(textureName, unCoord2, lod) textureName.Load(int3(unCoord2, lod)) + #define LOAD_TEXTURE2D_MSAA(textureName, unCoord2, sampleIndex) textureName.Load(unCoord2, sampleIndex) + #define LOAD_TEXTURE2D_ARRAY(textureName, unCoord2, index) textureName.Load(int4(unCoord2, index, 0)) + #define LOAD_TEXTURE2D_ARRAY_MSAA(textureName, unCoord2, index, sampleIndex) textureName.Load(int3(unCoord2, index), sampleIndex) + #define LOAD_TEXTURE2D_ARRAY_LOD(textureName, unCoord2, index, lod) textureName.Load(int4(unCoord2, index, lod)) + + #if OPENGL4_1_SM5 + #define PLATFORM_SUPPORT_GATHER + #define GATHER_TEXTURE2D(textureName, samplerName, coord2) textureName.Gather(samplerName, coord2) + #define GATHER_TEXTURE2D_ARRAY(textureName, samplerName, coord2, index) textureName.Gather(samplerName, float3(coord2, index)) + #define GATHER_TEXTURECUBE(textureName, samplerName, coord3) textureName.Gather(samplerName, coord3) + #define GATHER_TEXTURECUBE_ARRAY(textureName, samplerName, coord3, index) textureName.Gather(samplerName, float4(coord3, index)) + #else + #define GATHER_TEXTURE2D(textureName, samplerName, coord2) ERROR_ON_UNSUPPORTED_FUNCTION(GATHER_TEXTURE2D) + #define GATHER_TEXTURE2D_ARRAY(textureName, samplerName, coord2, index) ERROR_ON_UNSUPPORTED_FUNCTION(GATHER_TEXTURE2D_ARRAY) + #define GATHER_TEXTURECUBE(textureName, samplerName, coord3) ERROR_ON_UNSUPPORTED_FUNCTION(GATHER_TEXTURECUBE) + #define GATHER_TEXTURECUBE_ARRAY(textureName, samplerName, coord3, index) ERROR_ON_UNSUPPORTED_FUNCTION(GATHER_TEXTURECUBE_ARRAY) + #endif + + + #elif defined(SHADER_API_GLES3) + + // GLES 3.1 + AEP shader feature https://docs.unity3d.com/Manual/SL-ShaderCompileTargets.html + #if (SHADER_TARGET >= 40) + #define GLES3_1_AEP 1 + #else + #define GLES3_1_AEP 0 + #endif + + // Initialize arbitrary structure with zero values. + // Do not exist on some platform, in this case we need to have a standard name that call a function that will initialize all parameters to 0 + #define ZERO_INITIALIZE(type, name) name = (type)0; + #define ZERO_INITIALIZE_ARRAY(type, name, arraySize) { for (int arrayIndex = 0; arrayIndex < arraySize; arrayIndex++) { name[arrayIndex] = (type)0; } } + + // Texture util abstraction + + #define CALCULATE_TEXTURE2D_LOD(textureName, samplerName, coord2) textureName.CalculateLevelOfDetail(samplerName, coord2) + + // Texture abstraction + + #define TEXTURE2D(textureName) Texture2D textureName + #define TEXTURE2D_ARRAY(textureName) Texture2DArray textureName + #define TEXTURECUBE(textureName) TextureCube textureName + #define TEXTURECUBE_ARRAY(textureName) TextureCubeArray textureName + #define TEXTURE3D(textureName) Texture3D textureName + + #define TEXTURE2D_FLOAT(textureName) Texture2D_float textureName + #define TEXTURE2D_ARRAY_FLOAT(textureName) Texture2DArray textureName // no support to _float on Array, it's being added + #define TEXTURECUBE_FLOAT(textureName) TextureCube_float textureName + #define TEXTURECUBE_ARRAY_FLOAT(textureName) TextureCubeArray textureName // no support to _float on Array, it's being added + #define TEXTURE3D_FLOAT(textureName) Texture3D_float textureName + + #define TEXTURE2D_HALF(textureName) Texture2D_half textureName + #define TEXTURE2D_ARRAY_HALF(textureName) Texture2DArray textureName // no support to _float on Array, it's being added + #define TEXTURECUBE_HALF(textureName) TextureCube_half textureName + #define TEXTURECUBE_ARRAY_HALF(textureName) TextureCubeArray textureName // no support to _float on Array, it's being added + #define TEXTURE3D_HALF(textureName) Texture3D_half textureName + + #define TEXTURE2D_SHADOW(textureName) TEXTURE2D(textureName) + #define TEXTURE2D_ARRAY_SHADOW(textureName) TEXTURE2D_ARRAY(textureName) + #define TEXTURECUBE_SHADOW(textureName) TEXTURECUBE(textureName) + #define TEXTURECUBE_ARRAY_SHADOW(textureName) TEXTURECUBE_ARRAY(textureName) + + #if GLES3_1_AEP + #define RW_TEXTURE2D(type, textureName) RWTexture2D textureName + #define RW_TEXTURE2D_ARRAY(type, textureName) RWTexture2DArray textureName + #define RW_TEXTURE3D(type, textureName) RWTexture3D textureName + #else + #define RW_TEXTURE2D(type, textureName) ERROR_ON_UNSUPPORTED_FUNCTION(RWTexture2D) + #define RW_TEXTURE2D_ARRAY(type, textureName) ERROR_ON_UNSUPPORTED_FUNCTION(RWTexture2DArray) + #define RW_TEXTURE3D(type, textureName) ERROR_ON_UNSUPPORTED_FUNCTION(RWTexture3D) + #endif + + #define SAMPLER(samplerName) SamplerState samplerName + #define SAMPLER_CMP(samplerName) SamplerComparisonState samplerName + + #define TEXTURE2D_PARAM(textureName, samplerName) TEXTURE2D(textureName), SAMPLER(samplerName) + #define TEXTURE2D_ARRAY_PARAM(textureName, samplerName) TEXTURE2D_ARRAY(textureName), SAMPLER(samplerName) + #define TEXTURECUBE_PARAM(textureName, samplerName) TEXTURECUBE(textureName), SAMPLER(samplerName) + #define TEXTURECUBE_ARRAY_PARAM(textureName, samplerName) TEXTURECUBE_ARRAY(textureName), SAMPLER(samplerName) + #define TEXTURE3D_PARAM(textureName, samplerName) TEXTURE3D(textureName), SAMPLER(samplerName) + + #define TEXTURE2D_SHADOW_PARAM(textureName, samplerName) TEXTURE2D(textureName), SAMPLER_CMP(samplerName) + #define TEXTURE2D_ARRAY_SHADOW_PARAM(textureName, samplerName) TEXTURE2D_ARRAY(textureName), SAMPLER_CMP(samplerName) + #define TEXTURECUBE_SHADOW_PARAM(textureName, samplerName) TEXTURECUBE(textureName), SAMPLER_CMP(samplerName) + #define TEXTURECUBE_ARRAY_SHADOW_PARAM(textureName, samplerName) TEXTURECUBE_ARRAY(textureName), SAMPLER_CMP(samplerName) + + #define TEXTURE2D_ARGS(textureName, samplerName) textureName, samplerName + #define TEXTURE2D_ARRAY_ARGS(textureName, samplerName) textureName, samplerName + #define TEXTURECUBE_ARGS(textureName, samplerName) textureName, samplerName + #define TEXTURECUBE_ARRAY_ARGS(textureName, samplerName) textureName, samplerName + #define TEXTURE3D_ARGS(textureName, samplerName) textureName, samplerName + + #define TEXTURE2D_SHADOW_ARGS(textureName, samplerName) textureName, samplerName + #define TEXTURE2D_ARRAY_SHADOW_ARGS(textureName, samplerName) textureName, samplerName + #define TEXTURECUBE_SHADOW_ARGS(textureName, samplerName) textureName, samplerName + #define TEXTURECUBE_ARRAY_SHADOW_ARGS(textureName, samplerName) textureName, samplerName + + #define SAMPLE_TEXTURE2D(textureName, samplerName, coord2) textureName.Sample(samplerName, coord2) + #define SAMPLE_TEXTURE2D_LOD(textureName, samplerName, coord2, lod) textureName.SampleLevel(samplerName, coord2, lod) + #define SAMPLE_TEXTURE2D_BIAS(textureName, samplerName, coord2, bias) textureName.SampleBias(samplerName, coord2, bias) + #define SAMPLE_TEXTURE2D_GRAD(textureName, samplerName, coord2, ddx, ddy) textureName.SampleGrad(samplerName, coord2, ddx, ddy) + #define SAMPLE_TEXTURE2D_ARRAY(textureName, samplerName, coord2, index) textureName.Sample(samplerName, float3(coord2, index)) + #define SAMPLE_TEXTURE2D_ARRAY_LOD(textureName, samplerName, coord2, index, lod) textureName.SampleLevel(samplerName, float3(coord2, index), lod) + #define SAMPLE_TEXTURE2D_ARRAY_BIAS(textureName, samplerName, coord2, index, bias) textureName.SampleBias(samplerName, float3(coord2, index), bias) + #define SAMPLE_TEXTURE2D_ARRAY_GRAD(textureName, samplerName, coord2, index, dpdx, dpdy) textureName.SampleGrad(samplerName, float3(coord2, index), dpdx, dpdy) + #define SAMPLE_TEXTURECUBE(textureName, samplerName, coord3) textureName.Sample(samplerName, coord3) + #define SAMPLE_TEXTURECUBE_LOD(textureName, samplerName, coord3, lod) textureName.SampleLevel(samplerName, coord3, lod) + #define SAMPLE_TEXTURECUBE_BIAS(textureName, samplerName, coord3, bias) textureName.SampleBias(samplerName, coord3, bias) + + #ifdef UNITY_NO_CUBEMAP_ARRAY + #define SAMPLE_TEXTURECUBE_ARRAY(textureName, samplerName, coord3, index) ERROR_ON_UNSUPPORTED_FUNCTION(SAMPLE_TEXTURECUBE_ARRAY) + #define SAMPLE_TEXTURECUBE_ARRAY_LOD(textureName, samplerName, coord3, index, lod) ERROR_ON_UNSUPPORTED_FUNCTION(SAMPLE_TEXTURECUBE_ARRAY_LOD) + #define SAMPLE_TEXTURECUBE_ARRAY_BIAS(textureName, samplerName, coord3, index, bias)ERROR_ON_UNSUPPORTED_FUNCTION(SAMPLE_TEXTURECUBE_ARRAY_BIAS) + #else + #define SAMPLE_TEXTURECUBE_ARRAY(textureName, samplerName, coord3, index) textureName.Sample(samplerName, float4(coord3, index)) + #define SAMPLE_TEXTURECUBE_ARRAY_LOD(textureName, samplerName, coord3, index, lod) textureName.SampleLevel(samplerName, float4(coord3, index), lod) + #define SAMPLE_TEXTURECUBE_ARRAY_BIAS(textureName, samplerName, coord3, index, bias)textureName.SampleBias(samplerName, float4(coord3, index), bias) + #endif + + #define SAMPLE_TEXTURE3D(textureName, samplerName, coord3) textureName.Sample(samplerName, coord3) + #define SAMPLE_TEXTURE3D_LOD(textureName, samplerName, coord3, lod) textureName.SampleLevel(samplerName, coord3, lod) + + #define SAMPLE_TEXTURE2D_SHADOW(textureName, samplerName, coord3) textureName.SampleCmpLevelZero(samplerName, (coord3).xy, (coord3).z) + #define SAMPLE_TEXTURE2D_ARRAY_SHADOW(textureName, samplerName, coord3, index) textureName.SampleCmpLevelZero(samplerName, float3((coord3).xy, index), (coord3).z) + #define SAMPLE_TEXTURECUBE_SHADOW(textureName, samplerName, coord4) textureName.SampleCmpLevelZero(samplerName, (coord4).xyz, (coord4).w) + #define SAMPLE_TEXTURECUBE_ARRAY_SHADOW(textureName, samplerName, coord4, index) textureName.SampleCmpLevelZero(samplerName, float4((coord4).xyz, index), (coord4).w) + + + #define LOAD_TEXTURE2D(textureName, unCoord2) textureName.Load(int3(unCoord2, 0)) + #define LOAD_TEXTURE2D_LOD(textureName, unCoord2, lod) textureName.Load(int3(unCoord2, lod)) + #define LOAD_TEXTURE2D_MSAA(textureName, unCoord2, sampleIndex) textureName.Load(unCoord2, sampleIndex) + #define LOAD_TEXTURE2D_ARRAY(textureName, unCoord2, index) textureName.Load(int4(unCoord2, index, 0)) + #define LOAD_TEXTURE2D_ARRAY_MSAA(textureName, unCoord2, index, sampleIndex) textureName.Load(int3(unCoord2, index), sampleIndex) + #define LOAD_TEXTURE2D_ARRAY_LOD(textureName, unCoord2, index, lod) textureName.Load(int4(unCoord2, index, lod)) + #define LOAD_TEXTURE3D(textureName, unCoord3) textureName.Load(int4(unCoord3, 0)) + #define LOAD_TEXTURE3D_LOD(textureName, unCoord3, lod) textureName.Load(int4(unCoord3, lod)) + + #if GLES3_1_AEP + #define PLATFORM_SUPPORT_GATHER + #define GATHER_TEXTURE2D(textureName, samplerName, coord2) textureName.Gather(samplerName, coord2) + #define GATHER_TEXTURE2D_ARRAY(textureName, samplerName, coord2, index) textureName.Gather(samplerName, float3(coord2, index)) + #define GATHER_TEXTURECUBE(textureName, samplerName, coord3) textureName.Gather(samplerName, coord3) + #define GATHER_TEXTURECUBE_ARRAY(textureName, samplerName, coord3, index) textureName.Gather(samplerName, float4(coord3, index)) + #define GATHER_RED_TEXTURE2D(textureName, samplerName, coord2) textureName.GatherRed(samplerName, coord2) + #define GATHER_GREEN_TEXTURE2D(textureName, samplerName, coord2) textureName.GatherGreen(samplerName, coord2) + #define GATHER_BLUE_TEXTURE2D(textureName, samplerName, coord2) textureName.GatherBlue(samplerName, coord2) + #define GATHER_ALPHA_TEXTURE2D(textureName, samplerName, coord2) textureName.GatherAlpha(samplerName, coord2) + #else + #define GATHER_TEXTURE2D(textureName, samplerName, coord2) ERROR_ON_UNSUPPORTED_FUNCTION(GATHER_TEXTURE2D) + #define GATHER_TEXTURE2D_ARRAY(textureName, samplerName, coord2, index) ERROR_ON_UNSUPPORTED_FUNCTION(GATHER_TEXTURE2D_ARRAY) + #define GATHER_TEXTURECUBE(textureName, samplerName, coord3) ERROR_ON_UNSUPPORTED_FUNCTION(GATHER_TEXTURECUBE) + #define GATHER_TEXTURECUBE_ARRAY(textureName, samplerName, coord3, index) ERROR_ON_UNSUPPORTED_FUNCTION(GATHER_TEXTURECUBE_ARRAY) + #define GATHER_RED_TEXTURE2D(textureName, samplerName, coord2) ERROR_ON_UNSUPPORTED_FUNCTION(GATHER_RED_TEXTURE2D) + #define GATHER_GREEN_TEXTURE2D(textureName, samplerName, coord2) ERROR_ON_UNSUPPORTED_FUNCTION(GATHER_GREEN_TEXTURE2D) + #define GATHER_BLUE_TEXTURE2D(textureName, samplerName, coord2) ERROR_ON_UNSUPPORTED_FUNCTION(GATHER_BLUE_TEXTURE2D) + #define GATHER_ALPHA_TEXTURE2D(textureName, samplerName, coord2) ERROR_ON_UNSUPPORTED_FUNCTION(GATHER_ALPHA_TEXTURE2D) + #endif + + +#elif defined(SHADER_API_GLES) + + + #define uint int + + #define rcp(x) 1.0 / (x) + #define ddx_fine ddx + #define ddy_fine ddy + #define asfloat + #define asuint(x) asint(x) + #define f32tof16 + #define f16tof32 + + #define ERROR_ON_UNSUPPORTED_FUNCTION(funcName) #error #funcName is not supported on GLES 2.0 + + // Initialize arbitrary structure with zero values. + // Do not exist on some platform, in this case we need to have a standard name that call a function that will initialize all parameters to 0 + #define ZERO_INITIALIZE(type, name) name = (type)0; + #define ZERO_INITIALIZE_ARRAY(type, name, arraySize) { for (int arrayIndex = 0; arrayIndex < arraySize; arrayIndex++) { name[arrayIndex] = (type)0; } } + + + // Texture util abstraction + + #define CALCULATE_TEXTURE2D_LOD(textureName, samplerName, coord2) #error calculate Level of Detail not supported in GLES2 + + // Texture abstraction + + #define TEXTURE2D(textureName) sampler2D textureName + #define TEXTURE2D_ARRAY(textureName) samplerCUBE textureName // No support to texture2DArray + #define TEXTURECUBE(textureName) samplerCUBE textureName + #define TEXTURECUBE_ARRAY(textureName) samplerCUBE textureName // No supoport to textureCubeArray and can't emulate with texture2DArray + #define TEXTURE3D(textureName) sampler3D textureName + + #define TEXTURE2D_FLOAT(textureName) sampler2D_float textureName + #define TEXTURE2D_ARRAY_FLOAT(textureName) TEXTURECUBE_FLOAT(textureName) // No support to texture2DArray + #define TEXTURECUBE_FLOAT(textureName) samplerCUBE_float textureName + #define TEXTURECUBE_ARRAY_FLOAT(textureName) TEXTURECUBE_FLOAT(textureName) // No support to textureCubeArray + #define TEXTURE3D_FLOAT(textureName) sampler3D_float textureName + + #define TEXTURE2D_HALF(textureName) sampler2D_half textureName + #define TEXTURE2D_ARRAY_HALF(textureName) TEXTURECUBE_HALF(textureName) // No support to texture2DArray + #define TEXTURECUBE_HALF(textureName) samplerCUBE_half textureName + #define TEXTURECUBE_ARRAY_HALF(textureName) TEXTURECUBE_HALF(textureName) // No support to textureCubeArray + #define TEXTURE3D_HALF(textureName) sampler3D_half textureName + + #define TEXTURE2D_SHADOW(textureName) SHADOW2D_TEXTURE_AND_SAMPLER textureName + #define TEXTURE2D_ARRAY_SHADOW(textureName) TEXTURECUBE_SHADOW(textureName) // No support to texture array + #define TEXTURECUBE_SHADOW(textureName) SHADOWCUBE_TEXTURE_AND_SAMPLER textureName + #define TEXTURECUBE_ARRAY_SHADOW(textureName) TEXTURECUBE_SHADOW(textureName) // No support to texture array + + #define RW_TEXTURE2D(type, textureNam) ERROR_ON_UNSUPPORTED_FUNCTION(RWTexture2D) + #define RW_TEXTURE2D_ARRAY(type, textureName) ERROR_ON_UNSUPPORTED_FUNCTION(RWTexture2DArray) + #define RW_TEXTURE3D(type, textureNam) ERROR_ON_UNSUPPORTED_FUNCTION(RWTexture3D) + + #define SAMPLER(samplerName) + #define SAMPLER_CMP(samplerName) + + #define TEXTURE2D_PARAM(textureName, samplerName) sampler2D textureName + #define TEXTURE2D_ARRAY_PARAM(textureName, samplerName) samplerCUBE textureName + #define TEXTURECUBE_PARAM(textureName, samplerName) samplerCUBE textureName + #define TEXTURECUBE_ARRAY_PARAM(textureName, samplerName) samplerCUBE textureName + #define TEXTURE3D_PARAM(textureName, samplerName) sampler3D textureName + #define TEXTURE2D_SHADOW_PARAM(textureName, samplerName) SHADOW2D_TEXTURE_AND_SAMPLER textureName + #define TEXTURE2D_ARRAY_SHADOW_PARAM(textureName, samplerName) SHADOWCUBE_TEXTURE_AND_SAMPLER textureName + #define TEXTURECUBE_SHADOW_PARAM(textureName, samplerName) SHADOWCUBE_TEXTURE_AND_SAMPLER textureName + + #define TEXTURE2D_ARGS(textureName, samplerName) textureName + #define TEXTURE2D_ARRAY_ARGS(textureName, samplerName) textureName + #define TEXTURECUBE_ARGS(textureName, samplerName) textureName + #define TEXTURECUBE_ARRAY_ARGS(textureName, samplerName) textureName + #define TEXTURE3D_ARGS(textureName, samplerName) textureName + #define TEXTURE2D_SHADOW_ARGS(textureName, samplerName) textureName + #define TEXTURE2D_ARRAY_SHADOW_ARGS(textureName, samplerName) textureName + #define TEXTURECUBE_SHADOW_ARGS(textureName, samplerName) textureName + + #define SAMPLE_TEXTURE2D(textureName, samplerName, coord2) tex2D(textureName, coord2) + + #if (SHADER_TARGET >= 30) + #define SAMPLE_TEXTURE2D_LOD(textureName, samplerName, coord2, lod) tex2Dlod(textureName, float4(coord2, 0, lod)) + #else + // No lod support. Very poor approximation with bias. + #define SAMPLE_TEXTURE2D_LOD(textureName, samplerName, coord2, lod) SAMPLE_TEXTURE2D_BIAS(textureName, samplerName, coord2, lod) + #endif + + #define SAMPLE_TEXTURE2D_BIAS(textureName, samplerName, coord2, bias) tex2Dbias(textureName, float4(coord2, 0, bias)) + #define SAMPLE_TEXTURE2D_GRAD(textureName, samplerName, coord2, ddx, ddy) SAMPLE_TEXTURE2D(textureName, samplerName, coord2) + #define SAMPLE_TEXTURE2D_ARRAY(textureName, samplerName, coord2, index) ERROR_ON_UNSUPPORTED_FUNCTION(SAMPLE_TEXTURE2D_ARRAY) + #define SAMPLE_TEXTURE2D_ARRAY_LOD(textureName, samplerName, coord2, index, lod) ERROR_ON_UNSUPPORTED_FUNCTION(SAMPLE_TEXTURE2D_ARRAY_LOD) + #define SAMPLE_TEXTURE2D_ARRAY_BIAS(textureName, samplerName, coord2, index, bias) ERROR_ON_UNSUPPORTED_FUNCTION(SAMPLE_TEXTURE2D_ARRAY_BIAS) + #define SAMPLE_TEXTURE2D_ARRAY_GRAD(textureName, samplerName, coord2, index, dpdx, dpdy) ERROR_ON_UNSUPPORTED_FUNCTION(SAMPLE_TEXTURE2D_ARRAY_GRAD) + #define SAMPLE_TEXTURECUBE(textureName, samplerName, coord3) texCUBE(textureName, coord3) + // No lod support. Very poor approximation with bias. + #define SAMPLE_TEXTURECUBE_LOD(textureName, samplerName, coord3, lod) SAMPLE_TEXTURECUBE_BIAS(textureName, samplerName, coord3, lod) + #define SAMPLE_TEXTURECUBE_BIAS(textureName, samplerName, coord3, bias) texCUBEbias(textureName, float4(coord3, bias)) + #define SAMPLE_TEXTURECUBE_ARRAY(textureName, samplerName, coord3, index) ERROR_ON_UNSUPPORTED_FUNCTION(SAMPLE_TEXTURECUBE_ARRAY) + #define SAMPLE_TEXTURECUBE_ARRAY_LOD(textureName, samplerName, coord3, index, lod) ERROR_ON_UNSUPPORTED_FUNCTION(SAMPLE_TEXTURECUBE_ARRAY_LOD) + #define SAMPLE_TEXTURECUBE_ARRAY_BIAS(textureName, samplerName, coord3, index, bias) ERROR_ON_UNSUPPORTED_FUNCTION(SAMPLE_TEXTURECUBE_ARRAY_BIAS) + #define SAMPLE_TEXTURE3D(textureName, samplerName, coord3) tex3D(textureName, coord3) + #define SAMPLE_TEXTURE3D_LOD(textureName, samplerName, coord3, lod) ERROR_ON_UNSUPPORTED_FUNCTION(SAMPLE_TEXTURE3D_LOD) + + #define SAMPLE_TEXTURE2D_SHADOW(textureName, samplerName, coord3) SHADOW2D_SAMPLE(textureName, samplerName, coord3) + #define SAMPLE_TEXTURE2D_ARRAY_SHADOW(textureName, samplerName, coord3, index) ERROR_ON_UNSUPPORTED_FUNCTION(SAMPLE_TEXTURE2D_ARRAY_SHADOW) + #define SAMPLE_TEXTURECUBE_SHADOW(textureName, samplerName, coord4) SHADOWCUBE_SAMPLE(textureName, samplerName, coord4) + #define SAMPLE_TEXTURECUBE_ARRAY_SHADOW(textureName, samplerName, coord4, index) ERROR_ON_UNSUPPORTED_FUNCTION(SAMPLE_TEXTURECUBE_ARRAY_SHADOW) + + + // Not supported. Can't define as error because shader library is calling these functions. + #define LOAD_TEXTURE2D(textureName, unCoord2) half4(0, 0, 0, 0) + #define LOAD_TEXTURE2D_LOD(textureName, unCoord2, lod) half4(0, 0, 0, 0) + #define LOAD_TEXTURE2D_MSAA(textureName, unCoord2, sampleIndex) half4(0, 0, 0, 0) + #define LOAD_TEXTURE2D_ARRAY(textureName, unCoord2, index) half4(0, 0, 0, 0) + #define LOAD_TEXTURE2D_ARRAY_MSAA(textureName, unCoord2, index, sampleIndex) half4(0, 0, 0, 0) + #define LOAD_TEXTURE2D_ARRAY_LOD(textureName, unCoord2, index, lod) half4(0, 0, 0, 0) + #define LOAD_TEXTURE3D(textureName, unCoord3) ERROR_ON_UNSUPPORTED_FUNCTION(LOAD_TEXTURE3D) + #define LOAD_TEXTURE3D_LOD(textureName, unCoord3, lod) ERROR_ON_UNSUPPORTED_FUNCTION(LOAD_TEXTURE3D_LOD) + + // Gather not supported. Fallback to regular texture sampling. + #define GATHER_TEXTURE2D(textureName, samplerName, coord2) ERROR_ON_UNSUPPORTED_FUNCTION(GATHER_TEXTURE2D) + #define GATHER_TEXTURE2D_ARRAY(textureName, samplerName, coord2, index) ERROR_ON_UNSUPPORTED_FUNCTION(GATHER_TEXTURE2D_ARRAY) + #define GATHER_TEXTURECUBE(textureName, samplerName, coord3) ERROR_ON_UNSUPPORTED_FUNCTION(GATHER_TEXTURECUBE) + #define GATHER_TEXTURECUBE_ARRAY(textureName, samplerName, coord3, index) ERROR_ON_UNSUPPORTED_FUNCTION(GATHER_TEXTURECUBE_ARRAY) + #define GATHER_RED_TEXTURE2D(textureName, samplerName, coord2) ERROR_ON_UNSUPPORTED_FUNCTION(GATHER_RED_TEXTURE2D) + #define GATHER_GREEN_TEXTURE2D(textureName, samplerName, coord2) ERROR_ON_UNSUPPORTED_FUNCTION(GATHER_GREEN_TEXTURE2D) + #define GATHER_BLUE_TEXTURE2D(textureName, samplerName, coord2) ERROR_ON_UNSUPPORTED_FUNCTION(GATHER_BLUE_TEXTURE2D) + #define GATHER_ALPHA_TEXTURE2D(textureName, samplerName, coord2) ERROR_ON_UNSUPPORTED_FUNCTION(GATHER_ALPHA_TEXTURE2D) + +#else +#error unsupported shader api +#endif + + + + +// default flow control attributes +#ifndef UNITY_BRANCH +# define UNITY_BRANCH +#endif +#ifndef UNITY_FLATTEN +# define UNITY_FLATTEN +#endif +#ifndef UNITY_UNROLL +# define UNITY_UNROLL +#endif +#ifndef UNITY_UNROLLX +# define UNITY_UNROLLX(_x) +#endif +#ifndef UNITY_LOOP +# define UNITY_LOOP +#endif + + + +#define _USINGTEXCOORD1 1 +#define _USINGTEXCOORD2 1 + + + + + // data across stages, stripped like the above. + struct VertexToPixel + { + UNITY_POSITION(pos); // must be named pos because Unity does stupid macro stuff + float3 worldPos : TEXCOORD0; + float3 worldNormal : TEXCOORD1; + float4 worldTangent : TEXCOORD2; + float4 texcoord0 : TEXCOORD3; + float4 texcoord1 : TEXCOORD4; + float4 texcoord2 : TEXCOORD5; + + // #if %TEXCOORD3REQUIREKEY% + float4 texcoord3 : TEXCOORD6; + // #endif + + // #if %SCREENPOSREQUIREKEY% + // float4 screenPos : TEXCOORD7; + // #endif + + #ifndef DIRLIGHTMAP_OFF + float3 viewDir : TEXCOORD8; + #endif + float4 lmap : TEXCOORD9; + #ifndef LIGHTMAP_ON + #if UNITY_SHOULD_SAMPLE_SH && !UNITY_SAMPLE_FULL_SH_PER_PIXEL + half3 sh : TEXCOORD10; // SH + #endif + #else + #ifdef DIRLIGHTMAP_OFF + float4 lmapFadePos : TEXCOORD11; + #endif + #endif + + + // #if %VERTEXCOLORREQUIREKEY% + float4 vertexColor : COLOR; + // #endif + + // #if %EXTRAV2F0REQUIREKEY% + // float4 extraV2F0 : TEXCOORD12; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // float4 extraV2F1 : TEXCOORD13; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // float4 extraV2F2 : TEXCOORD14; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // float4 extraV2F3 : TEXCOORD15; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // float4 extraV2F4 : TEXCOORD16; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // float4 extraV2F5 : TEXCOORD17; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // float4 extraV2F6 : TEXCOORD18; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // float4 extraV2F7 : TEXCOORD19; + // #endif + + UNITY_VERTEX_INPUT_INSTANCE_ID + UNITY_VERTEX_OUTPUT_STEREO + }; + + + + // data describing the user output of a pixel + struct Surface + { + half3 Albedo; + half Height; + half3 Normal; + half Smoothness; + half3 Emission; + half Metallic; + half3 Specular; + half Occlusion; + half SpecularPower; // for simple lighting + half Alpha; + float outputDepth; // if written, SV_Depth semantic is used. ShaderData.clipPos.z is unused value + // HDRP Only + half SpecularOcclusion; + half SubsurfaceMask; + half Thickness; + half CoatMask; + half CoatSmoothness; + half Anisotropy; + half IridescenceMask; + half IridescenceThickness; + int DiffusionProfileHash; + float SpecularAAThreshold; + float SpecularAAScreenSpaceVariance; + // requires _OVERRIDE_BAKEDGI to be defined, but is mapped in all pipelines + float3 DiffuseGI; + float3 BackDiffuseGI; + float3 SpecularGI; + float ior; + float3 transmittanceColor; + float atDistance; + float transmittanceMask; + // requires _OVERRIDE_SHADOWMASK to be defines + float4 ShadowMask; + + // for decals + float NormalAlpha; + float MAOSAlpha; + + + }; + + // Data the user declares in blackboard blocks + struct Blackboard + { + + float blackboardDummyData; + }; + + // data the user might need, this will grow to be big. But easy to strip + struct ShaderData + { + float4 clipPos; // SV_POSITION + float3 localSpacePosition; + float3 localSpaceNormal; + float3 localSpaceTangent; + + float3 worldSpacePosition; + float3 worldSpaceNormal; + float3 worldSpaceTangent; + float tangentSign; + + float3 worldSpaceViewDir; + float3 tangentSpaceViewDir; + + float4 texcoord0; + float4 texcoord1; + float4 texcoord2; + float4 texcoord3; + + float2 screenUV; + float4 screenPos; + + float4 vertexColor; + bool isFrontFace; + + float4 extraV2F0; + float4 extraV2F1; + float4 extraV2F2; + float4 extraV2F3; + float4 extraV2F4; + float4 extraV2F5; + float4 extraV2F6; + float4 extraV2F7; + + float3x3 TBNMatrix; + Blackboard blackboard; + }; + + struct VertexData + { + #if SHADER_TARGET > 30 + // uint vertexID : SV_VertexID; + #endif + float4 vertex : POSITION; + float3 normal : NORMAL; + float4 tangent : TANGENT; + float4 texcoord0 : TEXCOORD0; + + // optimize out mesh coords when not in use by user or lighting system + #if _URP && (_USINGTEXCOORD1 || _PASSMETA || _PASSFORWARD || _PASSGBUFFER) + float4 texcoord1 : TEXCOORD1; + #endif + + #if _URP && (_USINGTEXCOORD2 || _PASSMETA || ((_PASSFORWARD || _PASSGBUFFER) && defined(DYNAMICLIGHTMAP_ON))) + float4 texcoord2 : TEXCOORD2; + #endif + + #if _STANDARD && (_USINGTEXCOORD1 || (_PASSMETA || ((_PASSFORWARD || _PASSGBUFFER || _PASSFORWARDADD) && LIGHTMAP_ON))) + float4 texcoord1 : TEXCOORD1; + #endif + #if _STANDARD && (_USINGTEXCOORD2 || (_PASSMETA || ((_PASSFORWARD || _PASSGBUFFER) && DYNAMICLIGHTMAP_ON))) + float4 texcoord2 : TEXCOORD2; + #endif + + + #if _HDRP + float4 texcoord1 : TEXCOORD1; + float4 texcoord2 : TEXCOORD2; + #endif + + // #if %TEXCOORD3REQUIREKEY% + float4 texcoord3 : TEXCOORD3; + // #endif + + // #if %VERTEXCOLORREQUIREKEY% + float4 vertexColor : COLOR; + // #endif + + #if _PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR)) + float3 previousPositionOS : TEXCOORD4; // Contain previous transform position (in case of skinning for example) + #if defined (_ADD_PRECOMPUTED_VELOCITY) + float3 precomputedVelocity : TEXCOORD5; // Add Precomputed Velocity (Alembic computes velocities on runtime side). + #endif + #endif + + UNITY_VERTEX_INPUT_INSTANCE_ID + }; + + struct TessVertex + { + float4 vertex : INTERNALTESSPOS; + float3 normal : NORMAL; + float4 tangent : TANGENT; + float4 texcoord0 : TEXCOORD0; + float4 texcoord1 : TEXCOORD1; + float4 texcoord2 : TEXCOORD2; + + // #if %TEXCOORD3REQUIREKEY% + float4 texcoord3 : TEXCOORD3; + // #endif + + // #if %VERTEXCOLORREQUIREKEY% + float4 vertexColor : COLOR; + // #endif + + // #if %EXTRAV2F0REQUIREKEY% + // float4 extraV2F0 : TEXCOORD5; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // float4 extraV2F1 : TEXCOORD6; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // float4 extraV2F2 : TEXCOORD7; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // float4 extraV2F3 : TEXCOORD8; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // float4 extraV2F4 : TEXCOORD9; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // float4 extraV2F5 : TEXCOORD10; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // float4 extraV2F6 : TEXCOORD11; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // float4 extraV2F7 : TEXCOORD12; + // #endif + + #if _PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR)) + float3 previousPositionOS : TEXCOORD13; // Contain previous transform position (in case of skinning for example) + #if defined (_ADD_PRECOMPUTED_VELOCITY) + float3 precomputedVelocity : TEXCOORD14; + #endif + #endif + + UNITY_VERTEX_INPUT_INSTANCE_ID + UNITY_VERTEX_OUTPUT_STEREO + }; + + struct ExtraV2F + { + float4 extraV2F0; + float4 extraV2F1; + float4 extraV2F2; + float4 extraV2F3; + float4 extraV2F4; + float4 extraV2F5; + float4 extraV2F6; + float4 extraV2F7; + Blackboard blackboard; + float4 time; + }; + + + float3 WorldToTangentSpace(ShaderData d, float3 normal) + { + return mul(d.TBNMatrix, normal); + } + + float3 TangentToWorldSpace(ShaderData d, float3 normal) + { + return mul(normal, d.TBNMatrix); + } + + // in this case, make standard more like SRPs, because we can't fix + // unity_WorldToObject in HDRP, since it already does macro-fu there + + #if _STANDARD + float3 TransformWorldToObject(float3 p) { return mul(unity_WorldToObject, float4(p, 1)); }; + float3 TransformObjectToWorld(float3 p) { return mul(unity_ObjectToWorld, float4(p, 1)); }; + float4 TransformWorldToObject(float4 p) { return mul(unity_WorldToObject, p); }; + float4 TransformObjectToWorld(float4 p) { return mul(unity_ObjectToWorld, p); }; + float4x4 GetWorldToObjectMatrix() { return unity_WorldToObject; } + float4x4 GetObjectToWorldMatrix() { return unity_ObjectToWorld; } + #if (defined(SHADER_API_D3D11) || defined(SHADER_API_XBOXONE) || defined(UNITY_COMPILER_HLSLCC) || defined(SHADER_API_PSSL) || (SHADER_TARGET_SURFACE_ANALYSIS && !SHADER_TARGET_SURFACE_ANALYSIS_MOJOSHADER)) + #define UNITY_SAMPLE_TEX2D_LOD(tex,coord, lod) tex.SampleLevel (sampler##tex,coord, lod) + #define UNITY_SAMPLE_TEX2D_SAMPLER_LOD(tex,samplertex,coord, lod) tex.SampleLevel (sampler##samplertex,coord, lod) + #else + #define UNITY_SAMPLE_TEX2D_LOD(tex,coord,lod) tex2D (tex,coord,0,lod) + #define UNITY_SAMPLE_TEX2D_SAMPLER_LOD(tex,samplertex,coord,lod) tex2D (tex,coord,0,lod) + #endif + + #undef UNITY_MATRIX_I_M + + #define UNITY_MATRIX_I_M unity_WorldToObject + + + #endif + + float3 GetCameraWorldPosition() + { + #if _HDRP + return GetCameraRelativePositionWS(_WorldSpaceCameraPos); + #else + return _WorldSpaceCameraPos; + #endif + } + + #if _GRABPASSUSED + #if _STANDARD + TEXTURE2D(%GRABTEXTURE%); + SAMPLER(sampler_%GRABTEXTURE%); + #endif + + half3 GetSceneColor(float2 uv) + { + #if _STANDARD + return SAMPLE_TEXTURE2D(%GRABTEXTURE%, sampler_%GRABTEXTURE%, uv).rgb; + #else + return SHADERGRAPH_SAMPLE_SCENE_COLOR(uv); + #endif + } + #endif + + + + #if _STANDARD + UNITY_DECLARE_DEPTH_TEXTURE(_CameraDepthTexture); + float GetSceneDepth(float2 uv) { return SAMPLE_DEPTH_TEXTURE(_CameraDepthTexture, uv); } + float GetLinear01Depth(float2 uv) { return Linear01Depth(GetSceneDepth(uv)); } + float GetLinearEyeDepth(float2 uv) { return LinearEyeDepth(GetSceneDepth(uv)); } + #else + float GetSceneDepth(float2 uv) { return SHADERGRAPH_SAMPLE_SCENE_DEPTH(uv); } + float GetLinear01Depth(float2 uv) { return Linear01Depth(GetSceneDepth(uv), _ZBufferParams); } + float GetLinearEyeDepth(float2 uv) { return LinearEyeDepth(GetSceneDepth(uv), _ZBufferParams); } + #endif + + float3 GetWorldPositionFromDepthBuffer(float2 uv, float3 worldSpaceViewDir) + { + float eye = GetLinearEyeDepth(uv); + float3 camView = mul((float3x3)UNITY_MATRIX_M, transpose(mul(UNITY_MATRIX_I_M, UNITY_MATRIX_I_V)) [2].xyz); + + float dt = dot(worldSpaceViewDir, camView); + float3 div = worldSpaceViewDir/dt; + float3 wpos = (eye * div) + GetCameraWorldPosition(); + return wpos; + } + + #if _HDRP + float3 ObjectToWorldSpacePosition(float3 pos) + { + return GetAbsolutePositionWS(TransformObjectToWorld(pos)); + } + #else + float3 ObjectToWorldSpacePosition(float3 pos) + { + return TransformObjectToWorld(pos); + } + #endif + + #if _STANDARD + UNITY_DECLARE_SCREENSPACE_TEXTURE(_CameraDepthNormalsTexture); + float3 GetSceneNormal(float2 uv, float3 worldSpaceViewDir) + { + float4 depthNorms = UNITY_SAMPLE_SCREENSPACE_TEXTURE(_CameraDepthNormalsTexture, uv); + float3 norms = DecodeViewNormalStereo(depthNorms); + norms = mul((float3x3)UNITY_MATRIX_V, norms) * 0.5 + 0.5; + return norms; + } + #elif _HDRP && !_DECALSHADER + + float3 GetSceneNormal(float2 uv, float3 worldSpaceViewDir) + { + NormalData nd; + DecodeFromNormalBuffer(_ScreenSize.xy * uv, nd); + return nd.normalWS; + } + #elif _URP + #if (SHADER_LIBRARY_VERSION_MAJOR >= 10) + #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/DeclareNormalsTexture.hlsl" + #endif + + float3 GetSceneNormal(float2 uv, float3 worldSpaceViewDir) + { + #if (SHADER_LIBRARY_VERSION_MAJOR >= 10) + return SampleSceneNormals(uv); + #else + float3 wpos = GetWorldPositionFromDepthBuffer(uv, worldSpaceViewDir); + return normalize(-cross(ddx(wpos), ddy(wpos))) * 0.5 + 0.5; + #endif + + } + #endif + + #if _HDRP + + half3 UnpackNormalmapRGorAG(half4 packednormal) + { + // This do the trick + packednormal.x *= packednormal.w; + + half3 normal; + normal.xy = packednormal.xy * 2 - 1; + normal.z = sqrt(1 - saturate(dot(normal.xy, normal.xy))); + return normal; + } + half3 UnpackNormal(half4 packednormal) + { + #if defined(UNITY_NO_DXT5nm) + return packednormal.xyz * 2 - 1; + #else + return UnpackNormalmapRGorAG(packednormal); + #endif + } + #endif + #if _HDRP || _URP + + half3 UnpackScaleNormal(half4 packednormal, half scale) + { + #ifndef UNITY_NO_DXT5nm + // Unpack normal as DXT5nm (1, y, 1, x) or BC5 (x, y, 0, 1) + // Note neutral texture like "bump" is (0, 0, 1, 1) to work with both plain RGB normal and DXT5nm/BC5 + packednormal.x *= packednormal.w; + #endif + half3 normal; + normal.xy = (packednormal.xy * 2 - 1) * scale; + normal.z = sqrt(1 - saturate(dot(normal.xy, normal.xy))); + return normal; + } + + #endif + + + void GetSun(out float3 lightDir, out float3 color) + { + lightDir = float3(0.5, 0.5, 0); + color = 1; + #if _HDRP + if (_DirectionalLightCount > 0) + { + DirectionalLightData light = _DirectionalLightDatas[0]; + lightDir = -light.forward.xyz; + color = light.color; + } + #elif _STANDARD + lightDir = normalize(_WorldSpaceLightPos0.xyz); + color = _LightColor0.rgb; + #elif _URP + Light light = GetMainLight(); + lightDir = light.direction; + color = light.color; + #endif + } + + + + + half4 _Color; + half4 _MainTex_ST, _MainTex_TexelSize; + half _Alpha, _AlphaCutoffValue; + + #if ATLAS_ON + half _MinXUV, _MaxXUV, _MinYUV, _MaxYUV; + #endif + + #if GLOW_ON + half4 _GlowColor; + half _Glow, _GlowGlobal; + #endif + + #if HSV_ON + half _HsvShift, _HsvSaturation, _HsvBright; + #endif + + #if DISTORT_ON + half4 _DistortTex_ST; + half _DistortTexXSpeed, _DistortTexYSpeed, _DistortAmount; + #endif + + #if FADE_ON + half4 _FadeBurnColor, _FadeTex_ST, _FadeBurnTex_ST; + half _FadeAmount, _FadeBurnWidth, _FadeBurnTransition,_FadeBurnGlow; + #endif + + #if OUTBASE_ON + half4 _OutlineColor; + half _OutlineAlpha, _OutlineGlow, _OutlineWidth; + int _OutlinePixelWidth; + #endif + + #if OUTTEX_ON + half4 _OutlineTex_ST; + half _OutlineTexXSpeed, _OutlineTexYSpeed; + #endif + + #if OUTDIST_ON + half4 _OutlineDistortTex_ST; + half _OutlineDistortTexXSpeed, _OutlineDistortTexYSpeed, _OutlineDistortAmount; + #endif + + #if ALPHAOUTLINE_ON + half _AlphaOutlineGlow, _AlphaOutlinePower, _AlphaOutlineMinAlpha, _AlphaOutlineBlend; + half4 _AlphaOutlineColor; + #endif + + #if INNEROUTLINE_ON + half _InnerOutlineThickness, _InnerOutlineAlpha, _InnerOutlineGlow; + half4 _InnerOutlineColor; + #endif + + #if GRADIENT_ON + half _GradBlend, _GradBoostX, _GradBoostY; + half4 _GradTopRightCol, _GradTopLeftCol, _GradBotRightCol, _GradBotLeftCol; + #endif + + #if COLORSWAP_ON + half4 _ColorSwapRed, _ColorSwapGreen, _ColorSwapBlue; + half _ColorSwapRedLuminosity, _ColorSwapGreenLuminosity, _ColorSwapBlueLuminosity, _ColorSwapBlend; + #endif + + #if CHANGECOLOR_ON + half4 _ColorChangeNewCol, _ColorChangeTarget; + half _ColorChangeTolerance, _ColorChangeLuminosity; + #endif + #if CHANGECOLOR2_ON + half4 _ColorChangeNewCol2, _ColorChangeTarget2; + half _ColorChangeTolerance2; + #endif + #if CHANGECOLOR3_ON + half4 _ColorChangeNewCol3, _ColorChangeTarget3; + half _ColorChangeTolerance3; + #endif + + #if COLORRAMP_ON + half _ColorRampLuminosity, _ColorRampBlend; + #endif + + #if HITEFFECT_ON + half4 _HitEffectColor; + half _HitEffectGlow, _HitEffectBlend; + #endif + + #if NEGATIVE_ON + half _NegativeAmount; + #endif + + #if PIXELATE_ON + half _PixelateSize; + #endif + + #if GREYSCALE_ON + half _GreyscaleLuminosity, _GreyscaleBlend; + half4 _GreyscaleTintColor; + #endif + + #if POSTERIZE_ON + half _PosterizeNumColors, _PosterizeGamma; + #endif + + #if BLUR_ON + half _BlurIntensity; + #endif + + #if MOTIONBLUR_ON + half _MotionBlurAngle, _MotionBlurDist; + #endif + + #if GHOST_ON + half _GhostColorBoost, _GhostTransparency, _GhostBlend; + #endif + + #if HOLOGRAM_ON + half _HologramStripesAmount, _HologramMinAlpha, _HologramUnmodAmount, _HologramStripesSpeed, _HologramMaxAlpha, _HologramBlend; + half4 _HologramStripeColor; + #endif + + #if CHROMABERR_ON + half _ChromAberrAmount, _ChromAberrAlpha; + #endif + + #if GLITCH_ON + half _GlitchAmount, _GlitchSize; + #endif + + #if FLICKER_ON + half _FlickerFreq, _FlickerPercent, _FlickerAlpha; + #endif + + #if SHADOW_ON + half _ShadowX, _ShadowY, _ShadowAlpha; + half4 _ShadowColor; + #endif + + #if SHINE_ON + half4 _ShineColor; + half _ShineLocation, _ShineRotate, _ShineWidth, _ShineGlow; + #endif + + #if CONTRAST_ON + half _Contrast, _Brightness; + #endif + + #if OVERLAY_ON + half4 _OverlayTex_ST, _OverlayColor; + half _OverlayGlow, _OverlayBlend, _OverlayTextureScrollXSpeed, _OverlayTextureScrollYSpeed; + #endif + + #if DOODLE_ON + half _HandDrawnAmount, _HandDrawnSpeed; + #endif + + #if WIND_ON + half _GrassSpeed, _GrassWind, _GrassManualAnim, _GrassRadialBend; + #endif + + #if WAVEUV_ON + float _WaveAmount, _WaveSpeed, _WaveStrength, _WaveX, _WaveY; + #endif + + #if ROUNDWAVEUV_ON + half _RoundWaveStrength, _RoundWaveSpeed; + #endif + + #if RECTSIZE_ON + half _RectSize; + #endif + + #if OFFSETUV_ON + half _OffsetUvX, _OffsetUvY; + #endif + + #if CLIPPING_ON + half _ClipUvLeft, _ClipUvRight, _ClipUvUp, _ClipUvDown; + #endif + + #if RADIALCLIPPING_ON + half _RadialStartAngle, _RadialClip, _RadialClip2; + #endif + + #if TEXTURESCROLL_ON + half _TextureScrollXSpeed, _TextureScrollYSpeed; + #endif + + #if ZOOMUV_ON + half _ZoomUvAmount; + #endif + + #if WARP_ON + half _WarpStrength, _WarpSpeed, _WarpScale; + #endif + + #if TWISTUV_ON + half _TwistUvAmount, _TwistUvPosX, _TwistUvPosY, _TwistUvRadius; + #endif + + #if ROTATEUV_ON + half _RotateUvAmount; + #endif + + #if FISHEYE_ON + half _FishEyeUvAmount; + #endif + + #if PINCH_ON + half _PinchUvAmount; + #endif + + #if SHAKEUV_ON + half _ShakeUvSpeed, _ShakeUvX, _ShakeUvY; + #endif + + #if NORMALMAP_ON + half _NormalStrength; + #endif + + float _RandomSeed; + + + + + + + + + + + TEXTURE2D(_MainTex); + SAMPLER(sampler_MainTex); + + #if GLOW_ON + TEXTURE2D(_GlowTex); + SAMPLER(sampler_GlowTex); + #endif + + #if FADE_ON + TEXTURE2D(_FadeTex); + SAMPLER(sampler_FadeTex); + + TEXTURE2D(_FadeBurnTex); + SAMPLER(sampler_FadeBurnTex); + #endif + + #if DISTORT_ON + TEXTURE2D(_DistortTex); + SAMPLER(sampler_DistortTex); + #endif + + #if OUTTEX_ON + TEXTURE2D(_OutlineTex); + SAMPLER(sampler_OutlineTex); + #endif + + #if OUTDIST_ON + TEXTURE2D(_OutlineDistortTex); + SAMPLER(sampler_OutlineDistortTex); + #endif + + #if COLORSWAP_ON + TEXTURE2D(_ColorSwapTex); + SAMPLER(sampler_ColorSwapTex); + #endif + + #if COLORRAMP_ON + TEXTURE2D(_ColorRampTex); + TEXTURE2D(_ColorRampTexGradient); + SAMPLER(sampler_ColorRampTex); + SAMPLER(sampler_ColorRampTexGradient); + #endif + + #if SHINE_ON + TEXTURE2D(_ShineMask); + SAMPLER(sampler_ShineMask); + #endif + + #if OVERLAY_ON + TEXTURE2D(_OverlayTex); + SAMPLER(sampler_OverlayTex); + #endif + + #if NORMALMAP_ON + TEXTURE2D(_NormalMap); + SAMPLER(sampler_NormalMap); + #endif + + + half3 GetPixel(in int offsetX, in int offsetY, in half2 uv, in Texture2D _tex, in SamplerState _sampler) + { + half2 _uv = uv + half2(offsetX * _MainTex_TexelSize.x, offsetY * _MainTex_TexelSize.y); + half4 col = SAMPLE_TEXTURE2D(_tex, _sampler, _uv); + return col.rgb; + } + + + //BLURS------------------------------------------------------------------------- + half4 Blur(half2 uv, Texture2D source, SamplerState sampler_source, half Intensity) + { + const half2 texelSize = 1.0 / _ScreenParams.xy; + const half4 color = SAMPLE_TEXTURE2D(source, sampler_source, uv); + const half2 offset = Intensity * texelSize; + + half4 accumulatedColor = color; + half accumulatedWeight = 1.0; + for (int x = -1; x <= 1; x++) + { + for (int y = -1; y <= 1; y++) + { + const half2 sampleUV = uv + half2(x, y) * offset; + const half4 sampleColor = SAMPLE_TEXTURE2D(source, sampler_source, sampleUV); + + accumulatedColor += sampleColor; + accumulatedWeight += 1.0; + } + } + + half4 blurredColor = accumulatedColor / accumulatedWeight; + return blurredColor; + } + + half BlurHD_G(half bhqp, half x) + { + return exp(-(x * x) / (2.0 * bhqp * bhqp)); + } + half4 BlurHD(half2 uv, Texture2D source, SamplerState sampler_source, half BlurAmount, half xScale, half yScale) + { + int iterations = 16; + int halfIterations = iterations / 2; + half sigmaX = 0.1 + BlurAmount * 0.5; + half sigmaY = sigmaX; + half total = 0.0; + half4 ret = half4(0, 0, 0, 0); + for (int iy = 0; iy < iterations; ++iy) + { + half fy = BlurHD_G(sigmaY, half(iy) -half(halfIterations)); + half offsetY = half(iy - halfIterations) * 0.00390625 * xScale; + for (int ix = 0; ix < iterations; ++ix) + { + half fx = BlurHD_G(sigmaX, half(ix) - half(halfIterations)); + half offsetX = half(ix - halfIterations) * 0.00390625 * yScale; + total += fx * fy; + ret += SAMPLE_TEXTURE2D(source, sampler_source, uv + half2(offsetX, offsetY)) * fx * fy; + } + } + return ret / total; + } + //----------------------------------------------------------------------- + + + //------------------------------------------- + half RemapFloat(half inValue, half inMin, half inMax, half outMin, half outMax){ + return outMin + (inValue - inMin) * (outMax - outMin) / (inMax - inMin); + } + //------------------------------------------- + + //----------------------------------------------------------------------- + half rand(half2 seed, half offset) { + return (frac(sin(dot(seed, half2(12.9898, 78.233))) * 43758.5453) + offset) % 1.0; + } + + half rand2(half2 seed, half offset) { + return (frac(sin(dot(seed * floor(50 + (_Time.x % 1.0) * 12.), half2(127.1, 311.7))) * 43758.5453123) + offset) % 1.0; + } + + half rand2CustomTime(half2 seed, half offset, half customTime) { + return (frac(sin(dot(seed * floor(50 + (customTime % 1.0) * 12.), half2(127.1, 311.7))) * 43758.5453123) + offset) % 1.0; + } + //----------------------------------------------------------------------- + + + void Ext_ModifyVertex0 (inout VertexData v, inout ExtraV2F d) + { + //BILBOARD_ON + #if BILBOARD_ON + half3 camRight = mul((half3x3)unity_CameraToWorld, half3(1,0,0)); + half3 camUp = half3(0,1,0); + #if BILBOARDY_ON + camUp = mul((half3x3)unity_CameraToWorld, half3(0,1,0)); + #endif + half3 localPos = v.vertex.x * camRight + v.vertex.y * camUp; + v.vertex = half4(localPos, 1); + #endif + //----------------------------------------------------------- + + v.texcoord0.xy = TRANSFORM_TEX(v.texcoord0.xy, _MainTex); + half2 center = half2(0.5, 0.5); + #if ATLAS_ON + center = half2((_MaxXUV + _MinXUV) / 2.0, (_MaxYUV + _MinYUV) / 2.0); + #endif + + //POLARUV_ON + #if POLARUV_ON + v.texcoord0.xy = v.texcoord0.xy - center; + #endif + + //---------------------------------------- + + //ROTATEUV_ON + #if ROTATEUV_ON + half2 uvC = v.texcoord0.xy; + half cosAngle = cos(_RotateUvAmount); + half sinAngle = sin(_RotateUvAmount); + half2x2 rot = half2x2(cosAngle, -sinAngle, sinAngle, cosAngle); + uvC -= center; + v.texcoord0.xy = mul(rot, uvC); + v.texcoord0.xy += center; + #endif + //-------------------- + + #if RECTSIZE_ON + v.vertex.xyz += (v.vertex.xyz * (_RectSize - 1.0)); + #endif + + #if OUTTEX_ON + v.texcoord1.xy = TRANSFORM_TEX(v.texcoord0.xy, _OutlineTex); + #endif + + #if OUTDIST_ON + v.texcoord2.xy = TRANSFORM_TEX(v.texcoord0.xy, _OutlineDistortTex); + #endif + + #if DISTORT_ON + v.texcoord3.xy = TRANSFORM_TEX(v.texcoord0.xy, _DistortTex); + #endif + } + + void Ext_SurfaceFunction0 (inout Surface o, ShaderData d) + { + half randomSeed = _RandomSeed; + + float2 uvRect = d.texcoord0; + half2 center = half2(0.5, 0.5); + #if ATLAS_ON + center = half2((_MaxXUV + _MinXUV) / 2.0, (_MaxYUV + _MinYUV) / 2.0); + uvRect = half2((d.texcoord0.x - _MinXUV) / (_MaxXUV - _MinXUV), (d.texcoord0.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half2 centerTiled = half2(center.x * _MainTex_ST.x, center.y * _MainTex_ST.y); + + //CLIPPING_ON + #if CLIPPING_ON + half2 tiledUv = half2(d.texcoord0.x / _MainTex_ST.x, d.texcoord0.y / _MainTex_ST.y); + #if ATLAS_ON + tiledUv = half2((tiledUv.x - _MinXUV) / (_MaxXUV - _MinXUV), (tiledUv.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + clip((1 - _ClipUvUp) - tiledUv.y); + clip(tiledUv.y - _ClipUvDown); + clip((1 - _ClipUvRight) - tiledUv.x); + clip(tiledUv.x - _ClipUvLeft); + #endif + //---------------------------------- + + //RADIALCLIPPING_ON + #if RADIALCLIPPING_ON + half2 tiledUv2 = half2(d.texcoord0.x / _MainTex_ST.x, d.texcoord0.y / _MainTex_ST.y); + #if ATLAS_ON + tiledUv2 = half2((tiledUv2.x - _MinXUV) / (_MaxXUV - _MinXUV), (tiledUv2.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half startAngle = _RadialStartAngle - _RadialClip; + half endAngle = _RadialStartAngle + _RadialClip2; + half offset0 = clamp(0, 360, startAngle + 360); + half offset360 = clamp(0, 360, endAngle - 360); + half2 atan2Coord = half2(lerp(-1, 1, tiledUv2.x), lerp(-1, 1, tiledUv2.y)); + half atanAngle = atan2(atan2Coord.y, atan2Coord.x) * 57.3; // angle in degrees + if(atanAngle < 0) atanAngle = 360 + atanAngle; + if(atanAngle >= startAngle && atanAngle <= endAngle) discard; + if(atanAngle <= offset360) discard; + if(atanAngle >= offset0) discard; + #endif + + //----------------------------- + + //TEXTURESCROLL_ON && ATLAS_ON + #if TEXTURESCROLL_ON && ATLAS_ON + d.texcoord0.xy = half2(_MinXUV + ((_MaxXUV - _MinXUV) * (abs(((_Time.y + randomSeed) * _TextureScrollXSpeed) + uvRect.x) % 1)), + _MinYUV + ((_MaxYUV - _MinYUV) * (abs(((_Time.y + randomSeed) * _TextureScrollYSpeed) + uvRect.y) % 1))); + #endif + //---------------------------- + + //OFFSETUV_ON + #if OFFSETUV_ON + #if ATLAS_ON + d.texcoord0.xy = half2(_MinXUV + ((_MaxXUV - _MinXUV) * (abs((_OffsetUvX + uvRect.x) % 1))), + _MinYUV + ((_MaxYUV - _MinYUV) * (abs(_OffsetUvY + uvRect.y) % 1))); + #else + d.texcoord0.xy += half2(_OffsetUvX, _OffsetUvY); + #endif + #endif + + //---------------------- + + //POLARUV_ON + #if POLARUV_ON + d.texcoord0.xy = half2(atan2(d.texcoord0.y, d.texcoord0.x) / (2.0f * 3.141592653589f), length(d.texcoord0.xy)); + d.texcoord0.xy *= _MainTex_ST.xy; + #endif + + //-------------------------------------- + + //TWISTUV_ON + #if TWISTUV_ON + #if ATLAS_ON + _TwistUvPosX = ((_MaxXUV - _MinXUV) * _TwistUvPosX) + _MinXUV; + _TwistUvPosY = ((_MaxYUV - _MinYUV) * _TwistUvPosY) + _MinYUV; + #endif + half2 tempUv = d.texcoord0.xy - half2(_TwistUvPosX * _MainTex_ST.x, _TwistUvPosY * _MainTex_ST.y); + _TwistUvRadius *= (_MainTex_ST.x + _MainTex_ST.y) / 2; + half percent = (_TwistUvRadius - length(tempUv)) / _TwistUvRadius; + half theta = percent * percent * (2.0 * sin(_TwistUvAmount)) * 8.0; + half s = sin(theta); + half c = cos(theta); + half beta = max(sign(_TwistUvRadius - length(tempUv)), 0.0); + tempUv = half2(dot(tempUv, half2(c, -s)), dot(tempUv, half2(s, c))) * beta + tempUv * (1 - beta); + tempUv += half2(_TwistUvPosX * _MainTex_ST.x, _TwistUvPosY * _MainTex_ST.y); + d.texcoord0.xy = tempUv; + #endif + + //-------------------------------------------- + + //FISHEYE_ON + #if FISHEYE_ON + half bind = length(centerTiled); + half2 dF = d.texcoord0.xy - centerTiled; + half dFlen = length(dF); + half fishInt = (3.14159265359 / bind) * (_FishEyeUvAmount + 0.001); + d.texcoord0.xy = centerTiled + (dF / (max(0.0001, dFlen))) * tan(dFlen * fishInt) * bind / tan(bind * fishInt); + #endif + //--------------------------------------------- + + //PINCH_ON + #if PINCH_ON + half2 dP = d.texcoord0.xy - centerTiled; + half pinchInt = (3.141592 / length(centerTiled)) * (-_PinchUvAmount + 0.001); + d.texcoord0.xy = centerTiled + normalize(dP) * atan(length(dP) * -pinchInt * 10.0) * 0.5 / atan(-pinchInt * 5); + #endif + + //--------------------------------------------- + + //ZOOMUV_ON + #if ZOOMUV_ON + d.texcoord0.xy -= centerTiled; + d.texcoord0.xy = d.texcoord0.xy * _ZoomUvAmount; + d.texcoord0.xy += centerTiled; + #endif + + //----------------------------------------------- + + //DOODLE_ON + #if DOODLE_ON + half2 uvCopy = uvRect; + _HandDrawnSpeed = (floor((_Time.x + randomSeed) * 20 * _HandDrawnSpeed) / _HandDrawnSpeed) * _HandDrawnSpeed; + uvCopy.x = sin((uvCopy.x * _HandDrawnAmount + _HandDrawnSpeed) * 4); + uvCopy.y = cos((uvCopy.y * _HandDrawnAmount + _HandDrawnSpeed) * 4); + d.texcoord0.xy = lerp(d.texcoord0.xy, d.texcoord0.xy + uvCopy, 0.0005 * _HandDrawnAmount); + #endif + + //-------------------------- + + //SHAKEUV_ON + #if SHAKEUV_ON + half xShake = sin((_Time.x + randomSeed) * _ShakeUvSpeed * 50) * _ShakeUvX; + half yShake = cos((_Time.x + randomSeed) * _ShakeUvSpeed * 50) * _ShakeUvY; + d.texcoord0.xy += half2(xShake * 0.012, yShake * 0.01); + #endif + + //------------------------------------------- + + //RECTSIZE_ON + #if RECTSIZE_ON + d.texcoord0.xy = d.texcoord0.xy * (_RectSize).xx + (((-_RectSize * 0.5) + 0.5)).xx; + #endif + + //------------------------------------------- + + //DISTORT_ON + #if DISTORT_ON + #if ATLAS_ON + d.texcoord3.x = d.texcoord3.x * (1 / (_MaxXUV - _MinXUV)); + d.texcoord3.y = d.texcoord3.y * (1 / (_MaxYUV - _MinYUV)); + #endif + + d.texcoord3.x += ((_Time.x + _RandomSeed) * _DistortTexXSpeed) % 1; + d.texcoord3.y += ((_Time.x + _RandomSeed) * _DistortTexYSpeed) % 1; + half distortAmnt = (SAMPLE_TEXTURE2D(_DistortTex, sampler_DistortTex, d.texcoord3.xy).r - 0.5) * 0.2 * _DistortAmount; + d.texcoord0.x += distortAmnt; + d.texcoord0.y += distortAmnt; + #endif + //------------------------------------------------------- + + //WARP_ON + #if WARP_ON + half2 warpUv = half2(d.texcoord0.x / _MainTex_ST.x, d.texcoord0.y / _MainTex_ST.y); + #if ATLAS_ON + warpUv = half2((warpUv.x - _MinXUV) / (_MaxXUV - _MinXUV), (warpUv.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + const float tau = 6.283185307179586; + float xWarp = (_Time.y + randomSeed) * _WarpSpeed + warpUv.x * tau / _WarpScale; + float yWarp = (_Time.y + randomSeed) * _WarpSpeed + warpUv.y * tau / _WarpScale; + float2 warp = float2(sin(xWarp), sin(yWarp)) * _WarpStrength; + d.texcoord0.xy += warp; + #endif + + //------------------------------------------------------- + + //WAVEUV_ON + #if WAVEUV_ON + float2 uvWave = half2(_WaveX * _MainTex_ST.x, _WaveY * _MainTex_ST.y) - d.texcoord0.xy; + uvWave %= 1; + #if ATLAS_ON + uvWave = half2(_WaveX, _WaveY) - uvRect; + #endif + uvWave.x *= _ScreenParams.x / _ScreenParams.y; + float waveTime = _Time.y + randomSeed; + float angWave = (sqrt(dot(uvWave, uvWave)) * _WaveAmount) - ((waveTime * _WaveSpeed)); + d.texcoord0.xy = d.texcoord0.xy + uvWave * sin(angWave) * (_WaveStrength / 1000.0); + #endif + //---------------------------------------------------- + + //ROUNDWAVEUV_ON + #if ROUNDWAVEUV_ON + half xWave = ((0.5 * _MainTex_ST.x) - uvRect.x); + half yWave = ((0.5 * _MainTex_ST.y) - uvRect.y) * (_MainTex_TexelSize.w / _MainTex_TexelSize.z); + half ripple = -sqrt(xWave*xWave + yWave* yWave); + d.texcoord0.xy += (sin((ripple + (_Time.y + randomSeed) * (_RoundWaveSpeed/10.0)) / 0.015) * (_RoundWaveStrength/10.0)) % 1; + #endif + //---------------------------------------------------- + + + //WIND_ON + #if WIND_ON + half windOffset = sin((_Time.x + randomSeed) * _GrassSpeed * 10); + half2 windCenter = half2(0.5, 0.1); + #if ATLAS_ON + windCenter.x = ((_MaxXUV - _MinXUV) * windCenter.x) + _MinXUV; + windCenter.y = ((_MaxYUV - _MinYUV) * windCenter.y) + _MinYUV; + #endif + #if !MANUALWIND_ON + d.texcoord0.x = fmod(abs(lerp(d.texcoord0.x, d.texcoord0.x + (_GrassWind * 0.01 * windOffset), uvRect.y)), 1); + #else + d.texcoord0.x = fmod(abs(lerp(d.texcoord0.x, d.texcoord0.x + (_GrassWind * 0.01 * _GrassManualAnim), uvRect.y)), 1); + windOffset = _GrassManualAnim; + #endif + half2 delta = d.texcoord0.xy - windCenter; + half delta2 = dot(delta.xy, delta.xy); + half2 delta_offset = delta2 * windOffset; + d.texcoord0.xy = d.texcoord0.xy + half2(delta.y, -delta.x) * delta_offset * _GrassRadialBend; + #endif + + //-------------------------------------------------------- + + //TEXTURESCROLL_ON && !ATLAS_ON + #if TEXTURESCROLL_ON && !ATLAS_ON + d.texcoord0.x += ((_Time.y + randomSeed) * _TextureScrollXSpeed) % 1; + d.texcoord0.y += ((_Time.y + randomSeed) * _TextureScrollYSpeed) % 1; + #endif + //------------------------------ + + //PIXELATE_ON + #if PIXELATE_ON + half aspectRatio = _MainTex_TexelSize.x / _MainTex_TexelSize.y; + half2 pixelSize = float2(_PixelateSize, _PixelateSize * aspectRatio); + d.texcoord0.xy = floor(d.texcoord0.xy * pixelSize) / pixelSize; + #endif + //-------------- + + half4 col = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy); + half originalAlpha = col.a; + col *= d.vertexColor; + + //NORMAL MAP + #if NORMALMAP_ON + half4 normalSample = SAMPLE_TEXTURE2D(_NormalMap, sampler_NormalMap, d.texcoord0.xy); + half3 normalTS = UnpackNormal(normalSample); + normalTS.xy *= _NormalStrength; + o.Normal = normalTS; + #endif + + + //GLITCH_ON + #if GLITCH_ON + half2 uvGlitch = uvRect; + uvGlitch.y -= 0.5; + half lineNoise = pow(rand2(floor(uvGlitch * half2(24., 19.) * _GlitchSize) * 4.0, randomSeed), 3.0) * _GlitchAmount + * pow(rand2(floor(uvGlitch * half2(38., 14.) * _GlitchSize) * 4.0, randomSeed), 3.0); + col = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(lineNoise * 0.02 * rand2(half2(2.0, 1), randomSeed), 0)) * d.vertexColor; + #endif + //-------------------------------------- + + //CHROMABERR_ON + #if CHROMABERR_ON + half4 r = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(_ChromAberrAmount/10, 0)) * d.vertexColor; + half4 b = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(-_ChromAberrAmount/10, 0)) * d.vertexColor; + col = half4(r.r * r.a, col.g, b.b * b.a, max(max(r.a, b.a) * _ChromAberrAlpha, col.a)); + #endif + + //-------------------------------- + + //BLUR_ON + #if BLUR_ON + #if ATLAS_ON + #if !BLURISHD_ON + col = BlurHD(d.texcoord0.xy, _MainTex, sampler_MainTex, _BlurIntensity, (_MaxXUV - _MinXUV), (_MaxYUV - _MinYUV)) * d.vertexColor; + #else + col = Blur(d.texcoord0.xy, _MainTex, sampler_MainTex, _BlurIntensity * (_MaxXUV - _MinXUV)) * d.vertexColor; + #endif + #else + #if !BLURISHD_ON + col = BlurHD(d.texcoord0.xy, _MainTex, sampler_MainTex, _BlurIntensity, 1, 1) * d.vertexColor; + #else + col = Blur(d.texcoord0.xy, _MainTex, sampler_MainTex, _BlurIntensity) * d.vertexColor; + #endif + #endif + #endif + + //-------------------- + + //MOTIONBLUR_ON + #if MOTIONBLUR_ON + _MotionBlurAngle = _MotionBlurAngle * 3.1415926; + #define rot(n) mul(n, half2x2(cos(_MotionBlurAngle), -sin(_MotionBlurAngle), sin(_MotionBlurAngle), cos(_MotionBlurAngle))) + _MotionBlurDist = _MotionBlurDist * 0.005; + #if ATLAS_ON + _MotionBlurDist *= (_MaxXUV - _MinXUV); + #endif + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(-_MotionBlurDist, -_MotionBlurDist))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(-_MotionBlurDist * 2, -_MotionBlurDist * 2))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(-_MotionBlurDist * 3, -_MotionBlurDist * 3))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(-_MotionBlurDist * 4, -_MotionBlurDist * 4))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(_MotionBlurDist, _MotionBlurDist))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(_MotionBlurDist * 2, _MotionBlurDist * 2))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(_MotionBlurDist * 3, _MotionBlurDist * 3))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(_MotionBlurDist * 4, _MotionBlurDist * 4))); + col.rgb = col.rgb / 9; + #endif + //------------------------------------ + + //NEGATIVE_ON + #if NEGATIVE_ON + col.rgb = lerp(col.rgb, 1 - col.rgb, _NegativeAmount); + #endif + + //-------------- + half luminance = 0; + + //GREYSCALE_ON && !GREYSCALEOUTLINE_ON + #if GREYSCALE_ON && !GREYSCALEOUTLINE_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + luminance = saturate(luminance + _GreyscaleLuminosity); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _GreyscaleTintColor, _GreyscaleBlend); + #endif + //------------------------------------ + + //GHOST_ON + #if GHOST_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + half4 ghostResult; + ghostResult.a = saturate(luminance - _GhostTransparency) * col.a; + ghostResult.rgb = col.rgb * (luminance + _GhostColorBoost); + col = lerp(col, ghostResult, _GhostBlend); + #endif + //------------------------------------ + + //INNEROUTLINE_ON + #if INNEROUTLINE_ON + half3 innerT = abs(GetPixel(0, _InnerOutlineThickness, d.texcoord0.xy, _MainTex, sampler_MainTex) - GetPixel(0, -_InnerOutlineThickness, d.texcoord0.xy, _MainTex, sampler_MainTex)); + innerT += abs(GetPixel(_InnerOutlineThickness, 0, d.texcoord0.xy, _MainTex, sampler_MainTex) - GetPixel(-_InnerOutlineThickness, 0, d.texcoord0.xy, _MainTex, sampler_MainTex)); + #if !ONLYINNEROUTLINE_ON + innerT = (innerT / 2.0) * col.a * _InnerOutlineAlpha; + col.rgb += length(innerT) * _InnerOutlineColor.rgb * _InnerOutlineGlow; + #else + innerT *= col.a * _InnerOutlineAlpha; + col.rgb = length(innerT) * _InnerOutlineColor.rgb * _InnerOutlineGlow; + col.a = step(0.3, col.r+col.g+col.b); + #endif + #endif + //------------------------------------------------------- + + //HITEFFECT_ON + #if HITEFFECT_ON + col.rgb = lerp(col.rgb, _HitEffectColor.rgb * _HitEffectGlow, _HitEffectBlend); + #endif + //-------------------- + + //GRADIENT_ON + #if GRADIENT_ON + half2 tiledUvGrad = half2(uvRect.x / _MainTex_ST.x, uvRect.y / _MainTex_ST.y); + #if GRADIENT2COL_ON + _GradTopRightCol = _GradTopLeftCol; + _GradBotRightCol = _GradBotLeftCol; + #endif + #if RADIALGRADIENT_ON + half radialDist = 1 - length(tiledUvGrad - half2(0.5, 0.5)); + radialDist *= (_MainTex_TexelSize.w / _MainTex_TexelSize.z); + radialDist = saturate(_GradBoostX * radialDist); + half4 gradientResult = lerp(_GradTopLeftCol, _GradBotLeftCol, radialDist); + #else + half gradXLerpFactor = saturate(pow(tiledUvGrad.x, _GradBoostX)); + half4 gradientResult = lerp(lerp(_GradBotLeftCol, _GradBotRightCol, gradXLerpFactor), + lerp(_GradTopLeftCol, _GradTopRightCol, gradXLerpFactor), saturate(pow(tiledUvGrad.y, _GradBoostY))); + #endif + gradientResult = lerp(col, gradientResult, _GradBlend); + col.rgb = gradientResult.rgb * col.a; + col.a *= gradientResult.a; + #endif + //-------------------------------------------------------------------- + + //CONTRAST_ON + #if CONTRAST_ON + col.rgb = (col.rgb - float3(0.5, 0.5, 0.5)) * _Contrast + float3(0.5, 0.5, 0.5); + col.rgb += _Brightness; + #endif + + //------------------------------------------------------------------- + + //COLORSWAP_ON + #if COLORSWAP_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + half4 swapMask = SAMPLE_TEXTURE2D(_ColorSwapTex, sampler_ColorSwapTex, d.texcoord0.xy); + swapMask.rgb *= swapMask.a; + half3 redSwap = _ColorSwapRed * swapMask.r * saturate(luminance + _ColorSwapRedLuminosity); + half3 greenSwap = _ColorSwapGreen * swapMask.g * saturate(luminance + _ColorSwapGreenLuminosity); + half3 blueSwap = _ColorSwapBlue * swapMask.b * saturate(luminance + _ColorSwapBlueLuminosity); + swapMask.rgb = col.rgb * saturate(1 - swapMask.r - swapMask.g - swapMask.b); + col.rgb = lerp(col.rgb, swapMask.rgb + redSwap + greenSwap + blueSwap, _ColorSwapBlend); + #endif + //-------------------------------------------------------------------- + + //COLORRAMP_ON && !COLORRAMPOUTLINE_ON + #if COLORRAMP_ON && !COLORRAMPOUTLINE_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + luminance = saturate(luminance + _ColorRampLuminosity); + #if GRADIENTCOLORRAMP_ON + col.rgb = lerp(col.rgb, SAMPLE_TEXTURE2D(_ColorRampTexGradient, sampler_ColorRampTexGradient, half2(luminance, 0)).rgb, _ColorRampBlend); + #else + col.rgb = lerp(col.rgb, SAMPLE_TEXTURE2D(_ColorRampTex, sampler_ColorRampTex, half2(luminance, 0)).rgb, _ColorRampBlend); + #endif + #endif + //-------------------------------------------------------------------- + + //CHANGECOLOR_ON + #if CHANGECOLOR_ON + float3 currChangeColor = saturate(col.rgb); + luminance = 0.3 * currChangeColor.r + 0.59 * currChangeColor.g + 0.11 * currChangeColor.b; + luminance = saturate(luminance + _ColorChangeLuminosity); + half3 dif = abs(currChangeColor - _ColorChangeTarget.rgb); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _ColorChangeNewCol.rgb, + max(sign(1 - saturate(dif.x + dif.y + dif.z) - _ColorChangeTolerance), 0.0)); + #if CHANGECOLOR2_ON + dif = abs(currChangeColor - _ColorChangeTarget2.rgb); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _ColorChangeNewCol2.rgb, + max(sign(1 - saturate(dif.x + dif.y + dif.z) - _ColorChangeTolerance2), 0.0)); + #endif + #if CHANGECOLOR3_ON + dif = abs(currChangeColor - _ColorChangeTarget3.rgb); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _ColorChangeNewCol3.rgb, + max(sign(1 - saturate(dif.x + dif.y + dif.z) - _ColorChangeTolerance3), 0.0)); + #endif + #endif + //------------------------------------------------------- + + //POSTERIZE_ON && !POSTERIZEOUTLINE_ON + #if POSTERIZE_ON && !POSTERIZEOUTLINE_ON + col.rgb = pow(col.rgb, _PosterizeGamma) * _PosterizeNumColors; + col.rgb = floor(col.rgb) / _PosterizeNumColors; + col.rgb = pow(col.rgb, 1.0 / _PosterizeGamma); + #endif + //------------------------------------ + + //HSV_ON + #if HSV_ON + half3 resultHsv = half3(col.rgb); + half cosHsv = _HsvBright * _HsvSaturation * cos(_HsvShift * 3.14159265 / 180); + half sinHsv = _HsvBright * _HsvSaturation * sin(_HsvShift * 3.14159265 / 180); + resultHsv.x = (.299 * _HsvBright + .701 * cosHsv + .168 * sinHsv) * col.x + + (.587 * _HsvBright - .587 * cosHsv + .330 * sinHsv) * col.y + + (.114 * _HsvBright - .114 * cosHsv - .497 * sinHsv) * col.z; + resultHsv.y = (.299 * _HsvBright - .299 * cosHsv - .328 * sinHsv) *col.x + + (.587 * _HsvBright + .413 * cosHsv + .035 * sinHsv) * col.y + + (.114 * _HsvBright - .114 * cosHsv + .292 * sinHsv) * col.z; + resultHsv.z = (.299 * _HsvBright - .3 * cosHsv + 1.25 * sinHsv) * col.x + + (.587 * _HsvBright - .588 * cosHsv - 1.05 * sinHsv) * col.y + + (.114 * _HsvBright + .886 * cosHsv - .203 * sinHsv) * col.z; + col.rgb = resultHsv; + #endif + //------------------------------------------------------- + + //OVERLAY_ON + #if OVERLAY_ON + half2 overlayUvs = d.texcoord0.xy; + overlayUvs.x += ((_Time.y + randomSeed) * _OverlayTextureScrollXSpeed) % 1; + overlayUvs.y += ((_Time.y + randomSeed) * _OverlayTextureScrollYSpeed) % 1; + half4 overlayCol = SAMPLE_TEXTURE2D(_OverlayTex, sampler_OverlayTex, TRANSFORM_TEX(overlayUvs, _OverlayTex)); + overlayCol.rgb *= _OverlayColor.rgb * _OverlayGlow; + #if !OVERLAYMULT_ON + overlayCol.rgb *= overlayCol.a * _OverlayColor.rgb * _OverlayColor.a * _OverlayBlend; + col.rgb += overlayCol.rgb; + #else + overlayCol.a *= _OverlayColor.a; + col = lerp(col, col * overlayCol, _OverlayBlend); + #endif + #endif + + //--------------------------------- + + //OUTBASE_ON + #if OUTBASE_ON + #if OUTBASEPIXELPERF_ON + half2 destUv = half2(_OutlinePixelWidth * _MainTex_TexelSize.x, _OutlinePixelWidth * _MainTex_TexelSize.y); + #else + half2 destUv = half2(_OutlineWidth * _MainTex_TexelSize.x * 200, _OutlineWidth * _MainTex_TexelSize.y * 200); + #endif + + #if OUTDIST_ON + d.texcoord3.x += ((_Time.x + _RandomSeed) * _OutlineDistortTexXSpeed) % 1; + d.texcoord3.y += ((_Time.x + _RandomSeed) * _OutlineDistortTexYSpeed) % 1; + #if ATLAS_ON + d.texcoord3 = half2((d.texcoord3.x - _MinXUV) / (_MaxXUV - _MinXUV), (d.texcoord3.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half outDistortAmnt = (SAMPLE_TEXTURE2D(_OutlineDistortTex, sampler_OutlineDistortTex, d.texcoord3).r - 0.5) * 0.2 * _OutlineDistortAmount; + destUv.x += outDistortAmnt; + destUv.y += outDistortAmnt; + #endif + + half spriteLeft = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(destUv.x, 0)).a; + half spriteRight = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy - half2(destUv.x, 0)).a; + half spriteBottom = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(0, destUv.y)).a; + half spriteTop = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy - half2(0, destUv.y)).a; + half result = spriteLeft + spriteRight + spriteBottom + spriteTop; + + #if OUTBASE8DIR_ON + half spriteTopLeft = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(destUv.x, destUv.y)).a; + half spriteTopRight = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(-destUv.x, destUv.y)).a; + half spriteBotLeft = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(destUv.x, -destUv.y)).a; + half spriteBotRight = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(-destUv.x, -destUv.y)).a; + result = result + spriteTopLeft + spriteTopRight + spriteBotLeft + spriteBotRight; + #endif + + result = step(0.05, saturate(result)); + + #if OUTTEX_ON + d.texcoord1.x += ((_Time.x + _RandomSeed) * _OutlineTexXSpeed) % 1; + d.texcoord1.y += ((_Time.x + _RandomSeed) * _OutlineTexYSpeed) % 1; + #if ATLAS_ON + d.texcoord1 = half2((d.texcoord1.x - _MinXUV) / (_MaxXUV - _MinXUV), (d.texcoord1.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half4 tempOutColor = SAMPLE_TEXTURE2D(_OutlineTex, sampler_OutlineTex, d.texcoord1); + tempOutColor *= _OutlineColor; + _OutlineColor = tempOutColor; + #endif + + result *= (1 - originalAlpha) * _OutlineAlpha; + + half4 outline = _OutlineColor * d.vertexColor.a; + outline.rgb *= _OutlineGlow; + outline.a = result; + #if ONLYOUTLINE_ON + col = outline; + #else + col = lerp(col, outline, result); + #endif + #endif + //------------------------------------------------------- + + //FADE_ON + #if FADE_ON + half2 tiledUvFade1 = TRANSFORM_TEX(d.texcoord0, _FadeTex); + half2 tiledUvFade2 = TRANSFORM_TEX(d.texcoord0, _FadeBurnTex); + #if ATLAS_ON + tiledUvFade1 = half2((tiledUvFade1.x - _MinXUV) / (_MaxXUV - _MinXUV), (tiledUvFade1.y - _MinYUV) / (_MaxYUV - _MinYUV)); + tiledUvFade2 = half2((tiledUvFade2.x - _MinXUV) / (_MaxXUV - _MinXUV), (tiledUvFade2.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half fadeTemp = SAMPLE_TEXTURE2D(_FadeTex, sampler_FadeTex, tiledUvFade1).r; + half fade = smoothstep(_FadeAmount, _FadeAmount + _FadeBurnTransition, fadeTemp); + half fadeBurn = saturate(smoothstep(_FadeAmount - _FadeBurnWidth, _FadeAmount - _FadeBurnWidth + 0.1, fadeTemp) * _FadeAmount); + col.a *= fade; + _FadeBurnColor.rgb *= _FadeBurnGlow; + col += fadeBurn * SAMPLE_TEXTURE2D(_FadeBurnTex, sampler_FadeBurnTex, tiledUvFade2) * _FadeBurnColor * originalAlpha * (1 - col.a); + #endif + //------------------------------------------------------- + + //SHADOW_ON + #if SHADOW_ON + half shadowA = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(_ShadowX, _ShadowY)).a; + half preMultShadowMask = 1 - (saturate(shadowA - col.a) * (1 - col.a)); + col.rgb *= 1 - ((shadowA - col.a) * (1 - col.a)); + col.rgb += (_ShadowColor * shadowA) * (1 - col.a); + col.a = max(shadowA * _ShadowAlpha * d.vertexColor.a, col.a); + #endif + + //------------------------------------------------------- + + //GLOW_ON + #if GLOW_ON + half4 emission; + #if GLOWTEX_ON + emission = SAMPLE_TEXTURE2D(_GlowTex, sampler_GlowTex, d.texcoord0); + #else + emission = col; + #endif + + col.rgb *= _GlowGlobal; + emission.rgb *= emission.a * col.a * _Glow * _GlowColor; + col.rgb += emission.rgb; + #endif + //------------------------------------------------------- + + //COLORRAMP_ON && COLORRAMPOUTLINE_ON + #if COLORRAMP_ON && COLORRAMPOUTLINE_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + luminance = saturate(luminance + _ColorRampLuminosity); + #if GRADIENTCOLORRAMP_ON + col.rgb = lerp(col.rgb, SAMPLE_TEXTURE2D(_ColorRampTexGradient, sampler_ColorRampTexGradient, half2(luminance, 0)).rgb, _ColorRampBlend); + #else + col.rgb = lerp(col.rgb, SAMPLE_TEXTURE2D(_ColorRampTex, sampler_ColorRampTex, half2(luminance, 0)).rgb, _ColorRampBlend); + #endif + #endif + //--------------- + + //GREYSCALE_ON && GREYSCALEOUTLINE_ON + #if GREYSCALE_ON && GREYSCALEOUTLINE_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + luminance = saturate(luminance + _GreyscaleLuminosity); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _GreyscaleTintColor, _GreyscaleBlend); + #endif + + //----------------------------------- + + //POSTERIZE_ON && POSTERIZEOUTLINE_ON + #if POSTERIZE_ON && POSTERIZEOUTLINE_ON + col.rgb = pow(col.rgb, _PosterizeGamma) * _PosterizeNumColors; + col.rgb = floor(col.rgb) / _PosterizeNumColors; + col.rgb = pow(col.rgb, 1.0 / _PosterizeGamma); + #endif + + //----------------------------------- + + //SHINE_ON + #if SHINE_ON + half2 uvShine = uvRect; + half cosAngle = cos(_ShineRotate); + half sinAngle = sin(_ShineRotate); + half2x2 rot = half2x2(cosAngle, -sinAngle, sinAngle, cosAngle); + uvShine -= half2(0.5, 0.5); + uvShine = mul(rot, uvShine); + uvShine += half2(0.5, 0.5); + half shineMask = SAMPLE_TEXTURE2D(_ShineMask, sampler_ShineMask, d.texcoord0.xy).a; + half currentDistanceProjection = (uvShine.x + uvShine.y) / 2; + half whitePower = 1 - (abs(currentDistanceProjection - _ShineLocation) / _ShineWidth); + col.rgb += col.a * whitePower * _ShineGlow * max(sign(currentDistanceProjection - (_ShineLocation - _ShineWidth)), 0.0) + * max(sign((_ShineLocation + _ShineWidth) - currentDistanceProjection), 0.0) * _ShineColor * shineMask; + #endif + + //----------------------------------- + + //HOLOGRAM_ON + #if HOLOGRAM_ON + half totalHologram = _HologramStripesAmount + _HologramUnmodAmount; + half hologramYCoord = ((uvRect.y + (((_Time.x + randomSeed) % 1) * _HologramStripesSpeed)) % totalHologram) / totalHologram; + hologramYCoord = abs(hologramYCoord); + half alpha = RemapFloat(saturate(hologramYCoord - (_HologramUnmodAmount/totalHologram)), 0.0, 1.0, _HologramMinAlpha, saturate(_HologramMaxAlpha)); + half hologramMask = max(sign((_HologramUnmodAmount/totalHologram) - hologramYCoord), 0.0); + half4 hologramResult = col; + hologramResult.a *= lerp(alpha, 1, hologramMask); + hologramResult.rgb *= max(1, _HologramMaxAlpha * max(sign(hologramYCoord - (_HologramUnmodAmount/totalHologram)), 0.0)); + hologramMask = 1 - step(0.01,hologramMask); + hologramResult.rgb += hologramMask * _HologramStripeColor * col.a; + col = lerp(col, hologramResult, _HologramBlend); + #endif + + //----------------------------------- + + //FLICKER_ON + #if FLICKER_ON + col.a *= saturate(col.a * step(frac(0.05 + (_Time.w + randomSeed) * _FlickerFreq), 1 - _FlickerPercent) + _FlickerAlpha); + #endif + //----------------------------------- + + //ALPHACUTOFF_ON + + //ALPHAROUND_ON + + //ALPHAOUTLINE_ON + #if ALPHAOUTLINE_ON + half alphaOutlineRes = pow(1 - col.a, max(_AlphaOutlinePower, 0.0001)) * step(_AlphaOutlineMinAlpha, col.a) * _AlphaOutlineBlend; + col.rgb = lerp(col.rgb, _AlphaOutlineColor.rgb * _AlphaOutlineGlow, alphaOutlineRes); + col.a = lerp(col.a, 1, alphaOutlineRes > 1); + #endif + //------------------------------------------------------- + + //FOG_ON + + //------------------ + + col *= _Color; + o.Albedo = col; + col.a *= _Alpha; + clip(col.a - _AlphaCutoffValue - 0.01); + o.Alpha = _Color.a; + } + + + + + + void ChainSurfaceFunction(inout Surface l, inout ShaderData d) + { + Ext_SurfaceFunction0(l, d); + // Ext_SurfaceFunction1(l, d); + // Ext_SurfaceFunction2(l, d); + // Ext_SurfaceFunction3(l, d); + // Ext_SurfaceFunction4(l, d); + // Ext_SurfaceFunction5(l, d); + // Ext_SurfaceFunction6(l, d); + // Ext_SurfaceFunction7(l, d); + // Ext_SurfaceFunction8(l, d); + // Ext_SurfaceFunction9(l, d); + // Ext_SurfaceFunction10(l, d); + // Ext_SurfaceFunction11(l, d); + // Ext_SurfaceFunction12(l, d); + // Ext_SurfaceFunction13(l, d); + // Ext_SurfaceFunction14(l, d); + // Ext_SurfaceFunction15(l, d); + // Ext_SurfaceFunction16(l, d); + // Ext_SurfaceFunction17(l, d); + // Ext_SurfaceFunction18(l, d); + // Ext_SurfaceFunction19(l, d); + // Ext_SurfaceFunction20(l, d); + // Ext_SurfaceFunction21(l, d); + // Ext_SurfaceFunction22(l, d); + // Ext_SurfaceFunction23(l, d); + // Ext_SurfaceFunction24(l, d); + // Ext_SurfaceFunction25(l, d); + // Ext_SurfaceFunction26(l, d); + // Ext_SurfaceFunction27(l, d); + // Ext_SurfaceFunction28(l, d); + // Ext_SurfaceFunction29(l, d); + } + +#if !_DECALSHADER + + void ChainModifyVertex(inout VertexData v, inout VertexToPixel v2p, float4 time) + { + ExtraV2F d; + + ZERO_INITIALIZE(ExtraV2F, d); + ZERO_INITIALIZE(Blackboard, d.blackboard); + // due to motion vectors in HDRP, we need to use the last + // time in certain spots. So if you are going to use _Time to adjust vertices, + // you need to use this time or motion vectors will break. + d.time = time; + + Ext_ModifyVertex0(v, d); + // Ext_ModifyVertex1(v, d); + // Ext_ModifyVertex2(v, d); + // Ext_ModifyVertex3(v, d); + // Ext_ModifyVertex4(v, d); + // Ext_ModifyVertex5(v, d); + // Ext_ModifyVertex6(v, d); + // Ext_ModifyVertex7(v, d); + // Ext_ModifyVertex8(v, d); + // Ext_ModifyVertex9(v, d); + // Ext_ModifyVertex10(v, d); + // Ext_ModifyVertex11(v, d); + // Ext_ModifyVertex12(v, d); + // Ext_ModifyVertex13(v, d); + // Ext_ModifyVertex14(v, d); + // Ext_ModifyVertex15(v, d); + // Ext_ModifyVertex16(v, d); + // Ext_ModifyVertex17(v, d); + // Ext_ModifyVertex18(v, d); + // Ext_ModifyVertex19(v, d); + // Ext_ModifyVertex20(v, d); + // Ext_ModifyVertex21(v, d); + // Ext_ModifyVertex22(v, d); + // Ext_ModifyVertex23(v, d); + // Ext_ModifyVertex24(v, d); + // Ext_ModifyVertex25(v, d); + // Ext_ModifyVertex26(v, d); + // Ext_ModifyVertex27(v, d); + // Ext_ModifyVertex28(v, d); + // Ext_ModifyVertex29(v, d); + + + // #if %EXTRAV2F0REQUIREKEY% + // v2p.extraV2F0 = d.extraV2F0; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // v2p.extraV2F1 = d.extraV2F1; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // v2p.extraV2F2 = d.extraV2F2; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // v2p.extraV2F3 = d.extraV2F3; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // v2p.extraV2F4 = d.extraV2F4; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // v2p.extraV2F5 = d.extraV2F5; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // v2p.extraV2F6 = d.extraV2F6; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // v2p.extraV2F7 = d.extraV2F7; + // #endif + } + + void ChainModifyTessellatedVertex(inout VertexData v, inout VertexToPixel v2p) + { + ExtraV2F d; + ZERO_INITIALIZE(ExtraV2F, d); + ZERO_INITIALIZE(Blackboard, d.blackboard); + + // #if %EXTRAV2F0REQUIREKEY% + // d.extraV2F0 = v2p.extraV2F0; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // d.extraV2F1 = v2p.extraV2F1; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // d.extraV2F2 = v2p.extraV2F2; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // d.extraV2F3 = v2p.extraV2F3; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // d.extraV2F4 = v2p.extraV2F4; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // d.extraV2F5 = v2p.extraV2F5; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // d.extraV2F6 = v2p.extraV2F6; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // d.extraV2F7 = v2p.extraV2F7; + // #endif + + + // Ext_ModifyTessellatedVertex0(v, d); + // Ext_ModifyTessellatedVertex1(v, d); + // Ext_ModifyTessellatedVertex2(v, d); + // Ext_ModifyTessellatedVertex3(v, d); + // Ext_ModifyTessellatedVertex4(v, d); + // Ext_ModifyTessellatedVertex5(v, d); + // Ext_ModifyTessellatedVertex6(v, d); + // Ext_ModifyTessellatedVertex7(v, d); + // Ext_ModifyTessellatedVertex8(v, d); + // Ext_ModifyTessellatedVertex9(v, d); + // Ext_ModifyTessellatedVertex10(v, d); + // Ext_ModifyTessellatedVertex11(v, d); + // Ext_ModifyTessellatedVertex12(v, d); + // Ext_ModifyTessellatedVertex13(v, d); + // Ext_ModifyTessellatedVertex14(v, d); + // Ext_ModifyTessellatedVertex15(v, d); + // Ext_ModifyTessellatedVertex16(v, d); + // Ext_ModifyTessellatedVertex17(v, d); + // Ext_ModifyTessellatedVertex18(v, d); + // Ext_ModifyTessellatedVertex19(v, d); + // Ext_ModifyTessellatedVertex20(v, d); + // Ext_ModifyTessellatedVertex21(v, d); + // Ext_ModifyTessellatedVertex22(v, d); + // Ext_ModifyTessellatedVertex23(v, d); + // Ext_ModifyTessellatedVertex24(v, d); + // Ext_ModifyTessellatedVertex25(v, d); + // Ext_ModifyTessellatedVertex26(v, d); + // Ext_ModifyTessellatedVertex27(v, d); + // Ext_ModifyTessellatedVertex28(v, d); + // Ext_ModifyTessellatedVertex29(v, d); + + // #if %EXTRAV2F0REQUIREKEY% + // v2p.extraV2F0 = d.extraV2F0; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // v2p.extraV2F1 = d.extraV2F1; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // v2p.extraV2F2 = d.extraV2F2; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // v2p.extraV2F3 = d.extraV2F3; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // v2p.extraV2F4 = d.extraV2F4; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // v2p.extraV2F5 = d.extraV2F5; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // v2p.extraV2F6 = d.extraV2F6; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // v2p.extraV2F7 = d.extraV2F7; + // #endif + } + + void ChainFinalColorForward(inout Surface l, inout ShaderData d, inout half4 color) + { + // Ext_FinalColorForward0(l, d, color); + // Ext_FinalColorForward1(l, d, color); + // Ext_FinalColorForward2(l, d, color); + // Ext_FinalColorForward3(l, d, color); + // Ext_FinalColorForward4(l, d, color); + // Ext_FinalColorForward5(l, d, color); + // Ext_FinalColorForward6(l, d, color); + // Ext_FinalColorForward7(l, d, color); + // Ext_FinalColorForward8(l, d, color); + // Ext_FinalColorForward9(l, d, color); + // Ext_FinalColorForward10(l, d, color); + // Ext_FinalColorForward11(l, d, color); + // Ext_FinalColorForward12(l, d, color); + // Ext_FinalColorForward13(l, d, color); + // Ext_FinalColorForward14(l, d, color); + // Ext_FinalColorForward15(l, d, color); + // Ext_FinalColorForward16(l, d, color); + // Ext_FinalColorForward17(l, d, color); + // Ext_FinalColorForward18(l, d, color); + // Ext_FinalColorForward19(l, d, color); + // Ext_FinalColorForward20(l, d, color); + // Ext_FinalColorForward21(l, d, color); + // Ext_FinalColorForward22(l, d, color); + // Ext_FinalColorForward23(l, d, color); + // Ext_FinalColorForward24(l, d, color); + // Ext_FinalColorForward25(l, d, color); + // Ext_FinalColorForward26(l, d, color); + // Ext_FinalColorForward27(l, d, color); + // Ext_FinalColorForward28(l, d, color); + // Ext_FinalColorForward29(l, d, color); + } + + void ChainFinalGBufferStandard(inout Surface s, inout ShaderData d, inout half4 GBuffer0, inout half4 GBuffer1, inout half4 GBuffer2, inout half4 outEmission, inout half4 outShadowMask) + { + // Ext_FinalGBufferStandard0(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard1(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard2(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard3(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard4(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard5(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard6(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard7(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard8(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard9(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard10(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard11(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard12(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard13(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard14(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard15(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard16(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard17(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard18(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard19(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard20(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard21(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard22(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard23(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard24(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard25(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard26(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard27(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard28(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard29(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + } +#endif + + + + + +#if _DECALSHADER + + ShaderData CreateShaderData(SurfaceDescriptionInputs IN) + { + ShaderData d = (ShaderData)0; + d.TBNMatrix = float3x3(IN.WorldSpaceTangent, IN.WorldSpaceBiTangent, IN.WorldSpaceNormal); + d.worldSpaceNormal = IN.WorldSpaceNormal; + d.worldSpaceTangent = IN.WorldSpaceTangent; + + d.worldSpacePosition = IN.WorldSpacePosition; + d.texcoord0 = IN.uv0.xyxy; + d.screenPos = IN.ScreenPosition; + + d.worldSpaceViewDir = normalize(_WorldSpaceCameraPos - d.worldSpacePosition); + + d.tangentSpaceViewDir = mul(d.TBNMatrix, d.worldSpaceViewDir); + + // these rarely get used, so we back transform them. Usually will be stripped. + #if _HDRP + // d.localSpacePosition = mul(GetWorldToObjectMatrix(), float4(GetCameraRelativePositionWS(d.worldSpacePosition), 1)).xyz; + #else + // d.localSpacePosition = mul(GetWorldToObjectMatrix(), float4(d.worldSpacePosition, 1)).xyz; + #endif + // d.localSpaceNormal = normalize(mul((float3x3)GetWorldToObjectMatrix(), d.worldSpaceNormal)); + // d.localSpaceTangent = normalize(mul((float3x3)GetWorldToObjectMatrix(), d.worldSpaceTangent.xyz)); + + // #if %SCREENPOSREQUIREKEY% + // d.screenUV = (IN.ScreenPosition.xy / max(0.01, IN.ScreenPosition.w)); + // #endif + + return d; + } +#else + + ShaderData CreateShaderData(VertexToPixel i + #if NEED_FACING + , bool facing + #endif + ) + { + ShaderData d = (ShaderData)0; + d.clipPos = i.pos; + d.worldSpacePosition = i.worldPos; + + d.worldSpaceNormal = normalize(i.worldNormal); + d.worldSpaceTangent.xyz = normalize(i.worldTangent.xyz); + + d.tangentSign = i.worldTangent.w * unity_WorldTransformParams.w; + float3 bitangent = cross(d.worldSpaceTangent.xyz, d.worldSpaceNormal) * d.tangentSign; + + d.TBNMatrix = float3x3(d.worldSpaceTangent, -bitangent, d.worldSpaceNormal); + d.worldSpaceViewDir = normalize(_WorldSpaceCameraPos - i.worldPos); + + d.tangentSpaceViewDir = mul(d.TBNMatrix, d.worldSpaceViewDir); + d.texcoord0 = i.texcoord0; + d.texcoord1 = i.texcoord1; + d.texcoord2 = i.texcoord2; + + // #if %TEXCOORD3REQUIREKEY% + d.texcoord3 = i.texcoord3; + // #endif + + // d.isFrontFace = facing; + // #if %VERTEXCOLORREQUIREKEY% + d.vertexColor = i.vertexColor; + // #endif + + // these rarely get used, so we back transform them. Usually will be stripped. + #if _HDRP + // d.localSpacePosition = mul(GetWorldToObjectMatrix(), float4(GetCameraRelativePositionWS(i.worldPos), 1)).xyz; + #else + // d.localSpacePosition = mul(GetWorldToObjectMatrix(), float4(i.worldPos, 1)).xyz; + #endif + // d.localSpaceNormal = normalize(mul((float3x3)GetWorldToObjectMatrix(), i.worldNormal)); + // d.localSpaceTangent = normalize(mul((float3x3)GetWorldToObjectMatrix(), i.worldTangent.xyz)); + + // #if %SCREENPOSREQUIREKEY% + // d.screenPos = i.screenPos; + // d.screenUV = (i.screenPos.xy / i.screenPos.w); + // #endif + + + // #if %EXTRAV2F0REQUIREKEY% + // d.extraV2F0 = i.extraV2F0; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // d.extraV2F1 = i.extraV2F1; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // d.extraV2F2 = i.extraV2F2; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // d.extraV2F3 = i.extraV2F3; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // d.extraV2F4 = i.extraV2F4; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // d.extraV2F5 = i.extraV2F5; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // d.extraV2F6 = i.extraV2F6; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // d.extraV2F7 = i.extraV2F7; + // #endif + + return d; + } + +#endif + + + // vertex shader + VertexToPixel Vert (VertexData v) + { + UNITY_SETUP_INSTANCE_ID(v); + VertexToPixel o; + UNITY_INITIALIZE_OUTPUT(VertexToPixel,o); + UNITY_TRANSFER_INSTANCE_ID(v,o); + UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o); + +#if !_TESSELLATION_ON + ChainModifyVertex(v, o, _Time); +#endif + + o.pos = UnityObjectToClipPos(v.vertex); + o.texcoord0 = v.texcoord0; + o.texcoord1 = v.texcoord1; + o.texcoord2 = v.texcoord2; + + // #if %TEXCOORD3REQUIREKEY% + o.texcoord3 = v.texcoord3; + // #endif + + // #if %VERTEXCOLORREQUIREKEY% + o.vertexColor = v.vertexColor; + // #endif + + // #if %SCREENPOSREQUIREKEY% + // o.screenPos = ComputeScreenPos(o.pos); + // #endif + + o.worldPos = mul(GetObjectToWorldMatrix(), v.vertex).xyz; + o.worldNormal = UnityObjectToWorldNormal(v.normal); + o.worldTangent = float4(UnityObjectToWorldDir(v.tangent.xyz), v.tangent.w); + + + float3 viewDirForLight = UnityWorldSpaceViewDir(o.worldPos); + #ifndef DIRLIGHTMAP_OFF + float3 worldBinormal = cross(o.worldNormal, o.worldTangent.xyz); + o.viewDir.x = dot(viewDirForLight, o.worldTangent.xyz); + o.viewDir.y = dot(viewDirForLight, worldBinormal); + o.viewDir.z = dot(viewDirForLight, o.worldNormal); + #endif + #ifdef DYNAMICLIGHTMAP_ON + o.lmap.zw = v.texcoord2.xy * unity_DynamicLightmapST.xy + unity_DynamicLightmapST.zw; + #else + o.lmap.zw = 0; + #endif + #ifdef LIGHTMAP_ON + o.lmap.xy = v.texcoord1.xy * unity_LightmapST.xy + unity_LightmapST.zw; + #ifdef DIRLIGHTMAP_OFF + o.lmapFadePos.xyz = (mul(GetObjectToWorldMatrix(), v.vertex).xyz - unity_ShadowFadeCenterAndType.xyz) * unity_ShadowFadeCenterAndType.w; + o.lmapFadePos.w = (-UnityObjectToViewPos(v.vertex).z) * (1.0 - unity_ShadowFadeCenterAndType.w); + #endif + #else + o.lmap.xy = 0; + #if UNITY_SHOULD_SAMPLE_SH && !UNITY_SAMPLE_FULL_SH_PER_PIXEL + o.sh = 0; + o.sh = ShadeSHPerVertex (o.worldNormal, o.sh); + #endif + #endif + + return o; + } + + + + #ifdef LIGHTMAP_ON + float4 unity_LightmapFade; + #endif + fixed4 unity_Ambient; + + + + // fragment shader + void Frag (VertexToPixel IN, + out half4 outGBuffer0 : SV_Target0, + out half4 outGBuffer1 : SV_Target1, + out half4 outGBuffer2 : SV_Target2, + out half4 outEmission : SV_Target3 + #if defined(SHADOWS_SHADOWMASK) && (UNITY_ALLOWED_MRT_COUNT > 4) + , out half4 outShadowMask : SV_Target4 + #endif + #ifdef _DEPTHOFFSET_ON + , out float outputDepth : SV_Depth + #endif + #if NEED_FACING + , bool facing : SV_IsFrontFace + #endif + ) + { + UNITY_SETUP_INSTANCE_ID(IN); + // prepare and unpack data + + #ifdef FOG_COMBINED_WITH_TSPACE + UNITY_EXTRACT_FOG_FROM_TSPACE(IN); + #elif defined FOG_COMBINED_WITH_WORLD_POS + UNITY_EXTRACT_FOG_FROM_WORLD_POS(IN); + #else + UNITY_EXTRACT_FOG(IN); + #endif + + ShaderData d = CreateShaderData(IN + #if NEED_FACING + , facing + #endif + ); + Surface l = (Surface)0; + + #ifdef _DEPTHOFFSET_ON + l.outputDepth = outputDepth; + #endif + + l.Albedo = half3(0.5, 0.5, 0.5); + l.Normal = float3(0,0,1); + l.Occlusion = 1; + l.Alpha = 1; + + ChainSurfaceFunction(l, d); + + #ifdef _DEPTHOFFSET_ON + outputDepth = l.outputDepth; + #endif + + + + + + #ifndef USING_DIRECTIONAL_LIGHT + fixed3 lightDir = normalize(UnityWorldSpaceLightDir(d.worldSpacePosition)); + #else + fixed3 lightDir = _WorldSpaceLightPos0.xyz; + #endif + float3 worldViewDir = normalize(UnityWorldSpaceViewDir(d.worldSpacePosition)); + + #if _USESPECULAR || _USESPECULARWORKFLOW || _SPECULARFROMMETALLIC + #ifdef UNITY_COMPILER_HLSL + SurfaceOutputStandardSpecular o = (SurfaceOutputStandardSpecular)0; + #else + SurfaceOutputStandardSpecular o; + #endif + o.Specular = l.Specular; + o.Occlusion = l.Occlusion; + o.Smoothness = l.Smoothness; + #elif _BDRFLAMBERT || _BDRF3 || _SIMPLELIT + #ifdef UNITY_COMPILER_HLSL + SurfaceOutput o = (SurfaceOutput)0; + #else + SurfaceOutput o; + #endif + + o.Specular = l.SpecularPower; + o.Gloss = l.Smoothness; + _SpecColor.rgb = l.Specular; // fucking hell Unity, wtf.. + #else + #ifdef UNITY_COMPILER_HLSL + SurfaceOutputStandard o = (SurfaceOutputStandard)0; + #else + SurfaceOutputStandard o; + #endif + o.Smoothness = l.Smoothness; + o.Metallic = l.Metallic; + o.Occlusion = l.Occlusion; + #endif + + + + o.Albedo = l.Albedo; + o.Emission = l.Emission; + o.Alpha = l.Alpha; + + #if _WORLDSPACENORMAL + o.Normal = l.Normal; + #else + o.Normal = normalize(TangentToWorldSpace(d, l.Normal)); + #endif + + + half atten = 1; + + // Setup lighting environment + UnityGI gi; + UNITY_INITIALIZE_OUTPUT(UnityGI, gi); + gi.indirect.diffuse = 0; + gi.indirect.specular = 0; + gi.light.color = 0; + gi.light.dir = half3(0,1,0); + // Call GI (lightmaps/SH/reflections) lighting function + UnityGIInput giInput; + UNITY_INITIALIZE_OUTPUT(UnityGIInput, giInput); + giInput.light = gi.light; + giInput.worldPos = d.worldSpacePosition; + giInput.worldViewDir = worldViewDir; + giInput.atten = atten; + #if defined(LIGHTMAP_ON) || defined(DYNAMICLIGHTMAP_ON) + giInput.lightmapUV = IN.lmap; + #else + giInput.lightmapUV = 0.0; + #endif + #if UNITY_SHOULD_SAMPLE_SH && !UNITY_SAMPLE_FULL_SH_PER_PIXEL + giInput.ambient = IN.sh; + #else + giInput.ambient.rgb = 0.0; + #endif + giInput.probeHDR[0] = unity_SpecCube0_HDR; + giInput.probeHDR[1] = unity_SpecCube1_HDR; + #if defined(UNITY_SPECCUBE_BLENDING) || defined(UNITY_SPECCUBE_BOX_PROJECTION) + giInput.boxMin[0] = unity_SpecCube0_BoxMin; // .w holds lerp value for blending + #endif + #ifdef UNITY_SPECCUBE_BOX_PROJECTION + giInput.boxMax[0] = unity_SpecCube0_BoxMax; + giInput.probePosition[0] = unity_SpecCube0_ProbePosition; + giInput.boxMax[1] = unity_SpecCube1_BoxMax; + giInput.boxMin[1] = unity_SpecCube1_BoxMin; + giInput.probePosition[1] = unity_SpecCube1_ProbePosition; + #endif + + + + #if _BDRF3 || _SIMPLELIT + + LightingBlinnPhong_GI(o, giInput, gi); + #if defined(_OVERRIDE_BAKEDGI) + gi.indirect.diffuse = l.DiffuseGI; + gi.indirect.specular = l.SpecularGI; + #endif + + outEmission = LightingBlinnPhong_Deferred(o, worldViewDir, gi, outGBuffer0, outGBuffer1, outGBuffer2); + #if defined(SHADOWS_SHADOWMASK) && (UNITY_ALLOWED_MRT_COUNT > 4) + outShadowMask = UnityGetRawBakedOcclusions (IN.lmap.xy, d.worldSpacePosition); + #endif + #ifndef UNITY_HDR_ON + outEmission.rgb = exp2(-outEmission.rgb); + #endif + #elif _USESPECULAR || _USESPECULARWORKFLOW || _SPECULARFROMMETALLIC + LightingStandardSpecular_GI(o, giInput, gi); + #if defined(_OVERRIDE_BAKEDGI) + gi.indirect.diffuse = l.DiffuseGI; + gi.indirect.specular = l.SpecularGI; + #endif + // call lighting function to output g-buffer + outEmission = LightingStandardSpecular_Deferred (o, worldViewDir, gi, outGBuffer0, outGBuffer1, outGBuffer2); + #if defined(SHADOWS_SHADOWMASK) && (UNITY_ALLOWED_MRT_COUNT > 4) + outShadowMask = UnityGetRawBakedOcclusions (IN.lmap.xy, d.worldSpacePosition); + #endif + #ifndef UNITY_HDR_ON + outEmission.rgb = exp2(-outEmission.rgb); + #endif + #else + LightingStandard_GI(o, giInput, gi); + #if defined(_OVERRIDE_BAKEDGI) + gi.indirect.diffuse = l.DiffuseGI; + gi.indirect.specular = l.SpecularGI; + #endif + // call lighting function to output g-buffer + outEmission = LightingStandard_Deferred (o, worldViewDir, gi, outGBuffer0, outGBuffer1, outGBuffer2); + #if defined(SHADOWS_SHADOWMASK) && (UNITY_ALLOWED_MRT_COUNT > 4) + outShadowMask = UnityGetRawBakedOcclusions (IN.lmap.xy, d.worldSpacePosition); + #endif + #ifndef UNITY_HDR_ON + outEmission.rgb = exp2(-outEmission.rgb); + #endif + #endif + + #if defined(_OVERRIDE_SHADOWMASK) && defined(SHADOWS_SHADOWMASK) && (UNITY_ALLOWED_MRT_COUNT > 4) + float4 mulColor = saturate(dot(l.ShadowMask, unity_OcclusionMaskSelector)); + outShadowMask = mulColor; + #endif + + #if defined(SHADOWS_SHADOWMASK) && (UNITY_ALLOWED_MRT_COUNT > 4) + ChainFinalGBufferStandard(l, d, outGBuffer0, outGBuffer1, outGBuffer2, outEmission, outShadowMask); + #else + half4 outShadowMask = 0; + ChainFinalGBufferStandard(l, d, outGBuffer0, outGBuffer1, outGBuffer2, outEmission, outShadowMask); + #endif + + + } + + + + + ENDCG + + } + + + + + // ---- forward rendering additive lights pass: + Pass + { + Name "FORWARD" + Tags { "LightMode" = "ForwardAdd" } + ZWrite Off Blend One One + + Tags { "RenderType" = "Opaque" "Queue" = "Geometry" "PreviewType" = "Plane" } + Cull [_CullingOption] + ZWrite [_ZWrite] + ZTest [_ZTestMode] + + + CGPROGRAM + + #pragma vertex Vert + #pragma fragment Frag + + // compile directives + #pragma target 3.0 + #pragma multi_compile_instancing + #pragma multi_compile_fog + #pragma skip_variants INSTANCING_ON + #pragma multi_compile_fwdadd_fullshadows + #include "HLSLSupport.cginc" + #define UNITY_INSTANCED_LOD_FADE + #define UNITY_INSTANCED_SH + #define UNITY_INSTANCED_LIGHTMAPSTS + #include "UnityShaderVariables.cginc" + #include "UnityShaderUtilities.cginc" + + + #include "UnityCG.cginc" + #include "Lighting.cginc" + #include "UnityPBSLighting.cginc" + #include "AutoLight.cginc" + + + + #define _PASSFORWARD 1 + #define _PASSFORWARDADD 1 + + + #pragma shader_feature_local GLOW_ON + #pragma shader_feature_local FADE_ON + #pragma shader_feature_local OUTBASE_ON + #pragma shader_feature_local ONLYOUTLINE_ON + #pragma shader_feature_local GRADIENT_ON + #pragma shader_feature_local GRADIENT2COL_ON + #pragma shader_feature_local RADIALGRADIENT_ON + #pragma shader_feature_local COLORSWAP_ON + #pragma shader_feature_local HSV_ON + #pragma shader_feature_local CHANGECOLOR_ON + #pragma shader_feature_local CHANGECOLOR2_ON + #pragma shader_feature_local CHANGECOLOR3_ON + #pragma shader_feature_local COLORRAMP_ON + #pragma shader_feature_local GRADIENTCOLORRAMP_ON + #pragma shader_feature_local HITEFFECT_ON + #pragma shader_feature_local NEGATIVE_ON + #pragma shader_feature_local PIXELATE_ON + #pragma shader_feature_local GREYSCALE_ON + #pragma shader_feature_local POSTERIZE_ON + #pragma shader_feature_local BLUR_ON + #pragma shader_feature_local MOTIONBLUR_ON + #pragma shader_feature_local GHOST_ON + #pragma shader_feature_local ALPHAOUTLINE_ON + #pragma shader_feature_local INNEROUTLINE_ON + #pragma shader_feature_local ONLYINNEROUTLINE_ON + #pragma shader_feature_local HOLOGRAM_ON + #pragma shader_feature_local CHROMABERR_ON + #pragma shader_feature_local GLITCH_ON + #pragma shader_feature_local FLICKER_ON + #pragma shader_feature_local SHADOW_ON + #pragma shader_feature_local SHINE_ON + #pragma shader_feature_local CONTRAST_ON + #pragma shader_feature_local OVERLAY_ON + #pragma shader_feature_local OVERLAYMULT_ON + #pragma shader_feature_local DOODLE_ON + #pragma shader_feature_local WIND_ON + #pragma shader_feature_local WAVEUV_ON + #pragma shader_feature_local ROUNDWAVEUV_ON + #pragma shader_feature_local RECTSIZE_ON + #pragma shader_feature_local OFFSETUV_ON + #pragma shader_feature_local CLIPPING_ON + #pragma shader_feature_local RADIALCLIPPING_ON + #pragma shader_feature_local TEXTURESCROLL_ON + #pragma shader_feature_local ZOOMUV_ON + #pragma shader_feature_local DISTORT_ON + #pragma shader_feature_local WARP_ON + #pragma shader_feature_local TWISTUV_ON + #pragma shader_feature_local ROTATEUV_ON + #pragma shader_feature_local POLARUV_ON + #pragma shader_feature_local FISHEYE_ON + #pragma shader_feature_local PINCH_ON + #pragma shader_feature_local SHAKEUV_ON + + #pragma shader_feature_local GLOWTEX_ON + #pragma shader_feature_local OUTTEX_ON + #pragma shader_feature_local OUTDIST_ON + #pragma shader_feature_local OUTBASE8DIR_ON + #pragma shader_feature_local OUTBASEPIXELPERF_ON + #pragma shader_feature_local COLORRAMPOUTLINE_ON + #pragma shader_feature_local GREYSCALEOUTLINE_ON + #pragma shader_feature_local POSTERIZEOUTLINE_ON + #pragma shader_feature_local BLURISHD_ON + #pragma shader_feature_local MANUALWIND_ON + #pragma shader_feature_local ATLAS_ON + #pragma shader_feature_local PREMULTIPLYALPHA_ON + + #pragma shader_feature BILBOARD_ON + #pragma shader_feature BILBOARDY_ON + + #pragma shader_feature NORMALMAP_ON + + + #define _STANDARD 1 +// If your looking in here and thinking WTF, yeah, I know. These are taken from the SRPs, to allow us to use the same +// texturing library they use. However, since they are not included in the standard pipeline by default, there is no +// way to include them in and they have to be inlined, since someone could copy this shader onto another machine without +// Better Shaders installed. Unfortunate, but I'd rather do this and have a nice library for texture sampling instead +// of the patchy one Unity provides being inlined/emulated in HDRP/URP. Strangely, PSSL and XBoxOne libraries are not +// included in the standard SRP code, but they are in tons of Unity own projects on the web, so I grabbed them from there. + +#if defined(SHADER_API_GAMECORE) + + #define ZERO_INITIALIZE(type, name) name = (type)0; + #define ZERO_INITIALIZE_ARRAY(type, name, arraySize) { for (int arrayIndex = 0; arrayIndex < arraySize; arrayIndex++) { name[arrayIndex] = (type)0; } } + + // Texture util abstraction + + #define CALCULATE_TEXTURE2D_LOD(textureName, samplerName, coord2) textureName.CalculateLevelOfDetail(samplerName, coord2) + + // Texture abstraction + + #define TEXTURE2D(textureName) Texture2D textureName + #define TEXTURE2D_ARRAY(textureName) Texture2DArray textureName + #define TEXTURECUBE(textureName) TextureCube textureName + #define TEXTURECUBE_ARRAY(textureName) TextureCubeArray textureName + #define TEXTURE3D(textureName) Texture3D textureName + + #define TEXTURE2D_FLOAT(textureName) TEXTURE2D(textureName) + #define TEXTURE2D_ARRAY_FLOAT(textureName) TEXTURE2D_ARRAY(textureName) + #define TEXTURECUBE_FLOAT(textureName) TEXTURECUBE(textureName) + #define TEXTURECUBE_ARRAY_FLOAT(textureName) TEXTURECUBE_ARRAY(textureName) + #define TEXTURE3D_FLOAT(textureName) TEXTURE3D(textureName) + + #define TEXTURE2D_HALF(textureName) TEXTURE2D(textureName) + #define TEXTURE2D_ARRAY_HALF(textureName) TEXTURE2D_ARRAY(textureName) + #define TEXTURECUBE_HALF(textureName) TEXTURECUBE(textureName) + #define TEXTURECUBE_ARRAY_HALF(textureName) TEXTURECUBE_ARRAY(textureName) + #define TEXTURE3D_HALF(textureName) TEXTURE3D(textureName) + + #define TEXTURE2D_SHADOW(textureName) TEXTURE2D(textureName) + #define TEXTURE2D_ARRAY_SHADOW(textureName) TEXTURE2D_ARRAY(textureName) + #define TEXTURECUBE_SHADOW(textureName) TEXTURECUBE(textureName) + #define TEXTURECUBE_ARRAY_SHADOW(textureName) TEXTURECUBE_ARRAY(textureName) + + #define RW_TEXTURE2D(type, textureName) RWTexture2D textureName + #define RW_TEXTURE2D_ARRAY(type, textureName) RWTexture2DArray textureName + #define RW_TEXTURE3D(type, textureName) RWTexture3D textureName + + #define SAMPLER(samplerName) SamplerState samplerName + #define SAMPLER_CMP(samplerName) SamplerComparisonState samplerName + #define ASSIGN_SAMPLER(samplerName, samplerValue) samplerName = samplerValue + + #define TEXTURE2D_PARAM(textureName, samplerName) TEXTURE2D(textureName), SAMPLER(samplerName) + #define TEXTURE2D_ARRAY_PARAM(textureName, samplerName) TEXTURE2D_ARRAY(textureName), SAMPLER(samplerName) + #define TEXTURECUBE_PARAM(textureName, samplerName) TEXTURECUBE(textureName), SAMPLER(samplerName) + #define TEXTURECUBE_ARRAY_PARAM(textureName, samplerName) TEXTURECUBE_ARRAY(textureName), SAMPLER(samplerName) + #define TEXTURE3D_PARAM(textureName, samplerName) TEXTURE3D(textureName), SAMPLER(samplerName) + + #define TEXTURE2D_SHADOW_PARAM(textureName, samplerName) TEXTURE2D(textureName), SAMPLER_CMP(samplerName) + #define TEXTURE2D_ARRAY_SHADOW_PARAM(textureName, samplerName) TEXTURE2D_ARRAY(textureName), SAMPLER_CMP(samplerName) + #define TEXTURECUBE_SHADOW_PARAM(textureName, samplerName) TEXTURECUBE(textureName), SAMPLER_CMP(samplerName) + #define TEXTURECUBE_ARRAY_SHADOW_PARAM(textureName, samplerName) TEXTURECUBE_ARRAY(textureName), SAMPLER_CMP(samplerName) + + #define TEXTURE2D_ARGS(textureName, samplerName) textureName, samplerName + #define TEXTURE2D_ARRAY_ARGS(textureName, samplerName) textureName, samplerName + #define TEXTURECUBE_ARGS(textureName, samplerName) textureName, samplerName + #define TEXTURECUBE_ARRAY_ARGS(textureName, samplerName) textureName, samplerName + #define TEXTURE3D_ARGS(textureName, samplerName) textureName, samplerName + + #define TEXTURE2D_SHADOW_ARGS(textureName, samplerName) textureName, samplerName + #define TEXTURE2D_ARRAY_SHADOW_ARGS(textureName, samplerName) textureName, samplerName + #define TEXTURECUBE_SHADOW_ARGS(textureName, samplerName) textureName, samplerName + #define TEXTURECUBE_ARRAY_SHADOW_ARGS(textureName, samplerName) textureName, samplerName + + #define PLATFORM_SAMPLE_TEXTURE2D(textureName, samplerName, coord2) textureName.Sample(samplerName, coord2) + #define PLATFORM_SAMPLE_TEXTURE2D_LOD(textureName, samplerName, coord2, lod) textureName.SampleLevel(samplerName, coord2, lod) + #define PLATFORM_SAMPLE_TEXTURE2D_BIAS(textureName, samplerName, coord2, bias) textureName.SampleBias(samplerName, coord2, bias) + #define PLATFORM_SAMPLE_TEXTURE2D_GRAD(textureName, samplerName, coord2, dpdx, dpdy) textureName.SampleGrad(samplerName, coord2, dpdx, dpdy) + #define PLATFORM_SAMPLE_TEXTURE2D_ARRAY(textureName, samplerName, coord2, index) textureName.Sample(samplerName, float3(coord2, index)) + #define PLATFORM_SAMPLE_TEXTURE2D_ARRAY_LOD(textureName, samplerName, coord2, index, lod) textureName.SampleLevel(samplerName, float3(coord2, index), lod) + #define PLATFORM_SAMPLE_TEXTURE2D_ARRAY_BIAS(textureName, samplerName, coord2, index, bias) textureName.SampleBias(samplerName, float3(coord2, index), bias) + #define PLATFORM_SAMPLE_TEXTURE2D_ARRAY_GRAD(textureName, samplerName, coord2, index, dpdx, dpdy) textureName.SampleGrad(samplerName, float3(coord2, index), dpdx, dpdy) + #define PLATFORM_SAMPLE_TEXTURECUBE(textureName, samplerName, coord3) textureName.Sample(samplerName, coord3) + #define PLATFORM_SAMPLE_TEXTURECUBE_LOD(textureName, samplerName, coord3, lod) textureName.SampleLevel(samplerName, coord3, lod) + #define PLATFORM_SAMPLE_TEXTURECUBE_BIAS(textureName, samplerName, coord3, bias) textureName.SampleBias(samplerName, coord3, bias) + #define PLATFORM_SAMPLE_TEXTURECUBE_ARRAY(textureName, samplerName, coord3, index) textureName.Sample(samplerName, float4(coord3, index)) + #define PLATFORM_SAMPLE_TEXTURECUBE_ARRAY_LOD(textureName, samplerName, coord3, index, lod) textureName.SampleLevel(samplerName, float4(coord3, index), lod) + #define PLATFORM_SAMPLE_TEXTURECUBE_ARRAY_BIAS(textureName, samplerName, coord3, index, bias) textureName.SampleBias(samplerName, float4(coord3, index), bias) + #define PLATFORM_SAMPLE_TEXTURE3D(textureName, samplerName, coord3) textureName.Sample(samplerName, coord3) + #define PLATFORM_SAMPLE_TEXTURE3D_LOD(textureName, samplerName, coord3, lod) textureName.SampleLevel(samplerName, coord3, lod) + + #define SAMPLE_TEXTURE2D(textureName, samplerName, coord2) PLATFORM_SAMPLE_TEXTURE2D(textureName, samplerName, coord2) + #define SAMPLE_TEXTURE2D_LOD(textureName, samplerName, coord2, lod) PLATFORM_SAMPLE_TEXTURE2D_LOD(textureName, samplerName, coord2, lod) + #define SAMPLE_TEXTURE2D_BIAS(textureName, samplerName, coord2, bias) PLATFORM_SAMPLE_TEXTURE2D_BIAS(textureName, samplerName, coord2, bias) + #define SAMPLE_TEXTURE2D_GRAD(textureName, samplerName, coord2, dpdx, dpdy) PLATFORM_SAMPLE_TEXTURE2D_GRAD(textureName, samplerName, coord2, dpdx, dpdy) + #define SAMPLE_TEXTURE2D_ARRAY(textureName, samplerName, coord2, index) PLATFORM_SAMPLE_TEXTURE2D_ARRAY(textureName, samplerName, coord2, index) + #define SAMPLE_TEXTURE2D_ARRAY_LOD(textureName, samplerName, coord2, index, lod) PLATFORM_SAMPLE_TEXTURE2D_ARRAY_LOD(textureName, samplerName, coord2, index, lod) + #define SAMPLE_TEXTURE2D_ARRAY_BIAS(textureName, samplerName, coord2, index, bias) PLATFORM_SAMPLE_TEXTURE2D_ARRAY_BIAS(textureName, samplerName, coord2, index, bias) + #define SAMPLE_TEXTURE2D_ARRAY_GRAD(textureName, samplerName, coord2, index, dpdx, dpdy) PLATFORM_SAMPLE_TEXTURE2D_ARRAY_GRAD(textureName, samplerName, coord2, index, dpdx, dpdy) + #define SAMPLE_TEXTURECUBE(textureName, samplerName, coord3) PLATFORM_SAMPLE_TEXTURECUBE(textureName, samplerName, coord3) + #define SAMPLE_TEXTURECUBE_LOD(textureName, samplerName, coord3, lod) PLATFORM_SAMPLE_TEXTURECUBE_LOD(textureName, samplerName, coord3, lod) + #define SAMPLE_TEXTURECUBE_BIAS(textureName, samplerName, coord3, bias) PLATFORM_SAMPLE_TEXTURECUBE_BIAS(textureName, samplerName, coord3, bias) + #define SAMPLE_TEXTURECUBE_ARRAY(textureName, samplerName, coord3, index) PLATFORM_SAMPLE_TEXTURECUBE_ARRAY(textureName, samplerName, coord3, index) + #define SAMPLE_TEXTURECUBE_ARRAY_LOD(textureName, samplerName, coord3, index, lod) PLATFORM_SAMPLE_TEXTURECUBE_ARRAY_LOD(textureName, samplerName, coord3, index, lod) + #define SAMPLE_TEXTURECUBE_ARRAY_BIAS(textureName, samplerName, coord3, index, bias) PLATFORM_SAMPLE_TEXTURECUBE_ARRAY_BIAS(textureName, samplerName, coord3, index, bias) + #define SAMPLE_TEXTURE3D(textureName, samplerName, coord3) PLATFORM_SAMPLE_TEXTURE3D(textureName, samplerName, coord3) + #define SAMPLE_TEXTURE3D_LOD(textureName, samplerName, coord3, lod) PLATFORM_SAMPLE_TEXTURE3D_LOD(textureName, samplerName, coord3, lod) + + #define SAMPLE_TEXTURE2D_SHADOW(textureName, samplerName, coord3) textureName.SampleCmpLevelZero(samplerName, (coord3).xy, (coord3).z) + #define SAMPLE_TEXTURE2D_ARRAY_SHADOW(textureName, samplerName, coord3, index) textureName.SampleCmpLevelZero(samplerName, float3((coord3).xy, index), (coord3).z) + #define SAMPLE_TEXTURECUBE_SHADOW(textureName, samplerName, coord4) textureName.SampleCmpLevelZero(samplerName, (coord4).xyz, (coord4).w) + #define SAMPLE_TEXTURECUBE_ARRAY_SHADOW(textureName, samplerName, coord4, index) textureName.SampleCmpLevelZero(samplerName, float4((coord4).xyz, index), (coord4).w) + + #define SAMPLE_DEPTH_TEXTURE(textureName, samplerName, coord2) SAMPLE_TEXTURE2D(textureName, samplerName, coord2).r + #define SAMPLE_DEPTH_TEXTURE_LOD(textureName, samplerName, coord2, lod) SAMPLE_TEXTURE2D_LOD(textureName, samplerName, coord2, lod).r + + #define LOAD_TEXTURE2D(textureName, unCoord2) textureName.Load(int3(unCoord2, 0)) + #define LOAD_TEXTURE2D_LOD(textureName, unCoord2, lod) textureName.Load(int3(unCoord2, lod)) + #define LOAD_TEXTURE2D_MSAA(textureName, unCoord2, sampleIndex) textureName.Load(unCoord2, sampleIndex) + #define LOAD_TEXTURE2D_ARRAY(textureName, unCoord2, index) textureName.Load(int4(unCoord2, index, 0)) + #define LOAD_TEXTURE2D_ARRAY_MSAA(textureName, unCoord2, index, sampleIndex) textureName.Load(int3(unCoord2, index), sampleIndex) + #define LOAD_TEXTURE2D_ARRAY_LOD(textureName, unCoord2, index, lod) textureName.Load(int4(unCoord2, index, lod)) + #define LOAD_TEXTURE3D(textureName, unCoord3) textureName.Load(int4(unCoord3, 0)) + #define LOAD_TEXTURE3D_LOD(textureName, unCoord3, lod) textureName.Load(int4(unCoord3, lod)) + + #define PLATFORM_SUPPORT_GATHER + #define GATHER_TEXTURE2D(textureName, samplerName, coord2) textureName.Gather(samplerName, coord2) + #define GATHER_TEXTURE2D_ARRAY(textureName, samplerName, coord2, index) textureName.Gather(samplerName, float3(coord2, index)) + #define GATHER_TEXTURECUBE(textureName, samplerName, coord3) textureName.Gather(samplerName, coord3) + #define GATHER_TEXTURECUBE_ARRAY(textureName, samplerName, coord3, index) textureName.Gather(samplerName, float4(coord3, index)) + #define GATHER_RED_TEXTURE2D(textureName, samplerName, coord2) textureName.GatherRed(samplerName, coord2) + #define GATHER_GREEN_TEXTURE2D(textureName, samplerName, coord2) textureName.GatherGreen(samplerName, coord2) + #define GATHER_BLUE_TEXTURE2D(textureName, samplerName, coord2) textureName.GatherBlue(samplerName, coord2) + #define GATHER_ALPHA_TEXTURE2D(textureName, samplerName, coord2) textureName.GatherAlpha(samplerName, coord2) + + +#elif defined(SHADER_API_XBOXONE) + + // Initialize arbitrary structure with zero values. + // Do not exist on some platform, in this case we need to have a standard name that call a function that will initialize all parameters to 0 + #define ZERO_INITIALIZE(type, name) name = (type)0; + #define ZERO_INITIALIZE_ARRAY(type, name, arraySize) { for (int arrayIndex = 0; arrayIndex < arraySize; arrayIndex++) { name[arrayIndex] = (type)0; } } + + // Texture util abstraction + + #define CALCULATE_TEXTURE2D_LOD(textureName, samplerName, coord2) textureName.CalculateLevelOfDetail(samplerName, coord2) + + // Texture abstraction + + #define TEXTURE2D(textureName) Texture2D textureName + #define TEXTURE2D_ARRAY(textureName) Texture2DArray textureName + #define TEXTURECUBE(textureName) TextureCube textureName + #define TEXTURECUBE_ARRAY(textureName) TextureCubeArray textureName + #define TEXTURE3D(textureName) Texture3D textureName + + #define TEXTURE2D_FLOAT(textureName) TEXTURE2D(textureName) + #define TEXTURE2D_ARRAY_FLOAT(textureName) TEXTURE2D_ARRAY(textureName) + #define TEXTURECUBE_FLOAT(textureName) TEXTURECUBE(textureName) + #define TEXTURECUBE_ARRAY_FLOAT(textureName) TEXTURECUBE_ARRAY(textureName) + #define TEXTURE3D_FLOAT(textureName) TEXTURE3D(textureName) + + #define TEXTURE2D_HALF(textureName) TEXTURE2D(textureName) + #define TEXTURE2D_ARRAY_HALF(textureName) TEXTURE2D_ARRAY(textureName) + #define TEXTURECUBE_HALF(textureName) TEXTURECUBE(textureName) + #define TEXTURECUBE_ARRAY_HALF(textureName) TEXTURECUBE_ARRAY(textureName) + #define TEXTURE3D_HALF(textureName) TEXTURE3D(textureName) + + #define TEXTURE2D_SHADOW(textureName) TEXTURE2D(textureName) + #define TEXTURE2D_ARRAY_SHADOW(textureName) TEXTURE2D_ARRAY(textureName) + #define TEXTURECUBE_SHADOW(textureName) TEXTURECUBE(textureName) + #define TEXTURECUBE_ARRAY_SHADOW(textureName) TEXTURECUBE_ARRAY(textureName) + + #define RW_TEXTURE2D(type, textureName) RWTexture2D textureName + #define RW_TEXTURE2D_ARRAY(type, textureName) RWTexture2DArray textureName + #define RW_TEXTURE3D(type, textureName) RWTexture3D textureName + + #define SAMPLER(samplerName) SamplerState samplerName + #define SAMPLER_CMP(samplerName) SamplerComparisonState samplerName + + #define TEXTURE2D_PARAM(textureName, samplerName) TEXTURE2D(textureName), SAMPLER(samplerName) + #define TEXTURE2D_ARRAY_PARAM(textureName, samplerName) TEXTURE2D_ARRAY(textureName), SAMPLER(samplerName) + #define TEXTURECUBE_PARAM(textureName, samplerName) TEXTURECUBE(textureName), SAMPLER(samplerName) + #define TEXTURECUBE_ARRAY_PARAM(textureName, samplerName) TEXTURECUBE_ARRAY(textureName), SAMPLER(samplerName) + #define TEXTURE3D_PARAM(textureName, samplerName) TEXTURE3D(textureName), SAMPLER(samplerName) + + #define TEXTURE2D_SHADOW_PARAM(textureName, samplerName) TEXTURE2D(textureName), SAMPLER_CMP(samplerName) + #define TEXTURE2D_ARRAY_SHADOW_PARAM(textureName, samplerName) TEXTURE2D_ARRAY(textureName), SAMPLER_CMP(samplerName) + #define TEXTURECUBE_SHADOW_PARAM(textureName, samplerName) TEXTURECUBE(textureName), SAMPLER_CMP(samplerName) + #define TEXTURECUBE_ARRAY_SHADOW_PARAM(textureName, samplerName) TEXTURECUBE_ARRAY(textureName), SAMPLER_CMP(samplerName) + + #define TEXTURE2D_ARGS(textureName, samplerName) textureName, samplerName + #define TEXTURE2D_ARRAY_ARGS(textureName, samplerName) textureName, samplerName + #define TEXTURECUBE_ARGS(textureName, samplerName) textureName, samplerName + #define TEXTURECUBE_ARRAY_ARGS(textureName, samplerName) textureName, samplerName + #define TEXTURE3D_ARGS(textureName, samplerName) textureName, samplerName + + #define TEXTURE2D_SHADOW_ARGS(textureName, samplerName) textureName, samplerName + #define TEXTURE2D_ARRAY_SHADOW_ARGS(textureName, samplerName) textureName, samplerName + #define TEXTURECUBE_SHADOW_ARGS(textureName, samplerName) textureName, samplerName + #define TEXTURECUBE_ARRAY_SHADOW_ARGS(textureName, samplerName) textureName, samplerName + + #define SAMPLE_TEXTURE2D(textureName, samplerName, coord2) textureName.Sample(samplerName, coord2) + #define SAMPLE_TEXTURE2D_LOD(textureName, samplerName, coord2, lod) textureName.SampleLevel(samplerName, coord2, lod) + #define SAMPLE_TEXTURE2D_BIAS(textureName, samplerName, coord2, bias) textureName.SampleBias(samplerName, coord2, bias) + #define SAMPLE_TEXTURE2D_GRAD(textureName, samplerName, coord2, dpdx, dpdy) textureName.SampleGrad(samplerName, coord2, dpdx, dpdy) + #define SAMPLE_TEXTURE2D_ARRAY(textureName, samplerName, coord2, index) textureName.Sample(samplerName, float3(coord2, index)) + #define SAMPLE_TEXTURE2D_ARRAY_LOD(textureName, samplerName, coord2, index, lod) textureName.SampleLevel(samplerName, float3(coord2, index), lod) + #define SAMPLE_TEXTURE2D_ARRAY_BIAS(textureName, samplerName, coord2, index, bias) textureName.SampleBias(samplerName, float3(coord2, index), bias) + #define SAMPLE_TEXTURE2D_ARRAY_GRAD(textureName, samplerName, coord2, index, dpdx, dpdy) textureName.SampleGrad(samplerName, float3(coord2, index), dpdx, dpdy) + #define SAMPLE_TEXTURECUBE(textureName, samplerName, coord3) textureName.Sample(samplerName, coord3) + #define SAMPLE_TEXTURECUBE_LOD(textureName, samplerName, coord3, lod) textureName.SampleLevel(samplerName, coord3, lod) + #define SAMPLE_TEXTURECUBE_BIAS(textureName, samplerName, coord3, bias) textureName.SampleBias(samplerName, coord3, bias) + #define SAMPLE_TEXTURECUBE_ARRAY(textureName, samplerName, coord3, index) textureName.Sample(samplerName, float4(coord3, index)) + #define SAMPLE_TEXTURECUBE_ARRAY_LOD(textureName, samplerName, coord3, index, lod) textureName.SampleLevel(samplerName, float4(coord3, index), lod) + #define SAMPLE_TEXTURECUBE_ARRAY_BIAS(textureName, samplerName, coord3, index, bias) textureName.SampleBias(samplerName, float4(coord3, index), bias) + #define SAMPLE_TEXTURE3D(textureName, samplerName, coord3) textureName.Sample(samplerName, coord3) + #define SAMPLE_TEXTURE3D_LOD(textureName, samplerName, coord3, lod) textureName.SampleLevel(samplerName, coord3, lod) + + #define SAMPLE_TEXTURE2D_SHADOW(textureName, samplerName, coord3) textureName.SampleCmpLevelZero(samplerName, (coord3).xy, (coord3).z) + #define SAMPLE_TEXTURE2D_ARRAY_SHADOW(textureName, samplerName, coord3, index) textureName.SampleCmpLevelZero(samplerName, float3((coord3).xy, index), (coord3).z) + #define SAMPLE_TEXTURECUBE_SHADOW(textureName, samplerName, coord4) textureName.SampleCmpLevelZero(samplerName, (coord4).xyz, (coord4).w) + #define SAMPLE_TEXTURECUBE_ARRAY_SHADOW(textureName, samplerName, coord4, index) textureName.SampleCmpLevelZero(samplerName, float4((coord4).xyz, index), (coord4).w) + + #define LOAD_TEXTURE2D(textureName, unCoord2) textureName.Load(int3(unCoord2, 0)) + #define LOAD_TEXTURE2D_LOD(textureName, unCoord2, lod) textureName.Load(int3(unCoord2, lod)) + #define LOAD_TEXTURE2D_MSAA(textureName, unCoord2, sampleIndex) textureName.Load(unCoord2, sampleIndex) + #define LOAD_TEXTURE2D_ARRAY(textureName, unCoord2, index) textureName.Load(int4(unCoord2, index, 0)) + #define LOAD_TEXTURE2D_ARRAY_MSAA(textureName, unCoord2, index, sampleIndex) textureName.Load(int3(unCoord2, index), sampleIndex) + #define LOAD_TEXTURE2D_ARRAY_LOD(textureName, unCoord2, index, lod) textureName.Load(int4(unCoord2, index, lod)) + #define LOAD_TEXTURE3D(textureName, unCoord3) textureName.Load(int4(unCoord3, 0)) + #define LOAD_TEXTURE3D_LOD(textureName, unCoord3, lod) textureName.Load(int4(unCoord3, lod)) + + #define PLATFORM_SUPPORT_GATHER + #define GATHER_TEXTURE2D(textureName, samplerName, coord2) textureName.Gather(samplerName, coord2) + #define GATHER_TEXTURE2D_ARRAY(textureName, samplerName, coord2, index) textureName.Gather(samplerName, float3(coord2, index)) + #define GATHER_TEXTURECUBE(textureName, samplerName, coord3) textureName.Gather(samplerName, coord3) + #define GATHER_TEXTURECUBE_ARRAY(textureName, samplerName, coord3, index) textureName.Gather(samplerName, float4(coord3, index)) + #define GATHER_RED_TEXTURE2D(textureName, samplerName, coord2) textureName.GatherRed(samplerName, coord2) + #define GATHER_GREEN_TEXTURE2D(textureName, samplerName, coord2) textureName.GatherGreen(samplerName, coord2) + #define GATHER_BLUE_TEXTURE2D(textureName, samplerName, coord2) textureName.GatherBlue(samplerName, coord2) + #define GATHER_ALPHA_TEXTURE2D(textureName, samplerName, coord2) textureName.GatherAlpha(samplerName, coord2) + + +#elif defined(SHADER_API_PSSL) + + // Initialize arbitrary structure with zero values. + // Do not exist on some platform, in this case we need to have a standard name that call a function that will initialize all parameters to 0 + #define ZERO_INITIALIZE(type, name) name = (type)0; + #define ZERO_INITIALIZE_ARRAY(type, name, arraySize) { for (int arrayIndex = 0; arrayIndex < arraySize; arrayIndex++) { name[arrayIndex] = (type)0; } } + + // Texture util abstraction + + #define CALCULATE_TEXTURE2D_LOD(textureName, samplerName, coord2) textureName.GetLOD(samplerName, coord2) + + // Texture abstraction + + #define TEXTURE2D(textureName) Texture2D textureName + #define TEXTURE2D_ARRAY(textureName) Texture2DArray textureName + #define TEXTURECUBE(textureName) TextureCube textureName + #define TEXTURECUBE_ARRAY(textureName) TextureCubeArray textureName + #define TEXTURE3D(textureName) Texture3D textureName + + #define TEXTURE2D_FLOAT(textureName) TEXTURE2D(textureName) + #define TEXTURE2D_ARRAY_FLOAT(textureName) TEXTURE2D_ARRAY(textureName) + #define TEXTURECUBE_FLOAT(textureName) TEXTURECUBE(textureName) + #define TEXTURECUBE_ARRAY_FLOAT(textureName) TEXTURECUBE_ARRAY(textureName) + #define TEXTURE3D_FLOAT(textureName) TEXTURE3D(textureName) + + #define TEXTURE2D_HALF(textureName) TEXTURE2D(textureName) + #define TEXTURE2D_ARRAY_HALF(textureName) TEXTURE2D_ARRAY(textureName) + #define TEXTURECUBE_HALF(textureName) TEXTURECUBE(textureName) + #define TEXTURECUBE_ARRAY_HALF(textureName) TEXTURECUBE_ARRAY(textureName) + #define TEXTURE3D_HALF(textureName) TEXTURE3D(textureName) + + #define TEXTURE2D_SHADOW(textureName) TEXTURE2D(textureName) + #define TEXTURE2D_ARRAY_SHADOW(textureName) TEXTURE2D_ARRAY(textureName) + #define TEXTURECUBE_SHADOW(textureName) TEXTURECUBE(textureName) + #define TEXTURECUBE_ARRAY_SHADOW(textureName) TEXTURECUBE_ARRAY(textureName) + + #define RW_TEXTURE2D(type, textureName) RW_Texture2D textureName + #define RW_TEXTURE2D_ARRAY(type, textureName) RW_Texture2D_Array textureName + #define RW_TEXTURE3D(type, textureName) RW_Texture3D textureName + + #define SAMPLER(samplerName) SamplerState samplerName + #define SAMPLER_CMP(samplerName) SamplerComparisonState samplerName + + #define TEXTURE2D_PARAM(textureName, samplerName) TEXTURE2D(textureName), SAMPLER(samplerName) + #define TEXTURE2D_ARRAY_PARAM(textureName, samplerName) TEXTURE2D_ARRAY(textureName), SAMPLER(samplerName) + #define TEXTURECUBE_PARAM(textureName, samplerName) TEXTURECUBE(textureName), SAMPLER(samplerName) + #define TEXTURECUBE_ARRAY_PARAM(textureName, samplerName) TEXTURECUBE_ARRAY(textureName), SAMPLER(samplerName) + #define TEXTURE3D_PARAM(textureName, samplerName) TEXTURE3D(textureName), SAMPLER(samplerName) + + #define TEXTURE2D_SHADOW_PARAM(textureName, samplerName) TEXTURE2D(textureName), SAMPLER_CMP(samplerName) + #define TEXTURE2D_ARRAY_SHADOW_PARAM(textureName, samplerName) TEXTURE2D_ARRAY(textureName), SAMPLER_CMP(samplerName) + #define TEXTURECUBE_SHADOW_PARAM(textureName, samplerName) TEXTURECUBE(textureName), SAMPLER_CMP(samplerName) + #define TEXTURECUBE_ARRAY_SHADOW_PARAM(textureName, samplerName) TEXTURECUBE_ARRAY(textureName), SAMPLER_CMP(samplerName) + + #define TEXTURE2D_ARGS(textureName, samplerName) textureName, samplerName + #define TEXTURE2D_ARRAY_ARGS(textureName, samplerName) textureName, samplerName + #define TEXTURECUBE_ARGS(textureName, samplerName) textureName, samplerName + #define TEXTURECUBE_ARRAY_ARGS(textureName, samplerName) textureName, samplerName + #define TEXTURE3D_ARGS(textureName, samplerName) textureName, samplerName + + #define TEXTURE2D_SHADOW_ARGS(textureName, samplerName) textureName, samplerName + #define TEXTURE2D_ARRAY_SHADOW_ARGS(textureName, samplerName) textureName, samplerName + #define TEXTURECUBE_SHADOW_ARGS(textureName, samplerName) textureName, samplerName + #define TEXTURECUBE_ARRAY_SHADOW_ARGS(textureName, samplerName) textureName, samplerName + + #define SAMPLE_TEXTURE2D(textureName, samplerName, coord2) textureName.Sample(samplerName, coord2) + #define SAMPLE_TEXTURE2D_LOD(textureName, samplerName, coord2, lod) textureName.SampleLevel(samplerName, coord2, lod) + #define SAMPLE_TEXTURE2D_BIAS(textureName, samplerName, coord2, bias) textureName.SampleBias(samplerName, coord2, bias) + #define SAMPLE_TEXTURE2D_GRAD(textureName, samplerName, coord2, dpdx, dpdy) textureName.SampleGrad(samplerName, coord2, dpdx, dpdy) + #define SAMPLE_TEXTURE2D_ARRAY(textureName, samplerName, coord2, index) textureName.Sample(samplerName, float3(coord2, index)) + #define SAMPLE_TEXTURE2D_ARRAY_LOD(textureName, samplerName, coord2, index, lod) textureName.SampleLevel(samplerName, float3(coord2, index), lod) + #define SAMPLE_TEXTURE2D_ARRAY_BIAS(textureName, samplerName, coord2, index, bias) textureName.SampleBias(samplerName, float3(coord2, index), bias) + #define SAMPLE_TEXTURE2D_ARRAY_GRAD(textureName, samplerName, coord2, index, dpdx, dpdy) textureName.SampleGrad(samplerName, float3(coord2, index), dpdx, dpdy) + #define SAMPLE_TEXTURECUBE(textureName, samplerName, coord3) textureName.Sample(samplerName, coord3) + #define SAMPLE_TEXTURECUBE_LOD(textureName, samplerName, coord3, lod) textureName.SampleLevel(samplerName, coord3, lod) + #define SAMPLE_TEXTURECUBE_BIAS(textureName, samplerName, coord3, bias) textureName.SampleBias(samplerName, coord3, bias) + #define SAMPLE_TEXTURECUBE_ARRAY(textureName, samplerName, coord3, index) textureName.Sample(samplerName, float4(coord3, index)) + #define SAMPLE_TEXTURECUBE_ARRAY_LOD(textureName, samplerName, coord3, index, lod) textureName.SampleLevel(samplerName, float4(coord3, index), lod) + #define SAMPLE_TEXTURECUBE_ARRAY_BIAS(textureName, samplerName, coord3, index, bias) textureName.SampleBias(samplerName, float4(coord3, index), bias) + #define SAMPLE_TEXTURE3D(textureName, samplerName, coord3) textureName.Sample(samplerName, coord3) + #define SAMPLE_TEXTURE3D_LOD(textureName, samplerName, coord3, lod) textureName.SampleLevel(samplerName, coord3, lod) + + #define SAMPLE_TEXTURE2D_SHADOW(textureName, samplerName, coord3) textureName.SampleCmpLevelZero(samplerName, (coord3).xy, (coord3).z) + #define SAMPLE_TEXTURE2D_ARRAY_SHADOW(textureName, samplerName, coord3, index) textureName.SampleCmpLevelZero(samplerName, float3((coord3).xy, index), (coord3).z) + #define SAMPLE_TEXTURECUBE_SHADOW(textureName, samplerName, coord4) textureName.SampleCmpLevelZero(samplerName, (coord4).xyz, (coord4).w) + #define SAMPLE_TEXTURECUBE_ARRAY_SHADOW(textureName, samplerName, coord4, index) textureName.SampleCmpLevelZero(samplerName, float4((coord4).xyz, index), (coord4).w) + + #define LOAD_TEXTURE2D(textureName, unCoord2) textureName.Load(int3(unCoord2, 0)) + #define LOAD_TEXTURE2D_LOD(textureName, unCoord2, lod) textureName.Load(int3(unCoord2, lod)) + #define LOAD_TEXTURE2D_MSAA(textureName, unCoord2, sampleIndex) textureName.Load(unCoord2, sampleIndex) + #define LOAD_TEXTURE2D_ARRAY(textureName, unCoord2, index) textureName.Load(int4(unCoord2, index, 0)) + #define LOAD_TEXTURE2D_ARRAY_MSAA(textureName, unCoord2, index, sampleIndex) textureName.Load(int3(unCoord2, index), sampleIndex) + #define LOAD_TEXTURE2D_ARRAY_LOD(textureName, unCoord2, index, lod) textureName.Load(int4(unCoord2, index, lod)) + #define LOAD_TEXTURE3D(textureName, unCoord3) textureName.Load(int4(unCoord3, 0)) + #define LOAD_TEXTURE3D_LOD(textureName, unCoord3, lod) textureName.Load(int4(unCoord3, lod)) + + #define PLATFORM_SUPPORT_GATHER + #define GATHER_TEXTURE2D(textureName, samplerName, coord2) textureName.Gather(samplerName, coord2) + #define GATHER_TEXTURE2D_ARRAY(textureName, samplerName, coord2, index) textureName.Gather(samplerName, float3(coord2, index)) + #define GATHER_TEXTURECUBE(textureName, samplerName, coord3) textureName.Gather(samplerName, coord3) + #define GATHER_TEXTURECUBE_ARRAY(textureName, samplerName, coord3, index) textureName.Gather(samplerName, float4(coord3, index)) + #define GATHER_RED_TEXTURE2D(textureName, samplerName, coord2) textureName.GatherRed(samplerName, coord2) + #define GATHER_GREEN_TEXTURE2D(textureName, samplerName, coord2) textureName.GatherGreen(samplerName, coord2) + #define GATHER_BLUE_TEXTURE2D(textureName, samplerName, coord2) textureName.GatherBlue(samplerName, coord2) + #define GATHER_ALPHA_TEXTURE2D(textureName, samplerName, coord2) textureName.GatherAlpha(samplerName, coord2) + + + +#elif defined(SHADER_API_D3D11) + + // Initialize arbitrary structure with zero values. + // Do not exist on some platform, in this case we need to have a standard name that call a function that will initialize all parameters to 0 + #define ZERO_INITIALIZE(type, name) name = (type)0; + #define ZERO_INITIALIZE_ARRAY(type, name, arraySize) { for (int arrayIndex = 0; arrayIndex < arraySize; arrayIndex++) { name[arrayIndex] = (type)0; } } + + // Texture util abstraction + + #define CALCULATE_TEXTURE2D_LOD(textureName, samplerName, coord2) textureName.CalculateLevelOfDetail(samplerName, coord2) + + // Texture abstraction + + #define TEXTURE2D(textureName) Texture2D textureName + #define TEXTURE2D_ARRAY(textureName) Texture2DArray textureName + #define TEXTURECUBE(textureName) TextureCube textureName + #define TEXTURECUBE_ARRAY(textureName) TextureCubeArray textureName + #define TEXTURE3D(textureName) Texture3D textureName + + #define TEXTURE2D_FLOAT(textureName) TEXTURE2D(textureName) + #define TEXTURE2D_ARRAY_FLOAT(textureName) TEXTURE2D_ARRAY(textureName) + #define TEXTURECUBE_FLOAT(textureName) TEXTURECUBE(textureName) + #define TEXTURECUBE_ARRAY_FLOAT(textureName) TEXTURECUBE_ARRAY(textureName) + #define TEXTURE3D_FLOAT(textureName) TEXTURE3D(textureName) + + #define TEXTURE2D_HALF(textureName) TEXTURE2D(textureName) + #define TEXTURE2D_ARRAY_HALF(textureName) TEXTURE2D_ARRAY(textureName) + #define TEXTURECUBE_HALF(textureName) TEXTURECUBE(textureName) + #define TEXTURECUBE_ARRAY_HALF(textureName) TEXTURECUBE_ARRAY(textureName) + #define TEXTURE3D_HALF(textureName) TEXTURE3D(textureName) + + #define TEXTURE2D_SHADOW(textureName) TEXTURE2D(textureName) + #define TEXTURE2D_ARRAY_SHADOW(textureName) TEXTURE2D_ARRAY(textureName) + #define TEXTURECUBE_SHADOW(textureName) TEXTURECUBE(textureName) + #define TEXTURECUBE_ARRAY_SHADOW(textureName) TEXTURECUBE_ARRAY(textureName) + + #define RW_TEXTURE2D(type, textureName) RWTexture2D textureName + #define RW_TEXTURE2D_ARRAY(type, textureName) RWTexture2DArray textureName + #define RW_TEXTURE3D(type, textureName) RWTexture3D textureName + + #define SAMPLER(samplerName) SamplerState samplerName + #define SAMPLER_CMP(samplerName) SamplerComparisonState samplerName + + #define TEXTURE2D_PARAM(textureName, samplerName) TEXTURE2D(textureName), SAMPLER(samplerName) + #define TEXTURE2D_ARRAY_PARAM(textureName, samplerName) TEXTURE2D_ARRAY(textureName), SAMPLER(samplerName) + #define TEXTURECUBE_PARAM(textureName, samplerName) TEXTURECUBE(textureName), SAMPLER(samplerName) + #define TEXTURECUBE_ARRAY_PARAM(textureName, samplerName) TEXTURECUBE_ARRAY(textureName), SAMPLER(samplerName) + #define TEXTURE3D_PARAM(textureName, samplerName) TEXTURE3D(textureName), SAMPLER(samplerName) + + #define TEXTURE2D_SHADOW_PARAM(textureName, samplerName) TEXTURE2D(textureName), SAMPLER_CMP(samplerName) + #define TEXTURE2D_ARRAY_SHADOW_PARAM(textureName, samplerName) TEXTURE2D_ARRAY(textureName), SAMPLER_CMP(samplerName) + #define TEXTURECUBE_SHADOW_PARAM(textureName, samplerName) TEXTURECUBE(textureName), SAMPLER_CMP(samplerName) + #define TEXTURECUBE_ARRAY_SHADOW_PARAM(textureName, samplerName) TEXTURECUBE_ARRAY(textureName), SAMPLER_CMP(samplerName) + + #define TEXTURE2D_ARGS(textureName, samplerName) textureName, samplerName + #define TEXTURE2D_ARRAY_ARGS(textureName, samplerName) textureName, samplerName + #define TEXTURECUBE_ARGS(textureName, samplerName) textureName, samplerName + #define TEXTURECUBE_ARRAY_ARGS(textureName, samplerName) textureName, samplerName + #define TEXTURE3D_ARGS(textureName, samplerName) textureName, samplerName + + #define TEXTURE2D_SHADOW_ARGS(textureName, samplerName) textureName, samplerName + #define TEXTURE2D_ARRAY_SHADOW_ARGS(textureName, samplerName) textureName, samplerName + #define TEXTURECUBE_SHADOW_ARGS(textureName, samplerName) textureName, samplerName + #define TEXTURECUBE_ARRAY_SHADOW_ARGS(textureName, samplerName) textureName, samplerName + + #define SAMPLE_TEXTURE2D(textureName, samplerName, coord2) textureName.Sample(samplerName, coord2) + #define SAMPLE_TEXTURE2D_LOD(textureName, samplerName, coord2, lod) textureName.SampleLevel(samplerName, coord2, lod) + #define SAMPLE_TEXTURE2D_BIAS(textureName, samplerName, coord2, bias) textureName.SampleBias(samplerName, coord2, bias) + #define SAMPLE_TEXTURE2D_GRAD(textureName, samplerName, coord2, dpdx, dpdy) textureName.SampleGrad(samplerName, coord2, dpdx, dpdy) + #define SAMPLE_TEXTURE2D_ARRAY(textureName, samplerName, coord2, index) textureName.Sample(samplerName, float3(coord2, index)) + #define SAMPLE_TEXTURE2D_ARRAY_LOD(textureName, samplerName, coord2, index, lod) textureName.SampleLevel(samplerName, float3(coord2, index), lod) + #define SAMPLE_TEXTURE2D_ARRAY_BIAS(textureName, samplerName, coord2, index, bias) textureName.SampleBias(samplerName, float3(coord2, index), bias) + #define SAMPLE_TEXTURE2D_ARRAY_GRAD(textureName, samplerName, coord2, index, dpdx, dpdy) textureName.SampleGrad(samplerName, float3(coord2, index), dpdx, dpdy) + #define SAMPLE_TEXTURECUBE(textureName, samplerName, coord3) textureName.Sample(samplerName, coord3) + #define SAMPLE_TEXTURECUBE_LOD(textureName, samplerName, coord3, lod) textureName.SampleLevel(samplerName, coord3, lod) + #define SAMPLE_TEXTURECUBE_BIAS(textureName, samplerName, coord3, bias) textureName.SampleBias(samplerName, coord3, bias) + #define SAMPLE_TEXTURECUBE_ARRAY(textureName, samplerName, coord3, index) textureName.Sample(samplerName, float4(coord3, index)) + #define SAMPLE_TEXTURECUBE_ARRAY_LOD(textureName, samplerName, coord3, index, lod) textureName.SampleLevel(samplerName, float4(coord3, index), lod) + #define SAMPLE_TEXTURECUBE_ARRAY_BIAS(textureName, samplerName, coord3, index, bias) textureName.SampleBias(samplerName, float4(coord3, index), bias) + #define SAMPLE_TEXTURE3D(textureName, samplerName, coord3) textureName.Sample(samplerName, coord3) + #define SAMPLE_TEXTURE3D_LOD(textureName, samplerName, coord3, lod) textureName.SampleLevel(samplerName, coord3, lod) + + #define SAMPLE_TEXTURE2D_SHADOW(textureName, samplerName, coord3) textureName.SampleCmpLevelZero(samplerName, (coord3).xy, (coord3).z) + #define SAMPLE_TEXTURE2D_ARRAY_SHADOW(textureName, samplerName, coord3, index) textureName.SampleCmpLevelZero(samplerName, float3((coord3).xy, index), (coord3).z) + #define SAMPLE_TEXTURECUBE_SHADOW(textureName, samplerName, coord4) textureName.SampleCmpLevelZero(samplerName, (coord4).xyz, (coord4).w) + #define SAMPLE_TEXTURECUBE_ARRAY_SHADOW(textureName, samplerName, coord4, index) textureName.SampleCmpLevelZero(samplerName, float4((coord4).xyz, index), (coord4).w) + + #define LOAD_TEXTURE2D(textureName, unCoord2) textureName.Load(int3(unCoord2, 0)) + #define LOAD_TEXTURE2D_LOD(textureName, unCoord2, lod) textureName.Load(int3(unCoord2, lod)) + #define LOAD_TEXTURE2D_MSAA(textureName, unCoord2, sampleIndex) textureName.Load(unCoord2, sampleIndex) + #define LOAD_TEXTURE2D_ARRAY(textureName, unCoord2, index) textureName.Load(int4(unCoord2, index, 0)) + #define LOAD_TEXTURE2D_ARRAY_MSAA(textureName, unCoord2, index, sampleIndex) textureName.Load(int3(unCoord2, index), sampleIndex) + #define LOAD_TEXTURE2D_ARRAY_LOD(textureName, unCoord2, index, lod) textureName.Load(int4(unCoord2, index, lod)) + #define LOAD_TEXTURE3D(textureName, unCoord3) textureName.Load(int4(unCoord3, 0)) + #define LOAD_TEXTURE3D_LOD(textureName, unCoord3, lod) textureName.Load(int4(unCoord3, lod)) + + #define PLATFORM_SUPPORT_GATHER + #define GATHER_TEXTURE2D(textureName, samplerName, coord2) textureName.Gather(samplerName, coord2) + #define GATHER_TEXTURE2D_ARRAY(textureName, samplerName, coord2, index) textureName.Gather(samplerName, float3(coord2, index)) + #define GATHER_TEXTURECUBE(textureName, samplerName, coord3) textureName.Gather(samplerName, coord3) + #define GATHER_TEXTURECUBE_ARRAY(textureName, samplerName, coord3, index) textureName.Gather(samplerName, float4(coord3, index)) + #define GATHER_RED_TEXTURE2D(textureName, samplerName, coord2) textureName.GatherRed(samplerName, coord2) + #define GATHER_GREEN_TEXTURE2D(textureName, samplerName, coord2) textureName.GatherGreen(samplerName, coord2) + #define GATHER_BLUE_TEXTURE2D(textureName, samplerName, coord2) textureName.GatherBlue(samplerName, coord2) + #define GATHER_ALPHA_TEXTURE2D(textureName, samplerName, coord2) textureName.GatherAlpha(samplerName, coord2) + +#elif defined(SHADER_API_METAL) + + // Initialize arbitrary structure with zero values. + // Do not exist on some platform, in this case we need to have a standard name that call a function that will initialize all parameters to 0 + #define ZERO_INITIALIZE(type, name) name = (type)0; + #define ZERO_INITIALIZE_ARRAY(type, name, arraySize) { for (int arrayIndex = 0; arrayIndex < arraySize; arrayIndex++) { name[arrayIndex] = (type)0; } } + + // Texture util abstraction + + #define CALCULATE_TEXTURE2D_LOD(textureName, samplerName, coord2) textureName.CalculateLevelOfDetail(samplerName, coord2) + + // Texture abstraction + + #define TEXTURE2D(textureName) Texture2D textureName + #define TEXTURE2D_ARRAY(textureName) Texture2DArray textureName + #define TEXTURECUBE(textureName) TextureCube textureName + #define TEXTURECUBE_ARRAY(textureName) TextureCubeArray textureName + #define TEXTURE3D(textureName) Texture3D textureName + + #define TEXTURE2D_FLOAT(textureName) Texture2D_float textureName + #define TEXTURE2D_ARRAY_FLOAT(textureName) Texture2DArray textureName // no support to _float on Array, it's being added + #define TEXTURECUBE_FLOAT(textureName) TextureCube_float textureName + #define TEXTURECUBE_ARRAY_FLOAT(textureName) TextureCubeArray textureName // no support to _float on Array, it's being added + #define TEXTURE3D_FLOAT(textureName) Texture3D_float textureName + + #define TEXTURE2D_HALF(textureName) Texture2D_half textureName + #define TEXTURE2D_ARRAY_HALF(textureName) Texture2DArray textureName // no support to _float on Array, it's being added + #define TEXTURECUBE_HALF(textureName) TextureCube_half textureName + #define TEXTURECUBE_ARRAY_HALF(textureName) TextureCubeArray textureName // no support to _float on Array, it's being added + #define TEXTURE3D_HALF(textureName) Texture3D_half textureName + + #define TEXTURE2D_SHADOW(textureName) TEXTURE2D(textureName) + #define TEXTURE2D_ARRAY_SHADOW(textureName) TEXTURE2D_ARRAY(textureName) + #define TEXTURECUBE_SHADOW(textureName) TEXTURECUBE(textureName) + #define TEXTURECUBE_ARRAY_SHADOW(textureName) TEXTURECUBE_ARRAY(textureName) + + #define RW_TEXTURE2D(type, textureName) RWTexture2D textureName + #define RW_TEXTURE2D_ARRAY(type, textureName) RWTexture2DArray textureName + #define RW_TEXTURE3D(type, textureName) RWTexture3D textureName + + #define SAMPLER(samplerName) SamplerState samplerName + #define SAMPLER_CMP(samplerName) SamplerComparisonState samplerName + + #define TEXTURE2D_PARAM(textureName, samplerName) TEXTURE2D(textureName), SAMPLER(samplerName) + #define TEXTURE2D_ARRAY_PARAM(textureName, samplerName) TEXTURE2D_ARRAY(textureName), SAMPLER(samplerName) + #define TEXTURECUBE_PARAM(textureName, samplerName) TEXTURECUBE(textureName), SAMPLER(samplerName) + #define TEXTURECUBE_ARRAY_PARAM(textureName, samplerName) TEXTURECUBE_ARRAY(textureName), SAMPLER(samplerName) + #define TEXTURE3D_PARAM(textureName, samplerName) TEXTURE3D(textureName), SAMPLER(samplerName) + + #define TEXTURE2D_SHADOW_PARAM(textureName, samplerName) TEXTURE2D(textureName), SAMPLER_CMP(samplerName) + #define TEXTURE2D_ARRAY_SHADOW_PARAM(textureName, samplerName) TEXTURE2D_ARRAY(textureName), SAMPLER_CMP(samplerName) + #define TEXTURECUBE_SHADOW_PARAM(textureName, samplerName) TEXTURECUBE(textureName), SAMPLER_CMP(samplerName) + #define TEXTURECUBE_ARRAY_SHADOW_PARAM(textureName, samplerName) TEXTURECUBE_ARRAY(textureName), SAMPLER_CMP(samplerName) + + #define TEXTURE2D_ARGS(textureName, samplerName) textureName, samplerName + #define TEXTURE2D_ARRAY_ARGS(textureName, samplerName) textureName, samplerName + #define TEXTURECUBE_ARGS(textureName, samplerName) textureName, samplerName + #define TEXTURECUBE_ARRAY_ARGS(textureName, samplerName) textureName, samplerName + #define TEXTURE3D_ARGS(textureName, samplerName) textureName, samplerName + + #define TEXTURE2D_SHADOW_ARGS(textureName, samplerName) textureName, samplerName + #define TEXTURE2D_ARRAY_SHADOW_ARGS(textureName, samplerName) textureName, samplerName + #define TEXTURECUBE_SHADOW_ARGS(textureName, samplerName) textureName, samplerName + #define TEXTURECUBE_ARRAY_SHADOW_ARGS(textureName, samplerName) textureName, samplerName + + #define SAMPLE_TEXTURE2D(textureName, samplerName, coord2) textureName.Sample(samplerName, coord2) + #define SAMPLE_TEXTURE2D_LOD(textureName, samplerName, coord2, lod) textureName.SampleLevel(samplerName, coord2, lod) + #define SAMPLE_TEXTURE2D_BIAS(textureName, samplerName, coord2, bias) textureName.SampleBias(samplerName, coord2, bias) + #define SAMPLE_TEXTURE2D_GRAD(textureName, samplerName, coord2, dpdx, dpdy) textureName.SampleGrad(samplerName, coord2, dpdx, dpdy) + #define SAMPLE_TEXTURE2D_ARRAY(textureName, samplerName, coord2, index) textureName.Sample(samplerName, float3(coord2, index)) + #define SAMPLE_TEXTURE2D_ARRAY_LOD(textureName, samplerName, coord2, index, lod) textureName.SampleLevel(samplerName, float3(coord2, index), lod) + #define SAMPLE_TEXTURE2D_ARRAY_BIAS(textureName, samplerName, coord2, index, bias) textureName.SampleBias(samplerName, float3(coord2, index), bias) + #define SAMPLE_TEXTURE2D_ARRAY_GRAD(textureName, samplerName, coord2, index, dpdx, dpdy) textureName.SampleGrad(samplerName, float3(coord2, index), dpdx, dpdy) + #define SAMPLE_TEXTURECUBE(textureName, samplerName, coord3) textureName.Sample(samplerName, coord3) + #define SAMPLE_TEXTURECUBE_LOD(textureName, samplerName, coord3, lod) textureName.SampleLevel(samplerName, coord3, lod) + #define SAMPLE_TEXTURECUBE_BIAS(textureName, samplerName, coord3, bias) textureName.SampleBias(samplerName, coord3, bias) + #define SAMPLE_TEXTURECUBE_ARRAY(textureName, samplerName, coord3, index) textureName.Sample(samplerName, float4(coord3, index)) + #define SAMPLE_TEXTURECUBE_ARRAY_LOD(textureName, samplerName, coord3, index, lod) textureName.SampleLevel(samplerName, float4(coord3, index), lod) + #define SAMPLE_TEXTURECUBE_ARRAY_BIAS(textureName, samplerName, coord3, index, bias) textureName.SampleBias(samplerName, float4(coord3, index), bias) + #define SAMPLE_TEXTURE3D(textureName, samplerName, coord3) textureName.Sample(samplerName, coord3) + #define SAMPLE_TEXTURE3D_LOD(textureName, samplerName, coord3, lod) textureName.SampleLevel(samplerName, coord3, lod) + + #define SAMPLE_TEXTURE2D_SHADOW(textureName, samplerName, coord3) textureName.SampleCmpLevelZero(samplerName, (coord3).xy, (coord3).z) + #define SAMPLE_TEXTURE2D_ARRAY_SHADOW(textureName, samplerName, coord3, index) textureName.SampleCmpLevelZero(samplerName, float3((coord3).xy, index), (coord3).z) + #define SAMPLE_TEXTURECUBE_SHADOW(textureName, samplerName, coord4) textureName.SampleCmpLevelZero(samplerName, (coord4).xyz, (coord4).w) + #define SAMPLE_TEXTURECUBE_ARRAY_SHADOW(textureName, samplerName, coord4, index) textureName.SampleCmpLevelZero(samplerName, float4((coord4).xyz, index), (coord4).w) + + #define LOAD_TEXTURE2D(textureName, unCoord2) textureName.Load(int3(unCoord2, 0)) + #define LOAD_TEXTURE2D_LOD(textureName, unCoord2, lod) textureName.Load(int3(unCoord2, lod)) + #define LOAD_TEXTURE2D_MSAA(textureName, unCoord2, sampleIndex) textureName.Load(unCoord2, sampleIndex) + #define LOAD_TEXTURE2D_ARRAY(textureName, unCoord2, index) textureName.Load(int4(unCoord2, index, 0)) + #define LOAD_TEXTURE2D_ARRAY_MSAA(textureName, unCoord2, index, sampleIndex) textureName.Load(int3(unCoord2, index), sampleIndex) + #define LOAD_TEXTURE2D_ARRAY_LOD(textureName, unCoord2, index, lod) textureName.Load(int4(unCoord2, index, lod)) + #define LOAD_TEXTURE3D(textureName, unCoord3) textureName.Load(int4(unCoord3, 0)) + #define LOAD_TEXTURE3D_LOD(textureName, unCoord3, lod) textureName.Load(int4(unCoord3, lod)) + + #define PLATFORM_SUPPORT_GATHER + #define GATHER_TEXTURE2D(textureName, samplerName, coord2) textureName.Gather(samplerName, coord2) + #define GATHER_TEXTURE2D_ARRAY(textureName, samplerName, coord2, index) textureName.Gather(samplerName, float3(coord2, index)) + #define GATHER_TEXTURECUBE(textureName, samplerName, coord3) textureName.Gather(samplerName, coord3) + #define GATHER_TEXTURECUBE_ARRAY(textureName, samplerName, coord3, index) textureName.Gather(samplerName, float4(coord3, index)) + #define GATHER_RED_TEXTURE2D(textureName, samplerName, coord2) textureName.GatherRed(samplerName, coord2) + #define GATHER_GREEN_TEXTURE2D(textureName, samplerName, coord2) textureName.GatherGreen(samplerName, coord2) + #define GATHER_BLUE_TEXTURE2D(textureName, samplerName, coord2) textureName.GatherBlue(samplerName, coord2) + #define GATHER_ALPHA_TEXTURE2D(textureName, samplerName, coord2) textureName.GatherAlpha(samplerName, coord2) + +#elif defined(SHADER_API_VULKAN) +// This file assume SHADER_API_VULKAN is defined + // TODO: This is a straight copy from D3D11.hlsl. Go through all this stuff and adjust where needed. + + + // Initialize arbitrary structure with zero values. + // Do not exist on some platform, in this case we need to have a standard name that call a function that will initialize all parameters to 0 + #define ZERO_INITIALIZE(type, name) name = (type)0; + #define ZERO_INITIALIZE_ARRAY(type, name, arraySize) { for (int arrayIndex = 0; arrayIndex < arraySize; arrayIndex++) { name[arrayIndex] = (type)0; } } + + // Texture util abstraction + + #define CALCULATE_TEXTURE2D_LOD(textureName, samplerName, coord2) textureName.CalculateLevelOfDetail(samplerName, coord2) + + // Texture abstraction + + #define TEXTURE2D(textureName) Texture2D textureName + #define TEXTURE2D_ARRAY(textureName) Texture2DArray textureName + #define TEXTURECUBE(textureName) TextureCube textureName + #define TEXTURECUBE_ARRAY(textureName) TextureCubeArray textureName + #define TEXTURE3D(textureName) Texture3D textureName + + #define TEXTURE2D_FLOAT(textureName) Texture2D_float textureName + #define TEXTURE2D_ARRAY_FLOAT(textureName) Texture2DArray textureName // no support to _float on Array, it's being added + #define TEXTURECUBE_FLOAT(textureName) TextureCube_float textureName + #define TEXTURECUBE_ARRAY_FLOAT(textureName) TextureCubeArray textureName // no support to _float on Array, it's being added + #define TEXTURE3D_FLOAT(textureName) Texture3D_float textureName + + #define TEXTURE2D_HALF(textureName) Texture2D_half textureName + #define TEXTURE2D_ARRAY_HALF(textureName) Texture2DArray textureName // no support to _float on Array, it's being added + #define TEXTURECUBE_HALF(textureName) TextureCube_half textureName + #define TEXTURECUBE_ARRAY_HALF(textureName) TextureCubeArray textureName // no support to _float on Array, it's being added + #define TEXTURE3D_HALF(textureName) Texture3D_half textureName + + #define TEXTURE2D_SHADOW(textureName) TEXTURE2D(textureName) + #define TEXTURE2D_ARRAY_SHADOW(textureName) TEXTURE2D_ARRAY(textureName) + #define TEXTURECUBE_SHADOW(textureName) TEXTURECUBE(textureName) + #define TEXTURECUBE_ARRAY_SHADOW(textureName) TEXTURECUBE_ARRAY(textureName) + + #define RW_TEXTURE2D(type, textureName) RWTexture2D textureName + #define RW_TEXTURE2D_ARRAY(type, textureName) RWTexture2DArray textureName + #define RW_TEXTURE3D(type, textureName) RWTexture3D textureName + + #define SAMPLER(samplerName) SamplerState samplerName + #define SAMPLER_CMP(samplerName) SamplerComparisonState samplerName + + #define TEXTURE2D_PARAM(textureName, samplerName) TEXTURE2D(textureName), SAMPLER(samplerName) + #define TEXTURE2D_ARRAY_PARAM(textureName, samplerName) TEXTURE2D_ARRAY(textureName), SAMPLER(samplerName) + #define TEXTURECUBE_PARAM(textureName, samplerName) TEXTURECUBE(textureName), SAMPLER(samplerName) + #define TEXTURECUBE_ARRAY_PARAM(textureName, samplerName) TEXTURECUBE_ARRAY(textureName), SAMPLER(samplerName) + #define TEXTURE3D_PARAM(textureName, samplerName) TEXTURE3D(textureName), SAMPLER(samplerName) + + #define TEXTURE2D_SHADOW_PARAM(textureName, samplerName) TEXTURE2D(textureName), SAMPLER_CMP(samplerName) + #define TEXTURE2D_ARRAY_SHADOW_PARAM(textureName, samplerName) TEXTURE2D_ARRAY(textureName), SAMPLER_CMP(samplerName) + #define TEXTURECUBE_SHADOW_PARAM(textureName, samplerName) TEXTURECUBE(textureName), SAMPLER_CMP(samplerName) + #define TEXTURECUBE_ARRAY_SHADOW_PARAM(textureName, samplerName) TEXTURECUBE_ARRAY(textureName), SAMPLER_CMP(samplerName) + + #define TEXTURE2D_ARGS(textureName, samplerName) textureName, samplerName + #define TEXTURE2D_ARRAY_ARGS(textureName, samplerName) textureName, samplerName + #define TEXTURECUBE_ARGS(textureName, samplerName) textureName, samplerName + #define TEXTURECUBE_ARRAY_ARGS(textureName, samplerName) textureName, samplerName + #define TEXTURE3D_ARGS(textureName, samplerName) textureName, samplerName + + #define TEXTURE2D_SHADOW_ARGS(textureName, samplerName) textureName, samplerName + #define TEXTURE2D_ARRAY_SHADOW_ARGS(textureName, samplerName) textureName, samplerName + #define TEXTURECUBE_SHADOW_ARGS(textureName, samplerName) textureName, samplerName + #define TEXTURECUBE_ARRAY_SHADOW_ARGS(textureName, samplerName) textureName, samplerName + + #define SAMPLE_TEXTURE2D(textureName, samplerName, coord2) textureName.Sample(samplerName, coord2) + #define SAMPLE_TEXTURE2D_LOD(textureName, samplerName, coord2, lod) textureName.SampleLevel(samplerName, coord2, lod) + #define SAMPLE_TEXTURE2D_BIAS(textureName, samplerName, coord2, bias) textureName.SampleBias(samplerName, coord2, bias) + #define SAMPLE_TEXTURE2D_GRAD(textureName, samplerName, coord2, dpdx, dpdy) textureName.SampleGrad(samplerName, coord2, dpdx, dpdy) + #define SAMPLE_TEXTURE2D_ARRAY(textureName, samplerName, coord2, index) textureName.Sample(samplerName, float3(coord2, index)) + #define SAMPLE_TEXTURE2D_ARRAY_LOD(textureName, samplerName, coord2, index, lod) textureName.SampleLevel(samplerName, float3(coord2, index), lod) + #define SAMPLE_TEXTURE2D_ARRAY_BIAS(textureName, samplerName, coord2, index, bias) textureName.SampleBias(samplerName, float3(coord2, index), bias) + #define SAMPLE_TEXTURE2D_ARRAY_GRAD(textureName, samplerName, coord2, index, dpdx, dpdy) textureName.SampleGrad(samplerName, float3(coord2, index), dpdx, dpdy) + #define SAMPLE_TEXTURECUBE(textureName, samplerName, coord3) textureName.Sample(samplerName, coord3) + #define SAMPLE_TEXTURECUBE_LOD(textureName, samplerName, coord3, lod) textureName.SampleLevel(samplerName, coord3, lod) + #define SAMPLE_TEXTURECUBE_BIAS(textureName, samplerName, coord3, bias) textureName.SampleBias(samplerName, coord3, bias) + #define SAMPLE_TEXTURECUBE_ARRAY(textureName, samplerName, coord3, index) textureName.Sample(samplerName, float4(coord3, index)) + #define SAMPLE_TEXTURECUBE_ARRAY_LOD(textureName, samplerName, coord3, index, lod) textureName.SampleLevel(samplerName, float4(coord3, index), lod) + #define SAMPLE_TEXTURECUBE_ARRAY_BIAS(textureName, samplerName, coord3, index, bias) textureName.SampleBias(samplerName, float4(coord3, index), bias) + #define SAMPLE_TEXTURE3D(textureName, samplerName, coord3) textureName.Sample(samplerName, coord3) + #define SAMPLE_TEXTURE3D_LOD(textureName, samplerName, coord3, lod) textureName.SampleLevel(samplerName, coord3, lod) + + #define SAMPLE_TEXTURE2D_SHADOW(textureName, samplerName, coord3) textureName.SampleCmpLevelZero(samplerName, (coord3).xy, (coord3).z) + #define SAMPLE_TEXTURE2D_ARRAY_SHADOW(textureName, samplerName, coord3, index) textureName.SampleCmpLevelZero(samplerName, float3((coord3).xy, index), (coord3).z) + #define SAMPLE_TEXTURECUBE_SHADOW(textureName, samplerName, coord4) textureName.SampleCmpLevelZero(samplerName, (coord4).xyz, (coord4).w) + #define SAMPLE_TEXTURECUBE_ARRAY_SHADOW(textureName, samplerName, coord4, index) textureName.SampleCmpLevelZero(samplerName, float4((coord4).xyz, index), (coord4).w) + + #define LOAD_TEXTURE2D(textureName, unCoord2) textureName.Load(int3(unCoord2, 0)) + #define LOAD_TEXTURE2D_LOD(textureName, unCoord2, lod) textureName.Load(int3(unCoord2, lod)) + #define LOAD_TEXTURE2D_MSAA(textureName, unCoord2, sampleIndex) textureName.Load(unCoord2, sampleIndex) + #define LOAD_TEXTURE2D_ARRAY(textureName, unCoord2, index) textureName.Load(int4(unCoord2, index, 0)) + #define LOAD_TEXTURE2D_ARRAY_MSAA(textureName, unCoord2, index, sampleIndex) textureName.Load(int3(unCoord2, index), sampleIndex) + #define LOAD_TEXTURE2D_ARRAY_LOD(textureName, unCoord2, index, lod) textureName.Load(int4(unCoord2, index, lod)) + #define LOAD_TEXTURE3D(textureName, unCoord3) textureName.Load(int4(unCoord3, 0)) + #define LOAD_TEXTURE3D_LOD(textureName, unCoord3, lod) textureName.Load(int4(unCoord3, lod)) + + #define PLATFORM_SUPPORT_GATHER + #define GATHER_TEXTURE2D(textureName, samplerName, coord2) textureName.Gather(samplerName, coord2) + #define GATHER_TEXTURE2D_ARRAY(textureName, samplerName, coord2, index) textureName.Gather(samplerName, float3(coord2, index)) + #define GATHER_TEXTURECUBE(textureName, samplerName, coord3) textureName.Gather(samplerName, coord3) + #define GATHER_TEXTURECUBE_ARRAY(textureName, samplerName, coord3, index) textureName.Gather(samplerName, float4(coord3, index)) + #define GATHER_RED_TEXTURE2D(textureName, samplerName, coord2) textureName.GatherRed(samplerName, coord2) + #define GATHER_GREEN_TEXTURE2D(textureName, samplerName, coord2) textureName.GatherGreen(samplerName, coord2) + #define GATHER_BLUE_TEXTURE2D(textureName, samplerName, coord2) textureName.GatherBlue(samplerName, coord2) + #define GATHER_ALPHA_TEXTURE2D(textureName, samplerName, coord2) textureName.GatherAlpha(samplerName, coord2) + +#elif defined(SHADER_API_SWITCH) + // This file assume SHADER_API_SWITCH is defined + + // Initialize arbitrary structure with zero values. + // Do not exist on some platform, in this case we need to have a standard name that call a function that will initialize all parameters to 0 + #define ZERO_INITIALIZE(type, name) name = (type)0; + #define ZERO_INITIALIZE_ARRAY(type, name, arraySize) { for (int arrayIndex = 0; arrayIndex < arraySize; arrayIndex++) { name[arrayIndex] = (type)0; } } + + // Texture util abstraction + + #define CALCULATE_TEXTURE2D_LOD(textureName, samplerName, coord2) textureName.CalculateLevelOfDetail(samplerName, coord2) + + // Texture abstraction + + #define TEXTURE2D(textureName) Texture2D textureName + #define TEXTURE2D_ARRAY(textureName) Texture2DArray textureName + #define TEXTURECUBE(textureName) TextureCube textureName + #define TEXTURECUBE_ARRAY(textureName) TextureCubeArray textureName + #define TEXTURE3D(textureName) Texture3D textureName + + #define TEXTURE2D_FLOAT(textureName) Texture2D_float textureName + #define TEXTURE2D_ARRAY_FLOAT(textureName) Texture2DArray textureName // no support to _float on Array, it's being added + #define TEXTURECUBE_FLOAT(textureName) TextureCube_float textureName + #define TEXTURECUBE_ARRAY_FLOAT(textureName) TextureCubeArray textureName // no support to _float on Array, it's being added + #define TEXTURE3D_FLOAT(textureName) Texture3D_float textureName + + #define TEXTURE2D_HALF(textureName) Texture2D_half textureName + #define TEXTURE2D_ARRAY_HALF(textureName) Texture2DArray textureName // no support to _float on Array, it's being added + #define TEXTURECUBE_HALF(textureName) TextureCube_half textureName + #define TEXTURECUBE_ARRAY_HALF(textureName) TextureCubeArray textureName // no support to _float on Array, it's being added + #define TEXTURE3D_HALF(textureName) Texture3D_half textureName + + #define TEXTURE2D_SHADOW(textureName) TEXTURE2D(textureName) + #define TEXTURE2D_ARRAY_SHADOW(textureName) TEXTURE2D_ARRAY(textureName) + #define TEXTURECUBE_SHADOW(textureName) TEXTURECUBE(textureName) + #define TEXTURECUBE_ARRAY_SHADOW(textureName) TEXTURECUBE_ARRAY(textureName) + + #define RW_TEXTURE2D(type, textureName) RWTexture2D textureName + #define RW_TEXTURE2D_ARRAY(type, textureName) RWTexture2DArray textureName + #define RW_TEXTURE3D(type, textureName) RWTexture3D textureName + + #define SAMPLER(samplerName) SamplerState samplerName + #define SAMPLER_CMP(samplerName) SamplerComparisonState samplerName + + #define TEXTURE2D_PARAM(textureName, samplerName) TEXTURE2D(textureName), SAMPLER(samplerName) + #define TEXTURE2D_ARRAY_PARAM(textureName, samplerName) TEXTURE2D_ARRAY(textureName), SAMPLER(samplerName) + #define TEXTURECUBE_PARAM(textureName, samplerName) TEXTURECUBE(textureName), SAMPLER(samplerName) + #define TEXTURECUBE_ARRAY_PARAM(textureName, samplerName) TEXTURECUBE_ARRAY(textureName), SAMPLER(samplerName) + #define TEXTURE3D_PARAM(textureName, samplerName) TEXTURE3D(textureName), SAMPLER(samplerName) + + #define TEXTURE2D_SHADOW_PARAM(textureName, samplerName) TEXTURE2D(textureName), SAMPLER_CMP(samplerName) + #define TEXTURE2D_ARRAY_SHADOW_PARAM(textureName, samplerName) TEXTURE2D_ARRAY(textureName), SAMPLER_CMP(samplerName) + #define TEXTURECUBE_SHADOW_PARAM(textureName, samplerName) TEXTURECUBE(textureName), SAMPLER_CMP(samplerName) + #define TEXTURECUBE_ARRAY_SHADOW_PARAM(textureName, samplerName) TEXTURECUBE_ARRAY(textureName), SAMPLER_CMP(samplerName) + + #define TEXTURE2D_ARGS(textureName, samplerName) textureName, samplerName + #define TEXTURE2D_ARRAY_ARGS(textureName, samplerName) textureName, samplerName + #define TEXTURECUBE_ARGS(textureName, samplerName) textureName, samplerName + #define TEXTURECUBE_ARRAY_ARGS(textureName, samplerName) textureName, samplerName + #define TEXTURE3D_ARGS(textureName, samplerName) textureName, samplerName + + #define TEXTURE2D_SHADOW_ARGS(textureName, samplerName) textureName, samplerName + #define TEXTURE2D_ARRAY_SHADOW_ARGS(textureName, samplerName) textureName, samplerName + #define TEXTURECUBE_SHADOW_ARGS(textureName, samplerName) textureName, samplerName + #define TEXTURECUBE_ARRAY_SHADOW_ARGS(textureName, samplerName) textureName, samplerName + + #define SAMPLE_TEXTURE2D(textureName, samplerName, coord2) textureName.Sample(samplerName, coord2) + #define SAMPLE_TEXTURE2D_LOD(textureName, samplerName, coord2, lod) textureName.SampleLevel(samplerName, coord2, lod) + #define SAMPLE_TEXTURE2D_BIAS(textureName, samplerName, coord2, bias) textureName.SampleBias(samplerName, coord2, bias) + #define SAMPLE_TEXTURE2D_GRAD(textureName, samplerName, coord2, dpdx, dpdy) textureName.SampleGrad(samplerName, coord2, dpdx, dpdy) + #define SAMPLE_TEXTURE2D_ARRAY(textureName, samplerName, coord2, index) textureName.Sample(samplerName, float3(coord2, index)) + #define SAMPLE_TEXTURE2D_ARRAY_LOD(textureName, samplerName, coord2, index, lod) textureName.SampleLevel(samplerName, float3(coord2, index), lod) + #define SAMPLE_TEXTURE2D_ARRAY_BIAS(textureName, samplerName, coord2, index, bias) textureName.SampleBias(samplerName, float3(coord2, index), bias) + #define SAMPLE_TEXTURE2D_ARRAY_GRAD(textureName, samplerName, coord2, index, dpdx, dpdy) textureName.SampleGrad(samplerName, float3(coord2, index), dpdx, dpdy) + #define SAMPLE_TEXTURECUBE(textureName, samplerName, coord3) textureName.Sample(samplerName, coord3) + #define SAMPLE_TEXTURECUBE_LOD(textureName, samplerName, coord3, lod) textureName.SampleLevel(samplerName, coord3, lod) + #define SAMPLE_TEXTURECUBE_BIAS(textureName, samplerName, coord3, bias) textureName.SampleBias(samplerName, coord3, bias) + #define SAMPLE_TEXTURECUBE_ARRAY(textureName, samplerName, coord3, index) textureName.Sample(samplerName, float4(coord3, index)) + #define SAMPLE_TEXTURECUBE_ARRAY_LOD(textureName, samplerName, coord3, index, lod) textureName.SampleLevel(samplerName, float4(coord3, index), lod) + #define SAMPLE_TEXTURECUBE_ARRAY_BIAS(textureName, samplerName, coord3, index, bias) textureName.SampleBias(samplerName, float4(coord3, index), bias) + #define SAMPLE_TEXTURE3D(textureName, samplerName, coord3) textureName.Sample(samplerName, coord3) + #define SAMPLE_TEXTURE3D_LOD(textureName, samplerName, coord3, lod) textureName.SampleLevel(samplerName, coord3, lod) + + #define SAMPLE_TEXTURE2D_SHADOW(textureName, samplerName, coord3) textureName.SampleCmpLevelZero(samplerName, (coord3).xy, (coord3).z) + #define SAMPLE_TEXTURE2D_ARRAY_SHADOW(textureName, samplerName, coord3, index) textureName.SampleCmpLevelZero(samplerName, float3((coord3).xy, index), (coord3).z) + #define SAMPLE_TEXTURECUBE_SHADOW(textureName, samplerName, coord4) textureName.SampleCmpLevelZero(samplerName, (coord4).xyz, (coord4).w) + #define SAMPLE_TEXTURECUBE_ARRAY_SHADOW(textureName, samplerName, coord4, index) textureName.SampleCmpLevelZero(samplerName, float4((coord4).xyz, index), (coord4).w) + + + #define LOAD_TEXTURE2D(textureName, unCoord2) textureName.Load(int3(unCoord2, 0)) + #define LOAD_TEXTURE2D_LOD(textureName, unCoord2, lod) textureName.Load(int3(unCoord2, lod)) + #define LOAD_TEXTURE2D_MSAA(textureName, unCoord2, sampleIndex) textureName.Load(unCoord2, sampleIndex) + #define LOAD_TEXTURE2D_ARRAY(textureName, unCoord2, index) textureName.Load(int4(unCoord2, index, 0)) + #define LOAD_TEXTURE2D_ARRAY_LOD(textureName, unCoord2, index, lod) textureName.Load(int4(unCoord2, index, lod)) + #define LOAD_TEXTURE3D(textureName, unCoord3) textureName.Load(int4(unCoord3, 0)) + #define LOAD_TEXTURE3D_LOD(textureName, unCoord3, lod) textureName.Load(int4(unCoord3, lod)) + + #define PLATFORM_SUPPORT_GATHER + #define GATHER_TEXTURE2D(textureName, samplerName, coord2) textureName.Gather(samplerName, coord2) + #define GATHER_TEXTURE2D_ARRAY(textureName, samplerName, coord2, index) textureName.Gather(samplerName, float3(coord2, index)) + #define GATHER_TEXTURECUBE(textureName, samplerName, coord3) textureName.Gather(samplerName, coord3) + #define GATHER_TEXTURECUBE_ARRAY(textureName, samplerName, coord3, index) textureName.Gather(samplerName, float4(coord3, index)) + #define GATHER_RED_TEXTURE2D(textureName, samplerName, coord2) textureName.GatherRed(samplerName, coord2) + #define GATHER_GREEN_TEXTURE2D(textureName, samplerName, coord2) textureName.GatherGreen(samplerName, coord2) + #define GATHER_BLUE_TEXTURE2D(textureName, samplerName, coord2) textureName.GatherBlue(samplerName, coord2) + #define GATHER_ALPHA_TEXTURE2D(textureName, samplerName, coord2) textureName.GatherAlpha(samplerName, coord2) + +#elif defined(SHADER_API_GLCORE) + + // OpenGL 4.1 SM 5.0 https://docs.unity3d.com/Manual/SL-ShaderCompileTargets.html + #if (SHADER_TARGET >= 46) + #define OPENGL4_1_SM5 1 + #else + #define OPENGL4_1_SM5 0 + #endif + + // Initialize arbitrary structure with zero values. + // Do not exist on some platform, in this case we need to have a standard name that call a function that will initialize all parameters to 0 + #define ZERO_INITIALIZE(type, name) name = (type)0; + #define ZERO_INITIALIZE_ARRAY(type, name, arraySize) { for (int arrayIndex = 0; arrayIndex < arraySize; arrayIndex++) { name[arrayIndex] = (type)0; } } + + // Texture util abstraction + + #define CALCULATE_TEXTURE2D_LOD(textureName, samplerName, coord2) textureName.CalculateLevelOfDetail(samplerName, coord2) + + // Texture abstraction + + #define TEXTURE2D(textureName) Texture2D textureName + #define TEXTURE2D_ARRAY(textureName) Texture2DArray textureName + #define TEXTURECUBE(textureName) TextureCube textureName + #define TEXTURECUBE_ARRAY(textureName) TextureCubeArray textureName + #define TEXTURE3D(textureName) Texture3D textureName + + #define TEXTURE2D_FLOAT(textureName) TEXTURE2D(textureName) + #define TEXTURE2D_ARRAY_FLOAT(textureName) TEXTURE2D_ARRAY(textureName) + #define TEXTURECUBE_FLOAT(textureName) TEXTURECUBE(textureName) + #define TEXTURECUBE_ARRAY_FLOAT(textureName) TEXTURECUBE_ARRAY(textureName) + #define TEXTURE3D_FLOAT(textureName) TEXTURE3D(textureName) + + #define TEXTURE2D_HALF(textureName) TEXTURE2D(textureName) + #define TEXTURE2D_ARRAY_HALF(textureName) TEXTURE2D_ARRAY(textureName) + #define TEXTURECUBE_HALF(textureName) TEXTURECUBE(textureName) + #define TEXTURECUBE_ARRAY_HALF(textureName) TEXTURECUBE_ARRAY(textureName) + #define TEXTURE3D_HALF(textureName) TEXTURE3D(textureName) + + #define TEXTURE2D_SHADOW(textureName) TEXTURE2D(textureName) + #define TEXTURE2D_ARRAY_SHADOW(textureName) TEXTURE2D_ARRAY(textureName) + #define TEXTURECUBE_SHADOW(textureName) TEXTURECUBE(textureName) + #define TEXTURECUBE_ARRAY_SHADOW(textureName) TEXTURECUBE_ARRAY(textureName) + + #define RW_TEXTURE2D(type, textureName) RWTexture2D textureName + #define RW_TEXTURE2D_ARRAY(type, textureName) RWTexture2DArray textureName + #define RW_TEXTURE3D(type, textureName) RWTexture3D textureName + + #define SAMPLER(samplerName) SamplerState samplerName + #define SAMPLER_CMP(samplerName) SamplerComparisonState samplerName + + #define TEXTURE2D_PARAM(textureName, samplerName) TEXTURE2D(textureName), SAMPLER(samplerName) + #define TEXTURE2D_ARRAY_PARAM(textureName, samplerName) TEXTURE2D_ARRAY(textureName), SAMPLER(samplerName) + #define TEXTURECUBE_PARAM(textureName, samplerName) TEXTURECUBE(textureName), SAMPLER(samplerName) + #define TEXTURECUBE_ARRAY_PARAM(textureName, samplerName) TEXTURECUBE_ARRAY(textureName), SAMPLER(samplerName) + #define TEXTURE3D_PARAM(textureName, samplerName) TEXTURE3D(textureName), SAMPLER(samplerName) + + #define TEXTURE2D_SHADOW_PARAM(textureName, samplerName) TEXTURE2D(textureName), SAMPLER_CMP(samplerName) + #define TEXTURE2D_ARRAY_SHADOW_PARAM(textureName, samplerName) TEXTURE2D_ARRAY(textureName), SAMPLER_CMP(samplerName) + #define TEXTURECUBE_SHADOW_PARAM(textureName, samplerName) TEXTURECUBE(textureName), SAMPLER_CMP(samplerName) + #define TEXTURECUBE_ARRAY_SHADOW_PARAM(textureName, samplerName) TEXTURECUBE_ARRAY(textureName), SAMPLER_CMP(samplerName) + + #define TEXTURE2D_ARGS(textureName, samplerName) textureName, samplerName + #define TEXTURE2D_ARRAY_ARGS(textureName, samplerName) textureName, samplerName + #define TEXTURECUBE_ARGS(textureName, samplerName) textureName, samplerName + #define TEXTURECUBE_ARRAY_ARGS(textureName, samplerName) textureName, samplerName + #define TEXTURE3D_ARGS(textureName, samplerName) textureName, samplerName + + #define TEXTURE2D_SHADOW_ARGS(textureName, samplerName) textureName, samplerName + #define TEXTURE2D_ARRAY_SHADOW_ARGS(textureName, samplerName) textureName, samplerName + #define TEXTURECUBE_SHADOW_ARGS(textureName, samplerName) textureName, samplerName + #define TEXTURECUBE_ARRAY_SHADOW_ARGS(textureName, samplerName) textureName, samplerName + + #define SAMPLE_TEXTURE2D(textureName, samplerName, coord2) textureName.Sample(samplerName, coord2) + #define SAMPLE_TEXTURE2D_LOD(textureName, samplerName, coord2, lod) textureName.SampleLevel(samplerName, coord2, lod) + #define SAMPLE_TEXTURE2D_BIAS(textureName, samplerName, coord2, bias) textureName.SampleBias(samplerName, coord2, bias) + #define SAMPLE_TEXTURE2D_GRAD(textureName, samplerName, coord2, ddx, ddy) textureName.SampleGrad(samplerName, coord2, ddx, ddy) + #define SAMPLE_TEXTURE2D_ARRAY(textureName, samplerName, coord2, index) textureName.Sample(samplerName, float3(coord2, index)) + #define SAMPLE_TEXTURE2D_ARRAY_LOD(textureName, samplerName, coord2, index, lod) textureName.SampleLevel(samplerName, float3(coord2, index), lod) + #define SAMPLE_TEXTURE2D_ARRAY_BIAS(textureName, samplerName, coord2, index, bias) textureName.SampleBias(samplerName, float3(coord2, index), bias) + #define SAMPLE_TEXTURE2D_ARRAY_GRAD(textureName, samplerName, coord2, index, dpdx, dpdy) textureName.SampleGrad(samplerName, float3(coord2, index), dpdx, dpdy) + #define SAMPLE_TEXTURECUBE(textureName, samplerName, coord3) textureName.Sample(samplerName, coord3) + #define SAMPLE_TEXTURECUBE_LOD(textureName, samplerName, coord3, lod) textureName.SampleLevel(samplerName, coord3, lod) + #define SAMPLE_TEXTURECUBE_BIAS(textureName, samplerName, coord3, bias) textureName.SampleBias(samplerName, coord3, bias) + #ifdef UNITY_NO_CUBEMAP_ARRAY + #define SAMPLE_TEXTURECUBE_ARRAY(textureName, samplerName, coord3, index) ERROR_ON_UNSUPPORTED_FUNCTION(SAMPLE_TEXTURECUBE_ARRAY) + #define SAMPLE_TEXTURECUBE_ARRAY_LOD(textureName, samplerName, coord3, index, lod) ERROR_ON_UNSUPPORTED_FUNCTION(SAMPLE_TEXTURECUBE_ARRAY_LOD) + #define SAMPLE_TEXTURECUBE_ARRAY_LOD(textureName, samplerName, coord3, index, bias) ERROR_ON_UNSUPPORTED_FUNCTION(SAMPLE_TEXTURECUBE_ARRAY_LOD) + #else + #define SAMPLE_TEXTURECUBE_ARRAY(textureName, samplerName, coord3, index) textureName.Sample(samplerName, float4(coord3, index)) + #define SAMPLE_TEXTURECUBE_ARRAY_LOD(textureName, samplerName, coord3, index, lod) textureName.SampleLevel(samplerName, float4(coord3, index), lod) + #define SAMPLE_TEXTURECUBE_ARRAY_BIAS(textureName, samplerName, coord3, index, bias)textureName.SampleBias(samplerName, float4(coord3, index), bias) + #endif + #define SAMPLE_TEXTURE3D(textureName, samplerName, coord3) textureName.Sample(samplerName, coord3) + #define SAMPLE_TEXTURE3D_LOD(textureName, samplerName, coord3, lod) textureName.SampleLevel(samplerName, coord3, lod) + + #define SAMPLE_TEXTURE2D_SHADOW(textureName, samplerName, coord3) textureName.SampleCmpLevelZero(samplerName, (coord3).xy, (coord3).z) + #define SAMPLE_TEXTURE2D_ARRAY_SHADOW(textureName, samplerName, coord3, index) textureName.SampleCmpLevelZero(samplerName, float3((coord3).xy, index), (coord3).z) + #define SAMPLE_TEXTURECUBE_SHADOW(textureName, samplerName, coord4) textureName.SampleCmpLevelZero(samplerName, (coord4).xyz, (coord4).w) + #define SAMPLE_TEXTURECUBE_ARRAY_SHADOW(textureName, samplerName, coord4, index) textureName.SampleCmpLevelZero(samplerName, float4((coord4).xyz, index), (coord4).w) + + #define LOAD_TEXTURE2D(textureName, unCoord2) textureName.Load(int3(unCoord2, 0)) + #define LOAD_TEXTURE2D_LOD(textureName, unCoord2, lod) textureName.Load(int3(unCoord2, lod)) + #define LOAD_TEXTURE2D_MSAA(textureName, unCoord2, sampleIndex) textureName.Load(unCoord2, sampleIndex) + #define LOAD_TEXTURE2D_ARRAY(textureName, unCoord2, index) textureName.Load(int4(unCoord2, index, 0)) + #define LOAD_TEXTURE2D_ARRAY_MSAA(textureName, unCoord2, index, sampleIndex) textureName.Load(int3(unCoord2, index), sampleIndex) + #define LOAD_TEXTURE2D_ARRAY_LOD(textureName, unCoord2, index, lod) textureName.Load(int4(unCoord2, index, lod)) + + #if OPENGL4_1_SM5 + #define PLATFORM_SUPPORT_GATHER + #define GATHER_TEXTURE2D(textureName, samplerName, coord2) textureName.Gather(samplerName, coord2) + #define GATHER_TEXTURE2D_ARRAY(textureName, samplerName, coord2, index) textureName.Gather(samplerName, float3(coord2, index)) + #define GATHER_TEXTURECUBE(textureName, samplerName, coord3) textureName.Gather(samplerName, coord3) + #define GATHER_TEXTURECUBE_ARRAY(textureName, samplerName, coord3, index) textureName.Gather(samplerName, float4(coord3, index)) + #else + #define GATHER_TEXTURE2D(textureName, samplerName, coord2) ERROR_ON_UNSUPPORTED_FUNCTION(GATHER_TEXTURE2D) + #define GATHER_TEXTURE2D_ARRAY(textureName, samplerName, coord2, index) ERROR_ON_UNSUPPORTED_FUNCTION(GATHER_TEXTURE2D_ARRAY) + #define GATHER_TEXTURECUBE(textureName, samplerName, coord3) ERROR_ON_UNSUPPORTED_FUNCTION(GATHER_TEXTURECUBE) + #define GATHER_TEXTURECUBE_ARRAY(textureName, samplerName, coord3, index) ERROR_ON_UNSUPPORTED_FUNCTION(GATHER_TEXTURECUBE_ARRAY) + #endif + + + #elif defined(SHADER_API_GLES3) + + // GLES 3.1 + AEP shader feature https://docs.unity3d.com/Manual/SL-ShaderCompileTargets.html + #if (SHADER_TARGET >= 40) + #define GLES3_1_AEP 1 + #else + #define GLES3_1_AEP 0 + #endif + + // Initialize arbitrary structure with zero values. + // Do not exist on some platform, in this case we need to have a standard name that call a function that will initialize all parameters to 0 + #define ZERO_INITIALIZE(type, name) name = (type)0; + #define ZERO_INITIALIZE_ARRAY(type, name, arraySize) { for (int arrayIndex = 0; arrayIndex < arraySize; arrayIndex++) { name[arrayIndex] = (type)0; } } + + // Texture util abstraction + + #define CALCULATE_TEXTURE2D_LOD(textureName, samplerName, coord2) textureName.CalculateLevelOfDetail(samplerName, coord2) + + // Texture abstraction + + #define TEXTURE2D(textureName) Texture2D textureName + #define TEXTURE2D_ARRAY(textureName) Texture2DArray textureName + #define TEXTURECUBE(textureName) TextureCube textureName + #define TEXTURECUBE_ARRAY(textureName) TextureCubeArray textureName + #define TEXTURE3D(textureName) Texture3D textureName + + #define TEXTURE2D_FLOAT(textureName) Texture2D_float textureName + #define TEXTURE2D_ARRAY_FLOAT(textureName) Texture2DArray textureName // no support to _float on Array, it's being added + #define TEXTURECUBE_FLOAT(textureName) TextureCube_float textureName + #define TEXTURECUBE_ARRAY_FLOAT(textureName) TextureCubeArray textureName // no support to _float on Array, it's being added + #define TEXTURE3D_FLOAT(textureName) Texture3D_float textureName + + #define TEXTURE2D_HALF(textureName) Texture2D_half textureName + #define TEXTURE2D_ARRAY_HALF(textureName) Texture2DArray textureName // no support to _float on Array, it's being added + #define TEXTURECUBE_HALF(textureName) TextureCube_half textureName + #define TEXTURECUBE_ARRAY_HALF(textureName) TextureCubeArray textureName // no support to _float on Array, it's being added + #define TEXTURE3D_HALF(textureName) Texture3D_half textureName + + #define TEXTURE2D_SHADOW(textureName) TEXTURE2D(textureName) + #define TEXTURE2D_ARRAY_SHADOW(textureName) TEXTURE2D_ARRAY(textureName) + #define TEXTURECUBE_SHADOW(textureName) TEXTURECUBE(textureName) + #define TEXTURECUBE_ARRAY_SHADOW(textureName) TEXTURECUBE_ARRAY(textureName) + + #if GLES3_1_AEP + #define RW_TEXTURE2D(type, textureName) RWTexture2D textureName + #define RW_TEXTURE2D_ARRAY(type, textureName) RWTexture2DArray textureName + #define RW_TEXTURE3D(type, textureName) RWTexture3D textureName + #else + #define RW_TEXTURE2D(type, textureName) ERROR_ON_UNSUPPORTED_FUNCTION(RWTexture2D) + #define RW_TEXTURE2D_ARRAY(type, textureName) ERROR_ON_UNSUPPORTED_FUNCTION(RWTexture2DArray) + #define RW_TEXTURE3D(type, textureName) ERROR_ON_UNSUPPORTED_FUNCTION(RWTexture3D) + #endif + + #define SAMPLER(samplerName) SamplerState samplerName + #define SAMPLER_CMP(samplerName) SamplerComparisonState samplerName + + #define TEXTURE2D_PARAM(textureName, samplerName) TEXTURE2D(textureName), SAMPLER(samplerName) + #define TEXTURE2D_ARRAY_PARAM(textureName, samplerName) TEXTURE2D_ARRAY(textureName), SAMPLER(samplerName) + #define TEXTURECUBE_PARAM(textureName, samplerName) TEXTURECUBE(textureName), SAMPLER(samplerName) + #define TEXTURECUBE_ARRAY_PARAM(textureName, samplerName) TEXTURECUBE_ARRAY(textureName), SAMPLER(samplerName) + #define TEXTURE3D_PARAM(textureName, samplerName) TEXTURE3D(textureName), SAMPLER(samplerName) + + #define TEXTURE2D_SHADOW_PARAM(textureName, samplerName) TEXTURE2D(textureName), SAMPLER_CMP(samplerName) + #define TEXTURE2D_ARRAY_SHADOW_PARAM(textureName, samplerName) TEXTURE2D_ARRAY(textureName), SAMPLER_CMP(samplerName) + #define TEXTURECUBE_SHADOW_PARAM(textureName, samplerName) TEXTURECUBE(textureName), SAMPLER_CMP(samplerName) + #define TEXTURECUBE_ARRAY_SHADOW_PARAM(textureName, samplerName) TEXTURECUBE_ARRAY(textureName), SAMPLER_CMP(samplerName) + + #define TEXTURE2D_ARGS(textureName, samplerName) textureName, samplerName + #define TEXTURE2D_ARRAY_ARGS(textureName, samplerName) textureName, samplerName + #define TEXTURECUBE_ARGS(textureName, samplerName) textureName, samplerName + #define TEXTURECUBE_ARRAY_ARGS(textureName, samplerName) textureName, samplerName + #define TEXTURE3D_ARGS(textureName, samplerName) textureName, samplerName + + #define TEXTURE2D_SHADOW_ARGS(textureName, samplerName) textureName, samplerName + #define TEXTURE2D_ARRAY_SHADOW_ARGS(textureName, samplerName) textureName, samplerName + #define TEXTURECUBE_SHADOW_ARGS(textureName, samplerName) textureName, samplerName + #define TEXTURECUBE_ARRAY_SHADOW_ARGS(textureName, samplerName) textureName, samplerName + + #define SAMPLE_TEXTURE2D(textureName, samplerName, coord2) textureName.Sample(samplerName, coord2) + #define SAMPLE_TEXTURE2D_LOD(textureName, samplerName, coord2, lod) textureName.SampleLevel(samplerName, coord2, lod) + #define SAMPLE_TEXTURE2D_BIAS(textureName, samplerName, coord2, bias) textureName.SampleBias(samplerName, coord2, bias) + #define SAMPLE_TEXTURE2D_GRAD(textureName, samplerName, coord2, ddx, ddy) textureName.SampleGrad(samplerName, coord2, ddx, ddy) + #define SAMPLE_TEXTURE2D_ARRAY(textureName, samplerName, coord2, index) textureName.Sample(samplerName, float3(coord2, index)) + #define SAMPLE_TEXTURE2D_ARRAY_LOD(textureName, samplerName, coord2, index, lod) textureName.SampleLevel(samplerName, float3(coord2, index), lod) + #define SAMPLE_TEXTURE2D_ARRAY_BIAS(textureName, samplerName, coord2, index, bias) textureName.SampleBias(samplerName, float3(coord2, index), bias) + #define SAMPLE_TEXTURE2D_ARRAY_GRAD(textureName, samplerName, coord2, index, dpdx, dpdy) textureName.SampleGrad(samplerName, float3(coord2, index), dpdx, dpdy) + #define SAMPLE_TEXTURECUBE(textureName, samplerName, coord3) textureName.Sample(samplerName, coord3) + #define SAMPLE_TEXTURECUBE_LOD(textureName, samplerName, coord3, lod) textureName.SampleLevel(samplerName, coord3, lod) + #define SAMPLE_TEXTURECUBE_BIAS(textureName, samplerName, coord3, bias) textureName.SampleBias(samplerName, coord3, bias) + + #ifdef UNITY_NO_CUBEMAP_ARRAY + #define SAMPLE_TEXTURECUBE_ARRAY(textureName, samplerName, coord3, index) ERROR_ON_UNSUPPORTED_FUNCTION(SAMPLE_TEXTURECUBE_ARRAY) + #define SAMPLE_TEXTURECUBE_ARRAY_LOD(textureName, samplerName, coord3, index, lod) ERROR_ON_UNSUPPORTED_FUNCTION(SAMPLE_TEXTURECUBE_ARRAY_LOD) + #define SAMPLE_TEXTURECUBE_ARRAY_BIAS(textureName, samplerName, coord3, index, bias)ERROR_ON_UNSUPPORTED_FUNCTION(SAMPLE_TEXTURECUBE_ARRAY_BIAS) + #else + #define SAMPLE_TEXTURECUBE_ARRAY(textureName, samplerName, coord3, index) textureName.Sample(samplerName, float4(coord3, index)) + #define SAMPLE_TEXTURECUBE_ARRAY_LOD(textureName, samplerName, coord3, index, lod) textureName.SampleLevel(samplerName, float4(coord3, index), lod) + #define SAMPLE_TEXTURECUBE_ARRAY_BIAS(textureName, samplerName, coord3, index, bias)textureName.SampleBias(samplerName, float4(coord3, index), bias) + #endif + + #define SAMPLE_TEXTURE3D(textureName, samplerName, coord3) textureName.Sample(samplerName, coord3) + #define SAMPLE_TEXTURE3D_LOD(textureName, samplerName, coord3, lod) textureName.SampleLevel(samplerName, coord3, lod) + + #define SAMPLE_TEXTURE2D_SHADOW(textureName, samplerName, coord3) textureName.SampleCmpLevelZero(samplerName, (coord3).xy, (coord3).z) + #define SAMPLE_TEXTURE2D_ARRAY_SHADOW(textureName, samplerName, coord3, index) textureName.SampleCmpLevelZero(samplerName, float3((coord3).xy, index), (coord3).z) + #define SAMPLE_TEXTURECUBE_SHADOW(textureName, samplerName, coord4) textureName.SampleCmpLevelZero(samplerName, (coord4).xyz, (coord4).w) + #define SAMPLE_TEXTURECUBE_ARRAY_SHADOW(textureName, samplerName, coord4, index) textureName.SampleCmpLevelZero(samplerName, float4((coord4).xyz, index), (coord4).w) + + + #define LOAD_TEXTURE2D(textureName, unCoord2) textureName.Load(int3(unCoord2, 0)) + #define LOAD_TEXTURE2D_LOD(textureName, unCoord2, lod) textureName.Load(int3(unCoord2, lod)) + #define LOAD_TEXTURE2D_MSAA(textureName, unCoord2, sampleIndex) textureName.Load(unCoord2, sampleIndex) + #define LOAD_TEXTURE2D_ARRAY(textureName, unCoord2, index) textureName.Load(int4(unCoord2, index, 0)) + #define LOAD_TEXTURE2D_ARRAY_MSAA(textureName, unCoord2, index, sampleIndex) textureName.Load(int3(unCoord2, index), sampleIndex) + #define LOAD_TEXTURE2D_ARRAY_LOD(textureName, unCoord2, index, lod) textureName.Load(int4(unCoord2, index, lod)) + #define LOAD_TEXTURE3D(textureName, unCoord3) textureName.Load(int4(unCoord3, 0)) + #define LOAD_TEXTURE3D_LOD(textureName, unCoord3, lod) textureName.Load(int4(unCoord3, lod)) + + #if GLES3_1_AEP + #define PLATFORM_SUPPORT_GATHER + #define GATHER_TEXTURE2D(textureName, samplerName, coord2) textureName.Gather(samplerName, coord2) + #define GATHER_TEXTURE2D_ARRAY(textureName, samplerName, coord2, index) textureName.Gather(samplerName, float3(coord2, index)) + #define GATHER_TEXTURECUBE(textureName, samplerName, coord3) textureName.Gather(samplerName, coord3) + #define GATHER_TEXTURECUBE_ARRAY(textureName, samplerName, coord3, index) textureName.Gather(samplerName, float4(coord3, index)) + #define GATHER_RED_TEXTURE2D(textureName, samplerName, coord2) textureName.GatherRed(samplerName, coord2) + #define GATHER_GREEN_TEXTURE2D(textureName, samplerName, coord2) textureName.GatherGreen(samplerName, coord2) + #define GATHER_BLUE_TEXTURE2D(textureName, samplerName, coord2) textureName.GatherBlue(samplerName, coord2) + #define GATHER_ALPHA_TEXTURE2D(textureName, samplerName, coord2) textureName.GatherAlpha(samplerName, coord2) + #else + #define GATHER_TEXTURE2D(textureName, samplerName, coord2) ERROR_ON_UNSUPPORTED_FUNCTION(GATHER_TEXTURE2D) + #define GATHER_TEXTURE2D_ARRAY(textureName, samplerName, coord2, index) ERROR_ON_UNSUPPORTED_FUNCTION(GATHER_TEXTURE2D_ARRAY) + #define GATHER_TEXTURECUBE(textureName, samplerName, coord3) ERROR_ON_UNSUPPORTED_FUNCTION(GATHER_TEXTURECUBE) + #define GATHER_TEXTURECUBE_ARRAY(textureName, samplerName, coord3, index) ERROR_ON_UNSUPPORTED_FUNCTION(GATHER_TEXTURECUBE_ARRAY) + #define GATHER_RED_TEXTURE2D(textureName, samplerName, coord2) ERROR_ON_UNSUPPORTED_FUNCTION(GATHER_RED_TEXTURE2D) + #define GATHER_GREEN_TEXTURE2D(textureName, samplerName, coord2) ERROR_ON_UNSUPPORTED_FUNCTION(GATHER_GREEN_TEXTURE2D) + #define GATHER_BLUE_TEXTURE2D(textureName, samplerName, coord2) ERROR_ON_UNSUPPORTED_FUNCTION(GATHER_BLUE_TEXTURE2D) + #define GATHER_ALPHA_TEXTURE2D(textureName, samplerName, coord2) ERROR_ON_UNSUPPORTED_FUNCTION(GATHER_ALPHA_TEXTURE2D) + #endif + + +#elif defined(SHADER_API_GLES) + + + #define uint int + + #define rcp(x) 1.0 / (x) + #define ddx_fine ddx + #define ddy_fine ddy + #define asfloat + #define asuint(x) asint(x) + #define f32tof16 + #define f16tof32 + + #define ERROR_ON_UNSUPPORTED_FUNCTION(funcName) #error #funcName is not supported on GLES 2.0 + + // Initialize arbitrary structure with zero values. + // Do not exist on some platform, in this case we need to have a standard name that call a function that will initialize all parameters to 0 + #define ZERO_INITIALIZE(type, name) name = (type)0; + #define ZERO_INITIALIZE_ARRAY(type, name, arraySize) { for (int arrayIndex = 0; arrayIndex < arraySize; arrayIndex++) { name[arrayIndex] = (type)0; } } + + + // Texture util abstraction + + #define CALCULATE_TEXTURE2D_LOD(textureName, samplerName, coord2) #error calculate Level of Detail not supported in GLES2 + + // Texture abstraction + + #define TEXTURE2D(textureName) sampler2D textureName + #define TEXTURE2D_ARRAY(textureName) samplerCUBE textureName // No support to texture2DArray + #define TEXTURECUBE(textureName) samplerCUBE textureName + #define TEXTURECUBE_ARRAY(textureName) samplerCUBE textureName // No supoport to textureCubeArray and can't emulate with texture2DArray + #define TEXTURE3D(textureName) sampler3D textureName + + #define TEXTURE2D_FLOAT(textureName) sampler2D_float textureName + #define TEXTURE2D_ARRAY_FLOAT(textureName) TEXTURECUBE_FLOAT(textureName) // No support to texture2DArray + #define TEXTURECUBE_FLOAT(textureName) samplerCUBE_float textureName + #define TEXTURECUBE_ARRAY_FLOAT(textureName) TEXTURECUBE_FLOAT(textureName) // No support to textureCubeArray + #define TEXTURE3D_FLOAT(textureName) sampler3D_float textureName + + #define TEXTURE2D_HALF(textureName) sampler2D_half textureName + #define TEXTURE2D_ARRAY_HALF(textureName) TEXTURECUBE_HALF(textureName) // No support to texture2DArray + #define TEXTURECUBE_HALF(textureName) samplerCUBE_half textureName + #define TEXTURECUBE_ARRAY_HALF(textureName) TEXTURECUBE_HALF(textureName) // No support to textureCubeArray + #define TEXTURE3D_HALF(textureName) sampler3D_half textureName + + #define TEXTURE2D_SHADOW(textureName) SHADOW2D_TEXTURE_AND_SAMPLER textureName + #define TEXTURE2D_ARRAY_SHADOW(textureName) TEXTURECUBE_SHADOW(textureName) // No support to texture array + #define TEXTURECUBE_SHADOW(textureName) SHADOWCUBE_TEXTURE_AND_SAMPLER textureName + #define TEXTURECUBE_ARRAY_SHADOW(textureName) TEXTURECUBE_SHADOW(textureName) // No support to texture array + + #define RW_TEXTURE2D(type, textureNam) ERROR_ON_UNSUPPORTED_FUNCTION(RWTexture2D) + #define RW_TEXTURE2D_ARRAY(type, textureName) ERROR_ON_UNSUPPORTED_FUNCTION(RWTexture2DArray) + #define RW_TEXTURE3D(type, textureNam) ERROR_ON_UNSUPPORTED_FUNCTION(RWTexture3D) + + #define SAMPLER(samplerName) + #define SAMPLER_CMP(samplerName) + + #define TEXTURE2D_PARAM(textureName, samplerName) sampler2D textureName + #define TEXTURE2D_ARRAY_PARAM(textureName, samplerName) samplerCUBE textureName + #define TEXTURECUBE_PARAM(textureName, samplerName) samplerCUBE textureName + #define TEXTURECUBE_ARRAY_PARAM(textureName, samplerName) samplerCUBE textureName + #define TEXTURE3D_PARAM(textureName, samplerName) sampler3D textureName + #define TEXTURE2D_SHADOW_PARAM(textureName, samplerName) SHADOW2D_TEXTURE_AND_SAMPLER textureName + #define TEXTURE2D_ARRAY_SHADOW_PARAM(textureName, samplerName) SHADOWCUBE_TEXTURE_AND_SAMPLER textureName + #define TEXTURECUBE_SHADOW_PARAM(textureName, samplerName) SHADOWCUBE_TEXTURE_AND_SAMPLER textureName + + #define TEXTURE2D_ARGS(textureName, samplerName) textureName + #define TEXTURE2D_ARRAY_ARGS(textureName, samplerName) textureName + #define TEXTURECUBE_ARGS(textureName, samplerName) textureName + #define TEXTURECUBE_ARRAY_ARGS(textureName, samplerName) textureName + #define TEXTURE3D_ARGS(textureName, samplerName) textureName + #define TEXTURE2D_SHADOW_ARGS(textureName, samplerName) textureName + #define TEXTURE2D_ARRAY_SHADOW_ARGS(textureName, samplerName) textureName + #define TEXTURECUBE_SHADOW_ARGS(textureName, samplerName) textureName + + #define SAMPLE_TEXTURE2D(textureName, samplerName, coord2) tex2D(textureName, coord2) + + #if (SHADER_TARGET >= 30) + #define SAMPLE_TEXTURE2D_LOD(textureName, samplerName, coord2, lod) tex2Dlod(textureName, float4(coord2, 0, lod)) + #else + // No lod support. Very poor approximation with bias. + #define SAMPLE_TEXTURE2D_LOD(textureName, samplerName, coord2, lod) SAMPLE_TEXTURE2D_BIAS(textureName, samplerName, coord2, lod) + #endif + + #define SAMPLE_TEXTURE2D_BIAS(textureName, samplerName, coord2, bias) tex2Dbias(textureName, float4(coord2, 0, bias)) + #define SAMPLE_TEXTURE2D_GRAD(textureName, samplerName, coord2, ddx, ddy) SAMPLE_TEXTURE2D(textureName, samplerName, coord2) + #define SAMPLE_TEXTURE2D_ARRAY(textureName, samplerName, coord2, index) ERROR_ON_UNSUPPORTED_FUNCTION(SAMPLE_TEXTURE2D_ARRAY) + #define SAMPLE_TEXTURE2D_ARRAY_LOD(textureName, samplerName, coord2, index, lod) ERROR_ON_UNSUPPORTED_FUNCTION(SAMPLE_TEXTURE2D_ARRAY_LOD) + #define SAMPLE_TEXTURE2D_ARRAY_BIAS(textureName, samplerName, coord2, index, bias) ERROR_ON_UNSUPPORTED_FUNCTION(SAMPLE_TEXTURE2D_ARRAY_BIAS) + #define SAMPLE_TEXTURE2D_ARRAY_GRAD(textureName, samplerName, coord2, index, dpdx, dpdy) ERROR_ON_UNSUPPORTED_FUNCTION(SAMPLE_TEXTURE2D_ARRAY_GRAD) + #define SAMPLE_TEXTURECUBE(textureName, samplerName, coord3) texCUBE(textureName, coord3) + // No lod support. Very poor approximation with bias. + #define SAMPLE_TEXTURECUBE_LOD(textureName, samplerName, coord3, lod) SAMPLE_TEXTURECUBE_BIAS(textureName, samplerName, coord3, lod) + #define SAMPLE_TEXTURECUBE_BIAS(textureName, samplerName, coord3, bias) texCUBEbias(textureName, float4(coord3, bias)) + #define SAMPLE_TEXTURECUBE_ARRAY(textureName, samplerName, coord3, index) ERROR_ON_UNSUPPORTED_FUNCTION(SAMPLE_TEXTURECUBE_ARRAY) + #define SAMPLE_TEXTURECUBE_ARRAY_LOD(textureName, samplerName, coord3, index, lod) ERROR_ON_UNSUPPORTED_FUNCTION(SAMPLE_TEXTURECUBE_ARRAY_LOD) + #define SAMPLE_TEXTURECUBE_ARRAY_BIAS(textureName, samplerName, coord3, index, bias) ERROR_ON_UNSUPPORTED_FUNCTION(SAMPLE_TEXTURECUBE_ARRAY_BIAS) + #define SAMPLE_TEXTURE3D(textureName, samplerName, coord3) tex3D(textureName, coord3) + #define SAMPLE_TEXTURE3D_LOD(textureName, samplerName, coord3, lod) ERROR_ON_UNSUPPORTED_FUNCTION(SAMPLE_TEXTURE3D_LOD) + + #define SAMPLE_TEXTURE2D_SHADOW(textureName, samplerName, coord3) SHADOW2D_SAMPLE(textureName, samplerName, coord3) + #define SAMPLE_TEXTURE2D_ARRAY_SHADOW(textureName, samplerName, coord3, index) ERROR_ON_UNSUPPORTED_FUNCTION(SAMPLE_TEXTURE2D_ARRAY_SHADOW) + #define SAMPLE_TEXTURECUBE_SHADOW(textureName, samplerName, coord4) SHADOWCUBE_SAMPLE(textureName, samplerName, coord4) + #define SAMPLE_TEXTURECUBE_ARRAY_SHADOW(textureName, samplerName, coord4, index) ERROR_ON_UNSUPPORTED_FUNCTION(SAMPLE_TEXTURECUBE_ARRAY_SHADOW) + + + // Not supported. Can't define as error because shader library is calling these functions. + #define LOAD_TEXTURE2D(textureName, unCoord2) half4(0, 0, 0, 0) + #define LOAD_TEXTURE2D_LOD(textureName, unCoord2, lod) half4(0, 0, 0, 0) + #define LOAD_TEXTURE2D_MSAA(textureName, unCoord2, sampleIndex) half4(0, 0, 0, 0) + #define LOAD_TEXTURE2D_ARRAY(textureName, unCoord2, index) half4(0, 0, 0, 0) + #define LOAD_TEXTURE2D_ARRAY_MSAA(textureName, unCoord2, index, sampleIndex) half4(0, 0, 0, 0) + #define LOAD_TEXTURE2D_ARRAY_LOD(textureName, unCoord2, index, lod) half4(0, 0, 0, 0) + #define LOAD_TEXTURE3D(textureName, unCoord3) ERROR_ON_UNSUPPORTED_FUNCTION(LOAD_TEXTURE3D) + #define LOAD_TEXTURE3D_LOD(textureName, unCoord3, lod) ERROR_ON_UNSUPPORTED_FUNCTION(LOAD_TEXTURE3D_LOD) + + // Gather not supported. Fallback to regular texture sampling. + #define GATHER_TEXTURE2D(textureName, samplerName, coord2) ERROR_ON_UNSUPPORTED_FUNCTION(GATHER_TEXTURE2D) + #define GATHER_TEXTURE2D_ARRAY(textureName, samplerName, coord2, index) ERROR_ON_UNSUPPORTED_FUNCTION(GATHER_TEXTURE2D_ARRAY) + #define GATHER_TEXTURECUBE(textureName, samplerName, coord3) ERROR_ON_UNSUPPORTED_FUNCTION(GATHER_TEXTURECUBE) + #define GATHER_TEXTURECUBE_ARRAY(textureName, samplerName, coord3, index) ERROR_ON_UNSUPPORTED_FUNCTION(GATHER_TEXTURECUBE_ARRAY) + #define GATHER_RED_TEXTURE2D(textureName, samplerName, coord2) ERROR_ON_UNSUPPORTED_FUNCTION(GATHER_RED_TEXTURE2D) + #define GATHER_GREEN_TEXTURE2D(textureName, samplerName, coord2) ERROR_ON_UNSUPPORTED_FUNCTION(GATHER_GREEN_TEXTURE2D) + #define GATHER_BLUE_TEXTURE2D(textureName, samplerName, coord2) ERROR_ON_UNSUPPORTED_FUNCTION(GATHER_BLUE_TEXTURE2D) + #define GATHER_ALPHA_TEXTURE2D(textureName, samplerName, coord2) ERROR_ON_UNSUPPORTED_FUNCTION(GATHER_ALPHA_TEXTURE2D) + +#else +#error unsupported shader api +#endif + + + + +// default flow control attributes +#ifndef UNITY_BRANCH +# define UNITY_BRANCH +#endif +#ifndef UNITY_FLATTEN +# define UNITY_FLATTEN +#endif +#ifndef UNITY_UNROLL +# define UNITY_UNROLL +#endif +#ifndef UNITY_UNROLLX +# define UNITY_UNROLLX(_x) +#endif +#ifndef UNITY_LOOP +# define UNITY_LOOP +#endif + + + +#define _USINGTEXCOORD1 1 +#define _USINGTEXCOORD2 1 + + + // data across stages, stripped like the above. + struct VertexToPixel + { + UNITY_POSITION(pos); // must be named pos because Unity does stupid macro stuff + float3 worldPos : TEXCOORD0; + float3 worldNormal : TEXCOORD1; + float4 worldTangent : TEXCOORD2; + float4 texcoord0 : TEXCOORD3; + float4 texcoord1 : TEXCOORD4; + float4 texcoord2 : TEXCOORD5; + + // #if %TEXCOORD3REQUIREKEY% + float4 texcoord3 : TEXCOORD6; + // #endif + + // #if %SCREENPOSREQUIREKEY% + // float4 screenPos : TEXCOORD7; + // #endif + + UNITY_LIGHTING_COORDS(8,9) + UNITY_FOG_COORDS(10) + + + // #if %VERTEXCOLORREQUIREKEY% + float4 vertexColor : COLOR; + // #endif + + // #if %EXTRAV2F0REQUIREKEY% + // float4 extraV2F0 : TEXCOORD11; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // float4 extraV2F1 : TEXCOORD12; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // float4 extraV2F2 : TEXCOORD13; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // float4 extraV2F3 : TEXCOORD14; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // float4 extraV2F4 : TEXCOORD15; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // float4 extraV2F5 : TEXCOORD16; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // float4 extraV2F6 : TEXCOORD17; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // float4 extraV2F7 : TEXCOORD18; + // #endif + + UNITY_VERTEX_INPUT_INSTANCE_ID + UNITY_VERTEX_OUTPUT_STEREO + + }; + + + + // data describing the user output of a pixel + struct Surface + { + half3 Albedo; + half Height; + half3 Normal; + half Smoothness; + half3 Emission; + half Metallic; + half3 Specular; + half Occlusion; + half SpecularPower; // for simple lighting + half Alpha; + float outputDepth; // if written, SV_Depth semantic is used. ShaderData.clipPos.z is unused value + // HDRP Only + half SpecularOcclusion; + half SubsurfaceMask; + half Thickness; + half CoatMask; + half CoatSmoothness; + half Anisotropy; + half IridescenceMask; + half IridescenceThickness; + int DiffusionProfileHash; + float SpecularAAThreshold; + float SpecularAAScreenSpaceVariance; + // requires _OVERRIDE_BAKEDGI to be defined, but is mapped in all pipelines + float3 DiffuseGI; + float3 BackDiffuseGI; + float3 SpecularGI; + float ior; + float3 transmittanceColor; + float atDistance; + float transmittanceMask; + // requires _OVERRIDE_SHADOWMASK to be defines + float4 ShadowMask; + + // for decals + float NormalAlpha; + float MAOSAlpha; + + + }; + + // Data the user declares in blackboard blocks + struct Blackboard + { + + float blackboardDummyData; + }; + + // data the user might need, this will grow to be big. But easy to strip + struct ShaderData + { + float4 clipPos; // SV_POSITION + float3 localSpacePosition; + float3 localSpaceNormal; + float3 localSpaceTangent; + + float3 worldSpacePosition; + float3 worldSpaceNormal; + float3 worldSpaceTangent; + float tangentSign; + + float3 worldSpaceViewDir; + float3 tangentSpaceViewDir; + + float4 texcoord0; + float4 texcoord1; + float4 texcoord2; + float4 texcoord3; + + float2 screenUV; + float4 screenPos; + + float4 vertexColor; + bool isFrontFace; + + float4 extraV2F0; + float4 extraV2F1; + float4 extraV2F2; + float4 extraV2F3; + float4 extraV2F4; + float4 extraV2F5; + float4 extraV2F6; + float4 extraV2F7; + + float3x3 TBNMatrix; + Blackboard blackboard; + }; + + struct VertexData + { + #if SHADER_TARGET > 30 + // uint vertexID : SV_VertexID; + #endif + float4 vertex : POSITION; + float3 normal : NORMAL; + float4 tangent : TANGENT; + float4 texcoord0 : TEXCOORD0; + + // optimize out mesh coords when not in use by user or lighting system + #if _URP && (_USINGTEXCOORD1 || _PASSMETA || _PASSFORWARD || _PASSGBUFFER) + float4 texcoord1 : TEXCOORD1; + #endif + + #if _URP && (_USINGTEXCOORD2 || _PASSMETA || ((_PASSFORWARD || _PASSGBUFFER) && defined(DYNAMICLIGHTMAP_ON))) + float4 texcoord2 : TEXCOORD2; + #endif + + #if _STANDARD && (_USINGTEXCOORD1 || (_PASSMETA || ((_PASSFORWARD || _PASSGBUFFER || _PASSFORWARDADD) && LIGHTMAP_ON))) + float4 texcoord1 : TEXCOORD1; + #endif + #if _STANDARD && (_USINGTEXCOORD2 || (_PASSMETA || ((_PASSFORWARD || _PASSGBUFFER) && DYNAMICLIGHTMAP_ON))) + float4 texcoord2 : TEXCOORD2; + #endif + + + #if _HDRP + float4 texcoord1 : TEXCOORD1; + float4 texcoord2 : TEXCOORD2; + #endif + + // #if %TEXCOORD3REQUIREKEY% + float4 texcoord3 : TEXCOORD3; + // #endif + + // #if %VERTEXCOLORREQUIREKEY% + float4 vertexColor : COLOR; + // #endif + + #if _PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR)) + float3 previousPositionOS : TEXCOORD4; // Contain previous transform position (in case of skinning for example) + #if defined (_ADD_PRECOMPUTED_VELOCITY) + float3 precomputedVelocity : TEXCOORD5; // Add Precomputed Velocity (Alembic computes velocities on runtime side). + #endif + #endif + + UNITY_VERTEX_INPUT_INSTANCE_ID + }; + + struct TessVertex + { + float4 vertex : INTERNALTESSPOS; + float3 normal : NORMAL; + float4 tangent : TANGENT; + float4 texcoord0 : TEXCOORD0; + float4 texcoord1 : TEXCOORD1; + float4 texcoord2 : TEXCOORD2; + + // #if %TEXCOORD3REQUIREKEY% + float4 texcoord3 : TEXCOORD3; + // #endif + + // #if %VERTEXCOLORREQUIREKEY% + float4 vertexColor : COLOR; + // #endif + + // #if %EXTRAV2F0REQUIREKEY% + // float4 extraV2F0 : TEXCOORD5; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // float4 extraV2F1 : TEXCOORD6; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // float4 extraV2F2 : TEXCOORD7; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // float4 extraV2F3 : TEXCOORD8; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // float4 extraV2F4 : TEXCOORD9; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // float4 extraV2F5 : TEXCOORD10; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // float4 extraV2F6 : TEXCOORD11; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // float4 extraV2F7 : TEXCOORD12; + // #endif + + #if _PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR)) + float3 previousPositionOS : TEXCOORD13; // Contain previous transform position (in case of skinning for example) + #if defined (_ADD_PRECOMPUTED_VELOCITY) + float3 precomputedVelocity : TEXCOORD14; + #endif + #endif + + UNITY_VERTEX_INPUT_INSTANCE_ID + UNITY_VERTEX_OUTPUT_STEREO + }; + + struct ExtraV2F + { + float4 extraV2F0; + float4 extraV2F1; + float4 extraV2F2; + float4 extraV2F3; + float4 extraV2F4; + float4 extraV2F5; + float4 extraV2F6; + float4 extraV2F7; + Blackboard blackboard; + float4 time; + }; + + + float3 WorldToTangentSpace(ShaderData d, float3 normal) + { + return mul(d.TBNMatrix, normal); + } + + float3 TangentToWorldSpace(ShaderData d, float3 normal) + { + return mul(normal, d.TBNMatrix); + } + + // in this case, make standard more like SRPs, because we can't fix + // unity_WorldToObject in HDRP, since it already does macro-fu there + + #if _STANDARD + float3 TransformWorldToObject(float3 p) { return mul(unity_WorldToObject, float4(p, 1)); }; + float3 TransformObjectToWorld(float3 p) { return mul(unity_ObjectToWorld, float4(p, 1)); }; + float4 TransformWorldToObject(float4 p) { return mul(unity_WorldToObject, p); }; + float4 TransformObjectToWorld(float4 p) { return mul(unity_ObjectToWorld, p); }; + float4x4 GetWorldToObjectMatrix() { return unity_WorldToObject; } + float4x4 GetObjectToWorldMatrix() { return unity_ObjectToWorld; } + #if (defined(SHADER_API_D3D11) || defined(SHADER_API_XBOXONE) || defined(UNITY_COMPILER_HLSLCC) || defined(SHADER_API_PSSL) || (SHADER_TARGET_SURFACE_ANALYSIS && !SHADER_TARGET_SURFACE_ANALYSIS_MOJOSHADER)) + #define UNITY_SAMPLE_TEX2D_LOD(tex,coord, lod) tex.SampleLevel (sampler##tex,coord, lod) + #define UNITY_SAMPLE_TEX2D_SAMPLER_LOD(tex,samplertex,coord, lod) tex.SampleLevel (sampler##samplertex,coord, lod) + #else + #define UNITY_SAMPLE_TEX2D_LOD(tex,coord,lod) tex2D (tex,coord,0,lod) + #define UNITY_SAMPLE_TEX2D_SAMPLER_LOD(tex,samplertex,coord,lod) tex2D (tex,coord,0,lod) + #endif + + #undef UNITY_MATRIX_I_M + + #define UNITY_MATRIX_I_M unity_WorldToObject + + + #endif + + float3 GetCameraWorldPosition() + { + #if _HDRP + return GetCameraRelativePositionWS(_WorldSpaceCameraPos); + #else + return _WorldSpaceCameraPos; + #endif + } + + #if _GRABPASSUSED + #if _STANDARD + TEXTURE2D(%GRABTEXTURE%); + SAMPLER(sampler_%GRABTEXTURE%); + #endif + + half3 GetSceneColor(float2 uv) + { + #if _STANDARD + return SAMPLE_TEXTURE2D(%GRABTEXTURE%, sampler_%GRABTEXTURE%, uv).rgb; + #else + return SHADERGRAPH_SAMPLE_SCENE_COLOR(uv); + #endif + } + #endif + + + + #if _STANDARD + UNITY_DECLARE_DEPTH_TEXTURE(_CameraDepthTexture); + float GetSceneDepth(float2 uv) { return SAMPLE_DEPTH_TEXTURE(_CameraDepthTexture, uv); } + float GetLinear01Depth(float2 uv) { return Linear01Depth(GetSceneDepth(uv)); } + float GetLinearEyeDepth(float2 uv) { return LinearEyeDepth(GetSceneDepth(uv)); } + #else + float GetSceneDepth(float2 uv) { return SHADERGRAPH_SAMPLE_SCENE_DEPTH(uv); } + float GetLinear01Depth(float2 uv) { return Linear01Depth(GetSceneDepth(uv), _ZBufferParams); } + float GetLinearEyeDepth(float2 uv) { return LinearEyeDepth(GetSceneDepth(uv), _ZBufferParams); } + #endif + + float3 GetWorldPositionFromDepthBuffer(float2 uv, float3 worldSpaceViewDir) + { + float eye = GetLinearEyeDepth(uv); + float3 camView = mul((float3x3)UNITY_MATRIX_M, transpose(mul(UNITY_MATRIX_I_M, UNITY_MATRIX_I_V)) [2].xyz); + + float dt = dot(worldSpaceViewDir, camView); + float3 div = worldSpaceViewDir/dt; + float3 wpos = (eye * div) + GetCameraWorldPosition(); + return wpos; + } + + #if _HDRP + float3 ObjectToWorldSpacePosition(float3 pos) + { + return GetAbsolutePositionWS(TransformObjectToWorld(pos)); + } + #else + float3 ObjectToWorldSpacePosition(float3 pos) + { + return TransformObjectToWorld(pos); + } + #endif + + #if _STANDARD + UNITY_DECLARE_SCREENSPACE_TEXTURE(_CameraDepthNormalsTexture); + float3 GetSceneNormal(float2 uv, float3 worldSpaceViewDir) + { + float4 depthNorms = UNITY_SAMPLE_SCREENSPACE_TEXTURE(_CameraDepthNormalsTexture, uv); + float3 norms = DecodeViewNormalStereo(depthNorms); + norms = mul((float3x3)UNITY_MATRIX_V, norms) * 0.5 + 0.5; + return norms; + } + #elif _HDRP && !_DECALSHADER + + float3 GetSceneNormal(float2 uv, float3 worldSpaceViewDir) + { + NormalData nd; + DecodeFromNormalBuffer(_ScreenSize.xy * uv, nd); + return nd.normalWS; + } + #elif _URP + #if (SHADER_LIBRARY_VERSION_MAJOR >= 10) + #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/DeclareNormalsTexture.hlsl" + #endif + + float3 GetSceneNormal(float2 uv, float3 worldSpaceViewDir) + { + #if (SHADER_LIBRARY_VERSION_MAJOR >= 10) + return SampleSceneNormals(uv); + #else + float3 wpos = GetWorldPositionFromDepthBuffer(uv, worldSpaceViewDir); + return normalize(-cross(ddx(wpos), ddy(wpos))) * 0.5 + 0.5; + #endif + + } + #endif + + #if _HDRP + + half3 UnpackNormalmapRGorAG(half4 packednormal) + { + // This do the trick + packednormal.x *= packednormal.w; + + half3 normal; + normal.xy = packednormal.xy * 2 - 1; + normal.z = sqrt(1 - saturate(dot(normal.xy, normal.xy))); + return normal; + } + half3 UnpackNormal(half4 packednormal) + { + #if defined(UNITY_NO_DXT5nm) + return packednormal.xyz * 2 - 1; + #else + return UnpackNormalmapRGorAG(packednormal); + #endif + } + #endif + #if _HDRP || _URP + + half3 UnpackScaleNormal(half4 packednormal, half scale) + { + #ifndef UNITY_NO_DXT5nm + // Unpack normal as DXT5nm (1, y, 1, x) or BC5 (x, y, 0, 1) + // Note neutral texture like "bump" is (0, 0, 1, 1) to work with both plain RGB normal and DXT5nm/BC5 + packednormal.x *= packednormal.w; + #endif + half3 normal; + normal.xy = (packednormal.xy * 2 - 1) * scale; + normal.z = sqrt(1 - saturate(dot(normal.xy, normal.xy))); + return normal; + } + + #endif + + + void GetSun(out float3 lightDir, out float3 color) + { + lightDir = float3(0.5, 0.5, 0); + color = 1; + #if _HDRP + if (_DirectionalLightCount > 0) + { + DirectionalLightData light = _DirectionalLightDatas[0]; + lightDir = -light.forward.xyz; + color = light.color; + } + #elif _STANDARD + lightDir = normalize(_WorldSpaceLightPos0.xyz); + color = _LightColor0.rgb; + #elif _URP + Light light = GetMainLight(); + lightDir = light.direction; + color = light.color; + #endif + } + + + + + half4 _Color; + half4 _MainTex_ST, _MainTex_TexelSize; + half _Alpha, _AlphaCutoffValue; + + #if ATLAS_ON + half _MinXUV, _MaxXUV, _MinYUV, _MaxYUV; + #endif + + #if GLOW_ON + half4 _GlowColor; + half _Glow, _GlowGlobal; + #endif + + #if HSV_ON + half _HsvShift, _HsvSaturation, _HsvBright; + #endif + + #if DISTORT_ON + half4 _DistortTex_ST; + half _DistortTexXSpeed, _DistortTexYSpeed, _DistortAmount; + #endif + + #if FADE_ON + half4 _FadeBurnColor, _FadeTex_ST, _FadeBurnTex_ST; + half _FadeAmount, _FadeBurnWidth, _FadeBurnTransition,_FadeBurnGlow; + #endif + + #if OUTBASE_ON + half4 _OutlineColor; + half _OutlineAlpha, _OutlineGlow, _OutlineWidth; + int _OutlinePixelWidth; + #endif + + #if OUTTEX_ON + half4 _OutlineTex_ST; + half _OutlineTexXSpeed, _OutlineTexYSpeed; + #endif + + #if OUTDIST_ON + half4 _OutlineDistortTex_ST; + half _OutlineDistortTexXSpeed, _OutlineDistortTexYSpeed, _OutlineDistortAmount; + #endif + + #if ALPHAOUTLINE_ON + half _AlphaOutlineGlow, _AlphaOutlinePower, _AlphaOutlineMinAlpha, _AlphaOutlineBlend; + half4 _AlphaOutlineColor; + #endif + + #if INNEROUTLINE_ON + half _InnerOutlineThickness, _InnerOutlineAlpha, _InnerOutlineGlow; + half4 _InnerOutlineColor; + #endif + + #if GRADIENT_ON + half _GradBlend, _GradBoostX, _GradBoostY; + half4 _GradTopRightCol, _GradTopLeftCol, _GradBotRightCol, _GradBotLeftCol; + #endif + + #if COLORSWAP_ON + half4 _ColorSwapRed, _ColorSwapGreen, _ColorSwapBlue; + half _ColorSwapRedLuminosity, _ColorSwapGreenLuminosity, _ColorSwapBlueLuminosity, _ColorSwapBlend; + #endif + + #if CHANGECOLOR_ON + half4 _ColorChangeNewCol, _ColorChangeTarget; + half _ColorChangeTolerance, _ColorChangeLuminosity; + #endif + #if CHANGECOLOR2_ON + half4 _ColorChangeNewCol2, _ColorChangeTarget2; + half _ColorChangeTolerance2; + #endif + #if CHANGECOLOR3_ON + half4 _ColorChangeNewCol3, _ColorChangeTarget3; + half _ColorChangeTolerance3; + #endif + + #if COLORRAMP_ON + half _ColorRampLuminosity, _ColorRampBlend; + #endif + + #if HITEFFECT_ON + half4 _HitEffectColor; + half _HitEffectGlow, _HitEffectBlend; + #endif + + #if NEGATIVE_ON + half _NegativeAmount; + #endif + + #if PIXELATE_ON + half _PixelateSize; + #endif + + #if GREYSCALE_ON + half _GreyscaleLuminosity, _GreyscaleBlend; + half4 _GreyscaleTintColor; + #endif + + #if POSTERIZE_ON + half _PosterizeNumColors, _PosterizeGamma; + #endif + + #if BLUR_ON + half _BlurIntensity; + #endif + + #if MOTIONBLUR_ON + half _MotionBlurAngle, _MotionBlurDist; + #endif + + #if GHOST_ON + half _GhostColorBoost, _GhostTransparency, _GhostBlend; + #endif + + #if HOLOGRAM_ON + half _HologramStripesAmount, _HologramMinAlpha, _HologramUnmodAmount, _HologramStripesSpeed, _HologramMaxAlpha, _HologramBlend; + half4 _HologramStripeColor; + #endif + + #if CHROMABERR_ON + half _ChromAberrAmount, _ChromAberrAlpha; + #endif + + #if GLITCH_ON + half _GlitchAmount, _GlitchSize; + #endif + + #if FLICKER_ON + half _FlickerFreq, _FlickerPercent, _FlickerAlpha; + #endif + + #if SHADOW_ON + half _ShadowX, _ShadowY, _ShadowAlpha; + half4 _ShadowColor; + #endif + + #if SHINE_ON + half4 _ShineColor; + half _ShineLocation, _ShineRotate, _ShineWidth, _ShineGlow; + #endif + + #if CONTRAST_ON + half _Contrast, _Brightness; + #endif + + #if OVERLAY_ON + half4 _OverlayTex_ST, _OverlayColor; + half _OverlayGlow, _OverlayBlend, _OverlayTextureScrollXSpeed, _OverlayTextureScrollYSpeed; + #endif + + #if DOODLE_ON + half _HandDrawnAmount, _HandDrawnSpeed; + #endif + + #if WIND_ON + half _GrassSpeed, _GrassWind, _GrassManualAnim, _GrassRadialBend; + #endif + + #if WAVEUV_ON + float _WaveAmount, _WaveSpeed, _WaveStrength, _WaveX, _WaveY; + #endif + + #if ROUNDWAVEUV_ON + half _RoundWaveStrength, _RoundWaveSpeed; + #endif + + #if RECTSIZE_ON + half _RectSize; + #endif + + #if OFFSETUV_ON + half _OffsetUvX, _OffsetUvY; + #endif + + #if CLIPPING_ON + half _ClipUvLeft, _ClipUvRight, _ClipUvUp, _ClipUvDown; + #endif + + #if RADIALCLIPPING_ON + half _RadialStartAngle, _RadialClip, _RadialClip2; + #endif + + #if TEXTURESCROLL_ON + half _TextureScrollXSpeed, _TextureScrollYSpeed; + #endif + + #if ZOOMUV_ON + half _ZoomUvAmount; + #endif + + #if WARP_ON + half _WarpStrength, _WarpSpeed, _WarpScale; + #endif + + #if TWISTUV_ON + half _TwistUvAmount, _TwistUvPosX, _TwistUvPosY, _TwistUvRadius; + #endif + + #if ROTATEUV_ON + half _RotateUvAmount; + #endif + + #if FISHEYE_ON + half _FishEyeUvAmount; + #endif + + #if PINCH_ON + half _PinchUvAmount; + #endif + + #if SHAKEUV_ON + half _ShakeUvSpeed, _ShakeUvX, _ShakeUvY; + #endif + + #if NORMALMAP_ON + half _NormalStrength; + #endif + + float _RandomSeed; + + + + + + + + + + + TEXTURE2D(_MainTex); + SAMPLER(sampler_MainTex); + + #if GLOW_ON + TEXTURE2D(_GlowTex); + SAMPLER(sampler_GlowTex); + #endif + + #if FADE_ON + TEXTURE2D(_FadeTex); + SAMPLER(sampler_FadeTex); + + TEXTURE2D(_FadeBurnTex); + SAMPLER(sampler_FadeBurnTex); + #endif + + #if DISTORT_ON + TEXTURE2D(_DistortTex); + SAMPLER(sampler_DistortTex); + #endif + + #if OUTTEX_ON + TEXTURE2D(_OutlineTex); + SAMPLER(sampler_OutlineTex); + #endif + + #if OUTDIST_ON + TEXTURE2D(_OutlineDistortTex); + SAMPLER(sampler_OutlineDistortTex); + #endif + + #if COLORSWAP_ON + TEXTURE2D(_ColorSwapTex); + SAMPLER(sampler_ColorSwapTex); + #endif + + #if COLORRAMP_ON + TEXTURE2D(_ColorRampTex); + TEXTURE2D(_ColorRampTexGradient); + SAMPLER(sampler_ColorRampTex); + SAMPLER(sampler_ColorRampTexGradient); + #endif + + #if SHINE_ON + TEXTURE2D(_ShineMask); + SAMPLER(sampler_ShineMask); + #endif + + #if OVERLAY_ON + TEXTURE2D(_OverlayTex); + SAMPLER(sampler_OverlayTex); + #endif + + #if NORMALMAP_ON + TEXTURE2D(_NormalMap); + SAMPLER(sampler_NormalMap); + #endif + + + half3 GetPixel(in int offsetX, in int offsetY, in half2 uv, in Texture2D _tex, in SamplerState _sampler) + { + half2 _uv = uv + half2(offsetX * _MainTex_TexelSize.x, offsetY * _MainTex_TexelSize.y); + half4 col = SAMPLE_TEXTURE2D(_tex, _sampler, _uv); + return col.rgb; + } + + + //BLURS------------------------------------------------------------------------- + half4 Blur(half2 uv, Texture2D source, SamplerState sampler_source, half Intensity) + { + const half2 texelSize = 1.0 / _ScreenParams.xy; + const half4 color = SAMPLE_TEXTURE2D(source, sampler_source, uv); + const half2 offset = Intensity * texelSize; + + half4 accumulatedColor = color; + half accumulatedWeight = 1.0; + for (int x = -1; x <= 1; x++) + { + for (int y = -1; y <= 1; y++) + { + const half2 sampleUV = uv + half2(x, y) * offset; + const half4 sampleColor = SAMPLE_TEXTURE2D(source, sampler_source, sampleUV); + + accumulatedColor += sampleColor; + accumulatedWeight += 1.0; + } + } + + half4 blurredColor = accumulatedColor / accumulatedWeight; + return blurredColor; + } + + half BlurHD_G(half bhqp, half x) + { + return exp(-(x * x) / (2.0 * bhqp * bhqp)); + } + half4 BlurHD(half2 uv, Texture2D source, SamplerState sampler_source, half BlurAmount, half xScale, half yScale) + { + int iterations = 16; + int halfIterations = iterations / 2; + half sigmaX = 0.1 + BlurAmount * 0.5; + half sigmaY = sigmaX; + half total = 0.0; + half4 ret = half4(0, 0, 0, 0); + for (int iy = 0; iy < iterations; ++iy) + { + half fy = BlurHD_G(sigmaY, half(iy) -half(halfIterations)); + half offsetY = half(iy - halfIterations) * 0.00390625 * xScale; + for (int ix = 0; ix < iterations; ++ix) + { + half fx = BlurHD_G(sigmaX, half(ix) - half(halfIterations)); + half offsetX = half(ix - halfIterations) * 0.00390625 * yScale; + total += fx * fy; + ret += SAMPLE_TEXTURE2D(source, sampler_source, uv + half2(offsetX, offsetY)) * fx * fy; + } + } + return ret / total; + } + //----------------------------------------------------------------------- + + + //------------------------------------------- + half RemapFloat(half inValue, half inMin, half inMax, half outMin, half outMax){ + return outMin + (inValue - inMin) * (outMax - outMin) / (inMax - inMin); + } + //------------------------------------------- + + //----------------------------------------------------------------------- + half rand(half2 seed, half offset) { + return (frac(sin(dot(seed, half2(12.9898, 78.233))) * 43758.5453) + offset) % 1.0; + } + + half rand2(half2 seed, half offset) { + return (frac(sin(dot(seed * floor(50 + (_Time.x % 1.0) * 12.), half2(127.1, 311.7))) * 43758.5453123) + offset) % 1.0; + } + + half rand2CustomTime(half2 seed, half offset, half customTime) { + return (frac(sin(dot(seed * floor(50 + (customTime % 1.0) * 12.), half2(127.1, 311.7))) * 43758.5453123) + offset) % 1.0; + } + //----------------------------------------------------------------------- + + + void Ext_ModifyVertex0 (inout VertexData v, inout ExtraV2F d) + { + //BILBOARD_ON + #if BILBOARD_ON + half3 camRight = mul((half3x3)unity_CameraToWorld, half3(1,0,0)); + half3 camUp = half3(0,1,0); + #if BILBOARDY_ON + camUp = mul((half3x3)unity_CameraToWorld, half3(0,1,0)); + #endif + half3 localPos = v.vertex.x * camRight + v.vertex.y * camUp; + v.vertex = half4(localPos, 1); + #endif + //----------------------------------------------------------- + + v.texcoord0.xy = TRANSFORM_TEX(v.texcoord0.xy, _MainTex); + half2 center = half2(0.5, 0.5); + #if ATLAS_ON + center = half2((_MaxXUV + _MinXUV) / 2.0, (_MaxYUV + _MinYUV) / 2.0); + #endif + + //POLARUV_ON + #if POLARUV_ON + v.texcoord0.xy = v.texcoord0.xy - center; + #endif + + //---------------------------------------- + + //ROTATEUV_ON + #if ROTATEUV_ON + half2 uvC = v.texcoord0.xy; + half cosAngle = cos(_RotateUvAmount); + half sinAngle = sin(_RotateUvAmount); + half2x2 rot = half2x2(cosAngle, -sinAngle, sinAngle, cosAngle); + uvC -= center; + v.texcoord0.xy = mul(rot, uvC); + v.texcoord0.xy += center; + #endif + //-------------------- + + #if RECTSIZE_ON + v.vertex.xyz += (v.vertex.xyz * (_RectSize - 1.0)); + #endif + + #if OUTTEX_ON + v.texcoord1.xy = TRANSFORM_TEX(v.texcoord0.xy, _OutlineTex); + #endif + + #if OUTDIST_ON + v.texcoord2.xy = TRANSFORM_TEX(v.texcoord0.xy, _OutlineDistortTex); + #endif + + #if DISTORT_ON + v.texcoord3.xy = TRANSFORM_TEX(v.texcoord0.xy, _DistortTex); + #endif + } + + void Ext_SurfaceFunction0 (inout Surface o, ShaderData d) + { + half randomSeed = _RandomSeed; + + float2 uvRect = d.texcoord0; + half2 center = half2(0.5, 0.5); + #if ATLAS_ON + center = half2((_MaxXUV + _MinXUV) / 2.0, (_MaxYUV + _MinYUV) / 2.0); + uvRect = half2((d.texcoord0.x - _MinXUV) / (_MaxXUV - _MinXUV), (d.texcoord0.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half2 centerTiled = half2(center.x * _MainTex_ST.x, center.y * _MainTex_ST.y); + + //CLIPPING_ON + #if CLIPPING_ON + half2 tiledUv = half2(d.texcoord0.x / _MainTex_ST.x, d.texcoord0.y / _MainTex_ST.y); + #if ATLAS_ON + tiledUv = half2((tiledUv.x - _MinXUV) / (_MaxXUV - _MinXUV), (tiledUv.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + clip((1 - _ClipUvUp) - tiledUv.y); + clip(tiledUv.y - _ClipUvDown); + clip((1 - _ClipUvRight) - tiledUv.x); + clip(tiledUv.x - _ClipUvLeft); + #endif + //---------------------------------- + + //RADIALCLIPPING_ON + #if RADIALCLIPPING_ON + half2 tiledUv2 = half2(d.texcoord0.x / _MainTex_ST.x, d.texcoord0.y / _MainTex_ST.y); + #if ATLAS_ON + tiledUv2 = half2((tiledUv2.x - _MinXUV) / (_MaxXUV - _MinXUV), (tiledUv2.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half startAngle = _RadialStartAngle - _RadialClip; + half endAngle = _RadialStartAngle + _RadialClip2; + half offset0 = clamp(0, 360, startAngle + 360); + half offset360 = clamp(0, 360, endAngle - 360); + half2 atan2Coord = half2(lerp(-1, 1, tiledUv2.x), lerp(-1, 1, tiledUv2.y)); + half atanAngle = atan2(atan2Coord.y, atan2Coord.x) * 57.3; // angle in degrees + if(atanAngle < 0) atanAngle = 360 + atanAngle; + if(atanAngle >= startAngle && atanAngle <= endAngle) discard; + if(atanAngle <= offset360) discard; + if(atanAngle >= offset0) discard; + #endif + + //----------------------------- + + //TEXTURESCROLL_ON && ATLAS_ON + #if TEXTURESCROLL_ON && ATLAS_ON + d.texcoord0.xy = half2(_MinXUV + ((_MaxXUV - _MinXUV) * (abs(((_Time.y + randomSeed) * _TextureScrollXSpeed) + uvRect.x) % 1)), + _MinYUV + ((_MaxYUV - _MinYUV) * (abs(((_Time.y + randomSeed) * _TextureScrollYSpeed) + uvRect.y) % 1))); + #endif + //---------------------------- + + //OFFSETUV_ON + #if OFFSETUV_ON + #if ATLAS_ON + d.texcoord0.xy = half2(_MinXUV + ((_MaxXUV - _MinXUV) * (abs((_OffsetUvX + uvRect.x) % 1))), + _MinYUV + ((_MaxYUV - _MinYUV) * (abs(_OffsetUvY + uvRect.y) % 1))); + #else + d.texcoord0.xy += half2(_OffsetUvX, _OffsetUvY); + #endif + #endif + + //---------------------- + + //POLARUV_ON + #if POLARUV_ON + d.texcoord0.xy = half2(atan2(d.texcoord0.y, d.texcoord0.x) / (2.0f * 3.141592653589f), length(d.texcoord0.xy)); + d.texcoord0.xy *= _MainTex_ST.xy; + #endif + + //-------------------------------------- + + //TWISTUV_ON + #if TWISTUV_ON + #if ATLAS_ON + _TwistUvPosX = ((_MaxXUV - _MinXUV) * _TwistUvPosX) + _MinXUV; + _TwistUvPosY = ((_MaxYUV - _MinYUV) * _TwistUvPosY) + _MinYUV; + #endif + half2 tempUv = d.texcoord0.xy - half2(_TwistUvPosX * _MainTex_ST.x, _TwistUvPosY * _MainTex_ST.y); + _TwistUvRadius *= (_MainTex_ST.x + _MainTex_ST.y) / 2; + half percent = (_TwistUvRadius - length(tempUv)) / _TwistUvRadius; + half theta = percent * percent * (2.0 * sin(_TwistUvAmount)) * 8.0; + half s = sin(theta); + half c = cos(theta); + half beta = max(sign(_TwistUvRadius - length(tempUv)), 0.0); + tempUv = half2(dot(tempUv, half2(c, -s)), dot(tempUv, half2(s, c))) * beta + tempUv * (1 - beta); + tempUv += half2(_TwistUvPosX * _MainTex_ST.x, _TwistUvPosY * _MainTex_ST.y); + d.texcoord0.xy = tempUv; + #endif + + //-------------------------------------------- + + //FISHEYE_ON + #if FISHEYE_ON + half bind = length(centerTiled); + half2 dF = d.texcoord0.xy - centerTiled; + half dFlen = length(dF); + half fishInt = (3.14159265359 / bind) * (_FishEyeUvAmount + 0.001); + d.texcoord0.xy = centerTiled + (dF / (max(0.0001, dFlen))) * tan(dFlen * fishInt) * bind / tan(bind * fishInt); + #endif + //--------------------------------------------- + + //PINCH_ON + #if PINCH_ON + half2 dP = d.texcoord0.xy - centerTiled; + half pinchInt = (3.141592 / length(centerTiled)) * (-_PinchUvAmount + 0.001); + d.texcoord0.xy = centerTiled + normalize(dP) * atan(length(dP) * -pinchInt * 10.0) * 0.5 / atan(-pinchInt * 5); + #endif + + //--------------------------------------------- + + //ZOOMUV_ON + #if ZOOMUV_ON + d.texcoord0.xy -= centerTiled; + d.texcoord0.xy = d.texcoord0.xy * _ZoomUvAmount; + d.texcoord0.xy += centerTiled; + #endif + + //----------------------------------------------- + + //DOODLE_ON + #if DOODLE_ON + half2 uvCopy = uvRect; + _HandDrawnSpeed = (floor((_Time.x + randomSeed) * 20 * _HandDrawnSpeed) / _HandDrawnSpeed) * _HandDrawnSpeed; + uvCopy.x = sin((uvCopy.x * _HandDrawnAmount + _HandDrawnSpeed) * 4); + uvCopy.y = cos((uvCopy.y * _HandDrawnAmount + _HandDrawnSpeed) * 4); + d.texcoord0.xy = lerp(d.texcoord0.xy, d.texcoord0.xy + uvCopy, 0.0005 * _HandDrawnAmount); + #endif + + //-------------------------- + + //SHAKEUV_ON + #if SHAKEUV_ON + half xShake = sin((_Time.x + randomSeed) * _ShakeUvSpeed * 50) * _ShakeUvX; + half yShake = cos((_Time.x + randomSeed) * _ShakeUvSpeed * 50) * _ShakeUvY; + d.texcoord0.xy += half2(xShake * 0.012, yShake * 0.01); + #endif + + //------------------------------------------- + + //RECTSIZE_ON + #if RECTSIZE_ON + d.texcoord0.xy = d.texcoord0.xy * (_RectSize).xx + (((-_RectSize * 0.5) + 0.5)).xx; + #endif + + //------------------------------------------- + + //DISTORT_ON + #if DISTORT_ON + #if ATLAS_ON + d.texcoord3.x = d.texcoord3.x * (1 / (_MaxXUV - _MinXUV)); + d.texcoord3.y = d.texcoord3.y * (1 / (_MaxYUV - _MinYUV)); + #endif + + d.texcoord3.x += ((_Time.x + _RandomSeed) * _DistortTexXSpeed) % 1; + d.texcoord3.y += ((_Time.x + _RandomSeed) * _DistortTexYSpeed) % 1; + half distortAmnt = (SAMPLE_TEXTURE2D(_DistortTex, sampler_DistortTex, d.texcoord3.xy).r - 0.5) * 0.2 * _DistortAmount; + d.texcoord0.x += distortAmnt; + d.texcoord0.y += distortAmnt; + #endif + //------------------------------------------------------- + + //WARP_ON + #if WARP_ON + half2 warpUv = half2(d.texcoord0.x / _MainTex_ST.x, d.texcoord0.y / _MainTex_ST.y); + #if ATLAS_ON + warpUv = half2((warpUv.x - _MinXUV) / (_MaxXUV - _MinXUV), (warpUv.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + const float tau = 6.283185307179586; + float xWarp = (_Time.y + randomSeed) * _WarpSpeed + warpUv.x * tau / _WarpScale; + float yWarp = (_Time.y + randomSeed) * _WarpSpeed + warpUv.y * tau / _WarpScale; + float2 warp = float2(sin(xWarp), sin(yWarp)) * _WarpStrength; + d.texcoord0.xy += warp; + #endif + + //------------------------------------------------------- + + //WAVEUV_ON + #if WAVEUV_ON + float2 uvWave = half2(_WaveX * _MainTex_ST.x, _WaveY * _MainTex_ST.y) - d.texcoord0.xy; + uvWave %= 1; + #if ATLAS_ON + uvWave = half2(_WaveX, _WaveY) - uvRect; + #endif + uvWave.x *= _ScreenParams.x / _ScreenParams.y; + float waveTime = _Time.y + randomSeed; + float angWave = (sqrt(dot(uvWave, uvWave)) * _WaveAmount) - ((waveTime * _WaveSpeed)); + d.texcoord0.xy = d.texcoord0.xy + uvWave * sin(angWave) * (_WaveStrength / 1000.0); + #endif + //---------------------------------------------------- + + //ROUNDWAVEUV_ON + #if ROUNDWAVEUV_ON + half xWave = ((0.5 * _MainTex_ST.x) - uvRect.x); + half yWave = ((0.5 * _MainTex_ST.y) - uvRect.y) * (_MainTex_TexelSize.w / _MainTex_TexelSize.z); + half ripple = -sqrt(xWave*xWave + yWave* yWave); + d.texcoord0.xy += (sin((ripple + (_Time.y + randomSeed) * (_RoundWaveSpeed/10.0)) / 0.015) * (_RoundWaveStrength/10.0)) % 1; + #endif + //---------------------------------------------------- + + + //WIND_ON + #if WIND_ON + half windOffset = sin((_Time.x + randomSeed) * _GrassSpeed * 10); + half2 windCenter = half2(0.5, 0.1); + #if ATLAS_ON + windCenter.x = ((_MaxXUV - _MinXUV) * windCenter.x) + _MinXUV; + windCenter.y = ((_MaxYUV - _MinYUV) * windCenter.y) + _MinYUV; + #endif + #if !MANUALWIND_ON + d.texcoord0.x = fmod(abs(lerp(d.texcoord0.x, d.texcoord0.x + (_GrassWind * 0.01 * windOffset), uvRect.y)), 1); + #else + d.texcoord0.x = fmod(abs(lerp(d.texcoord0.x, d.texcoord0.x + (_GrassWind * 0.01 * _GrassManualAnim), uvRect.y)), 1); + windOffset = _GrassManualAnim; + #endif + half2 delta = d.texcoord0.xy - windCenter; + half delta2 = dot(delta.xy, delta.xy); + half2 delta_offset = delta2 * windOffset; + d.texcoord0.xy = d.texcoord0.xy + half2(delta.y, -delta.x) * delta_offset * _GrassRadialBend; + #endif + + //-------------------------------------------------------- + + //TEXTURESCROLL_ON && !ATLAS_ON + #if TEXTURESCROLL_ON && !ATLAS_ON + d.texcoord0.x += ((_Time.y + randomSeed) * _TextureScrollXSpeed) % 1; + d.texcoord0.y += ((_Time.y + randomSeed) * _TextureScrollYSpeed) % 1; + #endif + //------------------------------ + + //PIXELATE_ON + #if PIXELATE_ON + half aspectRatio = _MainTex_TexelSize.x / _MainTex_TexelSize.y; + half2 pixelSize = float2(_PixelateSize, _PixelateSize * aspectRatio); + d.texcoord0.xy = floor(d.texcoord0.xy * pixelSize) / pixelSize; + #endif + //-------------- + + half4 col = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy); + half originalAlpha = col.a; + col *= d.vertexColor; + + //NORMAL MAP + #if NORMALMAP_ON + half4 normalSample = SAMPLE_TEXTURE2D(_NormalMap, sampler_NormalMap, d.texcoord0.xy); + half3 normalTS = UnpackNormal(normalSample); + normalTS.xy *= _NormalStrength; + o.Normal = normalTS; + #endif + + + //GLITCH_ON + #if GLITCH_ON + half2 uvGlitch = uvRect; + uvGlitch.y -= 0.5; + half lineNoise = pow(rand2(floor(uvGlitch * half2(24., 19.) * _GlitchSize) * 4.0, randomSeed), 3.0) * _GlitchAmount + * pow(rand2(floor(uvGlitch * half2(38., 14.) * _GlitchSize) * 4.0, randomSeed), 3.0); + col = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(lineNoise * 0.02 * rand2(half2(2.0, 1), randomSeed), 0)) * d.vertexColor; + #endif + //-------------------------------------- + + //CHROMABERR_ON + #if CHROMABERR_ON + half4 r = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(_ChromAberrAmount/10, 0)) * d.vertexColor; + half4 b = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(-_ChromAberrAmount/10, 0)) * d.vertexColor; + col = half4(r.r * r.a, col.g, b.b * b.a, max(max(r.a, b.a) * _ChromAberrAlpha, col.a)); + #endif + + //-------------------------------- + + //BLUR_ON + #if BLUR_ON + #if ATLAS_ON + #if !BLURISHD_ON + col = BlurHD(d.texcoord0.xy, _MainTex, sampler_MainTex, _BlurIntensity, (_MaxXUV - _MinXUV), (_MaxYUV - _MinYUV)) * d.vertexColor; + #else + col = Blur(d.texcoord0.xy, _MainTex, sampler_MainTex, _BlurIntensity * (_MaxXUV - _MinXUV)) * d.vertexColor; + #endif + #else + #if !BLURISHD_ON + col = BlurHD(d.texcoord0.xy, _MainTex, sampler_MainTex, _BlurIntensity, 1, 1) * d.vertexColor; + #else + col = Blur(d.texcoord0.xy, _MainTex, sampler_MainTex, _BlurIntensity) * d.vertexColor; + #endif + #endif + #endif + + //-------------------- + + //MOTIONBLUR_ON + #if MOTIONBLUR_ON + _MotionBlurAngle = _MotionBlurAngle * 3.1415926; + #define rot(n) mul(n, half2x2(cos(_MotionBlurAngle), -sin(_MotionBlurAngle), sin(_MotionBlurAngle), cos(_MotionBlurAngle))) + _MotionBlurDist = _MotionBlurDist * 0.005; + #if ATLAS_ON + _MotionBlurDist *= (_MaxXUV - _MinXUV); + #endif + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(-_MotionBlurDist, -_MotionBlurDist))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(-_MotionBlurDist * 2, -_MotionBlurDist * 2))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(-_MotionBlurDist * 3, -_MotionBlurDist * 3))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(-_MotionBlurDist * 4, -_MotionBlurDist * 4))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(_MotionBlurDist, _MotionBlurDist))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(_MotionBlurDist * 2, _MotionBlurDist * 2))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(_MotionBlurDist * 3, _MotionBlurDist * 3))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(_MotionBlurDist * 4, _MotionBlurDist * 4))); + col.rgb = col.rgb / 9; + #endif + //------------------------------------ + + //NEGATIVE_ON + #if NEGATIVE_ON + col.rgb = lerp(col.rgb, 1 - col.rgb, _NegativeAmount); + #endif + + //-------------- + half luminance = 0; + + //GREYSCALE_ON && !GREYSCALEOUTLINE_ON + #if GREYSCALE_ON && !GREYSCALEOUTLINE_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + luminance = saturate(luminance + _GreyscaleLuminosity); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _GreyscaleTintColor, _GreyscaleBlend); + #endif + //------------------------------------ + + //GHOST_ON + #if GHOST_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + half4 ghostResult; + ghostResult.a = saturate(luminance - _GhostTransparency) * col.a; + ghostResult.rgb = col.rgb * (luminance + _GhostColorBoost); + col = lerp(col, ghostResult, _GhostBlend); + #endif + //------------------------------------ + + //INNEROUTLINE_ON + #if INNEROUTLINE_ON + half3 innerT = abs(GetPixel(0, _InnerOutlineThickness, d.texcoord0.xy, _MainTex, sampler_MainTex) - GetPixel(0, -_InnerOutlineThickness, d.texcoord0.xy, _MainTex, sampler_MainTex)); + innerT += abs(GetPixel(_InnerOutlineThickness, 0, d.texcoord0.xy, _MainTex, sampler_MainTex) - GetPixel(-_InnerOutlineThickness, 0, d.texcoord0.xy, _MainTex, sampler_MainTex)); + #if !ONLYINNEROUTLINE_ON + innerT = (innerT / 2.0) * col.a * _InnerOutlineAlpha; + col.rgb += length(innerT) * _InnerOutlineColor.rgb * _InnerOutlineGlow; + #else + innerT *= col.a * _InnerOutlineAlpha; + col.rgb = length(innerT) * _InnerOutlineColor.rgb * _InnerOutlineGlow; + col.a = step(0.3, col.r+col.g+col.b); + #endif + #endif + //------------------------------------------------------- + + //HITEFFECT_ON + #if HITEFFECT_ON + col.rgb = lerp(col.rgb, _HitEffectColor.rgb * _HitEffectGlow, _HitEffectBlend); + #endif + //-------------------- + + //GRADIENT_ON + #if GRADIENT_ON + half2 tiledUvGrad = half2(uvRect.x / _MainTex_ST.x, uvRect.y / _MainTex_ST.y); + #if GRADIENT2COL_ON + _GradTopRightCol = _GradTopLeftCol; + _GradBotRightCol = _GradBotLeftCol; + #endif + #if RADIALGRADIENT_ON + half radialDist = 1 - length(tiledUvGrad - half2(0.5, 0.5)); + radialDist *= (_MainTex_TexelSize.w / _MainTex_TexelSize.z); + radialDist = saturate(_GradBoostX * radialDist); + half4 gradientResult = lerp(_GradTopLeftCol, _GradBotLeftCol, radialDist); + #else + half gradXLerpFactor = saturate(pow(tiledUvGrad.x, _GradBoostX)); + half4 gradientResult = lerp(lerp(_GradBotLeftCol, _GradBotRightCol, gradXLerpFactor), + lerp(_GradTopLeftCol, _GradTopRightCol, gradXLerpFactor), saturate(pow(tiledUvGrad.y, _GradBoostY))); + #endif + gradientResult = lerp(col, gradientResult, _GradBlend); + col.rgb = gradientResult.rgb * col.a; + col.a *= gradientResult.a; + #endif + //-------------------------------------------------------------------- + + //CONTRAST_ON + #if CONTRAST_ON + col.rgb = (col.rgb - float3(0.5, 0.5, 0.5)) * _Contrast + float3(0.5, 0.5, 0.5); + col.rgb += _Brightness; + #endif + + //------------------------------------------------------------------- + + //COLORSWAP_ON + #if COLORSWAP_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + half4 swapMask = SAMPLE_TEXTURE2D(_ColorSwapTex, sampler_ColorSwapTex, d.texcoord0.xy); + swapMask.rgb *= swapMask.a; + half3 redSwap = _ColorSwapRed * swapMask.r * saturate(luminance + _ColorSwapRedLuminosity); + half3 greenSwap = _ColorSwapGreen * swapMask.g * saturate(luminance + _ColorSwapGreenLuminosity); + half3 blueSwap = _ColorSwapBlue * swapMask.b * saturate(luminance + _ColorSwapBlueLuminosity); + swapMask.rgb = col.rgb * saturate(1 - swapMask.r - swapMask.g - swapMask.b); + col.rgb = lerp(col.rgb, swapMask.rgb + redSwap + greenSwap + blueSwap, _ColorSwapBlend); + #endif + //-------------------------------------------------------------------- + + //COLORRAMP_ON && !COLORRAMPOUTLINE_ON + #if COLORRAMP_ON && !COLORRAMPOUTLINE_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + luminance = saturate(luminance + _ColorRampLuminosity); + #if GRADIENTCOLORRAMP_ON + col.rgb = lerp(col.rgb, SAMPLE_TEXTURE2D(_ColorRampTexGradient, sampler_ColorRampTexGradient, half2(luminance, 0)).rgb, _ColorRampBlend); + #else + col.rgb = lerp(col.rgb, SAMPLE_TEXTURE2D(_ColorRampTex, sampler_ColorRampTex, half2(luminance, 0)).rgb, _ColorRampBlend); + #endif + #endif + //-------------------------------------------------------------------- + + //CHANGECOLOR_ON + #if CHANGECOLOR_ON + float3 currChangeColor = saturate(col.rgb); + luminance = 0.3 * currChangeColor.r + 0.59 * currChangeColor.g + 0.11 * currChangeColor.b; + luminance = saturate(luminance + _ColorChangeLuminosity); + half3 dif = abs(currChangeColor - _ColorChangeTarget.rgb); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _ColorChangeNewCol.rgb, + max(sign(1 - saturate(dif.x + dif.y + dif.z) - _ColorChangeTolerance), 0.0)); + #if CHANGECOLOR2_ON + dif = abs(currChangeColor - _ColorChangeTarget2.rgb); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _ColorChangeNewCol2.rgb, + max(sign(1 - saturate(dif.x + dif.y + dif.z) - _ColorChangeTolerance2), 0.0)); + #endif + #if CHANGECOLOR3_ON + dif = abs(currChangeColor - _ColorChangeTarget3.rgb); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _ColorChangeNewCol3.rgb, + max(sign(1 - saturate(dif.x + dif.y + dif.z) - _ColorChangeTolerance3), 0.0)); + #endif + #endif + //------------------------------------------------------- + + //POSTERIZE_ON && !POSTERIZEOUTLINE_ON + #if POSTERIZE_ON && !POSTERIZEOUTLINE_ON + col.rgb = pow(col.rgb, _PosterizeGamma) * _PosterizeNumColors; + col.rgb = floor(col.rgb) / _PosterizeNumColors; + col.rgb = pow(col.rgb, 1.0 / _PosterizeGamma); + #endif + //------------------------------------ + + //HSV_ON + #if HSV_ON + half3 resultHsv = half3(col.rgb); + half cosHsv = _HsvBright * _HsvSaturation * cos(_HsvShift * 3.14159265 / 180); + half sinHsv = _HsvBright * _HsvSaturation * sin(_HsvShift * 3.14159265 / 180); + resultHsv.x = (.299 * _HsvBright + .701 * cosHsv + .168 * sinHsv) * col.x + + (.587 * _HsvBright - .587 * cosHsv + .330 * sinHsv) * col.y + + (.114 * _HsvBright - .114 * cosHsv - .497 * sinHsv) * col.z; + resultHsv.y = (.299 * _HsvBright - .299 * cosHsv - .328 * sinHsv) *col.x + + (.587 * _HsvBright + .413 * cosHsv + .035 * sinHsv) * col.y + + (.114 * _HsvBright - .114 * cosHsv + .292 * sinHsv) * col.z; + resultHsv.z = (.299 * _HsvBright - .3 * cosHsv + 1.25 * sinHsv) * col.x + + (.587 * _HsvBright - .588 * cosHsv - 1.05 * sinHsv) * col.y + + (.114 * _HsvBright + .886 * cosHsv - .203 * sinHsv) * col.z; + col.rgb = resultHsv; + #endif + //------------------------------------------------------- + + //OVERLAY_ON + #if OVERLAY_ON + half2 overlayUvs = d.texcoord0.xy; + overlayUvs.x += ((_Time.y + randomSeed) * _OverlayTextureScrollXSpeed) % 1; + overlayUvs.y += ((_Time.y + randomSeed) * _OverlayTextureScrollYSpeed) % 1; + half4 overlayCol = SAMPLE_TEXTURE2D(_OverlayTex, sampler_OverlayTex, TRANSFORM_TEX(overlayUvs, _OverlayTex)); + overlayCol.rgb *= _OverlayColor.rgb * _OverlayGlow; + #if !OVERLAYMULT_ON + overlayCol.rgb *= overlayCol.a * _OverlayColor.rgb * _OverlayColor.a * _OverlayBlend; + col.rgb += overlayCol.rgb; + #else + overlayCol.a *= _OverlayColor.a; + col = lerp(col, col * overlayCol, _OverlayBlend); + #endif + #endif + + //--------------------------------- + + //OUTBASE_ON + #if OUTBASE_ON + #if OUTBASEPIXELPERF_ON + half2 destUv = half2(_OutlinePixelWidth * _MainTex_TexelSize.x, _OutlinePixelWidth * _MainTex_TexelSize.y); + #else + half2 destUv = half2(_OutlineWidth * _MainTex_TexelSize.x * 200, _OutlineWidth * _MainTex_TexelSize.y * 200); + #endif + + #if OUTDIST_ON + d.texcoord3.x += ((_Time.x + _RandomSeed) * _OutlineDistortTexXSpeed) % 1; + d.texcoord3.y += ((_Time.x + _RandomSeed) * _OutlineDistortTexYSpeed) % 1; + #if ATLAS_ON + d.texcoord3 = half2((d.texcoord3.x - _MinXUV) / (_MaxXUV - _MinXUV), (d.texcoord3.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half outDistortAmnt = (SAMPLE_TEXTURE2D(_OutlineDistortTex, sampler_OutlineDistortTex, d.texcoord3).r - 0.5) * 0.2 * _OutlineDistortAmount; + destUv.x += outDistortAmnt; + destUv.y += outDistortAmnt; + #endif + + half spriteLeft = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(destUv.x, 0)).a; + half spriteRight = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy - half2(destUv.x, 0)).a; + half spriteBottom = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(0, destUv.y)).a; + half spriteTop = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy - half2(0, destUv.y)).a; + half result = spriteLeft + spriteRight + spriteBottom + spriteTop; + + #if OUTBASE8DIR_ON + half spriteTopLeft = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(destUv.x, destUv.y)).a; + half spriteTopRight = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(-destUv.x, destUv.y)).a; + half spriteBotLeft = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(destUv.x, -destUv.y)).a; + half spriteBotRight = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(-destUv.x, -destUv.y)).a; + result = result + spriteTopLeft + spriteTopRight + spriteBotLeft + spriteBotRight; + #endif + + result = step(0.05, saturate(result)); + + #if OUTTEX_ON + d.texcoord1.x += ((_Time.x + _RandomSeed) * _OutlineTexXSpeed) % 1; + d.texcoord1.y += ((_Time.x + _RandomSeed) * _OutlineTexYSpeed) % 1; + #if ATLAS_ON + d.texcoord1 = half2((d.texcoord1.x - _MinXUV) / (_MaxXUV - _MinXUV), (d.texcoord1.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half4 tempOutColor = SAMPLE_TEXTURE2D(_OutlineTex, sampler_OutlineTex, d.texcoord1); + tempOutColor *= _OutlineColor; + _OutlineColor = tempOutColor; + #endif + + result *= (1 - originalAlpha) * _OutlineAlpha; + + half4 outline = _OutlineColor * d.vertexColor.a; + outline.rgb *= _OutlineGlow; + outline.a = result; + #if ONLYOUTLINE_ON + col = outline; + #else + col = lerp(col, outline, result); + #endif + #endif + //------------------------------------------------------- + + //FADE_ON + #if FADE_ON + half2 tiledUvFade1 = TRANSFORM_TEX(d.texcoord0, _FadeTex); + half2 tiledUvFade2 = TRANSFORM_TEX(d.texcoord0, _FadeBurnTex); + #if ATLAS_ON + tiledUvFade1 = half2((tiledUvFade1.x - _MinXUV) / (_MaxXUV - _MinXUV), (tiledUvFade1.y - _MinYUV) / (_MaxYUV - _MinYUV)); + tiledUvFade2 = half2((tiledUvFade2.x - _MinXUV) / (_MaxXUV - _MinXUV), (tiledUvFade2.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half fadeTemp = SAMPLE_TEXTURE2D(_FadeTex, sampler_FadeTex, tiledUvFade1).r; + half fade = smoothstep(_FadeAmount, _FadeAmount + _FadeBurnTransition, fadeTemp); + half fadeBurn = saturate(smoothstep(_FadeAmount - _FadeBurnWidth, _FadeAmount - _FadeBurnWidth + 0.1, fadeTemp) * _FadeAmount); + col.a *= fade; + _FadeBurnColor.rgb *= _FadeBurnGlow; + col += fadeBurn * SAMPLE_TEXTURE2D(_FadeBurnTex, sampler_FadeBurnTex, tiledUvFade2) * _FadeBurnColor * originalAlpha * (1 - col.a); + #endif + //------------------------------------------------------- + + //SHADOW_ON + #if SHADOW_ON + half shadowA = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(_ShadowX, _ShadowY)).a; + half preMultShadowMask = 1 - (saturate(shadowA - col.a) * (1 - col.a)); + col.rgb *= 1 - ((shadowA - col.a) * (1 - col.a)); + col.rgb += (_ShadowColor * shadowA) * (1 - col.a); + col.a = max(shadowA * _ShadowAlpha * d.vertexColor.a, col.a); + #endif + + //------------------------------------------------------- + + //GLOW_ON + #if GLOW_ON + half4 emission; + #if GLOWTEX_ON + emission = SAMPLE_TEXTURE2D(_GlowTex, sampler_GlowTex, d.texcoord0); + #else + emission = col; + #endif + + col.rgb *= _GlowGlobal; + emission.rgb *= emission.a * col.a * _Glow * _GlowColor; + col.rgb += emission.rgb; + #endif + //------------------------------------------------------- + + //COLORRAMP_ON && COLORRAMPOUTLINE_ON + #if COLORRAMP_ON && COLORRAMPOUTLINE_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + luminance = saturate(luminance + _ColorRampLuminosity); + #if GRADIENTCOLORRAMP_ON + col.rgb = lerp(col.rgb, SAMPLE_TEXTURE2D(_ColorRampTexGradient, sampler_ColorRampTexGradient, half2(luminance, 0)).rgb, _ColorRampBlend); + #else + col.rgb = lerp(col.rgb, SAMPLE_TEXTURE2D(_ColorRampTex, sampler_ColorRampTex, half2(luminance, 0)).rgb, _ColorRampBlend); + #endif + #endif + //--------------- + + //GREYSCALE_ON && GREYSCALEOUTLINE_ON + #if GREYSCALE_ON && GREYSCALEOUTLINE_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + luminance = saturate(luminance + _GreyscaleLuminosity); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _GreyscaleTintColor, _GreyscaleBlend); + #endif + + //----------------------------------- + + //POSTERIZE_ON && POSTERIZEOUTLINE_ON + #if POSTERIZE_ON && POSTERIZEOUTLINE_ON + col.rgb = pow(col.rgb, _PosterizeGamma) * _PosterizeNumColors; + col.rgb = floor(col.rgb) / _PosterizeNumColors; + col.rgb = pow(col.rgb, 1.0 / _PosterizeGamma); + #endif + + //----------------------------------- + + //SHINE_ON + #if SHINE_ON + half2 uvShine = uvRect; + half cosAngle = cos(_ShineRotate); + half sinAngle = sin(_ShineRotate); + half2x2 rot = half2x2(cosAngle, -sinAngle, sinAngle, cosAngle); + uvShine -= half2(0.5, 0.5); + uvShine = mul(rot, uvShine); + uvShine += half2(0.5, 0.5); + half shineMask = SAMPLE_TEXTURE2D(_ShineMask, sampler_ShineMask, d.texcoord0.xy).a; + half currentDistanceProjection = (uvShine.x + uvShine.y) / 2; + half whitePower = 1 - (abs(currentDistanceProjection - _ShineLocation) / _ShineWidth); + col.rgb += col.a * whitePower * _ShineGlow * max(sign(currentDistanceProjection - (_ShineLocation - _ShineWidth)), 0.0) + * max(sign((_ShineLocation + _ShineWidth) - currentDistanceProjection), 0.0) * _ShineColor * shineMask; + #endif + + //----------------------------------- + + //HOLOGRAM_ON + #if HOLOGRAM_ON + half totalHologram = _HologramStripesAmount + _HologramUnmodAmount; + half hologramYCoord = ((uvRect.y + (((_Time.x + randomSeed) % 1) * _HologramStripesSpeed)) % totalHologram) / totalHologram; + hologramYCoord = abs(hologramYCoord); + half alpha = RemapFloat(saturate(hologramYCoord - (_HologramUnmodAmount/totalHologram)), 0.0, 1.0, _HologramMinAlpha, saturate(_HologramMaxAlpha)); + half hologramMask = max(sign((_HologramUnmodAmount/totalHologram) - hologramYCoord), 0.0); + half4 hologramResult = col; + hologramResult.a *= lerp(alpha, 1, hologramMask); + hologramResult.rgb *= max(1, _HologramMaxAlpha * max(sign(hologramYCoord - (_HologramUnmodAmount/totalHologram)), 0.0)); + hologramMask = 1 - step(0.01,hologramMask); + hologramResult.rgb += hologramMask * _HologramStripeColor * col.a; + col = lerp(col, hologramResult, _HologramBlend); + #endif + + //----------------------------------- + + //FLICKER_ON + #if FLICKER_ON + col.a *= saturate(col.a * step(frac(0.05 + (_Time.w + randomSeed) * _FlickerFreq), 1 - _FlickerPercent) + _FlickerAlpha); + #endif + //----------------------------------- + + //ALPHACUTOFF_ON + + //ALPHAROUND_ON + + //ALPHAOUTLINE_ON + #if ALPHAOUTLINE_ON + half alphaOutlineRes = pow(1 - col.a, max(_AlphaOutlinePower, 0.0001)) * step(_AlphaOutlineMinAlpha, col.a) * _AlphaOutlineBlend; + col.rgb = lerp(col.rgb, _AlphaOutlineColor.rgb * _AlphaOutlineGlow, alphaOutlineRes); + col.a = lerp(col.a, 1, alphaOutlineRes > 1); + #endif + //------------------------------------------------------- + + //FOG_ON + + //------------------ + + col *= _Color; + o.Albedo = col; + col.a *= _Alpha; + clip(col.a - _AlphaCutoffValue - 0.01); + o.Alpha = _Color.a; + } + + + + + + void ChainSurfaceFunction(inout Surface l, inout ShaderData d) + { + Ext_SurfaceFunction0(l, d); + // Ext_SurfaceFunction1(l, d); + // Ext_SurfaceFunction2(l, d); + // Ext_SurfaceFunction3(l, d); + // Ext_SurfaceFunction4(l, d); + // Ext_SurfaceFunction5(l, d); + // Ext_SurfaceFunction6(l, d); + // Ext_SurfaceFunction7(l, d); + // Ext_SurfaceFunction8(l, d); + // Ext_SurfaceFunction9(l, d); + // Ext_SurfaceFunction10(l, d); + // Ext_SurfaceFunction11(l, d); + // Ext_SurfaceFunction12(l, d); + // Ext_SurfaceFunction13(l, d); + // Ext_SurfaceFunction14(l, d); + // Ext_SurfaceFunction15(l, d); + // Ext_SurfaceFunction16(l, d); + // Ext_SurfaceFunction17(l, d); + // Ext_SurfaceFunction18(l, d); + // Ext_SurfaceFunction19(l, d); + // Ext_SurfaceFunction20(l, d); + // Ext_SurfaceFunction21(l, d); + // Ext_SurfaceFunction22(l, d); + // Ext_SurfaceFunction23(l, d); + // Ext_SurfaceFunction24(l, d); + // Ext_SurfaceFunction25(l, d); + // Ext_SurfaceFunction26(l, d); + // Ext_SurfaceFunction27(l, d); + // Ext_SurfaceFunction28(l, d); + // Ext_SurfaceFunction29(l, d); + } + +#if !_DECALSHADER + + void ChainModifyVertex(inout VertexData v, inout VertexToPixel v2p, float4 time) + { + ExtraV2F d; + + ZERO_INITIALIZE(ExtraV2F, d); + ZERO_INITIALIZE(Blackboard, d.blackboard); + // due to motion vectors in HDRP, we need to use the last + // time in certain spots. So if you are going to use _Time to adjust vertices, + // you need to use this time or motion vectors will break. + d.time = time; + + Ext_ModifyVertex0(v, d); + // Ext_ModifyVertex1(v, d); + // Ext_ModifyVertex2(v, d); + // Ext_ModifyVertex3(v, d); + // Ext_ModifyVertex4(v, d); + // Ext_ModifyVertex5(v, d); + // Ext_ModifyVertex6(v, d); + // Ext_ModifyVertex7(v, d); + // Ext_ModifyVertex8(v, d); + // Ext_ModifyVertex9(v, d); + // Ext_ModifyVertex10(v, d); + // Ext_ModifyVertex11(v, d); + // Ext_ModifyVertex12(v, d); + // Ext_ModifyVertex13(v, d); + // Ext_ModifyVertex14(v, d); + // Ext_ModifyVertex15(v, d); + // Ext_ModifyVertex16(v, d); + // Ext_ModifyVertex17(v, d); + // Ext_ModifyVertex18(v, d); + // Ext_ModifyVertex19(v, d); + // Ext_ModifyVertex20(v, d); + // Ext_ModifyVertex21(v, d); + // Ext_ModifyVertex22(v, d); + // Ext_ModifyVertex23(v, d); + // Ext_ModifyVertex24(v, d); + // Ext_ModifyVertex25(v, d); + // Ext_ModifyVertex26(v, d); + // Ext_ModifyVertex27(v, d); + // Ext_ModifyVertex28(v, d); + // Ext_ModifyVertex29(v, d); + + + // #if %EXTRAV2F0REQUIREKEY% + // v2p.extraV2F0 = d.extraV2F0; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // v2p.extraV2F1 = d.extraV2F1; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // v2p.extraV2F2 = d.extraV2F2; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // v2p.extraV2F3 = d.extraV2F3; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // v2p.extraV2F4 = d.extraV2F4; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // v2p.extraV2F5 = d.extraV2F5; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // v2p.extraV2F6 = d.extraV2F6; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // v2p.extraV2F7 = d.extraV2F7; + // #endif + } + + void ChainModifyTessellatedVertex(inout VertexData v, inout VertexToPixel v2p) + { + ExtraV2F d; + ZERO_INITIALIZE(ExtraV2F, d); + ZERO_INITIALIZE(Blackboard, d.blackboard); + + // #if %EXTRAV2F0REQUIREKEY% + // d.extraV2F0 = v2p.extraV2F0; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // d.extraV2F1 = v2p.extraV2F1; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // d.extraV2F2 = v2p.extraV2F2; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // d.extraV2F3 = v2p.extraV2F3; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // d.extraV2F4 = v2p.extraV2F4; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // d.extraV2F5 = v2p.extraV2F5; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // d.extraV2F6 = v2p.extraV2F6; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // d.extraV2F7 = v2p.extraV2F7; + // #endif + + + // Ext_ModifyTessellatedVertex0(v, d); + // Ext_ModifyTessellatedVertex1(v, d); + // Ext_ModifyTessellatedVertex2(v, d); + // Ext_ModifyTessellatedVertex3(v, d); + // Ext_ModifyTessellatedVertex4(v, d); + // Ext_ModifyTessellatedVertex5(v, d); + // Ext_ModifyTessellatedVertex6(v, d); + // Ext_ModifyTessellatedVertex7(v, d); + // Ext_ModifyTessellatedVertex8(v, d); + // Ext_ModifyTessellatedVertex9(v, d); + // Ext_ModifyTessellatedVertex10(v, d); + // Ext_ModifyTessellatedVertex11(v, d); + // Ext_ModifyTessellatedVertex12(v, d); + // Ext_ModifyTessellatedVertex13(v, d); + // Ext_ModifyTessellatedVertex14(v, d); + // Ext_ModifyTessellatedVertex15(v, d); + // Ext_ModifyTessellatedVertex16(v, d); + // Ext_ModifyTessellatedVertex17(v, d); + // Ext_ModifyTessellatedVertex18(v, d); + // Ext_ModifyTessellatedVertex19(v, d); + // Ext_ModifyTessellatedVertex20(v, d); + // Ext_ModifyTessellatedVertex21(v, d); + // Ext_ModifyTessellatedVertex22(v, d); + // Ext_ModifyTessellatedVertex23(v, d); + // Ext_ModifyTessellatedVertex24(v, d); + // Ext_ModifyTessellatedVertex25(v, d); + // Ext_ModifyTessellatedVertex26(v, d); + // Ext_ModifyTessellatedVertex27(v, d); + // Ext_ModifyTessellatedVertex28(v, d); + // Ext_ModifyTessellatedVertex29(v, d); + + // #if %EXTRAV2F0REQUIREKEY% + // v2p.extraV2F0 = d.extraV2F0; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // v2p.extraV2F1 = d.extraV2F1; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // v2p.extraV2F2 = d.extraV2F2; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // v2p.extraV2F3 = d.extraV2F3; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // v2p.extraV2F4 = d.extraV2F4; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // v2p.extraV2F5 = d.extraV2F5; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // v2p.extraV2F6 = d.extraV2F6; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // v2p.extraV2F7 = d.extraV2F7; + // #endif + } + + void ChainFinalColorForward(inout Surface l, inout ShaderData d, inout half4 color) + { + // Ext_FinalColorForward0(l, d, color); + // Ext_FinalColorForward1(l, d, color); + // Ext_FinalColorForward2(l, d, color); + // Ext_FinalColorForward3(l, d, color); + // Ext_FinalColorForward4(l, d, color); + // Ext_FinalColorForward5(l, d, color); + // Ext_FinalColorForward6(l, d, color); + // Ext_FinalColorForward7(l, d, color); + // Ext_FinalColorForward8(l, d, color); + // Ext_FinalColorForward9(l, d, color); + // Ext_FinalColorForward10(l, d, color); + // Ext_FinalColorForward11(l, d, color); + // Ext_FinalColorForward12(l, d, color); + // Ext_FinalColorForward13(l, d, color); + // Ext_FinalColorForward14(l, d, color); + // Ext_FinalColorForward15(l, d, color); + // Ext_FinalColorForward16(l, d, color); + // Ext_FinalColorForward17(l, d, color); + // Ext_FinalColorForward18(l, d, color); + // Ext_FinalColorForward19(l, d, color); + // Ext_FinalColorForward20(l, d, color); + // Ext_FinalColorForward21(l, d, color); + // Ext_FinalColorForward22(l, d, color); + // Ext_FinalColorForward23(l, d, color); + // Ext_FinalColorForward24(l, d, color); + // Ext_FinalColorForward25(l, d, color); + // Ext_FinalColorForward26(l, d, color); + // Ext_FinalColorForward27(l, d, color); + // Ext_FinalColorForward28(l, d, color); + // Ext_FinalColorForward29(l, d, color); + } + + void ChainFinalGBufferStandard(inout Surface s, inout ShaderData d, inout half4 GBuffer0, inout half4 GBuffer1, inout half4 GBuffer2, inout half4 outEmission, inout half4 outShadowMask) + { + // Ext_FinalGBufferStandard0(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard1(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard2(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard3(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard4(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard5(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard6(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard7(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard8(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard9(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard10(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard11(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard12(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard13(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard14(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard15(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard16(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard17(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard18(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard19(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard20(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard21(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard22(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard23(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard24(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard25(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard26(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard27(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard28(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard29(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + } +#endif + + + + + +#if _DECALSHADER + + ShaderData CreateShaderData(SurfaceDescriptionInputs IN) + { + ShaderData d = (ShaderData)0; + d.TBNMatrix = float3x3(IN.WorldSpaceTangent, IN.WorldSpaceBiTangent, IN.WorldSpaceNormal); + d.worldSpaceNormal = IN.WorldSpaceNormal; + d.worldSpaceTangent = IN.WorldSpaceTangent; + + d.worldSpacePosition = IN.WorldSpacePosition; + d.texcoord0 = IN.uv0.xyxy; + d.screenPos = IN.ScreenPosition; + + d.worldSpaceViewDir = normalize(_WorldSpaceCameraPos - d.worldSpacePosition); + + d.tangentSpaceViewDir = mul(d.TBNMatrix, d.worldSpaceViewDir); + + // these rarely get used, so we back transform them. Usually will be stripped. + #if _HDRP + // d.localSpacePosition = mul(GetWorldToObjectMatrix(), float4(GetCameraRelativePositionWS(d.worldSpacePosition), 1)).xyz; + #else + // d.localSpacePosition = mul(GetWorldToObjectMatrix(), float4(d.worldSpacePosition, 1)).xyz; + #endif + // d.localSpaceNormal = normalize(mul((float3x3)GetWorldToObjectMatrix(), d.worldSpaceNormal)); + // d.localSpaceTangent = normalize(mul((float3x3)GetWorldToObjectMatrix(), d.worldSpaceTangent.xyz)); + + // #if %SCREENPOSREQUIREKEY% + // d.screenUV = (IN.ScreenPosition.xy / max(0.01, IN.ScreenPosition.w)); + // #endif + + return d; + } +#else + + ShaderData CreateShaderData(VertexToPixel i + #if NEED_FACING + , bool facing + #endif + ) + { + ShaderData d = (ShaderData)0; + d.clipPos = i.pos; + d.worldSpacePosition = i.worldPos; + + d.worldSpaceNormal = normalize(i.worldNormal); + d.worldSpaceTangent.xyz = normalize(i.worldTangent.xyz); + + d.tangentSign = i.worldTangent.w * unity_WorldTransformParams.w; + float3 bitangent = cross(d.worldSpaceTangent.xyz, d.worldSpaceNormal) * d.tangentSign; + + d.TBNMatrix = float3x3(d.worldSpaceTangent, -bitangent, d.worldSpaceNormal); + d.worldSpaceViewDir = normalize(_WorldSpaceCameraPos - i.worldPos); + + d.tangentSpaceViewDir = mul(d.TBNMatrix, d.worldSpaceViewDir); + d.texcoord0 = i.texcoord0; + d.texcoord1 = i.texcoord1; + d.texcoord2 = i.texcoord2; + + // #if %TEXCOORD3REQUIREKEY% + d.texcoord3 = i.texcoord3; + // #endif + + // d.isFrontFace = facing; + // #if %VERTEXCOLORREQUIREKEY% + d.vertexColor = i.vertexColor; + // #endif + + // these rarely get used, so we back transform them. Usually will be stripped. + #if _HDRP + // d.localSpacePosition = mul(GetWorldToObjectMatrix(), float4(GetCameraRelativePositionWS(i.worldPos), 1)).xyz; + #else + // d.localSpacePosition = mul(GetWorldToObjectMatrix(), float4(i.worldPos, 1)).xyz; + #endif + // d.localSpaceNormal = normalize(mul((float3x3)GetWorldToObjectMatrix(), i.worldNormal)); + // d.localSpaceTangent = normalize(mul((float3x3)GetWorldToObjectMatrix(), i.worldTangent.xyz)); + + // #if %SCREENPOSREQUIREKEY% + // d.screenPos = i.screenPos; + // d.screenUV = (i.screenPos.xy / i.screenPos.w); + // #endif + + + // #if %EXTRAV2F0REQUIREKEY% + // d.extraV2F0 = i.extraV2F0; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // d.extraV2F1 = i.extraV2F1; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // d.extraV2F2 = i.extraV2F2; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // d.extraV2F3 = i.extraV2F3; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // d.extraV2F4 = i.extraV2F4; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // d.extraV2F5 = i.extraV2F5; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // d.extraV2F6 = i.extraV2F6; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // d.extraV2F7 = i.extraV2F7; + // #endif + + return d; + } + +#endif + + // vertex shader + VertexToPixel Vert (VertexData v) + { + UNITY_SETUP_INSTANCE_ID(v); + VertexToPixel o; + UNITY_INITIALIZE_OUTPUT(VertexToPixel,o); + UNITY_TRANSFER_INSTANCE_ID(v,o); + UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o); + +#if !_TESSELLATION_ON + ChainModifyVertex(v, o, _Time); +#endif + + o.pos = UnityObjectToClipPos(v.vertex); + o.texcoord0 = v.texcoord0; + o.texcoord1 = v.texcoord1; + o.texcoord2 = v.texcoord2; + + // #if %TEXCOORD3REQUIREKEY% + o.texcoord3 = v.texcoord3; + // #endif + + // #if %VERTEXCOLORREQUIREKEY% + o.vertexColor = v.vertexColor; + // #endif + + // #if %SCREENPOSREQUIREKEY% + // o.screenPos = ComputeScreenPos(o.pos); + // #endif + + o.worldPos = mul(GetObjectToWorldMatrix(), v.vertex).xyz; + o.worldNormal = UnityObjectToWorldNormal(v.normal); + o.worldTangent = float4(UnityObjectToWorldDir(v.tangent.xyz), v.tangent.w); + + + UNITY_TRANSFER_LIGHTING(o, v.texcoord1.xy); // pass shadow and, possibly, light cookie coordinates to pixel shader + UNITY_TRANSFER_FOG(o,o.pos); // pass fog coordinates to pixel shader + + return o; + } + + + + // fragment shader + fixed4 Frag (VertexToPixel IN + #ifdef _DEPTHOFFSET_ON + , out float outputDepth : SV_Depth + #endif + #if NEED_FACING + , bool facing : SV_IsFrontFace + #endif + ) : SV_Target + { + UNITY_SETUP_INSTANCE_ID(IN); + // prepare and unpack data + + #ifdef FOG_COMBINED_WITH_TSPACE + UNITY_EXTRACT_FOG_FROM_TSPACE(IN); + #elif defined FOG_COMBINED_WITH_WORLD_POS + UNITY_EXTRACT_FOG_FROM_WORLD_POS(IN); + #else + UNITY_EXTRACT_FOG(IN); + #endif + + + + ShaderData d = CreateShaderData(IN + #if NEED_FACING + , facing + #endif + ); + Surface l = (Surface)0; + + + #ifdef _DEPTHOFFSET_ON + l.outputDepth = outputDepth; + #endif + + l.Albedo = half3(0.5, 0.5, 0.5); + l.Normal = float3(0,0,1); + l.Occlusion = 1; + l.Alpha = 1; + + ChainSurfaceFunction(l, d); + + #ifdef _DEPTHOFFSET_ON + outputDepth = l.outputDepth; + #endif + + + #ifndef USING_DIRECTIONAL_LIGHT + fixed3 lightDir = normalize(UnityWorldSpaceLightDir(d.worldSpacePosition)); + #else + fixed3 lightDir = _WorldSpaceLightPos0.xyz; + #endif + float3 worldViewDir = normalize(UnityWorldSpaceViewDir(d.worldSpacePosition)); + + #if _USESPECULAR || _USESPECULARWORKFLOW || _SPECULARFROMMETALLIC + #ifdef UNITY_COMPILER_HLSL + SurfaceOutputStandardSpecular o = (SurfaceOutputStandardSpecular)0; + #else + SurfaceOutputStandardSpecular o; + #endif + o.Specular = l.Specular; + o.Occlusion = l.Occlusion; + o.Smoothness = l.Smoothness; + #elif _BDRFLAMBERT || _BDRF3 || _SIMPLELIT + #ifdef UNITY_COMPILER_HLSL + SurfaceOutput o = (SurfaceOutput)0; + #else + SurfaceOutput o; + #endif + + o.Specular = l.SpecularPower; + o.Gloss = l.Smoothness; + _SpecColor.rgb = l.Specular; // fucking hell Unity, wtf.. + #else + #ifdef UNITY_COMPILER_HLSL + SurfaceOutputStandard o = (SurfaceOutputStandard)0; + #else + SurfaceOutputStandard o; + #endif + o.Smoothness = l.Smoothness; + o.Metallic = l.Metallic; + o.Occlusion = l.Occlusion; + #endif + + + o.Albedo = l.Albedo; + o.Emission = l.Emission; + o.Alpha = l.Alpha; + + #if _WORLDSPACENORMAL + o.Normal = l.Normal; + #else + o.Normal = normalize(TangentToWorldSpace(d, l.Normal)); + #endif + + + + UNITY_LIGHT_ATTENUATION(atten, IN, d.worldSpacePosition) + half4 c = 0; + + // Setup lighting environment + UnityGI gi; + UNITY_INITIALIZE_OUTPUT(UnityGI, gi); + gi.indirect.diffuse = 0; + gi.indirect.specular = 0; + gi.light.color = _LightColor0.rgb; + gi.light.dir = lightDir; + gi.light.color *= atten; + + #if defined(_OVERRIDE_SHADOWMASK) + float4 mulColor = saturate(dot(l.ShadowMask, unity_OcclusionMaskSelector)); + gi.light.color *= mulColor; + #endif + + #if _USESPECULAR + c += LightingStandardSpecular (o, worldViewDir, gi); + #elif _BDRF3 || _SIMPLELIT + c += LightingBlinnPhong (o, d.worldSpaceViewDir, gi); + #else + c += LightingStandard (o, worldViewDir, gi); + #endif + + + ChainFinalColorForward(l, d, c); + + #if !DISABLEFOG + UNITY_APPLY_FOG(_unity_fogCoord, c); // apply fog + #endif + #if !_ALPHABLEND_ON + UNITY_OPAQUE_ALPHA(c.a); + #endif + + return c; + } + + ENDCG + + } + + + Pass { + Name "ShadowCaster" + Tags { "LightMode" = "ShadowCaster" } + ZWrite On ZTest LEqual + + Tags { "RenderType" = "Opaque" "Queue" = "Geometry" "PreviewType" = "Plane" } + Cull [_CullingOption] + ZWrite [_ZWrite] + ZTest [_ZTestMode] + + + CGPROGRAM + + #pragma vertex Vert + #pragma fragment Frag + // compile directives + #pragma target 3.0 + #pragma multi_compile_instancing + #pragma skip_variants FOG_LINEAR FOG_EXP FOG_EXP2 + #pragma multi_compile_shadowcaster + #include "HLSLSupport.cginc" + #define UNITY_INSTANCED_LOD_FADE + #define UNITY_INSTANCED_SH + #define UNITY_INSTANCED_LIGHTMAPSTS + #include "UnityShaderVariables.cginc" + #include "UnityShaderUtilities.cginc" + + #include "UnityCG.cginc" + #include "Lighting.cginc" + #include "UnityPBSLighting.cginc" + + #define _PASSSHADOW 1 + + + #pragma shader_feature_local GLOW_ON + #pragma shader_feature_local FADE_ON + #pragma shader_feature_local OUTBASE_ON + #pragma shader_feature_local ONLYOUTLINE_ON + #pragma shader_feature_local GRADIENT_ON + #pragma shader_feature_local GRADIENT2COL_ON + #pragma shader_feature_local RADIALGRADIENT_ON + #pragma shader_feature_local COLORSWAP_ON + #pragma shader_feature_local HSV_ON + #pragma shader_feature_local CHANGECOLOR_ON + #pragma shader_feature_local CHANGECOLOR2_ON + #pragma shader_feature_local CHANGECOLOR3_ON + #pragma shader_feature_local COLORRAMP_ON + #pragma shader_feature_local GRADIENTCOLORRAMP_ON + #pragma shader_feature_local HITEFFECT_ON + #pragma shader_feature_local NEGATIVE_ON + #pragma shader_feature_local PIXELATE_ON + #pragma shader_feature_local GREYSCALE_ON + #pragma shader_feature_local POSTERIZE_ON + #pragma shader_feature_local BLUR_ON + #pragma shader_feature_local MOTIONBLUR_ON + #pragma shader_feature_local GHOST_ON + #pragma shader_feature_local ALPHAOUTLINE_ON + #pragma shader_feature_local INNEROUTLINE_ON + #pragma shader_feature_local ONLYINNEROUTLINE_ON + #pragma shader_feature_local HOLOGRAM_ON + #pragma shader_feature_local CHROMABERR_ON + #pragma shader_feature_local GLITCH_ON + #pragma shader_feature_local FLICKER_ON + #pragma shader_feature_local SHADOW_ON + #pragma shader_feature_local SHINE_ON + #pragma shader_feature_local CONTRAST_ON + #pragma shader_feature_local OVERLAY_ON + #pragma shader_feature_local OVERLAYMULT_ON + #pragma shader_feature_local DOODLE_ON + #pragma shader_feature_local WIND_ON + #pragma shader_feature_local WAVEUV_ON + #pragma shader_feature_local ROUNDWAVEUV_ON + #pragma shader_feature_local RECTSIZE_ON + #pragma shader_feature_local OFFSETUV_ON + #pragma shader_feature_local CLIPPING_ON + #pragma shader_feature_local RADIALCLIPPING_ON + #pragma shader_feature_local TEXTURESCROLL_ON + #pragma shader_feature_local ZOOMUV_ON + #pragma shader_feature_local DISTORT_ON + #pragma shader_feature_local WARP_ON + #pragma shader_feature_local TWISTUV_ON + #pragma shader_feature_local ROTATEUV_ON + #pragma shader_feature_local POLARUV_ON + #pragma shader_feature_local FISHEYE_ON + #pragma shader_feature_local PINCH_ON + #pragma shader_feature_local SHAKEUV_ON + + #pragma shader_feature_local GLOWTEX_ON + #pragma shader_feature_local OUTTEX_ON + #pragma shader_feature_local OUTDIST_ON + #pragma shader_feature_local OUTBASE8DIR_ON + #pragma shader_feature_local OUTBASEPIXELPERF_ON + #pragma shader_feature_local COLORRAMPOUTLINE_ON + #pragma shader_feature_local GREYSCALEOUTLINE_ON + #pragma shader_feature_local POSTERIZEOUTLINE_ON + #pragma shader_feature_local BLURISHD_ON + #pragma shader_feature_local MANUALWIND_ON + #pragma shader_feature_local ATLAS_ON + #pragma shader_feature_local PREMULTIPLYALPHA_ON + + #pragma shader_feature BILBOARD_ON + #pragma shader_feature BILBOARDY_ON + + #pragma shader_feature NORMALMAP_ON + + + #define _STANDARD 1 +// If your looking in here and thinking WTF, yeah, I know. These are taken from the SRPs, to allow us to use the same +// texturing library they use. However, since they are not included in the standard pipeline by default, there is no +// way to include them in and they have to be inlined, since someone could copy this shader onto another machine without +// Better Shaders installed. Unfortunate, but I'd rather do this and have a nice library for texture sampling instead +// of the patchy one Unity provides being inlined/emulated in HDRP/URP. Strangely, PSSL and XBoxOne libraries are not +// included in the standard SRP code, but they are in tons of Unity own projects on the web, so I grabbed them from there. + +#if defined(SHADER_API_GAMECORE) + + #define ZERO_INITIALIZE(type, name) name = (type)0; + #define ZERO_INITIALIZE_ARRAY(type, name, arraySize) { for (int arrayIndex = 0; arrayIndex < arraySize; arrayIndex++) { name[arrayIndex] = (type)0; } } + + // Texture util abstraction + + #define CALCULATE_TEXTURE2D_LOD(textureName, samplerName, coord2) textureName.CalculateLevelOfDetail(samplerName, coord2) + + // Texture abstraction + + #define TEXTURE2D(textureName) Texture2D textureName + #define TEXTURE2D_ARRAY(textureName) Texture2DArray textureName + #define TEXTURECUBE(textureName) TextureCube textureName + #define TEXTURECUBE_ARRAY(textureName) TextureCubeArray textureName + #define TEXTURE3D(textureName) Texture3D textureName + + #define TEXTURE2D_FLOAT(textureName) TEXTURE2D(textureName) + #define TEXTURE2D_ARRAY_FLOAT(textureName) TEXTURE2D_ARRAY(textureName) + #define TEXTURECUBE_FLOAT(textureName) TEXTURECUBE(textureName) + #define TEXTURECUBE_ARRAY_FLOAT(textureName) TEXTURECUBE_ARRAY(textureName) + #define TEXTURE3D_FLOAT(textureName) TEXTURE3D(textureName) + + #define TEXTURE2D_HALF(textureName) TEXTURE2D(textureName) + #define TEXTURE2D_ARRAY_HALF(textureName) TEXTURE2D_ARRAY(textureName) + #define TEXTURECUBE_HALF(textureName) TEXTURECUBE(textureName) + #define TEXTURECUBE_ARRAY_HALF(textureName) TEXTURECUBE_ARRAY(textureName) + #define TEXTURE3D_HALF(textureName) TEXTURE3D(textureName) + + #define TEXTURE2D_SHADOW(textureName) TEXTURE2D(textureName) + #define TEXTURE2D_ARRAY_SHADOW(textureName) TEXTURE2D_ARRAY(textureName) + #define TEXTURECUBE_SHADOW(textureName) TEXTURECUBE(textureName) + #define TEXTURECUBE_ARRAY_SHADOW(textureName) TEXTURECUBE_ARRAY(textureName) + + #define RW_TEXTURE2D(type, textureName) RWTexture2D textureName + #define RW_TEXTURE2D_ARRAY(type, textureName) RWTexture2DArray textureName + #define RW_TEXTURE3D(type, textureName) RWTexture3D textureName + + #define SAMPLER(samplerName) SamplerState samplerName + #define SAMPLER_CMP(samplerName) SamplerComparisonState samplerName + #define ASSIGN_SAMPLER(samplerName, samplerValue) samplerName = samplerValue + + #define TEXTURE2D_PARAM(textureName, samplerName) TEXTURE2D(textureName), SAMPLER(samplerName) + #define TEXTURE2D_ARRAY_PARAM(textureName, samplerName) TEXTURE2D_ARRAY(textureName), SAMPLER(samplerName) + #define TEXTURECUBE_PARAM(textureName, samplerName) TEXTURECUBE(textureName), SAMPLER(samplerName) + #define TEXTURECUBE_ARRAY_PARAM(textureName, samplerName) TEXTURECUBE_ARRAY(textureName), SAMPLER(samplerName) + #define TEXTURE3D_PARAM(textureName, samplerName) TEXTURE3D(textureName), SAMPLER(samplerName) + + #define TEXTURE2D_SHADOW_PARAM(textureName, samplerName) TEXTURE2D(textureName), SAMPLER_CMP(samplerName) + #define TEXTURE2D_ARRAY_SHADOW_PARAM(textureName, samplerName) TEXTURE2D_ARRAY(textureName), SAMPLER_CMP(samplerName) + #define TEXTURECUBE_SHADOW_PARAM(textureName, samplerName) TEXTURECUBE(textureName), SAMPLER_CMP(samplerName) + #define TEXTURECUBE_ARRAY_SHADOW_PARAM(textureName, samplerName) TEXTURECUBE_ARRAY(textureName), SAMPLER_CMP(samplerName) + + #define TEXTURE2D_ARGS(textureName, samplerName) textureName, samplerName + #define TEXTURE2D_ARRAY_ARGS(textureName, samplerName) textureName, samplerName + #define TEXTURECUBE_ARGS(textureName, samplerName) textureName, samplerName + #define TEXTURECUBE_ARRAY_ARGS(textureName, samplerName) textureName, samplerName + #define TEXTURE3D_ARGS(textureName, samplerName) textureName, samplerName + + #define TEXTURE2D_SHADOW_ARGS(textureName, samplerName) textureName, samplerName + #define TEXTURE2D_ARRAY_SHADOW_ARGS(textureName, samplerName) textureName, samplerName + #define TEXTURECUBE_SHADOW_ARGS(textureName, samplerName) textureName, samplerName + #define TEXTURECUBE_ARRAY_SHADOW_ARGS(textureName, samplerName) textureName, samplerName + + #define PLATFORM_SAMPLE_TEXTURE2D(textureName, samplerName, coord2) textureName.Sample(samplerName, coord2) + #define PLATFORM_SAMPLE_TEXTURE2D_LOD(textureName, samplerName, coord2, lod) textureName.SampleLevel(samplerName, coord2, lod) + #define PLATFORM_SAMPLE_TEXTURE2D_BIAS(textureName, samplerName, coord2, bias) textureName.SampleBias(samplerName, coord2, bias) + #define PLATFORM_SAMPLE_TEXTURE2D_GRAD(textureName, samplerName, coord2, dpdx, dpdy) textureName.SampleGrad(samplerName, coord2, dpdx, dpdy) + #define PLATFORM_SAMPLE_TEXTURE2D_ARRAY(textureName, samplerName, coord2, index) textureName.Sample(samplerName, float3(coord2, index)) + #define PLATFORM_SAMPLE_TEXTURE2D_ARRAY_LOD(textureName, samplerName, coord2, index, lod) textureName.SampleLevel(samplerName, float3(coord2, index), lod) + #define PLATFORM_SAMPLE_TEXTURE2D_ARRAY_BIAS(textureName, samplerName, coord2, index, bias) textureName.SampleBias(samplerName, float3(coord2, index), bias) + #define PLATFORM_SAMPLE_TEXTURE2D_ARRAY_GRAD(textureName, samplerName, coord2, index, dpdx, dpdy) textureName.SampleGrad(samplerName, float3(coord2, index), dpdx, dpdy) + #define PLATFORM_SAMPLE_TEXTURECUBE(textureName, samplerName, coord3) textureName.Sample(samplerName, coord3) + #define PLATFORM_SAMPLE_TEXTURECUBE_LOD(textureName, samplerName, coord3, lod) textureName.SampleLevel(samplerName, coord3, lod) + #define PLATFORM_SAMPLE_TEXTURECUBE_BIAS(textureName, samplerName, coord3, bias) textureName.SampleBias(samplerName, coord3, bias) + #define PLATFORM_SAMPLE_TEXTURECUBE_ARRAY(textureName, samplerName, coord3, index) textureName.Sample(samplerName, float4(coord3, index)) + #define PLATFORM_SAMPLE_TEXTURECUBE_ARRAY_LOD(textureName, samplerName, coord3, index, lod) textureName.SampleLevel(samplerName, float4(coord3, index), lod) + #define PLATFORM_SAMPLE_TEXTURECUBE_ARRAY_BIAS(textureName, samplerName, coord3, index, bias) textureName.SampleBias(samplerName, float4(coord3, index), bias) + #define PLATFORM_SAMPLE_TEXTURE3D(textureName, samplerName, coord3) textureName.Sample(samplerName, coord3) + #define PLATFORM_SAMPLE_TEXTURE3D_LOD(textureName, samplerName, coord3, lod) textureName.SampleLevel(samplerName, coord3, lod) + + #define SAMPLE_TEXTURE2D(textureName, samplerName, coord2) PLATFORM_SAMPLE_TEXTURE2D(textureName, samplerName, coord2) + #define SAMPLE_TEXTURE2D_LOD(textureName, samplerName, coord2, lod) PLATFORM_SAMPLE_TEXTURE2D_LOD(textureName, samplerName, coord2, lod) + #define SAMPLE_TEXTURE2D_BIAS(textureName, samplerName, coord2, bias) PLATFORM_SAMPLE_TEXTURE2D_BIAS(textureName, samplerName, coord2, bias) + #define SAMPLE_TEXTURE2D_GRAD(textureName, samplerName, coord2, dpdx, dpdy) PLATFORM_SAMPLE_TEXTURE2D_GRAD(textureName, samplerName, coord2, dpdx, dpdy) + #define SAMPLE_TEXTURE2D_ARRAY(textureName, samplerName, coord2, index) PLATFORM_SAMPLE_TEXTURE2D_ARRAY(textureName, samplerName, coord2, index) + #define SAMPLE_TEXTURE2D_ARRAY_LOD(textureName, samplerName, coord2, index, lod) PLATFORM_SAMPLE_TEXTURE2D_ARRAY_LOD(textureName, samplerName, coord2, index, lod) + #define SAMPLE_TEXTURE2D_ARRAY_BIAS(textureName, samplerName, coord2, index, bias) PLATFORM_SAMPLE_TEXTURE2D_ARRAY_BIAS(textureName, samplerName, coord2, index, bias) + #define SAMPLE_TEXTURE2D_ARRAY_GRAD(textureName, samplerName, coord2, index, dpdx, dpdy) PLATFORM_SAMPLE_TEXTURE2D_ARRAY_GRAD(textureName, samplerName, coord2, index, dpdx, dpdy) + #define SAMPLE_TEXTURECUBE(textureName, samplerName, coord3) PLATFORM_SAMPLE_TEXTURECUBE(textureName, samplerName, coord3) + #define SAMPLE_TEXTURECUBE_LOD(textureName, samplerName, coord3, lod) PLATFORM_SAMPLE_TEXTURECUBE_LOD(textureName, samplerName, coord3, lod) + #define SAMPLE_TEXTURECUBE_BIAS(textureName, samplerName, coord3, bias) PLATFORM_SAMPLE_TEXTURECUBE_BIAS(textureName, samplerName, coord3, bias) + #define SAMPLE_TEXTURECUBE_ARRAY(textureName, samplerName, coord3, index) PLATFORM_SAMPLE_TEXTURECUBE_ARRAY(textureName, samplerName, coord3, index) + #define SAMPLE_TEXTURECUBE_ARRAY_LOD(textureName, samplerName, coord3, index, lod) PLATFORM_SAMPLE_TEXTURECUBE_ARRAY_LOD(textureName, samplerName, coord3, index, lod) + #define SAMPLE_TEXTURECUBE_ARRAY_BIAS(textureName, samplerName, coord3, index, bias) PLATFORM_SAMPLE_TEXTURECUBE_ARRAY_BIAS(textureName, samplerName, coord3, index, bias) + #define SAMPLE_TEXTURE3D(textureName, samplerName, coord3) PLATFORM_SAMPLE_TEXTURE3D(textureName, samplerName, coord3) + #define SAMPLE_TEXTURE3D_LOD(textureName, samplerName, coord3, lod) PLATFORM_SAMPLE_TEXTURE3D_LOD(textureName, samplerName, coord3, lod) + + #define SAMPLE_TEXTURE2D_SHADOW(textureName, samplerName, coord3) textureName.SampleCmpLevelZero(samplerName, (coord3).xy, (coord3).z) + #define SAMPLE_TEXTURE2D_ARRAY_SHADOW(textureName, samplerName, coord3, index) textureName.SampleCmpLevelZero(samplerName, float3((coord3).xy, index), (coord3).z) + #define SAMPLE_TEXTURECUBE_SHADOW(textureName, samplerName, coord4) textureName.SampleCmpLevelZero(samplerName, (coord4).xyz, (coord4).w) + #define SAMPLE_TEXTURECUBE_ARRAY_SHADOW(textureName, samplerName, coord4, index) textureName.SampleCmpLevelZero(samplerName, float4((coord4).xyz, index), (coord4).w) + + #define SAMPLE_DEPTH_TEXTURE(textureName, samplerName, coord2) SAMPLE_TEXTURE2D(textureName, samplerName, coord2).r + #define SAMPLE_DEPTH_TEXTURE_LOD(textureName, samplerName, coord2, lod) SAMPLE_TEXTURE2D_LOD(textureName, samplerName, coord2, lod).r + + #define LOAD_TEXTURE2D(textureName, unCoord2) textureName.Load(int3(unCoord2, 0)) + #define LOAD_TEXTURE2D_LOD(textureName, unCoord2, lod) textureName.Load(int3(unCoord2, lod)) + #define LOAD_TEXTURE2D_MSAA(textureName, unCoord2, sampleIndex) textureName.Load(unCoord2, sampleIndex) + #define LOAD_TEXTURE2D_ARRAY(textureName, unCoord2, index) textureName.Load(int4(unCoord2, index, 0)) + #define LOAD_TEXTURE2D_ARRAY_MSAA(textureName, unCoord2, index, sampleIndex) textureName.Load(int3(unCoord2, index), sampleIndex) + #define LOAD_TEXTURE2D_ARRAY_LOD(textureName, unCoord2, index, lod) textureName.Load(int4(unCoord2, index, lod)) + #define LOAD_TEXTURE3D(textureName, unCoord3) textureName.Load(int4(unCoord3, 0)) + #define LOAD_TEXTURE3D_LOD(textureName, unCoord3, lod) textureName.Load(int4(unCoord3, lod)) + + #define PLATFORM_SUPPORT_GATHER + #define GATHER_TEXTURE2D(textureName, samplerName, coord2) textureName.Gather(samplerName, coord2) + #define GATHER_TEXTURE2D_ARRAY(textureName, samplerName, coord2, index) textureName.Gather(samplerName, float3(coord2, index)) + #define GATHER_TEXTURECUBE(textureName, samplerName, coord3) textureName.Gather(samplerName, coord3) + #define GATHER_TEXTURECUBE_ARRAY(textureName, samplerName, coord3, index) textureName.Gather(samplerName, float4(coord3, index)) + #define GATHER_RED_TEXTURE2D(textureName, samplerName, coord2) textureName.GatherRed(samplerName, coord2) + #define GATHER_GREEN_TEXTURE2D(textureName, samplerName, coord2) textureName.GatherGreen(samplerName, coord2) + #define GATHER_BLUE_TEXTURE2D(textureName, samplerName, coord2) textureName.GatherBlue(samplerName, coord2) + #define GATHER_ALPHA_TEXTURE2D(textureName, samplerName, coord2) textureName.GatherAlpha(samplerName, coord2) + + +#elif defined(SHADER_API_XBOXONE) + + // Initialize arbitrary structure with zero values. + // Do not exist on some platform, in this case we need to have a standard name that call a function that will initialize all parameters to 0 + #define ZERO_INITIALIZE(type, name) name = (type)0; + #define ZERO_INITIALIZE_ARRAY(type, name, arraySize) { for (int arrayIndex = 0; arrayIndex < arraySize; arrayIndex++) { name[arrayIndex] = (type)0; } } + + // Texture util abstraction + + #define CALCULATE_TEXTURE2D_LOD(textureName, samplerName, coord2) textureName.CalculateLevelOfDetail(samplerName, coord2) + + // Texture abstraction + + #define TEXTURE2D(textureName) Texture2D textureName + #define TEXTURE2D_ARRAY(textureName) Texture2DArray textureName + #define TEXTURECUBE(textureName) TextureCube textureName + #define TEXTURECUBE_ARRAY(textureName) TextureCubeArray textureName + #define TEXTURE3D(textureName) Texture3D textureName + + #define TEXTURE2D_FLOAT(textureName) TEXTURE2D(textureName) + #define TEXTURE2D_ARRAY_FLOAT(textureName) TEXTURE2D_ARRAY(textureName) + #define TEXTURECUBE_FLOAT(textureName) TEXTURECUBE(textureName) + #define TEXTURECUBE_ARRAY_FLOAT(textureName) TEXTURECUBE_ARRAY(textureName) + #define TEXTURE3D_FLOAT(textureName) TEXTURE3D(textureName) + + #define TEXTURE2D_HALF(textureName) TEXTURE2D(textureName) + #define TEXTURE2D_ARRAY_HALF(textureName) TEXTURE2D_ARRAY(textureName) + #define TEXTURECUBE_HALF(textureName) TEXTURECUBE(textureName) + #define TEXTURECUBE_ARRAY_HALF(textureName) TEXTURECUBE_ARRAY(textureName) + #define TEXTURE3D_HALF(textureName) TEXTURE3D(textureName) + + #define TEXTURE2D_SHADOW(textureName) TEXTURE2D(textureName) + #define TEXTURE2D_ARRAY_SHADOW(textureName) TEXTURE2D_ARRAY(textureName) + #define TEXTURECUBE_SHADOW(textureName) TEXTURECUBE(textureName) + #define TEXTURECUBE_ARRAY_SHADOW(textureName) TEXTURECUBE_ARRAY(textureName) + + #define RW_TEXTURE2D(type, textureName) RWTexture2D textureName + #define RW_TEXTURE2D_ARRAY(type, textureName) RWTexture2DArray textureName + #define RW_TEXTURE3D(type, textureName) RWTexture3D textureName + + #define SAMPLER(samplerName) SamplerState samplerName + #define SAMPLER_CMP(samplerName) SamplerComparisonState samplerName + + #define TEXTURE2D_PARAM(textureName, samplerName) TEXTURE2D(textureName), SAMPLER(samplerName) + #define TEXTURE2D_ARRAY_PARAM(textureName, samplerName) TEXTURE2D_ARRAY(textureName), SAMPLER(samplerName) + #define TEXTURECUBE_PARAM(textureName, samplerName) TEXTURECUBE(textureName), SAMPLER(samplerName) + #define TEXTURECUBE_ARRAY_PARAM(textureName, samplerName) TEXTURECUBE_ARRAY(textureName), SAMPLER(samplerName) + #define TEXTURE3D_PARAM(textureName, samplerName) TEXTURE3D(textureName), SAMPLER(samplerName) + + #define TEXTURE2D_SHADOW_PARAM(textureName, samplerName) TEXTURE2D(textureName), SAMPLER_CMP(samplerName) + #define TEXTURE2D_ARRAY_SHADOW_PARAM(textureName, samplerName) TEXTURE2D_ARRAY(textureName), SAMPLER_CMP(samplerName) + #define TEXTURECUBE_SHADOW_PARAM(textureName, samplerName) TEXTURECUBE(textureName), SAMPLER_CMP(samplerName) + #define TEXTURECUBE_ARRAY_SHADOW_PARAM(textureName, samplerName) TEXTURECUBE_ARRAY(textureName), SAMPLER_CMP(samplerName) + + #define TEXTURE2D_ARGS(textureName, samplerName) textureName, samplerName + #define TEXTURE2D_ARRAY_ARGS(textureName, samplerName) textureName, samplerName + #define TEXTURECUBE_ARGS(textureName, samplerName) textureName, samplerName + #define TEXTURECUBE_ARRAY_ARGS(textureName, samplerName) textureName, samplerName + #define TEXTURE3D_ARGS(textureName, samplerName) textureName, samplerName + + #define TEXTURE2D_SHADOW_ARGS(textureName, samplerName) textureName, samplerName + #define TEXTURE2D_ARRAY_SHADOW_ARGS(textureName, samplerName) textureName, samplerName + #define TEXTURECUBE_SHADOW_ARGS(textureName, samplerName) textureName, samplerName + #define TEXTURECUBE_ARRAY_SHADOW_ARGS(textureName, samplerName) textureName, samplerName + + #define SAMPLE_TEXTURE2D(textureName, samplerName, coord2) textureName.Sample(samplerName, coord2) + #define SAMPLE_TEXTURE2D_LOD(textureName, samplerName, coord2, lod) textureName.SampleLevel(samplerName, coord2, lod) + #define SAMPLE_TEXTURE2D_BIAS(textureName, samplerName, coord2, bias) textureName.SampleBias(samplerName, coord2, bias) + #define SAMPLE_TEXTURE2D_GRAD(textureName, samplerName, coord2, dpdx, dpdy) textureName.SampleGrad(samplerName, coord2, dpdx, dpdy) + #define SAMPLE_TEXTURE2D_ARRAY(textureName, samplerName, coord2, index) textureName.Sample(samplerName, float3(coord2, index)) + #define SAMPLE_TEXTURE2D_ARRAY_LOD(textureName, samplerName, coord2, index, lod) textureName.SampleLevel(samplerName, float3(coord2, index), lod) + #define SAMPLE_TEXTURE2D_ARRAY_BIAS(textureName, samplerName, coord2, index, bias) textureName.SampleBias(samplerName, float3(coord2, index), bias) + #define SAMPLE_TEXTURE2D_ARRAY_GRAD(textureName, samplerName, coord2, index, dpdx, dpdy) textureName.SampleGrad(samplerName, float3(coord2, index), dpdx, dpdy) + #define SAMPLE_TEXTURECUBE(textureName, samplerName, coord3) textureName.Sample(samplerName, coord3) + #define SAMPLE_TEXTURECUBE_LOD(textureName, samplerName, coord3, lod) textureName.SampleLevel(samplerName, coord3, lod) + #define SAMPLE_TEXTURECUBE_BIAS(textureName, samplerName, coord3, bias) textureName.SampleBias(samplerName, coord3, bias) + #define SAMPLE_TEXTURECUBE_ARRAY(textureName, samplerName, coord3, index) textureName.Sample(samplerName, float4(coord3, index)) + #define SAMPLE_TEXTURECUBE_ARRAY_LOD(textureName, samplerName, coord3, index, lod) textureName.SampleLevel(samplerName, float4(coord3, index), lod) + #define SAMPLE_TEXTURECUBE_ARRAY_BIAS(textureName, samplerName, coord3, index, bias) textureName.SampleBias(samplerName, float4(coord3, index), bias) + #define SAMPLE_TEXTURE3D(textureName, samplerName, coord3) textureName.Sample(samplerName, coord3) + #define SAMPLE_TEXTURE3D_LOD(textureName, samplerName, coord3, lod) textureName.SampleLevel(samplerName, coord3, lod) + + #define SAMPLE_TEXTURE2D_SHADOW(textureName, samplerName, coord3) textureName.SampleCmpLevelZero(samplerName, (coord3).xy, (coord3).z) + #define SAMPLE_TEXTURE2D_ARRAY_SHADOW(textureName, samplerName, coord3, index) textureName.SampleCmpLevelZero(samplerName, float3((coord3).xy, index), (coord3).z) + #define SAMPLE_TEXTURECUBE_SHADOW(textureName, samplerName, coord4) textureName.SampleCmpLevelZero(samplerName, (coord4).xyz, (coord4).w) + #define SAMPLE_TEXTURECUBE_ARRAY_SHADOW(textureName, samplerName, coord4, index) textureName.SampleCmpLevelZero(samplerName, float4((coord4).xyz, index), (coord4).w) + + #define LOAD_TEXTURE2D(textureName, unCoord2) textureName.Load(int3(unCoord2, 0)) + #define LOAD_TEXTURE2D_LOD(textureName, unCoord2, lod) textureName.Load(int3(unCoord2, lod)) + #define LOAD_TEXTURE2D_MSAA(textureName, unCoord2, sampleIndex) textureName.Load(unCoord2, sampleIndex) + #define LOAD_TEXTURE2D_ARRAY(textureName, unCoord2, index) textureName.Load(int4(unCoord2, index, 0)) + #define LOAD_TEXTURE2D_ARRAY_MSAA(textureName, unCoord2, index, sampleIndex) textureName.Load(int3(unCoord2, index), sampleIndex) + #define LOAD_TEXTURE2D_ARRAY_LOD(textureName, unCoord2, index, lod) textureName.Load(int4(unCoord2, index, lod)) + #define LOAD_TEXTURE3D(textureName, unCoord3) textureName.Load(int4(unCoord3, 0)) + #define LOAD_TEXTURE3D_LOD(textureName, unCoord3, lod) textureName.Load(int4(unCoord3, lod)) + + #define PLATFORM_SUPPORT_GATHER + #define GATHER_TEXTURE2D(textureName, samplerName, coord2) textureName.Gather(samplerName, coord2) + #define GATHER_TEXTURE2D_ARRAY(textureName, samplerName, coord2, index) textureName.Gather(samplerName, float3(coord2, index)) + #define GATHER_TEXTURECUBE(textureName, samplerName, coord3) textureName.Gather(samplerName, coord3) + #define GATHER_TEXTURECUBE_ARRAY(textureName, samplerName, coord3, index) textureName.Gather(samplerName, float4(coord3, index)) + #define GATHER_RED_TEXTURE2D(textureName, samplerName, coord2) textureName.GatherRed(samplerName, coord2) + #define GATHER_GREEN_TEXTURE2D(textureName, samplerName, coord2) textureName.GatherGreen(samplerName, coord2) + #define GATHER_BLUE_TEXTURE2D(textureName, samplerName, coord2) textureName.GatherBlue(samplerName, coord2) + #define GATHER_ALPHA_TEXTURE2D(textureName, samplerName, coord2) textureName.GatherAlpha(samplerName, coord2) + + +#elif defined(SHADER_API_PSSL) + + // Initialize arbitrary structure with zero values. + // Do not exist on some platform, in this case we need to have a standard name that call a function that will initialize all parameters to 0 + #define ZERO_INITIALIZE(type, name) name = (type)0; + #define ZERO_INITIALIZE_ARRAY(type, name, arraySize) { for (int arrayIndex = 0; arrayIndex < arraySize; arrayIndex++) { name[arrayIndex] = (type)0; } } + + // Texture util abstraction + + #define CALCULATE_TEXTURE2D_LOD(textureName, samplerName, coord2) textureName.GetLOD(samplerName, coord2) + + // Texture abstraction + + #define TEXTURE2D(textureName) Texture2D textureName + #define TEXTURE2D_ARRAY(textureName) Texture2DArray textureName + #define TEXTURECUBE(textureName) TextureCube textureName + #define TEXTURECUBE_ARRAY(textureName) TextureCubeArray textureName + #define TEXTURE3D(textureName) Texture3D textureName + + #define TEXTURE2D_FLOAT(textureName) TEXTURE2D(textureName) + #define TEXTURE2D_ARRAY_FLOAT(textureName) TEXTURE2D_ARRAY(textureName) + #define TEXTURECUBE_FLOAT(textureName) TEXTURECUBE(textureName) + #define TEXTURECUBE_ARRAY_FLOAT(textureName) TEXTURECUBE_ARRAY(textureName) + #define TEXTURE3D_FLOAT(textureName) TEXTURE3D(textureName) + + #define TEXTURE2D_HALF(textureName) TEXTURE2D(textureName) + #define TEXTURE2D_ARRAY_HALF(textureName) TEXTURE2D_ARRAY(textureName) + #define TEXTURECUBE_HALF(textureName) TEXTURECUBE(textureName) + #define TEXTURECUBE_ARRAY_HALF(textureName) TEXTURECUBE_ARRAY(textureName) + #define TEXTURE3D_HALF(textureName) TEXTURE3D(textureName) + + #define TEXTURE2D_SHADOW(textureName) TEXTURE2D(textureName) + #define TEXTURE2D_ARRAY_SHADOW(textureName) TEXTURE2D_ARRAY(textureName) + #define TEXTURECUBE_SHADOW(textureName) TEXTURECUBE(textureName) + #define TEXTURECUBE_ARRAY_SHADOW(textureName) TEXTURECUBE_ARRAY(textureName) + + #define RW_TEXTURE2D(type, textureName) RW_Texture2D textureName + #define RW_TEXTURE2D_ARRAY(type, textureName) RW_Texture2D_Array textureName + #define RW_TEXTURE3D(type, textureName) RW_Texture3D textureName + + #define SAMPLER(samplerName) SamplerState samplerName + #define SAMPLER_CMP(samplerName) SamplerComparisonState samplerName + + #define TEXTURE2D_PARAM(textureName, samplerName) TEXTURE2D(textureName), SAMPLER(samplerName) + #define TEXTURE2D_ARRAY_PARAM(textureName, samplerName) TEXTURE2D_ARRAY(textureName), SAMPLER(samplerName) + #define TEXTURECUBE_PARAM(textureName, samplerName) TEXTURECUBE(textureName), SAMPLER(samplerName) + #define TEXTURECUBE_ARRAY_PARAM(textureName, samplerName) TEXTURECUBE_ARRAY(textureName), SAMPLER(samplerName) + #define TEXTURE3D_PARAM(textureName, samplerName) TEXTURE3D(textureName), SAMPLER(samplerName) + + #define TEXTURE2D_SHADOW_PARAM(textureName, samplerName) TEXTURE2D(textureName), SAMPLER_CMP(samplerName) + #define TEXTURE2D_ARRAY_SHADOW_PARAM(textureName, samplerName) TEXTURE2D_ARRAY(textureName), SAMPLER_CMP(samplerName) + #define TEXTURECUBE_SHADOW_PARAM(textureName, samplerName) TEXTURECUBE(textureName), SAMPLER_CMP(samplerName) + #define TEXTURECUBE_ARRAY_SHADOW_PARAM(textureName, samplerName) TEXTURECUBE_ARRAY(textureName), SAMPLER_CMP(samplerName) + + #define TEXTURE2D_ARGS(textureName, samplerName) textureName, samplerName + #define TEXTURE2D_ARRAY_ARGS(textureName, samplerName) textureName, samplerName + #define TEXTURECUBE_ARGS(textureName, samplerName) textureName, samplerName + #define TEXTURECUBE_ARRAY_ARGS(textureName, samplerName) textureName, samplerName + #define TEXTURE3D_ARGS(textureName, samplerName) textureName, samplerName + + #define TEXTURE2D_SHADOW_ARGS(textureName, samplerName) textureName, samplerName + #define TEXTURE2D_ARRAY_SHADOW_ARGS(textureName, samplerName) textureName, samplerName + #define TEXTURECUBE_SHADOW_ARGS(textureName, samplerName) textureName, samplerName + #define TEXTURECUBE_ARRAY_SHADOW_ARGS(textureName, samplerName) textureName, samplerName + + #define SAMPLE_TEXTURE2D(textureName, samplerName, coord2) textureName.Sample(samplerName, coord2) + #define SAMPLE_TEXTURE2D_LOD(textureName, samplerName, coord2, lod) textureName.SampleLevel(samplerName, coord2, lod) + #define SAMPLE_TEXTURE2D_BIAS(textureName, samplerName, coord2, bias) textureName.SampleBias(samplerName, coord2, bias) + #define SAMPLE_TEXTURE2D_GRAD(textureName, samplerName, coord2, dpdx, dpdy) textureName.SampleGrad(samplerName, coord2, dpdx, dpdy) + #define SAMPLE_TEXTURE2D_ARRAY(textureName, samplerName, coord2, index) textureName.Sample(samplerName, float3(coord2, index)) + #define SAMPLE_TEXTURE2D_ARRAY_LOD(textureName, samplerName, coord2, index, lod) textureName.SampleLevel(samplerName, float3(coord2, index), lod) + #define SAMPLE_TEXTURE2D_ARRAY_BIAS(textureName, samplerName, coord2, index, bias) textureName.SampleBias(samplerName, float3(coord2, index), bias) + #define SAMPLE_TEXTURE2D_ARRAY_GRAD(textureName, samplerName, coord2, index, dpdx, dpdy) textureName.SampleGrad(samplerName, float3(coord2, index), dpdx, dpdy) + #define SAMPLE_TEXTURECUBE(textureName, samplerName, coord3) textureName.Sample(samplerName, coord3) + #define SAMPLE_TEXTURECUBE_LOD(textureName, samplerName, coord3, lod) textureName.SampleLevel(samplerName, coord3, lod) + #define SAMPLE_TEXTURECUBE_BIAS(textureName, samplerName, coord3, bias) textureName.SampleBias(samplerName, coord3, bias) + #define SAMPLE_TEXTURECUBE_ARRAY(textureName, samplerName, coord3, index) textureName.Sample(samplerName, float4(coord3, index)) + #define SAMPLE_TEXTURECUBE_ARRAY_LOD(textureName, samplerName, coord3, index, lod) textureName.SampleLevel(samplerName, float4(coord3, index), lod) + #define SAMPLE_TEXTURECUBE_ARRAY_BIAS(textureName, samplerName, coord3, index, bias) textureName.SampleBias(samplerName, float4(coord3, index), bias) + #define SAMPLE_TEXTURE3D(textureName, samplerName, coord3) textureName.Sample(samplerName, coord3) + #define SAMPLE_TEXTURE3D_LOD(textureName, samplerName, coord3, lod) textureName.SampleLevel(samplerName, coord3, lod) + + #define SAMPLE_TEXTURE2D_SHADOW(textureName, samplerName, coord3) textureName.SampleCmpLevelZero(samplerName, (coord3).xy, (coord3).z) + #define SAMPLE_TEXTURE2D_ARRAY_SHADOW(textureName, samplerName, coord3, index) textureName.SampleCmpLevelZero(samplerName, float3((coord3).xy, index), (coord3).z) + #define SAMPLE_TEXTURECUBE_SHADOW(textureName, samplerName, coord4) textureName.SampleCmpLevelZero(samplerName, (coord4).xyz, (coord4).w) + #define SAMPLE_TEXTURECUBE_ARRAY_SHADOW(textureName, samplerName, coord4, index) textureName.SampleCmpLevelZero(samplerName, float4((coord4).xyz, index), (coord4).w) + + #define LOAD_TEXTURE2D(textureName, unCoord2) textureName.Load(int3(unCoord2, 0)) + #define LOAD_TEXTURE2D_LOD(textureName, unCoord2, lod) textureName.Load(int3(unCoord2, lod)) + #define LOAD_TEXTURE2D_MSAA(textureName, unCoord2, sampleIndex) textureName.Load(unCoord2, sampleIndex) + #define LOAD_TEXTURE2D_ARRAY(textureName, unCoord2, index) textureName.Load(int4(unCoord2, index, 0)) + #define LOAD_TEXTURE2D_ARRAY_MSAA(textureName, unCoord2, index, sampleIndex) textureName.Load(int3(unCoord2, index), sampleIndex) + #define LOAD_TEXTURE2D_ARRAY_LOD(textureName, unCoord2, index, lod) textureName.Load(int4(unCoord2, index, lod)) + #define LOAD_TEXTURE3D(textureName, unCoord3) textureName.Load(int4(unCoord3, 0)) + #define LOAD_TEXTURE3D_LOD(textureName, unCoord3, lod) textureName.Load(int4(unCoord3, lod)) + + #define PLATFORM_SUPPORT_GATHER + #define GATHER_TEXTURE2D(textureName, samplerName, coord2) textureName.Gather(samplerName, coord2) + #define GATHER_TEXTURE2D_ARRAY(textureName, samplerName, coord2, index) textureName.Gather(samplerName, float3(coord2, index)) + #define GATHER_TEXTURECUBE(textureName, samplerName, coord3) textureName.Gather(samplerName, coord3) + #define GATHER_TEXTURECUBE_ARRAY(textureName, samplerName, coord3, index) textureName.Gather(samplerName, float4(coord3, index)) + #define GATHER_RED_TEXTURE2D(textureName, samplerName, coord2) textureName.GatherRed(samplerName, coord2) + #define GATHER_GREEN_TEXTURE2D(textureName, samplerName, coord2) textureName.GatherGreen(samplerName, coord2) + #define GATHER_BLUE_TEXTURE2D(textureName, samplerName, coord2) textureName.GatherBlue(samplerName, coord2) + #define GATHER_ALPHA_TEXTURE2D(textureName, samplerName, coord2) textureName.GatherAlpha(samplerName, coord2) + + + +#elif defined(SHADER_API_D3D11) + + // Initialize arbitrary structure with zero values. + // Do not exist on some platform, in this case we need to have a standard name that call a function that will initialize all parameters to 0 + #define ZERO_INITIALIZE(type, name) name = (type)0; + #define ZERO_INITIALIZE_ARRAY(type, name, arraySize) { for (int arrayIndex = 0; arrayIndex < arraySize; arrayIndex++) { name[arrayIndex] = (type)0; } } + + // Texture util abstraction + + #define CALCULATE_TEXTURE2D_LOD(textureName, samplerName, coord2) textureName.CalculateLevelOfDetail(samplerName, coord2) + + // Texture abstraction + + #define TEXTURE2D(textureName) Texture2D textureName + #define TEXTURE2D_ARRAY(textureName) Texture2DArray textureName + #define TEXTURECUBE(textureName) TextureCube textureName + #define TEXTURECUBE_ARRAY(textureName) TextureCubeArray textureName + #define TEXTURE3D(textureName) Texture3D textureName + + #define TEXTURE2D_FLOAT(textureName) TEXTURE2D(textureName) + #define TEXTURE2D_ARRAY_FLOAT(textureName) TEXTURE2D_ARRAY(textureName) + #define TEXTURECUBE_FLOAT(textureName) TEXTURECUBE(textureName) + #define TEXTURECUBE_ARRAY_FLOAT(textureName) TEXTURECUBE_ARRAY(textureName) + #define TEXTURE3D_FLOAT(textureName) TEXTURE3D(textureName) + + #define TEXTURE2D_HALF(textureName) TEXTURE2D(textureName) + #define TEXTURE2D_ARRAY_HALF(textureName) TEXTURE2D_ARRAY(textureName) + #define TEXTURECUBE_HALF(textureName) TEXTURECUBE(textureName) + #define TEXTURECUBE_ARRAY_HALF(textureName) TEXTURECUBE_ARRAY(textureName) + #define TEXTURE3D_HALF(textureName) TEXTURE3D(textureName) + + #define TEXTURE2D_SHADOW(textureName) TEXTURE2D(textureName) + #define TEXTURE2D_ARRAY_SHADOW(textureName) TEXTURE2D_ARRAY(textureName) + #define TEXTURECUBE_SHADOW(textureName) TEXTURECUBE(textureName) + #define TEXTURECUBE_ARRAY_SHADOW(textureName) TEXTURECUBE_ARRAY(textureName) + + #define RW_TEXTURE2D(type, textureName) RWTexture2D textureName + #define RW_TEXTURE2D_ARRAY(type, textureName) RWTexture2DArray textureName + #define RW_TEXTURE3D(type, textureName) RWTexture3D textureName + + #define SAMPLER(samplerName) SamplerState samplerName + #define SAMPLER_CMP(samplerName) SamplerComparisonState samplerName + + #define TEXTURE2D_PARAM(textureName, samplerName) TEXTURE2D(textureName), SAMPLER(samplerName) + #define TEXTURE2D_ARRAY_PARAM(textureName, samplerName) TEXTURE2D_ARRAY(textureName), SAMPLER(samplerName) + #define TEXTURECUBE_PARAM(textureName, samplerName) TEXTURECUBE(textureName), SAMPLER(samplerName) + #define TEXTURECUBE_ARRAY_PARAM(textureName, samplerName) TEXTURECUBE_ARRAY(textureName), SAMPLER(samplerName) + #define TEXTURE3D_PARAM(textureName, samplerName) TEXTURE3D(textureName), SAMPLER(samplerName) + + #define TEXTURE2D_SHADOW_PARAM(textureName, samplerName) TEXTURE2D(textureName), SAMPLER_CMP(samplerName) + #define TEXTURE2D_ARRAY_SHADOW_PARAM(textureName, samplerName) TEXTURE2D_ARRAY(textureName), SAMPLER_CMP(samplerName) + #define TEXTURECUBE_SHADOW_PARAM(textureName, samplerName) TEXTURECUBE(textureName), SAMPLER_CMP(samplerName) + #define TEXTURECUBE_ARRAY_SHADOW_PARAM(textureName, samplerName) TEXTURECUBE_ARRAY(textureName), SAMPLER_CMP(samplerName) + + #define TEXTURE2D_ARGS(textureName, samplerName) textureName, samplerName + #define TEXTURE2D_ARRAY_ARGS(textureName, samplerName) textureName, samplerName + #define TEXTURECUBE_ARGS(textureName, samplerName) textureName, samplerName + #define TEXTURECUBE_ARRAY_ARGS(textureName, samplerName) textureName, samplerName + #define TEXTURE3D_ARGS(textureName, samplerName) textureName, samplerName + + #define TEXTURE2D_SHADOW_ARGS(textureName, samplerName) textureName, samplerName + #define TEXTURE2D_ARRAY_SHADOW_ARGS(textureName, samplerName) textureName, samplerName + #define TEXTURECUBE_SHADOW_ARGS(textureName, samplerName) textureName, samplerName + #define TEXTURECUBE_ARRAY_SHADOW_ARGS(textureName, samplerName) textureName, samplerName + + #define SAMPLE_TEXTURE2D(textureName, samplerName, coord2) textureName.Sample(samplerName, coord2) + #define SAMPLE_TEXTURE2D_LOD(textureName, samplerName, coord2, lod) textureName.SampleLevel(samplerName, coord2, lod) + #define SAMPLE_TEXTURE2D_BIAS(textureName, samplerName, coord2, bias) textureName.SampleBias(samplerName, coord2, bias) + #define SAMPLE_TEXTURE2D_GRAD(textureName, samplerName, coord2, dpdx, dpdy) textureName.SampleGrad(samplerName, coord2, dpdx, dpdy) + #define SAMPLE_TEXTURE2D_ARRAY(textureName, samplerName, coord2, index) textureName.Sample(samplerName, float3(coord2, index)) + #define SAMPLE_TEXTURE2D_ARRAY_LOD(textureName, samplerName, coord2, index, lod) textureName.SampleLevel(samplerName, float3(coord2, index), lod) + #define SAMPLE_TEXTURE2D_ARRAY_BIAS(textureName, samplerName, coord2, index, bias) textureName.SampleBias(samplerName, float3(coord2, index), bias) + #define SAMPLE_TEXTURE2D_ARRAY_GRAD(textureName, samplerName, coord2, index, dpdx, dpdy) textureName.SampleGrad(samplerName, float3(coord2, index), dpdx, dpdy) + #define SAMPLE_TEXTURECUBE(textureName, samplerName, coord3) textureName.Sample(samplerName, coord3) + #define SAMPLE_TEXTURECUBE_LOD(textureName, samplerName, coord3, lod) textureName.SampleLevel(samplerName, coord3, lod) + #define SAMPLE_TEXTURECUBE_BIAS(textureName, samplerName, coord3, bias) textureName.SampleBias(samplerName, coord3, bias) + #define SAMPLE_TEXTURECUBE_ARRAY(textureName, samplerName, coord3, index) textureName.Sample(samplerName, float4(coord3, index)) + #define SAMPLE_TEXTURECUBE_ARRAY_LOD(textureName, samplerName, coord3, index, lod) textureName.SampleLevel(samplerName, float4(coord3, index), lod) + #define SAMPLE_TEXTURECUBE_ARRAY_BIAS(textureName, samplerName, coord3, index, bias) textureName.SampleBias(samplerName, float4(coord3, index), bias) + #define SAMPLE_TEXTURE3D(textureName, samplerName, coord3) textureName.Sample(samplerName, coord3) + #define SAMPLE_TEXTURE3D_LOD(textureName, samplerName, coord3, lod) textureName.SampleLevel(samplerName, coord3, lod) + + #define SAMPLE_TEXTURE2D_SHADOW(textureName, samplerName, coord3) textureName.SampleCmpLevelZero(samplerName, (coord3).xy, (coord3).z) + #define SAMPLE_TEXTURE2D_ARRAY_SHADOW(textureName, samplerName, coord3, index) textureName.SampleCmpLevelZero(samplerName, float3((coord3).xy, index), (coord3).z) + #define SAMPLE_TEXTURECUBE_SHADOW(textureName, samplerName, coord4) textureName.SampleCmpLevelZero(samplerName, (coord4).xyz, (coord4).w) + #define SAMPLE_TEXTURECUBE_ARRAY_SHADOW(textureName, samplerName, coord4, index) textureName.SampleCmpLevelZero(samplerName, float4((coord4).xyz, index), (coord4).w) + + #define LOAD_TEXTURE2D(textureName, unCoord2) textureName.Load(int3(unCoord2, 0)) + #define LOAD_TEXTURE2D_LOD(textureName, unCoord2, lod) textureName.Load(int3(unCoord2, lod)) + #define LOAD_TEXTURE2D_MSAA(textureName, unCoord2, sampleIndex) textureName.Load(unCoord2, sampleIndex) + #define LOAD_TEXTURE2D_ARRAY(textureName, unCoord2, index) textureName.Load(int4(unCoord2, index, 0)) + #define LOAD_TEXTURE2D_ARRAY_MSAA(textureName, unCoord2, index, sampleIndex) textureName.Load(int3(unCoord2, index), sampleIndex) + #define LOAD_TEXTURE2D_ARRAY_LOD(textureName, unCoord2, index, lod) textureName.Load(int4(unCoord2, index, lod)) + #define LOAD_TEXTURE3D(textureName, unCoord3) textureName.Load(int4(unCoord3, 0)) + #define LOAD_TEXTURE3D_LOD(textureName, unCoord3, lod) textureName.Load(int4(unCoord3, lod)) + + #define PLATFORM_SUPPORT_GATHER + #define GATHER_TEXTURE2D(textureName, samplerName, coord2) textureName.Gather(samplerName, coord2) + #define GATHER_TEXTURE2D_ARRAY(textureName, samplerName, coord2, index) textureName.Gather(samplerName, float3(coord2, index)) + #define GATHER_TEXTURECUBE(textureName, samplerName, coord3) textureName.Gather(samplerName, coord3) + #define GATHER_TEXTURECUBE_ARRAY(textureName, samplerName, coord3, index) textureName.Gather(samplerName, float4(coord3, index)) + #define GATHER_RED_TEXTURE2D(textureName, samplerName, coord2) textureName.GatherRed(samplerName, coord2) + #define GATHER_GREEN_TEXTURE2D(textureName, samplerName, coord2) textureName.GatherGreen(samplerName, coord2) + #define GATHER_BLUE_TEXTURE2D(textureName, samplerName, coord2) textureName.GatherBlue(samplerName, coord2) + #define GATHER_ALPHA_TEXTURE2D(textureName, samplerName, coord2) textureName.GatherAlpha(samplerName, coord2) + +#elif defined(SHADER_API_METAL) + + // Initialize arbitrary structure with zero values. + // Do not exist on some platform, in this case we need to have a standard name that call a function that will initialize all parameters to 0 + #define ZERO_INITIALIZE(type, name) name = (type)0; + #define ZERO_INITIALIZE_ARRAY(type, name, arraySize) { for (int arrayIndex = 0; arrayIndex < arraySize; arrayIndex++) { name[arrayIndex] = (type)0; } } + + // Texture util abstraction + + #define CALCULATE_TEXTURE2D_LOD(textureName, samplerName, coord2) textureName.CalculateLevelOfDetail(samplerName, coord2) + + // Texture abstraction + + #define TEXTURE2D(textureName) Texture2D textureName + #define TEXTURE2D_ARRAY(textureName) Texture2DArray textureName + #define TEXTURECUBE(textureName) TextureCube textureName + #define TEXTURECUBE_ARRAY(textureName) TextureCubeArray textureName + #define TEXTURE3D(textureName) Texture3D textureName + + #define TEXTURE2D_FLOAT(textureName) Texture2D_float textureName + #define TEXTURE2D_ARRAY_FLOAT(textureName) Texture2DArray textureName // no support to _float on Array, it's being added + #define TEXTURECUBE_FLOAT(textureName) TextureCube_float textureName + #define TEXTURECUBE_ARRAY_FLOAT(textureName) TextureCubeArray textureName // no support to _float on Array, it's being added + #define TEXTURE3D_FLOAT(textureName) Texture3D_float textureName + + #define TEXTURE2D_HALF(textureName) Texture2D_half textureName + #define TEXTURE2D_ARRAY_HALF(textureName) Texture2DArray textureName // no support to _float on Array, it's being added + #define TEXTURECUBE_HALF(textureName) TextureCube_half textureName + #define TEXTURECUBE_ARRAY_HALF(textureName) TextureCubeArray textureName // no support to _float on Array, it's being added + #define TEXTURE3D_HALF(textureName) Texture3D_half textureName + + #define TEXTURE2D_SHADOW(textureName) TEXTURE2D(textureName) + #define TEXTURE2D_ARRAY_SHADOW(textureName) TEXTURE2D_ARRAY(textureName) + #define TEXTURECUBE_SHADOW(textureName) TEXTURECUBE(textureName) + #define TEXTURECUBE_ARRAY_SHADOW(textureName) TEXTURECUBE_ARRAY(textureName) + + #define RW_TEXTURE2D(type, textureName) RWTexture2D textureName + #define RW_TEXTURE2D_ARRAY(type, textureName) RWTexture2DArray textureName + #define RW_TEXTURE3D(type, textureName) RWTexture3D textureName + + #define SAMPLER(samplerName) SamplerState samplerName + #define SAMPLER_CMP(samplerName) SamplerComparisonState samplerName + + #define TEXTURE2D_PARAM(textureName, samplerName) TEXTURE2D(textureName), SAMPLER(samplerName) + #define TEXTURE2D_ARRAY_PARAM(textureName, samplerName) TEXTURE2D_ARRAY(textureName), SAMPLER(samplerName) + #define TEXTURECUBE_PARAM(textureName, samplerName) TEXTURECUBE(textureName), SAMPLER(samplerName) + #define TEXTURECUBE_ARRAY_PARAM(textureName, samplerName) TEXTURECUBE_ARRAY(textureName), SAMPLER(samplerName) + #define TEXTURE3D_PARAM(textureName, samplerName) TEXTURE3D(textureName), SAMPLER(samplerName) + + #define TEXTURE2D_SHADOW_PARAM(textureName, samplerName) TEXTURE2D(textureName), SAMPLER_CMP(samplerName) + #define TEXTURE2D_ARRAY_SHADOW_PARAM(textureName, samplerName) TEXTURE2D_ARRAY(textureName), SAMPLER_CMP(samplerName) + #define TEXTURECUBE_SHADOW_PARAM(textureName, samplerName) TEXTURECUBE(textureName), SAMPLER_CMP(samplerName) + #define TEXTURECUBE_ARRAY_SHADOW_PARAM(textureName, samplerName) TEXTURECUBE_ARRAY(textureName), SAMPLER_CMP(samplerName) + + #define TEXTURE2D_ARGS(textureName, samplerName) textureName, samplerName + #define TEXTURE2D_ARRAY_ARGS(textureName, samplerName) textureName, samplerName + #define TEXTURECUBE_ARGS(textureName, samplerName) textureName, samplerName + #define TEXTURECUBE_ARRAY_ARGS(textureName, samplerName) textureName, samplerName + #define TEXTURE3D_ARGS(textureName, samplerName) textureName, samplerName + + #define TEXTURE2D_SHADOW_ARGS(textureName, samplerName) textureName, samplerName + #define TEXTURE2D_ARRAY_SHADOW_ARGS(textureName, samplerName) textureName, samplerName + #define TEXTURECUBE_SHADOW_ARGS(textureName, samplerName) textureName, samplerName + #define TEXTURECUBE_ARRAY_SHADOW_ARGS(textureName, samplerName) textureName, samplerName + + #define SAMPLE_TEXTURE2D(textureName, samplerName, coord2) textureName.Sample(samplerName, coord2) + #define SAMPLE_TEXTURE2D_LOD(textureName, samplerName, coord2, lod) textureName.SampleLevel(samplerName, coord2, lod) + #define SAMPLE_TEXTURE2D_BIAS(textureName, samplerName, coord2, bias) textureName.SampleBias(samplerName, coord2, bias) + #define SAMPLE_TEXTURE2D_GRAD(textureName, samplerName, coord2, dpdx, dpdy) textureName.SampleGrad(samplerName, coord2, dpdx, dpdy) + #define SAMPLE_TEXTURE2D_ARRAY(textureName, samplerName, coord2, index) textureName.Sample(samplerName, float3(coord2, index)) + #define SAMPLE_TEXTURE2D_ARRAY_LOD(textureName, samplerName, coord2, index, lod) textureName.SampleLevel(samplerName, float3(coord2, index), lod) + #define SAMPLE_TEXTURE2D_ARRAY_BIAS(textureName, samplerName, coord2, index, bias) textureName.SampleBias(samplerName, float3(coord2, index), bias) + #define SAMPLE_TEXTURE2D_ARRAY_GRAD(textureName, samplerName, coord2, index, dpdx, dpdy) textureName.SampleGrad(samplerName, float3(coord2, index), dpdx, dpdy) + #define SAMPLE_TEXTURECUBE(textureName, samplerName, coord3) textureName.Sample(samplerName, coord3) + #define SAMPLE_TEXTURECUBE_LOD(textureName, samplerName, coord3, lod) textureName.SampleLevel(samplerName, coord3, lod) + #define SAMPLE_TEXTURECUBE_BIAS(textureName, samplerName, coord3, bias) textureName.SampleBias(samplerName, coord3, bias) + #define SAMPLE_TEXTURECUBE_ARRAY(textureName, samplerName, coord3, index) textureName.Sample(samplerName, float4(coord3, index)) + #define SAMPLE_TEXTURECUBE_ARRAY_LOD(textureName, samplerName, coord3, index, lod) textureName.SampleLevel(samplerName, float4(coord3, index), lod) + #define SAMPLE_TEXTURECUBE_ARRAY_BIAS(textureName, samplerName, coord3, index, bias) textureName.SampleBias(samplerName, float4(coord3, index), bias) + #define SAMPLE_TEXTURE3D(textureName, samplerName, coord3) textureName.Sample(samplerName, coord3) + #define SAMPLE_TEXTURE3D_LOD(textureName, samplerName, coord3, lod) textureName.SampleLevel(samplerName, coord3, lod) + + #define SAMPLE_TEXTURE2D_SHADOW(textureName, samplerName, coord3) textureName.SampleCmpLevelZero(samplerName, (coord3).xy, (coord3).z) + #define SAMPLE_TEXTURE2D_ARRAY_SHADOW(textureName, samplerName, coord3, index) textureName.SampleCmpLevelZero(samplerName, float3((coord3).xy, index), (coord3).z) + #define SAMPLE_TEXTURECUBE_SHADOW(textureName, samplerName, coord4) textureName.SampleCmpLevelZero(samplerName, (coord4).xyz, (coord4).w) + #define SAMPLE_TEXTURECUBE_ARRAY_SHADOW(textureName, samplerName, coord4, index) textureName.SampleCmpLevelZero(samplerName, float4((coord4).xyz, index), (coord4).w) + + #define LOAD_TEXTURE2D(textureName, unCoord2) textureName.Load(int3(unCoord2, 0)) + #define LOAD_TEXTURE2D_LOD(textureName, unCoord2, lod) textureName.Load(int3(unCoord2, lod)) + #define LOAD_TEXTURE2D_MSAA(textureName, unCoord2, sampleIndex) textureName.Load(unCoord2, sampleIndex) + #define LOAD_TEXTURE2D_ARRAY(textureName, unCoord2, index) textureName.Load(int4(unCoord2, index, 0)) + #define LOAD_TEXTURE2D_ARRAY_MSAA(textureName, unCoord2, index, sampleIndex) textureName.Load(int3(unCoord2, index), sampleIndex) + #define LOAD_TEXTURE2D_ARRAY_LOD(textureName, unCoord2, index, lod) textureName.Load(int4(unCoord2, index, lod)) + #define LOAD_TEXTURE3D(textureName, unCoord3) textureName.Load(int4(unCoord3, 0)) + #define LOAD_TEXTURE3D_LOD(textureName, unCoord3, lod) textureName.Load(int4(unCoord3, lod)) + + #define PLATFORM_SUPPORT_GATHER + #define GATHER_TEXTURE2D(textureName, samplerName, coord2) textureName.Gather(samplerName, coord2) + #define GATHER_TEXTURE2D_ARRAY(textureName, samplerName, coord2, index) textureName.Gather(samplerName, float3(coord2, index)) + #define GATHER_TEXTURECUBE(textureName, samplerName, coord3) textureName.Gather(samplerName, coord3) + #define GATHER_TEXTURECUBE_ARRAY(textureName, samplerName, coord3, index) textureName.Gather(samplerName, float4(coord3, index)) + #define GATHER_RED_TEXTURE2D(textureName, samplerName, coord2) textureName.GatherRed(samplerName, coord2) + #define GATHER_GREEN_TEXTURE2D(textureName, samplerName, coord2) textureName.GatherGreen(samplerName, coord2) + #define GATHER_BLUE_TEXTURE2D(textureName, samplerName, coord2) textureName.GatherBlue(samplerName, coord2) + #define GATHER_ALPHA_TEXTURE2D(textureName, samplerName, coord2) textureName.GatherAlpha(samplerName, coord2) + +#elif defined(SHADER_API_VULKAN) +// This file assume SHADER_API_VULKAN is defined + // TODO: This is a straight copy from D3D11.hlsl. Go through all this stuff and adjust where needed. + + + // Initialize arbitrary structure with zero values. + // Do not exist on some platform, in this case we need to have a standard name that call a function that will initialize all parameters to 0 + #define ZERO_INITIALIZE(type, name) name = (type)0; + #define ZERO_INITIALIZE_ARRAY(type, name, arraySize) { for (int arrayIndex = 0; arrayIndex < arraySize; arrayIndex++) { name[arrayIndex] = (type)0; } } + + // Texture util abstraction + + #define CALCULATE_TEXTURE2D_LOD(textureName, samplerName, coord2) textureName.CalculateLevelOfDetail(samplerName, coord2) + + // Texture abstraction + + #define TEXTURE2D(textureName) Texture2D textureName + #define TEXTURE2D_ARRAY(textureName) Texture2DArray textureName + #define TEXTURECUBE(textureName) TextureCube textureName + #define TEXTURECUBE_ARRAY(textureName) TextureCubeArray textureName + #define TEXTURE3D(textureName) Texture3D textureName + + #define TEXTURE2D_FLOAT(textureName) Texture2D_float textureName + #define TEXTURE2D_ARRAY_FLOAT(textureName) Texture2DArray textureName // no support to _float on Array, it's being added + #define TEXTURECUBE_FLOAT(textureName) TextureCube_float textureName + #define TEXTURECUBE_ARRAY_FLOAT(textureName) TextureCubeArray textureName // no support to _float on Array, it's being added + #define TEXTURE3D_FLOAT(textureName) Texture3D_float textureName + + #define TEXTURE2D_HALF(textureName) Texture2D_half textureName + #define TEXTURE2D_ARRAY_HALF(textureName) Texture2DArray textureName // no support to _float on Array, it's being added + #define TEXTURECUBE_HALF(textureName) TextureCube_half textureName + #define TEXTURECUBE_ARRAY_HALF(textureName) TextureCubeArray textureName // no support to _float on Array, it's being added + #define TEXTURE3D_HALF(textureName) Texture3D_half textureName + + #define TEXTURE2D_SHADOW(textureName) TEXTURE2D(textureName) + #define TEXTURE2D_ARRAY_SHADOW(textureName) TEXTURE2D_ARRAY(textureName) + #define TEXTURECUBE_SHADOW(textureName) TEXTURECUBE(textureName) + #define TEXTURECUBE_ARRAY_SHADOW(textureName) TEXTURECUBE_ARRAY(textureName) + + #define RW_TEXTURE2D(type, textureName) RWTexture2D textureName + #define RW_TEXTURE2D_ARRAY(type, textureName) RWTexture2DArray textureName + #define RW_TEXTURE3D(type, textureName) RWTexture3D textureName + + #define SAMPLER(samplerName) SamplerState samplerName + #define SAMPLER_CMP(samplerName) SamplerComparisonState samplerName + + #define TEXTURE2D_PARAM(textureName, samplerName) TEXTURE2D(textureName), SAMPLER(samplerName) + #define TEXTURE2D_ARRAY_PARAM(textureName, samplerName) TEXTURE2D_ARRAY(textureName), SAMPLER(samplerName) + #define TEXTURECUBE_PARAM(textureName, samplerName) TEXTURECUBE(textureName), SAMPLER(samplerName) + #define TEXTURECUBE_ARRAY_PARAM(textureName, samplerName) TEXTURECUBE_ARRAY(textureName), SAMPLER(samplerName) + #define TEXTURE3D_PARAM(textureName, samplerName) TEXTURE3D(textureName), SAMPLER(samplerName) + + #define TEXTURE2D_SHADOW_PARAM(textureName, samplerName) TEXTURE2D(textureName), SAMPLER_CMP(samplerName) + #define TEXTURE2D_ARRAY_SHADOW_PARAM(textureName, samplerName) TEXTURE2D_ARRAY(textureName), SAMPLER_CMP(samplerName) + #define TEXTURECUBE_SHADOW_PARAM(textureName, samplerName) TEXTURECUBE(textureName), SAMPLER_CMP(samplerName) + #define TEXTURECUBE_ARRAY_SHADOW_PARAM(textureName, samplerName) TEXTURECUBE_ARRAY(textureName), SAMPLER_CMP(samplerName) + + #define TEXTURE2D_ARGS(textureName, samplerName) textureName, samplerName + #define TEXTURE2D_ARRAY_ARGS(textureName, samplerName) textureName, samplerName + #define TEXTURECUBE_ARGS(textureName, samplerName) textureName, samplerName + #define TEXTURECUBE_ARRAY_ARGS(textureName, samplerName) textureName, samplerName + #define TEXTURE3D_ARGS(textureName, samplerName) textureName, samplerName + + #define TEXTURE2D_SHADOW_ARGS(textureName, samplerName) textureName, samplerName + #define TEXTURE2D_ARRAY_SHADOW_ARGS(textureName, samplerName) textureName, samplerName + #define TEXTURECUBE_SHADOW_ARGS(textureName, samplerName) textureName, samplerName + #define TEXTURECUBE_ARRAY_SHADOW_ARGS(textureName, samplerName) textureName, samplerName + + #define SAMPLE_TEXTURE2D(textureName, samplerName, coord2) textureName.Sample(samplerName, coord2) + #define SAMPLE_TEXTURE2D_LOD(textureName, samplerName, coord2, lod) textureName.SampleLevel(samplerName, coord2, lod) + #define SAMPLE_TEXTURE2D_BIAS(textureName, samplerName, coord2, bias) textureName.SampleBias(samplerName, coord2, bias) + #define SAMPLE_TEXTURE2D_GRAD(textureName, samplerName, coord2, dpdx, dpdy) textureName.SampleGrad(samplerName, coord2, dpdx, dpdy) + #define SAMPLE_TEXTURE2D_ARRAY(textureName, samplerName, coord2, index) textureName.Sample(samplerName, float3(coord2, index)) + #define SAMPLE_TEXTURE2D_ARRAY_LOD(textureName, samplerName, coord2, index, lod) textureName.SampleLevel(samplerName, float3(coord2, index), lod) + #define SAMPLE_TEXTURE2D_ARRAY_BIAS(textureName, samplerName, coord2, index, bias) textureName.SampleBias(samplerName, float3(coord2, index), bias) + #define SAMPLE_TEXTURE2D_ARRAY_GRAD(textureName, samplerName, coord2, index, dpdx, dpdy) textureName.SampleGrad(samplerName, float3(coord2, index), dpdx, dpdy) + #define SAMPLE_TEXTURECUBE(textureName, samplerName, coord3) textureName.Sample(samplerName, coord3) + #define SAMPLE_TEXTURECUBE_LOD(textureName, samplerName, coord3, lod) textureName.SampleLevel(samplerName, coord3, lod) + #define SAMPLE_TEXTURECUBE_BIAS(textureName, samplerName, coord3, bias) textureName.SampleBias(samplerName, coord3, bias) + #define SAMPLE_TEXTURECUBE_ARRAY(textureName, samplerName, coord3, index) textureName.Sample(samplerName, float4(coord3, index)) + #define SAMPLE_TEXTURECUBE_ARRAY_LOD(textureName, samplerName, coord3, index, lod) textureName.SampleLevel(samplerName, float4(coord3, index), lod) + #define SAMPLE_TEXTURECUBE_ARRAY_BIAS(textureName, samplerName, coord3, index, bias) textureName.SampleBias(samplerName, float4(coord3, index), bias) + #define SAMPLE_TEXTURE3D(textureName, samplerName, coord3) textureName.Sample(samplerName, coord3) + #define SAMPLE_TEXTURE3D_LOD(textureName, samplerName, coord3, lod) textureName.SampleLevel(samplerName, coord3, lod) + + #define SAMPLE_TEXTURE2D_SHADOW(textureName, samplerName, coord3) textureName.SampleCmpLevelZero(samplerName, (coord3).xy, (coord3).z) + #define SAMPLE_TEXTURE2D_ARRAY_SHADOW(textureName, samplerName, coord3, index) textureName.SampleCmpLevelZero(samplerName, float3((coord3).xy, index), (coord3).z) + #define SAMPLE_TEXTURECUBE_SHADOW(textureName, samplerName, coord4) textureName.SampleCmpLevelZero(samplerName, (coord4).xyz, (coord4).w) + #define SAMPLE_TEXTURECUBE_ARRAY_SHADOW(textureName, samplerName, coord4, index) textureName.SampleCmpLevelZero(samplerName, float4((coord4).xyz, index), (coord4).w) + + #define LOAD_TEXTURE2D(textureName, unCoord2) textureName.Load(int3(unCoord2, 0)) + #define LOAD_TEXTURE2D_LOD(textureName, unCoord2, lod) textureName.Load(int3(unCoord2, lod)) + #define LOAD_TEXTURE2D_MSAA(textureName, unCoord2, sampleIndex) textureName.Load(unCoord2, sampleIndex) + #define LOAD_TEXTURE2D_ARRAY(textureName, unCoord2, index) textureName.Load(int4(unCoord2, index, 0)) + #define LOAD_TEXTURE2D_ARRAY_MSAA(textureName, unCoord2, index, sampleIndex) textureName.Load(int3(unCoord2, index), sampleIndex) + #define LOAD_TEXTURE2D_ARRAY_LOD(textureName, unCoord2, index, lod) textureName.Load(int4(unCoord2, index, lod)) + #define LOAD_TEXTURE3D(textureName, unCoord3) textureName.Load(int4(unCoord3, 0)) + #define LOAD_TEXTURE3D_LOD(textureName, unCoord3, lod) textureName.Load(int4(unCoord3, lod)) + + #define PLATFORM_SUPPORT_GATHER + #define GATHER_TEXTURE2D(textureName, samplerName, coord2) textureName.Gather(samplerName, coord2) + #define GATHER_TEXTURE2D_ARRAY(textureName, samplerName, coord2, index) textureName.Gather(samplerName, float3(coord2, index)) + #define GATHER_TEXTURECUBE(textureName, samplerName, coord3) textureName.Gather(samplerName, coord3) + #define GATHER_TEXTURECUBE_ARRAY(textureName, samplerName, coord3, index) textureName.Gather(samplerName, float4(coord3, index)) + #define GATHER_RED_TEXTURE2D(textureName, samplerName, coord2) textureName.GatherRed(samplerName, coord2) + #define GATHER_GREEN_TEXTURE2D(textureName, samplerName, coord2) textureName.GatherGreen(samplerName, coord2) + #define GATHER_BLUE_TEXTURE2D(textureName, samplerName, coord2) textureName.GatherBlue(samplerName, coord2) + #define GATHER_ALPHA_TEXTURE2D(textureName, samplerName, coord2) textureName.GatherAlpha(samplerName, coord2) + +#elif defined(SHADER_API_SWITCH) + // This file assume SHADER_API_SWITCH is defined + + // Initialize arbitrary structure with zero values. + // Do not exist on some platform, in this case we need to have a standard name that call a function that will initialize all parameters to 0 + #define ZERO_INITIALIZE(type, name) name = (type)0; + #define ZERO_INITIALIZE_ARRAY(type, name, arraySize) { for (int arrayIndex = 0; arrayIndex < arraySize; arrayIndex++) { name[arrayIndex] = (type)0; } } + + // Texture util abstraction + + #define CALCULATE_TEXTURE2D_LOD(textureName, samplerName, coord2) textureName.CalculateLevelOfDetail(samplerName, coord2) + + // Texture abstraction + + #define TEXTURE2D(textureName) Texture2D textureName + #define TEXTURE2D_ARRAY(textureName) Texture2DArray textureName + #define TEXTURECUBE(textureName) TextureCube textureName + #define TEXTURECUBE_ARRAY(textureName) TextureCubeArray textureName + #define TEXTURE3D(textureName) Texture3D textureName + + #define TEXTURE2D_FLOAT(textureName) Texture2D_float textureName + #define TEXTURE2D_ARRAY_FLOAT(textureName) Texture2DArray textureName // no support to _float on Array, it's being added + #define TEXTURECUBE_FLOAT(textureName) TextureCube_float textureName + #define TEXTURECUBE_ARRAY_FLOAT(textureName) TextureCubeArray textureName // no support to _float on Array, it's being added + #define TEXTURE3D_FLOAT(textureName) Texture3D_float textureName + + #define TEXTURE2D_HALF(textureName) Texture2D_half textureName + #define TEXTURE2D_ARRAY_HALF(textureName) Texture2DArray textureName // no support to _float on Array, it's being added + #define TEXTURECUBE_HALF(textureName) TextureCube_half textureName + #define TEXTURECUBE_ARRAY_HALF(textureName) TextureCubeArray textureName // no support to _float on Array, it's being added + #define TEXTURE3D_HALF(textureName) Texture3D_half textureName + + #define TEXTURE2D_SHADOW(textureName) TEXTURE2D(textureName) + #define TEXTURE2D_ARRAY_SHADOW(textureName) TEXTURE2D_ARRAY(textureName) + #define TEXTURECUBE_SHADOW(textureName) TEXTURECUBE(textureName) + #define TEXTURECUBE_ARRAY_SHADOW(textureName) TEXTURECUBE_ARRAY(textureName) + + #define RW_TEXTURE2D(type, textureName) RWTexture2D textureName + #define RW_TEXTURE2D_ARRAY(type, textureName) RWTexture2DArray textureName + #define RW_TEXTURE3D(type, textureName) RWTexture3D textureName + + #define SAMPLER(samplerName) SamplerState samplerName + #define SAMPLER_CMP(samplerName) SamplerComparisonState samplerName + + #define TEXTURE2D_PARAM(textureName, samplerName) TEXTURE2D(textureName), SAMPLER(samplerName) + #define TEXTURE2D_ARRAY_PARAM(textureName, samplerName) TEXTURE2D_ARRAY(textureName), SAMPLER(samplerName) + #define TEXTURECUBE_PARAM(textureName, samplerName) TEXTURECUBE(textureName), SAMPLER(samplerName) + #define TEXTURECUBE_ARRAY_PARAM(textureName, samplerName) TEXTURECUBE_ARRAY(textureName), SAMPLER(samplerName) + #define TEXTURE3D_PARAM(textureName, samplerName) TEXTURE3D(textureName), SAMPLER(samplerName) + + #define TEXTURE2D_SHADOW_PARAM(textureName, samplerName) TEXTURE2D(textureName), SAMPLER_CMP(samplerName) + #define TEXTURE2D_ARRAY_SHADOW_PARAM(textureName, samplerName) TEXTURE2D_ARRAY(textureName), SAMPLER_CMP(samplerName) + #define TEXTURECUBE_SHADOW_PARAM(textureName, samplerName) TEXTURECUBE(textureName), SAMPLER_CMP(samplerName) + #define TEXTURECUBE_ARRAY_SHADOW_PARAM(textureName, samplerName) TEXTURECUBE_ARRAY(textureName), SAMPLER_CMP(samplerName) + + #define TEXTURE2D_ARGS(textureName, samplerName) textureName, samplerName + #define TEXTURE2D_ARRAY_ARGS(textureName, samplerName) textureName, samplerName + #define TEXTURECUBE_ARGS(textureName, samplerName) textureName, samplerName + #define TEXTURECUBE_ARRAY_ARGS(textureName, samplerName) textureName, samplerName + #define TEXTURE3D_ARGS(textureName, samplerName) textureName, samplerName + + #define TEXTURE2D_SHADOW_ARGS(textureName, samplerName) textureName, samplerName + #define TEXTURE2D_ARRAY_SHADOW_ARGS(textureName, samplerName) textureName, samplerName + #define TEXTURECUBE_SHADOW_ARGS(textureName, samplerName) textureName, samplerName + #define TEXTURECUBE_ARRAY_SHADOW_ARGS(textureName, samplerName) textureName, samplerName + + #define SAMPLE_TEXTURE2D(textureName, samplerName, coord2) textureName.Sample(samplerName, coord2) + #define SAMPLE_TEXTURE2D_LOD(textureName, samplerName, coord2, lod) textureName.SampleLevel(samplerName, coord2, lod) + #define SAMPLE_TEXTURE2D_BIAS(textureName, samplerName, coord2, bias) textureName.SampleBias(samplerName, coord2, bias) + #define SAMPLE_TEXTURE2D_GRAD(textureName, samplerName, coord2, dpdx, dpdy) textureName.SampleGrad(samplerName, coord2, dpdx, dpdy) + #define SAMPLE_TEXTURE2D_ARRAY(textureName, samplerName, coord2, index) textureName.Sample(samplerName, float3(coord2, index)) + #define SAMPLE_TEXTURE2D_ARRAY_LOD(textureName, samplerName, coord2, index, lod) textureName.SampleLevel(samplerName, float3(coord2, index), lod) + #define SAMPLE_TEXTURE2D_ARRAY_BIAS(textureName, samplerName, coord2, index, bias) textureName.SampleBias(samplerName, float3(coord2, index), bias) + #define SAMPLE_TEXTURE2D_ARRAY_GRAD(textureName, samplerName, coord2, index, dpdx, dpdy) textureName.SampleGrad(samplerName, float3(coord2, index), dpdx, dpdy) + #define SAMPLE_TEXTURECUBE(textureName, samplerName, coord3) textureName.Sample(samplerName, coord3) + #define SAMPLE_TEXTURECUBE_LOD(textureName, samplerName, coord3, lod) textureName.SampleLevel(samplerName, coord3, lod) + #define SAMPLE_TEXTURECUBE_BIAS(textureName, samplerName, coord3, bias) textureName.SampleBias(samplerName, coord3, bias) + #define SAMPLE_TEXTURECUBE_ARRAY(textureName, samplerName, coord3, index) textureName.Sample(samplerName, float4(coord3, index)) + #define SAMPLE_TEXTURECUBE_ARRAY_LOD(textureName, samplerName, coord3, index, lod) textureName.SampleLevel(samplerName, float4(coord3, index), lod) + #define SAMPLE_TEXTURECUBE_ARRAY_BIAS(textureName, samplerName, coord3, index, bias) textureName.SampleBias(samplerName, float4(coord3, index), bias) + #define SAMPLE_TEXTURE3D(textureName, samplerName, coord3) textureName.Sample(samplerName, coord3) + #define SAMPLE_TEXTURE3D_LOD(textureName, samplerName, coord3, lod) textureName.SampleLevel(samplerName, coord3, lod) + + #define SAMPLE_TEXTURE2D_SHADOW(textureName, samplerName, coord3) textureName.SampleCmpLevelZero(samplerName, (coord3).xy, (coord3).z) + #define SAMPLE_TEXTURE2D_ARRAY_SHADOW(textureName, samplerName, coord3, index) textureName.SampleCmpLevelZero(samplerName, float3((coord3).xy, index), (coord3).z) + #define SAMPLE_TEXTURECUBE_SHADOW(textureName, samplerName, coord4) textureName.SampleCmpLevelZero(samplerName, (coord4).xyz, (coord4).w) + #define SAMPLE_TEXTURECUBE_ARRAY_SHADOW(textureName, samplerName, coord4, index) textureName.SampleCmpLevelZero(samplerName, float4((coord4).xyz, index), (coord4).w) + + + #define LOAD_TEXTURE2D(textureName, unCoord2) textureName.Load(int3(unCoord2, 0)) + #define LOAD_TEXTURE2D_LOD(textureName, unCoord2, lod) textureName.Load(int3(unCoord2, lod)) + #define LOAD_TEXTURE2D_MSAA(textureName, unCoord2, sampleIndex) textureName.Load(unCoord2, sampleIndex) + #define LOAD_TEXTURE2D_ARRAY(textureName, unCoord2, index) textureName.Load(int4(unCoord2, index, 0)) + #define LOAD_TEXTURE2D_ARRAY_LOD(textureName, unCoord2, index, lod) textureName.Load(int4(unCoord2, index, lod)) + #define LOAD_TEXTURE3D(textureName, unCoord3) textureName.Load(int4(unCoord3, 0)) + #define LOAD_TEXTURE3D_LOD(textureName, unCoord3, lod) textureName.Load(int4(unCoord3, lod)) + + #define PLATFORM_SUPPORT_GATHER + #define GATHER_TEXTURE2D(textureName, samplerName, coord2) textureName.Gather(samplerName, coord2) + #define GATHER_TEXTURE2D_ARRAY(textureName, samplerName, coord2, index) textureName.Gather(samplerName, float3(coord2, index)) + #define GATHER_TEXTURECUBE(textureName, samplerName, coord3) textureName.Gather(samplerName, coord3) + #define GATHER_TEXTURECUBE_ARRAY(textureName, samplerName, coord3, index) textureName.Gather(samplerName, float4(coord3, index)) + #define GATHER_RED_TEXTURE2D(textureName, samplerName, coord2) textureName.GatherRed(samplerName, coord2) + #define GATHER_GREEN_TEXTURE2D(textureName, samplerName, coord2) textureName.GatherGreen(samplerName, coord2) + #define GATHER_BLUE_TEXTURE2D(textureName, samplerName, coord2) textureName.GatherBlue(samplerName, coord2) + #define GATHER_ALPHA_TEXTURE2D(textureName, samplerName, coord2) textureName.GatherAlpha(samplerName, coord2) + +#elif defined(SHADER_API_GLCORE) + + // OpenGL 4.1 SM 5.0 https://docs.unity3d.com/Manual/SL-ShaderCompileTargets.html + #if (SHADER_TARGET >= 46) + #define OPENGL4_1_SM5 1 + #else + #define OPENGL4_1_SM5 0 + #endif + + // Initialize arbitrary structure with zero values. + // Do not exist on some platform, in this case we need to have a standard name that call a function that will initialize all parameters to 0 + #define ZERO_INITIALIZE(type, name) name = (type)0; + #define ZERO_INITIALIZE_ARRAY(type, name, arraySize) { for (int arrayIndex = 0; arrayIndex < arraySize; arrayIndex++) { name[arrayIndex] = (type)0; } } + + // Texture util abstraction + + #define CALCULATE_TEXTURE2D_LOD(textureName, samplerName, coord2) textureName.CalculateLevelOfDetail(samplerName, coord2) + + // Texture abstraction + + #define TEXTURE2D(textureName) Texture2D textureName + #define TEXTURE2D_ARRAY(textureName) Texture2DArray textureName + #define TEXTURECUBE(textureName) TextureCube textureName + #define TEXTURECUBE_ARRAY(textureName) TextureCubeArray textureName + #define TEXTURE3D(textureName) Texture3D textureName + + #define TEXTURE2D_FLOAT(textureName) TEXTURE2D(textureName) + #define TEXTURE2D_ARRAY_FLOAT(textureName) TEXTURE2D_ARRAY(textureName) + #define TEXTURECUBE_FLOAT(textureName) TEXTURECUBE(textureName) + #define TEXTURECUBE_ARRAY_FLOAT(textureName) TEXTURECUBE_ARRAY(textureName) + #define TEXTURE3D_FLOAT(textureName) TEXTURE3D(textureName) + + #define TEXTURE2D_HALF(textureName) TEXTURE2D(textureName) + #define TEXTURE2D_ARRAY_HALF(textureName) TEXTURE2D_ARRAY(textureName) + #define TEXTURECUBE_HALF(textureName) TEXTURECUBE(textureName) + #define TEXTURECUBE_ARRAY_HALF(textureName) TEXTURECUBE_ARRAY(textureName) + #define TEXTURE3D_HALF(textureName) TEXTURE3D(textureName) + + #define TEXTURE2D_SHADOW(textureName) TEXTURE2D(textureName) + #define TEXTURE2D_ARRAY_SHADOW(textureName) TEXTURE2D_ARRAY(textureName) + #define TEXTURECUBE_SHADOW(textureName) TEXTURECUBE(textureName) + #define TEXTURECUBE_ARRAY_SHADOW(textureName) TEXTURECUBE_ARRAY(textureName) + + #define RW_TEXTURE2D(type, textureName) RWTexture2D textureName + #define RW_TEXTURE2D_ARRAY(type, textureName) RWTexture2DArray textureName + #define RW_TEXTURE3D(type, textureName) RWTexture3D textureName + + #define SAMPLER(samplerName) SamplerState samplerName + #define SAMPLER_CMP(samplerName) SamplerComparisonState samplerName + + #define TEXTURE2D_PARAM(textureName, samplerName) TEXTURE2D(textureName), SAMPLER(samplerName) + #define TEXTURE2D_ARRAY_PARAM(textureName, samplerName) TEXTURE2D_ARRAY(textureName), SAMPLER(samplerName) + #define TEXTURECUBE_PARAM(textureName, samplerName) TEXTURECUBE(textureName), SAMPLER(samplerName) + #define TEXTURECUBE_ARRAY_PARAM(textureName, samplerName) TEXTURECUBE_ARRAY(textureName), SAMPLER(samplerName) + #define TEXTURE3D_PARAM(textureName, samplerName) TEXTURE3D(textureName), SAMPLER(samplerName) + + #define TEXTURE2D_SHADOW_PARAM(textureName, samplerName) TEXTURE2D(textureName), SAMPLER_CMP(samplerName) + #define TEXTURE2D_ARRAY_SHADOW_PARAM(textureName, samplerName) TEXTURE2D_ARRAY(textureName), SAMPLER_CMP(samplerName) + #define TEXTURECUBE_SHADOW_PARAM(textureName, samplerName) TEXTURECUBE(textureName), SAMPLER_CMP(samplerName) + #define TEXTURECUBE_ARRAY_SHADOW_PARAM(textureName, samplerName) TEXTURECUBE_ARRAY(textureName), SAMPLER_CMP(samplerName) + + #define TEXTURE2D_ARGS(textureName, samplerName) textureName, samplerName + #define TEXTURE2D_ARRAY_ARGS(textureName, samplerName) textureName, samplerName + #define TEXTURECUBE_ARGS(textureName, samplerName) textureName, samplerName + #define TEXTURECUBE_ARRAY_ARGS(textureName, samplerName) textureName, samplerName + #define TEXTURE3D_ARGS(textureName, samplerName) textureName, samplerName + + #define TEXTURE2D_SHADOW_ARGS(textureName, samplerName) textureName, samplerName + #define TEXTURE2D_ARRAY_SHADOW_ARGS(textureName, samplerName) textureName, samplerName + #define TEXTURECUBE_SHADOW_ARGS(textureName, samplerName) textureName, samplerName + #define TEXTURECUBE_ARRAY_SHADOW_ARGS(textureName, samplerName) textureName, samplerName + + #define SAMPLE_TEXTURE2D(textureName, samplerName, coord2) textureName.Sample(samplerName, coord2) + #define SAMPLE_TEXTURE2D_LOD(textureName, samplerName, coord2, lod) textureName.SampleLevel(samplerName, coord2, lod) + #define SAMPLE_TEXTURE2D_BIAS(textureName, samplerName, coord2, bias) textureName.SampleBias(samplerName, coord2, bias) + #define SAMPLE_TEXTURE2D_GRAD(textureName, samplerName, coord2, ddx, ddy) textureName.SampleGrad(samplerName, coord2, ddx, ddy) + #define SAMPLE_TEXTURE2D_ARRAY(textureName, samplerName, coord2, index) textureName.Sample(samplerName, float3(coord2, index)) + #define SAMPLE_TEXTURE2D_ARRAY_LOD(textureName, samplerName, coord2, index, lod) textureName.SampleLevel(samplerName, float3(coord2, index), lod) + #define SAMPLE_TEXTURE2D_ARRAY_BIAS(textureName, samplerName, coord2, index, bias) textureName.SampleBias(samplerName, float3(coord2, index), bias) + #define SAMPLE_TEXTURE2D_ARRAY_GRAD(textureName, samplerName, coord2, index, dpdx, dpdy) textureName.SampleGrad(samplerName, float3(coord2, index), dpdx, dpdy) + #define SAMPLE_TEXTURECUBE(textureName, samplerName, coord3) textureName.Sample(samplerName, coord3) + #define SAMPLE_TEXTURECUBE_LOD(textureName, samplerName, coord3, lod) textureName.SampleLevel(samplerName, coord3, lod) + #define SAMPLE_TEXTURECUBE_BIAS(textureName, samplerName, coord3, bias) textureName.SampleBias(samplerName, coord3, bias) + #ifdef UNITY_NO_CUBEMAP_ARRAY + #define SAMPLE_TEXTURECUBE_ARRAY(textureName, samplerName, coord3, index) ERROR_ON_UNSUPPORTED_FUNCTION(SAMPLE_TEXTURECUBE_ARRAY) + #define SAMPLE_TEXTURECUBE_ARRAY_LOD(textureName, samplerName, coord3, index, lod) ERROR_ON_UNSUPPORTED_FUNCTION(SAMPLE_TEXTURECUBE_ARRAY_LOD) + #define SAMPLE_TEXTURECUBE_ARRAY_LOD(textureName, samplerName, coord3, index, bias) ERROR_ON_UNSUPPORTED_FUNCTION(SAMPLE_TEXTURECUBE_ARRAY_LOD) + #else + #define SAMPLE_TEXTURECUBE_ARRAY(textureName, samplerName, coord3, index) textureName.Sample(samplerName, float4(coord3, index)) + #define SAMPLE_TEXTURECUBE_ARRAY_LOD(textureName, samplerName, coord3, index, lod) textureName.SampleLevel(samplerName, float4(coord3, index), lod) + #define SAMPLE_TEXTURECUBE_ARRAY_BIAS(textureName, samplerName, coord3, index, bias)textureName.SampleBias(samplerName, float4(coord3, index), bias) + #endif + #define SAMPLE_TEXTURE3D(textureName, samplerName, coord3) textureName.Sample(samplerName, coord3) + #define SAMPLE_TEXTURE3D_LOD(textureName, samplerName, coord3, lod) textureName.SampleLevel(samplerName, coord3, lod) + + #define SAMPLE_TEXTURE2D_SHADOW(textureName, samplerName, coord3) textureName.SampleCmpLevelZero(samplerName, (coord3).xy, (coord3).z) + #define SAMPLE_TEXTURE2D_ARRAY_SHADOW(textureName, samplerName, coord3, index) textureName.SampleCmpLevelZero(samplerName, float3((coord3).xy, index), (coord3).z) + #define SAMPLE_TEXTURECUBE_SHADOW(textureName, samplerName, coord4) textureName.SampleCmpLevelZero(samplerName, (coord4).xyz, (coord4).w) + #define SAMPLE_TEXTURECUBE_ARRAY_SHADOW(textureName, samplerName, coord4, index) textureName.SampleCmpLevelZero(samplerName, float4((coord4).xyz, index), (coord4).w) + + #define LOAD_TEXTURE2D(textureName, unCoord2) textureName.Load(int3(unCoord2, 0)) + #define LOAD_TEXTURE2D_LOD(textureName, unCoord2, lod) textureName.Load(int3(unCoord2, lod)) + #define LOAD_TEXTURE2D_MSAA(textureName, unCoord2, sampleIndex) textureName.Load(unCoord2, sampleIndex) + #define LOAD_TEXTURE2D_ARRAY(textureName, unCoord2, index) textureName.Load(int4(unCoord2, index, 0)) + #define LOAD_TEXTURE2D_ARRAY_MSAA(textureName, unCoord2, index, sampleIndex) textureName.Load(int3(unCoord2, index), sampleIndex) + #define LOAD_TEXTURE2D_ARRAY_LOD(textureName, unCoord2, index, lod) textureName.Load(int4(unCoord2, index, lod)) + + #if OPENGL4_1_SM5 + #define PLATFORM_SUPPORT_GATHER + #define GATHER_TEXTURE2D(textureName, samplerName, coord2) textureName.Gather(samplerName, coord2) + #define GATHER_TEXTURE2D_ARRAY(textureName, samplerName, coord2, index) textureName.Gather(samplerName, float3(coord2, index)) + #define GATHER_TEXTURECUBE(textureName, samplerName, coord3) textureName.Gather(samplerName, coord3) + #define GATHER_TEXTURECUBE_ARRAY(textureName, samplerName, coord3, index) textureName.Gather(samplerName, float4(coord3, index)) + #else + #define GATHER_TEXTURE2D(textureName, samplerName, coord2) ERROR_ON_UNSUPPORTED_FUNCTION(GATHER_TEXTURE2D) + #define GATHER_TEXTURE2D_ARRAY(textureName, samplerName, coord2, index) ERROR_ON_UNSUPPORTED_FUNCTION(GATHER_TEXTURE2D_ARRAY) + #define GATHER_TEXTURECUBE(textureName, samplerName, coord3) ERROR_ON_UNSUPPORTED_FUNCTION(GATHER_TEXTURECUBE) + #define GATHER_TEXTURECUBE_ARRAY(textureName, samplerName, coord3, index) ERROR_ON_UNSUPPORTED_FUNCTION(GATHER_TEXTURECUBE_ARRAY) + #endif + + + #elif defined(SHADER_API_GLES3) + + // GLES 3.1 + AEP shader feature https://docs.unity3d.com/Manual/SL-ShaderCompileTargets.html + #if (SHADER_TARGET >= 40) + #define GLES3_1_AEP 1 + #else + #define GLES3_1_AEP 0 + #endif + + // Initialize arbitrary structure with zero values. + // Do not exist on some platform, in this case we need to have a standard name that call a function that will initialize all parameters to 0 + #define ZERO_INITIALIZE(type, name) name = (type)0; + #define ZERO_INITIALIZE_ARRAY(type, name, arraySize) { for (int arrayIndex = 0; arrayIndex < arraySize; arrayIndex++) { name[arrayIndex] = (type)0; } } + + // Texture util abstraction + + #define CALCULATE_TEXTURE2D_LOD(textureName, samplerName, coord2) textureName.CalculateLevelOfDetail(samplerName, coord2) + + // Texture abstraction + + #define TEXTURE2D(textureName) Texture2D textureName + #define TEXTURE2D_ARRAY(textureName) Texture2DArray textureName + #define TEXTURECUBE(textureName) TextureCube textureName + #define TEXTURECUBE_ARRAY(textureName) TextureCubeArray textureName + #define TEXTURE3D(textureName) Texture3D textureName + + #define TEXTURE2D_FLOAT(textureName) Texture2D_float textureName + #define TEXTURE2D_ARRAY_FLOAT(textureName) Texture2DArray textureName // no support to _float on Array, it's being added + #define TEXTURECUBE_FLOAT(textureName) TextureCube_float textureName + #define TEXTURECUBE_ARRAY_FLOAT(textureName) TextureCubeArray textureName // no support to _float on Array, it's being added + #define TEXTURE3D_FLOAT(textureName) Texture3D_float textureName + + #define TEXTURE2D_HALF(textureName) Texture2D_half textureName + #define TEXTURE2D_ARRAY_HALF(textureName) Texture2DArray textureName // no support to _float on Array, it's being added + #define TEXTURECUBE_HALF(textureName) TextureCube_half textureName + #define TEXTURECUBE_ARRAY_HALF(textureName) TextureCubeArray textureName // no support to _float on Array, it's being added + #define TEXTURE3D_HALF(textureName) Texture3D_half textureName + + #define TEXTURE2D_SHADOW(textureName) TEXTURE2D(textureName) + #define TEXTURE2D_ARRAY_SHADOW(textureName) TEXTURE2D_ARRAY(textureName) + #define TEXTURECUBE_SHADOW(textureName) TEXTURECUBE(textureName) + #define TEXTURECUBE_ARRAY_SHADOW(textureName) TEXTURECUBE_ARRAY(textureName) + + #if GLES3_1_AEP + #define RW_TEXTURE2D(type, textureName) RWTexture2D textureName + #define RW_TEXTURE2D_ARRAY(type, textureName) RWTexture2DArray textureName + #define RW_TEXTURE3D(type, textureName) RWTexture3D textureName + #else + #define RW_TEXTURE2D(type, textureName) ERROR_ON_UNSUPPORTED_FUNCTION(RWTexture2D) + #define RW_TEXTURE2D_ARRAY(type, textureName) ERROR_ON_UNSUPPORTED_FUNCTION(RWTexture2DArray) + #define RW_TEXTURE3D(type, textureName) ERROR_ON_UNSUPPORTED_FUNCTION(RWTexture3D) + #endif + + #define SAMPLER(samplerName) SamplerState samplerName + #define SAMPLER_CMP(samplerName) SamplerComparisonState samplerName + + #define TEXTURE2D_PARAM(textureName, samplerName) TEXTURE2D(textureName), SAMPLER(samplerName) + #define TEXTURE2D_ARRAY_PARAM(textureName, samplerName) TEXTURE2D_ARRAY(textureName), SAMPLER(samplerName) + #define TEXTURECUBE_PARAM(textureName, samplerName) TEXTURECUBE(textureName), SAMPLER(samplerName) + #define TEXTURECUBE_ARRAY_PARAM(textureName, samplerName) TEXTURECUBE_ARRAY(textureName), SAMPLER(samplerName) + #define TEXTURE3D_PARAM(textureName, samplerName) TEXTURE3D(textureName), SAMPLER(samplerName) + + #define TEXTURE2D_SHADOW_PARAM(textureName, samplerName) TEXTURE2D(textureName), SAMPLER_CMP(samplerName) + #define TEXTURE2D_ARRAY_SHADOW_PARAM(textureName, samplerName) TEXTURE2D_ARRAY(textureName), SAMPLER_CMP(samplerName) + #define TEXTURECUBE_SHADOW_PARAM(textureName, samplerName) TEXTURECUBE(textureName), SAMPLER_CMP(samplerName) + #define TEXTURECUBE_ARRAY_SHADOW_PARAM(textureName, samplerName) TEXTURECUBE_ARRAY(textureName), SAMPLER_CMP(samplerName) + + #define TEXTURE2D_ARGS(textureName, samplerName) textureName, samplerName + #define TEXTURE2D_ARRAY_ARGS(textureName, samplerName) textureName, samplerName + #define TEXTURECUBE_ARGS(textureName, samplerName) textureName, samplerName + #define TEXTURECUBE_ARRAY_ARGS(textureName, samplerName) textureName, samplerName + #define TEXTURE3D_ARGS(textureName, samplerName) textureName, samplerName + + #define TEXTURE2D_SHADOW_ARGS(textureName, samplerName) textureName, samplerName + #define TEXTURE2D_ARRAY_SHADOW_ARGS(textureName, samplerName) textureName, samplerName + #define TEXTURECUBE_SHADOW_ARGS(textureName, samplerName) textureName, samplerName + #define TEXTURECUBE_ARRAY_SHADOW_ARGS(textureName, samplerName) textureName, samplerName + + #define SAMPLE_TEXTURE2D(textureName, samplerName, coord2) textureName.Sample(samplerName, coord2) + #define SAMPLE_TEXTURE2D_LOD(textureName, samplerName, coord2, lod) textureName.SampleLevel(samplerName, coord2, lod) + #define SAMPLE_TEXTURE2D_BIAS(textureName, samplerName, coord2, bias) textureName.SampleBias(samplerName, coord2, bias) + #define SAMPLE_TEXTURE2D_GRAD(textureName, samplerName, coord2, ddx, ddy) textureName.SampleGrad(samplerName, coord2, ddx, ddy) + #define SAMPLE_TEXTURE2D_ARRAY(textureName, samplerName, coord2, index) textureName.Sample(samplerName, float3(coord2, index)) + #define SAMPLE_TEXTURE2D_ARRAY_LOD(textureName, samplerName, coord2, index, lod) textureName.SampleLevel(samplerName, float3(coord2, index), lod) + #define SAMPLE_TEXTURE2D_ARRAY_BIAS(textureName, samplerName, coord2, index, bias) textureName.SampleBias(samplerName, float3(coord2, index), bias) + #define SAMPLE_TEXTURE2D_ARRAY_GRAD(textureName, samplerName, coord2, index, dpdx, dpdy) textureName.SampleGrad(samplerName, float3(coord2, index), dpdx, dpdy) + #define SAMPLE_TEXTURECUBE(textureName, samplerName, coord3) textureName.Sample(samplerName, coord3) + #define SAMPLE_TEXTURECUBE_LOD(textureName, samplerName, coord3, lod) textureName.SampleLevel(samplerName, coord3, lod) + #define SAMPLE_TEXTURECUBE_BIAS(textureName, samplerName, coord3, bias) textureName.SampleBias(samplerName, coord3, bias) + + #ifdef UNITY_NO_CUBEMAP_ARRAY + #define SAMPLE_TEXTURECUBE_ARRAY(textureName, samplerName, coord3, index) ERROR_ON_UNSUPPORTED_FUNCTION(SAMPLE_TEXTURECUBE_ARRAY) + #define SAMPLE_TEXTURECUBE_ARRAY_LOD(textureName, samplerName, coord3, index, lod) ERROR_ON_UNSUPPORTED_FUNCTION(SAMPLE_TEXTURECUBE_ARRAY_LOD) + #define SAMPLE_TEXTURECUBE_ARRAY_BIAS(textureName, samplerName, coord3, index, bias)ERROR_ON_UNSUPPORTED_FUNCTION(SAMPLE_TEXTURECUBE_ARRAY_BIAS) + #else + #define SAMPLE_TEXTURECUBE_ARRAY(textureName, samplerName, coord3, index) textureName.Sample(samplerName, float4(coord3, index)) + #define SAMPLE_TEXTURECUBE_ARRAY_LOD(textureName, samplerName, coord3, index, lod) textureName.SampleLevel(samplerName, float4(coord3, index), lod) + #define SAMPLE_TEXTURECUBE_ARRAY_BIAS(textureName, samplerName, coord3, index, bias)textureName.SampleBias(samplerName, float4(coord3, index), bias) + #endif + + #define SAMPLE_TEXTURE3D(textureName, samplerName, coord3) textureName.Sample(samplerName, coord3) + #define SAMPLE_TEXTURE3D_LOD(textureName, samplerName, coord3, lod) textureName.SampleLevel(samplerName, coord3, lod) + + #define SAMPLE_TEXTURE2D_SHADOW(textureName, samplerName, coord3) textureName.SampleCmpLevelZero(samplerName, (coord3).xy, (coord3).z) + #define SAMPLE_TEXTURE2D_ARRAY_SHADOW(textureName, samplerName, coord3, index) textureName.SampleCmpLevelZero(samplerName, float3((coord3).xy, index), (coord3).z) + #define SAMPLE_TEXTURECUBE_SHADOW(textureName, samplerName, coord4) textureName.SampleCmpLevelZero(samplerName, (coord4).xyz, (coord4).w) + #define SAMPLE_TEXTURECUBE_ARRAY_SHADOW(textureName, samplerName, coord4, index) textureName.SampleCmpLevelZero(samplerName, float4((coord4).xyz, index), (coord4).w) + + + #define LOAD_TEXTURE2D(textureName, unCoord2) textureName.Load(int3(unCoord2, 0)) + #define LOAD_TEXTURE2D_LOD(textureName, unCoord2, lod) textureName.Load(int3(unCoord2, lod)) + #define LOAD_TEXTURE2D_MSAA(textureName, unCoord2, sampleIndex) textureName.Load(unCoord2, sampleIndex) + #define LOAD_TEXTURE2D_ARRAY(textureName, unCoord2, index) textureName.Load(int4(unCoord2, index, 0)) + #define LOAD_TEXTURE2D_ARRAY_MSAA(textureName, unCoord2, index, sampleIndex) textureName.Load(int3(unCoord2, index), sampleIndex) + #define LOAD_TEXTURE2D_ARRAY_LOD(textureName, unCoord2, index, lod) textureName.Load(int4(unCoord2, index, lod)) + #define LOAD_TEXTURE3D(textureName, unCoord3) textureName.Load(int4(unCoord3, 0)) + #define LOAD_TEXTURE3D_LOD(textureName, unCoord3, lod) textureName.Load(int4(unCoord3, lod)) + + #if GLES3_1_AEP + #define PLATFORM_SUPPORT_GATHER + #define GATHER_TEXTURE2D(textureName, samplerName, coord2) textureName.Gather(samplerName, coord2) + #define GATHER_TEXTURE2D_ARRAY(textureName, samplerName, coord2, index) textureName.Gather(samplerName, float3(coord2, index)) + #define GATHER_TEXTURECUBE(textureName, samplerName, coord3) textureName.Gather(samplerName, coord3) + #define GATHER_TEXTURECUBE_ARRAY(textureName, samplerName, coord3, index) textureName.Gather(samplerName, float4(coord3, index)) + #define GATHER_RED_TEXTURE2D(textureName, samplerName, coord2) textureName.GatherRed(samplerName, coord2) + #define GATHER_GREEN_TEXTURE2D(textureName, samplerName, coord2) textureName.GatherGreen(samplerName, coord2) + #define GATHER_BLUE_TEXTURE2D(textureName, samplerName, coord2) textureName.GatherBlue(samplerName, coord2) + #define GATHER_ALPHA_TEXTURE2D(textureName, samplerName, coord2) textureName.GatherAlpha(samplerName, coord2) + #else + #define GATHER_TEXTURE2D(textureName, samplerName, coord2) ERROR_ON_UNSUPPORTED_FUNCTION(GATHER_TEXTURE2D) + #define GATHER_TEXTURE2D_ARRAY(textureName, samplerName, coord2, index) ERROR_ON_UNSUPPORTED_FUNCTION(GATHER_TEXTURE2D_ARRAY) + #define GATHER_TEXTURECUBE(textureName, samplerName, coord3) ERROR_ON_UNSUPPORTED_FUNCTION(GATHER_TEXTURECUBE) + #define GATHER_TEXTURECUBE_ARRAY(textureName, samplerName, coord3, index) ERROR_ON_UNSUPPORTED_FUNCTION(GATHER_TEXTURECUBE_ARRAY) + #define GATHER_RED_TEXTURE2D(textureName, samplerName, coord2) ERROR_ON_UNSUPPORTED_FUNCTION(GATHER_RED_TEXTURE2D) + #define GATHER_GREEN_TEXTURE2D(textureName, samplerName, coord2) ERROR_ON_UNSUPPORTED_FUNCTION(GATHER_GREEN_TEXTURE2D) + #define GATHER_BLUE_TEXTURE2D(textureName, samplerName, coord2) ERROR_ON_UNSUPPORTED_FUNCTION(GATHER_BLUE_TEXTURE2D) + #define GATHER_ALPHA_TEXTURE2D(textureName, samplerName, coord2) ERROR_ON_UNSUPPORTED_FUNCTION(GATHER_ALPHA_TEXTURE2D) + #endif + + +#elif defined(SHADER_API_GLES) + + + #define uint int + + #define rcp(x) 1.0 / (x) + #define ddx_fine ddx + #define ddy_fine ddy + #define asfloat + #define asuint(x) asint(x) + #define f32tof16 + #define f16tof32 + + #define ERROR_ON_UNSUPPORTED_FUNCTION(funcName) #error #funcName is not supported on GLES 2.0 + + // Initialize arbitrary structure with zero values. + // Do not exist on some platform, in this case we need to have a standard name that call a function that will initialize all parameters to 0 + #define ZERO_INITIALIZE(type, name) name = (type)0; + #define ZERO_INITIALIZE_ARRAY(type, name, arraySize) { for (int arrayIndex = 0; arrayIndex < arraySize; arrayIndex++) { name[arrayIndex] = (type)0; } } + + + // Texture util abstraction + + #define CALCULATE_TEXTURE2D_LOD(textureName, samplerName, coord2) #error calculate Level of Detail not supported in GLES2 + + // Texture abstraction + + #define TEXTURE2D(textureName) sampler2D textureName + #define TEXTURE2D_ARRAY(textureName) samplerCUBE textureName // No support to texture2DArray + #define TEXTURECUBE(textureName) samplerCUBE textureName + #define TEXTURECUBE_ARRAY(textureName) samplerCUBE textureName // No supoport to textureCubeArray and can't emulate with texture2DArray + #define TEXTURE3D(textureName) sampler3D textureName + + #define TEXTURE2D_FLOAT(textureName) sampler2D_float textureName + #define TEXTURE2D_ARRAY_FLOAT(textureName) TEXTURECUBE_FLOAT(textureName) // No support to texture2DArray + #define TEXTURECUBE_FLOAT(textureName) samplerCUBE_float textureName + #define TEXTURECUBE_ARRAY_FLOAT(textureName) TEXTURECUBE_FLOAT(textureName) // No support to textureCubeArray + #define TEXTURE3D_FLOAT(textureName) sampler3D_float textureName + + #define TEXTURE2D_HALF(textureName) sampler2D_half textureName + #define TEXTURE2D_ARRAY_HALF(textureName) TEXTURECUBE_HALF(textureName) // No support to texture2DArray + #define TEXTURECUBE_HALF(textureName) samplerCUBE_half textureName + #define TEXTURECUBE_ARRAY_HALF(textureName) TEXTURECUBE_HALF(textureName) // No support to textureCubeArray + #define TEXTURE3D_HALF(textureName) sampler3D_half textureName + + #define TEXTURE2D_SHADOW(textureName) SHADOW2D_TEXTURE_AND_SAMPLER textureName + #define TEXTURE2D_ARRAY_SHADOW(textureName) TEXTURECUBE_SHADOW(textureName) // No support to texture array + #define TEXTURECUBE_SHADOW(textureName) SHADOWCUBE_TEXTURE_AND_SAMPLER textureName + #define TEXTURECUBE_ARRAY_SHADOW(textureName) TEXTURECUBE_SHADOW(textureName) // No support to texture array + + #define RW_TEXTURE2D(type, textureNam) ERROR_ON_UNSUPPORTED_FUNCTION(RWTexture2D) + #define RW_TEXTURE2D_ARRAY(type, textureName) ERROR_ON_UNSUPPORTED_FUNCTION(RWTexture2DArray) + #define RW_TEXTURE3D(type, textureNam) ERROR_ON_UNSUPPORTED_FUNCTION(RWTexture3D) + + #define SAMPLER(samplerName) + #define SAMPLER_CMP(samplerName) + + #define TEXTURE2D_PARAM(textureName, samplerName) sampler2D textureName + #define TEXTURE2D_ARRAY_PARAM(textureName, samplerName) samplerCUBE textureName + #define TEXTURECUBE_PARAM(textureName, samplerName) samplerCUBE textureName + #define TEXTURECUBE_ARRAY_PARAM(textureName, samplerName) samplerCUBE textureName + #define TEXTURE3D_PARAM(textureName, samplerName) sampler3D textureName + #define TEXTURE2D_SHADOW_PARAM(textureName, samplerName) SHADOW2D_TEXTURE_AND_SAMPLER textureName + #define TEXTURE2D_ARRAY_SHADOW_PARAM(textureName, samplerName) SHADOWCUBE_TEXTURE_AND_SAMPLER textureName + #define TEXTURECUBE_SHADOW_PARAM(textureName, samplerName) SHADOWCUBE_TEXTURE_AND_SAMPLER textureName + + #define TEXTURE2D_ARGS(textureName, samplerName) textureName + #define TEXTURE2D_ARRAY_ARGS(textureName, samplerName) textureName + #define TEXTURECUBE_ARGS(textureName, samplerName) textureName + #define TEXTURECUBE_ARRAY_ARGS(textureName, samplerName) textureName + #define TEXTURE3D_ARGS(textureName, samplerName) textureName + #define TEXTURE2D_SHADOW_ARGS(textureName, samplerName) textureName + #define TEXTURE2D_ARRAY_SHADOW_ARGS(textureName, samplerName) textureName + #define TEXTURECUBE_SHADOW_ARGS(textureName, samplerName) textureName + + #define SAMPLE_TEXTURE2D(textureName, samplerName, coord2) tex2D(textureName, coord2) + + #if (SHADER_TARGET >= 30) + #define SAMPLE_TEXTURE2D_LOD(textureName, samplerName, coord2, lod) tex2Dlod(textureName, float4(coord2, 0, lod)) + #else + // No lod support. Very poor approximation with bias. + #define SAMPLE_TEXTURE2D_LOD(textureName, samplerName, coord2, lod) SAMPLE_TEXTURE2D_BIAS(textureName, samplerName, coord2, lod) + #endif + + #define SAMPLE_TEXTURE2D_BIAS(textureName, samplerName, coord2, bias) tex2Dbias(textureName, float4(coord2, 0, bias)) + #define SAMPLE_TEXTURE2D_GRAD(textureName, samplerName, coord2, ddx, ddy) SAMPLE_TEXTURE2D(textureName, samplerName, coord2) + #define SAMPLE_TEXTURE2D_ARRAY(textureName, samplerName, coord2, index) ERROR_ON_UNSUPPORTED_FUNCTION(SAMPLE_TEXTURE2D_ARRAY) + #define SAMPLE_TEXTURE2D_ARRAY_LOD(textureName, samplerName, coord2, index, lod) ERROR_ON_UNSUPPORTED_FUNCTION(SAMPLE_TEXTURE2D_ARRAY_LOD) + #define SAMPLE_TEXTURE2D_ARRAY_BIAS(textureName, samplerName, coord2, index, bias) ERROR_ON_UNSUPPORTED_FUNCTION(SAMPLE_TEXTURE2D_ARRAY_BIAS) + #define SAMPLE_TEXTURE2D_ARRAY_GRAD(textureName, samplerName, coord2, index, dpdx, dpdy) ERROR_ON_UNSUPPORTED_FUNCTION(SAMPLE_TEXTURE2D_ARRAY_GRAD) + #define SAMPLE_TEXTURECUBE(textureName, samplerName, coord3) texCUBE(textureName, coord3) + // No lod support. Very poor approximation with bias. + #define SAMPLE_TEXTURECUBE_LOD(textureName, samplerName, coord3, lod) SAMPLE_TEXTURECUBE_BIAS(textureName, samplerName, coord3, lod) + #define SAMPLE_TEXTURECUBE_BIAS(textureName, samplerName, coord3, bias) texCUBEbias(textureName, float4(coord3, bias)) + #define SAMPLE_TEXTURECUBE_ARRAY(textureName, samplerName, coord3, index) ERROR_ON_UNSUPPORTED_FUNCTION(SAMPLE_TEXTURECUBE_ARRAY) + #define SAMPLE_TEXTURECUBE_ARRAY_LOD(textureName, samplerName, coord3, index, lod) ERROR_ON_UNSUPPORTED_FUNCTION(SAMPLE_TEXTURECUBE_ARRAY_LOD) + #define SAMPLE_TEXTURECUBE_ARRAY_BIAS(textureName, samplerName, coord3, index, bias) ERROR_ON_UNSUPPORTED_FUNCTION(SAMPLE_TEXTURECUBE_ARRAY_BIAS) + #define SAMPLE_TEXTURE3D(textureName, samplerName, coord3) tex3D(textureName, coord3) + #define SAMPLE_TEXTURE3D_LOD(textureName, samplerName, coord3, lod) ERROR_ON_UNSUPPORTED_FUNCTION(SAMPLE_TEXTURE3D_LOD) + + #define SAMPLE_TEXTURE2D_SHADOW(textureName, samplerName, coord3) SHADOW2D_SAMPLE(textureName, samplerName, coord3) + #define SAMPLE_TEXTURE2D_ARRAY_SHADOW(textureName, samplerName, coord3, index) ERROR_ON_UNSUPPORTED_FUNCTION(SAMPLE_TEXTURE2D_ARRAY_SHADOW) + #define SAMPLE_TEXTURECUBE_SHADOW(textureName, samplerName, coord4) SHADOWCUBE_SAMPLE(textureName, samplerName, coord4) + #define SAMPLE_TEXTURECUBE_ARRAY_SHADOW(textureName, samplerName, coord4, index) ERROR_ON_UNSUPPORTED_FUNCTION(SAMPLE_TEXTURECUBE_ARRAY_SHADOW) + + + // Not supported. Can't define as error because shader library is calling these functions. + #define LOAD_TEXTURE2D(textureName, unCoord2) half4(0, 0, 0, 0) + #define LOAD_TEXTURE2D_LOD(textureName, unCoord2, lod) half4(0, 0, 0, 0) + #define LOAD_TEXTURE2D_MSAA(textureName, unCoord2, sampleIndex) half4(0, 0, 0, 0) + #define LOAD_TEXTURE2D_ARRAY(textureName, unCoord2, index) half4(0, 0, 0, 0) + #define LOAD_TEXTURE2D_ARRAY_MSAA(textureName, unCoord2, index, sampleIndex) half4(0, 0, 0, 0) + #define LOAD_TEXTURE2D_ARRAY_LOD(textureName, unCoord2, index, lod) half4(0, 0, 0, 0) + #define LOAD_TEXTURE3D(textureName, unCoord3) ERROR_ON_UNSUPPORTED_FUNCTION(LOAD_TEXTURE3D) + #define LOAD_TEXTURE3D_LOD(textureName, unCoord3, lod) ERROR_ON_UNSUPPORTED_FUNCTION(LOAD_TEXTURE3D_LOD) + + // Gather not supported. Fallback to regular texture sampling. + #define GATHER_TEXTURE2D(textureName, samplerName, coord2) ERROR_ON_UNSUPPORTED_FUNCTION(GATHER_TEXTURE2D) + #define GATHER_TEXTURE2D_ARRAY(textureName, samplerName, coord2, index) ERROR_ON_UNSUPPORTED_FUNCTION(GATHER_TEXTURE2D_ARRAY) + #define GATHER_TEXTURECUBE(textureName, samplerName, coord3) ERROR_ON_UNSUPPORTED_FUNCTION(GATHER_TEXTURECUBE) + #define GATHER_TEXTURECUBE_ARRAY(textureName, samplerName, coord3, index) ERROR_ON_UNSUPPORTED_FUNCTION(GATHER_TEXTURECUBE_ARRAY) + #define GATHER_RED_TEXTURE2D(textureName, samplerName, coord2) ERROR_ON_UNSUPPORTED_FUNCTION(GATHER_RED_TEXTURE2D) + #define GATHER_GREEN_TEXTURE2D(textureName, samplerName, coord2) ERROR_ON_UNSUPPORTED_FUNCTION(GATHER_GREEN_TEXTURE2D) + #define GATHER_BLUE_TEXTURE2D(textureName, samplerName, coord2) ERROR_ON_UNSUPPORTED_FUNCTION(GATHER_BLUE_TEXTURE2D) + #define GATHER_ALPHA_TEXTURE2D(textureName, samplerName, coord2) ERROR_ON_UNSUPPORTED_FUNCTION(GATHER_ALPHA_TEXTURE2D) + +#else +#error unsupported shader api +#endif + + + + +// default flow control attributes +#ifndef UNITY_BRANCH +# define UNITY_BRANCH +#endif +#ifndef UNITY_FLATTEN +# define UNITY_FLATTEN +#endif +#ifndef UNITY_UNROLL +# define UNITY_UNROLL +#endif +#ifndef UNITY_UNROLLX +# define UNITY_UNROLLX(_x) +#endif +#ifndef UNITY_LOOP +# define UNITY_LOOP +#endif + + + +#define _USINGTEXCOORD1 1 +#define _USINGTEXCOORD2 1 + + + + + + // data across stages, stripped like the above. + struct VertexToPixel + { + V2F_SHADOW_CASTER; // may declare TEXCOORD0 for the wonderfully named .vec + float3 worldPos : TEXCOORD1; + float3 worldNormal : TEXCOORD2; + float4 worldTangent : TEXCOORD3; + float4 texcoord0 : TEXCOORD4; + float4 texcoord1 : TEXCOORD5; + float4 texcoord2 : TEXCOORD6; + + // #if %TEXCOORD3REQUIREKEY% + float4 texcoord3 : TEXCOORD7; + // #endif + + // #if %SCREENPOSREQUIREKEY% + // float4 screenPos : TEXCOORD8; + // #endif + + // #if %VERTEXCOLORREQUIREKEY% + float4 vertexColor : COLOR; + // #endif + + // #if %EXTRAV2F0REQUIREKEY% + // float4 extraV2F0 : TEXCOORD9; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // float4 extraV2F1 : TEXCOORD10; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // float4 extraV2F2 : TEXCOORD11; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // float4 extraV2F3 : TEXCOORD12; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // float4 extraV2F4 : TEXCOORD13; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // float4 extraV2F5 : TEXCOORD14; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // float4 extraV2F6 : TEXCOORD15; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // float4 extraV2F7 : TEXCOORD16; + // #endif + + UNITY_VERTEX_INPUT_INSTANCE_ID + UNITY_VERTEX_OUTPUT_STEREO + }; + + + + // data describing the user output of a pixel + struct Surface + { + half3 Albedo; + half Height; + half3 Normal; + half Smoothness; + half3 Emission; + half Metallic; + half3 Specular; + half Occlusion; + half SpecularPower; // for simple lighting + half Alpha; + float outputDepth; // if written, SV_Depth semantic is used. ShaderData.clipPos.z is unused value + // HDRP Only + half SpecularOcclusion; + half SubsurfaceMask; + half Thickness; + half CoatMask; + half CoatSmoothness; + half Anisotropy; + half IridescenceMask; + half IridescenceThickness; + int DiffusionProfileHash; + float SpecularAAThreshold; + float SpecularAAScreenSpaceVariance; + // requires _OVERRIDE_BAKEDGI to be defined, but is mapped in all pipelines + float3 DiffuseGI; + float3 BackDiffuseGI; + float3 SpecularGI; + float ior; + float3 transmittanceColor; + float atDistance; + float transmittanceMask; + // requires _OVERRIDE_SHADOWMASK to be defines + float4 ShadowMask; + + // for decals + float NormalAlpha; + float MAOSAlpha; + + + }; + + // Data the user declares in blackboard blocks + struct Blackboard + { + + float blackboardDummyData; + }; + + // data the user might need, this will grow to be big. But easy to strip + struct ShaderData + { + float4 clipPos; // SV_POSITION + float3 localSpacePosition; + float3 localSpaceNormal; + float3 localSpaceTangent; + + float3 worldSpacePosition; + float3 worldSpaceNormal; + float3 worldSpaceTangent; + float tangentSign; + + float3 worldSpaceViewDir; + float3 tangentSpaceViewDir; + + float4 texcoord0; + float4 texcoord1; + float4 texcoord2; + float4 texcoord3; + + float2 screenUV; + float4 screenPos; + + float4 vertexColor; + bool isFrontFace; + + float4 extraV2F0; + float4 extraV2F1; + float4 extraV2F2; + float4 extraV2F3; + float4 extraV2F4; + float4 extraV2F5; + float4 extraV2F6; + float4 extraV2F7; + + float3x3 TBNMatrix; + Blackboard blackboard; + }; + + struct VertexData + { + #if SHADER_TARGET > 30 + // uint vertexID : SV_VertexID; + #endif + float4 vertex : POSITION; + float3 normal : NORMAL; + float4 tangent : TANGENT; + float4 texcoord0 : TEXCOORD0; + + // optimize out mesh coords when not in use by user or lighting system + #if _URP && (_USINGTEXCOORD1 || _PASSMETA || _PASSFORWARD || _PASSGBUFFER) + float4 texcoord1 : TEXCOORD1; + #endif + + #if _URP && (_USINGTEXCOORD2 || _PASSMETA || ((_PASSFORWARD || _PASSGBUFFER) && defined(DYNAMICLIGHTMAP_ON))) + float4 texcoord2 : TEXCOORD2; + #endif + + #if _STANDARD && (_USINGTEXCOORD1 || (_PASSMETA || ((_PASSFORWARD || _PASSGBUFFER || _PASSFORWARDADD) && LIGHTMAP_ON))) + float4 texcoord1 : TEXCOORD1; + #endif + #if _STANDARD && (_USINGTEXCOORD2 || (_PASSMETA || ((_PASSFORWARD || _PASSGBUFFER) && DYNAMICLIGHTMAP_ON))) + float4 texcoord2 : TEXCOORD2; + #endif + + + #if _HDRP + float4 texcoord1 : TEXCOORD1; + float4 texcoord2 : TEXCOORD2; + #endif + + // #if %TEXCOORD3REQUIREKEY% + float4 texcoord3 : TEXCOORD3; + // #endif + + // #if %VERTEXCOLORREQUIREKEY% + float4 vertexColor : COLOR; + // #endif + + #if _PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR)) + float3 previousPositionOS : TEXCOORD4; // Contain previous transform position (in case of skinning for example) + #if defined (_ADD_PRECOMPUTED_VELOCITY) + float3 precomputedVelocity : TEXCOORD5; // Add Precomputed Velocity (Alembic computes velocities on runtime side). + #endif + #endif + + UNITY_VERTEX_INPUT_INSTANCE_ID + }; + + struct TessVertex + { + float4 vertex : INTERNALTESSPOS; + float3 normal : NORMAL; + float4 tangent : TANGENT; + float4 texcoord0 : TEXCOORD0; + float4 texcoord1 : TEXCOORD1; + float4 texcoord2 : TEXCOORD2; + + // #if %TEXCOORD3REQUIREKEY% + float4 texcoord3 : TEXCOORD3; + // #endif + + // #if %VERTEXCOLORREQUIREKEY% + float4 vertexColor : COLOR; + // #endif + + // #if %EXTRAV2F0REQUIREKEY% + // float4 extraV2F0 : TEXCOORD5; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // float4 extraV2F1 : TEXCOORD6; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // float4 extraV2F2 : TEXCOORD7; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // float4 extraV2F3 : TEXCOORD8; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // float4 extraV2F4 : TEXCOORD9; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // float4 extraV2F5 : TEXCOORD10; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // float4 extraV2F6 : TEXCOORD11; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // float4 extraV2F7 : TEXCOORD12; + // #endif + + #if _PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR)) + float3 previousPositionOS : TEXCOORD13; // Contain previous transform position (in case of skinning for example) + #if defined (_ADD_PRECOMPUTED_VELOCITY) + float3 precomputedVelocity : TEXCOORD14; + #endif + #endif + + UNITY_VERTEX_INPUT_INSTANCE_ID + UNITY_VERTEX_OUTPUT_STEREO + }; + + struct ExtraV2F + { + float4 extraV2F0; + float4 extraV2F1; + float4 extraV2F2; + float4 extraV2F3; + float4 extraV2F4; + float4 extraV2F5; + float4 extraV2F6; + float4 extraV2F7; + Blackboard blackboard; + float4 time; + }; + + + float3 WorldToTangentSpace(ShaderData d, float3 normal) + { + return mul(d.TBNMatrix, normal); + } + + float3 TangentToWorldSpace(ShaderData d, float3 normal) + { + return mul(normal, d.TBNMatrix); + } + + // in this case, make standard more like SRPs, because we can't fix + // unity_WorldToObject in HDRP, since it already does macro-fu there + + #if _STANDARD + float3 TransformWorldToObject(float3 p) { return mul(unity_WorldToObject, float4(p, 1)); }; + float3 TransformObjectToWorld(float3 p) { return mul(unity_ObjectToWorld, float4(p, 1)); }; + float4 TransformWorldToObject(float4 p) { return mul(unity_WorldToObject, p); }; + float4 TransformObjectToWorld(float4 p) { return mul(unity_ObjectToWorld, p); }; + float4x4 GetWorldToObjectMatrix() { return unity_WorldToObject; } + float4x4 GetObjectToWorldMatrix() { return unity_ObjectToWorld; } + #if (defined(SHADER_API_D3D11) || defined(SHADER_API_XBOXONE) || defined(UNITY_COMPILER_HLSLCC) || defined(SHADER_API_PSSL) || (SHADER_TARGET_SURFACE_ANALYSIS && !SHADER_TARGET_SURFACE_ANALYSIS_MOJOSHADER)) + #define UNITY_SAMPLE_TEX2D_LOD(tex,coord, lod) tex.SampleLevel (sampler##tex,coord, lod) + #define UNITY_SAMPLE_TEX2D_SAMPLER_LOD(tex,samplertex,coord, lod) tex.SampleLevel (sampler##samplertex,coord, lod) + #else + #define UNITY_SAMPLE_TEX2D_LOD(tex,coord,lod) tex2D (tex,coord,0,lod) + #define UNITY_SAMPLE_TEX2D_SAMPLER_LOD(tex,samplertex,coord,lod) tex2D (tex,coord,0,lod) + #endif + + #undef UNITY_MATRIX_I_M + + #define UNITY_MATRIX_I_M unity_WorldToObject + + + #endif + + float3 GetCameraWorldPosition() + { + #if _HDRP + return GetCameraRelativePositionWS(_WorldSpaceCameraPos); + #else + return _WorldSpaceCameraPos; + #endif + } + + #if _GRABPASSUSED + #if _STANDARD + TEXTURE2D(%GRABTEXTURE%); + SAMPLER(sampler_%GRABTEXTURE%); + #endif + + half3 GetSceneColor(float2 uv) + { + #if _STANDARD + return SAMPLE_TEXTURE2D(%GRABTEXTURE%, sampler_%GRABTEXTURE%, uv).rgb; + #else + return SHADERGRAPH_SAMPLE_SCENE_COLOR(uv); + #endif + } + #endif + + + + #if _STANDARD + UNITY_DECLARE_DEPTH_TEXTURE(_CameraDepthTexture); + float GetSceneDepth(float2 uv) { return SAMPLE_DEPTH_TEXTURE(_CameraDepthTexture, uv); } + float GetLinear01Depth(float2 uv) { return Linear01Depth(GetSceneDepth(uv)); } + float GetLinearEyeDepth(float2 uv) { return LinearEyeDepth(GetSceneDepth(uv)); } + #else + float GetSceneDepth(float2 uv) { return SHADERGRAPH_SAMPLE_SCENE_DEPTH(uv); } + float GetLinear01Depth(float2 uv) { return Linear01Depth(GetSceneDepth(uv), _ZBufferParams); } + float GetLinearEyeDepth(float2 uv) { return LinearEyeDepth(GetSceneDepth(uv), _ZBufferParams); } + #endif + + float3 GetWorldPositionFromDepthBuffer(float2 uv, float3 worldSpaceViewDir) + { + float eye = GetLinearEyeDepth(uv); + float3 camView = mul((float3x3)UNITY_MATRIX_M, transpose(mul(UNITY_MATRIX_I_M, UNITY_MATRIX_I_V)) [2].xyz); + + float dt = dot(worldSpaceViewDir, camView); + float3 div = worldSpaceViewDir/dt; + float3 wpos = (eye * div) + GetCameraWorldPosition(); + return wpos; + } + + #if _HDRP + float3 ObjectToWorldSpacePosition(float3 pos) + { + return GetAbsolutePositionWS(TransformObjectToWorld(pos)); + } + #else + float3 ObjectToWorldSpacePosition(float3 pos) + { + return TransformObjectToWorld(pos); + } + #endif + + #if _STANDARD + UNITY_DECLARE_SCREENSPACE_TEXTURE(_CameraDepthNormalsTexture); + float3 GetSceneNormal(float2 uv, float3 worldSpaceViewDir) + { + float4 depthNorms = UNITY_SAMPLE_SCREENSPACE_TEXTURE(_CameraDepthNormalsTexture, uv); + float3 norms = DecodeViewNormalStereo(depthNorms); + norms = mul((float3x3)UNITY_MATRIX_V, norms) * 0.5 + 0.5; + return norms; + } + #elif _HDRP && !_DECALSHADER + + float3 GetSceneNormal(float2 uv, float3 worldSpaceViewDir) + { + NormalData nd; + DecodeFromNormalBuffer(_ScreenSize.xy * uv, nd); + return nd.normalWS; + } + #elif _URP + #if (SHADER_LIBRARY_VERSION_MAJOR >= 10) + #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/DeclareNormalsTexture.hlsl" + #endif + + float3 GetSceneNormal(float2 uv, float3 worldSpaceViewDir) + { + #if (SHADER_LIBRARY_VERSION_MAJOR >= 10) + return SampleSceneNormals(uv); + #else + float3 wpos = GetWorldPositionFromDepthBuffer(uv, worldSpaceViewDir); + return normalize(-cross(ddx(wpos), ddy(wpos))) * 0.5 + 0.5; + #endif + + } + #endif + + #if _HDRP + + half3 UnpackNormalmapRGorAG(half4 packednormal) + { + // This do the trick + packednormal.x *= packednormal.w; + + half3 normal; + normal.xy = packednormal.xy * 2 - 1; + normal.z = sqrt(1 - saturate(dot(normal.xy, normal.xy))); + return normal; + } + half3 UnpackNormal(half4 packednormal) + { + #if defined(UNITY_NO_DXT5nm) + return packednormal.xyz * 2 - 1; + #else + return UnpackNormalmapRGorAG(packednormal); + #endif + } + #endif + #if _HDRP || _URP + + half3 UnpackScaleNormal(half4 packednormal, half scale) + { + #ifndef UNITY_NO_DXT5nm + // Unpack normal as DXT5nm (1, y, 1, x) or BC5 (x, y, 0, 1) + // Note neutral texture like "bump" is (0, 0, 1, 1) to work with both plain RGB normal and DXT5nm/BC5 + packednormal.x *= packednormal.w; + #endif + half3 normal; + normal.xy = (packednormal.xy * 2 - 1) * scale; + normal.z = sqrt(1 - saturate(dot(normal.xy, normal.xy))); + return normal; + } + + #endif + + + void GetSun(out float3 lightDir, out float3 color) + { + lightDir = float3(0.5, 0.5, 0); + color = 1; + #if _HDRP + if (_DirectionalLightCount > 0) + { + DirectionalLightData light = _DirectionalLightDatas[0]; + lightDir = -light.forward.xyz; + color = light.color; + } + #elif _STANDARD + lightDir = normalize(_WorldSpaceLightPos0.xyz); + color = _LightColor0.rgb; + #elif _URP + Light light = GetMainLight(); + lightDir = light.direction; + color = light.color; + #endif + } + + + + + half4 _Color; + half4 _MainTex_ST, _MainTex_TexelSize; + half _Alpha, _AlphaCutoffValue; + + #if ATLAS_ON + half _MinXUV, _MaxXUV, _MinYUV, _MaxYUV; + #endif + + #if GLOW_ON + half4 _GlowColor; + half _Glow, _GlowGlobal; + #endif + + #if HSV_ON + half _HsvShift, _HsvSaturation, _HsvBright; + #endif + + #if DISTORT_ON + half4 _DistortTex_ST; + half _DistortTexXSpeed, _DistortTexYSpeed, _DistortAmount; + #endif + + #if FADE_ON + half4 _FadeBurnColor, _FadeTex_ST, _FadeBurnTex_ST; + half _FadeAmount, _FadeBurnWidth, _FadeBurnTransition,_FadeBurnGlow; + #endif + + #if OUTBASE_ON + half4 _OutlineColor; + half _OutlineAlpha, _OutlineGlow, _OutlineWidth; + int _OutlinePixelWidth; + #endif + + #if OUTTEX_ON + half4 _OutlineTex_ST; + half _OutlineTexXSpeed, _OutlineTexYSpeed; + #endif + + #if OUTDIST_ON + half4 _OutlineDistortTex_ST; + half _OutlineDistortTexXSpeed, _OutlineDistortTexYSpeed, _OutlineDistortAmount; + #endif + + #if ALPHAOUTLINE_ON + half _AlphaOutlineGlow, _AlphaOutlinePower, _AlphaOutlineMinAlpha, _AlphaOutlineBlend; + half4 _AlphaOutlineColor; + #endif + + #if INNEROUTLINE_ON + half _InnerOutlineThickness, _InnerOutlineAlpha, _InnerOutlineGlow; + half4 _InnerOutlineColor; + #endif + + #if GRADIENT_ON + half _GradBlend, _GradBoostX, _GradBoostY; + half4 _GradTopRightCol, _GradTopLeftCol, _GradBotRightCol, _GradBotLeftCol; + #endif + + #if COLORSWAP_ON + half4 _ColorSwapRed, _ColorSwapGreen, _ColorSwapBlue; + half _ColorSwapRedLuminosity, _ColorSwapGreenLuminosity, _ColorSwapBlueLuminosity, _ColorSwapBlend; + #endif + + #if CHANGECOLOR_ON + half4 _ColorChangeNewCol, _ColorChangeTarget; + half _ColorChangeTolerance, _ColorChangeLuminosity; + #endif + #if CHANGECOLOR2_ON + half4 _ColorChangeNewCol2, _ColorChangeTarget2; + half _ColorChangeTolerance2; + #endif + #if CHANGECOLOR3_ON + half4 _ColorChangeNewCol3, _ColorChangeTarget3; + half _ColorChangeTolerance3; + #endif + + #if COLORRAMP_ON + half _ColorRampLuminosity, _ColorRampBlend; + #endif + + #if HITEFFECT_ON + half4 _HitEffectColor; + half _HitEffectGlow, _HitEffectBlend; + #endif + + #if NEGATIVE_ON + half _NegativeAmount; + #endif + + #if PIXELATE_ON + half _PixelateSize; + #endif + + #if GREYSCALE_ON + half _GreyscaleLuminosity, _GreyscaleBlend; + half4 _GreyscaleTintColor; + #endif + + #if POSTERIZE_ON + half _PosterizeNumColors, _PosterizeGamma; + #endif + + #if BLUR_ON + half _BlurIntensity; + #endif + + #if MOTIONBLUR_ON + half _MotionBlurAngle, _MotionBlurDist; + #endif + + #if GHOST_ON + half _GhostColorBoost, _GhostTransparency, _GhostBlend; + #endif + + #if HOLOGRAM_ON + half _HologramStripesAmount, _HologramMinAlpha, _HologramUnmodAmount, _HologramStripesSpeed, _HologramMaxAlpha, _HologramBlend; + half4 _HologramStripeColor; + #endif + + #if CHROMABERR_ON + half _ChromAberrAmount, _ChromAberrAlpha; + #endif + + #if GLITCH_ON + half _GlitchAmount, _GlitchSize; + #endif + + #if FLICKER_ON + half _FlickerFreq, _FlickerPercent, _FlickerAlpha; + #endif + + #if SHADOW_ON + half _ShadowX, _ShadowY, _ShadowAlpha; + half4 _ShadowColor; + #endif + + #if SHINE_ON + half4 _ShineColor; + half _ShineLocation, _ShineRotate, _ShineWidth, _ShineGlow; + #endif + + #if CONTRAST_ON + half _Contrast, _Brightness; + #endif + + #if OVERLAY_ON + half4 _OverlayTex_ST, _OverlayColor; + half _OverlayGlow, _OverlayBlend, _OverlayTextureScrollXSpeed, _OverlayTextureScrollYSpeed; + #endif + + #if DOODLE_ON + half _HandDrawnAmount, _HandDrawnSpeed; + #endif + + #if WIND_ON + half _GrassSpeed, _GrassWind, _GrassManualAnim, _GrassRadialBend; + #endif + + #if WAVEUV_ON + float _WaveAmount, _WaveSpeed, _WaveStrength, _WaveX, _WaveY; + #endif + + #if ROUNDWAVEUV_ON + half _RoundWaveStrength, _RoundWaveSpeed; + #endif + + #if RECTSIZE_ON + half _RectSize; + #endif + + #if OFFSETUV_ON + half _OffsetUvX, _OffsetUvY; + #endif + + #if CLIPPING_ON + half _ClipUvLeft, _ClipUvRight, _ClipUvUp, _ClipUvDown; + #endif + + #if RADIALCLIPPING_ON + half _RadialStartAngle, _RadialClip, _RadialClip2; + #endif + + #if TEXTURESCROLL_ON + half _TextureScrollXSpeed, _TextureScrollYSpeed; + #endif + + #if ZOOMUV_ON + half _ZoomUvAmount; + #endif + + #if WARP_ON + half _WarpStrength, _WarpSpeed, _WarpScale; + #endif + + #if TWISTUV_ON + half _TwistUvAmount, _TwistUvPosX, _TwistUvPosY, _TwistUvRadius; + #endif + + #if ROTATEUV_ON + half _RotateUvAmount; + #endif + + #if FISHEYE_ON + half _FishEyeUvAmount; + #endif + + #if PINCH_ON + half _PinchUvAmount; + #endif + + #if SHAKEUV_ON + half _ShakeUvSpeed, _ShakeUvX, _ShakeUvY; + #endif + + #if NORMALMAP_ON + half _NormalStrength; + #endif + + float _RandomSeed; + + + + + + + + + + + TEXTURE2D(_MainTex); + SAMPLER(sampler_MainTex); + + #if GLOW_ON + TEXTURE2D(_GlowTex); + SAMPLER(sampler_GlowTex); + #endif + + #if FADE_ON + TEXTURE2D(_FadeTex); + SAMPLER(sampler_FadeTex); + + TEXTURE2D(_FadeBurnTex); + SAMPLER(sampler_FadeBurnTex); + #endif + + #if DISTORT_ON + TEXTURE2D(_DistortTex); + SAMPLER(sampler_DistortTex); + #endif + + #if OUTTEX_ON + TEXTURE2D(_OutlineTex); + SAMPLER(sampler_OutlineTex); + #endif + + #if OUTDIST_ON + TEXTURE2D(_OutlineDistortTex); + SAMPLER(sampler_OutlineDistortTex); + #endif + + #if COLORSWAP_ON + TEXTURE2D(_ColorSwapTex); + SAMPLER(sampler_ColorSwapTex); + #endif + + #if COLORRAMP_ON + TEXTURE2D(_ColorRampTex); + TEXTURE2D(_ColorRampTexGradient); + SAMPLER(sampler_ColorRampTex); + SAMPLER(sampler_ColorRampTexGradient); + #endif + + #if SHINE_ON + TEXTURE2D(_ShineMask); + SAMPLER(sampler_ShineMask); + #endif + + #if OVERLAY_ON + TEXTURE2D(_OverlayTex); + SAMPLER(sampler_OverlayTex); + #endif + + #if NORMALMAP_ON + TEXTURE2D(_NormalMap); + SAMPLER(sampler_NormalMap); + #endif + + + half3 GetPixel(in int offsetX, in int offsetY, in half2 uv, in Texture2D _tex, in SamplerState _sampler) + { + half2 _uv = uv + half2(offsetX * _MainTex_TexelSize.x, offsetY * _MainTex_TexelSize.y); + half4 col = SAMPLE_TEXTURE2D(_tex, _sampler, _uv); + return col.rgb; + } + + + //BLURS------------------------------------------------------------------------- + half4 Blur(half2 uv, Texture2D source, SamplerState sampler_source, half Intensity) + { + const half2 texelSize = 1.0 / _ScreenParams.xy; + const half4 color = SAMPLE_TEXTURE2D(source, sampler_source, uv); + const half2 offset = Intensity * texelSize; + + half4 accumulatedColor = color; + half accumulatedWeight = 1.0; + for (int x = -1; x <= 1; x++) + { + for (int y = -1; y <= 1; y++) + { + const half2 sampleUV = uv + half2(x, y) * offset; + const half4 sampleColor = SAMPLE_TEXTURE2D(source, sampler_source, sampleUV); + + accumulatedColor += sampleColor; + accumulatedWeight += 1.0; + } + } + + half4 blurredColor = accumulatedColor / accumulatedWeight; + return blurredColor; + } + + half BlurHD_G(half bhqp, half x) + { + return exp(-(x * x) / (2.0 * bhqp * bhqp)); + } + half4 BlurHD(half2 uv, Texture2D source, SamplerState sampler_source, half BlurAmount, half xScale, half yScale) + { + int iterations = 16; + int halfIterations = iterations / 2; + half sigmaX = 0.1 + BlurAmount * 0.5; + half sigmaY = sigmaX; + half total = 0.0; + half4 ret = half4(0, 0, 0, 0); + for (int iy = 0; iy < iterations; ++iy) + { + half fy = BlurHD_G(sigmaY, half(iy) -half(halfIterations)); + half offsetY = half(iy - halfIterations) * 0.00390625 * xScale; + for (int ix = 0; ix < iterations; ++ix) + { + half fx = BlurHD_G(sigmaX, half(ix) - half(halfIterations)); + half offsetX = half(ix - halfIterations) * 0.00390625 * yScale; + total += fx * fy; + ret += SAMPLE_TEXTURE2D(source, sampler_source, uv + half2(offsetX, offsetY)) * fx * fy; + } + } + return ret / total; + } + //----------------------------------------------------------------------- + + + //------------------------------------------- + half RemapFloat(half inValue, half inMin, half inMax, half outMin, half outMax){ + return outMin + (inValue - inMin) * (outMax - outMin) / (inMax - inMin); + } + //------------------------------------------- + + //----------------------------------------------------------------------- + half rand(half2 seed, half offset) { + return (frac(sin(dot(seed, half2(12.9898, 78.233))) * 43758.5453) + offset) % 1.0; + } + + half rand2(half2 seed, half offset) { + return (frac(sin(dot(seed * floor(50 + (_Time.x % 1.0) * 12.), half2(127.1, 311.7))) * 43758.5453123) + offset) % 1.0; + } + + half rand2CustomTime(half2 seed, half offset, half customTime) { + return (frac(sin(dot(seed * floor(50 + (customTime % 1.0) * 12.), half2(127.1, 311.7))) * 43758.5453123) + offset) % 1.0; + } + //----------------------------------------------------------------------- + + + void Ext_ModifyVertex0 (inout VertexData v, inout ExtraV2F d) + { + //BILBOARD_ON + #if BILBOARD_ON + half3 camRight = mul((half3x3)unity_CameraToWorld, half3(1,0,0)); + half3 camUp = half3(0,1,0); + #if BILBOARDY_ON + camUp = mul((half3x3)unity_CameraToWorld, half3(0,1,0)); + #endif + half3 localPos = v.vertex.x * camRight + v.vertex.y * camUp; + v.vertex = half4(localPos, 1); + #endif + //----------------------------------------------------------- + + v.texcoord0.xy = TRANSFORM_TEX(v.texcoord0.xy, _MainTex); + half2 center = half2(0.5, 0.5); + #if ATLAS_ON + center = half2((_MaxXUV + _MinXUV) / 2.0, (_MaxYUV + _MinYUV) / 2.0); + #endif + + //POLARUV_ON + #if POLARUV_ON + v.texcoord0.xy = v.texcoord0.xy - center; + #endif + + //---------------------------------------- + + //ROTATEUV_ON + #if ROTATEUV_ON + half2 uvC = v.texcoord0.xy; + half cosAngle = cos(_RotateUvAmount); + half sinAngle = sin(_RotateUvAmount); + half2x2 rot = half2x2(cosAngle, -sinAngle, sinAngle, cosAngle); + uvC -= center; + v.texcoord0.xy = mul(rot, uvC); + v.texcoord0.xy += center; + #endif + //-------------------- + + #if RECTSIZE_ON + v.vertex.xyz += (v.vertex.xyz * (_RectSize - 1.0)); + #endif + + #if OUTTEX_ON + v.texcoord1.xy = TRANSFORM_TEX(v.texcoord0.xy, _OutlineTex); + #endif + + #if OUTDIST_ON + v.texcoord2.xy = TRANSFORM_TEX(v.texcoord0.xy, _OutlineDistortTex); + #endif + + #if DISTORT_ON + v.texcoord3.xy = TRANSFORM_TEX(v.texcoord0.xy, _DistortTex); + #endif + } + + void Ext_SurfaceFunction0 (inout Surface o, ShaderData d) + { + half randomSeed = _RandomSeed; + + float2 uvRect = d.texcoord0; + half2 center = half2(0.5, 0.5); + #if ATLAS_ON + center = half2((_MaxXUV + _MinXUV) / 2.0, (_MaxYUV + _MinYUV) / 2.0); + uvRect = half2((d.texcoord0.x - _MinXUV) / (_MaxXUV - _MinXUV), (d.texcoord0.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half2 centerTiled = half2(center.x * _MainTex_ST.x, center.y * _MainTex_ST.y); + + //CLIPPING_ON + #if CLIPPING_ON + half2 tiledUv = half2(d.texcoord0.x / _MainTex_ST.x, d.texcoord0.y / _MainTex_ST.y); + #if ATLAS_ON + tiledUv = half2((tiledUv.x - _MinXUV) / (_MaxXUV - _MinXUV), (tiledUv.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + clip((1 - _ClipUvUp) - tiledUv.y); + clip(tiledUv.y - _ClipUvDown); + clip((1 - _ClipUvRight) - tiledUv.x); + clip(tiledUv.x - _ClipUvLeft); + #endif + //---------------------------------- + + //RADIALCLIPPING_ON + #if RADIALCLIPPING_ON + half2 tiledUv2 = half2(d.texcoord0.x / _MainTex_ST.x, d.texcoord0.y / _MainTex_ST.y); + #if ATLAS_ON + tiledUv2 = half2((tiledUv2.x - _MinXUV) / (_MaxXUV - _MinXUV), (tiledUv2.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half startAngle = _RadialStartAngle - _RadialClip; + half endAngle = _RadialStartAngle + _RadialClip2; + half offset0 = clamp(0, 360, startAngle + 360); + half offset360 = clamp(0, 360, endAngle - 360); + half2 atan2Coord = half2(lerp(-1, 1, tiledUv2.x), lerp(-1, 1, tiledUv2.y)); + half atanAngle = atan2(atan2Coord.y, atan2Coord.x) * 57.3; // angle in degrees + if(atanAngle < 0) atanAngle = 360 + atanAngle; + if(atanAngle >= startAngle && atanAngle <= endAngle) discard; + if(atanAngle <= offset360) discard; + if(atanAngle >= offset0) discard; + #endif + + //----------------------------- + + //TEXTURESCROLL_ON && ATLAS_ON + #if TEXTURESCROLL_ON && ATLAS_ON + d.texcoord0.xy = half2(_MinXUV + ((_MaxXUV - _MinXUV) * (abs(((_Time.y + randomSeed) * _TextureScrollXSpeed) + uvRect.x) % 1)), + _MinYUV + ((_MaxYUV - _MinYUV) * (abs(((_Time.y + randomSeed) * _TextureScrollYSpeed) + uvRect.y) % 1))); + #endif + //---------------------------- + + //OFFSETUV_ON + #if OFFSETUV_ON + #if ATLAS_ON + d.texcoord0.xy = half2(_MinXUV + ((_MaxXUV - _MinXUV) * (abs((_OffsetUvX + uvRect.x) % 1))), + _MinYUV + ((_MaxYUV - _MinYUV) * (abs(_OffsetUvY + uvRect.y) % 1))); + #else + d.texcoord0.xy += half2(_OffsetUvX, _OffsetUvY); + #endif + #endif + + //---------------------- + + //POLARUV_ON + #if POLARUV_ON + d.texcoord0.xy = half2(atan2(d.texcoord0.y, d.texcoord0.x) / (2.0f * 3.141592653589f), length(d.texcoord0.xy)); + d.texcoord0.xy *= _MainTex_ST.xy; + #endif + + //-------------------------------------- + + //TWISTUV_ON + #if TWISTUV_ON + #if ATLAS_ON + _TwistUvPosX = ((_MaxXUV - _MinXUV) * _TwistUvPosX) + _MinXUV; + _TwistUvPosY = ((_MaxYUV - _MinYUV) * _TwistUvPosY) + _MinYUV; + #endif + half2 tempUv = d.texcoord0.xy - half2(_TwistUvPosX * _MainTex_ST.x, _TwistUvPosY * _MainTex_ST.y); + _TwistUvRadius *= (_MainTex_ST.x + _MainTex_ST.y) / 2; + half percent = (_TwistUvRadius - length(tempUv)) / _TwistUvRadius; + half theta = percent * percent * (2.0 * sin(_TwistUvAmount)) * 8.0; + half s = sin(theta); + half c = cos(theta); + half beta = max(sign(_TwistUvRadius - length(tempUv)), 0.0); + tempUv = half2(dot(tempUv, half2(c, -s)), dot(tempUv, half2(s, c))) * beta + tempUv * (1 - beta); + tempUv += half2(_TwistUvPosX * _MainTex_ST.x, _TwistUvPosY * _MainTex_ST.y); + d.texcoord0.xy = tempUv; + #endif + + //-------------------------------------------- + + //FISHEYE_ON + #if FISHEYE_ON + half bind = length(centerTiled); + half2 dF = d.texcoord0.xy - centerTiled; + half dFlen = length(dF); + half fishInt = (3.14159265359 / bind) * (_FishEyeUvAmount + 0.001); + d.texcoord0.xy = centerTiled + (dF / (max(0.0001, dFlen))) * tan(dFlen * fishInt) * bind / tan(bind * fishInt); + #endif + //--------------------------------------------- + + //PINCH_ON + #if PINCH_ON + half2 dP = d.texcoord0.xy - centerTiled; + half pinchInt = (3.141592 / length(centerTiled)) * (-_PinchUvAmount + 0.001); + d.texcoord0.xy = centerTiled + normalize(dP) * atan(length(dP) * -pinchInt * 10.0) * 0.5 / atan(-pinchInt * 5); + #endif + + //--------------------------------------------- + + //ZOOMUV_ON + #if ZOOMUV_ON + d.texcoord0.xy -= centerTiled; + d.texcoord0.xy = d.texcoord0.xy * _ZoomUvAmount; + d.texcoord0.xy += centerTiled; + #endif + + //----------------------------------------------- + + //DOODLE_ON + #if DOODLE_ON + half2 uvCopy = uvRect; + _HandDrawnSpeed = (floor((_Time.x + randomSeed) * 20 * _HandDrawnSpeed) / _HandDrawnSpeed) * _HandDrawnSpeed; + uvCopy.x = sin((uvCopy.x * _HandDrawnAmount + _HandDrawnSpeed) * 4); + uvCopy.y = cos((uvCopy.y * _HandDrawnAmount + _HandDrawnSpeed) * 4); + d.texcoord0.xy = lerp(d.texcoord0.xy, d.texcoord0.xy + uvCopy, 0.0005 * _HandDrawnAmount); + #endif + + //-------------------------- + + //SHAKEUV_ON + #if SHAKEUV_ON + half xShake = sin((_Time.x + randomSeed) * _ShakeUvSpeed * 50) * _ShakeUvX; + half yShake = cos((_Time.x + randomSeed) * _ShakeUvSpeed * 50) * _ShakeUvY; + d.texcoord0.xy += half2(xShake * 0.012, yShake * 0.01); + #endif + + //------------------------------------------- + + //RECTSIZE_ON + #if RECTSIZE_ON + d.texcoord0.xy = d.texcoord0.xy * (_RectSize).xx + (((-_RectSize * 0.5) + 0.5)).xx; + #endif + + //------------------------------------------- + + //DISTORT_ON + #if DISTORT_ON + #if ATLAS_ON + d.texcoord3.x = d.texcoord3.x * (1 / (_MaxXUV - _MinXUV)); + d.texcoord3.y = d.texcoord3.y * (1 / (_MaxYUV - _MinYUV)); + #endif + + d.texcoord3.x += ((_Time.x + _RandomSeed) * _DistortTexXSpeed) % 1; + d.texcoord3.y += ((_Time.x + _RandomSeed) * _DistortTexYSpeed) % 1; + half distortAmnt = (SAMPLE_TEXTURE2D(_DistortTex, sampler_DistortTex, d.texcoord3.xy).r - 0.5) * 0.2 * _DistortAmount; + d.texcoord0.x += distortAmnt; + d.texcoord0.y += distortAmnt; + #endif + //------------------------------------------------------- + + //WARP_ON + #if WARP_ON + half2 warpUv = half2(d.texcoord0.x / _MainTex_ST.x, d.texcoord0.y / _MainTex_ST.y); + #if ATLAS_ON + warpUv = half2((warpUv.x - _MinXUV) / (_MaxXUV - _MinXUV), (warpUv.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + const float tau = 6.283185307179586; + float xWarp = (_Time.y + randomSeed) * _WarpSpeed + warpUv.x * tau / _WarpScale; + float yWarp = (_Time.y + randomSeed) * _WarpSpeed + warpUv.y * tau / _WarpScale; + float2 warp = float2(sin(xWarp), sin(yWarp)) * _WarpStrength; + d.texcoord0.xy += warp; + #endif + + //------------------------------------------------------- + + //WAVEUV_ON + #if WAVEUV_ON + float2 uvWave = half2(_WaveX * _MainTex_ST.x, _WaveY * _MainTex_ST.y) - d.texcoord0.xy; + uvWave %= 1; + #if ATLAS_ON + uvWave = half2(_WaveX, _WaveY) - uvRect; + #endif + uvWave.x *= _ScreenParams.x / _ScreenParams.y; + float waveTime = _Time.y + randomSeed; + float angWave = (sqrt(dot(uvWave, uvWave)) * _WaveAmount) - ((waveTime * _WaveSpeed)); + d.texcoord0.xy = d.texcoord0.xy + uvWave * sin(angWave) * (_WaveStrength / 1000.0); + #endif + //---------------------------------------------------- + + //ROUNDWAVEUV_ON + #if ROUNDWAVEUV_ON + half xWave = ((0.5 * _MainTex_ST.x) - uvRect.x); + half yWave = ((0.5 * _MainTex_ST.y) - uvRect.y) * (_MainTex_TexelSize.w / _MainTex_TexelSize.z); + half ripple = -sqrt(xWave*xWave + yWave* yWave); + d.texcoord0.xy += (sin((ripple + (_Time.y + randomSeed) * (_RoundWaveSpeed/10.0)) / 0.015) * (_RoundWaveStrength/10.0)) % 1; + #endif + //---------------------------------------------------- + + + //WIND_ON + #if WIND_ON + half windOffset = sin((_Time.x + randomSeed) * _GrassSpeed * 10); + half2 windCenter = half2(0.5, 0.1); + #if ATLAS_ON + windCenter.x = ((_MaxXUV - _MinXUV) * windCenter.x) + _MinXUV; + windCenter.y = ((_MaxYUV - _MinYUV) * windCenter.y) + _MinYUV; + #endif + #if !MANUALWIND_ON + d.texcoord0.x = fmod(abs(lerp(d.texcoord0.x, d.texcoord0.x + (_GrassWind * 0.01 * windOffset), uvRect.y)), 1); + #else + d.texcoord0.x = fmod(abs(lerp(d.texcoord0.x, d.texcoord0.x + (_GrassWind * 0.01 * _GrassManualAnim), uvRect.y)), 1); + windOffset = _GrassManualAnim; + #endif + half2 delta = d.texcoord0.xy - windCenter; + half delta2 = dot(delta.xy, delta.xy); + half2 delta_offset = delta2 * windOffset; + d.texcoord0.xy = d.texcoord0.xy + half2(delta.y, -delta.x) * delta_offset * _GrassRadialBend; + #endif + + //-------------------------------------------------------- + + //TEXTURESCROLL_ON && !ATLAS_ON + #if TEXTURESCROLL_ON && !ATLAS_ON + d.texcoord0.x += ((_Time.y + randomSeed) * _TextureScrollXSpeed) % 1; + d.texcoord0.y += ((_Time.y + randomSeed) * _TextureScrollYSpeed) % 1; + #endif + //------------------------------ + + //PIXELATE_ON + #if PIXELATE_ON + half aspectRatio = _MainTex_TexelSize.x / _MainTex_TexelSize.y; + half2 pixelSize = float2(_PixelateSize, _PixelateSize * aspectRatio); + d.texcoord0.xy = floor(d.texcoord0.xy * pixelSize) / pixelSize; + #endif + //-------------- + + half4 col = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy); + half originalAlpha = col.a; + col *= d.vertexColor; + + //NORMAL MAP + #if NORMALMAP_ON + half4 normalSample = SAMPLE_TEXTURE2D(_NormalMap, sampler_NormalMap, d.texcoord0.xy); + half3 normalTS = UnpackNormal(normalSample); + normalTS.xy *= _NormalStrength; + o.Normal = normalTS; + #endif + + + //GLITCH_ON + #if GLITCH_ON + half2 uvGlitch = uvRect; + uvGlitch.y -= 0.5; + half lineNoise = pow(rand2(floor(uvGlitch * half2(24., 19.) * _GlitchSize) * 4.0, randomSeed), 3.0) * _GlitchAmount + * pow(rand2(floor(uvGlitch * half2(38., 14.) * _GlitchSize) * 4.0, randomSeed), 3.0); + col = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(lineNoise * 0.02 * rand2(half2(2.0, 1), randomSeed), 0)) * d.vertexColor; + #endif + //-------------------------------------- + + //CHROMABERR_ON + #if CHROMABERR_ON + half4 r = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(_ChromAberrAmount/10, 0)) * d.vertexColor; + half4 b = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(-_ChromAberrAmount/10, 0)) * d.vertexColor; + col = half4(r.r * r.a, col.g, b.b * b.a, max(max(r.a, b.a) * _ChromAberrAlpha, col.a)); + #endif + + //-------------------------------- + + //BLUR_ON + #if BLUR_ON + #if ATLAS_ON + #if !BLURISHD_ON + col = BlurHD(d.texcoord0.xy, _MainTex, sampler_MainTex, _BlurIntensity, (_MaxXUV - _MinXUV), (_MaxYUV - _MinYUV)) * d.vertexColor; + #else + col = Blur(d.texcoord0.xy, _MainTex, sampler_MainTex, _BlurIntensity * (_MaxXUV - _MinXUV)) * d.vertexColor; + #endif + #else + #if !BLURISHD_ON + col = BlurHD(d.texcoord0.xy, _MainTex, sampler_MainTex, _BlurIntensity, 1, 1) * d.vertexColor; + #else + col = Blur(d.texcoord0.xy, _MainTex, sampler_MainTex, _BlurIntensity) * d.vertexColor; + #endif + #endif + #endif + + //-------------------- + + //MOTIONBLUR_ON + #if MOTIONBLUR_ON + _MotionBlurAngle = _MotionBlurAngle * 3.1415926; + #define rot(n) mul(n, half2x2(cos(_MotionBlurAngle), -sin(_MotionBlurAngle), sin(_MotionBlurAngle), cos(_MotionBlurAngle))) + _MotionBlurDist = _MotionBlurDist * 0.005; + #if ATLAS_ON + _MotionBlurDist *= (_MaxXUV - _MinXUV); + #endif + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(-_MotionBlurDist, -_MotionBlurDist))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(-_MotionBlurDist * 2, -_MotionBlurDist * 2))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(-_MotionBlurDist * 3, -_MotionBlurDist * 3))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(-_MotionBlurDist * 4, -_MotionBlurDist * 4))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(_MotionBlurDist, _MotionBlurDist))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(_MotionBlurDist * 2, _MotionBlurDist * 2))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(_MotionBlurDist * 3, _MotionBlurDist * 3))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(_MotionBlurDist * 4, _MotionBlurDist * 4))); + col.rgb = col.rgb / 9; + #endif + //------------------------------------ + + //NEGATIVE_ON + #if NEGATIVE_ON + col.rgb = lerp(col.rgb, 1 - col.rgb, _NegativeAmount); + #endif + + //-------------- + half luminance = 0; + + //GREYSCALE_ON && !GREYSCALEOUTLINE_ON + #if GREYSCALE_ON && !GREYSCALEOUTLINE_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + luminance = saturate(luminance + _GreyscaleLuminosity); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _GreyscaleTintColor, _GreyscaleBlend); + #endif + //------------------------------------ + + //GHOST_ON + #if GHOST_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + half4 ghostResult; + ghostResult.a = saturate(luminance - _GhostTransparency) * col.a; + ghostResult.rgb = col.rgb * (luminance + _GhostColorBoost); + col = lerp(col, ghostResult, _GhostBlend); + #endif + //------------------------------------ + + //INNEROUTLINE_ON + #if INNEROUTLINE_ON + half3 innerT = abs(GetPixel(0, _InnerOutlineThickness, d.texcoord0.xy, _MainTex, sampler_MainTex) - GetPixel(0, -_InnerOutlineThickness, d.texcoord0.xy, _MainTex, sampler_MainTex)); + innerT += abs(GetPixel(_InnerOutlineThickness, 0, d.texcoord0.xy, _MainTex, sampler_MainTex) - GetPixel(-_InnerOutlineThickness, 0, d.texcoord0.xy, _MainTex, sampler_MainTex)); + #if !ONLYINNEROUTLINE_ON + innerT = (innerT / 2.0) * col.a * _InnerOutlineAlpha; + col.rgb += length(innerT) * _InnerOutlineColor.rgb * _InnerOutlineGlow; + #else + innerT *= col.a * _InnerOutlineAlpha; + col.rgb = length(innerT) * _InnerOutlineColor.rgb * _InnerOutlineGlow; + col.a = step(0.3, col.r+col.g+col.b); + #endif + #endif + //------------------------------------------------------- + + //HITEFFECT_ON + #if HITEFFECT_ON + col.rgb = lerp(col.rgb, _HitEffectColor.rgb * _HitEffectGlow, _HitEffectBlend); + #endif + //-------------------- + + //GRADIENT_ON + #if GRADIENT_ON + half2 tiledUvGrad = half2(uvRect.x / _MainTex_ST.x, uvRect.y / _MainTex_ST.y); + #if GRADIENT2COL_ON + _GradTopRightCol = _GradTopLeftCol; + _GradBotRightCol = _GradBotLeftCol; + #endif + #if RADIALGRADIENT_ON + half radialDist = 1 - length(tiledUvGrad - half2(0.5, 0.5)); + radialDist *= (_MainTex_TexelSize.w / _MainTex_TexelSize.z); + radialDist = saturate(_GradBoostX * radialDist); + half4 gradientResult = lerp(_GradTopLeftCol, _GradBotLeftCol, radialDist); + #else + half gradXLerpFactor = saturate(pow(tiledUvGrad.x, _GradBoostX)); + half4 gradientResult = lerp(lerp(_GradBotLeftCol, _GradBotRightCol, gradXLerpFactor), + lerp(_GradTopLeftCol, _GradTopRightCol, gradXLerpFactor), saturate(pow(tiledUvGrad.y, _GradBoostY))); + #endif + gradientResult = lerp(col, gradientResult, _GradBlend); + col.rgb = gradientResult.rgb * col.a; + col.a *= gradientResult.a; + #endif + //-------------------------------------------------------------------- + + //CONTRAST_ON + #if CONTRAST_ON + col.rgb = (col.rgb - float3(0.5, 0.5, 0.5)) * _Contrast + float3(0.5, 0.5, 0.5); + col.rgb += _Brightness; + #endif + + //------------------------------------------------------------------- + + //COLORSWAP_ON + #if COLORSWAP_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + half4 swapMask = SAMPLE_TEXTURE2D(_ColorSwapTex, sampler_ColorSwapTex, d.texcoord0.xy); + swapMask.rgb *= swapMask.a; + half3 redSwap = _ColorSwapRed * swapMask.r * saturate(luminance + _ColorSwapRedLuminosity); + half3 greenSwap = _ColorSwapGreen * swapMask.g * saturate(luminance + _ColorSwapGreenLuminosity); + half3 blueSwap = _ColorSwapBlue * swapMask.b * saturate(luminance + _ColorSwapBlueLuminosity); + swapMask.rgb = col.rgb * saturate(1 - swapMask.r - swapMask.g - swapMask.b); + col.rgb = lerp(col.rgb, swapMask.rgb + redSwap + greenSwap + blueSwap, _ColorSwapBlend); + #endif + //-------------------------------------------------------------------- + + //COLORRAMP_ON && !COLORRAMPOUTLINE_ON + #if COLORRAMP_ON && !COLORRAMPOUTLINE_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + luminance = saturate(luminance + _ColorRampLuminosity); + #if GRADIENTCOLORRAMP_ON + col.rgb = lerp(col.rgb, SAMPLE_TEXTURE2D(_ColorRampTexGradient, sampler_ColorRampTexGradient, half2(luminance, 0)).rgb, _ColorRampBlend); + #else + col.rgb = lerp(col.rgb, SAMPLE_TEXTURE2D(_ColorRampTex, sampler_ColorRampTex, half2(luminance, 0)).rgb, _ColorRampBlend); + #endif + #endif + //-------------------------------------------------------------------- + + //CHANGECOLOR_ON + #if CHANGECOLOR_ON + float3 currChangeColor = saturate(col.rgb); + luminance = 0.3 * currChangeColor.r + 0.59 * currChangeColor.g + 0.11 * currChangeColor.b; + luminance = saturate(luminance + _ColorChangeLuminosity); + half3 dif = abs(currChangeColor - _ColorChangeTarget.rgb); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _ColorChangeNewCol.rgb, + max(sign(1 - saturate(dif.x + dif.y + dif.z) - _ColorChangeTolerance), 0.0)); + #if CHANGECOLOR2_ON + dif = abs(currChangeColor - _ColorChangeTarget2.rgb); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _ColorChangeNewCol2.rgb, + max(sign(1 - saturate(dif.x + dif.y + dif.z) - _ColorChangeTolerance2), 0.0)); + #endif + #if CHANGECOLOR3_ON + dif = abs(currChangeColor - _ColorChangeTarget3.rgb); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _ColorChangeNewCol3.rgb, + max(sign(1 - saturate(dif.x + dif.y + dif.z) - _ColorChangeTolerance3), 0.0)); + #endif + #endif + //------------------------------------------------------- + + //POSTERIZE_ON && !POSTERIZEOUTLINE_ON + #if POSTERIZE_ON && !POSTERIZEOUTLINE_ON + col.rgb = pow(col.rgb, _PosterizeGamma) * _PosterizeNumColors; + col.rgb = floor(col.rgb) / _PosterizeNumColors; + col.rgb = pow(col.rgb, 1.0 / _PosterizeGamma); + #endif + //------------------------------------ + + //HSV_ON + #if HSV_ON + half3 resultHsv = half3(col.rgb); + half cosHsv = _HsvBright * _HsvSaturation * cos(_HsvShift * 3.14159265 / 180); + half sinHsv = _HsvBright * _HsvSaturation * sin(_HsvShift * 3.14159265 / 180); + resultHsv.x = (.299 * _HsvBright + .701 * cosHsv + .168 * sinHsv) * col.x + + (.587 * _HsvBright - .587 * cosHsv + .330 * sinHsv) * col.y + + (.114 * _HsvBright - .114 * cosHsv - .497 * sinHsv) * col.z; + resultHsv.y = (.299 * _HsvBright - .299 * cosHsv - .328 * sinHsv) *col.x + + (.587 * _HsvBright + .413 * cosHsv + .035 * sinHsv) * col.y + + (.114 * _HsvBright - .114 * cosHsv + .292 * sinHsv) * col.z; + resultHsv.z = (.299 * _HsvBright - .3 * cosHsv + 1.25 * sinHsv) * col.x + + (.587 * _HsvBright - .588 * cosHsv - 1.05 * sinHsv) * col.y + + (.114 * _HsvBright + .886 * cosHsv - .203 * sinHsv) * col.z; + col.rgb = resultHsv; + #endif + //------------------------------------------------------- + + //OVERLAY_ON + #if OVERLAY_ON + half2 overlayUvs = d.texcoord0.xy; + overlayUvs.x += ((_Time.y + randomSeed) * _OverlayTextureScrollXSpeed) % 1; + overlayUvs.y += ((_Time.y + randomSeed) * _OverlayTextureScrollYSpeed) % 1; + half4 overlayCol = SAMPLE_TEXTURE2D(_OverlayTex, sampler_OverlayTex, TRANSFORM_TEX(overlayUvs, _OverlayTex)); + overlayCol.rgb *= _OverlayColor.rgb * _OverlayGlow; + #if !OVERLAYMULT_ON + overlayCol.rgb *= overlayCol.a * _OverlayColor.rgb * _OverlayColor.a * _OverlayBlend; + col.rgb += overlayCol.rgb; + #else + overlayCol.a *= _OverlayColor.a; + col = lerp(col, col * overlayCol, _OverlayBlend); + #endif + #endif + + //--------------------------------- + + //OUTBASE_ON + #if OUTBASE_ON + #if OUTBASEPIXELPERF_ON + half2 destUv = half2(_OutlinePixelWidth * _MainTex_TexelSize.x, _OutlinePixelWidth * _MainTex_TexelSize.y); + #else + half2 destUv = half2(_OutlineWidth * _MainTex_TexelSize.x * 200, _OutlineWidth * _MainTex_TexelSize.y * 200); + #endif + + #if OUTDIST_ON + d.texcoord3.x += ((_Time.x + _RandomSeed) * _OutlineDistortTexXSpeed) % 1; + d.texcoord3.y += ((_Time.x + _RandomSeed) * _OutlineDistortTexYSpeed) % 1; + #if ATLAS_ON + d.texcoord3 = half2((d.texcoord3.x - _MinXUV) / (_MaxXUV - _MinXUV), (d.texcoord3.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half outDistortAmnt = (SAMPLE_TEXTURE2D(_OutlineDistortTex, sampler_OutlineDistortTex, d.texcoord3).r - 0.5) * 0.2 * _OutlineDistortAmount; + destUv.x += outDistortAmnt; + destUv.y += outDistortAmnt; + #endif + + half spriteLeft = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(destUv.x, 0)).a; + half spriteRight = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy - half2(destUv.x, 0)).a; + half spriteBottom = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(0, destUv.y)).a; + half spriteTop = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy - half2(0, destUv.y)).a; + half result = spriteLeft + spriteRight + spriteBottom + spriteTop; + + #if OUTBASE8DIR_ON + half spriteTopLeft = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(destUv.x, destUv.y)).a; + half spriteTopRight = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(-destUv.x, destUv.y)).a; + half spriteBotLeft = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(destUv.x, -destUv.y)).a; + half spriteBotRight = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(-destUv.x, -destUv.y)).a; + result = result + spriteTopLeft + spriteTopRight + spriteBotLeft + spriteBotRight; + #endif + + result = step(0.05, saturate(result)); + + #if OUTTEX_ON + d.texcoord1.x += ((_Time.x + _RandomSeed) * _OutlineTexXSpeed) % 1; + d.texcoord1.y += ((_Time.x + _RandomSeed) * _OutlineTexYSpeed) % 1; + #if ATLAS_ON + d.texcoord1 = half2((d.texcoord1.x - _MinXUV) / (_MaxXUV - _MinXUV), (d.texcoord1.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half4 tempOutColor = SAMPLE_TEXTURE2D(_OutlineTex, sampler_OutlineTex, d.texcoord1); + tempOutColor *= _OutlineColor; + _OutlineColor = tempOutColor; + #endif + + result *= (1 - originalAlpha) * _OutlineAlpha; + + half4 outline = _OutlineColor * d.vertexColor.a; + outline.rgb *= _OutlineGlow; + outline.a = result; + #if ONLYOUTLINE_ON + col = outline; + #else + col = lerp(col, outline, result); + #endif + #endif + //------------------------------------------------------- + + //FADE_ON + #if FADE_ON + half2 tiledUvFade1 = TRANSFORM_TEX(d.texcoord0, _FadeTex); + half2 tiledUvFade2 = TRANSFORM_TEX(d.texcoord0, _FadeBurnTex); + #if ATLAS_ON + tiledUvFade1 = half2((tiledUvFade1.x - _MinXUV) / (_MaxXUV - _MinXUV), (tiledUvFade1.y - _MinYUV) / (_MaxYUV - _MinYUV)); + tiledUvFade2 = half2((tiledUvFade2.x - _MinXUV) / (_MaxXUV - _MinXUV), (tiledUvFade2.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half fadeTemp = SAMPLE_TEXTURE2D(_FadeTex, sampler_FadeTex, tiledUvFade1).r; + half fade = smoothstep(_FadeAmount, _FadeAmount + _FadeBurnTransition, fadeTemp); + half fadeBurn = saturate(smoothstep(_FadeAmount - _FadeBurnWidth, _FadeAmount - _FadeBurnWidth + 0.1, fadeTemp) * _FadeAmount); + col.a *= fade; + _FadeBurnColor.rgb *= _FadeBurnGlow; + col += fadeBurn * SAMPLE_TEXTURE2D(_FadeBurnTex, sampler_FadeBurnTex, tiledUvFade2) * _FadeBurnColor * originalAlpha * (1 - col.a); + #endif + //------------------------------------------------------- + + //SHADOW_ON + #if SHADOW_ON + half shadowA = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(_ShadowX, _ShadowY)).a; + half preMultShadowMask = 1 - (saturate(shadowA - col.a) * (1 - col.a)); + col.rgb *= 1 - ((shadowA - col.a) * (1 - col.a)); + col.rgb += (_ShadowColor * shadowA) * (1 - col.a); + col.a = max(shadowA * _ShadowAlpha * d.vertexColor.a, col.a); + #endif + + //------------------------------------------------------- + + //GLOW_ON + #if GLOW_ON + half4 emission; + #if GLOWTEX_ON + emission = SAMPLE_TEXTURE2D(_GlowTex, sampler_GlowTex, d.texcoord0); + #else + emission = col; + #endif + + col.rgb *= _GlowGlobal; + emission.rgb *= emission.a * col.a * _Glow * _GlowColor; + col.rgb += emission.rgb; + #endif + //------------------------------------------------------- + + //COLORRAMP_ON && COLORRAMPOUTLINE_ON + #if COLORRAMP_ON && COLORRAMPOUTLINE_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + luminance = saturate(luminance + _ColorRampLuminosity); + #if GRADIENTCOLORRAMP_ON + col.rgb = lerp(col.rgb, SAMPLE_TEXTURE2D(_ColorRampTexGradient, sampler_ColorRampTexGradient, half2(luminance, 0)).rgb, _ColorRampBlend); + #else + col.rgb = lerp(col.rgb, SAMPLE_TEXTURE2D(_ColorRampTex, sampler_ColorRampTex, half2(luminance, 0)).rgb, _ColorRampBlend); + #endif + #endif + //--------------- + + //GREYSCALE_ON && GREYSCALEOUTLINE_ON + #if GREYSCALE_ON && GREYSCALEOUTLINE_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + luminance = saturate(luminance + _GreyscaleLuminosity); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _GreyscaleTintColor, _GreyscaleBlend); + #endif + + //----------------------------------- + + //POSTERIZE_ON && POSTERIZEOUTLINE_ON + #if POSTERIZE_ON && POSTERIZEOUTLINE_ON + col.rgb = pow(col.rgb, _PosterizeGamma) * _PosterizeNumColors; + col.rgb = floor(col.rgb) / _PosterizeNumColors; + col.rgb = pow(col.rgb, 1.0 / _PosterizeGamma); + #endif + + //----------------------------------- + + //SHINE_ON + #if SHINE_ON + half2 uvShine = uvRect; + half cosAngle = cos(_ShineRotate); + half sinAngle = sin(_ShineRotate); + half2x2 rot = half2x2(cosAngle, -sinAngle, sinAngle, cosAngle); + uvShine -= half2(0.5, 0.5); + uvShine = mul(rot, uvShine); + uvShine += half2(0.5, 0.5); + half shineMask = SAMPLE_TEXTURE2D(_ShineMask, sampler_ShineMask, d.texcoord0.xy).a; + half currentDistanceProjection = (uvShine.x + uvShine.y) / 2; + half whitePower = 1 - (abs(currentDistanceProjection - _ShineLocation) / _ShineWidth); + col.rgb += col.a * whitePower * _ShineGlow * max(sign(currentDistanceProjection - (_ShineLocation - _ShineWidth)), 0.0) + * max(sign((_ShineLocation + _ShineWidth) - currentDistanceProjection), 0.0) * _ShineColor * shineMask; + #endif + + //----------------------------------- + + //HOLOGRAM_ON + #if HOLOGRAM_ON + half totalHologram = _HologramStripesAmount + _HologramUnmodAmount; + half hologramYCoord = ((uvRect.y + (((_Time.x + randomSeed) % 1) * _HologramStripesSpeed)) % totalHologram) / totalHologram; + hologramYCoord = abs(hologramYCoord); + half alpha = RemapFloat(saturate(hologramYCoord - (_HologramUnmodAmount/totalHologram)), 0.0, 1.0, _HologramMinAlpha, saturate(_HologramMaxAlpha)); + half hologramMask = max(sign((_HologramUnmodAmount/totalHologram) - hologramYCoord), 0.0); + half4 hologramResult = col; + hologramResult.a *= lerp(alpha, 1, hologramMask); + hologramResult.rgb *= max(1, _HologramMaxAlpha * max(sign(hologramYCoord - (_HologramUnmodAmount/totalHologram)), 0.0)); + hologramMask = 1 - step(0.01,hologramMask); + hologramResult.rgb += hologramMask * _HologramStripeColor * col.a; + col = lerp(col, hologramResult, _HologramBlend); + #endif + + //----------------------------------- + + //FLICKER_ON + #if FLICKER_ON + col.a *= saturate(col.a * step(frac(0.05 + (_Time.w + randomSeed) * _FlickerFreq), 1 - _FlickerPercent) + _FlickerAlpha); + #endif + //----------------------------------- + + //ALPHACUTOFF_ON + + //ALPHAROUND_ON + + //ALPHAOUTLINE_ON + #if ALPHAOUTLINE_ON + half alphaOutlineRes = pow(1 - col.a, max(_AlphaOutlinePower, 0.0001)) * step(_AlphaOutlineMinAlpha, col.a) * _AlphaOutlineBlend; + col.rgb = lerp(col.rgb, _AlphaOutlineColor.rgb * _AlphaOutlineGlow, alphaOutlineRes); + col.a = lerp(col.a, 1, alphaOutlineRes > 1); + #endif + //------------------------------------------------------- + + //FOG_ON + + //------------------ + + col *= _Color; + o.Albedo = col; + col.a *= _Alpha; + clip(col.a - _AlphaCutoffValue - 0.01); + o.Alpha = _Color.a; + } + + + + + + void ChainSurfaceFunction(inout Surface l, inout ShaderData d) + { + Ext_SurfaceFunction0(l, d); + // Ext_SurfaceFunction1(l, d); + // Ext_SurfaceFunction2(l, d); + // Ext_SurfaceFunction3(l, d); + // Ext_SurfaceFunction4(l, d); + // Ext_SurfaceFunction5(l, d); + // Ext_SurfaceFunction6(l, d); + // Ext_SurfaceFunction7(l, d); + // Ext_SurfaceFunction8(l, d); + // Ext_SurfaceFunction9(l, d); + // Ext_SurfaceFunction10(l, d); + // Ext_SurfaceFunction11(l, d); + // Ext_SurfaceFunction12(l, d); + // Ext_SurfaceFunction13(l, d); + // Ext_SurfaceFunction14(l, d); + // Ext_SurfaceFunction15(l, d); + // Ext_SurfaceFunction16(l, d); + // Ext_SurfaceFunction17(l, d); + // Ext_SurfaceFunction18(l, d); + // Ext_SurfaceFunction19(l, d); + // Ext_SurfaceFunction20(l, d); + // Ext_SurfaceFunction21(l, d); + // Ext_SurfaceFunction22(l, d); + // Ext_SurfaceFunction23(l, d); + // Ext_SurfaceFunction24(l, d); + // Ext_SurfaceFunction25(l, d); + // Ext_SurfaceFunction26(l, d); + // Ext_SurfaceFunction27(l, d); + // Ext_SurfaceFunction28(l, d); + // Ext_SurfaceFunction29(l, d); + } + +#if !_DECALSHADER + + void ChainModifyVertex(inout VertexData v, inout VertexToPixel v2p, float4 time) + { + ExtraV2F d; + + ZERO_INITIALIZE(ExtraV2F, d); + ZERO_INITIALIZE(Blackboard, d.blackboard); + // due to motion vectors in HDRP, we need to use the last + // time in certain spots. So if you are going to use _Time to adjust vertices, + // you need to use this time or motion vectors will break. + d.time = time; + + Ext_ModifyVertex0(v, d); + // Ext_ModifyVertex1(v, d); + // Ext_ModifyVertex2(v, d); + // Ext_ModifyVertex3(v, d); + // Ext_ModifyVertex4(v, d); + // Ext_ModifyVertex5(v, d); + // Ext_ModifyVertex6(v, d); + // Ext_ModifyVertex7(v, d); + // Ext_ModifyVertex8(v, d); + // Ext_ModifyVertex9(v, d); + // Ext_ModifyVertex10(v, d); + // Ext_ModifyVertex11(v, d); + // Ext_ModifyVertex12(v, d); + // Ext_ModifyVertex13(v, d); + // Ext_ModifyVertex14(v, d); + // Ext_ModifyVertex15(v, d); + // Ext_ModifyVertex16(v, d); + // Ext_ModifyVertex17(v, d); + // Ext_ModifyVertex18(v, d); + // Ext_ModifyVertex19(v, d); + // Ext_ModifyVertex20(v, d); + // Ext_ModifyVertex21(v, d); + // Ext_ModifyVertex22(v, d); + // Ext_ModifyVertex23(v, d); + // Ext_ModifyVertex24(v, d); + // Ext_ModifyVertex25(v, d); + // Ext_ModifyVertex26(v, d); + // Ext_ModifyVertex27(v, d); + // Ext_ModifyVertex28(v, d); + // Ext_ModifyVertex29(v, d); + + + // #if %EXTRAV2F0REQUIREKEY% + // v2p.extraV2F0 = d.extraV2F0; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // v2p.extraV2F1 = d.extraV2F1; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // v2p.extraV2F2 = d.extraV2F2; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // v2p.extraV2F3 = d.extraV2F3; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // v2p.extraV2F4 = d.extraV2F4; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // v2p.extraV2F5 = d.extraV2F5; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // v2p.extraV2F6 = d.extraV2F6; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // v2p.extraV2F7 = d.extraV2F7; + // #endif + } + + void ChainModifyTessellatedVertex(inout VertexData v, inout VertexToPixel v2p) + { + ExtraV2F d; + ZERO_INITIALIZE(ExtraV2F, d); + ZERO_INITIALIZE(Blackboard, d.blackboard); + + // #if %EXTRAV2F0REQUIREKEY% + // d.extraV2F0 = v2p.extraV2F0; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // d.extraV2F1 = v2p.extraV2F1; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // d.extraV2F2 = v2p.extraV2F2; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // d.extraV2F3 = v2p.extraV2F3; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // d.extraV2F4 = v2p.extraV2F4; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // d.extraV2F5 = v2p.extraV2F5; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // d.extraV2F6 = v2p.extraV2F6; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // d.extraV2F7 = v2p.extraV2F7; + // #endif + + + // Ext_ModifyTessellatedVertex0(v, d); + // Ext_ModifyTessellatedVertex1(v, d); + // Ext_ModifyTessellatedVertex2(v, d); + // Ext_ModifyTessellatedVertex3(v, d); + // Ext_ModifyTessellatedVertex4(v, d); + // Ext_ModifyTessellatedVertex5(v, d); + // Ext_ModifyTessellatedVertex6(v, d); + // Ext_ModifyTessellatedVertex7(v, d); + // Ext_ModifyTessellatedVertex8(v, d); + // Ext_ModifyTessellatedVertex9(v, d); + // Ext_ModifyTessellatedVertex10(v, d); + // Ext_ModifyTessellatedVertex11(v, d); + // Ext_ModifyTessellatedVertex12(v, d); + // Ext_ModifyTessellatedVertex13(v, d); + // Ext_ModifyTessellatedVertex14(v, d); + // Ext_ModifyTessellatedVertex15(v, d); + // Ext_ModifyTessellatedVertex16(v, d); + // Ext_ModifyTessellatedVertex17(v, d); + // Ext_ModifyTessellatedVertex18(v, d); + // Ext_ModifyTessellatedVertex19(v, d); + // Ext_ModifyTessellatedVertex20(v, d); + // Ext_ModifyTessellatedVertex21(v, d); + // Ext_ModifyTessellatedVertex22(v, d); + // Ext_ModifyTessellatedVertex23(v, d); + // Ext_ModifyTessellatedVertex24(v, d); + // Ext_ModifyTessellatedVertex25(v, d); + // Ext_ModifyTessellatedVertex26(v, d); + // Ext_ModifyTessellatedVertex27(v, d); + // Ext_ModifyTessellatedVertex28(v, d); + // Ext_ModifyTessellatedVertex29(v, d); + + // #if %EXTRAV2F0REQUIREKEY% + // v2p.extraV2F0 = d.extraV2F0; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // v2p.extraV2F1 = d.extraV2F1; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // v2p.extraV2F2 = d.extraV2F2; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // v2p.extraV2F3 = d.extraV2F3; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // v2p.extraV2F4 = d.extraV2F4; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // v2p.extraV2F5 = d.extraV2F5; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // v2p.extraV2F6 = d.extraV2F6; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // v2p.extraV2F7 = d.extraV2F7; + // #endif + } + + void ChainFinalColorForward(inout Surface l, inout ShaderData d, inout half4 color) + { + // Ext_FinalColorForward0(l, d, color); + // Ext_FinalColorForward1(l, d, color); + // Ext_FinalColorForward2(l, d, color); + // Ext_FinalColorForward3(l, d, color); + // Ext_FinalColorForward4(l, d, color); + // Ext_FinalColorForward5(l, d, color); + // Ext_FinalColorForward6(l, d, color); + // Ext_FinalColorForward7(l, d, color); + // Ext_FinalColorForward8(l, d, color); + // Ext_FinalColorForward9(l, d, color); + // Ext_FinalColorForward10(l, d, color); + // Ext_FinalColorForward11(l, d, color); + // Ext_FinalColorForward12(l, d, color); + // Ext_FinalColorForward13(l, d, color); + // Ext_FinalColorForward14(l, d, color); + // Ext_FinalColorForward15(l, d, color); + // Ext_FinalColorForward16(l, d, color); + // Ext_FinalColorForward17(l, d, color); + // Ext_FinalColorForward18(l, d, color); + // Ext_FinalColorForward19(l, d, color); + // Ext_FinalColorForward20(l, d, color); + // Ext_FinalColorForward21(l, d, color); + // Ext_FinalColorForward22(l, d, color); + // Ext_FinalColorForward23(l, d, color); + // Ext_FinalColorForward24(l, d, color); + // Ext_FinalColorForward25(l, d, color); + // Ext_FinalColorForward26(l, d, color); + // Ext_FinalColorForward27(l, d, color); + // Ext_FinalColorForward28(l, d, color); + // Ext_FinalColorForward29(l, d, color); + } + + void ChainFinalGBufferStandard(inout Surface s, inout ShaderData d, inout half4 GBuffer0, inout half4 GBuffer1, inout half4 GBuffer2, inout half4 outEmission, inout half4 outShadowMask) + { + // Ext_FinalGBufferStandard0(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard1(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard2(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard3(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard4(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard5(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard6(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard7(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard8(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard9(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard10(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard11(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard12(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard13(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard14(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard15(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard16(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard17(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard18(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard19(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard20(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard21(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard22(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard23(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard24(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard25(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard26(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard27(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard28(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard29(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + } +#endif + + + + + +#if _DECALSHADER + + ShaderData CreateShaderData(SurfaceDescriptionInputs IN) + { + ShaderData d = (ShaderData)0; + d.TBNMatrix = float3x3(IN.WorldSpaceTangent, IN.WorldSpaceBiTangent, IN.WorldSpaceNormal); + d.worldSpaceNormal = IN.WorldSpaceNormal; + d.worldSpaceTangent = IN.WorldSpaceTangent; + + d.worldSpacePosition = IN.WorldSpacePosition; + d.texcoord0 = IN.uv0.xyxy; + d.screenPos = IN.ScreenPosition; + + d.worldSpaceViewDir = normalize(_WorldSpaceCameraPos - d.worldSpacePosition); + + d.tangentSpaceViewDir = mul(d.TBNMatrix, d.worldSpaceViewDir); + + // these rarely get used, so we back transform them. Usually will be stripped. + #if _HDRP + // d.localSpacePosition = mul(GetWorldToObjectMatrix(), float4(GetCameraRelativePositionWS(d.worldSpacePosition), 1)).xyz; + #else + // d.localSpacePosition = mul(GetWorldToObjectMatrix(), float4(d.worldSpacePosition, 1)).xyz; + #endif + // d.localSpaceNormal = normalize(mul((float3x3)GetWorldToObjectMatrix(), d.worldSpaceNormal)); + // d.localSpaceTangent = normalize(mul((float3x3)GetWorldToObjectMatrix(), d.worldSpaceTangent.xyz)); + + // #if %SCREENPOSREQUIREKEY% + // d.screenUV = (IN.ScreenPosition.xy / max(0.01, IN.ScreenPosition.w)); + // #endif + + return d; + } +#else + + ShaderData CreateShaderData(VertexToPixel i + #if NEED_FACING + , bool facing + #endif + ) + { + ShaderData d = (ShaderData)0; + d.clipPos = i.pos; + d.worldSpacePosition = i.worldPos; + + d.worldSpaceNormal = normalize(i.worldNormal); + d.worldSpaceTangent.xyz = normalize(i.worldTangent.xyz); + + d.tangentSign = i.worldTangent.w * unity_WorldTransformParams.w; + float3 bitangent = cross(d.worldSpaceTangent.xyz, d.worldSpaceNormal) * d.tangentSign; + + d.TBNMatrix = float3x3(d.worldSpaceTangent, -bitangent, d.worldSpaceNormal); + d.worldSpaceViewDir = normalize(_WorldSpaceCameraPos - i.worldPos); + + d.tangentSpaceViewDir = mul(d.TBNMatrix, d.worldSpaceViewDir); + d.texcoord0 = i.texcoord0; + d.texcoord1 = i.texcoord1; + d.texcoord2 = i.texcoord2; + + // #if %TEXCOORD3REQUIREKEY% + d.texcoord3 = i.texcoord3; + // #endif + + // d.isFrontFace = facing; + // #if %VERTEXCOLORREQUIREKEY% + d.vertexColor = i.vertexColor; + // #endif + + // these rarely get used, so we back transform them. Usually will be stripped. + #if _HDRP + // d.localSpacePosition = mul(GetWorldToObjectMatrix(), float4(GetCameraRelativePositionWS(i.worldPos), 1)).xyz; + #else + // d.localSpacePosition = mul(GetWorldToObjectMatrix(), float4(i.worldPos, 1)).xyz; + #endif + // d.localSpaceNormal = normalize(mul((float3x3)GetWorldToObjectMatrix(), i.worldNormal)); + // d.localSpaceTangent = normalize(mul((float3x3)GetWorldToObjectMatrix(), i.worldTangent.xyz)); + + // #if %SCREENPOSREQUIREKEY% + // d.screenPos = i.screenPos; + // d.screenUV = (i.screenPos.xy / i.screenPos.w); + // #endif + + + // #if %EXTRAV2F0REQUIREKEY% + // d.extraV2F0 = i.extraV2F0; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // d.extraV2F1 = i.extraV2F1; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // d.extraV2F2 = i.extraV2F2; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // d.extraV2F3 = i.extraV2F3; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // d.extraV2F4 = i.extraV2F4; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // d.extraV2F5 = i.extraV2F5; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // d.extraV2F6 = i.extraV2F6; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // d.extraV2F7 = i.extraV2F7; + // #endif + + return d; + } + +#endif + + + // vertex shader + VertexToPixel Vert (VertexData v) + { + UNITY_SETUP_INSTANCE_ID(v); + VertexToPixel o; + UNITY_INITIALIZE_OUTPUT(VertexToPixel,o); + UNITY_TRANSFER_INSTANCE_ID(v,o); + UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o); + +#if !_TESSELLATION_ON + ChainModifyVertex(v, o, _Time); +#endif + + o.texcoord0 = v.texcoord0; + o.texcoord1 = v.texcoord1; + o.texcoord2 = v.texcoord2; + + // #if %TEXCOORD3REQUIREKEY% + o.texcoord3 = v.texcoord3; + // #endif + + // #if %VERTEXCOLORREQUIREKEY% + o.vertexColor = v.vertexColor; + // #endif + + + + o.worldPos = mul(GetObjectToWorldMatrix(), v.vertex).xyz; + o.worldNormal = UnityObjectToWorldNormal(v.normal); + o.worldTangent = float4(UnityObjectToWorldDir(v.tangent.xyz), v.tangent.w); + + + // sets o.pos, so do screenpos after. + TRANSFER_SHADOW_CASTER_NORMALOFFSET(o) + + // #if %SCREENPOSREQUIREKEY% + // o.screenPos = ComputeScreenPos(o.pos); + // #endif + + return o; + } + + + + // fragment shader + fixed4 Frag (VertexToPixel IN + #ifdef _DEPTHOFFSET_ON + , out float outputDepth : SV_Depth + #endif + #if NEED_FACING + , bool facing : SV_IsFrontFace + #endif + ) : SV_Target + { + UNITY_SETUP_INSTANCE_ID(IN); + // prepare and unpack data + + #ifdef FOG_COMBINED_WITH_TSPACE + UNITY_EXTRACT_FOG_FROM_TSPACE(IN); + #elif defined FOG_COMBINED_WITH_WORLD_POS + UNITY_EXTRACT_FOG_FROM_WORLD_POS(IN); + #else + UNITY_EXTRACT_FOG(IN); + #endif + + #ifndef USING_DIRECTIONAL_LIGHT + fixed3 lightDir = normalize(UnityWorldSpaceLightDir(IN.worldPos)); + #else + fixed3 lightDir = _WorldSpaceLightPos0.xyz; + #endif + + + + ShaderData d = CreateShaderData(IN + #if NEED_FACING + , facing + #endif + ); + + Surface l = (Surface)0; + + #ifdef _DEPTHOFFSET_ON + l.outputDepth = outputDepth; + #endif + + l.Albedo = half3(0.5, 0.5, 0.5); + l.Normal = float3(0,0,1); + l.Occlusion = 1; + l.Alpha = 1; + + ChainSurfaceFunction(l, d); + + #ifdef _DEPTHOFFSET_ON + outputDepth = l.outputDepth; + #endif + + SHADOW_CASTER_FRAGMENT(IN) + } + + + ENDCG + + } + + + // ---- meta information extraction pass: + Pass + { + Name "Meta" + Tags { "LightMode" = "Meta" } + Cull Off + + Tags { "RenderType" = "Opaque" "Queue" = "Geometry" "PreviewType" = "Plane" } + Cull [_CullingOption] + ZWrite [_ZWrite] + ZTest [_ZTestMode] + + + CGPROGRAM + + #pragma vertex Vert + #pragma fragment Frag + + // compile directives + #pragma target 3.0 + #pragma multi_compile_instancing + #pragma skip_variants FOG_LINEAR FOG_EXP FOG_EXP2 + #pragma shader_feature EDITOR_VISUALIZATION + + #include "HLSLSupport.cginc" + #define UNITY_INSTANCED_LOD_FADE + #define UNITY_INSTANCED_SH + #define UNITY_INSTANCED_LIGHTMAPSTS + #include "UnityShaderVariables.cginc" + #include "UnityShaderUtilities.cginc" + + #include "UnityCG.cginc" + #include "Lighting.cginc" + #include "UnityPBSLighting.cginc" + #include "UnityMetaPass.cginc" + + #define _PASSMETA 1 + + + #pragma shader_feature_local GLOW_ON + #pragma shader_feature_local FADE_ON + #pragma shader_feature_local OUTBASE_ON + #pragma shader_feature_local ONLYOUTLINE_ON + #pragma shader_feature_local GRADIENT_ON + #pragma shader_feature_local GRADIENT2COL_ON + #pragma shader_feature_local RADIALGRADIENT_ON + #pragma shader_feature_local COLORSWAP_ON + #pragma shader_feature_local HSV_ON + #pragma shader_feature_local CHANGECOLOR_ON + #pragma shader_feature_local CHANGECOLOR2_ON + #pragma shader_feature_local CHANGECOLOR3_ON + #pragma shader_feature_local COLORRAMP_ON + #pragma shader_feature_local GRADIENTCOLORRAMP_ON + #pragma shader_feature_local HITEFFECT_ON + #pragma shader_feature_local NEGATIVE_ON + #pragma shader_feature_local PIXELATE_ON + #pragma shader_feature_local GREYSCALE_ON + #pragma shader_feature_local POSTERIZE_ON + #pragma shader_feature_local BLUR_ON + #pragma shader_feature_local MOTIONBLUR_ON + #pragma shader_feature_local GHOST_ON + #pragma shader_feature_local ALPHAOUTLINE_ON + #pragma shader_feature_local INNEROUTLINE_ON + #pragma shader_feature_local ONLYINNEROUTLINE_ON + #pragma shader_feature_local HOLOGRAM_ON + #pragma shader_feature_local CHROMABERR_ON + #pragma shader_feature_local GLITCH_ON + #pragma shader_feature_local FLICKER_ON + #pragma shader_feature_local SHADOW_ON + #pragma shader_feature_local SHINE_ON + #pragma shader_feature_local CONTRAST_ON + #pragma shader_feature_local OVERLAY_ON + #pragma shader_feature_local OVERLAYMULT_ON + #pragma shader_feature_local DOODLE_ON + #pragma shader_feature_local WIND_ON + #pragma shader_feature_local WAVEUV_ON + #pragma shader_feature_local ROUNDWAVEUV_ON + #pragma shader_feature_local RECTSIZE_ON + #pragma shader_feature_local OFFSETUV_ON + #pragma shader_feature_local CLIPPING_ON + #pragma shader_feature_local RADIALCLIPPING_ON + #pragma shader_feature_local TEXTURESCROLL_ON + #pragma shader_feature_local ZOOMUV_ON + #pragma shader_feature_local DISTORT_ON + #pragma shader_feature_local WARP_ON + #pragma shader_feature_local TWISTUV_ON + #pragma shader_feature_local ROTATEUV_ON + #pragma shader_feature_local POLARUV_ON + #pragma shader_feature_local FISHEYE_ON + #pragma shader_feature_local PINCH_ON + #pragma shader_feature_local SHAKEUV_ON + + #pragma shader_feature_local GLOWTEX_ON + #pragma shader_feature_local OUTTEX_ON + #pragma shader_feature_local OUTDIST_ON + #pragma shader_feature_local OUTBASE8DIR_ON + #pragma shader_feature_local OUTBASEPIXELPERF_ON + #pragma shader_feature_local COLORRAMPOUTLINE_ON + #pragma shader_feature_local GREYSCALEOUTLINE_ON + #pragma shader_feature_local POSTERIZEOUTLINE_ON + #pragma shader_feature_local BLURISHD_ON + #pragma shader_feature_local MANUALWIND_ON + #pragma shader_feature_local ATLAS_ON + #pragma shader_feature_local PREMULTIPLYALPHA_ON + + #pragma shader_feature BILBOARD_ON + #pragma shader_feature BILBOARDY_ON + + #pragma shader_feature NORMALMAP_ON + + + #define _STANDARD 1 +// If your looking in here and thinking WTF, yeah, I know. These are taken from the SRPs, to allow us to use the same +// texturing library they use. However, since they are not included in the standard pipeline by default, there is no +// way to include them in and they have to be inlined, since someone could copy this shader onto another machine without +// Better Shaders installed. Unfortunate, but I'd rather do this and have a nice library for texture sampling instead +// of the patchy one Unity provides being inlined/emulated in HDRP/URP. Strangely, PSSL and XBoxOne libraries are not +// included in the standard SRP code, but they are in tons of Unity own projects on the web, so I grabbed them from there. + +#if defined(SHADER_API_GAMECORE) + + #define ZERO_INITIALIZE(type, name) name = (type)0; + #define ZERO_INITIALIZE_ARRAY(type, name, arraySize) { for (int arrayIndex = 0; arrayIndex < arraySize; arrayIndex++) { name[arrayIndex] = (type)0; } } + + // Texture util abstraction + + #define CALCULATE_TEXTURE2D_LOD(textureName, samplerName, coord2) textureName.CalculateLevelOfDetail(samplerName, coord2) + + // Texture abstraction + + #define TEXTURE2D(textureName) Texture2D textureName + #define TEXTURE2D_ARRAY(textureName) Texture2DArray textureName + #define TEXTURECUBE(textureName) TextureCube textureName + #define TEXTURECUBE_ARRAY(textureName) TextureCubeArray textureName + #define TEXTURE3D(textureName) Texture3D textureName + + #define TEXTURE2D_FLOAT(textureName) TEXTURE2D(textureName) + #define TEXTURE2D_ARRAY_FLOAT(textureName) TEXTURE2D_ARRAY(textureName) + #define TEXTURECUBE_FLOAT(textureName) TEXTURECUBE(textureName) + #define TEXTURECUBE_ARRAY_FLOAT(textureName) TEXTURECUBE_ARRAY(textureName) + #define TEXTURE3D_FLOAT(textureName) TEXTURE3D(textureName) + + #define TEXTURE2D_HALF(textureName) TEXTURE2D(textureName) + #define TEXTURE2D_ARRAY_HALF(textureName) TEXTURE2D_ARRAY(textureName) + #define TEXTURECUBE_HALF(textureName) TEXTURECUBE(textureName) + #define TEXTURECUBE_ARRAY_HALF(textureName) TEXTURECUBE_ARRAY(textureName) + #define TEXTURE3D_HALF(textureName) TEXTURE3D(textureName) + + #define TEXTURE2D_SHADOW(textureName) TEXTURE2D(textureName) + #define TEXTURE2D_ARRAY_SHADOW(textureName) TEXTURE2D_ARRAY(textureName) + #define TEXTURECUBE_SHADOW(textureName) TEXTURECUBE(textureName) + #define TEXTURECUBE_ARRAY_SHADOW(textureName) TEXTURECUBE_ARRAY(textureName) + + #define RW_TEXTURE2D(type, textureName) RWTexture2D textureName + #define RW_TEXTURE2D_ARRAY(type, textureName) RWTexture2DArray textureName + #define RW_TEXTURE3D(type, textureName) RWTexture3D textureName + + #define SAMPLER(samplerName) SamplerState samplerName + #define SAMPLER_CMP(samplerName) SamplerComparisonState samplerName + #define ASSIGN_SAMPLER(samplerName, samplerValue) samplerName = samplerValue + + #define TEXTURE2D_PARAM(textureName, samplerName) TEXTURE2D(textureName), SAMPLER(samplerName) + #define TEXTURE2D_ARRAY_PARAM(textureName, samplerName) TEXTURE2D_ARRAY(textureName), SAMPLER(samplerName) + #define TEXTURECUBE_PARAM(textureName, samplerName) TEXTURECUBE(textureName), SAMPLER(samplerName) + #define TEXTURECUBE_ARRAY_PARAM(textureName, samplerName) TEXTURECUBE_ARRAY(textureName), SAMPLER(samplerName) + #define TEXTURE3D_PARAM(textureName, samplerName) TEXTURE3D(textureName), SAMPLER(samplerName) + + #define TEXTURE2D_SHADOW_PARAM(textureName, samplerName) TEXTURE2D(textureName), SAMPLER_CMP(samplerName) + #define TEXTURE2D_ARRAY_SHADOW_PARAM(textureName, samplerName) TEXTURE2D_ARRAY(textureName), SAMPLER_CMP(samplerName) + #define TEXTURECUBE_SHADOW_PARAM(textureName, samplerName) TEXTURECUBE(textureName), SAMPLER_CMP(samplerName) + #define TEXTURECUBE_ARRAY_SHADOW_PARAM(textureName, samplerName) TEXTURECUBE_ARRAY(textureName), SAMPLER_CMP(samplerName) + + #define TEXTURE2D_ARGS(textureName, samplerName) textureName, samplerName + #define TEXTURE2D_ARRAY_ARGS(textureName, samplerName) textureName, samplerName + #define TEXTURECUBE_ARGS(textureName, samplerName) textureName, samplerName + #define TEXTURECUBE_ARRAY_ARGS(textureName, samplerName) textureName, samplerName + #define TEXTURE3D_ARGS(textureName, samplerName) textureName, samplerName + + #define TEXTURE2D_SHADOW_ARGS(textureName, samplerName) textureName, samplerName + #define TEXTURE2D_ARRAY_SHADOW_ARGS(textureName, samplerName) textureName, samplerName + #define TEXTURECUBE_SHADOW_ARGS(textureName, samplerName) textureName, samplerName + #define TEXTURECUBE_ARRAY_SHADOW_ARGS(textureName, samplerName) textureName, samplerName + + #define PLATFORM_SAMPLE_TEXTURE2D(textureName, samplerName, coord2) textureName.Sample(samplerName, coord2) + #define PLATFORM_SAMPLE_TEXTURE2D_LOD(textureName, samplerName, coord2, lod) textureName.SampleLevel(samplerName, coord2, lod) + #define PLATFORM_SAMPLE_TEXTURE2D_BIAS(textureName, samplerName, coord2, bias) textureName.SampleBias(samplerName, coord2, bias) + #define PLATFORM_SAMPLE_TEXTURE2D_GRAD(textureName, samplerName, coord2, dpdx, dpdy) textureName.SampleGrad(samplerName, coord2, dpdx, dpdy) + #define PLATFORM_SAMPLE_TEXTURE2D_ARRAY(textureName, samplerName, coord2, index) textureName.Sample(samplerName, float3(coord2, index)) + #define PLATFORM_SAMPLE_TEXTURE2D_ARRAY_LOD(textureName, samplerName, coord2, index, lod) textureName.SampleLevel(samplerName, float3(coord2, index), lod) + #define PLATFORM_SAMPLE_TEXTURE2D_ARRAY_BIAS(textureName, samplerName, coord2, index, bias) textureName.SampleBias(samplerName, float3(coord2, index), bias) + #define PLATFORM_SAMPLE_TEXTURE2D_ARRAY_GRAD(textureName, samplerName, coord2, index, dpdx, dpdy) textureName.SampleGrad(samplerName, float3(coord2, index), dpdx, dpdy) + #define PLATFORM_SAMPLE_TEXTURECUBE(textureName, samplerName, coord3) textureName.Sample(samplerName, coord3) + #define PLATFORM_SAMPLE_TEXTURECUBE_LOD(textureName, samplerName, coord3, lod) textureName.SampleLevel(samplerName, coord3, lod) + #define PLATFORM_SAMPLE_TEXTURECUBE_BIAS(textureName, samplerName, coord3, bias) textureName.SampleBias(samplerName, coord3, bias) + #define PLATFORM_SAMPLE_TEXTURECUBE_ARRAY(textureName, samplerName, coord3, index) textureName.Sample(samplerName, float4(coord3, index)) + #define PLATFORM_SAMPLE_TEXTURECUBE_ARRAY_LOD(textureName, samplerName, coord3, index, lod) textureName.SampleLevel(samplerName, float4(coord3, index), lod) + #define PLATFORM_SAMPLE_TEXTURECUBE_ARRAY_BIAS(textureName, samplerName, coord3, index, bias) textureName.SampleBias(samplerName, float4(coord3, index), bias) + #define PLATFORM_SAMPLE_TEXTURE3D(textureName, samplerName, coord3) textureName.Sample(samplerName, coord3) + #define PLATFORM_SAMPLE_TEXTURE3D_LOD(textureName, samplerName, coord3, lod) textureName.SampleLevel(samplerName, coord3, lod) + + #define SAMPLE_TEXTURE2D(textureName, samplerName, coord2) PLATFORM_SAMPLE_TEXTURE2D(textureName, samplerName, coord2) + #define SAMPLE_TEXTURE2D_LOD(textureName, samplerName, coord2, lod) PLATFORM_SAMPLE_TEXTURE2D_LOD(textureName, samplerName, coord2, lod) + #define SAMPLE_TEXTURE2D_BIAS(textureName, samplerName, coord2, bias) PLATFORM_SAMPLE_TEXTURE2D_BIAS(textureName, samplerName, coord2, bias) + #define SAMPLE_TEXTURE2D_GRAD(textureName, samplerName, coord2, dpdx, dpdy) PLATFORM_SAMPLE_TEXTURE2D_GRAD(textureName, samplerName, coord2, dpdx, dpdy) + #define SAMPLE_TEXTURE2D_ARRAY(textureName, samplerName, coord2, index) PLATFORM_SAMPLE_TEXTURE2D_ARRAY(textureName, samplerName, coord2, index) + #define SAMPLE_TEXTURE2D_ARRAY_LOD(textureName, samplerName, coord2, index, lod) PLATFORM_SAMPLE_TEXTURE2D_ARRAY_LOD(textureName, samplerName, coord2, index, lod) + #define SAMPLE_TEXTURE2D_ARRAY_BIAS(textureName, samplerName, coord2, index, bias) PLATFORM_SAMPLE_TEXTURE2D_ARRAY_BIAS(textureName, samplerName, coord2, index, bias) + #define SAMPLE_TEXTURE2D_ARRAY_GRAD(textureName, samplerName, coord2, index, dpdx, dpdy) PLATFORM_SAMPLE_TEXTURE2D_ARRAY_GRAD(textureName, samplerName, coord2, index, dpdx, dpdy) + #define SAMPLE_TEXTURECUBE(textureName, samplerName, coord3) PLATFORM_SAMPLE_TEXTURECUBE(textureName, samplerName, coord3) + #define SAMPLE_TEXTURECUBE_LOD(textureName, samplerName, coord3, lod) PLATFORM_SAMPLE_TEXTURECUBE_LOD(textureName, samplerName, coord3, lod) + #define SAMPLE_TEXTURECUBE_BIAS(textureName, samplerName, coord3, bias) PLATFORM_SAMPLE_TEXTURECUBE_BIAS(textureName, samplerName, coord3, bias) + #define SAMPLE_TEXTURECUBE_ARRAY(textureName, samplerName, coord3, index) PLATFORM_SAMPLE_TEXTURECUBE_ARRAY(textureName, samplerName, coord3, index) + #define SAMPLE_TEXTURECUBE_ARRAY_LOD(textureName, samplerName, coord3, index, lod) PLATFORM_SAMPLE_TEXTURECUBE_ARRAY_LOD(textureName, samplerName, coord3, index, lod) + #define SAMPLE_TEXTURECUBE_ARRAY_BIAS(textureName, samplerName, coord3, index, bias) PLATFORM_SAMPLE_TEXTURECUBE_ARRAY_BIAS(textureName, samplerName, coord3, index, bias) + #define SAMPLE_TEXTURE3D(textureName, samplerName, coord3) PLATFORM_SAMPLE_TEXTURE3D(textureName, samplerName, coord3) + #define SAMPLE_TEXTURE3D_LOD(textureName, samplerName, coord3, lod) PLATFORM_SAMPLE_TEXTURE3D_LOD(textureName, samplerName, coord3, lod) + + #define SAMPLE_TEXTURE2D_SHADOW(textureName, samplerName, coord3) textureName.SampleCmpLevelZero(samplerName, (coord3).xy, (coord3).z) + #define SAMPLE_TEXTURE2D_ARRAY_SHADOW(textureName, samplerName, coord3, index) textureName.SampleCmpLevelZero(samplerName, float3((coord3).xy, index), (coord3).z) + #define SAMPLE_TEXTURECUBE_SHADOW(textureName, samplerName, coord4) textureName.SampleCmpLevelZero(samplerName, (coord4).xyz, (coord4).w) + #define SAMPLE_TEXTURECUBE_ARRAY_SHADOW(textureName, samplerName, coord4, index) textureName.SampleCmpLevelZero(samplerName, float4((coord4).xyz, index), (coord4).w) + + #define SAMPLE_DEPTH_TEXTURE(textureName, samplerName, coord2) SAMPLE_TEXTURE2D(textureName, samplerName, coord2).r + #define SAMPLE_DEPTH_TEXTURE_LOD(textureName, samplerName, coord2, lod) SAMPLE_TEXTURE2D_LOD(textureName, samplerName, coord2, lod).r + + #define LOAD_TEXTURE2D(textureName, unCoord2) textureName.Load(int3(unCoord2, 0)) + #define LOAD_TEXTURE2D_LOD(textureName, unCoord2, lod) textureName.Load(int3(unCoord2, lod)) + #define LOAD_TEXTURE2D_MSAA(textureName, unCoord2, sampleIndex) textureName.Load(unCoord2, sampleIndex) + #define LOAD_TEXTURE2D_ARRAY(textureName, unCoord2, index) textureName.Load(int4(unCoord2, index, 0)) + #define LOAD_TEXTURE2D_ARRAY_MSAA(textureName, unCoord2, index, sampleIndex) textureName.Load(int3(unCoord2, index), sampleIndex) + #define LOAD_TEXTURE2D_ARRAY_LOD(textureName, unCoord2, index, lod) textureName.Load(int4(unCoord2, index, lod)) + #define LOAD_TEXTURE3D(textureName, unCoord3) textureName.Load(int4(unCoord3, 0)) + #define LOAD_TEXTURE3D_LOD(textureName, unCoord3, lod) textureName.Load(int4(unCoord3, lod)) + + #define PLATFORM_SUPPORT_GATHER + #define GATHER_TEXTURE2D(textureName, samplerName, coord2) textureName.Gather(samplerName, coord2) + #define GATHER_TEXTURE2D_ARRAY(textureName, samplerName, coord2, index) textureName.Gather(samplerName, float3(coord2, index)) + #define GATHER_TEXTURECUBE(textureName, samplerName, coord3) textureName.Gather(samplerName, coord3) + #define GATHER_TEXTURECUBE_ARRAY(textureName, samplerName, coord3, index) textureName.Gather(samplerName, float4(coord3, index)) + #define GATHER_RED_TEXTURE2D(textureName, samplerName, coord2) textureName.GatherRed(samplerName, coord2) + #define GATHER_GREEN_TEXTURE2D(textureName, samplerName, coord2) textureName.GatherGreen(samplerName, coord2) + #define GATHER_BLUE_TEXTURE2D(textureName, samplerName, coord2) textureName.GatherBlue(samplerName, coord2) + #define GATHER_ALPHA_TEXTURE2D(textureName, samplerName, coord2) textureName.GatherAlpha(samplerName, coord2) + + +#elif defined(SHADER_API_XBOXONE) + + // Initialize arbitrary structure with zero values. + // Do not exist on some platform, in this case we need to have a standard name that call a function that will initialize all parameters to 0 + #define ZERO_INITIALIZE(type, name) name = (type)0; + #define ZERO_INITIALIZE_ARRAY(type, name, arraySize) { for (int arrayIndex = 0; arrayIndex < arraySize; arrayIndex++) { name[arrayIndex] = (type)0; } } + + // Texture util abstraction + + #define CALCULATE_TEXTURE2D_LOD(textureName, samplerName, coord2) textureName.CalculateLevelOfDetail(samplerName, coord2) + + // Texture abstraction + + #define TEXTURE2D(textureName) Texture2D textureName + #define TEXTURE2D_ARRAY(textureName) Texture2DArray textureName + #define TEXTURECUBE(textureName) TextureCube textureName + #define TEXTURECUBE_ARRAY(textureName) TextureCubeArray textureName + #define TEXTURE3D(textureName) Texture3D textureName + + #define TEXTURE2D_FLOAT(textureName) TEXTURE2D(textureName) + #define TEXTURE2D_ARRAY_FLOAT(textureName) TEXTURE2D_ARRAY(textureName) + #define TEXTURECUBE_FLOAT(textureName) TEXTURECUBE(textureName) + #define TEXTURECUBE_ARRAY_FLOAT(textureName) TEXTURECUBE_ARRAY(textureName) + #define TEXTURE3D_FLOAT(textureName) TEXTURE3D(textureName) + + #define TEXTURE2D_HALF(textureName) TEXTURE2D(textureName) + #define TEXTURE2D_ARRAY_HALF(textureName) TEXTURE2D_ARRAY(textureName) + #define TEXTURECUBE_HALF(textureName) TEXTURECUBE(textureName) + #define TEXTURECUBE_ARRAY_HALF(textureName) TEXTURECUBE_ARRAY(textureName) + #define TEXTURE3D_HALF(textureName) TEXTURE3D(textureName) + + #define TEXTURE2D_SHADOW(textureName) TEXTURE2D(textureName) + #define TEXTURE2D_ARRAY_SHADOW(textureName) TEXTURE2D_ARRAY(textureName) + #define TEXTURECUBE_SHADOW(textureName) TEXTURECUBE(textureName) + #define TEXTURECUBE_ARRAY_SHADOW(textureName) TEXTURECUBE_ARRAY(textureName) + + #define RW_TEXTURE2D(type, textureName) RWTexture2D textureName + #define RW_TEXTURE2D_ARRAY(type, textureName) RWTexture2DArray textureName + #define RW_TEXTURE3D(type, textureName) RWTexture3D textureName + + #define SAMPLER(samplerName) SamplerState samplerName + #define SAMPLER_CMP(samplerName) SamplerComparisonState samplerName + + #define TEXTURE2D_PARAM(textureName, samplerName) TEXTURE2D(textureName), SAMPLER(samplerName) + #define TEXTURE2D_ARRAY_PARAM(textureName, samplerName) TEXTURE2D_ARRAY(textureName), SAMPLER(samplerName) + #define TEXTURECUBE_PARAM(textureName, samplerName) TEXTURECUBE(textureName), SAMPLER(samplerName) + #define TEXTURECUBE_ARRAY_PARAM(textureName, samplerName) TEXTURECUBE_ARRAY(textureName), SAMPLER(samplerName) + #define TEXTURE3D_PARAM(textureName, samplerName) TEXTURE3D(textureName), SAMPLER(samplerName) + + #define TEXTURE2D_SHADOW_PARAM(textureName, samplerName) TEXTURE2D(textureName), SAMPLER_CMP(samplerName) + #define TEXTURE2D_ARRAY_SHADOW_PARAM(textureName, samplerName) TEXTURE2D_ARRAY(textureName), SAMPLER_CMP(samplerName) + #define TEXTURECUBE_SHADOW_PARAM(textureName, samplerName) TEXTURECUBE(textureName), SAMPLER_CMP(samplerName) + #define TEXTURECUBE_ARRAY_SHADOW_PARAM(textureName, samplerName) TEXTURECUBE_ARRAY(textureName), SAMPLER_CMP(samplerName) + + #define TEXTURE2D_ARGS(textureName, samplerName) textureName, samplerName + #define TEXTURE2D_ARRAY_ARGS(textureName, samplerName) textureName, samplerName + #define TEXTURECUBE_ARGS(textureName, samplerName) textureName, samplerName + #define TEXTURECUBE_ARRAY_ARGS(textureName, samplerName) textureName, samplerName + #define TEXTURE3D_ARGS(textureName, samplerName) textureName, samplerName + + #define TEXTURE2D_SHADOW_ARGS(textureName, samplerName) textureName, samplerName + #define TEXTURE2D_ARRAY_SHADOW_ARGS(textureName, samplerName) textureName, samplerName + #define TEXTURECUBE_SHADOW_ARGS(textureName, samplerName) textureName, samplerName + #define TEXTURECUBE_ARRAY_SHADOW_ARGS(textureName, samplerName) textureName, samplerName + + #define SAMPLE_TEXTURE2D(textureName, samplerName, coord2) textureName.Sample(samplerName, coord2) + #define SAMPLE_TEXTURE2D_LOD(textureName, samplerName, coord2, lod) textureName.SampleLevel(samplerName, coord2, lod) + #define SAMPLE_TEXTURE2D_BIAS(textureName, samplerName, coord2, bias) textureName.SampleBias(samplerName, coord2, bias) + #define SAMPLE_TEXTURE2D_GRAD(textureName, samplerName, coord2, dpdx, dpdy) textureName.SampleGrad(samplerName, coord2, dpdx, dpdy) + #define SAMPLE_TEXTURE2D_ARRAY(textureName, samplerName, coord2, index) textureName.Sample(samplerName, float3(coord2, index)) + #define SAMPLE_TEXTURE2D_ARRAY_LOD(textureName, samplerName, coord2, index, lod) textureName.SampleLevel(samplerName, float3(coord2, index), lod) + #define SAMPLE_TEXTURE2D_ARRAY_BIAS(textureName, samplerName, coord2, index, bias) textureName.SampleBias(samplerName, float3(coord2, index), bias) + #define SAMPLE_TEXTURE2D_ARRAY_GRAD(textureName, samplerName, coord2, index, dpdx, dpdy) textureName.SampleGrad(samplerName, float3(coord2, index), dpdx, dpdy) + #define SAMPLE_TEXTURECUBE(textureName, samplerName, coord3) textureName.Sample(samplerName, coord3) + #define SAMPLE_TEXTURECUBE_LOD(textureName, samplerName, coord3, lod) textureName.SampleLevel(samplerName, coord3, lod) + #define SAMPLE_TEXTURECUBE_BIAS(textureName, samplerName, coord3, bias) textureName.SampleBias(samplerName, coord3, bias) + #define SAMPLE_TEXTURECUBE_ARRAY(textureName, samplerName, coord3, index) textureName.Sample(samplerName, float4(coord3, index)) + #define SAMPLE_TEXTURECUBE_ARRAY_LOD(textureName, samplerName, coord3, index, lod) textureName.SampleLevel(samplerName, float4(coord3, index), lod) + #define SAMPLE_TEXTURECUBE_ARRAY_BIAS(textureName, samplerName, coord3, index, bias) textureName.SampleBias(samplerName, float4(coord3, index), bias) + #define SAMPLE_TEXTURE3D(textureName, samplerName, coord3) textureName.Sample(samplerName, coord3) + #define SAMPLE_TEXTURE3D_LOD(textureName, samplerName, coord3, lod) textureName.SampleLevel(samplerName, coord3, lod) + + #define SAMPLE_TEXTURE2D_SHADOW(textureName, samplerName, coord3) textureName.SampleCmpLevelZero(samplerName, (coord3).xy, (coord3).z) + #define SAMPLE_TEXTURE2D_ARRAY_SHADOW(textureName, samplerName, coord3, index) textureName.SampleCmpLevelZero(samplerName, float3((coord3).xy, index), (coord3).z) + #define SAMPLE_TEXTURECUBE_SHADOW(textureName, samplerName, coord4) textureName.SampleCmpLevelZero(samplerName, (coord4).xyz, (coord4).w) + #define SAMPLE_TEXTURECUBE_ARRAY_SHADOW(textureName, samplerName, coord4, index) textureName.SampleCmpLevelZero(samplerName, float4((coord4).xyz, index), (coord4).w) + + #define LOAD_TEXTURE2D(textureName, unCoord2) textureName.Load(int3(unCoord2, 0)) + #define LOAD_TEXTURE2D_LOD(textureName, unCoord2, lod) textureName.Load(int3(unCoord2, lod)) + #define LOAD_TEXTURE2D_MSAA(textureName, unCoord2, sampleIndex) textureName.Load(unCoord2, sampleIndex) + #define LOAD_TEXTURE2D_ARRAY(textureName, unCoord2, index) textureName.Load(int4(unCoord2, index, 0)) + #define LOAD_TEXTURE2D_ARRAY_MSAA(textureName, unCoord2, index, sampleIndex) textureName.Load(int3(unCoord2, index), sampleIndex) + #define LOAD_TEXTURE2D_ARRAY_LOD(textureName, unCoord2, index, lod) textureName.Load(int4(unCoord2, index, lod)) + #define LOAD_TEXTURE3D(textureName, unCoord3) textureName.Load(int4(unCoord3, 0)) + #define LOAD_TEXTURE3D_LOD(textureName, unCoord3, lod) textureName.Load(int4(unCoord3, lod)) + + #define PLATFORM_SUPPORT_GATHER + #define GATHER_TEXTURE2D(textureName, samplerName, coord2) textureName.Gather(samplerName, coord2) + #define GATHER_TEXTURE2D_ARRAY(textureName, samplerName, coord2, index) textureName.Gather(samplerName, float3(coord2, index)) + #define GATHER_TEXTURECUBE(textureName, samplerName, coord3) textureName.Gather(samplerName, coord3) + #define GATHER_TEXTURECUBE_ARRAY(textureName, samplerName, coord3, index) textureName.Gather(samplerName, float4(coord3, index)) + #define GATHER_RED_TEXTURE2D(textureName, samplerName, coord2) textureName.GatherRed(samplerName, coord2) + #define GATHER_GREEN_TEXTURE2D(textureName, samplerName, coord2) textureName.GatherGreen(samplerName, coord2) + #define GATHER_BLUE_TEXTURE2D(textureName, samplerName, coord2) textureName.GatherBlue(samplerName, coord2) + #define GATHER_ALPHA_TEXTURE2D(textureName, samplerName, coord2) textureName.GatherAlpha(samplerName, coord2) + + +#elif defined(SHADER_API_PSSL) + + // Initialize arbitrary structure with zero values. + // Do not exist on some platform, in this case we need to have a standard name that call a function that will initialize all parameters to 0 + #define ZERO_INITIALIZE(type, name) name = (type)0; + #define ZERO_INITIALIZE_ARRAY(type, name, arraySize) { for (int arrayIndex = 0; arrayIndex < arraySize; arrayIndex++) { name[arrayIndex] = (type)0; } } + + // Texture util abstraction + + #define CALCULATE_TEXTURE2D_LOD(textureName, samplerName, coord2) textureName.GetLOD(samplerName, coord2) + + // Texture abstraction + + #define TEXTURE2D(textureName) Texture2D textureName + #define TEXTURE2D_ARRAY(textureName) Texture2DArray textureName + #define TEXTURECUBE(textureName) TextureCube textureName + #define TEXTURECUBE_ARRAY(textureName) TextureCubeArray textureName + #define TEXTURE3D(textureName) Texture3D textureName + + #define TEXTURE2D_FLOAT(textureName) TEXTURE2D(textureName) + #define TEXTURE2D_ARRAY_FLOAT(textureName) TEXTURE2D_ARRAY(textureName) + #define TEXTURECUBE_FLOAT(textureName) TEXTURECUBE(textureName) + #define TEXTURECUBE_ARRAY_FLOAT(textureName) TEXTURECUBE_ARRAY(textureName) + #define TEXTURE3D_FLOAT(textureName) TEXTURE3D(textureName) + + #define TEXTURE2D_HALF(textureName) TEXTURE2D(textureName) + #define TEXTURE2D_ARRAY_HALF(textureName) TEXTURE2D_ARRAY(textureName) + #define TEXTURECUBE_HALF(textureName) TEXTURECUBE(textureName) + #define TEXTURECUBE_ARRAY_HALF(textureName) TEXTURECUBE_ARRAY(textureName) + #define TEXTURE3D_HALF(textureName) TEXTURE3D(textureName) + + #define TEXTURE2D_SHADOW(textureName) TEXTURE2D(textureName) + #define TEXTURE2D_ARRAY_SHADOW(textureName) TEXTURE2D_ARRAY(textureName) + #define TEXTURECUBE_SHADOW(textureName) TEXTURECUBE(textureName) + #define TEXTURECUBE_ARRAY_SHADOW(textureName) TEXTURECUBE_ARRAY(textureName) + + #define RW_TEXTURE2D(type, textureName) RW_Texture2D textureName + #define RW_TEXTURE2D_ARRAY(type, textureName) RW_Texture2D_Array textureName + #define RW_TEXTURE3D(type, textureName) RW_Texture3D textureName + + #define SAMPLER(samplerName) SamplerState samplerName + #define SAMPLER_CMP(samplerName) SamplerComparisonState samplerName + + #define TEXTURE2D_PARAM(textureName, samplerName) TEXTURE2D(textureName), SAMPLER(samplerName) + #define TEXTURE2D_ARRAY_PARAM(textureName, samplerName) TEXTURE2D_ARRAY(textureName), SAMPLER(samplerName) + #define TEXTURECUBE_PARAM(textureName, samplerName) TEXTURECUBE(textureName), SAMPLER(samplerName) + #define TEXTURECUBE_ARRAY_PARAM(textureName, samplerName) TEXTURECUBE_ARRAY(textureName), SAMPLER(samplerName) + #define TEXTURE3D_PARAM(textureName, samplerName) TEXTURE3D(textureName), SAMPLER(samplerName) + + #define TEXTURE2D_SHADOW_PARAM(textureName, samplerName) TEXTURE2D(textureName), SAMPLER_CMP(samplerName) + #define TEXTURE2D_ARRAY_SHADOW_PARAM(textureName, samplerName) TEXTURE2D_ARRAY(textureName), SAMPLER_CMP(samplerName) + #define TEXTURECUBE_SHADOW_PARAM(textureName, samplerName) TEXTURECUBE(textureName), SAMPLER_CMP(samplerName) + #define TEXTURECUBE_ARRAY_SHADOW_PARAM(textureName, samplerName) TEXTURECUBE_ARRAY(textureName), SAMPLER_CMP(samplerName) + + #define TEXTURE2D_ARGS(textureName, samplerName) textureName, samplerName + #define TEXTURE2D_ARRAY_ARGS(textureName, samplerName) textureName, samplerName + #define TEXTURECUBE_ARGS(textureName, samplerName) textureName, samplerName + #define TEXTURECUBE_ARRAY_ARGS(textureName, samplerName) textureName, samplerName + #define TEXTURE3D_ARGS(textureName, samplerName) textureName, samplerName + + #define TEXTURE2D_SHADOW_ARGS(textureName, samplerName) textureName, samplerName + #define TEXTURE2D_ARRAY_SHADOW_ARGS(textureName, samplerName) textureName, samplerName + #define TEXTURECUBE_SHADOW_ARGS(textureName, samplerName) textureName, samplerName + #define TEXTURECUBE_ARRAY_SHADOW_ARGS(textureName, samplerName) textureName, samplerName + + #define SAMPLE_TEXTURE2D(textureName, samplerName, coord2) textureName.Sample(samplerName, coord2) + #define SAMPLE_TEXTURE2D_LOD(textureName, samplerName, coord2, lod) textureName.SampleLevel(samplerName, coord2, lod) + #define SAMPLE_TEXTURE2D_BIAS(textureName, samplerName, coord2, bias) textureName.SampleBias(samplerName, coord2, bias) + #define SAMPLE_TEXTURE2D_GRAD(textureName, samplerName, coord2, dpdx, dpdy) textureName.SampleGrad(samplerName, coord2, dpdx, dpdy) + #define SAMPLE_TEXTURE2D_ARRAY(textureName, samplerName, coord2, index) textureName.Sample(samplerName, float3(coord2, index)) + #define SAMPLE_TEXTURE2D_ARRAY_LOD(textureName, samplerName, coord2, index, lod) textureName.SampleLevel(samplerName, float3(coord2, index), lod) + #define SAMPLE_TEXTURE2D_ARRAY_BIAS(textureName, samplerName, coord2, index, bias) textureName.SampleBias(samplerName, float3(coord2, index), bias) + #define SAMPLE_TEXTURE2D_ARRAY_GRAD(textureName, samplerName, coord2, index, dpdx, dpdy) textureName.SampleGrad(samplerName, float3(coord2, index), dpdx, dpdy) + #define SAMPLE_TEXTURECUBE(textureName, samplerName, coord3) textureName.Sample(samplerName, coord3) + #define SAMPLE_TEXTURECUBE_LOD(textureName, samplerName, coord3, lod) textureName.SampleLevel(samplerName, coord3, lod) + #define SAMPLE_TEXTURECUBE_BIAS(textureName, samplerName, coord3, bias) textureName.SampleBias(samplerName, coord3, bias) + #define SAMPLE_TEXTURECUBE_ARRAY(textureName, samplerName, coord3, index) textureName.Sample(samplerName, float4(coord3, index)) + #define SAMPLE_TEXTURECUBE_ARRAY_LOD(textureName, samplerName, coord3, index, lod) textureName.SampleLevel(samplerName, float4(coord3, index), lod) + #define SAMPLE_TEXTURECUBE_ARRAY_BIAS(textureName, samplerName, coord3, index, bias) textureName.SampleBias(samplerName, float4(coord3, index), bias) + #define SAMPLE_TEXTURE3D(textureName, samplerName, coord3) textureName.Sample(samplerName, coord3) + #define SAMPLE_TEXTURE3D_LOD(textureName, samplerName, coord3, lod) textureName.SampleLevel(samplerName, coord3, lod) + + #define SAMPLE_TEXTURE2D_SHADOW(textureName, samplerName, coord3) textureName.SampleCmpLevelZero(samplerName, (coord3).xy, (coord3).z) + #define SAMPLE_TEXTURE2D_ARRAY_SHADOW(textureName, samplerName, coord3, index) textureName.SampleCmpLevelZero(samplerName, float3((coord3).xy, index), (coord3).z) + #define SAMPLE_TEXTURECUBE_SHADOW(textureName, samplerName, coord4) textureName.SampleCmpLevelZero(samplerName, (coord4).xyz, (coord4).w) + #define SAMPLE_TEXTURECUBE_ARRAY_SHADOW(textureName, samplerName, coord4, index) textureName.SampleCmpLevelZero(samplerName, float4((coord4).xyz, index), (coord4).w) + + #define LOAD_TEXTURE2D(textureName, unCoord2) textureName.Load(int3(unCoord2, 0)) + #define LOAD_TEXTURE2D_LOD(textureName, unCoord2, lod) textureName.Load(int3(unCoord2, lod)) + #define LOAD_TEXTURE2D_MSAA(textureName, unCoord2, sampleIndex) textureName.Load(unCoord2, sampleIndex) + #define LOAD_TEXTURE2D_ARRAY(textureName, unCoord2, index) textureName.Load(int4(unCoord2, index, 0)) + #define LOAD_TEXTURE2D_ARRAY_MSAA(textureName, unCoord2, index, sampleIndex) textureName.Load(int3(unCoord2, index), sampleIndex) + #define LOAD_TEXTURE2D_ARRAY_LOD(textureName, unCoord2, index, lod) textureName.Load(int4(unCoord2, index, lod)) + #define LOAD_TEXTURE3D(textureName, unCoord3) textureName.Load(int4(unCoord3, 0)) + #define LOAD_TEXTURE3D_LOD(textureName, unCoord3, lod) textureName.Load(int4(unCoord3, lod)) + + #define PLATFORM_SUPPORT_GATHER + #define GATHER_TEXTURE2D(textureName, samplerName, coord2) textureName.Gather(samplerName, coord2) + #define GATHER_TEXTURE2D_ARRAY(textureName, samplerName, coord2, index) textureName.Gather(samplerName, float3(coord2, index)) + #define GATHER_TEXTURECUBE(textureName, samplerName, coord3) textureName.Gather(samplerName, coord3) + #define GATHER_TEXTURECUBE_ARRAY(textureName, samplerName, coord3, index) textureName.Gather(samplerName, float4(coord3, index)) + #define GATHER_RED_TEXTURE2D(textureName, samplerName, coord2) textureName.GatherRed(samplerName, coord2) + #define GATHER_GREEN_TEXTURE2D(textureName, samplerName, coord2) textureName.GatherGreen(samplerName, coord2) + #define GATHER_BLUE_TEXTURE2D(textureName, samplerName, coord2) textureName.GatherBlue(samplerName, coord2) + #define GATHER_ALPHA_TEXTURE2D(textureName, samplerName, coord2) textureName.GatherAlpha(samplerName, coord2) + + + +#elif defined(SHADER_API_D3D11) + + // Initialize arbitrary structure with zero values. + // Do not exist on some platform, in this case we need to have a standard name that call a function that will initialize all parameters to 0 + #define ZERO_INITIALIZE(type, name) name = (type)0; + #define ZERO_INITIALIZE_ARRAY(type, name, arraySize) { for (int arrayIndex = 0; arrayIndex < arraySize; arrayIndex++) { name[arrayIndex] = (type)0; } } + + // Texture util abstraction + + #define CALCULATE_TEXTURE2D_LOD(textureName, samplerName, coord2) textureName.CalculateLevelOfDetail(samplerName, coord2) + + // Texture abstraction + + #define TEXTURE2D(textureName) Texture2D textureName + #define TEXTURE2D_ARRAY(textureName) Texture2DArray textureName + #define TEXTURECUBE(textureName) TextureCube textureName + #define TEXTURECUBE_ARRAY(textureName) TextureCubeArray textureName + #define TEXTURE3D(textureName) Texture3D textureName + + #define TEXTURE2D_FLOAT(textureName) TEXTURE2D(textureName) + #define TEXTURE2D_ARRAY_FLOAT(textureName) TEXTURE2D_ARRAY(textureName) + #define TEXTURECUBE_FLOAT(textureName) TEXTURECUBE(textureName) + #define TEXTURECUBE_ARRAY_FLOAT(textureName) TEXTURECUBE_ARRAY(textureName) + #define TEXTURE3D_FLOAT(textureName) TEXTURE3D(textureName) + + #define TEXTURE2D_HALF(textureName) TEXTURE2D(textureName) + #define TEXTURE2D_ARRAY_HALF(textureName) TEXTURE2D_ARRAY(textureName) + #define TEXTURECUBE_HALF(textureName) TEXTURECUBE(textureName) + #define TEXTURECUBE_ARRAY_HALF(textureName) TEXTURECUBE_ARRAY(textureName) + #define TEXTURE3D_HALF(textureName) TEXTURE3D(textureName) + + #define TEXTURE2D_SHADOW(textureName) TEXTURE2D(textureName) + #define TEXTURE2D_ARRAY_SHADOW(textureName) TEXTURE2D_ARRAY(textureName) + #define TEXTURECUBE_SHADOW(textureName) TEXTURECUBE(textureName) + #define TEXTURECUBE_ARRAY_SHADOW(textureName) TEXTURECUBE_ARRAY(textureName) + + #define RW_TEXTURE2D(type, textureName) RWTexture2D textureName + #define RW_TEXTURE2D_ARRAY(type, textureName) RWTexture2DArray textureName + #define RW_TEXTURE3D(type, textureName) RWTexture3D textureName + + #define SAMPLER(samplerName) SamplerState samplerName + #define SAMPLER_CMP(samplerName) SamplerComparisonState samplerName + + #define TEXTURE2D_PARAM(textureName, samplerName) TEXTURE2D(textureName), SAMPLER(samplerName) + #define TEXTURE2D_ARRAY_PARAM(textureName, samplerName) TEXTURE2D_ARRAY(textureName), SAMPLER(samplerName) + #define TEXTURECUBE_PARAM(textureName, samplerName) TEXTURECUBE(textureName), SAMPLER(samplerName) + #define TEXTURECUBE_ARRAY_PARAM(textureName, samplerName) TEXTURECUBE_ARRAY(textureName), SAMPLER(samplerName) + #define TEXTURE3D_PARAM(textureName, samplerName) TEXTURE3D(textureName), SAMPLER(samplerName) + + #define TEXTURE2D_SHADOW_PARAM(textureName, samplerName) TEXTURE2D(textureName), SAMPLER_CMP(samplerName) + #define TEXTURE2D_ARRAY_SHADOW_PARAM(textureName, samplerName) TEXTURE2D_ARRAY(textureName), SAMPLER_CMP(samplerName) + #define TEXTURECUBE_SHADOW_PARAM(textureName, samplerName) TEXTURECUBE(textureName), SAMPLER_CMP(samplerName) + #define TEXTURECUBE_ARRAY_SHADOW_PARAM(textureName, samplerName) TEXTURECUBE_ARRAY(textureName), SAMPLER_CMP(samplerName) + + #define TEXTURE2D_ARGS(textureName, samplerName) textureName, samplerName + #define TEXTURE2D_ARRAY_ARGS(textureName, samplerName) textureName, samplerName + #define TEXTURECUBE_ARGS(textureName, samplerName) textureName, samplerName + #define TEXTURECUBE_ARRAY_ARGS(textureName, samplerName) textureName, samplerName + #define TEXTURE3D_ARGS(textureName, samplerName) textureName, samplerName + + #define TEXTURE2D_SHADOW_ARGS(textureName, samplerName) textureName, samplerName + #define TEXTURE2D_ARRAY_SHADOW_ARGS(textureName, samplerName) textureName, samplerName + #define TEXTURECUBE_SHADOW_ARGS(textureName, samplerName) textureName, samplerName + #define TEXTURECUBE_ARRAY_SHADOW_ARGS(textureName, samplerName) textureName, samplerName + + #define SAMPLE_TEXTURE2D(textureName, samplerName, coord2) textureName.Sample(samplerName, coord2) + #define SAMPLE_TEXTURE2D_LOD(textureName, samplerName, coord2, lod) textureName.SampleLevel(samplerName, coord2, lod) + #define SAMPLE_TEXTURE2D_BIAS(textureName, samplerName, coord2, bias) textureName.SampleBias(samplerName, coord2, bias) + #define SAMPLE_TEXTURE2D_GRAD(textureName, samplerName, coord2, dpdx, dpdy) textureName.SampleGrad(samplerName, coord2, dpdx, dpdy) + #define SAMPLE_TEXTURE2D_ARRAY(textureName, samplerName, coord2, index) textureName.Sample(samplerName, float3(coord2, index)) + #define SAMPLE_TEXTURE2D_ARRAY_LOD(textureName, samplerName, coord2, index, lod) textureName.SampleLevel(samplerName, float3(coord2, index), lod) + #define SAMPLE_TEXTURE2D_ARRAY_BIAS(textureName, samplerName, coord2, index, bias) textureName.SampleBias(samplerName, float3(coord2, index), bias) + #define SAMPLE_TEXTURE2D_ARRAY_GRAD(textureName, samplerName, coord2, index, dpdx, dpdy) textureName.SampleGrad(samplerName, float3(coord2, index), dpdx, dpdy) + #define SAMPLE_TEXTURECUBE(textureName, samplerName, coord3) textureName.Sample(samplerName, coord3) + #define SAMPLE_TEXTURECUBE_LOD(textureName, samplerName, coord3, lod) textureName.SampleLevel(samplerName, coord3, lod) + #define SAMPLE_TEXTURECUBE_BIAS(textureName, samplerName, coord3, bias) textureName.SampleBias(samplerName, coord3, bias) + #define SAMPLE_TEXTURECUBE_ARRAY(textureName, samplerName, coord3, index) textureName.Sample(samplerName, float4(coord3, index)) + #define SAMPLE_TEXTURECUBE_ARRAY_LOD(textureName, samplerName, coord3, index, lod) textureName.SampleLevel(samplerName, float4(coord3, index), lod) + #define SAMPLE_TEXTURECUBE_ARRAY_BIAS(textureName, samplerName, coord3, index, bias) textureName.SampleBias(samplerName, float4(coord3, index), bias) + #define SAMPLE_TEXTURE3D(textureName, samplerName, coord3) textureName.Sample(samplerName, coord3) + #define SAMPLE_TEXTURE3D_LOD(textureName, samplerName, coord3, lod) textureName.SampleLevel(samplerName, coord3, lod) + + #define SAMPLE_TEXTURE2D_SHADOW(textureName, samplerName, coord3) textureName.SampleCmpLevelZero(samplerName, (coord3).xy, (coord3).z) + #define SAMPLE_TEXTURE2D_ARRAY_SHADOW(textureName, samplerName, coord3, index) textureName.SampleCmpLevelZero(samplerName, float3((coord3).xy, index), (coord3).z) + #define SAMPLE_TEXTURECUBE_SHADOW(textureName, samplerName, coord4) textureName.SampleCmpLevelZero(samplerName, (coord4).xyz, (coord4).w) + #define SAMPLE_TEXTURECUBE_ARRAY_SHADOW(textureName, samplerName, coord4, index) textureName.SampleCmpLevelZero(samplerName, float4((coord4).xyz, index), (coord4).w) + + #define LOAD_TEXTURE2D(textureName, unCoord2) textureName.Load(int3(unCoord2, 0)) + #define LOAD_TEXTURE2D_LOD(textureName, unCoord2, lod) textureName.Load(int3(unCoord2, lod)) + #define LOAD_TEXTURE2D_MSAA(textureName, unCoord2, sampleIndex) textureName.Load(unCoord2, sampleIndex) + #define LOAD_TEXTURE2D_ARRAY(textureName, unCoord2, index) textureName.Load(int4(unCoord2, index, 0)) + #define LOAD_TEXTURE2D_ARRAY_MSAA(textureName, unCoord2, index, sampleIndex) textureName.Load(int3(unCoord2, index), sampleIndex) + #define LOAD_TEXTURE2D_ARRAY_LOD(textureName, unCoord2, index, lod) textureName.Load(int4(unCoord2, index, lod)) + #define LOAD_TEXTURE3D(textureName, unCoord3) textureName.Load(int4(unCoord3, 0)) + #define LOAD_TEXTURE3D_LOD(textureName, unCoord3, lod) textureName.Load(int4(unCoord3, lod)) + + #define PLATFORM_SUPPORT_GATHER + #define GATHER_TEXTURE2D(textureName, samplerName, coord2) textureName.Gather(samplerName, coord2) + #define GATHER_TEXTURE2D_ARRAY(textureName, samplerName, coord2, index) textureName.Gather(samplerName, float3(coord2, index)) + #define GATHER_TEXTURECUBE(textureName, samplerName, coord3) textureName.Gather(samplerName, coord3) + #define GATHER_TEXTURECUBE_ARRAY(textureName, samplerName, coord3, index) textureName.Gather(samplerName, float4(coord3, index)) + #define GATHER_RED_TEXTURE2D(textureName, samplerName, coord2) textureName.GatherRed(samplerName, coord2) + #define GATHER_GREEN_TEXTURE2D(textureName, samplerName, coord2) textureName.GatherGreen(samplerName, coord2) + #define GATHER_BLUE_TEXTURE2D(textureName, samplerName, coord2) textureName.GatherBlue(samplerName, coord2) + #define GATHER_ALPHA_TEXTURE2D(textureName, samplerName, coord2) textureName.GatherAlpha(samplerName, coord2) + +#elif defined(SHADER_API_METAL) + + // Initialize arbitrary structure with zero values. + // Do not exist on some platform, in this case we need to have a standard name that call a function that will initialize all parameters to 0 + #define ZERO_INITIALIZE(type, name) name = (type)0; + #define ZERO_INITIALIZE_ARRAY(type, name, arraySize) { for (int arrayIndex = 0; arrayIndex < arraySize; arrayIndex++) { name[arrayIndex] = (type)0; } } + + // Texture util abstraction + + #define CALCULATE_TEXTURE2D_LOD(textureName, samplerName, coord2) textureName.CalculateLevelOfDetail(samplerName, coord2) + + // Texture abstraction + + #define TEXTURE2D(textureName) Texture2D textureName + #define TEXTURE2D_ARRAY(textureName) Texture2DArray textureName + #define TEXTURECUBE(textureName) TextureCube textureName + #define TEXTURECUBE_ARRAY(textureName) TextureCubeArray textureName + #define TEXTURE3D(textureName) Texture3D textureName + + #define TEXTURE2D_FLOAT(textureName) Texture2D_float textureName + #define TEXTURE2D_ARRAY_FLOAT(textureName) Texture2DArray textureName // no support to _float on Array, it's being added + #define TEXTURECUBE_FLOAT(textureName) TextureCube_float textureName + #define TEXTURECUBE_ARRAY_FLOAT(textureName) TextureCubeArray textureName // no support to _float on Array, it's being added + #define TEXTURE3D_FLOAT(textureName) Texture3D_float textureName + + #define TEXTURE2D_HALF(textureName) Texture2D_half textureName + #define TEXTURE2D_ARRAY_HALF(textureName) Texture2DArray textureName // no support to _float on Array, it's being added + #define TEXTURECUBE_HALF(textureName) TextureCube_half textureName + #define TEXTURECUBE_ARRAY_HALF(textureName) TextureCubeArray textureName // no support to _float on Array, it's being added + #define TEXTURE3D_HALF(textureName) Texture3D_half textureName + + #define TEXTURE2D_SHADOW(textureName) TEXTURE2D(textureName) + #define TEXTURE2D_ARRAY_SHADOW(textureName) TEXTURE2D_ARRAY(textureName) + #define TEXTURECUBE_SHADOW(textureName) TEXTURECUBE(textureName) + #define TEXTURECUBE_ARRAY_SHADOW(textureName) TEXTURECUBE_ARRAY(textureName) + + #define RW_TEXTURE2D(type, textureName) RWTexture2D textureName + #define RW_TEXTURE2D_ARRAY(type, textureName) RWTexture2DArray textureName + #define RW_TEXTURE3D(type, textureName) RWTexture3D textureName + + #define SAMPLER(samplerName) SamplerState samplerName + #define SAMPLER_CMP(samplerName) SamplerComparisonState samplerName + + #define TEXTURE2D_PARAM(textureName, samplerName) TEXTURE2D(textureName), SAMPLER(samplerName) + #define TEXTURE2D_ARRAY_PARAM(textureName, samplerName) TEXTURE2D_ARRAY(textureName), SAMPLER(samplerName) + #define TEXTURECUBE_PARAM(textureName, samplerName) TEXTURECUBE(textureName), SAMPLER(samplerName) + #define TEXTURECUBE_ARRAY_PARAM(textureName, samplerName) TEXTURECUBE_ARRAY(textureName), SAMPLER(samplerName) + #define TEXTURE3D_PARAM(textureName, samplerName) TEXTURE3D(textureName), SAMPLER(samplerName) + + #define TEXTURE2D_SHADOW_PARAM(textureName, samplerName) TEXTURE2D(textureName), SAMPLER_CMP(samplerName) + #define TEXTURE2D_ARRAY_SHADOW_PARAM(textureName, samplerName) TEXTURE2D_ARRAY(textureName), SAMPLER_CMP(samplerName) + #define TEXTURECUBE_SHADOW_PARAM(textureName, samplerName) TEXTURECUBE(textureName), SAMPLER_CMP(samplerName) + #define TEXTURECUBE_ARRAY_SHADOW_PARAM(textureName, samplerName) TEXTURECUBE_ARRAY(textureName), SAMPLER_CMP(samplerName) + + #define TEXTURE2D_ARGS(textureName, samplerName) textureName, samplerName + #define TEXTURE2D_ARRAY_ARGS(textureName, samplerName) textureName, samplerName + #define TEXTURECUBE_ARGS(textureName, samplerName) textureName, samplerName + #define TEXTURECUBE_ARRAY_ARGS(textureName, samplerName) textureName, samplerName + #define TEXTURE3D_ARGS(textureName, samplerName) textureName, samplerName + + #define TEXTURE2D_SHADOW_ARGS(textureName, samplerName) textureName, samplerName + #define TEXTURE2D_ARRAY_SHADOW_ARGS(textureName, samplerName) textureName, samplerName + #define TEXTURECUBE_SHADOW_ARGS(textureName, samplerName) textureName, samplerName + #define TEXTURECUBE_ARRAY_SHADOW_ARGS(textureName, samplerName) textureName, samplerName + + #define SAMPLE_TEXTURE2D(textureName, samplerName, coord2) textureName.Sample(samplerName, coord2) + #define SAMPLE_TEXTURE2D_LOD(textureName, samplerName, coord2, lod) textureName.SampleLevel(samplerName, coord2, lod) + #define SAMPLE_TEXTURE2D_BIAS(textureName, samplerName, coord2, bias) textureName.SampleBias(samplerName, coord2, bias) + #define SAMPLE_TEXTURE2D_GRAD(textureName, samplerName, coord2, dpdx, dpdy) textureName.SampleGrad(samplerName, coord2, dpdx, dpdy) + #define SAMPLE_TEXTURE2D_ARRAY(textureName, samplerName, coord2, index) textureName.Sample(samplerName, float3(coord2, index)) + #define SAMPLE_TEXTURE2D_ARRAY_LOD(textureName, samplerName, coord2, index, lod) textureName.SampleLevel(samplerName, float3(coord2, index), lod) + #define SAMPLE_TEXTURE2D_ARRAY_BIAS(textureName, samplerName, coord2, index, bias) textureName.SampleBias(samplerName, float3(coord2, index), bias) + #define SAMPLE_TEXTURE2D_ARRAY_GRAD(textureName, samplerName, coord2, index, dpdx, dpdy) textureName.SampleGrad(samplerName, float3(coord2, index), dpdx, dpdy) + #define SAMPLE_TEXTURECUBE(textureName, samplerName, coord3) textureName.Sample(samplerName, coord3) + #define SAMPLE_TEXTURECUBE_LOD(textureName, samplerName, coord3, lod) textureName.SampleLevel(samplerName, coord3, lod) + #define SAMPLE_TEXTURECUBE_BIAS(textureName, samplerName, coord3, bias) textureName.SampleBias(samplerName, coord3, bias) + #define SAMPLE_TEXTURECUBE_ARRAY(textureName, samplerName, coord3, index) textureName.Sample(samplerName, float4(coord3, index)) + #define SAMPLE_TEXTURECUBE_ARRAY_LOD(textureName, samplerName, coord3, index, lod) textureName.SampleLevel(samplerName, float4(coord3, index), lod) + #define SAMPLE_TEXTURECUBE_ARRAY_BIAS(textureName, samplerName, coord3, index, bias) textureName.SampleBias(samplerName, float4(coord3, index), bias) + #define SAMPLE_TEXTURE3D(textureName, samplerName, coord3) textureName.Sample(samplerName, coord3) + #define SAMPLE_TEXTURE3D_LOD(textureName, samplerName, coord3, lod) textureName.SampleLevel(samplerName, coord3, lod) + + #define SAMPLE_TEXTURE2D_SHADOW(textureName, samplerName, coord3) textureName.SampleCmpLevelZero(samplerName, (coord3).xy, (coord3).z) + #define SAMPLE_TEXTURE2D_ARRAY_SHADOW(textureName, samplerName, coord3, index) textureName.SampleCmpLevelZero(samplerName, float3((coord3).xy, index), (coord3).z) + #define SAMPLE_TEXTURECUBE_SHADOW(textureName, samplerName, coord4) textureName.SampleCmpLevelZero(samplerName, (coord4).xyz, (coord4).w) + #define SAMPLE_TEXTURECUBE_ARRAY_SHADOW(textureName, samplerName, coord4, index) textureName.SampleCmpLevelZero(samplerName, float4((coord4).xyz, index), (coord4).w) + + #define LOAD_TEXTURE2D(textureName, unCoord2) textureName.Load(int3(unCoord2, 0)) + #define LOAD_TEXTURE2D_LOD(textureName, unCoord2, lod) textureName.Load(int3(unCoord2, lod)) + #define LOAD_TEXTURE2D_MSAA(textureName, unCoord2, sampleIndex) textureName.Load(unCoord2, sampleIndex) + #define LOAD_TEXTURE2D_ARRAY(textureName, unCoord2, index) textureName.Load(int4(unCoord2, index, 0)) + #define LOAD_TEXTURE2D_ARRAY_MSAA(textureName, unCoord2, index, sampleIndex) textureName.Load(int3(unCoord2, index), sampleIndex) + #define LOAD_TEXTURE2D_ARRAY_LOD(textureName, unCoord2, index, lod) textureName.Load(int4(unCoord2, index, lod)) + #define LOAD_TEXTURE3D(textureName, unCoord3) textureName.Load(int4(unCoord3, 0)) + #define LOAD_TEXTURE3D_LOD(textureName, unCoord3, lod) textureName.Load(int4(unCoord3, lod)) + + #define PLATFORM_SUPPORT_GATHER + #define GATHER_TEXTURE2D(textureName, samplerName, coord2) textureName.Gather(samplerName, coord2) + #define GATHER_TEXTURE2D_ARRAY(textureName, samplerName, coord2, index) textureName.Gather(samplerName, float3(coord2, index)) + #define GATHER_TEXTURECUBE(textureName, samplerName, coord3) textureName.Gather(samplerName, coord3) + #define GATHER_TEXTURECUBE_ARRAY(textureName, samplerName, coord3, index) textureName.Gather(samplerName, float4(coord3, index)) + #define GATHER_RED_TEXTURE2D(textureName, samplerName, coord2) textureName.GatherRed(samplerName, coord2) + #define GATHER_GREEN_TEXTURE2D(textureName, samplerName, coord2) textureName.GatherGreen(samplerName, coord2) + #define GATHER_BLUE_TEXTURE2D(textureName, samplerName, coord2) textureName.GatherBlue(samplerName, coord2) + #define GATHER_ALPHA_TEXTURE2D(textureName, samplerName, coord2) textureName.GatherAlpha(samplerName, coord2) + +#elif defined(SHADER_API_VULKAN) +// This file assume SHADER_API_VULKAN is defined + // TODO: This is a straight copy from D3D11.hlsl. Go through all this stuff and adjust where needed. + + + // Initialize arbitrary structure with zero values. + // Do not exist on some platform, in this case we need to have a standard name that call a function that will initialize all parameters to 0 + #define ZERO_INITIALIZE(type, name) name = (type)0; + #define ZERO_INITIALIZE_ARRAY(type, name, arraySize) { for (int arrayIndex = 0; arrayIndex < arraySize; arrayIndex++) { name[arrayIndex] = (type)0; } } + + // Texture util abstraction + + #define CALCULATE_TEXTURE2D_LOD(textureName, samplerName, coord2) textureName.CalculateLevelOfDetail(samplerName, coord2) + + // Texture abstraction + + #define TEXTURE2D(textureName) Texture2D textureName + #define TEXTURE2D_ARRAY(textureName) Texture2DArray textureName + #define TEXTURECUBE(textureName) TextureCube textureName + #define TEXTURECUBE_ARRAY(textureName) TextureCubeArray textureName + #define TEXTURE3D(textureName) Texture3D textureName + + #define TEXTURE2D_FLOAT(textureName) Texture2D_float textureName + #define TEXTURE2D_ARRAY_FLOAT(textureName) Texture2DArray textureName // no support to _float on Array, it's being added + #define TEXTURECUBE_FLOAT(textureName) TextureCube_float textureName + #define TEXTURECUBE_ARRAY_FLOAT(textureName) TextureCubeArray textureName // no support to _float on Array, it's being added + #define TEXTURE3D_FLOAT(textureName) Texture3D_float textureName + + #define TEXTURE2D_HALF(textureName) Texture2D_half textureName + #define TEXTURE2D_ARRAY_HALF(textureName) Texture2DArray textureName // no support to _float on Array, it's being added + #define TEXTURECUBE_HALF(textureName) TextureCube_half textureName + #define TEXTURECUBE_ARRAY_HALF(textureName) TextureCubeArray textureName // no support to _float on Array, it's being added + #define TEXTURE3D_HALF(textureName) Texture3D_half textureName + + #define TEXTURE2D_SHADOW(textureName) TEXTURE2D(textureName) + #define TEXTURE2D_ARRAY_SHADOW(textureName) TEXTURE2D_ARRAY(textureName) + #define TEXTURECUBE_SHADOW(textureName) TEXTURECUBE(textureName) + #define TEXTURECUBE_ARRAY_SHADOW(textureName) TEXTURECUBE_ARRAY(textureName) + + #define RW_TEXTURE2D(type, textureName) RWTexture2D textureName + #define RW_TEXTURE2D_ARRAY(type, textureName) RWTexture2DArray textureName + #define RW_TEXTURE3D(type, textureName) RWTexture3D textureName + + #define SAMPLER(samplerName) SamplerState samplerName + #define SAMPLER_CMP(samplerName) SamplerComparisonState samplerName + + #define TEXTURE2D_PARAM(textureName, samplerName) TEXTURE2D(textureName), SAMPLER(samplerName) + #define TEXTURE2D_ARRAY_PARAM(textureName, samplerName) TEXTURE2D_ARRAY(textureName), SAMPLER(samplerName) + #define TEXTURECUBE_PARAM(textureName, samplerName) TEXTURECUBE(textureName), SAMPLER(samplerName) + #define TEXTURECUBE_ARRAY_PARAM(textureName, samplerName) TEXTURECUBE_ARRAY(textureName), SAMPLER(samplerName) + #define TEXTURE3D_PARAM(textureName, samplerName) TEXTURE3D(textureName), SAMPLER(samplerName) + + #define TEXTURE2D_SHADOW_PARAM(textureName, samplerName) TEXTURE2D(textureName), SAMPLER_CMP(samplerName) + #define TEXTURE2D_ARRAY_SHADOW_PARAM(textureName, samplerName) TEXTURE2D_ARRAY(textureName), SAMPLER_CMP(samplerName) + #define TEXTURECUBE_SHADOW_PARAM(textureName, samplerName) TEXTURECUBE(textureName), SAMPLER_CMP(samplerName) + #define TEXTURECUBE_ARRAY_SHADOW_PARAM(textureName, samplerName) TEXTURECUBE_ARRAY(textureName), SAMPLER_CMP(samplerName) + + #define TEXTURE2D_ARGS(textureName, samplerName) textureName, samplerName + #define TEXTURE2D_ARRAY_ARGS(textureName, samplerName) textureName, samplerName + #define TEXTURECUBE_ARGS(textureName, samplerName) textureName, samplerName + #define TEXTURECUBE_ARRAY_ARGS(textureName, samplerName) textureName, samplerName + #define TEXTURE3D_ARGS(textureName, samplerName) textureName, samplerName + + #define TEXTURE2D_SHADOW_ARGS(textureName, samplerName) textureName, samplerName + #define TEXTURE2D_ARRAY_SHADOW_ARGS(textureName, samplerName) textureName, samplerName + #define TEXTURECUBE_SHADOW_ARGS(textureName, samplerName) textureName, samplerName + #define TEXTURECUBE_ARRAY_SHADOW_ARGS(textureName, samplerName) textureName, samplerName + + #define SAMPLE_TEXTURE2D(textureName, samplerName, coord2) textureName.Sample(samplerName, coord2) + #define SAMPLE_TEXTURE2D_LOD(textureName, samplerName, coord2, lod) textureName.SampleLevel(samplerName, coord2, lod) + #define SAMPLE_TEXTURE2D_BIAS(textureName, samplerName, coord2, bias) textureName.SampleBias(samplerName, coord2, bias) + #define SAMPLE_TEXTURE2D_GRAD(textureName, samplerName, coord2, dpdx, dpdy) textureName.SampleGrad(samplerName, coord2, dpdx, dpdy) + #define SAMPLE_TEXTURE2D_ARRAY(textureName, samplerName, coord2, index) textureName.Sample(samplerName, float3(coord2, index)) + #define SAMPLE_TEXTURE2D_ARRAY_LOD(textureName, samplerName, coord2, index, lod) textureName.SampleLevel(samplerName, float3(coord2, index), lod) + #define SAMPLE_TEXTURE2D_ARRAY_BIAS(textureName, samplerName, coord2, index, bias) textureName.SampleBias(samplerName, float3(coord2, index), bias) + #define SAMPLE_TEXTURE2D_ARRAY_GRAD(textureName, samplerName, coord2, index, dpdx, dpdy) textureName.SampleGrad(samplerName, float3(coord2, index), dpdx, dpdy) + #define SAMPLE_TEXTURECUBE(textureName, samplerName, coord3) textureName.Sample(samplerName, coord3) + #define SAMPLE_TEXTURECUBE_LOD(textureName, samplerName, coord3, lod) textureName.SampleLevel(samplerName, coord3, lod) + #define SAMPLE_TEXTURECUBE_BIAS(textureName, samplerName, coord3, bias) textureName.SampleBias(samplerName, coord3, bias) + #define SAMPLE_TEXTURECUBE_ARRAY(textureName, samplerName, coord3, index) textureName.Sample(samplerName, float4(coord3, index)) + #define SAMPLE_TEXTURECUBE_ARRAY_LOD(textureName, samplerName, coord3, index, lod) textureName.SampleLevel(samplerName, float4(coord3, index), lod) + #define SAMPLE_TEXTURECUBE_ARRAY_BIAS(textureName, samplerName, coord3, index, bias) textureName.SampleBias(samplerName, float4(coord3, index), bias) + #define SAMPLE_TEXTURE3D(textureName, samplerName, coord3) textureName.Sample(samplerName, coord3) + #define SAMPLE_TEXTURE3D_LOD(textureName, samplerName, coord3, lod) textureName.SampleLevel(samplerName, coord3, lod) + + #define SAMPLE_TEXTURE2D_SHADOW(textureName, samplerName, coord3) textureName.SampleCmpLevelZero(samplerName, (coord3).xy, (coord3).z) + #define SAMPLE_TEXTURE2D_ARRAY_SHADOW(textureName, samplerName, coord3, index) textureName.SampleCmpLevelZero(samplerName, float3((coord3).xy, index), (coord3).z) + #define SAMPLE_TEXTURECUBE_SHADOW(textureName, samplerName, coord4) textureName.SampleCmpLevelZero(samplerName, (coord4).xyz, (coord4).w) + #define SAMPLE_TEXTURECUBE_ARRAY_SHADOW(textureName, samplerName, coord4, index) textureName.SampleCmpLevelZero(samplerName, float4((coord4).xyz, index), (coord4).w) + + #define LOAD_TEXTURE2D(textureName, unCoord2) textureName.Load(int3(unCoord2, 0)) + #define LOAD_TEXTURE2D_LOD(textureName, unCoord2, lod) textureName.Load(int3(unCoord2, lod)) + #define LOAD_TEXTURE2D_MSAA(textureName, unCoord2, sampleIndex) textureName.Load(unCoord2, sampleIndex) + #define LOAD_TEXTURE2D_ARRAY(textureName, unCoord2, index) textureName.Load(int4(unCoord2, index, 0)) + #define LOAD_TEXTURE2D_ARRAY_MSAA(textureName, unCoord2, index, sampleIndex) textureName.Load(int3(unCoord2, index), sampleIndex) + #define LOAD_TEXTURE2D_ARRAY_LOD(textureName, unCoord2, index, lod) textureName.Load(int4(unCoord2, index, lod)) + #define LOAD_TEXTURE3D(textureName, unCoord3) textureName.Load(int4(unCoord3, 0)) + #define LOAD_TEXTURE3D_LOD(textureName, unCoord3, lod) textureName.Load(int4(unCoord3, lod)) + + #define PLATFORM_SUPPORT_GATHER + #define GATHER_TEXTURE2D(textureName, samplerName, coord2) textureName.Gather(samplerName, coord2) + #define GATHER_TEXTURE2D_ARRAY(textureName, samplerName, coord2, index) textureName.Gather(samplerName, float3(coord2, index)) + #define GATHER_TEXTURECUBE(textureName, samplerName, coord3) textureName.Gather(samplerName, coord3) + #define GATHER_TEXTURECUBE_ARRAY(textureName, samplerName, coord3, index) textureName.Gather(samplerName, float4(coord3, index)) + #define GATHER_RED_TEXTURE2D(textureName, samplerName, coord2) textureName.GatherRed(samplerName, coord2) + #define GATHER_GREEN_TEXTURE2D(textureName, samplerName, coord2) textureName.GatherGreen(samplerName, coord2) + #define GATHER_BLUE_TEXTURE2D(textureName, samplerName, coord2) textureName.GatherBlue(samplerName, coord2) + #define GATHER_ALPHA_TEXTURE2D(textureName, samplerName, coord2) textureName.GatherAlpha(samplerName, coord2) + +#elif defined(SHADER_API_SWITCH) + // This file assume SHADER_API_SWITCH is defined + + // Initialize arbitrary structure with zero values. + // Do not exist on some platform, in this case we need to have a standard name that call a function that will initialize all parameters to 0 + #define ZERO_INITIALIZE(type, name) name = (type)0; + #define ZERO_INITIALIZE_ARRAY(type, name, arraySize) { for (int arrayIndex = 0; arrayIndex < arraySize; arrayIndex++) { name[arrayIndex] = (type)0; } } + + // Texture util abstraction + + #define CALCULATE_TEXTURE2D_LOD(textureName, samplerName, coord2) textureName.CalculateLevelOfDetail(samplerName, coord2) + + // Texture abstraction + + #define TEXTURE2D(textureName) Texture2D textureName + #define TEXTURE2D_ARRAY(textureName) Texture2DArray textureName + #define TEXTURECUBE(textureName) TextureCube textureName + #define TEXTURECUBE_ARRAY(textureName) TextureCubeArray textureName + #define TEXTURE3D(textureName) Texture3D textureName + + #define TEXTURE2D_FLOAT(textureName) Texture2D_float textureName + #define TEXTURE2D_ARRAY_FLOAT(textureName) Texture2DArray textureName // no support to _float on Array, it's being added + #define TEXTURECUBE_FLOAT(textureName) TextureCube_float textureName + #define TEXTURECUBE_ARRAY_FLOAT(textureName) TextureCubeArray textureName // no support to _float on Array, it's being added + #define TEXTURE3D_FLOAT(textureName) Texture3D_float textureName + + #define TEXTURE2D_HALF(textureName) Texture2D_half textureName + #define TEXTURE2D_ARRAY_HALF(textureName) Texture2DArray textureName // no support to _float on Array, it's being added + #define TEXTURECUBE_HALF(textureName) TextureCube_half textureName + #define TEXTURECUBE_ARRAY_HALF(textureName) TextureCubeArray textureName // no support to _float on Array, it's being added + #define TEXTURE3D_HALF(textureName) Texture3D_half textureName + + #define TEXTURE2D_SHADOW(textureName) TEXTURE2D(textureName) + #define TEXTURE2D_ARRAY_SHADOW(textureName) TEXTURE2D_ARRAY(textureName) + #define TEXTURECUBE_SHADOW(textureName) TEXTURECUBE(textureName) + #define TEXTURECUBE_ARRAY_SHADOW(textureName) TEXTURECUBE_ARRAY(textureName) + + #define RW_TEXTURE2D(type, textureName) RWTexture2D textureName + #define RW_TEXTURE2D_ARRAY(type, textureName) RWTexture2DArray textureName + #define RW_TEXTURE3D(type, textureName) RWTexture3D textureName + + #define SAMPLER(samplerName) SamplerState samplerName + #define SAMPLER_CMP(samplerName) SamplerComparisonState samplerName + + #define TEXTURE2D_PARAM(textureName, samplerName) TEXTURE2D(textureName), SAMPLER(samplerName) + #define TEXTURE2D_ARRAY_PARAM(textureName, samplerName) TEXTURE2D_ARRAY(textureName), SAMPLER(samplerName) + #define TEXTURECUBE_PARAM(textureName, samplerName) TEXTURECUBE(textureName), SAMPLER(samplerName) + #define TEXTURECUBE_ARRAY_PARAM(textureName, samplerName) TEXTURECUBE_ARRAY(textureName), SAMPLER(samplerName) + #define TEXTURE3D_PARAM(textureName, samplerName) TEXTURE3D(textureName), SAMPLER(samplerName) + + #define TEXTURE2D_SHADOW_PARAM(textureName, samplerName) TEXTURE2D(textureName), SAMPLER_CMP(samplerName) + #define TEXTURE2D_ARRAY_SHADOW_PARAM(textureName, samplerName) TEXTURE2D_ARRAY(textureName), SAMPLER_CMP(samplerName) + #define TEXTURECUBE_SHADOW_PARAM(textureName, samplerName) TEXTURECUBE(textureName), SAMPLER_CMP(samplerName) + #define TEXTURECUBE_ARRAY_SHADOW_PARAM(textureName, samplerName) TEXTURECUBE_ARRAY(textureName), SAMPLER_CMP(samplerName) + + #define TEXTURE2D_ARGS(textureName, samplerName) textureName, samplerName + #define TEXTURE2D_ARRAY_ARGS(textureName, samplerName) textureName, samplerName + #define TEXTURECUBE_ARGS(textureName, samplerName) textureName, samplerName + #define TEXTURECUBE_ARRAY_ARGS(textureName, samplerName) textureName, samplerName + #define TEXTURE3D_ARGS(textureName, samplerName) textureName, samplerName + + #define TEXTURE2D_SHADOW_ARGS(textureName, samplerName) textureName, samplerName + #define TEXTURE2D_ARRAY_SHADOW_ARGS(textureName, samplerName) textureName, samplerName + #define TEXTURECUBE_SHADOW_ARGS(textureName, samplerName) textureName, samplerName + #define TEXTURECUBE_ARRAY_SHADOW_ARGS(textureName, samplerName) textureName, samplerName + + #define SAMPLE_TEXTURE2D(textureName, samplerName, coord2) textureName.Sample(samplerName, coord2) + #define SAMPLE_TEXTURE2D_LOD(textureName, samplerName, coord2, lod) textureName.SampleLevel(samplerName, coord2, lod) + #define SAMPLE_TEXTURE2D_BIAS(textureName, samplerName, coord2, bias) textureName.SampleBias(samplerName, coord2, bias) + #define SAMPLE_TEXTURE2D_GRAD(textureName, samplerName, coord2, dpdx, dpdy) textureName.SampleGrad(samplerName, coord2, dpdx, dpdy) + #define SAMPLE_TEXTURE2D_ARRAY(textureName, samplerName, coord2, index) textureName.Sample(samplerName, float3(coord2, index)) + #define SAMPLE_TEXTURE2D_ARRAY_LOD(textureName, samplerName, coord2, index, lod) textureName.SampleLevel(samplerName, float3(coord2, index), lod) + #define SAMPLE_TEXTURE2D_ARRAY_BIAS(textureName, samplerName, coord2, index, bias) textureName.SampleBias(samplerName, float3(coord2, index), bias) + #define SAMPLE_TEXTURE2D_ARRAY_GRAD(textureName, samplerName, coord2, index, dpdx, dpdy) textureName.SampleGrad(samplerName, float3(coord2, index), dpdx, dpdy) + #define SAMPLE_TEXTURECUBE(textureName, samplerName, coord3) textureName.Sample(samplerName, coord3) + #define SAMPLE_TEXTURECUBE_LOD(textureName, samplerName, coord3, lod) textureName.SampleLevel(samplerName, coord3, lod) + #define SAMPLE_TEXTURECUBE_BIAS(textureName, samplerName, coord3, bias) textureName.SampleBias(samplerName, coord3, bias) + #define SAMPLE_TEXTURECUBE_ARRAY(textureName, samplerName, coord3, index) textureName.Sample(samplerName, float4(coord3, index)) + #define SAMPLE_TEXTURECUBE_ARRAY_LOD(textureName, samplerName, coord3, index, lod) textureName.SampleLevel(samplerName, float4(coord3, index), lod) + #define SAMPLE_TEXTURECUBE_ARRAY_BIAS(textureName, samplerName, coord3, index, bias) textureName.SampleBias(samplerName, float4(coord3, index), bias) + #define SAMPLE_TEXTURE3D(textureName, samplerName, coord3) textureName.Sample(samplerName, coord3) + #define SAMPLE_TEXTURE3D_LOD(textureName, samplerName, coord3, lod) textureName.SampleLevel(samplerName, coord3, lod) + + #define SAMPLE_TEXTURE2D_SHADOW(textureName, samplerName, coord3) textureName.SampleCmpLevelZero(samplerName, (coord3).xy, (coord3).z) + #define SAMPLE_TEXTURE2D_ARRAY_SHADOW(textureName, samplerName, coord3, index) textureName.SampleCmpLevelZero(samplerName, float3((coord3).xy, index), (coord3).z) + #define SAMPLE_TEXTURECUBE_SHADOW(textureName, samplerName, coord4) textureName.SampleCmpLevelZero(samplerName, (coord4).xyz, (coord4).w) + #define SAMPLE_TEXTURECUBE_ARRAY_SHADOW(textureName, samplerName, coord4, index) textureName.SampleCmpLevelZero(samplerName, float4((coord4).xyz, index), (coord4).w) + + + #define LOAD_TEXTURE2D(textureName, unCoord2) textureName.Load(int3(unCoord2, 0)) + #define LOAD_TEXTURE2D_LOD(textureName, unCoord2, lod) textureName.Load(int3(unCoord2, lod)) + #define LOAD_TEXTURE2D_MSAA(textureName, unCoord2, sampleIndex) textureName.Load(unCoord2, sampleIndex) + #define LOAD_TEXTURE2D_ARRAY(textureName, unCoord2, index) textureName.Load(int4(unCoord2, index, 0)) + #define LOAD_TEXTURE2D_ARRAY_LOD(textureName, unCoord2, index, lod) textureName.Load(int4(unCoord2, index, lod)) + #define LOAD_TEXTURE3D(textureName, unCoord3) textureName.Load(int4(unCoord3, 0)) + #define LOAD_TEXTURE3D_LOD(textureName, unCoord3, lod) textureName.Load(int4(unCoord3, lod)) + + #define PLATFORM_SUPPORT_GATHER + #define GATHER_TEXTURE2D(textureName, samplerName, coord2) textureName.Gather(samplerName, coord2) + #define GATHER_TEXTURE2D_ARRAY(textureName, samplerName, coord2, index) textureName.Gather(samplerName, float3(coord2, index)) + #define GATHER_TEXTURECUBE(textureName, samplerName, coord3) textureName.Gather(samplerName, coord3) + #define GATHER_TEXTURECUBE_ARRAY(textureName, samplerName, coord3, index) textureName.Gather(samplerName, float4(coord3, index)) + #define GATHER_RED_TEXTURE2D(textureName, samplerName, coord2) textureName.GatherRed(samplerName, coord2) + #define GATHER_GREEN_TEXTURE2D(textureName, samplerName, coord2) textureName.GatherGreen(samplerName, coord2) + #define GATHER_BLUE_TEXTURE2D(textureName, samplerName, coord2) textureName.GatherBlue(samplerName, coord2) + #define GATHER_ALPHA_TEXTURE2D(textureName, samplerName, coord2) textureName.GatherAlpha(samplerName, coord2) + +#elif defined(SHADER_API_GLCORE) + + // OpenGL 4.1 SM 5.0 https://docs.unity3d.com/Manual/SL-ShaderCompileTargets.html + #if (SHADER_TARGET >= 46) + #define OPENGL4_1_SM5 1 + #else + #define OPENGL4_1_SM5 0 + #endif + + // Initialize arbitrary structure with zero values. + // Do not exist on some platform, in this case we need to have a standard name that call a function that will initialize all parameters to 0 + #define ZERO_INITIALIZE(type, name) name = (type)0; + #define ZERO_INITIALIZE_ARRAY(type, name, arraySize) { for (int arrayIndex = 0; arrayIndex < arraySize; arrayIndex++) { name[arrayIndex] = (type)0; } } + + // Texture util abstraction + + #define CALCULATE_TEXTURE2D_LOD(textureName, samplerName, coord2) textureName.CalculateLevelOfDetail(samplerName, coord2) + + // Texture abstraction + + #define TEXTURE2D(textureName) Texture2D textureName + #define TEXTURE2D_ARRAY(textureName) Texture2DArray textureName + #define TEXTURECUBE(textureName) TextureCube textureName + #define TEXTURECUBE_ARRAY(textureName) TextureCubeArray textureName + #define TEXTURE3D(textureName) Texture3D textureName + + #define TEXTURE2D_FLOAT(textureName) TEXTURE2D(textureName) + #define TEXTURE2D_ARRAY_FLOAT(textureName) TEXTURE2D_ARRAY(textureName) + #define TEXTURECUBE_FLOAT(textureName) TEXTURECUBE(textureName) + #define TEXTURECUBE_ARRAY_FLOAT(textureName) TEXTURECUBE_ARRAY(textureName) + #define TEXTURE3D_FLOAT(textureName) TEXTURE3D(textureName) + + #define TEXTURE2D_HALF(textureName) TEXTURE2D(textureName) + #define TEXTURE2D_ARRAY_HALF(textureName) TEXTURE2D_ARRAY(textureName) + #define TEXTURECUBE_HALF(textureName) TEXTURECUBE(textureName) + #define TEXTURECUBE_ARRAY_HALF(textureName) TEXTURECUBE_ARRAY(textureName) + #define TEXTURE3D_HALF(textureName) TEXTURE3D(textureName) + + #define TEXTURE2D_SHADOW(textureName) TEXTURE2D(textureName) + #define TEXTURE2D_ARRAY_SHADOW(textureName) TEXTURE2D_ARRAY(textureName) + #define TEXTURECUBE_SHADOW(textureName) TEXTURECUBE(textureName) + #define TEXTURECUBE_ARRAY_SHADOW(textureName) TEXTURECUBE_ARRAY(textureName) + + #define RW_TEXTURE2D(type, textureName) RWTexture2D textureName + #define RW_TEXTURE2D_ARRAY(type, textureName) RWTexture2DArray textureName + #define RW_TEXTURE3D(type, textureName) RWTexture3D textureName + + #define SAMPLER(samplerName) SamplerState samplerName + #define SAMPLER_CMP(samplerName) SamplerComparisonState samplerName + + #define TEXTURE2D_PARAM(textureName, samplerName) TEXTURE2D(textureName), SAMPLER(samplerName) + #define TEXTURE2D_ARRAY_PARAM(textureName, samplerName) TEXTURE2D_ARRAY(textureName), SAMPLER(samplerName) + #define TEXTURECUBE_PARAM(textureName, samplerName) TEXTURECUBE(textureName), SAMPLER(samplerName) + #define TEXTURECUBE_ARRAY_PARAM(textureName, samplerName) TEXTURECUBE_ARRAY(textureName), SAMPLER(samplerName) + #define TEXTURE3D_PARAM(textureName, samplerName) TEXTURE3D(textureName), SAMPLER(samplerName) + + #define TEXTURE2D_SHADOW_PARAM(textureName, samplerName) TEXTURE2D(textureName), SAMPLER_CMP(samplerName) + #define TEXTURE2D_ARRAY_SHADOW_PARAM(textureName, samplerName) TEXTURE2D_ARRAY(textureName), SAMPLER_CMP(samplerName) + #define TEXTURECUBE_SHADOW_PARAM(textureName, samplerName) TEXTURECUBE(textureName), SAMPLER_CMP(samplerName) + #define TEXTURECUBE_ARRAY_SHADOW_PARAM(textureName, samplerName) TEXTURECUBE_ARRAY(textureName), SAMPLER_CMP(samplerName) + + #define TEXTURE2D_ARGS(textureName, samplerName) textureName, samplerName + #define TEXTURE2D_ARRAY_ARGS(textureName, samplerName) textureName, samplerName + #define TEXTURECUBE_ARGS(textureName, samplerName) textureName, samplerName + #define TEXTURECUBE_ARRAY_ARGS(textureName, samplerName) textureName, samplerName + #define TEXTURE3D_ARGS(textureName, samplerName) textureName, samplerName + + #define TEXTURE2D_SHADOW_ARGS(textureName, samplerName) textureName, samplerName + #define TEXTURE2D_ARRAY_SHADOW_ARGS(textureName, samplerName) textureName, samplerName + #define TEXTURECUBE_SHADOW_ARGS(textureName, samplerName) textureName, samplerName + #define TEXTURECUBE_ARRAY_SHADOW_ARGS(textureName, samplerName) textureName, samplerName + + #define SAMPLE_TEXTURE2D(textureName, samplerName, coord2) textureName.Sample(samplerName, coord2) + #define SAMPLE_TEXTURE2D_LOD(textureName, samplerName, coord2, lod) textureName.SampleLevel(samplerName, coord2, lod) + #define SAMPLE_TEXTURE2D_BIAS(textureName, samplerName, coord2, bias) textureName.SampleBias(samplerName, coord2, bias) + #define SAMPLE_TEXTURE2D_GRAD(textureName, samplerName, coord2, ddx, ddy) textureName.SampleGrad(samplerName, coord2, ddx, ddy) + #define SAMPLE_TEXTURE2D_ARRAY(textureName, samplerName, coord2, index) textureName.Sample(samplerName, float3(coord2, index)) + #define SAMPLE_TEXTURE2D_ARRAY_LOD(textureName, samplerName, coord2, index, lod) textureName.SampleLevel(samplerName, float3(coord2, index), lod) + #define SAMPLE_TEXTURE2D_ARRAY_BIAS(textureName, samplerName, coord2, index, bias) textureName.SampleBias(samplerName, float3(coord2, index), bias) + #define SAMPLE_TEXTURE2D_ARRAY_GRAD(textureName, samplerName, coord2, index, dpdx, dpdy) textureName.SampleGrad(samplerName, float3(coord2, index), dpdx, dpdy) + #define SAMPLE_TEXTURECUBE(textureName, samplerName, coord3) textureName.Sample(samplerName, coord3) + #define SAMPLE_TEXTURECUBE_LOD(textureName, samplerName, coord3, lod) textureName.SampleLevel(samplerName, coord3, lod) + #define SAMPLE_TEXTURECUBE_BIAS(textureName, samplerName, coord3, bias) textureName.SampleBias(samplerName, coord3, bias) + #ifdef UNITY_NO_CUBEMAP_ARRAY + #define SAMPLE_TEXTURECUBE_ARRAY(textureName, samplerName, coord3, index) ERROR_ON_UNSUPPORTED_FUNCTION(SAMPLE_TEXTURECUBE_ARRAY) + #define SAMPLE_TEXTURECUBE_ARRAY_LOD(textureName, samplerName, coord3, index, lod) ERROR_ON_UNSUPPORTED_FUNCTION(SAMPLE_TEXTURECUBE_ARRAY_LOD) + #define SAMPLE_TEXTURECUBE_ARRAY_LOD(textureName, samplerName, coord3, index, bias) ERROR_ON_UNSUPPORTED_FUNCTION(SAMPLE_TEXTURECUBE_ARRAY_LOD) + #else + #define SAMPLE_TEXTURECUBE_ARRAY(textureName, samplerName, coord3, index) textureName.Sample(samplerName, float4(coord3, index)) + #define SAMPLE_TEXTURECUBE_ARRAY_LOD(textureName, samplerName, coord3, index, lod) textureName.SampleLevel(samplerName, float4(coord3, index), lod) + #define SAMPLE_TEXTURECUBE_ARRAY_BIAS(textureName, samplerName, coord3, index, bias)textureName.SampleBias(samplerName, float4(coord3, index), bias) + #endif + #define SAMPLE_TEXTURE3D(textureName, samplerName, coord3) textureName.Sample(samplerName, coord3) + #define SAMPLE_TEXTURE3D_LOD(textureName, samplerName, coord3, lod) textureName.SampleLevel(samplerName, coord3, lod) + + #define SAMPLE_TEXTURE2D_SHADOW(textureName, samplerName, coord3) textureName.SampleCmpLevelZero(samplerName, (coord3).xy, (coord3).z) + #define SAMPLE_TEXTURE2D_ARRAY_SHADOW(textureName, samplerName, coord3, index) textureName.SampleCmpLevelZero(samplerName, float3((coord3).xy, index), (coord3).z) + #define SAMPLE_TEXTURECUBE_SHADOW(textureName, samplerName, coord4) textureName.SampleCmpLevelZero(samplerName, (coord4).xyz, (coord4).w) + #define SAMPLE_TEXTURECUBE_ARRAY_SHADOW(textureName, samplerName, coord4, index) textureName.SampleCmpLevelZero(samplerName, float4((coord4).xyz, index), (coord4).w) + + #define LOAD_TEXTURE2D(textureName, unCoord2) textureName.Load(int3(unCoord2, 0)) + #define LOAD_TEXTURE2D_LOD(textureName, unCoord2, lod) textureName.Load(int3(unCoord2, lod)) + #define LOAD_TEXTURE2D_MSAA(textureName, unCoord2, sampleIndex) textureName.Load(unCoord2, sampleIndex) + #define LOAD_TEXTURE2D_ARRAY(textureName, unCoord2, index) textureName.Load(int4(unCoord2, index, 0)) + #define LOAD_TEXTURE2D_ARRAY_MSAA(textureName, unCoord2, index, sampleIndex) textureName.Load(int3(unCoord2, index), sampleIndex) + #define LOAD_TEXTURE2D_ARRAY_LOD(textureName, unCoord2, index, lod) textureName.Load(int4(unCoord2, index, lod)) + + #if OPENGL4_1_SM5 + #define PLATFORM_SUPPORT_GATHER + #define GATHER_TEXTURE2D(textureName, samplerName, coord2) textureName.Gather(samplerName, coord2) + #define GATHER_TEXTURE2D_ARRAY(textureName, samplerName, coord2, index) textureName.Gather(samplerName, float3(coord2, index)) + #define GATHER_TEXTURECUBE(textureName, samplerName, coord3) textureName.Gather(samplerName, coord3) + #define GATHER_TEXTURECUBE_ARRAY(textureName, samplerName, coord3, index) textureName.Gather(samplerName, float4(coord3, index)) + #else + #define GATHER_TEXTURE2D(textureName, samplerName, coord2) ERROR_ON_UNSUPPORTED_FUNCTION(GATHER_TEXTURE2D) + #define GATHER_TEXTURE2D_ARRAY(textureName, samplerName, coord2, index) ERROR_ON_UNSUPPORTED_FUNCTION(GATHER_TEXTURE2D_ARRAY) + #define GATHER_TEXTURECUBE(textureName, samplerName, coord3) ERROR_ON_UNSUPPORTED_FUNCTION(GATHER_TEXTURECUBE) + #define GATHER_TEXTURECUBE_ARRAY(textureName, samplerName, coord3, index) ERROR_ON_UNSUPPORTED_FUNCTION(GATHER_TEXTURECUBE_ARRAY) + #endif + + + #elif defined(SHADER_API_GLES3) + + // GLES 3.1 + AEP shader feature https://docs.unity3d.com/Manual/SL-ShaderCompileTargets.html + #if (SHADER_TARGET >= 40) + #define GLES3_1_AEP 1 + #else + #define GLES3_1_AEP 0 + #endif + + // Initialize arbitrary structure with zero values. + // Do not exist on some platform, in this case we need to have a standard name that call a function that will initialize all parameters to 0 + #define ZERO_INITIALIZE(type, name) name = (type)0; + #define ZERO_INITIALIZE_ARRAY(type, name, arraySize) { for (int arrayIndex = 0; arrayIndex < arraySize; arrayIndex++) { name[arrayIndex] = (type)0; } } + + // Texture util abstraction + + #define CALCULATE_TEXTURE2D_LOD(textureName, samplerName, coord2) textureName.CalculateLevelOfDetail(samplerName, coord2) + + // Texture abstraction + + #define TEXTURE2D(textureName) Texture2D textureName + #define TEXTURE2D_ARRAY(textureName) Texture2DArray textureName + #define TEXTURECUBE(textureName) TextureCube textureName + #define TEXTURECUBE_ARRAY(textureName) TextureCubeArray textureName + #define TEXTURE3D(textureName) Texture3D textureName + + #define TEXTURE2D_FLOAT(textureName) Texture2D_float textureName + #define TEXTURE2D_ARRAY_FLOAT(textureName) Texture2DArray textureName // no support to _float on Array, it's being added + #define TEXTURECUBE_FLOAT(textureName) TextureCube_float textureName + #define TEXTURECUBE_ARRAY_FLOAT(textureName) TextureCubeArray textureName // no support to _float on Array, it's being added + #define TEXTURE3D_FLOAT(textureName) Texture3D_float textureName + + #define TEXTURE2D_HALF(textureName) Texture2D_half textureName + #define TEXTURE2D_ARRAY_HALF(textureName) Texture2DArray textureName // no support to _float on Array, it's being added + #define TEXTURECUBE_HALF(textureName) TextureCube_half textureName + #define TEXTURECUBE_ARRAY_HALF(textureName) TextureCubeArray textureName // no support to _float on Array, it's being added + #define TEXTURE3D_HALF(textureName) Texture3D_half textureName + + #define TEXTURE2D_SHADOW(textureName) TEXTURE2D(textureName) + #define TEXTURE2D_ARRAY_SHADOW(textureName) TEXTURE2D_ARRAY(textureName) + #define TEXTURECUBE_SHADOW(textureName) TEXTURECUBE(textureName) + #define TEXTURECUBE_ARRAY_SHADOW(textureName) TEXTURECUBE_ARRAY(textureName) + + #if GLES3_1_AEP + #define RW_TEXTURE2D(type, textureName) RWTexture2D textureName + #define RW_TEXTURE2D_ARRAY(type, textureName) RWTexture2DArray textureName + #define RW_TEXTURE3D(type, textureName) RWTexture3D textureName + #else + #define RW_TEXTURE2D(type, textureName) ERROR_ON_UNSUPPORTED_FUNCTION(RWTexture2D) + #define RW_TEXTURE2D_ARRAY(type, textureName) ERROR_ON_UNSUPPORTED_FUNCTION(RWTexture2DArray) + #define RW_TEXTURE3D(type, textureName) ERROR_ON_UNSUPPORTED_FUNCTION(RWTexture3D) + #endif + + #define SAMPLER(samplerName) SamplerState samplerName + #define SAMPLER_CMP(samplerName) SamplerComparisonState samplerName + + #define TEXTURE2D_PARAM(textureName, samplerName) TEXTURE2D(textureName), SAMPLER(samplerName) + #define TEXTURE2D_ARRAY_PARAM(textureName, samplerName) TEXTURE2D_ARRAY(textureName), SAMPLER(samplerName) + #define TEXTURECUBE_PARAM(textureName, samplerName) TEXTURECUBE(textureName), SAMPLER(samplerName) + #define TEXTURECUBE_ARRAY_PARAM(textureName, samplerName) TEXTURECUBE_ARRAY(textureName), SAMPLER(samplerName) + #define TEXTURE3D_PARAM(textureName, samplerName) TEXTURE3D(textureName), SAMPLER(samplerName) + + #define TEXTURE2D_SHADOW_PARAM(textureName, samplerName) TEXTURE2D(textureName), SAMPLER_CMP(samplerName) + #define TEXTURE2D_ARRAY_SHADOW_PARAM(textureName, samplerName) TEXTURE2D_ARRAY(textureName), SAMPLER_CMP(samplerName) + #define TEXTURECUBE_SHADOW_PARAM(textureName, samplerName) TEXTURECUBE(textureName), SAMPLER_CMP(samplerName) + #define TEXTURECUBE_ARRAY_SHADOW_PARAM(textureName, samplerName) TEXTURECUBE_ARRAY(textureName), SAMPLER_CMP(samplerName) + + #define TEXTURE2D_ARGS(textureName, samplerName) textureName, samplerName + #define TEXTURE2D_ARRAY_ARGS(textureName, samplerName) textureName, samplerName + #define TEXTURECUBE_ARGS(textureName, samplerName) textureName, samplerName + #define TEXTURECUBE_ARRAY_ARGS(textureName, samplerName) textureName, samplerName + #define TEXTURE3D_ARGS(textureName, samplerName) textureName, samplerName + + #define TEXTURE2D_SHADOW_ARGS(textureName, samplerName) textureName, samplerName + #define TEXTURE2D_ARRAY_SHADOW_ARGS(textureName, samplerName) textureName, samplerName + #define TEXTURECUBE_SHADOW_ARGS(textureName, samplerName) textureName, samplerName + #define TEXTURECUBE_ARRAY_SHADOW_ARGS(textureName, samplerName) textureName, samplerName + + #define SAMPLE_TEXTURE2D(textureName, samplerName, coord2) textureName.Sample(samplerName, coord2) + #define SAMPLE_TEXTURE2D_LOD(textureName, samplerName, coord2, lod) textureName.SampleLevel(samplerName, coord2, lod) + #define SAMPLE_TEXTURE2D_BIAS(textureName, samplerName, coord2, bias) textureName.SampleBias(samplerName, coord2, bias) + #define SAMPLE_TEXTURE2D_GRAD(textureName, samplerName, coord2, ddx, ddy) textureName.SampleGrad(samplerName, coord2, ddx, ddy) + #define SAMPLE_TEXTURE2D_ARRAY(textureName, samplerName, coord2, index) textureName.Sample(samplerName, float3(coord2, index)) + #define SAMPLE_TEXTURE2D_ARRAY_LOD(textureName, samplerName, coord2, index, lod) textureName.SampleLevel(samplerName, float3(coord2, index), lod) + #define SAMPLE_TEXTURE2D_ARRAY_BIAS(textureName, samplerName, coord2, index, bias) textureName.SampleBias(samplerName, float3(coord2, index), bias) + #define SAMPLE_TEXTURE2D_ARRAY_GRAD(textureName, samplerName, coord2, index, dpdx, dpdy) textureName.SampleGrad(samplerName, float3(coord2, index), dpdx, dpdy) + #define SAMPLE_TEXTURECUBE(textureName, samplerName, coord3) textureName.Sample(samplerName, coord3) + #define SAMPLE_TEXTURECUBE_LOD(textureName, samplerName, coord3, lod) textureName.SampleLevel(samplerName, coord3, lod) + #define SAMPLE_TEXTURECUBE_BIAS(textureName, samplerName, coord3, bias) textureName.SampleBias(samplerName, coord3, bias) + + #ifdef UNITY_NO_CUBEMAP_ARRAY + #define SAMPLE_TEXTURECUBE_ARRAY(textureName, samplerName, coord3, index) ERROR_ON_UNSUPPORTED_FUNCTION(SAMPLE_TEXTURECUBE_ARRAY) + #define SAMPLE_TEXTURECUBE_ARRAY_LOD(textureName, samplerName, coord3, index, lod) ERROR_ON_UNSUPPORTED_FUNCTION(SAMPLE_TEXTURECUBE_ARRAY_LOD) + #define SAMPLE_TEXTURECUBE_ARRAY_BIAS(textureName, samplerName, coord3, index, bias)ERROR_ON_UNSUPPORTED_FUNCTION(SAMPLE_TEXTURECUBE_ARRAY_BIAS) + #else + #define SAMPLE_TEXTURECUBE_ARRAY(textureName, samplerName, coord3, index) textureName.Sample(samplerName, float4(coord3, index)) + #define SAMPLE_TEXTURECUBE_ARRAY_LOD(textureName, samplerName, coord3, index, lod) textureName.SampleLevel(samplerName, float4(coord3, index), lod) + #define SAMPLE_TEXTURECUBE_ARRAY_BIAS(textureName, samplerName, coord3, index, bias)textureName.SampleBias(samplerName, float4(coord3, index), bias) + #endif + + #define SAMPLE_TEXTURE3D(textureName, samplerName, coord3) textureName.Sample(samplerName, coord3) + #define SAMPLE_TEXTURE3D_LOD(textureName, samplerName, coord3, lod) textureName.SampleLevel(samplerName, coord3, lod) + + #define SAMPLE_TEXTURE2D_SHADOW(textureName, samplerName, coord3) textureName.SampleCmpLevelZero(samplerName, (coord3).xy, (coord3).z) + #define SAMPLE_TEXTURE2D_ARRAY_SHADOW(textureName, samplerName, coord3, index) textureName.SampleCmpLevelZero(samplerName, float3((coord3).xy, index), (coord3).z) + #define SAMPLE_TEXTURECUBE_SHADOW(textureName, samplerName, coord4) textureName.SampleCmpLevelZero(samplerName, (coord4).xyz, (coord4).w) + #define SAMPLE_TEXTURECUBE_ARRAY_SHADOW(textureName, samplerName, coord4, index) textureName.SampleCmpLevelZero(samplerName, float4((coord4).xyz, index), (coord4).w) + + + #define LOAD_TEXTURE2D(textureName, unCoord2) textureName.Load(int3(unCoord2, 0)) + #define LOAD_TEXTURE2D_LOD(textureName, unCoord2, lod) textureName.Load(int3(unCoord2, lod)) + #define LOAD_TEXTURE2D_MSAA(textureName, unCoord2, sampleIndex) textureName.Load(unCoord2, sampleIndex) + #define LOAD_TEXTURE2D_ARRAY(textureName, unCoord2, index) textureName.Load(int4(unCoord2, index, 0)) + #define LOAD_TEXTURE2D_ARRAY_MSAA(textureName, unCoord2, index, sampleIndex) textureName.Load(int3(unCoord2, index), sampleIndex) + #define LOAD_TEXTURE2D_ARRAY_LOD(textureName, unCoord2, index, lod) textureName.Load(int4(unCoord2, index, lod)) + #define LOAD_TEXTURE3D(textureName, unCoord3) textureName.Load(int4(unCoord3, 0)) + #define LOAD_TEXTURE3D_LOD(textureName, unCoord3, lod) textureName.Load(int4(unCoord3, lod)) + + #if GLES3_1_AEP + #define PLATFORM_SUPPORT_GATHER + #define GATHER_TEXTURE2D(textureName, samplerName, coord2) textureName.Gather(samplerName, coord2) + #define GATHER_TEXTURE2D_ARRAY(textureName, samplerName, coord2, index) textureName.Gather(samplerName, float3(coord2, index)) + #define GATHER_TEXTURECUBE(textureName, samplerName, coord3) textureName.Gather(samplerName, coord3) + #define GATHER_TEXTURECUBE_ARRAY(textureName, samplerName, coord3, index) textureName.Gather(samplerName, float4(coord3, index)) + #define GATHER_RED_TEXTURE2D(textureName, samplerName, coord2) textureName.GatherRed(samplerName, coord2) + #define GATHER_GREEN_TEXTURE2D(textureName, samplerName, coord2) textureName.GatherGreen(samplerName, coord2) + #define GATHER_BLUE_TEXTURE2D(textureName, samplerName, coord2) textureName.GatherBlue(samplerName, coord2) + #define GATHER_ALPHA_TEXTURE2D(textureName, samplerName, coord2) textureName.GatherAlpha(samplerName, coord2) + #else + #define GATHER_TEXTURE2D(textureName, samplerName, coord2) ERROR_ON_UNSUPPORTED_FUNCTION(GATHER_TEXTURE2D) + #define GATHER_TEXTURE2D_ARRAY(textureName, samplerName, coord2, index) ERROR_ON_UNSUPPORTED_FUNCTION(GATHER_TEXTURE2D_ARRAY) + #define GATHER_TEXTURECUBE(textureName, samplerName, coord3) ERROR_ON_UNSUPPORTED_FUNCTION(GATHER_TEXTURECUBE) + #define GATHER_TEXTURECUBE_ARRAY(textureName, samplerName, coord3, index) ERROR_ON_UNSUPPORTED_FUNCTION(GATHER_TEXTURECUBE_ARRAY) + #define GATHER_RED_TEXTURE2D(textureName, samplerName, coord2) ERROR_ON_UNSUPPORTED_FUNCTION(GATHER_RED_TEXTURE2D) + #define GATHER_GREEN_TEXTURE2D(textureName, samplerName, coord2) ERROR_ON_UNSUPPORTED_FUNCTION(GATHER_GREEN_TEXTURE2D) + #define GATHER_BLUE_TEXTURE2D(textureName, samplerName, coord2) ERROR_ON_UNSUPPORTED_FUNCTION(GATHER_BLUE_TEXTURE2D) + #define GATHER_ALPHA_TEXTURE2D(textureName, samplerName, coord2) ERROR_ON_UNSUPPORTED_FUNCTION(GATHER_ALPHA_TEXTURE2D) + #endif + + +#elif defined(SHADER_API_GLES) + + + #define uint int + + #define rcp(x) 1.0 / (x) + #define ddx_fine ddx + #define ddy_fine ddy + #define asfloat + #define asuint(x) asint(x) + #define f32tof16 + #define f16tof32 + + #define ERROR_ON_UNSUPPORTED_FUNCTION(funcName) #error #funcName is not supported on GLES 2.0 + + // Initialize arbitrary structure with zero values. + // Do not exist on some platform, in this case we need to have a standard name that call a function that will initialize all parameters to 0 + #define ZERO_INITIALIZE(type, name) name = (type)0; + #define ZERO_INITIALIZE_ARRAY(type, name, arraySize) { for (int arrayIndex = 0; arrayIndex < arraySize; arrayIndex++) { name[arrayIndex] = (type)0; } } + + + // Texture util abstraction + + #define CALCULATE_TEXTURE2D_LOD(textureName, samplerName, coord2) #error calculate Level of Detail not supported in GLES2 + + // Texture abstraction + + #define TEXTURE2D(textureName) sampler2D textureName + #define TEXTURE2D_ARRAY(textureName) samplerCUBE textureName // No support to texture2DArray + #define TEXTURECUBE(textureName) samplerCUBE textureName + #define TEXTURECUBE_ARRAY(textureName) samplerCUBE textureName // No supoport to textureCubeArray and can't emulate with texture2DArray + #define TEXTURE3D(textureName) sampler3D textureName + + #define TEXTURE2D_FLOAT(textureName) sampler2D_float textureName + #define TEXTURE2D_ARRAY_FLOAT(textureName) TEXTURECUBE_FLOAT(textureName) // No support to texture2DArray + #define TEXTURECUBE_FLOAT(textureName) samplerCUBE_float textureName + #define TEXTURECUBE_ARRAY_FLOAT(textureName) TEXTURECUBE_FLOAT(textureName) // No support to textureCubeArray + #define TEXTURE3D_FLOAT(textureName) sampler3D_float textureName + + #define TEXTURE2D_HALF(textureName) sampler2D_half textureName + #define TEXTURE2D_ARRAY_HALF(textureName) TEXTURECUBE_HALF(textureName) // No support to texture2DArray + #define TEXTURECUBE_HALF(textureName) samplerCUBE_half textureName + #define TEXTURECUBE_ARRAY_HALF(textureName) TEXTURECUBE_HALF(textureName) // No support to textureCubeArray + #define TEXTURE3D_HALF(textureName) sampler3D_half textureName + + #define TEXTURE2D_SHADOW(textureName) SHADOW2D_TEXTURE_AND_SAMPLER textureName + #define TEXTURE2D_ARRAY_SHADOW(textureName) TEXTURECUBE_SHADOW(textureName) // No support to texture array + #define TEXTURECUBE_SHADOW(textureName) SHADOWCUBE_TEXTURE_AND_SAMPLER textureName + #define TEXTURECUBE_ARRAY_SHADOW(textureName) TEXTURECUBE_SHADOW(textureName) // No support to texture array + + #define RW_TEXTURE2D(type, textureNam) ERROR_ON_UNSUPPORTED_FUNCTION(RWTexture2D) + #define RW_TEXTURE2D_ARRAY(type, textureName) ERROR_ON_UNSUPPORTED_FUNCTION(RWTexture2DArray) + #define RW_TEXTURE3D(type, textureNam) ERROR_ON_UNSUPPORTED_FUNCTION(RWTexture3D) + + #define SAMPLER(samplerName) + #define SAMPLER_CMP(samplerName) + + #define TEXTURE2D_PARAM(textureName, samplerName) sampler2D textureName + #define TEXTURE2D_ARRAY_PARAM(textureName, samplerName) samplerCUBE textureName + #define TEXTURECUBE_PARAM(textureName, samplerName) samplerCUBE textureName + #define TEXTURECUBE_ARRAY_PARAM(textureName, samplerName) samplerCUBE textureName + #define TEXTURE3D_PARAM(textureName, samplerName) sampler3D textureName + #define TEXTURE2D_SHADOW_PARAM(textureName, samplerName) SHADOW2D_TEXTURE_AND_SAMPLER textureName + #define TEXTURE2D_ARRAY_SHADOW_PARAM(textureName, samplerName) SHADOWCUBE_TEXTURE_AND_SAMPLER textureName + #define TEXTURECUBE_SHADOW_PARAM(textureName, samplerName) SHADOWCUBE_TEXTURE_AND_SAMPLER textureName + + #define TEXTURE2D_ARGS(textureName, samplerName) textureName + #define TEXTURE2D_ARRAY_ARGS(textureName, samplerName) textureName + #define TEXTURECUBE_ARGS(textureName, samplerName) textureName + #define TEXTURECUBE_ARRAY_ARGS(textureName, samplerName) textureName + #define TEXTURE3D_ARGS(textureName, samplerName) textureName + #define TEXTURE2D_SHADOW_ARGS(textureName, samplerName) textureName + #define TEXTURE2D_ARRAY_SHADOW_ARGS(textureName, samplerName) textureName + #define TEXTURECUBE_SHADOW_ARGS(textureName, samplerName) textureName + + #define SAMPLE_TEXTURE2D(textureName, samplerName, coord2) tex2D(textureName, coord2) + + #if (SHADER_TARGET >= 30) + #define SAMPLE_TEXTURE2D_LOD(textureName, samplerName, coord2, lod) tex2Dlod(textureName, float4(coord2, 0, lod)) + #else + // No lod support. Very poor approximation with bias. + #define SAMPLE_TEXTURE2D_LOD(textureName, samplerName, coord2, lod) SAMPLE_TEXTURE2D_BIAS(textureName, samplerName, coord2, lod) + #endif + + #define SAMPLE_TEXTURE2D_BIAS(textureName, samplerName, coord2, bias) tex2Dbias(textureName, float4(coord2, 0, bias)) + #define SAMPLE_TEXTURE2D_GRAD(textureName, samplerName, coord2, ddx, ddy) SAMPLE_TEXTURE2D(textureName, samplerName, coord2) + #define SAMPLE_TEXTURE2D_ARRAY(textureName, samplerName, coord2, index) ERROR_ON_UNSUPPORTED_FUNCTION(SAMPLE_TEXTURE2D_ARRAY) + #define SAMPLE_TEXTURE2D_ARRAY_LOD(textureName, samplerName, coord2, index, lod) ERROR_ON_UNSUPPORTED_FUNCTION(SAMPLE_TEXTURE2D_ARRAY_LOD) + #define SAMPLE_TEXTURE2D_ARRAY_BIAS(textureName, samplerName, coord2, index, bias) ERROR_ON_UNSUPPORTED_FUNCTION(SAMPLE_TEXTURE2D_ARRAY_BIAS) + #define SAMPLE_TEXTURE2D_ARRAY_GRAD(textureName, samplerName, coord2, index, dpdx, dpdy) ERROR_ON_UNSUPPORTED_FUNCTION(SAMPLE_TEXTURE2D_ARRAY_GRAD) + #define SAMPLE_TEXTURECUBE(textureName, samplerName, coord3) texCUBE(textureName, coord3) + // No lod support. Very poor approximation with bias. + #define SAMPLE_TEXTURECUBE_LOD(textureName, samplerName, coord3, lod) SAMPLE_TEXTURECUBE_BIAS(textureName, samplerName, coord3, lod) + #define SAMPLE_TEXTURECUBE_BIAS(textureName, samplerName, coord3, bias) texCUBEbias(textureName, float4(coord3, bias)) + #define SAMPLE_TEXTURECUBE_ARRAY(textureName, samplerName, coord3, index) ERROR_ON_UNSUPPORTED_FUNCTION(SAMPLE_TEXTURECUBE_ARRAY) + #define SAMPLE_TEXTURECUBE_ARRAY_LOD(textureName, samplerName, coord3, index, lod) ERROR_ON_UNSUPPORTED_FUNCTION(SAMPLE_TEXTURECUBE_ARRAY_LOD) + #define SAMPLE_TEXTURECUBE_ARRAY_BIAS(textureName, samplerName, coord3, index, bias) ERROR_ON_UNSUPPORTED_FUNCTION(SAMPLE_TEXTURECUBE_ARRAY_BIAS) + #define SAMPLE_TEXTURE3D(textureName, samplerName, coord3) tex3D(textureName, coord3) + #define SAMPLE_TEXTURE3D_LOD(textureName, samplerName, coord3, lod) ERROR_ON_UNSUPPORTED_FUNCTION(SAMPLE_TEXTURE3D_LOD) + + #define SAMPLE_TEXTURE2D_SHADOW(textureName, samplerName, coord3) SHADOW2D_SAMPLE(textureName, samplerName, coord3) + #define SAMPLE_TEXTURE2D_ARRAY_SHADOW(textureName, samplerName, coord3, index) ERROR_ON_UNSUPPORTED_FUNCTION(SAMPLE_TEXTURE2D_ARRAY_SHADOW) + #define SAMPLE_TEXTURECUBE_SHADOW(textureName, samplerName, coord4) SHADOWCUBE_SAMPLE(textureName, samplerName, coord4) + #define SAMPLE_TEXTURECUBE_ARRAY_SHADOW(textureName, samplerName, coord4, index) ERROR_ON_UNSUPPORTED_FUNCTION(SAMPLE_TEXTURECUBE_ARRAY_SHADOW) + + + // Not supported. Can't define as error because shader library is calling these functions. + #define LOAD_TEXTURE2D(textureName, unCoord2) half4(0, 0, 0, 0) + #define LOAD_TEXTURE2D_LOD(textureName, unCoord2, lod) half4(0, 0, 0, 0) + #define LOAD_TEXTURE2D_MSAA(textureName, unCoord2, sampleIndex) half4(0, 0, 0, 0) + #define LOAD_TEXTURE2D_ARRAY(textureName, unCoord2, index) half4(0, 0, 0, 0) + #define LOAD_TEXTURE2D_ARRAY_MSAA(textureName, unCoord2, index, sampleIndex) half4(0, 0, 0, 0) + #define LOAD_TEXTURE2D_ARRAY_LOD(textureName, unCoord2, index, lod) half4(0, 0, 0, 0) + #define LOAD_TEXTURE3D(textureName, unCoord3) ERROR_ON_UNSUPPORTED_FUNCTION(LOAD_TEXTURE3D) + #define LOAD_TEXTURE3D_LOD(textureName, unCoord3, lod) ERROR_ON_UNSUPPORTED_FUNCTION(LOAD_TEXTURE3D_LOD) + + // Gather not supported. Fallback to regular texture sampling. + #define GATHER_TEXTURE2D(textureName, samplerName, coord2) ERROR_ON_UNSUPPORTED_FUNCTION(GATHER_TEXTURE2D) + #define GATHER_TEXTURE2D_ARRAY(textureName, samplerName, coord2, index) ERROR_ON_UNSUPPORTED_FUNCTION(GATHER_TEXTURE2D_ARRAY) + #define GATHER_TEXTURECUBE(textureName, samplerName, coord3) ERROR_ON_UNSUPPORTED_FUNCTION(GATHER_TEXTURECUBE) + #define GATHER_TEXTURECUBE_ARRAY(textureName, samplerName, coord3, index) ERROR_ON_UNSUPPORTED_FUNCTION(GATHER_TEXTURECUBE_ARRAY) + #define GATHER_RED_TEXTURE2D(textureName, samplerName, coord2) ERROR_ON_UNSUPPORTED_FUNCTION(GATHER_RED_TEXTURE2D) + #define GATHER_GREEN_TEXTURE2D(textureName, samplerName, coord2) ERROR_ON_UNSUPPORTED_FUNCTION(GATHER_GREEN_TEXTURE2D) + #define GATHER_BLUE_TEXTURE2D(textureName, samplerName, coord2) ERROR_ON_UNSUPPORTED_FUNCTION(GATHER_BLUE_TEXTURE2D) + #define GATHER_ALPHA_TEXTURE2D(textureName, samplerName, coord2) ERROR_ON_UNSUPPORTED_FUNCTION(GATHER_ALPHA_TEXTURE2D) + +#else +#error unsupported shader api +#endif + + + + +// default flow control attributes +#ifndef UNITY_BRANCH +# define UNITY_BRANCH +#endif +#ifndef UNITY_FLATTEN +# define UNITY_FLATTEN +#endif +#ifndef UNITY_UNROLL +# define UNITY_UNROLL +#endif +#ifndef UNITY_UNROLLX +# define UNITY_UNROLLX(_x) +#endif +#ifndef UNITY_LOOP +# define UNITY_LOOP +#endif + + + +#define _USINGTEXCOORD1 1 +#define _USINGTEXCOORD2 1 + + + + + // data across stages, stripped like the above. + struct VertexToPixel + { + UNITY_POSITION(pos); + float3 worldPos : TEXCOORD0; + float3 worldNormal : TEXCOORD1; + float4 worldTangent : TEXCOORD2; + float4 texcoord0 : TEXCOORD3; + float4 texcoord1 : TEXCOORD4; + float4 texcoord2 : TEXCOORD5; + + // #if %TEXCOORD3REQUIREKEY% + float4 texcoord3 : TEXCOORD6; + // #endif + + // #if %SCREENPOSREQUIREKEY% + // float4 screenPos : TEXCOORD7; + // #endif + + #ifdef EDITOR_VISUALIZATION + float2 vizUV : TEXCOORD8; + float4 lightCoord : TEXCOORD9; + #endif + + + // #if %VERTEXCOLORREQUIREKEY% + float4 vertexColor : COLOR; + // #endif + + // #if %EXTRAV2F0REQUIREKEY% + // float4 extraV2F0 : TEXCOORD10; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // float4 extraV2F1 : TEXCOORD11; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // float4 extraV2F2 : TEXCOORD12; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // float4 extraV2F3 : TEXCOORD13; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // float4 extraV2F4 : TEXCOORD14; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // float4 extraV2F5 : TEXCOORD15; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // float4 extraV2F6 : TEXCOORD16; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // float4 extraV2F7 : TEXCOORD17; + // #endif + + + UNITY_VERTEX_INPUT_INSTANCE_ID + UNITY_VERTEX_OUTPUT_STEREO + }; + + + + // data describing the user output of a pixel + struct Surface + { + half3 Albedo; + half Height; + half3 Normal; + half Smoothness; + half3 Emission; + half Metallic; + half3 Specular; + half Occlusion; + half SpecularPower; // for simple lighting + half Alpha; + float outputDepth; // if written, SV_Depth semantic is used. ShaderData.clipPos.z is unused value + // HDRP Only + half SpecularOcclusion; + half SubsurfaceMask; + half Thickness; + half CoatMask; + half CoatSmoothness; + half Anisotropy; + half IridescenceMask; + half IridescenceThickness; + int DiffusionProfileHash; + float SpecularAAThreshold; + float SpecularAAScreenSpaceVariance; + // requires _OVERRIDE_BAKEDGI to be defined, but is mapped in all pipelines + float3 DiffuseGI; + float3 BackDiffuseGI; + float3 SpecularGI; + float ior; + float3 transmittanceColor; + float atDistance; + float transmittanceMask; + // requires _OVERRIDE_SHADOWMASK to be defines + float4 ShadowMask; + + // for decals + float NormalAlpha; + float MAOSAlpha; + + + }; + + // Data the user declares in blackboard blocks + struct Blackboard + { + + float blackboardDummyData; + }; + + // data the user might need, this will grow to be big. But easy to strip + struct ShaderData + { + float4 clipPos; // SV_POSITION + float3 localSpacePosition; + float3 localSpaceNormal; + float3 localSpaceTangent; + + float3 worldSpacePosition; + float3 worldSpaceNormal; + float3 worldSpaceTangent; + float tangentSign; + + float3 worldSpaceViewDir; + float3 tangentSpaceViewDir; + + float4 texcoord0; + float4 texcoord1; + float4 texcoord2; + float4 texcoord3; + + float2 screenUV; + float4 screenPos; + + float4 vertexColor; + bool isFrontFace; + + float4 extraV2F0; + float4 extraV2F1; + float4 extraV2F2; + float4 extraV2F3; + float4 extraV2F4; + float4 extraV2F5; + float4 extraV2F6; + float4 extraV2F7; + + float3x3 TBNMatrix; + Blackboard blackboard; + }; + + struct VertexData + { + #if SHADER_TARGET > 30 + // uint vertexID : SV_VertexID; + #endif + float4 vertex : POSITION; + float3 normal : NORMAL; + float4 tangent : TANGENT; + float4 texcoord0 : TEXCOORD0; + + // optimize out mesh coords when not in use by user or lighting system + #if _URP && (_USINGTEXCOORD1 || _PASSMETA || _PASSFORWARD || _PASSGBUFFER) + float4 texcoord1 : TEXCOORD1; + #endif + + #if _URP && (_USINGTEXCOORD2 || _PASSMETA || ((_PASSFORWARD || _PASSGBUFFER) && defined(DYNAMICLIGHTMAP_ON))) + float4 texcoord2 : TEXCOORD2; + #endif + + #if _STANDARD && (_USINGTEXCOORD1 || (_PASSMETA || ((_PASSFORWARD || _PASSGBUFFER || _PASSFORWARDADD) && LIGHTMAP_ON))) + float4 texcoord1 : TEXCOORD1; + #endif + #if _STANDARD && (_USINGTEXCOORD2 || (_PASSMETA || ((_PASSFORWARD || _PASSGBUFFER) && DYNAMICLIGHTMAP_ON))) + float4 texcoord2 : TEXCOORD2; + #endif + + + #if _HDRP + float4 texcoord1 : TEXCOORD1; + float4 texcoord2 : TEXCOORD2; + #endif + + // #if %TEXCOORD3REQUIREKEY% + float4 texcoord3 : TEXCOORD3; + // #endif + + // #if %VERTEXCOLORREQUIREKEY% + float4 vertexColor : COLOR; + // #endif + + #if _PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR)) + float3 previousPositionOS : TEXCOORD4; // Contain previous transform position (in case of skinning for example) + #if defined (_ADD_PRECOMPUTED_VELOCITY) + float3 precomputedVelocity : TEXCOORD5; // Add Precomputed Velocity (Alembic computes velocities on runtime side). + #endif + #endif + + UNITY_VERTEX_INPUT_INSTANCE_ID + }; + + struct TessVertex + { + float4 vertex : INTERNALTESSPOS; + float3 normal : NORMAL; + float4 tangent : TANGENT; + float4 texcoord0 : TEXCOORD0; + float4 texcoord1 : TEXCOORD1; + float4 texcoord2 : TEXCOORD2; + + // #if %TEXCOORD3REQUIREKEY% + float4 texcoord3 : TEXCOORD3; + // #endif + + // #if %VERTEXCOLORREQUIREKEY% + float4 vertexColor : COLOR; + // #endif + + // #if %EXTRAV2F0REQUIREKEY% + // float4 extraV2F0 : TEXCOORD5; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // float4 extraV2F1 : TEXCOORD6; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // float4 extraV2F2 : TEXCOORD7; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // float4 extraV2F3 : TEXCOORD8; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // float4 extraV2F4 : TEXCOORD9; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // float4 extraV2F5 : TEXCOORD10; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // float4 extraV2F6 : TEXCOORD11; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // float4 extraV2F7 : TEXCOORD12; + // #endif + + #if _PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR)) + float3 previousPositionOS : TEXCOORD13; // Contain previous transform position (in case of skinning for example) + #if defined (_ADD_PRECOMPUTED_VELOCITY) + float3 precomputedVelocity : TEXCOORD14; + #endif + #endif + + UNITY_VERTEX_INPUT_INSTANCE_ID + UNITY_VERTEX_OUTPUT_STEREO + }; + + struct ExtraV2F + { + float4 extraV2F0; + float4 extraV2F1; + float4 extraV2F2; + float4 extraV2F3; + float4 extraV2F4; + float4 extraV2F5; + float4 extraV2F6; + float4 extraV2F7; + Blackboard blackboard; + float4 time; + }; + + + float3 WorldToTangentSpace(ShaderData d, float3 normal) + { + return mul(d.TBNMatrix, normal); + } + + float3 TangentToWorldSpace(ShaderData d, float3 normal) + { + return mul(normal, d.TBNMatrix); + } + + // in this case, make standard more like SRPs, because we can't fix + // unity_WorldToObject in HDRP, since it already does macro-fu there + + #if _STANDARD + float3 TransformWorldToObject(float3 p) { return mul(unity_WorldToObject, float4(p, 1)); }; + float3 TransformObjectToWorld(float3 p) { return mul(unity_ObjectToWorld, float4(p, 1)); }; + float4 TransformWorldToObject(float4 p) { return mul(unity_WorldToObject, p); }; + float4 TransformObjectToWorld(float4 p) { return mul(unity_ObjectToWorld, p); }; + float4x4 GetWorldToObjectMatrix() { return unity_WorldToObject; } + float4x4 GetObjectToWorldMatrix() { return unity_ObjectToWorld; } + #if (defined(SHADER_API_D3D11) || defined(SHADER_API_XBOXONE) || defined(UNITY_COMPILER_HLSLCC) || defined(SHADER_API_PSSL) || (SHADER_TARGET_SURFACE_ANALYSIS && !SHADER_TARGET_SURFACE_ANALYSIS_MOJOSHADER)) + #define UNITY_SAMPLE_TEX2D_LOD(tex,coord, lod) tex.SampleLevel (sampler##tex,coord, lod) + #define UNITY_SAMPLE_TEX2D_SAMPLER_LOD(tex,samplertex,coord, lod) tex.SampleLevel (sampler##samplertex,coord, lod) + #else + #define UNITY_SAMPLE_TEX2D_LOD(tex,coord,lod) tex2D (tex,coord,0,lod) + #define UNITY_SAMPLE_TEX2D_SAMPLER_LOD(tex,samplertex,coord,lod) tex2D (tex,coord,0,lod) + #endif + + #undef UNITY_MATRIX_I_M + + #define UNITY_MATRIX_I_M unity_WorldToObject + + + #endif + + float3 GetCameraWorldPosition() + { + #if _HDRP + return GetCameraRelativePositionWS(_WorldSpaceCameraPos); + #else + return _WorldSpaceCameraPos; + #endif + } + + #if _GRABPASSUSED + #if _STANDARD + TEXTURE2D(%GRABTEXTURE%); + SAMPLER(sampler_%GRABTEXTURE%); + #endif + + half3 GetSceneColor(float2 uv) + { + #if _STANDARD + return SAMPLE_TEXTURE2D(%GRABTEXTURE%, sampler_%GRABTEXTURE%, uv).rgb; + #else + return SHADERGRAPH_SAMPLE_SCENE_COLOR(uv); + #endif + } + #endif + + + + #if _STANDARD + UNITY_DECLARE_DEPTH_TEXTURE(_CameraDepthTexture); + float GetSceneDepth(float2 uv) { return SAMPLE_DEPTH_TEXTURE(_CameraDepthTexture, uv); } + float GetLinear01Depth(float2 uv) { return Linear01Depth(GetSceneDepth(uv)); } + float GetLinearEyeDepth(float2 uv) { return LinearEyeDepth(GetSceneDepth(uv)); } + #else + float GetSceneDepth(float2 uv) { return SHADERGRAPH_SAMPLE_SCENE_DEPTH(uv); } + float GetLinear01Depth(float2 uv) { return Linear01Depth(GetSceneDepth(uv), _ZBufferParams); } + float GetLinearEyeDepth(float2 uv) { return LinearEyeDepth(GetSceneDepth(uv), _ZBufferParams); } + #endif + + float3 GetWorldPositionFromDepthBuffer(float2 uv, float3 worldSpaceViewDir) + { + float eye = GetLinearEyeDepth(uv); + float3 camView = mul((float3x3)UNITY_MATRIX_M, transpose(mul(UNITY_MATRIX_I_M, UNITY_MATRIX_I_V)) [2].xyz); + + float dt = dot(worldSpaceViewDir, camView); + float3 div = worldSpaceViewDir/dt; + float3 wpos = (eye * div) + GetCameraWorldPosition(); + return wpos; + } + + #if _HDRP + float3 ObjectToWorldSpacePosition(float3 pos) + { + return GetAbsolutePositionWS(TransformObjectToWorld(pos)); + } + #else + float3 ObjectToWorldSpacePosition(float3 pos) + { + return TransformObjectToWorld(pos); + } + #endif + + #if _STANDARD + UNITY_DECLARE_SCREENSPACE_TEXTURE(_CameraDepthNormalsTexture); + float3 GetSceneNormal(float2 uv, float3 worldSpaceViewDir) + { + float4 depthNorms = UNITY_SAMPLE_SCREENSPACE_TEXTURE(_CameraDepthNormalsTexture, uv); + float3 norms = DecodeViewNormalStereo(depthNorms); + norms = mul((float3x3)UNITY_MATRIX_V, norms) * 0.5 + 0.5; + return norms; + } + #elif _HDRP && !_DECALSHADER + + float3 GetSceneNormal(float2 uv, float3 worldSpaceViewDir) + { + NormalData nd; + DecodeFromNormalBuffer(_ScreenSize.xy * uv, nd); + return nd.normalWS; + } + #elif _URP + #if (SHADER_LIBRARY_VERSION_MAJOR >= 10) + #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/DeclareNormalsTexture.hlsl" + #endif + + float3 GetSceneNormal(float2 uv, float3 worldSpaceViewDir) + { + #if (SHADER_LIBRARY_VERSION_MAJOR >= 10) + return SampleSceneNormals(uv); + #else + float3 wpos = GetWorldPositionFromDepthBuffer(uv, worldSpaceViewDir); + return normalize(-cross(ddx(wpos), ddy(wpos))) * 0.5 + 0.5; + #endif + + } + #endif + + #if _HDRP + + half3 UnpackNormalmapRGorAG(half4 packednormal) + { + // This do the trick + packednormal.x *= packednormal.w; + + half3 normal; + normal.xy = packednormal.xy * 2 - 1; + normal.z = sqrt(1 - saturate(dot(normal.xy, normal.xy))); + return normal; + } + half3 UnpackNormal(half4 packednormal) + { + #if defined(UNITY_NO_DXT5nm) + return packednormal.xyz * 2 - 1; + #else + return UnpackNormalmapRGorAG(packednormal); + #endif + } + #endif + #if _HDRP || _URP + + half3 UnpackScaleNormal(half4 packednormal, half scale) + { + #ifndef UNITY_NO_DXT5nm + // Unpack normal as DXT5nm (1, y, 1, x) or BC5 (x, y, 0, 1) + // Note neutral texture like "bump" is (0, 0, 1, 1) to work with both plain RGB normal and DXT5nm/BC5 + packednormal.x *= packednormal.w; + #endif + half3 normal; + normal.xy = (packednormal.xy * 2 - 1) * scale; + normal.z = sqrt(1 - saturate(dot(normal.xy, normal.xy))); + return normal; + } + + #endif + + + void GetSun(out float3 lightDir, out float3 color) + { + lightDir = float3(0.5, 0.5, 0); + color = 1; + #if _HDRP + if (_DirectionalLightCount > 0) + { + DirectionalLightData light = _DirectionalLightDatas[0]; + lightDir = -light.forward.xyz; + color = light.color; + } + #elif _STANDARD + lightDir = normalize(_WorldSpaceLightPos0.xyz); + color = _LightColor0.rgb; + #elif _URP + Light light = GetMainLight(); + lightDir = light.direction; + color = light.color; + #endif + } + + + + + half4 _Color; + half4 _MainTex_ST, _MainTex_TexelSize; + half _Alpha, _AlphaCutoffValue; + + #if ATLAS_ON + half _MinXUV, _MaxXUV, _MinYUV, _MaxYUV; + #endif + + #if GLOW_ON + half4 _GlowColor; + half _Glow, _GlowGlobal; + #endif + + #if HSV_ON + half _HsvShift, _HsvSaturation, _HsvBright; + #endif + + #if DISTORT_ON + half4 _DistortTex_ST; + half _DistortTexXSpeed, _DistortTexYSpeed, _DistortAmount; + #endif + + #if FADE_ON + half4 _FadeBurnColor, _FadeTex_ST, _FadeBurnTex_ST; + half _FadeAmount, _FadeBurnWidth, _FadeBurnTransition,_FadeBurnGlow; + #endif + + #if OUTBASE_ON + half4 _OutlineColor; + half _OutlineAlpha, _OutlineGlow, _OutlineWidth; + int _OutlinePixelWidth; + #endif + + #if OUTTEX_ON + half4 _OutlineTex_ST; + half _OutlineTexXSpeed, _OutlineTexYSpeed; + #endif + + #if OUTDIST_ON + half4 _OutlineDistortTex_ST; + half _OutlineDistortTexXSpeed, _OutlineDistortTexYSpeed, _OutlineDistortAmount; + #endif + + #if ALPHAOUTLINE_ON + half _AlphaOutlineGlow, _AlphaOutlinePower, _AlphaOutlineMinAlpha, _AlphaOutlineBlend; + half4 _AlphaOutlineColor; + #endif + + #if INNEROUTLINE_ON + half _InnerOutlineThickness, _InnerOutlineAlpha, _InnerOutlineGlow; + half4 _InnerOutlineColor; + #endif + + #if GRADIENT_ON + half _GradBlend, _GradBoostX, _GradBoostY; + half4 _GradTopRightCol, _GradTopLeftCol, _GradBotRightCol, _GradBotLeftCol; + #endif + + #if COLORSWAP_ON + half4 _ColorSwapRed, _ColorSwapGreen, _ColorSwapBlue; + half _ColorSwapRedLuminosity, _ColorSwapGreenLuminosity, _ColorSwapBlueLuminosity, _ColorSwapBlend; + #endif + + #if CHANGECOLOR_ON + half4 _ColorChangeNewCol, _ColorChangeTarget; + half _ColorChangeTolerance, _ColorChangeLuminosity; + #endif + #if CHANGECOLOR2_ON + half4 _ColorChangeNewCol2, _ColorChangeTarget2; + half _ColorChangeTolerance2; + #endif + #if CHANGECOLOR3_ON + half4 _ColorChangeNewCol3, _ColorChangeTarget3; + half _ColorChangeTolerance3; + #endif + + #if COLORRAMP_ON + half _ColorRampLuminosity, _ColorRampBlend; + #endif + + #if HITEFFECT_ON + half4 _HitEffectColor; + half _HitEffectGlow, _HitEffectBlend; + #endif + + #if NEGATIVE_ON + half _NegativeAmount; + #endif + + #if PIXELATE_ON + half _PixelateSize; + #endif + + #if GREYSCALE_ON + half _GreyscaleLuminosity, _GreyscaleBlend; + half4 _GreyscaleTintColor; + #endif + + #if POSTERIZE_ON + half _PosterizeNumColors, _PosterizeGamma; + #endif + + #if BLUR_ON + half _BlurIntensity; + #endif + + #if MOTIONBLUR_ON + half _MotionBlurAngle, _MotionBlurDist; + #endif + + #if GHOST_ON + half _GhostColorBoost, _GhostTransparency, _GhostBlend; + #endif + + #if HOLOGRAM_ON + half _HologramStripesAmount, _HologramMinAlpha, _HologramUnmodAmount, _HologramStripesSpeed, _HologramMaxAlpha, _HologramBlend; + half4 _HologramStripeColor; + #endif + + #if CHROMABERR_ON + half _ChromAberrAmount, _ChromAberrAlpha; + #endif + + #if GLITCH_ON + half _GlitchAmount, _GlitchSize; + #endif + + #if FLICKER_ON + half _FlickerFreq, _FlickerPercent, _FlickerAlpha; + #endif + + #if SHADOW_ON + half _ShadowX, _ShadowY, _ShadowAlpha; + half4 _ShadowColor; + #endif + + #if SHINE_ON + half4 _ShineColor; + half _ShineLocation, _ShineRotate, _ShineWidth, _ShineGlow; + #endif + + #if CONTRAST_ON + half _Contrast, _Brightness; + #endif + + #if OVERLAY_ON + half4 _OverlayTex_ST, _OverlayColor; + half _OverlayGlow, _OverlayBlend, _OverlayTextureScrollXSpeed, _OverlayTextureScrollYSpeed; + #endif + + #if DOODLE_ON + half _HandDrawnAmount, _HandDrawnSpeed; + #endif + + #if WIND_ON + half _GrassSpeed, _GrassWind, _GrassManualAnim, _GrassRadialBend; + #endif + + #if WAVEUV_ON + float _WaveAmount, _WaveSpeed, _WaveStrength, _WaveX, _WaveY; + #endif + + #if ROUNDWAVEUV_ON + half _RoundWaveStrength, _RoundWaveSpeed; + #endif + + #if RECTSIZE_ON + half _RectSize; + #endif + + #if OFFSETUV_ON + half _OffsetUvX, _OffsetUvY; + #endif + + #if CLIPPING_ON + half _ClipUvLeft, _ClipUvRight, _ClipUvUp, _ClipUvDown; + #endif + + #if RADIALCLIPPING_ON + half _RadialStartAngle, _RadialClip, _RadialClip2; + #endif + + #if TEXTURESCROLL_ON + half _TextureScrollXSpeed, _TextureScrollYSpeed; + #endif + + #if ZOOMUV_ON + half _ZoomUvAmount; + #endif + + #if WARP_ON + half _WarpStrength, _WarpSpeed, _WarpScale; + #endif + + #if TWISTUV_ON + half _TwistUvAmount, _TwistUvPosX, _TwistUvPosY, _TwistUvRadius; + #endif + + #if ROTATEUV_ON + half _RotateUvAmount; + #endif + + #if FISHEYE_ON + half _FishEyeUvAmount; + #endif + + #if PINCH_ON + half _PinchUvAmount; + #endif + + #if SHAKEUV_ON + half _ShakeUvSpeed, _ShakeUvX, _ShakeUvY; + #endif + + #if NORMALMAP_ON + half _NormalStrength; + #endif + + float _RandomSeed; + + + + + + + + + + + TEXTURE2D(_MainTex); + SAMPLER(sampler_MainTex); + + #if GLOW_ON + TEXTURE2D(_GlowTex); + SAMPLER(sampler_GlowTex); + #endif + + #if FADE_ON + TEXTURE2D(_FadeTex); + SAMPLER(sampler_FadeTex); + + TEXTURE2D(_FadeBurnTex); + SAMPLER(sampler_FadeBurnTex); + #endif + + #if DISTORT_ON + TEXTURE2D(_DistortTex); + SAMPLER(sampler_DistortTex); + #endif + + #if OUTTEX_ON + TEXTURE2D(_OutlineTex); + SAMPLER(sampler_OutlineTex); + #endif + + #if OUTDIST_ON + TEXTURE2D(_OutlineDistortTex); + SAMPLER(sampler_OutlineDistortTex); + #endif + + #if COLORSWAP_ON + TEXTURE2D(_ColorSwapTex); + SAMPLER(sampler_ColorSwapTex); + #endif + + #if COLORRAMP_ON + TEXTURE2D(_ColorRampTex); + TEXTURE2D(_ColorRampTexGradient); + SAMPLER(sampler_ColorRampTex); + SAMPLER(sampler_ColorRampTexGradient); + #endif + + #if SHINE_ON + TEXTURE2D(_ShineMask); + SAMPLER(sampler_ShineMask); + #endif + + #if OVERLAY_ON + TEXTURE2D(_OverlayTex); + SAMPLER(sampler_OverlayTex); + #endif + + #if NORMALMAP_ON + TEXTURE2D(_NormalMap); + SAMPLER(sampler_NormalMap); + #endif + + + half3 GetPixel(in int offsetX, in int offsetY, in half2 uv, in Texture2D _tex, in SamplerState _sampler) + { + half2 _uv = uv + half2(offsetX * _MainTex_TexelSize.x, offsetY * _MainTex_TexelSize.y); + half4 col = SAMPLE_TEXTURE2D(_tex, _sampler, _uv); + return col.rgb; + } + + + //BLURS------------------------------------------------------------------------- + half4 Blur(half2 uv, Texture2D source, SamplerState sampler_source, half Intensity) + { + const half2 texelSize = 1.0 / _ScreenParams.xy; + const half4 color = SAMPLE_TEXTURE2D(source, sampler_source, uv); + const half2 offset = Intensity * texelSize; + + half4 accumulatedColor = color; + half accumulatedWeight = 1.0; + for (int x = -1; x <= 1; x++) + { + for (int y = -1; y <= 1; y++) + { + const half2 sampleUV = uv + half2(x, y) * offset; + const half4 sampleColor = SAMPLE_TEXTURE2D(source, sampler_source, sampleUV); + + accumulatedColor += sampleColor; + accumulatedWeight += 1.0; + } + } + + half4 blurredColor = accumulatedColor / accumulatedWeight; + return blurredColor; + } + + half BlurHD_G(half bhqp, half x) + { + return exp(-(x * x) / (2.0 * bhqp * bhqp)); + } + half4 BlurHD(half2 uv, Texture2D source, SamplerState sampler_source, half BlurAmount, half xScale, half yScale) + { + int iterations = 16; + int halfIterations = iterations / 2; + half sigmaX = 0.1 + BlurAmount * 0.5; + half sigmaY = sigmaX; + half total = 0.0; + half4 ret = half4(0, 0, 0, 0); + for (int iy = 0; iy < iterations; ++iy) + { + half fy = BlurHD_G(sigmaY, half(iy) -half(halfIterations)); + half offsetY = half(iy - halfIterations) * 0.00390625 * xScale; + for (int ix = 0; ix < iterations; ++ix) + { + half fx = BlurHD_G(sigmaX, half(ix) - half(halfIterations)); + half offsetX = half(ix - halfIterations) * 0.00390625 * yScale; + total += fx * fy; + ret += SAMPLE_TEXTURE2D(source, sampler_source, uv + half2(offsetX, offsetY)) * fx * fy; + } + } + return ret / total; + } + //----------------------------------------------------------------------- + + + //------------------------------------------- + half RemapFloat(half inValue, half inMin, half inMax, half outMin, half outMax){ + return outMin + (inValue - inMin) * (outMax - outMin) / (inMax - inMin); + } + //------------------------------------------- + + //----------------------------------------------------------------------- + half rand(half2 seed, half offset) { + return (frac(sin(dot(seed, half2(12.9898, 78.233))) * 43758.5453) + offset) % 1.0; + } + + half rand2(half2 seed, half offset) { + return (frac(sin(dot(seed * floor(50 + (_Time.x % 1.0) * 12.), half2(127.1, 311.7))) * 43758.5453123) + offset) % 1.0; + } + + half rand2CustomTime(half2 seed, half offset, half customTime) { + return (frac(sin(dot(seed * floor(50 + (customTime % 1.0) * 12.), half2(127.1, 311.7))) * 43758.5453123) + offset) % 1.0; + } + //----------------------------------------------------------------------- + + + void Ext_ModifyVertex0 (inout VertexData v, inout ExtraV2F d) + { + //BILBOARD_ON + #if BILBOARD_ON + half3 camRight = mul((half3x3)unity_CameraToWorld, half3(1,0,0)); + half3 camUp = half3(0,1,0); + #if BILBOARDY_ON + camUp = mul((half3x3)unity_CameraToWorld, half3(0,1,0)); + #endif + half3 localPos = v.vertex.x * camRight + v.vertex.y * camUp; + v.vertex = half4(localPos, 1); + #endif + //----------------------------------------------------------- + + v.texcoord0.xy = TRANSFORM_TEX(v.texcoord0.xy, _MainTex); + half2 center = half2(0.5, 0.5); + #if ATLAS_ON + center = half2((_MaxXUV + _MinXUV) / 2.0, (_MaxYUV + _MinYUV) / 2.0); + #endif + + //POLARUV_ON + #if POLARUV_ON + v.texcoord0.xy = v.texcoord0.xy - center; + #endif + + //---------------------------------------- + + //ROTATEUV_ON + #if ROTATEUV_ON + half2 uvC = v.texcoord0.xy; + half cosAngle = cos(_RotateUvAmount); + half sinAngle = sin(_RotateUvAmount); + half2x2 rot = half2x2(cosAngle, -sinAngle, sinAngle, cosAngle); + uvC -= center; + v.texcoord0.xy = mul(rot, uvC); + v.texcoord0.xy += center; + #endif + //-------------------- + + #if RECTSIZE_ON + v.vertex.xyz += (v.vertex.xyz * (_RectSize - 1.0)); + #endif + + #if OUTTEX_ON + v.texcoord1.xy = TRANSFORM_TEX(v.texcoord0.xy, _OutlineTex); + #endif + + #if OUTDIST_ON + v.texcoord2.xy = TRANSFORM_TEX(v.texcoord0.xy, _OutlineDistortTex); + #endif + + #if DISTORT_ON + v.texcoord3.xy = TRANSFORM_TEX(v.texcoord0.xy, _DistortTex); + #endif + } + + void Ext_SurfaceFunction0 (inout Surface o, ShaderData d) + { + half randomSeed = _RandomSeed; + + float2 uvRect = d.texcoord0; + half2 center = half2(0.5, 0.5); + #if ATLAS_ON + center = half2((_MaxXUV + _MinXUV) / 2.0, (_MaxYUV + _MinYUV) / 2.0); + uvRect = half2((d.texcoord0.x - _MinXUV) / (_MaxXUV - _MinXUV), (d.texcoord0.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half2 centerTiled = half2(center.x * _MainTex_ST.x, center.y * _MainTex_ST.y); + + //CLIPPING_ON + #if CLIPPING_ON + half2 tiledUv = half2(d.texcoord0.x / _MainTex_ST.x, d.texcoord0.y / _MainTex_ST.y); + #if ATLAS_ON + tiledUv = half2((tiledUv.x - _MinXUV) / (_MaxXUV - _MinXUV), (tiledUv.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + clip((1 - _ClipUvUp) - tiledUv.y); + clip(tiledUv.y - _ClipUvDown); + clip((1 - _ClipUvRight) - tiledUv.x); + clip(tiledUv.x - _ClipUvLeft); + #endif + //---------------------------------- + + //RADIALCLIPPING_ON + #if RADIALCLIPPING_ON + half2 tiledUv2 = half2(d.texcoord0.x / _MainTex_ST.x, d.texcoord0.y / _MainTex_ST.y); + #if ATLAS_ON + tiledUv2 = half2((tiledUv2.x - _MinXUV) / (_MaxXUV - _MinXUV), (tiledUv2.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half startAngle = _RadialStartAngle - _RadialClip; + half endAngle = _RadialStartAngle + _RadialClip2; + half offset0 = clamp(0, 360, startAngle + 360); + half offset360 = clamp(0, 360, endAngle - 360); + half2 atan2Coord = half2(lerp(-1, 1, tiledUv2.x), lerp(-1, 1, tiledUv2.y)); + half atanAngle = atan2(atan2Coord.y, atan2Coord.x) * 57.3; // angle in degrees + if(atanAngle < 0) atanAngle = 360 + atanAngle; + if(atanAngle >= startAngle && atanAngle <= endAngle) discard; + if(atanAngle <= offset360) discard; + if(atanAngle >= offset0) discard; + #endif + + //----------------------------- + + //TEXTURESCROLL_ON && ATLAS_ON + #if TEXTURESCROLL_ON && ATLAS_ON + d.texcoord0.xy = half2(_MinXUV + ((_MaxXUV - _MinXUV) * (abs(((_Time.y + randomSeed) * _TextureScrollXSpeed) + uvRect.x) % 1)), + _MinYUV + ((_MaxYUV - _MinYUV) * (abs(((_Time.y + randomSeed) * _TextureScrollYSpeed) + uvRect.y) % 1))); + #endif + //---------------------------- + + //OFFSETUV_ON + #if OFFSETUV_ON + #if ATLAS_ON + d.texcoord0.xy = half2(_MinXUV + ((_MaxXUV - _MinXUV) * (abs((_OffsetUvX + uvRect.x) % 1))), + _MinYUV + ((_MaxYUV - _MinYUV) * (abs(_OffsetUvY + uvRect.y) % 1))); + #else + d.texcoord0.xy += half2(_OffsetUvX, _OffsetUvY); + #endif + #endif + + //---------------------- + + //POLARUV_ON + #if POLARUV_ON + d.texcoord0.xy = half2(atan2(d.texcoord0.y, d.texcoord0.x) / (2.0f * 3.141592653589f), length(d.texcoord0.xy)); + d.texcoord0.xy *= _MainTex_ST.xy; + #endif + + //-------------------------------------- + + //TWISTUV_ON + #if TWISTUV_ON + #if ATLAS_ON + _TwistUvPosX = ((_MaxXUV - _MinXUV) * _TwistUvPosX) + _MinXUV; + _TwistUvPosY = ((_MaxYUV - _MinYUV) * _TwistUvPosY) + _MinYUV; + #endif + half2 tempUv = d.texcoord0.xy - half2(_TwistUvPosX * _MainTex_ST.x, _TwistUvPosY * _MainTex_ST.y); + _TwistUvRadius *= (_MainTex_ST.x + _MainTex_ST.y) / 2; + half percent = (_TwistUvRadius - length(tempUv)) / _TwistUvRadius; + half theta = percent * percent * (2.0 * sin(_TwistUvAmount)) * 8.0; + half s = sin(theta); + half c = cos(theta); + half beta = max(sign(_TwistUvRadius - length(tempUv)), 0.0); + tempUv = half2(dot(tempUv, half2(c, -s)), dot(tempUv, half2(s, c))) * beta + tempUv * (1 - beta); + tempUv += half2(_TwistUvPosX * _MainTex_ST.x, _TwistUvPosY * _MainTex_ST.y); + d.texcoord0.xy = tempUv; + #endif + + //-------------------------------------------- + + //FISHEYE_ON + #if FISHEYE_ON + half bind = length(centerTiled); + half2 dF = d.texcoord0.xy - centerTiled; + half dFlen = length(dF); + half fishInt = (3.14159265359 / bind) * (_FishEyeUvAmount + 0.001); + d.texcoord0.xy = centerTiled + (dF / (max(0.0001, dFlen))) * tan(dFlen * fishInt) * bind / tan(bind * fishInt); + #endif + //--------------------------------------------- + + //PINCH_ON + #if PINCH_ON + half2 dP = d.texcoord0.xy - centerTiled; + half pinchInt = (3.141592 / length(centerTiled)) * (-_PinchUvAmount + 0.001); + d.texcoord0.xy = centerTiled + normalize(dP) * atan(length(dP) * -pinchInt * 10.0) * 0.5 / atan(-pinchInt * 5); + #endif + + //--------------------------------------------- + + //ZOOMUV_ON + #if ZOOMUV_ON + d.texcoord0.xy -= centerTiled; + d.texcoord0.xy = d.texcoord0.xy * _ZoomUvAmount; + d.texcoord0.xy += centerTiled; + #endif + + //----------------------------------------------- + + //DOODLE_ON + #if DOODLE_ON + half2 uvCopy = uvRect; + _HandDrawnSpeed = (floor((_Time.x + randomSeed) * 20 * _HandDrawnSpeed) / _HandDrawnSpeed) * _HandDrawnSpeed; + uvCopy.x = sin((uvCopy.x * _HandDrawnAmount + _HandDrawnSpeed) * 4); + uvCopy.y = cos((uvCopy.y * _HandDrawnAmount + _HandDrawnSpeed) * 4); + d.texcoord0.xy = lerp(d.texcoord0.xy, d.texcoord0.xy + uvCopy, 0.0005 * _HandDrawnAmount); + #endif + + //-------------------------- + + //SHAKEUV_ON + #if SHAKEUV_ON + half xShake = sin((_Time.x + randomSeed) * _ShakeUvSpeed * 50) * _ShakeUvX; + half yShake = cos((_Time.x + randomSeed) * _ShakeUvSpeed * 50) * _ShakeUvY; + d.texcoord0.xy += half2(xShake * 0.012, yShake * 0.01); + #endif + + //------------------------------------------- + + //RECTSIZE_ON + #if RECTSIZE_ON + d.texcoord0.xy = d.texcoord0.xy * (_RectSize).xx + (((-_RectSize * 0.5) + 0.5)).xx; + #endif + + //------------------------------------------- + + //DISTORT_ON + #if DISTORT_ON + #if ATLAS_ON + d.texcoord3.x = d.texcoord3.x * (1 / (_MaxXUV - _MinXUV)); + d.texcoord3.y = d.texcoord3.y * (1 / (_MaxYUV - _MinYUV)); + #endif + + d.texcoord3.x += ((_Time.x + _RandomSeed) * _DistortTexXSpeed) % 1; + d.texcoord3.y += ((_Time.x + _RandomSeed) * _DistortTexYSpeed) % 1; + half distortAmnt = (SAMPLE_TEXTURE2D(_DistortTex, sampler_DistortTex, d.texcoord3.xy).r - 0.5) * 0.2 * _DistortAmount; + d.texcoord0.x += distortAmnt; + d.texcoord0.y += distortAmnt; + #endif + //------------------------------------------------------- + + //WARP_ON + #if WARP_ON + half2 warpUv = half2(d.texcoord0.x / _MainTex_ST.x, d.texcoord0.y / _MainTex_ST.y); + #if ATLAS_ON + warpUv = half2((warpUv.x - _MinXUV) / (_MaxXUV - _MinXUV), (warpUv.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + const float tau = 6.283185307179586; + float xWarp = (_Time.y + randomSeed) * _WarpSpeed + warpUv.x * tau / _WarpScale; + float yWarp = (_Time.y + randomSeed) * _WarpSpeed + warpUv.y * tau / _WarpScale; + float2 warp = float2(sin(xWarp), sin(yWarp)) * _WarpStrength; + d.texcoord0.xy += warp; + #endif + + //------------------------------------------------------- + + //WAVEUV_ON + #if WAVEUV_ON + float2 uvWave = half2(_WaveX * _MainTex_ST.x, _WaveY * _MainTex_ST.y) - d.texcoord0.xy; + uvWave %= 1; + #if ATLAS_ON + uvWave = half2(_WaveX, _WaveY) - uvRect; + #endif + uvWave.x *= _ScreenParams.x / _ScreenParams.y; + float waveTime = _Time.y + randomSeed; + float angWave = (sqrt(dot(uvWave, uvWave)) * _WaveAmount) - ((waveTime * _WaveSpeed)); + d.texcoord0.xy = d.texcoord0.xy + uvWave * sin(angWave) * (_WaveStrength / 1000.0); + #endif + //---------------------------------------------------- + + //ROUNDWAVEUV_ON + #if ROUNDWAVEUV_ON + half xWave = ((0.5 * _MainTex_ST.x) - uvRect.x); + half yWave = ((0.5 * _MainTex_ST.y) - uvRect.y) * (_MainTex_TexelSize.w / _MainTex_TexelSize.z); + half ripple = -sqrt(xWave*xWave + yWave* yWave); + d.texcoord0.xy += (sin((ripple + (_Time.y + randomSeed) * (_RoundWaveSpeed/10.0)) / 0.015) * (_RoundWaveStrength/10.0)) % 1; + #endif + //---------------------------------------------------- + + + //WIND_ON + #if WIND_ON + half windOffset = sin((_Time.x + randomSeed) * _GrassSpeed * 10); + half2 windCenter = half2(0.5, 0.1); + #if ATLAS_ON + windCenter.x = ((_MaxXUV - _MinXUV) * windCenter.x) + _MinXUV; + windCenter.y = ((_MaxYUV - _MinYUV) * windCenter.y) + _MinYUV; + #endif + #if !MANUALWIND_ON + d.texcoord0.x = fmod(abs(lerp(d.texcoord0.x, d.texcoord0.x + (_GrassWind * 0.01 * windOffset), uvRect.y)), 1); + #else + d.texcoord0.x = fmod(abs(lerp(d.texcoord0.x, d.texcoord0.x + (_GrassWind * 0.01 * _GrassManualAnim), uvRect.y)), 1); + windOffset = _GrassManualAnim; + #endif + half2 delta = d.texcoord0.xy - windCenter; + half delta2 = dot(delta.xy, delta.xy); + half2 delta_offset = delta2 * windOffset; + d.texcoord0.xy = d.texcoord0.xy + half2(delta.y, -delta.x) * delta_offset * _GrassRadialBend; + #endif + + //-------------------------------------------------------- + + //TEXTURESCROLL_ON && !ATLAS_ON + #if TEXTURESCROLL_ON && !ATLAS_ON + d.texcoord0.x += ((_Time.y + randomSeed) * _TextureScrollXSpeed) % 1; + d.texcoord0.y += ((_Time.y + randomSeed) * _TextureScrollYSpeed) % 1; + #endif + //------------------------------ + + //PIXELATE_ON + #if PIXELATE_ON + half aspectRatio = _MainTex_TexelSize.x / _MainTex_TexelSize.y; + half2 pixelSize = float2(_PixelateSize, _PixelateSize * aspectRatio); + d.texcoord0.xy = floor(d.texcoord0.xy * pixelSize) / pixelSize; + #endif + //-------------- + + half4 col = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy); + half originalAlpha = col.a; + col *= d.vertexColor; + + //NORMAL MAP + #if NORMALMAP_ON + half4 normalSample = SAMPLE_TEXTURE2D(_NormalMap, sampler_NormalMap, d.texcoord0.xy); + half3 normalTS = UnpackNormal(normalSample); + normalTS.xy *= _NormalStrength; + o.Normal = normalTS; + #endif + + + //GLITCH_ON + #if GLITCH_ON + half2 uvGlitch = uvRect; + uvGlitch.y -= 0.5; + half lineNoise = pow(rand2(floor(uvGlitch * half2(24., 19.) * _GlitchSize) * 4.0, randomSeed), 3.0) * _GlitchAmount + * pow(rand2(floor(uvGlitch * half2(38., 14.) * _GlitchSize) * 4.0, randomSeed), 3.0); + col = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(lineNoise * 0.02 * rand2(half2(2.0, 1), randomSeed), 0)) * d.vertexColor; + #endif + //-------------------------------------- + + //CHROMABERR_ON + #if CHROMABERR_ON + half4 r = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(_ChromAberrAmount/10, 0)) * d.vertexColor; + half4 b = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(-_ChromAberrAmount/10, 0)) * d.vertexColor; + col = half4(r.r * r.a, col.g, b.b * b.a, max(max(r.a, b.a) * _ChromAberrAlpha, col.a)); + #endif + + //-------------------------------- + + //BLUR_ON + #if BLUR_ON + #if ATLAS_ON + #if !BLURISHD_ON + col = BlurHD(d.texcoord0.xy, _MainTex, sampler_MainTex, _BlurIntensity, (_MaxXUV - _MinXUV), (_MaxYUV - _MinYUV)) * d.vertexColor; + #else + col = Blur(d.texcoord0.xy, _MainTex, sampler_MainTex, _BlurIntensity * (_MaxXUV - _MinXUV)) * d.vertexColor; + #endif + #else + #if !BLURISHD_ON + col = BlurHD(d.texcoord0.xy, _MainTex, sampler_MainTex, _BlurIntensity, 1, 1) * d.vertexColor; + #else + col = Blur(d.texcoord0.xy, _MainTex, sampler_MainTex, _BlurIntensity) * d.vertexColor; + #endif + #endif + #endif + + //-------------------- + + //MOTIONBLUR_ON + #if MOTIONBLUR_ON + _MotionBlurAngle = _MotionBlurAngle * 3.1415926; + #define rot(n) mul(n, half2x2(cos(_MotionBlurAngle), -sin(_MotionBlurAngle), sin(_MotionBlurAngle), cos(_MotionBlurAngle))) + _MotionBlurDist = _MotionBlurDist * 0.005; + #if ATLAS_ON + _MotionBlurDist *= (_MaxXUV - _MinXUV); + #endif + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(-_MotionBlurDist, -_MotionBlurDist))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(-_MotionBlurDist * 2, -_MotionBlurDist * 2))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(-_MotionBlurDist * 3, -_MotionBlurDist * 3))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(-_MotionBlurDist * 4, -_MotionBlurDist * 4))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(_MotionBlurDist, _MotionBlurDist))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(_MotionBlurDist * 2, _MotionBlurDist * 2))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(_MotionBlurDist * 3, _MotionBlurDist * 3))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(_MotionBlurDist * 4, _MotionBlurDist * 4))); + col.rgb = col.rgb / 9; + #endif + //------------------------------------ + + //NEGATIVE_ON + #if NEGATIVE_ON + col.rgb = lerp(col.rgb, 1 - col.rgb, _NegativeAmount); + #endif + + //-------------- + half luminance = 0; + + //GREYSCALE_ON && !GREYSCALEOUTLINE_ON + #if GREYSCALE_ON && !GREYSCALEOUTLINE_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + luminance = saturate(luminance + _GreyscaleLuminosity); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _GreyscaleTintColor, _GreyscaleBlend); + #endif + //------------------------------------ + + //GHOST_ON + #if GHOST_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + half4 ghostResult; + ghostResult.a = saturate(luminance - _GhostTransparency) * col.a; + ghostResult.rgb = col.rgb * (luminance + _GhostColorBoost); + col = lerp(col, ghostResult, _GhostBlend); + #endif + //------------------------------------ + + //INNEROUTLINE_ON + #if INNEROUTLINE_ON + half3 innerT = abs(GetPixel(0, _InnerOutlineThickness, d.texcoord0.xy, _MainTex, sampler_MainTex) - GetPixel(0, -_InnerOutlineThickness, d.texcoord0.xy, _MainTex, sampler_MainTex)); + innerT += abs(GetPixel(_InnerOutlineThickness, 0, d.texcoord0.xy, _MainTex, sampler_MainTex) - GetPixel(-_InnerOutlineThickness, 0, d.texcoord0.xy, _MainTex, sampler_MainTex)); + #if !ONLYINNEROUTLINE_ON + innerT = (innerT / 2.0) * col.a * _InnerOutlineAlpha; + col.rgb += length(innerT) * _InnerOutlineColor.rgb * _InnerOutlineGlow; + #else + innerT *= col.a * _InnerOutlineAlpha; + col.rgb = length(innerT) * _InnerOutlineColor.rgb * _InnerOutlineGlow; + col.a = step(0.3, col.r+col.g+col.b); + #endif + #endif + //------------------------------------------------------- + + //HITEFFECT_ON + #if HITEFFECT_ON + col.rgb = lerp(col.rgb, _HitEffectColor.rgb * _HitEffectGlow, _HitEffectBlend); + #endif + //-------------------- + + //GRADIENT_ON + #if GRADIENT_ON + half2 tiledUvGrad = half2(uvRect.x / _MainTex_ST.x, uvRect.y / _MainTex_ST.y); + #if GRADIENT2COL_ON + _GradTopRightCol = _GradTopLeftCol; + _GradBotRightCol = _GradBotLeftCol; + #endif + #if RADIALGRADIENT_ON + half radialDist = 1 - length(tiledUvGrad - half2(0.5, 0.5)); + radialDist *= (_MainTex_TexelSize.w / _MainTex_TexelSize.z); + radialDist = saturate(_GradBoostX * radialDist); + half4 gradientResult = lerp(_GradTopLeftCol, _GradBotLeftCol, radialDist); + #else + half gradXLerpFactor = saturate(pow(tiledUvGrad.x, _GradBoostX)); + half4 gradientResult = lerp(lerp(_GradBotLeftCol, _GradBotRightCol, gradXLerpFactor), + lerp(_GradTopLeftCol, _GradTopRightCol, gradXLerpFactor), saturate(pow(tiledUvGrad.y, _GradBoostY))); + #endif + gradientResult = lerp(col, gradientResult, _GradBlend); + col.rgb = gradientResult.rgb * col.a; + col.a *= gradientResult.a; + #endif + //-------------------------------------------------------------------- + + //CONTRAST_ON + #if CONTRAST_ON + col.rgb = (col.rgb - float3(0.5, 0.5, 0.5)) * _Contrast + float3(0.5, 0.5, 0.5); + col.rgb += _Brightness; + #endif + + //------------------------------------------------------------------- + + //COLORSWAP_ON + #if COLORSWAP_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + half4 swapMask = SAMPLE_TEXTURE2D(_ColorSwapTex, sampler_ColorSwapTex, d.texcoord0.xy); + swapMask.rgb *= swapMask.a; + half3 redSwap = _ColorSwapRed * swapMask.r * saturate(luminance + _ColorSwapRedLuminosity); + half3 greenSwap = _ColorSwapGreen * swapMask.g * saturate(luminance + _ColorSwapGreenLuminosity); + half3 blueSwap = _ColorSwapBlue * swapMask.b * saturate(luminance + _ColorSwapBlueLuminosity); + swapMask.rgb = col.rgb * saturate(1 - swapMask.r - swapMask.g - swapMask.b); + col.rgb = lerp(col.rgb, swapMask.rgb + redSwap + greenSwap + blueSwap, _ColorSwapBlend); + #endif + //-------------------------------------------------------------------- + + //COLORRAMP_ON && !COLORRAMPOUTLINE_ON + #if COLORRAMP_ON && !COLORRAMPOUTLINE_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + luminance = saturate(luminance + _ColorRampLuminosity); + #if GRADIENTCOLORRAMP_ON + col.rgb = lerp(col.rgb, SAMPLE_TEXTURE2D(_ColorRampTexGradient, sampler_ColorRampTexGradient, half2(luminance, 0)).rgb, _ColorRampBlend); + #else + col.rgb = lerp(col.rgb, SAMPLE_TEXTURE2D(_ColorRampTex, sampler_ColorRampTex, half2(luminance, 0)).rgb, _ColorRampBlend); + #endif + #endif + //-------------------------------------------------------------------- + + //CHANGECOLOR_ON + #if CHANGECOLOR_ON + float3 currChangeColor = saturate(col.rgb); + luminance = 0.3 * currChangeColor.r + 0.59 * currChangeColor.g + 0.11 * currChangeColor.b; + luminance = saturate(luminance + _ColorChangeLuminosity); + half3 dif = abs(currChangeColor - _ColorChangeTarget.rgb); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _ColorChangeNewCol.rgb, + max(sign(1 - saturate(dif.x + dif.y + dif.z) - _ColorChangeTolerance), 0.0)); + #if CHANGECOLOR2_ON + dif = abs(currChangeColor - _ColorChangeTarget2.rgb); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _ColorChangeNewCol2.rgb, + max(sign(1 - saturate(dif.x + dif.y + dif.z) - _ColorChangeTolerance2), 0.0)); + #endif + #if CHANGECOLOR3_ON + dif = abs(currChangeColor - _ColorChangeTarget3.rgb); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _ColorChangeNewCol3.rgb, + max(sign(1 - saturate(dif.x + dif.y + dif.z) - _ColorChangeTolerance3), 0.0)); + #endif + #endif + //------------------------------------------------------- + + //POSTERIZE_ON && !POSTERIZEOUTLINE_ON + #if POSTERIZE_ON && !POSTERIZEOUTLINE_ON + col.rgb = pow(col.rgb, _PosterizeGamma) * _PosterizeNumColors; + col.rgb = floor(col.rgb) / _PosterizeNumColors; + col.rgb = pow(col.rgb, 1.0 / _PosterizeGamma); + #endif + //------------------------------------ + + //HSV_ON + #if HSV_ON + half3 resultHsv = half3(col.rgb); + half cosHsv = _HsvBright * _HsvSaturation * cos(_HsvShift * 3.14159265 / 180); + half sinHsv = _HsvBright * _HsvSaturation * sin(_HsvShift * 3.14159265 / 180); + resultHsv.x = (.299 * _HsvBright + .701 * cosHsv + .168 * sinHsv) * col.x + + (.587 * _HsvBright - .587 * cosHsv + .330 * sinHsv) * col.y + + (.114 * _HsvBright - .114 * cosHsv - .497 * sinHsv) * col.z; + resultHsv.y = (.299 * _HsvBright - .299 * cosHsv - .328 * sinHsv) *col.x + + (.587 * _HsvBright + .413 * cosHsv + .035 * sinHsv) * col.y + + (.114 * _HsvBright - .114 * cosHsv + .292 * sinHsv) * col.z; + resultHsv.z = (.299 * _HsvBright - .3 * cosHsv + 1.25 * sinHsv) * col.x + + (.587 * _HsvBright - .588 * cosHsv - 1.05 * sinHsv) * col.y + + (.114 * _HsvBright + .886 * cosHsv - .203 * sinHsv) * col.z; + col.rgb = resultHsv; + #endif + //------------------------------------------------------- + + //OVERLAY_ON + #if OVERLAY_ON + half2 overlayUvs = d.texcoord0.xy; + overlayUvs.x += ((_Time.y + randomSeed) * _OverlayTextureScrollXSpeed) % 1; + overlayUvs.y += ((_Time.y + randomSeed) * _OverlayTextureScrollYSpeed) % 1; + half4 overlayCol = SAMPLE_TEXTURE2D(_OverlayTex, sampler_OverlayTex, TRANSFORM_TEX(overlayUvs, _OverlayTex)); + overlayCol.rgb *= _OverlayColor.rgb * _OverlayGlow; + #if !OVERLAYMULT_ON + overlayCol.rgb *= overlayCol.a * _OverlayColor.rgb * _OverlayColor.a * _OverlayBlend; + col.rgb += overlayCol.rgb; + #else + overlayCol.a *= _OverlayColor.a; + col = lerp(col, col * overlayCol, _OverlayBlend); + #endif + #endif + + //--------------------------------- + + //OUTBASE_ON + #if OUTBASE_ON + #if OUTBASEPIXELPERF_ON + half2 destUv = half2(_OutlinePixelWidth * _MainTex_TexelSize.x, _OutlinePixelWidth * _MainTex_TexelSize.y); + #else + half2 destUv = half2(_OutlineWidth * _MainTex_TexelSize.x * 200, _OutlineWidth * _MainTex_TexelSize.y * 200); + #endif + + #if OUTDIST_ON + d.texcoord3.x += ((_Time.x + _RandomSeed) * _OutlineDistortTexXSpeed) % 1; + d.texcoord3.y += ((_Time.x + _RandomSeed) * _OutlineDistortTexYSpeed) % 1; + #if ATLAS_ON + d.texcoord3 = half2((d.texcoord3.x - _MinXUV) / (_MaxXUV - _MinXUV), (d.texcoord3.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half outDistortAmnt = (SAMPLE_TEXTURE2D(_OutlineDistortTex, sampler_OutlineDistortTex, d.texcoord3).r - 0.5) * 0.2 * _OutlineDistortAmount; + destUv.x += outDistortAmnt; + destUv.y += outDistortAmnt; + #endif + + half spriteLeft = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(destUv.x, 0)).a; + half spriteRight = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy - half2(destUv.x, 0)).a; + half spriteBottom = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(0, destUv.y)).a; + half spriteTop = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy - half2(0, destUv.y)).a; + half result = spriteLeft + spriteRight + spriteBottom + spriteTop; + + #if OUTBASE8DIR_ON + half spriteTopLeft = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(destUv.x, destUv.y)).a; + half spriteTopRight = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(-destUv.x, destUv.y)).a; + half spriteBotLeft = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(destUv.x, -destUv.y)).a; + half spriteBotRight = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(-destUv.x, -destUv.y)).a; + result = result + spriteTopLeft + spriteTopRight + spriteBotLeft + spriteBotRight; + #endif + + result = step(0.05, saturate(result)); + + #if OUTTEX_ON + d.texcoord1.x += ((_Time.x + _RandomSeed) * _OutlineTexXSpeed) % 1; + d.texcoord1.y += ((_Time.x + _RandomSeed) * _OutlineTexYSpeed) % 1; + #if ATLAS_ON + d.texcoord1 = half2((d.texcoord1.x - _MinXUV) / (_MaxXUV - _MinXUV), (d.texcoord1.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half4 tempOutColor = SAMPLE_TEXTURE2D(_OutlineTex, sampler_OutlineTex, d.texcoord1); + tempOutColor *= _OutlineColor; + _OutlineColor = tempOutColor; + #endif + + result *= (1 - originalAlpha) * _OutlineAlpha; + + half4 outline = _OutlineColor * d.vertexColor.a; + outline.rgb *= _OutlineGlow; + outline.a = result; + #if ONLYOUTLINE_ON + col = outline; + #else + col = lerp(col, outline, result); + #endif + #endif + //------------------------------------------------------- + + //FADE_ON + #if FADE_ON + half2 tiledUvFade1 = TRANSFORM_TEX(d.texcoord0, _FadeTex); + half2 tiledUvFade2 = TRANSFORM_TEX(d.texcoord0, _FadeBurnTex); + #if ATLAS_ON + tiledUvFade1 = half2((tiledUvFade1.x - _MinXUV) / (_MaxXUV - _MinXUV), (tiledUvFade1.y - _MinYUV) / (_MaxYUV - _MinYUV)); + tiledUvFade2 = half2((tiledUvFade2.x - _MinXUV) / (_MaxXUV - _MinXUV), (tiledUvFade2.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half fadeTemp = SAMPLE_TEXTURE2D(_FadeTex, sampler_FadeTex, tiledUvFade1).r; + half fade = smoothstep(_FadeAmount, _FadeAmount + _FadeBurnTransition, fadeTemp); + half fadeBurn = saturate(smoothstep(_FadeAmount - _FadeBurnWidth, _FadeAmount - _FadeBurnWidth + 0.1, fadeTemp) * _FadeAmount); + col.a *= fade; + _FadeBurnColor.rgb *= _FadeBurnGlow; + col += fadeBurn * SAMPLE_TEXTURE2D(_FadeBurnTex, sampler_FadeBurnTex, tiledUvFade2) * _FadeBurnColor * originalAlpha * (1 - col.a); + #endif + //------------------------------------------------------- + + //SHADOW_ON + #if SHADOW_ON + half shadowA = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(_ShadowX, _ShadowY)).a; + half preMultShadowMask = 1 - (saturate(shadowA - col.a) * (1 - col.a)); + col.rgb *= 1 - ((shadowA - col.a) * (1 - col.a)); + col.rgb += (_ShadowColor * shadowA) * (1 - col.a); + col.a = max(shadowA * _ShadowAlpha * d.vertexColor.a, col.a); + #endif + + //------------------------------------------------------- + + //GLOW_ON + #if GLOW_ON + half4 emission; + #if GLOWTEX_ON + emission = SAMPLE_TEXTURE2D(_GlowTex, sampler_GlowTex, d.texcoord0); + #else + emission = col; + #endif + + col.rgb *= _GlowGlobal; + emission.rgb *= emission.a * col.a * _Glow * _GlowColor; + col.rgb += emission.rgb; + #endif + //------------------------------------------------------- + + //COLORRAMP_ON && COLORRAMPOUTLINE_ON + #if COLORRAMP_ON && COLORRAMPOUTLINE_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + luminance = saturate(luminance + _ColorRampLuminosity); + #if GRADIENTCOLORRAMP_ON + col.rgb = lerp(col.rgb, SAMPLE_TEXTURE2D(_ColorRampTexGradient, sampler_ColorRampTexGradient, half2(luminance, 0)).rgb, _ColorRampBlend); + #else + col.rgb = lerp(col.rgb, SAMPLE_TEXTURE2D(_ColorRampTex, sampler_ColorRampTex, half2(luminance, 0)).rgb, _ColorRampBlend); + #endif + #endif + //--------------- + + //GREYSCALE_ON && GREYSCALEOUTLINE_ON + #if GREYSCALE_ON && GREYSCALEOUTLINE_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + luminance = saturate(luminance + _GreyscaleLuminosity); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _GreyscaleTintColor, _GreyscaleBlend); + #endif + + //----------------------------------- + + //POSTERIZE_ON && POSTERIZEOUTLINE_ON + #if POSTERIZE_ON && POSTERIZEOUTLINE_ON + col.rgb = pow(col.rgb, _PosterizeGamma) * _PosterizeNumColors; + col.rgb = floor(col.rgb) / _PosterizeNumColors; + col.rgb = pow(col.rgb, 1.0 / _PosterizeGamma); + #endif + + //----------------------------------- + + //SHINE_ON + #if SHINE_ON + half2 uvShine = uvRect; + half cosAngle = cos(_ShineRotate); + half sinAngle = sin(_ShineRotate); + half2x2 rot = half2x2(cosAngle, -sinAngle, sinAngle, cosAngle); + uvShine -= half2(0.5, 0.5); + uvShine = mul(rot, uvShine); + uvShine += half2(0.5, 0.5); + half shineMask = SAMPLE_TEXTURE2D(_ShineMask, sampler_ShineMask, d.texcoord0.xy).a; + half currentDistanceProjection = (uvShine.x + uvShine.y) / 2; + half whitePower = 1 - (abs(currentDistanceProjection - _ShineLocation) / _ShineWidth); + col.rgb += col.a * whitePower * _ShineGlow * max(sign(currentDistanceProjection - (_ShineLocation - _ShineWidth)), 0.0) + * max(sign((_ShineLocation + _ShineWidth) - currentDistanceProjection), 0.0) * _ShineColor * shineMask; + #endif + + //----------------------------------- + + //HOLOGRAM_ON + #if HOLOGRAM_ON + half totalHologram = _HologramStripesAmount + _HologramUnmodAmount; + half hologramYCoord = ((uvRect.y + (((_Time.x + randomSeed) % 1) * _HologramStripesSpeed)) % totalHologram) / totalHologram; + hologramYCoord = abs(hologramYCoord); + half alpha = RemapFloat(saturate(hologramYCoord - (_HologramUnmodAmount/totalHologram)), 0.0, 1.0, _HologramMinAlpha, saturate(_HologramMaxAlpha)); + half hologramMask = max(sign((_HologramUnmodAmount/totalHologram) - hologramYCoord), 0.0); + half4 hologramResult = col; + hologramResult.a *= lerp(alpha, 1, hologramMask); + hologramResult.rgb *= max(1, _HologramMaxAlpha * max(sign(hologramYCoord - (_HologramUnmodAmount/totalHologram)), 0.0)); + hologramMask = 1 - step(0.01,hologramMask); + hologramResult.rgb += hologramMask * _HologramStripeColor * col.a; + col = lerp(col, hologramResult, _HologramBlend); + #endif + + //----------------------------------- + + //FLICKER_ON + #if FLICKER_ON + col.a *= saturate(col.a * step(frac(0.05 + (_Time.w + randomSeed) * _FlickerFreq), 1 - _FlickerPercent) + _FlickerAlpha); + #endif + //----------------------------------- + + //ALPHACUTOFF_ON + + //ALPHAROUND_ON + + //ALPHAOUTLINE_ON + #if ALPHAOUTLINE_ON + half alphaOutlineRes = pow(1 - col.a, max(_AlphaOutlinePower, 0.0001)) * step(_AlphaOutlineMinAlpha, col.a) * _AlphaOutlineBlend; + col.rgb = lerp(col.rgb, _AlphaOutlineColor.rgb * _AlphaOutlineGlow, alphaOutlineRes); + col.a = lerp(col.a, 1, alphaOutlineRes > 1); + #endif + //------------------------------------------------------- + + //FOG_ON + + //------------------ + + col *= _Color; + o.Albedo = col; + col.a *= _Alpha; + clip(col.a - _AlphaCutoffValue - 0.01); + o.Alpha = _Color.a; + } + + + + + + void ChainSurfaceFunction(inout Surface l, inout ShaderData d) + { + Ext_SurfaceFunction0(l, d); + // Ext_SurfaceFunction1(l, d); + // Ext_SurfaceFunction2(l, d); + // Ext_SurfaceFunction3(l, d); + // Ext_SurfaceFunction4(l, d); + // Ext_SurfaceFunction5(l, d); + // Ext_SurfaceFunction6(l, d); + // Ext_SurfaceFunction7(l, d); + // Ext_SurfaceFunction8(l, d); + // Ext_SurfaceFunction9(l, d); + // Ext_SurfaceFunction10(l, d); + // Ext_SurfaceFunction11(l, d); + // Ext_SurfaceFunction12(l, d); + // Ext_SurfaceFunction13(l, d); + // Ext_SurfaceFunction14(l, d); + // Ext_SurfaceFunction15(l, d); + // Ext_SurfaceFunction16(l, d); + // Ext_SurfaceFunction17(l, d); + // Ext_SurfaceFunction18(l, d); + // Ext_SurfaceFunction19(l, d); + // Ext_SurfaceFunction20(l, d); + // Ext_SurfaceFunction21(l, d); + // Ext_SurfaceFunction22(l, d); + // Ext_SurfaceFunction23(l, d); + // Ext_SurfaceFunction24(l, d); + // Ext_SurfaceFunction25(l, d); + // Ext_SurfaceFunction26(l, d); + // Ext_SurfaceFunction27(l, d); + // Ext_SurfaceFunction28(l, d); + // Ext_SurfaceFunction29(l, d); + } + +#if !_DECALSHADER + + void ChainModifyVertex(inout VertexData v, inout VertexToPixel v2p, float4 time) + { + ExtraV2F d; + + ZERO_INITIALIZE(ExtraV2F, d); + ZERO_INITIALIZE(Blackboard, d.blackboard); + // due to motion vectors in HDRP, we need to use the last + // time in certain spots. So if you are going to use _Time to adjust vertices, + // you need to use this time or motion vectors will break. + d.time = time; + + Ext_ModifyVertex0(v, d); + // Ext_ModifyVertex1(v, d); + // Ext_ModifyVertex2(v, d); + // Ext_ModifyVertex3(v, d); + // Ext_ModifyVertex4(v, d); + // Ext_ModifyVertex5(v, d); + // Ext_ModifyVertex6(v, d); + // Ext_ModifyVertex7(v, d); + // Ext_ModifyVertex8(v, d); + // Ext_ModifyVertex9(v, d); + // Ext_ModifyVertex10(v, d); + // Ext_ModifyVertex11(v, d); + // Ext_ModifyVertex12(v, d); + // Ext_ModifyVertex13(v, d); + // Ext_ModifyVertex14(v, d); + // Ext_ModifyVertex15(v, d); + // Ext_ModifyVertex16(v, d); + // Ext_ModifyVertex17(v, d); + // Ext_ModifyVertex18(v, d); + // Ext_ModifyVertex19(v, d); + // Ext_ModifyVertex20(v, d); + // Ext_ModifyVertex21(v, d); + // Ext_ModifyVertex22(v, d); + // Ext_ModifyVertex23(v, d); + // Ext_ModifyVertex24(v, d); + // Ext_ModifyVertex25(v, d); + // Ext_ModifyVertex26(v, d); + // Ext_ModifyVertex27(v, d); + // Ext_ModifyVertex28(v, d); + // Ext_ModifyVertex29(v, d); + + + // #if %EXTRAV2F0REQUIREKEY% + // v2p.extraV2F0 = d.extraV2F0; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // v2p.extraV2F1 = d.extraV2F1; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // v2p.extraV2F2 = d.extraV2F2; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // v2p.extraV2F3 = d.extraV2F3; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // v2p.extraV2F4 = d.extraV2F4; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // v2p.extraV2F5 = d.extraV2F5; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // v2p.extraV2F6 = d.extraV2F6; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // v2p.extraV2F7 = d.extraV2F7; + // #endif + } + + void ChainModifyTessellatedVertex(inout VertexData v, inout VertexToPixel v2p) + { + ExtraV2F d; + ZERO_INITIALIZE(ExtraV2F, d); + ZERO_INITIALIZE(Blackboard, d.blackboard); + + // #if %EXTRAV2F0REQUIREKEY% + // d.extraV2F0 = v2p.extraV2F0; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // d.extraV2F1 = v2p.extraV2F1; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // d.extraV2F2 = v2p.extraV2F2; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // d.extraV2F3 = v2p.extraV2F3; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // d.extraV2F4 = v2p.extraV2F4; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // d.extraV2F5 = v2p.extraV2F5; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // d.extraV2F6 = v2p.extraV2F6; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // d.extraV2F7 = v2p.extraV2F7; + // #endif + + + // Ext_ModifyTessellatedVertex0(v, d); + // Ext_ModifyTessellatedVertex1(v, d); + // Ext_ModifyTessellatedVertex2(v, d); + // Ext_ModifyTessellatedVertex3(v, d); + // Ext_ModifyTessellatedVertex4(v, d); + // Ext_ModifyTessellatedVertex5(v, d); + // Ext_ModifyTessellatedVertex6(v, d); + // Ext_ModifyTessellatedVertex7(v, d); + // Ext_ModifyTessellatedVertex8(v, d); + // Ext_ModifyTessellatedVertex9(v, d); + // Ext_ModifyTessellatedVertex10(v, d); + // Ext_ModifyTessellatedVertex11(v, d); + // Ext_ModifyTessellatedVertex12(v, d); + // Ext_ModifyTessellatedVertex13(v, d); + // Ext_ModifyTessellatedVertex14(v, d); + // Ext_ModifyTessellatedVertex15(v, d); + // Ext_ModifyTessellatedVertex16(v, d); + // Ext_ModifyTessellatedVertex17(v, d); + // Ext_ModifyTessellatedVertex18(v, d); + // Ext_ModifyTessellatedVertex19(v, d); + // Ext_ModifyTessellatedVertex20(v, d); + // Ext_ModifyTessellatedVertex21(v, d); + // Ext_ModifyTessellatedVertex22(v, d); + // Ext_ModifyTessellatedVertex23(v, d); + // Ext_ModifyTessellatedVertex24(v, d); + // Ext_ModifyTessellatedVertex25(v, d); + // Ext_ModifyTessellatedVertex26(v, d); + // Ext_ModifyTessellatedVertex27(v, d); + // Ext_ModifyTessellatedVertex28(v, d); + // Ext_ModifyTessellatedVertex29(v, d); + + // #if %EXTRAV2F0REQUIREKEY% + // v2p.extraV2F0 = d.extraV2F0; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // v2p.extraV2F1 = d.extraV2F1; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // v2p.extraV2F2 = d.extraV2F2; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // v2p.extraV2F3 = d.extraV2F3; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // v2p.extraV2F4 = d.extraV2F4; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // v2p.extraV2F5 = d.extraV2F5; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // v2p.extraV2F6 = d.extraV2F6; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // v2p.extraV2F7 = d.extraV2F7; + // #endif + } + + void ChainFinalColorForward(inout Surface l, inout ShaderData d, inout half4 color) + { + // Ext_FinalColorForward0(l, d, color); + // Ext_FinalColorForward1(l, d, color); + // Ext_FinalColorForward2(l, d, color); + // Ext_FinalColorForward3(l, d, color); + // Ext_FinalColorForward4(l, d, color); + // Ext_FinalColorForward5(l, d, color); + // Ext_FinalColorForward6(l, d, color); + // Ext_FinalColorForward7(l, d, color); + // Ext_FinalColorForward8(l, d, color); + // Ext_FinalColorForward9(l, d, color); + // Ext_FinalColorForward10(l, d, color); + // Ext_FinalColorForward11(l, d, color); + // Ext_FinalColorForward12(l, d, color); + // Ext_FinalColorForward13(l, d, color); + // Ext_FinalColorForward14(l, d, color); + // Ext_FinalColorForward15(l, d, color); + // Ext_FinalColorForward16(l, d, color); + // Ext_FinalColorForward17(l, d, color); + // Ext_FinalColorForward18(l, d, color); + // Ext_FinalColorForward19(l, d, color); + // Ext_FinalColorForward20(l, d, color); + // Ext_FinalColorForward21(l, d, color); + // Ext_FinalColorForward22(l, d, color); + // Ext_FinalColorForward23(l, d, color); + // Ext_FinalColorForward24(l, d, color); + // Ext_FinalColorForward25(l, d, color); + // Ext_FinalColorForward26(l, d, color); + // Ext_FinalColorForward27(l, d, color); + // Ext_FinalColorForward28(l, d, color); + // Ext_FinalColorForward29(l, d, color); + } + + void ChainFinalGBufferStandard(inout Surface s, inout ShaderData d, inout half4 GBuffer0, inout half4 GBuffer1, inout half4 GBuffer2, inout half4 outEmission, inout half4 outShadowMask) + { + // Ext_FinalGBufferStandard0(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard1(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard2(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard3(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard4(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard5(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard6(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard7(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard8(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard9(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard10(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard11(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard12(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard13(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard14(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard15(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard16(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard17(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard18(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard19(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard20(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard21(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard22(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard23(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard24(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard25(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard26(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard27(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard28(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard29(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + } +#endif + + + + + +#if _DECALSHADER + + ShaderData CreateShaderData(SurfaceDescriptionInputs IN) + { + ShaderData d = (ShaderData)0; + d.TBNMatrix = float3x3(IN.WorldSpaceTangent, IN.WorldSpaceBiTangent, IN.WorldSpaceNormal); + d.worldSpaceNormal = IN.WorldSpaceNormal; + d.worldSpaceTangent = IN.WorldSpaceTangent; + + d.worldSpacePosition = IN.WorldSpacePosition; + d.texcoord0 = IN.uv0.xyxy; + d.screenPos = IN.ScreenPosition; + + d.worldSpaceViewDir = normalize(_WorldSpaceCameraPos - d.worldSpacePosition); + + d.tangentSpaceViewDir = mul(d.TBNMatrix, d.worldSpaceViewDir); + + // these rarely get used, so we back transform them. Usually will be stripped. + #if _HDRP + // d.localSpacePosition = mul(GetWorldToObjectMatrix(), float4(GetCameraRelativePositionWS(d.worldSpacePosition), 1)).xyz; + #else + // d.localSpacePosition = mul(GetWorldToObjectMatrix(), float4(d.worldSpacePosition, 1)).xyz; + #endif + // d.localSpaceNormal = normalize(mul((float3x3)GetWorldToObjectMatrix(), d.worldSpaceNormal)); + // d.localSpaceTangent = normalize(mul((float3x3)GetWorldToObjectMatrix(), d.worldSpaceTangent.xyz)); + + // #if %SCREENPOSREQUIREKEY% + // d.screenUV = (IN.ScreenPosition.xy / max(0.01, IN.ScreenPosition.w)); + // #endif + + return d; + } +#else + + ShaderData CreateShaderData(VertexToPixel i + #if NEED_FACING + , bool facing + #endif + ) + { + ShaderData d = (ShaderData)0; + d.clipPos = i.pos; + d.worldSpacePosition = i.worldPos; + + d.worldSpaceNormal = normalize(i.worldNormal); + d.worldSpaceTangent.xyz = normalize(i.worldTangent.xyz); + + d.tangentSign = i.worldTangent.w * unity_WorldTransformParams.w; + float3 bitangent = cross(d.worldSpaceTangent.xyz, d.worldSpaceNormal) * d.tangentSign; + + d.TBNMatrix = float3x3(d.worldSpaceTangent, -bitangent, d.worldSpaceNormal); + d.worldSpaceViewDir = normalize(_WorldSpaceCameraPos - i.worldPos); + + d.tangentSpaceViewDir = mul(d.TBNMatrix, d.worldSpaceViewDir); + d.texcoord0 = i.texcoord0; + d.texcoord1 = i.texcoord1; + d.texcoord2 = i.texcoord2; + + // #if %TEXCOORD3REQUIREKEY% + d.texcoord3 = i.texcoord3; + // #endif + + // d.isFrontFace = facing; + // #if %VERTEXCOLORREQUIREKEY% + d.vertexColor = i.vertexColor; + // #endif + + // these rarely get used, so we back transform them. Usually will be stripped. + #if _HDRP + // d.localSpacePosition = mul(GetWorldToObjectMatrix(), float4(GetCameraRelativePositionWS(i.worldPos), 1)).xyz; + #else + // d.localSpacePosition = mul(GetWorldToObjectMatrix(), float4(i.worldPos, 1)).xyz; + #endif + // d.localSpaceNormal = normalize(mul((float3x3)GetWorldToObjectMatrix(), i.worldNormal)); + // d.localSpaceTangent = normalize(mul((float3x3)GetWorldToObjectMatrix(), i.worldTangent.xyz)); + + // #if %SCREENPOSREQUIREKEY% + // d.screenPos = i.screenPos; + // d.screenUV = (i.screenPos.xy / i.screenPos.w); + // #endif + + + // #if %EXTRAV2F0REQUIREKEY% + // d.extraV2F0 = i.extraV2F0; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // d.extraV2F1 = i.extraV2F1; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // d.extraV2F2 = i.extraV2F2; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // d.extraV2F3 = i.extraV2F3; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // d.extraV2F4 = i.extraV2F4; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // d.extraV2F5 = i.extraV2F5; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // d.extraV2F6 = i.extraV2F6; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // d.extraV2F7 = i.extraV2F7; + // #endif + + return d; + } + +#endif + + // vertex shader + VertexToPixel Vert (VertexData v) + { + UNITY_SETUP_INSTANCE_ID(v); + VertexToPixel o; + UNITY_INITIALIZE_OUTPUT(VertexToPixel,o); + UNITY_TRANSFER_INSTANCE_ID(v,o); + UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o); + +#if !_TESSELLATION_ON + ChainModifyVertex(v, o, _Time); +#endif + + + o.pos = UnityMetaVertexPosition(v.vertex, v.texcoord1.xy, v.texcoord2.xy, unity_LightmapST, unity_DynamicLightmapST); + #ifdef EDITOR_VISUALIZATION + o.vizUV = 0; + o.lightCoord = 0; + if (unity_VisualizationMode == EDITORVIZ_TEXTURE) + o.vizUV = UnityMetaVizUV(unity_EditorViz_UVIndex, v.texcoord0.xy, v.texcoord1.xy, v.texcoord2.xy, unity_EditorViz_Texture_ST); + else if (unity_VisualizationMode == EDITORVIZ_SHOWLIGHTMASK) + { + o.vizUV = v.texcoord1.xy * unity_LightmapST.xy + unity_LightmapST.zw; + o.lightCoord = mul(unity_EditorViz_WorldToLight, mul(GetObjectToWorldMatrix(), float4(v.vertex.xyz, 1))); + } + #endif + + + o.texcoord0 = v.texcoord0; + o.texcoord1 = v.texcoord1; + o.texcoord2 = v.texcoord2; + + // #if %TEXCOORD3REQUIREKEY% + o.texcoord3 = v.texcoord3; + // #endif + + // #if %VERTEXCOLORREQUIREKEY% + o.vertexColor = v.vertexColor; + // #endif + + // #if %SCREENPOSREQUIREKEY% + // o.screenPos = ComputeScreenPos(o.pos); + // #endif + + o.worldPos = mul(GetObjectToWorldMatrix(), v.vertex).xyz; + o.worldNormal = UnityObjectToWorldNormal(v.normal); + o.worldTangent = float4(UnityObjectToWorldDir(v.tangent.xyz), v.tangent.w); + + return o; + } + + + + // fragment shader + fixed4 Frag (VertexToPixel IN + #if NEED_FACING + , bool facing : SV_IsFrontFace + #endif + ) : SV_Target + { + UNITY_SETUP_INSTANCE_ID(IN); + + #ifdef FOG_COMBINED_WITH_TSPACE + UNITY_EXTRACT_FOG_FROM_TSPACE(IN); + #elif defined FOG_COMBINED_WITH_WORLD_POS + UNITY_EXTRACT_FOG_FROM_WORLD_POS(IN); + #else + UNITY_EXTRACT_FOG(IN); + #endif + + ShaderData d = CreateShaderData(IN + #if NEED_FACING + , facing + #endif + ); + + Surface l = (Surface)0; + + l.Albedo = half3(0.5, 0.5, 0.5); + l.Normal = float3(0,0,1); + l.Occlusion = 1; + l.Alpha = 1; + + + ChainSurfaceFunction(l, d); + + UnityMetaInput metaIN; + UNITY_INITIALIZE_OUTPUT(UnityMetaInput, metaIN); + metaIN.Albedo = l.Albedo; + metaIN.Emission = l.Emission; + + #if _USESPECULAR + metaIN.SpecularColor = l.Specular; + #endif + + #ifdef EDITOR_VISUALIZATION + metaIN.VizUV = IN.vizUV; + metaIN.LightCoord = IN.lightCoord; + #endif + return UnityMetaFragment(metaIN); + } + ENDCG + + } + + + + + + } + + + CustomEditor "AllIn1SpriteShaderLitMaterialInspector" +} diff --git a/Assets/Plugins/AllIn1SpriteShader/Shaders/LitShaders/AllIn1SpriteShaderLit_BetterShader_Standard.txt.meta b/Assets/Plugins/AllIn1SpriteShader/Shaders/LitShaders/AllIn1SpriteShaderLit_BetterShader_Standard.txt.meta new file mode 100644 index 000000000..03096d78c --- /dev/null +++ b/Assets/Plugins/AllIn1SpriteShader/Shaders/LitShaders/AllIn1SpriteShaderLit_BetterShader_Standard.txt.meta @@ -0,0 +1,14 @@ +fileFormatVersion: 2 +guid: d0469e88f445d184f88bc25be7464884 +TextScriptImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 156513 + packageName: All In 1 Sprite Shader + packageVersion: 4.25 + assetPath: Assets/Plugins/AllIn1SpriteShader/Shaders/LitShaders/AllIn1SpriteShaderLit_BetterShader_Standard.txt + uploadId: 708810 diff --git a/Assets/Plugins/AllIn1SpriteShader/Shaders/LitShaders/AllIn1SpriteShaderLit_BetterShader_URP2019.txt b/Assets/Plugins/AllIn1SpriteShader/Shaders/LitShaders/AllIn1SpriteShaderLit_BetterShader_URP2019.txt new file mode 100644 index 000000000..e5df848ca --- /dev/null +++ b/Assets/Plugins/AllIn1SpriteShader/Shaders/LitShaders/AllIn1SpriteShaderLit_BetterShader_URP2019.txt @@ -0,0 +1,11776 @@ +//////////////////////////////////////// +// Generated with Better Shaders +// +// Auto-generated shader code, don't hand edit! +// +// Unity Version: 2019.4.16f1 +// Render Pipeline: URP2019 +// Platform: WindowsEditor +//////////////////////////////////////// + + +Shader "AllIn1SpriteShader/AllIn1SpriteShaderLit_BetterShader" +{ + Properties + { + + _MainTex ("Main Texture", 2D) = "white" {} //0 + _Color("Main Color", Color) = (1,1,1,1) //1 + _Alpha("General Alpha", Range(0,1)) = 1 //2 + + _GlowColor("Glow Color", Color) = (1,1,1,1) //3 + _Glow("Glow Color Intensity", Range(0,100)) = 10 //4 + _GlowGlobal("Global Glow Intensity", Range(1,100)) = 1 //5 + [NoScaleOffset] _GlowTex("Glow Texture", 2D) = "white" {} //6 + + _FadeTex("Fade Texture", 2D) = "white" {} //7 + _FadeAmount("Fade Amount", Range(-0.1,1)) = -0.1 //8 + _FadeBurnWidth("Fade Burn Width", Range(0,1)) = 0.025 //9 + _FadeBurnTransition("Burn Transition", Range(0.01,0.5)) = 0.075 //10 + _FadeBurnColor("Fade Burn Color", Color) = (1,1,0,1) //11 + _FadeBurnTex("Fade Burn Texture", 2D) = "white" {} //12 + _FadeBurnGlow("Fade Burn Glow", Range(1,250)) = 2//13 + + _OutlineColor("Outline Base Color", Color) = (1,1,1,1) //14 + _OutlineAlpha("Outline Base Alpha", Range(0,1)) = 1 //15 + _OutlineGlow("Outline Base Glow", Range(1,100)) = 1.5 //16 + _OutlineWidth("Outline Base Width", Range(0,0.2)) = 0.004 //17 + _OutlinePixelWidth("Outline Base Pixel Width", Int) = 1 //18 + + [Space] + _OutlineTex("Outline Texture", 2D) = "white" {} //19 + _OutlineTexXSpeed("Texture scroll speed X", Range(-50,50)) = 10 //20 + _OutlineTexYSpeed("Texture scroll speed Y", Range(-50,50)) = 0 //21 + + [Space] + _OutlineDistortTex("Outline Distortion Texture", 2D) = "white" {} //22 + _OutlineDistortAmount("Outline Distortion Amount", Range(0,2)) = 0.5 //23 + _OutlineDistortTexXSpeed("Distortion scroll speed X", Range(-50,50)) = 5 //24 + _OutlineDistortTexYSpeed("Distortion scroll speed Y", Range(-50,50)) = 5 //25 + + _AlphaOutlineColor("Color", Color) = (1, 1, 1, 1) //26 + _AlphaOutlineGlow("Outline Glow", Range(1,100)) = 5 //27 + _AlphaOutlinePower("Power", Range(0, 5)) = 1 // 28 + _AlphaOutlineMinAlpha("Min Alpha", Range(0, 1)) = 0 // 29 + _AlphaOutlineBlend("Blend", Range(0, 1)) = 1 // 30 + + _GradBlend("Gradient Blend", Range(0,1)) = 1 //31 + _GradTopLeftCol("Top Color", Color) = (1,0,0,1) //32 + _GradTopRightCol("Top Color 2", Color) = (1, 1, 0, 1) //33 + _GradBotLeftCol("Bot Color", Color) = (0,0,1,1) //34 + _GradBotRightCol("Bot Color 2", Color) = (0, 1, 0, 1) //35 + + [NoScaleOffset] _ColorSwapTex("Color Swap Texture", 2D) = "black" {} //36 + [HDR] _ColorSwapRed("Red Channel", Color) = (1,1,1,1) //37 + _ColorSwapRedLuminosity("Red luminosity", Range(-1,1)) = 0.5 //38 + [HDR] _ColorSwapGreen("Green Channel", Color) = (1,1,1,1) //39 + _ColorSwapGreenLuminosity("Green luminosity", Range(-1,1)) = 0.5 //40 + [HDR] _ColorSwapBlue("Blue Channel", Color) = (1,1,1,1) //41 + _ColorSwapBlueLuminosity("Blue luminosity", Range(-1,1)) = 0.5 //42 + + _HsvShift("Hue Shift", Range(0, 360)) = 180 //43 + _HsvSaturation("Saturation", Range(0, 2)) = 1 //44 + _HsvBright("Brightness", Range(0, 2)) = 1 //45 + + _HitEffectColor("Hit Effect Color", Color) = (1,1,1,1) //46 + _HitEffectGlow("Glow Intensity", Range(1,100)) = 5 //47 + [Space] + _HitEffectBlend("Hit Effect Blend", Range(0,1)) = 1 //48 + + _NegativeAmount("Negative Amount", Range(0, 1)) = 1 //49 + + _PixelateSize("Pixelate size", Range(4,512)) = 32 //50 + + [NoScaleOffset] _ColorRampTex("Color ramp Texture", 2D) = "white" {} //51 + _ColorRampLuminosity("Color ramp luminosity", Range(-1,1)) = 0 //52 + [Toggle()] _ColorRampOutline("Affects everything?", float) = 0 //53 + + _GreyscaleLuminosity("Greyscale luminosity", Range(-1,1)) = 0 //54 + [Toggle()] _GreyscaleOutline("Affects everything?", float) = 0 //55 + _GreyscaleTintColor("Greyscale Tint Color", Color) = (1,1,1,1) //56 + + _PosterizeNumColors("Number of Colors", Range(0,100)) = 8 //57 + _PosterizeGamma("Posterize Amount", Range(0.1,10)) = 0.75 //58 + [Toggle()] _PosterizeOutline("Affects everything?", float) = 0 //59 + + _BlurIntensity("Blur Intensity", Range(0,100)) = 10 //60 + [Toggle()] _BlurHD("Blur is Low Res?", float) = 0 //61 + + _MotionBlurAngle("Motion Blur Angle", Range(-1, 1)) = 0.1 //62 + _MotionBlurDist("Motion Blur Distance", Range(-3, 3)) = 1.25 //63 + + _GhostColorBoost("Ghost Color Boost", Range(0,5)) = 1 //64 + _GhostTransparency("Ghost Transparency", Range(0,1)) = 0 //65 + + _InnerOutlineColor("Inner Outline Color", Color) = (1,0,0,1) //66 + _InnerOutlineThickness("Outline Thickness", Range(0,3)) = 1 //67 + _InnerOutlineAlpha("Inner Outline Alpha", Range(0,1)) = 1 //68 + _InnerOutlineGlow("Inner Outline Glow", Range(1,250)) = 4 //69 + + _AlphaCutoffValue("Alpha cutoff value", Range(0, 1)) = 0.25 //70 + + [Toggle()] _OnlyOutline("Only render outline?", float) = 0 //71 + [Toggle()] _OnlyInnerOutline("Only render inner outline?", float) = 0 //72 + + _HologramStripesAmount("Stripes Amount", Range(0, 1)) = 0.1 //73 + _HologramUnmodAmount("Unchanged Amount", Range(0, 1)) = 0.0 //74 + _HologramStripesSpeed("Stripes Speed", Range(-20, 20)) = 4.5 //75 + _HologramMinAlpha("Min Alpha", Range(0, 1)) = 0.1 //76 + _HologramMaxAlpha("Max Alpha", Range(0, 100)) = 0.75 //77 + + _ChromAberrAmount("ChromAberr Amount", Range(0, 1)) = 1 //78 + _ChromAberrAlpha("ChromAberr Alpha", Range(0, 1)) = 0.4 //79 + + _GlitchAmount("Glitch Amount", Range(0, 20)) = 3 //80 + + _FlickerPercent("Flicker Percent", Range(0, 1)) = 0.05 //81 + _FlickerFreq("Flicker Frequency", Range(0, 5)) = 0.2 //82 + _FlickerAlpha("Flicker Alpha", Range(0, 1)) = 0 //83 + + _ShadowX("Shadow X Axis", Range(-0.5, 0.5)) = 0.1 //84 + _ShadowY("Shadow Y Axis", Range(-0.5, 0.5)) = -0.05 //85 + _ShadowAlpha("Shadow Alpha", Range(0, 1)) = 0.5 //86 + _ShadowColor("Shadow Color", Color) = (0, 0, 0, 1) //87 + + _HandDrawnAmount("Hand Drawn Amount", Range(0, 20)) = 10 //88 + _HandDrawnSpeed("Hand Drawn Speed", Range(1, 15)) = 5 //89 + + _GrassSpeed("Speed", Range(0,50)) = 2 //90 + _GrassWind("Bend amount", Range(0,50)) = 20 //91 + [Space] + [Toggle()] _GrassManualToggle("Manually animated?", float) = 0 //92 + _GrassManualAnim("Manual Anim Value", Range(-1,1)) = 1 //93 + + _WaveAmount("Wave Amount", Range(0, 25)) = 7 //94 + _WaveSpeed("Wave Speed", Range(0, 25)) = 10 //95 + _WaveStrength("Wave Strength", Range(0, 25)) = 7.5 //96 + _WaveX("Wave X Axis", Range(0, 1)) = 0 //97 + _WaveY("Wave Y Axis", Range(0, 1)) = 0.5 //98 + + _RectSize("Rect Size", Range(1, 4)) = 1 //99 + + _OffsetUvX("X axis", Range(-1, 1)) = 0 //100 + _OffsetUvY("Y axis", Range(-1, 1)) = 0 //101 + + _ClipUvLeft("Clipping Left", Range(0, 1)) = 0 //102 + _ClipUvRight("Clipping Right", Range(0, 1)) = 0 //103 + _ClipUvUp("Clipping Up", Range(0, 1)) = 0 //104 + _ClipUvDown("Clipping Down", Range(0, 1)) = 0 //105 + + _TextureScrollXSpeed("Speed X Axis", Range(-5, 5)) = 1 //106 + _TextureScrollYSpeed("Speed Y Axis", Range(-5, 5)) = 0 //107 + + _ZoomUvAmount("Zoom Amount", Range(0.1, 5)) = 0.5 //108 + + _DistortTex("Distortion Texture", 2D) = "white" {} //109 + _DistortAmount("Distortion Amount", Range(0,2)) = 0.5 //110 + _DistortTexXSpeed("Scroll speed X", Range(-50,50)) = 5 //111 + _DistortTexYSpeed("Scroll speed Y", Range(-50,50)) = 5 //112 + + _TwistUvAmount("Twist Amount", Range(0, 3.1416)) = 1 //113 + _TwistUvPosX("Twist Pos X Axis", Range(0, 1)) = 0.5 //114 + _TwistUvPosY("Twist Pos Y Axis", Range(0, 1)) = 0.5 //115 + _TwistUvRadius("Twist Radius", Range(0, 3)) = 0.75 //116 + + _RotateUvAmount("Rotate Angle(radians)", Range(0, 6.2831)) = 0 //117 + + _FishEyeUvAmount("Fish Eye Amount", Range(0, 0.5)) = 0.35 //118 + + _PinchUvAmount("Pinch Amount", Range(0, 0.5)) = 0.35 //119 + + _ShakeUvSpeed("Shake Speed", Range(0, 20)) = 2.5 //120 + _ShakeUvX("X Multiplier", Range(0, 5)) = 1.5 //121 + _ShakeUvY("Y Multiplier", Range(0, 5)) = 1 //122 + + _ColorChangeTolerance("Tolerance", Range(0, 1)) = 0.25 //123 + _ColorChangeTarget("Color to change", Color) = (1, 0, 0, 1) //124 + [HDR] _ColorChangeNewCol("New Color", Color) = (1, 1, 0, 1) //125 + _ColorChangeLuminosity("New Color Luminosity", Range(0, 1)) = 0.0 //126 + + _RoundWaveStrength("Wave Strength", Range(0, 1)) = 0.7 //127 + _RoundWaveSpeed("Wave Speed", Range(0, 5)) = 2 //128 + + [Toggle()] _BillboardY("Billboard on both axis?", float) = 0 //129 + _ZWrite ("Depth Write", Float) = 1.0 // 130 + + _MySrcMode ("SrcMode", Float) = 5 // 131 + _MyDstMode ("DstMode", Float) = 10 // 132 + + _ShineColor("Shine Color", Color) = (1,1,1,1) // 133 + _ShineLocation("Shine Location", Range(0,1)) = 0.5 // 134 + _ShineRotate("Rotate Angle(radians)", Range(0, 6.2831)) = 0 //135 + _ShineWidth("Shine Width", Range(0.05,1)) = 0.1 // 136 + _ShineGlow("Shine Glow", Range(0,100)) = 1 // 137 + [NoScaleOffset] _ShineMask("Shine Mask", 2D) = "white" {} // 138 + + _GlitchSize("Glitch Size", Range(0.25, 5)) = 1 //139 + _HologramStripeColor("Stripes Color", Color) = (0,1,1,1) //140 + _GradBoostX("Boost X axis", Range(0.1, 5)) = 1.2 //141 + _GradBoostY("Boost Y axis", Range(0.1, 5)) = 1.2 //142 + [Toggle()] _GradIsRadial("Radial Gradient?", float) = 0 //143 + _AlphaRoundThreshold("Round Threshold", Range(0.005, 1.0)) = 0.5 //144 + _GrassRadialBend("Radial Bend", Range(0.0, 5.0)) = 0.1 //145 + + _ColorChangeTolerance2("Tolerance 2", Range(0, 1)) = 0.25 //146 + _ColorChangeTarget2("Color to change 2", Color) = (1, 0, 0, 1) //147 + [HDR] _ColorChangeNewCol2("New Color 2", Color) = (1, 1, 0, 1) //148 + _ColorChangeTolerance3("Tolerance 3", Range(0, 1)) = 0.25 //149 + _ColorChangeTarget3("Color to change 3", Color) = (1, 0, 0, 1) //150 + [HDR] _ColorChangeNewCol3("New Color 3", Color) = (1, 1, 0, 1) //151 + + _Contrast ("Contrast", Range(0, 6)) = 1 // 152 + _Brightness ("Brightness", Range(-1, 1)) = 0 // 153 + + _ColorSwapBlend ("Color Swap Blend", Range(0, 1)) = 1 // 154 + _ColorRampBlend ("Color Ramp Blend", Range(0, 1)) = 1 // 155 + _GreyscaleBlend ("Greyscale Blend", Range(0, 1)) = 1 // 156 + _GhostBlend ("Ghost Blend", Range(0, 1)) = 1 // 157 + _HologramBlend ("Hologram Blend", Range(0, 1)) = 1 // 158 + + [AllIn1ShaderGradient] _ColorRampTexGradient("Color ramp Gradient", 2D) = "white" {} //159 + + _OverlayTex("Overlay Texture", 2D) = "white" {} //160 + _OverlayColor("Overlay Color", Color) = (1, 1, 1, 1) //161 + _OverlayGlow("Overlay Glow", Range(0,25)) = 1 // 162 + _OverlayBlend("Overlay Blend", Range(0, 1)) = 1 // 163 + + _RadialStartAngle("Radial Start Angle", Range(0, 360)) = 90 //164 + _RadialClip("Radial Clip", Range(0, 360)) = 45 //165 + _RadialClip2("Radial Clip 2", Range(0, 360)) = 0 //166 + + _WarpStrength("Warp Strength", Range(0, 0.1)) = 0.025 //167 + _WarpSpeed("Warp Speed", Range(0, 25)) = 8 //168 + _WarpScale("Warp Scale", Range(0.05, 3)) = 0.5 //169 + + _OverlayTextureScrollXSpeed("Speed X Axis", Range(-5, 5)) = 0.25 //170 + _OverlayTextureScrollYSpeed("Speed Y Axis", Range(-5, 5)) = 0.25 //171 + + _ZTestMode ("Z Test Mode", Float) = 4 + _CullingOption ("Culling Option", float) = 0 + + [HideInInspector] _MinXUV("_MinXUV", Range(0, 1)) = 0.0 + [HideInInspector] _MaxXUV("_MaxXUV", Range(0, 1)) = 1.0 + [HideInInspector] _MinYUV("_MinYUV", Range(0, 1)) = 0.0 + [HideInInspector] _MaxYUV("_MaxYUV", Range(0, 1)) = 1.0 + [HideInInspector] _RandomSeed("_MaxYUV", Range(0, 10000)) = 0.0 + _EditorDrawers("Editor Drawers", Int) = 6 + + [Normal][NoScaleOffset] _NormalMap("Normal Map", 2D) = "bump" {} + _NormalStrength("Normal Strength", Range(0, 15)) = 1.0 + + + } + SubShader + { + Tags { "RenderPipeline"="UniversalPipeline" "RenderType" = "Opaque" "Queue" = "Geometry" } + + + + Pass + { + Name "Universal Forward" + Tags + { + "LightMode" = "UniversalForward" + } + Blend One Zero, One Zero +Cull Back +ZTest LEqual +ZWrite On + + Tags { "RenderType" = "Opaque" "Queue" = "Geometry" "PreviewType" = "Plane" } + Cull [_CullingOption] + ZWrite [_ZWrite] + ZTest [_ZTestMode] + + + HLSLPROGRAM + + #pragma vertex Vert + #pragma fragment Frag + + #pragma target 3.0 + + #pragma prefer_hlslcc gles + #pragma exclude_renderers d3d11_9x + #pragma multi_compile_fog + #pragma multi_compile_instancing + + // Keywords + #pragma multi_compile _ LIGHTMAP_ON + #pragma multi_compile _ DIRLIGHTMAP_COMBINED + #pragma multi_compile _ _MAIN_LIGHT_SHADOWS + #pragma multi_compile _ _MAIN_LIGHT_SHADOWS_CASCADE + #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 + + // GraphKeywords: + + + #define VARYINGS_NEED_FOG_AND_VERTEX_LIGHT + #define SHADER_PASS SHADERPASS_FORWARD + #define SHADERPASS_FORWARD + + #define _PASSFORWARD 1 + + + #pragma shader_feature_local GLOW_ON + #pragma shader_feature_local FADE_ON + #pragma shader_feature_local OUTBASE_ON + #pragma shader_feature_local ONLYOUTLINE_ON + #pragma shader_feature_local GRADIENT_ON + #pragma shader_feature_local GRADIENT2COL_ON + #pragma shader_feature_local RADIALGRADIENT_ON + #pragma shader_feature_local COLORSWAP_ON + #pragma shader_feature_local HSV_ON + #pragma shader_feature_local CHANGECOLOR_ON + #pragma shader_feature_local CHANGECOLOR2_ON + #pragma shader_feature_local CHANGECOLOR3_ON + #pragma shader_feature_local COLORRAMP_ON + #pragma shader_feature_local GRADIENTCOLORRAMP_ON + #pragma shader_feature_local HITEFFECT_ON + #pragma shader_feature_local NEGATIVE_ON + #pragma shader_feature_local PIXELATE_ON + #pragma shader_feature_local GREYSCALE_ON + #pragma shader_feature_local POSTERIZE_ON + #pragma shader_feature_local BLUR_ON + #pragma shader_feature_local MOTIONBLUR_ON + #pragma shader_feature_local GHOST_ON + #pragma shader_feature_local ALPHAOUTLINE_ON + #pragma shader_feature_local INNEROUTLINE_ON + #pragma shader_feature_local ONLYINNEROUTLINE_ON + #pragma shader_feature_local HOLOGRAM_ON + #pragma shader_feature_local CHROMABERR_ON + #pragma shader_feature_local GLITCH_ON + #pragma shader_feature_local FLICKER_ON + #pragma shader_feature_local SHADOW_ON + #pragma shader_feature_local SHINE_ON + #pragma shader_feature_local CONTRAST_ON + #pragma shader_feature_local OVERLAY_ON + #pragma shader_feature_local OVERLAYMULT_ON + #pragma shader_feature_local DOODLE_ON + #pragma shader_feature_local WIND_ON + #pragma shader_feature_local WAVEUV_ON + #pragma shader_feature_local ROUNDWAVEUV_ON + #pragma shader_feature_local RECTSIZE_ON + #pragma shader_feature_local OFFSETUV_ON + #pragma shader_feature_local CLIPPING_ON + #pragma shader_feature_local RADIALCLIPPING_ON + #pragma shader_feature_local TEXTURESCROLL_ON + #pragma shader_feature_local ZOOMUV_ON + #pragma shader_feature_local DISTORT_ON + #pragma shader_feature_local WARP_ON + #pragma shader_feature_local TWISTUV_ON + #pragma shader_feature_local ROTATEUV_ON + #pragma shader_feature_local POLARUV_ON + #pragma shader_feature_local FISHEYE_ON + #pragma shader_feature_local PINCH_ON + #pragma shader_feature_local SHAKEUV_ON + + #pragma shader_feature_local GLOWTEX_ON + #pragma shader_feature_local OUTTEX_ON + #pragma shader_feature_local OUTDIST_ON + #pragma shader_feature_local OUTBASE8DIR_ON + #pragma shader_feature_local OUTBASEPIXELPERF_ON + #pragma shader_feature_local COLORRAMPOUTLINE_ON + #pragma shader_feature_local GREYSCALEOUTLINE_ON + #pragma shader_feature_local POSTERIZEOUTLINE_ON + #pragma shader_feature_local BLURISHD_ON + #pragma shader_feature_local MANUALWIND_ON + #pragma shader_feature_local ATLAS_ON + #pragma shader_feature_local PREMULTIPLYALPHA_ON + + #pragma shader_feature BILBOARD_ON + #pragma shader_feature BILBOARDY_ON + + #pragma shader_feature NORMALMAP_ON + + + #define _URP 1 +#define _USINGTEXCOORD1 1 +#define _USINGTEXCOORD2 1 + + + // this has to be here or specular color will be ignored. Not in SG code + #if _SIMPLELIT + #define _SPECULAR_COLOR + #endif + + + // Includes + #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Version.hlsl" + #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Color.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.universal/ShaderLibrary/Shadows.hlsl" + #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/ShaderGraphFunctions.hlsl" + #include "Packages/com.unity.shadergraph/ShaderGraphLibrary/ShaderVariablesFunctions.hlsl" + + + #undef WorldNormalVector + #define WorldNormalVector(data, normal) mul(normal, data.TBNMatrix) + + #define UnityObjectToWorldNormal(normal) mul(GetObjectToWorldMatrix(), normal) + + #define _WorldSpaceLightPos0 _MainLightPosition + + #define UNITY_DECLARE_TEX2D(name) TEXTURE2D(name); SAMPLER(sampler##name); + #define UNITY_DECLARE_TEX2D_NOSAMPLER(name) TEXTURE2D(name); + #define UNITY_DECLARE_TEX2DARRAY(name) TEXTURE2D_ARRAY(name); SAMPLER(sampler##name); + #define UNITY_DECLARE_TEX2DARRAY_NOSAMPLER(name) TEXTURE2D_ARRAY(name); + + #define UNITY_SAMPLE_TEX2DARRAY(tex,coord) SAMPLE_TEXTURE2D_ARRAY(tex, sampler##tex, coord.xy, coord.z) + #define UNITY_SAMPLE_TEX2DARRAY_LOD(tex,coord,lod) SAMPLE_TEXTURE2D_ARRAY_LOD(tex, sampler##tex, coord.xy, coord.z, lod) + #define UNITY_SAMPLE_TEX2D(tex, coord) SAMPLE_TEXTURE2D(tex, sampler##tex, coord) + #define UNITY_SAMPLE_TEX2D_SAMPLER(tex, samp, coord) SAMPLE_TEXTURE2D(tex, sampler##samp, coord) + + #define UNITY_SAMPLE_TEX2D_LOD(tex,coord, lod) SAMPLE_TEXTURE2D_LOD(tex, sampler_##tex, coord, lod) + #define UNITY_SAMPLE_TEX2D_SAMPLER_LOD(tex,samplertex,coord, lod) SAMPLE_TEXTURE2D_LOD (tex, sampler##samplertex,coord, lod) + + #if defined(UNITY_COMPILER_HLSL) + #define UNITY_INITIALIZE_OUTPUT(type,name) name = (type)0; + #else + #define UNITY_INITIALIZE_OUTPUT(type,name) + #endif + + #define sampler2D_float sampler2D + #define sampler2D_half sampler2D + + + + // data across stages, stripped like the above. + struct VertexToPixel + { + float4 pos : SV_POSITION; + float3 worldPos : TEXCOORD0; + float3 worldNormal : TEXCOORD1; + float4 worldTangent : TEXCOORD2; + float4 texcoord0 : TEXCOORD3; + float4 texcoord1 : TEXCOORD4; + float4 texcoord2 : TEXCOORD5; + + // #if %TEXCOORD3REQUIREKEY% + float4 texcoord3 : TEXCOORD6; + // #endif + + // #if %SCREENPOSREQUIREKEY% + // float4 screenPos : TEXCOORD7; + // #endif + + // #if %VERTEXCOLORREQUIREKEY% + half4 vertexColor : COLOR; + // #endif + + // #if %EXTRAV2F0REQUIREKEY% + // float4 extraV2F0 : TEXCOORD12; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // float4 extraV2F1 : TEXCOORD13; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // float4 extraV2F2 : TEXCOORD14; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // float4 extraV2F3 : TEXCOORD15; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // float4 extraV2F4 : TEXCOORD16; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // float4 extraV2F5 : TEXCOORD17; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // float4 extraV2F6 : TEXCOORD18; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // float4 extraV2F7 : TEXCOORD19; + // #endif + + #if defined(LIGHTMAP_ON) + float2 lightmapUV : TEXCOORD8; + #endif + #if !defined(LIGHTMAP_ON) + float3 sh : TEXCOORD9; + #endif + float4 fogFactorAndVertexLight : TEXCOORD10; + float4 shadowCoord : TEXCOORD11; + #if UNITY_ANY_INSTANCING_ENABLED + uint instanceID : CUSTOM_INSTANCE_ID; + #endif + #if (defined(UNITY_STEREO_INSTANCING_ENABLED)) + uint stereoTargetEyeIndexAsRTArrayIdx : SV_RenderTargetArrayIndex; + #endif + #if (defined(UNITY_STEREO_MULTIVIEW_ENABLED)) || (defined(UNITY_STEREO_INSTANCING_ENABLED) && (defined(SHADER_API_GLES3) || defined(SHADER_API_GLCORE))) + uint stereoTargetEyeIndexAsBlendIdx0 : BLENDINDICES0; + #endif + #if defined(SHADER_STAGE_FRAGMENT) && defined(VARYINGS_NEED_CULLFACE) + FRONT_FACE_TYPE cullFace : FRONT_FACE_SEMANTIC; + #endif + }; + + + + + // data describing the user output of a pixel + struct Surface + { + half3 Albedo; + half Height; + half3 Normal; + half Smoothness; + half3 Emission; + half Metallic; + half3 Specular; + half Occlusion; + half SpecularPower; // for simple lighting + half Alpha; + float outputDepth; // if written, SV_Depth semantic is used. ShaderData.clipPos.z is unused value + // HDRP Only + half SpecularOcclusion; + half SubsurfaceMask; + half Thickness; + half CoatMask; + half CoatSmoothness; + half Anisotropy; + half IridescenceMask; + half IridescenceThickness; + int DiffusionProfileHash; + float SpecularAAThreshold; + float SpecularAAScreenSpaceVariance; + // requires _OVERRIDE_BAKEDGI to be defined, but is mapped in all pipelines + float3 DiffuseGI; + float3 BackDiffuseGI; + float3 SpecularGI; + float ior; + float3 transmittanceColor; + float atDistance; + float transmittanceMask; + // requires _OVERRIDE_SHADOWMASK to be defines + float4 ShadowMask; + + // for decals + float NormalAlpha; + float MAOSAlpha; + + + }; + + // Data the user declares in blackboard blocks + struct Blackboard + { + + float blackboardDummyData; + }; + + // data the user might need, this will grow to be big. But easy to strip + struct ShaderData + { + float4 clipPos; // SV_POSITION + float3 localSpacePosition; + float3 localSpaceNormal; + float3 localSpaceTangent; + + float3 worldSpacePosition; + float3 worldSpaceNormal; + float3 worldSpaceTangent; + float tangentSign; + + float3 worldSpaceViewDir; + float3 tangentSpaceViewDir; + + float4 texcoord0; + float4 texcoord1; + float4 texcoord2; + float4 texcoord3; + + float2 screenUV; + float4 screenPos; + + float4 vertexColor; + bool isFrontFace; + + float4 extraV2F0; + float4 extraV2F1; + float4 extraV2F2; + float4 extraV2F3; + float4 extraV2F4; + float4 extraV2F5; + float4 extraV2F6; + float4 extraV2F7; + + float3x3 TBNMatrix; + Blackboard blackboard; + }; + + struct VertexData + { + #if SHADER_TARGET > 30 + // uint vertexID : SV_VertexID; + #endif + float4 vertex : POSITION; + float3 normal : NORMAL; + float4 tangent : TANGENT; + float4 texcoord0 : TEXCOORD0; + + // optimize out mesh coords when not in use by user or lighting system + #if _URP && (_USINGTEXCOORD1 || _PASSMETA || _PASSFORWARD || _PASSGBUFFER) + float4 texcoord1 : TEXCOORD1; + #endif + + #if _URP && (_USINGTEXCOORD2 || _PASSMETA || ((_PASSFORWARD || _PASSGBUFFER) && defined(DYNAMICLIGHTMAP_ON))) + float4 texcoord2 : TEXCOORD2; + #endif + + #if _STANDARD && (_USINGTEXCOORD1 || (_PASSMETA || ((_PASSFORWARD || _PASSGBUFFER || _PASSFORWARDADD) && LIGHTMAP_ON))) + float4 texcoord1 : TEXCOORD1; + #endif + #if _STANDARD && (_USINGTEXCOORD2 || (_PASSMETA || ((_PASSFORWARD || _PASSGBUFFER) && DYNAMICLIGHTMAP_ON))) + float4 texcoord2 : TEXCOORD2; + #endif + + + #if _HDRP + float4 texcoord1 : TEXCOORD1; + float4 texcoord2 : TEXCOORD2; + #endif + + // #if %TEXCOORD3REQUIREKEY% + float4 texcoord3 : TEXCOORD3; + // #endif + + // #if %VERTEXCOLORREQUIREKEY% + float4 vertexColor : COLOR; + // #endif + + #if _PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR)) + float3 previousPositionOS : TEXCOORD4; // Contain previous transform position (in case of skinning for example) + #if defined (_ADD_PRECOMPUTED_VELOCITY) + float3 precomputedVelocity : TEXCOORD5; // Add Precomputed Velocity (Alembic computes velocities on runtime side). + #endif + #endif + + UNITY_VERTEX_INPUT_INSTANCE_ID + }; + + struct TessVertex + { + float4 vertex : INTERNALTESSPOS; + float3 normal : NORMAL; + float4 tangent : TANGENT; + float4 texcoord0 : TEXCOORD0; + float4 texcoord1 : TEXCOORD1; + float4 texcoord2 : TEXCOORD2; + + // #if %TEXCOORD3REQUIREKEY% + float4 texcoord3 : TEXCOORD3; + // #endif + + // #if %VERTEXCOLORREQUIREKEY% + float4 vertexColor : COLOR; + // #endif + + // #if %EXTRAV2F0REQUIREKEY% + // float4 extraV2F0 : TEXCOORD5; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // float4 extraV2F1 : TEXCOORD6; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // float4 extraV2F2 : TEXCOORD7; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // float4 extraV2F3 : TEXCOORD8; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // float4 extraV2F4 : TEXCOORD9; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // float4 extraV2F5 : TEXCOORD10; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // float4 extraV2F6 : TEXCOORD11; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // float4 extraV2F7 : TEXCOORD12; + // #endif + + #if _PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR)) + float3 previousPositionOS : TEXCOORD13; // Contain previous transform position (in case of skinning for example) + #if defined (_ADD_PRECOMPUTED_VELOCITY) + float3 precomputedVelocity : TEXCOORD14; + #endif + #endif + + UNITY_VERTEX_INPUT_INSTANCE_ID + UNITY_VERTEX_OUTPUT_STEREO + }; + + struct ExtraV2F + { + float4 extraV2F0; + float4 extraV2F1; + float4 extraV2F2; + float4 extraV2F3; + float4 extraV2F4; + float4 extraV2F5; + float4 extraV2F6; + float4 extraV2F7; + Blackboard blackboard; + float4 time; + }; + + + float3 WorldToTangentSpace(ShaderData d, float3 normal) + { + return mul(d.TBNMatrix, normal); + } + + float3 TangentToWorldSpace(ShaderData d, float3 normal) + { + return mul(normal, d.TBNMatrix); + } + + // in this case, make standard more like SRPs, because we can't fix + // unity_WorldToObject in HDRP, since it already does macro-fu there + + #if _STANDARD + float3 TransformWorldToObject(float3 p) { return mul(unity_WorldToObject, float4(p, 1)); }; + float3 TransformObjectToWorld(float3 p) { return mul(unity_ObjectToWorld, float4(p, 1)); }; + float4 TransformWorldToObject(float4 p) { return mul(unity_WorldToObject, p); }; + float4 TransformObjectToWorld(float4 p) { return mul(unity_ObjectToWorld, p); }; + float4x4 GetWorldToObjectMatrix() { return unity_WorldToObject; } + float4x4 GetObjectToWorldMatrix() { return unity_ObjectToWorld; } + #if (defined(SHADER_API_D3D11) || defined(SHADER_API_XBOXONE) || defined(UNITY_COMPILER_HLSLCC) || defined(SHADER_API_PSSL) || (SHADER_TARGET_SURFACE_ANALYSIS && !SHADER_TARGET_SURFACE_ANALYSIS_MOJOSHADER)) + #define UNITY_SAMPLE_TEX2D_LOD(tex,coord, lod) tex.SampleLevel (sampler##tex,coord, lod) + #define UNITY_SAMPLE_TEX2D_SAMPLER_LOD(tex,samplertex,coord, lod) tex.SampleLevel (sampler##samplertex,coord, lod) + #else + #define UNITY_SAMPLE_TEX2D_LOD(tex,coord,lod) tex2D (tex,coord,0,lod) + #define UNITY_SAMPLE_TEX2D_SAMPLER_LOD(tex,samplertex,coord,lod) tex2D (tex,coord,0,lod) + #endif + + #undef GetWorldToObjectMatrix() + + #define GetWorldToObjectMatrix() unity_WorldToObject + + + #endif + + float3 GetCameraWorldPosition() + { + #if _HDRP + return GetCameraRelativePositionWS(_WorldSpaceCameraPos); + #else + return _WorldSpaceCameraPos; + #endif + } + + #if _GRABPASSUSED + #if _STANDARD + TEXTURE2D(%GRABTEXTURE%); + SAMPLER(sampler_%GRABTEXTURE%); + #endif + + half3 GetSceneColor(float2 uv) + { + #if _STANDARD + return SAMPLE_TEXTURE2D(%GRABTEXTURE%, sampler_%GRABTEXTURE%, uv).rgb; + #else + return SHADERGRAPH_SAMPLE_SCENE_COLOR(uv); + #endif + } + #endif + + + + #if _STANDARD + UNITY_DECLARE_DEPTH_TEXTURE(_CameraDepthTexture); + float GetSceneDepth(float2 uv) { return SAMPLE_DEPTH_TEXTURE(_CameraDepthTexture, uv); } + float GetLinear01Depth(float2 uv) { return Linear01Depth(GetSceneDepth(uv)); } + float GetLinearEyeDepth(float2 uv) { return LinearEyeDepth(GetSceneDepth(uv)); } + #else + float GetSceneDepth(float2 uv) { return SHADERGRAPH_SAMPLE_SCENE_DEPTH(uv); } + float GetLinear01Depth(float2 uv) { return Linear01Depth(GetSceneDepth(uv), _ZBufferParams); } + float GetLinearEyeDepth(float2 uv) { return LinearEyeDepth(GetSceneDepth(uv), _ZBufferParams); } + #endif + + float3 GetWorldPositionFromDepthBuffer(float2 uv, float3 worldSpaceViewDir) + { + float eye = GetLinearEyeDepth(uv); + float3 camView = mul((float3x3)GetObjectToWorldMatrix(), transpose(mul(GetWorldToObjectMatrix(), UNITY_MATRIX_I_V)) [2].xyz); + + float dt = dot(worldSpaceViewDir, camView); + float3 div = worldSpaceViewDir/dt; + float3 wpos = (eye * div) + GetCameraWorldPosition(); + return wpos; + } + + #if _HDRP + float3 ObjectToWorldSpacePosition(float3 pos) + { + return GetAbsolutePositionWS(TransformObjectToWorld(pos)); + } + #else + float3 ObjectToWorldSpacePosition(float3 pos) + { + return TransformObjectToWorld(pos); + } + #endif + + #if _STANDARD + UNITY_DECLARE_SCREENSPACE_TEXTURE(_CameraDepthNormalsTexture); + float3 GetSceneNormal(float2 uv, float3 worldSpaceViewDir) + { + float4 depthNorms = UNITY_SAMPLE_SCREENSPACE_TEXTURE(_CameraDepthNormalsTexture, uv); + float3 norms = DecodeViewNormalStereo(depthNorms); + norms = mul((float3x3)GetWorldToViewMatrix(), norms) * 0.5 + 0.5; + return norms; + } + #elif _HDRP && !_DECALSHADER + + float3 GetSceneNormal(float2 uv, float3 worldSpaceViewDir) + { + NormalData nd; + DecodeFromNormalBuffer(_ScreenSize.xy * uv, nd); + return nd.normalWS; + } + #elif _URP + #if (SHADER_LIBRARY_VERSION_MAJOR >= 10) + #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/DeclareNormalsTexture.hlsl" + #endif + + float3 GetSceneNormal(float2 uv, float3 worldSpaceViewDir) + { + #if (SHADER_LIBRARY_VERSION_MAJOR >= 10) + return SampleSceneNormals(uv); + #else + float3 wpos = GetWorldPositionFromDepthBuffer(uv, worldSpaceViewDir); + return normalize(-cross(ddx(wpos), ddy(wpos))) * 0.5 + 0.5; + #endif + + } + #endif + + #if _HDRP + + half3 UnpackNormalmapRGorAG(half4 packednormal) + { + // This do the trick + packednormal.x *= packednormal.w; + + half3 normal; + normal.xy = packednormal.xy * 2 - 1; + normal.z = sqrt(1 - saturate(dot(normal.xy, normal.xy))); + return normal; + } + half3 UnpackNormal(half4 packednormal) + { + #if defined(UNITY_NO_DXT5nm) + return packednormal.xyz * 2 - 1; + #else + return UnpackNormalmapRGorAG(packednormal); + #endif + } + #endif + #if _HDRP || _URP + + half3 UnpackScaleNormal(half4 packednormal, half scale) + { + #ifndef UNITY_NO_DXT5nm + // Unpack normal as DXT5nm (1, y, 1, x) or BC5 (x, y, 0, 1) + // Note neutral texture like "bump" is (0, 0, 1, 1) to work with both plain RGB normal and DXT5nm/BC5 + packednormal.x *= packednormal.w; + #endif + half3 normal; + normal.xy = (packednormal.xy * 2 - 1) * scale; + normal.z = sqrt(1 - saturate(dot(normal.xy, normal.xy))); + return normal; + } + + #endif + + + void GetSun(out float3 lightDir, out float3 color) + { + lightDir = float3(0.5, 0.5, 0); + color = 1; + #if _HDRP + if (_DirectionalLightCount > 0) + { + DirectionalLightData light = _DirectionalLightDatas[0]; + lightDir = -light.forward.xyz; + color = light.color; + } + #elif _STANDARD + lightDir = normalize(_WorldSpaceLightPos0.xyz); + color = _LightColor0.rgb; + #elif _URP + Light light = GetMainLight(); + lightDir = light.direction; + color = light.color; + #endif + } + + + + CBUFFER_START(UnityPerMaterial) + + + half4 _Color; + half4 _MainTex_ST, _MainTex_TexelSize; + half _Alpha, _AlphaCutoffValue; + + #if ATLAS_ON + half _MinXUV, _MaxXUV, _MinYUV, _MaxYUV; + #endif + + #if GLOW_ON + half4 _GlowColor; + half _Glow, _GlowGlobal; + #endif + + #if HSV_ON + half _HsvShift, _HsvSaturation, _HsvBright; + #endif + + #if DISTORT_ON + half4 _DistortTex_ST; + half _DistortTexXSpeed, _DistortTexYSpeed, _DistortAmount; + #endif + + #if FADE_ON + half4 _FadeBurnColor, _FadeTex_ST, _FadeBurnTex_ST; + half _FadeAmount, _FadeBurnWidth, _FadeBurnTransition,_FadeBurnGlow; + #endif + + #if OUTBASE_ON + half4 _OutlineColor; + half _OutlineAlpha, _OutlineGlow, _OutlineWidth; + int _OutlinePixelWidth; + #endif + + #if OUTTEX_ON + half4 _OutlineTex_ST; + half _OutlineTexXSpeed, _OutlineTexYSpeed; + #endif + + #if OUTDIST_ON + half4 _OutlineDistortTex_ST; + half _OutlineDistortTexXSpeed, _OutlineDistortTexYSpeed, _OutlineDistortAmount; + #endif + + #if ALPHAOUTLINE_ON + half _AlphaOutlineGlow, _AlphaOutlinePower, _AlphaOutlineMinAlpha, _AlphaOutlineBlend; + half4 _AlphaOutlineColor; + #endif + + #if INNEROUTLINE_ON + half _InnerOutlineThickness, _InnerOutlineAlpha, _InnerOutlineGlow; + half4 _InnerOutlineColor; + #endif + + #if GRADIENT_ON + half _GradBlend, _GradBoostX, _GradBoostY; + half4 _GradTopRightCol, _GradTopLeftCol, _GradBotRightCol, _GradBotLeftCol; + #endif + + #if COLORSWAP_ON + half4 _ColorSwapRed, _ColorSwapGreen, _ColorSwapBlue; + half _ColorSwapRedLuminosity, _ColorSwapGreenLuminosity, _ColorSwapBlueLuminosity, _ColorSwapBlend; + #endif + + #if CHANGECOLOR_ON + half4 _ColorChangeNewCol, _ColorChangeTarget; + half _ColorChangeTolerance, _ColorChangeLuminosity; + #endif + #if CHANGECOLOR2_ON + half4 _ColorChangeNewCol2, _ColorChangeTarget2; + half _ColorChangeTolerance2; + #endif + #if CHANGECOLOR3_ON + half4 _ColorChangeNewCol3, _ColorChangeTarget3; + half _ColorChangeTolerance3; + #endif + + #if COLORRAMP_ON + half _ColorRampLuminosity, _ColorRampBlend; + #endif + + #if HITEFFECT_ON + half4 _HitEffectColor; + half _HitEffectGlow, _HitEffectBlend; + #endif + + #if NEGATIVE_ON + half _NegativeAmount; + #endif + + #if PIXELATE_ON + half _PixelateSize; + #endif + + #if GREYSCALE_ON + half _GreyscaleLuminosity, _GreyscaleBlend; + half4 _GreyscaleTintColor; + #endif + + #if POSTERIZE_ON + half _PosterizeNumColors, _PosterizeGamma; + #endif + + #if BLUR_ON + half _BlurIntensity; + #endif + + #if MOTIONBLUR_ON + half _MotionBlurAngle, _MotionBlurDist; + #endif + + #if GHOST_ON + half _GhostColorBoost, _GhostTransparency, _GhostBlend; + #endif + + #if HOLOGRAM_ON + half _HologramStripesAmount, _HologramMinAlpha, _HologramUnmodAmount, _HologramStripesSpeed, _HologramMaxAlpha, _HologramBlend; + half4 _HologramStripeColor; + #endif + + #if CHROMABERR_ON + half _ChromAberrAmount, _ChromAberrAlpha; + #endif + + #if GLITCH_ON + half _GlitchAmount, _GlitchSize; + #endif + + #if FLICKER_ON + half _FlickerFreq, _FlickerPercent, _FlickerAlpha; + #endif + + #if SHADOW_ON + half _ShadowX, _ShadowY, _ShadowAlpha; + half4 _ShadowColor; + #endif + + #if SHINE_ON + half4 _ShineColor; + half _ShineLocation, _ShineRotate, _ShineWidth, _ShineGlow; + #endif + + #if CONTRAST_ON + half _Contrast, _Brightness; + #endif + + #if OVERLAY_ON + half4 _OverlayTex_ST, _OverlayColor; + half _OverlayGlow, _OverlayBlend, _OverlayTextureScrollXSpeed, _OverlayTextureScrollYSpeed; + #endif + + #if DOODLE_ON + half _HandDrawnAmount, _HandDrawnSpeed; + #endif + + #if WIND_ON + half _GrassSpeed, _GrassWind, _GrassManualAnim, _GrassRadialBend; + #endif + + #if WAVEUV_ON + float _WaveAmount, _WaveSpeed, _WaveStrength, _WaveX, _WaveY; + #endif + + #if ROUNDWAVEUV_ON + half _RoundWaveStrength, _RoundWaveSpeed; + #endif + + #if RECTSIZE_ON + half _RectSize; + #endif + + #if OFFSETUV_ON + half _OffsetUvX, _OffsetUvY; + #endif + + #if CLIPPING_ON + half _ClipUvLeft, _ClipUvRight, _ClipUvUp, _ClipUvDown; + #endif + + #if RADIALCLIPPING_ON + half _RadialStartAngle, _RadialClip, _RadialClip2; + #endif + + #if TEXTURESCROLL_ON + half _TextureScrollXSpeed, _TextureScrollYSpeed; + #endif + + #if ZOOMUV_ON + half _ZoomUvAmount; + #endif + + #if WARP_ON + half _WarpStrength, _WarpSpeed, _WarpScale; + #endif + + #if TWISTUV_ON + half _TwistUvAmount, _TwistUvPosX, _TwistUvPosY, _TwistUvRadius; + #endif + + #if ROTATEUV_ON + half _RotateUvAmount; + #endif + + #if FISHEYE_ON + half _FishEyeUvAmount; + #endif + + #if PINCH_ON + half _PinchUvAmount; + #endif + + #if SHAKEUV_ON + half _ShakeUvSpeed, _ShakeUvX, _ShakeUvY; + #endif + + #if NORMALMAP_ON + half _NormalStrength; + #endif + + float _RandomSeed; + + + + + CBUFFER_END + + + + + + + + TEXTURE2D(_MainTex); + SAMPLER(sampler_MainTex); + + #if GLOW_ON + TEXTURE2D(_GlowTex); + SAMPLER(sampler_GlowTex); + #endif + + #if FADE_ON + TEXTURE2D(_FadeTex); + SAMPLER(sampler_FadeTex); + + TEXTURE2D(_FadeBurnTex); + SAMPLER(sampler_FadeBurnTex); + #endif + + #if DISTORT_ON + TEXTURE2D(_DistortTex); + SAMPLER(sampler_DistortTex); + #endif + + #if OUTTEX_ON + TEXTURE2D(_OutlineTex); + SAMPLER(sampler_OutlineTex); + #endif + + #if OUTDIST_ON + TEXTURE2D(_OutlineDistortTex); + SAMPLER(sampler_OutlineDistortTex); + #endif + + #if COLORSWAP_ON + TEXTURE2D(_ColorSwapTex); + SAMPLER(sampler_ColorSwapTex); + #endif + + #if COLORRAMP_ON + TEXTURE2D(_ColorRampTex); + TEXTURE2D(_ColorRampTexGradient); + SAMPLER(sampler_ColorRampTex); + SAMPLER(sampler_ColorRampTexGradient); + #endif + + #if SHINE_ON + TEXTURE2D(_ShineMask); + SAMPLER(sampler_ShineMask); + #endif + + #if OVERLAY_ON + TEXTURE2D(_OverlayTex); + SAMPLER(sampler_OverlayTex); + #endif + + #if NORMALMAP_ON + TEXTURE2D(_NormalMap); + SAMPLER(sampler_NormalMap); + #endif + + + half3 GetPixel(in int offsetX, in int offsetY, in half2 uv, in Texture2D _tex, in SamplerState _sampler) + { + half2 _uv = uv + half2(offsetX * _MainTex_TexelSize.x, offsetY * _MainTex_TexelSize.y); + half4 col = SAMPLE_TEXTURE2D(_tex, _sampler, _uv); + return col.rgb; + } + + + //BLURS------------------------------------------------------------------------- + half4 Blur(half2 uv, Texture2D source, SamplerState sampler_source, half Intensity) + { + const half2 texelSize = 1.0 / _ScreenParams.xy; + const half4 color = SAMPLE_TEXTURE2D(source, sampler_source, uv); + const half2 offset = Intensity * texelSize; + + half4 accumulatedColor = color; + half accumulatedWeight = 1.0; + for (int x = -1; x <= 1; x++) + { + for (int y = -1; y <= 1; y++) + { + const half2 sampleUV = uv + half2(x, y) * offset; + const half4 sampleColor = SAMPLE_TEXTURE2D(source, sampler_source, sampleUV); + + accumulatedColor += sampleColor; + accumulatedWeight += 1.0; + } + } + + half4 blurredColor = accumulatedColor / accumulatedWeight; + return blurredColor; + } + + half BlurHD_G(half bhqp, half x) + { + return exp(-(x * x) / (2.0 * bhqp * bhqp)); + } + half4 BlurHD(half2 uv, Texture2D source, SamplerState sampler_source, half BlurAmount, half xScale, half yScale) + { + int iterations = 16; + int halfIterations = iterations / 2; + half sigmaX = 0.1 + BlurAmount * 0.5; + half sigmaY = sigmaX; + half total = 0.0; + half4 ret = half4(0, 0, 0, 0); + for (int iy = 0; iy < iterations; ++iy) + { + half fy = BlurHD_G(sigmaY, half(iy) -half(halfIterations)); + half offsetY = half(iy - halfIterations) * 0.00390625 * xScale; + for (int ix = 0; ix < iterations; ++ix) + { + half fx = BlurHD_G(sigmaX, half(ix) - half(halfIterations)); + half offsetX = half(ix - halfIterations) * 0.00390625 * yScale; + total += fx * fy; + ret += SAMPLE_TEXTURE2D(source, sampler_source, uv + half2(offsetX, offsetY)) * fx * fy; + } + } + return ret / total; + } + //----------------------------------------------------------------------- + + + //------------------------------------------- + half RemapFloat(half inValue, half inMin, half inMax, half outMin, half outMax){ + return outMin + (inValue - inMin) * (outMax - outMin) / (inMax - inMin); + } + //------------------------------------------- + + //----------------------------------------------------------------------- + half rand(half2 seed, half offset) { + return (frac(sin(dot(seed, half2(12.9898, 78.233))) * 43758.5453) + offset) % 1.0; + } + + half rand2(half2 seed, half offset) { + return (frac(sin(dot(seed * floor(50 + (_Time.x % 1.0) * 12.), half2(127.1, 311.7))) * 43758.5453123) + offset) % 1.0; + } + + half rand2CustomTime(half2 seed, half offset, half customTime) { + return (frac(sin(dot(seed * floor(50 + (customTime % 1.0) * 12.), half2(127.1, 311.7))) * 43758.5453123) + offset) % 1.0; + } + //----------------------------------------------------------------------- + + + void Ext_ModifyVertex0 (inout VertexData v, inout ExtraV2F d) + { + //BILBOARD_ON + #if BILBOARD_ON + half3 camRight = mul((half3x3)unity_CameraToWorld, half3(1,0,0)); + half3 camUp = half3(0,1,0); + #if BILBOARDY_ON + camUp = mul((half3x3)unity_CameraToWorld, half3(0,1,0)); + #endif + half3 localPos = v.vertex.x * camRight + v.vertex.y * camUp; + v.vertex = half4(localPos, 1); + #endif + //----------------------------------------------------------- + + v.texcoord0.xy = TRANSFORM_TEX(v.texcoord0.xy, _MainTex); + half2 center = half2(0.5, 0.5); + #if ATLAS_ON + center = half2((_MaxXUV + _MinXUV) / 2.0, (_MaxYUV + _MinYUV) / 2.0); + #endif + + //POLARUV_ON + #if POLARUV_ON + v.texcoord0.xy = v.texcoord0.xy - center; + #endif + + //---------------------------------------- + + //ROTATEUV_ON + #if ROTATEUV_ON + half2 uvC = v.texcoord0.xy; + half cosAngle = cos(_RotateUvAmount); + half sinAngle = sin(_RotateUvAmount); + half2x2 rot = half2x2(cosAngle, -sinAngle, sinAngle, cosAngle); + uvC -= center; + v.texcoord0.xy = mul(rot, uvC); + v.texcoord0.xy += center; + #endif + //-------------------- + + #if RECTSIZE_ON + v.vertex.xyz += (v.vertex.xyz * (_RectSize - 1.0)); + #endif + + #if OUTTEX_ON + v.texcoord1.xy = TRANSFORM_TEX(v.texcoord0.xy, _OutlineTex); + #endif + + #if OUTDIST_ON + v.texcoord2.xy = TRANSFORM_TEX(v.texcoord0.xy, _OutlineDistortTex); + #endif + + #if DISTORT_ON + v.texcoord3.xy = TRANSFORM_TEX(v.texcoord0.xy, _DistortTex); + #endif + } + + void Ext_SurfaceFunction0 (inout Surface o, ShaderData d) + { + half randomSeed = _RandomSeed; + + float2 uvRect = d.texcoord0; + half2 center = half2(0.5, 0.5); + #if ATLAS_ON + center = half2((_MaxXUV + _MinXUV) / 2.0, (_MaxYUV + _MinYUV) / 2.0); + uvRect = half2((d.texcoord0.x - _MinXUV) / (_MaxXUV - _MinXUV), (d.texcoord0.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half2 centerTiled = half2(center.x * _MainTex_ST.x, center.y * _MainTex_ST.y); + + //CLIPPING_ON + #if CLIPPING_ON + half2 tiledUv = half2(d.texcoord0.x / _MainTex_ST.x, d.texcoord0.y / _MainTex_ST.y); + #if ATLAS_ON + tiledUv = half2((tiledUv.x - _MinXUV) / (_MaxXUV - _MinXUV), (tiledUv.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + clip((1 - _ClipUvUp) - tiledUv.y); + clip(tiledUv.y - _ClipUvDown); + clip((1 - _ClipUvRight) - tiledUv.x); + clip(tiledUv.x - _ClipUvLeft); + #endif + //---------------------------------- + + //RADIALCLIPPING_ON + #if RADIALCLIPPING_ON + half2 tiledUv2 = half2(d.texcoord0.x / _MainTex_ST.x, d.texcoord0.y / _MainTex_ST.y); + #if ATLAS_ON + tiledUv2 = half2((tiledUv2.x - _MinXUV) / (_MaxXUV - _MinXUV), (tiledUv2.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half startAngle = _RadialStartAngle - _RadialClip; + half endAngle = _RadialStartAngle + _RadialClip2; + half offset0 = clamp(0, 360, startAngle + 360); + half offset360 = clamp(0, 360, endAngle - 360); + half2 atan2Coord = half2(lerp(-1, 1, tiledUv2.x), lerp(-1, 1, tiledUv2.y)); + half atanAngle = atan2(atan2Coord.y, atan2Coord.x) * 57.3; // angle in degrees + if(atanAngle < 0) atanAngle = 360 + atanAngle; + if(atanAngle >= startAngle && atanAngle <= endAngle) discard; + if(atanAngle <= offset360) discard; + if(atanAngle >= offset0) discard; + #endif + + //----------------------------- + + //TEXTURESCROLL_ON && ATLAS_ON + #if TEXTURESCROLL_ON && ATLAS_ON + d.texcoord0.xy = half2(_MinXUV + ((_MaxXUV - _MinXUV) * (abs(((_Time.y + randomSeed) * _TextureScrollXSpeed) + uvRect.x) % 1)), + _MinYUV + ((_MaxYUV - _MinYUV) * (abs(((_Time.y + randomSeed) * _TextureScrollYSpeed) + uvRect.y) % 1))); + #endif + //---------------------------- + + //OFFSETUV_ON + #if OFFSETUV_ON + #if ATLAS_ON + d.texcoord0.xy = half2(_MinXUV + ((_MaxXUV - _MinXUV) * (abs((_OffsetUvX + uvRect.x) % 1))), + _MinYUV + ((_MaxYUV - _MinYUV) * (abs(_OffsetUvY + uvRect.y) % 1))); + #else + d.texcoord0.xy += half2(_OffsetUvX, _OffsetUvY); + #endif + #endif + + //---------------------- + + //POLARUV_ON + #if POLARUV_ON + d.texcoord0.xy = half2(atan2(d.texcoord0.y, d.texcoord0.x) / (2.0f * 3.141592653589f), length(d.texcoord0.xy)); + d.texcoord0.xy *= _MainTex_ST.xy; + #endif + + //-------------------------------------- + + //TWISTUV_ON + #if TWISTUV_ON + #if ATLAS_ON + _TwistUvPosX = ((_MaxXUV - _MinXUV) * _TwistUvPosX) + _MinXUV; + _TwistUvPosY = ((_MaxYUV - _MinYUV) * _TwistUvPosY) + _MinYUV; + #endif + half2 tempUv = d.texcoord0.xy - half2(_TwistUvPosX * _MainTex_ST.x, _TwistUvPosY * _MainTex_ST.y); + _TwistUvRadius *= (_MainTex_ST.x + _MainTex_ST.y) / 2; + half percent = (_TwistUvRadius - length(tempUv)) / _TwistUvRadius; + half theta = percent * percent * (2.0 * sin(_TwistUvAmount)) * 8.0; + half s = sin(theta); + half c = cos(theta); + half beta = max(sign(_TwistUvRadius - length(tempUv)), 0.0); + tempUv = half2(dot(tempUv, half2(c, -s)), dot(tempUv, half2(s, c))) * beta + tempUv * (1 - beta); + tempUv += half2(_TwistUvPosX * _MainTex_ST.x, _TwistUvPosY * _MainTex_ST.y); + d.texcoord0.xy = tempUv; + #endif + + //-------------------------------------------- + + //FISHEYE_ON + #if FISHEYE_ON + half bind = length(centerTiled); + half2 dF = d.texcoord0.xy - centerTiled; + half dFlen = length(dF); + half fishInt = (3.14159265359 / bind) * (_FishEyeUvAmount + 0.001); + d.texcoord0.xy = centerTiled + (dF / (max(0.0001, dFlen))) * tan(dFlen * fishInt) * bind / tan(bind * fishInt); + #endif + //--------------------------------------------- + + //PINCH_ON + #if PINCH_ON + half2 dP = d.texcoord0.xy - centerTiled; + half pinchInt = (3.141592 / length(centerTiled)) * (-_PinchUvAmount + 0.001); + d.texcoord0.xy = centerTiled + normalize(dP) * atan(length(dP) * -pinchInt * 10.0) * 0.5 / atan(-pinchInt * 5); + #endif + + //--------------------------------------------- + + //ZOOMUV_ON + #if ZOOMUV_ON + d.texcoord0.xy -= centerTiled; + d.texcoord0.xy = d.texcoord0.xy * _ZoomUvAmount; + d.texcoord0.xy += centerTiled; + #endif + + //----------------------------------------------- + + //DOODLE_ON + #if DOODLE_ON + half2 uvCopy = uvRect; + _HandDrawnSpeed = (floor((_Time.x + randomSeed) * 20 * _HandDrawnSpeed) / _HandDrawnSpeed) * _HandDrawnSpeed; + uvCopy.x = sin((uvCopy.x * _HandDrawnAmount + _HandDrawnSpeed) * 4); + uvCopy.y = cos((uvCopy.y * _HandDrawnAmount + _HandDrawnSpeed) * 4); + d.texcoord0.xy = lerp(d.texcoord0.xy, d.texcoord0.xy + uvCopy, 0.0005 * _HandDrawnAmount); + #endif + + //-------------------------- + + //SHAKEUV_ON + #if SHAKEUV_ON + half xShake = sin((_Time.x + randomSeed) * _ShakeUvSpeed * 50) * _ShakeUvX; + half yShake = cos((_Time.x + randomSeed) * _ShakeUvSpeed * 50) * _ShakeUvY; + d.texcoord0.xy += half2(xShake * 0.012, yShake * 0.01); + #endif + + //------------------------------------------- + + //RECTSIZE_ON + #if RECTSIZE_ON + d.texcoord0.xy = d.texcoord0.xy * (_RectSize).xx + (((-_RectSize * 0.5) + 0.5)).xx; + #endif + + //------------------------------------------- + + //DISTORT_ON + #if DISTORT_ON + #if ATLAS_ON + d.texcoord3.x = d.texcoord3.x * (1 / (_MaxXUV - _MinXUV)); + d.texcoord3.y = d.texcoord3.y * (1 / (_MaxYUV - _MinYUV)); + #endif + + d.texcoord3.x += ((_Time.x + _RandomSeed) * _DistortTexXSpeed) % 1; + d.texcoord3.y += ((_Time.x + _RandomSeed) * _DistortTexYSpeed) % 1; + half distortAmnt = (SAMPLE_TEXTURE2D(_DistortTex, sampler_DistortTex, d.texcoord3.xy).r - 0.5) * 0.2 * _DistortAmount; + d.texcoord0.x += distortAmnt; + d.texcoord0.y += distortAmnt; + #endif + //------------------------------------------------------- + + //WARP_ON + #if WARP_ON + half2 warpUv = half2(d.texcoord0.x / _MainTex_ST.x, d.texcoord0.y / _MainTex_ST.y); + #if ATLAS_ON + warpUv = half2((warpUv.x - _MinXUV) / (_MaxXUV - _MinXUV), (warpUv.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + const float tau = 6.283185307179586; + float xWarp = (_Time.y + randomSeed) * _WarpSpeed + warpUv.x * tau / _WarpScale; + float yWarp = (_Time.y + randomSeed) * _WarpSpeed + warpUv.y * tau / _WarpScale; + float2 warp = float2(sin(xWarp), sin(yWarp)) * _WarpStrength; + d.texcoord0.xy += warp; + #endif + + //------------------------------------------------------- + + //WAVEUV_ON + #if WAVEUV_ON + float2 uvWave = half2(_WaveX * _MainTex_ST.x, _WaveY * _MainTex_ST.y) - d.texcoord0.xy; + uvWave %= 1; + #if ATLAS_ON + uvWave = half2(_WaveX, _WaveY) - uvRect; + #endif + uvWave.x *= _ScreenParams.x / _ScreenParams.y; + float waveTime = _Time.y + randomSeed; + float angWave = (sqrt(dot(uvWave, uvWave)) * _WaveAmount) - ((waveTime * _WaveSpeed)); + d.texcoord0.xy = d.texcoord0.xy + uvWave * sin(angWave) * (_WaveStrength / 1000.0); + #endif + //---------------------------------------------------- + + //ROUNDWAVEUV_ON + #if ROUNDWAVEUV_ON + half xWave = ((0.5 * _MainTex_ST.x) - uvRect.x); + half yWave = ((0.5 * _MainTex_ST.y) - uvRect.y) * (_MainTex_TexelSize.w / _MainTex_TexelSize.z); + half ripple = -sqrt(xWave*xWave + yWave* yWave); + d.texcoord0.xy += (sin((ripple + (_Time.y + randomSeed) * (_RoundWaveSpeed/10.0)) / 0.015) * (_RoundWaveStrength/10.0)) % 1; + #endif + //---------------------------------------------------- + + + //WIND_ON + #if WIND_ON + half windOffset = sin((_Time.x + randomSeed) * _GrassSpeed * 10); + half2 windCenter = half2(0.5, 0.1); + #if ATLAS_ON + windCenter.x = ((_MaxXUV - _MinXUV) * windCenter.x) + _MinXUV; + windCenter.y = ((_MaxYUV - _MinYUV) * windCenter.y) + _MinYUV; + #endif + #if !MANUALWIND_ON + d.texcoord0.x = fmod(abs(lerp(d.texcoord0.x, d.texcoord0.x + (_GrassWind * 0.01 * windOffset), uvRect.y)), 1); + #else + d.texcoord0.x = fmod(abs(lerp(d.texcoord0.x, d.texcoord0.x + (_GrassWind * 0.01 * _GrassManualAnim), uvRect.y)), 1); + windOffset = _GrassManualAnim; + #endif + half2 delta = d.texcoord0.xy - windCenter; + half delta2 = dot(delta.xy, delta.xy); + half2 delta_offset = delta2 * windOffset; + d.texcoord0.xy = d.texcoord0.xy + half2(delta.y, -delta.x) * delta_offset * _GrassRadialBend; + #endif + + //-------------------------------------------------------- + + //TEXTURESCROLL_ON && !ATLAS_ON + #if TEXTURESCROLL_ON && !ATLAS_ON + d.texcoord0.x += ((_Time.y + randomSeed) * _TextureScrollXSpeed) % 1; + d.texcoord0.y += ((_Time.y + randomSeed) * _TextureScrollYSpeed) % 1; + #endif + //------------------------------ + + //PIXELATE_ON + #if PIXELATE_ON + half aspectRatio = _MainTex_TexelSize.x / _MainTex_TexelSize.y; + half2 pixelSize = float2(_PixelateSize, _PixelateSize * aspectRatio); + d.texcoord0.xy = floor(d.texcoord0.xy * pixelSize) / pixelSize; + #endif + //-------------- + + half4 col = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy); + half originalAlpha = col.a; + col *= d.vertexColor; + + //NORMAL MAP + #if NORMALMAP_ON + half4 normalSample = SAMPLE_TEXTURE2D(_NormalMap, sampler_NormalMap, d.texcoord0.xy); + half3 normalTS = UnpackNormal(normalSample); + normalTS.xy *= _NormalStrength; + o.Normal = normalTS; + #endif + + + //GLITCH_ON + #if GLITCH_ON + half2 uvGlitch = uvRect; + uvGlitch.y -= 0.5; + half lineNoise = pow(rand2(floor(uvGlitch * half2(24., 19.) * _GlitchSize) * 4.0, randomSeed), 3.0) * _GlitchAmount + * pow(rand2(floor(uvGlitch * half2(38., 14.) * _GlitchSize) * 4.0, randomSeed), 3.0); + col = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(lineNoise * 0.02 * rand2(half2(2.0, 1), randomSeed), 0)) * d.vertexColor; + #endif + //-------------------------------------- + + //CHROMABERR_ON + #if CHROMABERR_ON + half4 r = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(_ChromAberrAmount/10, 0)) * d.vertexColor; + half4 b = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(-_ChromAberrAmount/10, 0)) * d.vertexColor; + col = half4(r.r * r.a, col.g, b.b * b.a, max(max(r.a, b.a) * _ChromAberrAlpha, col.a)); + #endif + + //-------------------------------- + + //BLUR_ON + #if BLUR_ON + #if ATLAS_ON + #if !BLURISHD_ON + col = BlurHD(d.texcoord0.xy, _MainTex, sampler_MainTex, _BlurIntensity, (_MaxXUV - _MinXUV), (_MaxYUV - _MinYUV)) * d.vertexColor; + #else + col = Blur(d.texcoord0.xy, _MainTex, sampler_MainTex, _BlurIntensity * (_MaxXUV - _MinXUV)) * d.vertexColor; + #endif + #else + #if !BLURISHD_ON + col = BlurHD(d.texcoord0.xy, _MainTex, sampler_MainTex, _BlurIntensity, 1, 1) * d.vertexColor; + #else + col = Blur(d.texcoord0.xy, _MainTex, sampler_MainTex, _BlurIntensity) * d.vertexColor; + #endif + #endif + #endif + + //-------------------- + + //MOTIONBLUR_ON + #if MOTIONBLUR_ON + _MotionBlurAngle = _MotionBlurAngle * 3.1415926; + #define rot(n) mul(n, half2x2(cos(_MotionBlurAngle), -sin(_MotionBlurAngle), sin(_MotionBlurAngle), cos(_MotionBlurAngle))) + _MotionBlurDist = _MotionBlurDist * 0.005; + #if ATLAS_ON + _MotionBlurDist *= (_MaxXUV - _MinXUV); + #endif + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(-_MotionBlurDist, -_MotionBlurDist))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(-_MotionBlurDist * 2, -_MotionBlurDist * 2))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(-_MotionBlurDist * 3, -_MotionBlurDist * 3))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(-_MotionBlurDist * 4, -_MotionBlurDist * 4))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(_MotionBlurDist, _MotionBlurDist))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(_MotionBlurDist * 2, _MotionBlurDist * 2))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(_MotionBlurDist * 3, _MotionBlurDist * 3))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(_MotionBlurDist * 4, _MotionBlurDist * 4))); + col.rgb = col.rgb / 9; + #endif + //------------------------------------ + + //NEGATIVE_ON + #if NEGATIVE_ON + col.rgb = lerp(col.rgb, 1 - col.rgb, _NegativeAmount); + #endif + + //-------------- + half luminance = 0; + + //GREYSCALE_ON && !GREYSCALEOUTLINE_ON + #if GREYSCALE_ON && !GREYSCALEOUTLINE_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + luminance = saturate(luminance + _GreyscaleLuminosity); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _GreyscaleTintColor, _GreyscaleBlend); + #endif + //------------------------------------ + + //GHOST_ON + #if GHOST_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + half4 ghostResult; + ghostResult.a = saturate(luminance - _GhostTransparency) * col.a; + ghostResult.rgb = col.rgb * (luminance + _GhostColorBoost); + col = lerp(col, ghostResult, _GhostBlend); + #endif + //------------------------------------ + + //INNEROUTLINE_ON + #if INNEROUTLINE_ON + half3 innerT = abs(GetPixel(0, _InnerOutlineThickness, d.texcoord0.xy, _MainTex, sampler_MainTex) - GetPixel(0, -_InnerOutlineThickness, d.texcoord0.xy, _MainTex, sampler_MainTex)); + innerT += abs(GetPixel(_InnerOutlineThickness, 0, d.texcoord0.xy, _MainTex, sampler_MainTex) - GetPixel(-_InnerOutlineThickness, 0, d.texcoord0.xy, _MainTex, sampler_MainTex)); + #if !ONLYINNEROUTLINE_ON + innerT = (innerT / 2.0) * col.a * _InnerOutlineAlpha; + col.rgb += length(innerT) * _InnerOutlineColor.rgb * _InnerOutlineGlow; + #else + innerT *= col.a * _InnerOutlineAlpha; + col.rgb = length(innerT) * _InnerOutlineColor.rgb * _InnerOutlineGlow; + col.a = step(0.3, col.r+col.g+col.b); + #endif + #endif + //------------------------------------------------------- + + //HITEFFECT_ON + #if HITEFFECT_ON + col.rgb = lerp(col.rgb, _HitEffectColor.rgb * _HitEffectGlow, _HitEffectBlend); + #endif + //-------------------- + + //GRADIENT_ON + #if GRADIENT_ON + half2 tiledUvGrad = half2(uvRect.x / _MainTex_ST.x, uvRect.y / _MainTex_ST.y); + #if GRADIENT2COL_ON + _GradTopRightCol = _GradTopLeftCol; + _GradBotRightCol = _GradBotLeftCol; + #endif + #if RADIALGRADIENT_ON + half radialDist = 1 - length(tiledUvGrad - half2(0.5, 0.5)); + radialDist *= (_MainTex_TexelSize.w / _MainTex_TexelSize.z); + radialDist = saturate(_GradBoostX * radialDist); + half4 gradientResult = lerp(_GradTopLeftCol, _GradBotLeftCol, radialDist); + #else + half gradXLerpFactor = saturate(pow(tiledUvGrad.x, _GradBoostX)); + half4 gradientResult = lerp(lerp(_GradBotLeftCol, _GradBotRightCol, gradXLerpFactor), + lerp(_GradTopLeftCol, _GradTopRightCol, gradXLerpFactor), saturate(pow(tiledUvGrad.y, _GradBoostY))); + #endif + gradientResult = lerp(col, gradientResult, _GradBlend); + col.rgb = gradientResult.rgb * col.a; + col.a *= gradientResult.a; + #endif + //-------------------------------------------------------------------- + + //CONTRAST_ON + #if CONTRAST_ON + col.rgb = (col.rgb - float3(0.5, 0.5, 0.5)) * _Contrast + float3(0.5, 0.5, 0.5); + col.rgb += _Brightness; + #endif + + //------------------------------------------------------------------- + + //COLORSWAP_ON + #if COLORSWAP_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + half4 swapMask = SAMPLE_TEXTURE2D(_ColorSwapTex, sampler_ColorSwapTex, d.texcoord0.xy); + swapMask.rgb *= swapMask.a; + half3 redSwap = _ColorSwapRed * swapMask.r * saturate(luminance + _ColorSwapRedLuminosity); + half3 greenSwap = _ColorSwapGreen * swapMask.g * saturate(luminance + _ColorSwapGreenLuminosity); + half3 blueSwap = _ColorSwapBlue * swapMask.b * saturate(luminance + _ColorSwapBlueLuminosity); + swapMask.rgb = col.rgb * saturate(1 - swapMask.r - swapMask.g - swapMask.b); + col.rgb = lerp(col.rgb, swapMask.rgb + redSwap + greenSwap + blueSwap, _ColorSwapBlend); + #endif + //-------------------------------------------------------------------- + + //COLORRAMP_ON && !COLORRAMPOUTLINE_ON + #if COLORRAMP_ON && !COLORRAMPOUTLINE_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + luminance = saturate(luminance + _ColorRampLuminosity); + #if GRADIENTCOLORRAMP_ON + col.rgb = lerp(col.rgb, SAMPLE_TEXTURE2D(_ColorRampTexGradient, sampler_ColorRampTexGradient, half2(luminance, 0)).rgb, _ColorRampBlend); + #else + col.rgb = lerp(col.rgb, SAMPLE_TEXTURE2D(_ColorRampTex, sampler_ColorRampTex, half2(luminance, 0)).rgb, _ColorRampBlend); + #endif + #endif + //-------------------------------------------------------------------- + + //CHANGECOLOR_ON + #if CHANGECOLOR_ON + float3 currChangeColor = saturate(col.rgb); + luminance = 0.3 * currChangeColor.r + 0.59 * currChangeColor.g + 0.11 * currChangeColor.b; + luminance = saturate(luminance + _ColorChangeLuminosity); + half3 dif = abs(currChangeColor - _ColorChangeTarget.rgb); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _ColorChangeNewCol.rgb, + max(sign(1 - saturate(dif.x + dif.y + dif.z) - _ColorChangeTolerance), 0.0)); + #if CHANGECOLOR2_ON + dif = abs(currChangeColor - _ColorChangeTarget2.rgb); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _ColorChangeNewCol2.rgb, + max(sign(1 - saturate(dif.x + dif.y + dif.z) - _ColorChangeTolerance2), 0.0)); + #endif + #if CHANGECOLOR3_ON + dif = abs(currChangeColor - _ColorChangeTarget3.rgb); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _ColorChangeNewCol3.rgb, + max(sign(1 - saturate(dif.x + dif.y + dif.z) - _ColorChangeTolerance3), 0.0)); + #endif + #endif + //------------------------------------------------------- + + //POSTERIZE_ON && !POSTERIZEOUTLINE_ON + #if POSTERIZE_ON && !POSTERIZEOUTLINE_ON + col.rgb = pow(col.rgb, _PosterizeGamma) * _PosterizeNumColors; + col.rgb = floor(col.rgb) / _PosterizeNumColors; + col.rgb = pow(col.rgb, 1.0 / _PosterizeGamma); + #endif + //------------------------------------ + + //HSV_ON + #if HSV_ON + half3 resultHsv = half3(col.rgb); + half cosHsv = _HsvBright * _HsvSaturation * cos(_HsvShift * 3.14159265 / 180); + half sinHsv = _HsvBright * _HsvSaturation * sin(_HsvShift * 3.14159265 / 180); + resultHsv.x = (.299 * _HsvBright + .701 * cosHsv + .168 * sinHsv) * col.x + + (.587 * _HsvBright - .587 * cosHsv + .330 * sinHsv) * col.y + + (.114 * _HsvBright - .114 * cosHsv - .497 * sinHsv) * col.z; + resultHsv.y = (.299 * _HsvBright - .299 * cosHsv - .328 * sinHsv) *col.x + + (.587 * _HsvBright + .413 * cosHsv + .035 * sinHsv) * col.y + + (.114 * _HsvBright - .114 * cosHsv + .292 * sinHsv) * col.z; + resultHsv.z = (.299 * _HsvBright - .3 * cosHsv + 1.25 * sinHsv) * col.x + + (.587 * _HsvBright - .588 * cosHsv - 1.05 * sinHsv) * col.y + + (.114 * _HsvBright + .886 * cosHsv - .203 * sinHsv) * col.z; + col.rgb = resultHsv; + #endif + //------------------------------------------------------- + + //OVERLAY_ON + #if OVERLAY_ON + half2 overlayUvs = d.texcoord0.xy; + overlayUvs.x += ((_Time.y + randomSeed) * _OverlayTextureScrollXSpeed) % 1; + overlayUvs.y += ((_Time.y + randomSeed) * _OverlayTextureScrollYSpeed) % 1; + half4 overlayCol = SAMPLE_TEXTURE2D(_OverlayTex, sampler_OverlayTex, TRANSFORM_TEX(overlayUvs, _OverlayTex)); + overlayCol.rgb *= _OverlayColor.rgb * _OverlayGlow; + #if !OVERLAYMULT_ON + overlayCol.rgb *= overlayCol.a * _OverlayColor.rgb * _OverlayColor.a * _OverlayBlend; + col.rgb += overlayCol.rgb; + #else + overlayCol.a *= _OverlayColor.a; + col = lerp(col, col * overlayCol, _OverlayBlend); + #endif + #endif + + //--------------------------------- + + //OUTBASE_ON + #if OUTBASE_ON + #if OUTBASEPIXELPERF_ON + half2 destUv = half2(_OutlinePixelWidth * _MainTex_TexelSize.x, _OutlinePixelWidth * _MainTex_TexelSize.y); + #else + half2 destUv = half2(_OutlineWidth * _MainTex_TexelSize.x * 200, _OutlineWidth * _MainTex_TexelSize.y * 200); + #endif + + #if OUTDIST_ON + d.texcoord3.x += ((_Time.x + _RandomSeed) * _OutlineDistortTexXSpeed) % 1; + d.texcoord3.y += ((_Time.x + _RandomSeed) * _OutlineDistortTexYSpeed) % 1; + #if ATLAS_ON + d.texcoord3 = half2((d.texcoord3.x - _MinXUV) / (_MaxXUV - _MinXUV), (d.texcoord3.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half outDistortAmnt = (SAMPLE_TEXTURE2D(_OutlineDistortTex, sampler_OutlineDistortTex, d.texcoord3).r - 0.5) * 0.2 * _OutlineDistortAmount; + destUv.x += outDistortAmnt; + destUv.y += outDistortAmnt; + #endif + + half spriteLeft = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(destUv.x, 0)).a; + half spriteRight = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy - half2(destUv.x, 0)).a; + half spriteBottom = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(0, destUv.y)).a; + half spriteTop = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy - half2(0, destUv.y)).a; + half result = spriteLeft + spriteRight + spriteBottom + spriteTop; + + #if OUTBASE8DIR_ON + half spriteTopLeft = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(destUv.x, destUv.y)).a; + half spriteTopRight = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(-destUv.x, destUv.y)).a; + half spriteBotLeft = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(destUv.x, -destUv.y)).a; + half spriteBotRight = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(-destUv.x, -destUv.y)).a; + result = result + spriteTopLeft + spriteTopRight + spriteBotLeft + spriteBotRight; + #endif + + result = step(0.05, saturate(result)); + + #if OUTTEX_ON + d.texcoord1.x += ((_Time.x + _RandomSeed) * _OutlineTexXSpeed) % 1; + d.texcoord1.y += ((_Time.x + _RandomSeed) * _OutlineTexYSpeed) % 1; + #if ATLAS_ON + d.texcoord1 = half2((d.texcoord1.x - _MinXUV) / (_MaxXUV - _MinXUV), (d.texcoord1.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half4 tempOutColor = SAMPLE_TEXTURE2D(_OutlineTex, sampler_OutlineTex, d.texcoord1); + tempOutColor *= _OutlineColor; + _OutlineColor = tempOutColor; + #endif + + result *= (1 - originalAlpha) * _OutlineAlpha; + + half4 outline = _OutlineColor * d.vertexColor.a; + outline.rgb *= _OutlineGlow; + outline.a = result; + #if ONLYOUTLINE_ON + col = outline; + #else + col = lerp(col, outline, result); + #endif + #endif + //------------------------------------------------------- + + //FADE_ON + #if FADE_ON + half2 tiledUvFade1 = TRANSFORM_TEX(d.texcoord0, _FadeTex); + half2 tiledUvFade2 = TRANSFORM_TEX(d.texcoord0, _FadeBurnTex); + #if ATLAS_ON + tiledUvFade1 = half2((tiledUvFade1.x - _MinXUV) / (_MaxXUV - _MinXUV), (tiledUvFade1.y - _MinYUV) / (_MaxYUV - _MinYUV)); + tiledUvFade2 = half2((tiledUvFade2.x - _MinXUV) / (_MaxXUV - _MinXUV), (tiledUvFade2.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half fadeTemp = SAMPLE_TEXTURE2D(_FadeTex, sampler_FadeTex, tiledUvFade1).r; + half fade = smoothstep(_FadeAmount, _FadeAmount + _FadeBurnTransition, fadeTemp); + half fadeBurn = saturate(smoothstep(_FadeAmount - _FadeBurnWidth, _FadeAmount - _FadeBurnWidth + 0.1, fadeTemp) * _FadeAmount); + col.a *= fade; + _FadeBurnColor.rgb *= _FadeBurnGlow; + col += fadeBurn * SAMPLE_TEXTURE2D(_FadeBurnTex, sampler_FadeBurnTex, tiledUvFade2) * _FadeBurnColor * originalAlpha * (1 - col.a); + #endif + //------------------------------------------------------- + + //SHADOW_ON + #if SHADOW_ON + half shadowA = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(_ShadowX, _ShadowY)).a; + half preMultShadowMask = 1 - (saturate(shadowA - col.a) * (1 - col.a)); + col.rgb *= 1 - ((shadowA - col.a) * (1 - col.a)); + col.rgb += (_ShadowColor * shadowA) * (1 - col.a); + col.a = max(shadowA * _ShadowAlpha * d.vertexColor.a, col.a); + #endif + + //------------------------------------------------------- + + //GLOW_ON + #if GLOW_ON + half4 emission; + #if GLOWTEX_ON + emission = SAMPLE_TEXTURE2D(_GlowTex, sampler_GlowTex, d.texcoord0); + #else + emission = col; + #endif + + col.rgb *= _GlowGlobal; + emission.rgb *= emission.a * col.a * _Glow * _GlowColor; + col.rgb += emission.rgb; + #endif + //------------------------------------------------------- + + //COLORRAMP_ON && COLORRAMPOUTLINE_ON + #if COLORRAMP_ON && COLORRAMPOUTLINE_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + luminance = saturate(luminance + _ColorRampLuminosity); + #if GRADIENTCOLORRAMP_ON + col.rgb = lerp(col.rgb, SAMPLE_TEXTURE2D(_ColorRampTexGradient, sampler_ColorRampTexGradient, half2(luminance, 0)).rgb, _ColorRampBlend); + #else + col.rgb = lerp(col.rgb, SAMPLE_TEXTURE2D(_ColorRampTex, sampler_ColorRampTex, half2(luminance, 0)).rgb, _ColorRampBlend); + #endif + #endif + //--------------- + + //GREYSCALE_ON && GREYSCALEOUTLINE_ON + #if GREYSCALE_ON && GREYSCALEOUTLINE_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + luminance = saturate(luminance + _GreyscaleLuminosity); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _GreyscaleTintColor, _GreyscaleBlend); + #endif + + //----------------------------------- + + //POSTERIZE_ON && POSTERIZEOUTLINE_ON + #if POSTERIZE_ON && POSTERIZEOUTLINE_ON + col.rgb = pow(col.rgb, _PosterizeGamma) * _PosterizeNumColors; + col.rgb = floor(col.rgb) / _PosterizeNumColors; + col.rgb = pow(col.rgb, 1.0 / _PosterizeGamma); + #endif + + //----------------------------------- + + //SHINE_ON + #if SHINE_ON + half2 uvShine = uvRect; + half cosAngle = cos(_ShineRotate); + half sinAngle = sin(_ShineRotate); + half2x2 rot = half2x2(cosAngle, -sinAngle, sinAngle, cosAngle); + uvShine -= half2(0.5, 0.5); + uvShine = mul(rot, uvShine); + uvShine += half2(0.5, 0.5); + half shineMask = SAMPLE_TEXTURE2D(_ShineMask, sampler_ShineMask, d.texcoord0.xy).a; + half currentDistanceProjection = (uvShine.x + uvShine.y) / 2; + half whitePower = 1 - (abs(currentDistanceProjection - _ShineLocation) / _ShineWidth); + col.rgb += col.a * whitePower * _ShineGlow * max(sign(currentDistanceProjection - (_ShineLocation - _ShineWidth)), 0.0) + * max(sign((_ShineLocation + _ShineWidth) - currentDistanceProjection), 0.0) * _ShineColor * shineMask; + #endif + + //----------------------------------- + + //HOLOGRAM_ON + #if HOLOGRAM_ON + half totalHologram = _HologramStripesAmount + _HologramUnmodAmount; + half hologramYCoord = ((uvRect.y + (((_Time.x + randomSeed) % 1) * _HologramStripesSpeed)) % totalHologram) / totalHologram; + hologramYCoord = abs(hologramYCoord); + half alpha = RemapFloat(saturate(hologramYCoord - (_HologramUnmodAmount/totalHologram)), 0.0, 1.0, _HologramMinAlpha, saturate(_HologramMaxAlpha)); + half hologramMask = max(sign((_HologramUnmodAmount/totalHologram) - hologramYCoord), 0.0); + half4 hologramResult = col; + hologramResult.a *= lerp(alpha, 1, hologramMask); + hologramResult.rgb *= max(1, _HologramMaxAlpha * max(sign(hologramYCoord - (_HologramUnmodAmount/totalHologram)), 0.0)); + hologramMask = 1 - step(0.01,hologramMask); + hologramResult.rgb += hologramMask * _HologramStripeColor * col.a; + col = lerp(col, hologramResult, _HologramBlend); + #endif + + //----------------------------------- + + //FLICKER_ON + #if FLICKER_ON + col.a *= saturate(col.a * step(frac(0.05 + (_Time.w + randomSeed) * _FlickerFreq), 1 - _FlickerPercent) + _FlickerAlpha); + #endif + //----------------------------------- + + //ALPHACUTOFF_ON + + //ALPHAROUND_ON + + //ALPHAOUTLINE_ON + #if ALPHAOUTLINE_ON + half alphaOutlineRes = pow(1 - col.a, max(_AlphaOutlinePower, 0.0001)) * step(_AlphaOutlineMinAlpha, col.a) * _AlphaOutlineBlend; + col.rgb = lerp(col.rgb, _AlphaOutlineColor.rgb * _AlphaOutlineGlow, alphaOutlineRes); + col.a = lerp(col.a, 1, alphaOutlineRes > 1); + #endif + //------------------------------------------------------- + + //FOG_ON + + //------------------ + + col *= _Color; + o.Albedo = col; + col.a *= _Alpha; + clip(col.a - _AlphaCutoffValue - 0.01); + o.Alpha = _Color.a; + } + + + + + + void ChainSurfaceFunction(inout Surface l, inout ShaderData d) + { + Ext_SurfaceFunction0(l, d); + // Ext_SurfaceFunction1(l, d); + // Ext_SurfaceFunction2(l, d); + // Ext_SurfaceFunction3(l, d); + // Ext_SurfaceFunction4(l, d); + // Ext_SurfaceFunction5(l, d); + // Ext_SurfaceFunction6(l, d); + // Ext_SurfaceFunction7(l, d); + // Ext_SurfaceFunction8(l, d); + // Ext_SurfaceFunction9(l, d); + // Ext_SurfaceFunction10(l, d); + // Ext_SurfaceFunction11(l, d); + // Ext_SurfaceFunction12(l, d); + // Ext_SurfaceFunction13(l, d); + // Ext_SurfaceFunction14(l, d); + // Ext_SurfaceFunction15(l, d); + // Ext_SurfaceFunction16(l, d); + // Ext_SurfaceFunction17(l, d); + // Ext_SurfaceFunction18(l, d); + // Ext_SurfaceFunction19(l, d); + // Ext_SurfaceFunction20(l, d); + // Ext_SurfaceFunction21(l, d); + // Ext_SurfaceFunction22(l, d); + // Ext_SurfaceFunction23(l, d); + // Ext_SurfaceFunction24(l, d); + // Ext_SurfaceFunction25(l, d); + // Ext_SurfaceFunction26(l, d); + // Ext_SurfaceFunction27(l, d); + // Ext_SurfaceFunction28(l, d); + // Ext_SurfaceFunction29(l, d); + } + +#if !_DECALSHADER + + void ChainModifyVertex(inout VertexData v, inout VertexToPixel v2p, float4 time) + { + ExtraV2F d; + + ZERO_INITIALIZE(ExtraV2F, d); + ZERO_INITIALIZE(Blackboard, d.blackboard); + // due to motion vectors in HDRP, we need to use the last + // time in certain spots. So if you are going to use _Time to adjust vertices, + // you need to use this time or motion vectors will break. + d.time = time; + + Ext_ModifyVertex0(v, d); + // Ext_ModifyVertex1(v, d); + // Ext_ModifyVertex2(v, d); + // Ext_ModifyVertex3(v, d); + // Ext_ModifyVertex4(v, d); + // Ext_ModifyVertex5(v, d); + // Ext_ModifyVertex6(v, d); + // Ext_ModifyVertex7(v, d); + // Ext_ModifyVertex8(v, d); + // Ext_ModifyVertex9(v, d); + // Ext_ModifyVertex10(v, d); + // Ext_ModifyVertex11(v, d); + // Ext_ModifyVertex12(v, d); + // Ext_ModifyVertex13(v, d); + // Ext_ModifyVertex14(v, d); + // Ext_ModifyVertex15(v, d); + // Ext_ModifyVertex16(v, d); + // Ext_ModifyVertex17(v, d); + // Ext_ModifyVertex18(v, d); + // Ext_ModifyVertex19(v, d); + // Ext_ModifyVertex20(v, d); + // Ext_ModifyVertex21(v, d); + // Ext_ModifyVertex22(v, d); + // Ext_ModifyVertex23(v, d); + // Ext_ModifyVertex24(v, d); + // Ext_ModifyVertex25(v, d); + // Ext_ModifyVertex26(v, d); + // Ext_ModifyVertex27(v, d); + // Ext_ModifyVertex28(v, d); + // Ext_ModifyVertex29(v, d); + + + // #if %EXTRAV2F0REQUIREKEY% + // v2p.extraV2F0 = d.extraV2F0; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // v2p.extraV2F1 = d.extraV2F1; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // v2p.extraV2F2 = d.extraV2F2; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // v2p.extraV2F3 = d.extraV2F3; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // v2p.extraV2F4 = d.extraV2F4; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // v2p.extraV2F5 = d.extraV2F5; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // v2p.extraV2F6 = d.extraV2F6; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // v2p.extraV2F7 = d.extraV2F7; + // #endif + } + + void ChainModifyTessellatedVertex(inout VertexData v, inout VertexToPixel v2p) + { + ExtraV2F d; + ZERO_INITIALIZE(ExtraV2F, d); + ZERO_INITIALIZE(Blackboard, d.blackboard); + + // #if %EXTRAV2F0REQUIREKEY% + // d.extraV2F0 = v2p.extraV2F0; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // d.extraV2F1 = v2p.extraV2F1; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // d.extraV2F2 = v2p.extraV2F2; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // d.extraV2F3 = v2p.extraV2F3; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // d.extraV2F4 = v2p.extraV2F4; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // d.extraV2F5 = v2p.extraV2F5; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // d.extraV2F6 = v2p.extraV2F6; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // d.extraV2F7 = v2p.extraV2F7; + // #endif + + + // Ext_ModifyTessellatedVertex0(v, d); + // Ext_ModifyTessellatedVertex1(v, d); + // Ext_ModifyTessellatedVertex2(v, d); + // Ext_ModifyTessellatedVertex3(v, d); + // Ext_ModifyTessellatedVertex4(v, d); + // Ext_ModifyTessellatedVertex5(v, d); + // Ext_ModifyTessellatedVertex6(v, d); + // Ext_ModifyTessellatedVertex7(v, d); + // Ext_ModifyTessellatedVertex8(v, d); + // Ext_ModifyTessellatedVertex9(v, d); + // Ext_ModifyTessellatedVertex10(v, d); + // Ext_ModifyTessellatedVertex11(v, d); + // Ext_ModifyTessellatedVertex12(v, d); + // Ext_ModifyTessellatedVertex13(v, d); + // Ext_ModifyTessellatedVertex14(v, d); + // Ext_ModifyTessellatedVertex15(v, d); + // Ext_ModifyTessellatedVertex16(v, d); + // Ext_ModifyTessellatedVertex17(v, d); + // Ext_ModifyTessellatedVertex18(v, d); + // Ext_ModifyTessellatedVertex19(v, d); + // Ext_ModifyTessellatedVertex20(v, d); + // Ext_ModifyTessellatedVertex21(v, d); + // Ext_ModifyTessellatedVertex22(v, d); + // Ext_ModifyTessellatedVertex23(v, d); + // Ext_ModifyTessellatedVertex24(v, d); + // Ext_ModifyTessellatedVertex25(v, d); + // Ext_ModifyTessellatedVertex26(v, d); + // Ext_ModifyTessellatedVertex27(v, d); + // Ext_ModifyTessellatedVertex28(v, d); + // Ext_ModifyTessellatedVertex29(v, d); + + // #if %EXTRAV2F0REQUIREKEY% + // v2p.extraV2F0 = d.extraV2F0; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // v2p.extraV2F1 = d.extraV2F1; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // v2p.extraV2F2 = d.extraV2F2; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // v2p.extraV2F3 = d.extraV2F3; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // v2p.extraV2F4 = d.extraV2F4; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // v2p.extraV2F5 = d.extraV2F5; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // v2p.extraV2F6 = d.extraV2F6; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // v2p.extraV2F7 = d.extraV2F7; + // #endif + } + + void ChainFinalColorForward(inout Surface l, inout ShaderData d, inout half4 color) + { + // Ext_FinalColorForward0(l, d, color); + // Ext_FinalColorForward1(l, d, color); + // Ext_FinalColorForward2(l, d, color); + // Ext_FinalColorForward3(l, d, color); + // Ext_FinalColorForward4(l, d, color); + // Ext_FinalColorForward5(l, d, color); + // Ext_FinalColorForward6(l, d, color); + // Ext_FinalColorForward7(l, d, color); + // Ext_FinalColorForward8(l, d, color); + // Ext_FinalColorForward9(l, d, color); + // Ext_FinalColorForward10(l, d, color); + // Ext_FinalColorForward11(l, d, color); + // Ext_FinalColorForward12(l, d, color); + // Ext_FinalColorForward13(l, d, color); + // Ext_FinalColorForward14(l, d, color); + // Ext_FinalColorForward15(l, d, color); + // Ext_FinalColorForward16(l, d, color); + // Ext_FinalColorForward17(l, d, color); + // Ext_FinalColorForward18(l, d, color); + // Ext_FinalColorForward19(l, d, color); + // Ext_FinalColorForward20(l, d, color); + // Ext_FinalColorForward21(l, d, color); + // Ext_FinalColorForward22(l, d, color); + // Ext_FinalColorForward23(l, d, color); + // Ext_FinalColorForward24(l, d, color); + // Ext_FinalColorForward25(l, d, color); + // Ext_FinalColorForward26(l, d, color); + // Ext_FinalColorForward27(l, d, color); + // Ext_FinalColorForward28(l, d, color); + // Ext_FinalColorForward29(l, d, color); + } + + void ChainFinalGBufferStandard(inout Surface s, inout ShaderData d, inout half4 GBuffer0, inout half4 GBuffer1, inout half4 GBuffer2, inout half4 outEmission, inout half4 outShadowMask) + { + // Ext_FinalGBufferStandard0(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard1(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard2(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard3(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard4(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard5(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard6(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard7(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard8(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard9(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard10(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard11(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard12(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard13(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard14(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard15(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard16(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard17(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard18(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard19(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard20(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard21(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard22(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard23(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard24(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard25(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard26(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard27(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard28(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard29(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + } +#endif + + + + + +#if _DECALSHADER + + ShaderData CreateShaderData(SurfaceDescriptionInputs IN) + { + ShaderData d = (ShaderData)0; + d.TBNMatrix = float3x3(IN.WorldSpaceTangent, IN.WorldSpaceBiTangent, IN.WorldSpaceNormal); + d.worldSpaceNormal = IN.WorldSpaceNormal; + d.worldSpaceTangent = IN.WorldSpaceTangent; + + d.worldSpacePosition = IN.WorldSpacePosition; + d.texcoord0 = IN.uv0.xyxy; + d.screenPos = IN.ScreenPosition; + + d.worldSpaceViewDir = normalize(_WorldSpaceCameraPos - d.worldSpacePosition); + + d.tangentSpaceViewDir = mul(d.TBNMatrix, d.worldSpaceViewDir); + + // these rarely get used, so we back transform them. Usually will be stripped. + #if _HDRP + // d.localSpacePosition = mul(GetWorldToObjectMatrix(), float4(GetCameraRelativePositionWS(d.worldSpacePosition), 1)).xyz; + #else + // d.localSpacePosition = mul(GetWorldToObjectMatrix(), float4(d.worldSpacePosition, 1)).xyz; + #endif + // d.localSpaceNormal = normalize(mul((float3x3)GetWorldToObjectMatrix(), d.worldSpaceNormal)); + // d.localSpaceTangent = normalize(mul((float3x3)GetWorldToObjectMatrix(), d.worldSpaceTangent.xyz)); + + // #if %SCREENPOSREQUIREKEY% + // d.screenUV = (IN.ScreenPosition.xy / max(0.01, IN.ScreenPosition.w)); + // #endif + + return d; + } +#else + + ShaderData CreateShaderData(VertexToPixel i + #if NEED_FACING + , bool facing + #endif + ) + { + ShaderData d = (ShaderData)0; + d.clipPos = i.pos; + d.worldSpacePosition = i.worldPos; + + d.worldSpaceNormal = normalize(i.worldNormal); + d.worldSpaceTangent.xyz = normalize(i.worldTangent.xyz); + + d.tangentSign = i.worldTangent.w * unity_WorldTransformParams.w; + float3 bitangent = cross(d.worldSpaceTangent.xyz, d.worldSpaceNormal) * d.tangentSign; + + d.TBNMatrix = float3x3(d.worldSpaceTangent, -bitangent, d.worldSpaceNormal); + d.worldSpaceViewDir = normalize(_WorldSpaceCameraPos - i.worldPos); + + d.tangentSpaceViewDir = mul(d.TBNMatrix, d.worldSpaceViewDir); + d.texcoord0 = i.texcoord0; + d.texcoord1 = i.texcoord1; + d.texcoord2 = i.texcoord2; + + // #if %TEXCOORD3REQUIREKEY% + d.texcoord3 = i.texcoord3; + // #endif + + // d.isFrontFace = facing; + // #if %VERTEXCOLORREQUIREKEY% + d.vertexColor = i.vertexColor; + // #endif + + // these rarely get used, so we back transform them. Usually will be stripped. + #if _HDRP + // d.localSpacePosition = mul(GetWorldToObjectMatrix(), float4(GetCameraRelativePositionWS(i.worldPos), 1)).xyz; + #else + // d.localSpacePosition = mul(GetWorldToObjectMatrix(), float4(i.worldPos, 1)).xyz; + #endif + // d.localSpaceNormal = normalize(mul((float3x3)GetWorldToObjectMatrix(), i.worldNormal)); + // d.localSpaceTangent = normalize(mul((float3x3)GetWorldToObjectMatrix(), i.worldTangent.xyz)); + + // #if %SCREENPOSREQUIREKEY% + // d.screenPos = i.screenPos; + // d.screenUV = (i.screenPos.xy / i.screenPos.w); + // #endif + + + // #if %EXTRAV2F0REQUIREKEY% + // d.extraV2F0 = i.extraV2F0; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // d.extraV2F1 = i.extraV2F1; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // d.extraV2F2 = i.extraV2F2; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // d.extraV2F3 = i.extraV2F3; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // d.extraV2F4 = i.extraV2F4; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // d.extraV2F5 = i.extraV2F5; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // d.extraV2F6 = i.extraV2F6; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // d.extraV2F7 = i.extraV2F7; + // #endif + + return d; + } + +#endif + + + #if _PASSSHADOW + float3 _LightDirection; + #endif + + // vertex shader + VertexToPixel Vert (VertexData v) + { + + VertexToPixel o = (VertexToPixel)0; + + UNITY_SETUP_INSTANCE_ID(v); + UNITY_TRANSFER_INSTANCE_ID(v, o); + UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o); + + +#if !_TESSELLATION_ON + ChainModifyVertex(v, o, _Time); +#endif + + o.texcoord0 = v.texcoord0; + o.texcoord1 = v.texcoord1; + o.texcoord2 = v.texcoord2; + + // #if %TEXCOORD3REQUIREKEY% + o.texcoord3 = v.texcoord3; + // #endif + + // #if %VERTEXCOLORREQUIREKEY% + o.vertexColor = v.vertexColor; + // #endif + + VertexPositionInputs vertexInput = GetVertexPositionInputs(v.vertex.xyz); + o.worldPos = TransformObjectToWorld(v.vertex.xyz); + o.worldNormal = TransformObjectToWorldNormal(v.normal); + o.worldTangent = float4(TransformObjectToWorldDir(v.tangent.xyz), v.tangent.w); + + + #if _PASSSHADOW + // Define shadow pass specific clip position for Universal + o.pos = TransformWorldToHClip(ApplyShadowBias(o.worldPos, o.worldNormal, _LightDirection)); + #if UNITY_REVERSED_Z + o.pos.z = min(o.pos.z, UNITY_NEAR_CLIP_VALUE); + #else + o.pos.z = max(o.pos.z, UNITY_NEAR_CLIP_VALUE); + #endif + #elif _PASSMETA + o.pos = MetaVertexPosition(float4(v.vertex.xyz, 0), v.texcoord1, v.texcoord2, unity_LightmapST, unity_DynamicLightmapST); + #else + o.pos = TransformWorldToHClip(o.worldPos); + #endif + + // #if %SCREENPOSREQUIREKEY% + // o.screenPos = ComputeScreenPos(o.pos, _ProjectionParams.x); + // #endif + + #if _PASSFORWARD + OUTPUT_LIGHTMAP_UV(v.texcoord1, unity_LightmapST, o.lightmapUV); + OUTPUT_SH(o.worldNormal, o.sh); + #endif + + #ifdef VARYINGS_NEED_FOG_AND_VERTEX_LIGHT + #if _BAKEDLIT + half3 vertexLight = 0; + #else + half3 vertexLight = VertexLighting(o.worldPos, o.worldNormal); + #endif + half fogFactor = ComputeFogFactor(o.pos.z); + o.fogFactorAndVertexLight = half4(fogFactor, vertexLight); + #endif + + #ifdef _MAIN_LIGHT_SHADOWS + o.shadowCoord = GetShadowCoord(vertexInput); + #endif + + return o; + } + + + + + // fragment shader + half4 Frag (VertexToPixel IN + #ifdef _DEPTHOFFSET_ON + , out float outputDepth : SV_Depth + #endif + #if NEED_FACING + , bool facing : SV_IsFrontFace + #endif + ) : SV_Target + { + UNITY_SETUP_INSTANCE_ID(IN); + UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX(IN); + + ShaderData d = CreateShaderData(IN + #if NEED_FACING + , facing + #endif + ); + Surface l = (Surface)0; + + #ifdef _DEPTHOFFSET_ON + l.outputDepth = outputDepth; + #endif + + l.Albedo = half3(0.5, 0.5, 0.5); + l.Normal = float3(0,0,1); + l.Occlusion = 1; + l.Alpha = 1; + + ChainSurfaceFunction(l, d); + + #ifdef _DEPTHOFFSET_ON + outputDepth = l.outputDepth; + #endif + + #if defined(_USESPECULAR) || _SIMPLELIT + float3 specular = l.Specular; + float metallic = 1; + #else + float3 specular = 0; + float metallic = l.Metallic; + #endif + + + InputData inputData; + + inputData.positionWS = IN.worldPos; + #if _WORLDSPACENORMAL + inputData.normalWS = l.Normal; + #else + inputData.normalWS = normalize(TangentToWorldSpace(d, l.Normal)); + #endif + + inputData.viewDirectionWS = SafeNormalize(d.worldSpaceViewDir); + + + #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR) + inputData.shadowCoord = IN.shadowCoord; + #elif defined(MAIN_LIGHT_CALCULATE_SHADOWS) + inputData.shadowCoord = TransformWorldToShadowCoord(IN.worldPos); + #else + inputData.shadowCoord = float4(0, 0, 0, 0); + #endif + + inputData.fogCoord = IN.fogFactorAndVertexLight.x; + inputData.vertexLighting = IN.fogFactorAndVertexLight.yzw; + #if defined(_OVERRIDE_BAKEDGI) + inputData.bakedGI = l.DiffuseGI; + l.Emission += l.SpecularGI; + #else + inputData.bakedGI = SAMPLE_GI(IN.lightmapUV, IN.sh, inputData.normalWS); + #endif + + #if !_UNLIT + #if _SIMPLELIT + half4 color = UniversalFragmentBlinnPhong( + inputData, + l.Albedo, + float4(specular * l.Smoothness, 0), + l.SpecularPower * 128, + l.Emission, + l.Alpha); + color.a = l.Alpha; + #elif _BAKEDLIT + half4 color = color = UniversalFragmentBakedLit(inputData, l.Albedo, l.Alpha, normalTS); + #else + half4 color = UniversalFragmentPBR( + inputData, + l.Albedo, + metallic, + specular, + l.Smoothness, + l.Occlusion, + l.Emission, + l.Alpha); + #endif + + #else + half4 color = half4(l.Albedo, l.Alpha); + #endif + + #if _UNLITFOG && !DISABLEFOG + color.rgb = MixFog(color.rgb, IN.fogFactorAndVertexLight.x); + #endif + + ChainFinalColorForward(l, d, color); + + return color; + + } + + ENDHLSL + + } + + + + Pass + { + Name "ShadowCaster" + Tags + { + "LightMode" = "ShadowCaster" + } + + // Render State + Blend One Zero, One Zero + Cull Back + ZTest LEqual + ZWrite On + // ColorMask: + + Tags { "RenderType" = "Opaque" "Queue" = "Geometry" "PreviewType" = "Plane" } + Cull [_CullingOption] + ZWrite [_ZWrite] + ZTest [_ZTestMode] + + + HLSLPROGRAM + + #pragma vertex Vert + #pragma fragment Frag + + #pragma target 3.0 + + #pragma prefer_hlslcc gles + #pragma exclude_renderers d3d11_9x + #pragma multi_compile_instancing + + #define _NORMAL_DROPOFF_TS 1 + #define ATTRIBUTES_NEED_NORMAL + #define ATTRIBUTES_NEED_TANGENT + #define SHADERPASS_SHADOWCASTER + #define _PASSSHADOW 1 + + + #pragma shader_feature_local GLOW_ON + #pragma shader_feature_local FADE_ON + #pragma shader_feature_local OUTBASE_ON + #pragma shader_feature_local ONLYOUTLINE_ON + #pragma shader_feature_local GRADIENT_ON + #pragma shader_feature_local GRADIENT2COL_ON + #pragma shader_feature_local RADIALGRADIENT_ON + #pragma shader_feature_local COLORSWAP_ON + #pragma shader_feature_local HSV_ON + #pragma shader_feature_local CHANGECOLOR_ON + #pragma shader_feature_local CHANGECOLOR2_ON + #pragma shader_feature_local CHANGECOLOR3_ON + #pragma shader_feature_local COLORRAMP_ON + #pragma shader_feature_local GRADIENTCOLORRAMP_ON + #pragma shader_feature_local HITEFFECT_ON + #pragma shader_feature_local NEGATIVE_ON + #pragma shader_feature_local PIXELATE_ON + #pragma shader_feature_local GREYSCALE_ON + #pragma shader_feature_local POSTERIZE_ON + #pragma shader_feature_local BLUR_ON + #pragma shader_feature_local MOTIONBLUR_ON + #pragma shader_feature_local GHOST_ON + #pragma shader_feature_local ALPHAOUTLINE_ON + #pragma shader_feature_local INNEROUTLINE_ON + #pragma shader_feature_local ONLYINNEROUTLINE_ON + #pragma shader_feature_local HOLOGRAM_ON + #pragma shader_feature_local CHROMABERR_ON + #pragma shader_feature_local GLITCH_ON + #pragma shader_feature_local FLICKER_ON + #pragma shader_feature_local SHADOW_ON + #pragma shader_feature_local SHINE_ON + #pragma shader_feature_local CONTRAST_ON + #pragma shader_feature_local OVERLAY_ON + #pragma shader_feature_local OVERLAYMULT_ON + #pragma shader_feature_local DOODLE_ON + #pragma shader_feature_local WIND_ON + #pragma shader_feature_local WAVEUV_ON + #pragma shader_feature_local ROUNDWAVEUV_ON + #pragma shader_feature_local RECTSIZE_ON + #pragma shader_feature_local OFFSETUV_ON + #pragma shader_feature_local CLIPPING_ON + #pragma shader_feature_local RADIALCLIPPING_ON + #pragma shader_feature_local TEXTURESCROLL_ON + #pragma shader_feature_local ZOOMUV_ON + #pragma shader_feature_local DISTORT_ON + #pragma shader_feature_local WARP_ON + #pragma shader_feature_local TWISTUV_ON + #pragma shader_feature_local ROTATEUV_ON + #pragma shader_feature_local POLARUV_ON + #pragma shader_feature_local FISHEYE_ON + #pragma shader_feature_local PINCH_ON + #pragma shader_feature_local SHAKEUV_ON + + #pragma shader_feature_local GLOWTEX_ON + #pragma shader_feature_local OUTTEX_ON + #pragma shader_feature_local OUTDIST_ON + #pragma shader_feature_local OUTBASE8DIR_ON + #pragma shader_feature_local OUTBASEPIXELPERF_ON + #pragma shader_feature_local COLORRAMPOUTLINE_ON + #pragma shader_feature_local GREYSCALEOUTLINE_ON + #pragma shader_feature_local POSTERIZEOUTLINE_ON + #pragma shader_feature_local BLURISHD_ON + #pragma shader_feature_local MANUALWIND_ON + #pragma shader_feature_local ATLAS_ON + #pragma shader_feature_local PREMULTIPLYALPHA_ON + + #pragma shader_feature BILBOARD_ON + #pragma shader_feature BILBOARDY_ON + + #pragma shader_feature NORMALMAP_ON + + + #define _URP 1 +#define _USINGTEXCOORD1 1 +#define _USINGTEXCOORD2 1 + + + + + #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Color.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.universal/ShaderLibrary/ShaderGraphFunctions.hlsl" + #include "Packages/com.unity.shadergraph/ShaderGraphLibrary/ShaderVariablesFunctions.hlsl" + + #undef WorldNormalVector + #define WorldNormalVector(data, normal) mul(normal, data.TBNMatrix) + + #define UnityObjectToWorldNormal(normal) mul(GetObjectToWorldMatrix(), normal) + + #define _WorldSpaceLightPos0 _MainLightPosition + + #define UNITY_DECLARE_TEX2D(name) TEXTURE2D(name); SAMPLER(sampler##name); + #define UNITY_DECLARE_TEX2D_NOSAMPLER(name) TEXTURE2D(name); + #define UNITY_DECLARE_TEX2DARRAY(name) TEXTURE2D_ARRAY(name); SAMPLER(sampler##name); + #define UNITY_DECLARE_TEX2DARRAY_NOSAMPLER(name) TEXTURE2D_ARRAY(name); + + #define UNITY_SAMPLE_TEX2DARRAY(tex,coord) SAMPLE_TEXTURE2D_ARRAY(tex, sampler##tex, coord.xy, coord.z) + #define UNITY_SAMPLE_TEX2DARRAY_LOD(tex,coord,lod) SAMPLE_TEXTURE2D_ARRAY_LOD(tex, sampler##tex, coord.xy, coord.z, lod) + #define UNITY_SAMPLE_TEX2D(tex, coord) SAMPLE_TEXTURE2D(tex, sampler##tex, coord) + #define UNITY_SAMPLE_TEX2D_SAMPLER(tex, samp, coord) SAMPLE_TEXTURE2D(tex, sampler##samp, coord) + + #define UNITY_SAMPLE_TEX2D_LOD(tex,coord, lod) SAMPLE_TEXTURE2D_LOD(tex, sampler_##tex, coord, lod) + #define UNITY_SAMPLE_TEX2D_SAMPLER_LOD(tex,samplertex,coord, lod) SAMPLE_TEXTURE2D_LOD (tex, sampler##samplertex,coord, lod) + + #if defined(UNITY_COMPILER_HLSL) + #define UNITY_INITIALIZE_OUTPUT(type,name) name = (type)0; + #else + #define UNITY_INITIALIZE_OUTPUT(type,name) + #endif + + #define sampler2D_float sampler2D + #define sampler2D_half sampler2D + + + + // data across stages, stripped like the above. + struct VertexToPixel + { + float4 pos : SV_POSITION; + float3 worldPos : TEXCOORD0; + float3 worldNormal : TEXCOORD1; + float4 worldTangent : TEXCOORD2; + float4 texcoord0 : TEXCOORD3; + float4 texcoord1 : TEXCOORD4; + float4 texcoord2 : TEXCOORD5; + + // #if %TEXCOORD3REQUIREKEY% + float4 texcoord3 : TEXCOORD6; + // #endif + + // #if %SCREENPOSREQUIREKEY% + // float4 screenPos : TEXCOORD7; + // #endif + + // #if %VERTEXCOLORREQUIREKEY% + half4 vertexColor : COLOR; + // #endif + + // #if %EXTRAV2F0REQUIREKEY% + // float4 extraV2F0 : TEXCOORD12; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // float4 extraV2F1 : TEXCOORD13; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // float4 extraV2F2 : TEXCOORD14; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // float4 extraV2F3 : TEXCOORD15; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // float4 extraV2F4 : TEXCOORD16; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // float4 extraV2F5 : TEXCOORD17; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // float4 extraV2F6 : TEXCOORD18; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // float4 extraV2F7 : TEXCOORD19; + // #endif + + #if defined(LIGHTMAP_ON) + float2 lightmapUV : TEXCOORD8; + #endif + #if !defined(LIGHTMAP_ON) + float3 sh : TEXCOORD9; + #endif + float4 fogFactorAndVertexLight : TEXCOORD10; + float4 shadowCoord : TEXCOORD11; + #if UNITY_ANY_INSTANCING_ENABLED + uint instanceID : CUSTOM_INSTANCE_ID; + #endif + #if (defined(UNITY_STEREO_INSTANCING_ENABLED)) + uint stereoTargetEyeIndexAsRTArrayIdx : SV_RenderTargetArrayIndex; + #endif + #if (defined(UNITY_STEREO_MULTIVIEW_ENABLED)) || (defined(UNITY_STEREO_INSTANCING_ENABLED) && (defined(SHADER_API_GLES3) || defined(SHADER_API_GLCORE))) + uint stereoTargetEyeIndexAsBlendIdx0 : BLENDINDICES0; + #endif + #if defined(SHADER_STAGE_FRAGMENT) && defined(VARYINGS_NEED_CULLFACE) + FRONT_FACE_TYPE cullFace : FRONT_FACE_SEMANTIC; + #endif + }; + + + + + // data describing the user output of a pixel + struct Surface + { + half3 Albedo; + half Height; + half3 Normal; + half Smoothness; + half3 Emission; + half Metallic; + half3 Specular; + half Occlusion; + half SpecularPower; // for simple lighting + half Alpha; + float outputDepth; // if written, SV_Depth semantic is used. ShaderData.clipPos.z is unused value + // HDRP Only + half SpecularOcclusion; + half SubsurfaceMask; + half Thickness; + half CoatMask; + half CoatSmoothness; + half Anisotropy; + half IridescenceMask; + half IridescenceThickness; + int DiffusionProfileHash; + float SpecularAAThreshold; + float SpecularAAScreenSpaceVariance; + // requires _OVERRIDE_BAKEDGI to be defined, but is mapped in all pipelines + float3 DiffuseGI; + float3 BackDiffuseGI; + float3 SpecularGI; + float ior; + float3 transmittanceColor; + float atDistance; + float transmittanceMask; + // requires _OVERRIDE_SHADOWMASK to be defines + float4 ShadowMask; + + // for decals + float NormalAlpha; + float MAOSAlpha; + + + }; + + // Data the user declares in blackboard blocks + struct Blackboard + { + + float blackboardDummyData; + }; + + // data the user might need, this will grow to be big. But easy to strip + struct ShaderData + { + float4 clipPos; // SV_POSITION + float3 localSpacePosition; + float3 localSpaceNormal; + float3 localSpaceTangent; + + float3 worldSpacePosition; + float3 worldSpaceNormal; + float3 worldSpaceTangent; + float tangentSign; + + float3 worldSpaceViewDir; + float3 tangentSpaceViewDir; + + float4 texcoord0; + float4 texcoord1; + float4 texcoord2; + float4 texcoord3; + + float2 screenUV; + float4 screenPos; + + float4 vertexColor; + bool isFrontFace; + + float4 extraV2F0; + float4 extraV2F1; + float4 extraV2F2; + float4 extraV2F3; + float4 extraV2F4; + float4 extraV2F5; + float4 extraV2F6; + float4 extraV2F7; + + float3x3 TBNMatrix; + Blackboard blackboard; + }; + + struct VertexData + { + #if SHADER_TARGET > 30 + // uint vertexID : SV_VertexID; + #endif + float4 vertex : POSITION; + float3 normal : NORMAL; + float4 tangent : TANGENT; + float4 texcoord0 : TEXCOORD0; + + // optimize out mesh coords when not in use by user or lighting system + #if _URP && (_USINGTEXCOORD1 || _PASSMETA || _PASSFORWARD || _PASSGBUFFER) + float4 texcoord1 : TEXCOORD1; + #endif + + #if _URP && (_USINGTEXCOORD2 || _PASSMETA || ((_PASSFORWARD || _PASSGBUFFER) && defined(DYNAMICLIGHTMAP_ON))) + float4 texcoord2 : TEXCOORD2; + #endif + + #if _STANDARD && (_USINGTEXCOORD1 || (_PASSMETA || ((_PASSFORWARD || _PASSGBUFFER || _PASSFORWARDADD) && LIGHTMAP_ON))) + float4 texcoord1 : TEXCOORD1; + #endif + #if _STANDARD && (_USINGTEXCOORD2 || (_PASSMETA || ((_PASSFORWARD || _PASSGBUFFER) && DYNAMICLIGHTMAP_ON))) + float4 texcoord2 : TEXCOORD2; + #endif + + + #if _HDRP + float4 texcoord1 : TEXCOORD1; + float4 texcoord2 : TEXCOORD2; + #endif + + // #if %TEXCOORD3REQUIREKEY% + float4 texcoord3 : TEXCOORD3; + // #endif + + // #if %VERTEXCOLORREQUIREKEY% + float4 vertexColor : COLOR; + // #endif + + #if _PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR)) + float3 previousPositionOS : TEXCOORD4; // Contain previous transform position (in case of skinning for example) + #if defined (_ADD_PRECOMPUTED_VELOCITY) + float3 precomputedVelocity : TEXCOORD5; // Add Precomputed Velocity (Alembic computes velocities on runtime side). + #endif + #endif + + UNITY_VERTEX_INPUT_INSTANCE_ID + }; + + struct TessVertex + { + float4 vertex : INTERNALTESSPOS; + float3 normal : NORMAL; + float4 tangent : TANGENT; + float4 texcoord0 : TEXCOORD0; + float4 texcoord1 : TEXCOORD1; + float4 texcoord2 : TEXCOORD2; + + // #if %TEXCOORD3REQUIREKEY% + float4 texcoord3 : TEXCOORD3; + // #endif + + // #if %VERTEXCOLORREQUIREKEY% + float4 vertexColor : COLOR; + // #endif + + // #if %EXTRAV2F0REQUIREKEY% + // float4 extraV2F0 : TEXCOORD5; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // float4 extraV2F1 : TEXCOORD6; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // float4 extraV2F2 : TEXCOORD7; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // float4 extraV2F3 : TEXCOORD8; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // float4 extraV2F4 : TEXCOORD9; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // float4 extraV2F5 : TEXCOORD10; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // float4 extraV2F6 : TEXCOORD11; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // float4 extraV2F7 : TEXCOORD12; + // #endif + + #if _PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR)) + float3 previousPositionOS : TEXCOORD13; // Contain previous transform position (in case of skinning for example) + #if defined (_ADD_PRECOMPUTED_VELOCITY) + float3 precomputedVelocity : TEXCOORD14; + #endif + #endif + + UNITY_VERTEX_INPUT_INSTANCE_ID + UNITY_VERTEX_OUTPUT_STEREO + }; + + struct ExtraV2F + { + float4 extraV2F0; + float4 extraV2F1; + float4 extraV2F2; + float4 extraV2F3; + float4 extraV2F4; + float4 extraV2F5; + float4 extraV2F6; + float4 extraV2F7; + Blackboard blackboard; + float4 time; + }; + + + float3 WorldToTangentSpace(ShaderData d, float3 normal) + { + return mul(d.TBNMatrix, normal); + } + + float3 TangentToWorldSpace(ShaderData d, float3 normal) + { + return mul(normal, d.TBNMatrix); + } + + // in this case, make standard more like SRPs, because we can't fix + // unity_WorldToObject in HDRP, since it already does macro-fu there + + #if _STANDARD + float3 TransformWorldToObject(float3 p) { return mul(unity_WorldToObject, float4(p, 1)); }; + float3 TransformObjectToWorld(float3 p) { return mul(unity_ObjectToWorld, float4(p, 1)); }; + float4 TransformWorldToObject(float4 p) { return mul(unity_WorldToObject, p); }; + float4 TransformObjectToWorld(float4 p) { return mul(unity_ObjectToWorld, p); }; + float4x4 GetWorldToObjectMatrix() { return unity_WorldToObject; } + float4x4 GetObjectToWorldMatrix() { return unity_ObjectToWorld; } + #if (defined(SHADER_API_D3D11) || defined(SHADER_API_XBOXONE) || defined(UNITY_COMPILER_HLSLCC) || defined(SHADER_API_PSSL) || (SHADER_TARGET_SURFACE_ANALYSIS && !SHADER_TARGET_SURFACE_ANALYSIS_MOJOSHADER)) + #define UNITY_SAMPLE_TEX2D_LOD(tex,coord, lod) tex.SampleLevel (sampler##tex,coord, lod) + #define UNITY_SAMPLE_TEX2D_SAMPLER_LOD(tex,samplertex,coord, lod) tex.SampleLevel (sampler##samplertex,coord, lod) + #else + #define UNITY_SAMPLE_TEX2D_LOD(tex,coord,lod) tex2D (tex,coord,0,lod) + #define UNITY_SAMPLE_TEX2D_SAMPLER_LOD(tex,samplertex,coord,lod) tex2D (tex,coord,0,lod) + #endif + + #undef GetWorldToObjectMatrix() + + #define GetWorldToObjectMatrix() unity_WorldToObject + + + #endif + + float3 GetCameraWorldPosition() + { + #if _HDRP + return GetCameraRelativePositionWS(_WorldSpaceCameraPos); + #else + return _WorldSpaceCameraPos; + #endif + } + + #if _GRABPASSUSED + #if _STANDARD + TEXTURE2D(%GRABTEXTURE%); + SAMPLER(sampler_%GRABTEXTURE%); + #endif + + half3 GetSceneColor(float2 uv) + { + #if _STANDARD + return SAMPLE_TEXTURE2D(%GRABTEXTURE%, sampler_%GRABTEXTURE%, uv).rgb; + #else + return SHADERGRAPH_SAMPLE_SCENE_COLOR(uv); + #endif + } + #endif + + + + #if _STANDARD + UNITY_DECLARE_DEPTH_TEXTURE(_CameraDepthTexture); + float GetSceneDepth(float2 uv) { return SAMPLE_DEPTH_TEXTURE(_CameraDepthTexture, uv); } + float GetLinear01Depth(float2 uv) { return Linear01Depth(GetSceneDepth(uv)); } + float GetLinearEyeDepth(float2 uv) { return LinearEyeDepth(GetSceneDepth(uv)); } + #else + float GetSceneDepth(float2 uv) { return SHADERGRAPH_SAMPLE_SCENE_DEPTH(uv); } + float GetLinear01Depth(float2 uv) { return Linear01Depth(GetSceneDepth(uv), _ZBufferParams); } + float GetLinearEyeDepth(float2 uv) { return LinearEyeDepth(GetSceneDepth(uv), _ZBufferParams); } + #endif + + float3 GetWorldPositionFromDepthBuffer(float2 uv, float3 worldSpaceViewDir) + { + float eye = GetLinearEyeDepth(uv); + float3 camView = mul((float3x3)GetObjectToWorldMatrix(), transpose(mul(GetWorldToObjectMatrix(), UNITY_MATRIX_I_V)) [2].xyz); + + float dt = dot(worldSpaceViewDir, camView); + float3 div = worldSpaceViewDir/dt; + float3 wpos = (eye * div) + GetCameraWorldPosition(); + return wpos; + } + + #if _HDRP + float3 ObjectToWorldSpacePosition(float3 pos) + { + return GetAbsolutePositionWS(TransformObjectToWorld(pos)); + } + #else + float3 ObjectToWorldSpacePosition(float3 pos) + { + return TransformObjectToWorld(pos); + } + #endif + + #if _STANDARD + UNITY_DECLARE_SCREENSPACE_TEXTURE(_CameraDepthNormalsTexture); + float3 GetSceneNormal(float2 uv, float3 worldSpaceViewDir) + { + float4 depthNorms = UNITY_SAMPLE_SCREENSPACE_TEXTURE(_CameraDepthNormalsTexture, uv); + float3 norms = DecodeViewNormalStereo(depthNorms); + norms = mul((float3x3)GetWorldToViewMatrix(), norms) * 0.5 + 0.5; + return norms; + } + #elif _HDRP && !_DECALSHADER + + float3 GetSceneNormal(float2 uv, float3 worldSpaceViewDir) + { + NormalData nd; + DecodeFromNormalBuffer(_ScreenSize.xy * uv, nd); + return nd.normalWS; + } + #elif _URP + #if (SHADER_LIBRARY_VERSION_MAJOR >= 10) + #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/DeclareNormalsTexture.hlsl" + #endif + + float3 GetSceneNormal(float2 uv, float3 worldSpaceViewDir) + { + #if (SHADER_LIBRARY_VERSION_MAJOR >= 10) + return SampleSceneNormals(uv); + #else + float3 wpos = GetWorldPositionFromDepthBuffer(uv, worldSpaceViewDir); + return normalize(-cross(ddx(wpos), ddy(wpos))) * 0.5 + 0.5; + #endif + + } + #endif + + #if _HDRP + + half3 UnpackNormalmapRGorAG(half4 packednormal) + { + // This do the trick + packednormal.x *= packednormal.w; + + half3 normal; + normal.xy = packednormal.xy * 2 - 1; + normal.z = sqrt(1 - saturate(dot(normal.xy, normal.xy))); + return normal; + } + half3 UnpackNormal(half4 packednormal) + { + #if defined(UNITY_NO_DXT5nm) + return packednormal.xyz * 2 - 1; + #else + return UnpackNormalmapRGorAG(packednormal); + #endif + } + #endif + #if _HDRP || _URP + + half3 UnpackScaleNormal(half4 packednormal, half scale) + { + #ifndef UNITY_NO_DXT5nm + // Unpack normal as DXT5nm (1, y, 1, x) or BC5 (x, y, 0, 1) + // Note neutral texture like "bump" is (0, 0, 1, 1) to work with both plain RGB normal and DXT5nm/BC5 + packednormal.x *= packednormal.w; + #endif + half3 normal; + normal.xy = (packednormal.xy * 2 - 1) * scale; + normal.z = sqrt(1 - saturate(dot(normal.xy, normal.xy))); + return normal; + } + + #endif + + + void GetSun(out float3 lightDir, out float3 color) + { + lightDir = float3(0.5, 0.5, 0); + color = 1; + #if _HDRP + if (_DirectionalLightCount > 0) + { + DirectionalLightData light = _DirectionalLightDatas[0]; + lightDir = -light.forward.xyz; + color = light.color; + } + #elif _STANDARD + lightDir = normalize(_WorldSpaceLightPos0.xyz); + color = _LightColor0.rgb; + #elif _URP + Light light = GetMainLight(); + lightDir = light.direction; + color = light.color; + #endif + } + + + + CBUFFER_START(UnityPerMaterial) + + + half4 _Color; + half4 _MainTex_ST, _MainTex_TexelSize; + half _Alpha, _AlphaCutoffValue; + + #if ATLAS_ON + half _MinXUV, _MaxXUV, _MinYUV, _MaxYUV; + #endif + + #if GLOW_ON + half4 _GlowColor; + half _Glow, _GlowGlobal; + #endif + + #if HSV_ON + half _HsvShift, _HsvSaturation, _HsvBright; + #endif + + #if DISTORT_ON + half4 _DistortTex_ST; + half _DistortTexXSpeed, _DistortTexYSpeed, _DistortAmount; + #endif + + #if FADE_ON + half4 _FadeBurnColor, _FadeTex_ST, _FadeBurnTex_ST; + half _FadeAmount, _FadeBurnWidth, _FadeBurnTransition,_FadeBurnGlow; + #endif + + #if OUTBASE_ON + half4 _OutlineColor; + half _OutlineAlpha, _OutlineGlow, _OutlineWidth; + int _OutlinePixelWidth; + #endif + + #if OUTTEX_ON + half4 _OutlineTex_ST; + half _OutlineTexXSpeed, _OutlineTexYSpeed; + #endif + + #if OUTDIST_ON + half4 _OutlineDistortTex_ST; + half _OutlineDistortTexXSpeed, _OutlineDistortTexYSpeed, _OutlineDistortAmount; + #endif + + #if ALPHAOUTLINE_ON + half _AlphaOutlineGlow, _AlphaOutlinePower, _AlphaOutlineMinAlpha, _AlphaOutlineBlend; + half4 _AlphaOutlineColor; + #endif + + #if INNEROUTLINE_ON + half _InnerOutlineThickness, _InnerOutlineAlpha, _InnerOutlineGlow; + half4 _InnerOutlineColor; + #endif + + #if GRADIENT_ON + half _GradBlend, _GradBoostX, _GradBoostY; + half4 _GradTopRightCol, _GradTopLeftCol, _GradBotRightCol, _GradBotLeftCol; + #endif + + #if COLORSWAP_ON + half4 _ColorSwapRed, _ColorSwapGreen, _ColorSwapBlue; + half _ColorSwapRedLuminosity, _ColorSwapGreenLuminosity, _ColorSwapBlueLuminosity, _ColorSwapBlend; + #endif + + #if CHANGECOLOR_ON + half4 _ColorChangeNewCol, _ColorChangeTarget; + half _ColorChangeTolerance, _ColorChangeLuminosity; + #endif + #if CHANGECOLOR2_ON + half4 _ColorChangeNewCol2, _ColorChangeTarget2; + half _ColorChangeTolerance2; + #endif + #if CHANGECOLOR3_ON + half4 _ColorChangeNewCol3, _ColorChangeTarget3; + half _ColorChangeTolerance3; + #endif + + #if COLORRAMP_ON + half _ColorRampLuminosity, _ColorRampBlend; + #endif + + #if HITEFFECT_ON + half4 _HitEffectColor; + half _HitEffectGlow, _HitEffectBlend; + #endif + + #if NEGATIVE_ON + half _NegativeAmount; + #endif + + #if PIXELATE_ON + half _PixelateSize; + #endif + + #if GREYSCALE_ON + half _GreyscaleLuminosity, _GreyscaleBlend; + half4 _GreyscaleTintColor; + #endif + + #if POSTERIZE_ON + half _PosterizeNumColors, _PosterizeGamma; + #endif + + #if BLUR_ON + half _BlurIntensity; + #endif + + #if MOTIONBLUR_ON + half _MotionBlurAngle, _MotionBlurDist; + #endif + + #if GHOST_ON + half _GhostColorBoost, _GhostTransparency, _GhostBlend; + #endif + + #if HOLOGRAM_ON + half _HologramStripesAmount, _HologramMinAlpha, _HologramUnmodAmount, _HologramStripesSpeed, _HologramMaxAlpha, _HologramBlend; + half4 _HologramStripeColor; + #endif + + #if CHROMABERR_ON + half _ChromAberrAmount, _ChromAberrAlpha; + #endif + + #if GLITCH_ON + half _GlitchAmount, _GlitchSize; + #endif + + #if FLICKER_ON + half _FlickerFreq, _FlickerPercent, _FlickerAlpha; + #endif + + #if SHADOW_ON + half _ShadowX, _ShadowY, _ShadowAlpha; + half4 _ShadowColor; + #endif + + #if SHINE_ON + half4 _ShineColor; + half _ShineLocation, _ShineRotate, _ShineWidth, _ShineGlow; + #endif + + #if CONTRAST_ON + half _Contrast, _Brightness; + #endif + + #if OVERLAY_ON + half4 _OverlayTex_ST, _OverlayColor; + half _OverlayGlow, _OverlayBlend, _OverlayTextureScrollXSpeed, _OverlayTextureScrollYSpeed; + #endif + + #if DOODLE_ON + half _HandDrawnAmount, _HandDrawnSpeed; + #endif + + #if WIND_ON + half _GrassSpeed, _GrassWind, _GrassManualAnim, _GrassRadialBend; + #endif + + #if WAVEUV_ON + float _WaveAmount, _WaveSpeed, _WaveStrength, _WaveX, _WaveY; + #endif + + #if ROUNDWAVEUV_ON + half _RoundWaveStrength, _RoundWaveSpeed; + #endif + + #if RECTSIZE_ON + half _RectSize; + #endif + + #if OFFSETUV_ON + half _OffsetUvX, _OffsetUvY; + #endif + + #if CLIPPING_ON + half _ClipUvLeft, _ClipUvRight, _ClipUvUp, _ClipUvDown; + #endif + + #if RADIALCLIPPING_ON + half _RadialStartAngle, _RadialClip, _RadialClip2; + #endif + + #if TEXTURESCROLL_ON + half _TextureScrollXSpeed, _TextureScrollYSpeed; + #endif + + #if ZOOMUV_ON + half _ZoomUvAmount; + #endif + + #if WARP_ON + half _WarpStrength, _WarpSpeed, _WarpScale; + #endif + + #if TWISTUV_ON + half _TwistUvAmount, _TwistUvPosX, _TwistUvPosY, _TwistUvRadius; + #endif + + #if ROTATEUV_ON + half _RotateUvAmount; + #endif + + #if FISHEYE_ON + half _FishEyeUvAmount; + #endif + + #if PINCH_ON + half _PinchUvAmount; + #endif + + #if SHAKEUV_ON + half _ShakeUvSpeed, _ShakeUvX, _ShakeUvY; + #endif + + #if NORMALMAP_ON + half _NormalStrength; + #endif + + float _RandomSeed; + + + + + CBUFFER_END + + + + + + + + TEXTURE2D(_MainTex); + SAMPLER(sampler_MainTex); + + #if GLOW_ON + TEXTURE2D(_GlowTex); + SAMPLER(sampler_GlowTex); + #endif + + #if FADE_ON + TEXTURE2D(_FadeTex); + SAMPLER(sampler_FadeTex); + + TEXTURE2D(_FadeBurnTex); + SAMPLER(sampler_FadeBurnTex); + #endif + + #if DISTORT_ON + TEXTURE2D(_DistortTex); + SAMPLER(sampler_DistortTex); + #endif + + #if OUTTEX_ON + TEXTURE2D(_OutlineTex); + SAMPLER(sampler_OutlineTex); + #endif + + #if OUTDIST_ON + TEXTURE2D(_OutlineDistortTex); + SAMPLER(sampler_OutlineDistortTex); + #endif + + #if COLORSWAP_ON + TEXTURE2D(_ColorSwapTex); + SAMPLER(sampler_ColorSwapTex); + #endif + + #if COLORRAMP_ON + TEXTURE2D(_ColorRampTex); + TEXTURE2D(_ColorRampTexGradient); + SAMPLER(sampler_ColorRampTex); + SAMPLER(sampler_ColorRampTexGradient); + #endif + + #if SHINE_ON + TEXTURE2D(_ShineMask); + SAMPLER(sampler_ShineMask); + #endif + + #if OVERLAY_ON + TEXTURE2D(_OverlayTex); + SAMPLER(sampler_OverlayTex); + #endif + + #if NORMALMAP_ON + TEXTURE2D(_NormalMap); + SAMPLER(sampler_NormalMap); + #endif + + + half3 GetPixel(in int offsetX, in int offsetY, in half2 uv, in Texture2D _tex, in SamplerState _sampler) + { + half2 _uv = uv + half2(offsetX * _MainTex_TexelSize.x, offsetY * _MainTex_TexelSize.y); + half4 col = SAMPLE_TEXTURE2D(_tex, _sampler, _uv); + return col.rgb; + } + + + //BLURS------------------------------------------------------------------------- + half4 Blur(half2 uv, Texture2D source, SamplerState sampler_source, half Intensity) + { + const half2 texelSize = 1.0 / _ScreenParams.xy; + const half4 color = SAMPLE_TEXTURE2D(source, sampler_source, uv); + const half2 offset = Intensity * texelSize; + + half4 accumulatedColor = color; + half accumulatedWeight = 1.0; + for (int x = -1; x <= 1; x++) + { + for (int y = -1; y <= 1; y++) + { + const half2 sampleUV = uv + half2(x, y) * offset; + const half4 sampleColor = SAMPLE_TEXTURE2D(source, sampler_source, sampleUV); + + accumulatedColor += sampleColor; + accumulatedWeight += 1.0; + } + } + + half4 blurredColor = accumulatedColor / accumulatedWeight; + return blurredColor; + } + + half BlurHD_G(half bhqp, half x) + { + return exp(-(x * x) / (2.0 * bhqp * bhqp)); + } + half4 BlurHD(half2 uv, Texture2D source, SamplerState sampler_source, half BlurAmount, half xScale, half yScale) + { + int iterations = 16; + int halfIterations = iterations / 2; + half sigmaX = 0.1 + BlurAmount * 0.5; + half sigmaY = sigmaX; + half total = 0.0; + half4 ret = half4(0, 0, 0, 0); + for (int iy = 0; iy < iterations; ++iy) + { + half fy = BlurHD_G(sigmaY, half(iy) -half(halfIterations)); + half offsetY = half(iy - halfIterations) * 0.00390625 * xScale; + for (int ix = 0; ix < iterations; ++ix) + { + half fx = BlurHD_G(sigmaX, half(ix) - half(halfIterations)); + half offsetX = half(ix - halfIterations) * 0.00390625 * yScale; + total += fx * fy; + ret += SAMPLE_TEXTURE2D(source, sampler_source, uv + half2(offsetX, offsetY)) * fx * fy; + } + } + return ret / total; + } + //----------------------------------------------------------------------- + + + //------------------------------------------- + half RemapFloat(half inValue, half inMin, half inMax, half outMin, half outMax){ + return outMin + (inValue - inMin) * (outMax - outMin) / (inMax - inMin); + } + //------------------------------------------- + + //----------------------------------------------------------------------- + half rand(half2 seed, half offset) { + return (frac(sin(dot(seed, half2(12.9898, 78.233))) * 43758.5453) + offset) % 1.0; + } + + half rand2(half2 seed, half offset) { + return (frac(sin(dot(seed * floor(50 + (_Time.x % 1.0) * 12.), half2(127.1, 311.7))) * 43758.5453123) + offset) % 1.0; + } + + half rand2CustomTime(half2 seed, half offset, half customTime) { + return (frac(sin(dot(seed * floor(50 + (customTime % 1.0) * 12.), half2(127.1, 311.7))) * 43758.5453123) + offset) % 1.0; + } + //----------------------------------------------------------------------- + + + void Ext_ModifyVertex0 (inout VertexData v, inout ExtraV2F d) + { + //BILBOARD_ON + #if BILBOARD_ON + half3 camRight = mul((half3x3)unity_CameraToWorld, half3(1,0,0)); + half3 camUp = half3(0,1,0); + #if BILBOARDY_ON + camUp = mul((half3x3)unity_CameraToWorld, half3(0,1,0)); + #endif + half3 localPos = v.vertex.x * camRight + v.vertex.y * camUp; + v.vertex = half4(localPos, 1); + #endif + //----------------------------------------------------------- + + v.texcoord0.xy = TRANSFORM_TEX(v.texcoord0.xy, _MainTex); + half2 center = half2(0.5, 0.5); + #if ATLAS_ON + center = half2((_MaxXUV + _MinXUV) / 2.0, (_MaxYUV + _MinYUV) / 2.0); + #endif + + //POLARUV_ON + #if POLARUV_ON + v.texcoord0.xy = v.texcoord0.xy - center; + #endif + + //---------------------------------------- + + //ROTATEUV_ON + #if ROTATEUV_ON + half2 uvC = v.texcoord0.xy; + half cosAngle = cos(_RotateUvAmount); + half sinAngle = sin(_RotateUvAmount); + half2x2 rot = half2x2(cosAngle, -sinAngle, sinAngle, cosAngle); + uvC -= center; + v.texcoord0.xy = mul(rot, uvC); + v.texcoord0.xy += center; + #endif + //-------------------- + + #if RECTSIZE_ON + v.vertex.xyz += (v.vertex.xyz * (_RectSize - 1.0)); + #endif + + #if OUTTEX_ON + v.texcoord1.xy = TRANSFORM_TEX(v.texcoord0.xy, _OutlineTex); + #endif + + #if OUTDIST_ON + v.texcoord2.xy = TRANSFORM_TEX(v.texcoord0.xy, _OutlineDistortTex); + #endif + + #if DISTORT_ON + v.texcoord3.xy = TRANSFORM_TEX(v.texcoord0.xy, _DistortTex); + #endif + } + + void Ext_SurfaceFunction0 (inout Surface o, ShaderData d) + { + half randomSeed = _RandomSeed; + + float2 uvRect = d.texcoord0; + half2 center = half2(0.5, 0.5); + #if ATLAS_ON + center = half2((_MaxXUV + _MinXUV) / 2.0, (_MaxYUV + _MinYUV) / 2.0); + uvRect = half2((d.texcoord0.x - _MinXUV) / (_MaxXUV - _MinXUV), (d.texcoord0.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half2 centerTiled = half2(center.x * _MainTex_ST.x, center.y * _MainTex_ST.y); + + //CLIPPING_ON + #if CLIPPING_ON + half2 tiledUv = half2(d.texcoord0.x / _MainTex_ST.x, d.texcoord0.y / _MainTex_ST.y); + #if ATLAS_ON + tiledUv = half2((tiledUv.x - _MinXUV) / (_MaxXUV - _MinXUV), (tiledUv.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + clip((1 - _ClipUvUp) - tiledUv.y); + clip(tiledUv.y - _ClipUvDown); + clip((1 - _ClipUvRight) - tiledUv.x); + clip(tiledUv.x - _ClipUvLeft); + #endif + //---------------------------------- + + //RADIALCLIPPING_ON + #if RADIALCLIPPING_ON + half2 tiledUv2 = half2(d.texcoord0.x / _MainTex_ST.x, d.texcoord0.y / _MainTex_ST.y); + #if ATLAS_ON + tiledUv2 = half2((tiledUv2.x - _MinXUV) / (_MaxXUV - _MinXUV), (tiledUv2.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half startAngle = _RadialStartAngle - _RadialClip; + half endAngle = _RadialStartAngle + _RadialClip2; + half offset0 = clamp(0, 360, startAngle + 360); + half offset360 = clamp(0, 360, endAngle - 360); + half2 atan2Coord = half2(lerp(-1, 1, tiledUv2.x), lerp(-1, 1, tiledUv2.y)); + half atanAngle = atan2(atan2Coord.y, atan2Coord.x) * 57.3; // angle in degrees + if(atanAngle < 0) atanAngle = 360 + atanAngle; + if(atanAngle >= startAngle && atanAngle <= endAngle) discard; + if(atanAngle <= offset360) discard; + if(atanAngle >= offset0) discard; + #endif + + //----------------------------- + + //TEXTURESCROLL_ON && ATLAS_ON + #if TEXTURESCROLL_ON && ATLAS_ON + d.texcoord0.xy = half2(_MinXUV + ((_MaxXUV - _MinXUV) * (abs(((_Time.y + randomSeed) * _TextureScrollXSpeed) + uvRect.x) % 1)), + _MinYUV + ((_MaxYUV - _MinYUV) * (abs(((_Time.y + randomSeed) * _TextureScrollYSpeed) + uvRect.y) % 1))); + #endif + //---------------------------- + + //OFFSETUV_ON + #if OFFSETUV_ON + #if ATLAS_ON + d.texcoord0.xy = half2(_MinXUV + ((_MaxXUV - _MinXUV) * (abs((_OffsetUvX + uvRect.x) % 1))), + _MinYUV + ((_MaxYUV - _MinYUV) * (abs(_OffsetUvY + uvRect.y) % 1))); + #else + d.texcoord0.xy += half2(_OffsetUvX, _OffsetUvY); + #endif + #endif + + //---------------------- + + //POLARUV_ON + #if POLARUV_ON + d.texcoord0.xy = half2(atan2(d.texcoord0.y, d.texcoord0.x) / (2.0f * 3.141592653589f), length(d.texcoord0.xy)); + d.texcoord0.xy *= _MainTex_ST.xy; + #endif + + //-------------------------------------- + + //TWISTUV_ON + #if TWISTUV_ON + #if ATLAS_ON + _TwistUvPosX = ((_MaxXUV - _MinXUV) * _TwistUvPosX) + _MinXUV; + _TwistUvPosY = ((_MaxYUV - _MinYUV) * _TwistUvPosY) + _MinYUV; + #endif + half2 tempUv = d.texcoord0.xy - half2(_TwistUvPosX * _MainTex_ST.x, _TwistUvPosY * _MainTex_ST.y); + _TwistUvRadius *= (_MainTex_ST.x + _MainTex_ST.y) / 2; + half percent = (_TwistUvRadius - length(tempUv)) / _TwistUvRadius; + half theta = percent * percent * (2.0 * sin(_TwistUvAmount)) * 8.0; + half s = sin(theta); + half c = cos(theta); + half beta = max(sign(_TwistUvRadius - length(tempUv)), 0.0); + tempUv = half2(dot(tempUv, half2(c, -s)), dot(tempUv, half2(s, c))) * beta + tempUv * (1 - beta); + tempUv += half2(_TwistUvPosX * _MainTex_ST.x, _TwistUvPosY * _MainTex_ST.y); + d.texcoord0.xy = tempUv; + #endif + + //-------------------------------------------- + + //FISHEYE_ON + #if FISHEYE_ON + half bind = length(centerTiled); + half2 dF = d.texcoord0.xy - centerTiled; + half dFlen = length(dF); + half fishInt = (3.14159265359 / bind) * (_FishEyeUvAmount + 0.001); + d.texcoord0.xy = centerTiled + (dF / (max(0.0001, dFlen))) * tan(dFlen * fishInt) * bind / tan(bind * fishInt); + #endif + //--------------------------------------------- + + //PINCH_ON + #if PINCH_ON + half2 dP = d.texcoord0.xy - centerTiled; + half pinchInt = (3.141592 / length(centerTiled)) * (-_PinchUvAmount + 0.001); + d.texcoord0.xy = centerTiled + normalize(dP) * atan(length(dP) * -pinchInt * 10.0) * 0.5 / atan(-pinchInt * 5); + #endif + + //--------------------------------------------- + + //ZOOMUV_ON + #if ZOOMUV_ON + d.texcoord0.xy -= centerTiled; + d.texcoord0.xy = d.texcoord0.xy * _ZoomUvAmount; + d.texcoord0.xy += centerTiled; + #endif + + //----------------------------------------------- + + //DOODLE_ON + #if DOODLE_ON + half2 uvCopy = uvRect; + _HandDrawnSpeed = (floor((_Time.x + randomSeed) * 20 * _HandDrawnSpeed) / _HandDrawnSpeed) * _HandDrawnSpeed; + uvCopy.x = sin((uvCopy.x * _HandDrawnAmount + _HandDrawnSpeed) * 4); + uvCopy.y = cos((uvCopy.y * _HandDrawnAmount + _HandDrawnSpeed) * 4); + d.texcoord0.xy = lerp(d.texcoord0.xy, d.texcoord0.xy + uvCopy, 0.0005 * _HandDrawnAmount); + #endif + + //-------------------------- + + //SHAKEUV_ON + #if SHAKEUV_ON + half xShake = sin((_Time.x + randomSeed) * _ShakeUvSpeed * 50) * _ShakeUvX; + half yShake = cos((_Time.x + randomSeed) * _ShakeUvSpeed * 50) * _ShakeUvY; + d.texcoord0.xy += half2(xShake * 0.012, yShake * 0.01); + #endif + + //------------------------------------------- + + //RECTSIZE_ON + #if RECTSIZE_ON + d.texcoord0.xy = d.texcoord0.xy * (_RectSize).xx + (((-_RectSize * 0.5) + 0.5)).xx; + #endif + + //------------------------------------------- + + //DISTORT_ON + #if DISTORT_ON + #if ATLAS_ON + d.texcoord3.x = d.texcoord3.x * (1 / (_MaxXUV - _MinXUV)); + d.texcoord3.y = d.texcoord3.y * (1 / (_MaxYUV - _MinYUV)); + #endif + + d.texcoord3.x += ((_Time.x + _RandomSeed) * _DistortTexXSpeed) % 1; + d.texcoord3.y += ((_Time.x + _RandomSeed) * _DistortTexYSpeed) % 1; + half distortAmnt = (SAMPLE_TEXTURE2D(_DistortTex, sampler_DistortTex, d.texcoord3.xy).r - 0.5) * 0.2 * _DistortAmount; + d.texcoord0.x += distortAmnt; + d.texcoord0.y += distortAmnt; + #endif + //------------------------------------------------------- + + //WARP_ON + #if WARP_ON + half2 warpUv = half2(d.texcoord0.x / _MainTex_ST.x, d.texcoord0.y / _MainTex_ST.y); + #if ATLAS_ON + warpUv = half2((warpUv.x - _MinXUV) / (_MaxXUV - _MinXUV), (warpUv.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + const float tau = 6.283185307179586; + float xWarp = (_Time.y + randomSeed) * _WarpSpeed + warpUv.x * tau / _WarpScale; + float yWarp = (_Time.y + randomSeed) * _WarpSpeed + warpUv.y * tau / _WarpScale; + float2 warp = float2(sin(xWarp), sin(yWarp)) * _WarpStrength; + d.texcoord0.xy += warp; + #endif + + //------------------------------------------------------- + + //WAVEUV_ON + #if WAVEUV_ON + float2 uvWave = half2(_WaveX * _MainTex_ST.x, _WaveY * _MainTex_ST.y) - d.texcoord0.xy; + uvWave %= 1; + #if ATLAS_ON + uvWave = half2(_WaveX, _WaveY) - uvRect; + #endif + uvWave.x *= _ScreenParams.x / _ScreenParams.y; + float waveTime = _Time.y + randomSeed; + float angWave = (sqrt(dot(uvWave, uvWave)) * _WaveAmount) - ((waveTime * _WaveSpeed)); + d.texcoord0.xy = d.texcoord0.xy + uvWave * sin(angWave) * (_WaveStrength / 1000.0); + #endif + //---------------------------------------------------- + + //ROUNDWAVEUV_ON + #if ROUNDWAVEUV_ON + half xWave = ((0.5 * _MainTex_ST.x) - uvRect.x); + half yWave = ((0.5 * _MainTex_ST.y) - uvRect.y) * (_MainTex_TexelSize.w / _MainTex_TexelSize.z); + half ripple = -sqrt(xWave*xWave + yWave* yWave); + d.texcoord0.xy += (sin((ripple + (_Time.y + randomSeed) * (_RoundWaveSpeed/10.0)) / 0.015) * (_RoundWaveStrength/10.0)) % 1; + #endif + //---------------------------------------------------- + + + //WIND_ON + #if WIND_ON + half windOffset = sin((_Time.x + randomSeed) * _GrassSpeed * 10); + half2 windCenter = half2(0.5, 0.1); + #if ATLAS_ON + windCenter.x = ((_MaxXUV - _MinXUV) * windCenter.x) + _MinXUV; + windCenter.y = ((_MaxYUV - _MinYUV) * windCenter.y) + _MinYUV; + #endif + #if !MANUALWIND_ON + d.texcoord0.x = fmod(abs(lerp(d.texcoord0.x, d.texcoord0.x + (_GrassWind * 0.01 * windOffset), uvRect.y)), 1); + #else + d.texcoord0.x = fmod(abs(lerp(d.texcoord0.x, d.texcoord0.x + (_GrassWind * 0.01 * _GrassManualAnim), uvRect.y)), 1); + windOffset = _GrassManualAnim; + #endif + half2 delta = d.texcoord0.xy - windCenter; + half delta2 = dot(delta.xy, delta.xy); + half2 delta_offset = delta2 * windOffset; + d.texcoord0.xy = d.texcoord0.xy + half2(delta.y, -delta.x) * delta_offset * _GrassRadialBend; + #endif + + //-------------------------------------------------------- + + //TEXTURESCROLL_ON && !ATLAS_ON + #if TEXTURESCROLL_ON && !ATLAS_ON + d.texcoord0.x += ((_Time.y + randomSeed) * _TextureScrollXSpeed) % 1; + d.texcoord0.y += ((_Time.y + randomSeed) * _TextureScrollYSpeed) % 1; + #endif + //------------------------------ + + //PIXELATE_ON + #if PIXELATE_ON + half aspectRatio = _MainTex_TexelSize.x / _MainTex_TexelSize.y; + half2 pixelSize = float2(_PixelateSize, _PixelateSize * aspectRatio); + d.texcoord0.xy = floor(d.texcoord0.xy * pixelSize) / pixelSize; + #endif + //-------------- + + half4 col = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy); + half originalAlpha = col.a; + col *= d.vertexColor; + + //NORMAL MAP + #if NORMALMAP_ON + half4 normalSample = SAMPLE_TEXTURE2D(_NormalMap, sampler_NormalMap, d.texcoord0.xy); + half3 normalTS = UnpackNormal(normalSample); + normalTS.xy *= _NormalStrength; + o.Normal = normalTS; + #endif + + + //GLITCH_ON + #if GLITCH_ON + half2 uvGlitch = uvRect; + uvGlitch.y -= 0.5; + half lineNoise = pow(rand2(floor(uvGlitch * half2(24., 19.) * _GlitchSize) * 4.0, randomSeed), 3.0) * _GlitchAmount + * pow(rand2(floor(uvGlitch * half2(38., 14.) * _GlitchSize) * 4.0, randomSeed), 3.0); + col = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(lineNoise * 0.02 * rand2(half2(2.0, 1), randomSeed), 0)) * d.vertexColor; + #endif + //-------------------------------------- + + //CHROMABERR_ON + #if CHROMABERR_ON + half4 r = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(_ChromAberrAmount/10, 0)) * d.vertexColor; + half4 b = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(-_ChromAberrAmount/10, 0)) * d.vertexColor; + col = half4(r.r * r.a, col.g, b.b * b.a, max(max(r.a, b.a) * _ChromAberrAlpha, col.a)); + #endif + + //-------------------------------- + + //BLUR_ON + #if BLUR_ON + #if ATLAS_ON + #if !BLURISHD_ON + col = BlurHD(d.texcoord0.xy, _MainTex, sampler_MainTex, _BlurIntensity, (_MaxXUV - _MinXUV), (_MaxYUV - _MinYUV)) * d.vertexColor; + #else + col = Blur(d.texcoord0.xy, _MainTex, sampler_MainTex, _BlurIntensity * (_MaxXUV - _MinXUV)) * d.vertexColor; + #endif + #else + #if !BLURISHD_ON + col = BlurHD(d.texcoord0.xy, _MainTex, sampler_MainTex, _BlurIntensity, 1, 1) * d.vertexColor; + #else + col = Blur(d.texcoord0.xy, _MainTex, sampler_MainTex, _BlurIntensity) * d.vertexColor; + #endif + #endif + #endif + + //-------------------- + + //MOTIONBLUR_ON + #if MOTIONBLUR_ON + _MotionBlurAngle = _MotionBlurAngle * 3.1415926; + #define rot(n) mul(n, half2x2(cos(_MotionBlurAngle), -sin(_MotionBlurAngle), sin(_MotionBlurAngle), cos(_MotionBlurAngle))) + _MotionBlurDist = _MotionBlurDist * 0.005; + #if ATLAS_ON + _MotionBlurDist *= (_MaxXUV - _MinXUV); + #endif + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(-_MotionBlurDist, -_MotionBlurDist))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(-_MotionBlurDist * 2, -_MotionBlurDist * 2))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(-_MotionBlurDist * 3, -_MotionBlurDist * 3))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(-_MotionBlurDist * 4, -_MotionBlurDist * 4))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(_MotionBlurDist, _MotionBlurDist))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(_MotionBlurDist * 2, _MotionBlurDist * 2))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(_MotionBlurDist * 3, _MotionBlurDist * 3))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(_MotionBlurDist * 4, _MotionBlurDist * 4))); + col.rgb = col.rgb / 9; + #endif + //------------------------------------ + + //NEGATIVE_ON + #if NEGATIVE_ON + col.rgb = lerp(col.rgb, 1 - col.rgb, _NegativeAmount); + #endif + + //-------------- + half luminance = 0; + + //GREYSCALE_ON && !GREYSCALEOUTLINE_ON + #if GREYSCALE_ON && !GREYSCALEOUTLINE_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + luminance = saturate(luminance + _GreyscaleLuminosity); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _GreyscaleTintColor, _GreyscaleBlend); + #endif + //------------------------------------ + + //GHOST_ON + #if GHOST_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + half4 ghostResult; + ghostResult.a = saturate(luminance - _GhostTransparency) * col.a; + ghostResult.rgb = col.rgb * (luminance + _GhostColorBoost); + col = lerp(col, ghostResult, _GhostBlend); + #endif + //------------------------------------ + + //INNEROUTLINE_ON + #if INNEROUTLINE_ON + half3 innerT = abs(GetPixel(0, _InnerOutlineThickness, d.texcoord0.xy, _MainTex, sampler_MainTex) - GetPixel(0, -_InnerOutlineThickness, d.texcoord0.xy, _MainTex, sampler_MainTex)); + innerT += abs(GetPixel(_InnerOutlineThickness, 0, d.texcoord0.xy, _MainTex, sampler_MainTex) - GetPixel(-_InnerOutlineThickness, 0, d.texcoord0.xy, _MainTex, sampler_MainTex)); + #if !ONLYINNEROUTLINE_ON + innerT = (innerT / 2.0) * col.a * _InnerOutlineAlpha; + col.rgb += length(innerT) * _InnerOutlineColor.rgb * _InnerOutlineGlow; + #else + innerT *= col.a * _InnerOutlineAlpha; + col.rgb = length(innerT) * _InnerOutlineColor.rgb * _InnerOutlineGlow; + col.a = step(0.3, col.r+col.g+col.b); + #endif + #endif + //------------------------------------------------------- + + //HITEFFECT_ON + #if HITEFFECT_ON + col.rgb = lerp(col.rgb, _HitEffectColor.rgb * _HitEffectGlow, _HitEffectBlend); + #endif + //-------------------- + + //GRADIENT_ON + #if GRADIENT_ON + half2 tiledUvGrad = half2(uvRect.x / _MainTex_ST.x, uvRect.y / _MainTex_ST.y); + #if GRADIENT2COL_ON + _GradTopRightCol = _GradTopLeftCol; + _GradBotRightCol = _GradBotLeftCol; + #endif + #if RADIALGRADIENT_ON + half radialDist = 1 - length(tiledUvGrad - half2(0.5, 0.5)); + radialDist *= (_MainTex_TexelSize.w / _MainTex_TexelSize.z); + radialDist = saturate(_GradBoostX * radialDist); + half4 gradientResult = lerp(_GradTopLeftCol, _GradBotLeftCol, radialDist); + #else + half gradXLerpFactor = saturate(pow(tiledUvGrad.x, _GradBoostX)); + half4 gradientResult = lerp(lerp(_GradBotLeftCol, _GradBotRightCol, gradXLerpFactor), + lerp(_GradTopLeftCol, _GradTopRightCol, gradXLerpFactor), saturate(pow(tiledUvGrad.y, _GradBoostY))); + #endif + gradientResult = lerp(col, gradientResult, _GradBlend); + col.rgb = gradientResult.rgb * col.a; + col.a *= gradientResult.a; + #endif + //-------------------------------------------------------------------- + + //CONTRAST_ON + #if CONTRAST_ON + col.rgb = (col.rgb - float3(0.5, 0.5, 0.5)) * _Contrast + float3(0.5, 0.5, 0.5); + col.rgb += _Brightness; + #endif + + //------------------------------------------------------------------- + + //COLORSWAP_ON + #if COLORSWAP_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + half4 swapMask = SAMPLE_TEXTURE2D(_ColorSwapTex, sampler_ColorSwapTex, d.texcoord0.xy); + swapMask.rgb *= swapMask.a; + half3 redSwap = _ColorSwapRed * swapMask.r * saturate(luminance + _ColorSwapRedLuminosity); + half3 greenSwap = _ColorSwapGreen * swapMask.g * saturate(luminance + _ColorSwapGreenLuminosity); + half3 blueSwap = _ColorSwapBlue * swapMask.b * saturate(luminance + _ColorSwapBlueLuminosity); + swapMask.rgb = col.rgb * saturate(1 - swapMask.r - swapMask.g - swapMask.b); + col.rgb = lerp(col.rgb, swapMask.rgb + redSwap + greenSwap + blueSwap, _ColorSwapBlend); + #endif + //-------------------------------------------------------------------- + + //COLORRAMP_ON && !COLORRAMPOUTLINE_ON + #if COLORRAMP_ON && !COLORRAMPOUTLINE_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + luminance = saturate(luminance + _ColorRampLuminosity); + #if GRADIENTCOLORRAMP_ON + col.rgb = lerp(col.rgb, SAMPLE_TEXTURE2D(_ColorRampTexGradient, sampler_ColorRampTexGradient, half2(luminance, 0)).rgb, _ColorRampBlend); + #else + col.rgb = lerp(col.rgb, SAMPLE_TEXTURE2D(_ColorRampTex, sampler_ColorRampTex, half2(luminance, 0)).rgb, _ColorRampBlend); + #endif + #endif + //-------------------------------------------------------------------- + + //CHANGECOLOR_ON + #if CHANGECOLOR_ON + float3 currChangeColor = saturate(col.rgb); + luminance = 0.3 * currChangeColor.r + 0.59 * currChangeColor.g + 0.11 * currChangeColor.b; + luminance = saturate(luminance + _ColorChangeLuminosity); + half3 dif = abs(currChangeColor - _ColorChangeTarget.rgb); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _ColorChangeNewCol.rgb, + max(sign(1 - saturate(dif.x + dif.y + dif.z) - _ColorChangeTolerance), 0.0)); + #if CHANGECOLOR2_ON + dif = abs(currChangeColor - _ColorChangeTarget2.rgb); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _ColorChangeNewCol2.rgb, + max(sign(1 - saturate(dif.x + dif.y + dif.z) - _ColorChangeTolerance2), 0.0)); + #endif + #if CHANGECOLOR3_ON + dif = abs(currChangeColor - _ColorChangeTarget3.rgb); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _ColorChangeNewCol3.rgb, + max(sign(1 - saturate(dif.x + dif.y + dif.z) - _ColorChangeTolerance3), 0.0)); + #endif + #endif + //------------------------------------------------------- + + //POSTERIZE_ON && !POSTERIZEOUTLINE_ON + #if POSTERIZE_ON && !POSTERIZEOUTLINE_ON + col.rgb = pow(col.rgb, _PosterizeGamma) * _PosterizeNumColors; + col.rgb = floor(col.rgb) / _PosterizeNumColors; + col.rgb = pow(col.rgb, 1.0 / _PosterizeGamma); + #endif + //------------------------------------ + + //HSV_ON + #if HSV_ON + half3 resultHsv = half3(col.rgb); + half cosHsv = _HsvBright * _HsvSaturation * cos(_HsvShift * 3.14159265 / 180); + half sinHsv = _HsvBright * _HsvSaturation * sin(_HsvShift * 3.14159265 / 180); + resultHsv.x = (.299 * _HsvBright + .701 * cosHsv + .168 * sinHsv) * col.x + + (.587 * _HsvBright - .587 * cosHsv + .330 * sinHsv) * col.y + + (.114 * _HsvBright - .114 * cosHsv - .497 * sinHsv) * col.z; + resultHsv.y = (.299 * _HsvBright - .299 * cosHsv - .328 * sinHsv) *col.x + + (.587 * _HsvBright + .413 * cosHsv + .035 * sinHsv) * col.y + + (.114 * _HsvBright - .114 * cosHsv + .292 * sinHsv) * col.z; + resultHsv.z = (.299 * _HsvBright - .3 * cosHsv + 1.25 * sinHsv) * col.x + + (.587 * _HsvBright - .588 * cosHsv - 1.05 * sinHsv) * col.y + + (.114 * _HsvBright + .886 * cosHsv - .203 * sinHsv) * col.z; + col.rgb = resultHsv; + #endif + //------------------------------------------------------- + + //OVERLAY_ON + #if OVERLAY_ON + half2 overlayUvs = d.texcoord0.xy; + overlayUvs.x += ((_Time.y + randomSeed) * _OverlayTextureScrollXSpeed) % 1; + overlayUvs.y += ((_Time.y + randomSeed) * _OverlayTextureScrollYSpeed) % 1; + half4 overlayCol = SAMPLE_TEXTURE2D(_OverlayTex, sampler_OverlayTex, TRANSFORM_TEX(overlayUvs, _OverlayTex)); + overlayCol.rgb *= _OverlayColor.rgb * _OverlayGlow; + #if !OVERLAYMULT_ON + overlayCol.rgb *= overlayCol.a * _OverlayColor.rgb * _OverlayColor.a * _OverlayBlend; + col.rgb += overlayCol.rgb; + #else + overlayCol.a *= _OverlayColor.a; + col = lerp(col, col * overlayCol, _OverlayBlend); + #endif + #endif + + //--------------------------------- + + //OUTBASE_ON + #if OUTBASE_ON + #if OUTBASEPIXELPERF_ON + half2 destUv = half2(_OutlinePixelWidth * _MainTex_TexelSize.x, _OutlinePixelWidth * _MainTex_TexelSize.y); + #else + half2 destUv = half2(_OutlineWidth * _MainTex_TexelSize.x * 200, _OutlineWidth * _MainTex_TexelSize.y * 200); + #endif + + #if OUTDIST_ON + d.texcoord3.x += ((_Time.x + _RandomSeed) * _OutlineDistortTexXSpeed) % 1; + d.texcoord3.y += ((_Time.x + _RandomSeed) * _OutlineDistortTexYSpeed) % 1; + #if ATLAS_ON + d.texcoord3 = half2((d.texcoord3.x - _MinXUV) / (_MaxXUV - _MinXUV), (d.texcoord3.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half outDistortAmnt = (SAMPLE_TEXTURE2D(_OutlineDistortTex, sampler_OutlineDistortTex, d.texcoord3).r - 0.5) * 0.2 * _OutlineDistortAmount; + destUv.x += outDistortAmnt; + destUv.y += outDistortAmnt; + #endif + + half spriteLeft = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(destUv.x, 0)).a; + half spriteRight = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy - half2(destUv.x, 0)).a; + half spriteBottom = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(0, destUv.y)).a; + half spriteTop = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy - half2(0, destUv.y)).a; + half result = spriteLeft + spriteRight + spriteBottom + spriteTop; + + #if OUTBASE8DIR_ON + half spriteTopLeft = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(destUv.x, destUv.y)).a; + half spriteTopRight = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(-destUv.x, destUv.y)).a; + half spriteBotLeft = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(destUv.x, -destUv.y)).a; + half spriteBotRight = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(-destUv.x, -destUv.y)).a; + result = result + spriteTopLeft + spriteTopRight + spriteBotLeft + spriteBotRight; + #endif + + result = step(0.05, saturate(result)); + + #if OUTTEX_ON + d.texcoord1.x += ((_Time.x + _RandomSeed) * _OutlineTexXSpeed) % 1; + d.texcoord1.y += ((_Time.x + _RandomSeed) * _OutlineTexYSpeed) % 1; + #if ATLAS_ON + d.texcoord1 = half2((d.texcoord1.x - _MinXUV) / (_MaxXUV - _MinXUV), (d.texcoord1.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half4 tempOutColor = SAMPLE_TEXTURE2D(_OutlineTex, sampler_OutlineTex, d.texcoord1); + tempOutColor *= _OutlineColor; + _OutlineColor = tempOutColor; + #endif + + result *= (1 - originalAlpha) * _OutlineAlpha; + + half4 outline = _OutlineColor * d.vertexColor.a; + outline.rgb *= _OutlineGlow; + outline.a = result; + #if ONLYOUTLINE_ON + col = outline; + #else + col = lerp(col, outline, result); + #endif + #endif + //------------------------------------------------------- + + //FADE_ON + #if FADE_ON + half2 tiledUvFade1 = TRANSFORM_TEX(d.texcoord0, _FadeTex); + half2 tiledUvFade2 = TRANSFORM_TEX(d.texcoord0, _FadeBurnTex); + #if ATLAS_ON + tiledUvFade1 = half2((tiledUvFade1.x - _MinXUV) / (_MaxXUV - _MinXUV), (tiledUvFade1.y - _MinYUV) / (_MaxYUV - _MinYUV)); + tiledUvFade2 = half2((tiledUvFade2.x - _MinXUV) / (_MaxXUV - _MinXUV), (tiledUvFade2.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half fadeTemp = SAMPLE_TEXTURE2D(_FadeTex, sampler_FadeTex, tiledUvFade1).r; + half fade = smoothstep(_FadeAmount, _FadeAmount + _FadeBurnTransition, fadeTemp); + half fadeBurn = saturate(smoothstep(_FadeAmount - _FadeBurnWidth, _FadeAmount - _FadeBurnWidth + 0.1, fadeTemp) * _FadeAmount); + col.a *= fade; + _FadeBurnColor.rgb *= _FadeBurnGlow; + col += fadeBurn * SAMPLE_TEXTURE2D(_FadeBurnTex, sampler_FadeBurnTex, tiledUvFade2) * _FadeBurnColor * originalAlpha * (1 - col.a); + #endif + //------------------------------------------------------- + + //SHADOW_ON + #if SHADOW_ON + half shadowA = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(_ShadowX, _ShadowY)).a; + half preMultShadowMask = 1 - (saturate(shadowA - col.a) * (1 - col.a)); + col.rgb *= 1 - ((shadowA - col.a) * (1 - col.a)); + col.rgb += (_ShadowColor * shadowA) * (1 - col.a); + col.a = max(shadowA * _ShadowAlpha * d.vertexColor.a, col.a); + #endif + + //------------------------------------------------------- + + //GLOW_ON + #if GLOW_ON + half4 emission; + #if GLOWTEX_ON + emission = SAMPLE_TEXTURE2D(_GlowTex, sampler_GlowTex, d.texcoord0); + #else + emission = col; + #endif + + col.rgb *= _GlowGlobal; + emission.rgb *= emission.a * col.a * _Glow * _GlowColor; + col.rgb += emission.rgb; + #endif + //------------------------------------------------------- + + //COLORRAMP_ON && COLORRAMPOUTLINE_ON + #if COLORRAMP_ON && COLORRAMPOUTLINE_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + luminance = saturate(luminance + _ColorRampLuminosity); + #if GRADIENTCOLORRAMP_ON + col.rgb = lerp(col.rgb, SAMPLE_TEXTURE2D(_ColorRampTexGradient, sampler_ColorRampTexGradient, half2(luminance, 0)).rgb, _ColorRampBlend); + #else + col.rgb = lerp(col.rgb, SAMPLE_TEXTURE2D(_ColorRampTex, sampler_ColorRampTex, half2(luminance, 0)).rgb, _ColorRampBlend); + #endif + #endif + //--------------- + + //GREYSCALE_ON && GREYSCALEOUTLINE_ON + #if GREYSCALE_ON && GREYSCALEOUTLINE_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + luminance = saturate(luminance + _GreyscaleLuminosity); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _GreyscaleTintColor, _GreyscaleBlend); + #endif + + //----------------------------------- + + //POSTERIZE_ON && POSTERIZEOUTLINE_ON + #if POSTERIZE_ON && POSTERIZEOUTLINE_ON + col.rgb = pow(col.rgb, _PosterizeGamma) * _PosterizeNumColors; + col.rgb = floor(col.rgb) / _PosterizeNumColors; + col.rgb = pow(col.rgb, 1.0 / _PosterizeGamma); + #endif + + //----------------------------------- + + //SHINE_ON + #if SHINE_ON + half2 uvShine = uvRect; + half cosAngle = cos(_ShineRotate); + half sinAngle = sin(_ShineRotate); + half2x2 rot = half2x2(cosAngle, -sinAngle, sinAngle, cosAngle); + uvShine -= half2(0.5, 0.5); + uvShine = mul(rot, uvShine); + uvShine += half2(0.5, 0.5); + half shineMask = SAMPLE_TEXTURE2D(_ShineMask, sampler_ShineMask, d.texcoord0.xy).a; + half currentDistanceProjection = (uvShine.x + uvShine.y) / 2; + half whitePower = 1 - (abs(currentDistanceProjection - _ShineLocation) / _ShineWidth); + col.rgb += col.a * whitePower * _ShineGlow * max(sign(currentDistanceProjection - (_ShineLocation - _ShineWidth)), 0.0) + * max(sign((_ShineLocation + _ShineWidth) - currentDistanceProjection), 0.0) * _ShineColor * shineMask; + #endif + + //----------------------------------- + + //HOLOGRAM_ON + #if HOLOGRAM_ON + half totalHologram = _HologramStripesAmount + _HologramUnmodAmount; + half hologramYCoord = ((uvRect.y + (((_Time.x + randomSeed) % 1) * _HologramStripesSpeed)) % totalHologram) / totalHologram; + hologramYCoord = abs(hologramYCoord); + half alpha = RemapFloat(saturate(hologramYCoord - (_HologramUnmodAmount/totalHologram)), 0.0, 1.0, _HologramMinAlpha, saturate(_HologramMaxAlpha)); + half hologramMask = max(sign((_HologramUnmodAmount/totalHologram) - hologramYCoord), 0.0); + half4 hologramResult = col; + hologramResult.a *= lerp(alpha, 1, hologramMask); + hologramResult.rgb *= max(1, _HologramMaxAlpha * max(sign(hologramYCoord - (_HologramUnmodAmount/totalHologram)), 0.0)); + hologramMask = 1 - step(0.01,hologramMask); + hologramResult.rgb += hologramMask * _HologramStripeColor * col.a; + col = lerp(col, hologramResult, _HologramBlend); + #endif + + //----------------------------------- + + //FLICKER_ON + #if FLICKER_ON + col.a *= saturate(col.a * step(frac(0.05 + (_Time.w + randomSeed) * _FlickerFreq), 1 - _FlickerPercent) + _FlickerAlpha); + #endif + //----------------------------------- + + //ALPHACUTOFF_ON + + //ALPHAROUND_ON + + //ALPHAOUTLINE_ON + #if ALPHAOUTLINE_ON + half alphaOutlineRes = pow(1 - col.a, max(_AlphaOutlinePower, 0.0001)) * step(_AlphaOutlineMinAlpha, col.a) * _AlphaOutlineBlend; + col.rgb = lerp(col.rgb, _AlphaOutlineColor.rgb * _AlphaOutlineGlow, alphaOutlineRes); + col.a = lerp(col.a, 1, alphaOutlineRes > 1); + #endif + //------------------------------------------------------- + + //FOG_ON + + //------------------ + + col *= _Color; + o.Albedo = col; + col.a *= _Alpha; + clip(col.a - _AlphaCutoffValue - 0.01); + o.Alpha = _Color.a; + } + + + + + + void ChainSurfaceFunction(inout Surface l, inout ShaderData d) + { + Ext_SurfaceFunction0(l, d); + // Ext_SurfaceFunction1(l, d); + // Ext_SurfaceFunction2(l, d); + // Ext_SurfaceFunction3(l, d); + // Ext_SurfaceFunction4(l, d); + // Ext_SurfaceFunction5(l, d); + // Ext_SurfaceFunction6(l, d); + // Ext_SurfaceFunction7(l, d); + // Ext_SurfaceFunction8(l, d); + // Ext_SurfaceFunction9(l, d); + // Ext_SurfaceFunction10(l, d); + // Ext_SurfaceFunction11(l, d); + // Ext_SurfaceFunction12(l, d); + // Ext_SurfaceFunction13(l, d); + // Ext_SurfaceFunction14(l, d); + // Ext_SurfaceFunction15(l, d); + // Ext_SurfaceFunction16(l, d); + // Ext_SurfaceFunction17(l, d); + // Ext_SurfaceFunction18(l, d); + // Ext_SurfaceFunction19(l, d); + // Ext_SurfaceFunction20(l, d); + // Ext_SurfaceFunction21(l, d); + // Ext_SurfaceFunction22(l, d); + // Ext_SurfaceFunction23(l, d); + // Ext_SurfaceFunction24(l, d); + // Ext_SurfaceFunction25(l, d); + // Ext_SurfaceFunction26(l, d); + // Ext_SurfaceFunction27(l, d); + // Ext_SurfaceFunction28(l, d); + // Ext_SurfaceFunction29(l, d); + } + +#if !_DECALSHADER + + void ChainModifyVertex(inout VertexData v, inout VertexToPixel v2p, float4 time) + { + ExtraV2F d; + + ZERO_INITIALIZE(ExtraV2F, d); + ZERO_INITIALIZE(Blackboard, d.blackboard); + // due to motion vectors in HDRP, we need to use the last + // time in certain spots. So if you are going to use _Time to adjust vertices, + // you need to use this time or motion vectors will break. + d.time = time; + + Ext_ModifyVertex0(v, d); + // Ext_ModifyVertex1(v, d); + // Ext_ModifyVertex2(v, d); + // Ext_ModifyVertex3(v, d); + // Ext_ModifyVertex4(v, d); + // Ext_ModifyVertex5(v, d); + // Ext_ModifyVertex6(v, d); + // Ext_ModifyVertex7(v, d); + // Ext_ModifyVertex8(v, d); + // Ext_ModifyVertex9(v, d); + // Ext_ModifyVertex10(v, d); + // Ext_ModifyVertex11(v, d); + // Ext_ModifyVertex12(v, d); + // Ext_ModifyVertex13(v, d); + // Ext_ModifyVertex14(v, d); + // Ext_ModifyVertex15(v, d); + // Ext_ModifyVertex16(v, d); + // Ext_ModifyVertex17(v, d); + // Ext_ModifyVertex18(v, d); + // Ext_ModifyVertex19(v, d); + // Ext_ModifyVertex20(v, d); + // Ext_ModifyVertex21(v, d); + // Ext_ModifyVertex22(v, d); + // Ext_ModifyVertex23(v, d); + // Ext_ModifyVertex24(v, d); + // Ext_ModifyVertex25(v, d); + // Ext_ModifyVertex26(v, d); + // Ext_ModifyVertex27(v, d); + // Ext_ModifyVertex28(v, d); + // Ext_ModifyVertex29(v, d); + + + // #if %EXTRAV2F0REQUIREKEY% + // v2p.extraV2F0 = d.extraV2F0; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // v2p.extraV2F1 = d.extraV2F1; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // v2p.extraV2F2 = d.extraV2F2; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // v2p.extraV2F3 = d.extraV2F3; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // v2p.extraV2F4 = d.extraV2F4; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // v2p.extraV2F5 = d.extraV2F5; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // v2p.extraV2F6 = d.extraV2F6; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // v2p.extraV2F7 = d.extraV2F7; + // #endif + } + + void ChainModifyTessellatedVertex(inout VertexData v, inout VertexToPixel v2p) + { + ExtraV2F d; + ZERO_INITIALIZE(ExtraV2F, d); + ZERO_INITIALIZE(Blackboard, d.blackboard); + + // #if %EXTRAV2F0REQUIREKEY% + // d.extraV2F0 = v2p.extraV2F0; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // d.extraV2F1 = v2p.extraV2F1; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // d.extraV2F2 = v2p.extraV2F2; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // d.extraV2F3 = v2p.extraV2F3; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // d.extraV2F4 = v2p.extraV2F4; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // d.extraV2F5 = v2p.extraV2F5; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // d.extraV2F6 = v2p.extraV2F6; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // d.extraV2F7 = v2p.extraV2F7; + // #endif + + + // Ext_ModifyTessellatedVertex0(v, d); + // Ext_ModifyTessellatedVertex1(v, d); + // Ext_ModifyTessellatedVertex2(v, d); + // Ext_ModifyTessellatedVertex3(v, d); + // Ext_ModifyTessellatedVertex4(v, d); + // Ext_ModifyTessellatedVertex5(v, d); + // Ext_ModifyTessellatedVertex6(v, d); + // Ext_ModifyTessellatedVertex7(v, d); + // Ext_ModifyTessellatedVertex8(v, d); + // Ext_ModifyTessellatedVertex9(v, d); + // Ext_ModifyTessellatedVertex10(v, d); + // Ext_ModifyTessellatedVertex11(v, d); + // Ext_ModifyTessellatedVertex12(v, d); + // Ext_ModifyTessellatedVertex13(v, d); + // Ext_ModifyTessellatedVertex14(v, d); + // Ext_ModifyTessellatedVertex15(v, d); + // Ext_ModifyTessellatedVertex16(v, d); + // Ext_ModifyTessellatedVertex17(v, d); + // Ext_ModifyTessellatedVertex18(v, d); + // Ext_ModifyTessellatedVertex19(v, d); + // Ext_ModifyTessellatedVertex20(v, d); + // Ext_ModifyTessellatedVertex21(v, d); + // Ext_ModifyTessellatedVertex22(v, d); + // Ext_ModifyTessellatedVertex23(v, d); + // Ext_ModifyTessellatedVertex24(v, d); + // Ext_ModifyTessellatedVertex25(v, d); + // Ext_ModifyTessellatedVertex26(v, d); + // Ext_ModifyTessellatedVertex27(v, d); + // Ext_ModifyTessellatedVertex28(v, d); + // Ext_ModifyTessellatedVertex29(v, d); + + // #if %EXTRAV2F0REQUIREKEY% + // v2p.extraV2F0 = d.extraV2F0; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // v2p.extraV2F1 = d.extraV2F1; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // v2p.extraV2F2 = d.extraV2F2; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // v2p.extraV2F3 = d.extraV2F3; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // v2p.extraV2F4 = d.extraV2F4; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // v2p.extraV2F5 = d.extraV2F5; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // v2p.extraV2F6 = d.extraV2F6; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // v2p.extraV2F7 = d.extraV2F7; + // #endif + } + + void ChainFinalColorForward(inout Surface l, inout ShaderData d, inout half4 color) + { + // Ext_FinalColorForward0(l, d, color); + // Ext_FinalColorForward1(l, d, color); + // Ext_FinalColorForward2(l, d, color); + // Ext_FinalColorForward3(l, d, color); + // Ext_FinalColorForward4(l, d, color); + // Ext_FinalColorForward5(l, d, color); + // Ext_FinalColorForward6(l, d, color); + // Ext_FinalColorForward7(l, d, color); + // Ext_FinalColorForward8(l, d, color); + // Ext_FinalColorForward9(l, d, color); + // Ext_FinalColorForward10(l, d, color); + // Ext_FinalColorForward11(l, d, color); + // Ext_FinalColorForward12(l, d, color); + // Ext_FinalColorForward13(l, d, color); + // Ext_FinalColorForward14(l, d, color); + // Ext_FinalColorForward15(l, d, color); + // Ext_FinalColorForward16(l, d, color); + // Ext_FinalColorForward17(l, d, color); + // Ext_FinalColorForward18(l, d, color); + // Ext_FinalColorForward19(l, d, color); + // Ext_FinalColorForward20(l, d, color); + // Ext_FinalColorForward21(l, d, color); + // Ext_FinalColorForward22(l, d, color); + // Ext_FinalColorForward23(l, d, color); + // Ext_FinalColorForward24(l, d, color); + // Ext_FinalColorForward25(l, d, color); + // Ext_FinalColorForward26(l, d, color); + // Ext_FinalColorForward27(l, d, color); + // Ext_FinalColorForward28(l, d, color); + // Ext_FinalColorForward29(l, d, color); + } + + void ChainFinalGBufferStandard(inout Surface s, inout ShaderData d, inout half4 GBuffer0, inout half4 GBuffer1, inout half4 GBuffer2, inout half4 outEmission, inout half4 outShadowMask) + { + // Ext_FinalGBufferStandard0(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard1(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard2(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard3(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard4(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard5(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard6(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard7(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard8(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard9(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard10(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard11(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard12(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard13(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard14(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard15(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard16(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard17(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard18(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard19(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard20(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard21(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard22(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard23(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard24(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard25(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard26(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard27(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard28(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard29(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + } +#endif + + + + + +#if _DECALSHADER + + ShaderData CreateShaderData(SurfaceDescriptionInputs IN) + { + ShaderData d = (ShaderData)0; + d.TBNMatrix = float3x3(IN.WorldSpaceTangent, IN.WorldSpaceBiTangent, IN.WorldSpaceNormal); + d.worldSpaceNormal = IN.WorldSpaceNormal; + d.worldSpaceTangent = IN.WorldSpaceTangent; + + d.worldSpacePosition = IN.WorldSpacePosition; + d.texcoord0 = IN.uv0.xyxy; + d.screenPos = IN.ScreenPosition; + + d.worldSpaceViewDir = normalize(_WorldSpaceCameraPos - d.worldSpacePosition); + + d.tangentSpaceViewDir = mul(d.TBNMatrix, d.worldSpaceViewDir); + + // these rarely get used, so we back transform them. Usually will be stripped. + #if _HDRP + // d.localSpacePosition = mul(GetWorldToObjectMatrix(), float4(GetCameraRelativePositionWS(d.worldSpacePosition), 1)).xyz; + #else + // d.localSpacePosition = mul(GetWorldToObjectMatrix(), float4(d.worldSpacePosition, 1)).xyz; + #endif + // d.localSpaceNormal = normalize(mul((float3x3)GetWorldToObjectMatrix(), d.worldSpaceNormal)); + // d.localSpaceTangent = normalize(mul((float3x3)GetWorldToObjectMatrix(), d.worldSpaceTangent.xyz)); + + // #if %SCREENPOSREQUIREKEY% + // d.screenUV = (IN.ScreenPosition.xy / max(0.01, IN.ScreenPosition.w)); + // #endif + + return d; + } +#else + + ShaderData CreateShaderData(VertexToPixel i + #if NEED_FACING + , bool facing + #endif + ) + { + ShaderData d = (ShaderData)0; + d.clipPos = i.pos; + d.worldSpacePosition = i.worldPos; + + d.worldSpaceNormal = normalize(i.worldNormal); + d.worldSpaceTangent.xyz = normalize(i.worldTangent.xyz); + + d.tangentSign = i.worldTangent.w * unity_WorldTransformParams.w; + float3 bitangent = cross(d.worldSpaceTangent.xyz, d.worldSpaceNormal) * d.tangentSign; + + d.TBNMatrix = float3x3(d.worldSpaceTangent, -bitangent, d.worldSpaceNormal); + d.worldSpaceViewDir = normalize(_WorldSpaceCameraPos - i.worldPos); + + d.tangentSpaceViewDir = mul(d.TBNMatrix, d.worldSpaceViewDir); + d.texcoord0 = i.texcoord0; + d.texcoord1 = i.texcoord1; + d.texcoord2 = i.texcoord2; + + // #if %TEXCOORD3REQUIREKEY% + d.texcoord3 = i.texcoord3; + // #endif + + // d.isFrontFace = facing; + // #if %VERTEXCOLORREQUIREKEY% + d.vertexColor = i.vertexColor; + // #endif + + // these rarely get used, so we back transform them. Usually will be stripped. + #if _HDRP + // d.localSpacePosition = mul(GetWorldToObjectMatrix(), float4(GetCameraRelativePositionWS(i.worldPos), 1)).xyz; + #else + // d.localSpacePosition = mul(GetWorldToObjectMatrix(), float4(i.worldPos, 1)).xyz; + #endif + // d.localSpaceNormal = normalize(mul((float3x3)GetWorldToObjectMatrix(), i.worldNormal)); + // d.localSpaceTangent = normalize(mul((float3x3)GetWorldToObjectMatrix(), i.worldTangent.xyz)); + + // #if %SCREENPOSREQUIREKEY% + // d.screenPos = i.screenPos; + // d.screenUV = (i.screenPos.xy / i.screenPos.w); + // #endif + + + // #if %EXTRAV2F0REQUIREKEY% + // d.extraV2F0 = i.extraV2F0; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // d.extraV2F1 = i.extraV2F1; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // d.extraV2F2 = i.extraV2F2; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // d.extraV2F3 = i.extraV2F3; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // d.extraV2F4 = i.extraV2F4; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // d.extraV2F5 = i.extraV2F5; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // d.extraV2F6 = i.extraV2F6; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // d.extraV2F7 = i.extraV2F7; + // #endif + + return d; + } + +#endif + + + #if _PASSSHADOW + float3 _LightDirection; + #endif + + // vertex shader + VertexToPixel Vert (VertexData v) + { + + VertexToPixel o = (VertexToPixel)0; + + UNITY_SETUP_INSTANCE_ID(v); + UNITY_TRANSFER_INSTANCE_ID(v, o); + UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o); + + +#if !_TESSELLATION_ON + ChainModifyVertex(v, o, _Time); +#endif + + o.texcoord0 = v.texcoord0; + o.texcoord1 = v.texcoord1; + o.texcoord2 = v.texcoord2; + + // #if %TEXCOORD3REQUIREKEY% + o.texcoord3 = v.texcoord3; + // #endif + + // #if %VERTEXCOLORREQUIREKEY% + o.vertexColor = v.vertexColor; + // #endif + + VertexPositionInputs vertexInput = GetVertexPositionInputs(v.vertex.xyz); + o.worldPos = TransformObjectToWorld(v.vertex.xyz); + o.worldNormal = TransformObjectToWorldNormal(v.normal); + o.worldTangent = float4(TransformObjectToWorldDir(v.tangent.xyz), v.tangent.w); + + + #if _PASSSHADOW + // Define shadow pass specific clip position for Universal + o.pos = TransformWorldToHClip(ApplyShadowBias(o.worldPos, o.worldNormal, _LightDirection)); + #if UNITY_REVERSED_Z + o.pos.z = min(o.pos.z, UNITY_NEAR_CLIP_VALUE); + #else + o.pos.z = max(o.pos.z, UNITY_NEAR_CLIP_VALUE); + #endif + #elif _PASSMETA + o.pos = MetaVertexPosition(float4(v.vertex.xyz, 0), v.texcoord1, v.texcoord2, unity_LightmapST, unity_DynamicLightmapST); + #else + o.pos = TransformWorldToHClip(o.worldPos); + #endif + + // #if %SCREENPOSREQUIREKEY% + // o.screenPos = ComputeScreenPos(o.pos, _ProjectionParams.x); + // #endif + + #if _PASSFORWARD + OUTPUT_LIGHTMAP_UV(v.texcoord1, unity_LightmapST, o.lightmapUV); + OUTPUT_SH(o.worldNormal, o.sh); + #endif + + #ifdef VARYINGS_NEED_FOG_AND_VERTEX_LIGHT + #if _BAKEDLIT + half3 vertexLight = 0; + #else + half3 vertexLight = VertexLighting(o.worldPos, o.worldNormal); + #endif + half fogFactor = ComputeFogFactor(o.pos.z); + o.fogFactorAndVertexLight = half4(fogFactor, vertexLight); + #endif + + #ifdef _MAIN_LIGHT_SHADOWS + o.shadowCoord = GetShadowCoord(vertexInput); + #endif + + return o; + } + + + + + // fragment shader + half4 Frag (VertexToPixel IN + #ifdef _DEPTHOFFSET_ON + , out float outputDepth : SV_Depth + #endif + #if NEED_FACING + , bool facing : SV_IsFrontFace + #endif + ) : SV_Target + { + UNITY_SETUP_INSTANCE_ID(IN); + + ShaderData d = CreateShaderData(IN + #if NEED_FACING + , facing + #endif + ); + Surface l = (Surface)0; + + #ifdef _DEPTHOFFSET_ON + l.outputDepth = outputDepth; + #endif + + l.Albedo = half3(0.5, 0.5, 0.5); + l.Normal = float3(0,0,1); + l.Occlusion = 1; + l.Alpha = 1; + + ChainSurfaceFunction(l, d); + + #ifdef _DEPTHOFFSET_ON + outputDepth = l.outputDepth; + #endif + + return 0; + + } + + ENDHLSL + + } + + + + Pass + { + Name "DepthOnly" + Tags + { + "LightMode" = "DepthOnly" + } + + // Render State + Blend One Zero, One Zero + Cull Back + ZTest LEqual + ZWrite On + ColorMask 0 + + Tags { "RenderType" = "Opaque" "Queue" = "Geometry" "PreviewType" = "Plane" } + Cull [_CullingOption] + ZWrite [_ZWrite] + ZTest [_ZTestMode] + + + HLSLPROGRAM + + #pragma vertex Vert + #pragma fragment Frag + + #define _NORMAL_DROPOFF_TS 1 + #define ATTRIBUTES_NEED_NORMAL + #define ATTRIBUTES_NEED_TANGENT + #define SHADERPASS_DEPTHONLY + + #pragma target 3.0 + #pragma prefer_hlslcc gles + #pragma exclude_renderers d3d11_9x + #pragma multi_compile_instancing + + + #pragma shader_feature_local GLOW_ON + #pragma shader_feature_local FADE_ON + #pragma shader_feature_local OUTBASE_ON + #pragma shader_feature_local ONLYOUTLINE_ON + #pragma shader_feature_local GRADIENT_ON + #pragma shader_feature_local GRADIENT2COL_ON + #pragma shader_feature_local RADIALGRADIENT_ON + #pragma shader_feature_local COLORSWAP_ON + #pragma shader_feature_local HSV_ON + #pragma shader_feature_local CHANGECOLOR_ON + #pragma shader_feature_local CHANGECOLOR2_ON + #pragma shader_feature_local CHANGECOLOR3_ON + #pragma shader_feature_local COLORRAMP_ON + #pragma shader_feature_local GRADIENTCOLORRAMP_ON + #pragma shader_feature_local HITEFFECT_ON + #pragma shader_feature_local NEGATIVE_ON + #pragma shader_feature_local PIXELATE_ON + #pragma shader_feature_local GREYSCALE_ON + #pragma shader_feature_local POSTERIZE_ON + #pragma shader_feature_local BLUR_ON + #pragma shader_feature_local MOTIONBLUR_ON + #pragma shader_feature_local GHOST_ON + #pragma shader_feature_local ALPHAOUTLINE_ON + #pragma shader_feature_local INNEROUTLINE_ON + #pragma shader_feature_local ONLYINNEROUTLINE_ON + #pragma shader_feature_local HOLOGRAM_ON + #pragma shader_feature_local CHROMABERR_ON + #pragma shader_feature_local GLITCH_ON + #pragma shader_feature_local FLICKER_ON + #pragma shader_feature_local SHADOW_ON + #pragma shader_feature_local SHINE_ON + #pragma shader_feature_local CONTRAST_ON + #pragma shader_feature_local OVERLAY_ON + #pragma shader_feature_local OVERLAYMULT_ON + #pragma shader_feature_local DOODLE_ON + #pragma shader_feature_local WIND_ON + #pragma shader_feature_local WAVEUV_ON + #pragma shader_feature_local ROUNDWAVEUV_ON + #pragma shader_feature_local RECTSIZE_ON + #pragma shader_feature_local OFFSETUV_ON + #pragma shader_feature_local CLIPPING_ON + #pragma shader_feature_local RADIALCLIPPING_ON + #pragma shader_feature_local TEXTURESCROLL_ON + #pragma shader_feature_local ZOOMUV_ON + #pragma shader_feature_local DISTORT_ON + #pragma shader_feature_local WARP_ON + #pragma shader_feature_local TWISTUV_ON + #pragma shader_feature_local ROTATEUV_ON + #pragma shader_feature_local POLARUV_ON + #pragma shader_feature_local FISHEYE_ON + #pragma shader_feature_local PINCH_ON + #pragma shader_feature_local SHAKEUV_ON + + #pragma shader_feature_local GLOWTEX_ON + #pragma shader_feature_local OUTTEX_ON + #pragma shader_feature_local OUTDIST_ON + #pragma shader_feature_local OUTBASE8DIR_ON + #pragma shader_feature_local OUTBASEPIXELPERF_ON + #pragma shader_feature_local COLORRAMPOUTLINE_ON + #pragma shader_feature_local GREYSCALEOUTLINE_ON + #pragma shader_feature_local POSTERIZEOUTLINE_ON + #pragma shader_feature_local BLURISHD_ON + #pragma shader_feature_local MANUALWIND_ON + #pragma shader_feature_local ATLAS_ON + #pragma shader_feature_local PREMULTIPLYALPHA_ON + + #pragma shader_feature BILBOARD_ON + #pragma shader_feature BILBOARDY_ON + + #pragma shader_feature NORMALMAP_ON + + + #define _URP 1 +#define _USINGTEXCOORD1 1 +#define _USINGTEXCOORD2 1 + + + #define _PASSDEPTH 1 + + // Includes + #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Version.hlsl" + #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Color.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.universal/ShaderLibrary/ShaderGraphFunctions.hlsl" + #include "Packages/com.unity.shadergraph/ShaderGraphLibrary/ShaderVariablesFunctions.hlsl" + + + #undef WorldNormalVector + #define WorldNormalVector(data, normal) mul(normal, data.TBNMatrix) + + #define UnityObjectToWorldNormal(normal) mul(GetObjectToWorldMatrix(), normal) + + #define _WorldSpaceLightPos0 _MainLightPosition + + #define UNITY_DECLARE_TEX2D(name) TEXTURE2D(name); SAMPLER(sampler##name); + #define UNITY_DECLARE_TEX2D_NOSAMPLER(name) TEXTURE2D(name); + #define UNITY_DECLARE_TEX2DARRAY(name) TEXTURE2D_ARRAY(name); SAMPLER(sampler##name); + #define UNITY_DECLARE_TEX2DARRAY_NOSAMPLER(name) TEXTURE2D_ARRAY(name); + + #define UNITY_SAMPLE_TEX2DARRAY(tex,coord) SAMPLE_TEXTURE2D_ARRAY(tex, sampler##tex, coord.xy, coord.z) + #define UNITY_SAMPLE_TEX2DARRAY_LOD(tex,coord,lod) SAMPLE_TEXTURE2D_ARRAY_LOD(tex, sampler##tex, coord.xy, coord.z, lod) + #define UNITY_SAMPLE_TEX2D(tex, coord) SAMPLE_TEXTURE2D(tex, sampler##tex, coord) + #define UNITY_SAMPLE_TEX2D_SAMPLER(tex, samp, coord) SAMPLE_TEXTURE2D(tex, sampler##samp, coord) + + #define UNITY_SAMPLE_TEX2D_LOD(tex,coord, lod) SAMPLE_TEXTURE2D_LOD(tex, sampler_##tex, coord, lod) + #define UNITY_SAMPLE_TEX2D_SAMPLER_LOD(tex,samplertex,coord, lod) SAMPLE_TEXTURE2D_LOD (tex, sampler##samplertex,coord, lod) + + #if defined(UNITY_COMPILER_HLSL) + #define UNITY_INITIALIZE_OUTPUT(type,name) name = (type)0; + #else + #define UNITY_INITIALIZE_OUTPUT(type,name) + #endif + + #define sampler2D_float sampler2D + #define sampler2D_half sampler2D + + + + // data across stages, stripped like the above. + struct VertexToPixel + { + float4 pos : SV_POSITION; + float3 worldPos : TEXCOORD0; + float3 worldNormal : TEXCOORD1; + float4 worldTangent : TEXCOORD2; + float4 texcoord0 : TEXCOORD3; + float4 texcoord1 : TEXCOORD4; + float4 texcoord2 : TEXCOORD5; + + // #if %TEXCOORD3REQUIREKEY% + float4 texcoord3 : TEXCOORD6; + // #endif + + // #if %SCREENPOSREQUIREKEY% + // float4 screenPos : TEXCOORD7; + // #endif + + // #if %VERTEXCOLORREQUIREKEY% + half4 vertexColor : COLOR; + // #endif + + // #if %EXTRAV2F0REQUIREKEY% + // float4 extraV2F0 : TEXCOORD12; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // float4 extraV2F1 : TEXCOORD13; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // float4 extraV2F2 : TEXCOORD14; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // float4 extraV2F3 : TEXCOORD15; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // float4 extraV2F4 : TEXCOORD16; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // float4 extraV2F5 : TEXCOORD17; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // float4 extraV2F6 : TEXCOORD18; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // float4 extraV2F7 : TEXCOORD19; + // #endif + + #if defined(LIGHTMAP_ON) + float2 lightmapUV : TEXCOORD8; + #endif + #if !defined(LIGHTMAP_ON) + float3 sh : TEXCOORD9; + #endif + float4 fogFactorAndVertexLight : TEXCOORD10; + float4 shadowCoord : TEXCOORD11; + #if UNITY_ANY_INSTANCING_ENABLED + uint instanceID : CUSTOM_INSTANCE_ID; + #endif + #if (defined(UNITY_STEREO_INSTANCING_ENABLED)) + uint stereoTargetEyeIndexAsRTArrayIdx : SV_RenderTargetArrayIndex; + #endif + #if (defined(UNITY_STEREO_MULTIVIEW_ENABLED)) || (defined(UNITY_STEREO_INSTANCING_ENABLED) && (defined(SHADER_API_GLES3) || defined(SHADER_API_GLCORE))) + uint stereoTargetEyeIndexAsBlendIdx0 : BLENDINDICES0; + #endif + #if defined(SHADER_STAGE_FRAGMENT) && defined(VARYINGS_NEED_CULLFACE) + FRONT_FACE_TYPE cullFace : FRONT_FACE_SEMANTIC; + #endif + }; + + + + + // data describing the user output of a pixel + struct Surface + { + half3 Albedo; + half Height; + half3 Normal; + half Smoothness; + half3 Emission; + half Metallic; + half3 Specular; + half Occlusion; + half SpecularPower; // for simple lighting + half Alpha; + float outputDepth; // if written, SV_Depth semantic is used. ShaderData.clipPos.z is unused value + // HDRP Only + half SpecularOcclusion; + half SubsurfaceMask; + half Thickness; + half CoatMask; + half CoatSmoothness; + half Anisotropy; + half IridescenceMask; + half IridescenceThickness; + int DiffusionProfileHash; + float SpecularAAThreshold; + float SpecularAAScreenSpaceVariance; + // requires _OVERRIDE_BAKEDGI to be defined, but is mapped in all pipelines + float3 DiffuseGI; + float3 BackDiffuseGI; + float3 SpecularGI; + float ior; + float3 transmittanceColor; + float atDistance; + float transmittanceMask; + // requires _OVERRIDE_SHADOWMASK to be defines + float4 ShadowMask; + + // for decals + float NormalAlpha; + float MAOSAlpha; + + + }; + + // Data the user declares in blackboard blocks + struct Blackboard + { + + float blackboardDummyData; + }; + + // data the user might need, this will grow to be big. But easy to strip + struct ShaderData + { + float4 clipPos; // SV_POSITION + float3 localSpacePosition; + float3 localSpaceNormal; + float3 localSpaceTangent; + + float3 worldSpacePosition; + float3 worldSpaceNormal; + float3 worldSpaceTangent; + float tangentSign; + + float3 worldSpaceViewDir; + float3 tangentSpaceViewDir; + + float4 texcoord0; + float4 texcoord1; + float4 texcoord2; + float4 texcoord3; + + float2 screenUV; + float4 screenPos; + + float4 vertexColor; + bool isFrontFace; + + float4 extraV2F0; + float4 extraV2F1; + float4 extraV2F2; + float4 extraV2F3; + float4 extraV2F4; + float4 extraV2F5; + float4 extraV2F6; + float4 extraV2F7; + + float3x3 TBNMatrix; + Blackboard blackboard; + }; + + struct VertexData + { + #if SHADER_TARGET > 30 + // uint vertexID : SV_VertexID; + #endif + float4 vertex : POSITION; + float3 normal : NORMAL; + float4 tangent : TANGENT; + float4 texcoord0 : TEXCOORD0; + + // optimize out mesh coords when not in use by user or lighting system + #if _URP && (_USINGTEXCOORD1 || _PASSMETA || _PASSFORWARD || _PASSGBUFFER) + float4 texcoord1 : TEXCOORD1; + #endif + + #if _URP && (_USINGTEXCOORD2 || _PASSMETA || ((_PASSFORWARD || _PASSGBUFFER) && defined(DYNAMICLIGHTMAP_ON))) + float4 texcoord2 : TEXCOORD2; + #endif + + #if _STANDARD && (_USINGTEXCOORD1 || (_PASSMETA || ((_PASSFORWARD || _PASSGBUFFER || _PASSFORWARDADD) && LIGHTMAP_ON))) + float4 texcoord1 : TEXCOORD1; + #endif + #if _STANDARD && (_USINGTEXCOORD2 || (_PASSMETA || ((_PASSFORWARD || _PASSGBUFFER) && DYNAMICLIGHTMAP_ON))) + float4 texcoord2 : TEXCOORD2; + #endif + + + #if _HDRP + float4 texcoord1 : TEXCOORD1; + float4 texcoord2 : TEXCOORD2; + #endif + + // #if %TEXCOORD3REQUIREKEY% + float4 texcoord3 : TEXCOORD3; + // #endif + + // #if %VERTEXCOLORREQUIREKEY% + float4 vertexColor : COLOR; + // #endif + + #if _PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR)) + float3 previousPositionOS : TEXCOORD4; // Contain previous transform position (in case of skinning for example) + #if defined (_ADD_PRECOMPUTED_VELOCITY) + float3 precomputedVelocity : TEXCOORD5; // Add Precomputed Velocity (Alembic computes velocities on runtime side). + #endif + #endif + + UNITY_VERTEX_INPUT_INSTANCE_ID + }; + + struct TessVertex + { + float4 vertex : INTERNALTESSPOS; + float3 normal : NORMAL; + float4 tangent : TANGENT; + float4 texcoord0 : TEXCOORD0; + float4 texcoord1 : TEXCOORD1; + float4 texcoord2 : TEXCOORD2; + + // #if %TEXCOORD3REQUIREKEY% + float4 texcoord3 : TEXCOORD3; + // #endif + + // #if %VERTEXCOLORREQUIREKEY% + float4 vertexColor : COLOR; + // #endif + + // #if %EXTRAV2F0REQUIREKEY% + // float4 extraV2F0 : TEXCOORD5; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // float4 extraV2F1 : TEXCOORD6; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // float4 extraV2F2 : TEXCOORD7; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // float4 extraV2F3 : TEXCOORD8; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // float4 extraV2F4 : TEXCOORD9; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // float4 extraV2F5 : TEXCOORD10; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // float4 extraV2F6 : TEXCOORD11; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // float4 extraV2F7 : TEXCOORD12; + // #endif + + #if _PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR)) + float3 previousPositionOS : TEXCOORD13; // Contain previous transform position (in case of skinning for example) + #if defined (_ADD_PRECOMPUTED_VELOCITY) + float3 precomputedVelocity : TEXCOORD14; + #endif + #endif + + UNITY_VERTEX_INPUT_INSTANCE_ID + UNITY_VERTEX_OUTPUT_STEREO + }; + + struct ExtraV2F + { + float4 extraV2F0; + float4 extraV2F1; + float4 extraV2F2; + float4 extraV2F3; + float4 extraV2F4; + float4 extraV2F5; + float4 extraV2F6; + float4 extraV2F7; + Blackboard blackboard; + float4 time; + }; + + + float3 WorldToTangentSpace(ShaderData d, float3 normal) + { + return mul(d.TBNMatrix, normal); + } + + float3 TangentToWorldSpace(ShaderData d, float3 normal) + { + return mul(normal, d.TBNMatrix); + } + + // in this case, make standard more like SRPs, because we can't fix + // unity_WorldToObject in HDRP, since it already does macro-fu there + + #if _STANDARD + float3 TransformWorldToObject(float3 p) { return mul(unity_WorldToObject, float4(p, 1)); }; + float3 TransformObjectToWorld(float3 p) { return mul(unity_ObjectToWorld, float4(p, 1)); }; + float4 TransformWorldToObject(float4 p) { return mul(unity_WorldToObject, p); }; + float4 TransformObjectToWorld(float4 p) { return mul(unity_ObjectToWorld, p); }; + float4x4 GetWorldToObjectMatrix() { return unity_WorldToObject; } + float4x4 GetObjectToWorldMatrix() { return unity_ObjectToWorld; } + #if (defined(SHADER_API_D3D11) || defined(SHADER_API_XBOXONE) || defined(UNITY_COMPILER_HLSLCC) || defined(SHADER_API_PSSL) || (SHADER_TARGET_SURFACE_ANALYSIS && !SHADER_TARGET_SURFACE_ANALYSIS_MOJOSHADER)) + #define UNITY_SAMPLE_TEX2D_LOD(tex,coord, lod) tex.SampleLevel (sampler##tex,coord, lod) + #define UNITY_SAMPLE_TEX2D_SAMPLER_LOD(tex,samplertex,coord, lod) tex.SampleLevel (sampler##samplertex,coord, lod) + #else + #define UNITY_SAMPLE_TEX2D_LOD(tex,coord,lod) tex2D (tex,coord,0,lod) + #define UNITY_SAMPLE_TEX2D_SAMPLER_LOD(tex,samplertex,coord,lod) tex2D (tex,coord,0,lod) + #endif + + #undef GetWorldToObjectMatrix() + + #define GetWorldToObjectMatrix() unity_WorldToObject + + + #endif + + float3 GetCameraWorldPosition() + { + #if _HDRP + return GetCameraRelativePositionWS(_WorldSpaceCameraPos); + #else + return _WorldSpaceCameraPos; + #endif + } + + #if _GRABPASSUSED + #if _STANDARD + TEXTURE2D(%GRABTEXTURE%); + SAMPLER(sampler_%GRABTEXTURE%); + #endif + + half3 GetSceneColor(float2 uv) + { + #if _STANDARD + return SAMPLE_TEXTURE2D(%GRABTEXTURE%, sampler_%GRABTEXTURE%, uv).rgb; + #else + return SHADERGRAPH_SAMPLE_SCENE_COLOR(uv); + #endif + } + #endif + + + + #if _STANDARD + UNITY_DECLARE_DEPTH_TEXTURE(_CameraDepthTexture); + float GetSceneDepth(float2 uv) { return SAMPLE_DEPTH_TEXTURE(_CameraDepthTexture, uv); } + float GetLinear01Depth(float2 uv) { return Linear01Depth(GetSceneDepth(uv)); } + float GetLinearEyeDepth(float2 uv) { return LinearEyeDepth(GetSceneDepth(uv)); } + #else + float GetSceneDepth(float2 uv) { return SHADERGRAPH_SAMPLE_SCENE_DEPTH(uv); } + float GetLinear01Depth(float2 uv) { return Linear01Depth(GetSceneDepth(uv), _ZBufferParams); } + float GetLinearEyeDepth(float2 uv) { return LinearEyeDepth(GetSceneDepth(uv), _ZBufferParams); } + #endif + + float3 GetWorldPositionFromDepthBuffer(float2 uv, float3 worldSpaceViewDir) + { + float eye = GetLinearEyeDepth(uv); + float3 camView = mul((float3x3)GetObjectToWorldMatrix(), transpose(mul(GetWorldToObjectMatrix(), UNITY_MATRIX_I_V)) [2].xyz); + + float dt = dot(worldSpaceViewDir, camView); + float3 div = worldSpaceViewDir/dt; + float3 wpos = (eye * div) + GetCameraWorldPosition(); + return wpos; + } + + #if _HDRP + float3 ObjectToWorldSpacePosition(float3 pos) + { + return GetAbsolutePositionWS(TransformObjectToWorld(pos)); + } + #else + float3 ObjectToWorldSpacePosition(float3 pos) + { + return TransformObjectToWorld(pos); + } + #endif + + #if _STANDARD + UNITY_DECLARE_SCREENSPACE_TEXTURE(_CameraDepthNormalsTexture); + float3 GetSceneNormal(float2 uv, float3 worldSpaceViewDir) + { + float4 depthNorms = UNITY_SAMPLE_SCREENSPACE_TEXTURE(_CameraDepthNormalsTexture, uv); + float3 norms = DecodeViewNormalStereo(depthNorms); + norms = mul((float3x3)GetWorldToViewMatrix(), norms) * 0.5 + 0.5; + return norms; + } + #elif _HDRP && !_DECALSHADER + + float3 GetSceneNormal(float2 uv, float3 worldSpaceViewDir) + { + NormalData nd; + DecodeFromNormalBuffer(_ScreenSize.xy * uv, nd); + return nd.normalWS; + } + #elif _URP + #if (SHADER_LIBRARY_VERSION_MAJOR >= 10) + #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/DeclareNormalsTexture.hlsl" + #endif + + float3 GetSceneNormal(float2 uv, float3 worldSpaceViewDir) + { + #if (SHADER_LIBRARY_VERSION_MAJOR >= 10) + return SampleSceneNormals(uv); + #else + float3 wpos = GetWorldPositionFromDepthBuffer(uv, worldSpaceViewDir); + return normalize(-cross(ddx(wpos), ddy(wpos))) * 0.5 + 0.5; + #endif + + } + #endif + + #if _HDRP + + half3 UnpackNormalmapRGorAG(half4 packednormal) + { + // This do the trick + packednormal.x *= packednormal.w; + + half3 normal; + normal.xy = packednormal.xy * 2 - 1; + normal.z = sqrt(1 - saturate(dot(normal.xy, normal.xy))); + return normal; + } + half3 UnpackNormal(half4 packednormal) + { + #if defined(UNITY_NO_DXT5nm) + return packednormal.xyz * 2 - 1; + #else + return UnpackNormalmapRGorAG(packednormal); + #endif + } + #endif + #if _HDRP || _URP + + half3 UnpackScaleNormal(half4 packednormal, half scale) + { + #ifndef UNITY_NO_DXT5nm + // Unpack normal as DXT5nm (1, y, 1, x) or BC5 (x, y, 0, 1) + // Note neutral texture like "bump" is (0, 0, 1, 1) to work with both plain RGB normal and DXT5nm/BC5 + packednormal.x *= packednormal.w; + #endif + half3 normal; + normal.xy = (packednormal.xy * 2 - 1) * scale; + normal.z = sqrt(1 - saturate(dot(normal.xy, normal.xy))); + return normal; + } + + #endif + + + void GetSun(out float3 lightDir, out float3 color) + { + lightDir = float3(0.5, 0.5, 0); + color = 1; + #if _HDRP + if (_DirectionalLightCount > 0) + { + DirectionalLightData light = _DirectionalLightDatas[0]; + lightDir = -light.forward.xyz; + color = light.color; + } + #elif _STANDARD + lightDir = normalize(_WorldSpaceLightPos0.xyz); + color = _LightColor0.rgb; + #elif _URP + Light light = GetMainLight(); + lightDir = light.direction; + color = light.color; + #endif + } + + + + CBUFFER_START(UnityPerMaterial) + + + half4 _Color; + half4 _MainTex_ST, _MainTex_TexelSize; + half _Alpha, _AlphaCutoffValue; + + #if ATLAS_ON + half _MinXUV, _MaxXUV, _MinYUV, _MaxYUV; + #endif + + #if GLOW_ON + half4 _GlowColor; + half _Glow, _GlowGlobal; + #endif + + #if HSV_ON + half _HsvShift, _HsvSaturation, _HsvBright; + #endif + + #if DISTORT_ON + half4 _DistortTex_ST; + half _DistortTexXSpeed, _DistortTexYSpeed, _DistortAmount; + #endif + + #if FADE_ON + half4 _FadeBurnColor, _FadeTex_ST, _FadeBurnTex_ST; + half _FadeAmount, _FadeBurnWidth, _FadeBurnTransition,_FadeBurnGlow; + #endif + + #if OUTBASE_ON + half4 _OutlineColor; + half _OutlineAlpha, _OutlineGlow, _OutlineWidth; + int _OutlinePixelWidth; + #endif + + #if OUTTEX_ON + half4 _OutlineTex_ST; + half _OutlineTexXSpeed, _OutlineTexYSpeed; + #endif + + #if OUTDIST_ON + half4 _OutlineDistortTex_ST; + half _OutlineDistortTexXSpeed, _OutlineDistortTexYSpeed, _OutlineDistortAmount; + #endif + + #if ALPHAOUTLINE_ON + half _AlphaOutlineGlow, _AlphaOutlinePower, _AlphaOutlineMinAlpha, _AlphaOutlineBlend; + half4 _AlphaOutlineColor; + #endif + + #if INNEROUTLINE_ON + half _InnerOutlineThickness, _InnerOutlineAlpha, _InnerOutlineGlow; + half4 _InnerOutlineColor; + #endif + + #if GRADIENT_ON + half _GradBlend, _GradBoostX, _GradBoostY; + half4 _GradTopRightCol, _GradTopLeftCol, _GradBotRightCol, _GradBotLeftCol; + #endif + + #if COLORSWAP_ON + half4 _ColorSwapRed, _ColorSwapGreen, _ColorSwapBlue; + half _ColorSwapRedLuminosity, _ColorSwapGreenLuminosity, _ColorSwapBlueLuminosity, _ColorSwapBlend; + #endif + + #if CHANGECOLOR_ON + half4 _ColorChangeNewCol, _ColorChangeTarget; + half _ColorChangeTolerance, _ColorChangeLuminosity; + #endif + #if CHANGECOLOR2_ON + half4 _ColorChangeNewCol2, _ColorChangeTarget2; + half _ColorChangeTolerance2; + #endif + #if CHANGECOLOR3_ON + half4 _ColorChangeNewCol3, _ColorChangeTarget3; + half _ColorChangeTolerance3; + #endif + + #if COLORRAMP_ON + half _ColorRampLuminosity, _ColorRampBlend; + #endif + + #if HITEFFECT_ON + half4 _HitEffectColor; + half _HitEffectGlow, _HitEffectBlend; + #endif + + #if NEGATIVE_ON + half _NegativeAmount; + #endif + + #if PIXELATE_ON + half _PixelateSize; + #endif + + #if GREYSCALE_ON + half _GreyscaleLuminosity, _GreyscaleBlend; + half4 _GreyscaleTintColor; + #endif + + #if POSTERIZE_ON + half _PosterizeNumColors, _PosterizeGamma; + #endif + + #if BLUR_ON + half _BlurIntensity; + #endif + + #if MOTIONBLUR_ON + half _MotionBlurAngle, _MotionBlurDist; + #endif + + #if GHOST_ON + half _GhostColorBoost, _GhostTransparency, _GhostBlend; + #endif + + #if HOLOGRAM_ON + half _HologramStripesAmount, _HologramMinAlpha, _HologramUnmodAmount, _HologramStripesSpeed, _HologramMaxAlpha, _HologramBlend; + half4 _HologramStripeColor; + #endif + + #if CHROMABERR_ON + half _ChromAberrAmount, _ChromAberrAlpha; + #endif + + #if GLITCH_ON + half _GlitchAmount, _GlitchSize; + #endif + + #if FLICKER_ON + half _FlickerFreq, _FlickerPercent, _FlickerAlpha; + #endif + + #if SHADOW_ON + half _ShadowX, _ShadowY, _ShadowAlpha; + half4 _ShadowColor; + #endif + + #if SHINE_ON + half4 _ShineColor; + half _ShineLocation, _ShineRotate, _ShineWidth, _ShineGlow; + #endif + + #if CONTRAST_ON + half _Contrast, _Brightness; + #endif + + #if OVERLAY_ON + half4 _OverlayTex_ST, _OverlayColor; + half _OverlayGlow, _OverlayBlend, _OverlayTextureScrollXSpeed, _OverlayTextureScrollYSpeed; + #endif + + #if DOODLE_ON + half _HandDrawnAmount, _HandDrawnSpeed; + #endif + + #if WIND_ON + half _GrassSpeed, _GrassWind, _GrassManualAnim, _GrassRadialBend; + #endif + + #if WAVEUV_ON + float _WaveAmount, _WaveSpeed, _WaveStrength, _WaveX, _WaveY; + #endif + + #if ROUNDWAVEUV_ON + half _RoundWaveStrength, _RoundWaveSpeed; + #endif + + #if RECTSIZE_ON + half _RectSize; + #endif + + #if OFFSETUV_ON + half _OffsetUvX, _OffsetUvY; + #endif + + #if CLIPPING_ON + half _ClipUvLeft, _ClipUvRight, _ClipUvUp, _ClipUvDown; + #endif + + #if RADIALCLIPPING_ON + half _RadialStartAngle, _RadialClip, _RadialClip2; + #endif + + #if TEXTURESCROLL_ON + half _TextureScrollXSpeed, _TextureScrollYSpeed; + #endif + + #if ZOOMUV_ON + half _ZoomUvAmount; + #endif + + #if WARP_ON + half _WarpStrength, _WarpSpeed, _WarpScale; + #endif + + #if TWISTUV_ON + half _TwistUvAmount, _TwistUvPosX, _TwistUvPosY, _TwistUvRadius; + #endif + + #if ROTATEUV_ON + half _RotateUvAmount; + #endif + + #if FISHEYE_ON + half _FishEyeUvAmount; + #endif + + #if PINCH_ON + half _PinchUvAmount; + #endif + + #if SHAKEUV_ON + half _ShakeUvSpeed, _ShakeUvX, _ShakeUvY; + #endif + + #if NORMALMAP_ON + half _NormalStrength; + #endif + + float _RandomSeed; + + + + + CBUFFER_END + + + + + + + + TEXTURE2D(_MainTex); + SAMPLER(sampler_MainTex); + + #if GLOW_ON + TEXTURE2D(_GlowTex); + SAMPLER(sampler_GlowTex); + #endif + + #if FADE_ON + TEXTURE2D(_FadeTex); + SAMPLER(sampler_FadeTex); + + TEXTURE2D(_FadeBurnTex); + SAMPLER(sampler_FadeBurnTex); + #endif + + #if DISTORT_ON + TEXTURE2D(_DistortTex); + SAMPLER(sampler_DistortTex); + #endif + + #if OUTTEX_ON + TEXTURE2D(_OutlineTex); + SAMPLER(sampler_OutlineTex); + #endif + + #if OUTDIST_ON + TEXTURE2D(_OutlineDistortTex); + SAMPLER(sampler_OutlineDistortTex); + #endif + + #if COLORSWAP_ON + TEXTURE2D(_ColorSwapTex); + SAMPLER(sampler_ColorSwapTex); + #endif + + #if COLORRAMP_ON + TEXTURE2D(_ColorRampTex); + TEXTURE2D(_ColorRampTexGradient); + SAMPLER(sampler_ColorRampTex); + SAMPLER(sampler_ColorRampTexGradient); + #endif + + #if SHINE_ON + TEXTURE2D(_ShineMask); + SAMPLER(sampler_ShineMask); + #endif + + #if OVERLAY_ON + TEXTURE2D(_OverlayTex); + SAMPLER(sampler_OverlayTex); + #endif + + #if NORMALMAP_ON + TEXTURE2D(_NormalMap); + SAMPLER(sampler_NormalMap); + #endif + + + half3 GetPixel(in int offsetX, in int offsetY, in half2 uv, in Texture2D _tex, in SamplerState _sampler) + { + half2 _uv = uv + half2(offsetX * _MainTex_TexelSize.x, offsetY * _MainTex_TexelSize.y); + half4 col = SAMPLE_TEXTURE2D(_tex, _sampler, _uv); + return col.rgb; + } + + + //BLURS------------------------------------------------------------------------- + half4 Blur(half2 uv, Texture2D source, SamplerState sampler_source, half Intensity) + { + const half2 texelSize = 1.0 / _ScreenParams.xy; + const half4 color = SAMPLE_TEXTURE2D(source, sampler_source, uv); + const half2 offset = Intensity * texelSize; + + half4 accumulatedColor = color; + half accumulatedWeight = 1.0; + for (int x = -1; x <= 1; x++) + { + for (int y = -1; y <= 1; y++) + { + const half2 sampleUV = uv + half2(x, y) * offset; + const half4 sampleColor = SAMPLE_TEXTURE2D(source, sampler_source, sampleUV); + + accumulatedColor += sampleColor; + accumulatedWeight += 1.0; + } + } + + half4 blurredColor = accumulatedColor / accumulatedWeight; + return blurredColor; + } + + half BlurHD_G(half bhqp, half x) + { + return exp(-(x * x) / (2.0 * bhqp * bhqp)); + } + half4 BlurHD(half2 uv, Texture2D source, SamplerState sampler_source, half BlurAmount, half xScale, half yScale) + { + int iterations = 16; + int halfIterations = iterations / 2; + half sigmaX = 0.1 + BlurAmount * 0.5; + half sigmaY = sigmaX; + half total = 0.0; + half4 ret = half4(0, 0, 0, 0); + for (int iy = 0; iy < iterations; ++iy) + { + half fy = BlurHD_G(sigmaY, half(iy) -half(halfIterations)); + half offsetY = half(iy - halfIterations) * 0.00390625 * xScale; + for (int ix = 0; ix < iterations; ++ix) + { + half fx = BlurHD_G(sigmaX, half(ix) - half(halfIterations)); + half offsetX = half(ix - halfIterations) * 0.00390625 * yScale; + total += fx * fy; + ret += SAMPLE_TEXTURE2D(source, sampler_source, uv + half2(offsetX, offsetY)) * fx * fy; + } + } + return ret / total; + } + //----------------------------------------------------------------------- + + + //------------------------------------------- + half RemapFloat(half inValue, half inMin, half inMax, half outMin, half outMax){ + return outMin + (inValue - inMin) * (outMax - outMin) / (inMax - inMin); + } + //------------------------------------------- + + //----------------------------------------------------------------------- + half rand(half2 seed, half offset) { + return (frac(sin(dot(seed, half2(12.9898, 78.233))) * 43758.5453) + offset) % 1.0; + } + + half rand2(half2 seed, half offset) { + return (frac(sin(dot(seed * floor(50 + (_Time.x % 1.0) * 12.), half2(127.1, 311.7))) * 43758.5453123) + offset) % 1.0; + } + + half rand2CustomTime(half2 seed, half offset, half customTime) { + return (frac(sin(dot(seed * floor(50 + (customTime % 1.0) * 12.), half2(127.1, 311.7))) * 43758.5453123) + offset) % 1.0; + } + //----------------------------------------------------------------------- + + + void Ext_ModifyVertex0 (inout VertexData v, inout ExtraV2F d) + { + //BILBOARD_ON + #if BILBOARD_ON + half3 camRight = mul((half3x3)unity_CameraToWorld, half3(1,0,0)); + half3 camUp = half3(0,1,0); + #if BILBOARDY_ON + camUp = mul((half3x3)unity_CameraToWorld, half3(0,1,0)); + #endif + half3 localPos = v.vertex.x * camRight + v.vertex.y * camUp; + v.vertex = half4(localPos, 1); + #endif + //----------------------------------------------------------- + + v.texcoord0.xy = TRANSFORM_TEX(v.texcoord0.xy, _MainTex); + half2 center = half2(0.5, 0.5); + #if ATLAS_ON + center = half2((_MaxXUV + _MinXUV) / 2.0, (_MaxYUV + _MinYUV) / 2.0); + #endif + + //POLARUV_ON + #if POLARUV_ON + v.texcoord0.xy = v.texcoord0.xy - center; + #endif + + //---------------------------------------- + + //ROTATEUV_ON + #if ROTATEUV_ON + half2 uvC = v.texcoord0.xy; + half cosAngle = cos(_RotateUvAmount); + half sinAngle = sin(_RotateUvAmount); + half2x2 rot = half2x2(cosAngle, -sinAngle, sinAngle, cosAngle); + uvC -= center; + v.texcoord0.xy = mul(rot, uvC); + v.texcoord0.xy += center; + #endif + //-------------------- + + #if RECTSIZE_ON + v.vertex.xyz += (v.vertex.xyz * (_RectSize - 1.0)); + #endif + + #if OUTTEX_ON + v.texcoord1.xy = TRANSFORM_TEX(v.texcoord0.xy, _OutlineTex); + #endif + + #if OUTDIST_ON + v.texcoord2.xy = TRANSFORM_TEX(v.texcoord0.xy, _OutlineDistortTex); + #endif + + #if DISTORT_ON + v.texcoord3.xy = TRANSFORM_TEX(v.texcoord0.xy, _DistortTex); + #endif + } + + void Ext_SurfaceFunction0 (inout Surface o, ShaderData d) + { + half randomSeed = _RandomSeed; + + float2 uvRect = d.texcoord0; + half2 center = half2(0.5, 0.5); + #if ATLAS_ON + center = half2((_MaxXUV + _MinXUV) / 2.0, (_MaxYUV + _MinYUV) / 2.0); + uvRect = half2((d.texcoord0.x - _MinXUV) / (_MaxXUV - _MinXUV), (d.texcoord0.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half2 centerTiled = half2(center.x * _MainTex_ST.x, center.y * _MainTex_ST.y); + + //CLIPPING_ON + #if CLIPPING_ON + half2 tiledUv = half2(d.texcoord0.x / _MainTex_ST.x, d.texcoord0.y / _MainTex_ST.y); + #if ATLAS_ON + tiledUv = half2((tiledUv.x - _MinXUV) / (_MaxXUV - _MinXUV), (tiledUv.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + clip((1 - _ClipUvUp) - tiledUv.y); + clip(tiledUv.y - _ClipUvDown); + clip((1 - _ClipUvRight) - tiledUv.x); + clip(tiledUv.x - _ClipUvLeft); + #endif + //---------------------------------- + + //RADIALCLIPPING_ON + #if RADIALCLIPPING_ON + half2 tiledUv2 = half2(d.texcoord0.x / _MainTex_ST.x, d.texcoord0.y / _MainTex_ST.y); + #if ATLAS_ON + tiledUv2 = half2((tiledUv2.x - _MinXUV) / (_MaxXUV - _MinXUV), (tiledUv2.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half startAngle = _RadialStartAngle - _RadialClip; + half endAngle = _RadialStartAngle + _RadialClip2; + half offset0 = clamp(0, 360, startAngle + 360); + half offset360 = clamp(0, 360, endAngle - 360); + half2 atan2Coord = half2(lerp(-1, 1, tiledUv2.x), lerp(-1, 1, tiledUv2.y)); + half atanAngle = atan2(atan2Coord.y, atan2Coord.x) * 57.3; // angle in degrees + if(atanAngle < 0) atanAngle = 360 + atanAngle; + if(atanAngle >= startAngle && atanAngle <= endAngle) discard; + if(atanAngle <= offset360) discard; + if(atanAngle >= offset0) discard; + #endif + + //----------------------------- + + //TEXTURESCROLL_ON && ATLAS_ON + #if TEXTURESCROLL_ON && ATLAS_ON + d.texcoord0.xy = half2(_MinXUV + ((_MaxXUV - _MinXUV) * (abs(((_Time.y + randomSeed) * _TextureScrollXSpeed) + uvRect.x) % 1)), + _MinYUV + ((_MaxYUV - _MinYUV) * (abs(((_Time.y + randomSeed) * _TextureScrollYSpeed) + uvRect.y) % 1))); + #endif + //---------------------------- + + //OFFSETUV_ON + #if OFFSETUV_ON + #if ATLAS_ON + d.texcoord0.xy = half2(_MinXUV + ((_MaxXUV - _MinXUV) * (abs((_OffsetUvX + uvRect.x) % 1))), + _MinYUV + ((_MaxYUV - _MinYUV) * (abs(_OffsetUvY + uvRect.y) % 1))); + #else + d.texcoord0.xy += half2(_OffsetUvX, _OffsetUvY); + #endif + #endif + + //---------------------- + + //POLARUV_ON + #if POLARUV_ON + d.texcoord0.xy = half2(atan2(d.texcoord0.y, d.texcoord0.x) / (2.0f * 3.141592653589f), length(d.texcoord0.xy)); + d.texcoord0.xy *= _MainTex_ST.xy; + #endif + + //-------------------------------------- + + //TWISTUV_ON + #if TWISTUV_ON + #if ATLAS_ON + _TwistUvPosX = ((_MaxXUV - _MinXUV) * _TwistUvPosX) + _MinXUV; + _TwistUvPosY = ((_MaxYUV - _MinYUV) * _TwistUvPosY) + _MinYUV; + #endif + half2 tempUv = d.texcoord0.xy - half2(_TwistUvPosX * _MainTex_ST.x, _TwistUvPosY * _MainTex_ST.y); + _TwistUvRadius *= (_MainTex_ST.x + _MainTex_ST.y) / 2; + half percent = (_TwistUvRadius - length(tempUv)) / _TwistUvRadius; + half theta = percent * percent * (2.0 * sin(_TwistUvAmount)) * 8.0; + half s = sin(theta); + half c = cos(theta); + half beta = max(sign(_TwistUvRadius - length(tempUv)), 0.0); + tempUv = half2(dot(tempUv, half2(c, -s)), dot(tempUv, half2(s, c))) * beta + tempUv * (1 - beta); + tempUv += half2(_TwistUvPosX * _MainTex_ST.x, _TwistUvPosY * _MainTex_ST.y); + d.texcoord0.xy = tempUv; + #endif + + //-------------------------------------------- + + //FISHEYE_ON + #if FISHEYE_ON + half bind = length(centerTiled); + half2 dF = d.texcoord0.xy - centerTiled; + half dFlen = length(dF); + half fishInt = (3.14159265359 / bind) * (_FishEyeUvAmount + 0.001); + d.texcoord0.xy = centerTiled + (dF / (max(0.0001, dFlen))) * tan(dFlen * fishInt) * bind / tan(bind * fishInt); + #endif + //--------------------------------------------- + + //PINCH_ON + #if PINCH_ON + half2 dP = d.texcoord0.xy - centerTiled; + half pinchInt = (3.141592 / length(centerTiled)) * (-_PinchUvAmount + 0.001); + d.texcoord0.xy = centerTiled + normalize(dP) * atan(length(dP) * -pinchInt * 10.0) * 0.5 / atan(-pinchInt * 5); + #endif + + //--------------------------------------------- + + //ZOOMUV_ON + #if ZOOMUV_ON + d.texcoord0.xy -= centerTiled; + d.texcoord0.xy = d.texcoord0.xy * _ZoomUvAmount; + d.texcoord0.xy += centerTiled; + #endif + + //----------------------------------------------- + + //DOODLE_ON + #if DOODLE_ON + half2 uvCopy = uvRect; + _HandDrawnSpeed = (floor((_Time.x + randomSeed) * 20 * _HandDrawnSpeed) / _HandDrawnSpeed) * _HandDrawnSpeed; + uvCopy.x = sin((uvCopy.x * _HandDrawnAmount + _HandDrawnSpeed) * 4); + uvCopy.y = cos((uvCopy.y * _HandDrawnAmount + _HandDrawnSpeed) * 4); + d.texcoord0.xy = lerp(d.texcoord0.xy, d.texcoord0.xy + uvCopy, 0.0005 * _HandDrawnAmount); + #endif + + //-------------------------- + + //SHAKEUV_ON + #if SHAKEUV_ON + half xShake = sin((_Time.x + randomSeed) * _ShakeUvSpeed * 50) * _ShakeUvX; + half yShake = cos((_Time.x + randomSeed) * _ShakeUvSpeed * 50) * _ShakeUvY; + d.texcoord0.xy += half2(xShake * 0.012, yShake * 0.01); + #endif + + //------------------------------------------- + + //RECTSIZE_ON + #if RECTSIZE_ON + d.texcoord0.xy = d.texcoord0.xy * (_RectSize).xx + (((-_RectSize * 0.5) + 0.5)).xx; + #endif + + //------------------------------------------- + + //DISTORT_ON + #if DISTORT_ON + #if ATLAS_ON + d.texcoord3.x = d.texcoord3.x * (1 / (_MaxXUV - _MinXUV)); + d.texcoord3.y = d.texcoord3.y * (1 / (_MaxYUV - _MinYUV)); + #endif + + d.texcoord3.x += ((_Time.x + _RandomSeed) * _DistortTexXSpeed) % 1; + d.texcoord3.y += ((_Time.x + _RandomSeed) * _DistortTexYSpeed) % 1; + half distortAmnt = (SAMPLE_TEXTURE2D(_DistortTex, sampler_DistortTex, d.texcoord3.xy).r - 0.5) * 0.2 * _DistortAmount; + d.texcoord0.x += distortAmnt; + d.texcoord0.y += distortAmnt; + #endif + //------------------------------------------------------- + + //WARP_ON + #if WARP_ON + half2 warpUv = half2(d.texcoord0.x / _MainTex_ST.x, d.texcoord0.y / _MainTex_ST.y); + #if ATLAS_ON + warpUv = half2((warpUv.x - _MinXUV) / (_MaxXUV - _MinXUV), (warpUv.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + const float tau = 6.283185307179586; + float xWarp = (_Time.y + randomSeed) * _WarpSpeed + warpUv.x * tau / _WarpScale; + float yWarp = (_Time.y + randomSeed) * _WarpSpeed + warpUv.y * tau / _WarpScale; + float2 warp = float2(sin(xWarp), sin(yWarp)) * _WarpStrength; + d.texcoord0.xy += warp; + #endif + + //------------------------------------------------------- + + //WAVEUV_ON + #if WAVEUV_ON + float2 uvWave = half2(_WaveX * _MainTex_ST.x, _WaveY * _MainTex_ST.y) - d.texcoord0.xy; + uvWave %= 1; + #if ATLAS_ON + uvWave = half2(_WaveX, _WaveY) - uvRect; + #endif + uvWave.x *= _ScreenParams.x / _ScreenParams.y; + float waveTime = _Time.y + randomSeed; + float angWave = (sqrt(dot(uvWave, uvWave)) * _WaveAmount) - ((waveTime * _WaveSpeed)); + d.texcoord0.xy = d.texcoord0.xy + uvWave * sin(angWave) * (_WaveStrength / 1000.0); + #endif + //---------------------------------------------------- + + //ROUNDWAVEUV_ON + #if ROUNDWAVEUV_ON + half xWave = ((0.5 * _MainTex_ST.x) - uvRect.x); + half yWave = ((0.5 * _MainTex_ST.y) - uvRect.y) * (_MainTex_TexelSize.w / _MainTex_TexelSize.z); + half ripple = -sqrt(xWave*xWave + yWave* yWave); + d.texcoord0.xy += (sin((ripple + (_Time.y + randomSeed) * (_RoundWaveSpeed/10.0)) / 0.015) * (_RoundWaveStrength/10.0)) % 1; + #endif + //---------------------------------------------------- + + + //WIND_ON + #if WIND_ON + half windOffset = sin((_Time.x + randomSeed) * _GrassSpeed * 10); + half2 windCenter = half2(0.5, 0.1); + #if ATLAS_ON + windCenter.x = ((_MaxXUV - _MinXUV) * windCenter.x) + _MinXUV; + windCenter.y = ((_MaxYUV - _MinYUV) * windCenter.y) + _MinYUV; + #endif + #if !MANUALWIND_ON + d.texcoord0.x = fmod(abs(lerp(d.texcoord0.x, d.texcoord0.x + (_GrassWind * 0.01 * windOffset), uvRect.y)), 1); + #else + d.texcoord0.x = fmod(abs(lerp(d.texcoord0.x, d.texcoord0.x + (_GrassWind * 0.01 * _GrassManualAnim), uvRect.y)), 1); + windOffset = _GrassManualAnim; + #endif + half2 delta = d.texcoord0.xy - windCenter; + half delta2 = dot(delta.xy, delta.xy); + half2 delta_offset = delta2 * windOffset; + d.texcoord0.xy = d.texcoord0.xy + half2(delta.y, -delta.x) * delta_offset * _GrassRadialBend; + #endif + + //-------------------------------------------------------- + + //TEXTURESCROLL_ON && !ATLAS_ON + #if TEXTURESCROLL_ON && !ATLAS_ON + d.texcoord0.x += ((_Time.y + randomSeed) * _TextureScrollXSpeed) % 1; + d.texcoord0.y += ((_Time.y + randomSeed) * _TextureScrollYSpeed) % 1; + #endif + //------------------------------ + + //PIXELATE_ON + #if PIXELATE_ON + half aspectRatio = _MainTex_TexelSize.x / _MainTex_TexelSize.y; + half2 pixelSize = float2(_PixelateSize, _PixelateSize * aspectRatio); + d.texcoord0.xy = floor(d.texcoord0.xy * pixelSize) / pixelSize; + #endif + //-------------- + + half4 col = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy); + half originalAlpha = col.a; + col *= d.vertexColor; + + //NORMAL MAP + #if NORMALMAP_ON + half4 normalSample = SAMPLE_TEXTURE2D(_NormalMap, sampler_NormalMap, d.texcoord0.xy); + half3 normalTS = UnpackNormal(normalSample); + normalTS.xy *= _NormalStrength; + o.Normal = normalTS; + #endif + + + //GLITCH_ON + #if GLITCH_ON + half2 uvGlitch = uvRect; + uvGlitch.y -= 0.5; + half lineNoise = pow(rand2(floor(uvGlitch * half2(24., 19.) * _GlitchSize) * 4.0, randomSeed), 3.0) * _GlitchAmount + * pow(rand2(floor(uvGlitch * half2(38., 14.) * _GlitchSize) * 4.0, randomSeed), 3.0); + col = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(lineNoise * 0.02 * rand2(half2(2.0, 1), randomSeed), 0)) * d.vertexColor; + #endif + //-------------------------------------- + + //CHROMABERR_ON + #if CHROMABERR_ON + half4 r = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(_ChromAberrAmount/10, 0)) * d.vertexColor; + half4 b = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(-_ChromAberrAmount/10, 0)) * d.vertexColor; + col = half4(r.r * r.a, col.g, b.b * b.a, max(max(r.a, b.a) * _ChromAberrAlpha, col.a)); + #endif + + //-------------------------------- + + //BLUR_ON + #if BLUR_ON + #if ATLAS_ON + #if !BLURISHD_ON + col = BlurHD(d.texcoord0.xy, _MainTex, sampler_MainTex, _BlurIntensity, (_MaxXUV - _MinXUV), (_MaxYUV - _MinYUV)) * d.vertexColor; + #else + col = Blur(d.texcoord0.xy, _MainTex, sampler_MainTex, _BlurIntensity * (_MaxXUV - _MinXUV)) * d.vertexColor; + #endif + #else + #if !BLURISHD_ON + col = BlurHD(d.texcoord0.xy, _MainTex, sampler_MainTex, _BlurIntensity, 1, 1) * d.vertexColor; + #else + col = Blur(d.texcoord0.xy, _MainTex, sampler_MainTex, _BlurIntensity) * d.vertexColor; + #endif + #endif + #endif + + //-------------------- + + //MOTIONBLUR_ON + #if MOTIONBLUR_ON + _MotionBlurAngle = _MotionBlurAngle * 3.1415926; + #define rot(n) mul(n, half2x2(cos(_MotionBlurAngle), -sin(_MotionBlurAngle), sin(_MotionBlurAngle), cos(_MotionBlurAngle))) + _MotionBlurDist = _MotionBlurDist * 0.005; + #if ATLAS_ON + _MotionBlurDist *= (_MaxXUV - _MinXUV); + #endif + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(-_MotionBlurDist, -_MotionBlurDist))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(-_MotionBlurDist * 2, -_MotionBlurDist * 2))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(-_MotionBlurDist * 3, -_MotionBlurDist * 3))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(-_MotionBlurDist * 4, -_MotionBlurDist * 4))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(_MotionBlurDist, _MotionBlurDist))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(_MotionBlurDist * 2, _MotionBlurDist * 2))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(_MotionBlurDist * 3, _MotionBlurDist * 3))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(_MotionBlurDist * 4, _MotionBlurDist * 4))); + col.rgb = col.rgb / 9; + #endif + //------------------------------------ + + //NEGATIVE_ON + #if NEGATIVE_ON + col.rgb = lerp(col.rgb, 1 - col.rgb, _NegativeAmount); + #endif + + //-------------- + half luminance = 0; + + //GREYSCALE_ON && !GREYSCALEOUTLINE_ON + #if GREYSCALE_ON && !GREYSCALEOUTLINE_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + luminance = saturate(luminance + _GreyscaleLuminosity); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _GreyscaleTintColor, _GreyscaleBlend); + #endif + //------------------------------------ + + //GHOST_ON + #if GHOST_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + half4 ghostResult; + ghostResult.a = saturate(luminance - _GhostTransparency) * col.a; + ghostResult.rgb = col.rgb * (luminance + _GhostColorBoost); + col = lerp(col, ghostResult, _GhostBlend); + #endif + //------------------------------------ + + //INNEROUTLINE_ON + #if INNEROUTLINE_ON + half3 innerT = abs(GetPixel(0, _InnerOutlineThickness, d.texcoord0.xy, _MainTex, sampler_MainTex) - GetPixel(0, -_InnerOutlineThickness, d.texcoord0.xy, _MainTex, sampler_MainTex)); + innerT += abs(GetPixel(_InnerOutlineThickness, 0, d.texcoord0.xy, _MainTex, sampler_MainTex) - GetPixel(-_InnerOutlineThickness, 0, d.texcoord0.xy, _MainTex, sampler_MainTex)); + #if !ONLYINNEROUTLINE_ON + innerT = (innerT / 2.0) * col.a * _InnerOutlineAlpha; + col.rgb += length(innerT) * _InnerOutlineColor.rgb * _InnerOutlineGlow; + #else + innerT *= col.a * _InnerOutlineAlpha; + col.rgb = length(innerT) * _InnerOutlineColor.rgb * _InnerOutlineGlow; + col.a = step(0.3, col.r+col.g+col.b); + #endif + #endif + //------------------------------------------------------- + + //HITEFFECT_ON + #if HITEFFECT_ON + col.rgb = lerp(col.rgb, _HitEffectColor.rgb * _HitEffectGlow, _HitEffectBlend); + #endif + //-------------------- + + //GRADIENT_ON + #if GRADIENT_ON + half2 tiledUvGrad = half2(uvRect.x / _MainTex_ST.x, uvRect.y / _MainTex_ST.y); + #if GRADIENT2COL_ON + _GradTopRightCol = _GradTopLeftCol; + _GradBotRightCol = _GradBotLeftCol; + #endif + #if RADIALGRADIENT_ON + half radialDist = 1 - length(tiledUvGrad - half2(0.5, 0.5)); + radialDist *= (_MainTex_TexelSize.w / _MainTex_TexelSize.z); + radialDist = saturate(_GradBoostX * radialDist); + half4 gradientResult = lerp(_GradTopLeftCol, _GradBotLeftCol, radialDist); + #else + half gradXLerpFactor = saturate(pow(tiledUvGrad.x, _GradBoostX)); + half4 gradientResult = lerp(lerp(_GradBotLeftCol, _GradBotRightCol, gradXLerpFactor), + lerp(_GradTopLeftCol, _GradTopRightCol, gradXLerpFactor), saturate(pow(tiledUvGrad.y, _GradBoostY))); + #endif + gradientResult = lerp(col, gradientResult, _GradBlend); + col.rgb = gradientResult.rgb * col.a; + col.a *= gradientResult.a; + #endif + //-------------------------------------------------------------------- + + //CONTRAST_ON + #if CONTRAST_ON + col.rgb = (col.rgb - float3(0.5, 0.5, 0.5)) * _Contrast + float3(0.5, 0.5, 0.5); + col.rgb += _Brightness; + #endif + + //------------------------------------------------------------------- + + //COLORSWAP_ON + #if COLORSWAP_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + half4 swapMask = SAMPLE_TEXTURE2D(_ColorSwapTex, sampler_ColorSwapTex, d.texcoord0.xy); + swapMask.rgb *= swapMask.a; + half3 redSwap = _ColorSwapRed * swapMask.r * saturate(luminance + _ColorSwapRedLuminosity); + half3 greenSwap = _ColorSwapGreen * swapMask.g * saturate(luminance + _ColorSwapGreenLuminosity); + half3 blueSwap = _ColorSwapBlue * swapMask.b * saturate(luminance + _ColorSwapBlueLuminosity); + swapMask.rgb = col.rgb * saturate(1 - swapMask.r - swapMask.g - swapMask.b); + col.rgb = lerp(col.rgb, swapMask.rgb + redSwap + greenSwap + blueSwap, _ColorSwapBlend); + #endif + //-------------------------------------------------------------------- + + //COLORRAMP_ON && !COLORRAMPOUTLINE_ON + #if COLORRAMP_ON && !COLORRAMPOUTLINE_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + luminance = saturate(luminance + _ColorRampLuminosity); + #if GRADIENTCOLORRAMP_ON + col.rgb = lerp(col.rgb, SAMPLE_TEXTURE2D(_ColorRampTexGradient, sampler_ColorRampTexGradient, half2(luminance, 0)).rgb, _ColorRampBlend); + #else + col.rgb = lerp(col.rgb, SAMPLE_TEXTURE2D(_ColorRampTex, sampler_ColorRampTex, half2(luminance, 0)).rgb, _ColorRampBlend); + #endif + #endif + //-------------------------------------------------------------------- + + //CHANGECOLOR_ON + #if CHANGECOLOR_ON + float3 currChangeColor = saturate(col.rgb); + luminance = 0.3 * currChangeColor.r + 0.59 * currChangeColor.g + 0.11 * currChangeColor.b; + luminance = saturate(luminance + _ColorChangeLuminosity); + half3 dif = abs(currChangeColor - _ColorChangeTarget.rgb); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _ColorChangeNewCol.rgb, + max(sign(1 - saturate(dif.x + dif.y + dif.z) - _ColorChangeTolerance), 0.0)); + #if CHANGECOLOR2_ON + dif = abs(currChangeColor - _ColorChangeTarget2.rgb); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _ColorChangeNewCol2.rgb, + max(sign(1 - saturate(dif.x + dif.y + dif.z) - _ColorChangeTolerance2), 0.0)); + #endif + #if CHANGECOLOR3_ON + dif = abs(currChangeColor - _ColorChangeTarget3.rgb); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _ColorChangeNewCol3.rgb, + max(sign(1 - saturate(dif.x + dif.y + dif.z) - _ColorChangeTolerance3), 0.0)); + #endif + #endif + //------------------------------------------------------- + + //POSTERIZE_ON && !POSTERIZEOUTLINE_ON + #if POSTERIZE_ON && !POSTERIZEOUTLINE_ON + col.rgb = pow(col.rgb, _PosterizeGamma) * _PosterizeNumColors; + col.rgb = floor(col.rgb) / _PosterizeNumColors; + col.rgb = pow(col.rgb, 1.0 / _PosterizeGamma); + #endif + //------------------------------------ + + //HSV_ON + #if HSV_ON + half3 resultHsv = half3(col.rgb); + half cosHsv = _HsvBright * _HsvSaturation * cos(_HsvShift * 3.14159265 / 180); + half sinHsv = _HsvBright * _HsvSaturation * sin(_HsvShift * 3.14159265 / 180); + resultHsv.x = (.299 * _HsvBright + .701 * cosHsv + .168 * sinHsv) * col.x + + (.587 * _HsvBright - .587 * cosHsv + .330 * sinHsv) * col.y + + (.114 * _HsvBright - .114 * cosHsv - .497 * sinHsv) * col.z; + resultHsv.y = (.299 * _HsvBright - .299 * cosHsv - .328 * sinHsv) *col.x + + (.587 * _HsvBright + .413 * cosHsv + .035 * sinHsv) * col.y + + (.114 * _HsvBright - .114 * cosHsv + .292 * sinHsv) * col.z; + resultHsv.z = (.299 * _HsvBright - .3 * cosHsv + 1.25 * sinHsv) * col.x + + (.587 * _HsvBright - .588 * cosHsv - 1.05 * sinHsv) * col.y + + (.114 * _HsvBright + .886 * cosHsv - .203 * sinHsv) * col.z; + col.rgb = resultHsv; + #endif + //------------------------------------------------------- + + //OVERLAY_ON + #if OVERLAY_ON + half2 overlayUvs = d.texcoord0.xy; + overlayUvs.x += ((_Time.y + randomSeed) * _OverlayTextureScrollXSpeed) % 1; + overlayUvs.y += ((_Time.y + randomSeed) * _OverlayTextureScrollYSpeed) % 1; + half4 overlayCol = SAMPLE_TEXTURE2D(_OverlayTex, sampler_OverlayTex, TRANSFORM_TEX(overlayUvs, _OverlayTex)); + overlayCol.rgb *= _OverlayColor.rgb * _OverlayGlow; + #if !OVERLAYMULT_ON + overlayCol.rgb *= overlayCol.a * _OverlayColor.rgb * _OverlayColor.a * _OverlayBlend; + col.rgb += overlayCol.rgb; + #else + overlayCol.a *= _OverlayColor.a; + col = lerp(col, col * overlayCol, _OverlayBlend); + #endif + #endif + + //--------------------------------- + + //OUTBASE_ON + #if OUTBASE_ON + #if OUTBASEPIXELPERF_ON + half2 destUv = half2(_OutlinePixelWidth * _MainTex_TexelSize.x, _OutlinePixelWidth * _MainTex_TexelSize.y); + #else + half2 destUv = half2(_OutlineWidth * _MainTex_TexelSize.x * 200, _OutlineWidth * _MainTex_TexelSize.y * 200); + #endif + + #if OUTDIST_ON + d.texcoord3.x += ((_Time.x + _RandomSeed) * _OutlineDistortTexXSpeed) % 1; + d.texcoord3.y += ((_Time.x + _RandomSeed) * _OutlineDistortTexYSpeed) % 1; + #if ATLAS_ON + d.texcoord3 = half2((d.texcoord3.x - _MinXUV) / (_MaxXUV - _MinXUV), (d.texcoord3.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half outDistortAmnt = (SAMPLE_TEXTURE2D(_OutlineDistortTex, sampler_OutlineDistortTex, d.texcoord3).r - 0.5) * 0.2 * _OutlineDistortAmount; + destUv.x += outDistortAmnt; + destUv.y += outDistortAmnt; + #endif + + half spriteLeft = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(destUv.x, 0)).a; + half spriteRight = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy - half2(destUv.x, 0)).a; + half spriteBottom = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(0, destUv.y)).a; + half spriteTop = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy - half2(0, destUv.y)).a; + half result = spriteLeft + spriteRight + spriteBottom + spriteTop; + + #if OUTBASE8DIR_ON + half spriteTopLeft = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(destUv.x, destUv.y)).a; + half spriteTopRight = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(-destUv.x, destUv.y)).a; + half spriteBotLeft = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(destUv.x, -destUv.y)).a; + half spriteBotRight = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(-destUv.x, -destUv.y)).a; + result = result + spriteTopLeft + spriteTopRight + spriteBotLeft + spriteBotRight; + #endif + + result = step(0.05, saturate(result)); + + #if OUTTEX_ON + d.texcoord1.x += ((_Time.x + _RandomSeed) * _OutlineTexXSpeed) % 1; + d.texcoord1.y += ((_Time.x + _RandomSeed) * _OutlineTexYSpeed) % 1; + #if ATLAS_ON + d.texcoord1 = half2((d.texcoord1.x - _MinXUV) / (_MaxXUV - _MinXUV), (d.texcoord1.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half4 tempOutColor = SAMPLE_TEXTURE2D(_OutlineTex, sampler_OutlineTex, d.texcoord1); + tempOutColor *= _OutlineColor; + _OutlineColor = tempOutColor; + #endif + + result *= (1 - originalAlpha) * _OutlineAlpha; + + half4 outline = _OutlineColor * d.vertexColor.a; + outline.rgb *= _OutlineGlow; + outline.a = result; + #if ONLYOUTLINE_ON + col = outline; + #else + col = lerp(col, outline, result); + #endif + #endif + //------------------------------------------------------- + + //FADE_ON + #if FADE_ON + half2 tiledUvFade1 = TRANSFORM_TEX(d.texcoord0, _FadeTex); + half2 tiledUvFade2 = TRANSFORM_TEX(d.texcoord0, _FadeBurnTex); + #if ATLAS_ON + tiledUvFade1 = half2((tiledUvFade1.x - _MinXUV) / (_MaxXUV - _MinXUV), (tiledUvFade1.y - _MinYUV) / (_MaxYUV - _MinYUV)); + tiledUvFade2 = half2((tiledUvFade2.x - _MinXUV) / (_MaxXUV - _MinXUV), (tiledUvFade2.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half fadeTemp = SAMPLE_TEXTURE2D(_FadeTex, sampler_FadeTex, tiledUvFade1).r; + half fade = smoothstep(_FadeAmount, _FadeAmount + _FadeBurnTransition, fadeTemp); + half fadeBurn = saturate(smoothstep(_FadeAmount - _FadeBurnWidth, _FadeAmount - _FadeBurnWidth + 0.1, fadeTemp) * _FadeAmount); + col.a *= fade; + _FadeBurnColor.rgb *= _FadeBurnGlow; + col += fadeBurn * SAMPLE_TEXTURE2D(_FadeBurnTex, sampler_FadeBurnTex, tiledUvFade2) * _FadeBurnColor * originalAlpha * (1 - col.a); + #endif + //------------------------------------------------------- + + //SHADOW_ON + #if SHADOW_ON + half shadowA = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(_ShadowX, _ShadowY)).a; + half preMultShadowMask = 1 - (saturate(shadowA - col.a) * (1 - col.a)); + col.rgb *= 1 - ((shadowA - col.a) * (1 - col.a)); + col.rgb += (_ShadowColor * shadowA) * (1 - col.a); + col.a = max(shadowA * _ShadowAlpha * d.vertexColor.a, col.a); + #endif + + //------------------------------------------------------- + + //GLOW_ON + #if GLOW_ON + half4 emission; + #if GLOWTEX_ON + emission = SAMPLE_TEXTURE2D(_GlowTex, sampler_GlowTex, d.texcoord0); + #else + emission = col; + #endif + + col.rgb *= _GlowGlobal; + emission.rgb *= emission.a * col.a * _Glow * _GlowColor; + col.rgb += emission.rgb; + #endif + //------------------------------------------------------- + + //COLORRAMP_ON && COLORRAMPOUTLINE_ON + #if COLORRAMP_ON && COLORRAMPOUTLINE_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + luminance = saturate(luminance + _ColorRampLuminosity); + #if GRADIENTCOLORRAMP_ON + col.rgb = lerp(col.rgb, SAMPLE_TEXTURE2D(_ColorRampTexGradient, sampler_ColorRampTexGradient, half2(luminance, 0)).rgb, _ColorRampBlend); + #else + col.rgb = lerp(col.rgb, SAMPLE_TEXTURE2D(_ColorRampTex, sampler_ColorRampTex, half2(luminance, 0)).rgb, _ColorRampBlend); + #endif + #endif + //--------------- + + //GREYSCALE_ON && GREYSCALEOUTLINE_ON + #if GREYSCALE_ON && GREYSCALEOUTLINE_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + luminance = saturate(luminance + _GreyscaleLuminosity); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _GreyscaleTintColor, _GreyscaleBlend); + #endif + + //----------------------------------- + + //POSTERIZE_ON && POSTERIZEOUTLINE_ON + #if POSTERIZE_ON && POSTERIZEOUTLINE_ON + col.rgb = pow(col.rgb, _PosterizeGamma) * _PosterizeNumColors; + col.rgb = floor(col.rgb) / _PosterizeNumColors; + col.rgb = pow(col.rgb, 1.0 / _PosterizeGamma); + #endif + + //----------------------------------- + + //SHINE_ON + #if SHINE_ON + half2 uvShine = uvRect; + half cosAngle = cos(_ShineRotate); + half sinAngle = sin(_ShineRotate); + half2x2 rot = half2x2(cosAngle, -sinAngle, sinAngle, cosAngle); + uvShine -= half2(0.5, 0.5); + uvShine = mul(rot, uvShine); + uvShine += half2(0.5, 0.5); + half shineMask = SAMPLE_TEXTURE2D(_ShineMask, sampler_ShineMask, d.texcoord0.xy).a; + half currentDistanceProjection = (uvShine.x + uvShine.y) / 2; + half whitePower = 1 - (abs(currentDistanceProjection - _ShineLocation) / _ShineWidth); + col.rgb += col.a * whitePower * _ShineGlow * max(sign(currentDistanceProjection - (_ShineLocation - _ShineWidth)), 0.0) + * max(sign((_ShineLocation + _ShineWidth) - currentDistanceProjection), 0.0) * _ShineColor * shineMask; + #endif + + //----------------------------------- + + //HOLOGRAM_ON + #if HOLOGRAM_ON + half totalHologram = _HologramStripesAmount + _HologramUnmodAmount; + half hologramYCoord = ((uvRect.y + (((_Time.x + randomSeed) % 1) * _HologramStripesSpeed)) % totalHologram) / totalHologram; + hologramYCoord = abs(hologramYCoord); + half alpha = RemapFloat(saturate(hologramYCoord - (_HologramUnmodAmount/totalHologram)), 0.0, 1.0, _HologramMinAlpha, saturate(_HologramMaxAlpha)); + half hologramMask = max(sign((_HologramUnmodAmount/totalHologram) - hologramYCoord), 0.0); + half4 hologramResult = col; + hologramResult.a *= lerp(alpha, 1, hologramMask); + hologramResult.rgb *= max(1, _HologramMaxAlpha * max(sign(hologramYCoord - (_HologramUnmodAmount/totalHologram)), 0.0)); + hologramMask = 1 - step(0.01,hologramMask); + hologramResult.rgb += hologramMask * _HologramStripeColor * col.a; + col = lerp(col, hologramResult, _HologramBlend); + #endif + + //----------------------------------- + + //FLICKER_ON + #if FLICKER_ON + col.a *= saturate(col.a * step(frac(0.05 + (_Time.w + randomSeed) * _FlickerFreq), 1 - _FlickerPercent) + _FlickerAlpha); + #endif + //----------------------------------- + + //ALPHACUTOFF_ON + + //ALPHAROUND_ON + + //ALPHAOUTLINE_ON + #if ALPHAOUTLINE_ON + half alphaOutlineRes = pow(1 - col.a, max(_AlphaOutlinePower, 0.0001)) * step(_AlphaOutlineMinAlpha, col.a) * _AlphaOutlineBlend; + col.rgb = lerp(col.rgb, _AlphaOutlineColor.rgb * _AlphaOutlineGlow, alphaOutlineRes); + col.a = lerp(col.a, 1, alphaOutlineRes > 1); + #endif + //------------------------------------------------------- + + //FOG_ON + + //------------------ + + col *= _Color; + o.Albedo = col; + col.a *= _Alpha; + clip(col.a - _AlphaCutoffValue - 0.01); + o.Alpha = _Color.a; + } + + + + + + void ChainSurfaceFunction(inout Surface l, inout ShaderData d) + { + Ext_SurfaceFunction0(l, d); + // Ext_SurfaceFunction1(l, d); + // Ext_SurfaceFunction2(l, d); + // Ext_SurfaceFunction3(l, d); + // Ext_SurfaceFunction4(l, d); + // Ext_SurfaceFunction5(l, d); + // Ext_SurfaceFunction6(l, d); + // Ext_SurfaceFunction7(l, d); + // Ext_SurfaceFunction8(l, d); + // Ext_SurfaceFunction9(l, d); + // Ext_SurfaceFunction10(l, d); + // Ext_SurfaceFunction11(l, d); + // Ext_SurfaceFunction12(l, d); + // Ext_SurfaceFunction13(l, d); + // Ext_SurfaceFunction14(l, d); + // Ext_SurfaceFunction15(l, d); + // Ext_SurfaceFunction16(l, d); + // Ext_SurfaceFunction17(l, d); + // Ext_SurfaceFunction18(l, d); + // Ext_SurfaceFunction19(l, d); + // Ext_SurfaceFunction20(l, d); + // Ext_SurfaceFunction21(l, d); + // Ext_SurfaceFunction22(l, d); + // Ext_SurfaceFunction23(l, d); + // Ext_SurfaceFunction24(l, d); + // Ext_SurfaceFunction25(l, d); + // Ext_SurfaceFunction26(l, d); + // Ext_SurfaceFunction27(l, d); + // Ext_SurfaceFunction28(l, d); + // Ext_SurfaceFunction29(l, d); + } + +#if !_DECALSHADER + + void ChainModifyVertex(inout VertexData v, inout VertexToPixel v2p, float4 time) + { + ExtraV2F d; + + ZERO_INITIALIZE(ExtraV2F, d); + ZERO_INITIALIZE(Blackboard, d.blackboard); + // due to motion vectors in HDRP, we need to use the last + // time in certain spots. So if you are going to use _Time to adjust vertices, + // you need to use this time or motion vectors will break. + d.time = time; + + Ext_ModifyVertex0(v, d); + // Ext_ModifyVertex1(v, d); + // Ext_ModifyVertex2(v, d); + // Ext_ModifyVertex3(v, d); + // Ext_ModifyVertex4(v, d); + // Ext_ModifyVertex5(v, d); + // Ext_ModifyVertex6(v, d); + // Ext_ModifyVertex7(v, d); + // Ext_ModifyVertex8(v, d); + // Ext_ModifyVertex9(v, d); + // Ext_ModifyVertex10(v, d); + // Ext_ModifyVertex11(v, d); + // Ext_ModifyVertex12(v, d); + // Ext_ModifyVertex13(v, d); + // Ext_ModifyVertex14(v, d); + // Ext_ModifyVertex15(v, d); + // Ext_ModifyVertex16(v, d); + // Ext_ModifyVertex17(v, d); + // Ext_ModifyVertex18(v, d); + // Ext_ModifyVertex19(v, d); + // Ext_ModifyVertex20(v, d); + // Ext_ModifyVertex21(v, d); + // Ext_ModifyVertex22(v, d); + // Ext_ModifyVertex23(v, d); + // Ext_ModifyVertex24(v, d); + // Ext_ModifyVertex25(v, d); + // Ext_ModifyVertex26(v, d); + // Ext_ModifyVertex27(v, d); + // Ext_ModifyVertex28(v, d); + // Ext_ModifyVertex29(v, d); + + + // #if %EXTRAV2F0REQUIREKEY% + // v2p.extraV2F0 = d.extraV2F0; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // v2p.extraV2F1 = d.extraV2F1; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // v2p.extraV2F2 = d.extraV2F2; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // v2p.extraV2F3 = d.extraV2F3; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // v2p.extraV2F4 = d.extraV2F4; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // v2p.extraV2F5 = d.extraV2F5; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // v2p.extraV2F6 = d.extraV2F6; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // v2p.extraV2F7 = d.extraV2F7; + // #endif + } + + void ChainModifyTessellatedVertex(inout VertexData v, inout VertexToPixel v2p) + { + ExtraV2F d; + ZERO_INITIALIZE(ExtraV2F, d); + ZERO_INITIALIZE(Blackboard, d.blackboard); + + // #if %EXTRAV2F0REQUIREKEY% + // d.extraV2F0 = v2p.extraV2F0; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // d.extraV2F1 = v2p.extraV2F1; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // d.extraV2F2 = v2p.extraV2F2; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // d.extraV2F3 = v2p.extraV2F3; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // d.extraV2F4 = v2p.extraV2F4; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // d.extraV2F5 = v2p.extraV2F5; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // d.extraV2F6 = v2p.extraV2F6; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // d.extraV2F7 = v2p.extraV2F7; + // #endif + + + // Ext_ModifyTessellatedVertex0(v, d); + // Ext_ModifyTessellatedVertex1(v, d); + // Ext_ModifyTessellatedVertex2(v, d); + // Ext_ModifyTessellatedVertex3(v, d); + // Ext_ModifyTessellatedVertex4(v, d); + // Ext_ModifyTessellatedVertex5(v, d); + // Ext_ModifyTessellatedVertex6(v, d); + // Ext_ModifyTessellatedVertex7(v, d); + // Ext_ModifyTessellatedVertex8(v, d); + // Ext_ModifyTessellatedVertex9(v, d); + // Ext_ModifyTessellatedVertex10(v, d); + // Ext_ModifyTessellatedVertex11(v, d); + // Ext_ModifyTessellatedVertex12(v, d); + // Ext_ModifyTessellatedVertex13(v, d); + // Ext_ModifyTessellatedVertex14(v, d); + // Ext_ModifyTessellatedVertex15(v, d); + // Ext_ModifyTessellatedVertex16(v, d); + // Ext_ModifyTessellatedVertex17(v, d); + // Ext_ModifyTessellatedVertex18(v, d); + // Ext_ModifyTessellatedVertex19(v, d); + // Ext_ModifyTessellatedVertex20(v, d); + // Ext_ModifyTessellatedVertex21(v, d); + // Ext_ModifyTessellatedVertex22(v, d); + // Ext_ModifyTessellatedVertex23(v, d); + // Ext_ModifyTessellatedVertex24(v, d); + // Ext_ModifyTessellatedVertex25(v, d); + // Ext_ModifyTessellatedVertex26(v, d); + // Ext_ModifyTessellatedVertex27(v, d); + // Ext_ModifyTessellatedVertex28(v, d); + // Ext_ModifyTessellatedVertex29(v, d); + + // #if %EXTRAV2F0REQUIREKEY% + // v2p.extraV2F0 = d.extraV2F0; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // v2p.extraV2F1 = d.extraV2F1; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // v2p.extraV2F2 = d.extraV2F2; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // v2p.extraV2F3 = d.extraV2F3; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // v2p.extraV2F4 = d.extraV2F4; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // v2p.extraV2F5 = d.extraV2F5; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // v2p.extraV2F6 = d.extraV2F6; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // v2p.extraV2F7 = d.extraV2F7; + // #endif + } + + void ChainFinalColorForward(inout Surface l, inout ShaderData d, inout half4 color) + { + // Ext_FinalColorForward0(l, d, color); + // Ext_FinalColorForward1(l, d, color); + // Ext_FinalColorForward2(l, d, color); + // Ext_FinalColorForward3(l, d, color); + // Ext_FinalColorForward4(l, d, color); + // Ext_FinalColorForward5(l, d, color); + // Ext_FinalColorForward6(l, d, color); + // Ext_FinalColorForward7(l, d, color); + // Ext_FinalColorForward8(l, d, color); + // Ext_FinalColorForward9(l, d, color); + // Ext_FinalColorForward10(l, d, color); + // Ext_FinalColorForward11(l, d, color); + // Ext_FinalColorForward12(l, d, color); + // Ext_FinalColorForward13(l, d, color); + // Ext_FinalColorForward14(l, d, color); + // Ext_FinalColorForward15(l, d, color); + // Ext_FinalColorForward16(l, d, color); + // Ext_FinalColorForward17(l, d, color); + // Ext_FinalColorForward18(l, d, color); + // Ext_FinalColorForward19(l, d, color); + // Ext_FinalColorForward20(l, d, color); + // Ext_FinalColorForward21(l, d, color); + // Ext_FinalColorForward22(l, d, color); + // Ext_FinalColorForward23(l, d, color); + // Ext_FinalColorForward24(l, d, color); + // Ext_FinalColorForward25(l, d, color); + // Ext_FinalColorForward26(l, d, color); + // Ext_FinalColorForward27(l, d, color); + // Ext_FinalColorForward28(l, d, color); + // Ext_FinalColorForward29(l, d, color); + } + + void ChainFinalGBufferStandard(inout Surface s, inout ShaderData d, inout half4 GBuffer0, inout half4 GBuffer1, inout half4 GBuffer2, inout half4 outEmission, inout half4 outShadowMask) + { + // Ext_FinalGBufferStandard0(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard1(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard2(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard3(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard4(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard5(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard6(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard7(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard8(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard9(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard10(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard11(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard12(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard13(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard14(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard15(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard16(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard17(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard18(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard19(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard20(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard21(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard22(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard23(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard24(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard25(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard26(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard27(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard28(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard29(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + } +#endif + + + + + +#if _DECALSHADER + + ShaderData CreateShaderData(SurfaceDescriptionInputs IN) + { + ShaderData d = (ShaderData)0; + d.TBNMatrix = float3x3(IN.WorldSpaceTangent, IN.WorldSpaceBiTangent, IN.WorldSpaceNormal); + d.worldSpaceNormal = IN.WorldSpaceNormal; + d.worldSpaceTangent = IN.WorldSpaceTangent; + + d.worldSpacePosition = IN.WorldSpacePosition; + d.texcoord0 = IN.uv0.xyxy; + d.screenPos = IN.ScreenPosition; + + d.worldSpaceViewDir = normalize(_WorldSpaceCameraPos - d.worldSpacePosition); + + d.tangentSpaceViewDir = mul(d.TBNMatrix, d.worldSpaceViewDir); + + // these rarely get used, so we back transform them. Usually will be stripped. + #if _HDRP + // d.localSpacePosition = mul(GetWorldToObjectMatrix(), float4(GetCameraRelativePositionWS(d.worldSpacePosition), 1)).xyz; + #else + // d.localSpacePosition = mul(GetWorldToObjectMatrix(), float4(d.worldSpacePosition, 1)).xyz; + #endif + // d.localSpaceNormal = normalize(mul((float3x3)GetWorldToObjectMatrix(), d.worldSpaceNormal)); + // d.localSpaceTangent = normalize(mul((float3x3)GetWorldToObjectMatrix(), d.worldSpaceTangent.xyz)); + + // #if %SCREENPOSREQUIREKEY% + // d.screenUV = (IN.ScreenPosition.xy / max(0.01, IN.ScreenPosition.w)); + // #endif + + return d; + } +#else + + ShaderData CreateShaderData(VertexToPixel i + #if NEED_FACING + , bool facing + #endif + ) + { + ShaderData d = (ShaderData)0; + d.clipPos = i.pos; + d.worldSpacePosition = i.worldPos; + + d.worldSpaceNormal = normalize(i.worldNormal); + d.worldSpaceTangent.xyz = normalize(i.worldTangent.xyz); + + d.tangentSign = i.worldTangent.w * unity_WorldTransformParams.w; + float3 bitangent = cross(d.worldSpaceTangent.xyz, d.worldSpaceNormal) * d.tangentSign; + + d.TBNMatrix = float3x3(d.worldSpaceTangent, -bitangent, d.worldSpaceNormal); + d.worldSpaceViewDir = normalize(_WorldSpaceCameraPos - i.worldPos); + + d.tangentSpaceViewDir = mul(d.TBNMatrix, d.worldSpaceViewDir); + d.texcoord0 = i.texcoord0; + d.texcoord1 = i.texcoord1; + d.texcoord2 = i.texcoord2; + + // #if %TEXCOORD3REQUIREKEY% + d.texcoord3 = i.texcoord3; + // #endif + + // d.isFrontFace = facing; + // #if %VERTEXCOLORREQUIREKEY% + d.vertexColor = i.vertexColor; + // #endif + + // these rarely get used, so we back transform them. Usually will be stripped. + #if _HDRP + // d.localSpacePosition = mul(GetWorldToObjectMatrix(), float4(GetCameraRelativePositionWS(i.worldPos), 1)).xyz; + #else + // d.localSpacePosition = mul(GetWorldToObjectMatrix(), float4(i.worldPos, 1)).xyz; + #endif + // d.localSpaceNormal = normalize(mul((float3x3)GetWorldToObjectMatrix(), i.worldNormal)); + // d.localSpaceTangent = normalize(mul((float3x3)GetWorldToObjectMatrix(), i.worldTangent.xyz)); + + // #if %SCREENPOSREQUIREKEY% + // d.screenPos = i.screenPos; + // d.screenUV = (i.screenPos.xy / i.screenPos.w); + // #endif + + + // #if %EXTRAV2F0REQUIREKEY% + // d.extraV2F0 = i.extraV2F0; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // d.extraV2F1 = i.extraV2F1; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // d.extraV2F2 = i.extraV2F2; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // d.extraV2F3 = i.extraV2F3; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // d.extraV2F4 = i.extraV2F4; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // d.extraV2F5 = i.extraV2F5; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // d.extraV2F6 = i.extraV2F6; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // d.extraV2F7 = i.extraV2F7; + // #endif + + return d; + } + +#endif + + + #if _PASSSHADOW + float3 _LightDirection; + #endif + + // vertex shader + VertexToPixel Vert (VertexData v) + { + + VertexToPixel o = (VertexToPixel)0; + + UNITY_SETUP_INSTANCE_ID(v); + UNITY_TRANSFER_INSTANCE_ID(v, o); + UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o); + + +#if !_TESSELLATION_ON + ChainModifyVertex(v, o, _Time); +#endif + + o.texcoord0 = v.texcoord0; + o.texcoord1 = v.texcoord1; + o.texcoord2 = v.texcoord2; + + // #if %TEXCOORD3REQUIREKEY% + o.texcoord3 = v.texcoord3; + // #endif + + // #if %VERTEXCOLORREQUIREKEY% + o.vertexColor = v.vertexColor; + // #endif + + VertexPositionInputs vertexInput = GetVertexPositionInputs(v.vertex.xyz); + o.worldPos = TransformObjectToWorld(v.vertex.xyz); + o.worldNormal = TransformObjectToWorldNormal(v.normal); + o.worldTangent = float4(TransformObjectToWorldDir(v.tangent.xyz), v.tangent.w); + + + #if _PASSSHADOW + // Define shadow pass specific clip position for Universal + o.pos = TransformWorldToHClip(ApplyShadowBias(o.worldPos, o.worldNormal, _LightDirection)); + #if UNITY_REVERSED_Z + o.pos.z = min(o.pos.z, UNITY_NEAR_CLIP_VALUE); + #else + o.pos.z = max(o.pos.z, UNITY_NEAR_CLIP_VALUE); + #endif + #elif _PASSMETA + o.pos = MetaVertexPosition(float4(v.vertex.xyz, 0), v.texcoord1, v.texcoord2, unity_LightmapST, unity_DynamicLightmapST); + #else + o.pos = TransformWorldToHClip(o.worldPos); + #endif + + // #if %SCREENPOSREQUIREKEY% + // o.screenPos = ComputeScreenPos(o.pos, _ProjectionParams.x); + // #endif + + #if _PASSFORWARD + OUTPUT_LIGHTMAP_UV(v.texcoord1, unity_LightmapST, o.lightmapUV); + OUTPUT_SH(o.worldNormal, o.sh); + #endif + + #ifdef VARYINGS_NEED_FOG_AND_VERTEX_LIGHT + #if _BAKEDLIT + half3 vertexLight = 0; + #else + half3 vertexLight = VertexLighting(o.worldPos, o.worldNormal); + #endif + half fogFactor = ComputeFogFactor(o.pos.z); + o.fogFactorAndVertexLight = half4(fogFactor, vertexLight); + #endif + + #ifdef _MAIN_LIGHT_SHADOWS + o.shadowCoord = GetShadowCoord(vertexInput); + #endif + + return o; + } + + + + + // fragment shader + half4 Frag (VertexToPixel IN + #ifdef _DEPTHOFFSET_ON + , out float outputDepth : SV_Depth + #endif + #if NEED_FACING + , bool facing : SV_IsFrontFace + #endif + ) : SV_Target + { + UNITY_SETUP_INSTANCE_ID(IN); + UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX(IN); + + ShaderData d = CreateShaderData(IN + #if NEED_FACING + , facing + #endif + ); + Surface l = (Surface)0; + + #ifdef _DEPTHOFFSET_ON + l.outputDepth = outputDepth; + #endif + + l.Albedo = half3(0.5, 0.5, 0.5); + l.Normal = float3(0,0,1); + l.Occlusion = 1; + l.Alpha = 1; + + ChainSurfaceFunction(l, d); + + #ifdef _DEPTHOFFSET_ON + outputDepth = l.outputDepth; + #endif + + return 0; + + } + + ENDHLSL + + } + + + + Pass + { + Name "Meta" + Tags + { + "LightMode" = "Meta" + } + + // Render State + Cull Off + // ColorMask: + + Tags { "RenderType" = "Opaque" "Queue" = "Geometry" "PreviewType" = "Plane" } + Cull [_CullingOption] + ZWrite [_ZWrite] + ZTest [_ZTestMode] + + + HLSLPROGRAM + + #pragma vertex Vert + #pragma fragment Frag + + #pragma target 3.0 + + #pragma prefer_hlslcc gles + #pragma exclude_renderers d3d11_9x + + #define SHADERPASS_META + #define _PASSMETA 1 + + + + #pragma shader_feature_local GLOW_ON + #pragma shader_feature_local FADE_ON + #pragma shader_feature_local OUTBASE_ON + #pragma shader_feature_local ONLYOUTLINE_ON + #pragma shader_feature_local GRADIENT_ON + #pragma shader_feature_local GRADIENT2COL_ON + #pragma shader_feature_local RADIALGRADIENT_ON + #pragma shader_feature_local COLORSWAP_ON + #pragma shader_feature_local HSV_ON + #pragma shader_feature_local CHANGECOLOR_ON + #pragma shader_feature_local CHANGECOLOR2_ON + #pragma shader_feature_local CHANGECOLOR3_ON + #pragma shader_feature_local COLORRAMP_ON + #pragma shader_feature_local GRADIENTCOLORRAMP_ON + #pragma shader_feature_local HITEFFECT_ON + #pragma shader_feature_local NEGATIVE_ON + #pragma shader_feature_local PIXELATE_ON + #pragma shader_feature_local GREYSCALE_ON + #pragma shader_feature_local POSTERIZE_ON + #pragma shader_feature_local BLUR_ON + #pragma shader_feature_local MOTIONBLUR_ON + #pragma shader_feature_local GHOST_ON + #pragma shader_feature_local ALPHAOUTLINE_ON + #pragma shader_feature_local INNEROUTLINE_ON + #pragma shader_feature_local ONLYINNEROUTLINE_ON + #pragma shader_feature_local HOLOGRAM_ON + #pragma shader_feature_local CHROMABERR_ON + #pragma shader_feature_local GLITCH_ON + #pragma shader_feature_local FLICKER_ON + #pragma shader_feature_local SHADOW_ON + #pragma shader_feature_local SHINE_ON + #pragma shader_feature_local CONTRAST_ON + #pragma shader_feature_local OVERLAY_ON + #pragma shader_feature_local OVERLAYMULT_ON + #pragma shader_feature_local DOODLE_ON + #pragma shader_feature_local WIND_ON + #pragma shader_feature_local WAVEUV_ON + #pragma shader_feature_local ROUNDWAVEUV_ON + #pragma shader_feature_local RECTSIZE_ON + #pragma shader_feature_local OFFSETUV_ON + #pragma shader_feature_local CLIPPING_ON + #pragma shader_feature_local RADIALCLIPPING_ON + #pragma shader_feature_local TEXTURESCROLL_ON + #pragma shader_feature_local ZOOMUV_ON + #pragma shader_feature_local DISTORT_ON + #pragma shader_feature_local WARP_ON + #pragma shader_feature_local TWISTUV_ON + #pragma shader_feature_local ROTATEUV_ON + #pragma shader_feature_local POLARUV_ON + #pragma shader_feature_local FISHEYE_ON + #pragma shader_feature_local PINCH_ON + #pragma shader_feature_local SHAKEUV_ON + + #pragma shader_feature_local GLOWTEX_ON + #pragma shader_feature_local OUTTEX_ON + #pragma shader_feature_local OUTDIST_ON + #pragma shader_feature_local OUTBASE8DIR_ON + #pragma shader_feature_local OUTBASEPIXELPERF_ON + #pragma shader_feature_local COLORRAMPOUTLINE_ON + #pragma shader_feature_local GREYSCALEOUTLINE_ON + #pragma shader_feature_local POSTERIZEOUTLINE_ON + #pragma shader_feature_local BLURISHD_ON + #pragma shader_feature_local MANUALWIND_ON + #pragma shader_feature_local ATLAS_ON + #pragma shader_feature_local PREMULTIPLYALPHA_ON + + #pragma shader_feature BILBOARD_ON + #pragma shader_feature BILBOARDY_ON + + #pragma shader_feature NORMALMAP_ON + + + #define _URP 1 +#define _USINGTEXCOORD1 1 +#define _USINGTEXCOORD2 1 + + + + // Includes + #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Version.hlsl" + #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Color.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.universal/ShaderLibrary/ShaderGraphFunctions.hlsl" + #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/MetaInput.hlsl" + #include "Packages/com.unity.shadergraph/ShaderGraphLibrary/ShaderVariablesFunctions.hlsl" + + + #undef WorldNormalVector + #define WorldNormalVector(data, normal) mul(normal, data.TBNMatrix) + + #define UnityObjectToWorldNormal(normal) mul(GetObjectToWorldMatrix(), normal) + + #define _WorldSpaceLightPos0 _MainLightPosition + + #define UNITY_DECLARE_TEX2D(name) TEXTURE2D(name); SAMPLER(sampler##name); + #define UNITY_DECLARE_TEX2D_NOSAMPLER(name) TEXTURE2D(name); + #define UNITY_DECLARE_TEX2DARRAY(name) TEXTURE2D_ARRAY(name); SAMPLER(sampler##name); + #define UNITY_DECLARE_TEX2DARRAY_NOSAMPLER(name) TEXTURE2D_ARRAY(name); + + #define UNITY_SAMPLE_TEX2DARRAY(tex,coord) SAMPLE_TEXTURE2D_ARRAY(tex, sampler##tex, coord.xy, coord.z) + #define UNITY_SAMPLE_TEX2DARRAY_LOD(tex,coord,lod) SAMPLE_TEXTURE2D_ARRAY_LOD(tex, sampler##tex, coord.xy, coord.z, lod) + #define UNITY_SAMPLE_TEX2D(tex, coord) SAMPLE_TEXTURE2D(tex, sampler##tex, coord) + #define UNITY_SAMPLE_TEX2D_SAMPLER(tex, samp, coord) SAMPLE_TEXTURE2D(tex, sampler##samp, coord) + + #define UNITY_SAMPLE_TEX2D_LOD(tex,coord, lod) SAMPLE_TEXTURE2D_LOD(tex, sampler_##tex, coord, lod) + #define UNITY_SAMPLE_TEX2D_SAMPLER_LOD(tex,samplertex,coord, lod) SAMPLE_TEXTURE2D_LOD (tex, sampler##samplertex,coord, lod) + + #if defined(UNITY_COMPILER_HLSL) + #define UNITY_INITIALIZE_OUTPUT(type,name) name = (type)0; + #else + #define UNITY_INITIALIZE_OUTPUT(type,name) + #endif + + #define sampler2D_float sampler2D + #define sampler2D_half sampler2D + + + + // data across stages, stripped like the above. + struct VertexToPixel + { + float4 pos : SV_POSITION; + float3 worldPos : TEXCOORD0; + float3 worldNormal : TEXCOORD1; + float4 worldTangent : TEXCOORD2; + float4 texcoord0 : TEXCOORD3; + float4 texcoord1 : TEXCOORD4; + float4 texcoord2 : TEXCOORD5; + + // #if %TEXCOORD3REQUIREKEY% + float4 texcoord3 : TEXCOORD6; + // #endif + + // #if %SCREENPOSREQUIREKEY% + // float4 screenPos : TEXCOORD7; + // #endif + + // #if %VERTEXCOLORREQUIREKEY% + half4 vertexColor : COLOR; + // #endif + + // #if %EXTRAV2F0REQUIREKEY% + // float4 extraV2F0 : TEXCOORD12; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // float4 extraV2F1 : TEXCOORD13; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // float4 extraV2F2 : TEXCOORD14; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // float4 extraV2F3 : TEXCOORD15; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // float4 extraV2F4 : TEXCOORD16; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // float4 extraV2F5 : TEXCOORD17; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // float4 extraV2F6 : TEXCOORD18; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // float4 extraV2F7 : TEXCOORD19; + // #endif + + #if defined(LIGHTMAP_ON) + float2 lightmapUV : TEXCOORD8; + #endif + #if !defined(LIGHTMAP_ON) + float3 sh : TEXCOORD9; + #endif + float4 fogFactorAndVertexLight : TEXCOORD10; + float4 shadowCoord : TEXCOORD11; + #if UNITY_ANY_INSTANCING_ENABLED + uint instanceID : CUSTOM_INSTANCE_ID; + #endif + #if (defined(UNITY_STEREO_INSTANCING_ENABLED)) + uint stereoTargetEyeIndexAsRTArrayIdx : SV_RenderTargetArrayIndex; + #endif + #if (defined(UNITY_STEREO_MULTIVIEW_ENABLED)) || (defined(UNITY_STEREO_INSTANCING_ENABLED) && (defined(SHADER_API_GLES3) || defined(SHADER_API_GLCORE))) + uint stereoTargetEyeIndexAsBlendIdx0 : BLENDINDICES0; + #endif + #if defined(SHADER_STAGE_FRAGMENT) && defined(VARYINGS_NEED_CULLFACE) + FRONT_FACE_TYPE cullFace : FRONT_FACE_SEMANTIC; + #endif + }; + + + + + // data describing the user output of a pixel + struct Surface + { + half3 Albedo; + half Height; + half3 Normal; + half Smoothness; + half3 Emission; + half Metallic; + half3 Specular; + half Occlusion; + half SpecularPower; // for simple lighting + half Alpha; + float outputDepth; // if written, SV_Depth semantic is used. ShaderData.clipPos.z is unused value + // HDRP Only + half SpecularOcclusion; + half SubsurfaceMask; + half Thickness; + half CoatMask; + half CoatSmoothness; + half Anisotropy; + half IridescenceMask; + half IridescenceThickness; + int DiffusionProfileHash; + float SpecularAAThreshold; + float SpecularAAScreenSpaceVariance; + // requires _OVERRIDE_BAKEDGI to be defined, but is mapped in all pipelines + float3 DiffuseGI; + float3 BackDiffuseGI; + float3 SpecularGI; + float ior; + float3 transmittanceColor; + float atDistance; + float transmittanceMask; + // requires _OVERRIDE_SHADOWMASK to be defines + float4 ShadowMask; + + // for decals + float NormalAlpha; + float MAOSAlpha; + + + }; + + // Data the user declares in blackboard blocks + struct Blackboard + { + + float blackboardDummyData; + }; + + // data the user might need, this will grow to be big. But easy to strip + struct ShaderData + { + float4 clipPos; // SV_POSITION + float3 localSpacePosition; + float3 localSpaceNormal; + float3 localSpaceTangent; + + float3 worldSpacePosition; + float3 worldSpaceNormal; + float3 worldSpaceTangent; + float tangentSign; + + float3 worldSpaceViewDir; + float3 tangentSpaceViewDir; + + float4 texcoord0; + float4 texcoord1; + float4 texcoord2; + float4 texcoord3; + + float2 screenUV; + float4 screenPos; + + float4 vertexColor; + bool isFrontFace; + + float4 extraV2F0; + float4 extraV2F1; + float4 extraV2F2; + float4 extraV2F3; + float4 extraV2F4; + float4 extraV2F5; + float4 extraV2F6; + float4 extraV2F7; + + float3x3 TBNMatrix; + Blackboard blackboard; + }; + + struct VertexData + { + #if SHADER_TARGET > 30 + // uint vertexID : SV_VertexID; + #endif + float4 vertex : POSITION; + float3 normal : NORMAL; + float4 tangent : TANGENT; + float4 texcoord0 : TEXCOORD0; + + // optimize out mesh coords when not in use by user or lighting system + #if _URP && (_USINGTEXCOORD1 || _PASSMETA || _PASSFORWARD || _PASSGBUFFER) + float4 texcoord1 : TEXCOORD1; + #endif + + #if _URP && (_USINGTEXCOORD2 || _PASSMETA || ((_PASSFORWARD || _PASSGBUFFER) && defined(DYNAMICLIGHTMAP_ON))) + float4 texcoord2 : TEXCOORD2; + #endif + + #if _STANDARD && (_USINGTEXCOORD1 || (_PASSMETA || ((_PASSFORWARD || _PASSGBUFFER || _PASSFORWARDADD) && LIGHTMAP_ON))) + float4 texcoord1 : TEXCOORD1; + #endif + #if _STANDARD && (_USINGTEXCOORD2 || (_PASSMETA || ((_PASSFORWARD || _PASSGBUFFER) && DYNAMICLIGHTMAP_ON))) + float4 texcoord2 : TEXCOORD2; + #endif + + + #if _HDRP + float4 texcoord1 : TEXCOORD1; + float4 texcoord2 : TEXCOORD2; + #endif + + // #if %TEXCOORD3REQUIREKEY% + float4 texcoord3 : TEXCOORD3; + // #endif + + // #if %VERTEXCOLORREQUIREKEY% + float4 vertexColor : COLOR; + // #endif + + #if _PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR)) + float3 previousPositionOS : TEXCOORD4; // Contain previous transform position (in case of skinning for example) + #if defined (_ADD_PRECOMPUTED_VELOCITY) + float3 precomputedVelocity : TEXCOORD5; // Add Precomputed Velocity (Alembic computes velocities on runtime side). + #endif + #endif + + UNITY_VERTEX_INPUT_INSTANCE_ID + }; + + struct TessVertex + { + float4 vertex : INTERNALTESSPOS; + float3 normal : NORMAL; + float4 tangent : TANGENT; + float4 texcoord0 : TEXCOORD0; + float4 texcoord1 : TEXCOORD1; + float4 texcoord2 : TEXCOORD2; + + // #if %TEXCOORD3REQUIREKEY% + float4 texcoord3 : TEXCOORD3; + // #endif + + // #if %VERTEXCOLORREQUIREKEY% + float4 vertexColor : COLOR; + // #endif + + // #if %EXTRAV2F0REQUIREKEY% + // float4 extraV2F0 : TEXCOORD5; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // float4 extraV2F1 : TEXCOORD6; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // float4 extraV2F2 : TEXCOORD7; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // float4 extraV2F3 : TEXCOORD8; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // float4 extraV2F4 : TEXCOORD9; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // float4 extraV2F5 : TEXCOORD10; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // float4 extraV2F6 : TEXCOORD11; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // float4 extraV2F7 : TEXCOORD12; + // #endif + + #if _PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR)) + float3 previousPositionOS : TEXCOORD13; // Contain previous transform position (in case of skinning for example) + #if defined (_ADD_PRECOMPUTED_VELOCITY) + float3 precomputedVelocity : TEXCOORD14; + #endif + #endif + + UNITY_VERTEX_INPUT_INSTANCE_ID + UNITY_VERTEX_OUTPUT_STEREO + }; + + struct ExtraV2F + { + float4 extraV2F0; + float4 extraV2F1; + float4 extraV2F2; + float4 extraV2F3; + float4 extraV2F4; + float4 extraV2F5; + float4 extraV2F6; + float4 extraV2F7; + Blackboard blackboard; + float4 time; + }; + + + float3 WorldToTangentSpace(ShaderData d, float3 normal) + { + return mul(d.TBNMatrix, normal); + } + + float3 TangentToWorldSpace(ShaderData d, float3 normal) + { + return mul(normal, d.TBNMatrix); + } + + // in this case, make standard more like SRPs, because we can't fix + // unity_WorldToObject in HDRP, since it already does macro-fu there + + #if _STANDARD + float3 TransformWorldToObject(float3 p) { return mul(unity_WorldToObject, float4(p, 1)); }; + float3 TransformObjectToWorld(float3 p) { return mul(unity_ObjectToWorld, float4(p, 1)); }; + float4 TransformWorldToObject(float4 p) { return mul(unity_WorldToObject, p); }; + float4 TransformObjectToWorld(float4 p) { return mul(unity_ObjectToWorld, p); }; + float4x4 GetWorldToObjectMatrix() { return unity_WorldToObject; } + float4x4 GetObjectToWorldMatrix() { return unity_ObjectToWorld; } + #if (defined(SHADER_API_D3D11) || defined(SHADER_API_XBOXONE) || defined(UNITY_COMPILER_HLSLCC) || defined(SHADER_API_PSSL) || (SHADER_TARGET_SURFACE_ANALYSIS && !SHADER_TARGET_SURFACE_ANALYSIS_MOJOSHADER)) + #define UNITY_SAMPLE_TEX2D_LOD(tex,coord, lod) tex.SampleLevel (sampler##tex,coord, lod) + #define UNITY_SAMPLE_TEX2D_SAMPLER_LOD(tex,samplertex,coord, lod) tex.SampleLevel (sampler##samplertex,coord, lod) + #else + #define UNITY_SAMPLE_TEX2D_LOD(tex,coord,lod) tex2D (tex,coord,0,lod) + #define UNITY_SAMPLE_TEX2D_SAMPLER_LOD(tex,samplertex,coord,lod) tex2D (tex,coord,0,lod) + #endif + + #undef GetWorldToObjectMatrix() + + #define GetWorldToObjectMatrix() unity_WorldToObject + + + #endif + + float3 GetCameraWorldPosition() + { + #if _HDRP + return GetCameraRelativePositionWS(_WorldSpaceCameraPos); + #else + return _WorldSpaceCameraPos; + #endif + } + + #if _GRABPASSUSED + #if _STANDARD + TEXTURE2D(%GRABTEXTURE%); + SAMPLER(sampler_%GRABTEXTURE%); + #endif + + half3 GetSceneColor(float2 uv) + { + #if _STANDARD + return SAMPLE_TEXTURE2D(%GRABTEXTURE%, sampler_%GRABTEXTURE%, uv).rgb; + #else + return SHADERGRAPH_SAMPLE_SCENE_COLOR(uv); + #endif + } + #endif + + + + #if _STANDARD + UNITY_DECLARE_DEPTH_TEXTURE(_CameraDepthTexture); + float GetSceneDepth(float2 uv) { return SAMPLE_DEPTH_TEXTURE(_CameraDepthTexture, uv); } + float GetLinear01Depth(float2 uv) { return Linear01Depth(GetSceneDepth(uv)); } + float GetLinearEyeDepth(float2 uv) { return LinearEyeDepth(GetSceneDepth(uv)); } + #else + float GetSceneDepth(float2 uv) { return SHADERGRAPH_SAMPLE_SCENE_DEPTH(uv); } + float GetLinear01Depth(float2 uv) { return Linear01Depth(GetSceneDepth(uv), _ZBufferParams); } + float GetLinearEyeDepth(float2 uv) { return LinearEyeDepth(GetSceneDepth(uv), _ZBufferParams); } + #endif + + float3 GetWorldPositionFromDepthBuffer(float2 uv, float3 worldSpaceViewDir) + { + float eye = GetLinearEyeDepth(uv); + float3 camView = mul((float3x3)GetObjectToWorldMatrix(), transpose(mul(GetWorldToObjectMatrix(), UNITY_MATRIX_I_V)) [2].xyz); + + float dt = dot(worldSpaceViewDir, camView); + float3 div = worldSpaceViewDir/dt; + float3 wpos = (eye * div) + GetCameraWorldPosition(); + return wpos; + } + + #if _HDRP + float3 ObjectToWorldSpacePosition(float3 pos) + { + return GetAbsolutePositionWS(TransformObjectToWorld(pos)); + } + #else + float3 ObjectToWorldSpacePosition(float3 pos) + { + return TransformObjectToWorld(pos); + } + #endif + + #if _STANDARD + UNITY_DECLARE_SCREENSPACE_TEXTURE(_CameraDepthNormalsTexture); + float3 GetSceneNormal(float2 uv, float3 worldSpaceViewDir) + { + float4 depthNorms = UNITY_SAMPLE_SCREENSPACE_TEXTURE(_CameraDepthNormalsTexture, uv); + float3 norms = DecodeViewNormalStereo(depthNorms); + norms = mul((float3x3)GetWorldToViewMatrix(), norms) * 0.5 + 0.5; + return norms; + } + #elif _HDRP && !_DECALSHADER + + float3 GetSceneNormal(float2 uv, float3 worldSpaceViewDir) + { + NormalData nd; + DecodeFromNormalBuffer(_ScreenSize.xy * uv, nd); + return nd.normalWS; + } + #elif _URP + #if (SHADER_LIBRARY_VERSION_MAJOR >= 10) + #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/DeclareNormalsTexture.hlsl" + #endif + + float3 GetSceneNormal(float2 uv, float3 worldSpaceViewDir) + { + #if (SHADER_LIBRARY_VERSION_MAJOR >= 10) + return SampleSceneNormals(uv); + #else + float3 wpos = GetWorldPositionFromDepthBuffer(uv, worldSpaceViewDir); + return normalize(-cross(ddx(wpos), ddy(wpos))) * 0.5 + 0.5; + #endif + + } + #endif + + #if _HDRP + + half3 UnpackNormalmapRGorAG(half4 packednormal) + { + // This do the trick + packednormal.x *= packednormal.w; + + half3 normal; + normal.xy = packednormal.xy * 2 - 1; + normal.z = sqrt(1 - saturate(dot(normal.xy, normal.xy))); + return normal; + } + half3 UnpackNormal(half4 packednormal) + { + #if defined(UNITY_NO_DXT5nm) + return packednormal.xyz * 2 - 1; + #else + return UnpackNormalmapRGorAG(packednormal); + #endif + } + #endif + #if _HDRP || _URP + + half3 UnpackScaleNormal(half4 packednormal, half scale) + { + #ifndef UNITY_NO_DXT5nm + // Unpack normal as DXT5nm (1, y, 1, x) or BC5 (x, y, 0, 1) + // Note neutral texture like "bump" is (0, 0, 1, 1) to work with both plain RGB normal and DXT5nm/BC5 + packednormal.x *= packednormal.w; + #endif + half3 normal; + normal.xy = (packednormal.xy * 2 - 1) * scale; + normal.z = sqrt(1 - saturate(dot(normal.xy, normal.xy))); + return normal; + } + + #endif + + + void GetSun(out float3 lightDir, out float3 color) + { + lightDir = float3(0.5, 0.5, 0); + color = 1; + #if _HDRP + if (_DirectionalLightCount > 0) + { + DirectionalLightData light = _DirectionalLightDatas[0]; + lightDir = -light.forward.xyz; + color = light.color; + } + #elif _STANDARD + lightDir = normalize(_WorldSpaceLightPos0.xyz); + color = _LightColor0.rgb; + #elif _URP + Light light = GetMainLight(); + lightDir = light.direction; + color = light.color; + #endif + } + + + + CBUFFER_START(UnityPerMaterial) + + + half4 _Color; + half4 _MainTex_ST, _MainTex_TexelSize; + half _Alpha, _AlphaCutoffValue; + + #if ATLAS_ON + half _MinXUV, _MaxXUV, _MinYUV, _MaxYUV; + #endif + + #if GLOW_ON + half4 _GlowColor; + half _Glow, _GlowGlobal; + #endif + + #if HSV_ON + half _HsvShift, _HsvSaturation, _HsvBright; + #endif + + #if DISTORT_ON + half4 _DistortTex_ST; + half _DistortTexXSpeed, _DistortTexYSpeed, _DistortAmount; + #endif + + #if FADE_ON + half4 _FadeBurnColor, _FadeTex_ST, _FadeBurnTex_ST; + half _FadeAmount, _FadeBurnWidth, _FadeBurnTransition,_FadeBurnGlow; + #endif + + #if OUTBASE_ON + half4 _OutlineColor; + half _OutlineAlpha, _OutlineGlow, _OutlineWidth; + int _OutlinePixelWidth; + #endif + + #if OUTTEX_ON + half4 _OutlineTex_ST; + half _OutlineTexXSpeed, _OutlineTexYSpeed; + #endif + + #if OUTDIST_ON + half4 _OutlineDistortTex_ST; + half _OutlineDistortTexXSpeed, _OutlineDistortTexYSpeed, _OutlineDistortAmount; + #endif + + #if ALPHAOUTLINE_ON + half _AlphaOutlineGlow, _AlphaOutlinePower, _AlphaOutlineMinAlpha, _AlphaOutlineBlend; + half4 _AlphaOutlineColor; + #endif + + #if INNEROUTLINE_ON + half _InnerOutlineThickness, _InnerOutlineAlpha, _InnerOutlineGlow; + half4 _InnerOutlineColor; + #endif + + #if GRADIENT_ON + half _GradBlend, _GradBoostX, _GradBoostY; + half4 _GradTopRightCol, _GradTopLeftCol, _GradBotRightCol, _GradBotLeftCol; + #endif + + #if COLORSWAP_ON + half4 _ColorSwapRed, _ColorSwapGreen, _ColorSwapBlue; + half _ColorSwapRedLuminosity, _ColorSwapGreenLuminosity, _ColorSwapBlueLuminosity, _ColorSwapBlend; + #endif + + #if CHANGECOLOR_ON + half4 _ColorChangeNewCol, _ColorChangeTarget; + half _ColorChangeTolerance, _ColorChangeLuminosity; + #endif + #if CHANGECOLOR2_ON + half4 _ColorChangeNewCol2, _ColorChangeTarget2; + half _ColorChangeTolerance2; + #endif + #if CHANGECOLOR3_ON + half4 _ColorChangeNewCol3, _ColorChangeTarget3; + half _ColorChangeTolerance3; + #endif + + #if COLORRAMP_ON + half _ColorRampLuminosity, _ColorRampBlend; + #endif + + #if HITEFFECT_ON + half4 _HitEffectColor; + half _HitEffectGlow, _HitEffectBlend; + #endif + + #if NEGATIVE_ON + half _NegativeAmount; + #endif + + #if PIXELATE_ON + half _PixelateSize; + #endif + + #if GREYSCALE_ON + half _GreyscaleLuminosity, _GreyscaleBlend; + half4 _GreyscaleTintColor; + #endif + + #if POSTERIZE_ON + half _PosterizeNumColors, _PosterizeGamma; + #endif + + #if BLUR_ON + half _BlurIntensity; + #endif + + #if MOTIONBLUR_ON + half _MotionBlurAngle, _MotionBlurDist; + #endif + + #if GHOST_ON + half _GhostColorBoost, _GhostTransparency, _GhostBlend; + #endif + + #if HOLOGRAM_ON + half _HologramStripesAmount, _HologramMinAlpha, _HologramUnmodAmount, _HologramStripesSpeed, _HologramMaxAlpha, _HologramBlend; + half4 _HologramStripeColor; + #endif + + #if CHROMABERR_ON + half _ChromAberrAmount, _ChromAberrAlpha; + #endif + + #if GLITCH_ON + half _GlitchAmount, _GlitchSize; + #endif + + #if FLICKER_ON + half _FlickerFreq, _FlickerPercent, _FlickerAlpha; + #endif + + #if SHADOW_ON + half _ShadowX, _ShadowY, _ShadowAlpha; + half4 _ShadowColor; + #endif + + #if SHINE_ON + half4 _ShineColor; + half _ShineLocation, _ShineRotate, _ShineWidth, _ShineGlow; + #endif + + #if CONTRAST_ON + half _Contrast, _Brightness; + #endif + + #if OVERLAY_ON + half4 _OverlayTex_ST, _OverlayColor; + half _OverlayGlow, _OverlayBlend, _OverlayTextureScrollXSpeed, _OverlayTextureScrollYSpeed; + #endif + + #if DOODLE_ON + half _HandDrawnAmount, _HandDrawnSpeed; + #endif + + #if WIND_ON + half _GrassSpeed, _GrassWind, _GrassManualAnim, _GrassRadialBend; + #endif + + #if WAVEUV_ON + float _WaveAmount, _WaveSpeed, _WaveStrength, _WaveX, _WaveY; + #endif + + #if ROUNDWAVEUV_ON + half _RoundWaveStrength, _RoundWaveSpeed; + #endif + + #if RECTSIZE_ON + half _RectSize; + #endif + + #if OFFSETUV_ON + half _OffsetUvX, _OffsetUvY; + #endif + + #if CLIPPING_ON + half _ClipUvLeft, _ClipUvRight, _ClipUvUp, _ClipUvDown; + #endif + + #if RADIALCLIPPING_ON + half _RadialStartAngle, _RadialClip, _RadialClip2; + #endif + + #if TEXTURESCROLL_ON + half _TextureScrollXSpeed, _TextureScrollYSpeed; + #endif + + #if ZOOMUV_ON + half _ZoomUvAmount; + #endif + + #if WARP_ON + half _WarpStrength, _WarpSpeed, _WarpScale; + #endif + + #if TWISTUV_ON + half _TwistUvAmount, _TwistUvPosX, _TwistUvPosY, _TwistUvRadius; + #endif + + #if ROTATEUV_ON + half _RotateUvAmount; + #endif + + #if FISHEYE_ON + half _FishEyeUvAmount; + #endif + + #if PINCH_ON + half _PinchUvAmount; + #endif + + #if SHAKEUV_ON + half _ShakeUvSpeed, _ShakeUvX, _ShakeUvY; + #endif + + #if NORMALMAP_ON + half _NormalStrength; + #endif + + float _RandomSeed; + + + + + CBUFFER_END + + + + + + + + TEXTURE2D(_MainTex); + SAMPLER(sampler_MainTex); + + #if GLOW_ON + TEXTURE2D(_GlowTex); + SAMPLER(sampler_GlowTex); + #endif + + #if FADE_ON + TEXTURE2D(_FadeTex); + SAMPLER(sampler_FadeTex); + + TEXTURE2D(_FadeBurnTex); + SAMPLER(sampler_FadeBurnTex); + #endif + + #if DISTORT_ON + TEXTURE2D(_DistortTex); + SAMPLER(sampler_DistortTex); + #endif + + #if OUTTEX_ON + TEXTURE2D(_OutlineTex); + SAMPLER(sampler_OutlineTex); + #endif + + #if OUTDIST_ON + TEXTURE2D(_OutlineDistortTex); + SAMPLER(sampler_OutlineDistortTex); + #endif + + #if COLORSWAP_ON + TEXTURE2D(_ColorSwapTex); + SAMPLER(sampler_ColorSwapTex); + #endif + + #if COLORRAMP_ON + TEXTURE2D(_ColorRampTex); + TEXTURE2D(_ColorRampTexGradient); + SAMPLER(sampler_ColorRampTex); + SAMPLER(sampler_ColorRampTexGradient); + #endif + + #if SHINE_ON + TEXTURE2D(_ShineMask); + SAMPLER(sampler_ShineMask); + #endif + + #if OVERLAY_ON + TEXTURE2D(_OverlayTex); + SAMPLER(sampler_OverlayTex); + #endif + + #if NORMALMAP_ON + TEXTURE2D(_NormalMap); + SAMPLER(sampler_NormalMap); + #endif + + + half3 GetPixel(in int offsetX, in int offsetY, in half2 uv, in Texture2D _tex, in SamplerState _sampler) + { + half2 _uv = uv + half2(offsetX * _MainTex_TexelSize.x, offsetY * _MainTex_TexelSize.y); + half4 col = SAMPLE_TEXTURE2D(_tex, _sampler, _uv); + return col.rgb; + } + + + //BLURS------------------------------------------------------------------------- + half4 Blur(half2 uv, Texture2D source, SamplerState sampler_source, half Intensity) + { + const half2 texelSize = 1.0 / _ScreenParams.xy; + const half4 color = SAMPLE_TEXTURE2D(source, sampler_source, uv); + const half2 offset = Intensity * texelSize; + + half4 accumulatedColor = color; + half accumulatedWeight = 1.0; + for (int x = -1; x <= 1; x++) + { + for (int y = -1; y <= 1; y++) + { + const half2 sampleUV = uv + half2(x, y) * offset; + const half4 sampleColor = SAMPLE_TEXTURE2D(source, sampler_source, sampleUV); + + accumulatedColor += sampleColor; + accumulatedWeight += 1.0; + } + } + + half4 blurredColor = accumulatedColor / accumulatedWeight; + return blurredColor; + } + + half BlurHD_G(half bhqp, half x) + { + return exp(-(x * x) / (2.0 * bhqp * bhqp)); + } + half4 BlurHD(half2 uv, Texture2D source, SamplerState sampler_source, half BlurAmount, half xScale, half yScale) + { + int iterations = 16; + int halfIterations = iterations / 2; + half sigmaX = 0.1 + BlurAmount * 0.5; + half sigmaY = sigmaX; + half total = 0.0; + half4 ret = half4(0, 0, 0, 0); + for (int iy = 0; iy < iterations; ++iy) + { + half fy = BlurHD_G(sigmaY, half(iy) -half(halfIterations)); + half offsetY = half(iy - halfIterations) * 0.00390625 * xScale; + for (int ix = 0; ix < iterations; ++ix) + { + half fx = BlurHD_G(sigmaX, half(ix) - half(halfIterations)); + half offsetX = half(ix - halfIterations) * 0.00390625 * yScale; + total += fx * fy; + ret += SAMPLE_TEXTURE2D(source, sampler_source, uv + half2(offsetX, offsetY)) * fx * fy; + } + } + return ret / total; + } + //----------------------------------------------------------------------- + + + //------------------------------------------- + half RemapFloat(half inValue, half inMin, half inMax, half outMin, half outMax){ + return outMin + (inValue - inMin) * (outMax - outMin) / (inMax - inMin); + } + //------------------------------------------- + + //----------------------------------------------------------------------- + half rand(half2 seed, half offset) { + return (frac(sin(dot(seed, half2(12.9898, 78.233))) * 43758.5453) + offset) % 1.0; + } + + half rand2(half2 seed, half offset) { + return (frac(sin(dot(seed * floor(50 + (_Time.x % 1.0) * 12.), half2(127.1, 311.7))) * 43758.5453123) + offset) % 1.0; + } + + half rand2CustomTime(half2 seed, half offset, half customTime) { + return (frac(sin(dot(seed * floor(50 + (customTime % 1.0) * 12.), half2(127.1, 311.7))) * 43758.5453123) + offset) % 1.0; + } + //----------------------------------------------------------------------- + + + void Ext_ModifyVertex0 (inout VertexData v, inout ExtraV2F d) + { + //BILBOARD_ON + #if BILBOARD_ON + half3 camRight = mul((half3x3)unity_CameraToWorld, half3(1,0,0)); + half3 camUp = half3(0,1,0); + #if BILBOARDY_ON + camUp = mul((half3x3)unity_CameraToWorld, half3(0,1,0)); + #endif + half3 localPos = v.vertex.x * camRight + v.vertex.y * camUp; + v.vertex = half4(localPos, 1); + #endif + //----------------------------------------------------------- + + v.texcoord0.xy = TRANSFORM_TEX(v.texcoord0.xy, _MainTex); + half2 center = half2(0.5, 0.5); + #if ATLAS_ON + center = half2((_MaxXUV + _MinXUV) / 2.0, (_MaxYUV + _MinYUV) / 2.0); + #endif + + //POLARUV_ON + #if POLARUV_ON + v.texcoord0.xy = v.texcoord0.xy - center; + #endif + + //---------------------------------------- + + //ROTATEUV_ON + #if ROTATEUV_ON + half2 uvC = v.texcoord0.xy; + half cosAngle = cos(_RotateUvAmount); + half sinAngle = sin(_RotateUvAmount); + half2x2 rot = half2x2(cosAngle, -sinAngle, sinAngle, cosAngle); + uvC -= center; + v.texcoord0.xy = mul(rot, uvC); + v.texcoord0.xy += center; + #endif + //-------------------- + + #if RECTSIZE_ON + v.vertex.xyz += (v.vertex.xyz * (_RectSize - 1.0)); + #endif + + #if OUTTEX_ON + v.texcoord1.xy = TRANSFORM_TEX(v.texcoord0.xy, _OutlineTex); + #endif + + #if OUTDIST_ON + v.texcoord2.xy = TRANSFORM_TEX(v.texcoord0.xy, _OutlineDistortTex); + #endif + + #if DISTORT_ON + v.texcoord3.xy = TRANSFORM_TEX(v.texcoord0.xy, _DistortTex); + #endif + } + + void Ext_SurfaceFunction0 (inout Surface o, ShaderData d) + { + half randomSeed = _RandomSeed; + + float2 uvRect = d.texcoord0; + half2 center = half2(0.5, 0.5); + #if ATLAS_ON + center = half2((_MaxXUV + _MinXUV) / 2.0, (_MaxYUV + _MinYUV) / 2.0); + uvRect = half2((d.texcoord0.x - _MinXUV) / (_MaxXUV - _MinXUV), (d.texcoord0.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half2 centerTiled = half2(center.x * _MainTex_ST.x, center.y * _MainTex_ST.y); + + //CLIPPING_ON + #if CLIPPING_ON + half2 tiledUv = half2(d.texcoord0.x / _MainTex_ST.x, d.texcoord0.y / _MainTex_ST.y); + #if ATLAS_ON + tiledUv = half2((tiledUv.x - _MinXUV) / (_MaxXUV - _MinXUV), (tiledUv.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + clip((1 - _ClipUvUp) - tiledUv.y); + clip(tiledUv.y - _ClipUvDown); + clip((1 - _ClipUvRight) - tiledUv.x); + clip(tiledUv.x - _ClipUvLeft); + #endif + //---------------------------------- + + //RADIALCLIPPING_ON + #if RADIALCLIPPING_ON + half2 tiledUv2 = half2(d.texcoord0.x / _MainTex_ST.x, d.texcoord0.y / _MainTex_ST.y); + #if ATLAS_ON + tiledUv2 = half2((tiledUv2.x - _MinXUV) / (_MaxXUV - _MinXUV), (tiledUv2.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half startAngle = _RadialStartAngle - _RadialClip; + half endAngle = _RadialStartAngle + _RadialClip2; + half offset0 = clamp(0, 360, startAngle + 360); + half offset360 = clamp(0, 360, endAngle - 360); + half2 atan2Coord = half2(lerp(-1, 1, tiledUv2.x), lerp(-1, 1, tiledUv2.y)); + half atanAngle = atan2(atan2Coord.y, atan2Coord.x) * 57.3; // angle in degrees + if(atanAngle < 0) atanAngle = 360 + atanAngle; + if(atanAngle >= startAngle && atanAngle <= endAngle) discard; + if(atanAngle <= offset360) discard; + if(atanAngle >= offset0) discard; + #endif + + //----------------------------- + + //TEXTURESCROLL_ON && ATLAS_ON + #if TEXTURESCROLL_ON && ATLAS_ON + d.texcoord0.xy = half2(_MinXUV + ((_MaxXUV - _MinXUV) * (abs(((_Time.y + randomSeed) * _TextureScrollXSpeed) + uvRect.x) % 1)), + _MinYUV + ((_MaxYUV - _MinYUV) * (abs(((_Time.y + randomSeed) * _TextureScrollYSpeed) + uvRect.y) % 1))); + #endif + //---------------------------- + + //OFFSETUV_ON + #if OFFSETUV_ON + #if ATLAS_ON + d.texcoord0.xy = half2(_MinXUV + ((_MaxXUV - _MinXUV) * (abs((_OffsetUvX + uvRect.x) % 1))), + _MinYUV + ((_MaxYUV - _MinYUV) * (abs(_OffsetUvY + uvRect.y) % 1))); + #else + d.texcoord0.xy += half2(_OffsetUvX, _OffsetUvY); + #endif + #endif + + //---------------------- + + //POLARUV_ON + #if POLARUV_ON + d.texcoord0.xy = half2(atan2(d.texcoord0.y, d.texcoord0.x) / (2.0f * 3.141592653589f), length(d.texcoord0.xy)); + d.texcoord0.xy *= _MainTex_ST.xy; + #endif + + //-------------------------------------- + + //TWISTUV_ON + #if TWISTUV_ON + #if ATLAS_ON + _TwistUvPosX = ((_MaxXUV - _MinXUV) * _TwistUvPosX) + _MinXUV; + _TwistUvPosY = ((_MaxYUV - _MinYUV) * _TwistUvPosY) + _MinYUV; + #endif + half2 tempUv = d.texcoord0.xy - half2(_TwistUvPosX * _MainTex_ST.x, _TwistUvPosY * _MainTex_ST.y); + _TwistUvRadius *= (_MainTex_ST.x + _MainTex_ST.y) / 2; + half percent = (_TwistUvRadius - length(tempUv)) / _TwistUvRadius; + half theta = percent * percent * (2.0 * sin(_TwistUvAmount)) * 8.0; + half s = sin(theta); + half c = cos(theta); + half beta = max(sign(_TwistUvRadius - length(tempUv)), 0.0); + tempUv = half2(dot(tempUv, half2(c, -s)), dot(tempUv, half2(s, c))) * beta + tempUv * (1 - beta); + tempUv += half2(_TwistUvPosX * _MainTex_ST.x, _TwistUvPosY * _MainTex_ST.y); + d.texcoord0.xy = tempUv; + #endif + + //-------------------------------------------- + + //FISHEYE_ON + #if FISHEYE_ON + half bind = length(centerTiled); + half2 dF = d.texcoord0.xy - centerTiled; + half dFlen = length(dF); + half fishInt = (3.14159265359 / bind) * (_FishEyeUvAmount + 0.001); + d.texcoord0.xy = centerTiled + (dF / (max(0.0001, dFlen))) * tan(dFlen * fishInt) * bind / tan(bind * fishInt); + #endif + //--------------------------------------------- + + //PINCH_ON + #if PINCH_ON + half2 dP = d.texcoord0.xy - centerTiled; + half pinchInt = (3.141592 / length(centerTiled)) * (-_PinchUvAmount + 0.001); + d.texcoord0.xy = centerTiled + normalize(dP) * atan(length(dP) * -pinchInt * 10.0) * 0.5 / atan(-pinchInt * 5); + #endif + + //--------------------------------------------- + + //ZOOMUV_ON + #if ZOOMUV_ON + d.texcoord0.xy -= centerTiled; + d.texcoord0.xy = d.texcoord0.xy * _ZoomUvAmount; + d.texcoord0.xy += centerTiled; + #endif + + //----------------------------------------------- + + //DOODLE_ON + #if DOODLE_ON + half2 uvCopy = uvRect; + _HandDrawnSpeed = (floor((_Time.x + randomSeed) * 20 * _HandDrawnSpeed) / _HandDrawnSpeed) * _HandDrawnSpeed; + uvCopy.x = sin((uvCopy.x * _HandDrawnAmount + _HandDrawnSpeed) * 4); + uvCopy.y = cos((uvCopy.y * _HandDrawnAmount + _HandDrawnSpeed) * 4); + d.texcoord0.xy = lerp(d.texcoord0.xy, d.texcoord0.xy + uvCopy, 0.0005 * _HandDrawnAmount); + #endif + + //-------------------------- + + //SHAKEUV_ON + #if SHAKEUV_ON + half xShake = sin((_Time.x + randomSeed) * _ShakeUvSpeed * 50) * _ShakeUvX; + half yShake = cos((_Time.x + randomSeed) * _ShakeUvSpeed * 50) * _ShakeUvY; + d.texcoord0.xy += half2(xShake * 0.012, yShake * 0.01); + #endif + + //------------------------------------------- + + //RECTSIZE_ON + #if RECTSIZE_ON + d.texcoord0.xy = d.texcoord0.xy * (_RectSize).xx + (((-_RectSize * 0.5) + 0.5)).xx; + #endif + + //------------------------------------------- + + //DISTORT_ON + #if DISTORT_ON + #if ATLAS_ON + d.texcoord3.x = d.texcoord3.x * (1 / (_MaxXUV - _MinXUV)); + d.texcoord3.y = d.texcoord3.y * (1 / (_MaxYUV - _MinYUV)); + #endif + + d.texcoord3.x += ((_Time.x + _RandomSeed) * _DistortTexXSpeed) % 1; + d.texcoord3.y += ((_Time.x + _RandomSeed) * _DistortTexYSpeed) % 1; + half distortAmnt = (SAMPLE_TEXTURE2D(_DistortTex, sampler_DistortTex, d.texcoord3.xy).r - 0.5) * 0.2 * _DistortAmount; + d.texcoord0.x += distortAmnt; + d.texcoord0.y += distortAmnt; + #endif + //------------------------------------------------------- + + //WARP_ON + #if WARP_ON + half2 warpUv = half2(d.texcoord0.x / _MainTex_ST.x, d.texcoord0.y / _MainTex_ST.y); + #if ATLAS_ON + warpUv = half2((warpUv.x - _MinXUV) / (_MaxXUV - _MinXUV), (warpUv.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + const float tau = 6.283185307179586; + float xWarp = (_Time.y + randomSeed) * _WarpSpeed + warpUv.x * tau / _WarpScale; + float yWarp = (_Time.y + randomSeed) * _WarpSpeed + warpUv.y * tau / _WarpScale; + float2 warp = float2(sin(xWarp), sin(yWarp)) * _WarpStrength; + d.texcoord0.xy += warp; + #endif + + //------------------------------------------------------- + + //WAVEUV_ON + #if WAVEUV_ON + float2 uvWave = half2(_WaveX * _MainTex_ST.x, _WaveY * _MainTex_ST.y) - d.texcoord0.xy; + uvWave %= 1; + #if ATLAS_ON + uvWave = half2(_WaveX, _WaveY) - uvRect; + #endif + uvWave.x *= _ScreenParams.x / _ScreenParams.y; + float waveTime = _Time.y + randomSeed; + float angWave = (sqrt(dot(uvWave, uvWave)) * _WaveAmount) - ((waveTime * _WaveSpeed)); + d.texcoord0.xy = d.texcoord0.xy + uvWave * sin(angWave) * (_WaveStrength / 1000.0); + #endif + //---------------------------------------------------- + + //ROUNDWAVEUV_ON + #if ROUNDWAVEUV_ON + half xWave = ((0.5 * _MainTex_ST.x) - uvRect.x); + half yWave = ((0.5 * _MainTex_ST.y) - uvRect.y) * (_MainTex_TexelSize.w / _MainTex_TexelSize.z); + half ripple = -sqrt(xWave*xWave + yWave* yWave); + d.texcoord0.xy += (sin((ripple + (_Time.y + randomSeed) * (_RoundWaveSpeed/10.0)) / 0.015) * (_RoundWaveStrength/10.0)) % 1; + #endif + //---------------------------------------------------- + + + //WIND_ON + #if WIND_ON + half windOffset = sin((_Time.x + randomSeed) * _GrassSpeed * 10); + half2 windCenter = half2(0.5, 0.1); + #if ATLAS_ON + windCenter.x = ((_MaxXUV - _MinXUV) * windCenter.x) + _MinXUV; + windCenter.y = ((_MaxYUV - _MinYUV) * windCenter.y) + _MinYUV; + #endif + #if !MANUALWIND_ON + d.texcoord0.x = fmod(abs(lerp(d.texcoord0.x, d.texcoord0.x + (_GrassWind * 0.01 * windOffset), uvRect.y)), 1); + #else + d.texcoord0.x = fmod(abs(lerp(d.texcoord0.x, d.texcoord0.x + (_GrassWind * 0.01 * _GrassManualAnim), uvRect.y)), 1); + windOffset = _GrassManualAnim; + #endif + half2 delta = d.texcoord0.xy - windCenter; + half delta2 = dot(delta.xy, delta.xy); + half2 delta_offset = delta2 * windOffset; + d.texcoord0.xy = d.texcoord0.xy + half2(delta.y, -delta.x) * delta_offset * _GrassRadialBend; + #endif + + //-------------------------------------------------------- + + //TEXTURESCROLL_ON && !ATLAS_ON + #if TEXTURESCROLL_ON && !ATLAS_ON + d.texcoord0.x += ((_Time.y + randomSeed) * _TextureScrollXSpeed) % 1; + d.texcoord0.y += ((_Time.y + randomSeed) * _TextureScrollYSpeed) % 1; + #endif + //------------------------------ + + //PIXELATE_ON + #if PIXELATE_ON + half aspectRatio = _MainTex_TexelSize.x / _MainTex_TexelSize.y; + half2 pixelSize = float2(_PixelateSize, _PixelateSize * aspectRatio); + d.texcoord0.xy = floor(d.texcoord0.xy * pixelSize) / pixelSize; + #endif + //-------------- + + half4 col = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy); + half originalAlpha = col.a; + col *= d.vertexColor; + + //NORMAL MAP + #if NORMALMAP_ON + half4 normalSample = SAMPLE_TEXTURE2D(_NormalMap, sampler_NormalMap, d.texcoord0.xy); + half3 normalTS = UnpackNormal(normalSample); + normalTS.xy *= _NormalStrength; + o.Normal = normalTS; + #endif + + + //GLITCH_ON + #if GLITCH_ON + half2 uvGlitch = uvRect; + uvGlitch.y -= 0.5; + half lineNoise = pow(rand2(floor(uvGlitch * half2(24., 19.) * _GlitchSize) * 4.0, randomSeed), 3.0) * _GlitchAmount + * pow(rand2(floor(uvGlitch * half2(38., 14.) * _GlitchSize) * 4.0, randomSeed), 3.0); + col = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(lineNoise * 0.02 * rand2(half2(2.0, 1), randomSeed), 0)) * d.vertexColor; + #endif + //-------------------------------------- + + //CHROMABERR_ON + #if CHROMABERR_ON + half4 r = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(_ChromAberrAmount/10, 0)) * d.vertexColor; + half4 b = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(-_ChromAberrAmount/10, 0)) * d.vertexColor; + col = half4(r.r * r.a, col.g, b.b * b.a, max(max(r.a, b.a) * _ChromAberrAlpha, col.a)); + #endif + + //-------------------------------- + + //BLUR_ON + #if BLUR_ON + #if ATLAS_ON + #if !BLURISHD_ON + col = BlurHD(d.texcoord0.xy, _MainTex, sampler_MainTex, _BlurIntensity, (_MaxXUV - _MinXUV), (_MaxYUV - _MinYUV)) * d.vertexColor; + #else + col = Blur(d.texcoord0.xy, _MainTex, sampler_MainTex, _BlurIntensity * (_MaxXUV - _MinXUV)) * d.vertexColor; + #endif + #else + #if !BLURISHD_ON + col = BlurHD(d.texcoord0.xy, _MainTex, sampler_MainTex, _BlurIntensity, 1, 1) * d.vertexColor; + #else + col = Blur(d.texcoord0.xy, _MainTex, sampler_MainTex, _BlurIntensity) * d.vertexColor; + #endif + #endif + #endif + + //-------------------- + + //MOTIONBLUR_ON + #if MOTIONBLUR_ON + _MotionBlurAngle = _MotionBlurAngle * 3.1415926; + #define rot(n) mul(n, half2x2(cos(_MotionBlurAngle), -sin(_MotionBlurAngle), sin(_MotionBlurAngle), cos(_MotionBlurAngle))) + _MotionBlurDist = _MotionBlurDist * 0.005; + #if ATLAS_ON + _MotionBlurDist *= (_MaxXUV - _MinXUV); + #endif + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(-_MotionBlurDist, -_MotionBlurDist))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(-_MotionBlurDist * 2, -_MotionBlurDist * 2))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(-_MotionBlurDist * 3, -_MotionBlurDist * 3))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(-_MotionBlurDist * 4, -_MotionBlurDist * 4))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(_MotionBlurDist, _MotionBlurDist))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(_MotionBlurDist * 2, _MotionBlurDist * 2))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(_MotionBlurDist * 3, _MotionBlurDist * 3))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(_MotionBlurDist * 4, _MotionBlurDist * 4))); + col.rgb = col.rgb / 9; + #endif + //------------------------------------ + + //NEGATIVE_ON + #if NEGATIVE_ON + col.rgb = lerp(col.rgb, 1 - col.rgb, _NegativeAmount); + #endif + + //-------------- + half luminance = 0; + + //GREYSCALE_ON && !GREYSCALEOUTLINE_ON + #if GREYSCALE_ON && !GREYSCALEOUTLINE_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + luminance = saturate(luminance + _GreyscaleLuminosity); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _GreyscaleTintColor, _GreyscaleBlend); + #endif + //------------------------------------ + + //GHOST_ON + #if GHOST_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + half4 ghostResult; + ghostResult.a = saturate(luminance - _GhostTransparency) * col.a; + ghostResult.rgb = col.rgb * (luminance + _GhostColorBoost); + col = lerp(col, ghostResult, _GhostBlend); + #endif + //------------------------------------ + + //INNEROUTLINE_ON + #if INNEROUTLINE_ON + half3 innerT = abs(GetPixel(0, _InnerOutlineThickness, d.texcoord0.xy, _MainTex, sampler_MainTex) - GetPixel(0, -_InnerOutlineThickness, d.texcoord0.xy, _MainTex, sampler_MainTex)); + innerT += abs(GetPixel(_InnerOutlineThickness, 0, d.texcoord0.xy, _MainTex, sampler_MainTex) - GetPixel(-_InnerOutlineThickness, 0, d.texcoord0.xy, _MainTex, sampler_MainTex)); + #if !ONLYINNEROUTLINE_ON + innerT = (innerT / 2.0) * col.a * _InnerOutlineAlpha; + col.rgb += length(innerT) * _InnerOutlineColor.rgb * _InnerOutlineGlow; + #else + innerT *= col.a * _InnerOutlineAlpha; + col.rgb = length(innerT) * _InnerOutlineColor.rgb * _InnerOutlineGlow; + col.a = step(0.3, col.r+col.g+col.b); + #endif + #endif + //------------------------------------------------------- + + //HITEFFECT_ON + #if HITEFFECT_ON + col.rgb = lerp(col.rgb, _HitEffectColor.rgb * _HitEffectGlow, _HitEffectBlend); + #endif + //-------------------- + + //GRADIENT_ON + #if GRADIENT_ON + half2 tiledUvGrad = half2(uvRect.x / _MainTex_ST.x, uvRect.y / _MainTex_ST.y); + #if GRADIENT2COL_ON + _GradTopRightCol = _GradTopLeftCol; + _GradBotRightCol = _GradBotLeftCol; + #endif + #if RADIALGRADIENT_ON + half radialDist = 1 - length(tiledUvGrad - half2(0.5, 0.5)); + radialDist *= (_MainTex_TexelSize.w / _MainTex_TexelSize.z); + radialDist = saturate(_GradBoostX * radialDist); + half4 gradientResult = lerp(_GradTopLeftCol, _GradBotLeftCol, radialDist); + #else + half gradXLerpFactor = saturate(pow(tiledUvGrad.x, _GradBoostX)); + half4 gradientResult = lerp(lerp(_GradBotLeftCol, _GradBotRightCol, gradXLerpFactor), + lerp(_GradTopLeftCol, _GradTopRightCol, gradXLerpFactor), saturate(pow(tiledUvGrad.y, _GradBoostY))); + #endif + gradientResult = lerp(col, gradientResult, _GradBlend); + col.rgb = gradientResult.rgb * col.a; + col.a *= gradientResult.a; + #endif + //-------------------------------------------------------------------- + + //CONTRAST_ON + #if CONTRAST_ON + col.rgb = (col.rgb - float3(0.5, 0.5, 0.5)) * _Contrast + float3(0.5, 0.5, 0.5); + col.rgb += _Brightness; + #endif + + //------------------------------------------------------------------- + + //COLORSWAP_ON + #if COLORSWAP_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + half4 swapMask = SAMPLE_TEXTURE2D(_ColorSwapTex, sampler_ColorSwapTex, d.texcoord0.xy); + swapMask.rgb *= swapMask.a; + half3 redSwap = _ColorSwapRed * swapMask.r * saturate(luminance + _ColorSwapRedLuminosity); + half3 greenSwap = _ColorSwapGreen * swapMask.g * saturate(luminance + _ColorSwapGreenLuminosity); + half3 blueSwap = _ColorSwapBlue * swapMask.b * saturate(luminance + _ColorSwapBlueLuminosity); + swapMask.rgb = col.rgb * saturate(1 - swapMask.r - swapMask.g - swapMask.b); + col.rgb = lerp(col.rgb, swapMask.rgb + redSwap + greenSwap + blueSwap, _ColorSwapBlend); + #endif + //-------------------------------------------------------------------- + + //COLORRAMP_ON && !COLORRAMPOUTLINE_ON + #if COLORRAMP_ON && !COLORRAMPOUTLINE_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + luminance = saturate(luminance + _ColorRampLuminosity); + #if GRADIENTCOLORRAMP_ON + col.rgb = lerp(col.rgb, SAMPLE_TEXTURE2D(_ColorRampTexGradient, sampler_ColorRampTexGradient, half2(luminance, 0)).rgb, _ColorRampBlend); + #else + col.rgb = lerp(col.rgb, SAMPLE_TEXTURE2D(_ColorRampTex, sampler_ColorRampTex, half2(luminance, 0)).rgb, _ColorRampBlend); + #endif + #endif + //-------------------------------------------------------------------- + + //CHANGECOLOR_ON + #if CHANGECOLOR_ON + float3 currChangeColor = saturate(col.rgb); + luminance = 0.3 * currChangeColor.r + 0.59 * currChangeColor.g + 0.11 * currChangeColor.b; + luminance = saturate(luminance + _ColorChangeLuminosity); + half3 dif = abs(currChangeColor - _ColorChangeTarget.rgb); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _ColorChangeNewCol.rgb, + max(sign(1 - saturate(dif.x + dif.y + dif.z) - _ColorChangeTolerance), 0.0)); + #if CHANGECOLOR2_ON + dif = abs(currChangeColor - _ColorChangeTarget2.rgb); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _ColorChangeNewCol2.rgb, + max(sign(1 - saturate(dif.x + dif.y + dif.z) - _ColorChangeTolerance2), 0.0)); + #endif + #if CHANGECOLOR3_ON + dif = abs(currChangeColor - _ColorChangeTarget3.rgb); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _ColorChangeNewCol3.rgb, + max(sign(1 - saturate(dif.x + dif.y + dif.z) - _ColorChangeTolerance3), 0.0)); + #endif + #endif + //------------------------------------------------------- + + //POSTERIZE_ON && !POSTERIZEOUTLINE_ON + #if POSTERIZE_ON && !POSTERIZEOUTLINE_ON + col.rgb = pow(col.rgb, _PosterizeGamma) * _PosterizeNumColors; + col.rgb = floor(col.rgb) / _PosterizeNumColors; + col.rgb = pow(col.rgb, 1.0 / _PosterizeGamma); + #endif + //------------------------------------ + + //HSV_ON + #if HSV_ON + half3 resultHsv = half3(col.rgb); + half cosHsv = _HsvBright * _HsvSaturation * cos(_HsvShift * 3.14159265 / 180); + half sinHsv = _HsvBright * _HsvSaturation * sin(_HsvShift * 3.14159265 / 180); + resultHsv.x = (.299 * _HsvBright + .701 * cosHsv + .168 * sinHsv) * col.x + + (.587 * _HsvBright - .587 * cosHsv + .330 * sinHsv) * col.y + + (.114 * _HsvBright - .114 * cosHsv - .497 * sinHsv) * col.z; + resultHsv.y = (.299 * _HsvBright - .299 * cosHsv - .328 * sinHsv) *col.x + + (.587 * _HsvBright + .413 * cosHsv + .035 * sinHsv) * col.y + + (.114 * _HsvBright - .114 * cosHsv + .292 * sinHsv) * col.z; + resultHsv.z = (.299 * _HsvBright - .3 * cosHsv + 1.25 * sinHsv) * col.x + + (.587 * _HsvBright - .588 * cosHsv - 1.05 * sinHsv) * col.y + + (.114 * _HsvBright + .886 * cosHsv - .203 * sinHsv) * col.z; + col.rgb = resultHsv; + #endif + //------------------------------------------------------- + + //OVERLAY_ON + #if OVERLAY_ON + half2 overlayUvs = d.texcoord0.xy; + overlayUvs.x += ((_Time.y + randomSeed) * _OverlayTextureScrollXSpeed) % 1; + overlayUvs.y += ((_Time.y + randomSeed) * _OverlayTextureScrollYSpeed) % 1; + half4 overlayCol = SAMPLE_TEXTURE2D(_OverlayTex, sampler_OverlayTex, TRANSFORM_TEX(overlayUvs, _OverlayTex)); + overlayCol.rgb *= _OverlayColor.rgb * _OverlayGlow; + #if !OVERLAYMULT_ON + overlayCol.rgb *= overlayCol.a * _OverlayColor.rgb * _OverlayColor.a * _OverlayBlend; + col.rgb += overlayCol.rgb; + #else + overlayCol.a *= _OverlayColor.a; + col = lerp(col, col * overlayCol, _OverlayBlend); + #endif + #endif + + //--------------------------------- + + //OUTBASE_ON + #if OUTBASE_ON + #if OUTBASEPIXELPERF_ON + half2 destUv = half2(_OutlinePixelWidth * _MainTex_TexelSize.x, _OutlinePixelWidth * _MainTex_TexelSize.y); + #else + half2 destUv = half2(_OutlineWidth * _MainTex_TexelSize.x * 200, _OutlineWidth * _MainTex_TexelSize.y * 200); + #endif + + #if OUTDIST_ON + d.texcoord3.x += ((_Time.x + _RandomSeed) * _OutlineDistortTexXSpeed) % 1; + d.texcoord3.y += ((_Time.x + _RandomSeed) * _OutlineDistortTexYSpeed) % 1; + #if ATLAS_ON + d.texcoord3 = half2((d.texcoord3.x - _MinXUV) / (_MaxXUV - _MinXUV), (d.texcoord3.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half outDistortAmnt = (SAMPLE_TEXTURE2D(_OutlineDistortTex, sampler_OutlineDistortTex, d.texcoord3).r - 0.5) * 0.2 * _OutlineDistortAmount; + destUv.x += outDistortAmnt; + destUv.y += outDistortAmnt; + #endif + + half spriteLeft = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(destUv.x, 0)).a; + half spriteRight = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy - half2(destUv.x, 0)).a; + half spriteBottom = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(0, destUv.y)).a; + half spriteTop = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy - half2(0, destUv.y)).a; + half result = spriteLeft + spriteRight + spriteBottom + spriteTop; + + #if OUTBASE8DIR_ON + half spriteTopLeft = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(destUv.x, destUv.y)).a; + half spriteTopRight = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(-destUv.x, destUv.y)).a; + half spriteBotLeft = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(destUv.x, -destUv.y)).a; + half spriteBotRight = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(-destUv.x, -destUv.y)).a; + result = result + spriteTopLeft + spriteTopRight + spriteBotLeft + spriteBotRight; + #endif + + result = step(0.05, saturate(result)); + + #if OUTTEX_ON + d.texcoord1.x += ((_Time.x + _RandomSeed) * _OutlineTexXSpeed) % 1; + d.texcoord1.y += ((_Time.x + _RandomSeed) * _OutlineTexYSpeed) % 1; + #if ATLAS_ON + d.texcoord1 = half2((d.texcoord1.x - _MinXUV) / (_MaxXUV - _MinXUV), (d.texcoord1.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half4 tempOutColor = SAMPLE_TEXTURE2D(_OutlineTex, sampler_OutlineTex, d.texcoord1); + tempOutColor *= _OutlineColor; + _OutlineColor = tempOutColor; + #endif + + result *= (1 - originalAlpha) * _OutlineAlpha; + + half4 outline = _OutlineColor * d.vertexColor.a; + outline.rgb *= _OutlineGlow; + outline.a = result; + #if ONLYOUTLINE_ON + col = outline; + #else + col = lerp(col, outline, result); + #endif + #endif + //------------------------------------------------------- + + //FADE_ON + #if FADE_ON + half2 tiledUvFade1 = TRANSFORM_TEX(d.texcoord0, _FadeTex); + half2 tiledUvFade2 = TRANSFORM_TEX(d.texcoord0, _FadeBurnTex); + #if ATLAS_ON + tiledUvFade1 = half2((tiledUvFade1.x - _MinXUV) / (_MaxXUV - _MinXUV), (tiledUvFade1.y - _MinYUV) / (_MaxYUV - _MinYUV)); + tiledUvFade2 = half2((tiledUvFade2.x - _MinXUV) / (_MaxXUV - _MinXUV), (tiledUvFade2.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half fadeTemp = SAMPLE_TEXTURE2D(_FadeTex, sampler_FadeTex, tiledUvFade1).r; + half fade = smoothstep(_FadeAmount, _FadeAmount + _FadeBurnTransition, fadeTemp); + half fadeBurn = saturate(smoothstep(_FadeAmount - _FadeBurnWidth, _FadeAmount - _FadeBurnWidth + 0.1, fadeTemp) * _FadeAmount); + col.a *= fade; + _FadeBurnColor.rgb *= _FadeBurnGlow; + col += fadeBurn * SAMPLE_TEXTURE2D(_FadeBurnTex, sampler_FadeBurnTex, tiledUvFade2) * _FadeBurnColor * originalAlpha * (1 - col.a); + #endif + //------------------------------------------------------- + + //SHADOW_ON + #if SHADOW_ON + half shadowA = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(_ShadowX, _ShadowY)).a; + half preMultShadowMask = 1 - (saturate(shadowA - col.a) * (1 - col.a)); + col.rgb *= 1 - ((shadowA - col.a) * (1 - col.a)); + col.rgb += (_ShadowColor * shadowA) * (1 - col.a); + col.a = max(shadowA * _ShadowAlpha * d.vertexColor.a, col.a); + #endif + + //------------------------------------------------------- + + //GLOW_ON + #if GLOW_ON + half4 emission; + #if GLOWTEX_ON + emission = SAMPLE_TEXTURE2D(_GlowTex, sampler_GlowTex, d.texcoord0); + #else + emission = col; + #endif + + col.rgb *= _GlowGlobal; + emission.rgb *= emission.a * col.a * _Glow * _GlowColor; + col.rgb += emission.rgb; + #endif + //------------------------------------------------------- + + //COLORRAMP_ON && COLORRAMPOUTLINE_ON + #if COLORRAMP_ON && COLORRAMPOUTLINE_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + luminance = saturate(luminance + _ColorRampLuminosity); + #if GRADIENTCOLORRAMP_ON + col.rgb = lerp(col.rgb, SAMPLE_TEXTURE2D(_ColorRampTexGradient, sampler_ColorRampTexGradient, half2(luminance, 0)).rgb, _ColorRampBlend); + #else + col.rgb = lerp(col.rgb, SAMPLE_TEXTURE2D(_ColorRampTex, sampler_ColorRampTex, half2(luminance, 0)).rgb, _ColorRampBlend); + #endif + #endif + //--------------- + + //GREYSCALE_ON && GREYSCALEOUTLINE_ON + #if GREYSCALE_ON && GREYSCALEOUTLINE_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + luminance = saturate(luminance + _GreyscaleLuminosity); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _GreyscaleTintColor, _GreyscaleBlend); + #endif + + //----------------------------------- + + //POSTERIZE_ON && POSTERIZEOUTLINE_ON + #if POSTERIZE_ON && POSTERIZEOUTLINE_ON + col.rgb = pow(col.rgb, _PosterizeGamma) * _PosterizeNumColors; + col.rgb = floor(col.rgb) / _PosterizeNumColors; + col.rgb = pow(col.rgb, 1.0 / _PosterizeGamma); + #endif + + //----------------------------------- + + //SHINE_ON + #if SHINE_ON + half2 uvShine = uvRect; + half cosAngle = cos(_ShineRotate); + half sinAngle = sin(_ShineRotate); + half2x2 rot = half2x2(cosAngle, -sinAngle, sinAngle, cosAngle); + uvShine -= half2(0.5, 0.5); + uvShine = mul(rot, uvShine); + uvShine += half2(0.5, 0.5); + half shineMask = SAMPLE_TEXTURE2D(_ShineMask, sampler_ShineMask, d.texcoord0.xy).a; + half currentDistanceProjection = (uvShine.x + uvShine.y) / 2; + half whitePower = 1 - (abs(currentDistanceProjection - _ShineLocation) / _ShineWidth); + col.rgb += col.a * whitePower * _ShineGlow * max(sign(currentDistanceProjection - (_ShineLocation - _ShineWidth)), 0.0) + * max(sign((_ShineLocation + _ShineWidth) - currentDistanceProjection), 0.0) * _ShineColor * shineMask; + #endif + + //----------------------------------- + + //HOLOGRAM_ON + #if HOLOGRAM_ON + half totalHologram = _HologramStripesAmount + _HologramUnmodAmount; + half hologramYCoord = ((uvRect.y + (((_Time.x + randomSeed) % 1) * _HologramStripesSpeed)) % totalHologram) / totalHologram; + hologramYCoord = abs(hologramYCoord); + half alpha = RemapFloat(saturate(hologramYCoord - (_HologramUnmodAmount/totalHologram)), 0.0, 1.0, _HologramMinAlpha, saturate(_HologramMaxAlpha)); + half hologramMask = max(sign((_HologramUnmodAmount/totalHologram) - hologramYCoord), 0.0); + half4 hologramResult = col; + hologramResult.a *= lerp(alpha, 1, hologramMask); + hologramResult.rgb *= max(1, _HologramMaxAlpha * max(sign(hologramYCoord - (_HologramUnmodAmount/totalHologram)), 0.0)); + hologramMask = 1 - step(0.01,hologramMask); + hologramResult.rgb += hologramMask * _HologramStripeColor * col.a; + col = lerp(col, hologramResult, _HologramBlend); + #endif + + //----------------------------------- + + //FLICKER_ON + #if FLICKER_ON + col.a *= saturate(col.a * step(frac(0.05 + (_Time.w + randomSeed) * _FlickerFreq), 1 - _FlickerPercent) + _FlickerAlpha); + #endif + //----------------------------------- + + //ALPHACUTOFF_ON + + //ALPHAROUND_ON + + //ALPHAOUTLINE_ON + #if ALPHAOUTLINE_ON + half alphaOutlineRes = pow(1 - col.a, max(_AlphaOutlinePower, 0.0001)) * step(_AlphaOutlineMinAlpha, col.a) * _AlphaOutlineBlend; + col.rgb = lerp(col.rgb, _AlphaOutlineColor.rgb * _AlphaOutlineGlow, alphaOutlineRes); + col.a = lerp(col.a, 1, alphaOutlineRes > 1); + #endif + //------------------------------------------------------- + + //FOG_ON + + //------------------ + + col *= _Color; + o.Albedo = col; + col.a *= _Alpha; + clip(col.a - _AlphaCutoffValue - 0.01); + o.Alpha = _Color.a; + } + + + + + + void ChainSurfaceFunction(inout Surface l, inout ShaderData d) + { + Ext_SurfaceFunction0(l, d); + // Ext_SurfaceFunction1(l, d); + // Ext_SurfaceFunction2(l, d); + // Ext_SurfaceFunction3(l, d); + // Ext_SurfaceFunction4(l, d); + // Ext_SurfaceFunction5(l, d); + // Ext_SurfaceFunction6(l, d); + // Ext_SurfaceFunction7(l, d); + // Ext_SurfaceFunction8(l, d); + // Ext_SurfaceFunction9(l, d); + // Ext_SurfaceFunction10(l, d); + // Ext_SurfaceFunction11(l, d); + // Ext_SurfaceFunction12(l, d); + // Ext_SurfaceFunction13(l, d); + // Ext_SurfaceFunction14(l, d); + // Ext_SurfaceFunction15(l, d); + // Ext_SurfaceFunction16(l, d); + // Ext_SurfaceFunction17(l, d); + // Ext_SurfaceFunction18(l, d); + // Ext_SurfaceFunction19(l, d); + // Ext_SurfaceFunction20(l, d); + // Ext_SurfaceFunction21(l, d); + // Ext_SurfaceFunction22(l, d); + // Ext_SurfaceFunction23(l, d); + // Ext_SurfaceFunction24(l, d); + // Ext_SurfaceFunction25(l, d); + // Ext_SurfaceFunction26(l, d); + // Ext_SurfaceFunction27(l, d); + // Ext_SurfaceFunction28(l, d); + // Ext_SurfaceFunction29(l, d); + } + +#if !_DECALSHADER + + void ChainModifyVertex(inout VertexData v, inout VertexToPixel v2p, float4 time) + { + ExtraV2F d; + + ZERO_INITIALIZE(ExtraV2F, d); + ZERO_INITIALIZE(Blackboard, d.blackboard); + // due to motion vectors in HDRP, we need to use the last + // time in certain spots. So if you are going to use _Time to adjust vertices, + // you need to use this time or motion vectors will break. + d.time = time; + + Ext_ModifyVertex0(v, d); + // Ext_ModifyVertex1(v, d); + // Ext_ModifyVertex2(v, d); + // Ext_ModifyVertex3(v, d); + // Ext_ModifyVertex4(v, d); + // Ext_ModifyVertex5(v, d); + // Ext_ModifyVertex6(v, d); + // Ext_ModifyVertex7(v, d); + // Ext_ModifyVertex8(v, d); + // Ext_ModifyVertex9(v, d); + // Ext_ModifyVertex10(v, d); + // Ext_ModifyVertex11(v, d); + // Ext_ModifyVertex12(v, d); + // Ext_ModifyVertex13(v, d); + // Ext_ModifyVertex14(v, d); + // Ext_ModifyVertex15(v, d); + // Ext_ModifyVertex16(v, d); + // Ext_ModifyVertex17(v, d); + // Ext_ModifyVertex18(v, d); + // Ext_ModifyVertex19(v, d); + // Ext_ModifyVertex20(v, d); + // Ext_ModifyVertex21(v, d); + // Ext_ModifyVertex22(v, d); + // Ext_ModifyVertex23(v, d); + // Ext_ModifyVertex24(v, d); + // Ext_ModifyVertex25(v, d); + // Ext_ModifyVertex26(v, d); + // Ext_ModifyVertex27(v, d); + // Ext_ModifyVertex28(v, d); + // Ext_ModifyVertex29(v, d); + + + // #if %EXTRAV2F0REQUIREKEY% + // v2p.extraV2F0 = d.extraV2F0; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // v2p.extraV2F1 = d.extraV2F1; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // v2p.extraV2F2 = d.extraV2F2; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // v2p.extraV2F3 = d.extraV2F3; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // v2p.extraV2F4 = d.extraV2F4; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // v2p.extraV2F5 = d.extraV2F5; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // v2p.extraV2F6 = d.extraV2F6; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // v2p.extraV2F7 = d.extraV2F7; + // #endif + } + + void ChainModifyTessellatedVertex(inout VertexData v, inout VertexToPixel v2p) + { + ExtraV2F d; + ZERO_INITIALIZE(ExtraV2F, d); + ZERO_INITIALIZE(Blackboard, d.blackboard); + + // #if %EXTRAV2F0REQUIREKEY% + // d.extraV2F0 = v2p.extraV2F0; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // d.extraV2F1 = v2p.extraV2F1; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // d.extraV2F2 = v2p.extraV2F2; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // d.extraV2F3 = v2p.extraV2F3; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // d.extraV2F4 = v2p.extraV2F4; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // d.extraV2F5 = v2p.extraV2F5; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // d.extraV2F6 = v2p.extraV2F6; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // d.extraV2F7 = v2p.extraV2F7; + // #endif + + + // Ext_ModifyTessellatedVertex0(v, d); + // Ext_ModifyTessellatedVertex1(v, d); + // Ext_ModifyTessellatedVertex2(v, d); + // Ext_ModifyTessellatedVertex3(v, d); + // Ext_ModifyTessellatedVertex4(v, d); + // Ext_ModifyTessellatedVertex5(v, d); + // Ext_ModifyTessellatedVertex6(v, d); + // Ext_ModifyTessellatedVertex7(v, d); + // Ext_ModifyTessellatedVertex8(v, d); + // Ext_ModifyTessellatedVertex9(v, d); + // Ext_ModifyTessellatedVertex10(v, d); + // Ext_ModifyTessellatedVertex11(v, d); + // Ext_ModifyTessellatedVertex12(v, d); + // Ext_ModifyTessellatedVertex13(v, d); + // Ext_ModifyTessellatedVertex14(v, d); + // Ext_ModifyTessellatedVertex15(v, d); + // Ext_ModifyTessellatedVertex16(v, d); + // Ext_ModifyTessellatedVertex17(v, d); + // Ext_ModifyTessellatedVertex18(v, d); + // Ext_ModifyTessellatedVertex19(v, d); + // Ext_ModifyTessellatedVertex20(v, d); + // Ext_ModifyTessellatedVertex21(v, d); + // Ext_ModifyTessellatedVertex22(v, d); + // Ext_ModifyTessellatedVertex23(v, d); + // Ext_ModifyTessellatedVertex24(v, d); + // Ext_ModifyTessellatedVertex25(v, d); + // Ext_ModifyTessellatedVertex26(v, d); + // Ext_ModifyTessellatedVertex27(v, d); + // Ext_ModifyTessellatedVertex28(v, d); + // Ext_ModifyTessellatedVertex29(v, d); + + // #if %EXTRAV2F0REQUIREKEY% + // v2p.extraV2F0 = d.extraV2F0; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // v2p.extraV2F1 = d.extraV2F1; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // v2p.extraV2F2 = d.extraV2F2; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // v2p.extraV2F3 = d.extraV2F3; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // v2p.extraV2F4 = d.extraV2F4; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // v2p.extraV2F5 = d.extraV2F5; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // v2p.extraV2F6 = d.extraV2F6; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // v2p.extraV2F7 = d.extraV2F7; + // #endif + } + + void ChainFinalColorForward(inout Surface l, inout ShaderData d, inout half4 color) + { + // Ext_FinalColorForward0(l, d, color); + // Ext_FinalColorForward1(l, d, color); + // Ext_FinalColorForward2(l, d, color); + // Ext_FinalColorForward3(l, d, color); + // Ext_FinalColorForward4(l, d, color); + // Ext_FinalColorForward5(l, d, color); + // Ext_FinalColorForward6(l, d, color); + // Ext_FinalColorForward7(l, d, color); + // Ext_FinalColorForward8(l, d, color); + // Ext_FinalColorForward9(l, d, color); + // Ext_FinalColorForward10(l, d, color); + // Ext_FinalColorForward11(l, d, color); + // Ext_FinalColorForward12(l, d, color); + // Ext_FinalColorForward13(l, d, color); + // Ext_FinalColorForward14(l, d, color); + // Ext_FinalColorForward15(l, d, color); + // Ext_FinalColorForward16(l, d, color); + // Ext_FinalColorForward17(l, d, color); + // Ext_FinalColorForward18(l, d, color); + // Ext_FinalColorForward19(l, d, color); + // Ext_FinalColorForward20(l, d, color); + // Ext_FinalColorForward21(l, d, color); + // Ext_FinalColorForward22(l, d, color); + // Ext_FinalColorForward23(l, d, color); + // Ext_FinalColorForward24(l, d, color); + // Ext_FinalColorForward25(l, d, color); + // Ext_FinalColorForward26(l, d, color); + // Ext_FinalColorForward27(l, d, color); + // Ext_FinalColorForward28(l, d, color); + // Ext_FinalColorForward29(l, d, color); + } + + void ChainFinalGBufferStandard(inout Surface s, inout ShaderData d, inout half4 GBuffer0, inout half4 GBuffer1, inout half4 GBuffer2, inout half4 outEmission, inout half4 outShadowMask) + { + // Ext_FinalGBufferStandard0(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard1(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard2(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard3(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard4(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard5(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard6(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard7(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard8(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard9(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard10(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard11(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard12(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard13(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard14(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard15(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard16(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard17(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard18(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard19(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard20(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard21(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard22(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard23(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard24(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard25(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard26(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard27(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard28(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard29(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + } +#endif + + + + + +#if _DECALSHADER + + ShaderData CreateShaderData(SurfaceDescriptionInputs IN) + { + ShaderData d = (ShaderData)0; + d.TBNMatrix = float3x3(IN.WorldSpaceTangent, IN.WorldSpaceBiTangent, IN.WorldSpaceNormal); + d.worldSpaceNormal = IN.WorldSpaceNormal; + d.worldSpaceTangent = IN.WorldSpaceTangent; + + d.worldSpacePosition = IN.WorldSpacePosition; + d.texcoord0 = IN.uv0.xyxy; + d.screenPos = IN.ScreenPosition; + + d.worldSpaceViewDir = normalize(_WorldSpaceCameraPos - d.worldSpacePosition); + + d.tangentSpaceViewDir = mul(d.TBNMatrix, d.worldSpaceViewDir); + + // these rarely get used, so we back transform them. Usually will be stripped. + #if _HDRP + // d.localSpacePosition = mul(GetWorldToObjectMatrix(), float4(GetCameraRelativePositionWS(d.worldSpacePosition), 1)).xyz; + #else + // d.localSpacePosition = mul(GetWorldToObjectMatrix(), float4(d.worldSpacePosition, 1)).xyz; + #endif + // d.localSpaceNormal = normalize(mul((float3x3)GetWorldToObjectMatrix(), d.worldSpaceNormal)); + // d.localSpaceTangent = normalize(mul((float3x3)GetWorldToObjectMatrix(), d.worldSpaceTangent.xyz)); + + // #if %SCREENPOSREQUIREKEY% + // d.screenUV = (IN.ScreenPosition.xy / max(0.01, IN.ScreenPosition.w)); + // #endif + + return d; + } +#else + + ShaderData CreateShaderData(VertexToPixel i + #if NEED_FACING + , bool facing + #endif + ) + { + ShaderData d = (ShaderData)0; + d.clipPos = i.pos; + d.worldSpacePosition = i.worldPos; + + d.worldSpaceNormal = normalize(i.worldNormal); + d.worldSpaceTangent.xyz = normalize(i.worldTangent.xyz); + + d.tangentSign = i.worldTangent.w * unity_WorldTransformParams.w; + float3 bitangent = cross(d.worldSpaceTangent.xyz, d.worldSpaceNormal) * d.tangentSign; + + d.TBNMatrix = float3x3(d.worldSpaceTangent, -bitangent, d.worldSpaceNormal); + d.worldSpaceViewDir = normalize(_WorldSpaceCameraPos - i.worldPos); + + d.tangentSpaceViewDir = mul(d.TBNMatrix, d.worldSpaceViewDir); + d.texcoord0 = i.texcoord0; + d.texcoord1 = i.texcoord1; + d.texcoord2 = i.texcoord2; + + // #if %TEXCOORD3REQUIREKEY% + d.texcoord3 = i.texcoord3; + // #endif + + // d.isFrontFace = facing; + // #if %VERTEXCOLORREQUIREKEY% + d.vertexColor = i.vertexColor; + // #endif + + // these rarely get used, so we back transform them. Usually will be stripped. + #if _HDRP + // d.localSpacePosition = mul(GetWorldToObjectMatrix(), float4(GetCameraRelativePositionWS(i.worldPos), 1)).xyz; + #else + // d.localSpacePosition = mul(GetWorldToObjectMatrix(), float4(i.worldPos, 1)).xyz; + #endif + // d.localSpaceNormal = normalize(mul((float3x3)GetWorldToObjectMatrix(), i.worldNormal)); + // d.localSpaceTangent = normalize(mul((float3x3)GetWorldToObjectMatrix(), i.worldTangent.xyz)); + + // #if %SCREENPOSREQUIREKEY% + // d.screenPos = i.screenPos; + // d.screenUV = (i.screenPos.xy / i.screenPos.w); + // #endif + + + // #if %EXTRAV2F0REQUIREKEY% + // d.extraV2F0 = i.extraV2F0; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // d.extraV2F1 = i.extraV2F1; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // d.extraV2F2 = i.extraV2F2; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // d.extraV2F3 = i.extraV2F3; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // d.extraV2F4 = i.extraV2F4; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // d.extraV2F5 = i.extraV2F5; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // d.extraV2F6 = i.extraV2F6; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // d.extraV2F7 = i.extraV2F7; + // #endif + + return d; + } + +#endif + + + #if _PASSSHADOW + float3 _LightDirection; + #endif + + // vertex shader + VertexToPixel Vert (VertexData v) + { + + VertexToPixel o = (VertexToPixel)0; + + UNITY_SETUP_INSTANCE_ID(v); + UNITY_TRANSFER_INSTANCE_ID(v, o); + UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o); + + +#if !_TESSELLATION_ON + ChainModifyVertex(v, o, _Time); +#endif + + o.texcoord0 = v.texcoord0; + o.texcoord1 = v.texcoord1; + o.texcoord2 = v.texcoord2; + + // #if %TEXCOORD3REQUIREKEY% + o.texcoord3 = v.texcoord3; + // #endif + + // #if %VERTEXCOLORREQUIREKEY% + o.vertexColor = v.vertexColor; + // #endif + + VertexPositionInputs vertexInput = GetVertexPositionInputs(v.vertex.xyz); + o.worldPos = TransformObjectToWorld(v.vertex.xyz); + o.worldNormal = TransformObjectToWorldNormal(v.normal); + o.worldTangent = float4(TransformObjectToWorldDir(v.tangent.xyz), v.tangent.w); + + + #if _PASSSHADOW + // Define shadow pass specific clip position for Universal + o.pos = TransformWorldToHClip(ApplyShadowBias(o.worldPos, o.worldNormal, _LightDirection)); + #if UNITY_REVERSED_Z + o.pos.z = min(o.pos.z, UNITY_NEAR_CLIP_VALUE); + #else + o.pos.z = max(o.pos.z, UNITY_NEAR_CLIP_VALUE); + #endif + #elif _PASSMETA + o.pos = MetaVertexPosition(float4(v.vertex.xyz, 0), v.texcoord1, v.texcoord2, unity_LightmapST, unity_DynamicLightmapST); + #else + o.pos = TransformWorldToHClip(o.worldPos); + #endif + + // #if %SCREENPOSREQUIREKEY% + // o.screenPos = ComputeScreenPos(o.pos, _ProjectionParams.x); + // #endif + + #if _PASSFORWARD + OUTPUT_LIGHTMAP_UV(v.texcoord1, unity_LightmapST, o.lightmapUV); + OUTPUT_SH(o.worldNormal, o.sh); + #endif + + #ifdef VARYINGS_NEED_FOG_AND_VERTEX_LIGHT + #if _BAKEDLIT + half3 vertexLight = 0; + #else + half3 vertexLight = VertexLighting(o.worldPos, o.worldNormal); + #endif + half fogFactor = ComputeFogFactor(o.pos.z); + o.fogFactorAndVertexLight = half4(fogFactor, vertexLight); + #endif + + #ifdef _MAIN_LIGHT_SHADOWS + o.shadowCoord = GetShadowCoord(vertexInput); + #endif + + return o; + } + + + + + // fragment shader + half4 Frag (VertexToPixel IN + #if NEED_FACING + , bool facing : SV_IsFrontFace + #endif + ) : SV_Target + { + UNITY_SETUP_INSTANCE_ID(IN); + + ShaderData d = CreateShaderData(IN + #if NEED_FACING + , facing + #endif + ); + + Surface l = (Surface)0; + + l.Albedo = half3(0.5, 0.5, 0.5); + l.Normal = float3(0,0,1); + l.Occlusion = 1; + l.Alpha = 1; + + ChainSurfaceFunction(l, d); + + MetaInput metaInput = (MetaInput)0; + metaInput.Albedo = l.Albedo; + metaInput.Emission = l.Emission; + + return MetaFragment(metaInput); + + } + + ENDHLSL + + } + + + + Pass + { + // Name: + Tags + { + "LightMode" = "Universal2D" + } + + // Render State + Blend One Zero, One Zero + Cull Back + ZTest LEqual + ZWrite On + // ColorMask: + + Tags { "RenderType" = "Opaque" "Queue" = "Geometry" "PreviewType" = "Plane" } + Cull [_CullingOption] + ZWrite [_ZWrite] + ZTest [_ZTestMode] + + + HLSLPROGRAM + + #pragma vertex Vert + #pragma fragment Frag + + #pragma target 3.0 + + #pragma prefer_hlslcc gles + #pragma exclude_renderers d3d11_9x + #pragma multi_compile_instancing + + #define SHADERPASS_2D + + + #pragma shader_feature_local GLOW_ON + #pragma shader_feature_local FADE_ON + #pragma shader_feature_local OUTBASE_ON + #pragma shader_feature_local ONLYOUTLINE_ON + #pragma shader_feature_local GRADIENT_ON + #pragma shader_feature_local GRADIENT2COL_ON + #pragma shader_feature_local RADIALGRADIENT_ON + #pragma shader_feature_local COLORSWAP_ON + #pragma shader_feature_local HSV_ON + #pragma shader_feature_local CHANGECOLOR_ON + #pragma shader_feature_local CHANGECOLOR2_ON + #pragma shader_feature_local CHANGECOLOR3_ON + #pragma shader_feature_local COLORRAMP_ON + #pragma shader_feature_local GRADIENTCOLORRAMP_ON + #pragma shader_feature_local HITEFFECT_ON + #pragma shader_feature_local NEGATIVE_ON + #pragma shader_feature_local PIXELATE_ON + #pragma shader_feature_local GREYSCALE_ON + #pragma shader_feature_local POSTERIZE_ON + #pragma shader_feature_local BLUR_ON + #pragma shader_feature_local MOTIONBLUR_ON + #pragma shader_feature_local GHOST_ON + #pragma shader_feature_local ALPHAOUTLINE_ON + #pragma shader_feature_local INNEROUTLINE_ON + #pragma shader_feature_local ONLYINNEROUTLINE_ON + #pragma shader_feature_local HOLOGRAM_ON + #pragma shader_feature_local CHROMABERR_ON + #pragma shader_feature_local GLITCH_ON + #pragma shader_feature_local FLICKER_ON + #pragma shader_feature_local SHADOW_ON + #pragma shader_feature_local SHINE_ON + #pragma shader_feature_local CONTRAST_ON + #pragma shader_feature_local OVERLAY_ON + #pragma shader_feature_local OVERLAYMULT_ON + #pragma shader_feature_local DOODLE_ON + #pragma shader_feature_local WIND_ON + #pragma shader_feature_local WAVEUV_ON + #pragma shader_feature_local ROUNDWAVEUV_ON + #pragma shader_feature_local RECTSIZE_ON + #pragma shader_feature_local OFFSETUV_ON + #pragma shader_feature_local CLIPPING_ON + #pragma shader_feature_local RADIALCLIPPING_ON + #pragma shader_feature_local TEXTURESCROLL_ON + #pragma shader_feature_local ZOOMUV_ON + #pragma shader_feature_local DISTORT_ON + #pragma shader_feature_local WARP_ON + #pragma shader_feature_local TWISTUV_ON + #pragma shader_feature_local ROTATEUV_ON + #pragma shader_feature_local POLARUV_ON + #pragma shader_feature_local FISHEYE_ON + #pragma shader_feature_local PINCH_ON + #pragma shader_feature_local SHAKEUV_ON + + #pragma shader_feature_local GLOWTEX_ON + #pragma shader_feature_local OUTTEX_ON + #pragma shader_feature_local OUTDIST_ON + #pragma shader_feature_local OUTBASE8DIR_ON + #pragma shader_feature_local OUTBASEPIXELPERF_ON + #pragma shader_feature_local COLORRAMPOUTLINE_ON + #pragma shader_feature_local GREYSCALEOUTLINE_ON + #pragma shader_feature_local POSTERIZEOUTLINE_ON + #pragma shader_feature_local BLURISHD_ON + #pragma shader_feature_local MANUALWIND_ON + #pragma shader_feature_local ATLAS_ON + #pragma shader_feature_local PREMULTIPLYALPHA_ON + + #pragma shader_feature BILBOARD_ON + #pragma shader_feature BILBOARDY_ON + + #pragma shader_feature NORMALMAP_ON + + + #define _URP 1 +#define _USINGTEXCOORD1 1 +#define _USINGTEXCOORD2 1 + + + // Includes + #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Version.hlsl" + #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Color.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.universal/ShaderLibrary/ShaderGraphFunctions.hlsl" + #include "Packages/com.unity.shadergraph/ShaderGraphLibrary/ShaderVariablesFunctions.hlsl" + + + + + #undef WorldNormalVector + #define WorldNormalVector(data, normal) mul(normal, data.TBNMatrix) + + #define UnityObjectToWorldNormal(normal) mul(GetObjectToWorldMatrix(), normal) + + #define _WorldSpaceLightPos0 _MainLightPosition + + #define UNITY_DECLARE_TEX2D(name) TEXTURE2D(name); SAMPLER(sampler##name); + #define UNITY_DECLARE_TEX2D_NOSAMPLER(name) TEXTURE2D(name); + #define UNITY_DECLARE_TEX2DARRAY(name) TEXTURE2D_ARRAY(name); SAMPLER(sampler##name); + #define UNITY_DECLARE_TEX2DARRAY_NOSAMPLER(name) TEXTURE2D_ARRAY(name); + + #define UNITY_SAMPLE_TEX2DARRAY(tex,coord) SAMPLE_TEXTURE2D_ARRAY(tex, sampler##tex, coord.xy, coord.z) + #define UNITY_SAMPLE_TEX2DARRAY_LOD(tex,coord,lod) SAMPLE_TEXTURE2D_ARRAY_LOD(tex, sampler##tex, coord.xy, coord.z, lod) + #define UNITY_SAMPLE_TEX2D(tex, coord) SAMPLE_TEXTURE2D(tex, sampler##tex, coord) + #define UNITY_SAMPLE_TEX2D_SAMPLER(tex, samp, coord) SAMPLE_TEXTURE2D(tex, sampler##samp, coord) + + #define UNITY_SAMPLE_TEX2D_LOD(tex,coord, lod) SAMPLE_TEXTURE2D_LOD(tex, sampler_##tex, coord, lod) + #define UNITY_SAMPLE_TEX2D_SAMPLER_LOD(tex,samplertex,coord, lod) SAMPLE_TEXTURE2D_LOD (tex, sampler##samplertex,coord, lod) + + #if defined(UNITY_COMPILER_HLSL) + #define UNITY_INITIALIZE_OUTPUT(type,name) name = (type)0; + #else + #define UNITY_INITIALIZE_OUTPUT(type,name) + #endif + + #define sampler2D_float sampler2D + #define sampler2D_half sampler2D + + + + // data across stages, stripped like the above. + struct VertexToPixel + { + float4 pos : SV_POSITION; + float3 worldPos : TEXCOORD0; + float3 worldNormal : TEXCOORD1; + float4 worldTangent : TEXCOORD2; + float4 texcoord0 : TEXCOORD3; + float4 texcoord1 : TEXCOORD4; + float4 texcoord2 : TEXCOORD5; + + // #if %TEXCOORD3REQUIREKEY% + float4 texcoord3 : TEXCOORD6; + // #endif + + // #if %SCREENPOSREQUIREKEY% + // float4 screenPos : TEXCOORD7; + // #endif + + // #if %VERTEXCOLORREQUIREKEY% + half4 vertexColor : COLOR; + // #endif + + // #if %EXTRAV2F0REQUIREKEY% + // float4 extraV2F0 : TEXCOORD12; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // float4 extraV2F1 : TEXCOORD13; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // float4 extraV2F2 : TEXCOORD14; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // float4 extraV2F3 : TEXCOORD15; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // float4 extraV2F4 : TEXCOORD16; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // float4 extraV2F5 : TEXCOORD17; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // float4 extraV2F6 : TEXCOORD18; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // float4 extraV2F7 : TEXCOORD19; + // #endif + + #if defined(LIGHTMAP_ON) + float2 lightmapUV : TEXCOORD8; + #endif + #if !defined(LIGHTMAP_ON) + float3 sh : TEXCOORD9; + #endif + float4 fogFactorAndVertexLight : TEXCOORD10; + float4 shadowCoord : TEXCOORD11; + #if UNITY_ANY_INSTANCING_ENABLED + uint instanceID : CUSTOM_INSTANCE_ID; + #endif + #if (defined(UNITY_STEREO_INSTANCING_ENABLED)) + uint stereoTargetEyeIndexAsRTArrayIdx : SV_RenderTargetArrayIndex; + #endif + #if (defined(UNITY_STEREO_MULTIVIEW_ENABLED)) || (defined(UNITY_STEREO_INSTANCING_ENABLED) && (defined(SHADER_API_GLES3) || defined(SHADER_API_GLCORE))) + uint stereoTargetEyeIndexAsBlendIdx0 : BLENDINDICES0; + #endif + #if defined(SHADER_STAGE_FRAGMENT) && defined(VARYINGS_NEED_CULLFACE) + FRONT_FACE_TYPE cullFace : FRONT_FACE_SEMANTIC; + #endif + }; + + + + + + // data describing the user output of a pixel + struct Surface + { + half3 Albedo; + half Height; + half3 Normal; + half Smoothness; + half3 Emission; + half Metallic; + half3 Specular; + half Occlusion; + half SpecularPower; // for simple lighting + half Alpha; + float outputDepth; // if written, SV_Depth semantic is used. ShaderData.clipPos.z is unused value + // HDRP Only + half SpecularOcclusion; + half SubsurfaceMask; + half Thickness; + half CoatMask; + half CoatSmoothness; + half Anisotropy; + half IridescenceMask; + half IridescenceThickness; + int DiffusionProfileHash; + float SpecularAAThreshold; + float SpecularAAScreenSpaceVariance; + // requires _OVERRIDE_BAKEDGI to be defined, but is mapped in all pipelines + float3 DiffuseGI; + float3 BackDiffuseGI; + float3 SpecularGI; + float ior; + float3 transmittanceColor; + float atDistance; + float transmittanceMask; + // requires _OVERRIDE_SHADOWMASK to be defines + float4 ShadowMask; + + // for decals + float NormalAlpha; + float MAOSAlpha; + + + }; + + // Data the user declares in blackboard blocks + struct Blackboard + { + + float blackboardDummyData; + }; + + // data the user might need, this will grow to be big. But easy to strip + struct ShaderData + { + float4 clipPos; // SV_POSITION + float3 localSpacePosition; + float3 localSpaceNormal; + float3 localSpaceTangent; + + float3 worldSpacePosition; + float3 worldSpaceNormal; + float3 worldSpaceTangent; + float tangentSign; + + float3 worldSpaceViewDir; + float3 tangentSpaceViewDir; + + float4 texcoord0; + float4 texcoord1; + float4 texcoord2; + float4 texcoord3; + + float2 screenUV; + float4 screenPos; + + float4 vertexColor; + bool isFrontFace; + + float4 extraV2F0; + float4 extraV2F1; + float4 extraV2F2; + float4 extraV2F3; + float4 extraV2F4; + float4 extraV2F5; + float4 extraV2F6; + float4 extraV2F7; + + float3x3 TBNMatrix; + Blackboard blackboard; + }; + + struct VertexData + { + #if SHADER_TARGET > 30 + // uint vertexID : SV_VertexID; + #endif + float4 vertex : POSITION; + float3 normal : NORMAL; + float4 tangent : TANGENT; + float4 texcoord0 : TEXCOORD0; + + // optimize out mesh coords when not in use by user or lighting system + #if _URP && (_USINGTEXCOORD1 || _PASSMETA || _PASSFORWARD || _PASSGBUFFER) + float4 texcoord1 : TEXCOORD1; + #endif + + #if _URP && (_USINGTEXCOORD2 || _PASSMETA || ((_PASSFORWARD || _PASSGBUFFER) && defined(DYNAMICLIGHTMAP_ON))) + float4 texcoord2 : TEXCOORD2; + #endif + + #if _STANDARD && (_USINGTEXCOORD1 || (_PASSMETA || ((_PASSFORWARD || _PASSGBUFFER || _PASSFORWARDADD) && LIGHTMAP_ON))) + float4 texcoord1 : TEXCOORD1; + #endif + #if _STANDARD && (_USINGTEXCOORD2 || (_PASSMETA || ((_PASSFORWARD || _PASSGBUFFER) && DYNAMICLIGHTMAP_ON))) + float4 texcoord2 : TEXCOORD2; + #endif + + + #if _HDRP + float4 texcoord1 : TEXCOORD1; + float4 texcoord2 : TEXCOORD2; + #endif + + // #if %TEXCOORD3REQUIREKEY% + float4 texcoord3 : TEXCOORD3; + // #endif + + // #if %VERTEXCOLORREQUIREKEY% + float4 vertexColor : COLOR; + // #endif + + #if _PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR)) + float3 previousPositionOS : TEXCOORD4; // Contain previous transform position (in case of skinning for example) + #if defined (_ADD_PRECOMPUTED_VELOCITY) + float3 precomputedVelocity : TEXCOORD5; // Add Precomputed Velocity (Alembic computes velocities on runtime side). + #endif + #endif + + UNITY_VERTEX_INPUT_INSTANCE_ID + }; + + struct TessVertex + { + float4 vertex : INTERNALTESSPOS; + float3 normal : NORMAL; + float4 tangent : TANGENT; + float4 texcoord0 : TEXCOORD0; + float4 texcoord1 : TEXCOORD1; + float4 texcoord2 : TEXCOORD2; + + // #if %TEXCOORD3REQUIREKEY% + float4 texcoord3 : TEXCOORD3; + // #endif + + // #if %VERTEXCOLORREQUIREKEY% + float4 vertexColor : COLOR; + // #endif + + // #if %EXTRAV2F0REQUIREKEY% + // float4 extraV2F0 : TEXCOORD5; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // float4 extraV2F1 : TEXCOORD6; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // float4 extraV2F2 : TEXCOORD7; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // float4 extraV2F3 : TEXCOORD8; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // float4 extraV2F4 : TEXCOORD9; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // float4 extraV2F5 : TEXCOORD10; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // float4 extraV2F6 : TEXCOORD11; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // float4 extraV2F7 : TEXCOORD12; + // #endif + + #if _PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR)) + float3 previousPositionOS : TEXCOORD13; // Contain previous transform position (in case of skinning for example) + #if defined (_ADD_PRECOMPUTED_VELOCITY) + float3 precomputedVelocity : TEXCOORD14; + #endif + #endif + + UNITY_VERTEX_INPUT_INSTANCE_ID + UNITY_VERTEX_OUTPUT_STEREO + }; + + struct ExtraV2F + { + float4 extraV2F0; + float4 extraV2F1; + float4 extraV2F2; + float4 extraV2F3; + float4 extraV2F4; + float4 extraV2F5; + float4 extraV2F6; + float4 extraV2F7; + Blackboard blackboard; + float4 time; + }; + + + float3 WorldToTangentSpace(ShaderData d, float3 normal) + { + return mul(d.TBNMatrix, normal); + } + + float3 TangentToWorldSpace(ShaderData d, float3 normal) + { + return mul(normal, d.TBNMatrix); + } + + // in this case, make standard more like SRPs, because we can't fix + // unity_WorldToObject in HDRP, since it already does macro-fu there + + #if _STANDARD + float3 TransformWorldToObject(float3 p) { return mul(unity_WorldToObject, float4(p, 1)); }; + float3 TransformObjectToWorld(float3 p) { return mul(unity_ObjectToWorld, float4(p, 1)); }; + float4 TransformWorldToObject(float4 p) { return mul(unity_WorldToObject, p); }; + float4 TransformObjectToWorld(float4 p) { return mul(unity_ObjectToWorld, p); }; + float4x4 GetWorldToObjectMatrix() { return unity_WorldToObject; } + float4x4 GetObjectToWorldMatrix() { return unity_ObjectToWorld; } + #if (defined(SHADER_API_D3D11) || defined(SHADER_API_XBOXONE) || defined(UNITY_COMPILER_HLSLCC) || defined(SHADER_API_PSSL) || (SHADER_TARGET_SURFACE_ANALYSIS && !SHADER_TARGET_SURFACE_ANALYSIS_MOJOSHADER)) + #define UNITY_SAMPLE_TEX2D_LOD(tex,coord, lod) tex.SampleLevel (sampler##tex,coord, lod) + #define UNITY_SAMPLE_TEX2D_SAMPLER_LOD(tex,samplertex,coord, lod) tex.SampleLevel (sampler##samplertex,coord, lod) + #else + #define UNITY_SAMPLE_TEX2D_LOD(tex,coord,lod) tex2D (tex,coord,0,lod) + #define UNITY_SAMPLE_TEX2D_SAMPLER_LOD(tex,samplertex,coord,lod) tex2D (tex,coord,0,lod) + #endif + + #undef GetWorldToObjectMatrix() + + #define GetWorldToObjectMatrix() unity_WorldToObject + + + #endif + + float3 GetCameraWorldPosition() + { + #if _HDRP + return GetCameraRelativePositionWS(_WorldSpaceCameraPos); + #else + return _WorldSpaceCameraPos; + #endif + } + + #if _GRABPASSUSED + #if _STANDARD + TEXTURE2D(%GRABTEXTURE%); + SAMPLER(sampler_%GRABTEXTURE%); + #endif + + half3 GetSceneColor(float2 uv) + { + #if _STANDARD + return SAMPLE_TEXTURE2D(%GRABTEXTURE%, sampler_%GRABTEXTURE%, uv).rgb; + #else + return SHADERGRAPH_SAMPLE_SCENE_COLOR(uv); + #endif + } + #endif + + + + #if _STANDARD + UNITY_DECLARE_DEPTH_TEXTURE(_CameraDepthTexture); + float GetSceneDepth(float2 uv) { return SAMPLE_DEPTH_TEXTURE(_CameraDepthTexture, uv); } + float GetLinear01Depth(float2 uv) { return Linear01Depth(GetSceneDepth(uv)); } + float GetLinearEyeDepth(float2 uv) { return LinearEyeDepth(GetSceneDepth(uv)); } + #else + float GetSceneDepth(float2 uv) { return SHADERGRAPH_SAMPLE_SCENE_DEPTH(uv); } + float GetLinear01Depth(float2 uv) { return Linear01Depth(GetSceneDepth(uv), _ZBufferParams); } + float GetLinearEyeDepth(float2 uv) { return LinearEyeDepth(GetSceneDepth(uv), _ZBufferParams); } + #endif + + float3 GetWorldPositionFromDepthBuffer(float2 uv, float3 worldSpaceViewDir) + { + float eye = GetLinearEyeDepth(uv); + float3 camView = mul((float3x3)GetObjectToWorldMatrix(), transpose(mul(GetWorldToObjectMatrix(), UNITY_MATRIX_I_V)) [2].xyz); + + float dt = dot(worldSpaceViewDir, camView); + float3 div = worldSpaceViewDir/dt; + float3 wpos = (eye * div) + GetCameraWorldPosition(); + return wpos; + } + + #if _HDRP + float3 ObjectToWorldSpacePosition(float3 pos) + { + return GetAbsolutePositionWS(TransformObjectToWorld(pos)); + } + #else + float3 ObjectToWorldSpacePosition(float3 pos) + { + return TransformObjectToWorld(pos); + } + #endif + + #if _STANDARD + UNITY_DECLARE_SCREENSPACE_TEXTURE(_CameraDepthNormalsTexture); + float3 GetSceneNormal(float2 uv, float3 worldSpaceViewDir) + { + float4 depthNorms = UNITY_SAMPLE_SCREENSPACE_TEXTURE(_CameraDepthNormalsTexture, uv); + float3 norms = DecodeViewNormalStereo(depthNorms); + norms = mul((float3x3)GetWorldToViewMatrix(), norms) * 0.5 + 0.5; + return norms; + } + #elif _HDRP && !_DECALSHADER + + float3 GetSceneNormal(float2 uv, float3 worldSpaceViewDir) + { + NormalData nd; + DecodeFromNormalBuffer(_ScreenSize.xy * uv, nd); + return nd.normalWS; + } + #elif _URP + #if (SHADER_LIBRARY_VERSION_MAJOR >= 10) + #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/DeclareNormalsTexture.hlsl" + #endif + + float3 GetSceneNormal(float2 uv, float3 worldSpaceViewDir) + { + #if (SHADER_LIBRARY_VERSION_MAJOR >= 10) + return SampleSceneNormals(uv); + #else + float3 wpos = GetWorldPositionFromDepthBuffer(uv, worldSpaceViewDir); + return normalize(-cross(ddx(wpos), ddy(wpos))) * 0.5 + 0.5; + #endif + + } + #endif + + #if _HDRP + + half3 UnpackNormalmapRGorAG(half4 packednormal) + { + // This do the trick + packednormal.x *= packednormal.w; + + half3 normal; + normal.xy = packednormal.xy * 2 - 1; + normal.z = sqrt(1 - saturate(dot(normal.xy, normal.xy))); + return normal; + } + half3 UnpackNormal(half4 packednormal) + { + #if defined(UNITY_NO_DXT5nm) + return packednormal.xyz * 2 - 1; + #else + return UnpackNormalmapRGorAG(packednormal); + #endif + } + #endif + #if _HDRP || _URP + + half3 UnpackScaleNormal(half4 packednormal, half scale) + { + #ifndef UNITY_NO_DXT5nm + // Unpack normal as DXT5nm (1, y, 1, x) or BC5 (x, y, 0, 1) + // Note neutral texture like "bump" is (0, 0, 1, 1) to work with both plain RGB normal and DXT5nm/BC5 + packednormal.x *= packednormal.w; + #endif + half3 normal; + normal.xy = (packednormal.xy * 2 - 1) * scale; + normal.z = sqrt(1 - saturate(dot(normal.xy, normal.xy))); + return normal; + } + + #endif + + + void GetSun(out float3 lightDir, out float3 color) + { + lightDir = float3(0.5, 0.5, 0); + color = 1; + #if _HDRP + if (_DirectionalLightCount > 0) + { + DirectionalLightData light = _DirectionalLightDatas[0]; + lightDir = -light.forward.xyz; + color = light.color; + } + #elif _STANDARD + lightDir = normalize(_WorldSpaceLightPos0.xyz); + color = _LightColor0.rgb; + #elif _URP + Light light = GetMainLight(); + lightDir = light.direction; + color = light.color; + #endif + } + + + + CBUFFER_START(UnityPerMaterial) + + + half4 _Color; + half4 _MainTex_ST, _MainTex_TexelSize; + half _Alpha, _AlphaCutoffValue; + + #if ATLAS_ON + half _MinXUV, _MaxXUV, _MinYUV, _MaxYUV; + #endif + + #if GLOW_ON + half4 _GlowColor; + half _Glow, _GlowGlobal; + #endif + + #if HSV_ON + half _HsvShift, _HsvSaturation, _HsvBright; + #endif + + #if DISTORT_ON + half4 _DistortTex_ST; + half _DistortTexXSpeed, _DistortTexYSpeed, _DistortAmount; + #endif + + #if FADE_ON + half4 _FadeBurnColor, _FadeTex_ST, _FadeBurnTex_ST; + half _FadeAmount, _FadeBurnWidth, _FadeBurnTransition,_FadeBurnGlow; + #endif + + #if OUTBASE_ON + half4 _OutlineColor; + half _OutlineAlpha, _OutlineGlow, _OutlineWidth; + int _OutlinePixelWidth; + #endif + + #if OUTTEX_ON + half4 _OutlineTex_ST; + half _OutlineTexXSpeed, _OutlineTexYSpeed; + #endif + + #if OUTDIST_ON + half4 _OutlineDistortTex_ST; + half _OutlineDistortTexXSpeed, _OutlineDistortTexYSpeed, _OutlineDistortAmount; + #endif + + #if ALPHAOUTLINE_ON + half _AlphaOutlineGlow, _AlphaOutlinePower, _AlphaOutlineMinAlpha, _AlphaOutlineBlend; + half4 _AlphaOutlineColor; + #endif + + #if INNEROUTLINE_ON + half _InnerOutlineThickness, _InnerOutlineAlpha, _InnerOutlineGlow; + half4 _InnerOutlineColor; + #endif + + #if GRADIENT_ON + half _GradBlend, _GradBoostX, _GradBoostY; + half4 _GradTopRightCol, _GradTopLeftCol, _GradBotRightCol, _GradBotLeftCol; + #endif + + #if COLORSWAP_ON + half4 _ColorSwapRed, _ColorSwapGreen, _ColorSwapBlue; + half _ColorSwapRedLuminosity, _ColorSwapGreenLuminosity, _ColorSwapBlueLuminosity, _ColorSwapBlend; + #endif + + #if CHANGECOLOR_ON + half4 _ColorChangeNewCol, _ColorChangeTarget; + half _ColorChangeTolerance, _ColorChangeLuminosity; + #endif + #if CHANGECOLOR2_ON + half4 _ColorChangeNewCol2, _ColorChangeTarget2; + half _ColorChangeTolerance2; + #endif + #if CHANGECOLOR3_ON + half4 _ColorChangeNewCol3, _ColorChangeTarget3; + half _ColorChangeTolerance3; + #endif + + #if COLORRAMP_ON + half _ColorRampLuminosity, _ColorRampBlend; + #endif + + #if HITEFFECT_ON + half4 _HitEffectColor; + half _HitEffectGlow, _HitEffectBlend; + #endif + + #if NEGATIVE_ON + half _NegativeAmount; + #endif + + #if PIXELATE_ON + half _PixelateSize; + #endif + + #if GREYSCALE_ON + half _GreyscaleLuminosity, _GreyscaleBlend; + half4 _GreyscaleTintColor; + #endif + + #if POSTERIZE_ON + half _PosterizeNumColors, _PosterizeGamma; + #endif + + #if BLUR_ON + half _BlurIntensity; + #endif + + #if MOTIONBLUR_ON + half _MotionBlurAngle, _MotionBlurDist; + #endif + + #if GHOST_ON + half _GhostColorBoost, _GhostTransparency, _GhostBlend; + #endif + + #if HOLOGRAM_ON + half _HologramStripesAmount, _HologramMinAlpha, _HologramUnmodAmount, _HologramStripesSpeed, _HologramMaxAlpha, _HologramBlend; + half4 _HologramStripeColor; + #endif + + #if CHROMABERR_ON + half _ChromAberrAmount, _ChromAberrAlpha; + #endif + + #if GLITCH_ON + half _GlitchAmount, _GlitchSize; + #endif + + #if FLICKER_ON + half _FlickerFreq, _FlickerPercent, _FlickerAlpha; + #endif + + #if SHADOW_ON + half _ShadowX, _ShadowY, _ShadowAlpha; + half4 _ShadowColor; + #endif + + #if SHINE_ON + half4 _ShineColor; + half _ShineLocation, _ShineRotate, _ShineWidth, _ShineGlow; + #endif + + #if CONTRAST_ON + half _Contrast, _Brightness; + #endif + + #if OVERLAY_ON + half4 _OverlayTex_ST, _OverlayColor; + half _OverlayGlow, _OverlayBlend, _OverlayTextureScrollXSpeed, _OverlayTextureScrollYSpeed; + #endif + + #if DOODLE_ON + half _HandDrawnAmount, _HandDrawnSpeed; + #endif + + #if WIND_ON + half _GrassSpeed, _GrassWind, _GrassManualAnim, _GrassRadialBend; + #endif + + #if WAVEUV_ON + float _WaveAmount, _WaveSpeed, _WaveStrength, _WaveX, _WaveY; + #endif + + #if ROUNDWAVEUV_ON + half _RoundWaveStrength, _RoundWaveSpeed; + #endif + + #if RECTSIZE_ON + half _RectSize; + #endif + + #if OFFSETUV_ON + half _OffsetUvX, _OffsetUvY; + #endif + + #if CLIPPING_ON + half _ClipUvLeft, _ClipUvRight, _ClipUvUp, _ClipUvDown; + #endif + + #if RADIALCLIPPING_ON + half _RadialStartAngle, _RadialClip, _RadialClip2; + #endif + + #if TEXTURESCROLL_ON + half _TextureScrollXSpeed, _TextureScrollYSpeed; + #endif + + #if ZOOMUV_ON + half _ZoomUvAmount; + #endif + + #if WARP_ON + half _WarpStrength, _WarpSpeed, _WarpScale; + #endif + + #if TWISTUV_ON + half _TwistUvAmount, _TwistUvPosX, _TwistUvPosY, _TwistUvRadius; + #endif + + #if ROTATEUV_ON + half _RotateUvAmount; + #endif + + #if FISHEYE_ON + half _FishEyeUvAmount; + #endif + + #if PINCH_ON + half _PinchUvAmount; + #endif + + #if SHAKEUV_ON + half _ShakeUvSpeed, _ShakeUvX, _ShakeUvY; + #endif + + #if NORMALMAP_ON + half _NormalStrength; + #endif + + float _RandomSeed; + + + + + CBUFFER_END + + + + + + + + TEXTURE2D(_MainTex); + SAMPLER(sampler_MainTex); + + #if GLOW_ON + TEXTURE2D(_GlowTex); + SAMPLER(sampler_GlowTex); + #endif + + #if FADE_ON + TEXTURE2D(_FadeTex); + SAMPLER(sampler_FadeTex); + + TEXTURE2D(_FadeBurnTex); + SAMPLER(sampler_FadeBurnTex); + #endif + + #if DISTORT_ON + TEXTURE2D(_DistortTex); + SAMPLER(sampler_DistortTex); + #endif + + #if OUTTEX_ON + TEXTURE2D(_OutlineTex); + SAMPLER(sampler_OutlineTex); + #endif + + #if OUTDIST_ON + TEXTURE2D(_OutlineDistortTex); + SAMPLER(sampler_OutlineDistortTex); + #endif + + #if COLORSWAP_ON + TEXTURE2D(_ColorSwapTex); + SAMPLER(sampler_ColorSwapTex); + #endif + + #if COLORRAMP_ON + TEXTURE2D(_ColorRampTex); + TEXTURE2D(_ColorRampTexGradient); + SAMPLER(sampler_ColorRampTex); + SAMPLER(sampler_ColorRampTexGradient); + #endif + + #if SHINE_ON + TEXTURE2D(_ShineMask); + SAMPLER(sampler_ShineMask); + #endif + + #if OVERLAY_ON + TEXTURE2D(_OverlayTex); + SAMPLER(sampler_OverlayTex); + #endif + + #if NORMALMAP_ON + TEXTURE2D(_NormalMap); + SAMPLER(sampler_NormalMap); + #endif + + + half3 GetPixel(in int offsetX, in int offsetY, in half2 uv, in Texture2D _tex, in SamplerState _sampler) + { + half2 _uv = uv + half2(offsetX * _MainTex_TexelSize.x, offsetY * _MainTex_TexelSize.y); + half4 col = SAMPLE_TEXTURE2D(_tex, _sampler, _uv); + return col.rgb; + } + + + //BLURS------------------------------------------------------------------------- + half4 Blur(half2 uv, Texture2D source, SamplerState sampler_source, half Intensity) + { + const half2 texelSize = 1.0 / _ScreenParams.xy; + const half4 color = SAMPLE_TEXTURE2D(source, sampler_source, uv); + const half2 offset = Intensity * texelSize; + + half4 accumulatedColor = color; + half accumulatedWeight = 1.0; + for (int x = -1; x <= 1; x++) + { + for (int y = -1; y <= 1; y++) + { + const half2 sampleUV = uv + half2(x, y) * offset; + const half4 sampleColor = SAMPLE_TEXTURE2D(source, sampler_source, sampleUV); + + accumulatedColor += sampleColor; + accumulatedWeight += 1.0; + } + } + + half4 blurredColor = accumulatedColor / accumulatedWeight; + return blurredColor; + } + + half BlurHD_G(half bhqp, half x) + { + return exp(-(x * x) / (2.0 * bhqp * bhqp)); + } + half4 BlurHD(half2 uv, Texture2D source, SamplerState sampler_source, half BlurAmount, half xScale, half yScale) + { + int iterations = 16; + int halfIterations = iterations / 2; + half sigmaX = 0.1 + BlurAmount * 0.5; + half sigmaY = sigmaX; + half total = 0.0; + half4 ret = half4(0, 0, 0, 0); + for (int iy = 0; iy < iterations; ++iy) + { + half fy = BlurHD_G(sigmaY, half(iy) -half(halfIterations)); + half offsetY = half(iy - halfIterations) * 0.00390625 * xScale; + for (int ix = 0; ix < iterations; ++ix) + { + half fx = BlurHD_G(sigmaX, half(ix) - half(halfIterations)); + half offsetX = half(ix - halfIterations) * 0.00390625 * yScale; + total += fx * fy; + ret += SAMPLE_TEXTURE2D(source, sampler_source, uv + half2(offsetX, offsetY)) * fx * fy; + } + } + return ret / total; + } + //----------------------------------------------------------------------- + + + //------------------------------------------- + half RemapFloat(half inValue, half inMin, half inMax, half outMin, half outMax){ + return outMin + (inValue - inMin) * (outMax - outMin) / (inMax - inMin); + } + //------------------------------------------- + + //----------------------------------------------------------------------- + half rand(half2 seed, half offset) { + return (frac(sin(dot(seed, half2(12.9898, 78.233))) * 43758.5453) + offset) % 1.0; + } + + half rand2(half2 seed, half offset) { + return (frac(sin(dot(seed * floor(50 + (_Time.x % 1.0) * 12.), half2(127.1, 311.7))) * 43758.5453123) + offset) % 1.0; + } + + half rand2CustomTime(half2 seed, half offset, half customTime) { + return (frac(sin(dot(seed * floor(50 + (customTime % 1.0) * 12.), half2(127.1, 311.7))) * 43758.5453123) + offset) % 1.0; + } + //----------------------------------------------------------------------- + + + void Ext_ModifyVertex0 (inout VertexData v, inout ExtraV2F d) + { + //BILBOARD_ON + #if BILBOARD_ON + half3 camRight = mul((half3x3)unity_CameraToWorld, half3(1,0,0)); + half3 camUp = half3(0,1,0); + #if BILBOARDY_ON + camUp = mul((half3x3)unity_CameraToWorld, half3(0,1,0)); + #endif + half3 localPos = v.vertex.x * camRight + v.vertex.y * camUp; + v.vertex = half4(localPos, 1); + #endif + //----------------------------------------------------------- + + v.texcoord0.xy = TRANSFORM_TEX(v.texcoord0.xy, _MainTex); + half2 center = half2(0.5, 0.5); + #if ATLAS_ON + center = half2((_MaxXUV + _MinXUV) / 2.0, (_MaxYUV + _MinYUV) / 2.0); + #endif + + //POLARUV_ON + #if POLARUV_ON + v.texcoord0.xy = v.texcoord0.xy - center; + #endif + + //---------------------------------------- + + //ROTATEUV_ON + #if ROTATEUV_ON + half2 uvC = v.texcoord0.xy; + half cosAngle = cos(_RotateUvAmount); + half sinAngle = sin(_RotateUvAmount); + half2x2 rot = half2x2(cosAngle, -sinAngle, sinAngle, cosAngle); + uvC -= center; + v.texcoord0.xy = mul(rot, uvC); + v.texcoord0.xy += center; + #endif + //-------------------- + + #if RECTSIZE_ON + v.vertex.xyz += (v.vertex.xyz * (_RectSize - 1.0)); + #endif + + #if OUTTEX_ON + v.texcoord1.xy = TRANSFORM_TEX(v.texcoord0.xy, _OutlineTex); + #endif + + #if OUTDIST_ON + v.texcoord2.xy = TRANSFORM_TEX(v.texcoord0.xy, _OutlineDistortTex); + #endif + + #if DISTORT_ON + v.texcoord3.xy = TRANSFORM_TEX(v.texcoord0.xy, _DistortTex); + #endif + } + + void Ext_SurfaceFunction0 (inout Surface o, ShaderData d) + { + half randomSeed = _RandomSeed; + + float2 uvRect = d.texcoord0; + half2 center = half2(0.5, 0.5); + #if ATLAS_ON + center = half2((_MaxXUV + _MinXUV) / 2.0, (_MaxYUV + _MinYUV) / 2.0); + uvRect = half2((d.texcoord0.x - _MinXUV) / (_MaxXUV - _MinXUV), (d.texcoord0.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half2 centerTiled = half2(center.x * _MainTex_ST.x, center.y * _MainTex_ST.y); + + //CLIPPING_ON + #if CLIPPING_ON + half2 tiledUv = half2(d.texcoord0.x / _MainTex_ST.x, d.texcoord0.y / _MainTex_ST.y); + #if ATLAS_ON + tiledUv = half2((tiledUv.x - _MinXUV) / (_MaxXUV - _MinXUV), (tiledUv.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + clip((1 - _ClipUvUp) - tiledUv.y); + clip(tiledUv.y - _ClipUvDown); + clip((1 - _ClipUvRight) - tiledUv.x); + clip(tiledUv.x - _ClipUvLeft); + #endif + //---------------------------------- + + //RADIALCLIPPING_ON + #if RADIALCLIPPING_ON + half2 tiledUv2 = half2(d.texcoord0.x / _MainTex_ST.x, d.texcoord0.y / _MainTex_ST.y); + #if ATLAS_ON + tiledUv2 = half2((tiledUv2.x - _MinXUV) / (_MaxXUV - _MinXUV), (tiledUv2.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half startAngle = _RadialStartAngle - _RadialClip; + half endAngle = _RadialStartAngle + _RadialClip2; + half offset0 = clamp(0, 360, startAngle + 360); + half offset360 = clamp(0, 360, endAngle - 360); + half2 atan2Coord = half2(lerp(-1, 1, tiledUv2.x), lerp(-1, 1, tiledUv2.y)); + half atanAngle = atan2(atan2Coord.y, atan2Coord.x) * 57.3; // angle in degrees + if(atanAngle < 0) atanAngle = 360 + atanAngle; + if(atanAngle >= startAngle && atanAngle <= endAngle) discard; + if(atanAngle <= offset360) discard; + if(atanAngle >= offset0) discard; + #endif + + //----------------------------- + + //TEXTURESCROLL_ON && ATLAS_ON + #if TEXTURESCROLL_ON && ATLAS_ON + d.texcoord0.xy = half2(_MinXUV + ((_MaxXUV - _MinXUV) * (abs(((_Time.y + randomSeed) * _TextureScrollXSpeed) + uvRect.x) % 1)), + _MinYUV + ((_MaxYUV - _MinYUV) * (abs(((_Time.y + randomSeed) * _TextureScrollYSpeed) + uvRect.y) % 1))); + #endif + //---------------------------- + + //OFFSETUV_ON + #if OFFSETUV_ON + #if ATLAS_ON + d.texcoord0.xy = half2(_MinXUV + ((_MaxXUV - _MinXUV) * (abs((_OffsetUvX + uvRect.x) % 1))), + _MinYUV + ((_MaxYUV - _MinYUV) * (abs(_OffsetUvY + uvRect.y) % 1))); + #else + d.texcoord0.xy += half2(_OffsetUvX, _OffsetUvY); + #endif + #endif + + //---------------------- + + //POLARUV_ON + #if POLARUV_ON + d.texcoord0.xy = half2(atan2(d.texcoord0.y, d.texcoord0.x) / (2.0f * 3.141592653589f), length(d.texcoord0.xy)); + d.texcoord0.xy *= _MainTex_ST.xy; + #endif + + //-------------------------------------- + + //TWISTUV_ON + #if TWISTUV_ON + #if ATLAS_ON + _TwistUvPosX = ((_MaxXUV - _MinXUV) * _TwistUvPosX) + _MinXUV; + _TwistUvPosY = ((_MaxYUV - _MinYUV) * _TwistUvPosY) + _MinYUV; + #endif + half2 tempUv = d.texcoord0.xy - half2(_TwistUvPosX * _MainTex_ST.x, _TwistUvPosY * _MainTex_ST.y); + _TwistUvRadius *= (_MainTex_ST.x + _MainTex_ST.y) / 2; + half percent = (_TwistUvRadius - length(tempUv)) / _TwistUvRadius; + half theta = percent * percent * (2.0 * sin(_TwistUvAmount)) * 8.0; + half s = sin(theta); + half c = cos(theta); + half beta = max(sign(_TwistUvRadius - length(tempUv)), 0.0); + tempUv = half2(dot(tempUv, half2(c, -s)), dot(tempUv, half2(s, c))) * beta + tempUv * (1 - beta); + tempUv += half2(_TwistUvPosX * _MainTex_ST.x, _TwistUvPosY * _MainTex_ST.y); + d.texcoord0.xy = tempUv; + #endif + + //-------------------------------------------- + + //FISHEYE_ON + #if FISHEYE_ON + half bind = length(centerTiled); + half2 dF = d.texcoord0.xy - centerTiled; + half dFlen = length(dF); + half fishInt = (3.14159265359 / bind) * (_FishEyeUvAmount + 0.001); + d.texcoord0.xy = centerTiled + (dF / (max(0.0001, dFlen))) * tan(dFlen * fishInt) * bind / tan(bind * fishInt); + #endif + //--------------------------------------------- + + //PINCH_ON + #if PINCH_ON + half2 dP = d.texcoord0.xy - centerTiled; + half pinchInt = (3.141592 / length(centerTiled)) * (-_PinchUvAmount + 0.001); + d.texcoord0.xy = centerTiled + normalize(dP) * atan(length(dP) * -pinchInt * 10.0) * 0.5 / atan(-pinchInt * 5); + #endif + + //--------------------------------------------- + + //ZOOMUV_ON + #if ZOOMUV_ON + d.texcoord0.xy -= centerTiled; + d.texcoord0.xy = d.texcoord0.xy * _ZoomUvAmount; + d.texcoord0.xy += centerTiled; + #endif + + //----------------------------------------------- + + //DOODLE_ON + #if DOODLE_ON + half2 uvCopy = uvRect; + _HandDrawnSpeed = (floor((_Time.x + randomSeed) * 20 * _HandDrawnSpeed) / _HandDrawnSpeed) * _HandDrawnSpeed; + uvCopy.x = sin((uvCopy.x * _HandDrawnAmount + _HandDrawnSpeed) * 4); + uvCopy.y = cos((uvCopy.y * _HandDrawnAmount + _HandDrawnSpeed) * 4); + d.texcoord0.xy = lerp(d.texcoord0.xy, d.texcoord0.xy + uvCopy, 0.0005 * _HandDrawnAmount); + #endif + + //-------------------------- + + //SHAKEUV_ON + #if SHAKEUV_ON + half xShake = sin((_Time.x + randomSeed) * _ShakeUvSpeed * 50) * _ShakeUvX; + half yShake = cos((_Time.x + randomSeed) * _ShakeUvSpeed * 50) * _ShakeUvY; + d.texcoord0.xy += half2(xShake * 0.012, yShake * 0.01); + #endif + + //------------------------------------------- + + //RECTSIZE_ON + #if RECTSIZE_ON + d.texcoord0.xy = d.texcoord0.xy * (_RectSize).xx + (((-_RectSize * 0.5) + 0.5)).xx; + #endif + + //------------------------------------------- + + //DISTORT_ON + #if DISTORT_ON + #if ATLAS_ON + d.texcoord3.x = d.texcoord3.x * (1 / (_MaxXUV - _MinXUV)); + d.texcoord3.y = d.texcoord3.y * (1 / (_MaxYUV - _MinYUV)); + #endif + + d.texcoord3.x += ((_Time.x + _RandomSeed) * _DistortTexXSpeed) % 1; + d.texcoord3.y += ((_Time.x + _RandomSeed) * _DistortTexYSpeed) % 1; + half distortAmnt = (SAMPLE_TEXTURE2D(_DistortTex, sampler_DistortTex, d.texcoord3.xy).r - 0.5) * 0.2 * _DistortAmount; + d.texcoord0.x += distortAmnt; + d.texcoord0.y += distortAmnt; + #endif + //------------------------------------------------------- + + //WARP_ON + #if WARP_ON + half2 warpUv = half2(d.texcoord0.x / _MainTex_ST.x, d.texcoord0.y / _MainTex_ST.y); + #if ATLAS_ON + warpUv = half2((warpUv.x - _MinXUV) / (_MaxXUV - _MinXUV), (warpUv.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + const float tau = 6.283185307179586; + float xWarp = (_Time.y + randomSeed) * _WarpSpeed + warpUv.x * tau / _WarpScale; + float yWarp = (_Time.y + randomSeed) * _WarpSpeed + warpUv.y * tau / _WarpScale; + float2 warp = float2(sin(xWarp), sin(yWarp)) * _WarpStrength; + d.texcoord0.xy += warp; + #endif + + //------------------------------------------------------- + + //WAVEUV_ON + #if WAVEUV_ON + float2 uvWave = half2(_WaveX * _MainTex_ST.x, _WaveY * _MainTex_ST.y) - d.texcoord0.xy; + uvWave %= 1; + #if ATLAS_ON + uvWave = half2(_WaveX, _WaveY) - uvRect; + #endif + uvWave.x *= _ScreenParams.x / _ScreenParams.y; + float waveTime = _Time.y + randomSeed; + float angWave = (sqrt(dot(uvWave, uvWave)) * _WaveAmount) - ((waveTime * _WaveSpeed)); + d.texcoord0.xy = d.texcoord0.xy + uvWave * sin(angWave) * (_WaveStrength / 1000.0); + #endif + //---------------------------------------------------- + + //ROUNDWAVEUV_ON + #if ROUNDWAVEUV_ON + half xWave = ((0.5 * _MainTex_ST.x) - uvRect.x); + half yWave = ((0.5 * _MainTex_ST.y) - uvRect.y) * (_MainTex_TexelSize.w / _MainTex_TexelSize.z); + half ripple = -sqrt(xWave*xWave + yWave* yWave); + d.texcoord0.xy += (sin((ripple + (_Time.y + randomSeed) * (_RoundWaveSpeed/10.0)) / 0.015) * (_RoundWaveStrength/10.0)) % 1; + #endif + //---------------------------------------------------- + + + //WIND_ON + #if WIND_ON + half windOffset = sin((_Time.x + randomSeed) * _GrassSpeed * 10); + half2 windCenter = half2(0.5, 0.1); + #if ATLAS_ON + windCenter.x = ((_MaxXUV - _MinXUV) * windCenter.x) + _MinXUV; + windCenter.y = ((_MaxYUV - _MinYUV) * windCenter.y) + _MinYUV; + #endif + #if !MANUALWIND_ON + d.texcoord0.x = fmod(abs(lerp(d.texcoord0.x, d.texcoord0.x + (_GrassWind * 0.01 * windOffset), uvRect.y)), 1); + #else + d.texcoord0.x = fmod(abs(lerp(d.texcoord0.x, d.texcoord0.x + (_GrassWind * 0.01 * _GrassManualAnim), uvRect.y)), 1); + windOffset = _GrassManualAnim; + #endif + half2 delta = d.texcoord0.xy - windCenter; + half delta2 = dot(delta.xy, delta.xy); + half2 delta_offset = delta2 * windOffset; + d.texcoord0.xy = d.texcoord0.xy + half2(delta.y, -delta.x) * delta_offset * _GrassRadialBend; + #endif + + //-------------------------------------------------------- + + //TEXTURESCROLL_ON && !ATLAS_ON + #if TEXTURESCROLL_ON && !ATLAS_ON + d.texcoord0.x += ((_Time.y + randomSeed) * _TextureScrollXSpeed) % 1; + d.texcoord0.y += ((_Time.y + randomSeed) * _TextureScrollYSpeed) % 1; + #endif + //------------------------------ + + //PIXELATE_ON + #if PIXELATE_ON + half aspectRatio = _MainTex_TexelSize.x / _MainTex_TexelSize.y; + half2 pixelSize = float2(_PixelateSize, _PixelateSize * aspectRatio); + d.texcoord0.xy = floor(d.texcoord0.xy * pixelSize) / pixelSize; + #endif + //-------------- + + half4 col = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy); + half originalAlpha = col.a; + col *= d.vertexColor; + + //NORMAL MAP + #if NORMALMAP_ON + half4 normalSample = SAMPLE_TEXTURE2D(_NormalMap, sampler_NormalMap, d.texcoord0.xy); + half3 normalTS = UnpackNormal(normalSample); + normalTS.xy *= _NormalStrength; + o.Normal = normalTS; + #endif + + + //GLITCH_ON + #if GLITCH_ON + half2 uvGlitch = uvRect; + uvGlitch.y -= 0.5; + half lineNoise = pow(rand2(floor(uvGlitch * half2(24., 19.) * _GlitchSize) * 4.0, randomSeed), 3.0) * _GlitchAmount + * pow(rand2(floor(uvGlitch * half2(38., 14.) * _GlitchSize) * 4.0, randomSeed), 3.0); + col = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(lineNoise * 0.02 * rand2(half2(2.0, 1), randomSeed), 0)) * d.vertexColor; + #endif + //-------------------------------------- + + //CHROMABERR_ON + #if CHROMABERR_ON + half4 r = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(_ChromAberrAmount/10, 0)) * d.vertexColor; + half4 b = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(-_ChromAberrAmount/10, 0)) * d.vertexColor; + col = half4(r.r * r.a, col.g, b.b * b.a, max(max(r.a, b.a) * _ChromAberrAlpha, col.a)); + #endif + + //-------------------------------- + + //BLUR_ON + #if BLUR_ON + #if ATLAS_ON + #if !BLURISHD_ON + col = BlurHD(d.texcoord0.xy, _MainTex, sampler_MainTex, _BlurIntensity, (_MaxXUV - _MinXUV), (_MaxYUV - _MinYUV)) * d.vertexColor; + #else + col = Blur(d.texcoord0.xy, _MainTex, sampler_MainTex, _BlurIntensity * (_MaxXUV - _MinXUV)) * d.vertexColor; + #endif + #else + #if !BLURISHD_ON + col = BlurHD(d.texcoord0.xy, _MainTex, sampler_MainTex, _BlurIntensity, 1, 1) * d.vertexColor; + #else + col = Blur(d.texcoord0.xy, _MainTex, sampler_MainTex, _BlurIntensity) * d.vertexColor; + #endif + #endif + #endif + + //-------------------- + + //MOTIONBLUR_ON + #if MOTIONBLUR_ON + _MotionBlurAngle = _MotionBlurAngle * 3.1415926; + #define rot(n) mul(n, half2x2(cos(_MotionBlurAngle), -sin(_MotionBlurAngle), sin(_MotionBlurAngle), cos(_MotionBlurAngle))) + _MotionBlurDist = _MotionBlurDist * 0.005; + #if ATLAS_ON + _MotionBlurDist *= (_MaxXUV - _MinXUV); + #endif + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(-_MotionBlurDist, -_MotionBlurDist))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(-_MotionBlurDist * 2, -_MotionBlurDist * 2))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(-_MotionBlurDist * 3, -_MotionBlurDist * 3))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(-_MotionBlurDist * 4, -_MotionBlurDist * 4))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(_MotionBlurDist, _MotionBlurDist))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(_MotionBlurDist * 2, _MotionBlurDist * 2))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(_MotionBlurDist * 3, _MotionBlurDist * 3))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(_MotionBlurDist * 4, _MotionBlurDist * 4))); + col.rgb = col.rgb / 9; + #endif + //------------------------------------ + + //NEGATIVE_ON + #if NEGATIVE_ON + col.rgb = lerp(col.rgb, 1 - col.rgb, _NegativeAmount); + #endif + + //-------------- + half luminance = 0; + + //GREYSCALE_ON && !GREYSCALEOUTLINE_ON + #if GREYSCALE_ON && !GREYSCALEOUTLINE_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + luminance = saturate(luminance + _GreyscaleLuminosity); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _GreyscaleTintColor, _GreyscaleBlend); + #endif + //------------------------------------ + + //GHOST_ON + #if GHOST_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + half4 ghostResult; + ghostResult.a = saturate(luminance - _GhostTransparency) * col.a; + ghostResult.rgb = col.rgb * (luminance + _GhostColorBoost); + col = lerp(col, ghostResult, _GhostBlend); + #endif + //------------------------------------ + + //INNEROUTLINE_ON + #if INNEROUTLINE_ON + half3 innerT = abs(GetPixel(0, _InnerOutlineThickness, d.texcoord0.xy, _MainTex, sampler_MainTex) - GetPixel(0, -_InnerOutlineThickness, d.texcoord0.xy, _MainTex, sampler_MainTex)); + innerT += abs(GetPixel(_InnerOutlineThickness, 0, d.texcoord0.xy, _MainTex, sampler_MainTex) - GetPixel(-_InnerOutlineThickness, 0, d.texcoord0.xy, _MainTex, sampler_MainTex)); + #if !ONLYINNEROUTLINE_ON + innerT = (innerT / 2.0) * col.a * _InnerOutlineAlpha; + col.rgb += length(innerT) * _InnerOutlineColor.rgb * _InnerOutlineGlow; + #else + innerT *= col.a * _InnerOutlineAlpha; + col.rgb = length(innerT) * _InnerOutlineColor.rgb * _InnerOutlineGlow; + col.a = step(0.3, col.r+col.g+col.b); + #endif + #endif + //------------------------------------------------------- + + //HITEFFECT_ON + #if HITEFFECT_ON + col.rgb = lerp(col.rgb, _HitEffectColor.rgb * _HitEffectGlow, _HitEffectBlend); + #endif + //-------------------- + + //GRADIENT_ON + #if GRADIENT_ON + half2 tiledUvGrad = half2(uvRect.x / _MainTex_ST.x, uvRect.y / _MainTex_ST.y); + #if GRADIENT2COL_ON + _GradTopRightCol = _GradTopLeftCol; + _GradBotRightCol = _GradBotLeftCol; + #endif + #if RADIALGRADIENT_ON + half radialDist = 1 - length(tiledUvGrad - half2(0.5, 0.5)); + radialDist *= (_MainTex_TexelSize.w / _MainTex_TexelSize.z); + radialDist = saturate(_GradBoostX * radialDist); + half4 gradientResult = lerp(_GradTopLeftCol, _GradBotLeftCol, radialDist); + #else + half gradXLerpFactor = saturate(pow(tiledUvGrad.x, _GradBoostX)); + half4 gradientResult = lerp(lerp(_GradBotLeftCol, _GradBotRightCol, gradXLerpFactor), + lerp(_GradTopLeftCol, _GradTopRightCol, gradXLerpFactor), saturate(pow(tiledUvGrad.y, _GradBoostY))); + #endif + gradientResult = lerp(col, gradientResult, _GradBlend); + col.rgb = gradientResult.rgb * col.a; + col.a *= gradientResult.a; + #endif + //-------------------------------------------------------------------- + + //CONTRAST_ON + #if CONTRAST_ON + col.rgb = (col.rgb - float3(0.5, 0.5, 0.5)) * _Contrast + float3(0.5, 0.5, 0.5); + col.rgb += _Brightness; + #endif + + //------------------------------------------------------------------- + + //COLORSWAP_ON + #if COLORSWAP_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + half4 swapMask = SAMPLE_TEXTURE2D(_ColorSwapTex, sampler_ColorSwapTex, d.texcoord0.xy); + swapMask.rgb *= swapMask.a; + half3 redSwap = _ColorSwapRed * swapMask.r * saturate(luminance + _ColorSwapRedLuminosity); + half3 greenSwap = _ColorSwapGreen * swapMask.g * saturate(luminance + _ColorSwapGreenLuminosity); + half3 blueSwap = _ColorSwapBlue * swapMask.b * saturate(luminance + _ColorSwapBlueLuminosity); + swapMask.rgb = col.rgb * saturate(1 - swapMask.r - swapMask.g - swapMask.b); + col.rgb = lerp(col.rgb, swapMask.rgb + redSwap + greenSwap + blueSwap, _ColorSwapBlend); + #endif + //-------------------------------------------------------------------- + + //COLORRAMP_ON && !COLORRAMPOUTLINE_ON + #if COLORRAMP_ON && !COLORRAMPOUTLINE_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + luminance = saturate(luminance + _ColorRampLuminosity); + #if GRADIENTCOLORRAMP_ON + col.rgb = lerp(col.rgb, SAMPLE_TEXTURE2D(_ColorRampTexGradient, sampler_ColorRampTexGradient, half2(luminance, 0)).rgb, _ColorRampBlend); + #else + col.rgb = lerp(col.rgb, SAMPLE_TEXTURE2D(_ColorRampTex, sampler_ColorRampTex, half2(luminance, 0)).rgb, _ColorRampBlend); + #endif + #endif + //-------------------------------------------------------------------- + + //CHANGECOLOR_ON + #if CHANGECOLOR_ON + float3 currChangeColor = saturate(col.rgb); + luminance = 0.3 * currChangeColor.r + 0.59 * currChangeColor.g + 0.11 * currChangeColor.b; + luminance = saturate(luminance + _ColorChangeLuminosity); + half3 dif = abs(currChangeColor - _ColorChangeTarget.rgb); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _ColorChangeNewCol.rgb, + max(sign(1 - saturate(dif.x + dif.y + dif.z) - _ColorChangeTolerance), 0.0)); + #if CHANGECOLOR2_ON + dif = abs(currChangeColor - _ColorChangeTarget2.rgb); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _ColorChangeNewCol2.rgb, + max(sign(1 - saturate(dif.x + dif.y + dif.z) - _ColorChangeTolerance2), 0.0)); + #endif + #if CHANGECOLOR3_ON + dif = abs(currChangeColor - _ColorChangeTarget3.rgb); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _ColorChangeNewCol3.rgb, + max(sign(1 - saturate(dif.x + dif.y + dif.z) - _ColorChangeTolerance3), 0.0)); + #endif + #endif + //------------------------------------------------------- + + //POSTERIZE_ON && !POSTERIZEOUTLINE_ON + #if POSTERIZE_ON && !POSTERIZEOUTLINE_ON + col.rgb = pow(col.rgb, _PosterizeGamma) * _PosterizeNumColors; + col.rgb = floor(col.rgb) / _PosterizeNumColors; + col.rgb = pow(col.rgb, 1.0 / _PosterizeGamma); + #endif + //------------------------------------ + + //HSV_ON + #if HSV_ON + half3 resultHsv = half3(col.rgb); + half cosHsv = _HsvBright * _HsvSaturation * cos(_HsvShift * 3.14159265 / 180); + half sinHsv = _HsvBright * _HsvSaturation * sin(_HsvShift * 3.14159265 / 180); + resultHsv.x = (.299 * _HsvBright + .701 * cosHsv + .168 * sinHsv) * col.x + + (.587 * _HsvBright - .587 * cosHsv + .330 * sinHsv) * col.y + + (.114 * _HsvBright - .114 * cosHsv - .497 * sinHsv) * col.z; + resultHsv.y = (.299 * _HsvBright - .299 * cosHsv - .328 * sinHsv) *col.x + + (.587 * _HsvBright + .413 * cosHsv + .035 * sinHsv) * col.y + + (.114 * _HsvBright - .114 * cosHsv + .292 * sinHsv) * col.z; + resultHsv.z = (.299 * _HsvBright - .3 * cosHsv + 1.25 * sinHsv) * col.x + + (.587 * _HsvBright - .588 * cosHsv - 1.05 * sinHsv) * col.y + + (.114 * _HsvBright + .886 * cosHsv - .203 * sinHsv) * col.z; + col.rgb = resultHsv; + #endif + //------------------------------------------------------- + + //OVERLAY_ON + #if OVERLAY_ON + half2 overlayUvs = d.texcoord0.xy; + overlayUvs.x += ((_Time.y + randomSeed) * _OverlayTextureScrollXSpeed) % 1; + overlayUvs.y += ((_Time.y + randomSeed) * _OverlayTextureScrollYSpeed) % 1; + half4 overlayCol = SAMPLE_TEXTURE2D(_OverlayTex, sampler_OverlayTex, TRANSFORM_TEX(overlayUvs, _OverlayTex)); + overlayCol.rgb *= _OverlayColor.rgb * _OverlayGlow; + #if !OVERLAYMULT_ON + overlayCol.rgb *= overlayCol.a * _OverlayColor.rgb * _OverlayColor.a * _OverlayBlend; + col.rgb += overlayCol.rgb; + #else + overlayCol.a *= _OverlayColor.a; + col = lerp(col, col * overlayCol, _OverlayBlend); + #endif + #endif + + //--------------------------------- + + //OUTBASE_ON + #if OUTBASE_ON + #if OUTBASEPIXELPERF_ON + half2 destUv = half2(_OutlinePixelWidth * _MainTex_TexelSize.x, _OutlinePixelWidth * _MainTex_TexelSize.y); + #else + half2 destUv = half2(_OutlineWidth * _MainTex_TexelSize.x * 200, _OutlineWidth * _MainTex_TexelSize.y * 200); + #endif + + #if OUTDIST_ON + d.texcoord3.x += ((_Time.x + _RandomSeed) * _OutlineDistortTexXSpeed) % 1; + d.texcoord3.y += ((_Time.x + _RandomSeed) * _OutlineDistortTexYSpeed) % 1; + #if ATLAS_ON + d.texcoord3 = half2((d.texcoord3.x - _MinXUV) / (_MaxXUV - _MinXUV), (d.texcoord3.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half outDistortAmnt = (SAMPLE_TEXTURE2D(_OutlineDistortTex, sampler_OutlineDistortTex, d.texcoord3).r - 0.5) * 0.2 * _OutlineDistortAmount; + destUv.x += outDistortAmnt; + destUv.y += outDistortAmnt; + #endif + + half spriteLeft = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(destUv.x, 0)).a; + half spriteRight = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy - half2(destUv.x, 0)).a; + half spriteBottom = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(0, destUv.y)).a; + half spriteTop = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy - half2(0, destUv.y)).a; + half result = spriteLeft + spriteRight + spriteBottom + spriteTop; + + #if OUTBASE8DIR_ON + half spriteTopLeft = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(destUv.x, destUv.y)).a; + half spriteTopRight = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(-destUv.x, destUv.y)).a; + half spriteBotLeft = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(destUv.x, -destUv.y)).a; + half spriteBotRight = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(-destUv.x, -destUv.y)).a; + result = result + spriteTopLeft + spriteTopRight + spriteBotLeft + spriteBotRight; + #endif + + result = step(0.05, saturate(result)); + + #if OUTTEX_ON + d.texcoord1.x += ((_Time.x + _RandomSeed) * _OutlineTexXSpeed) % 1; + d.texcoord1.y += ((_Time.x + _RandomSeed) * _OutlineTexYSpeed) % 1; + #if ATLAS_ON + d.texcoord1 = half2((d.texcoord1.x - _MinXUV) / (_MaxXUV - _MinXUV), (d.texcoord1.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half4 tempOutColor = SAMPLE_TEXTURE2D(_OutlineTex, sampler_OutlineTex, d.texcoord1); + tempOutColor *= _OutlineColor; + _OutlineColor = tempOutColor; + #endif + + result *= (1 - originalAlpha) * _OutlineAlpha; + + half4 outline = _OutlineColor * d.vertexColor.a; + outline.rgb *= _OutlineGlow; + outline.a = result; + #if ONLYOUTLINE_ON + col = outline; + #else + col = lerp(col, outline, result); + #endif + #endif + //------------------------------------------------------- + + //FADE_ON + #if FADE_ON + half2 tiledUvFade1 = TRANSFORM_TEX(d.texcoord0, _FadeTex); + half2 tiledUvFade2 = TRANSFORM_TEX(d.texcoord0, _FadeBurnTex); + #if ATLAS_ON + tiledUvFade1 = half2((tiledUvFade1.x - _MinXUV) / (_MaxXUV - _MinXUV), (tiledUvFade1.y - _MinYUV) / (_MaxYUV - _MinYUV)); + tiledUvFade2 = half2((tiledUvFade2.x - _MinXUV) / (_MaxXUV - _MinXUV), (tiledUvFade2.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half fadeTemp = SAMPLE_TEXTURE2D(_FadeTex, sampler_FadeTex, tiledUvFade1).r; + half fade = smoothstep(_FadeAmount, _FadeAmount + _FadeBurnTransition, fadeTemp); + half fadeBurn = saturate(smoothstep(_FadeAmount - _FadeBurnWidth, _FadeAmount - _FadeBurnWidth + 0.1, fadeTemp) * _FadeAmount); + col.a *= fade; + _FadeBurnColor.rgb *= _FadeBurnGlow; + col += fadeBurn * SAMPLE_TEXTURE2D(_FadeBurnTex, sampler_FadeBurnTex, tiledUvFade2) * _FadeBurnColor * originalAlpha * (1 - col.a); + #endif + //------------------------------------------------------- + + //SHADOW_ON + #if SHADOW_ON + half shadowA = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(_ShadowX, _ShadowY)).a; + half preMultShadowMask = 1 - (saturate(shadowA - col.a) * (1 - col.a)); + col.rgb *= 1 - ((shadowA - col.a) * (1 - col.a)); + col.rgb += (_ShadowColor * shadowA) * (1 - col.a); + col.a = max(shadowA * _ShadowAlpha * d.vertexColor.a, col.a); + #endif + + //------------------------------------------------------- + + //GLOW_ON + #if GLOW_ON + half4 emission; + #if GLOWTEX_ON + emission = SAMPLE_TEXTURE2D(_GlowTex, sampler_GlowTex, d.texcoord0); + #else + emission = col; + #endif + + col.rgb *= _GlowGlobal; + emission.rgb *= emission.a * col.a * _Glow * _GlowColor; + col.rgb += emission.rgb; + #endif + //------------------------------------------------------- + + //COLORRAMP_ON && COLORRAMPOUTLINE_ON + #if COLORRAMP_ON && COLORRAMPOUTLINE_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + luminance = saturate(luminance + _ColorRampLuminosity); + #if GRADIENTCOLORRAMP_ON + col.rgb = lerp(col.rgb, SAMPLE_TEXTURE2D(_ColorRampTexGradient, sampler_ColorRampTexGradient, half2(luminance, 0)).rgb, _ColorRampBlend); + #else + col.rgb = lerp(col.rgb, SAMPLE_TEXTURE2D(_ColorRampTex, sampler_ColorRampTex, half2(luminance, 0)).rgb, _ColorRampBlend); + #endif + #endif + //--------------- + + //GREYSCALE_ON && GREYSCALEOUTLINE_ON + #if GREYSCALE_ON && GREYSCALEOUTLINE_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + luminance = saturate(luminance + _GreyscaleLuminosity); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _GreyscaleTintColor, _GreyscaleBlend); + #endif + + //----------------------------------- + + //POSTERIZE_ON && POSTERIZEOUTLINE_ON + #if POSTERIZE_ON && POSTERIZEOUTLINE_ON + col.rgb = pow(col.rgb, _PosterizeGamma) * _PosterizeNumColors; + col.rgb = floor(col.rgb) / _PosterizeNumColors; + col.rgb = pow(col.rgb, 1.0 / _PosterizeGamma); + #endif + + //----------------------------------- + + //SHINE_ON + #if SHINE_ON + half2 uvShine = uvRect; + half cosAngle = cos(_ShineRotate); + half sinAngle = sin(_ShineRotate); + half2x2 rot = half2x2(cosAngle, -sinAngle, sinAngle, cosAngle); + uvShine -= half2(0.5, 0.5); + uvShine = mul(rot, uvShine); + uvShine += half2(0.5, 0.5); + half shineMask = SAMPLE_TEXTURE2D(_ShineMask, sampler_ShineMask, d.texcoord0.xy).a; + half currentDistanceProjection = (uvShine.x + uvShine.y) / 2; + half whitePower = 1 - (abs(currentDistanceProjection - _ShineLocation) / _ShineWidth); + col.rgb += col.a * whitePower * _ShineGlow * max(sign(currentDistanceProjection - (_ShineLocation - _ShineWidth)), 0.0) + * max(sign((_ShineLocation + _ShineWidth) - currentDistanceProjection), 0.0) * _ShineColor * shineMask; + #endif + + //----------------------------------- + + //HOLOGRAM_ON + #if HOLOGRAM_ON + half totalHologram = _HologramStripesAmount + _HologramUnmodAmount; + half hologramYCoord = ((uvRect.y + (((_Time.x + randomSeed) % 1) * _HologramStripesSpeed)) % totalHologram) / totalHologram; + hologramYCoord = abs(hologramYCoord); + half alpha = RemapFloat(saturate(hologramYCoord - (_HologramUnmodAmount/totalHologram)), 0.0, 1.0, _HologramMinAlpha, saturate(_HologramMaxAlpha)); + half hologramMask = max(sign((_HologramUnmodAmount/totalHologram) - hologramYCoord), 0.0); + half4 hologramResult = col; + hologramResult.a *= lerp(alpha, 1, hologramMask); + hologramResult.rgb *= max(1, _HologramMaxAlpha * max(sign(hologramYCoord - (_HologramUnmodAmount/totalHologram)), 0.0)); + hologramMask = 1 - step(0.01,hologramMask); + hologramResult.rgb += hologramMask * _HologramStripeColor * col.a; + col = lerp(col, hologramResult, _HologramBlend); + #endif + + //----------------------------------- + + //FLICKER_ON + #if FLICKER_ON + col.a *= saturate(col.a * step(frac(0.05 + (_Time.w + randomSeed) * _FlickerFreq), 1 - _FlickerPercent) + _FlickerAlpha); + #endif + //----------------------------------- + + //ALPHACUTOFF_ON + + //ALPHAROUND_ON + + //ALPHAOUTLINE_ON + #if ALPHAOUTLINE_ON + half alphaOutlineRes = pow(1 - col.a, max(_AlphaOutlinePower, 0.0001)) * step(_AlphaOutlineMinAlpha, col.a) * _AlphaOutlineBlend; + col.rgb = lerp(col.rgb, _AlphaOutlineColor.rgb * _AlphaOutlineGlow, alphaOutlineRes); + col.a = lerp(col.a, 1, alphaOutlineRes > 1); + #endif + //------------------------------------------------------- + + //FOG_ON + + //------------------ + + col *= _Color; + o.Albedo = col; + col.a *= _Alpha; + clip(col.a - _AlphaCutoffValue - 0.01); + o.Alpha = _Color.a; + } + + + + + + void ChainSurfaceFunction(inout Surface l, inout ShaderData d) + { + Ext_SurfaceFunction0(l, d); + // Ext_SurfaceFunction1(l, d); + // Ext_SurfaceFunction2(l, d); + // Ext_SurfaceFunction3(l, d); + // Ext_SurfaceFunction4(l, d); + // Ext_SurfaceFunction5(l, d); + // Ext_SurfaceFunction6(l, d); + // Ext_SurfaceFunction7(l, d); + // Ext_SurfaceFunction8(l, d); + // Ext_SurfaceFunction9(l, d); + // Ext_SurfaceFunction10(l, d); + // Ext_SurfaceFunction11(l, d); + // Ext_SurfaceFunction12(l, d); + // Ext_SurfaceFunction13(l, d); + // Ext_SurfaceFunction14(l, d); + // Ext_SurfaceFunction15(l, d); + // Ext_SurfaceFunction16(l, d); + // Ext_SurfaceFunction17(l, d); + // Ext_SurfaceFunction18(l, d); + // Ext_SurfaceFunction19(l, d); + // Ext_SurfaceFunction20(l, d); + // Ext_SurfaceFunction21(l, d); + // Ext_SurfaceFunction22(l, d); + // Ext_SurfaceFunction23(l, d); + // Ext_SurfaceFunction24(l, d); + // Ext_SurfaceFunction25(l, d); + // Ext_SurfaceFunction26(l, d); + // Ext_SurfaceFunction27(l, d); + // Ext_SurfaceFunction28(l, d); + // Ext_SurfaceFunction29(l, d); + } + +#if !_DECALSHADER + + void ChainModifyVertex(inout VertexData v, inout VertexToPixel v2p, float4 time) + { + ExtraV2F d; + + ZERO_INITIALIZE(ExtraV2F, d); + ZERO_INITIALIZE(Blackboard, d.blackboard); + // due to motion vectors in HDRP, we need to use the last + // time in certain spots. So if you are going to use _Time to adjust vertices, + // you need to use this time or motion vectors will break. + d.time = time; + + Ext_ModifyVertex0(v, d); + // Ext_ModifyVertex1(v, d); + // Ext_ModifyVertex2(v, d); + // Ext_ModifyVertex3(v, d); + // Ext_ModifyVertex4(v, d); + // Ext_ModifyVertex5(v, d); + // Ext_ModifyVertex6(v, d); + // Ext_ModifyVertex7(v, d); + // Ext_ModifyVertex8(v, d); + // Ext_ModifyVertex9(v, d); + // Ext_ModifyVertex10(v, d); + // Ext_ModifyVertex11(v, d); + // Ext_ModifyVertex12(v, d); + // Ext_ModifyVertex13(v, d); + // Ext_ModifyVertex14(v, d); + // Ext_ModifyVertex15(v, d); + // Ext_ModifyVertex16(v, d); + // Ext_ModifyVertex17(v, d); + // Ext_ModifyVertex18(v, d); + // Ext_ModifyVertex19(v, d); + // Ext_ModifyVertex20(v, d); + // Ext_ModifyVertex21(v, d); + // Ext_ModifyVertex22(v, d); + // Ext_ModifyVertex23(v, d); + // Ext_ModifyVertex24(v, d); + // Ext_ModifyVertex25(v, d); + // Ext_ModifyVertex26(v, d); + // Ext_ModifyVertex27(v, d); + // Ext_ModifyVertex28(v, d); + // Ext_ModifyVertex29(v, d); + + + // #if %EXTRAV2F0REQUIREKEY% + // v2p.extraV2F0 = d.extraV2F0; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // v2p.extraV2F1 = d.extraV2F1; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // v2p.extraV2F2 = d.extraV2F2; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // v2p.extraV2F3 = d.extraV2F3; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // v2p.extraV2F4 = d.extraV2F4; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // v2p.extraV2F5 = d.extraV2F5; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // v2p.extraV2F6 = d.extraV2F6; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // v2p.extraV2F7 = d.extraV2F7; + // #endif + } + + void ChainModifyTessellatedVertex(inout VertexData v, inout VertexToPixel v2p) + { + ExtraV2F d; + ZERO_INITIALIZE(ExtraV2F, d); + ZERO_INITIALIZE(Blackboard, d.blackboard); + + // #if %EXTRAV2F0REQUIREKEY% + // d.extraV2F0 = v2p.extraV2F0; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // d.extraV2F1 = v2p.extraV2F1; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // d.extraV2F2 = v2p.extraV2F2; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // d.extraV2F3 = v2p.extraV2F3; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // d.extraV2F4 = v2p.extraV2F4; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // d.extraV2F5 = v2p.extraV2F5; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // d.extraV2F6 = v2p.extraV2F6; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // d.extraV2F7 = v2p.extraV2F7; + // #endif + + + // Ext_ModifyTessellatedVertex0(v, d); + // Ext_ModifyTessellatedVertex1(v, d); + // Ext_ModifyTessellatedVertex2(v, d); + // Ext_ModifyTessellatedVertex3(v, d); + // Ext_ModifyTessellatedVertex4(v, d); + // Ext_ModifyTessellatedVertex5(v, d); + // Ext_ModifyTessellatedVertex6(v, d); + // Ext_ModifyTessellatedVertex7(v, d); + // Ext_ModifyTessellatedVertex8(v, d); + // Ext_ModifyTessellatedVertex9(v, d); + // Ext_ModifyTessellatedVertex10(v, d); + // Ext_ModifyTessellatedVertex11(v, d); + // Ext_ModifyTessellatedVertex12(v, d); + // Ext_ModifyTessellatedVertex13(v, d); + // Ext_ModifyTessellatedVertex14(v, d); + // Ext_ModifyTessellatedVertex15(v, d); + // Ext_ModifyTessellatedVertex16(v, d); + // Ext_ModifyTessellatedVertex17(v, d); + // Ext_ModifyTessellatedVertex18(v, d); + // Ext_ModifyTessellatedVertex19(v, d); + // Ext_ModifyTessellatedVertex20(v, d); + // Ext_ModifyTessellatedVertex21(v, d); + // Ext_ModifyTessellatedVertex22(v, d); + // Ext_ModifyTessellatedVertex23(v, d); + // Ext_ModifyTessellatedVertex24(v, d); + // Ext_ModifyTessellatedVertex25(v, d); + // Ext_ModifyTessellatedVertex26(v, d); + // Ext_ModifyTessellatedVertex27(v, d); + // Ext_ModifyTessellatedVertex28(v, d); + // Ext_ModifyTessellatedVertex29(v, d); + + // #if %EXTRAV2F0REQUIREKEY% + // v2p.extraV2F0 = d.extraV2F0; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // v2p.extraV2F1 = d.extraV2F1; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // v2p.extraV2F2 = d.extraV2F2; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // v2p.extraV2F3 = d.extraV2F3; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // v2p.extraV2F4 = d.extraV2F4; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // v2p.extraV2F5 = d.extraV2F5; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // v2p.extraV2F6 = d.extraV2F6; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // v2p.extraV2F7 = d.extraV2F7; + // #endif + } + + void ChainFinalColorForward(inout Surface l, inout ShaderData d, inout half4 color) + { + // Ext_FinalColorForward0(l, d, color); + // Ext_FinalColorForward1(l, d, color); + // Ext_FinalColorForward2(l, d, color); + // Ext_FinalColorForward3(l, d, color); + // Ext_FinalColorForward4(l, d, color); + // Ext_FinalColorForward5(l, d, color); + // Ext_FinalColorForward6(l, d, color); + // Ext_FinalColorForward7(l, d, color); + // Ext_FinalColorForward8(l, d, color); + // Ext_FinalColorForward9(l, d, color); + // Ext_FinalColorForward10(l, d, color); + // Ext_FinalColorForward11(l, d, color); + // Ext_FinalColorForward12(l, d, color); + // Ext_FinalColorForward13(l, d, color); + // Ext_FinalColorForward14(l, d, color); + // Ext_FinalColorForward15(l, d, color); + // Ext_FinalColorForward16(l, d, color); + // Ext_FinalColorForward17(l, d, color); + // Ext_FinalColorForward18(l, d, color); + // Ext_FinalColorForward19(l, d, color); + // Ext_FinalColorForward20(l, d, color); + // Ext_FinalColorForward21(l, d, color); + // Ext_FinalColorForward22(l, d, color); + // Ext_FinalColorForward23(l, d, color); + // Ext_FinalColorForward24(l, d, color); + // Ext_FinalColorForward25(l, d, color); + // Ext_FinalColorForward26(l, d, color); + // Ext_FinalColorForward27(l, d, color); + // Ext_FinalColorForward28(l, d, color); + // Ext_FinalColorForward29(l, d, color); + } + + void ChainFinalGBufferStandard(inout Surface s, inout ShaderData d, inout half4 GBuffer0, inout half4 GBuffer1, inout half4 GBuffer2, inout half4 outEmission, inout half4 outShadowMask) + { + // Ext_FinalGBufferStandard0(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard1(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard2(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard3(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard4(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard5(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard6(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard7(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard8(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard9(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard10(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard11(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard12(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard13(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard14(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard15(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard16(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard17(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard18(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard19(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard20(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard21(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard22(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard23(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard24(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard25(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard26(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard27(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard28(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard29(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + } +#endif + + + + + +#if _DECALSHADER + + ShaderData CreateShaderData(SurfaceDescriptionInputs IN) + { + ShaderData d = (ShaderData)0; + d.TBNMatrix = float3x3(IN.WorldSpaceTangent, IN.WorldSpaceBiTangent, IN.WorldSpaceNormal); + d.worldSpaceNormal = IN.WorldSpaceNormal; + d.worldSpaceTangent = IN.WorldSpaceTangent; + + d.worldSpacePosition = IN.WorldSpacePosition; + d.texcoord0 = IN.uv0.xyxy; + d.screenPos = IN.ScreenPosition; + + d.worldSpaceViewDir = normalize(_WorldSpaceCameraPos - d.worldSpacePosition); + + d.tangentSpaceViewDir = mul(d.TBNMatrix, d.worldSpaceViewDir); + + // these rarely get used, so we back transform them. Usually will be stripped. + #if _HDRP + // d.localSpacePosition = mul(GetWorldToObjectMatrix(), float4(GetCameraRelativePositionWS(d.worldSpacePosition), 1)).xyz; + #else + // d.localSpacePosition = mul(GetWorldToObjectMatrix(), float4(d.worldSpacePosition, 1)).xyz; + #endif + // d.localSpaceNormal = normalize(mul((float3x3)GetWorldToObjectMatrix(), d.worldSpaceNormal)); + // d.localSpaceTangent = normalize(mul((float3x3)GetWorldToObjectMatrix(), d.worldSpaceTangent.xyz)); + + // #if %SCREENPOSREQUIREKEY% + // d.screenUV = (IN.ScreenPosition.xy / max(0.01, IN.ScreenPosition.w)); + // #endif + + return d; + } +#else + + ShaderData CreateShaderData(VertexToPixel i + #if NEED_FACING + , bool facing + #endif + ) + { + ShaderData d = (ShaderData)0; + d.clipPos = i.pos; + d.worldSpacePosition = i.worldPos; + + d.worldSpaceNormal = normalize(i.worldNormal); + d.worldSpaceTangent.xyz = normalize(i.worldTangent.xyz); + + d.tangentSign = i.worldTangent.w * unity_WorldTransformParams.w; + float3 bitangent = cross(d.worldSpaceTangent.xyz, d.worldSpaceNormal) * d.tangentSign; + + d.TBNMatrix = float3x3(d.worldSpaceTangent, -bitangent, d.worldSpaceNormal); + d.worldSpaceViewDir = normalize(_WorldSpaceCameraPos - i.worldPos); + + d.tangentSpaceViewDir = mul(d.TBNMatrix, d.worldSpaceViewDir); + d.texcoord0 = i.texcoord0; + d.texcoord1 = i.texcoord1; + d.texcoord2 = i.texcoord2; + + // #if %TEXCOORD3REQUIREKEY% + d.texcoord3 = i.texcoord3; + // #endif + + // d.isFrontFace = facing; + // #if %VERTEXCOLORREQUIREKEY% + d.vertexColor = i.vertexColor; + // #endif + + // these rarely get used, so we back transform them. Usually will be stripped. + #if _HDRP + // d.localSpacePosition = mul(GetWorldToObjectMatrix(), float4(GetCameraRelativePositionWS(i.worldPos), 1)).xyz; + #else + // d.localSpacePosition = mul(GetWorldToObjectMatrix(), float4(i.worldPos, 1)).xyz; + #endif + // d.localSpaceNormal = normalize(mul((float3x3)GetWorldToObjectMatrix(), i.worldNormal)); + // d.localSpaceTangent = normalize(mul((float3x3)GetWorldToObjectMatrix(), i.worldTangent.xyz)); + + // #if %SCREENPOSREQUIREKEY% + // d.screenPos = i.screenPos; + // d.screenUV = (i.screenPos.xy / i.screenPos.w); + // #endif + + + // #if %EXTRAV2F0REQUIREKEY% + // d.extraV2F0 = i.extraV2F0; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // d.extraV2F1 = i.extraV2F1; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // d.extraV2F2 = i.extraV2F2; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // d.extraV2F3 = i.extraV2F3; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // d.extraV2F4 = i.extraV2F4; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // d.extraV2F5 = i.extraV2F5; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // d.extraV2F6 = i.extraV2F6; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // d.extraV2F7 = i.extraV2F7; + // #endif + + return d; + } + +#endif + + + #if _PASSSHADOW + float3 _LightDirection; + #endif + + // vertex shader + VertexToPixel Vert (VertexData v) + { + + VertexToPixel o = (VertexToPixel)0; + + UNITY_SETUP_INSTANCE_ID(v); + UNITY_TRANSFER_INSTANCE_ID(v, o); + UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o); + + +#if !_TESSELLATION_ON + ChainModifyVertex(v, o, _Time); +#endif + + o.texcoord0 = v.texcoord0; + o.texcoord1 = v.texcoord1; + o.texcoord2 = v.texcoord2; + + // #if %TEXCOORD3REQUIREKEY% + o.texcoord3 = v.texcoord3; + // #endif + + // #if %VERTEXCOLORREQUIREKEY% + o.vertexColor = v.vertexColor; + // #endif + + VertexPositionInputs vertexInput = GetVertexPositionInputs(v.vertex.xyz); + o.worldPos = TransformObjectToWorld(v.vertex.xyz); + o.worldNormal = TransformObjectToWorldNormal(v.normal); + o.worldTangent = float4(TransformObjectToWorldDir(v.tangent.xyz), v.tangent.w); + + + #if _PASSSHADOW + // Define shadow pass specific clip position for Universal + o.pos = TransformWorldToHClip(ApplyShadowBias(o.worldPos, o.worldNormal, _LightDirection)); + #if UNITY_REVERSED_Z + o.pos.z = min(o.pos.z, UNITY_NEAR_CLIP_VALUE); + #else + o.pos.z = max(o.pos.z, UNITY_NEAR_CLIP_VALUE); + #endif + #elif _PASSMETA + o.pos = MetaVertexPosition(float4(v.vertex.xyz, 0), v.texcoord1, v.texcoord2, unity_LightmapST, unity_DynamicLightmapST); + #else + o.pos = TransformWorldToHClip(o.worldPos); + #endif + + // #if %SCREENPOSREQUIREKEY% + // o.screenPos = ComputeScreenPos(o.pos, _ProjectionParams.x); + // #endif + + #if _PASSFORWARD + OUTPUT_LIGHTMAP_UV(v.texcoord1, unity_LightmapST, o.lightmapUV); + OUTPUT_SH(o.worldNormal, o.sh); + #endif + + #ifdef VARYINGS_NEED_FOG_AND_VERTEX_LIGHT + #if _BAKEDLIT + half3 vertexLight = 0; + #else + half3 vertexLight = VertexLighting(o.worldPos, o.worldNormal); + #endif + half fogFactor = ComputeFogFactor(o.pos.z); + o.fogFactorAndVertexLight = half4(fogFactor, vertexLight); + #endif + + #ifdef _MAIN_LIGHT_SHADOWS + o.shadowCoord = GetShadowCoord(vertexInput); + #endif + + return o; + } + + + + + // fragment shader + half4 Frag (VertexToPixel IN + #if NEED_FACING + , bool facing : SV_IsFrontFace + #endif + ) : SV_Target + { + UNITY_SETUP_INSTANCE_ID(IN); + UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX(IN); + + + ShaderData d = CreateShaderData(IN + #if NEED_FACING + , facing + #endif + ); + + Surface l = (Surface)0; + + l.Albedo = half3(0.5, 0.5, 0.5); + l.Normal = float3(0,0,1); + l.Occlusion = 1; + l.Alpha = 1; + + ChainSurfaceFunction(l, d); + + + half4 color = half4(l.Albedo, l.Alpha); + + return color; + + } + + ENDHLSL + + } + + + + + + + } + + + CustomEditor "AllIn1SpriteShaderLitMaterialInspector" +} diff --git a/Assets/Plugins/AllIn1SpriteShader/Shaders/LitShaders/AllIn1SpriteShaderLit_BetterShader_URP2019.txt.meta b/Assets/Plugins/AllIn1SpriteShader/Shaders/LitShaders/AllIn1SpriteShaderLit_BetterShader_URP2019.txt.meta new file mode 100644 index 000000000..f72938e6a --- /dev/null +++ b/Assets/Plugins/AllIn1SpriteShader/Shaders/LitShaders/AllIn1SpriteShaderLit_BetterShader_URP2019.txt.meta @@ -0,0 +1,14 @@ +fileFormatVersion: 2 +guid: 3a9baa42d2bd0f2418209ef9ad138f0e +TextScriptImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 156513 + packageName: All In 1 Sprite Shader + packageVersion: 4.25 + assetPath: Assets/Plugins/AllIn1SpriteShader/Shaders/LitShaders/AllIn1SpriteShaderLit_BetterShader_URP2019.txt + uploadId: 708810 diff --git a/Assets/Plugins/AllIn1SpriteShader/Shaders/LitShaders/AllIn1SpriteShaderLit_BetterShader_URP2020.txt b/Assets/Plugins/AllIn1SpriteShader/Shaders/LitShaders/AllIn1SpriteShaderLit_BetterShader_URP2020.txt new file mode 100644 index 000000000..71016fa3b --- /dev/null +++ b/Assets/Plugins/AllIn1SpriteShader/Shaders/LitShaders/AllIn1SpriteShaderLit_BetterShader_URP2020.txt @@ -0,0 +1,11878 @@ +//////////////////////////////////////// +// Generated with Better Shaders +// +// Auto-generated shader code, don't hand edit! +// +// Unity Version: 2019.4.16f1 +// Render Pipeline: URP2020 +// Platform: WindowsEditor +//////////////////////////////////////// + + +Shader "AllIn1SpriteShader/AllIn1SpriteShaderLit_BetterShader" +{ + Properties + { + + _MainTex ("Main Texture", 2D) = "white" {} //0 + _Color("Main Color", Color) = (1,1,1,1) //1 + _Alpha("General Alpha", Range(0,1)) = 1 //2 + + _GlowColor("Glow Color", Color) = (1,1,1,1) //3 + _Glow("Glow Color Intensity", Range(0,100)) = 10 //4 + _GlowGlobal("Global Glow Intensity", Range(1,100)) = 1 //5 + [NoScaleOffset] _GlowTex("Glow Texture", 2D) = "white" {} //6 + + _FadeTex("Fade Texture", 2D) = "white" {} //7 + _FadeAmount("Fade Amount", Range(-0.1,1)) = -0.1 //8 + _FadeBurnWidth("Fade Burn Width", Range(0,1)) = 0.025 //9 + _FadeBurnTransition("Burn Transition", Range(0.01,0.5)) = 0.075 //10 + _FadeBurnColor("Fade Burn Color", Color) = (1,1,0,1) //11 + _FadeBurnTex("Fade Burn Texture", 2D) = "white" {} //12 + _FadeBurnGlow("Fade Burn Glow", Range(1,250)) = 2//13 + + _OutlineColor("Outline Base Color", Color) = (1,1,1,1) //14 + _OutlineAlpha("Outline Base Alpha", Range(0,1)) = 1 //15 + _OutlineGlow("Outline Base Glow", Range(1,100)) = 1.5 //16 + _OutlineWidth("Outline Base Width", Range(0,0.2)) = 0.004 //17 + _OutlinePixelWidth("Outline Base Pixel Width", Int) = 1 //18 + + [Space] + _OutlineTex("Outline Texture", 2D) = "white" {} //19 + _OutlineTexXSpeed("Texture scroll speed X", Range(-50,50)) = 10 //20 + _OutlineTexYSpeed("Texture scroll speed Y", Range(-50,50)) = 0 //21 + + [Space] + _OutlineDistortTex("Outline Distortion Texture", 2D) = "white" {} //22 + _OutlineDistortAmount("Outline Distortion Amount", Range(0,2)) = 0.5 //23 + _OutlineDistortTexXSpeed("Distortion scroll speed X", Range(-50,50)) = 5 //24 + _OutlineDistortTexYSpeed("Distortion scroll speed Y", Range(-50,50)) = 5 //25 + + _AlphaOutlineColor("Color", Color) = (1, 1, 1, 1) //26 + _AlphaOutlineGlow("Outline Glow", Range(1,100)) = 5 //27 + _AlphaOutlinePower("Power", Range(0, 5)) = 1 // 28 + _AlphaOutlineMinAlpha("Min Alpha", Range(0, 1)) = 0 // 29 + _AlphaOutlineBlend("Blend", Range(0, 1)) = 1 // 30 + + _GradBlend("Gradient Blend", Range(0,1)) = 1 //31 + _GradTopLeftCol("Top Color", Color) = (1,0,0,1) //32 + _GradTopRightCol("Top Color 2", Color) = (1, 1, 0, 1) //33 + _GradBotLeftCol("Bot Color", Color) = (0,0,1,1) //34 + _GradBotRightCol("Bot Color 2", Color) = (0, 1, 0, 1) //35 + + [NoScaleOffset] _ColorSwapTex("Color Swap Texture", 2D) = "black" {} //36 + [HDR] _ColorSwapRed("Red Channel", Color) = (1,1,1,1) //37 + _ColorSwapRedLuminosity("Red luminosity", Range(-1,1)) = 0.5 //38 + [HDR] _ColorSwapGreen("Green Channel", Color) = (1,1,1,1) //39 + _ColorSwapGreenLuminosity("Green luminosity", Range(-1,1)) = 0.5 //40 + [HDR] _ColorSwapBlue("Blue Channel", Color) = (1,1,1,1) //41 + _ColorSwapBlueLuminosity("Blue luminosity", Range(-1,1)) = 0.5 //42 + + _HsvShift("Hue Shift", Range(0, 360)) = 180 //43 + _HsvSaturation("Saturation", Range(0, 2)) = 1 //44 + _HsvBright("Brightness", Range(0, 2)) = 1 //45 + + _HitEffectColor("Hit Effect Color", Color) = (1,1,1,1) //46 + _HitEffectGlow("Glow Intensity", Range(1,100)) = 5 //47 + [Space] + _HitEffectBlend("Hit Effect Blend", Range(0,1)) = 1 //48 + + _NegativeAmount("Negative Amount", Range(0, 1)) = 1 //49 + + _PixelateSize("Pixelate size", Range(4,512)) = 32 //50 + + [NoScaleOffset] _ColorRampTex("Color ramp Texture", 2D) = "white" {} //51 + _ColorRampLuminosity("Color ramp luminosity", Range(-1,1)) = 0 //52 + [Toggle()] _ColorRampOutline("Affects everything?", float) = 0 //53 + + _GreyscaleLuminosity("Greyscale luminosity", Range(-1,1)) = 0 //54 + [Toggle()] _GreyscaleOutline("Affects everything?", float) = 0 //55 + _GreyscaleTintColor("Greyscale Tint Color", Color) = (1,1,1,1) //56 + + _PosterizeNumColors("Number of Colors", Range(0,100)) = 8 //57 + _PosterizeGamma("Posterize Amount", Range(0.1,10)) = 0.75 //58 + [Toggle()] _PosterizeOutline("Affects everything?", float) = 0 //59 + + _BlurIntensity("Blur Intensity", Range(0,100)) = 10 //60 + [Toggle()] _BlurHD("Blur is Low Res?", float) = 0 //61 + + _MotionBlurAngle("Motion Blur Angle", Range(-1, 1)) = 0.1 //62 + _MotionBlurDist("Motion Blur Distance", Range(-3, 3)) = 1.25 //63 + + _GhostColorBoost("Ghost Color Boost", Range(0,5)) = 1 //64 + _GhostTransparency("Ghost Transparency", Range(0,1)) = 0 //65 + + _InnerOutlineColor("Inner Outline Color", Color) = (1,0,0,1) //66 + _InnerOutlineThickness("Outline Thickness", Range(0,3)) = 1 //67 + _InnerOutlineAlpha("Inner Outline Alpha", Range(0,1)) = 1 //68 + _InnerOutlineGlow("Inner Outline Glow", Range(1,250)) = 4 //69 + + _AlphaCutoffValue("Alpha cutoff value", Range(0, 1)) = 0.25 //70 + + [Toggle()] _OnlyOutline("Only render outline?", float) = 0 //71 + [Toggle()] _OnlyInnerOutline("Only render inner outline?", float) = 0 //72 + + _HologramStripesAmount("Stripes Amount", Range(0, 1)) = 0.1 //73 + _HologramUnmodAmount("Unchanged Amount", Range(0, 1)) = 0.0 //74 + _HologramStripesSpeed("Stripes Speed", Range(-20, 20)) = 4.5 //75 + _HologramMinAlpha("Min Alpha", Range(0, 1)) = 0.1 //76 + _HologramMaxAlpha("Max Alpha", Range(0, 100)) = 0.75 //77 + + _ChromAberrAmount("ChromAberr Amount", Range(0, 1)) = 1 //78 + _ChromAberrAlpha("ChromAberr Alpha", Range(0, 1)) = 0.4 //79 + + _GlitchAmount("Glitch Amount", Range(0, 20)) = 3 //80 + + _FlickerPercent("Flicker Percent", Range(0, 1)) = 0.05 //81 + _FlickerFreq("Flicker Frequency", Range(0, 5)) = 0.2 //82 + _FlickerAlpha("Flicker Alpha", Range(0, 1)) = 0 //83 + + _ShadowX("Shadow X Axis", Range(-0.5, 0.5)) = 0.1 //84 + _ShadowY("Shadow Y Axis", Range(-0.5, 0.5)) = -0.05 //85 + _ShadowAlpha("Shadow Alpha", Range(0, 1)) = 0.5 //86 + _ShadowColor("Shadow Color", Color) = (0, 0, 0, 1) //87 + + _HandDrawnAmount("Hand Drawn Amount", Range(0, 20)) = 10 //88 + _HandDrawnSpeed("Hand Drawn Speed", Range(1, 15)) = 5 //89 + + _GrassSpeed("Speed", Range(0,50)) = 2 //90 + _GrassWind("Bend amount", Range(0,50)) = 20 //91 + [Space] + [Toggle()] _GrassManualToggle("Manually animated?", float) = 0 //92 + _GrassManualAnim("Manual Anim Value", Range(-1,1)) = 1 //93 + + _WaveAmount("Wave Amount", Range(0, 25)) = 7 //94 + _WaveSpeed("Wave Speed", Range(0, 25)) = 10 //95 + _WaveStrength("Wave Strength", Range(0, 25)) = 7.5 //96 + _WaveX("Wave X Axis", Range(0, 1)) = 0 //97 + _WaveY("Wave Y Axis", Range(0, 1)) = 0.5 //98 + + _RectSize("Rect Size", Range(1, 4)) = 1 //99 + + _OffsetUvX("X axis", Range(-1, 1)) = 0 //100 + _OffsetUvY("Y axis", Range(-1, 1)) = 0 //101 + + _ClipUvLeft("Clipping Left", Range(0, 1)) = 0 //102 + _ClipUvRight("Clipping Right", Range(0, 1)) = 0 //103 + _ClipUvUp("Clipping Up", Range(0, 1)) = 0 //104 + _ClipUvDown("Clipping Down", Range(0, 1)) = 0 //105 + + _TextureScrollXSpeed("Speed X Axis", Range(-5, 5)) = 1 //106 + _TextureScrollYSpeed("Speed Y Axis", Range(-5, 5)) = 0 //107 + + _ZoomUvAmount("Zoom Amount", Range(0.1, 5)) = 0.5 //108 + + _DistortTex("Distortion Texture", 2D) = "white" {} //109 + _DistortAmount("Distortion Amount", Range(0,2)) = 0.5 //110 + _DistortTexXSpeed("Scroll speed X", Range(-50,50)) = 5 //111 + _DistortTexYSpeed("Scroll speed Y", Range(-50,50)) = 5 //112 + + _TwistUvAmount("Twist Amount", Range(0, 3.1416)) = 1 //113 + _TwistUvPosX("Twist Pos X Axis", Range(0, 1)) = 0.5 //114 + _TwistUvPosY("Twist Pos Y Axis", Range(0, 1)) = 0.5 //115 + _TwistUvRadius("Twist Radius", Range(0, 3)) = 0.75 //116 + + _RotateUvAmount("Rotate Angle(radians)", Range(0, 6.2831)) = 0 //117 + + _FishEyeUvAmount("Fish Eye Amount", Range(0, 0.5)) = 0.35 //118 + + _PinchUvAmount("Pinch Amount", Range(0, 0.5)) = 0.35 //119 + + _ShakeUvSpeed("Shake Speed", Range(0, 20)) = 2.5 //120 + _ShakeUvX("X Multiplier", Range(0, 5)) = 1.5 //121 + _ShakeUvY("Y Multiplier", Range(0, 5)) = 1 //122 + + _ColorChangeTolerance("Tolerance", Range(0, 1)) = 0.25 //123 + _ColorChangeTarget("Color to change", Color) = (1, 0, 0, 1) //124 + [HDR] _ColorChangeNewCol("New Color", Color) = (1, 1, 0, 1) //125 + _ColorChangeLuminosity("New Color Luminosity", Range(0, 1)) = 0.0 //126 + + _RoundWaveStrength("Wave Strength", Range(0, 1)) = 0.7 //127 + _RoundWaveSpeed("Wave Speed", Range(0, 5)) = 2 //128 + + [Toggle()] _BillboardY("Billboard on both axis?", float) = 0 //129 + _ZWrite ("Depth Write", Float) = 1.0 // 130 + + _MySrcMode ("SrcMode", Float) = 5 // 131 + _MyDstMode ("DstMode", Float) = 10 // 132 + + _ShineColor("Shine Color", Color) = (1,1,1,1) // 133 + _ShineLocation("Shine Location", Range(0,1)) = 0.5 // 134 + _ShineRotate("Rotate Angle(radians)", Range(0, 6.2831)) = 0 //135 + _ShineWidth("Shine Width", Range(0.05,1)) = 0.1 // 136 + _ShineGlow("Shine Glow", Range(0,100)) = 1 // 137 + [NoScaleOffset] _ShineMask("Shine Mask", 2D) = "white" {} // 138 + + _GlitchSize("Glitch Size", Range(0.25, 5)) = 1 //139 + _HologramStripeColor("Stripes Color", Color) = (0,1,1,1) //140 + _GradBoostX("Boost X axis", Range(0.1, 5)) = 1.2 //141 + _GradBoostY("Boost Y axis", Range(0.1, 5)) = 1.2 //142 + [Toggle()] _GradIsRadial("Radial Gradient?", float) = 0 //143 + _AlphaRoundThreshold("Round Threshold", Range(0.005, 1.0)) = 0.5 //144 + _GrassRadialBend("Radial Bend", Range(0.0, 5.0)) = 0.1 //145 + + _ColorChangeTolerance2("Tolerance 2", Range(0, 1)) = 0.25 //146 + _ColorChangeTarget2("Color to change 2", Color) = (1, 0, 0, 1) //147 + [HDR] _ColorChangeNewCol2("New Color 2", Color) = (1, 1, 0, 1) //148 + _ColorChangeTolerance3("Tolerance 3", Range(0, 1)) = 0.25 //149 + _ColorChangeTarget3("Color to change 3", Color) = (1, 0, 0, 1) //150 + [HDR] _ColorChangeNewCol3("New Color 3", Color) = (1, 1, 0, 1) //151 + + _Contrast ("Contrast", Range(0, 6)) = 1 // 152 + _Brightness ("Brightness", Range(-1, 1)) = 0 // 153 + + _ColorSwapBlend ("Color Swap Blend", Range(0, 1)) = 1 // 154 + _ColorRampBlend ("Color Ramp Blend", Range(0, 1)) = 1 // 155 + _GreyscaleBlend ("Greyscale Blend", Range(0, 1)) = 1 // 156 + _GhostBlend ("Ghost Blend", Range(0, 1)) = 1 // 157 + _HologramBlend ("Hologram Blend", Range(0, 1)) = 1 // 158 + + [AllIn1ShaderGradient] _ColorRampTexGradient("Color ramp Gradient", 2D) = "white" {} //159 + + _OverlayTex("Overlay Texture", 2D) = "white" {} //160 + _OverlayColor("Overlay Color", Color) = (1, 1, 1, 1) //161 + _OverlayGlow("Overlay Glow", Range(0,25)) = 1 // 162 + _OverlayBlend("Overlay Blend", Range(0, 1)) = 1 // 163 + + _RadialStartAngle("Radial Start Angle", Range(0, 360)) = 90 //164 + _RadialClip("Radial Clip", Range(0, 360)) = 45 //165 + _RadialClip2("Radial Clip 2", Range(0, 360)) = 0 //166 + + _WarpStrength("Warp Strength", Range(0, 0.1)) = 0.025 //167 + _WarpSpeed("Warp Speed", Range(0, 25)) = 8 //168 + _WarpScale("Warp Scale", Range(0.05, 3)) = 0.5 //169 + + _OverlayTextureScrollXSpeed("Speed X Axis", Range(-5, 5)) = 0.25 //170 + _OverlayTextureScrollYSpeed("Speed Y Axis", Range(-5, 5)) = 0.25 //171 + + _ZTestMode ("Z Test Mode", Float) = 4 + _CullingOption ("Culling Option", float) = 0 + + [HideInInspector] _MinXUV("_MinXUV", Range(0, 1)) = 0.0 + [HideInInspector] _MaxXUV("_MaxXUV", Range(0, 1)) = 1.0 + [HideInInspector] _MinYUV("_MinYUV", Range(0, 1)) = 0.0 + [HideInInspector] _MaxYUV("_MaxYUV", Range(0, 1)) = 1.0 + [HideInInspector] _RandomSeed("_MaxYUV", Range(0, 10000)) = 0.0 + _EditorDrawers("Editor Drawers", Int) = 6 + + [Normal][NoScaleOffset] _NormalMap("Normal Map", 2D) = "bump" {} + _NormalStrength("Normal Strength", Range(0, 15)) = 1.0 + + + [HideInInspector][NoScaleOffset]unity_Lightmaps("unity_Lightmaps", 2DArray) = "" {} + [HideInInspector][NoScaleOffset]unity_LightmapsInd("unity_LightmapsInd", 2DArray) = "" {} + [HideInInspector][NoScaleOffset]unity_ShadowMasks("unity_ShadowMasks", 2DArray) = "" {} + } + SubShader + { + Tags { "RenderPipeline"="UniversalPipeline" "RenderType" = "Opaque" "UniversalMaterialType" = "Lit" "Queue" = "Geometry" } + + + + + Pass + { + Name "Universal Forward" + Tags + { + "LightMode" = "UniversalForward" + } + Cull Back + Blend One Zero + ZTest LEqual + ZWrite On + + Blend One Zero, One Zero +Cull Back +ZTest LEqual +ZWrite On + + Tags { "RenderType" = "Opaque" "Queue" = "Geometry" "PreviewType" = "Plane" } + Cull [_CullingOption] + ZWrite [_ZWrite] + ZTest [_ZTestMode] + + + HLSLPROGRAM + + #pragma vertex Vert + #pragma fragment Frag + + #pragma target 3.0 + + #pragma prefer_hlslcc gles + #pragma exclude_renderers d3d11_9x + #pragma multi_compile_fog + #pragma multi_compile_instancing + #pragma multi_compile _ DOTS_INSTANCING_ON + + // Keywords + #pragma multi_compile _ _SCREEN_SPACE_OCCLUSION + #pragma multi_compile _ LIGHTMAP_ON + #pragma multi_compile _ DIRLIGHTMAP_COMBINED + #pragma multi_compile _ _MAIN_LIGHT_SHADOWS + #pragma multi_compile _ _MAIN_LIGHT_SHADOWS_CASCADE + #pragma multi_compile _ADDITIONAL_LIGHTS_VERTEX _ADDITIONAL_LIGHTS _ADDITIONAL_OFF + #pragma multi_compile _ _ADDITIONAL_LIGHT_SHADOWS + #pragma multi_compile _ _SHADOWS_SOFT + #pragma multi_compile _ LIGHTMAP_SHADOW_MIXING + #pragma multi_compile _ SHADOWS_SHADOWMASK + // GraphKeywords: + + #define SHADER_PASS SHADERPASS_FORWARD + #define SHADERPASS_FORWARD + #define VARYINGS_NEED_FOG_AND_VERTEX_LIGHT + #define _PASSFORWARD 1 + + + + #pragma shader_feature_local GLOW_ON + #pragma shader_feature_local FADE_ON + #pragma shader_feature_local OUTBASE_ON + #pragma shader_feature_local ONLYOUTLINE_ON + #pragma shader_feature_local GRADIENT_ON + #pragma shader_feature_local GRADIENT2COL_ON + #pragma shader_feature_local RADIALGRADIENT_ON + #pragma shader_feature_local COLORSWAP_ON + #pragma shader_feature_local HSV_ON + #pragma shader_feature_local CHANGECOLOR_ON + #pragma shader_feature_local CHANGECOLOR2_ON + #pragma shader_feature_local CHANGECOLOR3_ON + #pragma shader_feature_local COLORRAMP_ON + #pragma shader_feature_local GRADIENTCOLORRAMP_ON + #pragma shader_feature_local HITEFFECT_ON + #pragma shader_feature_local NEGATIVE_ON + #pragma shader_feature_local PIXELATE_ON + #pragma shader_feature_local GREYSCALE_ON + #pragma shader_feature_local POSTERIZE_ON + #pragma shader_feature_local BLUR_ON + #pragma shader_feature_local MOTIONBLUR_ON + #pragma shader_feature_local GHOST_ON + #pragma shader_feature_local ALPHAOUTLINE_ON + #pragma shader_feature_local INNEROUTLINE_ON + #pragma shader_feature_local ONLYINNEROUTLINE_ON + #pragma shader_feature_local HOLOGRAM_ON + #pragma shader_feature_local CHROMABERR_ON + #pragma shader_feature_local GLITCH_ON + #pragma shader_feature_local FLICKER_ON + #pragma shader_feature_local SHADOW_ON + #pragma shader_feature_local SHINE_ON + #pragma shader_feature_local CONTRAST_ON + #pragma shader_feature_local OVERLAY_ON + #pragma shader_feature_local OVERLAYMULT_ON + #pragma shader_feature_local DOODLE_ON + #pragma shader_feature_local WIND_ON + #pragma shader_feature_local WAVEUV_ON + #pragma shader_feature_local ROUNDWAVEUV_ON + #pragma shader_feature_local RECTSIZE_ON + #pragma shader_feature_local OFFSETUV_ON + #pragma shader_feature_local CLIPPING_ON + #pragma shader_feature_local RADIALCLIPPING_ON + #pragma shader_feature_local TEXTURESCROLL_ON + #pragma shader_feature_local ZOOMUV_ON + #pragma shader_feature_local DISTORT_ON + #pragma shader_feature_local WARP_ON + #pragma shader_feature_local TWISTUV_ON + #pragma shader_feature_local ROTATEUV_ON + #pragma shader_feature_local POLARUV_ON + #pragma shader_feature_local FISHEYE_ON + #pragma shader_feature_local PINCH_ON + #pragma shader_feature_local SHAKEUV_ON + + #pragma shader_feature_local GLOWTEX_ON + #pragma shader_feature_local OUTTEX_ON + #pragma shader_feature_local OUTDIST_ON + #pragma shader_feature_local OUTBASE8DIR_ON + #pragma shader_feature_local OUTBASEPIXELPERF_ON + #pragma shader_feature_local COLORRAMPOUTLINE_ON + #pragma shader_feature_local GREYSCALEOUTLINE_ON + #pragma shader_feature_local POSTERIZEOUTLINE_ON + #pragma shader_feature_local BLURISHD_ON + #pragma shader_feature_local MANUALWIND_ON + #pragma shader_feature_local ATLAS_ON + #pragma shader_feature_local PREMULTIPLYALPHA_ON + + #pragma shader_feature BILBOARD_ON + #pragma shader_feature BILBOARDY_ON + + #pragma shader_feature NORMALMAP_ON + + + #define _URP 1 +#define _USINGTEXCOORD1 1 +#define _USINGTEXCOORD2 1 + + + // this has to be here or specular color will be ignored. Not in SG code + #if _SIMPLELIT + #define _SPECULAR_COLOR + #endif + + + // Includes + #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Version.hlsl" + #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Color.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.shadergraph/ShaderGraphLibrary/ShaderVariablesFunctions.hlsl" + + + + + #undef WorldNormalVector + #define WorldNormalVector(data, normal) mul(normal, data.TBNMatrix) + + #define UnityObjectToWorldNormal(normal) mul(GetObjectToWorldMatrix(), normal) + + #define _WorldSpaceLightPos0 _MainLightPosition + + #define UNITY_DECLARE_TEX2D(name) TEXTURE2D(name); SAMPLER(sampler##name); + #define UNITY_DECLARE_TEX2D_NOSAMPLER(name) TEXTURE2D(name); + #define UNITY_DECLARE_TEX2DARRAY(name) TEXTURE2D_ARRAY(name); SAMPLER(sampler##name); + #define UNITY_DECLARE_TEX2DARRAY_NOSAMPLER(name) TEXTURE2D_ARRAY(name); + + #define UNITY_SAMPLE_TEX2DARRAY(tex,coord) SAMPLE_TEXTURE2D_ARRAY(tex, sampler##tex, coord.xy, coord.z) + #define UNITY_SAMPLE_TEX2DARRAY_LOD(tex,coord,lod) SAMPLE_TEXTURE2D_ARRAY_LOD(tex, sampler##tex, coord.xy, coord.z, lod) + #define UNITY_SAMPLE_TEX2D(tex, coord) SAMPLE_TEXTURE2D(tex, sampler##tex, coord) + #define UNITY_SAMPLE_TEX2D_SAMPLER(tex, samp, coord) SAMPLE_TEXTURE2D(tex, sampler##samp, coord) + + #define UNITY_SAMPLE_TEX2D_LOD(tex,coord, lod) SAMPLE_TEXTURE2D_LOD(tex, sampler_##tex, coord, lod) + #define UNITY_SAMPLE_TEX2D_SAMPLER_LOD(tex,samplertex,coord, lod) SAMPLE_TEXTURE2D_LOD (tex, sampler##samplertex,coord, lod) + + #if defined(UNITY_COMPILER_HLSL) + #define UNITY_INITIALIZE_OUTPUT(type,name) name = (type)0; + #else + #define UNITY_INITIALIZE_OUTPUT(type,name) + #endif + + #define sampler2D_float sampler2D + #define sampler2D_half sampler2D + + + + // data across stages, stripped like the above. + struct VertexToPixel + { + float4 pos : SV_POSITION; + float3 worldPos : TEXCOORD0; + float3 worldNormal : TEXCOORD1; + float4 worldTangent : TEXCOORD2; + float4 texcoord0 : TEXCOORD3; + float4 texcoord1 : TEXCOORD4; + float4 texcoord2 : TEXCOORD5; + + // #if %TEXCOORD3REQUIREKEY% + float4 texcoord3 : TEXCOORD6; + // #endif + + // #if %SCREENPOSREQUIREKEY% + // float4 screenPos : TEXCOORD7; + // #endif + + // #if %VERTEXCOLORREQUIREKEY% + half4 vertexColor : COLOR; + // #endif + + // #if %EXTRAV2F0REQUIREKEY% + // float4 extraV2F0 : TEXCOORD12; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // float4 extraV2F1 : TEXCOORD13; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // float4 extraV2F2 : TEXCOORD14; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // float4 extraV2F3 : TEXCOORD15; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // float4 extraV2F4 : TEXCOORD16; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // float4 extraV2F5 : TEXCOORD17; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // float4 extraV2F6 : TEXCOORD18; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // float4 extraV2F7 : TEXCOORD19; + // #endif + + #if defined(LIGHTMAP_ON) + float2 lightmapUV : TEXCOORD8; + #endif + #if !defined(LIGHTMAP_ON) + float3 sh : TEXCOORD9; + #endif + + #ifdef VARYINGS_NEED_FOG_AND_VERTEX_LIGHT + float4 fogFactorAndVertexLight : TEXCOORD10; + #endif + + #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR) + float4 shadowCoord : TEXCOORD11; + #endif + + #if UNITY_ANY_INSTANCING_ENABLED + uint instanceID : CUSTOM_INSTANCE_ID; + #endif + #if (defined(UNITY_STEREO_INSTANCING_ENABLED)) + uint stereoTargetEyeIndexAsRTArrayIdx : SV_RenderTargetArrayIndex; + #endif + #if (defined(UNITY_STEREO_MULTIVIEW_ENABLED)) || (defined(UNITY_STEREO_INSTANCING_ENABLED) && (defined(SHADER_API_GLES3) || defined(SHADER_API_GLCORE))) + uint stereoTargetEyeIndexAsBlendIdx0 : BLENDINDICES0; + #endif + #if defined(SHADER_STAGE_FRAGMENT) && defined(VARYINGS_NEED_CULLFACE) + FRONT_FACE_TYPE cullFace : FRONT_FACE_SEMANTIC; + #endif + }; + + + + + // data describing the user output of a pixel + struct Surface + { + half3 Albedo; + half Height; + half3 Normal; + half Smoothness; + half3 Emission; + half Metallic; + half3 Specular; + half Occlusion; + half SpecularPower; // for simple lighting + half Alpha; + float outputDepth; // if written, SV_Depth semantic is used. ShaderData.clipPos.z is unused value + // HDRP Only + half SpecularOcclusion; + half SubsurfaceMask; + half Thickness; + half CoatMask; + half CoatSmoothness; + half Anisotropy; + half IridescenceMask; + half IridescenceThickness; + int DiffusionProfileHash; + float SpecularAAThreshold; + float SpecularAAScreenSpaceVariance; + // requires _OVERRIDE_BAKEDGI to be defined, but is mapped in all pipelines + float3 DiffuseGI; + float3 BackDiffuseGI; + float3 SpecularGI; + float ior; + float3 transmittanceColor; + float atDistance; + float transmittanceMask; + // requires _OVERRIDE_SHADOWMASK to be defines + float4 ShadowMask; + + // for decals + float NormalAlpha; + float MAOSAlpha; + + + }; + + // Data the user declares in blackboard blocks + struct Blackboard + { + + float blackboardDummyData; + }; + + // data the user might need, this will grow to be big. But easy to strip + struct ShaderData + { + float4 clipPos; // SV_POSITION + float3 localSpacePosition; + float3 localSpaceNormal; + float3 localSpaceTangent; + + float3 worldSpacePosition; + float3 worldSpaceNormal; + float3 worldSpaceTangent; + float tangentSign; + + float3 worldSpaceViewDir; + float3 tangentSpaceViewDir; + + float4 texcoord0; + float4 texcoord1; + float4 texcoord2; + float4 texcoord3; + + float2 screenUV; + float4 screenPos; + + float4 vertexColor; + bool isFrontFace; + + float4 extraV2F0; + float4 extraV2F1; + float4 extraV2F2; + float4 extraV2F3; + float4 extraV2F4; + float4 extraV2F5; + float4 extraV2F6; + float4 extraV2F7; + + float3x3 TBNMatrix; + Blackboard blackboard; + }; + + struct VertexData + { + #if SHADER_TARGET > 30 + // uint vertexID : SV_VertexID; + #endif + float4 vertex : POSITION; + float3 normal : NORMAL; + float4 tangent : TANGENT; + float4 texcoord0 : TEXCOORD0; + + // optimize out mesh coords when not in use by user or lighting system + #if _URP && (_USINGTEXCOORD1 || _PASSMETA || _PASSFORWARD || _PASSGBUFFER) + float4 texcoord1 : TEXCOORD1; + #endif + + #if _URP && (_USINGTEXCOORD2 || _PASSMETA || ((_PASSFORWARD || _PASSGBUFFER) && defined(DYNAMICLIGHTMAP_ON))) + float4 texcoord2 : TEXCOORD2; + #endif + + #if _STANDARD && (_USINGTEXCOORD1 || (_PASSMETA || ((_PASSFORWARD || _PASSGBUFFER || _PASSFORWARDADD) && LIGHTMAP_ON))) + float4 texcoord1 : TEXCOORD1; + #endif + #if _STANDARD && (_USINGTEXCOORD2 || (_PASSMETA || ((_PASSFORWARD || _PASSGBUFFER) && DYNAMICLIGHTMAP_ON))) + float4 texcoord2 : TEXCOORD2; + #endif + + + #if _HDRP + float4 texcoord1 : TEXCOORD1; + float4 texcoord2 : TEXCOORD2; + #endif + + // #if %TEXCOORD3REQUIREKEY% + float4 texcoord3 : TEXCOORD3; + // #endif + + // #if %VERTEXCOLORREQUIREKEY% + float4 vertexColor : COLOR; + // #endif + + #if _PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR)) + float3 previousPositionOS : TEXCOORD4; // Contain previous transform position (in case of skinning for example) + #if defined (_ADD_PRECOMPUTED_VELOCITY) + float3 precomputedVelocity : TEXCOORD5; // Add Precomputed Velocity (Alembic computes velocities on runtime side). + #endif + #endif + + UNITY_VERTEX_INPUT_INSTANCE_ID + }; + + struct TessVertex + { + float4 vertex : INTERNALTESSPOS; + float3 normal : NORMAL; + float4 tangent : TANGENT; + float4 texcoord0 : TEXCOORD0; + float4 texcoord1 : TEXCOORD1; + float4 texcoord2 : TEXCOORD2; + + // #if %TEXCOORD3REQUIREKEY% + float4 texcoord3 : TEXCOORD3; + // #endif + + // #if %VERTEXCOLORREQUIREKEY% + float4 vertexColor : COLOR; + // #endif + + // #if %EXTRAV2F0REQUIREKEY% + // float4 extraV2F0 : TEXCOORD5; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // float4 extraV2F1 : TEXCOORD6; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // float4 extraV2F2 : TEXCOORD7; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // float4 extraV2F3 : TEXCOORD8; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // float4 extraV2F4 : TEXCOORD9; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // float4 extraV2F5 : TEXCOORD10; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // float4 extraV2F6 : TEXCOORD11; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // float4 extraV2F7 : TEXCOORD12; + // #endif + + #if _PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR)) + float3 previousPositionOS : TEXCOORD13; // Contain previous transform position (in case of skinning for example) + #if defined (_ADD_PRECOMPUTED_VELOCITY) + float3 precomputedVelocity : TEXCOORD14; + #endif + #endif + + UNITY_VERTEX_INPUT_INSTANCE_ID + UNITY_VERTEX_OUTPUT_STEREO + }; + + struct ExtraV2F + { + float4 extraV2F0; + float4 extraV2F1; + float4 extraV2F2; + float4 extraV2F3; + float4 extraV2F4; + float4 extraV2F5; + float4 extraV2F6; + float4 extraV2F7; + Blackboard blackboard; + float4 time; + }; + + + float3 WorldToTangentSpace(ShaderData d, float3 normal) + { + return mul(d.TBNMatrix, normal); + } + + float3 TangentToWorldSpace(ShaderData d, float3 normal) + { + return mul(normal, d.TBNMatrix); + } + + // in this case, make standard more like SRPs, because we can't fix + // unity_WorldToObject in HDRP, since it already does macro-fu there + + #if _STANDARD + float3 TransformWorldToObject(float3 p) { return mul(unity_WorldToObject, float4(p, 1)); }; + float3 TransformObjectToWorld(float3 p) { return mul(unity_ObjectToWorld, float4(p, 1)); }; + float4 TransformWorldToObject(float4 p) { return mul(unity_WorldToObject, p); }; + float4 TransformObjectToWorld(float4 p) { return mul(unity_ObjectToWorld, p); }; + float4x4 GetWorldToObjectMatrix() { return unity_WorldToObject; } + float4x4 GetObjectToWorldMatrix() { return unity_ObjectToWorld; } + #if (defined(SHADER_API_D3D11) || defined(SHADER_API_XBOXONE) || defined(UNITY_COMPILER_HLSLCC) || defined(SHADER_API_PSSL) || (SHADER_TARGET_SURFACE_ANALYSIS && !SHADER_TARGET_SURFACE_ANALYSIS_MOJOSHADER)) + #define UNITY_SAMPLE_TEX2D_LOD(tex,coord, lod) tex.SampleLevel (sampler##tex,coord, lod) + #define UNITY_SAMPLE_TEX2D_SAMPLER_LOD(tex,samplertex,coord, lod) tex.SampleLevel (sampler##samplertex,coord, lod) + #else + #define UNITY_SAMPLE_TEX2D_LOD(tex,coord,lod) tex2D (tex,coord,0,lod) + #define UNITY_SAMPLE_TEX2D_SAMPLER_LOD(tex,samplertex,coord,lod) tex2D (tex,coord,0,lod) + #endif + + #undef GetWorldToObjectMatrix() + + #define GetWorldToObjectMatrix() unity_WorldToObject + + + #endif + + float3 GetCameraWorldPosition() + { + #if _HDRP + return GetCameraRelativePositionWS(_WorldSpaceCameraPos); + #else + return _WorldSpaceCameraPos; + #endif + } + + #if _GRABPASSUSED + #if _STANDARD + TEXTURE2D(%GRABTEXTURE%); + SAMPLER(sampler_%GRABTEXTURE%); + #endif + + half3 GetSceneColor(float2 uv) + { + #if _STANDARD + return SAMPLE_TEXTURE2D(%GRABTEXTURE%, sampler_%GRABTEXTURE%, uv).rgb; + #else + return SHADERGRAPH_SAMPLE_SCENE_COLOR(uv); + #endif + } + #endif + + + + #if _STANDARD + UNITY_DECLARE_DEPTH_TEXTURE(_CameraDepthTexture); + float GetSceneDepth(float2 uv) { return SAMPLE_DEPTH_TEXTURE(_CameraDepthTexture, uv); } + float GetLinear01Depth(float2 uv) { return Linear01Depth(GetSceneDepth(uv)); } + float GetLinearEyeDepth(float2 uv) { return LinearEyeDepth(GetSceneDepth(uv)); } + #else + float GetSceneDepth(float2 uv) { return SHADERGRAPH_SAMPLE_SCENE_DEPTH(uv); } + float GetLinear01Depth(float2 uv) { return Linear01Depth(GetSceneDepth(uv), _ZBufferParams); } + float GetLinearEyeDepth(float2 uv) { return LinearEyeDepth(GetSceneDepth(uv), _ZBufferParams); } + #endif + + float3 GetWorldPositionFromDepthBuffer(float2 uv, float3 worldSpaceViewDir) + { + float eye = GetLinearEyeDepth(uv); + float3 camView = mul((float3x3)GetObjectToWorldMatrix(), transpose(mul(GetWorldToObjectMatrix(), UNITY_MATRIX_I_V)) [2].xyz); + + float dt = dot(worldSpaceViewDir, camView); + float3 div = worldSpaceViewDir/dt; + float3 wpos = (eye * div) + GetCameraWorldPosition(); + return wpos; + } + + #if _HDRP + float3 ObjectToWorldSpacePosition(float3 pos) + { + return GetAbsolutePositionWS(TransformObjectToWorld(pos)); + } + #else + float3 ObjectToWorldSpacePosition(float3 pos) + { + return TransformObjectToWorld(pos); + } + #endif + + #if _STANDARD + UNITY_DECLARE_SCREENSPACE_TEXTURE(_CameraDepthNormalsTexture); + float3 GetSceneNormal(float2 uv, float3 worldSpaceViewDir) + { + float4 depthNorms = UNITY_SAMPLE_SCREENSPACE_TEXTURE(_CameraDepthNormalsTexture, uv); + float3 norms = DecodeViewNormalStereo(depthNorms); + norms = mul((float3x3)GetWorldToViewMatrix(), norms) * 0.5 + 0.5; + return norms; + } + #elif _HDRP && !_DECALSHADER + + float3 GetSceneNormal(float2 uv, float3 worldSpaceViewDir) + { + NormalData nd; + DecodeFromNormalBuffer(_ScreenSize.xy * uv, nd); + return nd.normalWS; + } + #elif _URP + #if (SHADER_LIBRARY_VERSION_MAJOR >= 10) + #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/DeclareNormalsTexture.hlsl" + #endif + + float3 GetSceneNormal(float2 uv, float3 worldSpaceViewDir) + { + #if (SHADER_LIBRARY_VERSION_MAJOR >= 10) + return SampleSceneNormals(uv); + #else + float3 wpos = GetWorldPositionFromDepthBuffer(uv, worldSpaceViewDir); + return normalize(-cross(ddx(wpos), ddy(wpos))) * 0.5 + 0.5; + #endif + + } + #endif + + #if _HDRP + + half3 UnpackNormalmapRGorAG(half4 packednormal) + { + // This do the trick + packednormal.x *= packednormal.w; + + half3 normal; + normal.xy = packednormal.xy * 2 - 1; + normal.z = sqrt(1 - saturate(dot(normal.xy, normal.xy))); + return normal; + } + half3 UnpackNormal(half4 packednormal) + { + #if defined(UNITY_NO_DXT5nm) + return packednormal.xyz * 2 - 1; + #else + return UnpackNormalmapRGorAG(packednormal); + #endif + } + #endif + #if _HDRP || _URP + + half3 UnpackScaleNormal(half4 packednormal, half scale) + { + #ifndef UNITY_NO_DXT5nm + // Unpack normal as DXT5nm (1, y, 1, x) or BC5 (x, y, 0, 1) + // Note neutral texture like "bump" is (0, 0, 1, 1) to work with both plain RGB normal and DXT5nm/BC5 + packednormal.x *= packednormal.w; + #endif + half3 normal; + normal.xy = (packednormal.xy * 2 - 1) * scale; + normal.z = sqrt(1 - saturate(dot(normal.xy, normal.xy))); + return normal; + } + + #endif + + + void GetSun(out float3 lightDir, out float3 color) + { + lightDir = float3(0.5, 0.5, 0); + color = 1; + #if _HDRP + if (_DirectionalLightCount > 0) + { + DirectionalLightData light = _DirectionalLightDatas[0]; + lightDir = -light.forward.xyz; + color = light.color; + } + #elif _STANDARD + lightDir = normalize(_WorldSpaceLightPos0.xyz); + color = _LightColor0.rgb; + #elif _URP + Light light = GetMainLight(); + lightDir = light.direction; + color = light.color; + #endif + } + + + + CBUFFER_START(UnityPerMaterial) + + + half4 _Color; + half4 _MainTex_ST, _MainTex_TexelSize; + half _Alpha, _AlphaCutoffValue; + + #if ATLAS_ON + half _MinXUV, _MaxXUV, _MinYUV, _MaxYUV; + #endif + + #if GLOW_ON + half4 _GlowColor; + half _Glow, _GlowGlobal; + #endif + + #if HSV_ON + half _HsvShift, _HsvSaturation, _HsvBright; + #endif + + #if DISTORT_ON + half4 _DistortTex_ST; + half _DistortTexXSpeed, _DistortTexYSpeed, _DistortAmount; + #endif + + #if FADE_ON + half4 _FadeBurnColor, _FadeTex_ST, _FadeBurnTex_ST; + half _FadeAmount, _FadeBurnWidth, _FadeBurnTransition,_FadeBurnGlow; + #endif + + #if OUTBASE_ON + half4 _OutlineColor; + half _OutlineAlpha, _OutlineGlow, _OutlineWidth; + int _OutlinePixelWidth; + #endif + + #if OUTTEX_ON + half4 _OutlineTex_ST; + half _OutlineTexXSpeed, _OutlineTexYSpeed; + #endif + + #if OUTDIST_ON + half4 _OutlineDistortTex_ST; + half _OutlineDistortTexXSpeed, _OutlineDistortTexYSpeed, _OutlineDistortAmount; + #endif + + #if ALPHAOUTLINE_ON + half _AlphaOutlineGlow, _AlphaOutlinePower, _AlphaOutlineMinAlpha, _AlphaOutlineBlend; + half4 _AlphaOutlineColor; + #endif + + #if INNEROUTLINE_ON + half _InnerOutlineThickness, _InnerOutlineAlpha, _InnerOutlineGlow; + half4 _InnerOutlineColor; + #endif + + #if GRADIENT_ON + half _GradBlend, _GradBoostX, _GradBoostY; + half4 _GradTopRightCol, _GradTopLeftCol, _GradBotRightCol, _GradBotLeftCol; + #endif + + #if COLORSWAP_ON + half4 _ColorSwapRed, _ColorSwapGreen, _ColorSwapBlue; + half _ColorSwapRedLuminosity, _ColorSwapGreenLuminosity, _ColorSwapBlueLuminosity, _ColorSwapBlend; + #endif + + #if CHANGECOLOR_ON + half4 _ColorChangeNewCol, _ColorChangeTarget; + half _ColorChangeTolerance, _ColorChangeLuminosity; + #endif + #if CHANGECOLOR2_ON + half4 _ColorChangeNewCol2, _ColorChangeTarget2; + half _ColorChangeTolerance2; + #endif + #if CHANGECOLOR3_ON + half4 _ColorChangeNewCol3, _ColorChangeTarget3; + half _ColorChangeTolerance3; + #endif + + #if COLORRAMP_ON + half _ColorRampLuminosity, _ColorRampBlend; + #endif + + #if HITEFFECT_ON + half4 _HitEffectColor; + half _HitEffectGlow, _HitEffectBlend; + #endif + + #if NEGATIVE_ON + half _NegativeAmount; + #endif + + #if PIXELATE_ON + half _PixelateSize; + #endif + + #if GREYSCALE_ON + half _GreyscaleLuminosity, _GreyscaleBlend; + half4 _GreyscaleTintColor; + #endif + + #if POSTERIZE_ON + half _PosterizeNumColors, _PosterizeGamma; + #endif + + #if BLUR_ON + half _BlurIntensity; + #endif + + #if MOTIONBLUR_ON + half _MotionBlurAngle, _MotionBlurDist; + #endif + + #if GHOST_ON + half _GhostColorBoost, _GhostTransparency, _GhostBlend; + #endif + + #if HOLOGRAM_ON + half _HologramStripesAmount, _HologramMinAlpha, _HologramUnmodAmount, _HologramStripesSpeed, _HologramMaxAlpha, _HologramBlend; + half4 _HologramStripeColor; + #endif + + #if CHROMABERR_ON + half _ChromAberrAmount, _ChromAberrAlpha; + #endif + + #if GLITCH_ON + half _GlitchAmount, _GlitchSize; + #endif + + #if FLICKER_ON + half _FlickerFreq, _FlickerPercent, _FlickerAlpha; + #endif + + #if SHADOW_ON + half _ShadowX, _ShadowY, _ShadowAlpha; + half4 _ShadowColor; + #endif + + #if SHINE_ON + half4 _ShineColor; + half _ShineLocation, _ShineRotate, _ShineWidth, _ShineGlow; + #endif + + #if CONTRAST_ON + half _Contrast, _Brightness; + #endif + + #if OVERLAY_ON + half4 _OverlayTex_ST, _OverlayColor; + half _OverlayGlow, _OverlayBlend, _OverlayTextureScrollXSpeed, _OverlayTextureScrollYSpeed; + #endif + + #if DOODLE_ON + half _HandDrawnAmount, _HandDrawnSpeed; + #endif + + #if WIND_ON + half _GrassSpeed, _GrassWind, _GrassManualAnim, _GrassRadialBend; + #endif + + #if WAVEUV_ON + float _WaveAmount, _WaveSpeed, _WaveStrength, _WaveX, _WaveY; + #endif + + #if ROUNDWAVEUV_ON + half _RoundWaveStrength, _RoundWaveSpeed; + #endif + + #if RECTSIZE_ON + half _RectSize; + #endif + + #if OFFSETUV_ON + half _OffsetUvX, _OffsetUvY; + #endif + + #if CLIPPING_ON + half _ClipUvLeft, _ClipUvRight, _ClipUvUp, _ClipUvDown; + #endif + + #if RADIALCLIPPING_ON + half _RadialStartAngle, _RadialClip, _RadialClip2; + #endif + + #if TEXTURESCROLL_ON + half _TextureScrollXSpeed, _TextureScrollYSpeed; + #endif + + #if ZOOMUV_ON + half _ZoomUvAmount; + #endif + + #if WARP_ON + half _WarpStrength, _WarpSpeed, _WarpScale; + #endif + + #if TWISTUV_ON + half _TwistUvAmount, _TwistUvPosX, _TwistUvPosY, _TwistUvRadius; + #endif + + #if ROTATEUV_ON + half _RotateUvAmount; + #endif + + #if FISHEYE_ON + half _FishEyeUvAmount; + #endif + + #if PINCH_ON + half _PinchUvAmount; + #endif + + #if SHAKEUV_ON + half _ShakeUvSpeed, _ShakeUvX, _ShakeUvY; + #endif + + #if NORMALMAP_ON + half _NormalStrength; + #endif + + float _RandomSeed; + + + + + CBUFFER_END + + + + + + + + TEXTURE2D(_MainTex); + SAMPLER(sampler_MainTex); + + #if GLOW_ON + TEXTURE2D(_GlowTex); + SAMPLER(sampler_GlowTex); + #endif + + #if FADE_ON + TEXTURE2D(_FadeTex); + SAMPLER(sampler_FadeTex); + + TEXTURE2D(_FadeBurnTex); + SAMPLER(sampler_FadeBurnTex); + #endif + + #if DISTORT_ON + TEXTURE2D(_DistortTex); + SAMPLER(sampler_DistortTex); + #endif + + #if OUTTEX_ON + TEXTURE2D(_OutlineTex); + SAMPLER(sampler_OutlineTex); + #endif + + #if OUTDIST_ON + TEXTURE2D(_OutlineDistortTex); + SAMPLER(sampler_OutlineDistortTex); + #endif + + #if COLORSWAP_ON + TEXTURE2D(_ColorSwapTex); + SAMPLER(sampler_ColorSwapTex); + #endif + + #if COLORRAMP_ON + TEXTURE2D(_ColorRampTex); + TEXTURE2D(_ColorRampTexGradient); + SAMPLER(sampler_ColorRampTex); + SAMPLER(sampler_ColorRampTexGradient); + #endif + + #if SHINE_ON + TEXTURE2D(_ShineMask); + SAMPLER(sampler_ShineMask); + #endif + + #if OVERLAY_ON + TEXTURE2D(_OverlayTex); + SAMPLER(sampler_OverlayTex); + #endif + + #if NORMALMAP_ON + TEXTURE2D(_NormalMap); + SAMPLER(sampler_NormalMap); + #endif + + + half3 GetPixel(in int offsetX, in int offsetY, in half2 uv, in Texture2D _tex, in SamplerState _sampler) + { + half2 _uv = uv + half2(offsetX * _MainTex_TexelSize.x, offsetY * _MainTex_TexelSize.y); + half4 col = SAMPLE_TEXTURE2D(_tex, _sampler, _uv); + return col.rgb; + } + + + //BLURS------------------------------------------------------------------------- + half4 Blur(half2 uv, Texture2D source, SamplerState sampler_source, half Intensity) + { + const half2 texelSize = 1.0 / _ScreenParams.xy; + const half4 color = SAMPLE_TEXTURE2D(source, sampler_source, uv); + const half2 offset = Intensity * texelSize; + + half4 accumulatedColor = color; + half accumulatedWeight = 1.0; + for (int x = -1; x <= 1; x++) + { + for (int y = -1; y <= 1; y++) + { + const half2 sampleUV = uv + half2(x, y) * offset; + const half4 sampleColor = SAMPLE_TEXTURE2D(source, sampler_source, sampleUV); + + accumulatedColor += sampleColor; + accumulatedWeight += 1.0; + } + } + + half4 blurredColor = accumulatedColor / accumulatedWeight; + return blurredColor; + } + + half BlurHD_G(half bhqp, half x) + { + return exp(-(x * x) / (2.0 * bhqp * bhqp)); + } + half4 BlurHD(half2 uv, Texture2D source, SamplerState sampler_source, half BlurAmount, half xScale, half yScale) + { + int iterations = 16; + int halfIterations = iterations / 2; + half sigmaX = 0.1 + BlurAmount * 0.5; + half sigmaY = sigmaX; + half total = 0.0; + half4 ret = half4(0, 0, 0, 0); + for (int iy = 0; iy < iterations; ++iy) + { + half fy = BlurHD_G(sigmaY, half(iy) -half(halfIterations)); + half offsetY = half(iy - halfIterations) * 0.00390625 * xScale; + for (int ix = 0; ix < iterations; ++ix) + { + half fx = BlurHD_G(sigmaX, half(ix) - half(halfIterations)); + half offsetX = half(ix - halfIterations) * 0.00390625 * yScale; + total += fx * fy; + ret += SAMPLE_TEXTURE2D(source, sampler_source, uv + half2(offsetX, offsetY)) * fx * fy; + } + } + return ret / total; + } + //----------------------------------------------------------------------- + + + //------------------------------------------- + half RemapFloat(half inValue, half inMin, half inMax, half outMin, half outMax){ + return outMin + (inValue - inMin) * (outMax - outMin) / (inMax - inMin); + } + //------------------------------------------- + + //----------------------------------------------------------------------- + half rand(half2 seed, half offset) { + return (frac(sin(dot(seed, half2(12.9898, 78.233))) * 43758.5453) + offset) % 1.0; + } + + half rand2(half2 seed, half offset) { + return (frac(sin(dot(seed * floor(50 + (_Time.x % 1.0) * 12.), half2(127.1, 311.7))) * 43758.5453123) + offset) % 1.0; + } + + half rand2CustomTime(half2 seed, half offset, half customTime) { + return (frac(sin(dot(seed * floor(50 + (customTime % 1.0) * 12.), half2(127.1, 311.7))) * 43758.5453123) + offset) % 1.0; + } + //----------------------------------------------------------------------- + + + void Ext_ModifyVertex0 (inout VertexData v, inout ExtraV2F d) + { + //BILBOARD_ON + #if BILBOARD_ON + half3 camRight = mul((half3x3)unity_CameraToWorld, half3(1,0,0)); + half3 camUp = half3(0,1,0); + #if BILBOARDY_ON + camUp = mul((half3x3)unity_CameraToWorld, half3(0,1,0)); + #endif + half3 localPos = v.vertex.x * camRight + v.vertex.y * camUp; + v.vertex = half4(localPos, 1); + #endif + //----------------------------------------------------------- + + v.texcoord0.xy = TRANSFORM_TEX(v.texcoord0.xy, _MainTex); + half2 center = half2(0.5, 0.5); + #if ATLAS_ON + center = half2((_MaxXUV + _MinXUV) / 2.0, (_MaxYUV + _MinYUV) / 2.0); + #endif + + //POLARUV_ON + #if POLARUV_ON + v.texcoord0.xy = v.texcoord0.xy - center; + #endif + + //---------------------------------------- + + //ROTATEUV_ON + #if ROTATEUV_ON + half2 uvC = v.texcoord0.xy; + half cosAngle = cos(_RotateUvAmount); + half sinAngle = sin(_RotateUvAmount); + half2x2 rot = half2x2(cosAngle, -sinAngle, sinAngle, cosAngle); + uvC -= center; + v.texcoord0.xy = mul(rot, uvC); + v.texcoord0.xy += center; + #endif + //-------------------- + + #if RECTSIZE_ON + v.vertex.xyz += (v.vertex.xyz * (_RectSize - 1.0)); + #endif + + #if OUTTEX_ON + v.texcoord1.xy = TRANSFORM_TEX(v.texcoord0.xy, _OutlineTex); + #endif + + #if OUTDIST_ON + v.texcoord2.xy = TRANSFORM_TEX(v.texcoord0.xy, _OutlineDistortTex); + #endif + + #if DISTORT_ON + v.texcoord3.xy = TRANSFORM_TEX(v.texcoord0.xy, _DistortTex); + #endif + } + + void Ext_SurfaceFunction0 (inout Surface o, ShaderData d) + { + half randomSeed = _RandomSeed; + + float2 uvRect = d.texcoord0; + half2 center = half2(0.5, 0.5); + #if ATLAS_ON + center = half2((_MaxXUV + _MinXUV) / 2.0, (_MaxYUV + _MinYUV) / 2.0); + uvRect = half2((d.texcoord0.x - _MinXUV) / (_MaxXUV - _MinXUV), (d.texcoord0.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half2 centerTiled = half2(center.x * _MainTex_ST.x, center.y * _MainTex_ST.y); + + //CLIPPING_ON + #if CLIPPING_ON + half2 tiledUv = half2(d.texcoord0.x / _MainTex_ST.x, d.texcoord0.y / _MainTex_ST.y); + #if ATLAS_ON + tiledUv = half2((tiledUv.x - _MinXUV) / (_MaxXUV - _MinXUV), (tiledUv.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + clip((1 - _ClipUvUp) - tiledUv.y); + clip(tiledUv.y - _ClipUvDown); + clip((1 - _ClipUvRight) - tiledUv.x); + clip(tiledUv.x - _ClipUvLeft); + #endif + //---------------------------------- + + //RADIALCLIPPING_ON + #if RADIALCLIPPING_ON + half2 tiledUv2 = half2(d.texcoord0.x / _MainTex_ST.x, d.texcoord0.y / _MainTex_ST.y); + #if ATLAS_ON + tiledUv2 = half2((tiledUv2.x - _MinXUV) / (_MaxXUV - _MinXUV), (tiledUv2.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half startAngle = _RadialStartAngle - _RadialClip; + half endAngle = _RadialStartAngle + _RadialClip2; + half offset0 = clamp(0, 360, startAngle + 360); + half offset360 = clamp(0, 360, endAngle - 360); + half2 atan2Coord = half2(lerp(-1, 1, tiledUv2.x), lerp(-1, 1, tiledUv2.y)); + half atanAngle = atan2(atan2Coord.y, atan2Coord.x) * 57.3; // angle in degrees + if(atanAngle < 0) atanAngle = 360 + atanAngle; + if(atanAngle >= startAngle && atanAngle <= endAngle) discard; + if(atanAngle <= offset360) discard; + if(atanAngle >= offset0) discard; + #endif + + //----------------------------- + + //TEXTURESCROLL_ON && ATLAS_ON + #if TEXTURESCROLL_ON && ATLAS_ON + d.texcoord0.xy = half2(_MinXUV + ((_MaxXUV - _MinXUV) * (abs(((_Time.y + randomSeed) * _TextureScrollXSpeed) + uvRect.x) % 1)), + _MinYUV + ((_MaxYUV - _MinYUV) * (abs(((_Time.y + randomSeed) * _TextureScrollYSpeed) + uvRect.y) % 1))); + #endif + //---------------------------- + + //OFFSETUV_ON + #if OFFSETUV_ON + #if ATLAS_ON + d.texcoord0.xy = half2(_MinXUV + ((_MaxXUV - _MinXUV) * (abs((_OffsetUvX + uvRect.x) % 1))), + _MinYUV + ((_MaxYUV - _MinYUV) * (abs(_OffsetUvY + uvRect.y) % 1))); + #else + d.texcoord0.xy += half2(_OffsetUvX, _OffsetUvY); + #endif + #endif + + //---------------------- + + //POLARUV_ON + #if POLARUV_ON + d.texcoord0.xy = half2(atan2(d.texcoord0.y, d.texcoord0.x) / (2.0f * 3.141592653589f), length(d.texcoord0.xy)); + d.texcoord0.xy *= _MainTex_ST.xy; + #endif + + //-------------------------------------- + + //TWISTUV_ON + #if TWISTUV_ON + #if ATLAS_ON + _TwistUvPosX = ((_MaxXUV - _MinXUV) * _TwistUvPosX) + _MinXUV; + _TwistUvPosY = ((_MaxYUV - _MinYUV) * _TwistUvPosY) + _MinYUV; + #endif + half2 tempUv = d.texcoord0.xy - half2(_TwistUvPosX * _MainTex_ST.x, _TwistUvPosY * _MainTex_ST.y); + _TwistUvRadius *= (_MainTex_ST.x + _MainTex_ST.y) / 2; + half percent = (_TwistUvRadius - length(tempUv)) / _TwistUvRadius; + half theta = percent * percent * (2.0 * sin(_TwistUvAmount)) * 8.0; + half s = sin(theta); + half c = cos(theta); + half beta = max(sign(_TwistUvRadius - length(tempUv)), 0.0); + tempUv = half2(dot(tempUv, half2(c, -s)), dot(tempUv, half2(s, c))) * beta + tempUv * (1 - beta); + tempUv += half2(_TwistUvPosX * _MainTex_ST.x, _TwistUvPosY * _MainTex_ST.y); + d.texcoord0.xy = tempUv; + #endif + + //-------------------------------------------- + + //FISHEYE_ON + #if FISHEYE_ON + half bind = length(centerTiled); + half2 dF = d.texcoord0.xy - centerTiled; + half dFlen = length(dF); + half fishInt = (3.14159265359 / bind) * (_FishEyeUvAmount + 0.001); + d.texcoord0.xy = centerTiled + (dF / (max(0.0001, dFlen))) * tan(dFlen * fishInt) * bind / tan(bind * fishInt); + #endif + //--------------------------------------------- + + //PINCH_ON + #if PINCH_ON + half2 dP = d.texcoord0.xy - centerTiled; + half pinchInt = (3.141592 / length(centerTiled)) * (-_PinchUvAmount + 0.001); + d.texcoord0.xy = centerTiled + normalize(dP) * atan(length(dP) * -pinchInt * 10.0) * 0.5 / atan(-pinchInt * 5); + #endif + + //--------------------------------------------- + + //ZOOMUV_ON + #if ZOOMUV_ON + d.texcoord0.xy -= centerTiled; + d.texcoord0.xy = d.texcoord0.xy * _ZoomUvAmount; + d.texcoord0.xy += centerTiled; + #endif + + //----------------------------------------------- + + //DOODLE_ON + #if DOODLE_ON + half2 uvCopy = uvRect; + _HandDrawnSpeed = (floor((_Time.x + randomSeed) * 20 * _HandDrawnSpeed) / _HandDrawnSpeed) * _HandDrawnSpeed; + uvCopy.x = sin((uvCopy.x * _HandDrawnAmount + _HandDrawnSpeed) * 4); + uvCopy.y = cos((uvCopy.y * _HandDrawnAmount + _HandDrawnSpeed) * 4); + d.texcoord0.xy = lerp(d.texcoord0.xy, d.texcoord0.xy + uvCopy, 0.0005 * _HandDrawnAmount); + #endif + + //-------------------------- + + //SHAKEUV_ON + #if SHAKEUV_ON + half xShake = sin((_Time.x + randomSeed) * _ShakeUvSpeed * 50) * _ShakeUvX; + half yShake = cos((_Time.x + randomSeed) * _ShakeUvSpeed * 50) * _ShakeUvY; + d.texcoord0.xy += half2(xShake * 0.012, yShake * 0.01); + #endif + + //------------------------------------------- + + //RECTSIZE_ON + #if RECTSIZE_ON + d.texcoord0.xy = d.texcoord0.xy * (_RectSize).xx + (((-_RectSize * 0.5) + 0.5)).xx; + #endif + + //------------------------------------------- + + //DISTORT_ON + #if DISTORT_ON + #if ATLAS_ON + d.texcoord3.x = d.texcoord3.x * (1 / (_MaxXUV - _MinXUV)); + d.texcoord3.y = d.texcoord3.y * (1 / (_MaxYUV - _MinYUV)); + #endif + + d.texcoord3.x += ((_Time.x + _RandomSeed) * _DistortTexXSpeed) % 1; + d.texcoord3.y += ((_Time.x + _RandomSeed) * _DistortTexYSpeed) % 1; + half distortAmnt = (SAMPLE_TEXTURE2D(_DistortTex, sampler_DistortTex, d.texcoord3.xy).r - 0.5) * 0.2 * _DistortAmount; + d.texcoord0.x += distortAmnt; + d.texcoord0.y += distortAmnt; + #endif + //------------------------------------------------------- + + //WARP_ON + #if WARP_ON + half2 warpUv = half2(d.texcoord0.x / _MainTex_ST.x, d.texcoord0.y / _MainTex_ST.y); + #if ATLAS_ON + warpUv = half2((warpUv.x - _MinXUV) / (_MaxXUV - _MinXUV), (warpUv.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + const float tau = 6.283185307179586; + float xWarp = (_Time.y + randomSeed) * _WarpSpeed + warpUv.x * tau / _WarpScale; + float yWarp = (_Time.y + randomSeed) * _WarpSpeed + warpUv.y * tau / _WarpScale; + float2 warp = float2(sin(xWarp), sin(yWarp)) * _WarpStrength; + d.texcoord0.xy += warp; + #endif + + //------------------------------------------------------- + + //WAVEUV_ON + #if WAVEUV_ON + float2 uvWave = half2(_WaveX * _MainTex_ST.x, _WaveY * _MainTex_ST.y) - d.texcoord0.xy; + uvWave %= 1; + #if ATLAS_ON + uvWave = half2(_WaveX, _WaveY) - uvRect; + #endif + uvWave.x *= _ScreenParams.x / _ScreenParams.y; + float waveTime = _Time.y + randomSeed; + float angWave = (sqrt(dot(uvWave, uvWave)) * _WaveAmount) - ((waveTime * _WaveSpeed)); + d.texcoord0.xy = d.texcoord0.xy + uvWave * sin(angWave) * (_WaveStrength / 1000.0); + #endif + //---------------------------------------------------- + + //ROUNDWAVEUV_ON + #if ROUNDWAVEUV_ON + half xWave = ((0.5 * _MainTex_ST.x) - uvRect.x); + half yWave = ((0.5 * _MainTex_ST.y) - uvRect.y) * (_MainTex_TexelSize.w / _MainTex_TexelSize.z); + half ripple = -sqrt(xWave*xWave + yWave* yWave); + d.texcoord0.xy += (sin((ripple + (_Time.y + randomSeed) * (_RoundWaveSpeed/10.0)) / 0.015) * (_RoundWaveStrength/10.0)) % 1; + #endif + //---------------------------------------------------- + + + //WIND_ON + #if WIND_ON + half windOffset = sin((_Time.x + randomSeed) * _GrassSpeed * 10); + half2 windCenter = half2(0.5, 0.1); + #if ATLAS_ON + windCenter.x = ((_MaxXUV - _MinXUV) * windCenter.x) + _MinXUV; + windCenter.y = ((_MaxYUV - _MinYUV) * windCenter.y) + _MinYUV; + #endif + #if !MANUALWIND_ON + d.texcoord0.x = fmod(abs(lerp(d.texcoord0.x, d.texcoord0.x + (_GrassWind * 0.01 * windOffset), uvRect.y)), 1); + #else + d.texcoord0.x = fmod(abs(lerp(d.texcoord0.x, d.texcoord0.x + (_GrassWind * 0.01 * _GrassManualAnim), uvRect.y)), 1); + windOffset = _GrassManualAnim; + #endif + half2 delta = d.texcoord0.xy - windCenter; + half delta2 = dot(delta.xy, delta.xy); + half2 delta_offset = delta2 * windOffset; + d.texcoord0.xy = d.texcoord0.xy + half2(delta.y, -delta.x) * delta_offset * _GrassRadialBend; + #endif + + //-------------------------------------------------------- + + //TEXTURESCROLL_ON && !ATLAS_ON + #if TEXTURESCROLL_ON && !ATLAS_ON + d.texcoord0.x += ((_Time.y + randomSeed) * _TextureScrollXSpeed) % 1; + d.texcoord0.y += ((_Time.y + randomSeed) * _TextureScrollYSpeed) % 1; + #endif + //------------------------------ + + //PIXELATE_ON + #if PIXELATE_ON + half aspectRatio = _MainTex_TexelSize.x / _MainTex_TexelSize.y; + half2 pixelSize = float2(_PixelateSize, _PixelateSize * aspectRatio); + d.texcoord0.xy = floor(d.texcoord0.xy * pixelSize) / pixelSize; + #endif + //-------------- + + half4 col = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy); + half originalAlpha = col.a; + col *= d.vertexColor; + + //NORMAL MAP + #if NORMALMAP_ON + half4 normalSample = SAMPLE_TEXTURE2D(_NormalMap, sampler_NormalMap, d.texcoord0.xy); + half3 normalTS = UnpackNormal(normalSample); + normalTS.xy *= _NormalStrength; + o.Normal = normalTS; + #endif + + + //GLITCH_ON + #if GLITCH_ON + half2 uvGlitch = uvRect; + uvGlitch.y -= 0.5; + half lineNoise = pow(rand2(floor(uvGlitch * half2(24., 19.) * _GlitchSize) * 4.0, randomSeed), 3.0) * _GlitchAmount + * pow(rand2(floor(uvGlitch * half2(38., 14.) * _GlitchSize) * 4.0, randomSeed), 3.0); + col = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(lineNoise * 0.02 * rand2(half2(2.0, 1), randomSeed), 0)) * d.vertexColor; + #endif + //-------------------------------------- + + //CHROMABERR_ON + #if CHROMABERR_ON + half4 r = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(_ChromAberrAmount/10, 0)) * d.vertexColor; + half4 b = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(-_ChromAberrAmount/10, 0)) * d.vertexColor; + col = half4(r.r * r.a, col.g, b.b * b.a, max(max(r.a, b.a) * _ChromAberrAlpha, col.a)); + #endif + + //-------------------------------- + + //BLUR_ON + #if BLUR_ON + #if ATLAS_ON + #if !BLURISHD_ON + col = BlurHD(d.texcoord0.xy, _MainTex, sampler_MainTex, _BlurIntensity, (_MaxXUV - _MinXUV), (_MaxYUV - _MinYUV)) * d.vertexColor; + #else + col = Blur(d.texcoord0.xy, _MainTex, sampler_MainTex, _BlurIntensity * (_MaxXUV - _MinXUV)) * d.vertexColor; + #endif + #else + #if !BLURISHD_ON + col = BlurHD(d.texcoord0.xy, _MainTex, sampler_MainTex, _BlurIntensity, 1, 1) * d.vertexColor; + #else + col = Blur(d.texcoord0.xy, _MainTex, sampler_MainTex, _BlurIntensity) * d.vertexColor; + #endif + #endif + #endif + + //-------------------- + + //MOTIONBLUR_ON + #if MOTIONBLUR_ON + _MotionBlurAngle = _MotionBlurAngle * 3.1415926; + #define rot(n) mul(n, half2x2(cos(_MotionBlurAngle), -sin(_MotionBlurAngle), sin(_MotionBlurAngle), cos(_MotionBlurAngle))) + _MotionBlurDist = _MotionBlurDist * 0.005; + #if ATLAS_ON + _MotionBlurDist *= (_MaxXUV - _MinXUV); + #endif + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(-_MotionBlurDist, -_MotionBlurDist))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(-_MotionBlurDist * 2, -_MotionBlurDist * 2))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(-_MotionBlurDist * 3, -_MotionBlurDist * 3))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(-_MotionBlurDist * 4, -_MotionBlurDist * 4))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(_MotionBlurDist, _MotionBlurDist))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(_MotionBlurDist * 2, _MotionBlurDist * 2))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(_MotionBlurDist * 3, _MotionBlurDist * 3))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(_MotionBlurDist * 4, _MotionBlurDist * 4))); + col.rgb = col.rgb / 9; + #endif + //------------------------------------ + + //NEGATIVE_ON + #if NEGATIVE_ON + col.rgb = lerp(col.rgb, 1 - col.rgb, _NegativeAmount); + #endif + + //-------------- + half luminance = 0; + + //GREYSCALE_ON && !GREYSCALEOUTLINE_ON + #if GREYSCALE_ON && !GREYSCALEOUTLINE_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + luminance = saturate(luminance + _GreyscaleLuminosity); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _GreyscaleTintColor, _GreyscaleBlend); + #endif + //------------------------------------ + + //GHOST_ON + #if GHOST_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + half4 ghostResult; + ghostResult.a = saturate(luminance - _GhostTransparency) * col.a; + ghostResult.rgb = col.rgb * (luminance + _GhostColorBoost); + col = lerp(col, ghostResult, _GhostBlend); + #endif + //------------------------------------ + + //INNEROUTLINE_ON + #if INNEROUTLINE_ON + half3 innerT = abs(GetPixel(0, _InnerOutlineThickness, d.texcoord0.xy, _MainTex, sampler_MainTex) - GetPixel(0, -_InnerOutlineThickness, d.texcoord0.xy, _MainTex, sampler_MainTex)); + innerT += abs(GetPixel(_InnerOutlineThickness, 0, d.texcoord0.xy, _MainTex, sampler_MainTex) - GetPixel(-_InnerOutlineThickness, 0, d.texcoord0.xy, _MainTex, sampler_MainTex)); + #if !ONLYINNEROUTLINE_ON + innerT = (innerT / 2.0) * col.a * _InnerOutlineAlpha; + col.rgb += length(innerT) * _InnerOutlineColor.rgb * _InnerOutlineGlow; + #else + innerT *= col.a * _InnerOutlineAlpha; + col.rgb = length(innerT) * _InnerOutlineColor.rgb * _InnerOutlineGlow; + col.a = step(0.3, col.r+col.g+col.b); + #endif + #endif + //------------------------------------------------------- + + //HITEFFECT_ON + #if HITEFFECT_ON + col.rgb = lerp(col.rgb, _HitEffectColor.rgb * _HitEffectGlow, _HitEffectBlend); + #endif + //-------------------- + + //GRADIENT_ON + #if GRADIENT_ON + half2 tiledUvGrad = half2(uvRect.x / _MainTex_ST.x, uvRect.y / _MainTex_ST.y); + #if GRADIENT2COL_ON + _GradTopRightCol = _GradTopLeftCol; + _GradBotRightCol = _GradBotLeftCol; + #endif + #if RADIALGRADIENT_ON + half radialDist = 1 - length(tiledUvGrad - half2(0.5, 0.5)); + radialDist *= (_MainTex_TexelSize.w / _MainTex_TexelSize.z); + radialDist = saturate(_GradBoostX * radialDist); + half4 gradientResult = lerp(_GradTopLeftCol, _GradBotLeftCol, radialDist); + #else + half gradXLerpFactor = saturate(pow(tiledUvGrad.x, _GradBoostX)); + half4 gradientResult = lerp(lerp(_GradBotLeftCol, _GradBotRightCol, gradXLerpFactor), + lerp(_GradTopLeftCol, _GradTopRightCol, gradXLerpFactor), saturate(pow(tiledUvGrad.y, _GradBoostY))); + #endif + gradientResult = lerp(col, gradientResult, _GradBlend); + col.rgb = gradientResult.rgb * col.a; + col.a *= gradientResult.a; + #endif + //-------------------------------------------------------------------- + + //CONTRAST_ON + #if CONTRAST_ON + col.rgb = (col.rgb - float3(0.5, 0.5, 0.5)) * _Contrast + float3(0.5, 0.5, 0.5); + col.rgb += _Brightness; + #endif + + //------------------------------------------------------------------- + + //COLORSWAP_ON + #if COLORSWAP_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + half4 swapMask = SAMPLE_TEXTURE2D(_ColorSwapTex, sampler_ColorSwapTex, d.texcoord0.xy); + swapMask.rgb *= swapMask.a; + half3 redSwap = _ColorSwapRed * swapMask.r * saturate(luminance + _ColorSwapRedLuminosity); + half3 greenSwap = _ColorSwapGreen * swapMask.g * saturate(luminance + _ColorSwapGreenLuminosity); + half3 blueSwap = _ColorSwapBlue * swapMask.b * saturate(luminance + _ColorSwapBlueLuminosity); + swapMask.rgb = col.rgb * saturate(1 - swapMask.r - swapMask.g - swapMask.b); + col.rgb = lerp(col.rgb, swapMask.rgb + redSwap + greenSwap + blueSwap, _ColorSwapBlend); + #endif + //-------------------------------------------------------------------- + + //COLORRAMP_ON && !COLORRAMPOUTLINE_ON + #if COLORRAMP_ON && !COLORRAMPOUTLINE_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + luminance = saturate(luminance + _ColorRampLuminosity); + #if GRADIENTCOLORRAMP_ON + col.rgb = lerp(col.rgb, SAMPLE_TEXTURE2D(_ColorRampTexGradient, sampler_ColorRampTexGradient, half2(luminance, 0)).rgb, _ColorRampBlend); + #else + col.rgb = lerp(col.rgb, SAMPLE_TEXTURE2D(_ColorRampTex, sampler_ColorRampTex, half2(luminance, 0)).rgb, _ColorRampBlend); + #endif + #endif + //-------------------------------------------------------------------- + + //CHANGECOLOR_ON + #if CHANGECOLOR_ON + float3 currChangeColor = saturate(col.rgb); + luminance = 0.3 * currChangeColor.r + 0.59 * currChangeColor.g + 0.11 * currChangeColor.b; + luminance = saturate(luminance + _ColorChangeLuminosity); + half3 dif = abs(currChangeColor - _ColorChangeTarget.rgb); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _ColorChangeNewCol.rgb, + max(sign(1 - saturate(dif.x + dif.y + dif.z) - _ColorChangeTolerance), 0.0)); + #if CHANGECOLOR2_ON + dif = abs(currChangeColor - _ColorChangeTarget2.rgb); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _ColorChangeNewCol2.rgb, + max(sign(1 - saturate(dif.x + dif.y + dif.z) - _ColorChangeTolerance2), 0.0)); + #endif + #if CHANGECOLOR3_ON + dif = abs(currChangeColor - _ColorChangeTarget3.rgb); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _ColorChangeNewCol3.rgb, + max(sign(1 - saturate(dif.x + dif.y + dif.z) - _ColorChangeTolerance3), 0.0)); + #endif + #endif + //------------------------------------------------------- + + //POSTERIZE_ON && !POSTERIZEOUTLINE_ON + #if POSTERIZE_ON && !POSTERIZEOUTLINE_ON + col.rgb = pow(col.rgb, _PosterizeGamma) * _PosterizeNumColors; + col.rgb = floor(col.rgb) / _PosterizeNumColors; + col.rgb = pow(col.rgb, 1.0 / _PosterizeGamma); + #endif + //------------------------------------ + + //HSV_ON + #if HSV_ON + half3 resultHsv = half3(col.rgb); + half cosHsv = _HsvBright * _HsvSaturation * cos(_HsvShift * 3.14159265 / 180); + half sinHsv = _HsvBright * _HsvSaturation * sin(_HsvShift * 3.14159265 / 180); + resultHsv.x = (.299 * _HsvBright + .701 * cosHsv + .168 * sinHsv) * col.x + + (.587 * _HsvBright - .587 * cosHsv + .330 * sinHsv) * col.y + + (.114 * _HsvBright - .114 * cosHsv - .497 * sinHsv) * col.z; + resultHsv.y = (.299 * _HsvBright - .299 * cosHsv - .328 * sinHsv) *col.x + + (.587 * _HsvBright + .413 * cosHsv + .035 * sinHsv) * col.y + + (.114 * _HsvBright - .114 * cosHsv + .292 * sinHsv) * col.z; + resultHsv.z = (.299 * _HsvBright - .3 * cosHsv + 1.25 * sinHsv) * col.x + + (.587 * _HsvBright - .588 * cosHsv - 1.05 * sinHsv) * col.y + + (.114 * _HsvBright + .886 * cosHsv - .203 * sinHsv) * col.z; + col.rgb = resultHsv; + #endif + //------------------------------------------------------- + + //OVERLAY_ON + #if OVERLAY_ON + half2 overlayUvs = d.texcoord0.xy; + overlayUvs.x += ((_Time.y + randomSeed) * _OverlayTextureScrollXSpeed) % 1; + overlayUvs.y += ((_Time.y + randomSeed) * _OverlayTextureScrollYSpeed) % 1; + half4 overlayCol = SAMPLE_TEXTURE2D(_OverlayTex, sampler_OverlayTex, TRANSFORM_TEX(overlayUvs, _OverlayTex)); + overlayCol.rgb *= _OverlayColor.rgb * _OverlayGlow; + #if !OVERLAYMULT_ON + overlayCol.rgb *= overlayCol.a * _OverlayColor.rgb * _OverlayColor.a * _OverlayBlend; + col.rgb += overlayCol.rgb; + #else + overlayCol.a *= _OverlayColor.a; + col = lerp(col, col * overlayCol, _OverlayBlend); + #endif + #endif + + //--------------------------------- + + //OUTBASE_ON + #if OUTBASE_ON + #if OUTBASEPIXELPERF_ON + half2 destUv = half2(_OutlinePixelWidth * _MainTex_TexelSize.x, _OutlinePixelWidth * _MainTex_TexelSize.y); + #else + half2 destUv = half2(_OutlineWidth * _MainTex_TexelSize.x * 200, _OutlineWidth * _MainTex_TexelSize.y * 200); + #endif + + #if OUTDIST_ON + d.texcoord3.x += ((_Time.x + _RandomSeed) * _OutlineDistortTexXSpeed) % 1; + d.texcoord3.y += ((_Time.x + _RandomSeed) * _OutlineDistortTexYSpeed) % 1; + #if ATLAS_ON + d.texcoord3 = half2((d.texcoord3.x - _MinXUV) / (_MaxXUV - _MinXUV), (d.texcoord3.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half outDistortAmnt = (SAMPLE_TEXTURE2D(_OutlineDistortTex, sampler_OutlineDistortTex, d.texcoord3).r - 0.5) * 0.2 * _OutlineDistortAmount; + destUv.x += outDistortAmnt; + destUv.y += outDistortAmnt; + #endif + + half spriteLeft = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(destUv.x, 0)).a; + half spriteRight = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy - half2(destUv.x, 0)).a; + half spriteBottom = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(0, destUv.y)).a; + half spriteTop = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy - half2(0, destUv.y)).a; + half result = spriteLeft + spriteRight + spriteBottom + spriteTop; + + #if OUTBASE8DIR_ON + half spriteTopLeft = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(destUv.x, destUv.y)).a; + half spriteTopRight = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(-destUv.x, destUv.y)).a; + half spriteBotLeft = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(destUv.x, -destUv.y)).a; + half spriteBotRight = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(-destUv.x, -destUv.y)).a; + result = result + spriteTopLeft + spriteTopRight + spriteBotLeft + spriteBotRight; + #endif + + result = step(0.05, saturate(result)); + + #if OUTTEX_ON + d.texcoord1.x += ((_Time.x + _RandomSeed) * _OutlineTexXSpeed) % 1; + d.texcoord1.y += ((_Time.x + _RandomSeed) * _OutlineTexYSpeed) % 1; + #if ATLAS_ON + d.texcoord1 = half2((d.texcoord1.x - _MinXUV) / (_MaxXUV - _MinXUV), (d.texcoord1.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half4 tempOutColor = SAMPLE_TEXTURE2D(_OutlineTex, sampler_OutlineTex, d.texcoord1); + tempOutColor *= _OutlineColor; + _OutlineColor = tempOutColor; + #endif + + result *= (1 - originalAlpha) * _OutlineAlpha; + + half4 outline = _OutlineColor * d.vertexColor.a; + outline.rgb *= _OutlineGlow; + outline.a = result; + #if ONLYOUTLINE_ON + col = outline; + #else + col = lerp(col, outline, result); + #endif + #endif + //------------------------------------------------------- + + //FADE_ON + #if FADE_ON + half2 tiledUvFade1 = TRANSFORM_TEX(d.texcoord0, _FadeTex); + half2 tiledUvFade2 = TRANSFORM_TEX(d.texcoord0, _FadeBurnTex); + #if ATLAS_ON + tiledUvFade1 = half2((tiledUvFade1.x - _MinXUV) / (_MaxXUV - _MinXUV), (tiledUvFade1.y - _MinYUV) / (_MaxYUV - _MinYUV)); + tiledUvFade2 = half2((tiledUvFade2.x - _MinXUV) / (_MaxXUV - _MinXUV), (tiledUvFade2.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half fadeTemp = SAMPLE_TEXTURE2D(_FadeTex, sampler_FadeTex, tiledUvFade1).r; + half fade = smoothstep(_FadeAmount, _FadeAmount + _FadeBurnTransition, fadeTemp); + half fadeBurn = saturate(smoothstep(_FadeAmount - _FadeBurnWidth, _FadeAmount - _FadeBurnWidth + 0.1, fadeTemp) * _FadeAmount); + col.a *= fade; + _FadeBurnColor.rgb *= _FadeBurnGlow; + col += fadeBurn * SAMPLE_TEXTURE2D(_FadeBurnTex, sampler_FadeBurnTex, tiledUvFade2) * _FadeBurnColor * originalAlpha * (1 - col.a); + #endif + //------------------------------------------------------- + + //SHADOW_ON + #if SHADOW_ON + half shadowA = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(_ShadowX, _ShadowY)).a; + half preMultShadowMask = 1 - (saturate(shadowA - col.a) * (1 - col.a)); + col.rgb *= 1 - ((shadowA - col.a) * (1 - col.a)); + col.rgb += (_ShadowColor * shadowA) * (1 - col.a); + col.a = max(shadowA * _ShadowAlpha * d.vertexColor.a, col.a); + #endif + + //------------------------------------------------------- + + //GLOW_ON + #if GLOW_ON + half4 emission; + #if GLOWTEX_ON + emission = SAMPLE_TEXTURE2D(_GlowTex, sampler_GlowTex, d.texcoord0); + #else + emission = col; + #endif + + col.rgb *= _GlowGlobal; + emission.rgb *= emission.a * col.a * _Glow * _GlowColor; + col.rgb += emission.rgb; + #endif + //------------------------------------------------------- + + //COLORRAMP_ON && COLORRAMPOUTLINE_ON + #if COLORRAMP_ON && COLORRAMPOUTLINE_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + luminance = saturate(luminance + _ColorRampLuminosity); + #if GRADIENTCOLORRAMP_ON + col.rgb = lerp(col.rgb, SAMPLE_TEXTURE2D(_ColorRampTexGradient, sampler_ColorRampTexGradient, half2(luminance, 0)).rgb, _ColorRampBlend); + #else + col.rgb = lerp(col.rgb, SAMPLE_TEXTURE2D(_ColorRampTex, sampler_ColorRampTex, half2(luminance, 0)).rgb, _ColorRampBlend); + #endif + #endif + //--------------- + + //GREYSCALE_ON && GREYSCALEOUTLINE_ON + #if GREYSCALE_ON && GREYSCALEOUTLINE_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + luminance = saturate(luminance + _GreyscaleLuminosity); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _GreyscaleTintColor, _GreyscaleBlend); + #endif + + //----------------------------------- + + //POSTERIZE_ON && POSTERIZEOUTLINE_ON + #if POSTERIZE_ON && POSTERIZEOUTLINE_ON + col.rgb = pow(col.rgb, _PosterizeGamma) * _PosterizeNumColors; + col.rgb = floor(col.rgb) / _PosterizeNumColors; + col.rgb = pow(col.rgb, 1.0 / _PosterizeGamma); + #endif + + //----------------------------------- + + //SHINE_ON + #if SHINE_ON + half2 uvShine = uvRect; + half cosAngle = cos(_ShineRotate); + half sinAngle = sin(_ShineRotate); + half2x2 rot = half2x2(cosAngle, -sinAngle, sinAngle, cosAngle); + uvShine -= half2(0.5, 0.5); + uvShine = mul(rot, uvShine); + uvShine += half2(0.5, 0.5); + half shineMask = SAMPLE_TEXTURE2D(_ShineMask, sampler_ShineMask, d.texcoord0.xy).a; + half currentDistanceProjection = (uvShine.x + uvShine.y) / 2; + half whitePower = 1 - (abs(currentDistanceProjection - _ShineLocation) / _ShineWidth); + col.rgb += col.a * whitePower * _ShineGlow * max(sign(currentDistanceProjection - (_ShineLocation - _ShineWidth)), 0.0) + * max(sign((_ShineLocation + _ShineWidth) - currentDistanceProjection), 0.0) * _ShineColor * shineMask; + #endif + + //----------------------------------- + + //HOLOGRAM_ON + #if HOLOGRAM_ON + half totalHologram = _HologramStripesAmount + _HologramUnmodAmount; + half hologramYCoord = ((uvRect.y + (((_Time.x + randomSeed) % 1) * _HologramStripesSpeed)) % totalHologram) / totalHologram; + hologramYCoord = abs(hologramYCoord); + half alpha = RemapFloat(saturate(hologramYCoord - (_HologramUnmodAmount/totalHologram)), 0.0, 1.0, _HologramMinAlpha, saturate(_HologramMaxAlpha)); + half hologramMask = max(sign((_HologramUnmodAmount/totalHologram) - hologramYCoord), 0.0); + half4 hologramResult = col; + hologramResult.a *= lerp(alpha, 1, hologramMask); + hologramResult.rgb *= max(1, _HologramMaxAlpha * max(sign(hologramYCoord - (_HologramUnmodAmount/totalHologram)), 0.0)); + hologramMask = 1 - step(0.01,hologramMask); + hologramResult.rgb += hologramMask * _HologramStripeColor * col.a; + col = lerp(col, hologramResult, _HologramBlend); + #endif + + //----------------------------------- + + //FLICKER_ON + #if FLICKER_ON + col.a *= saturate(col.a * step(frac(0.05 + (_Time.w + randomSeed) * _FlickerFreq), 1 - _FlickerPercent) + _FlickerAlpha); + #endif + //----------------------------------- + + //ALPHACUTOFF_ON + + //ALPHAROUND_ON + + //ALPHAOUTLINE_ON + #if ALPHAOUTLINE_ON + half alphaOutlineRes = pow(1 - col.a, max(_AlphaOutlinePower, 0.0001)) * step(_AlphaOutlineMinAlpha, col.a) * _AlphaOutlineBlend; + col.rgb = lerp(col.rgb, _AlphaOutlineColor.rgb * _AlphaOutlineGlow, alphaOutlineRes); + col.a = lerp(col.a, 1, alphaOutlineRes > 1); + #endif + //------------------------------------------------------- + + //FOG_ON + + //------------------ + + col *= _Color; + o.Albedo = col; + col.a *= _Alpha; + clip(col.a - _AlphaCutoffValue - 0.01); + o.Alpha = _Color.a; + } + + + + + + void ChainSurfaceFunction(inout Surface l, inout ShaderData d) + { + Ext_SurfaceFunction0(l, d); + // Ext_SurfaceFunction1(l, d); + // Ext_SurfaceFunction2(l, d); + // Ext_SurfaceFunction3(l, d); + // Ext_SurfaceFunction4(l, d); + // Ext_SurfaceFunction5(l, d); + // Ext_SurfaceFunction6(l, d); + // Ext_SurfaceFunction7(l, d); + // Ext_SurfaceFunction8(l, d); + // Ext_SurfaceFunction9(l, d); + // Ext_SurfaceFunction10(l, d); + // Ext_SurfaceFunction11(l, d); + // Ext_SurfaceFunction12(l, d); + // Ext_SurfaceFunction13(l, d); + // Ext_SurfaceFunction14(l, d); + // Ext_SurfaceFunction15(l, d); + // Ext_SurfaceFunction16(l, d); + // Ext_SurfaceFunction17(l, d); + // Ext_SurfaceFunction18(l, d); + // Ext_SurfaceFunction19(l, d); + // Ext_SurfaceFunction20(l, d); + // Ext_SurfaceFunction21(l, d); + // Ext_SurfaceFunction22(l, d); + // Ext_SurfaceFunction23(l, d); + // Ext_SurfaceFunction24(l, d); + // Ext_SurfaceFunction25(l, d); + // Ext_SurfaceFunction26(l, d); + // Ext_SurfaceFunction27(l, d); + // Ext_SurfaceFunction28(l, d); + // Ext_SurfaceFunction29(l, d); + } + +#if !_DECALSHADER + + void ChainModifyVertex(inout VertexData v, inout VertexToPixel v2p, float4 time) + { + ExtraV2F d; + + ZERO_INITIALIZE(ExtraV2F, d); + ZERO_INITIALIZE(Blackboard, d.blackboard); + // due to motion vectors in HDRP, we need to use the last + // time in certain spots. So if you are going to use _Time to adjust vertices, + // you need to use this time or motion vectors will break. + d.time = time; + + Ext_ModifyVertex0(v, d); + // Ext_ModifyVertex1(v, d); + // Ext_ModifyVertex2(v, d); + // Ext_ModifyVertex3(v, d); + // Ext_ModifyVertex4(v, d); + // Ext_ModifyVertex5(v, d); + // Ext_ModifyVertex6(v, d); + // Ext_ModifyVertex7(v, d); + // Ext_ModifyVertex8(v, d); + // Ext_ModifyVertex9(v, d); + // Ext_ModifyVertex10(v, d); + // Ext_ModifyVertex11(v, d); + // Ext_ModifyVertex12(v, d); + // Ext_ModifyVertex13(v, d); + // Ext_ModifyVertex14(v, d); + // Ext_ModifyVertex15(v, d); + // Ext_ModifyVertex16(v, d); + // Ext_ModifyVertex17(v, d); + // Ext_ModifyVertex18(v, d); + // Ext_ModifyVertex19(v, d); + // Ext_ModifyVertex20(v, d); + // Ext_ModifyVertex21(v, d); + // Ext_ModifyVertex22(v, d); + // Ext_ModifyVertex23(v, d); + // Ext_ModifyVertex24(v, d); + // Ext_ModifyVertex25(v, d); + // Ext_ModifyVertex26(v, d); + // Ext_ModifyVertex27(v, d); + // Ext_ModifyVertex28(v, d); + // Ext_ModifyVertex29(v, d); + + + // #if %EXTRAV2F0REQUIREKEY% + // v2p.extraV2F0 = d.extraV2F0; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // v2p.extraV2F1 = d.extraV2F1; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // v2p.extraV2F2 = d.extraV2F2; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // v2p.extraV2F3 = d.extraV2F3; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // v2p.extraV2F4 = d.extraV2F4; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // v2p.extraV2F5 = d.extraV2F5; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // v2p.extraV2F6 = d.extraV2F6; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // v2p.extraV2F7 = d.extraV2F7; + // #endif + } + + void ChainModifyTessellatedVertex(inout VertexData v, inout VertexToPixel v2p) + { + ExtraV2F d; + ZERO_INITIALIZE(ExtraV2F, d); + ZERO_INITIALIZE(Blackboard, d.blackboard); + + // #if %EXTRAV2F0REQUIREKEY% + // d.extraV2F0 = v2p.extraV2F0; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // d.extraV2F1 = v2p.extraV2F1; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // d.extraV2F2 = v2p.extraV2F2; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // d.extraV2F3 = v2p.extraV2F3; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // d.extraV2F4 = v2p.extraV2F4; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // d.extraV2F5 = v2p.extraV2F5; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // d.extraV2F6 = v2p.extraV2F6; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // d.extraV2F7 = v2p.extraV2F7; + // #endif + + + // Ext_ModifyTessellatedVertex0(v, d); + // Ext_ModifyTessellatedVertex1(v, d); + // Ext_ModifyTessellatedVertex2(v, d); + // Ext_ModifyTessellatedVertex3(v, d); + // Ext_ModifyTessellatedVertex4(v, d); + // Ext_ModifyTessellatedVertex5(v, d); + // Ext_ModifyTessellatedVertex6(v, d); + // Ext_ModifyTessellatedVertex7(v, d); + // Ext_ModifyTessellatedVertex8(v, d); + // Ext_ModifyTessellatedVertex9(v, d); + // Ext_ModifyTessellatedVertex10(v, d); + // Ext_ModifyTessellatedVertex11(v, d); + // Ext_ModifyTessellatedVertex12(v, d); + // Ext_ModifyTessellatedVertex13(v, d); + // Ext_ModifyTessellatedVertex14(v, d); + // Ext_ModifyTessellatedVertex15(v, d); + // Ext_ModifyTessellatedVertex16(v, d); + // Ext_ModifyTessellatedVertex17(v, d); + // Ext_ModifyTessellatedVertex18(v, d); + // Ext_ModifyTessellatedVertex19(v, d); + // Ext_ModifyTessellatedVertex20(v, d); + // Ext_ModifyTessellatedVertex21(v, d); + // Ext_ModifyTessellatedVertex22(v, d); + // Ext_ModifyTessellatedVertex23(v, d); + // Ext_ModifyTessellatedVertex24(v, d); + // Ext_ModifyTessellatedVertex25(v, d); + // Ext_ModifyTessellatedVertex26(v, d); + // Ext_ModifyTessellatedVertex27(v, d); + // Ext_ModifyTessellatedVertex28(v, d); + // Ext_ModifyTessellatedVertex29(v, d); + + // #if %EXTRAV2F0REQUIREKEY% + // v2p.extraV2F0 = d.extraV2F0; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // v2p.extraV2F1 = d.extraV2F1; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // v2p.extraV2F2 = d.extraV2F2; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // v2p.extraV2F3 = d.extraV2F3; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // v2p.extraV2F4 = d.extraV2F4; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // v2p.extraV2F5 = d.extraV2F5; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // v2p.extraV2F6 = d.extraV2F6; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // v2p.extraV2F7 = d.extraV2F7; + // #endif + } + + void ChainFinalColorForward(inout Surface l, inout ShaderData d, inout half4 color) + { + // Ext_FinalColorForward0(l, d, color); + // Ext_FinalColorForward1(l, d, color); + // Ext_FinalColorForward2(l, d, color); + // Ext_FinalColorForward3(l, d, color); + // Ext_FinalColorForward4(l, d, color); + // Ext_FinalColorForward5(l, d, color); + // Ext_FinalColorForward6(l, d, color); + // Ext_FinalColorForward7(l, d, color); + // Ext_FinalColorForward8(l, d, color); + // Ext_FinalColorForward9(l, d, color); + // Ext_FinalColorForward10(l, d, color); + // Ext_FinalColorForward11(l, d, color); + // Ext_FinalColorForward12(l, d, color); + // Ext_FinalColorForward13(l, d, color); + // Ext_FinalColorForward14(l, d, color); + // Ext_FinalColorForward15(l, d, color); + // Ext_FinalColorForward16(l, d, color); + // Ext_FinalColorForward17(l, d, color); + // Ext_FinalColorForward18(l, d, color); + // Ext_FinalColorForward19(l, d, color); + // Ext_FinalColorForward20(l, d, color); + // Ext_FinalColorForward21(l, d, color); + // Ext_FinalColorForward22(l, d, color); + // Ext_FinalColorForward23(l, d, color); + // Ext_FinalColorForward24(l, d, color); + // Ext_FinalColorForward25(l, d, color); + // Ext_FinalColorForward26(l, d, color); + // Ext_FinalColorForward27(l, d, color); + // Ext_FinalColorForward28(l, d, color); + // Ext_FinalColorForward29(l, d, color); + } + + void ChainFinalGBufferStandard(inout Surface s, inout ShaderData d, inout half4 GBuffer0, inout half4 GBuffer1, inout half4 GBuffer2, inout half4 outEmission, inout half4 outShadowMask) + { + // Ext_FinalGBufferStandard0(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard1(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard2(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard3(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard4(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard5(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard6(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard7(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard8(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard9(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard10(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard11(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard12(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard13(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard14(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard15(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard16(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard17(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard18(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard19(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard20(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard21(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard22(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard23(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard24(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard25(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard26(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard27(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard28(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard29(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + } +#endif + + + + + +#if _DECALSHADER + + ShaderData CreateShaderData(SurfaceDescriptionInputs IN) + { + ShaderData d = (ShaderData)0; + d.TBNMatrix = float3x3(IN.WorldSpaceTangent, IN.WorldSpaceBiTangent, IN.WorldSpaceNormal); + d.worldSpaceNormal = IN.WorldSpaceNormal; + d.worldSpaceTangent = IN.WorldSpaceTangent; + + d.worldSpacePosition = IN.WorldSpacePosition; + d.texcoord0 = IN.uv0.xyxy; + d.screenPos = IN.ScreenPosition; + + d.worldSpaceViewDir = normalize(_WorldSpaceCameraPos - d.worldSpacePosition); + + d.tangentSpaceViewDir = mul(d.TBNMatrix, d.worldSpaceViewDir); + + // these rarely get used, so we back transform them. Usually will be stripped. + #if _HDRP + // d.localSpacePosition = mul(GetWorldToObjectMatrix(), float4(GetCameraRelativePositionWS(d.worldSpacePosition), 1)).xyz; + #else + // d.localSpacePosition = mul(GetWorldToObjectMatrix(), float4(d.worldSpacePosition, 1)).xyz; + #endif + // d.localSpaceNormal = normalize(mul((float3x3)GetWorldToObjectMatrix(), d.worldSpaceNormal)); + // d.localSpaceTangent = normalize(mul((float3x3)GetWorldToObjectMatrix(), d.worldSpaceTangent.xyz)); + + // #if %SCREENPOSREQUIREKEY% + // d.screenUV = (IN.ScreenPosition.xy / max(0.01, IN.ScreenPosition.w)); + // #endif + + return d; + } +#else + + ShaderData CreateShaderData(VertexToPixel i + #if NEED_FACING + , bool facing + #endif + ) + { + ShaderData d = (ShaderData)0; + d.clipPos = i.pos; + d.worldSpacePosition = i.worldPos; + + d.worldSpaceNormal = normalize(i.worldNormal); + d.worldSpaceTangent.xyz = normalize(i.worldTangent.xyz); + + d.tangentSign = i.worldTangent.w * unity_WorldTransformParams.w; + float3 bitangent = cross(d.worldSpaceTangent.xyz, d.worldSpaceNormal) * d.tangentSign; + + d.TBNMatrix = float3x3(d.worldSpaceTangent, -bitangent, d.worldSpaceNormal); + d.worldSpaceViewDir = normalize(_WorldSpaceCameraPos - i.worldPos); + + d.tangentSpaceViewDir = mul(d.TBNMatrix, d.worldSpaceViewDir); + d.texcoord0 = i.texcoord0; + d.texcoord1 = i.texcoord1; + d.texcoord2 = i.texcoord2; + + // #if %TEXCOORD3REQUIREKEY% + d.texcoord3 = i.texcoord3; + // #endif + + // d.isFrontFace = facing; + // #if %VERTEXCOLORREQUIREKEY% + d.vertexColor = i.vertexColor; + // #endif + + // these rarely get used, so we back transform them. Usually will be stripped. + #if _HDRP + // d.localSpacePosition = mul(GetWorldToObjectMatrix(), float4(GetCameraRelativePositionWS(i.worldPos), 1)).xyz; + #else + // d.localSpacePosition = mul(GetWorldToObjectMatrix(), float4(i.worldPos, 1)).xyz; + #endif + // d.localSpaceNormal = normalize(mul((float3x3)GetWorldToObjectMatrix(), i.worldNormal)); + // d.localSpaceTangent = normalize(mul((float3x3)GetWorldToObjectMatrix(), i.worldTangent.xyz)); + + // #if %SCREENPOSREQUIREKEY% + // d.screenPos = i.screenPos; + // d.screenUV = (i.screenPos.xy / i.screenPos.w); + // #endif + + + // #if %EXTRAV2F0REQUIREKEY% + // d.extraV2F0 = i.extraV2F0; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // d.extraV2F1 = i.extraV2F1; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // d.extraV2F2 = i.extraV2F2; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // d.extraV2F3 = i.extraV2F3; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // d.extraV2F4 = i.extraV2F4; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // d.extraV2F5 = i.extraV2F5; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // d.extraV2F6 = i.extraV2F6; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // d.extraV2F7 = i.extraV2F7; + // #endif + + return d; + } + +#endif + + + #if _PASSSHADOW + float3 _LightDirection; + #endif + + // vertex shader + VertexToPixel Vert (VertexData v) + { + + VertexToPixel o = (VertexToPixel)0; + + UNITY_SETUP_INSTANCE_ID(v); + UNITY_TRANSFER_INSTANCE_ID(v, o); + UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o); + + +#if !_TESSELLATION_ON + ChainModifyVertex(v, o, _Time); +#endif + + o.texcoord0 = v.texcoord0; + o.texcoord1 = v.texcoord1; + o.texcoord2 = v.texcoord2; + + // #if %TEXCOORD3REQUIREKEY% + o.texcoord3 = v.texcoord3; + // #endif + + // #if %VERTEXCOLORREQUIREKEY% + o.vertexColor = v.vertexColor; + // #endif + + VertexPositionInputs vertexInput = GetVertexPositionInputs(v.vertex.xyz); + o.worldPos = TransformObjectToWorld(v.vertex.xyz); + o.worldNormal = TransformObjectToWorldNormal(v.normal); + o.worldTangent = float4(TransformObjectToWorldDir(v.tangent.xyz), v.tangent.w); + + + #if _PASSSHADOW + // Define shadow pass specific clip position for Universal + o.pos = TransformWorldToHClip(ApplyShadowBias(o.worldPos, o.worldNormal, _LightDirection)); + #if UNITY_REVERSED_Z + o.pos.z = min(o.pos.z, o.pos.w * UNITY_NEAR_CLIP_VALUE); + #else + o.pos.z = max(o.pos.z, o.pos.w * UNITY_NEAR_CLIP_VALUE); + #endif + #elif _PASSMETA + o.pos = MetaVertexPosition(float4(v.vertex.xyz, 0), v.texcoord1.xy, v.texcoord2.xy, unity_LightmapST, unity_DynamicLightmapST); + #else + o.pos = TransformWorldToHClip(o.worldPos); + #endif + + + // #if %SCREENPOSREQUIREKEY% + // o.screenPos = ComputeScreenPos(o.pos, _ProjectionParams.x); + // #endif + + #if _PASSFORWARD || _PASSGBUFFER + float2 uv1 = v.texcoord1.xy; + OUTPUT_LIGHTMAP_UV(uv1, unity_LightmapST, o.lightmapUV); + o.texcoord1.xy = uv1; + OUTPUT_SH(o.worldNormal, o.sh); + #endif + + #ifdef VARYINGS_NEED_FOG_AND_VERTEX_LIGHT + #if _BAKEDLIT + half3 vertexLight = 0; + #else + half3 vertexLight = VertexLighting(o.worldPos, o.worldNormal); + #endif + half fogFactor = ComputeFogFactor(o.pos.z); + o.fogFactorAndVertexLight = half4(fogFactor, vertexLight); + #endif + + #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR) + o.shadowCoord = GetShadowCoord(vertexInput); + #endif + + return o; + } + + + + + // fragment shader + half4 Frag (VertexToPixel IN + #ifdef _DEPTHOFFSET_ON + , out float outputDepth : SV_Depth + #endif + #if NEED_FACING + , bool facing : SV_IsFrontFace + #endif + ) : SV_Target + { + UNITY_SETUP_INSTANCE_ID(IN); + UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX(IN); + + ShaderData d = CreateShaderData(IN + #if NEED_FACING + , facing + #endif + ); + Surface l = (Surface)0; + + #ifdef _DEPTHOFFSET_ON + l.outputDepth = outputDepth; + #endif + + l.Albedo = half3(0.5, 0.5, 0.5); + l.Normal = float3(0,0,1); + l.Occlusion = 1; + l.Alpha = 1; + + ChainSurfaceFunction(l, d); + + #ifdef _DEPTHOFFSET_ON + outputDepth = l.outputDepth; + #endif + + #if _USESPECULAR || _SIMPLELIT + float3 specular = l.Specular; + float metallic = 1; + #else + float3 specular = 0; + float metallic = l.Metallic; + #endif + + + + + InputData inputData; + + inputData.positionWS = IN.worldPos; + #if _WORLDSPACENORMAL + inputData.normalWS = l.Normal; + #else + inputData.normalWS = normalize(TangentToWorldSpace(d, l.Normal)); + #endif + + inputData.viewDirectionWS = SafeNormalize(d.worldSpaceViewDir); + + + #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR) + inputData.shadowCoord = IN.shadowCoord; + #elif defined(MAIN_LIGHT_CALCULATE_SHADOWS) + inputData.shadowCoord = TransformWorldToShadowCoord(IN.worldPos); + #else + inputData.shadowCoord = float4(0, 0, 0, 0); + #endif + + inputData.fogCoord = IN.fogFactorAndVertexLight.x; + inputData.vertexLighting = IN.fogFactorAndVertexLight.yzw; + #if defined(_OVERRIDE_BAKEDGI) + inputData.bakedGI = l.DiffuseGI; + l.Emission += l.SpecularGI; + #else + inputData.bakedGI = SAMPLE_GI(IN.lightmapUV, IN.sh, inputData.normalWS); + #endif + inputData.normalizedScreenSpaceUV = GetNormalizedScreenSpaceUV(IN.pos); + #if !_BAKEDLIT + inputData.shadowMask = SAMPLE_SHADOWMASK(IN.lightmapUV); + + #if defined(_OVERRIDE_SHADOWMASK) + float4 mulColor = saturate(dot(l.ShadowMask, _MainLightOcclusionProbes)); //unity_OcclusionMaskSelector)); + inputData.shadowMask = mulColor; + #endif + #endif + + #if !_UNLIT + #if _SIMPLELIT + half4 color = UniversalFragmentBlinnPhong( + inputData, + l.Albedo, + float4(specular * l.Smoothness, 0), + l.SpecularPower * 128, + l.Emission, + l.Alpha); + color.a = l.Alpha; + #elif _BAKEDLIT + color = UniversalFragmentBakedLit(inputData, l.Albedo, l.Alpha, normalTS); + #else + + + SurfaceData surface = (SurfaceData)0; + surface.albedo = l.Albedo; + surface.metallic = saturate(metallic); + surface.specular = specular; + surface.smoothness = saturate(l.Smoothness), + surface.occlusion = l.Occlusion, + surface.emission = l.Emission, + surface.alpha = saturate(l.Alpha); + surface.clearCoatMask = 0; + surface.clearCoatSmoothness = 1; + + #ifdef _CLEARCOAT + surface.clearCoatMask = saturate(l.CoatMask); + surface.clearCoatSmoothness = saturate(l.CoatSmoothness); + #endif + + half4 color = UniversalFragmentPBR(inputData, surface); + + #endif + + #else + half4 color = half4(l.Albedo, l.Alpha); + + #endif + + #if !DISABLEFOG + color.rgb = MixFog(color.rgb, IN.fogFactorAndVertexLight.x); + #endif + ChainFinalColorForward(l, d, color); + + return color; + + } + + ENDHLSL + + } + + + + + Pass + { + Name "ShadowCaster" + Tags + { + "LightMode" = "ShadowCaster" + } + + // Render State + Blend One Zero, One Zero + Cull Back + ZTest LEqual + ZWrite On + // ColorMask: + + Tags { "RenderType" = "Opaque" "Queue" = "Geometry" "PreviewType" = "Plane" } + Cull [_CullingOption] + ZWrite [_ZWrite] + ZTest [_ZTestMode] + + + HLSLPROGRAM + + #pragma vertex Vert + #pragma fragment Frag + + #pragma target 3.0 + + #pragma prefer_hlslcc gles + #pragma exclude_renderers d3d11_9x + #pragma multi_compile_instancing + + #define _NORMAL_DROPOFF_TS 1 + #define ATTRIBUTES_NEED_NORMAL + #define ATTRIBUTES_NEED_TANGENT + #define SHADERPASS_SHADOWCASTER + #define _PASSSHADOW 1 + + + #pragma shader_feature_local GLOW_ON + #pragma shader_feature_local FADE_ON + #pragma shader_feature_local OUTBASE_ON + #pragma shader_feature_local ONLYOUTLINE_ON + #pragma shader_feature_local GRADIENT_ON + #pragma shader_feature_local GRADIENT2COL_ON + #pragma shader_feature_local RADIALGRADIENT_ON + #pragma shader_feature_local COLORSWAP_ON + #pragma shader_feature_local HSV_ON + #pragma shader_feature_local CHANGECOLOR_ON + #pragma shader_feature_local CHANGECOLOR2_ON + #pragma shader_feature_local CHANGECOLOR3_ON + #pragma shader_feature_local COLORRAMP_ON + #pragma shader_feature_local GRADIENTCOLORRAMP_ON + #pragma shader_feature_local HITEFFECT_ON + #pragma shader_feature_local NEGATIVE_ON + #pragma shader_feature_local PIXELATE_ON + #pragma shader_feature_local GREYSCALE_ON + #pragma shader_feature_local POSTERIZE_ON + #pragma shader_feature_local BLUR_ON + #pragma shader_feature_local MOTIONBLUR_ON + #pragma shader_feature_local GHOST_ON + #pragma shader_feature_local ALPHAOUTLINE_ON + #pragma shader_feature_local INNEROUTLINE_ON + #pragma shader_feature_local ONLYINNEROUTLINE_ON + #pragma shader_feature_local HOLOGRAM_ON + #pragma shader_feature_local CHROMABERR_ON + #pragma shader_feature_local GLITCH_ON + #pragma shader_feature_local FLICKER_ON + #pragma shader_feature_local SHADOW_ON + #pragma shader_feature_local SHINE_ON + #pragma shader_feature_local CONTRAST_ON + #pragma shader_feature_local OVERLAY_ON + #pragma shader_feature_local OVERLAYMULT_ON + #pragma shader_feature_local DOODLE_ON + #pragma shader_feature_local WIND_ON + #pragma shader_feature_local WAVEUV_ON + #pragma shader_feature_local ROUNDWAVEUV_ON + #pragma shader_feature_local RECTSIZE_ON + #pragma shader_feature_local OFFSETUV_ON + #pragma shader_feature_local CLIPPING_ON + #pragma shader_feature_local RADIALCLIPPING_ON + #pragma shader_feature_local TEXTURESCROLL_ON + #pragma shader_feature_local ZOOMUV_ON + #pragma shader_feature_local DISTORT_ON + #pragma shader_feature_local WARP_ON + #pragma shader_feature_local TWISTUV_ON + #pragma shader_feature_local ROTATEUV_ON + #pragma shader_feature_local POLARUV_ON + #pragma shader_feature_local FISHEYE_ON + #pragma shader_feature_local PINCH_ON + #pragma shader_feature_local SHAKEUV_ON + + #pragma shader_feature_local GLOWTEX_ON + #pragma shader_feature_local OUTTEX_ON + #pragma shader_feature_local OUTDIST_ON + #pragma shader_feature_local OUTBASE8DIR_ON + #pragma shader_feature_local OUTBASEPIXELPERF_ON + #pragma shader_feature_local COLORRAMPOUTLINE_ON + #pragma shader_feature_local GREYSCALEOUTLINE_ON + #pragma shader_feature_local POSTERIZEOUTLINE_ON + #pragma shader_feature_local BLURISHD_ON + #pragma shader_feature_local MANUALWIND_ON + #pragma shader_feature_local ATLAS_ON + #pragma shader_feature_local PREMULTIPLYALPHA_ON + + #pragma shader_feature BILBOARD_ON + #pragma shader_feature BILBOARDY_ON + + #pragma shader_feature NORMALMAP_ON + + + #define _URP 1 +#define _USINGTEXCOORD1 1 +#define _USINGTEXCOORD2 1 + + + #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Color.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.universal/ShaderLibrary/ShaderGraphFunctions.hlsl" + #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/TextureStack.hlsl" + #include "Packages/com.unity.shadergraph/ShaderGraphLibrary/ShaderVariablesFunctions.hlsl" + + #undef WorldNormalVector + #define WorldNormalVector(data, normal) mul(normal, data.TBNMatrix) + + #define UnityObjectToWorldNormal(normal) mul(GetObjectToWorldMatrix(), normal) + + #define _WorldSpaceLightPos0 _MainLightPosition + + #define UNITY_DECLARE_TEX2D(name) TEXTURE2D(name); SAMPLER(sampler##name); + #define UNITY_DECLARE_TEX2D_NOSAMPLER(name) TEXTURE2D(name); + #define UNITY_DECLARE_TEX2DARRAY(name) TEXTURE2D_ARRAY(name); SAMPLER(sampler##name); + #define UNITY_DECLARE_TEX2DARRAY_NOSAMPLER(name) TEXTURE2D_ARRAY(name); + + #define UNITY_SAMPLE_TEX2DARRAY(tex,coord) SAMPLE_TEXTURE2D_ARRAY(tex, sampler##tex, coord.xy, coord.z) + #define UNITY_SAMPLE_TEX2DARRAY_LOD(tex,coord,lod) SAMPLE_TEXTURE2D_ARRAY_LOD(tex, sampler##tex, coord.xy, coord.z, lod) + #define UNITY_SAMPLE_TEX2D(tex, coord) SAMPLE_TEXTURE2D(tex, sampler##tex, coord) + #define UNITY_SAMPLE_TEX2D_SAMPLER(tex, samp, coord) SAMPLE_TEXTURE2D(tex, sampler##samp, coord) + + #define UNITY_SAMPLE_TEX2D_LOD(tex,coord, lod) SAMPLE_TEXTURE2D_LOD(tex, sampler_##tex, coord, lod) + #define UNITY_SAMPLE_TEX2D_SAMPLER_LOD(tex,samplertex,coord, lod) SAMPLE_TEXTURE2D_LOD (tex, sampler##samplertex,coord, lod) + + #if defined(UNITY_COMPILER_HLSL) + #define UNITY_INITIALIZE_OUTPUT(type,name) name = (type)0; + #else + #define UNITY_INITIALIZE_OUTPUT(type,name) + #endif + + #define sampler2D_float sampler2D + #define sampler2D_half sampler2D + + + + // data across stages, stripped like the above. + struct VertexToPixel + { + float4 pos : SV_POSITION; + float3 worldPos : TEXCOORD0; + float3 worldNormal : TEXCOORD1; + float4 worldTangent : TEXCOORD2; + float4 texcoord0 : TEXCOORD3; + float4 texcoord1 : TEXCOORD4; + float4 texcoord2 : TEXCOORD5; + + // #if %TEXCOORD3REQUIREKEY% + float4 texcoord3 : TEXCOORD6; + // #endif + + // #if %SCREENPOSREQUIREKEY% + // float4 screenPos : TEXCOORD7; + // #endif + + // #if %VERTEXCOLORREQUIREKEY% + half4 vertexColor : COLOR; + // #endif + + // #if %EXTRAV2F0REQUIREKEY% + // float4 extraV2F0 : TEXCOORD12; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // float4 extraV2F1 : TEXCOORD13; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // float4 extraV2F2 : TEXCOORD14; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // float4 extraV2F3 : TEXCOORD15; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // float4 extraV2F4 : TEXCOORD16; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // float4 extraV2F5 : TEXCOORD17; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // float4 extraV2F6 : TEXCOORD18; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // float4 extraV2F7 : TEXCOORD19; + // #endif + + #if defined(LIGHTMAP_ON) + float2 lightmapUV : TEXCOORD8; + #endif + #if !defined(LIGHTMAP_ON) + float3 sh : TEXCOORD9; + #endif + + #ifdef VARYINGS_NEED_FOG_AND_VERTEX_LIGHT + float4 fogFactorAndVertexLight : TEXCOORD10; + #endif + + #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR) + float4 shadowCoord : TEXCOORD11; + #endif + + #if UNITY_ANY_INSTANCING_ENABLED + uint instanceID : CUSTOM_INSTANCE_ID; + #endif + #if (defined(UNITY_STEREO_INSTANCING_ENABLED)) + uint stereoTargetEyeIndexAsRTArrayIdx : SV_RenderTargetArrayIndex; + #endif + #if (defined(UNITY_STEREO_MULTIVIEW_ENABLED)) || (defined(UNITY_STEREO_INSTANCING_ENABLED) && (defined(SHADER_API_GLES3) || defined(SHADER_API_GLCORE))) + uint stereoTargetEyeIndexAsBlendIdx0 : BLENDINDICES0; + #endif + #if defined(SHADER_STAGE_FRAGMENT) && defined(VARYINGS_NEED_CULLFACE) + FRONT_FACE_TYPE cullFace : FRONT_FACE_SEMANTIC; + #endif + }; + + + + + // data describing the user output of a pixel + struct Surface + { + half3 Albedo; + half Height; + half3 Normal; + half Smoothness; + half3 Emission; + half Metallic; + half3 Specular; + half Occlusion; + half SpecularPower; // for simple lighting + half Alpha; + float outputDepth; // if written, SV_Depth semantic is used. ShaderData.clipPos.z is unused value + // HDRP Only + half SpecularOcclusion; + half SubsurfaceMask; + half Thickness; + half CoatMask; + half CoatSmoothness; + half Anisotropy; + half IridescenceMask; + half IridescenceThickness; + int DiffusionProfileHash; + float SpecularAAThreshold; + float SpecularAAScreenSpaceVariance; + // requires _OVERRIDE_BAKEDGI to be defined, but is mapped in all pipelines + float3 DiffuseGI; + float3 BackDiffuseGI; + float3 SpecularGI; + float ior; + float3 transmittanceColor; + float atDistance; + float transmittanceMask; + // requires _OVERRIDE_SHADOWMASK to be defines + float4 ShadowMask; + + // for decals + float NormalAlpha; + float MAOSAlpha; + + + }; + + // Data the user declares in blackboard blocks + struct Blackboard + { + + float blackboardDummyData; + }; + + // data the user might need, this will grow to be big. But easy to strip + struct ShaderData + { + float4 clipPos; // SV_POSITION + float3 localSpacePosition; + float3 localSpaceNormal; + float3 localSpaceTangent; + + float3 worldSpacePosition; + float3 worldSpaceNormal; + float3 worldSpaceTangent; + float tangentSign; + + float3 worldSpaceViewDir; + float3 tangentSpaceViewDir; + + float4 texcoord0; + float4 texcoord1; + float4 texcoord2; + float4 texcoord3; + + float2 screenUV; + float4 screenPos; + + float4 vertexColor; + bool isFrontFace; + + float4 extraV2F0; + float4 extraV2F1; + float4 extraV2F2; + float4 extraV2F3; + float4 extraV2F4; + float4 extraV2F5; + float4 extraV2F6; + float4 extraV2F7; + + float3x3 TBNMatrix; + Blackboard blackboard; + }; + + struct VertexData + { + #if SHADER_TARGET > 30 + // uint vertexID : SV_VertexID; + #endif + float4 vertex : POSITION; + float3 normal : NORMAL; + float4 tangent : TANGENT; + float4 texcoord0 : TEXCOORD0; + + // optimize out mesh coords when not in use by user or lighting system + #if _URP && (_USINGTEXCOORD1 || _PASSMETA || _PASSFORWARD || _PASSGBUFFER) + float4 texcoord1 : TEXCOORD1; + #endif + + #if _URP && (_USINGTEXCOORD2 || _PASSMETA || ((_PASSFORWARD || _PASSGBUFFER) && defined(DYNAMICLIGHTMAP_ON))) + float4 texcoord2 : TEXCOORD2; + #endif + + #if _STANDARD && (_USINGTEXCOORD1 || (_PASSMETA || ((_PASSFORWARD || _PASSGBUFFER || _PASSFORWARDADD) && LIGHTMAP_ON))) + float4 texcoord1 : TEXCOORD1; + #endif + #if _STANDARD && (_USINGTEXCOORD2 || (_PASSMETA || ((_PASSFORWARD || _PASSGBUFFER) && DYNAMICLIGHTMAP_ON))) + float4 texcoord2 : TEXCOORD2; + #endif + + + #if _HDRP + float4 texcoord1 : TEXCOORD1; + float4 texcoord2 : TEXCOORD2; + #endif + + // #if %TEXCOORD3REQUIREKEY% + float4 texcoord3 : TEXCOORD3; + // #endif + + // #if %VERTEXCOLORREQUIREKEY% + float4 vertexColor : COLOR; + // #endif + + #if _PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR)) + float3 previousPositionOS : TEXCOORD4; // Contain previous transform position (in case of skinning for example) + #if defined (_ADD_PRECOMPUTED_VELOCITY) + float3 precomputedVelocity : TEXCOORD5; // Add Precomputed Velocity (Alembic computes velocities on runtime side). + #endif + #endif + + UNITY_VERTEX_INPUT_INSTANCE_ID + }; + + struct TessVertex + { + float4 vertex : INTERNALTESSPOS; + float3 normal : NORMAL; + float4 tangent : TANGENT; + float4 texcoord0 : TEXCOORD0; + float4 texcoord1 : TEXCOORD1; + float4 texcoord2 : TEXCOORD2; + + // #if %TEXCOORD3REQUIREKEY% + float4 texcoord3 : TEXCOORD3; + // #endif + + // #if %VERTEXCOLORREQUIREKEY% + float4 vertexColor : COLOR; + // #endif + + // #if %EXTRAV2F0REQUIREKEY% + // float4 extraV2F0 : TEXCOORD5; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // float4 extraV2F1 : TEXCOORD6; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // float4 extraV2F2 : TEXCOORD7; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // float4 extraV2F3 : TEXCOORD8; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // float4 extraV2F4 : TEXCOORD9; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // float4 extraV2F5 : TEXCOORD10; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // float4 extraV2F6 : TEXCOORD11; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // float4 extraV2F7 : TEXCOORD12; + // #endif + + #if _PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR)) + float3 previousPositionOS : TEXCOORD13; // Contain previous transform position (in case of skinning for example) + #if defined (_ADD_PRECOMPUTED_VELOCITY) + float3 precomputedVelocity : TEXCOORD14; + #endif + #endif + + UNITY_VERTEX_INPUT_INSTANCE_ID + UNITY_VERTEX_OUTPUT_STEREO + }; + + struct ExtraV2F + { + float4 extraV2F0; + float4 extraV2F1; + float4 extraV2F2; + float4 extraV2F3; + float4 extraV2F4; + float4 extraV2F5; + float4 extraV2F6; + float4 extraV2F7; + Blackboard blackboard; + float4 time; + }; + + + float3 WorldToTangentSpace(ShaderData d, float3 normal) + { + return mul(d.TBNMatrix, normal); + } + + float3 TangentToWorldSpace(ShaderData d, float3 normal) + { + return mul(normal, d.TBNMatrix); + } + + // in this case, make standard more like SRPs, because we can't fix + // unity_WorldToObject in HDRP, since it already does macro-fu there + + #if _STANDARD + float3 TransformWorldToObject(float3 p) { return mul(unity_WorldToObject, float4(p, 1)); }; + float3 TransformObjectToWorld(float3 p) { return mul(unity_ObjectToWorld, float4(p, 1)); }; + float4 TransformWorldToObject(float4 p) { return mul(unity_WorldToObject, p); }; + float4 TransformObjectToWorld(float4 p) { return mul(unity_ObjectToWorld, p); }; + float4x4 GetWorldToObjectMatrix() { return unity_WorldToObject; } + float4x4 GetObjectToWorldMatrix() { return unity_ObjectToWorld; } + #if (defined(SHADER_API_D3D11) || defined(SHADER_API_XBOXONE) || defined(UNITY_COMPILER_HLSLCC) || defined(SHADER_API_PSSL) || (SHADER_TARGET_SURFACE_ANALYSIS && !SHADER_TARGET_SURFACE_ANALYSIS_MOJOSHADER)) + #define UNITY_SAMPLE_TEX2D_LOD(tex,coord, lod) tex.SampleLevel (sampler##tex,coord, lod) + #define UNITY_SAMPLE_TEX2D_SAMPLER_LOD(tex,samplertex,coord, lod) tex.SampleLevel (sampler##samplertex,coord, lod) + #else + #define UNITY_SAMPLE_TEX2D_LOD(tex,coord,lod) tex2D (tex,coord,0,lod) + #define UNITY_SAMPLE_TEX2D_SAMPLER_LOD(tex,samplertex,coord,lod) tex2D (tex,coord,0,lod) + #endif + + #undef GetWorldToObjectMatrix() + + #define GetWorldToObjectMatrix() unity_WorldToObject + + + #endif + + float3 GetCameraWorldPosition() + { + #if _HDRP + return GetCameraRelativePositionWS(_WorldSpaceCameraPos); + #else + return _WorldSpaceCameraPos; + #endif + } + + #if _GRABPASSUSED + #if _STANDARD + TEXTURE2D(%GRABTEXTURE%); + SAMPLER(sampler_%GRABTEXTURE%); + #endif + + half3 GetSceneColor(float2 uv) + { + #if _STANDARD + return SAMPLE_TEXTURE2D(%GRABTEXTURE%, sampler_%GRABTEXTURE%, uv).rgb; + #else + return SHADERGRAPH_SAMPLE_SCENE_COLOR(uv); + #endif + } + #endif + + + + #if _STANDARD + UNITY_DECLARE_DEPTH_TEXTURE(_CameraDepthTexture); + float GetSceneDepth(float2 uv) { return SAMPLE_DEPTH_TEXTURE(_CameraDepthTexture, uv); } + float GetLinear01Depth(float2 uv) { return Linear01Depth(GetSceneDepth(uv)); } + float GetLinearEyeDepth(float2 uv) { return LinearEyeDepth(GetSceneDepth(uv)); } + #else + float GetSceneDepth(float2 uv) { return SHADERGRAPH_SAMPLE_SCENE_DEPTH(uv); } + float GetLinear01Depth(float2 uv) { return Linear01Depth(GetSceneDepth(uv), _ZBufferParams); } + float GetLinearEyeDepth(float2 uv) { return LinearEyeDepth(GetSceneDepth(uv), _ZBufferParams); } + #endif + + float3 GetWorldPositionFromDepthBuffer(float2 uv, float3 worldSpaceViewDir) + { + float eye = GetLinearEyeDepth(uv); + float3 camView = mul((float3x3)GetObjectToWorldMatrix(), transpose(mul(GetWorldToObjectMatrix(), UNITY_MATRIX_I_V)) [2].xyz); + + float dt = dot(worldSpaceViewDir, camView); + float3 div = worldSpaceViewDir/dt; + float3 wpos = (eye * div) + GetCameraWorldPosition(); + return wpos; + } + + #if _HDRP + float3 ObjectToWorldSpacePosition(float3 pos) + { + return GetAbsolutePositionWS(TransformObjectToWorld(pos)); + } + #else + float3 ObjectToWorldSpacePosition(float3 pos) + { + return TransformObjectToWorld(pos); + } + #endif + + #if _STANDARD + UNITY_DECLARE_SCREENSPACE_TEXTURE(_CameraDepthNormalsTexture); + float3 GetSceneNormal(float2 uv, float3 worldSpaceViewDir) + { + float4 depthNorms = UNITY_SAMPLE_SCREENSPACE_TEXTURE(_CameraDepthNormalsTexture, uv); + float3 norms = DecodeViewNormalStereo(depthNorms); + norms = mul((float3x3)GetWorldToViewMatrix(), norms) * 0.5 + 0.5; + return norms; + } + #elif _HDRP && !_DECALSHADER + + float3 GetSceneNormal(float2 uv, float3 worldSpaceViewDir) + { + NormalData nd; + DecodeFromNormalBuffer(_ScreenSize.xy * uv, nd); + return nd.normalWS; + } + #elif _URP + #if (SHADER_LIBRARY_VERSION_MAJOR >= 10) + #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/DeclareNormalsTexture.hlsl" + #endif + + float3 GetSceneNormal(float2 uv, float3 worldSpaceViewDir) + { + #if (SHADER_LIBRARY_VERSION_MAJOR >= 10) + return SampleSceneNormals(uv); + #else + float3 wpos = GetWorldPositionFromDepthBuffer(uv, worldSpaceViewDir); + return normalize(-cross(ddx(wpos), ddy(wpos))) * 0.5 + 0.5; + #endif + + } + #endif + + #if _HDRP + + half3 UnpackNormalmapRGorAG(half4 packednormal) + { + // This do the trick + packednormal.x *= packednormal.w; + + half3 normal; + normal.xy = packednormal.xy * 2 - 1; + normal.z = sqrt(1 - saturate(dot(normal.xy, normal.xy))); + return normal; + } + half3 UnpackNormal(half4 packednormal) + { + #if defined(UNITY_NO_DXT5nm) + return packednormal.xyz * 2 - 1; + #else + return UnpackNormalmapRGorAG(packednormal); + #endif + } + #endif + #if _HDRP || _URP + + half3 UnpackScaleNormal(half4 packednormal, half scale) + { + #ifndef UNITY_NO_DXT5nm + // Unpack normal as DXT5nm (1, y, 1, x) or BC5 (x, y, 0, 1) + // Note neutral texture like "bump" is (0, 0, 1, 1) to work with both plain RGB normal and DXT5nm/BC5 + packednormal.x *= packednormal.w; + #endif + half3 normal; + normal.xy = (packednormal.xy * 2 - 1) * scale; + normal.z = sqrt(1 - saturate(dot(normal.xy, normal.xy))); + return normal; + } + + #endif + + + void GetSun(out float3 lightDir, out float3 color) + { + lightDir = float3(0.5, 0.5, 0); + color = 1; + #if _HDRP + if (_DirectionalLightCount > 0) + { + DirectionalLightData light = _DirectionalLightDatas[0]; + lightDir = -light.forward.xyz; + color = light.color; + } + #elif _STANDARD + lightDir = normalize(_WorldSpaceLightPos0.xyz); + color = _LightColor0.rgb; + #elif _URP + Light light = GetMainLight(); + lightDir = light.direction; + color = light.color; + #endif + } + + + + CBUFFER_START(UnityPerMaterial) + + + half4 _Color; + half4 _MainTex_ST, _MainTex_TexelSize; + half _Alpha, _AlphaCutoffValue; + + #if ATLAS_ON + half _MinXUV, _MaxXUV, _MinYUV, _MaxYUV; + #endif + + #if GLOW_ON + half4 _GlowColor; + half _Glow, _GlowGlobal; + #endif + + #if HSV_ON + half _HsvShift, _HsvSaturation, _HsvBright; + #endif + + #if DISTORT_ON + half4 _DistortTex_ST; + half _DistortTexXSpeed, _DistortTexYSpeed, _DistortAmount; + #endif + + #if FADE_ON + half4 _FadeBurnColor, _FadeTex_ST, _FadeBurnTex_ST; + half _FadeAmount, _FadeBurnWidth, _FadeBurnTransition,_FadeBurnGlow; + #endif + + #if OUTBASE_ON + half4 _OutlineColor; + half _OutlineAlpha, _OutlineGlow, _OutlineWidth; + int _OutlinePixelWidth; + #endif + + #if OUTTEX_ON + half4 _OutlineTex_ST; + half _OutlineTexXSpeed, _OutlineTexYSpeed; + #endif + + #if OUTDIST_ON + half4 _OutlineDistortTex_ST; + half _OutlineDistortTexXSpeed, _OutlineDistortTexYSpeed, _OutlineDistortAmount; + #endif + + #if ALPHAOUTLINE_ON + half _AlphaOutlineGlow, _AlphaOutlinePower, _AlphaOutlineMinAlpha, _AlphaOutlineBlend; + half4 _AlphaOutlineColor; + #endif + + #if INNEROUTLINE_ON + half _InnerOutlineThickness, _InnerOutlineAlpha, _InnerOutlineGlow; + half4 _InnerOutlineColor; + #endif + + #if GRADIENT_ON + half _GradBlend, _GradBoostX, _GradBoostY; + half4 _GradTopRightCol, _GradTopLeftCol, _GradBotRightCol, _GradBotLeftCol; + #endif + + #if COLORSWAP_ON + half4 _ColorSwapRed, _ColorSwapGreen, _ColorSwapBlue; + half _ColorSwapRedLuminosity, _ColorSwapGreenLuminosity, _ColorSwapBlueLuminosity, _ColorSwapBlend; + #endif + + #if CHANGECOLOR_ON + half4 _ColorChangeNewCol, _ColorChangeTarget; + half _ColorChangeTolerance, _ColorChangeLuminosity; + #endif + #if CHANGECOLOR2_ON + half4 _ColorChangeNewCol2, _ColorChangeTarget2; + half _ColorChangeTolerance2; + #endif + #if CHANGECOLOR3_ON + half4 _ColorChangeNewCol3, _ColorChangeTarget3; + half _ColorChangeTolerance3; + #endif + + #if COLORRAMP_ON + half _ColorRampLuminosity, _ColorRampBlend; + #endif + + #if HITEFFECT_ON + half4 _HitEffectColor; + half _HitEffectGlow, _HitEffectBlend; + #endif + + #if NEGATIVE_ON + half _NegativeAmount; + #endif + + #if PIXELATE_ON + half _PixelateSize; + #endif + + #if GREYSCALE_ON + half _GreyscaleLuminosity, _GreyscaleBlend; + half4 _GreyscaleTintColor; + #endif + + #if POSTERIZE_ON + half _PosterizeNumColors, _PosterizeGamma; + #endif + + #if BLUR_ON + half _BlurIntensity; + #endif + + #if MOTIONBLUR_ON + half _MotionBlurAngle, _MotionBlurDist; + #endif + + #if GHOST_ON + half _GhostColorBoost, _GhostTransparency, _GhostBlend; + #endif + + #if HOLOGRAM_ON + half _HologramStripesAmount, _HologramMinAlpha, _HologramUnmodAmount, _HologramStripesSpeed, _HologramMaxAlpha, _HologramBlend; + half4 _HologramStripeColor; + #endif + + #if CHROMABERR_ON + half _ChromAberrAmount, _ChromAberrAlpha; + #endif + + #if GLITCH_ON + half _GlitchAmount, _GlitchSize; + #endif + + #if FLICKER_ON + half _FlickerFreq, _FlickerPercent, _FlickerAlpha; + #endif + + #if SHADOW_ON + half _ShadowX, _ShadowY, _ShadowAlpha; + half4 _ShadowColor; + #endif + + #if SHINE_ON + half4 _ShineColor; + half _ShineLocation, _ShineRotate, _ShineWidth, _ShineGlow; + #endif + + #if CONTRAST_ON + half _Contrast, _Brightness; + #endif + + #if OVERLAY_ON + half4 _OverlayTex_ST, _OverlayColor; + half _OverlayGlow, _OverlayBlend, _OverlayTextureScrollXSpeed, _OverlayTextureScrollYSpeed; + #endif + + #if DOODLE_ON + half _HandDrawnAmount, _HandDrawnSpeed; + #endif + + #if WIND_ON + half _GrassSpeed, _GrassWind, _GrassManualAnim, _GrassRadialBend; + #endif + + #if WAVEUV_ON + float _WaveAmount, _WaveSpeed, _WaveStrength, _WaveX, _WaveY; + #endif + + #if ROUNDWAVEUV_ON + half _RoundWaveStrength, _RoundWaveSpeed; + #endif + + #if RECTSIZE_ON + half _RectSize; + #endif + + #if OFFSETUV_ON + half _OffsetUvX, _OffsetUvY; + #endif + + #if CLIPPING_ON + half _ClipUvLeft, _ClipUvRight, _ClipUvUp, _ClipUvDown; + #endif + + #if RADIALCLIPPING_ON + half _RadialStartAngle, _RadialClip, _RadialClip2; + #endif + + #if TEXTURESCROLL_ON + half _TextureScrollXSpeed, _TextureScrollYSpeed; + #endif + + #if ZOOMUV_ON + half _ZoomUvAmount; + #endif + + #if WARP_ON + half _WarpStrength, _WarpSpeed, _WarpScale; + #endif + + #if TWISTUV_ON + half _TwistUvAmount, _TwistUvPosX, _TwistUvPosY, _TwistUvRadius; + #endif + + #if ROTATEUV_ON + half _RotateUvAmount; + #endif + + #if FISHEYE_ON + half _FishEyeUvAmount; + #endif + + #if PINCH_ON + half _PinchUvAmount; + #endif + + #if SHAKEUV_ON + half _ShakeUvSpeed, _ShakeUvX, _ShakeUvY; + #endif + + #if NORMALMAP_ON + half _NormalStrength; + #endif + + float _RandomSeed; + + + + + CBUFFER_END + + + + + + + + TEXTURE2D(_MainTex); + SAMPLER(sampler_MainTex); + + #if GLOW_ON + TEXTURE2D(_GlowTex); + SAMPLER(sampler_GlowTex); + #endif + + #if FADE_ON + TEXTURE2D(_FadeTex); + SAMPLER(sampler_FadeTex); + + TEXTURE2D(_FadeBurnTex); + SAMPLER(sampler_FadeBurnTex); + #endif + + #if DISTORT_ON + TEXTURE2D(_DistortTex); + SAMPLER(sampler_DistortTex); + #endif + + #if OUTTEX_ON + TEXTURE2D(_OutlineTex); + SAMPLER(sampler_OutlineTex); + #endif + + #if OUTDIST_ON + TEXTURE2D(_OutlineDistortTex); + SAMPLER(sampler_OutlineDistortTex); + #endif + + #if COLORSWAP_ON + TEXTURE2D(_ColorSwapTex); + SAMPLER(sampler_ColorSwapTex); + #endif + + #if COLORRAMP_ON + TEXTURE2D(_ColorRampTex); + TEXTURE2D(_ColorRampTexGradient); + SAMPLER(sampler_ColorRampTex); + SAMPLER(sampler_ColorRampTexGradient); + #endif + + #if SHINE_ON + TEXTURE2D(_ShineMask); + SAMPLER(sampler_ShineMask); + #endif + + #if OVERLAY_ON + TEXTURE2D(_OverlayTex); + SAMPLER(sampler_OverlayTex); + #endif + + #if NORMALMAP_ON + TEXTURE2D(_NormalMap); + SAMPLER(sampler_NormalMap); + #endif + + + half3 GetPixel(in int offsetX, in int offsetY, in half2 uv, in Texture2D _tex, in SamplerState _sampler) + { + half2 _uv = uv + half2(offsetX * _MainTex_TexelSize.x, offsetY * _MainTex_TexelSize.y); + half4 col = SAMPLE_TEXTURE2D(_tex, _sampler, _uv); + return col.rgb; + } + + + //BLURS------------------------------------------------------------------------- + half4 Blur(half2 uv, Texture2D source, SamplerState sampler_source, half Intensity) + { + const half2 texelSize = 1.0 / _ScreenParams.xy; + const half4 color = SAMPLE_TEXTURE2D(source, sampler_source, uv); + const half2 offset = Intensity * texelSize; + + half4 accumulatedColor = color; + half accumulatedWeight = 1.0; + for (int x = -1; x <= 1; x++) + { + for (int y = -1; y <= 1; y++) + { + const half2 sampleUV = uv + half2(x, y) * offset; + const half4 sampleColor = SAMPLE_TEXTURE2D(source, sampler_source, sampleUV); + + accumulatedColor += sampleColor; + accumulatedWeight += 1.0; + } + } + + half4 blurredColor = accumulatedColor / accumulatedWeight; + return blurredColor; + } + + half BlurHD_G(half bhqp, half x) + { + return exp(-(x * x) / (2.0 * bhqp * bhqp)); + } + half4 BlurHD(half2 uv, Texture2D source, SamplerState sampler_source, half BlurAmount, half xScale, half yScale) + { + int iterations = 16; + int halfIterations = iterations / 2; + half sigmaX = 0.1 + BlurAmount * 0.5; + half sigmaY = sigmaX; + half total = 0.0; + half4 ret = half4(0, 0, 0, 0); + for (int iy = 0; iy < iterations; ++iy) + { + half fy = BlurHD_G(sigmaY, half(iy) -half(halfIterations)); + half offsetY = half(iy - halfIterations) * 0.00390625 * xScale; + for (int ix = 0; ix < iterations; ++ix) + { + half fx = BlurHD_G(sigmaX, half(ix) - half(halfIterations)); + half offsetX = half(ix - halfIterations) * 0.00390625 * yScale; + total += fx * fy; + ret += SAMPLE_TEXTURE2D(source, sampler_source, uv + half2(offsetX, offsetY)) * fx * fy; + } + } + return ret / total; + } + //----------------------------------------------------------------------- + + + //------------------------------------------- + half RemapFloat(half inValue, half inMin, half inMax, half outMin, half outMax){ + return outMin + (inValue - inMin) * (outMax - outMin) / (inMax - inMin); + } + //------------------------------------------- + + //----------------------------------------------------------------------- + half rand(half2 seed, half offset) { + return (frac(sin(dot(seed, half2(12.9898, 78.233))) * 43758.5453) + offset) % 1.0; + } + + half rand2(half2 seed, half offset) { + return (frac(sin(dot(seed * floor(50 + (_Time.x % 1.0) * 12.), half2(127.1, 311.7))) * 43758.5453123) + offset) % 1.0; + } + + half rand2CustomTime(half2 seed, half offset, half customTime) { + return (frac(sin(dot(seed * floor(50 + (customTime % 1.0) * 12.), half2(127.1, 311.7))) * 43758.5453123) + offset) % 1.0; + } + //----------------------------------------------------------------------- + + + void Ext_ModifyVertex0 (inout VertexData v, inout ExtraV2F d) + { + //BILBOARD_ON + #if BILBOARD_ON + half3 camRight = mul((half3x3)unity_CameraToWorld, half3(1,0,0)); + half3 camUp = half3(0,1,0); + #if BILBOARDY_ON + camUp = mul((half3x3)unity_CameraToWorld, half3(0,1,0)); + #endif + half3 localPos = v.vertex.x * camRight + v.vertex.y * camUp; + v.vertex = half4(localPos, 1); + #endif + //----------------------------------------------------------- + + v.texcoord0.xy = TRANSFORM_TEX(v.texcoord0.xy, _MainTex); + half2 center = half2(0.5, 0.5); + #if ATLAS_ON + center = half2((_MaxXUV + _MinXUV) / 2.0, (_MaxYUV + _MinYUV) / 2.0); + #endif + + //POLARUV_ON + #if POLARUV_ON + v.texcoord0.xy = v.texcoord0.xy - center; + #endif + + //---------------------------------------- + + //ROTATEUV_ON + #if ROTATEUV_ON + half2 uvC = v.texcoord0.xy; + half cosAngle = cos(_RotateUvAmount); + half sinAngle = sin(_RotateUvAmount); + half2x2 rot = half2x2(cosAngle, -sinAngle, sinAngle, cosAngle); + uvC -= center; + v.texcoord0.xy = mul(rot, uvC); + v.texcoord0.xy += center; + #endif + //-------------------- + + #if RECTSIZE_ON + v.vertex.xyz += (v.vertex.xyz * (_RectSize - 1.0)); + #endif + + #if OUTTEX_ON + v.texcoord1.xy = TRANSFORM_TEX(v.texcoord0.xy, _OutlineTex); + #endif + + #if OUTDIST_ON + v.texcoord2.xy = TRANSFORM_TEX(v.texcoord0.xy, _OutlineDistortTex); + #endif + + #if DISTORT_ON + v.texcoord3.xy = TRANSFORM_TEX(v.texcoord0.xy, _DistortTex); + #endif + } + + void Ext_SurfaceFunction0 (inout Surface o, ShaderData d) + { + half randomSeed = _RandomSeed; + + float2 uvRect = d.texcoord0; + half2 center = half2(0.5, 0.5); + #if ATLAS_ON + center = half2((_MaxXUV + _MinXUV) / 2.0, (_MaxYUV + _MinYUV) / 2.0); + uvRect = half2((d.texcoord0.x - _MinXUV) / (_MaxXUV - _MinXUV), (d.texcoord0.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half2 centerTiled = half2(center.x * _MainTex_ST.x, center.y * _MainTex_ST.y); + + //CLIPPING_ON + #if CLIPPING_ON + half2 tiledUv = half2(d.texcoord0.x / _MainTex_ST.x, d.texcoord0.y / _MainTex_ST.y); + #if ATLAS_ON + tiledUv = half2((tiledUv.x - _MinXUV) / (_MaxXUV - _MinXUV), (tiledUv.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + clip((1 - _ClipUvUp) - tiledUv.y); + clip(tiledUv.y - _ClipUvDown); + clip((1 - _ClipUvRight) - tiledUv.x); + clip(tiledUv.x - _ClipUvLeft); + #endif + //---------------------------------- + + //RADIALCLIPPING_ON + #if RADIALCLIPPING_ON + half2 tiledUv2 = half2(d.texcoord0.x / _MainTex_ST.x, d.texcoord0.y / _MainTex_ST.y); + #if ATLAS_ON + tiledUv2 = half2((tiledUv2.x - _MinXUV) / (_MaxXUV - _MinXUV), (tiledUv2.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half startAngle = _RadialStartAngle - _RadialClip; + half endAngle = _RadialStartAngle + _RadialClip2; + half offset0 = clamp(0, 360, startAngle + 360); + half offset360 = clamp(0, 360, endAngle - 360); + half2 atan2Coord = half2(lerp(-1, 1, tiledUv2.x), lerp(-1, 1, tiledUv2.y)); + half atanAngle = atan2(atan2Coord.y, atan2Coord.x) * 57.3; // angle in degrees + if(atanAngle < 0) atanAngle = 360 + atanAngle; + if(atanAngle >= startAngle && atanAngle <= endAngle) discard; + if(atanAngle <= offset360) discard; + if(atanAngle >= offset0) discard; + #endif + + //----------------------------- + + //TEXTURESCROLL_ON && ATLAS_ON + #if TEXTURESCROLL_ON && ATLAS_ON + d.texcoord0.xy = half2(_MinXUV + ((_MaxXUV - _MinXUV) * (abs(((_Time.y + randomSeed) * _TextureScrollXSpeed) + uvRect.x) % 1)), + _MinYUV + ((_MaxYUV - _MinYUV) * (abs(((_Time.y + randomSeed) * _TextureScrollYSpeed) + uvRect.y) % 1))); + #endif + //---------------------------- + + //OFFSETUV_ON + #if OFFSETUV_ON + #if ATLAS_ON + d.texcoord0.xy = half2(_MinXUV + ((_MaxXUV - _MinXUV) * (abs((_OffsetUvX + uvRect.x) % 1))), + _MinYUV + ((_MaxYUV - _MinYUV) * (abs(_OffsetUvY + uvRect.y) % 1))); + #else + d.texcoord0.xy += half2(_OffsetUvX, _OffsetUvY); + #endif + #endif + + //---------------------- + + //POLARUV_ON + #if POLARUV_ON + d.texcoord0.xy = half2(atan2(d.texcoord0.y, d.texcoord0.x) / (2.0f * 3.141592653589f), length(d.texcoord0.xy)); + d.texcoord0.xy *= _MainTex_ST.xy; + #endif + + //-------------------------------------- + + //TWISTUV_ON + #if TWISTUV_ON + #if ATLAS_ON + _TwistUvPosX = ((_MaxXUV - _MinXUV) * _TwistUvPosX) + _MinXUV; + _TwistUvPosY = ((_MaxYUV - _MinYUV) * _TwistUvPosY) + _MinYUV; + #endif + half2 tempUv = d.texcoord0.xy - half2(_TwistUvPosX * _MainTex_ST.x, _TwistUvPosY * _MainTex_ST.y); + _TwistUvRadius *= (_MainTex_ST.x + _MainTex_ST.y) / 2; + half percent = (_TwistUvRadius - length(tempUv)) / _TwistUvRadius; + half theta = percent * percent * (2.0 * sin(_TwistUvAmount)) * 8.0; + half s = sin(theta); + half c = cos(theta); + half beta = max(sign(_TwistUvRadius - length(tempUv)), 0.0); + tempUv = half2(dot(tempUv, half2(c, -s)), dot(tempUv, half2(s, c))) * beta + tempUv * (1 - beta); + tempUv += half2(_TwistUvPosX * _MainTex_ST.x, _TwistUvPosY * _MainTex_ST.y); + d.texcoord0.xy = tempUv; + #endif + + //-------------------------------------------- + + //FISHEYE_ON + #if FISHEYE_ON + half bind = length(centerTiled); + half2 dF = d.texcoord0.xy - centerTiled; + half dFlen = length(dF); + half fishInt = (3.14159265359 / bind) * (_FishEyeUvAmount + 0.001); + d.texcoord0.xy = centerTiled + (dF / (max(0.0001, dFlen))) * tan(dFlen * fishInt) * bind / tan(bind * fishInt); + #endif + //--------------------------------------------- + + //PINCH_ON + #if PINCH_ON + half2 dP = d.texcoord0.xy - centerTiled; + half pinchInt = (3.141592 / length(centerTiled)) * (-_PinchUvAmount + 0.001); + d.texcoord0.xy = centerTiled + normalize(dP) * atan(length(dP) * -pinchInt * 10.0) * 0.5 / atan(-pinchInt * 5); + #endif + + //--------------------------------------------- + + //ZOOMUV_ON + #if ZOOMUV_ON + d.texcoord0.xy -= centerTiled; + d.texcoord0.xy = d.texcoord0.xy * _ZoomUvAmount; + d.texcoord0.xy += centerTiled; + #endif + + //----------------------------------------------- + + //DOODLE_ON + #if DOODLE_ON + half2 uvCopy = uvRect; + _HandDrawnSpeed = (floor((_Time.x + randomSeed) * 20 * _HandDrawnSpeed) / _HandDrawnSpeed) * _HandDrawnSpeed; + uvCopy.x = sin((uvCopy.x * _HandDrawnAmount + _HandDrawnSpeed) * 4); + uvCopy.y = cos((uvCopy.y * _HandDrawnAmount + _HandDrawnSpeed) * 4); + d.texcoord0.xy = lerp(d.texcoord0.xy, d.texcoord0.xy + uvCopy, 0.0005 * _HandDrawnAmount); + #endif + + //-------------------------- + + //SHAKEUV_ON + #if SHAKEUV_ON + half xShake = sin((_Time.x + randomSeed) * _ShakeUvSpeed * 50) * _ShakeUvX; + half yShake = cos((_Time.x + randomSeed) * _ShakeUvSpeed * 50) * _ShakeUvY; + d.texcoord0.xy += half2(xShake * 0.012, yShake * 0.01); + #endif + + //------------------------------------------- + + //RECTSIZE_ON + #if RECTSIZE_ON + d.texcoord0.xy = d.texcoord0.xy * (_RectSize).xx + (((-_RectSize * 0.5) + 0.5)).xx; + #endif + + //------------------------------------------- + + //DISTORT_ON + #if DISTORT_ON + #if ATLAS_ON + d.texcoord3.x = d.texcoord3.x * (1 / (_MaxXUV - _MinXUV)); + d.texcoord3.y = d.texcoord3.y * (1 / (_MaxYUV - _MinYUV)); + #endif + + d.texcoord3.x += ((_Time.x + _RandomSeed) * _DistortTexXSpeed) % 1; + d.texcoord3.y += ((_Time.x + _RandomSeed) * _DistortTexYSpeed) % 1; + half distortAmnt = (SAMPLE_TEXTURE2D(_DistortTex, sampler_DistortTex, d.texcoord3.xy).r - 0.5) * 0.2 * _DistortAmount; + d.texcoord0.x += distortAmnt; + d.texcoord0.y += distortAmnt; + #endif + //------------------------------------------------------- + + //WARP_ON + #if WARP_ON + half2 warpUv = half2(d.texcoord0.x / _MainTex_ST.x, d.texcoord0.y / _MainTex_ST.y); + #if ATLAS_ON + warpUv = half2((warpUv.x - _MinXUV) / (_MaxXUV - _MinXUV), (warpUv.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + const float tau = 6.283185307179586; + float xWarp = (_Time.y + randomSeed) * _WarpSpeed + warpUv.x * tau / _WarpScale; + float yWarp = (_Time.y + randomSeed) * _WarpSpeed + warpUv.y * tau / _WarpScale; + float2 warp = float2(sin(xWarp), sin(yWarp)) * _WarpStrength; + d.texcoord0.xy += warp; + #endif + + //------------------------------------------------------- + + //WAVEUV_ON + #if WAVEUV_ON + float2 uvWave = half2(_WaveX * _MainTex_ST.x, _WaveY * _MainTex_ST.y) - d.texcoord0.xy; + uvWave %= 1; + #if ATLAS_ON + uvWave = half2(_WaveX, _WaveY) - uvRect; + #endif + uvWave.x *= _ScreenParams.x / _ScreenParams.y; + float waveTime = _Time.y + randomSeed; + float angWave = (sqrt(dot(uvWave, uvWave)) * _WaveAmount) - ((waveTime * _WaveSpeed)); + d.texcoord0.xy = d.texcoord0.xy + uvWave * sin(angWave) * (_WaveStrength / 1000.0); + #endif + //---------------------------------------------------- + + //ROUNDWAVEUV_ON + #if ROUNDWAVEUV_ON + half xWave = ((0.5 * _MainTex_ST.x) - uvRect.x); + half yWave = ((0.5 * _MainTex_ST.y) - uvRect.y) * (_MainTex_TexelSize.w / _MainTex_TexelSize.z); + half ripple = -sqrt(xWave*xWave + yWave* yWave); + d.texcoord0.xy += (sin((ripple + (_Time.y + randomSeed) * (_RoundWaveSpeed/10.0)) / 0.015) * (_RoundWaveStrength/10.0)) % 1; + #endif + //---------------------------------------------------- + + + //WIND_ON + #if WIND_ON + half windOffset = sin((_Time.x + randomSeed) * _GrassSpeed * 10); + half2 windCenter = half2(0.5, 0.1); + #if ATLAS_ON + windCenter.x = ((_MaxXUV - _MinXUV) * windCenter.x) + _MinXUV; + windCenter.y = ((_MaxYUV - _MinYUV) * windCenter.y) + _MinYUV; + #endif + #if !MANUALWIND_ON + d.texcoord0.x = fmod(abs(lerp(d.texcoord0.x, d.texcoord0.x + (_GrassWind * 0.01 * windOffset), uvRect.y)), 1); + #else + d.texcoord0.x = fmod(abs(lerp(d.texcoord0.x, d.texcoord0.x + (_GrassWind * 0.01 * _GrassManualAnim), uvRect.y)), 1); + windOffset = _GrassManualAnim; + #endif + half2 delta = d.texcoord0.xy - windCenter; + half delta2 = dot(delta.xy, delta.xy); + half2 delta_offset = delta2 * windOffset; + d.texcoord0.xy = d.texcoord0.xy + half2(delta.y, -delta.x) * delta_offset * _GrassRadialBend; + #endif + + //-------------------------------------------------------- + + //TEXTURESCROLL_ON && !ATLAS_ON + #if TEXTURESCROLL_ON && !ATLAS_ON + d.texcoord0.x += ((_Time.y + randomSeed) * _TextureScrollXSpeed) % 1; + d.texcoord0.y += ((_Time.y + randomSeed) * _TextureScrollYSpeed) % 1; + #endif + //------------------------------ + + //PIXELATE_ON + #if PIXELATE_ON + half aspectRatio = _MainTex_TexelSize.x / _MainTex_TexelSize.y; + half2 pixelSize = float2(_PixelateSize, _PixelateSize * aspectRatio); + d.texcoord0.xy = floor(d.texcoord0.xy * pixelSize) / pixelSize; + #endif + //-------------- + + half4 col = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy); + half originalAlpha = col.a; + col *= d.vertexColor; + + //NORMAL MAP + #if NORMALMAP_ON + half4 normalSample = SAMPLE_TEXTURE2D(_NormalMap, sampler_NormalMap, d.texcoord0.xy); + half3 normalTS = UnpackNormal(normalSample); + normalTS.xy *= _NormalStrength; + o.Normal = normalTS; + #endif + + + //GLITCH_ON + #if GLITCH_ON + half2 uvGlitch = uvRect; + uvGlitch.y -= 0.5; + half lineNoise = pow(rand2(floor(uvGlitch * half2(24., 19.) * _GlitchSize) * 4.0, randomSeed), 3.0) * _GlitchAmount + * pow(rand2(floor(uvGlitch * half2(38., 14.) * _GlitchSize) * 4.0, randomSeed), 3.0); + col = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(lineNoise * 0.02 * rand2(half2(2.0, 1), randomSeed), 0)) * d.vertexColor; + #endif + //-------------------------------------- + + //CHROMABERR_ON + #if CHROMABERR_ON + half4 r = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(_ChromAberrAmount/10, 0)) * d.vertexColor; + half4 b = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(-_ChromAberrAmount/10, 0)) * d.vertexColor; + col = half4(r.r * r.a, col.g, b.b * b.a, max(max(r.a, b.a) * _ChromAberrAlpha, col.a)); + #endif + + //-------------------------------- + + //BLUR_ON + #if BLUR_ON + #if ATLAS_ON + #if !BLURISHD_ON + col = BlurHD(d.texcoord0.xy, _MainTex, sampler_MainTex, _BlurIntensity, (_MaxXUV - _MinXUV), (_MaxYUV - _MinYUV)) * d.vertexColor; + #else + col = Blur(d.texcoord0.xy, _MainTex, sampler_MainTex, _BlurIntensity * (_MaxXUV - _MinXUV)) * d.vertexColor; + #endif + #else + #if !BLURISHD_ON + col = BlurHD(d.texcoord0.xy, _MainTex, sampler_MainTex, _BlurIntensity, 1, 1) * d.vertexColor; + #else + col = Blur(d.texcoord0.xy, _MainTex, sampler_MainTex, _BlurIntensity) * d.vertexColor; + #endif + #endif + #endif + + //-------------------- + + //MOTIONBLUR_ON + #if MOTIONBLUR_ON + _MotionBlurAngle = _MotionBlurAngle * 3.1415926; + #define rot(n) mul(n, half2x2(cos(_MotionBlurAngle), -sin(_MotionBlurAngle), sin(_MotionBlurAngle), cos(_MotionBlurAngle))) + _MotionBlurDist = _MotionBlurDist * 0.005; + #if ATLAS_ON + _MotionBlurDist *= (_MaxXUV - _MinXUV); + #endif + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(-_MotionBlurDist, -_MotionBlurDist))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(-_MotionBlurDist * 2, -_MotionBlurDist * 2))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(-_MotionBlurDist * 3, -_MotionBlurDist * 3))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(-_MotionBlurDist * 4, -_MotionBlurDist * 4))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(_MotionBlurDist, _MotionBlurDist))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(_MotionBlurDist * 2, _MotionBlurDist * 2))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(_MotionBlurDist * 3, _MotionBlurDist * 3))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(_MotionBlurDist * 4, _MotionBlurDist * 4))); + col.rgb = col.rgb / 9; + #endif + //------------------------------------ + + //NEGATIVE_ON + #if NEGATIVE_ON + col.rgb = lerp(col.rgb, 1 - col.rgb, _NegativeAmount); + #endif + + //-------------- + half luminance = 0; + + //GREYSCALE_ON && !GREYSCALEOUTLINE_ON + #if GREYSCALE_ON && !GREYSCALEOUTLINE_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + luminance = saturate(luminance + _GreyscaleLuminosity); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _GreyscaleTintColor, _GreyscaleBlend); + #endif + //------------------------------------ + + //GHOST_ON + #if GHOST_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + half4 ghostResult; + ghostResult.a = saturate(luminance - _GhostTransparency) * col.a; + ghostResult.rgb = col.rgb * (luminance + _GhostColorBoost); + col = lerp(col, ghostResult, _GhostBlend); + #endif + //------------------------------------ + + //INNEROUTLINE_ON + #if INNEROUTLINE_ON + half3 innerT = abs(GetPixel(0, _InnerOutlineThickness, d.texcoord0.xy, _MainTex, sampler_MainTex) - GetPixel(0, -_InnerOutlineThickness, d.texcoord0.xy, _MainTex, sampler_MainTex)); + innerT += abs(GetPixel(_InnerOutlineThickness, 0, d.texcoord0.xy, _MainTex, sampler_MainTex) - GetPixel(-_InnerOutlineThickness, 0, d.texcoord0.xy, _MainTex, sampler_MainTex)); + #if !ONLYINNEROUTLINE_ON + innerT = (innerT / 2.0) * col.a * _InnerOutlineAlpha; + col.rgb += length(innerT) * _InnerOutlineColor.rgb * _InnerOutlineGlow; + #else + innerT *= col.a * _InnerOutlineAlpha; + col.rgb = length(innerT) * _InnerOutlineColor.rgb * _InnerOutlineGlow; + col.a = step(0.3, col.r+col.g+col.b); + #endif + #endif + //------------------------------------------------------- + + //HITEFFECT_ON + #if HITEFFECT_ON + col.rgb = lerp(col.rgb, _HitEffectColor.rgb * _HitEffectGlow, _HitEffectBlend); + #endif + //-------------------- + + //GRADIENT_ON + #if GRADIENT_ON + half2 tiledUvGrad = half2(uvRect.x / _MainTex_ST.x, uvRect.y / _MainTex_ST.y); + #if GRADIENT2COL_ON + _GradTopRightCol = _GradTopLeftCol; + _GradBotRightCol = _GradBotLeftCol; + #endif + #if RADIALGRADIENT_ON + half radialDist = 1 - length(tiledUvGrad - half2(0.5, 0.5)); + radialDist *= (_MainTex_TexelSize.w / _MainTex_TexelSize.z); + radialDist = saturate(_GradBoostX * radialDist); + half4 gradientResult = lerp(_GradTopLeftCol, _GradBotLeftCol, radialDist); + #else + half gradXLerpFactor = saturate(pow(tiledUvGrad.x, _GradBoostX)); + half4 gradientResult = lerp(lerp(_GradBotLeftCol, _GradBotRightCol, gradXLerpFactor), + lerp(_GradTopLeftCol, _GradTopRightCol, gradXLerpFactor), saturate(pow(tiledUvGrad.y, _GradBoostY))); + #endif + gradientResult = lerp(col, gradientResult, _GradBlend); + col.rgb = gradientResult.rgb * col.a; + col.a *= gradientResult.a; + #endif + //-------------------------------------------------------------------- + + //CONTRAST_ON + #if CONTRAST_ON + col.rgb = (col.rgb - float3(0.5, 0.5, 0.5)) * _Contrast + float3(0.5, 0.5, 0.5); + col.rgb += _Brightness; + #endif + + //------------------------------------------------------------------- + + //COLORSWAP_ON + #if COLORSWAP_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + half4 swapMask = SAMPLE_TEXTURE2D(_ColorSwapTex, sampler_ColorSwapTex, d.texcoord0.xy); + swapMask.rgb *= swapMask.a; + half3 redSwap = _ColorSwapRed * swapMask.r * saturate(luminance + _ColorSwapRedLuminosity); + half3 greenSwap = _ColorSwapGreen * swapMask.g * saturate(luminance + _ColorSwapGreenLuminosity); + half3 blueSwap = _ColorSwapBlue * swapMask.b * saturate(luminance + _ColorSwapBlueLuminosity); + swapMask.rgb = col.rgb * saturate(1 - swapMask.r - swapMask.g - swapMask.b); + col.rgb = lerp(col.rgb, swapMask.rgb + redSwap + greenSwap + blueSwap, _ColorSwapBlend); + #endif + //-------------------------------------------------------------------- + + //COLORRAMP_ON && !COLORRAMPOUTLINE_ON + #if COLORRAMP_ON && !COLORRAMPOUTLINE_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + luminance = saturate(luminance + _ColorRampLuminosity); + #if GRADIENTCOLORRAMP_ON + col.rgb = lerp(col.rgb, SAMPLE_TEXTURE2D(_ColorRampTexGradient, sampler_ColorRampTexGradient, half2(luminance, 0)).rgb, _ColorRampBlend); + #else + col.rgb = lerp(col.rgb, SAMPLE_TEXTURE2D(_ColorRampTex, sampler_ColorRampTex, half2(luminance, 0)).rgb, _ColorRampBlend); + #endif + #endif + //-------------------------------------------------------------------- + + //CHANGECOLOR_ON + #if CHANGECOLOR_ON + float3 currChangeColor = saturate(col.rgb); + luminance = 0.3 * currChangeColor.r + 0.59 * currChangeColor.g + 0.11 * currChangeColor.b; + luminance = saturate(luminance + _ColorChangeLuminosity); + half3 dif = abs(currChangeColor - _ColorChangeTarget.rgb); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _ColorChangeNewCol.rgb, + max(sign(1 - saturate(dif.x + dif.y + dif.z) - _ColorChangeTolerance), 0.0)); + #if CHANGECOLOR2_ON + dif = abs(currChangeColor - _ColorChangeTarget2.rgb); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _ColorChangeNewCol2.rgb, + max(sign(1 - saturate(dif.x + dif.y + dif.z) - _ColorChangeTolerance2), 0.0)); + #endif + #if CHANGECOLOR3_ON + dif = abs(currChangeColor - _ColorChangeTarget3.rgb); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _ColorChangeNewCol3.rgb, + max(sign(1 - saturate(dif.x + dif.y + dif.z) - _ColorChangeTolerance3), 0.0)); + #endif + #endif + //------------------------------------------------------- + + //POSTERIZE_ON && !POSTERIZEOUTLINE_ON + #if POSTERIZE_ON && !POSTERIZEOUTLINE_ON + col.rgb = pow(col.rgb, _PosterizeGamma) * _PosterizeNumColors; + col.rgb = floor(col.rgb) / _PosterizeNumColors; + col.rgb = pow(col.rgb, 1.0 / _PosterizeGamma); + #endif + //------------------------------------ + + //HSV_ON + #if HSV_ON + half3 resultHsv = half3(col.rgb); + half cosHsv = _HsvBright * _HsvSaturation * cos(_HsvShift * 3.14159265 / 180); + half sinHsv = _HsvBright * _HsvSaturation * sin(_HsvShift * 3.14159265 / 180); + resultHsv.x = (.299 * _HsvBright + .701 * cosHsv + .168 * sinHsv) * col.x + + (.587 * _HsvBright - .587 * cosHsv + .330 * sinHsv) * col.y + + (.114 * _HsvBright - .114 * cosHsv - .497 * sinHsv) * col.z; + resultHsv.y = (.299 * _HsvBright - .299 * cosHsv - .328 * sinHsv) *col.x + + (.587 * _HsvBright + .413 * cosHsv + .035 * sinHsv) * col.y + + (.114 * _HsvBright - .114 * cosHsv + .292 * sinHsv) * col.z; + resultHsv.z = (.299 * _HsvBright - .3 * cosHsv + 1.25 * sinHsv) * col.x + + (.587 * _HsvBright - .588 * cosHsv - 1.05 * sinHsv) * col.y + + (.114 * _HsvBright + .886 * cosHsv - .203 * sinHsv) * col.z; + col.rgb = resultHsv; + #endif + //------------------------------------------------------- + + //OVERLAY_ON + #if OVERLAY_ON + half2 overlayUvs = d.texcoord0.xy; + overlayUvs.x += ((_Time.y + randomSeed) * _OverlayTextureScrollXSpeed) % 1; + overlayUvs.y += ((_Time.y + randomSeed) * _OverlayTextureScrollYSpeed) % 1; + half4 overlayCol = SAMPLE_TEXTURE2D(_OverlayTex, sampler_OverlayTex, TRANSFORM_TEX(overlayUvs, _OverlayTex)); + overlayCol.rgb *= _OverlayColor.rgb * _OverlayGlow; + #if !OVERLAYMULT_ON + overlayCol.rgb *= overlayCol.a * _OverlayColor.rgb * _OverlayColor.a * _OverlayBlend; + col.rgb += overlayCol.rgb; + #else + overlayCol.a *= _OverlayColor.a; + col = lerp(col, col * overlayCol, _OverlayBlend); + #endif + #endif + + //--------------------------------- + + //OUTBASE_ON + #if OUTBASE_ON + #if OUTBASEPIXELPERF_ON + half2 destUv = half2(_OutlinePixelWidth * _MainTex_TexelSize.x, _OutlinePixelWidth * _MainTex_TexelSize.y); + #else + half2 destUv = half2(_OutlineWidth * _MainTex_TexelSize.x * 200, _OutlineWidth * _MainTex_TexelSize.y * 200); + #endif + + #if OUTDIST_ON + d.texcoord3.x += ((_Time.x + _RandomSeed) * _OutlineDistortTexXSpeed) % 1; + d.texcoord3.y += ((_Time.x + _RandomSeed) * _OutlineDistortTexYSpeed) % 1; + #if ATLAS_ON + d.texcoord3 = half2((d.texcoord3.x - _MinXUV) / (_MaxXUV - _MinXUV), (d.texcoord3.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half outDistortAmnt = (SAMPLE_TEXTURE2D(_OutlineDistortTex, sampler_OutlineDistortTex, d.texcoord3).r - 0.5) * 0.2 * _OutlineDistortAmount; + destUv.x += outDistortAmnt; + destUv.y += outDistortAmnt; + #endif + + half spriteLeft = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(destUv.x, 0)).a; + half spriteRight = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy - half2(destUv.x, 0)).a; + half spriteBottom = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(0, destUv.y)).a; + half spriteTop = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy - half2(0, destUv.y)).a; + half result = spriteLeft + spriteRight + spriteBottom + spriteTop; + + #if OUTBASE8DIR_ON + half spriteTopLeft = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(destUv.x, destUv.y)).a; + half spriteTopRight = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(-destUv.x, destUv.y)).a; + half spriteBotLeft = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(destUv.x, -destUv.y)).a; + half spriteBotRight = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(-destUv.x, -destUv.y)).a; + result = result + spriteTopLeft + spriteTopRight + spriteBotLeft + spriteBotRight; + #endif + + result = step(0.05, saturate(result)); + + #if OUTTEX_ON + d.texcoord1.x += ((_Time.x + _RandomSeed) * _OutlineTexXSpeed) % 1; + d.texcoord1.y += ((_Time.x + _RandomSeed) * _OutlineTexYSpeed) % 1; + #if ATLAS_ON + d.texcoord1 = half2((d.texcoord1.x - _MinXUV) / (_MaxXUV - _MinXUV), (d.texcoord1.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half4 tempOutColor = SAMPLE_TEXTURE2D(_OutlineTex, sampler_OutlineTex, d.texcoord1); + tempOutColor *= _OutlineColor; + _OutlineColor = tempOutColor; + #endif + + result *= (1 - originalAlpha) * _OutlineAlpha; + + half4 outline = _OutlineColor * d.vertexColor.a; + outline.rgb *= _OutlineGlow; + outline.a = result; + #if ONLYOUTLINE_ON + col = outline; + #else + col = lerp(col, outline, result); + #endif + #endif + //------------------------------------------------------- + + //FADE_ON + #if FADE_ON + half2 tiledUvFade1 = TRANSFORM_TEX(d.texcoord0, _FadeTex); + half2 tiledUvFade2 = TRANSFORM_TEX(d.texcoord0, _FadeBurnTex); + #if ATLAS_ON + tiledUvFade1 = half2((tiledUvFade1.x - _MinXUV) / (_MaxXUV - _MinXUV), (tiledUvFade1.y - _MinYUV) / (_MaxYUV - _MinYUV)); + tiledUvFade2 = half2((tiledUvFade2.x - _MinXUV) / (_MaxXUV - _MinXUV), (tiledUvFade2.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half fadeTemp = SAMPLE_TEXTURE2D(_FadeTex, sampler_FadeTex, tiledUvFade1).r; + half fade = smoothstep(_FadeAmount, _FadeAmount + _FadeBurnTransition, fadeTemp); + half fadeBurn = saturate(smoothstep(_FadeAmount - _FadeBurnWidth, _FadeAmount - _FadeBurnWidth + 0.1, fadeTemp) * _FadeAmount); + col.a *= fade; + _FadeBurnColor.rgb *= _FadeBurnGlow; + col += fadeBurn * SAMPLE_TEXTURE2D(_FadeBurnTex, sampler_FadeBurnTex, tiledUvFade2) * _FadeBurnColor * originalAlpha * (1 - col.a); + #endif + //------------------------------------------------------- + + //SHADOW_ON + #if SHADOW_ON + half shadowA = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(_ShadowX, _ShadowY)).a; + half preMultShadowMask = 1 - (saturate(shadowA - col.a) * (1 - col.a)); + col.rgb *= 1 - ((shadowA - col.a) * (1 - col.a)); + col.rgb += (_ShadowColor * shadowA) * (1 - col.a); + col.a = max(shadowA * _ShadowAlpha * d.vertexColor.a, col.a); + #endif + + //------------------------------------------------------- + + //GLOW_ON + #if GLOW_ON + half4 emission; + #if GLOWTEX_ON + emission = SAMPLE_TEXTURE2D(_GlowTex, sampler_GlowTex, d.texcoord0); + #else + emission = col; + #endif + + col.rgb *= _GlowGlobal; + emission.rgb *= emission.a * col.a * _Glow * _GlowColor; + col.rgb += emission.rgb; + #endif + //------------------------------------------------------- + + //COLORRAMP_ON && COLORRAMPOUTLINE_ON + #if COLORRAMP_ON && COLORRAMPOUTLINE_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + luminance = saturate(luminance + _ColorRampLuminosity); + #if GRADIENTCOLORRAMP_ON + col.rgb = lerp(col.rgb, SAMPLE_TEXTURE2D(_ColorRampTexGradient, sampler_ColorRampTexGradient, half2(luminance, 0)).rgb, _ColorRampBlend); + #else + col.rgb = lerp(col.rgb, SAMPLE_TEXTURE2D(_ColorRampTex, sampler_ColorRampTex, half2(luminance, 0)).rgb, _ColorRampBlend); + #endif + #endif + //--------------- + + //GREYSCALE_ON && GREYSCALEOUTLINE_ON + #if GREYSCALE_ON && GREYSCALEOUTLINE_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + luminance = saturate(luminance + _GreyscaleLuminosity); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _GreyscaleTintColor, _GreyscaleBlend); + #endif + + //----------------------------------- + + //POSTERIZE_ON && POSTERIZEOUTLINE_ON + #if POSTERIZE_ON && POSTERIZEOUTLINE_ON + col.rgb = pow(col.rgb, _PosterizeGamma) * _PosterizeNumColors; + col.rgb = floor(col.rgb) / _PosterizeNumColors; + col.rgb = pow(col.rgb, 1.0 / _PosterizeGamma); + #endif + + //----------------------------------- + + //SHINE_ON + #if SHINE_ON + half2 uvShine = uvRect; + half cosAngle = cos(_ShineRotate); + half sinAngle = sin(_ShineRotate); + half2x2 rot = half2x2(cosAngle, -sinAngle, sinAngle, cosAngle); + uvShine -= half2(0.5, 0.5); + uvShine = mul(rot, uvShine); + uvShine += half2(0.5, 0.5); + half shineMask = SAMPLE_TEXTURE2D(_ShineMask, sampler_ShineMask, d.texcoord0.xy).a; + half currentDistanceProjection = (uvShine.x + uvShine.y) / 2; + half whitePower = 1 - (abs(currentDistanceProjection - _ShineLocation) / _ShineWidth); + col.rgb += col.a * whitePower * _ShineGlow * max(sign(currentDistanceProjection - (_ShineLocation - _ShineWidth)), 0.0) + * max(sign((_ShineLocation + _ShineWidth) - currentDistanceProjection), 0.0) * _ShineColor * shineMask; + #endif + + //----------------------------------- + + //HOLOGRAM_ON + #if HOLOGRAM_ON + half totalHologram = _HologramStripesAmount + _HologramUnmodAmount; + half hologramYCoord = ((uvRect.y + (((_Time.x + randomSeed) % 1) * _HologramStripesSpeed)) % totalHologram) / totalHologram; + hologramYCoord = abs(hologramYCoord); + half alpha = RemapFloat(saturate(hologramYCoord - (_HologramUnmodAmount/totalHologram)), 0.0, 1.0, _HologramMinAlpha, saturate(_HologramMaxAlpha)); + half hologramMask = max(sign((_HologramUnmodAmount/totalHologram) - hologramYCoord), 0.0); + half4 hologramResult = col; + hologramResult.a *= lerp(alpha, 1, hologramMask); + hologramResult.rgb *= max(1, _HologramMaxAlpha * max(sign(hologramYCoord - (_HologramUnmodAmount/totalHologram)), 0.0)); + hologramMask = 1 - step(0.01,hologramMask); + hologramResult.rgb += hologramMask * _HologramStripeColor * col.a; + col = lerp(col, hologramResult, _HologramBlend); + #endif + + //----------------------------------- + + //FLICKER_ON + #if FLICKER_ON + col.a *= saturate(col.a * step(frac(0.05 + (_Time.w + randomSeed) * _FlickerFreq), 1 - _FlickerPercent) + _FlickerAlpha); + #endif + //----------------------------------- + + //ALPHACUTOFF_ON + + //ALPHAROUND_ON + + //ALPHAOUTLINE_ON + #if ALPHAOUTLINE_ON + half alphaOutlineRes = pow(1 - col.a, max(_AlphaOutlinePower, 0.0001)) * step(_AlphaOutlineMinAlpha, col.a) * _AlphaOutlineBlend; + col.rgb = lerp(col.rgb, _AlphaOutlineColor.rgb * _AlphaOutlineGlow, alphaOutlineRes); + col.a = lerp(col.a, 1, alphaOutlineRes > 1); + #endif + //------------------------------------------------------- + + //FOG_ON + + //------------------ + + col *= _Color; + o.Albedo = col; + col.a *= _Alpha; + clip(col.a - _AlphaCutoffValue - 0.01); + o.Alpha = _Color.a; + } + + + + + + void ChainSurfaceFunction(inout Surface l, inout ShaderData d) + { + Ext_SurfaceFunction0(l, d); + // Ext_SurfaceFunction1(l, d); + // Ext_SurfaceFunction2(l, d); + // Ext_SurfaceFunction3(l, d); + // Ext_SurfaceFunction4(l, d); + // Ext_SurfaceFunction5(l, d); + // Ext_SurfaceFunction6(l, d); + // Ext_SurfaceFunction7(l, d); + // Ext_SurfaceFunction8(l, d); + // Ext_SurfaceFunction9(l, d); + // Ext_SurfaceFunction10(l, d); + // Ext_SurfaceFunction11(l, d); + // Ext_SurfaceFunction12(l, d); + // Ext_SurfaceFunction13(l, d); + // Ext_SurfaceFunction14(l, d); + // Ext_SurfaceFunction15(l, d); + // Ext_SurfaceFunction16(l, d); + // Ext_SurfaceFunction17(l, d); + // Ext_SurfaceFunction18(l, d); + // Ext_SurfaceFunction19(l, d); + // Ext_SurfaceFunction20(l, d); + // Ext_SurfaceFunction21(l, d); + // Ext_SurfaceFunction22(l, d); + // Ext_SurfaceFunction23(l, d); + // Ext_SurfaceFunction24(l, d); + // Ext_SurfaceFunction25(l, d); + // Ext_SurfaceFunction26(l, d); + // Ext_SurfaceFunction27(l, d); + // Ext_SurfaceFunction28(l, d); + // Ext_SurfaceFunction29(l, d); + } + +#if !_DECALSHADER + + void ChainModifyVertex(inout VertexData v, inout VertexToPixel v2p, float4 time) + { + ExtraV2F d; + + ZERO_INITIALIZE(ExtraV2F, d); + ZERO_INITIALIZE(Blackboard, d.blackboard); + // due to motion vectors in HDRP, we need to use the last + // time in certain spots. So if you are going to use _Time to adjust vertices, + // you need to use this time or motion vectors will break. + d.time = time; + + Ext_ModifyVertex0(v, d); + // Ext_ModifyVertex1(v, d); + // Ext_ModifyVertex2(v, d); + // Ext_ModifyVertex3(v, d); + // Ext_ModifyVertex4(v, d); + // Ext_ModifyVertex5(v, d); + // Ext_ModifyVertex6(v, d); + // Ext_ModifyVertex7(v, d); + // Ext_ModifyVertex8(v, d); + // Ext_ModifyVertex9(v, d); + // Ext_ModifyVertex10(v, d); + // Ext_ModifyVertex11(v, d); + // Ext_ModifyVertex12(v, d); + // Ext_ModifyVertex13(v, d); + // Ext_ModifyVertex14(v, d); + // Ext_ModifyVertex15(v, d); + // Ext_ModifyVertex16(v, d); + // Ext_ModifyVertex17(v, d); + // Ext_ModifyVertex18(v, d); + // Ext_ModifyVertex19(v, d); + // Ext_ModifyVertex20(v, d); + // Ext_ModifyVertex21(v, d); + // Ext_ModifyVertex22(v, d); + // Ext_ModifyVertex23(v, d); + // Ext_ModifyVertex24(v, d); + // Ext_ModifyVertex25(v, d); + // Ext_ModifyVertex26(v, d); + // Ext_ModifyVertex27(v, d); + // Ext_ModifyVertex28(v, d); + // Ext_ModifyVertex29(v, d); + + + // #if %EXTRAV2F0REQUIREKEY% + // v2p.extraV2F0 = d.extraV2F0; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // v2p.extraV2F1 = d.extraV2F1; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // v2p.extraV2F2 = d.extraV2F2; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // v2p.extraV2F3 = d.extraV2F3; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // v2p.extraV2F4 = d.extraV2F4; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // v2p.extraV2F5 = d.extraV2F5; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // v2p.extraV2F6 = d.extraV2F6; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // v2p.extraV2F7 = d.extraV2F7; + // #endif + } + + void ChainModifyTessellatedVertex(inout VertexData v, inout VertexToPixel v2p) + { + ExtraV2F d; + ZERO_INITIALIZE(ExtraV2F, d); + ZERO_INITIALIZE(Blackboard, d.blackboard); + + // #if %EXTRAV2F0REQUIREKEY% + // d.extraV2F0 = v2p.extraV2F0; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // d.extraV2F1 = v2p.extraV2F1; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // d.extraV2F2 = v2p.extraV2F2; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // d.extraV2F3 = v2p.extraV2F3; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // d.extraV2F4 = v2p.extraV2F4; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // d.extraV2F5 = v2p.extraV2F5; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // d.extraV2F6 = v2p.extraV2F6; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // d.extraV2F7 = v2p.extraV2F7; + // #endif + + + // Ext_ModifyTessellatedVertex0(v, d); + // Ext_ModifyTessellatedVertex1(v, d); + // Ext_ModifyTessellatedVertex2(v, d); + // Ext_ModifyTessellatedVertex3(v, d); + // Ext_ModifyTessellatedVertex4(v, d); + // Ext_ModifyTessellatedVertex5(v, d); + // Ext_ModifyTessellatedVertex6(v, d); + // Ext_ModifyTessellatedVertex7(v, d); + // Ext_ModifyTessellatedVertex8(v, d); + // Ext_ModifyTessellatedVertex9(v, d); + // Ext_ModifyTessellatedVertex10(v, d); + // Ext_ModifyTessellatedVertex11(v, d); + // Ext_ModifyTessellatedVertex12(v, d); + // Ext_ModifyTessellatedVertex13(v, d); + // Ext_ModifyTessellatedVertex14(v, d); + // Ext_ModifyTessellatedVertex15(v, d); + // Ext_ModifyTessellatedVertex16(v, d); + // Ext_ModifyTessellatedVertex17(v, d); + // Ext_ModifyTessellatedVertex18(v, d); + // Ext_ModifyTessellatedVertex19(v, d); + // Ext_ModifyTessellatedVertex20(v, d); + // Ext_ModifyTessellatedVertex21(v, d); + // Ext_ModifyTessellatedVertex22(v, d); + // Ext_ModifyTessellatedVertex23(v, d); + // Ext_ModifyTessellatedVertex24(v, d); + // Ext_ModifyTessellatedVertex25(v, d); + // Ext_ModifyTessellatedVertex26(v, d); + // Ext_ModifyTessellatedVertex27(v, d); + // Ext_ModifyTessellatedVertex28(v, d); + // Ext_ModifyTessellatedVertex29(v, d); + + // #if %EXTRAV2F0REQUIREKEY% + // v2p.extraV2F0 = d.extraV2F0; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // v2p.extraV2F1 = d.extraV2F1; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // v2p.extraV2F2 = d.extraV2F2; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // v2p.extraV2F3 = d.extraV2F3; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // v2p.extraV2F4 = d.extraV2F4; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // v2p.extraV2F5 = d.extraV2F5; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // v2p.extraV2F6 = d.extraV2F6; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // v2p.extraV2F7 = d.extraV2F7; + // #endif + } + + void ChainFinalColorForward(inout Surface l, inout ShaderData d, inout half4 color) + { + // Ext_FinalColorForward0(l, d, color); + // Ext_FinalColorForward1(l, d, color); + // Ext_FinalColorForward2(l, d, color); + // Ext_FinalColorForward3(l, d, color); + // Ext_FinalColorForward4(l, d, color); + // Ext_FinalColorForward5(l, d, color); + // Ext_FinalColorForward6(l, d, color); + // Ext_FinalColorForward7(l, d, color); + // Ext_FinalColorForward8(l, d, color); + // Ext_FinalColorForward9(l, d, color); + // Ext_FinalColorForward10(l, d, color); + // Ext_FinalColorForward11(l, d, color); + // Ext_FinalColorForward12(l, d, color); + // Ext_FinalColorForward13(l, d, color); + // Ext_FinalColorForward14(l, d, color); + // Ext_FinalColorForward15(l, d, color); + // Ext_FinalColorForward16(l, d, color); + // Ext_FinalColorForward17(l, d, color); + // Ext_FinalColorForward18(l, d, color); + // Ext_FinalColorForward19(l, d, color); + // Ext_FinalColorForward20(l, d, color); + // Ext_FinalColorForward21(l, d, color); + // Ext_FinalColorForward22(l, d, color); + // Ext_FinalColorForward23(l, d, color); + // Ext_FinalColorForward24(l, d, color); + // Ext_FinalColorForward25(l, d, color); + // Ext_FinalColorForward26(l, d, color); + // Ext_FinalColorForward27(l, d, color); + // Ext_FinalColorForward28(l, d, color); + // Ext_FinalColorForward29(l, d, color); + } + + void ChainFinalGBufferStandard(inout Surface s, inout ShaderData d, inout half4 GBuffer0, inout half4 GBuffer1, inout half4 GBuffer2, inout half4 outEmission, inout half4 outShadowMask) + { + // Ext_FinalGBufferStandard0(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard1(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard2(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard3(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard4(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard5(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard6(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard7(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard8(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard9(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard10(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard11(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard12(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard13(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard14(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard15(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard16(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard17(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard18(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard19(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard20(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard21(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard22(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard23(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard24(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard25(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard26(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard27(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard28(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard29(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + } +#endif + + + + + +#if _DECALSHADER + + ShaderData CreateShaderData(SurfaceDescriptionInputs IN) + { + ShaderData d = (ShaderData)0; + d.TBNMatrix = float3x3(IN.WorldSpaceTangent, IN.WorldSpaceBiTangent, IN.WorldSpaceNormal); + d.worldSpaceNormal = IN.WorldSpaceNormal; + d.worldSpaceTangent = IN.WorldSpaceTangent; + + d.worldSpacePosition = IN.WorldSpacePosition; + d.texcoord0 = IN.uv0.xyxy; + d.screenPos = IN.ScreenPosition; + + d.worldSpaceViewDir = normalize(_WorldSpaceCameraPos - d.worldSpacePosition); + + d.tangentSpaceViewDir = mul(d.TBNMatrix, d.worldSpaceViewDir); + + // these rarely get used, so we back transform them. Usually will be stripped. + #if _HDRP + // d.localSpacePosition = mul(GetWorldToObjectMatrix(), float4(GetCameraRelativePositionWS(d.worldSpacePosition), 1)).xyz; + #else + // d.localSpacePosition = mul(GetWorldToObjectMatrix(), float4(d.worldSpacePosition, 1)).xyz; + #endif + // d.localSpaceNormal = normalize(mul((float3x3)GetWorldToObjectMatrix(), d.worldSpaceNormal)); + // d.localSpaceTangent = normalize(mul((float3x3)GetWorldToObjectMatrix(), d.worldSpaceTangent.xyz)); + + // #if %SCREENPOSREQUIREKEY% + // d.screenUV = (IN.ScreenPosition.xy / max(0.01, IN.ScreenPosition.w)); + // #endif + + return d; + } +#else + + ShaderData CreateShaderData(VertexToPixel i + #if NEED_FACING + , bool facing + #endif + ) + { + ShaderData d = (ShaderData)0; + d.clipPos = i.pos; + d.worldSpacePosition = i.worldPos; + + d.worldSpaceNormal = normalize(i.worldNormal); + d.worldSpaceTangent.xyz = normalize(i.worldTangent.xyz); + + d.tangentSign = i.worldTangent.w * unity_WorldTransformParams.w; + float3 bitangent = cross(d.worldSpaceTangent.xyz, d.worldSpaceNormal) * d.tangentSign; + + d.TBNMatrix = float3x3(d.worldSpaceTangent, -bitangent, d.worldSpaceNormal); + d.worldSpaceViewDir = normalize(_WorldSpaceCameraPos - i.worldPos); + + d.tangentSpaceViewDir = mul(d.TBNMatrix, d.worldSpaceViewDir); + d.texcoord0 = i.texcoord0; + d.texcoord1 = i.texcoord1; + d.texcoord2 = i.texcoord2; + + // #if %TEXCOORD3REQUIREKEY% + d.texcoord3 = i.texcoord3; + // #endif + + // d.isFrontFace = facing; + // #if %VERTEXCOLORREQUIREKEY% + d.vertexColor = i.vertexColor; + // #endif + + // these rarely get used, so we back transform them. Usually will be stripped. + #if _HDRP + // d.localSpacePosition = mul(GetWorldToObjectMatrix(), float4(GetCameraRelativePositionWS(i.worldPos), 1)).xyz; + #else + // d.localSpacePosition = mul(GetWorldToObjectMatrix(), float4(i.worldPos, 1)).xyz; + #endif + // d.localSpaceNormal = normalize(mul((float3x3)GetWorldToObjectMatrix(), i.worldNormal)); + // d.localSpaceTangent = normalize(mul((float3x3)GetWorldToObjectMatrix(), i.worldTangent.xyz)); + + // #if %SCREENPOSREQUIREKEY% + // d.screenPos = i.screenPos; + // d.screenUV = (i.screenPos.xy / i.screenPos.w); + // #endif + + + // #if %EXTRAV2F0REQUIREKEY% + // d.extraV2F0 = i.extraV2F0; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // d.extraV2F1 = i.extraV2F1; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // d.extraV2F2 = i.extraV2F2; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // d.extraV2F3 = i.extraV2F3; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // d.extraV2F4 = i.extraV2F4; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // d.extraV2F5 = i.extraV2F5; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // d.extraV2F6 = i.extraV2F6; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // d.extraV2F7 = i.extraV2F7; + // #endif + + return d; + } + +#endif + + + #if _PASSSHADOW + float3 _LightDirection; + #endif + + // vertex shader + VertexToPixel Vert (VertexData v) + { + + VertexToPixel o = (VertexToPixel)0; + + UNITY_SETUP_INSTANCE_ID(v); + UNITY_TRANSFER_INSTANCE_ID(v, o); + UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o); + + +#if !_TESSELLATION_ON + ChainModifyVertex(v, o, _Time); +#endif + + o.texcoord0 = v.texcoord0; + o.texcoord1 = v.texcoord1; + o.texcoord2 = v.texcoord2; + + // #if %TEXCOORD3REQUIREKEY% + o.texcoord3 = v.texcoord3; + // #endif + + // #if %VERTEXCOLORREQUIREKEY% + o.vertexColor = v.vertexColor; + // #endif + + VertexPositionInputs vertexInput = GetVertexPositionInputs(v.vertex.xyz); + o.worldPos = TransformObjectToWorld(v.vertex.xyz); + o.worldNormal = TransformObjectToWorldNormal(v.normal); + o.worldTangent = float4(TransformObjectToWorldDir(v.tangent.xyz), v.tangent.w); + + + #if _PASSSHADOW + // Define shadow pass specific clip position for Universal + o.pos = TransformWorldToHClip(ApplyShadowBias(o.worldPos, o.worldNormal, _LightDirection)); + #if UNITY_REVERSED_Z + o.pos.z = min(o.pos.z, o.pos.w * UNITY_NEAR_CLIP_VALUE); + #else + o.pos.z = max(o.pos.z, o.pos.w * UNITY_NEAR_CLIP_VALUE); + #endif + #elif _PASSMETA + o.pos = MetaVertexPosition(float4(v.vertex.xyz, 0), v.texcoord1.xy, v.texcoord2.xy, unity_LightmapST, unity_DynamicLightmapST); + #else + o.pos = TransformWorldToHClip(o.worldPos); + #endif + + + // #if %SCREENPOSREQUIREKEY% + // o.screenPos = ComputeScreenPos(o.pos, _ProjectionParams.x); + // #endif + + #if _PASSFORWARD || _PASSGBUFFER + float2 uv1 = v.texcoord1.xy; + OUTPUT_LIGHTMAP_UV(uv1, unity_LightmapST, o.lightmapUV); + o.texcoord1.xy = uv1; + OUTPUT_SH(o.worldNormal, o.sh); + #endif + + #ifdef VARYINGS_NEED_FOG_AND_VERTEX_LIGHT + #if _BAKEDLIT + half3 vertexLight = 0; + #else + half3 vertexLight = VertexLighting(o.worldPos, o.worldNormal); + #endif + half fogFactor = ComputeFogFactor(o.pos.z); + o.fogFactorAndVertexLight = half4(fogFactor, vertexLight); + #endif + + #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR) + o.shadowCoord = GetShadowCoord(vertexInput); + #endif + + return o; + } + + + + + // fragment shader + half4 Frag (VertexToPixel IN + #ifdef _DEPTHOFFSET_ON + , out float outputDepth : SV_Depth + #endif + #if NEED_FACING + , bool facing : SV_IsFrontFace + #endif + ) : SV_Target + { + UNITY_SETUP_INSTANCE_ID(IN); + + ShaderData d = CreateShaderData(IN + #if NEED_FACING + , facing + #endif + ); + Surface l = (Surface)0; + + #ifdef _DEPTHOFFSET_ON + l.outputDepth = outputDepth; + #endif + + l.Albedo = half3(0.5, 0.5, 0.5); + l.Normal = float3(0,0,1); + l.Occlusion = 1; + l.Alpha = 1; + + ChainSurfaceFunction(l, d); + + #ifdef _DEPTHOFFSET_ON + outputDepth = l.outputDepth; + #endif + + return 0; + + } + + ENDHLSL + + } + + + + Pass + { + Name "DepthOnly" + Tags + { + "LightMode" = "DepthOnly" + } + + // Render State + Blend One Zero, One Zero + Cull Back + ZTest LEqual + ZWrite On + ColorMask 0 + + Tags { "RenderType" = "Opaque" "Queue" = "Geometry" "PreviewType" = "Plane" } + Cull [_CullingOption] + ZWrite [_ZWrite] + ZTest [_ZTestMode] + + + HLSLPROGRAM + + #pragma vertex Vert + #pragma fragment Frag + + + #define SHADERPASS_DEPTHONLY + #define _PASSDEPTH 1 + + #pragma target 3.0 + #pragma prefer_hlslcc gles + #pragma exclude_renderers d3d11_9x + #pragma multi_compile_instancing + #pragma multi_compile _ DOTS_INSTANCING_ON + + + #pragma shader_feature_local GLOW_ON + #pragma shader_feature_local FADE_ON + #pragma shader_feature_local OUTBASE_ON + #pragma shader_feature_local ONLYOUTLINE_ON + #pragma shader_feature_local GRADIENT_ON + #pragma shader_feature_local GRADIENT2COL_ON + #pragma shader_feature_local RADIALGRADIENT_ON + #pragma shader_feature_local COLORSWAP_ON + #pragma shader_feature_local HSV_ON + #pragma shader_feature_local CHANGECOLOR_ON + #pragma shader_feature_local CHANGECOLOR2_ON + #pragma shader_feature_local CHANGECOLOR3_ON + #pragma shader_feature_local COLORRAMP_ON + #pragma shader_feature_local GRADIENTCOLORRAMP_ON + #pragma shader_feature_local HITEFFECT_ON + #pragma shader_feature_local NEGATIVE_ON + #pragma shader_feature_local PIXELATE_ON + #pragma shader_feature_local GREYSCALE_ON + #pragma shader_feature_local POSTERIZE_ON + #pragma shader_feature_local BLUR_ON + #pragma shader_feature_local MOTIONBLUR_ON + #pragma shader_feature_local GHOST_ON + #pragma shader_feature_local ALPHAOUTLINE_ON + #pragma shader_feature_local INNEROUTLINE_ON + #pragma shader_feature_local ONLYINNEROUTLINE_ON + #pragma shader_feature_local HOLOGRAM_ON + #pragma shader_feature_local CHROMABERR_ON + #pragma shader_feature_local GLITCH_ON + #pragma shader_feature_local FLICKER_ON + #pragma shader_feature_local SHADOW_ON + #pragma shader_feature_local SHINE_ON + #pragma shader_feature_local CONTRAST_ON + #pragma shader_feature_local OVERLAY_ON + #pragma shader_feature_local OVERLAYMULT_ON + #pragma shader_feature_local DOODLE_ON + #pragma shader_feature_local WIND_ON + #pragma shader_feature_local WAVEUV_ON + #pragma shader_feature_local ROUNDWAVEUV_ON + #pragma shader_feature_local RECTSIZE_ON + #pragma shader_feature_local OFFSETUV_ON + #pragma shader_feature_local CLIPPING_ON + #pragma shader_feature_local RADIALCLIPPING_ON + #pragma shader_feature_local TEXTURESCROLL_ON + #pragma shader_feature_local ZOOMUV_ON + #pragma shader_feature_local DISTORT_ON + #pragma shader_feature_local WARP_ON + #pragma shader_feature_local TWISTUV_ON + #pragma shader_feature_local ROTATEUV_ON + #pragma shader_feature_local POLARUV_ON + #pragma shader_feature_local FISHEYE_ON + #pragma shader_feature_local PINCH_ON + #pragma shader_feature_local SHAKEUV_ON + + #pragma shader_feature_local GLOWTEX_ON + #pragma shader_feature_local OUTTEX_ON + #pragma shader_feature_local OUTDIST_ON + #pragma shader_feature_local OUTBASE8DIR_ON + #pragma shader_feature_local OUTBASEPIXELPERF_ON + #pragma shader_feature_local COLORRAMPOUTLINE_ON + #pragma shader_feature_local GREYSCALEOUTLINE_ON + #pragma shader_feature_local POSTERIZEOUTLINE_ON + #pragma shader_feature_local BLURISHD_ON + #pragma shader_feature_local MANUALWIND_ON + #pragma shader_feature_local ATLAS_ON + #pragma shader_feature_local PREMULTIPLYALPHA_ON + + #pragma shader_feature BILBOARD_ON + #pragma shader_feature BILBOARDY_ON + + #pragma shader_feature NORMALMAP_ON + + + #define _URP 1 +#define _USINGTEXCOORD1 1 +#define _USINGTEXCOORD2 1 + + // Includes + #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Version.hlsl" + #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Color.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.universal/ShaderLibrary/ShaderGraphFunctions.hlsl" + #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/TextureStack.hlsl" + #include "Packages/com.unity.shadergraph/ShaderGraphLibrary/ShaderVariablesFunctions.hlsl" + + + #undef WorldNormalVector + #define WorldNormalVector(data, normal) mul(normal, data.TBNMatrix) + + #define UnityObjectToWorldNormal(normal) mul(GetObjectToWorldMatrix(), normal) + + #define _WorldSpaceLightPos0 _MainLightPosition + + #define UNITY_DECLARE_TEX2D(name) TEXTURE2D(name); SAMPLER(sampler##name); + #define UNITY_DECLARE_TEX2D_NOSAMPLER(name) TEXTURE2D(name); + #define UNITY_DECLARE_TEX2DARRAY(name) TEXTURE2D_ARRAY(name); SAMPLER(sampler##name); + #define UNITY_DECLARE_TEX2DARRAY_NOSAMPLER(name) TEXTURE2D_ARRAY(name); + + #define UNITY_SAMPLE_TEX2DARRAY(tex,coord) SAMPLE_TEXTURE2D_ARRAY(tex, sampler##tex, coord.xy, coord.z) + #define UNITY_SAMPLE_TEX2DARRAY_LOD(tex,coord,lod) SAMPLE_TEXTURE2D_ARRAY_LOD(tex, sampler##tex, coord.xy, coord.z, lod) + #define UNITY_SAMPLE_TEX2D(tex, coord) SAMPLE_TEXTURE2D(tex, sampler##tex, coord) + #define UNITY_SAMPLE_TEX2D_SAMPLER(tex, samp, coord) SAMPLE_TEXTURE2D(tex, sampler##samp, coord) + + #define UNITY_SAMPLE_TEX2D_LOD(tex,coord, lod) SAMPLE_TEXTURE2D_LOD(tex, sampler_##tex, coord, lod) + #define UNITY_SAMPLE_TEX2D_SAMPLER_LOD(tex,samplertex,coord, lod) SAMPLE_TEXTURE2D_LOD (tex, sampler##samplertex,coord, lod) + + #if defined(UNITY_COMPILER_HLSL) + #define UNITY_INITIALIZE_OUTPUT(type,name) name = (type)0; + #else + #define UNITY_INITIALIZE_OUTPUT(type,name) + #endif + + #define sampler2D_float sampler2D + #define sampler2D_half sampler2D + + + + // data across stages, stripped like the above. + struct VertexToPixel + { + float4 pos : SV_POSITION; + float3 worldPos : TEXCOORD0; + float3 worldNormal : TEXCOORD1; + float4 worldTangent : TEXCOORD2; + float4 texcoord0 : TEXCOORD3; + float4 texcoord1 : TEXCOORD4; + float4 texcoord2 : TEXCOORD5; + + // #if %TEXCOORD3REQUIREKEY% + float4 texcoord3 : TEXCOORD6; + // #endif + + // #if %SCREENPOSREQUIREKEY% + // float4 screenPos : TEXCOORD7; + // #endif + + // #if %VERTEXCOLORREQUIREKEY% + half4 vertexColor : COLOR; + // #endif + + // #if %EXTRAV2F0REQUIREKEY% + // float4 extraV2F0 : TEXCOORD12; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // float4 extraV2F1 : TEXCOORD13; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // float4 extraV2F2 : TEXCOORD14; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // float4 extraV2F3 : TEXCOORD15; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // float4 extraV2F4 : TEXCOORD16; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // float4 extraV2F5 : TEXCOORD17; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // float4 extraV2F6 : TEXCOORD18; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // float4 extraV2F7 : TEXCOORD19; + // #endif + + #if defined(LIGHTMAP_ON) + float2 lightmapUV : TEXCOORD8; + #endif + #if !defined(LIGHTMAP_ON) + float3 sh : TEXCOORD9; + #endif + + #ifdef VARYINGS_NEED_FOG_AND_VERTEX_LIGHT + float4 fogFactorAndVertexLight : TEXCOORD10; + #endif + + #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR) + float4 shadowCoord : TEXCOORD11; + #endif + + #if UNITY_ANY_INSTANCING_ENABLED + uint instanceID : CUSTOM_INSTANCE_ID; + #endif + #if (defined(UNITY_STEREO_INSTANCING_ENABLED)) + uint stereoTargetEyeIndexAsRTArrayIdx : SV_RenderTargetArrayIndex; + #endif + #if (defined(UNITY_STEREO_MULTIVIEW_ENABLED)) || (defined(UNITY_STEREO_INSTANCING_ENABLED) && (defined(SHADER_API_GLES3) || defined(SHADER_API_GLCORE))) + uint stereoTargetEyeIndexAsBlendIdx0 : BLENDINDICES0; + #endif + #if defined(SHADER_STAGE_FRAGMENT) && defined(VARYINGS_NEED_CULLFACE) + FRONT_FACE_TYPE cullFace : FRONT_FACE_SEMANTIC; + #endif + }; + + + + + // data describing the user output of a pixel + struct Surface + { + half3 Albedo; + half Height; + half3 Normal; + half Smoothness; + half3 Emission; + half Metallic; + half3 Specular; + half Occlusion; + half SpecularPower; // for simple lighting + half Alpha; + float outputDepth; // if written, SV_Depth semantic is used. ShaderData.clipPos.z is unused value + // HDRP Only + half SpecularOcclusion; + half SubsurfaceMask; + half Thickness; + half CoatMask; + half CoatSmoothness; + half Anisotropy; + half IridescenceMask; + half IridescenceThickness; + int DiffusionProfileHash; + float SpecularAAThreshold; + float SpecularAAScreenSpaceVariance; + // requires _OVERRIDE_BAKEDGI to be defined, but is mapped in all pipelines + float3 DiffuseGI; + float3 BackDiffuseGI; + float3 SpecularGI; + float ior; + float3 transmittanceColor; + float atDistance; + float transmittanceMask; + // requires _OVERRIDE_SHADOWMASK to be defines + float4 ShadowMask; + + // for decals + float NormalAlpha; + float MAOSAlpha; + + + }; + + // Data the user declares in blackboard blocks + struct Blackboard + { + + float blackboardDummyData; + }; + + // data the user might need, this will grow to be big. But easy to strip + struct ShaderData + { + float4 clipPos; // SV_POSITION + float3 localSpacePosition; + float3 localSpaceNormal; + float3 localSpaceTangent; + + float3 worldSpacePosition; + float3 worldSpaceNormal; + float3 worldSpaceTangent; + float tangentSign; + + float3 worldSpaceViewDir; + float3 tangentSpaceViewDir; + + float4 texcoord0; + float4 texcoord1; + float4 texcoord2; + float4 texcoord3; + + float2 screenUV; + float4 screenPos; + + float4 vertexColor; + bool isFrontFace; + + float4 extraV2F0; + float4 extraV2F1; + float4 extraV2F2; + float4 extraV2F3; + float4 extraV2F4; + float4 extraV2F5; + float4 extraV2F6; + float4 extraV2F7; + + float3x3 TBNMatrix; + Blackboard blackboard; + }; + + struct VertexData + { + #if SHADER_TARGET > 30 + // uint vertexID : SV_VertexID; + #endif + float4 vertex : POSITION; + float3 normal : NORMAL; + float4 tangent : TANGENT; + float4 texcoord0 : TEXCOORD0; + + // optimize out mesh coords when not in use by user or lighting system + #if _URP && (_USINGTEXCOORD1 || _PASSMETA || _PASSFORWARD || _PASSGBUFFER) + float4 texcoord1 : TEXCOORD1; + #endif + + #if _URP && (_USINGTEXCOORD2 || _PASSMETA || ((_PASSFORWARD || _PASSGBUFFER) && defined(DYNAMICLIGHTMAP_ON))) + float4 texcoord2 : TEXCOORD2; + #endif + + #if _STANDARD && (_USINGTEXCOORD1 || (_PASSMETA || ((_PASSFORWARD || _PASSGBUFFER || _PASSFORWARDADD) && LIGHTMAP_ON))) + float4 texcoord1 : TEXCOORD1; + #endif + #if _STANDARD && (_USINGTEXCOORD2 || (_PASSMETA || ((_PASSFORWARD || _PASSGBUFFER) && DYNAMICLIGHTMAP_ON))) + float4 texcoord2 : TEXCOORD2; + #endif + + + #if _HDRP + float4 texcoord1 : TEXCOORD1; + float4 texcoord2 : TEXCOORD2; + #endif + + // #if %TEXCOORD3REQUIREKEY% + float4 texcoord3 : TEXCOORD3; + // #endif + + // #if %VERTEXCOLORREQUIREKEY% + float4 vertexColor : COLOR; + // #endif + + #if _PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR)) + float3 previousPositionOS : TEXCOORD4; // Contain previous transform position (in case of skinning for example) + #if defined (_ADD_PRECOMPUTED_VELOCITY) + float3 precomputedVelocity : TEXCOORD5; // Add Precomputed Velocity (Alembic computes velocities on runtime side). + #endif + #endif + + UNITY_VERTEX_INPUT_INSTANCE_ID + }; + + struct TessVertex + { + float4 vertex : INTERNALTESSPOS; + float3 normal : NORMAL; + float4 tangent : TANGENT; + float4 texcoord0 : TEXCOORD0; + float4 texcoord1 : TEXCOORD1; + float4 texcoord2 : TEXCOORD2; + + // #if %TEXCOORD3REQUIREKEY% + float4 texcoord3 : TEXCOORD3; + // #endif + + // #if %VERTEXCOLORREQUIREKEY% + float4 vertexColor : COLOR; + // #endif + + // #if %EXTRAV2F0REQUIREKEY% + // float4 extraV2F0 : TEXCOORD5; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // float4 extraV2F1 : TEXCOORD6; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // float4 extraV2F2 : TEXCOORD7; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // float4 extraV2F3 : TEXCOORD8; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // float4 extraV2F4 : TEXCOORD9; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // float4 extraV2F5 : TEXCOORD10; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // float4 extraV2F6 : TEXCOORD11; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // float4 extraV2F7 : TEXCOORD12; + // #endif + + #if _PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR)) + float3 previousPositionOS : TEXCOORD13; // Contain previous transform position (in case of skinning for example) + #if defined (_ADD_PRECOMPUTED_VELOCITY) + float3 precomputedVelocity : TEXCOORD14; + #endif + #endif + + UNITY_VERTEX_INPUT_INSTANCE_ID + UNITY_VERTEX_OUTPUT_STEREO + }; + + struct ExtraV2F + { + float4 extraV2F0; + float4 extraV2F1; + float4 extraV2F2; + float4 extraV2F3; + float4 extraV2F4; + float4 extraV2F5; + float4 extraV2F6; + float4 extraV2F7; + Blackboard blackboard; + float4 time; + }; + + + float3 WorldToTangentSpace(ShaderData d, float3 normal) + { + return mul(d.TBNMatrix, normal); + } + + float3 TangentToWorldSpace(ShaderData d, float3 normal) + { + return mul(normal, d.TBNMatrix); + } + + // in this case, make standard more like SRPs, because we can't fix + // unity_WorldToObject in HDRP, since it already does macro-fu there + + #if _STANDARD + float3 TransformWorldToObject(float3 p) { return mul(unity_WorldToObject, float4(p, 1)); }; + float3 TransformObjectToWorld(float3 p) { return mul(unity_ObjectToWorld, float4(p, 1)); }; + float4 TransformWorldToObject(float4 p) { return mul(unity_WorldToObject, p); }; + float4 TransformObjectToWorld(float4 p) { return mul(unity_ObjectToWorld, p); }; + float4x4 GetWorldToObjectMatrix() { return unity_WorldToObject; } + float4x4 GetObjectToWorldMatrix() { return unity_ObjectToWorld; } + #if (defined(SHADER_API_D3D11) || defined(SHADER_API_XBOXONE) || defined(UNITY_COMPILER_HLSLCC) || defined(SHADER_API_PSSL) || (SHADER_TARGET_SURFACE_ANALYSIS && !SHADER_TARGET_SURFACE_ANALYSIS_MOJOSHADER)) + #define UNITY_SAMPLE_TEX2D_LOD(tex,coord, lod) tex.SampleLevel (sampler##tex,coord, lod) + #define UNITY_SAMPLE_TEX2D_SAMPLER_LOD(tex,samplertex,coord, lod) tex.SampleLevel (sampler##samplertex,coord, lod) + #else + #define UNITY_SAMPLE_TEX2D_LOD(tex,coord,lod) tex2D (tex,coord,0,lod) + #define UNITY_SAMPLE_TEX2D_SAMPLER_LOD(tex,samplertex,coord,lod) tex2D (tex,coord,0,lod) + #endif + + #undef GetWorldToObjectMatrix() + + #define GetWorldToObjectMatrix() unity_WorldToObject + + + #endif + + float3 GetCameraWorldPosition() + { + #if _HDRP + return GetCameraRelativePositionWS(_WorldSpaceCameraPos); + #else + return _WorldSpaceCameraPos; + #endif + } + + #if _GRABPASSUSED + #if _STANDARD + TEXTURE2D(%GRABTEXTURE%); + SAMPLER(sampler_%GRABTEXTURE%); + #endif + + half3 GetSceneColor(float2 uv) + { + #if _STANDARD + return SAMPLE_TEXTURE2D(%GRABTEXTURE%, sampler_%GRABTEXTURE%, uv).rgb; + #else + return SHADERGRAPH_SAMPLE_SCENE_COLOR(uv); + #endif + } + #endif + + + + #if _STANDARD + UNITY_DECLARE_DEPTH_TEXTURE(_CameraDepthTexture); + float GetSceneDepth(float2 uv) { return SAMPLE_DEPTH_TEXTURE(_CameraDepthTexture, uv); } + float GetLinear01Depth(float2 uv) { return Linear01Depth(GetSceneDepth(uv)); } + float GetLinearEyeDepth(float2 uv) { return LinearEyeDepth(GetSceneDepth(uv)); } + #else + float GetSceneDepth(float2 uv) { return SHADERGRAPH_SAMPLE_SCENE_DEPTH(uv); } + float GetLinear01Depth(float2 uv) { return Linear01Depth(GetSceneDepth(uv), _ZBufferParams); } + float GetLinearEyeDepth(float2 uv) { return LinearEyeDepth(GetSceneDepth(uv), _ZBufferParams); } + #endif + + float3 GetWorldPositionFromDepthBuffer(float2 uv, float3 worldSpaceViewDir) + { + float eye = GetLinearEyeDepth(uv); + float3 camView = mul((float3x3)GetObjectToWorldMatrix(), transpose(mul(GetWorldToObjectMatrix(), UNITY_MATRIX_I_V)) [2].xyz); + + float dt = dot(worldSpaceViewDir, camView); + float3 div = worldSpaceViewDir/dt; + float3 wpos = (eye * div) + GetCameraWorldPosition(); + return wpos; + } + + #if _HDRP + float3 ObjectToWorldSpacePosition(float3 pos) + { + return GetAbsolutePositionWS(TransformObjectToWorld(pos)); + } + #else + float3 ObjectToWorldSpacePosition(float3 pos) + { + return TransformObjectToWorld(pos); + } + #endif + + #if _STANDARD + UNITY_DECLARE_SCREENSPACE_TEXTURE(_CameraDepthNormalsTexture); + float3 GetSceneNormal(float2 uv, float3 worldSpaceViewDir) + { + float4 depthNorms = UNITY_SAMPLE_SCREENSPACE_TEXTURE(_CameraDepthNormalsTexture, uv); + float3 norms = DecodeViewNormalStereo(depthNorms); + norms = mul((float3x3)GetWorldToViewMatrix(), norms) * 0.5 + 0.5; + return norms; + } + #elif _HDRP && !_DECALSHADER + + float3 GetSceneNormal(float2 uv, float3 worldSpaceViewDir) + { + NormalData nd; + DecodeFromNormalBuffer(_ScreenSize.xy * uv, nd); + return nd.normalWS; + } + #elif _URP + #if (SHADER_LIBRARY_VERSION_MAJOR >= 10) + #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/DeclareNormalsTexture.hlsl" + #endif + + float3 GetSceneNormal(float2 uv, float3 worldSpaceViewDir) + { + #if (SHADER_LIBRARY_VERSION_MAJOR >= 10) + return SampleSceneNormals(uv); + #else + float3 wpos = GetWorldPositionFromDepthBuffer(uv, worldSpaceViewDir); + return normalize(-cross(ddx(wpos), ddy(wpos))) * 0.5 + 0.5; + #endif + + } + #endif + + #if _HDRP + + half3 UnpackNormalmapRGorAG(half4 packednormal) + { + // This do the trick + packednormal.x *= packednormal.w; + + half3 normal; + normal.xy = packednormal.xy * 2 - 1; + normal.z = sqrt(1 - saturate(dot(normal.xy, normal.xy))); + return normal; + } + half3 UnpackNormal(half4 packednormal) + { + #if defined(UNITY_NO_DXT5nm) + return packednormal.xyz * 2 - 1; + #else + return UnpackNormalmapRGorAG(packednormal); + #endif + } + #endif + #if _HDRP || _URP + + half3 UnpackScaleNormal(half4 packednormal, half scale) + { + #ifndef UNITY_NO_DXT5nm + // Unpack normal as DXT5nm (1, y, 1, x) or BC5 (x, y, 0, 1) + // Note neutral texture like "bump" is (0, 0, 1, 1) to work with both plain RGB normal and DXT5nm/BC5 + packednormal.x *= packednormal.w; + #endif + half3 normal; + normal.xy = (packednormal.xy * 2 - 1) * scale; + normal.z = sqrt(1 - saturate(dot(normal.xy, normal.xy))); + return normal; + } + + #endif + + + void GetSun(out float3 lightDir, out float3 color) + { + lightDir = float3(0.5, 0.5, 0); + color = 1; + #if _HDRP + if (_DirectionalLightCount > 0) + { + DirectionalLightData light = _DirectionalLightDatas[0]; + lightDir = -light.forward.xyz; + color = light.color; + } + #elif _STANDARD + lightDir = normalize(_WorldSpaceLightPos0.xyz); + color = _LightColor0.rgb; + #elif _URP + Light light = GetMainLight(); + lightDir = light.direction; + color = light.color; + #endif + } + + + + CBUFFER_START(UnityPerMaterial) + + + half4 _Color; + half4 _MainTex_ST, _MainTex_TexelSize; + half _Alpha, _AlphaCutoffValue; + + #if ATLAS_ON + half _MinXUV, _MaxXUV, _MinYUV, _MaxYUV; + #endif + + #if GLOW_ON + half4 _GlowColor; + half _Glow, _GlowGlobal; + #endif + + #if HSV_ON + half _HsvShift, _HsvSaturation, _HsvBright; + #endif + + #if DISTORT_ON + half4 _DistortTex_ST; + half _DistortTexXSpeed, _DistortTexYSpeed, _DistortAmount; + #endif + + #if FADE_ON + half4 _FadeBurnColor, _FadeTex_ST, _FadeBurnTex_ST; + half _FadeAmount, _FadeBurnWidth, _FadeBurnTransition,_FadeBurnGlow; + #endif + + #if OUTBASE_ON + half4 _OutlineColor; + half _OutlineAlpha, _OutlineGlow, _OutlineWidth; + int _OutlinePixelWidth; + #endif + + #if OUTTEX_ON + half4 _OutlineTex_ST; + half _OutlineTexXSpeed, _OutlineTexYSpeed; + #endif + + #if OUTDIST_ON + half4 _OutlineDistortTex_ST; + half _OutlineDistortTexXSpeed, _OutlineDistortTexYSpeed, _OutlineDistortAmount; + #endif + + #if ALPHAOUTLINE_ON + half _AlphaOutlineGlow, _AlphaOutlinePower, _AlphaOutlineMinAlpha, _AlphaOutlineBlend; + half4 _AlphaOutlineColor; + #endif + + #if INNEROUTLINE_ON + half _InnerOutlineThickness, _InnerOutlineAlpha, _InnerOutlineGlow; + half4 _InnerOutlineColor; + #endif + + #if GRADIENT_ON + half _GradBlend, _GradBoostX, _GradBoostY; + half4 _GradTopRightCol, _GradTopLeftCol, _GradBotRightCol, _GradBotLeftCol; + #endif + + #if COLORSWAP_ON + half4 _ColorSwapRed, _ColorSwapGreen, _ColorSwapBlue; + half _ColorSwapRedLuminosity, _ColorSwapGreenLuminosity, _ColorSwapBlueLuminosity, _ColorSwapBlend; + #endif + + #if CHANGECOLOR_ON + half4 _ColorChangeNewCol, _ColorChangeTarget; + half _ColorChangeTolerance, _ColorChangeLuminosity; + #endif + #if CHANGECOLOR2_ON + half4 _ColorChangeNewCol2, _ColorChangeTarget2; + half _ColorChangeTolerance2; + #endif + #if CHANGECOLOR3_ON + half4 _ColorChangeNewCol3, _ColorChangeTarget3; + half _ColorChangeTolerance3; + #endif + + #if COLORRAMP_ON + half _ColorRampLuminosity, _ColorRampBlend; + #endif + + #if HITEFFECT_ON + half4 _HitEffectColor; + half _HitEffectGlow, _HitEffectBlend; + #endif + + #if NEGATIVE_ON + half _NegativeAmount; + #endif + + #if PIXELATE_ON + half _PixelateSize; + #endif + + #if GREYSCALE_ON + half _GreyscaleLuminosity, _GreyscaleBlend; + half4 _GreyscaleTintColor; + #endif + + #if POSTERIZE_ON + half _PosterizeNumColors, _PosterizeGamma; + #endif + + #if BLUR_ON + half _BlurIntensity; + #endif + + #if MOTIONBLUR_ON + half _MotionBlurAngle, _MotionBlurDist; + #endif + + #if GHOST_ON + half _GhostColorBoost, _GhostTransparency, _GhostBlend; + #endif + + #if HOLOGRAM_ON + half _HologramStripesAmount, _HologramMinAlpha, _HologramUnmodAmount, _HologramStripesSpeed, _HologramMaxAlpha, _HologramBlend; + half4 _HologramStripeColor; + #endif + + #if CHROMABERR_ON + half _ChromAberrAmount, _ChromAberrAlpha; + #endif + + #if GLITCH_ON + half _GlitchAmount, _GlitchSize; + #endif + + #if FLICKER_ON + half _FlickerFreq, _FlickerPercent, _FlickerAlpha; + #endif + + #if SHADOW_ON + half _ShadowX, _ShadowY, _ShadowAlpha; + half4 _ShadowColor; + #endif + + #if SHINE_ON + half4 _ShineColor; + half _ShineLocation, _ShineRotate, _ShineWidth, _ShineGlow; + #endif + + #if CONTRAST_ON + half _Contrast, _Brightness; + #endif + + #if OVERLAY_ON + half4 _OverlayTex_ST, _OverlayColor; + half _OverlayGlow, _OverlayBlend, _OverlayTextureScrollXSpeed, _OverlayTextureScrollYSpeed; + #endif + + #if DOODLE_ON + half _HandDrawnAmount, _HandDrawnSpeed; + #endif + + #if WIND_ON + half _GrassSpeed, _GrassWind, _GrassManualAnim, _GrassRadialBend; + #endif + + #if WAVEUV_ON + float _WaveAmount, _WaveSpeed, _WaveStrength, _WaveX, _WaveY; + #endif + + #if ROUNDWAVEUV_ON + half _RoundWaveStrength, _RoundWaveSpeed; + #endif + + #if RECTSIZE_ON + half _RectSize; + #endif + + #if OFFSETUV_ON + half _OffsetUvX, _OffsetUvY; + #endif + + #if CLIPPING_ON + half _ClipUvLeft, _ClipUvRight, _ClipUvUp, _ClipUvDown; + #endif + + #if RADIALCLIPPING_ON + half _RadialStartAngle, _RadialClip, _RadialClip2; + #endif + + #if TEXTURESCROLL_ON + half _TextureScrollXSpeed, _TextureScrollYSpeed; + #endif + + #if ZOOMUV_ON + half _ZoomUvAmount; + #endif + + #if WARP_ON + half _WarpStrength, _WarpSpeed, _WarpScale; + #endif + + #if TWISTUV_ON + half _TwistUvAmount, _TwistUvPosX, _TwistUvPosY, _TwistUvRadius; + #endif + + #if ROTATEUV_ON + half _RotateUvAmount; + #endif + + #if FISHEYE_ON + half _FishEyeUvAmount; + #endif + + #if PINCH_ON + half _PinchUvAmount; + #endif + + #if SHAKEUV_ON + half _ShakeUvSpeed, _ShakeUvX, _ShakeUvY; + #endif + + #if NORMALMAP_ON + half _NormalStrength; + #endif + + float _RandomSeed; + + + + + CBUFFER_END + + + + + + + + TEXTURE2D(_MainTex); + SAMPLER(sampler_MainTex); + + #if GLOW_ON + TEXTURE2D(_GlowTex); + SAMPLER(sampler_GlowTex); + #endif + + #if FADE_ON + TEXTURE2D(_FadeTex); + SAMPLER(sampler_FadeTex); + + TEXTURE2D(_FadeBurnTex); + SAMPLER(sampler_FadeBurnTex); + #endif + + #if DISTORT_ON + TEXTURE2D(_DistortTex); + SAMPLER(sampler_DistortTex); + #endif + + #if OUTTEX_ON + TEXTURE2D(_OutlineTex); + SAMPLER(sampler_OutlineTex); + #endif + + #if OUTDIST_ON + TEXTURE2D(_OutlineDistortTex); + SAMPLER(sampler_OutlineDistortTex); + #endif + + #if COLORSWAP_ON + TEXTURE2D(_ColorSwapTex); + SAMPLER(sampler_ColorSwapTex); + #endif + + #if COLORRAMP_ON + TEXTURE2D(_ColorRampTex); + TEXTURE2D(_ColorRampTexGradient); + SAMPLER(sampler_ColorRampTex); + SAMPLER(sampler_ColorRampTexGradient); + #endif + + #if SHINE_ON + TEXTURE2D(_ShineMask); + SAMPLER(sampler_ShineMask); + #endif + + #if OVERLAY_ON + TEXTURE2D(_OverlayTex); + SAMPLER(sampler_OverlayTex); + #endif + + #if NORMALMAP_ON + TEXTURE2D(_NormalMap); + SAMPLER(sampler_NormalMap); + #endif + + + half3 GetPixel(in int offsetX, in int offsetY, in half2 uv, in Texture2D _tex, in SamplerState _sampler) + { + half2 _uv = uv + half2(offsetX * _MainTex_TexelSize.x, offsetY * _MainTex_TexelSize.y); + half4 col = SAMPLE_TEXTURE2D(_tex, _sampler, _uv); + return col.rgb; + } + + + //BLURS------------------------------------------------------------------------- + half4 Blur(half2 uv, Texture2D source, SamplerState sampler_source, half Intensity) + { + const half2 texelSize = 1.0 / _ScreenParams.xy; + const half4 color = SAMPLE_TEXTURE2D(source, sampler_source, uv); + const half2 offset = Intensity * texelSize; + + half4 accumulatedColor = color; + half accumulatedWeight = 1.0; + for (int x = -1; x <= 1; x++) + { + for (int y = -1; y <= 1; y++) + { + const half2 sampleUV = uv + half2(x, y) * offset; + const half4 sampleColor = SAMPLE_TEXTURE2D(source, sampler_source, sampleUV); + + accumulatedColor += sampleColor; + accumulatedWeight += 1.0; + } + } + + half4 blurredColor = accumulatedColor / accumulatedWeight; + return blurredColor; + } + + half BlurHD_G(half bhqp, half x) + { + return exp(-(x * x) / (2.0 * bhqp * bhqp)); + } + half4 BlurHD(half2 uv, Texture2D source, SamplerState sampler_source, half BlurAmount, half xScale, half yScale) + { + int iterations = 16; + int halfIterations = iterations / 2; + half sigmaX = 0.1 + BlurAmount * 0.5; + half sigmaY = sigmaX; + half total = 0.0; + half4 ret = half4(0, 0, 0, 0); + for (int iy = 0; iy < iterations; ++iy) + { + half fy = BlurHD_G(sigmaY, half(iy) -half(halfIterations)); + half offsetY = half(iy - halfIterations) * 0.00390625 * xScale; + for (int ix = 0; ix < iterations; ++ix) + { + half fx = BlurHD_G(sigmaX, half(ix) - half(halfIterations)); + half offsetX = half(ix - halfIterations) * 0.00390625 * yScale; + total += fx * fy; + ret += SAMPLE_TEXTURE2D(source, sampler_source, uv + half2(offsetX, offsetY)) * fx * fy; + } + } + return ret / total; + } + //----------------------------------------------------------------------- + + + //------------------------------------------- + half RemapFloat(half inValue, half inMin, half inMax, half outMin, half outMax){ + return outMin + (inValue - inMin) * (outMax - outMin) / (inMax - inMin); + } + //------------------------------------------- + + //----------------------------------------------------------------------- + half rand(half2 seed, half offset) { + return (frac(sin(dot(seed, half2(12.9898, 78.233))) * 43758.5453) + offset) % 1.0; + } + + half rand2(half2 seed, half offset) { + return (frac(sin(dot(seed * floor(50 + (_Time.x % 1.0) * 12.), half2(127.1, 311.7))) * 43758.5453123) + offset) % 1.0; + } + + half rand2CustomTime(half2 seed, half offset, half customTime) { + return (frac(sin(dot(seed * floor(50 + (customTime % 1.0) * 12.), half2(127.1, 311.7))) * 43758.5453123) + offset) % 1.0; + } + //----------------------------------------------------------------------- + + + void Ext_ModifyVertex0 (inout VertexData v, inout ExtraV2F d) + { + //BILBOARD_ON + #if BILBOARD_ON + half3 camRight = mul((half3x3)unity_CameraToWorld, half3(1,0,0)); + half3 camUp = half3(0,1,0); + #if BILBOARDY_ON + camUp = mul((half3x3)unity_CameraToWorld, half3(0,1,0)); + #endif + half3 localPos = v.vertex.x * camRight + v.vertex.y * camUp; + v.vertex = half4(localPos, 1); + #endif + //----------------------------------------------------------- + + v.texcoord0.xy = TRANSFORM_TEX(v.texcoord0.xy, _MainTex); + half2 center = half2(0.5, 0.5); + #if ATLAS_ON + center = half2((_MaxXUV + _MinXUV) / 2.0, (_MaxYUV + _MinYUV) / 2.0); + #endif + + //POLARUV_ON + #if POLARUV_ON + v.texcoord0.xy = v.texcoord0.xy - center; + #endif + + //---------------------------------------- + + //ROTATEUV_ON + #if ROTATEUV_ON + half2 uvC = v.texcoord0.xy; + half cosAngle = cos(_RotateUvAmount); + half sinAngle = sin(_RotateUvAmount); + half2x2 rot = half2x2(cosAngle, -sinAngle, sinAngle, cosAngle); + uvC -= center; + v.texcoord0.xy = mul(rot, uvC); + v.texcoord0.xy += center; + #endif + //-------------------- + + #if RECTSIZE_ON + v.vertex.xyz += (v.vertex.xyz * (_RectSize - 1.0)); + #endif + + #if OUTTEX_ON + v.texcoord1.xy = TRANSFORM_TEX(v.texcoord0.xy, _OutlineTex); + #endif + + #if OUTDIST_ON + v.texcoord2.xy = TRANSFORM_TEX(v.texcoord0.xy, _OutlineDistortTex); + #endif + + #if DISTORT_ON + v.texcoord3.xy = TRANSFORM_TEX(v.texcoord0.xy, _DistortTex); + #endif + } + + void Ext_SurfaceFunction0 (inout Surface o, ShaderData d) + { + half randomSeed = _RandomSeed; + + float2 uvRect = d.texcoord0; + half2 center = half2(0.5, 0.5); + #if ATLAS_ON + center = half2((_MaxXUV + _MinXUV) / 2.0, (_MaxYUV + _MinYUV) / 2.0); + uvRect = half2((d.texcoord0.x - _MinXUV) / (_MaxXUV - _MinXUV), (d.texcoord0.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half2 centerTiled = half2(center.x * _MainTex_ST.x, center.y * _MainTex_ST.y); + + //CLIPPING_ON + #if CLIPPING_ON + half2 tiledUv = half2(d.texcoord0.x / _MainTex_ST.x, d.texcoord0.y / _MainTex_ST.y); + #if ATLAS_ON + tiledUv = half2((tiledUv.x - _MinXUV) / (_MaxXUV - _MinXUV), (tiledUv.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + clip((1 - _ClipUvUp) - tiledUv.y); + clip(tiledUv.y - _ClipUvDown); + clip((1 - _ClipUvRight) - tiledUv.x); + clip(tiledUv.x - _ClipUvLeft); + #endif + //---------------------------------- + + //RADIALCLIPPING_ON + #if RADIALCLIPPING_ON + half2 tiledUv2 = half2(d.texcoord0.x / _MainTex_ST.x, d.texcoord0.y / _MainTex_ST.y); + #if ATLAS_ON + tiledUv2 = half2((tiledUv2.x - _MinXUV) / (_MaxXUV - _MinXUV), (tiledUv2.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half startAngle = _RadialStartAngle - _RadialClip; + half endAngle = _RadialStartAngle + _RadialClip2; + half offset0 = clamp(0, 360, startAngle + 360); + half offset360 = clamp(0, 360, endAngle - 360); + half2 atan2Coord = half2(lerp(-1, 1, tiledUv2.x), lerp(-1, 1, tiledUv2.y)); + half atanAngle = atan2(atan2Coord.y, atan2Coord.x) * 57.3; // angle in degrees + if(atanAngle < 0) atanAngle = 360 + atanAngle; + if(atanAngle >= startAngle && atanAngle <= endAngle) discard; + if(atanAngle <= offset360) discard; + if(atanAngle >= offset0) discard; + #endif + + //----------------------------- + + //TEXTURESCROLL_ON && ATLAS_ON + #if TEXTURESCROLL_ON && ATLAS_ON + d.texcoord0.xy = half2(_MinXUV + ((_MaxXUV - _MinXUV) * (abs(((_Time.y + randomSeed) * _TextureScrollXSpeed) + uvRect.x) % 1)), + _MinYUV + ((_MaxYUV - _MinYUV) * (abs(((_Time.y + randomSeed) * _TextureScrollYSpeed) + uvRect.y) % 1))); + #endif + //---------------------------- + + //OFFSETUV_ON + #if OFFSETUV_ON + #if ATLAS_ON + d.texcoord0.xy = half2(_MinXUV + ((_MaxXUV - _MinXUV) * (abs((_OffsetUvX + uvRect.x) % 1))), + _MinYUV + ((_MaxYUV - _MinYUV) * (abs(_OffsetUvY + uvRect.y) % 1))); + #else + d.texcoord0.xy += half2(_OffsetUvX, _OffsetUvY); + #endif + #endif + + //---------------------- + + //POLARUV_ON + #if POLARUV_ON + d.texcoord0.xy = half2(atan2(d.texcoord0.y, d.texcoord0.x) / (2.0f * 3.141592653589f), length(d.texcoord0.xy)); + d.texcoord0.xy *= _MainTex_ST.xy; + #endif + + //-------------------------------------- + + //TWISTUV_ON + #if TWISTUV_ON + #if ATLAS_ON + _TwistUvPosX = ((_MaxXUV - _MinXUV) * _TwistUvPosX) + _MinXUV; + _TwistUvPosY = ((_MaxYUV - _MinYUV) * _TwistUvPosY) + _MinYUV; + #endif + half2 tempUv = d.texcoord0.xy - half2(_TwistUvPosX * _MainTex_ST.x, _TwistUvPosY * _MainTex_ST.y); + _TwistUvRadius *= (_MainTex_ST.x + _MainTex_ST.y) / 2; + half percent = (_TwistUvRadius - length(tempUv)) / _TwistUvRadius; + half theta = percent * percent * (2.0 * sin(_TwistUvAmount)) * 8.0; + half s = sin(theta); + half c = cos(theta); + half beta = max(sign(_TwistUvRadius - length(tempUv)), 0.0); + tempUv = half2(dot(tempUv, half2(c, -s)), dot(tempUv, half2(s, c))) * beta + tempUv * (1 - beta); + tempUv += half2(_TwistUvPosX * _MainTex_ST.x, _TwistUvPosY * _MainTex_ST.y); + d.texcoord0.xy = tempUv; + #endif + + //-------------------------------------------- + + //FISHEYE_ON + #if FISHEYE_ON + half bind = length(centerTiled); + half2 dF = d.texcoord0.xy - centerTiled; + half dFlen = length(dF); + half fishInt = (3.14159265359 / bind) * (_FishEyeUvAmount + 0.001); + d.texcoord0.xy = centerTiled + (dF / (max(0.0001, dFlen))) * tan(dFlen * fishInt) * bind / tan(bind * fishInt); + #endif + //--------------------------------------------- + + //PINCH_ON + #if PINCH_ON + half2 dP = d.texcoord0.xy - centerTiled; + half pinchInt = (3.141592 / length(centerTiled)) * (-_PinchUvAmount + 0.001); + d.texcoord0.xy = centerTiled + normalize(dP) * atan(length(dP) * -pinchInt * 10.0) * 0.5 / atan(-pinchInt * 5); + #endif + + //--------------------------------------------- + + //ZOOMUV_ON + #if ZOOMUV_ON + d.texcoord0.xy -= centerTiled; + d.texcoord0.xy = d.texcoord0.xy * _ZoomUvAmount; + d.texcoord0.xy += centerTiled; + #endif + + //----------------------------------------------- + + //DOODLE_ON + #if DOODLE_ON + half2 uvCopy = uvRect; + _HandDrawnSpeed = (floor((_Time.x + randomSeed) * 20 * _HandDrawnSpeed) / _HandDrawnSpeed) * _HandDrawnSpeed; + uvCopy.x = sin((uvCopy.x * _HandDrawnAmount + _HandDrawnSpeed) * 4); + uvCopy.y = cos((uvCopy.y * _HandDrawnAmount + _HandDrawnSpeed) * 4); + d.texcoord0.xy = lerp(d.texcoord0.xy, d.texcoord0.xy + uvCopy, 0.0005 * _HandDrawnAmount); + #endif + + //-------------------------- + + //SHAKEUV_ON + #if SHAKEUV_ON + half xShake = sin((_Time.x + randomSeed) * _ShakeUvSpeed * 50) * _ShakeUvX; + half yShake = cos((_Time.x + randomSeed) * _ShakeUvSpeed * 50) * _ShakeUvY; + d.texcoord0.xy += half2(xShake * 0.012, yShake * 0.01); + #endif + + //------------------------------------------- + + //RECTSIZE_ON + #if RECTSIZE_ON + d.texcoord0.xy = d.texcoord0.xy * (_RectSize).xx + (((-_RectSize * 0.5) + 0.5)).xx; + #endif + + //------------------------------------------- + + //DISTORT_ON + #if DISTORT_ON + #if ATLAS_ON + d.texcoord3.x = d.texcoord3.x * (1 / (_MaxXUV - _MinXUV)); + d.texcoord3.y = d.texcoord3.y * (1 / (_MaxYUV - _MinYUV)); + #endif + + d.texcoord3.x += ((_Time.x + _RandomSeed) * _DistortTexXSpeed) % 1; + d.texcoord3.y += ((_Time.x + _RandomSeed) * _DistortTexYSpeed) % 1; + half distortAmnt = (SAMPLE_TEXTURE2D(_DistortTex, sampler_DistortTex, d.texcoord3.xy).r - 0.5) * 0.2 * _DistortAmount; + d.texcoord0.x += distortAmnt; + d.texcoord0.y += distortAmnt; + #endif + //------------------------------------------------------- + + //WARP_ON + #if WARP_ON + half2 warpUv = half2(d.texcoord0.x / _MainTex_ST.x, d.texcoord0.y / _MainTex_ST.y); + #if ATLAS_ON + warpUv = half2((warpUv.x - _MinXUV) / (_MaxXUV - _MinXUV), (warpUv.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + const float tau = 6.283185307179586; + float xWarp = (_Time.y + randomSeed) * _WarpSpeed + warpUv.x * tau / _WarpScale; + float yWarp = (_Time.y + randomSeed) * _WarpSpeed + warpUv.y * tau / _WarpScale; + float2 warp = float2(sin(xWarp), sin(yWarp)) * _WarpStrength; + d.texcoord0.xy += warp; + #endif + + //------------------------------------------------------- + + //WAVEUV_ON + #if WAVEUV_ON + float2 uvWave = half2(_WaveX * _MainTex_ST.x, _WaveY * _MainTex_ST.y) - d.texcoord0.xy; + uvWave %= 1; + #if ATLAS_ON + uvWave = half2(_WaveX, _WaveY) - uvRect; + #endif + uvWave.x *= _ScreenParams.x / _ScreenParams.y; + float waveTime = _Time.y + randomSeed; + float angWave = (sqrt(dot(uvWave, uvWave)) * _WaveAmount) - ((waveTime * _WaveSpeed)); + d.texcoord0.xy = d.texcoord0.xy + uvWave * sin(angWave) * (_WaveStrength / 1000.0); + #endif + //---------------------------------------------------- + + //ROUNDWAVEUV_ON + #if ROUNDWAVEUV_ON + half xWave = ((0.5 * _MainTex_ST.x) - uvRect.x); + half yWave = ((0.5 * _MainTex_ST.y) - uvRect.y) * (_MainTex_TexelSize.w / _MainTex_TexelSize.z); + half ripple = -sqrt(xWave*xWave + yWave* yWave); + d.texcoord0.xy += (sin((ripple + (_Time.y + randomSeed) * (_RoundWaveSpeed/10.0)) / 0.015) * (_RoundWaveStrength/10.0)) % 1; + #endif + //---------------------------------------------------- + + + //WIND_ON + #if WIND_ON + half windOffset = sin((_Time.x + randomSeed) * _GrassSpeed * 10); + half2 windCenter = half2(0.5, 0.1); + #if ATLAS_ON + windCenter.x = ((_MaxXUV - _MinXUV) * windCenter.x) + _MinXUV; + windCenter.y = ((_MaxYUV - _MinYUV) * windCenter.y) + _MinYUV; + #endif + #if !MANUALWIND_ON + d.texcoord0.x = fmod(abs(lerp(d.texcoord0.x, d.texcoord0.x + (_GrassWind * 0.01 * windOffset), uvRect.y)), 1); + #else + d.texcoord0.x = fmod(abs(lerp(d.texcoord0.x, d.texcoord0.x + (_GrassWind * 0.01 * _GrassManualAnim), uvRect.y)), 1); + windOffset = _GrassManualAnim; + #endif + half2 delta = d.texcoord0.xy - windCenter; + half delta2 = dot(delta.xy, delta.xy); + half2 delta_offset = delta2 * windOffset; + d.texcoord0.xy = d.texcoord0.xy + half2(delta.y, -delta.x) * delta_offset * _GrassRadialBend; + #endif + + //-------------------------------------------------------- + + //TEXTURESCROLL_ON && !ATLAS_ON + #if TEXTURESCROLL_ON && !ATLAS_ON + d.texcoord0.x += ((_Time.y + randomSeed) * _TextureScrollXSpeed) % 1; + d.texcoord0.y += ((_Time.y + randomSeed) * _TextureScrollYSpeed) % 1; + #endif + //------------------------------ + + //PIXELATE_ON + #if PIXELATE_ON + half aspectRatio = _MainTex_TexelSize.x / _MainTex_TexelSize.y; + half2 pixelSize = float2(_PixelateSize, _PixelateSize * aspectRatio); + d.texcoord0.xy = floor(d.texcoord0.xy * pixelSize) / pixelSize; + #endif + //-------------- + + half4 col = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy); + half originalAlpha = col.a; + col *= d.vertexColor; + + //NORMAL MAP + #if NORMALMAP_ON + half4 normalSample = SAMPLE_TEXTURE2D(_NormalMap, sampler_NormalMap, d.texcoord0.xy); + half3 normalTS = UnpackNormal(normalSample); + normalTS.xy *= _NormalStrength; + o.Normal = normalTS; + #endif + + + //GLITCH_ON + #if GLITCH_ON + half2 uvGlitch = uvRect; + uvGlitch.y -= 0.5; + half lineNoise = pow(rand2(floor(uvGlitch * half2(24., 19.) * _GlitchSize) * 4.0, randomSeed), 3.0) * _GlitchAmount + * pow(rand2(floor(uvGlitch * half2(38., 14.) * _GlitchSize) * 4.0, randomSeed), 3.0); + col = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(lineNoise * 0.02 * rand2(half2(2.0, 1), randomSeed), 0)) * d.vertexColor; + #endif + //-------------------------------------- + + //CHROMABERR_ON + #if CHROMABERR_ON + half4 r = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(_ChromAberrAmount/10, 0)) * d.vertexColor; + half4 b = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(-_ChromAberrAmount/10, 0)) * d.vertexColor; + col = half4(r.r * r.a, col.g, b.b * b.a, max(max(r.a, b.a) * _ChromAberrAlpha, col.a)); + #endif + + //-------------------------------- + + //BLUR_ON + #if BLUR_ON + #if ATLAS_ON + #if !BLURISHD_ON + col = BlurHD(d.texcoord0.xy, _MainTex, sampler_MainTex, _BlurIntensity, (_MaxXUV - _MinXUV), (_MaxYUV - _MinYUV)) * d.vertexColor; + #else + col = Blur(d.texcoord0.xy, _MainTex, sampler_MainTex, _BlurIntensity * (_MaxXUV - _MinXUV)) * d.vertexColor; + #endif + #else + #if !BLURISHD_ON + col = BlurHD(d.texcoord0.xy, _MainTex, sampler_MainTex, _BlurIntensity, 1, 1) * d.vertexColor; + #else + col = Blur(d.texcoord0.xy, _MainTex, sampler_MainTex, _BlurIntensity) * d.vertexColor; + #endif + #endif + #endif + + //-------------------- + + //MOTIONBLUR_ON + #if MOTIONBLUR_ON + _MotionBlurAngle = _MotionBlurAngle * 3.1415926; + #define rot(n) mul(n, half2x2(cos(_MotionBlurAngle), -sin(_MotionBlurAngle), sin(_MotionBlurAngle), cos(_MotionBlurAngle))) + _MotionBlurDist = _MotionBlurDist * 0.005; + #if ATLAS_ON + _MotionBlurDist *= (_MaxXUV - _MinXUV); + #endif + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(-_MotionBlurDist, -_MotionBlurDist))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(-_MotionBlurDist * 2, -_MotionBlurDist * 2))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(-_MotionBlurDist * 3, -_MotionBlurDist * 3))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(-_MotionBlurDist * 4, -_MotionBlurDist * 4))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(_MotionBlurDist, _MotionBlurDist))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(_MotionBlurDist * 2, _MotionBlurDist * 2))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(_MotionBlurDist * 3, _MotionBlurDist * 3))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(_MotionBlurDist * 4, _MotionBlurDist * 4))); + col.rgb = col.rgb / 9; + #endif + //------------------------------------ + + //NEGATIVE_ON + #if NEGATIVE_ON + col.rgb = lerp(col.rgb, 1 - col.rgb, _NegativeAmount); + #endif + + //-------------- + half luminance = 0; + + //GREYSCALE_ON && !GREYSCALEOUTLINE_ON + #if GREYSCALE_ON && !GREYSCALEOUTLINE_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + luminance = saturate(luminance + _GreyscaleLuminosity); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _GreyscaleTintColor, _GreyscaleBlend); + #endif + //------------------------------------ + + //GHOST_ON + #if GHOST_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + half4 ghostResult; + ghostResult.a = saturate(luminance - _GhostTransparency) * col.a; + ghostResult.rgb = col.rgb * (luminance + _GhostColorBoost); + col = lerp(col, ghostResult, _GhostBlend); + #endif + //------------------------------------ + + //INNEROUTLINE_ON + #if INNEROUTLINE_ON + half3 innerT = abs(GetPixel(0, _InnerOutlineThickness, d.texcoord0.xy, _MainTex, sampler_MainTex) - GetPixel(0, -_InnerOutlineThickness, d.texcoord0.xy, _MainTex, sampler_MainTex)); + innerT += abs(GetPixel(_InnerOutlineThickness, 0, d.texcoord0.xy, _MainTex, sampler_MainTex) - GetPixel(-_InnerOutlineThickness, 0, d.texcoord0.xy, _MainTex, sampler_MainTex)); + #if !ONLYINNEROUTLINE_ON + innerT = (innerT / 2.0) * col.a * _InnerOutlineAlpha; + col.rgb += length(innerT) * _InnerOutlineColor.rgb * _InnerOutlineGlow; + #else + innerT *= col.a * _InnerOutlineAlpha; + col.rgb = length(innerT) * _InnerOutlineColor.rgb * _InnerOutlineGlow; + col.a = step(0.3, col.r+col.g+col.b); + #endif + #endif + //------------------------------------------------------- + + //HITEFFECT_ON + #if HITEFFECT_ON + col.rgb = lerp(col.rgb, _HitEffectColor.rgb * _HitEffectGlow, _HitEffectBlend); + #endif + //-------------------- + + //GRADIENT_ON + #if GRADIENT_ON + half2 tiledUvGrad = half2(uvRect.x / _MainTex_ST.x, uvRect.y / _MainTex_ST.y); + #if GRADIENT2COL_ON + _GradTopRightCol = _GradTopLeftCol; + _GradBotRightCol = _GradBotLeftCol; + #endif + #if RADIALGRADIENT_ON + half radialDist = 1 - length(tiledUvGrad - half2(0.5, 0.5)); + radialDist *= (_MainTex_TexelSize.w / _MainTex_TexelSize.z); + radialDist = saturate(_GradBoostX * radialDist); + half4 gradientResult = lerp(_GradTopLeftCol, _GradBotLeftCol, radialDist); + #else + half gradXLerpFactor = saturate(pow(tiledUvGrad.x, _GradBoostX)); + half4 gradientResult = lerp(lerp(_GradBotLeftCol, _GradBotRightCol, gradXLerpFactor), + lerp(_GradTopLeftCol, _GradTopRightCol, gradXLerpFactor), saturate(pow(tiledUvGrad.y, _GradBoostY))); + #endif + gradientResult = lerp(col, gradientResult, _GradBlend); + col.rgb = gradientResult.rgb * col.a; + col.a *= gradientResult.a; + #endif + //-------------------------------------------------------------------- + + //CONTRAST_ON + #if CONTRAST_ON + col.rgb = (col.rgb - float3(0.5, 0.5, 0.5)) * _Contrast + float3(0.5, 0.5, 0.5); + col.rgb += _Brightness; + #endif + + //------------------------------------------------------------------- + + //COLORSWAP_ON + #if COLORSWAP_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + half4 swapMask = SAMPLE_TEXTURE2D(_ColorSwapTex, sampler_ColorSwapTex, d.texcoord0.xy); + swapMask.rgb *= swapMask.a; + half3 redSwap = _ColorSwapRed * swapMask.r * saturate(luminance + _ColorSwapRedLuminosity); + half3 greenSwap = _ColorSwapGreen * swapMask.g * saturate(luminance + _ColorSwapGreenLuminosity); + half3 blueSwap = _ColorSwapBlue * swapMask.b * saturate(luminance + _ColorSwapBlueLuminosity); + swapMask.rgb = col.rgb * saturate(1 - swapMask.r - swapMask.g - swapMask.b); + col.rgb = lerp(col.rgb, swapMask.rgb + redSwap + greenSwap + blueSwap, _ColorSwapBlend); + #endif + //-------------------------------------------------------------------- + + //COLORRAMP_ON && !COLORRAMPOUTLINE_ON + #if COLORRAMP_ON && !COLORRAMPOUTLINE_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + luminance = saturate(luminance + _ColorRampLuminosity); + #if GRADIENTCOLORRAMP_ON + col.rgb = lerp(col.rgb, SAMPLE_TEXTURE2D(_ColorRampTexGradient, sampler_ColorRampTexGradient, half2(luminance, 0)).rgb, _ColorRampBlend); + #else + col.rgb = lerp(col.rgb, SAMPLE_TEXTURE2D(_ColorRampTex, sampler_ColorRampTex, half2(luminance, 0)).rgb, _ColorRampBlend); + #endif + #endif + //-------------------------------------------------------------------- + + //CHANGECOLOR_ON + #if CHANGECOLOR_ON + float3 currChangeColor = saturate(col.rgb); + luminance = 0.3 * currChangeColor.r + 0.59 * currChangeColor.g + 0.11 * currChangeColor.b; + luminance = saturate(luminance + _ColorChangeLuminosity); + half3 dif = abs(currChangeColor - _ColorChangeTarget.rgb); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _ColorChangeNewCol.rgb, + max(sign(1 - saturate(dif.x + dif.y + dif.z) - _ColorChangeTolerance), 0.0)); + #if CHANGECOLOR2_ON + dif = abs(currChangeColor - _ColorChangeTarget2.rgb); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _ColorChangeNewCol2.rgb, + max(sign(1 - saturate(dif.x + dif.y + dif.z) - _ColorChangeTolerance2), 0.0)); + #endif + #if CHANGECOLOR3_ON + dif = abs(currChangeColor - _ColorChangeTarget3.rgb); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _ColorChangeNewCol3.rgb, + max(sign(1 - saturate(dif.x + dif.y + dif.z) - _ColorChangeTolerance3), 0.0)); + #endif + #endif + //------------------------------------------------------- + + //POSTERIZE_ON && !POSTERIZEOUTLINE_ON + #if POSTERIZE_ON && !POSTERIZEOUTLINE_ON + col.rgb = pow(col.rgb, _PosterizeGamma) * _PosterizeNumColors; + col.rgb = floor(col.rgb) / _PosterizeNumColors; + col.rgb = pow(col.rgb, 1.0 / _PosterizeGamma); + #endif + //------------------------------------ + + //HSV_ON + #if HSV_ON + half3 resultHsv = half3(col.rgb); + half cosHsv = _HsvBright * _HsvSaturation * cos(_HsvShift * 3.14159265 / 180); + half sinHsv = _HsvBright * _HsvSaturation * sin(_HsvShift * 3.14159265 / 180); + resultHsv.x = (.299 * _HsvBright + .701 * cosHsv + .168 * sinHsv) * col.x + + (.587 * _HsvBright - .587 * cosHsv + .330 * sinHsv) * col.y + + (.114 * _HsvBright - .114 * cosHsv - .497 * sinHsv) * col.z; + resultHsv.y = (.299 * _HsvBright - .299 * cosHsv - .328 * sinHsv) *col.x + + (.587 * _HsvBright + .413 * cosHsv + .035 * sinHsv) * col.y + + (.114 * _HsvBright - .114 * cosHsv + .292 * sinHsv) * col.z; + resultHsv.z = (.299 * _HsvBright - .3 * cosHsv + 1.25 * sinHsv) * col.x + + (.587 * _HsvBright - .588 * cosHsv - 1.05 * sinHsv) * col.y + + (.114 * _HsvBright + .886 * cosHsv - .203 * sinHsv) * col.z; + col.rgb = resultHsv; + #endif + //------------------------------------------------------- + + //OVERLAY_ON + #if OVERLAY_ON + half2 overlayUvs = d.texcoord0.xy; + overlayUvs.x += ((_Time.y + randomSeed) * _OverlayTextureScrollXSpeed) % 1; + overlayUvs.y += ((_Time.y + randomSeed) * _OverlayTextureScrollYSpeed) % 1; + half4 overlayCol = SAMPLE_TEXTURE2D(_OverlayTex, sampler_OverlayTex, TRANSFORM_TEX(overlayUvs, _OverlayTex)); + overlayCol.rgb *= _OverlayColor.rgb * _OverlayGlow; + #if !OVERLAYMULT_ON + overlayCol.rgb *= overlayCol.a * _OverlayColor.rgb * _OverlayColor.a * _OverlayBlend; + col.rgb += overlayCol.rgb; + #else + overlayCol.a *= _OverlayColor.a; + col = lerp(col, col * overlayCol, _OverlayBlend); + #endif + #endif + + //--------------------------------- + + //OUTBASE_ON + #if OUTBASE_ON + #if OUTBASEPIXELPERF_ON + half2 destUv = half2(_OutlinePixelWidth * _MainTex_TexelSize.x, _OutlinePixelWidth * _MainTex_TexelSize.y); + #else + half2 destUv = half2(_OutlineWidth * _MainTex_TexelSize.x * 200, _OutlineWidth * _MainTex_TexelSize.y * 200); + #endif + + #if OUTDIST_ON + d.texcoord3.x += ((_Time.x + _RandomSeed) * _OutlineDistortTexXSpeed) % 1; + d.texcoord3.y += ((_Time.x + _RandomSeed) * _OutlineDistortTexYSpeed) % 1; + #if ATLAS_ON + d.texcoord3 = half2((d.texcoord3.x - _MinXUV) / (_MaxXUV - _MinXUV), (d.texcoord3.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half outDistortAmnt = (SAMPLE_TEXTURE2D(_OutlineDistortTex, sampler_OutlineDistortTex, d.texcoord3).r - 0.5) * 0.2 * _OutlineDistortAmount; + destUv.x += outDistortAmnt; + destUv.y += outDistortAmnt; + #endif + + half spriteLeft = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(destUv.x, 0)).a; + half spriteRight = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy - half2(destUv.x, 0)).a; + half spriteBottom = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(0, destUv.y)).a; + half spriteTop = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy - half2(0, destUv.y)).a; + half result = spriteLeft + spriteRight + spriteBottom + spriteTop; + + #if OUTBASE8DIR_ON + half spriteTopLeft = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(destUv.x, destUv.y)).a; + half spriteTopRight = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(-destUv.x, destUv.y)).a; + half spriteBotLeft = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(destUv.x, -destUv.y)).a; + half spriteBotRight = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(-destUv.x, -destUv.y)).a; + result = result + spriteTopLeft + spriteTopRight + spriteBotLeft + spriteBotRight; + #endif + + result = step(0.05, saturate(result)); + + #if OUTTEX_ON + d.texcoord1.x += ((_Time.x + _RandomSeed) * _OutlineTexXSpeed) % 1; + d.texcoord1.y += ((_Time.x + _RandomSeed) * _OutlineTexYSpeed) % 1; + #if ATLAS_ON + d.texcoord1 = half2((d.texcoord1.x - _MinXUV) / (_MaxXUV - _MinXUV), (d.texcoord1.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half4 tempOutColor = SAMPLE_TEXTURE2D(_OutlineTex, sampler_OutlineTex, d.texcoord1); + tempOutColor *= _OutlineColor; + _OutlineColor = tempOutColor; + #endif + + result *= (1 - originalAlpha) * _OutlineAlpha; + + half4 outline = _OutlineColor * d.vertexColor.a; + outline.rgb *= _OutlineGlow; + outline.a = result; + #if ONLYOUTLINE_ON + col = outline; + #else + col = lerp(col, outline, result); + #endif + #endif + //------------------------------------------------------- + + //FADE_ON + #if FADE_ON + half2 tiledUvFade1 = TRANSFORM_TEX(d.texcoord0, _FadeTex); + half2 tiledUvFade2 = TRANSFORM_TEX(d.texcoord0, _FadeBurnTex); + #if ATLAS_ON + tiledUvFade1 = half2((tiledUvFade1.x - _MinXUV) / (_MaxXUV - _MinXUV), (tiledUvFade1.y - _MinYUV) / (_MaxYUV - _MinYUV)); + tiledUvFade2 = half2((tiledUvFade2.x - _MinXUV) / (_MaxXUV - _MinXUV), (tiledUvFade2.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half fadeTemp = SAMPLE_TEXTURE2D(_FadeTex, sampler_FadeTex, tiledUvFade1).r; + half fade = smoothstep(_FadeAmount, _FadeAmount + _FadeBurnTransition, fadeTemp); + half fadeBurn = saturate(smoothstep(_FadeAmount - _FadeBurnWidth, _FadeAmount - _FadeBurnWidth + 0.1, fadeTemp) * _FadeAmount); + col.a *= fade; + _FadeBurnColor.rgb *= _FadeBurnGlow; + col += fadeBurn * SAMPLE_TEXTURE2D(_FadeBurnTex, sampler_FadeBurnTex, tiledUvFade2) * _FadeBurnColor * originalAlpha * (1 - col.a); + #endif + //------------------------------------------------------- + + //SHADOW_ON + #if SHADOW_ON + half shadowA = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(_ShadowX, _ShadowY)).a; + half preMultShadowMask = 1 - (saturate(shadowA - col.a) * (1 - col.a)); + col.rgb *= 1 - ((shadowA - col.a) * (1 - col.a)); + col.rgb += (_ShadowColor * shadowA) * (1 - col.a); + col.a = max(shadowA * _ShadowAlpha * d.vertexColor.a, col.a); + #endif + + //------------------------------------------------------- + + //GLOW_ON + #if GLOW_ON + half4 emission; + #if GLOWTEX_ON + emission = SAMPLE_TEXTURE2D(_GlowTex, sampler_GlowTex, d.texcoord0); + #else + emission = col; + #endif + + col.rgb *= _GlowGlobal; + emission.rgb *= emission.a * col.a * _Glow * _GlowColor; + col.rgb += emission.rgb; + #endif + //------------------------------------------------------- + + //COLORRAMP_ON && COLORRAMPOUTLINE_ON + #if COLORRAMP_ON && COLORRAMPOUTLINE_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + luminance = saturate(luminance + _ColorRampLuminosity); + #if GRADIENTCOLORRAMP_ON + col.rgb = lerp(col.rgb, SAMPLE_TEXTURE2D(_ColorRampTexGradient, sampler_ColorRampTexGradient, half2(luminance, 0)).rgb, _ColorRampBlend); + #else + col.rgb = lerp(col.rgb, SAMPLE_TEXTURE2D(_ColorRampTex, sampler_ColorRampTex, half2(luminance, 0)).rgb, _ColorRampBlend); + #endif + #endif + //--------------- + + //GREYSCALE_ON && GREYSCALEOUTLINE_ON + #if GREYSCALE_ON && GREYSCALEOUTLINE_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + luminance = saturate(luminance + _GreyscaleLuminosity); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _GreyscaleTintColor, _GreyscaleBlend); + #endif + + //----------------------------------- + + //POSTERIZE_ON && POSTERIZEOUTLINE_ON + #if POSTERIZE_ON && POSTERIZEOUTLINE_ON + col.rgb = pow(col.rgb, _PosterizeGamma) * _PosterizeNumColors; + col.rgb = floor(col.rgb) / _PosterizeNumColors; + col.rgb = pow(col.rgb, 1.0 / _PosterizeGamma); + #endif + + //----------------------------------- + + //SHINE_ON + #if SHINE_ON + half2 uvShine = uvRect; + half cosAngle = cos(_ShineRotate); + half sinAngle = sin(_ShineRotate); + half2x2 rot = half2x2(cosAngle, -sinAngle, sinAngle, cosAngle); + uvShine -= half2(0.5, 0.5); + uvShine = mul(rot, uvShine); + uvShine += half2(0.5, 0.5); + half shineMask = SAMPLE_TEXTURE2D(_ShineMask, sampler_ShineMask, d.texcoord0.xy).a; + half currentDistanceProjection = (uvShine.x + uvShine.y) / 2; + half whitePower = 1 - (abs(currentDistanceProjection - _ShineLocation) / _ShineWidth); + col.rgb += col.a * whitePower * _ShineGlow * max(sign(currentDistanceProjection - (_ShineLocation - _ShineWidth)), 0.0) + * max(sign((_ShineLocation + _ShineWidth) - currentDistanceProjection), 0.0) * _ShineColor * shineMask; + #endif + + //----------------------------------- + + //HOLOGRAM_ON + #if HOLOGRAM_ON + half totalHologram = _HologramStripesAmount + _HologramUnmodAmount; + half hologramYCoord = ((uvRect.y + (((_Time.x + randomSeed) % 1) * _HologramStripesSpeed)) % totalHologram) / totalHologram; + hologramYCoord = abs(hologramYCoord); + half alpha = RemapFloat(saturate(hologramYCoord - (_HologramUnmodAmount/totalHologram)), 0.0, 1.0, _HologramMinAlpha, saturate(_HologramMaxAlpha)); + half hologramMask = max(sign((_HologramUnmodAmount/totalHologram) - hologramYCoord), 0.0); + half4 hologramResult = col; + hologramResult.a *= lerp(alpha, 1, hologramMask); + hologramResult.rgb *= max(1, _HologramMaxAlpha * max(sign(hologramYCoord - (_HologramUnmodAmount/totalHologram)), 0.0)); + hologramMask = 1 - step(0.01,hologramMask); + hologramResult.rgb += hologramMask * _HologramStripeColor * col.a; + col = lerp(col, hologramResult, _HologramBlend); + #endif + + //----------------------------------- + + //FLICKER_ON + #if FLICKER_ON + col.a *= saturate(col.a * step(frac(0.05 + (_Time.w + randomSeed) * _FlickerFreq), 1 - _FlickerPercent) + _FlickerAlpha); + #endif + //----------------------------------- + + //ALPHACUTOFF_ON + + //ALPHAROUND_ON + + //ALPHAOUTLINE_ON + #if ALPHAOUTLINE_ON + half alphaOutlineRes = pow(1 - col.a, max(_AlphaOutlinePower, 0.0001)) * step(_AlphaOutlineMinAlpha, col.a) * _AlphaOutlineBlend; + col.rgb = lerp(col.rgb, _AlphaOutlineColor.rgb * _AlphaOutlineGlow, alphaOutlineRes); + col.a = lerp(col.a, 1, alphaOutlineRes > 1); + #endif + //------------------------------------------------------- + + //FOG_ON + + //------------------ + + col *= _Color; + o.Albedo = col; + col.a *= _Alpha; + clip(col.a - _AlphaCutoffValue - 0.01); + o.Alpha = _Color.a; + } + + + + + + void ChainSurfaceFunction(inout Surface l, inout ShaderData d) + { + Ext_SurfaceFunction0(l, d); + // Ext_SurfaceFunction1(l, d); + // Ext_SurfaceFunction2(l, d); + // Ext_SurfaceFunction3(l, d); + // Ext_SurfaceFunction4(l, d); + // Ext_SurfaceFunction5(l, d); + // Ext_SurfaceFunction6(l, d); + // Ext_SurfaceFunction7(l, d); + // Ext_SurfaceFunction8(l, d); + // Ext_SurfaceFunction9(l, d); + // Ext_SurfaceFunction10(l, d); + // Ext_SurfaceFunction11(l, d); + // Ext_SurfaceFunction12(l, d); + // Ext_SurfaceFunction13(l, d); + // Ext_SurfaceFunction14(l, d); + // Ext_SurfaceFunction15(l, d); + // Ext_SurfaceFunction16(l, d); + // Ext_SurfaceFunction17(l, d); + // Ext_SurfaceFunction18(l, d); + // Ext_SurfaceFunction19(l, d); + // Ext_SurfaceFunction20(l, d); + // Ext_SurfaceFunction21(l, d); + // Ext_SurfaceFunction22(l, d); + // Ext_SurfaceFunction23(l, d); + // Ext_SurfaceFunction24(l, d); + // Ext_SurfaceFunction25(l, d); + // Ext_SurfaceFunction26(l, d); + // Ext_SurfaceFunction27(l, d); + // Ext_SurfaceFunction28(l, d); + // Ext_SurfaceFunction29(l, d); + } + +#if !_DECALSHADER + + void ChainModifyVertex(inout VertexData v, inout VertexToPixel v2p, float4 time) + { + ExtraV2F d; + + ZERO_INITIALIZE(ExtraV2F, d); + ZERO_INITIALIZE(Blackboard, d.blackboard); + // due to motion vectors in HDRP, we need to use the last + // time in certain spots. So if you are going to use _Time to adjust vertices, + // you need to use this time or motion vectors will break. + d.time = time; + + Ext_ModifyVertex0(v, d); + // Ext_ModifyVertex1(v, d); + // Ext_ModifyVertex2(v, d); + // Ext_ModifyVertex3(v, d); + // Ext_ModifyVertex4(v, d); + // Ext_ModifyVertex5(v, d); + // Ext_ModifyVertex6(v, d); + // Ext_ModifyVertex7(v, d); + // Ext_ModifyVertex8(v, d); + // Ext_ModifyVertex9(v, d); + // Ext_ModifyVertex10(v, d); + // Ext_ModifyVertex11(v, d); + // Ext_ModifyVertex12(v, d); + // Ext_ModifyVertex13(v, d); + // Ext_ModifyVertex14(v, d); + // Ext_ModifyVertex15(v, d); + // Ext_ModifyVertex16(v, d); + // Ext_ModifyVertex17(v, d); + // Ext_ModifyVertex18(v, d); + // Ext_ModifyVertex19(v, d); + // Ext_ModifyVertex20(v, d); + // Ext_ModifyVertex21(v, d); + // Ext_ModifyVertex22(v, d); + // Ext_ModifyVertex23(v, d); + // Ext_ModifyVertex24(v, d); + // Ext_ModifyVertex25(v, d); + // Ext_ModifyVertex26(v, d); + // Ext_ModifyVertex27(v, d); + // Ext_ModifyVertex28(v, d); + // Ext_ModifyVertex29(v, d); + + + // #if %EXTRAV2F0REQUIREKEY% + // v2p.extraV2F0 = d.extraV2F0; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // v2p.extraV2F1 = d.extraV2F1; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // v2p.extraV2F2 = d.extraV2F2; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // v2p.extraV2F3 = d.extraV2F3; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // v2p.extraV2F4 = d.extraV2F4; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // v2p.extraV2F5 = d.extraV2F5; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // v2p.extraV2F6 = d.extraV2F6; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // v2p.extraV2F7 = d.extraV2F7; + // #endif + } + + void ChainModifyTessellatedVertex(inout VertexData v, inout VertexToPixel v2p) + { + ExtraV2F d; + ZERO_INITIALIZE(ExtraV2F, d); + ZERO_INITIALIZE(Blackboard, d.blackboard); + + // #if %EXTRAV2F0REQUIREKEY% + // d.extraV2F0 = v2p.extraV2F0; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // d.extraV2F1 = v2p.extraV2F1; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // d.extraV2F2 = v2p.extraV2F2; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // d.extraV2F3 = v2p.extraV2F3; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // d.extraV2F4 = v2p.extraV2F4; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // d.extraV2F5 = v2p.extraV2F5; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // d.extraV2F6 = v2p.extraV2F6; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // d.extraV2F7 = v2p.extraV2F7; + // #endif + + + // Ext_ModifyTessellatedVertex0(v, d); + // Ext_ModifyTessellatedVertex1(v, d); + // Ext_ModifyTessellatedVertex2(v, d); + // Ext_ModifyTessellatedVertex3(v, d); + // Ext_ModifyTessellatedVertex4(v, d); + // Ext_ModifyTessellatedVertex5(v, d); + // Ext_ModifyTessellatedVertex6(v, d); + // Ext_ModifyTessellatedVertex7(v, d); + // Ext_ModifyTessellatedVertex8(v, d); + // Ext_ModifyTessellatedVertex9(v, d); + // Ext_ModifyTessellatedVertex10(v, d); + // Ext_ModifyTessellatedVertex11(v, d); + // Ext_ModifyTessellatedVertex12(v, d); + // Ext_ModifyTessellatedVertex13(v, d); + // Ext_ModifyTessellatedVertex14(v, d); + // Ext_ModifyTessellatedVertex15(v, d); + // Ext_ModifyTessellatedVertex16(v, d); + // Ext_ModifyTessellatedVertex17(v, d); + // Ext_ModifyTessellatedVertex18(v, d); + // Ext_ModifyTessellatedVertex19(v, d); + // Ext_ModifyTessellatedVertex20(v, d); + // Ext_ModifyTessellatedVertex21(v, d); + // Ext_ModifyTessellatedVertex22(v, d); + // Ext_ModifyTessellatedVertex23(v, d); + // Ext_ModifyTessellatedVertex24(v, d); + // Ext_ModifyTessellatedVertex25(v, d); + // Ext_ModifyTessellatedVertex26(v, d); + // Ext_ModifyTessellatedVertex27(v, d); + // Ext_ModifyTessellatedVertex28(v, d); + // Ext_ModifyTessellatedVertex29(v, d); + + // #if %EXTRAV2F0REQUIREKEY% + // v2p.extraV2F0 = d.extraV2F0; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // v2p.extraV2F1 = d.extraV2F1; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // v2p.extraV2F2 = d.extraV2F2; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // v2p.extraV2F3 = d.extraV2F3; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // v2p.extraV2F4 = d.extraV2F4; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // v2p.extraV2F5 = d.extraV2F5; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // v2p.extraV2F6 = d.extraV2F6; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // v2p.extraV2F7 = d.extraV2F7; + // #endif + } + + void ChainFinalColorForward(inout Surface l, inout ShaderData d, inout half4 color) + { + // Ext_FinalColorForward0(l, d, color); + // Ext_FinalColorForward1(l, d, color); + // Ext_FinalColorForward2(l, d, color); + // Ext_FinalColorForward3(l, d, color); + // Ext_FinalColorForward4(l, d, color); + // Ext_FinalColorForward5(l, d, color); + // Ext_FinalColorForward6(l, d, color); + // Ext_FinalColorForward7(l, d, color); + // Ext_FinalColorForward8(l, d, color); + // Ext_FinalColorForward9(l, d, color); + // Ext_FinalColorForward10(l, d, color); + // Ext_FinalColorForward11(l, d, color); + // Ext_FinalColorForward12(l, d, color); + // Ext_FinalColorForward13(l, d, color); + // Ext_FinalColorForward14(l, d, color); + // Ext_FinalColorForward15(l, d, color); + // Ext_FinalColorForward16(l, d, color); + // Ext_FinalColorForward17(l, d, color); + // Ext_FinalColorForward18(l, d, color); + // Ext_FinalColorForward19(l, d, color); + // Ext_FinalColorForward20(l, d, color); + // Ext_FinalColorForward21(l, d, color); + // Ext_FinalColorForward22(l, d, color); + // Ext_FinalColorForward23(l, d, color); + // Ext_FinalColorForward24(l, d, color); + // Ext_FinalColorForward25(l, d, color); + // Ext_FinalColorForward26(l, d, color); + // Ext_FinalColorForward27(l, d, color); + // Ext_FinalColorForward28(l, d, color); + // Ext_FinalColorForward29(l, d, color); + } + + void ChainFinalGBufferStandard(inout Surface s, inout ShaderData d, inout half4 GBuffer0, inout half4 GBuffer1, inout half4 GBuffer2, inout half4 outEmission, inout half4 outShadowMask) + { + // Ext_FinalGBufferStandard0(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard1(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard2(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard3(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard4(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard5(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard6(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard7(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard8(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard9(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard10(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard11(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard12(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard13(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard14(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard15(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard16(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard17(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard18(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard19(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard20(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard21(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard22(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard23(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard24(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard25(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard26(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard27(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard28(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard29(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + } +#endif + + + + + +#if _DECALSHADER + + ShaderData CreateShaderData(SurfaceDescriptionInputs IN) + { + ShaderData d = (ShaderData)0; + d.TBNMatrix = float3x3(IN.WorldSpaceTangent, IN.WorldSpaceBiTangent, IN.WorldSpaceNormal); + d.worldSpaceNormal = IN.WorldSpaceNormal; + d.worldSpaceTangent = IN.WorldSpaceTangent; + + d.worldSpacePosition = IN.WorldSpacePosition; + d.texcoord0 = IN.uv0.xyxy; + d.screenPos = IN.ScreenPosition; + + d.worldSpaceViewDir = normalize(_WorldSpaceCameraPos - d.worldSpacePosition); + + d.tangentSpaceViewDir = mul(d.TBNMatrix, d.worldSpaceViewDir); + + // these rarely get used, so we back transform them. Usually will be stripped. + #if _HDRP + // d.localSpacePosition = mul(GetWorldToObjectMatrix(), float4(GetCameraRelativePositionWS(d.worldSpacePosition), 1)).xyz; + #else + // d.localSpacePosition = mul(GetWorldToObjectMatrix(), float4(d.worldSpacePosition, 1)).xyz; + #endif + // d.localSpaceNormal = normalize(mul((float3x3)GetWorldToObjectMatrix(), d.worldSpaceNormal)); + // d.localSpaceTangent = normalize(mul((float3x3)GetWorldToObjectMatrix(), d.worldSpaceTangent.xyz)); + + // #if %SCREENPOSREQUIREKEY% + // d.screenUV = (IN.ScreenPosition.xy / max(0.01, IN.ScreenPosition.w)); + // #endif + + return d; + } +#else + + ShaderData CreateShaderData(VertexToPixel i + #if NEED_FACING + , bool facing + #endif + ) + { + ShaderData d = (ShaderData)0; + d.clipPos = i.pos; + d.worldSpacePosition = i.worldPos; + + d.worldSpaceNormal = normalize(i.worldNormal); + d.worldSpaceTangent.xyz = normalize(i.worldTangent.xyz); + + d.tangentSign = i.worldTangent.w * unity_WorldTransformParams.w; + float3 bitangent = cross(d.worldSpaceTangent.xyz, d.worldSpaceNormal) * d.tangentSign; + + d.TBNMatrix = float3x3(d.worldSpaceTangent, -bitangent, d.worldSpaceNormal); + d.worldSpaceViewDir = normalize(_WorldSpaceCameraPos - i.worldPos); + + d.tangentSpaceViewDir = mul(d.TBNMatrix, d.worldSpaceViewDir); + d.texcoord0 = i.texcoord0; + d.texcoord1 = i.texcoord1; + d.texcoord2 = i.texcoord2; + + // #if %TEXCOORD3REQUIREKEY% + d.texcoord3 = i.texcoord3; + // #endif + + // d.isFrontFace = facing; + // #if %VERTEXCOLORREQUIREKEY% + d.vertexColor = i.vertexColor; + // #endif + + // these rarely get used, so we back transform them. Usually will be stripped. + #if _HDRP + // d.localSpacePosition = mul(GetWorldToObjectMatrix(), float4(GetCameraRelativePositionWS(i.worldPos), 1)).xyz; + #else + // d.localSpacePosition = mul(GetWorldToObjectMatrix(), float4(i.worldPos, 1)).xyz; + #endif + // d.localSpaceNormal = normalize(mul((float3x3)GetWorldToObjectMatrix(), i.worldNormal)); + // d.localSpaceTangent = normalize(mul((float3x3)GetWorldToObjectMatrix(), i.worldTangent.xyz)); + + // #if %SCREENPOSREQUIREKEY% + // d.screenPos = i.screenPos; + // d.screenUV = (i.screenPos.xy / i.screenPos.w); + // #endif + + + // #if %EXTRAV2F0REQUIREKEY% + // d.extraV2F0 = i.extraV2F0; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // d.extraV2F1 = i.extraV2F1; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // d.extraV2F2 = i.extraV2F2; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // d.extraV2F3 = i.extraV2F3; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // d.extraV2F4 = i.extraV2F4; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // d.extraV2F5 = i.extraV2F5; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // d.extraV2F6 = i.extraV2F6; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // d.extraV2F7 = i.extraV2F7; + // #endif + + return d; + } + +#endif + + + #if _PASSSHADOW + float3 _LightDirection; + #endif + + // vertex shader + VertexToPixel Vert (VertexData v) + { + + VertexToPixel o = (VertexToPixel)0; + + UNITY_SETUP_INSTANCE_ID(v); + UNITY_TRANSFER_INSTANCE_ID(v, o); + UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o); + + +#if !_TESSELLATION_ON + ChainModifyVertex(v, o, _Time); +#endif + + o.texcoord0 = v.texcoord0; + o.texcoord1 = v.texcoord1; + o.texcoord2 = v.texcoord2; + + // #if %TEXCOORD3REQUIREKEY% + o.texcoord3 = v.texcoord3; + // #endif + + // #if %VERTEXCOLORREQUIREKEY% + o.vertexColor = v.vertexColor; + // #endif + + VertexPositionInputs vertexInput = GetVertexPositionInputs(v.vertex.xyz); + o.worldPos = TransformObjectToWorld(v.vertex.xyz); + o.worldNormal = TransformObjectToWorldNormal(v.normal); + o.worldTangent = float4(TransformObjectToWorldDir(v.tangent.xyz), v.tangent.w); + + + #if _PASSSHADOW + // Define shadow pass specific clip position for Universal + o.pos = TransformWorldToHClip(ApplyShadowBias(o.worldPos, o.worldNormal, _LightDirection)); + #if UNITY_REVERSED_Z + o.pos.z = min(o.pos.z, o.pos.w * UNITY_NEAR_CLIP_VALUE); + #else + o.pos.z = max(o.pos.z, o.pos.w * UNITY_NEAR_CLIP_VALUE); + #endif + #elif _PASSMETA + o.pos = MetaVertexPosition(float4(v.vertex.xyz, 0), v.texcoord1.xy, v.texcoord2.xy, unity_LightmapST, unity_DynamicLightmapST); + #else + o.pos = TransformWorldToHClip(o.worldPos); + #endif + + + // #if %SCREENPOSREQUIREKEY% + // o.screenPos = ComputeScreenPos(o.pos, _ProjectionParams.x); + // #endif + + #if _PASSFORWARD || _PASSGBUFFER + float2 uv1 = v.texcoord1.xy; + OUTPUT_LIGHTMAP_UV(uv1, unity_LightmapST, o.lightmapUV); + o.texcoord1.xy = uv1; + OUTPUT_SH(o.worldNormal, o.sh); + #endif + + #ifdef VARYINGS_NEED_FOG_AND_VERTEX_LIGHT + #if _BAKEDLIT + half3 vertexLight = 0; + #else + half3 vertexLight = VertexLighting(o.worldPos, o.worldNormal); + #endif + half fogFactor = ComputeFogFactor(o.pos.z); + o.fogFactorAndVertexLight = half4(fogFactor, vertexLight); + #endif + + #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR) + o.shadowCoord = GetShadowCoord(vertexInput); + #endif + + return o; + } + + + + + // fragment shader + half4 Frag (VertexToPixel IN + #ifdef _DEPTHOFFSET_ON + , out float outputDepth : SV_Depth + #endif + #if NEED_FACING + , bool facing : SV_IsFrontFace + #endif + ) : SV_Target + { + UNITY_SETUP_INSTANCE_ID(IN); + UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX(IN); + + ShaderData d = CreateShaderData(IN + #if NEED_FACING + , facing + #endif + ); + Surface l = (Surface)0; + + #ifdef _DEPTHOFFSET_ON + l.outputDepth = outputDepth; + #endif + + l.Albedo = half3(0.5, 0.5, 0.5); + l.Normal = float3(0,0,1); + l.Occlusion = 1; + l.Alpha = 1; + + ChainSurfaceFunction(l, d); + + #ifdef _DEPTHOFFSET_ON + outputDepth = l.outputDepth; + #endif + + return 0; + + } + + ENDHLSL + + } + + + + Pass + { + Name "Meta" + Tags + { + "LightMode" = "Meta" + } + + // Render State + Cull Off + // ColorMask: + + Tags { "RenderType" = "Opaque" "Queue" = "Geometry" "PreviewType" = "Plane" } + Cull [_CullingOption] + ZWrite [_ZWrite] + ZTest [_ZTestMode] + + + HLSLPROGRAM + + #pragma vertex Vert + #pragma fragment Frag + + #pragma target 3.0 + + #pragma prefer_hlslcc gles + #pragma exclude_renderers d3d11_9x + + #define SHADERPASS_META + #define _PASSMETA 1 + + + + #pragma shader_feature_local GLOW_ON + #pragma shader_feature_local FADE_ON + #pragma shader_feature_local OUTBASE_ON + #pragma shader_feature_local ONLYOUTLINE_ON + #pragma shader_feature_local GRADIENT_ON + #pragma shader_feature_local GRADIENT2COL_ON + #pragma shader_feature_local RADIALGRADIENT_ON + #pragma shader_feature_local COLORSWAP_ON + #pragma shader_feature_local HSV_ON + #pragma shader_feature_local CHANGECOLOR_ON + #pragma shader_feature_local CHANGECOLOR2_ON + #pragma shader_feature_local CHANGECOLOR3_ON + #pragma shader_feature_local COLORRAMP_ON + #pragma shader_feature_local GRADIENTCOLORRAMP_ON + #pragma shader_feature_local HITEFFECT_ON + #pragma shader_feature_local NEGATIVE_ON + #pragma shader_feature_local PIXELATE_ON + #pragma shader_feature_local GREYSCALE_ON + #pragma shader_feature_local POSTERIZE_ON + #pragma shader_feature_local BLUR_ON + #pragma shader_feature_local MOTIONBLUR_ON + #pragma shader_feature_local GHOST_ON + #pragma shader_feature_local ALPHAOUTLINE_ON + #pragma shader_feature_local INNEROUTLINE_ON + #pragma shader_feature_local ONLYINNEROUTLINE_ON + #pragma shader_feature_local HOLOGRAM_ON + #pragma shader_feature_local CHROMABERR_ON + #pragma shader_feature_local GLITCH_ON + #pragma shader_feature_local FLICKER_ON + #pragma shader_feature_local SHADOW_ON + #pragma shader_feature_local SHINE_ON + #pragma shader_feature_local CONTRAST_ON + #pragma shader_feature_local OVERLAY_ON + #pragma shader_feature_local OVERLAYMULT_ON + #pragma shader_feature_local DOODLE_ON + #pragma shader_feature_local WIND_ON + #pragma shader_feature_local WAVEUV_ON + #pragma shader_feature_local ROUNDWAVEUV_ON + #pragma shader_feature_local RECTSIZE_ON + #pragma shader_feature_local OFFSETUV_ON + #pragma shader_feature_local CLIPPING_ON + #pragma shader_feature_local RADIALCLIPPING_ON + #pragma shader_feature_local TEXTURESCROLL_ON + #pragma shader_feature_local ZOOMUV_ON + #pragma shader_feature_local DISTORT_ON + #pragma shader_feature_local WARP_ON + #pragma shader_feature_local TWISTUV_ON + #pragma shader_feature_local ROTATEUV_ON + #pragma shader_feature_local POLARUV_ON + #pragma shader_feature_local FISHEYE_ON + #pragma shader_feature_local PINCH_ON + #pragma shader_feature_local SHAKEUV_ON + + #pragma shader_feature_local GLOWTEX_ON + #pragma shader_feature_local OUTTEX_ON + #pragma shader_feature_local OUTDIST_ON + #pragma shader_feature_local OUTBASE8DIR_ON + #pragma shader_feature_local OUTBASEPIXELPERF_ON + #pragma shader_feature_local COLORRAMPOUTLINE_ON + #pragma shader_feature_local GREYSCALEOUTLINE_ON + #pragma shader_feature_local POSTERIZEOUTLINE_ON + #pragma shader_feature_local BLURISHD_ON + #pragma shader_feature_local MANUALWIND_ON + #pragma shader_feature_local ATLAS_ON + #pragma shader_feature_local PREMULTIPLYALPHA_ON + + #pragma shader_feature BILBOARD_ON + #pragma shader_feature BILBOARDY_ON + + #pragma shader_feature NORMALMAP_ON + + + #define _URP 1 +#define _USINGTEXCOORD1 1 +#define _USINGTEXCOORD2 1 + + + + // Includes + #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Version.hlsl" + #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Color.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.universal/ShaderLibrary/ShaderGraphFunctions.hlsl" + #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/MetaInput.hlsl" + #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/TextureStack.hlsl" + #include "Packages/com.unity.shadergraph/ShaderGraphLibrary/ShaderVariablesFunctions.hlsl" + + + #undef WorldNormalVector + #define WorldNormalVector(data, normal) mul(normal, data.TBNMatrix) + + #define UnityObjectToWorldNormal(normal) mul(GetObjectToWorldMatrix(), normal) + + #define _WorldSpaceLightPos0 _MainLightPosition + + #define UNITY_DECLARE_TEX2D(name) TEXTURE2D(name); SAMPLER(sampler##name); + #define UNITY_DECLARE_TEX2D_NOSAMPLER(name) TEXTURE2D(name); + #define UNITY_DECLARE_TEX2DARRAY(name) TEXTURE2D_ARRAY(name); SAMPLER(sampler##name); + #define UNITY_DECLARE_TEX2DARRAY_NOSAMPLER(name) TEXTURE2D_ARRAY(name); + + #define UNITY_SAMPLE_TEX2DARRAY(tex,coord) SAMPLE_TEXTURE2D_ARRAY(tex, sampler##tex, coord.xy, coord.z) + #define UNITY_SAMPLE_TEX2DARRAY_LOD(tex,coord,lod) SAMPLE_TEXTURE2D_ARRAY_LOD(tex, sampler##tex, coord.xy, coord.z, lod) + #define UNITY_SAMPLE_TEX2D(tex, coord) SAMPLE_TEXTURE2D(tex, sampler##tex, coord) + #define UNITY_SAMPLE_TEX2D_SAMPLER(tex, samp, coord) SAMPLE_TEXTURE2D(tex, sampler##samp, coord) + + #define UNITY_SAMPLE_TEX2D_LOD(tex,coord, lod) SAMPLE_TEXTURE2D_LOD(tex, sampler_##tex, coord, lod) + #define UNITY_SAMPLE_TEX2D_SAMPLER_LOD(tex,samplertex,coord, lod) SAMPLE_TEXTURE2D_LOD (tex, sampler##samplertex,coord, lod) + + #if defined(UNITY_COMPILER_HLSL) + #define UNITY_INITIALIZE_OUTPUT(type,name) name = (type)0; + #else + #define UNITY_INITIALIZE_OUTPUT(type,name) + #endif + + #define sampler2D_float sampler2D + #define sampler2D_half sampler2D + + + + // data across stages, stripped like the above. + struct VertexToPixel + { + float4 pos : SV_POSITION; + float3 worldPos : TEXCOORD0; + float3 worldNormal : TEXCOORD1; + float4 worldTangent : TEXCOORD2; + float4 texcoord0 : TEXCOORD3; + float4 texcoord1 : TEXCOORD4; + float4 texcoord2 : TEXCOORD5; + + // #if %TEXCOORD3REQUIREKEY% + float4 texcoord3 : TEXCOORD6; + // #endif + + // #if %SCREENPOSREQUIREKEY% + // float4 screenPos : TEXCOORD7; + // #endif + + // #if %VERTEXCOLORREQUIREKEY% + half4 vertexColor : COLOR; + // #endif + + // #if %EXTRAV2F0REQUIREKEY% + // float4 extraV2F0 : TEXCOORD12; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // float4 extraV2F1 : TEXCOORD13; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // float4 extraV2F2 : TEXCOORD14; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // float4 extraV2F3 : TEXCOORD15; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // float4 extraV2F4 : TEXCOORD16; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // float4 extraV2F5 : TEXCOORD17; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // float4 extraV2F6 : TEXCOORD18; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // float4 extraV2F7 : TEXCOORD19; + // #endif + + #if defined(LIGHTMAP_ON) + float2 lightmapUV : TEXCOORD8; + #endif + #if !defined(LIGHTMAP_ON) + float3 sh : TEXCOORD9; + #endif + + #ifdef VARYINGS_NEED_FOG_AND_VERTEX_LIGHT + float4 fogFactorAndVertexLight : TEXCOORD10; + #endif + + #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR) + float4 shadowCoord : TEXCOORD11; + #endif + + #if UNITY_ANY_INSTANCING_ENABLED + uint instanceID : CUSTOM_INSTANCE_ID; + #endif + #if (defined(UNITY_STEREO_INSTANCING_ENABLED)) + uint stereoTargetEyeIndexAsRTArrayIdx : SV_RenderTargetArrayIndex; + #endif + #if (defined(UNITY_STEREO_MULTIVIEW_ENABLED)) || (defined(UNITY_STEREO_INSTANCING_ENABLED) && (defined(SHADER_API_GLES3) || defined(SHADER_API_GLCORE))) + uint stereoTargetEyeIndexAsBlendIdx0 : BLENDINDICES0; + #endif + #if defined(SHADER_STAGE_FRAGMENT) && defined(VARYINGS_NEED_CULLFACE) + FRONT_FACE_TYPE cullFace : FRONT_FACE_SEMANTIC; + #endif + }; + + + + + // data describing the user output of a pixel + struct Surface + { + half3 Albedo; + half Height; + half3 Normal; + half Smoothness; + half3 Emission; + half Metallic; + half3 Specular; + half Occlusion; + half SpecularPower; // for simple lighting + half Alpha; + float outputDepth; // if written, SV_Depth semantic is used. ShaderData.clipPos.z is unused value + // HDRP Only + half SpecularOcclusion; + half SubsurfaceMask; + half Thickness; + half CoatMask; + half CoatSmoothness; + half Anisotropy; + half IridescenceMask; + half IridescenceThickness; + int DiffusionProfileHash; + float SpecularAAThreshold; + float SpecularAAScreenSpaceVariance; + // requires _OVERRIDE_BAKEDGI to be defined, but is mapped in all pipelines + float3 DiffuseGI; + float3 BackDiffuseGI; + float3 SpecularGI; + float ior; + float3 transmittanceColor; + float atDistance; + float transmittanceMask; + // requires _OVERRIDE_SHADOWMASK to be defines + float4 ShadowMask; + + // for decals + float NormalAlpha; + float MAOSAlpha; + + + }; + + // Data the user declares in blackboard blocks + struct Blackboard + { + + float blackboardDummyData; + }; + + // data the user might need, this will grow to be big. But easy to strip + struct ShaderData + { + float4 clipPos; // SV_POSITION + float3 localSpacePosition; + float3 localSpaceNormal; + float3 localSpaceTangent; + + float3 worldSpacePosition; + float3 worldSpaceNormal; + float3 worldSpaceTangent; + float tangentSign; + + float3 worldSpaceViewDir; + float3 tangentSpaceViewDir; + + float4 texcoord0; + float4 texcoord1; + float4 texcoord2; + float4 texcoord3; + + float2 screenUV; + float4 screenPos; + + float4 vertexColor; + bool isFrontFace; + + float4 extraV2F0; + float4 extraV2F1; + float4 extraV2F2; + float4 extraV2F3; + float4 extraV2F4; + float4 extraV2F5; + float4 extraV2F6; + float4 extraV2F7; + + float3x3 TBNMatrix; + Blackboard blackboard; + }; + + struct VertexData + { + #if SHADER_TARGET > 30 + // uint vertexID : SV_VertexID; + #endif + float4 vertex : POSITION; + float3 normal : NORMAL; + float4 tangent : TANGENT; + float4 texcoord0 : TEXCOORD0; + + // optimize out mesh coords when not in use by user or lighting system + #if _URP && (_USINGTEXCOORD1 || _PASSMETA || _PASSFORWARD || _PASSGBUFFER) + float4 texcoord1 : TEXCOORD1; + #endif + + #if _URP && (_USINGTEXCOORD2 || _PASSMETA || ((_PASSFORWARD || _PASSGBUFFER) && defined(DYNAMICLIGHTMAP_ON))) + float4 texcoord2 : TEXCOORD2; + #endif + + #if _STANDARD && (_USINGTEXCOORD1 || (_PASSMETA || ((_PASSFORWARD || _PASSGBUFFER || _PASSFORWARDADD) && LIGHTMAP_ON))) + float4 texcoord1 : TEXCOORD1; + #endif + #if _STANDARD && (_USINGTEXCOORD2 || (_PASSMETA || ((_PASSFORWARD || _PASSGBUFFER) && DYNAMICLIGHTMAP_ON))) + float4 texcoord2 : TEXCOORD2; + #endif + + + #if _HDRP + float4 texcoord1 : TEXCOORD1; + float4 texcoord2 : TEXCOORD2; + #endif + + // #if %TEXCOORD3REQUIREKEY% + float4 texcoord3 : TEXCOORD3; + // #endif + + // #if %VERTEXCOLORREQUIREKEY% + float4 vertexColor : COLOR; + // #endif + + #if _PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR)) + float3 previousPositionOS : TEXCOORD4; // Contain previous transform position (in case of skinning for example) + #if defined (_ADD_PRECOMPUTED_VELOCITY) + float3 precomputedVelocity : TEXCOORD5; // Add Precomputed Velocity (Alembic computes velocities on runtime side). + #endif + #endif + + UNITY_VERTEX_INPUT_INSTANCE_ID + }; + + struct TessVertex + { + float4 vertex : INTERNALTESSPOS; + float3 normal : NORMAL; + float4 tangent : TANGENT; + float4 texcoord0 : TEXCOORD0; + float4 texcoord1 : TEXCOORD1; + float4 texcoord2 : TEXCOORD2; + + // #if %TEXCOORD3REQUIREKEY% + float4 texcoord3 : TEXCOORD3; + // #endif + + // #if %VERTEXCOLORREQUIREKEY% + float4 vertexColor : COLOR; + // #endif + + // #if %EXTRAV2F0REQUIREKEY% + // float4 extraV2F0 : TEXCOORD5; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // float4 extraV2F1 : TEXCOORD6; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // float4 extraV2F2 : TEXCOORD7; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // float4 extraV2F3 : TEXCOORD8; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // float4 extraV2F4 : TEXCOORD9; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // float4 extraV2F5 : TEXCOORD10; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // float4 extraV2F6 : TEXCOORD11; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // float4 extraV2F7 : TEXCOORD12; + // #endif + + #if _PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR)) + float3 previousPositionOS : TEXCOORD13; // Contain previous transform position (in case of skinning for example) + #if defined (_ADD_PRECOMPUTED_VELOCITY) + float3 precomputedVelocity : TEXCOORD14; + #endif + #endif + + UNITY_VERTEX_INPUT_INSTANCE_ID + UNITY_VERTEX_OUTPUT_STEREO + }; + + struct ExtraV2F + { + float4 extraV2F0; + float4 extraV2F1; + float4 extraV2F2; + float4 extraV2F3; + float4 extraV2F4; + float4 extraV2F5; + float4 extraV2F6; + float4 extraV2F7; + Blackboard blackboard; + float4 time; + }; + + + float3 WorldToTangentSpace(ShaderData d, float3 normal) + { + return mul(d.TBNMatrix, normal); + } + + float3 TangentToWorldSpace(ShaderData d, float3 normal) + { + return mul(normal, d.TBNMatrix); + } + + // in this case, make standard more like SRPs, because we can't fix + // unity_WorldToObject in HDRP, since it already does macro-fu there + + #if _STANDARD + float3 TransformWorldToObject(float3 p) { return mul(unity_WorldToObject, float4(p, 1)); }; + float3 TransformObjectToWorld(float3 p) { return mul(unity_ObjectToWorld, float4(p, 1)); }; + float4 TransformWorldToObject(float4 p) { return mul(unity_WorldToObject, p); }; + float4 TransformObjectToWorld(float4 p) { return mul(unity_ObjectToWorld, p); }; + float4x4 GetWorldToObjectMatrix() { return unity_WorldToObject; } + float4x4 GetObjectToWorldMatrix() { return unity_ObjectToWorld; } + #if (defined(SHADER_API_D3D11) || defined(SHADER_API_XBOXONE) || defined(UNITY_COMPILER_HLSLCC) || defined(SHADER_API_PSSL) || (SHADER_TARGET_SURFACE_ANALYSIS && !SHADER_TARGET_SURFACE_ANALYSIS_MOJOSHADER)) + #define UNITY_SAMPLE_TEX2D_LOD(tex,coord, lod) tex.SampleLevel (sampler##tex,coord, lod) + #define UNITY_SAMPLE_TEX2D_SAMPLER_LOD(tex,samplertex,coord, lod) tex.SampleLevel (sampler##samplertex,coord, lod) + #else + #define UNITY_SAMPLE_TEX2D_LOD(tex,coord,lod) tex2D (tex,coord,0,lod) + #define UNITY_SAMPLE_TEX2D_SAMPLER_LOD(tex,samplertex,coord,lod) tex2D (tex,coord,0,lod) + #endif + + #undef GetWorldToObjectMatrix() + + #define GetWorldToObjectMatrix() unity_WorldToObject + + + #endif + + float3 GetCameraWorldPosition() + { + #if _HDRP + return GetCameraRelativePositionWS(_WorldSpaceCameraPos); + #else + return _WorldSpaceCameraPos; + #endif + } + + #if _GRABPASSUSED + #if _STANDARD + TEXTURE2D(%GRABTEXTURE%); + SAMPLER(sampler_%GRABTEXTURE%); + #endif + + half3 GetSceneColor(float2 uv) + { + #if _STANDARD + return SAMPLE_TEXTURE2D(%GRABTEXTURE%, sampler_%GRABTEXTURE%, uv).rgb; + #else + return SHADERGRAPH_SAMPLE_SCENE_COLOR(uv); + #endif + } + #endif + + + + #if _STANDARD + UNITY_DECLARE_DEPTH_TEXTURE(_CameraDepthTexture); + float GetSceneDepth(float2 uv) { return SAMPLE_DEPTH_TEXTURE(_CameraDepthTexture, uv); } + float GetLinear01Depth(float2 uv) { return Linear01Depth(GetSceneDepth(uv)); } + float GetLinearEyeDepth(float2 uv) { return LinearEyeDepth(GetSceneDepth(uv)); } + #else + float GetSceneDepth(float2 uv) { return SHADERGRAPH_SAMPLE_SCENE_DEPTH(uv); } + float GetLinear01Depth(float2 uv) { return Linear01Depth(GetSceneDepth(uv), _ZBufferParams); } + float GetLinearEyeDepth(float2 uv) { return LinearEyeDepth(GetSceneDepth(uv), _ZBufferParams); } + #endif + + float3 GetWorldPositionFromDepthBuffer(float2 uv, float3 worldSpaceViewDir) + { + float eye = GetLinearEyeDepth(uv); + float3 camView = mul((float3x3)GetObjectToWorldMatrix(), transpose(mul(GetWorldToObjectMatrix(), UNITY_MATRIX_I_V)) [2].xyz); + + float dt = dot(worldSpaceViewDir, camView); + float3 div = worldSpaceViewDir/dt; + float3 wpos = (eye * div) + GetCameraWorldPosition(); + return wpos; + } + + #if _HDRP + float3 ObjectToWorldSpacePosition(float3 pos) + { + return GetAbsolutePositionWS(TransformObjectToWorld(pos)); + } + #else + float3 ObjectToWorldSpacePosition(float3 pos) + { + return TransformObjectToWorld(pos); + } + #endif + + #if _STANDARD + UNITY_DECLARE_SCREENSPACE_TEXTURE(_CameraDepthNormalsTexture); + float3 GetSceneNormal(float2 uv, float3 worldSpaceViewDir) + { + float4 depthNorms = UNITY_SAMPLE_SCREENSPACE_TEXTURE(_CameraDepthNormalsTexture, uv); + float3 norms = DecodeViewNormalStereo(depthNorms); + norms = mul((float3x3)GetWorldToViewMatrix(), norms) * 0.5 + 0.5; + return norms; + } + #elif _HDRP && !_DECALSHADER + + float3 GetSceneNormal(float2 uv, float3 worldSpaceViewDir) + { + NormalData nd; + DecodeFromNormalBuffer(_ScreenSize.xy * uv, nd); + return nd.normalWS; + } + #elif _URP + #if (SHADER_LIBRARY_VERSION_MAJOR >= 10) + #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/DeclareNormalsTexture.hlsl" + #endif + + float3 GetSceneNormal(float2 uv, float3 worldSpaceViewDir) + { + #if (SHADER_LIBRARY_VERSION_MAJOR >= 10) + return SampleSceneNormals(uv); + #else + float3 wpos = GetWorldPositionFromDepthBuffer(uv, worldSpaceViewDir); + return normalize(-cross(ddx(wpos), ddy(wpos))) * 0.5 + 0.5; + #endif + + } + #endif + + #if _HDRP + + half3 UnpackNormalmapRGorAG(half4 packednormal) + { + // This do the trick + packednormal.x *= packednormal.w; + + half3 normal; + normal.xy = packednormal.xy * 2 - 1; + normal.z = sqrt(1 - saturate(dot(normal.xy, normal.xy))); + return normal; + } + half3 UnpackNormal(half4 packednormal) + { + #if defined(UNITY_NO_DXT5nm) + return packednormal.xyz * 2 - 1; + #else + return UnpackNormalmapRGorAG(packednormal); + #endif + } + #endif + #if _HDRP || _URP + + half3 UnpackScaleNormal(half4 packednormal, half scale) + { + #ifndef UNITY_NO_DXT5nm + // Unpack normal as DXT5nm (1, y, 1, x) or BC5 (x, y, 0, 1) + // Note neutral texture like "bump" is (0, 0, 1, 1) to work with both plain RGB normal and DXT5nm/BC5 + packednormal.x *= packednormal.w; + #endif + half3 normal; + normal.xy = (packednormal.xy * 2 - 1) * scale; + normal.z = sqrt(1 - saturate(dot(normal.xy, normal.xy))); + return normal; + } + + #endif + + + void GetSun(out float3 lightDir, out float3 color) + { + lightDir = float3(0.5, 0.5, 0); + color = 1; + #if _HDRP + if (_DirectionalLightCount > 0) + { + DirectionalLightData light = _DirectionalLightDatas[0]; + lightDir = -light.forward.xyz; + color = light.color; + } + #elif _STANDARD + lightDir = normalize(_WorldSpaceLightPos0.xyz); + color = _LightColor0.rgb; + #elif _URP + Light light = GetMainLight(); + lightDir = light.direction; + color = light.color; + #endif + } + + + + CBUFFER_START(UnityPerMaterial) + + + half4 _Color; + half4 _MainTex_ST, _MainTex_TexelSize; + half _Alpha, _AlphaCutoffValue; + + #if ATLAS_ON + half _MinXUV, _MaxXUV, _MinYUV, _MaxYUV; + #endif + + #if GLOW_ON + half4 _GlowColor; + half _Glow, _GlowGlobal; + #endif + + #if HSV_ON + half _HsvShift, _HsvSaturation, _HsvBright; + #endif + + #if DISTORT_ON + half4 _DistortTex_ST; + half _DistortTexXSpeed, _DistortTexYSpeed, _DistortAmount; + #endif + + #if FADE_ON + half4 _FadeBurnColor, _FadeTex_ST, _FadeBurnTex_ST; + half _FadeAmount, _FadeBurnWidth, _FadeBurnTransition,_FadeBurnGlow; + #endif + + #if OUTBASE_ON + half4 _OutlineColor; + half _OutlineAlpha, _OutlineGlow, _OutlineWidth; + int _OutlinePixelWidth; + #endif + + #if OUTTEX_ON + half4 _OutlineTex_ST; + half _OutlineTexXSpeed, _OutlineTexYSpeed; + #endif + + #if OUTDIST_ON + half4 _OutlineDistortTex_ST; + half _OutlineDistortTexXSpeed, _OutlineDistortTexYSpeed, _OutlineDistortAmount; + #endif + + #if ALPHAOUTLINE_ON + half _AlphaOutlineGlow, _AlphaOutlinePower, _AlphaOutlineMinAlpha, _AlphaOutlineBlend; + half4 _AlphaOutlineColor; + #endif + + #if INNEROUTLINE_ON + half _InnerOutlineThickness, _InnerOutlineAlpha, _InnerOutlineGlow; + half4 _InnerOutlineColor; + #endif + + #if GRADIENT_ON + half _GradBlend, _GradBoostX, _GradBoostY; + half4 _GradTopRightCol, _GradTopLeftCol, _GradBotRightCol, _GradBotLeftCol; + #endif + + #if COLORSWAP_ON + half4 _ColorSwapRed, _ColorSwapGreen, _ColorSwapBlue; + half _ColorSwapRedLuminosity, _ColorSwapGreenLuminosity, _ColorSwapBlueLuminosity, _ColorSwapBlend; + #endif + + #if CHANGECOLOR_ON + half4 _ColorChangeNewCol, _ColorChangeTarget; + half _ColorChangeTolerance, _ColorChangeLuminosity; + #endif + #if CHANGECOLOR2_ON + half4 _ColorChangeNewCol2, _ColorChangeTarget2; + half _ColorChangeTolerance2; + #endif + #if CHANGECOLOR3_ON + half4 _ColorChangeNewCol3, _ColorChangeTarget3; + half _ColorChangeTolerance3; + #endif + + #if COLORRAMP_ON + half _ColorRampLuminosity, _ColorRampBlend; + #endif + + #if HITEFFECT_ON + half4 _HitEffectColor; + half _HitEffectGlow, _HitEffectBlend; + #endif + + #if NEGATIVE_ON + half _NegativeAmount; + #endif + + #if PIXELATE_ON + half _PixelateSize; + #endif + + #if GREYSCALE_ON + half _GreyscaleLuminosity, _GreyscaleBlend; + half4 _GreyscaleTintColor; + #endif + + #if POSTERIZE_ON + half _PosterizeNumColors, _PosterizeGamma; + #endif + + #if BLUR_ON + half _BlurIntensity; + #endif + + #if MOTIONBLUR_ON + half _MotionBlurAngle, _MotionBlurDist; + #endif + + #if GHOST_ON + half _GhostColorBoost, _GhostTransparency, _GhostBlend; + #endif + + #if HOLOGRAM_ON + half _HologramStripesAmount, _HologramMinAlpha, _HologramUnmodAmount, _HologramStripesSpeed, _HologramMaxAlpha, _HologramBlend; + half4 _HologramStripeColor; + #endif + + #if CHROMABERR_ON + half _ChromAberrAmount, _ChromAberrAlpha; + #endif + + #if GLITCH_ON + half _GlitchAmount, _GlitchSize; + #endif + + #if FLICKER_ON + half _FlickerFreq, _FlickerPercent, _FlickerAlpha; + #endif + + #if SHADOW_ON + half _ShadowX, _ShadowY, _ShadowAlpha; + half4 _ShadowColor; + #endif + + #if SHINE_ON + half4 _ShineColor; + half _ShineLocation, _ShineRotate, _ShineWidth, _ShineGlow; + #endif + + #if CONTRAST_ON + half _Contrast, _Brightness; + #endif + + #if OVERLAY_ON + half4 _OverlayTex_ST, _OverlayColor; + half _OverlayGlow, _OverlayBlend, _OverlayTextureScrollXSpeed, _OverlayTextureScrollYSpeed; + #endif + + #if DOODLE_ON + half _HandDrawnAmount, _HandDrawnSpeed; + #endif + + #if WIND_ON + half _GrassSpeed, _GrassWind, _GrassManualAnim, _GrassRadialBend; + #endif + + #if WAVEUV_ON + float _WaveAmount, _WaveSpeed, _WaveStrength, _WaveX, _WaveY; + #endif + + #if ROUNDWAVEUV_ON + half _RoundWaveStrength, _RoundWaveSpeed; + #endif + + #if RECTSIZE_ON + half _RectSize; + #endif + + #if OFFSETUV_ON + half _OffsetUvX, _OffsetUvY; + #endif + + #if CLIPPING_ON + half _ClipUvLeft, _ClipUvRight, _ClipUvUp, _ClipUvDown; + #endif + + #if RADIALCLIPPING_ON + half _RadialStartAngle, _RadialClip, _RadialClip2; + #endif + + #if TEXTURESCROLL_ON + half _TextureScrollXSpeed, _TextureScrollYSpeed; + #endif + + #if ZOOMUV_ON + half _ZoomUvAmount; + #endif + + #if WARP_ON + half _WarpStrength, _WarpSpeed, _WarpScale; + #endif + + #if TWISTUV_ON + half _TwistUvAmount, _TwistUvPosX, _TwistUvPosY, _TwistUvRadius; + #endif + + #if ROTATEUV_ON + half _RotateUvAmount; + #endif + + #if FISHEYE_ON + half _FishEyeUvAmount; + #endif + + #if PINCH_ON + half _PinchUvAmount; + #endif + + #if SHAKEUV_ON + half _ShakeUvSpeed, _ShakeUvX, _ShakeUvY; + #endif + + #if NORMALMAP_ON + half _NormalStrength; + #endif + + float _RandomSeed; + + + + + CBUFFER_END + + + + + + + + TEXTURE2D(_MainTex); + SAMPLER(sampler_MainTex); + + #if GLOW_ON + TEXTURE2D(_GlowTex); + SAMPLER(sampler_GlowTex); + #endif + + #if FADE_ON + TEXTURE2D(_FadeTex); + SAMPLER(sampler_FadeTex); + + TEXTURE2D(_FadeBurnTex); + SAMPLER(sampler_FadeBurnTex); + #endif + + #if DISTORT_ON + TEXTURE2D(_DistortTex); + SAMPLER(sampler_DistortTex); + #endif + + #if OUTTEX_ON + TEXTURE2D(_OutlineTex); + SAMPLER(sampler_OutlineTex); + #endif + + #if OUTDIST_ON + TEXTURE2D(_OutlineDistortTex); + SAMPLER(sampler_OutlineDistortTex); + #endif + + #if COLORSWAP_ON + TEXTURE2D(_ColorSwapTex); + SAMPLER(sampler_ColorSwapTex); + #endif + + #if COLORRAMP_ON + TEXTURE2D(_ColorRampTex); + TEXTURE2D(_ColorRampTexGradient); + SAMPLER(sampler_ColorRampTex); + SAMPLER(sampler_ColorRampTexGradient); + #endif + + #if SHINE_ON + TEXTURE2D(_ShineMask); + SAMPLER(sampler_ShineMask); + #endif + + #if OVERLAY_ON + TEXTURE2D(_OverlayTex); + SAMPLER(sampler_OverlayTex); + #endif + + #if NORMALMAP_ON + TEXTURE2D(_NormalMap); + SAMPLER(sampler_NormalMap); + #endif + + + half3 GetPixel(in int offsetX, in int offsetY, in half2 uv, in Texture2D _tex, in SamplerState _sampler) + { + half2 _uv = uv + half2(offsetX * _MainTex_TexelSize.x, offsetY * _MainTex_TexelSize.y); + half4 col = SAMPLE_TEXTURE2D(_tex, _sampler, _uv); + return col.rgb; + } + + + //BLURS------------------------------------------------------------------------- + half4 Blur(half2 uv, Texture2D source, SamplerState sampler_source, half Intensity) + { + const half2 texelSize = 1.0 / _ScreenParams.xy; + const half4 color = SAMPLE_TEXTURE2D(source, sampler_source, uv); + const half2 offset = Intensity * texelSize; + + half4 accumulatedColor = color; + half accumulatedWeight = 1.0; + for (int x = -1; x <= 1; x++) + { + for (int y = -1; y <= 1; y++) + { + const half2 sampleUV = uv + half2(x, y) * offset; + const half4 sampleColor = SAMPLE_TEXTURE2D(source, sampler_source, sampleUV); + + accumulatedColor += sampleColor; + accumulatedWeight += 1.0; + } + } + + half4 blurredColor = accumulatedColor / accumulatedWeight; + return blurredColor; + } + + half BlurHD_G(half bhqp, half x) + { + return exp(-(x * x) / (2.0 * bhqp * bhqp)); + } + half4 BlurHD(half2 uv, Texture2D source, SamplerState sampler_source, half BlurAmount, half xScale, half yScale) + { + int iterations = 16; + int halfIterations = iterations / 2; + half sigmaX = 0.1 + BlurAmount * 0.5; + half sigmaY = sigmaX; + half total = 0.0; + half4 ret = half4(0, 0, 0, 0); + for (int iy = 0; iy < iterations; ++iy) + { + half fy = BlurHD_G(sigmaY, half(iy) -half(halfIterations)); + half offsetY = half(iy - halfIterations) * 0.00390625 * xScale; + for (int ix = 0; ix < iterations; ++ix) + { + half fx = BlurHD_G(sigmaX, half(ix) - half(halfIterations)); + half offsetX = half(ix - halfIterations) * 0.00390625 * yScale; + total += fx * fy; + ret += SAMPLE_TEXTURE2D(source, sampler_source, uv + half2(offsetX, offsetY)) * fx * fy; + } + } + return ret / total; + } + //----------------------------------------------------------------------- + + + //------------------------------------------- + half RemapFloat(half inValue, half inMin, half inMax, half outMin, half outMax){ + return outMin + (inValue - inMin) * (outMax - outMin) / (inMax - inMin); + } + //------------------------------------------- + + //----------------------------------------------------------------------- + half rand(half2 seed, half offset) { + return (frac(sin(dot(seed, half2(12.9898, 78.233))) * 43758.5453) + offset) % 1.0; + } + + half rand2(half2 seed, half offset) { + return (frac(sin(dot(seed * floor(50 + (_Time.x % 1.0) * 12.), half2(127.1, 311.7))) * 43758.5453123) + offset) % 1.0; + } + + half rand2CustomTime(half2 seed, half offset, half customTime) { + return (frac(sin(dot(seed * floor(50 + (customTime % 1.0) * 12.), half2(127.1, 311.7))) * 43758.5453123) + offset) % 1.0; + } + //----------------------------------------------------------------------- + + + void Ext_ModifyVertex0 (inout VertexData v, inout ExtraV2F d) + { + //BILBOARD_ON + #if BILBOARD_ON + half3 camRight = mul((half3x3)unity_CameraToWorld, half3(1,0,0)); + half3 camUp = half3(0,1,0); + #if BILBOARDY_ON + camUp = mul((half3x3)unity_CameraToWorld, half3(0,1,0)); + #endif + half3 localPos = v.vertex.x * camRight + v.vertex.y * camUp; + v.vertex = half4(localPos, 1); + #endif + //----------------------------------------------------------- + + v.texcoord0.xy = TRANSFORM_TEX(v.texcoord0.xy, _MainTex); + half2 center = half2(0.5, 0.5); + #if ATLAS_ON + center = half2((_MaxXUV + _MinXUV) / 2.0, (_MaxYUV + _MinYUV) / 2.0); + #endif + + //POLARUV_ON + #if POLARUV_ON + v.texcoord0.xy = v.texcoord0.xy - center; + #endif + + //---------------------------------------- + + //ROTATEUV_ON + #if ROTATEUV_ON + half2 uvC = v.texcoord0.xy; + half cosAngle = cos(_RotateUvAmount); + half sinAngle = sin(_RotateUvAmount); + half2x2 rot = half2x2(cosAngle, -sinAngle, sinAngle, cosAngle); + uvC -= center; + v.texcoord0.xy = mul(rot, uvC); + v.texcoord0.xy += center; + #endif + //-------------------- + + #if RECTSIZE_ON + v.vertex.xyz += (v.vertex.xyz * (_RectSize - 1.0)); + #endif + + #if OUTTEX_ON + v.texcoord1.xy = TRANSFORM_TEX(v.texcoord0.xy, _OutlineTex); + #endif + + #if OUTDIST_ON + v.texcoord2.xy = TRANSFORM_TEX(v.texcoord0.xy, _OutlineDistortTex); + #endif + + #if DISTORT_ON + v.texcoord3.xy = TRANSFORM_TEX(v.texcoord0.xy, _DistortTex); + #endif + } + + void Ext_SurfaceFunction0 (inout Surface o, ShaderData d) + { + half randomSeed = _RandomSeed; + + float2 uvRect = d.texcoord0; + half2 center = half2(0.5, 0.5); + #if ATLAS_ON + center = half2((_MaxXUV + _MinXUV) / 2.0, (_MaxYUV + _MinYUV) / 2.0); + uvRect = half2((d.texcoord0.x - _MinXUV) / (_MaxXUV - _MinXUV), (d.texcoord0.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half2 centerTiled = half2(center.x * _MainTex_ST.x, center.y * _MainTex_ST.y); + + //CLIPPING_ON + #if CLIPPING_ON + half2 tiledUv = half2(d.texcoord0.x / _MainTex_ST.x, d.texcoord0.y / _MainTex_ST.y); + #if ATLAS_ON + tiledUv = half2((tiledUv.x - _MinXUV) / (_MaxXUV - _MinXUV), (tiledUv.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + clip((1 - _ClipUvUp) - tiledUv.y); + clip(tiledUv.y - _ClipUvDown); + clip((1 - _ClipUvRight) - tiledUv.x); + clip(tiledUv.x - _ClipUvLeft); + #endif + //---------------------------------- + + //RADIALCLIPPING_ON + #if RADIALCLIPPING_ON + half2 tiledUv2 = half2(d.texcoord0.x / _MainTex_ST.x, d.texcoord0.y / _MainTex_ST.y); + #if ATLAS_ON + tiledUv2 = half2((tiledUv2.x - _MinXUV) / (_MaxXUV - _MinXUV), (tiledUv2.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half startAngle = _RadialStartAngle - _RadialClip; + half endAngle = _RadialStartAngle + _RadialClip2; + half offset0 = clamp(0, 360, startAngle + 360); + half offset360 = clamp(0, 360, endAngle - 360); + half2 atan2Coord = half2(lerp(-1, 1, tiledUv2.x), lerp(-1, 1, tiledUv2.y)); + half atanAngle = atan2(atan2Coord.y, atan2Coord.x) * 57.3; // angle in degrees + if(atanAngle < 0) atanAngle = 360 + atanAngle; + if(atanAngle >= startAngle && atanAngle <= endAngle) discard; + if(atanAngle <= offset360) discard; + if(atanAngle >= offset0) discard; + #endif + + //----------------------------- + + //TEXTURESCROLL_ON && ATLAS_ON + #if TEXTURESCROLL_ON && ATLAS_ON + d.texcoord0.xy = half2(_MinXUV + ((_MaxXUV - _MinXUV) * (abs(((_Time.y + randomSeed) * _TextureScrollXSpeed) + uvRect.x) % 1)), + _MinYUV + ((_MaxYUV - _MinYUV) * (abs(((_Time.y + randomSeed) * _TextureScrollYSpeed) + uvRect.y) % 1))); + #endif + //---------------------------- + + //OFFSETUV_ON + #if OFFSETUV_ON + #if ATLAS_ON + d.texcoord0.xy = half2(_MinXUV + ((_MaxXUV - _MinXUV) * (abs((_OffsetUvX + uvRect.x) % 1))), + _MinYUV + ((_MaxYUV - _MinYUV) * (abs(_OffsetUvY + uvRect.y) % 1))); + #else + d.texcoord0.xy += half2(_OffsetUvX, _OffsetUvY); + #endif + #endif + + //---------------------- + + //POLARUV_ON + #if POLARUV_ON + d.texcoord0.xy = half2(atan2(d.texcoord0.y, d.texcoord0.x) / (2.0f * 3.141592653589f), length(d.texcoord0.xy)); + d.texcoord0.xy *= _MainTex_ST.xy; + #endif + + //-------------------------------------- + + //TWISTUV_ON + #if TWISTUV_ON + #if ATLAS_ON + _TwistUvPosX = ((_MaxXUV - _MinXUV) * _TwistUvPosX) + _MinXUV; + _TwistUvPosY = ((_MaxYUV - _MinYUV) * _TwistUvPosY) + _MinYUV; + #endif + half2 tempUv = d.texcoord0.xy - half2(_TwistUvPosX * _MainTex_ST.x, _TwistUvPosY * _MainTex_ST.y); + _TwistUvRadius *= (_MainTex_ST.x + _MainTex_ST.y) / 2; + half percent = (_TwistUvRadius - length(tempUv)) / _TwistUvRadius; + half theta = percent * percent * (2.0 * sin(_TwistUvAmount)) * 8.0; + half s = sin(theta); + half c = cos(theta); + half beta = max(sign(_TwistUvRadius - length(tempUv)), 0.0); + tempUv = half2(dot(tempUv, half2(c, -s)), dot(tempUv, half2(s, c))) * beta + tempUv * (1 - beta); + tempUv += half2(_TwistUvPosX * _MainTex_ST.x, _TwistUvPosY * _MainTex_ST.y); + d.texcoord0.xy = tempUv; + #endif + + //-------------------------------------------- + + //FISHEYE_ON + #if FISHEYE_ON + half bind = length(centerTiled); + half2 dF = d.texcoord0.xy - centerTiled; + half dFlen = length(dF); + half fishInt = (3.14159265359 / bind) * (_FishEyeUvAmount + 0.001); + d.texcoord0.xy = centerTiled + (dF / (max(0.0001, dFlen))) * tan(dFlen * fishInt) * bind / tan(bind * fishInt); + #endif + //--------------------------------------------- + + //PINCH_ON + #if PINCH_ON + half2 dP = d.texcoord0.xy - centerTiled; + half pinchInt = (3.141592 / length(centerTiled)) * (-_PinchUvAmount + 0.001); + d.texcoord0.xy = centerTiled + normalize(dP) * atan(length(dP) * -pinchInt * 10.0) * 0.5 / atan(-pinchInt * 5); + #endif + + //--------------------------------------------- + + //ZOOMUV_ON + #if ZOOMUV_ON + d.texcoord0.xy -= centerTiled; + d.texcoord0.xy = d.texcoord0.xy * _ZoomUvAmount; + d.texcoord0.xy += centerTiled; + #endif + + //----------------------------------------------- + + //DOODLE_ON + #if DOODLE_ON + half2 uvCopy = uvRect; + _HandDrawnSpeed = (floor((_Time.x + randomSeed) * 20 * _HandDrawnSpeed) / _HandDrawnSpeed) * _HandDrawnSpeed; + uvCopy.x = sin((uvCopy.x * _HandDrawnAmount + _HandDrawnSpeed) * 4); + uvCopy.y = cos((uvCopy.y * _HandDrawnAmount + _HandDrawnSpeed) * 4); + d.texcoord0.xy = lerp(d.texcoord0.xy, d.texcoord0.xy + uvCopy, 0.0005 * _HandDrawnAmount); + #endif + + //-------------------------- + + //SHAKEUV_ON + #if SHAKEUV_ON + half xShake = sin((_Time.x + randomSeed) * _ShakeUvSpeed * 50) * _ShakeUvX; + half yShake = cos((_Time.x + randomSeed) * _ShakeUvSpeed * 50) * _ShakeUvY; + d.texcoord0.xy += half2(xShake * 0.012, yShake * 0.01); + #endif + + //------------------------------------------- + + //RECTSIZE_ON + #if RECTSIZE_ON + d.texcoord0.xy = d.texcoord0.xy * (_RectSize).xx + (((-_RectSize * 0.5) + 0.5)).xx; + #endif + + //------------------------------------------- + + //DISTORT_ON + #if DISTORT_ON + #if ATLAS_ON + d.texcoord3.x = d.texcoord3.x * (1 / (_MaxXUV - _MinXUV)); + d.texcoord3.y = d.texcoord3.y * (1 / (_MaxYUV - _MinYUV)); + #endif + + d.texcoord3.x += ((_Time.x + _RandomSeed) * _DistortTexXSpeed) % 1; + d.texcoord3.y += ((_Time.x + _RandomSeed) * _DistortTexYSpeed) % 1; + half distortAmnt = (SAMPLE_TEXTURE2D(_DistortTex, sampler_DistortTex, d.texcoord3.xy).r - 0.5) * 0.2 * _DistortAmount; + d.texcoord0.x += distortAmnt; + d.texcoord0.y += distortAmnt; + #endif + //------------------------------------------------------- + + //WARP_ON + #if WARP_ON + half2 warpUv = half2(d.texcoord0.x / _MainTex_ST.x, d.texcoord0.y / _MainTex_ST.y); + #if ATLAS_ON + warpUv = half2((warpUv.x - _MinXUV) / (_MaxXUV - _MinXUV), (warpUv.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + const float tau = 6.283185307179586; + float xWarp = (_Time.y + randomSeed) * _WarpSpeed + warpUv.x * tau / _WarpScale; + float yWarp = (_Time.y + randomSeed) * _WarpSpeed + warpUv.y * tau / _WarpScale; + float2 warp = float2(sin(xWarp), sin(yWarp)) * _WarpStrength; + d.texcoord0.xy += warp; + #endif + + //------------------------------------------------------- + + //WAVEUV_ON + #if WAVEUV_ON + float2 uvWave = half2(_WaveX * _MainTex_ST.x, _WaveY * _MainTex_ST.y) - d.texcoord0.xy; + uvWave %= 1; + #if ATLAS_ON + uvWave = half2(_WaveX, _WaveY) - uvRect; + #endif + uvWave.x *= _ScreenParams.x / _ScreenParams.y; + float waveTime = _Time.y + randomSeed; + float angWave = (sqrt(dot(uvWave, uvWave)) * _WaveAmount) - ((waveTime * _WaveSpeed)); + d.texcoord0.xy = d.texcoord0.xy + uvWave * sin(angWave) * (_WaveStrength / 1000.0); + #endif + //---------------------------------------------------- + + //ROUNDWAVEUV_ON + #if ROUNDWAVEUV_ON + half xWave = ((0.5 * _MainTex_ST.x) - uvRect.x); + half yWave = ((0.5 * _MainTex_ST.y) - uvRect.y) * (_MainTex_TexelSize.w / _MainTex_TexelSize.z); + half ripple = -sqrt(xWave*xWave + yWave* yWave); + d.texcoord0.xy += (sin((ripple + (_Time.y + randomSeed) * (_RoundWaveSpeed/10.0)) / 0.015) * (_RoundWaveStrength/10.0)) % 1; + #endif + //---------------------------------------------------- + + + //WIND_ON + #if WIND_ON + half windOffset = sin((_Time.x + randomSeed) * _GrassSpeed * 10); + half2 windCenter = half2(0.5, 0.1); + #if ATLAS_ON + windCenter.x = ((_MaxXUV - _MinXUV) * windCenter.x) + _MinXUV; + windCenter.y = ((_MaxYUV - _MinYUV) * windCenter.y) + _MinYUV; + #endif + #if !MANUALWIND_ON + d.texcoord0.x = fmod(abs(lerp(d.texcoord0.x, d.texcoord0.x + (_GrassWind * 0.01 * windOffset), uvRect.y)), 1); + #else + d.texcoord0.x = fmod(abs(lerp(d.texcoord0.x, d.texcoord0.x + (_GrassWind * 0.01 * _GrassManualAnim), uvRect.y)), 1); + windOffset = _GrassManualAnim; + #endif + half2 delta = d.texcoord0.xy - windCenter; + half delta2 = dot(delta.xy, delta.xy); + half2 delta_offset = delta2 * windOffset; + d.texcoord0.xy = d.texcoord0.xy + half2(delta.y, -delta.x) * delta_offset * _GrassRadialBend; + #endif + + //-------------------------------------------------------- + + //TEXTURESCROLL_ON && !ATLAS_ON + #if TEXTURESCROLL_ON && !ATLAS_ON + d.texcoord0.x += ((_Time.y + randomSeed) * _TextureScrollXSpeed) % 1; + d.texcoord0.y += ((_Time.y + randomSeed) * _TextureScrollYSpeed) % 1; + #endif + //------------------------------ + + //PIXELATE_ON + #if PIXELATE_ON + half aspectRatio = _MainTex_TexelSize.x / _MainTex_TexelSize.y; + half2 pixelSize = float2(_PixelateSize, _PixelateSize * aspectRatio); + d.texcoord0.xy = floor(d.texcoord0.xy * pixelSize) / pixelSize; + #endif + //-------------- + + half4 col = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy); + half originalAlpha = col.a; + col *= d.vertexColor; + + //NORMAL MAP + #if NORMALMAP_ON + half4 normalSample = SAMPLE_TEXTURE2D(_NormalMap, sampler_NormalMap, d.texcoord0.xy); + half3 normalTS = UnpackNormal(normalSample); + normalTS.xy *= _NormalStrength; + o.Normal = normalTS; + #endif + + + //GLITCH_ON + #if GLITCH_ON + half2 uvGlitch = uvRect; + uvGlitch.y -= 0.5; + half lineNoise = pow(rand2(floor(uvGlitch * half2(24., 19.) * _GlitchSize) * 4.0, randomSeed), 3.0) * _GlitchAmount + * pow(rand2(floor(uvGlitch * half2(38., 14.) * _GlitchSize) * 4.0, randomSeed), 3.0); + col = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(lineNoise * 0.02 * rand2(half2(2.0, 1), randomSeed), 0)) * d.vertexColor; + #endif + //-------------------------------------- + + //CHROMABERR_ON + #if CHROMABERR_ON + half4 r = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(_ChromAberrAmount/10, 0)) * d.vertexColor; + half4 b = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(-_ChromAberrAmount/10, 0)) * d.vertexColor; + col = half4(r.r * r.a, col.g, b.b * b.a, max(max(r.a, b.a) * _ChromAberrAlpha, col.a)); + #endif + + //-------------------------------- + + //BLUR_ON + #if BLUR_ON + #if ATLAS_ON + #if !BLURISHD_ON + col = BlurHD(d.texcoord0.xy, _MainTex, sampler_MainTex, _BlurIntensity, (_MaxXUV - _MinXUV), (_MaxYUV - _MinYUV)) * d.vertexColor; + #else + col = Blur(d.texcoord0.xy, _MainTex, sampler_MainTex, _BlurIntensity * (_MaxXUV - _MinXUV)) * d.vertexColor; + #endif + #else + #if !BLURISHD_ON + col = BlurHD(d.texcoord0.xy, _MainTex, sampler_MainTex, _BlurIntensity, 1, 1) * d.vertexColor; + #else + col = Blur(d.texcoord0.xy, _MainTex, sampler_MainTex, _BlurIntensity) * d.vertexColor; + #endif + #endif + #endif + + //-------------------- + + //MOTIONBLUR_ON + #if MOTIONBLUR_ON + _MotionBlurAngle = _MotionBlurAngle * 3.1415926; + #define rot(n) mul(n, half2x2(cos(_MotionBlurAngle), -sin(_MotionBlurAngle), sin(_MotionBlurAngle), cos(_MotionBlurAngle))) + _MotionBlurDist = _MotionBlurDist * 0.005; + #if ATLAS_ON + _MotionBlurDist *= (_MaxXUV - _MinXUV); + #endif + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(-_MotionBlurDist, -_MotionBlurDist))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(-_MotionBlurDist * 2, -_MotionBlurDist * 2))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(-_MotionBlurDist * 3, -_MotionBlurDist * 3))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(-_MotionBlurDist * 4, -_MotionBlurDist * 4))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(_MotionBlurDist, _MotionBlurDist))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(_MotionBlurDist * 2, _MotionBlurDist * 2))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(_MotionBlurDist * 3, _MotionBlurDist * 3))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(_MotionBlurDist * 4, _MotionBlurDist * 4))); + col.rgb = col.rgb / 9; + #endif + //------------------------------------ + + //NEGATIVE_ON + #if NEGATIVE_ON + col.rgb = lerp(col.rgb, 1 - col.rgb, _NegativeAmount); + #endif + + //-------------- + half luminance = 0; + + //GREYSCALE_ON && !GREYSCALEOUTLINE_ON + #if GREYSCALE_ON && !GREYSCALEOUTLINE_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + luminance = saturate(luminance + _GreyscaleLuminosity); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _GreyscaleTintColor, _GreyscaleBlend); + #endif + //------------------------------------ + + //GHOST_ON + #if GHOST_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + half4 ghostResult; + ghostResult.a = saturate(luminance - _GhostTransparency) * col.a; + ghostResult.rgb = col.rgb * (luminance + _GhostColorBoost); + col = lerp(col, ghostResult, _GhostBlend); + #endif + //------------------------------------ + + //INNEROUTLINE_ON + #if INNEROUTLINE_ON + half3 innerT = abs(GetPixel(0, _InnerOutlineThickness, d.texcoord0.xy, _MainTex, sampler_MainTex) - GetPixel(0, -_InnerOutlineThickness, d.texcoord0.xy, _MainTex, sampler_MainTex)); + innerT += abs(GetPixel(_InnerOutlineThickness, 0, d.texcoord0.xy, _MainTex, sampler_MainTex) - GetPixel(-_InnerOutlineThickness, 0, d.texcoord0.xy, _MainTex, sampler_MainTex)); + #if !ONLYINNEROUTLINE_ON + innerT = (innerT / 2.0) * col.a * _InnerOutlineAlpha; + col.rgb += length(innerT) * _InnerOutlineColor.rgb * _InnerOutlineGlow; + #else + innerT *= col.a * _InnerOutlineAlpha; + col.rgb = length(innerT) * _InnerOutlineColor.rgb * _InnerOutlineGlow; + col.a = step(0.3, col.r+col.g+col.b); + #endif + #endif + //------------------------------------------------------- + + //HITEFFECT_ON + #if HITEFFECT_ON + col.rgb = lerp(col.rgb, _HitEffectColor.rgb * _HitEffectGlow, _HitEffectBlend); + #endif + //-------------------- + + //GRADIENT_ON + #if GRADIENT_ON + half2 tiledUvGrad = half2(uvRect.x / _MainTex_ST.x, uvRect.y / _MainTex_ST.y); + #if GRADIENT2COL_ON + _GradTopRightCol = _GradTopLeftCol; + _GradBotRightCol = _GradBotLeftCol; + #endif + #if RADIALGRADIENT_ON + half radialDist = 1 - length(tiledUvGrad - half2(0.5, 0.5)); + radialDist *= (_MainTex_TexelSize.w / _MainTex_TexelSize.z); + radialDist = saturate(_GradBoostX * radialDist); + half4 gradientResult = lerp(_GradTopLeftCol, _GradBotLeftCol, radialDist); + #else + half gradXLerpFactor = saturate(pow(tiledUvGrad.x, _GradBoostX)); + half4 gradientResult = lerp(lerp(_GradBotLeftCol, _GradBotRightCol, gradXLerpFactor), + lerp(_GradTopLeftCol, _GradTopRightCol, gradXLerpFactor), saturate(pow(tiledUvGrad.y, _GradBoostY))); + #endif + gradientResult = lerp(col, gradientResult, _GradBlend); + col.rgb = gradientResult.rgb * col.a; + col.a *= gradientResult.a; + #endif + //-------------------------------------------------------------------- + + //CONTRAST_ON + #if CONTRAST_ON + col.rgb = (col.rgb - float3(0.5, 0.5, 0.5)) * _Contrast + float3(0.5, 0.5, 0.5); + col.rgb += _Brightness; + #endif + + //------------------------------------------------------------------- + + //COLORSWAP_ON + #if COLORSWAP_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + half4 swapMask = SAMPLE_TEXTURE2D(_ColorSwapTex, sampler_ColorSwapTex, d.texcoord0.xy); + swapMask.rgb *= swapMask.a; + half3 redSwap = _ColorSwapRed * swapMask.r * saturate(luminance + _ColorSwapRedLuminosity); + half3 greenSwap = _ColorSwapGreen * swapMask.g * saturate(luminance + _ColorSwapGreenLuminosity); + half3 blueSwap = _ColorSwapBlue * swapMask.b * saturate(luminance + _ColorSwapBlueLuminosity); + swapMask.rgb = col.rgb * saturate(1 - swapMask.r - swapMask.g - swapMask.b); + col.rgb = lerp(col.rgb, swapMask.rgb + redSwap + greenSwap + blueSwap, _ColorSwapBlend); + #endif + //-------------------------------------------------------------------- + + //COLORRAMP_ON && !COLORRAMPOUTLINE_ON + #if COLORRAMP_ON && !COLORRAMPOUTLINE_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + luminance = saturate(luminance + _ColorRampLuminosity); + #if GRADIENTCOLORRAMP_ON + col.rgb = lerp(col.rgb, SAMPLE_TEXTURE2D(_ColorRampTexGradient, sampler_ColorRampTexGradient, half2(luminance, 0)).rgb, _ColorRampBlend); + #else + col.rgb = lerp(col.rgb, SAMPLE_TEXTURE2D(_ColorRampTex, sampler_ColorRampTex, half2(luminance, 0)).rgb, _ColorRampBlend); + #endif + #endif + //-------------------------------------------------------------------- + + //CHANGECOLOR_ON + #if CHANGECOLOR_ON + float3 currChangeColor = saturate(col.rgb); + luminance = 0.3 * currChangeColor.r + 0.59 * currChangeColor.g + 0.11 * currChangeColor.b; + luminance = saturate(luminance + _ColorChangeLuminosity); + half3 dif = abs(currChangeColor - _ColorChangeTarget.rgb); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _ColorChangeNewCol.rgb, + max(sign(1 - saturate(dif.x + dif.y + dif.z) - _ColorChangeTolerance), 0.0)); + #if CHANGECOLOR2_ON + dif = abs(currChangeColor - _ColorChangeTarget2.rgb); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _ColorChangeNewCol2.rgb, + max(sign(1 - saturate(dif.x + dif.y + dif.z) - _ColorChangeTolerance2), 0.0)); + #endif + #if CHANGECOLOR3_ON + dif = abs(currChangeColor - _ColorChangeTarget3.rgb); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _ColorChangeNewCol3.rgb, + max(sign(1 - saturate(dif.x + dif.y + dif.z) - _ColorChangeTolerance3), 0.0)); + #endif + #endif + //------------------------------------------------------- + + //POSTERIZE_ON && !POSTERIZEOUTLINE_ON + #if POSTERIZE_ON && !POSTERIZEOUTLINE_ON + col.rgb = pow(col.rgb, _PosterizeGamma) * _PosterizeNumColors; + col.rgb = floor(col.rgb) / _PosterizeNumColors; + col.rgb = pow(col.rgb, 1.0 / _PosterizeGamma); + #endif + //------------------------------------ + + //HSV_ON + #if HSV_ON + half3 resultHsv = half3(col.rgb); + half cosHsv = _HsvBright * _HsvSaturation * cos(_HsvShift * 3.14159265 / 180); + half sinHsv = _HsvBright * _HsvSaturation * sin(_HsvShift * 3.14159265 / 180); + resultHsv.x = (.299 * _HsvBright + .701 * cosHsv + .168 * sinHsv) * col.x + + (.587 * _HsvBright - .587 * cosHsv + .330 * sinHsv) * col.y + + (.114 * _HsvBright - .114 * cosHsv - .497 * sinHsv) * col.z; + resultHsv.y = (.299 * _HsvBright - .299 * cosHsv - .328 * sinHsv) *col.x + + (.587 * _HsvBright + .413 * cosHsv + .035 * sinHsv) * col.y + + (.114 * _HsvBright - .114 * cosHsv + .292 * sinHsv) * col.z; + resultHsv.z = (.299 * _HsvBright - .3 * cosHsv + 1.25 * sinHsv) * col.x + + (.587 * _HsvBright - .588 * cosHsv - 1.05 * sinHsv) * col.y + + (.114 * _HsvBright + .886 * cosHsv - .203 * sinHsv) * col.z; + col.rgb = resultHsv; + #endif + //------------------------------------------------------- + + //OVERLAY_ON + #if OVERLAY_ON + half2 overlayUvs = d.texcoord0.xy; + overlayUvs.x += ((_Time.y + randomSeed) * _OverlayTextureScrollXSpeed) % 1; + overlayUvs.y += ((_Time.y + randomSeed) * _OverlayTextureScrollYSpeed) % 1; + half4 overlayCol = SAMPLE_TEXTURE2D(_OverlayTex, sampler_OverlayTex, TRANSFORM_TEX(overlayUvs, _OverlayTex)); + overlayCol.rgb *= _OverlayColor.rgb * _OverlayGlow; + #if !OVERLAYMULT_ON + overlayCol.rgb *= overlayCol.a * _OverlayColor.rgb * _OverlayColor.a * _OverlayBlend; + col.rgb += overlayCol.rgb; + #else + overlayCol.a *= _OverlayColor.a; + col = lerp(col, col * overlayCol, _OverlayBlend); + #endif + #endif + + //--------------------------------- + + //OUTBASE_ON + #if OUTBASE_ON + #if OUTBASEPIXELPERF_ON + half2 destUv = half2(_OutlinePixelWidth * _MainTex_TexelSize.x, _OutlinePixelWidth * _MainTex_TexelSize.y); + #else + half2 destUv = half2(_OutlineWidth * _MainTex_TexelSize.x * 200, _OutlineWidth * _MainTex_TexelSize.y * 200); + #endif + + #if OUTDIST_ON + d.texcoord3.x += ((_Time.x + _RandomSeed) * _OutlineDistortTexXSpeed) % 1; + d.texcoord3.y += ((_Time.x + _RandomSeed) * _OutlineDistortTexYSpeed) % 1; + #if ATLAS_ON + d.texcoord3 = half2((d.texcoord3.x - _MinXUV) / (_MaxXUV - _MinXUV), (d.texcoord3.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half outDistortAmnt = (SAMPLE_TEXTURE2D(_OutlineDistortTex, sampler_OutlineDistortTex, d.texcoord3).r - 0.5) * 0.2 * _OutlineDistortAmount; + destUv.x += outDistortAmnt; + destUv.y += outDistortAmnt; + #endif + + half spriteLeft = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(destUv.x, 0)).a; + half spriteRight = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy - half2(destUv.x, 0)).a; + half spriteBottom = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(0, destUv.y)).a; + half spriteTop = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy - half2(0, destUv.y)).a; + half result = spriteLeft + spriteRight + spriteBottom + spriteTop; + + #if OUTBASE8DIR_ON + half spriteTopLeft = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(destUv.x, destUv.y)).a; + half spriteTopRight = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(-destUv.x, destUv.y)).a; + half spriteBotLeft = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(destUv.x, -destUv.y)).a; + half spriteBotRight = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(-destUv.x, -destUv.y)).a; + result = result + spriteTopLeft + spriteTopRight + spriteBotLeft + spriteBotRight; + #endif + + result = step(0.05, saturate(result)); + + #if OUTTEX_ON + d.texcoord1.x += ((_Time.x + _RandomSeed) * _OutlineTexXSpeed) % 1; + d.texcoord1.y += ((_Time.x + _RandomSeed) * _OutlineTexYSpeed) % 1; + #if ATLAS_ON + d.texcoord1 = half2((d.texcoord1.x - _MinXUV) / (_MaxXUV - _MinXUV), (d.texcoord1.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half4 tempOutColor = SAMPLE_TEXTURE2D(_OutlineTex, sampler_OutlineTex, d.texcoord1); + tempOutColor *= _OutlineColor; + _OutlineColor = tempOutColor; + #endif + + result *= (1 - originalAlpha) * _OutlineAlpha; + + half4 outline = _OutlineColor * d.vertexColor.a; + outline.rgb *= _OutlineGlow; + outline.a = result; + #if ONLYOUTLINE_ON + col = outline; + #else + col = lerp(col, outline, result); + #endif + #endif + //------------------------------------------------------- + + //FADE_ON + #if FADE_ON + half2 tiledUvFade1 = TRANSFORM_TEX(d.texcoord0, _FadeTex); + half2 tiledUvFade2 = TRANSFORM_TEX(d.texcoord0, _FadeBurnTex); + #if ATLAS_ON + tiledUvFade1 = half2((tiledUvFade1.x - _MinXUV) / (_MaxXUV - _MinXUV), (tiledUvFade1.y - _MinYUV) / (_MaxYUV - _MinYUV)); + tiledUvFade2 = half2((tiledUvFade2.x - _MinXUV) / (_MaxXUV - _MinXUV), (tiledUvFade2.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half fadeTemp = SAMPLE_TEXTURE2D(_FadeTex, sampler_FadeTex, tiledUvFade1).r; + half fade = smoothstep(_FadeAmount, _FadeAmount + _FadeBurnTransition, fadeTemp); + half fadeBurn = saturate(smoothstep(_FadeAmount - _FadeBurnWidth, _FadeAmount - _FadeBurnWidth + 0.1, fadeTemp) * _FadeAmount); + col.a *= fade; + _FadeBurnColor.rgb *= _FadeBurnGlow; + col += fadeBurn * SAMPLE_TEXTURE2D(_FadeBurnTex, sampler_FadeBurnTex, tiledUvFade2) * _FadeBurnColor * originalAlpha * (1 - col.a); + #endif + //------------------------------------------------------- + + //SHADOW_ON + #if SHADOW_ON + half shadowA = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(_ShadowX, _ShadowY)).a; + half preMultShadowMask = 1 - (saturate(shadowA - col.a) * (1 - col.a)); + col.rgb *= 1 - ((shadowA - col.a) * (1 - col.a)); + col.rgb += (_ShadowColor * shadowA) * (1 - col.a); + col.a = max(shadowA * _ShadowAlpha * d.vertexColor.a, col.a); + #endif + + //------------------------------------------------------- + + //GLOW_ON + #if GLOW_ON + half4 emission; + #if GLOWTEX_ON + emission = SAMPLE_TEXTURE2D(_GlowTex, sampler_GlowTex, d.texcoord0); + #else + emission = col; + #endif + + col.rgb *= _GlowGlobal; + emission.rgb *= emission.a * col.a * _Glow * _GlowColor; + col.rgb += emission.rgb; + #endif + //------------------------------------------------------- + + //COLORRAMP_ON && COLORRAMPOUTLINE_ON + #if COLORRAMP_ON && COLORRAMPOUTLINE_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + luminance = saturate(luminance + _ColorRampLuminosity); + #if GRADIENTCOLORRAMP_ON + col.rgb = lerp(col.rgb, SAMPLE_TEXTURE2D(_ColorRampTexGradient, sampler_ColorRampTexGradient, half2(luminance, 0)).rgb, _ColorRampBlend); + #else + col.rgb = lerp(col.rgb, SAMPLE_TEXTURE2D(_ColorRampTex, sampler_ColorRampTex, half2(luminance, 0)).rgb, _ColorRampBlend); + #endif + #endif + //--------------- + + //GREYSCALE_ON && GREYSCALEOUTLINE_ON + #if GREYSCALE_ON && GREYSCALEOUTLINE_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + luminance = saturate(luminance + _GreyscaleLuminosity); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _GreyscaleTintColor, _GreyscaleBlend); + #endif + + //----------------------------------- + + //POSTERIZE_ON && POSTERIZEOUTLINE_ON + #if POSTERIZE_ON && POSTERIZEOUTLINE_ON + col.rgb = pow(col.rgb, _PosterizeGamma) * _PosterizeNumColors; + col.rgb = floor(col.rgb) / _PosterizeNumColors; + col.rgb = pow(col.rgb, 1.0 / _PosterizeGamma); + #endif + + //----------------------------------- + + //SHINE_ON + #if SHINE_ON + half2 uvShine = uvRect; + half cosAngle = cos(_ShineRotate); + half sinAngle = sin(_ShineRotate); + half2x2 rot = half2x2(cosAngle, -sinAngle, sinAngle, cosAngle); + uvShine -= half2(0.5, 0.5); + uvShine = mul(rot, uvShine); + uvShine += half2(0.5, 0.5); + half shineMask = SAMPLE_TEXTURE2D(_ShineMask, sampler_ShineMask, d.texcoord0.xy).a; + half currentDistanceProjection = (uvShine.x + uvShine.y) / 2; + half whitePower = 1 - (abs(currentDistanceProjection - _ShineLocation) / _ShineWidth); + col.rgb += col.a * whitePower * _ShineGlow * max(sign(currentDistanceProjection - (_ShineLocation - _ShineWidth)), 0.0) + * max(sign((_ShineLocation + _ShineWidth) - currentDistanceProjection), 0.0) * _ShineColor * shineMask; + #endif + + //----------------------------------- + + //HOLOGRAM_ON + #if HOLOGRAM_ON + half totalHologram = _HologramStripesAmount + _HologramUnmodAmount; + half hologramYCoord = ((uvRect.y + (((_Time.x + randomSeed) % 1) * _HologramStripesSpeed)) % totalHologram) / totalHologram; + hologramYCoord = abs(hologramYCoord); + half alpha = RemapFloat(saturate(hologramYCoord - (_HologramUnmodAmount/totalHologram)), 0.0, 1.0, _HologramMinAlpha, saturate(_HologramMaxAlpha)); + half hologramMask = max(sign((_HologramUnmodAmount/totalHologram) - hologramYCoord), 0.0); + half4 hologramResult = col; + hologramResult.a *= lerp(alpha, 1, hologramMask); + hologramResult.rgb *= max(1, _HologramMaxAlpha * max(sign(hologramYCoord - (_HologramUnmodAmount/totalHologram)), 0.0)); + hologramMask = 1 - step(0.01,hologramMask); + hologramResult.rgb += hologramMask * _HologramStripeColor * col.a; + col = lerp(col, hologramResult, _HologramBlend); + #endif + + //----------------------------------- + + //FLICKER_ON + #if FLICKER_ON + col.a *= saturate(col.a * step(frac(0.05 + (_Time.w + randomSeed) * _FlickerFreq), 1 - _FlickerPercent) + _FlickerAlpha); + #endif + //----------------------------------- + + //ALPHACUTOFF_ON + + //ALPHAROUND_ON + + //ALPHAOUTLINE_ON + #if ALPHAOUTLINE_ON + half alphaOutlineRes = pow(1 - col.a, max(_AlphaOutlinePower, 0.0001)) * step(_AlphaOutlineMinAlpha, col.a) * _AlphaOutlineBlend; + col.rgb = lerp(col.rgb, _AlphaOutlineColor.rgb * _AlphaOutlineGlow, alphaOutlineRes); + col.a = lerp(col.a, 1, alphaOutlineRes > 1); + #endif + //------------------------------------------------------- + + //FOG_ON + + //------------------ + + col *= _Color; + o.Albedo = col; + col.a *= _Alpha; + clip(col.a - _AlphaCutoffValue - 0.01); + o.Alpha = _Color.a; + } + + + + + + void ChainSurfaceFunction(inout Surface l, inout ShaderData d) + { + Ext_SurfaceFunction0(l, d); + // Ext_SurfaceFunction1(l, d); + // Ext_SurfaceFunction2(l, d); + // Ext_SurfaceFunction3(l, d); + // Ext_SurfaceFunction4(l, d); + // Ext_SurfaceFunction5(l, d); + // Ext_SurfaceFunction6(l, d); + // Ext_SurfaceFunction7(l, d); + // Ext_SurfaceFunction8(l, d); + // Ext_SurfaceFunction9(l, d); + // Ext_SurfaceFunction10(l, d); + // Ext_SurfaceFunction11(l, d); + // Ext_SurfaceFunction12(l, d); + // Ext_SurfaceFunction13(l, d); + // Ext_SurfaceFunction14(l, d); + // Ext_SurfaceFunction15(l, d); + // Ext_SurfaceFunction16(l, d); + // Ext_SurfaceFunction17(l, d); + // Ext_SurfaceFunction18(l, d); + // Ext_SurfaceFunction19(l, d); + // Ext_SurfaceFunction20(l, d); + // Ext_SurfaceFunction21(l, d); + // Ext_SurfaceFunction22(l, d); + // Ext_SurfaceFunction23(l, d); + // Ext_SurfaceFunction24(l, d); + // Ext_SurfaceFunction25(l, d); + // Ext_SurfaceFunction26(l, d); + // Ext_SurfaceFunction27(l, d); + // Ext_SurfaceFunction28(l, d); + // Ext_SurfaceFunction29(l, d); + } + +#if !_DECALSHADER + + void ChainModifyVertex(inout VertexData v, inout VertexToPixel v2p, float4 time) + { + ExtraV2F d; + + ZERO_INITIALIZE(ExtraV2F, d); + ZERO_INITIALIZE(Blackboard, d.blackboard); + // due to motion vectors in HDRP, we need to use the last + // time in certain spots. So if you are going to use _Time to adjust vertices, + // you need to use this time or motion vectors will break. + d.time = time; + + Ext_ModifyVertex0(v, d); + // Ext_ModifyVertex1(v, d); + // Ext_ModifyVertex2(v, d); + // Ext_ModifyVertex3(v, d); + // Ext_ModifyVertex4(v, d); + // Ext_ModifyVertex5(v, d); + // Ext_ModifyVertex6(v, d); + // Ext_ModifyVertex7(v, d); + // Ext_ModifyVertex8(v, d); + // Ext_ModifyVertex9(v, d); + // Ext_ModifyVertex10(v, d); + // Ext_ModifyVertex11(v, d); + // Ext_ModifyVertex12(v, d); + // Ext_ModifyVertex13(v, d); + // Ext_ModifyVertex14(v, d); + // Ext_ModifyVertex15(v, d); + // Ext_ModifyVertex16(v, d); + // Ext_ModifyVertex17(v, d); + // Ext_ModifyVertex18(v, d); + // Ext_ModifyVertex19(v, d); + // Ext_ModifyVertex20(v, d); + // Ext_ModifyVertex21(v, d); + // Ext_ModifyVertex22(v, d); + // Ext_ModifyVertex23(v, d); + // Ext_ModifyVertex24(v, d); + // Ext_ModifyVertex25(v, d); + // Ext_ModifyVertex26(v, d); + // Ext_ModifyVertex27(v, d); + // Ext_ModifyVertex28(v, d); + // Ext_ModifyVertex29(v, d); + + + // #if %EXTRAV2F0REQUIREKEY% + // v2p.extraV2F0 = d.extraV2F0; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // v2p.extraV2F1 = d.extraV2F1; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // v2p.extraV2F2 = d.extraV2F2; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // v2p.extraV2F3 = d.extraV2F3; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // v2p.extraV2F4 = d.extraV2F4; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // v2p.extraV2F5 = d.extraV2F5; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // v2p.extraV2F6 = d.extraV2F6; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // v2p.extraV2F7 = d.extraV2F7; + // #endif + } + + void ChainModifyTessellatedVertex(inout VertexData v, inout VertexToPixel v2p) + { + ExtraV2F d; + ZERO_INITIALIZE(ExtraV2F, d); + ZERO_INITIALIZE(Blackboard, d.blackboard); + + // #if %EXTRAV2F0REQUIREKEY% + // d.extraV2F0 = v2p.extraV2F0; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // d.extraV2F1 = v2p.extraV2F1; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // d.extraV2F2 = v2p.extraV2F2; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // d.extraV2F3 = v2p.extraV2F3; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // d.extraV2F4 = v2p.extraV2F4; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // d.extraV2F5 = v2p.extraV2F5; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // d.extraV2F6 = v2p.extraV2F6; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // d.extraV2F7 = v2p.extraV2F7; + // #endif + + + // Ext_ModifyTessellatedVertex0(v, d); + // Ext_ModifyTessellatedVertex1(v, d); + // Ext_ModifyTessellatedVertex2(v, d); + // Ext_ModifyTessellatedVertex3(v, d); + // Ext_ModifyTessellatedVertex4(v, d); + // Ext_ModifyTessellatedVertex5(v, d); + // Ext_ModifyTessellatedVertex6(v, d); + // Ext_ModifyTessellatedVertex7(v, d); + // Ext_ModifyTessellatedVertex8(v, d); + // Ext_ModifyTessellatedVertex9(v, d); + // Ext_ModifyTessellatedVertex10(v, d); + // Ext_ModifyTessellatedVertex11(v, d); + // Ext_ModifyTessellatedVertex12(v, d); + // Ext_ModifyTessellatedVertex13(v, d); + // Ext_ModifyTessellatedVertex14(v, d); + // Ext_ModifyTessellatedVertex15(v, d); + // Ext_ModifyTessellatedVertex16(v, d); + // Ext_ModifyTessellatedVertex17(v, d); + // Ext_ModifyTessellatedVertex18(v, d); + // Ext_ModifyTessellatedVertex19(v, d); + // Ext_ModifyTessellatedVertex20(v, d); + // Ext_ModifyTessellatedVertex21(v, d); + // Ext_ModifyTessellatedVertex22(v, d); + // Ext_ModifyTessellatedVertex23(v, d); + // Ext_ModifyTessellatedVertex24(v, d); + // Ext_ModifyTessellatedVertex25(v, d); + // Ext_ModifyTessellatedVertex26(v, d); + // Ext_ModifyTessellatedVertex27(v, d); + // Ext_ModifyTessellatedVertex28(v, d); + // Ext_ModifyTessellatedVertex29(v, d); + + // #if %EXTRAV2F0REQUIREKEY% + // v2p.extraV2F0 = d.extraV2F0; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // v2p.extraV2F1 = d.extraV2F1; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // v2p.extraV2F2 = d.extraV2F2; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // v2p.extraV2F3 = d.extraV2F3; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // v2p.extraV2F4 = d.extraV2F4; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // v2p.extraV2F5 = d.extraV2F5; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // v2p.extraV2F6 = d.extraV2F6; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // v2p.extraV2F7 = d.extraV2F7; + // #endif + } + + void ChainFinalColorForward(inout Surface l, inout ShaderData d, inout half4 color) + { + // Ext_FinalColorForward0(l, d, color); + // Ext_FinalColorForward1(l, d, color); + // Ext_FinalColorForward2(l, d, color); + // Ext_FinalColorForward3(l, d, color); + // Ext_FinalColorForward4(l, d, color); + // Ext_FinalColorForward5(l, d, color); + // Ext_FinalColorForward6(l, d, color); + // Ext_FinalColorForward7(l, d, color); + // Ext_FinalColorForward8(l, d, color); + // Ext_FinalColorForward9(l, d, color); + // Ext_FinalColorForward10(l, d, color); + // Ext_FinalColorForward11(l, d, color); + // Ext_FinalColorForward12(l, d, color); + // Ext_FinalColorForward13(l, d, color); + // Ext_FinalColorForward14(l, d, color); + // Ext_FinalColorForward15(l, d, color); + // Ext_FinalColorForward16(l, d, color); + // Ext_FinalColorForward17(l, d, color); + // Ext_FinalColorForward18(l, d, color); + // Ext_FinalColorForward19(l, d, color); + // Ext_FinalColorForward20(l, d, color); + // Ext_FinalColorForward21(l, d, color); + // Ext_FinalColorForward22(l, d, color); + // Ext_FinalColorForward23(l, d, color); + // Ext_FinalColorForward24(l, d, color); + // Ext_FinalColorForward25(l, d, color); + // Ext_FinalColorForward26(l, d, color); + // Ext_FinalColorForward27(l, d, color); + // Ext_FinalColorForward28(l, d, color); + // Ext_FinalColorForward29(l, d, color); + } + + void ChainFinalGBufferStandard(inout Surface s, inout ShaderData d, inout half4 GBuffer0, inout half4 GBuffer1, inout half4 GBuffer2, inout half4 outEmission, inout half4 outShadowMask) + { + // Ext_FinalGBufferStandard0(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard1(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard2(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard3(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard4(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard5(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard6(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard7(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard8(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard9(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard10(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard11(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard12(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard13(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard14(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard15(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard16(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard17(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard18(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard19(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard20(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard21(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard22(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard23(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard24(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard25(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard26(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard27(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard28(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard29(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + } +#endif + + + + + +#if _DECALSHADER + + ShaderData CreateShaderData(SurfaceDescriptionInputs IN) + { + ShaderData d = (ShaderData)0; + d.TBNMatrix = float3x3(IN.WorldSpaceTangent, IN.WorldSpaceBiTangent, IN.WorldSpaceNormal); + d.worldSpaceNormal = IN.WorldSpaceNormal; + d.worldSpaceTangent = IN.WorldSpaceTangent; + + d.worldSpacePosition = IN.WorldSpacePosition; + d.texcoord0 = IN.uv0.xyxy; + d.screenPos = IN.ScreenPosition; + + d.worldSpaceViewDir = normalize(_WorldSpaceCameraPos - d.worldSpacePosition); + + d.tangentSpaceViewDir = mul(d.TBNMatrix, d.worldSpaceViewDir); + + // these rarely get used, so we back transform them. Usually will be stripped. + #if _HDRP + // d.localSpacePosition = mul(GetWorldToObjectMatrix(), float4(GetCameraRelativePositionWS(d.worldSpacePosition), 1)).xyz; + #else + // d.localSpacePosition = mul(GetWorldToObjectMatrix(), float4(d.worldSpacePosition, 1)).xyz; + #endif + // d.localSpaceNormal = normalize(mul((float3x3)GetWorldToObjectMatrix(), d.worldSpaceNormal)); + // d.localSpaceTangent = normalize(mul((float3x3)GetWorldToObjectMatrix(), d.worldSpaceTangent.xyz)); + + // #if %SCREENPOSREQUIREKEY% + // d.screenUV = (IN.ScreenPosition.xy / max(0.01, IN.ScreenPosition.w)); + // #endif + + return d; + } +#else + + ShaderData CreateShaderData(VertexToPixel i + #if NEED_FACING + , bool facing + #endif + ) + { + ShaderData d = (ShaderData)0; + d.clipPos = i.pos; + d.worldSpacePosition = i.worldPos; + + d.worldSpaceNormal = normalize(i.worldNormal); + d.worldSpaceTangent.xyz = normalize(i.worldTangent.xyz); + + d.tangentSign = i.worldTangent.w * unity_WorldTransformParams.w; + float3 bitangent = cross(d.worldSpaceTangent.xyz, d.worldSpaceNormal) * d.tangentSign; + + d.TBNMatrix = float3x3(d.worldSpaceTangent, -bitangent, d.worldSpaceNormal); + d.worldSpaceViewDir = normalize(_WorldSpaceCameraPos - i.worldPos); + + d.tangentSpaceViewDir = mul(d.TBNMatrix, d.worldSpaceViewDir); + d.texcoord0 = i.texcoord0; + d.texcoord1 = i.texcoord1; + d.texcoord2 = i.texcoord2; + + // #if %TEXCOORD3REQUIREKEY% + d.texcoord3 = i.texcoord3; + // #endif + + // d.isFrontFace = facing; + // #if %VERTEXCOLORREQUIREKEY% + d.vertexColor = i.vertexColor; + // #endif + + // these rarely get used, so we back transform them. Usually will be stripped. + #if _HDRP + // d.localSpacePosition = mul(GetWorldToObjectMatrix(), float4(GetCameraRelativePositionWS(i.worldPos), 1)).xyz; + #else + // d.localSpacePosition = mul(GetWorldToObjectMatrix(), float4(i.worldPos, 1)).xyz; + #endif + // d.localSpaceNormal = normalize(mul((float3x3)GetWorldToObjectMatrix(), i.worldNormal)); + // d.localSpaceTangent = normalize(mul((float3x3)GetWorldToObjectMatrix(), i.worldTangent.xyz)); + + // #if %SCREENPOSREQUIREKEY% + // d.screenPos = i.screenPos; + // d.screenUV = (i.screenPos.xy / i.screenPos.w); + // #endif + + + // #if %EXTRAV2F0REQUIREKEY% + // d.extraV2F0 = i.extraV2F0; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // d.extraV2F1 = i.extraV2F1; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // d.extraV2F2 = i.extraV2F2; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // d.extraV2F3 = i.extraV2F3; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // d.extraV2F4 = i.extraV2F4; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // d.extraV2F5 = i.extraV2F5; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // d.extraV2F6 = i.extraV2F6; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // d.extraV2F7 = i.extraV2F7; + // #endif + + return d; + } + +#endif + + + #if _PASSSHADOW + float3 _LightDirection; + #endif + + // vertex shader + VertexToPixel Vert (VertexData v) + { + + VertexToPixel o = (VertexToPixel)0; + + UNITY_SETUP_INSTANCE_ID(v); + UNITY_TRANSFER_INSTANCE_ID(v, o); + UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o); + + +#if !_TESSELLATION_ON + ChainModifyVertex(v, o, _Time); +#endif + + o.texcoord0 = v.texcoord0; + o.texcoord1 = v.texcoord1; + o.texcoord2 = v.texcoord2; + + // #if %TEXCOORD3REQUIREKEY% + o.texcoord3 = v.texcoord3; + // #endif + + // #if %VERTEXCOLORREQUIREKEY% + o.vertexColor = v.vertexColor; + // #endif + + VertexPositionInputs vertexInput = GetVertexPositionInputs(v.vertex.xyz); + o.worldPos = TransformObjectToWorld(v.vertex.xyz); + o.worldNormal = TransformObjectToWorldNormal(v.normal); + o.worldTangent = float4(TransformObjectToWorldDir(v.tangent.xyz), v.tangent.w); + + + #if _PASSSHADOW + // Define shadow pass specific clip position for Universal + o.pos = TransformWorldToHClip(ApplyShadowBias(o.worldPos, o.worldNormal, _LightDirection)); + #if UNITY_REVERSED_Z + o.pos.z = min(o.pos.z, o.pos.w * UNITY_NEAR_CLIP_VALUE); + #else + o.pos.z = max(o.pos.z, o.pos.w * UNITY_NEAR_CLIP_VALUE); + #endif + #elif _PASSMETA + o.pos = MetaVertexPosition(float4(v.vertex.xyz, 0), v.texcoord1.xy, v.texcoord2.xy, unity_LightmapST, unity_DynamicLightmapST); + #else + o.pos = TransformWorldToHClip(o.worldPos); + #endif + + + // #if %SCREENPOSREQUIREKEY% + // o.screenPos = ComputeScreenPos(o.pos, _ProjectionParams.x); + // #endif + + #if _PASSFORWARD || _PASSGBUFFER + float2 uv1 = v.texcoord1.xy; + OUTPUT_LIGHTMAP_UV(uv1, unity_LightmapST, o.lightmapUV); + o.texcoord1.xy = uv1; + OUTPUT_SH(o.worldNormal, o.sh); + #endif + + #ifdef VARYINGS_NEED_FOG_AND_VERTEX_LIGHT + #if _BAKEDLIT + half3 vertexLight = 0; + #else + half3 vertexLight = VertexLighting(o.worldPos, o.worldNormal); + #endif + half fogFactor = ComputeFogFactor(o.pos.z); + o.fogFactorAndVertexLight = half4(fogFactor, vertexLight); + #endif + + #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR) + o.shadowCoord = GetShadowCoord(vertexInput); + #endif + + return o; + } + + + + + // fragment shader + half4 Frag (VertexToPixel IN + #if NEED_FACING + , bool facing : SV_IsFrontFace + #endif + ) : SV_Target + { + UNITY_SETUP_INSTANCE_ID(IN); + + ShaderData d = CreateShaderData(IN + #if NEED_FACING + , facing + #endif + ); + + Surface l = (Surface)0; + + l.Albedo = half3(0.5, 0.5, 0.5); + l.Normal = float3(0,0,1); + l.Occlusion = 1; + l.Alpha = 1; + + ChainSurfaceFunction(l, d); + + MetaInput metaInput = (MetaInput)0; + metaInput.Albedo = l.Albedo; + metaInput.Emission = l.Emission; + + return MetaFragment(metaInput); + + } + + ENDHLSL + + } + + + + Pass + { + Name "DepthNormals" + Tags + { + "LightMode" = "DepthNormals" + } + + // Render State + Cull Back + Blend One Zero + ZTest LEqual + ZWrite On + + Tags { "RenderType" = "Opaque" "Queue" = "Geometry" "PreviewType" = "Plane" } + Cull [_CullingOption] + ZWrite [_ZWrite] + ZTest [_ZTestMode] + + + HLSLPROGRAM + + #pragma vertex Vert + #pragma fragment Frag + + #pragma target 3.0 + + #pragma prefer_hlslcc gles + #pragma exclude_renderers d3d11_9x + #pragma multi_compile_fog + #pragma multi_compile_instancing + #pragma multi_compile _ DOTS_INSTANCING_ON + + #define SHADERPASS SHADERPASS_DEPTHNORMALSONLY + #define _PASSDEPTH 1 + #define _PASSDEPTHNORMALS 1 + + + + #pragma shader_feature_local GLOW_ON + #pragma shader_feature_local FADE_ON + #pragma shader_feature_local OUTBASE_ON + #pragma shader_feature_local ONLYOUTLINE_ON + #pragma shader_feature_local GRADIENT_ON + #pragma shader_feature_local GRADIENT2COL_ON + #pragma shader_feature_local RADIALGRADIENT_ON + #pragma shader_feature_local COLORSWAP_ON + #pragma shader_feature_local HSV_ON + #pragma shader_feature_local CHANGECOLOR_ON + #pragma shader_feature_local CHANGECOLOR2_ON + #pragma shader_feature_local CHANGECOLOR3_ON + #pragma shader_feature_local COLORRAMP_ON + #pragma shader_feature_local GRADIENTCOLORRAMP_ON + #pragma shader_feature_local HITEFFECT_ON + #pragma shader_feature_local NEGATIVE_ON + #pragma shader_feature_local PIXELATE_ON + #pragma shader_feature_local GREYSCALE_ON + #pragma shader_feature_local POSTERIZE_ON + #pragma shader_feature_local BLUR_ON + #pragma shader_feature_local MOTIONBLUR_ON + #pragma shader_feature_local GHOST_ON + #pragma shader_feature_local ALPHAOUTLINE_ON + #pragma shader_feature_local INNEROUTLINE_ON + #pragma shader_feature_local ONLYINNEROUTLINE_ON + #pragma shader_feature_local HOLOGRAM_ON + #pragma shader_feature_local CHROMABERR_ON + #pragma shader_feature_local GLITCH_ON + #pragma shader_feature_local FLICKER_ON + #pragma shader_feature_local SHADOW_ON + #pragma shader_feature_local SHINE_ON + #pragma shader_feature_local CONTRAST_ON + #pragma shader_feature_local OVERLAY_ON + #pragma shader_feature_local OVERLAYMULT_ON + #pragma shader_feature_local DOODLE_ON + #pragma shader_feature_local WIND_ON + #pragma shader_feature_local WAVEUV_ON + #pragma shader_feature_local ROUNDWAVEUV_ON + #pragma shader_feature_local RECTSIZE_ON + #pragma shader_feature_local OFFSETUV_ON + #pragma shader_feature_local CLIPPING_ON + #pragma shader_feature_local RADIALCLIPPING_ON + #pragma shader_feature_local TEXTURESCROLL_ON + #pragma shader_feature_local ZOOMUV_ON + #pragma shader_feature_local DISTORT_ON + #pragma shader_feature_local WARP_ON + #pragma shader_feature_local TWISTUV_ON + #pragma shader_feature_local ROTATEUV_ON + #pragma shader_feature_local POLARUV_ON + #pragma shader_feature_local FISHEYE_ON + #pragma shader_feature_local PINCH_ON + #pragma shader_feature_local SHAKEUV_ON + + #pragma shader_feature_local GLOWTEX_ON + #pragma shader_feature_local OUTTEX_ON + #pragma shader_feature_local OUTDIST_ON + #pragma shader_feature_local OUTBASE8DIR_ON + #pragma shader_feature_local OUTBASEPIXELPERF_ON + #pragma shader_feature_local COLORRAMPOUTLINE_ON + #pragma shader_feature_local GREYSCALEOUTLINE_ON + #pragma shader_feature_local POSTERIZEOUTLINE_ON + #pragma shader_feature_local BLURISHD_ON + #pragma shader_feature_local MANUALWIND_ON + #pragma shader_feature_local ATLAS_ON + #pragma shader_feature_local PREMULTIPLYALPHA_ON + + #pragma shader_feature BILBOARD_ON + #pragma shader_feature BILBOARDY_ON + + #pragma shader_feature NORMALMAP_ON + + + #define _URP 1 +#define _USINGTEXCOORD1 1 +#define _USINGTEXCOORD2 1 + + + // this has to be here or specular color will be ignored. Not in SG code + #if _SIMPLELIT + #define _SPECULAR_COLOR + #endif + + + // Includes + #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Version.hlsl" + #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Color.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.shadergraph/ShaderGraphLibrary/ShaderVariablesFunctions.hlsl" + + + + + #undef WorldNormalVector + #define WorldNormalVector(data, normal) mul(normal, data.TBNMatrix) + + #define UnityObjectToWorldNormal(normal) mul(GetObjectToWorldMatrix(), normal) + + #define _WorldSpaceLightPos0 _MainLightPosition + + #define UNITY_DECLARE_TEX2D(name) TEXTURE2D(name); SAMPLER(sampler##name); + #define UNITY_DECLARE_TEX2D_NOSAMPLER(name) TEXTURE2D(name); + #define UNITY_DECLARE_TEX2DARRAY(name) TEXTURE2D_ARRAY(name); SAMPLER(sampler##name); + #define UNITY_DECLARE_TEX2DARRAY_NOSAMPLER(name) TEXTURE2D_ARRAY(name); + + #define UNITY_SAMPLE_TEX2DARRAY(tex,coord) SAMPLE_TEXTURE2D_ARRAY(tex, sampler##tex, coord.xy, coord.z) + #define UNITY_SAMPLE_TEX2DARRAY_LOD(tex,coord,lod) SAMPLE_TEXTURE2D_ARRAY_LOD(tex, sampler##tex, coord.xy, coord.z, lod) + #define UNITY_SAMPLE_TEX2D(tex, coord) SAMPLE_TEXTURE2D(tex, sampler##tex, coord) + #define UNITY_SAMPLE_TEX2D_SAMPLER(tex, samp, coord) SAMPLE_TEXTURE2D(tex, sampler##samp, coord) + + #define UNITY_SAMPLE_TEX2D_LOD(tex,coord, lod) SAMPLE_TEXTURE2D_LOD(tex, sampler_##tex, coord, lod) + #define UNITY_SAMPLE_TEX2D_SAMPLER_LOD(tex,samplertex,coord, lod) SAMPLE_TEXTURE2D_LOD (tex, sampler##samplertex,coord, lod) + + #if defined(UNITY_COMPILER_HLSL) + #define UNITY_INITIALIZE_OUTPUT(type,name) name = (type)0; + #else + #define UNITY_INITIALIZE_OUTPUT(type,name) + #endif + + #define sampler2D_float sampler2D + #define sampler2D_half sampler2D + + + + // data across stages, stripped like the above. + struct VertexToPixel + { + float4 pos : SV_POSITION; + float3 worldPos : TEXCOORD0; + float3 worldNormal : TEXCOORD1; + float4 worldTangent : TEXCOORD2; + float4 texcoord0 : TEXCOORD3; + float4 texcoord1 : TEXCOORD4; + float4 texcoord2 : TEXCOORD5; + + // #if %TEXCOORD3REQUIREKEY% + float4 texcoord3 : TEXCOORD6; + // #endif + + // #if %SCREENPOSREQUIREKEY% + // float4 screenPos : TEXCOORD7; + // #endif + + // #if %VERTEXCOLORREQUIREKEY% + half4 vertexColor : COLOR; + // #endif + + // #if %EXTRAV2F0REQUIREKEY% + // float4 extraV2F0 : TEXCOORD12; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // float4 extraV2F1 : TEXCOORD13; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // float4 extraV2F2 : TEXCOORD14; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // float4 extraV2F3 : TEXCOORD15; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // float4 extraV2F4 : TEXCOORD16; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // float4 extraV2F5 : TEXCOORD17; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // float4 extraV2F6 : TEXCOORD18; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // float4 extraV2F7 : TEXCOORD19; + // #endif + + #if defined(LIGHTMAP_ON) + float2 lightmapUV : TEXCOORD8; + #endif + #if !defined(LIGHTMAP_ON) + float3 sh : TEXCOORD9; + #endif + + #ifdef VARYINGS_NEED_FOG_AND_VERTEX_LIGHT + float4 fogFactorAndVertexLight : TEXCOORD10; + #endif + + #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR) + float4 shadowCoord : TEXCOORD11; + #endif + + #if UNITY_ANY_INSTANCING_ENABLED + uint instanceID : CUSTOM_INSTANCE_ID; + #endif + #if (defined(UNITY_STEREO_INSTANCING_ENABLED)) + uint stereoTargetEyeIndexAsRTArrayIdx : SV_RenderTargetArrayIndex; + #endif + #if (defined(UNITY_STEREO_MULTIVIEW_ENABLED)) || (defined(UNITY_STEREO_INSTANCING_ENABLED) && (defined(SHADER_API_GLES3) || defined(SHADER_API_GLCORE))) + uint stereoTargetEyeIndexAsBlendIdx0 : BLENDINDICES0; + #endif + #if defined(SHADER_STAGE_FRAGMENT) && defined(VARYINGS_NEED_CULLFACE) + FRONT_FACE_TYPE cullFace : FRONT_FACE_SEMANTIC; + #endif + }; + + + + + // data describing the user output of a pixel + struct Surface + { + half3 Albedo; + half Height; + half3 Normal; + half Smoothness; + half3 Emission; + half Metallic; + half3 Specular; + half Occlusion; + half SpecularPower; // for simple lighting + half Alpha; + float outputDepth; // if written, SV_Depth semantic is used. ShaderData.clipPos.z is unused value + // HDRP Only + half SpecularOcclusion; + half SubsurfaceMask; + half Thickness; + half CoatMask; + half CoatSmoothness; + half Anisotropy; + half IridescenceMask; + half IridescenceThickness; + int DiffusionProfileHash; + float SpecularAAThreshold; + float SpecularAAScreenSpaceVariance; + // requires _OVERRIDE_BAKEDGI to be defined, but is mapped in all pipelines + float3 DiffuseGI; + float3 BackDiffuseGI; + float3 SpecularGI; + float ior; + float3 transmittanceColor; + float atDistance; + float transmittanceMask; + // requires _OVERRIDE_SHADOWMASK to be defines + float4 ShadowMask; + + // for decals + float NormalAlpha; + float MAOSAlpha; + + + }; + + // Data the user declares in blackboard blocks + struct Blackboard + { + + float blackboardDummyData; + }; + + // data the user might need, this will grow to be big. But easy to strip + struct ShaderData + { + float4 clipPos; // SV_POSITION + float3 localSpacePosition; + float3 localSpaceNormal; + float3 localSpaceTangent; + + float3 worldSpacePosition; + float3 worldSpaceNormal; + float3 worldSpaceTangent; + float tangentSign; + + float3 worldSpaceViewDir; + float3 tangentSpaceViewDir; + + float4 texcoord0; + float4 texcoord1; + float4 texcoord2; + float4 texcoord3; + + float2 screenUV; + float4 screenPos; + + float4 vertexColor; + bool isFrontFace; + + float4 extraV2F0; + float4 extraV2F1; + float4 extraV2F2; + float4 extraV2F3; + float4 extraV2F4; + float4 extraV2F5; + float4 extraV2F6; + float4 extraV2F7; + + float3x3 TBNMatrix; + Blackboard blackboard; + }; + + struct VertexData + { + #if SHADER_TARGET > 30 + // uint vertexID : SV_VertexID; + #endif + float4 vertex : POSITION; + float3 normal : NORMAL; + float4 tangent : TANGENT; + float4 texcoord0 : TEXCOORD0; + + // optimize out mesh coords when not in use by user or lighting system + #if _URP && (_USINGTEXCOORD1 || _PASSMETA || _PASSFORWARD || _PASSGBUFFER) + float4 texcoord1 : TEXCOORD1; + #endif + + #if _URP && (_USINGTEXCOORD2 || _PASSMETA || ((_PASSFORWARD || _PASSGBUFFER) && defined(DYNAMICLIGHTMAP_ON))) + float4 texcoord2 : TEXCOORD2; + #endif + + #if _STANDARD && (_USINGTEXCOORD1 || (_PASSMETA || ((_PASSFORWARD || _PASSGBUFFER || _PASSFORWARDADD) && LIGHTMAP_ON))) + float4 texcoord1 : TEXCOORD1; + #endif + #if _STANDARD && (_USINGTEXCOORD2 || (_PASSMETA || ((_PASSFORWARD || _PASSGBUFFER) && DYNAMICLIGHTMAP_ON))) + float4 texcoord2 : TEXCOORD2; + #endif + + + #if _HDRP + float4 texcoord1 : TEXCOORD1; + float4 texcoord2 : TEXCOORD2; + #endif + + // #if %TEXCOORD3REQUIREKEY% + float4 texcoord3 : TEXCOORD3; + // #endif + + // #if %VERTEXCOLORREQUIREKEY% + float4 vertexColor : COLOR; + // #endif + + #if _PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR)) + float3 previousPositionOS : TEXCOORD4; // Contain previous transform position (in case of skinning for example) + #if defined (_ADD_PRECOMPUTED_VELOCITY) + float3 precomputedVelocity : TEXCOORD5; // Add Precomputed Velocity (Alembic computes velocities on runtime side). + #endif + #endif + + UNITY_VERTEX_INPUT_INSTANCE_ID + }; + + struct TessVertex + { + float4 vertex : INTERNALTESSPOS; + float3 normal : NORMAL; + float4 tangent : TANGENT; + float4 texcoord0 : TEXCOORD0; + float4 texcoord1 : TEXCOORD1; + float4 texcoord2 : TEXCOORD2; + + // #if %TEXCOORD3REQUIREKEY% + float4 texcoord3 : TEXCOORD3; + // #endif + + // #if %VERTEXCOLORREQUIREKEY% + float4 vertexColor : COLOR; + // #endif + + // #if %EXTRAV2F0REQUIREKEY% + // float4 extraV2F0 : TEXCOORD5; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // float4 extraV2F1 : TEXCOORD6; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // float4 extraV2F2 : TEXCOORD7; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // float4 extraV2F3 : TEXCOORD8; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // float4 extraV2F4 : TEXCOORD9; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // float4 extraV2F5 : TEXCOORD10; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // float4 extraV2F6 : TEXCOORD11; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // float4 extraV2F7 : TEXCOORD12; + // #endif + + #if _PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR)) + float3 previousPositionOS : TEXCOORD13; // Contain previous transform position (in case of skinning for example) + #if defined (_ADD_PRECOMPUTED_VELOCITY) + float3 precomputedVelocity : TEXCOORD14; + #endif + #endif + + UNITY_VERTEX_INPUT_INSTANCE_ID + UNITY_VERTEX_OUTPUT_STEREO + }; + + struct ExtraV2F + { + float4 extraV2F0; + float4 extraV2F1; + float4 extraV2F2; + float4 extraV2F3; + float4 extraV2F4; + float4 extraV2F5; + float4 extraV2F6; + float4 extraV2F7; + Blackboard blackboard; + float4 time; + }; + + + float3 WorldToTangentSpace(ShaderData d, float3 normal) + { + return mul(d.TBNMatrix, normal); + } + + float3 TangentToWorldSpace(ShaderData d, float3 normal) + { + return mul(normal, d.TBNMatrix); + } + + // in this case, make standard more like SRPs, because we can't fix + // unity_WorldToObject in HDRP, since it already does macro-fu there + + #if _STANDARD + float3 TransformWorldToObject(float3 p) { return mul(unity_WorldToObject, float4(p, 1)); }; + float3 TransformObjectToWorld(float3 p) { return mul(unity_ObjectToWorld, float4(p, 1)); }; + float4 TransformWorldToObject(float4 p) { return mul(unity_WorldToObject, p); }; + float4 TransformObjectToWorld(float4 p) { return mul(unity_ObjectToWorld, p); }; + float4x4 GetWorldToObjectMatrix() { return unity_WorldToObject; } + float4x4 GetObjectToWorldMatrix() { return unity_ObjectToWorld; } + #if (defined(SHADER_API_D3D11) || defined(SHADER_API_XBOXONE) || defined(UNITY_COMPILER_HLSLCC) || defined(SHADER_API_PSSL) || (SHADER_TARGET_SURFACE_ANALYSIS && !SHADER_TARGET_SURFACE_ANALYSIS_MOJOSHADER)) + #define UNITY_SAMPLE_TEX2D_LOD(tex,coord, lod) tex.SampleLevel (sampler##tex,coord, lod) + #define UNITY_SAMPLE_TEX2D_SAMPLER_LOD(tex,samplertex,coord, lod) tex.SampleLevel (sampler##samplertex,coord, lod) + #else + #define UNITY_SAMPLE_TEX2D_LOD(tex,coord,lod) tex2D (tex,coord,0,lod) + #define UNITY_SAMPLE_TEX2D_SAMPLER_LOD(tex,samplertex,coord,lod) tex2D (tex,coord,0,lod) + #endif + + #undef GetWorldToObjectMatrix() + + #define GetWorldToObjectMatrix() unity_WorldToObject + + + #endif + + float3 GetCameraWorldPosition() + { + #if _HDRP + return GetCameraRelativePositionWS(_WorldSpaceCameraPos); + #else + return _WorldSpaceCameraPos; + #endif + } + + #if _GRABPASSUSED + #if _STANDARD + TEXTURE2D(%GRABTEXTURE%); + SAMPLER(sampler_%GRABTEXTURE%); + #endif + + half3 GetSceneColor(float2 uv) + { + #if _STANDARD + return SAMPLE_TEXTURE2D(%GRABTEXTURE%, sampler_%GRABTEXTURE%, uv).rgb; + #else + return SHADERGRAPH_SAMPLE_SCENE_COLOR(uv); + #endif + } + #endif + + + + #if _STANDARD + UNITY_DECLARE_DEPTH_TEXTURE(_CameraDepthTexture); + float GetSceneDepth(float2 uv) { return SAMPLE_DEPTH_TEXTURE(_CameraDepthTexture, uv); } + float GetLinear01Depth(float2 uv) { return Linear01Depth(GetSceneDepth(uv)); } + float GetLinearEyeDepth(float2 uv) { return LinearEyeDepth(GetSceneDepth(uv)); } + #else + float GetSceneDepth(float2 uv) { return SHADERGRAPH_SAMPLE_SCENE_DEPTH(uv); } + float GetLinear01Depth(float2 uv) { return Linear01Depth(GetSceneDepth(uv), _ZBufferParams); } + float GetLinearEyeDepth(float2 uv) { return LinearEyeDepth(GetSceneDepth(uv), _ZBufferParams); } + #endif + + float3 GetWorldPositionFromDepthBuffer(float2 uv, float3 worldSpaceViewDir) + { + float eye = GetLinearEyeDepth(uv); + float3 camView = mul((float3x3)GetObjectToWorldMatrix(), transpose(mul(GetWorldToObjectMatrix(), UNITY_MATRIX_I_V)) [2].xyz); + + float dt = dot(worldSpaceViewDir, camView); + float3 div = worldSpaceViewDir/dt; + float3 wpos = (eye * div) + GetCameraWorldPosition(); + return wpos; + } + + #if _HDRP + float3 ObjectToWorldSpacePosition(float3 pos) + { + return GetAbsolutePositionWS(TransformObjectToWorld(pos)); + } + #else + float3 ObjectToWorldSpacePosition(float3 pos) + { + return TransformObjectToWorld(pos); + } + #endif + + #if _STANDARD + UNITY_DECLARE_SCREENSPACE_TEXTURE(_CameraDepthNormalsTexture); + float3 GetSceneNormal(float2 uv, float3 worldSpaceViewDir) + { + float4 depthNorms = UNITY_SAMPLE_SCREENSPACE_TEXTURE(_CameraDepthNormalsTexture, uv); + float3 norms = DecodeViewNormalStereo(depthNorms); + norms = mul((float3x3)GetWorldToViewMatrix(), norms) * 0.5 + 0.5; + return norms; + } + #elif _HDRP && !_DECALSHADER + + float3 GetSceneNormal(float2 uv, float3 worldSpaceViewDir) + { + NormalData nd; + DecodeFromNormalBuffer(_ScreenSize.xy * uv, nd); + return nd.normalWS; + } + #elif _URP + #if (SHADER_LIBRARY_VERSION_MAJOR >= 10) + #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/DeclareNormalsTexture.hlsl" + #endif + + float3 GetSceneNormal(float2 uv, float3 worldSpaceViewDir) + { + #if (SHADER_LIBRARY_VERSION_MAJOR >= 10) + return SampleSceneNormals(uv); + #else + float3 wpos = GetWorldPositionFromDepthBuffer(uv, worldSpaceViewDir); + return normalize(-cross(ddx(wpos), ddy(wpos))) * 0.5 + 0.5; + #endif + + } + #endif + + #if _HDRP + + half3 UnpackNormalmapRGorAG(half4 packednormal) + { + // This do the trick + packednormal.x *= packednormal.w; + + half3 normal; + normal.xy = packednormal.xy * 2 - 1; + normal.z = sqrt(1 - saturate(dot(normal.xy, normal.xy))); + return normal; + } + half3 UnpackNormal(half4 packednormal) + { + #if defined(UNITY_NO_DXT5nm) + return packednormal.xyz * 2 - 1; + #else + return UnpackNormalmapRGorAG(packednormal); + #endif + } + #endif + #if _HDRP || _URP + + half3 UnpackScaleNormal(half4 packednormal, half scale) + { + #ifndef UNITY_NO_DXT5nm + // Unpack normal as DXT5nm (1, y, 1, x) or BC5 (x, y, 0, 1) + // Note neutral texture like "bump" is (0, 0, 1, 1) to work with both plain RGB normal and DXT5nm/BC5 + packednormal.x *= packednormal.w; + #endif + half3 normal; + normal.xy = (packednormal.xy * 2 - 1) * scale; + normal.z = sqrt(1 - saturate(dot(normal.xy, normal.xy))); + return normal; + } + + #endif + + + void GetSun(out float3 lightDir, out float3 color) + { + lightDir = float3(0.5, 0.5, 0); + color = 1; + #if _HDRP + if (_DirectionalLightCount > 0) + { + DirectionalLightData light = _DirectionalLightDatas[0]; + lightDir = -light.forward.xyz; + color = light.color; + } + #elif _STANDARD + lightDir = normalize(_WorldSpaceLightPos0.xyz); + color = _LightColor0.rgb; + #elif _URP + Light light = GetMainLight(); + lightDir = light.direction; + color = light.color; + #endif + } + + + + CBUFFER_START(UnityPerMaterial) + + + half4 _Color; + half4 _MainTex_ST, _MainTex_TexelSize; + half _Alpha, _AlphaCutoffValue; + + #if ATLAS_ON + half _MinXUV, _MaxXUV, _MinYUV, _MaxYUV; + #endif + + #if GLOW_ON + half4 _GlowColor; + half _Glow, _GlowGlobal; + #endif + + #if HSV_ON + half _HsvShift, _HsvSaturation, _HsvBright; + #endif + + #if DISTORT_ON + half4 _DistortTex_ST; + half _DistortTexXSpeed, _DistortTexYSpeed, _DistortAmount; + #endif + + #if FADE_ON + half4 _FadeBurnColor, _FadeTex_ST, _FadeBurnTex_ST; + half _FadeAmount, _FadeBurnWidth, _FadeBurnTransition,_FadeBurnGlow; + #endif + + #if OUTBASE_ON + half4 _OutlineColor; + half _OutlineAlpha, _OutlineGlow, _OutlineWidth; + int _OutlinePixelWidth; + #endif + + #if OUTTEX_ON + half4 _OutlineTex_ST; + half _OutlineTexXSpeed, _OutlineTexYSpeed; + #endif + + #if OUTDIST_ON + half4 _OutlineDistortTex_ST; + half _OutlineDistortTexXSpeed, _OutlineDistortTexYSpeed, _OutlineDistortAmount; + #endif + + #if ALPHAOUTLINE_ON + half _AlphaOutlineGlow, _AlphaOutlinePower, _AlphaOutlineMinAlpha, _AlphaOutlineBlend; + half4 _AlphaOutlineColor; + #endif + + #if INNEROUTLINE_ON + half _InnerOutlineThickness, _InnerOutlineAlpha, _InnerOutlineGlow; + half4 _InnerOutlineColor; + #endif + + #if GRADIENT_ON + half _GradBlend, _GradBoostX, _GradBoostY; + half4 _GradTopRightCol, _GradTopLeftCol, _GradBotRightCol, _GradBotLeftCol; + #endif + + #if COLORSWAP_ON + half4 _ColorSwapRed, _ColorSwapGreen, _ColorSwapBlue; + half _ColorSwapRedLuminosity, _ColorSwapGreenLuminosity, _ColorSwapBlueLuminosity, _ColorSwapBlend; + #endif + + #if CHANGECOLOR_ON + half4 _ColorChangeNewCol, _ColorChangeTarget; + half _ColorChangeTolerance, _ColorChangeLuminosity; + #endif + #if CHANGECOLOR2_ON + half4 _ColorChangeNewCol2, _ColorChangeTarget2; + half _ColorChangeTolerance2; + #endif + #if CHANGECOLOR3_ON + half4 _ColorChangeNewCol3, _ColorChangeTarget3; + half _ColorChangeTolerance3; + #endif + + #if COLORRAMP_ON + half _ColorRampLuminosity, _ColorRampBlend; + #endif + + #if HITEFFECT_ON + half4 _HitEffectColor; + half _HitEffectGlow, _HitEffectBlend; + #endif + + #if NEGATIVE_ON + half _NegativeAmount; + #endif + + #if PIXELATE_ON + half _PixelateSize; + #endif + + #if GREYSCALE_ON + half _GreyscaleLuminosity, _GreyscaleBlend; + half4 _GreyscaleTintColor; + #endif + + #if POSTERIZE_ON + half _PosterizeNumColors, _PosterizeGamma; + #endif + + #if BLUR_ON + half _BlurIntensity; + #endif + + #if MOTIONBLUR_ON + half _MotionBlurAngle, _MotionBlurDist; + #endif + + #if GHOST_ON + half _GhostColorBoost, _GhostTransparency, _GhostBlend; + #endif + + #if HOLOGRAM_ON + half _HologramStripesAmount, _HologramMinAlpha, _HologramUnmodAmount, _HologramStripesSpeed, _HologramMaxAlpha, _HologramBlend; + half4 _HologramStripeColor; + #endif + + #if CHROMABERR_ON + half _ChromAberrAmount, _ChromAberrAlpha; + #endif + + #if GLITCH_ON + half _GlitchAmount, _GlitchSize; + #endif + + #if FLICKER_ON + half _FlickerFreq, _FlickerPercent, _FlickerAlpha; + #endif + + #if SHADOW_ON + half _ShadowX, _ShadowY, _ShadowAlpha; + half4 _ShadowColor; + #endif + + #if SHINE_ON + half4 _ShineColor; + half _ShineLocation, _ShineRotate, _ShineWidth, _ShineGlow; + #endif + + #if CONTRAST_ON + half _Contrast, _Brightness; + #endif + + #if OVERLAY_ON + half4 _OverlayTex_ST, _OverlayColor; + half _OverlayGlow, _OverlayBlend, _OverlayTextureScrollXSpeed, _OverlayTextureScrollYSpeed; + #endif + + #if DOODLE_ON + half _HandDrawnAmount, _HandDrawnSpeed; + #endif + + #if WIND_ON + half _GrassSpeed, _GrassWind, _GrassManualAnim, _GrassRadialBend; + #endif + + #if WAVEUV_ON + float _WaveAmount, _WaveSpeed, _WaveStrength, _WaveX, _WaveY; + #endif + + #if ROUNDWAVEUV_ON + half _RoundWaveStrength, _RoundWaveSpeed; + #endif + + #if RECTSIZE_ON + half _RectSize; + #endif + + #if OFFSETUV_ON + half _OffsetUvX, _OffsetUvY; + #endif + + #if CLIPPING_ON + half _ClipUvLeft, _ClipUvRight, _ClipUvUp, _ClipUvDown; + #endif + + #if RADIALCLIPPING_ON + half _RadialStartAngle, _RadialClip, _RadialClip2; + #endif + + #if TEXTURESCROLL_ON + half _TextureScrollXSpeed, _TextureScrollYSpeed; + #endif + + #if ZOOMUV_ON + half _ZoomUvAmount; + #endif + + #if WARP_ON + half _WarpStrength, _WarpSpeed, _WarpScale; + #endif + + #if TWISTUV_ON + half _TwistUvAmount, _TwistUvPosX, _TwistUvPosY, _TwistUvRadius; + #endif + + #if ROTATEUV_ON + half _RotateUvAmount; + #endif + + #if FISHEYE_ON + half _FishEyeUvAmount; + #endif + + #if PINCH_ON + half _PinchUvAmount; + #endif + + #if SHAKEUV_ON + half _ShakeUvSpeed, _ShakeUvX, _ShakeUvY; + #endif + + #if NORMALMAP_ON + half _NormalStrength; + #endif + + float _RandomSeed; + + + + + CBUFFER_END + + + + + + + + TEXTURE2D(_MainTex); + SAMPLER(sampler_MainTex); + + #if GLOW_ON + TEXTURE2D(_GlowTex); + SAMPLER(sampler_GlowTex); + #endif + + #if FADE_ON + TEXTURE2D(_FadeTex); + SAMPLER(sampler_FadeTex); + + TEXTURE2D(_FadeBurnTex); + SAMPLER(sampler_FadeBurnTex); + #endif + + #if DISTORT_ON + TEXTURE2D(_DistortTex); + SAMPLER(sampler_DistortTex); + #endif + + #if OUTTEX_ON + TEXTURE2D(_OutlineTex); + SAMPLER(sampler_OutlineTex); + #endif + + #if OUTDIST_ON + TEXTURE2D(_OutlineDistortTex); + SAMPLER(sampler_OutlineDistortTex); + #endif + + #if COLORSWAP_ON + TEXTURE2D(_ColorSwapTex); + SAMPLER(sampler_ColorSwapTex); + #endif + + #if COLORRAMP_ON + TEXTURE2D(_ColorRampTex); + TEXTURE2D(_ColorRampTexGradient); + SAMPLER(sampler_ColorRampTex); + SAMPLER(sampler_ColorRampTexGradient); + #endif + + #if SHINE_ON + TEXTURE2D(_ShineMask); + SAMPLER(sampler_ShineMask); + #endif + + #if OVERLAY_ON + TEXTURE2D(_OverlayTex); + SAMPLER(sampler_OverlayTex); + #endif + + #if NORMALMAP_ON + TEXTURE2D(_NormalMap); + SAMPLER(sampler_NormalMap); + #endif + + + half3 GetPixel(in int offsetX, in int offsetY, in half2 uv, in Texture2D _tex, in SamplerState _sampler) + { + half2 _uv = uv + half2(offsetX * _MainTex_TexelSize.x, offsetY * _MainTex_TexelSize.y); + half4 col = SAMPLE_TEXTURE2D(_tex, _sampler, _uv); + return col.rgb; + } + + + //BLURS------------------------------------------------------------------------- + half4 Blur(half2 uv, Texture2D source, SamplerState sampler_source, half Intensity) + { + const half2 texelSize = 1.0 / _ScreenParams.xy; + const half4 color = SAMPLE_TEXTURE2D(source, sampler_source, uv); + const half2 offset = Intensity * texelSize; + + half4 accumulatedColor = color; + half accumulatedWeight = 1.0; + for (int x = -1; x <= 1; x++) + { + for (int y = -1; y <= 1; y++) + { + const half2 sampleUV = uv + half2(x, y) * offset; + const half4 sampleColor = SAMPLE_TEXTURE2D(source, sampler_source, sampleUV); + + accumulatedColor += sampleColor; + accumulatedWeight += 1.0; + } + } + + half4 blurredColor = accumulatedColor / accumulatedWeight; + return blurredColor; + } + + half BlurHD_G(half bhqp, half x) + { + return exp(-(x * x) / (2.0 * bhqp * bhqp)); + } + half4 BlurHD(half2 uv, Texture2D source, SamplerState sampler_source, half BlurAmount, half xScale, half yScale) + { + int iterations = 16; + int halfIterations = iterations / 2; + half sigmaX = 0.1 + BlurAmount * 0.5; + half sigmaY = sigmaX; + half total = 0.0; + half4 ret = half4(0, 0, 0, 0); + for (int iy = 0; iy < iterations; ++iy) + { + half fy = BlurHD_G(sigmaY, half(iy) -half(halfIterations)); + half offsetY = half(iy - halfIterations) * 0.00390625 * xScale; + for (int ix = 0; ix < iterations; ++ix) + { + half fx = BlurHD_G(sigmaX, half(ix) - half(halfIterations)); + half offsetX = half(ix - halfIterations) * 0.00390625 * yScale; + total += fx * fy; + ret += SAMPLE_TEXTURE2D(source, sampler_source, uv + half2(offsetX, offsetY)) * fx * fy; + } + } + return ret / total; + } + //----------------------------------------------------------------------- + + + //------------------------------------------- + half RemapFloat(half inValue, half inMin, half inMax, half outMin, half outMax){ + return outMin + (inValue - inMin) * (outMax - outMin) / (inMax - inMin); + } + //------------------------------------------- + + //----------------------------------------------------------------------- + half rand(half2 seed, half offset) { + return (frac(sin(dot(seed, half2(12.9898, 78.233))) * 43758.5453) + offset) % 1.0; + } + + half rand2(half2 seed, half offset) { + return (frac(sin(dot(seed * floor(50 + (_Time.x % 1.0) * 12.), half2(127.1, 311.7))) * 43758.5453123) + offset) % 1.0; + } + + half rand2CustomTime(half2 seed, half offset, half customTime) { + return (frac(sin(dot(seed * floor(50 + (customTime % 1.0) * 12.), half2(127.1, 311.7))) * 43758.5453123) + offset) % 1.0; + } + //----------------------------------------------------------------------- + + + void Ext_ModifyVertex0 (inout VertexData v, inout ExtraV2F d) + { + //BILBOARD_ON + #if BILBOARD_ON + half3 camRight = mul((half3x3)unity_CameraToWorld, half3(1,0,0)); + half3 camUp = half3(0,1,0); + #if BILBOARDY_ON + camUp = mul((half3x3)unity_CameraToWorld, half3(0,1,0)); + #endif + half3 localPos = v.vertex.x * camRight + v.vertex.y * camUp; + v.vertex = half4(localPos, 1); + #endif + //----------------------------------------------------------- + + v.texcoord0.xy = TRANSFORM_TEX(v.texcoord0.xy, _MainTex); + half2 center = half2(0.5, 0.5); + #if ATLAS_ON + center = half2((_MaxXUV + _MinXUV) / 2.0, (_MaxYUV + _MinYUV) / 2.0); + #endif + + //POLARUV_ON + #if POLARUV_ON + v.texcoord0.xy = v.texcoord0.xy - center; + #endif + + //---------------------------------------- + + //ROTATEUV_ON + #if ROTATEUV_ON + half2 uvC = v.texcoord0.xy; + half cosAngle = cos(_RotateUvAmount); + half sinAngle = sin(_RotateUvAmount); + half2x2 rot = half2x2(cosAngle, -sinAngle, sinAngle, cosAngle); + uvC -= center; + v.texcoord0.xy = mul(rot, uvC); + v.texcoord0.xy += center; + #endif + //-------------------- + + #if RECTSIZE_ON + v.vertex.xyz += (v.vertex.xyz * (_RectSize - 1.0)); + #endif + + #if OUTTEX_ON + v.texcoord1.xy = TRANSFORM_TEX(v.texcoord0.xy, _OutlineTex); + #endif + + #if OUTDIST_ON + v.texcoord2.xy = TRANSFORM_TEX(v.texcoord0.xy, _OutlineDistortTex); + #endif + + #if DISTORT_ON + v.texcoord3.xy = TRANSFORM_TEX(v.texcoord0.xy, _DistortTex); + #endif + } + + void Ext_SurfaceFunction0 (inout Surface o, ShaderData d) + { + half randomSeed = _RandomSeed; + + float2 uvRect = d.texcoord0; + half2 center = half2(0.5, 0.5); + #if ATLAS_ON + center = half2((_MaxXUV + _MinXUV) / 2.0, (_MaxYUV + _MinYUV) / 2.0); + uvRect = half2((d.texcoord0.x - _MinXUV) / (_MaxXUV - _MinXUV), (d.texcoord0.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half2 centerTiled = half2(center.x * _MainTex_ST.x, center.y * _MainTex_ST.y); + + //CLIPPING_ON + #if CLIPPING_ON + half2 tiledUv = half2(d.texcoord0.x / _MainTex_ST.x, d.texcoord0.y / _MainTex_ST.y); + #if ATLAS_ON + tiledUv = half2((tiledUv.x - _MinXUV) / (_MaxXUV - _MinXUV), (tiledUv.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + clip((1 - _ClipUvUp) - tiledUv.y); + clip(tiledUv.y - _ClipUvDown); + clip((1 - _ClipUvRight) - tiledUv.x); + clip(tiledUv.x - _ClipUvLeft); + #endif + //---------------------------------- + + //RADIALCLIPPING_ON + #if RADIALCLIPPING_ON + half2 tiledUv2 = half2(d.texcoord0.x / _MainTex_ST.x, d.texcoord0.y / _MainTex_ST.y); + #if ATLAS_ON + tiledUv2 = half2((tiledUv2.x - _MinXUV) / (_MaxXUV - _MinXUV), (tiledUv2.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half startAngle = _RadialStartAngle - _RadialClip; + half endAngle = _RadialStartAngle + _RadialClip2; + half offset0 = clamp(0, 360, startAngle + 360); + half offset360 = clamp(0, 360, endAngle - 360); + half2 atan2Coord = half2(lerp(-1, 1, tiledUv2.x), lerp(-1, 1, tiledUv2.y)); + half atanAngle = atan2(atan2Coord.y, atan2Coord.x) * 57.3; // angle in degrees + if(atanAngle < 0) atanAngle = 360 + atanAngle; + if(atanAngle >= startAngle && atanAngle <= endAngle) discard; + if(atanAngle <= offset360) discard; + if(atanAngle >= offset0) discard; + #endif + + //----------------------------- + + //TEXTURESCROLL_ON && ATLAS_ON + #if TEXTURESCROLL_ON && ATLAS_ON + d.texcoord0.xy = half2(_MinXUV + ((_MaxXUV - _MinXUV) * (abs(((_Time.y + randomSeed) * _TextureScrollXSpeed) + uvRect.x) % 1)), + _MinYUV + ((_MaxYUV - _MinYUV) * (abs(((_Time.y + randomSeed) * _TextureScrollYSpeed) + uvRect.y) % 1))); + #endif + //---------------------------- + + //OFFSETUV_ON + #if OFFSETUV_ON + #if ATLAS_ON + d.texcoord0.xy = half2(_MinXUV + ((_MaxXUV - _MinXUV) * (abs((_OffsetUvX + uvRect.x) % 1))), + _MinYUV + ((_MaxYUV - _MinYUV) * (abs(_OffsetUvY + uvRect.y) % 1))); + #else + d.texcoord0.xy += half2(_OffsetUvX, _OffsetUvY); + #endif + #endif + + //---------------------- + + //POLARUV_ON + #if POLARUV_ON + d.texcoord0.xy = half2(atan2(d.texcoord0.y, d.texcoord0.x) / (2.0f * 3.141592653589f), length(d.texcoord0.xy)); + d.texcoord0.xy *= _MainTex_ST.xy; + #endif + + //-------------------------------------- + + //TWISTUV_ON + #if TWISTUV_ON + #if ATLAS_ON + _TwistUvPosX = ((_MaxXUV - _MinXUV) * _TwistUvPosX) + _MinXUV; + _TwistUvPosY = ((_MaxYUV - _MinYUV) * _TwistUvPosY) + _MinYUV; + #endif + half2 tempUv = d.texcoord0.xy - half2(_TwistUvPosX * _MainTex_ST.x, _TwistUvPosY * _MainTex_ST.y); + _TwistUvRadius *= (_MainTex_ST.x + _MainTex_ST.y) / 2; + half percent = (_TwistUvRadius - length(tempUv)) / _TwistUvRadius; + half theta = percent * percent * (2.0 * sin(_TwistUvAmount)) * 8.0; + half s = sin(theta); + half c = cos(theta); + half beta = max(sign(_TwistUvRadius - length(tempUv)), 0.0); + tempUv = half2(dot(tempUv, half2(c, -s)), dot(tempUv, half2(s, c))) * beta + tempUv * (1 - beta); + tempUv += half2(_TwistUvPosX * _MainTex_ST.x, _TwistUvPosY * _MainTex_ST.y); + d.texcoord0.xy = tempUv; + #endif + + //-------------------------------------------- + + //FISHEYE_ON + #if FISHEYE_ON + half bind = length(centerTiled); + half2 dF = d.texcoord0.xy - centerTiled; + half dFlen = length(dF); + half fishInt = (3.14159265359 / bind) * (_FishEyeUvAmount + 0.001); + d.texcoord0.xy = centerTiled + (dF / (max(0.0001, dFlen))) * tan(dFlen * fishInt) * bind / tan(bind * fishInt); + #endif + //--------------------------------------------- + + //PINCH_ON + #if PINCH_ON + half2 dP = d.texcoord0.xy - centerTiled; + half pinchInt = (3.141592 / length(centerTiled)) * (-_PinchUvAmount + 0.001); + d.texcoord0.xy = centerTiled + normalize(dP) * atan(length(dP) * -pinchInt * 10.0) * 0.5 / atan(-pinchInt * 5); + #endif + + //--------------------------------------------- + + //ZOOMUV_ON + #if ZOOMUV_ON + d.texcoord0.xy -= centerTiled; + d.texcoord0.xy = d.texcoord0.xy * _ZoomUvAmount; + d.texcoord0.xy += centerTiled; + #endif + + //----------------------------------------------- + + //DOODLE_ON + #if DOODLE_ON + half2 uvCopy = uvRect; + _HandDrawnSpeed = (floor((_Time.x + randomSeed) * 20 * _HandDrawnSpeed) / _HandDrawnSpeed) * _HandDrawnSpeed; + uvCopy.x = sin((uvCopy.x * _HandDrawnAmount + _HandDrawnSpeed) * 4); + uvCopy.y = cos((uvCopy.y * _HandDrawnAmount + _HandDrawnSpeed) * 4); + d.texcoord0.xy = lerp(d.texcoord0.xy, d.texcoord0.xy + uvCopy, 0.0005 * _HandDrawnAmount); + #endif + + //-------------------------- + + //SHAKEUV_ON + #if SHAKEUV_ON + half xShake = sin((_Time.x + randomSeed) * _ShakeUvSpeed * 50) * _ShakeUvX; + half yShake = cos((_Time.x + randomSeed) * _ShakeUvSpeed * 50) * _ShakeUvY; + d.texcoord0.xy += half2(xShake * 0.012, yShake * 0.01); + #endif + + //------------------------------------------- + + //RECTSIZE_ON + #if RECTSIZE_ON + d.texcoord0.xy = d.texcoord0.xy * (_RectSize).xx + (((-_RectSize * 0.5) + 0.5)).xx; + #endif + + //------------------------------------------- + + //DISTORT_ON + #if DISTORT_ON + #if ATLAS_ON + d.texcoord3.x = d.texcoord3.x * (1 / (_MaxXUV - _MinXUV)); + d.texcoord3.y = d.texcoord3.y * (1 / (_MaxYUV - _MinYUV)); + #endif + + d.texcoord3.x += ((_Time.x + _RandomSeed) * _DistortTexXSpeed) % 1; + d.texcoord3.y += ((_Time.x + _RandomSeed) * _DistortTexYSpeed) % 1; + half distortAmnt = (SAMPLE_TEXTURE2D(_DistortTex, sampler_DistortTex, d.texcoord3.xy).r - 0.5) * 0.2 * _DistortAmount; + d.texcoord0.x += distortAmnt; + d.texcoord0.y += distortAmnt; + #endif + //------------------------------------------------------- + + //WARP_ON + #if WARP_ON + half2 warpUv = half2(d.texcoord0.x / _MainTex_ST.x, d.texcoord0.y / _MainTex_ST.y); + #if ATLAS_ON + warpUv = half2((warpUv.x - _MinXUV) / (_MaxXUV - _MinXUV), (warpUv.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + const float tau = 6.283185307179586; + float xWarp = (_Time.y + randomSeed) * _WarpSpeed + warpUv.x * tau / _WarpScale; + float yWarp = (_Time.y + randomSeed) * _WarpSpeed + warpUv.y * tau / _WarpScale; + float2 warp = float2(sin(xWarp), sin(yWarp)) * _WarpStrength; + d.texcoord0.xy += warp; + #endif + + //------------------------------------------------------- + + //WAVEUV_ON + #if WAVEUV_ON + float2 uvWave = half2(_WaveX * _MainTex_ST.x, _WaveY * _MainTex_ST.y) - d.texcoord0.xy; + uvWave %= 1; + #if ATLAS_ON + uvWave = half2(_WaveX, _WaveY) - uvRect; + #endif + uvWave.x *= _ScreenParams.x / _ScreenParams.y; + float waveTime = _Time.y + randomSeed; + float angWave = (sqrt(dot(uvWave, uvWave)) * _WaveAmount) - ((waveTime * _WaveSpeed)); + d.texcoord0.xy = d.texcoord0.xy + uvWave * sin(angWave) * (_WaveStrength / 1000.0); + #endif + //---------------------------------------------------- + + //ROUNDWAVEUV_ON + #if ROUNDWAVEUV_ON + half xWave = ((0.5 * _MainTex_ST.x) - uvRect.x); + half yWave = ((0.5 * _MainTex_ST.y) - uvRect.y) * (_MainTex_TexelSize.w / _MainTex_TexelSize.z); + half ripple = -sqrt(xWave*xWave + yWave* yWave); + d.texcoord0.xy += (sin((ripple + (_Time.y + randomSeed) * (_RoundWaveSpeed/10.0)) / 0.015) * (_RoundWaveStrength/10.0)) % 1; + #endif + //---------------------------------------------------- + + + //WIND_ON + #if WIND_ON + half windOffset = sin((_Time.x + randomSeed) * _GrassSpeed * 10); + half2 windCenter = half2(0.5, 0.1); + #if ATLAS_ON + windCenter.x = ((_MaxXUV - _MinXUV) * windCenter.x) + _MinXUV; + windCenter.y = ((_MaxYUV - _MinYUV) * windCenter.y) + _MinYUV; + #endif + #if !MANUALWIND_ON + d.texcoord0.x = fmod(abs(lerp(d.texcoord0.x, d.texcoord0.x + (_GrassWind * 0.01 * windOffset), uvRect.y)), 1); + #else + d.texcoord0.x = fmod(abs(lerp(d.texcoord0.x, d.texcoord0.x + (_GrassWind * 0.01 * _GrassManualAnim), uvRect.y)), 1); + windOffset = _GrassManualAnim; + #endif + half2 delta = d.texcoord0.xy - windCenter; + half delta2 = dot(delta.xy, delta.xy); + half2 delta_offset = delta2 * windOffset; + d.texcoord0.xy = d.texcoord0.xy + half2(delta.y, -delta.x) * delta_offset * _GrassRadialBend; + #endif + + //-------------------------------------------------------- + + //TEXTURESCROLL_ON && !ATLAS_ON + #if TEXTURESCROLL_ON && !ATLAS_ON + d.texcoord0.x += ((_Time.y + randomSeed) * _TextureScrollXSpeed) % 1; + d.texcoord0.y += ((_Time.y + randomSeed) * _TextureScrollYSpeed) % 1; + #endif + //------------------------------ + + //PIXELATE_ON + #if PIXELATE_ON + half aspectRatio = _MainTex_TexelSize.x / _MainTex_TexelSize.y; + half2 pixelSize = float2(_PixelateSize, _PixelateSize * aspectRatio); + d.texcoord0.xy = floor(d.texcoord0.xy * pixelSize) / pixelSize; + #endif + //-------------- + + half4 col = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy); + half originalAlpha = col.a; + col *= d.vertexColor; + + //NORMAL MAP + #if NORMALMAP_ON + half4 normalSample = SAMPLE_TEXTURE2D(_NormalMap, sampler_NormalMap, d.texcoord0.xy); + half3 normalTS = UnpackNormal(normalSample); + normalTS.xy *= _NormalStrength; + o.Normal = normalTS; + #endif + + + //GLITCH_ON + #if GLITCH_ON + half2 uvGlitch = uvRect; + uvGlitch.y -= 0.5; + half lineNoise = pow(rand2(floor(uvGlitch * half2(24., 19.) * _GlitchSize) * 4.0, randomSeed), 3.0) * _GlitchAmount + * pow(rand2(floor(uvGlitch * half2(38., 14.) * _GlitchSize) * 4.0, randomSeed), 3.0); + col = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(lineNoise * 0.02 * rand2(half2(2.0, 1), randomSeed), 0)) * d.vertexColor; + #endif + //-------------------------------------- + + //CHROMABERR_ON + #if CHROMABERR_ON + half4 r = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(_ChromAberrAmount/10, 0)) * d.vertexColor; + half4 b = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(-_ChromAberrAmount/10, 0)) * d.vertexColor; + col = half4(r.r * r.a, col.g, b.b * b.a, max(max(r.a, b.a) * _ChromAberrAlpha, col.a)); + #endif + + //-------------------------------- + + //BLUR_ON + #if BLUR_ON + #if ATLAS_ON + #if !BLURISHD_ON + col = BlurHD(d.texcoord0.xy, _MainTex, sampler_MainTex, _BlurIntensity, (_MaxXUV - _MinXUV), (_MaxYUV - _MinYUV)) * d.vertexColor; + #else + col = Blur(d.texcoord0.xy, _MainTex, sampler_MainTex, _BlurIntensity * (_MaxXUV - _MinXUV)) * d.vertexColor; + #endif + #else + #if !BLURISHD_ON + col = BlurHD(d.texcoord0.xy, _MainTex, sampler_MainTex, _BlurIntensity, 1, 1) * d.vertexColor; + #else + col = Blur(d.texcoord0.xy, _MainTex, sampler_MainTex, _BlurIntensity) * d.vertexColor; + #endif + #endif + #endif + + //-------------------- + + //MOTIONBLUR_ON + #if MOTIONBLUR_ON + _MotionBlurAngle = _MotionBlurAngle * 3.1415926; + #define rot(n) mul(n, half2x2(cos(_MotionBlurAngle), -sin(_MotionBlurAngle), sin(_MotionBlurAngle), cos(_MotionBlurAngle))) + _MotionBlurDist = _MotionBlurDist * 0.005; + #if ATLAS_ON + _MotionBlurDist *= (_MaxXUV - _MinXUV); + #endif + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(-_MotionBlurDist, -_MotionBlurDist))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(-_MotionBlurDist * 2, -_MotionBlurDist * 2))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(-_MotionBlurDist * 3, -_MotionBlurDist * 3))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(-_MotionBlurDist * 4, -_MotionBlurDist * 4))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(_MotionBlurDist, _MotionBlurDist))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(_MotionBlurDist * 2, _MotionBlurDist * 2))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(_MotionBlurDist * 3, _MotionBlurDist * 3))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(_MotionBlurDist * 4, _MotionBlurDist * 4))); + col.rgb = col.rgb / 9; + #endif + //------------------------------------ + + //NEGATIVE_ON + #if NEGATIVE_ON + col.rgb = lerp(col.rgb, 1 - col.rgb, _NegativeAmount); + #endif + + //-------------- + half luminance = 0; + + //GREYSCALE_ON && !GREYSCALEOUTLINE_ON + #if GREYSCALE_ON && !GREYSCALEOUTLINE_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + luminance = saturate(luminance + _GreyscaleLuminosity); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _GreyscaleTintColor, _GreyscaleBlend); + #endif + //------------------------------------ + + //GHOST_ON + #if GHOST_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + half4 ghostResult; + ghostResult.a = saturate(luminance - _GhostTransparency) * col.a; + ghostResult.rgb = col.rgb * (luminance + _GhostColorBoost); + col = lerp(col, ghostResult, _GhostBlend); + #endif + //------------------------------------ + + //INNEROUTLINE_ON + #if INNEROUTLINE_ON + half3 innerT = abs(GetPixel(0, _InnerOutlineThickness, d.texcoord0.xy, _MainTex, sampler_MainTex) - GetPixel(0, -_InnerOutlineThickness, d.texcoord0.xy, _MainTex, sampler_MainTex)); + innerT += abs(GetPixel(_InnerOutlineThickness, 0, d.texcoord0.xy, _MainTex, sampler_MainTex) - GetPixel(-_InnerOutlineThickness, 0, d.texcoord0.xy, _MainTex, sampler_MainTex)); + #if !ONLYINNEROUTLINE_ON + innerT = (innerT / 2.0) * col.a * _InnerOutlineAlpha; + col.rgb += length(innerT) * _InnerOutlineColor.rgb * _InnerOutlineGlow; + #else + innerT *= col.a * _InnerOutlineAlpha; + col.rgb = length(innerT) * _InnerOutlineColor.rgb * _InnerOutlineGlow; + col.a = step(0.3, col.r+col.g+col.b); + #endif + #endif + //------------------------------------------------------- + + //HITEFFECT_ON + #if HITEFFECT_ON + col.rgb = lerp(col.rgb, _HitEffectColor.rgb * _HitEffectGlow, _HitEffectBlend); + #endif + //-------------------- + + //GRADIENT_ON + #if GRADIENT_ON + half2 tiledUvGrad = half2(uvRect.x / _MainTex_ST.x, uvRect.y / _MainTex_ST.y); + #if GRADIENT2COL_ON + _GradTopRightCol = _GradTopLeftCol; + _GradBotRightCol = _GradBotLeftCol; + #endif + #if RADIALGRADIENT_ON + half radialDist = 1 - length(tiledUvGrad - half2(0.5, 0.5)); + radialDist *= (_MainTex_TexelSize.w / _MainTex_TexelSize.z); + radialDist = saturate(_GradBoostX * radialDist); + half4 gradientResult = lerp(_GradTopLeftCol, _GradBotLeftCol, radialDist); + #else + half gradXLerpFactor = saturate(pow(tiledUvGrad.x, _GradBoostX)); + half4 gradientResult = lerp(lerp(_GradBotLeftCol, _GradBotRightCol, gradXLerpFactor), + lerp(_GradTopLeftCol, _GradTopRightCol, gradXLerpFactor), saturate(pow(tiledUvGrad.y, _GradBoostY))); + #endif + gradientResult = lerp(col, gradientResult, _GradBlend); + col.rgb = gradientResult.rgb * col.a; + col.a *= gradientResult.a; + #endif + //-------------------------------------------------------------------- + + //CONTRAST_ON + #if CONTRAST_ON + col.rgb = (col.rgb - float3(0.5, 0.5, 0.5)) * _Contrast + float3(0.5, 0.5, 0.5); + col.rgb += _Brightness; + #endif + + //------------------------------------------------------------------- + + //COLORSWAP_ON + #if COLORSWAP_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + half4 swapMask = SAMPLE_TEXTURE2D(_ColorSwapTex, sampler_ColorSwapTex, d.texcoord0.xy); + swapMask.rgb *= swapMask.a; + half3 redSwap = _ColorSwapRed * swapMask.r * saturate(luminance + _ColorSwapRedLuminosity); + half3 greenSwap = _ColorSwapGreen * swapMask.g * saturate(luminance + _ColorSwapGreenLuminosity); + half3 blueSwap = _ColorSwapBlue * swapMask.b * saturate(luminance + _ColorSwapBlueLuminosity); + swapMask.rgb = col.rgb * saturate(1 - swapMask.r - swapMask.g - swapMask.b); + col.rgb = lerp(col.rgb, swapMask.rgb + redSwap + greenSwap + blueSwap, _ColorSwapBlend); + #endif + //-------------------------------------------------------------------- + + //COLORRAMP_ON && !COLORRAMPOUTLINE_ON + #if COLORRAMP_ON && !COLORRAMPOUTLINE_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + luminance = saturate(luminance + _ColorRampLuminosity); + #if GRADIENTCOLORRAMP_ON + col.rgb = lerp(col.rgb, SAMPLE_TEXTURE2D(_ColorRampTexGradient, sampler_ColorRampTexGradient, half2(luminance, 0)).rgb, _ColorRampBlend); + #else + col.rgb = lerp(col.rgb, SAMPLE_TEXTURE2D(_ColorRampTex, sampler_ColorRampTex, half2(luminance, 0)).rgb, _ColorRampBlend); + #endif + #endif + //-------------------------------------------------------------------- + + //CHANGECOLOR_ON + #if CHANGECOLOR_ON + float3 currChangeColor = saturate(col.rgb); + luminance = 0.3 * currChangeColor.r + 0.59 * currChangeColor.g + 0.11 * currChangeColor.b; + luminance = saturate(luminance + _ColorChangeLuminosity); + half3 dif = abs(currChangeColor - _ColorChangeTarget.rgb); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _ColorChangeNewCol.rgb, + max(sign(1 - saturate(dif.x + dif.y + dif.z) - _ColorChangeTolerance), 0.0)); + #if CHANGECOLOR2_ON + dif = abs(currChangeColor - _ColorChangeTarget2.rgb); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _ColorChangeNewCol2.rgb, + max(sign(1 - saturate(dif.x + dif.y + dif.z) - _ColorChangeTolerance2), 0.0)); + #endif + #if CHANGECOLOR3_ON + dif = abs(currChangeColor - _ColorChangeTarget3.rgb); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _ColorChangeNewCol3.rgb, + max(sign(1 - saturate(dif.x + dif.y + dif.z) - _ColorChangeTolerance3), 0.0)); + #endif + #endif + //------------------------------------------------------- + + //POSTERIZE_ON && !POSTERIZEOUTLINE_ON + #if POSTERIZE_ON && !POSTERIZEOUTLINE_ON + col.rgb = pow(col.rgb, _PosterizeGamma) * _PosterizeNumColors; + col.rgb = floor(col.rgb) / _PosterizeNumColors; + col.rgb = pow(col.rgb, 1.0 / _PosterizeGamma); + #endif + //------------------------------------ + + //HSV_ON + #if HSV_ON + half3 resultHsv = half3(col.rgb); + half cosHsv = _HsvBright * _HsvSaturation * cos(_HsvShift * 3.14159265 / 180); + half sinHsv = _HsvBright * _HsvSaturation * sin(_HsvShift * 3.14159265 / 180); + resultHsv.x = (.299 * _HsvBright + .701 * cosHsv + .168 * sinHsv) * col.x + + (.587 * _HsvBright - .587 * cosHsv + .330 * sinHsv) * col.y + + (.114 * _HsvBright - .114 * cosHsv - .497 * sinHsv) * col.z; + resultHsv.y = (.299 * _HsvBright - .299 * cosHsv - .328 * sinHsv) *col.x + + (.587 * _HsvBright + .413 * cosHsv + .035 * sinHsv) * col.y + + (.114 * _HsvBright - .114 * cosHsv + .292 * sinHsv) * col.z; + resultHsv.z = (.299 * _HsvBright - .3 * cosHsv + 1.25 * sinHsv) * col.x + + (.587 * _HsvBright - .588 * cosHsv - 1.05 * sinHsv) * col.y + + (.114 * _HsvBright + .886 * cosHsv - .203 * sinHsv) * col.z; + col.rgb = resultHsv; + #endif + //------------------------------------------------------- + + //OVERLAY_ON + #if OVERLAY_ON + half2 overlayUvs = d.texcoord0.xy; + overlayUvs.x += ((_Time.y + randomSeed) * _OverlayTextureScrollXSpeed) % 1; + overlayUvs.y += ((_Time.y + randomSeed) * _OverlayTextureScrollYSpeed) % 1; + half4 overlayCol = SAMPLE_TEXTURE2D(_OverlayTex, sampler_OverlayTex, TRANSFORM_TEX(overlayUvs, _OverlayTex)); + overlayCol.rgb *= _OverlayColor.rgb * _OverlayGlow; + #if !OVERLAYMULT_ON + overlayCol.rgb *= overlayCol.a * _OverlayColor.rgb * _OverlayColor.a * _OverlayBlend; + col.rgb += overlayCol.rgb; + #else + overlayCol.a *= _OverlayColor.a; + col = lerp(col, col * overlayCol, _OverlayBlend); + #endif + #endif + + //--------------------------------- + + //OUTBASE_ON + #if OUTBASE_ON + #if OUTBASEPIXELPERF_ON + half2 destUv = half2(_OutlinePixelWidth * _MainTex_TexelSize.x, _OutlinePixelWidth * _MainTex_TexelSize.y); + #else + half2 destUv = half2(_OutlineWidth * _MainTex_TexelSize.x * 200, _OutlineWidth * _MainTex_TexelSize.y * 200); + #endif + + #if OUTDIST_ON + d.texcoord3.x += ((_Time.x + _RandomSeed) * _OutlineDistortTexXSpeed) % 1; + d.texcoord3.y += ((_Time.x + _RandomSeed) * _OutlineDistortTexYSpeed) % 1; + #if ATLAS_ON + d.texcoord3 = half2((d.texcoord3.x - _MinXUV) / (_MaxXUV - _MinXUV), (d.texcoord3.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half outDistortAmnt = (SAMPLE_TEXTURE2D(_OutlineDistortTex, sampler_OutlineDistortTex, d.texcoord3).r - 0.5) * 0.2 * _OutlineDistortAmount; + destUv.x += outDistortAmnt; + destUv.y += outDistortAmnt; + #endif + + half spriteLeft = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(destUv.x, 0)).a; + half spriteRight = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy - half2(destUv.x, 0)).a; + half spriteBottom = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(0, destUv.y)).a; + half spriteTop = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy - half2(0, destUv.y)).a; + half result = spriteLeft + spriteRight + spriteBottom + spriteTop; + + #if OUTBASE8DIR_ON + half spriteTopLeft = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(destUv.x, destUv.y)).a; + half spriteTopRight = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(-destUv.x, destUv.y)).a; + half spriteBotLeft = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(destUv.x, -destUv.y)).a; + half spriteBotRight = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(-destUv.x, -destUv.y)).a; + result = result + spriteTopLeft + spriteTopRight + spriteBotLeft + spriteBotRight; + #endif + + result = step(0.05, saturate(result)); + + #if OUTTEX_ON + d.texcoord1.x += ((_Time.x + _RandomSeed) * _OutlineTexXSpeed) % 1; + d.texcoord1.y += ((_Time.x + _RandomSeed) * _OutlineTexYSpeed) % 1; + #if ATLAS_ON + d.texcoord1 = half2((d.texcoord1.x - _MinXUV) / (_MaxXUV - _MinXUV), (d.texcoord1.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half4 tempOutColor = SAMPLE_TEXTURE2D(_OutlineTex, sampler_OutlineTex, d.texcoord1); + tempOutColor *= _OutlineColor; + _OutlineColor = tempOutColor; + #endif + + result *= (1 - originalAlpha) * _OutlineAlpha; + + half4 outline = _OutlineColor * d.vertexColor.a; + outline.rgb *= _OutlineGlow; + outline.a = result; + #if ONLYOUTLINE_ON + col = outline; + #else + col = lerp(col, outline, result); + #endif + #endif + //------------------------------------------------------- + + //FADE_ON + #if FADE_ON + half2 tiledUvFade1 = TRANSFORM_TEX(d.texcoord0, _FadeTex); + half2 tiledUvFade2 = TRANSFORM_TEX(d.texcoord0, _FadeBurnTex); + #if ATLAS_ON + tiledUvFade1 = half2((tiledUvFade1.x - _MinXUV) / (_MaxXUV - _MinXUV), (tiledUvFade1.y - _MinYUV) / (_MaxYUV - _MinYUV)); + tiledUvFade2 = half2((tiledUvFade2.x - _MinXUV) / (_MaxXUV - _MinXUV), (tiledUvFade2.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half fadeTemp = SAMPLE_TEXTURE2D(_FadeTex, sampler_FadeTex, tiledUvFade1).r; + half fade = smoothstep(_FadeAmount, _FadeAmount + _FadeBurnTransition, fadeTemp); + half fadeBurn = saturate(smoothstep(_FadeAmount - _FadeBurnWidth, _FadeAmount - _FadeBurnWidth + 0.1, fadeTemp) * _FadeAmount); + col.a *= fade; + _FadeBurnColor.rgb *= _FadeBurnGlow; + col += fadeBurn * SAMPLE_TEXTURE2D(_FadeBurnTex, sampler_FadeBurnTex, tiledUvFade2) * _FadeBurnColor * originalAlpha * (1 - col.a); + #endif + //------------------------------------------------------- + + //SHADOW_ON + #if SHADOW_ON + half shadowA = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(_ShadowX, _ShadowY)).a; + half preMultShadowMask = 1 - (saturate(shadowA - col.a) * (1 - col.a)); + col.rgb *= 1 - ((shadowA - col.a) * (1 - col.a)); + col.rgb += (_ShadowColor * shadowA) * (1 - col.a); + col.a = max(shadowA * _ShadowAlpha * d.vertexColor.a, col.a); + #endif + + //------------------------------------------------------- + + //GLOW_ON + #if GLOW_ON + half4 emission; + #if GLOWTEX_ON + emission = SAMPLE_TEXTURE2D(_GlowTex, sampler_GlowTex, d.texcoord0); + #else + emission = col; + #endif + + col.rgb *= _GlowGlobal; + emission.rgb *= emission.a * col.a * _Glow * _GlowColor; + col.rgb += emission.rgb; + #endif + //------------------------------------------------------- + + //COLORRAMP_ON && COLORRAMPOUTLINE_ON + #if COLORRAMP_ON && COLORRAMPOUTLINE_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + luminance = saturate(luminance + _ColorRampLuminosity); + #if GRADIENTCOLORRAMP_ON + col.rgb = lerp(col.rgb, SAMPLE_TEXTURE2D(_ColorRampTexGradient, sampler_ColorRampTexGradient, half2(luminance, 0)).rgb, _ColorRampBlend); + #else + col.rgb = lerp(col.rgb, SAMPLE_TEXTURE2D(_ColorRampTex, sampler_ColorRampTex, half2(luminance, 0)).rgb, _ColorRampBlend); + #endif + #endif + //--------------- + + //GREYSCALE_ON && GREYSCALEOUTLINE_ON + #if GREYSCALE_ON && GREYSCALEOUTLINE_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + luminance = saturate(luminance + _GreyscaleLuminosity); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _GreyscaleTintColor, _GreyscaleBlend); + #endif + + //----------------------------------- + + //POSTERIZE_ON && POSTERIZEOUTLINE_ON + #if POSTERIZE_ON && POSTERIZEOUTLINE_ON + col.rgb = pow(col.rgb, _PosterizeGamma) * _PosterizeNumColors; + col.rgb = floor(col.rgb) / _PosterizeNumColors; + col.rgb = pow(col.rgb, 1.0 / _PosterizeGamma); + #endif + + //----------------------------------- + + //SHINE_ON + #if SHINE_ON + half2 uvShine = uvRect; + half cosAngle = cos(_ShineRotate); + half sinAngle = sin(_ShineRotate); + half2x2 rot = half2x2(cosAngle, -sinAngle, sinAngle, cosAngle); + uvShine -= half2(0.5, 0.5); + uvShine = mul(rot, uvShine); + uvShine += half2(0.5, 0.5); + half shineMask = SAMPLE_TEXTURE2D(_ShineMask, sampler_ShineMask, d.texcoord0.xy).a; + half currentDistanceProjection = (uvShine.x + uvShine.y) / 2; + half whitePower = 1 - (abs(currentDistanceProjection - _ShineLocation) / _ShineWidth); + col.rgb += col.a * whitePower * _ShineGlow * max(sign(currentDistanceProjection - (_ShineLocation - _ShineWidth)), 0.0) + * max(sign((_ShineLocation + _ShineWidth) - currentDistanceProjection), 0.0) * _ShineColor * shineMask; + #endif + + //----------------------------------- + + //HOLOGRAM_ON + #if HOLOGRAM_ON + half totalHologram = _HologramStripesAmount + _HologramUnmodAmount; + half hologramYCoord = ((uvRect.y + (((_Time.x + randomSeed) % 1) * _HologramStripesSpeed)) % totalHologram) / totalHologram; + hologramYCoord = abs(hologramYCoord); + half alpha = RemapFloat(saturate(hologramYCoord - (_HologramUnmodAmount/totalHologram)), 0.0, 1.0, _HologramMinAlpha, saturate(_HologramMaxAlpha)); + half hologramMask = max(sign((_HologramUnmodAmount/totalHologram) - hologramYCoord), 0.0); + half4 hologramResult = col; + hologramResult.a *= lerp(alpha, 1, hologramMask); + hologramResult.rgb *= max(1, _HologramMaxAlpha * max(sign(hologramYCoord - (_HologramUnmodAmount/totalHologram)), 0.0)); + hologramMask = 1 - step(0.01,hologramMask); + hologramResult.rgb += hologramMask * _HologramStripeColor * col.a; + col = lerp(col, hologramResult, _HologramBlend); + #endif + + //----------------------------------- + + //FLICKER_ON + #if FLICKER_ON + col.a *= saturate(col.a * step(frac(0.05 + (_Time.w + randomSeed) * _FlickerFreq), 1 - _FlickerPercent) + _FlickerAlpha); + #endif + //----------------------------------- + + //ALPHACUTOFF_ON + + //ALPHAROUND_ON + + //ALPHAOUTLINE_ON + #if ALPHAOUTLINE_ON + half alphaOutlineRes = pow(1 - col.a, max(_AlphaOutlinePower, 0.0001)) * step(_AlphaOutlineMinAlpha, col.a) * _AlphaOutlineBlend; + col.rgb = lerp(col.rgb, _AlphaOutlineColor.rgb * _AlphaOutlineGlow, alphaOutlineRes); + col.a = lerp(col.a, 1, alphaOutlineRes > 1); + #endif + //------------------------------------------------------- + + //FOG_ON + + //------------------ + + col *= _Color; + o.Albedo = col; + col.a *= _Alpha; + clip(col.a - _AlphaCutoffValue - 0.01); + o.Alpha = _Color.a; + } + + + + + + void ChainSurfaceFunction(inout Surface l, inout ShaderData d) + { + Ext_SurfaceFunction0(l, d); + // Ext_SurfaceFunction1(l, d); + // Ext_SurfaceFunction2(l, d); + // Ext_SurfaceFunction3(l, d); + // Ext_SurfaceFunction4(l, d); + // Ext_SurfaceFunction5(l, d); + // Ext_SurfaceFunction6(l, d); + // Ext_SurfaceFunction7(l, d); + // Ext_SurfaceFunction8(l, d); + // Ext_SurfaceFunction9(l, d); + // Ext_SurfaceFunction10(l, d); + // Ext_SurfaceFunction11(l, d); + // Ext_SurfaceFunction12(l, d); + // Ext_SurfaceFunction13(l, d); + // Ext_SurfaceFunction14(l, d); + // Ext_SurfaceFunction15(l, d); + // Ext_SurfaceFunction16(l, d); + // Ext_SurfaceFunction17(l, d); + // Ext_SurfaceFunction18(l, d); + // Ext_SurfaceFunction19(l, d); + // Ext_SurfaceFunction20(l, d); + // Ext_SurfaceFunction21(l, d); + // Ext_SurfaceFunction22(l, d); + // Ext_SurfaceFunction23(l, d); + // Ext_SurfaceFunction24(l, d); + // Ext_SurfaceFunction25(l, d); + // Ext_SurfaceFunction26(l, d); + // Ext_SurfaceFunction27(l, d); + // Ext_SurfaceFunction28(l, d); + // Ext_SurfaceFunction29(l, d); + } + +#if !_DECALSHADER + + void ChainModifyVertex(inout VertexData v, inout VertexToPixel v2p, float4 time) + { + ExtraV2F d; + + ZERO_INITIALIZE(ExtraV2F, d); + ZERO_INITIALIZE(Blackboard, d.blackboard); + // due to motion vectors in HDRP, we need to use the last + // time in certain spots. So if you are going to use _Time to adjust vertices, + // you need to use this time or motion vectors will break. + d.time = time; + + Ext_ModifyVertex0(v, d); + // Ext_ModifyVertex1(v, d); + // Ext_ModifyVertex2(v, d); + // Ext_ModifyVertex3(v, d); + // Ext_ModifyVertex4(v, d); + // Ext_ModifyVertex5(v, d); + // Ext_ModifyVertex6(v, d); + // Ext_ModifyVertex7(v, d); + // Ext_ModifyVertex8(v, d); + // Ext_ModifyVertex9(v, d); + // Ext_ModifyVertex10(v, d); + // Ext_ModifyVertex11(v, d); + // Ext_ModifyVertex12(v, d); + // Ext_ModifyVertex13(v, d); + // Ext_ModifyVertex14(v, d); + // Ext_ModifyVertex15(v, d); + // Ext_ModifyVertex16(v, d); + // Ext_ModifyVertex17(v, d); + // Ext_ModifyVertex18(v, d); + // Ext_ModifyVertex19(v, d); + // Ext_ModifyVertex20(v, d); + // Ext_ModifyVertex21(v, d); + // Ext_ModifyVertex22(v, d); + // Ext_ModifyVertex23(v, d); + // Ext_ModifyVertex24(v, d); + // Ext_ModifyVertex25(v, d); + // Ext_ModifyVertex26(v, d); + // Ext_ModifyVertex27(v, d); + // Ext_ModifyVertex28(v, d); + // Ext_ModifyVertex29(v, d); + + + // #if %EXTRAV2F0REQUIREKEY% + // v2p.extraV2F0 = d.extraV2F0; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // v2p.extraV2F1 = d.extraV2F1; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // v2p.extraV2F2 = d.extraV2F2; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // v2p.extraV2F3 = d.extraV2F3; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // v2p.extraV2F4 = d.extraV2F4; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // v2p.extraV2F5 = d.extraV2F5; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // v2p.extraV2F6 = d.extraV2F6; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // v2p.extraV2F7 = d.extraV2F7; + // #endif + } + + void ChainModifyTessellatedVertex(inout VertexData v, inout VertexToPixel v2p) + { + ExtraV2F d; + ZERO_INITIALIZE(ExtraV2F, d); + ZERO_INITIALIZE(Blackboard, d.blackboard); + + // #if %EXTRAV2F0REQUIREKEY% + // d.extraV2F0 = v2p.extraV2F0; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // d.extraV2F1 = v2p.extraV2F1; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // d.extraV2F2 = v2p.extraV2F2; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // d.extraV2F3 = v2p.extraV2F3; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // d.extraV2F4 = v2p.extraV2F4; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // d.extraV2F5 = v2p.extraV2F5; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // d.extraV2F6 = v2p.extraV2F6; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // d.extraV2F7 = v2p.extraV2F7; + // #endif + + + // Ext_ModifyTessellatedVertex0(v, d); + // Ext_ModifyTessellatedVertex1(v, d); + // Ext_ModifyTessellatedVertex2(v, d); + // Ext_ModifyTessellatedVertex3(v, d); + // Ext_ModifyTessellatedVertex4(v, d); + // Ext_ModifyTessellatedVertex5(v, d); + // Ext_ModifyTessellatedVertex6(v, d); + // Ext_ModifyTessellatedVertex7(v, d); + // Ext_ModifyTessellatedVertex8(v, d); + // Ext_ModifyTessellatedVertex9(v, d); + // Ext_ModifyTessellatedVertex10(v, d); + // Ext_ModifyTessellatedVertex11(v, d); + // Ext_ModifyTessellatedVertex12(v, d); + // Ext_ModifyTessellatedVertex13(v, d); + // Ext_ModifyTessellatedVertex14(v, d); + // Ext_ModifyTessellatedVertex15(v, d); + // Ext_ModifyTessellatedVertex16(v, d); + // Ext_ModifyTessellatedVertex17(v, d); + // Ext_ModifyTessellatedVertex18(v, d); + // Ext_ModifyTessellatedVertex19(v, d); + // Ext_ModifyTessellatedVertex20(v, d); + // Ext_ModifyTessellatedVertex21(v, d); + // Ext_ModifyTessellatedVertex22(v, d); + // Ext_ModifyTessellatedVertex23(v, d); + // Ext_ModifyTessellatedVertex24(v, d); + // Ext_ModifyTessellatedVertex25(v, d); + // Ext_ModifyTessellatedVertex26(v, d); + // Ext_ModifyTessellatedVertex27(v, d); + // Ext_ModifyTessellatedVertex28(v, d); + // Ext_ModifyTessellatedVertex29(v, d); + + // #if %EXTRAV2F0REQUIREKEY% + // v2p.extraV2F0 = d.extraV2F0; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // v2p.extraV2F1 = d.extraV2F1; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // v2p.extraV2F2 = d.extraV2F2; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // v2p.extraV2F3 = d.extraV2F3; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // v2p.extraV2F4 = d.extraV2F4; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // v2p.extraV2F5 = d.extraV2F5; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // v2p.extraV2F6 = d.extraV2F6; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // v2p.extraV2F7 = d.extraV2F7; + // #endif + } + + void ChainFinalColorForward(inout Surface l, inout ShaderData d, inout half4 color) + { + // Ext_FinalColorForward0(l, d, color); + // Ext_FinalColorForward1(l, d, color); + // Ext_FinalColorForward2(l, d, color); + // Ext_FinalColorForward3(l, d, color); + // Ext_FinalColorForward4(l, d, color); + // Ext_FinalColorForward5(l, d, color); + // Ext_FinalColorForward6(l, d, color); + // Ext_FinalColorForward7(l, d, color); + // Ext_FinalColorForward8(l, d, color); + // Ext_FinalColorForward9(l, d, color); + // Ext_FinalColorForward10(l, d, color); + // Ext_FinalColorForward11(l, d, color); + // Ext_FinalColorForward12(l, d, color); + // Ext_FinalColorForward13(l, d, color); + // Ext_FinalColorForward14(l, d, color); + // Ext_FinalColorForward15(l, d, color); + // Ext_FinalColorForward16(l, d, color); + // Ext_FinalColorForward17(l, d, color); + // Ext_FinalColorForward18(l, d, color); + // Ext_FinalColorForward19(l, d, color); + // Ext_FinalColorForward20(l, d, color); + // Ext_FinalColorForward21(l, d, color); + // Ext_FinalColorForward22(l, d, color); + // Ext_FinalColorForward23(l, d, color); + // Ext_FinalColorForward24(l, d, color); + // Ext_FinalColorForward25(l, d, color); + // Ext_FinalColorForward26(l, d, color); + // Ext_FinalColorForward27(l, d, color); + // Ext_FinalColorForward28(l, d, color); + // Ext_FinalColorForward29(l, d, color); + } + + void ChainFinalGBufferStandard(inout Surface s, inout ShaderData d, inout half4 GBuffer0, inout half4 GBuffer1, inout half4 GBuffer2, inout half4 outEmission, inout half4 outShadowMask) + { + // Ext_FinalGBufferStandard0(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard1(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard2(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard3(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard4(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard5(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard6(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard7(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard8(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard9(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard10(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard11(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard12(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard13(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard14(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard15(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard16(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard17(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard18(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard19(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard20(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard21(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard22(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard23(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard24(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard25(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard26(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard27(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard28(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard29(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + } +#endif + + + + + +#if _DECALSHADER + + ShaderData CreateShaderData(SurfaceDescriptionInputs IN) + { + ShaderData d = (ShaderData)0; + d.TBNMatrix = float3x3(IN.WorldSpaceTangent, IN.WorldSpaceBiTangent, IN.WorldSpaceNormal); + d.worldSpaceNormal = IN.WorldSpaceNormal; + d.worldSpaceTangent = IN.WorldSpaceTangent; + + d.worldSpacePosition = IN.WorldSpacePosition; + d.texcoord0 = IN.uv0.xyxy; + d.screenPos = IN.ScreenPosition; + + d.worldSpaceViewDir = normalize(_WorldSpaceCameraPos - d.worldSpacePosition); + + d.tangentSpaceViewDir = mul(d.TBNMatrix, d.worldSpaceViewDir); + + // these rarely get used, so we back transform them. Usually will be stripped. + #if _HDRP + // d.localSpacePosition = mul(GetWorldToObjectMatrix(), float4(GetCameraRelativePositionWS(d.worldSpacePosition), 1)).xyz; + #else + // d.localSpacePosition = mul(GetWorldToObjectMatrix(), float4(d.worldSpacePosition, 1)).xyz; + #endif + // d.localSpaceNormal = normalize(mul((float3x3)GetWorldToObjectMatrix(), d.worldSpaceNormal)); + // d.localSpaceTangent = normalize(mul((float3x3)GetWorldToObjectMatrix(), d.worldSpaceTangent.xyz)); + + // #if %SCREENPOSREQUIREKEY% + // d.screenUV = (IN.ScreenPosition.xy / max(0.01, IN.ScreenPosition.w)); + // #endif + + return d; + } +#else + + ShaderData CreateShaderData(VertexToPixel i + #if NEED_FACING + , bool facing + #endif + ) + { + ShaderData d = (ShaderData)0; + d.clipPos = i.pos; + d.worldSpacePosition = i.worldPos; + + d.worldSpaceNormal = normalize(i.worldNormal); + d.worldSpaceTangent.xyz = normalize(i.worldTangent.xyz); + + d.tangentSign = i.worldTangent.w * unity_WorldTransformParams.w; + float3 bitangent = cross(d.worldSpaceTangent.xyz, d.worldSpaceNormal) * d.tangentSign; + + d.TBNMatrix = float3x3(d.worldSpaceTangent, -bitangent, d.worldSpaceNormal); + d.worldSpaceViewDir = normalize(_WorldSpaceCameraPos - i.worldPos); + + d.tangentSpaceViewDir = mul(d.TBNMatrix, d.worldSpaceViewDir); + d.texcoord0 = i.texcoord0; + d.texcoord1 = i.texcoord1; + d.texcoord2 = i.texcoord2; + + // #if %TEXCOORD3REQUIREKEY% + d.texcoord3 = i.texcoord3; + // #endif + + // d.isFrontFace = facing; + // #if %VERTEXCOLORREQUIREKEY% + d.vertexColor = i.vertexColor; + // #endif + + // these rarely get used, so we back transform them. Usually will be stripped. + #if _HDRP + // d.localSpacePosition = mul(GetWorldToObjectMatrix(), float4(GetCameraRelativePositionWS(i.worldPos), 1)).xyz; + #else + // d.localSpacePosition = mul(GetWorldToObjectMatrix(), float4(i.worldPos, 1)).xyz; + #endif + // d.localSpaceNormal = normalize(mul((float3x3)GetWorldToObjectMatrix(), i.worldNormal)); + // d.localSpaceTangent = normalize(mul((float3x3)GetWorldToObjectMatrix(), i.worldTangent.xyz)); + + // #if %SCREENPOSREQUIREKEY% + // d.screenPos = i.screenPos; + // d.screenUV = (i.screenPos.xy / i.screenPos.w); + // #endif + + + // #if %EXTRAV2F0REQUIREKEY% + // d.extraV2F0 = i.extraV2F0; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // d.extraV2F1 = i.extraV2F1; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // d.extraV2F2 = i.extraV2F2; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // d.extraV2F3 = i.extraV2F3; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // d.extraV2F4 = i.extraV2F4; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // d.extraV2F5 = i.extraV2F5; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // d.extraV2F6 = i.extraV2F6; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // d.extraV2F7 = i.extraV2F7; + // #endif + + return d; + } + +#endif + + + #if _PASSSHADOW + float3 _LightDirection; + #endif + + // vertex shader + VertexToPixel Vert (VertexData v) + { + + VertexToPixel o = (VertexToPixel)0; + + UNITY_SETUP_INSTANCE_ID(v); + UNITY_TRANSFER_INSTANCE_ID(v, o); + UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o); + + +#if !_TESSELLATION_ON + ChainModifyVertex(v, o, _Time); +#endif + + o.texcoord0 = v.texcoord0; + o.texcoord1 = v.texcoord1; + o.texcoord2 = v.texcoord2; + + // #if %TEXCOORD3REQUIREKEY% + o.texcoord3 = v.texcoord3; + // #endif + + // #if %VERTEXCOLORREQUIREKEY% + o.vertexColor = v.vertexColor; + // #endif + + VertexPositionInputs vertexInput = GetVertexPositionInputs(v.vertex.xyz); + o.worldPos = TransformObjectToWorld(v.vertex.xyz); + o.worldNormal = TransformObjectToWorldNormal(v.normal); + o.worldTangent = float4(TransformObjectToWorldDir(v.tangent.xyz), v.tangent.w); + + + #if _PASSSHADOW + // Define shadow pass specific clip position for Universal + o.pos = TransformWorldToHClip(ApplyShadowBias(o.worldPos, o.worldNormal, _LightDirection)); + #if UNITY_REVERSED_Z + o.pos.z = min(o.pos.z, o.pos.w * UNITY_NEAR_CLIP_VALUE); + #else + o.pos.z = max(o.pos.z, o.pos.w * UNITY_NEAR_CLIP_VALUE); + #endif + #elif _PASSMETA + o.pos = MetaVertexPosition(float4(v.vertex.xyz, 0), v.texcoord1.xy, v.texcoord2.xy, unity_LightmapST, unity_DynamicLightmapST); + #else + o.pos = TransformWorldToHClip(o.worldPos); + #endif + + + // #if %SCREENPOSREQUIREKEY% + // o.screenPos = ComputeScreenPos(o.pos, _ProjectionParams.x); + // #endif + + #if _PASSFORWARD || _PASSGBUFFER + float2 uv1 = v.texcoord1.xy; + OUTPUT_LIGHTMAP_UV(uv1, unity_LightmapST, o.lightmapUV); + o.texcoord1.xy = uv1; + OUTPUT_SH(o.worldNormal, o.sh); + #endif + + #ifdef VARYINGS_NEED_FOG_AND_VERTEX_LIGHT + #if _BAKEDLIT + half3 vertexLight = 0; + #else + half3 vertexLight = VertexLighting(o.worldPos, o.worldNormal); + #endif + half fogFactor = ComputeFogFactor(o.pos.z); + o.fogFactorAndVertexLight = half4(fogFactor, vertexLight); + #endif + + #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR) + o.shadowCoord = GetShadowCoord(vertexInput); + #endif + + return o; + } + + + + + // fragment shader + half4 Frag (VertexToPixel IN + #ifdef _DEPTHOFFSET_ON + , out float outputDepth : SV_Depth + #endif + #if NEED_FACING + , bool facing : SV_IsFrontFace + #endif + ) : SV_Target + { + UNITY_SETUP_INSTANCE_ID(IN); + UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX(IN); + + ShaderData d = CreateShaderData(IN + #if NEED_FACING + , facing + #endif + ); + Surface l = (Surface)0; + + #ifdef _DEPTHOFFSET_ON + l.outputDepth = outputDepth; + #endif + + l.Albedo = half3(0.5, 0.5, 0.5); + l.Normal = float3(0,0,1); + l.Occlusion = 1; + l.Alpha = 1; + + ChainSurfaceFunction(l, d); + + #ifdef _DEPTHOFFSET_ON + outputDepth = l.outputDepth; + #endif + + return float4(PackNormalOctRectEncode(TransformWorldToViewDir(d.worldSpaceNormal, true)), 0.0, 0.0); + + } + + ENDHLSL + + } + + + + + + + + } + + + CustomEditor "AllIn1SpriteShaderLitMaterialInspector" +} diff --git a/Assets/Plugins/AllIn1SpriteShader/Shaders/LitShaders/AllIn1SpriteShaderLit_BetterShader_URP2020.txt.meta b/Assets/Plugins/AllIn1SpriteShader/Shaders/LitShaders/AllIn1SpriteShaderLit_BetterShader_URP2020.txt.meta new file mode 100644 index 000000000..00210da41 --- /dev/null +++ b/Assets/Plugins/AllIn1SpriteShader/Shaders/LitShaders/AllIn1SpriteShaderLit_BetterShader_URP2020.txt.meta @@ -0,0 +1,14 @@ +fileFormatVersion: 2 +guid: aa67532b31576e249a3d2c13ec2c0cf8 +TextScriptImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 156513 + packageName: All In 1 Sprite Shader + packageVersion: 4.25 + assetPath: Assets/Plugins/AllIn1SpriteShader/Shaders/LitShaders/AllIn1SpriteShaderLit_BetterShader_URP2020.txt + uploadId: 708810 diff --git a/Assets/Plugins/AllIn1SpriteShader/Shaders/LitShaders/AllIn1SpriteShaderLit_BetterShader_URP2021.txt b/Assets/Plugins/AllIn1SpriteShader/Shaders/LitShaders/AllIn1SpriteShaderLit_BetterShader_URP2021.txt new file mode 100644 index 000000000..25c28ef74 --- /dev/null +++ b/Assets/Plugins/AllIn1SpriteShader/Shaders/LitShaders/AllIn1SpriteShaderLit_BetterShader_URP2021.txt @@ -0,0 +1,14438 @@ +//////////////////////////////////////// +// Generated with Better Shaders +// +// Auto-generated shader code, don't hand edit! +// +// Unity Version: 2019.4.16f1 +// Render Pipeline: URP2021 +// Platform: WindowsEditor +//////////////////////////////////////// + + +Shader "AllIn1SpriteShader/AllIn1SpriteShaderLit_BetterShader" +{ + Properties + { + + _MainTex ("Main Texture", 2D) = "white" {} //0 + _Color("Main Color", Color) = (1,1,1,1) //1 + _Alpha("General Alpha", Range(0,1)) = 1 //2 + + _GlowColor("Glow Color", Color) = (1,1,1,1) //3 + _Glow("Glow Color Intensity", Range(0,100)) = 10 //4 + _GlowGlobal("Global Glow Intensity", Range(1,100)) = 1 //5 + [NoScaleOffset] _GlowTex("Glow Texture", 2D) = "white" {} //6 + + _FadeTex("Fade Texture", 2D) = "white" {} //7 + _FadeAmount("Fade Amount", Range(-0.1,1)) = -0.1 //8 + _FadeBurnWidth("Fade Burn Width", Range(0,1)) = 0.025 //9 + _FadeBurnTransition("Burn Transition", Range(0.01,0.5)) = 0.075 //10 + _FadeBurnColor("Fade Burn Color", Color) = (1,1,0,1) //11 + _FadeBurnTex("Fade Burn Texture", 2D) = "white" {} //12 + _FadeBurnGlow("Fade Burn Glow", Range(1,250)) = 2//13 + + _OutlineColor("Outline Base Color", Color) = (1,1,1,1) //14 + _OutlineAlpha("Outline Base Alpha", Range(0,1)) = 1 //15 + _OutlineGlow("Outline Base Glow", Range(1,100)) = 1.5 //16 + _OutlineWidth("Outline Base Width", Range(0,0.2)) = 0.004 //17 + _OutlinePixelWidth("Outline Base Pixel Width", Int) = 1 //18 + + [Space] + _OutlineTex("Outline Texture", 2D) = "white" {} //19 + _OutlineTexXSpeed("Texture scroll speed X", Range(-50,50)) = 10 //20 + _OutlineTexYSpeed("Texture scroll speed Y", Range(-50,50)) = 0 //21 + + [Space] + _OutlineDistortTex("Outline Distortion Texture", 2D) = "white" {} //22 + _OutlineDistortAmount("Outline Distortion Amount", Range(0,2)) = 0.5 //23 + _OutlineDistortTexXSpeed("Distortion scroll speed X", Range(-50,50)) = 5 //24 + _OutlineDistortTexYSpeed("Distortion scroll speed Y", Range(-50,50)) = 5 //25 + + _AlphaOutlineColor("Color", Color) = (1, 1, 1, 1) //26 + _AlphaOutlineGlow("Outline Glow", Range(1,100)) = 5 //27 + _AlphaOutlinePower("Power", Range(0, 5)) = 1 // 28 + _AlphaOutlineMinAlpha("Min Alpha", Range(0, 1)) = 0 // 29 + _AlphaOutlineBlend("Blend", Range(0, 1)) = 1 // 30 + + _GradBlend("Gradient Blend", Range(0,1)) = 1 //31 + _GradTopLeftCol("Top Color", Color) = (1,0,0,1) //32 + _GradTopRightCol("Top Color 2", Color) = (1, 1, 0, 1) //33 + _GradBotLeftCol("Bot Color", Color) = (0,0,1,1) //34 + _GradBotRightCol("Bot Color 2", Color) = (0, 1, 0, 1) //35 + + [NoScaleOffset] _ColorSwapTex("Color Swap Texture", 2D) = "black" {} //36 + [HDR] _ColorSwapRed("Red Channel", Color) = (1,1,1,1) //37 + _ColorSwapRedLuminosity("Red luminosity", Range(-1,1)) = 0.5 //38 + [HDR] _ColorSwapGreen("Green Channel", Color) = (1,1,1,1) //39 + _ColorSwapGreenLuminosity("Green luminosity", Range(-1,1)) = 0.5 //40 + [HDR] _ColorSwapBlue("Blue Channel", Color) = (1,1,1,1) //41 + _ColorSwapBlueLuminosity("Blue luminosity", Range(-1,1)) = 0.5 //42 + + _HsvShift("Hue Shift", Range(0, 360)) = 180 //43 + _HsvSaturation("Saturation", Range(0, 2)) = 1 //44 + _HsvBright("Brightness", Range(0, 2)) = 1 //45 + + _HitEffectColor("Hit Effect Color", Color) = (1,1,1,1) //46 + _HitEffectGlow("Glow Intensity", Range(1,100)) = 5 //47 + [Space] + _HitEffectBlend("Hit Effect Blend", Range(0,1)) = 1 //48 + + _NegativeAmount("Negative Amount", Range(0, 1)) = 1 //49 + + _PixelateSize("Pixelate size", Range(4,512)) = 32 //50 + + [NoScaleOffset] _ColorRampTex("Color ramp Texture", 2D) = "white" {} //51 + _ColorRampLuminosity("Color ramp luminosity", Range(-1,1)) = 0 //52 + [Toggle()] _ColorRampOutline("Affects everything?", float) = 0 //53 + + _GreyscaleLuminosity("Greyscale luminosity", Range(-1,1)) = 0 //54 + [Toggle()] _GreyscaleOutline("Affects everything?", float) = 0 //55 + _GreyscaleTintColor("Greyscale Tint Color", Color) = (1,1,1,1) //56 + + _PosterizeNumColors("Number of Colors", Range(0,100)) = 8 //57 + _PosterizeGamma("Posterize Amount", Range(0.1,10)) = 0.75 //58 + [Toggle()] _PosterizeOutline("Affects everything?", float) = 0 //59 + + _BlurIntensity("Blur Intensity", Range(0,100)) = 10 //60 + [Toggle()] _BlurHD("Blur is Low Res?", float) = 0 //61 + + _MotionBlurAngle("Motion Blur Angle", Range(-1, 1)) = 0.1 //62 + _MotionBlurDist("Motion Blur Distance", Range(-3, 3)) = 1.25 //63 + + _GhostColorBoost("Ghost Color Boost", Range(0,5)) = 1 //64 + _GhostTransparency("Ghost Transparency", Range(0,1)) = 0 //65 + + _InnerOutlineColor("Inner Outline Color", Color) = (1,0,0,1) //66 + _InnerOutlineThickness("Outline Thickness", Range(0,3)) = 1 //67 + _InnerOutlineAlpha("Inner Outline Alpha", Range(0,1)) = 1 //68 + _InnerOutlineGlow("Inner Outline Glow", Range(1,250)) = 4 //69 + + _AlphaCutoffValue("Alpha cutoff value", Range(0, 1)) = 0.25 //70 + + [Toggle()] _OnlyOutline("Only render outline?", float) = 0 //71 + [Toggle()] _OnlyInnerOutline("Only render inner outline?", float) = 0 //72 + + _HologramStripesAmount("Stripes Amount", Range(0, 1)) = 0.1 //73 + _HologramUnmodAmount("Unchanged Amount", Range(0, 1)) = 0.0 //74 + _HologramStripesSpeed("Stripes Speed", Range(-20, 20)) = 4.5 //75 + _HologramMinAlpha("Min Alpha", Range(0, 1)) = 0.1 //76 + _HologramMaxAlpha("Max Alpha", Range(0, 100)) = 0.75 //77 + + _ChromAberrAmount("ChromAberr Amount", Range(0, 1)) = 1 //78 + _ChromAberrAlpha("ChromAberr Alpha", Range(0, 1)) = 0.4 //79 + + _GlitchAmount("Glitch Amount", Range(0, 20)) = 3 //80 + + _FlickerPercent("Flicker Percent", Range(0, 1)) = 0.05 //81 + _FlickerFreq("Flicker Frequency", Range(0, 5)) = 0.2 //82 + _FlickerAlpha("Flicker Alpha", Range(0, 1)) = 0 //83 + + _ShadowX("Shadow X Axis", Range(-0.5, 0.5)) = 0.1 //84 + _ShadowY("Shadow Y Axis", Range(-0.5, 0.5)) = -0.05 //85 + _ShadowAlpha("Shadow Alpha", Range(0, 1)) = 0.5 //86 + _ShadowColor("Shadow Color", Color) = (0, 0, 0, 1) //87 + + _HandDrawnAmount("Hand Drawn Amount", Range(0, 20)) = 10 //88 + _HandDrawnSpeed("Hand Drawn Speed", Range(1, 15)) = 5 //89 + + _GrassSpeed("Speed", Range(0,50)) = 2 //90 + _GrassWind("Bend amount", Range(0,50)) = 20 //91 + [Space] + [Toggle()] _GrassManualToggle("Manually animated?", float) = 0 //92 + _GrassManualAnim("Manual Anim Value", Range(-1,1)) = 1 //93 + + _WaveAmount("Wave Amount", Range(0, 25)) = 7 //94 + _WaveSpeed("Wave Speed", Range(0, 25)) = 10 //95 + _WaveStrength("Wave Strength", Range(0, 25)) = 7.5 //96 + _WaveX("Wave X Axis", Range(0, 1)) = 0 //97 + _WaveY("Wave Y Axis", Range(0, 1)) = 0.5 //98 + + _RectSize("Rect Size", Range(1, 4)) = 1 //99 + + _OffsetUvX("X axis", Range(-1, 1)) = 0 //100 + _OffsetUvY("Y axis", Range(-1, 1)) = 0 //101 + + _ClipUvLeft("Clipping Left", Range(0, 1)) = 0 //102 + _ClipUvRight("Clipping Right", Range(0, 1)) = 0 //103 + _ClipUvUp("Clipping Up", Range(0, 1)) = 0 //104 + _ClipUvDown("Clipping Down", Range(0, 1)) = 0 //105 + + _TextureScrollXSpeed("Speed X Axis", Range(-5, 5)) = 1 //106 + _TextureScrollYSpeed("Speed Y Axis", Range(-5, 5)) = 0 //107 + + _ZoomUvAmount("Zoom Amount", Range(0.1, 5)) = 0.5 //108 + + _DistortTex("Distortion Texture", 2D) = "white" {} //109 + _DistortAmount("Distortion Amount", Range(0,2)) = 0.5 //110 + _DistortTexXSpeed("Scroll speed X", Range(-50,50)) = 5 //111 + _DistortTexYSpeed("Scroll speed Y", Range(-50,50)) = 5 //112 + + _TwistUvAmount("Twist Amount", Range(0, 3.1416)) = 1 //113 + _TwistUvPosX("Twist Pos X Axis", Range(0, 1)) = 0.5 //114 + _TwistUvPosY("Twist Pos Y Axis", Range(0, 1)) = 0.5 //115 + _TwistUvRadius("Twist Radius", Range(0, 3)) = 0.75 //116 + + _RotateUvAmount("Rotate Angle(radians)", Range(0, 6.2831)) = 0 //117 + + _FishEyeUvAmount("Fish Eye Amount", Range(0, 0.5)) = 0.35 //118 + + _PinchUvAmount("Pinch Amount", Range(0, 0.5)) = 0.35 //119 + + _ShakeUvSpeed("Shake Speed", Range(0, 20)) = 2.5 //120 + _ShakeUvX("X Multiplier", Range(0, 5)) = 1.5 //121 + _ShakeUvY("Y Multiplier", Range(0, 5)) = 1 //122 + + _ColorChangeTolerance("Tolerance", Range(0, 1)) = 0.25 //123 + _ColorChangeTarget("Color to change", Color) = (1, 0, 0, 1) //124 + [HDR] _ColorChangeNewCol("New Color", Color) = (1, 1, 0, 1) //125 + _ColorChangeLuminosity("New Color Luminosity", Range(0, 1)) = 0.0 //126 + + _RoundWaveStrength("Wave Strength", Range(0, 1)) = 0.7 //127 + _RoundWaveSpeed("Wave Speed", Range(0, 5)) = 2 //128 + + [Toggle()] _BillboardY("Billboard on both axis?", float) = 0 //129 + _ZWrite ("Depth Write", Float) = 1.0 // 130 + + _MySrcMode ("SrcMode", Float) = 5 // 131 + _MyDstMode ("DstMode", Float) = 10 // 132 + + _ShineColor("Shine Color", Color) = (1,1,1,1) // 133 + _ShineLocation("Shine Location", Range(0,1)) = 0.5 // 134 + _ShineRotate("Rotate Angle(radians)", Range(0, 6.2831)) = 0 //135 + _ShineWidth("Shine Width", Range(0.05,1)) = 0.1 // 136 + _ShineGlow("Shine Glow", Range(0,100)) = 1 // 137 + [NoScaleOffset] _ShineMask("Shine Mask", 2D) = "white" {} // 138 + + _GlitchSize("Glitch Size", Range(0.25, 5)) = 1 //139 + _HologramStripeColor("Stripes Color", Color) = (0,1,1,1) //140 + _GradBoostX("Boost X axis", Range(0.1, 5)) = 1.2 //141 + _GradBoostY("Boost Y axis", Range(0.1, 5)) = 1.2 //142 + [Toggle()] _GradIsRadial("Radial Gradient?", float) = 0 //143 + _AlphaRoundThreshold("Round Threshold", Range(0.005, 1.0)) = 0.5 //144 + _GrassRadialBend("Radial Bend", Range(0.0, 5.0)) = 0.1 //145 + + _ColorChangeTolerance2("Tolerance 2", Range(0, 1)) = 0.25 //146 + _ColorChangeTarget2("Color to change 2", Color) = (1, 0, 0, 1) //147 + [HDR] _ColorChangeNewCol2("New Color 2", Color) = (1, 1, 0, 1) //148 + _ColorChangeTolerance3("Tolerance 3", Range(0, 1)) = 0.25 //149 + _ColorChangeTarget3("Color to change 3", Color) = (1, 0, 0, 1) //150 + [HDR] _ColorChangeNewCol3("New Color 3", Color) = (1, 1, 0, 1) //151 + + _Contrast ("Contrast", Range(0, 6)) = 1 // 152 + _Brightness ("Brightness", Range(-1, 1)) = 0 // 153 + + _ColorSwapBlend ("Color Swap Blend", Range(0, 1)) = 1 // 154 + _ColorRampBlend ("Color Ramp Blend", Range(0, 1)) = 1 // 155 + _GreyscaleBlend ("Greyscale Blend", Range(0, 1)) = 1 // 156 + _GhostBlend ("Ghost Blend", Range(0, 1)) = 1 // 157 + _HologramBlend ("Hologram Blend", Range(0, 1)) = 1 // 158 + + [AllIn1ShaderGradient] _ColorRampTexGradient("Color ramp Gradient", 2D) = "white" {} //159 + + _OverlayTex("Overlay Texture", 2D) = "white" {} //160 + _OverlayColor("Overlay Color", Color) = (1, 1, 1, 1) //161 + _OverlayGlow("Overlay Glow", Range(0,25)) = 1 // 162 + _OverlayBlend("Overlay Blend", Range(0, 1)) = 1 // 163 + + _RadialStartAngle("Radial Start Angle", Range(0, 360)) = 90 //164 + _RadialClip("Radial Clip", Range(0, 360)) = 45 //165 + _RadialClip2("Radial Clip 2", Range(0, 360)) = 0 //166 + + _WarpStrength("Warp Strength", Range(0, 0.1)) = 0.025 //167 + _WarpSpeed("Warp Speed", Range(0, 25)) = 8 //168 + _WarpScale("Warp Scale", Range(0.05, 3)) = 0.5 //169 + + _OverlayTextureScrollXSpeed("Speed X Axis", Range(-5, 5)) = 0.25 //170 + _OverlayTextureScrollYSpeed("Speed Y Axis", Range(-5, 5)) = 0.25 //171 + + _ZTestMode ("Z Test Mode", Float) = 4 + _CullingOption ("Culling Option", float) = 0 + + [HideInInspector] _MinXUV("_MinXUV", Range(0, 1)) = 0.0 + [HideInInspector] _MaxXUV("_MaxXUV", Range(0, 1)) = 1.0 + [HideInInspector] _MinYUV("_MinYUV", Range(0, 1)) = 0.0 + [HideInInspector] _MaxYUV("_MaxYUV", Range(0, 1)) = 1.0 + [HideInInspector] _RandomSeed("_MaxYUV", Range(0, 10000)) = 0.0 + _EditorDrawers("Editor Drawers", Int) = 6 + + [Normal][NoScaleOffset] _NormalMap("Normal Map", 2D) = "bump" {} + _NormalStrength("Normal Strength", Range(0, 15)) = 1.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) = "" {} + } + SubShader + { + Tags { "RenderPipeline"="UniversalPipeline" "RenderType" = "Opaque" "UniversalMaterialType" = "Lit" "Queue" = "Geometry" } + + + + + Pass + { + Name "Universal Forward" + Tags + { + "LightMode" = "UniversalForward" + } + Cull Back + Blend One Zero + ZTest LEqual + ZWrite On + + Blend One Zero, One Zero +Cull Back +ZTest LEqual +ZWrite On + + Tags { "RenderType" = "Opaque" "Queue" = "Geometry" "PreviewType" = "Plane" } + Cull [_CullingOption] + ZWrite [_ZWrite] + ZTest [_ZTestMode] + + + HLSLPROGRAM + + #pragma vertex Vert + #pragma fragment Frag + + #pragma target 3.0 + + #pragma prefer_hlslcc gles + #pragma exclude_renderers d3d11_9x + #pragma multi_compile_fog + #pragma multi_compile_instancing + #pragma instancing_options renderinglayer + #pragma multi_compile _ DOTS_INSTANCING_ON + + // Keywords + #pragma multi_compile_fragment _ _SCREEN_SPACE_OCCLUSION + #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 _ _ADDITIONAL_LIGHTS_VERTEX _ADDITIONAL_LIGHTS + #pragma multi_compile_fragment _ _ADDITIONAL_LIGHT_SHADOWS + #pragma multi_compile_fragment _ _REFLECTION_PROBE_BLENDING + #pragma multi_compile_fragment _ _REFLECTION_PROBE_BOX_PROJECTION + #pragma multi_compile_fragment _ _SHADOWS_SOFT + #pragma multi_compile _ LIGHTMAP_SHADOW_MIXING + #pragma multi_compile _ SHADOWS_SHADOWMASK + #pragma multi_compile_fragment _ _DBUFFER_MRT1 _DBUFFER_MRT2 _DBUFFER_MRT3 + #pragma multi_compile_fragment _ _LIGHT_LAYERS + #pragma multi_compile_fragment _ DEBUG_DISPLAY + #pragma multi_compile_fragment _ _LIGHT_COOKIES + #pragma multi_compile _ _CLUSTERED_RENDERING + // GraphKeywords: + + #define SHADER_PASS SHADERPASS_FORWARD + #define VARYINGS_NEED_FOG_AND_VERTEX_LIGHT + #define _PASSFORWARD 1 + #define _FOG_FRAGMENT 1 + + + #pragma shader_feature_local GLOW_ON + #pragma shader_feature_local FADE_ON + #pragma shader_feature_local OUTBASE_ON + #pragma shader_feature_local ONLYOUTLINE_ON + #pragma shader_feature_local GRADIENT_ON + #pragma shader_feature_local GRADIENT2COL_ON + #pragma shader_feature_local RADIALGRADIENT_ON + #pragma shader_feature_local COLORSWAP_ON + #pragma shader_feature_local HSV_ON + #pragma shader_feature_local CHANGECOLOR_ON + #pragma shader_feature_local CHANGECOLOR2_ON + #pragma shader_feature_local CHANGECOLOR3_ON + #pragma shader_feature_local COLORRAMP_ON + #pragma shader_feature_local GRADIENTCOLORRAMP_ON + #pragma shader_feature_local HITEFFECT_ON + #pragma shader_feature_local NEGATIVE_ON + #pragma shader_feature_local PIXELATE_ON + #pragma shader_feature_local GREYSCALE_ON + #pragma shader_feature_local POSTERIZE_ON + #pragma shader_feature_local BLUR_ON + #pragma shader_feature_local MOTIONBLUR_ON + #pragma shader_feature_local GHOST_ON + #pragma shader_feature_local ALPHAOUTLINE_ON + #pragma shader_feature_local INNEROUTLINE_ON + #pragma shader_feature_local ONLYINNEROUTLINE_ON + #pragma shader_feature_local HOLOGRAM_ON + #pragma shader_feature_local CHROMABERR_ON + #pragma shader_feature_local GLITCH_ON + #pragma shader_feature_local FLICKER_ON + #pragma shader_feature_local SHADOW_ON + #pragma shader_feature_local SHINE_ON + #pragma shader_feature_local CONTRAST_ON + #pragma shader_feature_local OVERLAY_ON + #pragma shader_feature_local OVERLAYMULT_ON + #pragma shader_feature_local DOODLE_ON + #pragma shader_feature_local WIND_ON + #pragma shader_feature_local WAVEUV_ON + #pragma shader_feature_local ROUNDWAVEUV_ON + #pragma shader_feature_local RECTSIZE_ON + #pragma shader_feature_local OFFSETUV_ON + #pragma shader_feature_local CLIPPING_ON + #pragma shader_feature_local RADIALCLIPPING_ON + #pragma shader_feature_local TEXTURESCROLL_ON + #pragma shader_feature_local ZOOMUV_ON + #pragma shader_feature_local DISTORT_ON + #pragma shader_feature_local WARP_ON + #pragma shader_feature_local TWISTUV_ON + #pragma shader_feature_local ROTATEUV_ON + #pragma shader_feature_local POLARUV_ON + #pragma shader_feature_local FISHEYE_ON + #pragma shader_feature_local PINCH_ON + #pragma shader_feature_local SHAKEUV_ON + + #pragma shader_feature_local GLOWTEX_ON + #pragma shader_feature_local OUTTEX_ON + #pragma shader_feature_local OUTDIST_ON + #pragma shader_feature_local OUTBASE8DIR_ON + #pragma shader_feature_local OUTBASEPIXELPERF_ON + #pragma shader_feature_local COLORRAMPOUTLINE_ON + #pragma shader_feature_local GREYSCALEOUTLINE_ON + #pragma shader_feature_local POSTERIZEOUTLINE_ON + #pragma shader_feature_local BLURISHD_ON + #pragma shader_feature_local MANUALWIND_ON + #pragma shader_feature_local ATLAS_ON + #pragma shader_feature_local PREMULTIPLYALPHA_ON + + #pragma shader_feature BILBOARD_ON + #pragma shader_feature BILBOARDY_ON + + #pragma shader_feature NORMALMAP_ON + + + #define _URP 1 +#define _USINGTEXCOORD1 1 +#define _USINGTEXCOORD2 1 + + + // this has to be here or specular color will be ignored. Not in SG code + #if _SIMPLELIT + #define _SPECULAR_COLOR + #endif + + + // Includes + #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" + + + + + #undef WorldNormalVector + #define WorldNormalVector(data, normal) mul(normal, data.TBNMatrix) + + #define UnityObjectToWorldNormal(normal) mul(GetObjectToWorldMatrix(), normal) + + #define _WorldSpaceLightPos0 _MainLightPosition + + #define UNITY_DECLARE_TEX2D(name) TEXTURE2D(name); SAMPLER(sampler##name); + #define UNITY_DECLARE_TEX2D_NOSAMPLER(name) TEXTURE2D(name); + #define UNITY_DECLARE_TEX2DARRAY(name) TEXTURE2D_ARRAY(name); SAMPLER(sampler##name); + #define UNITY_DECLARE_TEX2DARRAY_NOSAMPLER(name) TEXTURE2D_ARRAY(name); + + #define UNITY_SAMPLE_TEX2DARRAY(tex,coord) SAMPLE_TEXTURE2D_ARRAY(tex, sampler##tex, coord.xy, coord.z) + #define UNITY_SAMPLE_TEX2DARRAY_LOD(tex,coord,lod) SAMPLE_TEXTURE2D_ARRAY_LOD(tex, sampler##tex, coord.xy, coord.z, lod) + #define UNITY_SAMPLE_TEX2D(tex, coord) SAMPLE_TEXTURE2D(tex, sampler##tex, coord) + #define UNITY_SAMPLE_TEX2D_SAMPLER(tex, samp, coord) SAMPLE_TEXTURE2D(tex, sampler##samp, coord) + + #define UNITY_SAMPLE_TEX2D_LOD(tex,coord, lod) SAMPLE_TEXTURE2D_LOD(tex, sampler_##tex, coord, lod) + #define UNITY_SAMPLE_TEX2D_SAMPLER_LOD(tex,samplertex,coord, lod) SAMPLE_TEXTURE2D_LOD (tex, sampler##samplertex,coord, lod) + + #if defined(UNITY_COMPILER_HLSL) + #define UNITY_INITIALIZE_OUTPUT(type,name) name = (type)0; + #else + #define UNITY_INITIALIZE_OUTPUT(type,name) + #endif + + #define sampler2D_float sampler2D + #define sampler2D_half sampler2D + + + + // data across stages, stripped like the above. + struct VertexToPixel + { + float4 pos : SV_POSITION; + float3 worldPos : TEXCOORD0; + float3 worldNormal : TEXCOORD1; + float4 worldTangent : TEXCOORD2; + float4 texcoord0 : TEXCOORD3; + float4 texcoord1 : TEXCOORD4; + float4 texcoord2 : TEXCOORD5; + + // #if %TEXCOORD3REQUIREKEY% + float4 texcoord3 : TEXCOORD6; + // #endif + + // #if %SCREENPOSREQUIREKEY% + // float4 screenPos : TEXCOORD7; + // #endif + + // #if %VERTEXCOLORREQUIREKEY% + half4 vertexColor : COLOR; + // #endif + + #if defined(LIGHTMAP_ON) + float2 lightmapUV : TEXCOORD8; + #endif + #if defined(DYNAMICLIGHTMAP_ON) + float2 dynamicLightmapUV : TEXCOORD9; + #endif + #if !defined(LIGHTMAP_ON) + float3 sh : TEXCOORD10; + #endif + + #if defined(VARYINGS_NEED_FOG_AND_VERTEX_LIGHT) + float4 fogFactorAndVertexLight : TEXCOORD11; + #endif + + #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR) + float4 shadowCoord : TEXCOORD12; + #endif + + // #if %EXTRAV2F0REQUIREKEY% + // float4 extraV2F0 : TEXCOORD13; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // float4 extraV2F1 : TEXCOORD14; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // float4 extraV2F2 : TEXCOORD15; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // float4 extraV2F3 : TEXCOORD16; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // float4 extraV2F4 : TEXCOORD17; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // float4 extraV2F5 : TEXCOORD18; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // float4 extraV2F6 : TEXCOORD19; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // float4 extraV2F7 : TEXCOORD20; + // #endif + + #if UNITY_ANY_INSTANCING_ENABLED + uint instanceID : CUSTOM_INSTANCE_ID; + #endif + #if (defined(UNITY_STEREO_MULTIVIEW_ENABLED)) || (defined(UNITY_STEREO_INSTANCING_ENABLED) && (defined(SHADER_API_GLES3) || defined(SHADER_API_GLCORE))) + uint stereoTargetEyeIndexAsBlendIdx0 : BLENDINDICES0; + #endif + #if (defined(UNITY_STEREO_INSTANCING_ENABLED)) + uint stereoTargetEyeIndexAsRTArrayIdx : SV_RenderTargetArrayIndex; + #endif + #if defined(SHADER_STAGE_FRAGMENT) && defined(VARYINGS_NEED_CULLFACE) + FRONT_FACE_TYPE cullFace : FRONT_FACE_SEMANTIC; + #endif + + + }; + + + + + // data describing the user output of a pixel + struct Surface + { + half3 Albedo; + half Height; + half3 Normal; + half Smoothness; + half3 Emission; + half Metallic; + half3 Specular; + half Occlusion; + half SpecularPower; // for simple lighting + half Alpha; + float outputDepth; // if written, SV_Depth semantic is used. ShaderData.clipPos.z is unused value + // HDRP Only + half SpecularOcclusion; + half SubsurfaceMask; + half Thickness; + half CoatMask; + half CoatSmoothness; + half Anisotropy; + half IridescenceMask; + half IridescenceThickness; + int DiffusionProfileHash; + float SpecularAAThreshold; + float SpecularAAScreenSpaceVariance; + // requires _OVERRIDE_BAKEDGI to be defined, but is mapped in all pipelines + float3 DiffuseGI; + float3 BackDiffuseGI; + float3 SpecularGI; + float ior; + float3 transmittanceColor; + float atDistance; + float transmittanceMask; + // requires _OVERRIDE_SHADOWMASK to be defines + float4 ShadowMask; + + // for decals + float NormalAlpha; + float MAOSAlpha; + + + }; + + // Data the user declares in blackboard blocks + struct Blackboard + { + + float blackboardDummyData; + }; + + // data the user might need, this will grow to be big. But easy to strip + struct ShaderData + { + float4 clipPos; // SV_POSITION + float3 localSpacePosition; + float3 localSpaceNormal; + float3 localSpaceTangent; + + float3 worldSpacePosition; + float3 worldSpaceNormal; + float3 worldSpaceTangent; + float tangentSign; + + float3 worldSpaceViewDir; + float3 tangentSpaceViewDir; + + float4 texcoord0; + float4 texcoord1; + float4 texcoord2; + float4 texcoord3; + + float2 screenUV; + float4 screenPos; + + float4 vertexColor; + bool isFrontFace; + + float4 extraV2F0; + float4 extraV2F1; + float4 extraV2F2; + float4 extraV2F3; + float4 extraV2F4; + float4 extraV2F5; + float4 extraV2F6; + float4 extraV2F7; + + float3x3 TBNMatrix; + Blackboard blackboard; + }; + + struct VertexData + { + #if SHADER_TARGET > 30 + // uint vertexID : SV_VertexID; + #endif + float4 vertex : POSITION; + float3 normal : NORMAL; + float4 tangent : TANGENT; + float4 texcoord0 : TEXCOORD0; + + // optimize out mesh coords when not in use by user or lighting system + #if _URP && (_USINGTEXCOORD1 || _PASSMETA || _PASSFORWARD || _PASSGBUFFER) + float4 texcoord1 : TEXCOORD1; + #endif + + #if _URP && (_USINGTEXCOORD2 || _PASSMETA || ((_PASSFORWARD || _PASSGBUFFER) && defined(DYNAMICLIGHTMAP_ON))) + float4 texcoord2 : TEXCOORD2; + #endif + + #if _STANDARD && (_USINGTEXCOORD1 || (_PASSMETA || ((_PASSFORWARD || _PASSGBUFFER || _PASSFORWARDADD) && LIGHTMAP_ON))) + float4 texcoord1 : TEXCOORD1; + #endif + #if _STANDARD && (_USINGTEXCOORD2 || (_PASSMETA || ((_PASSFORWARD || _PASSGBUFFER) && DYNAMICLIGHTMAP_ON))) + float4 texcoord2 : TEXCOORD2; + #endif + + + #if _HDRP + float4 texcoord1 : TEXCOORD1; + float4 texcoord2 : TEXCOORD2; + #endif + + // #if %TEXCOORD3REQUIREKEY% + float4 texcoord3 : TEXCOORD3; + // #endif + + // #if %VERTEXCOLORREQUIREKEY% + float4 vertexColor : COLOR; + // #endif + + #if _PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR)) + float3 previousPositionOS : TEXCOORD4; // Contain previous transform position (in case of skinning for example) + #if defined (_ADD_PRECOMPUTED_VELOCITY) + float3 precomputedVelocity : TEXCOORD5; // Add Precomputed Velocity (Alembic computes velocities on runtime side). + #endif + #endif + + UNITY_VERTEX_INPUT_INSTANCE_ID + }; + + struct TessVertex + { + float4 vertex : INTERNALTESSPOS; + float3 normal : NORMAL; + float4 tangent : TANGENT; + float4 texcoord0 : TEXCOORD0; + float4 texcoord1 : TEXCOORD1; + float4 texcoord2 : TEXCOORD2; + + // #if %TEXCOORD3REQUIREKEY% + float4 texcoord3 : TEXCOORD3; + // #endif + + // #if %VERTEXCOLORREQUIREKEY% + float4 vertexColor : COLOR; + // #endif + + // #if %EXTRAV2F0REQUIREKEY% + // float4 extraV2F0 : TEXCOORD5; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // float4 extraV2F1 : TEXCOORD6; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // float4 extraV2F2 : TEXCOORD7; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // float4 extraV2F3 : TEXCOORD8; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // float4 extraV2F4 : TEXCOORD9; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // float4 extraV2F5 : TEXCOORD10; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // float4 extraV2F6 : TEXCOORD11; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // float4 extraV2F7 : TEXCOORD12; + // #endif + + #if _PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR)) + float3 previousPositionOS : TEXCOORD13; // Contain previous transform position (in case of skinning for example) + #if defined (_ADD_PRECOMPUTED_VELOCITY) + float3 precomputedVelocity : TEXCOORD14; + #endif + #endif + + UNITY_VERTEX_INPUT_INSTANCE_ID + UNITY_VERTEX_OUTPUT_STEREO + }; + + struct ExtraV2F + { + float4 extraV2F0; + float4 extraV2F1; + float4 extraV2F2; + float4 extraV2F3; + float4 extraV2F4; + float4 extraV2F5; + float4 extraV2F6; + float4 extraV2F7; + Blackboard blackboard; + float4 time; + }; + + + float3 WorldToTangentSpace(ShaderData d, float3 normal) + { + return mul(d.TBNMatrix, normal); + } + + float3 TangentToWorldSpace(ShaderData d, float3 normal) + { + return mul(normal, d.TBNMatrix); + } + + // in this case, make standard more like SRPs, because we can't fix + // unity_WorldToObject in HDRP, since it already does macro-fu there + + #if _STANDARD + float3 TransformWorldToObject(float3 p) { return mul(unity_WorldToObject, float4(p, 1)); }; + float3 TransformObjectToWorld(float3 p) { return mul(unity_ObjectToWorld, float4(p, 1)); }; + float4 TransformWorldToObject(float4 p) { return mul(unity_WorldToObject, p); }; + float4 TransformObjectToWorld(float4 p) { return mul(unity_ObjectToWorld, p); }; + float4x4 GetWorldToObjectMatrix() { return unity_WorldToObject; } + float4x4 GetObjectToWorldMatrix() { return unity_ObjectToWorld; } + #if (defined(SHADER_API_D3D11) || defined(SHADER_API_XBOXONE) || defined(UNITY_COMPILER_HLSLCC) || defined(SHADER_API_PSSL) || (SHADER_TARGET_SURFACE_ANALYSIS && !SHADER_TARGET_SURFACE_ANALYSIS_MOJOSHADER)) + #define UNITY_SAMPLE_TEX2D_LOD(tex,coord, lod) tex.SampleLevel (sampler##tex,coord, lod) + #define UNITY_SAMPLE_TEX2D_SAMPLER_LOD(tex,samplertex,coord, lod) tex.SampleLevel (sampler##samplertex,coord, lod) + #else + #define UNITY_SAMPLE_TEX2D_LOD(tex,coord,lod) tex2D (tex,coord,0,lod) + #define UNITY_SAMPLE_TEX2D_SAMPLER_LOD(tex,samplertex,coord,lod) tex2D (tex,coord,0,lod) + #endif + + #undef GetWorldToObjectMatrix() + + #define GetWorldToObjectMatrix() unity_WorldToObject + + + #endif + + float3 GetCameraWorldPosition() + { + #if _HDRP + return GetCameraRelativePositionWS(_WorldSpaceCameraPos); + #else + return _WorldSpaceCameraPos; + #endif + } + + #if _GRABPASSUSED + #if _STANDARD + TEXTURE2D(%GRABTEXTURE%); + SAMPLER(sampler_%GRABTEXTURE%); + #endif + + half3 GetSceneColor(float2 uv) + { + #if _STANDARD + return SAMPLE_TEXTURE2D(%GRABTEXTURE%, sampler_%GRABTEXTURE%, uv).rgb; + #else + return SHADERGRAPH_SAMPLE_SCENE_COLOR(uv); + #endif + } + #endif + + + + #if _STANDARD + UNITY_DECLARE_DEPTH_TEXTURE(_CameraDepthTexture); + float GetSceneDepth(float2 uv) { return SAMPLE_DEPTH_TEXTURE(_CameraDepthTexture, uv); } + float GetLinear01Depth(float2 uv) { return Linear01Depth(GetSceneDepth(uv)); } + float GetLinearEyeDepth(float2 uv) { return LinearEyeDepth(GetSceneDepth(uv)); } + #else + float GetSceneDepth(float2 uv) { return SHADERGRAPH_SAMPLE_SCENE_DEPTH(uv); } + float GetLinear01Depth(float2 uv) { return Linear01Depth(GetSceneDepth(uv), _ZBufferParams); } + float GetLinearEyeDepth(float2 uv) { return LinearEyeDepth(GetSceneDepth(uv), _ZBufferParams); } + #endif + + float3 GetWorldPositionFromDepthBuffer(float2 uv, float3 worldSpaceViewDir) + { + float eye = GetLinearEyeDepth(uv); + float3 camView = mul((float3x3)GetObjectToWorldMatrix(), transpose(mul(GetWorldToObjectMatrix(), UNITY_MATRIX_I_V)) [2].xyz); + + float dt = dot(worldSpaceViewDir, camView); + float3 div = worldSpaceViewDir/dt; + float3 wpos = (eye * div) + GetCameraWorldPosition(); + return wpos; + } + + #if _HDRP + float3 ObjectToWorldSpacePosition(float3 pos) + { + return GetAbsolutePositionWS(TransformObjectToWorld(pos)); + } + #else + float3 ObjectToWorldSpacePosition(float3 pos) + { + return TransformObjectToWorld(pos); + } + #endif + + #if _STANDARD + UNITY_DECLARE_SCREENSPACE_TEXTURE(_CameraDepthNormalsTexture); + float3 GetSceneNormal(float2 uv, float3 worldSpaceViewDir) + { + float4 depthNorms = UNITY_SAMPLE_SCREENSPACE_TEXTURE(_CameraDepthNormalsTexture, uv); + float3 norms = DecodeViewNormalStereo(depthNorms); + norms = mul((float3x3)GetWorldToViewMatrix(), norms) * 0.5 + 0.5; + return norms; + } + #elif _HDRP && !_DECALSHADER + + float3 GetSceneNormal(float2 uv, float3 worldSpaceViewDir) + { + NormalData nd; + DecodeFromNormalBuffer(_ScreenSize.xy * uv, nd); + return nd.normalWS; + } + #elif _URP + #if (SHADER_LIBRARY_VERSION_MAJOR >= 10) + #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/DeclareNormalsTexture.hlsl" + #endif + + float3 GetSceneNormal(float2 uv, float3 worldSpaceViewDir) + { + #if (SHADER_LIBRARY_VERSION_MAJOR >= 10) + return SampleSceneNormals(uv); + #else + float3 wpos = GetWorldPositionFromDepthBuffer(uv, worldSpaceViewDir); + return normalize(-cross(ddx(wpos), ddy(wpos))) * 0.5 + 0.5; + #endif + + } + #endif + + #if _HDRP + + half3 UnpackNormalmapRGorAG(half4 packednormal) + { + // This do the trick + packednormal.x *= packednormal.w; + + half3 normal; + normal.xy = packednormal.xy * 2 - 1; + normal.z = sqrt(1 - saturate(dot(normal.xy, normal.xy))); + return normal; + } + half3 UnpackNormal(half4 packednormal) + { + #if defined(UNITY_NO_DXT5nm) + return packednormal.xyz * 2 - 1; + #else + return UnpackNormalmapRGorAG(packednormal); + #endif + } + #endif + #if _HDRP || _URP + + half3 UnpackScaleNormal(half4 packednormal, half scale) + { + #ifndef UNITY_NO_DXT5nm + // Unpack normal as DXT5nm (1, y, 1, x) or BC5 (x, y, 0, 1) + // Note neutral texture like "bump" is (0, 0, 1, 1) to work with both plain RGB normal and DXT5nm/BC5 + packednormal.x *= packednormal.w; + #endif + half3 normal; + normal.xy = (packednormal.xy * 2 - 1) * scale; + normal.z = sqrt(1 - saturate(dot(normal.xy, normal.xy))); + return normal; + } + + #endif + + + void GetSun(out float3 lightDir, out float3 color) + { + lightDir = float3(0.5, 0.5, 0); + color = 1; + #if _HDRP + if (_DirectionalLightCount > 0) + { + DirectionalLightData light = _DirectionalLightDatas[0]; + lightDir = -light.forward.xyz; + color = light.color; + } + #elif _STANDARD + lightDir = normalize(_WorldSpaceLightPos0.xyz); + color = _LightColor0.rgb; + #elif _URP + Light light = GetMainLight(); + lightDir = light.direction; + color = light.color; + #endif + } + + + + CBUFFER_START(UnityPerMaterial) + + + half4 _Color; + half4 _MainTex_ST, _MainTex_TexelSize; + half _Alpha, _AlphaCutoffValue; + + #if ATLAS_ON + half _MinXUV, _MaxXUV, _MinYUV, _MaxYUV; + #endif + + #if GLOW_ON + half4 _GlowColor; + half _Glow, _GlowGlobal; + #endif + + #if HSV_ON + half _HsvShift, _HsvSaturation, _HsvBright; + #endif + + #if DISTORT_ON + half4 _DistortTex_ST; + half _DistortTexXSpeed, _DistortTexYSpeed, _DistortAmount; + #endif + + #if FADE_ON + half4 _FadeBurnColor, _FadeTex_ST, _FadeBurnTex_ST; + half _FadeAmount, _FadeBurnWidth, _FadeBurnTransition,_FadeBurnGlow; + #endif + + #if OUTBASE_ON + half4 _OutlineColor; + half _OutlineAlpha, _OutlineGlow, _OutlineWidth; + int _OutlinePixelWidth; + #endif + + #if OUTTEX_ON + half4 _OutlineTex_ST; + half _OutlineTexXSpeed, _OutlineTexYSpeed; + #endif + + #if OUTDIST_ON + half4 _OutlineDistortTex_ST; + half _OutlineDistortTexXSpeed, _OutlineDistortTexYSpeed, _OutlineDistortAmount; + #endif + + #if ALPHAOUTLINE_ON + half _AlphaOutlineGlow, _AlphaOutlinePower, _AlphaOutlineMinAlpha, _AlphaOutlineBlend; + half4 _AlphaOutlineColor; + #endif + + #if INNEROUTLINE_ON + half _InnerOutlineThickness, _InnerOutlineAlpha, _InnerOutlineGlow; + half4 _InnerOutlineColor; + #endif + + #if GRADIENT_ON + half _GradBlend, _GradBoostX, _GradBoostY; + half4 _GradTopRightCol, _GradTopLeftCol, _GradBotRightCol, _GradBotLeftCol; + #endif + + #if COLORSWAP_ON + half4 _ColorSwapRed, _ColorSwapGreen, _ColorSwapBlue; + half _ColorSwapRedLuminosity, _ColorSwapGreenLuminosity, _ColorSwapBlueLuminosity, _ColorSwapBlend; + #endif + + #if CHANGECOLOR_ON + half4 _ColorChangeNewCol, _ColorChangeTarget; + half _ColorChangeTolerance, _ColorChangeLuminosity; + #endif + #if CHANGECOLOR2_ON + half4 _ColorChangeNewCol2, _ColorChangeTarget2; + half _ColorChangeTolerance2; + #endif + #if CHANGECOLOR3_ON + half4 _ColorChangeNewCol3, _ColorChangeTarget3; + half _ColorChangeTolerance3; + #endif + + #if COLORRAMP_ON + half _ColorRampLuminosity, _ColorRampBlend; + #endif + + #if HITEFFECT_ON + half4 _HitEffectColor; + half _HitEffectGlow, _HitEffectBlend; + #endif + + #if NEGATIVE_ON + half _NegativeAmount; + #endif + + #if PIXELATE_ON + half _PixelateSize; + #endif + + #if GREYSCALE_ON + half _GreyscaleLuminosity, _GreyscaleBlend; + half4 _GreyscaleTintColor; + #endif + + #if POSTERIZE_ON + half _PosterizeNumColors, _PosterizeGamma; + #endif + + #if BLUR_ON + half _BlurIntensity; + #endif + + #if MOTIONBLUR_ON + half _MotionBlurAngle, _MotionBlurDist; + #endif + + #if GHOST_ON + half _GhostColorBoost, _GhostTransparency, _GhostBlend; + #endif + + #if HOLOGRAM_ON + half _HologramStripesAmount, _HologramMinAlpha, _HologramUnmodAmount, _HologramStripesSpeed, _HologramMaxAlpha, _HologramBlend; + half4 _HologramStripeColor; + #endif + + #if CHROMABERR_ON + half _ChromAberrAmount, _ChromAberrAlpha; + #endif + + #if GLITCH_ON + half _GlitchAmount, _GlitchSize; + #endif + + #if FLICKER_ON + half _FlickerFreq, _FlickerPercent, _FlickerAlpha; + #endif + + #if SHADOW_ON + half _ShadowX, _ShadowY, _ShadowAlpha; + half4 _ShadowColor; + #endif + + #if SHINE_ON + half4 _ShineColor; + half _ShineLocation, _ShineRotate, _ShineWidth, _ShineGlow; + #endif + + #if CONTRAST_ON + half _Contrast, _Brightness; + #endif + + #if OVERLAY_ON + half4 _OverlayTex_ST, _OverlayColor; + half _OverlayGlow, _OverlayBlend, _OverlayTextureScrollXSpeed, _OverlayTextureScrollYSpeed; + #endif + + #if DOODLE_ON + half _HandDrawnAmount, _HandDrawnSpeed; + #endif + + #if WIND_ON + half _GrassSpeed, _GrassWind, _GrassManualAnim, _GrassRadialBend; + #endif + + #if WAVEUV_ON + float _WaveAmount, _WaveSpeed, _WaveStrength, _WaveX, _WaveY; + #endif + + #if ROUNDWAVEUV_ON + half _RoundWaveStrength, _RoundWaveSpeed; + #endif + + #if RECTSIZE_ON + half _RectSize; + #endif + + #if OFFSETUV_ON + half _OffsetUvX, _OffsetUvY; + #endif + + #if CLIPPING_ON + half _ClipUvLeft, _ClipUvRight, _ClipUvUp, _ClipUvDown; + #endif + + #if RADIALCLIPPING_ON + half _RadialStartAngle, _RadialClip, _RadialClip2; + #endif + + #if TEXTURESCROLL_ON + half _TextureScrollXSpeed, _TextureScrollYSpeed; + #endif + + #if ZOOMUV_ON + half _ZoomUvAmount; + #endif + + #if WARP_ON + half _WarpStrength, _WarpSpeed, _WarpScale; + #endif + + #if TWISTUV_ON + half _TwistUvAmount, _TwistUvPosX, _TwistUvPosY, _TwistUvRadius; + #endif + + #if ROTATEUV_ON + half _RotateUvAmount; + #endif + + #if FISHEYE_ON + half _FishEyeUvAmount; + #endif + + #if PINCH_ON + half _PinchUvAmount; + #endif + + #if SHAKEUV_ON + half _ShakeUvSpeed, _ShakeUvX, _ShakeUvY; + #endif + + #if NORMALMAP_ON + half _NormalStrength; + #endif + + float _RandomSeed; + + + + + CBUFFER_END + + + + + + + + TEXTURE2D(_MainTex); + SAMPLER(sampler_MainTex); + + #if GLOW_ON + TEXTURE2D(_GlowTex); + SAMPLER(sampler_GlowTex); + #endif + + #if FADE_ON + TEXTURE2D(_FadeTex); + SAMPLER(sampler_FadeTex); + + TEXTURE2D(_FadeBurnTex); + SAMPLER(sampler_FadeBurnTex); + #endif + + #if DISTORT_ON + TEXTURE2D(_DistortTex); + SAMPLER(sampler_DistortTex); + #endif + + #if OUTTEX_ON + TEXTURE2D(_OutlineTex); + SAMPLER(sampler_OutlineTex); + #endif + + #if OUTDIST_ON + TEXTURE2D(_OutlineDistortTex); + SAMPLER(sampler_OutlineDistortTex); + #endif + + #if COLORSWAP_ON + TEXTURE2D(_ColorSwapTex); + SAMPLER(sampler_ColorSwapTex); + #endif + + #if COLORRAMP_ON + TEXTURE2D(_ColorRampTex); + TEXTURE2D(_ColorRampTexGradient); + SAMPLER(sampler_ColorRampTex); + SAMPLER(sampler_ColorRampTexGradient); + #endif + + #if SHINE_ON + TEXTURE2D(_ShineMask); + SAMPLER(sampler_ShineMask); + #endif + + #if OVERLAY_ON + TEXTURE2D(_OverlayTex); + SAMPLER(sampler_OverlayTex); + #endif + + #if NORMALMAP_ON + TEXTURE2D(_NormalMap); + SAMPLER(sampler_NormalMap); + #endif + + + half3 GetPixel(in int offsetX, in int offsetY, in half2 uv, in Texture2D _tex, in SamplerState _sampler) + { + half2 _uv = uv + half2(offsetX * _MainTex_TexelSize.x, offsetY * _MainTex_TexelSize.y); + half4 col = SAMPLE_TEXTURE2D(_tex, _sampler, _uv); + return col.rgb; + } + + + //BLURS------------------------------------------------------------------------- + half4 Blur(half2 uv, Texture2D source, SamplerState sampler_source, half Intensity) + { + const half2 texelSize = 1.0 / _ScreenParams.xy; + const half4 color = SAMPLE_TEXTURE2D(source, sampler_source, uv); + const half2 offset = Intensity * texelSize; + + half4 accumulatedColor = color; + half accumulatedWeight = 1.0; + for (int x = -1; x <= 1; x++) + { + for (int y = -1; y <= 1; y++) + { + const half2 sampleUV = uv + half2(x, y) * offset; + const half4 sampleColor = SAMPLE_TEXTURE2D(source, sampler_source, sampleUV); + + accumulatedColor += sampleColor; + accumulatedWeight += 1.0; + } + } + + half4 blurredColor = accumulatedColor / accumulatedWeight; + return blurredColor; + } + + half BlurHD_G(half bhqp, half x) + { + return exp(-(x * x) / (2.0 * bhqp * bhqp)); + } + half4 BlurHD(half2 uv, Texture2D source, SamplerState sampler_source, half BlurAmount, half xScale, half yScale) + { + int iterations = 16; + int halfIterations = iterations / 2; + half sigmaX = 0.1 + BlurAmount * 0.5; + half sigmaY = sigmaX; + half total = 0.0; + half4 ret = half4(0, 0, 0, 0); + for (int iy = 0; iy < iterations; ++iy) + { + half fy = BlurHD_G(sigmaY, half(iy) -half(halfIterations)); + half offsetY = half(iy - halfIterations) * 0.00390625 * xScale; + for (int ix = 0; ix < iterations; ++ix) + { + half fx = BlurHD_G(sigmaX, half(ix) - half(halfIterations)); + half offsetX = half(ix - halfIterations) * 0.00390625 * yScale; + total += fx * fy; + ret += SAMPLE_TEXTURE2D(source, sampler_source, uv + half2(offsetX, offsetY)) * fx * fy; + } + } + return ret / total; + } + //----------------------------------------------------------------------- + + + //------------------------------------------- + half RemapFloat(half inValue, half inMin, half inMax, half outMin, half outMax){ + return outMin + (inValue - inMin) * (outMax - outMin) / (inMax - inMin); + } + //------------------------------------------- + + //----------------------------------------------------------------------- + half rand(half2 seed, half offset) { + return (frac(sin(dot(seed, half2(12.9898, 78.233))) * 43758.5453) + offset) % 1.0; + } + + half rand2(half2 seed, half offset) { + return (frac(sin(dot(seed * floor(50 + (_Time.x % 1.0) * 12.), half2(127.1, 311.7))) * 43758.5453123) + offset) % 1.0; + } + + half rand2CustomTime(half2 seed, half offset, half customTime) { + return (frac(sin(dot(seed * floor(50 + (customTime % 1.0) * 12.), half2(127.1, 311.7))) * 43758.5453123) + offset) % 1.0; + } + //----------------------------------------------------------------------- + + + void Ext_ModifyVertex0 (inout VertexData v, inout ExtraV2F d) + { + //BILBOARD_ON + #if BILBOARD_ON + half3 camRight = mul((half3x3)unity_CameraToWorld, half3(1,0,0)); + half3 camUp = half3(0,1,0); + #if BILBOARDY_ON + camUp = mul((half3x3)unity_CameraToWorld, half3(0,1,0)); + #endif + half3 localPos = v.vertex.x * camRight + v.vertex.y * camUp; + v.vertex = half4(localPos, 1); + #endif + //----------------------------------------------------------- + + v.texcoord0.xy = TRANSFORM_TEX(v.texcoord0.xy, _MainTex); + half2 center = half2(0.5, 0.5); + #if ATLAS_ON + center = half2((_MaxXUV + _MinXUV) / 2.0, (_MaxYUV + _MinYUV) / 2.0); + #endif + + //POLARUV_ON + #if POLARUV_ON + v.texcoord0.xy = v.texcoord0.xy - center; + #endif + + //---------------------------------------- + + //ROTATEUV_ON + #if ROTATEUV_ON + half2 uvC = v.texcoord0.xy; + half cosAngle = cos(_RotateUvAmount); + half sinAngle = sin(_RotateUvAmount); + half2x2 rot = half2x2(cosAngle, -sinAngle, sinAngle, cosAngle); + uvC -= center; + v.texcoord0.xy = mul(rot, uvC); + v.texcoord0.xy += center; + #endif + //-------------------- + + #if RECTSIZE_ON + v.vertex.xyz += (v.vertex.xyz * (_RectSize - 1.0)); + #endif + + #if OUTTEX_ON + v.texcoord1.xy = TRANSFORM_TEX(v.texcoord0.xy, _OutlineTex); + #endif + + #if OUTDIST_ON + v.texcoord2.xy = TRANSFORM_TEX(v.texcoord0.xy, _OutlineDistortTex); + #endif + + #if DISTORT_ON + v.texcoord3.xy = TRANSFORM_TEX(v.texcoord0.xy, _DistortTex); + #endif + } + + void Ext_SurfaceFunction0 (inout Surface o, ShaderData d) + { + half randomSeed = _RandomSeed; + + float2 uvRect = d.texcoord0; + half2 center = half2(0.5, 0.5); + #if ATLAS_ON + center = half2((_MaxXUV + _MinXUV) / 2.0, (_MaxYUV + _MinYUV) / 2.0); + uvRect = half2((d.texcoord0.x - _MinXUV) / (_MaxXUV - _MinXUV), (d.texcoord0.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half2 centerTiled = half2(center.x * _MainTex_ST.x, center.y * _MainTex_ST.y); + + //CLIPPING_ON + #if CLIPPING_ON + half2 tiledUv = half2(d.texcoord0.x / _MainTex_ST.x, d.texcoord0.y / _MainTex_ST.y); + #if ATLAS_ON + tiledUv = half2((tiledUv.x - _MinXUV) / (_MaxXUV - _MinXUV), (tiledUv.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + clip((1 - _ClipUvUp) - tiledUv.y); + clip(tiledUv.y - _ClipUvDown); + clip((1 - _ClipUvRight) - tiledUv.x); + clip(tiledUv.x - _ClipUvLeft); + #endif + //---------------------------------- + + //RADIALCLIPPING_ON + #if RADIALCLIPPING_ON + half2 tiledUv2 = half2(d.texcoord0.x / _MainTex_ST.x, d.texcoord0.y / _MainTex_ST.y); + #if ATLAS_ON + tiledUv2 = half2((tiledUv2.x - _MinXUV) / (_MaxXUV - _MinXUV), (tiledUv2.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half startAngle = _RadialStartAngle - _RadialClip; + half endAngle = _RadialStartAngle + _RadialClip2; + half offset0 = clamp(0, 360, startAngle + 360); + half offset360 = clamp(0, 360, endAngle - 360); + half2 atan2Coord = half2(lerp(-1, 1, tiledUv2.x), lerp(-1, 1, tiledUv2.y)); + half atanAngle = atan2(atan2Coord.y, atan2Coord.x) * 57.3; // angle in degrees + if(atanAngle < 0) atanAngle = 360 + atanAngle; + if(atanAngle >= startAngle && atanAngle <= endAngle) discard; + if(atanAngle <= offset360) discard; + if(atanAngle >= offset0) discard; + #endif + + //----------------------------- + + //TEXTURESCROLL_ON && ATLAS_ON + #if TEXTURESCROLL_ON && ATLAS_ON + d.texcoord0.xy = half2(_MinXUV + ((_MaxXUV - _MinXUV) * (abs(((_Time.y + randomSeed) * _TextureScrollXSpeed) + uvRect.x) % 1)), + _MinYUV + ((_MaxYUV - _MinYUV) * (abs(((_Time.y + randomSeed) * _TextureScrollYSpeed) + uvRect.y) % 1))); + #endif + //---------------------------- + + //OFFSETUV_ON + #if OFFSETUV_ON + #if ATLAS_ON + d.texcoord0.xy = half2(_MinXUV + ((_MaxXUV - _MinXUV) * (abs((_OffsetUvX + uvRect.x) % 1))), + _MinYUV + ((_MaxYUV - _MinYUV) * (abs(_OffsetUvY + uvRect.y) % 1))); + #else + d.texcoord0.xy += half2(_OffsetUvX, _OffsetUvY); + #endif + #endif + + //---------------------- + + //POLARUV_ON + #if POLARUV_ON + d.texcoord0.xy = half2(atan2(d.texcoord0.y, d.texcoord0.x) / (2.0f * 3.141592653589f), length(d.texcoord0.xy)); + d.texcoord0.xy *= _MainTex_ST.xy; + #endif + + //-------------------------------------- + + //TWISTUV_ON + #if TWISTUV_ON + #if ATLAS_ON + _TwistUvPosX = ((_MaxXUV - _MinXUV) * _TwistUvPosX) + _MinXUV; + _TwistUvPosY = ((_MaxYUV - _MinYUV) * _TwistUvPosY) + _MinYUV; + #endif + half2 tempUv = d.texcoord0.xy - half2(_TwistUvPosX * _MainTex_ST.x, _TwistUvPosY * _MainTex_ST.y); + _TwistUvRadius *= (_MainTex_ST.x + _MainTex_ST.y) / 2; + half percent = (_TwistUvRadius - length(tempUv)) / _TwistUvRadius; + half theta = percent * percent * (2.0 * sin(_TwistUvAmount)) * 8.0; + half s = sin(theta); + half c = cos(theta); + half beta = max(sign(_TwistUvRadius - length(tempUv)), 0.0); + tempUv = half2(dot(tempUv, half2(c, -s)), dot(tempUv, half2(s, c))) * beta + tempUv * (1 - beta); + tempUv += half2(_TwistUvPosX * _MainTex_ST.x, _TwistUvPosY * _MainTex_ST.y); + d.texcoord0.xy = tempUv; + #endif + + //-------------------------------------------- + + //FISHEYE_ON + #if FISHEYE_ON + half bind = length(centerTiled); + half2 dF = d.texcoord0.xy - centerTiled; + half dFlen = length(dF); + half fishInt = (3.14159265359 / bind) * (_FishEyeUvAmount + 0.001); + d.texcoord0.xy = centerTiled + (dF / (max(0.0001, dFlen))) * tan(dFlen * fishInt) * bind / tan(bind * fishInt); + #endif + //--------------------------------------------- + + //PINCH_ON + #if PINCH_ON + half2 dP = d.texcoord0.xy - centerTiled; + half pinchInt = (3.141592 / length(centerTiled)) * (-_PinchUvAmount + 0.001); + d.texcoord0.xy = centerTiled + normalize(dP) * atan(length(dP) * -pinchInt * 10.0) * 0.5 / atan(-pinchInt * 5); + #endif + + //--------------------------------------------- + + //ZOOMUV_ON + #if ZOOMUV_ON + d.texcoord0.xy -= centerTiled; + d.texcoord0.xy = d.texcoord0.xy * _ZoomUvAmount; + d.texcoord0.xy += centerTiled; + #endif + + //----------------------------------------------- + + //DOODLE_ON + #if DOODLE_ON + half2 uvCopy = uvRect; + _HandDrawnSpeed = (floor((_Time.x + randomSeed) * 20 * _HandDrawnSpeed) / _HandDrawnSpeed) * _HandDrawnSpeed; + uvCopy.x = sin((uvCopy.x * _HandDrawnAmount + _HandDrawnSpeed) * 4); + uvCopy.y = cos((uvCopy.y * _HandDrawnAmount + _HandDrawnSpeed) * 4); + d.texcoord0.xy = lerp(d.texcoord0.xy, d.texcoord0.xy + uvCopy, 0.0005 * _HandDrawnAmount); + #endif + + //-------------------------- + + //SHAKEUV_ON + #if SHAKEUV_ON + half xShake = sin((_Time.x + randomSeed) * _ShakeUvSpeed * 50) * _ShakeUvX; + half yShake = cos((_Time.x + randomSeed) * _ShakeUvSpeed * 50) * _ShakeUvY; + d.texcoord0.xy += half2(xShake * 0.012, yShake * 0.01); + #endif + + //------------------------------------------- + + //RECTSIZE_ON + #if RECTSIZE_ON + d.texcoord0.xy = d.texcoord0.xy * (_RectSize).xx + (((-_RectSize * 0.5) + 0.5)).xx; + #endif + + //------------------------------------------- + + //DISTORT_ON + #if DISTORT_ON + #if ATLAS_ON + d.texcoord3.x = d.texcoord3.x * (1 / (_MaxXUV - _MinXUV)); + d.texcoord3.y = d.texcoord3.y * (1 / (_MaxYUV - _MinYUV)); + #endif + + d.texcoord3.x += ((_Time.x + _RandomSeed) * _DistortTexXSpeed) % 1; + d.texcoord3.y += ((_Time.x + _RandomSeed) * _DistortTexYSpeed) % 1; + half distortAmnt = (SAMPLE_TEXTURE2D(_DistortTex, sampler_DistortTex, d.texcoord3.xy).r - 0.5) * 0.2 * _DistortAmount; + d.texcoord0.x += distortAmnt; + d.texcoord0.y += distortAmnt; + #endif + //------------------------------------------------------- + + //WARP_ON + #if WARP_ON + half2 warpUv = half2(d.texcoord0.x / _MainTex_ST.x, d.texcoord0.y / _MainTex_ST.y); + #if ATLAS_ON + warpUv = half2((warpUv.x - _MinXUV) / (_MaxXUV - _MinXUV), (warpUv.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + const float tau = 6.283185307179586; + float xWarp = (_Time.y + randomSeed) * _WarpSpeed + warpUv.x * tau / _WarpScale; + float yWarp = (_Time.y + randomSeed) * _WarpSpeed + warpUv.y * tau / _WarpScale; + float2 warp = float2(sin(xWarp), sin(yWarp)) * _WarpStrength; + d.texcoord0.xy += warp; + #endif + + //------------------------------------------------------- + + //WAVEUV_ON + #if WAVEUV_ON + float2 uvWave = half2(_WaveX * _MainTex_ST.x, _WaveY * _MainTex_ST.y) - d.texcoord0.xy; + uvWave %= 1; + #if ATLAS_ON + uvWave = half2(_WaveX, _WaveY) - uvRect; + #endif + uvWave.x *= _ScreenParams.x / _ScreenParams.y; + float waveTime = _Time.y + randomSeed; + float angWave = (sqrt(dot(uvWave, uvWave)) * _WaveAmount) - ((waveTime * _WaveSpeed)); + d.texcoord0.xy = d.texcoord0.xy + uvWave * sin(angWave) * (_WaveStrength / 1000.0); + #endif + //---------------------------------------------------- + + //ROUNDWAVEUV_ON + #if ROUNDWAVEUV_ON + half xWave = ((0.5 * _MainTex_ST.x) - uvRect.x); + half yWave = ((0.5 * _MainTex_ST.y) - uvRect.y) * (_MainTex_TexelSize.w / _MainTex_TexelSize.z); + half ripple = -sqrt(xWave*xWave + yWave* yWave); + d.texcoord0.xy += (sin((ripple + (_Time.y + randomSeed) * (_RoundWaveSpeed/10.0)) / 0.015) * (_RoundWaveStrength/10.0)) % 1; + #endif + //---------------------------------------------------- + + + //WIND_ON + #if WIND_ON + half windOffset = sin((_Time.x + randomSeed) * _GrassSpeed * 10); + half2 windCenter = half2(0.5, 0.1); + #if ATLAS_ON + windCenter.x = ((_MaxXUV - _MinXUV) * windCenter.x) + _MinXUV; + windCenter.y = ((_MaxYUV - _MinYUV) * windCenter.y) + _MinYUV; + #endif + #if !MANUALWIND_ON + d.texcoord0.x = fmod(abs(lerp(d.texcoord0.x, d.texcoord0.x + (_GrassWind * 0.01 * windOffset), uvRect.y)), 1); + #else + d.texcoord0.x = fmod(abs(lerp(d.texcoord0.x, d.texcoord0.x + (_GrassWind * 0.01 * _GrassManualAnim), uvRect.y)), 1); + windOffset = _GrassManualAnim; + #endif + half2 delta = d.texcoord0.xy - windCenter; + half delta2 = dot(delta.xy, delta.xy); + half2 delta_offset = delta2 * windOffset; + d.texcoord0.xy = d.texcoord0.xy + half2(delta.y, -delta.x) * delta_offset * _GrassRadialBend; + #endif + + //-------------------------------------------------------- + + //TEXTURESCROLL_ON && !ATLAS_ON + #if TEXTURESCROLL_ON && !ATLAS_ON + d.texcoord0.x += ((_Time.y + randomSeed) * _TextureScrollXSpeed) % 1; + d.texcoord0.y += ((_Time.y + randomSeed) * _TextureScrollYSpeed) % 1; + #endif + //------------------------------ + + //PIXELATE_ON + #if PIXELATE_ON + half aspectRatio = _MainTex_TexelSize.x / _MainTex_TexelSize.y; + half2 pixelSize = float2(_PixelateSize, _PixelateSize * aspectRatio); + d.texcoord0.xy = floor(d.texcoord0.xy * pixelSize) / pixelSize; + #endif + //-------------- + + half4 col = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy); + half originalAlpha = col.a; + col *= d.vertexColor; + + //NORMAL MAP + #if NORMALMAP_ON + half4 normalSample = SAMPLE_TEXTURE2D(_NormalMap, sampler_NormalMap, d.texcoord0.xy); + half3 normalTS = UnpackNormal(normalSample); + normalTS.xy *= _NormalStrength; + o.Normal = normalTS; + #endif + + + //GLITCH_ON + #if GLITCH_ON + half2 uvGlitch = uvRect; + uvGlitch.y -= 0.5; + half lineNoise = pow(rand2(floor(uvGlitch * half2(24., 19.) * _GlitchSize) * 4.0, randomSeed), 3.0) * _GlitchAmount + * pow(rand2(floor(uvGlitch * half2(38., 14.) * _GlitchSize) * 4.0, randomSeed), 3.0); + col = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(lineNoise * 0.02 * rand2(half2(2.0, 1), randomSeed), 0)) * d.vertexColor; + #endif + //-------------------------------------- + + //CHROMABERR_ON + #if CHROMABERR_ON + half4 r = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(_ChromAberrAmount/10, 0)) * d.vertexColor; + half4 b = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(-_ChromAberrAmount/10, 0)) * d.vertexColor; + col = half4(r.r * r.a, col.g, b.b * b.a, max(max(r.a, b.a) * _ChromAberrAlpha, col.a)); + #endif + + //-------------------------------- + + //BLUR_ON + #if BLUR_ON + #if ATLAS_ON + #if !BLURISHD_ON + col = BlurHD(d.texcoord0.xy, _MainTex, sampler_MainTex, _BlurIntensity, (_MaxXUV - _MinXUV), (_MaxYUV - _MinYUV)) * d.vertexColor; + #else + col = Blur(d.texcoord0.xy, _MainTex, sampler_MainTex, _BlurIntensity * (_MaxXUV - _MinXUV)) * d.vertexColor; + #endif + #else + #if !BLURISHD_ON + col = BlurHD(d.texcoord0.xy, _MainTex, sampler_MainTex, _BlurIntensity, 1, 1) * d.vertexColor; + #else + col = Blur(d.texcoord0.xy, _MainTex, sampler_MainTex, _BlurIntensity) * d.vertexColor; + #endif + #endif + #endif + + //-------------------- + + //MOTIONBLUR_ON + #if MOTIONBLUR_ON + _MotionBlurAngle = _MotionBlurAngle * 3.1415926; + #define rot(n) mul(n, half2x2(cos(_MotionBlurAngle), -sin(_MotionBlurAngle), sin(_MotionBlurAngle), cos(_MotionBlurAngle))) + _MotionBlurDist = _MotionBlurDist * 0.005; + #if ATLAS_ON + _MotionBlurDist *= (_MaxXUV - _MinXUV); + #endif + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(-_MotionBlurDist, -_MotionBlurDist))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(-_MotionBlurDist * 2, -_MotionBlurDist * 2))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(-_MotionBlurDist * 3, -_MotionBlurDist * 3))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(-_MotionBlurDist * 4, -_MotionBlurDist * 4))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(_MotionBlurDist, _MotionBlurDist))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(_MotionBlurDist * 2, _MotionBlurDist * 2))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(_MotionBlurDist * 3, _MotionBlurDist * 3))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(_MotionBlurDist * 4, _MotionBlurDist * 4))); + col.rgb = col.rgb / 9; + #endif + //------------------------------------ + + //NEGATIVE_ON + #if NEGATIVE_ON + col.rgb = lerp(col.rgb, 1 - col.rgb, _NegativeAmount); + #endif + + //-------------- + half luminance = 0; + + //GREYSCALE_ON && !GREYSCALEOUTLINE_ON + #if GREYSCALE_ON && !GREYSCALEOUTLINE_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + luminance = saturate(luminance + _GreyscaleLuminosity); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _GreyscaleTintColor, _GreyscaleBlend); + #endif + //------------------------------------ + + //GHOST_ON + #if GHOST_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + half4 ghostResult; + ghostResult.a = saturate(luminance - _GhostTransparency) * col.a; + ghostResult.rgb = col.rgb * (luminance + _GhostColorBoost); + col = lerp(col, ghostResult, _GhostBlend); + #endif + //------------------------------------ + + //INNEROUTLINE_ON + #if INNEROUTLINE_ON + half3 innerT = abs(GetPixel(0, _InnerOutlineThickness, d.texcoord0.xy, _MainTex, sampler_MainTex) - GetPixel(0, -_InnerOutlineThickness, d.texcoord0.xy, _MainTex, sampler_MainTex)); + innerT += abs(GetPixel(_InnerOutlineThickness, 0, d.texcoord0.xy, _MainTex, sampler_MainTex) - GetPixel(-_InnerOutlineThickness, 0, d.texcoord0.xy, _MainTex, sampler_MainTex)); + #if !ONLYINNEROUTLINE_ON + innerT = (innerT / 2.0) * col.a * _InnerOutlineAlpha; + col.rgb += length(innerT) * _InnerOutlineColor.rgb * _InnerOutlineGlow; + #else + innerT *= col.a * _InnerOutlineAlpha; + col.rgb = length(innerT) * _InnerOutlineColor.rgb * _InnerOutlineGlow; + col.a = step(0.3, col.r+col.g+col.b); + #endif + #endif + //------------------------------------------------------- + + //HITEFFECT_ON + #if HITEFFECT_ON + col.rgb = lerp(col.rgb, _HitEffectColor.rgb * _HitEffectGlow, _HitEffectBlend); + #endif + //-------------------- + + //GRADIENT_ON + #if GRADIENT_ON + half2 tiledUvGrad = half2(uvRect.x / _MainTex_ST.x, uvRect.y / _MainTex_ST.y); + #if GRADIENT2COL_ON + _GradTopRightCol = _GradTopLeftCol; + _GradBotRightCol = _GradBotLeftCol; + #endif + #if RADIALGRADIENT_ON + half radialDist = 1 - length(tiledUvGrad - half2(0.5, 0.5)); + radialDist *= (_MainTex_TexelSize.w / _MainTex_TexelSize.z); + radialDist = saturate(_GradBoostX * radialDist); + half4 gradientResult = lerp(_GradTopLeftCol, _GradBotLeftCol, radialDist); + #else + half gradXLerpFactor = saturate(pow(tiledUvGrad.x, _GradBoostX)); + half4 gradientResult = lerp(lerp(_GradBotLeftCol, _GradBotRightCol, gradXLerpFactor), + lerp(_GradTopLeftCol, _GradTopRightCol, gradXLerpFactor), saturate(pow(tiledUvGrad.y, _GradBoostY))); + #endif + gradientResult = lerp(col, gradientResult, _GradBlend); + col.rgb = gradientResult.rgb * col.a; + col.a *= gradientResult.a; + #endif + //-------------------------------------------------------------------- + + //CONTRAST_ON + #if CONTRAST_ON + col.rgb = (col.rgb - float3(0.5, 0.5, 0.5)) * _Contrast + float3(0.5, 0.5, 0.5); + col.rgb += _Brightness; + #endif + + //------------------------------------------------------------------- + + //COLORSWAP_ON + #if COLORSWAP_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + half4 swapMask = SAMPLE_TEXTURE2D(_ColorSwapTex, sampler_ColorSwapTex, d.texcoord0.xy); + swapMask.rgb *= swapMask.a; + half3 redSwap = _ColorSwapRed * swapMask.r * saturate(luminance + _ColorSwapRedLuminosity); + half3 greenSwap = _ColorSwapGreen * swapMask.g * saturate(luminance + _ColorSwapGreenLuminosity); + half3 blueSwap = _ColorSwapBlue * swapMask.b * saturate(luminance + _ColorSwapBlueLuminosity); + swapMask.rgb = col.rgb * saturate(1 - swapMask.r - swapMask.g - swapMask.b); + col.rgb = lerp(col.rgb, swapMask.rgb + redSwap + greenSwap + blueSwap, _ColorSwapBlend); + #endif + //-------------------------------------------------------------------- + + //COLORRAMP_ON && !COLORRAMPOUTLINE_ON + #if COLORRAMP_ON && !COLORRAMPOUTLINE_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + luminance = saturate(luminance + _ColorRampLuminosity); + #if GRADIENTCOLORRAMP_ON + col.rgb = lerp(col.rgb, SAMPLE_TEXTURE2D(_ColorRampTexGradient, sampler_ColorRampTexGradient, half2(luminance, 0)).rgb, _ColorRampBlend); + #else + col.rgb = lerp(col.rgb, SAMPLE_TEXTURE2D(_ColorRampTex, sampler_ColorRampTex, half2(luminance, 0)).rgb, _ColorRampBlend); + #endif + #endif + //-------------------------------------------------------------------- + + //CHANGECOLOR_ON + #if CHANGECOLOR_ON + float3 currChangeColor = saturate(col.rgb); + luminance = 0.3 * currChangeColor.r + 0.59 * currChangeColor.g + 0.11 * currChangeColor.b; + luminance = saturate(luminance + _ColorChangeLuminosity); + half3 dif = abs(currChangeColor - _ColorChangeTarget.rgb); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _ColorChangeNewCol.rgb, + max(sign(1 - saturate(dif.x + dif.y + dif.z) - _ColorChangeTolerance), 0.0)); + #if CHANGECOLOR2_ON + dif = abs(currChangeColor - _ColorChangeTarget2.rgb); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _ColorChangeNewCol2.rgb, + max(sign(1 - saturate(dif.x + dif.y + dif.z) - _ColorChangeTolerance2), 0.0)); + #endif + #if CHANGECOLOR3_ON + dif = abs(currChangeColor - _ColorChangeTarget3.rgb); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _ColorChangeNewCol3.rgb, + max(sign(1 - saturate(dif.x + dif.y + dif.z) - _ColorChangeTolerance3), 0.0)); + #endif + #endif + //------------------------------------------------------- + + //POSTERIZE_ON && !POSTERIZEOUTLINE_ON + #if POSTERIZE_ON && !POSTERIZEOUTLINE_ON + col.rgb = pow(col.rgb, _PosterizeGamma) * _PosterizeNumColors; + col.rgb = floor(col.rgb) / _PosterizeNumColors; + col.rgb = pow(col.rgb, 1.0 / _PosterizeGamma); + #endif + //------------------------------------ + + //HSV_ON + #if HSV_ON + half3 resultHsv = half3(col.rgb); + half cosHsv = _HsvBright * _HsvSaturation * cos(_HsvShift * 3.14159265 / 180); + half sinHsv = _HsvBright * _HsvSaturation * sin(_HsvShift * 3.14159265 / 180); + resultHsv.x = (.299 * _HsvBright + .701 * cosHsv + .168 * sinHsv) * col.x + + (.587 * _HsvBright - .587 * cosHsv + .330 * sinHsv) * col.y + + (.114 * _HsvBright - .114 * cosHsv - .497 * sinHsv) * col.z; + resultHsv.y = (.299 * _HsvBright - .299 * cosHsv - .328 * sinHsv) *col.x + + (.587 * _HsvBright + .413 * cosHsv + .035 * sinHsv) * col.y + + (.114 * _HsvBright - .114 * cosHsv + .292 * sinHsv) * col.z; + resultHsv.z = (.299 * _HsvBright - .3 * cosHsv + 1.25 * sinHsv) * col.x + + (.587 * _HsvBright - .588 * cosHsv - 1.05 * sinHsv) * col.y + + (.114 * _HsvBright + .886 * cosHsv - .203 * sinHsv) * col.z; + col.rgb = resultHsv; + #endif + //------------------------------------------------------- + + //OVERLAY_ON + #if OVERLAY_ON + half2 overlayUvs = d.texcoord0.xy; + overlayUvs.x += ((_Time.y + randomSeed) * _OverlayTextureScrollXSpeed) % 1; + overlayUvs.y += ((_Time.y + randomSeed) * _OverlayTextureScrollYSpeed) % 1; + half4 overlayCol = SAMPLE_TEXTURE2D(_OverlayTex, sampler_OverlayTex, TRANSFORM_TEX(overlayUvs, _OverlayTex)); + overlayCol.rgb *= _OverlayColor.rgb * _OverlayGlow; + #if !OVERLAYMULT_ON + overlayCol.rgb *= overlayCol.a * _OverlayColor.rgb * _OverlayColor.a * _OverlayBlend; + col.rgb += overlayCol.rgb; + #else + overlayCol.a *= _OverlayColor.a; + col = lerp(col, col * overlayCol, _OverlayBlend); + #endif + #endif + + //--------------------------------- + + //OUTBASE_ON + #if OUTBASE_ON + #if OUTBASEPIXELPERF_ON + half2 destUv = half2(_OutlinePixelWidth * _MainTex_TexelSize.x, _OutlinePixelWidth * _MainTex_TexelSize.y); + #else + half2 destUv = half2(_OutlineWidth * _MainTex_TexelSize.x * 200, _OutlineWidth * _MainTex_TexelSize.y * 200); + #endif + + #if OUTDIST_ON + d.texcoord3.x += ((_Time.x + _RandomSeed) * _OutlineDistortTexXSpeed) % 1; + d.texcoord3.y += ((_Time.x + _RandomSeed) * _OutlineDistortTexYSpeed) % 1; + #if ATLAS_ON + d.texcoord3 = half2((d.texcoord3.x - _MinXUV) / (_MaxXUV - _MinXUV), (d.texcoord3.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half outDistortAmnt = (SAMPLE_TEXTURE2D(_OutlineDistortTex, sampler_OutlineDistortTex, d.texcoord3).r - 0.5) * 0.2 * _OutlineDistortAmount; + destUv.x += outDistortAmnt; + destUv.y += outDistortAmnt; + #endif + + half spriteLeft = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(destUv.x, 0)).a; + half spriteRight = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy - half2(destUv.x, 0)).a; + half spriteBottom = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(0, destUv.y)).a; + half spriteTop = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy - half2(0, destUv.y)).a; + half result = spriteLeft + spriteRight + spriteBottom + spriteTop; + + #if OUTBASE8DIR_ON + half spriteTopLeft = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(destUv.x, destUv.y)).a; + half spriteTopRight = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(-destUv.x, destUv.y)).a; + half spriteBotLeft = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(destUv.x, -destUv.y)).a; + half spriteBotRight = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(-destUv.x, -destUv.y)).a; + result = result + spriteTopLeft + spriteTopRight + spriteBotLeft + spriteBotRight; + #endif + + result = step(0.05, saturate(result)); + + #if OUTTEX_ON + d.texcoord1.x += ((_Time.x + _RandomSeed) * _OutlineTexXSpeed) % 1; + d.texcoord1.y += ((_Time.x + _RandomSeed) * _OutlineTexYSpeed) % 1; + #if ATLAS_ON + d.texcoord1 = half2((d.texcoord1.x - _MinXUV) / (_MaxXUV - _MinXUV), (d.texcoord1.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half4 tempOutColor = SAMPLE_TEXTURE2D(_OutlineTex, sampler_OutlineTex, d.texcoord1); + tempOutColor *= _OutlineColor; + _OutlineColor = tempOutColor; + #endif + + result *= (1 - originalAlpha) * _OutlineAlpha; + + half4 outline = _OutlineColor * d.vertexColor.a; + outline.rgb *= _OutlineGlow; + outline.a = result; + #if ONLYOUTLINE_ON + col = outline; + #else + col = lerp(col, outline, result); + #endif + #endif + //------------------------------------------------------- + + //FADE_ON + #if FADE_ON + half2 tiledUvFade1 = TRANSFORM_TEX(d.texcoord0, _FadeTex); + half2 tiledUvFade2 = TRANSFORM_TEX(d.texcoord0, _FadeBurnTex); + #if ATLAS_ON + tiledUvFade1 = half2((tiledUvFade1.x - _MinXUV) / (_MaxXUV - _MinXUV), (tiledUvFade1.y - _MinYUV) / (_MaxYUV - _MinYUV)); + tiledUvFade2 = half2((tiledUvFade2.x - _MinXUV) / (_MaxXUV - _MinXUV), (tiledUvFade2.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half fadeTemp = SAMPLE_TEXTURE2D(_FadeTex, sampler_FadeTex, tiledUvFade1).r; + half fade = smoothstep(_FadeAmount, _FadeAmount + _FadeBurnTransition, fadeTemp); + half fadeBurn = saturate(smoothstep(_FadeAmount - _FadeBurnWidth, _FadeAmount - _FadeBurnWidth + 0.1, fadeTemp) * _FadeAmount); + col.a *= fade; + _FadeBurnColor.rgb *= _FadeBurnGlow; + col += fadeBurn * SAMPLE_TEXTURE2D(_FadeBurnTex, sampler_FadeBurnTex, tiledUvFade2) * _FadeBurnColor * originalAlpha * (1 - col.a); + #endif + //------------------------------------------------------- + + //SHADOW_ON + #if SHADOW_ON + half shadowA = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(_ShadowX, _ShadowY)).a; + half preMultShadowMask = 1 - (saturate(shadowA - col.a) * (1 - col.a)); + col.rgb *= 1 - ((shadowA - col.a) * (1 - col.a)); + col.rgb += (_ShadowColor * shadowA) * (1 - col.a); + col.a = max(shadowA * _ShadowAlpha * d.vertexColor.a, col.a); + #endif + + //------------------------------------------------------- + + //GLOW_ON + #if GLOW_ON + half4 emission; + #if GLOWTEX_ON + emission = SAMPLE_TEXTURE2D(_GlowTex, sampler_GlowTex, d.texcoord0); + #else + emission = col; + #endif + + col.rgb *= _GlowGlobal; + emission.rgb *= emission.a * col.a * _Glow * _GlowColor; + col.rgb += emission.rgb; + #endif + //------------------------------------------------------- + + //COLORRAMP_ON && COLORRAMPOUTLINE_ON + #if COLORRAMP_ON && COLORRAMPOUTLINE_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + luminance = saturate(luminance + _ColorRampLuminosity); + #if GRADIENTCOLORRAMP_ON + col.rgb = lerp(col.rgb, SAMPLE_TEXTURE2D(_ColorRampTexGradient, sampler_ColorRampTexGradient, half2(luminance, 0)).rgb, _ColorRampBlend); + #else + col.rgb = lerp(col.rgb, SAMPLE_TEXTURE2D(_ColorRampTex, sampler_ColorRampTex, half2(luminance, 0)).rgb, _ColorRampBlend); + #endif + #endif + //--------------- + + //GREYSCALE_ON && GREYSCALEOUTLINE_ON + #if GREYSCALE_ON && GREYSCALEOUTLINE_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + luminance = saturate(luminance + _GreyscaleLuminosity); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _GreyscaleTintColor, _GreyscaleBlend); + #endif + + //----------------------------------- + + //POSTERIZE_ON && POSTERIZEOUTLINE_ON + #if POSTERIZE_ON && POSTERIZEOUTLINE_ON + col.rgb = pow(col.rgb, _PosterizeGamma) * _PosterizeNumColors; + col.rgb = floor(col.rgb) / _PosterizeNumColors; + col.rgb = pow(col.rgb, 1.0 / _PosterizeGamma); + #endif + + //----------------------------------- + + //SHINE_ON + #if SHINE_ON + half2 uvShine = uvRect; + half cosAngle = cos(_ShineRotate); + half sinAngle = sin(_ShineRotate); + half2x2 rot = half2x2(cosAngle, -sinAngle, sinAngle, cosAngle); + uvShine -= half2(0.5, 0.5); + uvShine = mul(rot, uvShine); + uvShine += half2(0.5, 0.5); + half shineMask = SAMPLE_TEXTURE2D(_ShineMask, sampler_ShineMask, d.texcoord0.xy).a; + half currentDistanceProjection = (uvShine.x + uvShine.y) / 2; + half whitePower = 1 - (abs(currentDistanceProjection - _ShineLocation) / _ShineWidth); + col.rgb += col.a * whitePower * _ShineGlow * max(sign(currentDistanceProjection - (_ShineLocation - _ShineWidth)), 0.0) + * max(sign((_ShineLocation + _ShineWidth) - currentDistanceProjection), 0.0) * _ShineColor * shineMask; + #endif + + //----------------------------------- + + //HOLOGRAM_ON + #if HOLOGRAM_ON + half totalHologram = _HologramStripesAmount + _HologramUnmodAmount; + half hologramYCoord = ((uvRect.y + (((_Time.x + randomSeed) % 1) * _HologramStripesSpeed)) % totalHologram) / totalHologram; + hologramYCoord = abs(hologramYCoord); + half alpha = RemapFloat(saturate(hologramYCoord - (_HologramUnmodAmount/totalHologram)), 0.0, 1.0, _HologramMinAlpha, saturate(_HologramMaxAlpha)); + half hologramMask = max(sign((_HologramUnmodAmount/totalHologram) - hologramYCoord), 0.0); + half4 hologramResult = col; + hologramResult.a *= lerp(alpha, 1, hologramMask); + hologramResult.rgb *= max(1, _HologramMaxAlpha * max(sign(hologramYCoord - (_HologramUnmodAmount/totalHologram)), 0.0)); + hologramMask = 1 - step(0.01,hologramMask); + hologramResult.rgb += hologramMask * _HologramStripeColor * col.a; + col = lerp(col, hologramResult, _HologramBlend); + #endif + + //----------------------------------- + + //FLICKER_ON + #if FLICKER_ON + col.a *= saturate(col.a * step(frac(0.05 + (_Time.w + randomSeed) * _FlickerFreq), 1 - _FlickerPercent) + _FlickerAlpha); + #endif + //----------------------------------- + + //ALPHACUTOFF_ON + + //ALPHAROUND_ON + + //ALPHAOUTLINE_ON + #if ALPHAOUTLINE_ON + half alphaOutlineRes = pow(1 - col.a, max(_AlphaOutlinePower, 0.0001)) * step(_AlphaOutlineMinAlpha, col.a) * _AlphaOutlineBlend; + col.rgb = lerp(col.rgb, _AlphaOutlineColor.rgb * _AlphaOutlineGlow, alphaOutlineRes); + col.a = lerp(col.a, 1, alphaOutlineRes > 1); + #endif + //------------------------------------------------------- + + //FOG_ON + + //------------------ + + col *= _Color; + o.Albedo = col; + col.a *= _Alpha; + clip(col.a - _AlphaCutoffValue - 0.01); + o.Alpha = _Color.a; + } + + + + + + void ChainSurfaceFunction(inout Surface l, inout ShaderData d) + { + Ext_SurfaceFunction0(l, d); + // Ext_SurfaceFunction1(l, d); + // Ext_SurfaceFunction2(l, d); + // Ext_SurfaceFunction3(l, d); + // Ext_SurfaceFunction4(l, d); + // Ext_SurfaceFunction5(l, d); + // Ext_SurfaceFunction6(l, d); + // Ext_SurfaceFunction7(l, d); + // Ext_SurfaceFunction8(l, d); + // Ext_SurfaceFunction9(l, d); + // Ext_SurfaceFunction10(l, d); + // Ext_SurfaceFunction11(l, d); + // Ext_SurfaceFunction12(l, d); + // Ext_SurfaceFunction13(l, d); + // Ext_SurfaceFunction14(l, d); + // Ext_SurfaceFunction15(l, d); + // Ext_SurfaceFunction16(l, d); + // Ext_SurfaceFunction17(l, d); + // Ext_SurfaceFunction18(l, d); + // Ext_SurfaceFunction19(l, d); + // Ext_SurfaceFunction20(l, d); + // Ext_SurfaceFunction21(l, d); + // Ext_SurfaceFunction22(l, d); + // Ext_SurfaceFunction23(l, d); + // Ext_SurfaceFunction24(l, d); + // Ext_SurfaceFunction25(l, d); + // Ext_SurfaceFunction26(l, d); + // Ext_SurfaceFunction27(l, d); + // Ext_SurfaceFunction28(l, d); + // Ext_SurfaceFunction29(l, d); + } + +#if !_DECALSHADER + + void ChainModifyVertex(inout VertexData v, inout VertexToPixel v2p, float4 time) + { + ExtraV2F d; + + ZERO_INITIALIZE(ExtraV2F, d); + ZERO_INITIALIZE(Blackboard, d.blackboard); + // due to motion vectors in HDRP, we need to use the last + // time in certain spots. So if you are going to use _Time to adjust vertices, + // you need to use this time or motion vectors will break. + d.time = time; + + Ext_ModifyVertex0(v, d); + // Ext_ModifyVertex1(v, d); + // Ext_ModifyVertex2(v, d); + // Ext_ModifyVertex3(v, d); + // Ext_ModifyVertex4(v, d); + // Ext_ModifyVertex5(v, d); + // Ext_ModifyVertex6(v, d); + // Ext_ModifyVertex7(v, d); + // Ext_ModifyVertex8(v, d); + // Ext_ModifyVertex9(v, d); + // Ext_ModifyVertex10(v, d); + // Ext_ModifyVertex11(v, d); + // Ext_ModifyVertex12(v, d); + // Ext_ModifyVertex13(v, d); + // Ext_ModifyVertex14(v, d); + // Ext_ModifyVertex15(v, d); + // Ext_ModifyVertex16(v, d); + // Ext_ModifyVertex17(v, d); + // Ext_ModifyVertex18(v, d); + // Ext_ModifyVertex19(v, d); + // Ext_ModifyVertex20(v, d); + // Ext_ModifyVertex21(v, d); + // Ext_ModifyVertex22(v, d); + // Ext_ModifyVertex23(v, d); + // Ext_ModifyVertex24(v, d); + // Ext_ModifyVertex25(v, d); + // Ext_ModifyVertex26(v, d); + // Ext_ModifyVertex27(v, d); + // Ext_ModifyVertex28(v, d); + // Ext_ModifyVertex29(v, d); + + + // #if %EXTRAV2F0REQUIREKEY% + // v2p.extraV2F0 = d.extraV2F0; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // v2p.extraV2F1 = d.extraV2F1; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // v2p.extraV2F2 = d.extraV2F2; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // v2p.extraV2F3 = d.extraV2F3; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // v2p.extraV2F4 = d.extraV2F4; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // v2p.extraV2F5 = d.extraV2F5; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // v2p.extraV2F6 = d.extraV2F6; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // v2p.extraV2F7 = d.extraV2F7; + // #endif + } + + void ChainModifyTessellatedVertex(inout VertexData v, inout VertexToPixel v2p) + { + ExtraV2F d; + ZERO_INITIALIZE(ExtraV2F, d); + ZERO_INITIALIZE(Blackboard, d.blackboard); + + // #if %EXTRAV2F0REQUIREKEY% + // d.extraV2F0 = v2p.extraV2F0; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // d.extraV2F1 = v2p.extraV2F1; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // d.extraV2F2 = v2p.extraV2F2; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // d.extraV2F3 = v2p.extraV2F3; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // d.extraV2F4 = v2p.extraV2F4; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // d.extraV2F5 = v2p.extraV2F5; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // d.extraV2F6 = v2p.extraV2F6; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // d.extraV2F7 = v2p.extraV2F7; + // #endif + + + // Ext_ModifyTessellatedVertex0(v, d); + // Ext_ModifyTessellatedVertex1(v, d); + // Ext_ModifyTessellatedVertex2(v, d); + // Ext_ModifyTessellatedVertex3(v, d); + // Ext_ModifyTessellatedVertex4(v, d); + // Ext_ModifyTessellatedVertex5(v, d); + // Ext_ModifyTessellatedVertex6(v, d); + // Ext_ModifyTessellatedVertex7(v, d); + // Ext_ModifyTessellatedVertex8(v, d); + // Ext_ModifyTessellatedVertex9(v, d); + // Ext_ModifyTessellatedVertex10(v, d); + // Ext_ModifyTessellatedVertex11(v, d); + // Ext_ModifyTessellatedVertex12(v, d); + // Ext_ModifyTessellatedVertex13(v, d); + // Ext_ModifyTessellatedVertex14(v, d); + // Ext_ModifyTessellatedVertex15(v, d); + // Ext_ModifyTessellatedVertex16(v, d); + // Ext_ModifyTessellatedVertex17(v, d); + // Ext_ModifyTessellatedVertex18(v, d); + // Ext_ModifyTessellatedVertex19(v, d); + // Ext_ModifyTessellatedVertex20(v, d); + // Ext_ModifyTessellatedVertex21(v, d); + // Ext_ModifyTessellatedVertex22(v, d); + // Ext_ModifyTessellatedVertex23(v, d); + // Ext_ModifyTessellatedVertex24(v, d); + // Ext_ModifyTessellatedVertex25(v, d); + // Ext_ModifyTessellatedVertex26(v, d); + // Ext_ModifyTessellatedVertex27(v, d); + // Ext_ModifyTessellatedVertex28(v, d); + // Ext_ModifyTessellatedVertex29(v, d); + + // #if %EXTRAV2F0REQUIREKEY% + // v2p.extraV2F0 = d.extraV2F0; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // v2p.extraV2F1 = d.extraV2F1; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // v2p.extraV2F2 = d.extraV2F2; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // v2p.extraV2F3 = d.extraV2F3; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // v2p.extraV2F4 = d.extraV2F4; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // v2p.extraV2F5 = d.extraV2F5; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // v2p.extraV2F6 = d.extraV2F6; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // v2p.extraV2F7 = d.extraV2F7; + // #endif + } + + void ChainFinalColorForward(inout Surface l, inout ShaderData d, inout half4 color) + { + // Ext_FinalColorForward0(l, d, color); + // Ext_FinalColorForward1(l, d, color); + // Ext_FinalColorForward2(l, d, color); + // Ext_FinalColorForward3(l, d, color); + // Ext_FinalColorForward4(l, d, color); + // Ext_FinalColorForward5(l, d, color); + // Ext_FinalColorForward6(l, d, color); + // Ext_FinalColorForward7(l, d, color); + // Ext_FinalColorForward8(l, d, color); + // Ext_FinalColorForward9(l, d, color); + // Ext_FinalColorForward10(l, d, color); + // Ext_FinalColorForward11(l, d, color); + // Ext_FinalColorForward12(l, d, color); + // Ext_FinalColorForward13(l, d, color); + // Ext_FinalColorForward14(l, d, color); + // Ext_FinalColorForward15(l, d, color); + // Ext_FinalColorForward16(l, d, color); + // Ext_FinalColorForward17(l, d, color); + // Ext_FinalColorForward18(l, d, color); + // Ext_FinalColorForward19(l, d, color); + // Ext_FinalColorForward20(l, d, color); + // Ext_FinalColorForward21(l, d, color); + // Ext_FinalColorForward22(l, d, color); + // Ext_FinalColorForward23(l, d, color); + // Ext_FinalColorForward24(l, d, color); + // Ext_FinalColorForward25(l, d, color); + // Ext_FinalColorForward26(l, d, color); + // Ext_FinalColorForward27(l, d, color); + // Ext_FinalColorForward28(l, d, color); + // Ext_FinalColorForward29(l, d, color); + } + + void ChainFinalGBufferStandard(inout Surface s, inout ShaderData d, inout half4 GBuffer0, inout half4 GBuffer1, inout half4 GBuffer2, inout half4 outEmission, inout half4 outShadowMask) + { + // Ext_FinalGBufferStandard0(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard1(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard2(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard3(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard4(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard5(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard6(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard7(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard8(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard9(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard10(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard11(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard12(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard13(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard14(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard15(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard16(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard17(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard18(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard19(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard20(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard21(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard22(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard23(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard24(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard25(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard26(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard27(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard28(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard29(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + } +#endif + + + + + +#if _DECALSHADER + + ShaderData CreateShaderData(SurfaceDescriptionInputs IN) + { + ShaderData d = (ShaderData)0; + d.TBNMatrix = float3x3(IN.WorldSpaceTangent, IN.WorldSpaceBiTangent, IN.WorldSpaceNormal); + d.worldSpaceNormal = IN.WorldSpaceNormal; + d.worldSpaceTangent = IN.WorldSpaceTangent; + + d.worldSpacePosition = IN.WorldSpacePosition; + d.texcoord0 = IN.uv0.xyxy; + d.screenPos = IN.ScreenPosition; + + d.worldSpaceViewDir = normalize(_WorldSpaceCameraPos - d.worldSpacePosition); + + d.tangentSpaceViewDir = mul(d.TBNMatrix, d.worldSpaceViewDir); + + // these rarely get used, so we back transform them. Usually will be stripped. + #if _HDRP + // d.localSpacePosition = mul(GetWorldToObjectMatrix(), float4(GetCameraRelativePositionWS(d.worldSpacePosition), 1)).xyz; + #else + // d.localSpacePosition = mul(GetWorldToObjectMatrix(), float4(d.worldSpacePosition, 1)).xyz; + #endif + // d.localSpaceNormal = normalize(mul((float3x3)GetWorldToObjectMatrix(), d.worldSpaceNormal)); + // d.localSpaceTangent = normalize(mul((float3x3)GetWorldToObjectMatrix(), d.worldSpaceTangent.xyz)); + + // #if %SCREENPOSREQUIREKEY% + // d.screenUV = (IN.ScreenPosition.xy / max(0.01, IN.ScreenPosition.w)); + // #endif + + return d; + } +#else + + ShaderData CreateShaderData(VertexToPixel i + #if NEED_FACING + , bool facing + #endif + ) + { + ShaderData d = (ShaderData)0; + d.clipPos = i.pos; + d.worldSpacePosition = i.worldPos; + + d.worldSpaceNormal = normalize(i.worldNormal); + d.worldSpaceTangent.xyz = normalize(i.worldTangent.xyz); + + d.tangentSign = i.worldTangent.w * unity_WorldTransformParams.w; + float3 bitangent = cross(d.worldSpaceTangent.xyz, d.worldSpaceNormal) * d.tangentSign; + + d.TBNMatrix = float3x3(d.worldSpaceTangent, -bitangent, d.worldSpaceNormal); + d.worldSpaceViewDir = normalize(_WorldSpaceCameraPos - i.worldPos); + + d.tangentSpaceViewDir = mul(d.TBNMatrix, d.worldSpaceViewDir); + d.texcoord0 = i.texcoord0; + d.texcoord1 = i.texcoord1; + d.texcoord2 = i.texcoord2; + + // #if %TEXCOORD3REQUIREKEY% + d.texcoord3 = i.texcoord3; + // #endif + + // d.isFrontFace = facing; + // #if %VERTEXCOLORREQUIREKEY% + d.vertexColor = i.vertexColor; + // #endif + + // these rarely get used, so we back transform them. Usually will be stripped. + #if _HDRP + // d.localSpacePosition = mul(GetWorldToObjectMatrix(), float4(GetCameraRelativePositionWS(i.worldPos), 1)).xyz; + #else + // d.localSpacePosition = mul(GetWorldToObjectMatrix(), float4(i.worldPos, 1)).xyz; + #endif + // d.localSpaceNormal = normalize(mul((float3x3)GetWorldToObjectMatrix(), i.worldNormal)); + // d.localSpaceTangent = normalize(mul((float3x3)GetWorldToObjectMatrix(), i.worldTangent.xyz)); + + // #if %SCREENPOSREQUIREKEY% + // d.screenPos = i.screenPos; + // d.screenUV = (i.screenPos.xy / i.screenPos.w); + // #endif + + + // #if %EXTRAV2F0REQUIREKEY% + // d.extraV2F0 = i.extraV2F0; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // d.extraV2F1 = i.extraV2F1; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // d.extraV2F2 = i.extraV2F2; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // d.extraV2F3 = i.extraV2F3; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // d.extraV2F4 = i.extraV2F4; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // d.extraV2F5 = i.extraV2F5; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // d.extraV2F6 = i.extraV2F6; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // d.extraV2F7 = i.extraV2F7; + // #endif + + return d; + } + +#endif + + + #if defined(_PASSSHADOW) + float3 _LightDirection; + float3 _LightPosition; + #endif + + // vertex shader + VertexToPixel Vert (VertexData v) + { + + VertexToPixel o = (VertexToPixel)0; + + UNITY_SETUP_INSTANCE_ID(v); + UNITY_TRANSFER_INSTANCE_ID(v, o); + UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o); + + +#if !_TESSELLATION_ON + ChainModifyVertex(v, o, _Time); +#endif + + o.texcoord0 = v.texcoord0; + o.texcoord1 = v.texcoord1; + o.texcoord2 = v.texcoord2; + + // #if %TEXCOORD3REQUIREKEY% + o.texcoord3 = v.texcoord3; + // #endif + + // #if %VERTEXCOLORREQUIREKEY% + o.vertexColor = v.vertexColor; + // #endif + + VertexPositionInputs vertexInput = GetVertexPositionInputs(v.vertex.xyz); + o.worldPos = TransformObjectToWorld(v.vertex.xyz); + o.worldNormal = TransformObjectToWorldNormal(v.normal); + o.worldTangent = float4(TransformObjectToWorldDir(v.tangent.xyz), v.tangent.w); + + // For some very odd reason, in 2021.2, we can't use Unity's defines, but have to use our own.. + #if _PASSSHADOW + #if _CASTING_PUNCTUAL_LIGHT_SHADOW + float3 lightDirectionWS = normalize(_LightPosition - o.worldPos); + #else + float3 lightDirectionWS = _LightDirection; + #endif + // Define shadow pass specific clip position for Universal + o.pos = TransformWorldToHClip(ApplyShadowBias(o.worldPos, o.worldNormal, lightDirectionWS)); + #if UNITY_REVERSED_Z + o.pos.z = min(o.pos.z, UNITY_NEAR_CLIP_VALUE); + #else + o.pos.z = max(o.pos.z, UNITY_NEAR_CLIP_VALUE); + #endif + #elif _PASSMETA + o.pos = MetaVertexPosition(float4(v.vertex.xyz, 0), v.texcoord1.xy, v.texcoord2.xy, unity_LightmapST, unity_DynamicLightmapST); + #else + o.pos = TransformWorldToHClip(o.worldPos); + #endif + + // #if %SCREENPOSREQUIREKEY% + // o.screenPos = ComputeScreenPos(o.pos, _ProjectionParams.x); + // #endif + + #if _PASSFORWARD || _PASSGBUFFER + float2 uv1 = v.texcoord1.xy; + OUTPUT_LIGHTMAP_UV(uv1, unity_LightmapST, o.lightmapUV); + o.texcoord1.xy = uv1; + OUTPUT_SH(o.worldNormal, o.sh); + #if defined(DYNAMICLIGHTMAP_ON) + o.dynamicLightmapUV.xy = v.texcoord2.xy * unity_DynamicLightmapST.xy + unity_DynamicLightmapST.zw; + #endif + #endif + + #ifdef VARYINGS_NEED_FOG_AND_VERTEX_LIGHT + half fogFactor = 0; + #if defined(_FOG_FRAGMENT) + fogFactor = ComputeFogFactor(o.pos.z); + #endif + #if _BAKEDLIT + o.fogFactorAndVertexLight = half4(fogFactor, 0, 0, 0); + #else + half3 vertexLight = VertexLighting(o.worldPos, o.worldNormal); + o.fogFactorAndVertexLight = half4(fogFactor, vertexLight); + #endif + #endif + + #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR) + o.shadowCoord = GetShadowCoord(vertexInput); + #endif + + return o; + } + + + + +#if _UNLIT + #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Unlit.hlsl" +#endif + + // fragment shader + half4 Frag (VertexToPixel IN + #ifdef _DEPTHOFFSET_ON + , out float outputDepth : SV_Depth + #endif + #if NEED_FACING + , bool facing : SV_IsFrontFace + #endif + ) : SV_Target + { + UNITY_SETUP_INSTANCE_ID(IN); + UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX(IN); + + ShaderData d = CreateShaderData(IN + #if NEED_FACING + , facing + #endif + ); + Surface l = (Surface)0; + + #ifdef _DEPTHOFFSET_ON + l.outputDepth = outputDepth; + #endif + + l.Albedo = half3(0.5, 0.5, 0.5); + l.Normal = float3(0,0,1); + l.Occlusion = 1; + l.Alpha = 1; + + ChainSurfaceFunction(l, d); + + #ifdef _DEPTHOFFSET_ON + outputDepth = l.outputDepth; + #endif + + #if _USESPECULAR || _SIMPLELIT + float3 specular = l.Specular; + float metallic = 1; + #else + float3 specular = 0; + float metallic = l.Metallic; + #endif + + + + + InputData inputData = (InputData)0; + + inputData.positionWS = IN.worldPos; + #if _WORLDSPACENORMAL + inputData.normalWS = l.Normal; + #else + inputData.normalWS = normalize(TangentToWorldSpace(d, l.Normal)); + #endif + + inputData.viewDirectionWS = SafeNormalize(d.worldSpaceViewDir); + + + #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR) + inputData.shadowCoord = IN.shadowCoord; + #elif defined(MAIN_LIGHT_CALCULATE_SHADOWS) + inputData.shadowCoord = TransformWorldToShadowCoord(IN.worldPos); + #else + inputData.shadowCoord = float4(0, 0, 0, 0); + #endif + +#if _BAKEDLIT + inputData.fogCoord = IN.fogFactorAndVertexLight.x; + inputData.vertexLighting = 0; +#else + inputData.fogCoord = InitializeInputDataFog(float4(IN.worldPos, 1.0), IN.fogFactorAndVertexLight.x); + inputData.vertexLighting = IN.fogFactorAndVertexLight.yzw; +#endif + + + + #if defined(_OVERRIDE_BAKEDGI) + inputData.bakedGI = l.DiffuseGI; + l.Emission += l.SpecularGI; + #elif _BAKEDLIT + inputData.bakedGI = SAMPLE_GI(IN.lightmapUV, IN.sh, inputData.normalWS); + #else + #if defined(DYNAMICLIGHTMAP_ON) + inputData.bakedGI = SAMPLE_GI(IN.lightmapUV, IN.dynamicLightmapUV.xy, IN.sh, inputData.normalWS); + #else + inputData.bakedGI = SAMPLE_GI(IN.lightmapUV, IN.sh, inputData.normalWS); + #endif + #endif + inputData.normalizedScreenSpaceUV = GetNormalizedScreenSpaceUV(IN.pos); + #if !_BAKEDLIT + inputData.shadowMask = SAMPLE_SHADOWMASK(IN.lightmapUV); + + #if defined(_OVERRIDE_SHADOWMASK) + float4 mulColor = saturate(dot(l.ShadowMask, _MainLightOcclusionProbes)); //unity_OcclusionMaskSelector)); + inputData.shadowMask = mulColor; + #endif + #else + inputData.shadowMask = float4(1,1,1,1); + #endif + + #if defined(DEBUG_DISPLAY) + #if defined(DYNAMICLIGHTMAP_ON) + inputData.dynamicLightmapUV = IN.dynamicLightmapUV.xy; + #endif + #if defined(LIGHTMAP_ON) + inputData.staticLightmapUV = IN.lightmapUV; + #else + inputData.vertexSH = IN.sh; + #endif + #endif + + #if _WORLDSPACENORMAL + float3 normalTS = WorldToTangentSpace(d, l.Normal); + #else + float3 normalTS = l.Normal; + #endif + + SurfaceData surface = (SurfaceData)0; + surface.albedo = l.Albedo; + surface.metallic = saturate(metallic); + surface.specular = specular; + surface.smoothness = saturate(l.Smoothness), + surface.occlusion = l.Occlusion, + surface.emission = l.Emission, + surface.alpha = saturate(l.Alpha); + surface.clearCoatMask = 0; + surface.clearCoatSmoothness = 1; + + #ifdef _CLEARCOAT + surface.clearCoatMask = saturate(l.CoatMask); + surface.clearCoatSmoothness = saturate(l.CoatSmoothness); + #endif + + #if !_UNLIT + half4 color = half4(l.Albedo, l.Alpha); + #ifdef _DBUFFER + #if _BAKEDLIT + half3 bakeColor = color.rgb; + float3 bakeNormal = inputData.normalWS.xyz; + ApplyDecalToBaseColorAndNormal(IN.pos, bakeColor, bakeNormal); + color.rgb = bakeColor; + inputData.normalWS.xyz = bakeNormal; + #else + ApplyDecalToSurfaceData(IN.pos, surface, inputData); + #endif + #endif + #if _SIMPLELIT + color = UniversalFragmentBlinnPhong( + inputData, + surface); + #elif _BAKEDLIT + color = UniversalFragmentBakedLit(inputData, color.rgb, color.a, normalTS); + #else + color = UniversalFragmentPBR(inputData, surface); + #endif + + #if !DISABLEFOG + color.rgb = MixFog(color.rgb, inputData.fogCoord); + #endif + + #else // unlit + #ifdef _DBUFFER + ApplyDecalToSurfaceData(IN.pos, surface, inputData); + #endif + half4 color = UniversalFragmentUnlit(inputData, l.Albedo, l.Alpha); + #if !DISABLEFOG + color.rgb = MixFog(color.rgb, inputData.fogCoord); + #endif + #endif + ChainFinalColorForward(l, d, color); + + return color; + + } + + ENDHLSL + + } + + + + Pass + { + Name "GBuffer" + Tags + { + "LightMode" = "UniversalGBuffer" + } + + Blend One Zero + ZTest LEqual + ZWrite On + + Tags { "RenderType" = "Opaque" "Queue" = "Geometry" "PreviewType" = "Plane" } + Cull [_CullingOption] + ZWrite [_ZWrite] + ZTest [_ZTestMode] + + + HLSLPROGRAM + + #pragma vertex Vert + #pragma fragment Frag + + #pragma target 3.0 + + #pragma prefer_hlslcc gles + #pragma exclude_renderers d3d11_9x + #pragma multi_compile_instancing + #pragma multi_compile_fog + #pragma instancing_options renderinglayer + #pragma multi_compile _ DOTS_INSTANCING_ON + + #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_fragment _ _REFLECTION_PROBE_BLENDING + #pragma multi_compile_fragment _ _REFLECTION_PROBE_BOX_PROJECTION + #pragma multi_compile_fragment _ _SHADOWS_SOFT + #pragma multi_compile _ LIGHTMAP_SHADOW_MIXING + #pragma multi_compile _ _MIXED_LIGHTING_SUBTRACTIVE + #pragma multi_compile_fragment _ _DBUFFER_MRT1 _DBUFFER_MRT2 _DBUFFER_MRT3 + #pragma multi_compile_fragment _ _GBUFFER_NORMALS_OCT + #pragma multi_compile_fragment _ _LIGHT_LAYERS + #pragma multi_compile_fragment _ _RENDER_PASS_ENABLED + #pragma multi_compile_fragment _ DEBUG_DISPLAY + #pragma multi_compile _ SHADOWS_SHADOWMASK + + #define _FOG_FRAGMENT 1 + + #define VARYINGS_NEED_FOG_AND_VERTEX_LIGHT + #define SHADERPASS SHADERPASS_GBUFFER + #define _PASSGBUFFER 1 + + + #pragma shader_feature_local GLOW_ON + #pragma shader_feature_local FADE_ON + #pragma shader_feature_local OUTBASE_ON + #pragma shader_feature_local ONLYOUTLINE_ON + #pragma shader_feature_local GRADIENT_ON + #pragma shader_feature_local GRADIENT2COL_ON + #pragma shader_feature_local RADIALGRADIENT_ON + #pragma shader_feature_local COLORSWAP_ON + #pragma shader_feature_local HSV_ON + #pragma shader_feature_local CHANGECOLOR_ON + #pragma shader_feature_local CHANGECOLOR2_ON + #pragma shader_feature_local CHANGECOLOR3_ON + #pragma shader_feature_local COLORRAMP_ON + #pragma shader_feature_local GRADIENTCOLORRAMP_ON + #pragma shader_feature_local HITEFFECT_ON + #pragma shader_feature_local NEGATIVE_ON + #pragma shader_feature_local PIXELATE_ON + #pragma shader_feature_local GREYSCALE_ON + #pragma shader_feature_local POSTERIZE_ON + #pragma shader_feature_local BLUR_ON + #pragma shader_feature_local MOTIONBLUR_ON + #pragma shader_feature_local GHOST_ON + #pragma shader_feature_local ALPHAOUTLINE_ON + #pragma shader_feature_local INNEROUTLINE_ON + #pragma shader_feature_local ONLYINNEROUTLINE_ON + #pragma shader_feature_local HOLOGRAM_ON + #pragma shader_feature_local CHROMABERR_ON + #pragma shader_feature_local GLITCH_ON + #pragma shader_feature_local FLICKER_ON + #pragma shader_feature_local SHADOW_ON + #pragma shader_feature_local SHINE_ON + #pragma shader_feature_local CONTRAST_ON + #pragma shader_feature_local OVERLAY_ON + #pragma shader_feature_local OVERLAYMULT_ON + #pragma shader_feature_local DOODLE_ON + #pragma shader_feature_local WIND_ON + #pragma shader_feature_local WAVEUV_ON + #pragma shader_feature_local ROUNDWAVEUV_ON + #pragma shader_feature_local RECTSIZE_ON + #pragma shader_feature_local OFFSETUV_ON + #pragma shader_feature_local CLIPPING_ON + #pragma shader_feature_local RADIALCLIPPING_ON + #pragma shader_feature_local TEXTURESCROLL_ON + #pragma shader_feature_local ZOOMUV_ON + #pragma shader_feature_local DISTORT_ON + #pragma shader_feature_local WARP_ON + #pragma shader_feature_local TWISTUV_ON + #pragma shader_feature_local ROTATEUV_ON + #pragma shader_feature_local POLARUV_ON + #pragma shader_feature_local FISHEYE_ON + #pragma shader_feature_local PINCH_ON + #pragma shader_feature_local SHAKEUV_ON + + #pragma shader_feature_local GLOWTEX_ON + #pragma shader_feature_local OUTTEX_ON + #pragma shader_feature_local OUTDIST_ON + #pragma shader_feature_local OUTBASE8DIR_ON + #pragma shader_feature_local OUTBASEPIXELPERF_ON + #pragma shader_feature_local COLORRAMPOUTLINE_ON + #pragma shader_feature_local GREYSCALEOUTLINE_ON + #pragma shader_feature_local POSTERIZEOUTLINE_ON + #pragma shader_feature_local BLURISHD_ON + #pragma shader_feature_local MANUALWIND_ON + #pragma shader_feature_local ATLAS_ON + #pragma shader_feature_local PREMULTIPLYALPHA_ON + + #pragma shader_feature BILBOARD_ON + #pragma shader_feature BILBOARDY_ON + + #pragma shader_feature NORMALMAP_ON + + + #define _URP 1 +#define _USINGTEXCOORD1 1 +#define _USINGTEXCOORD2 1 + + + + + // Includes + #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" + + + + + #undef WorldNormalVector + #define WorldNormalVector(data, normal) mul(normal, data.TBNMatrix) + + #define UnityObjectToWorldNormal(normal) mul(GetObjectToWorldMatrix(), normal) + + #define _WorldSpaceLightPos0 _MainLightPosition + + #define UNITY_DECLARE_TEX2D(name) TEXTURE2D(name); SAMPLER(sampler##name); + #define UNITY_DECLARE_TEX2D_NOSAMPLER(name) TEXTURE2D(name); + #define UNITY_DECLARE_TEX2DARRAY(name) TEXTURE2D_ARRAY(name); SAMPLER(sampler##name); + #define UNITY_DECLARE_TEX2DARRAY_NOSAMPLER(name) TEXTURE2D_ARRAY(name); + + #define UNITY_SAMPLE_TEX2DARRAY(tex,coord) SAMPLE_TEXTURE2D_ARRAY(tex, sampler##tex, coord.xy, coord.z) + #define UNITY_SAMPLE_TEX2DARRAY_LOD(tex,coord,lod) SAMPLE_TEXTURE2D_ARRAY_LOD(tex, sampler##tex, coord.xy, coord.z, lod) + #define UNITY_SAMPLE_TEX2D(tex, coord) SAMPLE_TEXTURE2D(tex, sampler##tex, coord) + #define UNITY_SAMPLE_TEX2D_SAMPLER(tex, samp, coord) SAMPLE_TEXTURE2D(tex, sampler##samp, coord) + + #define UNITY_SAMPLE_TEX2D_LOD(tex,coord, lod) SAMPLE_TEXTURE2D_LOD(tex, sampler_##tex, coord, lod) + #define UNITY_SAMPLE_TEX2D_SAMPLER_LOD(tex,samplertex,coord, lod) SAMPLE_TEXTURE2D_LOD (tex, sampler##samplertex,coord, lod) + + #if defined(UNITY_COMPILER_HLSL) + #define UNITY_INITIALIZE_OUTPUT(type,name) name = (type)0; + #else + #define UNITY_INITIALIZE_OUTPUT(type,name) + #endif + + #define sampler2D_float sampler2D + #define sampler2D_half sampler2D + + + + // data across stages, stripped like the above. + struct VertexToPixel + { + float4 pos : SV_POSITION; + float3 worldPos : TEXCOORD0; + float3 worldNormal : TEXCOORD1; + float4 worldTangent : TEXCOORD2; + float4 texcoord0 : TEXCOORD3; + float4 texcoord1 : TEXCOORD4; + float4 texcoord2 : TEXCOORD5; + + // #if %TEXCOORD3REQUIREKEY% + float4 texcoord3 : TEXCOORD6; + // #endif + + // #if %SCREENPOSREQUIREKEY% + // float4 screenPos : TEXCOORD7; + // #endif + + // #if %VERTEXCOLORREQUIREKEY% + half4 vertexColor : COLOR; + // #endif + + #if defined(LIGHTMAP_ON) + float2 lightmapUV : TEXCOORD8; + #endif + #if defined(DYNAMICLIGHTMAP_ON) + float2 dynamicLightmapUV : TEXCOORD9; + #endif + #if !defined(LIGHTMAP_ON) + float3 sh : TEXCOORD10; + #endif + + #if defined(VARYINGS_NEED_FOG_AND_VERTEX_LIGHT) + float4 fogFactorAndVertexLight : TEXCOORD11; + #endif + + #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR) + float4 shadowCoord : TEXCOORD12; + #endif + + // #if %EXTRAV2F0REQUIREKEY% + // float4 extraV2F0 : TEXCOORD13; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // float4 extraV2F1 : TEXCOORD14; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // float4 extraV2F2 : TEXCOORD15; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // float4 extraV2F3 : TEXCOORD16; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // float4 extraV2F4 : TEXCOORD17; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // float4 extraV2F5 : TEXCOORD18; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // float4 extraV2F6 : TEXCOORD19; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // float4 extraV2F7 : TEXCOORD20; + // #endif + + #if UNITY_ANY_INSTANCING_ENABLED + uint instanceID : CUSTOM_INSTANCE_ID; + #endif + #if (defined(UNITY_STEREO_MULTIVIEW_ENABLED)) || (defined(UNITY_STEREO_INSTANCING_ENABLED) && (defined(SHADER_API_GLES3) || defined(SHADER_API_GLCORE))) + uint stereoTargetEyeIndexAsBlendIdx0 : BLENDINDICES0; + #endif + #if (defined(UNITY_STEREO_INSTANCING_ENABLED)) + uint stereoTargetEyeIndexAsRTArrayIdx : SV_RenderTargetArrayIndex; + #endif + #if defined(SHADER_STAGE_FRAGMENT) && defined(VARYINGS_NEED_CULLFACE) + FRONT_FACE_TYPE cullFace : FRONT_FACE_SEMANTIC; + #endif + + + }; + + + + + + // data describing the user output of a pixel + struct Surface + { + half3 Albedo; + half Height; + half3 Normal; + half Smoothness; + half3 Emission; + half Metallic; + half3 Specular; + half Occlusion; + half SpecularPower; // for simple lighting + half Alpha; + float outputDepth; // if written, SV_Depth semantic is used. ShaderData.clipPos.z is unused value + // HDRP Only + half SpecularOcclusion; + half SubsurfaceMask; + half Thickness; + half CoatMask; + half CoatSmoothness; + half Anisotropy; + half IridescenceMask; + half IridescenceThickness; + int DiffusionProfileHash; + float SpecularAAThreshold; + float SpecularAAScreenSpaceVariance; + // requires _OVERRIDE_BAKEDGI to be defined, but is mapped in all pipelines + float3 DiffuseGI; + float3 BackDiffuseGI; + float3 SpecularGI; + float ior; + float3 transmittanceColor; + float atDistance; + float transmittanceMask; + // requires _OVERRIDE_SHADOWMASK to be defines + float4 ShadowMask; + + // for decals + float NormalAlpha; + float MAOSAlpha; + + + }; + + // Data the user declares in blackboard blocks + struct Blackboard + { + + float blackboardDummyData; + }; + + // data the user might need, this will grow to be big. But easy to strip + struct ShaderData + { + float4 clipPos; // SV_POSITION + float3 localSpacePosition; + float3 localSpaceNormal; + float3 localSpaceTangent; + + float3 worldSpacePosition; + float3 worldSpaceNormal; + float3 worldSpaceTangent; + float tangentSign; + + float3 worldSpaceViewDir; + float3 tangentSpaceViewDir; + + float4 texcoord0; + float4 texcoord1; + float4 texcoord2; + float4 texcoord3; + + float2 screenUV; + float4 screenPos; + + float4 vertexColor; + bool isFrontFace; + + float4 extraV2F0; + float4 extraV2F1; + float4 extraV2F2; + float4 extraV2F3; + float4 extraV2F4; + float4 extraV2F5; + float4 extraV2F6; + float4 extraV2F7; + + float3x3 TBNMatrix; + Blackboard blackboard; + }; + + struct VertexData + { + #if SHADER_TARGET > 30 + // uint vertexID : SV_VertexID; + #endif + float4 vertex : POSITION; + float3 normal : NORMAL; + float4 tangent : TANGENT; + float4 texcoord0 : TEXCOORD0; + + // optimize out mesh coords when not in use by user or lighting system + #if _URP && (_USINGTEXCOORD1 || _PASSMETA || _PASSFORWARD || _PASSGBUFFER) + float4 texcoord1 : TEXCOORD1; + #endif + + #if _URP && (_USINGTEXCOORD2 || _PASSMETA || ((_PASSFORWARD || _PASSGBUFFER) && defined(DYNAMICLIGHTMAP_ON))) + float4 texcoord2 : TEXCOORD2; + #endif + + #if _STANDARD && (_USINGTEXCOORD1 || (_PASSMETA || ((_PASSFORWARD || _PASSGBUFFER || _PASSFORWARDADD) && LIGHTMAP_ON))) + float4 texcoord1 : TEXCOORD1; + #endif + #if _STANDARD && (_USINGTEXCOORD2 || (_PASSMETA || ((_PASSFORWARD || _PASSGBUFFER) && DYNAMICLIGHTMAP_ON))) + float4 texcoord2 : TEXCOORD2; + #endif + + + #if _HDRP + float4 texcoord1 : TEXCOORD1; + float4 texcoord2 : TEXCOORD2; + #endif + + // #if %TEXCOORD3REQUIREKEY% + float4 texcoord3 : TEXCOORD3; + // #endif + + // #if %VERTEXCOLORREQUIREKEY% + float4 vertexColor : COLOR; + // #endif + + #if _PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR)) + float3 previousPositionOS : TEXCOORD4; // Contain previous transform position (in case of skinning for example) + #if defined (_ADD_PRECOMPUTED_VELOCITY) + float3 precomputedVelocity : TEXCOORD5; // Add Precomputed Velocity (Alembic computes velocities on runtime side). + #endif + #endif + + UNITY_VERTEX_INPUT_INSTANCE_ID + }; + + struct TessVertex + { + float4 vertex : INTERNALTESSPOS; + float3 normal : NORMAL; + float4 tangent : TANGENT; + float4 texcoord0 : TEXCOORD0; + float4 texcoord1 : TEXCOORD1; + float4 texcoord2 : TEXCOORD2; + + // #if %TEXCOORD3REQUIREKEY% + float4 texcoord3 : TEXCOORD3; + // #endif + + // #if %VERTEXCOLORREQUIREKEY% + float4 vertexColor : COLOR; + // #endif + + // #if %EXTRAV2F0REQUIREKEY% + // float4 extraV2F0 : TEXCOORD5; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // float4 extraV2F1 : TEXCOORD6; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // float4 extraV2F2 : TEXCOORD7; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // float4 extraV2F3 : TEXCOORD8; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // float4 extraV2F4 : TEXCOORD9; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // float4 extraV2F5 : TEXCOORD10; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // float4 extraV2F6 : TEXCOORD11; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // float4 extraV2F7 : TEXCOORD12; + // #endif + + #if _PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR)) + float3 previousPositionOS : TEXCOORD13; // Contain previous transform position (in case of skinning for example) + #if defined (_ADD_PRECOMPUTED_VELOCITY) + float3 precomputedVelocity : TEXCOORD14; + #endif + #endif + + UNITY_VERTEX_INPUT_INSTANCE_ID + UNITY_VERTEX_OUTPUT_STEREO + }; + + struct ExtraV2F + { + float4 extraV2F0; + float4 extraV2F1; + float4 extraV2F2; + float4 extraV2F3; + float4 extraV2F4; + float4 extraV2F5; + float4 extraV2F6; + float4 extraV2F7; + Blackboard blackboard; + float4 time; + }; + + + float3 WorldToTangentSpace(ShaderData d, float3 normal) + { + return mul(d.TBNMatrix, normal); + } + + float3 TangentToWorldSpace(ShaderData d, float3 normal) + { + return mul(normal, d.TBNMatrix); + } + + // in this case, make standard more like SRPs, because we can't fix + // unity_WorldToObject in HDRP, since it already does macro-fu there + + #if _STANDARD + float3 TransformWorldToObject(float3 p) { return mul(unity_WorldToObject, float4(p, 1)); }; + float3 TransformObjectToWorld(float3 p) { return mul(unity_ObjectToWorld, float4(p, 1)); }; + float4 TransformWorldToObject(float4 p) { return mul(unity_WorldToObject, p); }; + float4 TransformObjectToWorld(float4 p) { return mul(unity_ObjectToWorld, p); }; + float4x4 GetWorldToObjectMatrix() { return unity_WorldToObject; } + float4x4 GetObjectToWorldMatrix() { return unity_ObjectToWorld; } + #if (defined(SHADER_API_D3D11) || defined(SHADER_API_XBOXONE) || defined(UNITY_COMPILER_HLSLCC) || defined(SHADER_API_PSSL) || (SHADER_TARGET_SURFACE_ANALYSIS && !SHADER_TARGET_SURFACE_ANALYSIS_MOJOSHADER)) + #define UNITY_SAMPLE_TEX2D_LOD(tex,coord, lod) tex.SampleLevel (sampler##tex,coord, lod) + #define UNITY_SAMPLE_TEX2D_SAMPLER_LOD(tex,samplertex,coord, lod) tex.SampleLevel (sampler##samplertex,coord, lod) + #else + #define UNITY_SAMPLE_TEX2D_LOD(tex,coord,lod) tex2D (tex,coord,0,lod) + #define UNITY_SAMPLE_TEX2D_SAMPLER_LOD(tex,samplertex,coord,lod) tex2D (tex,coord,0,lod) + #endif + + #undef GetWorldToObjectMatrix() + + #define GetWorldToObjectMatrix() unity_WorldToObject + + + #endif + + float3 GetCameraWorldPosition() + { + #if _HDRP + return GetCameraRelativePositionWS(_WorldSpaceCameraPos); + #else + return _WorldSpaceCameraPos; + #endif + } + + #if _GRABPASSUSED + #if _STANDARD + TEXTURE2D(%GRABTEXTURE%); + SAMPLER(sampler_%GRABTEXTURE%); + #endif + + half3 GetSceneColor(float2 uv) + { + #if _STANDARD + return SAMPLE_TEXTURE2D(%GRABTEXTURE%, sampler_%GRABTEXTURE%, uv).rgb; + #else + return SHADERGRAPH_SAMPLE_SCENE_COLOR(uv); + #endif + } + #endif + + + + #if _STANDARD + UNITY_DECLARE_DEPTH_TEXTURE(_CameraDepthTexture); + float GetSceneDepth(float2 uv) { return SAMPLE_DEPTH_TEXTURE(_CameraDepthTexture, uv); } + float GetLinear01Depth(float2 uv) { return Linear01Depth(GetSceneDepth(uv)); } + float GetLinearEyeDepth(float2 uv) { return LinearEyeDepth(GetSceneDepth(uv)); } + #else + float GetSceneDepth(float2 uv) { return SHADERGRAPH_SAMPLE_SCENE_DEPTH(uv); } + float GetLinear01Depth(float2 uv) { return Linear01Depth(GetSceneDepth(uv), _ZBufferParams); } + float GetLinearEyeDepth(float2 uv) { return LinearEyeDepth(GetSceneDepth(uv), _ZBufferParams); } + #endif + + float3 GetWorldPositionFromDepthBuffer(float2 uv, float3 worldSpaceViewDir) + { + float eye = GetLinearEyeDepth(uv); + float3 camView = mul((float3x3)GetObjectToWorldMatrix(), transpose(mul(GetWorldToObjectMatrix(), UNITY_MATRIX_I_V)) [2].xyz); + + float dt = dot(worldSpaceViewDir, camView); + float3 div = worldSpaceViewDir/dt; + float3 wpos = (eye * div) + GetCameraWorldPosition(); + return wpos; + } + + #if _HDRP + float3 ObjectToWorldSpacePosition(float3 pos) + { + return GetAbsolutePositionWS(TransformObjectToWorld(pos)); + } + #else + float3 ObjectToWorldSpacePosition(float3 pos) + { + return TransformObjectToWorld(pos); + } + #endif + + #if _STANDARD + UNITY_DECLARE_SCREENSPACE_TEXTURE(_CameraDepthNormalsTexture); + float3 GetSceneNormal(float2 uv, float3 worldSpaceViewDir) + { + float4 depthNorms = UNITY_SAMPLE_SCREENSPACE_TEXTURE(_CameraDepthNormalsTexture, uv); + float3 norms = DecodeViewNormalStereo(depthNorms); + norms = mul((float3x3)GetWorldToViewMatrix(), norms) * 0.5 + 0.5; + return norms; + } + #elif _HDRP && !_DECALSHADER + + float3 GetSceneNormal(float2 uv, float3 worldSpaceViewDir) + { + NormalData nd; + DecodeFromNormalBuffer(_ScreenSize.xy * uv, nd); + return nd.normalWS; + } + #elif _URP + #if (SHADER_LIBRARY_VERSION_MAJOR >= 10) + #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/DeclareNormalsTexture.hlsl" + #endif + + float3 GetSceneNormal(float2 uv, float3 worldSpaceViewDir) + { + #if (SHADER_LIBRARY_VERSION_MAJOR >= 10) + return SampleSceneNormals(uv); + #else + float3 wpos = GetWorldPositionFromDepthBuffer(uv, worldSpaceViewDir); + return normalize(-cross(ddx(wpos), ddy(wpos))) * 0.5 + 0.5; + #endif + + } + #endif + + #if _HDRP + + half3 UnpackNormalmapRGorAG(half4 packednormal) + { + // This do the trick + packednormal.x *= packednormal.w; + + half3 normal; + normal.xy = packednormal.xy * 2 - 1; + normal.z = sqrt(1 - saturate(dot(normal.xy, normal.xy))); + return normal; + } + half3 UnpackNormal(half4 packednormal) + { + #if defined(UNITY_NO_DXT5nm) + return packednormal.xyz * 2 - 1; + #else + return UnpackNormalmapRGorAG(packednormal); + #endif + } + #endif + #if _HDRP || _URP + + half3 UnpackScaleNormal(half4 packednormal, half scale) + { + #ifndef UNITY_NO_DXT5nm + // Unpack normal as DXT5nm (1, y, 1, x) or BC5 (x, y, 0, 1) + // Note neutral texture like "bump" is (0, 0, 1, 1) to work with both plain RGB normal and DXT5nm/BC5 + packednormal.x *= packednormal.w; + #endif + half3 normal; + normal.xy = (packednormal.xy * 2 - 1) * scale; + normal.z = sqrt(1 - saturate(dot(normal.xy, normal.xy))); + return normal; + } + + #endif + + + void GetSun(out float3 lightDir, out float3 color) + { + lightDir = float3(0.5, 0.5, 0); + color = 1; + #if _HDRP + if (_DirectionalLightCount > 0) + { + DirectionalLightData light = _DirectionalLightDatas[0]; + lightDir = -light.forward.xyz; + color = light.color; + } + #elif _STANDARD + lightDir = normalize(_WorldSpaceLightPos0.xyz); + color = _LightColor0.rgb; + #elif _URP + Light light = GetMainLight(); + lightDir = light.direction; + color = light.color; + #endif + } + + + + CBUFFER_START(UnityPerMaterial) + + + half4 _Color; + half4 _MainTex_ST, _MainTex_TexelSize; + half _Alpha, _AlphaCutoffValue; + + #if ATLAS_ON + half _MinXUV, _MaxXUV, _MinYUV, _MaxYUV; + #endif + + #if GLOW_ON + half4 _GlowColor; + half _Glow, _GlowGlobal; + #endif + + #if HSV_ON + half _HsvShift, _HsvSaturation, _HsvBright; + #endif + + #if DISTORT_ON + half4 _DistortTex_ST; + half _DistortTexXSpeed, _DistortTexYSpeed, _DistortAmount; + #endif + + #if FADE_ON + half4 _FadeBurnColor, _FadeTex_ST, _FadeBurnTex_ST; + half _FadeAmount, _FadeBurnWidth, _FadeBurnTransition,_FadeBurnGlow; + #endif + + #if OUTBASE_ON + half4 _OutlineColor; + half _OutlineAlpha, _OutlineGlow, _OutlineWidth; + int _OutlinePixelWidth; + #endif + + #if OUTTEX_ON + half4 _OutlineTex_ST; + half _OutlineTexXSpeed, _OutlineTexYSpeed; + #endif + + #if OUTDIST_ON + half4 _OutlineDistortTex_ST; + half _OutlineDistortTexXSpeed, _OutlineDistortTexYSpeed, _OutlineDistortAmount; + #endif + + #if ALPHAOUTLINE_ON + half _AlphaOutlineGlow, _AlphaOutlinePower, _AlphaOutlineMinAlpha, _AlphaOutlineBlend; + half4 _AlphaOutlineColor; + #endif + + #if INNEROUTLINE_ON + half _InnerOutlineThickness, _InnerOutlineAlpha, _InnerOutlineGlow; + half4 _InnerOutlineColor; + #endif + + #if GRADIENT_ON + half _GradBlend, _GradBoostX, _GradBoostY; + half4 _GradTopRightCol, _GradTopLeftCol, _GradBotRightCol, _GradBotLeftCol; + #endif + + #if COLORSWAP_ON + half4 _ColorSwapRed, _ColorSwapGreen, _ColorSwapBlue; + half _ColorSwapRedLuminosity, _ColorSwapGreenLuminosity, _ColorSwapBlueLuminosity, _ColorSwapBlend; + #endif + + #if CHANGECOLOR_ON + half4 _ColorChangeNewCol, _ColorChangeTarget; + half _ColorChangeTolerance, _ColorChangeLuminosity; + #endif + #if CHANGECOLOR2_ON + half4 _ColorChangeNewCol2, _ColorChangeTarget2; + half _ColorChangeTolerance2; + #endif + #if CHANGECOLOR3_ON + half4 _ColorChangeNewCol3, _ColorChangeTarget3; + half _ColorChangeTolerance3; + #endif + + #if COLORRAMP_ON + half _ColorRampLuminosity, _ColorRampBlend; + #endif + + #if HITEFFECT_ON + half4 _HitEffectColor; + half _HitEffectGlow, _HitEffectBlend; + #endif + + #if NEGATIVE_ON + half _NegativeAmount; + #endif + + #if PIXELATE_ON + half _PixelateSize; + #endif + + #if GREYSCALE_ON + half _GreyscaleLuminosity, _GreyscaleBlend; + half4 _GreyscaleTintColor; + #endif + + #if POSTERIZE_ON + half _PosterizeNumColors, _PosterizeGamma; + #endif + + #if BLUR_ON + half _BlurIntensity; + #endif + + #if MOTIONBLUR_ON + half _MotionBlurAngle, _MotionBlurDist; + #endif + + #if GHOST_ON + half _GhostColorBoost, _GhostTransparency, _GhostBlend; + #endif + + #if HOLOGRAM_ON + half _HologramStripesAmount, _HologramMinAlpha, _HologramUnmodAmount, _HologramStripesSpeed, _HologramMaxAlpha, _HologramBlend; + half4 _HologramStripeColor; + #endif + + #if CHROMABERR_ON + half _ChromAberrAmount, _ChromAberrAlpha; + #endif + + #if GLITCH_ON + half _GlitchAmount, _GlitchSize; + #endif + + #if FLICKER_ON + half _FlickerFreq, _FlickerPercent, _FlickerAlpha; + #endif + + #if SHADOW_ON + half _ShadowX, _ShadowY, _ShadowAlpha; + half4 _ShadowColor; + #endif + + #if SHINE_ON + half4 _ShineColor; + half _ShineLocation, _ShineRotate, _ShineWidth, _ShineGlow; + #endif + + #if CONTRAST_ON + half _Contrast, _Brightness; + #endif + + #if OVERLAY_ON + half4 _OverlayTex_ST, _OverlayColor; + half _OverlayGlow, _OverlayBlend, _OverlayTextureScrollXSpeed, _OverlayTextureScrollYSpeed; + #endif + + #if DOODLE_ON + half _HandDrawnAmount, _HandDrawnSpeed; + #endif + + #if WIND_ON + half _GrassSpeed, _GrassWind, _GrassManualAnim, _GrassRadialBend; + #endif + + #if WAVEUV_ON + float _WaveAmount, _WaveSpeed, _WaveStrength, _WaveX, _WaveY; + #endif + + #if ROUNDWAVEUV_ON + half _RoundWaveStrength, _RoundWaveSpeed; + #endif + + #if RECTSIZE_ON + half _RectSize; + #endif + + #if OFFSETUV_ON + half _OffsetUvX, _OffsetUvY; + #endif + + #if CLIPPING_ON + half _ClipUvLeft, _ClipUvRight, _ClipUvUp, _ClipUvDown; + #endif + + #if RADIALCLIPPING_ON + half _RadialStartAngle, _RadialClip, _RadialClip2; + #endif + + #if TEXTURESCROLL_ON + half _TextureScrollXSpeed, _TextureScrollYSpeed; + #endif + + #if ZOOMUV_ON + half _ZoomUvAmount; + #endif + + #if WARP_ON + half _WarpStrength, _WarpSpeed, _WarpScale; + #endif + + #if TWISTUV_ON + half _TwistUvAmount, _TwistUvPosX, _TwistUvPosY, _TwistUvRadius; + #endif + + #if ROTATEUV_ON + half _RotateUvAmount; + #endif + + #if FISHEYE_ON + half _FishEyeUvAmount; + #endif + + #if PINCH_ON + half _PinchUvAmount; + #endif + + #if SHAKEUV_ON + half _ShakeUvSpeed, _ShakeUvX, _ShakeUvY; + #endif + + #if NORMALMAP_ON + half _NormalStrength; + #endif + + float _RandomSeed; + + + + + CBUFFER_END + + + + + + + + TEXTURE2D(_MainTex); + SAMPLER(sampler_MainTex); + + #if GLOW_ON + TEXTURE2D(_GlowTex); + SAMPLER(sampler_GlowTex); + #endif + + #if FADE_ON + TEXTURE2D(_FadeTex); + SAMPLER(sampler_FadeTex); + + TEXTURE2D(_FadeBurnTex); + SAMPLER(sampler_FadeBurnTex); + #endif + + #if DISTORT_ON + TEXTURE2D(_DistortTex); + SAMPLER(sampler_DistortTex); + #endif + + #if OUTTEX_ON + TEXTURE2D(_OutlineTex); + SAMPLER(sampler_OutlineTex); + #endif + + #if OUTDIST_ON + TEXTURE2D(_OutlineDistortTex); + SAMPLER(sampler_OutlineDistortTex); + #endif + + #if COLORSWAP_ON + TEXTURE2D(_ColorSwapTex); + SAMPLER(sampler_ColorSwapTex); + #endif + + #if COLORRAMP_ON + TEXTURE2D(_ColorRampTex); + TEXTURE2D(_ColorRampTexGradient); + SAMPLER(sampler_ColorRampTex); + SAMPLER(sampler_ColorRampTexGradient); + #endif + + #if SHINE_ON + TEXTURE2D(_ShineMask); + SAMPLER(sampler_ShineMask); + #endif + + #if OVERLAY_ON + TEXTURE2D(_OverlayTex); + SAMPLER(sampler_OverlayTex); + #endif + + #if NORMALMAP_ON + TEXTURE2D(_NormalMap); + SAMPLER(sampler_NormalMap); + #endif + + + half3 GetPixel(in int offsetX, in int offsetY, in half2 uv, in Texture2D _tex, in SamplerState _sampler) + { + half2 _uv = uv + half2(offsetX * _MainTex_TexelSize.x, offsetY * _MainTex_TexelSize.y); + half4 col = SAMPLE_TEXTURE2D(_tex, _sampler, _uv); + return col.rgb; + } + + + //BLURS------------------------------------------------------------------------- + half4 Blur(half2 uv, Texture2D source, SamplerState sampler_source, half Intensity) + { + const half2 texelSize = 1.0 / _ScreenParams.xy; + const half4 color = SAMPLE_TEXTURE2D(source, sampler_source, uv); + const half2 offset = Intensity * texelSize; + + half4 accumulatedColor = color; + half accumulatedWeight = 1.0; + for (int x = -1; x <= 1; x++) + { + for (int y = -1; y <= 1; y++) + { + const half2 sampleUV = uv + half2(x, y) * offset; + const half4 sampleColor = SAMPLE_TEXTURE2D(source, sampler_source, sampleUV); + + accumulatedColor += sampleColor; + accumulatedWeight += 1.0; + } + } + + half4 blurredColor = accumulatedColor / accumulatedWeight; + return blurredColor; + } + + half BlurHD_G(half bhqp, half x) + { + return exp(-(x * x) / (2.0 * bhqp * bhqp)); + } + half4 BlurHD(half2 uv, Texture2D source, SamplerState sampler_source, half BlurAmount, half xScale, half yScale) + { + int iterations = 16; + int halfIterations = iterations / 2; + half sigmaX = 0.1 + BlurAmount * 0.5; + half sigmaY = sigmaX; + half total = 0.0; + half4 ret = half4(0, 0, 0, 0); + for (int iy = 0; iy < iterations; ++iy) + { + half fy = BlurHD_G(sigmaY, half(iy) -half(halfIterations)); + half offsetY = half(iy - halfIterations) * 0.00390625 * xScale; + for (int ix = 0; ix < iterations; ++ix) + { + half fx = BlurHD_G(sigmaX, half(ix) - half(halfIterations)); + half offsetX = half(ix - halfIterations) * 0.00390625 * yScale; + total += fx * fy; + ret += SAMPLE_TEXTURE2D(source, sampler_source, uv + half2(offsetX, offsetY)) * fx * fy; + } + } + return ret / total; + } + //----------------------------------------------------------------------- + + + //------------------------------------------- + half RemapFloat(half inValue, half inMin, half inMax, half outMin, half outMax){ + return outMin + (inValue - inMin) * (outMax - outMin) / (inMax - inMin); + } + //------------------------------------------- + + //----------------------------------------------------------------------- + half rand(half2 seed, half offset) { + return (frac(sin(dot(seed, half2(12.9898, 78.233))) * 43758.5453) + offset) % 1.0; + } + + half rand2(half2 seed, half offset) { + return (frac(sin(dot(seed * floor(50 + (_Time.x % 1.0) * 12.), half2(127.1, 311.7))) * 43758.5453123) + offset) % 1.0; + } + + half rand2CustomTime(half2 seed, half offset, half customTime) { + return (frac(sin(dot(seed * floor(50 + (customTime % 1.0) * 12.), half2(127.1, 311.7))) * 43758.5453123) + offset) % 1.0; + } + //----------------------------------------------------------------------- + + + void Ext_ModifyVertex0 (inout VertexData v, inout ExtraV2F d) + { + //BILBOARD_ON + #if BILBOARD_ON + half3 camRight = mul((half3x3)unity_CameraToWorld, half3(1,0,0)); + half3 camUp = half3(0,1,0); + #if BILBOARDY_ON + camUp = mul((half3x3)unity_CameraToWorld, half3(0,1,0)); + #endif + half3 localPos = v.vertex.x * camRight + v.vertex.y * camUp; + v.vertex = half4(localPos, 1); + #endif + //----------------------------------------------------------- + + v.texcoord0.xy = TRANSFORM_TEX(v.texcoord0.xy, _MainTex); + half2 center = half2(0.5, 0.5); + #if ATLAS_ON + center = half2((_MaxXUV + _MinXUV) / 2.0, (_MaxYUV + _MinYUV) / 2.0); + #endif + + //POLARUV_ON + #if POLARUV_ON + v.texcoord0.xy = v.texcoord0.xy - center; + #endif + + //---------------------------------------- + + //ROTATEUV_ON + #if ROTATEUV_ON + half2 uvC = v.texcoord0.xy; + half cosAngle = cos(_RotateUvAmount); + half sinAngle = sin(_RotateUvAmount); + half2x2 rot = half2x2(cosAngle, -sinAngle, sinAngle, cosAngle); + uvC -= center; + v.texcoord0.xy = mul(rot, uvC); + v.texcoord0.xy += center; + #endif + //-------------------- + + #if RECTSIZE_ON + v.vertex.xyz += (v.vertex.xyz * (_RectSize - 1.0)); + #endif + + #if OUTTEX_ON + v.texcoord1.xy = TRANSFORM_TEX(v.texcoord0.xy, _OutlineTex); + #endif + + #if OUTDIST_ON + v.texcoord2.xy = TRANSFORM_TEX(v.texcoord0.xy, _OutlineDistortTex); + #endif + + #if DISTORT_ON + v.texcoord3.xy = TRANSFORM_TEX(v.texcoord0.xy, _DistortTex); + #endif + } + + void Ext_SurfaceFunction0 (inout Surface o, ShaderData d) + { + half randomSeed = _RandomSeed; + + float2 uvRect = d.texcoord0; + half2 center = half2(0.5, 0.5); + #if ATLAS_ON + center = half2((_MaxXUV + _MinXUV) / 2.0, (_MaxYUV + _MinYUV) / 2.0); + uvRect = half2((d.texcoord0.x - _MinXUV) / (_MaxXUV - _MinXUV), (d.texcoord0.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half2 centerTiled = half2(center.x * _MainTex_ST.x, center.y * _MainTex_ST.y); + + //CLIPPING_ON + #if CLIPPING_ON + half2 tiledUv = half2(d.texcoord0.x / _MainTex_ST.x, d.texcoord0.y / _MainTex_ST.y); + #if ATLAS_ON + tiledUv = half2((tiledUv.x - _MinXUV) / (_MaxXUV - _MinXUV), (tiledUv.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + clip((1 - _ClipUvUp) - tiledUv.y); + clip(tiledUv.y - _ClipUvDown); + clip((1 - _ClipUvRight) - tiledUv.x); + clip(tiledUv.x - _ClipUvLeft); + #endif + //---------------------------------- + + //RADIALCLIPPING_ON + #if RADIALCLIPPING_ON + half2 tiledUv2 = half2(d.texcoord0.x / _MainTex_ST.x, d.texcoord0.y / _MainTex_ST.y); + #if ATLAS_ON + tiledUv2 = half2((tiledUv2.x - _MinXUV) / (_MaxXUV - _MinXUV), (tiledUv2.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half startAngle = _RadialStartAngle - _RadialClip; + half endAngle = _RadialStartAngle + _RadialClip2; + half offset0 = clamp(0, 360, startAngle + 360); + half offset360 = clamp(0, 360, endAngle - 360); + half2 atan2Coord = half2(lerp(-1, 1, tiledUv2.x), lerp(-1, 1, tiledUv2.y)); + half atanAngle = atan2(atan2Coord.y, atan2Coord.x) * 57.3; // angle in degrees + if(atanAngle < 0) atanAngle = 360 + atanAngle; + if(atanAngle >= startAngle && atanAngle <= endAngle) discard; + if(atanAngle <= offset360) discard; + if(atanAngle >= offset0) discard; + #endif + + //----------------------------- + + //TEXTURESCROLL_ON && ATLAS_ON + #if TEXTURESCROLL_ON && ATLAS_ON + d.texcoord0.xy = half2(_MinXUV + ((_MaxXUV - _MinXUV) * (abs(((_Time.y + randomSeed) * _TextureScrollXSpeed) + uvRect.x) % 1)), + _MinYUV + ((_MaxYUV - _MinYUV) * (abs(((_Time.y + randomSeed) * _TextureScrollYSpeed) + uvRect.y) % 1))); + #endif + //---------------------------- + + //OFFSETUV_ON + #if OFFSETUV_ON + #if ATLAS_ON + d.texcoord0.xy = half2(_MinXUV + ((_MaxXUV - _MinXUV) * (abs((_OffsetUvX + uvRect.x) % 1))), + _MinYUV + ((_MaxYUV - _MinYUV) * (abs(_OffsetUvY + uvRect.y) % 1))); + #else + d.texcoord0.xy += half2(_OffsetUvX, _OffsetUvY); + #endif + #endif + + //---------------------- + + //POLARUV_ON + #if POLARUV_ON + d.texcoord0.xy = half2(atan2(d.texcoord0.y, d.texcoord0.x) / (2.0f * 3.141592653589f), length(d.texcoord0.xy)); + d.texcoord0.xy *= _MainTex_ST.xy; + #endif + + //-------------------------------------- + + //TWISTUV_ON + #if TWISTUV_ON + #if ATLAS_ON + _TwistUvPosX = ((_MaxXUV - _MinXUV) * _TwistUvPosX) + _MinXUV; + _TwistUvPosY = ((_MaxYUV - _MinYUV) * _TwistUvPosY) + _MinYUV; + #endif + half2 tempUv = d.texcoord0.xy - half2(_TwistUvPosX * _MainTex_ST.x, _TwistUvPosY * _MainTex_ST.y); + _TwistUvRadius *= (_MainTex_ST.x + _MainTex_ST.y) / 2; + half percent = (_TwistUvRadius - length(tempUv)) / _TwistUvRadius; + half theta = percent * percent * (2.0 * sin(_TwistUvAmount)) * 8.0; + half s = sin(theta); + half c = cos(theta); + half beta = max(sign(_TwistUvRadius - length(tempUv)), 0.0); + tempUv = half2(dot(tempUv, half2(c, -s)), dot(tempUv, half2(s, c))) * beta + tempUv * (1 - beta); + tempUv += half2(_TwistUvPosX * _MainTex_ST.x, _TwistUvPosY * _MainTex_ST.y); + d.texcoord0.xy = tempUv; + #endif + + //-------------------------------------------- + + //FISHEYE_ON + #if FISHEYE_ON + half bind = length(centerTiled); + half2 dF = d.texcoord0.xy - centerTiled; + half dFlen = length(dF); + half fishInt = (3.14159265359 / bind) * (_FishEyeUvAmount + 0.001); + d.texcoord0.xy = centerTiled + (dF / (max(0.0001, dFlen))) * tan(dFlen * fishInt) * bind / tan(bind * fishInt); + #endif + //--------------------------------------------- + + //PINCH_ON + #if PINCH_ON + half2 dP = d.texcoord0.xy - centerTiled; + half pinchInt = (3.141592 / length(centerTiled)) * (-_PinchUvAmount + 0.001); + d.texcoord0.xy = centerTiled + normalize(dP) * atan(length(dP) * -pinchInt * 10.0) * 0.5 / atan(-pinchInt * 5); + #endif + + //--------------------------------------------- + + //ZOOMUV_ON + #if ZOOMUV_ON + d.texcoord0.xy -= centerTiled; + d.texcoord0.xy = d.texcoord0.xy * _ZoomUvAmount; + d.texcoord0.xy += centerTiled; + #endif + + //----------------------------------------------- + + //DOODLE_ON + #if DOODLE_ON + half2 uvCopy = uvRect; + _HandDrawnSpeed = (floor((_Time.x + randomSeed) * 20 * _HandDrawnSpeed) / _HandDrawnSpeed) * _HandDrawnSpeed; + uvCopy.x = sin((uvCopy.x * _HandDrawnAmount + _HandDrawnSpeed) * 4); + uvCopy.y = cos((uvCopy.y * _HandDrawnAmount + _HandDrawnSpeed) * 4); + d.texcoord0.xy = lerp(d.texcoord0.xy, d.texcoord0.xy + uvCopy, 0.0005 * _HandDrawnAmount); + #endif + + //-------------------------- + + //SHAKEUV_ON + #if SHAKEUV_ON + half xShake = sin((_Time.x + randomSeed) * _ShakeUvSpeed * 50) * _ShakeUvX; + half yShake = cos((_Time.x + randomSeed) * _ShakeUvSpeed * 50) * _ShakeUvY; + d.texcoord0.xy += half2(xShake * 0.012, yShake * 0.01); + #endif + + //------------------------------------------- + + //RECTSIZE_ON + #if RECTSIZE_ON + d.texcoord0.xy = d.texcoord0.xy * (_RectSize).xx + (((-_RectSize * 0.5) + 0.5)).xx; + #endif + + //------------------------------------------- + + //DISTORT_ON + #if DISTORT_ON + #if ATLAS_ON + d.texcoord3.x = d.texcoord3.x * (1 / (_MaxXUV - _MinXUV)); + d.texcoord3.y = d.texcoord3.y * (1 / (_MaxYUV - _MinYUV)); + #endif + + d.texcoord3.x += ((_Time.x + _RandomSeed) * _DistortTexXSpeed) % 1; + d.texcoord3.y += ((_Time.x + _RandomSeed) * _DistortTexYSpeed) % 1; + half distortAmnt = (SAMPLE_TEXTURE2D(_DistortTex, sampler_DistortTex, d.texcoord3.xy).r - 0.5) * 0.2 * _DistortAmount; + d.texcoord0.x += distortAmnt; + d.texcoord0.y += distortAmnt; + #endif + //------------------------------------------------------- + + //WARP_ON + #if WARP_ON + half2 warpUv = half2(d.texcoord0.x / _MainTex_ST.x, d.texcoord0.y / _MainTex_ST.y); + #if ATLAS_ON + warpUv = half2((warpUv.x - _MinXUV) / (_MaxXUV - _MinXUV), (warpUv.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + const float tau = 6.283185307179586; + float xWarp = (_Time.y + randomSeed) * _WarpSpeed + warpUv.x * tau / _WarpScale; + float yWarp = (_Time.y + randomSeed) * _WarpSpeed + warpUv.y * tau / _WarpScale; + float2 warp = float2(sin(xWarp), sin(yWarp)) * _WarpStrength; + d.texcoord0.xy += warp; + #endif + + //------------------------------------------------------- + + //WAVEUV_ON + #if WAVEUV_ON + float2 uvWave = half2(_WaveX * _MainTex_ST.x, _WaveY * _MainTex_ST.y) - d.texcoord0.xy; + uvWave %= 1; + #if ATLAS_ON + uvWave = half2(_WaveX, _WaveY) - uvRect; + #endif + uvWave.x *= _ScreenParams.x / _ScreenParams.y; + float waveTime = _Time.y + randomSeed; + float angWave = (sqrt(dot(uvWave, uvWave)) * _WaveAmount) - ((waveTime * _WaveSpeed)); + d.texcoord0.xy = d.texcoord0.xy + uvWave * sin(angWave) * (_WaveStrength / 1000.0); + #endif + //---------------------------------------------------- + + //ROUNDWAVEUV_ON + #if ROUNDWAVEUV_ON + half xWave = ((0.5 * _MainTex_ST.x) - uvRect.x); + half yWave = ((0.5 * _MainTex_ST.y) - uvRect.y) * (_MainTex_TexelSize.w / _MainTex_TexelSize.z); + half ripple = -sqrt(xWave*xWave + yWave* yWave); + d.texcoord0.xy += (sin((ripple + (_Time.y + randomSeed) * (_RoundWaveSpeed/10.0)) / 0.015) * (_RoundWaveStrength/10.0)) % 1; + #endif + //---------------------------------------------------- + + + //WIND_ON + #if WIND_ON + half windOffset = sin((_Time.x + randomSeed) * _GrassSpeed * 10); + half2 windCenter = half2(0.5, 0.1); + #if ATLAS_ON + windCenter.x = ((_MaxXUV - _MinXUV) * windCenter.x) + _MinXUV; + windCenter.y = ((_MaxYUV - _MinYUV) * windCenter.y) + _MinYUV; + #endif + #if !MANUALWIND_ON + d.texcoord0.x = fmod(abs(lerp(d.texcoord0.x, d.texcoord0.x + (_GrassWind * 0.01 * windOffset), uvRect.y)), 1); + #else + d.texcoord0.x = fmod(abs(lerp(d.texcoord0.x, d.texcoord0.x + (_GrassWind * 0.01 * _GrassManualAnim), uvRect.y)), 1); + windOffset = _GrassManualAnim; + #endif + half2 delta = d.texcoord0.xy - windCenter; + half delta2 = dot(delta.xy, delta.xy); + half2 delta_offset = delta2 * windOffset; + d.texcoord0.xy = d.texcoord0.xy + half2(delta.y, -delta.x) * delta_offset * _GrassRadialBend; + #endif + + //-------------------------------------------------------- + + //TEXTURESCROLL_ON && !ATLAS_ON + #if TEXTURESCROLL_ON && !ATLAS_ON + d.texcoord0.x += ((_Time.y + randomSeed) * _TextureScrollXSpeed) % 1; + d.texcoord0.y += ((_Time.y + randomSeed) * _TextureScrollYSpeed) % 1; + #endif + //------------------------------ + + //PIXELATE_ON + #if PIXELATE_ON + half aspectRatio = _MainTex_TexelSize.x / _MainTex_TexelSize.y; + half2 pixelSize = float2(_PixelateSize, _PixelateSize * aspectRatio); + d.texcoord0.xy = floor(d.texcoord0.xy * pixelSize) / pixelSize; + #endif + //-------------- + + half4 col = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy); + half originalAlpha = col.a; + col *= d.vertexColor; + + //NORMAL MAP + #if NORMALMAP_ON + half4 normalSample = SAMPLE_TEXTURE2D(_NormalMap, sampler_NormalMap, d.texcoord0.xy); + half3 normalTS = UnpackNormal(normalSample); + normalTS.xy *= _NormalStrength; + o.Normal = normalTS; + #endif + + + //GLITCH_ON + #if GLITCH_ON + half2 uvGlitch = uvRect; + uvGlitch.y -= 0.5; + half lineNoise = pow(rand2(floor(uvGlitch * half2(24., 19.) * _GlitchSize) * 4.0, randomSeed), 3.0) * _GlitchAmount + * pow(rand2(floor(uvGlitch * half2(38., 14.) * _GlitchSize) * 4.0, randomSeed), 3.0); + col = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(lineNoise * 0.02 * rand2(half2(2.0, 1), randomSeed), 0)) * d.vertexColor; + #endif + //-------------------------------------- + + //CHROMABERR_ON + #if CHROMABERR_ON + half4 r = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(_ChromAberrAmount/10, 0)) * d.vertexColor; + half4 b = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(-_ChromAberrAmount/10, 0)) * d.vertexColor; + col = half4(r.r * r.a, col.g, b.b * b.a, max(max(r.a, b.a) * _ChromAberrAlpha, col.a)); + #endif + + //-------------------------------- + + //BLUR_ON + #if BLUR_ON + #if ATLAS_ON + #if !BLURISHD_ON + col = BlurHD(d.texcoord0.xy, _MainTex, sampler_MainTex, _BlurIntensity, (_MaxXUV - _MinXUV), (_MaxYUV - _MinYUV)) * d.vertexColor; + #else + col = Blur(d.texcoord0.xy, _MainTex, sampler_MainTex, _BlurIntensity * (_MaxXUV - _MinXUV)) * d.vertexColor; + #endif + #else + #if !BLURISHD_ON + col = BlurHD(d.texcoord0.xy, _MainTex, sampler_MainTex, _BlurIntensity, 1, 1) * d.vertexColor; + #else + col = Blur(d.texcoord0.xy, _MainTex, sampler_MainTex, _BlurIntensity) * d.vertexColor; + #endif + #endif + #endif + + //-------------------- + + //MOTIONBLUR_ON + #if MOTIONBLUR_ON + _MotionBlurAngle = _MotionBlurAngle * 3.1415926; + #define rot(n) mul(n, half2x2(cos(_MotionBlurAngle), -sin(_MotionBlurAngle), sin(_MotionBlurAngle), cos(_MotionBlurAngle))) + _MotionBlurDist = _MotionBlurDist * 0.005; + #if ATLAS_ON + _MotionBlurDist *= (_MaxXUV - _MinXUV); + #endif + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(-_MotionBlurDist, -_MotionBlurDist))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(-_MotionBlurDist * 2, -_MotionBlurDist * 2))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(-_MotionBlurDist * 3, -_MotionBlurDist * 3))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(-_MotionBlurDist * 4, -_MotionBlurDist * 4))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(_MotionBlurDist, _MotionBlurDist))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(_MotionBlurDist * 2, _MotionBlurDist * 2))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(_MotionBlurDist * 3, _MotionBlurDist * 3))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(_MotionBlurDist * 4, _MotionBlurDist * 4))); + col.rgb = col.rgb / 9; + #endif + //------------------------------------ + + //NEGATIVE_ON + #if NEGATIVE_ON + col.rgb = lerp(col.rgb, 1 - col.rgb, _NegativeAmount); + #endif + + //-------------- + half luminance = 0; + + //GREYSCALE_ON && !GREYSCALEOUTLINE_ON + #if GREYSCALE_ON && !GREYSCALEOUTLINE_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + luminance = saturate(luminance + _GreyscaleLuminosity); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _GreyscaleTintColor, _GreyscaleBlend); + #endif + //------------------------------------ + + //GHOST_ON + #if GHOST_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + half4 ghostResult; + ghostResult.a = saturate(luminance - _GhostTransparency) * col.a; + ghostResult.rgb = col.rgb * (luminance + _GhostColorBoost); + col = lerp(col, ghostResult, _GhostBlend); + #endif + //------------------------------------ + + //INNEROUTLINE_ON + #if INNEROUTLINE_ON + half3 innerT = abs(GetPixel(0, _InnerOutlineThickness, d.texcoord0.xy, _MainTex, sampler_MainTex) - GetPixel(0, -_InnerOutlineThickness, d.texcoord0.xy, _MainTex, sampler_MainTex)); + innerT += abs(GetPixel(_InnerOutlineThickness, 0, d.texcoord0.xy, _MainTex, sampler_MainTex) - GetPixel(-_InnerOutlineThickness, 0, d.texcoord0.xy, _MainTex, sampler_MainTex)); + #if !ONLYINNEROUTLINE_ON + innerT = (innerT / 2.0) * col.a * _InnerOutlineAlpha; + col.rgb += length(innerT) * _InnerOutlineColor.rgb * _InnerOutlineGlow; + #else + innerT *= col.a * _InnerOutlineAlpha; + col.rgb = length(innerT) * _InnerOutlineColor.rgb * _InnerOutlineGlow; + col.a = step(0.3, col.r+col.g+col.b); + #endif + #endif + //------------------------------------------------------- + + //HITEFFECT_ON + #if HITEFFECT_ON + col.rgb = lerp(col.rgb, _HitEffectColor.rgb * _HitEffectGlow, _HitEffectBlend); + #endif + //-------------------- + + //GRADIENT_ON + #if GRADIENT_ON + half2 tiledUvGrad = half2(uvRect.x / _MainTex_ST.x, uvRect.y / _MainTex_ST.y); + #if GRADIENT2COL_ON + _GradTopRightCol = _GradTopLeftCol; + _GradBotRightCol = _GradBotLeftCol; + #endif + #if RADIALGRADIENT_ON + half radialDist = 1 - length(tiledUvGrad - half2(0.5, 0.5)); + radialDist *= (_MainTex_TexelSize.w / _MainTex_TexelSize.z); + radialDist = saturate(_GradBoostX * radialDist); + half4 gradientResult = lerp(_GradTopLeftCol, _GradBotLeftCol, radialDist); + #else + half gradXLerpFactor = saturate(pow(tiledUvGrad.x, _GradBoostX)); + half4 gradientResult = lerp(lerp(_GradBotLeftCol, _GradBotRightCol, gradXLerpFactor), + lerp(_GradTopLeftCol, _GradTopRightCol, gradXLerpFactor), saturate(pow(tiledUvGrad.y, _GradBoostY))); + #endif + gradientResult = lerp(col, gradientResult, _GradBlend); + col.rgb = gradientResult.rgb * col.a; + col.a *= gradientResult.a; + #endif + //-------------------------------------------------------------------- + + //CONTRAST_ON + #if CONTRAST_ON + col.rgb = (col.rgb - float3(0.5, 0.5, 0.5)) * _Contrast + float3(0.5, 0.5, 0.5); + col.rgb += _Brightness; + #endif + + //------------------------------------------------------------------- + + //COLORSWAP_ON + #if COLORSWAP_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + half4 swapMask = SAMPLE_TEXTURE2D(_ColorSwapTex, sampler_ColorSwapTex, d.texcoord0.xy); + swapMask.rgb *= swapMask.a; + half3 redSwap = _ColorSwapRed * swapMask.r * saturate(luminance + _ColorSwapRedLuminosity); + half3 greenSwap = _ColorSwapGreen * swapMask.g * saturate(luminance + _ColorSwapGreenLuminosity); + half3 blueSwap = _ColorSwapBlue * swapMask.b * saturate(luminance + _ColorSwapBlueLuminosity); + swapMask.rgb = col.rgb * saturate(1 - swapMask.r - swapMask.g - swapMask.b); + col.rgb = lerp(col.rgb, swapMask.rgb + redSwap + greenSwap + blueSwap, _ColorSwapBlend); + #endif + //-------------------------------------------------------------------- + + //COLORRAMP_ON && !COLORRAMPOUTLINE_ON + #if COLORRAMP_ON && !COLORRAMPOUTLINE_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + luminance = saturate(luminance + _ColorRampLuminosity); + #if GRADIENTCOLORRAMP_ON + col.rgb = lerp(col.rgb, SAMPLE_TEXTURE2D(_ColorRampTexGradient, sampler_ColorRampTexGradient, half2(luminance, 0)).rgb, _ColorRampBlend); + #else + col.rgb = lerp(col.rgb, SAMPLE_TEXTURE2D(_ColorRampTex, sampler_ColorRampTex, half2(luminance, 0)).rgb, _ColorRampBlend); + #endif + #endif + //-------------------------------------------------------------------- + + //CHANGECOLOR_ON + #if CHANGECOLOR_ON + float3 currChangeColor = saturate(col.rgb); + luminance = 0.3 * currChangeColor.r + 0.59 * currChangeColor.g + 0.11 * currChangeColor.b; + luminance = saturate(luminance + _ColorChangeLuminosity); + half3 dif = abs(currChangeColor - _ColorChangeTarget.rgb); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _ColorChangeNewCol.rgb, + max(sign(1 - saturate(dif.x + dif.y + dif.z) - _ColorChangeTolerance), 0.0)); + #if CHANGECOLOR2_ON + dif = abs(currChangeColor - _ColorChangeTarget2.rgb); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _ColorChangeNewCol2.rgb, + max(sign(1 - saturate(dif.x + dif.y + dif.z) - _ColorChangeTolerance2), 0.0)); + #endif + #if CHANGECOLOR3_ON + dif = abs(currChangeColor - _ColorChangeTarget3.rgb); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _ColorChangeNewCol3.rgb, + max(sign(1 - saturate(dif.x + dif.y + dif.z) - _ColorChangeTolerance3), 0.0)); + #endif + #endif + //------------------------------------------------------- + + //POSTERIZE_ON && !POSTERIZEOUTLINE_ON + #if POSTERIZE_ON && !POSTERIZEOUTLINE_ON + col.rgb = pow(col.rgb, _PosterizeGamma) * _PosterizeNumColors; + col.rgb = floor(col.rgb) / _PosterizeNumColors; + col.rgb = pow(col.rgb, 1.0 / _PosterizeGamma); + #endif + //------------------------------------ + + //HSV_ON + #if HSV_ON + half3 resultHsv = half3(col.rgb); + half cosHsv = _HsvBright * _HsvSaturation * cos(_HsvShift * 3.14159265 / 180); + half sinHsv = _HsvBright * _HsvSaturation * sin(_HsvShift * 3.14159265 / 180); + resultHsv.x = (.299 * _HsvBright + .701 * cosHsv + .168 * sinHsv) * col.x + + (.587 * _HsvBright - .587 * cosHsv + .330 * sinHsv) * col.y + + (.114 * _HsvBright - .114 * cosHsv - .497 * sinHsv) * col.z; + resultHsv.y = (.299 * _HsvBright - .299 * cosHsv - .328 * sinHsv) *col.x + + (.587 * _HsvBright + .413 * cosHsv + .035 * sinHsv) * col.y + + (.114 * _HsvBright - .114 * cosHsv + .292 * sinHsv) * col.z; + resultHsv.z = (.299 * _HsvBright - .3 * cosHsv + 1.25 * sinHsv) * col.x + + (.587 * _HsvBright - .588 * cosHsv - 1.05 * sinHsv) * col.y + + (.114 * _HsvBright + .886 * cosHsv - .203 * sinHsv) * col.z; + col.rgb = resultHsv; + #endif + //------------------------------------------------------- + + //OVERLAY_ON + #if OVERLAY_ON + half2 overlayUvs = d.texcoord0.xy; + overlayUvs.x += ((_Time.y + randomSeed) * _OverlayTextureScrollXSpeed) % 1; + overlayUvs.y += ((_Time.y + randomSeed) * _OverlayTextureScrollYSpeed) % 1; + half4 overlayCol = SAMPLE_TEXTURE2D(_OverlayTex, sampler_OverlayTex, TRANSFORM_TEX(overlayUvs, _OverlayTex)); + overlayCol.rgb *= _OverlayColor.rgb * _OverlayGlow; + #if !OVERLAYMULT_ON + overlayCol.rgb *= overlayCol.a * _OverlayColor.rgb * _OverlayColor.a * _OverlayBlend; + col.rgb += overlayCol.rgb; + #else + overlayCol.a *= _OverlayColor.a; + col = lerp(col, col * overlayCol, _OverlayBlend); + #endif + #endif + + //--------------------------------- + + //OUTBASE_ON + #if OUTBASE_ON + #if OUTBASEPIXELPERF_ON + half2 destUv = half2(_OutlinePixelWidth * _MainTex_TexelSize.x, _OutlinePixelWidth * _MainTex_TexelSize.y); + #else + half2 destUv = half2(_OutlineWidth * _MainTex_TexelSize.x * 200, _OutlineWidth * _MainTex_TexelSize.y * 200); + #endif + + #if OUTDIST_ON + d.texcoord3.x += ((_Time.x + _RandomSeed) * _OutlineDistortTexXSpeed) % 1; + d.texcoord3.y += ((_Time.x + _RandomSeed) * _OutlineDistortTexYSpeed) % 1; + #if ATLAS_ON + d.texcoord3 = half2((d.texcoord3.x - _MinXUV) / (_MaxXUV - _MinXUV), (d.texcoord3.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half outDistortAmnt = (SAMPLE_TEXTURE2D(_OutlineDistortTex, sampler_OutlineDistortTex, d.texcoord3).r - 0.5) * 0.2 * _OutlineDistortAmount; + destUv.x += outDistortAmnt; + destUv.y += outDistortAmnt; + #endif + + half spriteLeft = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(destUv.x, 0)).a; + half spriteRight = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy - half2(destUv.x, 0)).a; + half spriteBottom = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(0, destUv.y)).a; + half spriteTop = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy - half2(0, destUv.y)).a; + half result = spriteLeft + spriteRight + spriteBottom + spriteTop; + + #if OUTBASE8DIR_ON + half spriteTopLeft = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(destUv.x, destUv.y)).a; + half spriteTopRight = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(-destUv.x, destUv.y)).a; + half spriteBotLeft = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(destUv.x, -destUv.y)).a; + half spriteBotRight = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(-destUv.x, -destUv.y)).a; + result = result + spriteTopLeft + spriteTopRight + spriteBotLeft + spriteBotRight; + #endif + + result = step(0.05, saturate(result)); + + #if OUTTEX_ON + d.texcoord1.x += ((_Time.x + _RandomSeed) * _OutlineTexXSpeed) % 1; + d.texcoord1.y += ((_Time.x + _RandomSeed) * _OutlineTexYSpeed) % 1; + #if ATLAS_ON + d.texcoord1 = half2((d.texcoord1.x - _MinXUV) / (_MaxXUV - _MinXUV), (d.texcoord1.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half4 tempOutColor = SAMPLE_TEXTURE2D(_OutlineTex, sampler_OutlineTex, d.texcoord1); + tempOutColor *= _OutlineColor; + _OutlineColor = tempOutColor; + #endif + + result *= (1 - originalAlpha) * _OutlineAlpha; + + half4 outline = _OutlineColor * d.vertexColor.a; + outline.rgb *= _OutlineGlow; + outline.a = result; + #if ONLYOUTLINE_ON + col = outline; + #else + col = lerp(col, outline, result); + #endif + #endif + //------------------------------------------------------- + + //FADE_ON + #if FADE_ON + half2 tiledUvFade1 = TRANSFORM_TEX(d.texcoord0, _FadeTex); + half2 tiledUvFade2 = TRANSFORM_TEX(d.texcoord0, _FadeBurnTex); + #if ATLAS_ON + tiledUvFade1 = half2((tiledUvFade1.x - _MinXUV) / (_MaxXUV - _MinXUV), (tiledUvFade1.y - _MinYUV) / (_MaxYUV - _MinYUV)); + tiledUvFade2 = half2((tiledUvFade2.x - _MinXUV) / (_MaxXUV - _MinXUV), (tiledUvFade2.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half fadeTemp = SAMPLE_TEXTURE2D(_FadeTex, sampler_FadeTex, tiledUvFade1).r; + half fade = smoothstep(_FadeAmount, _FadeAmount + _FadeBurnTransition, fadeTemp); + half fadeBurn = saturate(smoothstep(_FadeAmount - _FadeBurnWidth, _FadeAmount - _FadeBurnWidth + 0.1, fadeTemp) * _FadeAmount); + col.a *= fade; + _FadeBurnColor.rgb *= _FadeBurnGlow; + col += fadeBurn * SAMPLE_TEXTURE2D(_FadeBurnTex, sampler_FadeBurnTex, tiledUvFade2) * _FadeBurnColor * originalAlpha * (1 - col.a); + #endif + //------------------------------------------------------- + + //SHADOW_ON + #if SHADOW_ON + half shadowA = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(_ShadowX, _ShadowY)).a; + half preMultShadowMask = 1 - (saturate(shadowA - col.a) * (1 - col.a)); + col.rgb *= 1 - ((shadowA - col.a) * (1 - col.a)); + col.rgb += (_ShadowColor * shadowA) * (1 - col.a); + col.a = max(shadowA * _ShadowAlpha * d.vertexColor.a, col.a); + #endif + + //------------------------------------------------------- + + //GLOW_ON + #if GLOW_ON + half4 emission; + #if GLOWTEX_ON + emission = SAMPLE_TEXTURE2D(_GlowTex, sampler_GlowTex, d.texcoord0); + #else + emission = col; + #endif + + col.rgb *= _GlowGlobal; + emission.rgb *= emission.a * col.a * _Glow * _GlowColor; + col.rgb += emission.rgb; + #endif + //------------------------------------------------------- + + //COLORRAMP_ON && COLORRAMPOUTLINE_ON + #if COLORRAMP_ON && COLORRAMPOUTLINE_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + luminance = saturate(luminance + _ColorRampLuminosity); + #if GRADIENTCOLORRAMP_ON + col.rgb = lerp(col.rgb, SAMPLE_TEXTURE2D(_ColorRampTexGradient, sampler_ColorRampTexGradient, half2(luminance, 0)).rgb, _ColorRampBlend); + #else + col.rgb = lerp(col.rgb, SAMPLE_TEXTURE2D(_ColorRampTex, sampler_ColorRampTex, half2(luminance, 0)).rgb, _ColorRampBlend); + #endif + #endif + //--------------- + + //GREYSCALE_ON && GREYSCALEOUTLINE_ON + #if GREYSCALE_ON && GREYSCALEOUTLINE_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + luminance = saturate(luminance + _GreyscaleLuminosity); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _GreyscaleTintColor, _GreyscaleBlend); + #endif + + //----------------------------------- + + //POSTERIZE_ON && POSTERIZEOUTLINE_ON + #if POSTERIZE_ON && POSTERIZEOUTLINE_ON + col.rgb = pow(col.rgb, _PosterizeGamma) * _PosterizeNumColors; + col.rgb = floor(col.rgb) / _PosterizeNumColors; + col.rgb = pow(col.rgb, 1.0 / _PosterizeGamma); + #endif + + //----------------------------------- + + //SHINE_ON + #if SHINE_ON + half2 uvShine = uvRect; + half cosAngle = cos(_ShineRotate); + half sinAngle = sin(_ShineRotate); + half2x2 rot = half2x2(cosAngle, -sinAngle, sinAngle, cosAngle); + uvShine -= half2(0.5, 0.5); + uvShine = mul(rot, uvShine); + uvShine += half2(0.5, 0.5); + half shineMask = SAMPLE_TEXTURE2D(_ShineMask, sampler_ShineMask, d.texcoord0.xy).a; + half currentDistanceProjection = (uvShine.x + uvShine.y) / 2; + half whitePower = 1 - (abs(currentDistanceProjection - _ShineLocation) / _ShineWidth); + col.rgb += col.a * whitePower * _ShineGlow * max(sign(currentDistanceProjection - (_ShineLocation - _ShineWidth)), 0.0) + * max(sign((_ShineLocation + _ShineWidth) - currentDistanceProjection), 0.0) * _ShineColor * shineMask; + #endif + + //----------------------------------- + + //HOLOGRAM_ON + #if HOLOGRAM_ON + half totalHologram = _HologramStripesAmount + _HologramUnmodAmount; + half hologramYCoord = ((uvRect.y + (((_Time.x + randomSeed) % 1) * _HologramStripesSpeed)) % totalHologram) / totalHologram; + hologramYCoord = abs(hologramYCoord); + half alpha = RemapFloat(saturate(hologramYCoord - (_HologramUnmodAmount/totalHologram)), 0.0, 1.0, _HologramMinAlpha, saturate(_HologramMaxAlpha)); + half hologramMask = max(sign((_HologramUnmodAmount/totalHologram) - hologramYCoord), 0.0); + half4 hologramResult = col; + hologramResult.a *= lerp(alpha, 1, hologramMask); + hologramResult.rgb *= max(1, _HologramMaxAlpha * max(sign(hologramYCoord - (_HologramUnmodAmount/totalHologram)), 0.0)); + hologramMask = 1 - step(0.01,hologramMask); + hologramResult.rgb += hologramMask * _HologramStripeColor * col.a; + col = lerp(col, hologramResult, _HologramBlend); + #endif + + //----------------------------------- + + //FLICKER_ON + #if FLICKER_ON + col.a *= saturate(col.a * step(frac(0.05 + (_Time.w + randomSeed) * _FlickerFreq), 1 - _FlickerPercent) + _FlickerAlpha); + #endif + //----------------------------------- + + //ALPHACUTOFF_ON + + //ALPHAROUND_ON + + //ALPHAOUTLINE_ON + #if ALPHAOUTLINE_ON + half alphaOutlineRes = pow(1 - col.a, max(_AlphaOutlinePower, 0.0001)) * step(_AlphaOutlineMinAlpha, col.a) * _AlphaOutlineBlend; + col.rgb = lerp(col.rgb, _AlphaOutlineColor.rgb * _AlphaOutlineGlow, alphaOutlineRes); + col.a = lerp(col.a, 1, alphaOutlineRes > 1); + #endif + //------------------------------------------------------- + + //FOG_ON + + //------------------ + + col *= _Color; + o.Albedo = col; + col.a *= _Alpha; + clip(col.a - _AlphaCutoffValue - 0.01); + o.Alpha = _Color.a; + } + + + + + + void ChainSurfaceFunction(inout Surface l, inout ShaderData d) + { + Ext_SurfaceFunction0(l, d); + // Ext_SurfaceFunction1(l, d); + // Ext_SurfaceFunction2(l, d); + // Ext_SurfaceFunction3(l, d); + // Ext_SurfaceFunction4(l, d); + // Ext_SurfaceFunction5(l, d); + // Ext_SurfaceFunction6(l, d); + // Ext_SurfaceFunction7(l, d); + // Ext_SurfaceFunction8(l, d); + // Ext_SurfaceFunction9(l, d); + // Ext_SurfaceFunction10(l, d); + // Ext_SurfaceFunction11(l, d); + // Ext_SurfaceFunction12(l, d); + // Ext_SurfaceFunction13(l, d); + // Ext_SurfaceFunction14(l, d); + // Ext_SurfaceFunction15(l, d); + // Ext_SurfaceFunction16(l, d); + // Ext_SurfaceFunction17(l, d); + // Ext_SurfaceFunction18(l, d); + // Ext_SurfaceFunction19(l, d); + // Ext_SurfaceFunction20(l, d); + // Ext_SurfaceFunction21(l, d); + // Ext_SurfaceFunction22(l, d); + // Ext_SurfaceFunction23(l, d); + // Ext_SurfaceFunction24(l, d); + // Ext_SurfaceFunction25(l, d); + // Ext_SurfaceFunction26(l, d); + // Ext_SurfaceFunction27(l, d); + // Ext_SurfaceFunction28(l, d); + // Ext_SurfaceFunction29(l, d); + } + +#if !_DECALSHADER + + void ChainModifyVertex(inout VertexData v, inout VertexToPixel v2p, float4 time) + { + ExtraV2F d; + + ZERO_INITIALIZE(ExtraV2F, d); + ZERO_INITIALIZE(Blackboard, d.blackboard); + // due to motion vectors in HDRP, we need to use the last + // time in certain spots. So if you are going to use _Time to adjust vertices, + // you need to use this time or motion vectors will break. + d.time = time; + + Ext_ModifyVertex0(v, d); + // Ext_ModifyVertex1(v, d); + // Ext_ModifyVertex2(v, d); + // Ext_ModifyVertex3(v, d); + // Ext_ModifyVertex4(v, d); + // Ext_ModifyVertex5(v, d); + // Ext_ModifyVertex6(v, d); + // Ext_ModifyVertex7(v, d); + // Ext_ModifyVertex8(v, d); + // Ext_ModifyVertex9(v, d); + // Ext_ModifyVertex10(v, d); + // Ext_ModifyVertex11(v, d); + // Ext_ModifyVertex12(v, d); + // Ext_ModifyVertex13(v, d); + // Ext_ModifyVertex14(v, d); + // Ext_ModifyVertex15(v, d); + // Ext_ModifyVertex16(v, d); + // Ext_ModifyVertex17(v, d); + // Ext_ModifyVertex18(v, d); + // Ext_ModifyVertex19(v, d); + // Ext_ModifyVertex20(v, d); + // Ext_ModifyVertex21(v, d); + // Ext_ModifyVertex22(v, d); + // Ext_ModifyVertex23(v, d); + // Ext_ModifyVertex24(v, d); + // Ext_ModifyVertex25(v, d); + // Ext_ModifyVertex26(v, d); + // Ext_ModifyVertex27(v, d); + // Ext_ModifyVertex28(v, d); + // Ext_ModifyVertex29(v, d); + + + // #if %EXTRAV2F0REQUIREKEY% + // v2p.extraV2F0 = d.extraV2F0; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // v2p.extraV2F1 = d.extraV2F1; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // v2p.extraV2F2 = d.extraV2F2; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // v2p.extraV2F3 = d.extraV2F3; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // v2p.extraV2F4 = d.extraV2F4; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // v2p.extraV2F5 = d.extraV2F5; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // v2p.extraV2F6 = d.extraV2F6; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // v2p.extraV2F7 = d.extraV2F7; + // #endif + } + + void ChainModifyTessellatedVertex(inout VertexData v, inout VertexToPixel v2p) + { + ExtraV2F d; + ZERO_INITIALIZE(ExtraV2F, d); + ZERO_INITIALIZE(Blackboard, d.blackboard); + + // #if %EXTRAV2F0REQUIREKEY% + // d.extraV2F0 = v2p.extraV2F0; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // d.extraV2F1 = v2p.extraV2F1; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // d.extraV2F2 = v2p.extraV2F2; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // d.extraV2F3 = v2p.extraV2F3; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // d.extraV2F4 = v2p.extraV2F4; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // d.extraV2F5 = v2p.extraV2F5; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // d.extraV2F6 = v2p.extraV2F6; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // d.extraV2F7 = v2p.extraV2F7; + // #endif + + + // Ext_ModifyTessellatedVertex0(v, d); + // Ext_ModifyTessellatedVertex1(v, d); + // Ext_ModifyTessellatedVertex2(v, d); + // Ext_ModifyTessellatedVertex3(v, d); + // Ext_ModifyTessellatedVertex4(v, d); + // Ext_ModifyTessellatedVertex5(v, d); + // Ext_ModifyTessellatedVertex6(v, d); + // Ext_ModifyTessellatedVertex7(v, d); + // Ext_ModifyTessellatedVertex8(v, d); + // Ext_ModifyTessellatedVertex9(v, d); + // Ext_ModifyTessellatedVertex10(v, d); + // Ext_ModifyTessellatedVertex11(v, d); + // Ext_ModifyTessellatedVertex12(v, d); + // Ext_ModifyTessellatedVertex13(v, d); + // Ext_ModifyTessellatedVertex14(v, d); + // Ext_ModifyTessellatedVertex15(v, d); + // Ext_ModifyTessellatedVertex16(v, d); + // Ext_ModifyTessellatedVertex17(v, d); + // Ext_ModifyTessellatedVertex18(v, d); + // Ext_ModifyTessellatedVertex19(v, d); + // Ext_ModifyTessellatedVertex20(v, d); + // Ext_ModifyTessellatedVertex21(v, d); + // Ext_ModifyTessellatedVertex22(v, d); + // Ext_ModifyTessellatedVertex23(v, d); + // Ext_ModifyTessellatedVertex24(v, d); + // Ext_ModifyTessellatedVertex25(v, d); + // Ext_ModifyTessellatedVertex26(v, d); + // Ext_ModifyTessellatedVertex27(v, d); + // Ext_ModifyTessellatedVertex28(v, d); + // Ext_ModifyTessellatedVertex29(v, d); + + // #if %EXTRAV2F0REQUIREKEY% + // v2p.extraV2F0 = d.extraV2F0; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // v2p.extraV2F1 = d.extraV2F1; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // v2p.extraV2F2 = d.extraV2F2; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // v2p.extraV2F3 = d.extraV2F3; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // v2p.extraV2F4 = d.extraV2F4; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // v2p.extraV2F5 = d.extraV2F5; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // v2p.extraV2F6 = d.extraV2F6; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // v2p.extraV2F7 = d.extraV2F7; + // #endif + } + + void ChainFinalColorForward(inout Surface l, inout ShaderData d, inout half4 color) + { + // Ext_FinalColorForward0(l, d, color); + // Ext_FinalColorForward1(l, d, color); + // Ext_FinalColorForward2(l, d, color); + // Ext_FinalColorForward3(l, d, color); + // Ext_FinalColorForward4(l, d, color); + // Ext_FinalColorForward5(l, d, color); + // Ext_FinalColorForward6(l, d, color); + // Ext_FinalColorForward7(l, d, color); + // Ext_FinalColorForward8(l, d, color); + // Ext_FinalColorForward9(l, d, color); + // Ext_FinalColorForward10(l, d, color); + // Ext_FinalColorForward11(l, d, color); + // Ext_FinalColorForward12(l, d, color); + // Ext_FinalColorForward13(l, d, color); + // Ext_FinalColorForward14(l, d, color); + // Ext_FinalColorForward15(l, d, color); + // Ext_FinalColorForward16(l, d, color); + // Ext_FinalColorForward17(l, d, color); + // Ext_FinalColorForward18(l, d, color); + // Ext_FinalColorForward19(l, d, color); + // Ext_FinalColorForward20(l, d, color); + // Ext_FinalColorForward21(l, d, color); + // Ext_FinalColorForward22(l, d, color); + // Ext_FinalColorForward23(l, d, color); + // Ext_FinalColorForward24(l, d, color); + // Ext_FinalColorForward25(l, d, color); + // Ext_FinalColorForward26(l, d, color); + // Ext_FinalColorForward27(l, d, color); + // Ext_FinalColorForward28(l, d, color); + // Ext_FinalColorForward29(l, d, color); + } + + void ChainFinalGBufferStandard(inout Surface s, inout ShaderData d, inout half4 GBuffer0, inout half4 GBuffer1, inout half4 GBuffer2, inout half4 outEmission, inout half4 outShadowMask) + { + // Ext_FinalGBufferStandard0(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard1(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard2(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard3(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard4(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard5(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard6(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard7(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard8(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard9(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard10(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard11(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard12(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard13(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard14(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard15(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard16(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard17(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard18(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard19(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard20(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard21(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard22(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard23(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard24(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard25(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard26(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard27(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard28(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard29(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + } +#endif + + + + + +#if _DECALSHADER + + ShaderData CreateShaderData(SurfaceDescriptionInputs IN) + { + ShaderData d = (ShaderData)0; + d.TBNMatrix = float3x3(IN.WorldSpaceTangent, IN.WorldSpaceBiTangent, IN.WorldSpaceNormal); + d.worldSpaceNormal = IN.WorldSpaceNormal; + d.worldSpaceTangent = IN.WorldSpaceTangent; + + d.worldSpacePosition = IN.WorldSpacePosition; + d.texcoord0 = IN.uv0.xyxy; + d.screenPos = IN.ScreenPosition; + + d.worldSpaceViewDir = normalize(_WorldSpaceCameraPos - d.worldSpacePosition); + + d.tangentSpaceViewDir = mul(d.TBNMatrix, d.worldSpaceViewDir); + + // these rarely get used, so we back transform them. Usually will be stripped. + #if _HDRP + // d.localSpacePosition = mul(GetWorldToObjectMatrix(), float4(GetCameraRelativePositionWS(d.worldSpacePosition), 1)).xyz; + #else + // d.localSpacePosition = mul(GetWorldToObjectMatrix(), float4(d.worldSpacePosition, 1)).xyz; + #endif + // d.localSpaceNormal = normalize(mul((float3x3)GetWorldToObjectMatrix(), d.worldSpaceNormal)); + // d.localSpaceTangent = normalize(mul((float3x3)GetWorldToObjectMatrix(), d.worldSpaceTangent.xyz)); + + // #if %SCREENPOSREQUIREKEY% + // d.screenUV = (IN.ScreenPosition.xy / max(0.01, IN.ScreenPosition.w)); + // #endif + + return d; + } +#else + + ShaderData CreateShaderData(VertexToPixel i + #if NEED_FACING + , bool facing + #endif + ) + { + ShaderData d = (ShaderData)0; + d.clipPos = i.pos; + d.worldSpacePosition = i.worldPos; + + d.worldSpaceNormal = normalize(i.worldNormal); + d.worldSpaceTangent.xyz = normalize(i.worldTangent.xyz); + + d.tangentSign = i.worldTangent.w * unity_WorldTransformParams.w; + float3 bitangent = cross(d.worldSpaceTangent.xyz, d.worldSpaceNormal) * d.tangentSign; + + d.TBNMatrix = float3x3(d.worldSpaceTangent, -bitangent, d.worldSpaceNormal); + d.worldSpaceViewDir = normalize(_WorldSpaceCameraPos - i.worldPos); + + d.tangentSpaceViewDir = mul(d.TBNMatrix, d.worldSpaceViewDir); + d.texcoord0 = i.texcoord0; + d.texcoord1 = i.texcoord1; + d.texcoord2 = i.texcoord2; + + // #if %TEXCOORD3REQUIREKEY% + d.texcoord3 = i.texcoord3; + // #endif + + // d.isFrontFace = facing; + // #if %VERTEXCOLORREQUIREKEY% + d.vertexColor = i.vertexColor; + // #endif + + // these rarely get used, so we back transform them. Usually will be stripped. + #if _HDRP + // d.localSpacePosition = mul(GetWorldToObjectMatrix(), float4(GetCameraRelativePositionWS(i.worldPos), 1)).xyz; + #else + // d.localSpacePosition = mul(GetWorldToObjectMatrix(), float4(i.worldPos, 1)).xyz; + #endif + // d.localSpaceNormal = normalize(mul((float3x3)GetWorldToObjectMatrix(), i.worldNormal)); + // d.localSpaceTangent = normalize(mul((float3x3)GetWorldToObjectMatrix(), i.worldTangent.xyz)); + + // #if %SCREENPOSREQUIREKEY% + // d.screenPos = i.screenPos; + // d.screenUV = (i.screenPos.xy / i.screenPos.w); + // #endif + + + // #if %EXTRAV2F0REQUIREKEY% + // d.extraV2F0 = i.extraV2F0; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // d.extraV2F1 = i.extraV2F1; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // d.extraV2F2 = i.extraV2F2; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // d.extraV2F3 = i.extraV2F3; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // d.extraV2F4 = i.extraV2F4; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // d.extraV2F5 = i.extraV2F5; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // d.extraV2F6 = i.extraV2F6; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // d.extraV2F7 = i.extraV2F7; + // #endif + + return d; + } + +#endif + + + #if defined(_PASSSHADOW) + float3 _LightDirection; + float3 _LightPosition; + #endif + + // vertex shader + VertexToPixel Vert (VertexData v) + { + + VertexToPixel o = (VertexToPixel)0; + + UNITY_SETUP_INSTANCE_ID(v); + UNITY_TRANSFER_INSTANCE_ID(v, o); + UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o); + + +#if !_TESSELLATION_ON + ChainModifyVertex(v, o, _Time); +#endif + + o.texcoord0 = v.texcoord0; + o.texcoord1 = v.texcoord1; + o.texcoord2 = v.texcoord2; + + // #if %TEXCOORD3REQUIREKEY% + o.texcoord3 = v.texcoord3; + // #endif + + // #if %VERTEXCOLORREQUIREKEY% + o.vertexColor = v.vertexColor; + // #endif + + VertexPositionInputs vertexInput = GetVertexPositionInputs(v.vertex.xyz); + o.worldPos = TransformObjectToWorld(v.vertex.xyz); + o.worldNormal = TransformObjectToWorldNormal(v.normal); + o.worldTangent = float4(TransformObjectToWorldDir(v.tangent.xyz), v.tangent.w); + + // For some very odd reason, in 2021.2, we can't use Unity's defines, but have to use our own.. + #if _PASSSHADOW + #if _CASTING_PUNCTUAL_LIGHT_SHADOW + float3 lightDirectionWS = normalize(_LightPosition - o.worldPos); + #else + float3 lightDirectionWS = _LightDirection; + #endif + // Define shadow pass specific clip position for Universal + o.pos = TransformWorldToHClip(ApplyShadowBias(o.worldPos, o.worldNormal, lightDirectionWS)); + #if UNITY_REVERSED_Z + o.pos.z = min(o.pos.z, UNITY_NEAR_CLIP_VALUE); + #else + o.pos.z = max(o.pos.z, UNITY_NEAR_CLIP_VALUE); + #endif + #elif _PASSMETA + o.pos = MetaVertexPosition(float4(v.vertex.xyz, 0), v.texcoord1.xy, v.texcoord2.xy, unity_LightmapST, unity_DynamicLightmapST); + #else + o.pos = TransformWorldToHClip(o.worldPos); + #endif + + // #if %SCREENPOSREQUIREKEY% + // o.screenPos = ComputeScreenPos(o.pos, _ProjectionParams.x); + // #endif + + #if _PASSFORWARD || _PASSGBUFFER + float2 uv1 = v.texcoord1.xy; + OUTPUT_LIGHTMAP_UV(uv1, unity_LightmapST, o.lightmapUV); + o.texcoord1.xy = uv1; + OUTPUT_SH(o.worldNormal, o.sh); + #if defined(DYNAMICLIGHTMAP_ON) + o.dynamicLightmapUV.xy = v.texcoord2.xy * unity_DynamicLightmapST.xy + unity_DynamicLightmapST.zw; + #endif + #endif + + #ifdef VARYINGS_NEED_FOG_AND_VERTEX_LIGHT + half fogFactor = 0; + #if defined(_FOG_FRAGMENT) + fogFactor = ComputeFogFactor(o.pos.z); + #endif + #if _BAKEDLIT + o.fogFactorAndVertexLight = half4(fogFactor, 0, 0, 0); + #else + half3 vertexLight = VertexLighting(o.worldPos, o.worldNormal); + o.fogFactorAndVertexLight = half4(fogFactor, vertexLight); + #endif + #endif + + #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR) + o.shadowCoord = GetShadowCoord(vertexInput); + #endif + + return o; + } + + + + + #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/UnityGBuffer.hlsl" + + // fragment shader + FragmentOutput Frag (VertexToPixel IN + #ifdef _DEPTHOFFSET_ON + , out float outputDepth : SV_Depth + #endif + #if NEED_FACING + , bool facing : SV_IsFrontFace + #endif + ) + { + UNITY_SETUP_INSTANCE_ID(IN); + UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX(IN); + + ShaderData d = CreateShaderData(IN + #if NEED_FACING + , facing + #endif + ); + Surface l = (Surface)0; + + #ifdef _DEPTHOFFSET_ON + l.outputDepth = outputDepth; + #endif + + l.Albedo = half3(0.5, 0.5, 0.5); + l.Normal = float3(0,0,1); + l.Occlusion = 1; + l.Alpha = 1; + + ChainSurfaceFunction(l, d); + + #ifdef _DEPTHOFFSET_ON + outputDepth = l.outputDepth; + #endif + + #if _USESPECULAR || _SIMPLELIT + float3 specular = l.Specular; + float metallic = 0; + #else + float3 specular = 0; + float metallic = l.Metallic; + #endif + + InputData inputData = (InputData)0; + + inputData.positionWS = IN.worldPos; + #if _WORLDSPACENORMAL + inputData.normalWS = l.Normal; + #else + inputData.normalWS = normalize(TangentToWorldSpace(d, l.Normal)); + #endif + + inputData.viewDirectionWS = SafeNormalize(d.worldSpaceViewDir); + + + #if defined(MAIN_LIGHT_CALCULATE_SHADOWS) + inputData.shadowCoord = TransformWorldToShadowCoord(inputData.positionWS); + #else + inputData.shadowCoord = float4(0, 0, 0, 0); + #endif + + //inputData.fogCoord = IN.fogFactorAndVertexLight.x; + InitializeInputDataFog(float4(IN.worldPos, 1.0), IN.fogFactorAndVertexLight.x); + inputData.vertexLighting = IN.fogFactorAndVertexLight.yzw; + + + #if defined(_OVERRIDE_BAKEDGI) + inputData.bakedGI = l.DiffuseGI; + l.Emission += l.SpecularGI; + #else + #if defined(DYNAMICLIGHTMAP_ON) + inputData.bakedGI = SAMPLE_GI(IN.lightmapUV, IN.dynamicLightmapUV.xy, IN.sh, inputData.normalWS); + #else + inputData.bakedGI = SAMPLE_GI(IN.lightmapUV, IN.sh, inputData.normalWS); + #endif + #endif + + inputData.normalizedScreenSpaceUV = GetNormalizedScreenSpaceUV(IN.pos); + inputData.shadowMask = SAMPLE_SHADOWMASK(IN.lightmapUV); + + #if defined(DEBUG_DISPLAY) + #if defined(DYNAMICLIGHTMAP_ON) + inputData.dynamicLightmapUV = IN.dynamicLightmapUV.xy; + #endif + #if defined(LIGHTMAP_ON) + inputData.staticLightmapUV = IN.lightmapUV; + #else + inputData.vertexSH = IN.sh; + #endif + #endif + + #ifdef _DBUFFER + ApplyDecal(IN.pos, + l.Albedo, + specular, + inputData.normalWS, + metallic, + l.Occlusion, + l.Smoothness); + #endif + + BRDFData brdfData; + InitializeBRDFData(l.Albedo, metallic, specular, l.Smoothness, l.Alpha, brdfData); + Light mainLight = GetMainLight(inputData.shadowCoord, inputData.positionWS, inputData.shadowMask); + MixRealtimeAndBakedGI(mainLight, inputData.normalWS, inputData.bakedGI, inputData.shadowMask); + half3 color = GlobalIllumination(brdfData, inputData.bakedGI, l.Occlusion, inputData.positionWS, inputData.normalWS, inputData.viewDirectionWS); + + return BRDFDataToGbuffer(brdfData, inputData, l.Smoothness, l.Emission + color, l.Occlusion); + } + + ENDHLSL + + } + + + + Pass + { + Name "ShadowCaster" + Tags + { + "LightMode" = "ShadowCaster" + } + + // Render State + Blend One Zero, One Zero + Cull Back + ZTest LEqual + ZWrite On + // ColorMask: + + Tags { "RenderType" = "Opaque" "Queue" = "Geometry" "PreviewType" = "Plane" } + Cull [_CullingOption] + ZWrite [_ZWrite] + ZTest [_ZTestMode] + + + HLSLPROGRAM + + #pragma vertex Vert + #pragma fragment Frag + + #pragma target 3.0 + + #pragma prefer_hlslcc gles + #pragma exclude_renderers d3d11_9x + #pragma multi_compile_instancing + + #pragma multi_compile_vertex _ _CASTING_PUNCTUAL_LIGHT_SHADOW + + + #define _NORMAL_DROPOFF_TS 1 + #define ATTRIBUTES_NEED_NORMAL + #define ATTRIBUTES_NEED_TANGENT + #define _PASSSHADOW 1 + + + #pragma shader_feature_local GLOW_ON + #pragma shader_feature_local FADE_ON + #pragma shader_feature_local OUTBASE_ON + #pragma shader_feature_local ONLYOUTLINE_ON + #pragma shader_feature_local GRADIENT_ON + #pragma shader_feature_local GRADIENT2COL_ON + #pragma shader_feature_local RADIALGRADIENT_ON + #pragma shader_feature_local COLORSWAP_ON + #pragma shader_feature_local HSV_ON + #pragma shader_feature_local CHANGECOLOR_ON + #pragma shader_feature_local CHANGECOLOR2_ON + #pragma shader_feature_local CHANGECOLOR3_ON + #pragma shader_feature_local COLORRAMP_ON + #pragma shader_feature_local GRADIENTCOLORRAMP_ON + #pragma shader_feature_local HITEFFECT_ON + #pragma shader_feature_local NEGATIVE_ON + #pragma shader_feature_local PIXELATE_ON + #pragma shader_feature_local GREYSCALE_ON + #pragma shader_feature_local POSTERIZE_ON + #pragma shader_feature_local BLUR_ON + #pragma shader_feature_local MOTIONBLUR_ON + #pragma shader_feature_local GHOST_ON + #pragma shader_feature_local ALPHAOUTLINE_ON + #pragma shader_feature_local INNEROUTLINE_ON + #pragma shader_feature_local ONLYINNEROUTLINE_ON + #pragma shader_feature_local HOLOGRAM_ON + #pragma shader_feature_local CHROMABERR_ON + #pragma shader_feature_local GLITCH_ON + #pragma shader_feature_local FLICKER_ON + #pragma shader_feature_local SHADOW_ON + #pragma shader_feature_local SHINE_ON + #pragma shader_feature_local CONTRAST_ON + #pragma shader_feature_local OVERLAY_ON + #pragma shader_feature_local OVERLAYMULT_ON + #pragma shader_feature_local DOODLE_ON + #pragma shader_feature_local WIND_ON + #pragma shader_feature_local WAVEUV_ON + #pragma shader_feature_local ROUNDWAVEUV_ON + #pragma shader_feature_local RECTSIZE_ON + #pragma shader_feature_local OFFSETUV_ON + #pragma shader_feature_local CLIPPING_ON + #pragma shader_feature_local RADIALCLIPPING_ON + #pragma shader_feature_local TEXTURESCROLL_ON + #pragma shader_feature_local ZOOMUV_ON + #pragma shader_feature_local DISTORT_ON + #pragma shader_feature_local WARP_ON + #pragma shader_feature_local TWISTUV_ON + #pragma shader_feature_local ROTATEUV_ON + #pragma shader_feature_local POLARUV_ON + #pragma shader_feature_local FISHEYE_ON + #pragma shader_feature_local PINCH_ON + #pragma shader_feature_local SHAKEUV_ON + + #pragma shader_feature_local GLOWTEX_ON + #pragma shader_feature_local OUTTEX_ON + #pragma shader_feature_local OUTDIST_ON + #pragma shader_feature_local OUTBASE8DIR_ON + #pragma shader_feature_local OUTBASEPIXELPERF_ON + #pragma shader_feature_local COLORRAMPOUTLINE_ON + #pragma shader_feature_local GREYSCALEOUTLINE_ON + #pragma shader_feature_local POSTERIZEOUTLINE_ON + #pragma shader_feature_local BLURISHD_ON + #pragma shader_feature_local MANUALWIND_ON + #pragma shader_feature_local ATLAS_ON + #pragma shader_feature_local PREMULTIPLYALPHA_ON + + #pragma shader_feature BILBOARD_ON + #pragma shader_feature BILBOARDY_ON + + #pragma shader_feature NORMALMAP_ON + + + #define _URP 1 +#define _USINGTEXCOORD1 1 +#define _USINGTEXCOORD2 1 + + + #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" + + + #undef WorldNormalVector + #define WorldNormalVector(data, normal) mul(normal, data.TBNMatrix) + + #define UnityObjectToWorldNormal(normal) mul(GetObjectToWorldMatrix(), normal) + + #define _WorldSpaceLightPos0 _MainLightPosition + + #define UNITY_DECLARE_TEX2D(name) TEXTURE2D(name); SAMPLER(sampler##name); + #define UNITY_DECLARE_TEX2D_NOSAMPLER(name) TEXTURE2D(name); + #define UNITY_DECLARE_TEX2DARRAY(name) TEXTURE2D_ARRAY(name); SAMPLER(sampler##name); + #define UNITY_DECLARE_TEX2DARRAY_NOSAMPLER(name) TEXTURE2D_ARRAY(name); + + #define UNITY_SAMPLE_TEX2DARRAY(tex,coord) SAMPLE_TEXTURE2D_ARRAY(tex, sampler##tex, coord.xy, coord.z) + #define UNITY_SAMPLE_TEX2DARRAY_LOD(tex,coord,lod) SAMPLE_TEXTURE2D_ARRAY_LOD(tex, sampler##tex, coord.xy, coord.z, lod) + #define UNITY_SAMPLE_TEX2D(tex, coord) SAMPLE_TEXTURE2D(tex, sampler##tex, coord) + #define UNITY_SAMPLE_TEX2D_SAMPLER(tex, samp, coord) SAMPLE_TEXTURE2D(tex, sampler##samp, coord) + + #define UNITY_SAMPLE_TEX2D_LOD(tex,coord, lod) SAMPLE_TEXTURE2D_LOD(tex, sampler_##tex, coord, lod) + #define UNITY_SAMPLE_TEX2D_SAMPLER_LOD(tex,samplertex,coord, lod) SAMPLE_TEXTURE2D_LOD (tex, sampler##samplertex,coord, lod) + + #if defined(UNITY_COMPILER_HLSL) + #define UNITY_INITIALIZE_OUTPUT(type,name) name = (type)0; + #else + #define UNITY_INITIALIZE_OUTPUT(type,name) + #endif + + #define sampler2D_float sampler2D + #define sampler2D_half sampler2D + + + + // data across stages, stripped like the above. + struct VertexToPixel + { + float4 pos : SV_POSITION; + float3 worldPos : TEXCOORD0; + float3 worldNormal : TEXCOORD1; + float4 worldTangent : TEXCOORD2; + float4 texcoord0 : TEXCOORD3; + float4 texcoord1 : TEXCOORD4; + float4 texcoord2 : TEXCOORD5; + + // #if %TEXCOORD3REQUIREKEY% + float4 texcoord3 : TEXCOORD6; + // #endif + + // #if %SCREENPOSREQUIREKEY% + // float4 screenPos : TEXCOORD7; + // #endif + + // #if %VERTEXCOLORREQUIREKEY% + half4 vertexColor : COLOR; + // #endif + + #if defined(LIGHTMAP_ON) + float2 lightmapUV : TEXCOORD8; + #endif + #if defined(DYNAMICLIGHTMAP_ON) + float2 dynamicLightmapUV : TEXCOORD9; + #endif + #if !defined(LIGHTMAP_ON) + float3 sh : TEXCOORD10; + #endif + + #if defined(VARYINGS_NEED_FOG_AND_VERTEX_LIGHT) + float4 fogFactorAndVertexLight : TEXCOORD11; + #endif + + #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR) + float4 shadowCoord : TEXCOORD12; + #endif + + // #if %EXTRAV2F0REQUIREKEY% + // float4 extraV2F0 : TEXCOORD13; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // float4 extraV2F1 : TEXCOORD14; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // float4 extraV2F2 : TEXCOORD15; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // float4 extraV2F3 : TEXCOORD16; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // float4 extraV2F4 : TEXCOORD17; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // float4 extraV2F5 : TEXCOORD18; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // float4 extraV2F6 : TEXCOORD19; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // float4 extraV2F7 : TEXCOORD20; + // #endif + + #if UNITY_ANY_INSTANCING_ENABLED + uint instanceID : CUSTOM_INSTANCE_ID; + #endif + #if (defined(UNITY_STEREO_MULTIVIEW_ENABLED)) || (defined(UNITY_STEREO_INSTANCING_ENABLED) && (defined(SHADER_API_GLES3) || defined(SHADER_API_GLCORE))) + uint stereoTargetEyeIndexAsBlendIdx0 : BLENDINDICES0; + #endif + #if (defined(UNITY_STEREO_INSTANCING_ENABLED)) + uint stereoTargetEyeIndexAsRTArrayIdx : SV_RenderTargetArrayIndex; + #endif + #if defined(SHADER_STAGE_FRAGMENT) && defined(VARYINGS_NEED_CULLFACE) + FRONT_FACE_TYPE cullFace : FRONT_FACE_SEMANTIC; + #endif + + + }; + + + + + // data describing the user output of a pixel + struct Surface + { + half3 Albedo; + half Height; + half3 Normal; + half Smoothness; + half3 Emission; + half Metallic; + half3 Specular; + half Occlusion; + half SpecularPower; // for simple lighting + half Alpha; + float outputDepth; // if written, SV_Depth semantic is used. ShaderData.clipPos.z is unused value + // HDRP Only + half SpecularOcclusion; + half SubsurfaceMask; + half Thickness; + half CoatMask; + half CoatSmoothness; + half Anisotropy; + half IridescenceMask; + half IridescenceThickness; + int DiffusionProfileHash; + float SpecularAAThreshold; + float SpecularAAScreenSpaceVariance; + // requires _OVERRIDE_BAKEDGI to be defined, but is mapped in all pipelines + float3 DiffuseGI; + float3 BackDiffuseGI; + float3 SpecularGI; + float ior; + float3 transmittanceColor; + float atDistance; + float transmittanceMask; + // requires _OVERRIDE_SHADOWMASK to be defines + float4 ShadowMask; + + // for decals + float NormalAlpha; + float MAOSAlpha; + + + }; + + // Data the user declares in blackboard blocks + struct Blackboard + { + + float blackboardDummyData; + }; + + // data the user might need, this will grow to be big. But easy to strip + struct ShaderData + { + float4 clipPos; // SV_POSITION + float3 localSpacePosition; + float3 localSpaceNormal; + float3 localSpaceTangent; + + float3 worldSpacePosition; + float3 worldSpaceNormal; + float3 worldSpaceTangent; + float tangentSign; + + float3 worldSpaceViewDir; + float3 tangentSpaceViewDir; + + float4 texcoord0; + float4 texcoord1; + float4 texcoord2; + float4 texcoord3; + + float2 screenUV; + float4 screenPos; + + float4 vertexColor; + bool isFrontFace; + + float4 extraV2F0; + float4 extraV2F1; + float4 extraV2F2; + float4 extraV2F3; + float4 extraV2F4; + float4 extraV2F5; + float4 extraV2F6; + float4 extraV2F7; + + float3x3 TBNMatrix; + Blackboard blackboard; + }; + + struct VertexData + { + #if SHADER_TARGET > 30 + // uint vertexID : SV_VertexID; + #endif + float4 vertex : POSITION; + float3 normal : NORMAL; + float4 tangent : TANGENT; + float4 texcoord0 : TEXCOORD0; + + // optimize out mesh coords when not in use by user or lighting system + #if _URP && (_USINGTEXCOORD1 || _PASSMETA || _PASSFORWARD || _PASSGBUFFER) + float4 texcoord1 : TEXCOORD1; + #endif + + #if _URP && (_USINGTEXCOORD2 || _PASSMETA || ((_PASSFORWARD || _PASSGBUFFER) && defined(DYNAMICLIGHTMAP_ON))) + float4 texcoord2 : TEXCOORD2; + #endif + + #if _STANDARD && (_USINGTEXCOORD1 || (_PASSMETA || ((_PASSFORWARD || _PASSGBUFFER || _PASSFORWARDADD) && LIGHTMAP_ON))) + float4 texcoord1 : TEXCOORD1; + #endif + #if _STANDARD && (_USINGTEXCOORD2 || (_PASSMETA || ((_PASSFORWARD || _PASSGBUFFER) && DYNAMICLIGHTMAP_ON))) + float4 texcoord2 : TEXCOORD2; + #endif + + + #if _HDRP + float4 texcoord1 : TEXCOORD1; + float4 texcoord2 : TEXCOORD2; + #endif + + // #if %TEXCOORD3REQUIREKEY% + float4 texcoord3 : TEXCOORD3; + // #endif + + // #if %VERTEXCOLORREQUIREKEY% + float4 vertexColor : COLOR; + // #endif + + #if _PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR)) + float3 previousPositionOS : TEXCOORD4; // Contain previous transform position (in case of skinning for example) + #if defined (_ADD_PRECOMPUTED_VELOCITY) + float3 precomputedVelocity : TEXCOORD5; // Add Precomputed Velocity (Alembic computes velocities on runtime side). + #endif + #endif + + UNITY_VERTEX_INPUT_INSTANCE_ID + }; + + struct TessVertex + { + float4 vertex : INTERNALTESSPOS; + float3 normal : NORMAL; + float4 tangent : TANGENT; + float4 texcoord0 : TEXCOORD0; + float4 texcoord1 : TEXCOORD1; + float4 texcoord2 : TEXCOORD2; + + // #if %TEXCOORD3REQUIREKEY% + float4 texcoord3 : TEXCOORD3; + // #endif + + // #if %VERTEXCOLORREQUIREKEY% + float4 vertexColor : COLOR; + // #endif + + // #if %EXTRAV2F0REQUIREKEY% + // float4 extraV2F0 : TEXCOORD5; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // float4 extraV2F1 : TEXCOORD6; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // float4 extraV2F2 : TEXCOORD7; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // float4 extraV2F3 : TEXCOORD8; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // float4 extraV2F4 : TEXCOORD9; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // float4 extraV2F5 : TEXCOORD10; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // float4 extraV2F6 : TEXCOORD11; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // float4 extraV2F7 : TEXCOORD12; + // #endif + + #if _PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR)) + float3 previousPositionOS : TEXCOORD13; // Contain previous transform position (in case of skinning for example) + #if defined (_ADD_PRECOMPUTED_VELOCITY) + float3 precomputedVelocity : TEXCOORD14; + #endif + #endif + + UNITY_VERTEX_INPUT_INSTANCE_ID + UNITY_VERTEX_OUTPUT_STEREO + }; + + struct ExtraV2F + { + float4 extraV2F0; + float4 extraV2F1; + float4 extraV2F2; + float4 extraV2F3; + float4 extraV2F4; + float4 extraV2F5; + float4 extraV2F6; + float4 extraV2F7; + Blackboard blackboard; + float4 time; + }; + + + float3 WorldToTangentSpace(ShaderData d, float3 normal) + { + return mul(d.TBNMatrix, normal); + } + + float3 TangentToWorldSpace(ShaderData d, float3 normal) + { + return mul(normal, d.TBNMatrix); + } + + // in this case, make standard more like SRPs, because we can't fix + // unity_WorldToObject in HDRP, since it already does macro-fu there + + #if _STANDARD + float3 TransformWorldToObject(float3 p) { return mul(unity_WorldToObject, float4(p, 1)); }; + float3 TransformObjectToWorld(float3 p) { return mul(unity_ObjectToWorld, float4(p, 1)); }; + float4 TransformWorldToObject(float4 p) { return mul(unity_WorldToObject, p); }; + float4 TransformObjectToWorld(float4 p) { return mul(unity_ObjectToWorld, p); }; + float4x4 GetWorldToObjectMatrix() { return unity_WorldToObject; } + float4x4 GetObjectToWorldMatrix() { return unity_ObjectToWorld; } + #if (defined(SHADER_API_D3D11) || defined(SHADER_API_XBOXONE) || defined(UNITY_COMPILER_HLSLCC) || defined(SHADER_API_PSSL) || (SHADER_TARGET_SURFACE_ANALYSIS && !SHADER_TARGET_SURFACE_ANALYSIS_MOJOSHADER)) + #define UNITY_SAMPLE_TEX2D_LOD(tex,coord, lod) tex.SampleLevel (sampler##tex,coord, lod) + #define UNITY_SAMPLE_TEX2D_SAMPLER_LOD(tex,samplertex,coord, lod) tex.SampleLevel (sampler##samplertex,coord, lod) + #else + #define UNITY_SAMPLE_TEX2D_LOD(tex,coord,lod) tex2D (tex,coord,0,lod) + #define UNITY_SAMPLE_TEX2D_SAMPLER_LOD(tex,samplertex,coord,lod) tex2D (tex,coord,0,lod) + #endif + + #undef GetWorldToObjectMatrix() + + #define GetWorldToObjectMatrix() unity_WorldToObject + + + #endif + + float3 GetCameraWorldPosition() + { + #if _HDRP + return GetCameraRelativePositionWS(_WorldSpaceCameraPos); + #else + return _WorldSpaceCameraPos; + #endif + } + + #if _GRABPASSUSED + #if _STANDARD + TEXTURE2D(%GRABTEXTURE%); + SAMPLER(sampler_%GRABTEXTURE%); + #endif + + half3 GetSceneColor(float2 uv) + { + #if _STANDARD + return SAMPLE_TEXTURE2D(%GRABTEXTURE%, sampler_%GRABTEXTURE%, uv).rgb; + #else + return SHADERGRAPH_SAMPLE_SCENE_COLOR(uv); + #endif + } + #endif + + + + #if _STANDARD + UNITY_DECLARE_DEPTH_TEXTURE(_CameraDepthTexture); + float GetSceneDepth(float2 uv) { return SAMPLE_DEPTH_TEXTURE(_CameraDepthTexture, uv); } + float GetLinear01Depth(float2 uv) { return Linear01Depth(GetSceneDepth(uv)); } + float GetLinearEyeDepth(float2 uv) { return LinearEyeDepth(GetSceneDepth(uv)); } + #else + float GetSceneDepth(float2 uv) { return SHADERGRAPH_SAMPLE_SCENE_DEPTH(uv); } + float GetLinear01Depth(float2 uv) { return Linear01Depth(GetSceneDepth(uv), _ZBufferParams); } + float GetLinearEyeDepth(float2 uv) { return LinearEyeDepth(GetSceneDepth(uv), _ZBufferParams); } + #endif + + float3 GetWorldPositionFromDepthBuffer(float2 uv, float3 worldSpaceViewDir) + { + float eye = GetLinearEyeDepth(uv); + float3 camView = mul((float3x3)GetObjectToWorldMatrix(), transpose(mul(GetWorldToObjectMatrix(), UNITY_MATRIX_I_V)) [2].xyz); + + float dt = dot(worldSpaceViewDir, camView); + float3 div = worldSpaceViewDir/dt; + float3 wpos = (eye * div) + GetCameraWorldPosition(); + return wpos; + } + + #if _HDRP + float3 ObjectToWorldSpacePosition(float3 pos) + { + return GetAbsolutePositionWS(TransformObjectToWorld(pos)); + } + #else + float3 ObjectToWorldSpacePosition(float3 pos) + { + return TransformObjectToWorld(pos); + } + #endif + + #if _STANDARD + UNITY_DECLARE_SCREENSPACE_TEXTURE(_CameraDepthNormalsTexture); + float3 GetSceneNormal(float2 uv, float3 worldSpaceViewDir) + { + float4 depthNorms = UNITY_SAMPLE_SCREENSPACE_TEXTURE(_CameraDepthNormalsTexture, uv); + float3 norms = DecodeViewNormalStereo(depthNorms); + norms = mul((float3x3)GetWorldToViewMatrix(), norms) * 0.5 + 0.5; + return norms; + } + #elif _HDRP && !_DECALSHADER + + float3 GetSceneNormal(float2 uv, float3 worldSpaceViewDir) + { + NormalData nd; + DecodeFromNormalBuffer(_ScreenSize.xy * uv, nd); + return nd.normalWS; + } + #elif _URP + #if (SHADER_LIBRARY_VERSION_MAJOR >= 10) + #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/DeclareNormalsTexture.hlsl" + #endif + + float3 GetSceneNormal(float2 uv, float3 worldSpaceViewDir) + { + #if (SHADER_LIBRARY_VERSION_MAJOR >= 10) + return SampleSceneNormals(uv); + #else + float3 wpos = GetWorldPositionFromDepthBuffer(uv, worldSpaceViewDir); + return normalize(-cross(ddx(wpos), ddy(wpos))) * 0.5 + 0.5; + #endif + + } + #endif + + #if _HDRP + + half3 UnpackNormalmapRGorAG(half4 packednormal) + { + // This do the trick + packednormal.x *= packednormal.w; + + half3 normal; + normal.xy = packednormal.xy * 2 - 1; + normal.z = sqrt(1 - saturate(dot(normal.xy, normal.xy))); + return normal; + } + half3 UnpackNormal(half4 packednormal) + { + #if defined(UNITY_NO_DXT5nm) + return packednormal.xyz * 2 - 1; + #else + return UnpackNormalmapRGorAG(packednormal); + #endif + } + #endif + #if _HDRP || _URP + + half3 UnpackScaleNormal(half4 packednormal, half scale) + { + #ifndef UNITY_NO_DXT5nm + // Unpack normal as DXT5nm (1, y, 1, x) or BC5 (x, y, 0, 1) + // Note neutral texture like "bump" is (0, 0, 1, 1) to work with both plain RGB normal and DXT5nm/BC5 + packednormal.x *= packednormal.w; + #endif + half3 normal; + normal.xy = (packednormal.xy * 2 - 1) * scale; + normal.z = sqrt(1 - saturate(dot(normal.xy, normal.xy))); + return normal; + } + + #endif + + + void GetSun(out float3 lightDir, out float3 color) + { + lightDir = float3(0.5, 0.5, 0); + color = 1; + #if _HDRP + if (_DirectionalLightCount > 0) + { + DirectionalLightData light = _DirectionalLightDatas[0]; + lightDir = -light.forward.xyz; + color = light.color; + } + #elif _STANDARD + lightDir = normalize(_WorldSpaceLightPos0.xyz); + color = _LightColor0.rgb; + #elif _URP + Light light = GetMainLight(); + lightDir = light.direction; + color = light.color; + #endif + } + + + + CBUFFER_START(UnityPerMaterial) + + + half4 _Color; + half4 _MainTex_ST, _MainTex_TexelSize; + half _Alpha, _AlphaCutoffValue; + + #if ATLAS_ON + half _MinXUV, _MaxXUV, _MinYUV, _MaxYUV; + #endif + + #if GLOW_ON + half4 _GlowColor; + half _Glow, _GlowGlobal; + #endif + + #if HSV_ON + half _HsvShift, _HsvSaturation, _HsvBright; + #endif + + #if DISTORT_ON + half4 _DistortTex_ST; + half _DistortTexXSpeed, _DistortTexYSpeed, _DistortAmount; + #endif + + #if FADE_ON + half4 _FadeBurnColor, _FadeTex_ST, _FadeBurnTex_ST; + half _FadeAmount, _FadeBurnWidth, _FadeBurnTransition,_FadeBurnGlow; + #endif + + #if OUTBASE_ON + half4 _OutlineColor; + half _OutlineAlpha, _OutlineGlow, _OutlineWidth; + int _OutlinePixelWidth; + #endif + + #if OUTTEX_ON + half4 _OutlineTex_ST; + half _OutlineTexXSpeed, _OutlineTexYSpeed; + #endif + + #if OUTDIST_ON + half4 _OutlineDistortTex_ST; + half _OutlineDistortTexXSpeed, _OutlineDistortTexYSpeed, _OutlineDistortAmount; + #endif + + #if ALPHAOUTLINE_ON + half _AlphaOutlineGlow, _AlphaOutlinePower, _AlphaOutlineMinAlpha, _AlphaOutlineBlend; + half4 _AlphaOutlineColor; + #endif + + #if INNEROUTLINE_ON + half _InnerOutlineThickness, _InnerOutlineAlpha, _InnerOutlineGlow; + half4 _InnerOutlineColor; + #endif + + #if GRADIENT_ON + half _GradBlend, _GradBoostX, _GradBoostY; + half4 _GradTopRightCol, _GradTopLeftCol, _GradBotRightCol, _GradBotLeftCol; + #endif + + #if COLORSWAP_ON + half4 _ColorSwapRed, _ColorSwapGreen, _ColorSwapBlue; + half _ColorSwapRedLuminosity, _ColorSwapGreenLuminosity, _ColorSwapBlueLuminosity, _ColorSwapBlend; + #endif + + #if CHANGECOLOR_ON + half4 _ColorChangeNewCol, _ColorChangeTarget; + half _ColorChangeTolerance, _ColorChangeLuminosity; + #endif + #if CHANGECOLOR2_ON + half4 _ColorChangeNewCol2, _ColorChangeTarget2; + half _ColorChangeTolerance2; + #endif + #if CHANGECOLOR3_ON + half4 _ColorChangeNewCol3, _ColorChangeTarget3; + half _ColorChangeTolerance3; + #endif + + #if COLORRAMP_ON + half _ColorRampLuminosity, _ColorRampBlend; + #endif + + #if HITEFFECT_ON + half4 _HitEffectColor; + half _HitEffectGlow, _HitEffectBlend; + #endif + + #if NEGATIVE_ON + half _NegativeAmount; + #endif + + #if PIXELATE_ON + half _PixelateSize; + #endif + + #if GREYSCALE_ON + half _GreyscaleLuminosity, _GreyscaleBlend; + half4 _GreyscaleTintColor; + #endif + + #if POSTERIZE_ON + half _PosterizeNumColors, _PosterizeGamma; + #endif + + #if BLUR_ON + half _BlurIntensity; + #endif + + #if MOTIONBLUR_ON + half _MotionBlurAngle, _MotionBlurDist; + #endif + + #if GHOST_ON + half _GhostColorBoost, _GhostTransparency, _GhostBlend; + #endif + + #if HOLOGRAM_ON + half _HologramStripesAmount, _HologramMinAlpha, _HologramUnmodAmount, _HologramStripesSpeed, _HologramMaxAlpha, _HologramBlend; + half4 _HologramStripeColor; + #endif + + #if CHROMABERR_ON + half _ChromAberrAmount, _ChromAberrAlpha; + #endif + + #if GLITCH_ON + half _GlitchAmount, _GlitchSize; + #endif + + #if FLICKER_ON + half _FlickerFreq, _FlickerPercent, _FlickerAlpha; + #endif + + #if SHADOW_ON + half _ShadowX, _ShadowY, _ShadowAlpha; + half4 _ShadowColor; + #endif + + #if SHINE_ON + half4 _ShineColor; + half _ShineLocation, _ShineRotate, _ShineWidth, _ShineGlow; + #endif + + #if CONTRAST_ON + half _Contrast, _Brightness; + #endif + + #if OVERLAY_ON + half4 _OverlayTex_ST, _OverlayColor; + half _OverlayGlow, _OverlayBlend, _OverlayTextureScrollXSpeed, _OverlayTextureScrollYSpeed; + #endif + + #if DOODLE_ON + half _HandDrawnAmount, _HandDrawnSpeed; + #endif + + #if WIND_ON + half _GrassSpeed, _GrassWind, _GrassManualAnim, _GrassRadialBend; + #endif + + #if WAVEUV_ON + float _WaveAmount, _WaveSpeed, _WaveStrength, _WaveX, _WaveY; + #endif + + #if ROUNDWAVEUV_ON + half _RoundWaveStrength, _RoundWaveSpeed; + #endif + + #if RECTSIZE_ON + half _RectSize; + #endif + + #if OFFSETUV_ON + half _OffsetUvX, _OffsetUvY; + #endif + + #if CLIPPING_ON + half _ClipUvLeft, _ClipUvRight, _ClipUvUp, _ClipUvDown; + #endif + + #if RADIALCLIPPING_ON + half _RadialStartAngle, _RadialClip, _RadialClip2; + #endif + + #if TEXTURESCROLL_ON + half _TextureScrollXSpeed, _TextureScrollYSpeed; + #endif + + #if ZOOMUV_ON + half _ZoomUvAmount; + #endif + + #if WARP_ON + half _WarpStrength, _WarpSpeed, _WarpScale; + #endif + + #if TWISTUV_ON + half _TwistUvAmount, _TwistUvPosX, _TwistUvPosY, _TwistUvRadius; + #endif + + #if ROTATEUV_ON + half _RotateUvAmount; + #endif + + #if FISHEYE_ON + half _FishEyeUvAmount; + #endif + + #if PINCH_ON + half _PinchUvAmount; + #endif + + #if SHAKEUV_ON + half _ShakeUvSpeed, _ShakeUvX, _ShakeUvY; + #endif + + #if NORMALMAP_ON + half _NormalStrength; + #endif + + float _RandomSeed; + + + + + CBUFFER_END + + + + + + + + TEXTURE2D(_MainTex); + SAMPLER(sampler_MainTex); + + #if GLOW_ON + TEXTURE2D(_GlowTex); + SAMPLER(sampler_GlowTex); + #endif + + #if FADE_ON + TEXTURE2D(_FadeTex); + SAMPLER(sampler_FadeTex); + + TEXTURE2D(_FadeBurnTex); + SAMPLER(sampler_FadeBurnTex); + #endif + + #if DISTORT_ON + TEXTURE2D(_DistortTex); + SAMPLER(sampler_DistortTex); + #endif + + #if OUTTEX_ON + TEXTURE2D(_OutlineTex); + SAMPLER(sampler_OutlineTex); + #endif + + #if OUTDIST_ON + TEXTURE2D(_OutlineDistortTex); + SAMPLER(sampler_OutlineDistortTex); + #endif + + #if COLORSWAP_ON + TEXTURE2D(_ColorSwapTex); + SAMPLER(sampler_ColorSwapTex); + #endif + + #if COLORRAMP_ON + TEXTURE2D(_ColorRampTex); + TEXTURE2D(_ColorRampTexGradient); + SAMPLER(sampler_ColorRampTex); + SAMPLER(sampler_ColorRampTexGradient); + #endif + + #if SHINE_ON + TEXTURE2D(_ShineMask); + SAMPLER(sampler_ShineMask); + #endif + + #if OVERLAY_ON + TEXTURE2D(_OverlayTex); + SAMPLER(sampler_OverlayTex); + #endif + + #if NORMALMAP_ON + TEXTURE2D(_NormalMap); + SAMPLER(sampler_NormalMap); + #endif + + + half3 GetPixel(in int offsetX, in int offsetY, in half2 uv, in Texture2D _tex, in SamplerState _sampler) + { + half2 _uv = uv + half2(offsetX * _MainTex_TexelSize.x, offsetY * _MainTex_TexelSize.y); + half4 col = SAMPLE_TEXTURE2D(_tex, _sampler, _uv); + return col.rgb; + } + + + //BLURS------------------------------------------------------------------------- + half4 Blur(half2 uv, Texture2D source, SamplerState sampler_source, half Intensity) + { + const half2 texelSize = 1.0 / _ScreenParams.xy; + const half4 color = SAMPLE_TEXTURE2D(source, sampler_source, uv); + const half2 offset = Intensity * texelSize; + + half4 accumulatedColor = color; + half accumulatedWeight = 1.0; + for (int x = -1; x <= 1; x++) + { + for (int y = -1; y <= 1; y++) + { + const half2 sampleUV = uv + half2(x, y) * offset; + const half4 sampleColor = SAMPLE_TEXTURE2D(source, sampler_source, sampleUV); + + accumulatedColor += sampleColor; + accumulatedWeight += 1.0; + } + } + + half4 blurredColor = accumulatedColor / accumulatedWeight; + return blurredColor; + } + + half BlurHD_G(half bhqp, half x) + { + return exp(-(x * x) / (2.0 * bhqp * bhqp)); + } + half4 BlurHD(half2 uv, Texture2D source, SamplerState sampler_source, half BlurAmount, half xScale, half yScale) + { + int iterations = 16; + int halfIterations = iterations / 2; + half sigmaX = 0.1 + BlurAmount * 0.5; + half sigmaY = sigmaX; + half total = 0.0; + half4 ret = half4(0, 0, 0, 0); + for (int iy = 0; iy < iterations; ++iy) + { + half fy = BlurHD_G(sigmaY, half(iy) -half(halfIterations)); + half offsetY = half(iy - halfIterations) * 0.00390625 * xScale; + for (int ix = 0; ix < iterations; ++ix) + { + half fx = BlurHD_G(sigmaX, half(ix) - half(halfIterations)); + half offsetX = half(ix - halfIterations) * 0.00390625 * yScale; + total += fx * fy; + ret += SAMPLE_TEXTURE2D(source, sampler_source, uv + half2(offsetX, offsetY)) * fx * fy; + } + } + return ret / total; + } + //----------------------------------------------------------------------- + + + //------------------------------------------- + half RemapFloat(half inValue, half inMin, half inMax, half outMin, half outMax){ + return outMin + (inValue - inMin) * (outMax - outMin) / (inMax - inMin); + } + //------------------------------------------- + + //----------------------------------------------------------------------- + half rand(half2 seed, half offset) { + return (frac(sin(dot(seed, half2(12.9898, 78.233))) * 43758.5453) + offset) % 1.0; + } + + half rand2(half2 seed, half offset) { + return (frac(sin(dot(seed * floor(50 + (_Time.x % 1.0) * 12.), half2(127.1, 311.7))) * 43758.5453123) + offset) % 1.0; + } + + half rand2CustomTime(half2 seed, half offset, half customTime) { + return (frac(sin(dot(seed * floor(50 + (customTime % 1.0) * 12.), half2(127.1, 311.7))) * 43758.5453123) + offset) % 1.0; + } + //----------------------------------------------------------------------- + + + void Ext_ModifyVertex0 (inout VertexData v, inout ExtraV2F d) + { + //BILBOARD_ON + #if BILBOARD_ON + half3 camRight = mul((half3x3)unity_CameraToWorld, half3(1,0,0)); + half3 camUp = half3(0,1,0); + #if BILBOARDY_ON + camUp = mul((half3x3)unity_CameraToWorld, half3(0,1,0)); + #endif + half3 localPos = v.vertex.x * camRight + v.vertex.y * camUp; + v.vertex = half4(localPos, 1); + #endif + //----------------------------------------------------------- + + v.texcoord0.xy = TRANSFORM_TEX(v.texcoord0.xy, _MainTex); + half2 center = half2(0.5, 0.5); + #if ATLAS_ON + center = half2((_MaxXUV + _MinXUV) / 2.0, (_MaxYUV + _MinYUV) / 2.0); + #endif + + //POLARUV_ON + #if POLARUV_ON + v.texcoord0.xy = v.texcoord0.xy - center; + #endif + + //---------------------------------------- + + //ROTATEUV_ON + #if ROTATEUV_ON + half2 uvC = v.texcoord0.xy; + half cosAngle = cos(_RotateUvAmount); + half sinAngle = sin(_RotateUvAmount); + half2x2 rot = half2x2(cosAngle, -sinAngle, sinAngle, cosAngle); + uvC -= center; + v.texcoord0.xy = mul(rot, uvC); + v.texcoord0.xy += center; + #endif + //-------------------- + + #if RECTSIZE_ON + v.vertex.xyz += (v.vertex.xyz * (_RectSize - 1.0)); + #endif + + #if OUTTEX_ON + v.texcoord1.xy = TRANSFORM_TEX(v.texcoord0.xy, _OutlineTex); + #endif + + #if OUTDIST_ON + v.texcoord2.xy = TRANSFORM_TEX(v.texcoord0.xy, _OutlineDistortTex); + #endif + + #if DISTORT_ON + v.texcoord3.xy = TRANSFORM_TEX(v.texcoord0.xy, _DistortTex); + #endif + } + + void Ext_SurfaceFunction0 (inout Surface o, ShaderData d) + { + half randomSeed = _RandomSeed; + + float2 uvRect = d.texcoord0; + half2 center = half2(0.5, 0.5); + #if ATLAS_ON + center = half2((_MaxXUV + _MinXUV) / 2.0, (_MaxYUV + _MinYUV) / 2.0); + uvRect = half2((d.texcoord0.x - _MinXUV) / (_MaxXUV - _MinXUV), (d.texcoord0.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half2 centerTiled = half2(center.x * _MainTex_ST.x, center.y * _MainTex_ST.y); + + //CLIPPING_ON + #if CLIPPING_ON + half2 tiledUv = half2(d.texcoord0.x / _MainTex_ST.x, d.texcoord0.y / _MainTex_ST.y); + #if ATLAS_ON + tiledUv = half2((tiledUv.x - _MinXUV) / (_MaxXUV - _MinXUV), (tiledUv.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + clip((1 - _ClipUvUp) - tiledUv.y); + clip(tiledUv.y - _ClipUvDown); + clip((1 - _ClipUvRight) - tiledUv.x); + clip(tiledUv.x - _ClipUvLeft); + #endif + //---------------------------------- + + //RADIALCLIPPING_ON + #if RADIALCLIPPING_ON + half2 tiledUv2 = half2(d.texcoord0.x / _MainTex_ST.x, d.texcoord0.y / _MainTex_ST.y); + #if ATLAS_ON + tiledUv2 = half2((tiledUv2.x - _MinXUV) / (_MaxXUV - _MinXUV), (tiledUv2.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half startAngle = _RadialStartAngle - _RadialClip; + half endAngle = _RadialStartAngle + _RadialClip2; + half offset0 = clamp(0, 360, startAngle + 360); + half offset360 = clamp(0, 360, endAngle - 360); + half2 atan2Coord = half2(lerp(-1, 1, tiledUv2.x), lerp(-1, 1, tiledUv2.y)); + half atanAngle = atan2(atan2Coord.y, atan2Coord.x) * 57.3; // angle in degrees + if(atanAngle < 0) atanAngle = 360 + atanAngle; + if(atanAngle >= startAngle && atanAngle <= endAngle) discard; + if(atanAngle <= offset360) discard; + if(atanAngle >= offset0) discard; + #endif + + //----------------------------- + + //TEXTURESCROLL_ON && ATLAS_ON + #if TEXTURESCROLL_ON && ATLAS_ON + d.texcoord0.xy = half2(_MinXUV + ((_MaxXUV - _MinXUV) * (abs(((_Time.y + randomSeed) * _TextureScrollXSpeed) + uvRect.x) % 1)), + _MinYUV + ((_MaxYUV - _MinYUV) * (abs(((_Time.y + randomSeed) * _TextureScrollYSpeed) + uvRect.y) % 1))); + #endif + //---------------------------- + + //OFFSETUV_ON + #if OFFSETUV_ON + #if ATLAS_ON + d.texcoord0.xy = half2(_MinXUV + ((_MaxXUV - _MinXUV) * (abs((_OffsetUvX + uvRect.x) % 1))), + _MinYUV + ((_MaxYUV - _MinYUV) * (abs(_OffsetUvY + uvRect.y) % 1))); + #else + d.texcoord0.xy += half2(_OffsetUvX, _OffsetUvY); + #endif + #endif + + //---------------------- + + //POLARUV_ON + #if POLARUV_ON + d.texcoord0.xy = half2(atan2(d.texcoord0.y, d.texcoord0.x) / (2.0f * 3.141592653589f), length(d.texcoord0.xy)); + d.texcoord0.xy *= _MainTex_ST.xy; + #endif + + //-------------------------------------- + + //TWISTUV_ON + #if TWISTUV_ON + #if ATLAS_ON + _TwistUvPosX = ((_MaxXUV - _MinXUV) * _TwistUvPosX) + _MinXUV; + _TwistUvPosY = ((_MaxYUV - _MinYUV) * _TwistUvPosY) + _MinYUV; + #endif + half2 tempUv = d.texcoord0.xy - half2(_TwistUvPosX * _MainTex_ST.x, _TwistUvPosY * _MainTex_ST.y); + _TwistUvRadius *= (_MainTex_ST.x + _MainTex_ST.y) / 2; + half percent = (_TwistUvRadius - length(tempUv)) / _TwistUvRadius; + half theta = percent * percent * (2.0 * sin(_TwistUvAmount)) * 8.0; + half s = sin(theta); + half c = cos(theta); + half beta = max(sign(_TwistUvRadius - length(tempUv)), 0.0); + tempUv = half2(dot(tempUv, half2(c, -s)), dot(tempUv, half2(s, c))) * beta + tempUv * (1 - beta); + tempUv += half2(_TwistUvPosX * _MainTex_ST.x, _TwistUvPosY * _MainTex_ST.y); + d.texcoord0.xy = tempUv; + #endif + + //-------------------------------------------- + + //FISHEYE_ON + #if FISHEYE_ON + half bind = length(centerTiled); + half2 dF = d.texcoord0.xy - centerTiled; + half dFlen = length(dF); + half fishInt = (3.14159265359 / bind) * (_FishEyeUvAmount + 0.001); + d.texcoord0.xy = centerTiled + (dF / (max(0.0001, dFlen))) * tan(dFlen * fishInt) * bind / tan(bind * fishInt); + #endif + //--------------------------------------------- + + //PINCH_ON + #if PINCH_ON + half2 dP = d.texcoord0.xy - centerTiled; + half pinchInt = (3.141592 / length(centerTiled)) * (-_PinchUvAmount + 0.001); + d.texcoord0.xy = centerTiled + normalize(dP) * atan(length(dP) * -pinchInt * 10.0) * 0.5 / atan(-pinchInt * 5); + #endif + + //--------------------------------------------- + + //ZOOMUV_ON + #if ZOOMUV_ON + d.texcoord0.xy -= centerTiled; + d.texcoord0.xy = d.texcoord0.xy * _ZoomUvAmount; + d.texcoord0.xy += centerTiled; + #endif + + //----------------------------------------------- + + //DOODLE_ON + #if DOODLE_ON + half2 uvCopy = uvRect; + _HandDrawnSpeed = (floor((_Time.x + randomSeed) * 20 * _HandDrawnSpeed) / _HandDrawnSpeed) * _HandDrawnSpeed; + uvCopy.x = sin((uvCopy.x * _HandDrawnAmount + _HandDrawnSpeed) * 4); + uvCopy.y = cos((uvCopy.y * _HandDrawnAmount + _HandDrawnSpeed) * 4); + d.texcoord0.xy = lerp(d.texcoord0.xy, d.texcoord0.xy + uvCopy, 0.0005 * _HandDrawnAmount); + #endif + + //-------------------------- + + //SHAKEUV_ON + #if SHAKEUV_ON + half xShake = sin((_Time.x + randomSeed) * _ShakeUvSpeed * 50) * _ShakeUvX; + half yShake = cos((_Time.x + randomSeed) * _ShakeUvSpeed * 50) * _ShakeUvY; + d.texcoord0.xy += half2(xShake * 0.012, yShake * 0.01); + #endif + + //------------------------------------------- + + //RECTSIZE_ON + #if RECTSIZE_ON + d.texcoord0.xy = d.texcoord0.xy * (_RectSize).xx + (((-_RectSize * 0.5) + 0.5)).xx; + #endif + + //------------------------------------------- + + //DISTORT_ON + #if DISTORT_ON + #if ATLAS_ON + d.texcoord3.x = d.texcoord3.x * (1 / (_MaxXUV - _MinXUV)); + d.texcoord3.y = d.texcoord3.y * (1 / (_MaxYUV - _MinYUV)); + #endif + + d.texcoord3.x += ((_Time.x + _RandomSeed) * _DistortTexXSpeed) % 1; + d.texcoord3.y += ((_Time.x + _RandomSeed) * _DistortTexYSpeed) % 1; + half distortAmnt = (SAMPLE_TEXTURE2D(_DistortTex, sampler_DistortTex, d.texcoord3.xy).r - 0.5) * 0.2 * _DistortAmount; + d.texcoord0.x += distortAmnt; + d.texcoord0.y += distortAmnt; + #endif + //------------------------------------------------------- + + //WARP_ON + #if WARP_ON + half2 warpUv = half2(d.texcoord0.x / _MainTex_ST.x, d.texcoord0.y / _MainTex_ST.y); + #if ATLAS_ON + warpUv = half2((warpUv.x - _MinXUV) / (_MaxXUV - _MinXUV), (warpUv.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + const float tau = 6.283185307179586; + float xWarp = (_Time.y + randomSeed) * _WarpSpeed + warpUv.x * tau / _WarpScale; + float yWarp = (_Time.y + randomSeed) * _WarpSpeed + warpUv.y * tau / _WarpScale; + float2 warp = float2(sin(xWarp), sin(yWarp)) * _WarpStrength; + d.texcoord0.xy += warp; + #endif + + //------------------------------------------------------- + + //WAVEUV_ON + #if WAVEUV_ON + float2 uvWave = half2(_WaveX * _MainTex_ST.x, _WaveY * _MainTex_ST.y) - d.texcoord0.xy; + uvWave %= 1; + #if ATLAS_ON + uvWave = half2(_WaveX, _WaveY) - uvRect; + #endif + uvWave.x *= _ScreenParams.x / _ScreenParams.y; + float waveTime = _Time.y + randomSeed; + float angWave = (sqrt(dot(uvWave, uvWave)) * _WaveAmount) - ((waveTime * _WaveSpeed)); + d.texcoord0.xy = d.texcoord0.xy + uvWave * sin(angWave) * (_WaveStrength / 1000.0); + #endif + //---------------------------------------------------- + + //ROUNDWAVEUV_ON + #if ROUNDWAVEUV_ON + half xWave = ((0.5 * _MainTex_ST.x) - uvRect.x); + half yWave = ((0.5 * _MainTex_ST.y) - uvRect.y) * (_MainTex_TexelSize.w / _MainTex_TexelSize.z); + half ripple = -sqrt(xWave*xWave + yWave* yWave); + d.texcoord0.xy += (sin((ripple + (_Time.y + randomSeed) * (_RoundWaveSpeed/10.0)) / 0.015) * (_RoundWaveStrength/10.0)) % 1; + #endif + //---------------------------------------------------- + + + //WIND_ON + #if WIND_ON + half windOffset = sin((_Time.x + randomSeed) * _GrassSpeed * 10); + half2 windCenter = half2(0.5, 0.1); + #if ATLAS_ON + windCenter.x = ((_MaxXUV - _MinXUV) * windCenter.x) + _MinXUV; + windCenter.y = ((_MaxYUV - _MinYUV) * windCenter.y) + _MinYUV; + #endif + #if !MANUALWIND_ON + d.texcoord0.x = fmod(abs(lerp(d.texcoord0.x, d.texcoord0.x + (_GrassWind * 0.01 * windOffset), uvRect.y)), 1); + #else + d.texcoord0.x = fmod(abs(lerp(d.texcoord0.x, d.texcoord0.x + (_GrassWind * 0.01 * _GrassManualAnim), uvRect.y)), 1); + windOffset = _GrassManualAnim; + #endif + half2 delta = d.texcoord0.xy - windCenter; + half delta2 = dot(delta.xy, delta.xy); + half2 delta_offset = delta2 * windOffset; + d.texcoord0.xy = d.texcoord0.xy + half2(delta.y, -delta.x) * delta_offset * _GrassRadialBend; + #endif + + //-------------------------------------------------------- + + //TEXTURESCROLL_ON && !ATLAS_ON + #if TEXTURESCROLL_ON && !ATLAS_ON + d.texcoord0.x += ((_Time.y + randomSeed) * _TextureScrollXSpeed) % 1; + d.texcoord0.y += ((_Time.y + randomSeed) * _TextureScrollYSpeed) % 1; + #endif + //------------------------------ + + //PIXELATE_ON + #if PIXELATE_ON + half aspectRatio = _MainTex_TexelSize.x / _MainTex_TexelSize.y; + half2 pixelSize = float2(_PixelateSize, _PixelateSize * aspectRatio); + d.texcoord0.xy = floor(d.texcoord0.xy * pixelSize) / pixelSize; + #endif + //-------------- + + half4 col = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy); + half originalAlpha = col.a; + col *= d.vertexColor; + + //NORMAL MAP + #if NORMALMAP_ON + half4 normalSample = SAMPLE_TEXTURE2D(_NormalMap, sampler_NormalMap, d.texcoord0.xy); + half3 normalTS = UnpackNormal(normalSample); + normalTS.xy *= _NormalStrength; + o.Normal = normalTS; + #endif + + + //GLITCH_ON + #if GLITCH_ON + half2 uvGlitch = uvRect; + uvGlitch.y -= 0.5; + half lineNoise = pow(rand2(floor(uvGlitch * half2(24., 19.) * _GlitchSize) * 4.0, randomSeed), 3.0) * _GlitchAmount + * pow(rand2(floor(uvGlitch * half2(38., 14.) * _GlitchSize) * 4.0, randomSeed), 3.0); + col = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(lineNoise * 0.02 * rand2(half2(2.0, 1), randomSeed), 0)) * d.vertexColor; + #endif + //-------------------------------------- + + //CHROMABERR_ON + #if CHROMABERR_ON + half4 r = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(_ChromAberrAmount/10, 0)) * d.vertexColor; + half4 b = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(-_ChromAberrAmount/10, 0)) * d.vertexColor; + col = half4(r.r * r.a, col.g, b.b * b.a, max(max(r.a, b.a) * _ChromAberrAlpha, col.a)); + #endif + + //-------------------------------- + + //BLUR_ON + #if BLUR_ON + #if ATLAS_ON + #if !BLURISHD_ON + col = BlurHD(d.texcoord0.xy, _MainTex, sampler_MainTex, _BlurIntensity, (_MaxXUV - _MinXUV), (_MaxYUV - _MinYUV)) * d.vertexColor; + #else + col = Blur(d.texcoord0.xy, _MainTex, sampler_MainTex, _BlurIntensity * (_MaxXUV - _MinXUV)) * d.vertexColor; + #endif + #else + #if !BLURISHD_ON + col = BlurHD(d.texcoord0.xy, _MainTex, sampler_MainTex, _BlurIntensity, 1, 1) * d.vertexColor; + #else + col = Blur(d.texcoord0.xy, _MainTex, sampler_MainTex, _BlurIntensity) * d.vertexColor; + #endif + #endif + #endif + + //-------------------- + + //MOTIONBLUR_ON + #if MOTIONBLUR_ON + _MotionBlurAngle = _MotionBlurAngle * 3.1415926; + #define rot(n) mul(n, half2x2(cos(_MotionBlurAngle), -sin(_MotionBlurAngle), sin(_MotionBlurAngle), cos(_MotionBlurAngle))) + _MotionBlurDist = _MotionBlurDist * 0.005; + #if ATLAS_ON + _MotionBlurDist *= (_MaxXUV - _MinXUV); + #endif + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(-_MotionBlurDist, -_MotionBlurDist))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(-_MotionBlurDist * 2, -_MotionBlurDist * 2))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(-_MotionBlurDist * 3, -_MotionBlurDist * 3))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(-_MotionBlurDist * 4, -_MotionBlurDist * 4))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(_MotionBlurDist, _MotionBlurDist))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(_MotionBlurDist * 2, _MotionBlurDist * 2))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(_MotionBlurDist * 3, _MotionBlurDist * 3))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(_MotionBlurDist * 4, _MotionBlurDist * 4))); + col.rgb = col.rgb / 9; + #endif + //------------------------------------ + + //NEGATIVE_ON + #if NEGATIVE_ON + col.rgb = lerp(col.rgb, 1 - col.rgb, _NegativeAmount); + #endif + + //-------------- + half luminance = 0; + + //GREYSCALE_ON && !GREYSCALEOUTLINE_ON + #if GREYSCALE_ON && !GREYSCALEOUTLINE_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + luminance = saturate(luminance + _GreyscaleLuminosity); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _GreyscaleTintColor, _GreyscaleBlend); + #endif + //------------------------------------ + + //GHOST_ON + #if GHOST_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + half4 ghostResult; + ghostResult.a = saturate(luminance - _GhostTransparency) * col.a; + ghostResult.rgb = col.rgb * (luminance + _GhostColorBoost); + col = lerp(col, ghostResult, _GhostBlend); + #endif + //------------------------------------ + + //INNEROUTLINE_ON + #if INNEROUTLINE_ON + half3 innerT = abs(GetPixel(0, _InnerOutlineThickness, d.texcoord0.xy, _MainTex, sampler_MainTex) - GetPixel(0, -_InnerOutlineThickness, d.texcoord0.xy, _MainTex, sampler_MainTex)); + innerT += abs(GetPixel(_InnerOutlineThickness, 0, d.texcoord0.xy, _MainTex, sampler_MainTex) - GetPixel(-_InnerOutlineThickness, 0, d.texcoord0.xy, _MainTex, sampler_MainTex)); + #if !ONLYINNEROUTLINE_ON + innerT = (innerT / 2.0) * col.a * _InnerOutlineAlpha; + col.rgb += length(innerT) * _InnerOutlineColor.rgb * _InnerOutlineGlow; + #else + innerT *= col.a * _InnerOutlineAlpha; + col.rgb = length(innerT) * _InnerOutlineColor.rgb * _InnerOutlineGlow; + col.a = step(0.3, col.r+col.g+col.b); + #endif + #endif + //------------------------------------------------------- + + //HITEFFECT_ON + #if HITEFFECT_ON + col.rgb = lerp(col.rgb, _HitEffectColor.rgb * _HitEffectGlow, _HitEffectBlend); + #endif + //-------------------- + + //GRADIENT_ON + #if GRADIENT_ON + half2 tiledUvGrad = half2(uvRect.x / _MainTex_ST.x, uvRect.y / _MainTex_ST.y); + #if GRADIENT2COL_ON + _GradTopRightCol = _GradTopLeftCol; + _GradBotRightCol = _GradBotLeftCol; + #endif + #if RADIALGRADIENT_ON + half radialDist = 1 - length(tiledUvGrad - half2(0.5, 0.5)); + radialDist *= (_MainTex_TexelSize.w / _MainTex_TexelSize.z); + radialDist = saturate(_GradBoostX * radialDist); + half4 gradientResult = lerp(_GradTopLeftCol, _GradBotLeftCol, radialDist); + #else + half gradXLerpFactor = saturate(pow(tiledUvGrad.x, _GradBoostX)); + half4 gradientResult = lerp(lerp(_GradBotLeftCol, _GradBotRightCol, gradXLerpFactor), + lerp(_GradTopLeftCol, _GradTopRightCol, gradXLerpFactor), saturate(pow(tiledUvGrad.y, _GradBoostY))); + #endif + gradientResult = lerp(col, gradientResult, _GradBlend); + col.rgb = gradientResult.rgb * col.a; + col.a *= gradientResult.a; + #endif + //-------------------------------------------------------------------- + + //CONTRAST_ON + #if CONTRAST_ON + col.rgb = (col.rgb - float3(0.5, 0.5, 0.5)) * _Contrast + float3(0.5, 0.5, 0.5); + col.rgb += _Brightness; + #endif + + //------------------------------------------------------------------- + + //COLORSWAP_ON + #if COLORSWAP_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + half4 swapMask = SAMPLE_TEXTURE2D(_ColorSwapTex, sampler_ColorSwapTex, d.texcoord0.xy); + swapMask.rgb *= swapMask.a; + half3 redSwap = _ColorSwapRed * swapMask.r * saturate(luminance + _ColorSwapRedLuminosity); + half3 greenSwap = _ColorSwapGreen * swapMask.g * saturate(luminance + _ColorSwapGreenLuminosity); + half3 blueSwap = _ColorSwapBlue * swapMask.b * saturate(luminance + _ColorSwapBlueLuminosity); + swapMask.rgb = col.rgb * saturate(1 - swapMask.r - swapMask.g - swapMask.b); + col.rgb = lerp(col.rgb, swapMask.rgb + redSwap + greenSwap + blueSwap, _ColorSwapBlend); + #endif + //-------------------------------------------------------------------- + + //COLORRAMP_ON && !COLORRAMPOUTLINE_ON + #if COLORRAMP_ON && !COLORRAMPOUTLINE_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + luminance = saturate(luminance + _ColorRampLuminosity); + #if GRADIENTCOLORRAMP_ON + col.rgb = lerp(col.rgb, SAMPLE_TEXTURE2D(_ColorRampTexGradient, sampler_ColorRampTexGradient, half2(luminance, 0)).rgb, _ColorRampBlend); + #else + col.rgb = lerp(col.rgb, SAMPLE_TEXTURE2D(_ColorRampTex, sampler_ColorRampTex, half2(luminance, 0)).rgb, _ColorRampBlend); + #endif + #endif + //-------------------------------------------------------------------- + + //CHANGECOLOR_ON + #if CHANGECOLOR_ON + float3 currChangeColor = saturate(col.rgb); + luminance = 0.3 * currChangeColor.r + 0.59 * currChangeColor.g + 0.11 * currChangeColor.b; + luminance = saturate(luminance + _ColorChangeLuminosity); + half3 dif = abs(currChangeColor - _ColorChangeTarget.rgb); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _ColorChangeNewCol.rgb, + max(sign(1 - saturate(dif.x + dif.y + dif.z) - _ColorChangeTolerance), 0.0)); + #if CHANGECOLOR2_ON + dif = abs(currChangeColor - _ColorChangeTarget2.rgb); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _ColorChangeNewCol2.rgb, + max(sign(1 - saturate(dif.x + dif.y + dif.z) - _ColorChangeTolerance2), 0.0)); + #endif + #if CHANGECOLOR3_ON + dif = abs(currChangeColor - _ColorChangeTarget3.rgb); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _ColorChangeNewCol3.rgb, + max(sign(1 - saturate(dif.x + dif.y + dif.z) - _ColorChangeTolerance3), 0.0)); + #endif + #endif + //------------------------------------------------------- + + //POSTERIZE_ON && !POSTERIZEOUTLINE_ON + #if POSTERIZE_ON && !POSTERIZEOUTLINE_ON + col.rgb = pow(col.rgb, _PosterizeGamma) * _PosterizeNumColors; + col.rgb = floor(col.rgb) / _PosterizeNumColors; + col.rgb = pow(col.rgb, 1.0 / _PosterizeGamma); + #endif + //------------------------------------ + + //HSV_ON + #if HSV_ON + half3 resultHsv = half3(col.rgb); + half cosHsv = _HsvBright * _HsvSaturation * cos(_HsvShift * 3.14159265 / 180); + half sinHsv = _HsvBright * _HsvSaturation * sin(_HsvShift * 3.14159265 / 180); + resultHsv.x = (.299 * _HsvBright + .701 * cosHsv + .168 * sinHsv) * col.x + + (.587 * _HsvBright - .587 * cosHsv + .330 * sinHsv) * col.y + + (.114 * _HsvBright - .114 * cosHsv - .497 * sinHsv) * col.z; + resultHsv.y = (.299 * _HsvBright - .299 * cosHsv - .328 * sinHsv) *col.x + + (.587 * _HsvBright + .413 * cosHsv + .035 * sinHsv) * col.y + + (.114 * _HsvBright - .114 * cosHsv + .292 * sinHsv) * col.z; + resultHsv.z = (.299 * _HsvBright - .3 * cosHsv + 1.25 * sinHsv) * col.x + + (.587 * _HsvBright - .588 * cosHsv - 1.05 * sinHsv) * col.y + + (.114 * _HsvBright + .886 * cosHsv - .203 * sinHsv) * col.z; + col.rgb = resultHsv; + #endif + //------------------------------------------------------- + + //OVERLAY_ON + #if OVERLAY_ON + half2 overlayUvs = d.texcoord0.xy; + overlayUvs.x += ((_Time.y + randomSeed) * _OverlayTextureScrollXSpeed) % 1; + overlayUvs.y += ((_Time.y + randomSeed) * _OverlayTextureScrollYSpeed) % 1; + half4 overlayCol = SAMPLE_TEXTURE2D(_OverlayTex, sampler_OverlayTex, TRANSFORM_TEX(overlayUvs, _OverlayTex)); + overlayCol.rgb *= _OverlayColor.rgb * _OverlayGlow; + #if !OVERLAYMULT_ON + overlayCol.rgb *= overlayCol.a * _OverlayColor.rgb * _OverlayColor.a * _OverlayBlend; + col.rgb += overlayCol.rgb; + #else + overlayCol.a *= _OverlayColor.a; + col = lerp(col, col * overlayCol, _OverlayBlend); + #endif + #endif + + //--------------------------------- + + //OUTBASE_ON + #if OUTBASE_ON + #if OUTBASEPIXELPERF_ON + half2 destUv = half2(_OutlinePixelWidth * _MainTex_TexelSize.x, _OutlinePixelWidth * _MainTex_TexelSize.y); + #else + half2 destUv = half2(_OutlineWidth * _MainTex_TexelSize.x * 200, _OutlineWidth * _MainTex_TexelSize.y * 200); + #endif + + #if OUTDIST_ON + d.texcoord3.x += ((_Time.x + _RandomSeed) * _OutlineDistortTexXSpeed) % 1; + d.texcoord3.y += ((_Time.x + _RandomSeed) * _OutlineDistortTexYSpeed) % 1; + #if ATLAS_ON + d.texcoord3 = half2((d.texcoord3.x - _MinXUV) / (_MaxXUV - _MinXUV), (d.texcoord3.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half outDistortAmnt = (SAMPLE_TEXTURE2D(_OutlineDistortTex, sampler_OutlineDistortTex, d.texcoord3).r - 0.5) * 0.2 * _OutlineDistortAmount; + destUv.x += outDistortAmnt; + destUv.y += outDistortAmnt; + #endif + + half spriteLeft = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(destUv.x, 0)).a; + half spriteRight = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy - half2(destUv.x, 0)).a; + half spriteBottom = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(0, destUv.y)).a; + half spriteTop = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy - half2(0, destUv.y)).a; + half result = spriteLeft + spriteRight + spriteBottom + spriteTop; + + #if OUTBASE8DIR_ON + half spriteTopLeft = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(destUv.x, destUv.y)).a; + half spriteTopRight = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(-destUv.x, destUv.y)).a; + half spriteBotLeft = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(destUv.x, -destUv.y)).a; + half spriteBotRight = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(-destUv.x, -destUv.y)).a; + result = result + spriteTopLeft + spriteTopRight + spriteBotLeft + spriteBotRight; + #endif + + result = step(0.05, saturate(result)); + + #if OUTTEX_ON + d.texcoord1.x += ((_Time.x + _RandomSeed) * _OutlineTexXSpeed) % 1; + d.texcoord1.y += ((_Time.x + _RandomSeed) * _OutlineTexYSpeed) % 1; + #if ATLAS_ON + d.texcoord1 = half2((d.texcoord1.x - _MinXUV) / (_MaxXUV - _MinXUV), (d.texcoord1.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half4 tempOutColor = SAMPLE_TEXTURE2D(_OutlineTex, sampler_OutlineTex, d.texcoord1); + tempOutColor *= _OutlineColor; + _OutlineColor = tempOutColor; + #endif + + result *= (1 - originalAlpha) * _OutlineAlpha; + + half4 outline = _OutlineColor * d.vertexColor.a; + outline.rgb *= _OutlineGlow; + outline.a = result; + #if ONLYOUTLINE_ON + col = outline; + #else + col = lerp(col, outline, result); + #endif + #endif + //------------------------------------------------------- + + //FADE_ON + #if FADE_ON + half2 tiledUvFade1 = TRANSFORM_TEX(d.texcoord0, _FadeTex); + half2 tiledUvFade2 = TRANSFORM_TEX(d.texcoord0, _FadeBurnTex); + #if ATLAS_ON + tiledUvFade1 = half2((tiledUvFade1.x - _MinXUV) / (_MaxXUV - _MinXUV), (tiledUvFade1.y - _MinYUV) / (_MaxYUV - _MinYUV)); + tiledUvFade2 = half2((tiledUvFade2.x - _MinXUV) / (_MaxXUV - _MinXUV), (tiledUvFade2.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half fadeTemp = SAMPLE_TEXTURE2D(_FadeTex, sampler_FadeTex, tiledUvFade1).r; + half fade = smoothstep(_FadeAmount, _FadeAmount + _FadeBurnTransition, fadeTemp); + half fadeBurn = saturate(smoothstep(_FadeAmount - _FadeBurnWidth, _FadeAmount - _FadeBurnWidth + 0.1, fadeTemp) * _FadeAmount); + col.a *= fade; + _FadeBurnColor.rgb *= _FadeBurnGlow; + col += fadeBurn * SAMPLE_TEXTURE2D(_FadeBurnTex, sampler_FadeBurnTex, tiledUvFade2) * _FadeBurnColor * originalAlpha * (1 - col.a); + #endif + //------------------------------------------------------- + + //SHADOW_ON + #if SHADOW_ON + half shadowA = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(_ShadowX, _ShadowY)).a; + half preMultShadowMask = 1 - (saturate(shadowA - col.a) * (1 - col.a)); + col.rgb *= 1 - ((shadowA - col.a) * (1 - col.a)); + col.rgb += (_ShadowColor * shadowA) * (1 - col.a); + col.a = max(shadowA * _ShadowAlpha * d.vertexColor.a, col.a); + #endif + + //------------------------------------------------------- + + //GLOW_ON + #if GLOW_ON + half4 emission; + #if GLOWTEX_ON + emission = SAMPLE_TEXTURE2D(_GlowTex, sampler_GlowTex, d.texcoord0); + #else + emission = col; + #endif + + col.rgb *= _GlowGlobal; + emission.rgb *= emission.a * col.a * _Glow * _GlowColor; + col.rgb += emission.rgb; + #endif + //------------------------------------------------------- + + //COLORRAMP_ON && COLORRAMPOUTLINE_ON + #if COLORRAMP_ON && COLORRAMPOUTLINE_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + luminance = saturate(luminance + _ColorRampLuminosity); + #if GRADIENTCOLORRAMP_ON + col.rgb = lerp(col.rgb, SAMPLE_TEXTURE2D(_ColorRampTexGradient, sampler_ColorRampTexGradient, half2(luminance, 0)).rgb, _ColorRampBlend); + #else + col.rgb = lerp(col.rgb, SAMPLE_TEXTURE2D(_ColorRampTex, sampler_ColorRampTex, half2(luminance, 0)).rgb, _ColorRampBlend); + #endif + #endif + //--------------- + + //GREYSCALE_ON && GREYSCALEOUTLINE_ON + #if GREYSCALE_ON && GREYSCALEOUTLINE_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + luminance = saturate(luminance + _GreyscaleLuminosity); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _GreyscaleTintColor, _GreyscaleBlend); + #endif + + //----------------------------------- + + //POSTERIZE_ON && POSTERIZEOUTLINE_ON + #if POSTERIZE_ON && POSTERIZEOUTLINE_ON + col.rgb = pow(col.rgb, _PosterizeGamma) * _PosterizeNumColors; + col.rgb = floor(col.rgb) / _PosterizeNumColors; + col.rgb = pow(col.rgb, 1.0 / _PosterizeGamma); + #endif + + //----------------------------------- + + //SHINE_ON + #if SHINE_ON + half2 uvShine = uvRect; + half cosAngle = cos(_ShineRotate); + half sinAngle = sin(_ShineRotate); + half2x2 rot = half2x2(cosAngle, -sinAngle, sinAngle, cosAngle); + uvShine -= half2(0.5, 0.5); + uvShine = mul(rot, uvShine); + uvShine += half2(0.5, 0.5); + half shineMask = SAMPLE_TEXTURE2D(_ShineMask, sampler_ShineMask, d.texcoord0.xy).a; + half currentDistanceProjection = (uvShine.x + uvShine.y) / 2; + half whitePower = 1 - (abs(currentDistanceProjection - _ShineLocation) / _ShineWidth); + col.rgb += col.a * whitePower * _ShineGlow * max(sign(currentDistanceProjection - (_ShineLocation - _ShineWidth)), 0.0) + * max(sign((_ShineLocation + _ShineWidth) - currentDistanceProjection), 0.0) * _ShineColor * shineMask; + #endif + + //----------------------------------- + + //HOLOGRAM_ON + #if HOLOGRAM_ON + half totalHologram = _HologramStripesAmount + _HologramUnmodAmount; + half hologramYCoord = ((uvRect.y + (((_Time.x + randomSeed) % 1) * _HologramStripesSpeed)) % totalHologram) / totalHologram; + hologramYCoord = abs(hologramYCoord); + half alpha = RemapFloat(saturate(hologramYCoord - (_HologramUnmodAmount/totalHologram)), 0.0, 1.0, _HologramMinAlpha, saturate(_HologramMaxAlpha)); + half hologramMask = max(sign((_HologramUnmodAmount/totalHologram) - hologramYCoord), 0.0); + half4 hologramResult = col; + hologramResult.a *= lerp(alpha, 1, hologramMask); + hologramResult.rgb *= max(1, _HologramMaxAlpha * max(sign(hologramYCoord - (_HologramUnmodAmount/totalHologram)), 0.0)); + hologramMask = 1 - step(0.01,hologramMask); + hologramResult.rgb += hologramMask * _HologramStripeColor * col.a; + col = lerp(col, hologramResult, _HologramBlend); + #endif + + //----------------------------------- + + //FLICKER_ON + #if FLICKER_ON + col.a *= saturate(col.a * step(frac(0.05 + (_Time.w + randomSeed) * _FlickerFreq), 1 - _FlickerPercent) + _FlickerAlpha); + #endif + //----------------------------------- + + //ALPHACUTOFF_ON + + //ALPHAROUND_ON + + //ALPHAOUTLINE_ON + #if ALPHAOUTLINE_ON + half alphaOutlineRes = pow(1 - col.a, max(_AlphaOutlinePower, 0.0001)) * step(_AlphaOutlineMinAlpha, col.a) * _AlphaOutlineBlend; + col.rgb = lerp(col.rgb, _AlphaOutlineColor.rgb * _AlphaOutlineGlow, alphaOutlineRes); + col.a = lerp(col.a, 1, alphaOutlineRes > 1); + #endif + //------------------------------------------------------- + + //FOG_ON + + //------------------ + + col *= _Color; + o.Albedo = col; + col.a *= _Alpha; + clip(col.a - _AlphaCutoffValue - 0.01); + o.Alpha = _Color.a; + } + + + + + + void ChainSurfaceFunction(inout Surface l, inout ShaderData d) + { + Ext_SurfaceFunction0(l, d); + // Ext_SurfaceFunction1(l, d); + // Ext_SurfaceFunction2(l, d); + // Ext_SurfaceFunction3(l, d); + // Ext_SurfaceFunction4(l, d); + // Ext_SurfaceFunction5(l, d); + // Ext_SurfaceFunction6(l, d); + // Ext_SurfaceFunction7(l, d); + // Ext_SurfaceFunction8(l, d); + // Ext_SurfaceFunction9(l, d); + // Ext_SurfaceFunction10(l, d); + // Ext_SurfaceFunction11(l, d); + // Ext_SurfaceFunction12(l, d); + // Ext_SurfaceFunction13(l, d); + // Ext_SurfaceFunction14(l, d); + // Ext_SurfaceFunction15(l, d); + // Ext_SurfaceFunction16(l, d); + // Ext_SurfaceFunction17(l, d); + // Ext_SurfaceFunction18(l, d); + // Ext_SurfaceFunction19(l, d); + // Ext_SurfaceFunction20(l, d); + // Ext_SurfaceFunction21(l, d); + // Ext_SurfaceFunction22(l, d); + // Ext_SurfaceFunction23(l, d); + // Ext_SurfaceFunction24(l, d); + // Ext_SurfaceFunction25(l, d); + // Ext_SurfaceFunction26(l, d); + // Ext_SurfaceFunction27(l, d); + // Ext_SurfaceFunction28(l, d); + // Ext_SurfaceFunction29(l, d); + } + +#if !_DECALSHADER + + void ChainModifyVertex(inout VertexData v, inout VertexToPixel v2p, float4 time) + { + ExtraV2F d; + + ZERO_INITIALIZE(ExtraV2F, d); + ZERO_INITIALIZE(Blackboard, d.blackboard); + // due to motion vectors in HDRP, we need to use the last + // time in certain spots. So if you are going to use _Time to adjust vertices, + // you need to use this time or motion vectors will break. + d.time = time; + + Ext_ModifyVertex0(v, d); + // Ext_ModifyVertex1(v, d); + // Ext_ModifyVertex2(v, d); + // Ext_ModifyVertex3(v, d); + // Ext_ModifyVertex4(v, d); + // Ext_ModifyVertex5(v, d); + // Ext_ModifyVertex6(v, d); + // Ext_ModifyVertex7(v, d); + // Ext_ModifyVertex8(v, d); + // Ext_ModifyVertex9(v, d); + // Ext_ModifyVertex10(v, d); + // Ext_ModifyVertex11(v, d); + // Ext_ModifyVertex12(v, d); + // Ext_ModifyVertex13(v, d); + // Ext_ModifyVertex14(v, d); + // Ext_ModifyVertex15(v, d); + // Ext_ModifyVertex16(v, d); + // Ext_ModifyVertex17(v, d); + // Ext_ModifyVertex18(v, d); + // Ext_ModifyVertex19(v, d); + // Ext_ModifyVertex20(v, d); + // Ext_ModifyVertex21(v, d); + // Ext_ModifyVertex22(v, d); + // Ext_ModifyVertex23(v, d); + // Ext_ModifyVertex24(v, d); + // Ext_ModifyVertex25(v, d); + // Ext_ModifyVertex26(v, d); + // Ext_ModifyVertex27(v, d); + // Ext_ModifyVertex28(v, d); + // Ext_ModifyVertex29(v, d); + + + // #if %EXTRAV2F0REQUIREKEY% + // v2p.extraV2F0 = d.extraV2F0; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // v2p.extraV2F1 = d.extraV2F1; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // v2p.extraV2F2 = d.extraV2F2; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // v2p.extraV2F3 = d.extraV2F3; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // v2p.extraV2F4 = d.extraV2F4; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // v2p.extraV2F5 = d.extraV2F5; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // v2p.extraV2F6 = d.extraV2F6; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // v2p.extraV2F7 = d.extraV2F7; + // #endif + } + + void ChainModifyTessellatedVertex(inout VertexData v, inout VertexToPixel v2p) + { + ExtraV2F d; + ZERO_INITIALIZE(ExtraV2F, d); + ZERO_INITIALIZE(Blackboard, d.blackboard); + + // #if %EXTRAV2F0REQUIREKEY% + // d.extraV2F0 = v2p.extraV2F0; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // d.extraV2F1 = v2p.extraV2F1; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // d.extraV2F2 = v2p.extraV2F2; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // d.extraV2F3 = v2p.extraV2F3; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // d.extraV2F4 = v2p.extraV2F4; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // d.extraV2F5 = v2p.extraV2F5; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // d.extraV2F6 = v2p.extraV2F6; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // d.extraV2F7 = v2p.extraV2F7; + // #endif + + + // Ext_ModifyTessellatedVertex0(v, d); + // Ext_ModifyTessellatedVertex1(v, d); + // Ext_ModifyTessellatedVertex2(v, d); + // Ext_ModifyTessellatedVertex3(v, d); + // Ext_ModifyTessellatedVertex4(v, d); + // Ext_ModifyTessellatedVertex5(v, d); + // Ext_ModifyTessellatedVertex6(v, d); + // Ext_ModifyTessellatedVertex7(v, d); + // Ext_ModifyTessellatedVertex8(v, d); + // Ext_ModifyTessellatedVertex9(v, d); + // Ext_ModifyTessellatedVertex10(v, d); + // Ext_ModifyTessellatedVertex11(v, d); + // Ext_ModifyTessellatedVertex12(v, d); + // Ext_ModifyTessellatedVertex13(v, d); + // Ext_ModifyTessellatedVertex14(v, d); + // Ext_ModifyTessellatedVertex15(v, d); + // Ext_ModifyTessellatedVertex16(v, d); + // Ext_ModifyTessellatedVertex17(v, d); + // Ext_ModifyTessellatedVertex18(v, d); + // Ext_ModifyTessellatedVertex19(v, d); + // Ext_ModifyTessellatedVertex20(v, d); + // Ext_ModifyTessellatedVertex21(v, d); + // Ext_ModifyTessellatedVertex22(v, d); + // Ext_ModifyTessellatedVertex23(v, d); + // Ext_ModifyTessellatedVertex24(v, d); + // Ext_ModifyTessellatedVertex25(v, d); + // Ext_ModifyTessellatedVertex26(v, d); + // Ext_ModifyTessellatedVertex27(v, d); + // Ext_ModifyTessellatedVertex28(v, d); + // Ext_ModifyTessellatedVertex29(v, d); + + // #if %EXTRAV2F0REQUIREKEY% + // v2p.extraV2F0 = d.extraV2F0; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // v2p.extraV2F1 = d.extraV2F1; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // v2p.extraV2F2 = d.extraV2F2; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // v2p.extraV2F3 = d.extraV2F3; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // v2p.extraV2F4 = d.extraV2F4; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // v2p.extraV2F5 = d.extraV2F5; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // v2p.extraV2F6 = d.extraV2F6; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // v2p.extraV2F7 = d.extraV2F7; + // #endif + } + + void ChainFinalColorForward(inout Surface l, inout ShaderData d, inout half4 color) + { + // Ext_FinalColorForward0(l, d, color); + // Ext_FinalColorForward1(l, d, color); + // Ext_FinalColorForward2(l, d, color); + // Ext_FinalColorForward3(l, d, color); + // Ext_FinalColorForward4(l, d, color); + // Ext_FinalColorForward5(l, d, color); + // Ext_FinalColorForward6(l, d, color); + // Ext_FinalColorForward7(l, d, color); + // Ext_FinalColorForward8(l, d, color); + // Ext_FinalColorForward9(l, d, color); + // Ext_FinalColorForward10(l, d, color); + // Ext_FinalColorForward11(l, d, color); + // Ext_FinalColorForward12(l, d, color); + // Ext_FinalColorForward13(l, d, color); + // Ext_FinalColorForward14(l, d, color); + // Ext_FinalColorForward15(l, d, color); + // Ext_FinalColorForward16(l, d, color); + // Ext_FinalColorForward17(l, d, color); + // Ext_FinalColorForward18(l, d, color); + // Ext_FinalColorForward19(l, d, color); + // Ext_FinalColorForward20(l, d, color); + // Ext_FinalColorForward21(l, d, color); + // Ext_FinalColorForward22(l, d, color); + // Ext_FinalColorForward23(l, d, color); + // Ext_FinalColorForward24(l, d, color); + // Ext_FinalColorForward25(l, d, color); + // Ext_FinalColorForward26(l, d, color); + // Ext_FinalColorForward27(l, d, color); + // Ext_FinalColorForward28(l, d, color); + // Ext_FinalColorForward29(l, d, color); + } + + void ChainFinalGBufferStandard(inout Surface s, inout ShaderData d, inout half4 GBuffer0, inout half4 GBuffer1, inout half4 GBuffer2, inout half4 outEmission, inout half4 outShadowMask) + { + // Ext_FinalGBufferStandard0(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard1(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard2(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard3(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard4(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard5(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard6(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard7(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard8(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard9(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard10(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard11(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard12(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard13(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard14(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard15(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard16(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard17(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard18(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard19(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard20(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard21(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard22(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard23(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard24(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard25(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard26(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard27(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard28(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard29(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + } +#endif + + + + + +#if _DECALSHADER + + ShaderData CreateShaderData(SurfaceDescriptionInputs IN) + { + ShaderData d = (ShaderData)0; + d.TBNMatrix = float3x3(IN.WorldSpaceTangent, IN.WorldSpaceBiTangent, IN.WorldSpaceNormal); + d.worldSpaceNormal = IN.WorldSpaceNormal; + d.worldSpaceTangent = IN.WorldSpaceTangent; + + d.worldSpacePosition = IN.WorldSpacePosition; + d.texcoord0 = IN.uv0.xyxy; + d.screenPos = IN.ScreenPosition; + + d.worldSpaceViewDir = normalize(_WorldSpaceCameraPos - d.worldSpacePosition); + + d.tangentSpaceViewDir = mul(d.TBNMatrix, d.worldSpaceViewDir); + + // these rarely get used, so we back transform them. Usually will be stripped. + #if _HDRP + // d.localSpacePosition = mul(GetWorldToObjectMatrix(), float4(GetCameraRelativePositionWS(d.worldSpacePosition), 1)).xyz; + #else + // d.localSpacePosition = mul(GetWorldToObjectMatrix(), float4(d.worldSpacePosition, 1)).xyz; + #endif + // d.localSpaceNormal = normalize(mul((float3x3)GetWorldToObjectMatrix(), d.worldSpaceNormal)); + // d.localSpaceTangent = normalize(mul((float3x3)GetWorldToObjectMatrix(), d.worldSpaceTangent.xyz)); + + // #if %SCREENPOSREQUIREKEY% + // d.screenUV = (IN.ScreenPosition.xy / max(0.01, IN.ScreenPosition.w)); + // #endif + + return d; + } +#else + + ShaderData CreateShaderData(VertexToPixel i + #if NEED_FACING + , bool facing + #endif + ) + { + ShaderData d = (ShaderData)0; + d.clipPos = i.pos; + d.worldSpacePosition = i.worldPos; + + d.worldSpaceNormal = normalize(i.worldNormal); + d.worldSpaceTangent.xyz = normalize(i.worldTangent.xyz); + + d.tangentSign = i.worldTangent.w * unity_WorldTransformParams.w; + float3 bitangent = cross(d.worldSpaceTangent.xyz, d.worldSpaceNormal) * d.tangentSign; + + d.TBNMatrix = float3x3(d.worldSpaceTangent, -bitangent, d.worldSpaceNormal); + d.worldSpaceViewDir = normalize(_WorldSpaceCameraPos - i.worldPos); + + d.tangentSpaceViewDir = mul(d.TBNMatrix, d.worldSpaceViewDir); + d.texcoord0 = i.texcoord0; + d.texcoord1 = i.texcoord1; + d.texcoord2 = i.texcoord2; + + // #if %TEXCOORD3REQUIREKEY% + d.texcoord3 = i.texcoord3; + // #endif + + // d.isFrontFace = facing; + // #if %VERTEXCOLORREQUIREKEY% + d.vertexColor = i.vertexColor; + // #endif + + // these rarely get used, so we back transform them. Usually will be stripped. + #if _HDRP + // d.localSpacePosition = mul(GetWorldToObjectMatrix(), float4(GetCameraRelativePositionWS(i.worldPos), 1)).xyz; + #else + // d.localSpacePosition = mul(GetWorldToObjectMatrix(), float4(i.worldPos, 1)).xyz; + #endif + // d.localSpaceNormal = normalize(mul((float3x3)GetWorldToObjectMatrix(), i.worldNormal)); + // d.localSpaceTangent = normalize(mul((float3x3)GetWorldToObjectMatrix(), i.worldTangent.xyz)); + + // #if %SCREENPOSREQUIREKEY% + // d.screenPos = i.screenPos; + // d.screenUV = (i.screenPos.xy / i.screenPos.w); + // #endif + + + // #if %EXTRAV2F0REQUIREKEY% + // d.extraV2F0 = i.extraV2F0; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // d.extraV2F1 = i.extraV2F1; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // d.extraV2F2 = i.extraV2F2; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // d.extraV2F3 = i.extraV2F3; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // d.extraV2F4 = i.extraV2F4; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // d.extraV2F5 = i.extraV2F5; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // d.extraV2F6 = i.extraV2F6; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // d.extraV2F7 = i.extraV2F7; + // #endif + + return d; + } + +#endif + + + #if defined(_PASSSHADOW) + float3 _LightDirection; + float3 _LightPosition; + #endif + + // vertex shader + VertexToPixel Vert (VertexData v) + { + + VertexToPixel o = (VertexToPixel)0; + + UNITY_SETUP_INSTANCE_ID(v); + UNITY_TRANSFER_INSTANCE_ID(v, o); + UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o); + + +#if !_TESSELLATION_ON + ChainModifyVertex(v, o, _Time); +#endif + + o.texcoord0 = v.texcoord0; + o.texcoord1 = v.texcoord1; + o.texcoord2 = v.texcoord2; + + // #if %TEXCOORD3REQUIREKEY% + o.texcoord3 = v.texcoord3; + // #endif + + // #if %VERTEXCOLORREQUIREKEY% + o.vertexColor = v.vertexColor; + // #endif + + VertexPositionInputs vertexInput = GetVertexPositionInputs(v.vertex.xyz); + o.worldPos = TransformObjectToWorld(v.vertex.xyz); + o.worldNormal = TransformObjectToWorldNormal(v.normal); + o.worldTangent = float4(TransformObjectToWorldDir(v.tangent.xyz), v.tangent.w); + + // For some very odd reason, in 2021.2, we can't use Unity's defines, but have to use our own.. + #if _PASSSHADOW + #if _CASTING_PUNCTUAL_LIGHT_SHADOW + float3 lightDirectionWS = normalize(_LightPosition - o.worldPos); + #else + float3 lightDirectionWS = _LightDirection; + #endif + // Define shadow pass specific clip position for Universal + o.pos = TransformWorldToHClip(ApplyShadowBias(o.worldPos, o.worldNormal, lightDirectionWS)); + #if UNITY_REVERSED_Z + o.pos.z = min(o.pos.z, UNITY_NEAR_CLIP_VALUE); + #else + o.pos.z = max(o.pos.z, UNITY_NEAR_CLIP_VALUE); + #endif + #elif _PASSMETA + o.pos = MetaVertexPosition(float4(v.vertex.xyz, 0), v.texcoord1.xy, v.texcoord2.xy, unity_LightmapST, unity_DynamicLightmapST); + #else + o.pos = TransformWorldToHClip(o.worldPos); + #endif + + // #if %SCREENPOSREQUIREKEY% + // o.screenPos = ComputeScreenPos(o.pos, _ProjectionParams.x); + // #endif + + #if _PASSFORWARD || _PASSGBUFFER + float2 uv1 = v.texcoord1.xy; + OUTPUT_LIGHTMAP_UV(uv1, unity_LightmapST, o.lightmapUV); + o.texcoord1.xy = uv1; + OUTPUT_SH(o.worldNormal, o.sh); + #if defined(DYNAMICLIGHTMAP_ON) + o.dynamicLightmapUV.xy = v.texcoord2.xy * unity_DynamicLightmapST.xy + unity_DynamicLightmapST.zw; + #endif + #endif + + #ifdef VARYINGS_NEED_FOG_AND_VERTEX_LIGHT + half fogFactor = 0; + #if defined(_FOG_FRAGMENT) + fogFactor = ComputeFogFactor(o.pos.z); + #endif + #if _BAKEDLIT + o.fogFactorAndVertexLight = half4(fogFactor, 0, 0, 0); + #else + half3 vertexLight = VertexLighting(o.worldPos, o.worldNormal); + o.fogFactorAndVertexLight = half4(fogFactor, vertexLight); + #endif + #endif + + #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR) + o.shadowCoord = GetShadowCoord(vertexInput); + #endif + + return o; + } + + + + + // fragment shader + half4 Frag (VertexToPixel IN + #ifdef _DEPTHOFFSET_ON + , out float outputDepth : SV_Depth + #endif + #if NEED_FACING + , bool facing : SV_IsFrontFace + #endif + ) : SV_Target + { + UNITY_SETUP_INSTANCE_ID(IN); + + ShaderData d = CreateShaderData(IN + #if NEED_FACING + , facing + #endif + ); + Surface l = (Surface)0; + + #ifdef _DEPTHOFFSET_ON + l.outputDepth = outputDepth; + #endif + + l.Albedo = half3(0.5, 0.5, 0.5); + l.Normal = float3(0,0,1); + l.Occlusion = 1; + l.Alpha = 1; + + ChainSurfaceFunction(l, d); + + #ifdef _DEPTHOFFSET_ON + outputDepth = l.outputDepth; + #endif + + return 0; + + } + + ENDHLSL + + } + + + + Pass + { + Name "DepthOnly" + Tags + { + "LightMode" = "DepthOnly" + } + + // Render State + Blend One Zero, One Zero + Cull Back + ZTest LEqual + ZWrite On + ColorMask 0 + + Tags { "RenderType" = "Opaque" "Queue" = "Geometry" "PreviewType" = "Plane" } + Cull [_CullingOption] + ZWrite [_ZWrite] + ZTest [_ZTestMode] + + + HLSLPROGRAM + + #pragma vertex Vert + #pragma fragment Frag + + + #define _PASSDEPTH 1 + + #pragma target 3.0 + #pragma prefer_hlslcc gles + #pragma exclude_renderers d3d11_9x + #pragma multi_compile_instancing + #pragma multi_compile _ DOTS_INSTANCING_ON + + + #pragma shader_feature_local GLOW_ON + #pragma shader_feature_local FADE_ON + #pragma shader_feature_local OUTBASE_ON + #pragma shader_feature_local ONLYOUTLINE_ON + #pragma shader_feature_local GRADIENT_ON + #pragma shader_feature_local GRADIENT2COL_ON + #pragma shader_feature_local RADIALGRADIENT_ON + #pragma shader_feature_local COLORSWAP_ON + #pragma shader_feature_local HSV_ON + #pragma shader_feature_local CHANGECOLOR_ON + #pragma shader_feature_local CHANGECOLOR2_ON + #pragma shader_feature_local CHANGECOLOR3_ON + #pragma shader_feature_local COLORRAMP_ON + #pragma shader_feature_local GRADIENTCOLORRAMP_ON + #pragma shader_feature_local HITEFFECT_ON + #pragma shader_feature_local NEGATIVE_ON + #pragma shader_feature_local PIXELATE_ON + #pragma shader_feature_local GREYSCALE_ON + #pragma shader_feature_local POSTERIZE_ON + #pragma shader_feature_local BLUR_ON + #pragma shader_feature_local MOTIONBLUR_ON + #pragma shader_feature_local GHOST_ON + #pragma shader_feature_local ALPHAOUTLINE_ON + #pragma shader_feature_local INNEROUTLINE_ON + #pragma shader_feature_local ONLYINNEROUTLINE_ON + #pragma shader_feature_local HOLOGRAM_ON + #pragma shader_feature_local CHROMABERR_ON + #pragma shader_feature_local GLITCH_ON + #pragma shader_feature_local FLICKER_ON + #pragma shader_feature_local SHADOW_ON + #pragma shader_feature_local SHINE_ON + #pragma shader_feature_local CONTRAST_ON + #pragma shader_feature_local OVERLAY_ON + #pragma shader_feature_local OVERLAYMULT_ON + #pragma shader_feature_local DOODLE_ON + #pragma shader_feature_local WIND_ON + #pragma shader_feature_local WAVEUV_ON + #pragma shader_feature_local ROUNDWAVEUV_ON + #pragma shader_feature_local RECTSIZE_ON + #pragma shader_feature_local OFFSETUV_ON + #pragma shader_feature_local CLIPPING_ON + #pragma shader_feature_local RADIALCLIPPING_ON + #pragma shader_feature_local TEXTURESCROLL_ON + #pragma shader_feature_local ZOOMUV_ON + #pragma shader_feature_local DISTORT_ON + #pragma shader_feature_local WARP_ON + #pragma shader_feature_local TWISTUV_ON + #pragma shader_feature_local ROTATEUV_ON + #pragma shader_feature_local POLARUV_ON + #pragma shader_feature_local FISHEYE_ON + #pragma shader_feature_local PINCH_ON + #pragma shader_feature_local SHAKEUV_ON + + #pragma shader_feature_local GLOWTEX_ON + #pragma shader_feature_local OUTTEX_ON + #pragma shader_feature_local OUTDIST_ON + #pragma shader_feature_local OUTBASE8DIR_ON + #pragma shader_feature_local OUTBASEPIXELPERF_ON + #pragma shader_feature_local COLORRAMPOUTLINE_ON + #pragma shader_feature_local GREYSCALEOUTLINE_ON + #pragma shader_feature_local POSTERIZEOUTLINE_ON + #pragma shader_feature_local BLURISHD_ON + #pragma shader_feature_local MANUALWIND_ON + #pragma shader_feature_local ATLAS_ON + #pragma shader_feature_local PREMULTIPLYALPHA_ON + + #pragma shader_feature BILBOARD_ON + #pragma shader_feature BILBOARDY_ON + + #pragma shader_feature NORMALMAP_ON + + + #define _URP 1 +#define _USINGTEXCOORD1 1 +#define _USINGTEXCOORD2 1 + + // Includes + #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Version.hlsl" + #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Color.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.universal/ShaderLibrary/ShaderGraphFunctions.hlsl" + #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/TextureStack.hlsl" + #include "Packages/com.unity.shadergraph/ShaderGraphLibrary/ShaderVariablesFunctions.hlsl" + + + #undef WorldNormalVector + #define WorldNormalVector(data, normal) mul(normal, data.TBNMatrix) + + #define UnityObjectToWorldNormal(normal) mul(GetObjectToWorldMatrix(), normal) + + #define _WorldSpaceLightPos0 _MainLightPosition + + #define UNITY_DECLARE_TEX2D(name) TEXTURE2D(name); SAMPLER(sampler##name); + #define UNITY_DECLARE_TEX2D_NOSAMPLER(name) TEXTURE2D(name); + #define UNITY_DECLARE_TEX2DARRAY(name) TEXTURE2D_ARRAY(name); SAMPLER(sampler##name); + #define UNITY_DECLARE_TEX2DARRAY_NOSAMPLER(name) TEXTURE2D_ARRAY(name); + + #define UNITY_SAMPLE_TEX2DARRAY(tex,coord) SAMPLE_TEXTURE2D_ARRAY(tex, sampler##tex, coord.xy, coord.z) + #define UNITY_SAMPLE_TEX2DARRAY_LOD(tex,coord,lod) SAMPLE_TEXTURE2D_ARRAY_LOD(tex, sampler##tex, coord.xy, coord.z, lod) + #define UNITY_SAMPLE_TEX2D(tex, coord) SAMPLE_TEXTURE2D(tex, sampler##tex, coord) + #define UNITY_SAMPLE_TEX2D_SAMPLER(tex, samp, coord) SAMPLE_TEXTURE2D(tex, sampler##samp, coord) + + #define UNITY_SAMPLE_TEX2D_LOD(tex,coord, lod) SAMPLE_TEXTURE2D_LOD(tex, sampler_##tex, coord, lod) + #define UNITY_SAMPLE_TEX2D_SAMPLER_LOD(tex,samplertex,coord, lod) SAMPLE_TEXTURE2D_LOD (tex, sampler##samplertex,coord, lod) + + #if defined(UNITY_COMPILER_HLSL) + #define UNITY_INITIALIZE_OUTPUT(type,name) name = (type)0; + #else + #define UNITY_INITIALIZE_OUTPUT(type,name) + #endif + + #define sampler2D_float sampler2D + #define sampler2D_half sampler2D + + + + // data across stages, stripped like the above. + struct VertexToPixel + { + float4 pos : SV_POSITION; + float3 worldPos : TEXCOORD0; + float3 worldNormal : TEXCOORD1; + float4 worldTangent : TEXCOORD2; + float4 texcoord0 : TEXCOORD3; + float4 texcoord1 : TEXCOORD4; + float4 texcoord2 : TEXCOORD5; + + // #if %TEXCOORD3REQUIREKEY% + float4 texcoord3 : TEXCOORD6; + // #endif + + // #if %SCREENPOSREQUIREKEY% + // float4 screenPos : TEXCOORD7; + // #endif + + // #if %VERTEXCOLORREQUIREKEY% + half4 vertexColor : COLOR; + // #endif + + #if defined(LIGHTMAP_ON) + float2 lightmapUV : TEXCOORD8; + #endif + #if defined(DYNAMICLIGHTMAP_ON) + float2 dynamicLightmapUV : TEXCOORD9; + #endif + #if !defined(LIGHTMAP_ON) + float3 sh : TEXCOORD10; + #endif + + #if defined(VARYINGS_NEED_FOG_AND_VERTEX_LIGHT) + float4 fogFactorAndVertexLight : TEXCOORD11; + #endif + + #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR) + float4 shadowCoord : TEXCOORD12; + #endif + + // #if %EXTRAV2F0REQUIREKEY% + // float4 extraV2F0 : TEXCOORD13; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // float4 extraV2F1 : TEXCOORD14; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // float4 extraV2F2 : TEXCOORD15; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // float4 extraV2F3 : TEXCOORD16; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // float4 extraV2F4 : TEXCOORD17; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // float4 extraV2F5 : TEXCOORD18; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // float4 extraV2F6 : TEXCOORD19; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // float4 extraV2F7 : TEXCOORD20; + // #endif + + #if UNITY_ANY_INSTANCING_ENABLED + uint instanceID : CUSTOM_INSTANCE_ID; + #endif + #if (defined(UNITY_STEREO_MULTIVIEW_ENABLED)) || (defined(UNITY_STEREO_INSTANCING_ENABLED) && (defined(SHADER_API_GLES3) || defined(SHADER_API_GLCORE))) + uint stereoTargetEyeIndexAsBlendIdx0 : BLENDINDICES0; + #endif + #if (defined(UNITY_STEREO_INSTANCING_ENABLED)) + uint stereoTargetEyeIndexAsRTArrayIdx : SV_RenderTargetArrayIndex; + #endif + #if defined(SHADER_STAGE_FRAGMENT) && defined(VARYINGS_NEED_CULLFACE) + FRONT_FACE_TYPE cullFace : FRONT_FACE_SEMANTIC; + #endif + + + }; + + + + + // data describing the user output of a pixel + struct Surface + { + half3 Albedo; + half Height; + half3 Normal; + half Smoothness; + half3 Emission; + half Metallic; + half3 Specular; + half Occlusion; + half SpecularPower; // for simple lighting + half Alpha; + float outputDepth; // if written, SV_Depth semantic is used. ShaderData.clipPos.z is unused value + // HDRP Only + half SpecularOcclusion; + half SubsurfaceMask; + half Thickness; + half CoatMask; + half CoatSmoothness; + half Anisotropy; + half IridescenceMask; + half IridescenceThickness; + int DiffusionProfileHash; + float SpecularAAThreshold; + float SpecularAAScreenSpaceVariance; + // requires _OVERRIDE_BAKEDGI to be defined, but is mapped in all pipelines + float3 DiffuseGI; + float3 BackDiffuseGI; + float3 SpecularGI; + float ior; + float3 transmittanceColor; + float atDistance; + float transmittanceMask; + // requires _OVERRIDE_SHADOWMASK to be defines + float4 ShadowMask; + + // for decals + float NormalAlpha; + float MAOSAlpha; + + + }; + + // Data the user declares in blackboard blocks + struct Blackboard + { + + float blackboardDummyData; + }; + + // data the user might need, this will grow to be big. But easy to strip + struct ShaderData + { + float4 clipPos; // SV_POSITION + float3 localSpacePosition; + float3 localSpaceNormal; + float3 localSpaceTangent; + + float3 worldSpacePosition; + float3 worldSpaceNormal; + float3 worldSpaceTangent; + float tangentSign; + + float3 worldSpaceViewDir; + float3 tangentSpaceViewDir; + + float4 texcoord0; + float4 texcoord1; + float4 texcoord2; + float4 texcoord3; + + float2 screenUV; + float4 screenPos; + + float4 vertexColor; + bool isFrontFace; + + float4 extraV2F0; + float4 extraV2F1; + float4 extraV2F2; + float4 extraV2F3; + float4 extraV2F4; + float4 extraV2F5; + float4 extraV2F6; + float4 extraV2F7; + + float3x3 TBNMatrix; + Blackboard blackboard; + }; + + struct VertexData + { + #if SHADER_TARGET > 30 + // uint vertexID : SV_VertexID; + #endif + float4 vertex : POSITION; + float3 normal : NORMAL; + float4 tangent : TANGENT; + float4 texcoord0 : TEXCOORD0; + + // optimize out mesh coords when not in use by user or lighting system + #if _URP && (_USINGTEXCOORD1 || _PASSMETA || _PASSFORWARD || _PASSGBUFFER) + float4 texcoord1 : TEXCOORD1; + #endif + + #if _URP && (_USINGTEXCOORD2 || _PASSMETA || ((_PASSFORWARD || _PASSGBUFFER) && defined(DYNAMICLIGHTMAP_ON))) + float4 texcoord2 : TEXCOORD2; + #endif + + #if _STANDARD && (_USINGTEXCOORD1 || (_PASSMETA || ((_PASSFORWARD || _PASSGBUFFER || _PASSFORWARDADD) && LIGHTMAP_ON))) + float4 texcoord1 : TEXCOORD1; + #endif + #if _STANDARD && (_USINGTEXCOORD2 || (_PASSMETA || ((_PASSFORWARD || _PASSGBUFFER) && DYNAMICLIGHTMAP_ON))) + float4 texcoord2 : TEXCOORD2; + #endif + + + #if _HDRP + float4 texcoord1 : TEXCOORD1; + float4 texcoord2 : TEXCOORD2; + #endif + + // #if %TEXCOORD3REQUIREKEY% + float4 texcoord3 : TEXCOORD3; + // #endif + + // #if %VERTEXCOLORREQUIREKEY% + float4 vertexColor : COLOR; + // #endif + + #if _PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR)) + float3 previousPositionOS : TEXCOORD4; // Contain previous transform position (in case of skinning for example) + #if defined (_ADD_PRECOMPUTED_VELOCITY) + float3 precomputedVelocity : TEXCOORD5; // Add Precomputed Velocity (Alembic computes velocities on runtime side). + #endif + #endif + + UNITY_VERTEX_INPUT_INSTANCE_ID + }; + + struct TessVertex + { + float4 vertex : INTERNALTESSPOS; + float3 normal : NORMAL; + float4 tangent : TANGENT; + float4 texcoord0 : TEXCOORD0; + float4 texcoord1 : TEXCOORD1; + float4 texcoord2 : TEXCOORD2; + + // #if %TEXCOORD3REQUIREKEY% + float4 texcoord3 : TEXCOORD3; + // #endif + + // #if %VERTEXCOLORREQUIREKEY% + float4 vertexColor : COLOR; + // #endif + + // #if %EXTRAV2F0REQUIREKEY% + // float4 extraV2F0 : TEXCOORD5; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // float4 extraV2F1 : TEXCOORD6; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // float4 extraV2F2 : TEXCOORD7; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // float4 extraV2F3 : TEXCOORD8; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // float4 extraV2F4 : TEXCOORD9; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // float4 extraV2F5 : TEXCOORD10; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // float4 extraV2F6 : TEXCOORD11; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // float4 extraV2F7 : TEXCOORD12; + // #endif + + #if _PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR)) + float3 previousPositionOS : TEXCOORD13; // Contain previous transform position (in case of skinning for example) + #if defined (_ADD_PRECOMPUTED_VELOCITY) + float3 precomputedVelocity : TEXCOORD14; + #endif + #endif + + UNITY_VERTEX_INPUT_INSTANCE_ID + UNITY_VERTEX_OUTPUT_STEREO + }; + + struct ExtraV2F + { + float4 extraV2F0; + float4 extraV2F1; + float4 extraV2F2; + float4 extraV2F3; + float4 extraV2F4; + float4 extraV2F5; + float4 extraV2F6; + float4 extraV2F7; + Blackboard blackboard; + float4 time; + }; + + + float3 WorldToTangentSpace(ShaderData d, float3 normal) + { + return mul(d.TBNMatrix, normal); + } + + float3 TangentToWorldSpace(ShaderData d, float3 normal) + { + return mul(normal, d.TBNMatrix); + } + + // in this case, make standard more like SRPs, because we can't fix + // unity_WorldToObject in HDRP, since it already does macro-fu there + + #if _STANDARD + float3 TransformWorldToObject(float3 p) { return mul(unity_WorldToObject, float4(p, 1)); }; + float3 TransformObjectToWorld(float3 p) { return mul(unity_ObjectToWorld, float4(p, 1)); }; + float4 TransformWorldToObject(float4 p) { return mul(unity_WorldToObject, p); }; + float4 TransformObjectToWorld(float4 p) { return mul(unity_ObjectToWorld, p); }; + float4x4 GetWorldToObjectMatrix() { return unity_WorldToObject; } + float4x4 GetObjectToWorldMatrix() { return unity_ObjectToWorld; } + #if (defined(SHADER_API_D3D11) || defined(SHADER_API_XBOXONE) || defined(UNITY_COMPILER_HLSLCC) || defined(SHADER_API_PSSL) || (SHADER_TARGET_SURFACE_ANALYSIS && !SHADER_TARGET_SURFACE_ANALYSIS_MOJOSHADER)) + #define UNITY_SAMPLE_TEX2D_LOD(tex,coord, lod) tex.SampleLevel (sampler##tex,coord, lod) + #define UNITY_SAMPLE_TEX2D_SAMPLER_LOD(tex,samplertex,coord, lod) tex.SampleLevel (sampler##samplertex,coord, lod) + #else + #define UNITY_SAMPLE_TEX2D_LOD(tex,coord,lod) tex2D (tex,coord,0,lod) + #define UNITY_SAMPLE_TEX2D_SAMPLER_LOD(tex,samplertex,coord,lod) tex2D (tex,coord,0,lod) + #endif + + #undef GetWorldToObjectMatrix() + + #define GetWorldToObjectMatrix() unity_WorldToObject + + + #endif + + float3 GetCameraWorldPosition() + { + #if _HDRP + return GetCameraRelativePositionWS(_WorldSpaceCameraPos); + #else + return _WorldSpaceCameraPos; + #endif + } + + #if _GRABPASSUSED + #if _STANDARD + TEXTURE2D(%GRABTEXTURE%); + SAMPLER(sampler_%GRABTEXTURE%); + #endif + + half3 GetSceneColor(float2 uv) + { + #if _STANDARD + return SAMPLE_TEXTURE2D(%GRABTEXTURE%, sampler_%GRABTEXTURE%, uv).rgb; + #else + return SHADERGRAPH_SAMPLE_SCENE_COLOR(uv); + #endif + } + #endif + + + + #if _STANDARD + UNITY_DECLARE_DEPTH_TEXTURE(_CameraDepthTexture); + float GetSceneDepth(float2 uv) { return SAMPLE_DEPTH_TEXTURE(_CameraDepthTexture, uv); } + float GetLinear01Depth(float2 uv) { return Linear01Depth(GetSceneDepth(uv)); } + float GetLinearEyeDepth(float2 uv) { return LinearEyeDepth(GetSceneDepth(uv)); } + #else + float GetSceneDepth(float2 uv) { return SHADERGRAPH_SAMPLE_SCENE_DEPTH(uv); } + float GetLinear01Depth(float2 uv) { return Linear01Depth(GetSceneDepth(uv), _ZBufferParams); } + float GetLinearEyeDepth(float2 uv) { return LinearEyeDepth(GetSceneDepth(uv), _ZBufferParams); } + #endif + + float3 GetWorldPositionFromDepthBuffer(float2 uv, float3 worldSpaceViewDir) + { + float eye = GetLinearEyeDepth(uv); + float3 camView = mul((float3x3)GetObjectToWorldMatrix(), transpose(mul(GetWorldToObjectMatrix(), UNITY_MATRIX_I_V)) [2].xyz); + + float dt = dot(worldSpaceViewDir, camView); + float3 div = worldSpaceViewDir/dt; + float3 wpos = (eye * div) + GetCameraWorldPosition(); + return wpos; + } + + #if _HDRP + float3 ObjectToWorldSpacePosition(float3 pos) + { + return GetAbsolutePositionWS(TransformObjectToWorld(pos)); + } + #else + float3 ObjectToWorldSpacePosition(float3 pos) + { + return TransformObjectToWorld(pos); + } + #endif + + #if _STANDARD + UNITY_DECLARE_SCREENSPACE_TEXTURE(_CameraDepthNormalsTexture); + float3 GetSceneNormal(float2 uv, float3 worldSpaceViewDir) + { + float4 depthNorms = UNITY_SAMPLE_SCREENSPACE_TEXTURE(_CameraDepthNormalsTexture, uv); + float3 norms = DecodeViewNormalStereo(depthNorms); + norms = mul((float3x3)GetWorldToViewMatrix(), norms) * 0.5 + 0.5; + return norms; + } + #elif _HDRP && !_DECALSHADER + + float3 GetSceneNormal(float2 uv, float3 worldSpaceViewDir) + { + NormalData nd; + DecodeFromNormalBuffer(_ScreenSize.xy * uv, nd); + return nd.normalWS; + } + #elif _URP + #if (SHADER_LIBRARY_VERSION_MAJOR >= 10) + #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/DeclareNormalsTexture.hlsl" + #endif + + float3 GetSceneNormal(float2 uv, float3 worldSpaceViewDir) + { + #if (SHADER_LIBRARY_VERSION_MAJOR >= 10) + return SampleSceneNormals(uv); + #else + float3 wpos = GetWorldPositionFromDepthBuffer(uv, worldSpaceViewDir); + return normalize(-cross(ddx(wpos), ddy(wpos))) * 0.5 + 0.5; + #endif + + } + #endif + + #if _HDRP + + half3 UnpackNormalmapRGorAG(half4 packednormal) + { + // This do the trick + packednormal.x *= packednormal.w; + + half3 normal; + normal.xy = packednormal.xy * 2 - 1; + normal.z = sqrt(1 - saturate(dot(normal.xy, normal.xy))); + return normal; + } + half3 UnpackNormal(half4 packednormal) + { + #if defined(UNITY_NO_DXT5nm) + return packednormal.xyz * 2 - 1; + #else + return UnpackNormalmapRGorAG(packednormal); + #endif + } + #endif + #if _HDRP || _URP + + half3 UnpackScaleNormal(half4 packednormal, half scale) + { + #ifndef UNITY_NO_DXT5nm + // Unpack normal as DXT5nm (1, y, 1, x) or BC5 (x, y, 0, 1) + // Note neutral texture like "bump" is (0, 0, 1, 1) to work with both plain RGB normal and DXT5nm/BC5 + packednormal.x *= packednormal.w; + #endif + half3 normal; + normal.xy = (packednormal.xy * 2 - 1) * scale; + normal.z = sqrt(1 - saturate(dot(normal.xy, normal.xy))); + return normal; + } + + #endif + + + void GetSun(out float3 lightDir, out float3 color) + { + lightDir = float3(0.5, 0.5, 0); + color = 1; + #if _HDRP + if (_DirectionalLightCount > 0) + { + DirectionalLightData light = _DirectionalLightDatas[0]; + lightDir = -light.forward.xyz; + color = light.color; + } + #elif _STANDARD + lightDir = normalize(_WorldSpaceLightPos0.xyz); + color = _LightColor0.rgb; + #elif _URP + Light light = GetMainLight(); + lightDir = light.direction; + color = light.color; + #endif + } + + + + CBUFFER_START(UnityPerMaterial) + + + half4 _Color; + half4 _MainTex_ST, _MainTex_TexelSize; + half _Alpha, _AlphaCutoffValue; + + #if ATLAS_ON + half _MinXUV, _MaxXUV, _MinYUV, _MaxYUV; + #endif + + #if GLOW_ON + half4 _GlowColor; + half _Glow, _GlowGlobal; + #endif + + #if HSV_ON + half _HsvShift, _HsvSaturation, _HsvBright; + #endif + + #if DISTORT_ON + half4 _DistortTex_ST; + half _DistortTexXSpeed, _DistortTexYSpeed, _DistortAmount; + #endif + + #if FADE_ON + half4 _FadeBurnColor, _FadeTex_ST, _FadeBurnTex_ST; + half _FadeAmount, _FadeBurnWidth, _FadeBurnTransition,_FadeBurnGlow; + #endif + + #if OUTBASE_ON + half4 _OutlineColor; + half _OutlineAlpha, _OutlineGlow, _OutlineWidth; + int _OutlinePixelWidth; + #endif + + #if OUTTEX_ON + half4 _OutlineTex_ST; + half _OutlineTexXSpeed, _OutlineTexYSpeed; + #endif + + #if OUTDIST_ON + half4 _OutlineDistortTex_ST; + half _OutlineDistortTexXSpeed, _OutlineDistortTexYSpeed, _OutlineDistortAmount; + #endif + + #if ALPHAOUTLINE_ON + half _AlphaOutlineGlow, _AlphaOutlinePower, _AlphaOutlineMinAlpha, _AlphaOutlineBlend; + half4 _AlphaOutlineColor; + #endif + + #if INNEROUTLINE_ON + half _InnerOutlineThickness, _InnerOutlineAlpha, _InnerOutlineGlow; + half4 _InnerOutlineColor; + #endif + + #if GRADIENT_ON + half _GradBlend, _GradBoostX, _GradBoostY; + half4 _GradTopRightCol, _GradTopLeftCol, _GradBotRightCol, _GradBotLeftCol; + #endif + + #if COLORSWAP_ON + half4 _ColorSwapRed, _ColorSwapGreen, _ColorSwapBlue; + half _ColorSwapRedLuminosity, _ColorSwapGreenLuminosity, _ColorSwapBlueLuminosity, _ColorSwapBlend; + #endif + + #if CHANGECOLOR_ON + half4 _ColorChangeNewCol, _ColorChangeTarget; + half _ColorChangeTolerance, _ColorChangeLuminosity; + #endif + #if CHANGECOLOR2_ON + half4 _ColorChangeNewCol2, _ColorChangeTarget2; + half _ColorChangeTolerance2; + #endif + #if CHANGECOLOR3_ON + half4 _ColorChangeNewCol3, _ColorChangeTarget3; + half _ColorChangeTolerance3; + #endif + + #if COLORRAMP_ON + half _ColorRampLuminosity, _ColorRampBlend; + #endif + + #if HITEFFECT_ON + half4 _HitEffectColor; + half _HitEffectGlow, _HitEffectBlend; + #endif + + #if NEGATIVE_ON + half _NegativeAmount; + #endif + + #if PIXELATE_ON + half _PixelateSize; + #endif + + #if GREYSCALE_ON + half _GreyscaleLuminosity, _GreyscaleBlend; + half4 _GreyscaleTintColor; + #endif + + #if POSTERIZE_ON + half _PosterizeNumColors, _PosterizeGamma; + #endif + + #if BLUR_ON + half _BlurIntensity; + #endif + + #if MOTIONBLUR_ON + half _MotionBlurAngle, _MotionBlurDist; + #endif + + #if GHOST_ON + half _GhostColorBoost, _GhostTransparency, _GhostBlend; + #endif + + #if HOLOGRAM_ON + half _HologramStripesAmount, _HologramMinAlpha, _HologramUnmodAmount, _HologramStripesSpeed, _HologramMaxAlpha, _HologramBlend; + half4 _HologramStripeColor; + #endif + + #if CHROMABERR_ON + half _ChromAberrAmount, _ChromAberrAlpha; + #endif + + #if GLITCH_ON + half _GlitchAmount, _GlitchSize; + #endif + + #if FLICKER_ON + half _FlickerFreq, _FlickerPercent, _FlickerAlpha; + #endif + + #if SHADOW_ON + half _ShadowX, _ShadowY, _ShadowAlpha; + half4 _ShadowColor; + #endif + + #if SHINE_ON + half4 _ShineColor; + half _ShineLocation, _ShineRotate, _ShineWidth, _ShineGlow; + #endif + + #if CONTRAST_ON + half _Contrast, _Brightness; + #endif + + #if OVERLAY_ON + half4 _OverlayTex_ST, _OverlayColor; + half _OverlayGlow, _OverlayBlend, _OverlayTextureScrollXSpeed, _OverlayTextureScrollYSpeed; + #endif + + #if DOODLE_ON + half _HandDrawnAmount, _HandDrawnSpeed; + #endif + + #if WIND_ON + half _GrassSpeed, _GrassWind, _GrassManualAnim, _GrassRadialBend; + #endif + + #if WAVEUV_ON + float _WaveAmount, _WaveSpeed, _WaveStrength, _WaveX, _WaveY; + #endif + + #if ROUNDWAVEUV_ON + half _RoundWaveStrength, _RoundWaveSpeed; + #endif + + #if RECTSIZE_ON + half _RectSize; + #endif + + #if OFFSETUV_ON + half _OffsetUvX, _OffsetUvY; + #endif + + #if CLIPPING_ON + half _ClipUvLeft, _ClipUvRight, _ClipUvUp, _ClipUvDown; + #endif + + #if RADIALCLIPPING_ON + half _RadialStartAngle, _RadialClip, _RadialClip2; + #endif + + #if TEXTURESCROLL_ON + half _TextureScrollXSpeed, _TextureScrollYSpeed; + #endif + + #if ZOOMUV_ON + half _ZoomUvAmount; + #endif + + #if WARP_ON + half _WarpStrength, _WarpSpeed, _WarpScale; + #endif + + #if TWISTUV_ON + half _TwistUvAmount, _TwistUvPosX, _TwistUvPosY, _TwistUvRadius; + #endif + + #if ROTATEUV_ON + half _RotateUvAmount; + #endif + + #if FISHEYE_ON + half _FishEyeUvAmount; + #endif + + #if PINCH_ON + half _PinchUvAmount; + #endif + + #if SHAKEUV_ON + half _ShakeUvSpeed, _ShakeUvX, _ShakeUvY; + #endif + + #if NORMALMAP_ON + half _NormalStrength; + #endif + + float _RandomSeed; + + + + + CBUFFER_END + + + + + + + + TEXTURE2D(_MainTex); + SAMPLER(sampler_MainTex); + + #if GLOW_ON + TEXTURE2D(_GlowTex); + SAMPLER(sampler_GlowTex); + #endif + + #if FADE_ON + TEXTURE2D(_FadeTex); + SAMPLER(sampler_FadeTex); + + TEXTURE2D(_FadeBurnTex); + SAMPLER(sampler_FadeBurnTex); + #endif + + #if DISTORT_ON + TEXTURE2D(_DistortTex); + SAMPLER(sampler_DistortTex); + #endif + + #if OUTTEX_ON + TEXTURE2D(_OutlineTex); + SAMPLER(sampler_OutlineTex); + #endif + + #if OUTDIST_ON + TEXTURE2D(_OutlineDistortTex); + SAMPLER(sampler_OutlineDistortTex); + #endif + + #if COLORSWAP_ON + TEXTURE2D(_ColorSwapTex); + SAMPLER(sampler_ColorSwapTex); + #endif + + #if COLORRAMP_ON + TEXTURE2D(_ColorRampTex); + TEXTURE2D(_ColorRampTexGradient); + SAMPLER(sampler_ColorRampTex); + SAMPLER(sampler_ColorRampTexGradient); + #endif + + #if SHINE_ON + TEXTURE2D(_ShineMask); + SAMPLER(sampler_ShineMask); + #endif + + #if OVERLAY_ON + TEXTURE2D(_OverlayTex); + SAMPLER(sampler_OverlayTex); + #endif + + #if NORMALMAP_ON + TEXTURE2D(_NormalMap); + SAMPLER(sampler_NormalMap); + #endif + + + half3 GetPixel(in int offsetX, in int offsetY, in half2 uv, in Texture2D _tex, in SamplerState _sampler) + { + half2 _uv = uv + half2(offsetX * _MainTex_TexelSize.x, offsetY * _MainTex_TexelSize.y); + half4 col = SAMPLE_TEXTURE2D(_tex, _sampler, _uv); + return col.rgb; + } + + + //BLURS------------------------------------------------------------------------- + half4 Blur(half2 uv, Texture2D source, SamplerState sampler_source, half Intensity) + { + const half2 texelSize = 1.0 / _ScreenParams.xy; + const half4 color = SAMPLE_TEXTURE2D(source, sampler_source, uv); + const half2 offset = Intensity * texelSize; + + half4 accumulatedColor = color; + half accumulatedWeight = 1.0; + for (int x = -1; x <= 1; x++) + { + for (int y = -1; y <= 1; y++) + { + const half2 sampleUV = uv + half2(x, y) * offset; + const half4 sampleColor = SAMPLE_TEXTURE2D(source, sampler_source, sampleUV); + + accumulatedColor += sampleColor; + accumulatedWeight += 1.0; + } + } + + half4 blurredColor = accumulatedColor / accumulatedWeight; + return blurredColor; + } + + half BlurHD_G(half bhqp, half x) + { + return exp(-(x * x) / (2.0 * bhqp * bhqp)); + } + half4 BlurHD(half2 uv, Texture2D source, SamplerState sampler_source, half BlurAmount, half xScale, half yScale) + { + int iterations = 16; + int halfIterations = iterations / 2; + half sigmaX = 0.1 + BlurAmount * 0.5; + half sigmaY = sigmaX; + half total = 0.0; + half4 ret = half4(0, 0, 0, 0); + for (int iy = 0; iy < iterations; ++iy) + { + half fy = BlurHD_G(sigmaY, half(iy) -half(halfIterations)); + half offsetY = half(iy - halfIterations) * 0.00390625 * xScale; + for (int ix = 0; ix < iterations; ++ix) + { + half fx = BlurHD_G(sigmaX, half(ix) - half(halfIterations)); + half offsetX = half(ix - halfIterations) * 0.00390625 * yScale; + total += fx * fy; + ret += SAMPLE_TEXTURE2D(source, sampler_source, uv + half2(offsetX, offsetY)) * fx * fy; + } + } + return ret / total; + } + //----------------------------------------------------------------------- + + + //------------------------------------------- + half RemapFloat(half inValue, half inMin, half inMax, half outMin, half outMax){ + return outMin + (inValue - inMin) * (outMax - outMin) / (inMax - inMin); + } + //------------------------------------------- + + //----------------------------------------------------------------------- + half rand(half2 seed, half offset) { + return (frac(sin(dot(seed, half2(12.9898, 78.233))) * 43758.5453) + offset) % 1.0; + } + + half rand2(half2 seed, half offset) { + return (frac(sin(dot(seed * floor(50 + (_Time.x % 1.0) * 12.), half2(127.1, 311.7))) * 43758.5453123) + offset) % 1.0; + } + + half rand2CustomTime(half2 seed, half offset, half customTime) { + return (frac(sin(dot(seed * floor(50 + (customTime % 1.0) * 12.), half2(127.1, 311.7))) * 43758.5453123) + offset) % 1.0; + } + //----------------------------------------------------------------------- + + + void Ext_ModifyVertex0 (inout VertexData v, inout ExtraV2F d) + { + //BILBOARD_ON + #if BILBOARD_ON + half3 camRight = mul((half3x3)unity_CameraToWorld, half3(1,0,0)); + half3 camUp = half3(0,1,0); + #if BILBOARDY_ON + camUp = mul((half3x3)unity_CameraToWorld, half3(0,1,0)); + #endif + half3 localPos = v.vertex.x * camRight + v.vertex.y * camUp; + v.vertex = half4(localPos, 1); + #endif + //----------------------------------------------------------- + + v.texcoord0.xy = TRANSFORM_TEX(v.texcoord0.xy, _MainTex); + half2 center = half2(0.5, 0.5); + #if ATLAS_ON + center = half2((_MaxXUV + _MinXUV) / 2.0, (_MaxYUV + _MinYUV) / 2.0); + #endif + + //POLARUV_ON + #if POLARUV_ON + v.texcoord0.xy = v.texcoord0.xy - center; + #endif + + //---------------------------------------- + + //ROTATEUV_ON + #if ROTATEUV_ON + half2 uvC = v.texcoord0.xy; + half cosAngle = cos(_RotateUvAmount); + half sinAngle = sin(_RotateUvAmount); + half2x2 rot = half2x2(cosAngle, -sinAngle, sinAngle, cosAngle); + uvC -= center; + v.texcoord0.xy = mul(rot, uvC); + v.texcoord0.xy += center; + #endif + //-------------------- + + #if RECTSIZE_ON + v.vertex.xyz += (v.vertex.xyz * (_RectSize - 1.0)); + #endif + + #if OUTTEX_ON + v.texcoord1.xy = TRANSFORM_TEX(v.texcoord0.xy, _OutlineTex); + #endif + + #if OUTDIST_ON + v.texcoord2.xy = TRANSFORM_TEX(v.texcoord0.xy, _OutlineDistortTex); + #endif + + #if DISTORT_ON + v.texcoord3.xy = TRANSFORM_TEX(v.texcoord0.xy, _DistortTex); + #endif + } + + void Ext_SurfaceFunction0 (inout Surface o, ShaderData d) + { + half randomSeed = _RandomSeed; + + float2 uvRect = d.texcoord0; + half2 center = half2(0.5, 0.5); + #if ATLAS_ON + center = half2((_MaxXUV + _MinXUV) / 2.0, (_MaxYUV + _MinYUV) / 2.0); + uvRect = half2((d.texcoord0.x - _MinXUV) / (_MaxXUV - _MinXUV), (d.texcoord0.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half2 centerTiled = half2(center.x * _MainTex_ST.x, center.y * _MainTex_ST.y); + + //CLIPPING_ON + #if CLIPPING_ON + half2 tiledUv = half2(d.texcoord0.x / _MainTex_ST.x, d.texcoord0.y / _MainTex_ST.y); + #if ATLAS_ON + tiledUv = half2((tiledUv.x - _MinXUV) / (_MaxXUV - _MinXUV), (tiledUv.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + clip((1 - _ClipUvUp) - tiledUv.y); + clip(tiledUv.y - _ClipUvDown); + clip((1 - _ClipUvRight) - tiledUv.x); + clip(tiledUv.x - _ClipUvLeft); + #endif + //---------------------------------- + + //RADIALCLIPPING_ON + #if RADIALCLIPPING_ON + half2 tiledUv2 = half2(d.texcoord0.x / _MainTex_ST.x, d.texcoord0.y / _MainTex_ST.y); + #if ATLAS_ON + tiledUv2 = half2((tiledUv2.x - _MinXUV) / (_MaxXUV - _MinXUV), (tiledUv2.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half startAngle = _RadialStartAngle - _RadialClip; + half endAngle = _RadialStartAngle + _RadialClip2; + half offset0 = clamp(0, 360, startAngle + 360); + half offset360 = clamp(0, 360, endAngle - 360); + half2 atan2Coord = half2(lerp(-1, 1, tiledUv2.x), lerp(-1, 1, tiledUv2.y)); + half atanAngle = atan2(atan2Coord.y, atan2Coord.x) * 57.3; // angle in degrees + if(atanAngle < 0) atanAngle = 360 + atanAngle; + if(atanAngle >= startAngle && atanAngle <= endAngle) discard; + if(atanAngle <= offset360) discard; + if(atanAngle >= offset0) discard; + #endif + + //----------------------------- + + //TEXTURESCROLL_ON && ATLAS_ON + #if TEXTURESCROLL_ON && ATLAS_ON + d.texcoord0.xy = half2(_MinXUV + ((_MaxXUV - _MinXUV) * (abs(((_Time.y + randomSeed) * _TextureScrollXSpeed) + uvRect.x) % 1)), + _MinYUV + ((_MaxYUV - _MinYUV) * (abs(((_Time.y + randomSeed) * _TextureScrollYSpeed) + uvRect.y) % 1))); + #endif + //---------------------------- + + //OFFSETUV_ON + #if OFFSETUV_ON + #if ATLAS_ON + d.texcoord0.xy = half2(_MinXUV + ((_MaxXUV - _MinXUV) * (abs((_OffsetUvX + uvRect.x) % 1))), + _MinYUV + ((_MaxYUV - _MinYUV) * (abs(_OffsetUvY + uvRect.y) % 1))); + #else + d.texcoord0.xy += half2(_OffsetUvX, _OffsetUvY); + #endif + #endif + + //---------------------- + + //POLARUV_ON + #if POLARUV_ON + d.texcoord0.xy = half2(atan2(d.texcoord0.y, d.texcoord0.x) / (2.0f * 3.141592653589f), length(d.texcoord0.xy)); + d.texcoord0.xy *= _MainTex_ST.xy; + #endif + + //-------------------------------------- + + //TWISTUV_ON + #if TWISTUV_ON + #if ATLAS_ON + _TwistUvPosX = ((_MaxXUV - _MinXUV) * _TwistUvPosX) + _MinXUV; + _TwistUvPosY = ((_MaxYUV - _MinYUV) * _TwistUvPosY) + _MinYUV; + #endif + half2 tempUv = d.texcoord0.xy - half2(_TwistUvPosX * _MainTex_ST.x, _TwistUvPosY * _MainTex_ST.y); + _TwistUvRadius *= (_MainTex_ST.x + _MainTex_ST.y) / 2; + half percent = (_TwistUvRadius - length(tempUv)) / _TwistUvRadius; + half theta = percent * percent * (2.0 * sin(_TwistUvAmount)) * 8.0; + half s = sin(theta); + half c = cos(theta); + half beta = max(sign(_TwistUvRadius - length(tempUv)), 0.0); + tempUv = half2(dot(tempUv, half2(c, -s)), dot(tempUv, half2(s, c))) * beta + tempUv * (1 - beta); + tempUv += half2(_TwistUvPosX * _MainTex_ST.x, _TwistUvPosY * _MainTex_ST.y); + d.texcoord0.xy = tempUv; + #endif + + //-------------------------------------------- + + //FISHEYE_ON + #if FISHEYE_ON + half bind = length(centerTiled); + half2 dF = d.texcoord0.xy - centerTiled; + half dFlen = length(dF); + half fishInt = (3.14159265359 / bind) * (_FishEyeUvAmount + 0.001); + d.texcoord0.xy = centerTiled + (dF / (max(0.0001, dFlen))) * tan(dFlen * fishInt) * bind / tan(bind * fishInt); + #endif + //--------------------------------------------- + + //PINCH_ON + #if PINCH_ON + half2 dP = d.texcoord0.xy - centerTiled; + half pinchInt = (3.141592 / length(centerTiled)) * (-_PinchUvAmount + 0.001); + d.texcoord0.xy = centerTiled + normalize(dP) * atan(length(dP) * -pinchInt * 10.0) * 0.5 / atan(-pinchInt * 5); + #endif + + //--------------------------------------------- + + //ZOOMUV_ON + #if ZOOMUV_ON + d.texcoord0.xy -= centerTiled; + d.texcoord0.xy = d.texcoord0.xy * _ZoomUvAmount; + d.texcoord0.xy += centerTiled; + #endif + + //----------------------------------------------- + + //DOODLE_ON + #if DOODLE_ON + half2 uvCopy = uvRect; + _HandDrawnSpeed = (floor((_Time.x + randomSeed) * 20 * _HandDrawnSpeed) / _HandDrawnSpeed) * _HandDrawnSpeed; + uvCopy.x = sin((uvCopy.x * _HandDrawnAmount + _HandDrawnSpeed) * 4); + uvCopy.y = cos((uvCopy.y * _HandDrawnAmount + _HandDrawnSpeed) * 4); + d.texcoord0.xy = lerp(d.texcoord0.xy, d.texcoord0.xy + uvCopy, 0.0005 * _HandDrawnAmount); + #endif + + //-------------------------- + + //SHAKEUV_ON + #if SHAKEUV_ON + half xShake = sin((_Time.x + randomSeed) * _ShakeUvSpeed * 50) * _ShakeUvX; + half yShake = cos((_Time.x + randomSeed) * _ShakeUvSpeed * 50) * _ShakeUvY; + d.texcoord0.xy += half2(xShake * 0.012, yShake * 0.01); + #endif + + //------------------------------------------- + + //RECTSIZE_ON + #if RECTSIZE_ON + d.texcoord0.xy = d.texcoord0.xy * (_RectSize).xx + (((-_RectSize * 0.5) + 0.5)).xx; + #endif + + //------------------------------------------- + + //DISTORT_ON + #if DISTORT_ON + #if ATLAS_ON + d.texcoord3.x = d.texcoord3.x * (1 / (_MaxXUV - _MinXUV)); + d.texcoord3.y = d.texcoord3.y * (1 / (_MaxYUV - _MinYUV)); + #endif + + d.texcoord3.x += ((_Time.x + _RandomSeed) * _DistortTexXSpeed) % 1; + d.texcoord3.y += ((_Time.x + _RandomSeed) * _DistortTexYSpeed) % 1; + half distortAmnt = (SAMPLE_TEXTURE2D(_DistortTex, sampler_DistortTex, d.texcoord3.xy).r - 0.5) * 0.2 * _DistortAmount; + d.texcoord0.x += distortAmnt; + d.texcoord0.y += distortAmnt; + #endif + //------------------------------------------------------- + + //WARP_ON + #if WARP_ON + half2 warpUv = half2(d.texcoord0.x / _MainTex_ST.x, d.texcoord0.y / _MainTex_ST.y); + #if ATLAS_ON + warpUv = half2((warpUv.x - _MinXUV) / (_MaxXUV - _MinXUV), (warpUv.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + const float tau = 6.283185307179586; + float xWarp = (_Time.y + randomSeed) * _WarpSpeed + warpUv.x * tau / _WarpScale; + float yWarp = (_Time.y + randomSeed) * _WarpSpeed + warpUv.y * tau / _WarpScale; + float2 warp = float2(sin(xWarp), sin(yWarp)) * _WarpStrength; + d.texcoord0.xy += warp; + #endif + + //------------------------------------------------------- + + //WAVEUV_ON + #if WAVEUV_ON + float2 uvWave = half2(_WaveX * _MainTex_ST.x, _WaveY * _MainTex_ST.y) - d.texcoord0.xy; + uvWave %= 1; + #if ATLAS_ON + uvWave = half2(_WaveX, _WaveY) - uvRect; + #endif + uvWave.x *= _ScreenParams.x / _ScreenParams.y; + float waveTime = _Time.y + randomSeed; + float angWave = (sqrt(dot(uvWave, uvWave)) * _WaveAmount) - ((waveTime * _WaveSpeed)); + d.texcoord0.xy = d.texcoord0.xy + uvWave * sin(angWave) * (_WaveStrength / 1000.0); + #endif + //---------------------------------------------------- + + //ROUNDWAVEUV_ON + #if ROUNDWAVEUV_ON + half xWave = ((0.5 * _MainTex_ST.x) - uvRect.x); + half yWave = ((0.5 * _MainTex_ST.y) - uvRect.y) * (_MainTex_TexelSize.w / _MainTex_TexelSize.z); + half ripple = -sqrt(xWave*xWave + yWave* yWave); + d.texcoord0.xy += (sin((ripple + (_Time.y + randomSeed) * (_RoundWaveSpeed/10.0)) / 0.015) * (_RoundWaveStrength/10.0)) % 1; + #endif + //---------------------------------------------------- + + + //WIND_ON + #if WIND_ON + half windOffset = sin((_Time.x + randomSeed) * _GrassSpeed * 10); + half2 windCenter = half2(0.5, 0.1); + #if ATLAS_ON + windCenter.x = ((_MaxXUV - _MinXUV) * windCenter.x) + _MinXUV; + windCenter.y = ((_MaxYUV - _MinYUV) * windCenter.y) + _MinYUV; + #endif + #if !MANUALWIND_ON + d.texcoord0.x = fmod(abs(lerp(d.texcoord0.x, d.texcoord0.x + (_GrassWind * 0.01 * windOffset), uvRect.y)), 1); + #else + d.texcoord0.x = fmod(abs(lerp(d.texcoord0.x, d.texcoord0.x + (_GrassWind * 0.01 * _GrassManualAnim), uvRect.y)), 1); + windOffset = _GrassManualAnim; + #endif + half2 delta = d.texcoord0.xy - windCenter; + half delta2 = dot(delta.xy, delta.xy); + half2 delta_offset = delta2 * windOffset; + d.texcoord0.xy = d.texcoord0.xy + half2(delta.y, -delta.x) * delta_offset * _GrassRadialBend; + #endif + + //-------------------------------------------------------- + + //TEXTURESCROLL_ON && !ATLAS_ON + #if TEXTURESCROLL_ON && !ATLAS_ON + d.texcoord0.x += ((_Time.y + randomSeed) * _TextureScrollXSpeed) % 1; + d.texcoord0.y += ((_Time.y + randomSeed) * _TextureScrollYSpeed) % 1; + #endif + //------------------------------ + + //PIXELATE_ON + #if PIXELATE_ON + half aspectRatio = _MainTex_TexelSize.x / _MainTex_TexelSize.y; + half2 pixelSize = float2(_PixelateSize, _PixelateSize * aspectRatio); + d.texcoord0.xy = floor(d.texcoord0.xy * pixelSize) / pixelSize; + #endif + //-------------- + + half4 col = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy); + half originalAlpha = col.a; + col *= d.vertexColor; + + //NORMAL MAP + #if NORMALMAP_ON + half4 normalSample = SAMPLE_TEXTURE2D(_NormalMap, sampler_NormalMap, d.texcoord0.xy); + half3 normalTS = UnpackNormal(normalSample); + normalTS.xy *= _NormalStrength; + o.Normal = normalTS; + #endif + + + //GLITCH_ON + #if GLITCH_ON + half2 uvGlitch = uvRect; + uvGlitch.y -= 0.5; + half lineNoise = pow(rand2(floor(uvGlitch * half2(24., 19.) * _GlitchSize) * 4.0, randomSeed), 3.0) * _GlitchAmount + * pow(rand2(floor(uvGlitch * half2(38., 14.) * _GlitchSize) * 4.0, randomSeed), 3.0); + col = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(lineNoise * 0.02 * rand2(half2(2.0, 1), randomSeed), 0)) * d.vertexColor; + #endif + //-------------------------------------- + + //CHROMABERR_ON + #if CHROMABERR_ON + half4 r = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(_ChromAberrAmount/10, 0)) * d.vertexColor; + half4 b = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(-_ChromAberrAmount/10, 0)) * d.vertexColor; + col = half4(r.r * r.a, col.g, b.b * b.a, max(max(r.a, b.a) * _ChromAberrAlpha, col.a)); + #endif + + //-------------------------------- + + //BLUR_ON + #if BLUR_ON + #if ATLAS_ON + #if !BLURISHD_ON + col = BlurHD(d.texcoord0.xy, _MainTex, sampler_MainTex, _BlurIntensity, (_MaxXUV - _MinXUV), (_MaxYUV - _MinYUV)) * d.vertexColor; + #else + col = Blur(d.texcoord0.xy, _MainTex, sampler_MainTex, _BlurIntensity * (_MaxXUV - _MinXUV)) * d.vertexColor; + #endif + #else + #if !BLURISHD_ON + col = BlurHD(d.texcoord0.xy, _MainTex, sampler_MainTex, _BlurIntensity, 1, 1) * d.vertexColor; + #else + col = Blur(d.texcoord0.xy, _MainTex, sampler_MainTex, _BlurIntensity) * d.vertexColor; + #endif + #endif + #endif + + //-------------------- + + //MOTIONBLUR_ON + #if MOTIONBLUR_ON + _MotionBlurAngle = _MotionBlurAngle * 3.1415926; + #define rot(n) mul(n, half2x2(cos(_MotionBlurAngle), -sin(_MotionBlurAngle), sin(_MotionBlurAngle), cos(_MotionBlurAngle))) + _MotionBlurDist = _MotionBlurDist * 0.005; + #if ATLAS_ON + _MotionBlurDist *= (_MaxXUV - _MinXUV); + #endif + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(-_MotionBlurDist, -_MotionBlurDist))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(-_MotionBlurDist * 2, -_MotionBlurDist * 2))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(-_MotionBlurDist * 3, -_MotionBlurDist * 3))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(-_MotionBlurDist * 4, -_MotionBlurDist * 4))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(_MotionBlurDist, _MotionBlurDist))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(_MotionBlurDist * 2, _MotionBlurDist * 2))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(_MotionBlurDist * 3, _MotionBlurDist * 3))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(_MotionBlurDist * 4, _MotionBlurDist * 4))); + col.rgb = col.rgb / 9; + #endif + //------------------------------------ + + //NEGATIVE_ON + #if NEGATIVE_ON + col.rgb = lerp(col.rgb, 1 - col.rgb, _NegativeAmount); + #endif + + //-------------- + half luminance = 0; + + //GREYSCALE_ON && !GREYSCALEOUTLINE_ON + #if GREYSCALE_ON && !GREYSCALEOUTLINE_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + luminance = saturate(luminance + _GreyscaleLuminosity); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _GreyscaleTintColor, _GreyscaleBlend); + #endif + //------------------------------------ + + //GHOST_ON + #if GHOST_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + half4 ghostResult; + ghostResult.a = saturate(luminance - _GhostTransparency) * col.a; + ghostResult.rgb = col.rgb * (luminance + _GhostColorBoost); + col = lerp(col, ghostResult, _GhostBlend); + #endif + //------------------------------------ + + //INNEROUTLINE_ON + #if INNEROUTLINE_ON + half3 innerT = abs(GetPixel(0, _InnerOutlineThickness, d.texcoord0.xy, _MainTex, sampler_MainTex) - GetPixel(0, -_InnerOutlineThickness, d.texcoord0.xy, _MainTex, sampler_MainTex)); + innerT += abs(GetPixel(_InnerOutlineThickness, 0, d.texcoord0.xy, _MainTex, sampler_MainTex) - GetPixel(-_InnerOutlineThickness, 0, d.texcoord0.xy, _MainTex, sampler_MainTex)); + #if !ONLYINNEROUTLINE_ON + innerT = (innerT / 2.0) * col.a * _InnerOutlineAlpha; + col.rgb += length(innerT) * _InnerOutlineColor.rgb * _InnerOutlineGlow; + #else + innerT *= col.a * _InnerOutlineAlpha; + col.rgb = length(innerT) * _InnerOutlineColor.rgb * _InnerOutlineGlow; + col.a = step(0.3, col.r+col.g+col.b); + #endif + #endif + //------------------------------------------------------- + + //HITEFFECT_ON + #if HITEFFECT_ON + col.rgb = lerp(col.rgb, _HitEffectColor.rgb * _HitEffectGlow, _HitEffectBlend); + #endif + //-------------------- + + //GRADIENT_ON + #if GRADIENT_ON + half2 tiledUvGrad = half2(uvRect.x / _MainTex_ST.x, uvRect.y / _MainTex_ST.y); + #if GRADIENT2COL_ON + _GradTopRightCol = _GradTopLeftCol; + _GradBotRightCol = _GradBotLeftCol; + #endif + #if RADIALGRADIENT_ON + half radialDist = 1 - length(tiledUvGrad - half2(0.5, 0.5)); + radialDist *= (_MainTex_TexelSize.w / _MainTex_TexelSize.z); + radialDist = saturate(_GradBoostX * radialDist); + half4 gradientResult = lerp(_GradTopLeftCol, _GradBotLeftCol, radialDist); + #else + half gradXLerpFactor = saturate(pow(tiledUvGrad.x, _GradBoostX)); + half4 gradientResult = lerp(lerp(_GradBotLeftCol, _GradBotRightCol, gradXLerpFactor), + lerp(_GradTopLeftCol, _GradTopRightCol, gradXLerpFactor), saturate(pow(tiledUvGrad.y, _GradBoostY))); + #endif + gradientResult = lerp(col, gradientResult, _GradBlend); + col.rgb = gradientResult.rgb * col.a; + col.a *= gradientResult.a; + #endif + //-------------------------------------------------------------------- + + //CONTRAST_ON + #if CONTRAST_ON + col.rgb = (col.rgb - float3(0.5, 0.5, 0.5)) * _Contrast + float3(0.5, 0.5, 0.5); + col.rgb += _Brightness; + #endif + + //------------------------------------------------------------------- + + //COLORSWAP_ON + #if COLORSWAP_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + half4 swapMask = SAMPLE_TEXTURE2D(_ColorSwapTex, sampler_ColorSwapTex, d.texcoord0.xy); + swapMask.rgb *= swapMask.a; + half3 redSwap = _ColorSwapRed * swapMask.r * saturate(luminance + _ColorSwapRedLuminosity); + half3 greenSwap = _ColorSwapGreen * swapMask.g * saturate(luminance + _ColorSwapGreenLuminosity); + half3 blueSwap = _ColorSwapBlue * swapMask.b * saturate(luminance + _ColorSwapBlueLuminosity); + swapMask.rgb = col.rgb * saturate(1 - swapMask.r - swapMask.g - swapMask.b); + col.rgb = lerp(col.rgb, swapMask.rgb + redSwap + greenSwap + blueSwap, _ColorSwapBlend); + #endif + //-------------------------------------------------------------------- + + //COLORRAMP_ON && !COLORRAMPOUTLINE_ON + #if COLORRAMP_ON && !COLORRAMPOUTLINE_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + luminance = saturate(luminance + _ColorRampLuminosity); + #if GRADIENTCOLORRAMP_ON + col.rgb = lerp(col.rgb, SAMPLE_TEXTURE2D(_ColorRampTexGradient, sampler_ColorRampTexGradient, half2(luminance, 0)).rgb, _ColorRampBlend); + #else + col.rgb = lerp(col.rgb, SAMPLE_TEXTURE2D(_ColorRampTex, sampler_ColorRampTex, half2(luminance, 0)).rgb, _ColorRampBlend); + #endif + #endif + //-------------------------------------------------------------------- + + //CHANGECOLOR_ON + #if CHANGECOLOR_ON + float3 currChangeColor = saturate(col.rgb); + luminance = 0.3 * currChangeColor.r + 0.59 * currChangeColor.g + 0.11 * currChangeColor.b; + luminance = saturate(luminance + _ColorChangeLuminosity); + half3 dif = abs(currChangeColor - _ColorChangeTarget.rgb); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _ColorChangeNewCol.rgb, + max(sign(1 - saturate(dif.x + dif.y + dif.z) - _ColorChangeTolerance), 0.0)); + #if CHANGECOLOR2_ON + dif = abs(currChangeColor - _ColorChangeTarget2.rgb); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _ColorChangeNewCol2.rgb, + max(sign(1 - saturate(dif.x + dif.y + dif.z) - _ColorChangeTolerance2), 0.0)); + #endif + #if CHANGECOLOR3_ON + dif = abs(currChangeColor - _ColorChangeTarget3.rgb); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _ColorChangeNewCol3.rgb, + max(sign(1 - saturate(dif.x + dif.y + dif.z) - _ColorChangeTolerance3), 0.0)); + #endif + #endif + //------------------------------------------------------- + + //POSTERIZE_ON && !POSTERIZEOUTLINE_ON + #if POSTERIZE_ON && !POSTERIZEOUTLINE_ON + col.rgb = pow(col.rgb, _PosterizeGamma) * _PosterizeNumColors; + col.rgb = floor(col.rgb) / _PosterizeNumColors; + col.rgb = pow(col.rgb, 1.0 / _PosterizeGamma); + #endif + //------------------------------------ + + //HSV_ON + #if HSV_ON + half3 resultHsv = half3(col.rgb); + half cosHsv = _HsvBright * _HsvSaturation * cos(_HsvShift * 3.14159265 / 180); + half sinHsv = _HsvBright * _HsvSaturation * sin(_HsvShift * 3.14159265 / 180); + resultHsv.x = (.299 * _HsvBright + .701 * cosHsv + .168 * sinHsv) * col.x + + (.587 * _HsvBright - .587 * cosHsv + .330 * sinHsv) * col.y + + (.114 * _HsvBright - .114 * cosHsv - .497 * sinHsv) * col.z; + resultHsv.y = (.299 * _HsvBright - .299 * cosHsv - .328 * sinHsv) *col.x + + (.587 * _HsvBright + .413 * cosHsv + .035 * sinHsv) * col.y + + (.114 * _HsvBright - .114 * cosHsv + .292 * sinHsv) * col.z; + resultHsv.z = (.299 * _HsvBright - .3 * cosHsv + 1.25 * sinHsv) * col.x + + (.587 * _HsvBright - .588 * cosHsv - 1.05 * sinHsv) * col.y + + (.114 * _HsvBright + .886 * cosHsv - .203 * sinHsv) * col.z; + col.rgb = resultHsv; + #endif + //------------------------------------------------------- + + //OVERLAY_ON + #if OVERLAY_ON + half2 overlayUvs = d.texcoord0.xy; + overlayUvs.x += ((_Time.y + randomSeed) * _OverlayTextureScrollXSpeed) % 1; + overlayUvs.y += ((_Time.y + randomSeed) * _OverlayTextureScrollYSpeed) % 1; + half4 overlayCol = SAMPLE_TEXTURE2D(_OverlayTex, sampler_OverlayTex, TRANSFORM_TEX(overlayUvs, _OverlayTex)); + overlayCol.rgb *= _OverlayColor.rgb * _OverlayGlow; + #if !OVERLAYMULT_ON + overlayCol.rgb *= overlayCol.a * _OverlayColor.rgb * _OverlayColor.a * _OverlayBlend; + col.rgb += overlayCol.rgb; + #else + overlayCol.a *= _OverlayColor.a; + col = lerp(col, col * overlayCol, _OverlayBlend); + #endif + #endif + + //--------------------------------- + + //OUTBASE_ON + #if OUTBASE_ON + #if OUTBASEPIXELPERF_ON + half2 destUv = half2(_OutlinePixelWidth * _MainTex_TexelSize.x, _OutlinePixelWidth * _MainTex_TexelSize.y); + #else + half2 destUv = half2(_OutlineWidth * _MainTex_TexelSize.x * 200, _OutlineWidth * _MainTex_TexelSize.y * 200); + #endif + + #if OUTDIST_ON + d.texcoord3.x += ((_Time.x + _RandomSeed) * _OutlineDistortTexXSpeed) % 1; + d.texcoord3.y += ((_Time.x + _RandomSeed) * _OutlineDistortTexYSpeed) % 1; + #if ATLAS_ON + d.texcoord3 = half2((d.texcoord3.x - _MinXUV) / (_MaxXUV - _MinXUV), (d.texcoord3.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half outDistortAmnt = (SAMPLE_TEXTURE2D(_OutlineDistortTex, sampler_OutlineDistortTex, d.texcoord3).r - 0.5) * 0.2 * _OutlineDistortAmount; + destUv.x += outDistortAmnt; + destUv.y += outDistortAmnt; + #endif + + half spriteLeft = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(destUv.x, 0)).a; + half spriteRight = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy - half2(destUv.x, 0)).a; + half spriteBottom = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(0, destUv.y)).a; + half spriteTop = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy - half2(0, destUv.y)).a; + half result = spriteLeft + spriteRight + spriteBottom + spriteTop; + + #if OUTBASE8DIR_ON + half spriteTopLeft = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(destUv.x, destUv.y)).a; + half spriteTopRight = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(-destUv.x, destUv.y)).a; + half spriteBotLeft = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(destUv.x, -destUv.y)).a; + half spriteBotRight = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(-destUv.x, -destUv.y)).a; + result = result + spriteTopLeft + spriteTopRight + spriteBotLeft + spriteBotRight; + #endif + + result = step(0.05, saturate(result)); + + #if OUTTEX_ON + d.texcoord1.x += ((_Time.x + _RandomSeed) * _OutlineTexXSpeed) % 1; + d.texcoord1.y += ((_Time.x + _RandomSeed) * _OutlineTexYSpeed) % 1; + #if ATLAS_ON + d.texcoord1 = half2((d.texcoord1.x - _MinXUV) / (_MaxXUV - _MinXUV), (d.texcoord1.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half4 tempOutColor = SAMPLE_TEXTURE2D(_OutlineTex, sampler_OutlineTex, d.texcoord1); + tempOutColor *= _OutlineColor; + _OutlineColor = tempOutColor; + #endif + + result *= (1 - originalAlpha) * _OutlineAlpha; + + half4 outline = _OutlineColor * d.vertexColor.a; + outline.rgb *= _OutlineGlow; + outline.a = result; + #if ONLYOUTLINE_ON + col = outline; + #else + col = lerp(col, outline, result); + #endif + #endif + //------------------------------------------------------- + + //FADE_ON + #if FADE_ON + half2 tiledUvFade1 = TRANSFORM_TEX(d.texcoord0, _FadeTex); + half2 tiledUvFade2 = TRANSFORM_TEX(d.texcoord0, _FadeBurnTex); + #if ATLAS_ON + tiledUvFade1 = half2((tiledUvFade1.x - _MinXUV) / (_MaxXUV - _MinXUV), (tiledUvFade1.y - _MinYUV) / (_MaxYUV - _MinYUV)); + tiledUvFade2 = half2((tiledUvFade2.x - _MinXUV) / (_MaxXUV - _MinXUV), (tiledUvFade2.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half fadeTemp = SAMPLE_TEXTURE2D(_FadeTex, sampler_FadeTex, tiledUvFade1).r; + half fade = smoothstep(_FadeAmount, _FadeAmount + _FadeBurnTransition, fadeTemp); + half fadeBurn = saturate(smoothstep(_FadeAmount - _FadeBurnWidth, _FadeAmount - _FadeBurnWidth + 0.1, fadeTemp) * _FadeAmount); + col.a *= fade; + _FadeBurnColor.rgb *= _FadeBurnGlow; + col += fadeBurn * SAMPLE_TEXTURE2D(_FadeBurnTex, sampler_FadeBurnTex, tiledUvFade2) * _FadeBurnColor * originalAlpha * (1 - col.a); + #endif + //------------------------------------------------------- + + //SHADOW_ON + #if SHADOW_ON + half shadowA = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(_ShadowX, _ShadowY)).a; + half preMultShadowMask = 1 - (saturate(shadowA - col.a) * (1 - col.a)); + col.rgb *= 1 - ((shadowA - col.a) * (1 - col.a)); + col.rgb += (_ShadowColor * shadowA) * (1 - col.a); + col.a = max(shadowA * _ShadowAlpha * d.vertexColor.a, col.a); + #endif + + //------------------------------------------------------- + + //GLOW_ON + #if GLOW_ON + half4 emission; + #if GLOWTEX_ON + emission = SAMPLE_TEXTURE2D(_GlowTex, sampler_GlowTex, d.texcoord0); + #else + emission = col; + #endif + + col.rgb *= _GlowGlobal; + emission.rgb *= emission.a * col.a * _Glow * _GlowColor; + col.rgb += emission.rgb; + #endif + //------------------------------------------------------- + + //COLORRAMP_ON && COLORRAMPOUTLINE_ON + #if COLORRAMP_ON && COLORRAMPOUTLINE_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + luminance = saturate(luminance + _ColorRampLuminosity); + #if GRADIENTCOLORRAMP_ON + col.rgb = lerp(col.rgb, SAMPLE_TEXTURE2D(_ColorRampTexGradient, sampler_ColorRampTexGradient, half2(luminance, 0)).rgb, _ColorRampBlend); + #else + col.rgb = lerp(col.rgb, SAMPLE_TEXTURE2D(_ColorRampTex, sampler_ColorRampTex, half2(luminance, 0)).rgb, _ColorRampBlend); + #endif + #endif + //--------------- + + //GREYSCALE_ON && GREYSCALEOUTLINE_ON + #if GREYSCALE_ON && GREYSCALEOUTLINE_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + luminance = saturate(luminance + _GreyscaleLuminosity); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _GreyscaleTintColor, _GreyscaleBlend); + #endif + + //----------------------------------- + + //POSTERIZE_ON && POSTERIZEOUTLINE_ON + #if POSTERIZE_ON && POSTERIZEOUTLINE_ON + col.rgb = pow(col.rgb, _PosterizeGamma) * _PosterizeNumColors; + col.rgb = floor(col.rgb) / _PosterizeNumColors; + col.rgb = pow(col.rgb, 1.0 / _PosterizeGamma); + #endif + + //----------------------------------- + + //SHINE_ON + #if SHINE_ON + half2 uvShine = uvRect; + half cosAngle = cos(_ShineRotate); + half sinAngle = sin(_ShineRotate); + half2x2 rot = half2x2(cosAngle, -sinAngle, sinAngle, cosAngle); + uvShine -= half2(0.5, 0.5); + uvShine = mul(rot, uvShine); + uvShine += half2(0.5, 0.5); + half shineMask = SAMPLE_TEXTURE2D(_ShineMask, sampler_ShineMask, d.texcoord0.xy).a; + half currentDistanceProjection = (uvShine.x + uvShine.y) / 2; + half whitePower = 1 - (abs(currentDistanceProjection - _ShineLocation) / _ShineWidth); + col.rgb += col.a * whitePower * _ShineGlow * max(sign(currentDistanceProjection - (_ShineLocation - _ShineWidth)), 0.0) + * max(sign((_ShineLocation + _ShineWidth) - currentDistanceProjection), 0.0) * _ShineColor * shineMask; + #endif + + //----------------------------------- + + //HOLOGRAM_ON + #if HOLOGRAM_ON + half totalHologram = _HologramStripesAmount + _HologramUnmodAmount; + half hologramYCoord = ((uvRect.y + (((_Time.x + randomSeed) % 1) * _HologramStripesSpeed)) % totalHologram) / totalHologram; + hologramYCoord = abs(hologramYCoord); + half alpha = RemapFloat(saturate(hologramYCoord - (_HologramUnmodAmount/totalHologram)), 0.0, 1.0, _HologramMinAlpha, saturate(_HologramMaxAlpha)); + half hologramMask = max(sign((_HologramUnmodAmount/totalHologram) - hologramYCoord), 0.0); + half4 hologramResult = col; + hologramResult.a *= lerp(alpha, 1, hologramMask); + hologramResult.rgb *= max(1, _HologramMaxAlpha * max(sign(hologramYCoord - (_HologramUnmodAmount/totalHologram)), 0.0)); + hologramMask = 1 - step(0.01,hologramMask); + hologramResult.rgb += hologramMask * _HologramStripeColor * col.a; + col = lerp(col, hologramResult, _HologramBlend); + #endif + + //----------------------------------- + + //FLICKER_ON + #if FLICKER_ON + col.a *= saturate(col.a * step(frac(0.05 + (_Time.w + randomSeed) * _FlickerFreq), 1 - _FlickerPercent) + _FlickerAlpha); + #endif + //----------------------------------- + + //ALPHACUTOFF_ON + + //ALPHAROUND_ON + + //ALPHAOUTLINE_ON + #if ALPHAOUTLINE_ON + half alphaOutlineRes = pow(1 - col.a, max(_AlphaOutlinePower, 0.0001)) * step(_AlphaOutlineMinAlpha, col.a) * _AlphaOutlineBlend; + col.rgb = lerp(col.rgb, _AlphaOutlineColor.rgb * _AlphaOutlineGlow, alphaOutlineRes); + col.a = lerp(col.a, 1, alphaOutlineRes > 1); + #endif + //------------------------------------------------------- + + //FOG_ON + + //------------------ + + col *= _Color; + o.Albedo = col; + col.a *= _Alpha; + clip(col.a - _AlphaCutoffValue - 0.01); + o.Alpha = _Color.a; + } + + + + + + void ChainSurfaceFunction(inout Surface l, inout ShaderData d) + { + Ext_SurfaceFunction0(l, d); + // Ext_SurfaceFunction1(l, d); + // Ext_SurfaceFunction2(l, d); + // Ext_SurfaceFunction3(l, d); + // Ext_SurfaceFunction4(l, d); + // Ext_SurfaceFunction5(l, d); + // Ext_SurfaceFunction6(l, d); + // Ext_SurfaceFunction7(l, d); + // Ext_SurfaceFunction8(l, d); + // Ext_SurfaceFunction9(l, d); + // Ext_SurfaceFunction10(l, d); + // Ext_SurfaceFunction11(l, d); + // Ext_SurfaceFunction12(l, d); + // Ext_SurfaceFunction13(l, d); + // Ext_SurfaceFunction14(l, d); + // Ext_SurfaceFunction15(l, d); + // Ext_SurfaceFunction16(l, d); + // Ext_SurfaceFunction17(l, d); + // Ext_SurfaceFunction18(l, d); + // Ext_SurfaceFunction19(l, d); + // Ext_SurfaceFunction20(l, d); + // Ext_SurfaceFunction21(l, d); + // Ext_SurfaceFunction22(l, d); + // Ext_SurfaceFunction23(l, d); + // Ext_SurfaceFunction24(l, d); + // Ext_SurfaceFunction25(l, d); + // Ext_SurfaceFunction26(l, d); + // Ext_SurfaceFunction27(l, d); + // Ext_SurfaceFunction28(l, d); + // Ext_SurfaceFunction29(l, d); + } + +#if !_DECALSHADER + + void ChainModifyVertex(inout VertexData v, inout VertexToPixel v2p, float4 time) + { + ExtraV2F d; + + ZERO_INITIALIZE(ExtraV2F, d); + ZERO_INITIALIZE(Blackboard, d.blackboard); + // due to motion vectors in HDRP, we need to use the last + // time in certain spots. So if you are going to use _Time to adjust vertices, + // you need to use this time or motion vectors will break. + d.time = time; + + Ext_ModifyVertex0(v, d); + // Ext_ModifyVertex1(v, d); + // Ext_ModifyVertex2(v, d); + // Ext_ModifyVertex3(v, d); + // Ext_ModifyVertex4(v, d); + // Ext_ModifyVertex5(v, d); + // Ext_ModifyVertex6(v, d); + // Ext_ModifyVertex7(v, d); + // Ext_ModifyVertex8(v, d); + // Ext_ModifyVertex9(v, d); + // Ext_ModifyVertex10(v, d); + // Ext_ModifyVertex11(v, d); + // Ext_ModifyVertex12(v, d); + // Ext_ModifyVertex13(v, d); + // Ext_ModifyVertex14(v, d); + // Ext_ModifyVertex15(v, d); + // Ext_ModifyVertex16(v, d); + // Ext_ModifyVertex17(v, d); + // Ext_ModifyVertex18(v, d); + // Ext_ModifyVertex19(v, d); + // Ext_ModifyVertex20(v, d); + // Ext_ModifyVertex21(v, d); + // Ext_ModifyVertex22(v, d); + // Ext_ModifyVertex23(v, d); + // Ext_ModifyVertex24(v, d); + // Ext_ModifyVertex25(v, d); + // Ext_ModifyVertex26(v, d); + // Ext_ModifyVertex27(v, d); + // Ext_ModifyVertex28(v, d); + // Ext_ModifyVertex29(v, d); + + + // #if %EXTRAV2F0REQUIREKEY% + // v2p.extraV2F0 = d.extraV2F0; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // v2p.extraV2F1 = d.extraV2F1; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // v2p.extraV2F2 = d.extraV2F2; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // v2p.extraV2F3 = d.extraV2F3; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // v2p.extraV2F4 = d.extraV2F4; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // v2p.extraV2F5 = d.extraV2F5; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // v2p.extraV2F6 = d.extraV2F6; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // v2p.extraV2F7 = d.extraV2F7; + // #endif + } + + void ChainModifyTessellatedVertex(inout VertexData v, inout VertexToPixel v2p) + { + ExtraV2F d; + ZERO_INITIALIZE(ExtraV2F, d); + ZERO_INITIALIZE(Blackboard, d.blackboard); + + // #if %EXTRAV2F0REQUIREKEY% + // d.extraV2F0 = v2p.extraV2F0; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // d.extraV2F1 = v2p.extraV2F1; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // d.extraV2F2 = v2p.extraV2F2; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // d.extraV2F3 = v2p.extraV2F3; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // d.extraV2F4 = v2p.extraV2F4; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // d.extraV2F5 = v2p.extraV2F5; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // d.extraV2F6 = v2p.extraV2F6; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // d.extraV2F7 = v2p.extraV2F7; + // #endif + + + // Ext_ModifyTessellatedVertex0(v, d); + // Ext_ModifyTessellatedVertex1(v, d); + // Ext_ModifyTessellatedVertex2(v, d); + // Ext_ModifyTessellatedVertex3(v, d); + // Ext_ModifyTessellatedVertex4(v, d); + // Ext_ModifyTessellatedVertex5(v, d); + // Ext_ModifyTessellatedVertex6(v, d); + // Ext_ModifyTessellatedVertex7(v, d); + // Ext_ModifyTessellatedVertex8(v, d); + // Ext_ModifyTessellatedVertex9(v, d); + // Ext_ModifyTessellatedVertex10(v, d); + // Ext_ModifyTessellatedVertex11(v, d); + // Ext_ModifyTessellatedVertex12(v, d); + // Ext_ModifyTessellatedVertex13(v, d); + // Ext_ModifyTessellatedVertex14(v, d); + // Ext_ModifyTessellatedVertex15(v, d); + // Ext_ModifyTessellatedVertex16(v, d); + // Ext_ModifyTessellatedVertex17(v, d); + // Ext_ModifyTessellatedVertex18(v, d); + // Ext_ModifyTessellatedVertex19(v, d); + // Ext_ModifyTessellatedVertex20(v, d); + // Ext_ModifyTessellatedVertex21(v, d); + // Ext_ModifyTessellatedVertex22(v, d); + // Ext_ModifyTessellatedVertex23(v, d); + // Ext_ModifyTessellatedVertex24(v, d); + // Ext_ModifyTessellatedVertex25(v, d); + // Ext_ModifyTessellatedVertex26(v, d); + // Ext_ModifyTessellatedVertex27(v, d); + // Ext_ModifyTessellatedVertex28(v, d); + // Ext_ModifyTessellatedVertex29(v, d); + + // #if %EXTRAV2F0REQUIREKEY% + // v2p.extraV2F0 = d.extraV2F0; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // v2p.extraV2F1 = d.extraV2F1; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // v2p.extraV2F2 = d.extraV2F2; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // v2p.extraV2F3 = d.extraV2F3; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // v2p.extraV2F4 = d.extraV2F4; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // v2p.extraV2F5 = d.extraV2F5; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // v2p.extraV2F6 = d.extraV2F6; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // v2p.extraV2F7 = d.extraV2F7; + // #endif + } + + void ChainFinalColorForward(inout Surface l, inout ShaderData d, inout half4 color) + { + // Ext_FinalColorForward0(l, d, color); + // Ext_FinalColorForward1(l, d, color); + // Ext_FinalColorForward2(l, d, color); + // Ext_FinalColorForward3(l, d, color); + // Ext_FinalColorForward4(l, d, color); + // Ext_FinalColorForward5(l, d, color); + // Ext_FinalColorForward6(l, d, color); + // Ext_FinalColorForward7(l, d, color); + // Ext_FinalColorForward8(l, d, color); + // Ext_FinalColorForward9(l, d, color); + // Ext_FinalColorForward10(l, d, color); + // Ext_FinalColorForward11(l, d, color); + // Ext_FinalColorForward12(l, d, color); + // Ext_FinalColorForward13(l, d, color); + // Ext_FinalColorForward14(l, d, color); + // Ext_FinalColorForward15(l, d, color); + // Ext_FinalColorForward16(l, d, color); + // Ext_FinalColorForward17(l, d, color); + // Ext_FinalColorForward18(l, d, color); + // Ext_FinalColorForward19(l, d, color); + // Ext_FinalColorForward20(l, d, color); + // Ext_FinalColorForward21(l, d, color); + // Ext_FinalColorForward22(l, d, color); + // Ext_FinalColorForward23(l, d, color); + // Ext_FinalColorForward24(l, d, color); + // Ext_FinalColorForward25(l, d, color); + // Ext_FinalColorForward26(l, d, color); + // Ext_FinalColorForward27(l, d, color); + // Ext_FinalColorForward28(l, d, color); + // Ext_FinalColorForward29(l, d, color); + } + + void ChainFinalGBufferStandard(inout Surface s, inout ShaderData d, inout half4 GBuffer0, inout half4 GBuffer1, inout half4 GBuffer2, inout half4 outEmission, inout half4 outShadowMask) + { + // Ext_FinalGBufferStandard0(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard1(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard2(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard3(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard4(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard5(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard6(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard7(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard8(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard9(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard10(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard11(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard12(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard13(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard14(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard15(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard16(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard17(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard18(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard19(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard20(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard21(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard22(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard23(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard24(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard25(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard26(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard27(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard28(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard29(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + } +#endif + + + + + +#if _DECALSHADER + + ShaderData CreateShaderData(SurfaceDescriptionInputs IN) + { + ShaderData d = (ShaderData)0; + d.TBNMatrix = float3x3(IN.WorldSpaceTangent, IN.WorldSpaceBiTangent, IN.WorldSpaceNormal); + d.worldSpaceNormal = IN.WorldSpaceNormal; + d.worldSpaceTangent = IN.WorldSpaceTangent; + + d.worldSpacePosition = IN.WorldSpacePosition; + d.texcoord0 = IN.uv0.xyxy; + d.screenPos = IN.ScreenPosition; + + d.worldSpaceViewDir = normalize(_WorldSpaceCameraPos - d.worldSpacePosition); + + d.tangentSpaceViewDir = mul(d.TBNMatrix, d.worldSpaceViewDir); + + // these rarely get used, so we back transform them. Usually will be stripped. + #if _HDRP + // d.localSpacePosition = mul(GetWorldToObjectMatrix(), float4(GetCameraRelativePositionWS(d.worldSpacePosition), 1)).xyz; + #else + // d.localSpacePosition = mul(GetWorldToObjectMatrix(), float4(d.worldSpacePosition, 1)).xyz; + #endif + // d.localSpaceNormal = normalize(mul((float3x3)GetWorldToObjectMatrix(), d.worldSpaceNormal)); + // d.localSpaceTangent = normalize(mul((float3x3)GetWorldToObjectMatrix(), d.worldSpaceTangent.xyz)); + + // #if %SCREENPOSREQUIREKEY% + // d.screenUV = (IN.ScreenPosition.xy / max(0.01, IN.ScreenPosition.w)); + // #endif + + return d; + } +#else + + ShaderData CreateShaderData(VertexToPixel i + #if NEED_FACING + , bool facing + #endif + ) + { + ShaderData d = (ShaderData)0; + d.clipPos = i.pos; + d.worldSpacePosition = i.worldPos; + + d.worldSpaceNormal = normalize(i.worldNormal); + d.worldSpaceTangent.xyz = normalize(i.worldTangent.xyz); + + d.tangentSign = i.worldTangent.w * unity_WorldTransformParams.w; + float3 bitangent = cross(d.worldSpaceTangent.xyz, d.worldSpaceNormal) * d.tangentSign; + + d.TBNMatrix = float3x3(d.worldSpaceTangent, -bitangent, d.worldSpaceNormal); + d.worldSpaceViewDir = normalize(_WorldSpaceCameraPos - i.worldPos); + + d.tangentSpaceViewDir = mul(d.TBNMatrix, d.worldSpaceViewDir); + d.texcoord0 = i.texcoord0; + d.texcoord1 = i.texcoord1; + d.texcoord2 = i.texcoord2; + + // #if %TEXCOORD3REQUIREKEY% + d.texcoord3 = i.texcoord3; + // #endif + + // d.isFrontFace = facing; + // #if %VERTEXCOLORREQUIREKEY% + d.vertexColor = i.vertexColor; + // #endif + + // these rarely get used, so we back transform them. Usually will be stripped. + #if _HDRP + // d.localSpacePosition = mul(GetWorldToObjectMatrix(), float4(GetCameraRelativePositionWS(i.worldPos), 1)).xyz; + #else + // d.localSpacePosition = mul(GetWorldToObjectMatrix(), float4(i.worldPos, 1)).xyz; + #endif + // d.localSpaceNormal = normalize(mul((float3x3)GetWorldToObjectMatrix(), i.worldNormal)); + // d.localSpaceTangent = normalize(mul((float3x3)GetWorldToObjectMatrix(), i.worldTangent.xyz)); + + // #if %SCREENPOSREQUIREKEY% + // d.screenPos = i.screenPos; + // d.screenUV = (i.screenPos.xy / i.screenPos.w); + // #endif + + + // #if %EXTRAV2F0REQUIREKEY% + // d.extraV2F0 = i.extraV2F0; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // d.extraV2F1 = i.extraV2F1; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // d.extraV2F2 = i.extraV2F2; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // d.extraV2F3 = i.extraV2F3; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // d.extraV2F4 = i.extraV2F4; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // d.extraV2F5 = i.extraV2F5; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // d.extraV2F6 = i.extraV2F6; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // d.extraV2F7 = i.extraV2F7; + // #endif + + return d; + } + +#endif + + + #if defined(_PASSSHADOW) + float3 _LightDirection; + float3 _LightPosition; + #endif + + // vertex shader + VertexToPixel Vert (VertexData v) + { + + VertexToPixel o = (VertexToPixel)0; + + UNITY_SETUP_INSTANCE_ID(v); + UNITY_TRANSFER_INSTANCE_ID(v, o); + UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o); + + +#if !_TESSELLATION_ON + ChainModifyVertex(v, o, _Time); +#endif + + o.texcoord0 = v.texcoord0; + o.texcoord1 = v.texcoord1; + o.texcoord2 = v.texcoord2; + + // #if %TEXCOORD3REQUIREKEY% + o.texcoord3 = v.texcoord3; + // #endif + + // #if %VERTEXCOLORREQUIREKEY% + o.vertexColor = v.vertexColor; + // #endif + + VertexPositionInputs vertexInput = GetVertexPositionInputs(v.vertex.xyz); + o.worldPos = TransformObjectToWorld(v.vertex.xyz); + o.worldNormal = TransformObjectToWorldNormal(v.normal); + o.worldTangent = float4(TransformObjectToWorldDir(v.tangent.xyz), v.tangent.w); + + // For some very odd reason, in 2021.2, we can't use Unity's defines, but have to use our own.. + #if _PASSSHADOW + #if _CASTING_PUNCTUAL_LIGHT_SHADOW + float3 lightDirectionWS = normalize(_LightPosition - o.worldPos); + #else + float3 lightDirectionWS = _LightDirection; + #endif + // Define shadow pass specific clip position for Universal + o.pos = TransformWorldToHClip(ApplyShadowBias(o.worldPos, o.worldNormal, lightDirectionWS)); + #if UNITY_REVERSED_Z + o.pos.z = min(o.pos.z, UNITY_NEAR_CLIP_VALUE); + #else + o.pos.z = max(o.pos.z, UNITY_NEAR_CLIP_VALUE); + #endif + #elif _PASSMETA + o.pos = MetaVertexPosition(float4(v.vertex.xyz, 0), v.texcoord1.xy, v.texcoord2.xy, unity_LightmapST, unity_DynamicLightmapST); + #else + o.pos = TransformWorldToHClip(o.worldPos); + #endif + + // #if %SCREENPOSREQUIREKEY% + // o.screenPos = ComputeScreenPos(o.pos, _ProjectionParams.x); + // #endif + + #if _PASSFORWARD || _PASSGBUFFER + float2 uv1 = v.texcoord1.xy; + OUTPUT_LIGHTMAP_UV(uv1, unity_LightmapST, o.lightmapUV); + o.texcoord1.xy = uv1; + OUTPUT_SH(o.worldNormal, o.sh); + #if defined(DYNAMICLIGHTMAP_ON) + o.dynamicLightmapUV.xy = v.texcoord2.xy * unity_DynamicLightmapST.xy + unity_DynamicLightmapST.zw; + #endif + #endif + + #ifdef VARYINGS_NEED_FOG_AND_VERTEX_LIGHT + half fogFactor = 0; + #if defined(_FOG_FRAGMENT) + fogFactor = ComputeFogFactor(o.pos.z); + #endif + #if _BAKEDLIT + o.fogFactorAndVertexLight = half4(fogFactor, 0, 0, 0); + #else + half3 vertexLight = VertexLighting(o.worldPos, o.worldNormal); + o.fogFactorAndVertexLight = half4(fogFactor, vertexLight); + #endif + #endif + + #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR) + o.shadowCoord = GetShadowCoord(vertexInput); + #endif + + return o; + } + + + + + // fragment shader + half4 Frag (VertexToPixel IN + #ifdef _DEPTHOFFSET_ON + , out float outputDepth : SV_Depth + #endif + #if NEED_FACING + , bool facing : SV_IsFrontFace + #endif + ) : SV_Target + { + UNITY_SETUP_INSTANCE_ID(IN); + UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX(IN); + + ShaderData d = CreateShaderData(IN + #if NEED_FACING + , facing + #endif + ); + Surface l = (Surface)0; + + #ifdef _DEPTHOFFSET_ON + l.outputDepth = outputDepth; + #endif + + l.Albedo = half3(0.5, 0.5, 0.5); + l.Normal = float3(0,0,1); + l.Occlusion = 1; + l.Alpha = 1; + + ChainSurfaceFunction(l, d); + + #ifdef _DEPTHOFFSET_ON + outputDepth = l.outputDepth; + #endif + + return 0; + + } + + ENDHLSL + + } + + + + Pass + { + Name "Meta" + Tags + { + "LightMode" = "Meta" + } + + Cull Off + + + Tags { "RenderType" = "Opaque" "Queue" = "Geometry" "PreviewType" = "Plane" } + Cull [_CullingOption] + ZWrite [_ZWrite] + ZTest [_ZTestMode] + + + HLSLPROGRAM + + #pragma vertex Vert + #pragma fragment Frag + + #pragma target 3.0 + + #pragma prefer_hlslcc gles + #pragma exclude_renderers d3d11_9x + + #define SHADERPASS SHADERPASS_META + #define _PASSMETA 1 + + + + #pragma shader_feature_local GLOW_ON + #pragma shader_feature_local FADE_ON + #pragma shader_feature_local OUTBASE_ON + #pragma shader_feature_local ONLYOUTLINE_ON + #pragma shader_feature_local GRADIENT_ON + #pragma shader_feature_local GRADIENT2COL_ON + #pragma shader_feature_local RADIALGRADIENT_ON + #pragma shader_feature_local COLORSWAP_ON + #pragma shader_feature_local HSV_ON + #pragma shader_feature_local CHANGECOLOR_ON + #pragma shader_feature_local CHANGECOLOR2_ON + #pragma shader_feature_local CHANGECOLOR3_ON + #pragma shader_feature_local COLORRAMP_ON + #pragma shader_feature_local GRADIENTCOLORRAMP_ON + #pragma shader_feature_local HITEFFECT_ON + #pragma shader_feature_local NEGATIVE_ON + #pragma shader_feature_local PIXELATE_ON + #pragma shader_feature_local GREYSCALE_ON + #pragma shader_feature_local POSTERIZE_ON + #pragma shader_feature_local BLUR_ON + #pragma shader_feature_local MOTIONBLUR_ON + #pragma shader_feature_local GHOST_ON + #pragma shader_feature_local ALPHAOUTLINE_ON + #pragma shader_feature_local INNEROUTLINE_ON + #pragma shader_feature_local ONLYINNEROUTLINE_ON + #pragma shader_feature_local HOLOGRAM_ON + #pragma shader_feature_local CHROMABERR_ON + #pragma shader_feature_local GLITCH_ON + #pragma shader_feature_local FLICKER_ON + #pragma shader_feature_local SHADOW_ON + #pragma shader_feature_local SHINE_ON + #pragma shader_feature_local CONTRAST_ON + #pragma shader_feature_local OVERLAY_ON + #pragma shader_feature_local OVERLAYMULT_ON + #pragma shader_feature_local DOODLE_ON + #pragma shader_feature_local WIND_ON + #pragma shader_feature_local WAVEUV_ON + #pragma shader_feature_local ROUNDWAVEUV_ON + #pragma shader_feature_local RECTSIZE_ON + #pragma shader_feature_local OFFSETUV_ON + #pragma shader_feature_local CLIPPING_ON + #pragma shader_feature_local RADIALCLIPPING_ON + #pragma shader_feature_local TEXTURESCROLL_ON + #pragma shader_feature_local ZOOMUV_ON + #pragma shader_feature_local DISTORT_ON + #pragma shader_feature_local WARP_ON + #pragma shader_feature_local TWISTUV_ON + #pragma shader_feature_local ROTATEUV_ON + #pragma shader_feature_local POLARUV_ON + #pragma shader_feature_local FISHEYE_ON + #pragma shader_feature_local PINCH_ON + #pragma shader_feature_local SHAKEUV_ON + + #pragma shader_feature_local GLOWTEX_ON + #pragma shader_feature_local OUTTEX_ON + #pragma shader_feature_local OUTDIST_ON + #pragma shader_feature_local OUTBASE8DIR_ON + #pragma shader_feature_local OUTBASEPIXELPERF_ON + #pragma shader_feature_local COLORRAMPOUTLINE_ON + #pragma shader_feature_local GREYSCALEOUTLINE_ON + #pragma shader_feature_local POSTERIZEOUTLINE_ON + #pragma shader_feature_local BLURISHD_ON + #pragma shader_feature_local MANUALWIND_ON + #pragma shader_feature_local ATLAS_ON + #pragma shader_feature_local PREMULTIPLYALPHA_ON + + #pragma shader_feature BILBOARD_ON + #pragma shader_feature BILBOARDY_ON + + #pragma shader_feature NORMALMAP_ON + + + #define _URP 1 +#define _USINGTEXCOORD1 1 +#define _USINGTEXCOORD2 1 + + + + // Includes + #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Version.hlsl" + #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Color.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.universal/ShaderLibrary/ShaderGraphFunctions.hlsl" + #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/MetaInput.hlsl" + #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/TextureStack.hlsl" + #include "Packages/com.unity.shadergraph/ShaderGraphLibrary/ShaderVariablesFunctions.hlsl" + #include "Packages/com.unity.render-pipelines.universal/Editor/ShaderGraph/Includes/ShaderPass.hlsl" + + #undef WorldNormalVector + #define WorldNormalVector(data, normal) mul(normal, data.TBNMatrix) + + #define UnityObjectToWorldNormal(normal) mul(GetObjectToWorldMatrix(), normal) + + #define _WorldSpaceLightPos0 _MainLightPosition + + #define UNITY_DECLARE_TEX2D(name) TEXTURE2D(name); SAMPLER(sampler##name); + #define UNITY_DECLARE_TEX2D_NOSAMPLER(name) TEXTURE2D(name); + #define UNITY_DECLARE_TEX2DARRAY(name) TEXTURE2D_ARRAY(name); SAMPLER(sampler##name); + #define UNITY_DECLARE_TEX2DARRAY_NOSAMPLER(name) TEXTURE2D_ARRAY(name); + + #define UNITY_SAMPLE_TEX2DARRAY(tex,coord) SAMPLE_TEXTURE2D_ARRAY(tex, sampler##tex, coord.xy, coord.z) + #define UNITY_SAMPLE_TEX2DARRAY_LOD(tex,coord,lod) SAMPLE_TEXTURE2D_ARRAY_LOD(tex, sampler##tex, coord.xy, coord.z, lod) + #define UNITY_SAMPLE_TEX2D(tex, coord) SAMPLE_TEXTURE2D(tex, sampler##tex, coord) + #define UNITY_SAMPLE_TEX2D_SAMPLER(tex, samp, coord) SAMPLE_TEXTURE2D(tex, sampler##samp, coord) + + #define UNITY_SAMPLE_TEX2D_LOD(tex,coord, lod) SAMPLE_TEXTURE2D_LOD(tex, sampler_##tex, coord, lod) + #define UNITY_SAMPLE_TEX2D_SAMPLER_LOD(tex,samplertex,coord, lod) SAMPLE_TEXTURE2D_LOD (tex, sampler##samplertex,coord, lod) + + #if defined(UNITY_COMPILER_HLSL) + #define UNITY_INITIALIZE_OUTPUT(type,name) name = (type)0; + #else + #define UNITY_INITIALIZE_OUTPUT(type,name) + #endif + + #define sampler2D_float sampler2D + #define sampler2D_half sampler2D + + + + // data across stages, stripped like the above. + struct VertexToPixel + { + float4 pos : SV_POSITION; + float3 worldPos : TEXCOORD0; + float3 worldNormal : TEXCOORD1; + float4 worldTangent : TEXCOORD2; + float4 texcoord0 : TEXCOORD3; + float4 texcoord1 : TEXCOORD4; + float4 texcoord2 : TEXCOORD5; + + // #if %TEXCOORD3REQUIREKEY% + float4 texcoord3 : TEXCOORD6; + // #endif + + // #if %SCREENPOSREQUIREKEY% + // float4 screenPos : TEXCOORD7; + // #endif + + // #if %VERTEXCOLORREQUIREKEY% + half4 vertexColor : COLOR; + // #endif + + #if defined(LIGHTMAP_ON) + float2 lightmapUV : TEXCOORD8; + #endif + #if defined(DYNAMICLIGHTMAP_ON) + float2 dynamicLightmapUV : TEXCOORD9; + #endif + #if !defined(LIGHTMAP_ON) + float3 sh : TEXCOORD10; + #endif + + #if defined(VARYINGS_NEED_FOG_AND_VERTEX_LIGHT) + float4 fogFactorAndVertexLight : TEXCOORD11; + #endif + + #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR) + float4 shadowCoord : TEXCOORD12; + #endif + + // #if %EXTRAV2F0REQUIREKEY% + // float4 extraV2F0 : TEXCOORD13; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // float4 extraV2F1 : TEXCOORD14; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // float4 extraV2F2 : TEXCOORD15; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // float4 extraV2F3 : TEXCOORD16; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // float4 extraV2F4 : TEXCOORD17; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // float4 extraV2F5 : TEXCOORD18; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // float4 extraV2F6 : TEXCOORD19; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // float4 extraV2F7 : TEXCOORD20; + // #endif + + #if UNITY_ANY_INSTANCING_ENABLED + uint instanceID : CUSTOM_INSTANCE_ID; + #endif + #if (defined(UNITY_STEREO_MULTIVIEW_ENABLED)) || (defined(UNITY_STEREO_INSTANCING_ENABLED) && (defined(SHADER_API_GLES3) || defined(SHADER_API_GLCORE))) + uint stereoTargetEyeIndexAsBlendIdx0 : BLENDINDICES0; + #endif + #if (defined(UNITY_STEREO_INSTANCING_ENABLED)) + uint stereoTargetEyeIndexAsRTArrayIdx : SV_RenderTargetArrayIndex; + #endif + #if defined(SHADER_STAGE_FRAGMENT) && defined(VARYINGS_NEED_CULLFACE) + FRONT_FACE_TYPE cullFace : FRONT_FACE_SEMANTIC; + #endif + + + }; + + + + + // data describing the user output of a pixel + struct Surface + { + half3 Albedo; + half Height; + half3 Normal; + half Smoothness; + half3 Emission; + half Metallic; + half3 Specular; + half Occlusion; + half SpecularPower; // for simple lighting + half Alpha; + float outputDepth; // if written, SV_Depth semantic is used. ShaderData.clipPos.z is unused value + // HDRP Only + half SpecularOcclusion; + half SubsurfaceMask; + half Thickness; + half CoatMask; + half CoatSmoothness; + half Anisotropy; + half IridescenceMask; + half IridescenceThickness; + int DiffusionProfileHash; + float SpecularAAThreshold; + float SpecularAAScreenSpaceVariance; + // requires _OVERRIDE_BAKEDGI to be defined, but is mapped in all pipelines + float3 DiffuseGI; + float3 BackDiffuseGI; + float3 SpecularGI; + float ior; + float3 transmittanceColor; + float atDistance; + float transmittanceMask; + // requires _OVERRIDE_SHADOWMASK to be defines + float4 ShadowMask; + + // for decals + float NormalAlpha; + float MAOSAlpha; + + + }; + + // Data the user declares in blackboard blocks + struct Blackboard + { + + float blackboardDummyData; + }; + + // data the user might need, this will grow to be big. But easy to strip + struct ShaderData + { + float4 clipPos; // SV_POSITION + float3 localSpacePosition; + float3 localSpaceNormal; + float3 localSpaceTangent; + + float3 worldSpacePosition; + float3 worldSpaceNormal; + float3 worldSpaceTangent; + float tangentSign; + + float3 worldSpaceViewDir; + float3 tangentSpaceViewDir; + + float4 texcoord0; + float4 texcoord1; + float4 texcoord2; + float4 texcoord3; + + float2 screenUV; + float4 screenPos; + + float4 vertexColor; + bool isFrontFace; + + float4 extraV2F0; + float4 extraV2F1; + float4 extraV2F2; + float4 extraV2F3; + float4 extraV2F4; + float4 extraV2F5; + float4 extraV2F6; + float4 extraV2F7; + + float3x3 TBNMatrix; + Blackboard blackboard; + }; + + struct VertexData + { + #if SHADER_TARGET > 30 + // uint vertexID : SV_VertexID; + #endif + float4 vertex : POSITION; + float3 normal : NORMAL; + float4 tangent : TANGENT; + float4 texcoord0 : TEXCOORD0; + + // optimize out mesh coords when not in use by user or lighting system + #if _URP && (_USINGTEXCOORD1 || _PASSMETA || _PASSFORWARD || _PASSGBUFFER) + float4 texcoord1 : TEXCOORD1; + #endif + + #if _URP && (_USINGTEXCOORD2 || _PASSMETA || ((_PASSFORWARD || _PASSGBUFFER) && defined(DYNAMICLIGHTMAP_ON))) + float4 texcoord2 : TEXCOORD2; + #endif + + #if _STANDARD && (_USINGTEXCOORD1 || (_PASSMETA || ((_PASSFORWARD || _PASSGBUFFER || _PASSFORWARDADD) && LIGHTMAP_ON))) + float4 texcoord1 : TEXCOORD1; + #endif + #if _STANDARD && (_USINGTEXCOORD2 || (_PASSMETA || ((_PASSFORWARD || _PASSGBUFFER) && DYNAMICLIGHTMAP_ON))) + float4 texcoord2 : TEXCOORD2; + #endif + + + #if _HDRP + float4 texcoord1 : TEXCOORD1; + float4 texcoord2 : TEXCOORD2; + #endif + + // #if %TEXCOORD3REQUIREKEY% + float4 texcoord3 : TEXCOORD3; + // #endif + + // #if %VERTEXCOLORREQUIREKEY% + float4 vertexColor : COLOR; + // #endif + + #if _PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR)) + float3 previousPositionOS : TEXCOORD4; // Contain previous transform position (in case of skinning for example) + #if defined (_ADD_PRECOMPUTED_VELOCITY) + float3 precomputedVelocity : TEXCOORD5; // Add Precomputed Velocity (Alembic computes velocities on runtime side). + #endif + #endif + + UNITY_VERTEX_INPUT_INSTANCE_ID + }; + + struct TessVertex + { + float4 vertex : INTERNALTESSPOS; + float3 normal : NORMAL; + float4 tangent : TANGENT; + float4 texcoord0 : TEXCOORD0; + float4 texcoord1 : TEXCOORD1; + float4 texcoord2 : TEXCOORD2; + + // #if %TEXCOORD3REQUIREKEY% + float4 texcoord3 : TEXCOORD3; + // #endif + + // #if %VERTEXCOLORREQUIREKEY% + float4 vertexColor : COLOR; + // #endif + + // #if %EXTRAV2F0REQUIREKEY% + // float4 extraV2F0 : TEXCOORD5; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // float4 extraV2F1 : TEXCOORD6; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // float4 extraV2F2 : TEXCOORD7; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // float4 extraV2F3 : TEXCOORD8; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // float4 extraV2F4 : TEXCOORD9; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // float4 extraV2F5 : TEXCOORD10; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // float4 extraV2F6 : TEXCOORD11; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // float4 extraV2F7 : TEXCOORD12; + // #endif + + #if _PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR)) + float3 previousPositionOS : TEXCOORD13; // Contain previous transform position (in case of skinning for example) + #if defined (_ADD_PRECOMPUTED_VELOCITY) + float3 precomputedVelocity : TEXCOORD14; + #endif + #endif + + UNITY_VERTEX_INPUT_INSTANCE_ID + UNITY_VERTEX_OUTPUT_STEREO + }; + + struct ExtraV2F + { + float4 extraV2F0; + float4 extraV2F1; + float4 extraV2F2; + float4 extraV2F3; + float4 extraV2F4; + float4 extraV2F5; + float4 extraV2F6; + float4 extraV2F7; + Blackboard blackboard; + float4 time; + }; + + + float3 WorldToTangentSpace(ShaderData d, float3 normal) + { + return mul(d.TBNMatrix, normal); + } + + float3 TangentToWorldSpace(ShaderData d, float3 normal) + { + return mul(normal, d.TBNMatrix); + } + + // in this case, make standard more like SRPs, because we can't fix + // unity_WorldToObject in HDRP, since it already does macro-fu there + + #if _STANDARD + float3 TransformWorldToObject(float3 p) { return mul(unity_WorldToObject, float4(p, 1)); }; + float3 TransformObjectToWorld(float3 p) { return mul(unity_ObjectToWorld, float4(p, 1)); }; + float4 TransformWorldToObject(float4 p) { return mul(unity_WorldToObject, p); }; + float4 TransformObjectToWorld(float4 p) { return mul(unity_ObjectToWorld, p); }; + float4x4 GetWorldToObjectMatrix() { return unity_WorldToObject; } + float4x4 GetObjectToWorldMatrix() { return unity_ObjectToWorld; } + #if (defined(SHADER_API_D3D11) || defined(SHADER_API_XBOXONE) || defined(UNITY_COMPILER_HLSLCC) || defined(SHADER_API_PSSL) || (SHADER_TARGET_SURFACE_ANALYSIS && !SHADER_TARGET_SURFACE_ANALYSIS_MOJOSHADER)) + #define UNITY_SAMPLE_TEX2D_LOD(tex,coord, lod) tex.SampleLevel (sampler##tex,coord, lod) + #define UNITY_SAMPLE_TEX2D_SAMPLER_LOD(tex,samplertex,coord, lod) tex.SampleLevel (sampler##samplertex,coord, lod) + #else + #define UNITY_SAMPLE_TEX2D_LOD(tex,coord,lod) tex2D (tex,coord,0,lod) + #define UNITY_SAMPLE_TEX2D_SAMPLER_LOD(tex,samplertex,coord,lod) tex2D (tex,coord,0,lod) + #endif + + #undef GetWorldToObjectMatrix() + + #define GetWorldToObjectMatrix() unity_WorldToObject + + + #endif + + float3 GetCameraWorldPosition() + { + #if _HDRP + return GetCameraRelativePositionWS(_WorldSpaceCameraPos); + #else + return _WorldSpaceCameraPos; + #endif + } + + #if _GRABPASSUSED + #if _STANDARD + TEXTURE2D(%GRABTEXTURE%); + SAMPLER(sampler_%GRABTEXTURE%); + #endif + + half3 GetSceneColor(float2 uv) + { + #if _STANDARD + return SAMPLE_TEXTURE2D(%GRABTEXTURE%, sampler_%GRABTEXTURE%, uv).rgb; + #else + return SHADERGRAPH_SAMPLE_SCENE_COLOR(uv); + #endif + } + #endif + + + + #if _STANDARD + UNITY_DECLARE_DEPTH_TEXTURE(_CameraDepthTexture); + float GetSceneDepth(float2 uv) { return SAMPLE_DEPTH_TEXTURE(_CameraDepthTexture, uv); } + float GetLinear01Depth(float2 uv) { return Linear01Depth(GetSceneDepth(uv)); } + float GetLinearEyeDepth(float2 uv) { return LinearEyeDepth(GetSceneDepth(uv)); } + #else + float GetSceneDepth(float2 uv) { return SHADERGRAPH_SAMPLE_SCENE_DEPTH(uv); } + float GetLinear01Depth(float2 uv) { return Linear01Depth(GetSceneDepth(uv), _ZBufferParams); } + float GetLinearEyeDepth(float2 uv) { return LinearEyeDepth(GetSceneDepth(uv), _ZBufferParams); } + #endif + + float3 GetWorldPositionFromDepthBuffer(float2 uv, float3 worldSpaceViewDir) + { + float eye = GetLinearEyeDepth(uv); + float3 camView = mul((float3x3)GetObjectToWorldMatrix(), transpose(mul(GetWorldToObjectMatrix(), UNITY_MATRIX_I_V)) [2].xyz); + + float dt = dot(worldSpaceViewDir, camView); + float3 div = worldSpaceViewDir/dt; + float3 wpos = (eye * div) + GetCameraWorldPosition(); + return wpos; + } + + #if _HDRP + float3 ObjectToWorldSpacePosition(float3 pos) + { + return GetAbsolutePositionWS(TransformObjectToWorld(pos)); + } + #else + float3 ObjectToWorldSpacePosition(float3 pos) + { + return TransformObjectToWorld(pos); + } + #endif + + #if _STANDARD + UNITY_DECLARE_SCREENSPACE_TEXTURE(_CameraDepthNormalsTexture); + float3 GetSceneNormal(float2 uv, float3 worldSpaceViewDir) + { + float4 depthNorms = UNITY_SAMPLE_SCREENSPACE_TEXTURE(_CameraDepthNormalsTexture, uv); + float3 norms = DecodeViewNormalStereo(depthNorms); + norms = mul((float3x3)GetWorldToViewMatrix(), norms) * 0.5 + 0.5; + return norms; + } + #elif _HDRP && !_DECALSHADER + + float3 GetSceneNormal(float2 uv, float3 worldSpaceViewDir) + { + NormalData nd; + DecodeFromNormalBuffer(_ScreenSize.xy * uv, nd); + return nd.normalWS; + } + #elif _URP + #if (SHADER_LIBRARY_VERSION_MAJOR >= 10) + #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/DeclareNormalsTexture.hlsl" + #endif + + float3 GetSceneNormal(float2 uv, float3 worldSpaceViewDir) + { + #if (SHADER_LIBRARY_VERSION_MAJOR >= 10) + return SampleSceneNormals(uv); + #else + float3 wpos = GetWorldPositionFromDepthBuffer(uv, worldSpaceViewDir); + return normalize(-cross(ddx(wpos), ddy(wpos))) * 0.5 + 0.5; + #endif + + } + #endif + + #if _HDRP + + half3 UnpackNormalmapRGorAG(half4 packednormal) + { + // This do the trick + packednormal.x *= packednormal.w; + + half3 normal; + normal.xy = packednormal.xy * 2 - 1; + normal.z = sqrt(1 - saturate(dot(normal.xy, normal.xy))); + return normal; + } + half3 UnpackNormal(half4 packednormal) + { + #if defined(UNITY_NO_DXT5nm) + return packednormal.xyz * 2 - 1; + #else + return UnpackNormalmapRGorAG(packednormal); + #endif + } + #endif + #if _HDRP || _URP + + half3 UnpackScaleNormal(half4 packednormal, half scale) + { + #ifndef UNITY_NO_DXT5nm + // Unpack normal as DXT5nm (1, y, 1, x) or BC5 (x, y, 0, 1) + // Note neutral texture like "bump" is (0, 0, 1, 1) to work with both plain RGB normal and DXT5nm/BC5 + packednormal.x *= packednormal.w; + #endif + half3 normal; + normal.xy = (packednormal.xy * 2 - 1) * scale; + normal.z = sqrt(1 - saturate(dot(normal.xy, normal.xy))); + return normal; + } + + #endif + + + void GetSun(out float3 lightDir, out float3 color) + { + lightDir = float3(0.5, 0.5, 0); + color = 1; + #if _HDRP + if (_DirectionalLightCount > 0) + { + DirectionalLightData light = _DirectionalLightDatas[0]; + lightDir = -light.forward.xyz; + color = light.color; + } + #elif _STANDARD + lightDir = normalize(_WorldSpaceLightPos0.xyz); + color = _LightColor0.rgb; + #elif _URP + Light light = GetMainLight(); + lightDir = light.direction; + color = light.color; + #endif + } + + + + CBUFFER_START(UnityPerMaterial) + + + half4 _Color; + half4 _MainTex_ST, _MainTex_TexelSize; + half _Alpha, _AlphaCutoffValue; + + #if ATLAS_ON + half _MinXUV, _MaxXUV, _MinYUV, _MaxYUV; + #endif + + #if GLOW_ON + half4 _GlowColor; + half _Glow, _GlowGlobal; + #endif + + #if HSV_ON + half _HsvShift, _HsvSaturation, _HsvBright; + #endif + + #if DISTORT_ON + half4 _DistortTex_ST; + half _DistortTexXSpeed, _DistortTexYSpeed, _DistortAmount; + #endif + + #if FADE_ON + half4 _FadeBurnColor, _FadeTex_ST, _FadeBurnTex_ST; + half _FadeAmount, _FadeBurnWidth, _FadeBurnTransition,_FadeBurnGlow; + #endif + + #if OUTBASE_ON + half4 _OutlineColor; + half _OutlineAlpha, _OutlineGlow, _OutlineWidth; + int _OutlinePixelWidth; + #endif + + #if OUTTEX_ON + half4 _OutlineTex_ST; + half _OutlineTexXSpeed, _OutlineTexYSpeed; + #endif + + #if OUTDIST_ON + half4 _OutlineDistortTex_ST; + half _OutlineDistortTexXSpeed, _OutlineDistortTexYSpeed, _OutlineDistortAmount; + #endif + + #if ALPHAOUTLINE_ON + half _AlphaOutlineGlow, _AlphaOutlinePower, _AlphaOutlineMinAlpha, _AlphaOutlineBlend; + half4 _AlphaOutlineColor; + #endif + + #if INNEROUTLINE_ON + half _InnerOutlineThickness, _InnerOutlineAlpha, _InnerOutlineGlow; + half4 _InnerOutlineColor; + #endif + + #if GRADIENT_ON + half _GradBlend, _GradBoostX, _GradBoostY; + half4 _GradTopRightCol, _GradTopLeftCol, _GradBotRightCol, _GradBotLeftCol; + #endif + + #if COLORSWAP_ON + half4 _ColorSwapRed, _ColorSwapGreen, _ColorSwapBlue; + half _ColorSwapRedLuminosity, _ColorSwapGreenLuminosity, _ColorSwapBlueLuminosity, _ColorSwapBlend; + #endif + + #if CHANGECOLOR_ON + half4 _ColorChangeNewCol, _ColorChangeTarget; + half _ColorChangeTolerance, _ColorChangeLuminosity; + #endif + #if CHANGECOLOR2_ON + half4 _ColorChangeNewCol2, _ColorChangeTarget2; + half _ColorChangeTolerance2; + #endif + #if CHANGECOLOR3_ON + half4 _ColorChangeNewCol3, _ColorChangeTarget3; + half _ColorChangeTolerance3; + #endif + + #if COLORRAMP_ON + half _ColorRampLuminosity, _ColorRampBlend; + #endif + + #if HITEFFECT_ON + half4 _HitEffectColor; + half _HitEffectGlow, _HitEffectBlend; + #endif + + #if NEGATIVE_ON + half _NegativeAmount; + #endif + + #if PIXELATE_ON + half _PixelateSize; + #endif + + #if GREYSCALE_ON + half _GreyscaleLuminosity, _GreyscaleBlend; + half4 _GreyscaleTintColor; + #endif + + #if POSTERIZE_ON + half _PosterizeNumColors, _PosterizeGamma; + #endif + + #if BLUR_ON + half _BlurIntensity; + #endif + + #if MOTIONBLUR_ON + half _MotionBlurAngle, _MotionBlurDist; + #endif + + #if GHOST_ON + half _GhostColorBoost, _GhostTransparency, _GhostBlend; + #endif + + #if HOLOGRAM_ON + half _HologramStripesAmount, _HologramMinAlpha, _HologramUnmodAmount, _HologramStripesSpeed, _HologramMaxAlpha, _HologramBlend; + half4 _HologramStripeColor; + #endif + + #if CHROMABERR_ON + half _ChromAberrAmount, _ChromAberrAlpha; + #endif + + #if GLITCH_ON + half _GlitchAmount, _GlitchSize; + #endif + + #if FLICKER_ON + half _FlickerFreq, _FlickerPercent, _FlickerAlpha; + #endif + + #if SHADOW_ON + half _ShadowX, _ShadowY, _ShadowAlpha; + half4 _ShadowColor; + #endif + + #if SHINE_ON + half4 _ShineColor; + half _ShineLocation, _ShineRotate, _ShineWidth, _ShineGlow; + #endif + + #if CONTRAST_ON + half _Contrast, _Brightness; + #endif + + #if OVERLAY_ON + half4 _OverlayTex_ST, _OverlayColor; + half _OverlayGlow, _OverlayBlend, _OverlayTextureScrollXSpeed, _OverlayTextureScrollYSpeed; + #endif + + #if DOODLE_ON + half _HandDrawnAmount, _HandDrawnSpeed; + #endif + + #if WIND_ON + half _GrassSpeed, _GrassWind, _GrassManualAnim, _GrassRadialBend; + #endif + + #if WAVEUV_ON + float _WaveAmount, _WaveSpeed, _WaveStrength, _WaveX, _WaveY; + #endif + + #if ROUNDWAVEUV_ON + half _RoundWaveStrength, _RoundWaveSpeed; + #endif + + #if RECTSIZE_ON + half _RectSize; + #endif + + #if OFFSETUV_ON + half _OffsetUvX, _OffsetUvY; + #endif + + #if CLIPPING_ON + half _ClipUvLeft, _ClipUvRight, _ClipUvUp, _ClipUvDown; + #endif + + #if RADIALCLIPPING_ON + half _RadialStartAngle, _RadialClip, _RadialClip2; + #endif + + #if TEXTURESCROLL_ON + half _TextureScrollXSpeed, _TextureScrollYSpeed; + #endif + + #if ZOOMUV_ON + half _ZoomUvAmount; + #endif + + #if WARP_ON + half _WarpStrength, _WarpSpeed, _WarpScale; + #endif + + #if TWISTUV_ON + half _TwistUvAmount, _TwistUvPosX, _TwistUvPosY, _TwistUvRadius; + #endif + + #if ROTATEUV_ON + half _RotateUvAmount; + #endif + + #if FISHEYE_ON + half _FishEyeUvAmount; + #endif + + #if PINCH_ON + half _PinchUvAmount; + #endif + + #if SHAKEUV_ON + half _ShakeUvSpeed, _ShakeUvX, _ShakeUvY; + #endif + + #if NORMALMAP_ON + half _NormalStrength; + #endif + + float _RandomSeed; + + + + + CBUFFER_END + + + + + + + + TEXTURE2D(_MainTex); + SAMPLER(sampler_MainTex); + + #if GLOW_ON + TEXTURE2D(_GlowTex); + SAMPLER(sampler_GlowTex); + #endif + + #if FADE_ON + TEXTURE2D(_FadeTex); + SAMPLER(sampler_FadeTex); + + TEXTURE2D(_FadeBurnTex); + SAMPLER(sampler_FadeBurnTex); + #endif + + #if DISTORT_ON + TEXTURE2D(_DistortTex); + SAMPLER(sampler_DistortTex); + #endif + + #if OUTTEX_ON + TEXTURE2D(_OutlineTex); + SAMPLER(sampler_OutlineTex); + #endif + + #if OUTDIST_ON + TEXTURE2D(_OutlineDistortTex); + SAMPLER(sampler_OutlineDistortTex); + #endif + + #if COLORSWAP_ON + TEXTURE2D(_ColorSwapTex); + SAMPLER(sampler_ColorSwapTex); + #endif + + #if COLORRAMP_ON + TEXTURE2D(_ColorRampTex); + TEXTURE2D(_ColorRampTexGradient); + SAMPLER(sampler_ColorRampTex); + SAMPLER(sampler_ColorRampTexGradient); + #endif + + #if SHINE_ON + TEXTURE2D(_ShineMask); + SAMPLER(sampler_ShineMask); + #endif + + #if OVERLAY_ON + TEXTURE2D(_OverlayTex); + SAMPLER(sampler_OverlayTex); + #endif + + #if NORMALMAP_ON + TEXTURE2D(_NormalMap); + SAMPLER(sampler_NormalMap); + #endif + + + half3 GetPixel(in int offsetX, in int offsetY, in half2 uv, in Texture2D _tex, in SamplerState _sampler) + { + half2 _uv = uv + half2(offsetX * _MainTex_TexelSize.x, offsetY * _MainTex_TexelSize.y); + half4 col = SAMPLE_TEXTURE2D(_tex, _sampler, _uv); + return col.rgb; + } + + + //BLURS------------------------------------------------------------------------- + half4 Blur(half2 uv, Texture2D source, SamplerState sampler_source, half Intensity) + { + const half2 texelSize = 1.0 / _ScreenParams.xy; + const half4 color = SAMPLE_TEXTURE2D(source, sampler_source, uv); + const half2 offset = Intensity * texelSize; + + half4 accumulatedColor = color; + half accumulatedWeight = 1.0; + for (int x = -1; x <= 1; x++) + { + for (int y = -1; y <= 1; y++) + { + const half2 sampleUV = uv + half2(x, y) * offset; + const half4 sampleColor = SAMPLE_TEXTURE2D(source, sampler_source, sampleUV); + + accumulatedColor += sampleColor; + accumulatedWeight += 1.0; + } + } + + half4 blurredColor = accumulatedColor / accumulatedWeight; + return blurredColor; + } + + half BlurHD_G(half bhqp, half x) + { + return exp(-(x * x) / (2.0 * bhqp * bhqp)); + } + half4 BlurHD(half2 uv, Texture2D source, SamplerState sampler_source, half BlurAmount, half xScale, half yScale) + { + int iterations = 16; + int halfIterations = iterations / 2; + half sigmaX = 0.1 + BlurAmount * 0.5; + half sigmaY = sigmaX; + half total = 0.0; + half4 ret = half4(0, 0, 0, 0); + for (int iy = 0; iy < iterations; ++iy) + { + half fy = BlurHD_G(sigmaY, half(iy) -half(halfIterations)); + half offsetY = half(iy - halfIterations) * 0.00390625 * xScale; + for (int ix = 0; ix < iterations; ++ix) + { + half fx = BlurHD_G(sigmaX, half(ix) - half(halfIterations)); + half offsetX = half(ix - halfIterations) * 0.00390625 * yScale; + total += fx * fy; + ret += SAMPLE_TEXTURE2D(source, sampler_source, uv + half2(offsetX, offsetY)) * fx * fy; + } + } + return ret / total; + } + //----------------------------------------------------------------------- + + + //------------------------------------------- + half RemapFloat(half inValue, half inMin, half inMax, half outMin, half outMax){ + return outMin + (inValue - inMin) * (outMax - outMin) / (inMax - inMin); + } + //------------------------------------------- + + //----------------------------------------------------------------------- + half rand(half2 seed, half offset) { + return (frac(sin(dot(seed, half2(12.9898, 78.233))) * 43758.5453) + offset) % 1.0; + } + + half rand2(half2 seed, half offset) { + return (frac(sin(dot(seed * floor(50 + (_Time.x % 1.0) * 12.), half2(127.1, 311.7))) * 43758.5453123) + offset) % 1.0; + } + + half rand2CustomTime(half2 seed, half offset, half customTime) { + return (frac(sin(dot(seed * floor(50 + (customTime % 1.0) * 12.), half2(127.1, 311.7))) * 43758.5453123) + offset) % 1.0; + } + //----------------------------------------------------------------------- + + + void Ext_ModifyVertex0 (inout VertexData v, inout ExtraV2F d) + { + //BILBOARD_ON + #if BILBOARD_ON + half3 camRight = mul((half3x3)unity_CameraToWorld, half3(1,0,0)); + half3 camUp = half3(0,1,0); + #if BILBOARDY_ON + camUp = mul((half3x3)unity_CameraToWorld, half3(0,1,0)); + #endif + half3 localPos = v.vertex.x * camRight + v.vertex.y * camUp; + v.vertex = half4(localPos, 1); + #endif + //----------------------------------------------------------- + + v.texcoord0.xy = TRANSFORM_TEX(v.texcoord0.xy, _MainTex); + half2 center = half2(0.5, 0.5); + #if ATLAS_ON + center = half2((_MaxXUV + _MinXUV) / 2.0, (_MaxYUV + _MinYUV) / 2.0); + #endif + + //POLARUV_ON + #if POLARUV_ON + v.texcoord0.xy = v.texcoord0.xy - center; + #endif + + //---------------------------------------- + + //ROTATEUV_ON + #if ROTATEUV_ON + half2 uvC = v.texcoord0.xy; + half cosAngle = cos(_RotateUvAmount); + half sinAngle = sin(_RotateUvAmount); + half2x2 rot = half2x2(cosAngle, -sinAngle, sinAngle, cosAngle); + uvC -= center; + v.texcoord0.xy = mul(rot, uvC); + v.texcoord0.xy += center; + #endif + //-------------------- + + #if RECTSIZE_ON + v.vertex.xyz += (v.vertex.xyz * (_RectSize - 1.0)); + #endif + + #if OUTTEX_ON + v.texcoord1.xy = TRANSFORM_TEX(v.texcoord0.xy, _OutlineTex); + #endif + + #if OUTDIST_ON + v.texcoord2.xy = TRANSFORM_TEX(v.texcoord0.xy, _OutlineDistortTex); + #endif + + #if DISTORT_ON + v.texcoord3.xy = TRANSFORM_TEX(v.texcoord0.xy, _DistortTex); + #endif + } + + void Ext_SurfaceFunction0 (inout Surface o, ShaderData d) + { + half randomSeed = _RandomSeed; + + float2 uvRect = d.texcoord0; + half2 center = half2(0.5, 0.5); + #if ATLAS_ON + center = half2((_MaxXUV + _MinXUV) / 2.0, (_MaxYUV + _MinYUV) / 2.0); + uvRect = half2((d.texcoord0.x - _MinXUV) / (_MaxXUV - _MinXUV), (d.texcoord0.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half2 centerTiled = half2(center.x * _MainTex_ST.x, center.y * _MainTex_ST.y); + + //CLIPPING_ON + #if CLIPPING_ON + half2 tiledUv = half2(d.texcoord0.x / _MainTex_ST.x, d.texcoord0.y / _MainTex_ST.y); + #if ATLAS_ON + tiledUv = half2((tiledUv.x - _MinXUV) / (_MaxXUV - _MinXUV), (tiledUv.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + clip((1 - _ClipUvUp) - tiledUv.y); + clip(tiledUv.y - _ClipUvDown); + clip((1 - _ClipUvRight) - tiledUv.x); + clip(tiledUv.x - _ClipUvLeft); + #endif + //---------------------------------- + + //RADIALCLIPPING_ON + #if RADIALCLIPPING_ON + half2 tiledUv2 = half2(d.texcoord0.x / _MainTex_ST.x, d.texcoord0.y / _MainTex_ST.y); + #if ATLAS_ON + tiledUv2 = half2((tiledUv2.x - _MinXUV) / (_MaxXUV - _MinXUV), (tiledUv2.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half startAngle = _RadialStartAngle - _RadialClip; + half endAngle = _RadialStartAngle + _RadialClip2; + half offset0 = clamp(0, 360, startAngle + 360); + half offset360 = clamp(0, 360, endAngle - 360); + half2 atan2Coord = half2(lerp(-1, 1, tiledUv2.x), lerp(-1, 1, tiledUv2.y)); + half atanAngle = atan2(atan2Coord.y, atan2Coord.x) * 57.3; // angle in degrees + if(atanAngle < 0) atanAngle = 360 + atanAngle; + if(atanAngle >= startAngle && atanAngle <= endAngle) discard; + if(atanAngle <= offset360) discard; + if(atanAngle >= offset0) discard; + #endif + + //----------------------------- + + //TEXTURESCROLL_ON && ATLAS_ON + #if TEXTURESCROLL_ON && ATLAS_ON + d.texcoord0.xy = half2(_MinXUV + ((_MaxXUV - _MinXUV) * (abs(((_Time.y + randomSeed) * _TextureScrollXSpeed) + uvRect.x) % 1)), + _MinYUV + ((_MaxYUV - _MinYUV) * (abs(((_Time.y + randomSeed) * _TextureScrollYSpeed) + uvRect.y) % 1))); + #endif + //---------------------------- + + //OFFSETUV_ON + #if OFFSETUV_ON + #if ATLAS_ON + d.texcoord0.xy = half2(_MinXUV + ((_MaxXUV - _MinXUV) * (abs((_OffsetUvX + uvRect.x) % 1))), + _MinYUV + ((_MaxYUV - _MinYUV) * (abs(_OffsetUvY + uvRect.y) % 1))); + #else + d.texcoord0.xy += half2(_OffsetUvX, _OffsetUvY); + #endif + #endif + + //---------------------- + + //POLARUV_ON + #if POLARUV_ON + d.texcoord0.xy = half2(atan2(d.texcoord0.y, d.texcoord0.x) / (2.0f * 3.141592653589f), length(d.texcoord0.xy)); + d.texcoord0.xy *= _MainTex_ST.xy; + #endif + + //-------------------------------------- + + //TWISTUV_ON + #if TWISTUV_ON + #if ATLAS_ON + _TwistUvPosX = ((_MaxXUV - _MinXUV) * _TwistUvPosX) + _MinXUV; + _TwistUvPosY = ((_MaxYUV - _MinYUV) * _TwistUvPosY) + _MinYUV; + #endif + half2 tempUv = d.texcoord0.xy - half2(_TwistUvPosX * _MainTex_ST.x, _TwistUvPosY * _MainTex_ST.y); + _TwistUvRadius *= (_MainTex_ST.x + _MainTex_ST.y) / 2; + half percent = (_TwistUvRadius - length(tempUv)) / _TwistUvRadius; + half theta = percent * percent * (2.0 * sin(_TwistUvAmount)) * 8.0; + half s = sin(theta); + half c = cos(theta); + half beta = max(sign(_TwistUvRadius - length(tempUv)), 0.0); + tempUv = half2(dot(tempUv, half2(c, -s)), dot(tempUv, half2(s, c))) * beta + tempUv * (1 - beta); + tempUv += half2(_TwistUvPosX * _MainTex_ST.x, _TwistUvPosY * _MainTex_ST.y); + d.texcoord0.xy = tempUv; + #endif + + //-------------------------------------------- + + //FISHEYE_ON + #if FISHEYE_ON + half bind = length(centerTiled); + half2 dF = d.texcoord0.xy - centerTiled; + half dFlen = length(dF); + half fishInt = (3.14159265359 / bind) * (_FishEyeUvAmount + 0.001); + d.texcoord0.xy = centerTiled + (dF / (max(0.0001, dFlen))) * tan(dFlen * fishInt) * bind / tan(bind * fishInt); + #endif + //--------------------------------------------- + + //PINCH_ON + #if PINCH_ON + half2 dP = d.texcoord0.xy - centerTiled; + half pinchInt = (3.141592 / length(centerTiled)) * (-_PinchUvAmount + 0.001); + d.texcoord0.xy = centerTiled + normalize(dP) * atan(length(dP) * -pinchInt * 10.0) * 0.5 / atan(-pinchInt * 5); + #endif + + //--------------------------------------------- + + //ZOOMUV_ON + #if ZOOMUV_ON + d.texcoord0.xy -= centerTiled; + d.texcoord0.xy = d.texcoord0.xy * _ZoomUvAmount; + d.texcoord0.xy += centerTiled; + #endif + + //----------------------------------------------- + + //DOODLE_ON + #if DOODLE_ON + half2 uvCopy = uvRect; + _HandDrawnSpeed = (floor((_Time.x + randomSeed) * 20 * _HandDrawnSpeed) / _HandDrawnSpeed) * _HandDrawnSpeed; + uvCopy.x = sin((uvCopy.x * _HandDrawnAmount + _HandDrawnSpeed) * 4); + uvCopy.y = cos((uvCopy.y * _HandDrawnAmount + _HandDrawnSpeed) * 4); + d.texcoord0.xy = lerp(d.texcoord0.xy, d.texcoord0.xy + uvCopy, 0.0005 * _HandDrawnAmount); + #endif + + //-------------------------- + + //SHAKEUV_ON + #if SHAKEUV_ON + half xShake = sin((_Time.x + randomSeed) * _ShakeUvSpeed * 50) * _ShakeUvX; + half yShake = cos((_Time.x + randomSeed) * _ShakeUvSpeed * 50) * _ShakeUvY; + d.texcoord0.xy += half2(xShake * 0.012, yShake * 0.01); + #endif + + //------------------------------------------- + + //RECTSIZE_ON + #if RECTSIZE_ON + d.texcoord0.xy = d.texcoord0.xy * (_RectSize).xx + (((-_RectSize * 0.5) + 0.5)).xx; + #endif + + //------------------------------------------- + + //DISTORT_ON + #if DISTORT_ON + #if ATLAS_ON + d.texcoord3.x = d.texcoord3.x * (1 / (_MaxXUV - _MinXUV)); + d.texcoord3.y = d.texcoord3.y * (1 / (_MaxYUV - _MinYUV)); + #endif + + d.texcoord3.x += ((_Time.x + _RandomSeed) * _DistortTexXSpeed) % 1; + d.texcoord3.y += ((_Time.x + _RandomSeed) * _DistortTexYSpeed) % 1; + half distortAmnt = (SAMPLE_TEXTURE2D(_DistortTex, sampler_DistortTex, d.texcoord3.xy).r - 0.5) * 0.2 * _DistortAmount; + d.texcoord0.x += distortAmnt; + d.texcoord0.y += distortAmnt; + #endif + //------------------------------------------------------- + + //WARP_ON + #if WARP_ON + half2 warpUv = half2(d.texcoord0.x / _MainTex_ST.x, d.texcoord0.y / _MainTex_ST.y); + #if ATLAS_ON + warpUv = half2((warpUv.x - _MinXUV) / (_MaxXUV - _MinXUV), (warpUv.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + const float tau = 6.283185307179586; + float xWarp = (_Time.y + randomSeed) * _WarpSpeed + warpUv.x * tau / _WarpScale; + float yWarp = (_Time.y + randomSeed) * _WarpSpeed + warpUv.y * tau / _WarpScale; + float2 warp = float2(sin(xWarp), sin(yWarp)) * _WarpStrength; + d.texcoord0.xy += warp; + #endif + + //------------------------------------------------------- + + //WAVEUV_ON + #if WAVEUV_ON + float2 uvWave = half2(_WaveX * _MainTex_ST.x, _WaveY * _MainTex_ST.y) - d.texcoord0.xy; + uvWave %= 1; + #if ATLAS_ON + uvWave = half2(_WaveX, _WaveY) - uvRect; + #endif + uvWave.x *= _ScreenParams.x / _ScreenParams.y; + float waveTime = _Time.y + randomSeed; + float angWave = (sqrt(dot(uvWave, uvWave)) * _WaveAmount) - ((waveTime * _WaveSpeed)); + d.texcoord0.xy = d.texcoord0.xy + uvWave * sin(angWave) * (_WaveStrength / 1000.0); + #endif + //---------------------------------------------------- + + //ROUNDWAVEUV_ON + #if ROUNDWAVEUV_ON + half xWave = ((0.5 * _MainTex_ST.x) - uvRect.x); + half yWave = ((0.5 * _MainTex_ST.y) - uvRect.y) * (_MainTex_TexelSize.w / _MainTex_TexelSize.z); + half ripple = -sqrt(xWave*xWave + yWave* yWave); + d.texcoord0.xy += (sin((ripple + (_Time.y + randomSeed) * (_RoundWaveSpeed/10.0)) / 0.015) * (_RoundWaveStrength/10.0)) % 1; + #endif + //---------------------------------------------------- + + + //WIND_ON + #if WIND_ON + half windOffset = sin((_Time.x + randomSeed) * _GrassSpeed * 10); + half2 windCenter = half2(0.5, 0.1); + #if ATLAS_ON + windCenter.x = ((_MaxXUV - _MinXUV) * windCenter.x) + _MinXUV; + windCenter.y = ((_MaxYUV - _MinYUV) * windCenter.y) + _MinYUV; + #endif + #if !MANUALWIND_ON + d.texcoord0.x = fmod(abs(lerp(d.texcoord0.x, d.texcoord0.x + (_GrassWind * 0.01 * windOffset), uvRect.y)), 1); + #else + d.texcoord0.x = fmod(abs(lerp(d.texcoord0.x, d.texcoord0.x + (_GrassWind * 0.01 * _GrassManualAnim), uvRect.y)), 1); + windOffset = _GrassManualAnim; + #endif + half2 delta = d.texcoord0.xy - windCenter; + half delta2 = dot(delta.xy, delta.xy); + half2 delta_offset = delta2 * windOffset; + d.texcoord0.xy = d.texcoord0.xy + half2(delta.y, -delta.x) * delta_offset * _GrassRadialBend; + #endif + + //-------------------------------------------------------- + + //TEXTURESCROLL_ON && !ATLAS_ON + #if TEXTURESCROLL_ON && !ATLAS_ON + d.texcoord0.x += ((_Time.y + randomSeed) * _TextureScrollXSpeed) % 1; + d.texcoord0.y += ((_Time.y + randomSeed) * _TextureScrollYSpeed) % 1; + #endif + //------------------------------ + + //PIXELATE_ON + #if PIXELATE_ON + half aspectRatio = _MainTex_TexelSize.x / _MainTex_TexelSize.y; + half2 pixelSize = float2(_PixelateSize, _PixelateSize * aspectRatio); + d.texcoord0.xy = floor(d.texcoord0.xy * pixelSize) / pixelSize; + #endif + //-------------- + + half4 col = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy); + half originalAlpha = col.a; + col *= d.vertexColor; + + //NORMAL MAP + #if NORMALMAP_ON + half4 normalSample = SAMPLE_TEXTURE2D(_NormalMap, sampler_NormalMap, d.texcoord0.xy); + half3 normalTS = UnpackNormal(normalSample); + normalTS.xy *= _NormalStrength; + o.Normal = normalTS; + #endif + + + //GLITCH_ON + #if GLITCH_ON + half2 uvGlitch = uvRect; + uvGlitch.y -= 0.5; + half lineNoise = pow(rand2(floor(uvGlitch * half2(24., 19.) * _GlitchSize) * 4.0, randomSeed), 3.0) * _GlitchAmount + * pow(rand2(floor(uvGlitch * half2(38., 14.) * _GlitchSize) * 4.0, randomSeed), 3.0); + col = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(lineNoise * 0.02 * rand2(half2(2.0, 1), randomSeed), 0)) * d.vertexColor; + #endif + //-------------------------------------- + + //CHROMABERR_ON + #if CHROMABERR_ON + half4 r = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(_ChromAberrAmount/10, 0)) * d.vertexColor; + half4 b = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(-_ChromAberrAmount/10, 0)) * d.vertexColor; + col = half4(r.r * r.a, col.g, b.b * b.a, max(max(r.a, b.a) * _ChromAberrAlpha, col.a)); + #endif + + //-------------------------------- + + //BLUR_ON + #if BLUR_ON + #if ATLAS_ON + #if !BLURISHD_ON + col = BlurHD(d.texcoord0.xy, _MainTex, sampler_MainTex, _BlurIntensity, (_MaxXUV - _MinXUV), (_MaxYUV - _MinYUV)) * d.vertexColor; + #else + col = Blur(d.texcoord0.xy, _MainTex, sampler_MainTex, _BlurIntensity * (_MaxXUV - _MinXUV)) * d.vertexColor; + #endif + #else + #if !BLURISHD_ON + col = BlurHD(d.texcoord0.xy, _MainTex, sampler_MainTex, _BlurIntensity, 1, 1) * d.vertexColor; + #else + col = Blur(d.texcoord0.xy, _MainTex, sampler_MainTex, _BlurIntensity) * d.vertexColor; + #endif + #endif + #endif + + //-------------------- + + //MOTIONBLUR_ON + #if MOTIONBLUR_ON + _MotionBlurAngle = _MotionBlurAngle * 3.1415926; + #define rot(n) mul(n, half2x2(cos(_MotionBlurAngle), -sin(_MotionBlurAngle), sin(_MotionBlurAngle), cos(_MotionBlurAngle))) + _MotionBlurDist = _MotionBlurDist * 0.005; + #if ATLAS_ON + _MotionBlurDist *= (_MaxXUV - _MinXUV); + #endif + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(-_MotionBlurDist, -_MotionBlurDist))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(-_MotionBlurDist * 2, -_MotionBlurDist * 2))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(-_MotionBlurDist * 3, -_MotionBlurDist * 3))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(-_MotionBlurDist * 4, -_MotionBlurDist * 4))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(_MotionBlurDist, _MotionBlurDist))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(_MotionBlurDist * 2, _MotionBlurDist * 2))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(_MotionBlurDist * 3, _MotionBlurDist * 3))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(_MotionBlurDist * 4, _MotionBlurDist * 4))); + col.rgb = col.rgb / 9; + #endif + //------------------------------------ + + //NEGATIVE_ON + #if NEGATIVE_ON + col.rgb = lerp(col.rgb, 1 - col.rgb, _NegativeAmount); + #endif + + //-------------- + half luminance = 0; + + //GREYSCALE_ON && !GREYSCALEOUTLINE_ON + #if GREYSCALE_ON && !GREYSCALEOUTLINE_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + luminance = saturate(luminance + _GreyscaleLuminosity); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _GreyscaleTintColor, _GreyscaleBlend); + #endif + //------------------------------------ + + //GHOST_ON + #if GHOST_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + half4 ghostResult; + ghostResult.a = saturate(luminance - _GhostTransparency) * col.a; + ghostResult.rgb = col.rgb * (luminance + _GhostColorBoost); + col = lerp(col, ghostResult, _GhostBlend); + #endif + //------------------------------------ + + //INNEROUTLINE_ON + #if INNEROUTLINE_ON + half3 innerT = abs(GetPixel(0, _InnerOutlineThickness, d.texcoord0.xy, _MainTex, sampler_MainTex) - GetPixel(0, -_InnerOutlineThickness, d.texcoord0.xy, _MainTex, sampler_MainTex)); + innerT += abs(GetPixel(_InnerOutlineThickness, 0, d.texcoord0.xy, _MainTex, sampler_MainTex) - GetPixel(-_InnerOutlineThickness, 0, d.texcoord0.xy, _MainTex, sampler_MainTex)); + #if !ONLYINNEROUTLINE_ON + innerT = (innerT / 2.0) * col.a * _InnerOutlineAlpha; + col.rgb += length(innerT) * _InnerOutlineColor.rgb * _InnerOutlineGlow; + #else + innerT *= col.a * _InnerOutlineAlpha; + col.rgb = length(innerT) * _InnerOutlineColor.rgb * _InnerOutlineGlow; + col.a = step(0.3, col.r+col.g+col.b); + #endif + #endif + //------------------------------------------------------- + + //HITEFFECT_ON + #if HITEFFECT_ON + col.rgb = lerp(col.rgb, _HitEffectColor.rgb * _HitEffectGlow, _HitEffectBlend); + #endif + //-------------------- + + //GRADIENT_ON + #if GRADIENT_ON + half2 tiledUvGrad = half2(uvRect.x / _MainTex_ST.x, uvRect.y / _MainTex_ST.y); + #if GRADIENT2COL_ON + _GradTopRightCol = _GradTopLeftCol; + _GradBotRightCol = _GradBotLeftCol; + #endif + #if RADIALGRADIENT_ON + half radialDist = 1 - length(tiledUvGrad - half2(0.5, 0.5)); + radialDist *= (_MainTex_TexelSize.w / _MainTex_TexelSize.z); + radialDist = saturate(_GradBoostX * radialDist); + half4 gradientResult = lerp(_GradTopLeftCol, _GradBotLeftCol, radialDist); + #else + half gradXLerpFactor = saturate(pow(tiledUvGrad.x, _GradBoostX)); + half4 gradientResult = lerp(lerp(_GradBotLeftCol, _GradBotRightCol, gradXLerpFactor), + lerp(_GradTopLeftCol, _GradTopRightCol, gradXLerpFactor), saturate(pow(tiledUvGrad.y, _GradBoostY))); + #endif + gradientResult = lerp(col, gradientResult, _GradBlend); + col.rgb = gradientResult.rgb * col.a; + col.a *= gradientResult.a; + #endif + //-------------------------------------------------------------------- + + //CONTRAST_ON + #if CONTRAST_ON + col.rgb = (col.rgb - float3(0.5, 0.5, 0.5)) * _Contrast + float3(0.5, 0.5, 0.5); + col.rgb += _Brightness; + #endif + + //------------------------------------------------------------------- + + //COLORSWAP_ON + #if COLORSWAP_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + half4 swapMask = SAMPLE_TEXTURE2D(_ColorSwapTex, sampler_ColorSwapTex, d.texcoord0.xy); + swapMask.rgb *= swapMask.a; + half3 redSwap = _ColorSwapRed * swapMask.r * saturate(luminance + _ColorSwapRedLuminosity); + half3 greenSwap = _ColorSwapGreen * swapMask.g * saturate(luminance + _ColorSwapGreenLuminosity); + half3 blueSwap = _ColorSwapBlue * swapMask.b * saturate(luminance + _ColorSwapBlueLuminosity); + swapMask.rgb = col.rgb * saturate(1 - swapMask.r - swapMask.g - swapMask.b); + col.rgb = lerp(col.rgb, swapMask.rgb + redSwap + greenSwap + blueSwap, _ColorSwapBlend); + #endif + //-------------------------------------------------------------------- + + //COLORRAMP_ON && !COLORRAMPOUTLINE_ON + #if COLORRAMP_ON && !COLORRAMPOUTLINE_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + luminance = saturate(luminance + _ColorRampLuminosity); + #if GRADIENTCOLORRAMP_ON + col.rgb = lerp(col.rgb, SAMPLE_TEXTURE2D(_ColorRampTexGradient, sampler_ColorRampTexGradient, half2(luminance, 0)).rgb, _ColorRampBlend); + #else + col.rgb = lerp(col.rgb, SAMPLE_TEXTURE2D(_ColorRampTex, sampler_ColorRampTex, half2(luminance, 0)).rgb, _ColorRampBlend); + #endif + #endif + //-------------------------------------------------------------------- + + //CHANGECOLOR_ON + #if CHANGECOLOR_ON + float3 currChangeColor = saturate(col.rgb); + luminance = 0.3 * currChangeColor.r + 0.59 * currChangeColor.g + 0.11 * currChangeColor.b; + luminance = saturate(luminance + _ColorChangeLuminosity); + half3 dif = abs(currChangeColor - _ColorChangeTarget.rgb); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _ColorChangeNewCol.rgb, + max(sign(1 - saturate(dif.x + dif.y + dif.z) - _ColorChangeTolerance), 0.0)); + #if CHANGECOLOR2_ON + dif = abs(currChangeColor - _ColorChangeTarget2.rgb); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _ColorChangeNewCol2.rgb, + max(sign(1 - saturate(dif.x + dif.y + dif.z) - _ColorChangeTolerance2), 0.0)); + #endif + #if CHANGECOLOR3_ON + dif = abs(currChangeColor - _ColorChangeTarget3.rgb); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _ColorChangeNewCol3.rgb, + max(sign(1 - saturate(dif.x + dif.y + dif.z) - _ColorChangeTolerance3), 0.0)); + #endif + #endif + //------------------------------------------------------- + + //POSTERIZE_ON && !POSTERIZEOUTLINE_ON + #if POSTERIZE_ON && !POSTERIZEOUTLINE_ON + col.rgb = pow(col.rgb, _PosterizeGamma) * _PosterizeNumColors; + col.rgb = floor(col.rgb) / _PosterizeNumColors; + col.rgb = pow(col.rgb, 1.0 / _PosterizeGamma); + #endif + //------------------------------------ + + //HSV_ON + #if HSV_ON + half3 resultHsv = half3(col.rgb); + half cosHsv = _HsvBright * _HsvSaturation * cos(_HsvShift * 3.14159265 / 180); + half sinHsv = _HsvBright * _HsvSaturation * sin(_HsvShift * 3.14159265 / 180); + resultHsv.x = (.299 * _HsvBright + .701 * cosHsv + .168 * sinHsv) * col.x + + (.587 * _HsvBright - .587 * cosHsv + .330 * sinHsv) * col.y + + (.114 * _HsvBright - .114 * cosHsv - .497 * sinHsv) * col.z; + resultHsv.y = (.299 * _HsvBright - .299 * cosHsv - .328 * sinHsv) *col.x + + (.587 * _HsvBright + .413 * cosHsv + .035 * sinHsv) * col.y + + (.114 * _HsvBright - .114 * cosHsv + .292 * sinHsv) * col.z; + resultHsv.z = (.299 * _HsvBright - .3 * cosHsv + 1.25 * sinHsv) * col.x + + (.587 * _HsvBright - .588 * cosHsv - 1.05 * sinHsv) * col.y + + (.114 * _HsvBright + .886 * cosHsv - .203 * sinHsv) * col.z; + col.rgb = resultHsv; + #endif + //------------------------------------------------------- + + //OVERLAY_ON + #if OVERLAY_ON + half2 overlayUvs = d.texcoord0.xy; + overlayUvs.x += ((_Time.y + randomSeed) * _OverlayTextureScrollXSpeed) % 1; + overlayUvs.y += ((_Time.y + randomSeed) * _OverlayTextureScrollYSpeed) % 1; + half4 overlayCol = SAMPLE_TEXTURE2D(_OverlayTex, sampler_OverlayTex, TRANSFORM_TEX(overlayUvs, _OverlayTex)); + overlayCol.rgb *= _OverlayColor.rgb * _OverlayGlow; + #if !OVERLAYMULT_ON + overlayCol.rgb *= overlayCol.a * _OverlayColor.rgb * _OverlayColor.a * _OverlayBlend; + col.rgb += overlayCol.rgb; + #else + overlayCol.a *= _OverlayColor.a; + col = lerp(col, col * overlayCol, _OverlayBlend); + #endif + #endif + + //--------------------------------- + + //OUTBASE_ON + #if OUTBASE_ON + #if OUTBASEPIXELPERF_ON + half2 destUv = half2(_OutlinePixelWidth * _MainTex_TexelSize.x, _OutlinePixelWidth * _MainTex_TexelSize.y); + #else + half2 destUv = half2(_OutlineWidth * _MainTex_TexelSize.x * 200, _OutlineWidth * _MainTex_TexelSize.y * 200); + #endif + + #if OUTDIST_ON + d.texcoord3.x += ((_Time.x + _RandomSeed) * _OutlineDistortTexXSpeed) % 1; + d.texcoord3.y += ((_Time.x + _RandomSeed) * _OutlineDistortTexYSpeed) % 1; + #if ATLAS_ON + d.texcoord3 = half2((d.texcoord3.x - _MinXUV) / (_MaxXUV - _MinXUV), (d.texcoord3.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half outDistortAmnt = (SAMPLE_TEXTURE2D(_OutlineDistortTex, sampler_OutlineDistortTex, d.texcoord3).r - 0.5) * 0.2 * _OutlineDistortAmount; + destUv.x += outDistortAmnt; + destUv.y += outDistortAmnt; + #endif + + half spriteLeft = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(destUv.x, 0)).a; + half spriteRight = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy - half2(destUv.x, 0)).a; + half spriteBottom = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(0, destUv.y)).a; + half spriteTop = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy - half2(0, destUv.y)).a; + half result = spriteLeft + spriteRight + spriteBottom + spriteTop; + + #if OUTBASE8DIR_ON + half spriteTopLeft = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(destUv.x, destUv.y)).a; + half spriteTopRight = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(-destUv.x, destUv.y)).a; + half spriteBotLeft = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(destUv.x, -destUv.y)).a; + half spriteBotRight = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(-destUv.x, -destUv.y)).a; + result = result + spriteTopLeft + spriteTopRight + spriteBotLeft + spriteBotRight; + #endif + + result = step(0.05, saturate(result)); + + #if OUTTEX_ON + d.texcoord1.x += ((_Time.x + _RandomSeed) * _OutlineTexXSpeed) % 1; + d.texcoord1.y += ((_Time.x + _RandomSeed) * _OutlineTexYSpeed) % 1; + #if ATLAS_ON + d.texcoord1 = half2((d.texcoord1.x - _MinXUV) / (_MaxXUV - _MinXUV), (d.texcoord1.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half4 tempOutColor = SAMPLE_TEXTURE2D(_OutlineTex, sampler_OutlineTex, d.texcoord1); + tempOutColor *= _OutlineColor; + _OutlineColor = tempOutColor; + #endif + + result *= (1 - originalAlpha) * _OutlineAlpha; + + half4 outline = _OutlineColor * d.vertexColor.a; + outline.rgb *= _OutlineGlow; + outline.a = result; + #if ONLYOUTLINE_ON + col = outline; + #else + col = lerp(col, outline, result); + #endif + #endif + //------------------------------------------------------- + + //FADE_ON + #if FADE_ON + half2 tiledUvFade1 = TRANSFORM_TEX(d.texcoord0, _FadeTex); + half2 tiledUvFade2 = TRANSFORM_TEX(d.texcoord0, _FadeBurnTex); + #if ATLAS_ON + tiledUvFade1 = half2((tiledUvFade1.x - _MinXUV) / (_MaxXUV - _MinXUV), (tiledUvFade1.y - _MinYUV) / (_MaxYUV - _MinYUV)); + tiledUvFade2 = half2((tiledUvFade2.x - _MinXUV) / (_MaxXUV - _MinXUV), (tiledUvFade2.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half fadeTemp = SAMPLE_TEXTURE2D(_FadeTex, sampler_FadeTex, tiledUvFade1).r; + half fade = smoothstep(_FadeAmount, _FadeAmount + _FadeBurnTransition, fadeTemp); + half fadeBurn = saturate(smoothstep(_FadeAmount - _FadeBurnWidth, _FadeAmount - _FadeBurnWidth + 0.1, fadeTemp) * _FadeAmount); + col.a *= fade; + _FadeBurnColor.rgb *= _FadeBurnGlow; + col += fadeBurn * SAMPLE_TEXTURE2D(_FadeBurnTex, sampler_FadeBurnTex, tiledUvFade2) * _FadeBurnColor * originalAlpha * (1 - col.a); + #endif + //------------------------------------------------------- + + //SHADOW_ON + #if SHADOW_ON + half shadowA = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(_ShadowX, _ShadowY)).a; + half preMultShadowMask = 1 - (saturate(shadowA - col.a) * (1 - col.a)); + col.rgb *= 1 - ((shadowA - col.a) * (1 - col.a)); + col.rgb += (_ShadowColor * shadowA) * (1 - col.a); + col.a = max(shadowA * _ShadowAlpha * d.vertexColor.a, col.a); + #endif + + //------------------------------------------------------- + + //GLOW_ON + #if GLOW_ON + half4 emission; + #if GLOWTEX_ON + emission = SAMPLE_TEXTURE2D(_GlowTex, sampler_GlowTex, d.texcoord0); + #else + emission = col; + #endif + + col.rgb *= _GlowGlobal; + emission.rgb *= emission.a * col.a * _Glow * _GlowColor; + col.rgb += emission.rgb; + #endif + //------------------------------------------------------- + + //COLORRAMP_ON && COLORRAMPOUTLINE_ON + #if COLORRAMP_ON && COLORRAMPOUTLINE_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + luminance = saturate(luminance + _ColorRampLuminosity); + #if GRADIENTCOLORRAMP_ON + col.rgb = lerp(col.rgb, SAMPLE_TEXTURE2D(_ColorRampTexGradient, sampler_ColorRampTexGradient, half2(luminance, 0)).rgb, _ColorRampBlend); + #else + col.rgb = lerp(col.rgb, SAMPLE_TEXTURE2D(_ColorRampTex, sampler_ColorRampTex, half2(luminance, 0)).rgb, _ColorRampBlend); + #endif + #endif + //--------------- + + //GREYSCALE_ON && GREYSCALEOUTLINE_ON + #if GREYSCALE_ON && GREYSCALEOUTLINE_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + luminance = saturate(luminance + _GreyscaleLuminosity); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _GreyscaleTintColor, _GreyscaleBlend); + #endif + + //----------------------------------- + + //POSTERIZE_ON && POSTERIZEOUTLINE_ON + #if POSTERIZE_ON && POSTERIZEOUTLINE_ON + col.rgb = pow(col.rgb, _PosterizeGamma) * _PosterizeNumColors; + col.rgb = floor(col.rgb) / _PosterizeNumColors; + col.rgb = pow(col.rgb, 1.0 / _PosterizeGamma); + #endif + + //----------------------------------- + + //SHINE_ON + #if SHINE_ON + half2 uvShine = uvRect; + half cosAngle = cos(_ShineRotate); + half sinAngle = sin(_ShineRotate); + half2x2 rot = half2x2(cosAngle, -sinAngle, sinAngle, cosAngle); + uvShine -= half2(0.5, 0.5); + uvShine = mul(rot, uvShine); + uvShine += half2(0.5, 0.5); + half shineMask = SAMPLE_TEXTURE2D(_ShineMask, sampler_ShineMask, d.texcoord0.xy).a; + half currentDistanceProjection = (uvShine.x + uvShine.y) / 2; + half whitePower = 1 - (abs(currentDistanceProjection - _ShineLocation) / _ShineWidth); + col.rgb += col.a * whitePower * _ShineGlow * max(sign(currentDistanceProjection - (_ShineLocation - _ShineWidth)), 0.0) + * max(sign((_ShineLocation + _ShineWidth) - currentDistanceProjection), 0.0) * _ShineColor * shineMask; + #endif + + //----------------------------------- + + //HOLOGRAM_ON + #if HOLOGRAM_ON + half totalHologram = _HologramStripesAmount + _HologramUnmodAmount; + half hologramYCoord = ((uvRect.y + (((_Time.x + randomSeed) % 1) * _HologramStripesSpeed)) % totalHologram) / totalHologram; + hologramYCoord = abs(hologramYCoord); + half alpha = RemapFloat(saturate(hologramYCoord - (_HologramUnmodAmount/totalHologram)), 0.0, 1.0, _HologramMinAlpha, saturate(_HologramMaxAlpha)); + half hologramMask = max(sign((_HologramUnmodAmount/totalHologram) - hologramYCoord), 0.0); + half4 hologramResult = col; + hologramResult.a *= lerp(alpha, 1, hologramMask); + hologramResult.rgb *= max(1, _HologramMaxAlpha * max(sign(hologramYCoord - (_HologramUnmodAmount/totalHologram)), 0.0)); + hologramMask = 1 - step(0.01,hologramMask); + hologramResult.rgb += hologramMask * _HologramStripeColor * col.a; + col = lerp(col, hologramResult, _HologramBlend); + #endif + + //----------------------------------- + + //FLICKER_ON + #if FLICKER_ON + col.a *= saturate(col.a * step(frac(0.05 + (_Time.w + randomSeed) * _FlickerFreq), 1 - _FlickerPercent) + _FlickerAlpha); + #endif + //----------------------------------- + + //ALPHACUTOFF_ON + + //ALPHAROUND_ON + + //ALPHAOUTLINE_ON + #if ALPHAOUTLINE_ON + half alphaOutlineRes = pow(1 - col.a, max(_AlphaOutlinePower, 0.0001)) * step(_AlphaOutlineMinAlpha, col.a) * _AlphaOutlineBlend; + col.rgb = lerp(col.rgb, _AlphaOutlineColor.rgb * _AlphaOutlineGlow, alphaOutlineRes); + col.a = lerp(col.a, 1, alphaOutlineRes > 1); + #endif + //------------------------------------------------------- + + //FOG_ON + + //------------------ + + col *= _Color; + o.Albedo = col; + col.a *= _Alpha; + clip(col.a - _AlphaCutoffValue - 0.01); + o.Alpha = _Color.a; + } + + + + + + void ChainSurfaceFunction(inout Surface l, inout ShaderData d) + { + Ext_SurfaceFunction0(l, d); + // Ext_SurfaceFunction1(l, d); + // Ext_SurfaceFunction2(l, d); + // Ext_SurfaceFunction3(l, d); + // Ext_SurfaceFunction4(l, d); + // Ext_SurfaceFunction5(l, d); + // Ext_SurfaceFunction6(l, d); + // Ext_SurfaceFunction7(l, d); + // Ext_SurfaceFunction8(l, d); + // Ext_SurfaceFunction9(l, d); + // Ext_SurfaceFunction10(l, d); + // Ext_SurfaceFunction11(l, d); + // Ext_SurfaceFunction12(l, d); + // Ext_SurfaceFunction13(l, d); + // Ext_SurfaceFunction14(l, d); + // Ext_SurfaceFunction15(l, d); + // Ext_SurfaceFunction16(l, d); + // Ext_SurfaceFunction17(l, d); + // Ext_SurfaceFunction18(l, d); + // Ext_SurfaceFunction19(l, d); + // Ext_SurfaceFunction20(l, d); + // Ext_SurfaceFunction21(l, d); + // Ext_SurfaceFunction22(l, d); + // Ext_SurfaceFunction23(l, d); + // Ext_SurfaceFunction24(l, d); + // Ext_SurfaceFunction25(l, d); + // Ext_SurfaceFunction26(l, d); + // Ext_SurfaceFunction27(l, d); + // Ext_SurfaceFunction28(l, d); + // Ext_SurfaceFunction29(l, d); + } + +#if !_DECALSHADER + + void ChainModifyVertex(inout VertexData v, inout VertexToPixel v2p, float4 time) + { + ExtraV2F d; + + ZERO_INITIALIZE(ExtraV2F, d); + ZERO_INITIALIZE(Blackboard, d.blackboard); + // due to motion vectors in HDRP, we need to use the last + // time in certain spots. So if you are going to use _Time to adjust vertices, + // you need to use this time or motion vectors will break. + d.time = time; + + Ext_ModifyVertex0(v, d); + // Ext_ModifyVertex1(v, d); + // Ext_ModifyVertex2(v, d); + // Ext_ModifyVertex3(v, d); + // Ext_ModifyVertex4(v, d); + // Ext_ModifyVertex5(v, d); + // Ext_ModifyVertex6(v, d); + // Ext_ModifyVertex7(v, d); + // Ext_ModifyVertex8(v, d); + // Ext_ModifyVertex9(v, d); + // Ext_ModifyVertex10(v, d); + // Ext_ModifyVertex11(v, d); + // Ext_ModifyVertex12(v, d); + // Ext_ModifyVertex13(v, d); + // Ext_ModifyVertex14(v, d); + // Ext_ModifyVertex15(v, d); + // Ext_ModifyVertex16(v, d); + // Ext_ModifyVertex17(v, d); + // Ext_ModifyVertex18(v, d); + // Ext_ModifyVertex19(v, d); + // Ext_ModifyVertex20(v, d); + // Ext_ModifyVertex21(v, d); + // Ext_ModifyVertex22(v, d); + // Ext_ModifyVertex23(v, d); + // Ext_ModifyVertex24(v, d); + // Ext_ModifyVertex25(v, d); + // Ext_ModifyVertex26(v, d); + // Ext_ModifyVertex27(v, d); + // Ext_ModifyVertex28(v, d); + // Ext_ModifyVertex29(v, d); + + + // #if %EXTRAV2F0REQUIREKEY% + // v2p.extraV2F0 = d.extraV2F0; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // v2p.extraV2F1 = d.extraV2F1; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // v2p.extraV2F2 = d.extraV2F2; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // v2p.extraV2F3 = d.extraV2F3; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // v2p.extraV2F4 = d.extraV2F4; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // v2p.extraV2F5 = d.extraV2F5; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // v2p.extraV2F6 = d.extraV2F6; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // v2p.extraV2F7 = d.extraV2F7; + // #endif + } + + void ChainModifyTessellatedVertex(inout VertexData v, inout VertexToPixel v2p) + { + ExtraV2F d; + ZERO_INITIALIZE(ExtraV2F, d); + ZERO_INITIALIZE(Blackboard, d.blackboard); + + // #if %EXTRAV2F0REQUIREKEY% + // d.extraV2F0 = v2p.extraV2F0; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // d.extraV2F1 = v2p.extraV2F1; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // d.extraV2F2 = v2p.extraV2F2; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // d.extraV2F3 = v2p.extraV2F3; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // d.extraV2F4 = v2p.extraV2F4; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // d.extraV2F5 = v2p.extraV2F5; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // d.extraV2F6 = v2p.extraV2F6; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // d.extraV2F7 = v2p.extraV2F7; + // #endif + + + // Ext_ModifyTessellatedVertex0(v, d); + // Ext_ModifyTessellatedVertex1(v, d); + // Ext_ModifyTessellatedVertex2(v, d); + // Ext_ModifyTessellatedVertex3(v, d); + // Ext_ModifyTessellatedVertex4(v, d); + // Ext_ModifyTessellatedVertex5(v, d); + // Ext_ModifyTessellatedVertex6(v, d); + // Ext_ModifyTessellatedVertex7(v, d); + // Ext_ModifyTessellatedVertex8(v, d); + // Ext_ModifyTessellatedVertex9(v, d); + // Ext_ModifyTessellatedVertex10(v, d); + // Ext_ModifyTessellatedVertex11(v, d); + // Ext_ModifyTessellatedVertex12(v, d); + // Ext_ModifyTessellatedVertex13(v, d); + // Ext_ModifyTessellatedVertex14(v, d); + // Ext_ModifyTessellatedVertex15(v, d); + // Ext_ModifyTessellatedVertex16(v, d); + // Ext_ModifyTessellatedVertex17(v, d); + // Ext_ModifyTessellatedVertex18(v, d); + // Ext_ModifyTessellatedVertex19(v, d); + // Ext_ModifyTessellatedVertex20(v, d); + // Ext_ModifyTessellatedVertex21(v, d); + // Ext_ModifyTessellatedVertex22(v, d); + // Ext_ModifyTessellatedVertex23(v, d); + // Ext_ModifyTessellatedVertex24(v, d); + // Ext_ModifyTessellatedVertex25(v, d); + // Ext_ModifyTessellatedVertex26(v, d); + // Ext_ModifyTessellatedVertex27(v, d); + // Ext_ModifyTessellatedVertex28(v, d); + // Ext_ModifyTessellatedVertex29(v, d); + + // #if %EXTRAV2F0REQUIREKEY% + // v2p.extraV2F0 = d.extraV2F0; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // v2p.extraV2F1 = d.extraV2F1; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // v2p.extraV2F2 = d.extraV2F2; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // v2p.extraV2F3 = d.extraV2F3; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // v2p.extraV2F4 = d.extraV2F4; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // v2p.extraV2F5 = d.extraV2F5; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // v2p.extraV2F6 = d.extraV2F6; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // v2p.extraV2F7 = d.extraV2F7; + // #endif + } + + void ChainFinalColorForward(inout Surface l, inout ShaderData d, inout half4 color) + { + // Ext_FinalColorForward0(l, d, color); + // Ext_FinalColorForward1(l, d, color); + // Ext_FinalColorForward2(l, d, color); + // Ext_FinalColorForward3(l, d, color); + // Ext_FinalColorForward4(l, d, color); + // Ext_FinalColorForward5(l, d, color); + // Ext_FinalColorForward6(l, d, color); + // Ext_FinalColorForward7(l, d, color); + // Ext_FinalColorForward8(l, d, color); + // Ext_FinalColorForward9(l, d, color); + // Ext_FinalColorForward10(l, d, color); + // Ext_FinalColorForward11(l, d, color); + // Ext_FinalColorForward12(l, d, color); + // Ext_FinalColorForward13(l, d, color); + // Ext_FinalColorForward14(l, d, color); + // Ext_FinalColorForward15(l, d, color); + // Ext_FinalColorForward16(l, d, color); + // Ext_FinalColorForward17(l, d, color); + // Ext_FinalColorForward18(l, d, color); + // Ext_FinalColorForward19(l, d, color); + // Ext_FinalColorForward20(l, d, color); + // Ext_FinalColorForward21(l, d, color); + // Ext_FinalColorForward22(l, d, color); + // Ext_FinalColorForward23(l, d, color); + // Ext_FinalColorForward24(l, d, color); + // Ext_FinalColorForward25(l, d, color); + // Ext_FinalColorForward26(l, d, color); + // Ext_FinalColorForward27(l, d, color); + // Ext_FinalColorForward28(l, d, color); + // Ext_FinalColorForward29(l, d, color); + } + + void ChainFinalGBufferStandard(inout Surface s, inout ShaderData d, inout half4 GBuffer0, inout half4 GBuffer1, inout half4 GBuffer2, inout half4 outEmission, inout half4 outShadowMask) + { + // Ext_FinalGBufferStandard0(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard1(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard2(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard3(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard4(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard5(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard6(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard7(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard8(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard9(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard10(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard11(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard12(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard13(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard14(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard15(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard16(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard17(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard18(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard19(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard20(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard21(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard22(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard23(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard24(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard25(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard26(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard27(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard28(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard29(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + } +#endif + + + + + +#if _DECALSHADER + + ShaderData CreateShaderData(SurfaceDescriptionInputs IN) + { + ShaderData d = (ShaderData)0; + d.TBNMatrix = float3x3(IN.WorldSpaceTangent, IN.WorldSpaceBiTangent, IN.WorldSpaceNormal); + d.worldSpaceNormal = IN.WorldSpaceNormal; + d.worldSpaceTangent = IN.WorldSpaceTangent; + + d.worldSpacePosition = IN.WorldSpacePosition; + d.texcoord0 = IN.uv0.xyxy; + d.screenPos = IN.ScreenPosition; + + d.worldSpaceViewDir = normalize(_WorldSpaceCameraPos - d.worldSpacePosition); + + d.tangentSpaceViewDir = mul(d.TBNMatrix, d.worldSpaceViewDir); + + // these rarely get used, so we back transform them. Usually will be stripped. + #if _HDRP + // d.localSpacePosition = mul(GetWorldToObjectMatrix(), float4(GetCameraRelativePositionWS(d.worldSpacePosition), 1)).xyz; + #else + // d.localSpacePosition = mul(GetWorldToObjectMatrix(), float4(d.worldSpacePosition, 1)).xyz; + #endif + // d.localSpaceNormal = normalize(mul((float3x3)GetWorldToObjectMatrix(), d.worldSpaceNormal)); + // d.localSpaceTangent = normalize(mul((float3x3)GetWorldToObjectMatrix(), d.worldSpaceTangent.xyz)); + + // #if %SCREENPOSREQUIREKEY% + // d.screenUV = (IN.ScreenPosition.xy / max(0.01, IN.ScreenPosition.w)); + // #endif + + return d; + } +#else + + ShaderData CreateShaderData(VertexToPixel i + #if NEED_FACING + , bool facing + #endif + ) + { + ShaderData d = (ShaderData)0; + d.clipPos = i.pos; + d.worldSpacePosition = i.worldPos; + + d.worldSpaceNormal = normalize(i.worldNormal); + d.worldSpaceTangent.xyz = normalize(i.worldTangent.xyz); + + d.tangentSign = i.worldTangent.w * unity_WorldTransformParams.w; + float3 bitangent = cross(d.worldSpaceTangent.xyz, d.worldSpaceNormal) * d.tangentSign; + + d.TBNMatrix = float3x3(d.worldSpaceTangent, -bitangent, d.worldSpaceNormal); + d.worldSpaceViewDir = normalize(_WorldSpaceCameraPos - i.worldPos); + + d.tangentSpaceViewDir = mul(d.TBNMatrix, d.worldSpaceViewDir); + d.texcoord0 = i.texcoord0; + d.texcoord1 = i.texcoord1; + d.texcoord2 = i.texcoord2; + + // #if %TEXCOORD3REQUIREKEY% + d.texcoord3 = i.texcoord3; + // #endif + + // d.isFrontFace = facing; + // #if %VERTEXCOLORREQUIREKEY% + d.vertexColor = i.vertexColor; + // #endif + + // these rarely get used, so we back transform them. Usually will be stripped. + #if _HDRP + // d.localSpacePosition = mul(GetWorldToObjectMatrix(), float4(GetCameraRelativePositionWS(i.worldPos), 1)).xyz; + #else + // d.localSpacePosition = mul(GetWorldToObjectMatrix(), float4(i.worldPos, 1)).xyz; + #endif + // d.localSpaceNormal = normalize(mul((float3x3)GetWorldToObjectMatrix(), i.worldNormal)); + // d.localSpaceTangent = normalize(mul((float3x3)GetWorldToObjectMatrix(), i.worldTangent.xyz)); + + // #if %SCREENPOSREQUIREKEY% + // d.screenPos = i.screenPos; + // d.screenUV = (i.screenPos.xy / i.screenPos.w); + // #endif + + + // #if %EXTRAV2F0REQUIREKEY% + // d.extraV2F0 = i.extraV2F0; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // d.extraV2F1 = i.extraV2F1; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // d.extraV2F2 = i.extraV2F2; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // d.extraV2F3 = i.extraV2F3; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // d.extraV2F4 = i.extraV2F4; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // d.extraV2F5 = i.extraV2F5; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // d.extraV2F6 = i.extraV2F6; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // d.extraV2F7 = i.extraV2F7; + // #endif + + return d; + } + +#endif + + + #if defined(_PASSSHADOW) + float3 _LightDirection; + float3 _LightPosition; + #endif + + // vertex shader + VertexToPixel Vert (VertexData v) + { + + VertexToPixel o = (VertexToPixel)0; + + UNITY_SETUP_INSTANCE_ID(v); + UNITY_TRANSFER_INSTANCE_ID(v, o); + UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o); + + +#if !_TESSELLATION_ON + ChainModifyVertex(v, o, _Time); +#endif + + o.texcoord0 = v.texcoord0; + o.texcoord1 = v.texcoord1; + o.texcoord2 = v.texcoord2; + + // #if %TEXCOORD3REQUIREKEY% + o.texcoord3 = v.texcoord3; + // #endif + + // #if %VERTEXCOLORREQUIREKEY% + o.vertexColor = v.vertexColor; + // #endif + + VertexPositionInputs vertexInput = GetVertexPositionInputs(v.vertex.xyz); + o.worldPos = TransformObjectToWorld(v.vertex.xyz); + o.worldNormal = TransformObjectToWorldNormal(v.normal); + o.worldTangent = float4(TransformObjectToWorldDir(v.tangent.xyz), v.tangent.w); + + // For some very odd reason, in 2021.2, we can't use Unity's defines, but have to use our own.. + #if _PASSSHADOW + #if _CASTING_PUNCTUAL_LIGHT_SHADOW + float3 lightDirectionWS = normalize(_LightPosition - o.worldPos); + #else + float3 lightDirectionWS = _LightDirection; + #endif + // Define shadow pass specific clip position for Universal + o.pos = TransformWorldToHClip(ApplyShadowBias(o.worldPos, o.worldNormal, lightDirectionWS)); + #if UNITY_REVERSED_Z + o.pos.z = min(o.pos.z, UNITY_NEAR_CLIP_VALUE); + #else + o.pos.z = max(o.pos.z, UNITY_NEAR_CLIP_VALUE); + #endif + #elif _PASSMETA + o.pos = MetaVertexPosition(float4(v.vertex.xyz, 0), v.texcoord1.xy, v.texcoord2.xy, unity_LightmapST, unity_DynamicLightmapST); + #else + o.pos = TransformWorldToHClip(o.worldPos); + #endif + + // #if %SCREENPOSREQUIREKEY% + // o.screenPos = ComputeScreenPos(o.pos, _ProjectionParams.x); + // #endif + + #if _PASSFORWARD || _PASSGBUFFER + float2 uv1 = v.texcoord1.xy; + OUTPUT_LIGHTMAP_UV(uv1, unity_LightmapST, o.lightmapUV); + o.texcoord1.xy = uv1; + OUTPUT_SH(o.worldNormal, o.sh); + #if defined(DYNAMICLIGHTMAP_ON) + o.dynamicLightmapUV.xy = v.texcoord2.xy * unity_DynamicLightmapST.xy + unity_DynamicLightmapST.zw; + #endif + #endif + + #ifdef VARYINGS_NEED_FOG_AND_VERTEX_LIGHT + half fogFactor = 0; + #if defined(_FOG_FRAGMENT) + fogFactor = ComputeFogFactor(o.pos.z); + #endif + #if _BAKEDLIT + o.fogFactorAndVertexLight = half4(fogFactor, 0, 0, 0); + #else + half3 vertexLight = VertexLighting(o.worldPos, o.worldNormal); + o.fogFactorAndVertexLight = half4(fogFactor, vertexLight); + #endif + #endif + + #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR) + o.shadowCoord = GetShadowCoord(vertexInput); + #endif + + return o; + } + + + + + // fragment shader + half4 Frag (VertexToPixel IN + #if NEED_FACING + , bool facing : SV_IsFrontFace + #endif + ) : SV_Target + { + UNITY_SETUP_INSTANCE_ID(IN); + + ShaderData d = CreateShaderData(IN + #if NEED_FACING + , facing + #endif + ); + + Surface l = (Surface)0; + + l.Albedo = half3(0.5, 0.5, 0.5); + l.Normal = float3(0,0,1); + l.Occlusion = 1; + l.Alpha = 1; + + ChainSurfaceFunction(l, d); + + MetaInput metaInput = (MetaInput)0; + metaInput.Albedo = l.Albedo; + metaInput.Emission = l.Emission; + + return MetaFragment(metaInput); + + } + + ENDHLSL + + } + + + + Pass + { + Name "DepthNormals" + Tags + { + "LightMode" = "DepthNormals" + } + + // Render State + Cull Back + ZTest LEqual + ZWrite On + + Tags { "RenderType" = "Opaque" "Queue" = "Geometry" "PreviewType" = "Plane" } + Cull [_CullingOption] + ZWrite [_ZWrite] + ZTest [_ZTestMode] + + + HLSLPROGRAM + + #pragma vertex Vert + #pragma fragment Frag + + #pragma target 3.0 + + #pragma prefer_hlslcc gles + #pragma exclude_renderers d3d11_9x + #pragma multi_compile_fog + #pragma multi_compile_instancing + #pragma multi_compile _ DOTS_INSTANCING_ON + + + #define SHADERPASS SHADERPASS_DEPTHNORMALSONLY + #define _PASSDEPTH 1 + #define _PASSDEPTHNORMALS 1 + + + + #pragma shader_feature_local GLOW_ON + #pragma shader_feature_local FADE_ON + #pragma shader_feature_local OUTBASE_ON + #pragma shader_feature_local ONLYOUTLINE_ON + #pragma shader_feature_local GRADIENT_ON + #pragma shader_feature_local GRADIENT2COL_ON + #pragma shader_feature_local RADIALGRADIENT_ON + #pragma shader_feature_local COLORSWAP_ON + #pragma shader_feature_local HSV_ON + #pragma shader_feature_local CHANGECOLOR_ON + #pragma shader_feature_local CHANGECOLOR2_ON + #pragma shader_feature_local CHANGECOLOR3_ON + #pragma shader_feature_local COLORRAMP_ON + #pragma shader_feature_local GRADIENTCOLORRAMP_ON + #pragma shader_feature_local HITEFFECT_ON + #pragma shader_feature_local NEGATIVE_ON + #pragma shader_feature_local PIXELATE_ON + #pragma shader_feature_local GREYSCALE_ON + #pragma shader_feature_local POSTERIZE_ON + #pragma shader_feature_local BLUR_ON + #pragma shader_feature_local MOTIONBLUR_ON + #pragma shader_feature_local GHOST_ON + #pragma shader_feature_local ALPHAOUTLINE_ON + #pragma shader_feature_local INNEROUTLINE_ON + #pragma shader_feature_local ONLYINNEROUTLINE_ON + #pragma shader_feature_local HOLOGRAM_ON + #pragma shader_feature_local CHROMABERR_ON + #pragma shader_feature_local GLITCH_ON + #pragma shader_feature_local FLICKER_ON + #pragma shader_feature_local SHADOW_ON + #pragma shader_feature_local SHINE_ON + #pragma shader_feature_local CONTRAST_ON + #pragma shader_feature_local OVERLAY_ON + #pragma shader_feature_local OVERLAYMULT_ON + #pragma shader_feature_local DOODLE_ON + #pragma shader_feature_local WIND_ON + #pragma shader_feature_local WAVEUV_ON + #pragma shader_feature_local ROUNDWAVEUV_ON + #pragma shader_feature_local RECTSIZE_ON + #pragma shader_feature_local OFFSETUV_ON + #pragma shader_feature_local CLIPPING_ON + #pragma shader_feature_local RADIALCLIPPING_ON + #pragma shader_feature_local TEXTURESCROLL_ON + #pragma shader_feature_local ZOOMUV_ON + #pragma shader_feature_local DISTORT_ON + #pragma shader_feature_local WARP_ON + #pragma shader_feature_local TWISTUV_ON + #pragma shader_feature_local ROTATEUV_ON + #pragma shader_feature_local POLARUV_ON + #pragma shader_feature_local FISHEYE_ON + #pragma shader_feature_local PINCH_ON + #pragma shader_feature_local SHAKEUV_ON + + #pragma shader_feature_local GLOWTEX_ON + #pragma shader_feature_local OUTTEX_ON + #pragma shader_feature_local OUTDIST_ON + #pragma shader_feature_local OUTBASE8DIR_ON + #pragma shader_feature_local OUTBASEPIXELPERF_ON + #pragma shader_feature_local COLORRAMPOUTLINE_ON + #pragma shader_feature_local GREYSCALEOUTLINE_ON + #pragma shader_feature_local POSTERIZEOUTLINE_ON + #pragma shader_feature_local BLURISHD_ON + #pragma shader_feature_local MANUALWIND_ON + #pragma shader_feature_local ATLAS_ON + #pragma shader_feature_local PREMULTIPLYALPHA_ON + + #pragma shader_feature BILBOARD_ON + #pragma shader_feature BILBOARDY_ON + + #pragma shader_feature NORMALMAP_ON + + + #define _URP 1 +#define _USINGTEXCOORD1 1 +#define _USINGTEXCOORD2 1 + + + // this has to be here or specular color will be ignored. Not in SG code + #if _SIMPLELIT + #define _SPECULAR_COLOR + #endif + + + // Includes + #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Version.hlsl" + #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Color.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.shadergraph/ShaderGraphLibrary/ShaderVariablesFunctions.hlsl" + + + + + + #undef WorldNormalVector + #define WorldNormalVector(data, normal) mul(normal, data.TBNMatrix) + + #define UnityObjectToWorldNormal(normal) mul(GetObjectToWorldMatrix(), normal) + + #define _WorldSpaceLightPos0 _MainLightPosition + + #define UNITY_DECLARE_TEX2D(name) TEXTURE2D(name); SAMPLER(sampler##name); + #define UNITY_DECLARE_TEX2D_NOSAMPLER(name) TEXTURE2D(name); + #define UNITY_DECLARE_TEX2DARRAY(name) TEXTURE2D_ARRAY(name); SAMPLER(sampler##name); + #define UNITY_DECLARE_TEX2DARRAY_NOSAMPLER(name) TEXTURE2D_ARRAY(name); + + #define UNITY_SAMPLE_TEX2DARRAY(tex,coord) SAMPLE_TEXTURE2D_ARRAY(tex, sampler##tex, coord.xy, coord.z) + #define UNITY_SAMPLE_TEX2DARRAY_LOD(tex,coord,lod) SAMPLE_TEXTURE2D_ARRAY_LOD(tex, sampler##tex, coord.xy, coord.z, lod) + #define UNITY_SAMPLE_TEX2D(tex, coord) SAMPLE_TEXTURE2D(tex, sampler##tex, coord) + #define UNITY_SAMPLE_TEX2D_SAMPLER(tex, samp, coord) SAMPLE_TEXTURE2D(tex, sampler##samp, coord) + + #define UNITY_SAMPLE_TEX2D_LOD(tex,coord, lod) SAMPLE_TEXTURE2D_LOD(tex, sampler_##tex, coord, lod) + #define UNITY_SAMPLE_TEX2D_SAMPLER_LOD(tex,samplertex,coord, lod) SAMPLE_TEXTURE2D_LOD (tex, sampler##samplertex,coord, lod) + + #if defined(UNITY_COMPILER_HLSL) + #define UNITY_INITIALIZE_OUTPUT(type,name) name = (type)0; + #else + #define UNITY_INITIALIZE_OUTPUT(type,name) + #endif + + #define sampler2D_float sampler2D + #define sampler2D_half sampler2D + + + + // data across stages, stripped like the above. + struct VertexToPixel + { + float4 pos : SV_POSITION; + float3 worldPos : TEXCOORD0; + float3 worldNormal : TEXCOORD1; + float4 worldTangent : TEXCOORD2; + float4 texcoord0 : TEXCOORD3; + float4 texcoord1 : TEXCOORD4; + float4 texcoord2 : TEXCOORD5; + + // #if %TEXCOORD3REQUIREKEY% + float4 texcoord3 : TEXCOORD6; + // #endif + + // #if %SCREENPOSREQUIREKEY% + // float4 screenPos : TEXCOORD7; + // #endif + + // #if %VERTEXCOLORREQUIREKEY% + half4 vertexColor : COLOR; + // #endif + + #if defined(LIGHTMAP_ON) + float2 lightmapUV : TEXCOORD8; + #endif + #if defined(DYNAMICLIGHTMAP_ON) + float2 dynamicLightmapUV : TEXCOORD9; + #endif + #if !defined(LIGHTMAP_ON) + float3 sh : TEXCOORD10; + #endif + + #if defined(VARYINGS_NEED_FOG_AND_VERTEX_LIGHT) + float4 fogFactorAndVertexLight : TEXCOORD11; + #endif + + #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR) + float4 shadowCoord : TEXCOORD12; + #endif + + // #if %EXTRAV2F0REQUIREKEY% + // float4 extraV2F0 : TEXCOORD13; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // float4 extraV2F1 : TEXCOORD14; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // float4 extraV2F2 : TEXCOORD15; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // float4 extraV2F3 : TEXCOORD16; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // float4 extraV2F4 : TEXCOORD17; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // float4 extraV2F5 : TEXCOORD18; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // float4 extraV2F6 : TEXCOORD19; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // float4 extraV2F7 : TEXCOORD20; + // #endif + + #if UNITY_ANY_INSTANCING_ENABLED + uint instanceID : CUSTOM_INSTANCE_ID; + #endif + #if (defined(UNITY_STEREO_MULTIVIEW_ENABLED)) || (defined(UNITY_STEREO_INSTANCING_ENABLED) && (defined(SHADER_API_GLES3) || defined(SHADER_API_GLCORE))) + uint stereoTargetEyeIndexAsBlendIdx0 : BLENDINDICES0; + #endif + #if (defined(UNITY_STEREO_INSTANCING_ENABLED)) + uint stereoTargetEyeIndexAsRTArrayIdx : SV_RenderTargetArrayIndex; + #endif + #if defined(SHADER_STAGE_FRAGMENT) && defined(VARYINGS_NEED_CULLFACE) + FRONT_FACE_TYPE cullFace : FRONT_FACE_SEMANTIC; + #endif + + + }; + + + + + // data describing the user output of a pixel + struct Surface + { + half3 Albedo; + half Height; + half3 Normal; + half Smoothness; + half3 Emission; + half Metallic; + half3 Specular; + half Occlusion; + half SpecularPower; // for simple lighting + half Alpha; + float outputDepth; // if written, SV_Depth semantic is used. ShaderData.clipPos.z is unused value + // HDRP Only + half SpecularOcclusion; + half SubsurfaceMask; + half Thickness; + half CoatMask; + half CoatSmoothness; + half Anisotropy; + half IridescenceMask; + half IridescenceThickness; + int DiffusionProfileHash; + float SpecularAAThreshold; + float SpecularAAScreenSpaceVariance; + // requires _OVERRIDE_BAKEDGI to be defined, but is mapped in all pipelines + float3 DiffuseGI; + float3 BackDiffuseGI; + float3 SpecularGI; + float ior; + float3 transmittanceColor; + float atDistance; + float transmittanceMask; + // requires _OVERRIDE_SHADOWMASK to be defines + float4 ShadowMask; + + // for decals + float NormalAlpha; + float MAOSAlpha; + + + }; + + // Data the user declares in blackboard blocks + struct Blackboard + { + + float blackboardDummyData; + }; + + // data the user might need, this will grow to be big. But easy to strip + struct ShaderData + { + float4 clipPos; // SV_POSITION + float3 localSpacePosition; + float3 localSpaceNormal; + float3 localSpaceTangent; + + float3 worldSpacePosition; + float3 worldSpaceNormal; + float3 worldSpaceTangent; + float tangentSign; + + float3 worldSpaceViewDir; + float3 tangentSpaceViewDir; + + float4 texcoord0; + float4 texcoord1; + float4 texcoord2; + float4 texcoord3; + + float2 screenUV; + float4 screenPos; + + float4 vertexColor; + bool isFrontFace; + + float4 extraV2F0; + float4 extraV2F1; + float4 extraV2F2; + float4 extraV2F3; + float4 extraV2F4; + float4 extraV2F5; + float4 extraV2F6; + float4 extraV2F7; + + float3x3 TBNMatrix; + Blackboard blackboard; + }; + + struct VertexData + { + #if SHADER_TARGET > 30 + // uint vertexID : SV_VertexID; + #endif + float4 vertex : POSITION; + float3 normal : NORMAL; + float4 tangent : TANGENT; + float4 texcoord0 : TEXCOORD0; + + // optimize out mesh coords when not in use by user or lighting system + #if _URP && (_USINGTEXCOORD1 || _PASSMETA || _PASSFORWARD || _PASSGBUFFER) + float4 texcoord1 : TEXCOORD1; + #endif + + #if _URP && (_USINGTEXCOORD2 || _PASSMETA || ((_PASSFORWARD || _PASSGBUFFER) && defined(DYNAMICLIGHTMAP_ON))) + float4 texcoord2 : TEXCOORD2; + #endif + + #if _STANDARD && (_USINGTEXCOORD1 || (_PASSMETA || ((_PASSFORWARD || _PASSGBUFFER || _PASSFORWARDADD) && LIGHTMAP_ON))) + float4 texcoord1 : TEXCOORD1; + #endif + #if _STANDARD && (_USINGTEXCOORD2 || (_PASSMETA || ((_PASSFORWARD || _PASSGBUFFER) && DYNAMICLIGHTMAP_ON))) + float4 texcoord2 : TEXCOORD2; + #endif + + + #if _HDRP + float4 texcoord1 : TEXCOORD1; + float4 texcoord2 : TEXCOORD2; + #endif + + // #if %TEXCOORD3REQUIREKEY% + float4 texcoord3 : TEXCOORD3; + // #endif + + // #if %VERTEXCOLORREQUIREKEY% + float4 vertexColor : COLOR; + // #endif + + #if _PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR)) + float3 previousPositionOS : TEXCOORD4; // Contain previous transform position (in case of skinning for example) + #if defined (_ADD_PRECOMPUTED_VELOCITY) + float3 precomputedVelocity : TEXCOORD5; // Add Precomputed Velocity (Alembic computes velocities on runtime side). + #endif + #endif + + UNITY_VERTEX_INPUT_INSTANCE_ID + }; + + struct TessVertex + { + float4 vertex : INTERNALTESSPOS; + float3 normal : NORMAL; + float4 tangent : TANGENT; + float4 texcoord0 : TEXCOORD0; + float4 texcoord1 : TEXCOORD1; + float4 texcoord2 : TEXCOORD2; + + // #if %TEXCOORD3REQUIREKEY% + float4 texcoord3 : TEXCOORD3; + // #endif + + // #if %VERTEXCOLORREQUIREKEY% + float4 vertexColor : COLOR; + // #endif + + // #if %EXTRAV2F0REQUIREKEY% + // float4 extraV2F0 : TEXCOORD5; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // float4 extraV2F1 : TEXCOORD6; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // float4 extraV2F2 : TEXCOORD7; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // float4 extraV2F3 : TEXCOORD8; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // float4 extraV2F4 : TEXCOORD9; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // float4 extraV2F5 : TEXCOORD10; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // float4 extraV2F6 : TEXCOORD11; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // float4 extraV2F7 : TEXCOORD12; + // #endif + + #if _PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR)) + float3 previousPositionOS : TEXCOORD13; // Contain previous transform position (in case of skinning for example) + #if defined (_ADD_PRECOMPUTED_VELOCITY) + float3 precomputedVelocity : TEXCOORD14; + #endif + #endif + + UNITY_VERTEX_INPUT_INSTANCE_ID + UNITY_VERTEX_OUTPUT_STEREO + }; + + struct ExtraV2F + { + float4 extraV2F0; + float4 extraV2F1; + float4 extraV2F2; + float4 extraV2F3; + float4 extraV2F4; + float4 extraV2F5; + float4 extraV2F6; + float4 extraV2F7; + Blackboard blackboard; + float4 time; + }; + + + float3 WorldToTangentSpace(ShaderData d, float3 normal) + { + return mul(d.TBNMatrix, normal); + } + + float3 TangentToWorldSpace(ShaderData d, float3 normal) + { + return mul(normal, d.TBNMatrix); + } + + // in this case, make standard more like SRPs, because we can't fix + // unity_WorldToObject in HDRP, since it already does macro-fu there + + #if _STANDARD + float3 TransformWorldToObject(float3 p) { return mul(unity_WorldToObject, float4(p, 1)); }; + float3 TransformObjectToWorld(float3 p) { return mul(unity_ObjectToWorld, float4(p, 1)); }; + float4 TransformWorldToObject(float4 p) { return mul(unity_WorldToObject, p); }; + float4 TransformObjectToWorld(float4 p) { return mul(unity_ObjectToWorld, p); }; + float4x4 GetWorldToObjectMatrix() { return unity_WorldToObject; } + float4x4 GetObjectToWorldMatrix() { return unity_ObjectToWorld; } + #if (defined(SHADER_API_D3D11) || defined(SHADER_API_XBOXONE) || defined(UNITY_COMPILER_HLSLCC) || defined(SHADER_API_PSSL) || (SHADER_TARGET_SURFACE_ANALYSIS && !SHADER_TARGET_SURFACE_ANALYSIS_MOJOSHADER)) + #define UNITY_SAMPLE_TEX2D_LOD(tex,coord, lod) tex.SampleLevel (sampler##tex,coord, lod) + #define UNITY_SAMPLE_TEX2D_SAMPLER_LOD(tex,samplertex,coord, lod) tex.SampleLevel (sampler##samplertex,coord, lod) + #else + #define UNITY_SAMPLE_TEX2D_LOD(tex,coord,lod) tex2D (tex,coord,0,lod) + #define UNITY_SAMPLE_TEX2D_SAMPLER_LOD(tex,samplertex,coord,lod) tex2D (tex,coord,0,lod) + #endif + + #undef GetWorldToObjectMatrix() + + #define GetWorldToObjectMatrix() unity_WorldToObject + + + #endif + + float3 GetCameraWorldPosition() + { + #if _HDRP + return GetCameraRelativePositionWS(_WorldSpaceCameraPos); + #else + return _WorldSpaceCameraPos; + #endif + } + + #if _GRABPASSUSED + #if _STANDARD + TEXTURE2D(%GRABTEXTURE%); + SAMPLER(sampler_%GRABTEXTURE%); + #endif + + half3 GetSceneColor(float2 uv) + { + #if _STANDARD + return SAMPLE_TEXTURE2D(%GRABTEXTURE%, sampler_%GRABTEXTURE%, uv).rgb; + #else + return SHADERGRAPH_SAMPLE_SCENE_COLOR(uv); + #endif + } + #endif + + + + #if _STANDARD + UNITY_DECLARE_DEPTH_TEXTURE(_CameraDepthTexture); + float GetSceneDepth(float2 uv) { return SAMPLE_DEPTH_TEXTURE(_CameraDepthTexture, uv); } + float GetLinear01Depth(float2 uv) { return Linear01Depth(GetSceneDepth(uv)); } + float GetLinearEyeDepth(float2 uv) { return LinearEyeDepth(GetSceneDepth(uv)); } + #else + float GetSceneDepth(float2 uv) { return SHADERGRAPH_SAMPLE_SCENE_DEPTH(uv); } + float GetLinear01Depth(float2 uv) { return Linear01Depth(GetSceneDepth(uv), _ZBufferParams); } + float GetLinearEyeDepth(float2 uv) { return LinearEyeDepth(GetSceneDepth(uv), _ZBufferParams); } + #endif + + float3 GetWorldPositionFromDepthBuffer(float2 uv, float3 worldSpaceViewDir) + { + float eye = GetLinearEyeDepth(uv); + float3 camView = mul((float3x3)GetObjectToWorldMatrix(), transpose(mul(GetWorldToObjectMatrix(), UNITY_MATRIX_I_V)) [2].xyz); + + float dt = dot(worldSpaceViewDir, camView); + float3 div = worldSpaceViewDir/dt; + float3 wpos = (eye * div) + GetCameraWorldPosition(); + return wpos; + } + + #if _HDRP + float3 ObjectToWorldSpacePosition(float3 pos) + { + return GetAbsolutePositionWS(TransformObjectToWorld(pos)); + } + #else + float3 ObjectToWorldSpacePosition(float3 pos) + { + return TransformObjectToWorld(pos); + } + #endif + + #if _STANDARD + UNITY_DECLARE_SCREENSPACE_TEXTURE(_CameraDepthNormalsTexture); + float3 GetSceneNormal(float2 uv, float3 worldSpaceViewDir) + { + float4 depthNorms = UNITY_SAMPLE_SCREENSPACE_TEXTURE(_CameraDepthNormalsTexture, uv); + float3 norms = DecodeViewNormalStereo(depthNorms); + norms = mul((float3x3)GetWorldToViewMatrix(), norms) * 0.5 + 0.5; + return norms; + } + #elif _HDRP && !_DECALSHADER + + float3 GetSceneNormal(float2 uv, float3 worldSpaceViewDir) + { + NormalData nd; + DecodeFromNormalBuffer(_ScreenSize.xy * uv, nd); + return nd.normalWS; + } + #elif _URP + #if (SHADER_LIBRARY_VERSION_MAJOR >= 10) + #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/DeclareNormalsTexture.hlsl" + #endif + + float3 GetSceneNormal(float2 uv, float3 worldSpaceViewDir) + { + #if (SHADER_LIBRARY_VERSION_MAJOR >= 10) + return SampleSceneNormals(uv); + #else + float3 wpos = GetWorldPositionFromDepthBuffer(uv, worldSpaceViewDir); + return normalize(-cross(ddx(wpos), ddy(wpos))) * 0.5 + 0.5; + #endif + + } + #endif + + #if _HDRP + + half3 UnpackNormalmapRGorAG(half4 packednormal) + { + // This do the trick + packednormal.x *= packednormal.w; + + half3 normal; + normal.xy = packednormal.xy * 2 - 1; + normal.z = sqrt(1 - saturate(dot(normal.xy, normal.xy))); + return normal; + } + half3 UnpackNormal(half4 packednormal) + { + #if defined(UNITY_NO_DXT5nm) + return packednormal.xyz * 2 - 1; + #else + return UnpackNormalmapRGorAG(packednormal); + #endif + } + #endif + #if _HDRP || _URP + + half3 UnpackScaleNormal(half4 packednormal, half scale) + { + #ifndef UNITY_NO_DXT5nm + // Unpack normal as DXT5nm (1, y, 1, x) or BC5 (x, y, 0, 1) + // Note neutral texture like "bump" is (0, 0, 1, 1) to work with both plain RGB normal and DXT5nm/BC5 + packednormal.x *= packednormal.w; + #endif + half3 normal; + normal.xy = (packednormal.xy * 2 - 1) * scale; + normal.z = sqrt(1 - saturate(dot(normal.xy, normal.xy))); + return normal; + } + + #endif + + + void GetSun(out float3 lightDir, out float3 color) + { + lightDir = float3(0.5, 0.5, 0); + color = 1; + #if _HDRP + if (_DirectionalLightCount > 0) + { + DirectionalLightData light = _DirectionalLightDatas[0]; + lightDir = -light.forward.xyz; + color = light.color; + } + #elif _STANDARD + lightDir = normalize(_WorldSpaceLightPos0.xyz); + color = _LightColor0.rgb; + #elif _URP + Light light = GetMainLight(); + lightDir = light.direction; + color = light.color; + #endif + } + + + + CBUFFER_START(UnityPerMaterial) + + + half4 _Color; + half4 _MainTex_ST, _MainTex_TexelSize; + half _Alpha, _AlphaCutoffValue; + + #if ATLAS_ON + half _MinXUV, _MaxXUV, _MinYUV, _MaxYUV; + #endif + + #if GLOW_ON + half4 _GlowColor; + half _Glow, _GlowGlobal; + #endif + + #if HSV_ON + half _HsvShift, _HsvSaturation, _HsvBright; + #endif + + #if DISTORT_ON + half4 _DistortTex_ST; + half _DistortTexXSpeed, _DistortTexYSpeed, _DistortAmount; + #endif + + #if FADE_ON + half4 _FadeBurnColor, _FadeTex_ST, _FadeBurnTex_ST; + half _FadeAmount, _FadeBurnWidth, _FadeBurnTransition,_FadeBurnGlow; + #endif + + #if OUTBASE_ON + half4 _OutlineColor; + half _OutlineAlpha, _OutlineGlow, _OutlineWidth; + int _OutlinePixelWidth; + #endif + + #if OUTTEX_ON + half4 _OutlineTex_ST; + half _OutlineTexXSpeed, _OutlineTexYSpeed; + #endif + + #if OUTDIST_ON + half4 _OutlineDistortTex_ST; + half _OutlineDistortTexXSpeed, _OutlineDistortTexYSpeed, _OutlineDistortAmount; + #endif + + #if ALPHAOUTLINE_ON + half _AlphaOutlineGlow, _AlphaOutlinePower, _AlphaOutlineMinAlpha, _AlphaOutlineBlend; + half4 _AlphaOutlineColor; + #endif + + #if INNEROUTLINE_ON + half _InnerOutlineThickness, _InnerOutlineAlpha, _InnerOutlineGlow; + half4 _InnerOutlineColor; + #endif + + #if GRADIENT_ON + half _GradBlend, _GradBoostX, _GradBoostY; + half4 _GradTopRightCol, _GradTopLeftCol, _GradBotRightCol, _GradBotLeftCol; + #endif + + #if COLORSWAP_ON + half4 _ColorSwapRed, _ColorSwapGreen, _ColorSwapBlue; + half _ColorSwapRedLuminosity, _ColorSwapGreenLuminosity, _ColorSwapBlueLuminosity, _ColorSwapBlend; + #endif + + #if CHANGECOLOR_ON + half4 _ColorChangeNewCol, _ColorChangeTarget; + half _ColorChangeTolerance, _ColorChangeLuminosity; + #endif + #if CHANGECOLOR2_ON + half4 _ColorChangeNewCol2, _ColorChangeTarget2; + half _ColorChangeTolerance2; + #endif + #if CHANGECOLOR3_ON + half4 _ColorChangeNewCol3, _ColorChangeTarget3; + half _ColorChangeTolerance3; + #endif + + #if COLORRAMP_ON + half _ColorRampLuminosity, _ColorRampBlend; + #endif + + #if HITEFFECT_ON + half4 _HitEffectColor; + half _HitEffectGlow, _HitEffectBlend; + #endif + + #if NEGATIVE_ON + half _NegativeAmount; + #endif + + #if PIXELATE_ON + half _PixelateSize; + #endif + + #if GREYSCALE_ON + half _GreyscaleLuminosity, _GreyscaleBlend; + half4 _GreyscaleTintColor; + #endif + + #if POSTERIZE_ON + half _PosterizeNumColors, _PosterizeGamma; + #endif + + #if BLUR_ON + half _BlurIntensity; + #endif + + #if MOTIONBLUR_ON + half _MotionBlurAngle, _MotionBlurDist; + #endif + + #if GHOST_ON + half _GhostColorBoost, _GhostTransparency, _GhostBlend; + #endif + + #if HOLOGRAM_ON + half _HologramStripesAmount, _HologramMinAlpha, _HologramUnmodAmount, _HologramStripesSpeed, _HologramMaxAlpha, _HologramBlend; + half4 _HologramStripeColor; + #endif + + #if CHROMABERR_ON + half _ChromAberrAmount, _ChromAberrAlpha; + #endif + + #if GLITCH_ON + half _GlitchAmount, _GlitchSize; + #endif + + #if FLICKER_ON + half _FlickerFreq, _FlickerPercent, _FlickerAlpha; + #endif + + #if SHADOW_ON + half _ShadowX, _ShadowY, _ShadowAlpha; + half4 _ShadowColor; + #endif + + #if SHINE_ON + half4 _ShineColor; + half _ShineLocation, _ShineRotate, _ShineWidth, _ShineGlow; + #endif + + #if CONTRAST_ON + half _Contrast, _Brightness; + #endif + + #if OVERLAY_ON + half4 _OverlayTex_ST, _OverlayColor; + half _OverlayGlow, _OverlayBlend, _OverlayTextureScrollXSpeed, _OverlayTextureScrollYSpeed; + #endif + + #if DOODLE_ON + half _HandDrawnAmount, _HandDrawnSpeed; + #endif + + #if WIND_ON + half _GrassSpeed, _GrassWind, _GrassManualAnim, _GrassRadialBend; + #endif + + #if WAVEUV_ON + float _WaveAmount, _WaveSpeed, _WaveStrength, _WaveX, _WaveY; + #endif + + #if ROUNDWAVEUV_ON + half _RoundWaveStrength, _RoundWaveSpeed; + #endif + + #if RECTSIZE_ON + half _RectSize; + #endif + + #if OFFSETUV_ON + half _OffsetUvX, _OffsetUvY; + #endif + + #if CLIPPING_ON + half _ClipUvLeft, _ClipUvRight, _ClipUvUp, _ClipUvDown; + #endif + + #if RADIALCLIPPING_ON + half _RadialStartAngle, _RadialClip, _RadialClip2; + #endif + + #if TEXTURESCROLL_ON + half _TextureScrollXSpeed, _TextureScrollYSpeed; + #endif + + #if ZOOMUV_ON + half _ZoomUvAmount; + #endif + + #if WARP_ON + half _WarpStrength, _WarpSpeed, _WarpScale; + #endif + + #if TWISTUV_ON + half _TwistUvAmount, _TwistUvPosX, _TwistUvPosY, _TwistUvRadius; + #endif + + #if ROTATEUV_ON + half _RotateUvAmount; + #endif + + #if FISHEYE_ON + half _FishEyeUvAmount; + #endif + + #if PINCH_ON + half _PinchUvAmount; + #endif + + #if SHAKEUV_ON + half _ShakeUvSpeed, _ShakeUvX, _ShakeUvY; + #endif + + #if NORMALMAP_ON + half _NormalStrength; + #endif + + float _RandomSeed; + + + + + CBUFFER_END + + + + + + + + TEXTURE2D(_MainTex); + SAMPLER(sampler_MainTex); + + #if GLOW_ON + TEXTURE2D(_GlowTex); + SAMPLER(sampler_GlowTex); + #endif + + #if FADE_ON + TEXTURE2D(_FadeTex); + SAMPLER(sampler_FadeTex); + + TEXTURE2D(_FadeBurnTex); + SAMPLER(sampler_FadeBurnTex); + #endif + + #if DISTORT_ON + TEXTURE2D(_DistortTex); + SAMPLER(sampler_DistortTex); + #endif + + #if OUTTEX_ON + TEXTURE2D(_OutlineTex); + SAMPLER(sampler_OutlineTex); + #endif + + #if OUTDIST_ON + TEXTURE2D(_OutlineDistortTex); + SAMPLER(sampler_OutlineDistortTex); + #endif + + #if COLORSWAP_ON + TEXTURE2D(_ColorSwapTex); + SAMPLER(sampler_ColorSwapTex); + #endif + + #if COLORRAMP_ON + TEXTURE2D(_ColorRampTex); + TEXTURE2D(_ColorRampTexGradient); + SAMPLER(sampler_ColorRampTex); + SAMPLER(sampler_ColorRampTexGradient); + #endif + + #if SHINE_ON + TEXTURE2D(_ShineMask); + SAMPLER(sampler_ShineMask); + #endif + + #if OVERLAY_ON + TEXTURE2D(_OverlayTex); + SAMPLER(sampler_OverlayTex); + #endif + + #if NORMALMAP_ON + TEXTURE2D(_NormalMap); + SAMPLER(sampler_NormalMap); + #endif + + + half3 GetPixel(in int offsetX, in int offsetY, in half2 uv, in Texture2D _tex, in SamplerState _sampler) + { + half2 _uv = uv + half2(offsetX * _MainTex_TexelSize.x, offsetY * _MainTex_TexelSize.y); + half4 col = SAMPLE_TEXTURE2D(_tex, _sampler, _uv); + return col.rgb; + } + + + //BLURS------------------------------------------------------------------------- + half4 Blur(half2 uv, Texture2D source, SamplerState sampler_source, half Intensity) + { + const half2 texelSize = 1.0 / _ScreenParams.xy; + const half4 color = SAMPLE_TEXTURE2D(source, sampler_source, uv); + const half2 offset = Intensity * texelSize; + + half4 accumulatedColor = color; + half accumulatedWeight = 1.0; + for (int x = -1; x <= 1; x++) + { + for (int y = -1; y <= 1; y++) + { + const half2 sampleUV = uv + half2(x, y) * offset; + const half4 sampleColor = SAMPLE_TEXTURE2D(source, sampler_source, sampleUV); + + accumulatedColor += sampleColor; + accumulatedWeight += 1.0; + } + } + + half4 blurredColor = accumulatedColor / accumulatedWeight; + return blurredColor; + } + + half BlurHD_G(half bhqp, half x) + { + return exp(-(x * x) / (2.0 * bhqp * bhqp)); + } + half4 BlurHD(half2 uv, Texture2D source, SamplerState sampler_source, half BlurAmount, half xScale, half yScale) + { + int iterations = 16; + int halfIterations = iterations / 2; + half sigmaX = 0.1 + BlurAmount * 0.5; + half sigmaY = sigmaX; + half total = 0.0; + half4 ret = half4(0, 0, 0, 0); + for (int iy = 0; iy < iterations; ++iy) + { + half fy = BlurHD_G(sigmaY, half(iy) -half(halfIterations)); + half offsetY = half(iy - halfIterations) * 0.00390625 * xScale; + for (int ix = 0; ix < iterations; ++ix) + { + half fx = BlurHD_G(sigmaX, half(ix) - half(halfIterations)); + half offsetX = half(ix - halfIterations) * 0.00390625 * yScale; + total += fx * fy; + ret += SAMPLE_TEXTURE2D(source, sampler_source, uv + half2(offsetX, offsetY)) * fx * fy; + } + } + return ret / total; + } + //----------------------------------------------------------------------- + + + //------------------------------------------- + half RemapFloat(half inValue, half inMin, half inMax, half outMin, half outMax){ + return outMin + (inValue - inMin) * (outMax - outMin) / (inMax - inMin); + } + //------------------------------------------- + + //----------------------------------------------------------------------- + half rand(half2 seed, half offset) { + return (frac(sin(dot(seed, half2(12.9898, 78.233))) * 43758.5453) + offset) % 1.0; + } + + half rand2(half2 seed, half offset) { + return (frac(sin(dot(seed * floor(50 + (_Time.x % 1.0) * 12.), half2(127.1, 311.7))) * 43758.5453123) + offset) % 1.0; + } + + half rand2CustomTime(half2 seed, half offset, half customTime) { + return (frac(sin(dot(seed * floor(50 + (customTime % 1.0) * 12.), half2(127.1, 311.7))) * 43758.5453123) + offset) % 1.0; + } + //----------------------------------------------------------------------- + + + void Ext_ModifyVertex0 (inout VertexData v, inout ExtraV2F d) + { + //BILBOARD_ON + #if BILBOARD_ON + half3 camRight = mul((half3x3)unity_CameraToWorld, half3(1,0,0)); + half3 camUp = half3(0,1,0); + #if BILBOARDY_ON + camUp = mul((half3x3)unity_CameraToWorld, half3(0,1,0)); + #endif + half3 localPos = v.vertex.x * camRight + v.vertex.y * camUp; + v.vertex = half4(localPos, 1); + #endif + //----------------------------------------------------------- + + v.texcoord0.xy = TRANSFORM_TEX(v.texcoord0.xy, _MainTex); + half2 center = half2(0.5, 0.5); + #if ATLAS_ON + center = half2((_MaxXUV + _MinXUV) / 2.0, (_MaxYUV + _MinYUV) / 2.0); + #endif + + //POLARUV_ON + #if POLARUV_ON + v.texcoord0.xy = v.texcoord0.xy - center; + #endif + + //---------------------------------------- + + //ROTATEUV_ON + #if ROTATEUV_ON + half2 uvC = v.texcoord0.xy; + half cosAngle = cos(_RotateUvAmount); + half sinAngle = sin(_RotateUvAmount); + half2x2 rot = half2x2(cosAngle, -sinAngle, sinAngle, cosAngle); + uvC -= center; + v.texcoord0.xy = mul(rot, uvC); + v.texcoord0.xy += center; + #endif + //-------------------- + + #if RECTSIZE_ON + v.vertex.xyz += (v.vertex.xyz * (_RectSize - 1.0)); + #endif + + #if OUTTEX_ON + v.texcoord1.xy = TRANSFORM_TEX(v.texcoord0.xy, _OutlineTex); + #endif + + #if OUTDIST_ON + v.texcoord2.xy = TRANSFORM_TEX(v.texcoord0.xy, _OutlineDistortTex); + #endif + + #if DISTORT_ON + v.texcoord3.xy = TRANSFORM_TEX(v.texcoord0.xy, _DistortTex); + #endif + } + + void Ext_SurfaceFunction0 (inout Surface o, ShaderData d) + { + half randomSeed = _RandomSeed; + + float2 uvRect = d.texcoord0; + half2 center = half2(0.5, 0.5); + #if ATLAS_ON + center = half2((_MaxXUV + _MinXUV) / 2.0, (_MaxYUV + _MinYUV) / 2.0); + uvRect = half2((d.texcoord0.x - _MinXUV) / (_MaxXUV - _MinXUV), (d.texcoord0.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half2 centerTiled = half2(center.x * _MainTex_ST.x, center.y * _MainTex_ST.y); + + //CLIPPING_ON + #if CLIPPING_ON + half2 tiledUv = half2(d.texcoord0.x / _MainTex_ST.x, d.texcoord0.y / _MainTex_ST.y); + #if ATLAS_ON + tiledUv = half2((tiledUv.x - _MinXUV) / (_MaxXUV - _MinXUV), (tiledUv.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + clip((1 - _ClipUvUp) - tiledUv.y); + clip(tiledUv.y - _ClipUvDown); + clip((1 - _ClipUvRight) - tiledUv.x); + clip(tiledUv.x - _ClipUvLeft); + #endif + //---------------------------------- + + //RADIALCLIPPING_ON + #if RADIALCLIPPING_ON + half2 tiledUv2 = half2(d.texcoord0.x / _MainTex_ST.x, d.texcoord0.y / _MainTex_ST.y); + #if ATLAS_ON + tiledUv2 = half2((tiledUv2.x - _MinXUV) / (_MaxXUV - _MinXUV), (tiledUv2.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half startAngle = _RadialStartAngle - _RadialClip; + half endAngle = _RadialStartAngle + _RadialClip2; + half offset0 = clamp(0, 360, startAngle + 360); + half offset360 = clamp(0, 360, endAngle - 360); + half2 atan2Coord = half2(lerp(-1, 1, tiledUv2.x), lerp(-1, 1, tiledUv2.y)); + half atanAngle = atan2(atan2Coord.y, atan2Coord.x) * 57.3; // angle in degrees + if(atanAngle < 0) atanAngle = 360 + atanAngle; + if(atanAngle >= startAngle && atanAngle <= endAngle) discard; + if(atanAngle <= offset360) discard; + if(atanAngle >= offset0) discard; + #endif + + //----------------------------- + + //TEXTURESCROLL_ON && ATLAS_ON + #if TEXTURESCROLL_ON && ATLAS_ON + d.texcoord0.xy = half2(_MinXUV + ((_MaxXUV - _MinXUV) * (abs(((_Time.y + randomSeed) * _TextureScrollXSpeed) + uvRect.x) % 1)), + _MinYUV + ((_MaxYUV - _MinYUV) * (abs(((_Time.y + randomSeed) * _TextureScrollYSpeed) + uvRect.y) % 1))); + #endif + //---------------------------- + + //OFFSETUV_ON + #if OFFSETUV_ON + #if ATLAS_ON + d.texcoord0.xy = half2(_MinXUV + ((_MaxXUV - _MinXUV) * (abs((_OffsetUvX + uvRect.x) % 1))), + _MinYUV + ((_MaxYUV - _MinYUV) * (abs(_OffsetUvY + uvRect.y) % 1))); + #else + d.texcoord0.xy += half2(_OffsetUvX, _OffsetUvY); + #endif + #endif + + //---------------------- + + //POLARUV_ON + #if POLARUV_ON + d.texcoord0.xy = half2(atan2(d.texcoord0.y, d.texcoord0.x) / (2.0f * 3.141592653589f), length(d.texcoord0.xy)); + d.texcoord0.xy *= _MainTex_ST.xy; + #endif + + //-------------------------------------- + + //TWISTUV_ON + #if TWISTUV_ON + #if ATLAS_ON + _TwistUvPosX = ((_MaxXUV - _MinXUV) * _TwistUvPosX) + _MinXUV; + _TwistUvPosY = ((_MaxYUV - _MinYUV) * _TwistUvPosY) + _MinYUV; + #endif + half2 tempUv = d.texcoord0.xy - half2(_TwistUvPosX * _MainTex_ST.x, _TwistUvPosY * _MainTex_ST.y); + _TwistUvRadius *= (_MainTex_ST.x + _MainTex_ST.y) / 2; + half percent = (_TwistUvRadius - length(tempUv)) / _TwistUvRadius; + half theta = percent * percent * (2.0 * sin(_TwistUvAmount)) * 8.0; + half s = sin(theta); + half c = cos(theta); + half beta = max(sign(_TwistUvRadius - length(tempUv)), 0.0); + tempUv = half2(dot(tempUv, half2(c, -s)), dot(tempUv, half2(s, c))) * beta + tempUv * (1 - beta); + tempUv += half2(_TwistUvPosX * _MainTex_ST.x, _TwistUvPosY * _MainTex_ST.y); + d.texcoord0.xy = tempUv; + #endif + + //-------------------------------------------- + + //FISHEYE_ON + #if FISHEYE_ON + half bind = length(centerTiled); + half2 dF = d.texcoord0.xy - centerTiled; + half dFlen = length(dF); + half fishInt = (3.14159265359 / bind) * (_FishEyeUvAmount + 0.001); + d.texcoord0.xy = centerTiled + (dF / (max(0.0001, dFlen))) * tan(dFlen * fishInt) * bind / tan(bind * fishInt); + #endif + //--------------------------------------------- + + //PINCH_ON + #if PINCH_ON + half2 dP = d.texcoord0.xy - centerTiled; + half pinchInt = (3.141592 / length(centerTiled)) * (-_PinchUvAmount + 0.001); + d.texcoord0.xy = centerTiled + normalize(dP) * atan(length(dP) * -pinchInt * 10.0) * 0.5 / atan(-pinchInt * 5); + #endif + + //--------------------------------------------- + + //ZOOMUV_ON + #if ZOOMUV_ON + d.texcoord0.xy -= centerTiled; + d.texcoord0.xy = d.texcoord0.xy * _ZoomUvAmount; + d.texcoord0.xy += centerTiled; + #endif + + //----------------------------------------------- + + //DOODLE_ON + #if DOODLE_ON + half2 uvCopy = uvRect; + _HandDrawnSpeed = (floor((_Time.x + randomSeed) * 20 * _HandDrawnSpeed) / _HandDrawnSpeed) * _HandDrawnSpeed; + uvCopy.x = sin((uvCopy.x * _HandDrawnAmount + _HandDrawnSpeed) * 4); + uvCopy.y = cos((uvCopy.y * _HandDrawnAmount + _HandDrawnSpeed) * 4); + d.texcoord0.xy = lerp(d.texcoord0.xy, d.texcoord0.xy + uvCopy, 0.0005 * _HandDrawnAmount); + #endif + + //-------------------------- + + //SHAKEUV_ON + #if SHAKEUV_ON + half xShake = sin((_Time.x + randomSeed) * _ShakeUvSpeed * 50) * _ShakeUvX; + half yShake = cos((_Time.x + randomSeed) * _ShakeUvSpeed * 50) * _ShakeUvY; + d.texcoord0.xy += half2(xShake * 0.012, yShake * 0.01); + #endif + + //------------------------------------------- + + //RECTSIZE_ON + #if RECTSIZE_ON + d.texcoord0.xy = d.texcoord0.xy * (_RectSize).xx + (((-_RectSize * 0.5) + 0.5)).xx; + #endif + + //------------------------------------------- + + //DISTORT_ON + #if DISTORT_ON + #if ATLAS_ON + d.texcoord3.x = d.texcoord3.x * (1 / (_MaxXUV - _MinXUV)); + d.texcoord3.y = d.texcoord3.y * (1 / (_MaxYUV - _MinYUV)); + #endif + + d.texcoord3.x += ((_Time.x + _RandomSeed) * _DistortTexXSpeed) % 1; + d.texcoord3.y += ((_Time.x + _RandomSeed) * _DistortTexYSpeed) % 1; + half distortAmnt = (SAMPLE_TEXTURE2D(_DistortTex, sampler_DistortTex, d.texcoord3.xy).r - 0.5) * 0.2 * _DistortAmount; + d.texcoord0.x += distortAmnt; + d.texcoord0.y += distortAmnt; + #endif + //------------------------------------------------------- + + //WARP_ON + #if WARP_ON + half2 warpUv = half2(d.texcoord0.x / _MainTex_ST.x, d.texcoord0.y / _MainTex_ST.y); + #if ATLAS_ON + warpUv = half2((warpUv.x - _MinXUV) / (_MaxXUV - _MinXUV), (warpUv.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + const float tau = 6.283185307179586; + float xWarp = (_Time.y + randomSeed) * _WarpSpeed + warpUv.x * tau / _WarpScale; + float yWarp = (_Time.y + randomSeed) * _WarpSpeed + warpUv.y * tau / _WarpScale; + float2 warp = float2(sin(xWarp), sin(yWarp)) * _WarpStrength; + d.texcoord0.xy += warp; + #endif + + //------------------------------------------------------- + + //WAVEUV_ON + #if WAVEUV_ON + float2 uvWave = half2(_WaveX * _MainTex_ST.x, _WaveY * _MainTex_ST.y) - d.texcoord0.xy; + uvWave %= 1; + #if ATLAS_ON + uvWave = half2(_WaveX, _WaveY) - uvRect; + #endif + uvWave.x *= _ScreenParams.x / _ScreenParams.y; + float waveTime = _Time.y + randomSeed; + float angWave = (sqrt(dot(uvWave, uvWave)) * _WaveAmount) - ((waveTime * _WaveSpeed)); + d.texcoord0.xy = d.texcoord0.xy + uvWave * sin(angWave) * (_WaveStrength / 1000.0); + #endif + //---------------------------------------------------- + + //ROUNDWAVEUV_ON + #if ROUNDWAVEUV_ON + half xWave = ((0.5 * _MainTex_ST.x) - uvRect.x); + half yWave = ((0.5 * _MainTex_ST.y) - uvRect.y) * (_MainTex_TexelSize.w / _MainTex_TexelSize.z); + half ripple = -sqrt(xWave*xWave + yWave* yWave); + d.texcoord0.xy += (sin((ripple + (_Time.y + randomSeed) * (_RoundWaveSpeed/10.0)) / 0.015) * (_RoundWaveStrength/10.0)) % 1; + #endif + //---------------------------------------------------- + + + //WIND_ON + #if WIND_ON + half windOffset = sin((_Time.x + randomSeed) * _GrassSpeed * 10); + half2 windCenter = half2(0.5, 0.1); + #if ATLAS_ON + windCenter.x = ((_MaxXUV - _MinXUV) * windCenter.x) + _MinXUV; + windCenter.y = ((_MaxYUV - _MinYUV) * windCenter.y) + _MinYUV; + #endif + #if !MANUALWIND_ON + d.texcoord0.x = fmod(abs(lerp(d.texcoord0.x, d.texcoord0.x + (_GrassWind * 0.01 * windOffset), uvRect.y)), 1); + #else + d.texcoord0.x = fmod(abs(lerp(d.texcoord0.x, d.texcoord0.x + (_GrassWind * 0.01 * _GrassManualAnim), uvRect.y)), 1); + windOffset = _GrassManualAnim; + #endif + half2 delta = d.texcoord0.xy - windCenter; + half delta2 = dot(delta.xy, delta.xy); + half2 delta_offset = delta2 * windOffset; + d.texcoord0.xy = d.texcoord0.xy + half2(delta.y, -delta.x) * delta_offset * _GrassRadialBend; + #endif + + //-------------------------------------------------------- + + //TEXTURESCROLL_ON && !ATLAS_ON + #if TEXTURESCROLL_ON && !ATLAS_ON + d.texcoord0.x += ((_Time.y + randomSeed) * _TextureScrollXSpeed) % 1; + d.texcoord0.y += ((_Time.y + randomSeed) * _TextureScrollYSpeed) % 1; + #endif + //------------------------------ + + //PIXELATE_ON + #if PIXELATE_ON + half aspectRatio = _MainTex_TexelSize.x / _MainTex_TexelSize.y; + half2 pixelSize = float2(_PixelateSize, _PixelateSize * aspectRatio); + d.texcoord0.xy = floor(d.texcoord0.xy * pixelSize) / pixelSize; + #endif + //-------------- + + half4 col = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy); + half originalAlpha = col.a; + col *= d.vertexColor; + + //NORMAL MAP + #if NORMALMAP_ON + half4 normalSample = SAMPLE_TEXTURE2D(_NormalMap, sampler_NormalMap, d.texcoord0.xy); + half3 normalTS = UnpackNormal(normalSample); + normalTS.xy *= _NormalStrength; + o.Normal = normalTS; + #endif + + + //GLITCH_ON + #if GLITCH_ON + half2 uvGlitch = uvRect; + uvGlitch.y -= 0.5; + half lineNoise = pow(rand2(floor(uvGlitch * half2(24., 19.) * _GlitchSize) * 4.0, randomSeed), 3.0) * _GlitchAmount + * pow(rand2(floor(uvGlitch * half2(38., 14.) * _GlitchSize) * 4.0, randomSeed), 3.0); + col = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(lineNoise * 0.02 * rand2(half2(2.0, 1), randomSeed), 0)) * d.vertexColor; + #endif + //-------------------------------------- + + //CHROMABERR_ON + #if CHROMABERR_ON + half4 r = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(_ChromAberrAmount/10, 0)) * d.vertexColor; + half4 b = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(-_ChromAberrAmount/10, 0)) * d.vertexColor; + col = half4(r.r * r.a, col.g, b.b * b.a, max(max(r.a, b.a) * _ChromAberrAlpha, col.a)); + #endif + + //-------------------------------- + + //BLUR_ON + #if BLUR_ON + #if ATLAS_ON + #if !BLURISHD_ON + col = BlurHD(d.texcoord0.xy, _MainTex, sampler_MainTex, _BlurIntensity, (_MaxXUV - _MinXUV), (_MaxYUV - _MinYUV)) * d.vertexColor; + #else + col = Blur(d.texcoord0.xy, _MainTex, sampler_MainTex, _BlurIntensity * (_MaxXUV - _MinXUV)) * d.vertexColor; + #endif + #else + #if !BLURISHD_ON + col = BlurHD(d.texcoord0.xy, _MainTex, sampler_MainTex, _BlurIntensity, 1, 1) * d.vertexColor; + #else + col = Blur(d.texcoord0.xy, _MainTex, sampler_MainTex, _BlurIntensity) * d.vertexColor; + #endif + #endif + #endif + + //-------------------- + + //MOTIONBLUR_ON + #if MOTIONBLUR_ON + _MotionBlurAngle = _MotionBlurAngle * 3.1415926; + #define rot(n) mul(n, half2x2(cos(_MotionBlurAngle), -sin(_MotionBlurAngle), sin(_MotionBlurAngle), cos(_MotionBlurAngle))) + _MotionBlurDist = _MotionBlurDist * 0.005; + #if ATLAS_ON + _MotionBlurDist *= (_MaxXUV - _MinXUV); + #endif + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(-_MotionBlurDist, -_MotionBlurDist))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(-_MotionBlurDist * 2, -_MotionBlurDist * 2))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(-_MotionBlurDist * 3, -_MotionBlurDist * 3))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(-_MotionBlurDist * 4, -_MotionBlurDist * 4))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(_MotionBlurDist, _MotionBlurDist))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(_MotionBlurDist * 2, _MotionBlurDist * 2))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(_MotionBlurDist * 3, _MotionBlurDist * 3))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(_MotionBlurDist * 4, _MotionBlurDist * 4))); + col.rgb = col.rgb / 9; + #endif + //------------------------------------ + + //NEGATIVE_ON + #if NEGATIVE_ON + col.rgb = lerp(col.rgb, 1 - col.rgb, _NegativeAmount); + #endif + + //-------------- + half luminance = 0; + + //GREYSCALE_ON && !GREYSCALEOUTLINE_ON + #if GREYSCALE_ON && !GREYSCALEOUTLINE_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + luminance = saturate(luminance + _GreyscaleLuminosity); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _GreyscaleTintColor, _GreyscaleBlend); + #endif + //------------------------------------ + + //GHOST_ON + #if GHOST_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + half4 ghostResult; + ghostResult.a = saturate(luminance - _GhostTransparency) * col.a; + ghostResult.rgb = col.rgb * (luminance + _GhostColorBoost); + col = lerp(col, ghostResult, _GhostBlend); + #endif + //------------------------------------ + + //INNEROUTLINE_ON + #if INNEROUTLINE_ON + half3 innerT = abs(GetPixel(0, _InnerOutlineThickness, d.texcoord0.xy, _MainTex, sampler_MainTex) - GetPixel(0, -_InnerOutlineThickness, d.texcoord0.xy, _MainTex, sampler_MainTex)); + innerT += abs(GetPixel(_InnerOutlineThickness, 0, d.texcoord0.xy, _MainTex, sampler_MainTex) - GetPixel(-_InnerOutlineThickness, 0, d.texcoord0.xy, _MainTex, sampler_MainTex)); + #if !ONLYINNEROUTLINE_ON + innerT = (innerT / 2.0) * col.a * _InnerOutlineAlpha; + col.rgb += length(innerT) * _InnerOutlineColor.rgb * _InnerOutlineGlow; + #else + innerT *= col.a * _InnerOutlineAlpha; + col.rgb = length(innerT) * _InnerOutlineColor.rgb * _InnerOutlineGlow; + col.a = step(0.3, col.r+col.g+col.b); + #endif + #endif + //------------------------------------------------------- + + //HITEFFECT_ON + #if HITEFFECT_ON + col.rgb = lerp(col.rgb, _HitEffectColor.rgb * _HitEffectGlow, _HitEffectBlend); + #endif + //-------------------- + + //GRADIENT_ON + #if GRADIENT_ON + half2 tiledUvGrad = half2(uvRect.x / _MainTex_ST.x, uvRect.y / _MainTex_ST.y); + #if GRADIENT2COL_ON + _GradTopRightCol = _GradTopLeftCol; + _GradBotRightCol = _GradBotLeftCol; + #endif + #if RADIALGRADIENT_ON + half radialDist = 1 - length(tiledUvGrad - half2(0.5, 0.5)); + radialDist *= (_MainTex_TexelSize.w / _MainTex_TexelSize.z); + radialDist = saturate(_GradBoostX * radialDist); + half4 gradientResult = lerp(_GradTopLeftCol, _GradBotLeftCol, radialDist); + #else + half gradXLerpFactor = saturate(pow(tiledUvGrad.x, _GradBoostX)); + half4 gradientResult = lerp(lerp(_GradBotLeftCol, _GradBotRightCol, gradXLerpFactor), + lerp(_GradTopLeftCol, _GradTopRightCol, gradXLerpFactor), saturate(pow(tiledUvGrad.y, _GradBoostY))); + #endif + gradientResult = lerp(col, gradientResult, _GradBlend); + col.rgb = gradientResult.rgb * col.a; + col.a *= gradientResult.a; + #endif + //-------------------------------------------------------------------- + + //CONTRAST_ON + #if CONTRAST_ON + col.rgb = (col.rgb - float3(0.5, 0.5, 0.5)) * _Contrast + float3(0.5, 0.5, 0.5); + col.rgb += _Brightness; + #endif + + //------------------------------------------------------------------- + + //COLORSWAP_ON + #if COLORSWAP_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + half4 swapMask = SAMPLE_TEXTURE2D(_ColorSwapTex, sampler_ColorSwapTex, d.texcoord0.xy); + swapMask.rgb *= swapMask.a; + half3 redSwap = _ColorSwapRed * swapMask.r * saturate(luminance + _ColorSwapRedLuminosity); + half3 greenSwap = _ColorSwapGreen * swapMask.g * saturate(luminance + _ColorSwapGreenLuminosity); + half3 blueSwap = _ColorSwapBlue * swapMask.b * saturate(luminance + _ColorSwapBlueLuminosity); + swapMask.rgb = col.rgb * saturate(1 - swapMask.r - swapMask.g - swapMask.b); + col.rgb = lerp(col.rgb, swapMask.rgb + redSwap + greenSwap + blueSwap, _ColorSwapBlend); + #endif + //-------------------------------------------------------------------- + + //COLORRAMP_ON && !COLORRAMPOUTLINE_ON + #if COLORRAMP_ON && !COLORRAMPOUTLINE_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + luminance = saturate(luminance + _ColorRampLuminosity); + #if GRADIENTCOLORRAMP_ON + col.rgb = lerp(col.rgb, SAMPLE_TEXTURE2D(_ColorRampTexGradient, sampler_ColorRampTexGradient, half2(luminance, 0)).rgb, _ColorRampBlend); + #else + col.rgb = lerp(col.rgb, SAMPLE_TEXTURE2D(_ColorRampTex, sampler_ColorRampTex, half2(luminance, 0)).rgb, _ColorRampBlend); + #endif + #endif + //-------------------------------------------------------------------- + + //CHANGECOLOR_ON + #if CHANGECOLOR_ON + float3 currChangeColor = saturate(col.rgb); + luminance = 0.3 * currChangeColor.r + 0.59 * currChangeColor.g + 0.11 * currChangeColor.b; + luminance = saturate(luminance + _ColorChangeLuminosity); + half3 dif = abs(currChangeColor - _ColorChangeTarget.rgb); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _ColorChangeNewCol.rgb, + max(sign(1 - saturate(dif.x + dif.y + dif.z) - _ColorChangeTolerance), 0.0)); + #if CHANGECOLOR2_ON + dif = abs(currChangeColor - _ColorChangeTarget2.rgb); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _ColorChangeNewCol2.rgb, + max(sign(1 - saturate(dif.x + dif.y + dif.z) - _ColorChangeTolerance2), 0.0)); + #endif + #if CHANGECOLOR3_ON + dif = abs(currChangeColor - _ColorChangeTarget3.rgb); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _ColorChangeNewCol3.rgb, + max(sign(1 - saturate(dif.x + dif.y + dif.z) - _ColorChangeTolerance3), 0.0)); + #endif + #endif + //------------------------------------------------------- + + //POSTERIZE_ON && !POSTERIZEOUTLINE_ON + #if POSTERIZE_ON && !POSTERIZEOUTLINE_ON + col.rgb = pow(col.rgb, _PosterizeGamma) * _PosterizeNumColors; + col.rgb = floor(col.rgb) / _PosterizeNumColors; + col.rgb = pow(col.rgb, 1.0 / _PosterizeGamma); + #endif + //------------------------------------ + + //HSV_ON + #if HSV_ON + half3 resultHsv = half3(col.rgb); + half cosHsv = _HsvBright * _HsvSaturation * cos(_HsvShift * 3.14159265 / 180); + half sinHsv = _HsvBright * _HsvSaturation * sin(_HsvShift * 3.14159265 / 180); + resultHsv.x = (.299 * _HsvBright + .701 * cosHsv + .168 * sinHsv) * col.x + + (.587 * _HsvBright - .587 * cosHsv + .330 * sinHsv) * col.y + + (.114 * _HsvBright - .114 * cosHsv - .497 * sinHsv) * col.z; + resultHsv.y = (.299 * _HsvBright - .299 * cosHsv - .328 * sinHsv) *col.x + + (.587 * _HsvBright + .413 * cosHsv + .035 * sinHsv) * col.y + + (.114 * _HsvBright - .114 * cosHsv + .292 * sinHsv) * col.z; + resultHsv.z = (.299 * _HsvBright - .3 * cosHsv + 1.25 * sinHsv) * col.x + + (.587 * _HsvBright - .588 * cosHsv - 1.05 * sinHsv) * col.y + + (.114 * _HsvBright + .886 * cosHsv - .203 * sinHsv) * col.z; + col.rgb = resultHsv; + #endif + //------------------------------------------------------- + + //OVERLAY_ON + #if OVERLAY_ON + half2 overlayUvs = d.texcoord0.xy; + overlayUvs.x += ((_Time.y + randomSeed) * _OverlayTextureScrollXSpeed) % 1; + overlayUvs.y += ((_Time.y + randomSeed) * _OverlayTextureScrollYSpeed) % 1; + half4 overlayCol = SAMPLE_TEXTURE2D(_OverlayTex, sampler_OverlayTex, TRANSFORM_TEX(overlayUvs, _OverlayTex)); + overlayCol.rgb *= _OverlayColor.rgb * _OverlayGlow; + #if !OVERLAYMULT_ON + overlayCol.rgb *= overlayCol.a * _OverlayColor.rgb * _OverlayColor.a * _OverlayBlend; + col.rgb += overlayCol.rgb; + #else + overlayCol.a *= _OverlayColor.a; + col = lerp(col, col * overlayCol, _OverlayBlend); + #endif + #endif + + //--------------------------------- + + //OUTBASE_ON + #if OUTBASE_ON + #if OUTBASEPIXELPERF_ON + half2 destUv = half2(_OutlinePixelWidth * _MainTex_TexelSize.x, _OutlinePixelWidth * _MainTex_TexelSize.y); + #else + half2 destUv = half2(_OutlineWidth * _MainTex_TexelSize.x * 200, _OutlineWidth * _MainTex_TexelSize.y * 200); + #endif + + #if OUTDIST_ON + d.texcoord3.x += ((_Time.x + _RandomSeed) * _OutlineDistortTexXSpeed) % 1; + d.texcoord3.y += ((_Time.x + _RandomSeed) * _OutlineDistortTexYSpeed) % 1; + #if ATLAS_ON + d.texcoord3 = half2((d.texcoord3.x - _MinXUV) / (_MaxXUV - _MinXUV), (d.texcoord3.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half outDistortAmnt = (SAMPLE_TEXTURE2D(_OutlineDistortTex, sampler_OutlineDistortTex, d.texcoord3).r - 0.5) * 0.2 * _OutlineDistortAmount; + destUv.x += outDistortAmnt; + destUv.y += outDistortAmnt; + #endif + + half spriteLeft = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(destUv.x, 0)).a; + half spriteRight = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy - half2(destUv.x, 0)).a; + half spriteBottom = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(0, destUv.y)).a; + half spriteTop = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy - half2(0, destUv.y)).a; + half result = spriteLeft + spriteRight + spriteBottom + spriteTop; + + #if OUTBASE8DIR_ON + half spriteTopLeft = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(destUv.x, destUv.y)).a; + half spriteTopRight = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(-destUv.x, destUv.y)).a; + half spriteBotLeft = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(destUv.x, -destUv.y)).a; + half spriteBotRight = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(-destUv.x, -destUv.y)).a; + result = result + spriteTopLeft + spriteTopRight + spriteBotLeft + spriteBotRight; + #endif + + result = step(0.05, saturate(result)); + + #if OUTTEX_ON + d.texcoord1.x += ((_Time.x + _RandomSeed) * _OutlineTexXSpeed) % 1; + d.texcoord1.y += ((_Time.x + _RandomSeed) * _OutlineTexYSpeed) % 1; + #if ATLAS_ON + d.texcoord1 = half2((d.texcoord1.x - _MinXUV) / (_MaxXUV - _MinXUV), (d.texcoord1.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half4 tempOutColor = SAMPLE_TEXTURE2D(_OutlineTex, sampler_OutlineTex, d.texcoord1); + tempOutColor *= _OutlineColor; + _OutlineColor = tempOutColor; + #endif + + result *= (1 - originalAlpha) * _OutlineAlpha; + + half4 outline = _OutlineColor * d.vertexColor.a; + outline.rgb *= _OutlineGlow; + outline.a = result; + #if ONLYOUTLINE_ON + col = outline; + #else + col = lerp(col, outline, result); + #endif + #endif + //------------------------------------------------------- + + //FADE_ON + #if FADE_ON + half2 tiledUvFade1 = TRANSFORM_TEX(d.texcoord0, _FadeTex); + half2 tiledUvFade2 = TRANSFORM_TEX(d.texcoord0, _FadeBurnTex); + #if ATLAS_ON + tiledUvFade1 = half2((tiledUvFade1.x - _MinXUV) / (_MaxXUV - _MinXUV), (tiledUvFade1.y - _MinYUV) / (_MaxYUV - _MinYUV)); + tiledUvFade2 = half2((tiledUvFade2.x - _MinXUV) / (_MaxXUV - _MinXUV), (tiledUvFade2.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half fadeTemp = SAMPLE_TEXTURE2D(_FadeTex, sampler_FadeTex, tiledUvFade1).r; + half fade = smoothstep(_FadeAmount, _FadeAmount + _FadeBurnTransition, fadeTemp); + half fadeBurn = saturate(smoothstep(_FadeAmount - _FadeBurnWidth, _FadeAmount - _FadeBurnWidth + 0.1, fadeTemp) * _FadeAmount); + col.a *= fade; + _FadeBurnColor.rgb *= _FadeBurnGlow; + col += fadeBurn * SAMPLE_TEXTURE2D(_FadeBurnTex, sampler_FadeBurnTex, tiledUvFade2) * _FadeBurnColor * originalAlpha * (1 - col.a); + #endif + //------------------------------------------------------- + + //SHADOW_ON + #if SHADOW_ON + half shadowA = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(_ShadowX, _ShadowY)).a; + half preMultShadowMask = 1 - (saturate(shadowA - col.a) * (1 - col.a)); + col.rgb *= 1 - ((shadowA - col.a) * (1 - col.a)); + col.rgb += (_ShadowColor * shadowA) * (1 - col.a); + col.a = max(shadowA * _ShadowAlpha * d.vertexColor.a, col.a); + #endif + + //------------------------------------------------------- + + //GLOW_ON + #if GLOW_ON + half4 emission; + #if GLOWTEX_ON + emission = SAMPLE_TEXTURE2D(_GlowTex, sampler_GlowTex, d.texcoord0); + #else + emission = col; + #endif + + col.rgb *= _GlowGlobal; + emission.rgb *= emission.a * col.a * _Glow * _GlowColor; + col.rgb += emission.rgb; + #endif + //------------------------------------------------------- + + //COLORRAMP_ON && COLORRAMPOUTLINE_ON + #if COLORRAMP_ON && COLORRAMPOUTLINE_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + luminance = saturate(luminance + _ColorRampLuminosity); + #if GRADIENTCOLORRAMP_ON + col.rgb = lerp(col.rgb, SAMPLE_TEXTURE2D(_ColorRampTexGradient, sampler_ColorRampTexGradient, half2(luminance, 0)).rgb, _ColorRampBlend); + #else + col.rgb = lerp(col.rgb, SAMPLE_TEXTURE2D(_ColorRampTex, sampler_ColorRampTex, half2(luminance, 0)).rgb, _ColorRampBlend); + #endif + #endif + //--------------- + + //GREYSCALE_ON && GREYSCALEOUTLINE_ON + #if GREYSCALE_ON && GREYSCALEOUTLINE_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + luminance = saturate(luminance + _GreyscaleLuminosity); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _GreyscaleTintColor, _GreyscaleBlend); + #endif + + //----------------------------------- + + //POSTERIZE_ON && POSTERIZEOUTLINE_ON + #if POSTERIZE_ON && POSTERIZEOUTLINE_ON + col.rgb = pow(col.rgb, _PosterizeGamma) * _PosterizeNumColors; + col.rgb = floor(col.rgb) / _PosterizeNumColors; + col.rgb = pow(col.rgb, 1.0 / _PosterizeGamma); + #endif + + //----------------------------------- + + //SHINE_ON + #if SHINE_ON + half2 uvShine = uvRect; + half cosAngle = cos(_ShineRotate); + half sinAngle = sin(_ShineRotate); + half2x2 rot = half2x2(cosAngle, -sinAngle, sinAngle, cosAngle); + uvShine -= half2(0.5, 0.5); + uvShine = mul(rot, uvShine); + uvShine += half2(0.5, 0.5); + half shineMask = SAMPLE_TEXTURE2D(_ShineMask, sampler_ShineMask, d.texcoord0.xy).a; + half currentDistanceProjection = (uvShine.x + uvShine.y) / 2; + half whitePower = 1 - (abs(currentDistanceProjection - _ShineLocation) / _ShineWidth); + col.rgb += col.a * whitePower * _ShineGlow * max(sign(currentDistanceProjection - (_ShineLocation - _ShineWidth)), 0.0) + * max(sign((_ShineLocation + _ShineWidth) - currentDistanceProjection), 0.0) * _ShineColor * shineMask; + #endif + + //----------------------------------- + + //HOLOGRAM_ON + #if HOLOGRAM_ON + half totalHologram = _HologramStripesAmount + _HologramUnmodAmount; + half hologramYCoord = ((uvRect.y + (((_Time.x + randomSeed) % 1) * _HologramStripesSpeed)) % totalHologram) / totalHologram; + hologramYCoord = abs(hologramYCoord); + half alpha = RemapFloat(saturate(hologramYCoord - (_HologramUnmodAmount/totalHologram)), 0.0, 1.0, _HologramMinAlpha, saturate(_HologramMaxAlpha)); + half hologramMask = max(sign((_HologramUnmodAmount/totalHologram) - hologramYCoord), 0.0); + half4 hologramResult = col; + hologramResult.a *= lerp(alpha, 1, hologramMask); + hologramResult.rgb *= max(1, _HologramMaxAlpha * max(sign(hologramYCoord - (_HologramUnmodAmount/totalHologram)), 0.0)); + hologramMask = 1 - step(0.01,hologramMask); + hologramResult.rgb += hologramMask * _HologramStripeColor * col.a; + col = lerp(col, hologramResult, _HologramBlend); + #endif + + //----------------------------------- + + //FLICKER_ON + #if FLICKER_ON + col.a *= saturate(col.a * step(frac(0.05 + (_Time.w + randomSeed) * _FlickerFreq), 1 - _FlickerPercent) + _FlickerAlpha); + #endif + //----------------------------------- + + //ALPHACUTOFF_ON + + //ALPHAROUND_ON + + //ALPHAOUTLINE_ON + #if ALPHAOUTLINE_ON + half alphaOutlineRes = pow(1 - col.a, max(_AlphaOutlinePower, 0.0001)) * step(_AlphaOutlineMinAlpha, col.a) * _AlphaOutlineBlend; + col.rgb = lerp(col.rgb, _AlphaOutlineColor.rgb * _AlphaOutlineGlow, alphaOutlineRes); + col.a = lerp(col.a, 1, alphaOutlineRes > 1); + #endif + //------------------------------------------------------- + + //FOG_ON + + //------------------ + + col *= _Color; + o.Albedo = col; + col.a *= _Alpha; + clip(col.a - _AlphaCutoffValue - 0.01); + o.Alpha = _Color.a; + } + + + + + + void ChainSurfaceFunction(inout Surface l, inout ShaderData d) + { + Ext_SurfaceFunction0(l, d); + // Ext_SurfaceFunction1(l, d); + // Ext_SurfaceFunction2(l, d); + // Ext_SurfaceFunction3(l, d); + // Ext_SurfaceFunction4(l, d); + // Ext_SurfaceFunction5(l, d); + // Ext_SurfaceFunction6(l, d); + // Ext_SurfaceFunction7(l, d); + // Ext_SurfaceFunction8(l, d); + // Ext_SurfaceFunction9(l, d); + // Ext_SurfaceFunction10(l, d); + // Ext_SurfaceFunction11(l, d); + // Ext_SurfaceFunction12(l, d); + // Ext_SurfaceFunction13(l, d); + // Ext_SurfaceFunction14(l, d); + // Ext_SurfaceFunction15(l, d); + // Ext_SurfaceFunction16(l, d); + // Ext_SurfaceFunction17(l, d); + // Ext_SurfaceFunction18(l, d); + // Ext_SurfaceFunction19(l, d); + // Ext_SurfaceFunction20(l, d); + // Ext_SurfaceFunction21(l, d); + // Ext_SurfaceFunction22(l, d); + // Ext_SurfaceFunction23(l, d); + // Ext_SurfaceFunction24(l, d); + // Ext_SurfaceFunction25(l, d); + // Ext_SurfaceFunction26(l, d); + // Ext_SurfaceFunction27(l, d); + // Ext_SurfaceFunction28(l, d); + // Ext_SurfaceFunction29(l, d); + } + +#if !_DECALSHADER + + void ChainModifyVertex(inout VertexData v, inout VertexToPixel v2p, float4 time) + { + ExtraV2F d; + + ZERO_INITIALIZE(ExtraV2F, d); + ZERO_INITIALIZE(Blackboard, d.blackboard); + // due to motion vectors in HDRP, we need to use the last + // time in certain spots. So if you are going to use _Time to adjust vertices, + // you need to use this time or motion vectors will break. + d.time = time; + + Ext_ModifyVertex0(v, d); + // Ext_ModifyVertex1(v, d); + // Ext_ModifyVertex2(v, d); + // Ext_ModifyVertex3(v, d); + // Ext_ModifyVertex4(v, d); + // Ext_ModifyVertex5(v, d); + // Ext_ModifyVertex6(v, d); + // Ext_ModifyVertex7(v, d); + // Ext_ModifyVertex8(v, d); + // Ext_ModifyVertex9(v, d); + // Ext_ModifyVertex10(v, d); + // Ext_ModifyVertex11(v, d); + // Ext_ModifyVertex12(v, d); + // Ext_ModifyVertex13(v, d); + // Ext_ModifyVertex14(v, d); + // Ext_ModifyVertex15(v, d); + // Ext_ModifyVertex16(v, d); + // Ext_ModifyVertex17(v, d); + // Ext_ModifyVertex18(v, d); + // Ext_ModifyVertex19(v, d); + // Ext_ModifyVertex20(v, d); + // Ext_ModifyVertex21(v, d); + // Ext_ModifyVertex22(v, d); + // Ext_ModifyVertex23(v, d); + // Ext_ModifyVertex24(v, d); + // Ext_ModifyVertex25(v, d); + // Ext_ModifyVertex26(v, d); + // Ext_ModifyVertex27(v, d); + // Ext_ModifyVertex28(v, d); + // Ext_ModifyVertex29(v, d); + + + // #if %EXTRAV2F0REQUIREKEY% + // v2p.extraV2F0 = d.extraV2F0; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // v2p.extraV2F1 = d.extraV2F1; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // v2p.extraV2F2 = d.extraV2F2; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // v2p.extraV2F3 = d.extraV2F3; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // v2p.extraV2F4 = d.extraV2F4; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // v2p.extraV2F5 = d.extraV2F5; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // v2p.extraV2F6 = d.extraV2F6; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // v2p.extraV2F7 = d.extraV2F7; + // #endif + } + + void ChainModifyTessellatedVertex(inout VertexData v, inout VertexToPixel v2p) + { + ExtraV2F d; + ZERO_INITIALIZE(ExtraV2F, d); + ZERO_INITIALIZE(Blackboard, d.blackboard); + + // #if %EXTRAV2F0REQUIREKEY% + // d.extraV2F0 = v2p.extraV2F0; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // d.extraV2F1 = v2p.extraV2F1; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // d.extraV2F2 = v2p.extraV2F2; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // d.extraV2F3 = v2p.extraV2F3; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // d.extraV2F4 = v2p.extraV2F4; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // d.extraV2F5 = v2p.extraV2F5; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // d.extraV2F6 = v2p.extraV2F6; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // d.extraV2F7 = v2p.extraV2F7; + // #endif + + + // Ext_ModifyTessellatedVertex0(v, d); + // Ext_ModifyTessellatedVertex1(v, d); + // Ext_ModifyTessellatedVertex2(v, d); + // Ext_ModifyTessellatedVertex3(v, d); + // Ext_ModifyTessellatedVertex4(v, d); + // Ext_ModifyTessellatedVertex5(v, d); + // Ext_ModifyTessellatedVertex6(v, d); + // Ext_ModifyTessellatedVertex7(v, d); + // Ext_ModifyTessellatedVertex8(v, d); + // Ext_ModifyTessellatedVertex9(v, d); + // Ext_ModifyTessellatedVertex10(v, d); + // Ext_ModifyTessellatedVertex11(v, d); + // Ext_ModifyTessellatedVertex12(v, d); + // Ext_ModifyTessellatedVertex13(v, d); + // Ext_ModifyTessellatedVertex14(v, d); + // Ext_ModifyTessellatedVertex15(v, d); + // Ext_ModifyTessellatedVertex16(v, d); + // Ext_ModifyTessellatedVertex17(v, d); + // Ext_ModifyTessellatedVertex18(v, d); + // Ext_ModifyTessellatedVertex19(v, d); + // Ext_ModifyTessellatedVertex20(v, d); + // Ext_ModifyTessellatedVertex21(v, d); + // Ext_ModifyTessellatedVertex22(v, d); + // Ext_ModifyTessellatedVertex23(v, d); + // Ext_ModifyTessellatedVertex24(v, d); + // Ext_ModifyTessellatedVertex25(v, d); + // Ext_ModifyTessellatedVertex26(v, d); + // Ext_ModifyTessellatedVertex27(v, d); + // Ext_ModifyTessellatedVertex28(v, d); + // Ext_ModifyTessellatedVertex29(v, d); + + // #if %EXTRAV2F0REQUIREKEY% + // v2p.extraV2F0 = d.extraV2F0; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // v2p.extraV2F1 = d.extraV2F1; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // v2p.extraV2F2 = d.extraV2F2; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // v2p.extraV2F3 = d.extraV2F3; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // v2p.extraV2F4 = d.extraV2F4; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // v2p.extraV2F5 = d.extraV2F5; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // v2p.extraV2F6 = d.extraV2F6; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // v2p.extraV2F7 = d.extraV2F7; + // #endif + } + + void ChainFinalColorForward(inout Surface l, inout ShaderData d, inout half4 color) + { + // Ext_FinalColorForward0(l, d, color); + // Ext_FinalColorForward1(l, d, color); + // Ext_FinalColorForward2(l, d, color); + // Ext_FinalColorForward3(l, d, color); + // Ext_FinalColorForward4(l, d, color); + // Ext_FinalColorForward5(l, d, color); + // Ext_FinalColorForward6(l, d, color); + // Ext_FinalColorForward7(l, d, color); + // Ext_FinalColorForward8(l, d, color); + // Ext_FinalColorForward9(l, d, color); + // Ext_FinalColorForward10(l, d, color); + // Ext_FinalColorForward11(l, d, color); + // Ext_FinalColorForward12(l, d, color); + // Ext_FinalColorForward13(l, d, color); + // Ext_FinalColorForward14(l, d, color); + // Ext_FinalColorForward15(l, d, color); + // Ext_FinalColorForward16(l, d, color); + // Ext_FinalColorForward17(l, d, color); + // Ext_FinalColorForward18(l, d, color); + // Ext_FinalColorForward19(l, d, color); + // Ext_FinalColorForward20(l, d, color); + // Ext_FinalColorForward21(l, d, color); + // Ext_FinalColorForward22(l, d, color); + // Ext_FinalColorForward23(l, d, color); + // Ext_FinalColorForward24(l, d, color); + // Ext_FinalColorForward25(l, d, color); + // Ext_FinalColorForward26(l, d, color); + // Ext_FinalColorForward27(l, d, color); + // Ext_FinalColorForward28(l, d, color); + // Ext_FinalColorForward29(l, d, color); + } + + void ChainFinalGBufferStandard(inout Surface s, inout ShaderData d, inout half4 GBuffer0, inout half4 GBuffer1, inout half4 GBuffer2, inout half4 outEmission, inout half4 outShadowMask) + { + // Ext_FinalGBufferStandard0(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard1(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard2(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard3(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard4(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard5(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard6(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard7(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard8(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard9(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard10(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard11(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard12(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard13(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard14(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard15(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard16(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard17(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard18(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard19(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard20(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard21(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard22(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard23(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard24(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard25(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard26(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard27(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard28(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard29(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + } +#endif + + + + + +#if _DECALSHADER + + ShaderData CreateShaderData(SurfaceDescriptionInputs IN) + { + ShaderData d = (ShaderData)0; + d.TBNMatrix = float3x3(IN.WorldSpaceTangent, IN.WorldSpaceBiTangent, IN.WorldSpaceNormal); + d.worldSpaceNormal = IN.WorldSpaceNormal; + d.worldSpaceTangent = IN.WorldSpaceTangent; + + d.worldSpacePosition = IN.WorldSpacePosition; + d.texcoord0 = IN.uv0.xyxy; + d.screenPos = IN.ScreenPosition; + + d.worldSpaceViewDir = normalize(_WorldSpaceCameraPos - d.worldSpacePosition); + + d.tangentSpaceViewDir = mul(d.TBNMatrix, d.worldSpaceViewDir); + + // these rarely get used, so we back transform them. Usually will be stripped. + #if _HDRP + // d.localSpacePosition = mul(GetWorldToObjectMatrix(), float4(GetCameraRelativePositionWS(d.worldSpacePosition), 1)).xyz; + #else + // d.localSpacePosition = mul(GetWorldToObjectMatrix(), float4(d.worldSpacePosition, 1)).xyz; + #endif + // d.localSpaceNormal = normalize(mul((float3x3)GetWorldToObjectMatrix(), d.worldSpaceNormal)); + // d.localSpaceTangent = normalize(mul((float3x3)GetWorldToObjectMatrix(), d.worldSpaceTangent.xyz)); + + // #if %SCREENPOSREQUIREKEY% + // d.screenUV = (IN.ScreenPosition.xy / max(0.01, IN.ScreenPosition.w)); + // #endif + + return d; + } +#else + + ShaderData CreateShaderData(VertexToPixel i + #if NEED_FACING + , bool facing + #endif + ) + { + ShaderData d = (ShaderData)0; + d.clipPos = i.pos; + d.worldSpacePosition = i.worldPos; + + d.worldSpaceNormal = normalize(i.worldNormal); + d.worldSpaceTangent.xyz = normalize(i.worldTangent.xyz); + + d.tangentSign = i.worldTangent.w * unity_WorldTransformParams.w; + float3 bitangent = cross(d.worldSpaceTangent.xyz, d.worldSpaceNormal) * d.tangentSign; + + d.TBNMatrix = float3x3(d.worldSpaceTangent, -bitangent, d.worldSpaceNormal); + d.worldSpaceViewDir = normalize(_WorldSpaceCameraPos - i.worldPos); + + d.tangentSpaceViewDir = mul(d.TBNMatrix, d.worldSpaceViewDir); + d.texcoord0 = i.texcoord0; + d.texcoord1 = i.texcoord1; + d.texcoord2 = i.texcoord2; + + // #if %TEXCOORD3REQUIREKEY% + d.texcoord3 = i.texcoord3; + // #endif + + // d.isFrontFace = facing; + // #if %VERTEXCOLORREQUIREKEY% + d.vertexColor = i.vertexColor; + // #endif + + // these rarely get used, so we back transform them. Usually will be stripped. + #if _HDRP + // d.localSpacePosition = mul(GetWorldToObjectMatrix(), float4(GetCameraRelativePositionWS(i.worldPos), 1)).xyz; + #else + // d.localSpacePosition = mul(GetWorldToObjectMatrix(), float4(i.worldPos, 1)).xyz; + #endif + // d.localSpaceNormal = normalize(mul((float3x3)GetWorldToObjectMatrix(), i.worldNormal)); + // d.localSpaceTangent = normalize(mul((float3x3)GetWorldToObjectMatrix(), i.worldTangent.xyz)); + + // #if %SCREENPOSREQUIREKEY% + // d.screenPos = i.screenPos; + // d.screenUV = (i.screenPos.xy / i.screenPos.w); + // #endif + + + // #if %EXTRAV2F0REQUIREKEY% + // d.extraV2F0 = i.extraV2F0; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // d.extraV2F1 = i.extraV2F1; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // d.extraV2F2 = i.extraV2F2; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // d.extraV2F3 = i.extraV2F3; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // d.extraV2F4 = i.extraV2F4; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // d.extraV2F5 = i.extraV2F5; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // d.extraV2F6 = i.extraV2F6; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // d.extraV2F7 = i.extraV2F7; + // #endif + + return d; + } + +#endif + + + #if defined(_PASSSHADOW) + float3 _LightDirection; + float3 _LightPosition; + #endif + + // vertex shader + VertexToPixel Vert (VertexData v) + { + + VertexToPixel o = (VertexToPixel)0; + + UNITY_SETUP_INSTANCE_ID(v); + UNITY_TRANSFER_INSTANCE_ID(v, o); + UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o); + + +#if !_TESSELLATION_ON + ChainModifyVertex(v, o, _Time); +#endif + + o.texcoord0 = v.texcoord0; + o.texcoord1 = v.texcoord1; + o.texcoord2 = v.texcoord2; + + // #if %TEXCOORD3REQUIREKEY% + o.texcoord3 = v.texcoord3; + // #endif + + // #if %VERTEXCOLORREQUIREKEY% + o.vertexColor = v.vertexColor; + // #endif + + VertexPositionInputs vertexInput = GetVertexPositionInputs(v.vertex.xyz); + o.worldPos = TransformObjectToWorld(v.vertex.xyz); + o.worldNormal = TransformObjectToWorldNormal(v.normal); + o.worldTangent = float4(TransformObjectToWorldDir(v.tangent.xyz), v.tangent.w); + + // For some very odd reason, in 2021.2, we can't use Unity's defines, but have to use our own.. + #if _PASSSHADOW + #if _CASTING_PUNCTUAL_LIGHT_SHADOW + float3 lightDirectionWS = normalize(_LightPosition - o.worldPos); + #else + float3 lightDirectionWS = _LightDirection; + #endif + // Define shadow pass specific clip position for Universal + o.pos = TransformWorldToHClip(ApplyShadowBias(o.worldPos, o.worldNormal, lightDirectionWS)); + #if UNITY_REVERSED_Z + o.pos.z = min(o.pos.z, UNITY_NEAR_CLIP_VALUE); + #else + o.pos.z = max(o.pos.z, UNITY_NEAR_CLIP_VALUE); + #endif + #elif _PASSMETA + o.pos = MetaVertexPosition(float4(v.vertex.xyz, 0), v.texcoord1.xy, v.texcoord2.xy, unity_LightmapST, unity_DynamicLightmapST); + #else + o.pos = TransformWorldToHClip(o.worldPos); + #endif + + // #if %SCREENPOSREQUIREKEY% + // o.screenPos = ComputeScreenPos(o.pos, _ProjectionParams.x); + // #endif + + #if _PASSFORWARD || _PASSGBUFFER + float2 uv1 = v.texcoord1.xy; + OUTPUT_LIGHTMAP_UV(uv1, unity_LightmapST, o.lightmapUV); + o.texcoord1.xy = uv1; + OUTPUT_SH(o.worldNormal, o.sh); + #if defined(DYNAMICLIGHTMAP_ON) + o.dynamicLightmapUV.xy = v.texcoord2.xy * unity_DynamicLightmapST.xy + unity_DynamicLightmapST.zw; + #endif + #endif + + #ifdef VARYINGS_NEED_FOG_AND_VERTEX_LIGHT + half fogFactor = 0; + #if defined(_FOG_FRAGMENT) + fogFactor = ComputeFogFactor(o.pos.z); + #endif + #if _BAKEDLIT + o.fogFactorAndVertexLight = half4(fogFactor, 0, 0, 0); + #else + half3 vertexLight = VertexLighting(o.worldPos, o.worldNormal); + o.fogFactorAndVertexLight = half4(fogFactor, vertexLight); + #endif + #endif + + #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR) + o.shadowCoord = GetShadowCoord(vertexInput); + #endif + + return o; + } + + + + + // fragment shader + half4 Frag (VertexToPixel IN + #ifdef _DEPTHOFFSET_ON + , out float outputDepth : SV_Depth + #endif + #if NEED_FACING + , bool facing : SV_IsFrontFace + #endif + ) : SV_Target + { + UNITY_SETUP_INSTANCE_ID(IN); + UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX(IN); + + ShaderData d = CreateShaderData(IN + #if NEED_FACING + , facing + #endif + ); + Surface l = (Surface)0; + + #ifdef _DEPTHOFFSET_ON + l.outputDepth = outputDepth; + #endif + + l.Albedo = half3(0.5, 0.5, 0.5); + l.Normal = float3(0,0,1); + l.Occlusion = 1; + l.Alpha = 1; + + ChainSurfaceFunction(l, d); + + #ifdef _DEPTHOFFSET_ON + outputDepth = l.outputDepth; + #endif + + #if defined(_GBUFFER_NORMALS_OCT) + float3 normalWS = d.worldSpaceNormal; + float2 octNormalWS = PackNormalOctQuadEncode(normalWS); // values between [-1, +1], must use fp32 on some platforms + float2 remappedOctNormalWS = saturate(octNormalWS * 0.5 + 0.5); // values between [ 0, 1] + half3 packedNormalWS = PackFloat2To888(remappedOctNormalWS); // values between [ 0, 1] + return half4(packedNormalWS, 0.0); + #else + float3 wsn = l.Normal; + #if !_WORLDSPACENORMAL + wsn = TangentToWorldSpace(d, l.Normal); + #endif + return half4(NormalizeNormalPerPixel(wsn), 0.0); + #endif + + + } + + ENDHLSL + + } + + + + + + + + } + + + CustomEditor "AllIn1SpriteShaderLitMaterialInspector" +} diff --git a/Assets/Plugins/AllIn1SpriteShader/Shaders/LitShaders/AllIn1SpriteShaderLit_BetterShader_URP2021.txt.meta b/Assets/Plugins/AllIn1SpriteShader/Shaders/LitShaders/AllIn1SpriteShaderLit_BetterShader_URP2021.txt.meta new file mode 100644 index 000000000..5dafacce4 --- /dev/null +++ b/Assets/Plugins/AllIn1SpriteShader/Shaders/LitShaders/AllIn1SpriteShaderLit_BetterShader_URP2021.txt.meta @@ -0,0 +1,14 @@ +fileFormatVersion: 2 +guid: 69090a1deecc05842bc9e7d8d9f7ae6e +TextScriptImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 156513 + packageName: All In 1 Sprite Shader + packageVersion: 4.25 + assetPath: Assets/Plugins/AllIn1SpriteShader/Shaders/LitShaders/AllIn1SpriteShaderLit_BetterShader_URP2021.txt + uploadId: 708810 diff --git a/Assets/Plugins/AllIn1SpriteShader/Shaders/LitShaders/AllIn1SpriteShaderLit_BetterShader_URP2022.txt b/Assets/Plugins/AllIn1SpriteShader/Shaders/LitShaders/AllIn1SpriteShaderLit_BetterShader_URP2022.txt new file mode 100644 index 000000000..287812e94 --- /dev/null +++ b/Assets/Plugins/AllIn1SpriteShader/Shaders/LitShaders/AllIn1SpriteShaderLit_BetterShader_URP2022.txt @@ -0,0 +1,14487 @@ +//////////////////////////////////////// +// Generated with Better Shaders +// +// Auto-generated shader code, don't hand edit! +// +// Unity Version: 2019.4.16f1 +// Render Pipeline: URP2022 +// Platform: WindowsEditor +//////////////////////////////////////// + + +Shader "AllIn1SpriteShader/AllIn1SpriteShaderLit_BetterShader" +{ + Properties + { + + _MainTex ("Main Texture", 2D) = "white" {} //0 + _Color("Main Color", Color) = (1,1,1,1) //1 + _Alpha("General Alpha", Range(0,1)) = 1 //2 + + _GlowColor("Glow Color", Color) = (1,1,1,1) //3 + _Glow("Glow Color Intensity", Range(0,100)) = 10 //4 + _GlowGlobal("Global Glow Intensity", Range(1,100)) = 1 //5 + [NoScaleOffset] _GlowTex("Glow Texture", 2D) = "white" {} //6 + + _FadeTex("Fade Texture", 2D) = "white" {} //7 + _FadeAmount("Fade Amount", Range(-0.1,1)) = -0.1 //8 + _FadeBurnWidth("Fade Burn Width", Range(0,1)) = 0.025 //9 + _FadeBurnTransition("Burn Transition", Range(0.01,0.5)) = 0.075 //10 + _FadeBurnColor("Fade Burn Color", Color) = (1,1,0,1) //11 + _FadeBurnTex("Fade Burn Texture", 2D) = "white" {} //12 + _FadeBurnGlow("Fade Burn Glow", Range(1,250)) = 2//13 + + _OutlineColor("Outline Base Color", Color) = (1,1,1,1) //14 + _OutlineAlpha("Outline Base Alpha", Range(0,1)) = 1 //15 + _OutlineGlow("Outline Base Glow", Range(1,100)) = 1.5 //16 + _OutlineWidth("Outline Base Width", Range(0,0.2)) = 0.004 //17 + _OutlinePixelWidth("Outline Base Pixel Width", Int) = 1 //18 + + [Space] + _OutlineTex("Outline Texture", 2D) = "white" {} //19 + _OutlineTexXSpeed("Texture scroll speed X", Range(-50,50)) = 10 //20 + _OutlineTexYSpeed("Texture scroll speed Y", Range(-50,50)) = 0 //21 + + [Space] + _OutlineDistortTex("Outline Distortion Texture", 2D) = "white" {} //22 + _OutlineDistortAmount("Outline Distortion Amount", Range(0,2)) = 0.5 //23 + _OutlineDistortTexXSpeed("Distortion scroll speed X", Range(-50,50)) = 5 //24 + _OutlineDistortTexYSpeed("Distortion scroll speed Y", Range(-50,50)) = 5 //25 + + _AlphaOutlineColor("Color", Color) = (1, 1, 1, 1) //26 + _AlphaOutlineGlow("Outline Glow", Range(1,100)) = 5 //27 + _AlphaOutlinePower("Power", Range(0, 5)) = 1 // 28 + _AlphaOutlineMinAlpha("Min Alpha", Range(0, 1)) = 0 // 29 + _AlphaOutlineBlend("Blend", Range(0, 1)) = 1 // 30 + + _GradBlend("Gradient Blend", Range(0,1)) = 1 //31 + _GradTopLeftCol("Top Color", Color) = (1,0,0,1) //32 + _GradTopRightCol("Top Color 2", Color) = (1, 1, 0, 1) //33 + _GradBotLeftCol("Bot Color", Color) = (0,0,1,1) //34 + _GradBotRightCol("Bot Color 2", Color) = (0, 1, 0, 1) //35 + + [NoScaleOffset] _ColorSwapTex("Color Swap Texture", 2D) = "black" {} //36 + [HDR] _ColorSwapRed("Red Channel", Color) = (1,1,1,1) //37 + _ColorSwapRedLuminosity("Red luminosity", Range(-1,1)) = 0.5 //38 + [HDR] _ColorSwapGreen("Green Channel", Color) = (1,1,1,1) //39 + _ColorSwapGreenLuminosity("Green luminosity", Range(-1,1)) = 0.5 //40 + [HDR] _ColorSwapBlue("Blue Channel", Color) = (1,1,1,1) //41 + _ColorSwapBlueLuminosity("Blue luminosity", Range(-1,1)) = 0.5 //42 + + _HsvShift("Hue Shift", Range(0, 360)) = 180 //43 + _HsvSaturation("Saturation", Range(0, 2)) = 1 //44 + _HsvBright("Brightness", Range(0, 2)) = 1 //45 + + _HitEffectColor("Hit Effect Color", Color) = (1,1,1,1) //46 + _HitEffectGlow("Glow Intensity", Range(1,100)) = 5 //47 + [Space] + _HitEffectBlend("Hit Effect Blend", Range(0,1)) = 1 //48 + + _NegativeAmount("Negative Amount", Range(0, 1)) = 1 //49 + + _PixelateSize("Pixelate size", Range(4,512)) = 32 //50 + + [NoScaleOffset] _ColorRampTex("Color ramp Texture", 2D) = "white" {} //51 + _ColorRampLuminosity("Color ramp luminosity", Range(-1,1)) = 0 //52 + [Toggle()] _ColorRampOutline("Affects everything?", float) = 0 //53 + + _GreyscaleLuminosity("Greyscale luminosity", Range(-1,1)) = 0 //54 + [Toggle()] _GreyscaleOutline("Affects everything?", float) = 0 //55 + _GreyscaleTintColor("Greyscale Tint Color", Color) = (1,1,1,1) //56 + + _PosterizeNumColors("Number of Colors", Range(0,100)) = 8 //57 + _PosterizeGamma("Posterize Amount", Range(0.1,10)) = 0.75 //58 + [Toggle()] _PosterizeOutline("Affects everything?", float) = 0 //59 + + _BlurIntensity("Blur Intensity", Range(0,100)) = 10 //60 + [Toggle()] _BlurHD("Blur is Low Res?", float) = 0 //61 + + _MotionBlurAngle("Motion Blur Angle", Range(-1, 1)) = 0.1 //62 + _MotionBlurDist("Motion Blur Distance", Range(-3, 3)) = 1.25 //63 + + _GhostColorBoost("Ghost Color Boost", Range(0,5)) = 1 //64 + _GhostTransparency("Ghost Transparency", Range(0,1)) = 0 //65 + + _InnerOutlineColor("Inner Outline Color", Color) = (1,0,0,1) //66 + _InnerOutlineThickness("Outline Thickness", Range(0,3)) = 1 //67 + _InnerOutlineAlpha("Inner Outline Alpha", Range(0,1)) = 1 //68 + _InnerOutlineGlow("Inner Outline Glow", Range(1,250)) = 4 //69 + + _AlphaCutoffValue("Alpha cutoff value", Range(0, 1)) = 0.25 //70 + + [Toggle()] _OnlyOutline("Only render outline?", float) = 0 //71 + [Toggle()] _OnlyInnerOutline("Only render inner outline?", float) = 0 //72 + + _HologramStripesAmount("Stripes Amount", Range(0, 1)) = 0.1 //73 + _HologramUnmodAmount("Unchanged Amount", Range(0, 1)) = 0.0 //74 + _HologramStripesSpeed("Stripes Speed", Range(-20, 20)) = 4.5 //75 + _HologramMinAlpha("Min Alpha", Range(0, 1)) = 0.1 //76 + _HologramMaxAlpha("Max Alpha", Range(0, 100)) = 0.75 //77 + + _ChromAberrAmount("ChromAberr Amount", Range(0, 1)) = 1 //78 + _ChromAberrAlpha("ChromAberr Alpha", Range(0, 1)) = 0.4 //79 + + _GlitchAmount("Glitch Amount", Range(0, 20)) = 3 //80 + + _FlickerPercent("Flicker Percent", Range(0, 1)) = 0.05 //81 + _FlickerFreq("Flicker Frequency", Range(0, 5)) = 0.2 //82 + _FlickerAlpha("Flicker Alpha", Range(0, 1)) = 0 //83 + + _ShadowX("Shadow X Axis", Range(-0.5, 0.5)) = 0.1 //84 + _ShadowY("Shadow Y Axis", Range(-0.5, 0.5)) = -0.05 //85 + _ShadowAlpha("Shadow Alpha", Range(0, 1)) = 0.5 //86 + _ShadowColor("Shadow Color", Color) = (0, 0, 0, 1) //87 + + _HandDrawnAmount("Hand Drawn Amount", Range(0, 20)) = 10 //88 + _HandDrawnSpeed("Hand Drawn Speed", Range(1, 15)) = 5 //89 + + _GrassSpeed("Speed", Range(0,50)) = 2 //90 + _GrassWind("Bend amount", Range(0,50)) = 20 //91 + [Space] + [Toggle()] _GrassManualToggle("Manually animated?", float) = 0 //92 + _GrassManualAnim("Manual Anim Value", Range(-1,1)) = 1 //93 + + _WaveAmount("Wave Amount", Range(0, 25)) = 7 //94 + _WaveSpeed("Wave Speed", Range(0, 25)) = 10 //95 + _WaveStrength("Wave Strength", Range(0, 25)) = 7.5 //96 + _WaveX("Wave X Axis", Range(0, 1)) = 0 //97 + _WaveY("Wave Y Axis", Range(0, 1)) = 0.5 //98 + + _RectSize("Rect Size", Range(1, 4)) = 1 //99 + + _OffsetUvX("X axis", Range(-1, 1)) = 0 //100 + _OffsetUvY("Y axis", Range(-1, 1)) = 0 //101 + + _ClipUvLeft("Clipping Left", Range(0, 1)) = 0 //102 + _ClipUvRight("Clipping Right", Range(0, 1)) = 0 //103 + _ClipUvUp("Clipping Up", Range(0, 1)) = 0 //104 + _ClipUvDown("Clipping Down", Range(0, 1)) = 0 //105 + + _TextureScrollXSpeed("Speed X Axis", Range(-5, 5)) = 1 //106 + _TextureScrollYSpeed("Speed Y Axis", Range(-5, 5)) = 0 //107 + + _ZoomUvAmount("Zoom Amount", Range(0.1, 5)) = 0.5 //108 + + _DistortTex("Distortion Texture", 2D) = "white" {} //109 + _DistortAmount("Distortion Amount", Range(0,2)) = 0.5 //110 + _DistortTexXSpeed("Scroll speed X", Range(-50,50)) = 5 //111 + _DistortTexYSpeed("Scroll speed Y", Range(-50,50)) = 5 //112 + + _TwistUvAmount("Twist Amount", Range(0, 3.1416)) = 1 //113 + _TwistUvPosX("Twist Pos X Axis", Range(0, 1)) = 0.5 //114 + _TwistUvPosY("Twist Pos Y Axis", Range(0, 1)) = 0.5 //115 + _TwistUvRadius("Twist Radius", Range(0, 3)) = 0.75 //116 + + _RotateUvAmount("Rotate Angle(radians)", Range(0, 6.2831)) = 0 //117 + + _FishEyeUvAmount("Fish Eye Amount", Range(0, 0.5)) = 0.35 //118 + + _PinchUvAmount("Pinch Amount", Range(0, 0.5)) = 0.35 //119 + + _ShakeUvSpeed("Shake Speed", Range(0, 20)) = 2.5 //120 + _ShakeUvX("X Multiplier", Range(0, 5)) = 1.5 //121 + _ShakeUvY("Y Multiplier", Range(0, 5)) = 1 //122 + + _ColorChangeTolerance("Tolerance", Range(0, 1)) = 0.25 //123 + _ColorChangeTarget("Color to change", Color) = (1, 0, 0, 1) //124 + [HDR] _ColorChangeNewCol("New Color", Color) = (1, 1, 0, 1) //125 + _ColorChangeLuminosity("New Color Luminosity", Range(0, 1)) = 0.0 //126 + + _RoundWaveStrength("Wave Strength", Range(0, 1)) = 0.7 //127 + _RoundWaveSpeed("Wave Speed", Range(0, 5)) = 2 //128 + + [Toggle()] _BillboardY("Billboard on both axis?", float) = 0 //129 + _ZWrite ("Depth Write", Float) = 1.0 // 130 + + _MySrcMode ("SrcMode", Float) = 5 // 131 + _MyDstMode ("DstMode", Float) = 10 // 132 + + _ShineColor("Shine Color", Color) = (1,1,1,1) // 133 + _ShineLocation("Shine Location", Range(0,1)) = 0.5 // 134 + _ShineRotate("Rotate Angle(radians)", Range(0, 6.2831)) = 0 //135 + _ShineWidth("Shine Width", Range(0.05,1)) = 0.1 // 136 + _ShineGlow("Shine Glow", Range(0,100)) = 1 // 137 + [NoScaleOffset] _ShineMask("Shine Mask", 2D) = "white" {} // 138 + + _GlitchSize("Glitch Size", Range(0.25, 5)) = 1 //139 + _HologramStripeColor("Stripes Color", Color) = (0,1,1,1) //140 + _GradBoostX("Boost X axis", Range(0.1, 5)) = 1.2 //141 + _GradBoostY("Boost Y axis", Range(0.1, 5)) = 1.2 //142 + [Toggle()] _GradIsRadial("Radial Gradient?", float) = 0 //143 + _AlphaRoundThreshold("Round Threshold", Range(0.005, 1.0)) = 0.5 //144 + _GrassRadialBend("Radial Bend", Range(0.0, 5.0)) = 0.1 //145 + + _ColorChangeTolerance2("Tolerance 2", Range(0, 1)) = 0.25 //146 + _ColorChangeTarget2("Color to change 2", Color) = (1, 0, 0, 1) //147 + [HDR] _ColorChangeNewCol2("New Color 2", Color) = (1, 1, 0, 1) //148 + _ColorChangeTolerance3("Tolerance 3", Range(0, 1)) = 0.25 //149 + _ColorChangeTarget3("Color to change 3", Color) = (1, 0, 0, 1) //150 + [HDR] _ColorChangeNewCol3("New Color 3", Color) = (1, 1, 0, 1) //151 + + _Contrast ("Contrast", Range(0, 6)) = 1 // 152 + _Brightness ("Brightness", Range(-1, 1)) = 0 // 153 + + _ColorSwapBlend ("Color Swap Blend", Range(0, 1)) = 1 // 154 + _ColorRampBlend ("Color Ramp Blend", Range(0, 1)) = 1 // 155 + _GreyscaleBlend ("Greyscale Blend", Range(0, 1)) = 1 // 156 + _GhostBlend ("Ghost Blend", Range(0, 1)) = 1 // 157 + _HologramBlend ("Hologram Blend", Range(0, 1)) = 1 // 158 + + [AllIn1ShaderGradient] _ColorRampTexGradient("Color ramp Gradient", 2D) = "white" {} //159 + + _OverlayTex("Overlay Texture", 2D) = "white" {} //160 + _OverlayColor("Overlay Color", Color) = (1, 1, 1, 1) //161 + _OverlayGlow("Overlay Glow", Range(0,25)) = 1 // 162 + _OverlayBlend("Overlay Blend", Range(0, 1)) = 1 // 163 + + _RadialStartAngle("Radial Start Angle", Range(0, 360)) = 90 //164 + _RadialClip("Radial Clip", Range(0, 360)) = 45 //165 + _RadialClip2("Radial Clip 2", Range(0, 360)) = 0 //166 + + _WarpStrength("Warp Strength", Range(0, 0.1)) = 0.025 //167 + _WarpSpeed("Warp Speed", Range(0, 25)) = 8 //168 + _WarpScale("Warp Scale", Range(0.05, 3)) = 0.5 //169 + + _OverlayTextureScrollXSpeed("Speed X Axis", Range(-5, 5)) = 0.25 //170 + _OverlayTextureScrollYSpeed("Speed Y Axis", Range(-5, 5)) = 0.25 //171 + + _ZTestMode ("Z Test Mode", Float) = 4 + _CullingOption ("Culling Option", float) = 0 + + [HideInInspector] _MinXUV("_MinXUV", Range(0, 1)) = 0.0 + [HideInInspector] _MaxXUV("_MaxXUV", Range(0, 1)) = 1.0 + [HideInInspector] _MinYUV("_MinYUV", Range(0, 1)) = 0.0 + [HideInInspector] _MaxYUV("_MaxYUV", Range(0, 1)) = 1.0 + [HideInInspector] _RandomSeed("_MaxYUV", Range(0, 10000)) = 0.0 + _EditorDrawers("Editor Drawers", Int) = 6 + + [Normal][NoScaleOffset] _NormalMap("Normal Map", 2D) = "bump" {} + _NormalStrength("Normal Strength", Range(0, 15)) = 1.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) = "" {} + } + SubShader + { + Tags { "RenderPipeline"="UniversalPipeline" "RenderType" = "Opaque" "UniversalMaterialType" = "Lit" "Queue" = "Geometry" } + + + + + Pass + { + Name "Universal Forward" + Tags + { + "LightMode" = "UniversalForward" + } + Cull Back + Blend One Zero + ZTest LEqual + ZWrite On + + Blend One Zero, One Zero +Cull Back +ZTest LEqual +ZWrite On + + Tags { "RenderType" = "Opaque" "Queue" = "Geometry" "PreviewType" = "Plane" } + Cull [_CullingOption] + ZWrite [_ZWrite] + ZTest [_ZTestMode] + + + HLSLPROGRAM + + #pragma vertex Vert + #pragma fragment Frag + + #pragma target 3.0 + + #pragma prefer_hlslcc gles + #pragma exclude_renderers d3d11_9x + #pragma multi_compile_fog + #pragma multi_compile_instancing + #pragma instancing_options renderinglayer + #pragma multi_compile _ DOTS_INSTANCING_ON + + // Keywords + #pragma multi_compile_fragment _ _SCREEN_SPACE_OCCLUSION + #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 _ _ADDITIONAL_LIGHTS_VERTEX _ADDITIONAL_LIGHTS + #pragma multi_compile_fragment _ _ADDITIONAL_LIGHT_SHADOWS + #pragma multi_compile_fragment _ _REFLECTION_PROBE_BLENDING + #pragma multi_compile_fragment _ _REFLECTION_PROBE_BOX_PROJECTION + #pragma multi_compile_fragment _ _SHADOWS_SOFT + #pragma multi_compile _ LIGHTMAP_SHADOW_MIXING + #pragma multi_compile _ SHADOWS_SHADOWMASK + #pragma multi_compile_fragment _ _DBUFFER_MRT1 _DBUFFER_MRT2 _DBUFFER_MRT3 + #pragma multi_compile_fragment _ _LIGHT_LAYERS + #pragma multi_compile_fragment _ DEBUG_DISPLAY + #pragma multi_compile_fragment _ _LIGHT_COOKIES + #pragma multi_compile_fragment _ _WRITE_RENDERING_LAYERS + #pragma multi_compile _ _FORWARD_PLUS + #pragma multi_compile_fragment _ LOD_FADE_CROSSFADE + + // GraphKeywords: + + #define SHADER_PASS SHADERPASS_FORWARD + #define VARYINGS_NEED_FOG_AND_VERTEX_LIGHT + #define _PASSFORWARD 1 + #define _FOG_FRAGMENT 1 + + + + #pragma shader_feature_local GLOW_ON + #pragma shader_feature_local FADE_ON + #pragma shader_feature_local OUTBASE_ON + #pragma shader_feature_local ONLYOUTLINE_ON + #pragma shader_feature_local GRADIENT_ON + #pragma shader_feature_local GRADIENT2COL_ON + #pragma shader_feature_local RADIALGRADIENT_ON + #pragma shader_feature_local COLORSWAP_ON + #pragma shader_feature_local HSV_ON + #pragma shader_feature_local CHANGECOLOR_ON + #pragma shader_feature_local CHANGECOLOR2_ON + #pragma shader_feature_local CHANGECOLOR3_ON + #pragma shader_feature_local COLORRAMP_ON + #pragma shader_feature_local GRADIENTCOLORRAMP_ON + #pragma shader_feature_local HITEFFECT_ON + #pragma shader_feature_local NEGATIVE_ON + #pragma shader_feature_local PIXELATE_ON + #pragma shader_feature_local GREYSCALE_ON + #pragma shader_feature_local POSTERIZE_ON + #pragma shader_feature_local BLUR_ON + #pragma shader_feature_local MOTIONBLUR_ON + #pragma shader_feature_local GHOST_ON + #pragma shader_feature_local ALPHAOUTLINE_ON + #pragma shader_feature_local INNEROUTLINE_ON + #pragma shader_feature_local ONLYINNEROUTLINE_ON + #pragma shader_feature_local HOLOGRAM_ON + #pragma shader_feature_local CHROMABERR_ON + #pragma shader_feature_local GLITCH_ON + #pragma shader_feature_local FLICKER_ON + #pragma shader_feature_local SHADOW_ON + #pragma shader_feature_local SHINE_ON + #pragma shader_feature_local CONTRAST_ON + #pragma shader_feature_local OVERLAY_ON + #pragma shader_feature_local OVERLAYMULT_ON + #pragma shader_feature_local DOODLE_ON + #pragma shader_feature_local WIND_ON + #pragma shader_feature_local WAVEUV_ON + #pragma shader_feature_local ROUNDWAVEUV_ON + #pragma shader_feature_local RECTSIZE_ON + #pragma shader_feature_local OFFSETUV_ON + #pragma shader_feature_local CLIPPING_ON + #pragma shader_feature_local RADIALCLIPPING_ON + #pragma shader_feature_local TEXTURESCROLL_ON + #pragma shader_feature_local ZOOMUV_ON + #pragma shader_feature_local DISTORT_ON + #pragma shader_feature_local WARP_ON + #pragma shader_feature_local TWISTUV_ON + #pragma shader_feature_local ROTATEUV_ON + #pragma shader_feature_local POLARUV_ON + #pragma shader_feature_local FISHEYE_ON + #pragma shader_feature_local PINCH_ON + #pragma shader_feature_local SHAKEUV_ON + + #pragma shader_feature_local GLOWTEX_ON + #pragma shader_feature_local OUTTEX_ON + #pragma shader_feature_local OUTDIST_ON + #pragma shader_feature_local OUTBASE8DIR_ON + #pragma shader_feature_local OUTBASEPIXELPERF_ON + #pragma shader_feature_local COLORRAMPOUTLINE_ON + #pragma shader_feature_local GREYSCALEOUTLINE_ON + #pragma shader_feature_local POSTERIZEOUTLINE_ON + #pragma shader_feature_local BLURISHD_ON + #pragma shader_feature_local MANUALWIND_ON + #pragma shader_feature_local ATLAS_ON + #pragma shader_feature_local PREMULTIPLYALPHA_ON + + #pragma shader_feature BILBOARD_ON + #pragma shader_feature BILBOARDY_ON + + #pragma shader_feature NORMALMAP_ON + + + #define _URP 1 +#define _USINGTEXCOORD1 1 +#define _USINGTEXCOORD2 1 + + + // this has to be here or specular color will be ignored. Not in SG code + #if _SIMPLELIT + #define _SPECULAR_COLOR + #endif + + + // Includes + #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" + #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/LODCrossFade.hlsl" + + + + #undef WorldNormalVector + #define WorldNormalVector(data, normal) mul(normal, data.TBNMatrix) + + #define UnityObjectToWorldNormal(normal) mul(GetObjectToWorldMatrix(), normal) + + #define _WorldSpaceLightPos0 _MainLightPosition + + #define UNITY_DECLARE_TEX2D(name) TEXTURE2D(name); SAMPLER(sampler##name); + #define UNITY_DECLARE_TEX2D_NOSAMPLER(name) TEXTURE2D(name); + #define UNITY_DECLARE_TEX2DARRAY(name) TEXTURE2D_ARRAY(name); SAMPLER(sampler##name); + #define UNITY_DECLARE_TEX2DARRAY_NOSAMPLER(name) TEXTURE2D_ARRAY(name); + + #define UNITY_SAMPLE_TEX2DARRAY(tex,coord) SAMPLE_TEXTURE2D_ARRAY(tex, sampler##tex, coord.xy, coord.z) + #define UNITY_SAMPLE_TEX2DARRAY_LOD(tex,coord,lod) SAMPLE_TEXTURE2D_ARRAY_LOD(tex, sampler##tex, coord.xy, coord.z, lod) + #define UNITY_SAMPLE_TEX2D(tex, coord) SAMPLE_TEXTURE2D(tex, sampler##tex, coord) + #define UNITY_SAMPLE_TEX2D_SAMPLER(tex, samp, coord) SAMPLE_TEXTURE2D(tex, sampler##samp, coord) + + #define UNITY_SAMPLE_TEX2D_LOD(tex,coord, lod) SAMPLE_TEXTURE2D_LOD(tex, sampler_##tex, coord, lod) + #define UNITY_SAMPLE_TEX2D_SAMPLER_LOD(tex,samplertex,coord, lod) SAMPLE_TEXTURE2D_LOD (tex, sampler##samplertex,coord, lod) + + #if defined(UNITY_COMPILER_HLSL) + #define UNITY_INITIALIZE_OUTPUT(type,name) name = (type)0; + #else + #define UNITY_INITIALIZE_OUTPUT(type,name) + #endif + + #define sampler2D_float sampler2D + #define sampler2D_half sampler2D + + + + // data across stages, stripped like the above. + struct VertexToPixel + { + float4 pos : SV_POSITION; + float3 worldPos : TEXCOORD0; + float3 worldNormal : TEXCOORD1; + float4 worldTangent : TEXCOORD2; + float4 texcoord0 : TEXCOORD3; + float4 texcoord1 : TEXCOORD4; + float4 texcoord2 : TEXCOORD5; + + // #if %TEXCOORD3REQUIREKEY% + float4 texcoord3 : TEXCOORD6; + // #endif + + // #if %SCREENPOSREQUIREKEY% + // float4 screenPos : TEXCOORD7; + // #endif + + // #if %VERTEXCOLORREQUIREKEY% + half4 vertexColor : COLOR; + // #endif + + #if defined(LIGHTMAP_ON) + float2 lightmapUV : TEXCOORD8; + #endif + #if defined(DYNAMICLIGHTMAP_ON) + float2 dynamicLightmapUV : TEXCOORD9; + #endif + #if !defined(LIGHTMAP_ON) + float3 sh : TEXCOORD10; + #endif + + #if defined(VARYINGS_NEED_FOG_AND_VERTEX_LIGHT) + float4 fogFactorAndVertexLight : TEXCOORD11; + #endif + + #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR) + float4 shadowCoord : TEXCOORD12; + #endif + + // #if %EXTRAV2F0REQUIREKEY% + // float4 extraV2F0 : TEXCOORD13; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // float4 extraV2F1 : TEXCOORD14; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // float4 extraV2F2 : TEXCOORD15; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // float4 extraV2F3 : TEXCOORD16; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // float4 extraV2F4 : TEXCOORD17; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // float4 extraV2F5 : TEXCOORD18; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // float4 extraV2F6 : TEXCOORD19; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // float4 extraV2F7 : TEXCOORD20; + // #endif + + #if UNITY_ANY_INSTANCING_ENABLED + uint instanceID : CUSTOM_INSTANCE_ID; + #endif + #if (defined(UNITY_STEREO_MULTIVIEW_ENABLED)) || (defined(UNITY_STEREO_INSTANCING_ENABLED) && (defined(SHADER_API_GLES3) || defined(SHADER_API_GLCORE))) + uint stereoTargetEyeIndexAsBlendIdx0 : BLENDINDICES0; + #endif + #if (defined(UNITY_STEREO_INSTANCING_ENABLED)) + uint stereoTargetEyeIndexAsRTArrayIdx : SV_RenderTargetArrayIndex; + #endif + #if defined(SHADER_STAGE_FRAGMENT) && defined(VARYINGS_NEED_CULLFACE) + FRONT_FACE_TYPE cullFace : FRONT_FACE_SEMANTIC; + #endif + + + }; + + + + + // data describing the user output of a pixel + struct Surface + { + half3 Albedo; + half Height; + half3 Normal; + half Smoothness; + half3 Emission; + half Metallic; + half3 Specular; + half Occlusion; + half SpecularPower; // for simple lighting + half Alpha; + float outputDepth; // if written, SV_Depth semantic is used. ShaderData.clipPos.z is unused value + // HDRP Only + half SpecularOcclusion; + half SubsurfaceMask; + half Thickness; + half CoatMask; + half CoatSmoothness; + half Anisotropy; + half IridescenceMask; + half IridescenceThickness; + int DiffusionProfileHash; + float SpecularAAThreshold; + float SpecularAAScreenSpaceVariance; + // requires _OVERRIDE_BAKEDGI to be defined, but is mapped in all pipelines + float3 DiffuseGI; + float3 BackDiffuseGI; + float3 SpecularGI; + float ior; + float3 transmittanceColor; + float atDistance; + float transmittanceMask; + // requires _OVERRIDE_SHADOWMASK to be defines + float4 ShadowMask; + + // for decals + float NormalAlpha; + float MAOSAlpha; + + + }; + + // Data the user declares in blackboard blocks + struct Blackboard + { + + float blackboardDummyData; + }; + + // data the user might need, this will grow to be big. But easy to strip + struct ShaderData + { + float4 clipPos; // SV_POSITION + float3 localSpacePosition; + float3 localSpaceNormal; + float3 localSpaceTangent; + + float3 worldSpacePosition; + float3 worldSpaceNormal; + float3 worldSpaceTangent; + float tangentSign; + + float3 worldSpaceViewDir; + float3 tangentSpaceViewDir; + + float4 texcoord0; + float4 texcoord1; + float4 texcoord2; + float4 texcoord3; + + float2 screenUV; + float4 screenPos; + + float4 vertexColor; + bool isFrontFace; + + float4 extraV2F0; + float4 extraV2F1; + float4 extraV2F2; + float4 extraV2F3; + float4 extraV2F4; + float4 extraV2F5; + float4 extraV2F6; + float4 extraV2F7; + + float3x3 TBNMatrix; + Blackboard blackboard; + }; + + struct VertexData + { + #if SHADER_TARGET > 30 + // uint vertexID : SV_VertexID; + #endif + float4 vertex : POSITION; + float3 normal : NORMAL; + float4 tangent : TANGENT; + float4 texcoord0 : TEXCOORD0; + + // optimize out mesh coords when not in use by user or lighting system + #if _URP && (_USINGTEXCOORD1 || _PASSMETA || _PASSFORWARD || _PASSGBUFFER) + float4 texcoord1 : TEXCOORD1; + #endif + + #if _URP && (_USINGTEXCOORD2 || _PASSMETA || ((_PASSFORWARD || _PASSGBUFFER) && defined(DYNAMICLIGHTMAP_ON))) + float4 texcoord2 : TEXCOORD2; + #endif + + #if _STANDARD && (_USINGTEXCOORD1 || (_PASSMETA || ((_PASSFORWARD || _PASSGBUFFER || _PASSFORWARDADD) && LIGHTMAP_ON))) + float4 texcoord1 : TEXCOORD1; + #endif + #if _STANDARD && (_USINGTEXCOORD2 || (_PASSMETA || ((_PASSFORWARD || _PASSGBUFFER) && DYNAMICLIGHTMAP_ON))) + float4 texcoord2 : TEXCOORD2; + #endif + + + #if _HDRP + float4 texcoord1 : TEXCOORD1; + float4 texcoord2 : TEXCOORD2; + #endif + + // #if %TEXCOORD3REQUIREKEY% + float4 texcoord3 : TEXCOORD3; + // #endif + + // #if %VERTEXCOLORREQUIREKEY% + float4 vertexColor : COLOR; + // #endif + + #if _PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR)) + float3 previousPositionOS : TEXCOORD4; // Contain previous transform position (in case of skinning for example) + #if defined (_ADD_PRECOMPUTED_VELOCITY) + float3 precomputedVelocity : TEXCOORD5; // Add Precomputed Velocity (Alembic computes velocities on runtime side). + #endif + #endif + + UNITY_VERTEX_INPUT_INSTANCE_ID + }; + + struct TessVertex + { + float4 vertex : INTERNALTESSPOS; + float3 normal : NORMAL; + float4 tangent : TANGENT; + float4 texcoord0 : TEXCOORD0; + float4 texcoord1 : TEXCOORD1; + float4 texcoord2 : TEXCOORD2; + + // #if %TEXCOORD3REQUIREKEY% + float4 texcoord3 : TEXCOORD3; + // #endif + + // #if %VERTEXCOLORREQUIREKEY% + float4 vertexColor : COLOR; + // #endif + + // #if %EXTRAV2F0REQUIREKEY% + // float4 extraV2F0 : TEXCOORD5; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // float4 extraV2F1 : TEXCOORD6; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // float4 extraV2F2 : TEXCOORD7; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // float4 extraV2F3 : TEXCOORD8; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // float4 extraV2F4 : TEXCOORD9; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // float4 extraV2F5 : TEXCOORD10; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // float4 extraV2F6 : TEXCOORD11; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // float4 extraV2F7 : TEXCOORD12; + // #endif + + #if _PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR)) + float3 previousPositionOS : TEXCOORD13; // Contain previous transform position (in case of skinning for example) + #if defined (_ADD_PRECOMPUTED_VELOCITY) + float3 precomputedVelocity : TEXCOORD14; + #endif + #endif + + UNITY_VERTEX_INPUT_INSTANCE_ID + UNITY_VERTEX_OUTPUT_STEREO + }; + + struct ExtraV2F + { + float4 extraV2F0; + float4 extraV2F1; + float4 extraV2F2; + float4 extraV2F3; + float4 extraV2F4; + float4 extraV2F5; + float4 extraV2F6; + float4 extraV2F7; + Blackboard blackboard; + float4 time; + }; + + + float3 WorldToTangentSpace(ShaderData d, float3 normal) + { + return mul(d.TBNMatrix, normal); + } + + float3 TangentToWorldSpace(ShaderData d, float3 normal) + { + return mul(normal, d.TBNMatrix); + } + + // in this case, make standard more like SRPs, because we can't fix + // unity_WorldToObject in HDRP, since it already does macro-fu there + + #if _STANDARD + float3 TransformWorldToObject(float3 p) { return mul(unity_WorldToObject, float4(p, 1)); }; + float3 TransformObjectToWorld(float3 p) { return mul(unity_ObjectToWorld, float4(p, 1)); }; + float4 TransformWorldToObject(float4 p) { return mul(unity_WorldToObject, p); }; + float4 TransformObjectToWorld(float4 p) { return mul(unity_ObjectToWorld, p); }; + float4x4 GetWorldToObjectMatrix() { return unity_WorldToObject; } + float4x4 GetObjectToWorldMatrix() { return unity_ObjectToWorld; } + #if (defined(SHADER_API_D3D11) || defined(SHADER_API_XBOXONE) || defined(UNITY_COMPILER_HLSLCC) || defined(SHADER_API_PSSL) || (SHADER_TARGET_SURFACE_ANALYSIS && !SHADER_TARGET_SURFACE_ANALYSIS_MOJOSHADER)) + #define UNITY_SAMPLE_TEX2D_LOD(tex,coord, lod) tex.SampleLevel (sampler##tex,coord, lod) + #define UNITY_SAMPLE_TEX2D_SAMPLER_LOD(tex,samplertex,coord, lod) tex.SampleLevel (sampler##samplertex,coord, lod) + #else + #define UNITY_SAMPLE_TEX2D_LOD(tex,coord,lod) tex2D (tex,coord,0,lod) + #define UNITY_SAMPLE_TEX2D_SAMPLER_LOD(tex,samplertex,coord,lod) tex2D (tex,coord,0,lod) + #endif + + #undef GetWorldToObjectMatrix() + + #define GetWorldToObjectMatrix() unity_WorldToObject + + + #endif + + float3 GetCameraWorldPosition() + { + #if _HDRP + return GetCameraRelativePositionWS(_WorldSpaceCameraPos); + #else + return _WorldSpaceCameraPos; + #endif + } + + #if _GRABPASSUSED + #if _STANDARD + TEXTURE2D(%GRABTEXTURE%); + SAMPLER(sampler_%GRABTEXTURE%); + #endif + + half3 GetSceneColor(float2 uv) + { + #if _STANDARD + return SAMPLE_TEXTURE2D(%GRABTEXTURE%, sampler_%GRABTEXTURE%, uv).rgb; + #else + return SHADERGRAPH_SAMPLE_SCENE_COLOR(uv); + #endif + } + #endif + + + + #if _STANDARD + UNITY_DECLARE_DEPTH_TEXTURE(_CameraDepthTexture); + float GetSceneDepth(float2 uv) { return SAMPLE_DEPTH_TEXTURE(_CameraDepthTexture, uv); } + float GetLinear01Depth(float2 uv) { return Linear01Depth(GetSceneDepth(uv)); } + float GetLinearEyeDepth(float2 uv) { return LinearEyeDepth(GetSceneDepth(uv)); } + #else + float GetSceneDepth(float2 uv) { return SHADERGRAPH_SAMPLE_SCENE_DEPTH(uv); } + float GetLinear01Depth(float2 uv) { return Linear01Depth(GetSceneDepth(uv), _ZBufferParams); } + float GetLinearEyeDepth(float2 uv) { return LinearEyeDepth(GetSceneDepth(uv), _ZBufferParams); } + #endif + + float3 GetWorldPositionFromDepthBuffer(float2 uv, float3 worldSpaceViewDir) + { + float eye = GetLinearEyeDepth(uv); + float3 camView = mul((float3x3)GetObjectToWorldMatrix(), transpose(mul(GetWorldToObjectMatrix(), UNITY_MATRIX_I_V)) [2].xyz); + + float dt = dot(worldSpaceViewDir, camView); + float3 div = worldSpaceViewDir/dt; + float3 wpos = (eye * div) + GetCameraWorldPosition(); + return wpos; + } + + #if _HDRP + float3 ObjectToWorldSpacePosition(float3 pos) + { + return GetAbsolutePositionWS(TransformObjectToWorld(pos)); + } + #else + float3 ObjectToWorldSpacePosition(float3 pos) + { + return TransformObjectToWorld(pos); + } + #endif + + #if _STANDARD + UNITY_DECLARE_SCREENSPACE_TEXTURE(_CameraDepthNormalsTexture); + float3 GetSceneNormal(float2 uv, float3 worldSpaceViewDir) + { + float4 depthNorms = UNITY_SAMPLE_SCREENSPACE_TEXTURE(_CameraDepthNormalsTexture, uv); + float3 norms = DecodeViewNormalStereo(depthNorms); + norms = mul((float3x3)GetWorldToViewMatrix(), norms) * 0.5 + 0.5; + return norms; + } + #elif _HDRP && !_DECALSHADER + + float3 GetSceneNormal(float2 uv, float3 worldSpaceViewDir) + { + NormalData nd; + DecodeFromNormalBuffer(_ScreenSize.xy * uv, nd); + return nd.normalWS; + } + #elif _URP + #if (SHADER_LIBRARY_VERSION_MAJOR >= 10) + #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/DeclareNormalsTexture.hlsl" + #endif + + float3 GetSceneNormal(float2 uv, float3 worldSpaceViewDir) + { + #if (SHADER_LIBRARY_VERSION_MAJOR >= 10) + return SampleSceneNormals(uv); + #else + float3 wpos = GetWorldPositionFromDepthBuffer(uv, worldSpaceViewDir); + return normalize(-cross(ddx(wpos), ddy(wpos))) * 0.5 + 0.5; + #endif + + } + #endif + + #if _HDRP + + half3 UnpackNormalmapRGorAG(half4 packednormal) + { + // This do the trick + packednormal.x *= packednormal.w; + + half3 normal; + normal.xy = packednormal.xy * 2 - 1; + normal.z = sqrt(1 - saturate(dot(normal.xy, normal.xy))); + return normal; + } + half3 UnpackNormal(half4 packednormal) + { + #if defined(UNITY_NO_DXT5nm) + return packednormal.xyz * 2 - 1; + #else + return UnpackNormalmapRGorAG(packednormal); + #endif + } + #endif + #if _HDRP || _URP + + half3 UnpackScaleNormal(half4 packednormal, half scale) + { + #ifndef UNITY_NO_DXT5nm + // Unpack normal as DXT5nm (1, y, 1, x) or BC5 (x, y, 0, 1) + // Note neutral texture like "bump" is (0, 0, 1, 1) to work with both plain RGB normal and DXT5nm/BC5 + packednormal.x *= packednormal.w; + #endif + half3 normal; + normal.xy = (packednormal.xy * 2 - 1) * scale; + normal.z = sqrt(1 - saturate(dot(normal.xy, normal.xy))); + return normal; + } + + #endif + + + void GetSun(out float3 lightDir, out float3 color) + { + lightDir = float3(0.5, 0.5, 0); + color = 1; + #if _HDRP + if (_DirectionalLightCount > 0) + { + DirectionalLightData light = _DirectionalLightDatas[0]; + lightDir = -light.forward.xyz; + color = light.color; + } + #elif _STANDARD + lightDir = normalize(_WorldSpaceLightPos0.xyz); + color = _LightColor0.rgb; + #elif _URP + Light light = GetMainLight(); + lightDir = light.direction; + color = light.color; + #endif + } + + + + CBUFFER_START(UnityPerMaterial) + + + half4 _Color; + half4 _MainTex_ST, _MainTex_TexelSize; + half _Alpha, _AlphaCutoffValue; + + #if ATLAS_ON + half _MinXUV, _MaxXUV, _MinYUV, _MaxYUV; + #endif + + #if GLOW_ON + half4 _GlowColor; + half _Glow, _GlowGlobal; + #endif + + #if HSV_ON + half _HsvShift, _HsvSaturation, _HsvBright; + #endif + + #if DISTORT_ON + half4 _DistortTex_ST; + half _DistortTexXSpeed, _DistortTexYSpeed, _DistortAmount; + #endif + + #if FADE_ON + half4 _FadeBurnColor, _FadeTex_ST, _FadeBurnTex_ST; + half _FadeAmount, _FadeBurnWidth, _FadeBurnTransition,_FadeBurnGlow; + #endif + + #if OUTBASE_ON + half4 _OutlineColor; + half _OutlineAlpha, _OutlineGlow, _OutlineWidth; + int _OutlinePixelWidth; + #endif + + #if OUTTEX_ON + half4 _OutlineTex_ST; + half _OutlineTexXSpeed, _OutlineTexYSpeed; + #endif + + #if OUTDIST_ON + half4 _OutlineDistortTex_ST; + half _OutlineDistortTexXSpeed, _OutlineDistortTexYSpeed, _OutlineDistortAmount; + #endif + + #if ALPHAOUTLINE_ON + half _AlphaOutlineGlow, _AlphaOutlinePower, _AlphaOutlineMinAlpha, _AlphaOutlineBlend; + half4 _AlphaOutlineColor; + #endif + + #if INNEROUTLINE_ON + half _InnerOutlineThickness, _InnerOutlineAlpha, _InnerOutlineGlow; + half4 _InnerOutlineColor; + #endif + + #if GRADIENT_ON + half _GradBlend, _GradBoostX, _GradBoostY; + half4 _GradTopRightCol, _GradTopLeftCol, _GradBotRightCol, _GradBotLeftCol; + #endif + + #if COLORSWAP_ON + half4 _ColorSwapRed, _ColorSwapGreen, _ColorSwapBlue; + half _ColorSwapRedLuminosity, _ColorSwapGreenLuminosity, _ColorSwapBlueLuminosity, _ColorSwapBlend; + #endif + + #if CHANGECOLOR_ON + half4 _ColorChangeNewCol, _ColorChangeTarget; + half _ColorChangeTolerance, _ColorChangeLuminosity; + #endif + #if CHANGECOLOR2_ON + half4 _ColorChangeNewCol2, _ColorChangeTarget2; + half _ColorChangeTolerance2; + #endif + #if CHANGECOLOR3_ON + half4 _ColorChangeNewCol3, _ColorChangeTarget3; + half _ColorChangeTolerance3; + #endif + + #if COLORRAMP_ON + half _ColorRampLuminosity, _ColorRampBlend; + #endif + + #if HITEFFECT_ON + half4 _HitEffectColor; + half _HitEffectGlow, _HitEffectBlend; + #endif + + #if NEGATIVE_ON + half _NegativeAmount; + #endif + + #if PIXELATE_ON + half _PixelateSize; + #endif + + #if GREYSCALE_ON + half _GreyscaleLuminosity, _GreyscaleBlend; + half4 _GreyscaleTintColor; + #endif + + #if POSTERIZE_ON + half _PosterizeNumColors, _PosterizeGamma; + #endif + + #if BLUR_ON + half _BlurIntensity; + #endif + + #if MOTIONBLUR_ON + half _MotionBlurAngle, _MotionBlurDist; + #endif + + #if GHOST_ON + half _GhostColorBoost, _GhostTransparency, _GhostBlend; + #endif + + #if HOLOGRAM_ON + half _HologramStripesAmount, _HologramMinAlpha, _HologramUnmodAmount, _HologramStripesSpeed, _HologramMaxAlpha, _HologramBlend; + half4 _HologramStripeColor; + #endif + + #if CHROMABERR_ON + half _ChromAberrAmount, _ChromAberrAlpha; + #endif + + #if GLITCH_ON + half _GlitchAmount, _GlitchSize; + #endif + + #if FLICKER_ON + half _FlickerFreq, _FlickerPercent, _FlickerAlpha; + #endif + + #if SHADOW_ON + half _ShadowX, _ShadowY, _ShadowAlpha; + half4 _ShadowColor; + #endif + + #if SHINE_ON + half4 _ShineColor; + half _ShineLocation, _ShineRotate, _ShineWidth, _ShineGlow; + #endif + + #if CONTRAST_ON + half _Contrast, _Brightness; + #endif + + #if OVERLAY_ON + half4 _OverlayTex_ST, _OverlayColor; + half _OverlayGlow, _OverlayBlend, _OverlayTextureScrollXSpeed, _OverlayTextureScrollYSpeed; + #endif + + #if DOODLE_ON + half _HandDrawnAmount, _HandDrawnSpeed; + #endif + + #if WIND_ON + half _GrassSpeed, _GrassWind, _GrassManualAnim, _GrassRadialBend; + #endif + + #if WAVEUV_ON + float _WaveAmount, _WaveSpeed, _WaveStrength, _WaveX, _WaveY; + #endif + + #if ROUNDWAVEUV_ON + half _RoundWaveStrength, _RoundWaveSpeed; + #endif + + #if RECTSIZE_ON + half _RectSize; + #endif + + #if OFFSETUV_ON + half _OffsetUvX, _OffsetUvY; + #endif + + #if CLIPPING_ON + half _ClipUvLeft, _ClipUvRight, _ClipUvUp, _ClipUvDown; + #endif + + #if RADIALCLIPPING_ON + half _RadialStartAngle, _RadialClip, _RadialClip2; + #endif + + #if TEXTURESCROLL_ON + half _TextureScrollXSpeed, _TextureScrollYSpeed; + #endif + + #if ZOOMUV_ON + half _ZoomUvAmount; + #endif + + #if WARP_ON + half _WarpStrength, _WarpSpeed, _WarpScale; + #endif + + #if TWISTUV_ON + half _TwistUvAmount, _TwistUvPosX, _TwistUvPosY, _TwistUvRadius; + #endif + + #if ROTATEUV_ON + half _RotateUvAmount; + #endif + + #if FISHEYE_ON + half _FishEyeUvAmount; + #endif + + #if PINCH_ON + half _PinchUvAmount; + #endif + + #if SHAKEUV_ON + half _ShakeUvSpeed, _ShakeUvX, _ShakeUvY; + #endif + + #if NORMALMAP_ON + half _NormalStrength; + #endif + + float _RandomSeed; + + + + + CBUFFER_END + + + + + + + + TEXTURE2D(_MainTex); + SAMPLER(sampler_MainTex); + + #if GLOW_ON + TEXTURE2D(_GlowTex); + SAMPLER(sampler_GlowTex); + #endif + + #if FADE_ON + TEXTURE2D(_FadeTex); + SAMPLER(sampler_FadeTex); + + TEXTURE2D(_FadeBurnTex); + SAMPLER(sampler_FadeBurnTex); + #endif + + #if DISTORT_ON + TEXTURE2D(_DistortTex); + SAMPLER(sampler_DistortTex); + #endif + + #if OUTTEX_ON + TEXTURE2D(_OutlineTex); + SAMPLER(sampler_OutlineTex); + #endif + + #if OUTDIST_ON + TEXTURE2D(_OutlineDistortTex); + SAMPLER(sampler_OutlineDistortTex); + #endif + + #if COLORSWAP_ON + TEXTURE2D(_ColorSwapTex); + SAMPLER(sampler_ColorSwapTex); + #endif + + #if COLORRAMP_ON + TEXTURE2D(_ColorRampTex); + TEXTURE2D(_ColorRampTexGradient); + SAMPLER(sampler_ColorRampTex); + SAMPLER(sampler_ColorRampTexGradient); + #endif + + #if SHINE_ON + TEXTURE2D(_ShineMask); + SAMPLER(sampler_ShineMask); + #endif + + #if OVERLAY_ON + TEXTURE2D(_OverlayTex); + SAMPLER(sampler_OverlayTex); + #endif + + #if NORMALMAP_ON + TEXTURE2D(_NormalMap); + SAMPLER(sampler_NormalMap); + #endif + + + half3 GetPixel(in int offsetX, in int offsetY, in half2 uv, in Texture2D _tex, in SamplerState _sampler) + { + half2 _uv = uv + half2(offsetX * _MainTex_TexelSize.x, offsetY * _MainTex_TexelSize.y); + half4 col = SAMPLE_TEXTURE2D(_tex, _sampler, _uv); + return col.rgb; + } + + + //BLURS------------------------------------------------------------------------- + half4 Blur(half2 uv, Texture2D source, SamplerState sampler_source, half Intensity) + { + const half2 texelSize = 1.0 / _ScreenParams.xy; + const half4 color = SAMPLE_TEXTURE2D(source, sampler_source, uv); + const half2 offset = Intensity * texelSize; + + half4 accumulatedColor = color; + half accumulatedWeight = 1.0; + for (int x = -1; x <= 1; x++) + { + for (int y = -1; y <= 1; y++) + { + const half2 sampleUV = uv + half2(x, y) * offset; + const half4 sampleColor = SAMPLE_TEXTURE2D(source, sampler_source, sampleUV); + + accumulatedColor += sampleColor; + accumulatedWeight += 1.0; + } + } + + half4 blurredColor = accumulatedColor / accumulatedWeight; + return blurredColor; + } + + half BlurHD_G(half bhqp, half x) + { + return exp(-(x * x) / (2.0 * bhqp * bhqp)); + } + half4 BlurHD(half2 uv, Texture2D source, SamplerState sampler_source, half BlurAmount, half xScale, half yScale) + { + int iterations = 16; + int halfIterations = iterations / 2; + half sigmaX = 0.1 + BlurAmount * 0.5; + half sigmaY = sigmaX; + half total = 0.0; + half4 ret = half4(0, 0, 0, 0); + for (int iy = 0; iy < iterations; ++iy) + { + half fy = BlurHD_G(sigmaY, half(iy) -half(halfIterations)); + half offsetY = half(iy - halfIterations) * 0.00390625 * xScale; + for (int ix = 0; ix < iterations; ++ix) + { + half fx = BlurHD_G(sigmaX, half(ix) - half(halfIterations)); + half offsetX = half(ix - halfIterations) * 0.00390625 * yScale; + total += fx * fy; + ret += SAMPLE_TEXTURE2D(source, sampler_source, uv + half2(offsetX, offsetY)) * fx * fy; + } + } + return ret / total; + } + //----------------------------------------------------------------------- + + + //------------------------------------------- + half RemapFloat(half inValue, half inMin, half inMax, half outMin, half outMax){ + return outMin + (inValue - inMin) * (outMax - outMin) / (inMax - inMin); + } + //------------------------------------------- + + //----------------------------------------------------------------------- + half rand(half2 seed, half offset) { + return (frac(sin(dot(seed, half2(12.9898, 78.233))) * 43758.5453) + offset) % 1.0; + } + + half rand2(half2 seed, half offset) { + return (frac(sin(dot(seed * floor(50 + (_Time.x % 1.0) * 12.), half2(127.1, 311.7))) * 43758.5453123) + offset) % 1.0; + } + + half rand2CustomTime(half2 seed, half offset, half customTime) { + return (frac(sin(dot(seed * floor(50 + (customTime % 1.0) * 12.), half2(127.1, 311.7))) * 43758.5453123) + offset) % 1.0; + } + //----------------------------------------------------------------------- + + + void Ext_ModifyVertex0 (inout VertexData v, inout ExtraV2F d) + { + //BILBOARD_ON + #if BILBOARD_ON + half3 camRight = mul((half3x3)unity_CameraToWorld, half3(1,0,0)); + half3 camUp = half3(0,1,0); + #if BILBOARDY_ON + camUp = mul((half3x3)unity_CameraToWorld, half3(0,1,0)); + #endif + half3 localPos = v.vertex.x * camRight + v.vertex.y * camUp; + v.vertex = half4(localPos, 1); + #endif + //----------------------------------------------------------- + + v.texcoord0.xy = TRANSFORM_TEX(v.texcoord0.xy, _MainTex); + half2 center = half2(0.5, 0.5); + #if ATLAS_ON + center = half2((_MaxXUV + _MinXUV) / 2.0, (_MaxYUV + _MinYUV) / 2.0); + #endif + + //POLARUV_ON + #if POLARUV_ON + v.texcoord0.xy = v.texcoord0.xy - center; + #endif + + //---------------------------------------- + + //ROTATEUV_ON + #if ROTATEUV_ON + half2 uvC = v.texcoord0.xy; + half cosAngle = cos(_RotateUvAmount); + half sinAngle = sin(_RotateUvAmount); + half2x2 rot = half2x2(cosAngle, -sinAngle, sinAngle, cosAngle); + uvC -= center; + v.texcoord0.xy = mul(rot, uvC); + v.texcoord0.xy += center; + #endif + //-------------------- + + #if RECTSIZE_ON + v.vertex.xyz += (v.vertex.xyz * (_RectSize - 1.0)); + #endif + + #if OUTTEX_ON + v.texcoord1.xy = TRANSFORM_TEX(v.texcoord0.xy, _OutlineTex); + #endif + + #if OUTDIST_ON + v.texcoord2.xy = TRANSFORM_TEX(v.texcoord0.xy, _OutlineDistortTex); + #endif + + #if DISTORT_ON + v.texcoord3.xy = TRANSFORM_TEX(v.texcoord0.xy, _DistortTex); + #endif + } + + void Ext_SurfaceFunction0 (inout Surface o, ShaderData d) + { + half randomSeed = _RandomSeed; + + float2 uvRect = d.texcoord0; + half2 center = half2(0.5, 0.5); + #if ATLAS_ON + center = half2((_MaxXUV + _MinXUV) / 2.0, (_MaxYUV + _MinYUV) / 2.0); + uvRect = half2((d.texcoord0.x - _MinXUV) / (_MaxXUV - _MinXUV), (d.texcoord0.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half2 centerTiled = half2(center.x * _MainTex_ST.x, center.y * _MainTex_ST.y); + + //CLIPPING_ON + #if CLIPPING_ON + half2 tiledUv = half2(d.texcoord0.x / _MainTex_ST.x, d.texcoord0.y / _MainTex_ST.y); + #if ATLAS_ON + tiledUv = half2((tiledUv.x - _MinXUV) / (_MaxXUV - _MinXUV), (tiledUv.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + clip((1 - _ClipUvUp) - tiledUv.y); + clip(tiledUv.y - _ClipUvDown); + clip((1 - _ClipUvRight) - tiledUv.x); + clip(tiledUv.x - _ClipUvLeft); + #endif + //---------------------------------- + + //RADIALCLIPPING_ON + #if RADIALCLIPPING_ON + half2 tiledUv2 = half2(d.texcoord0.x / _MainTex_ST.x, d.texcoord0.y / _MainTex_ST.y); + #if ATLAS_ON + tiledUv2 = half2((tiledUv2.x - _MinXUV) / (_MaxXUV - _MinXUV), (tiledUv2.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half startAngle = _RadialStartAngle - _RadialClip; + half endAngle = _RadialStartAngle + _RadialClip2; + half offset0 = clamp(0, 360, startAngle + 360); + half offset360 = clamp(0, 360, endAngle - 360); + half2 atan2Coord = half2(lerp(-1, 1, tiledUv2.x), lerp(-1, 1, tiledUv2.y)); + half atanAngle = atan2(atan2Coord.y, atan2Coord.x) * 57.3; // angle in degrees + if(atanAngle < 0) atanAngle = 360 + atanAngle; + if(atanAngle >= startAngle && atanAngle <= endAngle) discard; + if(atanAngle <= offset360) discard; + if(atanAngle >= offset0) discard; + #endif + + //----------------------------- + + //TEXTURESCROLL_ON && ATLAS_ON + #if TEXTURESCROLL_ON && ATLAS_ON + d.texcoord0.xy = half2(_MinXUV + ((_MaxXUV - _MinXUV) * (abs(((_Time.y + randomSeed) * _TextureScrollXSpeed) + uvRect.x) % 1)), + _MinYUV + ((_MaxYUV - _MinYUV) * (abs(((_Time.y + randomSeed) * _TextureScrollYSpeed) + uvRect.y) % 1))); + #endif + //---------------------------- + + //OFFSETUV_ON + #if OFFSETUV_ON + #if ATLAS_ON + d.texcoord0.xy = half2(_MinXUV + ((_MaxXUV - _MinXUV) * (abs((_OffsetUvX + uvRect.x) % 1))), + _MinYUV + ((_MaxYUV - _MinYUV) * (abs(_OffsetUvY + uvRect.y) % 1))); + #else + d.texcoord0.xy += half2(_OffsetUvX, _OffsetUvY); + #endif + #endif + + //---------------------- + + //POLARUV_ON + #if POLARUV_ON + d.texcoord0.xy = half2(atan2(d.texcoord0.y, d.texcoord0.x) / (2.0f * 3.141592653589f), length(d.texcoord0.xy)); + d.texcoord0.xy *= _MainTex_ST.xy; + #endif + + //-------------------------------------- + + //TWISTUV_ON + #if TWISTUV_ON + #if ATLAS_ON + _TwistUvPosX = ((_MaxXUV - _MinXUV) * _TwistUvPosX) + _MinXUV; + _TwistUvPosY = ((_MaxYUV - _MinYUV) * _TwistUvPosY) + _MinYUV; + #endif + half2 tempUv = d.texcoord0.xy - half2(_TwistUvPosX * _MainTex_ST.x, _TwistUvPosY * _MainTex_ST.y); + _TwistUvRadius *= (_MainTex_ST.x + _MainTex_ST.y) / 2; + half percent = (_TwistUvRadius - length(tempUv)) / _TwistUvRadius; + half theta = percent * percent * (2.0 * sin(_TwistUvAmount)) * 8.0; + half s = sin(theta); + half c = cos(theta); + half beta = max(sign(_TwistUvRadius - length(tempUv)), 0.0); + tempUv = half2(dot(tempUv, half2(c, -s)), dot(tempUv, half2(s, c))) * beta + tempUv * (1 - beta); + tempUv += half2(_TwistUvPosX * _MainTex_ST.x, _TwistUvPosY * _MainTex_ST.y); + d.texcoord0.xy = tempUv; + #endif + + //-------------------------------------------- + + //FISHEYE_ON + #if FISHEYE_ON + half bind = length(centerTiled); + half2 dF = d.texcoord0.xy - centerTiled; + half dFlen = length(dF); + half fishInt = (3.14159265359 / bind) * (_FishEyeUvAmount + 0.001); + d.texcoord0.xy = centerTiled + (dF / (max(0.0001, dFlen))) * tan(dFlen * fishInt) * bind / tan(bind * fishInt); + #endif + //--------------------------------------------- + + //PINCH_ON + #if PINCH_ON + half2 dP = d.texcoord0.xy - centerTiled; + half pinchInt = (3.141592 / length(centerTiled)) * (-_PinchUvAmount + 0.001); + d.texcoord0.xy = centerTiled + normalize(dP) * atan(length(dP) * -pinchInt * 10.0) * 0.5 / atan(-pinchInt * 5); + #endif + + //--------------------------------------------- + + //ZOOMUV_ON + #if ZOOMUV_ON + d.texcoord0.xy -= centerTiled; + d.texcoord0.xy = d.texcoord0.xy * _ZoomUvAmount; + d.texcoord0.xy += centerTiled; + #endif + + //----------------------------------------------- + + //DOODLE_ON + #if DOODLE_ON + half2 uvCopy = uvRect; + _HandDrawnSpeed = (floor((_Time.x + randomSeed) * 20 * _HandDrawnSpeed) / _HandDrawnSpeed) * _HandDrawnSpeed; + uvCopy.x = sin((uvCopy.x * _HandDrawnAmount + _HandDrawnSpeed) * 4); + uvCopy.y = cos((uvCopy.y * _HandDrawnAmount + _HandDrawnSpeed) * 4); + d.texcoord0.xy = lerp(d.texcoord0.xy, d.texcoord0.xy + uvCopy, 0.0005 * _HandDrawnAmount); + #endif + + //-------------------------- + + //SHAKEUV_ON + #if SHAKEUV_ON + half xShake = sin((_Time.x + randomSeed) * _ShakeUvSpeed * 50) * _ShakeUvX; + half yShake = cos((_Time.x + randomSeed) * _ShakeUvSpeed * 50) * _ShakeUvY; + d.texcoord0.xy += half2(xShake * 0.012, yShake * 0.01); + #endif + + //------------------------------------------- + + //RECTSIZE_ON + #if RECTSIZE_ON + d.texcoord0.xy = d.texcoord0.xy * (_RectSize).xx + (((-_RectSize * 0.5) + 0.5)).xx; + #endif + + //------------------------------------------- + + //DISTORT_ON + #if DISTORT_ON + #if ATLAS_ON + d.texcoord3.x = d.texcoord3.x * (1 / (_MaxXUV - _MinXUV)); + d.texcoord3.y = d.texcoord3.y * (1 / (_MaxYUV - _MinYUV)); + #endif + + d.texcoord3.x += ((_Time.x + _RandomSeed) * _DistortTexXSpeed) % 1; + d.texcoord3.y += ((_Time.x + _RandomSeed) * _DistortTexYSpeed) % 1; + half distortAmnt = (SAMPLE_TEXTURE2D(_DistortTex, sampler_DistortTex, d.texcoord3.xy).r - 0.5) * 0.2 * _DistortAmount; + d.texcoord0.x += distortAmnt; + d.texcoord0.y += distortAmnt; + #endif + //------------------------------------------------------- + + //WARP_ON + #if WARP_ON + half2 warpUv = half2(d.texcoord0.x / _MainTex_ST.x, d.texcoord0.y / _MainTex_ST.y); + #if ATLAS_ON + warpUv = half2((warpUv.x - _MinXUV) / (_MaxXUV - _MinXUV), (warpUv.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + const float tau = 6.283185307179586; + float xWarp = (_Time.y + randomSeed) * _WarpSpeed + warpUv.x * tau / _WarpScale; + float yWarp = (_Time.y + randomSeed) * _WarpSpeed + warpUv.y * tau / _WarpScale; + float2 warp = float2(sin(xWarp), sin(yWarp)) * _WarpStrength; + d.texcoord0.xy += warp; + #endif + + //------------------------------------------------------- + + //WAVEUV_ON + #if WAVEUV_ON + float2 uvWave = half2(_WaveX * _MainTex_ST.x, _WaveY * _MainTex_ST.y) - d.texcoord0.xy; + uvWave %= 1; + #if ATLAS_ON + uvWave = half2(_WaveX, _WaveY) - uvRect; + #endif + uvWave.x *= _ScreenParams.x / _ScreenParams.y; + float waveTime = _Time.y + randomSeed; + float angWave = (sqrt(dot(uvWave, uvWave)) * _WaveAmount) - ((waveTime * _WaveSpeed)); + d.texcoord0.xy = d.texcoord0.xy + uvWave * sin(angWave) * (_WaveStrength / 1000.0); + #endif + //---------------------------------------------------- + + //ROUNDWAVEUV_ON + #if ROUNDWAVEUV_ON + half xWave = ((0.5 * _MainTex_ST.x) - uvRect.x); + half yWave = ((0.5 * _MainTex_ST.y) - uvRect.y) * (_MainTex_TexelSize.w / _MainTex_TexelSize.z); + half ripple = -sqrt(xWave*xWave + yWave* yWave); + d.texcoord0.xy += (sin((ripple + (_Time.y + randomSeed) * (_RoundWaveSpeed/10.0)) / 0.015) * (_RoundWaveStrength/10.0)) % 1; + #endif + //---------------------------------------------------- + + + //WIND_ON + #if WIND_ON + half windOffset = sin((_Time.x + randomSeed) * _GrassSpeed * 10); + half2 windCenter = half2(0.5, 0.1); + #if ATLAS_ON + windCenter.x = ((_MaxXUV - _MinXUV) * windCenter.x) + _MinXUV; + windCenter.y = ((_MaxYUV - _MinYUV) * windCenter.y) + _MinYUV; + #endif + #if !MANUALWIND_ON + d.texcoord0.x = fmod(abs(lerp(d.texcoord0.x, d.texcoord0.x + (_GrassWind * 0.01 * windOffset), uvRect.y)), 1); + #else + d.texcoord0.x = fmod(abs(lerp(d.texcoord0.x, d.texcoord0.x + (_GrassWind * 0.01 * _GrassManualAnim), uvRect.y)), 1); + windOffset = _GrassManualAnim; + #endif + half2 delta = d.texcoord0.xy - windCenter; + half delta2 = dot(delta.xy, delta.xy); + half2 delta_offset = delta2 * windOffset; + d.texcoord0.xy = d.texcoord0.xy + half2(delta.y, -delta.x) * delta_offset * _GrassRadialBend; + #endif + + //-------------------------------------------------------- + + //TEXTURESCROLL_ON && !ATLAS_ON + #if TEXTURESCROLL_ON && !ATLAS_ON + d.texcoord0.x += ((_Time.y + randomSeed) * _TextureScrollXSpeed) % 1; + d.texcoord0.y += ((_Time.y + randomSeed) * _TextureScrollYSpeed) % 1; + #endif + //------------------------------ + + //PIXELATE_ON + #if PIXELATE_ON + half aspectRatio = _MainTex_TexelSize.x / _MainTex_TexelSize.y; + half2 pixelSize = float2(_PixelateSize, _PixelateSize * aspectRatio); + d.texcoord0.xy = floor(d.texcoord0.xy * pixelSize) / pixelSize; + #endif + //-------------- + + half4 col = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy); + half originalAlpha = col.a; + col *= d.vertexColor; + + //NORMAL MAP + #if NORMALMAP_ON + half4 normalSample = SAMPLE_TEXTURE2D(_NormalMap, sampler_NormalMap, d.texcoord0.xy); + half3 normalTS = UnpackNormal(normalSample); + normalTS.xy *= _NormalStrength; + o.Normal = normalTS; + #endif + + + //GLITCH_ON + #if GLITCH_ON + half2 uvGlitch = uvRect; + uvGlitch.y -= 0.5; + half lineNoise = pow(rand2(floor(uvGlitch * half2(24., 19.) * _GlitchSize) * 4.0, randomSeed), 3.0) * _GlitchAmount + * pow(rand2(floor(uvGlitch * half2(38., 14.) * _GlitchSize) * 4.0, randomSeed), 3.0); + col = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(lineNoise * 0.02 * rand2(half2(2.0, 1), randomSeed), 0)) * d.vertexColor; + #endif + //-------------------------------------- + + //CHROMABERR_ON + #if CHROMABERR_ON + half4 r = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(_ChromAberrAmount/10, 0)) * d.vertexColor; + half4 b = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(-_ChromAberrAmount/10, 0)) * d.vertexColor; + col = half4(r.r * r.a, col.g, b.b * b.a, max(max(r.a, b.a) * _ChromAberrAlpha, col.a)); + #endif + + //-------------------------------- + + //BLUR_ON + #if BLUR_ON + #if ATLAS_ON + #if !BLURISHD_ON + col = BlurHD(d.texcoord0.xy, _MainTex, sampler_MainTex, _BlurIntensity, (_MaxXUV - _MinXUV), (_MaxYUV - _MinYUV)) * d.vertexColor; + #else + col = Blur(d.texcoord0.xy, _MainTex, sampler_MainTex, _BlurIntensity * (_MaxXUV - _MinXUV)) * d.vertexColor; + #endif + #else + #if !BLURISHD_ON + col = BlurHD(d.texcoord0.xy, _MainTex, sampler_MainTex, _BlurIntensity, 1, 1) * d.vertexColor; + #else + col = Blur(d.texcoord0.xy, _MainTex, sampler_MainTex, _BlurIntensity) * d.vertexColor; + #endif + #endif + #endif + + //-------------------- + + //MOTIONBLUR_ON + #if MOTIONBLUR_ON + _MotionBlurAngle = _MotionBlurAngle * 3.1415926; + #define rot(n) mul(n, half2x2(cos(_MotionBlurAngle), -sin(_MotionBlurAngle), sin(_MotionBlurAngle), cos(_MotionBlurAngle))) + _MotionBlurDist = _MotionBlurDist * 0.005; + #if ATLAS_ON + _MotionBlurDist *= (_MaxXUV - _MinXUV); + #endif + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(-_MotionBlurDist, -_MotionBlurDist))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(-_MotionBlurDist * 2, -_MotionBlurDist * 2))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(-_MotionBlurDist * 3, -_MotionBlurDist * 3))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(-_MotionBlurDist * 4, -_MotionBlurDist * 4))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(_MotionBlurDist, _MotionBlurDist))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(_MotionBlurDist * 2, _MotionBlurDist * 2))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(_MotionBlurDist * 3, _MotionBlurDist * 3))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(_MotionBlurDist * 4, _MotionBlurDist * 4))); + col.rgb = col.rgb / 9; + #endif + //------------------------------------ + + //NEGATIVE_ON + #if NEGATIVE_ON + col.rgb = lerp(col.rgb, 1 - col.rgb, _NegativeAmount); + #endif + + //-------------- + half luminance = 0; + + //GREYSCALE_ON && !GREYSCALEOUTLINE_ON + #if GREYSCALE_ON && !GREYSCALEOUTLINE_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + luminance = saturate(luminance + _GreyscaleLuminosity); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _GreyscaleTintColor, _GreyscaleBlend); + #endif + //------------------------------------ + + //GHOST_ON + #if GHOST_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + half4 ghostResult; + ghostResult.a = saturate(luminance - _GhostTransparency) * col.a; + ghostResult.rgb = col.rgb * (luminance + _GhostColorBoost); + col = lerp(col, ghostResult, _GhostBlend); + #endif + //------------------------------------ + + //INNEROUTLINE_ON + #if INNEROUTLINE_ON + half3 innerT = abs(GetPixel(0, _InnerOutlineThickness, d.texcoord0.xy, _MainTex, sampler_MainTex) - GetPixel(0, -_InnerOutlineThickness, d.texcoord0.xy, _MainTex, sampler_MainTex)); + innerT += abs(GetPixel(_InnerOutlineThickness, 0, d.texcoord0.xy, _MainTex, sampler_MainTex) - GetPixel(-_InnerOutlineThickness, 0, d.texcoord0.xy, _MainTex, sampler_MainTex)); + #if !ONLYINNEROUTLINE_ON + innerT = (innerT / 2.0) * col.a * _InnerOutlineAlpha; + col.rgb += length(innerT) * _InnerOutlineColor.rgb * _InnerOutlineGlow; + #else + innerT *= col.a * _InnerOutlineAlpha; + col.rgb = length(innerT) * _InnerOutlineColor.rgb * _InnerOutlineGlow; + col.a = step(0.3, col.r+col.g+col.b); + #endif + #endif + //------------------------------------------------------- + + //HITEFFECT_ON + #if HITEFFECT_ON + col.rgb = lerp(col.rgb, _HitEffectColor.rgb * _HitEffectGlow, _HitEffectBlend); + #endif + //-------------------- + + //GRADIENT_ON + #if GRADIENT_ON + half2 tiledUvGrad = half2(uvRect.x / _MainTex_ST.x, uvRect.y / _MainTex_ST.y); + #if GRADIENT2COL_ON + _GradTopRightCol = _GradTopLeftCol; + _GradBotRightCol = _GradBotLeftCol; + #endif + #if RADIALGRADIENT_ON + half radialDist = 1 - length(tiledUvGrad - half2(0.5, 0.5)); + radialDist *= (_MainTex_TexelSize.w / _MainTex_TexelSize.z); + radialDist = saturate(_GradBoostX * radialDist); + half4 gradientResult = lerp(_GradTopLeftCol, _GradBotLeftCol, radialDist); + #else + half gradXLerpFactor = saturate(pow(tiledUvGrad.x, _GradBoostX)); + half4 gradientResult = lerp(lerp(_GradBotLeftCol, _GradBotRightCol, gradXLerpFactor), + lerp(_GradTopLeftCol, _GradTopRightCol, gradXLerpFactor), saturate(pow(tiledUvGrad.y, _GradBoostY))); + #endif + gradientResult = lerp(col, gradientResult, _GradBlend); + col.rgb = gradientResult.rgb * col.a; + col.a *= gradientResult.a; + #endif + //-------------------------------------------------------------------- + + //CONTRAST_ON + #if CONTRAST_ON + col.rgb = (col.rgb - float3(0.5, 0.5, 0.5)) * _Contrast + float3(0.5, 0.5, 0.5); + col.rgb += _Brightness; + #endif + + //------------------------------------------------------------------- + + //COLORSWAP_ON + #if COLORSWAP_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + half4 swapMask = SAMPLE_TEXTURE2D(_ColorSwapTex, sampler_ColorSwapTex, d.texcoord0.xy); + swapMask.rgb *= swapMask.a; + half3 redSwap = _ColorSwapRed * swapMask.r * saturate(luminance + _ColorSwapRedLuminosity); + half3 greenSwap = _ColorSwapGreen * swapMask.g * saturate(luminance + _ColorSwapGreenLuminosity); + half3 blueSwap = _ColorSwapBlue * swapMask.b * saturate(luminance + _ColorSwapBlueLuminosity); + swapMask.rgb = col.rgb * saturate(1 - swapMask.r - swapMask.g - swapMask.b); + col.rgb = lerp(col.rgb, swapMask.rgb + redSwap + greenSwap + blueSwap, _ColorSwapBlend); + #endif + //-------------------------------------------------------------------- + + //COLORRAMP_ON && !COLORRAMPOUTLINE_ON + #if COLORRAMP_ON && !COLORRAMPOUTLINE_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + luminance = saturate(luminance + _ColorRampLuminosity); + #if GRADIENTCOLORRAMP_ON + col.rgb = lerp(col.rgb, SAMPLE_TEXTURE2D(_ColorRampTexGradient, sampler_ColorRampTexGradient, half2(luminance, 0)).rgb, _ColorRampBlend); + #else + col.rgb = lerp(col.rgb, SAMPLE_TEXTURE2D(_ColorRampTex, sampler_ColorRampTex, half2(luminance, 0)).rgb, _ColorRampBlend); + #endif + #endif + //-------------------------------------------------------------------- + + //CHANGECOLOR_ON + #if CHANGECOLOR_ON + float3 currChangeColor = saturate(col.rgb); + luminance = 0.3 * currChangeColor.r + 0.59 * currChangeColor.g + 0.11 * currChangeColor.b; + luminance = saturate(luminance + _ColorChangeLuminosity); + half3 dif = abs(currChangeColor - _ColorChangeTarget.rgb); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _ColorChangeNewCol.rgb, + max(sign(1 - saturate(dif.x + dif.y + dif.z) - _ColorChangeTolerance), 0.0)); + #if CHANGECOLOR2_ON + dif = abs(currChangeColor - _ColorChangeTarget2.rgb); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _ColorChangeNewCol2.rgb, + max(sign(1 - saturate(dif.x + dif.y + dif.z) - _ColorChangeTolerance2), 0.0)); + #endif + #if CHANGECOLOR3_ON + dif = abs(currChangeColor - _ColorChangeTarget3.rgb); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _ColorChangeNewCol3.rgb, + max(sign(1 - saturate(dif.x + dif.y + dif.z) - _ColorChangeTolerance3), 0.0)); + #endif + #endif + //------------------------------------------------------- + + //POSTERIZE_ON && !POSTERIZEOUTLINE_ON + #if POSTERIZE_ON && !POSTERIZEOUTLINE_ON + col.rgb = pow(col.rgb, _PosterizeGamma) * _PosterizeNumColors; + col.rgb = floor(col.rgb) / _PosterizeNumColors; + col.rgb = pow(col.rgb, 1.0 / _PosterizeGamma); + #endif + //------------------------------------ + + //HSV_ON + #if HSV_ON + half3 resultHsv = half3(col.rgb); + half cosHsv = _HsvBright * _HsvSaturation * cos(_HsvShift * 3.14159265 / 180); + half sinHsv = _HsvBright * _HsvSaturation * sin(_HsvShift * 3.14159265 / 180); + resultHsv.x = (.299 * _HsvBright + .701 * cosHsv + .168 * sinHsv) * col.x + + (.587 * _HsvBright - .587 * cosHsv + .330 * sinHsv) * col.y + + (.114 * _HsvBright - .114 * cosHsv - .497 * sinHsv) * col.z; + resultHsv.y = (.299 * _HsvBright - .299 * cosHsv - .328 * sinHsv) *col.x + + (.587 * _HsvBright + .413 * cosHsv + .035 * sinHsv) * col.y + + (.114 * _HsvBright - .114 * cosHsv + .292 * sinHsv) * col.z; + resultHsv.z = (.299 * _HsvBright - .3 * cosHsv + 1.25 * sinHsv) * col.x + + (.587 * _HsvBright - .588 * cosHsv - 1.05 * sinHsv) * col.y + + (.114 * _HsvBright + .886 * cosHsv - .203 * sinHsv) * col.z; + col.rgb = resultHsv; + #endif + //------------------------------------------------------- + + //OVERLAY_ON + #if OVERLAY_ON + half2 overlayUvs = d.texcoord0.xy; + overlayUvs.x += ((_Time.y + randomSeed) * _OverlayTextureScrollXSpeed) % 1; + overlayUvs.y += ((_Time.y + randomSeed) * _OverlayTextureScrollYSpeed) % 1; + half4 overlayCol = SAMPLE_TEXTURE2D(_OverlayTex, sampler_OverlayTex, TRANSFORM_TEX(overlayUvs, _OverlayTex)); + overlayCol.rgb *= _OverlayColor.rgb * _OverlayGlow; + #if !OVERLAYMULT_ON + overlayCol.rgb *= overlayCol.a * _OverlayColor.rgb * _OverlayColor.a * _OverlayBlend; + col.rgb += overlayCol.rgb; + #else + overlayCol.a *= _OverlayColor.a; + col = lerp(col, col * overlayCol, _OverlayBlend); + #endif + #endif + + //--------------------------------- + + //OUTBASE_ON + #if OUTBASE_ON + #if OUTBASEPIXELPERF_ON + half2 destUv = half2(_OutlinePixelWidth * _MainTex_TexelSize.x, _OutlinePixelWidth * _MainTex_TexelSize.y); + #else + half2 destUv = half2(_OutlineWidth * _MainTex_TexelSize.x * 200, _OutlineWidth * _MainTex_TexelSize.y * 200); + #endif + + #if OUTDIST_ON + d.texcoord3.x += ((_Time.x + _RandomSeed) * _OutlineDistortTexXSpeed) % 1; + d.texcoord3.y += ((_Time.x + _RandomSeed) * _OutlineDistortTexYSpeed) % 1; + #if ATLAS_ON + d.texcoord3 = half2((d.texcoord3.x - _MinXUV) / (_MaxXUV - _MinXUV), (d.texcoord3.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half outDistortAmnt = (SAMPLE_TEXTURE2D(_OutlineDistortTex, sampler_OutlineDistortTex, d.texcoord3).r - 0.5) * 0.2 * _OutlineDistortAmount; + destUv.x += outDistortAmnt; + destUv.y += outDistortAmnt; + #endif + + half spriteLeft = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(destUv.x, 0)).a; + half spriteRight = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy - half2(destUv.x, 0)).a; + half spriteBottom = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(0, destUv.y)).a; + half spriteTop = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy - half2(0, destUv.y)).a; + half result = spriteLeft + spriteRight + spriteBottom + spriteTop; + + #if OUTBASE8DIR_ON + half spriteTopLeft = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(destUv.x, destUv.y)).a; + half spriteTopRight = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(-destUv.x, destUv.y)).a; + half spriteBotLeft = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(destUv.x, -destUv.y)).a; + half spriteBotRight = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(-destUv.x, -destUv.y)).a; + result = result + spriteTopLeft + spriteTopRight + spriteBotLeft + spriteBotRight; + #endif + + result = step(0.05, saturate(result)); + + #if OUTTEX_ON + d.texcoord1.x += ((_Time.x + _RandomSeed) * _OutlineTexXSpeed) % 1; + d.texcoord1.y += ((_Time.x + _RandomSeed) * _OutlineTexYSpeed) % 1; + #if ATLAS_ON + d.texcoord1 = half2((d.texcoord1.x - _MinXUV) / (_MaxXUV - _MinXUV), (d.texcoord1.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half4 tempOutColor = SAMPLE_TEXTURE2D(_OutlineTex, sampler_OutlineTex, d.texcoord1); + tempOutColor *= _OutlineColor; + _OutlineColor = tempOutColor; + #endif + + result *= (1 - originalAlpha) * _OutlineAlpha; + + half4 outline = _OutlineColor * d.vertexColor.a; + outline.rgb *= _OutlineGlow; + outline.a = result; + #if ONLYOUTLINE_ON + col = outline; + #else + col = lerp(col, outline, result); + #endif + #endif + //------------------------------------------------------- + + //FADE_ON + #if FADE_ON + half2 tiledUvFade1 = TRANSFORM_TEX(d.texcoord0, _FadeTex); + half2 tiledUvFade2 = TRANSFORM_TEX(d.texcoord0, _FadeBurnTex); + #if ATLAS_ON + tiledUvFade1 = half2((tiledUvFade1.x - _MinXUV) / (_MaxXUV - _MinXUV), (tiledUvFade1.y - _MinYUV) / (_MaxYUV - _MinYUV)); + tiledUvFade2 = half2((tiledUvFade2.x - _MinXUV) / (_MaxXUV - _MinXUV), (tiledUvFade2.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half fadeTemp = SAMPLE_TEXTURE2D(_FadeTex, sampler_FadeTex, tiledUvFade1).r; + half fade = smoothstep(_FadeAmount, _FadeAmount + _FadeBurnTransition, fadeTemp); + half fadeBurn = saturate(smoothstep(_FadeAmount - _FadeBurnWidth, _FadeAmount - _FadeBurnWidth + 0.1, fadeTemp) * _FadeAmount); + col.a *= fade; + _FadeBurnColor.rgb *= _FadeBurnGlow; + col += fadeBurn * SAMPLE_TEXTURE2D(_FadeBurnTex, sampler_FadeBurnTex, tiledUvFade2) * _FadeBurnColor * originalAlpha * (1 - col.a); + #endif + //------------------------------------------------------- + + //SHADOW_ON + #if SHADOW_ON + half shadowA = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(_ShadowX, _ShadowY)).a; + half preMultShadowMask = 1 - (saturate(shadowA - col.a) * (1 - col.a)); + col.rgb *= 1 - ((shadowA - col.a) * (1 - col.a)); + col.rgb += (_ShadowColor * shadowA) * (1 - col.a); + col.a = max(shadowA * _ShadowAlpha * d.vertexColor.a, col.a); + #endif + + //------------------------------------------------------- + + //GLOW_ON + #if GLOW_ON + half4 emission; + #if GLOWTEX_ON + emission = SAMPLE_TEXTURE2D(_GlowTex, sampler_GlowTex, d.texcoord0); + #else + emission = col; + #endif + + col.rgb *= _GlowGlobal; + emission.rgb *= emission.a * col.a * _Glow * _GlowColor; + col.rgb += emission.rgb; + #endif + //------------------------------------------------------- + + //COLORRAMP_ON && COLORRAMPOUTLINE_ON + #if COLORRAMP_ON && COLORRAMPOUTLINE_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + luminance = saturate(luminance + _ColorRampLuminosity); + #if GRADIENTCOLORRAMP_ON + col.rgb = lerp(col.rgb, SAMPLE_TEXTURE2D(_ColorRampTexGradient, sampler_ColorRampTexGradient, half2(luminance, 0)).rgb, _ColorRampBlend); + #else + col.rgb = lerp(col.rgb, SAMPLE_TEXTURE2D(_ColorRampTex, sampler_ColorRampTex, half2(luminance, 0)).rgb, _ColorRampBlend); + #endif + #endif + //--------------- + + //GREYSCALE_ON && GREYSCALEOUTLINE_ON + #if GREYSCALE_ON && GREYSCALEOUTLINE_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + luminance = saturate(luminance + _GreyscaleLuminosity); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _GreyscaleTintColor, _GreyscaleBlend); + #endif + + //----------------------------------- + + //POSTERIZE_ON && POSTERIZEOUTLINE_ON + #if POSTERIZE_ON && POSTERIZEOUTLINE_ON + col.rgb = pow(col.rgb, _PosterizeGamma) * _PosterizeNumColors; + col.rgb = floor(col.rgb) / _PosterizeNumColors; + col.rgb = pow(col.rgb, 1.0 / _PosterizeGamma); + #endif + + //----------------------------------- + + //SHINE_ON + #if SHINE_ON + half2 uvShine = uvRect; + half cosAngle = cos(_ShineRotate); + half sinAngle = sin(_ShineRotate); + half2x2 rot = half2x2(cosAngle, -sinAngle, sinAngle, cosAngle); + uvShine -= half2(0.5, 0.5); + uvShine = mul(rot, uvShine); + uvShine += half2(0.5, 0.5); + half shineMask = SAMPLE_TEXTURE2D(_ShineMask, sampler_ShineMask, d.texcoord0.xy).a; + half currentDistanceProjection = (uvShine.x + uvShine.y) / 2; + half whitePower = 1 - (abs(currentDistanceProjection - _ShineLocation) / _ShineWidth); + col.rgb += col.a * whitePower * _ShineGlow * max(sign(currentDistanceProjection - (_ShineLocation - _ShineWidth)), 0.0) + * max(sign((_ShineLocation + _ShineWidth) - currentDistanceProjection), 0.0) * _ShineColor * shineMask; + #endif + + //----------------------------------- + + //HOLOGRAM_ON + #if HOLOGRAM_ON + half totalHologram = _HologramStripesAmount + _HologramUnmodAmount; + half hologramYCoord = ((uvRect.y + (((_Time.x + randomSeed) % 1) * _HologramStripesSpeed)) % totalHologram) / totalHologram; + hologramYCoord = abs(hologramYCoord); + half alpha = RemapFloat(saturate(hologramYCoord - (_HologramUnmodAmount/totalHologram)), 0.0, 1.0, _HologramMinAlpha, saturate(_HologramMaxAlpha)); + half hologramMask = max(sign((_HologramUnmodAmount/totalHologram) - hologramYCoord), 0.0); + half4 hologramResult = col; + hologramResult.a *= lerp(alpha, 1, hologramMask); + hologramResult.rgb *= max(1, _HologramMaxAlpha * max(sign(hologramYCoord - (_HologramUnmodAmount/totalHologram)), 0.0)); + hologramMask = 1 - step(0.01,hologramMask); + hologramResult.rgb += hologramMask * _HologramStripeColor * col.a; + col = lerp(col, hologramResult, _HologramBlend); + #endif + + //----------------------------------- + + //FLICKER_ON + #if FLICKER_ON + col.a *= saturate(col.a * step(frac(0.05 + (_Time.w + randomSeed) * _FlickerFreq), 1 - _FlickerPercent) + _FlickerAlpha); + #endif + //----------------------------------- + + //ALPHACUTOFF_ON + + //ALPHAROUND_ON + + //ALPHAOUTLINE_ON + #if ALPHAOUTLINE_ON + half alphaOutlineRes = pow(1 - col.a, max(_AlphaOutlinePower, 0.0001)) * step(_AlphaOutlineMinAlpha, col.a) * _AlphaOutlineBlend; + col.rgb = lerp(col.rgb, _AlphaOutlineColor.rgb * _AlphaOutlineGlow, alphaOutlineRes); + col.a = lerp(col.a, 1, alphaOutlineRes > 1); + #endif + //------------------------------------------------------- + + //FOG_ON + + //------------------ + + col *= _Color; + o.Albedo = col; + col.a *= _Alpha; + clip(col.a - _AlphaCutoffValue - 0.01); + o.Alpha = _Color.a; + } + + + + + + void ChainSurfaceFunction(inout Surface l, inout ShaderData d) + { + Ext_SurfaceFunction0(l, d); + // Ext_SurfaceFunction1(l, d); + // Ext_SurfaceFunction2(l, d); + // Ext_SurfaceFunction3(l, d); + // Ext_SurfaceFunction4(l, d); + // Ext_SurfaceFunction5(l, d); + // Ext_SurfaceFunction6(l, d); + // Ext_SurfaceFunction7(l, d); + // Ext_SurfaceFunction8(l, d); + // Ext_SurfaceFunction9(l, d); + // Ext_SurfaceFunction10(l, d); + // Ext_SurfaceFunction11(l, d); + // Ext_SurfaceFunction12(l, d); + // Ext_SurfaceFunction13(l, d); + // Ext_SurfaceFunction14(l, d); + // Ext_SurfaceFunction15(l, d); + // Ext_SurfaceFunction16(l, d); + // Ext_SurfaceFunction17(l, d); + // Ext_SurfaceFunction18(l, d); + // Ext_SurfaceFunction19(l, d); + // Ext_SurfaceFunction20(l, d); + // Ext_SurfaceFunction21(l, d); + // Ext_SurfaceFunction22(l, d); + // Ext_SurfaceFunction23(l, d); + // Ext_SurfaceFunction24(l, d); + // Ext_SurfaceFunction25(l, d); + // Ext_SurfaceFunction26(l, d); + // Ext_SurfaceFunction27(l, d); + // Ext_SurfaceFunction28(l, d); + // Ext_SurfaceFunction29(l, d); + } + +#if !_DECALSHADER + + void ChainModifyVertex(inout VertexData v, inout VertexToPixel v2p, float4 time) + { + ExtraV2F d; + + ZERO_INITIALIZE(ExtraV2F, d); + ZERO_INITIALIZE(Blackboard, d.blackboard); + // due to motion vectors in HDRP, we need to use the last + // time in certain spots. So if you are going to use _Time to adjust vertices, + // you need to use this time or motion vectors will break. + d.time = time; + + Ext_ModifyVertex0(v, d); + // Ext_ModifyVertex1(v, d); + // Ext_ModifyVertex2(v, d); + // Ext_ModifyVertex3(v, d); + // Ext_ModifyVertex4(v, d); + // Ext_ModifyVertex5(v, d); + // Ext_ModifyVertex6(v, d); + // Ext_ModifyVertex7(v, d); + // Ext_ModifyVertex8(v, d); + // Ext_ModifyVertex9(v, d); + // Ext_ModifyVertex10(v, d); + // Ext_ModifyVertex11(v, d); + // Ext_ModifyVertex12(v, d); + // Ext_ModifyVertex13(v, d); + // Ext_ModifyVertex14(v, d); + // Ext_ModifyVertex15(v, d); + // Ext_ModifyVertex16(v, d); + // Ext_ModifyVertex17(v, d); + // Ext_ModifyVertex18(v, d); + // Ext_ModifyVertex19(v, d); + // Ext_ModifyVertex20(v, d); + // Ext_ModifyVertex21(v, d); + // Ext_ModifyVertex22(v, d); + // Ext_ModifyVertex23(v, d); + // Ext_ModifyVertex24(v, d); + // Ext_ModifyVertex25(v, d); + // Ext_ModifyVertex26(v, d); + // Ext_ModifyVertex27(v, d); + // Ext_ModifyVertex28(v, d); + // Ext_ModifyVertex29(v, d); + + + // #if %EXTRAV2F0REQUIREKEY% + // v2p.extraV2F0 = d.extraV2F0; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // v2p.extraV2F1 = d.extraV2F1; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // v2p.extraV2F2 = d.extraV2F2; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // v2p.extraV2F3 = d.extraV2F3; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // v2p.extraV2F4 = d.extraV2F4; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // v2p.extraV2F5 = d.extraV2F5; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // v2p.extraV2F6 = d.extraV2F6; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // v2p.extraV2F7 = d.extraV2F7; + // #endif + } + + void ChainModifyTessellatedVertex(inout VertexData v, inout VertexToPixel v2p) + { + ExtraV2F d; + ZERO_INITIALIZE(ExtraV2F, d); + ZERO_INITIALIZE(Blackboard, d.blackboard); + + // #if %EXTRAV2F0REQUIREKEY% + // d.extraV2F0 = v2p.extraV2F0; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // d.extraV2F1 = v2p.extraV2F1; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // d.extraV2F2 = v2p.extraV2F2; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // d.extraV2F3 = v2p.extraV2F3; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // d.extraV2F4 = v2p.extraV2F4; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // d.extraV2F5 = v2p.extraV2F5; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // d.extraV2F6 = v2p.extraV2F6; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // d.extraV2F7 = v2p.extraV2F7; + // #endif + + + // Ext_ModifyTessellatedVertex0(v, d); + // Ext_ModifyTessellatedVertex1(v, d); + // Ext_ModifyTessellatedVertex2(v, d); + // Ext_ModifyTessellatedVertex3(v, d); + // Ext_ModifyTessellatedVertex4(v, d); + // Ext_ModifyTessellatedVertex5(v, d); + // Ext_ModifyTessellatedVertex6(v, d); + // Ext_ModifyTessellatedVertex7(v, d); + // Ext_ModifyTessellatedVertex8(v, d); + // Ext_ModifyTessellatedVertex9(v, d); + // Ext_ModifyTessellatedVertex10(v, d); + // Ext_ModifyTessellatedVertex11(v, d); + // Ext_ModifyTessellatedVertex12(v, d); + // Ext_ModifyTessellatedVertex13(v, d); + // Ext_ModifyTessellatedVertex14(v, d); + // Ext_ModifyTessellatedVertex15(v, d); + // Ext_ModifyTessellatedVertex16(v, d); + // Ext_ModifyTessellatedVertex17(v, d); + // Ext_ModifyTessellatedVertex18(v, d); + // Ext_ModifyTessellatedVertex19(v, d); + // Ext_ModifyTessellatedVertex20(v, d); + // Ext_ModifyTessellatedVertex21(v, d); + // Ext_ModifyTessellatedVertex22(v, d); + // Ext_ModifyTessellatedVertex23(v, d); + // Ext_ModifyTessellatedVertex24(v, d); + // Ext_ModifyTessellatedVertex25(v, d); + // Ext_ModifyTessellatedVertex26(v, d); + // Ext_ModifyTessellatedVertex27(v, d); + // Ext_ModifyTessellatedVertex28(v, d); + // Ext_ModifyTessellatedVertex29(v, d); + + // #if %EXTRAV2F0REQUIREKEY% + // v2p.extraV2F0 = d.extraV2F0; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // v2p.extraV2F1 = d.extraV2F1; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // v2p.extraV2F2 = d.extraV2F2; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // v2p.extraV2F3 = d.extraV2F3; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // v2p.extraV2F4 = d.extraV2F4; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // v2p.extraV2F5 = d.extraV2F5; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // v2p.extraV2F6 = d.extraV2F6; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // v2p.extraV2F7 = d.extraV2F7; + // #endif + } + + void ChainFinalColorForward(inout Surface l, inout ShaderData d, inout half4 color) + { + // Ext_FinalColorForward0(l, d, color); + // Ext_FinalColorForward1(l, d, color); + // Ext_FinalColorForward2(l, d, color); + // Ext_FinalColorForward3(l, d, color); + // Ext_FinalColorForward4(l, d, color); + // Ext_FinalColorForward5(l, d, color); + // Ext_FinalColorForward6(l, d, color); + // Ext_FinalColorForward7(l, d, color); + // Ext_FinalColorForward8(l, d, color); + // Ext_FinalColorForward9(l, d, color); + // Ext_FinalColorForward10(l, d, color); + // Ext_FinalColorForward11(l, d, color); + // Ext_FinalColorForward12(l, d, color); + // Ext_FinalColorForward13(l, d, color); + // Ext_FinalColorForward14(l, d, color); + // Ext_FinalColorForward15(l, d, color); + // Ext_FinalColorForward16(l, d, color); + // Ext_FinalColorForward17(l, d, color); + // Ext_FinalColorForward18(l, d, color); + // Ext_FinalColorForward19(l, d, color); + // Ext_FinalColorForward20(l, d, color); + // Ext_FinalColorForward21(l, d, color); + // Ext_FinalColorForward22(l, d, color); + // Ext_FinalColorForward23(l, d, color); + // Ext_FinalColorForward24(l, d, color); + // Ext_FinalColorForward25(l, d, color); + // Ext_FinalColorForward26(l, d, color); + // Ext_FinalColorForward27(l, d, color); + // Ext_FinalColorForward28(l, d, color); + // Ext_FinalColorForward29(l, d, color); + } + + void ChainFinalGBufferStandard(inout Surface s, inout ShaderData d, inout half4 GBuffer0, inout half4 GBuffer1, inout half4 GBuffer2, inout half4 outEmission, inout half4 outShadowMask) + { + // Ext_FinalGBufferStandard0(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard1(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard2(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard3(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard4(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard5(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard6(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard7(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard8(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard9(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard10(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard11(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard12(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard13(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard14(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard15(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard16(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard17(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard18(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard19(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard20(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard21(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard22(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard23(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard24(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard25(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard26(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard27(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard28(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard29(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + } +#endif + + + + + +#if _DECALSHADER + + ShaderData CreateShaderData(SurfaceDescriptionInputs IN) + { + ShaderData d = (ShaderData)0; + d.TBNMatrix = float3x3(IN.WorldSpaceTangent, IN.WorldSpaceBiTangent, IN.WorldSpaceNormal); + d.worldSpaceNormal = IN.WorldSpaceNormal; + d.worldSpaceTangent = IN.WorldSpaceTangent; + + d.worldSpacePosition = IN.WorldSpacePosition; + d.texcoord0 = IN.uv0.xyxy; + d.screenPos = IN.ScreenPosition; + + d.worldSpaceViewDir = normalize(_WorldSpaceCameraPos - d.worldSpacePosition); + + d.tangentSpaceViewDir = mul(d.TBNMatrix, d.worldSpaceViewDir); + + // these rarely get used, so we back transform them. Usually will be stripped. + #if _HDRP + // d.localSpacePosition = mul(GetWorldToObjectMatrix(), float4(GetCameraRelativePositionWS(d.worldSpacePosition), 1)).xyz; + #else + // d.localSpacePosition = mul(GetWorldToObjectMatrix(), float4(d.worldSpacePosition, 1)).xyz; + #endif + // d.localSpaceNormal = normalize(mul((float3x3)GetWorldToObjectMatrix(), d.worldSpaceNormal)); + // d.localSpaceTangent = normalize(mul((float3x3)GetWorldToObjectMatrix(), d.worldSpaceTangent.xyz)); + + // #if %SCREENPOSREQUIREKEY% + // d.screenUV = (IN.ScreenPosition.xy / max(0.01, IN.ScreenPosition.w)); + // #endif + + return d; + } +#else + + ShaderData CreateShaderData(VertexToPixel i + #if NEED_FACING + , bool facing + #endif + ) + { + ShaderData d = (ShaderData)0; + d.clipPos = i.pos; + d.worldSpacePosition = i.worldPos; + + d.worldSpaceNormal = normalize(i.worldNormal); + d.worldSpaceTangent.xyz = normalize(i.worldTangent.xyz); + + d.tangentSign = i.worldTangent.w * unity_WorldTransformParams.w; + float3 bitangent = cross(d.worldSpaceTangent.xyz, d.worldSpaceNormal) * d.tangentSign; + + d.TBNMatrix = float3x3(d.worldSpaceTangent, -bitangent, d.worldSpaceNormal); + d.worldSpaceViewDir = normalize(_WorldSpaceCameraPos - i.worldPos); + + d.tangentSpaceViewDir = mul(d.TBNMatrix, d.worldSpaceViewDir); + d.texcoord0 = i.texcoord0; + d.texcoord1 = i.texcoord1; + d.texcoord2 = i.texcoord2; + + // #if %TEXCOORD3REQUIREKEY% + d.texcoord3 = i.texcoord3; + // #endif + + // d.isFrontFace = facing; + // #if %VERTEXCOLORREQUIREKEY% + d.vertexColor = i.vertexColor; + // #endif + + // these rarely get used, so we back transform them. Usually will be stripped. + #if _HDRP + // d.localSpacePosition = mul(GetWorldToObjectMatrix(), float4(GetCameraRelativePositionWS(i.worldPos), 1)).xyz; + #else + // d.localSpacePosition = mul(GetWorldToObjectMatrix(), float4(i.worldPos, 1)).xyz; + #endif + // d.localSpaceNormal = normalize(mul((float3x3)GetWorldToObjectMatrix(), i.worldNormal)); + // d.localSpaceTangent = normalize(mul((float3x3)GetWorldToObjectMatrix(), i.worldTangent.xyz)); + + // #if %SCREENPOSREQUIREKEY% + // d.screenPos = i.screenPos; + // d.screenUV = (i.screenPos.xy / i.screenPos.w); + // #endif + + + // #if %EXTRAV2F0REQUIREKEY% + // d.extraV2F0 = i.extraV2F0; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // d.extraV2F1 = i.extraV2F1; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // d.extraV2F2 = i.extraV2F2; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // d.extraV2F3 = i.extraV2F3; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // d.extraV2F4 = i.extraV2F4; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // d.extraV2F5 = i.extraV2F5; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // d.extraV2F6 = i.extraV2F6; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // d.extraV2F7 = i.extraV2F7; + // #endif + + return d; + } + +#endif + + + #if defined(_PASSSHADOW) + float3 _LightDirection; + float3 _LightPosition; + #endif + + // vertex shader + VertexToPixel Vert (VertexData v) + { + + VertexToPixel o = (VertexToPixel)0; + + UNITY_SETUP_INSTANCE_ID(v); + UNITY_TRANSFER_INSTANCE_ID(v, o); + UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o); + + +#if !_TESSELLATION_ON + ChainModifyVertex(v, o, _Time); +#endif + + o.texcoord0 = v.texcoord0; + o.texcoord1 = v.texcoord1; + o.texcoord2 = v.texcoord2; + + // #if %TEXCOORD3REQUIREKEY% + o.texcoord3 = v.texcoord3; + // #endif + + // #if %VERTEXCOLORREQUIREKEY% + o.vertexColor = v.vertexColor; + // #endif + + VertexPositionInputs vertexInput = GetVertexPositionInputs(v.vertex.xyz); + o.worldPos = TransformObjectToWorld(v.vertex.xyz); + o.worldNormal = TransformObjectToWorldNormal(v.normal); + o.worldTangent = float4(TransformObjectToWorldDir(v.tangent.xyz), v.tangent.w); + + // For some very odd reason, in 2021.2, we can't use Unity's defines, but have to use our own.. + #if _PASSSHADOW + #if _CASTING_PUNCTUAL_LIGHT_SHADOW + float3 lightDirectionWS = normalize(_LightPosition - o.worldPos); + #else + float3 lightDirectionWS = _LightDirection; + #endif + // Define shadow pass specific clip position for Universal + o.pos = TransformWorldToHClip(ApplyShadowBias(o.worldPos, o.worldNormal, lightDirectionWS)); + #if UNITY_REVERSED_Z + o.pos.z = min(o.pos.z, UNITY_NEAR_CLIP_VALUE); + #else + o.pos.z = max(o.pos.z, UNITY_NEAR_CLIP_VALUE); + #endif + #elif _PASSMETA + o.pos = MetaVertexPosition(float4(v.vertex.xyz, 0), v.texcoord1.xy, v.texcoord2.xy, unity_LightmapST, unity_DynamicLightmapST); + #else + o.pos = TransformWorldToHClip(o.worldPos); + #endif + + // #if %SCREENPOSREQUIREKEY% + // o.screenPos = ComputeScreenPos(o.pos, _ProjectionParams.x); + // #endif + + #if _PASSFORWARD || _PASSGBUFFER + float2 uv1 = v.texcoord1.xy; + OUTPUT_LIGHTMAP_UV(uv1, unity_LightmapST, o.lightmapUV); + o.texcoord1.xy = uv1; + OUTPUT_SH(o.worldNormal, o.sh); + #if defined(DYNAMICLIGHTMAP_ON) + o.dynamicLightmapUV.xy = v.texcoord2.xy * unity_DynamicLightmapST.xy + unity_DynamicLightmapST.zw; + #endif + #endif + + #ifdef VARYINGS_NEED_FOG_AND_VERTEX_LIGHT + half fogFactor = 0; + #if defined(_FOG_FRAGMENT) + fogFactor = ComputeFogFactor(o.pos.z); + #endif + #if _BAKEDLIT + o.fogFactorAndVertexLight = half4(fogFactor, 0, 0, 0); + #else + half3 vertexLight = VertexLighting(o.worldPos, o.worldNormal); + o.fogFactorAndVertexLight = half4(fogFactor, vertexLight); + #endif + #endif + + #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR) + o.shadowCoord = GetShadowCoord(vertexInput); + #endif + + return o; + } + + + + +#if _UNLIT + #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Unlit.hlsl" +#endif + + // fragment shader + void Frag (VertexToPixel IN + , out half4 outColor : SV_Target0 + #ifdef _WRITE_RENDERING_LAYERS + , out float4 outRenderingLayers : SV_Target1 + #endif + #ifdef _DEPTHOFFSET_ON + , out float outputDepth : SV_Depth + #endif + #if NEED_FACING + , bool facing : SV_IsFrontFace + #endif + ) + { + UNITY_SETUP_INSTANCE_ID(IN); + UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX(IN); + + #if defined(LOD_FADE_CROSSFADE) + LODFadeCrossFade(IN.pos); + #endif + + + ShaderData d = CreateShaderData(IN + #if NEED_FACING + , facing + #endif + ); + Surface l = (Surface)0; + + #ifdef _DEPTHOFFSET_ON + l.outputDepth = outputDepth; + #endif + + l.Albedo = half3(0.5, 0.5, 0.5); + l.Normal = float3(0,0,1); + l.Occlusion = 1; + l.Alpha = 1; + + ChainSurfaceFunction(l, d); + + #ifdef _DEPTHOFFSET_ON + outputDepth = l.outputDepth; + #endif + + #if _USESPECULAR || _SIMPLELIT + float3 specular = l.Specular; + float metallic = 1; + #else + float3 specular = 0; + float metallic = l.Metallic; + #endif + + + + + InputData inputData = (InputData)0; + + inputData.positionWS = IN.worldPos; + #if _WORLDSPACENORMAL + inputData.normalWS = l.Normal; + #else + inputData.normalWS = normalize(TangentToWorldSpace(d, l.Normal)); + #endif + + inputData.viewDirectionWS = SafeNormalize(d.worldSpaceViewDir); + + + #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR) + inputData.shadowCoord = IN.shadowCoord; + #elif defined(MAIN_LIGHT_CALCULATE_SHADOWS) + inputData.shadowCoord = TransformWorldToShadowCoord(IN.worldPos); + #else + inputData.shadowCoord = float4(0, 0, 0, 0); + #endif + +#if _BAKEDLIT + inputData.fogCoord = IN.fogFactorAndVertexLight.x; + inputData.vertexLighting = 0; +#else + inputData.fogCoord = InitializeInputDataFog(float4(IN.worldPos, 1.0), IN.fogFactorAndVertexLight.x); + inputData.vertexLighting = IN.fogFactorAndVertexLight.yzw; +#endif + + + + #if defined(_OVERRIDE_BAKEDGI) + inputData.bakedGI = l.DiffuseGI; + l.Emission += l.SpecularGI; + #elif _BAKEDLIT + inputData.bakedGI = SAMPLE_GI(IN.lightmapUV, IN.sh, inputData.normalWS); + #else + #if defined(DYNAMICLIGHTMAP_ON) + inputData.bakedGI = SAMPLE_GI(IN.lightmapUV, IN.dynamicLightmapUV.xy, IN.sh, inputData.normalWS); + #else + inputData.bakedGI = SAMPLE_GI(IN.lightmapUV, IN.sh, inputData.normalWS); + #endif + #endif + inputData.normalizedScreenSpaceUV = GetNormalizedScreenSpaceUV(IN.pos); + #if !_BAKEDLIT + inputData.shadowMask = SAMPLE_SHADOWMASK(IN.lightmapUV); + + #if defined(_OVERRIDE_SHADOWMASK) + float4 mulColor = saturate(dot(l.ShadowMask, _MainLightOcclusionProbes)); //unity_OcclusionMaskSelector)); + inputData.shadowMask = mulColor; + #endif + #else + inputData.shadowMask = float4(1,1,1,1); + #endif + + #if defined(DEBUG_DISPLAY) + #if defined(DYNAMICLIGHTMAP_ON) + inputData.dynamicLightmapUV = IN.dynamicLightmapUV.xy; + #endif + #if defined(LIGHTMAP_ON) + inputData.staticLightmapUV = IN.lightmapUV; + #else + inputData.vertexSH = IN.sh; + #endif + #endif + + #if _WORLDSPACENORMAL + float3 normalTS = WorldToTangentSpace(d, l.Normal); + #else + float3 normalTS = l.Normal; + #endif + + SurfaceData surface = (SurfaceData)0; + surface.albedo = l.Albedo; + surface.metallic = saturate(metallic); + surface.specular = specular; + surface.smoothness = saturate(l.Smoothness), + surface.occlusion = l.Occlusion, + surface.emission = l.Emission, + surface.alpha = saturate(l.Alpha); + surface.clearCoatMask = 0; + surface.clearCoatSmoothness = 1; + + #ifdef _CLEARCOAT + surface.clearCoatMask = saturate(l.CoatMask); + surface.clearCoatSmoothness = saturate(l.CoatSmoothness); + #endif + + #if !_UNLIT + half4 color = half4(l.Albedo, l.Alpha); + #ifdef _DBUFFER + #if _BAKEDLIT + half3 bakeColor = color.rgb; + float3 bakeNormal = inputData.normalWS.xyz; + ApplyDecalToBaseColorAndNormal(IN.pos, bakeColor, bakeNormal); + color.rgb = bakeColor; + inputData.normalWS.xyz = bakeNormal; + #else + ApplyDecalToSurfaceData(IN.pos, surface, inputData); + #endif + #endif + #if _SIMPLELIT + color = UniversalFragmentBlinnPhong( + inputData, + surface); + #elif _BAKEDLIT + color = UniversalFragmentBakedLit(inputData, color.rgb, color.a, normalTS); + #else + color = UniversalFragmentPBR(inputData, surface); + #endif + + #if !DISABLEFOG + color.rgb = MixFog(color.rgb, inputData.fogCoord); + #endif + + #else // unlit + #ifdef _DBUFFER + ApplyDecalToSurfaceData(IN.pos, surface, inputData); + #endif + half4 color = UniversalFragmentUnlit(inputData, l.Albedo, l.Alpha); + #if !DISABLEFOG + color.rgb = MixFog(color.rgb, inputData.fogCoord); + #endif + #endif + ChainFinalColorForward(l, d, color); + + outColor = color; + + #ifdef _WRITE_RENDERING_LAYERS + uint renderingLayers = GetMeshRenderingLayer(); + outRenderingLayers = float4(EncodeMeshRenderingLayer(renderingLayers), 0, 0, 0); + #endif + + } + + ENDHLSL + + } + + + + Pass + { + Name "GBuffer" + Tags + { + "LightMode" = "UniversalGBuffer" + } + + Blend One Zero + ZTest LEqual + ZWrite On + + Tags { "RenderType" = "Opaque" "Queue" = "Geometry" "PreviewType" = "Plane" } + Cull [_CullingOption] + ZWrite [_ZWrite] + ZTest [_ZTestMode] + + + HLSLPROGRAM + + #pragma vertex Vert + #pragma fragment Frag + + #pragma target 3.0 + + #pragma prefer_hlslcc gles + #pragma exclude_renderers d3d11_9x + #pragma multi_compile_instancing + #pragma multi_compile_fog + #pragma instancing_options renderinglayer + #pragma multi_compile _ DOTS_INSTANCING_ON + + #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_fragment _ _REFLECTION_PROBE_BLENDING + #pragma multi_compile_fragment _ _REFLECTION_PROBE_BOX_PROJECTION + #pragma multi_compile_fragment _ _SHADOWS_SOFT + #pragma multi_compile _ LIGHTMAP_SHADOW_MIXING + #pragma multi_compile _ _MIXED_LIGHTING_SUBTRACTIVE + #pragma multi_compile_fragment _ _DBUFFER_MRT1 _DBUFFER_MRT2 _DBUFFER_MRT3 + #pragma multi_compile_fragment _ _GBUFFER_NORMALS_OCT + #pragma multi_compile_fragment _ _WRITE_RENDERING_LAYERS + #pragma multi_compile_fragment _ _RENDER_PASS_ENABLED + #pragma multi_compile_fragment _ DEBUG_DISPLAY + #pragma multi_compile _ SHADOWS_SHADOWMASK + #pragma multi_compile_fragment _ LOD_FADE_CROSSFADE + + + #define _FOG_FRAGMENT 1 + + #define VARYINGS_NEED_FOG_AND_VERTEX_LIGHT + #define SHADERPASS SHADERPASS_GBUFFER + #define _PASSGBUFFER 1 + + + #pragma shader_feature_local GLOW_ON + #pragma shader_feature_local FADE_ON + #pragma shader_feature_local OUTBASE_ON + #pragma shader_feature_local ONLYOUTLINE_ON + #pragma shader_feature_local GRADIENT_ON + #pragma shader_feature_local GRADIENT2COL_ON + #pragma shader_feature_local RADIALGRADIENT_ON + #pragma shader_feature_local COLORSWAP_ON + #pragma shader_feature_local HSV_ON + #pragma shader_feature_local CHANGECOLOR_ON + #pragma shader_feature_local CHANGECOLOR2_ON + #pragma shader_feature_local CHANGECOLOR3_ON + #pragma shader_feature_local COLORRAMP_ON + #pragma shader_feature_local GRADIENTCOLORRAMP_ON + #pragma shader_feature_local HITEFFECT_ON + #pragma shader_feature_local NEGATIVE_ON + #pragma shader_feature_local PIXELATE_ON + #pragma shader_feature_local GREYSCALE_ON + #pragma shader_feature_local POSTERIZE_ON + #pragma shader_feature_local BLUR_ON + #pragma shader_feature_local MOTIONBLUR_ON + #pragma shader_feature_local GHOST_ON + #pragma shader_feature_local ALPHAOUTLINE_ON + #pragma shader_feature_local INNEROUTLINE_ON + #pragma shader_feature_local ONLYINNEROUTLINE_ON + #pragma shader_feature_local HOLOGRAM_ON + #pragma shader_feature_local CHROMABERR_ON + #pragma shader_feature_local GLITCH_ON + #pragma shader_feature_local FLICKER_ON + #pragma shader_feature_local SHADOW_ON + #pragma shader_feature_local SHINE_ON + #pragma shader_feature_local CONTRAST_ON + #pragma shader_feature_local OVERLAY_ON + #pragma shader_feature_local OVERLAYMULT_ON + #pragma shader_feature_local DOODLE_ON + #pragma shader_feature_local WIND_ON + #pragma shader_feature_local WAVEUV_ON + #pragma shader_feature_local ROUNDWAVEUV_ON + #pragma shader_feature_local RECTSIZE_ON + #pragma shader_feature_local OFFSETUV_ON + #pragma shader_feature_local CLIPPING_ON + #pragma shader_feature_local RADIALCLIPPING_ON + #pragma shader_feature_local TEXTURESCROLL_ON + #pragma shader_feature_local ZOOMUV_ON + #pragma shader_feature_local DISTORT_ON + #pragma shader_feature_local WARP_ON + #pragma shader_feature_local TWISTUV_ON + #pragma shader_feature_local ROTATEUV_ON + #pragma shader_feature_local POLARUV_ON + #pragma shader_feature_local FISHEYE_ON + #pragma shader_feature_local PINCH_ON + #pragma shader_feature_local SHAKEUV_ON + + #pragma shader_feature_local GLOWTEX_ON + #pragma shader_feature_local OUTTEX_ON + #pragma shader_feature_local OUTDIST_ON + #pragma shader_feature_local OUTBASE8DIR_ON + #pragma shader_feature_local OUTBASEPIXELPERF_ON + #pragma shader_feature_local COLORRAMPOUTLINE_ON + #pragma shader_feature_local GREYSCALEOUTLINE_ON + #pragma shader_feature_local POSTERIZEOUTLINE_ON + #pragma shader_feature_local BLURISHD_ON + #pragma shader_feature_local MANUALWIND_ON + #pragma shader_feature_local ATLAS_ON + #pragma shader_feature_local PREMULTIPLYALPHA_ON + + #pragma shader_feature BILBOARD_ON + #pragma shader_feature BILBOARDY_ON + + #pragma shader_feature NORMALMAP_ON + + + #define _URP 1 +#define _USINGTEXCOORD1 1 +#define _USINGTEXCOORD2 1 + + + + + // Includes + #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" + #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/LODCrossFade.hlsl" + + + + + #undef WorldNormalVector + #define WorldNormalVector(data, normal) mul(normal, data.TBNMatrix) + + #define UnityObjectToWorldNormal(normal) mul(GetObjectToWorldMatrix(), normal) + + #define _WorldSpaceLightPos0 _MainLightPosition + + #define UNITY_DECLARE_TEX2D(name) TEXTURE2D(name); SAMPLER(sampler##name); + #define UNITY_DECLARE_TEX2D_NOSAMPLER(name) TEXTURE2D(name); + #define UNITY_DECLARE_TEX2DARRAY(name) TEXTURE2D_ARRAY(name); SAMPLER(sampler##name); + #define UNITY_DECLARE_TEX2DARRAY_NOSAMPLER(name) TEXTURE2D_ARRAY(name); + + #define UNITY_SAMPLE_TEX2DARRAY(tex,coord) SAMPLE_TEXTURE2D_ARRAY(tex, sampler##tex, coord.xy, coord.z) + #define UNITY_SAMPLE_TEX2DARRAY_LOD(tex,coord,lod) SAMPLE_TEXTURE2D_ARRAY_LOD(tex, sampler##tex, coord.xy, coord.z, lod) + #define UNITY_SAMPLE_TEX2D(tex, coord) SAMPLE_TEXTURE2D(tex, sampler##tex, coord) + #define UNITY_SAMPLE_TEX2D_SAMPLER(tex, samp, coord) SAMPLE_TEXTURE2D(tex, sampler##samp, coord) + + #define UNITY_SAMPLE_TEX2D_LOD(tex,coord, lod) SAMPLE_TEXTURE2D_LOD(tex, sampler_##tex, coord, lod) + #define UNITY_SAMPLE_TEX2D_SAMPLER_LOD(tex,samplertex,coord, lod) SAMPLE_TEXTURE2D_LOD (tex, sampler##samplertex,coord, lod) + + #if defined(UNITY_COMPILER_HLSL) + #define UNITY_INITIALIZE_OUTPUT(type,name) name = (type)0; + #else + #define UNITY_INITIALIZE_OUTPUT(type,name) + #endif + + #define sampler2D_float sampler2D + #define sampler2D_half sampler2D + + + + // data across stages, stripped like the above. + struct VertexToPixel + { + float4 pos : SV_POSITION; + float3 worldPos : TEXCOORD0; + float3 worldNormal : TEXCOORD1; + float4 worldTangent : TEXCOORD2; + float4 texcoord0 : TEXCOORD3; + float4 texcoord1 : TEXCOORD4; + float4 texcoord2 : TEXCOORD5; + + // #if %TEXCOORD3REQUIREKEY% + float4 texcoord3 : TEXCOORD6; + // #endif + + // #if %SCREENPOSREQUIREKEY% + // float4 screenPos : TEXCOORD7; + // #endif + + // #if %VERTEXCOLORREQUIREKEY% + half4 vertexColor : COLOR; + // #endif + + #if defined(LIGHTMAP_ON) + float2 lightmapUV : TEXCOORD8; + #endif + #if defined(DYNAMICLIGHTMAP_ON) + float2 dynamicLightmapUV : TEXCOORD9; + #endif + #if !defined(LIGHTMAP_ON) + float3 sh : TEXCOORD10; + #endif + + #if defined(VARYINGS_NEED_FOG_AND_VERTEX_LIGHT) + float4 fogFactorAndVertexLight : TEXCOORD11; + #endif + + #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR) + float4 shadowCoord : TEXCOORD12; + #endif + + // #if %EXTRAV2F0REQUIREKEY% + // float4 extraV2F0 : TEXCOORD13; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // float4 extraV2F1 : TEXCOORD14; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // float4 extraV2F2 : TEXCOORD15; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // float4 extraV2F3 : TEXCOORD16; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // float4 extraV2F4 : TEXCOORD17; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // float4 extraV2F5 : TEXCOORD18; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // float4 extraV2F6 : TEXCOORD19; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // float4 extraV2F7 : TEXCOORD20; + // #endif + + #if UNITY_ANY_INSTANCING_ENABLED + uint instanceID : CUSTOM_INSTANCE_ID; + #endif + #if (defined(UNITY_STEREO_MULTIVIEW_ENABLED)) || (defined(UNITY_STEREO_INSTANCING_ENABLED) && (defined(SHADER_API_GLES3) || defined(SHADER_API_GLCORE))) + uint stereoTargetEyeIndexAsBlendIdx0 : BLENDINDICES0; + #endif + #if (defined(UNITY_STEREO_INSTANCING_ENABLED)) + uint stereoTargetEyeIndexAsRTArrayIdx : SV_RenderTargetArrayIndex; + #endif + #if defined(SHADER_STAGE_FRAGMENT) && defined(VARYINGS_NEED_CULLFACE) + FRONT_FACE_TYPE cullFace : FRONT_FACE_SEMANTIC; + #endif + + + }; + + + + + + // data describing the user output of a pixel + struct Surface + { + half3 Albedo; + half Height; + half3 Normal; + half Smoothness; + half3 Emission; + half Metallic; + half3 Specular; + half Occlusion; + half SpecularPower; // for simple lighting + half Alpha; + float outputDepth; // if written, SV_Depth semantic is used. ShaderData.clipPos.z is unused value + // HDRP Only + half SpecularOcclusion; + half SubsurfaceMask; + half Thickness; + half CoatMask; + half CoatSmoothness; + half Anisotropy; + half IridescenceMask; + half IridescenceThickness; + int DiffusionProfileHash; + float SpecularAAThreshold; + float SpecularAAScreenSpaceVariance; + // requires _OVERRIDE_BAKEDGI to be defined, but is mapped in all pipelines + float3 DiffuseGI; + float3 BackDiffuseGI; + float3 SpecularGI; + float ior; + float3 transmittanceColor; + float atDistance; + float transmittanceMask; + // requires _OVERRIDE_SHADOWMASK to be defines + float4 ShadowMask; + + // for decals + float NormalAlpha; + float MAOSAlpha; + + + }; + + // Data the user declares in blackboard blocks + struct Blackboard + { + + float blackboardDummyData; + }; + + // data the user might need, this will grow to be big. But easy to strip + struct ShaderData + { + float4 clipPos; // SV_POSITION + float3 localSpacePosition; + float3 localSpaceNormal; + float3 localSpaceTangent; + + float3 worldSpacePosition; + float3 worldSpaceNormal; + float3 worldSpaceTangent; + float tangentSign; + + float3 worldSpaceViewDir; + float3 tangentSpaceViewDir; + + float4 texcoord0; + float4 texcoord1; + float4 texcoord2; + float4 texcoord3; + + float2 screenUV; + float4 screenPos; + + float4 vertexColor; + bool isFrontFace; + + float4 extraV2F0; + float4 extraV2F1; + float4 extraV2F2; + float4 extraV2F3; + float4 extraV2F4; + float4 extraV2F5; + float4 extraV2F6; + float4 extraV2F7; + + float3x3 TBNMatrix; + Blackboard blackboard; + }; + + struct VertexData + { + #if SHADER_TARGET > 30 + // uint vertexID : SV_VertexID; + #endif + float4 vertex : POSITION; + float3 normal : NORMAL; + float4 tangent : TANGENT; + float4 texcoord0 : TEXCOORD0; + + // optimize out mesh coords when not in use by user or lighting system + #if _URP && (_USINGTEXCOORD1 || _PASSMETA || _PASSFORWARD || _PASSGBUFFER) + float4 texcoord1 : TEXCOORD1; + #endif + + #if _URP && (_USINGTEXCOORD2 || _PASSMETA || ((_PASSFORWARD || _PASSGBUFFER) && defined(DYNAMICLIGHTMAP_ON))) + float4 texcoord2 : TEXCOORD2; + #endif + + #if _STANDARD && (_USINGTEXCOORD1 || (_PASSMETA || ((_PASSFORWARD || _PASSGBUFFER || _PASSFORWARDADD) && LIGHTMAP_ON))) + float4 texcoord1 : TEXCOORD1; + #endif + #if _STANDARD && (_USINGTEXCOORD2 || (_PASSMETA || ((_PASSFORWARD || _PASSGBUFFER) && DYNAMICLIGHTMAP_ON))) + float4 texcoord2 : TEXCOORD2; + #endif + + + #if _HDRP + float4 texcoord1 : TEXCOORD1; + float4 texcoord2 : TEXCOORD2; + #endif + + // #if %TEXCOORD3REQUIREKEY% + float4 texcoord3 : TEXCOORD3; + // #endif + + // #if %VERTEXCOLORREQUIREKEY% + float4 vertexColor : COLOR; + // #endif + + #if _PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR)) + float3 previousPositionOS : TEXCOORD4; // Contain previous transform position (in case of skinning for example) + #if defined (_ADD_PRECOMPUTED_VELOCITY) + float3 precomputedVelocity : TEXCOORD5; // Add Precomputed Velocity (Alembic computes velocities on runtime side). + #endif + #endif + + UNITY_VERTEX_INPUT_INSTANCE_ID + }; + + struct TessVertex + { + float4 vertex : INTERNALTESSPOS; + float3 normal : NORMAL; + float4 tangent : TANGENT; + float4 texcoord0 : TEXCOORD0; + float4 texcoord1 : TEXCOORD1; + float4 texcoord2 : TEXCOORD2; + + // #if %TEXCOORD3REQUIREKEY% + float4 texcoord3 : TEXCOORD3; + // #endif + + // #if %VERTEXCOLORREQUIREKEY% + float4 vertexColor : COLOR; + // #endif + + // #if %EXTRAV2F0REQUIREKEY% + // float4 extraV2F0 : TEXCOORD5; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // float4 extraV2F1 : TEXCOORD6; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // float4 extraV2F2 : TEXCOORD7; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // float4 extraV2F3 : TEXCOORD8; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // float4 extraV2F4 : TEXCOORD9; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // float4 extraV2F5 : TEXCOORD10; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // float4 extraV2F6 : TEXCOORD11; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // float4 extraV2F7 : TEXCOORD12; + // #endif + + #if _PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR)) + float3 previousPositionOS : TEXCOORD13; // Contain previous transform position (in case of skinning for example) + #if defined (_ADD_PRECOMPUTED_VELOCITY) + float3 precomputedVelocity : TEXCOORD14; + #endif + #endif + + UNITY_VERTEX_INPUT_INSTANCE_ID + UNITY_VERTEX_OUTPUT_STEREO + }; + + struct ExtraV2F + { + float4 extraV2F0; + float4 extraV2F1; + float4 extraV2F2; + float4 extraV2F3; + float4 extraV2F4; + float4 extraV2F5; + float4 extraV2F6; + float4 extraV2F7; + Blackboard blackboard; + float4 time; + }; + + + float3 WorldToTangentSpace(ShaderData d, float3 normal) + { + return mul(d.TBNMatrix, normal); + } + + float3 TangentToWorldSpace(ShaderData d, float3 normal) + { + return mul(normal, d.TBNMatrix); + } + + // in this case, make standard more like SRPs, because we can't fix + // unity_WorldToObject in HDRP, since it already does macro-fu there + + #if _STANDARD + float3 TransformWorldToObject(float3 p) { return mul(unity_WorldToObject, float4(p, 1)); }; + float3 TransformObjectToWorld(float3 p) { return mul(unity_ObjectToWorld, float4(p, 1)); }; + float4 TransformWorldToObject(float4 p) { return mul(unity_WorldToObject, p); }; + float4 TransformObjectToWorld(float4 p) { return mul(unity_ObjectToWorld, p); }; + float4x4 GetWorldToObjectMatrix() { return unity_WorldToObject; } + float4x4 GetObjectToWorldMatrix() { return unity_ObjectToWorld; } + #if (defined(SHADER_API_D3D11) || defined(SHADER_API_XBOXONE) || defined(UNITY_COMPILER_HLSLCC) || defined(SHADER_API_PSSL) || (SHADER_TARGET_SURFACE_ANALYSIS && !SHADER_TARGET_SURFACE_ANALYSIS_MOJOSHADER)) + #define UNITY_SAMPLE_TEX2D_LOD(tex,coord, lod) tex.SampleLevel (sampler##tex,coord, lod) + #define UNITY_SAMPLE_TEX2D_SAMPLER_LOD(tex,samplertex,coord, lod) tex.SampleLevel (sampler##samplertex,coord, lod) + #else + #define UNITY_SAMPLE_TEX2D_LOD(tex,coord,lod) tex2D (tex,coord,0,lod) + #define UNITY_SAMPLE_TEX2D_SAMPLER_LOD(tex,samplertex,coord,lod) tex2D (tex,coord,0,lod) + #endif + + #undef GetWorldToObjectMatrix() + + #define GetWorldToObjectMatrix() unity_WorldToObject + + + #endif + + float3 GetCameraWorldPosition() + { + #if _HDRP + return GetCameraRelativePositionWS(_WorldSpaceCameraPos); + #else + return _WorldSpaceCameraPos; + #endif + } + + #if _GRABPASSUSED + #if _STANDARD + TEXTURE2D(%GRABTEXTURE%); + SAMPLER(sampler_%GRABTEXTURE%); + #endif + + half3 GetSceneColor(float2 uv) + { + #if _STANDARD + return SAMPLE_TEXTURE2D(%GRABTEXTURE%, sampler_%GRABTEXTURE%, uv).rgb; + #else + return SHADERGRAPH_SAMPLE_SCENE_COLOR(uv); + #endif + } + #endif + + + + #if _STANDARD + UNITY_DECLARE_DEPTH_TEXTURE(_CameraDepthTexture); + float GetSceneDepth(float2 uv) { return SAMPLE_DEPTH_TEXTURE(_CameraDepthTexture, uv); } + float GetLinear01Depth(float2 uv) { return Linear01Depth(GetSceneDepth(uv)); } + float GetLinearEyeDepth(float2 uv) { return LinearEyeDepth(GetSceneDepth(uv)); } + #else + float GetSceneDepth(float2 uv) { return SHADERGRAPH_SAMPLE_SCENE_DEPTH(uv); } + float GetLinear01Depth(float2 uv) { return Linear01Depth(GetSceneDepth(uv), _ZBufferParams); } + float GetLinearEyeDepth(float2 uv) { return LinearEyeDepth(GetSceneDepth(uv), _ZBufferParams); } + #endif + + float3 GetWorldPositionFromDepthBuffer(float2 uv, float3 worldSpaceViewDir) + { + float eye = GetLinearEyeDepth(uv); + float3 camView = mul((float3x3)GetObjectToWorldMatrix(), transpose(mul(GetWorldToObjectMatrix(), UNITY_MATRIX_I_V)) [2].xyz); + + float dt = dot(worldSpaceViewDir, camView); + float3 div = worldSpaceViewDir/dt; + float3 wpos = (eye * div) + GetCameraWorldPosition(); + return wpos; + } + + #if _HDRP + float3 ObjectToWorldSpacePosition(float3 pos) + { + return GetAbsolutePositionWS(TransformObjectToWorld(pos)); + } + #else + float3 ObjectToWorldSpacePosition(float3 pos) + { + return TransformObjectToWorld(pos); + } + #endif + + #if _STANDARD + UNITY_DECLARE_SCREENSPACE_TEXTURE(_CameraDepthNormalsTexture); + float3 GetSceneNormal(float2 uv, float3 worldSpaceViewDir) + { + float4 depthNorms = UNITY_SAMPLE_SCREENSPACE_TEXTURE(_CameraDepthNormalsTexture, uv); + float3 norms = DecodeViewNormalStereo(depthNorms); + norms = mul((float3x3)GetWorldToViewMatrix(), norms) * 0.5 + 0.5; + return norms; + } + #elif _HDRP && !_DECALSHADER + + float3 GetSceneNormal(float2 uv, float3 worldSpaceViewDir) + { + NormalData nd; + DecodeFromNormalBuffer(_ScreenSize.xy * uv, nd); + return nd.normalWS; + } + #elif _URP + #if (SHADER_LIBRARY_VERSION_MAJOR >= 10) + #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/DeclareNormalsTexture.hlsl" + #endif + + float3 GetSceneNormal(float2 uv, float3 worldSpaceViewDir) + { + #if (SHADER_LIBRARY_VERSION_MAJOR >= 10) + return SampleSceneNormals(uv); + #else + float3 wpos = GetWorldPositionFromDepthBuffer(uv, worldSpaceViewDir); + return normalize(-cross(ddx(wpos), ddy(wpos))) * 0.5 + 0.5; + #endif + + } + #endif + + #if _HDRP + + half3 UnpackNormalmapRGorAG(half4 packednormal) + { + // This do the trick + packednormal.x *= packednormal.w; + + half3 normal; + normal.xy = packednormal.xy * 2 - 1; + normal.z = sqrt(1 - saturate(dot(normal.xy, normal.xy))); + return normal; + } + half3 UnpackNormal(half4 packednormal) + { + #if defined(UNITY_NO_DXT5nm) + return packednormal.xyz * 2 - 1; + #else + return UnpackNormalmapRGorAG(packednormal); + #endif + } + #endif + #if _HDRP || _URP + + half3 UnpackScaleNormal(half4 packednormal, half scale) + { + #ifndef UNITY_NO_DXT5nm + // Unpack normal as DXT5nm (1, y, 1, x) or BC5 (x, y, 0, 1) + // Note neutral texture like "bump" is (0, 0, 1, 1) to work with both plain RGB normal and DXT5nm/BC5 + packednormal.x *= packednormal.w; + #endif + half3 normal; + normal.xy = (packednormal.xy * 2 - 1) * scale; + normal.z = sqrt(1 - saturate(dot(normal.xy, normal.xy))); + return normal; + } + + #endif + + + void GetSun(out float3 lightDir, out float3 color) + { + lightDir = float3(0.5, 0.5, 0); + color = 1; + #if _HDRP + if (_DirectionalLightCount > 0) + { + DirectionalLightData light = _DirectionalLightDatas[0]; + lightDir = -light.forward.xyz; + color = light.color; + } + #elif _STANDARD + lightDir = normalize(_WorldSpaceLightPos0.xyz); + color = _LightColor0.rgb; + #elif _URP + Light light = GetMainLight(); + lightDir = light.direction; + color = light.color; + #endif + } + + + + CBUFFER_START(UnityPerMaterial) + + + half4 _Color; + half4 _MainTex_ST, _MainTex_TexelSize; + half _Alpha, _AlphaCutoffValue; + + #if ATLAS_ON + half _MinXUV, _MaxXUV, _MinYUV, _MaxYUV; + #endif + + #if GLOW_ON + half4 _GlowColor; + half _Glow, _GlowGlobal; + #endif + + #if HSV_ON + half _HsvShift, _HsvSaturation, _HsvBright; + #endif + + #if DISTORT_ON + half4 _DistortTex_ST; + half _DistortTexXSpeed, _DistortTexYSpeed, _DistortAmount; + #endif + + #if FADE_ON + half4 _FadeBurnColor, _FadeTex_ST, _FadeBurnTex_ST; + half _FadeAmount, _FadeBurnWidth, _FadeBurnTransition,_FadeBurnGlow; + #endif + + #if OUTBASE_ON + half4 _OutlineColor; + half _OutlineAlpha, _OutlineGlow, _OutlineWidth; + int _OutlinePixelWidth; + #endif + + #if OUTTEX_ON + half4 _OutlineTex_ST; + half _OutlineTexXSpeed, _OutlineTexYSpeed; + #endif + + #if OUTDIST_ON + half4 _OutlineDistortTex_ST; + half _OutlineDistortTexXSpeed, _OutlineDistortTexYSpeed, _OutlineDistortAmount; + #endif + + #if ALPHAOUTLINE_ON + half _AlphaOutlineGlow, _AlphaOutlinePower, _AlphaOutlineMinAlpha, _AlphaOutlineBlend; + half4 _AlphaOutlineColor; + #endif + + #if INNEROUTLINE_ON + half _InnerOutlineThickness, _InnerOutlineAlpha, _InnerOutlineGlow; + half4 _InnerOutlineColor; + #endif + + #if GRADIENT_ON + half _GradBlend, _GradBoostX, _GradBoostY; + half4 _GradTopRightCol, _GradTopLeftCol, _GradBotRightCol, _GradBotLeftCol; + #endif + + #if COLORSWAP_ON + half4 _ColorSwapRed, _ColorSwapGreen, _ColorSwapBlue; + half _ColorSwapRedLuminosity, _ColorSwapGreenLuminosity, _ColorSwapBlueLuminosity, _ColorSwapBlend; + #endif + + #if CHANGECOLOR_ON + half4 _ColorChangeNewCol, _ColorChangeTarget; + half _ColorChangeTolerance, _ColorChangeLuminosity; + #endif + #if CHANGECOLOR2_ON + half4 _ColorChangeNewCol2, _ColorChangeTarget2; + half _ColorChangeTolerance2; + #endif + #if CHANGECOLOR3_ON + half4 _ColorChangeNewCol3, _ColorChangeTarget3; + half _ColorChangeTolerance3; + #endif + + #if COLORRAMP_ON + half _ColorRampLuminosity, _ColorRampBlend; + #endif + + #if HITEFFECT_ON + half4 _HitEffectColor; + half _HitEffectGlow, _HitEffectBlend; + #endif + + #if NEGATIVE_ON + half _NegativeAmount; + #endif + + #if PIXELATE_ON + half _PixelateSize; + #endif + + #if GREYSCALE_ON + half _GreyscaleLuminosity, _GreyscaleBlend; + half4 _GreyscaleTintColor; + #endif + + #if POSTERIZE_ON + half _PosterizeNumColors, _PosterizeGamma; + #endif + + #if BLUR_ON + half _BlurIntensity; + #endif + + #if MOTIONBLUR_ON + half _MotionBlurAngle, _MotionBlurDist; + #endif + + #if GHOST_ON + half _GhostColorBoost, _GhostTransparency, _GhostBlend; + #endif + + #if HOLOGRAM_ON + half _HologramStripesAmount, _HologramMinAlpha, _HologramUnmodAmount, _HologramStripesSpeed, _HologramMaxAlpha, _HologramBlend; + half4 _HologramStripeColor; + #endif + + #if CHROMABERR_ON + half _ChromAberrAmount, _ChromAberrAlpha; + #endif + + #if GLITCH_ON + half _GlitchAmount, _GlitchSize; + #endif + + #if FLICKER_ON + half _FlickerFreq, _FlickerPercent, _FlickerAlpha; + #endif + + #if SHADOW_ON + half _ShadowX, _ShadowY, _ShadowAlpha; + half4 _ShadowColor; + #endif + + #if SHINE_ON + half4 _ShineColor; + half _ShineLocation, _ShineRotate, _ShineWidth, _ShineGlow; + #endif + + #if CONTRAST_ON + half _Contrast, _Brightness; + #endif + + #if OVERLAY_ON + half4 _OverlayTex_ST, _OverlayColor; + half _OverlayGlow, _OverlayBlend, _OverlayTextureScrollXSpeed, _OverlayTextureScrollYSpeed; + #endif + + #if DOODLE_ON + half _HandDrawnAmount, _HandDrawnSpeed; + #endif + + #if WIND_ON + half _GrassSpeed, _GrassWind, _GrassManualAnim, _GrassRadialBend; + #endif + + #if WAVEUV_ON + float _WaveAmount, _WaveSpeed, _WaveStrength, _WaveX, _WaveY; + #endif + + #if ROUNDWAVEUV_ON + half _RoundWaveStrength, _RoundWaveSpeed; + #endif + + #if RECTSIZE_ON + half _RectSize; + #endif + + #if OFFSETUV_ON + half _OffsetUvX, _OffsetUvY; + #endif + + #if CLIPPING_ON + half _ClipUvLeft, _ClipUvRight, _ClipUvUp, _ClipUvDown; + #endif + + #if RADIALCLIPPING_ON + half _RadialStartAngle, _RadialClip, _RadialClip2; + #endif + + #if TEXTURESCROLL_ON + half _TextureScrollXSpeed, _TextureScrollYSpeed; + #endif + + #if ZOOMUV_ON + half _ZoomUvAmount; + #endif + + #if WARP_ON + half _WarpStrength, _WarpSpeed, _WarpScale; + #endif + + #if TWISTUV_ON + half _TwistUvAmount, _TwistUvPosX, _TwistUvPosY, _TwistUvRadius; + #endif + + #if ROTATEUV_ON + half _RotateUvAmount; + #endif + + #if FISHEYE_ON + half _FishEyeUvAmount; + #endif + + #if PINCH_ON + half _PinchUvAmount; + #endif + + #if SHAKEUV_ON + half _ShakeUvSpeed, _ShakeUvX, _ShakeUvY; + #endif + + #if NORMALMAP_ON + half _NormalStrength; + #endif + + float _RandomSeed; + + + + + CBUFFER_END + + + + + + + + TEXTURE2D(_MainTex); + SAMPLER(sampler_MainTex); + + #if GLOW_ON + TEXTURE2D(_GlowTex); + SAMPLER(sampler_GlowTex); + #endif + + #if FADE_ON + TEXTURE2D(_FadeTex); + SAMPLER(sampler_FadeTex); + + TEXTURE2D(_FadeBurnTex); + SAMPLER(sampler_FadeBurnTex); + #endif + + #if DISTORT_ON + TEXTURE2D(_DistortTex); + SAMPLER(sampler_DistortTex); + #endif + + #if OUTTEX_ON + TEXTURE2D(_OutlineTex); + SAMPLER(sampler_OutlineTex); + #endif + + #if OUTDIST_ON + TEXTURE2D(_OutlineDistortTex); + SAMPLER(sampler_OutlineDistortTex); + #endif + + #if COLORSWAP_ON + TEXTURE2D(_ColorSwapTex); + SAMPLER(sampler_ColorSwapTex); + #endif + + #if COLORRAMP_ON + TEXTURE2D(_ColorRampTex); + TEXTURE2D(_ColorRampTexGradient); + SAMPLER(sampler_ColorRampTex); + SAMPLER(sampler_ColorRampTexGradient); + #endif + + #if SHINE_ON + TEXTURE2D(_ShineMask); + SAMPLER(sampler_ShineMask); + #endif + + #if OVERLAY_ON + TEXTURE2D(_OverlayTex); + SAMPLER(sampler_OverlayTex); + #endif + + #if NORMALMAP_ON + TEXTURE2D(_NormalMap); + SAMPLER(sampler_NormalMap); + #endif + + + half3 GetPixel(in int offsetX, in int offsetY, in half2 uv, in Texture2D _tex, in SamplerState _sampler) + { + half2 _uv = uv + half2(offsetX * _MainTex_TexelSize.x, offsetY * _MainTex_TexelSize.y); + half4 col = SAMPLE_TEXTURE2D(_tex, _sampler, _uv); + return col.rgb; + } + + + //BLURS------------------------------------------------------------------------- + half4 Blur(half2 uv, Texture2D source, SamplerState sampler_source, half Intensity) + { + const half2 texelSize = 1.0 / _ScreenParams.xy; + const half4 color = SAMPLE_TEXTURE2D(source, sampler_source, uv); + const half2 offset = Intensity * texelSize; + + half4 accumulatedColor = color; + half accumulatedWeight = 1.0; + for (int x = -1; x <= 1; x++) + { + for (int y = -1; y <= 1; y++) + { + const half2 sampleUV = uv + half2(x, y) * offset; + const half4 sampleColor = SAMPLE_TEXTURE2D(source, sampler_source, sampleUV); + + accumulatedColor += sampleColor; + accumulatedWeight += 1.0; + } + } + + half4 blurredColor = accumulatedColor / accumulatedWeight; + return blurredColor; + } + + half BlurHD_G(half bhqp, half x) + { + return exp(-(x * x) / (2.0 * bhqp * bhqp)); + } + half4 BlurHD(half2 uv, Texture2D source, SamplerState sampler_source, half BlurAmount, half xScale, half yScale) + { + int iterations = 16; + int halfIterations = iterations / 2; + half sigmaX = 0.1 + BlurAmount * 0.5; + half sigmaY = sigmaX; + half total = 0.0; + half4 ret = half4(0, 0, 0, 0); + for (int iy = 0; iy < iterations; ++iy) + { + half fy = BlurHD_G(sigmaY, half(iy) -half(halfIterations)); + half offsetY = half(iy - halfIterations) * 0.00390625 * xScale; + for (int ix = 0; ix < iterations; ++ix) + { + half fx = BlurHD_G(sigmaX, half(ix) - half(halfIterations)); + half offsetX = half(ix - halfIterations) * 0.00390625 * yScale; + total += fx * fy; + ret += SAMPLE_TEXTURE2D(source, sampler_source, uv + half2(offsetX, offsetY)) * fx * fy; + } + } + return ret / total; + } + //----------------------------------------------------------------------- + + + //------------------------------------------- + half RemapFloat(half inValue, half inMin, half inMax, half outMin, half outMax){ + return outMin + (inValue - inMin) * (outMax - outMin) / (inMax - inMin); + } + //------------------------------------------- + + //----------------------------------------------------------------------- + half rand(half2 seed, half offset) { + return (frac(sin(dot(seed, half2(12.9898, 78.233))) * 43758.5453) + offset) % 1.0; + } + + half rand2(half2 seed, half offset) { + return (frac(sin(dot(seed * floor(50 + (_Time.x % 1.0) * 12.), half2(127.1, 311.7))) * 43758.5453123) + offset) % 1.0; + } + + half rand2CustomTime(half2 seed, half offset, half customTime) { + return (frac(sin(dot(seed * floor(50 + (customTime % 1.0) * 12.), half2(127.1, 311.7))) * 43758.5453123) + offset) % 1.0; + } + //----------------------------------------------------------------------- + + + void Ext_ModifyVertex0 (inout VertexData v, inout ExtraV2F d) + { + //BILBOARD_ON + #if BILBOARD_ON + half3 camRight = mul((half3x3)unity_CameraToWorld, half3(1,0,0)); + half3 camUp = half3(0,1,0); + #if BILBOARDY_ON + camUp = mul((half3x3)unity_CameraToWorld, half3(0,1,0)); + #endif + half3 localPos = v.vertex.x * camRight + v.vertex.y * camUp; + v.vertex = half4(localPos, 1); + #endif + //----------------------------------------------------------- + + v.texcoord0.xy = TRANSFORM_TEX(v.texcoord0.xy, _MainTex); + half2 center = half2(0.5, 0.5); + #if ATLAS_ON + center = half2((_MaxXUV + _MinXUV) / 2.0, (_MaxYUV + _MinYUV) / 2.0); + #endif + + //POLARUV_ON + #if POLARUV_ON + v.texcoord0.xy = v.texcoord0.xy - center; + #endif + + //---------------------------------------- + + //ROTATEUV_ON + #if ROTATEUV_ON + half2 uvC = v.texcoord0.xy; + half cosAngle = cos(_RotateUvAmount); + half sinAngle = sin(_RotateUvAmount); + half2x2 rot = half2x2(cosAngle, -sinAngle, sinAngle, cosAngle); + uvC -= center; + v.texcoord0.xy = mul(rot, uvC); + v.texcoord0.xy += center; + #endif + //-------------------- + + #if RECTSIZE_ON + v.vertex.xyz += (v.vertex.xyz * (_RectSize - 1.0)); + #endif + + #if OUTTEX_ON + v.texcoord1.xy = TRANSFORM_TEX(v.texcoord0.xy, _OutlineTex); + #endif + + #if OUTDIST_ON + v.texcoord2.xy = TRANSFORM_TEX(v.texcoord0.xy, _OutlineDistortTex); + #endif + + #if DISTORT_ON + v.texcoord3.xy = TRANSFORM_TEX(v.texcoord0.xy, _DistortTex); + #endif + } + + void Ext_SurfaceFunction0 (inout Surface o, ShaderData d) + { + half randomSeed = _RandomSeed; + + float2 uvRect = d.texcoord0; + half2 center = half2(0.5, 0.5); + #if ATLAS_ON + center = half2((_MaxXUV + _MinXUV) / 2.0, (_MaxYUV + _MinYUV) / 2.0); + uvRect = half2((d.texcoord0.x - _MinXUV) / (_MaxXUV - _MinXUV), (d.texcoord0.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half2 centerTiled = half2(center.x * _MainTex_ST.x, center.y * _MainTex_ST.y); + + //CLIPPING_ON + #if CLIPPING_ON + half2 tiledUv = half2(d.texcoord0.x / _MainTex_ST.x, d.texcoord0.y / _MainTex_ST.y); + #if ATLAS_ON + tiledUv = half2((tiledUv.x - _MinXUV) / (_MaxXUV - _MinXUV), (tiledUv.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + clip((1 - _ClipUvUp) - tiledUv.y); + clip(tiledUv.y - _ClipUvDown); + clip((1 - _ClipUvRight) - tiledUv.x); + clip(tiledUv.x - _ClipUvLeft); + #endif + //---------------------------------- + + //RADIALCLIPPING_ON + #if RADIALCLIPPING_ON + half2 tiledUv2 = half2(d.texcoord0.x / _MainTex_ST.x, d.texcoord0.y / _MainTex_ST.y); + #if ATLAS_ON + tiledUv2 = half2((tiledUv2.x - _MinXUV) / (_MaxXUV - _MinXUV), (tiledUv2.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half startAngle = _RadialStartAngle - _RadialClip; + half endAngle = _RadialStartAngle + _RadialClip2; + half offset0 = clamp(0, 360, startAngle + 360); + half offset360 = clamp(0, 360, endAngle - 360); + half2 atan2Coord = half2(lerp(-1, 1, tiledUv2.x), lerp(-1, 1, tiledUv2.y)); + half atanAngle = atan2(atan2Coord.y, atan2Coord.x) * 57.3; // angle in degrees + if(atanAngle < 0) atanAngle = 360 + atanAngle; + if(atanAngle >= startAngle && atanAngle <= endAngle) discard; + if(atanAngle <= offset360) discard; + if(atanAngle >= offset0) discard; + #endif + + //----------------------------- + + //TEXTURESCROLL_ON && ATLAS_ON + #if TEXTURESCROLL_ON && ATLAS_ON + d.texcoord0.xy = half2(_MinXUV + ((_MaxXUV - _MinXUV) * (abs(((_Time.y + randomSeed) * _TextureScrollXSpeed) + uvRect.x) % 1)), + _MinYUV + ((_MaxYUV - _MinYUV) * (abs(((_Time.y + randomSeed) * _TextureScrollYSpeed) + uvRect.y) % 1))); + #endif + //---------------------------- + + //OFFSETUV_ON + #if OFFSETUV_ON + #if ATLAS_ON + d.texcoord0.xy = half2(_MinXUV + ((_MaxXUV - _MinXUV) * (abs((_OffsetUvX + uvRect.x) % 1))), + _MinYUV + ((_MaxYUV - _MinYUV) * (abs(_OffsetUvY + uvRect.y) % 1))); + #else + d.texcoord0.xy += half2(_OffsetUvX, _OffsetUvY); + #endif + #endif + + //---------------------- + + //POLARUV_ON + #if POLARUV_ON + d.texcoord0.xy = half2(atan2(d.texcoord0.y, d.texcoord0.x) / (2.0f * 3.141592653589f), length(d.texcoord0.xy)); + d.texcoord0.xy *= _MainTex_ST.xy; + #endif + + //-------------------------------------- + + //TWISTUV_ON + #if TWISTUV_ON + #if ATLAS_ON + _TwistUvPosX = ((_MaxXUV - _MinXUV) * _TwistUvPosX) + _MinXUV; + _TwistUvPosY = ((_MaxYUV - _MinYUV) * _TwistUvPosY) + _MinYUV; + #endif + half2 tempUv = d.texcoord0.xy - half2(_TwistUvPosX * _MainTex_ST.x, _TwistUvPosY * _MainTex_ST.y); + _TwistUvRadius *= (_MainTex_ST.x + _MainTex_ST.y) / 2; + half percent = (_TwistUvRadius - length(tempUv)) / _TwistUvRadius; + half theta = percent * percent * (2.0 * sin(_TwistUvAmount)) * 8.0; + half s = sin(theta); + half c = cos(theta); + half beta = max(sign(_TwistUvRadius - length(tempUv)), 0.0); + tempUv = half2(dot(tempUv, half2(c, -s)), dot(tempUv, half2(s, c))) * beta + tempUv * (1 - beta); + tempUv += half2(_TwistUvPosX * _MainTex_ST.x, _TwistUvPosY * _MainTex_ST.y); + d.texcoord0.xy = tempUv; + #endif + + //-------------------------------------------- + + //FISHEYE_ON + #if FISHEYE_ON + half bind = length(centerTiled); + half2 dF = d.texcoord0.xy - centerTiled; + half dFlen = length(dF); + half fishInt = (3.14159265359 / bind) * (_FishEyeUvAmount + 0.001); + d.texcoord0.xy = centerTiled + (dF / (max(0.0001, dFlen))) * tan(dFlen * fishInt) * bind / tan(bind * fishInt); + #endif + //--------------------------------------------- + + //PINCH_ON + #if PINCH_ON + half2 dP = d.texcoord0.xy - centerTiled; + half pinchInt = (3.141592 / length(centerTiled)) * (-_PinchUvAmount + 0.001); + d.texcoord0.xy = centerTiled + normalize(dP) * atan(length(dP) * -pinchInt * 10.0) * 0.5 / atan(-pinchInt * 5); + #endif + + //--------------------------------------------- + + //ZOOMUV_ON + #if ZOOMUV_ON + d.texcoord0.xy -= centerTiled; + d.texcoord0.xy = d.texcoord0.xy * _ZoomUvAmount; + d.texcoord0.xy += centerTiled; + #endif + + //----------------------------------------------- + + //DOODLE_ON + #if DOODLE_ON + half2 uvCopy = uvRect; + _HandDrawnSpeed = (floor((_Time.x + randomSeed) * 20 * _HandDrawnSpeed) / _HandDrawnSpeed) * _HandDrawnSpeed; + uvCopy.x = sin((uvCopy.x * _HandDrawnAmount + _HandDrawnSpeed) * 4); + uvCopy.y = cos((uvCopy.y * _HandDrawnAmount + _HandDrawnSpeed) * 4); + d.texcoord0.xy = lerp(d.texcoord0.xy, d.texcoord0.xy + uvCopy, 0.0005 * _HandDrawnAmount); + #endif + + //-------------------------- + + //SHAKEUV_ON + #if SHAKEUV_ON + half xShake = sin((_Time.x + randomSeed) * _ShakeUvSpeed * 50) * _ShakeUvX; + half yShake = cos((_Time.x + randomSeed) * _ShakeUvSpeed * 50) * _ShakeUvY; + d.texcoord0.xy += half2(xShake * 0.012, yShake * 0.01); + #endif + + //------------------------------------------- + + //RECTSIZE_ON + #if RECTSIZE_ON + d.texcoord0.xy = d.texcoord0.xy * (_RectSize).xx + (((-_RectSize * 0.5) + 0.5)).xx; + #endif + + //------------------------------------------- + + //DISTORT_ON + #if DISTORT_ON + #if ATLAS_ON + d.texcoord3.x = d.texcoord3.x * (1 / (_MaxXUV - _MinXUV)); + d.texcoord3.y = d.texcoord3.y * (1 / (_MaxYUV - _MinYUV)); + #endif + + d.texcoord3.x += ((_Time.x + _RandomSeed) * _DistortTexXSpeed) % 1; + d.texcoord3.y += ((_Time.x + _RandomSeed) * _DistortTexYSpeed) % 1; + half distortAmnt = (SAMPLE_TEXTURE2D(_DistortTex, sampler_DistortTex, d.texcoord3.xy).r - 0.5) * 0.2 * _DistortAmount; + d.texcoord0.x += distortAmnt; + d.texcoord0.y += distortAmnt; + #endif + //------------------------------------------------------- + + //WARP_ON + #if WARP_ON + half2 warpUv = half2(d.texcoord0.x / _MainTex_ST.x, d.texcoord0.y / _MainTex_ST.y); + #if ATLAS_ON + warpUv = half2((warpUv.x - _MinXUV) / (_MaxXUV - _MinXUV), (warpUv.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + const float tau = 6.283185307179586; + float xWarp = (_Time.y + randomSeed) * _WarpSpeed + warpUv.x * tau / _WarpScale; + float yWarp = (_Time.y + randomSeed) * _WarpSpeed + warpUv.y * tau / _WarpScale; + float2 warp = float2(sin(xWarp), sin(yWarp)) * _WarpStrength; + d.texcoord0.xy += warp; + #endif + + //------------------------------------------------------- + + //WAVEUV_ON + #if WAVEUV_ON + float2 uvWave = half2(_WaveX * _MainTex_ST.x, _WaveY * _MainTex_ST.y) - d.texcoord0.xy; + uvWave %= 1; + #if ATLAS_ON + uvWave = half2(_WaveX, _WaveY) - uvRect; + #endif + uvWave.x *= _ScreenParams.x / _ScreenParams.y; + float waveTime = _Time.y + randomSeed; + float angWave = (sqrt(dot(uvWave, uvWave)) * _WaveAmount) - ((waveTime * _WaveSpeed)); + d.texcoord0.xy = d.texcoord0.xy + uvWave * sin(angWave) * (_WaveStrength / 1000.0); + #endif + //---------------------------------------------------- + + //ROUNDWAVEUV_ON + #if ROUNDWAVEUV_ON + half xWave = ((0.5 * _MainTex_ST.x) - uvRect.x); + half yWave = ((0.5 * _MainTex_ST.y) - uvRect.y) * (_MainTex_TexelSize.w / _MainTex_TexelSize.z); + half ripple = -sqrt(xWave*xWave + yWave* yWave); + d.texcoord0.xy += (sin((ripple + (_Time.y + randomSeed) * (_RoundWaveSpeed/10.0)) / 0.015) * (_RoundWaveStrength/10.0)) % 1; + #endif + //---------------------------------------------------- + + + //WIND_ON + #if WIND_ON + half windOffset = sin((_Time.x + randomSeed) * _GrassSpeed * 10); + half2 windCenter = half2(0.5, 0.1); + #if ATLAS_ON + windCenter.x = ((_MaxXUV - _MinXUV) * windCenter.x) + _MinXUV; + windCenter.y = ((_MaxYUV - _MinYUV) * windCenter.y) + _MinYUV; + #endif + #if !MANUALWIND_ON + d.texcoord0.x = fmod(abs(lerp(d.texcoord0.x, d.texcoord0.x + (_GrassWind * 0.01 * windOffset), uvRect.y)), 1); + #else + d.texcoord0.x = fmod(abs(lerp(d.texcoord0.x, d.texcoord0.x + (_GrassWind * 0.01 * _GrassManualAnim), uvRect.y)), 1); + windOffset = _GrassManualAnim; + #endif + half2 delta = d.texcoord0.xy - windCenter; + half delta2 = dot(delta.xy, delta.xy); + half2 delta_offset = delta2 * windOffset; + d.texcoord0.xy = d.texcoord0.xy + half2(delta.y, -delta.x) * delta_offset * _GrassRadialBend; + #endif + + //-------------------------------------------------------- + + //TEXTURESCROLL_ON && !ATLAS_ON + #if TEXTURESCROLL_ON && !ATLAS_ON + d.texcoord0.x += ((_Time.y + randomSeed) * _TextureScrollXSpeed) % 1; + d.texcoord0.y += ((_Time.y + randomSeed) * _TextureScrollYSpeed) % 1; + #endif + //------------------------------ + + //PIXELATE_ON + #if PIXELATE_ON + half aspectRatio = _MainTex_TexelSize.x / _MainTex_TexelSize.y; + half2 pixelSize = float2(_PixelateSize, _PixelateSize * aspectRatio); + d.texcoord0.xy = floor(d.texcoord0.xy * pixelSize) / pixelSize; + #endif + //-------------- + + half4 col = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy); + half originalAlpha = col.a; + col *= d.vertexColor; + + //NORMAL MAP + #if NORMALMAP_ON + half4 normalSample = SAMPLE_TEXTURE2D(_NormalMap, sampler_NormalMap, d.texcoord0.xy); + half3 normalTS = UnpackNormal(normalSample); + normalTS.xy *= _NormalStrength; + o.Normal = normalTS; + #endif + + + //GLITCH_ON + #if GLITCH_ON + half2 uvGlitch = uvRect; + uvGlitch.y -= 0.5; + half lineNoise = pow(rand2(floor(uvGlitch * half2(24., 19.) * _GlitchSize) * 4.0, randomSeed), 3.0) * _GlitchAmount + * pow(rand2(floor(uvGlitch * half2(38., 14.) * _GlitchSize) * 4.0, randomSeed), 3.0); + col = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(lineNoise * 0.02 * rand2(half2(2.0, 1), randomSeed), 0)) * d.vertexColor; + #endif + //-------------------------------------- + + //CHROMABERR_ON + #if CHROMABERR_ON + half4 r = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(_ChromAberrAmount/10, 0)) * d.vertexColor; + half4 b = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(-_ChromAberrAmount/10, 0)) * d.vertexColor; + col = half4(r.r * r.a, col.g, b.b * b.a, max(max(r.a, b.a) * _ChromAberrAlpha, col.a)); + #endif + + //-------------------------------- + + //BLUR_ON + #if BLUR_ON + #if ATLAS_ON + #if !BLURISHD_ON + col = BlurHD(d.texcoord0.xy, _MainTex, sampler_MainTex, _BlurIntensity, (_MaxXUV - _MinXUV), (_MaxYUV - _MinYUV)) * d.vertexColor; + #else + col = Blur(d.texcoord0.xy, _MainTex, sampler_MainTex, _BlurIntensity * (_MaxXUV - _MinXUV)) * d.vertexColor; + #endif + #else + #if !BLURISHD_ON + col = BlurHD(d.texcoord0.xy, _MainTex, sampler_MainTex, _BlurIntensity, 1, 1) * d.vertexColor; + #else + col = Blur(d.texcoord0.xy, _MainTex, sampler_MainTex, _BlurIntensity) * d.vertexColor; + #endif + #endif + #endif + + //-------------------- + + //MOTIONBLUR_ON + #if MOTIONBLUR_ON + _MotionBlurAngle = _MotionBlurAngle * 3.1415926; + #define rot(n) mul(n, half2x2(cos(_MotionBlurAngle), -sin(_MotionBlurAngle), sin(_MotionBlurAngle), cos(_MotionBlurAngle))) + _MotionBlurDist = _MotionBlurDist * 0.005; + #if ATLAS_ON + _MotionBlurDist *= (_MaxXUV - _MinXUV); + #endif + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(-_MotionBlurDist, -_MotionBlurDist))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(-_MotionBlurDist * 2, -_MotionBlurDist * 2))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(-_MotionBlurDist * 3, -_MotionBlurDist * 3))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(-_MotionBlurDist * 4, -_MotionBlurDist * 4))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(_MotionBlurDist, _MotionBlurDist))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(_MotionBlurDist * 2, _MotionBlurDist * 2))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(_MotionBlurDist * 3, _MotionBlurDist * 3))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(_MotionBlurDist * 4, _MotionBlurDist * 4))); + col.rgb = col.rgb / 9; + #endif + //------------------------------------ + + //NEGATIVE_ON + #if NEGATIVE_ON + col.rgb = lerp(col.rgb, 1 - col.rgb, _NegativeAmount); + #endif + + //-------------- + half luminance = 0; + + //GREYSCALE_ON && !GREYSCALEOUTLINE_ON + #if GREYSCALE_ON && !GREYSCALEOUTLINE_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + luminance = saturate(luminance + _GreyscaleLuminosity); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _GreyscaleTintColor, _GreyscaleBlend); + #endif + //------------------------------------ + + //GHOST_ON + #if GHOST_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + half4 ghostResult; + ghostResult.a = saturate(luminance - _GhostTransparency) * col.a; + ghostResult.rgb = col.rgb * (luminance + _GhostColorBoost); + col = lerp(col, ghostResult, _GhostBlend); + #endif + //------------------------------------ + + //INNEROUTLINE_ON + #if INNEROUTLINE_ON + half3 innerT = abs(GetPixel(0, _InnerOutlineThickness, d.texcoord0.xy, _MainTex, sampler_MainTex) - GetPixel(0, -_InnerOutlineThickness, d.texcoord0.xy, _MainTex, sampler_MainTex)); + innerT += abs(GetPixel(_InnerOutlineThickness, 0, d.texcoord0.xy, _MainTex, sampler_MainTex) - GetPixel(-_InnerOutlineThickness, 0, d.texcoord0.xy, _MainTex, sampler_MainTex)); + #if !ONLYINNEROUTLINE_ON + innerT = (innerT / 2.0) * col.a * _InnerOutlineAlpha; + col.rgb += length(innerT) * _InnerOutlineColor.rgb * _InnerOutlineGlow; + #else + innerT *= col.a * _InnerOutlineAlpha; + col.rgb = length(innerT) * _InnerOutlineColor.rgb * _InnerOutlineGlow; + col.a = step(0.3, col.r+col.g+col.b); + #endif + #endif + //------------------------------------------------------- + + //HITEFFECT_ON + #if HITEFFECT_ON + col.rgb = lerp(col.rgb, _HitEffectColor.rgb * _HitEffectGlow, _HitEffectBlend); + #endif + //-------------------- + + //GRADIENT_ON + #if GRADIENT_ON + half2 tiledUvGrad = half2(uvRect.x / _MainTex_ST.x, uvRect.y / _MainTex_ST.y); + #if GRADIENT2COL_ON + _GradTopRightCol = _GradTopLeftCol; + _GradBotRightCol = _GradBotLeftCol; + #endif + #if RADIALGRADIENT_ON + half radialDist = 1 - length(tiledUvGrad - half2(0.5, 0.5)); + radialDist *= (_MainTex_TexelSize.w / _MainTex_TexelSize.z); + radialDist = saturate(_GradBoostX * radialDist); + half4 gradientResult = lerp(_GradTopLeftCol, _GradBotLeftCol, radialDist); + #else + half gradXLerpFactor = saturate(pow(tiledUvGrad.x, _GradBoostX)); + half4 gradientResult = lerp(lerp(_GradBotLeftCol, _GradBotRightCol, gradXLerpFactor), + lerp(_GradTopLeftCol, _GradTopRightCol, gradXLerpFactor), saturate(pow(tiledUvGrad.y, _GradBoostY))); + #endif + gradientResult = lerp(col, gradientResult, _GradBlend); + col.rgb = gradientResult.rgb * col.a; + col.a *= gradientResult.a; + #endif + //-------------------------------------------------------------------- + + //CONTRAST_ON + #if CONTRAST_ON + col.rgb = (col.rgb - float3(0.5, 0.5, 0.5)) * _Contrast + float3(0.5, 0.5, 0.5); + col.rgb += _Brightness; + #endif + + //------------------------------------------------------------------- + + //COLORSWAP_ON + #if COLORSWAP_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + half4 swapMask = SAMPLE_TEXTURE2D(_ColorSwapTex, sampler_ColorSwapTex, d.texcoord0.xy); + swapMask.rgb *= swapMask.a; + half3 redSwap = _ColorSwapRed * swapMask.r * saturate(luminance + _ColorSwapRedLuminosity); + half3 greenSwap = _ColorSwapGreen * swapMask.g * saturate(luminance + _ColorSwapGreenLuminosity); + half3 blueSwap = _ColorSwapBlue * swapMask.b * saturate(luminance + _ColorSwapBlueLuminosity); + swapMask.rgb = col.rgb * saturate(1 - swapMask.r - swapMask.g - swapMask.b); + col.rgb = lerp(col.rgb, swapMask.rgb + redSwap + greenSwap + blueSwap, _ColorSwapBlend); + #endif + //-------------------------------------------------------------------- + + //COLORRAMP_ON && !COLORRAMPOUTLINE_ON + #if COLORRAMP_ON && !COLORRAMPOUTLINE_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + luminance = saturate(luminance + _ColorRampLuminosity); + #if GRADIENTCOLORRAMP_ON + col.rgb = lerp(col.rgb, SAMPLE_TEXTURE2D(_ColorRampTexGradient, sampler_ColorRampTexGradient, half2(luminance, 0)).rgb, _ColorRampBlend); + #else + col.rgb = lerp(col.rgb, SAMPLE_TEXTURE2D(_ColorRampTex, sampler_ColorRampTex, half2(luminance, 0)).rgb, _ColorRampBlend); + #endif + #endif + //-------------------------------------------------------------------- + + //CHANGECOLOR_ON + #if CHANGECOLOR_ON + float3 currChangeColor = saturate(col.rgb); + luminance = 0.3 * currChangeColor.r + 0.59 * currChangeColor.g + 0.11 * currChangeColor.b; + luminance = saturate(luminance + _ColorChangeLuminosity); + half3 dif = abs(currChangeColor - _ColorChangeTarget.rgb); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _ColorChangeNewCol.rgb, + max(sign(1 - saturate(dif.x + dif.y + dif.z) - _ColorChangeTolerance), 0.0)); + #if CHANGECOLOR2_ON + dif = abs(currChangeColor - _ColorChangeTarget2.rgb); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _ColorChangeNewCol2.rgb, + max(sign(1 - saturate(dif.x + dif.y + dif.z) - _ColorChangeTolerance2), 0.0)); + #endif + #if CHANGECOLOR3_ON + dif = abs(currChangeColor - _ColorChangeTarget3.rgb); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _ColorChangeNewCol3.rgb, + max(sign(1 - saturate(dif.x + dif.y + dif.z) - _ColorChangeTolerance3), 0.0)); + #endif + #endif + //------------------------------------------------------- + + //POSTERIZE_ON && !POSTERIZEOUTLINE_ON + #if POSTERIZE_ON && !POSTERIZEOUTLINE_ON + col.rgb = pow(col.rgb, _PosterizeGamma) * _PosterizeNumColors; + col.rgb = floor(col.rgb) / _PosterizeNumColors; + col.rgb = pow(col.rgb, 1.0 / _PosterizeGamma); + #endif + //------------------------------------ + + //HSV_ON + #if HSV_ON + half3 resultHsv = half3(col.rgb); + half cosHsv = _HsvBright * _HsvSaturation * cos(_HsvShift * 3.14159265 / 180); + half sinHsv = _HsvBright * _HsvSaturation * sin(_HsvShift * 3.14159265 / 180); + resultHsv.x = (.299 * _HsvBright + .701 * cosHsv + .168 * sinHsv) * col.x + + (.587 * _HsvBright - .587 * cosHsv + .330 * sinHsv) * col.y + + (.114 * _HsvBright - .114 * cosHsv - .497 * sinHsv) * col.z; + resultHsv.y = (.299 * _HsvBright - .299 * cosHsv - .328 * sinHsv) *col.x + + (.587 * _HsvBright + .413 * cosHsv + .035 * sinHsv) * col.y + + (.114 * _HsvBright - .114 * cosHsv + .292 * sinHsv) * col.z; + resultHsv.z = (.299 * _HsvBright - .3 * cosHsv + 1.25 * sinHsv) * col.x + + (.587 * _HsvBright - .588 * cosHsv - 1.05 * sinHsv) * col.y + + (.114 * _HsvBright + .886 * cosHsv - .203 * sinHsv) * col.z; + col.rgb = resultHsv; + #endif + //------------------------------------------------------- + + //OVERLAY_ON + #if OVERLAY_ON + half2 overlayUvs = d.texcoord0.xy; + overlayUvs.x += ((_Time.y + randomSeed) * _OverlayTextureScrollXSpeed) % 1; + overlayUvs.y += ((_Time.y + randomSeed) * _OverlayTextureScrollYSpeed) % 1; + half4 overlayCol = SAMPLE_TEXTURE2D(_OverlayTex, sampler_OverlayTex, TRANSFORM_TEX(overlayUvs, _OverlayTex)); + overlayCol.rgb *= _OverlayColor.rgb * _OverlayGlow; + #if !OVERLAYMULT_ON + overlayCol.rgb *= overlayCol.a * _OverlayColor.rgb * _OverlayColor.a * _OverlayBlend; + col.rgb += overlayCol.rgb; + #else + overlayCol.a *= _OverlayColor.a; + col = lerp(col, col * overlayCol, _OverlayBlend); + #endif + #endif + + //--------------------------------- + + //OUTBASE_ON + #if OUTBASE_ON + #if OUTBASEPIXELPERF_ON + half2 destUv = half2(_OutlinePixelWidth * _MainTex_TexelSize.x, _OutlinePixelWidth * _MainTex_TexelSize.y); + #else + half2 destUv = half2(_OutlineWidth * _MainTex_TexelSize.x * 200, _OutlineWidth * _MainTex_TexelSize.y * 200); + #endif + + #if OUTDIST_ON + d.texcoord3.x += ((_Time.x + _RandomSeed) * _OutlineDistortTexXSpeed) % 1; + d.texcoord3.y += ((_Time.x + _RandomSeed) * _OutlineDistortTexYSpeed) % 1; + #if ATLAS_ON + d.texcoord3 = half2((d.texcoord3.x - _MinXUV) / (_MaxXUV - _MinXUV), (d.texcoord3.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half outDistortAmnt = (SAMPLE_TEXTURE2D(_OutlineDistortTex, sampler_OutlineDistortTex, d.texcoord3).r - 0.5) * 0.2 * _OutlineDistortAmount; + destUv.x += outDistortAmnt; + destUv.y += outDistortAmnt; + #endif + + half spriteLeft = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(destUv.x, 0)).a; + half spriteRight = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy - half2(destUv.x, 0)).a; + half spriteBottom = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(0, destUv.y)).a; + half spriteTop = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy - half2(0, destUv.y)).a; + half result = spriteLeft + spriteRight + spriteBottom + spriteTop; + + #if OUTBASE8DIR_ON + half spriteTopLeft = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(destUv.x, destUv.y)).a; + half spriteTopRight = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(-destUv.x, destUv.y)).a; + half spriteBotLeft = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(destUv.x, -destUv.y)).a; + half spriteBotRight = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(-destUv.x, -destUv.y)).a; + result = result + spriteTopLeft + spriteTopRight + spriteBotLeft + spriteBotRight; + #endif + + result = step(0.05, saturate(result)); + + #if OUTTEX_ON + d.texcoord1.x += ((_Time.x + _RandomSeed) * _OutlineTexXSpeed) % 1; + d.texcoord1.y += ((_Time.x + _RandomSeed) * _OutlineTexYSpeed) % 1; + #if ATLAS_ON + d.texcoord1 = half2((d.texcoord1.x - _MinXUV) / (_MaxXUV - _MinXUV), (d.texcoord1.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half4 tempOutColor = SAMPLE_TEXTURE2D(_OutlineTex, sampler_OutlineTex, d.texcoord1); + tempOutColor *= _OutlineColor; + _OutlineColor = tempOutColor; + #endif + + result *= (1 - originalAlpha) * _OutlineAlpha; + + half4 outline = _OutlineColor * d.vertexColor.a; + outline.rgb *= _OutlineGlow; + outline.a = result; + #if ONLYOUTLINE_ON + col = outline; + #else + col = lerp(col, outline, result); + #endif + #endif + //------------------------------------------------------- + + //FADE_ON + #if FADE_ON + half2 tiledUvFade1 = TRANSFORM_TEX(d.texcoord0, _FadeTex); + half2 tiledUvFade2 = TRANSFORM_TEX(d.texcoord0, _FadeBurnTex); + #if ATLAS_ON + tiledUvFade1 = half2((tiledUvFade1.x - _MinXUV) / (_MaxXUV - _MinXUV), (tiledUvFade1.y - _MinYUV) / (_MaxYUV - _MinYUV)); + tiledUvFade2 = half2((tiledUvFade2.x - _MinXUV) / (_MaxXUV - _MinXUV), (tiledUvFade2.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half fadeTemp = SAMPLE_TEXTURE2D(_FadeTex, sampler_FadeTex, tiledUvFade1).r; + half fade = smoothstep(_FadeAmount, _FadeAmount + _FadeBurnTransition, fadeTemp); + half fadeBurn = saturate(smoothstep(_FadeAmount - _FadeBurnWidth, _FadeAmount - _FadeBurnWidth + 0.1, fadeTemp) * _FadeAmount); + col.a *= fade; + _FadeBurnColor.rgb *= _FadeBurnGlow; + col += fadeBurn * SAMPLE_TEXTURE2D(_FadeBurnTex, sampler_FadeBurnTex, tiledUvFade2) * _FadeBurnColor * originalAlpha * (1 - col.a); + #endif + //------------------------------------------------------- + + //SHADOW_ON + #if SHADOW_ON + half shadowA = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(_ShadowX, _ShadowY)).a; + half preMultShadowMask = 1 - (saturate(shadowA - col.a) * (1 - col.a)); + col.rgb *= 1 - ((shadowA - col.a) * (1 - col.a)); + col.rgb += (_ShadowColor * shadowA) * (1 - col.a); + col.a = max(shadowA * _ShadowAlpha * d.vertexColor.a, col.a); + #endif + + //------------------------------------------------------- + + //GLOW_ON + #if GLOW_ON + half4 emission; + #if GLOWTEX_ON + emission = SAMPLE_TEXTURE2D(_GlowTex, sampler_GlowTex, d.texcoord0); + #else + emission = col; + #endif + + col.rgb *= _GlowGlobal; + emission.rgb *= emission.a * col.a * _Glow * _GlowColor; + col.rgb += emission.rgb; + #endif + //------------------------------------------------------- + + //COLORRAMP_ON && COLORRAMPOUTLINE_ON + #if COLORRAMP_ON && COLORRAMPOUTLINE_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + luminance = saturate(luminance + _ColorRampLuminosity); + #if GRADIENTCOLORRAMP_ON + col.rgb = lerp(col.rgb, SAMPLE_TEXTURE2D(_ColorRampTexGradient, sampler_ColorRampTexGradient, half2(luminance, 0)).rgb, _ColorRampBlend); + #else + col.rgb = lerp(col.rgb, SAMPLE_TEXTURE2D(_ColorRampTex, sampler_ColorRampTex, half2(luminance, 0)).rgb, _ColorRampBlend); + #endif + #endif + //--------------- + + //GREYSCALE_ON && GREYSCALEOUTLINE_ON + #if GREYSCALE_ON && GREYSCALEOUTLINE_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + luminance = saturate(luminance + _GreyscaleLuminosity); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _GreyscaleTintColor, _GreyscaleBlend); + #endif + + //----------------------------------- + + //POSTERIZE_ON && POSTERIZEOUTLINE_ON + #if POSTERIZE_ON && POSTERIZEOUTLINE_ON + col.rgb = pow(col.rgb, _PosterizeGamma) * _PosterizeNumColors; + col.rgb = floor(col.rgb) / _PosterizeNumColors; + col.rgb = pow(col.rgb, 1.0 / _PosterizeGamma); + #endif + + //----------------------------------- + + //SHINE_ON + #if SHINE_ON + half2 uvShine = uvRect; + half cosAngle = cos(_ShineRotate); + half sinAngle = sin(_ShineRotate); + half2x2 rot = half2x2(cosAngle, -sinAngle, sinAngle, cosAngle); + uvShine -= half2(0.5, 0.5); + uvShine = mul(rot, uvShine); + uvShine += half2(0.5, 0.5); + half shineMask = SAMPLE_TEXTURE2D(_ShineMask, sampler_ShineMask, d.texcoord0.xy).a; + half currentDistanceProjection = (uvShine.x + uvShine.y) / 2; + half whitePower = 1 - (abs(currentDistanceProjection - _ShineLocation) / _ShineWidth); + col.rgb += col.a * whitePower * _ShineGlow * max(sign(currentDistanceProjection - (_ShineLocation - _ShineWidth)), 0.0) + * max(sign((_ShineLocation + _ShineWidth) - currentDistanceProjection), 0.0) * _ShineColor * shineMask; + #endif + + //----------------------------------- + + //HOLOGRAM_ON + #if HOLOGRAM_ON + half totalHologram = _HologramStripesAmount + _HologramUnmodAmount; + half hologramYCoord = ((uvRect.y + (((_Time.x + randomSeed) % 1) * _HologramStripesSpeed)) % totalHologram) / totalHologram; + hologramYCoord = abs(hologramYCoord); + half alpha = RemapFloat(saturate(hologramYCoord - (_HologramUnmodAmount/totalHologram)), 0.0, 1.0, _HologramMinAlpha, saturate(_HologramMaxAlpha)); + half hologramMask = max(sign((_HologramUnmodAmount/totalHologram) - hologramYCoord), 0.0); + half4 hologramResult = col; + hologramResult.a *= lerp(alpha, 1, hologramMask); + hologramResult.rgb *= max(1, _HologramMaxAlpha * max(sign(hologramYCoord - (_HologramUnmodAmount/totalHologram)), 0.0)); + hologramMask = 1 - step(0.01,hologramMask); + hologramResult.rgb += hologramMask * _HologramStripeColor * col.a; + col = lerp(col, hologramResult, _HologramBlend); + #endif + + //----------------------------------- + + //FLICKER_ON + #if FLICKER_ON + col.a *= saturate(col.a * step(frac(0.05 + (_Time.w + randomSeed) * _FlickerFreq), 1 - _FlickerPercent) + _FlickerAlpha); + #endif + //----------------------------------- + + //ALPHACUTOFF_ON + + //ALPHAROUND_ON + + //ALPHAOUTLINE_ON + #if ALPHAOUTLINE_ON + half alphaOutlineRes = pow(1 - col.a, max(_AlphaOutlinePower, 0.0001)) * step(_AlphaOutlineMinAlpha, col.a) * _AlphaOutlineBlend; + col.rgb = lerp(col.rgb, _AlphaOutlineColor.rgb * _AlphaOutlineGlow, alphaOutlineRes); + col.a = lerp(col.a, 1, alphaOutlineRes > 1); + #endif + //------------------------------------------------------- + + //FOG_ON + + //------------------ + + col *= _Color; + o.Albedo = col; + col.a *= _Alpha; + clip(col.a - _AlphaCutoffValue - 0.01); + o.Alpha = _Color.a; + } + + + + + + void ChainSurfaceFunction(inout Surface l, inout ShaderData d) + { + Ext_SurfaceFunction0(l, d); + // Ext_SurfaceFunction1(l, d); + // Ext_SurfaceFunction2(l, d); + // Ext_SurfaceFunction3(l, d); + // Ext_SurfaceFunction4(l, d); + // Ext_SurfaceFunction5(l, d); + // Ext_SurfaceFunction6(l, d); + // Ext_SurfaceFunction7(l, d); + // Ext_SurfaceFunction8(l, d); + // Ext_SurfaceFunction9(l, d); + // Ext_SurfaceFunction10(l, d); + // Ext_SurfaceFunction11(l, d); + // Ext_SurfaceFunction12(l, d); + // Ext_SurfaceFunction13(l, d); + // Ext_SurfaceFunction14(l, d); + // Ext_SurfaceFunction15(l, d); + // Ext_SurfaceFunction16(l, d); + // Ext_SurfaceFunction17(l, d); + // Ext_SurfaceFunction18(l, d); + // Ext_SurfaceFunction19(l, d); + // Ext_SurfaceFunction20(l, d); + // Ext_SurfaceFunction21(l, d); + // Ext_SurfaceFunction22(l, d); + // Ext_SurfaceFunction23(l, d); + // Ext_SurfaceFunction24(l, d); + // Ext_SurfaceFunction25(l, d); + // Ext_SurfaceFunction26(l, d); + // Ext_SurfaceFunction27(l, d); + // Ext_SurfaceFunction28(l, d); + // Ext_SurfaceFunction29(l, d); + } + +#if !_DECALSHADER + + void ChainModifyVertex(inout VertexData v, inout VertexToPixel v2p, float4 time) + { + ExtraV2F d; + + ZERO_INITIALIZE(ExtraV2F, d); + ZERO_INITIALIZE(Blackboard, d.blackboard); + // due to motion vectors in HDRP, we need to use the last + // time in certain spots. So if you are going to use _Time to adjust vertices, + // you need to use this time or motion vectors will break. + d.time = time; + + Ext_ModifyVertex0(v, d); + // Ext_ModifyVertex1(v, d); + // Ext_ModifyVertex2(v, d); + // Ext_ModifyVertex3(v, d); + // Ext_ModifyVertex4(v, d); + // Ext_ModifyVertex5(v, d); + // Ext_ModifyVertex6(v, d); + // Ext_ModifyVertex7(v, d); + // Ext_ModifyVertex8(v, d); + // Ext_ModifyVertex9(v, d); + // Ext_ModifyVertex10(v, d); + // Ext_ModifyVertex11(v, d); + // Ext_ModifyVertex12(v, d); + // Ext_ModifyVertex13(v, d); + // Ext_ModifyVertex14(v, d); + // Ext_ModifyVertex15(v, d); + // Ext_ModifyVertex16(v, d); + // Ext_ModifyVertex17(v, d); + // Ext_ModifyVertex18(v, d); + // Ext_ModifyVertex19(v, d); + // Ext_ModifyVertex20(v, d); + // Ext_ModifyVertex21(v, d); + // Ext_ModifyVertex22(v, d); + // Ext_ModifyVertex23(v, d); + // Ext_ModifyVertex24(v, d); + // Ext_ModifyVertex25(v, d); + // Ext_ModifyVertex26(v, d); + // Ext_ModifyVertex27(v, d); + // Ext_ModifyVertex28(v, d); + // Ext_ModifyVertex29(v, d); + + + // #if %EXTRAV2F0REQUIREKEY% + // v2p.extraV2F0 = d.extraV2F0; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // v2p.extraV2F1 = d.extraV2F1; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // v2p.extraV2F2 = d.extraV2F2; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // v2p.extraV2F3 = d.extraV2F3; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // v2p.extraV2F4 = d.extraV2F4; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // v2p.extraV2F5 = d.extraV2F5; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // v2p.extraV2F6 = d.extraV2F6; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // v2p.extraV2F7 = d.extraV2F7; + // #endif + } + + void ChainModifyTessellatedVertex(inout VertexData v, inout VertexToPixel v2p) + { + ExtraV2F d; + ZERO_INITIALIZE(ExtraV2F, d); + ZERO_INITIALIZE(Blackboard, d.blackboard); + + // #if %EXTRAV2F0REQUIREKEY% + // d.extraV2F0 = v2p.extraV2F0; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // d.extraV2F1 = v2p.extraV2F1; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // d.extraV2F2 = v2p.extraV2F2; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // d.extraV2F3 = v2p.extraV2F3; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // d.extraV2F4 = v2p.extraV2F4; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // d.extraV2F5 = v2p.extraV2F5; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // d.extraV2F6 = v2p.extraV2F6; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // d.extraV2F7 = v2p.extraV2F7; + // #endif + + + // Ext_ModifyTessellatedVertex0(v, d); + // Ext_ModifyTessellatedVertex1(v, d); + // Ext_ModifyTessellatedVertex2(v, d); + // Ext_ModifyTessellatedVertex3(v, d); + // Ext_ModifyTessellatedVertex4(v, d); + // Ext_ModifyTessellatedVertex5(v, d); + // Ext_ModifyTessellatedVertex6(v, d); + // Ext_ModifyTessellatedVertex7(v, d); + // Ext_ModifyTessellatedVertex8(v, d); + // Ext_ModifyTessellatedVertex9(v, d); + // Ext_ModifyTessellatedVertex10(v, d); + // Ext_ModifyTessellatedVertex11(v, d); + // Ext_ModifyTessellatedVertex12(v, d); + // Ext_ModifyTessellatedVertex13(v, d); + // Ext_ModifyTessellatedVertex14(v, d); + // Ext_ModifyTessellatedVertex15(v, d); + // Ext_ModifyTessellatedVertex16(v, d); + // Ext_ModifyTessellatedVertex17(v, d); + // Ext_ModifyTessellatedVertex18(v, d); + // Ext_ModifyTessellatedVertex19(v, d); + // Ext_ModifyTessellatedVertex20(v, d); + // Ext_ModifyTessellatedVertex21(v, d); + // Ext_ModifyTessellatedVertex22(v, d); + // Ext_ModifyTessellatedVertex23(v, d); + // Ext_ModifyTessellatedVertex24(v, d); + // Ext_ModifyTessellatedVertex25(v, d); + // Ext_ModifyTessellatedVertex26(v, d); + // Ext_ModifyTessellatedVertex27(v, d); + // Ext_ModifyTessellatedVertex28(v, d); + // Ext_ModifyTessellatedVertex29(v, d); + + // #if %EXTRAV2F0REQUIREKEY% + // v2p.extraV2F0 = d.extraV2F0; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // v2p.extraV2F1 = d.extraV2F1; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // v2p.extraV2F2 = d.extraV2F2; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // v2p.extraV2F3 = d.extraV2F3; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // v2p.extraV2F4 = d.extraV2F4; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // v2p.extraV2F5 = d.extraV2F5; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // v2p.extraV2F6 = d.extraV2F6; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // v2p.extraV2F7 = d.extraV2F7; + // #endif + } + + void ChainFinalColorForward(inout Surface l, inout ShaderData d, inout half4 color) + { + // Ext_FinalColorForward0(l, d, color); + // Ext_FinalColorForward1(l, d, color); + // Ext_FinalColorForward2(l, d, color); + // Ext_FinalColorForward3(l, d, color); + // Ext_FinalColorForward4(l, d, color); + // Ext_FinalColorForward5(l, d, color); + // Ext_FinalColorForward6(l, d, color); + // Ext_FinalColorForward7(l, d, color); + // Ext_FinalColorForward8(l, d, color); + // Ext_FinalColorForward9(l, d, color); + // Ext_FinalColorForward10(l, d, color); + // Ext_FinalColorForward11(l, d, color); + // Ext_FinalColorForward12(l, d, color); + // Ext_FinalColorForward13(l, d, color); + // Ext_FinalColorForward14(l, d, color); + // Ext_FinalColorForward15(l, d, color); + // Ext_FinalColorForward16(l, d, color); + // Ext_FinalColorForward17(l, d, color); + // Ext_FinalColorForward18(l, d, color); + // Ext_FinalColorForward19(l, d, color); + // Ext_FinalColorForward20(l, d, color); + // Ext_FinalColorForward21(l, d, color); + // Ext_FinalColorForward22(l, d, color); + // Ext_FinalColorForward23(l, d, color); + // Ext_FinalColorForward24(l, d, color); + // Ext_FinalColorForward25(l, d, color); + // Ext_FinalColorForward26(l, d, color); + // Ext_FinalColorForward27(l, d, color); + // Ext_FinalColorForward28(l, d, color); + // Ext_FinalColorForward29(l, d, color); + } + + void ChainFinalGBufferStandard(inout Surface s, inout ShaderData d, inout half4 GBuffer0, inout half4 GBuffer1, inout half4 GBuffer2, inout half4 outEmission, inout half4 outShadowMask) + { + // Ext_FinalGBufferStandard0(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard1(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard2(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard3(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard4(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard5(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard6(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard7(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard8(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard9(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard10(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard11(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard12(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard13(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard14(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard15(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard16(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard17(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard18(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard19(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard20(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard21(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard22(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard23(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard24(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard25(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard26(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard27(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard28(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard29(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + } +#endif + + + + + +#if _DECALSHADER + + ShaderData CreateShaderData(SurfaceDescriptionInputs IN) + { + ShaderData d = (ShaderData)0; + d.TBNMatrix = float3x3(IN.WorldSpaceTangent, IN.WorldSpaceBiTangent, IN.WorldSpaceNormal); + d.worldSpaceNormal = IN.WorldSpaceNormal; + d.worldSpaceTangent = IN.WorldSpaceTangent; + + d.worldSpacePosition = IN.WorldSpacePosition; + d.texcoord0 = IN.uv0.xyxy; + d.screenPos = IN.ScreenPosition; + + d.worldSpaceViewDir = normalize(_WorldSpaceCameraPos - d.worldSpacePosition); + + d.tangentSpaceViewDir = mul(d.TBNMatrix, d.worldSpaceViewDir); + + // these rarely get used, so we back transform them. Usually will be stripped. + #if _HDRP + // d.localSpacePosition = mul(GetWorldToObjectMatrix(), float4(GetCameraRelativePositionWS(d.worldSpacePosition), 1)).xyz; + #else + // d.localSpacePosition = mul(GetWorldToObjectMatrix(), float4(d.worldSpacePosition, 1)).xyz; + #endif + // d.localSpaceNormal = normalize(mul((float3x3)GetWorldToObjectMatrix(), d.worldSpaceNormal)); + // d.localSpaceTangent = normalize(mul((float3x3)GetWorldToObjectMatrix(), d.worldSpaceTangent.xyz)); + + // #if %SCREENPOSREQUIREKEY% + // d.screenUV = (IN.ScreenPosition.xy / max(0.01, IN.ScreenPosition.w)); + // #endif + + return d; + } +#else + + ShaderData CreateShaderData(VertexToPixel i + #if NEED_FACING + , bool facing + #endif + ) + { + ShaderData d = (ShaderData)0; + d.clipPos = i.pos; + d.worldSpacePosition = i.worldPos; + + d.worldSpaceNormal = normalize(i.worldNormal); + d.worldSpaceTangent.xyz = normalize(i.worldTangent.xyz); + + d.tangentSign = i.worldTangent.w * unity_WorldTransformParams.w; + float3 bitangent = cross(d.worldSpaceTangent.xyz, d.worldSpaceNormal) * d.tangentSign; + + d.TBNMatrix = float3x3(d.worldSpaceTangent, -bitangent, d.worldSpaceNormal); + d.worldSpaceViewDir = normalize(_WorldSpaceCameraPos - i.worldPos); + + d.tangentSpaceViewDir = mul(d.TBNMatrix, d.worldSpaceViewDir); + d.texcoord0 = i.texcoord0; + d.texcoord1 = i.texcoord1; + d.texcoord2 = i.texcoord2; + + // #if %TEXCOORD3REQUIREKEY% + d.texcoord3 = i.texcoord3; + // #endif + + // d.isFrontFace = facing; + // #if %VERTEXCOLORREQUIREKEY% + d.vertexColor = i.vertexColor; + // #endif + + // these rarely get used, so we back transform them. Usually will be stripped. + #if _HDRP + // d.localSpacePosition = mul(GetWorldToObjectMatrix(), float4(GetCameraRelativePositionWS(i.worldPos), 1)).xyz; + #else + // d.localSpacePosition = mul(GetWorldToObjectMatrix(), float4(i.worldPos, 1)).xyz; + #endif + // d.localSpaceNormal = normalize(mul((float3x3)GetWorldToObjectMatrix(), i.worldNormal)); + // d.localSpaceTangent = normalize(mul((float3x3)GetWorldToObjectMatrix(), i.worldTangent.xyz)); + + // #if %SCREENPOSREQUIREKEY% + // d.screenPos = i.screenPos; + // d.screenUV = (i.screenPos.xy / i.screenPos.w); + // #endif + + + // #if %EXTRAV2F0REQUIREKEY% + // d.extraV2F0 = i.extraV2F0; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // d.extraV2F1 = i.extraV2F1; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // d.extraV2F2 = i.extraV2F2; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // d.extraV2F3 = i.extraV2F3; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // d.extraV2F4 = i.extraV2F4; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // d.extraV2F5 = i.extraV2F5; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // d.extraV2F6 = i.extraV2F6; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // d.extraV2F7 = i.extraV2F7; + // #endif + + return d; + } + +#endif + + + #if defined(_PASSSHADOW) + float3 _LightDirection; + float3 _LightPosition; + #endif + + // vertex shader + VertexToPixel Vert (VertexData v) + { + + VertexToPixel o = (VertexToPixel)0; + + UNITY_SETUP_INSTANCE_ID(v); + UNITY_TRANSFER_INSTANCE_ID(v, o); + UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o); + + +#if !_TESSELLATION_ON + ChainModifyVertex(v, o, _Time); +#endif + + o.texcoord0 = v.texcoord0; + o.texcoord1 = v.texcoord1; + o.texcoord2 = v.texcoord2; + + // #if %TEXCOORD3REQUIREKEY% + o.texcoord3 = v.texcoord3; + // #endif + + // #if %VERTEXCOLORREQUIREKEY% + o.vertexColor = v.vertexColor; + // #endif + + VertexPositionInputs vertexInput = GetVertexPositionInputs(v.vertex.xyz); + o.worldPos = TransformObjectToWorld(v.vertex.xyz); + o.worldNormal = TransformObjectToWorldNormal(v.normal); + o.worldTangent = float4(TransformObjectToWorldDir(v.tangent.xyz), v.tangent.w); + + // For some very odd reason, in 2021.2, we can't use Unity's defines, but have to use our own.. + #if _PASSSHADOW + #if _CASTING_PUNCTUAL_LIGHT_SHADOW + float3 lightDirectionWS = normalize(_LightPosition - o.worldPos); + #else + float3 lightDirectionWS = _LightDirection; + #endif + // Define shadow pass specific clip position for Universal + o.pos = TransformWorldToHClip(ApplyShadowBias(o.worldPos, o.worldNormal, lightDirectionWS)); + #if UNITY_REVERSED_Z + o.pos.z = min(o.pos.z, UNITY_NEAR_CLIP_VALUE); + #else + o.pos.z = max(o.pos.z, UNITY_NEAR_CLIP_VALUE); + #endif + #elif _PASSMETA + o.pos = MetaVertexPosition(float4(v.vertex.xyz, 0), v.texcoord1.xy, v.texcoord2.xy, unity_LightmapST, unity_DynamicLightmapST); + #else + o.pos = TransformWorldToHClip(o.worldPos); + #endif + + // #if %SCREENPOSREQUIREKEY% + // o.screenPos = ComputeScreenPos(o.pos, _ProjectionParams.x); + // #endif + + #if _PASSFORWARD || _PASSGBUFFER + float2 uv1 = v.texcoord1.xy; + OUTPUT_LIGHTMAP_UV(uv1, unity_LightmapST, o.lightmapUV); + o.texcoord1.xy = uv1; + OUTPUT_SH(o.worldNormal, o.sh); + #if defined(DYNAMICLIGHTMAP_ON) + o.dynamicLightmapUV.xy = v.texcoord2.xy * unity_DynamicLightmapST.xy + unity_DynamicLightmapST.zw; + #endif + #endif + + #ifdef VARYINGS_NEED_FOG_AND_VERTEX_LIGHT + half fogFactor = 0; + #if defined(_FOG_FRAGMENT) + fogFactor = ComputeFogFactor(o.pos.z); + #endif + #if _BAKEDLIT + o.fogFactorAndVertexLight = half4(fogFactor, 0, 0, 0); + #else + half3 vertexLight = VertexLighting(o.worldPos, o.worldNormal); + o.fogFactorAndVertexLight = half4(fogFactor, vertexLight); + #endif + #endif + + #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR) + o.shadowCoord = GetShadowCoord(vertexInput); + #endif + + return o; + } + + + + + #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/UnityGBuffer.hlsl" + + // fragment shader + FragmentOutput Frag (VertexToPixel IN + #ifdef _DEPTHOFFSET_ON + , out float outputDepth : SV_Depth + #endif + #if NEED_FACING + , bool facing : SV_IsFrontFace + #endif + ) + { + UNITY_SETUP_INSTANCE_ID(IN); + UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX(IN); + + #if defined(LOD_FADE_CROSSFADE) + LODFadeCrossFade(IN.pos); + #endif + + ShaderData d = CreateShaderData(IN + #if NEED_FACING + , facing + #endif + ); + Surface l = (Surface)0; + + #ifdef _DEPTHOFFSET_ON + l.outputDepth = outputDepth; + #endif + + l.Albedo = half3(0.5, 0.5, 0.5); + l.Normal = float3(0,0,1); + l.Occlusion = 1; + l.Alpha = 1; + + ChainSurfaceFunction(l, d); + + #ifdef _DEPTHOFFSET_ON + outputDepth = l.outputDepth; + #endif + + #if _USESPECULAR || _SIMPLELIT + float3 specular = l.Specular; + float metallic = 0; + #else + float3 specular = 0; + float metallic = l.Metallic; + #endif + + InputData inputData = (InputData)0; + + inputData.positionWS = IN.worldPos; + #if _WORLDSPACENORMAL + inputData.normalWS = l.Normal; + #else + inputData.normalWS = normalize(TangentToWorldSpace(d, l.Normal)); + #endif + + inputData.viewDirectionWS = SafeNormalize(d.worldSpaceViewDir); + + + #if defined(MAIN_LIGHT_CALCULATE_SHADOWS) + inputData.shadowCoord = TransformWorldToShadowCoord(inputData.positionWS); + #else + inputData.shadowCoord = float4(0, 0, 0, 0); + #endif + + //inputData.fogCoord = IN.fogFactorAndVertexLight.x; + InitializeInputDataFog(float4(IN.worldPos, 1.0), IN.fogFactorAndVertexLight.x); + inputData.vertexLighting = IN.fogFactorAndVertexLight.yzw; + + + #if defined(_OVERRIDE_BAKEDGI) + inputData.bakedGI = l.DiffuseGI; + l.Emission += l.SpecularGI; + #else + #if defined(DYNAMICLIGHTMAP_ON) + inputData.bakedGI = SAMPLE_GI(IN.lightmapUV, IN.dynamicLightmapUV.xy, IN.sh, inputData.normalWS); + #else + inputData.bakedGI = SAMPLE_GI(IN.lightmapUV, IN.sh, inputData.normalWS); + #endif + #endif + + inputData.normalizedScreenSpaceUV = GetNormalizedScreenSpaceUV(IN.pos); + inputData.shadowMask = SAMPLE_SHADOWMASK(IN.lightmapUV); + + #if defined(DEBUG_DISPLAY) + #if defined(DYNAMICLIGHTMAP_ON) + inputData.dynamicLightmapUV = IN.dynamicLightmapUV.xy; + #endif + #if defined(LIGHTMAP_ON) + inputData.staticLightmapUV = IN.lightmapUV; + #else + inputData.vertexSH = IN.sh; + #endif + #endif + + #ifdef _DBUFFER + ApplyDecal(IN.pos, + l.Albedo, + specular, + inputData.normalWS, + metallic, + l.Occlusion, + l.Smoothness); + #endif + + BRDFData brdfData; + InitializeBRDFData(l.Albedo, metallic, specular, l.Smoothness, l.Alpha, brdfData); + Light mainLight = GetMainLight(inputData.shadowCoord, inputData.positionWS, inputData.shadowMask); + MixRealtimeAndBakedGI(mainLight, inputData.normalWS, inputData.bakedGI, inputData.shadowMask); + half3 color = GlobalIllumination(brdfData, inputData.bakedGI, l.Occlusion, inputData.positionWS, inputData.normalWS, inputData.viewDirectionWS); + + return BRDFDataToGbuffer(brdfData, inputData, l.Smoothness, l.Emission + color, l.Occlusion); + } + + ENDHLSL + + } + + + + Pass + { + Name "ShadowCaster" + Tags + { + "LightMode" = "ShadowCaster" + } + + // Render State + Blend One Zero, One Zero + Cull Back + ZTest LEqual + ZWrite On + // ColorMask: + + Tags { "RenderType" = "Opaque" "Queue" = "Geometry" "PreviewType" = "Plane" } + Cull [_CullingOption] + ZWrite [_ZWrite] + ZTest [_ZTestMode] + + + HLSLPROGRAM + + #pragma vertex Vert + #pragma fragment Frag + + #pragma target 3.0 + + #pragma prefer_hlslcc gles + #pragma exclude_renderers d3d11_9x + #pragma multi_compile_instancing + + #pragma multi_compile_vertex _ _CASTING_PUNCTUAL_LIGHT_SHADOW + #pragma multi_compile_fragment _ LOD_FADE_CROSSFADE + + + #define _NORMAL_DROPOFF_TS 1 + #define ATTRIBUTES_NEED_NORMAL + #define ATTRIBUTES_NEED_TANGENT + #define _PASSSHADOW 1 + + + #pragma shader_feature_local GLOW_ON + #pragma shader_feature_local FADE_ON + #pragma shader_feature_local OUTBASE_ON + #pragma shader_feature_local ONLYOUTLINE_ON + #pragma shader_feature_local GRADIENT_ON + #pragma shader_feature_local GRADIENT2COL_ON + #pragma shader_feature_local RADIALGRADIENT_ON + #pragma shader_feature_local COLORSWAP_ON + #pragma shader_feature_local HSV_ON + #pragma shader_feature_local CHANGECOLOR_ON + #pragma shader_feature_local CHANGECOLOR2_ON + #pragma shader_feature_local CHANGECOLOR3_ON + #pragma shader_feature_local COLORRAMP_ON + #pragma shader_feature_local GRADIENTCOLORRAMP_ON + #pragma shader_feature_local HITEFFECT_ON + #pragma shader_feature_local NEGATIVE_ON + #pragma shader_feature_local PIXELATE_ON + #pragma shader_feature_local GREYSCALE_ON + #pragma shader_feature_local POSTERIZE_ON + #pragma shader_feature_local BLUR_ON + #pragma shader_feature_local MOTIONBLUR_ON + #pragma shader_feature_local GHOST_ON + #pragma shader_feature_local ALPHAOUTLINE_ON + #pragma shader_feature_local INNEROUTLINE_ON + #pragma shader_feature_local ONLYINNEROUTLINE_ON + #pragma shader_feature_local HOLOGRAM_ON + #pragma shader_feature_local CHROMABERR_ON + #pragma shader_feature_local GLITCH_ON + #pragma shader_feature_local FLICKER_ON + #pragma shader_feature_local SHADOW_ON + #pragma shader_feature_local SHINE_ON + #pragma shader_feature_local CONTRAST_ON + #pragma shader_feature_local OVERLAY_ON + #pragma shader_feature_local OVERLAYMULT_ON + #pragma shader_feature_local DOODLE_ON + #pragma shader_feature_local WIND_ON + #pragma shader_feature_local WAVEUV_ON + #pragma shader_feature_local ROUNDWAVEUV_ON + #pragma shader_feature_local RECTSIZE_ON + #pragma shader_feature_local OFFSETUV_ON + #pragma shader_feature_local CLIPPING_ON + #pragma shader_feature_local RADIALCLIPPING_ON + #pragma shader_feature_local TEXTURESCROLL_ON + #pragma shader_feature_local ZOOMUV_ON + #pragma shader_feature_local DISTORT_ON + #pragma shader_feature_local WARP_ON + #pragma shader_feature_local TWISTUV_ON + #pragma shader_feature_local ROTATEUV_ON + #pragma shader_feature_local POLARUV_ON + #pragma shader_feature_local FISHEYE_ON + #pragma shader_feature_local PINCH_ON + #pragma shader_feature_local SHAKEUV_ON + + #pragma shader_feature_local GLOWTEX_ON + #pragma shader_feature_local OUTTEX_ON + #pragma shader_feature_local OUTDIST_ON + #pragma shader_feature_local OUTBASE8DIR_ON + #pragma shader_feature_local OUTBASEPIXELPERF_ON + #pragma shader_feature_local COLORRAMPOUTLINE_ON + #pragma shader_feature_local GREYSCALEOUTLINE_ON + #pragma shader_feature_local POSTERIZEOUTLINE_ON + #pragma shader_feature_local BLURISHD_ON + #pragma shader_feature_local MANUALWIND_ON + #pragma shader_feature_local ATLAS_ON + #pragma shader_feature_local PREMULTIPLYALPHA_ON + + #pragma shader_feature BILBOARD_ON + #pragma shader_feature BILBOARDY_ON + + #pragma shader_feature NORMALMAP_ON + + + #define _URP 1 +#define _USINGTEXCOORD1 1 +#define _USINGTEXCOORD2 1 + + + #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" + #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/LODCrossFade.hlsl" + + #undef WorldNormalVector + #define WorldNormalVector(data, normal) mul(normal, data.TBNMatrix) + + #define UnityObjectToWorldNormal(normal) mul(GetObjectToWorldMatrix(), normal) + + #define _WorldSpaceLightPos0 _MainLightPosition + + #define UNITY_DECLARE_TEX2D(name) TEXTURE2D(name); SAMPLER(sampler##name); + #define UNITY_DECLARE_TEX2D_NOSAMPLER(name) TEXTURE2D(name); + #define UNITY_DECLARE_TEX2DARRAY(name) TEXTURE2D_ARRAY(name); SAMPLER(sampler##name); + #define UNITY_DECLARE_TEX2DARRAY_NOSAMPLER(name) TEXTURE2D_ARRAY(name); + + #define UNITY_SAMPLE_TEX2DARRAY(tex,coord) SAMPLE_TEXTURE2D_ARRAY(tex, sampler##tex, coord.xy, coord.z) + #define UNITY_SAMPLE_TEX2DARRAY_LOD(tex,coord,lod) SAMPLE_TEXTURE2D_ARRAY_LOD(tex, sampler##tex, coord.xy, coord.z, lod) + #define UNITY_SAMPLE_TEX2D(tex, coord) SAMPLE_TEXTURE2D(tex, sampler##tex, coord) + #define UNITY_SAMPLE_TEX2D_SAMPLER(tex, samp, coord) SAMPLE_TEXTURE2D(tex, sampler##samp, coord) + + #define UNITY_SAMPLE_TEX2D_LOD(tex,coord, lod) SAMPLE_TEXTURE2D_LOD(tex, sampler_##tex, coord, lod) + #define UNITY_SAMPLE_TEX2D_SAMPLER_LOD(tex,samplertex,coord, lod) SAMPLE_TEXTURE2D_LOD (tex, sampler##samplertex,coord, lod) + + #if defined(UNITY_COMPILER_HLSL) + #define UNITY_INITIALIZE_OUTPUT(type,name) name = (type)0; + #else + #define UNITY_INITIALIZE_OUTPUT(type,name) + #endif + + #define sampler2D_float sampler2D + #define sampler2D_half sampler2D + + + + // data across stages, stripped like the above. + struct VertexToPixel + { + float4 pos : SV_POSITION; + float3 worldPos : TEXCOORD0; + float3 worldNormal : TEXCOORD1; + float4 worldTangent : TEXCOORD2; + float4 texcoord0 : TEXCOORD3; + float4 texcoord1 : TEXCOORD4; + float4 texcoord2 : TEXCOORD5; + + // #if %TEXCOORD3REQUIREKEY% + float4 texcoord3 : TEXCOORD6; + // #endif + + // #if %SCREENPOSREQUIREKEY% + // float4 screenPos : TEXCOORD7; + // #endif + + // #if %VERTEXCOLORREQUIREKEY% + half4 vertexColor : COLOR; + // #endif + + #if defined(LIGHTMAP_ON) + float2 lightmapUV : TEXCOORD8; + #endif + #if defined(DYNAMICLIGHTMAP_ON) + float2 dynamicLightmapUV : TEXCOORD9; + #endif + #if !defined(LIGHTMAP_ON) + float3 sh : TEXCOORD10; + #endif + + #if defined(VARYINGS_NEED_FOG_AND_VERTEX_LIGHT) + float4 fogFactorAndVertexLight : TEXCOORD11; + #endif + + #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR) + float4 shadowCoord : TEXCOORD12; + #endif + + // #if %EXTRAV2F0REQUIREKEY% + // float4 extraV2F0 : TEXCOORD13; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // float4 extraV2F1 : TEXCOORD14; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // float4 extraV2F2 : TEXCOORD15; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // float4 extraV2F3 : TEXCOORD16; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // float4 extraV2F4 : TEXCOORD17; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // float4 extraV2F5 : TEXCOORD18; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // float4 extraV2F6 : TEXCOORD19; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // float4 extraV2F7 : TEXCOORD20; + // #endif + + #if UNITY_ANY_INSTANCING_ENABLED + uint instanceID : CUSTOM_INSTANCE_ID; + #endif + #if (defined(UNITY_STEREO_MULTIVIEW_ENABLED)) || (defined(UNITY_STEREO_INSTANCING_ENABLED) && (defined(SHADER_API_GLES3) || defined(SHADER_API_GLCORE))) + uint stereoTargetEyeIndexAsBlendIdx0 : BLENDINDICES0; + #endif + #if (defined(UNITY_STEREO_INSTANCING_ENABLED)) + uint stereoTargetEyeIndexAsRTArrayIdx : SV_RenderTargetArrayIndex; + #endif + #if defined(SHADER_STAGE_FRAGMENT) && defined(VARYINGS_NEED_CULLFACE) + FRONT_FACE_TYPE cullFace : FRONT_FACE_SEMANTIC; + #endif + + + }; + + + + + // data describing the user output of a pixel + struct Surface + { + half3 Albedo; + half Height; + half3 Normal; + half Smoothness; + half3 Emission; + half Metallic; + half3 Specular; + half Occlusion; + half SpecularPower; // for simple lighting + half Alpha; + float outputDepth; // if written, SV_Depth semantic is used. ShaderData.clipPos.z is unused value + // HDRP Only + half SpecularOcclusion; + half SubsurfaceMask; + half Thickness; + half CoatMask; + half CoatSmoothness; + half Anisotropy; + half IridescenceMask; + half IridescenceThickness; + int DiffusionProfileHash; + float SpecularAAThreshold; + float SpecularAAScreenSpaceVariance; + // requires _OVERRIDE_BAKEDGI to be defined, but is mapped in all pipelines + float3 DiffuseGI; + float3 BackDiffuseGI; + float3 SpecularGI; + float ior; + float3 transmittanceColor; + float atDistance; + float transmittanceMask; + // requires _OVERRIDE_SHADOWMASK to be defines + float4 ShadowMask; + + // for decals + float NormalAlpha; + float MAOSAlpha; + + + }; + + // Data the user declares in blackboard blocks + struct Blackboard + { + + float blackboardDummyData; + }; + + // data the user might need, this will grow to be big. But easy to strip + struct ShaderData + { + float4 clipPos; // SV_POSITION + float3 localSpacePosition; + float3 localSpaceNormal; + float3 localSpaceTangent; + + float3 worldSpacePosition; + float3 worldSpaceNormal; + float3 worldSpaceTangent; + float tangentSign; + + float3 worldSpaceViewDir; + float3 tangentSpaceViewDir; + + float4 texcoord0; + float4 texcoord1; + float4 texcoord2; + float4 texcoord3; + + float2 screenUV; + float4 screenPos; + + float4 vertexColor; + bool isFrontFace; + + float4 extraV2F0; + float4 extraV2F1; + float4 extraV2F2; + float4 extraV2F3; + float4 extraV2F4; + float4 extraV2F5; + float4 extraV2F6; + float4 extraV2F7; + + float3x3 TBNMatrix; + Blackboard blackboard; + }; + + struct VertexData + { + #if SHADER_TARGET > 30 + // uint vertexID : SV_VertexID; + #endif + float4 vertex : POSITION; + float3 normal : NORMAL; + float4 tangent : TANGENT; + float4 texcoord0 : TEXCOORD0; + + // optimize out mesh coords when not in use by user or lighting system + #if _URP && (_USINGTEXCOORD1 || _PASSMETA || _PASSFORWARD || _PASSGBUFFER) + float4 texcoord1 : TEXCOORD1; + #endif + + #if _URP && (_USINGTEXCOORD2 || _PASSMETA || ((_PASSFORWARD || _PASSGBUFFER) && defined(DYNAMICLIGHTMAP_ON))) + float4 texcoord2 : TEXCOORD2; + #endif + + #if _STANDARD && (_USINGTEXCOORD1 || (_PASSMETA || ((_PASSFORWARD || _PASSGBUFFER || _PASSFORWARDADD) && LIGHTMAP_ON))) + float4 texcoord1 : TEXCOORD1; + #endif + #if _STANDARD && (_USINGTEXCOORD2 || (_PASSMETA || ((_PASSFORWARD || _PASSGBUFFER) && DYNAMICLIGHTMAP_ON))) + float4 texcoord2 : TEXCOORD2; + #endif + + + #if _HDRP + float4 texcoord1 : TEXCOORD1; + float4 texcoord2 : TEXCOORD2; + #endif + + // #if %TEXCOORD3REQUIREKEY% + float4 texcoord3 : TEXCOORD3; + // #endif + + // #if %VERTEXCOLORREQUIREKEY% + float4 vertexColor : COLOR; + // #endif + + #if _PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR)) + float3 previousPositionOS : TEXCOORD4; // Contain previous transform position (in case of skinning for example) + #if defined (_ADD_PRECOMPUTED_VELOCITY) + float3 precomputedVelocity : TEXCOORD5; // Add Precomputed Velocity (Alembic computes velocities on runtime side). + #endif + #endif + + UNITY_VERTEX_INPUT_INSTANCE_ID + }; + + struct TessVertex + { + float4 vertex : INTERNALTESSPOS; + float3 normal : NORMAL; + float4 tangent : TANGENT; + float4 texcoord0 : TEXCOORD0; + float4 texcoord1 : TEXCOORD1; + float4 texcoord2 : TEXCOORD2; + + // #if %TEXCOORD3REQUIREKEY% + float4 texcoord3 : TEXCOORD3; + // #endif + + // #if %VERTEXCOLORREQUIREKEY% + float4 vertexColor : COLOR; + // #endif + + // #if %EXTRAV2F0REQUIREKEY% + // float4 extraV2F0 : TEXCOORD5; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // float4 extraV2F1 : TEXCOORD6; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // float4 extraV2F2 : TEXCOORD7; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // float4 extraV2F3 : TEXCOORD8; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // float4 extraV2F4 : TEXCOORD9; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // float4 extraV2F5 : TEXCOORD10; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // float4 extraV2F6 : TEXCOORD11; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // float4 extraV2F7 : TEXCOORD12; + // #endif + + #if _PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR)) + float3 previousPositionOS : TEXCOORD13; // Contain previous transform position (in case of skinning for example) + #if defined (_ADD_PRECOMPUTED_VELOCITY) + float3 precomputedVelocity : TEXCOORD14; + #endif + #endif + + UNITY_VERTEX_INPUT_INSTANCE_ID + UNITY_VERTEX_OUTPUT_STEREO + }; + + struct ExtraV2F + { + float4 extraV2F0; + float4 extraV2F1; + float4 extraV2F2; + float4 extraV2F3; + float4 extraV2F4; + float4 extraV2F5; + float4 extraV2F6; + float4 extraV2F7; + Blackboard blackboard; + float4 time; + }; + + + float3 WorldToTangentSpace(ShaderData d, float3 normal) + { + return mul(d.TBNMatrix, normal); + } + + float3 TangentToWorldSpace(ShaderData d, float3 normal) + { + return mul(normal, d.TBNMatrix); + } + + // in this case, make standard more like SRPs, because we can't fix + // unity_WorldToObject in HDRP, since it already does macro-fu there + + #if _STANDARD + float3 TransformWorldToObject(float3 p) { return mul(unity_WorldToObject, float4(p, 1)); }; + float3 TransformObjectToWorld(float3 p) { return mul(unity_ObjectToWorld, float4(p, 1)); }; + float4 TransformWorldToObject(float4 p) { return mul(unity_WorldToObject, p); }; + float4 TransformObjectToWorld(float4 p) { return mul(unity_ObjectToWorld, p); }; + float4x4 GetWorldToObjectMatrix() { return unity_WorldToObject; } + float4x4 GetObjectToWorldMatrix() { return unity_ObjectToWorld; } + #if (defined(SHADER_API_D3D11) || defined(SHADER_API_XBOXONE) || defined(UNITY_COMPILER_HLSLCC) || defined(SHADER_API_PSSL) || (SHADER_TARGET_SURFACE_ANALYSIS && !SHADER_TARGET_SURFACE_ANALYSIS_MOJOSHADER)) + #define UNITY_SAMPLE_TEX2D_LOD(tex,coord, lod) tex.SampleLevel (sampler##tex,coord, lod) + #define UNITY_SAMPLE_TEX2D_SAMPLER_LOD(tex,samplertex,coord, lod) tex.SampleLevel (sampler##samplertex,coord, lod) + #else + #define UNITY_SAMPLE_TEX2D_LOD(tex,coord,lod) tex2D (tex,coord,0,lod) + #define UNITY_SAMPLE_TEX2D_SAMPLER_LOD(tex,samplertex,coord,lod) tex2D (tex,coord,0,lod) + #endif + + #undef GetWorldToObjectMatrix() + + #define GetWorldToObjectMatrix() unity_WorldToObject + + + #endif + + float3 GetCameraWorldPosition() + { + #if _HDRP + return GetCameraRelativePositionWS(_WorldSpaceCameraPos); + #else + return _WorldSpaceCameraPos; + #endif + } + + #if _GRABPASSUSED + #if _STANDARD + TEXTURE2D(%GRABTEXTURE%); + SAMPLER(sampler_%GRABTEXTURE%); + #endif + + half3 GetSceneColor(float2 uv) + { + #if _STANDARD + return SAMPLE_TEXTURE2D(%GRABTEXTURE%, sampler_%GRABTEXTURE%, uv).rgb; + #else + return SHADERGRAPH_SAMPLE_SCENE_COLOR(uv); + #endif + } + #endif + + + + #if _STANDARD + UNITY_DECLARE_DEPTH_TEXTURE(_CameraDepthTexture); + float GetSceneDepth(float2 uv) { return SAMPLE_DEPTH_TEXTURE(_CameraDepthTexture, uv); } + float GetLinear01Depth(float2 uv) { return Linear01Depth(GetSceneDepth(uv)); } + float GetLinearEyeDepth(float2 uv) { return LinearEyeDepth(GetSceneDepth(uv)); } + #else + float GetSceneDepth(float2 uv) { return SHADERGRAPH_SAMPLE_SCENE_DEPTH(uv); } + float GetLinear01Depth(float2 uv) { return Linear01Depth(GetSceneDepth(uv), _ZBufferParams); } + float GetLinearEyeDepth(float2 uv) { return LinearEyeDepth(GetSceneDepth(uv), _ZBufferParams); } + #endif + + float3 GetWorldPositionFromDepthBuffer(float2 uv, float3 worldSpaceViewDir) + { + float eye = GetLinearEyeDepth(uv); + float3 camView = mul((float3x3)GetObjectToWorldMatrix(), transpose(mul(GetWorldToObjectMatrix(), UNITY_MATRIX_I_V)) [2].xyz); + + float dt = dot(worldSpaceViewDir, camView); + float3 div = worldSpaceViewDir/dt; + float3 wpos = (eye * div) + GetCameraWorldPosition(); + return wpos; + } + + #if _HDRP + float3 ObjectToWorldSpacePosition(float3 pos) + { + return GetAbsolutePositionWS(TransformObjectToWorld(pos)); + } + #else + float3 ObjectToWorldSpacePosition(float3 pos) + { + return TransformObjectToWorld(pos); + } + #endif + + #if _STANDARD + UNITY_DECLARE_SCREENSPACE_TEXTURE(_CameraDepthNormalsTexture); + float3 GetSceneNormal(float2 uv, float3 worldSpaceViewDir) + { + float4 depthNorms = UNITY_SAMPLE_SCREENSPACE_TEXTURE(_CameraDepthNormalsTexture, uv); + float3 norms = DecodeViewNormalStereo(depthNorms); + norms = mul((float3x3)GetWorldToViewMatrix(), norms) * 0.5 + 0.5; + return norms; + } + #elif _HDRP && !_DECALSHADER + + float3 GetSceneNormal(float2 uv, float3 worldSpaceViewDir) + { + NormalData nd; + DecodeFromNormalBuffer(_ScreenSize.xy * uv, nd); + return nd.normalWS; + } + #elif _URP + #if (SHADER_LIBRARY_VERSION_MAJOR >= 10) + #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/DeclareNormalsTexture.hlsl" + #endif + + float3 GetSceneNormal(float2 uv, float3 worldSpaceViewDir) + { + #if (SHADER_LIBRARY_VERSION_MAJOR >= 10) + return SampleSceneNormals(uv); + #else + float3 wpos = GetWorldPositionFromDepthBuffer(uv, worldSpaceViewDir); + return normalize(-cross(ddx(wpos), ddy(wpos))) * 0.5 + 0.5; + #endif + + } + #endif + + #if _HDRP + + half3 UnpackNormalmapRGorAG(half4 packednormal) + { + // This do the trick + packednormal.x *= packednormal.w; + + half3 normal; + normal.xy = packednormal.xy * 2 - 1; + normal.z = sqrt(1 - saturate(dot(normal.xy, normal.xy))); + return normal; + } + half3 UnpackNormal(half4 packednormal) + { + #if defined(UNITY_NO_DXT5nm) + return packednormal.xyz * 2 - 1; + #else + return UnpackNormalmapRGorAG(packednormal); + #endif + } + #endif + #if _HDRP || _URP + + half3 UnpackScaleNormal(half4 packednormal, half scale) + { + #ifndef UNITY_NO_DXT5nm + // Unpack normal as DXT5nm (1, y, 1, x) or BC5 (x, y, 0, 1) + // Note neutral texture like "bump" is (0, 0, 1, 1) to work with both plain RGB normal and DXT5nm/BC5 + packednormal.x *= packednormal.w; + #endif + half3 normal; + normal.xy = (packednormal.xy * 2 - 1) * scale; + normal.z = sqrt(1 - saturate(dot(normal.xy, normal.xy))); + return normal; + } + + #endif + + + void GetSun(out float3 lightDir, out float3 color) + { + lightDir = float3(0.5, 0.5, 0); + color = 1; + #if _HDRP + if (_DirectionalLightCount > 0) + { + DirectionalLightData light = _DirectionalLightDatas[0]; + lightDir = -light.forward.xyz; + color = light.color; + } + #elif _STANDARD + lightDir = normalize(_WorldSpaceLightPos0.xyz); + color = _LightColor0.rgb; + #elif _URP + Light light = GetMainLight(); + lightDir = light.direction; + color = light.color; + #endif + } + + + + CBUFFER_START(UnityPerMaterial) + + + half4 _Color; + half4 _MainTex_ST, _MainTex_TexelSize; + half _Alpha, _AlphaCutoffValue; + + #if ATLAS_ON + half _MinXUV, _MaxXUV, _MinYUV, _MaxYUV; + #endif + + #if GLOW_ON + half4 _GlowColor; + half _Glow, _GlowGlobal; + #endif + + #if HSV_ON + half _HsvShift, _HsvSaturation, _HsvBright; + #endif + + #if DISTORT_ON + half4 _DistortTex_ST; + half _DistortTexXSpeed, _DistortTexYSpeed, _DistortAmount; + #endif + + #if FADE_ON + half4 _FadeBurnColor, _FadeTex_ST, _FadeBurnTex_ST; + half _FadeAmount, _FadeBurnWidth, _FadeBurnTransition,_FadeBurnGlow; + #endif + + #if OUTBASE_ON + half4 _OutlineColor; + half _OutlineAlpha, _OutlineGlow, _OutlineWidth; + int _OutlinePixelWidth; + #endif + + #if OUTTEX_ON + half4 _OutlineTex_ST; + half _OutlineTexXSpeed, _OutlineTexYSpeed; + #endif + + #if OUTDIST_ON + half4 _OutlineDistortTex_ST; + half _OutlineDistortTexXSpeed, _OutlineDistortTexYSpeed, _OutlineDistortAmount; + #endif + + #if ALPHAOUTLINE_ON + half _AlphaOutlineGlow, _AlphaOutlinePower, _AlphaOutlineMinAlpha, _AlphaOutlineBlend; + half4 _AlphaOutlineColor; + #endif + + #if INNEROUTLINE_ON + half _InnerOutlineThickness, _InnerOutlineAlpha, _InnerOutlineGlow; + half4 _InnerOutlineColor; + #endif + + #if GRADIENT_ON + half _GradBlend, _GradBoostX, _GradBoostY; + half4 _GradTopRightCol, _GradTopLeftCol, _GradBotRightCol, _GradBotLeftCol; + #endif + + #if COLORSWAP_ON + half4 _ColorSwapRed, _ColorSwapGreen, _ColorSwapBlue; + half _ColorSwapRedLuminosity, _ColorSwapGreenLuminosity, _ColorSwapBlueLuminosity, _ColorSwapBlend; + #endif + + #if CHANGECOLOR_ON + half4 _ColorChangeNewCol, _ColorChangeTarget; + half _ColorChangeTolerance, _ColorChangeLuminosity; + #endif + #if CHANGECOLOR2_ON + half4 _ColorChangeNewCol2, _ColorChangeTarget2; + half _ColorChangeTolerance2; + #endif + #if CHANGECOLOR3_ON + half4 _ColorChangeNewCol3, _ColorChangeTarget3; + half _ColorChangeTolerance3; + #endif + + #if COLORRAMP_ON + half _ColorRampLuminosity, _ColorRampBlend; + #endif + + #if HITEFFECT_ON + half4 _HitEffectColor; + half _HitEffectGlow, _HitEffectBlend; + #endif + + #if NEGATIVE_ON + half _NegativeAmount; + #endif + + #if PIXELATE_ON + half _PixelateSize; + #endif + + #if GREYSCALE_ON + half _GreyscaleLuminosity, _GreyscaleBlend; + half4 _GreyscaleTintColor; + #endif + + #if POSTERIZE_ON + half _PosterizeNumColors, _PosterizeGamma; + #endif + + #if BLUR_ON + half _BlurIntensity; + #endif + + #if MOTIONBLUR_ON + half _MotionBlurAngle, _MotionBlurDist; + #endif + + #if GHOST_ON + half _GhostColorBoost, _GhostTransparency, _GhostBlend; + #endif + + #if HOLOGRAM_ON + half _HologramStripesAmount, _HologramMinAlpha, _HologramUnmodAmount, _HologramStripesSpeed, _HologramMaxAlpha, _HologramBlend; + half4 _HologramStripeColor; + #endif + + #if CHROMABERR_ON + half _ChromAberrAmount, _ChromAberrAlpha; + #endif + + #if GLITCH_ON + half _GlitchAmount, _GlitchSize; + #endif + + #if FLICKER_ON + half _FlickerFreq, _FlickerPercent, _FlickerAlpha; + #endif + + #if SHADOW_ON + half _ShadowX, _ShadowY, _ShadowAlpha; + half4 _ShadowColor; + #endif + + #if SHINE_ON + half4 _ShineColor; + half _ShineLocation, _ShineRotate, _ShineWidth, _ShineGlow; + #endif + + #if CONTRAST_ON + half _Contrast, _Brightness; + #endif + + #if OVERLAY_ON + half4 _OverlayTex_ST, _OverlayColor; + half _OverlayGlow, _OverlayBlend, _OverlayTextureScrollXSpeed, _OverlayTextureScrollYSpeed; + #endif + + #if DOODLE_ON + half _HandDrawnAmount, _HandDrawnSpeed; + #endif + + #if WIND_ON + half _GrassSpeed, _GrassWind, _GrassManualAnim, _GrassRadialBend; + #endif + + #if WAVEUV_ON + float _WaveAmount, _WaveSpeed, _WaveStrength, _WaveX, _WaveY; + #endif + + #if ROUNDWAVEUV_ON + half _RoundWaveStrength, _RoundWaveSpeed; + #endif + + #if RECTSIZE_ON + half _RectSize; + #endif + + #if OFFSETUV_ON + half _OffsetUvX, _OffsetUvY; + #endif + + #if CLIPPING_ON + half _ClipUvLeft, _ClipUvRight, _ClipUvUp, _ClipUvDown; + #endif + + #if RADIALCLIPPING_ON + half _RadialStartAngle, _RadialClip, _RadialClip2; + #endif + + #if TEXTURESCROLL_ON + half _TextureScrollXSpeed, _TextureScrollYSpeed; + #endif + + #if ZOOMUV_ON + half _ZoomUvAmount; + #endif + + #if WARP_ON + half _WarpStrength, _WarpSpeed, _WarpScale; + #endif + + #if TWISTUV_ON + half _TwistUvAmount, _TwistUvPosX, _TwistUvPosY, _TwistUvRadius; + #endif + + #if ROTATEUV_ON + half _RotateUvAmount; + #endif + + #if FISHEYE_ON + half _FishEyeUvAmount; + #endif + + #if PINCH_ON + half _PinchUvAmount; + #endif + + #if SHAKEUV_ON + half _ShakeUvSpeed, _ShakeUvX, _ShakeUvY; + #endif + + #if NORMALMAP_ON + half _NormalStrength; + #endif + + float _RandomSeed; + + + + + CBUFFER_END + + + + + + + + TEXTURE2D(_MainTex); + SAMPLER(sampler_MainTex); + + #if GLOW_ON + TEXTURE2D(_GlowTex); + SAMPLER(sampler_GlowTex); + #endif + + #if FADE_ON + TEXTURE2D(_FadeTex); + SAMPLER(sampler_FadeTex); + + TEXTURE2D(_FadeBurnTex); + SAMPLER(sampler_FadeBurnTex); + #endif + + #if DISTORT_ON + TEXTURE2D(_DistortTex); + SAMPLER(sampler_DistortTex); + #endif + + #if OUTTEX_ON + TEXTURE2D(_OutlineTex); + SAMPLER(sampler_OutlineTex); + #endif + + #if OUTDIST_ON + TEXTURE2D(_OutlineDistortTex); + SAMPLER(sampler_OutlineDistortTex); + #endif + + #if COLORSWAP_ON + TEXTURE2D(_ColorSwapTex); + SAMPLER(sampler_ColorSwapTex); + #endif + + #if COLORRAMP_ON + TEXTURE2D(_ColorRampTex); + TEXTURE2D(_ColorRampTexGradient); + SAMPLER(sampler_ColorRampTex); + SAMPLER(sampler_ColorRampTexGradient); + #endif + + #if SHINE_ON + TEXTURE2D(_ShineMask); + SAMPLER(sampler_ShineMask); + #endif + + #if OVERLAY_ON + TEXTURE2D(_OverlayTex); + SAMPLER(sampler_OverlayTex); + #endif + + #if NORMALMAP_ON + TEXTURE2D(_NormalMap); + SAMPLER(sampler_NormalMap); + #endif + + + half3 GetPixel(in int offsetX, in int offsetY, in half2 uv, in Texture2D _tex, in SamplerState _sampler) + { + half2 _uv = uv + half2(offsetX * _MainTex_TexelSize.x, offsetY * _MainTex_TexelSize.y); + half4 col = SAMPLE_TEXTURE2D(_tex, _sampler, _uv); + return col.rgb; + } + + + //BLURS------------------------------------------------------------------------- + half4 Blur(half2 uv, Texture2D source, SamplerState sampler_source, half Intensity) + { + const half2 texelSize = 1.0 / _ScreenParams.xy; + const half4 color = SAMPLE_TEXTURE2D(source, sampler_source, uv); + const half2 offset = Intensity * texelSize; + + half4 accumulatedColor = color; + half accumulatedWeight = 1.0; + for (int x = -1; x <= 1; x++) + { + for (int y = -1; y <= 1; y++) + { + const half2 sampleUV = uv + half2(x, y) * offset; + const half4 sampleColor = SAMPLE_TEXTURE2D(source, sampler_source, sampleUV); + + accumulatedColor += sampleColor; + accumulatedWeight += 1.0; + } + } + + half4 blurredColor = accumulatedColor / accumulatedWeight; + return blurredColor; + } + + half BlurHD_G(half bhqp, half x) + { + return exp(-(x * x) / (2.0 * bhqp * bhqp)); + } + half4 BlurHD(half2 uv, Texture2D source, SamplerState sampler_source, half BlurAmount, half xScale, half yScale) + { + int iterations = 16; + int halfIterations = iterations / 2; + half sigmaX = 0.1 + BlurAmount * 0.5; + half sigmaY = sigmaX; + half total = 0.0; + half4 ret = half4(0, 0, 0, 0); + for (int iy = 0; iy < iterations; ++iy) + { + half fy = BlurHD_G(sigmaY, half(iy) -half(halfIterations)); + half offsetY = half(iy - halfIterations) * 0.00390625 * xScale; + for (int ix = 0; ix < iterations; ++ix) + { + half fx = BlurHD_G(sigmaX, half(ix) - half(halfIterations)); + half offsetX = half(ix - halfIterations) * 0.00390625 * yScale; + total += fx * fy; + ret += SAMPLE_TEXTURE2D(source, sampler_source, uv + half2(offsetX, offsetY)) * fx * fy; + } + } + return ret / total; + } + //----------------------------------------------------------------------- + + + //------------------------------------------- + half RemapFloat(half inValue, half inMin, half inMax, half outMin, half outMax){ + return outMin + (inValue - inMin) * (outMax - outMin) / (inMax - inMin); + } + //------------------------------------------- + + //----------------------------------------------------------------------- + half rand(half2 seed, half offset) { + return (frac(sin(dot(seed, half2(12.9898, 78.233))) * 43758.5453) + offset) % 1.0; + } + + half rand2(half2 seed, half offset) { + return (frac(sin(dot(seed * floor(50 + (_Time.x % 1.0) * 12.), half2(127.1, 311.7))) * 43758.5453123) + offset) % 1.0; + } + + half rand2CustomTime(half2 seed, half offset, half customTime) { + return (frac(sin(dot(seed * floor(50 + (customTime % 1.0) * 12.), half2(127.1, 311.7))) * 43758.5453123) + offset) % 1.0; + } + //----------------------------------------------------------------------- + + + void Ext_ModifyVertex0 (inout VertexData v, inout ExtraV2F d) + { + //BILBOARD_ON + #if BILBOARD_ON + half3 camRight = mul((half3x3)unity_CameraToWorld, half3(1,0,0)); + half3 camUp = half3(0,1,0); + #if BILBOARDY_ON + camUp = mul((half3x3)unity_CameraToWorld, half3(0,1,0)); + #endif + half3 localPos = v.vertex.x * camRight + v.vertex.y * camUp; + v.vertex = half4(localPos, 1); + #endif + //----------------------------------------------------------- + + v.texcoord0.xy = TRANSFORM_TEX(v.texcoord0.xy, _MainTex); + half2 center = half2(0.5, 0.5); + #if ATLAS_ON + center = half2((_MaxXUV + _MinXUV) / 2.0, (_MaxYUV + _MinYUV) / 2.0); + #endif + + //POLARUV_ON + #if POLARUV_ON + v.texcoord0.xy = v.texcoord0.xy - center; + #endif + + //---------------------------------------- + + //ROTATEUV_ON + #if ROTATEUV_ON + half2 uvC = v.texcoord0.xy; + half cosAngle = cos(_RotateUvAmount); + half sinAngle = sin(_RotateUvAmount); + half2x2 rot = half2x2(cosAngle, -sinAngle, sinAngle, cosAngle); + uvC -= center; + v.texcoord0.xy = mul(rot, uvC); + v.texcoord0.xy += center; + #endif + //-------------------- + + #if RECTSIZE_ON + v.vertex.xyz += (v.vertex.xyz * (_RectSize - 1.0)); + #endif + + #if OUTTEX_ON + v.texcoord1.xy = TRANSFORM_TEX(v.texcoord0.xy, _OutlineTex); + #endif + + #if OUTDIST_ON + v.texcoord2.xy = TRANSFORM_TEX(v.texcoord0.xy, _OutlineDistortTex); + #endif + + #if DISTORT_ON + v.texcoord3.xy = TRANSFORM_TEX(v.texcoord0.xy, _DistortTex); + #endif + } + + void Ext_SurfaceFunction0 (inout Surface o, ShaderData d) + { + half randomSeed = _RandomSeed; + + float2 uvRect = d.texcoord0; + half2 center = half2(0.5, 0.5); + #if ATLAS_ON + center = half2((_MaxXUV + _MinXUV) / 2.0, (_MaxYUV + _MinYUV) / 2.0); + uvRect = half2((d.texcoord0.x - _MinXUV) / (_MaxXUV - _MinXUV), (d.texcoord0.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half2 centerTiled = half2(center.x * _MainTex_ST.x, center.y * _MainTex_ST.y); + + //CLIPPING_ON + #if CLIPPING_ON + half2 tiledUv = half2(d.texcoord0.x / _MainTex_ST.x, d.texcoord0.y / _MainTex_ST.y); + #if ATLAS_ON + tiledUv = half2((tiledUv.x - _MinXUV) / (_MaxXUV - _MinXUV), (tiledUv.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + clip((1 - _ClipUvUp) - tiledUv.y); + clip(tiledUv.y - _ClipUvDown); + clip((1 - _ClipUvRight) - tiledUv.x); + clip(tiledUv.x - _ClipUvLeft); + #endif + //---------------------------------- + + //RADIALCLIPPING_ON + #if RADIALCLIPPING_ON + half2 tiledUv2 = half2(d.texcoord0.x / _MainTex_ST.x, d.texcoord0.y / _MainTex_ST.y); + #if ATLAS_ON + tiledUv2 = half2((tiledUv2.x - _MinXUV) / (_MaxXUV - _MinXUV), (tiledUv2.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half startAngle = _RadialStartAngle - _RadialClip; + half endAngle = _RadialStartAngle + _RadialClip2; + half offset0 = clamp(0, 360, startAngle + 360); + half offset360 = clamp(0, 360, endAngle - 360); + half2 atan2Coord = half2(lerp(-1, 1, tiledUv2.x), lerp(-1, 1, tiledUv2.y)); + half atanAngle = atan2(atan2Coord.y, atan2Coord.x) * 57.3; // angle in degrees + if(atanAngle < 0) atanAngle = 360 + atanAngle; + if(atanAngle >= startAngle && atanAngle <= endAngle) discard; + if(atanAngle <= offset360) discard; + if(atanAngle >= offset0) discard; + #endif + + //----------------------------- + + //TEXTURESCROLL_ON && ATLAS_ON + #if TEXTURESCROLL_ON && ATLAS_ON + d.texcoord0.xy = half2(_MinXUV + ((_MaxXUV - _MinXUV) * (abs(((_Time.y + randomSeed) * _TextureScrollXSpeed) + uvRect.x) % 1)), + _MinYUV + ((_MaxYUV - _MinYUV) * (abs(((_Time.y + randomSeed) * _TextureScrollYSpeed) + uvRect.y) % 1))); + #endif + //---------------------------- + + //OFFSETUV_ON + #if OFFSETUV_ON + #if ATLAS_ON + d.texcoord0.xy = half2(_MinXUV + ((_MaxXUV - _MinXUV) * (abs((_OffsetUvX + uvRect.x) % 1))), + _MinYUV + ((_MaxYUV - _MinYUV) * (abs(_OffsetUvY + uvRect.y) % 1))); + #else + d.texcoord0.xy += half2(_OffsetUvX, _OffsetUvY); + #endif + #endif + + //---------------------- + + //POLARUV_ON + #if POLARUV_ON + d.texcoord0.xy = half2(atan2(d.texcoord0.y, d.texcoord0.x) / (2.0f * 3.141592653589f), length(d.texcoord0.xy)); + d.texcoord0.xy *= _MainTex_ST.xy; + #endif + + //-------------------------------------- + + //TWISTUV_ON + #if TWISTUV_ON + #if ATLAS_ON + _TwistUvPosX = ((_MaxXUV - _MinXUV) * _TwistUvPosX) + _MinXUV; + _TwistUvPosY = ((_MaxYUV - _MinYUV) * _TwistUvPosY) + _MinYUV; + #endif + half2 tempUv = d.texcoord0.xy - half2(_TwistUvPosX * _MainTex_ST.x, _TwistUvPosY * _MainTex_ST.y); + _TwistUvRadius *= (_MainTex_ST.x + _MainTex_ST.y) / 2; + half percent = (_TwistUvRadius - length(tempUv)) / _TwistUvRadius; + half theta = percent * percent * (2.0 * sin(_TwistUvAmount)) * 8.0; + half s = sin(theta); + half c = cos(theta); + half beta = max(sign(_TwistUvRadius - length(tempUv)), 0.0); + tempUv = half2(dot(tempUv, half2(c, -s)), dot(tempUv, half2(s, c))) * beta + tempUv * (1 - beta); + tempUv += half2(_TwistUvPosX * _MainTex_ST.x, _TwistUvPosY * _MainTex_ST.y); + d.texcoord0.xy = tempUv; + #endif + + //-------------------------------------------- + + //FISHEYE_ON + #if FISHEYE_ON + half bind = length(centerTiled); + half2 dF = d.texcoord0.xy - centerTiled; + half dFlen = length(dF); + half fishInt = (3.14159265359 / bind) * (_FishEyeUvAmount + 0.001); + d.texcoord0.xy = centerTiled + (dF / (max(0.0001, dFlen))) * tan(dFlen * fishInt) * bind / tan(bind * fishInt); + #endif + //--------------------------------------------- + + //PINCH_ON + #if PINCH_ON + half2 dP = d.texcoord0.xy - centerTiled; + half pinchInt = (3.141592 / length(centerTiled)) * (-_PinchUvAmount + 0.001); + d.texcoord0.xy = centerTiled + normalize(dP) * atan(length(dP) * -pinchInt * 10.0) * 0.5 / atan(-pinchInt * 5); + #endif + + //--------------------------------------------- + + //ZOOMUV_ON + #if ZOOMUV_ON + d.texcoord0.xy -= centerTiled; + d.texcoord0.xy = d.texcoord0.xy * _ZoomUvAmount; + d.texcoord0.xy += centerTiled; + #endif + + //----------------------------------------------- + + //DOODLE_ON + #if DOODLE_ON + half2 uvCopy = uvRect; + _HandDrawnSpeed = (floor((_Time.x + randomSeed) * 20 * _HandDrawnSpeed) / _HandDrawnSpeed) * _HandDrawnSpeed; + uvCopy.x = sin((uvCopy.x * _HandDrawnAmount + _HandDrawnSpeed) * 4); + uvCopy.y = cos((uvCopy.y * _HandDrawnAmount + _HandDrawnSpeed) * 4); + d.texcoord0.xy = lerp(d.texcoord0.xy, d.texcoord0.xy + uvCopy, 0.0005 * _HandDrawnAmount); + #endif + + //-------------------------- + + //SHAKEUV_ON + #if SHAKEUV_ON + half xShake = sin((_Time.x + randomSeed) * _ShakeUvSpeed * 50) * _ShakeUvX; + half yShake = cos((_Time.x + randomSeed) * _ShakeUvSpeed * 50) * _ShakeUvY; + d.texcoord0.xy += half2(xShake * 0.012, yShake * 0.01); + #endif + + //------------------------------------------- + + //RECTSIZE_ON + #if RECTSIZE_ON + d.texcoord0.xy = d.texcoord0.xy * (_RectSize).xx + (((-_RectSize * 0.5) + 0.5)).xx; + #endif + + //------------------------------------------- + + //DISTORT_ON + #if DISTORT_ON + #if ATLAS_ON + d.texcoord3.x = d.texcoord3.x * (1 / (_MaxXUV - _MinXUV)); + d.texcoord3.y = d.texcoord3.y * (1 / (_MaxYUV - _MinYUV)); + #endif + + d.texcoord3.x += ((_Time.x + _RandomSeed) * _DistortTexXSpeed) % 1; + d.texcoord3.y += ((_Time.x + _RandomSeed) * _DistortTexYSpeed) % 1; + half distortAmnt = (SAMPLE_TEXTURE2D(_DistortTex, sampler_DistortTex, d.texcoord3.xy).r - 0.5) * 0.2 * _DistortAmount; + d.texcoord0.x += distortAmnt; + d.texcoord0.y += distortAmnt; + #endif + //------------------------------------------------------- + + //WARP_ON + #if WARP_ON + half2 warpUv = half2(d.texcoord0.x / _MainTex_ST.x, d.texcoord0.y / _MainTex_ST.y); + #if ATLAS_ON + warpUv = half2((warpUv.x - _MinXUV) / (_MaxXUV - _MinXUV), (warpUv.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + const float tau = 6.283185307179586; + float xWarp = (_Time.y + randomSeed) * _WarpSpeed + warpUv.x * tau / _WarpScale; + float yWarp = (_Time.y + randomSeed) * _WarpSpeed + warpUv.y * tau / _WarpScale; + float2 warp = float2(sin(xWarp), sin(yWarp)) * _WarpStrength; + d.texcoord0.xy += warp; + #endif + + //------------------------------------------------------- + + //WAVEUV_ON + #if WAVEUV_ON + float2 uvWave = half2(_WaveX * _MainTex_ST.x, _WaveY * _MainTex_ST.y) - d.texcoord0.xy; + uvWave %= 1; + #if ATLAS_ON + uvWave = half2(_WaveX, _WaveY) - uvRect; + #endif + uvWave.x *= _ScreenParams.x / _ScreenParams.y; + float waveTime = _Time.y + randomSeed; + float angWave = (sqrt(dot(uvWave, uvWave)) * _WaveAmount) - ((waveTime * _WaveSpeed)); + d.texcoord0.xy = d.texcoord0.xy + uvWave * sin(angWave) * (_WaveStrength / 1000.0); + #endif + //---------------------------------------------------- + + //ROUNDWAVEUV_ON + #if ROUNDWAVEUV_ON + half xWave = ((0.5 * _MainTex_ST.x) - uvRect.x); + half yWave = ((0.5 * _MainTex_ST.y) - uvRect.y) * (_MainTex_TexelSize.w / _MainTex_TexelSize.z); + half ripple = -sqrt(xWave*xWave + yWave* yWave); + d.texcoord0.xy += (sin((ripple + (_Time.y + randomSeed) * (_RoundWaveSpeed/10.0)) / 0.015) * (_RoundWaveStrength/10.0)) % 1; + #endif + //---------------------------------------------------- + + + //WIND_ON + #if WIND_ON + half windOffset = sin((_Time.x + randomSeed) * _GrassSpeed * 10); + half2 windCenter = half2(0.5, 0.1); + #if ATLAS_ON + windCenter.x = ((_MaxXUV - _MinXUV) * windCenter.x) + _MinXUV; + windCenter.y = ((_MaxYUV - _MinYUV) * windCenter.y) + _MinYUV; + #endif + #if !MANUALWIND_ON + d.texcoord0.x = fmod(abs(lerp(d.texcoord0.x, d.texcoord0.x + (_GrassWind * 0.01 * windOffset), uvRect.y)), 1); + #else + d.texcoord0.x = fmod(abs(lerp(d.texcoord0.x, d.texcoord0.x + (_GrassWind * 0.01 * _GrassManualAnim), uvRect.y)), 1); + windOffset = _GrassManualAnim; + #endif + half2 delta = d.texcoord0.xy - windCenter; + half delta2 = dot(delta.xy, delta.xy); + half2 delta_offset = delta2 * windOffset; + d.texcoord0.xy = d.texcoord0.xy + half2(delta.y, -delta.x) * delta_offset * _GrassRadialBend; + #endif + + //-------------------------------------------------------- + + //TEXTURESCROLL_ON && !ATLAS_ON + #if TEXTURESCROLL_ON && !ATLAS_ON + d.texcoord0.x += ((_Time.y + randomSeed) * _TextureScrollXSpeed) % 1; + d.texcoord0.y += ((_Time.y + randomSeed) * _TextureScrollYSpeed) % 1; + #endif + //------------------------------ + + //PIXELATE_ON + #if PIXELATE_ON + half aspectRatio = _MainTex_TexelSize.x / _MainTex_TexelSize.y; + half2 pixelSize = float2(_PixelateSize, _PixelateSize * aspectRatio); + d.texcoord0.xy = floor(d.texcoord0.xy * pixelSize) / pixelSize; + #endif + //-------------- + + half4 col = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy); + half originalAlpha = col.a; + col *= d.vertexColor; + + //NORMAL MAP + #if NORMALMAP_ON + half4 normalSample = SAMPLE_TEXTURE2D(_NormalMap, sampler_NormalMap, d.texcoord0.xy); + half3 normalTS = UnpackNormal(normalSample); + normalTS.xy *= _NormalStrength; + o.Normal = normalTS; + #endif + + + //GLITCH_ON + #if GLITCH_ON + half2 uvGlitch = uvRect; + uvGlitch.y -= 0.5; + half lineNoise = pow(rand2(floor(uvGlitch * half2(24., 19.) * _GlitchSize) * 4.0, randomSeed), 3.0) * _GlitchAmount + * pow(rand2(floor(uvGlitch * half2(38., 14.) * _GlitchSize) * 4.0, randomSeed), 3.0); + col = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(lineNoise * 0.02 * rand2(half2(2.0, 1), randomSeed), 0)) * d.vertexColor; + #endif + //-------------------------------------- + + //CHROMABERR_ON + #if CHROMABERR_ON + half4 r = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(_ChromAberrAmount/10, 0)) * d.vertexColor; + half4 b = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(-_ChromAberrAmount/10, 0)) * d.vertexColor; + col = half4(r.r * r.a, col.g, b.b * b.a, max(max(r.a, b.a) * _ChromAberrAlpha, col.a)); + #endif + + //-------------------------------- + + //BLUR_ON + #if BLUR_ON + #if ATLAS_ON + #if !BLURISHD_ON + col = BlurHD(d.texcoord0.xy, _MainTex, sampler_MainTex, _BlurIntensity, (_MaxXUV - _MinXUV), (_MaxYUV - _MinYUV)) * d.vertexColor; + #else + col = Blur(d.texcoord0.xy, _MainTex, sampler_MainTex, _BlurIntensity * (_MaxXUV - _MinXUV)) * d.vertexColor; + #endif + #else + #if !BLURISHD_ON + col = BlurHD(d.texcoord0.xy, _MainTex, sampler_MainTex, _BlurIntensity, 1, 1) * d.vertexColor; + #else + col = Blur(d.texcoord0.xy, _MainTex, sampler_MainTex, _BlurIntensity) * d.vertexColor; + #endif + #endif + #endif + + //-------------------- + + //MOTIONBLUR_ON + #if MOTIONBLUR_ON + _MotionBlurAngle = _MotionBlurAngle * 3.1415926; + #define rot(n) mul(n, half2x2(cos(_MotionBlurAngle), -sin(_MotionBlurAngle), sin(_MotionBlurAngle), cos(_MotionBlurAngle))) + _MotionBlurDist = _MotionBlurDist * 0.005; + #if ATLAS_ON + _MotionBlurDist *= (_MaxXUV - _MinXUV); + #endif + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(-_MotionBlurDist, -_MotionBlurDist))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(-_MotionBlurDist * 2, -_MotionBlurDist * 2))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(-_MotionBlurDist * 3, -_MotionBlurDist * 3))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(-_MotionBlurDist * 4, -_MotionBlurDist * 4))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(_MotionBlurDist, _MotionBlurDist))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(_MotionBlurDist * 2, _MotionBlurDist * 2))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(_MotionBlurDist * 3, _MotionBlurDist * 3))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(_MotionBlurDist * 4, _MotionBlurDist * 4))); + col.rgb = col.rgb / 9; + #endif + //------------------------------------ + + //NEGATIVE_ON + #if NEGATIVE_ON + col.rgb = lerp(col.rgb, 1 - col.rgb, _NegativeAmount); + #endif + + //-------------- + half luminance = 0; + + //GREYSCALE_ON && !GREYSCALEOUTLINE_ON + #if GREYSCALE_ON && !GREYSCALEOUTLINE_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + luminance = saturate(luminance + _GreyscaleLuminosity); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _GreyscaleTintColor, _GreyscaleBlend); + #endif + //------------------------------------ + + //GHOST_ON + #if GHOST_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + half4 ghostResult; + ghostResult.a = saturate(luminance - _GhostTransparency) * col.a; + ghostResult.rgb = col.rgb * (luminance + _GhostColorBoost); + col = lerp(col, ghostResult, _GhostBlend); + #endif + //------------------------------------ + + //INNEROUTLINE_ON + #if INNEROUTLINE_ON + half3 innerT = abs(GetPixel(0, _InnerOutlineThickness, d.texcoord0.xy, _MainTex, sampler_MainTex) - GetPixel(0, -_InnerOutlineThickness, d.texcoord0.xy, _MainTex, sampler_MainTex)); + innerT += abs(GetPixel(_InnerOutlineThickness, 0, d.texcoord0.xy, _MainTex, sampler_MainTex) - GetPixel(-_InnerOutlineThickness, 0, d.texcoord0.xy, _MainTex, sampler_MainTex)); + #if !ONLYINNEROUTLINE_ON + innerT = (innerT / 2.0) * col.a * _InnerOutlineAlpha; + col.rgb += length(innerT) * _InnerOutlineColor.rgb * _InnerOutlineGlow; + #else + innerT *= col.a * _InnerOutlineAlpha; + col.rgb = length(innerT) * _InnerOutlineColor.rgb * _InnerOutlineGlow; + col.a = step(0.3, col.r+col.g+col.b); + #endif + #endif + //------------------------------------------------------- + + //HITEFFECT_ON + #if HITEFFECT_ON + col.rgb = lerp(col.rgb, _HitEffectColor.rgb * _HitEffectGlow, _HitEffectBlend); + #endif + //-------------------- + + //GRADIENT_ON + #if GRADIENT_ON + half2 tiledUvGrad = half2(uvRect.x / _MainTex_ST.x, uvRect.y / _MainTex_ST.y); + #if GRADIENT2COL_ON + _GradTopRightCol = _GradTopLeftCol; + _GradBotRightCol = _GradBotLeftCol; + #endif + #if RADIALGRADIENT_ON + half radialDist = 1 - length(tiledUvGrad - half2(0.5, 0.5)); + radialDist *= (_MainTex_TexelSize.w / _MainTex_TexelSize.z); + radialDist = saturate(_GradBoostX * radialDist); + half4 gradientResult = lerp(_GradTopLeftCol, _GradBotLeftCol, radialDist); + #else + half gradXLerpFactor = saturate(pow(tiledUvGrad.x, _GradBoostX)); + half4 gradientResult = lerp(lerp(_GradBotLeftCol, _GradBotRightCol, gradXLerpFactor), + lerp(_GradTopLeftCol, _GradTopRightCol, gradXLerpFactor), saturate(pow(tiledUvGrad.y, _GradBoostY))); + #endif + gradientResult = lerp(col, gradientResult, _GradBlend); + col.rgb = gradientResult.rgb * col.a; + col.a *= gradientResult.a; + #endif + //-------------------------------------------------------------------- + + //CONTRAST_ON + #if CONTRAST_ON + col.rgb = (col.rgb - float3(0.5, 0.5, 0.5)) * _Contrast + float3(0.5, 0.5, 0.5); + col.rgb += _Brightness; + #endif + + //------------------------------------------------------------------- + + //COLORSWAP_ON + #if COLORSWAP_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + half4 swapMask = SAMPLE_TEXTURE2D(_ColorSwapTex, sampler_ColorSwapTex, d.texcoord0.xy); + swapMask.rgb *= swapMask.a; + half3 redSwap = _ColorSwapRed * swapMask.r * saturate(luminance + _ColorSwapRedLuminosity); + half3 greenSwap = _ColorSwapGreen * swapMask.g * saturate(luminance + _ColorSwapGreenLuminosity); + half3 blueSwap = _ColorSwapBlue * swapMask.b * saturate(luminance + _ColorSwapBlueLuminosity); + swapMask.rgb = col.rgb * saturate(1 - swapMask.r - swapMask.g - swapMask.b); + col.rgb = lerp(col.rgb, swapMask.rgb + redSwap + greenSwap + blueSwap, _ColorSwapBlend); + #endif + //-------------------------------------------------------------------- + + //COLORRAMP_ON && !COLORRAMPOUTLINE_ON + #if COLORRAMP_ON && !COLORRAMPOUTLINE_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + luminance = saturate(luminance + _ColorRampLuminosity); + #if GRADIENTCOLORRAMP_ON + col.rgb = lerp(col.rgb, SAMPLE_TEXTURE2D(_ColorRampTexGradient, sampler_ColorRampTexGradient, half2(luminance, 0)).rgb, _ColorRampBlend); + #else + col.rgb = lerp(col.rgb, SAMPLE_TEXTURE2D(_ColorRampTex, sampler_ColorRampTex, half2(luminance, 0)).rgb, _ColorRampBlend); + #endif + #endif + //-------------------------------------------------------------------- + + //CHANGECOLOR_ON + #if CHANGECOLOR_ON + float3 currChangeColor = saturate(col.rgb); + luminance = 0.3 * currChangeColor.r + 0.59 * currChangeColor.g + 0.11 * currChangeColor.b; + luminance = saturate(luminance + _ColorChangeLuminosity); + half3 dif = abs(currChangeColor - _ColorChangeTarget.rgb); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _ColorChangeNewCol.rgb, + max(sign(1 - saturate(dif.x + dif.y + dif.z) - _ColorChangeTolerance), 0.0)); + #if CHANGECOLOR2_ON + dif = abs(currChangeColor - _ColorChangeTarget2.rgb); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _ColorChangeNewCol2.rgb, + max(sign(1 - saturate(dif.x + dif.y + dif.z) - _ColorChangeTolerance2), 0.0)); + #endif + #if CHANGECOLOR3_ON + dif = abs(currChangeColor - _ColorChangeTarget3.rgb); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _ColorChangeNewCol3.rgb, + max(sign(1 - saturate(dif.x + dif.y + dif.z) - _ColorChangeTolerance3), 0.0)); + #endif + #endif + //------------------------------------------------------- + + //POSTERIZE_ON && !POSTERIZEOUTLINE_ON + #if POSTERIZE_ON && !POSTERIZEOUTLINE_ON + col.rgb = pow(col.rgb, _PosterizeGamma) * _PosterizeNumColors; + col.rgb = floor(col.rgb) / _PosterizeNumColors; + col.rgb = pow(col.rgb, 1.0 / _PosterizeGamma); + #endif + //------------------------------------ + + //HSV_ON + #if HSV_ON + half3 resultHsv = half3(col.rgb); + half cosHsv = _HsvBright * _HsvSaturation * cos(_HsvShift * 3.14159265 / 180); + half sinHsv = _HsvBright * _HsvSaturation * sin(_HsvShift * 3.14159265 / 180); + resultHsv.x = (.299 * _HsvBright + .701 * cosHsv + .168 * sinHsv) * col.x + + (.587 * _HsvBright - .587 * cosHsv + .330 * sinHsv) * col.y + + (.114 * _HsvBright - .114 * cosHsv - .497 * sinHsv) * col.z; + resultHsv.y = (.299 * _HsvBright - .299 * cosHsv - .328 * sinHsv) *col.x + + (.587 * _HsvBright + .413 * cosHsv + .035 * sinHsv) * col.y + + (.114 * _HsvBright - .114 * cosHsv + .292 * sinHsv) * col.z; + resultHsv.z = (.299 * _HsvBright - .3 * cosHsv + 1.25 * sinHsv) * col.x + + (.587 * _HsvBright - .588 * cosHsv - 1.05 * sinHsv) * col.y + + (.114 * _HsvBright + .886 * cosHsv - .203 * sinHsv) * col.z; + col.rgb = resultHsv; + #endif + //------------------------------------------------------- + + //OVERLAY_ON + #if OVERLAY_ON + half2 overlayUvs = d.texcoord0.xy; + overlayUvs.x += ((_Time.y + randomSeed) * _OverlayTextureScrollXSpeed) % 1; + overlayUvs.y += ((_Time.y + randomSeed) * _OverlayTextureScrollYSpeed) % 1; + half4 overlayCol = SAMPLE_TEXTURE2D(_OverlayTex, sampler_OverlayTex, TRANSFORM_TEX(overlayUvs, _OverlayTex)); + overlayCol.rgb *= _OverlayColor.rgb * _OverlayGlow; + #if !OVERLAYMULT_ON + overlayCol.rgb *= overlayCol.a * _OverlayColor.rgb * _OverlayColor.a * _OverlayBlend; + col.rgb += overlayCol.rgb; + #else + overlayCol.a *= _OverlayColor.a; + col = lerp(col, col * overlayCol, _OverlayBlend); + #endif + #endif + + //--------------------------------- + + //OUTBASE_ON + #if OUTBASE_ON + #if OUTBASEPIXELPERF_ON + half2 destUv = half2(_OutlinePixelWidth * _MainTex_TexelSize.x, _OutlinePixelWidth * _MainTex_TexelSize.y); + #else + half2 destUv = half2(_OutlineWidth * _MainTex_TexelSize.x * 200, _OutlineWidth * _MainTex_TexelSize.y * 200); + #endif + + #if OUTDIST_ON + d.texcoord3.x += ((_Time.x + _RandomSeed) * _OutlineDistortTexXSpeed) % 1; + d.texcoord3.y += ((_Time.x + _RandomSeed) * _OutlineDistortTexYSpeed) % 1; + #if ATLAS_ON + d.texcoord3 = half2((d.texcoord3.x - _MinXUV) / (_MaxXUV - _MinXUV), (d.texcoord3.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half outDistortAmnt = (SAMPLE_TEXTURE2D(_OutlineDistortTex, sampler_OutlineDistortTex, d.texcoord3).r - 0.5) * 0.2 * _OutlineDistortAmount; + destUv.x += outDistortAmnt; + destUv.y += outDistortAmnt; + #endif + + half spriteLeft = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(destUv.x, 0)).a; + half spriteRight = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy - half2(destUv.x, 0)).a; + half spriteBottom = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(0, destUv.y)).a; + half spriteTop = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy - half2(0, destUv.y)).a; + half result = spriteLeft + spriteRight + spriteBottom + spriteTop; + + #if OUTBASE8DIR_ON + half spriteTopLeft = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(destUv.x, destUv.y)).a; + half spriteTopRight = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(-destUv.x, destUv.y)).a; + half spriteBotLeft = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(destUv.x, -destUv.y)).a; + half spriteBotRight = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(-destUv.x, -destUv.y)).a; + result = result + spriteTopLeft + spriteTopRight + spriteBotLeft + spriteBotRight; + #endif + + result = step(0.05, saturate(result)); + + #if OUTTEX_ON + d.texcoord1.x += ((_Time.x + _RandomSeed) * _OutlineTexXSpeed) % 1; + d.texcoord1.y += ((_Time.x + _RandomSeed) * _OutlineTexYSpeed) % 1; + #if ATLAS_ON + d.texcoord1 = half2((d.texcoord1.x - _MinXUV) / (_MaxXUV - _MinXUV), (d.texcoord1.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half4 tempOutColor = SAMPLE_TEXTURE2D(_OutlineTex, sampler_OutlineTex, d.texcoord1); + tempOutColor *= _OutlineColor; + _OutlineColor = tempOutColor; + #endif + + result *= (1 - originalAlpha) * _OutlineAlpha; + + half4 outline = _OutlineColor * d.vertexColor.a; + outline.rgb *= _OutlineGlow; + outline.a = result; + #if ONLYOUTLINE_ON + col = outline; + #else + col = lerp(col, outline, result); + #endif + #endif + //------------------------------------------------------- + + //FADE_ON + #if FADE_ON + half2 tiledUvFade1 = TRANSFORM_TEX(d.texcoord0, _FadeTex); + half2 tiledUvFade2 = TRANSFORM_TEX(d.texcoord0, _FadeBurnTex); + #if ATLAS_ON + tiledUvFade1 = half2((tiledUvFade1.x - _MinXUV) / (_MaxXUV - _MinXUV), (tiledUvFade1.y - _MinYUV) / (_MaxYUV - _MinYUV)); + tiledUvFade2 = half2((tiledUvFade2.x - _MinXUV) / (_MaxXUV - _MinXUV), (tiledUvFade2.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half fadeTemp = SAMPLE_TEXTURE2D(_FadeTex, sampler_FadeTex, tiledUvFade1).r; + half fade = smoothstep(_FadeAmount, _FadeAmount + _FadeBurnTransition, fadeTemp); + half fadeBurn = saturate(smoothstep(_FadeAmount - _FadeBurnWidth, _FadeAmount - _FadeBurnWidth + 0.1, fadeTemp) * _FadeAmount); + col.a *= fade; + _FadeBurnColor.rgb *= _FadeBurnGlow; + col += fadeBurn * SAMPLE_TEXTURE2D(_FadeBurnTex, sampler_FadeBurnTex, tiledUvFade2) * _FadeBurnColor * originalAlpha * (1 - col.a); + #endif + //------------------------------------------------------- + + //SHADOW_ON + #if SHADOW_ON + half shadowA = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(_ShadowX, _ShadowY)).a; + half preMultShadowMask = 1 - (saturate(shadowA - col.a) * (1 - col.a)); + col.rgb *= 1 - ((shadowA - col.a) * (1 - col.a)); + col.rgb += (_ShadowColor * shadowA) * (1 - col.a); + col.a = max(shadowA * _ShadowAlpha * d.vertexColor.a, col.a); + #endif + + //------------------------------------------------------- + + //GLOW_ON + #if GLOW_ON + half4 emission; + #if GLOWTEX_ON + emission = SAMPLE_TEXTURE2D(_GlowTex, sampler_GlowTex, d.texcoord0); + #else + emission = col; + #endif + + col.rgb *= _GlowGlobal; + emission.rgb *= emission.a * col.a * _Glow * _GlowColor; + col.rgb += emission.rgb; + #endif + //------------------------------------------------------- + + //COLORRAMP_ON && COLORRAMPOUTLINE_ON + #if COLORRAMP_ON && COLORRAMPOUTLINE_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + luminance = saturate(luminance + _ColorRampLuminosity); + #if GRADIENTCOLORRAMP_ON + col.rgb = lerp(col.rgb, SAMPLE_TEXTURE2D(_ColorRampTexGradient, sampler_ColorRampTexGradient, half2(luminance, 0)).rgb, _ColorRampBlend); + #else + col.rgb = lerp(col.rgb, SAMPLE_TEXTURE2D(_ColorRampTex, sampler_ColorRampTex, half2(luminance, 0)).rgb, _ColorRampBlend); + #endif + #endif + //--------------- + + //GREYSCALE_ON && GREYSCALEOUTLINE_ON + #if GREYSCALE_ON && GREYSCALEOUTLINE_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + luminance = saturate(luminance + _GreyscaleLuminosity); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _GreyscaleTintColor, _GreyscaleBlend); + #endif + + //----------------------------------- + + //POSTERIZE_ON && POSTERIZEOUTLINE_ON + #if POSTERIZE_ON && POSTERIZEOUTLINE_ON + col.rgb = pow(col.rgb, _PosterizeGamma) * _PosterizeNumColors; + col.rgb = floor(col.rgb) / _PosterizeNumColors; + col.rgb = pow(col.rgb, 1.0 / _PosterizeGamma); + #endif + + //----------------------------------- + + //SHINE_ON + #if SHINE_ON + half2 uvShine = uvRect; + half cosAngle = cos(_ShineRotate); + half sinAngle = sin(_ShineRotate); + half2x2 rot = half2x2(cosAngle, -sinAngle, sinAngle, cosAngle); + uvShine -= half2(0.5, 0.5); + uvShine = mul(rot, uvShine); + uvShine += half2(0.5, 0.5); + half shineMask = SAMPLE_TEXTURE2D(_ShineMask, sampler_ShineMask, d.texcoord0.xy).a; + half currentDistanceProjection = (uvShine.x + uvShine.y) / 2; + half whitePower = 1 - (abs(currentDistanceProjection - _ShineLocation) / _ShineWidth); + col.rgb += col.a * whitePower * _ShineGlow * max(sign(currentDistanceProjection - (_ShineLocation - _ShineWidth)), 0.0) + * max(sign((_ShineLocation + _ShineWidth) - currentDistanceProjection), 0.0) * _ShineColor * shineMask; + #endif + + //----------------------------------- + + //HOLOGRAM_ON + #if HOLOGRAM_ON + half totalHologram = _HologramStripesAmount + _HologramUnmodAmount; + half hologramYCoord = ((uvRect.y + (((_Time.x + randomSeed) % 1) * _HologramStripesSpeed)) % totalHologram) / totalHologram; + hologramYCoord = abs(hologramYCoord); + half alpha = RemapFloat(saturate(hologramYCoord - (_HologramUnmodAmount/totalHologram)), 0.0, 1.0, _HologramMinAlpha, saturate(_HologramMaxAlpha)); + half hologramMask = max(sign((_HologramUnmodAmount/totalHologram) - hologramYCoord), 0.0); + half4 hologramResult = col; + hologramResult.a *= lerp(alpha, 1, hologramMask); + hologramResult.rgb *= max(1, _HologramMaxAlpha * max(sign(hologramYCoord - (_HologramUnmodAmount/totalHologram)), 0.0)); + hologramMask = 1 - step(0.01,hologramMask); + hologramResult.rgb += hologramMask * _HologramStripeColor * col.a; + col = lerp(col, hologramResult, _HologramBlend); + #endif + + //----------------------------------- + + //FLICKER_ON + #if FLICKER_ON + col.a *= saturate(col.a * step(frac(0.05 + (_Time.w + randomSeed) * _FlickerFreq), 1 - _FlickerPercent) + _FlickerAlpha); + #endif + //----------------------------------- + + //ALPHACUTOFF_ON + + //ALPHAROUND_ON + + //ALPHAOUTLINE_ON + #if ALPHAOUTLINE_ON + half alphaOutlineRes = pow(1 - col.a, max(_AlphaOutlinePower, 0.0001)) * step(_AlphaOutlineMinAlpha, col.a) * _AlphaOutlineBlend; + col.rgb = lerp(col.rgb, _AlphaOutlineColor.rgb * _AlphaOutlineGlow, alphaOutlineRes); + col.a = lerp(col.a, 1, alphaOutlineRes > 1); + #endif + //------------------------------------------------------- + + //FOG_ON + + //------------------ + + col *= _Color; + o.Albedo = col; + col.a *= _Alpha; + clip(col.a - _AlphaCutoffValue - 0.01); + o.Alpha = _Color.a; + } + + + + + + void ChainSurfaceFunction(inout Surface l, inout ShaderData d) + { + Ext_SurfaceFunction0(l, d); + // Ext_SurfaceFunction1(l, d); + // Ext_SurfaceFunction2(l, d); + // Ext_SurfaceFunction3(l, d); + // Ext_SurfaceFunction4(l, d); + // Ext_SurfaceFunction5(l, d); + // Ext_SurfaceFunction6(l, d); + // Ext_SurfaceFunction7(l, d); + // Ext_SurfaceFunction8(l, d); + // Ext_SurfaceFunction9(l, d); + // Ext_SurfaceFunction10(l, d); + // Ext_SurfaceFunction11(l, d); + // Ext_SurfaceFunction12(l, d); + // Ext_SurfaceFunction13(l, d); + // Ext_SurfaceFunction14(l, d); + // Ext_SurfaceFunction15(l, d); + // Ext_SurfaceFunction16(l, d); + // Ext_SurfaceFunction17(l, d); + // Ext_SurfaceFunction18(l, d); + // Ext_SurfaceFunction19(l, d); + // Ext_SurfaceFunction20(l, d); + // Ext_SurfaceFunction21(l, d); + // Ext_SurfaceFunction22(l, d); + // Ext_SurfaceFunction23(l, d); + // Ext_SurfaceFunction24(l, d); + // Ext_SurfaceFunction25(l, d); + // Ext_SurfaceFunction26(l, d); + // Ext_SurfaceFunction27(l, d); + // Ext_SurfaceFunction28(l, d); + // Ext_SurfaceFunction29(l, d); + } + +#if !_DECALSHADER + + void ChainModifyVertex(inout VertexData v, inout VertexToPixel v2p, float4 time) + { + ExtraV2F d; + + ZERO_INITIALIZE(ExtraV2F, d); + ZERO_INITIALIZE(Blackboard, d.blackboard); + // due to motion vectors in HDRP, we need to use the last + // time in certain spots. So if you are going to use _Time to adjust vertices, + // you need to use this time or motion vectors will break. + d.time = time; + + Ext_ModifyVertex0(v, d); + // Ext_ModifyVertex1(v, d); + // Ext_ModifyVertex2(v, d); + // Ext_ModifyVertex3(v, d); + // Ext_ModifyVertex4(v, d); + // Ext_ModifyVertex5(v, d); + // Ext_ModifyVertex6(v, d); + // Ext_ModifyVertex7(v, d); + // Ext_ModifyVertex8(v, d); + // Ext_ModifyVertex9(v, d); + // Ext_ModifyVertex10(v, d); + // Ext_ModifyVertex11(v, d); + // Ext_ModifyVertex12(v, d); + // Ext_ModifyVertex13(v, d); + // Ext_ModifyVertex14(v, d); + // Ext_ModifyVertex15(v, d); + // Ext_ModifyVertex16(v, d); + // Ext_ModifyVertex17(v, d); + // Ext_ModifyVertex18(v, d); + // Ext_ModifyVertex19(v, d); + // Ext_ModifyVertex20(v, d); + // Ext_ModifyVertex21(v, d); + // Ext_ModifyVertex22(v, d); + // Ext_ModifyVertex23(v, d); + // Ext_ModifyVertex24(v, d); + // Ext_ModifyVertex25(v, d); + // Ext_ModifyVertex26(v, d); + // Ext_ModifyVertex27(v, d); + // Ext_ModifyVertex28(v, d); + // Ext_ModifyVertex29(v, d); + + + // #if %EXTRAV2F0REQUIREKEY% + // v2p.extraV2F0 = d.extraV2F0; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // v2p.extraV2F1 = d.extraV2F1; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // v2p.extraV2F2 = d.extraV2F2; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // v2p.extraV2F3 = d.extraV2F3; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // v2p.extraV2F4 = d.extraV2F4; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // v2p.extraV2F5 = d.extraV2F5; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // v2p.extraV2F6 = d.extraV2F6; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // v2p.extraV2F7 = d.extraV2F7; + // #endif + } + + void ChainModifyTessellatedVertex(inout VertexData v, inout VertexToPixel v2p) + { + ExtraV2F d; + ZERO_INITIALIZE(ExtraV2F, d); + ZERO_INITIALIZE(Blackboard, d.blackboard); + + // #if %EXTRAV2F0REQUIREKEY% + // d.extraV2F0 = v2p.extraV2F0; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // d.extraV2F1 = v2p.extraV2F1; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // d.extraV2F2 = v2p.extraV2F2; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // d.extraV2F3 = v2p.extraV2F3; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // d.extraV2F4 = v2p.extraV2F4; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // d.extraV2F5 = v2p.extraV2F5; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // d.extraV2F6 = v2p.extraV2F6; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // d.extraV2F7 = v2p.extraV2F7; + // #endif + + + // Ext_ModifyTessellatedVertex0(v, d); + // Ext_ModifyTessellatedVertex1(v, d); + // Ext_ModifyTessellatedVertex2(v, d); + // Ext_ModifyTessellatedVertex3(v, d); + // Ext_ModifyTessellatedVertex4(v, d); + // Ext_ModifyTessellatedVertex5(v, d); + // Ext_ModifyTessellatedVertex6(v, d); + // Ext_ModifyTessellatedVertex7(v, d); + // Ext_ModifyTessellatedVertex8(v, d); + // Ext_ModifyTessellatedVertex9(v, d); + // Ext_ModifyTessellatedVertex10(v, d); + // Ext_ModifyTessellatedVertex11(v, d); + // Ext_ModifyTessellatedVertex12(v, d); + // Ext_ModifyTessellatedVertex13(v, d); + // Ext_ModifyTessellatedVertex14(v, d); + // Ext_ModifyTessellatedVertex15(v, d); + // Ext_ModifyTessellatedVertex16(v, d); + // Ext_ModifyTessellatedVertex17(v, d); + // Ext_ModifyTessellatedVertex18(v, d); + // Ext_ModifyTessellatedVertex19(v, d); + // Ext_ModifyTessellatedVertex20(v, d); + // Ext_ModifyTessellatedVertex21(v, d); + // Ext_ModifyTessellatedVertex22(v, d); + // Ext_ModifyTessellatedVertex23(v, d); + // Ext_ModifyTessellatedVertex24(v, d); + // Ext_ModifyTessellatedVertex25(v, d); + // Ext_ModifyTessellatedVertex26(v, d); + // Ext_ModifyTessellatedVertex27(v, d); + // Ext_ModifyTessellatedVertex28(v, d); + // Ext_ModifyTessellatedVertex29(v, d); + + // #if %EXTRAV2F0REQUIREKEY% + // v2p.extraV2F0 = d.extraV2F0; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // v2p.extraV2F1 = d.extraV2F1; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // v2p.extraV2F2 = d.extraV2F2; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // v2p.extraV2F3 = d.extraV2F3; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // v2p.extraV2F4 = d.extraV2F4; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // v2p.extraV2F5 = d.extraV2F5; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // v2p.extraV2F6 = d.extraV2F6; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // v2p.extraV2F7 = d.extraV2F7; + // #endif + } + + void ChainFinalColorForward(inout Surface l, inout ShaderData d, inout half4 color) + { + // Ext_FinalColorForward0(l, d, color); + // Ext_FinalColorForward1(l, d, color); + // Ext_FinalColorForward2(l, d, color); + // Ext_FinalColorForward3(l, d, color); + // Ext_FinalColorForward4(l, d, color); + // Ext_FinalColorForward5(l, d, color); + // Ext_FinalColorForward6(l, d, color); + // Ext_FinalColorForward7(l, d, color); + // Ext_FinalColorForward8(l, d, color); + // Ext_FinalColorForward9(l, d, color); + // Ext_FinalColorForward10(l, d, color); + // Ext_FinalColorForward11(l, d, color); + // Ext_FinalColorForward12(l, d, color); + // Ext_FinalColorForward13(l, d, color); + // Ext_FinalColorForward14(l, d, color); + // Ext_FinalColorForward15(l, d, color); + // Ext_FinalColorForward16(l, d, color); + // Ext_FinalColorForward17(l, d, color); + // Ext_FinalColorForward18(l, d, color); + // Ext_FinalColorForward19(l, d, color); + // Ext_FinalColorForward20(l, d, color); + // Ext_FinalColorForward21(l, d, color); + // Ext_FinalColorForward22(l, d, color); + // Ext_FinalColorForward23(l, d, color); + // Ext_FinalColorForward24(l, d, color); + // Ext_FinalColorForward25(l, d, color); + // Ext_FinalColorForward26(l, d, color); + // Ext_FinalColorForward27(l, d, color); + // Ext_FinalColorForward28(l, d, color); + // Ext_FinalColorForward29(l, d, color); + } + + void ChainFinalGBufferStandard(inout Surface s, inout ShaderData d, inout half4 GBuffer0, inout half4 GBuffer1, inout half4 GBuffer2, inout half4 outEmission, inout half4 outShadowMask) + { + // Ext_FinalGBufferStandard0(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard1(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard2(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard3(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard4(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard5(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard6(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard7(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard8(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard9(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard10(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard11(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard12(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard13(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard14(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard15(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard16(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard17(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard18(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard19(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard20(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard21(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard22(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard23(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard24(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard25(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard26(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard27(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard28(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard29(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + } +#endif + + + + + +#if _DECALSHADER + + ShaderData CreateShaderData(SurfaceDescriptionInputs IN) + { + ShaderData d = (ShaderData)0; + d.TBNMatrix = float3x3(IN.WorldSpaceTangent, IN.WorldSpaceBiTangent, IN.WorldSpaceNormal); + d.worldSpaceNormal = IN.WorldSpaceNormal; + d.worldSpaceTangent = IN.WorldSpaceTangent; + + d.worldSpacePosition = IN.WorldSpacePosition; + d.texcoord0 = IN.uv0.xyxy; + d.screenPos = IN.ScreenPosition; + + d.worldSpaceViewDir = normalize(_WorldSpaceCameraPos - d.worldSpacePosition); + + d.tangentSpaceViewDir = mul(d.TBNMatrix, d.worldSpaceViewDir); + + // these rarely get used, so we back transform them. Usually will be stripped. + #if _HDRP + // d.localSpacePosition = mul(GetWorldToObjectMatrix(), float4(GetCameraRelativePositionWS(d.worldSpacePosition), 1)).xyz; + #else + // d.localSpacePosition = mul(GetWorldToObjectMatrix(), float4(d.worldSpacePosition, 1)).xyz; + #endif + // d.localSpaceNormal = normalize(mul((float3x3)GetWorldToObjectMatrix(), d.worldSpaceNormal)); + // d.localSpaceTangent = normalize(mul((float3x3)GetWorldToObjectMatrix(), d.worldSpaceTangent.xyz)); + + // #if %SCREENPOSREQUIREKEY% + // d.screenUV = (IN.ScreenPosition.xy / max(0.01, IN.ScreenPosition.w)); + // #endif + + return d; + } +#else + + ShaderData CreateShaderData(VertexToPixel i + #if NEED_FACING + , bool facing + #endif + ) + { + ShaderData d = (ShaderData)0; + d.clipPos = i.pos; + d.worldSpacePosition = i.worldPos; + + d.worldSpaceNormal = normalize(i.worldNormal); + d.worldSpaceTangent.xyz = normalize(i.worldTangent.xyz); + + d.tangentSign = i.worldTangent.w * unity_WorldTransformParams.w; + float3 bitangent = cross(d.worldSpaceTangent.xyz, d.worldSpaceNormal) * d.tangentSign; + + d.TBNMatrix = float3x3(d.worldSpaceTangent, -bitangent, d.worldSpaceNormal); + d.worldSpaceViewDir = normalize(_WorldSpaceCameraPos - i.worldPos); + + d.tangentSpaceViewDir = mul(d.TBNMatrix, d.worldSpaceViewDir); + d.texcoord0 = i.texcoord0; + d.texcoord1 = i.texcoord1; + d.texcoord2 = i.texcoord2; + + // #if %TEXCOORD3REQUIREKEY% + d.texcoord3 = i.texcoord3; + // #endif + + // d.isFrontFace = facing; + // #if %VERTEXCOLORREQUIREKEY% + d.vertexColor = i.vertexColor; + // #endif + + // these rarely get used, so we back transform them. Usually will be stripped. + #if _HDRP + // d.localSpacePosition = mul(GetWorldToObjectMatrix(), float4(GetCameraRelativePositionWS(i.worldPos), 1)).xyz; + #else + // d.localSpacePosition = mul(GetWorldToObjectMatrix(), float4(i.worldPos, 1)).xyz; + #endif + // d.localSpaceNormal = normalize(mul((float3x3)GetWorldToObjectMatrix(), i.worldNormal)); + // d.localSpaceTangent = normalize(mul((float3x3)GetWorldToObjectMatrix(), i.worldTangent.xyz)); + + // #if %SCREENPOSREQUIREKEY% + // d.screenPos = i.screenPos; + // d.screenUV = (i.screenPos.xy / i.screenPos.w); + // #endif + + + // #if %EXTRAV2F0REQUIREKEY% + // d.extraV2F0 = i.extraV2F0; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // d.extraV2F1 = i.extraV2F1; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // d.extraV2F2 = i.extraV2F2; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // d.extraV2F3 = i.extraV2F3; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // d.extraV2F4 = i.extraV2F4; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // d.extraV2F5 = i.extraV2F5; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // d.extraV2F6 = i.extraV2F6; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // d.extraV2F7 = i.extraV2F7; + // #endif + + return d; + } + +#endif + + + #if defined(_PASSSHADOW) + float3 _LightDirection; + float3 _LightPosition; + #endif + + // vertex shader + VertexToPixel Vert (VertexData v) + { + + VertexToPixel o = (VertexToPixel)0; + + UNITY_SETUP_INSTANCE_ID(v); + UNITY_TRANSFER_INSTANCE_ID(v, o); + UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o); + + +#if !_TESSELLATION_ON + ChainModifyVertex(v, o, _Time); +#endif + + o.texcoord0 = v.texcoord0; + o.texcoord1 = v.texcoord1; + o.texcoord2 = v.texcoord2; + + // #if %TEXCOORD3REQUIREKEY% + o.texcoord3 = v.texcoord3; + // #endif + + // #if %VERTEXCOLORREQUIREKEY% + o.vertexColor = v.vertexColor; + // #endif + + VertexPositionInputs vertexInput = GetVertexPositionInputs(v.vertex.xyz); + o.worldPos = TransformObjectToWorld(v.vertex.xyz); + o.worldNormal = TransformObjectToWorldNormal(v.normal); + o.worldTangent = float4(TransformObjectToWorldDir(v.tangent.xyz), v.tangent.w); + + // For some very odd reason, in 2021.2, we can't use Unity's defines, but have to use our own.. + #if _PASSSHADOW + #if _CASTING_PUNCTUAL_LIGHT_SHADOW + float3 lightDirectionWS = normalize(_LightPosition - o.worldPos); + #else + float3 lightDirectionWS = _LightDirection; + #endif + // Define shadow pass specific clip position for Universal + o.pos = TransformWorldToHClip(ApplyShadowBias(o.worldPos, o.worldNormal, lightDirectionWS)); + #if UNITY_REVERSED_Z + o.pos.z = min(o.pos.z, UNITY_NEAR_CLIP_VALUE); + #else + o.pos.z = max(o.pos.z, UNITY_NEAR_CLIP_VALUE); + #endif + #elif _PASSMETA + o.pos = MetaVertexPosition(float4(v.vertex.xyz, 0), v.texcoord1.xy, v.texcoord2.xy, unity_LightmapST, unity_DynamicLightmapST); + #else + o.pos = TransformWorldToHClip(o.worldPos); + #endif + + // #if %SCREENPOSREQUIREKEY% + // o.screenPos = ComputeScreenPos(o.pos, _ProjectionParams.x); + // #endif + + #if _PASSFORWARD || _PASSGBUFFER + float2 uv1 = v.texcoord1.xy; + OUTPUT_LIGHTMAP_UV(uv1, unity_LightmapST, o.lightmapUV); + o.texcoord1.xy = uv1; + OUTPUT_SH(o.worldNormal, o.sh); + #if defined(DYNAMICLIGHTMAP_ON) + o.dynamicLightmapUV.xy = v.texcoord2.xy * unity_DynamicLightmapST.xy + unity_DynamicLightmapST.zw; + #endif + #endif + + #ifdef VARYINGS_NEED_FOG_AND_VERTEX_LIGHT + half fogFactor = 0; + #if defined(_FOG_FRAGMENT) + fogFactor = ComputeFogFactor(o.pos.z); + #endif + #if _BAKEDLIT + o.fogFactorAndVertexLight = half4(fogFactor, 0, 0, 0); + #else + half3 vertexLight = VertexLighting(o.worldPos, o.worldNormal); + o.fogFactorAndVertexLight = half4(fogFactor, vertexLight); + #endif + #endif + + #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR) + o.shadowCoord = GetShadowCoord(vertexInput); + #endif + + return o; + } + + + + + // fragment shader + half4 Frag (VertexToPixel IN + #ifdef _DEPTHOFFSET_ON + , out float outputDepth : SV_Depth + #endif + #if NEED_FACING + , bool facing : SV_IsFrontFace + #endif + ) : SV_Target + { + UNITY_SETUP_INSTANCE_ID(IN); + + #if defined(LOD_FADE_CROSSFADE) + LODFadeCrossFade(IN.pos); + #endif + + ShaderData d = CreateShaderData(IN + #if NEED_FACING + , facing + #endif + ); + Surface l = (Surface)0; + + #ifdef _DEPTHOFFSET_ON + l.outputDepth = outputDepth; + #endif + + l.Albedo = half3(0.5, 0.5, 0.5); + l.Normal = float3(0,0,1); + l.Occlusion = 1; + l.Alpha = 1; + + ChainSurfaceFunction(l, d); + + #ifdef _DEPTHOFFSET_ON + outputDepth = l.outputDepth; + #endif + + return 0; + + } + + ENDHLSL + + } + + + + Pass + { + Name "DepthOnly" + Tags + { + "LightMode" = "DepthOnly" + } + + // Render State + Blend One Zero, One Zero + Cull Back + ZTest LEqual + ZWrite On + ColorMask 0 + + Tags { "RenderType" = "Opaque" "Queue" = "Geometry" "PreviewType" = "Plane" } + Cull [_CullingOption] + ZWrite [_ZWrite] + ZTest [_ZTestMode] + + + HLSLPROGRAM + + #pragma vertex Vert + #pragma fragment Frag + + + #define _PASSDEPTH 1 + + #pragma target 3.0 + #pragma prefer_hlslcc gles + #pragma exclude_renderers d3d11_9x + #pragma multi_compile_instancing + #pragma multi_compile _ DOTS_INSTANCING_ON + + + #pragma shader_feature_local GLOW_ON + #pragma shader_feature_local FADE_ON + #pragma shader_feature_local OUTBASE_ON + #pragma shader_feature_local ONLYOUTLINE_ON + #pragma shader_feature_local GRADIENT_ON + #pragma shader_feature_local GRADIENT2COL_ON + #pragma shader_feature_local RADIALGRADIENT_ON + #pragma shader_feature_local COLORSWAP_ON + #pragma shader_feature_local HSV_ON + #pragma shader_feature_local CHANGECOLOR_ON + #pragma shader_feature_local CHANGECOLOR2_ON + #pragma shader_feature_local CHANGECOLOR3_ON + #pragma shader_feature_local COLORRAMP_ON + #pragma shader_feature_local GRADIENTCOLORRAMP_ON + #pragma shader_feature_local HITEFFECT_ON + #pragma shader_feature_local NEGATIVE_ON + #pragma shader_feature_local PIXELATE_ON + #pragma shader_feature_local GREYSCALE_ON + #pragma shader_feature_local POSTERIZE_ON + #pragma shader_feature_local BLUR_ON + #pragma shader_feature_local MOTIONBLUR_ON + #pragma shader_feature_local GHOST_ON + #pragma shader_feature_local ALPHAOUTLINE_ON + #pragma shader_feature_local INNEROUTLINE_ON + #pragma shader_feature_local ONLYINNEROUTLINE_ON + #pragma shader_feature_local HOLOGRAM_ON + #pragma shader_feature_local CHROMABERR_ON + #pragma shader_feature_local GLITCH_ON + #pragma shader_feature_local FLICKER_ON + #pragma shader_feature_local SHADOW_ON + #pragma shader_feature_local SHINE_ON + #pragma shader_feature_local CONTRAST_ON + #pragma shader_feature_local OVERLAY_ON + #pragma shader_feature_local OVERLAYMULT_ON + #pragma shader_feature_local DOODLE_ON + #pragma shader_feature_local WIND_ON + #pragma shader_feature_local WAVEUV_ON + #pragma shader_feature_local ROUNDWAVEUV_ON + #pragma shader_feature_local RECTSIZE_ON + #pragma shader_feature_local OFFSETUV_ON + #pragma shader_feature_local CLIPPING_ON + #pragma shader_feature_local RADIALCLIPPING_ON + #pragma shader_feature_local TEXTURESCROLL_ON + #pragma shader_feature_local ZOOMUV_ON + #pragma shader_feature_local DISTORT_ON + #pragma shader_feature_local WARP_ON + #pragma shader_feature_local TWISTUV_ON + #pragma shader_feature_local ROTATEUV_ON + #pragma shader_feature_local POLARUV_ON + #pragma shader_feature_local FISHEYE_ON + #pragma shader_feature_local PINCH_ON + #pragma shader_feature_local SHAKEUV_ON + + #pragma shader_feature_local GLOWTEX_ON + #pragma shader_feature_local OUTTEX_ON + #pragma shader_feature_local OUTDIST_ON + #pragma shader_feature_local OUTBASE8DIR_ON + #pragma shader_feature_local OUTBASEPIXELPERF_ON + #pragma shader_feature_local COLORRAMPOUTLINE_ON + #pragma shader_feature_local GREYSCALEOUTLINE_ON + #pragma shader_feature_local POSTERIZEOUTLINE_ON + #pragma shader_feature_local BLURISHD_ON + #pragma shader_feature_local MANUALWIND_ON + #pragma shader_feature_local ATLAS_ON + #pragma shader_feature_local PREMULTIPLYALPHA_ON + + #pragma shader_feature BILBOARD_ON + #pragma shader_feature BILBOARDY_ON + + #pragma shader_feature NORMALMAP_ON + + + #define _URP 1 +#define _USINGTEXCOORD1 1 +#define _USINGTEXCOORD2 1 + + // Includes + #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Version.hlsl" + #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Color.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.universal/ShaderLibrary/ShaderGraphFunctions.hlsl" + #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/TextureStack.hlsl" + #include "Packages/com.unity.shadergraph/ShaderGraphLibrary/ShaderVariablesFunctions.hlsl" + + + #undef WorldNormalVector + #define WorldNormalVector(data, normal) mul(normal, data.TBNMatrix) + + #define UnityObjectToWorldNormal(normal) mul(GetObjectToWorldMatrix(), normal) + + #define _WorldSpaceLightPos0 _MainLightPosition + + #define UNITY_DECLARE_TEX2D(name) TEXTURE2D(name); SAMPLER(sampler##name); + #define UNITY_DECLARE_TEX2D_NOSAMPLER(name) TEXTURE2D(name); + #define UNITY_DECLARE_TEX2DARRAY(name) TEXTURE2D_ARRAY(name); SAMPLER(sampler##name); + #define UNITY_DECLARE_TEX2DARRAY_NOSAMPLER(name) TEXTURE2D_ARRAY(name); + + #define UNITY_SAMPLE_TEX2DARRAY(tex,coord) SAMPLE_TEXTURE2D_ARRAY(tex, sampler##tex, coord.xy, coord.z) + #define UNITY_SAMPLE_TEX2DARRAY_LOD(tex,coord,lod) SAMPLE_TEXTURE2D_ARRAY_LOD(tex, sampler##tex, coord.xy, coord.z, lod) + #define UNITY_SAMPLE_TEX2D(tex, coord) SAMPLE_TEXTURE2D(tex, sampler##tex, coord) + #define UNITY_SAMPLE_TEX2D_SAMPLER(tex, samp, coord) SAMPLE_TEXTURE2D(tex, sampler##samp, coord) + + #define UNITY_SAMPLE_TEX2D_LOD(tex,coord, lod) SAMPLE_TEXTURE2D_LOD(tex, sampler_##tex, coord, lod) + #define UNITY_SAMPLE_TEX2D_SAMPLER_LOD(tex,samplertex,coord, lod) SAMPLE_TEXTURE2D_LOD (tex, sampler##samplertex,coord, lod) + + #if defined(UNITY_COMPILER_HLSL) + #define UNITY_INITIALIZE_OUTPUT(type,name) name = (type)0; + #else + #define UNITY_INITIALIZE_OUTPUT(type,name) + #endif + + #define sampler2D_float sampler2D + #define sampler2D_half sampler2D + + + + // data across stages, stripped like the above. + struct VertexToPixel + { + float4 pos : SV_POSITION; + float3 worldPos : TEXCOORD0; + float3 worldNormal : TEXCOORD1; + float4 worldTangent : TEXCOORD2; + float4 texcoord0 : TEXCOORD3; + float4 texcoord1 : TEXCOORD4; + float4 texcoord2 : TEXCOORD5; + + // #if %TEXCOORD3REQUIREKEY% + float4 texcoord3 : TEXCOORD6; + // #endif + + // #if %SCREENPOSREQUIREKEY% + // float4 screenPos : TEXCOORD7; + // #endif + + // #if %VERTEXCOLORREQUIREKEY% + half4 vertexColor : COLOR; + // #endif + + #if defined(LIGHTMAP_ON) + float2 lightmapUV : TEXCOORD8; + #endif + #if defined(DYNAMICLIGHTMAP_ON) + float2 dynamicLightmapUV : TEXCOORD9; + #endif + #if !defined(LIGHTMAP_ON) + float3 sh : TEXCOORD10; + #endif + + #if defined(VARYINGS_NEED_FOG_AND_VERTEX_LIGHT) + float4 fogFactorAndVertexLight : TEXCOORD11; + #endif + + #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR) + float4 shadowCoord : TEXCOORD12; + #endif + + // #if %EXTRAV2F0REQUIREKEY% + // float4 extraV2F0 : TEXCOORD13; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // float4 extraV2F1 : TEXCOORD14; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // float4 extraV2F2 : TEXCOORD15; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // float4 extraV2F3 : TEXCOORD16; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // float4 extraV2F4 : TEXCOORD17; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // float4 extraV2F5 : TEXCOORD18; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // float4 extraV2F6 : TEXCOORD19; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // float4 extraV2F7 : TEXCOORD20; + // #endif + + #if UNITY_ANY_INSTANCING_ENABLED + uint instanceID : CUSTOM_INSTANCE_ID; + #endif + #if (defined(UNITY_STEREO_MULTIVIEW_ENABLED)) || (defined(UNITY_STEREO_INSTANCING_ENABLED) && (defined(SHADER_API_GLES3) || defined(SHADER_API_GLCORE))) + uint stereoTargetEyeIndexAsBlendIdx0 : BLENDINDICES0; + #endif + #if (defined(UNITY_STEREO_INSTANCING_ENABLED)) + uint stereoTargetEyeIndexAsRTArrayIdx : SV_RenderTargetArrayIndex; + #endif + #if defined(SHADER_STAGE_FRAGMENT) && defined(VARYINGS_NEED_CULLFACE) + FRONT_FACE_TYPE cullFace : FRONT_FACE_SEMANTIC; + #endif + + + }; + + + + + // data describing the user output of a pixel + struct Surface + { + half3 Albedo; + half Height; + half3 Normal; + half Smoothness; + half3 Emission; + half Metallic; + half3 Specular; + half Occlusion; + half SpecularPower; // for simple lighting + half Alpha; + float outputDepth; // if written, SV_Depth semantic is used. ShaderData.clipPos.z is unused value + // HDRP Only + half SpecularOcclusion; + half SubsurfaceMask; + half Thickness; + half CoatMask; + half CoatSmoothness; + half Anisotropy; + half IridescenceMask; + half IridescenceThickness; + int DiffusionProfileHash; + float SpecularAAThreshold; + float SpecularAAScreenSpaceVariance; + // requires _OVERRIDE_BAKEDGI to be defined, but is mapped in all pipelines + float3 DiffuseGI; + float3 BackDiffuseGI; + float3 SpecularGI; + float ior; + float3 transmittanceColor; + float atDistance; + float transmittanceMask; + // requires _OVERRIDE_SHADOWMASK to be defines + float4 ShadowMask; + + // for decals + float NormalAlpha; + float MAOSAlpha; + + + }; + + // Data the user declares in blackboard blocks + struct Blackboard + { + + float blackboardDummyData; + }; + + // data the user might need, this will grow to be big. But easy to strip + struct ShaderData + { + float4 clipPos; // SV_POSITION + float3 localSpacePosition; + float3 localSpaceNormal; + float3 localSpaceTangent; + + float3 worldSpacePosition; + float3 worldSpaceNormal; + float3 worldSpaceTangent; + float tangentSign; + + float3 worldSpaceViewDir; + float3 tangentSpaceViewDir; + + float4 texcoord0; + float4 texcoord1; + float4 texcoord2; + float4 texcoord3; + + float2 screenUV; + float4 screenPos; + + float4 vertexColor; + bool isFrontFace; + + float4 extraV2F0; + float4 extraV2F1; + float4 extraV2F2; + float4 extraV2F3; + float4 extraV2F4; + float4 extraV2F5; + float4 extraV2F6; + float4 extraV2F7; + + float3x3 TBNMatrix; + Blackboard blackboard; + }; + + struct VertexData + { + #if SHADER_TARGET > 30 + // uint vertexID : SV_VertexID; + #endif + float4 vertex : POSITION; + float3 normal : NORMAL; + float4 tangent : TANGENT; + float4 texcoord0 : TEXCOORD0; + + // optimize out mesh coords when not in use by user or lighting system + #if _URP && (_USINGTEXCOORD1 || _PASSMETA || _PASSFORWARD || _PASSGBUFFER) + float4 texcoord1 : TEXCOORD1; + #endif + + #if _URP && (_USINGTEXCOORD2 || _PASSMETA || ((_PASSFORWARD || _PASSGBUFFER) && defined(DYNAMICLIGHTMAP_ON))) + float4 texcoord2 : TEXCOORD2; + #endif + + #if _STANDARD && (_USINGTEXCOORD1 || (_PASSMETA || ((_PASSFORWARD || _PASSGBUFFER || _PASSFORWARDADD) && LIGHTMAP_ON))) + float4 texcoord1 : TEXCOORD1; + #endif + #if _STANDARD && (_USINGTEXCOORD2 || (_PASSMETA || ((_PASSFORWARD || _PASSGBUFFER) && DYNAMICLIGHTMAP_ON))) + float4 texcoord2 : TEXCOORD2; + #endif + + + #if _HDRP + float4 texcoord1 : TEXCOORD1; + float4 texcoord2 : TEXCOORD2; + #endif + + // #if %TEXCOORD3REQUIREKEY% + float4 texcoord3 : TEXCOORD3; + // #endif + + // #if %VERTEXCOLORREQUIREKEY% + float4 vertexColor : COLOR; + // #endif + + #if _PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR)) + float3 previousPositionOS : TEXCOORD4; // Contain previous transform position (in case of skinning for example) + #if defined (_ADD_PRECOMPUTED_VELOCITY) + float3 precomputedVelocity : TEXCOORD5; // Add Precomputed Velocity (Alembic computes velocities on runtime side). + #endif + #endif + + UNITY_VERTEX_INPUT_INSTANCE_ID + }; + + struct TessVertex + { + float4 vertex : INTERNALTESSPOS; + float3 normal : NORMAL; + float4 tangent : TANGENT; + float4 texcoord0 : TEXCOORD0; + float4 texcoord1 : TEXCOORD1; + float4 texcoord2 : TEXCOORD2; + + // #if %TEXCOORD3REQUIREKEY% + float4 texcoord3 : TEXCOORD3; + // #endif + + // #if %VERTEXCOLORREQUIREKEY% + float4 vertexColor : COLOR; + // #endif + + // #if %EXTRAV2F0REQUIREKEY% + // float4 extraV2F0 : TEXCOORD5; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // float4 extraV2F1 : TEXCOORD6; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // float4 extraV2F2 : TEXCOORD7; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // float4 extraV2F3 : TEXCOORD8; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // float4 extraV2F4 : TEXCOORD9; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // float4 extraV2F5 : TEXCOORD10; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // float4 extraV2F6 : TEXCOORD11; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // float4 extraV2F7 : TEXCOORD12; + // #endif + + #if _PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR)) + float3 previousPositionOS : TEXCOORD13; // Contain previous transform position (in case of skinning for example) + #if defined (_ADD_PRECOMPUTED_VELOCITY) + float3 precomputedVelocity : TEXCOORD14; + #endif + #endif + + UNITY_VERTEX_INPUT_INSTANCE_ID + UNITY_VERTEX_OUTPUT_STEREO + }; + + struct ExtraV2F + { + float4 extraV2F0; + float4 extraV2F1; + float4 extraV2F2; + float4 extraV2F3; + float4 extraV2F4; + float4 extraV2F5; + float4 extraV2F6; + float4 extraV2F7; + Blackboard blackboard; + float4 time; + }; + + + float3 WorldToTangentSpace(ShaderData d, float3 normal) + { + return mul(d.TBNMatrix, normal); + } + + float3 TangentToWorldSpace(ShaderData d, float3 normal) + { + return mul(normal, d.TBNMatrix); + } + + // in this case, make standard more like SRPs, because we can't fix + // unity_WorldToObject in HDRP, since it already does macro-fu there + + #if _STANDARD + float3 TransformWorldToObject(float3 p) { return mul(unity_WorldToObject, float4(p, 1)); }; + float3 TransformObjectToWorld(float3 p) { return mul(unity_ObjectToWorld, float4(p, 1)); }; + float4 TransformWorldToObject(float4 p) { return mul(unity_WorldToObject, p); }; + float4 TransformObjectToWorld(float4 p) { return mul(unity_ObjectToWorld, p); }; + float4x4 GetWorldToObjectMatrix() { return unity_WorldToObject; } + float4x4 GetObjectToWorldMatrix() { return unity_ObjectToWorld; } + #if (defined(SHADER_API_D3D11) || defined(SHADER_API_XBOXONE) || defined(UNITY_COMPILER_HLSLCC) || defined(SHADER_API_PSSL) || (SHADER_TARGET_SURFACE_ANALYSIS && !SHADER_TARGET_SURFACE_ANALYSIS_MOJOSHADER)) + #define UNITY_SAMPLE_TEX2D_LOD(tex,coord, lod) tex.SampleLevel (sampler##tex,coord, lod) + #define UNITY_SAMPLE_TEX2D_SAMPLER_LOD(tex,samplertex,coord, lod) tex.SampleLevel (sampler##samplertex,coord, lod) + #else + #define UNITY_SAMPLE_TEX2D_LOD(tex,coord,lod) tex2D (tex,coord,0,lod) + #define UNITY_SAMPLE_TEX2D_SAMPLER_LOD(tex,samplertex,coord,lod) tex2D (tex,coord,0,lod) + #endif + + #undef GetWorldToObjectMatrix() + + #define GetWorldToObjectMatrix() unity_WorldToObject + + + #endif + + float3 GetCameraWorldPosition() + { + #if _HDRP + return GetCameraRelativePositionWS(_WorldSpaceCameraPos); + #else + return _WorldSpaceCameraPos; + #endif + } + + #if _GRABPASSUSED + #if _STANDARD + TEXTURE2D(%GRABTEXTURE%); + SAMPLER(sampler_%GRABTEXTURE%); + #endif + + half3 GetSceneColor(float2 uv) + { + #if _STANDARD + return SAMPLE_TEXTURE2D(%GRABTEXTURE%, sampler_%GRABTEXTURE%, uv).rgb; + #else + return SHADERGRAPH_SAMPLE_SCENE_COLOR(uv); + #endif + } + #endif + + + + #if _STANDARD + UNITY_DECLARE_DEPTH_TEXTURE(_CameraDepthTexture); + float GetSceneDepth(float2 uv) { return SAMPLE_DEPTH_TEXTURE(_CameraDepthTexture, uv); } + float GetLinear01Depth(float2 uv) { return Linear01Depth(GetSceneDepth(uv)); } + float GetLinearEyeDepth(float2 uv) { return LinearEyeDepth(GetSceneDepth(uv)); } + #else + float GetSceneDepth(float2 uv) { return SHADERGRAPH_SAMPLE_SCENE_DEPTH(uv); } + float GetLinear01Depth(float2 uv) { return Linear01Depth(GetSceneDepth(uv), _ZBufferParams); } + float GetLinearEyeDepth(float2 uv) { return LinearEyeDepth(GetSceneDepth(uv), _ZBufferParams); } + #endif + + float3 GetWorldPositionFromDepthBuffer(float2 uv, float3 worldSpaceViewDir) + { + float eye = GetLinearEyeDepth(uv); + float3 camView = mul((float3x3)GetObjectToWorldMatrix(), transpose(mul(GetWorldToObjectMatrix(), UNITY_MATRIX_I_V)) [2].xyz); + + float dt = dot(worldSpaceViewDir, camView); + float3 div = worldSpaceViewDir/dt; + float3 wpos = (eye * div) + GetCameraWorldPosition(); + return wpos; + } + + #if _HDRP + float3 ObjectToWorldSpacePosition(float3 pos) + { + return GetAbsolutePositionWS(TransformObjectToWorld(pos)); + } + #else + float3 ObjectToWorldSpacePosition(float3 pos) + { + return TransformObjectToWorld(pos); + } + #endif + + #if _STANDARD + UNITY_DECLARE_SCREENSPACE_TEXTURE(_CameraDepthNormalsTexture); + float3 GetSceneNormal(float2 uv, float3 worldSpaceViewDir) + { + float4 depthNorms = UNITY_SAMPLE_SCREENSPACE_TEXTURE(_CameraDepthNormalsTexture, uv); + float3 norms = DecodeViewNormalStereo(depthNorms); + norms = mul((float3x3)GetWorldToViewMatrix(), norms) * 0.5 + 0.5; + return norms; + } + #elif _HDRP && !_DECALSHADER + + float3 GetSceneNormal(float2 uv, float3 worldSpaceViewDir) + { + NormalData nd; + DecodeFromNormalBuffer(_ScreenSize.xy * uv, nd); + return nd.normalWS; + } + #elif _URP + #if (SHADER_LIBRARY_VERSION_MAJOR >= 10) + #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/DeclareNormalsTexture.hlsl" + #endif + + float3 GetSceneNormal(float2 uv, float3 worldSpaceViewDir) + { + #if (SHADER_LIBRARY_VERSION_MAJOR >= 10) + return SampleSceneNormals(uv); + #else + float3 wpos = GetWorldPositionFromDepthBuffer(uv, worldSpaceViewDir); + return normalize(-cross(ddx(wpos), ddy(wpos))) * 0.5 + 0.5; + #endif + + } + #endif + + #if _HDRP + + half3 UnpackNormalmapRGorAG(half4 packednormal) + { + // This do the trick + packednormal.x *= packednormal.w; + + half3 normal; + normal.xy = packednormal.xy * 2 - 1; + normal.z = sqrt(1 - saturate(dot(normal.xy, normal.xy))); + return normal; + } + half3 UnpackNormal(half4 packednormal) + { + #if defined(UNITY_NO_DXT5nm) + return packednormal.xyz * 2 - 1; + #else + return UnpackNormalmapRGorAG(packednormal); + #endif + } + #endif + #if _HDRP || _URP + + half3 UnpackScaleNormal(half4 packednormal, half scale) + { + #ifndef UNITY_NO_DXT5nm + // Unpack normal as DXT5nm (1, y, 1, x) or BC5 (x, y, 0, 1) + // Note neutral texture like "bump" is (0, 0, 1, 1) to work with both plain RGB normal and DXT5nm/BC5 + packednormal.x *= packednormal.w; + #endif + half3 normal; + normal.xy = (packednormal.xy * 2 - 1) * scale; + normal.z = sqrt(1 - saturate(dot(normal.xy, normal.xy))); + return normal; + } + + #endif + + + void GetSun(out float3 lightDir, out float3 color) + { + lightDir = float3(0.5, 0.5, 0); + color = 1; + #if _HDRP + if (_DirectionalLightCount > 0) + { + DirectionalLightData light = _DirectionalLightDatas[0]; + lightDir = -light.forward.xyz; + color = light.color; + } + #elif _STANDARD + lightDir = normalize(_WorldSpaceLightPos0.xyz); + color = _LightColor0.rgb; + #elif _URP + Light light = GetMainLight(); + lightDir = light.direction; + color = light.color; + #endif + } + + + + CBUFFER_START(UnityPerMaterial) + + + half4 _Color; + half4 _MainTex_ST, _MainTex_TexelSize; + half _Alpha, _AlphaCutoffValue; + + #if ATLAS_ON + half _MinXUV, _MaxXUV, _MinYUV, _MaxYUV; + #endif + + #if GLOW_ON + half4 _GlowColor; + half _Glow, _GlowGlobal; + #endif + + #if HSV_ON + half _HsvShift, _HsvSaturation, _HsvBright; + #endif + + #if DISTORT_ON + half4 _DistortTex_ST; + half _DistortTexXSpeed, _DistortTexYSpeed, _DistortAmount; + #endif + + #if FADE_ON + half4 _FadeBurnColor, _FadeTex_ST, _FadeBurnTex_ST; + half _FadeAmount, _FadeBurnWidth, _FadeBurnTransition,_FadeBurnGlow; + #endif + + #if OUTBASE_ON + half4 _OutlineColor; + half _OutlineAlpha, _OutlineGlow, _OutlineWidth; + int _OutlinePixelWidth; + #endif + + #if OUTTEX_ON + half4 _OutlineTex_ST; + half _OutlineTexXSpeed, _OutlineTexYSpeed; + #endif + + #if OUTDIST_ON + half4 _OutlineDistortTex_ST; + half _OutlineDistortTexXSpeed, _OutlineDistortTexYSpeed, _OutlineDistortAmount; + #endif + + #if ALPHAOUTLINE_ON + half _AlphaOutlineGlow, _AlphaOutlinePower, _AlphaOutlineMinAlpha, _AlphaOutlineBlend; + half4 _AlphaOutlineColor; + #endif + + #if INNEROUTLINE_ON + half _InnerOutlineThickness, _InnerOutlineAlpha, _InnerOutlineGlow; + half4 _InnerOutlineColor; + #endif + + #if GRADIENT_ON + half _GradBlend, _GradBoostX, _GradBoostY; + half4 _GradTopRightCol, _GradTopLeftCol, _GradBotRightCol, _GradBotLeftCol; + #endif + + #if COLORSWAP_ON + half4 _ColorSwapRed, _ColorSwapGreen, _ColorSwapBlue; + half _ColorSwapRedLuminosity, _ColorSwapGreenLuminosity, _ColorSwapBlueLuminosity, _ColorSwapBlend; + #endif + + #if CHANGECOLOR_ON + half4 _ColorChangeNewCol, _ColorChangeTarget; + half _ColorChangeTolerance, _ColorChangeLuminosity; + #endif + #if CHANGECOLOR2_ON + half4 _ColorChangeNewCol2, _ColorChangeTarget2; + half _ColorChangeTolerance2; + #endif + #if CHANGECOLOR3_ON + half4 _ColorChangeNewCol3, _ColorChangeTarget3; + half _ColorChangeTolerance3; + #endif + + #if COLORRAMP_ON + half _ColorRampLuminosity, _ColorRampBlend; + #endif + + #if HITEFFECT_ON + half4 _HitEffectColor; + half _HitEffectGlow, _HitEffectBlend; + #endif + + #if NEGATIVE_ON + half _NegativeAmount; + #endif + + #if PIXELATE_ON + half _PixelateSize; + #endif + + #if GREYSCALE_ON + half _GreyscaleLuminosity, _GreyscaleBlend; + half4 _GreyscaleTintColor; + #endif + + #if POSTERIZE_ON + half _PosterizeNumColors, _PosterizeGamma; + #endif + + #if BLUR_ON + half _BlurIntensity; + #endif + + #if MOTIONBLUR_ON + half _MotionBlurAngle, _MotionBlurDist; + #endif + + #if GHOST_ON + half _GhostColorBoost, _GhostTransparency, _GhostBlend; + #endif + + #if HOLOGRAM_ON + half _HologramStripesAmount, _HologramMinAlpha, _HologramUnmodAmount, _HologramStripesSpeed, _HologramMaxAlpha, _HologramBlend; + half4 _HologramStripeColor; + #endif + + #if CHROMABERR_ON + half _ChromAberrAmount, _ChromAberrAlpha; + #endif + + #if GLITCH_ON + half _GlitchAmount, _GlitchSize; + #endif + + #if FLICKER_ON + half _FlickerFreq, _FlickerPercent, _FlickerAlpha; + #endif + + #if SHADOW_ON + half _ShadowX, _ShadowY, _ShadowAlpha; + half4 _ShadowColor; + #endif + + #if SHINE_ON + half4 _ShineColor; + half _ShineLocation, _ShineRotate, _ShineWidth, _ShineGlow; + #endif + + #if CONTRAST_ON + half _Contrast, _Brightness; + #endif + + #if OVERLAY_ON + half4 _OverlayTex_ST, _OverlayColor; + half _OverlayGlow, _OverlayBlend, _OverlayTextureScrollXSpeed, _OverlayTextureScrollYSpeed; + #endif + + #if DOODLE_ON + half _HandDrawnAmount, _HandDrawnSpeed; + #endif + + #if WIND_ON + half _GrassSpeed, _GrassWind, _GrassManualAnim, _GrassRadialBend; + #endif + + #if WAVEUV_ON + float _WaveAmount, _WaveSpeed, _WaveStrength, _WaveX, _WaveY; + #endif + + #if ROUNDWAVEUV_ON + half _RoundWaveStrength, _RoundWaveSpeed; + #endif + + #if RECTSIZE_ON + half _RectSize; + #endif + + #if OFFSETUV_ON + half _OffsetUvX, _OffsetUvY; + #endif + + #if CLIPPING_ON + half _ClipUvLeft, _ClipUvRight, _ClipUvUp, _ClipUvDown; + #endif + + #if RADIALCLIPPING_ON + half _RadialStartAngle, _RadialClip, _RadialClip2; + #endif + + #if TEXTURESCROLL_ON + half _TextureScrollXSpeed, _TextureScrollYSpeed; + #endif + + #if ZOOMUV_ON + half _ZoomUvAmount; + #endif + + #if WARP_ON + half _WarpStrength, _WarpSpeed, _WarpScale; + #endif + + #if TWISTUV_ON + half _TwistUvAmount, _TwistUvPosX, _TwistUvPosY, _TwistUvRadius; + #endif + + #if ROTATEUV_ON + half _RotateUvAmount; + #endif + + #if FISHEYE_ON + half _FishEyeUvAmount; + #endif + + #if PINCH_ON + half _PinchUvAmount; + #endif + + #if SHAKEUV_ON + half _ShakeUvSpeed, _ShakeUvX, _ShakeUvY; + #endif + + #if NORMALMAP_ON + half _NormalStrength; + #endif + + float _RandomSeed; + + + + + CBUFFER_END + + + + + + + + TEXTURE2D(_MainTex); + SAMPLER(sampler_MainTex); + + #if GLOW_ON + TEXTURE2D(_GlowTex); + SAMPLER(sampler_GlowTex); + #endif + + #if FADE_ON + TEXTURE2D(_FadeTex); + SAMPLER(sampler_FadeTex); + + TEXTURE2D(_FadeBurnTex); + SAMPLER(sampler_FadeBurnTex); + #endif + + #if DISTORT_ON + TEXTURE2D(_DistortTex); + SAMPLER(sampler_DistortTex); + #endif + + #if OUTTEX_ON + TEXTURE2D(_OutlineTex); + SAMPLER(sampler_OutlineTex); + #endif + + #if OUTDIST_ON + TEXTURE2D(_OutlineDistortTex); + SAMPLER(sampler_OutlineDistortTex); + #endif + + #if COLORSWAP_ON + TEXTURE2D(_ColorSwapTex); + SAMPLER(sampler_ColorSwapTex); + #endif + + #if COLORRAMP_ON + TEXTURE2D(_ColorRampTex); + TEXTURE2D(_ColorRampTexGradient); + SAMPLER(sampler_ColorRampTex); + SAMPLER(sampler_ColorRampTexGradient); + #endif + + #if SHINE_ON + TEXTURE2D(_ShineMask); + SAMPLER(sampler_ShineMask); + #endif + + #if OVERLAY_ON + TEXTURE2D(_OverlayTex); + SAMPLER(sampler_OverlayTex); + #endif + + #if NORMALMAP_ON + TEXTURE2D(_NormalMap); + SAMPLER(sampler_NormalMap); + #endif + + + half3 GetPixel(in int offsetX, in int offsetY, in half2 uv, in Texture2D _tex, in SamplerState _sampler) + { + half2 _uv = uv + half2(offsetX * _MainTex_TexelSize.x, offsetY * _MainTex_TexelSize.y); + half4 col = SAMPLE_TEXTURE2D(_tex, _sampler, _uv); + return col.rgb; + } + + + //BLURS------------------------------------------------------------------------- + half4 Blur(half2 uv, Texture2D source, SamplerState sampler_source, half Intensity) + { + const half2 texelSize = 1.0 / _ScreenParams.xy; + const half4 color = SAMPLE_TEXTURE2D(source, sampler_source, uv); + const half2 offset = Intensity * texelSize; + + half4 accumulatedColor = color; + half accumulatedWeight = 1.0; + for (int x = -1; x <= 1; x++) + { + for (int y = -1; y <= 1; y++) + { + const half2 sampleUV = uv + half2(x, y) * offset; + const half4 sampleColor = SAMPLE_TEXTURE2D(source, sampler_source, sampleUV); + + accumulatedColor += sampleColor; + accumulatedWeight += 1.0; + } + } + + half4 blurredColor = accumulatedColor / accumulatedWeight; + return blurredColor; + } + + half BlurHD_G(half bhqp, half x) + { + return exp(-(x * x) / (2.0 * bhqp * bhqp)); + } + half4 BlurHD(half2 uv, Texture2D source, SamplerState sampler_source, half BlurAmount, half xScale, half yScale) + { + int iterations = 16; + int halfIterations = iterations / 2; + half sigmaX = 0.1 + BlurAmount * 0.5; + half sigmaY = sigmaX; + half total = 0.0; + half4 ret = half4(0, 0, 0, 0); + for (int iy = 0; iy < iterations; ++iy) + { + half fy = BlurHD_G(sigmaY, half(iy) -half(halfIterations)); + half offsetY = half(iy - halfIterations) * 0.00390625 * xScale; + for (int ix = 0; ix < iterations; ++ix) + { + half fx = BlurHD_G(sigmaX, half(ix) - half(halfIterations)); + half offsetX = half(ix - halfIterations) * 0.00390625 * yScale; + total += fx * fy; + ret += SAMPLE_TEXTURE2D(source, sampler_source, uv + half2(offsetX, offsetY)) * fx * fy; + } + } + return ret / total; + } + //----------------------------------------------------------------------- + + + //------------------------------------------- + half RemapFloat(half inValue, half inMin, half inMax, half outMin, half outMax){ + return outMin + (inValue - inMin) * (outMax - outMin) / (inMax - inMin); + } + //------------------------------------------- + + //----------------------------------------------------------------------- + half rand(half2 seed, half offset) { + return (frac(sin(dot(seed, half2(12.9898, 78.233))) * 43758.5453) + offset) % 1.0; + } + + half rand2(half2 seed, half offset) { + return (frac(sin(dot(seed * floor(50 + (_Time.x % 1.0) * 12.), half2(127.1, 311.7))) * 43758.5453123) + offset) % 1.0; + } + + half rand2CustomTime(half2 seed, half offset, half customTime) { + return (frac(sin(dot(seed * floor(50 + (customTime % 1.0) * 12.), half2(127.1, 311.7))) * 43758.5453123) + offset) % 1.0; + } + //----------------------------------------------------------------------- + + + void Ext_ModifyVertex0 (inout VertexData v, inout ExtraV2F d) + { + //BILBOARD_ON + #if BILBOARD_ON + half3 camRight = mul((half3x3)unity_CameraToWorld, half3(1,0,0)); + half3 camUp = half3(0,1,0); + #if BILBOARDY_ON + camUp = mul((half3x3)unity_CameraToWorld, half3(0,1,0)); + #endif + half3 localPos = v.vertex.x * camRight + v.vertex.y * camUp; + v.vertex = half4(localPos, 1); + #endif + //----------------------------------------------------------- + + v.texcoord0.xy = TRANSFORM_TEX(v.texcoord0.xy, _MainTex); + half2 center = half2(0.5, 0.5); + #if ATLAS_ON + center = half2((_MaxXUV + _MinXUV) / 2.0, (_MaxYUV + _MinYUV) / 2.0); + #endif + + //POLARUV_ON + #if POLARUV_ON + v.texcoord0.xy = v.texcoord0.xy - center; + #endif + + //---------------------------------------- + + //ROTATEUV_ON + #if ROTATEUV_ON + half2 uvC = v.texcoord0.xy; + half cosAngle = cos(_RotateUvAmount); + half sinAngle = sin(_RotateUvAmount); + half2x2 rot = half2x2(cosAngle, -sinAngle, sinAngle, cosAngle); + uvC -= center; + v.texcoord0.xy = mul(rot, uvC); + v.texcoord0.xy += center; + #endif + //-------------------- + + #if RECTSIZE_ON + v.vertex.xyz += (v.vertex.xyz * (_RectSize - 1.0)); + #endif + + #if OUTTEX_ON + v.texcoord1.xy = TRANSFORM_TEX(v.texcoord0.xy, _OutlineTex); + #endif + + #if OUTDIST_ON + v.texcoord2.xy = TRANSFORM_TEX(v.texcoord0.xy, _OutlineDistortTex); + #endif + + #if DISTORT_ON + v.texcoord3.xy = TRANSFORM_TEX(v.texcoord0.xy, _DistortTex); + #endif + } + + void Ext_SurfaceFunction0 (inout Surface o, ShaderData d) + { + half randomSeed = _RandomSeed; + + float2 uvRect = d.texcoord0; + half2 center = half2(0.5, 0.5); + #if ATLAS_ON + center = half2((_MaxXUV + _MinXUV) / 2.0, (_MaxYUV + _MinYUV) / 2.0); + uvRect = half2((d.texcoord0.x - _MinXUV) / (_MaxXUV - _MinXUV), (d.texcoord0.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half2 centerTiled = half2(center.x * _MainTex_ST.x, center.y * _MainTex_ST.y); + + //CLIPPING_ON + #if CLIPPING_ON + half2 tiledUv = half2(d.texcoord0.x / _MainTex_ST.x, d.texcoord0.y / _MainTex_ST.y); + #if ATLAS_ON + tiledUv = half2((tiledUv.x - _MinXUV) / (_MaxXUV - _MinXUV), (tiledUv.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + clip((1 - _ClipUvUp) - tiledUv.y); + clip(tiledUv.y - _ClipUvDown); + clip((1 - _ClipUvRight) - tiledUv.x); + clip(tiledUv.x - _ClipUvLeft); + #endif + //---------------------------------- + + //RADIALCLIPPING_ON + #if RADIALCLIPPING_ON + half2 tiledUv2 = half2(d.texcoord0.x / _MainTex_ST.x, d.texcoord0.y / _MainTex_ST.y); + #if ATLAS_ON + tiledUv2 = half2((tiledUv2.x - _MinXUV) / (_MaxXUV - _MinXUV), (tiledUv2.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half startAngle = _RadialStartAngle - _RadialClip; + half endAngle = _RadialStartAngle + _RadialClip2; + half offset0 = clamp(0, 360, startAngle + 360); + half offset360 = clamp(0, 360, endAngle - 360); + half2 atan2Coord = half2(lerp(-1, 1, tiledUv2.x), lerp(-1, 1, tiledUv2.y)); + half atanAngle = atan2(atan2Coord.y, atan2Coord.x) * 57.3; // angle in degrees + if(atanAngle < 0) atanAngle = 360 + atanAngle; + if(atanAngle >= startAngle && atanAngle <= endAngle) discard; + if(atanAngle <= offset360) discard; + if(atanAngle >= offset0) discard; + #endif + + //----------------------------- + + //TEXTURESCROLL_ON && ATLAS_ON + #if TEXTURESCROLL_ON && ATLAS_ON + d.texcoord0.xy = half2(_MinXUV + ((_MaxXUV - _MinXUV) * (abs(((_Time.y + randomSeed) * _TextureScrollXSpeed) + uvRect.x) % 1)), + _MinYUV + ((_MaxYUV - _MinYUV) * (abs(((_Time.y + randomSeed) * _TextureScrollYSpeed) + uvRect.y) % 1))); + #endif + //---------------------------- + + //OFFSETUV_ON + #if OFFSETUV_ON + #if ATLAS_ON + d.texcoord0.xy = half2(_MinXUV + ((_MaxXUV - _MinXUV) * (abs((_OffsetUvX + uvRect.x) % 1))), + _MinYUV + ((_MaxYUV - _MinYUV) * (abs(_OffsetUvY + uvRect.y) % 1))); + #else + d.texcoord0.xy += half2(_OffsetUvX, _OffsetUvY); + #endif + #endif + + //---------------------- + + //POLARUV_ON + #if POLARUV_ON + d.texcoord0.xy = half2(atan2(d.texcoord0.y, d.texcoord0.x) / (2.0f * 3.141592653589f), length(d.texcoord0.xy)); + d.texcoord0.xy *= _MainTex_ST.xy; + #endif + + //-------------------------------------- + + //TWISTUV_ON + #if TWISTUV_ON + #if ATLAS_ON + _TwistUvPosX = ((_MaxXUV - _MinXUV) * _TwistUvPosX) + _MinXUV; + _TwistUvPosY = ((_MaxYUV - _MinYUV) * _TwistUvPosY) + _MinYUV; + #endif + half2 tempUv = d.texcoord0.xy - half2(_TwistUvPosX * _MainTex_ST.x, _TwistUvPosY * _MainTex_ST.y); + _TwistUvRadius *= (_MainTex_ST.x + _MainTex_ST.y) / 2; + half percent = (_TwistUvRadius - length(tempUv)) / _TwistUvRadius; + half theta = percent * percent * (2.0 * sin(_TwistUvAmount)) * 8.0; + half s = sin(theta); + half c = cos(theta); + half beta = max(sign(_TwistUvRadius - length(tempUv)), 0.0); + tempUv = half2(dot(tempUv, half2(c, -s)), dot(tempUv, half2(s, c))) * beta + tempUv * (1 - beta); + tempUv += half2(_TwistUvPosX * _MainTex_ST.x, _TwistUvPosY * _MainTex_ST.y); + d.texcoord0.xy = tempUv; + #endif + + //-------------------------------------------- + + //FISHEYE_ON + #if FISHEYE_ON + half bind = length(centerTiled); + half2 dF = d.texcoord0.xy - centerTiled; + half dFlen = length(dF); + half fishInt = (3.14159265359 / bind) * (_FishEyeUvAmount + 0.001); + d.texcoord0.xy = centerTiled + (dF / (max(0.0001, dFlen))) * tan(dFlen * fishInt) * bind / tan(bind * fishInt); + #endif + //--------------------------------------------- + + //PINCH_ON + #if PINCH_ON + half2 dP = d.texcoord0.xy - centerTiled; + half pinchInt = (3.141592 / length(centerTiled)) * (-_PinchUvAmount + 0.001); + d.texcoord0.xy = centerTiled + normalize(dP) * atan(length(dP) * -pinchInt * 10.0) * 0.5 / atan(-pinchInt * 5); + #endif + + //--------------------------------------------- + + //ZOOMUV_ON + #if ZOOMUV_ON + d.texcoord0.xy -= centerTiled; + d.texcoord0.xy = d.texcoord0.xy * _ZoomUvAmount; + d.texcoord0.xy += centerTiled; + #endif + + //----------------------------------------------- + + //DOODLE_ON + #if DOODLE_ON + half2 uvCopy = uvRect; + _HandDrawnSpeed = (floor((_Time.x + randomSeed) * 20 * _HandDrawnSpeed) / _HandDrawnSpeed) * _HandDrawnSpeed; + uvCopy.x = sin((uvCopy.x * _HandDrawnAmount + _HandDrawnSpeed) * 4); + uvCopy.y = cos((uvCopy.y * _HandDrawnAmount + _HandDrawnSpeed) * 4); + d.texcoord0.xy = lerp(d.texcoord0.xy, d.texcoord0.xy + uvCopy, 0.0005 * _HandDrawnAmount); + #endif + + //-------------------------- + + //SHAKEUV_ON + #if SHAKEUV_ON + half xShake = sin((_Time.x + randomSeed) * _ShakeUvSpeed * 50) * _ShakeUvX; + half yShake = cos((_Time.x + randomSeed) * _ShakeUvSpeed * 50) * _ShakeUvY; + d.texcoord0.xy += half2(xShake * 0.012, yShake * 0.01); + #endif + + //------------------------------------------- + + //RECTSIZE_ON + #if RECTSIZE_ON + d.texcoord0.xy = d.texcoord0.xy * (_RectSize).xx + (((-_RectSize * 0.5) + 0.5)).xx; + #endif + + //------------------------------------------- + + //DISTORT_ON + #if DISTORT_ON + #if ATLAS_ON + d.texcoord3.x = d.texcoord3.x * (1 / (_MaxXUV - _MinXUV)); + d.texcoord3.y = d.texcoord3.y * (1 / (_MaxYUV - _MinYUV)); + #endif + + d.texcoord3.x += ((_Time.x + _RandomSeed) * _DistortTexXSpeed) % 1; + d.texcoord3.y += ((_Time.x + _RandomSeed) * _DistortTexYSpeed) % 1; + half distortAmnt = (SAMPLE_TEXTURE2D(_DistortTex, sampler_DistortTex, d.texcoord3.xy).r - 0.5) * 0.2 * _DistortAmount; + d.texcoord0.x += distortAmnt; + d.texcoord0.y += distortAmnt; + #endif + //------------------------------------------------------- + + //WARP_ON + #if WARP_ON + half2 warpUv = half2(d.texcoord0.x / _MainTex_ST.x, d.texcoord0.y / _MainTex_ST.y); + #if ATLAS_ON + warpUv = half2((warpUv.x - _MinXUV) / (_MaxXUV - _MinXUV), (warpUv.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + const float tau = 6.283185307179586; + float xWarp = (_Time.y + randomSeed) * _WarpSpeed + warpUv.x * tau / _WarpScale; + float yWarp = (_Time.y + randomSeed) * _WarpSpeed + warpUv.y * tau / _WarpScale; + float2 warp = float2(sin(xWarp), sin(yWarp)) * _WarpStrength; + d.texcoord0.xy += warp; + #endif + + //------------------------------------------------------- + + //WAVEUV_ON + #if WAVEUV_ON + float2 uvWave = half2(_WaveX * _MainTex_ST.x, _WaveY * _MainTex_ST.y) - d.texcoord0.xy; + uvWave %= 1; + #if ATLAS_ON + uvWave = half2(_WaveX, _WaveY) - uvRect; + #endif + uvWave.x *= _ScreenParams.x / _ScreenParams.y; + float waveTime = _Time.y + randomSeed; + float angWave = (sqrt(dot(uvWave, uvWave)) * _WaveAmount) - ((waveTime * _WaveSpeed)); + d.texcoord0.xy = d.texcoord0.xy + uvWave * sin(angWave) * (_WaveStrength / 1000.0); + #endif + //---------------------------------------------------- + + //ROUNDWAVEUV_ON + #if ROUNDWAVEUV_ON + half xWave = ((0.5 * _MainTex_ST.x) - uvRect.x); + half yWave = ((0.5 * _MainTex_ST.y) - uvRect.y) * (_MainTex_TexelSize.w / _MainTex_TexelSize.z); + half ripple = -sqrt(xWave*xWave + yWave* yWave); + d.texcoord0.xy += (sin((ripple + (_Time.y + randomSeed) * (_RoundWaveSpeed/10.0)) / 0.015) * (_RoundWaveStrength/10.0)) % 1; + #endif + //---------------------------------------------------- + + + //WIND_ON + #if WIND_ON + half windOffset = sin((_Time.x + randomSeed) * _GrassSpeed * 10); + half2 windCenter = half2(0.5, 0.1); + #if ATLAS_ON + windCenter.x = ((_MaxXUV - _MinXUV) * windCenter.x) + _MinXUV; + windCenter.y = ((_MaxYUV - _MinYUV) * windCenter.y) + _MinYUV; + #endif + #if !MANUALWIND_ON + d.texcoord0.x = fmod(abs(lerp(d.texcoord0.x, d.texcoord0.x + (_GrassWind * 0.01 * windOffset), uvRect.y)), 1); + #else + d.texcoord0.x = fmod(abs(lerp(d.texcoord0.x, d.texcoord0.x + (_GrassWind * 0.01 * _GrassManualAnim), uvRect.y)), 1); + windOffset = _GrassManualAnim; + #endif + half2 delta = d.texcoord0.xy - windCenter; + half delta2 = dot(delta.xy, delta.xy); + half2 delta_offset = delta2 * windOffset; + d.texcoord0.xy = d.texcoord0.xy + half2(delta.y, -delta.x) * delta_offset * _GrassRadialBend; + #endif + + //-------------------------------------------------------- + + //TEXTURESCROLL_ON && !ATLAS_ON + #if TEXTURESCROLL_ON && !ATLAS_ON + d.texcoord0.x += ((_Time.y + randomSeed) * _TextureScrollXSpeed) % 1; + d.texcoord0.y += ((_Time.y + randomSeed) * _TextureScrollYSpeed) % 1; + #endif + //------------------------------ + + //PIXELATE_ON + #if PIXELATE_ON + half aspectRatio = _MainTex_TexelSize.x / _MainTex_TexelSize.y; + half2 pixelSize = float2(_PixelateSize, _PixelateSize * aspectRatio); + d.texcoord0.xy = floor(d.texcoord0.xy * pixelSize) / pixelSize; + #endif + //-------------- + + half4 col = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy); + half originalAlpha = col.a; + col *= d.vertexColor; + + //NORMAL MAP + #if NORMALMAP_ON + half4 normalSample = SAMPLE_TEXTURE2D(_NormalMap, sampler_NormalMap, d.texcoord0.xy); + half3 normalTS = UnpackNormal(normalSample); + normalTS.xy *= _NormalStrength; + o.Normal = normalTS; + #endif + + + //GLITCH_ON + #if GLITCH_ON + half2 uvGlitch = uvRect; + uvGlitch.y -= 0.5; + half lineNoise = pow(rand2(floor(uvGlitch * half2(24., 19.) * _GlitchSize) * 4.0, randomSeed), 3.0) * _GlitchAmount + * pow(rand2(floor(uvGlitch * half2(38., 14.) * _GlitchSize) * 4.0, randomSeed), 3.0); + col = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(lineNoise * 0.02 * rand2(half2(2.0, 1), randomSeed), 0)) * d.vertexColor; + #endif + //-------------------------------------- + + //CHROMABERR_ON + #if CHROMABERR_ON + half4 r = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(_ChromAberrAmount/10, 0)) * d.vertexColor; + half4 b = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(-_ChromAberrAmount/10, 0)) * d.vertexColor; + col = half4(r.r * r.a, col.g, b.b * b.a, max(max(r.a, b.a) * _ChromAberrAlpha, col.a)); + #endif + + //-------------------------------- + + //BLUR_ON + #if BLUR_ON + #if ATLAS_ON + #if !BLURISHD_ON + col = BlurHD(d.texcoord0.xy, _MainTex, sampler_MainTex, _BlurIntensity, (_MaxXUV - _MinXUV), (_MaxYUV - _MinYUV)) * d.vertexColor; + #else + col = Blur(d.texcoord0.xy, _MainTex, sampler_MainTex, _BlurIntensity * (_MaxXUV - _MinXUV)) * d.vertexColor; + #endif + #else + #if !BLURISHD_ON + col = BlurHD(d.texcoord0.xy, _MainTex, sampler_MainTex, _BlurIntensity, 1, 1) * d.vertexColor; + #else + col = Blur(d.texcoord0.xy, _MainTex, sampler_MainTex, _BlurIntensity) * d.vertexColor; + #endif + #endif + #endif + + //-------------------- + + //MOTIONBLUR_ON + #if MOTIONBLUR_ON + _MotionBlurAngle = _MotionBlurAngle * 3.1415926; + #define rot(n) mul(n, half2x2(cos(_MotionBlurAngle), -sin(_MotionBlurAngle), sin(_MotionBlurAngle), cos(_MotionBlurAngle))) + _MotionBlurDist = _MotionBlurDist * 0.005; + #if ATLAS_ON + _MotionBlurDist *= (_MaxXUV - _MinXUV); + #endif + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(-_MotionBlurDist, -_MotionBlurDist))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(-_MotionBlurDist * 2, -_MotionBlurDist * 2))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(-_MotionBlurDist * 3, -_MotionBlurDist * 3))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(-_MotionBlurDist * 4, -_MotionBlurDist * 4))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(_MotionBlurDist, _MotionBlurDist))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(_MotionBlurDist * 2, _MotionBlurDist * 2))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(_MotionBlurDist * 3, _MotionBlurDist * 3))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(_MotionBlurDist * 4, _MotionBlurDist * 4))); + col.rgb = col.rgb / 9; + #endif + //------------------------------------ + + //NEGATIVE_ON + #if NEGATIVE_ON + col.rgb = lerp(col.rgb, 1 - col.rgb, _NegativeAmount); + #endif + + //-------------- + half luminance = 0; + + //GREYSCALE_ON && !GREYSCALEOUTLINE_ON + #if GREYSCALE_ON && !GREYSCALEOUTLINE_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + luminance = saturate(luminance + _GreyscaleLuminosity); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _GreyscaleTintColor, _GreyscaleBlend); + #endif + //------------------------------------ + + //GHOST_ON + #if GHOST_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + half4 ghostResult; + ghostResult.a = saturate(luminance - _GhostTransparency) * col.a; + ghostResult.rgb = col.rgb * (luminance + _GhostColorBoost); + col = lerp(col, ghostResult, _GhostBlend); + #endif + //------------------------------------ + + //INNEROUTLINE_ON + #if INNEROUTLINE_ON + half3 innerT = abs(GetPixel(0, _InnerOutlineThickness, d.texcoord0.xy, _MainTex, sampler_MainTex) - GetPixel(0, -_InnerOutlineThickness, d.texcoord0.xy, _MainTex, sampler_MainTex)); + innerT += abs(GetPixel(_InnerOutlineThickness, 0, d.texcoord0.xy, _MainTex, sampler_MainTex) - GetPixel(-_InnerOutlineThickness, 0, d.texcoord0.xy, _MainTex, sampler_MainTex)); + #if !ONLYINNEROUTLINE_ON + innerT = (innerT / 2.0) * col.a * _InnerOutlineAlpha; + col.rgb += length(innerT) * _InnerOutlineColor.rgb * _InnerOutlineGlow; + #else + innerT *= col.a * _InnerOutlineAlpha; + col.rgb = length(innerT) * _InnerOutlineColor.rgb * _InnerOutlineGlow; + col.a = step(0.3, col.r+col.g+col.b); + #endif + #endif + //------------------------------------------------------- + + //HITEFFECT_ON + #if HITEFFECT_ON + col.rgb = lerp(col.rgb, _HitEffectColor.rgb * _HitEffectGlow, _HitEffectBlend); + #endif + //-------------------- + + //GRADIENT_ON + #if GRADIENT_ON + half2 tiledUvGrad = half2(uvRect.x / _MainTex_ST.x, uvRect.y / _MainTex_ST.y); + #if GRADIENT2COL_ON + _GradTopRightCol = _GradTopLeftCol; + _GradBotRightCol = _GradBotLeftCol; + #endif + #if RADIALGRADIENT_ON + half radialDist = 1 - length(tiledUvGrad - half2(0.5, 0.5)); + radialDist *= (_MainTex_TexelSize.w / _MainTex_TexelSize.z); + radialDist = saturate(_GradBoostX * radialDist); + half4 gradientResult = lerp(_GradTopLeftCol, _GradBotLeftCol, radialDist); + #else + half gradXLerpFactor = saturate(pow(tiledUvGrad.x, _GradBoostX)); + half4 gradientResult = lerp(lerp(_GradBotLeftCol, _GradBotRightCol, gradXLerpFactor), + lerp(_GradTopLeftCol, _GradTopRightCol, gradXLerpFactor), saturate(pow(tiledUvGrad.y, _GradBoostY))); + #endif + gradientResult = lerp(col, gradientResult, _GradBlend); + col.rgb = gradientResult.rgb * col.a; + col.a *= gradientResult.a; + #endif + //-------------------------------------------------------------------- + + //CONTRAST_ON + #if CONTRAST_ON + col.rgb = (col.rgb - float3(0.5, 0.5, 0.5)) * _Contrast + float3(0.5, 0.5, 0.5); + col.rgb += _Brightness; + #endif + + //------------------------------------------------------------------- + + //COLORSWAP_ON + #if COLORSWAP_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + half4 swapMask = SAMPLE_TEXTURE2D(_ColorSwapTex, sampler_ColorSwapTex, d.texcoord0.xy); + swapMask.rgb *= swapMask.a; + half3 redSwap = _ColorSwapRed * swapMask.r * saturate(luminance + _ColorSwapRedLuminosity); + half3 greenSwap = _ColorSwapGreen * swapMask.g * saturate(luminance + _ColorSwapGreenLuminosity); + half3 blueSwap = _ColorSwapBlue * swapMask.b * saturate(luminance + _ColorSwapBlueLuminosity); + swapMask.rgb = col.rgb * saturate(1 - swapMask.r - swapMask.g - swapMask.b); + col.rgb = lerp(col.rgb, swapMask.rgb + redSwap + greenSwap + blueSwap, _ColorSwapBlend); + #endif + //-------------------------------------------------------------------- + + //COLORRAMP_ON && !COLORRAMPOUTLINE_ON + #if COLORRAMP_ON && !COLORRAMPOUTLINE_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + luminance = saturate(luminance + _ColorRampLuminosity); + #if GRADIENTCOLORRAMP_ON + col.rgb = lerp(col.rgb, SAMPLE_TEXTURE2D(_ColorRampTexGradient, sampler_ColorRampTexGradient, half2(luminance, 0)).rgb, _ColorRampBlend); + #else + col.rgb = lerp(col.rgb, SAMPLE_TEXTURE2D(_ColorRampTex, sampler_ColorRampTex, half2(luminance, 0)).rgb, _ColorRampBlend); + #endif + #endif + //-------------------------------------------------------------------- + + //CHANGECOLOR_ON + #if CHANGECOLOR_ON + float3 currChangeColor = saturate(col.rgb); + luminance = 0.3 * currChangeColor.r + 0.59 * currChangeColor.g + 0.11 * currChangeColor.b; + luminance = saturate(luminance + _ColorChangeLuminosity); + half3 dif = abs(currChangeColor - _ColorChangeTarget.rgb); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _ColorChangeNewCol.rgb, + max(sign(1 - saturate(dif.x + dif.y + dif.z) - _ColorChangeTolerance), 0.0)); + #if CHANGECOLOR2_ON + dif = abs(currChangeColor - _ColorChangeTarget2.rgb); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _ColorChangeNewCol2.rgb, + max(sign(1 - saturate(dif.x + dif.y + dif.z) - _ColorChangeTolerance2), 0.0)); + #endif + #if CHANGECOLOR3_ON + dif = abs(currChangeColor - _ColorChangeTarget3.rgb); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _ColorChangeNewCol3.rgb, + max(sign(1 - saturate(dif.x + dif.y + dif.z) - _ColorChangeTolerance3), 0.0)); + #endif + #endif + //------------------------------------------------------- + + //POSTERIZE_ON && !POSTERIZEOUTLINE_ON + #if POSTERIZE_ON && !POSTERIZEOUTLINE_ON + col.rgb = pow(col.rgb, _PosterizeGamma) * _PosterizeNumColors; + col.rgb = floor(col.rgb) / _PosterizeNumColors; + col.rgb = pow(col.rgb, 1.0 / _PosterizeGamma); + #endif + //------------------------------------ + + //HSV_ON + #if HSV_ON + half3 resultHsv = half3(col.rgb); + half cosHsv = _HsvBright * _HsvSaturation * cos(_HsvShift * 3.14159265 / 180); + half sinHsv = _HsvBright * _HsvSaturation * sin(_HsvShift * 3.14159265 / 180); + resultHsv.x = (.299 * _HsvBright + .701 * cosHsv + .168 * sinHsv) * col.x + + (.587 * _HsvBright - .587 * cosHsv + .330 * sinHsv) * col.y + + (.114 * _HsvBright - .114 * cosHsv - .497 * sinHsv) * col.z; + resultHsv.y = (.299 * _HsvBright - .299 * cosHsv - .328 * sinHsv) *col.x + + (.587 * _HsvBright + .413 * cosHsv + .035 * sinHsv) * col.y + + (.114 * _HsvBright - .114 * cosHsv + .292 * sinHsv) * col.z; + resultHsv.z = (.299 * _HsvBright - .3 * cosHsv + 1.25 * sinHsv) * col.x + + (.587 * _HsvBright - .588 * cosHsv - 1.05 * sinHsv) * col.y + + (.114 * _HsvBright + .886 * cosHsv - .203 * sinHsv) * col.z; + col.rgb = resultHsv; + #endif + //------------------------------------------------------- + + //OVERLAY_ON + #if OVERLAY_ON + half2 overlayUvs = d.texcoord0.xy; + overlayUvs.x += ((_Time.y + randomSeed) * _OverlayTextureScrollXSpeed) % 1; + overlayUvs.y += ((_Time.y + randomSeed) * _OverlayTextureScrollYSpeed) % 1; + half4 overlayCol = SAMPLE_TEXTURE2D(_OverlayTex, sampler_OverlayTex, TRANSFORM_TEX(overlayUvs, _OverlayTex)); + overlayCol.rgb *= _OverlayColor.rgb * _OverlayGlow; + #if !OVERLAYMULT_ON + overlayCol.rgb *= overlayCol.a * _OverlayColor.rgb * _OverlayColor.a * _OverlayBlend; + col.rgb += overlayCol.rgb; + #else + overlayCol.a *= _OverlayColor.a; + col = lerp(col, col * overlayCol, _OverlayBlend); + #endif + #endif + + //--------------------------------- + + //OUTBASE_ON + #if OUTBASE_ON + #if OUTBASEPIXELPERF_ON + half2 destUv = half2(_OutlinePixelWidth * _MainTex_TexelSize.x, _OutlinePixelWidth * _MainTex_TexelSize.y); + #else + half2 destUv = half2(_OutlineWidth * _MainTex_TexelSize.x * 200, _OutlineWidth * _MainTex_TexelSize.y * 200); + #endif + + #if OUTDIST_ON + d.texcoord3.x += ((_Time.x + _RandomSeed) * _OutlineDistortTexXSpeed) % 1; + d.texcoord3.y += ((_Time.x + _RandomSeed) * _OutlineDistortTexYSpeed) % 1; + #if ATLAS_ON + d.texcoord3 = half2((d.texcoord3.x - _MinXUV) / (_MaxXUV - _MinXUV), (d.texcoord3.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half outDistortAmnt = (SAMPLE_TEXTURE2D(_OutlineDistortTex, sampler_OutlineDistortTex, d.texcoord3).r - 0.5) * 0.2 * _OutlineDistortAmount; + destUv.x += outDistortAmnt; + destUv.y += outDistortAmnt; + #endif + + half spriteLeft = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(destUv.x, 0)).a; + half spriteRight = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy - half2(destUv.x, 0)).a; + half spriteBottom = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(0, destUv.y)).a; + half spriteTop = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy - half2(0, destUv.y)).a; + half result = spriteLeft + spriteRight + spriteBottom + spriteTop; + + #if OUTBASE8DIR_ON + half spriteTopLeft = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(destUv.x, destUv.y)).a; + half spriteTopRight = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(-destUv.x, destUv.y)).a; + half spriteBotLeft = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(destUv.x, -destUv.y)).a; + half spriteBotRight = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(-destUv.x, -destUv.y)).a; + result = result + spriteTopLeft + spriteTopRight + spriteBotLeft + spriteBotRight; + #endif + + result = step(0.05, saturate(result)); + + #if OUTTEX_ON + d.texcoord1.x += ((_Time.x + _RandomSeed) * _OutlineTexXSpeed) % 1; + d.texcoord1.y += ((_Time.x + _RandomSeed) * _OutlineTexYSpeed) % 1; + #if ATLAS_ON + d.texcoord1 = half2((d.texcoord1.x - _MinXUV) / (_MaxXUV - _MinXUV), (d.texcoord1.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half4 tempOutColor = SAMPLE_TEXTURE2D(_OutlineTex, sampler_OutlineTex, d.texcoord1); + tempOutColor *= _OutlineColor; + _OutlineColor = tempOutColor; + #endif + + result *= (1 - originalAlpha) * _OutlineAlpha; + + half4 outline = _OutlineColor * d.vertexColor.a; + outline.rgb *= _OutlineGlow; + outline.a = result; + #if ONLYOUTLINE_ON + col = outline; + #else + col = lerp(col, outline, result); + #endif + #endif + //------------------------------------------------------- + + //FADE_ON + #if FADE_ON + half2 tiledUvFade1 = TRANSFORM_TEX(d.texcoord0, _FadeTex); + half2 tiledUvFade2 = TRANSFORM_TEX(d.texcoord0, _FadeBurnTex); + #if ATLAS_ON + tiledUvFade1 = half2((tiledUvFade1.x - _MinXUV) / (_MaxXUV - _MinXUV), (tiledUvFade1.y - _MinYUV) / (_MaxYUV - _MinYUV)); + tiledUvFade2 = half2((tiledUvFade2.x - _MinXUV) / (_MaxXUV - _MinXUV), (tiledUvFade2.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half fadeTemp = SAMPLE_TEXTURE2D(_FadeTex, sampler_FadeTex, tiledUvFade1).r; + half fade = smoothstep(_FadeAmount, _FadeAmount + _FadeBurnTransition, fadeTemp); + half fadeBurn = saturate(smoothstep(_FadeAmount - _FadeBurnWidth, _FadeAmount - _FadeBurnWidth + 0.1, fadeTemp) * _FadeAmount); + col.a *= fade; + _FadeBurnColor.rgb *= _FadeBurnGlow; + col += fadeBurn * SAMPLE_TEXTURE2D(_FadeBurnTex, sampler_FadeBurnTex, tiledUvFade2) * _FadeBurnColor * originalAlpha * (1 - col.a); + #endif + //------------------------------------------------------- + + //SHADOW_ON + #if SHADOW_ON + half shadowA = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(_ShadowX, _ShadowY)).a; + half preMultShadowMask = 1 - (saturate(shadowA - col.a) * (1 - col.a)); + col.rgb *= 1 - ((shadowA - col.a) * (1 - col.a)); + col.rgb += (_ShadowColor * shadowA) * (1 - col.a); + col.a = max(shadowA * _ShadowAlpha * d.vertexColor.a, col.a); + #endif + + //------------------------------------------------------- + + //GLOW_ON + #if GLOW_ON + half4 emission; + #if GLOWTEX_ON + emission = SAMPLE_TEXTURE2D(_GlowTex, sampler_GlowTex, d.texcoord0); + #else + emission = col; + #endif + + col.rgb *= _GlowGlobal; + emission.rgb *= emission.a * col.a * _Glow * _GlowColor; + col.rgb += emission.rgb; + #endif + //------------------------------------------------------- + + //COLORRAMP_ON && COLORRAMPOUTLINE_ON + #if COLORRAMP_ON && COLORRAMPOUTLINE_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + luminance = saturate(luminance + _ColorRampLuminosity); + #if GRADIENTCOLORRAMP_ON + col.rgb = lerp(col.rgb, SAMPLE_TEXTURE2D(_ColorRampTexGradient, sampler_ColorRampTexGradient, half2(luminance, 0)).rgb, _ColorRampBlend); + #else + col.rgb = lerp(col.rgb, SAMPLE_TEXTURE2D(_ColorRampTex, sampler_ColorRampTex, half2(luminance, 0)).rgb, _ColorRampBlend); + #endif + #endif + //--------------- + + //GREYSCALE_ON && GREYSCALEOUTLINE_ON + #if GREYSCALE_ON && GREYSCALEOUTLINE_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + luminance = saturate(luminance + _GreyscaleLuminosity); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _GreyscaleTintColor, _GreyscaleBlend); + #endif + + //----------------------------------- + + //POSTERIZE_ON && POSTERIZEOUTLINE_ON + #if POSTERIZE_ON && POSTERIZEOUTLINE_ON + col.rgb = pow(col.rgb, _PosterizeGamma) * _PosterizeNumColors; + col.rgb = floor(col.rgb) / _PosterizeNumColors; + col.rgb = pow(col.rgb, 1.0 / _PosterizeGamma); + #endif + + //----------------------------------- + + //SHINE_ON + #if SHINE_ON + half2 uvShine = uvRect; + half cosAngle = cos(_ShineRotate); + half sinAngle = sin(_ShineRotate); + half2x2 rot = half2x2(cosAngle, -sinAngle, sinAngle, cosAngle); + uvShine -= half2(0.5, 0.5); + uvShine = mul(rot, uvShine); + uvShine += half2(0.5, 0.5); + half shineMask = SAMPLE_TEXTURE2D(_ShineMask, sampler_ShineMask, d.texcoord0.xy).a; + half currentDistanceProjection = (uvShine.x + uvShine.y) / 2; + half whitePower = 1 - (abs(currentDistanceProjection - _ShineLocation) / _ShineWidth); + col.rgb += col.a * whitePower * _ShineGlow * max(sign(currentDistanceProjection - (_ShineLocation - _ShineWidth)), 0.0) + * max(sign((_ShineLocation + _ShineWidth) - currentDistanceProjection), 0.0) * _ShineColor * shineMask; + #endif + + //----------------------------------- + + //HOLOGRAM_ON + #if HOLOGRAM_ON + half totalHologram = _HologramStripesAmount + _HologramUnmodAmount; + half hologramYCoord = ((uvRect.y + (((_Time.x + randomSeed) % 1) * _HologramStripesSpeed)) % totalHologram) / totalHologram; + hologramYCoord = abs(hologramYCoord); + half alpha = RemapFloat(saturate(hologramYCoord - (_HologramUnmodAmount/totalHologram)), 0.0, 1.0, _HologramMinAlpha, saturate(_HologramMaxAlpha)); + half hologramMask = max(sign((_HologramUnmodAmount/totalHologram) - hologramYCoord), 0.0); + half4 hologramResult = col; + hologramResult.a *= lerp(alpha, 1, hologramMask); + hologramResult.rgb *= max(1, _HologramMaxAlpha * max(sign(hologramYCoord - (_HologramUnmodAmount/totalHologram)), 0.0)); + hologramMask = 1 - step(0.01,hologramMask); + hologramResult.rgb += hologramMask * _HologramStripeColor * col.a; + col = lerp(col, hologramResult, _HologramBlend); + #endif + + //----------------------------------- + + //FLICKER_ON + #if FLICKER_ON + col.a *= saturate(col.a * step(frac(0.05 + (_Time.w + randomSeed) * _FlickerFreq), 1 - _FlickerPercent) + _FlickerAlpha); + #endif + //----------------------------------- + + //ALPHACUTOFF_ON + + //ALPHAROUND_ON + + //ALPHAOUTLINE_ON + #if ALPHAOUTLINE_ON + half alphaOutlineRes = pow(1 - col.a, max(_AlphaOutlinePower, 0.0001)) * step(_AlphaOutlineMinAlpha, col.a) * _AlphaOutlineBlend; + col.rgb = lerp(col.rgb, _AlphaOutlineColor.rgb * _AlphaOutlineGlow, alphaOutlineRes); + col.a = lerp(col.a, 1, alphaOutlineRes > 1); + #endif + //------------------------------------------------------- + + //FOG_ON + + //------------------ + + col *= _Color; + o.Albedo = col; + col.a *= _Alpha; + clip(col.a - _AlphaCutoffValue - 0.01); + o.Alpha = _Color.a; + } + + + + + + void ChainSurfaceFunction(inout Surface l, inout ShaderData d) + { + Ext_SurfaceFunction0(l, d); + // Ext_SurfaceFunction1(l, d); + // Ext_SurfaceFunction2(l, d); + // Ext_SurfaceFunction3(l, d); + // Ext_SurfaceFunction4(l, d); + // Ext_SurfaceFunction5(l, d); + // Ext_SurfaceFunction6(l, d); + // Ext_SurfaceFunction7(l, d); + // Ext_SurfaceFunction8(l, d); + // Ext_SurfaceFunction9(l, d); + // Ext_SurfaceFunction10(l, d); + // Ext_SurfaceFunction11(l, d); + // Ext_SurfaceFunction12(l, d); + // Ext_SurfaceFunction13(l, d); + // Ext_SurfaceFunction14(l, d); + // Ext_SurfaceFunction15(l, d); + // Ext_SurfaceFunction16(l, d); + // Ext_SurfaceFunction17(l, d); + // Ext_SurfaceFunction18(l, d); + // Ext_SurfaceFunction19(l, d); + // Ext_SurfaceFunction20(l, d); + // Ext_SurfaceFunction21(l, d); + // Ext_SurfaceFunction22(l, d); + // Ext_SurfaceFunction23(l, d); + // Ext_SurfaceFunction24(l, d); + // Ext_SurfaceFunction25(l, d); + // Ext_SurfaceFunction26(l, d); + // Ext_SurfaceFunction27(l, d); + // Ext_SurfaceFunction28(l, d); + // Ext_SurfaceFunction29(l, d); + } + +#if !_DECALSHADER + + void ChainModifyVertex(inout VertexData v, inout VertexToPixel v2p, float4 time) + { + ExtraV2F d; + + ZERO_INITIALIZE(ExtraV2F, d); + ZERO_INITIALIZE(Blackboard, d.blackboard); + // due to motion vectors in HDRP, we need to use the last + // time in certain spots. So if you are going to use _Time to adjust vertices, + // you need to use this time or motion vectors will break. + d.time = time; + + Ext_ModifyVertex0(v, d); + // Ext_ModifyVertex1(v, d); + // Ext_ModifyVertex2(v, d); + // Ext_ModifyVertex3(v, d); + // Ext_ModifyVertex4(v, d); + // Ext_ModifyVertex5(v, d); + // Ext_ModifyVertex6(v, d); + // Ext_ModifyVertex7(v, d); + // Ext_ModifyVertex8(v, d); + // Ext_ModifyVertex9(v, d); + // Ext_ModifyVertex10(v, d); + // Ext_ModifyVertex11(v, d); + // Ext_ModifyVertex12(v, d); + // Ext_ModifyVertex13(v, d); + // Ext_ModifyVertex14(v, d); + // Ext_ModifyVertex15(v, d); + // Ext_ModifyVertex16(v, d); + // Ext_ModifyVertex17(v, d); + // Ext_ModifyVertex18(v, d); + // Ext_ModifyVertex19(v, d); + // Ext_ModifyVertex20(v, d); + // Ext_ModifyVertex21(v, d); + // Ext_ModifyVertex22(v, d); + // Ext_ModifyVertex23(v, d); + // Ext_ModifyVertex24(v, d); + // Ext_ModifyVertex25(v, d); + // Ext_ModifyVertex26(v, d); + // Ext_ModifyVertex27(v, d); + // Ext_ModifyVertex28(v, d); + // Ext_ModifyVertex29(v, d); + + + // #if %EXTRAV2F0REQUIREKEY% + // v2p.extraV2F0 = d.extraV2F0; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // v2p.extraV2F1 = d.extraV2F1; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // v2p.extraV2F2 = d.extraV2F2; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // v2p.extraV2F3 = d.extraV2F3; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // v2p.extraV2F4 = d.extraV2F4; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // v2p.extraV2F5 = d.extraV2F5; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // v2p.extraV2F6 = d.extraV2F6; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // v2p.extraV2F7 = d.extraV2F7; + // #endif + } + + void ChainModifyTessellatedVertex(inout VertexData v, inout VertexToPixel v2p) + { + ExtraV2F d; + ZERO_INITIALIZE(ExtraV2F, d); + ZERO_INITIALIZE(Blackboard, d.blackboard); + + // #if %EXTRAV2F0REQUIREKEY% + // d.extraV2F0 = v2p.extraV2F0; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // d.extraV2F1 = v2p.extraV2F1; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // d.extraV2F2 = v2p.extraV2F2; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // d.extraV2F3 = v2p.extraV2F3; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // d.extraV2F4 = v2p.extraV2F4; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // d.extraV2F5 = v2p.extraV2F5; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // d.extraV2F6 = v2p.extraV2F6; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // d.extraV2F7 = v2p.extraV2F7; + // #endif + + + // Ext_ModifyTessellatedVertex0(v, d); + // Ext_ModifyTessellatedVertex1(v, d); + // Ext_ModifyTessellatedVertex2(v, d); + // Ext_ModifyTessellatedVertex3(v, d); + // Ext_ModifyTessellatedVertex4(v, d); + // Ext_ModifyTessellatedVertex5(v, d); + // Ext_ModifyTessellatedVertex6(v, d); + // Ext_ModifyTessellatedVertex7(v, d); + // Ext_ModifyTessellatedVertex8(v, d); + // Ext_ModifyTessellatedVertex9(v, d); + // Ext_ModifyTessellatedVertex10(v, d); + // Ext_ModifyTessellatedVertex11(v, d); + // Ext_ModifyTessellatedVertex12(v, d); + // Ext_ModifyTessellatedVertex13(v, d); + // Ext_ModifyTessellatedVertex14(v, d); + // Ext_ModifyTessellatedVertex15(v, d); + // Ext_ModifyTessellatedVertex16(v, d); + // Ext_ModifyTessellatedVertex17(v, d); + // Ext_ModifyTessellatedVertex18(v, d); + // Ext_ModifyTessellatedVertex19(v, d); + // Ext_ModifyTessellatedVertex20(v, d); + // Ext_ModifyTessellatedVertex21(v, d); + // Ext_ModifyTessellatedVertex22(v, d); + // Ext_ModifyTessellatedVertex23(v, d); + // Ext_ModifyTessellatedVertex24(v, d); + // Ext_ModifyTessellatedVertex25(v, d); + // Ext_ModifyTessellatedVertex26(v, d); + // Ext_ModifyTessellatedVertex27(v, d); + // Ext_ModifyTessellatedVertex28(v, d); + // Ext_ModifyTessellatedVertex29(v, d); + + // #if %EXTRAV2F0REQUIREKEY% + // v2p.extraV2F0 = d.extraV2F0; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // v2p.extraV2F1 = d.extraV2F1; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // v2p.extraV2F2 = d.extraV2F2; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // v2p.extraV2F3 = d.extraV2F3; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // v2p.extraV2F4 = d.extraV2F4; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // v2p.extraV2F5 = d.extraV2F5; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // v2p.extraV2F6 = d.extraV2F6; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // v2p.extraV2F7 = d.extraV2F7; + // #endif + } + + void ChainFinalColorForward(inout Surface l, inout ShaderData d, inout half4 color) + { + // Ext_FinalColorForward0(l, d, color); + // Ext_FinalColorForward1(l, d, color); + // Ext_FinalColorForward2(l, d, color); + // Ext_FinalColorForward3(l, d, color); + // Ext_FinalColorForward4(l, d, color); + // Ext_FinalColorForward5(l, d, color); + // Ext_FinalColorForward6(l, d, color); + // Ext_FinalColorForward7(l, d, color); + // Ext_FinalColorForward8(l, d, color); + // Ext_FinalColorForward9(l, d, color); + // Ext_FinalColorForward10(l, d, color); + // Ext_FinalColorForward11(l, d, color); + // Ext_FinalColorForward12(l, d, color); + // Ext_FinalColorForward13(l, d, color); + // Ext_FinalColorForward14(l, d, color); + // Ext_FinalColorForward15(l, d, color); + // Ext_FinalColorForward16(l, d, color); + // Ext_FinalColorForward17(l, d, color); + // Ext_FinalColorForward18(l, d, color); + // Ext_FinalColorForward19(l, d, color); + // Ext_FinalColorForward20(l, d, color); + // Ext_FinalColorForward21(l, d, color); + // Ext_FinalColorForward22(l, d, color); + // Ext_FinalColorForward23(l, d, color); + // Ext_FinalColorForward24(l, d, color); + // Ext_FinalColorForward25(l, d, color); + // Ext_FinalColorForward26(l, d, color); + // Ext_FinalColorForward27(l, d, color); + // Ext_FinalColorForward28(l, d, color); + // Ext_FinalColorForward29(l, d, color); + } + + void ChainFinalGBufferStandard(inout Surface s, inout ShaderData d, inout half4 GBuffer0, inout half4 GBuffer1, inout half4 GBuffer2, inout half4 outEmission, inout half4 outShadowMask) + { + // Ext_FinalGBufferStandard0(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard1(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard2(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard3(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard4(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard5(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard6(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard7(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard8(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard9(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard10(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard11(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard12(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard13(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard14(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard15(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard16(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard17(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard18(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard19(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard20(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard21(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard22(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard23(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard24(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard25(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard26(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard27(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard28(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard29(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + } +#endif + + + + + +#if _DECALSHADER + + ShaderData CreateShaderData(SurfaceDescriptionInputs IN) + { + ShaderData d = (ShaderData)0; + d.TBNMatrix = float3x3(IN.WorldSpaceTangent, IN.WorldSpaceBiTangent, IN.WorldSpaceNormal); + d.worldSpaceNormal = IN.WorldSpaceNormal; + d.worldSpaceTangent = IN.WorldSpaceTangent; + + d.worldSpacePosition = IN.WorldSpacePosition; + d.texcoord0 = IN.uv0.xyxy; + d.screenPos = IN.ScreenPosition; + + d.worldSpaceViewDir = normalize(_WorldSpaceCameraPos - d.worldSpacePosition); + + d.tangentSpaceViewDir = mul(d.TBNMatrix, d.worldSpaceViewDir); + + // these rarely get used, so we back transform them. Usually will be stripped. + #if _HDRP + // d.localSpacePosition = mul(GetWorldToObjectMatrix(), float4(GetCameraRelativePositionWS(d.worldSpacePosition), 1)).xyz; + #else + // d.localSpacePosition = mul(GetWorldToObjectMatrix(), float4(d.worldSpacePosition, 1)).xyz; + #endif + // d.localSpaceNormal = normalize(mul((float3x3)GetWorldToObjectMatrix(), d.worldSpaceNormal)); + // d.localSpaceTangent = normalize(mul((float3x3)GetWorldToObjectMatrix(), d.worldSpaceTangent.xyz)); + + // #if %SCREENPOSREQUIREKEY% + // d.screenUV = (IN.ScreenPosition.xy / max(0.01, IN.ScreenPosition.w)); + // #endif + + return d; + } +#else + + ShaderData CreateShaderData(VertexToPixel i + #if NEED_FACING + , bool facing + #endif + ) + { + ShaderData d = (ShaderData)0; + d.clipPos = i.pos; + d.worldSpacePosition = i.worldPos; + + d.worldSpaceNormal = normalize(i.worldNormal); + d.worldSpaceTangent.xyz = normalize(i.worldTangent.xyz); + + d.tangentSign = i.worldTangent.w * unity_WorldTransformParams.w; + float3 bitangent = cross(d.worldSpaceTangent.xyz, d.worldSpaceNormal) * d.tangentSign; + + d.TBNMatrix = float3x3(d.worldSpaceTangent, -bitangent, d.worldSpaceNormal); + d.worldSpaceViewDir = normalize(_WorldSpaceCameraPos - i.worldPos); + + d.tangentSpaceViewDir = mul(d.TBNMatrix, d.worldSpaceViewDir); + d.texcoord0 = i.texcoord0; + d.texcoord1 = i.texcoord1; + d.texcoord2 = i.texcoord2; + + // #if %TEXCOORD3REQUIREKEY% + d.texcoord3 = i.texcoord3; + // #endif + + // d.isFrontFace = facing; + // #if %VERTEXCOLORREQUIREKEY% + d.vertexColor = i.vertexColor; + // #endif + + // these rarely get used, so we back transform them. Usually will be stripped. + #if _HDRP + // d.localSpacePosition = mul(GetWorldToObjectMatrix(), float4(GetCameraRelativePositionWS(i.worldPos), 1)).xyz; + #else + // d.localSpacePosition = mul(GetWorldToObjectMatrix(), float4(i.worldPos, 1)).xyz; + #endif + // d.localSpaceNormal = normalize(mul((float3x3)GetWorldToObjectMatrix(), i.worldNormal)); + // d.localSpaceTangent = normalize(mul((float3x3)GetWorldToObjectMatrix(), i.worldTangent.xyz)); + + // #if %SCREENPOSREQUIREKEY% + // d.screenPos = i.screenPos; + // d.screenUV = (i.screenPos.xy / i.screenPos.w); + // #endif + + + // #if %EXTRAV2F0REQUIREKEY% + // d.extraV2F0 = i.extraV2F0; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // d.extraV2F1 = i.extraV2F1; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // d.extraV2F2 = i.extraV2F2; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // d.extraV2F3 = i.extraV2F3; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // d.extraV2F4 = i.extraV2F4; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // d.extraV2F5 = i.extraV2F5; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // d.extraV2F6 = i.extraV2F6; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // d.extraV2F7 = i.extraV2F7; + // #endif + + return d; + } + +#endif + + + #if defined(_PASSSHADOW) + float3 _LightDirection; + float3 _LightPosition; + #endif + + // vertex shader + VertexToPixel Vert (VertexData v) + { + + VertexToPixel o = (VertexToPixel)0; + + UNITY_SETUP_INSTANCE_ID(v); + UNITY_TRANSFER_INSTANCE_ID(v, o); + UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o); + + +#if !_TESSELLATION_ON + ChainModifyVertex(v, o, _Time); +#endif + + o.texcoord0 = v.texcoord0; + o.texcoord1 = v.texcoord1; + o.texcoord2 = v.texcoord2; + + // #if %TEXCOORD3REQUIREKEY% + o.texcoord3 = v.texcoord3; + // #endif + + // #if %VERTEXCOLORREQUIREKEY% + o.vertexColor = v.vertexColor; + // #endif + + VertexPositionInputs vertexInput = GetVertexPositionInputs(v.vertex.xyz); + o.worldPos = TransformObjectToWorld(v.vertex.xyz); + o.worldNormal = TransformObjectToWorldNormal(v.normal); + o.worldTangent = float4(TransformObjectToWorldDir(v.tangent.xyz), v.tangent.w); + + // For some very odd reason, in 2021.2, we can't use Unity's defines, but have to use our own.. + #if _PASSSHADOW + #if _CASTING_PUNCTUAL_LIGHT_SHADOW + float3 lightDirectionWS = normalize(_LightPosition - o.worldPos); + #else + float3 lightDirectionWS = _LightDirection; + #endif + // Define shadow pass specific clip position for Universal + o.pos = TransformWorldToHClip(ApplyShadowBias(o.worldPos, o.worldNormal, lightDirectionWS)); + #if UNITY_REVERSED_Z + o.pos.z = min(o.pos.z, UNITY_NEAR_CLIP_VALUE); + #else + o.pos.z = max(o.pos.z, UNITY_NEAR_CLIP_VALUE); + #endif + #elif _PASSMETA + o.pos = MetaVertexPosition(float4(v.vertex.xyz, 0), v.texcoord1.xy, v.texcoord2.xy, unity_LightmapST, unity_DynamicLightmapST); + #else + o.pos = TransformWorldToHClip(o.worldPos); + #endif + + // #if %SCREENPOSREQUIREKEY% + // o.screenPos = ComputeScreenPos(o.pos, _ProjectionParams.x); + // #endif + + #if _PASSFORWARD || _PASSGBUFFER + float2 uv1 = v.texcoord1.xy; + OUTPUT_LIGHTMAP_UV(uv1, unity_LightmapST, o.lightmapUV); + o.texcoord1.xy = uv1; + OUTPUT_SH(o.worldNormal, o.sh); + #if defined(DYNAMICLIGHTMAP_ON) + o.dynamicLightmapUV.xy = v.texcoord2.xy * unity_DynamicLightmapST.xy + unity_DynamicLightmapST.zw; + #endif + #endif + + #ifdef VARYINGS_NEED_FOG_AND_VERTEX_LIGHT + half fogFactor = 0; + #if defined(_FOG_FRAGMENT) + fogFactor = ComputeFogFactor(o.pos.z); + #endif + #if _BAKEDLIT + o.fogFactorAndVertexLight = half4(fogFactor, 0, 0, 0); + #else + half3 vertexLight = VertexLighting(o.worldPos, o.worldNormal); + o.fogFactorAndVertexLight = half4(fogFactor, vertexLight); + #endif + #endif + + #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR) + o.shadowCoord = GetShadowCoord(vertexInput); + #endif + + return o; + } + + + + + // fragment shader + half4 Frag (VertexToPixel IN + #ifdef _DEPTHOFFSET_ON + , out float outputDepth : SV_Depth + #endif + #if NEED_FACING + , bool facing : SV_IsFrontFace + #endif + ) : SV_Target + { + UNITY_SETUP_INSTANCE_ID(IN); + UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX(IN); + + #if defined(LOD_FADE_CROSSFADE) && USE_UNITY_CROSSFADE + LODFadeCrossFade(IN.pos); + #endif + + ShaderData d = CreateShaderData(IN + #if NEED_FACING + , facing + #endif + ); + Surface l = (Surface)0; + + #ifdef _DEPTHOFFSET_ON + l.outputDepth = outputDepth; + #endif + + l.Albedo = half3(0.5, 0.5, 0.5); + l.Normal = float3(0,0,1); + l.Occlusion = 1; + l.Alpha = 1; + + ChainSurfaceFunction(l, d); + + #ifdef _DEPTHOFFSET_ON + outputDepth = l.outputDepth; + #endif + + return 0; + + } + + ENDHLSL + + } + + + + Pass + { + Name "Meta" + Tags + { + "LightMode" = "Meta" + } + + Cull Off + + + Tags { "RenderType" = "Opaque" "Queue" = "Geometry" "PreviewType" = "Plane" } + Cull [_CullingOption] + ZWrite [_ZWrite] + ZTest [_ZTestMode] + + + HLSLPROGRAM + + #pragma vertex Vert + #pragma fragment Frag + + #pragma target 3.0 + + #pragma prefer_hlslcc gles + #pragma exclude_renderers d3d11_9x + + #define SHADERPASS SHADERPASS_META + #define _PASSMETA 1 + + + + #pragma shader_feature_local GLOW_ON + #pragma shader_feature_local FADE_ON + #pragma shader_feature_local OUTBASE_ON + #pragma shader_feature_local ONLYOUTLINE_ON + #pragma shader_feature_local GRADIENT_ON + #pragma shader_feature_local GRADIENT2COL_ON + #pragma shader_feature_local RADIALGRADIENT_ON + #pragma shader_feature_local COLORSWAP_ON + #pragma shader_feature_local HSV_ON + #pragma shader_feature_local CHANGECOLOR_ON + #pragma shader_feature_local CHANGECOLOR2_ON + #pragma shader_feature_local CHANGECOLOR3_ON + #pragma shader_feature_local COLORRAMP_ON + #pragma shader_feature_local GRADIENTCOLORRAMP_ON + #pragma shader_feature_local HITEFFECT_ON + #pragma shader_feature_local NEGATIVE_ON + #pragma shader_feature_local PIXELATE_ON + #pragma shader_feature_local GREYSCALE_ON + #pragma shader_feature_local POSTERIZE_ON + #pragma shader_feature_local BLUR_ON + #pragma shader_feature_local MOTIONBLUR_ON + #pragma shader_feature_local GHOST_ON + #pragma shader_feature_local ALPHAOUTLINE_ON + #pragma shader_feature_local INNEROUTLINE_ON + #pragma shader_feature_local ONLYINNEROUTLINE_ON + #pragma shader_feature_local HOLOGRAM_ON + #pragma shader_feature_local CHROMABERR_ON + #pragma shader_feature_local GLITCH_ON + #pragma shader_feature_local FLICKER_ON + #pragma shader_feature_local SHADOW_ON + #pragma shader_feature_local SHINE_ON + #pragma shader_feature_local CONTRAST_ON + #pragma shader_feature_local OVERLAY_ON + #pragma shader_feature_local OVERLAYMULT_ON + #pragma shader_feature_local DOODLE_ON + #pragma shader_feature_local WIND_ON + #pragma shader_feature_local WAVEUV_ON + #pragma shader_feature_local ROUNDWAVEUV_ON + #pragma shader_feature_local RECTSIZE_ON + #pragma shader_feature_local OFFSETUV_ON + #pragma shader_feature_local CLIPPING_ON + #pragma shader_feature_local RADIALCLIPPING_ON + #pragma shader_feature_local TEXTURESCROLL_ON + #pragma shader_feature_local ZOOMUV_ON + #pragma shader_feature_local DISTORT_ON + #pragma shader_feature_local WARP_ON + #pragma shader_feature_local TWISTUV_ON + #pragma shader_feature_local ROTATEUV_ON + #pragma shader_feature_local POLARUV_ON + #pragma shader_feature_local FISHEYE_ON + #pragma shader_feature_local PINCH_ON + #pragma shader_feature_local SHAKEUV_ON + + #pragma shader_feature_local GLOWTEX_ON + #pragma shader_feature_local OUTTEX_ON + #pragma shader_feature_local OUTDIST_ON + #pragma shader_feature_local OUTBASE8DIR_ON + #pragma shader_feature_local OUTBASEPIXELPERF_ON + #pragma shader_feature_local COLORRAMPOUTLINE_ON + #pragma shader_feature_local GREYSCALEOUTLINE_ON + #pragma shader_feature_local POSTERIZEOUTLINE_ON + #pragma shader_feature_local BLURISHD_ON + #pragma shader_feature_local MANUALWIND_ON + #pragma shader_feature_local ATLAS_ON + #pragma shader_feature_local PREMULTIPLYALPHA_ON + + #pragma shader_feature BILBOARD_ON + #pragma shader_feature BILBOARDY_ON + + #pragma shader_feature NORMALMAP_ON + + + #define _URP 1 +#define _USINGTEXCOORD1 1 +#define _USINGTEXCOORD2 1 + + + + // Includes + #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Version.hlsl" + #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Color.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.universal/ShaderLibrary/ShaderGraphFunctions.hlsl" + #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/MetaInput.hlsl" + #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/TextureStack.hlsl" + #include "Packages/com.unity.shadergraph/ShaderGraphLibrary/ShaderVariablesFunctions.hlsl" + #include "Packages/com.unity.render-pipelines.universal/Editor/ShaderGraph/Includes/ShaderPass.hlsl" + + #undef WorldNormalVector + #define WorldNormalVector(data, normal) mul(normal, data.TBNMatrix) + + #define UnityObjectToWorldNormal(normal) mul(GetObjectToWorldMatrix(), normal) + + #define _WorldSpaceLightPos0 _MainLightPosition + + #define UNITY_DECLARE_TEX2D(name) TEXTURE2D(name); SAMPLER(sampler##name); + #define UNITY_DECLARE_TEX2D_NOSAMPLER(name) TEXTURE2D(name); + #define UNITY_DECLARE_TEX2DARRAY(name) TEXTURE2D_ARRAY(name); SAMPLER(sampler##name); + #define UNITY_DECLARE_TEX2DARRAY_NOSAMPLER(name) TEXTURE2D_ARRAY(name); + + #define UNITY_SAMPLE_TEX2DARRAY(tex,coord) SAMPLE_TEXTURE2D_ARRAY(tex, sampler##tex, coord.xy, coord.z) + #define UNITY_SAMPLE_TEX2DARRAY_LOD(tex,coord,lod) SAMPLE_TEXTURE2D_ARRAY_LOD(tex, sampler##tex, coord.xy, coord.z, lod) + #define UNITY_SAMPLE_TEX2D(tex, coord) SAMPLE_TEXTURE2D(tex, sampler##tex, coord) + #define UNITY_SAMPLE_TEX2D_SAMPLER(tex, samp, coord) SAMPLE_TEXTURE2D(tex, sampler##samp, coord) + + #define UNITY_SAMPLE_TEX2D_LOD(tex,coord, lod) SAMPLE_TEXTURE2D_LOD(tex, sampler_##tex, coord, lod) + #define UNITY_SAMPLE_TEX2D_SAMPLER_LOD(tex,samplertex,coord, lod) SAMPLE_TEXTURE2D_LOD (tex, sampler##samplertex,coord, lod) + + #if defined(UNITY_COMPILER_HLSL) + #define UNITY_INITIALIZE_OUTPUT(type,name) name = (type)0; + #else + #define UNITY_INITIALIZE_OUTPUT(type,name) + #endif + + #define sampler2D_float sampler2D + #define sampler2D_half sampler2D + + + + // data across stages, stripped like the above. + struct VertexToPixel + { + float4 pos : SV_POSITION; + float3 worldPos : TEXCOORD0; + float3 worldNormal : TEXCOORD1; + float4 worldTangent : TEXCOORD2; + float4 texcoord0 : TEXCOORD3; + float4 texcoord1 : TEXCOORD4; + float4 texcoord2 : TEXCOORD5; + + // #if %TEXCOORD3REQUIREKEY% + float4 texcoord3 : TEXCOORD6; + // #endif + + // #if %SCREENPOSREQUIREKEY% + // float4 screenPos : TEXCOORD7; + // #endif + + // #if %VERTEXCOLORREQUIREKEY% + half4 vertexColor : COLOR; + // #endif + + #if defined(LIGHTMAP_ON) + float2 lightmapUV : TEXCOORD8; + #endif + #if defined(DYNAMICLIGHTMAP_ON) + float2 dynamicLightmapUV : TEXCOORD9; + #endif + #if !defined(LIGHTMAP_ON) + float3 sh : TEXCOORD10; + #endif + + #if defined(VARYINGS_NEED_FOG_AND_VERTEX_LIGHT) + float4 fogFactorAndVertexLight : TEXCOORD11; + #endif + + #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR) + float4 shadowCoord : TEXCOORD12; + #endif + + // #if %EXTRAV2F0REQUIREKEY% + // float4 extraV2F0 : TEXCOORD13; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // float4 extraV2F1 : TEXCOORD14; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // float4 extraV2F2 : TEXCOORD15; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // float4 extraV2F3 : TEXCOORD16; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // float4 extraV2F4 : TEXCOORD17; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // float4 extraV2F5 : TEXCOORD18; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // float4 extraV2F6 : TEXCOORD19; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // float4 extraV2F7 : TEXCOORD20; + // #endif + + #if UNITY_ANY_INSTANCING_ENABLED + uint instanceID : CUSTOM_INSTANCE_ID; + #endif + #if (defined(UNITY_STEREO_MULTIVIEW_ENABLED)) || (defined(UNITY_STEREO_INSTANCING_ENABLED) && (defined(SHADER_API_GLES3) || defined(SHADER_API_GLCORE))) + uint stereoTargetEyeIndexAsBlendIdx0 : BLENDINDICES0; + #endif + #if (defined(UNITY_STEREO_INSTANCING_ENABLED)) + uint stereoTargetEyeIndexAsRTArrayIdx : SV_RenderTargetArrayIndex; + #endif + #if defined(SHADER_STAGE_FRAGMENT) && defined(VARYINGS_NEED_CULLFACE) + FRONT_FACE_TYPE cullFace : FRONT_FACE_SEMANTIC; + #endif + + + }; + + + + + // data describing the user output of a pixel + struct Surface + { + half3 Albedo; + half Height; + half3 Normal; + half Smoothness; + half3 Emission; + half Metallic; + half3 Specular; + half Occlusion; + half SpecularPower; // for simple lighting + half Alpha; + float outputDepth; // if written, SV_Depth semantic is used. ShaderData.clipPos.z is unused value + // HDRP Only + half SpecularOcclusion; + half SubsurfaceMask; + half Thickness; + half CoatMask; + half CoatSmoothness; + half Anisotropy; + half IridescenceMask; + half IridescenceThickness; + int DiffusionProfileHash; + float SpecularAAThreshold; + float SpecularAAScreenSpaceVariance; + // requires _OVERRIDE_BAKEDGI to be defined, but is mapped in all pipelines + float3 DiffuseGI; + float3 BackDiffuseGI; + float3 SpecularGI; + float ior; + float3 transmittanceColor; + float atDistance; + float transmittanceMask; + // requires _OVERRIDE_SHADOWMASK to be defines + float4 ShadowMask; + + // for decals + float NormalAlpha; + float MAOSAlpha; + + + }; + + // Data the user declares in blackboard blocks + struct Blackboard + { + + float blackboardDummyData; + }; + + // data the user might need, this will grow to be big. But easy to strip + struct ShaderData + { + float4 clipPos; // SV_POSITION + float3 localSpacePosition; + float3 localSpaceNormal; + float3 localSpaceTangent; + + float3 worldSpacePosition; + float3 worldSpaceNormal; + float3 worldSpaceTangent; + float tangentSign; + + float3 worldSpaceViewDir; + float3 tangentSpaceViewDir; + + float4 texcoord0; + float4 texcoord1; + float4 texcoord2; + float4 texcoord3; + + float2 screenUV; + float4 screenPos; + + float4 vertexColor; + bool isFrontFace; + + float4 extraV2F0; + float4 extraV2F1; + float4 extraV2F2; + float4 extraV2F3; + float4 extraV2F4; + float4 extraV2F5; + float4 extraV2F6; + float4 extraV2F7; + + float3x3 TBNMatrix; + Blackboard blackboard; + }; + + struct VertexData + { + #if SHADER_TARGET > 30 + // uint vertexID : SV_VertexID; + #endif + float4 vertex : POSITION; + float3 normal : NORMAL; + float4 tangent : TANGENT; + float4 texcoord0 : TEXCOORD0; + + // optimize out mesh coords when not in use by user or lighting system + #if _URP && (_USINGTEXCOORD1 || _PASSMETA || _PASSFORWARD || _PASSGBUFFER) + float4 texcoord1 : TEXCOORD1; + #endif + + #if _URP && (_USINGTEXCOORD2 || _PASSMETA || ((_PASSFORWARD || _PASSGBUFFER) && defined(DYNAMICLIGHTMAP_ON))) + float4 texcoord2 : TEXCOORD2; + #endif + + #if _STANDARD && (_USINGTEXCOORD1 || (_PASSMETA || ((_PASSFORWARD || _PASSGBUFFER || _PASSFORWARDADD) && LIGHTMAP_ON))) + float4 texcoord1 : TEXCOORD1; + #endif + #if _STANDARD && (_USINGTEXCOORD2 || (_PASSMETA || ((_PASSFORWARD || _PASSGBUFFER) && DYNAMICLIGHTMAP_ON))) + float4 texcoord2 : TEXCOORD2; + #endif + + + #if _HDRP + float4 texcoord1 : TEXCOORD1; + float4 texcoord2 : TEXCOORD2; + #endif + + // #if %TEXCOORD3REQUIREKEY% + float4 texcoord3 : TEXCOORD3; + // #endif + + // #if %VERTEXCOLORREQUIREKEY% + float4 vertexColor : COLOR; + // #endif + + #if _PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR)) + float3 previousPositionOS : TEXCOORD4; // Contain previous transform position (in case of skinning for example) + #if defined (_ADD_PRECOMPUTED_VELOCITY) + float3 precomputedVelocity : TEXCOORD5; // Add Precomputed Velocity (Alembic computes velocities on runtime side). + #endif + #endif + + UNITY_VERTEX_INPUT_INSTANCE_ID + }; + + struct TessVertex + { + float4 vertex : INTERNALTESSPOS; + float3 normal : NORMAL; + float4 tangent : TANGENT; + float4 texcoord0 : TEXCOORD0; + float4 texcoord1 : TEXCOORD1; + float4 texcoord2 : TEXCOORD2; + + // #if %TEXCOORD3REQUIREKEY% + float4 texcoord3 : TEXCOORD3; + // #endif + + // #if %VERTEXCOLORREQUIREKEY% + float4 vertexColor : COLOR; + // #endif + + // #if %EXTRAV2F0REQUIREKEY% + // float4 extraV2F0 : TEXCOORD5; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // float4 extraV2F1 : TEXCOORD6; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // float4 extraV2F2 : TEXCOORD7; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // float4 extraV2F3 : TEXCOORD8; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // float4 extraV2F4 : TEXCOORD9; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // float4 extraV2F5 : TEXCOORD10; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // float4 extraV2F6 : TEXCOORD11; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // float4 extraV2F7 : TEXCOORD12; + // #endif + + #if _PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR)) + float3 previousPositionOS : TEXCOORD13; // Contain previous transform position (in case of skinning for example) + #if defined (_ADD_PRECOMPUTED_VELOCITY) + float3 precomputedVelocity : TEXCOORD14; + #endif + #endif + + UNITY_VERTEX_INPUT_INSTANCE_ID + UNITY_VERTEX_OUTPUT_STEREO + }; + + struct ExtraV2F + { + float4 extraV2F0; + float4 extraV2F1; + float4 extraV2F2; + float4 extraV2F3; + float4 extraV2F4; + float4 extraV2F5; + float4 extraV2F6; + float4 extraV2F7; + Blackboard blackboard; + float4 time; + }; + + + float3 WorldToTangentSpace(ShaderData d, float3 normal) + { + return mul(d.TBNMatrix, normal); + } + + float3 TangentToWorldSpace(ShaderData d, float3 normal) + { + return mul(normal, d.TBNMatrix); + } + + // in this case, make standard more like SRPs, because we can't fix + // unity_WorldToObject in HDRP, since it already does macro-fu there + + #if _STANDARD + float3 TransformWorldToObject(float3 p) { return mul(unity_WorldToObject, float4(p, 1)); }; + float3 TransformObjectToWorld(float3 p) { return mul(unity_ObjectToWorld, float4(p, 1)); }; + float4 TransformWorldToObject(float4 p) { return mul(unity_WorldToObject, p); }; + float4 TransformObjectToWorld(float4 p) { return mul(unity_ObjectToWorld, p); }; + float4x4 GetWorldToObjectMatrix() { return unity_WorldToObject; } + float4x4 GetObjectToWorldMatrix() { return unity_ObjectToWorld; } + #if (defined(SHADER_API_D3D11) || defined(SHADER_API_XBOXONE) || defined(UNITY_COMPILER_HLSLCC) || defined(SHADER_API_PSSL) || (SHADER_TARGET_SURFACE_ANALYSIS && !SHADER_TARGET_SURFACE_ANALYSIS_MOJOSHADER)) + #define UNITY_SAMPLE_TEX2D_LOD(tex,coord, lod) tex.SampleLevel (sampler##tex,coord, lod) + #define UNITY_SAMPLE_TEX2D_SAMPLER_LOD(tex,samplertex,coord, lod) tex.SampleLevel (sampler##samplertex,coord, lod) + #else + #define UNITY_SAMPLE_TEX2D_LOD(tex,coord,lod) tex2D (tex,coord,0,lod) + #define UNITY_SAMPLE_TEX2D_SAMPLER_LOD(tex,samplertex,coord,lod) tex2D (tex,coord,0,lod) + #endif + + #undef GetWorldToObjectMatrix() + + #define GetWorldToObjectMatrix() unity_WorldToObject + + + #endif + + float3 GetCameraWorldPosition() + { + #if _HDRP + return GetCameraRelativePositionWS(_WorldSpaceCameraPos); + #else + return _WorldSpaceCameraPos; + #endif + } + + #if _GRABPASSUSED + #if _STANDARD + TEXTURE2D(%GRABTEXTURE%); + SAMPLER(sampler_%GRABTEXTURE%); + #endif + + half3 GetSceneColor(float2 uv) + { + #if _STANDARD + return SAMPLE_TEXTURE2D(%GRABTEXTURE%, sampler_%GRABTEXTURE%, uv).rgb; + #else + return SHADERGRAPH_SAMPLE_SCENE_COLOR(uv); + #endif + } + #endif + + + + #if _STANDARD + UNITY_DECLARE_DEPTH_TEXTURE(_CameraDepthTexture); + float GetSceneDepth(float2 uv) { return SAMPLE_DEPTH_TEXTURE(_CameraDepthTexture, uv); } + float GetLinear01Depth(float2 uv) { return Linear01Depth(GetSceneDepth(uv)); } + float GetLinearEyeDepth(float2 uv) { return LinearEyeDepth(GetSceneDepth(uv)); } + #else + float GetSceneDepth(float2 uv) { return SHADERGRAPH_SAMPLE_SCENE_DEPTH(uv); } + float GetLinear01Depth(float2 uv) { return Linear01Depth(GetSceneDepth(uv), _ZBufferParams); } + float GetLinearEyeDepth(float2 uv) { return LinearEyeDepth(GetSceneDepth(uv), _ZBufferParams); } + #endif + + float3 GetWorldPositionFromDepthBuffer(float2 uv, float3 worldSpaceViewDir) + { + float eye = GetLinearEyeDepth(uv); + float3 camView = mul((float3x3)GetObjectToWorldMatrix(), transpose(mul(GetWorldToObjectMatrix(), UNITY_MATRIX_I_V)) [2].xyz); + + float dt = dot(worldSpaceViewDir, camView); + float3 div = worldSpaceViewDir/dt; + float3 wpos = (eye * div) + GetCameraWorldPosition(); + return wpos; + } + + #if _HDRP + float3 ObjectToWorldSpacePosition(float3 pos) + { + return GetAbsolutePositionWS(TransformObjectToWorld(pos)); + } + #else + float3 ObjectToWorldSpacePosition(float3 pos) + { + return TransformObjectToWorld(pos); + } + #endif + + #if _STANDARD + UNITY_DECLARE_SCREENSPACE_TEXTURE(_CameraDepthNormalsTexture); + float3 GetSceneNormal(float2 uv, float3 worldSpaceViewDir) + { + float4 depthNorms = UNITY_SAMPLE_SCREENSPACE_TEXTURE(_CameraDepthNormalsTexture, uv); + float3 norms = DecodeViewNormalStereo(depthNorms); + norms = mul((float3x3)GetWorldToViewMatrix(), norms) * 0.5 + 0.5; + return norms; + } + #elif _HDRP && !_DECALSHADER + + float3 GetSceneNormal(float2 uv, float3 worldSpaceViewDir) + { + NormalData nd; + DecodeFromNormalBuffer(_ScreenSize.xy * uv, nd); + return nd.normalWS; + } + #elif _URP + #if (SHADER_LIBRARY_VERSION_MAJOR >= 10) + #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/DeclareNormalsTexture.hlsl" + #endif + + float3 GetSceneNormal(float2 uv, float3 worldSpaceViewDir) + { + #if (SHADER_LIBRARY_VERSION_MAJOR >= 10) + return SampleSceneNormals(uv); + #else + float3 wpos = GetWorldPositionFromDepthBuffer(uv, worldSpaceViewDir); + return normalize(-cross(ddx(wpos), ddy(wpos))) * 0.5 + 0.5; + #endif + + } + #endif + + #if _HDRP + + half3 UnpackNormalmapRGorAG(half4 packednormal) + { + // This do the trick + packednormal.x *= packednormal.w; + + half3 normal; + normal.xy = packednormal.xy * 2 - 1; + normal.z = sqrt(1 - saturate(dot(normal.xy, normal.xy))); + return normal; + } + half3 UnpackNormal(half4 packednormal) + { + #if defined(UNITY_NO_DXT5nm) + return packednormal.xyz * 2 - 1; + #else + return UnpackNormalmapRGorAG(packednormal); + #endif + } + #endif + #if _HDRP || _URP + + half3 UnpackScaleNormal(half4 packednormal, half scale) + { + #ifndef UNITY_NO_DXT5nm + // Unpack normal as DXT5nm (1, y, 1, x) or BC5 (x, y, 0, 1) + // Note neutral texture like "bump" is (0, 0, 1, 1) to work with both plain RGB normal and DXT5nm/BC5 + packednormal.x *= packednormal.w; + #endif + half3 normal; + normal.xy = (packednormal.xy * 2 - 1) * scale; + normal.z = sqrt(1 - saturate(dot(normal.xy, normal.xy))); + return normal; + } + + #endif + + + void GetSun(out float3 lightDir, out float3 color) + { + lightDir = float3(0.5, 0.5, 0); + color = 1; + #if _HDRP + if (_DirectionalLightCount > 0) + { + DirectionalLightData light = _DirectionalLightDatas[0]; + lightDir = -light.forward.xyz; + color = light.color; + } + #elif _STANDARD + lightDir = normalize(_WorldSpaceLightPos0.xyz); + color = _LightColor0.rgb; + #elif _URP + Light light = GetMainLight(); + lightDir = light.direction; + color = light.color; + #endif + } + + + + CBUFFER_START(UnityPerMaterial) + + + half4 _Color; + half4 _MainTex_ST, _MainTex_TexelSize; + half _Alpha, _AlphaCutoffValue; + + #if ATLAS_ON + half _MinXUV, _MaxXUV, _MinYUV, _MaxYUV; + #endif + + #if GLOW_ON + half4 _GlowColor; + half _Glow, _GlowGlobal; + #endif + + #if HSV_ON + half _HsvShift, _HsvSaturation, _HsvBright; + #endif + + #if DISTORT_ON + half4 _DistortTex_ST; + half _DistortTexXSpeed, _DistortTexYSpeed, _DistortAmount; + #endif + + #if FADE_ON + half4 _FadeBurnColor, _FadeTex_ST, _FadeBurnTex_ST; + half _FadeAmount, _FadeBurnWidth, _FadeBurnTransition,_FadeBurnGlow; + #endif + + #if OUTBASE_ON + half4 _OutlineColor; + half _OutlineAlpha, _OutlineGlow, _OutlineWidth; + int _OutlinePixelWidth; + #endif + + #if OUTTEX_ON + half4 _OutlineTex_ST; + half _OutlineTexXSpeed, _OutlineTexYSpeed; + #endif + + #if OUTDIST_ON + half4 _OutlineDistortTex_ST; + half _OutlineDistortTexXSpeed, _OutlineDistortTexYSpeed, _OutlineDistortAmount; + #endif + + #if ALPHAOUTLINE_ON + half _AlphaOutlineGlow, _AlphaOutlinePower, _AlphaOutlineMinAlpha, _AlphaOutlineBlend; + half4 _AlphaOutlineColor; + #endif + + #if INNEROUTLINE_ON + half _InnerOutlineThickness, _InnerOutlineAlpha, _InnerOutlineGlow; + half4 _InnerOutlineColor; + #endif + + #if GRADIENT_ON + half _GradBlend, _GradBoostX, _GradBoostY; + half4 _GradTopRightCol, _GradTopLeftCol, _GradBotRightCol, _GradBotLeftCol; + #endif + + #if COLORSWAP_ON + half4 _ColorSwapRed, _ColorSwapGreen, _ColorSwapBlue; + half _ColorSwapRedLuminosity, _ColorSwapGreenLuminosity, _ColorSwapBlueLuminosity, _ColorSwapBlend; + #endif + + #if CHANGECOLOR_ON + half4 _ColorChangeNewCol, _ColorChangeTarget; + half _ColorChangeTolerance, _ColorChangeLuminosity; + #endif + #if CHANGECOLOR2_ON + half4 _ColorChangeNewCol2, _ColorChangeTarget2; + half _ColorChangeTolerance2; + #endif + #if CHANGECOLOR3_ON + half4 _ColorChangeNewCol3, _ColorChangeTarget3; + half _ColorChangeTolerance3; + #endif + + #if COLORRAMP_ON + half _ColorRampLuminosity, _ColorRampBlend; + #endif + + #if HITEFFECT_ON + half4 _HitEffectColor; + half _HitEffectGlow, _HitEffectBlend; + #endif + + #if NEGATIVE_ON + half _NegativeAmount; + #endif + + #if PIXELATE_ON + half _PixelateSize; + #endif + + #if GREYSCALE_ON + half _GreyscaleLuminosity, _GreyscaleBlend; + half4 _GreyscaleTintColor; + #endif + + #if POSTERIZE_ON + half _PosterizeNumColors, _PosterizeGamma; + #endif + + #if BLUR_ON + half _BlurIntensity; + #endif + + #if MOTIONBLUR_ON + half _MotionBlurAngle, _MotionBlurDist; + #endif + + #if GHOST_ON + half _GhostColorBoost, _GhostTransparency, _GhostBlend; + #endif + + #if HOLOGRAM_ON + half _HologramStripesAmount, _HologramMinAlpha, _HologramUnmodAmount, _HologramStripesSpeed, _HologramMaxAlpha, _HologramBlend; + half4 _HologramStripeColor; + #endif + + #if CHROMABERR_ON + half _ChromAberrAmount, _ChromAberrAlpha; + #endif + + #if GLITCH_ON + half _GlitchAmount, _GlitchSize; + #endif + + #if FLICKER_ON + half _FlickerFreq, _FlickerPercent, _FlickerAlpha; + #endif + + #if SHADOW_ON + half _ShadowX, _ShadowY, _ShadowAlpha; + half4 _ShadowColor; + #endif + + #if SHINE_ON + half4 _ShineColor; + half _ShineLocation, _ShineRotate, _ShineWidth, _ShineGlow; + #endif + + #if CONTRAST_ON + half _Contrast, _Brightness; + #endif + + #if OVERLAY_ON + half4 _OverlayTex_ST, _OverlayColor; + half _OverlayGlow, _OverlayBlend, _OverlayTextureScrollXSpeed, _OverlayTextureScrollYSpeed; + #endif + + #if DOODLE_ON + half _HandDrawnAmount, _HandDrawnSpeed; + #endif + + #if WIND_ON + half _GrassSpeed, _GrassWind, _GrassManualAnim, _GrassRadialBend; + #endif + + #if WAVEUV_ON + float _WaveAmount, _WaveSpeed, _WaveStrength, _WaveX, _WaveY; + #endif + + #if ROUNDWAVEUV_ON + half _RoundWaveStrength, _RoundWaveSpeed; + #endif + + #if RECTSIZE_ON + half _RectSize; + #endif + + #if OFFSETUV_ON + half _OffsetUvX, _OffsetUvY; + #endif + + #if CLIPPING_ON + half _ClipUvLeft, _ClipUvRight, _ClipUvUp, _ClipUvDown; + #endif + + #if RADIALCLIPPING_ON + half _RadialStartAngle, _RadialClip, _RadialClip2; + #endif + + #if TEXTURESCROLL_ON + half _TextureScrollXSpeed, _TextureScrollYSpeed; + #endif + + #if ZOOMUV_ON + half _ZoomUvAmount; + #endif + + #if WARP_ON + half _WarpStrength, _WarpSpeed, _WarpScale; + #endif + + #if TWISTUV_ON + half _TwistUvAmount, _TwistUvPosX, _TwistUvPosY, _TwistUvRadius; + #endif + + #if ROTATEUV_ON + half _RotateUvAmount; + #endif + + #if FISHEYE_ON + half _FishEyeUvAmount; + #endif + + #if PINCH_ON + half _PinchUvAmount; + #endif + + #if SHAKEUV_ON + half _ShakeUvSpeed, _ShakeUvX, _ShakeUvY; + #endif + + #if NORMALMAP_ON + half _NormalStrength; + #endif + + float _RandomSeed; + + + + + CBUFFER_END + + + + + + + + TEXTURE2D(_MainTex); + SAMPLER(sampler_MainTex); + + #if GLOW_ON + TEXTURE2D(_GlowTex); + SAMPLER(sampler_GlowTex); + #endif + + #if FADE_ON + TEXTURE2D(_FadeTex); + SAMPLER(sampler_FadeTex); + + TEXTURE2D(_FadeBurnTex); + SAMPLER(sampler_FadeBurnTex); + #endif + + #if DISTORT_ON + TEXTURE2D(_DistortTex); + SAMPLER(sampler_DistortTex); + #endif + + #if OUTTEX_ON + TEXTURE2D(_OutlineTex); + SAMPLER(sampler_OutlineTex); + #endif + + #if OUTDIST_ON + TEXTURE2D(_OutlineDistortTex); + SAMPLER(sampler_OutlineDistortTex); + #endif + + #if COLORSWAP_ON + TEXTURE2D(_ColorSwapTex); + SAMPLER(sampler_ColorSwapTex); + #endif + + #if COLORRAMP_ON + TEXTURE2D(_ColorRampTex); + TEXTURE2D(_ColorRampTexGradient); + SAMPLER(sampler_ColorRampTex); + SAMPLER(sampler_ColorRampTexGradient); + #endif + + #if SHINE_ON + TEXTURE2D(_ShineMask); + SAMPLER(sampler_ShineMask); + #endif + + #if OVERLAY_ON + TEXTURE2D(_OverlayTex); + SAMPLER(sampler_OverlayTex); + #endif + + #if NORMALMAP_ON + TEXTURE2D(_NormalMap); + SAMPLER(sampler_NormalMap); + #endif + + + half3 GetPixel(in int offsetX, in int offsetY, in half2 uv, in Texture2D _tex, in SamplerState _sampler) + { + half2 _uv = uv + half2(offsetX * _MainTex_TexelSize.x, offsetY * _MainTex_TexelSize.y); + half4 col = SAMPLE_TEXTURE2D(_tex, _sampler, _uv); + return col.rgb; + } + + + //BLURS------------------------------------------------------------------------- + half4 Blur(half2 uv, Texture2D source, SamplerState sampler_source, half Intensity) + { + const half2 texelSize = 1.0 / _ScreenParams.xy; + const half4 color = SAMPLE_TEXTURE2D(source, sampler_source, uv); + const half2 offset = Intensity * texelSize; + + half4 accumulatedColor = color; + half accumulatedWeight = 1.0; + for (int x = -1; x <= 1; x++) + { + for (int y = -1; y <= 1; y++) + { + const half2 sampleUV = uv + half2(x, y) * offset; + const half4 sampleColor = SAMPLE_TEXTURE2D(source, sampler_source, sampleUV); + + accumulatedColor += sampleColor; + accumulatedWeight += 1.0; + } + } + + half4 blurredColor = accumulatedColor / accumulatedWeight; + return blurredColor; + } + + half BlurHD_G(half bhqp, half x) + { + return exp(-(x * x) / (2.0 * bhqp * bhqp)); + } + half4 BlurHD(half2 uv, Texture2D source, SamplerState sampler_source, half BlurAmount, half xScale, half yScale) + { + int iterations = 16; + int halfIterations = iterations / 2; + half sigmaX = 0.1 + BlurAmount * 0.5; + half sigmaY = sigmaX; + half total = 0.0; + half4 ret = half4(0, 0, 0, 0); + for (int iy = 0; iy < iterations; ++iy) + { + half fy = BlurHD_G(sigmaY, half(iy) -half(halfIterations)); + half offsetY = half(iy - halfIterations) * 0.00390625 * xScale; + for (int ix = 0; ix < iterations; ++ix) + { + half fx = BlurHD_G(sigmaX, half(ix) - half(halfIterations)); + half offsetX = half(ix - halfIterations) * 0.00390625 * yScale; + total += fx * fy; + ret += SAMPLE_TEXTURE2D(source, sampler_source, uv + half2(offsetX, offsetY)) * fx * fy; + } + } + return ret / total; + } + //----------------------------------------------------------------------- + + + //------------------------------------------- + half RemapFloat(half inValue, half inMin, half inMax, half outMin, half outMax){ + return outMin + (inValue - inMin) * (outMax - outMin) / (inMax - inMin); + } + //------------------------------------------- + + //----------------------------------------------------------------------- + half rand(half2 seed, half offset) { + return (frac(sin(dot(seed, half2(12.9898, 78.233))) * 43758.5453) + offset) % 1.0; + } + + half rand2(half2 seed, half offset) { + return (frac(sin(dot(seed * floor(50 + (_Time.x % 1.0) * 12.), half2(127.1, 311.7))) * 43758.5453123) + offset) % 1.0; + } + + half rand2CustomTime(half2 seed, half offset, half customTime) { + return (frac(sin(dot(seed * floor(50 + (customTime % 1.0) * 12.), half2(127.1, 311.7))) * 43758.5453123) + offset) % 1.0; + } + //----------------------------------------------------------------------- + + + void Ext_ModifyVertex0 (inout VertexData v, inout ExtraV2F d) + { + //BILBOARD_ON + #if BILBOARD_ON + half3 camRight = mul((half3x3)unity_CameraToWorld, half3(1,0,0)); + half3 camUp = half3(0,1,0); + #if BILBOARDY_ON + camUp = mul((half3x3)unity_CameraToWorld, half3(0,1,0)); + #endif + half3 localPos = v.vertex.x * camRight + v.vertex.y * camUp; + v.vertex = half4(localPos, 1); + #endif + //----------------------------------------------------------- + + v.texcoord0.xy = TRANSFORM_TEX(v.texcoord0.xy, _MainTex); + half2 center = half2(0.5, 0.5); + #if ATLAS_ON + center = half2((_MaxXUV + _MinXUV) / 2.0, (_MaxYUV + _MinYUV) / 2.0); + #endif + + //POLARUV_ON + #if POLARUV_ON + v.texcoord0.xy = v.texcoord0.xy - center; + #endif + + //---------------------------------------- + + //ROTATEUV_ON + #if ROTATEUV_ON + half2 uvC = v.texcoord0.xy; + half cosAngle = cos(_RotateUvAmount); + half sinAngle = sin(_RotateUvAmount); + half2x2 rot = half2x2(cosAngle, -sinAngle, sinAngle, cosAngle); + uvC -= center; + v.texcoord0.xy = mul(rot, uvC); + v.texcoord0.xy += center; + #endif + //-------------------- + + #if RECTSIZE_ON + v.vertex.xyz += (v.vertex.xyz * (_RectSize - 1.0)); + #endif + + #if OUTTEX_ON + v.texcoord1.xy = TRANSFORM_TEX(v.texcoord0.xy, _OutlineTex); + #endif + + #if OUTDIST_ON + v.texcoord2.xy = TRANSFORM_TEX(v.texcoord0.xy, _OutlineDistortTex); + #endif + + #if DISTORT_ON + v.texcoord3.xy = TRANSFORM_TEX(v.texcoord0.xy, _DistortTex); + #endif + } + + void Ext_SurfaceFunction0 (inout Surface o, ShaderData d) + { + half randomSeed = _RandomSeed; + + float2 uvRect = d.texcoord0; + half2 center = half2(0.5, 0.5); + #if ATLAS_ON + center = half2((_MaxXUV + _MinXUV) / 2.0, (_MaxYUV + _MinYUV) / 2.0); + uvRect = half2((d.texcoord0.x - _MinXUV) / (_MaxXUV - _MinXUV), (d.texcoord0.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half2 centerTiled = half2(center.x * _MainTex_ST.x, center.y * _MainTex_ST.y); + + //CLIPPING_ON + #if CLIPPING_ON + half2 tiledUv = half2(d.texcoord0.x / _MainTex_ST.x, d.texcoord0.y / _MainTex_ST.y); + #if ATLAS_ON + tiledUv = half2((tiledUv.x - _MinXUV) / (_MaxXUV - _MinXUV), (tiledUv.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + clip((1 - _ClipUvUp) - tiledUv.y); + clip(tiledUv.y - _ClipUvDown); + clip((1 - _ClipUvRight) - tiledUv.x); + clip(tiledUv.x - _ClipUvLeft); + #endif + //---------------------------------- + + //RADIALCLIPPING_ON + #if RADIALCLIPPING_ON + half2 tiledUv2 = half2(d.texcoord0.x / _MainTex_ST.x, d.texcoord0.y / _MainTex_ST.y); + #if ATLAS_ON + tiledUv2 = half2((tiledUv2.x - _MinXUV) / (_MaxXUV - _MinXUV), (tiledUv2.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half startAngle = _RadialStartAngle - _RadialClip; + half endAngle = _RadialStartAngle + _RadialClip2; + half offset0 = clamp(0, 360, startAngle + 360); + half offset360 = clamp(0, 360, endAngle - 360); + half2 atan2Coord = half2(lerp(-1, 1, tiledUv2.x), lerp(-1, 1, tiledUv2.y)); + half atanAngle = atan2(atan2Coord.y, atan2Coord.x) * 57.3; // angle in degrees + if(atanAngle < 0) atanAngle = 360 + atanAngle; + if(atanAngle >= startAngle && atanAngle <= endAngle) discard; + if(atanAngle <= offset360) discard; + if(atanAngle >= offset0) discard; + #endif + + //----------------------------- + + //TEXTURESCROLL_ON && ATLAS_ON + #if TEXTURESCROLL_ON && ATLAS_ON + d.texcoord0.xy = half2(_MinXUV + ((_MaxXUV - _MinXUV) * (abs(((_Time.y + randomSeed) * _TextureScrollXSpeed) + uvRect.x) % 1)), + _MinYUV + ((_MaxYUV - _MinYUV) * (abs(((_Time.y + randomSeed) * _TextureScrollYSpeed) + uvRect.y) % 1))); + #endif + //---------------------------- + + //OFFSETUV_ON + #if OFFSETUV_ON + #if ATLAS_ON + d.texcoord0.xy = half2(_MinXUV + ((_MaxXUV - _MinXUV) * (abs((_OffsetUvX + uvRect.x) % 1))), + _MinYUV + ((_MaxYUV - _MinYUV) * (abs(_OffsetUvY + uvRect.y) % 1))); + #else + d.texcoord0.xy += half2(_OffsetUvX, _OffsetUvY); + #endif + #endif + + //---------------------- + + //POLARUV_ON + #if POLARUV_ON + d.texcoord0.xy = half2(atan2(d.texcoord0.y, d.texcoord0.x) / (2.0f * 3.141592653589f), length(d.texcoord0.xy)); + d.texcoord0.xy *= _MainTex_ST.xy; + #endif + + //-------------------------------------- + + //TWISTUV_ON + #if TWISTUV_ON + #if ATLAS_ON + _TwistUvPosX = ((_MaxXUV - _MinXUV) * _TwistUvPosX) + _MinXUV; + _TwistUvPosY = ((_MaxYUV - _MinYUV) * _TwistUvPosY) + _MinYUV; + #endif + half2 tempUv = d.texcoord0.xy - half2(_TwistUvPosX * _MainTex_ST.x, _TwistUvPosY * _MainTex_ST.y); + _TwistUvRadius *= (_MainTex_ST.x + _MainTex_ST.y) / 2; + half percent = (_TwistUvRadius - length(tempUv)) / _TwistUvRadius; + half theta = percent * percent * (2.0 * sin(_TwistUvAmount)) * 8.0; + half s = sin(theta); + half c = cos(theta); + half beta = max(sign(_TwistUvRadius - length(tempUv)), 0.0); + tempUv = half2(dot(tempUv, half2(c, -s)), dot(tempUv, half2(s, c))) * beta + tempUv * (1 - beta); + tempUv += half2(_TwistUvPosX * _MainTex_ST.x, _TwistUvPosY * _MainTex_ST.y); + d.texcoord0.xy = tempUv; + #endif + + //-------------------------------------------- + + //FISHEYE_ON + #if FISHEYE_ON + half bind = length(centerTiled); + half2 dF = d.texcoord0.xy - centerTiled; + half dFlen = length(dF); + half fishInt = (3.14159265359 / bind) * (_FishEyeUvAmount + 0.001); + d.texcoord0.xy = centerTiled + (dF / (max(0.0001, dFlen))) * tan(dFlen * fishInt) * bind / tan(bind * fishInt); + #endif + //--------------------------------------------- + + //PINCH_ON + #if PINCH_ON + half2 dP = d.texcoord0.xy - centerTiled; + half pinchInt = (3.141592 / length(centerTiled)) * (-_PinchUvAmount + 0.001); + d.texcoord0.xy = centerTiled + normalize(dP) * atan(length(dP) * -pinchInt * 10.0) * 0.5 / atan(-pinchInt * 5); + #endif + + //--------------------------------------------- + + //ZOOMUV_ON + #if ZOOMUV_ON + d.texcoord0.xy -= centerTiled; + d.texcoord0.xy = d.texcoord0.xy * _ZoomUvAmount; + d.texcoord0.xy += centerTiled; + #endif + + //----------------------------------------------- + + //DOODLE_ON + #if DOODLE_ON + half2 uvCopy = uvRect; + _HandDrawnSpeed = (floor((_Time.x + randomSeed) * 20 * _HandDrawnSpeed) / _HandDrawnSpeed) * _HandDrawnSpeed; + uvCopy.x = sin((uvCopy.x * _HandDrawnAmount + _HandDrawnSpeed) * 4); + uvCopy.y = cos((uvCopy.y * _HandDrawnAmount + _HandDrawnSpeed) * 4); + d.texcoord0.xy = lerp(d.texcoord0.xy, d.texcoord0.xy + uvCopy, 0.0005 * _HandDrawnAmount); + #endif + + //-------------------------- + + //SHAKEUV_ON + #if SHAKEUV_ON + half xShake = sin((_Time.x + randomSeed) * _ShakeUvSpeed * 50) * _ShakeUvX; + half yShake = cos((_Time.x + randomSeed) * _ShakeUvSpeed * 50) * _ShakeUvY; + d.texcoord0.xy += half2(xShake * 0.012, yShake * 0.01); + #endif + + //------------------------------------------- + + //RECTSIZE_ON + #if RECTSIZE_ON + d.texcoord0.xy = d.texcoord0.xy * (_RectSize).xx + (((-_RectSize * 0.5) + 0.5)).xx; + #endif + + //------------------------------------------- + + //DISTORT_ON + #if DISTORT_ON + #if ATLAS_ON + d.texcoord3.x = d.texcoord3.x * (1 / (_MaxXUV - _MinXUV)); + d.texcoord3.y = d.texcoord3.y * (1 / (_MaxYUV - _MinYUV)); + #endif + + d.texcoord3.x += ((_Time.x + _RandomSeed) * _DistortTexXSpeed) % 1; + d.texcoord3.y += ((_Time.x + _RandomSeed) * _DistortTexYSpeed) % 1; + half distortAmnt = (SAMPLE_TEXTURE2D(_DistortTex, sampler_DistortTex, d.texcoord3.xy).r - 0.5) * 0.2 * _DistortAmount; + d.texcoord0.x += distortAmnt; + d.texcoord0.y += distortAmnt; + #endif + //------------------------------------------------------- + + //WARP_ON + #if WARP_ON + half2 warpUv = half2(d.texcoord0.x / _MainTex_ST.x, d.texcoord0.y / _MainTex_ST.y); + #if ATLAS_ON + warpUv = half2((warpUv.x - _MinXUV) / (_MaxXUV - _MinXUV), (warpUv.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + const float tau = 6.283185307179586; + float xWarp = (_Time.y + randomSeed) * _WarpSpeed + warpUv.x * tau / _WarpScale; + float yWarp = (_Time.y + randomSeed) * _WarpSpeed + warpUv.y * tau / _WarpScale; + float2 warp = float2(sin(xWarp), sin(yWarp)) * _WarpStrength; + d.texcoord0.xy += warp; + #endif + + //------------------------------------------------------- + + //WAVEUV_ON + #if WAVEUV_ON + float2 uvWave = half2(_WaveX * _MainTex_ST.x, _WaveY * _MainTex_ST.y) - d.texcoord0.xy; + uvWave %= 1; + #if ATLAS_ON + uvWave = half2(_WaveX, _WaveY) - uvRect; + #endif + uvWave.x *= _ScreenParams.x / _ScreenParams.y; + float waveTime = _Time.y + randomSeed; + float angWave = (sqrt(dot(uvWave, uvWave)) * _WaveAmount) - ((waveTime * _WaveSpeed)); + d.texcoord0.xy = d.texcoord0.xy + uvWave * sin(angWave) * (_WaveStrength / 1000.0); + #endif + //---------------------------------------------------- + + //ROUNDWAVEUV_ON + #if ROUNDWAVEUV_ON + half xWave = ((0.5 * _MainTex_ST.x) - uvRect.x); + half yWave = ((0.5 * _MainTex_ST.y) - uvRect.y) * (_MainTex_TexelSize.w / _MainTex_TexelSize.z); + half ripple = -sqrt(xWave*xWave + yWave* yWave); + d.texcoord0.xy += (sin((ripple + (_Time.y + randomSeed) * (_RoundWaveSpeed/10.0)) / 0.015) * (_RoundWaveStrength/10.0)) % 1; + #endif + //---------------------------------------------------- + + + //WIND_ON + #if WIND_ON + half windOffset = sin((_Time.x + randomSeed) * _GrassSpeed * 10); + half2 windCenter = half2(0.5, 0.1); + #if ATLAS_ON + windCenter.x = ((_MaxXUV - _MinXUV) * windCenter.x) + _MinXUV; + windCenter.y = ((_MaxYUV - _MinYUV) * windCenter.y) + _MinYUV; + #endif + #if !MANUALWIND_ON + d.texcoord0.x = fmod(abs(lerp(d.texcoord0.x, d.texcoord0.x + (_GrassWind * 0.01 * windOffset), uvRect.y)), 1); + #else + d.texcoord0.x = fmod(abs(lerp(d.texcoord0.x, d.texcoord0.x + (_GrassWind * 0.01 * _GrassManualAnim), uvRect.y)), 1); + windOffset = _GrassManualAnim; + #endif + half2 delta = d.texcoord0.xy - windCenter; + half delta2 = dot(delta.xy, delta.xy); + half2 delta_offset = delta2 * windOffset; + d.texcoord0.xy = d.texcoord0.xy + half2(delta.y, -delta.x) * delta_offset * _GrassRadialBend; + #endif + + //-------------------------------------------------------- + + //TEXTURESCROLL_ON && !ATLAS_ON + #if TEXTURESCROLL_ON && !ATLAS_ON + d.texcoord0.x += ((_Time.y + randomSeed) * _TextureScrollXSpeed) % 1; + d.texcoord0.y += ((_Time.y + randomSeed) * _TextureScrollYSpeed) % 1; + #endif + //------------------------------ + + //PIXELATE_ON + #if PIXELATE_ON + half aspectRatio = _MainTex_TexelSize.x / _MainTex_TexelSize.y; + half2 pixelSize = float2(_PixelateSize, _PixelateSize * aspectRatio); + d.texcoord0.xy = floor(d.texcoord0.xy * pixelSize) / pixelSize; + #endif + //-------------- + + half4 col = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy); + half originalAlpha = col.a; + col *= d.vertexColor; + + //NORMAL MAP + #if NORMALMAP_ON + half4 normalSample = SAMPLE_TEXTURE2D(_NormalMap, sampler_NormalMap, d.texcoord0.xy); + half3 normalTS = UnpackNormal(normalSample); + normalTS.xy *= _NormalStrength; + o.Normal = normalTS; + #endif + + + //GLITCH_ON + #if GLITCH_ON + half2 uvGlitch = uvRect; + uvGlitch.y -= 0.5; + half lineNoise = pow(rand2(floor(uvGlitch * half2(24., 19.) * _GlitchSize) * 4.0, randomSeed), 3.0) * _GlitchAmount + * pow(rand2(floor(uvGlitch * half2(38., 14.) * _GlitchSize) * 4.0, randomSeed), 3.0); + col = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(lineNoise * 0.02 * rand2(half2(2.0, 1), randomSeed), 0)) * d.vertexColor; + #endif + //-------------------------------------- + + //CHROMABERR_ON + #if CHROMABERR_ON + half4 r = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(_ChromAberrAmount/10, 0)) * d.vertexColor; + half4 b = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(-_ChromAberrAmount/10, 0)) * d.vertexColor; + col = half4(r.r * r.a, col.g, b.b * b.a, max(max(r.a, b.a) * _ChromAberrAlpha, col.a)); + #endif + + //-------------------------------- + + //BLUR_ON + #if BLUR_ON + #if ATLAS_ON + #if !BLURISHD_ON + col = BlurHD(d.texcoord0.xy, _MainTex, sampler_MainTex, _BlurIntensity, (_MaxXUV - _MinXUV), (_MaxYUV - _MinYUV)) * d.vertexColor; + #else + col = Blur(d.texcoord0.xy, _MainTex, sampler_MainTex, _BlurIntensity * (_MaxXUV - _MinXUV)) * d.vertexColor; + #endif + #else + #if !BLURISHD_ON + col = BlurHD(d.texcoord0.xy, _MainTex, sampler_MainTex, _BlurIntensity, 1, 1) * d.vertexColor; + #else + col = Blur(d.texcoord0.xy, _MainTex, sampler_MainTex, _BlurIntensity) * d.vertexColor; + #endif + #endif + #endif + + //-------------------- + + //MOTIONBLUR_ON + #if MOTIONBLUR_ON + _MotionBlurAngle = _MotionBlurAngle * 3.1415926; + #define rot(n) mul(n, half2x2(cos(_MotionBlurAngle), -sin(_MotionBlurAngle), sin(_MotionBlurAngle), cos(_MotionBlurAngle))) + _MotionBlurDist = _MotionBlurDist * 0.005; + #if ATLAS_ON + _MotionBlurDist *= (_MaxXUV - _MinXUV); + #endif + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(-_MotionBlurDist, -_MotionBlurDist))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(-_MotionBlurDist * 2, -_MotionBlurDist * 2))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(-_MotionBlurDist * 3, -_MotionBlurDist * 3))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(-_MotionBlurDist * 4, -_MotionBlurDist * 4))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(_MotionBlurDist, _MotionBlurDist))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(_MotionBlurDist * 2, _MotionBlurDist * 2))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(_MotionBlurDist * 3, _MotionBlurDist * 3))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(_MotionBlurDist * 4, _MotionBlurDist * 4))); + col.rgb = col.rgb / 9; + #endif + //------------------------------------ + + //NEGATIVE_ON + #if NEGATIVE_ON + col.rgb = lerp(col.rgb, 1 - col.rgb, _NegativeAmount); + #endif + + //-------------- + half luminance = 0; + + //GREYSCALE_ON && !GREYSCALEOUTLINE_ON + #if GREYSCALE_ON && !GREYSCALEOUTLINE_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + luminance = saturate(luminance + _GreyscaleLuminosity); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _GreyscaleTintColor, _GreyscaleBlend); + #endif + //------------------------------------ + + //GHOST_ON + #if GHOST_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + half4 ghostResult; + ghostResult.a = saturate(luminance - _GhostTransparency) * col.a; + ghostResult.rgb = col.rgb * (luminance + _GhostColorBoost); + col = lerp(col, ghostResult, _GhostBlend); + #endif + //------------------------------------ + + //INNEROUTLINE_ON + #if INNEROUTLINE_ON + half3 innerT = abs(GetPixel(0, _InnerOutlineThickness, d.texcoord0.xy, _MainTex, sampler_MainTex) - GetPixel(0, -_InnerOutlineThickness, d.texcoord0.xy, _MainTex, sampler_MainTex)); + innerT += abs(GetPixel(_InnerOutlineThickness, 0, d.texcoord0.xy, _MainTex, sampler_MainTex) - GetPixel(-_InnerOutlineThickness, 0, d.texcoord0.xy, _MainTex, sampler_MainTex)); + #if !ONLYINNEROUTLINE_ON + innerT = (innerT / 2.0) * col.a * _InnerOutlineAlpha; + col.rgb += length(innerT) * _InnerOutlineColor.rgb * _InnerOutlineGlow; + #else + innerT *= col.a * _InnerOutlineAlpha; + col.rgb = length(innerT) * _InnerOutlineColor.rgb * _InnerOutlineGlow; + col.a = step(0.3, col.r+col.g+col.b); + #endif + #endif + //------------------------------------------------------- + + //HITEFFECT_ON + #if HITEFFECT_ON + col.rgb = lerp(col.rgb, _HitEffectColor.rgb * _HitEffectGlow, _HitEffectBlend); + #endif + //-------------------- + + //GRADIENT_ON + #if GRADIENT_ON + half2 tiledUvGrad = half2(uvRect.x / _MainTex_ST.x, uvRect.y / _MainTex_ST.y); + #if GRADIENT2COL_ON + _GradTopRightCol = _GradTopLeftCol; + _GradBotRightCol = _GradBotLeftCol; + #endif + #if RADIALGRADIENT_ON + half radialDist = 1 - length(tiledUvGrad - half2(0.5, 0.5)); + radialDist *= (_MainTex_TexelSize.w / _MainTex_TexelSize.z); + radialDist = saturate(_GradBoostX * radialDist); + half4 gradientResult = lerp(_GradTopLeftCol, _GradBotLeftCol, radialDist); + #else + half gradXLerpFactor = saturate(pow(tiledUvGrad.x, _GradBoostX)); + half4 gradientResult = lerp(lerp(_GradBotLeftCol, _GradBotRightCol, gradXLerpFactor), + lerp(_GradTopLeftCol, _GradTopRightCol, gradXLerpFactor), saturate(pow(tiledUvGrad.y, _GradBoostY))); + #endif + gradientResult = lerp(col, gradientResult, _GradBlend); + col.rgb = gradientResult.rgb * col.a; + col.a *= gradientResult.a; + #endif + //-------------------------------------------------------------------- + + //CONTRAST_ON + #if CONTRAST_ON + col.rgb = (col.rgb - float3(0.5, 0.5, 0.5)) * _Contrast + float3(0.5, 0.5, 0.5); + col.rgb += _Brightness; + #endif + + //------------------------------------------------------------------- + + //COLORSWAP_ON + #if COLORSWAP_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + half4 swapMask = SAMPLE_TEXTURE2D(_ColorSwapTex, sampler_ColorSwapTex, d.texcoord0.xy); + swapMask.rgb *= swapMask.a; + half3 redSwap = _ColorSwapRed * swapMask.r * saturate(luminance + _ColorSwapRedLuminosity); + half3 greenSwap = _ColorSwapGreen * swapMask.g * saturate(luminance + _ColorSwapGreenLuminosity); + half3 blueSwap = _ColorSwapBlue * swapMask.b * saturate(luminance + _ColorSwapBlueLuminosity); + swapMask.rgb = col.rgb * saturate(1 - swapMask.r - swapMask.g - swapMask.b); + col.rgb = lerp(col.rgb, swapMask.rgb + redSwap + greenSwap + blueSwap, _ColorSwapBlend); + #endif + //-------------------------------------------------------------------- + + //COLORRAMP_ON && !COLORRAMPOUTLINE_ON + #if COLORRAMP_ON && !COLORRAMPOUTLINE_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + luminance = saturate(luminance + _ColorRampLuminosity); + #if GRADIENTCOLORRAMP_ON + col.rgb = lerp(col.rgb, SAMPLE_TEXTURE2D(_ColorRampTexGradient, sampler_ColorRampTexGradient, half2(luminance, 0)).rgb, _ColorRampBlend); + #else + col.rgb = lerp(col.rgb, SAMPLE_TEXTURE2D(_ColorRampTex, sampler_ColorRampTex, half2(luminance, 0)).rgb, _ColorRampBlend); + #endif + #endif + //-------------------------------------------------------------------- + + //CHANGECOLOR_ON + #if CHANGECOLOR_ON + float3 currChangeColor = saturate(col.rgb); + luminance = 0.3 * currChangeColor.r + 0.59 * currChangeColor.g + 0.11 * currChangeColor.b; + luminance = saturate(luminance + _ColorChangeLuminosity); + half3 dif = abs(currChangeColor - _ColorChangeTarget.rgb); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _ColorChangeNewCol.rgb, + max(sign(1 - saturate(dif.x + dif.y + dif.z) - _ColorChangeTolerance), 0.0)); + #if CHANGECOLOR2_ON + dif = abs(currChangeColor - _ColorChangeTarget2.rgb); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _ColorChangeNewCol2.rgb, + max(sign(1 - saturate(dif.x + dif.y + dif.z) - _ColorChangeTolerance2), 0.0)); + #endif + #if CHANGECOLOR3_ON + dif = abs(currChangeColor - _ColorChangeTarget3.rgb); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _ColorChangeNewCol3.rgb, + max(sign(1 - saturate(dif.x + dif.y + dif.z) - _ColorChangeTolerance3), 0.0)); + #endif + #endif + //------------------------------------------------------- + + //POSTERIZE_ON && !POSTERIZEOUTLINE_ON + #if POSTERIZE_ON && !POSTERIZEOUTLINE_ON + col.rgb = pow(col.rgb, _PosterizeGamma) * _PosterizeNumColors; + col.rgb = floor(col.rgb) / _PosterizeNumColors; + col.rgb = pow(col.rgb, 1.0 / _PosterizeGamma); + #endif + //------------------------------------ + + //HSV_ON + #if HSV_ON + half3 resultHsv = half3(col.rgb); + half cosHsv = _HsvBright * _HsvSaturation * cos(_HsvShift * 3.14159265 / 180); + half sinHsv = _HsvBright * _HsvSaturation * sin(_HsvShift * 3.14159265 / 180); + resultHsv.x = (.299 * _HsvBright + .701 * cosHsv + .168 * sinHsv) * col.x + + (.587 * _HsvBright - .587 * cosHsv + .330 * sinHsv) * col.y + + (.114 * _HsvBright - .114 * cosHsv - .497 * sinHsv) * col.z; + resultHsv.y = (.299 * _HsvBright - .299 * cosHsv - .328 * sinHsv) *col.x + + (.587 * _HsvBright + .413 * cosHsv + .035 * sinHsv) * col.y + + (.114 * _HsvBright - .114 * cosHsv + .292 * sinHsv) * col.z; + resultHsv.z = (.299 * _HsvBright - .3 * cosHsv + 1.25 * sinHsv) * col.x + + (.587 * _HsvBright - .588 * cosHsv - 1.05 * sinHsv) * col.y + + (.114 * _HsvBright + .886 * cosHsv - .203 * sinHsv) * col.z; + col.rgb = resultHsv; + #endif + //------------------------------------------------------- + + //OVERLAY_ON + #if OVERLAY_ON + half2 overlayUvs = d.texcoord0.xy; + overlayUvs.x += ((_Time.y + randomSeed) * _OverlayTextureScrollXSpeed) % 1; + overlayUvs.y += ((_Time.y + randomSeed) * _OverlayTextureScrollYSpeed) % 1; + half4 overlayCol = SAMPLE_TEXTURE2D(_OverlayTex, sampler_OverlayTex, TRANSFORM_TEX(overlayUvs, _OverlayTex)); + overlayCol.rgb *= _OverlayColor.rgb * _OverlayGlow; + #if !OVERLAYMULT_ON + overlayCol.rgb *= overlayCol.a * _OverlayColor.rgb * _OverlayColor.a * _OverlayBlend; + col.rgb += overlayCol.rgb; + #else + overlayCol.a *= _OverlayColor.a; + col = lerp(col, col * overlayCol, _OverlayBlend); + #endif + #endif + + //--------------------------------- + + //OUTBASE_ON + #if OUTBASE_ON + #if OUTBASEPIXELPERF_ON + half2 destUv = half2(_OutlinePixelWidth * _MainTex_TexelSize.x, _OutlinePixelWidth * _MainTex_TexelSize.y); + #else + half2 destUv = half2(_OutlineWidth * _MainTex_TexelSize.x * 200, _OutlineWidth * _MainTex_TexelSize.y * 200); + #endif + + #if OUTDIST_ON + d.texcoord3.x += ((_Time.x + _RandomSeed) * _OutlineDistortTexXSpeed) % 1; + d.texcoord3.y += ((_Time.x + _RandomSeed) * _OutlineDistortTexYSpeed) % 1; + #if ATLAS_ON + d.texcoord3 = half2((d.texcoord3.x - _MinXUV) / (_MaxXUV - _MinXUV), (d.texcoord3.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half outDistortAmnt = (SAMPLE_TEXTURE2D(_OutlineDistortTex, sampler_OutlineDistortTex, d.texcoord3).r - 0.5) * 0.2 * _OutlineDistortAmount; + destUv.x += outDistortAmnt; + destUv.y += outDistortAmnt; + #endif + + half spriteLeft = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(destUv.x, 0)).a; + half spriteRight = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy - half2(destUv.x, 0)).a; + half spriteBottom = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(0, destUv.y)).a; + half spriteTop = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy - half2(0, destUv.y)).a; + half result = spriteLeft + spriteRight + spriteBottom + spriteTop; + + #if OUTBASE8DIR_ON + half spriteTopLeft = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(destUv.x, destUv.y)).a; + half spriteTopRight = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(-destUv.x, destUv.y)).a; + half spriteBotLeft = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(destUv.x, -destUv.y)).a; + half spriteBotRight = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(-destUv.x, -destUv.y)).a; + result = result + spriteTopLeft + spriteTopRight + spriteBotLeft + spriteBotRight; + #endif + + result = step(0.05, saturate(result)); + + #if OUTTEX_ON + d.texcoord1.x += ((_Time.x + _RandomSeed) * _OutlineTexXSpeed) % 1; + d.texcoord1.y += ((_Time.x + _RandomSeed) * _OutlineTexYSpeed) % 1; + #if ATLAS_ON + d.texcoord1 = half2((d.texcoord1.x - _MinXUV) / (_MaxXUV - _MinXUV), (d.texcoord1.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half4 tempOutColor = SAMPLE_TEXTURE2D(_OutlineTex, sampler_OutlineTex, d.texcoord1); + tempOutColor *= _OutlineColor; + _OutlineColor = tempOutColor; + #endif + + result *= (1 - originalAlpha) * _OutlineAlpha; + + half4 outline = _OutlineColor * d.vertexColor.a; + outline.rgb *= _OutlineGlow; + outline.a = result; + #if ONLYOUTLINE_ON + col = outline; + #else + col = lerp(col, outline, result); + #endif + #endif + //------------------------------------------------------- + + //FADE_ON + #if FADE_ON + half2 tiledUvFade1 = TRANSFORM_TEX(d.texcoord0, _FadeTex); + half2 tiledUvFade2 = TRANSFORM_TEX(d.texcoord0, _FadeBurnTex); + #if ATLAS_ON + tiledUvFade1 = half2((tiledUvFade1.x - _MinXUV) / (_MaxXUV - _MinXUV), (tiledUvFade1.y - _MinYUV) / (_MaxYUV - _MinYUV)); + tiledUvFade2 = half2((tiledUvFade2.x - _MinXUV) / (_MaxXUV - _MinXUV), (tiledUvFade2.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half fadeTemp = SAMPLE_TEXTURE2D(_FadeTex, sampler_FadeTex, tiledUvFade1).r; + half fade = smoothstep(_FadeAmount, _FadeAmount + _FadeBurnTransition, fadeTemp); + half fadeBurn = saturate(smoothstep(_FadeAmount - _FadeBurnWidth, _FadeAmount - _FadeBurnWidth + 0.1, fadeTemp) * _FadeAmount); + col.a *= fade; + _FadeBurnColor.rgb *= _FadeBurnGlow; + col += fadeBurn * SAMPLE_TEXTURE2D(_FadeBurnTex, sampler_FadeBurnTex, tiledUvFade2) * _FadeBurnColor * originalAlpha * (1 - col.a); + #endif + //------------------------------------------------------- + + //SHADOW_ON + #if SHADOW_ON + half shadowA = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(_ShadowX, _ShadowY)).a; + half preMultShadowMask = 1 - (saturate(shadowA - col.a) * (1 - col.a)); + col.rgb *= 1 - ((shadowA - col.a) * (1 - col.a)); + col.rgb += (_ShadowColor * shadowA) * (1 - col.a); + col.a = max(shadowA * _ShadowAlpha * d.vertexColor.a, col.a); + #endif + + //------------------------------------------------------- + + //GLOW_ON + #if GLOW_ON + half4 emission; + #if GLOWTEX_ON + emission = SAMPLE_TEXTURE2D(_GlowTex, sampler_GlowTex, d.texcoord0); + #else + emission = col; + #endif + + col.rgb *= _GlowGlobal; + emission.rgb *= emission.a * col.a * _Glow * _GlowColor; + col.rgb += emission.rgb; + #endif + //------------------------------------------------------- + + //COLORRAMP_ON && COLORRAMPOUTLINE_ON + #if COLORRAMP_ON && COLORRAMPOUTLINE_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + luminance = saturate(luminance + _ColorRampLuminosity); + #if GRADIENTCOLORRAMP_ON + col.rgb = lerp(col.rgb, SAMPLE_TEXTURE2D(_ColorRampTexGradient, sampler_ColorRampTexGradient, half2(luminance, 0)).rgb, _ColorRampBlend); + #else + col.rgb = lerp(col.rgb, SAMPLE_TEXTURE2D(_ColorRampTex, sampler_ColorRampTex, half2(luminance, 0)).rgb, _ColorRampBlend); + #endif + #endif + //--------------- + + //GREYSCALE_ON && GREYSCALEOUTLINE_ON + #if GREYSCALE_ON && GREYSCALEOUTLINE_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + luminance = saturate(luminance + _GreyscaleLuminosity); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _GreyscaleTintColor, _GreyscaleBlend); + #endif + + //----------------------------------- + + //POSTERIZE_ON && POSTERIZEOUTLINE_ON + #if POSTERIZE_ON && POSTERIZEOUTLINE_ON + col.rgb = pow(col.rgb, _PosterizeGamma) * _PosterizeNumColors; + col.rgb = floor(col.rgb) / _PosterizeNumColors; + col.rgb = pow(col.rgb, 1.0 / _PosterizeGamma); + #endif + + //----------------------------------- + + //SHINE_ON + #if SHINE_ON + half2 uvShine = uvRect; + half cosAngle = cos(_ShineRotate); + half sinAngle = sin(_ShineRotate); + half2x2 rot = half2x2(cosAngle, -sinAngle, sinAngle, cosAngle); + uvShine -= half2(0.5, 0.5); + uvShine = mul(rot, uvShine); + uvShine += half2(0.5, 0.5); + half shineMask = SAMPLE_TEXTURE2D(_ShineMask, sampler_ShineMask, d.texcoord0.xy).a; + half currentDistanceProjection = (uvShine.x + uvShine.y) / 2; + half whitePower = 1 - (abs(currentDistanceProjection - _ShineLocation) / _ShineWidth); + col.rgb += col.a * whitePower * _ShineGlow * max(sign(currentDistanceProjection - (_ShineLocation - _ShineWidth)), 0.0) + * max(sign((_ShineLocation + _ShineWidth) - currentDistanceProjection), 0.0) * _ShineColor * shineMask; + #endif + + //----------------------------------- + + //HOLOGRAM_ON + #if HOLOGRAM_ON + half totalHologram = _HologramStripesAmount + _HologramUnmodAmount; + half hologramYCoord = ((uvRect.y + (((_Time.x + randomSeed) % 1) * _HologramStripesSpeed)) % totalHologram) / totalHologram; + hologramYCoord = abs(hologramYCoord); + half alpha = RemapFloat(saturate(hologramYCoord - (_HologramUnmodAmount/totalHologram)), 0.0, 1.0, _HologramMinAlpha, saturate(_HologramMaxAlpha)); + half hologramMask = max(sign((_HologramUnmodAmount/totalHologram) - hologramYCoord), 0.0); + half4 hologramResult = col; + hologramResult.a *= lerp(alpha, 1, hologramMask); + hologramResult.rgb *= max(1, _HologramMaxAlpha * max(sign(hologramYCoord - (_HologramUnmodAmount/totalHologram)), 0.0)); + hologramMask = 1 - step(0.01,hologramMask); + hologramResult.rgb += hologramMask * _HologramStripeColor * col.a; + col = lerp(col, hologramResult, _HologramBlend); + #endif + + //----------------------------------- + + //FLICKER_ON + #if FLICKER_ON + col.a *= saturate(col.a * step(frac(0.05 + (_Time.w + randomSeed) * _FlickerFreq), 1 - _FlickerPercent) + _FlickerAlpha); + #endif + //----------------------------------- + + //ALPHACUTOFF_ON + + //ALPHAROUND_ON + + //ALPHAOUTLINE_ON + #if ALPHAOUTLINE_ON + half alphaOutlineRes = pow(1 - col.a, max(_AlphaOutlinePower, 0.0001)) * step(_AlphaOutlineMinAlpha, col.a) * _AlphaOutlineBlend; + col.rgb = lerp(col.rgb, _AlphaOutlineColor.rgb * _AlphaOutlineGlow, alphaOutlineRes); + col.a = lerp(col.a, 1, alphaOutlineRes > 1); + #endif + //------------------------------------------------------- + + //FOG_ON + + //------------------ + + col *= _Color; + o.Albedo = col; + col.a *= _Alpha; + clip(col.a - _AlphaCutoffValue - 0.01); + o.Alpha = _Color.a; + } + + + + + + void ChainSurfaceFunction(inout Surface l, inout ShaderData d) + { + Ext_SurfaceFunction0(l, d); + // Ext_SurfaceFunction1(l, d); + // Ext_SurfaceFunction2(l, d); + // Ext_SurfaceFunction3(l, d); + // Ext_SurfaceFunction4(l, d); + // Ext_SurfaceFunction5(l, d); + // Ext_SurfaceFunction6(l, d); + // Ext_SurfaceFunction7(l, d); + // Ext_SurfaceFunction8(l, d); + // Ext_SurfaceFunction9(l, d); + // Ext_SurfaceFunction10(l, d); + // Ext_SurfaceFunction11(l, d); + // Ext_SurfaceFunction12(l, d); + // Ext_SurfaceFunction13(l, d); + // Ext_SurfaceFunction14(l, d); + // Ext_SurfaceFunction15(l, d); + // Ext_SurfaceFunction16(l, d); + // Ext_SurfaceFunction17(l, d); + // Ext_SurfaceFunction18(l, d); + // Ext_SurfaceFunction19(l, d); + // Ext_SurfaceFunction20(l, d); + // Ext_SurfaceFunction21(l, d); + // Ext_SurfaceFunction22(l, d); + // Ext_SurfaceFunction23(l, d); + // Ext_SurfaceFunction24(l, d); + // Ext_SurfaceFunction25(l, d); + // Ext_SurfaceFunction26(l, d); + // Ext_SurfaceFunction27(l, d); + // Ext_SurfaceFunction28(l, d); + // Ext_SurfaceFunction29(l, d); + } + +#if !_DECALSHADER + + void ChainModifyVertex(inout VertexData v, inout VertexToPixel v2p, float4 time) + { + ExtraV2F d; + + ZERO_INITIALIZE(ExtraV2F, d); + ZERO_INITIALIZE(Blackboard, d.blackboard); + // due to motion vectors in HDRP, we need to use the last + // time in certain spots. So if you are going to use _Time to adjust vertices, + // you need to use this time or motion vectors will break. + d.time = time; + + Ext_ModifyVertex0(v, d); + // Ext_ModifyVertex1(v, d); + // Ext_ModifyVertex2(v, d); + // Ext_ModifyVertex3(v, d); + // Ext_ModifyVertex4(v, d); + // Ext_ModifyVertex5(v, d); + // Ext_ModifyVertex6(v, d); + // Ext_ModifyVertex7(v, d); + // Ext_ModifyVertex8(v, d); + // Ext_ModifyVertex9(v, d); + // Ext_ModifyVertex10(v, d); + // Ext_ModifyVertex11(v, d); + // Ext_ModifyVertex12(v, d); + // Ext_ModifyVertex13(v, d); + // Ext_ModifyVertex14(v, d); + // Ext_ModifyVertex15(v, d); + // Ext_ModifyVertex16(v, d); + // Ext_ModifyVertex17(v, d); + // Ext_ModifyVertex18(v, d); + // Ext_ModifyVertex19(v, d); + // Ext_ModifyVertex20(v, d); + // Ext_ModifyVertex21(v, d); + // Ext_ModifyVertex22(v, d); + // Ext_ModifyVertex23(v, d); + // Ext_ModifyVertex24(v, d); + // Ext_ModifyVertex25(v, d); + // Ext_ModifyVertex26(v, d); + // Ext_ModifyVertex27(v, d); + // Ext_ModifyVertex28(v, d); + // Ext_ModifyVertex29(v, d); + + + // #if %EXTRAV2F0REQUIREKEY% + // v2p.extraV2F0 = d.extraV2F0; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // v2p.extraV2F1 = d.extraV2F1; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // v2p.extraV2F2 = d.extraV2F2; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // v2p.extraV2F3 = d.extraV2F3; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // v2p.extraV2F4 = d.extraV2F4; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // v2p.extraV2F5 = d.extraV2F5; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // v2p.extraV2F6 = d.extraV2F6; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // v2p.extraV2F7 = d.extraV2F7; + // #endif + } + + void ChainModifyTessellatedVertex(inout VertexData v, inout VertexToPixel v2p) + { + ExtraV2F d; + ZERO_INITIALIZE(ExtraV2F, d); + ZERO_INITIALIZE(Blackboard, d.blackboard); + + // #if %EXTRAV2F0REQUIREKEY% + // d.extraV2F0 = v2p.extraV2F0; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // d.extraV2F1 = v2p.extraV2F1; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // d.extraV2F2 = v2p.extraV2F2; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // d.extraV2F3 = v2p.extraV2F3; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // d.extraV2F4 = v2p.extraV2F4; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // d.extraV2F5 = v2p.extraV2F5; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // d.extraV2F6 = v2p.extraV2F6; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // d.extraV2F7 = v2p.extraV2F7; + // #endif + + + // Ext_ModifyTessellatedVertex0(v, d); + // Ext_ModifyTessellatedVertex1(v, d); + // Ext_ModifyTessellatedVertex2(v, d); + // Ext_ModifyTessellatedVertex3(v, d); + // Ext_ModifyTessellatedVertex4(v, d); + // Ext_ModifyTessellatedVertex5(v, d); + // Ext_ModifyTessellatedVertex6(v, d); + // Ext_ModifyTessellatedVertex7(v, d); + // Ext_ModifyTessellatedVertex8(v, d); + // Ext_ModifyTessellatedVertex9(v, d); + // Ext_ModifyTessellatedVertex10(v, d); + // Ext_ModifyTessellatedVertex11(v, d); + // Ext_ModifyTessellatedVertex12(v, d); + // Ext_ModifyTessellatedVertex13(v, d); + // Ext_ModifyTessellatedVertex14(v, d); + // Ext_ModifyTessellatedVertex15(v, d); + // Ext_ModifyTessellatedVertex16(v, d); + // Ext_ModifyTessellatedVertex17(v, d); + // Ext_ModifyTessellatedVertex18(v, d); + // Ext_ModifyTessellatedVertex19(v, d); + // Ext_ModifyTessellatedVertex20(v, d); + // Ext_ModifyTessellatedVertex21(v, d); + // Ext_ModifyTessellatedVertex22(v, d); + // Ext_ModifyTessellatedVertex23(v, d); + // Ext_ModifyTessellatedVertex24(v, d); + // Ext_ModifyTessellatedVertex25(v, d); + // Ext_ModifyTessellatedVertex26(v, d); + // Ext_ModifyTessellatedVertex27(v, d); + // Ext_ModifyTessellatedVertex28(v, d); + // Ext_ModifyTessellatedVertex29(v, d); + + // #if %EXTRAV2F0REQUIREKEY% + // v2p.extraV2F0 = d.extraV2F0; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // v2p.extraV2F1 = d.extraV2F1; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // v2p.extraV2F2 = d.extraV2F2; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // v2p.extraV2F3 = d.extraV2F3; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // v2p.extraV2F4 = d.extraV2F4; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // v2p.extraV2F5 = d.extraV2F5; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // v2p.extraV2F6 = d.extraV2F6; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // v2p.extraV2F7 = d.extraV2F7; + // #endif + } + + void ChainFinalColorForward(inout Surface l, inout ShaderData d, inout half4 color) + { + // Ext_FinalColorForward0(l, d, color); + // Ext_FinalColorForward1(l, d, color); + // Ext_FinalColorForward2(l, d, color); + // Ext_FinalColorForward3(l, d, color); + // Ext_FinalColorForward4(l, d, color); + // Ext_FinalColorForward5(l, d, color); + // Ext_FinalColorForward6(l, d, color); + // Ext_FinalColorForward7(l, d, color); + // Ext_FinalColorForward8(l, d, color); + // Ext_FinalColorForward9(l, d, color); + // Ext_FinalColorForward10(l, d, color); + // Ext_FinalColorForward11(l, d, color); + // Ext_FinalColorForward12(l, d, color); + // Ext_FinalColorForward13(l, d, color); + // Ext_FinalColorForward14(l, d, color); + // Ext_FinalColorForward15(l, d, color); + // Ext_FinalColorForward16(l, d, color); + // Ext_FinalColorForward17(l, d, color); + // Ext_FinalColorForward18(l, d, color); + // Ext_FinalColorForward19(l, d, color); + // Ext_FinalColorForward20(l, d, color); + // Ext_FinalColorForward21(l, d, color); + // Ext_FinalColorForward22(l, d, color); + // Ext_FinalColorForward23(l, d, color); + // Ext_FinalColorForward24(l, d, color); + // Ext_FinalColorForward25(l, d, color); + // Ext_FinalColorForward26(l, d, color); + // Ext_FinalColorForward27(l, d, color); + // Ext_FinalColorForward28(l, d, color); + // Ext_FinalColorForward29(l, d, color); + } + + void ChainFinalGBufferStandard(inout Surface s, inout ShaderData d, inout half4 GBuffer0, inout half4 GBuffer1, inout half4 GBuffer2, inout half4 outEmission, inout half4 outShadowMask) + { + // Ext_FinalGBufferStandard0(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard1(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard2(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard3(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard4(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard5(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard6(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard7(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard8(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard9(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard10(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard11(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard12(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard13(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard14(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard15(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard16(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard17(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard18(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard19(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard20(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard21(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard22(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard23(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard24(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard25(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard26(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard27(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard28(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard29(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + } +#endif + + + + + +#if _DECALSHADER + + ShaderData CreateShaderData(SurfaceDescriptionInputs IN) + { + ShaderData d = (ShaderData)0; + d.TBNMatrix = float3x3(IN.WorldSpaceTangent, IN.WorldSpaceBiTangent, IN.WorldSpaceNormal); + d.worldSpaceNormal = IN.WorldSpaceNormal; + d.worldSpaceTangent = IN.WorldSpaceTangent; + + d.worldSpacePosition = IN.WorldSpacePosition; + d.texcoord0 = IN.uv0.xyxy; + d.screenPos = IN.ScreenPosition; + + d.worldSpaceViewDir = normalize(_WorldSpaceCameraPos - d.worldSpacePosition); + + d.tangentSpaceViewDir = mul(d.TBNMatrix, d.worldSpaceViewDir); + + // these rarely get used, so we back transform them. Usually will be stripped. + #if _HDRP + // d.localSpacePosition = mul(GetWorldToObjectMatrix(), float4(GetCameraRelativePositionWS(d.worldSpacePosition), 1)).xyz; + #else + // d.localSpacePosition = mul(GetWorldToObjectMatrix(), float4(d.worldSpacePosition, 1)).xyz; + #endif + // d.localSpaceNormal = normalize(mul((float3x3)GetWorldToObjectMatrix(), d.worldSpaceNormal)); + // d.localSpaceTangent = normalize(mul((float3x3)GetWorldToObjectMatrix(), d.worldSpaceTangent.xyz)); + + // #if %SCREENPOSREQUIREKEY% + // d.screenUV = (IN.ScreenPosition.xy / max(0.01, IN.ScreenPosition.w)); + // #endif + + return d; + } +#else + + ShaderData CreateShaderData(VertexToPixel i + #if NEED_FACING + , bool facing + #endif + ) + { + ShaderData d = (ShaderData)0; + d.clipPos = i.pos; + d.worldSpacePosition = i.worldPos; + + d.worldSpaceNormal = normalize(i.worldNormal); + d.worldSpaceTangent.xyz = normalize(i.worldTangent.xyz); + + d.tangentSign = i.worldTangent.w * unity_WorldTransformParams.w; + float3 bitangent = cross(d.worldSpaceTangent.xyz, d.worldSpaceNormal) * d.tangentSign; + + d.TBNMatrix = float3x3(d.worldSpaceTangent, -bitangent, d.worldSpaceNormal); + d.worldSpaceViewDir = normalize(_WorldSpaceCameraPos - i.worldPos); + + d.tangentSpaceViewDir = mul(d.TBNMatrix, d.worldSpaceViewDir); + d.texcoord0 = i.texcoord0; + d.texcoord1 = i.texcoord1; + d.texcoord2 = i.texcoord2; + + // #if %TEXCOORD3REQUIREKEY% + d.texcoord3 = i.texcoord3; + // #endif + + // d.isFrontFace = facing; + // #if %VERTEXCOLORREQUIREKEY% + d.vertexColor = i.vertexColor; + // #endif + + // these rarely get used, so we back transform them. Usually will be stripped. + #if _HDRP + // d.localSpacePosition = mul(GetWorldToObjectMatrix(), float4(GetCameraRelativePositionWS(i.worldPos), 1)).xyz; + #else + // d.localSpacePosition = mul(GetWorldToObjectMatrix(), float4(i.worldPos, 1)).xyz; + #endif + // d.localSpaceNormal = normalize(mul((float3x3)GetWorldToObjectMatrix(), i.worldNormal)); + // d.localSpaceTangent = normalize(mul((float3x3)GetWorldToObjectMatrix(), i.worldTangent.xyz)); + + // #if %SCREENPOSREQUIREKEY% + // d.screenPos = i.screenPos; + // d.screenUV = (i.screenPos.xy / i.screenPos.w); + // #endif + + + // #if %EXTRAV2F0REQUIREKEY% + // d.extraV2F0 = i.extraV2F0; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // d.extraV2F1 = i.extraV2F1; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // d.extraV2F2 = i.extraV2F2; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // d.extraV2F3 = i.extraV2F3; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // d.extraV2F4 = i.extraV2F4; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // d.extraV2F5 = i.extraV2F5; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // d.extraV2F6 = i.extraV2F6; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // d.extraV2F7 = i.extraV2F7; + // #endif + + return d; + } + +#endif + + + #if defined(_PASSSHADOW) + float3 _LightDirection; + float3 _LightPosition; + #endif + + // vertex shader + VertexToPixel Vert (VertexData v) + { + + VertexToPixel o = (VertexToPixel)0; + + UNITY_SETUP_INSTANCE_ID(v); + UNITY_TRANSFER_INSTANCE_ID(v, o); + UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o); + + +#if !_TESSELLATION_ON + ChainModifyVertex(v, o, _Time); +#endif + + o.texcoord0 = v.texcoord0; + o.texcoord1 = v.texcoord1; + o.texcoord2 = v.texcoord2; + + // #if %TEXCOORD3REQUIREKEY% + o.texcoord3 = v.texcoord3; + // #endif + + // #if %VERTEXCOLORREQUIREKEY% + o.vertexColor = v.vertexColor; + // #endif + + VertexPositionInputs vertexInput = GetVertexPositionInputs(v.vertex.xyz); + o.worldPos = TransformObjectToWorld(v.vertex.xyz); + o.worldNormal = TransformObjectToWorldNormal(v.normal); + o.worldTangent = float4(TransformObjectToWorldDir(v.tangent.xyz), v.tangent.w); + + // For some very odd reason, in 2021.2, we can't use Unity's defines, but have to use our own.. + #if _PASSSHADOW + #if _CASTING_PUNCTUAL_LIGHT_SHADOW + float3 lightDirectionWS = normalize(_LightPosition - o.worldPos); + #else + float3 lightDirectionWS = _LightDirection; + #endif + // Define shadow pass specific clip position for Universal + o.pos = TransformWorldToHClip(ApplyShadowBias(o.worldPos, o.worldNormal, lightDirectionWS)); + #if UNITY_REVERSED_Z + o.pos.z = min(o.pos.z, UNITY_NEAR_CLIP_VALUE); + #else + o.pos.z = max(o.pos.z, UNITY_NEAR_CLIP_VALUE); + #endif + #elif _PASSMETA + o.pos = MetaVertexPosition(float4(v.vertex.xyz, 0), v.texcoord1.xy, v.texcoord2.xy, unity_LightmapST, unity_DynamicLightmapST); + #else + o.pos = TransformWorldToHClip(o.worldPos); + #endif + + // #if %SCREENPOSREQUIREKEY% + // o.screenPos = ComputeScreenPos(o.pos, _ProjectionParams.x); + // #endif + + #if _PASSFORWARD || _PASSGBUFFER + float2 uv1 = v.texcoord1.xy; + OUTPUT_LIGHTMAP_UV(uv1, unity_LightmapST, o.lightmapUV); + o.texcoord1.xy = uv1; + OUTPUT_SH(o.worldNormal, o.sh); + #if defined(DYNAMICLIGHTMAP_ON) + o.dynamicLightmapUV.xy = v.texcoord2.xy * unity_DynamicLightmapST.xy + unity_DynamicLightmapST.zw; + #endif + #endif + + #ifdef VARYINGS_NEED_FOG_AND_VERTEX_LIGHT + half fogFactor = 0; + #if defined(_FOG_FRAGMENT) + fogFactor = ComputeFogFactor(o.pos.z); + #endif + #if _BAKEDLIT + o.fogFactorAndVertexLight = half4(fogFactor, 0, 0, 0); + #else + half3 vertexLight = VertexLighting(o.worldPos, o.worldNormal); + o.fogFactorAndVertexLight = half4(fogFactor, vertexLight); + #endif + #endif + + #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR) + o.shadowCoord = GetShadowCoord(vertexInput); + #endif + + return o; + } + + + + + // fragment shader + half4 Frag (VertexToPixel IN + #if NEED_FACING + , bool facing : SV_IsFrontFace + #endif + ) : SV_Target + { + UNITY_SETUP_INSTANCE_ID(IN); + + ShaderData d = CreateShaderData(IN + #if NEED_FACING + , facing + #endif + ); + + Surface l = (Surface)0; + + l.Albedo = half3(0.5, 0.5, 0.5); + l.Normal = float3(0,0,1); + l.Occlusion = 1; + l.Alpha = 1; + + ChainSurfaceFunction(l, d); + + MetaInput metaInput = (MetaInput)0; + metaInput.Albedo = l.Albedo; + metaInput.Emission = l.Emission; + + return MetaFragment(metaInput); + + } + + ENDHLSL + + } + + + + Pass + { + Name "DepthNormals" + Tags + { + "LightMode" = "DepthNormals" + } + + // Render State + Cull Back + ZTest LEqual + ZWrite On + + Tags { "RenderType" = "Opaque" "Queue" = "Geometry" "PreviewType" = "Plane" } + Cull [_CullingOption] + ZWrite [_ZWrite] + ZTest [_ZTestMode] + + + HLSLPROGRAM + + #pragma vertex Vert + #pragma fragment Frag + + #pragma target 3.0 + + #pragma prefer_hlslcc gles + #pragma exclude_renderers d3d11_9x + #pragma multi_compile_fog + #pragma multi_compile_instancing + #pragma multi_compile _ DOTS_INSTANCING_ON + #pragma multi_compile_fragment _ LOD_FADE_CROSSFADE + #pragma multi_compile_fragment _ _WRITE_RENDERING_LAYERS + + + #define SHADERPASS SHADERPASS_DEPTHNORMALSONLY + #define _PASSDEPTH 1 + #define _PASSDEPTHNORMALS 1 + + + + #pragma shader_feature_local GLOW_ON + #pragma shader_feature_local FADE_ON + #pragma shader_feature_local OUTBASE_ON + #pragma shader_feature_local ONLYOUTLINE_ON + #pragma shader_feature_local GRADIENT_ON + #pragma shader_feature_local GRADIENT2COL_ON + #pragma shader_feature_local RADIALGRADIENT_ON + #pragma shader_feature_local COLORSWAP_ON + #pragma shader_feature_local HSV_ON + #pragma shader_feature_local CHANGECOLOR_ON + #pragma shader_feature_local CHANGECOLOR2_ON + #pragma shader_feature_local CHANGECOLOR3_ON + #pragma shader_feature_local COLORRAMP_ON + #pragma shader_feature_local GRADIENTCOLORRAMP_ON + #pragma shader_feature_local HITEFFECT_ON + #pragma shader_feature_local NEGATIVE_ON + #pragma shader_feature_local PIXELATE_ON + #pragma shader_feature_local GREYSCALE_ON + #pragma shader_feature_local POSTERIZE_ON + #pragma shader_feature_local BLUR_ON + #pragma shader_feature_local MOTIONBLUR_ON + #pragma shader_feature_local GHOST_ON + #pragma shader_feature_local ALPHAOUTLINE_ON + #pragma shader_feature_local INNEROUTLINE_ON + #pragma shader_feature_local ONLYINNEROUTLINE_ON + #pragma shader_feature_local HOLOGRAM_ON + #pragma shader_feature_local CHROMABERR_ON + #pragma shader_feature_local GLITCH_ON + #pragma shader_feature_local FLICKER_ON + #pragma shader_feature_local SHADOW_ON + #pragma shader_feature_local SHINE_ON + #pragma shader_feature_local CONTRAST_ON + #pragma shader_feature_local OVERLAY_ON + #pragma shader_feature_local OVERLAYMULT_ON + #pragma shader_feature_local DOODLE_ON + #pragma shader_feature_local WIND_ON + #pragma shader_feature_local WAVEUV_ON + #pragma shader_feature_local ROUNDWAVEUV_ON + #pragma shader_feature_local RECTSIZE_ON + #pragma shader_feature_local OFFSETUV_ON + #pragma shader_feature_local CLIPPING_ON + #pragma shader_feature_local RADIALCLIPPING_ON + #pragma shader_feature_local TEXTURESCROLL_ON + #pragma shader_feature_local ZOOMUV_ON + #pragma shader_feature_local DISTORT_ON + #pragma shader_feature_local WARP_ON + #pragma shader_feature_local TWISTUV_ON + #pragma shader_feature_local ROTATEUV_ON + #pragma shader_feature_local POLARUV_ON + #pragma shader_feature_local FISHEYE_ON + #pragma shader_feature_local PINCH_ON + #pragma shader_feature_local SHAKEUV_ON + + #pragma shader_feature_local GLOWTEX_ON + #pragma shader_feature_local OUTTEX_ON + #pragma shader_feature_local OUTDIST_ON + #pragma shader_feature_local OUTBASE8DIR_ON + #pragma shader_feature_local OUTBASEPIXELPERF_ON + #pragma shader_feature_local COLORRAMPOUTLINE_ON + #pragma shader_feature_local GREYSCALEOUTLINE_ON + #pragma shader_feature_local POSTERIZEOUTLINE_ON + #pragma shader_feature_local BLURISHD_ON + #pragma shader_feature_local MANUALWIND_ON + #pragma shader_feature_local ATLAS_ON + #pragma shader_feature_local PREMULTIPLYALPHA_ON + + #pragma shader_feature BILBOARD_ON + #pragma shader_feature BILBOARDY_ON + + #pragma shader_feature NORMALMAP_ON + + + #define _URP 1 +#define _USINGTEXCOORD1 1 +#define _USINGTEXCOORD2 1 + + + // this has to be here or specular color will be ignored. Not in SG code + #if _SIMPLELIT + #define _SPECULAR_COLOR + #endif + + + // Includes + #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Version.hlsl" + #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Color.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.shadergraph/ShaderGraphLibrary/ShaderVariablesFunctions.hlsl" + #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/LODCrossFade.hlsl" + + + + + #undef WorldNormalVector + #define WorldNormalVector(data, normal) mul(normal, data.TBNMatrix) + + #define UnityObjectToWorldNormal(normal) mul(GetObjectToWorldMatrix(), normal) + + #define _WorldSpaceLightPos0 _MainLightPosition + + #define UNITY_DECLARE_TEX2D(name) TEXTURE2D(name); SAMPLER(sampler##name); + #define UNITY_DECLARE_TEX2D_NOSAMPLER(name) TEXTURE2D(name); + #define UNITY_DECLARE_TEX2DARRAY(name) TEXTURE2D_ARRAY(name); SAMPLER(sampler##name); + #define UNITY_DECLARE_TEX2DARRAY_NOSAMPLER(name) TEXTURE2D_ARRAY(name); + + #define UNITY_SAMPLE_TEX2DARRAY(tex,coord) SAMPLE_TEXTURE2D_ARRAY(tex, sampler##tex, coord.xy, coord.z) + #define UNITY_SAMPLE_TEX2DARRAY_LOD(tex,coord,lod) SAMPLE_TEXTURE2D_ARRAY_LOD(tex, sampler##tex, coord.xy, coord.z, lod) + #define UNITY_SAMPLE_TEX2D(tex, coord) SAMPLE_TEXTURE2D(tex, sampler##tex, coord) + #define UNITY_SAMPLE_TEX2D_SAMPLER(tex, samp, coord) SAMPLE_TEXTURE2D(tex, sampler##samp, coord) + + #define UNITY_SAMPLE_TEX2D_LOD(tex,coord, lod) SAMPLE_TEXTURE2D_LOD(tex, sampler_##tex, coord, lod) + #define UNITY_SAMPLE_TEX2D_SAMPLER_LOD(tex,samplertex,coord, lod) SAMPLE_TEXTURE2D_LOD (tex, sampler##samplertex,coord, lod) + + #if defined(UNITY_COMPILER_HLSL) + #define UNITY_INITIALIZE_OUTPUT(type,name) name = (type)0; + #else + #define UNITY_INITIALIZE_OUTPUT(type,name) + #endif + + #define sampler2D_float sampler2D + #define sampler2D_half sampler2D + + + + // data across stages, stripped like the above. + struct VertexToPixel + { + float4 pos : SV_POSITION; + float3 worldPos : TEXCOORD0; + float3 worldNormal : TEXCOORD1; + float4 worldTangent : TEXCOORD2; + float4 texcoord0 : TEXCOORD3; + float4 texcoord1 : TEXCOORD4; + float4 texcoord2 : TEXCOORD5; + + // #if %TEXCOORD3REQUIREKEY% + float4 texcoord3 : TEXCOORD6; + // #endif + + // #if %SCREENPOSREQUIREKEY% + // float4 screenPos : TEXCOORD7; + // #endif + + // #if %VERTEXCOLORREQUIREKEY% + half4 vertexColor : COLOR; + // #endif + + #if defined(LIGHTMAP_ON) + float2 lightmapUV : TEXCOORD8; + #endif + #if defined(DYNAMICLIGHTMAP_ON) + float2 dynamicLightmapUV : TEXCOORD9; + #endif + #if !defined(LIGHTMAP_ON) + float3 sh : TEXCOORD10; + #endif + + #if defined(VARYINGS_NEED_FOG_AND_VERTEX_LIGHT) + float4 fogFactorAndVertexLight : TEXCOORD11; + #endif + + #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR) + float4 shadowCoord : TEXCOORD12; + #endif + + // #if %EXTRAV2F0REQUIREKEY% + // float4 extraV2F0 : TEXCOORD13; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // float4 extraV2F1 : TEXCOORD14; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // float4 extraV2F2 : TEXCOORD15; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // float4 extraV2F3 : TEXCOORD16; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // float4 extraV2F4 : TEXCOORD17; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // float4 extraV2F5 : TEXCOORD18; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // float4 extraV2F6 : TEXCOORD19; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // float4 extraV2F7 : TEXCOORD20; + // #endif + + #if UNITY_ANY_INSTANCING_ENABLED + uint instanceID : CUSTOM_INSTANCE_ID; + #endif + #if (defined(UNITY_STEREO_MULTIVIEW_ENABLED)) || (defined(UNITY_STEREO_INSTANCING_ENABLED) && (defined(SHADER_API_GLES3) || defined(SHADER_API_GLCORE))) + uint stereoTargetEyeIndexAsBlendIdx0 : BLENDINDICES0; + #endif + #if (defined(UNITY_STEREO_INSTANCING_ENABLED)) + uint stereoTargetEyeIndexAsRTArrayIdx : SV_RenderTargetArrayIndex; + #endif + #if defined(SHADER_STAGE_FRAGMENT) && defined(VARYINGS_NEED_CULLFACE) + FRONT_FACE_TYPE cullFace : FRONT_FACE_SEMANTIC; + #endif + + + }; + + + + + // data describing the user output of a pixel + struct Surface + { + half3 Albedo; + half Height; + half3 Normal; + half Smoothness; + half3 Emission; + half Metallic; + half3 Specular; + half Occlusion; + half SpecularPower; // for simple lighting + half Alpha; + float outputDepth; // if written, SV_Depth semantic is used. ShaderData.clipPos.z is unused value + // HDRP Only + half SpecularOcclusion; + half SubsurfaceMask; + half Thickness; + half CoatMask; + half CoatSmoothness; + half Anisotropy; + half IridescenceMask; + half IridescenceThickness; + int DiffusionProfileHash; + float SpecularAAThreshold; + float SpecularAAScreenSpaceVariance; + // requires _OVERRIDE_BAKEDGI to be defined, but is mapped in all pipelines + float3 DiffuseGI; + float3 BackDiffuseGI; + float3 SpecularGI; + float ior; + float3 transmittanceColor; + float atDistance; + float transmittanceMask; + // requires _OVERRIDE_SHADOWMASK to be defines + float4 ShadowMask; + + // for decals + float NormalAlpha; + float MAOSAlpha; + + + }; + + // Data the user declares in blackboard blocks + struct Blackboard + { + + float blackboardDummyData; + }; + + // data the user might need, this will grow to be big. But easy to strip + struct ShaderData + { + float4 clipPos; // SV_POSITION + float3 localSpacePosition; + float3 localSpaceNormal; + float3 localSpaceTangent; + + float3 worldSpacePosition; + float3 worldSpaceNormal; + float3 worldSpaceTangent; + float tangentSign; + + float3 worldSpaceViewDir; + float3 tangentSpaceViewDir; + + float4 texcoord0; + float4 texcoord1; + float4 texcoord2; + float4 texcoord3; + + float2 screenUV; + float4 screenPos; + + float4 vertexColor; + bool isFrontFace; + + float4 extraV2F0; + float4 extraV2F1; + float4 extraV2F2; + float4 extraV2F3; + float4 extraV2F4; + float4 extraV2F5; + float4 extraV2F6; + float4 extraV2F7; + + float3x3 TBNMatrix; + Blackboard blackboard; + }; + + struct VertexData + { + #if SHADER_TARGET > 30 + // uint vertexID : SV_VertexID; + #endif + float4 vertex : POSITION; + float3 normal : NORMAL; + float4 tangent : TANGENT; + float4 texcoord0 : TEXCOORD0; + + // optimize out mesh coords when not in use by user or lighting system + #if _URP && (_USINGTEXCOORD1 || _PASSMETA || _PASSFORWARD || _PASSGBUFFER) + float4 texcoord1 : TEXCOORD1; + #endif + + #if _URP && (_USINGTEXCOORD2 || _PASSMETA || ((_PASSFORWARD || _PASSGBUFFER) && defined(DYNAMICLIGHTMAP_ON))) + float4 texcoord2 : TEXCOORD2; + #endif + + #if _STANDARD && (_USINGTEXCOORD1 || (_PASSMETA || ((_PASSFORWARD || _PASSGBUFFER || _PASSFORWARDADD) && LIGHTMAP_ON))) + float4 texcoord1 : TEXCOORD1; + #endif + #if _STANDARD && (_USINGTEXCOORD2 || (_PASSMETA || ((_PASSFORWARD || _PASSGBUFFER) && DYNAMICLIGHTMAP_ON))) + float4 texcoord2 : TEXCOORD2; + #endif + + + #if _HDRP + float4 texcoord1 : TEXCOORD1; + float4 texcoord2 : TEXCOORD2; + #endif + + // #if %TEXCOORD3REQUIREKEY% + float4 texcoord3 : TEXCOORD3; + // #endif + + // #if %VERTEXCOLORREQUIREKEY% + float4 vertexColor : COLOR; + // #endif + + #if _PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR)) + float3 previousPositionOS : TEXCOORD4; // Contain previous transform position (in case of skinning for example) + #if defined (_ADD_PRECOMPUTED_VELOCITY) + float3 precomputedVelocity : TEXCOORD5; // Add Precomputed Velocity (Alembic computes velocities on runtime side). + #endif + #endif + + UNITY_VERTEX_INPUT_INSTANCE_ID + }; + + struct TessVertex + { + float4 vertex : INTERNALTESSPOS; + float3 normal : NORMAL; + float4 tangent : TANGENT; + float4 texcoord0 : TEXCOORD0; + float4 texcoord1 : TEXCOORD1; + float4 texcoord2 : TEXCOORD2; + + // #if %TEXCOORD3REQUIREKEY% + float4 texcoord3 : TEXCOORD3; + // #endif + + // #if %VERTEXCOLORREQUIREKEY% + float4 vertexColor : COLOR; + // #endif + + // #if %EXTRAV2F0REQUIREKEY% + // float4 extraV2F0 : TEXCOORD5; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // float4 extraV2F1 : TEXCOORD6; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // float4 extraV2F2 : TEXCOORD7; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // float4 extraV2F3 : TEXCOORD8; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // float4 extraV2F4 : TEXCOORD9; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // float4 extraV2F5 : TEXCOORD10; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // float4 extraV2F6 : TEXCOORD11; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // float4 extraV2F7 : TEXCOORD12; + // #endif + + #if _PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR)) + float3 previousPositionOS : TEXCOORD13; // Contain previous transform position (in case of skinning for example) + #if defined (_ADD_PRECOMPUTED_VELOCITY) + float3 precomputedVelocity : TEXCOORD14; + #endif + #endif + + UNITY_VERTEX_INPUT_INSTANCE_ID + UNITY_VERTEX_OUTPUT_STEREO + }; + + struct ExtraV2F + { + float4 extraV2F0; + float4 extraV2F1; + float4 extraV2F2; + float4 extraV2F3; + float4 extraV2F4; + float4 extraV2F5; + float4 extraV2F6; + float4 extraV2F7; + Blackboard blackboard; + float4 time; + }; + + + float3 WorldToTangentSpace(ShaderData d, float3 normal) + { + return mul(d.TBNMatrix, normal); + } + + float3 TangentToWorldSpace(ShaderData d, float3 normal) + { + return mul(normal, d.TBNMatrix); + } + + // in this case, make standard more like SRPs, because we can't fix + // unity_WorldToObject in HDRP, since it already does macro-fu there + + #if _STANDARD + float3 TransformWorldToObject(float3 p) { return mul(unity_WorldToObject, float4(p, 1)); }; + float3 TransformObjectToWorld(float3 p) { return mul(unity_ObjectToWorld, float4(p, 1)); }; + float4 TransformWorldToObject(float4 p) { return mul(unity_WorldToObject, p); }; + float4 TransformObjectToWorld(float4 p) { return mul(unity_ObjectToWorld, p); }; + float4x4 GetWorldToObjectMatrix() { return unity_WorldToObject; } + float4x4 GetObjectToWorldMatrix() { return unity_ObjectToWorld; } + #if (defined(SHADER_API_D3D11) || defined(SHADER_API_XBOXONE) || defined(UNITY_COMPILER_HLSLCC) || defined(SHADER_API_PSSL) || (SHADER_TARGET_SURFACE_ANALYSIS && !SHADER_TARGET_SURFACE_ANALYSIS_MOJOSHADER)) + #define UNITY_SAMPLE_TEX2D_LOD(tex,coord, lod) tex.SampleLevel (sampler##tex,coord, lod) + #define UNITY_SAMPLE_TEX2D_SAMPLER_LOD(tex,samplertex,coord, lod) tex.SampleLevel (sampler##samplertex,coord, lod) + #else + #define UNITY_SAMPLE_TEX2D_LOD(tex,coord,lod) tex2D (tex,coord,0,lod) + #define UNITY_SAMPLE_TEX2D_SAMPLER_LOD(tex,samplertex,coord,lod) tex2D (tex,coord,0,lod) + #endif + + #undef GetWorldToObjectMatrix() + + #define GetWorldToObjectMatrix() unity_WorldToObject + + + #endif + + float3 GetCameraWorldPosition() + { + #if _HDRP + return GetCameraRelativePositionWS(_WorldSpaceCameraPos); + #else + return _WorldSpaceCameraPos; + #endif + } + + #if _GRABPASSUSED + #if _STANDARD + TEXTURE2D(%GRABTEXTURE%); + SAMPLER(sampler_%GRABTEXTURE%); + #endif + + half3 GetSceneColor(float2 uv) + { + #if _STANDARD + return SAMPLE_TEXTURE2D(%GRABTEXTURE%, sampler_%GRABTEXTURE%, uv).rgb; + #else + return SHADERGRAPH_SAMPLE_SCENE_COLOR(uv); + #endif + } + #endif + + + + #if _STANDARD + UNITY_DECLARE_DEPTH_TEXTURE(_CameraDepthTexture); + float GetSceneDepth(float2 uv) { return SAMPLE_DEPTH_TEXTURE(_CameraDepthTexture, uv); } + float GetLinear01Depth(float2 uv) { return Linear01Depth(GetSceneDepth(uv)); } + float GetLinearEyeDepth(float2 uv) { return LinearEyeDepth(GetSceneDepth(uv)); } + #else + float GetSceneDepth(float2 uv) { return SHADERGRAPH_SAMPLE_SCENE_DEPTH(uv); } + float GetLinear01Depth(float2 uv) { return Linear01Depth(GetSceneDepth(uv), _ZBufferParams); } + float GetLinearEyeDepth(float2 uv) { return LinearEyeDepth(GetSceneDepth(uv), _ZBufferParams); } + #endif + + float3 GetWorldPositionFromDepthBuffer(float2 uv, float3 worldSpaceViewDir) + { + float eye = GetLinearEyeDepth(uv); + float3 camView = mul((float3x3)GetObjectToWorldMatrix(), transpose(mul(GetWorldToObjectMatrix(), UNITY_MATRIX_I_V)) [2].xyz); + + float dt = dot(worldSpaceViewDir, camView); + float3 div = worldSpaceViewDir/dt; + float3 wpos = (eye * div) + GetCameraWorldPosition(); + return wpos; + } + + #if _HDRP + float3 ObjectToWorldSpacePosition(float3 pos) + { + return GetAbsolutePositionWS(TransformObjectToWorld(pos)); + } + #else + float3 ObjectToWorldSpacePosition(float3 pos) + { + return TransformObjectToWorld(pos); + } + #endif + + #if _STANDARD + UNITY_DECLARE_SCREENSPACE_TEXTURE(_CameraDepthNormalsTexture); + float3 GetSceneNormal(float2 uv, float3 worldSpaceViewDir) + { + float4 depthNorms = UNITY_SAMPLE_SCREENSPACE_TEXTURE(_CameraDepthNormalsTexture, uv); + float3 norms = DecodeViewNormalStereo(depthNorms); + norms = mul((float3x3)GetWorldToViewMatrix(), norms) * 0.5 + 0.5; + return norms; + } + #elif _HDRP && !_DECALSHADER + + float3 GetSceneNormal(float2 uv, float3 worldSpaceViewDir) + { + NormalData nd; + DecodeFromNormalBuffer(_ScreenSize.xy * uv, nd); + return nd.normalWS; + } + #elif _URP + #if (SHADER_LIBRARY_VERSION_MAJOR >= 10) + #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/DeclareNormalsTexture.hlsl" + #endif + + float3 GetSceneNormal(float2 uv, float3 worldSpaceViewDir) + { + #if (SHADER_LIBRARY_VERSION_MAJOR >= 10) + return SampleSceneNormals(uv); + #else + float3 wpos = GetWorldPositionFromDepthBuffer(uv, worldSpaceViewDir); + return normalize(-cross(ddx(wpos), ddy(wpos))) * 0.5 + 0.5; + #endif + + } + #endif + + #if _HDRP + + half3 UnpackNormalmapRGorAG(half4 packednormal) + { + // This do the trick + packednormal.x *= packednormal.w; + + half3 normal; + normal.xy = packednormal.xy * 2 - 1; + normal.z = sqrt(1 - saturate(dot(normal.xy, normal.xy))); + return normal; + } + half3 UnpackNormal(half4 packednormal) + { + #if defined(UNITY_NO_DXT5nm) + return packednormal.xyz * 2 - 1; + #else + return UnpackNormalmapRGorAG(packednormal); + #endif + } + #endif + #if _HDRP || _URP + + half3 UnpackScaleNormal(half4 packednormal, half scale) + { + #ifndef UNITY_NO_DXT5nm + // Unpack normal as DXT5nm (1, y, 1, x) or BC5 (x, y, 0, 1) + // Note neutral texture like "bump" is (0, 0, 1, 1) to work with both plain RGB normal and DXT5nm/BC5 + packednormal.x *= packednormal.w; + #endif + half3 normal; + normal.xy = (packednormal.xy * 2 - 1) * scale; + normal.z = sqrt(1 - saturate(dot(normal.xy, normal.xy))); + return normal; + } + + #endif + + + void GetSun(out float3 lightDir, out float3 color) + { + lightDir = float3(0.5, 0.5, 0); + color = 1; + #if _HDRP + if (_DirectionalLightCount > 0) + { + DirectionalLightData light = _DirectionalLightDatas[0]; + lightDir = -light.forward.xyz; + color = light.color; + } + #elif _STANDARD + lightDir = normalize(_WorldSpaceLightPos0.xyz); + color = _LightColor0.rgb; + #elif _URP + Light light = GetMainLight(); + lightDir = light.direction; + color = light.color; + #endif + } + + + + CBUFFER_START(UnityPerMaterial) + + + half4 _Color; + half4 _MainTex_ST, _MainTex_TexelSize; + half _Alpha, _AlphaCutoffValue; + + #if ATLAS_ON + half _MinXUV, _MaxXUV, _MinYUV, _MaxYUV; + #endif + + #if GLOW_ON + half4 _GlowColor; + half _Glow, _GlowGlobal; + #endif + + #if HSV_ON + half _HsvShift, _HsvSaturation, _HsvBright; + #endif + + #if DISTORT_ON + half4 _DistortTex_ST; + half _DistortTexXSpeed, _DistortTexYSpeed, _DistortAmount; + #endif + + #if FADE_ON + half4 _FadeBurnColor, _FadeTex_ST, _FadeBurnTex_ST; + half _FadeAmount, _FadeBurnWidth, _FadeBurnTransition,_FadeBurnGlow; + #endif + + #if OUTBASE_ON + half4 _OutlineColor; + half _OutlineAlpha, _OutlineGlow, _OutlineWidth; + int _OutlinePixelWidth; + #endif + + #if OUTTEX_ON + half4 _OutlineTex_ST; + half _OutlineTexXSpeed, _OutlineTexYSpeed; + #endif + + #if OUTDIST_ON + half4 _OutlineDistortTex_ST; + half _OutlineDistortTexXSpeed, _OutlineDistortTexYSpeed, _OutlineDistortAmount; + #endif + + #if ALPHAOUTLINE_ON + half _AlphaOutlineGlow, _AlphaOutlinePower, _AlphaOutlineMinAlpha, _AlphaOutlineBlend; + half4 _AlphaOutlineColor; + #endif + + #if INNEROUTLINE_ON + half _InnerOutlineThickness, _InnerOutlineAlpha, _InnerOutlineGlow; + half4 _InnerOutlineColor; + #endif + + #if GRADIENT_ON + half _GradBlend, _GradBoostX, _GradBoostY; + half4 _GradTopRightCol, _GradTopLeftCol, _GradBotRightCol, _GradBotLeftCol; + #endif + + #if COLORSWAP_ON + half4 _ColorSwapRed, _ColorSwapGreen, _ColorSwapBlue; + half _ColorSwapRedLuminosity, _ColorSwapGreenLuminosity, _ColorSwapBlueLuminosity, _ColorSwapBlend; + #endif + + #if CHANGECOLOR_ON + half4 _ColorChangeNewCol, _ColorChangeTarget; + half _ColorChangeTolerance, _ColorChangeLuminosity; + #endif + #if CHANGECOLOR2_ON + half4 _ColorChangeNewCol2, _ColorChangeTarget2; + half _ColorChangeTolerance2; + #endif + #if CHANGECOLOR3_ON + half4 _ColorChangeNewCol3, _ColorChangeTarget3; + half _ColorChangeTolerance3; + #endif + + #if COLORRAMP_ON + half _ColorRampLuminosity, _ColorRampBlend; + #endif + + #if HITEFFECT_ON + half4 _HitEffectColor; + half _HitEffectGlow, _HitEffectBlend; + #endif + + #if NEGATIVE_ON + half _NegativeAmount; + #endif + + #if PIXELATE_ON + half _PixelateSize; + #endif + + #if GREYSCALE_ON + half _GreyscaleLuminosity, _GreyscaleBlend; + half4 _GreyscaleTintColor; + #endif + + #if POSTERIZE_ON + half _PosterizeNumColors, _PosterizeGamma; + #endif + + #if BLUR_ON + half _BlurIntensity; + #endif + + #if MOTIONBLUR_ON + half _MotionBlurAngle, _MotionBlurDist; + #endif + + #if GHOST_ON + half _GhostColorBoost, _GhostTransparency, _GhostBlend; + #endif + + #if HOLOGRAM_ON + half _HologramStripesAmount, _HologramMinAlpha, _HologramUnmodAmount, _HologramStripesSpeed, _HologramMaxAlpha, _HologramBlend; + half4 _HologramStripeColor; + #endif + + #if CHROMABERR_ON + half _ChromAberrAmount, _ChromAberrAlpha; + #endif + + #if GLITCH_ON + half _GlitchAmount, _GlitchSize; + #endif + + #if FLICKER_ON + half _FlickerFreq, _FlickerPercent, _FlickerAlpha; + #endif + + #if SHADOW_ON + half _ShadowX, _ShadowY, _ShadowAlpha; + half4 _ShadowColor; + #endif + + #if SHINE_ON + half4 _ShineColor; + half _ShineLocation, _ShineRotate, _ShineWidth, _ShineGlow; + #endif + + #if CONTRAST_ON + half _Contrast, _Brightness; + #endif + + #if OVERLAY_ON + half4 _OverlayTex_ST, _OverlayColor; + half _OverlayGlow, _OverlayBlend, _OverlayTextureScrollXSpeed, _OverlayTextureScrollYSpeed; + #endif + + #if DOODLE_ON + half _HandDrawnAmount, _HandDrawnSpeed; + #endif + + #if WIND_ON + half _GrassSpeed, _GrassWind, _GrassManualAnim, _GrassRadialBend; + #endif + + #if WAVEUV_ON + float _WaveAmount, _WaveSpeed, _WaveStrength, _WaveX, _WaveY; + #endif + + #if ROUNDWAVEUV_ON + half _RoundWaveStrength, _RoundWaveSpeed; + #endif + + #if RECTSIZE_ON + half _RectSize; + #endif + + #if OFFSETUV_ON + half _OffsetUvX, _OffsetUvY; + #endif + + #if CLIPPING_ON + half _ClipUvLeft, _ClipUvRight, _ClipUvUp, _ClipUvDown; + #endif + + #if RADIALCLIPPING_ON + half _RadialStartAngle, _RadialClip, _RadialClip2; + #endif + + #if TEXTURESCROLL_ON + half _TextureScrollXSpeed, _TextureScrollYSpeed; + #endif + + #if ZOOMUV_ON + half _ZoomUvAmount; + #endif + + #if WARP_ON + half _WarpStrength, _WarpSpeed, _WarpScale; + #endif + + #if TWISTUV_ON + half _TwistUvAmount, _TwistUvPosX, _TwistUvPosY, _TwistUvRadius; + #endif + + #if ROTATEUV_ON + half _RotateUvAmount; + #endif + + #if FISHEYE_ON + half _FishEyeUvAmount; + #endif + + #if PINCH_ON + half _PinchUvAmount; + #endif + + #if SHAKEUV_ON + half _ShakeUvSpeed, _ShakeUvX, _ShakeUvY; + #endif + + #if NORMALMAP_ON + half _NormalStrength; + #endif + + float _RandomSeed; + + + + + CBUFFER_END + + + + + + + + TEXTURE2D(_MainTex); + SAMPLER(sampler_MainTex); + + #if GLOW_ON + TEXTURE2D(_GlowTex); + SAMPLER(sampler_GlowTex); + #endif + + #if FADE_ON + TEXTURE2D(_FadeTex); + SAMPLER(sampler_FadeTex); + + TEXTURE2D(_FadeBurnTex); + SAMPLER(sampler_FadeBurnTex); + #endif + + #if DISTORT_ON + TEXTURE2D(_DistortTex); + SAMPLER(sampler_DistortTex); + #endif + + #if OUTTEX_ON + TEXTURE2D(_OutlineTex); + SAMPLER(sampler_OutlineTex); + #endif + + #if OUTDIST_ON + TEXTURE2D(_OutlineDistortTex); + SAMPLER(sampler_OutlineDistortTex); + #endif + + #if COLORSWAP_ON + TEXTURE2D(_ColorSwapTex); + SAMPLER(sampler_ColorSwapTex); + #endif + + #if COLORRAMP_ON + TEXTURE2D(_ColorRampTex); + TEXTURE2D(_ColorRampTexGradient); + SAMPLER(sampler_ColorRampTex); + SAMPLER(sampler_ColorRampTexGradient); + #endif + + #if SHINE_ON + TEXTURE2D(_ShineMask); + SAMPLER(sampler_ShineMask); + #endif + + #if OVERLAY_ON + TEXTURE2D(_OverlayTex); + SAMPLER(sampler_OverlayTex); + #endif + + #if NORMALMAP_ON + TEXTURE2D(_NormalMap); + SAMPLER(sampler_NormalMap); + #endif + + + half3 GetPixel(in int offsetX, in int offsetY, in half2 uv, in Texture2D _tex, in SamplerState _sampler) + { + half2 _uv = uv + half2(offsetX * _MainTex_TexelSize.x, offsetY * _MainTex_TexelSize.y); + half4 col = SAMPLE_TEXTURE2D(_tex, _sampler, _uv); + return col.rgb; + } + + + //BLURS------------------------------------------------------------------------- + half4 Blur(half2 uv, Texture2D source, SamplerState sampler_source, half Intensity) + { + const half2 texelSize = 1.0 / _ScreenParams.xy; + const half4 color = SAMPLE_TEXTURE2D(source, sampler_source, uv); + const half2 offset = Intensity * texelSize; + + half4 accumulatedColor = color; + half accumulatedWeight = 1.0; + for (int x = -1; x <= 1; x++) + { + for (int y = -1; y <= 1; y++) + { + const half2 sampleUV = uv + half2(x, y) * offset; + const half4 sampleColor = SAMPLE_TEXTURE2D(source, sampler_source, sampleUV); + + accumulatedColor += sampleColor; + accumulatedWeight += 1.0; + } + } + + half4 blurredColor = accumulatedColor / accumulatedWeight; + return blurredColor; + } + + half BlurHD_G(half bhqp, half x) + { + return exp(-(x * x) / (2.0 * bhqp * bhqp)); + } + half4 BlurHD(half2 uv, Texture2D source, SamplerState sampler_source, half BlurAmount, half xScale, half yScale) + { + int iterations = 16; + int halfIterations = iterations / 2; + half sigmaX = 0.1 + BlurAmount * 0.5; + half sigmaY = sigmaX; + half total = 0.0; + half4 ret = half4(0, 0, 0, 0); + for (int iy = 0; iy < iterations; ++iy) + { + half fy = BlurHD_G(sigmaY, half(iy) -half(halfIterations)); + half offsetY = half(iy - halfIterations) * 0.00390625 * xScale; + for (int ix = 0; ix < iterations; ++ix) + { + half fx = BlurHD_G(sigmaX, half(ix) - half(halfIterations)); + half offsetX = half(ix - halfIterations) * 0.00390625 * yScale; + total += fx * fy; + ret += SAMPLE_TEXTURE2D(source, sampler_source, uv + half2(offsetX, offsetY)) * fx * fy; + } + } + return ret / total; + } + //----------------------------------------------------------------------- + + + //------------------------------------------- + half RemapFloat(half inValue, half inMin, half inMax, half outMin, half outMax){ + return outMin + (inValue - inMin) * (outMax - outMin) / (inMax - inMin); + } + //------------------------------------------- + + //----------------------------------------------------------------------- + half rand(half2 seed, half offset) { + return (frac(sin(dot(seed, half2(12.9898, 78.233))) * 43758.5453) + offset) % 1.0; + } + + half rand2(half2 seed, half offset) { + return (frac(sin(dot(seed * floor(50 + (_Time.x % 1.0) * 12.), half2(127.1, 311.7))) * 43758.5453123) + offset) % 1.0; + } + + half rand2CustomTime(half2 seed, half offset, half customTime) { + return (frac(sin(dot(seed * floor(50 + (customTime % 1.0) * 12.), half2(127.1, 311.7))) * 43758.5453123) + offset) % 1.0; + } + //----------------------------------------------------------------------- + + + void Ext_ModifyVertex0 (inout VertexData v, inout ExtraV2F d) + { + //BILBOARD_ON + #if BILBOARD_ON + half3 camRight = mul((half3x3)unity_CameraToWorld, half3(1,0,0)); + half3 camUp = half3(0,1,0); + #if BILBOARDY_ON + camUp = mul((half3x3)unity_CameraToWorld, half3(0,1,0)); + #endif + half3 localPos = v.vertex.x * camRight + v.vertex.y * camUp; + v.vertex = half4(localPos, 1); + #endif + //----------------------------------------------------------- + + v.texcoord0.xy = TRANSFORM_TEX(v.texcoord0.xy, _MainTex); + half2 center = half2(0.5, 0.5); + #if ATLAS_ON + center = half2((_MaxXUV + _MinXUV) / 2.0, (_MaxYUV + _MinYUV) / 2.0); + #endif + + //POLARUV_ON + #if POLARUV_ON + v.texcoord0.xy = v.texcoord0.xy - center; + #endif + + //---------------------------------------- + + //ROTATEUV_ON + #if ROTATEUV_ON + half2 uvC = v.texcoord0.xy; + half cosAngle = cos(_RotateUvAmount); + half sinAngle = sin(_RotateUvAmount); + half2x2 rot = half2x2(cosAngle, -sinAngle, sinAngle, cosAngle); + uvC -= center; + v.texcoord0.xy = mul(rot, uvC); + v.texcoord0.xy += center; + #endif + //-------------------- + + #if RECTSIZE_ON + v.vertex.xyz += (v.vertex.xyz * (_RectSize - 1.0)); + #endif + + #if OUTTEX_ON + v.texcoord1.xy = TRANSFORM_TEX(v.texcoord0.xy, _OutlineTex); + #endif + + #if OUTDIST_ON + v.texcoord2.xy = TRANSFORM_TEX(v.texcoord0.xy, _OutlineDistortTex); + #endif + + #if DISTORT_ON + v.texcoord3.xy = TRANSFORM_TEX(v.texcoord0.xy, _DistortTex); + #endif + } + + void Ext_SurfaceFunction0 (inout Surface o, ShaderData d) + { + half randomSeed = _RandomSeed; + + float2 uvRect = d.texcoord0; + half2 center = half2(0.5, 0.5); + #if ATLAS_ON + center = half2((_MaxXUV + _MinXUV) / 2.0, (_MaxYUV + _MinYUV) / 2.0); + uvRect = half2((d.texcoord0.x - _MinXUV) / (_MaxXUV - _MinXUV), (d.texcoord0.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half2 centerTiled = half2(center.x * _MainTex_ST.x, center.y * _MainTex_ST.y); + + //CLIPPING_ON + #if CLIPPING_ON + half2 tiledUv = half2(d.texcoord0.x / _MainTex_ST.x, d.texcoord0.y / _MainTex_ST.y); + #if ATLAS_ON + tiledUv = half2((tiledUv.x - _MinXUV) / (_MaxXUV - _MinXUV), (tiledUv.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + clip((1 - _ClipUvUp) - tiledUv.y); + clip(tiledUv.y - _ClipUvDown); + clip((1 - _ClipUvRight) - tiledUv.x); + clip(tiledUv.x - _ClipUvLeft); + #endif + //---------------------------------- + + //RADIALCLIPPING_ON + #if RADIALCLIPPING_ON + half2 tiledUv2 = half2(d.texcoord0.x / _MainTex_ST.x, d.texcoord0.y / _MainTex_ST.y); + #if ATLAS_ON + tiledUv2 = half2((tiledUv2.x - _MinXUV) / (_MaxXUV - _MinXUV), (tiledUv2.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half startAngle = _RadialStartAngle - _RadialClip; + half endAngle = _RadialStartAngle + _RadialClip2; + half offset0 = clamp(0, 360, startAngle + 360); + half offset360 = clamp(0, 360, endAngle - 360); + half2 atan2Coord = half2(lerp(-1, 1, tiledUv2.x), lerp(-1, 1, tiledUv2.y)); + half atanAngle = atan2(atan2Coord.y, atan2Coord.x) * 57.3; // angle in degrees + if(atanAngle < 0) atanAngle = 360 + atanAngle; + if(atanAngle >= startAngle && atanAngle <= endAngle) discard; + if(atanAngle <= offset360) discard; + if(atanAngle >= offset0) discard; + #endif + + //----------------------------- + + //TEXTURESCROLL_ON && ATLAS_ON + #if TEXTURESCROLL_ON && ATLAS_ON + d.texcoord0.xy = half2(_MinXUV + ((_MaxXUV - _MinXUV) * (abs(((_Time.y + randomSeed) * _TextureScrollXSpeed) + uvRect.x) % 1)), + _MinYUV + ((_MaxYUV - _MinYUV) * (abs(((_Time.y + randomSeed) * _TextureScrollYSpeed) + uvRect.y) % 1))); + #endif + //---------------------------- + + //OFFSETUV_ON + #if OFFSETUV_ON + #if ATLAS_ON + d.texcoord0.xy = half2(_MinXUV + ((_MaxXUV - _MinXUV) * (abs((_OffsetUvX + uvRect.x) % 1))), + _MinYUV + ((_MaxYUV - _MinYUV) * (abs(_OffsetUvY + uvRect.y) % 1))); + #else + d.texcoord0.xy += half2(_OffsetUvX, _OffsetUvY); + #endif + #endif + + //---------------------- + + //POLARUV_ON + #if POLARUV_ON + d.texcoord0.xy = half2(atan2(d.texcoord0.y, d.texcoord0.x) / (2.0f * 3.141592653589f), length(d.texcoord0.xy)); + d.texcoord0.xy *= _MainTex_ST.xy; + #endif + + //-------------------------------------- + + //TWISTUV_ON + #if TWISTUV_ON + #if ATLAS_ON + _TwistUvPosX = ((_MaxXUV - _MinXUV) * _TwistUvPosX) + _MinXUV; + _TwistUvPosY = ((_MaxYUV - _MinYUV) * _TwistUvPosY) + _MinYUV; + #endif + half2 tempUv = d.texcoord0.xy - half2(_TwistUvPosX * _MainTex_ST.x, _TwistUvPosY * _MainTex_ST.y); + _TwistUvRadius *= (_MainTex_ST.x + _MainTex_ST.y) / 2; + half percent = (_TwistUvRadius - length(tempUv)) / _TwistUvRadius; + half theta = percent * percent * (2.0 * sin(_TwistUvAmount)) * 8.0; + half s = sin(theta); + half c = cos(theta); + half beta = max(sign(_TwistUvRadius - length(tempUv)), 0.0); + tempUv = half2(dot(tempUv, half2(c, -s)), dot(tempUv, half2(s, c))) * beta + tempUv * (1 - beta); + tempUv += half2(_TwistUvPosX * _MainTex_ST.x, _TwistUvPosY * _MainTex_ST.y); + d.texcoord0.xy = tempUv; + #endif + + //-------------------------------------------- + + //FISHEYE_ON + #if FISHEYE_ON + half bind = length(centerTiled); + half2 dF = d.texcoord0.xy - centerTiled; + half dFlen = length(dF); + half fishInt = (3.14159265359 / bind) * (_FishEyeUvAmount + 0.001); + d.texcoord0.xy = centerTiled + (dF / (max(0.0001, dFlen))) * tan(dFlen * fishInt) * bind / tan(bind * fishInt); + #endif + //--------------------------------------------- + + //PINCH_ON + #if PINCH_ON + half2 dP = d.texcoord0.xy - centerTiled; + half pinchInt = (3.141592 / length(centerTiled)) * (-_PinchUvAmount + 0.001); + d.texcoord0.xy = centerTiled + normalize(dP) * atan(length(dP) * -pinchInt * 10.0) * 0.5 / atan(-pinchInt * 5); + #endif + + //--------------------------------------------- + + //ZOOMUV_ON + #if ZOOMUV_ON + d.texcoord0.xy -= centerTiled; + d.texcoord0.xy = d.texcoord0.xy * _ZoomUvAmount; + d.texcoord0.xy += centerTiled; + #endif + + //----------------------------------------------- + + //DOODLE_ON + #if DOODLE_ON + half2 uvCopy = uvRect; + _HandDrawnSpeed = (floor((_Time.x + randomSeed) * 20 * _HandDrawnSpeed) / _HandDrawnSpeed) * _HandDrawnSpeed; + uvCopy.x = sin((uvCopy.x * _HandDrawnAmount + _HandDrawnSpeed) * 4); + uvCopy.y = cos((uvCopy.y * _HandDrawnAmount + _HandDrawnSpeed) * 4); + d.texcoord0.xy = lerp(d.texcoord0.xy, d.texcoord0.xy + uvCopy, 0.0005 * _HandDrawnAmount); + #endif + + //-------------------------- + + //SHAKEUV_ON + #if SHAKEUV_ON + half xShake = sin((_Time.x + randomSeed) * _ShakeUvSpeed * 50) * _ShakeUvX; + half yShake = cos((_Time.x + randomSeed) * _ShakeUvSpeed * 50) * _ShakeUvY; + d.texcoord0.xy += half2(xShake * 0.012, yShake * 0.01); + #endif + + //------------------------------------------- + + //RECTSIZE_ON + #if RECTSIZE_ON + d.texcoord0.xy = d.texcoord0.xy * (_RectSize).xx + (((-_RectSize * 0.5) + 0.5)).xx; + #endif + + //------------------------------------------- + + //DISTORT_ON + #if DISTORT_ON + #if ATLAS_ON + d.texcoord3.x = d.texcoord3.x * (1 / (_MaxXUV - _MinXUV)); + d.texcoord3.y = d.texcoord3.y * (1 / (_MaxYUV - _MinYUV)); + #endif + + d.texcoord3.x += ((_Time.x + _RandomSeed) * _DistortTexXSpeed) % 1; + d.texcoord3.y += ((_Time.x + _RandomSeed) * _DistortTexYSpeed) % 1; + half distortAmnt = (SAMPLE_TEXTURE2D(_DistortTex, sampler_DistortTex, d.texcoord3.xy).r - 0.5) * 0.2 * _DistortAmount; + d.texcoord0.x += distortAmnt; + d.texcoord0.y += distortAmnt; + #endif + //------------------------------------------------------- + + //WARP_ON + #if WARP_ON + half2 warpUv = half2(d.texcoord0.x / _MainTex_ST.x, d.texcoord0.y / _MainTex_ST.y); + #if ATLAS_ON + warpUv = half2((warpUv.x - _MinXUV) / (_MaxXUV - _MinXUV), (warpUv.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + const float tau = 6.283185307179586; + float xWarp = (_Time.y + randomSeed) * _WarpSpeed + warpUv.x * tau / _WarpScale; + float yWarp = (_Time.y + randomSeed) * _WarpSpeed + warpUv.y * tau / _WarpScale; + float2 warp = float2(sin(xWarp), sin(yWarp)) * _WarpStrength; + d.texcoord0.xy += warp; + #endif + + //------------------------------------------------------- + + //WAVEUV_ON + #if WAVEUV_ON + float2 uvWave = half2(_WaveX * _MainTex_ST.x, _WaveY * _MainTex_ST.y) - d.texcoord0.xy; + uvWave %= 1; + #if ATLAS_ON + uvWave = half2(_WaveX, _WaveY) - uvRect; + #endif + uvWave.x *= _ScreenParams.x / _ScreenParams.y; + float waveTime = _Time.y + randomSeed; + float angWave = (sqrt(dot(uvWave, uvWave)) * _WaveAmount) - ((waveTime * _WaveSpeed)); + d.texcoord0.xy = d.texcoord0.xy + uvWave * sin(angWave) * (_WaveStrength / 1000.0); + #endif + //---------------------------------------------------- + + //ROUNDWAVEUV_ON + #if ROUNDWAVEUV_ON + half xWave = ((0.5 * _MainTex_ST.x) - uvRect.x); + half yWave = ((0.5 * _MainTex_ST.y) - uvRect.y) * (_MainTex_TexelSize.w / _MainTex_TexelSize.z); + half ripple = -sqrt(xWave*xWave + yWave* yWave); + d.texcoord0.xy += (sin((ripple + (_Time.y + randomSeed) * (_RoundWaveSpeed/10.0)) / 0.015) * (_RoundWaveStrength/10.0)) % 1; + #endif + //---------------------------------------------------- + + + //WIND_ON + #if WIND_ON + half windOffset = sin((_Time.x + randomSeed) * _GrassSpeed * 10); + half2 windCenter = half2(0.5, 0.1); + #if ATLAS_ON + windCenter.x = ((_MaxXUV - _MinXUV) * windCenter.x) + _MinXUV; + windCenter.y = ((_MaxYUV - _MinYUV) * windCenter.y) + _MinYUV; + #endif + #if !MANUALWIND_ON + d.texcoord0.x = fmod(abs(lerp(d.texcoord0.x, d.texcoord0.x + (_GrassWind * 0.01 * windOffset), uvRect.y)), 1); + #else + d.texcoord0.x = fmod(abs(lerp(d.texcoord0.x, d.texcoord0.x + (_GrassWind * 0.01 * _GrassManualAnim), uvRect.y)), 1); + windOffset = _GrassManualAnim; + #endif + half2 delta = d.texcoord0.xy - windCenter; + half delta2 = dot(delta.xy, delta.xy); + half2 delta_offset = delta2 * windOffset; + d.texcoord0.xy = d.texcoord0.xy + half2(delta.y, -delta.x) * delta_offset * _GrassRadialBend; + #endif + + //-------------------------------------------------------- + + //TEXTURESCROLL_ON && !ATLAS_ON + #if TEXTURESCROLL_ON && !ATLAS_ON + d.texcoord0.x += ((_Time.y + randomSeed) * _TextureScrollXSpeed) % 1; + d.texcoord0.y += ((_Time.y + randomSeed) * _TextureScrollYSpeed) % 1; + #endif + //------------------------------ + + //PIXELATE_ON + #if PIXELATE_ON + half aspectRatio = _MainTex_TexelSize.x / _MainTex_TexelSize.y; + half2 pixelSize = float2(_PixelateSize, _PixelateSize * aspectRatio); + d.texcoord0.xy = floor(d.texcoord0.xy * pixelSize) / pixelSize; + #endif + //-------------- + + half4 col = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy); + half originalAlpha = col.a; + col *= d.vertexColor; + + //NORMAL MAP + #if NORMALMAP_ON + half4 normalSample = SAMPLE_TEXTURE2D(_NormalMap, sampler_NormalMap, d.texcoord0.xy); + half3 normalTS = UnpackNormal(normalSample); + normalTS.xy *= _NormalStrength; + o.Normal = normalTS; + #endif + + + //GLITCH_ON + #if GLITCH_ON + half2 uvGlitch = uvRect; + uvGlitch.y -= 0.5; + half lineNoise = pow(rand2(floor(uvGlitch * half2(24., 19.) * _GlitchSize) * 4.0, randomSeed), 3.0) * _GlitchAmount + * pow(rand2(floor(uvGlitch * half2(38., 14.) * _GlitchSize) * 4.0, randomSeed), 3.0); + col = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(lineNoise * 0.02 * rand2(half2(2.0, 1), randomSeed), 0)) * d.vertexColor; + #endif + //-------------------------------------- + + //CHROMABERR_ON + #if CHROMABERR_ON + half4 r = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(_ChromAberrAmount/10, 0)) * d.vertexColor; + half4 b = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(-_ChromAberrAmount/10, 0)) * d.vertexColor; + col = half4(r.r * r.a, col.g, b.b * b.a, max(max(r.a, b.a) * _ChromAberrAlpha, col.a)); + #endif + + //-------------------------------- + + //BLUR_ON + #if BLUR_ON + #if ATLAS_ON + #if !BLURISHD_ON + col = BlurHD(d.texcoord0.xy, _MainTex, sampler_MainTex, _BlurIntensity, (_MaxXUV - _MinXUV), (_MaxYUV - _MinYUV)) * d.vertexColor; + #else + col = Blur(d.texcoord0.xy, _MainTex, sampler_MainTex, _BlurIntensity * (_MaxXUV - _MinXUV)) * d.vertexColor; + #endif + #else + #if !BLURISHD_ON + col = BlurHD(d.texcoord0.xy, _MainTex, sampler_MainTex, _BlurIntensity, 1, 1) * d.vertexColor; + #else + col = Blur(d.texcoord0.xy, _MainTex, sampler_MainTex, _BlurIntensity) * d.vertexColor; + #endif + #endif + #endif + + //-------------------- + + //MOTIONBLUR_ON + #if MOTIONBLUR_ON + _MotionBlurAngle = _MotionBlurAngle * 3.1415926; + #define rot(n) mul(n, half2x2(cos(_MotionBlurAngle), -sin(_MotionBlurAngle), sin(_MotionBlurAngle), cos(_MotionBlurAngle))) + _MotionBlurDist = _MotionBlurDist * 0.005; + #if ATLAS_ON + _MotionBlurDist *= (_MaxXUV - _MinXUV); + #endif + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(-_MotionBlurDist, -_MotionBlurDist))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(-_MotionBlurDist * 2, -_MotionBlurDist * 2))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(-_MotionBlurDist * 3, -_MotionBlurDist * 3))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(-_MotionBlurDist * 4, -_MotionBlurDist * 4))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(_MotionBlurDist, _MotionBlurDist))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(_MotionBlurDist * 2, _MotionBlurDist * 2))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(_MotionBlurDist * 3, _MotionBlurDist * 3))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(_MotionBlurDist * 4, _MotionBlurDist * 4))); + col.rgb = col.rgb / 9; + #endif + //------------------------------------ + + //NEGATIVE_ON + #if NEGATIVE_ON + col.rgb = lerp(col.rgb, 1 - col.rgb, _NegativeAmount); + #endif + + //-------------- + half luminance = 0; + + //GREYSCALE_ON && !GREYSCALEOUTLINE_ON + #if GREYSCALE_ON && !GREYSCALEOUTLINE_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + luminance = saturate(luminance + _GreyscaleLuminosity); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _GreyscaleTintColor, _GreyscaleBlend); + #endif + //------------------------------------ + + //GHOST_ON + #if GHOST_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + half4 ghostResult; + ghostResult.a = saturate(luminance - _GhostTransparency) * col.a; + ghostResult.rgb = col.rgb * (luminance + _GhostColorBoost); + col = lerp(col, ghostResult, _GhostBlend); + #endif + //------------------------------------ + + //INNEROUTLINE_ON + #if INNEROUTLINE_ON + half3 innerT = abs(GetPixel(0, _InnerOutlineThickness, d.texcoord0.xy, _MainTex, sampler_MainTex) - GetPixel(0, -_InnerOutlineThickness, d.texcoord0.xy, _MainTex, sampler_MainTex)); + innerT += abs(GetPixel(_InnerOutlineThickness, 0, d.texcoord0.xy, _MainTex, sampler_MainTex) - GetPixel(-_InnerOutlineThickness, 0, d.texcoord0.xy, _MainTex, sampler_MainTex)); + #if !ONLYINNEROUTLINE_ON + innerT = (innerT / 2.0) * col.a * _InnerOutlineAlpha; + col.rgb += length(innerT) * _InnerOutlineColor.rgb * _InnerOutlineGlow; + #else + innerT *= col.a * _InnerOutlineAlpha; + col.rgb = length(innerT) * _InnerOutlineColor.rgb * _InnerOutlineGlow; + col.a = step(0.3, col.r+col.g+col.b); + #endif + #endif + //------------------------------------------------------- + + //HITEFFECT_ON + #if HITEFFECT_ON + col.rgb = lerp(col.rgb, _HitEffectColor.rgb * _HitEffectGlow, _HitEffectBlend); + #endif + //-------------------- + + //GRADIENT_ON + #if GRADIENT_ON + half2 tiledUvGrad = half2(uvRect.x / _MainTex_ST.x, uvRect.y / _MainTex_ST.y); + #if GRADIENT2COL_ON + _GradTopRightCol = _GradTopLeftCol; + _GradBotRightCol = _GradBotLeftCol; + #endif + #if RADIALGRADIENT_ON + half radialDist = 1 - length(tiledUvGrad - half2(0.5, 0.5)); + radialDist *= (_MainTex_TexelSize.w / _MainTex_TexelSize.z); + radialDist = saturate(_GradBoostX * radialDist); + half4 gradientResult = lerp(_GradTopLeftCol, _GradBotLeftCol, radialDist); + #else + half gradXLerpFactor = saturate(pow(tiledUvGrad.x, _GradBoostX)); + half4 gradientResult = lerp(lerp(_GradBotLeftCol, _GradBotRightCol, gradXLerpFactor), + lerp(_GradTopLeftCol, _GradTopRightCol, gradXLerpFactor), saturate(pow(tiledUvGrad.y, _GradBoostY))); + #endif + gradientResult = lerp(col, gradientResult, _GradBlend); + col.rgb = gradientResult.rgb * col.a; + col.a *= gradientResult.a; + #endif + //-------------------------------------------------------------------- + + //CONTRAST_ON + #if CONTRAST_ON + col.rgb = (col.rgb - float3(0.5, 0.5, 0.5)) * _Contrast + float3(0.5, 0.5, 0.5); + col.rgb += _Brightness; + #endif + + //------------------------------------------------------------------- + + //COLORSWAP_ON + #if COLORSWAP_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + half4 swapMask = SAMPLE_TEXTURE2D(_ColorSwapTex, sampler_ColorSwapTex, d.texcoord0.xy); + swapMask.rgb *= swapMask.a; + half3 redSwap = _ColorSwapRed * swapMask.r * saturate(luminance + _ColorSwapRedLuminosity); + half3 greenSwap = _ColorSwapGreen * swapMask.g * saturate(luminance + _ColorSwapGreenLuminosity); + half3 blueSwap = _ColorSwapBlue * swapMask.b * saturate(luminance + _ColorSwapBlueLuminosity); + swapMask.rgb = col.rgb * saturate(1 - swapMask.r - swapMask.g - swapMask.b); + col.rgb = lerp(col.rgb, swapMask.rgb + redSwap + greenSwap + blueSwap, _ColorSwapBlend); + #endif + //-------------------------------------------------------------------- + + //COLORRAMP_ON && !COLORRAMPOUTLINE_ON + #if COLORRAMP_ON && !COLORRAMPOUTLINE_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + luminance = saturate(luminance + _ColorRampLuminosity); + #if GRADIENTCOLORRAMP_ON + col.rgb = lerp(col.rgb, SAMPLE_TEXTURE2D(_ColorRampTexGradient, sampler_ColorRampTexGradient, half2(luminance, 0)).rgb, _ColorRampBlend); + #else + col.rgb = lerp(col.rgb, SAMPLE_TEXTURE2D(_ColorRampTex, sampler_ColorRampTex, half2(luminance, 0)).rgb, _ColorRampBlend); + #endif + #endif + //-------------------------------------------------------------------- + + //CHANGECOLOR_ON + #if CHANGECOLOR_ON + float3 currChangeColor = saturate(col.rgb); + luminance = 0.3 * currChangeColor.r + 0.59 * currChangeColor.g + 0.11 * currChangeColor.b; + luminance = saturate(luminance + _ColorChangeLuminosity); + half3 dif = abs(currChangeColor - _ColorChangeTarget.rgb); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _ColorChangeNewCol.rgb, + max(sign(1 - saturate(dif.x + dif.y + dif.z) - _ColorChangeTolerance), 0.0)); + #if CHANGECOLOR2_ON + dif = abs(currChangeColor - _ColorChangeTarget2.rgb); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _ColorChangeNewCol2.rgb, + max(sign(1 - saturate(dif.x + dif.y + dif.z) - _ColorChangeTolerance2), 0.0)); + #endif + #if CHANGECOLOR3_ON + dif = abs(currChangeColor - _ColorChangeTarget3.rgb); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _ColorChangeNewCol3.rgb, + max(sign(1 - saturate(dif.x + dif.y + dif.z) - _ColorChangeTolerance3), 0.0)); + #endif + #endif + //------------------------------------------------------- + + //POSTERIZE_ON && !POSTERIZEOUTLINE_ON + #if POSTERIZE_ON && !POSTERIZEOUTLINE_ON + col.rgb = pow(col.rgb, _PosterizeGamma) * _PosterizeNumColors; + col.rgb = floor(col.rgb) / _PosterizeNumColors; + col.rgb = pow(col.rgb, 1.0 / _PosterizeGamma); + #endif + //------------------------------------ + + //HSV_ON + #if HSV_ON + half3 resultHsv = half3(col.rgb); + half cosHsv = _HsvBright * _HsvSaturation * cos(_HsvShift * 3.14159265 / 180); + half sinHsv = _HsvBright * _HsvSaturation * sin(_HsvShift * 3.14159265 / 180); + resultHsv.x = (.299 * _HsvBright + .701 * cosHsv + .168 * sinHsv) * col.x + + (.587 * _HsvBright - .587 * cosHsv + .330 * sinHsv) * col.y + + (.114 * _HsvBright - .114 * cosHsv - .497 * sinHsv) * col.z; + resultHsv.y = (.299 * _HsvBright - .299 * cosHsv - .328 * sinHsv) *col.x + + (.587 * _HsvBright + .413 * cosHsv + .035 * sinHsv) * col.y + + (.114 * _HsvBright - .114 * cosHsv + .292 * sinHsv) * col.z; + resultHsv.z = (.299 * _HsvBright - .3 * cosHsv + 1.25 * sinHsv) * col.x + + (.587 * _HsvBright - .588 * cosHsv - 1.05 * sinHsv) * col.y + + (.114 * _HsvBright + .886 * cosHsv - .203 * sinHsv) * col.z; + col.rgb = resultHsv; + #endif + //------------------------------------------------------- + + //OVERLAY_ON + #if OVERLAY_ON + half2 overlayUvs = d.texcoord0.xy; + overlayUvs.x += ((_Time.y + randomSeed) * _OverlayTextureScrollXSpeed) % 1; + overlayUvs.y += ((_Time.y + randomSeed) * _OverlayTextureScrollYSpeed) % 1; + half4 overlayCol = SAMPLE_TEXTURE2D(_OverlayTex, sampler_OverlayTex, TRANSFORM_TEX(overlayUvs, _OverlayTex)); + overlayCol.rgb *= _OverlayColor.rgb * _OverlayGlow; + #if !OVERLAYMULT_ON + overlayCol.rgb *= overlayCol.a * _OverlayColor.rgb * _OverlayColor.a * _OverlayBlend; + col.rgb += overlayCol.rgb; + #else + overlayCol.a *= _OverlayColor.a; + col = lerp(col, col * overlayCol, _OverlayBlend); + #endif + #endif + + //--------------------------------- + + //OUTBASE_ON + #if OUTBASE_ON + #if OUTBASEPIXELPERF_ON + half2 destUv = half2(_OutlinePixelWidth * _MainTex_TexelSize.x, _OutlinePixelWidth * _MainTex_TexelSize.y); + #else + half2 destUv = half2(_OutlineWidth * _MainTex_TexelSize.x * 200, _OutlineWidth * _MainTex_TexelSize.y * 200); + #endif + + #if OUTDIST_ON + d.texcoord3.x += ((_Time.x + _RandomSeed) * _OutlineDistortTexXSpeed) % 1; + d.texcoord3.y += ((_Time.x + _RandomSeed) * _OutlineDistortTexYSpeed) % 1; + #if ATLAS_ON + d.texcoord3 = half2((d.texcoord3.x - _MinXUV) / (_MaxXUV - _MinXUV), (d.texcoord3.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half outDistortAmnt = (SAMPLE_TEXTURE2D(_OutlineDistortTex, sampler_OutlineDistortTex, d.texcoord3).r - 0.5) * 0.2 * _OutlineDistortAmount; + destUv.x += outDistortAmnt; + destUv.y += outDistortAmnt; + #endif + + half spriteLeft = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(destUv.x, 0)).a; + half spriteRight = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy - half2(destUv.x, 0)).a; + half spriteBottom = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(0, destUv.y)).a; + half spriteTop = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy - half2(0, destUv.y)).a; + half result = spriteLeft + spriteRight + spriteBottom + spriteTop; + + #if OUTBASE8DIR_ON + half spriteTopLeft = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(destUv.x, destUv.y)).a; + half spriteTopRight = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(-destUv.x, destUv.y)).a; + half spriteBotLeft = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(destUv.x, -destUv.y)).a; + half spriteBotRight = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(-destUv.x, -destUv.y)).a; + result = result + spriteTopLeft + spriteTopRight + spriteBotLeft + spriteBotRight; + #endif + + result = step(0.05, saturate(result)); + + #if OUTTEX_ON + d.texcoord1.x += ((_Time.x + _RandomSeed) * _OutlineTexXSpeed) % 1; + d.texcoord1.y += ((_Time.x + _RandomSeed) * _OutlineTexYSpeed) % 1; + #if ATLAS_ON + d.texcoord1 = half2((d.texcoord1.x - _MinXUV) / (_MaxXUV - _MinXUV), (d.texcoord1.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half4 tempOutColor = SAMPLE_TEXTURE2D(_OutlineTex, sampler_OutlineTex, d.texcoord1); + tempOutColor *= _OutlineColor; + _OutlineColor = tempOutColor; + #endif + + result *= (1 - originalAlpha) * _OutlineAlpha; + + half4 outline = _OutlineColor * d.vertexColor.a; + outline.rgb *= _OutlineGlow; + outline.a = result; + #if ONLYOUTLINE_ON + col = outline; + #else + col = lerp(col, outline, result); + #endif + #endif + //------------------------------------------------------- + + //FADE_ON + #if FADE_ON + half2 tiledUvFade1 = TRANSFORM_TEX(d.texcoord0, _FadeTex); + half2 tiledUvFade2 = TRANSFORM_TEX(d.texcoord0, _FadeBurnTex); + #if ATLAS_ON + tiledUvFade1 = half2((tiledUvFade1.x - _MinXUV) / (_MaxXUV - _MinXUV), (tiledUvFade1.y - _MinYUV) / (_MaxYUV - _MinYUV)); + tiledUvFade2 = half2((tiledUvFade2.x - _MinXUV) / (_MaxXUV - _MinXUV), (tiledUvFade2.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half fadeTemp = SAMPLE_TEXTURE2D(_FadeTex, sampler_FadeTex, tiledUvFade1).r; + half fade = smoothstep(_FadeAmount, _FadeAmount + _FadeBurnTransition, fadeTemp); + half fadeBurn = saturate(smoothstep(_FadeAmount - _FadeBurnWidth, _FadeAmount - _FadeBurnWidth + 0.1, fadeTemp) * _FadeAmount); + col.a *= fade; + _FadeBurnColor.rgb *= _FadeBurnGlow; + col += fadeBurn * SAMPLE_TEXTURE2D(_FadeBurnTex, sampler_FadeBurnTex, tiledUvFade2) * _FadeBurnColor * originalAlpha * (1 - col.a); + #endif + //------------------------------------------------------- + + //SHADOW_ON + #if SHADOW_ON + half shadowA = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(_ShadowX, _ShadowY)).a; + half preMultShadowMask = 1 - (saturate(shadowA - col.a) * (1 - col.a)); + col.rgb *= 1 - ((shadowA - col.a) * (1 - col.a)); + col.rgb += (_ShadowColor * shadowA) * (1 - col.a); + col.a = max(shadowA * _ShadowAlpha * d.vertexColor.a, col.a); + #endif + + //------------------------------------------------------- + + //GLOW_ON + #if GLOW_ON + half4 emission; + #if GLOWTEX_ON + emission = SAMPLE_TEXTURE2D(_GlowTex, sampler_GlowTex, d.texcoord0); + #else + emission = col; + #endif + + col.rgb *= _GlowGlobal; + emission.rgb *= emission.a * col.a * _Glow * _GlowColor; + col.rgb += emission.rgb; + #endif + //------------------------------------------------------- + + //COLORRAMP_ON && COLORRAMPOUTLINE_ON + #if COLORRAMP_ON && COLORRAMPOUTLINE_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + luminance = saturate(luminance + _ColorRampLuminosity); + #if GRADIENTCOLORRAMP_ON + col.rgb = lerp(col.rgb, SAMPLE_TEXTURE2D(_ColorRampTexGradient, sampler_ColorRampTexGradient, half2(luminance, 0)).rgb, _ColorRampBlend); + #else + col.rgb = lerp(col.rgb, SAMPLE_TEXTURE2D(_ColorRampTex, sampler_ColorRampTex, half2(luminance, 0)).rgb, _ColorRampBlend); + #endif + #endif + //--------------- + + //GREYSCALE_ON && GREYSCALEOUTLINE_ON + #if GREYSCALE_ON && GREYSCALEOUTLINE_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + luminance = saturate(luminance + _GreyscaleLuminosity); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _GreyscaleTintColor, _GreyscaleBlend); + #endif + + //----------------------------------- + + //POSTERIZE_ON && POSTERIZEOUTLINE_ON + #if POSTERIZE_ON && POSTERIZEOUTLINE_ON + col.rgb = pow(col.rgb, _PosterizeGamma) * _PosterizeNumColors; + col.rgb = floor(col.rgb) / _PosterizeNumColors; + col.rgb = pow(col.rgb, 1.0 / _PosterizeGamma); + #endif + + //----------------------------------- + + //SHINE_ON + #if SHINE_ON + half2 uvShine = uvRect; + half cosAngle = cos(_ShineRotate); + half sinAngle = sin(_ShineRotate); + half2x2 rot = half2x2(cosAngle, -sinAngle, sinAngle, cosAngle); + uvShine -= half2(0.5, 0.5); + uvShine = mul(rot, uvShine); + uvShine += half2(0.5, 0.5); + half shineMask = SAMPLE_TEXTURE2D(_ShineMask, sampler_ShineMask, d.texcoord0.xy).a; + half currentDistanceProjection = (uvShine.x + uvShine.y) / 2; + half whitePower = 1 - (abs(currentDistanceProjection - _ShineLocation) / _ShineWidth); + col.rgb += col.a * whitePower * _ShineGlow * max(sign(currentDistanceProjection - (_ShineLocation - _ShineWidth)), 0.0) + * max(sign((_ShineLocation + _ShineWidth) - currentDistanceProjection), 0.0) * _ShineColor * shineMask; + #endif + + //----------------------------------- + + //HOLOGRAM_ON + #if HOLOGRAM_ON + half totalHologram = _HologramStripesAmount + _HologramUnmodAmount; + half hologramYCoord = ((uvRect.y + (((_Time.x + randomSeed) % 1) * _HologramStripesSpeed)) % totalHologram) / totalHologram; + hologramYCoord = abs(hologramYCoord); + half alpha = RemapFloat(saturate(hologramYCoord - (_HologramUnmodAmount/totalHologram)), 0.0, 1.0, _HologramMinAlpha, saturate(_HologramMaxAlpha)); + half hologramMask = max(sign((_HologramUnmodAmount/totalHologram) - hologramYCoord), 0.0); + half4 hologramResult = col; + hologramResult.a *= lerp(alpha, 1, hologramMask); + hologramResult.rgb *= max(1, _HologramMaxAlpha * max(sign(hologramYCoord - (_HologramUnmodAmount/totalHologram)), 0.0)); + hologramMask = 1 - step(0.01,hologramMask); + hologramResult.rgb += hologramMask * _HologramStripeColor * col.a; + col = lerp(col, hologramResult, _HologramBlend); + #endif + + //----------------------------------- + + //FLICKER_ON + #if FLICKER_ON + col.a *= saturate(col.a * step(frac(0.05 + (_Time.w + randomSeed) * _FlickerFreq), 1 - _FlickerPercent) + _FlickerAlpha); + #endif + //----------------------------------- + + //ALPHACUTOFF_ON + + //ALPHAROUND_ON + + //ALPHAOUTLINE_ON + #if ALPHAOUTLINE_ON + half alphaOutlineRes = pow(1 - col.a, max(_AlphaOutlinePower, 0.0001)) * step(_AlphaOutlineMinAlpha, col.a) * _AlphaOutlineBlend; + col.rgb = lerp(col.rgb, _AlphaOutlineColor.rgb * _AlphaOutlineGlow, alphaOutlineRes); + col.a = lerp(col.a, 1, alphaOutlineRes > 1); + #endif + //------------------------------------------------------- + + //FOG_ON + + //------------------ + + col *= _Color; + o.Albedo = col; + col.a *= _Alpha; + clip(col.a - _AlphaCutoffValue - 0.01); + o.Alpha = _Color.a; + } + + + + + + void ChainSurfaceFunction(inout Surface l, inout ShaderData d) + { + Ext_SurfaceFunction0(l, d); + // Ext_SurfaceFunction1(l, d); + // Ext_SurfaceFunction2(l, d); + // Ext_SurfaceFunction3(l, d); + // Ext_SurfaceFunction4(l, d); + // Ext_SurfaceFunction5(l, d); + // Ext_SurfaceFunction6(l, d); + // Ext_SurfaceFunction7(l, d); + // Ext_SurfaceFunction8(l, d); + // Ext_SurfaceFunction9(l, d); + // Ext_SurfaceFunction10(l, d); + // Ext_SurfaceFunction11(l, d); + // Ext_SurfaceFunction12(l, d); + // Ext_SurfaceFunction13(l, d); + // Ext_SurfaceFunction14(l, d); + // Ext_SurfaceFunction15(l, d); + // Ext_SurfaceFunction16(l, d); + // Ext_SurfaceFunction17(l, d); + // Ext_SurfaceFunction18(l, d); + // Ext_SurfaceFunction19(l, d); + // Ext_SurfaceFunction20(l, d); + // Ext_SurfaceFunction21(l, d); + // Ext_SurfaceFunction22(l, d); + // Ext_SurfaceFunction23(l, d); + // Ext_SurfaceFunction24(l, d); + // Ext_SurfaceFunction25(l, d); + // Ext_SurfaceFunction26(l, d); + // Ext_SurfaceFunction27(l, d); + // Ext_SurfaceFunction28(l, d); + // Ext_SurfaceFunction29(l, d); + } + +#if !_DECALSHADER + + void ChainModifyVertex(inout VertexData v, inout VertexToPixel v2p, float4 time) + { + ExtraV2F d; + + ZERO_INITIALIZE(ExtraV2F, d); + ZERO_INITIALIZE(Blackboard, d.blackboard); + // due to motion vectors in HDRP, we need to use the last + // time in certain spots. So if you are going to use _Time to adjust vertices, + // you need to use this time or motion vectors will break. + d.time = time; + + Ext_ModifyVertex0(v, d); + // Ext_ModifyVertex1(v, d); + // Ext_ModifyVertex2(v, d); + // Ext_ModifyVertex3(v, d); + // Ext_ModifyVertex4(v, d); + // Ext_ModifyVertex5(v, d); + // Ext_ModifyVertex6(v, d); + // Ext_ModifyVertex7(v, d); + // Ext_ModifyVertex8(v, d); + // Ext_ModifyVertex9(v, d); + // Ext_ModifyVertex10(v, d); + // Ext_ModifyVertex11(v, d); + // Ext_ModifyVertex12(v, d); + // Ext_ModifyVertex13(v, d); + // Ext_ModifyVertex14(v, d); + // Ext_ModifyVertex15(v, d); + // Ext_ModifyVertex16(v, d); + // Ext_ModifyVertex17(v, d); + // Ext_ModifyVertex18(v, d); + // Ext_ModifyVertex19(v, d); + // Ext_ModifyVertex20(v, d); + // Ext_ModifyVertex21(v, d); + // Ext_ModifyVertex22(v, d); + // Ext_ModifyVertex23(v, d); + // Ext_ModifyVertex24(v, d); + // Ext_ModifyVertex25(v, d); + // Ext_ModifyVertex26(v, d); + // Ext_ModifyVertex27(v, d); + // Ext_ModifyVertex28(v, d); + // Ext_ModifyVertex29(v, d); + + + // #if %EXTRAV2F0REQUIREKEY% + // v2p.extraV2F0 = d.extraV2F0; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // v2p.extraV2F1 = d.extraV2F1; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // v2p.extraV2F2 = d.extraV2F2; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // v2p.extraV2F3 = d.extraV2F3; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // v2p.extraV2F4 = d.extraV2F4; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // v2p.extraV2F5 = d.extraV2F5; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // v2p.extraV2F6 = d.extraV2F6; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // v2p.extraV2F7 = d.extraV2F7; + // #endif + } + + void ChainModifyTessellatedVertex(inout VertexData v, inout VertexToPixel v2p) + { + ExtraV2F d; + ZERO_INITIALIZE(ExtraV2F, d); + ZERO_INITIALIZE(Blackboard, d.blackboard); + + // #if %EXTRAV2F0REQUIREKEY% + // d.extraV2F0 = v2p.extraV2F0; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // d.extraV2F1 = v2p.extraV2F1; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // d.extraV2F2 = v2p.extraV2F2; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // d.extraV2F3 = v2p.extraV2F3; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // d.extraV2F4 = v2p.extraV2F4; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // d.extraV2F5 = v2p.extraV2F5; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // d.extraV2F6 = v2p.extraV2F6; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // d.extraV2F7 = v2p.extraV2F7; + // #endif + + + // Ext_ModifyTessellatedVertex0(v, d); + // Ext_ModifyTessellatedVertex1(v, d); + // Ext_ModifyTessellatedVertex2(v, d); + // Ext_ModifyTessellatedVertex3(v, d); + // Ext_ModifyTessellatedVertex4(v, d); + // Ext_ModifyTessellatedVertex5(v, d); + // Ext_ModifyTessellatedVertex6(v, d); + // Ext_ModifyTessellatedVertex7(v, d); + // Ext_ModifyTessellatedVertex8(v, d); + // Ext_ModifyTessellatedVertex9(v, d); + // Ext_ModifyTessellatedVertex10(v, d); + // Ext_ModifyTessellatedVertex11(v, d); + // Ext_ModifyTessellatedVertex12(v, d); + // Ext_ModifyTessellatedVertex13(v, d); + // Ext_ModifyTessellatedVertex14(v, d); + // Ext_ModifyTessellatedVertex15(v, d); + // Ext_ModifyTessellatedVertex16(v, d); + // Ext_ModifyTessellatedVertex17(v, d); + // Ext_ModifyTessellatedVertex18(v, d); + // Ext_ModifyTessellatedVertex19(v, d); + // Ext_ModifyTessellatedVertex20(v, d); + // Ext_ModifyTessellatedVertex21(v, d); + // Ext_ModifyTessellatedVertex22(v, d); + // Ext_ModifyTessellatedVertex23(v, d); + // Ext_ModifyTessellatedVertex24(v, d); + // Ext_ModifyTessellatedVertex25(v, d); + // Ext_ModifyTessellatedVertex26(v, d); + // Ext_ModifyTessellatedVertex27(v, d); + // Ext_ModifyTessellatedVertex28(v, d); + // Ext_ModifyTessellatedVertex29(v, d); + + // #if %EXTRAV2F0REQUIREKEY% + // v2p.extraV2F0 = d.extraV2F0; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // v2p.extraV2F1 = d.extraV2F1; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // v2p.extraV2F2 = d.extraV2F2; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // v2p.extraV2F3 = d.extraV2F3; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // v2p.extraV2F4 = d.extraV2F4; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // v2p.extraV2F5 = d.extraV2F5; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // v2p.extraV2F6 = d.extraV2F6; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // v2p.extraV2F7 = d.extraV2F7; + // #endif + } + + void ChainFinalColorForward(inout Surface l, inout ShaderData d, inout half4 color) + { + // Ext_FinalColorForward0(l, d, color); + // Ext_FinalColorForward1(l, d, color); + // Ext_FinalColorForward2(l, d, color); + // Ext_FinalColorForward3(l, d, color); + // Ext_FinalColorForward4(l, d, color); + // Ext_FinalColorForward5(l, d, color); + // Ext_FinalColorForward6(l, d, color); + // Ext_FinalColorForward7(l, d, color); + // Ext_FinalColorForward8(l, d, color); + // Ext_FinalColorForward9(l, d, color); + // Ext_FinalColorForward10(l, d, color); + // Ext_FinalColorForward11(l, d, color); + // Ext_FinalColorForward12(l, d, color); + // Ext_FinalColorForward13(l, d, color); + // Ext_FinalColorForward14(l, d, color); + // Ext_FinalColorForward15(l, d, color); + // Ext_FinalColorForward16(l, d, color); + // Ext_FinalColorForward17(l, d, color); + // Ext_FinalColorForward18(l, d, color); + // Ext_FinalColorForward19(l, d, color); + // Ext_FinalColorForward20(l, d, color); + // Ext_FinalColorForward21(l, d, color); + // Ext_FinalColorForward22(l, d, color); + // Ext_FinalColorForward23(l, d, color); + // Ext_FinalColorForward24(l, d, color); + // Ext_FinalColorForward25(l, d, color); + // Ext_FinalColorForward26(l, d, color); + // Ext_FinalColorForward27(l, d, color); + // Ext_FinalColorForward28(l, d, color); + // Ext_FinalColorForward29(l, d, color); + } + + void ChainFinalGBufferStandard(inout Surface s, inout ShaderData d, inout half4 GBuffer0, inout half4 GBuffer1, inout half4 GBuffer2, inout half4 outEmission, inout half4 outShadowMask) + { + // Ext_FinalGBufferStandard0(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard1(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard2(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard3(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard4(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard5(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard6(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard7(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard8(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard9(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard10(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard11(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard12(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard13(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard14(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard15(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard16(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard17(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard18(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard19(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard20(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard21(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard22(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard23(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard24(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard25(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard26(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard27(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard28(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard29(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + } +#endif + + + + + +#if _DECALSHADER + + ShaderData CreateShaderData(SurfaceDescriptionInputs IN) + { + ShaderData d = (ShaderData)0; + d.TBNMatrix = float3x3(IN.WorldSpaceTangent, IN.WorldSpaceBiTangent, IN.WorldSpaceNormal); + d.worldSpaceNormal = IN.WorldSpaceNormal; + d.worldSpaceTangent = IN.WorldSpaceTangent; + + d.worldSpacePosition = IN.WorldSpacePosition; + d.texcoord0 = IN.uv0.xyxy; + d.screenPos = IN.ScreenPosition; + + d.worldSpaceViewDir = normalize(_WorldSpaceCameraPos - d.worldSpacePosition); + + d.tangentSpaceViewDir = mul(d.TBNMatrix, d.worldSpaceViewDir); + + // these rarely get used, so we back transform them. Usually will be stripped. + #if _HDRP + // d.localSpacePosition = mul(GetWorldToObjectMatrix(), float4(GetCameraRelativePositionWS(d.worldSpacePosition), 1)).xyz; + #else + // d.localSpacePosition = mul(GetWorldToObjectMatrix(), float4(d.worldSpacePosition, 1)).xyz; + #endif + // d.localSpaceNormal = normalize(mul((float3x3)GetWorldToObjectMatrix(), d.worldSpaceNormal)); + // d.localSpaceTangent = normalize(mul((float3x3)GetWorldToObjectMatrix(), d.worldSpaceTangent.xyz)); + + // #if %SCREENPOSREQUIREKEY% + // d.screenUV = (IN.ScreenPosition.xy / max(0.01, IN.ScreenPosition.w)); + // #endif + + return d; + } +#else + + ShaderData CreateShaderData(VertexToPixel i + #if NEED_FACING + , bool facing + #endif + ) + { + ShaderData d = (ShaderData)0; + d.clipPos = i.pos; + d.worldSpacePosition = i.worldPos; + + d.worldSpaceNormal = normalize(i.worldNormal); + d.worldSpaceTangent.xyz = normalize(i.worldTangent.xyz); + + d.tangentSign = i.worldTangent.w * unity_WorldTransformParams.w; + float3 bitangent = cross(d.worldSpaceTangent.xyz, d.worldSpaceNormal) * d.tangentSign; + + d.TBNMatrix = float3x3(d.worldSpaceTangent, -bitangent, d.worldSpaceNormal); + d.worldSpaceViewDir = normalize(_WorldSpaceCameraPos - i.worldPos); + + d.tangentSpaceViewDir = mul(d.TBNMatrix, d.worldSpaceViewDir); + d.texcoord0 = i.texcoord0; + d.texcoord1 = i.texcoord1; + d.texcoord2 = i.texcoord2; + + // #if %TEXCOORD3REQUIREKEY% + d.texcoord3 = i.texcoord3; + // #endif + + // d.isFrontFace = facing; + // #if %VERTEXCOLORREQUIREKEY% + d.vertexColor = i.vertexColor; + // #endif + + // these rarely get used, so we back transform them. Usually will be stripped. + #if _HDRP + // d.localSpacePosition = mul(GetWorldToObjectMatrix(), float4(GetCameraRelativePositionWS(i.worldPos), 1)).xyz; + #else + // d.localSpacePosition = mul(GetWorldToObjectMatrix(), float4(i.worldPos, 1)).xyz; + #endif + // d.localSpaceNormal = normalize(mul((float3x3)GetWorldToObjectMatrix(), i.worldNormal)); + // d.localSpaceTangent = normalize(mul((float3x3)GetWorldToObjectMatrix(), i.worldTangent.xyz)); + + // #if %SCREENPOSREQUIREKEY% + // d.screenPos = i.screenPos; + // d.screenUV = (i.screenPos.xy / i.screenPos.w); + // #endif + + + // #if %EXTRAV2F0REQUIREKEY% + // d.extraV2F0 = i.extraV2F0; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // d.extraV2F1 = i.extraV2F1; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // d.extraV2F2 = i.extraV2F2; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // d.extraV2F3 = i.extraV2F3; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // d.extraV2F4 = i.extraV2F4; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // d.extraV2F5 = i.extraV2F5; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // d.extraV2F6 = i.extraV2F6; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // d.extraV2F7 = i.extraV2F7; + // #endif + + return d; + } + +#endif + + + #if defined(_PASSSHADOW) + float3 _LightDirection; + float3 _LightPosition; + #endif + + // vertex shader + VertexToPixel Vert (VertexData v) + { + + VertexToPixel o = (VertexToPixel)0; + + UNITY_SETUP_INSTANCE_ID(v); + UNITY_TRANSFER_INSTANCE_ID(v, o); + UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o); + + +#if !_TESSELLATION_ON + ChainModifyVertex(v, o, _Time); +#endif + + o.texcoord0 = v.texcoord0; + o.texcoord1 = v.texcoord1; + o.texcoord2 = v.texcoord2; + + // #if %TEXCOORD3REQUIREKEY% + o.texcoord3 = v.texcoord3; + // #endif + + // #if %VERTEXCOLORREQUIREKEY% + o.vertexColor = v.vertexColor; + // #endif + + VertexPositionInputs vertexInput = GetVertexPositionInputs(v.vertex.xyz); + o.worldPos = TransformObjectToWorld(v.vertex.xyz); + o.worldNormal = TransformObjectToWorldNormal(v.normal); + o.worldTangent = float4(TransformObjectToWorldDir(v.tangent.xyz), v.tangent.w); + + // For some very odd reason, in 2021.2, we can't use Unity's defines, but have to use our own.. + #if _PASSSHADOW + #if _CASTING_PUNCTUAL_LIGHT_SHADOW + float3 lightDirectionWS = normalize(_LightPosition - o.worldPos); + #else + float3 lightDirectionWS = _LightDirection; + #endif + // Define shadow pass specific clip position for Universal + o.pos = TransformWorldToHClip(ApplyShadowBias(o.worldPos, o.worldNormal, lightDirectionWS)); + #if UNITY_REVERSED_Z + o.pos.z = min(o.pos.z, UNITY_NEAR_CLIP_VALUE); + #else + o.pos.z = max(o.pos.z, UNITY_NEAR_CLIP_VALUE); + #endif + #elif _PASSMETA + o.pos = MetaVertexPosition(float4(v.vertex.xyz, 0), v.texcoord1.xy, v.texcoord2.xy, unity_LightmapST, unity_DynamicLightmapST); + #else + o.pos = TransformWorldToHClip(o.worldPos); + #endif + + // #if %SCREENPOSREQUIREKEY% + // o.screenPos = ComputeScreenPos(o.pos, _ProjectionParams.x); + // #endif + + #if _PASSFORWARD || _PASSGBUFFER + float2 uv1 = v.texcoord1.xy; + OUTPUT_LIGHTMAP_UV(uv1, unity_LightmapST, o.lightmapUV); + o.texcoord1.xy = uv1; + OUTPUT_SH(o.worldNormal, o.sh); + #if defined(DYNAMICLIGHTMAP_ON) + o.dynamicLightmapUV.xy = v.texcoord2.xy * unity_DynamicLightmapST.xy + unity_DynamicLightmapST.zw; + #endif + #endif + + #ifdef VARYINGS_NEED_FOG_AND_VERTEX_LIGHT + half fogFactor = 0; + #if defined(_FOG_FRAGMENT) + fogFactor = ComputeFogFactor(o.pos.z); + #endif + #if _BAKEDLIT + o.fogFactorAndVertexLight = half4(fogFactor, 0, 0, 0); + #else + half3 vertexLight = VertexLighting(o.worldPos, o.worldNormal); + o.fogFactorAndVertexLight = half4(fogFactor, vertexLight); + #endif + #endif + + #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR) + o.shadowCoord = GetShadowCoord(vertexInput); + #endif + + return o; + } + + + + + // fragment shader + void Frag (VertexToPixel IN + , out half4 outNormalWS : SV_Target0 + #ifdef _WRITE_RENDERING_LAYERS + , out float4 outRenderingLayers : SV_Target1 + #endif + #ifdef _DEPTHOFFSET_ON + , out float outputDepth : SV_Depth + #endif + #if NEED_FACING + , bool facing : SV_IsFrontFace + #endif + ) + { + UNITY_SETUP_INSTANCE_ID(IN); + UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX(IN); + + #if defined(LOD_FADE_CROSSFADE) + LODFadeCrossFade(IN.pos); + #endif + + ShaderData d = CreateShaderData(IN + #if NEED_FACING + , facing + #endif + ); + Surface l = (Surface)0; + + #ifdef _DEPTHOFFSET_ON + l.outputDepth = outputDepth; + #endif + + l.Albedo = half3(0.5, 0.5, 0.5); + l.Normal = float3(0,0,1); + l.Occlusion = 1; + l.Alpha = 1; + + ChainSurfaceFunction(l, d); + + #ifdef _DEPTHOFFSET_ON + outputDepth = l.outputDepth; + #endif + + #if defined(_GBUFFER_NORMALS_OCT) + float3 normalWS = d.worldSpaceNormal; + float2 octNormalWS = PackNormalOctQuadEncode(normalWS); // values between [-1, +1], must use fp32 on some platforms + float2 remappedOctNormalWS = saturate(octNormalWS * 0.5 + 0.5); // values between [ 0, 1] + half3 packedNormalWS = PackFloat2To888(remappedOctNormalWS); // values between [ 0, 1] + outNormalWS = half4(packedNormalWS, 0.0); + #else + float3 wsn = l.Normal; + #if !_WORLDSPACENORMAL + wsn = TangentToWorldSpace(d, l.Normal); + #endif + outNormalWS = half4(NormalizeNormalPerPixel(wsn), 0.0); + #endif + + #ifdef _WRITE_RENDERING_LAYERS + uint renderingLayers = GetMeshRenderingLayer(); + outRenderingLayers = float4(EncodeMeshRenderingLayer(renderingLayers), 0, 0, 0); + #endif + + + } + + ENDHLSL + + } + + + + + + + + } + + + CustomEditor "AllIn1SpriteShaderLitMaterialInspector" +} diff --git a/Assets/Plugins/AllIn1SpriteShader/Shaders/LitShaders/AllIn1SpriteShaderLit_BetterShader_URP2022.txt.meta b/Assets/Plugins/AllIn1SpriteShader/Shaders/LitShaders/AllIn1SpriteShaderLit_BetterShader_URP2022.txt.meta new file mode 100644 index 000000000..8728a69d6 --- /dev/null +++ b/Assets/Plugins/AllIn1SpriteShader/Shaders/LitShaders/AllIn1SpriteShaderLit_BetterShader_URP2022.txt.meta @@ -0,0 +1,14 @@ +fileFormatVersion: 2 +guid: 7a76ffb960fb45246965a6e47eeb1a66 +TextScriptImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 156513 + packageName: All In 1 Sprite Shader + packageVersion: 4.25 + assetPath: Assets/Plugins/AllIn1SpriteShader/Shaders/LitShaders/AllIn1SpriteShaderLit_BetterShader_URP2022.txt + uploadId: 708810 diff --git a/Assets/Plugins/AllIn1SpriteShader/Shaders/LitShaders/AllIn1SpriteShaderLit_BetterShader_URP2023.txt b/Assets/Plugins/AllIn1SpriteShader/Shaders/LitShaders/AllIn1SpriteShaderLit_BetterShader_URP2023.txt new file mode 100644 index 000000000..88a49075d --- /dev/null +++ b/Assets/Plugins/AllIn1SpriteShader/Shaders/LitShaders/AllIn1SpriteShaderLit_BetterShader_URP2023.txt @@ -0,0 +1,17664 @@ +//////////////////////////////////////// +// Generated with Better Shaders +// +// Auto-generated shader code, don't hand edit! +// +// Unity Version: 2019.4.16f1 +// Render Pipeline: URP2023 +// Platform: WindowsEditor +//////////////////////////////////////// + + +Shader "AllIn1SpriteShader/AllIn1SpriteShaderLit_BetterShader" +{ + Properties + { + + _MainTex ("Main Texture", 2D) = "white" {} //0 + _Color("Main Color", Color) = (1,1,1,1) //1 + _Alpha("General Alpha", Range(0,1)) = 1 //2 + + _GlowColor("Glow Color", Color) = (1,1,1,1) //3 + _Glow("Glow Color Intensity", Range(0,100)) = 10 //4 + _GlowGlobal("Global Glow Intensity", Range(1,100)) = 1 //5 + [NoScaleOffset] _GlowTex("Glow Texture", 2D) = "white" {} //6 + + _FadeTex("Fade Texture", 2D) = "white" {} //7 + _FadeAmount("Fade Amount", Range(-0.1,1)) = -0.1 //8 + _FadeBurnWidth("Fade Burn Width", Range(0,1)) = 0.025 //9 + _FadeBurnTransition("Burn Transition", Range(0.01,0.5)) = 0.075 //10 + _FadeBurnColor("Fade Burn Color", Color) = (1,1,0,1) //11 + _FadeBurnTex("Fade Burn Texture", 2D) = "white" {} //12 + _FadeBurnGlow("Fade Burn Glow", Range(1,250)) = 2//13 + + _OutlineColor("Outline Base Color", Color) = (1,1,1,1) //14 + _OutlineAlpha("Outline Base Alpha", Range(0,1)) = 1 //15 + _OutlineGlow("Outline Base Glow", Range(1,100)) = 1.5 //16 + _OutlineWidth("Outline Base Width", Range(0,0.2)) = 0.004 //17 + _OutlinePixelWidth("Outline Base Pixel Width", Int) = 1 //18 + + [Space] + _OutlineTex("Outline Texture", 2D) = "white" {} //19 + _OutlineTexXSpeed("Texture scroll speed X", Range(-50,50)) = 10 //20 + _OutlineTexYSpeed("Texture scroll speed Y", Range(-50,50)) = 0 //21 + + [Space] + _OutlineDistortTex("Outline Distortion Texture", 2D) = "white" {} //22 + _OutlineDistortAmount("Outline Distortion Amount", Range(0,2)) = 0.5 //23 + _OutlineDistortTexXSpeed("Distortion scroll speed X", Range(-50,50)) = 5 //24 + _OutlineDistortTexYSpeed("Distortion scroll speed Y", Range(-50,50)) = 5 //25 + + _AlphaOutlineColor("Color", Color) = (1, 1, 1, 1) //26 + _AlphaOutlineGlow("Outline Glow", Range(1,100)) = 5 //27 + _AlphaOutlinePower("Power", Range(0, 5)) = 1 // 28 + _AlphaOutlineMinAlpha("Min Alpha", Range(0, 1)) = 0 // 29 + _AlphaOutlineBlend("Blend", Range(0, 1)) = 1 // 30 + + _GradBlend("Gradient Blend", Range(0,1)) = 1 //31 + _GradTopLeftCol("Top Color", Color) = (1,0,0,1) //32 + _GradTopRightCol("Top Color 2", Color) = (1, 1, 0, 1) //33 + _GradBotLeftCol("Bot Color", Color) = (0,0,1,1) //34 + _GradBotRightCol("Bot Color 2", Color) = (0, 1, 0, 1) //35 + + [NoScaleOffset] _ColorSwapTex("Color Swap Texture", 2D) = "black" {} //36 + [HDR] _ColorSwapRed("Red Channel", Color) = (1,1,1,1) //37 + _ColorSwapRedLuminosity("Red luminosity", Range(-1,1)) = 0.5 //38 + [HDR] _ColorSwapGreen("Green Channel", Color) = (1,1,1,1) //39 + _ColorSwapGreenLuminosity("Green luminosity", Range(-1,1)) = 0.5 //40 + [HDR] _ColorSwapBlue("Blue Channel", Color) = (1,1,1,1) //41 + _ColorSwapBlueLuminosity("Blue luminosity", Range(-1,1)) = 0.5 //42 + + _HsvShift("Hue Shift", Range(0, 360)) = 180 //43 + _HsvSaturation("Saturation", Range(0, 2)) = 1 //44 + _HsvBright("Brightness", Range(0, 2)) = 1 //45 + + _HitEffectColor("Hit Effect Color", Color) = (1,1,1,1) //46 + _HitEffectGlow("Glow Intensity", Range(1,100)) = 5 //47 + [Space] + _HitEffectBlend("Hit Effect Blend", Range(0,1)) = 1 //48 + + _NegativeAmount("Negative Amount", Range(0, 1)) = 1 //49 + + _PixelateSize("Pixelate size", Range(4,512)) = 32 //50 + + [NoScaleOffset] _ColorRampTex("Color ramp Texture", 2D) = "white" {} //51 + _ColorRampLuminosity("Color ramp luminosity", Range(-1,1)) = 0 //52 + [Toggle()] _ColorRampOutline("Affects everything?", float) = 0 //53 + + _GreyscaleLuminosity("Greyscale luminosity", Range(-1,1)) = 0 //54 + [Toggle()] _GreyscaleOutline("Affects everything?", float) = 0 //55 + _GreyscaleTintColor("Greyscale Tint Color", Color) = (1,1,1,1) //56 + + _PosterizeNumColors("Number of Colors", Range(0,100)) = 8 //57 + _PosterizeGamma("Posterize Amount", Range(0.1,10)) = 0.75 //58 + [Toggle()] _PosterizeOutline("Affects everything?", float) = 0 //59 + + _BlurIntensity("Blur Intensity", Range(0,100)) = 10 //60 + [Toggle()] _BlurHD("Blur is Low Res?", float) = 0 //61 + + _MotionBlurAngle("Motion Blur Angle", Range(-1, 1)) = 0.1 //62 + _MotionBlurDist("Motion Blur Distance", Range(-3, 3)) = 1.25 //63 + + _GhostColorBoost("Ghost Color Boost", Range(0,5)) = 1 //64 + _GhostTransparency("Ghost Transparency", Range(0,1)) = 0 //65 + + _InnerOutlineColor("Inner Outline Color", Color) = (1,0,0,1) //66 + _InnerOutlineThickness("Outline Thickness", Range(0,3)) = 1 //67 + _InnerOutlineAlpha("Inner Outline Alpha", Range(0,1)) = 1 //68 + _InnerOutlineGlow("Inner Outline Glow", Range(1,250)) = 4 //69 + + _AlphaCutoffValue("Alpha cutoff value", Range(0, 1)) = 0.25 //70 + + [Toggle()] _OnlyOutline("Only render outline?", float) = 0 //71 + [Toggle()] _OnlyInnerOutline("Only render inner outline?", float) = 0 //72 + + _HologramStripesAmount("Stripes Amount", Range(0, 1)) = 0.1 //73 + _HologramUnmodAmount("Unchanged Amount", Range(0, 1)) = 0.0 //74 + _HologramStripesSpeed("Stripes Speed", Range(-20, 20)) = 4.5 //75 + _HologramMinAlpha("Min Alpha", Range(0, 1)) = 0.1 //76 + _HologramMaxAlpha("Max Alpha", Range(0, 100)) = 0.75 //77 + + _ChromAberrAmount("ChromAberr Amount", Range(0, 1)) = 1 //78 + _ChromAberrAlpha("ChromAberr Alpha", Range(0, 1)) = 0.4 //79 + + _GlitchAmount("Glitch Amount", Range(0, 20)) = 3 //80 + + _FlickerPercent("Flicker Percent", Range(0, 1)) = 0.05 //81 + _FlickerFreq("Flicker Frequency", Range(0, 5)) = 0.2 //82 + _FlickerAlpha("Flicker Alpha", Range(0, 1)) = 0 //83 + + _ShadowX("Shadow X Axis", Range(-0.5, 0.5)) = 0.1 //84 + _ShadowY("Shadow Y Axis", Range(-0.5, 0.5)) = -0.05 //85 + _ShadowAlpha("Shadow Alpha", Range(0, 1)) = 0.5 //86 + _ShadowColor("Shadow Color", Color) = (0, 0, 0, 1) //87 + + _HandDrawnAmount("Hand Drawn Amount", Range(0, 20)) = 10 //88 + _HandDrawnSpeed("Hand Drawn Speed", Range(1, 15)) = 5 //89 + + _GrassSpeed("Speed", Range(0,50)) = 2 //90 + _GrassWind("Bend amount", Range(0,50)) = 20 //91 + [Space] + [Toggle()] _GrassManualToggle("Manually animated?", float) = 0 //92 + _GrassManualAnim("Manual Anim Value", Range(-1,1)) = 1 //93 + + _WaveAmount("Wave Amount", Range(0, 25)) = 7 //94 + _WaveSpeed("Wave Speed", Range(0, 25)) = 10 //95 + _WaveStrength("Wave Strength", Range(0, 25)) = 7.5 //96 + _WaveX("Wave X Axis", Range(0, 1)) = 0 //97 + _WaveY("Wave Y Axis", Range(0, 1)) = 0.5 //98 + + _RectSize("Rect Size", Range(1, 4)) = 1 //99 + + _OffsetUvX("X axis", Range(-1, 1)) = 0 //100 + _OffsetUvY("Y axis", Range(-1, 1)) = 0 //101 + + _ClipUvLeft("Clipping Left", Range(0, 1)) = 0 //102 + _ClipUvRight("Clipping Right", Range(0, 1)) = 0 //103 + _ClipUvUp("Clipping Up", Range(0, 1)) = 0 //104 + _ClipUvDown("Clipping Down", Range(0, 1)) = 0 //105 + + _TextureScrollXSpeed("Speed X Axis", Range(-5, 5)) = 1 //106 + _TextureScrollYSpeed("Speed Y Axis", Range(-5, 5)) = 0 //107 + + _ZoomUvAmount("Zoom Amount", Range(0.1, 5)) = 0.5 //108 + + _DistortTex("Distortion Texture", 2D) = "white" {} //109 + _DistortAmount("Distortion Amount", Range(0,2)) = 0.5 //110 + _DistortTexXSpeed("Scroll speed X", Range(-50,50)) = 5 //111 + _DistortTexYSpeed("Scroll speed Y", Range(-50,50)) = 5 //112 + + _TwistUvAmount("Twist Amount", Range(0, 3.1416)) = 1 //113 + _TwistUvPosX("Twist Pos X Axis", Range(0, 1)) = 0.5 //114 + _TwistUvPosY("Twist Pos Y Axis", Range(0, 1)) = 0.5 //115 + _TwistUvRadius("Twist Radius", Range(0, 3)) = 0.75 //116 + + _RotateUvAmount("Rotate Angle(radians)", Range(0, 6.2831)) = 0 //117 + + _FishEyeUvAmount("Fish Eye Amount", Range(0, 0.5)) = 0.35 //118 + + _PinchUvAmount("Pinch Amount", Range(0, 0.5)) = 0.35 //119 + + _ShakeUvSpeed("Shake Speed", Range(0, 20)) = 2.5 //120 + _ShakeUvX("X Multiplier", Range(0, 5)) = 1.5 //121 + _ShakeUvY("Y Multiplier", Range(0, 5)) = 1 //122 + + _ColorChangeTolerance("Tolerance", Range(0, 1)) = 0.25 //123 + _ColorChangeTarget("Color to change", Color) = (1, 0, 0, 1) //124 + [HDR] _ColorChangeNewCol("New Color", Color) = (1, 1, 0, 1) //125 + _ColorChangeLuminosity("New Color Luminosity", Range(0, 1)) = 0.0 //126 + + _RoundWaveStrength("Wave Strength", Range(0, 1)) = 0.7 //127 + _RoundWaveSpeed("Wave Speed", Range(0, 5)) = 2 //128 + + [Toggle()] _BillboardY("Billboard on both axis?", float) = 0 //129 + _ZWrite ("Depth Write", Float) = 1.0 // 130 + + _MySrcMode ("SrcMode", Float) = 5 // 131 + _MyDstMode ("DstMode", Float) = 10 // 132 + + _ShineColor("Shine Color", Color) = (1,1,1,1) // 133 + _ShineLocation("Shine Location", Range(0,1)) = 0.5 // 134 + _ShineRotate("Rotate Angle(radians)", Range(0, 6.2831)) = 0 //135 + _ShineWidth("Shine Width", Range(0.05,1)) = 0.1 // 136 + _ShineGlow("Shine Glow", Range(0,100)) = 1 // 137 + [NoScaleOffset] _ShineMask("Shine Mask", 2D) = "white" {} // 138 + + _GlitchSize("Glitch Size", Range(0.25, 5)) = 1 //139 + _HologramStripeColor("Stripes Color", Color) = (0,1,1,1) //140 + _GradBoostX("Boost X axis", Range(0.1, 5)) = 1.2 //141 + _GradBoostY("Boost Y axis", Range(0.1, 5)) = 1.2 //142 + [Toggle()] _GradIsRadial("Radial Gradient?", float) = 0 //143 + _AlphaRoundThreshold("Round Threshold", Range(0.005, 1.0)) = 0.5 //144 + _GrassRadialBend("Radial Bend", Range(0.0, 5.0)) = 0.1 //145 + + _ColorChangeTolerance2("Tolerance 2", Range(0, 1)) = 0.25 //146 + _ColorChangeTarget2("Color to change 2", Color) = (1, 0, 0, 1) //147 + [HDR] _ColorChangeNewCol2("New Color 2", Color) = (1, 1, 0, 1) //148 + _ColorChangeTolerance3("Tolerance 3", Range(0, 1)) = 0.25 //149 + _ColorChangeTarget3("Color to change 3", Color) = (1, 0, 0, 1) //150 + [HDR] _ColorChangeNewCol3("New Color 3", Color) = (1, 1, 0, 1) //151 + + _Contrast ("Contrast", Range(0, 6)) = 1 // 152 + _Brightness ("Brightness", Range(-1, 1)) = 0 // 153 + + _ColorSwapBlend ("Color Swap Blend", Range(0, 1)) = 1 // 154 + _ColorRampBlend ("Color Ramp Blend", Range(0, 1)) = 1 // 155 + _GreyscaleBlend ("Greyscale Blend", Range(0, 1)) = 1 // 156 + _GhostBlend ("Ghost Blend", Range(0, 1)) = 1 // 157 + _HologramBlend ("Hologram Blend", Range(0, 1)) = 1 // 158 + + [AllIn1ShaderGradient] _ColorRampTexGradient("Color ramp Gradient", 2D) = "white" {} //159 + + _OverlayTex("Overlay Texture", 2D) = "white" {} //160 + _OverlayColor("Overlay Color", Color) = (1, 1, 1, 1) //161 + _OverlayGlow("Overlay Glow", Range(0,25)) = 1 // 162 + _OverlayBlend("Overlay Blend", Range(0, 1)) = 1 // 163 + + _RadialStartAngle("Radial Start Angle", Range(0, 360)) = 90 //164 + _RadialClip("Radial Clip", Range(0, 360)) = 45 //165 + _RadialClip2("Radial Clip 2", Range(0, 360)) = 0 //166 + + _WarpStrength("Warp Strength", Range(0, 0.1)) = 0.025 //167 + _WarpSpeed("Warp Speed", Range(0, 25)) = 8 //168 + _WarpScale("Warp Scale", Range(0.05, 3)) = 0.5 //169 + + _OverlayTextureScrollXSpeed("Speed X Axis", Range(-5, 5)) = 0.25 //170 + _OverlayTextureScrollYSpeed("Speed Y Axis", Range(-5, 5)) = 0.25 //171 + + _ZTestMode ("Z Test Mode", Float) = 4 + _CullingOption ("Culling Option", float) = 0 + + [HideInInspector] _MinXUV("_MinXUV", Range(0, 1)) = 0.0 + [HideInInspector] _MaxXUV("_MaxXUV", Range(0, 1)) = 1.0 + [HideInInspector] _MinYUV("_MinYUV", Range(0, 1)) = 0.0 + [HideInInspector] _MaxYUV("_MaxYUV", Range(0, 1)) = 1.0 + [HideInInspector] _RandomSeed("_MaxYUV", Range(0, 10000)) = 0.0 + _EditorDrawers("Editor Drawers", Int) = 6 + + [Normal][NoScaleOffset] _NormalMap("Normal Map", 2D) = "bump" {} + _NormalStrength("Normal Strength", Range(0, 15)) = 1.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) = "" {} + + } + SubShader + { + Tags { "RenderPipeline"="UniversalPipeline" "RenderType" = "Opaque" "UniversalMaterialType" = "Lit" "Queue" = "Geometry" } + + + + + Pass + { + Name "Universal Forward" + Tags + { + "LightMode" = "UniversalForward" + } + Cull Back + Blend One Zero + ZTest LEqual + ZWrite On + + Blend One Zero, One Zero +Cull Back +ZTest LEqual +ZWrite On + + Tags { "RenderType" = "Opaque" "Queue" = "Geometry" "PreviewType" = "Plane" } + Cull [_CullingOption] + ZWrite [_ZWrite] + ZTest [_ZTestMode] + + + HLSLPROGRAM + + #pragma vertex Vert + #pragma fragment Frag + + #pragma target 3.0 + + #pragma prefer_hlslcc gles + #pragma exclude_renderers d3d11_9x + #pragma multi_compile_fog + #pragma multi_compile_instancing + #pragma instancing_options renderinglayer + + // Keywords + #pragma multi_compile_fragment _ _SCREEN_SPACE_OCCLUSION + #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 _ _ADDITIONAL_LIGHTS_VERTEX _ADDITIONAL_LIGHTS + #pragma multi_compile_fragment _ _ADDITIONAL_LIGHT_SHADOWS + #pragma multi_compile_fragment _ _REFLECTION_PROBE_BLENDING + #pragma multi_compile_fragment _ _REFLECTION_PROBE_BOX_PROJECTION + #pragma multi_compile_fragment _ _SHADOWS_SOFT + #pragma multi_compile_fragment _ _SHADOWS_SOFT_LOW + #pragma multi_compile_fragment _ _SHADOWS_SOFT_MEDIUM + #pragma multi_compile_fragment _ _SHADOWS_SOFT_HIGH + #pragma multi_compile _ LIGHTMAP_SHADOW_MIXING + #pragma multi_compile _ SHADOWS_SHADOWMASK + #pragma multi_compile_fragment _ _DBUFFER_MRT1 _DBUFFER_MRT2 _DBUFFER_MRT3 + #pragma multi_compile_fragment _ _LIGHT_LAYERS + #pragma multi_compile_fragment _ DEBUG_DISPLAY + #pragma multi_compile_fragment _ _LIGHT_COOKIES + #pragma multi_compile _ _FORWARD_PLUS + #pragma multi_compile _ EVALUATE_SH_VERTEX + #pragma multi_compile _ EVALUATE_SH_MIXED + #pragma multi_compile_fragment _ LOD_FADE_CROSSFADE + + + // GraphKeywords: + + #define SHADER_PASS SHADERPASS_FORWARD + #define VARYINGS_NEED_FOG_AND_VERTEX_LIGHT + #define _PASSFORWARD 1 + #define _FOG_FRAGMENT 1 + + + + #pragma shader_feature_local GLOW_ON + #pragma shader_feature_local FADE_ON + #pragma shader_feature_local OUTBASE_ON + #pragma shader_feature_local ONLYOUTLINE_ON + #pragma shader_feature_local GRADIENT_ON + #pragma shader_feature_local GRADIENT2COL_ON + #pragma shader_feature_local RADIALGRADIENT_ON + #pragma shader_feature_local COLORSWAP_ON + #pragma shader_feature_local HSV_ON + #pragma shader_feature_local CHANGECOLOR_ON + #pragma shader_feature_local CHANGECOLOR2_ON + #pragma shader_feature_local CHANGECOLOR3_ON + #pragma shader_feature_local COLORRAMP_ON + #pragma shader_feature_local GRADIENTCOLORRAMP_ON + #pragma shader_feature_local HITEFFECT_ON + #pragma shader_feature_local NEGATIVE_ON + #pragma shader_feature_local PIXELATE_ON + #pragma shader_feature_local GREYSCALE_ON + #pragma shader_feature_local POSTERIZE_ON + #pragma shader_feature_local BLUR_ON + #pragma shader_feature_local MOTIONBLUR_ON + #pragma shader_feature_local GHOST_ON + #pragma shader_feature_local ALPHAOUTLINE_ON + #pragma shader_feature_local INNEROUTLINE_ON + #pragma shader_feature_local ONLYINNEROUTLINE_ON + #pragma shader_feature_local HOLOGRAM_ON + #pragma shader_feature_local CHROMABERR_ON + #pragma shader_feature_local GLITCH_ON + #pragma shader_feature_local FLICKER_ON + #pragma shader_feature_local SHADOW_ON + #pragma shader_feature_local SHINE_ON + #pragma shader_feature_local CONTRAST_ON + #pragma shader_feature_local OVERLAY_ON + #pragma shader_feature_local OVERLAYMULT_ON + #pragma shader_feature_local DOODLE_ON + #pragma shader_feature_local WIND_ON + #pragma shader_feature_local WAVEUV_ON + #pragma shader_feature_local ROUNDWAVEUV_ON + #pragma shader_feature_local RECTSIZE_ON + #pragma shader_feature_local OFFSETUV_ON + #pragma shader_feature_local CLIPPING_ON + #pragma shader_feature_local RADIALCLIPPING_ON + #pragma shader_feature_local TEXTURESCROLL_ON + #pragma shader_feature_local ZOOMUV_ON + #pragma shader_feature_local DISTORT_ON + #pragma shader_feature_local WARP_ON + #pragma shader_feature_local TWISTUV_ON + #pragma shader_feature_local ROTATEUV_ON + #pragma shader_feature_local POLARUV_ON + #pragma shader_feature_local FISHEYE_ON + #pragma shader_feature_local PINCH_ON + #pragma shader_feature_local SHAKEUV_ON + + #pragma shader_feature_local GLOWTEX_ON + #pragma shader_feature_local OUTTEX_ON + #pragma shader_feature_local OUTDIST_ON + #pragma shader_feature_local OUTBASE8DIR_ON + #pragma shader_feature_local OUTBASEPIXELPERF_ON + #pragma shader_feature_local COLORRAMPOUTLINE_ON + #pragma shader_feature_local GREYSCALEOUTLINE_ON + #pragma shader_feature_local POSTERIZEOUTLINE_ON + #pragma shader_feature_local BLURISHD_ON + #pragma shader_feature_local MANUALWIND_ON + #pragma shader_feature_local ATLAS_ON + #pragma shader_feature_local PREMULTIPLYALPHA_ON + + #pragma shader_feature BILBOARD_ON + #pragma shader_feature BILBOARDY_ON + + #pragma shader_feature NORMALMAP_ON + + + #define _URP 1 +#define _USINGTEXCOORD1 1 +#define _USINGTEXCOORD2 1 + + + // this has to be here or specular color will be ignored. Not in SG code + #if _SIMPLELIT + #define _SPECULAR_COLOR + #endif + + + // Includes + + #include_with_pragmas "Packages/com.unity.render-pipelines.universal/ShaderLibrary/DOTS.hlsl" + #include_with_pragmas "Packages/com.unity.render-pipelines.universal/ShaderLibrary/RenderingLayers.hlsl" + #include_with_pragmas "Packages/com.unity.render-pipelines.universal/ShaderLibrary/ProbeVolumeVariants.hlsl" + #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.universal/ShaderLibrary/Input.hlsl" + #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/TextureStack.hlsl" + #include_with_pragmas "Packages/com.unity.render-pipelines.core/ShaderLibrary/FoveatedRenderingKeywords.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" + #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/LODCrossFade.hlsl" + + + #undef WorldNormalVector + #define WorldNormalVector(data, normal) mul(normal, data.TBNMatrix) + + #define UnityObjectToWorldNormal(normal) mul(GetObjectToWorldMatrix(), normal) + + #define _WorldSpaceLightPos0 _MainLightPosition + + #define UNITY_DECLARE_TEX2D(name) TEXTURE2D(name); SAMPLER(sampler##name); + #define UNITY_DECLARE_TEX2D_NOSAMPLER(name) TEXTURE2D(name); + #define UNITY_DECLARE_TEX2DARRAY(name) TEXTURE2D_ARRAY(name); SAMPLER(sampler##name); + #define UNITY_DECLARE_TEX2DARRAY_NOSAMPLER(name) TEXTURE2D_ARRAY(name); + + #define UNITY_SAMPLE_TEX2DARRAY(tex,coord) SAMPLE_TEXTURE2D_ARRAY(tex, sampler##tex, coord.xy, coord.z) + #define UNITY_SAMPLE_TEX2DARRAY_LOD(tex,coord,lod) SAMPLE_TEXTURE2D_ARRAY_LOD(tex, sampler##tex, coord.xy, coord.z, lod) + #define UNITY_SAMPLE_TEX2D(tex, coord) SAMPLE_TEXTURE2D(tex, sampler##tex, coord) + #define UNITY_SAMPLE_TEX2D_SAMPLER(tex, samp, coord) SAMPLE_TEXTURE2D(tex, sampler##samp, coord) + + #define UNITY_SAMPLE_TEX2D_LOD(tex,coord, lod) SAMPLE_TEXTURE2D_LOD(tex, sampler_##tex, coord, lod) + #define UNITY_SAMPLE_TEX2D_SAMPLER_LOD(tex,samplertex,coord, lod) SAMPLE_TEXTURE2D_LOD (tex, sampler##samplertex,coord, lod) + + #if defined(UNITY_COMPILER_HLSL) + #define UNITY_INITIALIZE_OUTPUT(type,name) name = (type)0; + #else + #define UNITY_INITIALIZE_OUTPUT(type,name) + #endif + + #define sampler2D_float sampler2D + #define sampler2D_half sampler2D + + + + // data across stages, stripped like the above. + struct VertexToPixel + { + float4 pos : SV_POSITION; + float3 worldPos : TEXCOORD0; + float3 worldNormal : TEXCOORD1; + float4 worldTangent : TEXCOORD2; + float4 texcoord0 : TEXCOORD3; + float4 texcoord1 : TEXCOORD4; + float4 texcoord2 : TEXCOORD5; + + // #if %TEXCOORD3REQUIREKEY% + float4 texcoord3 : TEXCOORD6; + // #endif + + // #if %SCREENPOSREQUIREKEY% + // float4 screenPos : TEXCOORD7; + // #endif + + // #if %VERTEXCOLORREQUIREKEY% + half4 vertexColor : COLOR; + // #endif + + #if defined(LIGHTMAP_ON) + float2 lightmapUV : TEXCOORD8; + #endif + #if defined(DYNAMICLIGHTMAP_ON) + float2 dynamicLightmapUV : TEXCOORD9; + #endif + #if !defined(LIGHTMAP_ON) + float4 probeOcclusion : TEXCOORD8; + float3 sh : TEXCOORD10; + #endif + + #if defined(VARYINGS_NEED_FOG_AND_VERTEX_LIGHT) + float4 fogFactorAndVertexLight : TEXCOORD11; + #endif + + #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR) + float4 shadowCoord : TEXCOORD12; + #endif + + // #if %EXTRAV2F0REQUIREKEY% + // float4 extraV2F0 : TEXCOORD13; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // float4 extraV2F1 : TEXCOORD14; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // float4 extraV2F2 : TEXCOORD15; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // float4 extraV2F3 : TEXCOORD16; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // float4 extraV2F4 : TEXCOORD17; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // float4 extraV2F5 : TEXCOORD18; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // float4 extraV2F6 : TEXCOORD19; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // float4 extraV2F7 : TEXCOORD20; + // #endif + + #if UNITY_ANY_INSTANCING_ENABLED + uint instanceID : CUSTOM_INSTANCE_ID; + #endif + #if (defined(UNITY_STEREO_MULTIVIEW_ENABLED)) || (defined(UNITY_STEREO_INSTANCING_ENABLED) && (defined(SHADER_API_GLES3) || defined(SHADER_API_GLCORE))) + uint stereoTargetEyeIndexAsBlendIdx0 : BLENDINDICES0; + #endif + #if (defined(UNITY_STEREO_INSTANCING_ENABLED)) + uint stereoTargetEyeIndexAsRTArrayIdx : SV_RenderTargetArrayIndex; + #endif + #if defined(SHADER_STAGE_FRAGMENT) && defined(VARYINGS_NEED_CULLFACE) + FRONT_FACE_TYPE cullFace : FRONT_FACE_SEMANTIC; + #endif + + #if _PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR)) + float4 previousPositionCS : TEXCOORD21; // Contain previous transform position (in case of skinning for example) + float4 positionCS : TEXCOORD22; + #endif + }; + + + + + // data describing the user output of a pixel + struct Surface + { + half3 Albedo; + half Height; + half3 Normal; + half Smoothness; + half3 Emission; + half Metallic; + half3 Specular; + half Occlusion; + half SpecularPower; // for simple lighting + half Alpha; + float outputDepth; // if written, SV_Depth semantic is used. ShaderData.clipPos.z is unused value + // HDRP Only + half SpecularOcclusion; + half SubsurfaceMask; + half Thickness; + half CoatMask; + half CoatSmoothness; + half Anisotropy; + half IridescenceMask; + half IridescenceThickness; + int DiffusionProfileHash; + float SpecularAAThreshold; + float SpecularAAScreenSpaceVariance; + // requires _OVERRIDE_BAKEDGI to be defined, but is mapped in all pipelines + float3 DiffuseGI; + float3 BackDiffuseGI; + float3 SpecularGI; + float ior; + float3 transmittanceColor; + float atDistance; + float transmittanceMask; + // requires _OVERRIDE_SHADOWMASK to be defines + float4 ShadowMask; + + // for decals + float NormalAlpha; + float MAOSAlpha; + + + }; + + // Data the user declares in blackboard blocks + struct Blackboard + { + + float blackboardDummyData; + }; + + // data the user might need, this will grow to be big. But easy to strip + struct ShaderData + { + float4 clipPos; // SV_POSITION + float3 localSpacePosition; + float3 localSpaceNormal; + float3 localSpaceTangent; + + float3 worldSpacePosition; + float3 worldSpaceNormal; + float3 worldSpaceTangent; + float tangentSign; + + float3 worldSpaceViewDir; + float3 tangentSpaceViewDir; + + float4 texcoord0; + float4 texcoord1; + float4 texcoord2; + float4 texcoord3; + + float2 screenUV; + float4 screenPos; + + float4 vertexColor; + bool isFrontFace; + + float4 extraV2F0; + float4 extraV2F1; + float4 extraV2F2; + float4 extraV2F3; + float4 extraV2F4; + float4 extraV2F5; + float4 extraV2F6; + float4 extraV2F7; + + float3x3 TBNMatrix; + Blackboard blackboard; + }; + + struct VertexData + { + #if SHADER_TARGET > 30 + // uint vertexID : SV_VertexID; + #endif + float4 vertex : POSITION; + float3 normal : NORMAL; + float4 tangent : TANGENT; + float4 texcoord0 : TEXCOORD0; + + // optimize out mesh coords when not in use by user or lighting system + #if _URP && (_USINGTEXCOORD1 || _PASSMETA || _PASSFORWARD || _PASSGBUFFER) + float4 texcoord1 : TEXCOORD1; + #endif + + #if _URP && (_USINGTEXCOORD2 || _PASSMETA || ((_PASSFORWARD || _PASSGBUFFER) && defined(DYNAMICLIGHTMAP_ON))) + float4 texcoord2 : TEXCOORD2; + #endif + + #if _STANDARD && (_USINGTEXCOORD1 || (_PASSMETA || ((_PASSFORWARD || _PASSGBUFFER || _PASSFORWARDADD) && LIGHTMAP_ON))) + float4 texcoord1 : TEXCOORD1; + #endif + #if _STANDARD && (_USINGTEXCOORD2 || (_PASSMETA || ((_PASSFORWARD || _PASSGBUFFER) && DYNAMICLIGHTMAP_ON))) + float4 texcoord2 : TEXCOORD2; + #endif + + + #if _HDRP + float4 texcoord1 : TEXCOORD1; + float4 texcoord2 : TEXCOORD2; + #endif + + // #if %TEXCOORD3REQUIREKEY% + float4 texcoord3 : TEXCOORD3; + // #endif + + // #if %VERTEXCOLORREQUIREKEY% + float4 vertexColor : COLOR; + // #endif + + #if _PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR)) + float3 previousPositionOS : TEXCOORD4; // Contain previous transform position (in case of skinning for example) + #if defined (_ADD_PRECOMPUTED_VELOCITY) + float3 precomputedVelocity : TEXCOORD5; // Add Precomputed Velocity (Alembic computes velocities on runtime side). + #endif + #endif + + UNITY_VERTEX_INPUT_INSTANCE_ID + }; + + struct TessVertex + { + float4 vertex : INTERNALTESSPOS; + float3 normal : NORMAL; + float4 tangent : TANGENT; + float4 texcoord0 : TEXCOORD0; + float4 texcoord1 : TEXCOORD1; + float4 texcoord2 : TEXCOORD2; + + // #if %TEXCOORD3REQUIREKEY% + float4 texcoord3 : TEXCOORD3; + // #endif + + // #if %VERTEXCOLORREQUIREKEY% + float4 vertexColor : COLOR; + // #endif + + // #if %EXTRAV2F0REQUIREKEY% + // float4 extraV2F0 : TEXCOORD5; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // float4 extraV2F1 : TEXCOORD6; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // float4 extraV2F2 : TEXCOORD7; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // float4 extraV2F3 : TEXCOORD8; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // float4 extraV2F4 : TEXCOORD9; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // float4 extraV2F5 : TEXCOORD10; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // float4 extraV2F6 : TEXCOORD11; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // float4 extraV2F7 : TEXCOORD12; + // #endif + + #if _PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR)) + float3 previousPositionOS : TEXCOORD13; // Contain previous transform position (in case of skinning for example) + #if defined (_ADD_PRECOMPUTED_VELOCITY) + float3 precomputedVelocity : TEXCOORD14; + #endif + #endif + + UNITY_VERTEX_INPUT_INSTANCE_ID + UNITY_VERTEX_OUTPUT_STEREO + }; + + struct ExtraV2F + { + float4 extraV2F0; + float4 extraV2F1; + float4 extraV2F2; + float4 extraV2F3; + float4 extraV2F4; + float4 extraV2F5; + float4 extraV2F6; + float4 extraV2F7; + Blackboard blackboard; + float4 time; + }; + + + float3 WorldToTangentSpace(ShaderData d, float3 normal) + { + return mul(d.TBNMatrix, normal); + } + + float3 TangentToWorldSpace(ShaderData d, float3 normal) + { + return mul(normal, d.TBNMatrix); + } + + // in this case, make standard more like SRPs, because we can't fix + // unity_WorldToObject in HDRP, since it already does macro-fu there + + #if _STANDARD + float3 TransformWorldToObject(float3 p) { return mul(unity_WorldToObject, float4(p, 1)); }; + float3 TransformObjectToWorld(float3 p) { return mul(unity_ObjectToWorld, float4(p, 1)); }; + float4 TransformWorldToObject(float4 p) { return mul(unity_WorldToObject, p); }; + float4 TransformObjectToWorld(float4 p) { return mul(unity_ObjectToWorld, p); }; + float4x4 GetWorldToObjectMatrix() { return unity_WorldToObject; } + float4x4 GetObjectToWorldMatrix() { return unity_ObjectToWorld; } + #if (defined(SHADER_API_D3D11) || defined(SHADER_API_XBOXONE) || defined(UNITY_COMPILER_HLSLCC) || defined(SHADER_API_PSSL) || (SHADER_TARGET_SURFACE_ANALYSIS && !SHADER_TARGET_SURFACE_ANALYSIS_MOJOSHADER)) + #define UNITY_SAMPLE_TEX2D_LOD(tex,coord, lod) tex.SampleLevel (sampler##tex,coord, lod) + #define UNITY_SAMPLE_TEX2D_SAMPLER_LOD(tex,samplertex,coord, lod) tex.SampleLevel (sampler##samplertex,coord, lod) + #else + #define UNITY_SAMPLE_TEX2D_LOD(tex,coord,lod) tex2D (tex,coord,0,lod) + #define UNITY_SAMPLE_TEX2D_SAMPLER_LOD(tex,samplertex,coord,lod) tex2D (tex,coord,0,lod) + #endif + + #undef GetWorldToObjectMatrix() + + #define GetWorldToObjectMatrix() unity_WorldToObject + + + #endif + + float3 GetCameraWorldPosition() + { + #if _HDRP + return GetCameraRelativePositionWS(_WorldSpaceCameraPos); + #else + return _WorldSpaceCameraPos; + #endif + } + + #if _GRABPASSUSED + #if _STANDARD + TEXTURE2D(%GRABTEXTURE%); + SAMPLER(sampler_%GRABTEXTURE%); + #endif + + half3 GetSceneColor(float2 uv) + { + #if _STANDARD + return SAMPLE_TEXTURE2D(%GRABTEXTURE%, sampler_%GRABTEXTURE%, uv).rgb; + #else + return SHADERGRAPH_SAMPLE_SCENE_COLOR(uv); + #endif + } + #endif + + + + #if _STANDARD + UNITY_DECLARE_DEPTH_TEXTURE(_CameraDepthTexture); + float GetSceneDepth(float2 uv) { return SAMPLE_DEPTH_TEXTURE(_CameraDepthTexture, uv); } + float GetLinear01Depth(float2 uv) { return Linear01Depth(GetSceneDepth(uv)); } + float GetLinearEyeDepth(float2 uv) { return LinearEyeDepth(GetSceneDepth(uv)); } + #else + float GetSceneDepth(float2 uv) { return SHADERGRAPH_SAMPLE_SCENE_DEPTH(uv); } + float GetLinear01Depth(float2 uv) { return Linear01Depth(GetSceneDepth(uv), _ZBufferParams); } + float GetLinearEyeDepth(float2 uv) { return LinearEyeDepth(GetSceneDepth(uv), _ZBufferParams); } + #endif + + float3 GetWorldPositionFromDepthBuffer(float2 uv, float3 worldSpaceViewDir) + { + float eye = GetLinearEyeDepth(uv); + float3 camView = mul((float3x3)GetObjectToWorldMatrix(), transpose(mul(GetWorldToObjectMatrix(), UNITY_MATRIX_I_V)) [2].xyz); + + float dt = dot(worldSpaceViewDir, camView); + float3 div = worldSpaceViewDir/dt; + float3 wpos = (eye * div) + GetCameraWorldPosition(); + return wpos; + } + + #if _HDRP + float3 ObjectToWorldSpacePosition(float3 pos) + { + return GetAbsolutePositionWS(TransformObjectToWorld(pos)); + } + #else + float3 ObjectToWorldSpacePosition(float3 pos) + { + return TransformObjectToWorld(pos); + } + #endif + + #if _STANDARD + UNITY_DECLARE_SCREENSPACE_TEXTURE(_CameraDepthNormalsTexture); + float3 GetSceneNormal(float2 uv, float3 worldSpaceViewDir) + { + float4 depthNorms = UNITY_SAMPLE_SCREENSPACE_TEXTURE(_CameraDepthNormalsTexture, uv); + float3 norms = DecodeViewNormalStereo(depthNorms); + norms = mul((float3x3)GetWorldToViewMatrix(), norms) * 0.5 + 0.5; + return norms; + } + #elif _HDRP && !_DECALSHADER + + float3 GetSceneNormal(float2 uv, float3 worldSpaceViewDir) + { + NormalData nd; + DecodeFromNormalBuffer(_ScreenSize.xy * uv, nd); + return nd.normalWS; + } + #elif _URP + #if (SHADER_LIBRARY_VERSION_MAJOR >= 10) + #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/DeclareNormalsTexture.hlsl" + #endif + + float3 GetSceneNormal(float2 uv, float3 worldSpaceViewDir) + { + #if (SHADER_LIBRARY_VERSION_MAJOR >= 10) + return SampleSceneNormals(uv); + #else + float3 wpos = GetWorldPositionFromDepthBuffer(uv, worldSpaceViewDir); + return normalize(-cross(ddx(wpos), ddy(wpos))) * 0.5 + 0.5; + #endif + + } + #endif + + #if _HDRP + + half3 UnpackNormalmapRGorAG(half4 packednormal) + { + // This do the trick + packednormal.x *= packednormal.w; + + half3 normal; + normal.xy = packednormal.xy * 2 - 1; + normal.z = sqrt(1 - saturate(dot(normal.xy, normal.xy))); + return normal; + } + half3 UnpackNormal(half4 packednormal) + { + #if defined(UNITY_NO_DXT5nm) + return packednormal.xyz * 2 - 1; + #else + return UnpackNormalmapRGorAG(packednormal); + #endif + } + #endif + #if _HDRP || _URP + + half3 UnpackScaleNormal(half4 packednormal, half scale) + { + #ifndef UNITY_NO_DXT5nm + // Unpack normal as DXT5nm (1, y, 1, x) or BC5 (x, y, 0, 1) + // Note neutral texture like "bump" is (0, 0, 1, 1) to work with both plain RGB normal and DXT5nm/BC5 + packednormal.x *= packednormal.w; + #endif + half3 normal; + normal.xy = (packednormal.xy * 2 - 1) * scale; + normal.z = sqrt(1 - saturate(dot(normal.xy, normal.xy))); + return normal; + } + + #endif + + + void GetSun(out float3 lightDir, out float3 color) + { + lightDir = float3(0.5, 0.5, 0); + color = 1; + #if _HDRP + if (_DirectionalLightCount > 0) + { + DirectionalLightData light = _DirectionalLightDatas[0]; + lightDir = -light.forward.xyz; + color = light.color; + } + #elif _STANDARD + lightDir = normalize(_WorldSpaceLightPos0.xyz); + color = _LightColor0.rgb; + #elif _URP + Light light = GetMainLight(); + lightDir = light.direction; + color = light.color; + #endif + } + + + + CBUFFER_START(UnityPerMaterial) + + + half4 _Color; + half4 _MainTex_ST, _MainTex_TexelSize; + half _Alpha, _AlphaCutoffValue; + + #if ATLAS_ON + half _MinXUV, _MaxXUV, _MinYUV, _MaxYUV; + #endif + + #if GLOW_ON + half4 _GlowColor; + half _Glow, _GlowGlobal; + #endif + + #if HSV_ON + half _HsvShift, _HsvSaturation, _HsvBright; + #endif + + #if DISTORT_ON + half4 _DistortTex_ST; + half _DistortTexXSpeed, _DistortTexYSpeed, _DistortAmount; + #endif + + #if FADE_ON + half4 _FadeBurnColor, _FadeTex_ST, _FadeBurnTex_ST; + half _FadeAmount, _FadeBurnWidth, _FadeBurnTransition,_FadeBurnGlow; + #endif + + #if OUTBASE_ON + half4 _OutlineColor; + half _OutlineAlpha, _OutlineGlow, _OutlineWidth; + int _OutlinePixelWidth; + #endif + + #if OUTTEX_ON + half4 _OutlineTex_ST; + half _OutlineTexXSpeed, _OutlineTexYSpeed; + #endif + + #if OUTDIST_ON + half4 _OutlineDistortTex_ST; + half _OutlineDistortTexXSpeed, _OutlineDistortTexYSpeed, _OutlineDistortAmount; + #endif + + #if ALPHAOUTLINE_ON + half _AlphaOutlineGlow, _AlphaOutlinePower, _AlphaOutlineMinAlpha, _AlphaOutlineBlend; + half4 _AlphaOutlineColor; + #endif + + #if INNEROUTLINE_ON + half _InnerOutlineThickness, _InnerOutlineAlpha, _InnerOutlineGlow; + half4 _InnerOutlineColor; + #endif + + #if GRADIENT_ON + half _GradBlend, _GradBoostX, _GradBoostY; + half4 _GradTopRightCol, _GradTopLeftCol, _GradBotRightCol, _GradBotLeftCol; + #endif + + #if COLORSWAP_ON + half4 _ColorSwapRed, _ColorSwapGreen, _ColorSwapBlue; + half _ColorSwapRedLuminosity, _ColorSwapGreenLuminosity, _ColorSwapBlueLuminosity, _ColorSwapBlend; + #endif + + #if CHANGECOLOR_ON + half4 _ColorChangeNewCol, _ColorChangeTarget; + half _ColorChangeTolerance, _ColorChangeLuminosity; + #endif + #if CHANGECOLOR2_ON + half4 _ColorChangeNewCol2, _ColorChangeTarget2; + half _ColorChangeTolerance2; + #endif + #if CHANGECOLOR3_ON + half4 _ColorChangeNewCol3, _ColorChangeTarget3; + half _ColorChangeTolerance3; + #endif + + #if COLORRAMP_ON + half _ColorRampLuminosity, _ColorRampBlend; + #endif + + #if HITEFFECT_ON + half4 _HitEffectColor; + half _HitEffectGlow, _HitEffectBlend; + #endif + + #if NEGATIVE_ON + half _NegativeAmount; + #endif + + #if PIXELATE_ON + half _PixelateSize; + #endif + + #if GREYSCALE_ON + half _GreyscaleLuminosity, _GreyscaleBlend; + half4 _GreyscaleTintColor; + #endif + + #if POSTERIZE_ON + half _PosterizeNumColors, _PosterizeGamma; + #endif + + #if BLUR_ON + half _BlurIntensity; + #endif + + #if MOTIONBLUR_ON + half _MotionBlurAngle, _MotionBlurDist; + #endif + + #if GHOST_ON + half _GhostColorBoost, _GhostTransparency, _GhostBlend; + #endif + + #if HOLOGRAM_ON + half _HologramStripesAmount, _HologramMinAlpha, _HologramUnmodAmount, _HologramStripesSpeed, _HologramMaxAlpha, _HologramBlend; + half4 _HologramStripeColor; + #endif + + #if CHROMABERR_ON + half _ChromAberrAmount, _ChromAberrAlpha; + #endif + + #if GLITCH_ON + half _GlitchAmount, _GlitchSize; + #endif + + #if FLICKER_ON + half _FlickerFreq, _FlickerPercent, _FlickerAlpha; + #endif + + #if SHADOW_ON + half _ShadowX, _ShadowY, _ShadowAlpha; + half4 _ShadowColor; + #endif + + #if SHINE_ON + half4 _ShineColor; + half _ShineLocation, _ShineRotate, _ShineWidth, _ShineGlow; + #endif + + #if CONTRAST_ON + half _Contrast, _Brightness; + #endif + + #if OVERLAY_ON + half4 _OverlayTex_ST, _OverlayColor; + half _OverlayGlow, _OverlayBlend, _OverlayTextureScrollXSpeed, _OverlayTextureScrollYSpeed; + #endif + + #if DOODLE_ON + half _HandDrawnAmount, _HandDrawnSpeed; + #endif + + #if WIND_ON + half _GrassSpeed, _GrassWind, _GrassManualAnim, _GrassRadialBend; + #endif + + #if WAVEUV_ON + float _WaveAmount, _WaveSpeed, _WaveStrength, _WaveX, _WaveY; + #endif + + #if ROUNDWAVEUV_ON + half _RoundWaveStrength, _RoundWaveSpeed; + #endif + + #if RECTSIZE_ON + half _RectSize; + #endif + + #if OFFSETUV_ON + half _OffsetUvX, _OffsetUvY; + #endif + + #if CLIPPING_ON + half _ClipUvLeft, _ClipUvRight, _ClipUvUp, _ClipUvDown; + #endif + + #if RADIALCLIPPING_ON + half _RadialStartAngle, _RadialClip, _RadialClip2; + #endif + + #if TEXTURESCROLL_ON + half _TextureScrollXSpeed, _TextureScrollYSpeed; + #endif + + #if ZOOMUV_ON + half _ZoomUvAmount; + #endif + + #if WARP_ON + half _WarpStrength, _WarpSpeed, _WarpScale; + #endif + + #if TWISTUV_ON + half _TwistUvAmount, _TwistUvPosX, _TwistUvPosY, _TwistUvRadius; + #endif + + #if ROTATEUV_ON + half _RotateUvAmount; + #endif + + #if FISHEYE_ON + half _FishEyeUvAmount; + #endif + + #if PINCH_ON + half _PinchUvAmount; + #endif + + #if SHAKEUV_ON + half _ShakeUvSpeed, _ShakeUvX, _ShakeUvY; + #endif + + #if NORMALMAP_ON + half _NormalStrength; + #endif + + float _RandomSeed; + + + + + CBUFFER_END + + + + + + + + TEXTURE2D(_MainTex); + SAMPLER(sampler_MainTex); + + #if GLOW_ON + TEXTURE2D(_GlowTex); + SAMPLER(sampler_GlowTex); + #endif + + #if FADE_ON + TEXTURE2D(_FadeTex); + SAMPLER(sampler_FadeTex); + + TEXTURE2D(_FadeBurnTex); + SAMPLER(sampler_FadeBurnTex); + #endif + + #if DISTORT_ON + TEXTURE2D(_DistortTex); + SAMPLER(sampler_DistortTex); + #endif + + #if OUTTEX_ON + TEXTURE2D(_OutlineTex); + SAMPLER(sampler_OutlineTex); + #endif + + #if OUTDIST_ON + TEXTURE2D(_OutlineDistortTex); + SAMPLER(sampler_OutlineDistortTex); + #endif + + #if COLORSWAP_ON + TEXTURE2D(_ColorSwapTex); + SAMPLER(sampler_ColorSwapTex); + #endif + + #if COLORRAMP_ON + TEXTURE2D(_ColorRampTex); + TEXTURE2D(_ColorRampTexGradient); + SAMPLER(sampler_ColorRampTex); + SAMPLER(sampler_ColorRampTexGradient); + #endif + + #if SHINE_ON + TEXTURE2D(_ShineMask); + SAMPLER(sampler_ShineMask); + #endif + + #if OVERLAY_ON + TEXTURE2D(_OverlayTex); + SAMPLER(sampler_OverlayTex); + #endif + + #if NORMALMAP_ON + TEXTURE2D(_NormalMap); + SAMPLER(sampler_NormalMap); + #endif + + + half3 GetPixel(in int offsetX, in int offsetY, in half2 uv, in Texture2D _tex, in SamplerState _sampler) + { + half2 _uv = uv + half2(offsetX * _MainTex_TexelSize.x, offsetY * _MainTex_TexelSize.y); + half4 col = SAMPLE_TEXTURE2D(_tex, _sampler, _uv); + return col.rgb; + } + + + //BLURS------------------------------------------------------------------------- + half4 Blur(half2 uv, Texture2D source, SamplerState sampler_source, half Intensity) + { + const half2 texelSize = 1.0 / _ScreenParams.xy; + const half4 color = SAMPLE_TEXTURE2D(source, sampler_source, uv); + const half2 offset = Intensity * texelSize; + + half4 accumulatedColor = color; + half accumulatedWeight = 1.0; + for (int x = -1; x <= 1; x++) + { + for (int y = -1; y <= 1; y++) + { + const half2 sampleUV = uv + half2(x, y) * offset; + const half4 sampleColor = SAMPLE_TEXTURE2D(source, sampler_source, sampleUV); + + accumulatedColor += sampleColor; + accumulatedWeight += 1.0; + } + } + + half4 blurredColor = accumulatedColor / accumulatedWeight; + return blurredColor; + } + + half BlurHD_G(half bhqp, half x) + { + return exp(-(x * x) / (2.0 * bhqp * bhqp)); + } + half4 BlurHD(half2 uv, Texture2D source, SamplerState sampler_source, half BlurAmount, half xScale, half yScale) + { + int iterations = 16; + int halfIterations = iterations / 2; + half sigmaX = 0.1 + BlurAmount * 0.5; + half sigmaY = sigmaX; + half total = 0.0; + half4 ret = half4(0, 0, 0, 0); + for (int iy = 0; iy < iterations; ++iy) + { + half fy = BlurHD_G(sigmaY, half(iy) -half(halfIterations)); + half offsetY = half(iy - halfIterations) * 0.00390625 * xScale; + for (int ix = 0; ix < iterations; ++ix) + { + half fx = BlurHD_G(sigmaX, half(ix) - half(halfIterations)); + half offsetX = half(ix - halfIterations) * 0.00390625 * yScale; + total += fx * fy; + ret += SAMPLE_TEXTURE2D(source, sampler_source, uv + half2(offsetX, offsetY)) * fx * fy; + } + } + return ret / total; + } + //----------------------------------------------------------------------- + + + //------------------------------------------- + half RemapFloat(half inValue, half inMin, half inMax, half outMin, half outMax){ + return outMin + (inValue - inMin) * (outMax - outMin) / (inMax - inMin); + } + //------------------------------------------- + + //----------------------------------------------------------------------- + half rand(half2 seed, half offset) { + return (frac(sin(dot(seed, half2(12.9898, 78.233))) * 43758.5453) + offset) % 1.0; + } + + half rand2(half2 seed, half offset) { + return (frac(sin(dot(seed * floor(50 + (_Time.x % 1.0) * 12.), half2(127.1, 311.7))) * 43758.5453123) + offset) % 1.0; + } + + half rand2CustomTime(half2 seed, half offset, half customTime) { + return (frac(sin(dot(seed * floor(50 + (customTime % 1.0) * 12.), half2(127.1, 311.7))) * 43758.5453123) + offset) % 1.0; + } + //----------------------------------------------------------------------- + + + void Ext_ModifyVertex0 (inout VertexData v, inout ExtraV2F d) + { + //BILBOARD_ON + #if BILBOARD_ON + half3 camRight = mul((half3x3)unity_CameraToWorld, half3(1,0,0)); + half3 camUp = half3(0,1,0); + #if BILBOARDY_ON + camUp = mul((half3x3)unity_CameraToWorld, half3(0,1,0)); + #endif + half3 localPos = v.vertex.x * camRight + v.vertex.y * camUp; + v.vertex = half4(localPos, 1); + #endif + //----------------------------------------------------------- + + v.texcoord0.xy = TRANSFORM_TEX(v.texcoord0.xy, _MainTex); + half2 center = half2(0.5, 0.5); + #if ATLAS_ON + center = half2((_MaxXUV + _MinXUV) / 2.0, (_MaxYUV + _MinYUV) / 2.0); + #endif + + //POLARUV_ON + #if POLARUV_ON + v.texcoord0.xy = v.texcoord0.xy - center; + #endif + + //---------------------------------------- + + //ROTATEUV_ON + #if ROTATEUV_ON + half2 uvC = v.texcoord0.xy; + half cosAngle = cos(_RotateUvAmount); + half sinAngle = sin(_RotateUvAmount); + half2x2 rot = half2x2(cosAngle, -sinAngle, sinAngle, cosAngle); + uvC -= center; + v.texcoord0.xy = mul(rot, uvC); + v.texcoord0.xy += center; + #endif + //-------------------- + + #if RECTSIZE_ON + v.vertex.xyz += (v.vertex.xyz * (_RectSize - 1.0)); + #endif + + #if OUTTEX_ON + v.texcoord1.xy = TRANSFORM_TEX(v.texcoord0.xy, _OutlineTex); + #endif + + #if OUTDIST_ON + v.texcoord2.xy = TRANSFORM_TEX(v.texcoord0.xy, _OutlineDistortTex); + #endif + + #if DISTORT_ON + v.texcoord3.xy = TRANSFORM_TEX(v.texcoord0.xy, _DistortTex); + #endif + } + + void Ext_SurfaceFunction0 (inout Surface o, ShaderData d) + { + half randomSeed = _RandomSeed; + + float2 uvRect = d.texcoord0; + half2 center = half2(0.5, 0.5); + #if ATLAS_ON + center = half2((_MaxXUV + _MinXUV) / 2.0, (_MaxYUV + _MinYUV) / 2.0); + uvRect = half2((d.texcoord0.x - _MinXUV) / (_MaxXUV - _MinXUV), (d.texcoord0.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half2 centerTiled = half2(center.x * _MainTex_ST.x, center.y * _MainTex_ST.y); + + //CLIPPING_ON + #if CLIPPING_ON + half2 tiledUv = half2(d.texcoord0.x / _MainTex_ST.x, d.texcoord0.y / _MainTex_ST.y); + #if ATLAS_ON + tiledUv = half2((tiledUv.x - _MinXUV) / (_MaxXUV - _MinXUV), (tiledUv.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + clip((1 - _ClipUvUp) - tiledUv.y); + clip(tiledUv.y - _ClipUvDown); + clip((1 - _ClipUvRight) - tiledUv.x); + clip(tiledUv.x - _ClipUvLeft); + #endif + //---------------------------------- + + //RADIALCLIPPING_ON + #if RADIALCLIPPING_ON + half2 tiledUv2 = half2(d.texcoord0.x / _MainTex_ST.x, d.texcoord0.y / _MainTex_ST.y); + #if ATLAS_ON + tiledUv2 = half2((tiledUv2.x - _MinXUV) / (_MaxXUV - _MinXUV), (tiledUv2.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half startAngle = _RadialStartAngle - _RadialClip; + half endAngle = _RadialStartAngle + _RadialClip2; + half offset0 = clamp(0, 360, startAngle + 360); + half offset360 = clamp(0, 360, endAngle - 360); + half2 atan2Coord = half2(lerp(-1, 1, tiledUv2.x), lerp(-1, 1, tiledUv2.y)); + half atanAngle = atan2(atan2Coord.y, atan2Coord.x) * 57.3; // angle in degrees + if(atanAngle < 0) atanAngle = 360 + atanAngle; + if(atanAngle >= startAngle && atanAngle <= endAngle) discard; + if(atanAngle <= offset360) discard; + if(atanAngle >= offset0) discard; + #endif + + //----------------------------- + + //TEXTURESCROLL_ON && ATLAS_ON + #if TEXTURESCROLL_ON && ATLAS_ON + d.texcoord0.xy = half2(_MinXUV + ((_MaxXUV - _MinXUV) * (abs(((_Time.y + randomSeed) * _TextureScrollXSpeed) + uvRect.x) % 1)), + _MinYUV + ((_MaxYUV - _MinYUV) * (abs(((_Time.y + randomSeed) * _TextureScrollYSpeed) + uvRect.y) % 1))); + #endif + //---------------------------- + + //OFFSETUV_ON + #if OFFSETUV_ON + #if ATLAS_ON + d.texcoord0.xy = half2(_MinXUV + ((_MaxXUV - _MinXUV) * (abs((_OffsetUvX + uvRect.x) % 1))), + _MinYUV + ((_MaxYUV - _MinYUV) * (abs(_OffsetUvY + uvRect.y) % 1))); + #else + d.texcoord0.xy += half2(_OffsetUvX, _OffsetUvY); + #endif + #endif + + //---------------------- + + //POLARUV_ON + #if POLARUV_ON + d.texcoord0.xy = half2(atan2(d.texcoord0.y, d.texcoord0.x) / (2.0f * 3.141592653589f), length(d.texcoord0.xy)); + d.texcoord0.xy *= _MainTex_ST.xy; + #endif + + //-------------------------------------- + + //TWISTUV_ON + #if TWISTUV_ON + #if ATLAS_ON + _TwistUvPosX = ((_MaxXUV - _MinXUV) * _TwistUvPosX) + _MinXUV; + _TwistUvPosY = ((_MaxYUV - _MinYUV) * _TwistUvPosY) + _MinYUV; + #endif + half2 tempUv = d.texcoord0.xy - half2(_TwistUvPosX * _MainTex_ST.x, _TwistUvPosY * _MainTex_ST.y); + _TwistUvRadius *= (_MainTex_ST.x + _MainTex_ST.y) / 2; + half percent = (_TwistUvRadius - length(tempUv)) / _TwistUvRadius; + half theta = percent * percent * (2.0 * sin(_TwistUvAmount)) * 8.0; + half s = sin(theta); + half c = cos(theta); + half beta = max(sign(_TwistUvRadius - length(tempUv)), 0.0); + tempUv = half2(dot(tempUv, half2(c, -s)), dot(tempUv, half2(s, c))) * beta + tempUv * (1 - beta); + tempUv += half2(_TwistUvPosX * _MainTex_ST.x, _TwistUvPosY * _MainTex_ST.y); + d.texcoord0.xy = tempUv; + #endif + + //-------------------------------------------- + + //FISHEYE_ON + #if FISHEYE_ON + half bind = length(centerTiled); + half2 dF = d.texcoord0.xy - centerTiled; + half dFlen = length(dF); + half fishInt = (3.14159265359 / bind) * (_FishEyeUvAmount + 0.001); + d.texcoord0.xy = centerTiled + (dF / (max(0.0001, dFlen))) * tan(dFlen * fishInt) * bind / tan(bind * fishInt); + #endif + //--------------------------------------------- + + //PINCH_ON + #if PINCH_ON + half2 dP = d.texcoord0.xy - centerTiled; + half pinchInt = (3.141592 / length(centerTiled)) * (-_PinchUvAmount + 0.001); + d.texcoord0.xy = centerTiled + normalize(dP) * atan(length(dP) * -pinchInt * 10.0) * 0.5 / atan(-pinchInt * 5); + #endif + + //--------------------------------------------- + + //ZOOMUV_ON + #if ZOOMUV_ON + d.texcoord0.xy -= centerTiled; + d.texcoord0.xy = d.texcoord0.xy * _ZoomUvAmount; + d.texcoord0.xy += centerTiled; + #endif + + //----------------------------------------------- + + //DOODLE_ON + #if DOODLE_ON + half2 uvCopy = uvRect; + _HandDrawnSpeed = (floor((_Time.x + randomSeed) * 20 * _HandDrawnSpeed) / _HandDrawnSpeed) * _HandDrawnSpeed; + uvCopy.x = sin((uvCopy.x * _HandDrawnAmount + _HandDrawnSpeed) * 4); + uvCopy.y = cos((uvCopy.y * _HandDrawnAmount + _HandDrawnSpeed) * 4); + d.texcoord0.xy = lerp(d.texcoord0.xy, d.texcoord0.xy + uvCopy, 0.0005 * _HandDrawnAmount); + #endif + + //-------------------------- + + //SHAKEUV_ON + #if SHAKEUV_ON + half xShake = sin((_Time.x + randomSeed) * _ShakeUvSpeed * 50) * _ShakeUvX; + half yShake = cos((_Time.x + randomSeed) * _ShakeUvSpeed * 50) * _ShakeUvY; + d.texcoord0.xy += half2(xShake * 0.012, yShake * 0.01); + #endif + + //------------------------------------------- + + //RECTSIZE_ON + #if RECTSIZE_ON + d.texcoord0.xy = d.texcoord0.xy * (_RectSize).xx + (((-_RectSize * 0.5) + 0.5)).xx; + #endif + + //------------------------------------------- + + //DISTORT_ON + #if DISTORT_ON + #if ATLAS_ON + d.texcoord3.x = d.texcoord3.x * (1 / (_MaxXUV - _MinXUV)); + d.texcoord3.y = d.texcoord3.y * (1 / (_MaxYUV - _MinYUV)); + #endif + + d.texcoord3.x += ((_Time.x + _RandomSeed) * _DistortTexXSpeed) % 1; + d.texcoord3.y += ((_Time.x + _RandomSeed) * _DistortTexYSpeed) % 1; + half distortAmnt = (SAMPLE_TEXTURE2D(_DistortTex, sampler_DistortTex, d.texcoord3.xy).r - 0.5) * 0.2 * _DistortAmount; + d.texcoord0.x += distortAmnt; + d.texcoord0.y += distortAmnt; + #endif + //------------------------------------------------------- + + //WARP_ON + #if WARP_ON + half2 warpUv = half2(d.texcoord0.x / _MainTex_ST.x, d.texcoord0.y / _MainTex_ST.y); + #if ATLAS_ON + warpUv = half2((warpUv.x - _MinXUV) / (_MaxXUV - _MinXUV), (warpUv.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + const float tau = 6.283185307179586; + float xWarp = (_Time.y + randomSeed) * _WarpSpeed + warpUv.x * tau / _WarpScale; + float yWarp = (_Time.y + randomSeed) * _WarpSpeed + warpUv.y * tau / _WarpScale; + float2 warp = float2(sin(xWarp), sin(yWarp)) * _WarpStrength; + d.texcoord0.xy += warp; + #endif + + //------------------------------------------------------- + + //WAVEUV_ON + #if WAVEUV_ON + float2 uvWave = half2(_WaveX * _MainTex_ST.x, _WaveY * _MainTex_ST.y) - d.texcoord0.xy; + uvWave %= 1; + #if ATLAS_ON + uvWave = half2(_WaveX, _WaveY) - uvRect; + #endif + uvWave.x *= _ScreenParams.x / _ScreenParams.y; + float waveTime = _Time.y + randomSeed; + float angWave = (sqrt(dot(uvWave, uvWave)) * _WaveAmount) - ((waveTime * _WaveSpeed)); + d.texcoord0.xy = d.texcoord0.xy + uvWave * sin(angWave) * (_WaveStrength / 1000.0); + #endif + //---------------------------------------------------- + + //ROUNDWAVEUV_ON + #if ROUNDWAVEUV_ON + half xWave = ((0.5 * _MainTex_ST.x) - uvRect.x); + half yWave = ((0.5 * _MainTex_ST.y) - uvRect.y) * (_MainTex_TexelSize.w / _MainTex_TexelSize.z); + half ripple = -sqrt(xWave*xWave + yWave* yWave); + d.texcoord0.xy += (sin((ripple + (_Time.y + randomSeed) * (_RoundWaveSpeed/10.0)) / 0.015) * (_RoundWaveStrength/10.0)) % 1; + #endif + //---------------------------------------------------- + + + //WIND_ON + #if WIND_ON + half windOffset = sin((_Time.x + randomSeed) * _GrassSpeed * 10); + half2 windCenter = half2(0.5, 0.1); + #if ATLAS_ON + windCenter.x = ((_MaxXUV - _MinXUV) * windCenter.x) + _MinXUV; + windCenter.y = ((_MaxYUV - _MinYUV) * windCenter.y) + _MinYUV; + #endif + #if !MANUALWIND_ON + d.texcoord0.x = fmod(abs(lerp(d.texcoord0.x, d.texcoord0.x + (_GrassWind * 0.01 * windOffset), uvRect.y)), 1); + #else + d.texcoord0.x = fmod(abs(lerp(d.texcoord0.x, d.texcoord0.x + (_GrassWind * 0.01 * _GrassManualAnim), uvRect.y)), 1); + windOffset = _GrassManualAnim; + #endif + half2 delta = d.texcoord0.xy - windCenter; + half delta2 = dot(delta.xy, delta.xy); + half2 delta_offset = delta2 * windOffset; + d.texcoord0.xy = d.texcoord0.xy + half2(delta.y, -delta.x) * delta_offset * _GrassRadialBend; + #endif + + //-------------------------------------------------------- + + //TEXTURESCROLL_ON && !ATLAS_ON + #if TEXTURESCROLL_ON && !ATLAS_ON + d.texcoord0.x += ((_Time.y + randomSeed) * _TextureScrollXSpeed) % 1; + d.texcoord0.y += ((_Time.y + randomSeed) * _TextureScrollYSpeed) % 1; + #endif + //------------------------------ + + //PIXELATE_ON + #if PIXELATE_ON + half aspectRatio = _MainTex_TexelSize.x / _MainTex_TexelSize.y; + half2 pixelSize = float2(_PixelateSize, _PixelateSize * aspectRatio); + d.texcoord0.xy = floor(d.texcoord0.xy * pixelSize) / pixelSize; + #endif + //-------------- + + half4 col = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy); + half originalAlpha = col.a; + col *= d.vertexColor; + + //NORMAL MAP + #if NORMALMAP_ON + half4 normalSample = SAMPLE_TEXTURE2D(_NormalMap, sampler_NormalMap, d.texcoord0.xy); + half3 normalTS = UnpackNormal(normalSample); + normalTS.xy *= _NormalStrength; + o.Normal = normalTS; + #endif + + + //GLITCH_ON + #if GLITCH_ON + half2 uvGlitch = uvRect; + uvGlitch.y -= 0.5; + half lineNoise = pow(rand2(floor(uvGlitch * half2(24., 19.) * _GlitchSize) * 4.0, randomSeed), 3.0) * _GlitchAmount + * pow(rand2(floor(uvGlitch * half2(38., 14.) * _GlitchSize) * 4.0, randomSeed), 3.0); + col = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(lineNoise * 0.02 * rand2(half2(2.0, 1), randomSeed), 0)) * d.vertexColor; + #endif + //-------------------------------------- + + //CHROMABERR_ON + #if CHROMABERR_ON + half4 r = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(_ChromAberrAmount/10, 0)) * d.vertexColor; + half4 b = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(-_ChromAberrAmount/10, 0)) * d.vertexColor; + col = half4(r.r * r.a, col.g, b.b * b.a, max(max(r.a, b.a) * _ChromAberrAlpha, col.a)); + #endif + + //-------------------------------- + + //BLUR_ON + #if BLUR_ON + #if ATLAS_ON + #if !BLURISHD_ON + col = BlurHD(d.texcoord0.xy, _MainTex, sampler_MainTex, _BlurIntensity, (_MaxXUV - _MinXUV), (_MaxYUV - _MinYUV)) * d.vertexColor; + #else + col = Blur(d.texcoord0.xy, _MainTex, sampler_MainTex, _BlurIntensity * (_MaxXUV - _MinXUV)) * d.vertexColor; + #endif + #else + #if !BLURISHD_ON + col = BlurHD(d.texcoord0.xy, _MainTex, sampler_MainTex, _BlurIntensity, 1, 1) * d.vertexColor; + #else + col = Blur(d.texcoord0.xy, _MainTex, sampler_MainTex, _BlurIntensity) * d.vertexColor; + #endif + #endif + #endif + + //-------------------- + + //MOTIONBLUR_ON + #if MOTIONBLUR_ON + _MotionBlurAngle = _MotionBlurAngle * 3.1415926; + #define rot(n) mul(n, half2x2(cos(_MotionBlurAngle), -sin(_MotionBlurAngle), sin(_MotionBlurAngle), cos(_MotionBlurAngle))) + _MotionBlurDist = _MotionBlurDist * 0.005; + #if ATLAS_ON + _MotionBlurDist *= (_MaxXUV - _MinXUV); + #endif + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(-_MotionBlurDist, -_MotionBlurDist))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(-_MotionBlurDist * 2, -_MotionBlurDist * 2))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(-_MotionBlurDist * 3, -_MotionBlurDist * 3))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(-_MotionBlurDist * 4, -_MotionBlurDist * 4))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(_MotionBlurDist, _MotionBlurDist))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(_MotionBlurDist * 2, _MotionBlurDist * 2))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(_MotionBlurDist * 3, _MotionBlurDist * 3))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(_MotionBlurDist * 4, _MotionBlurDist * 4))); + col.rgb = col.rgb / 9; + #endif + //------------------------------------ + + //NEGATIVE_ON + #if NEGATIVE_ON + col.rgb = lerp(col.rgb, 1 - col.rgb, _NegativeAmount); + #endif + + //-------------- + half luminance = 0; + + //GREYSCALE_ON && !GREYSCALEOUTLINE_ON + #if GREYSCALE_ON && !GREYSCALEOUTLINE_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + luminance = saturate(luminance + _GreyscaleLuminosity); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _GreyscaleTintColor, _GreyscaleBlend); + #endif + //------------------------------------ + + //GHOST_ON + #if GHOST_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + half4 ghostResult; + ghostResult.a = saturate(luminance - _GhostTransparency) * col.a; + ghostResult.rgb = col.rgb * (luminance + _GhostColorBoost); + col = lerp(col, ghostResult, _GhostBlend); + #endif + //------------------------------------ + + //INNEROUTLINE_ON + #if INNEROUTLINE_ON + half3 innerT = abs(GetPixel(0, _InnerOutlineThickness, d.texcoord0.xy, _MainTex, sampler_MainTex) - GetPixel(0, -_InnerOutlineThickness, d.texcoord0.xy, _MainTex, sampler_MainTex)); + innerT += abs(GetPixel(_InnerOutlineThickness, 0, d.texcoord0.xy, _MainTex, sampler_MainTex) - GetPixel(-_InnerOutlineThickness, 0, d.texcoord0.xy, _MainTex, sampler_MainTex)); + #if !ONLYINNEROUTLINE_ON + innerT = (innerT / 2.0) * col.a * _InnerOutlineAlpha; + col.rgb += length(innerT) * _InnerOutlineColor.rgb * _InnerOutlineGlow; + #else + innerT *= col.a * _InnerOutlineAlpha; + col.rgb = length(innerT) * _InnerOutlineColor.rgb * _InnerOutlineGlow; + col.a = step(0.3, col.r+col.g+col.b); + #endif + #endif + //------------------------------------------------------- + + //HITEFFECT_ON + #if HITEFFECT_ON + col.rgb = lerp(col.rgb, _HitEffectColor.rgb * _HitEffectGlow, _HitEffectBlend); + #endif + //-------------------- + + //GRADIENT_ON + #if GRADIENT_ON + half2 tiledUvGrad = half2(uvRect.x / _MainTex_ST.x, uvRect.y / _MainTex_ST.y); + #if GRADIENT2COL_ON + _GradTopRightCol = _GradTopLeftCol; + _GradBotRightCol = _GradBotLeftCol; + #endif + #if RADIALGRADIENT_ON + half radialDist = 1 - length(tiledUvGrad - half2(0.5, 0.5)); + radialDist *= (_MainTex_TexelSize.w / _MainTex_TexelSize.z); + radialDist = saturate(_GradBoostX * radialDist); + half4 gradientResult = lerp(_GradTopLeftCol, _GradBotLeftCol, radialDist); + #else + half gradXLerpFactor = saturate(pow(tiledUvGrad.x, _GradBoostX)); + half4 gradientResult = lerp(lerp(_GradBotLeftCol, _GradBotRightCol, gradXLerpFactor), + lerp(_GradTopLeftCol, _GradTopRightCol, gradXLerpFactor), saturate(pow(tiledUvGrad.y, _GradBoostY))); + #endif + gradientResult = lerp(col, gradientResult, _GradBlend); + col.rgb = gradientResult.rgb * col.a; + col.a *= gradientResult.a; + #endif + //-------------------------------------------------------------------- + + //CONTRAST_ON + #if CONTRAST_ON + col.rgb = (col.rgb - float3(0.5, 0.5, 0.5)) * _Contrast + float3(0.5, 0.5, 0.5); + col.rgb += _Brightness; + #endif + + //------------------------------------------------------------------- + + //COLORSWAP_ON + #if COLORSWAP_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + half4 swapMask = SAMPLE_TEXTURE2D(_ColorSwapTex, sampler_ColorSwapTex, d.texcoord0.xy); + swapMask.rgb *= swapMask.a; + half3 redSwap = _ColorSwapRed * swapMask.r * saturate(luminance + _ColorSwapRedLuminosity); + half3 greenSwap = _ColorSwapGreen * swapMask.g * saturate(luminance + _ColorSwapGreenLuminosity); + half3 blueSwap = _ColorSwapBlue * swapMask.b * saturate(luminance + _ColorSwapBlueLuminosity); + swapMask.rgb = col.rgb * saturate(1 - swapMask.r - swapMask.g - swapMask.b); + col.rgb = lerp(col.rgb, swapMask.rgb + redSwap + greenSwap + blueSwap, _ColorSwapBlend); + #endif + //-------------------------------------------------------------------- + + //COLORRAMP_ON && !COLORRAMPOUTLINE_ON + #if COLORRAMP_ON && !COLORRAMPOUTLINE_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + luminance = saturate(luminance + _ColorRampLuminosity); + #if GRADIENTCOLORRAMP_ON + col.rgb = lerp(col.rgb, SAMPLE_TEXTURE2D(_ColorRampTexGradient, sampler_ColorRampTexGradient, half2(luminance, 0)).rgb, _ColorRampBlend); + #else + col.rgb = lerp(col.rgb, SAMPLE_TEXTURE2D(_ColorRampTex, sampler_ColorRampTex, half2(luminance, 0)).rgb, _ColorRampBlend); + #endif + #endif + //-------------------------------------------------------------------- + + //CHANGECOLOR_ON + #if CHANGECOLOR_ON + float3 currChangeColor = saturate(col.rgb); + luminance = 0.3 * currChangeColor.r + 0.59 * currChangeColor.g + 0.11 * currChangeColor.b; + luminance = saturate(luminance + _ColorChangeLuminosity); + half3 dif = abs(currChangeColor - _ColorChangeTarget.rgb); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _ColorChangeNewCol.rgb, + max(sign(1 - saturate(dif.x + dif.y + dif.z) - _ColorChangeTolerance), 0.0)); + #if CHANGECOLOR2_ON + dif = abs(currChangeColor - _ColorChangeTarget2.rgb); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _ColorChangeNewCol2.rgb, + max(sign(1 - saturate(dif.x + dif.y + dif.z) - _ColorChangeTolerance2), 0.0)); + #endif + #if CHANGECOLOR3_ON + dif = abs(currChangeColor - _ColorChangeTarget3.rgb); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _ColorChangeNewCol3.rgb, + max(sign(1 - saturate(dif.x + dif.y + dif.z) - _ColorChangeTolerance3), 0.0)); + #endif + #endif + //------------------------------------------------------- + + //POSTERIZE_ON && !POSTERIZEOUTLINE_ON + #if POSTERIZE_ON && !POSTERIZEOUTLINE_ON + col.rgb = pow(col.rgb, _PosterizeGamma) * _PosterizeNumColors; + col.rgb = floor(col.rgb) / _PosterizeNumColors; + col.rgb = pow(col.rgb, 1.0 / _PosterizeGamma); + #endif + //------------------------------------ + + //HSV_ON + #if HSV_ON + half3 resultHsv = half3(col.rgb); + half cosHsv = _HsvBright * _HsvSaturation * cos(_HsvShift * 3.14159265 / 180); + half sinHsv = _HsvBright * _HsvSaturation * sin(_HsvShift * 3.14159265 / 180); + resultHsv.x = (.299 * _HsvBright + .701 * cosHsv + .168 * sinHsv) * col.x + + (.587 * _HsvBright - .587 * cosHsv + .330 * sinHsv) * col.y + + (.114 * _HsvBright - .114 * cosHsv - .497 * sinHsv) * col.z; + resultHsv.y = (.299 * _HsvBright - .299 * cosHsv - .328 * sinHsv) *col.x + + (.587 * _HsvBright + .413 * cosHsv + .035 * sinHsv) * col.y + + (.114 * _HsvBright - .114 * cosHsv + .292 * sinHsv) * col.z; + resultHsv.z = (.299 * _HsvBright - .3 * cosHsv + 1.25 * sinHsv) * col.x + + (.587 * _HsvBright - .588 * cosHsv - 1.05 * sinHsv) * col.y + + (.114 * _HsvBright + .886 * cosHsv - .203 * sinHsv) * col.z; + col.rgb = resultHsv; + #endif + //------------------------------------------------------- + + //OVERLAY_ON + #if OVERLAY_ON + half2 overlayUvs = d.texcoord0.xy; + overlayUvs.x += ((_Time.y + randomSeed) * _OverlayTextureScrollXSpeed) % 1; + overlayUvs.y += ((_Time.y + randomSeed) * _OverlayTextureScrollYSpeed) % 1; + half4 overlayCol = SAMPLE_TEXTURE2D(_OverlayTex, sampler_OverlayTex, TRANSFORM_TEX(overlayUvs, _OverlayTex)); + overlayCol.rgb *= _OverlayColor.rgb * _OverlayGlow; + #if !OVERLAYMULT_ON + overlayCol.rgb *= overlayCol.a * _OverlayColor.rgb * _OverlayColor.a * _OverlayBlend; + col.rgb += overlayCol.rgb; + #else + overlayCol.a *= _OverlayColor.a; + col = lerp(col, col * overlayCol, _OverlayBlend); + #endif + #endif + + //--------------------------------- + + //OUTBASE_ON + #if OUTBASE_ON + #if OUTBASEPIXELPERF_ON + half2 destUv = half2(_OutlinePixelWidth * _MainTex_TexelSize.x, _OutlinePixelWidth * _MainTex_TexelSize.y); + #else + half2 destUv = half2(_OutlineWidth * _MainTex_TexelSize.x * 200, _OutlineWidth * _MainTex_TexelSize.y * 200); + #endif + + #if OUTDIST_ON + d.texcoord3.x += ((_Time.x + _RandomSeed) * _OutlineDistortTexXSpeed) % 1; + d.texcoord3.y += ((_Time.x + _RandomSeed) * _OutlineDistortTexYSpeed) % 1; + #if ATLAS_ON + d.texcoord3 = half2((d.texcoord3.x - _MinXUV) / (_MaxXUV - _MinXUV), (d.texcoord3.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half outDistortAmnt = (SAMPLE_TEXTURE2D(_OutlineDistortTex, sampler_OutlineDistortTex, d.texcoord3).r - 0.5) * 0.2 * _OutlineDistortAmount; + destUv.x += outDistortAmnt; + destUv.y += outDistortAmnt; + #endif + + half spriteLeft = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(destUv.x, 0)).a; + half spriteRight = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy - half2(destUv.x, 0)).a; + half spriteBottom = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(0, destUv.y)).a; + half spriteTop = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy - half2(0, destUv.y)).a; + half result = spriteLeft + spriteRight + spriteBottom + spriteTop; + + #if OUTBASE8DIR_ON + half spriteTopLeft = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(destUv.x, destUv.y)).a; + half spriteTopRight = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(-destUv.x, destUv.y)).a; + half spriteBotLeft = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(destUv.x, -destUv.y)).a; + half spriteBotRight = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(-destUv.x, -destUv.y)).a; + result = result + spriteTopLeft + spriteTopRight + spriteBotLeft + spriteBotRight; + #endif + + result = step(0.05, saturate(result)); + + #if OUTTEX_ON + d.texcoord1.x += ((_Time.x + _RandomSeed) * _OutlineTexXSpeed) % 1; + d.texcoord1.y += ((_Time.x + _RandomSeed) * _OutlineTexYSpeed) % 1; + #if ATLAS_ON + d.texcoord1 = half2((d.texcoord1.x - _MinXUV) / (_MaxXUV - _MinXUV), (d.texcoord1.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half4 tempOutColor = SAMPLE_TEXTURE2D(_OutlineTex, sampler_OutlineTex, d.texcoord1); + tempOutColor *= _OutlineColor; + _OutlineColor = tempOutColor; + #endif + + result *= (1 - originalAlpha) * _OutlineAlpha; + + half4 outline = _OutlineColor * d.vertexColor.a; + outline.rgb *= _OutlineGlow; + outline.a = result; + #if ONLYOUTLINE_ON + col = outline; + #else + col = lerp(col, outline, result); + #endif + #endif + //------------------------------------------------------- + + //FADE_ON + #if FADE_ON + half2 tiledUvFade1 = TRANSFORM_TEX(d.texcoord0, _FadeTex); + half2 tiledUvFade2 = TRANSFORM_TEX(d.texcoord0, _FadeBurnTex); + #if ATLAS_ON + tiledUvFade1 = half2((tiledUvFade1.x - _MinXUV) / (_MaxXUV - _MinXUV), (tiledUvFade1.y - _MinYUV) / (_MaxYUV - _MinYUV)); + tiledUvFade2 = half2((tiledUvFade2.x - _MinXUV) / (_MaxXUV - _MinXUV), (tiledUvFade2.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half fadeTemp = SAMPLE_TEXTURE2D(_FadeTex, sampler_FadeTex, tiledUvFade1).r; + half fade = smoothstep(_FadeAmount, _FadeAmount + _FadeBurnTransition, fadeTemp); + half fadeBurn = saturate(smoothstep(_FadeAmount - _FadeBurnWidth, _FadeAmount - _FadeBurnWidth + 0.1, fadeTemp) * _FadeAmount); + col.a *= fade; + _FadeBurnColor.rgb *= _FadeBurnGlow; + col += fadeBurn * SAMPLE_TEXTURE2D(_FadeBurnTex, sampler_FadeBurnTex, tiledUvFade2) * _FadeBurnColor * originalAlpha * (1 - col.a); + #endif + //------------------------------------------------------- + + //SHADOW_ON + #if SHADOW_ON + half shadowA = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(_ShadowX, _ShadowY)).a; + half preMultShadowMask = 1 - (saturate(shadowA - col.a) * (1 - col.a)); + col.rgb *= 1 - ((shadowA - col.a) * (1 - col.a)); + col.rgb += (_ShadowColor * shadowA) * (1 - col.a); + col.a = max(shadowA * _ShadowAlpha * d.vertexColor.a, col.a); + #endif + + //------------------------------------------------------- + + //GLOW_ON + #if GLOW_ON + half4 emission; + #if GLOWTEX_ON + emission = SAMPLE_TEXTURE2D(_GlowTex, sampler_GlowTex, d.texcoord0); + #else + emission = col; + #endif + + col.rgb *= _GlowGlobal; + emission.rgb *= emission.a * col.a * _Glow * _GlowColor; + col.rgb += emission.rgb; + #endif + //------------------------------------------------------- + + //COLORRAMP_ON && COLORRAMPOUTLINE_ON + #if COLORRAMP_ON && COLORRAMPOUTLINE_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + luminance = saturate(luminance + _ColorRampLuminosity); + #if GRADIENTCOLORRAMP_ON + col.rgb = lerp(col.rgb, SAMPLE_TEXTURE2D(_ColorRampTexGradient, sampler_ColorRampTexGradient, half2(luminance, 0)).rgb, _ColorRampBlend); + #else + col.rgb = lerp(col.rgb, SAMPLE_TEXTURE2D(_ColorRampTex, sampler_ColorRampTex, half2(luminance, 0)).rgb, _ColorRampBlend); + #endif + #endif + //--------------- + + //GREYSCALE_ON && GREYSCALEOUTLINE_ON + #if GREYSCALE_ON && GREYSCALEOUTLINE_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + luminance = saturate(luminance + _GreyscaleLuminosity); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _GreyscaleTintColor, _GreyscaleBlend); + #endif + + //----------------------------------- + + //POSTERIZE_ON && POSTERIZEOUTLINE_ON + #if POSTERIZE_ON && POSTERIZEOUTLINE_ON + col.rgb = pow(col.rgb, _PosterizeGamma) * _PosterizeNumColors; + col.rgb = floor(col.rgb) / _PosterizeNumColors; + col.rgb = pow(col.rgb, 1.0 / _PosterizeGamma); + #endif + + //----------------------------------- + + //SHINE_ON + #if SHINE_ON + half2 uvShine = uvRect; + half cosAngle = cos(_ShineRotate); + half sinAngle = sin(_ShineRotate); + half2x2 rot = half2x2(cosAngle, -sinAngle, sinAngle, cosAngle); + uvShine -= half2(0.5, 0.5); + uvShine = mul(rot, uvShine); + uvShine += half2(0.5, 0.5); + half shineMask = SAMPLE_TEXTURE2D(_ShineMask, sampler_ShineMask, d.texcoord0.xy).a; + half currentDistanceProjection = (uvShine.x + uvShine.y) / 2; + half whitePower = 1 - (abs(currentDistanceProjection - _ShineLocation) / _ShineWidth); + col.rgb += col.a * whitePower * _ShineGlow * max(sign(currentDistanceProjection - (_ShineLocation - _ShineWidth)), 0.0) + * max(sign((_ShineLocation + _ShineWidth) - currentDistanceProjection), 0.0) * _ShineColor * shineMask; + #endif + + //----------------------------------- + + //HOLOGRAM_ON + #if HOLOGRAM_ON + half totalHologram = _HologramStripesAmount + _HologramUnmodAmount; + half hologramYCoord = ((uvRect.y + (((_Time.x + randomSeed) % 1) * _HologramStripesSpeed)) % totalHologram) / totalHologram; + hologramYCoord = abs(hologramYCoord); + half alpha = RemapFloat(saturate(hologramYCoord - (_HologramUnmodAmount/totalHologram)), 0.0, 1.0, _HologramMinAlpha, saturate(_HologramMaxAlpha)); + half hologramMask = max(sign((_HologramUnmodAmount/totalHologram) - hologramYCoord), 0.0); + half4 hologramResult = col; + hologramResult.a *= lerp(alpha, 1, hologramMask); + hologramResult.rgb *= max(1, _HologramMaxAlpha * max(sign(hologramYCoord - (_HologramUnmodAmount/totalHologram)), 0.0)); + hologramMask = 1 - step(0.01,hologramMask); + hologramResult.rgb += hologramMask * _HologramStripeColor * col.a; + col = lerp(col, hologramResult, _HologramBlend); + #endif + + //----------------------------------- + + //FLICKER_ON + #if FLICKER_ON + col.a *= saturate(col.a * step(frac(0.05 + (_Time.w + randomSeed) * _FlickerFreq), 1 - _FlickerPercent) + _FlickerAlpha); + #endif + //----------------------------------- + + //ALPHACUTOFF_ON + + //ALPHAROUND_ON + + //ALPHAOUTLINE_ON + #if ALPHAOUTLINE_ON + half alphaOutlineRes = pow(1 - col.a, max(_AlphaOutlinePower, 0.0001)) * step(_AlphaOutlineMinAlpha, col.a) * _AlphaOutlineBlend; + col.rgb = lerp(col.rgb, _AlphaOutlineColor.rgb * _AlphaOutlineGlow, alphaOutlineRes); + col.a = lerp(col.a, 1, alphaOutlineRes > 1); + #endif + //------------------------------------------------------- + + //FOG_ON + + //------------------ + + col *= _Color; + o.Albedo = col; + col.a *= _Alpha; + clip(col.a - _AlphaCutoffValue - 0.01); + o.Alpha = _Color.a; + } + + + + + + void ChainSurfaceFunction(inout Surface l, inout ShaderData d) + { + Ext_SurfaceFunction0(l, d); + // Ext_SurfaceFunction1(l, d); + // Ext_SurfaceFunction2(l, d); + // Ext_SurfaceFunction3(l, d); + // Ext_SurfaceFunction4(l, d); + // Ext_SurfaceFunction5(l, d); + // Ext_SurfaceFunction6(l, d); + // Ext_SurfaceFunction7(l, d); + // Ext_SurfaceFunction8(l, d); + // Ext_SurfaceFunction9(l, d); + // Ext_SurfaceFunction10(l, d); + // Ext_SurfaceFunction11(l, d); + // Ext_SurfaceFunction12(l, d); + // Ext_SurfaceFunction13(l, d); + // Ext_SurfaceFunction14(l, d); + // Ext_SurfaceFunction15(l, d); + // Ext_SurfaceFunction16(l, d); + // Ext_SurfaceFunction17(l, d); + // Ext_SurfaceFunction18(l, d); + // Ext_SurfaceFunction19(l, d); + // Ext_SurfaceFunction20(l, d); + // Ext_SurfaceFunction21(l, d); + // Ext_SurfaceFunction22(l, d); + // Ext_SurfaceFunction23(l, d); + // Ext_SurfaceFunction24(l, d); + // Ext_SurfaceFunction25(l, d); + // Ext_SurfaceFunction26(l, d); + // Ext_SurfaceFunction27(l, d); + // Ext_SurfaceFunction28(l, d); + // Ext_SurfaceFunction29(l, d); + } + +#if !_DECALSHADER + + void ChainModifyVertex(inout VertexData v, inout VertexToPixel v2p, float4 time) + { + ExtraV2F d; + + ZERO_INITIALIZE(ExtraV2F, d); + ZERO_INITIALIZE(Blackboard, d.blackboard); + // due to motion vectors in HDRP, we need to use the last + // time in certain spots. So if you are going to use _Time to adjust vertices, + // you need to use this time or motion vectors will break. + d.time = time; + + Ext_ModifyVertex0(v, d); + // Ext_ModifyVertex1(v, d); + // Ext_ModifyVertex2(v, d); + // Ext_ModifyVertex3(v, d); + // Ext_ModifyVertex4(v, d); + // Ext_ModifyVertex5(v, d); + // Ext_ModifyVertex6(v, d); + // Ext_ModifyVertex7(v, d); + // Ext_ModifyVertex8(v, d); + // Ext_ModifyVertex9(v, d); + // Ext_ModifyVertex10(v, d); + // Ext_ModifyVertex11(v, d); + // Ext_ModifyVertex12(v, d); + // Ext_ModifyVertex13(v, d); + // Ext_ModifyVertex14(v, d); + // Ext_ModifyVertex15(v, d); + // Ext_ModifyVertex16(v, d); + // Ext_ModifyVertex17(v, d); + // Ext_ModifyVertex18(v, d); + // Ext_ModifyVertex19(v, d); + // Ext_ModifyVertex20(v, d); + // Ext_ModifyVertex21(v, d); + // Ext_ModifyVertex22(v, d); + // Ext_ModifyVertex23(v, d); + // Ext_ModifyVertex24(v, d); + // Ext_ModifyVertex25(v, d); + // Ext_ModifyVertex26(v, d); + // Ext_ModifyVertex27(v, d); + // Ext_ModifyVertex28(v, d); + // Ext_ModifyVertex29(v, d); + + + // #if %EXTRAV2F0REQUIREKEY% + // v2p.extraV2F0 = d.extraV2F0; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // v2p.extraV2F1 = d.extraV2F1; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // v2p.extraV2F2 = d.extraV2F2; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // v2p.extraV2F3 = d.extraV2F3; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // v2p.extraV2F4 = d.extraV2F4; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // v2p.extraV2F5 = d.extraV2F5; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // v2p.extraV2F6 = d.extraV2F6; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // v2p.extraV2F7 = d.extraV2F7; + // #endif + } + + void ChainModifyTessellatedVertex(inout VertexData v, inout VertexToPixel v2p) + { + ExtraV2F d; + ZERO_INITIALIZE(ExtraV2F, d); + ZERO_INITIALIZE(Blackboard, d.blackboard); + + // #if %EXTRAV2F0REQUIREKEY% + // d.extraV2F0 = v2p.extraV2F0; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // d.extraV2F1 = v2p.extraV2F1; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // d.extraV2F2 = v2p.extraV2F2; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // d.extraV2F3 = v2p.extraV2F3; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // d.extraV2F4 = v2p.extraV2F4; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // d.extraV2F5 = v2p.extraV2F5; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // d.extraV2F6 = v2p.extraV2F6; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // d.extraV2F7 = v2p.extraV2F7; + // #endif + + + // Ext_ModifyTessellatedVertex0(v, d); + // Ext_ModifyTessellatedVertex1(v, d); + // Ext_ModifyTessellatedVertex2(v, d); + // Ext_ModifyTessellatedVertex3(v, d); + // Ext_ModifyTessellatedVertex4(v, d); + // Ext_ModifyTessellatedVertex5(v, d); + // Ext_ModifyTessellatedVertex6(v, d); + // Ext_ModifyTessellatedVertex7(v, d); + // Ext_ModifyTessellatedVertex8(v, d); + // Ext_ModifyTessellatedVertex9(v, d); + // Ext_ModifyTessellatedVertex10(v, d); + // Ext_ModifyTessellatedVertex11(v, d); + // Ext_ModifyTessellatedVertex12(v, d); + // Ext_ModifyTessellatedVertex13(v, d); + // Ext_ModifyTessellatedVertex14(v, d); + // Ext_ModifyTessellatedVertex15(v, d); + // Ext_ModifyTessellatedVertex16(v, d); + // Ext_ModifyTessellatedVertex17(v, d); + // Ext_ModifyTessellatedVertex18(v, d); + // Ext_ModifyTessellatedVertex19(v, d); + // Ext_ModifyTessellatedVertex20(v, d); + // Ext_ModifyTessellatedVertex21(v, d); + // Ext_ModifyTessellatedVertex22(v, d); + // Ext_ModifyTessellatedVertex23(v, d); + // Ext_ModifyTessellatedVertex24(v, d); + // Ext_ModifyTessellatedVertex25(v, d); + // Ext_ModifyTessellatedVertex26(v, d); + // Ext_ModifyTessellatedVertex27(v, d); + // Ext_ModifyTessellatedVertex28(v, d); + // Ext_ModifyTessellatedVertex29(v, d); + + // #if %EXTRAV2F0REQUIREKEY% + // v2p.extraV2F0 = d.extraV2F0; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // v2p.extraV2F1 = d.extraV2F1; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // v2p.extraV2F2 = d.extraV2F2; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // v2p.extraV2F3 = d.extraV2F3; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // v2p.extraV2F4 = d.extraV2F4; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // v2p.extraV2F5 = d.extraV2F5; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // v2p.extraV2F6 = d.extraV2F6; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // v2p.extraV2F7 = d.extraV2F7; + // #endif + } + + void ChainFinalColorForward(inout Surface l, inout ShaderData d, inout half4 color) + { + // Ext_FinalColorForward0(l, d, color); + // Ext_FinalColorForward1(l, d, color); + // Ext_FinalColorForward2(l, d, color); + // Ext_FinalColorForward3(l, d, color); + // Ext_FinalColorForward4(l, d, color); + // Ext_FinalColorForward5(l, d, color); + // Ext_FinalColorForward6(l, d, color); + // Ext_FinalColorForward7(l, d, color); + // Ext_FinalColorForward8(l, d, color); + // Ext_FinalColorForward9(l, d, color); + // Ext_FinalColorForward10(l, d, color); + // Ext_FinalColorForward11(l, d, color); + // Ext_FinalColorForward12(l, d, color); + // Ext_FinalColorForward13(l, d, color); + // Ext_FinalColorForward14(l, d, color); + // Ext_FinalColorForward15(l, d, color); + // Ext_FinalColorForward16(l, d, color); + // Ext_FinalColorForward17(l, d, color); + // Ext_FinalColorForward18(l, d, color); + // Ext_FinalColorForward19(l, d, color); + // Ext_FinalColorForward20(l, d, color); + // Ext_FinalColorForward21(l, d, color); + // Ext_FinalColorForward22(l, d, color); + // Ext_FinalColorForward23(l, d, color); + // Ext_FinalColorForward24(l, d, color); + // Ext_FinalColorForward25(l, d, color); + // Ext_FinalColorForward26(l, d, color); + // Ext_FinalColorForward27(l, d, color); + // Ext_FinalColorForward28(l, d, color); + // Ext_FinalColorForward29(l, d, color); + } + + void ChainFinalGBufferStandard(inout Surface s, inout ShaderData d, inout half4 GBuffer0, inout half4 GBuffer1, inout half4 GBuffer2, inout half4 outEmission, inout half4 outShadowMask) + { + // Ext_FinalGBufferStandard0(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard1(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard2(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard3(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard4(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard5(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard6(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard7(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard8(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard9(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard10(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard11(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard12(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard13(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard14(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard15(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard16(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard17(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard18(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard19(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard20(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard21(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard22(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard23(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard24(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard25(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard26(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard27(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard28(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard29(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + } +#endif + + + + + +#if _DECALSHADER + + ShaderData CreateShaderData(SurfaceDescriptionInputs IN) + { + ShaderData d = (ShaderData)0; + d.TBNMatrix = float3x3(IN.WorldSpaceTangent, IN.WorldSpaceBiTangent, IN.WorldSpaceNormal); + d.worldSpaceNormal = IN.WorldSpaceNormal; + d.worldSpaceTangent = IN.WorldSpaceTangent; + + d.worldSpacePosition = IN.WorldSpacePosition; + d.texcoord0 = IN.uv0.xyxy; + d.screenPos = IN.ScreenPosition; + + d.worldSpaceViewDir = normalize(_WorldSpaceCameraPos - d.worldSpacePosition); + + d.tangentSpaceViewDir = mul(d.TBNMatrix, d.worldSpaceViewDir); + + // these rarely get used, so we back transform them. Usually will be stripped. + #if _HDRP + // d.localSpacePosition = mul(GetWorldToObjectMatrix(), float4(GetCameraRelativePositionWS(d.worldSpacePosition), 1)).xyz; + #else + // d.localSpacePosition = mul(GetWorldToObjectMatrix(), float4(d.worldSpacePosition, 1)).xyz; + #endif + // d.localSpaceNormal = normalize(mul((float3x3)GetWorldToObjectMatrix(), d.worldSpaceNormal)); + // d.localSpaceTangent = normalize(mul((float3x3)GetWorldToObjectMatrix(), d.worldSpaceTangent.xyz)); + + // #if %SCREENPOSREQUIREKEY% + // d.screenUV = (IN.ScreenPosition.xy / max(0.01, IN.ScreenPosition.w)); + // #endif + + return d; + } +#else + + ShaderData CreateShaderData(VertexToPixel i + #if NEED_FACING + , bool facing + #endif + ) + { + ShaderData d = (ShaderData)0; + d.clipPos = i.pos; + d.worldSpacePosition = i.worldPos; + + d.worldSpaceNormal = normalize(i.worldNormal); + d.worldSpaceTangent.xyz = normalize(i.worldTangent.xyz); + + d.tangentSign = i.worldTangent.w * unity_WorldTransformParams.w; + float3 bitangent = cross(d.worldSpaceTangent.xyz, d.worldSpaceNormal) * d.tangentSign; + + d.TBNMatrix = float3x3(d.worldSpaceTangent, -bitangent, d.worldSpaceNormal); + d.worldSpaceViewDir = normalize(_WorldSpaceCameraPos - i.worldPos); + + d.tangentSpaceViewDir = mul(d.TBNMatrix, d.worldSpaceViewDir); + d.texcoord0 = i.texcoord0; + d.texcoord1 = i.texcoord1; + d.texcoord2 = i.texcoord2; + + // #if %TEXCOORD3REQUIREKEY% + d.texcoord3 = i.texcoord3; + // #endif + + // d.isFrontFace = facing; + // #if %VERTEXCOLORREQUIREKEY% + d.vertexColor = i.vertexColor; + // #endif + + // these rarely get used, so we back transform them. Usually will be stripped. + #if _HDRP + // d.localSpacePosition = mul(GetWorldToObjectMatrix(), float4(GetCameraRelativePositionWS(i.worldPos), 1)).xyz; + #else + // d.localSpacePosition = mul(GetWorldToObjectMatrix(), float4(i.worldPos, 1)).xyz; + #endif + // d.localSpaceNormal = normalize(mul((float3x3)GetWorldToObjectMatrix(), i.worldNormal)); + // d.localSpaceTangent = normalize(mul((float3x3)GetWorldToObjectMatrix(), i.worldTangent.xyz)); + + // #if %SCREENPOSREQUIREKEY% + // d.screenPos = i.screenPos; + // d.screenUV = (i.screenPos.xy / i.screenPos.w); + // #endif + + + // #if %EXTRAV2F0REQUIREKEY% + // d.extraV2F0 = i.extraV2F0; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // d.extraV2F1 = i.extraV2F1; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // d.extraV2F2 = i.extraV2F2; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // d.extraV2F3 = i.extraV2F3; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // d.extraV2F4 = i.extraV2F4; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // d.extraV2F5 = i.extraV2F5; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // d.extraV2F6 = i.extraV2F6; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // d.extraV2F7 = i.extraV2F7; + // #endif + + return d; + } + +#endif + + + #if defined(_PASSSHADOW) + float3 _LightDirection; + float3 _LightPosition; + #endif + + #if (_PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR))) + + #define GetWorldToViewMatrix() _ViewMatrix + #define UNITY_MATRIX_I_V _InvViewMatrix + #define GetViewToHClipMatrix() OptimizeProjectionMatrix(_ProjMatrix) + #define UNITY_MATRIX_I_P _InvProjMatrix + #define GetWorldToHClipMatrix() _ViewProjMatrix + #define UNITY_MATRIX_I_VP _InvViewProjMatrix + #define UNITY_MATRIX_UNJITTERED_VP _NonJitteredViewProjMatrix + #define UNITY_MATRIX_PREV_VP _PrevViewProjMatrix + #define UNITY_MATRIX_PREV_I_VP _PrevInvViewProjMatrix + + void MotionVectorPositionZBias(VertexToPixel input) + { + #if UNITY_REVERSED_Z + input.pos.z -= unity_MotionVectorsParams.z * input.pos.w; + #else + input.pos.z += unity_MotionVectorsParams.z * input.pos.w; + #endif + } + + #endif + + // vertex shader + VertexToPixel Vert (VertexData v) + { + VertexToPixel o = (VertexToPixel)0; + + UNITY_SETUP_INSTANCE_ID(v); + UNITY_TRANSFER_INSTANCE_ID(v, o); + UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o); + + + #if _URP && (_PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR))) + VertexData previousMesh = v; + #endif + #if !_TESSELLATION_ON + ChainModifyVertex(v, o, _Time); + #endif + + o.texcoord0 = v.texcoord0; + o.texcoord1 = v.texcoord1; + o.texcoord2 = v.texcoord2; + + // #if %TEXCOORD3REQUIREKEY% + o.texcoord3 = v.texcoord3; + // #endif + + // #if %VERTEXCOLORREQUIREKEY% + o.vertexColor = v.vertexColor; + // #endif + + // This return the camera relative position (if enable) + float3 positionWS = TransformObjectToWorld(v.vertex.xyz); + float3 normalWS = TransformObjectToWorldNormal(v.normal); + float4 tangentWS = float4(TransformObjectToWorldDir(v.tangent.xyz), v.tangent.w); + + VertexPositionInputs vertexInput = GetVertexPositionInputs(v.vertex.xyz); + o.worldPos = positionWS; + o.worldNormal = normalWS; + o.worldTangent = tangentWS; + + + // For some very odd reason, in 2021.2, we can't use Unity's defines, but have to use our own.. + #if _PASSSHADOW + #if _CASTING_PUNCTUAL_LIGHT_SHADOW + float3 lightDirectionWS = normalize(_LightPosition - o.worldPos); + #else + float3 lightDirectionWS = _LightDirection; + #endif + // Define shadow pass specific clip position for Universal + o.pos = TransformWorldToHClip(ApplyShadowBias(o.worldPos, o.worldNormal, lightDirectionWS)); + #if UNITY_REVERSED_Z + o.pos.z = min(o.pos.z, UNITY_NEAR_CLIP_VALUE); + #else + o.pos.z = max(o.pos.z, UNITY_NEAR_CLIP_VALUE); + #endif + #elif _PASSMETA + o.pos = MetaVertexPosition(float4(v.vertex.xyz, 0), v.texcoord1.xy, v.texcoord2.xy, unity_LightmapST, unity_DynamicLightmapST); + #else + o.pos = TransformWorldToHClip(o.worldPos); + #endif + + // #if %SCREENPOSREQUIREKEY% + // o.screenPos = ComputeScreenPos(o.pos, _ProjectionParams.x); + // #endif + + + #if _PASSFORWARD || _PASSGBUFFER + float2 uv1 = v.texcoord1.xy; + OUTPUT_LIGHTMAP_UV(uv1, unity_LightmapST, o.lightmapUV); + o.texcoord1.xy = uv1; + #if UNITY_VERSION < 60000009 + OUTPUT_SH(o.worldNormal, o.sh); + #endif + + #if defined(DYNAMICLIGHTMAP_ON) + o.dynamicLightmapUV.xy = v.texcoord2.xy * unity_DynamicLightmapST.xy + unity_DynamicLightmapST.zw; + #if UNITY_VERSION >= 60000009 + OUTPUT_SH(o.worldNormal, o.sh); + #endif + #elif (defined(PROBE_VOLUMES_L1) || defined(PROBE_VOLUMES_L2)) && UNITY_VERSION >= 60000009 + OUTPUT_SH4(vertexInput.positionWS, o.worldNormal.xyz, GetWorldSpaceNormalizeViewDir(vertexInput.positionWS), o.sh, o.probeOcclusion); + #endif + #endif + + #ifdef VARYINGS_NEED_FOG_AND_VERTEX_LIGHT + half fogFactor = 0; + #if defined(_FOG_FRAGMENT) + fogFactor = ComputeFogFactor(o.pos.z); + #endif + #if _BAKEDLIT + o.fogFactorAndVertexLight = half4(fogFactor, 0, 0, 0); + #else + half3 vertexLight = VertexLighting(o.worldPos, o.worldNormal); + o.fogFactorAndVertexLight = half4(fogFactor, vertexLight); + #endif + #endif + + #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR) + o.shadowCoord = GetShadowCoord(vertexInput); + #endif + + #if _URP && (_PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR))) + #if !defined(TESSELLATION_ON) + MotionVectorPositionZBias(o); + #endif + + o.previousPositionCS = float4(0.0, 0.0, 0.0, 1.0); + // Note: unity_MotionVectorsParams.y is 0 is forceNoMotion is enabled + bool forceNoMotion = unity_MotionVectorsParams.y == 0.0; + + if (!forceNoMotion) + { + #if defined(HAVE_VFX_MODIFICATION) + float3 previousPositionOS = currentFrameMvData.vfxParticlePositionOS; + #if defined(VFX_FEATURE_MOTION_VECTORS_VERTS) + const bool applyDeformation = false; + #else + const bool applyDeformation = true; + #endif + #else + const bool hasDeformation = unity_MotionVectorsParams.x == 1; // Mesh has skinned deformation + float3 previousPositionOS = hasDeformation ? previousMesh.previousPositionOS : previousMesh.vertex.xyz; + + #if defined(AUTOMATIC_TIME_BASED_MOTION_VECTORS) && defined(GRAPH_VERTEX_USES_TIME_PARAMETERS_INPUT) + const bool applyDeformation = true; + #else + const bool applyDeformation = hasDeformation; + #endif + #endif + // TODO + #if defined(FEATURES_GRAPH_VERTEX) + if (applyDeformation) + previousPositionOS = GetLastFrameDeformedPosition(previousMesh, currentFrameMvData, previousPositionOS); + else + previousPositionOS = previousMesh.positionOS; + + #if defined(FEATURES_GRAPH_VERTEX_MOTION_VECTOR_OUTPUT) + previousPositionOS -= previousMesh.precomputedVelocity; + #endif + #endif + + #if defined(UNITY_DOTS_INSTANCING_ENABLED) && defined(DOTS_DEFORMED) + // Deformed vertices in DOTS are not cumulative with built-in Unity skinning/blend shapes + // Needs to be called after vertex modification has been applied otherwise it will be + // overwritten by Compute Deform node + ApplyPreviousFrameDeformedVertexPosition(previousMesh.vertexID, previousPositionOS); + #endif + #if defined (_ADD_PRECOMPUTED_VELOCITY) + previousPositionOS -= previousMesh.precomputedVelocity; + #endif + o.positionCS = mul(UNITY_MATRIX_UNJITTERED_VP, float4(positionWS, 1.0f)); + + #if defined(HAVE_VFX_MODIFICATION) + #if defined(VFX_FEATURE_MOTION_VECTORS_VERTS) + #if defined(FEATURES_GRAPH_VERTEX_MOTION_VECTOR_OUTPUT) || defined(_ADD_PRECOMPUTED_VELOCITY) + #error Unexpected fast path rendering VFX motion vector while there are vertex modification afterwards. + #endif + o.previousPositionCS = VFXGetPreviousClipPosition(previousMesh, currentFrameMvData.vfxElementAttributes, o.positionCS); + #else + #if VFX_WORLD_SPACE + //previousPositionOS is already in world space + const float3 previousPositionWS = previousPositionOS; + #else + const float3 previousPositionWS = mul(UNITY_PREV_MATRIX_M, float4(previousPositionOS, 1.0f)).xyz; + #endif + o.previousPositionCS = mul(UNITY_MATRIX_PREV_VP, float4(previousPositionWS, 1.0f)); + #endif + #else + o.previousPositionCS = mul(UNITY_MATRIX_PREV_VP, mul(UNITY_PREV_MATRIX_M, float4(previousPositionOS, 1))); + #endif + } + #endif + + return o; + } + + + + +#if _UNLIT + #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Unlit.hlsl" +#endif + + // fragment shader + void Frag (VertexToPixel IN + , out half4 outColor : SV_Target0 + #ifdef _WRITE_RENDERING_LAYERS + , out float4 outRenderingLayers : SV_Target1 + #endif + #ifdef _DEPTHOFFSET_ON + , out float outputDepth : SV_Depth + #endif + #if NEED_FACING + , bool facing : SV_IsFrontFace + #endif + ) + { + UNITY_SETUP_INSTANCE_ID(IN); + UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX(IN); + + #if defined(LOD_FADE_CROSSFADE) + LODFadeCrossFade(IN.pos); + #endif + + + ShaderData d = CreateShaderData(IN + #if NEED_FACING + , facing + #endif + ); + Surface l = (Surface)0; + + #ifdef _DEPTHOFFSET_ON + l.outputDepth = outputDepth; + #endif + + l.Albedo = half3(0.5, 0.5, 0.5); + l.Normal = float3(0,0,1); + l.Occlusion = 1; + l.Alpha = 1; + + ChainSurfaceFunction(l, d); + + #ifdef _DEPTHOFFSET_ON + outputDepth = l.outputDepth; + #endif + + #if _USESPECULAR || _SIMPLELIT + float3 specular = l.Specular; + float metallic = 1; + #else + float3 specular = 0; + float metallic = l.Metallic; + #endif + + + + + InputData inputData = (InputData)0; + + inputData.positionWS = IN.worldPos; + #if _WORLDSPACENORMAL + inputData.normalWS = l.Normal; + #else + inputData.normalWS = normalize(TangentToWorldSpace(d, l.Normal)); + #endif + + inputData.viewDirectionWS = SafeNormalize(d.worldSpaceViewDir); + + + #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR) + inputData.shadowCoord = IN.shadowCoord; + #elif defined(MAIN_LIGHT_CALCULATE_SHADOWS) + inputData.shadowCoord = TransformWorldToShadowCoord(IN.worldPos); + #else + inputData.shadowCoord = float4(0, 0, 0, 0); + #endif + +#if _BAKEDLIT + inputData.fogCoord = IN.fogFactorAndVertexLight.x; + inputData.vertexLighting = 0; +#else + inputData.fogCoord = InitializeInputDataFog(float4(IN.worldPos, 1.0), IN.fogFactorAndVertexLight.x); + inputData.vertexLighting = IN.fogFactorAndVertexLight.yzw; +#endif + + + + #if defined(_OVERRIDE_BAKEDGI) + inputData.bakedGI = l.DiffuseGI; + l.Emission += l.SpecularGI; + #elif _BAKEDLIT + inputData.bakedGI = SAMPLE_GI(IN.lightmapUV, IN.sh, inputData.normalWS); + #else + #if defined(DYNAMICLIGHTMAP_ON) + inputData.bakedGI = SAMPLE_GI(IN.lightmapUV, IN.dynamicLightmapUV.xy, IN.sh, inputData.normalWS); + #elif defined(PROBE_VOLUMES_L1) || defined(PROBE_VOLUMES_L2) + #if UNITY_VERSION >= 60000009 + inputData.bakedGI = SAMPLE_GI(IN.sh, IN.worldPos, inputData.normalWS, inputData.viewDirectionWS, IN.pos, IN.probeOcclusion, inputData.shadowMask); + #else + inputData.bakedGI = SAMPLE_GI(IN.sh, IN.worldPos, inputData.normalWS, inputData.viewDirectionWS, IN.pos); + #endif + #else + inputData.bakedGI = SAMPLE_GI(IN.lightmapUV, IN.sh, inputData.normalWS); + #endif + #endif + inputData.normalizedScreenSpaceUV = GetNormalizedScreenSpaceUV(IN.pos); + #if !_BAKEDLIT + inputData.shadowMask = SAMPLE_SHADOWMASK(IN.lightmapUV); + + #if defined(_OVERRIDE_SHADOWMASK) + float4 mulColor = saturate(dot(l.ShadowMask, _MainLightOcclusionProbes)); //unity_OcclusionMaskSelector)); + inputData.shadowMask = mulColor; + #endif + #else + inputData.shadowMask = float4(1,1,1,1); + #endif + + #if defined(DEBUG_DISPLAY) + #if defined(DYNAMICLIGHTMAP_ON) + inputData.dynamicLightmapUV = IN.dynamicLightmapUV.xy; + #endif + #if defined(LIGHTMAP_ON) + inputData.staticLightmapUV = IN.lightmapUV; + #else + inputData.vertexSH = IN.sh; + #endif + #endif + + #if _WORLDSPACENORMAL + float3 normalTS = WorldToTangentSpace(d, l.Normal); + #else + float3 normalTS = l.Normal; + #endif + + SurfaceData surface = (SurfaceData)0; + surface.albedo = l.Albedo; + surface.metallic = saturate(metallic); + surface.specular = specular; + surface.smoothness = saturate(l.Smoothness), + surface.occlusion = l.Occlusion, + surface.emission = l.Emission, + surface.alpha = saturate(l.Alpha); + surface.clearCoatMask = 0; + surface.clearCoatSmoothness = 1; + + #ifdef _CLEARCOAT + surface.clearCoatMask = saturate(l.CoatMask); + surface.clearCoatSmoothness = saturate(l.CoatSmoothness); + #endif + + #if !_UNLIT + half4 color = half4(l.Albedo, l.Alpha); + #ifdef _DBUFFER + #if _BAKEDLIT + half3 bakeColor = color.rgb; + float3 bakeNormal = inputData.normalWS.xyz; + ApplyDecalToBaseColorAndNormal(IN.pos, bakeColor, bakeNormal); + color.rgb = bakeColor; + inputData.normalWS.xyz = bakeNormal; + #else + ApplyDecalToSurfaceData(IN.pos, surface, inputData); + #endif + #endif + #if _SIMPLELIT + color = UniversalFragmentBlinnPhong( + inputData, + surface); + #elif _BAKEDLIT + color = UniversalFragmentBakedLit(inputData, color.rgb, color.a, normalTS); + #else + color = UniversalFragmentPBR(inputData, surface); + #endif + + #if !DISABLEFOG + color.rgb = MixFog(color.rgb, inputData.fogCoord); + #endif + + #else // unlit + #ifdef _DBUFFER + ApplyDecalToSurfaceData(IN.pos, surface, inputData); + #endif + half4 color = UniversalFragmentUnlit(inputData, l.Albedo, l.Alpha); + #if !DISABLEFOG + color.rgb = MixFog(color.rgb, inputData.fogCoord); + #endif + #endif + ChainFinalColorForward(l, d, color); + + outColor = color; + + #ifdef _WRITE_RENDERING_LAYERS + uint renderingLayers = GetMeshRenderingLayer(); + outRenderingLayers = float4(EncodeMeshRenderingLayer(renderingLayers), 0, 0, 0); + #endif + + } + + ENDHLSL + + } + + + + Pass + { + Name "GBuffer" + Tags + { + "LightMode" = "UniversalGBuffer" + } + + Blend One Zero + ZTest LEqual + ZWrite On + + Tags { "RenderType" = "Opaque" "Queue" = "Geometry" "PreviewType" = "Plane" } + Cull [_CullingOption] + ZWrite [_ZWrite] + ZTest [_ZTestMode] + + + HLSLPROGRAM + + #pragma vertex Vert + #pragma fragment Frag + + #pragma target 3.0 + + #pragma prefer_hlslcc gles + #pragma exclude_renderers d3d11_9x + #pragma multi_compile_instancing + #pragma multi_compile_fog + #pragma instancing_options renderinglayer + + #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_fragment _ _REFLECTION_PROBE_BLENDING + #pragma multi_compile_fragment _ _REFLECTION_PROBE_BOX_PROJECTION + #pragma multi_compile_fragment _ _SHADOWS_SOFT + #pragma multi_compile_fragment _ _SHADOWS_SOFT_LOW + #pragma multi_compile_fragment _ _SHADOWS_SOFT_MEDIUM + #pragma multi_compile_fragment _ _SHADOWS_SOFT_HIGH + #pragma multi_compile _ LIGHTMAP_SHADOW_MIXING + #pragma multi_compile _ SHADOWS_SHADOWMASK + #pragma multi_compile _ _MIXED_LIGHTING_SUBTRACTIVE + #pragma multi_compile_fragment _ _DBUFFER_MRT1 _DBUFFER_MRT2 _DBUFFER_MRT3 + #pragma multi_compile_fragment _ _GBUFFER_NORMALS_OCT + #pragma multi_compile_fragment _ _RENDER_PASS_ENABLED + #pragma multi_compile_fragment _ DEBUG_DISPLAY + #pragma multi_compile_fragment _ LOD_FADE_CROSSFADE + + + #define _FOG_FRAGMENT 1 + + #define VARYINGS_NEED_FOG_AND_VERTEX_LIGHT + #define SHADERPASS SHADERPASS_GBUFFER + #define _PASSGBUFFER 1 + + + #pragma shader_feature_local GLOW_ON + #pragma shader_feature_local FADE_ON + #pragma shader_feature_local OUTBASE_ON + #pragma shader_feature_local ONLYOUTLINE_ON + #pragma shader_feature_local GRADIENT_ON + #pragma shader_feature_local GRADIENT2COL_ON + #pragma shader_feature_local RADIALGRADIENT_ON + #pragma shader_feature_local COLORSWAP_ON + #pragma shader_feature_local HSV_ON + #pragma shader_feature_local CHANGECOLOR_ON + #pragma shader_feature_local CHANGECOLOR2_ON + #pragma shader_feature_local CHANGECOLOR3_ON + #pragma shader_feature_local COLORRAMP_ON + #pragma shader_feature_local GRADIENTCOLORRAMP_ON + #pragma shader_feature_local HITEFFECT_ON + #pragma shader_feature_local NEGATIVE_ON + #pragma shader_feature_local PIXELATE_ON + #pragma shader_feature_local GREYSCALE_ON + #pragma shader_feature_local POSTERIZE_ON + #pragma shader_feature_local BLUR_ON + #pragma shader_feature_local MOTIONBLUR_ON + #pragma shader_feature_local GHOST_ON + #pragma shader_feature_local ALPHAOUTLINE_ON + #pragma shader_feature_local INNEROUTLINE_ON + #pragma shader_feature_local ONLYINNEROUTLINE_ON + #pragma shader_feature_local HOLOGRAM_ON + #pragma shader_feature_local CHROMABERR_ON + #pragma shader_feature_local GLITCH_ON + #pragma shader_feature_local FLICKER_ON + #pragma shader_feature_local SHADOW_ON + #pragma shader_feature_local SHINE_ON + #pragma shader_feature_local CONTRAST_ON + #pragma shader_feature_local OVERLAY_ON + #pragma shader_feature_local OVERLAYMULT_ON + #pragma shader_feature_local DOODLE_ON + #pragma shader_feature_local WIND_ON + #pragma shader_feature_local WAVEUV_ON + #pragma shader_feature_local ROUNDWAVEUV_ON + #pragma shader_feature_local RECTSIZE_ON + #pragma shader_feature_local OFFSETUV_ON + #pragma shader_feature_local CLIPPING_ON + #pragma shader_feature_local RADIALCLIPPING_ON + #pragma shader_feature_local TEXTURESCROLL_ON + #pragma shader_feature_local ZOOMUV_ON + #pragma shader_feature_local DISTORT_ON + #pragma shader_feature_local WARP_ON + #pragma shader_feature_local TWISTUV_ON + #pragma shader_feature_local ROTATEUV_ON + #pragma shader_feature_local POLARUV_ON + #pragma shader_feature_local FISHEYE_ON + #pragma shader_feature_local PINCH_ON + #pragma shader_feature_local SHAKEUV_ON + + #pragma shader_feature_local GLOWTEX_ON + #pragma shader_feature_local OUTTEX_ON + #pragma shader_feature_local OUTDIST_ON + #pragma shader_feature_local OUTBASE8DIR_ON + #pragma shader_feature_local OUTBASEPIXELPERF_ON + #pragma shader_feature_local COLORRAMPOUTLINE_ON + #pragma shader_feature_local GREYSCALEOUTLINE_ON + #pragma shader_feature_local POSTERIZEOUTLINE_ON + #pragma shader_feature_local BLURISHD_ON + #pragma shader_feature_local MANUALWIND_ON + #pragma shader_feature_local ATLAS_ON + #pragma shader_feature_local PREMULTIPLYALPHA_ON + + #pragma shader_feature BILBOARD_ON + #pragma shader_feature BILBOARDY_ON + + #pragma shader_feature NORMALMAP_ON + + + #define _URP 1 +#define _USINGTEXCOORD1 1 +#define _USINGTEXCOORD2 1 + + + + + // Includes + #include_with_pragmas "Packages/com.unity.render-pipelines.universal/ShaderLibrary/DOTS.hlsl" + #include_with_pragmas "Packages/com.unity.render-pipelines.universal/ShaderLibrary/RenderingLayers.hlsl" + #include_with_pragmas "Packages/com.unity.render-pipelines.universal/ShaderLibrary/ProbeVolumeVariants.hlsl" + #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.universal/ShaderLibrary/Input.hlsl" + #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/TextureStack.hlsl" + #include_with_pragmas "Packages/com.unity.render-pipelines.core/ShaderLibrary/FoveatedRenderingKeywords.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" + #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/LODCrossFade.hlsl" + + + + #undef WorldNormalVector + #define WorldNormalVector(data, normal) mul(normal, data.TBNMatrix) + + #define UnityObjectToWorldNormal(normal) mul(GetObjectToWorldMatrix(), normal) + + #define _WorldSpaceLightPos0 _MainLightPosition + + #define UNITY_DECLARE_TEX2D(name) TEXTURE2D(name); SAMPLER(sampler##name); + #define UNITY_DECLARE_TEX2D_NOSAMPLER(name) TEXTURE2D(name); + #define UNITY_DECLARE_TEX2DARRAY(name) TEXTURE2D_ARRAY(name); SAMPLER(sampler##name); + #define UNITY_DECLARE_TEX2DARRAY_NOSAMPLER(name) TEXTURE2D_ARRAY(name); + + #define UNITY_SAMPLE_TEX2DARRAY(tex,coord) SAMPLE_TEXTURE2D_ARRAY(tex, sampler##tex, coord.xy, coord.z) + #define UNITY_SAMPLE_TEX2DARRAY_LOD(tex,coord,lod) SAMPLE_TEXTURE2D_ARRAY_LOD(tex, sampler##tex, coord.xy, coord.z, lod) + #define UNITY_SAMPLE_TEX2D(tex, coord) SAMPLE_TEXTURE2D(tex, sampler##tex, coord) + #define UNITY_SAMPLE_TEX2D_SAMPLER(tex, samp, coord) SAMPLE_TEXTURE2D(tex, sampler##samp, coord) + + #define UNITY_SAMPLE_TEX2D_LOD(tex,coord, lod) SAMPLE_TEXTURE2D_LOD(tex, sampler_##tex, coord, lod) + #define UNITY_SAMPLE_TEX2D_SAMPLER_LOD(tex,samplertex,coord, lod) SAMPLE_TEXTURE2D_LOD (tex, sampler##samplertex,coord, lod) + + #if defined(UNITY_COMPILER_HLSL) + #define UNITY_INITIALIZE_OUTPUT(type,name) name = (type)0; + #else + #define UNITY_INITIALIZE_OUTPUT(type,name) + #endif + + #define sampler2D_float sampler2D + #define sampler2D_half sampler2D + + + + // data across stages, stripped like the above. + struct VertexToPixel + { + float4 pos : SV_POSITION; + float3 worldPos : TEXCOORD0; + float3 worldNormal : TEXCOORD1; + float4 worldTangent : TEXCOORD2; + float4 texcoord0 : TEXCOORD3; + float4 texcoord1 : TEXCOORD4; + float4 texcoord2 : TEXCOORD5; + + // #if %TEXCOORD3REQUIREKEY% + float4 texcoord3 : TEXCOORD6; + // #endif + + // #if %SCREENPOSREQUIREKEY% + // float4 screenPos : TEXCOORD7; + // #endif + + // #if %VERTEXCOLORREQUIREKEY% + half4 vertexColor : COLOR; + // #endif + + #if defined(LIGHTMAP_ON) + float2 lightmapUV : TEXCOORD8; + #endif + #if defined(DYNAMICLIGHTMAP_ON) + float2 dynamicLightmapUV : TEXCOORD9; + #endif + #if !defined(LIGHTMAP_ON) + float4 probeOcclusion : TEXCOORD8; + float3 sh : TEXCOORD10; + #endif + + #if defined(VARYINGS_NEED_FOG_AND_VERTEX_LIGHT) + float4 fogFactorAndVertexLight : TEXCOORD11; + #endif + + #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR) + float4 shadowCoord : TEXCOORD12; + #endif + + // #if %EXTRAV2F0REQUIREKEY% + // float4 extraV2F0 : TEXCOORD13; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // float4 extraV2F1 : TEXCOORD14; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // float4 extraV2F2 : TEXCOORD15; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // float4 extraV2F3 : TEXCOORD16; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // float4 extraV2F4 : TEXCOORD17; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // float4 extraV2F5 : TEXCOORD18; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // float4 extraV2F6 : TEXCOORD19; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // float4 extraV2F7 : TEXCOORD20; + // #endif + + #if UNITY_ANY_INSTANCING_ENABLED + uint instanceID : CUSTOM_INSTANCE_ID; + #endif + #if (defined(UNITY_STEREO_MULTIVIEW_ENABLED)) || (defined(UNITY_STEREO_INSTANCING_ENABLED) && (defined(SHADER_API_GLES3) || defined(SHADER_API_GLCORE))) + uint stereoTargetEyeIndexAsBlendIdx0 : BLENDINDICES0; + #endif + #if (defined(UNITY_STEREO_INSTANCING_ENABLED)) + uint stereoTargetEyeIndexAsRTArrayIdx : SV_RenderTargetArrayIndex; + #endif + #if defined(SHADER_STAGE_FRAGMENT) && defined(VARYINGS_NEED_CULLFACE) + FRONT_FACE_TYPE cullFace : FRONT_FACE_SEMANTIC; + #endif + + #if _PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR)) + float4 previousPositionCS : TEXCOORD21; // Contain previous transform position (in case of skinning for example) + float4 positionCS : TEXCOORD22; + #endif + }; + + + + + + // data describing the user output of a pixel + struct Surface + { + half3 Albedo; + half Height; + half3 Normal; + half Smoothness; + half3 Emission; + half Metallic; + half3 Specular; + half Occlusion; + half SpecularPower; // for simple lighting + half Alpha; + float outputDepth; // if written, SV_Depth semantic is used. ShaderData.clipPos.z is unused value + // HDRP Only + half SpecularOcclusion; + half SubsurfaceMask; + half Thickness; + half CoatMask; + half CoatSmoothness; + half Anisotropy; + half IridescenceMask; + half IridescenceThickness; + int DiffusionProfileHash; + float SpecularAAThreshold; + float SpecularAAScreenSpaceVariance; + // requires _OVERRIDE_BAKEDGI to be defined, but is mapped in all pipelines + float3 DiffuseGI; + float3 BackDiffuseGI; + float3 SpecularGI; + float ior; + float3 transmittanceColor; + float atDistance; + float transmittanceMask; + // requires _OVERRIDE_SHADOWMASK to be defines + float4 ShadowMask; + + // for decals + float NormalAlpha; + float MAOSAlpha; + + + }; + + // Data the user declares in blackboard blocks + struct Blackboard + { + + float blackboardDummyData; + }; + + // data the user might need, this will grow to be big. But easy to strip + struct ShaderData + { + float4 clipPos; // SV_POSITION + float3 localSpacePosition; + float3 localSpaceNormal; + float3 localSpaceTangent; + + float3 worldSpacePosition; + float3 worldSpaceNormal; + float3 worldSpaceTangent; + float tangentSign; + + float3 worldSpaceViewDir; + float3 tangentSpaceViewDir; + + float4 texcoord0; + float4 texcoord1; + float4 texcoord2; + float4 texcoord3; + + float2 screenUV; + float4 screenPos; + + float4 vertexColor; + bool isFrontFace; + + float4 extraV2F0; + float4 extraV2F1; + float4 extraV2F2; + float4 extraV2F3; + float4 extraV2F4; + float4 extraV2F5; + float4 extraV2F6; + float4 extraV2F7; + + float3x3 TBNMatrix; + Blackboard blackboard; + }; + + struct VertexData + { + #if SHADER_TARGET > 30 + // uint vertexID : SV_VertexID; + #endif + float4 vertex : POSITION; + float3 normal : NORMAL; + float4 tangent : TANGENT; + float4 texcoord0 : TEXCOORD0; + + // optimize out mesh coords when not in use by user or lighting system + #if _URP && (_USINGTEXCOORD1 || _PASSMETA || _PASSFORWARD || _PASSGBUFFER) + float4 texcoord1 : TEXCOORD1; + #endif + + #if _URP && (_USINGTEXCOORD2 || _PASSMETA || ((_PASSFORWARD || _PASSGBUFFER) && defined(DYNAMICLIGHTMAP_ON))) + float4 texcoord2 : TEXCOORD2; + #endif + + #if _STANDARD && (_USINGTEXCOORD1 || (_PASSMETA || ((_PASSFORWARD || _PASSGBUFFER || _PASSFORWARDADD) && LIGHTMAP_ON))) + float4 texcoord1 : TEXCOORD1; + #endif + #if _STANDARD && (_USINGTEXCOORD2 || (_PASSMETA || ((_PASSFORWARD || _PASSGBUFFER) && DYNAMICLIGHTMAP_ON))) + float4 texcoord2 : TEXCOORD2; + #endif + + + #if _HDRP + float4 texcoord1 : TEXCOORD1; + float4 texcoord2 : TEXCOORD2; + #endif + + // #if %TEXCOORD3REQUIREKEY% + float4 texcoord3 : TEXCOORD3; + // #endif + + // #if %VERTEXCOLORREQUIREKEY% + float4 vertexColor : COLOR; + // #endif + + #if _PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR)) + float3 previousPositionOS : TEXCOORD4; // Contain previous transform position (in case of skinning for example) + #if defined (_ADD_PRECOMPUTED_VELOCITY) + float3 precomputedVelocity : TEXCOORD5; // Add Precomputed Velocity (Alembic computes velocities on runtime side). + #endif + #endif + + UNITY_VERTEX_INPUT_INSTANCE_ID + }; + + struct TessVertex + { + float4 vertex : INTERNALTESSPOS; + float3 normal : NORMAL; + float4 tangent : TANGENT; + float4 texcoord0 : TEXCOORD0; + float4 texcoord1 : TEXCOORD1; + float4 texcoord2 : TEXCOORD2; + + // #if %TEXCOORD3REQUIREKEY% + float4 texcoord3 : TEXCOORD3; + // #endif + + // #if %VERTEXCOLORREQUIREKEY% + float4 vertexColor : COLOR; + // #endif + + // #if %EXTRAV2F0REQUIREKEY% + // float4 extraV2F0 : TEXCOORD5; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // float4 extraV2F1 : TEXCOORD6; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // float4 extraV2F2 : TEXCOORD7; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // float4 extraV2F3 : TEXCOORD8; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // float4 extraV2F4 : TEXCOORD9; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // float4 extraV2F5 : TEXCOORD10; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // float4 extraV2F6 : TEXCOORD11; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // float4 extraV2F7 : TEXCOORD12; + // #endif + + #if _PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR)) + float3 previousPositionOS : TEXCOORD13; // Contain previous transform position (in case of skinning for example) + #if defined (_ADD_PRECOMPUTED_VELOCITY) + float3 precomputedVelocity : TEXCOORD14; + #endif + #endif + + UNITY_VERTEX_INPUT_INSTANCE_ID + UNITY_VERTEX_OUTPUT_STEREO + }; + + struct ExtraV2F + { + float4 extraV2F0; + float4 extraV2F1; + float4 extraV2F2; + float4 extraV2F3; + float4 extraV2F4; + float4 extraV2F5; + float4 extraV2F6; + float4 extraV2F7; + Blackboard blackboard; + float4 time; + }; + + + float3 WorldToTangentSpace(ShaderData d, float3 normal) + { + return mul(d.TBNMatrix, normal); + } + + float3 TangentToWorldSpace(ShaderData d, float3 normal) + { + return mul(normal, d.TBNMatrix); + } + + // in this case, make standard more like SRPs, because we can't fix + // unity_WorldToObject in HDRP, since it already does macro-fu there + + #if _STANDARD + float3 TransformWorldToObject(float3 p) { return mul(unity_WorldToObject, float4(p, 1)); }; + float3 TransformObjectToWorld(float3 p) { return mul(unity_ObjectToWorld, float4(p, 1)); }; + float4 TransformWorldToObject(float4 p) { return mul(unity_WorldToObject, p); }; + float4 TransformObjectToWorld(float4 p) { return mul(unity_ObjectToWorld, p); }; + float4x4 GetWorldToObjectMatrix() { return unity_WorldToObject; } + float4x4 GetObjectToWorldMatrix() { return unity_ObjectToWorld; } + #if (defined(SHADER_API_D3D11) || defined(SHADER_API_XBOXONE) || defined(UNITY_COMPILER_HLSLCC) || defined(SHADER_API_PSSL) || (SHADER_TARGET_SURFACE_ANALYSIS && !SHADER_TARGET_SURFACE_ANALYSIS_MOJOSHADER)) + #define UNITY_SAMPLE_TEX2D_LOD(tex,coord, lod) tex.SampleLevel (sampler##tex,coord, lod) + #define UNITY_SAMPLE_TEX2D_SAMPLER_LOD(tex,samplertex,coord, lod) tex.SampleLevel (sampler##samplertex,coord, lod) + #else + #define UNITY_SAMPLE_TEX2D_LOD(tex,coord,lod) tex2D (tex,coord,0,lod) + #define UNITY_SAMPLE_TEX2D_SAMPLER_LOD(tex,samplertex,coord,lod) tex2D (tex,coord,0,lod) + #endif + + #undef GetWorldToObjectMatrix() + + #define GetWorldToObjectMatrix() unity_WorldToObject + + + #endif + + float3 GetCameraWorldPosition() + { + #if _HDRP + return GetCameraRelativePositionWS(_WorldSpaceCameraPos); + #else + return _WorldSpaceCameraPos; + #endif + } + + #if _GRABPASSUSED + #if _STANDARD + TEXTURE2D(%GRABTEXTURE%); + SAMPLER(sampler_%GRABTEXTURE%); + #endif + + half3 GetSceneColor(float2 uv) + { + #if _STANDARD + return SAMPLE_TEXTURE2D(%GRABTEXTURE%, sampler_%GRABTEXTURE%, uv).rgb; + #else + return SHADERGRAPH_SAMPLE_SCENE_COLOR(uv); + #endif + } + #endif + + + + #if _STANDARD + UNITY_DECLARE_DEPTH_TEXTURE(_CameraDepthTexture); + float GetSceneDepth(float2 uv) { return SAMPLE_DEPTH_TEXTURE(_CameraDepthTexture, uv); } + float GetLinear01Depth(float2 uv) { return Linear01Depth(GetSceneDepth(uv)); } + float GetLinearEyeDepth(float2 uv) { return LinearEyeDepth(GetSceneDepth(uv)); } + #else + float GetSceneDepth(float2 uv) { return SHADERGRAPH_SAMPLE_SCENE_DEPTH(uv); } + float GetLinear01Depth(float2 uv) { return Linear01Depth(GetSceneDepth(uv), _ZBufferParams); } + float GetLinearEyeDepth(float2 uv) { return LinearEyeDepth(GetSceneDepth(uv), _ZBufferParams); } + #endif + + float3 GetWorldPositionFromDepthBuffer(float2 uv, float3 worldSpaceViewDir) + { + float eye = GetLinearEyeDepth(uv); + float3 camView = mul((float3x3)GetObjectToWorldMatrix(), transpose(mul(GetWorldToObjectMatrix(), UNITY_MATRIX_I_V)) [2].xyz); + + float dt = dot(worldSpaceViewDir, camView); + float3 div = worldSpaceViewDir/dt; + float3 wpos = (eye * div) + GetCameraWorldPosition(); + return wpos; + } + + #if _HDRP + float3 ObjectToWorldSpacePosition(float3 pos) + { + return GetAbsolutePositionWS(TransformObjectToWorld(pos)); + } + #else + float3 ObjectToWorldSpacePosition(float3 pos) + { + return TransformObjectToWorld(pos); + } + #endif + + #if _STANDARD + UNITY_DECLARE_SCREENSPACE_TEXTURE(_CameraDepthNormalsTexture); + float3 GetSceneNormal(float2 uv, float3 worldSpaceViewDir) + { + float4 depthNorms = UNITY_SAMPLE_SCREENSPACE_TEXTURE(_CameraDepthNormalsTexture, uv); + float3 norms = DecodeViewNormalStereo(depthNorms); + norms = mul((float3x3)GetWorldToViewMatrix(), norms) * 0.5 + 0.5; + return norms; + } + #elif _HDRP && !_DECALSHADER + + float3 GetSceneNormal(float2 uv, float3 worldSpaceViewDir) + { + NormalData nd; + DecodeFromNormalBuffer(_ScreenSize.xy * uv, nd); + return nd.normalWS; + } + #elif _URP + #if (SHADER_LIBRARY_VERSION_MAJOR >= 10) + #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/DeclareNormalsTexture.hlsl" + #endif + + float3 GetSceneNormal(float2 uv, float3 worldSpaceViewDir) + { + #if (SHADER_LIBRARY_VERSION_MAJOR >= 10) + return SampleSceneNormals(uv); + #else + float3 wpos = GetWorldPositionFromDepthBuffer(uv, worldSpaceViewDir); + return normalize(-cross(ddx(wpos), ddy(wpos))) * 0.5 + 0.5; + #endif + + } + #endif + + #if _HDRP + + half3 UnpackNormalmapRGorAG(half4 packednormal) + { + // This do the trick + packednormal.x *= packednormal.w; + + half3 normal; + normal.xy = packednormal.xy * 2 - 1; + normal.z = sqrt(1 - saturate(dot(normal.xy, normal.xy))); + return normal; + } + half3 UnpackNormal(half4 packednormal) + { + #if defined(UNITY_NO_DXT5nm) + return packednormal.xyz * 2 - 1; + #else + return UnpackNormalmapRGorAG(packednormal); + #endif + } + #endif + #if _HDRP || _URP + + half3 UnpackScaleNormal(half4 packednormal, half scale) + { + #ifndef UNITY_NO_DXT5nm + // Unpack normal as DXT5nm (1, y, 1, x) or BC5 (x, y, 0, 1) + // Note neutral texture like "bump" is (0, 0, 1, 1) to work with both plain RGB normal and DXT5nm/BC5 + packednormal.x *= packednormal.w; + #endif + half3 normal; + normal.xy = (packednormal.xy * 2 - 1) * scale; + normal.z = sqrt(1 - saturate(dot(normal.xy, normal.xy))); + return normal; + } + + #endif + + + void GetSun(out float3 lightDir, out float3 color) + { + lightDir = float3(0.5, 0.5, 0); + color = 1; + #if _HDRP + if (_DirectionalLightCount > 0) + { + DirectionalLightData light = _DirectionalLightDatas[0]; + lightDir = -light.forward.xyz; + color = light.color; + } + #elif _STANDARD + lightDir = normalize(_WorldSpaceLightPos0.xyz); + color = _LightColor0.rgb; + #elif _URP + Light light = GetMainLight(); + lightDir = light.direction; + color = light.color; + #endif + } + + + + CBUFFER_START(UnityPerMaterial) + + + half4 _Color; + half4 _MainTex_ST, _MainTex_TexelSize; + half _Alpha, _AlphaCutoffValue; + + #if ATLAS_ON + half _MinXUV, _MaxXUV, _MinYUV, _MaxYUV; + #endif + + #if GLOW_ON + half4 _GlowColor; + half _Glow, _GlowGlobal; + #endif + + #if HSV_ON + half _HsvShift, _HsvSaturation, _HsvBright; + #endif + + #if DISTORT_ON + half4 _DistortTex_ST; + half _DistortTexXSpeed, _DistortTexYSpeed, _DistortAmount; + #endif + + #if FADE_ON + half4 _FadeBurnColor, _FadeTex_ST, _FadeBurnTex_ST; + half _FadeAmount, _FadeBurnWidth, _FadeBurnTransition,_FadeBurnGlow; + #endif + + #if OUTBASE_ON + half4 _OutlineColor; + half _OutlineAlpha, _OutlineGlow, _OutlineWidth; + int _OutlinePixelWidth; + #endif + + #if OUTTEX_ON + half4 _OutlineTex_ST; + half _OutlineTexXSpeed, _OutlineTexYSpeed; + #endif + + #if OUTDIST_ON + half4 _OutlineDistortTex_ST; + half _OutlineDistortTexXSpeed, _OutlineDistortTexYSpeed, _OutlineDistortAmount; + #endif + + #if ALPHAOUTLINE_ON + half _AlphaOutlineGlow, _AlphaOutlinePower, _AlphaOutlineMinAlpha, _AlphaOutlineBlend; + half4 _AlphaOutlineColor; + #endif + + #if INNEROUTLINE_ON + half _InnerOutlineThickness, _InnerOutlineAlpha, _InnerOutlineGlow; + half4 _InnerOutlineColor; + #endif + + #if GRADIENT_ON + half _GradBlend, _GradBoostX, _GradBoostY; + half4 _GradTopRightCol, _GradTopLeftCol, _GradBotRightCol, _GradBotLeftCol; + #endif + + #if COLORSWAP_ON + half4 _ColorSwapRed, _ColorSwapGreen, _ColorSwapBlue; + half _ColorSwapRedLuminosity, _ColorSwapGreenLuminosity, _ColorSwapBlueLuminosity, _ColorSwapBlend; + #endif + + #if CHANGECOLOR_ON + half4 _ColorChangeNewCol, _ColorChangeTarget; + half _ColorChangeTolerance, _ColorChangeLuminosity; + #endif + #if CHANGECOLOR2_ON + half4 _ColorChangeNewCol2, _ColorChangeTarget2; + half _ColorChangeTolerance2; + #endif + #if CHANGECOLOR3_ON + half4 _ColorChangeNewCol3, _ColorChangeTarget3; + half _ColorChangeTolerance3; + #endif + + #if COLORRAMP_ON + half _ColorRampLuminosity, _ColorRampBlend; + #endif + + #if HITEFFECT_ON + half4 _HitEffectColor; + half _HitEffectGlow, _HitEffectBlend; + #endif + + #if NEGATIVE_ON + half _NegativeAmount; + #endif + + #if PIXELATE_ON + half _PixelateSize; + #endif + + #if GREYSCALE_ON + half _GreyscaleLuminosity, _GreyscaleBlend; + half4 _GreyscaleTintColor; + #endif + + #if POSTERIZE_ON + half _PosterizeNumColors, _PosterizeGamma; + #endif + + #if BLUR_ON + half _BlurIntensity; + #endif + + #if MOTIONBLUR_ON + half _MotionBlurAngle, _MotionBlurDist; + #endif + + #if GHOST_ON + half _GhostColorBoost, _GhostTransparency, _GhostBlend; + #endif + + #if HOLOGRAM_ON + half _HologramStripesAmount, _HologramMinAlpha, _HologramUnmodAmount, _HologramStripesSpeed, _HologramMaxAlpha, _HologramBlend; + half4 _HologramStripeColor; + #endif + + #if CHROMABERR_ON + half _ChromAberrAmount, _ChromAberrAlpha; + #endif + + #if GLITCH_ON + half _GlitchAmount, _GlitchSize; + #endif + + #if FLICKER_ON + half _FlickerFreq, _FlickerPercent, _FlickerAlpha; + #endif + + #if SHADOW_ON + half _ShadowX, _ShadowY, _ShadowAlpha; + half4 _ShadowColor; + #endif + + #if SHINE_ON + half4 _ShineColor; + half _ShineLocation, _ShineRotate, _ShineWidth, _ShineGlow; + #endif + + #if CONTRAST_ON + half _Contrast, _Brightness; + #endif + + #if OVERLAY_ON + half4 _OverlayTex_ST, _OverlayColor; + half _OverlayGlow, _OverlayBlend, _OverlayTextureScrollXSpeed, _OverlayTextureScrollYSpeed; + #endif + + #if DOODLE_ON + half _HandDrawnAmount, _HandDrawnSpeed; + #endif + + #if WIND_ON + half _GrassSpeed, _GrassWind, _GrassManualAnim, _GrassRadialBend; + #endif + + #if WAVEUV_ON + float _WaveAmount, _WaveSpeed, _WaveStrength, _WaveX, _WaveY; + #endif + + #if ROUNDWAVEUV_ON + half _RoundWaveStrength, _RoundWaveSpeed; + #endif + + #if RECTSIZE_ON + half _RectSize; + #endif + + #if OFFSETUV_ON + half _OffsetUvX, _OffsetUvY; + #endif + + #if CLIPPING_ON + half _ClipUvLeft, _ClipUvRight, _ClipUvUp, _ClipUvDown; + #endif + + #if RADIALCLIPPING_ON + half _RadialStartAngle, _RadialClip, _RadialClip2; + #endif + + #if TEXTURESCROLL_ON + half _TextureScrollXSpeed, _TextureScrollYSpeed; + #endif + + #if ZOOMUV_ON + half _ZoomUvAmount; + #endif + + #if WARP_ON + half _WarpStrength, _WarpSpeed, _WarpScale; + #endif + + #if TWISTUV_ON + half _TwistUvAmount, _TwistUvPosX, _TwistUvPosY, _TwistUvRadius; + #endif + + #if ROTATEUV_ON + half _RotateUvAmount; + #endif + + #if FISHEYE_ON + half _FishEyeUvAmount; + #endif + + #if PINCH_ON + half _PinchUvAmount; + #endif + + #if SHAKEUV_ON + half _ShakeUvSpeed, _ShakeUvX, _ShakeUvY; + #endif + + #if NORMALMAP_ON + half _NormalStrength; + #endif + + float _RandomSeed; + + + + + CBUFFER_END + + + + + + + + TEXTURE2D(_MainTex); + SAMPLER(sampler_MainTex); + + #if GLOW_ON + TEXTURE2D(_GlowTex); + SAMPLER(sampler_GlowTex); + #endif + + #if FADE_ON + TEXTURE2D(_FadeTex); + SAMPLER(sampler_FadeTex); + + TEXTURE2D(_FadeBurnTex); + SAMPLER(sampler_FadeBurnTex); + #endif + + #if DISTORT_ON + TEXTURE2D(_DistortTex); + SAMPLER(sampler_DistortTex); + #endif + + #if OUTTEX_ON + TEXTURE2D(_OutlineTex); + SAMPLER(sampler_OutlineTex); + #endif + + #if OUTDIST_ON + TEXTURE2D(_OutlineDistortTex); + SAMPLER(sampler_OutlineDistortTex); + #endif + + #if COLORSWAP_ON + TEXTURE2D(_ColorSwapTex); + SAMPLER(sampler_ColorSwapTex); + #endif + + #if COLORRAMP_ON + TEXTURE2D(_ColorRampTex); + TEXTURE2D(_ColorRampTexGradient); + SAMPLER(sampler_ColorRampTex); + SAMPLER(sampler_ColorRampTexGradient); + #endif + + #if SHINE_ON + TEXTURE2D(_ShineMask); + SAMPLER(sampler_ShineMask); + #endif + + #if OVERLAY_ON + TEXTURE2D(_OverlayTex); + SAMPLER(sampler_OverlayTex); + #endif + + #if NORMALMAP_ON + TEXTURE2D(_NormalMap); + SAMPLER(sampler_NormalMap); + #endif + + + half3 GetPixel(in int offsetX, in int offsetY, in half2 uv, in Texture2D _tex, in SamplerState _sampler) + { + half2 _uv = uv + half2(offsetX * _MainTex_TexelSize.x, offsetY * _MainTex_TexelSize.y); + half4 col = SAMPLE_TEXTURE2D(_tex, _sampler, _uv); + return col.rgb; + } + + + //BLURS------------------------------------------------------------------------- + half4 Blur(half2 uv, Texture2D source, SamplerState sampler_source, half Intensity) + { + const half2 texelSize = 1.0 / _ScreenParams.xy; + const half4 color = SAMPLE_TEXTURE2D(source, sampler_source, uv); + const half2 offset = Intensity * texelSize; + + half4 accumulatedColor = color; + half accumulatedWeight = 1.0; + for (int x = -1; x <= 1; x++) + { + for (int y = -1; y <= 1; y++) + { + const half2 sampleUV = uv + half2(x, y) * offset; + const half4 sampleColor = SAMPLE_TEXTURE2D(source, sampler_source, sampleUV); + + accumulatedColor += sampleColor; + accumulatedWeight += 1.0; + } + } + + half4 blurredColor = accumulatedColor / accumulatedWeight; + return blurredColor; + } + + half BlurHD_G(half bhqp, half x) + { + return exp(-(x * x) / (2.0 * bhqp * bhqp)); + } + half4 BlurHD(half2 uv, Texture2D source, SamplerState sampler_source, half BlurAmount, half xScale, half yScale) + { + int iterations = 16; + int halfIterations = iterations / 2; + half sigmaX = 0.1 + BlurAmount * 0.5; + half sigmaY = sigmaX; + half total = 0.0; + half4 ret = half4(0, 0, 0, 0); + for (int iy = 0; iy < iterations; ++iy) + { + half fy = BlurHD_G(sigmaY, half(iy) -half(halfIterations)); + half offsetY = half(iy - halfIterations) * 0.00390625 * xScale; + for (int ix = 0; ix < iterations; ++ix) + { + half fx = BlurHD_G(sigmaX, half(ix) - half(halfIterations)); + half offsetX = half(ix - halfIterations) * 0.00390625 * yScale; + total += fx * fy; + ret += SAMPLE_TEXTURE2D(source, sampler_source, uv + half2(offsetX, offsetY)) * fx * fy; + } + } + return ret / total; + } + //----------------------------------------------------------------------- + + + //------------------------------------------- + half RemapFloat(half inValue, half inMin, half inMax, half outMin, half outMax){ + return outMin + (inValue - inMin) * (outMax - outMin) / (inMax - inMin); + } + //------------------------------------------- + + //----------------------------------------------------------------------- + half rand(half2 seed, half offset) { + return (frac(sin(dot(seed, half2(12.9898, 78.233))) * 43758.5453) + offset) % 1.0; + } + + half rand2(half2 seed, half offset) { + return (frac(sin(dot(seed * floor(50 + (_Time.x % 1.0) * 12.), half2(127.1, 311.7))) * 43758.5453123) + offset) % 1.0; + } + + half rand2CustomTime(half2 seed, half offset, half customTime) { + return (frac(sin(dot(seed * floor(50 + (customTime % 1.0) * 12.), half2(127.1, 311.7))) * 43758.5453123) + offset) % 1.0; + } + //----------------------------------------------------------------------- + + + void Ext_ModifyVertex0 (inout VertexData v, inout ExtraV2F d) + { + //BILBOARD_ON + #if BILBOARD_ON + half3 camRight = mul((half3x3)unity_CameraToWorld, half3(1,0,0)); + half3 camUp = half3(0,1,0); + #if BILBOARDY_ON + camUp = mul((half3x3)unity_CameraToWorld, half3(0,1,0)); + #endif + half3 localPos = v.vertex.x * camRight + v.vertex.y * camUp; + v.vertex = half4(localPos, 1); + #endif + //----------------------------------------------------------- + + v.texcoord0.xy = TRANSFORM_TEX(v.texcoord0.xy, _MainTex); + half2 center = half2(0.5, 0.5); + #if ATLAS_ON + center = half2((_MaxXUV + _MinXUV) / 2.0, (_MaxYUV + _MinYUV) / 2.0); + #endif + + //POLARUV_ON + #if POLARUV_ON + v.texcoord0.xy = v.texcoord0.xy - center; + #endif + + //---------------------------------------- + + //ROTATEUV_ON + #if ROTATEUV_ON + half2 uvC = v.texcoord0.xy; + half cosAngle = cos(_RotateUvAmount); + half sinAngle = sin(_RotateUvAmount); + half2x2 rot = half2x2(cosAngle, -sinAngle, sinAngle, cosAngle); + uvC -= center; + v.texcoord0.xy = mul(rot, uvC); + v.texcoord0.xy += center; + #endif + //-------------------- + + #if RECTSIZE_ON + v.vertex.xyz += (v.vertex.xyz * (_RectSize - 1.0)); + #endif + + #if OUTTEX_ON + v.texcoord1.xy = TRANSFORM_TEX(v.texcoord0.xy, _OutlineTex); + #endif + + #if OUTDIST_ON + v.texcoord2.xy = TRANSFORM_TEX(v.texcoord0.xy, _OutlineDistortTex); + #endif + + #if DISTORT_ON + v.texcoord3.xy = TRANSFORM_TEX(v.texcoord0.xy, _DistortTex); + #endif + } + + void Ext_SurfaceFunction0 (inout Surface o, ShaderData d) + { + half randomSeed = _RandomSeed; + + float2 uvRect = d.texcoord0; + half2 center = half2(0.5, 0.5); + #if ATLAS_ON + center = half2((_MaxXUV + _MinXUV) / 2.0, (_MaxYUV + _MinYUV) / 2.0); + uvRect = half2((d.texcoord0.x - _MinXUV) / (_MaxXUV - _MinXUV), (d.texcoord0.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half2 centerTiled = half2(center.x * _MainTex_ST.x, center.y * _MainTex_ST.y); + + //CLIPPING_ON + #if CLIPPING_ON + half2 tiledUv = half2(d.texcoord0.x / _MainTex_ST.x, d.texcoord0.y / _MainTex_ST.y); + #if ATLAS_ON + tiledUv = half2((tiledUv.x - _MinXUV) / (_MaxXUV - _MinXUV), (tiledUv.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + clip((1 - _ClipUvUp) - tiledUv.y); + clip(tiledUv.y - _ClipUvDown); + clip((1 - _ClipUvRight) - tiledUv.x); + clip(tiledUv.x - _ClipUvLeft); + #endif + //---------------------------------- + + //RADIALCLIPPING_ON + #if RADIALCLIPPING_ON + half2 tiledUv2 = half2(d.texcoord0.x / _MainTex_ST.x, d.texcoord0.y / _MainTex_ST.y); + #if ATLAS_ON + tiledUv2 = half2((tiledUv2.x - _MinXUV) / (_MaxXUV - _MinXUV), (tiledUv2.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half startAngle = _RadialStartAngle - _RadialClip; + half endAngle = _RadialStartAngle + _RadialClip2; + half offset0 = clamp(0, 360, startAngle + 360); + half offset360 = clamp(0, 360, endAngle - 360); + half2 atan2Coord = half2(lerp(-1, 1, tiledUv2.x), lerp(-1, 1, tiledUv2.y)); + half atanAngle = atan2(atan2Coord.y, atan2Coord.x) * 57.3; // angle in degrees + if(atanAngle < 0) atanAngle = 360 + atanAngle; + if(atanAngle >= startAngle && atanAngle <= endAngle) discard; + if(atanAngle <= offset360) discard; + if(atanAngle >= offset0) discard; + #endif + + //----------------------------- + + //TEXTURESCROLL_ON && ATLAS_ON + #if TEXTURESCROLL_ON && ATLAS_ON + d.texcoord0.xy = half2(_MinXUV + ((_MaxXUV - _MinXUV) * (abs(((_Time.y + randomSeed) * _TextureScrollXSpeed) + uvRect.x) % 1)), + _MinYUV + ((_MaxYUV - _MinYUV) * (abs(((_Time.y + randomSeed) * _TextureScrollYSpeed) + uvRect.y) % 1))); + #endif + //---------------------------- + + //OFFSETUV_ON + #if OFFSETUV_ON + #if ATLAS_ON + d.texcoord0.xy = half2(_MinXUV + ((_MaxXUV - _MinXUV) * (abs((_OffsetUvX + uvRect.x) % 1))), + _MinYUV + ((_MaxYUV - _MinYUV) * (abs(_OffsetUvY + uvRect.y) % 1))); + #else + d.texcoord0.xy += half2(_OffsetUvX, _OffsetUvY); + #endif + #endif + + //---------------------- + + //POLARUV_ON + #if POLARUV_ON + d.texcoord0.xy = half2(atan2(d.texcoord0.y, d.texcoord0.x) / (2.0f * 3.141592653589f), length(d.texcoord0.xy)); + d.texcoord0.xy *= _MainTex_ST.xy; + #endif + + //-------------------------------------- + + //TWISTUV_ON + #if TWISTUV_ON + #if ATLAS_ON + _TwistUvPosX = ((_MaxXUV - _MinXUV) * _TwistUvPosX) + _MinXUV; + _TwistUvPosY = ((_MaxYUV - _MinYUV) * _TwistUvPosY) + _MinYUV; + #endif + half2 tempUv = d.texcoord0.xy - half2(_TwistUvPosX * _MainTex_ST.x, _TwistUvPosY * _MainTex_ST.y); + _TwistUvRadius *= (_MainTex_ST.x + _MainTex_ST.y) / 2; + half percent = (_TwistUvRadius - length(tempUv)) / _TwistUvRadius; + half theta = percent * percent * (2.0 * sin(_TwistUvAmount)) * 8.0; + half s = sin(theta); + half c = cos(theta); + half beta = max(sign(_TwistUvRadius - length(tempUv)), 0.0); + tempUv = half2(dot(tempUv, half2(c, -s)), dot(tempUv, half2(s, c))) * beta + tempUv * (1 - beta); + tempUv += half2(_TwistUvPosX * _MainTex_ST.x, _TwistUvPosY * _MainTex_ST.y); + d.texcoord0.xy = tempUv; + #endif + + //-------------------------------------------- + + //FISHEYE_ON + #if FISHEYE_ON + half bind = length(centerTiled); + half2 dF = d.texcoord0.xy - centerTiled; + half dFlen = length(dF); + half fishInt = (3.14159265359 / bind) * (_FishEyeUvAmount + 0.001); + d.texcoord0.xy = centerTiled + (dF / (max(0.0001, dFlen))) * tan(dFlen * fishInt) * bind / tan(bind * fishInt); + #endif + //--------------------------------------------- + + //PINCH_ON + #if PINCH_ON + half2 dP = d.texcoord0.xy - centerTiled; + half pinchInt = (3.141592 / length(centerTiled)) * (-_PinchUvAmount + 0.001); + d.texcoord0.xy = centerTiled + normalize(dP) * atan(length(dP) * -pinchInt * 10.0) * 0.5 / atan(-pinchInt * 5); + #endif + + //--------------------------------------------- + + //ZOOMUV_ON + #if ZOOMUV_ON + d.texcoord0.xy -= centerTiled; + d.texcoord0.xy = d.texcoord0.xy * _ZoomUvAmount; + d.texcoord0.xy += centerTiled; + #endif + + //----------------------------------------------- + + //DOODLE_ON + #if DOODLE_ON + half2 uvCopy = uvRect; + _HandDrawnSpeed = (floor((_Time.x + randomSeed) * 20 * _HandDrawnSpeed) / _HandDrawnSpeed) * _HandDrawnSpeed; + uvCopy.x = sin((uvCopy.x * _HandDrawnAmount + _HandDrawnSpeed) * 4); + uvCopy.y = cos((uvCopy.y * _HandDrawnAmount + _HandDrawnSpeed) * 4); + d.texcoord0.xy = lerp(d.texcoord0.xy, d.texcoord0.xy + uvCopy, 0.0005 * _HandDrawnAmount); + #endif + + //-------------------------- + + //SHAKEUV_ON + #if SHAKEUV_ON + half xShake = sin((_Time.x + randomSeed) * _ShakeUvSpeed * 50) * _ShakeUvX; + half yShake = cos((_Time.x + randomSeed) * _ShakeUvSpeed * 50) * _ShakeUvY; + d.texcoord0.xy += half2(xShake * 0.012, yShake * 0.01); + #endif + + //------------------------------------------- + + //RECTSIZE_ON + #if RECTSIZE_ON + d.texcoord0.xy = d.texcoord0.xy * (_RectSize).xx + (((-_RectSize * 0.5) + 0.5)).xx; + #endif + + //------------------------------------------- + + //DISTORT_ON + #if DISTORT_ON + #if ATLAS_ON + d.texcoord3.x = d.texcoord3.x * (1 / (_MaxXUV - _MinXUV)); + d.texcoord3.y = d.texcoord3.y * (1 / (_MaxYUV - _MinYUV)); + #endif + + d.texcoord3.x += ((_Time.x + _RandomSeed) * _DistortTexXSpeed) % 1; + d.texcoord3.y += ((_Time.x + _RandomSeed) * _DistortTexYSpeed) % 1; + half distortAmnt = (SAMPLE_TEXTURE2D(_DistortTex, sampler_DistortTex, d.texcoord3.xy).r - 0.5) * 0.2 * _DistortAmount; + d.texcoord0.x += distortAmnt; + d.texcoord0.y += distortAmnt; + #endif + //------------------------------------------------------- + + //WARP_ON + #if WARP_ON + half2 warpUv = half2(d.texcoord0.x / _MainTex_ST.x, d.texcoord0.y / _MainTex_ST.y); + #if ATLAS_ON + warpUv = half2((warpUv.x - _MinXUV) / (_MaxXUV - _MinXUV), (warpUv.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + const float tau = 6.283185307179586; + float xWarp = (_Time.y + randomSeed) * _WarpSpeed + warpUv.x * tau / _WarpScale; + float yWarp = (_Time.y + randomSeed) * _WarpSpeed + warpUv.y * tau / _WarpScale; + float2 warp = float2(sin(xWarp), sin(yWarp)) * _WarpStrength; + d.texcoord0.xy += warp; + #endif + + //------------------------------------------------------- + + //WAVEUV_ON + #if WAVEUV_ON + float2 uvWave = half2(_WaveX * _MainTex_ST.x, _WaveY * _MainTex_ST.y) - d.texcoord0.xy; + uvWave %= 1; + #if ATLAS_ON + uvWave = half2(_WaveX, _WaveY) - uvRect; + #endif + uvWave.x *= _ScreenParams.x / _ScreenParams.y; + float waveTime = _Time.y + randomSeed; + float angWave = (sqrt(dot(uvWave, uvWave)) * _WaveAmount) - ((waveTime * _WaveSpeed)); + d.texcoord0.xy = d.texcoord0.xy + uvWave * sin(angWave) * (_WaveStrength / 1000.0); + #endif + //---------------------------------------------------- + + //ROUNDWAVEUV_ON + #if ROUNDWAVEUV_ON + half xWave = ((0.5 * _MainTex_ST.x) - uvRect.x); + half yWave = ((0.5 * _MainTex_ST.y) - uvRect.y) * (_MainTex_TexelSize.w / _MainTex_TexelSize.z); + half ripple = -sqrt(xWave*xWave + yWave* yWave); + d.texcoord0.xy += (sin((ripple + (_Time.y + randomSeed) * (_RoundWaveSpeed/10.0)) / 0.015) * (_RoundWaveStrength/10.0)) % 1; + #endif + //---------------------------------------------------- + + + //WIND_ON + #if WIND_ON + half windOffset = sin((_Time.x + randomSeed) * _GrassSpeed * 10); + half2 windCenter = half2(0.5, 0.1); + #if ATLAS_ON + windCenter.x = ((_MaxXUV - _MinXUV) * windCenter.x) + _MinXUV; + windCenter.y = ((_MaxYUV - _MinYUV) * windCenter.y) + _MinYUV; + #endif + #if !MANUALWIND_ON + d.texcoord0.x = fmod(abs(lerp(d.texcoord0.x, d.texcoord0.x + (_GrassWind * 0.01 * windOffset), uvRect.y)), 1); + #else + d.texcoord0.x = fmod(abs(lerp(d.texcoord0.x, d.texcoord0.x + (_GrassWind * 0.01 * _GrassManualAnim), uvRect.y)), 1); + windOffset = _GrassManualAnim; + #endif + half2 delta = d.texcoord0.xy - windCenter; + half delta2 = dot(delta.xy, delta.xy); + half2 delta_offset = delta2 * windOffset; + d.texcoord0.xy = d.texcoord0.xy + half2(delta.y, -delta.x) * delta_offset * _GrassRadialBend; + #endif + + //-------------------------------------------------------- + + //TEXTURESCROLL_ON && !ATLAS_ON + #if TEXTURESCROLL_ON && !ATLAS_ON + d.texcoord0.x += ((_Time.y + randomSeed) * _TextureScrollXSpeed) % 1; + d.texcoord0.y += ((_Time.y + randomSeed) * _TextureScrollYSpeed) % 1; + #endif + //------------------------------ + + //PIXELATE_ON + #if PIXELATE_ON + half aspectRatio = _MainTex_TexelSize.x / _MainTex_TexelSize.y; + half2 pixelSize = float2(_PixelateSize, _PixelateSize * aspectRatio); + d.texcoord0.xy = floor(d.texcoord0.xy * pixelSize) / pixelSize; + #endif + //-------------- + + half4 col = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy); + half originalAlpha = col.a; + col *= d.vertexColor; + + //NORMAL MAP + #if NORMALMAP_ON + half4 normalSample = SAMPLE_TEXTURE2D(_NormalMap, sampler_NormalMap, d.texcoord0.xy); + half3 normalTS = UnpackNormal(normalSample); + normalTS.xy *= _NormalStrength; + o.Normal = normalTS; + #endif + + + //GLITCH_ON + #if GLITCH_ON + half2 uvGlitch = uvRect; + uvGlitch.y -= 0.5; + half lineNoise = pow(rand2(floor(uvGlitch * half2(24., 19.) * _GlitchSize) * 4.0, randomSeed), 3.0) * _GlitchAmount + * pow(rand2(floor(uvGlitch * half2(38., 14.) * _GlitchSize) * 4.0, randomSeed), 3.0); + col = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(lineNoise * 0.02 * rand2(half2(2.0, 1), randomSeed), 0)) * d.vertexColor; + #endif + //-------------------------------------- + + //CHROMABERR_ON + #if CHROMABERR_ON + half4 r = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(_ChromAberrAmount/10, 0)) * d.vertexColor; + half4 b = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(-_ChromAberrAmount/10, 0)) * d.vertexColor; + col = half4(r.r * r.a, col.g, b.b * b.a, max(max(r.a, b.a) * _ChromAberrAlpha, col.a)); + #endif + + //-------------------------------- + + //BLUR_ON + #if BLUR_ON + #if ATLAS_ON + #if !BLURISHD_ON + col = BlurHD(d.texcoord0.xy, _MainTex, sampler_MainTex, _BlurIntensity, (_MaxXUV - _MinXUV), (_MaxYUV - _MinYUV)) * d.vertexColor; + #else + col = Blur(d.texcoord0.xy, _MainTex, sampler_MainTex, _BlurIntensity * (_MaxXUV - _MinXUV)) * d.vertexColor; + #endif + #else + #if !BLURISHD_ON + col = BlurHD(d.texcoord0.xy, _MainTex, sampler_MainTex, _BlurIntensity, 1, 1) * d.vertexColor; + #else + col = Blur(d.texcoord0.xy, _MainTex, sampler_MainTex, _BlurIntensity) * d.vertexColor; + #endif + #endif + #endif + + //-------------------- + + //MOTIONBLUR_ON + #if MOTIONBLUR_ON + _MotionBlurAngle = _MotionBlurAngle * 3.1415926; + #define rot(n) mul(n, half2x2(cos(_MotionBlurAngle), -sin(_MotionBlurAngle), sin(_MotionBlurAngle), cos(_MotionBlurAngle))) + _MotionBlurDist = _MotionBlurDist * 0.005; + #if ATLAS_ON + _MotionBlurDist *= (_MaxXUV - _MinXUV); + #endif + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(-_MotionBlurDist, -_MotionBlurDist))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(-_MotionBlurDist * 2, -_MotionBlurDist * 2))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(-_MotionBlurDist * 3, -_MotionBlurDist * 3))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(-_MotionBlurDist * 4, -_MotionBlurDist * 4))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(_MotionBlurDist, _MotionBlurDist))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(_MotionBlurDist * 2, _MotionBlurDist * 2))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(_MotionBlurDist * 3, _MotionBlurDist * 3))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(_MotionBlurDist * 4, _MotionBlurDist * 4))); + col.rgb = col.rgb / 9; + #endif + //------------------------------------ + + //NEGATIVE_ON + #if NEGATIVE_ON + col.rgb = lerp(col.rgb, 1 - col.rgb, _NegativeAmount); + #endif + + //-------------- + half luminance = 0; + + //GREYSCALE_ON && !GREYSCALEOUTLINE_ON + #if GREYSCALE_ON && !GREYSCALEOUTLINE_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + luminance = saturate(luminance + _GreyscaleLuminosity); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _GreyscaleTintColor, _GreyscaleBlend); + #endif + //------------------------------------ + + //GHOST_ON + #if GHOST_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + half4 ghostResult; + ghostResult.a = saturate(luminance - _GhostTransparency) * col.a; + ghostResult.rgb = col.rgb * (luminance + _GhostColorBoost); + col = lerp(col, ghostResult, _GhostBlend); + #endif + //------------------------------------ + + //INNEROUTLINE_ON + #if INNEROUTLINE_ON + half3 innerT = abs(GetPixel(0, _InnerOutlineThickness, d.texcoord0.xy, _MainTex, sampler_MainTex) - GetPixel(0, -_InnerOutlineThickness, d.texcoord0.xy, _MainTex, sampler_MainTex)); + innerT += abs(GetPixel(_InnerOutlineThickness, 0, d.texcoord0.xy, _MainTex, sampler_MainTex) - GetPixel(-_InnerOutlineThickness, 0, d.texcoord0.xy, _MainTex, sampler_MainTex)); + #if !ONLYINNEROUTLINE_ON + innerT = (innerT / 2.0) * col.a * _InnerOutlineAlpha; + col.rgb += length(innerT) * _InnerOutlineColor.rgb * _InnerOutlineGlow; + #else + innerT *= col.a * _InnerOutlineAlpha; + col.rgb = length(innerT) * _InnerOutlineColor.rgb * _InnerOutlineGlow; + col.a = step(0.3, col.r+col.g+col.b); + #endif + #endif + //------------------------------------------------------- + + //HITEFFECT_ON + #if HITEFFECT_ON + col.rgb = lerp(col.rgb, _HitEffectColor.rgb * _HitEffectGlow, _HitEffectBlend); + #endif + //-------------------- + + //GRADIENT_ON + #if GRADIENT_ON + half2 tiledUvGrad = half2(uvRect.x / _MainTex_ST.x, uvRect.y / _MainTex_ST.y); + #if GRADIENT2COL_ON + _GradTopRightCol = _GradTopLeftCol; + _GradBotRightCol = _GradBotLeftCol; + #endif + #if RADIALGRADIENT_ON + half radialDist = 1 - length(tiledUvGrad - half2(0.5, 0.5)); + radialDist *= (_MainTex_TexelSize.w / _MainTex_TexelSize.z); + radialDist = saturate(_GradBoostX * radialDist); + half4 gradientResult = lerp(_GradTopLeftCol, _GradBotLeftCol, radialDist); + #else + half gradXLerpFactor = saturate(pow(tiledUvGrad.x, _GradBoostX)); + half4 gradientResult = lerp(lerp(_GradBotLeftCol, _GradBotRightCol, gradXLerpFactor), + lerp(_GradTopLeftCol, _GradTopRightCol, gradXLerpFactor), saturate(pow(tiledUvGrad.y, _GradBoostY))); + #endif + gradientResult = lerp(col, gradientResult, _GradBlend); + col.rgb = gradientResult.rgb * col.a; + col.a *= gradientResult.a; + #endif + //-------------------------------------------------------------------- + + //CONTRAST_ON + #if CONTRAST_ON + col.rgb = (col.rgb - float3(0.5, 0.5, 0.5)) * _Contrast + float3(0.5, 0.5, 0.5); + col.rgb += _Brightness; + #endif + + //------------------------------------------------------------------- + + //COLORSWAP_ON + #if COLORSWAP_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + half4 swapMask = SAMPLE_TEXTURE2D(_ColorSwapTex, sampler_ColorSwapTex, d.texcoord0.xy); + swapMask.rgb *= swapMask.a; + half3 redSwap = _ColorSwapRed * swapMask.r * saturate(luminance + _ColorSwapRedLuminosity); + half3 greenSwap = _ColorSwapGreen * swapMask.g * saturate(luminance + _ColorSwapGreenLuminosity); + half3 blueSwap = _ColorSwapBlue * swapMask.b * saturate(luminance + _ColorSwapBlueLuminosity); + swapMask.rgb = col.rgb * saturate(1 - swapMask.r - swapMask.g - swapMask.b); + col.rgb = lerp(col.rgb, swapMask.rgb + redSwap + greenSwap + blueSwap, _ColorSwapBlend); + #endif + //-------------------------------------------------------------------- + + //COLORRAMP_ON && !COLORRAMPOUTLINE_ON + #if COLORRAMP_ON && !COLORRAMPOUTLINE_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + luminance = saturate(luminance + _ColorRampLuminosity); + #if GRADIENTCOLORRAMP_ON + col.rgb = lerp(col.rgb, SAMPLE_TEXTURE2D(_ColorRampTexGradient, sampler_ColorRampTexGradient, half2(luminance, 0)).rgb, _ColorRampBlend); + #else + col.rgb = lerp(col.rgb, SAMPLE_TEXTURE2D(_ColorRampTex, sampler_ColorRampTex, half2(luminance, 0)).rgb, _ColorRampBlend); + #endif + #endif + //-------------------------------------------------------------------- + + //CHANGECOLOR_ON + #if CHANGECOLOR_ON + float3 currChangeColor = saturate(col.rgb); + luminance = 0.3 * currChangeColor.r + 0.59 * currChangeColor.g + 0.11 * currChangeColor.b; + luminance = saturate(luminance + _ColorChangeLuminosity); + half3 dif = abs(currChangeColor - _ColorChangeTarget.rgb); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _ColorChangeNewCol.rgb, + max(sign(1 - saturate(dif.x + dif.y + dif.z) - _ColorChangeTolerance), 0.0)); + #if CHANGECOLOR2_ON + dif = abs(currChangeColor - _ColorChangeTarget2.rgb); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _ColorChangeNewCol2.rgb, + max(sign(1 - saturate(dif.x + dif.y + dif.z) - _ColorChangeTolerance2), 0.0)); + #endif + #if CHANGECOLOR3_ON + dif = abs(currChangeColor - _ColorChangeTarget3.rgb); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _ColorChangeNewCol3.rgb, + max(sign(1 - saturate(dif.x + dif.y + dif.z) - _ColorChangeTolerance3), 0.0)); + #endif + #endif + //------------------------------------------------------- + + //POSTERIZE_ON && !POSTERIZEOUTLINE_ON + #if POSTERIZE_ON && !POSTERIZEOUTLINE_ON + col.rgb = pow(col.rgb, _PosterizeGamma) * _PosterizeNumColors; + col.rgb = floor(col.rgb) / _PosterizeNumColors; + col.rgb = pow(col.rgb, 1.0 / _PosterizeGamma); + #endif + //------------------------------------ + + //HSV_ON + #if HSV_ON + half3 resultHsv = half3(col.rgb); + half cosHsv = _HsvBright * _HsvSaturation * cos(_HsvShift * 3.14159265 / 180); + half sinHsv = _HsvBright * _HsvSaturation * sin(_HsvShift * 3.14159265 / 180); + resultHsv.x = (.299 * _HsvBright + .701 * cosHsv + .168 * sinHsv) * col.x + + (.587 * _HsvBright - .587 * cosHsv + .330 * sinHsv) * col.y + + (.114 * _HsvBright - .114 * cosHsv - .497 * sinHsv) * col.z; + resultHsv.y = (.299 * _HsvBright - .299 * cosHsv - .328 * sinHsv) *col.x + + (.587 * _HsvBright + .413 * cosHsv + .035 * sinHsv) * col.y + + (.114 * _HsvBright - .114 * cosHsv + .292 * sinHsv) * col.z; + resultHsv.z = (.299 * _HsvBright - .3 * cosHsv + 1.25 * sinHsv) * col.x + + (.587 * _HsvBright - .588 * cosHsv - 1.05 * sinHsv) * col.y + + (.114 * _HsvBright + .886 * cosHsv - .203 * sinHsv) * col.z; + col.rgb = resultHsv; + #endif + //------------------------------------------------------- + + //OVERLAY_ON + #if OVERLAY_ON + half2 overlayUvs = d.texcoord0.xy; + overlayUvs.x += ((_Time.y + randomSeed) * _OverlayTextureScrollXSpeed) % 1; + overlayUvs.y += ((_Time.y + randomSeed) * _OverlayTextureScrollYSpeed) % 1; + half4 overlayCol = SAMPLE_TEXTURE2D(_OverlayTex, sampler_OverlayTex, TRANSFORM_TEX(overlayUvs, _OverlayTex)); + overlayCol.rgb *= _OverlayColor.rgb * _OverlayGlow; + #if !OVERLAYMULT_ON + overlayCol.rgb *= overlayCol.a * _OverlayColor.rgb * _OverlayColor.a * _OverlayBlend; + col.rgb += overlayCol.rgb; + #else + overlayCol.a *= _OverlayColor.a; + col = lerp(col, col * overlayCol, _OverlayBlend); + #endif + #endif + + //--------------------------------- + + //OUTBASE_ON + #if OUTBASE_ON + #if OUTBASEPIXELPERF_ON + half2 destUv = half2(_OutlinePixelWidth * _MainTex_TexelSize.x, _OutlinePixelWidth * _MainTex_TexelSize.y); + #else + half2 destUv = half2(_OutlineWidth * _MainTex_TexelSize.x * 200, _OutlineWidth * _MainTex_TexelSize.y * 200); + #endif + + #if OUTDIST_ON + d.texcoord3.x += ((_Time.x + _RandomSeed) * _OutlineDistortTexXSpeed) % 1; + d.texcoord3.y += ((_Time.x + _RandomSeed) * _OutlineDistortTexYSpeed) % 1; + #if ATLAS_ON + d.texcoord3 = half2((d.texcoord3.x - _MinXUV) / (_MaxXUV - _MinXUV), (d.texcoord3.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half outDistortAmnt = (SAMPLE_TEXTURE2D(_OutlineDistortTex, sampler_OutlineDistortTex, d.texcoord3).r - 0.5) * 0.2 * _OutlineDistortAmount; + destUv.x += outDistortAmnt; + destUv.y += outDistortAmnt; + #endif + + half spriteLeft = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(destUv.x, 0)).a; + half spriteRight = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy - half2(destUv.x, 0)).a; + half spriteBottom = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(0, destUv.y)).a; + half spriteTop = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy - half2(0, destUv.y)).a; + half result = spriteLeft + spriteRight + spriteBottom + spriteTop; + + #if OUTBASE8DIR_ON + half spriteTopLeft = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(destUv.x, destUv.y)).a; + half spriteTopRight = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(-destUv.x, destUv.y)).a; + half spriteBotLeft = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(destUv.x, -destUv.y)).a; + half spriteBotRight = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(-destUv.x, -destUv.y)).a; + result = result + spriteTopLeft + spriteTopRight + spriteBotLeft + spriteBotRight; + #endif + + result = step(0.05, saturate(result)); + + #if OUTTEX_ON + d.texcoord1.x += ((_Time.x + _RandomSeed) * _OutlineTexXSpeed) % 1; + d.texcoord1.y += ((_Time.x + _RandomSeed) * _OutlineTexYSpeed) % 1; + #if ATLAS_ON + d.texcoord1 = half2((d.texcoord1.x - _MinXUV) / (_MaxXUV - _MinXUV), (d.texcoord1.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half4 tempOutColor = SAMPLE_TEXTURE2D(_OutlineTex, sampler_OutlineTex, d.texcoord1); + tempOutColor *= _OutlineColor; + _OutlineColor = tempOutColor; + #endif + + result *= (1 - originalAlpha) * _OutlineAlpha; + + half4 outline = _OutlineColor * d.vertexColor.a; + outline.rgb *= _OutlineGlow; + outline.a = result; + #if ONLYOUTLINE_ON + col = outline; + #else + col = lerp(col, outline, result); + #endif + #endif + //------------------------------------------------------- + + //FADE_ON + #if FADE_ON + half2 tiledUvFade1 = TRANSFORM_TEX(d.texcoord0, _FadeTex); + half2 tiledUvFade2 = TRANSFORM_TEX(d.texcoord0, _FadeBurnTex); + #if ATLAS_ON + tiledUvFade1 = half2((tiledUvFade1.x - _MinXUV) / (_MaxXUV - _MinXUV), (tiledUvFade1.y - _MinYUV) / (_MaxYUV - _MinYUV)); + tiledUvFade2 = half2((tiledUvFade2.x - _MinXUV) / (_MaxXUV - _MinXUV), (tiledUvFade2.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half fadeTemp = SAMPLE_TEXTURE2D(_FadeTex, sampler_FadeTex, tiledUvFade1).r; + half fade = smoothstep(_FadeAmount, _FadeAmount + _FadeBurnTransition, fadeTemp); + half fadeBurn = saturate(smoothstep(_FadeAmount - _FadeBurnWidth, _FadeAmount - _FadeBurnWidth + 0.1, fadeTemp) * _FadeAmount); + col.a *= fade; + _FadeBurnColor.rgb *= _FadeBurnGlow; + col += fadeBurn * SAMPLE_TEXTURE2D(_FadeBurnTex, sampler_FadeBurnTex, tiledUvFade2) * _FadeBurnColor * originalAlpha * (1 - col.a); + #endif + //------------------------------------------------------- + + //SHADOW_ON + #if SHADOW_ON + half shadowA = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(_ShadowX, _ShadowY)).a; + half preMultShadowMask = 1 - (saturate(shadowA - col.a) * (1 - col.a)); + col.rgb *= 1 - ((shadowA - col.a) * (1 - col.a)); + col.rgb += (_ShadowColor * shadowA) * (1 - col.a); + col.a = max(shadowA * _ShadowAlpha * d.vertexColor.a, col.a); + #endif + + //------------------------------------------------------- + + //GLOW_ON + #if GLOW_ON + half4 emission; + #if GLOWTEX_ON + emission = SAMPLE_TEXTURE2D(_GlowTex, sampler_GlowTex, d.texcoord0); + #else + emission = col; + #endif + + col.rgb *= _GlowGlobal; + emission.rgb *= emission.a * col.a * _Glow * _GlowColor; + col.rgb += emission.rgb; + #endif + //------------------------------------------------------- + + //COLORRAMP_ON && COLORRAMPOUTLINE_ON + #if COLORRAMP_ON && COLORRAMPOUTLINE_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + luminance = saturate(luminance + _ColorRampLuminosity); + #if GRADIENTCOLORRAMP_ON + col.rgb = lerp(col.rgb, SAMPLE_TEXTURE2D(_ColorRampTexGradient, sampler_ColorRampTexGradient, half2(luminance, 0)).rgb, _ColorRampBlend); + #else + col.rgb = lerp(col.rgb, SAMPLE_TEXTURE2D(_ColorRampTex, sampler_ColorRampTex, half2(luminance, 0)).rgb, _ColorRampBlend); + #endif + #endif + //--------------- + + //GREYSCALE_ON && GREYSCALEOUTLINE_ON + #if GREYSCALE_ON && GREYSCALEOUTLINE_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + luminance = saturate(luminance + _GreyscaleLuminosity); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _GreyscaleTintColor, _GreyscaleBlend); + #endif + + //----------------------------------- + + //POSTERIZE_ON && POSTERIZEOUTLINE_ON + #if POSTERIZE_ON && POSTERIZEOUTLINE_ON + col.rgb = pow(col.rgb, _PosterizeGamma) * _PosterizeNumColors; + col.rgb = floor(col.rgb) / _PosterizeNumColors; + col.rgb = pow(col.rgb, 1.0 / _PosterizeGamma); + #endif + + //----------------------------------- + + //SHINE_ON + #if SHINE_ON + half2 uvShine = uvRect; + half cosAngle = cos(_ShineRotate); + half sinAngle = sin(_ShineRotate); + half2x2 rot = half2x2(cosAngle, -sinAngle, sinAngle, cosAngle); + uvShine -= half2(0.5, 0.5); + uvShine = mul(rot, uvShine); + uvShine += half2(0.5, 0.5); + half shineMask = SAMPLE_TEXTURE2D(_ShineMask, sampler_ShineMask, d.texcoord0.xy).a; + half currentDistanceProjection = (uvShine.x + uvShine.y) / 2; + half whitePower = 1 - (abs(currentDistanceProjection - _ShineLocation) / _ShineWidth); + col.rgb += col.a * whitePower * _ShineGlow * max(sign(currentDistanceProjection - (_ShineLocation - _ShineWidth)), 0.0) + * max(sign((_ShineLocation + _ShineWidth) - currentDistanceProjection), 0.0) * _ShineColor * shineMask; + #endif + + //----------------------------------- + + //HOLOGRAM_ON + #if HOLOGRAM_ON + half totalHologram = _HologramStripesAmount + _HologramUnmodAmount; + half hologramYCoord = ((uvRect.y + (((_Time.x + randomSeed) % 1) * _HologramStripesSpeed)) % totalHologram) / totalHologram; + hologramYCoord = abs(hologramYCoord); + half alpha = RemapFloat(saturate(hologramYCoord - (_HologramUnmodAmount/totalHologram)), 0.0, 1.0, _HologramMinAlpha, saturate(_HologramMaxAlpha)); + half hologramMask = max(sign((_HologramUnmodAmount/totalHologram) - hologramYCoord), 0.0); + half4 hologramResult = col; + hologramResult.a *= lerp(alpha, 1, hologramMask); + hologramResult.rgb *= max(1, _HologramMaxAlpha * max(sign(hologramYCoord - (_HologramUnmodAmount/totalHologram)), 0.0)); + hologramMask = 1 - step(0.01,hologramMask); + hologramResult.rgb += hologramMask * _HologramStripeColor * col.a; + col = lerp(col, hologramResult, _HologramBlend); + #endif + + //----------------------------------- + + //FLICKER_ON + #if FLICKER_ON + col.a *= saturate(col.a * step(frac(0.05 + (_Time.w + randomSeed) * _FlickerFreq), 1 - _FlickerPercent) + _FlickerAlpha); + #endif + //----------------------------------- + + //ALPHACUTOFF_ON + + //ALPHAROUND_ON + + //ALPHAOUTLINE_ON + #if ALPHAOUTLINE_ON + half alphaOutlineRes = pow(1 - col.a, max(_AlphaOutlinePower, 0.0001)) * step(_AlphaOutlineMinAlpha, col.a) * _AlphaOutlineBlend; + col.rgb = lerp(col.rgb, _AlphaOutlineColor.rgb * _AlphaOutlineGlow, alphaOutlineRes); + col.a = lerp(col.a, 1, alphaOutlineRes > 1); + #endif + //------------------------------------------------------- + + //FOG_ON + + //------------------ + + col *= _Color; + o.Albedo = col; + col.a *= _Alpha; + clip(col.a - _AlphaCutoffValue - 0.01); + o.Alpha = _Color.a; + } + + + + + + void ChainSurfaceFunction(inout Surface l, inout ShaderData d) + { + Ext_SurfaceFunction0(l, d); + // Ext_SurfaceFunction1(l, d); + // Ext_SurfaceFunction2(l, d); + // Ext_SurfaceFunction3(l, d); + // Ext_SurfaceFunction4(l, d); + // Ext_SurfaceFunction5(l, d); + // Ext_SurfaceFunction6(l, d); + // Ext_SurfaceFunction7(l, d); + // Ext_SurfaceFunction8(l, d); + // Ext_SurfaceFunction9(l, d); + // Ext_SurfaceFunction10(l, d); + // Ext_SurfaceFunction11(l, d); + // Ext_SurfaceFunction12(l, d); + // Ext_SurfaceFunction13(l, d); + // Ext_SurfaceFunction14(l, d); + // Ext_SurfaceFunction15(l, d); + // Ext_SurfaceFunction16(l, d); + // Ext_SurfaceFunction17(l, d); + // Ext_SurfaceFunction18(l, d); + // Ext_SurfaceFunction19(l, d); + // Ext_SurfaceFunction20(l, d); + // Ext_SurfaceFunction21(l, d); + // Ext_SurfaceFunction22(l, d); + // Ext_SurfaceFunction23(l, d); + // Ext_SurfaceFunction24(l, d); + // Ext_SurfaceFunction25(l, d); + // Ext_SurfaceFunction26(l, d); + // Ext_SurfaceFunction27(l, d); + // Ext_SurfaceFunction28(l, d); + // Ext_SurfaceFunction29(l, d); + } + +#if !_DECALSHADER + + void ChainModifyVertex(inout VertexData v, inout VertexToPixel v2p, float4 time) + { + ExtraV2F d; + + ZERO_INITIALIZE(ExtraV2F, d); + ZERO_INITIALIZE(Blackboard, d.blackboard); + // due to motion vectors in HDRP, we need to use the last + // time in certain spots. So if you are going to use _Time to adjust vertices, + // you need to use this time or motion vectors will break. + d.time = time; + + Ext_ModifyVertex0(v, d); + // Ext_ModifyVertex1(v, d); + // Ext_ModifyVertex2(v, d); + // Ext_ModifyVertex3(v, d); + // Ext_ModifyVertex4(v, d); + // Ext_ModifyVertex5(v, d); + // Ext_ModifyVertex6(v, d); + // Ext_ModifyVertex7(v, d); + // Ext_ModifyVertex8(v, d); + // Ext_ModifyVertex9(v, d); + // Ext_ModifyVertex10(v, d); + // Ext_ModifyVertex11(v, d); + // Ext_ModifyVertex12(v, d); + // Ext_ModifyVertex13(v, d); + // Ext_ModifyVertex14(v, d); + // Ext_ModifyVertex15(v, d); + // Ext_ModifyVertex16(v, d); + // Ext_ModifyVertex17(v, d); + // Ext_ModifyVertex18(v, d); + // Ext_ModifyVertex19(v, d); + // Ext_ModifyVertex20(v, d); + // Ext_ModifyVertex21(v, d); + // Ext_ModifyVertex22(v, d); + // Ext_ModifyVertex23(v, d); + // Ext_ModifyVertex24(v, d); + // Ext_ModifyVertex25(v, d); + // Ext_ModifyVertex26(v, d); + // Ext_ModifyVertex27(v, d); + // Ext_ModifyVertex28(v, d); + // Ext_ModifyVertex29(v, d); + + + // #if %EXTRAV2F0REQUIREKEY% + // v2p.extraV2F0 = d.extraV2F0; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // v2p.extraV2F1 = d.extraV2F1; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // v2p.extraV2F2 = d.extraV2F2; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // v2p.extraV2F3 = d.extraV2F3; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // v2p.extraV2F4 = d.extraV2F4; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // v2p.extraV2F5 = d.extraV2F5; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // v2p.extraV2F6 = d.extraV2F6; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // v2p.extraV2F7 = d.extraV2F7; + // #endif + } + + void ChainModifyTessellatedVertex(inout VertexData v, inout VertexToPixel v2p) + { + ExtraV2F d; + ZERO_INITIALIZE(ExtraV2F, d); + ZERO_INITIALIZE(Blackboard, d.blackboard); + + // #if %EXTRAV2F0REQUIREKEY% + // d.extraV2F0 = v2p.extraV2F0; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // d.extraV2F1 = v2p.extraV2F1; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // d.extraV2F2 = v2p.extraV2F2; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // d.extraV2F3 = v2p.extraV2F3; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // d.extraV2F4 = v2p.extraV2F4; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // d.extraV2F5 = v2p.extraV2F5; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // d.extraV2F6 = v2p.extraV2F6; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // d.extraV2F7 = v2p.extraV2F7; + // #endif + + + // Ext_ModifyTessellatedVertex0(v, d); + // Ext_ModifyTessellatedVertex1(v, d); + // Ext_ModifyTessellatedVertex2(v, d); + // Ext_ModifyTessellatedVertex3(v, d); + // Ext_ModifyTessellatedVertex4(v, d); + // Ext_ModifyTessellatedVertex5(v, d); + // Ext_ModifyTessellatedVertex6(v, d); + // Ext_ModifyTessellatedVertex7(v, d); + // Ext_ModifyTessellatedVertex8(v, d); + // Ext_ModifyTessellatedVertex9(v, d); + // Ext_ModifyTessellatedVertex10(v, d); + // Ext_ModifyTessellatedVertex11(v, d); + // Ext_ModifyTessellatedVertex12(v, d); + // Ext_ModifyTessellatedVertex13(v, d); + // Ext_ModifyTessellatedVertex14(v, d); + // Ext_ModifyTessellatedVertex15(v, d); + // Ext_ModifyTessellatedVertex16(v, d); + // Ext_ModifyTessellatedVertex17(v, d); + // Ext_ModifyTessellatedVertex18(v, d); + // Ext_ModifyTessellatedVertex19(v, d); + // Ext_ModifyTessellatedVertex20(v, d); + // Ext_ModifyTessellatedVertex21(v, d); + // Ext_ModifyTessellatedVertex22(v, d); + // Ext_ModifyTessellatedVertex23(v, d); + // Ext_ModifyTessellatedVertex24(v, d); + // Ext_ModifyTessellatedVertex25(v, d); + // Ext_ModifyTessellatedVertex26(v, d); + // Ext_ModifyTessellatedVertex27(v, d); + // Ext_ModifyTessellatedVertex28(v, d); + // Ext_ModifyTessellatedVertex29(v, d); + + // #if %EXTRAV2F0REQUIREKEY% + // v2p.extraV2F0 = d.extraV2F0; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // v2p.extraV2F1 = d.extraV2F1; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // v2p.extraV2F2 = d.extraV2F2; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // v2p.extraV2F3 = d.extraV2F3; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // v2p.extraV2F4 = d.extraV2F4; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // v2p.extraV2F5 = d.extraV2F5; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // v2p.extraV2F6 = d.extraV2F6; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // v2p.extraV2F7 = d.extraV2F7; + // #endif + } + + void ChainFinalColorForward(inout Surface l, inout ShaderData d, inout half4 color) + { + // Ext_FinalColorForward0(l, d, color); + // Ext_FinalColorForward1(l, d, color); + // Ext_FinalColorForward2(l, d, color); + // Ext_FinalColorForward3(l, d, color); + // Ext_FinalColorForward4(l, d, color); + // Ext_FinalColorForward5(l, d, color); + // Ext_FinalColorForward6(l, d, color); + // Ext_FinalColorForward7(l, d, color); + // Ext_FinalColorForward8(l, d, color); + // Ext_FinalColorForward9(l, d, color); + // Ext_FinalColorForward10(l, d, color); + // Ext_FinalColorForward11(l, d, color); + // Ext_FinalColorForward12(l, d, color); + // Ext_FinalColorForward13(l, d, color); + // Ext_FinalColorForward14(l, d, color); + // Ext_FinalColorForward15(l, d, color); + // Ext_FinalColorForward16(l, d, color); + // Ext_FinalColorForward17(l, d, color); + // Ext_FinalColorForward18(l, d, color); + // Ext_FinalColorForward19(l, d, color); + // Ext_FinalColorForward20(l, d, color); + // Ext_FinalColorForward21(l, d, color); + // Ext_FinalColorForward22(l, d, color); + // Ext_FinalColorForward23(l, d, color); + // Ext_FinalColorForward24(l, d, color); + // Ext_FinalColorForward25(l, d, color); + // Ext_FinalColorForward26(l, d, color); + // Ext_FinalColorForward27(l, d, color); + // Ext_FinalColorForward28(l, d, color); + // Ext_FinalColorForward29(l, d, color); + } + + void ChainFinalGBufferStandard(inout Surface s, inout ShaderData d, inout half4 GBuffer0, inout half4 GBuffer1, inout half4 GBuffer2, inout half4 outEmission, inout half4 outShadowMask) + { + // Ext_FinalGBufferStandard0(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard1(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard2(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard3(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard4(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard5(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard6(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard7(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard8(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard9(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard10(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard11(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard12(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard13(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard14(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard15(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard16(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard17(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard18(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard19(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard20(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard21(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard22(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard23(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard24(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard25(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard26(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard27(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard28(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard29(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + } +#endif + + + + + +#if _DECALSHADER + + ShaderData CreateShaderData(SurfaceDescriptionInputs IN) + { + ShaderData d = (ShaderData)0; + d.TBNMatrix = float3x3(IN.WorldSpaceTangent, IN.WorldSpaceBiTangent, IN.WorldSpaceNormal); + d.worldSpaceNormal = IN.WorldSpaceNormal; + d.worldSpaceTangent = IN.WorldSpaceTangent; + + d.worldSpacePosition = IN.WorldSpacePosition; + d.texcoord0 = IN.uv0.xyxy; + d.screenPos = IN.ScreenPosition; + + d.worldSpaceViewDir = normalize(_WorldSpaceCameraPos - d.worldSpacePosition); + + d.tangentSpaceViewDir = mul(d.TBNMatrix, d.worldSpaceViewDir); + + // these rarely get used, so we back transform them. Usually will be stripped. + #if _HDRP + // d.localSpacePosition = mul(GetWorldToObjectMatrix(), float4(GetCameraRelativePositionWS(d.worldSpacePosition), 1)).xyz; + #else + // d.localSpacePosition = mul(GetWorldToObjectMatrix(), float4(d.worldSpacePosition, 1)).xyz; + #endif + // d.localSpaceNormal = normalize(mul((float3x3)GetWorldToObjectMatrix(), d.worldSpaceNormal)); + // d.localSpaceTangent = normalize(mul((float3x3)GetWorldToObjectMatrix(), d.worldSpaceTangent.xyz)); + + // #if %SCREENPOSREQUIREKEY% + // d.screenUV = (IN.ScreenPosition.xy / max(0.01, IN.ScreenPosition.w)); + // #endif + + return d; + } +#else + + ShaderData CreateShaderData(VertexToPixel i + #if NEED_FACING + , bool facing + #endif + ) + { + ShaderData d = (ShaderData)0; + d.clipPos = i.pos; + d.worldSpacePosition = i.worldPos; + + d.worldSpaceNormal = normalize(i.worldNormal); + d.worldSpaceTangent.xyz = normalize(i.worldTangent.xyz); + + d.tangentSign = i.worldTangent.w * unity_WorldTransformParams.w; + float3 bitangent = cross(d.worldSpaceTangent.xyz, d.worldSpaceNormal) * d.tangentSign; + + d.TBNMatrix = float3x3(d.worldSpaceTangent, -bitangent, d.worldSpaceNormal); + d.worldSpaceViewDir = normalize(_WorldSpaceCameraPos - i.worldPos); + + d.tangentSpaceViewDir = mul(d.TBNMatrix, d.worldSpaceViewDir); + d.texcoord0 = i.texcoord0; + d.texcoord1 = i.texcoord1; + d.texcoord2 = i.texcoord2; + + // #if %TEXCOORD3REQUIREKEY% + d.texcoord3 = i.texcoord3; + // #endif + + // d.isFrontFace = facing; + // #if %VERTEXCOLORREQUIREKEY% + d.vertexColor = i.vertexColor; + // #endif + + // these rarely get used, so we back transform them. Usually will be stripped. + #if _HDRP + // d.localSpacePosition = mul(GetWorldToObjectMatrix(), float4(GetCameraRelativePositionWS(i.worldPos), 1)).xyz; + #else + // d.localSpacePosition = mul(GetWorldToObjectMatrix(), float4(i.worldPos, 1)).xyz; + #endif + // d.localSpaceNormal = normalize(mul((float3x3)GetWorldToObjectMatrix(), i.worldNormal)); + // d.localSpaceTangent = normalize(mul((float3x3)GetWorldToObjectMatrix(), i.worldTangent.xyz)); + + // #if %SCREENPOSREQUIREKEY% + // d.screenPos = i.screenPos; + // d.screenUV = (i.screenPos.xy / i.screenPos.w); + // #endif + + + // #if %EXTRAV2F0REQUIREKEY% + // d.extraV2F0 = i.extraV2F0; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // d.extraV2F1 = i.extraV2F1; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // d.extraV2F2 = i.extraV2F2; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // d.extraV2F3 = i.extraV2F3; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // d.extraV2F4 = i.extraV2F4; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // d.extraV2F5 = i.extraV2F5; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // d.extraV2F6 = i.extraV2F6; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // d.extraV2F7 = i.extraV2F7; + // #endif + + return d; + } + +#endif + + + #if defined(_PASSSHADOW) + float3 _LightDirection; + float3 _LightPosition; + #endif + + #if (_PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR))) + + #define GetWorldToViewMatrix() _ViewMatrix + #define UNITY_MATRIX_I_V _InvViewMatrix + #define GetViewToHClipMatrix() OptimizeProjectionMatrix(_ProjMatrix) + #define UNITY_MATRIX_I_P _InvProjMatrix + #define GetWorldToHClipMatrix() _ViewProjMatrix + #define UNITY_MATRIX_I_VP _InvViewProjMatrix + #define UNITY_MATRIX_UNJITTERED_VP _NonJitteredViewProjMatrix + #define UNITY_MATRIX_PREV_VP _PrevViewProjMatrix + #define UNITY_MATRIX_PREV_I_VP _PrevInvViewProjMatrix + + void MotionVectorPositionZBias(VertexToPixel input) + { + #if UNITY_REVERSED_Z + input.pos.z -= unity_MotionVectorsParams.z * input.pos.w; + #else + input.pos.z += unity_MotionVectorsParams.z * input.pos.w; + #endif + } + + #endif + + // vertex shader + VertexToPixel Vert (VertexData v) + { + VertexToPixel o = (VertexToPixel)0; + + UNITY_SETUP_INSTANCE_ID(v); + UNITY_TRANSFER_INSTANCE_ID(v, o); + UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o); + + + #if _URP && (_PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR))) + VertexData previousMesh = v; + #endif + #if !_TESSELLATION_ON + ChainModifyVertex(v, o, _Time); + #endif + + o.texcoord0 = v.texcoord0; + o.texcoord1 = v.texcoord1; + o.texcoord2 = v.texcoord2; + + // #if %TEXCOORD3REQUIREKEY% + o.texcoord3 = v.texcoord3; + // #endif + + // #if %VERTEXCOLORREQUIREKEY% + o.vertexColor = v.vertexColor; + // #endif + + // This return the camera relative position (if enable) + float3 positionWS = TransformObjectToWorld(v.vertex.xyz); + float3 normalWS = TransformObjectToWorldNormal(v.normal); + float4 tangentWS = float4(TransformObjectToWorldDir(v.tangent.xyz), v.tangent.w); + + VertexPositionInputs vertexInput = GetVertexPositionInputs(v.vertex.xyz); + o.worldPos = positionWS; + o.worldNormal = normalWS; + o.worldTangent = tangentWS; + + + // For some very odd reason, in 2021.2, we can't use Unity's defines, but have to use our own.. + #if _PASSSHADOW + #if _CASTING_PUNCTUAL_LIGHT_SHADOW + float3 lightDirectionWS = normalize(_LightPosition - o.worldPos); + #else + float3 lightDirectionWS = _LightDirection; + #endif + // Define shadow pass specific clip position for Universal + o.pos = TransformWorldToHClip(ApplyShadowBias(o.worldPos, o.worldNormal, lightDirectionWS)); + #if UNITY_REVERSED_Z + o.pos.z = min(o.pos.z, UNITY_NEAR_CLIP_VALUE); + #else + o.pos.z = max(o.pos.z, UNITY_NEAR_CLIP_VALUE); + #endif + #elif _PASSMETA + o.pos = MetaVertexPosition(float4(v.vertex.xyz, 0), v.texcoord1.xy, v.texcoord2.xy, unity_LightmapST, unity_DynamicLightmapST); + #else + o.pos = TransformWorldToHClip(o.worldPos); + #endif + + // #if %SCREENPOSREQUIREKEY% + // o.screenPos = ComputeScreenPos(o.pos, _ProjectionParams.x); + // #endif + + + #if _PASSFORWARD || _PASSGBUFFER + float2 uv1 = v.texcoord1.xy; + OUTPUT_LIGHTMAP_UV(uv1, unity_LightmapST, o.lightmapUV); + o.texcoord1.xy = uv1; + #if UNITY_VERSION < 60000009 + OUTPUT_SH(o.worldNormal, o.sh); + #endif + + #if defined(DYNAMICLIGHTMAP_ON) + o.dynamicLightmapUV.xy = v.texcoord2.xy * unity_DynamicLightmapST.xy + unity_DynamicLightmapST.zw; + #if UNITY_VERSION >= 60000009 + OUTPUT_SH(o.worldNormal, o.sh); + #endif + #elif (defined(PROBE_VOLUMES_L1) || defined(PROBE_VOLUMES_L2)) && UNITY_VERSION >= 60000009 + OUTPUT_SH4(vertexInput.positionWS, o.worldNormal.xyz, GetWorldSpaceNormalizeViewDir(vertexInput.positionWS), o.sh, o.probeOcclusion); + #endif + #endif + + #ifdef VARYINGS_NEED_FOG_AND_VERTEX_LIGHT + half fogFactor = 0; + #if defined(_FOG_FRAGMENT) + fogFactor = ComputeFogFactor(o.pos.z); + #endif + #if _BAKEDLIT + o.fogFactorAndVertexLight = half4(fogFactor, 0, 0, 0); + #else + half3 vertexLight = VertexLighting(o.worldPos, o.worldNormal); + o.fogFactorAndVertexLight = half4(fogFactor, vertexLight); + #endif + #endif + + #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR) + o.shadowCoord = GetShadowCoord(vertexInput); + #endif + + #if _URP && (_PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR))) + #if !defined(TESSELLATION_ON) + MotionVectorPositionZBias(o); + #endif + + o.previousPositionCS = float4(0.0, 0.0, 0.0, 1.0); + // Note: unity_MotionVectorsParams.y is 0 is forceNoMotion is enabled + bool forceNoMotion = unity_MotionVectorsParams.y == 0.0; + + if (!forceNoMotion) + { + #if defined(HAVE_VFX_MODIFICATION) + float3 previousPositionOS = currentFrameMvData.vfxParticlePositionOS; + #if defined(VFX_FEATURE_MOTION_VECTORS_VERTS) + const bool applyDeformation = false; + #else + const bool applyDeformation = true; + #endif + #else + const bool hasDeformation = unity_MotionVectorsParams.x == 1; // Mesh has skinned deformation + float3 previousPositionOS = hasDeformation ? previousMesh.previousPositionOS : previousMesh.vertex.xyz; + + #if defined(AUTOMATIC_TIME_BASED_MOTION_VECTORS) && defined(GRAPH_VERTEX_USES_TIME_PARAMETERS_INPUT) + const bool applyDeformation = true; + #else + const bool applyDeformation = hasDeformation; + #endif + #endif + // TODO + #if defined(FEATURES_GRAPH_VERTEX) + if (applyDeformation) + previousPositionOS = GetLastFrameDeformedPosition(previousMesh, currentFrameMvData, previousPositionOS); + else + previousPositionOS = previousMesh.positionOS; + + #if defined(FEATURES_GRAPH_VERTEX_MOTION_VECTOR_OUTPUT) + previousPositionOS -= previousMesh.precomputedVelocity; + #endif + #endif + + #if defined(UNITY_DOTS_INSTANCING_ENABLED) && defined(DOTS_DEFORMED) + // Deformed vertices in DOTS are not cumulative with built-in Unity skinning/blend shapes + // Needs to be called after vertex modification has been applied otherwise it will be + // overwritten by Compute Deform node + ApplyPreviousFrameDeformedVertexPosition(previousMesh.vertexID, previousPositionOS); + #endif + #if defined (_ADD_PRECOMPUTED_VELOCITY) + previousPositionOS -= previousMesh.precomputedVelocity; + #endif + o.positionCS = mul(UNITY_MATRIX_UNJITTERED_VP, float4(positionWS, 1.0f)); + + #if defined(HAVE_VFX_MODIFICATION) + #if defined(VFX_FEATURE_MOTION_VECTORS_VERTS) + #if defined(FEATURES_GRAPH_VERTEX_MOTION_VECTOR_OUTPUT) || defined(_ADD_PRECOMPUTED_VELOCITY) + #error Unexpected fast path rendering VFX motion vector while there are vertex modification afterwards. + #endif + o.previousPositionCS = VFXGetPreviousClipPosition(previousMesh, currentFrameMvData.vfxElementAttributes, o.positionCS); + #else + #if VFX_WORLD_SPACE + //previousPositionOS is already in world space + const float3 previousPositionWS = previousPositionOS; + #else + const float3 previousPositionWS = mul(UNITY_PREV_MATRIX_M, float4(previousPositionOS, 1.0f)).xyz; + #endif + o.previousPositionCS = mul(UNITY_MATRIX_PREV_VP, float4(previousPositionWS, 1.0f)); + #endif + #else + o.previousPositionCS = mul(UNITY_MATRIX_PREV_VP, mul(UNITY_PREV_MATRIX_M, float4(previousPositionOS, 1))); + #endif + } + #endif + + return o; + } + + + + + #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/UnityGBuffer.hlsl" + + // fragment shader + FragmentOutput Frag (VertexToPixel IN + #ifdef _DEPTHOFFSET_ON + , out float outputDepth : SV_Depth + #endif + #if NEED_FACING + , bool facing : SV_IsFrontFace + #endif + ) + { + UNITY_SETUP_INSTANCE_ID(IN); + UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX(IN); + + #if defined(LOD_FADE_CROSSFADE) + LODFadeCrossFade(IN.pos); + #endif + + ShaderData d = CreateShaderData(IN + #if NEED_FACING + , facing + #endif + ); + Surface l = (Surface)0; + + #ifdef _DEPTHOFFSET_ON + l.outputDepth = outputDepth; + #endif + + l.Albedo = half3(0.5, 0.5, 0.5); + l.Normal = float3(0,0,1); + l.Occlusion = 1; + l.Alpha = 1; + + ChainSurfaceFunction(l, d); + + #ifdef _DEPTHOFFSET_ON + outputDepth = l.outputDepth; + #endif + + #if _USESPECULAR || _SIMPLELIT + float3 specular = l.Specular; + float metallic = 0; + #else + float3 specular = 0; + float metallic = l.Metallic; + #endif + + InputData inputData = (InputData)0; + + inputData.positionWS = IN.worldPos; + #if _WORLDSPACENORMAL + inputData.normalWS = l.Normal; + #else + inputData.normalWS = normalize(TangentToWorldSpace(d, l.Normal)); + #endif + + inputData.viewDirectionWS = SafeNormalize(d.worldSpaceViewDir); + + + #if defined(MAIN_LIGHT_CALCULATE_SHADOWS) + inputData.shadowCoord = TransformWorldToShadowCoord(inputData.positionWS); + #else + inputData.shadowCoord = float4(0, 0, 0, 0); + #endif + + //inputData.fogCoord = IN.fogFactorAndVertexLight.x; + InitializeInputDataFog(float4(IN.worldPos, 1.0), IN.fogFactorAndVertexLight.x); + inputData.vertexLighting = IN.fogFactorAndVertexLight.yzw; + + + #if defined(_OVERRIDE_BAKEDGI) + inputData.bakedGI = l.DiffuseGI; + l.Emission += l.SpecularGI; + #else + #if defined(DYNAMICLIGHTMAP_ON) + inputData.bakedGI = SAMPLE_GI(IN.lightmapUV, IN.dynamicLightmapUV.xy, IN.sh, inputData.normalWS); + #elif defined(PROBE_VOLUMES_L1) || defined(PROBE_VOLUMES_L2) + #if UNITY_VERSION >= 60000009 + inputData.bakedGI = SAMPLE_GI(IN.sh, IN.worldPos, inputData.normalWS, inputData.viewDirectionWS, IN.pos, IN.probeOcclusion, inputData.shadowMask); + #else + inputData.bakedGI = SAMPLE_GI(IN.sh, IN.worldPos, inputData.normalWS, inputData.viewDirectionWS, IN.pos); + #endif + #else + inputData.bakedGI = SAMPLE_GI(IN.lightmapUV, IN.sh, inputData.normalWS); + #endif + #endif + + inputData.normalizedScreenSpaceUV = GetNormalizedScreenSpaceUV(IN.pos); + inputData.shadowMask = SAMPLE_SHADOWMASK(IN.lightmapUV); + + #if defined(DEBUG_DISPLAY) + #if defined(DYNAMICLIGHTMAP_ON) + inputData.dynamicLightmapUV = IN.dynamicLightmapUV.xy; + #endif + #if defined(LIGHTMAP_ON) + inputData.staticLightmapUV = IN.lightmapUV; + #else + inputData.vertexSH = IN.sh; + #endif + #endif + + #ifdef _DBUFFER + ApplyDecal(IN.pos, + l.Albedo, + specular, + inputData.normalWS, + metallic, + l.Occlusion, + l.Smoothness); + #endif + + BRDFData brdfData; + InitializeBRDFData(l.Albedo, metallic, specular, l.Smoothness, l.Alpha, brdfData); + Light mainLight = GetMainLight(inputData.shadowCoord, inputData.positionWS, inputData.shadowMask); + MixRealtimeAndBakedGI(mainLight, inputData.normalWS, inputData.bakedGI, inputData.shadowMask); + half3 color = GlobalIllumination(brdfData, inputData.bakedGI, l.Occlusion, inputData.positionWS, inputData.normalWS, inputData.viewDirectionWS); + + return BRDFDataToGbuffer(brdfData, inputData, l.Smoothness, l.Emission + color, l.Occlusion); + } + + ENDHLSL + + } + + + + Pass + { + Name "ShadowCaster" + Tags + { + "LightMode" = "ShadowCaster" + } + + // Render State + Blend One Zero, One Zero + Cull Back + ZTest LEqual + ZWrite On + // ColorMask: + + Tags { "RenderType" = "Opaque" "Queue" = "Geometry" "PreviewType" = "Plane" } + Cull [_CullingOption] + ZWrite [_ZWrite] + ZTest [_ZTestMode] + + + HLSLPROGRAM + + #pragma vertex Vert + #pragma fragment Frag + + #pragma target 3.0 + + #pragma prefer_hlslcc gles + #pragma exclude_renderers d3d11_9x + #pragma multi_compile_instancing + + #pragma multi_compile_vertex _ _CASTING_PUNCTUAL_LIGHT_SHADOW + #pragma multi_compile_fragment _ LOD_FADE_CROSSFADE + + #define _NORMAL_DROPOFF_TS 1 + #define ATTRIBUTES_NEED_NORMAL + #define ATTRIBUTES_NEED_TANGENT + #define _PASSSHADOW 1 + + + #pragma shader_feature_local GLOW_ON + #pragma shader_feature_local FADE_ON + #pragma shader_feature_local OUTBASE_ON + #pragma shader_feature_local ONLYOUTLINE_ON + #pragma shader_feature_local GRADIENT_ON + #pragma shader_feature_local GRADIENT2COL_ON + #pragma shader_feature_local RADIALGRADIENT_ON + #pragma shader_feature_local COLORSWAP_ON + #pragma shader_feature_local HSV_ON + #pragma shader_feature_local CHANGECOLOR_ON + #pragma shader_feature_local CHANGECOLOR2_ON + #pragma shader_feature_local CHANGECOLOR3_ON + #pragma shader_feature_local COLORRAMP_ON + #pragma shader_feature_local GRADIENTCOLORRAMP_ON + #pragma shader_feature_local HITEFFECT_ON + #pragma shader_feature_local NEGATIVE_ON + #pragma shader_feature_local PIXELATE_ON + #pragma shader_feature_local GREYSCALE_ON + #pragma shader_feature_local POSTERIZE_ON + #pragma shader_feature_local BLUR_ON + #pragma shader_feature_local MOTIONBLUR_ON + #pragma shader_feature_local GHOST_ON + #pragma shader_feature_local ALPHAOUTLINE_ON + #pragma shader_feature_local INNEROUTLINE_ON + #pragma shader_feature_local ONLYINNEROUTLINE_ON + #pragma shader_feature_local HOLOGRAM_ON + #pragma shader_feature_local CHROMABERR_ON + #pragma shader_feature_local GLITCH_ON + #pragma shader_feature_local FLICKER_ON + #pragma shader_feature_local SHADOW_ON + #pragma shader_feature_local SHINE_ON + #pragma shader_feature_local CONTRAST_ON + #pragma shader_feature_local OVERLAY_ON + #pragma shader_feature_local OVERLAYMULT_ON + #pragma shader_feature_local DOODLE_ON + #pragma shader_feature_local WIND_ON + #pragma shader_feature_local WAVEUV_ON + #pragma shader_feature_local ROUNDWAVEUV_ON + #pragma shader_feature_local RECTSIZE_ON + #pragma shader_feature_local OFFSETUV_ON + #pragma shader_feature_local CLIPPING_ON + #pragma shader_feature_local RADIALCLIPPING_ON + #pragma shader_feature_local TEXTURESCROLL_ON + #pragma shader_feature_local ZOOMUV_ON + #pragma shader_feature_local DISTORT_ON + #pragma shader_feature_local WARP_ON + #pragma shader_feature_local TWISTUV_ON + #pragma shader_feature_local ROTATEUV_ON + #pragma shader_feature_local POLARUV_ON + #pragma shader_feature_local FISHEYE_ON + #pragma shader_feature_local PINCH_ON + #pragma shader_feature_local SHAKEUV_ON + + #pragma shader_feature_local GLOWTEX_ON + #pragma shader_feature_local OUTTEX_ON + #pragma shader_feature_local OUTDIST_ON + #pragma shader_feature_local OUTBASE8DIR_ON + #pragma shader_feature_local OUTBASEPIXELPERF_ON + #pragma shader_feature_local COLORRAMPOUTLINE_ON + #pragma shader_feature_local GREYSCALEOUTLINE_ON + #pragma shader_feature_local POSTERIZEOUTLINE_ON + #pragma shader_feature_local BLURISHD_ON + #pragma shader_feature_local MANUALWIND_ON + #pragma shader_feature_local ATLAS_ON + #pragma shader_feature_local PREMULTIPLYALPHA_ON + + #pragma shader_feature BILBOARD_ON + #pragma shader_feature BILBOARDY_ON + + #pragma shader_feature NORMALMAP_ON + + + #define _URP 1 +#define _USINGTEXCOORD1 1 +#define _USINGTEXCOORD2 1 + + + #include_with_pragmas "Packages/com.unity.render-pipelines.universal/ShaderLibrary/DOTS.hlsl" + #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.universal/ShaderLibrary/Input.hlsl" + #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/TextureStack.hlsl" + #include_with_pragmas "Packages/com.unity.render-pipelines.core/ShaderLibrary/FoveatedRenderingKeywords.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.universal/ShaderLibrary/LODCrossFade.hlsl" + + #undef WorldNormalVector + #define WorldNormalVector(data, normal) mul(normal, data.TBNMatrix) + + #define UnityObjectToWorldNormal(normal) mul(GetObjectToWorldMatrix(), normal) + + #define _WorldSpaceLightPos0 _MainLightPosition + + #define UNITY_DECLARE_TEX2D(name) TEXTURE2D(name); SAMPLER(sampler##name); + #define UNITY_DECLARE_TEX2D_NOSAMPLER(name) TEXTURE2D(name); + #define UNITY_DECLARE_TEX2DARRAY(name) TEXTURE2D_ARRAY(name); SAMPLER(sampler##name); + #define UNITY_DECLARE_TEX2DARRAY_NOSAMPLER(name) TEXTURE2D_ARRAY(name); + + #define UNITY_SAMPLE_TEX2DARRAY(tex,coord) SAMPLE_TEXTURE2D_ARRAY(tex, sampler##tex, coord.xy, coord.z) + #define UNITY_SAMPLE_TEX2DARRAY_LOD(tex,coord,lod) SAMPLE_TEXTURE2D_ARRAY_LOD(tex, sampler##tex, coord.xy, coord.z, lod) + #define UNITY_SAMPLE_TEX2D(tex, coord) SAMPLE_TEXTURE2D(tex, sampler##tex, coord) + #define UNITY_SAMPLE_TEX2D_SAMPLER(tex, samp, coord) SAMPLE_TEXTURE2D(tex, sampler##samp, coord) + + #define UNITY_SAMPLE_TEX2D_LOD(tex,coord, lod) SAMPLE_TEXTURE2D_LOD(tex, sampler_##tex, coord, lod) + #define UNITY_SAMPLE_TEX2D_SAMPLER_LOD(tex,samplertex,coord, lod) SAMPLE_TEXTURE2D_LOD (tex, sampler##samplertex,coord, lod) + + #if defined(UNITY_COMPILER_HLSL) + #define UNITY_INITIALIZE_OUTPUT(type,name) name = (type)0; + #else + #define UNITY_INITIALIZE_OUTPUT(type,name) + #endif + + #define sampler2D_float sampler2D + #define sampler2D_half sampler2D + + + + // data across stages, stripped like the above. + struct VertexToPixel + { + float4 pos : SV_POSITION; + float3 worldPos : TEXCOORD0; + float3 worldNormal : TEXCOORD1; + float4 worldTangent : TEXCOORD2; + float4 texcoord0 : TEXCOORD3; + float4 texcoord1 : TEXCOORD4; + float4 texcoord2 : TEXCOORD5; + + // #if %TEXCOORD3REQUIREKEY% + float4 texcoord3 : TEXCOORD6; + // #endif + + // #if %SCREENPOSREQUIREKEY% + // float4 screenPos : TEXCOORD7; + // #endif + + // #if %VERTEXCOLORREQUIREKEY% + half4 vertexColor : COLOR; + // #endif + + #if defined(LIGHTMAP_ON) + float2 lightmapUV : TEXCOORD8; + #endif + #if defined(DYNAMICLIGHTMAP_ON) + float2 dynamicLightmapUV : TEXCOORD9; + #endif + #if !defined(LIGHTMAP_ON) + float4 probeOcclusion : TEXCOORD8; + float3 sh : TEXCOORD10; + #endif + + #if defined(VARYINGS_NEED_FOG_AND_VERTEX_LIGHT) + float4 fogFactorAndVertexLight : TEXCOORD11; + #endif + + #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR) + float4 shadowCoord : TEXCOORD12; + #endif + + // #if %EXTRAV2F0REQUIREKEY% + // float4 extraV2F0 : TEXCOORD13; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // float4 extraV2F1 : TEXCOORD14; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // float4 extraV2F2 : TEXCOORD15; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // float4 extraV2F3 : TEXCOORD16; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // float4 extraV2F4 : TEXCOORD17; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // float4 extraV2F5 : TEXCOORD18; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // float4 extraV2F6 : TEXCOORD19; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // float4 extraV2F7 : TEXCOORD20; + // #endif + + #if UNITY_ANY_INSTANCING_ENABLED + uint instanceID : CUSTOM_INSTANCE_ID; + #endif + #if (defined(UNITY_STEREO_MULTIVIEW_ENABLED)) || (defined(UNITY_STEREO_INSTANCING_ENABLED) && (defined(SHADER_API_GLES3) || defined(SHADER_API_GLCORE))) + uint stereoTargetEyeIndexAsBlendIdx0 : BLENDINDICES0; + #endif + #if (defined(UNITY_STEREO_INSTANCING_ENABLED)) + uint stereoTargetEyeIndexAsRTArrayIdx : SV_RenderTargetArrayIndex; + #endif + #if defined(SHADER_STAGE_FRAGMENT) && defined(VARYINGS_NEED_CULLFACE) + FRONT_FACE_TYPE cullFace : FRONT_FACE_SEMANTIC; + #endif + + #if _PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR)) + float4 previousPositionCS : TEXCOORD21; // Contain previous transform position (in case of skinning for example) + float4 positionCS : TEXCOORD22; + #endif + }; + + + + + // data describing the user output of a pixel + struct Surface + { + half3 Albedo; + half Height; + half3 Normal; + half Smoothness; + half3 Emission; + half Metallic; + half3 Specular; + half Occlusion; + half SpecularPower; // for simple lighting + half Alpha; + float outputDepth; // if written, SV_Depth semantic is used. ShaderData.clipPos.z is unused value + // HDRP Only + half SpecularOcclusion; + half SubsurfaceMask; + half Thickness; + half CoatMask; + half CoatSmoothness; + half Anisotropy; + half IridescenceMask; + half IridescenceThickness; + int DiffusionProfileHash; + float SpecularAAThreshold; + float SpecularAAScreenSpaceVariance; + // requires _OVERRIDE_BAKEDGI to be defined, but is mapped in all pipelines + float3 DiffuseGI; + float3 BackDiffuseGI; + float3 SpecularGI; + float ior; + float3 transmittanceColor; + float atDistance; + float transmittanceMask; + // requires _OVERRIDE_SHADOWMASK to be defines + float4 ShadowMask; + + // for decals + float NormalAlpha; + float MAOSAlpha; + + + }; + + // Data the user declares in blackboard blocks + struct Blackboard + { + + float blackboardDummyData; + }; + + // data the user might need, this will grow to be big. But easy to strip + struct ShaderData + { + float4 clipPos; // SV_POSITION + float3 localSpacePosition; + float3 localSpaceNormal; + float3 localSpaceTangent; + + float3 worldSpacePosition; + float3 worldSpaceNormal; + float3 worldSpaceTangent; + float tangentSign; + + float3 worldSpaceViewDir; + float3 tangentSpaceViewDir; + + float4 texcoord0; + float4 texcoord1; + float4 texcoord2; + float4 texcoord3; + + float2 screenUV; + float4 screenPos; + + float4 vertexColor; + bool isFrontFace; + + float4 extraV2F0; + float4 extraV2F1; + float4 extraV2F2; + float4 extraV2F3; + float4 extraV2F4; + float4 extraV2F5; + float4 extraV2F6; + float4 extraV2F7; + + float3x3 TBNMatrix; + Blackboard blackboard; + }; + + struct VertexData + { + #if SHADER_TARGET > 30 + // uint vertexID : SV_VertexID; + #endif + float4 vertex : POSITION; + float3 normal : NORMAL; + float4 tangent : TANGENT; + float4 texcoord0 : TEXCOORD0; + + // optimize out mesh coords when not in use by user or lighting system + #if _URP && (_USINGTEXCOORD1 || _PASSMETA || _PASSFORWARD || _PASSGBUFFER) + float4 texcoord1 : TEXCOORD1; + #endif + + #if _URP && (_USINGTEXCOORD2 || _PASSMETA || ((_PASSFORWARD || _PASSGBUFFER) && defined(DYNAMICLIGHTMAP_ON))) + float4 texcoord2 : TEXCOORD2; + #endif + + #if _STANDARD && (_USINGTEXCOORD1 || (_PASSMETA || ((_PASSFORWARD || _PASSGBUFFER || _PASSFORWARDADD) && LIGHTMAP_ON))) + float4 texcoord1 : TEXCOORD1; + #endif + #if _STANDARD && (_USINGTEXCOORD2 || (_PASSMETA || ((_PASSFORWARD || _PASSGBUFFER) && DYNAMICLIGHTMAP_ON))) + float4 texcoord2 : TEXCOORD2; + #endif + + + #if _HDRP + float4 texcoord1 : TEXCOORD1; + float4 texcoord2 : TEXCOORD2; + #endif + + // #if %TEXCOORD3REQUIREKEY% + float4 texcoord3 : TEXCOORD3; + // #endif + + // #if %VERTEXCOLORREQUIREKEY% + float4 vertexColor : COLOR; + // #endif + + #if _PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR)) + float3 previousPositionOS : TEXCOORD4; // Contain previous transform position (in case of skinning for example) + #if defined (_ADD_PRECOMPUTED_VELOCITY) + float3 precomputedVelocity : TEXCOORD5; // Add Precomputed Velocity (Alembic computes velocities on runtime side). + #endif + #endif + + UNITY_VERTEX_INPUT_INSTANCE_ID + }; + + struct TessVertex + { + float4 vertex : INTERNALTESSPOS; + float3 normal : NORMAL; + float4 tangent : TANGENT; + float4 texcoord0 : TEXCOORD0; + float4 texcoord1 : TEXCOORD1; + float4 texcoord2 : TEXCOORD2; + + // #if %TEXCOORD3REQUIREKEY% + float4 texcoord3 : TEXCOORD3; + // #endif + + // #if %VERTEXCOLORREQUIREKEY% + float4 vertexColor : COLOR; + // #endif + + // #if %EXTRAV2F0REQUIREKEY% + // float4 extraV2F0 : TEXCOORD5; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // float4 extraV2F1 : TEXCOORD6; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // float4 extraV2F2 : TEXCOORD7; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // float4 extraV2F3 : TEXCOORD8; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // float4 extraV2F4 : TEXCOORD9; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // float4 extraV2F5 : TEXCOORD10; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // float4 extraV2F6 : TEXCOORD11; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // float4 extraV2F7 : TEXCOORD12; + // #endif + + #if _PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR)) + float3 previousPositionOS : TEXCOORD13; // Contain previous transform position (in case of skinning for example) + #if defined (_ADD_PRECOMPUTED_VELOCITY) + float3 precomputedVelocity : TEXCOORD14; + #endif + #endif + + UNITY_VERTEX_INPUT_INSTANCE_ID + UNITY_VERTEX_OUTPUT_STEREO + }; + + struct ExtraV2F + { + float4 extraV2F0; + float4 extraV2F1; + float4 extraV2F2; + float4 extraV2F3; + float4 extraV2F4; + float4 extraV2F5; + float4 extraV2F6; + float4 extraV2F7; + Blackboard blackboard; + float4 time; + }; + + + float3 WorldToTangentSpace(ShaderData d, float3 normal) + { + return mul(d.TBNMatrix, normal); + } + + float3 TangentToWorldSpace(ShaderData d, float3 normal) + { + return mul(normal, d.TBNMatrix); + } + + // in this case, make standard more like SRPs, because we can't fix + // unity_WorldToObject in HDRP, since it already does macro-fu there + + #if _STANDARD + float3 TransformWorldToObject(float3 p) { return mul(unity_WorldToObject, float4(p, 1)); }; + float3 TransformObjectToWorld(float3 p) { return mul(unity_ObjectToWorld, float4(p, 1)); }; + float4 TransformWorldToObject(float4 p) { return mul(unity_WorldToObject, p); }; + float4 TransformObjectToWorld(float4 p) { return mul(unity_ObjectToWorld, p); }; + float4x4 GetWorldToObjectMatrix() { return unity_WorldToObject; } + float4x4 GetObjectToWorldMatrix() { return unity_ObjectToWorld; } + #if (defined(SHADER_API_D3D11) || defined(SHADER_API_XBOXONE) || defined(UNITY_COMPILER_HLSLCC) || defined(SHADER_API_PSSL) || (SHADER_TARGET_SURFACE_ANALYSIS && !SHADER_TARGET_SURFACE_ANALYSIS_MOJOSHADER)) + #define UNITY_SAMPLE_TEX2D_LOD(tex,coord, lod) tex.SampleLevel (sampler##tex,coord, lod) + #define UNITY_SAMPLE_TEX2D_SAMPLER_LOD(tex,samplertex,coord, lod) tex.SampleLevel (sampler##samplertex,coord, lod) + #else + #define UNITY_SAMPLE_TEX2D_LOD(tex,coord,lod) tex2D (tex,coord,0,lod) + #define UNITY_SAMPLE_TEX2D_SAMPLER_LOD(tex,samplertex,coord,lod) tex2D (tex,coord,0,lod) + #endif + + #undef GetWorldToObjectMatrix() + + #define GetWorldToObjectMatrix() unity_WorldToObject + + + #endif + + float3 GetCameraWorldPosition() + { + #if _HDRP + return GetCameraRelativePositionWS(_WorldSpaceCameraPos); + #else + return _WorldSpaceCameraPos; + #endif + } + + #if _GRABPASSUSED + #if _STANDARD + TEXTURE2D(%GRABTEXTURE%); + SAMPLER(sampler_%GRABTEXTURE%); + #endif + + half3 GetSceneColor(float2 uv) + { + #if _STANDARD + return SAMPLE_TEXTURE2D(%GRABTEXTURE%, sampler_%GRABTEXTURE%, uv).rgb; + #else + return SHADERGRAPH_SAMPLE_SCENE_COLOR(uv); + #endif + } + #endif + + + + #if _STANDARD + UNITY_DECLARE_DEPTH_TEXTURE(_CameraDepthTexture); + float GetSceneDepth(float2 uv) { return SAMPLE_DEPTH_TEXTURE(_CameraDepthTexture, uv); } + float GetLinear01Depth(float2 uv) { return Linear01Depth(GetSceneDepth(uv)); } + float GetLinearEyeDepth(float2 uv) { return LinearEyeDepth(GetSceneDepth(uv)); } + #else + float GetSceneDepth(float2 uv) { return SHADERGRAPH_SAMPLE_SCENE_DEPTH(uv); } + float GetLinear01Depth(float2 uv) { return Linear01Depth(GetSceneDepth(uv), _ZBufferParams); } + float GetLinearEyeDepth(float2 uv) { return LinearEyeDepth(GetSceneDepth(uv), _ZBufferParams); } + #endif + + float3 GetWorldPositionFromDepthBuffer(float2 uv, float3 worldSpaceViewDir) + { + float eye = GetLinearEyeDepth(uv); + float3 camView = mul((float3x3)GetObjectToWorldMatrix(), transpose(mul(GetWorldToObjectMatrix(), UNITY_MATRIX_I_V)) [2].xyz); + + float dt = dot(worldSpaceViewDir, camView); + float3 div = worldSpaceViewDir/dt; + float3 wpos = (eye * div) + GetCameraWorldPosition(); + return wpos; + } + + #if _HDRP + float3 ObjectToWorldSpacePosition(float3 pos) + { + return GetAbsolutePositionWS(TransformObjectToWorld(pos)); + } + #else + float3 ObjectToWorldSpacePosition(float3 pos) + { + return TransformObjectToWorld(pos); + } + #endif + + #if _STANDARD + UNITY_DECLARE_SCREENSPACE_TEXTURE(_CameraDepthNormalsTexture); + float3 GetSceneNormal(float2 uv, float3 worldSpaceViewDir) + { + float4 depthNorms = UNITY_SAMPLE_SCREENSPACE_TEXTURE(_CameraDepthNormalsTexture, uv); + float3 norms = DecodeViewNormalStereo(depthNorms); + norms = mul((float3x3)GetWorldToViewMatrix(), norms) * 0.5 + 0.5; + return norms; + } + #elif _HDRP && !_DECALSHADER + + float3 GetSceneNormal(float2 uv, float3 worldSpaceViewDir) + { + NormalData nd; + DecodeFromNormalBuffer(_ScreenSize.xy * uv, nd); + return nd.normalWS; + } + #elif _URP + #if (SHADER_LIBRARY_VERSION_MAJOR >= 10) + #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/DeclareNormalsTexture.hlsl" + #endif + + float3 GetSceneNormal(float2 uv, float3 worldSpaceViewDir) + { + #if (SHADER_LIBRARY_VERSION_MAJOR >= 10) + return SampleSceneNormals(uv); + #else + float3 wpos = GetWorldPositionFromDepthBuffer(uv, worldSpaceViewDir); + return normalize(-cross(ddx(wpos), ddy(wpos))) * 0.5 + 0.5; + #endif + + } + #endif + + #if _HDRP + + half3 UnpackNormalmapRGorAG(half4 packednormal) + { + // This do the trick + packednormal.x *= packednormal.w; + + half3 normal; + normal.xy = packednormal.xy * 2 - 1; + normal.z = sqrt(1 - saturate(dot(normal.xy, normal.xy))); + return normal; + } + half3 UnpackNormal(half4 packednormal) + { + #if defined(UNITY_NO_DXT5nm) + return packednormal.xyz * 2 - 1; + #else + return UnpackNormalmapRGorAG(packednormal); + #endif + } + #endif + #if _HDRP || _URP + + half3 UnpackScaleNormal(half4 packednormal, half scale) + { + #ifndef UNITY_NO_DXT5nm + // Unpack normal as DXT5nm (1, y, 1, x) or BC5 (x, y, 0, 1) + // Note neutral texture like "bump" is (0, 0, 1, 1) to work with both plain RGB normal and DXT5nm/BC5 + packednormal.x *= packednormal.w; + #endif + half3 normal; + normal.xy = (packednormal.xy * 2 - 1) * scale; + normal.z = sqrt(1 - saturate(dot(normal.xy, normal.xy))); + return normal; + } + + #endif + + + void GetSun(out float3 lightDir, out float3 color) + { + lightDir = float3(0.5, 0.5, 0); + color = 1; + #if _HDRP + if (_DirectionalLightCount > 0) + { + DirectionalLightData light = _DirectionalLightDatas[0]; + lightDir = -light.forward.xyz; + color = light.color; + } + #elif _STANDARD + lightDir = normalize(_WorldSpaceLightPos0.xyz); + color = _LightColor0.rgb; + #elif _URP + Light light = GetMainLight(); + lightDir = light.direction; + color = light.color; + #endif + } + + + + CBUFFER_START(UnityPerMaterial) + + + half4 _Color; + half4 _MainTex_ST, _MainTex_TexelSize; + half _Alpha, _AlphaCutoffValue; + + #if ATLAS_ON + half _MinXUV, _MaxXUV, _MinYUV, _MaxYUV; + #endif + + #if GLOW_ON + half4 _GlowColor; + half _Glow, _GlowGlobal; + #endif + + #if HSV_ON + half _HsvShift, _HsvSaturation, _HsvBright; + #endif + + #if DISTORT_ON + half4 _DistortTex_ST; + half _DistortTexXSpeed, _DistortTexYSpeed, _DistortAmount; + #endif + + #if FADE_ON + half4 _FadeBurnColor, _FadeTex_ST, _FadeBurnTex_ST; + half _FadeAmount, _FadeBurnWidth, _FadeBurnTransition,_FadeBurnGlow; + #endif + + #if OUTBASE_ON + half4 _OutlineColor; + half _OutlineAlpha, _OutlineGlow, _OutlineWidth; + int _OutlinePixelWidth; + #endif + + #if OUTTEX_ON + half4 _OutlineTex_ST; + half _OutlineTexXSpeed, _OutlineTexYSpeed; + #endif + + #if OUTDIST_ON + half4 _OutlineDistortTex_ST; + half _OutlineDistortTexXSpeed, _OutlineDistortTexYSpeed, _OutlineDistortAmount; + #endif + + #if ALPHAOUTLINE_ON + half _AlphaOutlineGlow, _AlphaOutlinePower, _AlphaOutlineMinAlpha, _AlphaOutlineBlend; + half4 _AlphaOutlineColor; + #endif + + #if INNEROUTLINE_ON + half _InnerOutlineThickness, _InnerOutlineAlpha, _InnerOutlineGlow; + half4 _InnerOutlineColor; + #endif + + #if GRADIENT_ON + half _GradBlend, _GradBoostX, _GradBoostY; + half4 _GradTopRightCol, _GradTopLeftCol, _GradBotRightCol, _GradBotLeftCol; + #endif + + #if COLORSWAP_ON + half4 _ColorSwapRed, _ColorSwapGreen, _ColorSwapBlue; + half _ColorSwapRedLuminosity, _ColorSwapGreenLuminosity, _ColorSwapBlueLuminosity, _ColorSwapBlend; + #endif + + #if CHANGECOLOR_ON + half4 _ColorChangeNewCol, _ColorChangeTarget; + half _ColorChangeTolerance, _ColorChangeLuminosity; + #endif + #if CHANGECOLOR2_ON + half4 _ColorChangeNewCol2, _ColorChangeTarget2; + half _ColorChangeTolerance2; + #endif + #if CHANGECOLOR3_ON + half4 _ColorChangeNewCol3, _ColorChangeTarget3; + half _ColorChangeTolerance3; + #endif + + #if COLORRAMP_ON + half _ColorRampLuminosity, _ColorRampBlend; + #endif + + #if HITEFFECT_ON + half4 _HitEffectColor; + half _HitEffectGlow, _HitEffectBlend; + #endif + + #if NEGATIVE_ON + half _NegativeAmount; + #endif + + #if PIXELATE_ON + half _PixelateSize; + #endif + + #if GREYSCALE_ON + half _GreyscaleLuminosity, _GreyscaleBlend; + half4 _GreyscaleTintColor; + #endif + + #if POSTERIZE_ON + half _PosterizeNumColors, _PosterizeGamma; + #endif + + #if BLUR_ON + half _BlurIntensity; + #endif + + #if MOTIONBLUR_ON + half _MotionBlurAngle, _MotionBlurDist; + #endif + + #if GHOST_ON + half _GhostColorBoost, _GhostTransparency, _GhostBlend; + #endif + + #if HOLOGRAM_ON + half _HologramStripesAmount, _HologramMinAlpha, _HologramUnmodAmount, _HologramStripesSpeed, _HologramMaxAlpha, _HologramBlend; + half4 _HologramStripeColor; + #endif + + #if CHROMABERR_ON + half _ChromAberrAmount, _ChromAberrAlpha; + #endif + + #if GLITCH_ON + half _GlitchAmount, _GlitchSize; + #endif + + #if FLICKER_ON + half _FlickerFreq, _FlickerPercent, _FlickerAlpha; + #endif + + #if SHADOW_ON + half _ShadowX, _ShadowY, _ShadowAlpha; + half4 _ShadowColor; + #endif + + #if SHINE_ON + half4 _ShineColor; + half _ShineLocation, _ShineRotate, _ShineWidth, _ShineGlow; + #endif + + #if CONTRAST_ON + half _Contrast, _Brightness; + #endif + + #if OVERLAY_ON + half4 _OverlayTex_ST, _OverlayColor; + half _OverlayGlow, _OverlayBlend, _OverlayTextureScrollXSpeed, _OverlayTextureScrollYSpeed; + #endif + + #if DOODLE_ON + half _HandDrawnAmount, _HandDrawnSpeed; + #endif + + #if WIND_ON + half _GrassSpeed, _GrassWind, _GrassManualAnim, _GrassRadialBend; + #endif + + #if WAVEUV_ON + float _WaveAmount, _WaveSpeed, _WaveStrength, _WaveX, _WaveY; + #endif + + #if ROUNDWAVEUV_ON + half _RoundWaveStrength, _RoundWaveSpeed; + #endif + + #if RECTSIZE_ON + half _RectSize; + #endif + + #if OFFSETUV_ON + half _OffsetUvX, _OffsetUvY; + #endif + + #if CLIPPING_ON + half _ClipUvLeft, _ClipUvRight, _ClipUvUp, _ClipUvDown; + #endif + + #if RADIALCLIPPING_ON + half _RadialStartAngle, _RadialClip, _RadialClip2; + #endif + + #if TEXTURESCROLL_ON + half _TextureScrollXSpeed, _TextureScrollYSpeed; + #endif + + #if ZOOMUV_ON + half _ZoomUvAmount; + #endif + + #if WARP_ON + half _WarpStrength, _WarpSpeed, _WarpScale; + #endif + + #if TWISTUV_ON + half _TwistUvAmount, _TwistUvPosX, _TwistUvPosY, _TwistUvRadius; + #endif + + #if ROTATEUV_ON + half _RotateUvAmount; + #endif + + #if FISHEYE_ON + half _FishEyeUvAmount; + #endif + + #if PINCH_ON + half _PinchUvAmount; + #endif + + #if SHAKEUV_ON + half _ShakeUvSpeed, _ShakeUvX, _ShakeUvY; + #endif + + #if NORMALMAP_ON + half _NormalStrength; + #endif + + float _RandomSeed; + + + + + CBUFFER_END + + + + + + + + TEXTURE2D(_MainTex); + SAMPLER(sampler_MainTex); + + #if GLOW_ON + TEXTURE2D(_GlowTex); + SAMPLER(sampler_GlowTex); + #endif + + #if FADE_ON + TEXTURE2D(_FadeTex); + SAMPLER(sampler_FadeTex); + + TEXTURE2D(_FadeBurnTex); + SAMPLER(sampler_FadeBurnTex); + #endif + + #if DISTORT_ON + TEXTURE2D(_DistortTex); + SAMPLER(sampler_DistortTex); + #endif + + #if OUTTEX_ON + TEXTURE2D(_OutlineTex); + SAMPLER(sampler_OutlineTex); + #endif + + #if OUTDIST_ON + TEXTURE2D(_OutlineDistortTex); + SAMPLER(sampler_OutlineDistortTex); + #endif + + #if COLORSWAP_ON + TEXTURE2D(_ColorSwapTex); + SAMPLER(sampler_ColorSwapTex); + #endif + + #if COLORRAMP_ON + TEXTURE2D(_ColorRampTex); + TEXTURE2D(_ColorRampTexGradient); + SAMPLER(sampler_ColorRampTex); + SAMPLER(sampler_ColorRampTexGradient); + #endif + + #if SHINE_ON + TEXTURE2D(_ShineMask); + SAMPLER(sampler_ShineMask); + #endif + + #if OVERLAY_ON + TEXTURE2D(_OverlayTex); + SAMPLER(sampler_OverlayTex); + #endif + + #if NORMALMAP_ON + TEXTURE2D(_NormalMap); + SAMPLER(sampler_NormalMap); + #endif + + + half3 GetPixel(in int offsetX, in int offsetY, in half2 uv, in Texture2D _tex, in SamplerState _sampler) + { + half2 _uv = uv + half2(offsetX * _MainTex_TexelSize.x, offsetY * _MainTex_TexelSize.y); + half4 col = SAMPLE_TEXTURE2D(_tex, _sampler, _uv); + return col.rgb; + } + + + //BLURS------------------------------------------------------------------------- + half4 Blur(half2 uv, Texture2D source, SamplerState sampler_source, half Intensity) + { + const half2 texelSize = 1.0 / _ScreenParams.xy; + const half4 color = SAMPLE_TEXTURE2D(source, sampler_source, uv); + const half2 offset = Intensity * texelSize; + + half4 accumulatedColor = color; + half accumulatedWeight = 1.0; + for (int x = -1; x <= 1; x++) + { + for (int y = -1; y <= 1; y++) + { + const half2 sampleUV = uv + half2(x, y) * offset; + const half4 sampleColor = SAMPLE_TEXTURE2D(source, sampler_source, sampleUV); + + accumulatedColor += sampleColor; + accumulatedWeight += 1.0; + } + } + + half4 blurredColor = accumulatedColor / accumulatedWeight; + return blurredColor; + } + + half BlurHD_G(half bhqp, half x) + { + return exp(-(x * x) / (2.0 * bhqp * bhqp)); + } + half4 BlurHD(half2 uv, Texture2D source, SamplerState sampler_source, half BlurAmount, half xScale, half yScale) + { + int iterations = 16; + int halfIterations = iterations / 2; + half sigmaX = 0.1 + BlurAmount * 0.5; + half sigmaY = sigmaX; + half total = 0.0; + half4 ret = half4(0, 0, 0, 0); + for (int iy = 0; iy < iterations; ++iy) + { + half fy = BlurHD_G(sigmaY, half(iy) -half(halfIterations)); + half offsetY = half(iy - halfIterations) * 0.00390625 * xScale; + for (int ix = 0; ix < iterations; ++ix) + { + half fx = BlurHD_G(sigmaX, half(ix) - half(halfIterations)); + half offsetX = half(ix - halfIterations) * 0.00390625 * yScale; + total += fx * fy; + ret += SAMPLE_TEXTURE2D(source, sampler_source, uv + half2(offsetX, offsetY)) * fx * fy; + } + } + return ret / total; + } + //----------------------------------------------------------------------- + + + //------------------------------------------- + half RemapFloat(half inValue, half inMin, half inMax, half outMin, half outMax){ + return outMin + (inValue - inMin) * (outMax - outMin) / (inMax - inMin); + } + //------------------------------------------- + + //----------------------------------------------------------------------- + half rand(half2 seed, half offset) { + return (frac(sin(dot(seed, half2(12.9898, 78.233))) * 43758.5453) + offset) % 1.0; + } + + half rand2(half2 seed, half offset) { + return (frac(sin(dot(seed * floor(50 + (_Time.x % 1.0) * 12.), half2(127.1, 311.7))) * 43758.5453123) + offset) % 1.0; + } + + half rand2CustomTime(half2 seed, half offset, half customTime) { + return (frac(sin(dot(seed * floor(50 + (customTime % 1.0) * 12.), half2(127.1, 311.7))) * 43758.5453123) + offset) % 1.0; + } + //----------------------------------------------------------------------- + + + void Ext_ModifyVertex0 (inout VertexData v, inout ExtraV2F d) + { + //BILBOARD_ON + #if BILBOARD_ON + half3 camRight = mul((half3x3)unity_CameraToWorld, half3(1,0,0)); + half3 camUp = half3(0,1,0); + #if BILBOARDY_ON + camUp = mul((half3x3)unity_CameraToWorld, half3(0,1,0)); + #endif + half3 localPos = v.vertex.x * camRight + v.vertex.y * camUp; + v.vertex = half4(localPos, 1); + #endif + //----------------------------------------------------------- + + v.texcoord0.xy = TRANSFORM_TEX(v.texcoord0.xy, _MainTex); + half2 center = half2(0.5, 0.5); + #if ATLAS_ON + center = half2((_MaxXUV + _MinXUV) / 2.0, (_MaxYUV + _MinYUV) / 2.0); + #endif + + //POLARUV_ON + #if POLARUV_ON + v.texcoord0.xy = v.texcoord0.xy - center; + #endif + + //---------------------------------------- + + //ROTATEUV_ON + #if ROTATEUV_ON + half2 uvC = v.texcoord0.xy; + half cosAngle = cos(_RotateUvAmount); + half sinAngle = sin(_RotateUvAmount); + half2x2 rot = half2x2(cosAngle, -sinAngle, sinAngle, cosAngle); + uvC -= center; + v.texcoord0.xy = mul(rot, uvC); + v.texcoord0.xy += center; + #endif + //-------------------- + + #if RECTSIZE_ON + v.vertex.xyz += (v.vertex.xyz * (_RectSize - 1.0)); + #endif + + #if OUTTEX_ON + v.texcoord1.xy = TRANSFORM_TEX(v.texcoord0.xy, _OutlineTex); + #endif + + #if OUTDIST_ON + v.texcoord2.xy = TRANSFORM_TEX(v.texcoord0.xy, _OutlineDistortTex); + #endif + + #if DISTORT_ON + v.texcoord3.xy = TRANSFORM_TEX(v.texcoord0.xy, _DistortTex); + #endif + } + + void Ext_SurfaceFunction0 (inout Surface o, ShaderData d) + { + half randomSeed = _RandomSeed; + + float2 uvRect = d.texcoord0; + half2 center = half2(0.5, 0.5); + #if ATLAS_ON + center = half2((_MaxXUV + _MinXUV) / 2.0, (_MaxYUV + _MinYUV) / 2.0); + uvRect = half2((d.texcoord0.x - _MinXUV) / (_MaxXUV - _MinXUV), (d.texcoord0.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half2 centerTiled = half2(center.x * _MainTex_ST.x, center.y * _MainTex_ST.y); + + //CLIPPING_ON + #if CLIPPING_ON + half2 tiledUv = half2(d.texcoord0.x / _MainTex_ST.x, d.texcoord0.y / _MainTex_ST.y); + #if ATLAS_ON + tiledUv = half2((tiledUv.x - _MinXUV) / (_MaxXUV - _MinXUV), (tiledUv.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + clip((1 - _ClipUvUp) - tiledUv.y); + clip(tiledUv.y - _ClipUvDown); + clip((1 - _ClipUvRight) - tiledUv.x); + clip(tiledUv.x - _ClipUvLeft); + #endif + //---------------------------------- + + //RADIALCLIPPING_ON + #if RADIALCLIPPING_ON + half2 tiledUv2 = half2(d.texcoord0.x / _MainTex_ST.x, d.texcoord0.y / _MainTex_ST.y); + #if ATLAS_ON + tiledUv2 = half2((tiledUv2.x - _MinXUV) / (_MaxXUV - _MinXUV), (tiledUv2.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half startAngle = _RadialStartAngle - _RadialClip; + half endAngle = _RadialStartAngle + _RadialClip2; + half offset0 = clamp(0, 360, startAngle + 360); + half offset360 = clamp(0, 360, endAngle - 360); + half2 atan2Coord = half2(lerp(-1, 1, tiledUv2.x), lerp(-1, 1, tiledUv2.y)); + half atanAngle = atan2(atan2Coord.y, atan2Coord.x) * 57.3; // angle in degrees + if(atanAngle < 0) atanAngle = 360 + atanAngle; + if(atanAngle >= startAngle && atanAngle <= endAngle) discard; + if(atanAngle <= offset360) discard; + if(atanAngle >= offset0) discard; + #endif + + //----------------------------- + + //TEXTURESCROLL_ON && ATLAS_ON + #if TEXTURESCROLL_ON && ATLAS_ON + d.texcoord0.xy = half2(_MinXUV + ((_MaxXUV - _MinXUV) * (abs(((_Time.y + randomSeed) * _TextureScrollXSpeed) + uvRect.x) % 1)), + _MinYUV + ((_MaxYUV - _MinYUV) * (abs(((_Time.y + randomSeed) * _TextureScrollYSpeed) + uvRect.y) % 1))); + #endif + //---------------------------- + + //OFFSETUV_ON + #if OFFSETUV_ON + #if ATLAS_ON + d.texcoord0.xy = half2(_MinXUV + ((_MaxXUV - _MinXUV) * (abs((_OffsetUvX + uvRect.x) % 1))), + _MinYUV + ((_MaxYUV - _MinYUV) * (abs(_OffsetUvY + uvRect.y) % 1))); + #else + d.texcoord0.xy += half2(_OffsetUvX, _OffsetUvY); + #endif + #endif + + //---------------------- + + //POLARUV_ON + #if POLARUV_ON + d.texcoord0.xy = half2(atan2(d.texcoord0.y, d.texcoord0.x) / (2.0f * 3.141592653589f), length(d.texcoord0.xy)); + d.texcoord0.xy *= _MainTex_ST.xy; + #endif + + //-------------------------------------- + + //TWISTUV_ON + #if TWISTUV_ON + #if ATLAS_ON + _TwistUvPosX = ((_MaxXUV - _MinXUV) * _TwistUvPosX) + _MinXUV; + _TwistUvPosY = ((_MaxYUV - _MinYUV) * _TwistUvPosY) + _MinYUV; + #endif + half2 tempUv = d.texcoord0.xy - half2(_TwistUvPosX * _MainTex_ST.x, _TwistUvPosY * _MainTex_ST.y); + _TwistUvRadius *= (_MainTex_ST.x + _MainTex_ST.y) / 2; + half percent = (_TwistUvRadius - length(tempUv)) / _TwistUvRadius; + half theta = percent * percent * (2.0 * sin(_TwistUvAmount)) * 8.0; + half s = sin(theta); + half c = cos(theta); + half beta = max(sign(_TwistUvRadius - length(tempUv)), 0.0); + tempUv = half2(dot(tempUv, half2(c, -s)), dot(tempUv, half2(s, c))) * beta + tempUv * (1 - beta); + tempUv += half2(_TwistUvPosX * _MainTex_ST.x, _TwistUvPosY * _MainTex_ST.y); + d.texcoord0.xy = tempUv; + #endif + + //-------------------------------------------- + + //FISHEYE_ON + #if FISHEYE_ON + half bind = length(centerTiled); + half2 dF = d.texcoord0.xy - centerTiled; + half dFlen = length(dF); + half fishInt = (3.14159265359 / bind) * (_FishEyeUvAmount + 0.001); + d.texcoord0.xy = centerTiled + (dF / (max(0.0001, dFlen))) * tan(dFlen * fishInt) * bind / tan(bind * fishInt); + #endif + //--------------------------------------------- + + //PINCH_ON + #if PINCH_ON + half2 dP = d.texcoord0.xy - centerTiled; + half pinchInt = (3.141592 / length(centerTiled)) * (-_PinchUvAmount + 0.001); + d.texcoord0.xy = centerTiled + normalize(dP) * atan(length(dP) * -pinchInt * 10.0) * 0.5 / atan(-pinchInt * 5); + #endif + + //--------------------------------------------- + + //ZOOMUV_ON + #if ZOOMUV_ON + d.texcoord0.xy -= centerTiled; + d.texcoord0.xy = d.texcoord0.xy * _ZoomUvAmount; + d.texcoord0.xy += centerTiled; + #endif + + //----------------------------------------------- + + //DOODLE_ON + #if DOODLE_ON + half2 uvCopy = uvRect; + _HandDrawnSpeed = (floor((_Time.x + randomSeed) * 20 * _HandDrawnSpeed) / _HandDrawnSpeed) * _HandDrawnSpeed; + uvCopy.x = sin((uvCopy.x * _HandDrawnAmount + _HandDrawnSpeed) * 4); + uvCopy.y = cos((uvCopy.y * _HandDrawnAmount + _HandDrawnSpeed) * 4); + d.texcoord0.xy = lerp(d.texcoord0.xy, d.texcoord0.xy + uvCopy, 0.0005 * _HandDrawnAmount); + #endif + + //-------------------------- + + //SHAKEUV_ON + #if SHAKEUV_ON + half xShake = sin((_Time.x + randomSeed) * _ShakeUvSpeed * 50) * _ShakeUvX; + half yShake = cos((_Time.x + randomSeed) * _ShakeUvSpeed * 50) * _ShakeUvY; + d.texcoord0.xy += half2(xShake * 0.012, yShake * 0.01); + #endif + + //------------------------------------------- + + //RECTSIZE_ON + #if RECTSIZE_ON + d.texcoord0.xy = d.texcoord0.xy * (_RectSize).xx + (((-_RectSize * 0.5) + 0.5)).xx; + #endif + + //------------------------------------------- + + //DISTORT_ON + #if DISTORT_ON + #if ATLAS_ON + d.texcoord3.x = d.texcoord3.x * (1 / (_MaxXUV - _MinXUV)); + d.texcoord3.y = d.texcoord3.y * (1 / (_MaxYUV - _MinYUV)); + #endif + + d.texcoord3.x += ((_Time.x + _RandomSeed) * _DistortTexXSpeed) % 1; + d.texcoord3.y += ((_Time.x + _RandomSeed) * _DistortTexYSpeed) % 1; + half distortAmnt = (SAMPLE_TEXTURE2D(_DistortTex, sampler_DistortTex, d.texcoord3.xy).r - 0.5) * 0.2 * _DistortAmount; + d.texcoord0.x += distortAmnt; + d.texcoord0.y += distortAmnt; + #endif + //------------------------------------------------------- + + //WARP_ON + #if WARP_ON + half2 warpUv = half2(d.texcoord0.x / _MainTex_ST.x, d.texcoord0.y / _MainTex_ST.y); + #if ATLAS_ON + warpUv = half2((warpUv.x - _MinXUV) / (_MaxXUV - _MinXUV), (warpUv.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + const float tau = 6.283185307179586; + float xWarp = (_Time.y + randomSeed) * _WarpSpeed + warpUv.x * tau / _WarpScale; + float yWarp = (_Time.y + randomSeed) * _WarpSpeed + warpUv.y * tau / _WarpScale; + float2 warp = float2(sin(xWarp), sin(yWarp)) * _WarpStrength; + d.texcoord0.xy += warp; + #endif + + //------------------------------------------------------- + + //WAVEUV_ON + #if WAVEUV_ON + float2 uvWave = half2(_WaveX * _MainTex_ST.x, _WaveY * _MainTex_ST.y) - d.texcoord0.xy; + uvWave %= 1; + #if ATLAS_ON + uvWave = half2(_WaveX, _WaveY) - uvRect; + #endif + uvWave.x *= _ScreenParams.x / _ScreenParams.y; + float waveTime = _Time.y + randomSeed; + float angWave = (sqrt(dot(uvWave, uvWave)) * _WaveAmount) - ((waveTime * _WaveSpeed)); + d.texcoord0.xy = d.texcoord0.xy + uvWave * sin(angWave) * (_WaveStrength / 1000.0); + #endif + //---------------------------------------------------- + + //ROUNDWAVEUV_ON + #if ROUNDWAVEUV_ON + half xWave = ((0.5 * _MainTex_ST.x) - uvRect.x); + half yWave = ((0.5 * _MainTex_ST.y) - uvRect.y) * (_MainTex_TexelSize.w / _MainTex_TexelSize.z); + half ripple = -sqrt(xWave*xWave + yWave* yWave); + d.texcoord0.xy += (sin((ripple + (_Time.y + randomSeed) * (_RoundWaveSpeed/10.0)) / 0.015) * (_RoundWaveStrength/10.0)) % 1; + #endif + //---------------------------------------------------- + + + //WIND_ON + #if WIND_ON + half windOffset = sin((_Time.x + randomSeed) * _GrassSpeed * 10); + half2 windCenter = half2(0.5, 0.1); + #if ATLAS_ON + windCenter.x = ((_MaxXUV - _MinXUV) * windCenter.x) + _MinXUV; + windCenter.y = ((_MaxYUV - _MinYUV) * windCenter.y) + _MinYUV; + #endif + #if !MANUALWIND_ON + d.texcoord0.x = fmod(abs(lerp(d.texcoord0.x, d.texcoord0.x + (_GrassWind * 0.01 * windOffset), uvRect.y)), 1); + #else + d.texcoord0.x = fmod(abs(lerp(d.texcoord0.x, d.texcoord0.x + (_GrassWind * 0.01 * _GrassManualAnim), uvRect.y)), 1); + windOffset = _GrassManualAnim; + #endif + half2 delta = d.texcoord0.xy - windCenter; + half delta2 = dot(delta.xy, delta.xy); + half2 delta_offset = delta2 * windOffset; + d.texcoord0.xy = d.texcoord0.xy + half2(delta.y, -delta.x) * delta_offset * _GrassRadialBend; + #endif + + //-------------------------------------------------------- + + //TEXTURESCROLL_ON && !ATLAS_ON + #if TEXTURESCROLL_ON && !ATLAS_ON + d.texcoord0.x += ((_Time.y + randomSeed) * _TextureScrollXSpeed) % 1; + d.texcoord0.y += ((_Time.y + randomSeed) * _TextureScrollYSpeed) % 1; + #endif + //------------------------------ + + //PIXELATE_ON + #if PIXELATE_ON + half aspectRatio = _MainTex_TexelSize.x / _MainTex_TexelSize.y; + half2 pixelSize = float2(_PixelateSize, _PixelateSize * aspectRatio); + d.texcoord0.xy = floor(d.texcoord0.xy * pixelSize) / pixelSize; + #endif + //-------------- + + half4 col = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy); + half originalAlpha = col.a; + col *= d.vertexColor; + + //NORMAL MAP + #if NORMALMAP_ON + half4 normalSample = SAMPLE_TEXTURE2D(_NormalMap, sampler_NormalMap, d.texcoord0.xy); + half3 normalTS = UnpackNormal(normalSample); + normalTS.xy *= _NormalStrength; + o.Normal = normalTS; + #endif + + + //GLITCH_ON + #if GLITCH_ON + half2 uvGlitch = uvRect; + uvGlitch.y -= 0.5; + half lineNoise = pow(rand2(floor(uvGlitch * half2(24., 19.) * _GlitchSize) * 4.0, randomSeed), 3.0) * _GlitchAmount + * pow(rand2(floor(uvGlitch * half2(38., 14.) * _GlitchSize) * 4.0, randomSeed), 3.0); + col = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(lineNoise * 0.02 * rand2(half2(2.0, 1), randomSeed), 0)) * d.vertexColor; + #endif + //-------------------------------------- + + //CHROMABERR_ON + #if CHROMABERR_ON + half4 r = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(_ChromAberrAmount/10, 0)) * d.vertexColor; + half4 b = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(-_ChromAberrAmount/10, 0)) * d.vertexColor; + col = half4(r.r * r.a, col.g, b.b * b.a, max(max(r.a, b.a) * _ChromAberrAlpha, col.a)); + #endif + + //-------------------------------- + + //BLUR_ON + #if BLUR_ON + #if ATLAS_ON + #if !BLURISHD_ON + col = BlurHD(d.texcoord0.xy, _MainTex, sampler_MainTex, _BlurIntensity, (_MaxXUV - _MinXUV), (_MaxYUV - _MinYUV)) * d.vertexColor; + #else + col = Blur(d.texcoord0.xy, _MainTex, sampler_MainTex, _BlurIntensity * (_MaxXUV - _MinXUV)) * d.vertexColor; + #endif + #else + #if !BLURISHD_ON + col = BlurHD(d.texcoord0.xy, _MainTex, sampler_MainTex, _BlurIntensity, 1, 1) * d.vertexColor; + #else + col = Blur(d.texcoord0.xy, _MainTex, sampler_MainTex, _BlurIntensity) * d.vertexColor; + #endif + #endif + #endif + + //-------------------- + + //MOTIONBLUR_ON + #if MOTIONBLUR_ON + _MotionBlurAngle = _MotionBlurAngle * 3.1415926; + #define rot(n) mul(n, half2x2(cos(_MotionBlurAngle), -sin(_MotionBlurAngle), sin(_MotionBlurAngle), cos(_MotionBlurAngle))) + _MotionBlurDist = _MotionBlurDist * 0.005; + #if ATLAS_ON + _MotionBlurDist *= (_MaxXUV - _MinXUV); + #endif + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(-_MotionBlurDist, -_MotionBlurDist))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(-_MotionBlurDist * 2, -_MotionBlurDist * 2))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(-_MotionBlurDist * 3, -_MotionBlurDist * 3))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(-_MotionBlurDist * 4, -_MotionBlurDist * 4))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(_MotionBlurDist, _MotionBlurDist))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(_MotionBlurDist * 2, _MotionBlurDist * 2))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(_MotionBlurDist * 3, _MotionBlurDist * 3))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(_MotionBlurDist * 4, _MotionBlurDist * 4))); + col.rgb = col.rgb / 9; + #endif + //------------------------------------ + + //NEGATIVE_ON + #if NEGATIVE_ON + col.rgb = lerp(col.rgb, 1 - col.rgb, _NegativeAmount); + #endif + + //-------------- + half luminance = 0; + + //GREYSCALE_ON && !GREYSCALEOUTLINE_ON + #if GREYSCALE_ON && !GREYSCALEOUTLINE_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + luminance = saturate(luminance + _GreyscaleLuminosity); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _GreyscaleTintColor, _GreyscaleBlend); + #endif + //------------------------------------ + + //GHOST_ON + #if GHOST_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + half4 ghostResult; + ghostResult.a = saturate(luminance - _GhostTransparency) * col.a; + ghostResult.rgb = col.rgb * (luminance + _GhostColorBoost); + col = lerp(col, ghostResult, _GhostBlend); + #endif + //------------------------------------ + + //INNEROUTLINE_ON + #if INNEROUTLINE_ON + half3 innerT = abs(GetPixel(0, _InnerOutlineThickness, d.texcoord0.xy, _MainTex, sampler_MainTex) - GetPixel(0, -_InnerOutlineThickness, d.texcoord0.xy, _MainTex, sampler_MainTex)); + innerT += abs(GetPixel(_InnerOutlineThickness, 0, d.texcoord0.xy, _MainTex, sampler_MainTex) - GetPixel(-_InnerOutlineThickness, 0, d.texcoord0.xy, _MainTex, sampler_MainTex)); + #if !ONLYINNEROUTLINE_ON + innerT = (innerT / 2.0) * col.a * _InnerOutlineAlpha; + col.rgb += length(innerT) * _InnerOutlineColor.rgb * _InnerOutlineGlow; + #else + innerT *= col.a * _InnerOutlineAlpha; + col.rgb = length(innerT) * _InnerOutlineColor.rgb * _InnerOutlineGlow; + col.a = step(0.3, col.r+col.g+col.b); + #endif + #endif + //------------------------------------------------------- + + //HITEFFECT_ON + #if HITEFFECT_ON + col.rgb = lerp(col.rgb, _HitEffectColor.rgb * _HitEffectGlow, _HitEffectBlend); + #endif + //-------------------- + + //GRADIENT_ON + #if GRADIENT_ON + half2 tiledUvGrad = half2(uvRect.x / _MainTex_ST.x, uvRect.y / _MainTex_ST.y); + #if GRADIENT2COL_ON + _GradTopRightCol = _GradTopLeftCol; + _GradBotRightCol = _GradBotLeftCol; + #endif + #if RADIALGRADIENT_ON + half radialDist = 1 - length(tiledUvGrad - half2(0.5, 0.5)); + radialDist *= (_MainTex_TexelSize.w / _MainTex_TexelSize.z); + radialDist = saturate(_GradBoostX * radialDist); + half4 gradientResult = lerp(_GradTopLeftCol, _GradBotLeftCol, radialDist); + #else + half gradXLerpFactor = saturate(pow(tiledUvGrad.x, _GradBoostX)); + half4 gradientResult = lerp(lerp(_GradBotLeftCol, _GradBotRightCol, gradXLerpFactor), + lerp(_GradTopLeftCol, _GradTopRightCol, gradXLerpFactor), saturate(pow(tiledUvGrad.y, _GradBoostY))); + #endif + gradientResult = lerp(col, gradientResult, _GradBlend); + col.rgb = gradientResult.rgb * col.a; + col.a *= gradientResult.a; + #endif + //-------------------------------------------------------------------- + + //CONTRAST_ON + #if CONTRAST_ON + col.rgb = (col.rgb - float3(0.5, 0.5, 0.5)) * _Contrast + float3(0.5, 0.5, 0.5); + col.rgb += _Brightness; + #endif + + //------------------------------------------------------------------- + + //COLORSWAP_ON + #if COLORSWAP_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + half4 swapMask = SAMPLE_TEXTURE2D(_ColorSwapTex, sampler_ColorSwapTex, d.texcoord0.xy); + swapMask.rgb *= swapMask.a; + half3 redSwap = _ColorSwapRed * swapMask.r * saturate(luminance + _ColorSwapRedLuminosity); + half3 greenSwap = _ColorSwapGreen * swapMask.g * saturate(luminance + _ColorSwapGreenLuminosity); + half3 blueSwap = _ColorSwapBlue * swapMask.b * saturate(luminance + _ColorSwapBlueLuminosity); + swapMask.rgb = col.rgb * saturate(1 - swapMask.r - swapMask.g - swapMask.b); + col.rgb = lerp(col.rgb, swapMask.rgb + redSwap + greenSwap + blueSwap, _ColorSwapBlend); + #endif + //-------------------------------------------------------------------- + + //COLORRAMP_ON && !COLORRAMPOUTLINE_ON + #if COLORRAMP_ON && !COLORRAMPOUTLINE_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + luminance = saturate(luminance + _ColorRampLuminosity); + #if GRADIENTCOLORRAMP_ON + col.rgb = lerp(col.rgb, SAMPLE_TEXTURE2D(_ColorRampTexGradient, sampler_ColorRampTexGradient, half2(luminance, 0)).rgb, _ColorRampBlend); + #else + col.rgb = lerp(col.rgb, SAMPLE_TEXTURE2D(_ColorRampTex, sampler_ColorRampTex, half2(luminance, 0)).rgb, _ColorRampBlend); + #endif + #endif + //-------------------------------------------------------------------- + + //CHANGECOLOR_ON + #if CHANGECOLOR_ON + float3 currChangeColor = saturate(col.rgb); + luminance = 0.3 * currChangeColor.r + 0.59 * currChangeColor.g + 0.11 * currChangeColor.b; + luminance = saturate(luminance + _ColorChangeLuminosity); + half3 dif = abs(currChangeColor - _ColorChangeTarget.rgb); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _ColorChangeNewCol.rgb, + max(sign(1 - saturate(dif.x + dif.y + dif.z) - _ColorChangeTolerance), 0.0)); + #if CHANGECOLOR2_ON + dif = abs(currChangeColor - _ColorChangeTarget2.rgb); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _ColorChangeNewCol2.rgb, + max(sign(1 - saturate(dif.x + dif.y + dif.z) - _ColorChangeTolerance2), 0.0)); + #endif + #if CHANGECOLOR3_ON + dif = abs(currChangeColor - _ColorChangeTarget3.rgb); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _ColorChangeNewCol3.rgb, + max(sign(1 - saturate(dif.x + dif.y + dif.z) - _ColorChangeTolerance3), 0.0)); + #endif + #endif + //------------------------------------------------------- + + //POSTERIZE_ON && !POSTERIZEOUTLINE_ON + #if POSTERIZE_ON && !POSTERIZEOUTLINE_ON + col.rgb = pow(col.rgb, _PosterizeGamma) * _PosterizeNumColors; + col.rgb = floor(col.rgb) / _PosterizeNumColors; + col.rgb = pow(col.rgb, 1.0 / _PosterizeGamma); + #endif + //------------------------------------ + + //HSV_ON + #if HSV_ON + half3 resultHsv = half3(col.rgb); + half cosHsv = _HsvBright * _HsvSaturation * cos(_HsvShift * 3.14159265 / 180); + half sinHsv = _HsvBright * _HsvSaturation * sin(_HsvShift * 3.14159265 / 180); + resultHsv.x = (.299 * _HsvBright + .701 * cosHsv + .168 * sinHsv) * col.x + + (.587 * _HsvBright - .587 * cosHsv + .330 * sinHsv) * col.y + + (.114 * _HsvBright - .114 * cosHsv - .497 * sinHsv) * col.z; + resultHsv.y = (.299 * _HsvBright - .299 * cosHsv - .328 * sinHsv) *col.x + + (.587 * _HsvBright + .413 * cosHsv + .035 * sinHsv) * col.y + + (.114 * _HsvBright - .114 * cosHsv + .292 * sinHsv) * col.z; + resultHsv.z = (.299 * _HsvBright - .3 * cosHsv + 1.25 * sinHsv) * col.x + + (.587 * _HsvBright - .588 * cosHsv - 1.05 * sinHsv) * col.y + + (.114 * _HsvBright + .886 * cosHsv - .203 * sinHsv) * col.z; + col.rgb = resultHsv; + #endif + //------------------------------------------------------- + + //OVERLAY_ON + #if OVERLAY_ON + half2 overlayUvs = d.texcoord0.xy; + overlayUvs.x += ((_Time.y + randomSeed) * _OverlayTextureScrollXSpeed) % 1; + overlayUvs.y += ((_Time.y + randomSeed) * _OverlayTextureScrollYSpeed) % 1; + half4 overlayCol = SAMPLE_TEXTURE2D(_OverlayTex, sampler_OverlayTex, TRANSFORM_TEX(overlayUvs, _OverlayTex)); + overlayCol.rgb *= _OverlayColor.rgb * _OverlayGlow; + #if !OVERLAYMULT_ON + overlayCol.rgb *= overlayCol.a * _OverlayColor.rgb * _OverlayColor.a * _OverlayBlend; + col.rgb += overlayCol.rgb; + #else + overlayCol.a *= _OverlayColor.a; + col = lerp(col, col * overlayCol, _OverlayBlend); + #endif + #endif + + //--------------------------------- + + //OUTBASE_ON + #if OUTBASE_ON + #if OUTBASEPIXELPERF_ON + half2 destUv = half2(_OutlinePixelWidth * _MainTex_TexelSize.x, _OutlinePixelWidth * _MainTex_TexelSize.y); + #else + half2 destUv = half2(_OutlineWidth * _MainTex_TexelSize.x * 200, _OutlineWidth * _MainTex_TexelSize.y * 200); + #endif + + #if OUTDIST_ON + d.texcoord3.x += ((_Time.x + _RandomSeed) * _OutlineDistortTexXSpeed) % 1; + d.texcoord3.y += ((_Time.x + _RandomSeed) * _OutlineDistortTexYSpeed) % 1; + #if ATLAS_ON + d.texcoord3 = half2((d.texcoord3.x - _MinXUV) / (_MaxXUV - _MinXUV), (d.texcoord3.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half outDistortAmnt = (SAMPLE_TEXTURE2D(_OutlineDistortTex, sampler_OutlineDistortTex, d.texcoord3).r - 0.5) * 0.2 * _OutlineDistortAmount; + destUv.x += outDistortAmnt; + destUv.y += outDistortAmnt; + #endif + + half spriteLeft = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(destUv.x, 0)).a; + half spriteRight = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy - half2(destUv.x, 0)).a; + half spriteBottom = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(0, destUv.y)).a; + half spriteTop = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy - half2(0, destUv.y)).a; + half result = spriteLeft + spriteRight + spriteBottom + spriteTop; + + #if OUTBASE8DIR_ON + half spriteTopLeft = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(destUv.x, destUv.y)).a; + half spriteTopRight = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(-destUv.x, destUv.y)).a; + half spriteBotLeft = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(destUv.x, -destUv.y)).a; + half spriteBotRight = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(-destUv.x, -destUv.y)).a; + result = result + spriteTopLeft + spriteTopRight + spriteBotLeft + spriteBotRight; + #endif + + result = step(0.05, saturate(result)); + + #if OUTTEX_ON + d.texcoord1.x += ((_Time.x + _RandomSeed) * _OutlineTexXSpeed) % 1; + d.texcoord1.y += ((_Time.x + _RandomSeed) * _OutlineTexYSpeed) % 1; + #if ATLAS_ON + d.texcoord1 = half2((d.texcoord1.x - _MinXUV) / (_MaxXUV - _MinXUV), (d.texcoord1.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half4 tempOutColor = SAMPLE_TEXTURE2D(_OutlineTex, sampler_OutlineTex, d.texcoord1); + tempOutColor *= _OutlineColor; + _OutlineColor = tempOutColor; + #endif + + result *= (1 - originalAlpha) * _OutlineAlpha; + + half4 outline = _OutlineColor * d.vertexColor.a; + outline.rgb *= _OutlineGlow; + outline.a = result; + #if ONLYOUTLINE_ON + col = outline; + #else + col = lerp(col, outline, result); + #endif + #endif + //------------------------------------------------------- + + //FADE_ON + #if FADE_ON + half2 tiledUvFade1 = TRANSFORM_TEX(d.texcoord0, _FadeTex); + half2 tiledUvFade2 = TRANSFORM_TEX(d.texcoord0, _FadeBurnTex); + #if ATLAS_ON + tiledUvFade1 = half2((tiledUvFade1.x - _MinXUV) / (_MaxXUV - _MinXUV), (tiledUvFade1.y - _MinYUV) / (_MaxYUV - _MinYUV)); + tiledUvFade2 = half2((tiledUvFade2.x - _MinXUV) / (_MaxXUV - _MinXUV), (tiledUvFade2.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half fadeTemp = SAMPLE_TEXTURE2D(_FadeTex, sampler_FadeTex, tiledUvFade1).r; + half fade = smoothstep(_FadeAmount, _FadeAmount + _FadeBurnTransition, fadeTemp); + half fadeBurn = saturate(smoothstep(_FadeAmount - _FadeBurnWidth, _FadeAmount - _FadeBurnWidth + 0.1, fadeTemp) * _FadeAmount); + col.a *= fade; + _FadeBurnColor.rgb *= _FadeBurnGlow; + col += fadeBurn * SAMPLE_TEXTURE2D(_FadeBurnTex, sampler_FadeBurnTex, tiledUvFade2) * _FadeBurnColor * originalAlpha * (1 - col.a); + #endif + //------------------------------------------------------- + + //SHADOW_ON + #if SHADOW_ON + half shadowA = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(_ShadowX, _ShadowY)).a; + half preMultShadowMask = 1 - (saturate(shadowA - col.a) * (1 - col.a)); + col.rgb *= 1 - ((shadowA - col.a) * (1 - col.a)); + col.rgb += (_ShadowColor * shadowA) * (1 - col.a); + col.a = max(shadowA * _ShadowAlpha * d.vertexColor.a, col.a); + #endif + + //------------------------------------------------------- + + //GLOW_ON + #if GLOW_ON + half4 emission; + #if GLOWTEX_ON + emission = SAMPLE_TEXTURE2D(_GlowTex, sampler_GlowTex, d.texcoord0); + #else + emission = col; + #endif + + col.rgb *= _GlowGlobal; + emission.rgb *= emission.a * col.a * _Glow * _GlowColor; + col.rgb += emission.rgb; + #endif + //------------------------------------------------------- + + //COLORRAMP_ON && COLORRAMPOUTLINE_ON + #if COLORRAMP_ON && COLORRAMPOUTLINE_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + luminance = saturate(luminance + _ColorRampLuminosity); + #if GRADIENTCOLORRAMP_ON + col.rgb = lerp(col.rgb, SAMPLE_TEXTURE2D(_ColorRampTexGradient, sampler_ColorRampTexGradient, half2(luminance, 0)).rgb, _ColorRampBlend); + #else + col.rgb = lerp(col.rgb, SAMPLE_TEXTURE2D(_ColorRampTex, sampler_ColorRampTex, half2(luminance, 0)).rgb, _ColorRampBlend); + #endif + #endif + //--------------- + + //GREYSCALE_ON && GREYSCALEOUTLINE_ON + #if GREYSCALE_ON && GREYSCALEOUTLINE_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + luminance = saturate(luminance + _GreyscaleLuminosity); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _GreyscaleTintColor, _GreyscaleBlend); + #endif + + //----------------------------------- + + //POSTERIZE_ON && POSTERIZEOUTLINE_ON + #if POSTERIZE_ON && POSTERIZEOUTLINE_ON + col.rgb = pow(col.rgb, _PosterizeGamma) * _PosterizeNumColors; + col.rgb = floor(col.rgb) / _PosterizeNumColors; + col.rgb = pow(col.rgb, 1.0 / _PosterizeGamma); + #endif + + //----------------------------------- + + //SHINE_ON + #if SHINE_ON + half2 uvShine = uvRect; + half cosAngle = cos(_ShineRotate); + half sinAngle = sin(_ShineRotate); + half2x2 rot = half2x2(cosAngle, -sinAngle, sinAngle, cosAngle); + uvShine -= half2(0.5, 0.5); + uvShine = mul(rot, uvShine); + uvShine += half2(0.5, 0.5); + half shineMask = SAMPLE_TEXTURE2D(_ShineMask, sampler_ShineMask, d.texcoord0.xy).a; + half currentDistanceProjection = (uvShine.x + uvShine.y) / 2; + half whitePower = 1 - (abs(currentDistanceProjection - _ShineLocation) / _ShineWidth); + col.rgb += col.a * whitePower * _ShineGlow * max(sign(currentDistanceProjection - (_ShineLocation - _ShineWidth)), 0.0) + * max(sign((_ShineLocation + _ShineWidth) - currentDistanceProjection), 0.0) * _ShineColor * shineMask; + #endif + + //----------------------------------- + + //HOLOGRAM_ON + #if HOLOGRAM_ON + half totalHologram = _HologramStripesAmount + _HologramUnmodAmount; + half hologramYCoord = ((uvRect.y + (((_Time.x + randomSeed) % 1) * _HologramStripesSpeed)) % totalHologram) / totalHologram; + hologramYCoord = abs(hologramYCoord); + half alpha = RemapFloat(saturate(hologramYCoord - (_HologramUnmodAmount/totalHologram)), 0.0, 1.0, _HologramMinAlpha, saturate(_HologramMaxAlpha)); + half hologramMask = max(sign((_HologramUnmodAmount/totalHologram) - hologramYCoord), 0.0); + half4 hologramResult = col; + hologramResult.a *= lerp(alpha, 1, hologramMask); + hologramResult.rgb *= max(1, _HologramMaxAlpha * max(sign(hologramYCoord - (_HologramUnmodAmount/totalHologram)), 0.0)); + hologramMask = 1 - step(0.01,hologramMask); + hologramResult.rgb += hologramMask * _HologramStripeColor * col.a; + col = lerp(col, hologramResult, _HologramBlend); + #endif + + //----------------------------------- + + //FLICKER_ON + #if FLICKER_ON + col.a *= saturate(col.a * step(frac(0.05 + (_Time.w + randomSeed) * _FlickerFreq), 1 - _FlickerPercent) + _FlickerAlpha); + #endif + //----------------------------------- + + //ALPHACUTOFF_ON + + //ALPHAROUND_ON + + //ALPHAOUTLINE_ON + #if ALPHAOUTLINE_ON + half alphaOutlineRes = pow(1 - col.a, max(_AlphaOutlinePower, 0.0001)) * step(_AlphaOutlineMinAlpha, col.a) * _AlphaOutlineBlend; + col.rgb = lerp(col.rgb, _AlphaOutlineColor.rgb * _AlphaOutlineGlow, alphaOutlineRes); + col.a = lerp(col.a, 1, alphaOutlineRes > 1); + #endif + //------------------------------------------------------- + + //FOG_ON + + //------------------ + + col *= _Color; + o.Albedo = col; + col.a *= _Alpha; + clip(col.a - _AlphaCutoffValue - 0.01); + o.Alpha = _Color.a; + } + + + + + + void ChainSurfaceFunction(inout Surface l, inout ShaderData d) + { + Ext_SurfaceFunction0(l, d); + // Ext_SurfaceFunction1(l, d); + // Ext_SurfaceFunction2(l, d); + // Ext_SurfaceFunction3(l, d); + // Ext_SurfaceFunction4(l, d); + // Ext_SurfaceFunction5(l, d); + // Ext_SurfaceFunction6(l, d); + // Ext_SurfaceFunction7(l, d); + // Ext_SurfaceFunction8(l, d); + // Ext_SurfaceFunction9(l, d); + // Ext_SurfaceFunction10(l, d); + // Ext_SurfaceFunction11(l, d); + // Ext_SurfaceFunction12(l, d); + // Ext_SurfaceFunction13(l, d); + // Ext_SurfaceFunction14(l, d); + // Ext_SurfaceFunction15(l, d); + // Ext_SurfaceFunction16(l, d); + // Ext_SurfaceFunction17(l, d); + // Ext_SurfaceFunction18(l, d); + // Ext_SurfaceFunction19(l, d); + // Ext_SurfaceFunction20(l, d); + // Ext_SurfaceFunction21(l, d); + // Ext_SurfaceFunction22(l, d); + // Ext_SurfaceFunction23(l, d); + // Ext_SurfaceFunction24(l, d); + // Ext_SurfaceFunction25(l, d); + // Ext_SurfaceFunction26(l, d); + // Ext_SurfaceFunction27(l, d); + // Ext_SurfaceFunction28(l, d); + // Ext_SurfaceFunction29(l, d); + } + +#if !_DECALSHADER + + void ChainModifyVertex(inout VertexData v, inout VertexToPixel v2p, float4 time) + { + ExtraV2F d; + + ZERO_INITIALIZE(ExtraV2F, d); + ZERO_INITIALIZE(Blackboard, d.blackboard); + // due to motion vectors in HDRP, we need to use the last + // time in certain spots. So if you are going to use _Time to adjust vertices, + // you need to use this time or motion vectors will break. + d.time = time; + + Ext_ModifyVertex0(v, d); + // Ext_ModifyVertex1(v, d); + // Ext_ModifyVertex2(v, d); + // Ext_ModifyVertex3(v, d); + // Ext_ModifyVertex4(v, d); + // Ext_ModifyVertex5(v, d); + // Ext_ModifyVertex6(v, d); + // Ext_ModifyVertex7(v, d); + // Ext_ModifyVertex8(v, d); + // Ext_ModifyVertex9(v, d); + // Ext_ModifyVertex10(v, d); + // Ext_ModifyVertex11(v, d); + // Ext_ModifyVertex12(v, d); + // Ext_ModifyVertex13(v, d); + // Ext_ModifyVertex14(v, d); + // Ext_ModifyVertex15(v, d); + // Ext_ModifyVertex16(v, d); + // Ext_ModifyVertex17(v, d); + // Ext_ModifyVertex18(v, d); + // Ext_ModifyVertex19(v, d); + // Ext_ModifyVertex20(v, d); + // Ext_ModifyVertex21(v, d); + // Ext_ModifyVertex22(v, d); + // Ext_ModifyVertex23(v, d); + // Ext_ModifyVertex24(v, d); + // Ext_ModifyVertex25(v, d); + // Ext_ModifyVertex26(v, d); + // Ext_ModifyVertex27(v, d); + // Ext_ModifyVertex28(v, d); + // Ext_ModifyVertex29(v, d); + + + // #if %EXTRAV2F0REQUIREKEY% + // v2p.extraV2F0 = d.extraV2F0; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // v2p.extraV2F1 = d.extraV2F1; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // v2p.extraV2F2 = d.extraV2F2; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // v2p.extraV2F3 = d.extraV2F3; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // v2p.extraV2F4 = d.extraV2F4; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // v2p.extraV2F5 = d.extraV2F5; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // v2p.extraV2F6 = d.extraV2F6; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // v2p.extraV2F7 = d.extraV2F7; + // #endif + } + + void ChainModifyTessellatedVertex(inout VertexData v, inout VertexToPixel v2p) + { + ExtraV2F d; + ZERO_INITIALIZE(ExtraV2F, d); + ZERO_INITIALIZE(Blackboard, d.blackboard); + + // #if %EXTRAV2F0REQUIREKEY% + // d.extraV2F0 = v2p.extraV2F0; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // d.extraV2F1 = v2p.extraV2F1; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // d.extraV2F2 = v2p.extraV2F2; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // d.extraV2F3 = v2p.extraV2F3; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // d.extraV2F4 = v2p.extraV2F4; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // d.extraV2F5 = v2p.extraV2F5; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // d.extraV2F6 = v2p.extraV2F6; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // d.extraV2F7 = v2p.extraV2F7; + // #endif + + + // Ext_ModifyTessellatedVertex0(v, d); + // Ext_ModifyTessellatedVertex1(v, d); + // Ext_ModifyTessellatedVertex2(v, d); + // Ext_ModifyTessellatedVertex3(v, d); + // Ext_ModifyTessellatedVertex4(v, d); + // Ext_ModifyTessellatedVertex5(v, d); + // Ext_ModifyTessellatedVertex6(v, d); + // Ext_ModifyTessellatedVertex7(v, d); + // Ext_ModifyTessellatedVertex8(v, d); + // Ext_ModifyTessellatedVertex9(v, d); + // Ext_ModifyTessellatedVertex10(v, d); + // Ext_ModifyTessellatedVertex11(v, d); + // Ext_ModifyTessellatedVertex12(v, d); + // Ext_ModifyTessellatedVertex13(v, d); + // Ext_ModifyTessellatedVertex14(v, d); + // Ext_ModifyTessellatedVertex15(v, d); + // Ext_ModifyTessellatedVertex16(v, d); + // Ext_ModifyTessellatedVertex17(v, d); + // Ext_ModifyTessellatedVertex18(v, d); + // Ext_ModifyTessellatedVertex19(v, d); + // Ext_ModifyTessellatedVertex20(v, d); + // Ext_ModifyTessellatedVertex21(v, d); + // Ext_ModifyTessellatedVertex22(v, d); + // Ext_ModifyTessellatedVertex23(v, d); + // Ext_ModifyTessellatedVertex24(v, d); + // Ext_ModifyTessellatedVertex25(v, d); + // Ext_ModifyTessellatedVertex26(v, d); + // Ext_ModifyTessellatedVertex27(v, d); + // Ext_ModifyTessellatedVertex28(v, d); + // Ext_ModifyTessellatedVertex29(v, d); + + // #if %EXTRAV2F0REQUIREKEY% + // v2p.extraV2F0 = d.extraV2F0; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // v2p.extraV2F1 = d.extraV2F1; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // v2p.extraV2F2 = d.extraV2F2; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // v2p.extraV2F3 = d.extraV2F3; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // v2p.extraV2F4 = d.extraV2F4; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // v2p.extraV2F5 = d.extraV2F5; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // v2p.extraV2F6 = d.extraV2F6; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // v2p.extraV2F7 = d.extraV2F7; + // #endif + } + + void ChainFinalColorForward(inout Surface l, inout ShaderData d, inout half4 color) + { + // Ext_FinalColorForward0(l, d, color); + // Ext_FinalColorForward1(l, d, color); + // Ext_FinalColorForward2(l, d, color); + // Ext_FinalColorForward3(l, d, color); + // Ext_FinalColorForward4(l, d, color); + // Ext_FinalColorForward5(l, d, color); + // Ext_FinalColorForward6(l, d, color); + // Ext_FinalColorForward7(l, d, color); + // Ext_FinalColorForward8(l, d, color); + // Ext_FinalColorForward9(l, d, color); + // Ext_FinalColorForward10(l, d, color); + // Ext_FinalColorForward11(l, d, color); + // Ext_FinalColorForward12(l, d, color); + // Ext_FinalColorForward13(l, d, color); + // Ext_FinalColorForward14(l, d, color); + // Ext_FinalColorForward15(l, d, color); + // Ext_FinalColorForward16(l, d, color); + // Ext_FinalColorForward17(l, d, color); + // Ext_FinalColorForward18(l, d, color); + // Ext_FinalColorForward19(l, d, color); + // Ext_FinalColorForward20(l, d, color); + // Ext_FinalColorForward21(l, d, color); + // Ext_FinalColorForward22(l, d, color); + // Ext_FinalColorForward23(l, d, color); + // Ext_FinalColorForward24(l, d, color); + // Ext_FinalColorForward25(l, d, color); + // Ext_FinalColorForward26(l, d, color); + // Ext_FinalColorForward27(l, d, color); + // Ext_FinalColorForward28(l, d, color); + // Ext_FinalColorForward29(l, d, color); + } + + void ChainFinalGBufferStandard(inout Surface s, inout ShaderData d, inout half4 GBuffer0, inout half4 GBuffer1, inout half4 GBuffer2, inout half4 outEmission, inout half4 outShadowMask) + { + // Ext_FinalGBufferStandard0(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard1(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard2(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard3(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard4(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard5(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard6(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard7(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard8(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard9(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard10(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard11(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard12(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard13(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard14(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard15(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard16(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard17(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard18(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard19(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard20(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard21(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard22(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard23(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard24(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard25(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard26(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard27(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard28(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard29(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + } +#endif + + + + + +#if _DECALSHADER + + ShaderData CreateShaderData(SurfaceDescriptionInputs IN) + { + ShaderData d = (ShaderData)0; + d.TBNMatrix = float3x3(IN.WorldSpaceTangent, IN.WorldSpaceBiTangent, IN.WorldSpaceNormal); + d.worldSpaceNormal = IN.WorldSpaceNormal; + d.worldSpaceTangent = IN.WorldSpaceTangent; + + d.worldSpacePosition = IN.WorldSpacePosition; + d.texcoord0 = IN.uv0.xyxy; + d.screenPos = IN.ScreenPosition; + + d.worldSpaceViewDir = normalize(_WorldSpaceCameraPos - d.worldSpacePosition); + + d.tangentSpaceViewDir = mul(d.TBNMatrix, d.worldSpaceViewDir); + + // these rarely get used, so we back transform them. Usually will be stripped. + #if _HDRP + // d.localSpacePosition = mul(GetWorldToObjectMatrix(), float4(GetCameraRelativePositionWS(d.worldSpacePosition), 1)).xyz; + #else + // d.localSpacePosition = mul(GetWorldToObjectMatrix(), float4(d.worldSpacePosition, 1)).xyz; + #endif + // d.localSpaceNormal = normalize(mul((float3x3)GetWorldToObjectMatrix(), d.worldSpaceNormal)); + // d.localSpaceTangent = normalize(mul((float3x3)GetWorldToObjectMatrix(), d.worldSpaceTangent.xyz)); + + // #if %SCREENPOSREQUIREKEY% + // d.screenUV = (IN.ScreenPosition.xy / max(0.01, IN.ScreenPosition.w)); + // #endif + + return d; + } +#else + + ShaderData CreateShaderData(VertexToPixel i + #if NEED_FACING + , bool facing + #endif + ) + { + ShaderData d = (ShaderData)0; + d.clipPos = i.pos; + d.worldSpacePosition = i.worldPos; + + d.worldSpaceNormal = normalize(i.worldNormal); + d.worldSpaceTangent.xyz = normalize(i.worldTangent.xyz); + + d.tangentSign = i.worldTangent.w * unity_WorldTransformParams.w; + float3 bitangent = cross(d.worldSpaceTangent.xyz, d.worldSpaceNormal) * d.tangentSign; + + d.TBNMatrix = float3x3(d.worldSpaceTangent, -bitangent, d.worldSpaceNormal); + d.worldSpaceViewDir = normalize(_WorldSpaceCameraPos - i.worldPos); + + d.tangentSpaceViewDir = mul(d.TBNMatrix, d.worldSpaceViewDir); + d.texcoord0 = i.texcoord0; + d.texcoord1 = i.texcoord1; + d.texcoord2 = i.texcoord2; + + // #if %TEXCOORD3REQUIREKEY% + d.texcoord3 = i.texcoord3; + // #endif + + // d.isFrontFace = facing; + // #if %VERTEXCOLORREQUIREKEY% + d.vertexColor = i.vertexColor; + // #endif + + // these rarely get used, so we back transform them. Usually will be stripped. + #if _HDRP + // d.localSpacePosition = mul(GetWorldToObjectMatrix(), float4(GetCameraRelativePositionWS(i.worldPos), 1)).xyz; + #else + // d.localSpacePosition = mul(GetWorldToObjectMatrix(), float4(i.worldPos, 1)).xyz; + #endif + // d.localSpaceNormal = normalize(mul((float3x3)GetWorldToObjectMatrix(), i.worldNormal)); + // d.localSpaceTangent = normalize(mul((float3x3)GetWorldToObjectMatrix(), i.worldTangent.xyz)); + + // #if %SCREENPOSREQUIREKEY% + // d.screenPos = i.screenPos; + // d.screenUV = (i.screenPos.xy / i.screenPos.w); + // #endif + + + // #if %EXTRAV2F0REQUIREKEY% + // d.extraV2F0 = i.extraV2F0; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // d.extraV2F1 = i.extraV2F1; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // d.extraV2F2 = i.extraV2F2; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // d.extraV2F3 = i.extraV2F3; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // d.extraV2F4 = i.extraV2F4; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // d.extraV2F5 = i.extraV2F5; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // d.extraV2F6 = i.extraV2F6; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // d.extraV2F7 = i.extraV2F7; + // #endif + + return d; + } + +#endif + + + #if defined(_PASSSHADOW) + float3 _LightDirection; + float3 _LightPosition; + #endif + + #if (_PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR))) + + #define GetWorldToViewMatrix() _ViewMatrix + #define UNITY_MATRIX_I_V _InvViewMatrix + #define GetViewToHClipMatrix() OptimizeProjectionMatrix(_ProjMatrix) + #define UNITY_MATRIX_I_P _InvProjMatrix + #define GetWorldToHClipMatrix() _ViewProjMatrix + #define UNITY_MATRIX_I_VP _InvViewProjMatrix + #define UNITY_MATRIX_UNJITTERED_VP _NonJitteredViewProjMatrix + #define UNITY_MATRIX_PREV_VP _PrevViewProjMatrix + #define UNITY_MATRIX_PREV_I_VP _PrevInvViewProjMatrix + + void MotionVectorPositionZBias(VertexToPixel input) + { + #if UNITY_REVERSED_Z + input.pos.z -= unity_MotionVectorsParams.z * input.pos.w; + #else + input.pos.z += unity_MotionVectorsParams.z * input.pos.w; + #endif + } + + #endif + + // vertex shader + VertexToPixel Vert (VertexData v) + { + VertexToPixel o = (VertexToPixel)0; + + UNITY_SETUP_INSTANCE_ID(v); + UNITY_TRANSFER_INSTANCE_ID(v, o); + UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o); + + + #if _URP && (_PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR))) + VertexData previousMesh = v; + #endif + #if !_TESSELLATION_ON + ChainModifyVertex(v, o, _Time); + #endif + + o.texcoord0 = v.texcoord0; + o.texcoord1 = v.texcoord1; + o.texcoord2 = v.texcoord2; + + // #if %TEXCOORD3REQUIREKEY% + o.texcoord3 = v.texcoord3; + // #endif + + // #if %VERTEXCOLORREQUIREKEY% + o.vertexColor = v.vertexColor; + // #endif + + // This return the camera relative position (if enable) + float3 positionWS = TransformObjectToWorld(v.vertex.xyz); + float3 normalWS = TransformObjectToWorldNormal(v.normal); + float4 tangentWS = float4(TransformObjectToWorldDir(v.tangent.xyz), v.tangent.w); + + VertexPositionInputs vertexInput = GetVertexPositionInputs(v.vertex.xyz); + o.worldPos = positionWS; + o.worldNormal = normalWS; + o.worldTangent = tangentWS; + + + // For some very odd reason, in 2021.2, we can't use Unity's defines, but have to use our own.. + #if _PASSSHADOW + #if _CASTING_PUNCTUAL_LIGHT_SHADOW + float3 lightDirectionWS = normalize(_LightPosition - o.worldPos); + #else + float3 lightDirectionWS = _LightDirection; + #endif + // Define shadow pass specific clip position for Universal + o.pos = TransformWorldToHClip(ApplyShadowBias(o.worldPos, o.worldNormal, lightDirectionWS)); + #if UNITY_REVERSED_Z + o.pos.z = min(o.pos.z, UNITY_NEAR_CLIP_VALUE); + #else + o.pos.z = max(o.pos.z, UNITY_NEAR_CLIP_VALUE); + #endif + #elif _PASSMETA + o.pos = MetaVertexPosition(float4(v.vertex.xyz, 0), v.texcoord1.xy, v.texcoord2.xy, unity_LightmapST, unity_DynamicLightmapST); + #else + o.pos = TransformWorldToHClip(o.worldPos); + #endif + + // #if %SCREENPOSREQUIREKEY% + // o.screenPos = ComputeScreenPos(o.pos, _ProjectionParams.x); + // #endif + + + #if _PASSFORWARD || _PASSGBUFFER + float2 uv1 = v.texcoord1.xy; + OUTPUT_LIGHTMAP_UV(uv1, unity_LightmapST, o.lightmapUV); + o.texcoord1.xy = uv1; + #if UNITY_VERSION < 60000009 + OUTPUT_SH(o.worldNormal, o.sh); + #endif + + #if defined(DYNAMICLIGHTMAP_ON) + o.dynamicLightmapUV.xy = v.texcoord2.xy * unity_DynamicLightmapST.xy + unity_DynamicLightmapST.zw; + #if UNITY_VERSION >= 60000009 + OUTPUT_SH(o.worldNormal, o.sh); + #endif + #elif (defined(PROBE_VOLUMES_L1) || defined(PROBE_VOLUMES_L2)) && UNITY_VERSION >= 60000009 + OUTPUT_SH4(vertexInput.positionWS, o.worldNormal.xyz, GetWorldSpaceNormalizeViewDir(vertexInput.positionWS), o.sh, o.probeOcclusion); + #endif + #endif + + #ifdef VARYINGS_NEED_FOG_AND_VERTEX_LIGHT + half fogFactor = 0; + #if defined(_FOG_FRAGMENT) + fogFactor = ComputeFogFactor(o.pos.z); + #endif + #if _BAKEDLIT + o.fogFactorAndVertexLight = half4(fogFactor, 0, 0, 0); + #else + half3 vertexLight = VertexLighting(o.worldPos, o.worldNormal); + o.fogFactorAndVertexLight = half4(fogFactor, vertexLight); + #endif + #endif + + #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR) + o.shadowCoord = GetShadowCoord(vertexInput); + #endif + + #if _URP && (_PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR))) + #if !defined(TESSELLATION_ON) + MotionVectorPositionZBias(o); + #endif + + o.previousPositionCS = float4(0.0, 0.0, 0.0, 1.0); + // Note: unity_MotionVectorsParams.y is 0 is forceNoMotion is enabled + bool forceNoMotion = unity_MotionVectorsParams.y == 0.0; + + if (!forceNoMotion) + { + #if defined(HAVE_VFX_MODIFICATION) + float3 previousPositionOS = currentFrameMvData.vfxParticlePositionOS; + #if defined(VFX_FEATURE_MOTION_VECTORS_VERTS) + const bool applyDeformation = false; + #else + const bool applyDeformation = true; + #endif + #else + const bool hasDeformation = unity_MotionVectorsParams.x == 1; // Mesh has skinned deformation + float3 previousPositionOS = hasDeformation ? previousMesh.previousPositionOS : previousMesh.vertex.xyz; + + #if defined(AUTOMATIC_TIME_BASED_MOTION_VECTORS) && defined(GRAPH_VERTEX_USES_TIME_PARAMETERS_INPUT) + const bool applyDeformation = true; + #else + const bool applyDeformation = hasDeformation; + #endif + #endif + // TODO + #if defined(FEATURES_GRAPH_VERTEX) + if (applyDeformation) + previousPositionOS = GetLastFrameDeformedPosition(previousMesh, currentFrameMvData, previousPositionOS); + else + previousPositionOS = previousMesh.positionOS; + + #if defined(FEATURES_GRAPH_VERTEX_MOTION_VECTOR_OUTPUT) + previousPositionOS -= previousMesh.precomputedVelocity; + #endif + #endif + + #if defined(UNITY_DOTS_INSTANCING_ENABLED) && defined(DOTS_DEFORMED) + // Deformed vertices in DOTS are not cumulative with built-in Unity skinning/blend shapes + // Needs to be called after vertex modification has been applied otherwise it will be + // overwritten by Compute Deform node + ApplyPreviousFrameDeformedVertexPosition(previousMesh.vertexID, previousPositionOS); + #endif + #if defined (_ADD_PRECOMPUTED_VELOCITY) + previousPositionOS -= previousMesh.precomputedVelocity; + #endif + o.positionCS = mul(UNITY_MATRIX_UNJITTERED_VP, float4(positionWS, 1.0f)); + + #if defined(HAVE_VFX_MODIFICATION) + #if defined(VFX_FEATURE_MOTION_VECTORS_VERTS) + #if defined(FEATURES_GRAPH_VERTEX_MOTION_VECTOR_OUTPUT) || defined(_ADD_PRECOMPUTED_VELOCITY) + #error Unexpected fast path rendering VFX motion vector while there are vertex modification afterwards. + #endif + o.previousPositionCS = VFXGetPreviousClipPosition(previousMesh, currentFrameMvData.vfxElementAttributes, o.positionCS); + #else + #if VFX_WORLD_SPACE + //previousPositionOS is already in world space + const float3 previousPositionWS = previousPositionOS; + #else + const float3 previousPositionWS = mul(UNITY_PREV_MATRIX_M, float4(previousPositionOS, 1.0f)).xyz; + #endif + o.previousPositionCS = mul(UNITY_MATRIX_PREV_VP, float4(previousPositionWS, 1.0f)); + #endif + #else + o.previousPositionCS = mul(UNITY_MATRIX_PREV_VP, mul(UNITY_PREV_MATRIX_M, float4(previousPositionOS, 1))); + #endif + } + #endif + + return o; + } + + + + + // fragment shader + half4 Frag (VertexToPixel IN + #ifdef _DEPTHOFFSET_ON + , out float outputDepth : SV_Depth + #endif + #if NEED_FACING + , bool facing : SV_IsFrontFace + #endif + ) : SV_Target + { + UNITY_SETUP_INSTANCE_ID(IN); + + #if defined(LOD_FADE_CROSSFADE) + LODFadeCrossFade(IN.pos); + #endif + + ShaderData d = CreateShaderData(IN + #if NEED_FACING + , facing + #endif + ); + Surface l = (Surface)0; + + #ifdef _DEPTHOFFSET_ON + l.outputDepth = outputDepth; + #endif + + l.Albedo = half3(0.5, 0.5, 0.5); + l.Normal = float3(0,0,1); + l.Occlusion = 1; + l.Alpha = 1; + + ChainSurfaceFunction(l, d); + + #ifdef _DEPTHOFFSET_ON + outputDepth = l.outputDepth; + #endif + + return 0; + + } + + ENDHLSL + + } + + + + Pass + { + Name "DepthOnly" + Tags + { + "LightMode" = "DepthOnly" + } + + // Render State + Blend One Zero, One Zero + Cull Back + ZTest LEqual + ZWrite On + ColorMask 0 + + Tags { "RenderType" = "Opaque" "Queue" = "Geometry" "PreviewType" = "Plane" } + Cull [_CullingOption] + ZWrite [_ZWrite] + ZTest [_ZTestMode] + + + HLSLPROGRAM + + #pragma vertex Vert + #pragma fragment Frag + + + #define _PASSDEPTH 1 + + #pragma target 3.0 + #pragma prefer_hlslcc gles + #pragma exclude_renderers d3d11_9x + #pragma multi_compile_instancing + + + #pragma shader_feature_local GLOW_ON + #pragma shader_feature_local FADE_ON + #pragma shader_feature_local OUTBASE_ON + #pragma shader_feature_local ONLYOUTLINE_ON + #pragma shader_feature_local GRADIENT_ON + #pragma shader_feature_local GRADIENT2COL_ON + #pragma shader_feature_local RADIALGRADIENT_ON + #pragma shader_feature_local COLORSWAP_ON + #pragma shader_feature_local HSV_ON + #pragma shader_feature_local CHANGECOLOR_ON + #pragma shader_feature_local CHANGECOLOR2_ON + #pragma shader_feature_local CHANGECOLOR3_ON + #pragma shader_feature_local COLORRAMP_ON + #pragma shader_feature_local GRADIENTCOLORRAMP_ON + #pragma shader_feature_local HITEFFECT_ON + #pragma shader_feature_local NEGATIVE_ON + #pragma shader_feature_local PIXELATE_ON + #pragma shader_feature_local GREYSCALE_ON + #pragma shader_feature_local POSTERIZE_ON + #pragma shader_feature_local BLUR_ON + #pragma shader_feature_local MOTIONBLUR_ON + #pragma shader_feature_local GHOST_ON + #pragma shader_feature_local ALPHAOUTLINE_ON + #pragma shader_feature_local INNEROUTLINE_ON + #pragma shader_feature_local ONLYINNEROUTLINE_ON + #pragma shader_feature_local HOLOGRAM_ON + #pragma shader_feature_local CHROMABERR_ON + #pragma shader_feature_local GLITCH_ON + #pragma shader_feature_local FLICKER_ON + #pragma shader_feature_local SHADOW_ON + #pragma shader_feature_local SHINE_ON + #pragma shader_feature_local CONTRAST_ON + #pragma shader_feature_local OVERLAY_ON + #pragma shader_feature_local OVERLAYMULT_ON + #pragma shader_feature_local DOODLE_ON + #pragma shader_feature_local WIND_ON + #pragma shader_feature_local WAVEUV_ON + #pragma shader_feature_local ROUNDWAVEUV_ON + #pragma shader_feature_local RECTSIZE_ON + #pragma shader_feature_local OFFSETUV_ON + #pragma shader_feature_local CLIPPING_ON + #pragma shader_feature_local RADIALCLIPPING_ON + #pragma shader_feature_local TEXTURESCROLL_ON + #pragma shader_feature_local ZOOMUV_ON + #pragma shader_feature_local DISTORT_ON + #pragma shader_feature_local WARP_ON + #pragma shader_feature_local TWISTUV_ON + #pragma shader_feature_local ROTATEUV_ON + #pragma shader_feature_local POLARUV_ON + #pragma shader_feature_local FISHEYE_ON + #pragma shader_feature_local PINCH_ON + #pragma shader_feature_local SHAKEUV_ON + + #pragma shader_feature_local GLOWTEX_ON + #pragma shader_feature_local OUTTEX_ON + #pragma shader_feature_local OUTDIST_ON + #pragma shader_feature_local OUTBASE8DIR_ON + #pragma shader_feature_local OUTBASEPIXELPERF_ON + #pragma shader_feature_local COLORRAMPOUTLINE_ON + #pragma shader_feature_local GREYSCALEOUTLINE_ON + #pragma shader_feature_local POSTERIZEOUTLINE_ON + #pragma shader_feature_local BLURISHD_ON + #pragma shader_feature_local MANUALWIND_ON + #pragma shader_feature_local ATLAS_ON + #pragma shader_feature_local PREMULTIPLYALPHA_ON + + #pragma shader_feature BILBOARD_ON + #pragma shader_feature BILBOARDY_ON + + #pragma shader_feature NORMALMAP_ON + + + #define _URP 1 +#define _USINGTEXCOORD1 1 +#define _USINGTEXCOORD2 1 + + // Includes + //#include_with_pragmas "Packages/com.unity.render-pipelines.universal/ShaderLibrary/DOTS.hlsl" + #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.universal/ShaderLibrary/Input.hlsl" + #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/TextureStack.hlsl" + #include_with_pragmas "Packages/com.unity.render-pipelines.core/ShaderLibrary/FoveatedRenderingKeywords.hlsl" + #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/ShaderGraphFunctions.hlsl" + #include "Packages/com.unity.render-pipelines.universal/Editor/ShaderGraph/Includes/ShaderPass.hlsl" + + + #undef WorldNormalVector + #define WorldNormalVector(data, normal) mul(normal, data.TBNMatrix) + + #define UnityObjectToWorldNormal(normal) mul(GetObjectToWorldMatrix(), normal) + + #define _WorldSpaceLightPos0 _MainLightPosition + + #define UNITY_DECLARE_TEX2D(name) TEXTURE2D(name); SAMPLER(sampler##name); + #define UNITY_DECLARE_TEX2D_NOSAMPLER(name) TEXTURE2D(name); + #define UNITY_DECLARE_TEX2DARRAY(name) TEXTURE2D_ARRAY(name); SAMPLER(sampler##name); + #define UNITY_DECLARE_TEX2DARRAY_NOSAMPLER(name) TEXTURE2D_ARRAY(name); + + #define UNITY_SAMPLE_TEX2DARRAY(tex,coord) SAMPLE_TEXTURE2D_ARRAY(tex, sampler##tex, coord.xy, coord.z) + #define UNITY_SAMPLE_TEX2DARRAY_LOD(tex,coord,lod) SAMPLE_TEXTURE2D_ARRAY_LOD(tex, sampler##tex, coord.xy, coord.z, lod) + #define UNITY_SAMPLE_TEX2D(tex, coord) SAMPLE_TEXTURE2D(tex, sampler##tex, coord) + #define UNITY_SAMPLE_TEX2D_SAMPLER(tex, samp, coord) SAMPLE_TEXTURE2D(tex, sampler##samp, coord) + + #define UNITY_SAMPLE_TEX2D_LOD(tex,coord, lod) SAMPLE_TEXTURE2D_LOD(tex, sampler_##tex, coord, lod) + #define UNITY_SAMPLE_TEX2D_SAMPLER_LOD(tex,samplertex,coord, lod) SAMPLE_TEXTURE2D_LOD (tex, sampler##samplertex,coord, lod) + + #if defined(UNITY_COMPILER_HLSL) + #define UNITY_INITIALIZE_OUTPUT(type,name) name = (type)0; + #else + #define UNITY_INITIALIZE_OUTPUT(type,name) + #endif + + #define sampler2D_float sampler2D + #define sampler2D_half sampler2D + + + + // data across stages, stripped like the above. + struct VertexToPixel + { + float4 pos : SV_POSITION; + float3 worldPos : TEXCOORD0; + float3 worldNormal : TEXCOORD1; + float4 worldTangent : TEXCOORD2; + float4 texcoord0 : TEXCOORD3; + float4 texcoord1 : TEXCOORD4; + float4 texcoord2 : TEXCOORD5; + + // #if %TEXCOORD3REQUIREKEY% + float4 texcoord3 : TEXCOORD6; + // #endif + + // #if %SCREENPOSREQUIREKEY% + // float4 screenPos : TEXCOORD7; + // #endif + + // #if %VERTEXCOLORREQUIREKEY% + half4 vertexColor : COLOR; + // #endif + + #if defined(LIGHTMAP_ON) + float2 lightmapUV : TEXCOORD8; + #endif + #if defined(DYNAMICLIGHTMAP_ON) + float2 dynamicLightmapUV : TEXCOORD9; + #endif + #if !defined(LIGHTMAP_ON) + float4 probeOcclusion : TEXCOORD8; + float3 sh : TEXCOORD10; + #endif + + #if defined(VARYINGS_NEED_FOG_AND_VERTEX_LIGHT) + float4 fogFactorAndVertexLight : TEXCOORD11; + #endif + + #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR) + float4 shadowCoord : TEXCOORD12; + #endif + + // #if %EXTRAV2F0REQUIREKEY% + // float4 extraV2F0 : TEXCOORD13; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // float4 extraV2F1 : TEXCOORD14; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // float4 extraV2F2 : TEXCOORD15; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // float4 extraV2F3 : TEXCOORD16; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // float4 extraV2F4 : TEXCOORD17; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // float4 extraV2F5 : TEXCOORD18; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // float4 extraV2F6 : TEXCOORD19; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // float4 extraV2F7 : TEXCOORD20; + // #endif + + #if UNITY_ANY_INSTANCING_ENABLED + uint instanceID : CUSTOM_INSTANCE_ID; + #endif + #if (defined(UNITY_STEREO_MULTIVIEW_ENABLED)) || (defined(UNITY_STEREO_INSTANCING_ENABLED) && (defined(SHADER_API_GLES3) || defined(SHADER_API_GLCORE))) + uint stereoTargetEyeIndexAsBlendIdx0 : BLENDINDICES0; + #endif + #if (defined(UNITY_STEREO_INSTANCING_ENABLED)) + uint stereoTargetEyeIndexAsRTArrayIdx : SV_RenderTargetArrayIndex; + #endif + #if defined(SHADER_STAGE_FRAGMENT) && defined(VARYINGS_NEED_CULLFACE) + FRONT_FACE_TYPE cullFace : FRONT_FACE_SEMANTIC; + #endif + + #if _PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR)) + float4 previousPositionCS : TEXCOORD21; // Contain previous transform position (in case of skinning for example) + float4 positionCS : TEXCOORD22; + #endif + }; + + + + + // data describing the user output of a pixel + struct Surface + { + half3 Albedo; + half Height; + half3 Normal; + half Smoothness; + half3 Emission; + half Metallic; + half3 Specular; + half Occlusion; + half SpecularPower; // for simple lighting + half Alpha; + float outputDepth; // if written, SV_Depth semantic is used. ShaderData.clipPos.z is unused value + // HDRP Only + half SpecularOcclusion; + half SubsurfaceMask; + half Thickness; + half CoatMask; + half CoatSmoothness; + half Anisotropy; + half IridescenceMask; + half IridescenceThickness; + int DiffusionProfileHash; + float SpecularAAThreshold; + float SpecularAAScreenSpaceVariance; + // requires _OVERRIDE_BAKEDGI to be defined, but is mapped in all pipelines + float3 DiffuseGI; + float3 BackDiffuseGI; + float3 SpecularGI; + float ior; + float3 transmittanceColor; + float atDistance; + float transmittanceMask; + // requires _OVERRIDE_SHADOWMASK to be defines + float4 ShadowMask; + + // for decals + float NormalAlpha; + float MAOSAlpha; + + + }; + + // Data the user declares in blackboard blocks + struct Blackboard + { + + float blackboardDummyData; + }; + + // data the user might need, this will grow to be big. But easy to strip + struct ShaderData + { + float4 clipPos; // SV_POSITION + float3 localSpacePosition; + float3 localSpaceNormal; + float3 localSpaceTangent; + + float3 worldSpacePosition; + float3 worldSpaceNormal; + float3 worldSpaceTangent; + float tangentSign; + + float3 worldSpaceViewDir; + float3 tangentSpaceViewDir; + + float4 texcoord0; + float4 texcoord1; + float4 texcoord2; + float4 texcoord3; + + float2 screenUV; + float4 screenPos; + + float4 vertexColor; + bool isFrontFace; + + float4 extraV2F0; + float4 extraV2F1; + float4 extraV2F2; + float4 extraV2F3; + float4 extraV2F4; + float4 extraV2F5; + float4 extraV2F6; + float4 extraV2F7; + + float3x3 TBNMatrix; + Blackboard blackboard; + }; + + struct VertexData + { + #if SHADER_TARGET > 30 + // uint vertexID : SV_VertexID; + #endif + float4 vertex : POSITION; + float3 normal : NORMAL; + float4 tangent : TANGENT; + float4 texcoord0 : TEXCOORD0; + + // optimize out mesh coords when not in use by user or lighting system + #if _URP && (_USINGTEXCOORD1 || _PASSMETA || _PASSFORWARD || _PASSGBUFFER) + float4 texcoord1 : TEXCOORD1; + #endif + + #if _URP && (_USINGTEXCOORD2 || _PASSMETA || ((_PASSFORWARD || _PASSGBUFFER) && defined(DYNAMICLIGHTMAP_ON))) + float4 texcoord2 : TEXCOORD2; + #endif + + #if _STANDARD && (_USINGTEXCOORD1 || (_PASSMETA || ((_PASSFORWARD || _PASSGBUFFER || _PASSFORWARDADD) && LIGHTMAP_ON))) + float4 texcoord1 : TEXCOORD1; + #endif + #if _STANDARD && (_USINGTEXCOORD2 || (_PASSMETA || ((_PASSFORWARD || _PASSGBUFFER) && DYNAMICLIGHTMAP_ON))) + float4 texcoord2 : TEXCOORD2; + #endif + + + #if _HDRP + float4 texcoord1 : TEXCOORD1; + float4 texcoord2 : TEXCOORD2; + #endif + + // #if %TEXCOORD3REQUIREKEY% + float4 texcoord3 : TEXCOORD3; + // #endif + + // #if %VERTEXCOLORREQUIREKEY% + float4 vertexColor : COLOR; + // #endif + + #if _PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR)) + float3 previousPositionOS : TEXCOORD4; // Contain previous transform position (in case of skinning for example) + #if defined (_ADD_PRECOMPUTED_VELOCITY) + float3 precomputedVelocity : TEXCOORD5; // Add Precomputed Velocity (Alembic computes velocities on runtime side). + #endif + #endif + + UNITY_VERTEX_INPUT_INSTANCE_ID + }; + + struct TessVertex + { + float4 vertex : INTERNALTESSPOS; + float3 normal : NORMAL; + float4 tangent : TANGENT; + float4 texcoord0 : TEXCOORD0; + float4 texcoord1 : TEXCOORD1; + float4 texcoord2 : TEXCOORD2; + + // #if %TEXCOORD3REQUIREKEY% + float4 texcoord3 : TEXCOORD3; + // #endif + + // #if %VERTEXCOLORREQUIREKEY% + float4 vertexColor : COLOR; + // #endif + + // #if %EXTRAV2F0REQUIREKEY% + // float4 extraV2F0 : TEXCOORD5; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // float4 extraV2F1 : TEXCOORD6; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // float4 extraV2F2 : TEXCOORD7; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // float4 extraV2F3 : TEXCOORD8; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // float4 extraV2F4 : TEXCOORD9; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // float4 extraV2F5 : TEXCOORD10; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // float4 extraV2F6 : TEXCOORD11; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // float4 extraV2F7 : TEXCOORD12; + // #endif + + #if _PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR)) + float3 previousPositionOS : TEXCOORD13; // Contain previous transform position (in case of skinning for example) + #if defined (_ADD_PRECOMPUTED_VELOCITY) + float3 precomputedVelocity : TEXCOORD14; + #endif + #endif + + UNITY_VERTEX_INPUT_INSTANCE_ID + UNITY_VERTEX_OUTPUT_STEREO + }; + + struct ExtraV2F + { + float4 extraV2F0; + float4 extraV2F1; + float4 extraV2F2; + float4 extraV2F3; + float4 extraV2F4; + float4 extraV2F5; + float4 extraV2F6; + float4 extraV2F7; + Blackboard blackboard; + float4 time; + }; + + + float3 WorldToTangentSpace(ShaderData d, float3 normal) + { + return mul(d.TBNMatrix, normal); + } + + float3 TangentToWorldSpace(ShaderData d, float3 normal) + { + return mul(normal, d.TBNMatrix); + } + + // in this case, make standard more like SRPs, because we can't fix + // unity_WorldToObject in HDRP, since it already does macro-fu there + + #if _STANDARD + float3 TransformWorldToObject(float3 p) { return mul(unity_WorldToObject, float4(p, 1)); }; + float3 TransformObjectToWorld(float3 p) { return mul(unity_ObjectToWorld, float4(p, 1)); }; + float4 TransformWorldToObject(float4 p) { return mul(unity_WorldToObject, p); }; + float4 TransformObjectToWorld(float4 p) { return mul(unity_ObjectToWorld, p); }; + float4x4 GetWorldToObjectMatrix() { return unity_WorldToObject; } + float4x4 GetObjectToWorldMatrix() { return unity_ObjectToWorld; } + #if (defined(SHADER_API_D3D11) || defined(SHADER_API_XBOXONE) || defined(UNITY_COMPILER_HLSLCC) || defined(SHADER_API_PSSL) || (SHADER_TARGET_SURFACE_ANALYSIS && !SHADER_TARGET_SURFACE_ANALYSIS_MOJOSHADER)) + #define UNITY_SAMPLE_TEX2D_LOD(tex,coord, lod) tex.SampleLevel (sampler##tex,coord, lod) + #define UNITY_SAMPLE_TEX2D_SAMPLER_LOD(tex,samplertex,coord, lod) tex.SampleLevel (sampler##samplertex,coord, lod) + #else + #define UNITY_SAMPLE_TEX2D_LOD(tex,coord,lod) tex2D (tex,coord,0,lod) + #define UNITY_SAMPLE_TEX2D_SAMPLER_LOD(tex,samplertex,coord,lod) tex2D (tex,coord,0,lod) + #endif + + #undef GetWorldToObjectMatrix() + + #define GetWorldToObjectMatrix() unity_WorldToObject + + + #endif + + float3 GetCameraWorldPosition() + { + #if _HDRP + return GetCameraRelativePositionWS(_WorldSpaceCameraPos); + #else + return _WorldSpaceCameraPos; + #endif + } + + #if _GRABPASSUSED + #if _STANDARD + TEXTURE2D(%GRABTEXTURE%); + SAMPLER(sampler_%GRABTEXTURE%); + #endif + + half3 GetSceneColor(float2 uv) + { + #if _STANDARD + return SAMPLE_TEXTURE2D(%GRABTEXTURE%, sampler_%GRABTEXTURE%, uv).rgb; + #else + return SHADERGRAPH_SAMPLE_SCENE_COLOR(uv); + #endif + } + #endif + + + + #if _STANDARD + UNITY_DECLARE_DEPTH_TEXTURE(_CameraDepthTexture); + float GetSceneDepth(float2 uv) { return SAMPLE_DEPTH_TEXTURE(_CameraDepthTexture, uv); } + float GetLinear01Depth(float2 uv) { return Linear01Depth(GetSceneDepth(uv)); } + float GetLinearEyeDepth(float2 uv) { return LinearEyeDepth(GetSceneDepth(uv)); } + #else + float GetSceneDepth(float2 uv) { return SHADERGRAPH_SAMPLE_SCENE_DEPTH(uv); } + float GetLinear01Depth(float2 uv) { return Linear01Depth(GetSceneDepth(uv), _ZBufferParams); } + float GetLinearEyeDepth(float2 uv) { return LinearEyeDepth(GetSceneDepth(uv), _ZBufferParams); } + #endif + + float3 GetWorldPositionFromDepthBuffer(float2 uv, float3 worldSpaceViewDir) + { + float eye = GetLinearEyeDepth(uv); + float3 camView = mul((float3x3)GetObjectToWorldMatrix(), transpose(mul(GetWorldToObjectMatrix(), UNITY_MATRIX_I_V)) [2].xyz); + + float dt = dot(worldSpaceViewDir, camView); + float3 div = worldSpaceViewDir/dt; + float3 wpos = (eye * div) + GetCameraWorldPosition(); + return wpos; + } + + #if _HDRP + float3 ObjectToWorldSpacePosition(float3 pos) + { + return GetAbsolutePositionWS(TransformObjectToWorld(pos)); + } + #else + float3 ObjectToWorldSpacePosition(float3 pos) + { + return TransformObjectToWorld(pos); + } + #endif + + #if _STANDARD + UNITY_DECLARE_SCREENSPACE_TEXTURE(_CameraDepthNormalsTexture); + float3 GetSceneNormal(float2 uv, float3 worldSpaceViewDir) + { + float4 depthNorms = UNITY_SAMPLE_SCREENSPACE_TEXTURE(_CameraDepthNormalsTexture, uv); + float3 norms = DecodeViewNormalStereo(depthNorms); + norms = mul((float3x3)GetWorldToViewMatrix(), norms) * 0.5 + 0.5; + return norms; + } + #elif _HDRP && !_DECALSHADER + + float3 GetSceneNormal(float2 uv, float3 worldSpaceViewDir) + { + NormalData nd; + DecodeFromNormalBuffer(_ScreenSize.xy * uv, nd); + return nd.normalWS; + } + #elif _URP + #if (SHADER_LIBRARY_VERSION_MAJOR >= 10) + #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/DeclareNormalsTexture.hlsl" + #endif + + float3 GetSceneNormal(float2 uv, float3 worldSpaceViewDir) + { + #if (SHADER_LIBRARY_VERSION_MAJOR >= 10) + return SampleSceneNormals(uv); + #else + float3 wpos = GetWorldPositionFromDepthBuffer(uv, worldSpaceViewDir); + return normalize(-cross(ddx(wpos), ddy(wpos))) * 0.5 + 0.5; + #endif + + } + #endif + + #if _HDRP + + half3 UnpackNormalmapRGorAG(half4 packednormal) + { + // This do the trick + packednormal.x *= packednormal.w; + + half3 normal; + normal.xy = packednormal.xy * 2 - 1; + normal.z = sqrt(1 - saturate(dot(normal.xy, normal.xy))); + return normal; + } + half3 UnpackNormal(half4 packednormal) + { + #if defined(UNITY_NO_DXT5nm) + return packednormal.xyz * 2 - 1; + #else + return UnpackNormalmapRGorAG(packednormal); + #endif + } + #endif + #if _HDRP || _URP + + half3 UnpackScaleNormal(half4 packednormal, half scale) + { + #ifndef UNITY_NO_DXT5nm + // Unpack normal as DXT5nm (1, y, 1, x) or BC5 (x, y, 0, 1) + // Note neutral texture like "bump" is (0, 0, 1, 1) to work with both plain RGB normal and DXT5nm/BC5 + packednormal.x *= packednormal.w; + #endif + half3 normal; + normal.xy = (packednormal.xy * 2 - 1) * scale; + normal.z = sqrt(1 - saturate(dot(normal.xy, normal.xy))); + return normal; + } + + #endif + + + void GetSun(out float3 lightDir, out float3 color) + { + lightDir = float3(0.5, 0.5, 0); + color = 1; + #if _HDRP + if (_DirectionalLightCount > 0) + { + DirectionalLightData light = _DirectionalLightDatas[0]; + lightDir = -light.forward.xyz; + color = light.color; + } + #elif _STANDARD + lightDir = normalize(_WorldSpaceLightPos0.xyz); + color = _LightColor0.rgb; + #elif _URP + Light light = GetMainLight(); + lightDir = light.direction; + color = light.color; + #endif + } + + + + CBUFFER_START(UnityPerMaterial) + + + half4 _Color; + half4 _MainTex_ST, _MainTex_TexelSize; + half _Alpha, _AlphaCutoffValue; + + #if ATLAS_ON + half _MinXUV, _MaxXUV, _MinYUV, _MaxYUV; + #endif + + #if GLOW_ON + half4 _GlowColor; + half _Glow, _GlowGlobal; + #endif + + #if HSV_ON + half _HsvShift, _HsvSaturation, _HsvBright; + #endif + + #if DISTORT_ON + half4 _DistortTex_ST; + half _DistortTexXSpeed, _DistortTexYSpeed, _DistortAmount; + #endif + + #if FADE_ON + half4 _FadeBurnColor, _FadeTex_ST, _FadeBurnTex_ST; + half _FadeAmount, _FadeBurnWidth, _FadeBurnTransition,_FadeBurnGlow; + #endif + + #if OUTBASE_ON + half4 _OutlineColor; + half _OutlineAlpha, _OutlineGlow, _OutlineWidth; + int _OutlinePixelWidth; + #endif + + #if OUTTEX_ON + half4 _OutlineTex_ST; + half _OutlineTexXSpeed, _OutlineTexYSpeed; + #endif + + #if OUTDIST_ON + half4 _OutlineDistortTex_ST; + half _OutlineDistortTexXSpeed, _OutlineDistortTexYSpeed, _OutlineDistortAmount; + #endif + + #if ALPHAOUTLINE_ON + half _AlphaOutlineGlow, _AlphaOutlinePower, _AlphaOutlineMinAlpha, _AlphaOutlineBlend; + half4 _AlphaOutlineColor; + #endif + + #if INNEROUTLINE_ON + half _InnerOutlineThickness, _InnerOutlineAlpha, _InnerOutlineGlow; + half4 _InnerOutlineColor; + #endif + + #if GRADIENT_ON + half _GradBlend, _GradBoostX, _GradBoostY; + half4 _GradTopRightCol, _GradTopLeftCol, _GradBotRightCol, _GradBotLeftCol; + #endif + + #if COLORSWAP_ON + half4 _ColorSwapRed, _ColorSwapGreen, _ColorSwapBlue; + half _ColorSwapRedLuminosity, _ColorSwapGreenLuminosity, _ColorSwapBlueLuminosity, _ColorSwapBlend; + #endif + + #if CHANGECOLOR_ON + half4 _ColorChangeNewCol, _ColorChangeTarget; + half _ColorChangeTolerance, _ColorChangeLuminosity; + #endif + #if CHANGECOLOR2_ON + half4 _ColorChangeNewCol2, _ColorChangeTarget2; + half _ColorChangeTolerance2; + #endif + #if CHANGECOLOR3_ON + half4 _ColorChangeNewCol3, _ColorChangeTarget3; + half _ColorChangeTolerance3; + #endif + + #if COLORRAMP_ON + half _ColorRampLuminosity, _ColorRampBlend; + #endif + + #if HITEFFECT_ON + half4 _HitEffectColor; + half _HitEffectGlow, _HitEffectBlend; + #endif + + #if NEGATIVE_ON + half _NegativeAmount; + #endif + + #if PIXELATE_ON + half _PixelateSize; + #endif + + #if GREYSCALE_ON + half _GreyscaleLuminosity, _GreyscaleBlend; + half4 _GreyscaleTintColor; + #endif + + #if POSTERIZE_ON + half _PosterizeNumColors, _PosterizeGamma; + #endif + + #if BLUR_ON + half _BlurIntensity; + #endif + + #if MOTIONBLUR_ON + half _MotionBlurAngle, _MotionBlurDist; + #endif + + #if GHOST_ON + half _GhostColorBoost, _GhostTransparency, _GhostBlend; + #endif + + #if HOLOGRAM_ON + half _HologramStripesAmount, _HologramMinAlpha, _HologramUnmodAmount, _HologramStripesSpeed, _HologramMaxAlpha, _HologramBlend; + half4 _HologramStripeColor; + #endif + + #if CHROMABERR_ON + half _ChromAberrAmount, _ChromAberrAlpha; + #endif + + #if GLITCH_ON + half _GlitchAmount, _GlitchSize; + #endif + + #if FLICKER_ON + half _FlickerFreq, _FlickerPercent, _FlickerAlpha; + #endif + + #if SHADOW_ON + half _ShadowX, _ShadowY, _ShadowAlpha; + half4 _ShadowColor; + #endif + + #if SHINE_ON + half4 _ShineColor; + half _ShineLocation, _ShineRotate, _ShineWidth, _ShineGlow; + #endif + + #if CONTRAST_ON + half _Contrast, _Brightness; + #endif + + #if OVERLAY_ON + half4 _OverlayTex_ST, _OverlayColor; + half _OverlayGlow, _OverlayBlend, _OverlayTextureScrollXSpeed, _OverlayTextureScrollYSpeed; + #endif + + #if DOODLE_ON + half _HandDrawnAmount, _HandDrawnSpeed; + #endif + + #if WIND_ON + half _GrassSpeed, _GrassWind, _GrassManualAnim, _GrassRadialBend; + #endif + + #if WAVEUV_ON + float _WaveAmount, _WaveSpeed, _WaveStrength, _WaveX, _WaveY; + #endif + + #if ROUNDWAVEUV_ON + half _RoundWaveStrength, _RoundWaveSpeed; + #endif + + #if RECTSIZE_ON + half _RectSize; + #endif + + #if OFFSETUV_ON + half _OffsetUvX, _OffsetUvY; + #endif + + #if CLIPPING_ON + half _ClipUvLeft, _ClipUvRight, _ClipUvUp, _ClipUvDown; + #endif + + #if RADIALCLIPPING_ON + half _RadialStartAngle, _RadialClip, _RadialClip2; + #endif + + #if TEXTURESCROLL_ON + half _TextureScrollXSpeed, _TextureScrollYSpeed; + #endif + + #if ZOOMUV_ON + half _ZoomUvAmount; + #endif + + #if WARP_ON + half _WarpStrength, _WarpSpeed, _WarpScale; + #endif + + #if TWISTUV_ON + half _TwistUvAmount, _TwistUvPosX, _TwistUvPosY, _TwistUvRadius; + #endif + + #if ROTATEUV_ON + half _RotateUvAmount; + #endif + + #if FISHEYE_ON + half _FishEyeUvAmount; + #endif + + #if PINCH_ON + half _PinchUvAmount; + #endif + + #if SHAKEUV_ON + half _ShakeUvSpeed, _ShakeUvX, _ShakeUvY; + #endif + + #if NORMALMAP_ON + half _NormalStrength; + #endif + + float _RandomSeed; + + + + + CBUFFER_END + + + + + + + + TEXTURE2D(_MainTex); + SAMPLER(sampler_MainTex); + + #if GLOW_ON + TEXTURE2D(_GlowTex); + SAMPLER(sampler_GlowTex); + #endif + + #if FADE_ON + TEXTURE2D(_FadeTex); + SAMPLER(sampler_FadeTex); + + TEXTURE2D(_FadeBurnTex); + SAMPLER(sampler_FadeBurnTex); + #endif + + #if DISTORT_ON + TEXTURE2D(_DistortTex); + SAMPLER(sampler_DistortTex); + #endif + + #if OUTTEX_ON + TEXTURE2D(_OutlineTex); + SAMPLER(sampler_OutlineTex); + #endif + + #if OUTDIST_ON + TEXTURE2D(_OutlineDistortTex); + SAMPLER(sampler_OutlineDistortTex); + #endif + + #if COLORSWAP_ON + TEXTURE2D(_ColorSwapTex); + SAMPLER(sampler_ColorSwapTex); + #endif + + #if COLORRAMP_ON + TEXTURE2D(_ColorRampTex); + TEXTURE2D(_ColorRampTexGradient); + SAMPLER(sampler_ColorRampTex); + SAMPLER(sampler_ColorRampTexGradient); + #endif + + #if SHINE_ON + TEXTURE2D(_ShineMask); + SAMPLER(sampler_ShineMask); + #endif + + #if OVERLAY_ON + TEXTURE2D(_OverlayTex); + SAMPLER(sampler_OverlayTex); + #endif + + #if NORMALMAP_ON + TEXTURE2D(_NormalMap); + SAMPLER(sampler_NormalMap); + #endif + + + half3 GetPixel(in int offsetX, in int offsetY, in half2 uv, in Texture2D _tex, in SamplerState _sampler) + { + half2 _uv = uv + half2(offsetX * _MainTex_TexelSize.x, offsetY * _MainTex_TexelSize.y); + half4 col = SAMPLE_TEXTURE2D(_tex, _sampler, _uv); + return col.rgb; + } + + + //BLURS------------------------------------------------------------------------- + half4 Blur(half2 uv, Texture2D source, SamplerState sampler_source, half Intensity) + { + const half2 texelSize = 1.0 / _ScreenParams.xy; + const half4 color = SAMPLE_TEXTURE2D(source, sampler_source, uv); + const half2 offset = Intensity * texelSize; + + half4 accumulatedColor = color; + half accumulatedWeight = 1.0; + for (int x = -1; x <= 1; x++) + { + for (int y = -1; y <= 1; y++) + { + const half2 sampleUV = uv + half2(x, y) * offset; + const half4 sampleColor = SAMPLE_TEXTURE2D(source, sampler_source, sampleUV); + + accumulatedColor += sampleColor; + accumulatedWeight += 1.0; + } + } + + half4 blurredColor = accumulatedColor / accumulatedWeight; + return blurredColor; + } + + half BlurHD_G(half bhqp, half x) + { + return exp(-(x * x) / (2.0 * bhqp * bhqp)); + } + half4 BlurHD(half2 uv, Texture2D source, SamplerState sampler_source, half BlurAmount, half xScale, half yScale) + { + int iterations = 16; + int halfIterations = iterations / 2; + half sigmaX = 0.1 + BlurAmount * 0.5; + half sigmaY = sigmaX; + half total = 0.0; + half4 ret = half4(0, 0, 0, 0); + for (int iy = 0; iy < iterations; ++iy) + { + half fy = BlurHD_G(sigmaY, half(iy) -half(halfIterations)); + half offsetY = half(iy - halfIterations) * 0.00390625 * xScale; + for (int ix = 0; ix < iterations; ++ix) + { + half fx = BlurHD_G(sigmaX, half(ix) - half(halfIterations)); + half offsetX = half(ix - halfIterations) * 0.00390625 * yScale; + total += fx * fy; + ret += SAMPLE_TEXTURE2D(source, sampler_source, uv + half2(offsetX, offsetY)) * fx * fy; + } + } + return ret / total; + } + //----------------------------------------------------------------------- + + + //------------------------------------------- + half RemapFloat(half inValue, half inMin, half inMax, half outMin, half outMax){ + return outMin + (inValue - inMin) * (outMax - outMin) / (inMax - inMin); + } + //------------------------------------------- + + //----------------------------------------------------------------------- + half rand(half2 seed, half offset) { + return (frac(sin(dot(seed, half2(12.9898, 78.233))) * 43758.5453) + offset) % 1.0; + } + + half rand2(half2 seed, half offset) { + return (frac(sin(dot(seed * floor(50 + (_Time.x % 1.0) * 12.), half2(127.1, 311.7))) * 43758.5453123) + offset) % 1.0; + } + + half rand2CustomTime(half2 seed, half offset, half customTime) { + return (frac(sin(dot(seed * floor(50 + (customTime % 1.0) * 12.), half2(127.1, 311.7))) * 43758.5453123) + offset) % 1.0; + } + //----------------------------------------------------------------------- + + + void Ext_ModifyVertex0 (inout VertexData v, inout ExtraV2F d) + { + //BILBOARD_ON + #if BILBOARD_ON + half3 camRight = mul((half3x3)unity_CameraToWorld, half3(1,0,0)); + half3 camUp = half3(0,1,0); + #if BILBOARDY_ON + camUp = mul((half3x3)unity_CameraToWorld, half3(0,1,0)); + #endif + half3 localPos = v.vertex.x * camRight + v.vertex.y * camUp; + v.vertex = half4(localPos, 1); + #endif + //----------------------------------------------------------- + + v.texcoord0.xy = TRANSFORM_TEX(v.texcoord0.xy, _MainTex); + half2 center = half2(0.5, 0.5); + #if ATLAS_ON + center = half2((_MaxXUV + _MinXUV) / 2.0, (_MaxYUV + _MinYUV) / 2.0); + #endif + + //POLARUV_ON + #if POLARUV_ON + v.texcoord0.xy = v.texcoord0.xy - center; + #endif + + //---------------------------------------- + + //ROTATEUV_ON + #if ROTATEUV_ON + half2 uvC = v.texcoord0.xy; + half cosAngle = cos(_RotateUvAmount); + half sinAngle = sin(_RotateUvAmount); + half2x2 rot = half2x2(cosAngle, -sinAngle, sinAngle, cosAngle); + uvC -= center; + v.texcoord0.xy = mul(rot, uvC); + v.texcoord0.xy += center; + #endif + //-------------------- + + #if RECTSIZE_ON + v.vertex.xyz += (v.vertex.xyz * (_RectSize - 1.0)); + #endif + + #if OUTTEX_ON + v.texcoord1.xy = TRANSFORM_TEX(v.texcoord0.xy, _OutlineTex); + #endif + + #if OUTDIST_ON + v.texcoord2.xy = TRANSFORM_TEX(v.texcoord0.xy, _OutlineDistortTex); + #endif + + #if DISTORT_ON + v.texcoord3.xy = TRANSFORM_TEX(v.texcoord0.xy, _DistortTex); + #endif + } + + void Ext_SurfaceFunction0 (inout Surface o, ShaderData d) + { + half randomSeed = _RandomSeed; + + float2 uvRect = d.texcoord0; + half2 center = half2(0.5, 0.5); + #if ATLAS_ON + center = half2((_MaxXUV + _MinXUV) / 2.0, (_MaxYUV + _MinYUV) / 2.0); + uvRect = half2((d.texcoord0.x - _MinXUV) / (_MaxXUV - _MinXUV), (d.texcoord0.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half2 centerTiled = half2(center.x * _MainTex_ST.x, center.y * _MainTex_ST.y); + + //CLIPPING_ON + #if CLIPPING_ON + half2 tiledUv = half2(d.texcoord0.x / _MainTex_ST.x, d.texcoord0.y / _MainTex_ST.y); + #if ATLAS_ON + tiledUv = half2((tiledUv.x - _MinXUV) / (_MaxXUV - _MinXUV), (tiledUv.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + clip((1 - _ClipUvUp) - tiledUv.y); + clip(tiledUv.y - _ClipUvDown); + clip((1 - _ClipUvRight) - tiledUv.x); + clip(tiledUv.x - _ClipUvLeft); + #endif + //---------------------------------- + + //RADIALCLIPPING_ON + #if RADIALCLIPPING_ON + half2 tiledUv2 = half2(d.texcoord0.x / _MainTex_ST.x, d.texcoord0.y / _MainTex_ST.y); + #if ATLAS_ON + tiledUv2 = half2((tiledUv2.x - _MinXUV) / (_MaxXUV - _MinXUV), (tiledUv2.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half startAngle = _RadialStartAngle - _RadialClip; + half endAngle = _RadialStartAngle + _RadialClip2; + half offset0 = clamp(0, 360, startAngle + 360); + half offset360 = clamp(0, 360, endAngle - 360); + half2 atan2Coord = half2(lerp(-1, 1, tiledUv2.x), lerp(-1, 1, tiledUv2.y)); + half atanAngle = atan2(atan2Coord.y, atan2Coord.x) * 57.3; // angle in degrees + if(atanAngle < 0) atanAngle = 360 + atanAngle; + if(atanAngle >= startAngle && atanAngle <= endAngle) discard; + if(atanAngle <= offset360) discard; + if(atanAngle >= offset0) discard; + #endif + + //----------------------------- + + //TEXTURESCROLL_ON && ATLAS_ON + #if TEXTURESCROLL_ON && ATLAS_ON + d.texcoord0.xy = half2(_MinXUV + ((_MaxXUV - _MinXUV) * (abs(((_Time.y + randomSeed) * _TextureScrollXSpeed) + uvRect.x) % 1)), + _MinYUV + ((_MaxYUV - _MinYUV) * (abs(((_Time.y + randomSeed) * _TextureScrollYSpeed) + uvRect.y) % 1))); + #endif + //---------------------------- + + //OFFSETUV_ON + #if OFFSETUV_ON + #if ATLAS_ON + d.texcoord0.xy = half2(_MinXUV + ((_MaxXUV - _MinXUV) * (abs((_OffsetUvX + uvRect.x) % 1))), + _MinYUV + ((_MaxYUV - _MinYUV) * (abs(_OffsetUvY + uvRect.y) % 1))); + #else + d.texcoord0.xy += half2(_OffsetUvX, _OffsetUvY); + #endif + #endif + + //---------------------- + + //POLARUV_ON + #if POLARUV_ON + d.texcoord0.xy = half2(atan2(d.texcoord0.y, d.texcoord0.x) / (2.0f * 3.141592653589f), length(d.texcoord0.xy)); + d.texcoord0.xy *= _MainTex_ST.xy; + #endif + + //-------------------------------------- + + //TWISTUV_ON + #if TWISTUV_ON + #if ATLAS_ON + _TwistUvPosX = ((_MaxXUV - _MinXUV) * _TwistUvPosX) + _MinXUV; + _TwistUvPosY = ((_MaxYUV - _MinYUV) * _TwistUvPosY) + _MinYUV; + #endif + half2 tempUv = d.texcoord0.xy - half2(_TwistUvPosX * _MainTex_ST.x, _TwistUvPosY * _MainTex_ST.y); + _TwistUvRadius *= (_MainTex_ST.x + _MainTex_ST.y) / 2; + half percent = (_TwistUvRadius - length(tempUv)) / _TwistUvRadius; + half theta = percent * percent * (2.0 * sin(_TwistUvAmount)) * 8.0; + half s = sin(theta); + half c = cos(theta); + half beta = max(sign(_TwistUvRadius - length(tempUv)), 0.0); + tempUv = half2(dot(tempUv, half2(c, -s)), dot(tempUv, half2(s, c))) * beta + tempUv * (1 - beta); + tempUv += half2(_TwistUvPosX * _MainTex_ST.x, _TwistUvPosY * _MainTex_ST.y); + d.texcoord0.xy = tempUv; + #endif + + //-------------------------------------------- + + //FISHEYE_ON + #if FISHEYE_ON + half bind = length(centerTiled); + half2 dF = d.texcoord0.xy - centerTiled; + half dFlen = length(dF); + half fishInt = (3.14159265359 / bind) * (_FishEyeUvAmount + 0.001); + d.texcoord0.xy = centerTiled + (dF / (max(0.0001, dFlen))) * tan(dFlen * fishInt) * bind / tan(bind * fishInt); + #endif + //--------------------------------------------- + + //PINCH_ON + #if PINCH_ON + half2 dP = d.texcoord0.xy - centerTiled; + half pinchInt = (3.141592 / length(centerTiled)) * (-_PinchUvAmount + 0.001); + d.texcoord0.xy = centerTiled + normalize(dP) * atan(length(dP) * -pinchInt * 10.0) * 0.5 / atan(-pinchInt * 5); + #endif + + //--------------------------------------------- + + //ZOOMUV_ON + #if ZOOMUV_ON + d.texcoord0.xy -= centerTiled; + d.texcoord0.xy = d.texcoord0.xy * _ZoomUvAmount; + d.texcoord0.xy += centerTiled; + #endif + + //----------------------------------------------- + + //DOODLE_ON + #if DOODLE_ON + half2 uvCopy = uvRect; + _HandDrawnSpeed = (floor((_Time.x + randomSeed) * 20 * _HandDrawnSpeed) / _HandDrawnSpeed) * _HandDrawnSpeed; + uvCopy.x = sin((uvCopy.x * _HandDrawnAmount + _HandDrawnSpeed) * 4); + uvCopy.y = cos((uvCopy.y * _HandDrawnAmount + _HandDrawnSpeed) * 4); + d.texcoord0.xy = lerp(d.texcoord0.xy, d.texcoord0.xy + uvCopy, 0.0005 * _HandDrawnAmount); + #endif + + //-------------------------- + + //SHAKEUV_ON + #if SHAKEUV_ON + half xShake = sin((_Time.x + randomSeed) * _ShakeUvSpeed * 50) * _ShakeUvX; + half yShake = cos((_Time.x + randomSeed) * _ShakeUvSpeed * 50) * _ShakeUvY; + d.texcoord0.xy += half2(xShake * 0.012, yShake * 0.01); + #endif + + //------------------------------------------- + + //RECTSIZE_ON + #if RECTSIZE_ON + d.texcoord0.xy = d.texcoord0.xy * (_RectSize).xx + (((-_RectSize * 0.5) + 0.5)).xx; + #endif + + //------------------------------------------- + + //DISTORT_ON + #if DISTORT_ON + #if ATLAS_ON + d.texcoord3.x = d.texcoord3.x * (1 / (_MaxXUV - _MinXUV)); + d.texcoord3.y = d.texcoord3.y * (1 / (_MaxYUV - _MinYUV)); + #endif + + d.texcoord3.x += ((_Time.x + _RandomSeed) * _DistortTexXSpeed) % 1; + d.texcoord3.y += ((_Time.x + _RandomSeed) * _DistortTexYSpeed) % 1; + half distortAmnt = (SAMPLE_TEXTURE2D(_DistortTex, sampler_DistortTex, d.texcoord3.xy).r - 0.5) * 0.2 * _DistortAmount; + d.texcoord0.x += distortAmnt; + d.texcoord0.y += distortAmnt; + #endif + //------------------------------------------------------- + + //WARP_ON + #if WARP_ON + half2 warpUv = half2(d.texcoord0.x / _MainTex_ST.x, d.texcoord0.y / _MainTex_ST.y); + #if ATLAS_ON + warpUv = half2((warpUv.x - _MinXUV) / (_MaxXUV - _MinXUV), (warpUv.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + const float tau = 6.283185307179586; + float xWarp = (_Time.y + randomSeed) * _WarpSpeed + warpUv.x * tau / _WarpScale; + float yWarp = (_Time.y + randomSeed) * _WarpSpeed + warpUv.y * tau / _WarpScale; + float2 warp = float2(sin(xWarp), sin(yWarp)) * _WarpStrength; + d.texcoord0.xy += warp; + #endif + + //------------------------------------------------------- + + //WAVEUV_ON + #if WAVEUV_ON + float2 uvWave = half2(_WaveX * _MainTex_ST.x, _WaveY * _MainTex_ST.y) - d.texcoord0.xy; + uvWave %= 1; + #if ATLAS_ON + uvWave = half2(_WaveX, _WaveY) - uvRect; + #endif + uvWave.x *= _ScreenParams.x / _ScreenParams.y; + float waveTime = _Time.y + randomSeed; + float angWave = (sqrt(dot(uvWave, uvWave)) * _WaveAmount) - ((waveTime * _WaveSpeed)); + d.texcoord0.xy = d.texcoord0.xy + uvWave * sin(angWave) * (_WaveStrength / 1000.0); + #endif + //---------------------------------------------------- + + //ROUNDWAVEUV_ON + #if ROUNDWAVEUV_ON + half xWave = ((0.5 * _MainTex_ST.x) - uvRect.x); + half yWave = ((0.5 * _MainTex_ST.y) - uvRect.y) * (_MainTex_TexelSize.w / _MainTex_TexelSize.z); + half ripple = -sqrt(xWave*xWave + yWave* yWave); + d.texcoord0.xy += (sin((ripple + (_Time.y + randomSeed) * (_RoundWaveSpeed/10.0)) / 0.015) * (_RoundWaveStrength/10.0)) % 1; + #endif + //---------------------------------------------------- + + + //WIND_ON + #if WIND_ON + half windOffset = sin((_Time.x + randomSeed) * _GrassSpeed * 10); + half2 windCenter = half2(0.5, 0.1); + #if ATLAS_ON + windCenter.x = ((_MaxXUV - _MinXUV) * windCenter.x) + _MinXUV; + windCenter.y = ((_MaxYUV - _MinYUV) * windCenter.y) + _MinYUV; + #endif + #if !MANUALWIND_ON + d.texcoord0.x = fmod(abs(lerp(d.texcoord0.x, d.texcoord0.x + (_GrassWind * 0.01 * windOffset), uvRect.y)), 1); + #else + d.texcoord0.x = fmod(abs(lerp(d.texcoord0.x, d.texcoord0.x + (_GrassWind * 0.01 * _GrassManualAnim), uvRect.y)), 1); + windOffset = _GrassManualAnim; + #endif + half2 delta = d.texcoord0.xy - windCenter; + half delta2 = dot(delta.xy, delta.xy); + half2 delta_offset = delta2 * windOffset; + d.texcoord0.xy = d.texcoord0.xy + half2(delta.y, -delta.x) * delta_offset * _GrassRadialBend; + #endif + + //-------------------------------------------------------- + + //TEXTURESCROLL_ON && !ATLAS_ON + #if TEXTURESCROLL_ON && !ATLAS_ON + d.texcoord0.x += ((_Time.y + randomSeed) * _TextureScrollXSpeed) % 1; + d.texcoord0.y += ((_Time.y + randomSeed) * _TextureScrollYSpeed) % 1; + #endif + //------------------------------ + + //PIXELATE_ON + #if PIXELATE_ON + half aspectRatio = _MainTex_TexelSize.x / _MainTex_TexelSize.y; + half2 pixelSize = float2(_PixelateSize, _PixelateSize * aspectRatio); + d.texcoord0.xy = floor(d.texcoord0.xy * pixelSize) / pixelSize; + #endif + //-------------- + + half4 col = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy); + half originalAlpha = col.a; + col *= d.vertexColor; + + //NORMAL MAP + #if NORMALMAP_ON + half4 normalSample = SAMPLE_TEXTURE2D(_NormalMap, sampler_NormalMap, d.texcoord0.xy); + half3 normalTS = UnpackNormal(normalSample); + normalTS.xy *= _NormalStrength; + o.Normal = normalTS; + #endif + + + //GLITCH_ON + #if GLITCH_ON + half2 uvGlitch = uvRect; + uvGlitch.y -= 0.5; + half lineNoise = pow(rand2(floor(uvGlitch * half2(24., 19.) * _GlitchSize) * 4.0, randomSeed), 3.0) * _GlitchAmount + * pow(rand2(floor(uvGlitch * half2(38., 14.) * _GlitchSize) * 4.0, randomSeed), 3.0); + col = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(lineNoise * 0.02 * rand2(half2(2.0, 1), randomSeed), 0)) * d.vertexColor; + #endif + //-------------------------------------- + + //CHROMABERR_ON + #if CHROMABERR_ON + half4 r = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(_ChromAberrAmount/10, 0)) * d.vertexColor; + half4 b = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(-_ChromAberrAmount/10, 0)) * d.vertexColor; + col = half4(r.r * r.a, col.g, b.b * b.a, max(max(r.a, b.a) * _ChromAberrAlpha, col.a)); + #endif + + //-------------------------------- + + //BLUR_ON + #if BLUR_ON + #if ATLAS_ON + #if !BLURISHD_ON + col = BlurHD(d.texcoord0.xy, _MainTex, sampler_MainTex, _BlurIntensity, (_MaxXUV - _MinXUV), (_MaxYUV - _MinYUV)) * d.vertexColor; + #else + col = Blur(d.texcoord0.xy, _MainTex, sampler_MainTex, _BlurIntensity * (_MaxXUV - _MinXUV)) * d.vertexColor; + #endif + #else + #if !BLURISHD_ON + col = BlurHD(d.texcoord0.xy, _MainTex, sampler_MainTex, _BlurIntensity, 1, 1) * d.vertexColor; + #else + col = Blur(d.texcoord0.xy, _MainTex, sampler_MainTex, _BlurIntensity) * d.vertexColor; + #endif + #endif + #endif + + //-------------------- + + //MOTIONBLUR_ON + #if MOTIONBLUR_ON + _MotionBlurAngle = _MotionBlurAngle * 3.1415926; + #define rot(n) mul(n, half2x2(cos(_MotionBlurAngle), -sin(_MotionBlurAngle), sin(_MotionBlurAngle), cos(_MotionBlurAngle))) + _MotionBlurDist = _MotionBlurDist * 0.005; + #if ATLAS_ON + _MotionBlurDist *= (_MaxXUV - _MinXUV); + #endif + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(-_MotionBlurDist, -_MotionBlurDist))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(-_MotionBlurDist * 2, -_MotionBlurDist * 2))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(-_MotionBlurDist * 3, -_MotionBlurDist * 3))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(-_MotionBlurDist * 4, -_MotionBlurDist * 4))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(_MotionBlurDist, _MotionBlurDist))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(_MotionBlurDist * 2, _MotionBlurDist * 2))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(_MotionBlurDist * 3, _MotionBlurDist * 3))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(_MotionBlurDist * 4, _MotionBlurDist * 4))); + col.rgb = col.rgb / 9; + #endif + //------------------------------------ + + //NEGATIVE_ON + #if NEGATIVE_ON + col.rgb = lerp(col.rgb, 1 - col.rgb, _NegativeAmount); + #endif + + //-------------- + half luminance = 0; + + //GREYSCALE_ON && !GREYSCALEOUTLINE_ON + #if GREYSCALE_ON && !GREYSCALEOUTLINE_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + luminance = saturate(luminance + _GreyscaleLuminosity); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _GreyscaleTintColor, _GreyscaleBlend); + #endif + //------------------------------------ + + //GHOST_ON + #if GHOST_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + half4 ghostResult; + ghostResult.a = saturate(luminance - _GhostTransparency) * col.a; + ghostResult.rgb = col.rgb * (luminance + _GhostColorBoost); + col = lerp(col, ghostResult, _GhostBlend); + #endif + //------------------------------------ + + //INNEROUTLINE_ON + #if INNEROUTLINE_ON + half3 innerT = abs(GetPixel(0, _InnerOutlineThickness, d.texcoord0.xy, _MainTex, sampler_MainTex) - GetPixel(0, -_InnerOutlineThickness, d.texcoord0.xy, _MainTex, sampler_MainTex)); + innerT += abs(GetPixel(_InnerOutlineThickness, 0, d.texcoord0.xy, _MainTex, sampler_MainTex) - GetPixel(-_InnerOutlineThickness, 0, d.texcoord0.xy, _MainTex, sampler_MainTex)); + #if !ONLYINNEROUTLINE_ON + innerT = (innerT / 2.0) * col.a * _InnerOutlineAlpha; + col.rgb += length(innerT) * _InnerOutlineColor.rgb * _InnerOutlineGlow; + #else + innerT *= col.a * _InnerOutlineAlpha; + col.rgb = length(innerT) * _InnerOutlineColor.rgb * _InnerOutlineGlow; + col.a = step(0.3, col.r+col.g+col.b); + #endif + #endif + //------------------------------------------------------- + + //HITEFFECT_ON + #if HITEFFECT_ON + col.rgb = lerp(col.rgb, _HitEffectColor.rgb * _HitEffectGlow, _HitEffectBlend); + #endif + //-------------------- + + //GRADIENT_ON + #if GRADIENT_ON + half2 tiledUvGrad = half2(uvRect.x / _MainTex_ST.x, uvRect.y / _MainTex_ST.y); + #if GRADIENT2COL_ON + _GradTopRightCol = _GradTopLeftCol; + _GradBotRightCol = _GradBotLeftCol; + #endif + #if RADIALGRADIENT_ON + half radialDist = 1 - length(tiledUvGrad - half2(0.5, 0.5)); + radialDist *= (_MainTex_TexelSize.w / _MainTex_TexelSize.z); + radialDist = saturate(_GradBoostX * radialDist); + half4 gradientResult = lerp(_GradTopLeftCol, _GradBotLeftCol, radialDist); + #else + half gradXLerpFactor = saturate(pow(tiledUvGrad.x, _GradBoostX)); + half4 gradientResult = lerp(lerp(_GradBotLeftCol, _GradBotRightCol, gradXLerpFactor), + lerp(_GradTopLeftCol, _GradTopRightCol, gradXLerpFactor), saturate(pow(tiledUvGrad.y, _GradBoostY))); + #endif + gradientResult = lerp(col, gradientResult, _GradBlend); + col.rgb = gradientResult.rgb * col.a; + col.a *= gradientResult.a; + #endif + //-------------------------------------------------------------------- + + //CONTRAST_ON + #if CONTRAST_ON + col.rgb = (col.rgb - float3(0.5, 0.5, 0.5)) * _Contrast + float3(0.5, 0.5, 0.5); + col.rgb += _Brightness; + #endif + + //------------------------------------------------------------------- + + //COLORSWAP_ON + #if COLORSWAP_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + half4 swapMask = SAMPLE_TEXTURE2D(_ColorSwapTex, sampler_ColorSwapTex, d.texcoord0.xy); + swapMask.rgb *= swapMask.a; + half3 redSwap = _ColorSwapRed * swapMask.r * saturate(luminance + _ColorSwapRedLuminosity); + half3 greenSwap = _ColorSwapGreen * swapMask.g * saturate(luminance + _ColorSwapGreenLuminosity); + half3 blueSwap = _ColorSwapBlue * swapMask.b * saturate(luminance + _ColorSwapBlueLuminosity); + swapMask.rgb = col.rgb * saturate(1 - swapMask.r - swapMask.g - swapMask.b); + col.rgb = lerp(col.rgb, swapMask.rgb + redSwap + greenSwap + blueSwap, _ColorSwapBlend); + #endif + //-------------------------------------------------------------------- + + //COLORRAMP_ON && !COLORRAMPOUTLINE_ON + #if COLORRAMP_ON && !COLORRAMPOUTLINE_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + luminance = saturate(luminance + _ColorRampLuminosity); + #if GRADIENTCOLORRAMP_ON + col.rgb = lerp(col.rgb, SAMPLE_TEXTURE2D(_ColorRampTexGradient, sampler_ColorRampTexGradient, half2(luminance, 0)).rgb, _ColorRampBlend); + #else + col.rgb = lerp(col.rgb, SAMPLE_TEXTURE2D(_ColorRampTex, sampler_ColorRampTex, half2(luminance, 0)).rgb, _ColorRampBlend); + #endif + #endif + //-------------------------------------------------------------------- + + //CHANGECOLOR_ON + #if CHANGECOLOR_ON + float3 currChangeColor = saturate(col.rgb); + luminance = 0.3 * currChangeColor.r + 0.59 * currChangeColor.g + 0.11 * currChangeColor.b; + luminance = saturate(luminance + _ColorChangeLuminosity); + half3 dif = abs(currChangeColor - _ColorChangeTarget.rgb); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _ColorChangeNewCol.rgb, + max(sign(1 - saturate(dif.x + dif.y + dif.z) - _ColorChangeTolerance), 0.0)); + #if CHANGECOLOR2_ON + dif = abs(currChangeColor - _ColorChangeTarget2.rgb); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _ColorChangeNewCol2.rgb, + max(sign(1 - saturate(dif.x + dif.y + dif.z) - _ColorChangeTolerance2), 0.0)); + #endif + #if CHANGECOLOR3_ON + dif = abs(currChangeColor - _ColorChangeTarget3.rgb); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _ColorChangeNewCol3.rgb, + max(sign(1 - saturate(dif.x + dif.y + dif.z) - _ColorChangeTolerance3), 0.0)); + #endif + #endif + //------------------------------------------------------- + + //POSTERIZE_ON && !POSTERIZEOUTLINE_ON + #if POSTERIZE_ON && !POSTERIZEOUTLINE_ON + col.rgb = pow(col.rgb, _PosterizeGamma) * _PosterizeNumColors; + col.rgb = floor(col.rgb) / _PosterizeNumColors; + col.rgb = pow(col.rgb, 1.0 / _PosterizeGamma); + #endif + //------------------------------------ + + //HSV_ON + #if HSV_ON + half3 resultHsv = half3(col.rgb); + half cosHsv = _HsvBright * _HsvSaturation * cos(_HsvShift * 3.14159265 / 180); + half sinHsv = _HsvBright * _HsvSaturation * sin(_HsvShift * 3.14159265 / 180); + resultHsv.x = (.299 * _HsvBright + .701 * cosHsv + .168 * sinHsv) * col.x + + (.587 * _HsvBright - .587 * cosHsv + .330 * sinHsv) * col.y + + (.114 * _HsvBright - .114 * cosHsv - .497 * sinHsv) * col.z; + resultHsv.y = (.299 * _HsvBright - .299 * cosHsv - .328 * sinHsv) *col.x + + (.587 * _HsvBright + .413 * cosHsv + .035 * sinHsv) * col.y + + (.114 * _HsvBright - .114 * cosHsv + .292 * sinHsv) * col.z; + resultHsv.z = (.299 * _HsvBright - .3 * cosHsv + 1.25 * sinHsv) * col.x + + (.587 * _HsvBright - .588 * cosHsv - 1.05 * sinHsv) * col.y + + (.114 * _HsvBright + .886 * cosHsv - .203 * sinHsv) * col.z; + col.rgb = resultHsv; + #endif + //------------------------------------------------------- + + //OVERLAY_ON + #if OVERLAY_ON + half2 overlayUvs = d.texcoord0.xy; + overlayUvs.x += ((_Time.y + randomSeed) * _OverlayTextureScrollXSpeed) % 1; + overlayUvs.y += ((_Time.y + randomSeed) * _OverlayTextureScrollYSpeed) % 1; + half4 overlayCol = SAMPLE_TEXTURE2D(_OverlayTex, sampler_OverlayTex, TRANSFORM_TEX(overlayUvs, _OverlayTex)); + overlayCol.rgb *= _OverlayColor.rgb * _OverlayGlow; + #if !OVERLAYMULT_ON + overlayCol.rgb *= overlayCol.a * _OverlayColor.rgb * _OverlayColor.a * _OverlayBlend; + col.rgb += overlayCol.rgb; + #else + overlayCol.a *= _OverlayColor.a; + col = lerp(col, col * overlayCol, _OverlayBlend); + #endif + #endif + + //--------------------------------- + + //OUTBASE_ON + #if OUTBASE_ON + #if OUTBASEPIXELPERF_ON + half2 destUv = half2(_OutlinePixelWidth * _MainTex_TexelSize.x, _OutlinePixelWidth * _MainTex_TexelSize.y); + #else + half2 destUv = half2(_OutlineWidth * _MainTex_TexelSize.x * 200, _OutlineWidth * _MainTex_TexelSize.y * 200); + #endif + + #if OUTDIST_ON + d.texcoord3.x += ((_Time.x + _RandomSeed) * _OutlineDistortTexXSpeed) % 1; + d.texcoord3.y += ((_Time.x + _RandomSeed) * _OutlineDistortTexYSpeed) % 1; + #if ATLAS_ON + d.texcoord3 = half2((d.texcoord3.x - _MinXUV) / (_MaxXUV - _MinXUV), (d.texcoord3.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half outDistortAmnt = (SAMPLE_TEXTURE2D(_OutlineDistortTex, sampler_OutlineDistortTex, d.texcoord3).r - 0.5) * 0.2 * _OutlineDistortAmount; + destUv.x += outDistortAmnt; + destUv.y += outDistortAmnt; + #endif + + half spriteLeft = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(destUv.x, 0)).a; + half spriteRight = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy - half2(destUv.x, 0)).a; + half spriteBottom = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(0, destUv.y)).a; + half spriteTop = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy - half2(0, destUv.y)).a; + half result = spriteLeft + spriteRight + spriteBottom + spriteTop; + + #if OUTBASE8DIR_ON + half spriteTopLeft = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(destUv.x, destUv.y)).a; + half spriteTopRight = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(-destUv.x, destUv.y)).a; + half spriteBotLeft = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(destUv.x, -destUv.y)).a; + half spriteBotRight = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(-destUv.x, -destUv.y)).a; + result = result + spriteTopLeft + spriteTopRight + spriteBotLeft + spriteBotRight; + #endif + + result = step(0.05, saturate(result)); + + #if OUTTEX_ON + d.texcoord1.x += ((_Time.x + _RandomSeed) * _OutlineTexXSpeed) % 1; + d.texcoord1.y += ((_Time.x + _RandomSeed) * _OutlineTexYSpeed) % 1; + #if ATLAS_ON + d.texcoord1 = half2((d.texcoord1.x - _MinXUV) / (_MaxXUV - _MinXUV), (d.texcoord1.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half4 tempOutColor = SAMPLE_TEXTURE2D(_OutlineTex, sampler_OutlineTex, d.texcoord1); + tempOutColor *= _OutlineColor; + _OutlineColor = tempOutColor; + #endif + + result *= (1 - originalAlpha) * _OutlineAlpha; + + half4 outline = _OutlineColor * d.vertexColor.a; + outline.rgb *= _OutlineGlow; + outline.a = result; + #if ONLYOUTLINE_ON + col = outline; + #else + col = lerp(col, outline, result); + #endif + #endif + //------------------------------------------------------- + + //FADE_ON + #if FADE_ON + half2 tiledUvFade1 = TRANSFORM_TEX(d.texcoord0, _FadeTex); + half2 tiledUvFade2 = TRANSFORM_TEX(d.texcoord0, _FadeBurnTex); + #if ATLAS_ON + tiledUvFade1 = half2((tiledUvFade1.x - _MinXUV) / (_MaxXUV - _MinXUV), (tiledUvFade1.y - _MinYUV) / (_MaxYUV - _MinYUV)); + tiledUvFade2 = half2((tiledUvFade2.x - _MinXUV) / (_MaxXUV - _MinXUV), (tiledUvFade2.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half fadeTemp = SAMPLE_TEXTURE2D(_FadeTex, sampler_FadeTex, tiledUvFade1).r; + half fade = smoothstep(_FadeAmount, _FadeAmount + _FadeBurnTransition, fadeTemp); + half fadeBurn = saturate(smoothstep(_FadeAmount - _FadeBurnWidth, _FadeAmount - _FadeBurnWidth + 0.1, fadeTemp) * _FadeAmount); + col.a *= fade; + _FadeBurnColor.rgb *= _FadeBurnGlow; + col += fadeBurn * SAMPLE_TEXTURE2D(_FadeBurnTex, sampler_FadeBurnTex, tiledUvFade2) * _FadeBurnColor * originalAlpha * (1 - col.a); + #endif + //------------------------------------------------------- + + //SHADOW_ON + #if SHADOW_ON + half shadowA = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(_ShadowX, _ShadowY)).a; + half preMultShadowMask = 1 - (saturate(shadowA - col.a) * (1 - col.a)); + col.rgb *= 1 - ((shadowA - col.a) * (1 - col.a)); + col.rgb += (_ShadowColor * shadowA) * (1 - col.a); + col.a = max(shadowA * _ShadowAlpha * d.vertexColor.a, col.a); + #endif + + //------------------------------------------------------- + + //GLOW_ON + #if GLOW_ON + half4 emission; + #if GLOWTEX_ON + emission = SAMPLE_TEXTURE2D(_GlowTex, sampler_GlowTex, d.texcoord0); + #else + emission = col; + #endif + + col.rgb *= _GlowGlobal; + emission.rgb *= emission.a * col.a * _Glow * _GlowColor; + col.rgb += emission.rgb; + #endif + //------------------------------------------------------- + + //COLORRAMP_ON && COLORRAMPOUTLINE_ON + #if COLORRAMP_ON && COLORRAMPOUTLINE_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + luminance = saturate(luminance + _ColorRampLuminosity); + #if GRADIENTCOLORRAMP_ON + col.rgb = lerp(col.rgb, SAMPLE_TEXTURE2D(_ColorRampTexGradient, sampler_ColorRampTexGradient, half2(luminance, 0)).rgb, _ColorRampBlend); + #else + col.rgb = lerp(col.rgb, SAMPLE_TEXTURE2D(_ColorRampTex, sampler_ColorRampTex, half2(luminance, 0)).rgb, _ColorRampBlend); + #endif + #endif + //--------------- + + //GREYSCALE_ON && GREYSCALEOUTLINE_ON + #if GREYSCALE_ON && GREYSCALEOUTLINE_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + luminance = saturate(luminance + _GreyscaleLuminosity); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _GreyscaleTintColor, _GreyscaleBlend); + #endif + + //----------------------------------- + + //POSTERIZE_ON && POSTERIZEOUTLINE_ON + #if POSTERIZE_ON && POSTERIZEOUTLINE_ON + col.rgb = pow(col.rgb, _PosterizeGamma) * _PosterizeNumColors; + col.rgb = floor(col.rgb) / _PosterizeNumColors; + col.rgb = pow(col.rgb, 1.0 / _PosterizeGamma); + #endif + + //----------------------------------- + + //SHINE_ON + #if SHINE_ON + half2 uvShine = uvRect; + half cosAngle = cos(_ShineRotate); + half sinAngle = sin(_ShineRotate); + half2x2 rot = half2x2(cosAngle, -sinAngle, sinAngle, cosAngle); + uvShine -= half2(0.5, 0.5); + uvShine = mul(rot, uvShine); + uvShine += half2(0.5, 0.5); + half shineMask = SAMPLE_TEXTURE2D(_ShineMask, sampler_ShineMask, d.texcoord0.xy).a; + half currentDistanceProjection = (uvShine.x + uvShine.y) / 2; + half whitePower = 1 - (abs(currentDistanceProjection - _ShineLocation) / _ShineWidth); + col.rgb += col.a * whitePower * _ShineGlow * max(sign(currentDistanceProjection - (_ShineLocation - _ShineWidth)), 0.0) + * max(sign((_ShineLocation + _ShineWidth) - currentDistanceProjection), 0.0) * _ShineColor * shineMask; + #endif + + //----------------------------------- + + //HOLOGRAM_ON + #if HOLOGRAM_ON + half totalHologram = _HologramStripesAmount + _HologramUnmodAmount; + half hologramYCoord = ((uvRect.y + (((_Time.x + randomSeed) % 1) * _HologramStripesSpeed)) % totalHologram) / totalHologram; + hologramYCoord = abs(hologramYCoord); + half alpha = RemapFloat(saturate(hologramYCoord - (_HologramUnmodAmount/totalHologram)), 0.0, 1.0, _HologramMinAlpha, saturate(_HologramMaxAlpha)); + half hologramMask = max(sign((_HologramUnmodAmount/totalHologram) - hologramYCoord), 0.0); + half4 hologramResult = col; + hologramResult.a *= lerp(alpha, 1, hologramMask); + hologramResult.rgb *= max(1, _HologramMaxAlpha * max(sign(hologramYCoord - (_HologramUnmodAmount/totalHologram)), 0.0)); + hologramMask = 1 - step(0.01,hologramMask); + hologramResult.rgb += hologramMask * _HologramStripeColor * col.a; + col = lerp(col, hologramResult, _HologramBlend); + #endif + + //----------------------------------- + + //FLICKER_ON + #if FLICKER_ON + col.a *= saturate(col.a * step(frac(0.05 + (_Time.w + randomSeed) * _FlickerFreq), 1 - _FlickerPercent) + _FlickerAlpha); + #endif + //----------------------------------- + + //ALPHACUTOFF_ON + + //ALPHAROUND_ON + + //ALPHAOUTLINE_ON + #if ALPHAOUTLINE_ON + half alphaOutlineRes = pow(1 - col.a, max(_AlphaOutlinePower, 0.0001)) * step(_AlphaOutlineMinAlpha, col.a) * _AlphaOutlineBlend; + col.rgb = lerp(col.rgb, _AlphaOutlineColor.rgb * _AlphaOutlineGlow, alphaOutlineRes); + col.a = lerp(col.a, 1, alphaOutlineRes > 1); + #endif + //------------------------------------------------------- + + //FOG_ON + + //------------------ + + col *= _Color; + o.Albedo = col; + col.a *= _Alpha; + clip(col.a - _AlphaCutoffValue - 0.01); + o.Alpha = _Color.a; + } + + + + + + void ChainSurfaceFunction(inout Surface l, inout ShaderData d) + { + Ext_SurfaceFunction0(l, d); + // Ext_SurfaceFunction1(l, d); + // Ext_SurfaceFunction2(l, d); + // Ext_SurfaceFunction3(l, d); + // Ext_SurfaceFunction4(l, d); + // Ext_SurfaceFunction5(l, d); + // Ext_SurfaceFunction6(l, d); + // Ext_SurfaceFunction7(l, d); + // Ext_SurfaceFunction8(l, d); + // Ext_SurfaceFunction9(l, d); + // Ext_SurfaceFunction10(l, d); + // Ext_SurfaceFunction11(l, d); + // Ext_SurfaceFunction12(l, d); + // Ext_SurfaceFunction13(l, d); + // Ext_SurfaceFunction14(l, d); + // Ext_SurfaceFunction15(l, d); + // Ext_SurfaceFunction16(l, d); + // Ext_SurfaceFunction17(l, d); + // Ext_SurfaceFunction18(l, d); + // Ext_SurfaceFunction19(l, d); + // Ext_SurfaceFunction20(l, d); + // Ext_SurfaceFunction21(l, d); + // Ext_SurfaceFunction22(l, d); + // Ext_SurfaceFunction23(l, d); + // Ext_SurfaceFunction24(l, d); + // Ext_SurfaceFunction25(l, d); + // Ext_SurfaceFunction26(l, d); + // Ext_SurfaceFunction27(l, d); + // Ext_SurfaceFunction28(l, d); + // Ext_SurfaceFunction29(l, d); + } + +#if !_DECALSHADER + + void ChainModifyVertex(inout VertexData v, inout VertexToPixel v2p, float4 time) + { + ExtraV2F d; + + ZERO_INITIALIZE(ExtraV2F, d); + ZERO_INITIALIZE(Blackboard, d.blackboard); + // due to motion vectors in HDRP, we need to use the last + // time in certain spots. So if you are going to use _Time to adjust vertices, + // you need to use this time or motion vectors will break. + d.time = time; + + Ext_ModifyVertex0(v, d); + // Ext_ModifyVertex1(v, d); + // Ext_ModifyVertex2(v, d); + // Ext_ModifyVertex3(v, d); + // Ext_ModifyVertex4(v, d); + // Ext_ModifyVertex5(v, d); + // Ext_ModifyVertex6(v, d); + // Ext_ModifyVertex7(v, d); + // Ext_ModifyVertex8(v, d); + // Ext_ModifyVertex9(v, d); + // Ext_ModifyVertex10(v, d); + // Ext_ModifyVertex11(v, d); + // Ext_ModifyVertex12(v, d); + // Ext_ModifyVertex13(v, d); + // Ext_ModifyVertex14(v, d); + // Ext_ModifyVertex15(v, d); + // Ext_ModifyVertex16(v, d); + // Ext_ModifyVertex17(v, d); + // Ext_ModifyVertex18(v, d); + // Ext_ModifyVertex19(v, d); + // Ext_ModifyVertex20(v, d); + // Ext_ModifyVertex21(v, d); + // Ext_ModifyVertex22(v, d); + // Ext_ModifyVertex23(v, d); + // Ext_ModifyVertex24(v, d); + // Ext_ModifyVertex25(v, d); + // Ext_ModifyVertex26(v, d); + // Ext_ModifyVertex27(v, d); + // Ext_ModifyVertex28(v, d); + // Ext_ModifyVertex29(v, d); + + + // #if %EXTRAV2F0REQUIREKEY% + // v2p.extraV2F0 = d.extraV2F0; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // v2p.extraV2F1 = d.extraV2F1; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // v2p.extraV2F2 = d.extraV2F2; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // v2p.extraV2F3 = d.extraV2F3; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // v2p.extraV2F4 = d.extraV2F4; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // v2p.extraV2F5 = d.extraV2F5; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // v2p.extraV2F6 = d.extraV2F6; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // v2p.extraV2F7 = d.extraV2F7; + // #endif + } + + void ChainModifyTessellatedVertex(inout VertexData v, inout VertexToPixel v2p) + { + ExtraV2F d; + ZERO_INITIALIZE(ExtraV2F, d); + ZERO_INITIALIZE(Blackboard, d.blackboard); + + // #if %EXTRAV2F0REQUIREKEY% + // d.extraV2F0 = v2p.extraV2F0; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // d.extraV2F1 = v2p.extraV2F1; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // d.extraV2F2 = v2p.extraV2F2; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // d.extraV2F3 = v2p.extraV2F3; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // d.extraV2F4 = v2p.extraV2F4; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // d.extraV2F5 = v2p.extraV2F5; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // d.extraV2F6 = v2p.extraV2F6; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // d.extraV2F7 = v2p.extraV2F7; + // #endif + + + // Ext_ModifyTessellatedVertex0(v, d); + // Ext_ModifyTessellatedVertex1(v, d); + // Ext_ModifyTessellatedVertex2(v, d); + // Ext_ModifyTessellatedVertex3(v, d); + // Ext_ModifyTessellatedVertex4(v, d); + // Ext_ModifyTessellatedVertex5(v, d); + // Ext_ModifyTessellatedVertex6(v, d); + // Ext_ModifyTessellatedVertex7(v, d); + // Ext_ModifyTessellatedVertex8(v, d); + // Ext_ModifyTessellatedVertex9(v, d); + // Ext_ModifyTessellatedVertex10(v, d); + // Ext_ModifyTessellatedVertex11(v, d); + // Ext_ModifyTessellatedVertex12(v, d); + // Ext_ModifyTessellatedVertex13(v, d); + // Ext_ModifyTessellatedVertex14(v, d); + // Ext_ModifyTessellatedVertex15(v, d); + // Ext_ModifyTessellatedVertex16(v, d); + // Ext_ModifyTessellatedVertex17(v, d); + // Ext_ModifyTessellatedVertex18(v, d); + // Ext_ModifyTessellatedVertex19(v, d); + // Ext_ModifyTessellatedVertex20(v, d); + // Ext_ModifyTessellatedVertex21(v, d); + // Ext_ModifyTessellatedVertex22(v, d); + // Ext_ModifyTessellatedVertex23(v, d); + // Ext_ModifyTessellatedVertex24(v, d); + // Ext_ModifyTessellatedVertex25(v, d); + // Ext_ModifyTessellatedVertex26(v, d); + // Ext_ModifyTessellatedVertex27(v, d); + // Ext_ModifyTessellatedVertex28(v, d); + // Ext_ModifyTessellatedVertex29(v, d); + + // #if %EXTRAV2F0REQUIREKEY% + // v2p.extraV2F0 = d.extraV2F0; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // v2p.extraV2F1 = d.extraV2F1; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // v2p.extraV2F2 = d.extraV2F2; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // v2p.extraV2F3 = d.extraV2F3; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // v2p.extraV2F4 = d.extraV2F4; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // v2p.extraV2F5 = d.extraV2F5; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // v2p.extraV2F6 = d.extraV2F6; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // v2p.extraV2F7 = d.extraV2F7; + // #endif + } + + void ChainFinalColorForward(inout Surface l, inout ShaderData d, inout half4 color) + { + // Ext_FinalColorForward0(l, d, color); + // Ext_FinalColorForward1(l, d, color); + // Ext_FinalColorForward2(l, d, color); + // Ext_FinalColorForward3(l, d, color); + // Ext_FinalColorForward4(l, d, color); + // Ext_FinalColorForward5(l, d, color); + // Ext_FinalColorForward6(l, d, color); + // Ext_FinalColorForward7(l, d, color); + // Ext_FinalColorForward8(l, d, color); + // Ext_FinalColorForward9(l, d, color); + // Ext_FinalColorForward10(l, d, color); + // Ext_FinalColorForward11(l, d, color); + // Ext_FinalColorForward12(l, d, color); + // Ext_FinalColorForward13(l, d, color); + // Ext_FinalColorForward14(l, d, color); + // Ext_FinalColorForward15(l, d, color); + // Ext_FinalColorForward16(l, d, color); + // Ext_FinalColorForward17(l, d, color); + // Ext_FinalColorForward18(l, d, color); + // Ext_FinalColorForward19(l, d, color); + // Ext_FinalColorForward20(l, d, color); + // Ext_FinalColorForward21(l, d, color); + // Ext_FinalColorForward22(l, d, color); + // Ext_FinalColorForward23(l, d, color); + // Ext_FinalColorForward24(l, d, color); + // Ext_FinalColorForward25(l, d, color); + // Ext_FinalColorForward26(l, d, color); + // Ext_FinalColorForward27(l, d, color); + // Ext_FinalColorForward28(l, d, color); + // Ext_FinalColorForward29(l, d, color); + } + + void ChainFinalGBufferStandard(inout Surface s, inout ShaderData d, inout half4 GBuffer0, inout half4 GBuffer1, inout half4 GBuffer2, inout half4 outEmission, inout half4 outShadowMask) + { + // Ext_FinalGBufferStandard0(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard1(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard2(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard3(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard4(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard5(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard6(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard7(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard8(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard9(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard10(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard11(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard12(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard13(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard14(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard15(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard16(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard17(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard18(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard19(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard20(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard21(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard22(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard23(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard24(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard25(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard26(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard27(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard28(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard29(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + } +#endif + + + + + +#if _DECALSHADER + + ShaderData CreateShaderData(SurfaceDescriptionInputs IN) + { + ShaderData d = (ShaderData)0; + d.TBNMatrix = float3x3(IN.WorldSpaceTangent, IN.WorldSpaceBiTangent, IN.WorldSpaceNormal); + d.worldSpaceNormal = IN.WorldSpaceNormal; + d.worldSpaceTangent = IN.WorldSpaceTangent; + + d.worldSpacePosition = IN.WorldSpacePosition; + d.texcoord0 = IN.uv0.xyxy; + d.screenPos = IN.ScreenPosition; + + d.worldSpaceViewDir = normalize(_WorldSpaceCameraPos - d.worldSpacePosition); + + d.tangentSpaceViewDir = mul(d.TBNMatrix, d.worldSpaceViewDir); + + // these rarely get used, so we back transform them. Usually will be stripped. + #if _HDRP + // d.localSpacePosition = mul(GetWorldToObjectMatrix(), float4(GetCameraRelativePositionWS(d.worldSpacePosition), 1)).xyz; + #else + // d.localSpacePosition = mul(GetWorldToObjectMatrix(), float4(d.worldSpacePosition, 1)).xyz; + #endif + // d.localSpaceNormal = normalize(mul((float3x3)GetWorldToObjectMatrix(), d.worldSpaceNormal)); + // d.localSpaceTangent = normalize(mul((float3x3)GetWorldToObjectMatrix(), d.worldSpaceTangent.xyz)); + + // #if %SCREENPOSREQUIREKEY% + // d.screenUV = (IN.ScreenPosition.xy / max(0.01, IN.ScreenPosition.w)); + // #endif + + return d; + } +#else + + ShaderData CreateShaderData(VertexToPixel i + #if NEED_FACING + , bool facing + #endif + ) + { + ShaderData d = (ShaderData)0; + d.clipPos = i.pos; + d.worldSpacePosition = i.worldPos; + + d.worldSpaceNormal = normalize(i.worldNormal); + d.worldSpaceTangent.xyz = normalize(i.worldTangent.xyz); + + d.tangentSign = i.worldTangent.w * unity_WorldTransformParams.w; + float3 bitangent = cross(d.worldSpaceTangent.xyz, d.worldSpaceNormal) * d.tangentSign; + + d.TBNMatrix = float3x3(d.worldSpaceTangent, -bitangent, d.worldSpaceNormal); + d.worldSpaceViewDir = normalize(_WorldSpaceCameraPos - i.worldPos); + + d.tangentSpaceViewDir = mul(d.TBNMatrix, d.worldSpaceViewDir); + d.texcoord0 = i.texcoord0; + d.texcoord1 = i.texcoord1; + d.texcoord2 = i.texcoord2; + + // #if %TEXCOORD3REQUIREKEY% + d.texcoord3 = i.texcoord3; + // #endif + + // d.isFrontFace = facing; + // #if %VERTEXCOLORREQUIREKEY% + d.vertexColor = i.vertexColor; + // #endif + + // these rarely get used, so we back transform them. Usually will be stripped. + #if _HDRP + // d.localSpacePosition = mul(GetWorldToObjectMatrix(), float4(GetCameraRelativePositionWS(i.worldPos), 1)).xyz; + #else + // d.localSpacePosition = mul(GetWorldToObjectMatrix(), float4(i.worldPos, 1)).xyz; + #endif + // d.localSpaceNormal = normalize(mul((float3x3)GetWorldToObjectMatrix(), i.worldNormal)); + // d.localSpaceTangent = normalize(mul((float3x3)GetWorldToObjectMatrix(), i.worldTangent.xyz)); + + // #if %SCREENPOSREQUIREKEY% + // d.screenPos = i.screenPos; + // d.screenUV = (i.screenPos.xy / i.screenPos.w); + // #endif + + + // #if %EXTRAV2F0REQUIREKEY% + // d.extraV2F0 = i.extraV2F0; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // d.extraV2F1 = i.extraV2F1; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // d.extraV2F2 = i.extraV2F2; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // d.extraV2F3 = i.extraV2F3; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // d.extraV2F4 = i.extraV2F4; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // d.extraV2F5 = i.extraV2F5; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // d.extraV2F6 = i.extraV2F6; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // d.extraV2F7 = i.extraV2F7; + // #endif + + return d; + } + +#endif + + + #if defined(_PASSSHADOW) + float3 _LightDirection; + float3 _LightPosition; + #endif + + #if (_PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR))) + + #define GetWorldToViewMatrix() _ViewMatrix + #define UNITY_MATRIX_I_V _InvViewMatrix + #define GetViewToHClipMatrix() OptimizeProjectionMatrix(_ProjMatrix) + #define UNITY_MATRIX_I_P _InvProjMatrix + #define GetWorldToHClipMatrix() _ViewProjMatrix + #define UNITY_MATRIX_I_VP _InvViewProjMatrix + #define UNITY_MATRIX_UNJITTERED_VP _NonJitteredViewProjMatrix + #define UNITY_MATRIX_PREV_VP _PrevViewProjMatrix + #define UNITY_MATRIX_PREV_I_VP _PrevInvViewProjMatrix + + void MotionVectorPositionZBias(VertexToPixel input) + { + #if UNITY_REVERSED_Z + input.pos.z -= unity_MotionVectorsParams.z * input.pos.w; + #else + input.pos.z += unity_MotionVectorsParams.z * input.pos.w; + #endif + } + + #endif + + // vertex shader + VertexToPixel Vert (VertexData v) + { + VertexToPixel o = (VertexToPixel)0; + + UNITY_SETUP_INSTANCE_ID(v); + UNITY_TRANSFER_INSTANCE_ID(v, o); + UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o); + + + #if _URP && (_PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR))) + VertexData previousMesh = v; + #endif + #if !_TESSELLATION_ON + ChainModifyVertex(v, o, _Time); + #endif + + o.texcoord0 = v.texcoord0; + o.texcoord1 = v.texcoord1; + o.texcoord2 = v.texcoord2; + + // #if %TEXCOORD3REQUIREKEY% + o.texcoord3 = v.texcoord3; + // #endif + + // #if %VERTEXCOLORREQUIREKEY% + o.vertexColor = v.vertexColor; + // #endif + + // This return the camera relative position (if enable) + float3 positionWS = TransformObjectToWorld(v.vertex.xyz); + float3 normalWS = TransformObjectToWorldNormal(v.normal); + float4 tangentWS = float4(TransformObjectToWorldDir(v.tangent.xyz), v.tangent.w); + + VertexPositionInputs vertexInput = GetVertexPositionInputs(v.vertex.xyz); + o.worldPos = positionWS; + o.worldNormal = normalWS; + o.worldTangent = tangentWS; + + + // For some very odd reason, in 2021.2, we can't use Unity's defines, but have to use our own.. + #if _PASSSHADOW + #if _CASTING_PUNCTUAL_LIGHT_SHADOW + float3 lightDirectionWS = normalize(_LightPosition - o.worldPos); + #else + float3 lightDirectionWS = _LightDirection; + #endif + // Define shadow pass specific clip position for Universal + o.pos = TransformWorldToHClip(ApplyShadowBias(o.worldPos, o.worldNormal, lightDirectionWS)); + #if UNITY_REVERSED_Z + o.pos.z = min(o.pos.z, UNITY_NEAR_CLIP_VALUE); + #else + o.pos.z = max(o.pos.z, UNITY_NEAR_CLIP_VALUE); + #endif + #elif _PASSMETA + o.pos = MetaVertexPosition(float4(v.vertex.xyz, 0), v.texcoord1.xy, v.texcoord2.xy, unity_LightmapST, unity_DynamicLightmapST); + #else + o.pos = TransformWorldToHClip(o.worldPos); + #endif + + // #if %SCREENPOSREQUIREKEY% + // o.screenPos = ComputeScreenPos(o.pos, _ProjectionParams.x); + // #endif + + + #if _PASSFORWARD || _PASSGBUFFER + float2 uv1 = v.texcoord1.xy; + OUTPUT_LIGHTMAP_UV(uv1, unity_LightmapST, o.lightmapUV); + o.texcoord1.xy = uv1; + #if UNITY_VERSION < 60000009 + OUTPUT_SH(o.worldNormal, o.sh); + #endif + + #if defined(DYNAMICLIGHTMAP_ON) + o.dynamicLightmapUV.xy = v.texcoord2.xy * unity_DynamicLightmapST.xy + unity_DynamicLightmapST.zw; + #if UNITY_VERSION >= 60000009 + OUTPUT_SH(o.worldNormal, o.sh); + #endif + #elif (defined(PROBE_VOLUMES_L1) || defined(PROBE_VOLUMES_L2)) && UNITY_VERSION >= 60000009 + OUTPUT_SH4(vertexInput.positionWS, o.worldNormal.xyz, GetWorldSpaceNormalizeViewDir(vertexInput.positionWS), o.sh, o.probeOcclusion); + #endif + #endif + + #ifdef VARYINGS_NEED_FOG_AND_VERTEX_LIGHT + half fogFactor = 0; + #if defined(_FOG_FRAGMENT) + fogFactor = ComputeFogFactor(o.pos.z); + #endif + #if _BAKEDLIT + o.fogFactorAndVertexLight = half4(fogFactor, 0, 0, 0); + #else + half3 vertexLight = VertexLighting(o.worldPos, o.worldNormal); + o.fogFactorAndVertexLight = half4(fogFactor, vertexLight); + #endif + #endif + + #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR) + o.shadowCoord = GetShadowCoord(vertexInput); + #endif + + #if _URP && (_PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR))) + #if !defined(TESSELLATION_ON) + MotionVectorPositionZBias(o); + #endif + + o.previousPositionCS = float4(0.0, 0.0, 0.0, 1.0); + // Note: unity_MotionVectorsParams.y is 0 is forceNoMotion is enabled + bool forceNoMotion = unity_MotionVectorsParams.y == 0.0; + + if (!forceNoMotion) + { + #if defined(HAVE_VFX_MODIFICATION) + float3 previousPositionOS = currentFrameMvData.vfxParticlePositionOS; + #if defined(VFX_FEATURE_MOTION_VECTORS_VERTS) + const bool applyDeformation = false; + #else + const bool applyDeformation = true; + #endif + #else + const bool hasDeformation = unity_MotionVectorsParams.x == 1; // Mesh has skinned deformation + float3 previousPositionOS = hasDeformation ? previousMesh.previousPositionOS : previousMesh.vertex.xyz; + + #if defined(AUTOMATIC_TIME_BASED_MOTION_VECTORS) && defined(GRAPH_VERTEX_USES_TIME_PARAMETERS_INPUT) + const bool applyDeformation = true; + #else + const bool applyDeformation = hasDeformation; + #endif + #endif + // TODO + #if defined(FEATURES_GRAPH_VERTEX) + if (applyDeformation) + previousPositionOS = GetLastFrameDeformedPosition(previousMesh, currentFrameMvData, previousPositionOS); + else + previousPositionOS = previousMesh.positionOS; + + #if defined(FEATURES_GRAPH_VERTEX_MOTION_VECTOR_OUTPUT) + previousPositionOS -= previousMesh.precomputedVelocity; + #endif + #endif + + #if defined(UNITY_DOTS_INSTANCING_ENABLED) && defined(DOTS_DEFORMED) + // Deformed vertices in DOTS are not cumulative with built-in Unity skinning/blend shapes + // Needs to be called after vertex modification has been applied otherwise it will be + // overwritten by Compute Deform node + ApplyPreviousFrameDeformedVertexPosition(previousMesh.vertexID, previousPositionOS); + #endif + #if defined (_ADD_PRECOMPUTED_VELOCITY) + previousPositionOS -= previousMesh.precomputedVelocity; + #endif + o.positionCS = mul(UNITY_MATRIX_UNJITTERED_VP, float4(positionWS, 1.0f)); + + #if defined(HAVE_VFX_MODIFICATION) + #if defined(VFX_FEATURE_MOTION_VECTORS_VERTS) + #if defined(FEATURES_GRAPH_VERTEX_MOTION_VECTOR_OUTPUT) || defined(_ADD_PRECOMPUTED_VELOCITY) + #error Unexpected fast path rendering VFX motion vector while there are vertex modification afterwards. + #endif + o.previousPositionCS = VFXGetPreviousClipPosition(previousMesh, currentFrameMvData.vfxElementAttributes, o.positionCS); + #else + #if VFX_WORLD_SPACE + //previousPositionOS is already in world space + const float3 previousPositionWS = previousPositionOS; + #else + const float3 previousPositionWS = mul(UNITY_PREV_MATRIX_M, float4(previousPositionOS, 1.0f)).xyz; + #endif + o.previousPositionCS = mul(UNITY_MATRIX_PREV_VP, float4(previousPositionWS, 1.0f)); + #endif + #else + o.previousPositionCS = mul(UNITY_MATRIX_PREV_VP, mul(UNITY_PREV_MATRIX_M, float4(previousPositionOS, 1))); + #endif + } + #endif + + return o; + } + + + + + // fragment shader + half4 Frag (VertexToPixel IN + #ifdef _DEPTHOFFSET_ON + , out float outputDepth : SV_Depth + #endif + #if NEED_FACING + , bool facing : SV_IsFrontFace + #endif + ) : SV_Target + { + UNITY_SETUP_INSTANCE_ID(IN); + UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX(IN); + + #if defined(LOD_FADE_CROSSFADE) && USE_UNITY_CROSSFADE + LODFadeCrossFade(IN.pos); + #endif + + ShaderData d = CreateShaderData(IN + #if NEED_FACING + , facing + #endif + ); + Surface l = (Surface)0; + + #ifdef _DEPTHOFFSET_ON + l.outputDepth = outputDepth; + #endif + + l.Albedo = half3(0.5, 0.5, 0.5); + l.Normal = float3(0,0,1); + l.Occlusion = 1; + l.Alpha = 1; + + ChainSurfaceFunction(l, d); + + #ifdef _DEPTHOFFSET_ON + outputDepth = l.outputDepth; + #endif + + return 0; + + } + + ENDHLSL + + } + + + + Pass + { + Name "Meta" + Tags + { + "LightMode" = "Meta" + } + + Cull Off + + + Tags { "RenderType" = "Opaque" "Queue" = "Geometry" "PreviewType" = "Plane" } + Cull [_CullingOption] + ZWrite [_ZWrite] + ZTest [_ZTestMode] + + + HLSLPROGRAM + + #pragma vertex Vert + #pragma fragment Frag + + #pragma target 3.0 + + #pragma prefer_hlslcc gles + #pragma exclude_renderers d3d11_9x + + #define SHADERPASS SHADERPASS_META + #define _PASSMETA 1 + + + + #pragma shader_feature_local GLOW_ON + #pragma shader_feature_local FADE_ON + #pragma shader_feature_local OUTBASE_ON + #pragma shader_feature_local ONLYOUTLINE_ON + #pragma shader_feature_local GRADIENT_ON + #pragma shader_feature_local GRADIENT2COL_ON + #pragma shader_feature_local RADIALGRADIENT_ON + #pragma shader_feature_local COLORSWAP_ON + #pragma shader_feature_local HSV_ON + #pragma shader_feature_local CHANGECOLOR_ON + #pragma shader_feature_local CHANGECOLOR2_ON + #pragma shader_feature_local CHANGECOLOR3_ON + #pragma shader_feature_local COLORRAMP_ON + #pragma shader_feature_local GRADIENTCOLORRAMP_ON + #pragma shader_feature_local HITEFFECT_ON + #pragma shader_feature_local NEGATIVE_ON + #pragma shader_feature_local PIXELATE_ON + #pragma shader_feature_local GREYSCALE_ON + #pragma shader_feature_local POSTERIZE_ON + #pragma shader_feature_local BLUR_ON + #pragma shader_feature_local MOTIONBLUR_ON + #pragma shader_feature_local GHOST_ON + #pragma shader_feature_local ALPHAOUTLINE_ON + #pragma shader_feature_local INNEROUTLINE_ON + #pragma shader_feature_local ONLYINNEROUTLINE_ON + #pragma shader_feature_local HOLOGRAM_ON + #pragma shader_feature_local CHROMABERR_ON + #pragma shader_feature_local GLITCH_ON + #pragma shader_feature_local FLICKER_ON + #pragma shader_feature_local SHADOW_ON + #pragma shader_feature_local SHINE_ON + #pragma shader_feature_local CONTRAST_ON + #pragma shader_feature_local OVERLAY_ON + #pragma shader_feature_local OVERLAYMULT_ON + #pragma shader_feature_local DOODLE_ON + #pragma shader_feature_local WIND_ON + #pragma shader_feature_local WAVEUV_ON + #pragma shader_feature_local ROUNDWAVEUV_ON + #pragma shader_feature_local RECTSIZE_ON + #pragma shader_feature_local OFFSETUV_ON + #pragma shader_feature_local CLIPPING_ON + #pragma shader_feature_local RADIALCLIPPING_ON + #pragma shader_feature_local TEXTURESCROLL_ON + #pragma shader_feature_local ZOOMUV_ON + #pragma shader_feature_local DISTORT_ON + #pragma shader_feature_local WARP_ON + #pragma shader_feature_local TWISTUV_ON + #pragma shader_feature_local ROTATEUV_ON + #pragma shader_feature_local POLARUV_ON + #pragma shader_feature_local FISHEYE_ON + #pragma shader_feature_local PINCH_ON + #pragma shader_feature_local SHAKEUV_ON + + #pragma shader_feature_local GLOWTEX_ON + #pragma shader_feature_local OUTTEX_ON + #pragma shader_feature_local OUTDIST_ON + #pragma shader_feature_local OUTBASE8DIR_ON + #pragma shader_feature_local OUTBASEPIXELPERF_ON + #pragma shader_feature_local COLORRAMPOUTLINE_ON + #pragma shader_feature_local GREYSCALEOUTLINE_ON + #pragma shader_feature_local POSTERIZEOUTLINE_ON + #pragma shader_feature_local BLURISHD_ON + #pragma shader_feature_local MANUALWIND_ON + #pragma shader_feature_local ATLAS_ON + #pragma shader_feature_local PREMULTIPLYALPHA_ON + + #pragma shader_feature BILBOARD_ON + #pragma shader_feature BILBOARDY_ON + + #pragma shader_feature NORMALMAP_ON + + + #define _URP 1 +#define _USINGTEXCOORD1 1 +#define _USINGTEXCOORD2 1 + + + + // Includes + #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.universal/ShaderLibrary/Input.hlsl" + #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/TextureStack.hlsl" + #include_with_pragmas "Packages/com.unity.render-pipelines.core/ShaderLibrary/FoveatedRenderingKeywords.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" + + #undef WorldNormalVector + #define WorldNormalVector(data, normal) mul(normal, data.TBNMatrix) + + #define UnityObjectToWorldNormal(normal) mul(GetObjectToWorldMatrix(), normal) + + #define _WorldSpaceLightPos0 _MainLightPosition + + #define UNITY_DECLARE_TEX2D(name) TEXTURE2D(name); SAMPLER(sampler##name); + #define UNITY_DECLARE_TEX2D_NOSAMPLER(name) TEXTURE2D(name); + #define UNITY_DECLARE_TEX2DARRAY(name) TEXTURE2D_ARRAY(name); SAMPLER(sampler##name); + #define UNITY_DECLARE_TEX2DARRAY_NOSAMPLER(name) TEXTURE2D_ARRAY(name); + + #define UNITY_SAMPLE_TEX2DARRAY(tex,coord) SAMPLE_TEXTURE2D_ARRAY(tex, sampler##tex, coord.xy, coord.z) + #define UNITY_SAMPLE_TEX2DARRAY_LOD(tex,coord,lod) SAMPLE_TEXTURE2D_ARRAY_LOD(tex, sampler##tex, coord.xy, coord.z, lod) + #define UNITY_SAMPLE_TEX2D(tex, coord) SAMPLE_TEXTURE2D(tex, sampler##tex, coord) + #define UNITY_SAMPLE_TEX2D_SAMPLER(tex, samp, coord) SAMPLE_TEXTURE2D(tex, sampler##samp, coord) + + #define UNITY_SAMPLE_TEX2D_LOD(tex,coord, lod) SAMPLE_TEXTURE2D_LOD(tex, sampler_##tex, coord, lod) + #define UNITY_SAMPLE_TEX2D_SAMPLER_LOD(tex,samplertex,coord, lod) SAMPLE_TEXTURE2D_LOD (tex, sampler##samplertex,coord, lod) + + #if defined(UNITY_COMPILER_HLSL) + #define UNITY_INITIALIZE_OUTPUT(type,name) name = (type)0; + #else + #define UNITY_INITIALIZE_OUTPUT(type,name) + #endif + + #define sampler2D_float sampler2D + #define sampler2D_half sampler2D + + + + // data across stages, stripped like the above. + struct VertexToPixel + { + float4 pos : SV_POSITION; + float3 worldPos : TEXCOORD0; + float3 worldNormal : TEXCOORD1; + float4 worldTangent : TEXCOORD2; + float4 texcoord0 : TEXCOORD3; + float4 texcoord1 : TEXCOORD4; + float4 texcoord2 : TEXCOORD5; + + // #if %TEXCOORD3REQUIREKEY% + float4 texcoord3 : TEXCOORD6; + // #endif + + // #if %SCREENPOSREQUIREKEY% + // float4 screenPos : TEXCOORD7; + // #endif + + // #if %VERTEXCOLORREQUIREKEY% + half4 vertexColor : COLOR; + // #endif + + #if defined(LIGHTMAP_ON) + float2 lightmapUV : TEXCOORD8; + #endif + #if defined(DYNAMICLIGHTMAP_ON) + float2 dynamicLightmapUV : TEXCOORD9; + #endif + #if !defined(LIGHTMAP_ON) + float4 probeOcclusion : TEXCOORD8; + float3 sh : TEXCOORD10; + #endif + + #if defined(VARYINGS_NEED_FOG_AND_VERTEX_LIGHT) + float4 fogFactorAndVertexLight : TEXCOORD11; + #endif + + #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR) + float4 shadowCoord : TEXCOORD12; + #endif + + // #if %EXTRAV2F0REQUIREKEY% + // float4 extraV2F0 : TEXCOORD13; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // float4 extraV2F1 : TEXCOORD14; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // float4 extraV2F2 : TEXCOORD15; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // float4 extraV2F3 : TEXCOORD16; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // float4 extraV2F4 : TEXCOORD17; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // float4 extraV2F5 : TEXCOORD18; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // float4 extraV2F6 : TEXCOORD19; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // float4 extraV2F7 : TEXCOORD20; + // #endif + + #if UNITY_ANY_INSTANCING_ENABLED + uint instanceID : CUSTOM_INSTANCE_ID; + #endif + #if (defined(UNITY_STEREO_MULTIVIEW_ENABLED)) || (defined(UNITY_STEREO_INSTANCING_ENABLED) && (defined(SHADER_API_GLES3) || defined(SHADER_API_GLCORE))) + uint stereoTargetEyeIndexAsBlendIdx0 : BLENDINDICES0; + #endif + #if (defined(UNITY_STEREO_INSTANCING_ENABLED)) + uint stereoTargetEyeIndexAsRTArrayIdx : SV_RenderTargetArrayIndex; + #endif + #if defined(SHADER_STAGE_FRAGMENT) && defined(VARYINGS_NEED_CULLFACE) + FRONT_FACE_TYPE cullFace : FRONT_FACE_SEMANTIC; + #endif + + #if _PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR)) + float4 previousPositionCS : TEXCOORD21; // Contain previous transform position (in case of skinning for example) + float4 positionCS : TEXCOORD22; + #endif + }; + + + + + // data describing the user output of a pixel + struct Surface + { + half3 Albedo; + half Height; + half3 Normal; + half Smoothness; + half3 Emission; + half Metallic; + half3 Specular; + half Occlusion; + half SpecularPower; // for simple lighting + half Alpha; + float outputDepth; // if written, SV_Depth semantic is used. ShaderData.clipPos.z is unused value + // HDRP Only + half SpecularOcclusion; + half SubsurfaceMask; + half Thickness; + half CoatMask; + half CoatSmoothness; + half Anisotropy; + half IridescenceMask; + half IridescenceThickness; + int DiffusionProfileHash; + float SpecularAAThreshold; + float SpecularAAScreenSpaceVariance; + // requires _OVERRIDE_BAKEDGI to be defined, but is mapped in all pipelines + float3 DiffuseGI; + float3 BackDiffuseGI; + float3 SpecularGI; + float ior; + float3 transmittanceColor; + float atDistance; + float transmittanceMask; + // requires _OVERRIDE_SHADOWMASK to be defines + float4 ShadowMask; + + // for decals + float NormalAlpha; + float MAOSAlpha; + + + }; + + // Data the user declares in blackboard blocks + struct Blackboard + { + + float blackboardDummyData; + }; + + // data the user might need, this will grow to be big. But easy to strip + struct ShaderData + { + float4 clipPos; // SV_POSITION + float3 localSpacePosition; + float3 localSpaceNormal; + float3 localSpaceTangent; + + float3 worldSpacePosition; + float3 worldSpaceNormal; + float3 worldSpaceTangent; + float tangentSign; + + float3 worldSpaceViewDir; + float3 tangentSpaceViewDir; + + float4 texcoord0; + float4 texcoord1; + float4 texcoord2; + float4 texcoord3; + + float2 screenUV; + float4 screenPos; + + float4 vertexColor; + bool isFrontFace; + + float4 extraV2F0; + float4 extraV2F1; + float4 extraV2F2; + float4 extraV2F3; + float4 extraV2F4; + float4 extraV2F5; + float4 extraV2F6; + float4 extraV2F7; + + float3x3 TBNMatrix; + Blackboard blackboard; + }; + + struct VertexData + { + #if SHADER_TARGET > 30 + // uint vertexID : SV_VertexID; + #endif + float4 vertex : POSITION; + float3 normal : NORMAL; + float4 tangent : TANGENT; + float4 texcoord0 : TEXCOORD0; + + // optimize out mesh coords when not in use by user or lighting system + #if _URP && (_USINGTEXCOORD1 || _PASSMETA || _PASSFORWARD || _PASSGBUFFER) + float4 texcoord1 : TEXCOORD1; + #endif + + #if _URP && (_USINGTEXCOORD2 || _PASSMETA || ((_PASSFORWARD || _PASSGBUFFER) && defined(DYNAMICLIGHTMAP_ON))) + float4 texcoord2 : TEXCOORD2; + #endif + + #if _STANDARD && (_USINGTEXCOORD1 || (_PASSMETA || ((_PASSFORWARD || _PASSGBUFFER || _PASSFORWARDADD) && LIGHTMAP_ON))) + float4 texcoord1 : TEXCOORD1; + #endif + #if _STANDARD && (_USINGTEXCOORD2 || (_PASSMETA || ((_PASSFORWARD || _PASSGBUFFER) && DYNAMICLIGHTMAP_ON))) + float4 texcoord2 : TEXCOORD2; + #endif + + + #if _HDRP + float4 texcoord1 : TEXCOORD1; + float4 texcoord2 : TEXCOORD2; + #endif + + // #if %TEXCOORD3REQUIREKEY% + float4 texcoord3 : TEXCOORD3; + // #endif + + // #if %VERTEXCOLORREQUIREKEY% + float4 vertexColor : COLOR; + // #endif + + #if _PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR)) + float3 previousPositionOS : TEXCOORD4; // Contain previous transform position (in case of skinning for example) + #if defined (_ADD_PRECOMPUTED_VELOCITY) + float3 precomputedVelocity : TEXCOORD5; // Add Precomputed Velocity (Alembic computes velocities on runtime side). + #endif + #endif + + UNITY_VERTEX_INPUT_INSTANCE_ID + }; + + struct TessVertex + { + float4 vertex : INTERNALTESSPOS; + float3 normal : NORMAL; + float4 tangent : TANGENT; + float4 texcoord0 : TEXCOORD0; + float4 texcoord1 : TEXCOORD1; + float4 texcoord2 : TEXCOORD2; + + // #if %TEXCOORD3REQUIREKEY% + float4 texcoord3 : TEXCOORD3; + // #endif + + // #if %VERTEXCOLORREQUIREKEY% + float4 vertexColor : COLOR; + // #endif + + // #if %EXTRAV2F0REQUIREKEY% + // float4 extraV2F0 : TEXCOORD5; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // float4 extraV2F1 : TEXCOORD6; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // float4 extraV2F2 : TEXCOORD7; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // float4 extraV2F3 : TEXCOORD8; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // float4 extraV2F4 : TEXCOORD9; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // float4 extraV2F5 : TEXCOORD10; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // float4 extraV2F6 : TEXCOORD11; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // float4 extraV2F7 : TEXCOORD12; + // #endif + + #if _PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR)) + float3 previousPositionOS : TEXCOORD13; // Contain previous transform position (in case of skinning for example) + #if defined (_ADD_PRECOMPUTED_VELOCITY) + float3 precomputedVelocity : TEXCOORD14; + #endif + #endif + + UNITY_VERTEX_INPUT_INSTANCE_ID + UNITY_VERTEX_OUTPUT_STEREO + }; + + struct ExtraV2F + { + float4 extraV2F0; + float4 extraV2F1; + float4 extraV2F2; + float4 extraV2F3; + float4 extraV2F4; + float4 extraV2F5; + float4 extraV2F6; + float4 extraV2F7; + Blackboard blackboard; + float4 time; + }; + + + float3 WorldToTangentSpace(ShaderData d, float3 normal) + { + return mul(d.TBNMatrix, normal); + } + + float3 TangentToWorldSpace(ShaderData d, float3 normal) + { + return mul(normal, d.TBNMatrix); + } + + // in this case, make standard more like SRPs, because we can't fix + // unity_WorldToObject in HDRP, since it already does macro-fu there + + #if _STANDARD + float3 TransformWorldToObject(float3 p) { return mul(unity_WorldToObject, float4(p, 1)); }; + float3 TransformObjectToWorld(float3 p) { return mul(unity_ObjectToWorld, float4(p, 1)); }; + float4 TransformWorldToObject(float4 p) { return mul(unity_WorldToObject, p); }; + float4 TransformObjectToWorld(float4 p) { return mul(unity_ObjectToWorld, p); }; + float4x4 GetWorldToObjectMatrix() { return unity_WorldToObject; } + float4x4 GetObjectToWorldMatrix() { return unity_ObjectToWorld; } + #if (defined(SHADER_API_D3D11) || defined(SHADER_API_XBOXONE) || defined(UNITY_COMPILER_HLSLCC) || defined(SHADER_API_PSSL) || (SHADER_TARGET_SURFACE_ANALYSIS && !SHADER_TARGET_SURFACE_ANALYSIS_MOJOSHADER)) + #define UNITY_SAMPLE_TEX2D_LOD(tex,coord, lod) tex.SampleLevel (sampler##tex,coord, lod) + #define UNITY_SAMPLE_TEX2D_SAMPLER_LOD(tex,samplertex,coord, lod) tex.SampleLevel (sampler##samplertex,coord, lod) + #else + #define UNITY_SAMPLE_TEX2D_LOD(tex,coord,lod) tex2D (tex,coord,0,lod) + #define UNITY_SAMPLE_TEX2D_SAMPLER_LOD(tex,samplertex,coord,lod) tex2D (tex,coord,0,lod) + #endif + + #undef GetWorldToObjectMatrix() + + #define GetWorldToObjectMatrix() unity_WorldToObject + + + #endif + + float3 GetCameraWorldPosition() + { + #if _HDRP + return GetCameraRelativePositionWS(_WorldSpaceCameraPos); + #else + return _WorldSpaceCameraPos; + #endif + } + + #if _GRABPASSUSED + #if _STANDARD + TEXTURE2D(%GRABTEXTURE%); + SAMPLER(sampler_%GRABTEXTURE%); + #endif + + half3 GetSceneColor(float2 uv) + { + #if _STANDARD + return SAMPLE_TEXTURE2D(%GRABTEXTURE%, sampler_%GRABTEXTURE%, uv).rgb; + #else + return SHADERGRAPH_SAMPLE_SCENE_COLOR(uv); + #endif + } + #endif + + + + #if _STANDARD + UNITY_DECLARE_DEPTH_TEXTURE(_CameraDepthTexture); + float GetSceneDepth(float2 uv) { return SAMPLE_DEPTH_TEXTURE(_CameraDepthTexture, uv); } + float GetLinear01Depth(float2 uv) { return Linear01Depth(GetSceneDepth(uv)); } + float GetLinearEyeDepth(float2 uv) { return LinearEyeDepth(GetSceneDepth(uv)); } + #else + float GetSceneDepth(float2 uv) { return SHADERGRAPH_SAMPLE_SCENE_DEPTH(uv); } + float GetLinear01Depth(float2 uv) { return Linear01Depth(GetSceneDepth(uv), _ZBufferParams); } + float GetLinearEyeDepth(float2 uv) { return LinearEyeDepth(GetSceneDepth(uv), _ZBufferParams); } + #endif + + float3 GetWorldPositionFromDepthBuffer(float2 uv, float3 worldSpaceViewDir) + { + float eye = GetLinearEyeDepth(uv); + float3 camView = mul((float3x3)GetObjectToWorldMatrix(), transpose(mul(GetWorldToObjectMatrix(), UNITY_MATRIX_I_V)) [2].xyz); + + float dt = dot(worldSpaceViewDir, camView); + float3 div = worldSpaceViewDir/dt; + float3 wpos = (eye * div) + GetCameraWorldPosition(); + return wpos; + } + + #if _HDRP + float3 ObjectToWorldSpacePosition(float3 pos) + { + return GetAbsolutePositionWS(TransformObjectToWorld(pos)); + } + #else + float3 ObjectToWorldSpacePosition(float3 pos) + { + return TransformObjectToWorld(pos); + } + #endif + + #if _STANDARD + UNITY_DECLARE_SCREENSPACE_TEXTURE(_CameraDepthNormalsTexture); + float3 GetSceneNormal(float2 uv, float3 worldSpaceViewDir) + { + float4 depthNorms = UNITY_SAMPLE_SCREENSPACE_TEXTURE(_CameraDepthNormalsTexture, uv); + float3 norms = DecodeViewNormalStereo(depthNorms); + norms = mul((float3x3)GetWorldToViewMatrix(), norms) * 0.5 + 0.5; + return norms; + } + #elif _HDRP && !_DECALSHADER + + float3 GetSceneNormal(float2 uv, float3 worldSpaceViewDir) + { + NormalData nd; + DecodeFromNormalBuffer(_ScreenSize.xy * uv, nd); + return nd.normalWS; + } + #elif _URP + #if (SHADER_LIBRARY_VERSION_MAJOR >= 10) + #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/DeclareNormalsTexture.hlsl" + #endif + + float3 GetSceneNormal(float2 uv, float3 worldSpaceViewDir) + { + #if (SHADER_LIBRARY_VERSION_MAJOR >= 10) + return SampleSceneNormals(uv); + #else + float3 wpos = GetWorldPositionFromDepthBuffer(uv, worldSpaceViewDir); + return normalize(-cross(ddx(wpos), ddy(wpos))) * 0.5 + 0.5; + #endif + + } + #endif + + #if _HDRP + + half3 UnpackNormalmapRGorAG(half4 packednormal) + { + // This do the trick + packednormal.x *= packednormal.w; + + half3 normal; + normal.xy = packednormal.xy * 2 - 1; + normal.z = sqrt(1 - saturate(dot(normal.xy, normal.xy))); + return normal; + } + half3 UnpackNormal(half4 packednormal) + { + #if defined(UNITY_NO_DXT5nm) + return packednormal.xyz * 2 - 1; + #else + return UnpackNormalmapRGorAG(packednormal); + #endif + } + #endif + #if _HDRP || _URP + + half3 UnpackScaleNormal(half4 packednormal, half scale) + { + #ifndef UNITY_NO_DXT5nm + // Unpack normal as DXT5nm (1, y, 1, x) or BC5 (x, y, 0, 1) + // Note neutral texture like "bump" is (0, 0, 1, 1) to work with both plain RGB normal and DXT5nm/BC5 + packednormal.x *= packednormal.w; + #endif + half3 normal; + normal.xy = (packednormal.xy * 2 - 1) * scale; + normal.z = sqrt(1 - saturate(dot(normal.xy, normal.xy))); + return normal; + } + + #endif + + + void GetSun(out float3 lightDir, out float3 color) + { + lightDir = float3(0.5, 0.5, 0); + color = 1; + #if _HDRP + if (_DirectionalLightCount > 0) + { + DirectionalLightData light = _DirectionalLightDatas[0]; + lightDir = -light.forward.xyz; + color = light.color; + } + #elif _STANDARD + lightDir = normalize(_WorldSpaceLightPos0.xyz); + color = _LightColor0.rgb; + #elif _URP + Light light = GetMainLight(); + lightDir = light.direction; + color = light.color; + #endif + } + + + + CBUFFER_START(UnityPerMaterial) + + + half4 _Color; + half4 _MainTex_ST, _MainTex_TexelSize; + half _Alpha, _AlphaCutoffValue; + + #if ATLAS_ON + half _MinXUV, _MaxXUV, _MinYUV, _MaxYUV; + #endif + + #if GLOW_ON + half4 _GlowColor; + half _Glow, _GlowGlobal; + #endif + + #if HSV_ON + half _HsvShift, _HsvSaturation, _HsvBright; + #endif + + #if DISTORT_ON + half4 _DistortTex_ST; + half _DistortTexXSpeed, _DistortTexYSpeed, _DistortAmount; + #endif + + #if FADE_ON + half4 _FadeBurnColor, _FadeTex_ST, _FadeBurnTex_ST; + half _FadeAmount, _FadeBurnWidth, _FadeBurnTransition,_FadeBurnGlow; + #endif + + #if OUTBASE_ON + half4 _OutlineColor; + half _OutlineAlpha, _OutlineGlow, _OutlineWidth; + int _OutlinePixelWidth; + #endif + + #if OUTTEX_ON + half4 _OutlineTex_ST; + half _OutlineTexXSpeed, _OutlineTexYSpeed; + #endif + + #if OUTDIST_ON + half4 _OutlineDistortTex_ST; + half _OutlineDistortTexXSpeed, _OutlineDistortTexYSpeed, _OutlineDistortAmount; + #endif + + #if ALPHAOUTLINE_ON + half _AlphaOutlineGlow, _AlphaOutlinePower, _AlphaOutlineMinAlpha, _AlphaOutlineBlend; + half4 _AlphaOutlineColor; + #endif + + #if INNEROUTLINE_ON + half _InnerOutlineThickness, _InnerOutlineAlpha, _InnerOutlineGlow; + half4 _InnerOutlineColor; + #endif + + #if GRADIENT_ON + half _GradBlend, _GradBoostX, _GradBoostY; + half4 _GradTopRightCol, _GradTopLeftCol, _GradBotRightCol, _GradBotLeftCol; + #endif + + #if COLORSWAP_ON + half4 _ColorSwapRed, _ColorSwapGreen, _ColorSwapBlue; + half _ColorSwapRedLuminosity, _ColorSwapGreenLuminosity, _ColorSwapBlueLuminosity, _ColorSwapBlend; + #endif + + #if CHANGECOLOR_ON + half4 _ColorChangeNewCol, _ColorChangeTarget; + half _ColorChangeTolerance, _ColorChangeLuminosity; + #endif + #if CHANGECOLOR2_ON + half4 _ColorChangeNewCol2, _ColorChangeTarget2; + half _ColorChangeTolerance2; + #endif + #if CHANGECOLOR3_ON + half4 _ColorChangeNewCol3, _ColorChangeTarget3; + half _ColorChangeTolerance3; + #endif + + #if COLORRAMP_ON + half _ColorRampLuminosity, _ColorRampBlend; + #endif + + #if HITEFFECT_ON + half4 _HitEffectColor; + half _HitEffectGlow, _HitEffectBlend; + #endif + + #if NEGATIVE_ON + half _NegativeAmount; + #endif + + #if PIXELATE_ON + half _PixelateSize; + #endif + + #if GREYSCALE_ON + half _GreyscaleLuminosity, _GreyscaleBlend; + half4 _GreyscaleTintColor; + #endif + + #if POSTERIZE_ON + half _PosterizeNumColors, _PosterizeGamma; + #endif + + #if BLUR_ON + half _BlurIntensity; + #endif + + #if MOTIONBLUR_ON + half _MotionBlurAngle, _MotionBlurDist; + #endif + + #if GHOST_ON + half _GhostColorBoost, _GhostTransparency, _GhostBlend; + #endif + + #if HOLOGRAM_ON + half _HologramStripesAmount, _HologramMinAlpha, _HologramUnmodAmount, _HologramStripesSpeed, _HologramMaxAlpha, _HologramBlend; + half4 _HologramStripeColor; + #endif + + #if CHROMABERR_ON + half _ChromAberrAmount, _ChromAberrAlpha; + #endif + + #if GLITCH_ON + half _GlitchAmount, _GlitchSize; + #endif + + #if FLICKER_ON + half _FlickerFreq, _FlickerPercent, _FlickerAlpha; + #endif + + #if SHADOW_ON + half _ShadowX, _ShadowY, _ShadowAlpha; + half4 _ShadowColor; + #endif + + #if SHINE_ON + half4 _ShineColor; + half _ShineLocation, _ShineRotate, _ShineWidth, _ShineGlow; + #endif + + #if CONTRAST_ON + half _Contrast, _Brightness; + #endif + + #if OVERLAY_ON + half4 _OverlayTex_ST, _OverlayColor; + half _OverlayGlow, _OverlayBlend, _OverlayTextureScrollXSpeed, _OverlayTextureScrollYSpeed; + #endif + + #if DOODLE_ON + half _HandDrawnAmount, _HandDrawnSpeed; + #endif + + #if WIND_ON + half _GrassSpeed, _GrassWind, _GrassManualAnim, _GrassRadialBend; + #endif + + #if WAVEUV_ON + float _WaveAmount, _WaveSpeed, _WaveStrength, _WaveX, _WaveY; + #endif + + #if ROUNDWAVEUV_ON + half _RoundWaveStrength, _RoundWaveSpeed; + #endif + + #if RECTSIZE_ON + half _RectSize; + #endif + + #if OFFSETUV_ON + half _OffsetUvX, _OffsetUvY; + #endif + + #if CLIPPING_ON + half _ClipUvLeft, _ClipUvRight, _ClipUvUp, _ClipUvDown; + #endif + + #if RADIALCLIPPING_ON + half _RadialStartAngle, _RadialClip, _RadialClip2; + #endif + + #if TEXTURESCROLL_ON + half _TextureScrollXSpeed, _TextureScrollYSpeed; + #endif + + #if ZOOMUV_ON + half _ZoomUvAmount; + #endif + + #if WARP_ON + half _WarpStrength, _WarpSpeed, _WarpScale; + #endif + + #if TWISTUV_ON + half _TwistUvAmount, _TwistUvPosX, _TwistUvPosY, _TwistUvRadius; + #endif + + #if ROTATEUV_ON + half _RotateUvAmount; + #endif + + #if FISHEYE_ON + half _FishEyeUvAmount; + #endif + + #if PINCH_ON + half _PinchUvAmount; + #endif + + #if SHAKEUV_ON + half _ShakeUvSpeed, _ShakeUvX, _ShakeUvY; + #endif + + #if NORMALMAP_ON + half _NormalStrength; + #endif + + float _RandomSeed; + + + + + CBUFFER_END + + + + + + + + TEXTURE2D(_MainTex); + SAMPLER(sampler_MainTex); + + #if GLOW_ON + TEXTURE2D(_GlowTex); + SAMPLER(sampler_GlowTex); + #endif + + #if FADE_ON + TEXTURE2D(_FadeTex); + SAMPLER(sampler_FadeTex); + + TEXTURE2D(_FadeBurnTex); + SAMPLER(sampler_FadeBurnTex); + #endif + + #if DISTORT_ON + TEXTURE2D(_DistortTex); + SAMPLER(sampler_DistortTex); + #endif + + #if OUTTEX_ON + TEXTURE2D(_OutlineTex); + SAMPLER(sampler_OutlineTex); + #endif + + #if OUTDIST_ON + TEXTURE2D(_OutlineDistortTex); + SAMPLER(sampler_OutlineDistortTex); + #endif + + #if COLORSWAP_ON + TEXTURE2D(_ColorSwapTex); + SAMPLER(sampler_ColorSwapTex); + #endif + + #if COLORRAMP_ON + TEXTURE2D(_ColorRampTex); + TEXTURE2D(_ColorRampTexGradient); + SAMPLER(sampler_ColorRampTex); + SAMPLER(sampler_ColorRampTexGradient); + #endif + + #if SHINE_ON + TEXTURE2D(_ShineMask); + SAMPLER(sampler_ShineMask); + #endif + + #if OVERLAY_ON + TEXTURE2D(_OverlayTex); + SAMPLER(sampler_OverlayTex); + #endif + + #if NORMALMAP_ON + TEXTURE2D(_NormalMap); + SAMPLER(sampler_NormalMap); + #endif + + + half3 GetPixel(in int offsetX, in int offsetY, in half2 uv, in Texture2D _tex, in SamplerState _sampler) + { + half2 _uv = uv + half2(offsetX * _MainTex_TexelSize.x, offsetY * _MainTex_TexelSize.y); + half4 col = SAMPLE_TEXTURE2D(_tex, _sampler, _uv); + return col.rgb; + } + + + //BLURS------------------------------------------------------------------------- + half4 Blur(half2 uv, Texture2D source, SamplerState sampler_source, half Intensity) + { + const half2 texelSize = 1.0 / _ScreenParams.xy; + const half4 color = SAMPLE_TEXTURE2D(source, sampler_source, uv); + const half2 offset = Intensity * texelSize; + + half4 accumulatedColor = color; + half accumulatedWeight = 1.0; + for (int x = -1; x <= 1; x++) + { + for (int y = -1; y <= 1; y++) + { + const half2 sampleUV = uv + half2(x, y) * offset; + const half4 sampleColor = SAMPLE_TEXTURE2D(source, sampler_source, sampleUV); + + accumulatedColor += sampleColor; + accumulatedWeight += 1.0; + } + } + + half4 blurredColor = accumulatedColor / accumulatedWeight; + return blurredColor; + } + + half BlurHD_G(half bhqp, half x) + { + return exp(-(x * x) / (2.0 * bhqp * bhqp)); + } + half4 BlurHD(half2 uv, Texture2D source, SamplerState sampler_source, half BlurAmount, half xScale, half yScale) + { + int iterations = 16; + int halfIterations = iterations / 2; + half sigmaX = 0.1 + BlurAmount * 0.5; + half sigmaY = sigmaX; + half total = 0.0; + half4 ret = half4(0, 0, 0, 0); + for (int iy = 0; iy < iterations; ++iy) + { + half fy = BlurHD_G(sigmaY, half(iy) -half(halfIterations)); + half offsetY = half(iy - halfIterations) * 0.00390625 * xScale; + for (int ix = 0; ix < iterations; ++ix) + { + half fx = BlurHD_G(sigmaX, half(ix) - half(halfIterations)); + half offsetX = half(ix - halfIterations) * 0.00390625 * yScale; + total += fx * fy; + ret += SAMPLE_TEXTURE2D(source, sampler_source, uv + half2(offsetX, offsetY)) * fx * fy; + } + } + return ret / total; + } + //----------------------------------------------------------------------- + + + //------------------------------------------- + half RemapFloat(half inValue, half inMin, half inMax, half outMin, half outMax){ + return outMin + (inValue - inMin) * (outMax - outMin) / (inMax - inMin); + } + //------------------------------------------- + + //----------------------------------------------------------------------- + half rand(half2 seed, half offset) { + return (frac(sin(dot(seed, half2(12.9898, 78.233))) * 43758.5453) + offset) % 1.0; + } + + half rand2(half2 seed, half offset) { + return (frac(sin(dot(seed * floor(50 + (_Time.x % 1.0) * 12.), half2(127.1, 311.7))) * 43758.5453123) + offset) % 1.0; + } + + half rand2CustomTime(half2 seed, half offset, half customTime) { + return (frac(sin(dot(seed * floor(50 + (customTime % 1.0) * 12.), half2(127.1, 311.7))) * 43758.5453123) + offset) % 1.0; + } + //----------------------------------------------------------------------- + + + void Ext_ModifyVertex0 (inout VertexData v, inout ExtraV2F d) + { + //BILBOARD_ON + #if BILBOARD_ON + half3 camRight = mul((half3x3)unity_CameraToWorld, half3(1,0,0)); + half3 camUp = half3(0,1,0); + #if BILBOARDY_ON + camUp = mul((half3x3)unity_CameraToWorld, half3(0,1,0)); + #endif + half3 localPos = v.vertex.x * camRight + v.vertex.y * camUp; + v.vertex = half4(localPos, 1); + #endif + //----------------------------------------------------------- + + v.texcoord0.xy = TRANSFORM_TEX(v.texcoord0.xy, _MainTex); + half2 center = half2(0.5, 0.5); + #if ATLAS_ON + center = half2((_MaxXUV + _MinXUV) / 2.0, (_MaxYUV + _MinYUV) / 2.0); + #endif + + //POLARUV_ON + #if POLARUV_ON + v.texcoord0.xy = v.texcoord0.xy - center; + #endif + + //---------------------------------------- + + //ROTATEUV_ON + #if ROTATEUV_ON + half2 uvC = v.texcoord0.xy; + half cosAngle = cos(_RotateUvAmount); + half sinAngle = sin(_RotateUvAmount); + half2x2 rot = half2x2(cosAngle, -sinAngle, sinAngle, cosAngle); + uvC -= center; + v.texcoord0.xy = mul(rot, uvC); + v.texcoord0.xy += center; + #endif + //-------------------- + + #if RECTSIZE_ON + v.vertex.xyz += (v.vertex.xyz * (_RectSize - 1.0)); + #endif + + #if OUTTEX_ON + v.texcoord1.xy = TRANSFORM_TEX(v.texcoord0.xy, _OutlineTex); + #endif + + #if OUTDIST_ON + v.texcoord2.xy = TRANSFORM_TEX(v.texcoord0.xy, _OutlineDistortTex); + #endif + + #if DISTORT_ON + v.texcoord3.xy = TRANSFORM_TEX(v.texcoord0.xy, _DistortTex); + #endif + } + + void Ext_SurfaceFunction0 (inout Surface o, ShaderData d) + { + half randomSeed = _RandomSeed; + + float2 uvRect = d.texcoord0; + half2 center = half2(0.5, 0.5); + #if ATLAS_ON + center = half2((_MaxXUV + _MinXUV) / 2.0, (_MaxYUV + _MinYUV) / 2.0); + uvRect = half2((d.texcoord0.x - _MinXUV) / (_MaxXUV - _MinXUV), (d.texcoord0.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half2 centerTiled = half2(center.x * _MainTex_ST.x, center.y * _MainTex_ST.y); + + //CLIPPING_ON + #if CLIPPING_ON + half2 tiledUv = half2(d.texcoord0.x / _MainTex_ST.x, d.texcoord0.y / _MainTex_ST.y); + #if ATLAS_ON + tiledUv = half2((tiledUv.x - _MinXUV) / (_MaxXUV - _MinXUV), (tiledUv.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + clip((1 - _ClipUvUp) - tiledUv.y); + clip(tiledUv.y - _ClipUvDown); + clip((1 - _ClipUvRight) - tiledUv.x); + clip(tiledUv.x - _ClipUvLeft); + #endif + //---------------------------------- + + //RADIALCLIPPING_ON + #if RADIALCLIPPING_ON + half2 tiledUv2 = half2(d.texcoord0.x / _MainTex_ST.x, d.texcoord0.y / _MainTex_ST.y); + #if ATLAS_ON + tiledUv2 = half2((tiledUv2.x - _MinXUV) / (_MaxXUV - _MinXUV), (tiledUv2.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half startAngle = _RadialStartAngle - _RadialClip; + half endAngle = _RadialStartAngle + _RadialClip2; + half offset0 = clamp(0, 360, startAngle + 360); + half offset360 = clamp(0, 360, endAngle - 360); + half2 atan2Coord = half2(lerp(-1, 1, tiledUv2.x), lerp(-1, 1, tiledUv2.y)); + half atanAngle = atan2(atan2Coord.y, atan2Coord.x) * 57.3; // angle in degrees + if(atanAngle < 0) atanAngle = 360 + atanAngle; + if(atanAngle >= startAngle && atanAngle <= endAngle) discard; + if(atanAngle <= offset360) discard; + if(atanAngle >= offset0) discard; + #endif + + //----------------------------- + + //TEXTURESCROLL_ON && ATLAS_ON + #if TEXTURESCROLL_ON && ATLAS_ON + d.texcoord0.xy = half2(_MinXUV + ((_MaxXUV - _MinXUV) * (abs(((_Time.y + randomSeed) * _TextureScrollXSpeed) + uvRect.x) % 1)), + _MinYUV + ((_MaxYUV - _MinYUV) * (abs(((_Time.y + randomSeed) * _TextureScrollYSpeed) + uvRect.y) % 1))); + #endif + //---------------------------- + + //OFFSETUV_ON + #if OFFSETUV_ON + #if ATLAS_ON + d.texcoord0.xy = half2(_MinXUV + ((_MaxXUV - _MinXUV) * (abs((_OffsetUvX + uvRect.x) % 1))), + _MinYUV + ((_MaxYUV - _MinYUV) * (abs(_OffsetUvY + uvRect.y) % 1))); + #else + d.texcoord0.xy += half2(_OffsetUvX, _OffsetUvY); + #endif + #endif + + //---------------------- + + //POLARUV_ON + #if POLARUV_ON + d.texcoord0.xy = half2(atan2(d.texcoord0.y, d.texcoord0.x) / (2.0f * 3.141592653589f), length(d.texcoord0.xy)); + d.texcoord0.xy *= _MainTex_ST.xy; + #endif + + //-------------------------------------- + + //TWISTUV_ON + #if TWISTUV_ON + #if ATLAS_ON + _TwistUvPosX = ((_MaxXUV - _MinXUV) * _TwistUvPosX) + _MinXUV; + _TwistUvPosY = ((_MaxYUV - _MinYUV) * _TwistUvPosY) + _MinYUV; + #endif + half2 tempUv = d.texcoord0.xy - half2(_TwistUvPosX * _MainTex_ST.x, _TwistUvPosY * _MainTex_ST.y); + _TwistUvRadius *= (_MainTex_ST.x + _MainTex_ST.y) / 2; + half percent = (_TwistUvRadius - length(tempUv)) / _TwistUvRadius; + half theta = percent * percent * (2.0 * sin(_TwistUvAmount)) * 8.0; + half s = sin(theta); + half c = cos(theta); + half beta = max(sign(_TwistUvRadius - length(tempUv)), 0.0); + tempUv = half2(dot(tempUv, half2(c, -s)), dot(tempUv, half2(s, c))) * beta + tempUv * (1 - beta); + tempUv += half2(_TwistUvPosX * _MainTex_ST.x, _TwistUvPosY * _MainTex_ST.y); + d.texcoord0.xy = tempUv; + #endif + + //-------------------------------------------- + + //FISHEYE_ON + #if FISHEYE_ON + half bind = length(centerTiled); + half2 dF = d.texcoord0.xy - centerTiled; + half dFlen = length(dF); + half fishInt = (3.14159265359 / bind) * (_FishEyeUvAmount + 0.001); + d.texcoord0.xy = centerTiled + (dF / (max(0.0001, dFlen))) * tan(dFlen * fishInt) * bind / tan(bind * fishInt); + #endif + //--------------------------------------------- + + //PINCH_ON + #if PINCH_ON + half2 dP = d.texcoord0.xy - centerTiled; + half pinchInt = (3.141592 / length(centerTiled)) * (-_PinchUvAmount + 0.001); + d.texcoord0.xy = centerTiled + normalize(dP) * atan(length(dP) * -pinchInt * 10.0) * 0.5 / atan(-pinchInt * 5); + #endif + + //--------------------------------------------- + + //ZOOMUV_ON + #if ZOOMUV_ON + d.texcoord0.xy -= centerTiled; + d.texcoord0.xy = d.texcoord0.xy * _ZoomUvAmount; + d.texcoord0.xy += centerTiled; + #endif + + //----------------------------------------------- + + //DOODLE_ON + #if DOODLE_ON + half2 uvCopy = uvRect; + _HandDrawnSpeed = (floor((_Time.x + randomSeed) * 20 * _HandDrawnSpeed) / _HandDrawnSpeed) * _HandDrawnSpeed; + uvCopy.x = sin((uvCopy.x * _HandDrawnAmount + _HandDrawnSpeed) * 4); + uvCopy.y = cos((uvCopy.y * _HandDrawnAmount + _HandDrawnSpeed) * 4); + d.texcoord0.xy = lerp(d.texcoord0.xy, d.texcoord0.xy + uvCopy, 0.0005 * _HandDrawnAmount); + #endif + + //-------------------------- + + //SHAKEUV_ON + #if SHAKEUV_ON + half xShake = sin((_Time.x + randomSeed) * _ShakeUvSpeed * 50) * _ShakeUvX; + half yShake = cos((_Time.x + randomSeed) * _ShakeUvSpeed * 50) * _ShakeUvY; + d.texcoord0.xy += half2(xShake * 0.012, yShake * 0.01); + #endif + + //------------------------------------------- + + //RECTSIZE_ON + #if RECTSIZE_ON + d.texcoord0.xy = d.texcoord0.xy * (_RectSize).xx + (((-_RectSize * 0.5) + 0.5)).xx; + #endif + + //------------------------------------------- + + //DISTORT_ON + #if DISTORT_ON + #if ATLAS_ON + d.texcoord3.x = d.texcoord3.x * (1 / (_MaxXUV - _MinXUV)); + d.texcoord3.y = d.texcoord3.y * (1 / (_MaxYUV - _MinYUV)); + #endif + + d.texcoord3.x += ((_Time.x + _RandomSeed) * _DistortTexXSpeed) % 1; + d.texcoord3.y += ((_Time.x + _RandomSeed) * _DistortTexYSpeed) % 1; + half distortAmnt = (SAMPLE_TEXTURE2D(_DistortTex, sampler_DistortTex, d.texcoord3.xy).r - 0.5) * 0.2 * _DistortAmount; + d.texcoord0.x += distortAmnt; + d.texcoord0.y += distortAmnt; + #endif + //------------------------------------------------------- + + //WARP_ON + #if WARP_ON + half2 warpUv = half2(d.texcoord0.x / _MainTex_ST.x, d.texcoord0.y / _MainTex_ST.y); + #if ATLAS_ON + warpUv = half2((warpUv.x - _MinXUV) / (_MaxXUV - _MinXUV), (warpUv.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + const float tau = 6.283185307179586; + float xWarp = (_Time.y + randomSeed) * _WarpSpeed + warpUv.x * tau / _WarpScale; + float yWarp = (_Time.y + randomSeed) * _WarpSpeed + warpUv.y * tau / _WarpScale; + float2 warp = float2(sin(xWarp), sin(yWarp)) * _WarpStrength; + d.texcoord0.xy += warp; + #endif + + //------------------------------------------------------- + + //WAVEUV_ON + #if WAVEUV_ON + float2 uvWave = half2(_WaveX * _MainTex_ST.x, _WaveY * _MainTex_ST.y) - d.texcoord0.xy; + uvWave %= 1; + #if ATLAS_ON + uvWave = half2(_WaveX, _WaveY) - uvRect; + #endif + uvWave.x *= _ScreenParams.x / _ScreenParams.y; + float waveTime = _Time.y + randomSeed; + float angWave = (sqrt(dot(uvWave, uvWave)) * _WaveAmount) - ((waveTime * _WaveSpeed)); + d.texcoord0.xy = d.texcoord0.xy + uvWave * sin(angWave) * (_WaveStrength / 1000.0); + #endif + //---------------------------------------------------- + + //ROUNDWAVEUV_ON + #if ROUNDWAVEUV_ON + half xWave = ((0.5 * _MainTex_ST.x) - uvRect.x); + half yWave = ((0.5 * _MainTex_ST.y) - uvRect.y) * (_MainTex_TexelSize.w / _MainTex_TexelSize.z); + half ripple = -sqrt(xWave*xWave + yWave* yWave); + d.texcoord0.xy += (sin((ripple + (_Time.y + randomSeed) * (_RoundWaveSpeed/10.0)) / 0.015) * (_RoundWaveStrength/10.0)) % 1; + #endif + //---------------------------------------------------- + + + //WIND_ON + #if WIND_ON + half windOffset = sin((_Time.x + randomSeed) * _GrassSpeed * 10); + half2 windCenter = half2(0.5, 0.1); + #if ATLAS_ON + windCenter.x = ((_MaxXUV - _MinXUV) * windCenter.x) + _MinXUV; + windCenter.y = ((_MaxYUV - _MinYUV) * windCenter.y) + _MinYUV; + #endif + #if !MANUALWIND_ON + d.texcoord0.x = fmod(abs(lerp(d.texcoord0.x, d.texcoord0.x + (_GrassWind * 0.01 * windOffset), uvRect.y)), 1); + #else + d.texcoord0.x = fmod(abs(lerp(d.texcoord0.x, d.texcoord0.x + (_GrassWind * 0.01 * _GrassManualAnim), uvRect.y)), 1); + windOffset = _GrassManualAnim; + #endif + half2 delta = d.texcoord0.xy - windCenter; + half delta2 = dot(delta.xy, delta.xy); + half2 delta_offset = delta2 * windOffset; + d.texcoord0.xy = d.texcoord0.xy + half2(delta.y, -delta.x) * delta_offset * _GrassRadialBend; + #endif + + //-------------------------------------------------------- + + //TEXTURESCROLL_ON && !ATLAS_ON + #if TEXTURESCROLL_ON && !ATLAS_ON + d.texcoord0.x += ((_Time.y + randomSeed) * _TextureScrollXSpeed) % 1; + d.texcoord0.y += ((_Time.y + randomSeed) * _TextureScrollYSpeed) % 1; + #endif + //------------------------------ + + //PIXELATE_ON + #if PIXELATE_ON + half aspectRatio = _MainTex_TexelSize.x / _MainTex_TexelSize.y; + half2 pixelSize = float2(_PixelateSize, _PixelateSize * aspectRatio); + d.texcoord0.xy = floor(d.texcoord0.xy * pixelSize) / pixelSize; + #endif + //-------------- + + half4 col = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy); + half originalAlpha = col.a; + col *= d.vertexColor; + + //NORMAL MAP + #if NORMALMAP_ON + half4 normalSample = SAMPLE_TEXTURE2D(_NormalMap, sampler_NormalMap, d.texcoord0.xy); + half3 normalTS = UnpackNormal(normalSample); + normalTS.xy *= _NormalStrength; + o.Normal = normalTS; + #endif + + + //GLITCH_ON + #if GLITCH_ON + half2 uvGlitch = uvRect; + uvGlitch.y -= 0.5; + half lineNoise = pow(rand2(floor(uvGlitch * half2(24., 19.) * _GlitchSize) * 4.0, randomSeed), 3.0) * _GlitchAmount + * pow(rand2(floor(uvGlitch * half2(38., 14.) * _GlitchSize) * 4.0, randomSeed), 3.0); + col = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(lineNoise * 0.02 * rand2(half2(2.0, 1), randomSeed), 0)) * d.vertexColor; + #endif + //-------------------------------------- + + //CHROMABERR_ON + #if CHROMABERR_ON + half4 r = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(_ChromAberrAmount/10, 0)) * d.vertexColor; + half4 b = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(-_ChromAberrAmount/10, 0)) * d.vertexColor; + col = half4(r.r * r.a, col.g, b.b * b.a, max(max(r.a, b.a) * _ChromAberrAlpha, col.a)); + #endif + + //-------------------------------- + + //BLUR_ON + #if BLUR_ON + #if ATLAS_ON + #if !BLURISHD_ON + col = BlurHD(d.texcoord0.xy, _MainTex, sampler_MainTex, _BlurIntensity, (_MaxXUV - _MinXUV), (_MaxYUV - _MinYUV)) * d.vertexColor; + #else + col = Blur(d.texcoord0.xy, _MainTex, sampler_MainTex, _BlurIntensity * (_MaxXUV - _MinXUV)) * d.vertexColor; + #endif + #else + #if !BLURISHD_ON + col = BlurHD(d.texcoord0.xy, _MainTex, sampler_MainTex, _BlurIntensity, 1, 1) * d.vertexColor; + #else + col = Blur(d.texcoord0.xy, _MainTex, sampler_MainTex, _BlurIntensity) * d.vertexColor; + #endif + #endif + #endif + + //-------------------- + + //MOTIONBLUR_ON + #if MOTIONBLUR_ON + _MotionBlurAngle = _MotionBlurAngle * 3.1415926; + #define rot(n) mul(n, half2x2(cos(_MotionBlurAngle), -sin(_MotionBlurAngle), sin(_MotionBlurAngle), cos(_MotionBlurAngle))) + _MotionBlurDist = _MotionBlurDist * 0.005; + #if ATLAS_ON + _MotionBlurDist *= (_MaxXUV - _MinXUV); + #endif + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(-_MotionBlurDist, -_MotionBlurDist))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(-_MotionBlurDist * 2, -_MotionBlurDist * 2))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(-_MotionBlurDist * 3, -_MotionBlurDist * 3))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(-_MotionBlurDist * 4, -_MotionBlurDist * 4))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(_MotionBlurDist, _MotionBlurDist))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(_MotionBlurDist * 2, _MotionBlurDist * 2))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(_MotionBlurDist * 3, _MotionBlurDist * 3))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(_MotionBlurDist * 4, _MotionBlurDist * 4))); + col.rgb = col.rgb / 9; + #endif + //------------------------------------ + + //NEGATIVE_ON + #if NEGATIVE_ON + col.rgb = lerp(col.rgb, 1 - col.rgb, _NegativeAmount); + #endif + + //-------------- + half luminance = 0; + + //GREYSCALE_ON && !GREYSCALEOUTLINE_ON + #if GREYSCALE_ON && !GREYSCALEOUTLINE_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + luminance = saturate(luminance + _GreyscaleLuminosity); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _GreyscaleTintColor, _GreyscaleBlend); + #endif + //------------------------------------ + + //GHOST_ON + #if GHOST_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + half4 ghostResult; + ghostResult.a = saturate(luminance - _GhostTransparency) * col.a; + ghostResult.rgb = col.rgb * (luminance + _GhostColorBoost); + col = lerp(col, ghostResult, _GhostBlend); + #endif + //------------------------------------ + + //INNEROUTLINE_ON + #if INNEROUTLINE_ON + half3 innerT = abs(GetPixel(0, _InnerOutlineThickness, d.texcoord0.xy, _MainTex, sampler_MainTex) - GetPixel(0, -_InnerOutlineThickness, d.texcoord0.xy, _MainTex, sampler_MainTex)); + innerT += abs(GetPixel(_InnerOutlineThickness, 0, d.texcoord0.xy, _MainTex, sampler_MainTex) - GetPixel(-_InnerOutlineThickness, 0, d.texcoord0.xy, _MainTex, sampler_MainTex)); + #if !ONLYINNEROUTLINE_ON + innerT = (innerT / 2.0) * col.a * _InnerOutlineAlpha; + col.rgb += length(innerT) * _InnerOutlineColor.rgb * _InnerOutlineGlow; + #else + innerT *= col.a * _InnerOutlineAlpha; + col.rgb = length(innerT) * _InnerOutlineColor.rgb * _InnerOutlineGlow; + col.a = step(0.3, col.r+col.g+col.b); + #endif + #endif + //------------------------------------------------------- + + //HITEFFECT_ON + #if HITEFFECT_ON + col.rgb = lerp(col.rgb, _HitEffectColor.rgb * _HitEffectGlow, _HitEffectBlend); + #endif + //-------------------- + + //GRADIENT_ON + #if GRADIENT_ON + half2 tiledUvGrad = half2(uvRect.x / _MainTex_ST.x, uvRect.y / _MainTex_ST.y); + #if GRADIENT2COL_ON + _GradTopRightCol = _GradTopLeftCol; + _GradBotRightCol = _GradBotLeftCol; + #endif + #if RADIALGRADIENT_ON + half radialDist = 1 - length(tiledUvGrad - half2(0.5, 0.5)); + radialDist *= (_MainTex_TexelSize.w / _MainTex_TexelSize.z); + radialDist = saturate(_GradBoostX * radialDist); + half4 gradientResult = lerp(_GradTopLeftCol, _GradBotLeftCol, radialDist); + #else + half gradXLerpFactor = saturate(pow(tiledUvGrad.x, _GradBoostX)); + half4 gradientResult = lerp(lerp(_GradBotLeftCol, _GradBotRightCol, gradXLerpFactor), + lerp(_GradTopLeftCol, _GradTopRightCol, gradXLerpFactor), saturate(pow(tiledUvGrad.y, _GradBoostY))); + #endif + gradientResult = lerp(col, gradientResult, _GradBlend); + col.rgb = gradientResult.rgb * col.a; + col.a *= gradientResult.a; + #endif + //-------------------------------------------------------------------- + + //CONTRAST_ON + #if CONTRAST_ON + col.rgb = (col.rgb - float3(0.5, 0.5, 0.5)) * _Contrast + float3(0.5, 0.5, 0.5); + col.rgb += _Brightness; + #endif + + //------------------------------------------------------------------- + + //COLORSWAP_ON + #if COLORSWAP_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + half4 swapMask = SAMPLE_TEXTURE2D(_ColorSwapTex, sampler_ColorSwapTex, d.texcoord0.xy); + swapMask.rgb *= swapMask.a; + half3 redSwap = _ColorSwapRed * swapMask.r * saturate(luminance + _ColorSwapRedLuminosity); + half3 greenSwap = _ColorSwapGreen * swapMask.g * saturate(luminance + _ColorSwapGreenLuminosity); + half3 blueSwap = _ColorSwapBlue * swapMask.b * saturate(luminance + _ColorSwapBlueLuminosity); + swapMask.rgb = col.rgb * saturate(1 - swapMask.r - swapMask.g - swapMask.b); + col.rgb = lerp(col.rgb, swapMask.rgb + redSwap + greenSwap + blueSwap, _ColorSwapBlend); + #endif + //-------------------------------------------------------------------- + + //COLORRAMP_ON && !COLORRAMPOUTLINE_ON + #if COLORRAMP_ON && !COLORRAMPOUTLINE_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + luminance = saturate(luminance + _ColorRampLuminosity); + #if GRADIENTCOLORRAMP_ON + col.rgb = lerp(col.rgb, SAMPLE_TEXTURE2D(_ColorRampTexGradient, sampler_ColorRampTexGradient, half2(luminance, 0)).rgb, _ColorRampBlend); + #else + col.rgb = lerp(col.rgb, SAMPLE_TEXTURE2D(_ColorRampTex, sampler_ColorRampTex, half2(luminance, 0)).rgb, _ColorRampBlend); + #endif + #endif + //-------------------------------------------------------------------- + + //CHANGECOLOR_ON + #if CHANGECOLOR_ON + float3 currChangeColor = saturate(col.rgb); + luminance = 0.3 * currChangeColor.r + 0.59 * currChangeColor.g + 0.11 * currChangeColor.b; + luminance = saturate(luminance + _ColorChangeLuminosity); + half3 dif = abs(currChangeColor - _ColorChangeTarget.rgb); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _ColorChangeNewCol.rgb, + max(sign(1 - saturate(dif.x + dif.y + dif.z) - _ColorChangeTolerance), 0.0)); + #if CHANGECOLOR2_ON + dif = abs(currChangeColor - _ColorChangeTarget2.rgb); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _ColorChangeNewCol2.rgb, + max(sign(1 - saturate(dif.x + dif.y + dif.z) - _ColorChangeTolerance2), 0.0)); + #endif + #if CHANGECOLOR3_ON + dif = abs(currChangeColor - _ColorChangeTarget3.rgb); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _ColorChangeNewCol3.rgb, + max(sign(1 - saturate(dif.x + dif.y + dif.z) - _ColorChangeTolerance3), 0.0)); + #endif + #endif + //------------------------------------------------------- + + //POSTERIZE_ON && !POSTERIZEOUTLINE_ON + #if POSTERIZE_ON && !POSTERIZEOUTLINE_ON + col.rgb = pow(col.rgb, _PosterizeGamma) * _PosterizeNumColors; + col.rgb = floor(col.rgb) / _PosterizeNumColors; + col.rgb = pow(col.rgb, 1.0 / _PosterizeGamma); + #endif + //------------------------------------ + + //HSV_ON + #if HSV_ON + half3 resultHsv = half3(col.rgb); + half cosHsv = _HsvBright * _HsvSaturation * cos(_HsvShift * 3.14159265 / 180); + half sinHsv = _HsvBright * _HsvSaturation * sin(_HsvShift * 3.14159265 / 180); + resultHsv.x = (.299 * _HsvBright + .701 * cosHsv + .168 * sinHsv) * col.x + + (.587 * _HsvBright - .587 * cosHsv + .330 * sinHsv) * col.y + + (.114 * _HsvBright - .114 * cosHsv - .497 * sinHsv) * col.z; + resultHsv.y = (.299 * _HsvBright - .299 * cosHsv - .328 * sinHsv) *col.x + + (.587 * _HsvBright + .413 * cosHsv + .035 * sinHsv) * col.y + + (.114 * _HsvBright - .114 * cosHsv + .292 * sinHsv) * col.z; + resultHsv.z = (.299 * _HsvBright - .3 * cosHsv + 1.25 * sinHsv) * col.x + + (.587 * _HsvBright - .588 * cosHsv - 1.05 * sinHsv) * col.y + + (.114 * _HsvBright + .886 * cosHsv - .203 * sinHsv) * col.z; + col.rgb = resultHsv; + #endif + //------------------------------------------------------- + + //OVERLAY_ON + #if OVERLAY_ON + half2 overlayUvs = d.texcoord0.xy; + overlayUvs.x += ((_Time.y + randomSeed) * _OverlayTextureScrollXSpeed) % 1; + overlayUvs.y += ((_Time.y + randomSeed) * _OverlayTextureScrollYSpeed) % 1; + half4 overlayCol = SAMPLE_TEXTURE2D(_OverlayTex, sampler_OverlayTex, TRANSFORM_TEX(overlayUvs, _OverlayTex)); + overlayCol.rgb *= _OverlayColor.rgb * _OverlayGlow; + #if !OVERLAYMULT_ON + overlayCol.rgb *= overlayCol.a * _OverlayColor.rgb * _OverlayColor.a * _OverlayBlend; + col.rgb += overlayCol.rgb; + #else + overlayCol.a *= _OverlayColor.a; + col = lerp(col, col * overlayCol, _OverlayBlend); + #endif + #endif + + //--------------------------------- + + //OUTBASE_ON + #if OUTBASE_ON + #if OUTBASEPIXELPERF_ON + half2 destUv = half2(_OutlinePixelWidth * _MainTex_TexelSize.x, _OutlinePixelWidth * _MainTex_TexelSize.y); + #else + half2 destUv = half2(_OutlineWidth * _MainTex_TexelSize.x * 200, _OutlineWidth * _MainTex_TexelSize.y * 200); + #endif + + #if OUTDIST_ON + d.texcoord3.x += ((_Time.x + _RandomSeed) * _OutlineDistortTexXSpeed) % 1; + d.texcoord3.y += ((_Time.x + _RandomSeed) * _OutlineDistortTexYSpeed) % 1; + #if ATLAS_ON + d.texcoord3 = half2((d.texcoord3.x - _MinXUV) / (_MaxXUV - _MinXUV), (d.texcoord3.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half outDistortAmnt = (SAMPLE_TEXTURE2D(_OutlineDistortTex, sampler_OutlineDistortTex, d.texcoord3).r - 0.5) * 0.2 * _OutlineDistortAmount; + destUv.x += outDistortAmnt; + destUv.y += outDistortAmnt; + #endif + + half spriteLeft = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(destUv.x, 0)).a; + half spriteRight = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy - half2(destUv.x, 0)).a; + half spriteBottom = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(0, destUv.y)).a; + half spriteTop = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy - half2(0, destUv.y)).a; + half result = spriteLeft + spriteRight + spriteBottom + spriteTop; + + #if OUTBASE8DIR_ON + half spriteTopLeft = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(destUv.x, destUv.y)).a; + half spriteTopRight = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(-destUv.x, destUv.y)).a; + half spriteBotLeft = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(destUv.x, -destUv.y)).a; + half spriteBotRight = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(-destUv.x, -destUv.y)).a; + result = result + spriteTopLeft + spriteTopRight + spriteBotLeft + spriteBotRight; + #endif + + result = step(0.05, saturate(result)); + + #if OUTTEX_ON + d.texcoord1.x += ((_Time.x + _RandomSeed) * _OutlineTexXSpeed) % 1; + d.texcoord1.y += ((_Time.x + _RandomSeed) * _OutlineTexYSpeed) % 1; + #if ATLAS_ON + d.texcoord1 = half2((d.texcoord1.x - _MinXUV) / (_MaxXUV - _MinXUV), (d.texcoord1.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half4 tempOutColor = SAMPLE_TEXTURE2D(_OutlineTex, sampler_OutlineTex, d.texcoord1); + tempOutColor *= _OutlineColor; + _OutlineColor = tempOutColor; + #endif + + result *= (1 - originalAlpha) * _OutlineAlpha; + + half4 outline = _OutlineColor * d.vertexColor.a; + outline.rgb *= _OutlineGlow; + outline.a = result; + #if ONLYOUTLINE_ON + col = outline; + #else + col = lerp(col, outline, result); + #endif + #endif + //------------------------------------------------------- + + //FADE_ON + #if FADE_ON + half2 tiledUvFade1 = TRANSFORM_TEX(d.texcoord0, _FadeTex); + half2 tiledUvFade2 = TRANSFORM_TEX(d.texcoord0, _FadeBurnTex); + #if ATLAS_ON + tiledUvFade1 = half2((tiledUvFade1.x - _MinXUV) / (_MaxXUV - _MinXUV), (tiledUvFade1.y - _MinYUV) / (_MaxYUV - _MinYUV)); + tiledUvFade2 = half2((tiledUvFade2.x - _MinXUV) / (_MaxXUV - _MinXUV), (tiledUvFade2.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half fadeTemp = SAMPLE_TEXTURE2D(_FadeTex, sampler_FadeTex, tiledUvFade1).r; + half fade = smoothstep(_FadeAmount, _FadeAmount + _FadeBurnTransition, fadeTemp); + half fadeBurn = saturate(smoothstep(_FadeAmount - _FadeBurnWidth, _FadeAmount - _FadeBurnWidth + 0.1, fadeTemp) * _FadeAmount); + col.a *= fade; + _FadeBurnColor.rgb *= _FadeBurnGlow; + col += fadeBurn * SAMPLE_TEXTURE2D(_FadeBurnTex, sampler_FadeBurnTex, tiledUvFade2) * _FadeBurnColor * originalAlpha * (1 - col.a); + #endif + //------------------------------------------------------- + + //SHADOW_ON + #if SHADOW_ON + half shadowA = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(_ShadowX, _ShadowY)).a; + half preMultShadowMask = 1 - (saturate(shadowA - col.a) * (1 - col.a)); + col.rgb *= 1 - ((shadowA - col.a) * (1 - col.a)); + col.rgb += (_ShadowColor * shadowA) * (1 - col.a); + col.a = max(shadowA * _ShadowAlpha * d.vertexColor.a, col.a); + #endif + + //------------------------------------------------------- + + //GLOW_ON + #if GLOW_ON + half4 emission; + #if GLOWTEX_ON + emission = SAMPLE_TEXTURE2D(_GlowTex, sampler_GlowTex, d.texcoord0); + #else + emission = col; + #endif + + col.rgb *= _GlowGlobal; + emission.rgb *= emission.a * col.a * _Glow * _GlowColor; + col.rgb += emission.rgb; + #endif + //------------------------------------------------------- + + //COLORRAMP_ON && COLORRAMPOUTLINE_ON + #if COLORRAMP_ON && COLORRAMPOUTLINE_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + luminance = saturate(luminance + _ColorRampLuminosity); + #if GRADIENTCOLORRAMP_ON + col.rgb = lerp(col.rgb, SAMPLE_TEXTURE2D(_ColorRampTexGradient, sampler_ColorRampTexGradient, half2(luminance, 0)).rgb, _ColorRampBlend); + #else + col.rgb = lerp(col.rgb, SAMPLE_TEXTURE2D(_ColorRampTex, sampler_ColorRampTex, half2(luminance, 0)).rgb, _ColorRampBlend); + #endif + #endif + //--------------- + + //GREYSCALE_ON && GREYSCALEOUTLINE_ON + #if GREYSCALE_ON && GREYSCALEOUTLINE_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + luminance = saturate(luminance + _GreyscaleLuminosity); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _GreyscaleTintColor, _GreyscaleBlend); + #endif + + //----------------------------------- + + //POSTERIZE_ON && POSTERIZEOUTLINE_ON + #if POSTERIZE_ON && POSTERIZEOUTLINE_ON + col.rgb = pow(col.rgb, _PosterizeGamma) * _PosterizeNumColors; + col.rgb = floor(col.rgb) / _PosterizeNumColors; + col.rgb = pow(col.rgb, 1.0 / _PosterizeGamma); + #endif + + //----------------------------------- + + //SHINE_ON + #if SHINE_ON + half2 uvShine = uvRect; + half cosAngle = cos(_ShineRotate); + half sinAngle = sin(_ShineRotate); + half2x2 rot = half2x2(cosAngle, -sinAngle, sinAngle, cosAngle); + uvShine -= half2(0.5, 0.5); + uvShine = mul(rot, uvShine); + uvShine += half2(0.5, 0.5); + half shineMask = SAMPLE_TEXTURE2D(_ShineMask, sampler_ShineMask, d.texcoord0.xy).a; + half currentDistanceProjection = (uvShine.x + uvShine.y) / 2; + half whitePower = 1 - (abs(currentDistanceProjection - _ShineLocation) / _ShineWidth); + col.rgb += col.a * whitePower * _ShineGlow * max(sign(currentDistanceProjection - (_ShineLocation - _ShineWidth)), 0.0) + * max(sign((_ShineLocation + _ShineWidth) - currentDistanceProjection), 0.0) * _ShineColor * shineMask; + #endif + + //----------------------------------- + + //HOLOGRAM_ON + #if HOLOGRAM_ON + half totalHologram = _HologramStripesAmount + _HologramUnmodAmount; + half hologramYCoord = ((uvRect.y + (((_Time.x + randomSeed) % 1) * _HologramStripesSpeed)) % totalHologram) / totalHologram; + hologramYCoord = abs(hologramYCoord); + half alpha = RemapFloat(saturate(hologramYCoord - (_HologramUnmodAmount/totalHologram)), 0.0, 1.0, _HologramMinAlpha, saturate(_HologramMaxAlpha)); + half hologramMask = max(sign((_HologramUnmodAmount/totalHologram) - hologramYCoord), 0.0); + half4 hologramResult = col; + hologramResult.a *= lerp(alpha, 1, hologramMask); + hologramResult.rgb *= max(1, _HologramMaxAlpha * max(sign(hologramYCoord - (_HologramUnmodAmount/totalHologram)), 0.0)); + hologramMask = 1 - step(0.01,hologramMask); + hologramResult.rgb += hologramMask * _HologramStripeColor * col.a; + col = lerp(col, hologramResult, _HologramBlend); + #endif + + //----------------------------------- + + //FLICKER_ON + #if FLICKER_ON + col.a *= saturate(col.a * step(frac(0.05 + (_Time.w + randomSeed) * _FlickerFreq), 1 - _FlickerPercent) + _FlickerAlpha); + #endif + //----------------------------------- + + //ALPHACUTOFF_ON + + //ALPHAROUND_ON + + //ALPHAOUTLINE_ON + #if ALPHAOUTLINE_ON + half alphaOutlineRes = pow(1 - col.a, max(_AlphaOutlinePower, 0.0001)) * step(_AlphaOutlineMinAlpha, col.a) * _AlphaOutlineBlend; + col.rgb = lerp(col.rgb, _AlphaOutlineColor.rgb * _AlphaOutlineGlow, alphaOutlineRes); + col.a = lerp(col.a, 1, alphaOutlineRes > 1); + #endif + //------------------------------------------------------- + + //FOG_ON + + //------------------ + + col *= _Color; + o.Albedo = col; + col.a *= _Alpha; + clip(col.a - _AlphaCutoffValue - 0.01); + o.Alpha = _Color.a; + } + + + + + + void ChainSurfaceFunction(inout Surface l, inout ShaderData d) + { + Ext_SurfaceFunction0(l, d); + // Ext_SurfaceFunction1(l, d); + // Ext_SurfaceFunction2(l, d); + // Ext_SurfaceFunction3(l, d); + // Ext_SurfaceFunction4(l, d); + // Ext_SurfaceFunction5(l, d); + // Ext_SurfaceFunction6(l, d); + // Ext_SurfaceFunction7(l, d); + // Ext_SurfaceFunction8(l, d); + // Ext_SurfaceFunction9(l, d); + // Ext_SurfaceFunction10(l, d); + // Ext_SurfaceFunction11(l, d); + // Ext_SurfaceFunction12(l, d); + // Ext_SurfaceFunction13(l, d); + // Ext_SurfaceFunction14(l, d); + // Ext_SurfaceFunction15(l, d); + // Ext_SurfaceFunction16(l, d); + // Ext_SurfaceFunction17(l, d); + // Ext_SurfaceFunction18(l, d); + // Ext_SurfaceFunction19(l, d); + // Ext_SurfaceFunction20(l, d); + // Ext_SurfaceFunction21(l, d); + // Ext_SurfaceFunction22(l, d); + // Ext_SurfaceFunction23(l, d); + // Ext_SurfaceFunction24(l, d); + // Ext_SurfaceFunction25(l, d); + // Ext_SurfaceFunction26(l, d); + // Ext_SurfaceFunction27(l, d); + // Ext_SurfaceFunction28(l, d); + // Ext_SurfaceFunction29(l, d); + } + +#if !_DECALSHADER + + void ChainModifyVertex(inout VertexData v, inout VertexToPixel v2p, float4 time) + { + ExtraV2F d; + + ZERO_INITIALIZE(ExtraV2F, d); + ZERO_INITIALIZE(Blackboard, d.blackboard); + // due to motion vectors in HDRP, we need to use the last + // time in certain spots. So if you are going to use _Time to adjust vertices, + // you need to use this time or motion vectors will break. + d.time = time; + + Ext_ModifyVertex0(v, d); + // Ext_ModifyVertex1(v, d); + // Ext_ModifyVertex2(v, d); + // Ext_ModifyVertex3(v, d); + // Ext_ModifyVertex4(v, d); + // Ext_ModifyVertex5(v, d); + // Ext_ModifyVertex6(v, d); + // Ext_ModifyVertex7(v, d); + // Ext_ModifyVertex8(v, d); + // Ext_ModifyVertex9(v, d); + // Ext_ModifyVertex10(v, d); + // Ext_ModifyVertex11(v, d); + // Ext_ModifyVertex12(v, d); + // Ext_ModifyVertex13(v, d); + // Ext_ModifyVertex14(v, d); + // Ext_ModifyVertex15(v, d); + // Ext_ModifyVertex16(v, d); + // Ext_ModifyVertex17(v, d); + // Ext_ModifyVertex18(v, d); + // Ext_ModifyVertex19(v, d); + // Ext_ModifyVertex20(v, d); + // Ext_ModifyVertex21(v, d); + // Ext_ModifyVertex22(v, d); + // Ext_ModifyVertex23(v, d); + // Ext_ModifyVertex24(v, d); + // Ext_ModifyVertex25(v, d); + // Ext_ModifyVertex26(v, d); + // Ext_ModifyVertex27(v, d); + // Ext_ModifyVertex28(v, d); + // Ext_ModifyVertex29(v, d); + + + // #if %EXTRAV2F0REQUIREKEY% + // v2p.extraV2F0 = d.extraV2F0; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // v2p.extraV2F1 = d.extraV2F1; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // v2p.extraV2F2 = d.extraV2F2; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // v2p.extraV2F3 = d.extraV2F3; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // v2p.extraV2F4 = d.extraV2F4; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // v2p.extraV2F5 = d.extraV2F5; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // v2p.extraV2F6 = d.extraV2F6; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // v2p.extraV2F7 = d.extraV2F7; + // #endif + } + + void ChainModifyTessellatedVertex(inout VertexData v, inout VertexToPixel v2p) + { + ExtraV2F d; + ZERO_INITIALIZE(ExtraV2F, d); + ZERO_INITIALIZE(Blackboard, d.blackboard); + + // #if %EXTRAV2F0REQUIREKEY% + // d.extraV2F0 = v2p.extraV2F0; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // d.extraV2F1 = v2p.extraV2F1; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // d.extraV2F2 = v2p.extraV2F2; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // d.extraV2F3 = v2p.extraV2F3; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // d.extraV2F4 = v2p.extraV2F4; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // d.extraV2F5 = v2p.extraV2F5; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // d.extraV2F6 = v2p.extraV2F6; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // d.extraV2F7 = v2p.extraV2F7; + // #endif + + + // Ext_ModifyTessellatedVertex0(v, d); + // Ext_ModifyTessellatedVertex1(v, d); + // Ext_ModifyTessellatedVertex2(v, d); + // Ext_ModifyTessellatedVertex3(v, d); + // Ext_ModifyTessellatedVertex4(v, d); + // Ext_ModifyTessellatedVertex5(v, d); + // Ext_ModifyTessellatedVertex6(v, d); + // Ext_ModifyTessellatedVertex7(v, d); + // Ext_ModifyTessellatedVertex8(v, d); + // Ext_ModifyTessellatedVertex9(v, d); + // Ext_ModifyTessellatedVertex10(v, d); + // Ext_ModifyTessellatedVertex11(v, d); + // Ext_ModifyTessellatedVertex12(v, d); + // Ext_ModifyTessellatedVertex13(v, d); + // Ext_ModifyTessellatedVertex14(v, d); + // Ext_ModifyTessellatedVertex15(v, d); + // Ext_ModifyTessellatedVertex16(v, d); + // Ext_ModifyTessellatedVertex17(v, d); + // Ext_ModifyTessellatedVertex18(v, d); + // Ext_ModifyTessellatedVertex19(v, d); + // Ext_ModifyTessellatedVertex20(v, d); + // Ext_ModifyTessellatedVertex21(v, d); + // Ext_ModifyTessellatedVertex22(v, d); + // Ext_ModifyTessellatedVertex23(v, d); + // Ext_ModifyTessellatedVertex24(v, d); + // Ext_ModifyTessellatedVertex25(v, d); + // Ext_ModifyTessellatedVertex26(v, d); + // Ext_ModifyTessellatedVertex27(v, d); + // Ext_ModifyTessellatedVertex28(v, d); + // Ext_ModifyTessellatedVertex29(v, d); + + // #if %EXTRAV2F0REQUIREKEY% + // v2p.extraV2F0 = d.extraV2F0; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // v2p.extraV2F1 = d.extraV2F1; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // v2p.extraV2F2 = d.extraV2F2; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // v2p.extraV2F3 = d.extraV2F3; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // v2p.extraV2F4 = d.extraV2F4; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // v2p.extraV2F5 = d.extraV2F5; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // v2p.extraV2F6 = d.extraV2F6; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // v2p.extraV2F7 = d.extraV2F7; + // #endif + } + + void ChainFinalColorForward(inout Surface l, inout ShaderData d, inout half4 color) + { + // Ext_FinalColorForward0(l, d, color); + // Ext_FinalColorForward1(l, d, color); + // Ext_FinalColorForward2(l, d, color); + // Ext_FinalColorForward3(l, d, color); + // Ext_FinalColorForward4(l, d, color); + // Ext_FinalColorForward5(l, d, color); + // Ext_FinalColorForward6(l, d, color); + // Ext_FinalColorForward7(l, d, color); + // Ext_FinalColorForward8(l, d, color); + // Ext_FinalColorForward9(l, d, color); + // Ext_FinalColorForward10(l, d, color); + // Ext_FinalColorForward11(l, d, color); + // Ext_FinalColorForward12(l, d, color); + // Ext_FinalColorForward13(l, d, color); + // Ext_FinalColorForward14(l, d, color); + // Ext_FinalColorForward15(l, d, color); + // Ext_FinalColorForward16(l, d, color); + // Ext_FinalColorForward17(l, d, color); + // Ext_FinalColorForward18(l, d, color); + // Ext_FinalColorForward19(l, d, color); + // Ext_FinalColorForward20(l, d, color); + // Ext_FinalColorForward21(l, d, color); + // Ext_FinalColorForward22(l, d, color); + // Ext_FinalColorForward23(l, d, color); + // Ext_FinalColorForward24(l, d, color); + // Ext_FinalColorForward25(l, d, color); + // Ext_FinalColorForward26(l, d, color); + // Ext_FinalColorForward27(l, d, color); + // Ext_FinalColorForward28(l, d, color); + // Ext_FinalColorForward29(l, d, color); + } + + void ChainFinalGBufferStandard(inout Surface s, inout ShaderData d, inout half4 GBuffer0, inout half4 GBuffer1, inout half4 GBuffer2, inout half4 outEmission, inout half4 outShadowMask) + { + // Ext_FinalGBufferStandard0(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard1(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard2(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard3(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard4(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard5(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard6(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard7(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard8(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard9(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard10(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard11(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard12(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard13(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard14(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard15(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard16(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard17(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard18(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard19(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard20(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard21(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard22(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard23(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard24(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard25(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard26(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard27(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard28(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard29(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + } +#endif + + + + + +#if _DECALSHADER + + ShaderData CreateShaderData(SurfaceDescriptionInputs IN) + { + ShaderData d = (ShaderData)0; + d.TBNMatrix = float3x3(IN.WorldSpaceTangent, IN.WorldSpaceBiTangent, IN.WorldSpaceNormal); + d.worldSpaceNormal = IN.WorldSpaceNormal; + d.worldSpaceTangent = IN.WorldSpaceTangent; + + d.worldSpacePosition = IN.WorldSpacePosition; + d.texcoord0 = IN.uv0.xyxy; + d.screenPos = IN.ScreenPosition; + + d.worldSpaceViewDir = normalize(_WorldSpaceCameraPos - d.worldSpacePosition); + + d.tangentSpaceViewDir = mul(d.TBNMatrix, d.worldSpaceViewDir); + + // these rarely get used, so we back transform them. Usually will be stripped. + #if _HDRP + // d.localSpacePosition = mul(GetWorldToObjectMatrix(), float4(GetCameraRelativePositionWS(d.worldSpacePosition), 1)).xyz; + #else + // d.localSpacePosition = mul(GetWorldToObjectMatrix(), float4(d.worldSpacePosition, 1)).xyz; + #endif + // d.localSpaceNormal = normalize(mul((float3x3)GetWorldToObjectMatrix(), d.worldSpaceNormal)); + // d.localSpaceTangent = normalize(mul((float3x3)GetWorldToObjectMatrix(), d.worldSpaceTangent.xyz)); + + // #if %SCREENPOSREQUIREKEY% + // d.screenUV = (IN.ScreenPosition.xy / max(0.01, IN.ScreenPosition.w)); + // #endif + + return d; + } +#else + + ShaderData CreateShaderData(VertexToPixel i + #if NEED_FACING + , bool facing + #endif + ) + { + ShaderData d = (ShaderData)0; + d.clipPos = i.pos; + d.worldSpacePosition = i.worldPos; + + d.worldSpaceNormal = normalize(i.worldNormal); + d.worldSpaceTangent.xyz = normalize(i.worldTangent.xyz); + + d.tangentSign = i.worldTangent.w * unity_WorldTransformParams.w; + float3 bitangent = cross(d.worldSpaceTangent.xyz, d.worldSpaceNormal) * d.tangentSign; + + d.TBNMatrix = float3x3(d.worldSpaceTangent, -bitangent, d.worldSpaceNormal); + d.worldSpaceViewDir = normalize(_WorldSpaceCameraPos - i.worldPos); + + d.tangentSpaceViewDir = mul(d.TBNMatrix, d.worldSpaceViewDir); + d.texcoord0 = i.texcoord0; + d.texcoord1 = i.texcoord1; + d.texcoord2 = i.texcoord2; + + // #if %TEXCOORD3REQUIREKEY% + d.texcoord3 = i.texcoord3; + // #endif + + // d.isFrontFace = facing; + // #if %VERTEXCOLORREQUIREKEY% + d.vertexColor = i.vertexColor; + // #endif + + // these rarely get used, so we back transform them. Usually will be stripped. + #if _HDRP + // d.localSpacePosition = mul(GetWorldToObjectMatrix(), float4(GetCameraRelativePositionWS(i.worldPos), 1)).xyz; + #else + // d.localSpacePosition = mul(GetWorldToObjectMatrix(), float4(i.worldPos, 1)).xyz; + #endif + // d.localSpaceNormal = normalize(mul((float3x3)GetWorldToObjectMatrix(), i.worldNormal)); + // d.localSpaceTangent = normalize(mul((float3x3)GetWorldToObjectMatrix(), i.worldTangent.xyz)); + + // #if %SCREENPOSREQUIREKEY% + // d.screenPos = i.screenPos; + // d.screenUV = (i.screenPos.xy / i.screenPos.w); + // #endif + + + // #if %EXTRAV2F0REQUIREKEY% + // d.extraV2F0 = i.extraV2F0; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // d.extraV2F1 = i.extraV2F1; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // d.extraV2F2 = i.extraV2F2; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // d.extraV2F3 = i.extraV2F3; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // d.extraV2F4 = i.extraV2F4; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // d.extraV2F5 = i.extraV2F5; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // d.extraV2F6 = i.extraV2F6; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // d.extraV2F7 = i.extraV2F7; + // #endif + + return d; + } + +#endif + + + #if defined(_PASSSHADOW) + float3 _LightDirection; + float3 _LightPosition; + #endif + + #if (_PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR))) + + #define GetWorldToViewMatrix() _ViewMatrix + #define UNITY_MATRIX_I_V _InvViewMatrix + #define GetViewToHClipMatrix() OptimizeProjectionMatrix(_ProjMatrix) + #define UNITY_MATRIX_I_P _InvProjMatrix + #define GetWorldToHClipMatrix() _ViewProjMatrix + #define UNITY_MATRIX_I_VP _InvViewProjMatrix + #define UNITY_MATRIX_UNJITTERED_VP _NonJitteredViewProjMatrix + #define UNITY_MATRIX_PREV_VP _PrevViewProjMatrix + #define UNITY_MATRIX_PREV_I_VP _PrevInvViewProjMatrix + + void MotionVectorPositionZBias(VertexToPixel input) + { + #if UNITY_REVERSED_Z + input.pos.z -= unity_MotionVectorsParams.z * input.pos.w; + #else + input.pos.z += unity_MotionVectorsParams.z * input.pos.w; + #endif + } + + #endif + + // vertex shader + VertexToPixel Vert (VertexData v) + { + VertexToPixel o = (VertexToPixel)0; + + UNITY_SETUP_INSTANCE_ID(v); + UNITY_TRANSFER_INSTANCE_ID(v, o); + UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o); + + + #if _URP && (_PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR))) + VertexData previousMesh = v; + #endif + #if !_TESSELLATION_ON + ChainModifyVertex(v, o, _Time); + #endif + + o.texcoord0 = v.texcoord0; + o.texcoord1 = v.texcoord1; + o.texcoord2 = v.texcoord2; + + // #if %TEXCOORD3REQUIREKEY% + o.texcoord3 = v.texcoord3; + // #endif + + // #if %VERTEXCOLORREQUIREKEY% + o.vertexColor = v.vertexColor; + // #endif + + // This return the camera relative position (if enable) + float3 positionWS = TransformObjectToWorld(v.vertex.xyz); + float3 normalWS = TransformObjectToWorldNormal(v.normal); + float4 tangentWS = float4(TransformObjectToWorldDir(v.tangent.xyz), v.tangent.w); + + VertexPositionInputs vertexInput = GetVertexPositionInputs(v.vertex.xyz); + o.worldPos = positionWS; + o.worldNormal = normalWS; + o.worldTangent = tangentWS; + + + // For some very odd reason, in 2021.2, we can't use Unity's defines, but have to use our own.. + #if _PASSSHADOW + #if _CASTING_PUNCTUAL_LIGHT_SHADOW + float3 lightDirectionWS = normalize(_LightPosition - o.worldPos); + #else + float3 lightDirectionWS = _LightDirection; + #endif + // Define shadow pass specific clip position for Universal + o.pos = TransformWorldToHClip(ApplyShadowBias(o.worldPos, o.worldNormal, lightDirectionWS)); + #if UNITY_REVERSED_Z + o.pos.z = min(o.pos.z, UNITY_NEAR_CLIP_VALUE); + #else + o.pos.z = max(o.pos.z, UNITY_NEAR_CLIP_VALUE); + #endif + #elif _PASSMETA + o.pos = MetaVertexPosition(float4(v.vertex.xyz, 0), v.texcoord1.xy, v.texcoord2.xy, unity_LightmapST, unity_DynamicLightmapST); + #else + o.pos = TransformWorldToHClip(o.worldPos); + #endif + + // #if %SCREENPOSREQUIREKEY% + // o.screenPos = ComputeScreenPos(o.pos, _ProjectionParams.x); + // #endif + + + #if _PASSFORWARD || _PASSGBUFFER + float2 uv1 = v.texcoord1.xy; + OUTPUT_LIGHTMAP_UV(uv1, unity_LightmapST, o.lightmapUV); + o.texcoord1.xy = uv1; + #if UNITY_VERSION < 60000009 + OUTPUT_SH(o.worldNormal, o.sh); + #endif + + #if defined(DYNAMICLIGHTMAP_ON) + o.dynamicLightmapUV.xy = v.texcoord2.xy * unity_DynamicLightmapST.xy + unity_DynamicLightmapST.zw; + #if UNITY_VERSION >= 60000009 + OUTPUT_SH(o.worldNormal, o.sh); + #endif + #elif (defined(PROBE_VOLUMES_L1) || defined(PROBE_VOLUMES_L2)) && UNITY_VERSION >= 60000009 + OUTPUT_SH4(vertexInput.positionWS, o.worldNormal.xyz, GetWorldSpaceNormalizeViewDir(vertexInput.positionWS), o.sh, o.probeOcclusion); + #endif + #endif + + #ifdef VARYINGS_NEED_FOG_AND_VERTEX_LIGHT + half fogFactor = 0; + #if defined(_FOG_FRAGMENT) + fogFactor = ComputeFogFactor(o.pos.z); + #endif + #if _BAKEDLIT + o.fogFactorAndVertexLight = half4(fogFactor, 0, 0, 0); + #else + half3 vertexLight = VertexLighting(o.worldPos, o.worldNormal); + o.fogFactorAndVertexLight = half4(fogFactor, vertexLight); + #endif + #endif + + #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR) + o.shadowCoord = GetShadowCoord(vertexInput); + #endif + + #if _URP && (_PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR))) + #if !defined(TESSELLATION_ON) + MotionVectorPositionZBias(o); + #endif + + o.previousPositionCS = float4(0.0, 0.0, 0.0, 1.0); + // Note: unity_MotionVectorsParams.y is 0 is forceNoMotion is enabled + bool forceNoMotion = unity_MotionVectorsParams.y == 0.0; + + if (!forceNoMotion) + { + #if defined(HAVE_VFX_MODIFICATION) + float3 previousPositionOS = currentFrameMvData.vfxParticlePositionOS; + #if defined(VFX_FEATURE_MOTION_VECTORS_VERTS) + const bool applyDeformation = false; + #else + const bool applyDeformation = true; + #endif + #else + const bool hasDeformation = unity_MotionVectorsParams.x == 1; // Mesh has skinned deformation + float3 previousPositionOS = hasDeformation ? previousMesh.previousPositionOS : previousMesh.vertex.xyz; + + #if defined(AUTOMATIC_TIME_BASED_MOTION_VECTORS) && defined(GRAPH_VERTEX_USES_TIME_PARAMETERS_INPUT) + const bool applyDeformation = true; + #else + const bool applyDeformation = hasDeformation; + #endif + #endif + // TODO + #if defined(FEATURES_GRAPH_VERTEX) + if (applyDeformation) + previousPositionOS = GetLastFrameDeformedPosition(previousMesh, currentFrameMvData, previousPositionOS); + else + previousPositionOS = previousMesh.positionOS; + + #if defined(FEATURES_GRAPH_VERTEX_MOTION_VECTOR_OUTPUT) + previousPositionOS -= previousMesh.precomputedVelocity; + #endif + #endif + + #if defined(UNITY_DOTS_INSTANCING_ENABLED) && defined(DOTS_DEFORMED) + // Deformed vertices in DOTS are not cumulative with built-in Unity skinning/blend shapes + // Needs to be called after vertex modification has been applied otherwise it will be + // overwritten by Compute Deform node + ApplyPreviousFrameDeformedVertexPosition(previousMesh.vertexID, previousPositionOS); + #endif + #if defined (_ADD_PRECOMPUTED_VELOCITY) + previousPositionOS -= previousMesh.precomputedVelocity; + #endif + o.positionCS = mul(UNITY_MATRIX_UNJITTERED_VP, float4(positionWS, 1.0f)); + + #if defined(HAVE_VFX_MODIFICATION) + #if defined(VFX_FEATURE_MOTION_VECTORS_VERTS) + #if defined(FEATURES_GRAPH_VERTEX_MOTION_VECTOR_OUTPUT) || defined(_ADD_PRECOMPUTED_VELOCITY) + #error Unexpected fast path rendering VFX motion vector while there are vertex modification afterwards. + #endif + o.previousPositionCS = VFXGetPreviousClipPosition(previousMesh, currentFrameMvData.vfxElementAttributes, o.positionCS); + #else + #if VFX_WORLD_SPACE + //previousPositionOS is already in world space + const float3 previousPositionWS = previousPositionOS; + #else + const float3 previousPositionWS = mul(UNITY_PREV_MATRIX_M, float4(previousPositionOS, 1.0f)).xyz; + #endif + o.previousPositionCS = mul(UNITY_MATRIX_PREV_VP, float4(previousPositionWS, 1.0f)); + #endif + #else + o.previousPositionCS = mul(UNITY_MATRIX_PREV_VP, mul(UNITY_PREV_MATRIX_M, float4(previousPositionOS, 1))); + #endif + } + #endif + + return o; + } + + + + + // fragment shader + half4 Frag (VertexToPixel IN + #if NEED_FACING + , bool facing : SV_IsFrontFace + #endif + ) : SV_Target + { + UNITY_SETUP_INSTANCE_ID(IN); + + ShaderData d = CreateShaderData(IN + #if NEED_FACING + , facing + #endif + ); + + Surface l = (Surface)0; + + l.Albedo = half3(0.5, 0.5, 0.5); + l.Normal = float3(0,0,1); + l.Occlusion = 1; + l.Alpha = 1; + + ChainSurfaceFunction(l, d); + + MetaInput metaInput = (MetaInput)0; + metaInput.Albedo = l.Albedo; + metaInput.Emission = l.Emission; + + return MetaFragment(metaInput); + + } + + ENDHLSL + + } + + + + Pass + { + Name "DepthNormals" + Tags + { + "LightMode" = "DepthNormals" + } + + // Render State + Cull Back + ZTest LEqual + ZWrite On + + Tags { "RenderType" = "Opaque" "Queue" = "Geometry" "PreviewType" = "Plane" } + Cull [_CullingOption] + ZWrite [_ZWrite] + ZTest [_ZTestMode] + + + HLSLPROGRAM + + #pragma vertex Vert + #pragma fragment Frag + + #pragma target 3.0 + + #pragma prefer_hlslcc gles + #pragma exclude_renderers d3d11_9x + #pragma multi_compile_fog + #pragma multi_compile_instancing + #pragma multi_compile_fragment _ LOD_FADE_CROSSFADE + #pragma multi_compile_fragment _ _WRITE_RENDERING_LAYERS + + #define SHADERPASS SHADERPASS_DEPTHNORMALSONLY + #define _PASSDEPTH 1 + #define _PASSDEPTHNORMALS 1 + + + + #pragma shader_feature_local GLOW_ON + #pragma shader_feature_local FADE_ON + #pragma shader_feature_local OUTBASE_ON + #pragma shader_feature_local ONLYOUTLINE_ON + #pragma shader_feature_local GRADIENT_ON + #pragma shader_feature_local GRADIENT2COL_ON + #pragma shader_feature_local RADIALGRADIENT_ON + #pragma shader_feature_local COLORSWAP_ON + #pragma shader_feature_local HSV_ON + #pragma shader_feature_local CHANGECOLOR_ON + #pragma shader_feature_local CHANGECOLOR2_ON + #pragma shader_feature_local CHANGECOLOR3_ON + #pragma shader_feature_local COLORRAMP_ON + #pragma shader_feature_local GRADIENTCOLORRAMP_ON + #pragma shader_feature_local HITEFFECT_ON + #pragma shader_feature_local NEGATIVE_ON + #pragma shader_feature_local PIXELATE_ON + #pragma shader_feature_local GREYSCALE_ON + #pragma shader_feature_local POSTERIZE_ON + #pragma shader_feature_local BLUR_ON + #pragma shader_feature_local MOTIONBLUR_ON + #pragma shader_feature_local GHOST_ON + #pragma shader_feature_local ALPHAOUTLINE_ON + #pragma shader_feature_local INNEROUTLINE_ON + #pragma shader_feature_local ONLYINNEROUTLINE_ON + #pragma shader_feature_local HOLOGRAM_ON + #pragma shader_feature_local CHROMABERR_ON + #pragma shader_feature_local GLITCH_ON + #pragma shader_feature_local FLICKER_ON + #pragma shader_feature_local SHADOW_ON + #pragma shader_feature_local SHINE_ON + #pragma shader_feature_local CONTRAST_ON + #pragma shader_feature_local OVERLAY_ON + #pragma shader_feature_local OVERLAYMULT_ON + #pragma shader_feature_local DOODLE_ON + #pragma shader_feature_local WIND_ON + #pragma shader_feature_local WAVEUV_ON + #pragma shader_feature_local ROUNDWAVEUV_ON + #pragma shader_feature_local RECTSIZE_ON + #pragma shader_feature_local OFFSETUV_ON + #pragma shader_feature_local CLIPPING_ON + #pragma shader_feature_local RADIALCLIPPING_ON + #pragma shader_feature_local TEXTURESCROLL_ON + #pragma shader_feature_local ZOOMUV_ON + #pragma shader_feature_local DISTORT_ON + #pragma shader_feature_local WARP_ON + #pragma shader_feature_local TWISTUV_ON + #pragma shader_feature_local ROTATEUV_ON + #pragma shader_feature_local POLARUV_ON + #pragma shader_feature_local FISHEYE_ON + #pragma shader_feature_local PINCH_ON + #pragma shader_feature_local SHAKEUV_ON + + #pragma shader_feature_local GLOWTEX_ON + #pragma shader_feature_local OUTTEX_ON + #pragma shader_feature_local OUTDIST_ON + #pragma shader_feature_local OUTBASE8DIR_ON + #pragma shader_feature_local OUTBASEPIXELPERF_ON + #pragma shader_feature_local COLORRAMPOUTLINE_ON + #pragma shader_feature_local GREYSCALEOUTLINE_ON + #pragma shader_feature_local POSTERIZEOUTLINE_ON + #pragma shader_feature_local BLURISHD_ON + #pragma shader_feature_local MANUALWIND_ON + #pragma shader_feature_local ATLAS_ON + #pragma shader_feature_local PREMULTIPLYALPHA_ON + + #pragma shader_feature BILBOARD_ON + #pragma shader_feature BILBOARDY_ON + + #pragma shader_feature NORMALMAP_ON + + + #define _URP 1 +#define _USINGTEXCOORD1 1 +#define _USINGTEXCOORD2 1 + + + // this has to be here or specular color will be ignored. Not in SG code + #if _SIMPLELIT + #define _SPECULAR_COLOR + #endif + + + // Includes + #include_with_pragmas "Packages/com.unity.render-pipelines.universal/ShaderLibrary/DOTS.hlsl" + #include_with_pragmas "Packages/com.unity.render-pipelines.universal/ShaderLibrary/RenderingLayers.hlsl" + #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.universal/ShaderLibrary/Input.hlsl" + #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/TextureStack.hlsl" + #include_with_pragmas "Packages/com.unity.render-pipelines.core/ShaderLibrary/FoveatedRenderingKeywords.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.universal/ShaderLibrary/LODCrossFade.hlsl" + + + + + + #undef WorldNormalVector + #define WorldNormalVector(data, normal) mul(normal, data.TBNMatrix) + + #define UnityObjectToWorldNormal(normal) mul(GetObjectToWorldMatrix(), normal) + + #define _WorldSpaceLightPos0 _MainLightPosition + + #define UNITY_DECLARE_TEX2D(name) TEXTURE2D(name); SAMPLER(sampler##name); + #define UNITY_DECLARE_TEX2D_NOSAMPLER(name) TEXTURE2D(name); + #define UNITY_DECLARE_TEX2DARRAY(name) TEXTURE2D_ARRAY(name); SAMPLER(sampler##name); + #define UNITY_DECLARE_TEX2DARRAY_NOSAMPLER(name) TEXTURE2D_ARRAY(name); + + #define UNITY_SAMPLE_TEX2DARRAY(tex,coord) SAMPLE_TEXTURE2D_ARRAY(tex, sampler##tex, coord.xy, coord.z) + #define UNITY_SAMPLE_TEX2DARRAY_LOD(tex,coord,lod) SAMPLE_TEXTURE2D_ARRAY_LOD(tex, sampler##tex, coord.xy, coord.z, lod) + #define UNITY_SAMPLE_TEX2D(tex, coord) SAMPLE_TEXTURE2D(tex, sampler##tex, coord) + #define UNITY_SAMPLE_TEX2D_SAMPLER(tex, samp, coord) SAMPLE_TEXTURE2D(tex, sampler##samp, coord) + + #define UNITY_SAMPLE_TEX2D_LOD(tex,coord, lod) SAMPLE_TEXTURE2D_LOD(tex, sampler_##tex, coord, lod) + #define UNITY_SAMPLE_TEX2D_SAMPLER_LOD(tex,samplertex,coord, lod) SAMPLE_TEXTURE2D_LOD (tex, sampler##samplertex,coord, lod) + + #if defined(UNITY_COMPILER_HLSL) + #define UNITY_INITIALIZE_OUTPUT(type,name) name = (type)0; + #else + #define UNITY_INITIALIZE_OUTPUT(type,name) + #endif + + #define sampler2D_float sampler2D + #define sampler2D_half sampler2D + + + + // data across stages, stripped like the above. + struct VertexToPixel + { + float4 pos : SV_POSITION; + float3 worldPos : TEXCOORD0; + float3 worldNormal : TEXCOORD1; + float4 worldTangent : TEXCOORD2; + float4 texcoord0 : TEXCOORD3; + float4 texcoord1 : TEXCOORD4; + float4 texcoord2 : TEXCOORD5; + + // #if %TEXCOORD3REQUIREKEY% + float4 texcoord3 : TEXCOORD6; + // #endif + + // #if %SCREENPOSREQUIREKEY% + // float4 screenPos : TEXCOORD7; + // #endif + + // #if %VERTEXCOLORREQUIREKEY% + half4 vertexColor : COLOR; + // #endif + + #if defined(LIGHTMAP_ON) + float2 lightmapUV : TEXCOORD8; + #endif + #if defined(DYNAMICLIGHTMAP_ON) + float2 dynamicLightmapUV : TEXCOORD9; + #endif + #if !defined(LIGHTMAP_ON) + float4 probeOcclusion : TEXCOORD8; + float3 sh : TEXCOORD10; + #endif + + #if defined(VARYINGS_NEED_FOG_AND_VERTEX_LIGHT) + float4 fogFactorAndVertexLight : TEXCOORD11; + #endif + + #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR) + float4 shadowCoord : TEXCOORD12; + #endif + + // #if %EXTRAV2F0REQUIREKEY% + // float4 extraV2F0 : TEXCOORD13; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // float4 extraV2F1 : TEXCOORD14; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // float4 extraV2F2 : TEXCOORD15; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // float4 extraV2F3 : TEXCOORD16; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // float4 extraV2F4 : TEXCOORD17; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // float4 extraV2F5 : TEXCOORD18; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // float4 extraV2F6 : TEXCOORD19; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // float4 extraV2F7 : TEXCOORD20; + // #endif + + #if UNITY_ANY_INSTANCING_ENABLED + uint instanceID : CUSTOM_INSTANCE_ID; + #endif + #if (defined(UNITY_STEREO_MULTIVIEW_ENABLED)) || (defined(UNITY_STEREO_INSTANCING_ENABLED) && (defined(SHADER_API_GLES3) || defined(SHADER_API_GLCORE))) + uint stereoTargetEyeIndexAsBlendIdx0 : BLENDINDICES0; + #endif + #if (defined(UNITY_STEREO_INSTANCING_ENABLED)) + uint stereoTargetEyeIndexAsRTArrayIdx : SV_RenderTargetArrayIndex; + #endif + #if defined(SHADER_STAGE_FRAGMENT) && defined(VARYINGS_NEED_CULLFACE) + FRONT_FACE_TYPE cullFace : FRONT_FACE_SEMANTIC; + #endif + + #if _PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR)) + float4 previousPositionCS : TEXCOORD21; // Contain previous transform position (in case of skinning for example) + float4 positionCS : TEXCOORD22; + #endif + }; + + + + + // data describing the user output of a pixel + struct Surface + { + half3 Albedo; + half Height; + half3 Normal; + half Smoothness; + half3 Emission; + half Metallic; + half3 Specular; + half Occlusion; + half SpecularPower; // for simple lighting + half Alpha; + float outputDepth; // if written, SV_Depth semantic is used. ShaderData.clipPos.z is unused value + // HDRP Only + half SpecularOcclusion; + half SubsurfaceMask; + half Thickness; + half CoatMask; + half CoatSmoothness; + half Anisotropy; + half IridescenceMask; + half IridescenceThickness; + int DiffusionProfileHash; + float SpecularAAThreshold; + float SpecularAAScreenSpaceVariance; + // requires _OVERRIDE_BAKEDGI to be defined, but is mapped in all pipelines + float3 DiffuseGI; + float3 BackDiffuseGI; + float3 SpecularGI; + float ior; + float3 transmittanceColor; + float atDistance; + float transmittanceMask; + // requires _OVERRIDE_SHADOWMASK to be defines + float4 ShadowMask; + + // for decals + float NormalAlpha; + float MAOSAlpha; + + + }; + + // Data the user declares in blackboard blocks + struct Blackboard + { + + float blackboardDummyData; + }; + + // data the user might need, this will grow to be big. But easy to strip + struct ShaderData + { + float4 clipPos; // SV_POSITION + float3 localSpacePosition; + float3 localSpaceNormal; + float3 localSpaceTangent; + + float3 worldSpacePosition; + float3 worldSpaceNormal; + float3 worldSpaceTangent; + float tangentSign; + + float3 worldSpaceViewDir; + float3 tangentSpaceViewDir; + + float4 texcoord0; + float4 texcoord1; + float4 texcoord2; + float4 texcoord3; + + float2 screenUV; + float4 screenPos; + + float4 vertexColor; + bool isFrontFace; + + float4 extraV2F0; + float4 extraV2F1; + float4 extraV2F2; + float4 extraV2F3; + float4 extraV2F4; + float4 extraV2F5; + float4 extraV2F6; + float4 extraV2F7; + + float3x3 TBNMatrix; + Blackboard blackboard; + }; + + struct VertexData + { + #if SHADER_TARGET > 30 + // uint vertexID : SV_VertexID; + #endif + float4 vertex : POSITION; + float3 normal : NORMAL; + float4 tangent : TANGENT; + float4 texcoord0 : TEXCOORD0; + + // optimize out mesh coords when not in use by user or lighting system + #if _URP && (_USINGTEXCOORD1 || _PASSMETA || _PASSFORWARD || _PASSGBUFFER) + float4 texcoord1 : TEXCOORD1; + #endif + + #if _URP && (_USINGTEXCOORD2 || _PASSMETA || ((_PASSFORWARD || _PASSGBUFFER) && defined(DYNAMICLIGHTMAP_ON))) + float4 texcoord2 : TEXCOORD2; + #endif + + #if _STANDARD && (_USINGTEXCOORD1 || (_PASSMETA || ((_PASSFORWARD || _PASSGBUFFER || _PASSFORWARDADD) && LIGHTMAP_ON))) + float4 texcoord1 : TEXCOORD1; + #endif + #if _STANDARD && (_USINGTEXCOORD2 || (_PASSMETA || ((_PASSFORWARD || _PASSGBUFFER) && DYNAMICLIGHTMAP_ON))) + float4 texcoord2 : TEXCOORD2; + #endif + + + #if _HDRP + float4 texcoord1 : TEXCOORD1; + float4 texcoord2 : TEXCOORD2; + #endif + + // #if %TEXCOORD3REQUIREKEY% + float4 texcoord3 : TEXCOORD3; + // #endif + + // #if %VERTEXCOLORREQUIREKEY% + float4 vertexColor : COLOR; + // #endif + + #if _PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR)) + float3 previousPositionOS : TEXCOORD4; // Contain previous transform position (in case of skinning for example) + #if defined (_ADD_PRECOMPUTED_VELOCITY) + float3 precomputedVelocity : TEXCOORD5; // Add Precomputed Velocity (Alembic computes velocities on runtime side). + #endif + #endif + + UNITY_VERTEX_INPUT_INSTANCE_ID + }; + + struct TessVertex + { + float4 vertex : INTERNALTESSPOS; + float3 normal : NORMAL; + float4 tangent : TANGENT; + float4 texcoord0 : TEXCOORD0; + float4 texcoord1 : TEXCOORD1; + float4 texcoord2 : TEXCOORD2; + + // #if %TEXCOORD3REQUIREKEY% + float4 texcoord3 : TEXCOORD3; + // #endif + + // #if %VERTEXCOLORREQUIREKEY% + float4 vertexColor : COLOR; + // #endif + + // #if %EXTRAV2F0REQUIREKEY% + // float4 extraV2F0 : TEXCOORD5; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // float4 extraV2F1 : TEXCOORD6; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // float4 extraV2F2 : TEXCOORD7; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // float4 extraV2F3 : TEXCOORD8; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // float4 extraV2F4 : TEXCOORD9; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // float4 extraV2F5 : TEXCOORD10; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // float4 extraV2F6 : TEXCOORD11; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // float4 extraV2F7 : TEXCOORD12; + // #endif + + #if _PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR)) + float3 previousPositionOS : TEXCOORD13; // Contain previous transform position (in case of skinning for example) + #if defined (_ADD_PRECOMPUTED_VELOCITY) + float3 precomputedVelocity : TEXCOORD14; + #endif + #endif + + UNITY_VERTEX_INPUT_INSTANCE_ID + UNITY_VERTEX_OUTPUT_STEREO + }; + + struct ExtraV2F + { + float4 extraV2F0; + float4 extraV2F1; + float4 extraV2F2; + float4 extraV2F3; + float4 extraV2F4; + float4 extraV2F5; + float4 extraV2F6; + float4 extraV2F7; + Blackboard blackboard; + float4 time; + }; + + + float3 WorldToTangentSpace(ShaderData d, float3 normal) + { + return mul(d.TBNMatrix, normal); + } + + float3 TangentToWorldSpace(ShaderData d, float3 normal) + { + return mul(normal, d.TBNMatrix); + } + + // in this case, make standard more like SRPs, because we can't fix + // unity_WorldToObject in HDRP, since it already does macro-fu there + + #if _STANDARD + float3 TransformWorldToObject(float3 p) { return mul(unity_WorldToObject, float4(p, 1)); }; + float3 TransformObjectToWorld(float3 p) { return mul(unity_ObjectToWorld, float4(p, 1)); }; + float4 TransformWorldToObject(float4 p) { return mul(unity_WorldToObject, p); }; + float4 TransformObjectToWorld(float4 p) { return mul(unity_ObjectToWorld, p); }; + float4x4 GetWorldToObjectMatrix() { return unity_WorldToObject; } + float4x4 GetObjectToWorldMatrix() { return unity_ObjectToWorld; } + #if (defined(SHADER_API_D3D11) || defined(SHADER_API_XBOXONE) || defined(UNITY_COMPILER_HLSLCC) || defined(SHADER_API_PSSL) || (SHADER_TARGET_SURFACE_ANALYSIS && !SHADER_TARGET_SURFACE_ANALYSIS_MOJOSHADER)) + #define UNITY_SAMPLE_TEX2D_LOD(tex,coord, lod) tex.SampleLevel (sampler##tex,coord, lod) + #define UNITY_SAMPLE_TEX2D_SAMPLER_LOD(tex,samplertex,coord, lod) tex.SampleLevel (sampler##samplertex,coord, lod) + #else + #define UNITY_SAMPLE_TEX2D_LOD(tex,coord,lod) tex2D (tex,coord,0,lod) + #define UNITY_SAMPLE_TEX2D_SAMPLER_LOD(tex,samplertex,coord,lod) tex2D (tex,coord,0,lod) + #endif + + #undef GetWorldToObjectMatrix() + + #define GetWorldToObjectMatrix() unity_WorldToObject + + + #endif + + float3 GetCameraWorldPosition() + { + #if _HDRP + return GetCameraRelativePositionWS(_WorldSpaceCameraPos); + #else + return _WorldSpaceCameraPos; + #endif + } + + #if _GRABPASSUSED + #if _STANDARD + TEXTURE2D(%GRABTEXTURE%); + SAMPLER(sampler_%GRABTEXTURE%); + #endif + + half3 GetSceneColor(float2 uv) + { + #if _STANDARD + return SAMPLE_TEXTURE2D(%GRABTEXTURE%, sampler_%GRABTEXTURE%, uv).rgb; + #else + return SHADERGRAPH_SAMPLE_SCENE_COLOR(uv); + #endif + } + #endif + + + + #if _STANDARD + UNITY_DECLARE_DEPTH_TEXTURE(_CameraDepthTexture); + float GetSceneDepth(float2 uv) { return SAMPLE_DEPTH_TEXTURE(_CameraDepthTexture, uv); } + float GetLinear01Depth(float2 uv) { return Linear01Depth(GetSceneDepth(uv)); } + float GetLinearEyeDepth(float2 uv) { return LinearEyeDepth(GetSceneDepth(uv)); } + #else + float GetSceneDepth(float2 uv) { return SHADERGRAPH_SAMPLE_SCENE_DEPTH(uv); } + float GetLinear01Depth(float2 uv) { return Linear01Depth(GetSceneDepth(uv), _ZBufferParams); } + float GetLinearEyeDepth(float2 uv) { return LinearEyeDepth(GetSceneDepth(uv), _ZBufferParams); } + #endif + + float3 GetWorldPositionFromDepthBuffer(float2 uv, float3 worldSpaceViewDir) + { + float eye = GetLinearEyeDepth(uv); + float3 camView = mul((float3x3)GetObjectToWorldMatrix(), transpose(mul(GetWorldToObjectMatrix(), UNITY_MATRIX_I_V)) [2].xyz); + + float dt = dot(worldSpaceViewDir, camView); + float3 div = worldSpaceViewDir/dt; + float3 wpos = (eye * div) + GetCameraWorldPosition(); + return wpos; + } + + #if _HDRP + float3 ObjectToWorldSpacePosition(float3 pos) + { + return GetAbsolutePositionWS(TransformObjectToWorld(pos)); + } + #else + float3 ObjectToWorldSpacePosition(float3 pos) + { + return TransformObjectToWorld(pos); + } + #endif + + #if _STANDARD + UNITY_DECLARE_SCREENSPACE_TEXTURE(_CameraDepthNormalsTexture); + float3 GetSceneNormal(float2 uv, float3 worldSpaceViewDir) + { + float4 depthNorms = UNITY_SAMPLE_SCREENSPACE_TEXTURE(_CameraDepthNormalsTexture, uv); + float3 norms = DecodeViewNormalStereo(depthNorms); + norms = mul((float3x3)GetWorldToViewMatrix(), norms) * 0.5 + 0.5; + return norms; + } + #elif _HDRP && !_DECALSHADER + + float3 GetSceneNormal(float2 uv, float3 worldSpaceViewDir) + { + NormalData nd; + DecodeFromNormalBuffer(_ScreenSize.xy * uv, nd); + return nd.normalWS; + } + #elif _URP + #if (SHADER_LIBRARY_VERSION_MAJOR >= 10) + #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/DeclareNormalsTexture.hlsl" + #endif + + float3 GetSceneNormal(float2 uv, float3 worldSpaceViewDir) + { + #if (SHADER_LIBRARY_VERSION_MAJOR >= 10) + return SampleSceneNormals(uv); + #else + float3 wpos = GetWorldPositionFromDepthBuffer(uv, worldSpaceViewDir); + return normalize(-cross(ddx(wpos), ddy(wpos))) * 0.5 + 0.5; + #endif + + } + #endif + + #if _HDRP + + half3 UnpackNormalmapRGorAG(half4 packednormal) + { + // This do the trick + packednormal.x *= packednormal.w; + + half3 normal; + normal.xy = packednormal.xy * 2 - 1; + normal.z = sqrt(1 - saturate(dot(normal.xy, normal.xy))); + return normal; + } + half3 UnpackNormal(half4 packednormal) + { + #if defined(UNITY_NO_DXT5nm) + return packednormal.xyz * 2 - 1; + #else + return UnpackNormalmapRGorAG(packednormal); + #endif + } + #endif + #if _HDRP || _URP + + half3 UnpackScaleNormal(half4 packednormal, half scale) + { + #ifndef UNITY_NO_DXT5nm + // Unpack normal as DXT5nm (1, y, 1, x) or BC5 (x, y, 0, 1) + // Note neutral texture like "bump" is (0, 0, 1, 1) to work with both plain RGB normal and DXT5nm/BC5 + packednormal.x *= packednormal.w; + #endif + half3 normal; + normal.xy = (packednormal.xy * 2 - 1) * scale; + normal.z = sqrt(1 - saturate(dot(normal.xy, normal.xy))); + return normal; + } + + #endif + + + void GetSun(out float3 lightDir, out float3 color) + { + lightDir = float3(0.5, 0.5, 0); + color = 1; + #if _HDRP + if (_DirectionalLightCount > 0) + { + DirectionalLightData light = _DirectionalLightDatas[0]; + lightDir = -light.forward.xyz; + color = light.color; + } + #elif _STANDARD + lightDir = normalize(_WorldSpaceLightPos0.xyz); + color = _LightColor0.rgb; + #elif _URP + Light light = GetMainLight(); + lightDir = light.direction; + color = light.color; + #endif + } + + + + CBUFFER_START(UnityPerMaterial) + + + half4 _Color; + half4 _MainTex_ST, _MainTex_TexelSize; + half _Alpha, _AlphaCutoffValue; + + #if ATLAS_ON + half _MinXUV, _MaxXUV, _MinYUV, _MaxYUV; + #endif + + #if GLOW_ON + half4 _GlowColor; + half _Glow, _GlowGlobal; + #endif + + #if HSV_ON + half _HsvShift, _HsvSaturation, _HsvBright; + #endif + + #if DISTORT_ON + half4 _DistortTex_ST; + half _DistortTexXSpeed, _DistortTexYSpeed, _DistortAmount; + #endif + + #if FADE_ON + half4 _FadeBurnColor, _FadeTex_ST, _FadeBurnTex_ST; + half _FadeAmount, _FadeBurnWidth, _FadeBurnTransition,_FadeBurnGlow; + #endif + + #if OUTBASE_ON + half4 _OutlineColor; + half _OutlineAlpha, _OutlineGlow, _OutlineWidth; + int _OutlinePixelWidth; + #endif + + #if OUTTEX_ON + half4 _OutlineTex_ST; + half _OutlineTexXSpeed, _OutlineTexYSpeed; + #endif + + #if OUTDIST_ON + half4 _OutlineDistortTex_ST; + half _OutlineDistortTexXSpeed, _OutlineDistortTexYSpeed, _OutlineDistortAmount; + #endif + + #if ALPHAOUTLINE_ON + half _AlphaOutlineGlow, _AlphaOutlinePower, _AlphaOutlineMinAlpha, _AlphaOutlineBlend; + half4 _AlphaOutlineColor; + #endif + + #if INNEROUTLINE_ON + half _InnerOutlineThickness, _InnerOutlineAlpha, _InnerOutlineGlow; + half4 _InnerOutlineColor; + #endif + + #if GRADIENT_ON + half _GradBlend, _GradBoostX, _GradBoostY; + half4 _GradTopRightCol, _GradTopLeftCol, _GradBotRightCol, _GradBotLeftCol; + #endif + + #if COLORSWAP_ON + half4 _ColorSwapRed, _ColorSwapGreen, _ColorSwapBlue; + half _ColorSwapRedLuminosity, _ColorSwapGreenLuminosity, _ColorSwapBlueLuminosity, _ColorSwapBlend; + #endif + + #if CHANGECOLOR_ON + half4 _ColorChangeNewCol, _ColorChangeTarget; + half _ColorChangeTolerance, _ColorChangeLuminosity; + #endif + #if CHANGECOLOR2_ON + half4 _ColorChangeNewCol2, _ColorChangeTarget2; + half _ColorChangeTolerance2; + #endif + #if CHANGECOLOR3_ON + half4 _ColorChangeNewCol3, _ColorChangeTarget3; + half _ColorChangeTolerance3; + #endif + + #if COLORRAMP_ON + half _ColorRampLuminosity, _ColorRampBlend; + #endif + + #if HITEFFECT_ON + half4 _HitEffectColor; + half _HitEffectGlow, _HitEffectBlend; + #endif + + #if NEGATIVE_ON + half _NegativeAmount; + #endif + + #if PIXELATE_ON + half _PixelateSize; + #endif + + #if GREYSCALE_ON + half _GreyscaleLuminosity, _GreyscaleBlend; + half4 _GreyscaleTintColor; + #endif + + #if POSTERIZE_ON + half _PosterizeNumColors, _PosterizeGamma; + #endif + + #if BLUR_ON + half _BlurIntensity; + #endif + + #if MOTIONBLUR_ON + half _MotionBlurAngle, _MotionBlurDist; + #endif + + #if GHOST_ON + half _GhostColorBoost, _GhostTransparency, _GhostBlend; + #endif + + #if HOLOGRAM_ON + half _HologramStripesAmount, _HologramMinAlpha, _HologramUnmodAmount, _HologramStripesSpeed, _HologramMaxAlpha, _HologramBlend; + half4 _HologramStripeColor; + #endif + + #if CHROMABERR_ON + half _ChromAberrAmount, _ChromAberrAlpha; + #endif + + #if GLITCH_ON + half _GlitchAmount, _GlitchSize; + #endif + + #if FLICKER_ON + half _FlickerFreq, _FlickerPercent, _FlickerAlpha; + #endif + + #if SHADOW_ON + half _ShadowX, _ShadowY, _ShadowAlpha; + half4 _ShadowColor; + #endif + + #if SHINE_ON + half4 _ShineColor; + half _ShineLocation, _ShineRotate, _ShineWidth, _ShineGlow; + #endif + + #if CONTRAST_ON + half _Contrast, _Brightness; + #endif + + #if OVERLAY_ON + half4 _OverlayTex_ST, _OverlayColor; + half _OverlayGlow, _OverlayBlend, _OverlayTextureScrollXSpeed, _OverlayTextureScrollYSpeed; + #endif + + #if DOODLE_ON + half _HandDrawnAmount, _HandDrawnSpeed; + #endif + + #if WIND_ON + half _GrassSpeed, _GrassWind, _GrassManualAnim, _GrassRadialBend; + #endif + + #if WAVEUV_ON + float _WaveAmount, _WaveSpeed, _WaveStrength, _WaveX, _WaveY; + #endif + + #if ROUNDWAVEUV_ON + half _RoundWaveStrength, _RoundWaveSpeed; + #endif + + #if RECTSIZE_ON + half _RectSize; + #endif + + #if OFFSETUV_ON + half _OffsetUvX, _OffsetUvY; + #endif + + #if CLIPPING_ON + half _ClipUvLeft, _ClipUvRight, _ClipUvUp, _ClipUvDown; + #endif + + #if RADIALCLIPPING_ON + half _RadialStartAngle, _RadialClip, _RadialClip2; + #endif + + #if TEXTURESCROLL_ON + half _TextureScrollXSpeed, _TextureScrollYSpeed; + #endif + + #if ZOOMUV_ON + half _ZoomUvAmount; + #endif + + #if WARP_ON + half _WarpStrength, _WarpSpeed, _WarpScale; + #endif + + #if TWISTUV_ON + half _TwistUvAmount, _TwistUvPosX, _TwistUvPosY, _TwistUvRadius; + #endif + + #if ROTATEUV_ON + half _RotateUvAmount; + #endif + + #if FISHEYE_ON + half _FishEyeUvAmount; + #endif + + #if PINCH_ON + half _PinchUvAmount; + #endif + + #if SHAKEUV_ON + half _ShakeUvSpeed, _ShakeUvX, _ShakeUvY; + #endif + + #if NORMALMAP_ON + half _NormalStrength; + #endif + + float _RandomSeed; + + + + + CBUFFER_END + + + + + + + + TEXTURE2D(_MainTex); + SAMPLER(sampler_MainTex); + + #if GLOW_ON + TEXTURE2D(_GlowTex); + SAMPLER(sampler_GlowTex); + #endif + + #if FADE_ON + TEXTURE2D(_FadeTex); + SAMPLER(sampler_FadeTex); + + TEXTURE2D(_FadeBurnTex); + SAMPLER(sampler_FadeBurnTex); + #endif + + #if DISTORT_ON + TEXTURE2D(_DistortTex); + SAMPLER(sampler_DistortTex); + #endif + + #if OUTTEX_ON + TEXTURE2D(_OutlineTex); + SAMPLER(sampler_OutlineTex); + #endif + + #if OUTDIST_ON + TEXTURE2D(_OutlineDistortTex); + SAMPLER(sampler_OutlineDistortTex); + #endif + + #if COLORSWAP_ON + TEXTURE2D(_ColorSwapTex); + SAMPLER(sampler_ColorSwapTex); + #endif + + #if COLORRAMP_ON + TEXTURE2D(_ColorRampTex); + TEXTURE2D(_ColorRampTexGradient); + SAMPLER(sampler_ColorRampTex); + SAMPLER(sampler_ColorRampTexGradient); + #endif + + #if SHINE_ON + TEXTURE2D(_ShineMask); + SAMPLER(sampler_ShineMask); + #endif + + #if OVERLAY_ON + TEXTURE2D(_OverlayTex); + SAMPLER(sampler_OverlayTex); + #endif + + #if NORMALMAP_ON + TEXTURE2D(_NormalMap); + SAMPLER(sampler_NormalMap); + #endif + + + half3 GetPixel(in int offsetX, in int offsetY, in half2 uv, in Texture2D _tex, in SamplerState _sampler) + { + half2 _uv = uv + half2(offsetX * _MainTex_TexelSize.x, offsetY * _MainTex_TexelSize.y); + half4 col = SAMPLE_TEXTURE2D(_tex, _sampler, _uv); + return col.rgb; + } + + + //BLURS------------------------------------------------------------------------- + half4 Blur(half2 uv, Texture2D source, SamplerState sampler_source, half Intensity) + { + const half2 texelSize = 1.0 / _ScreenParams.xy; + const half4 color = SAMPLE_TEXTURE2D(source, sampler_source, uv); + const half2 offset = Intensity * texelSize; + + half4 accumulatedColor = color; + half accumulatedWeight = 1.0; + for (int x = -1; x <= 1; x++) + { + for (int y = -1; y <= 1; y++) + { + const half2 sampleUV = uv + half2(x, y) * offset; + const half4 sampleColor = SAMPLE_TEXTURE2D(source, sampler_source, sampleUV); + + accumulatedColor += sampleColor; + accumulatedWeight += 1.0; + } + } + + half4 blurredColor = accumulatedColor / accumulatedWeight; + return blurredColor; + } + + half BlurHD_G(half bhqp, half x) + { + return exp(-(x * x) / (2.0 * bhqp * bhqp)); + } + half4 BlurHD(half2 uv, Texture2D source, SamplerState sampler_source, half BlurAmount, half xScale, half yScale) + { + int iterations = 16; + int halfIterations = iterations / 2; + half sigmaX = 0.1 + BlurAmount * 0.5; + half sigmaY = sigmaX; + half total = 0.0; + half4 ret = half4(0, 0, 0, 0); + for (int iy = 0; iy < iterations; ++iy) + { + half fy = BlurHD_G(sigmaY, half(iy) -half(halfIterations)); + half offsetY = half(iy - halfIterations) * 0.00390625 * xScale; + for (int ix = 0; ix < iterations; ++ix) + { + half fx = BlurHD_G(sigmaX, half(ix) - half(halfIterations)); + half offsetX = half(ix - halfIterations) * 0.00390625 * yScale; + total += fx * fy; + ret += SAMPLE_TEXTURE2D(source, sampler_source, uv + half2(offsetX, offsetY)) * fx * fy; + } + } + return ret / total; + } + //----------------------------------------------------------------------- + + + //------------------------------------------- + half RemapFloat(half inValue, half inMin, half inMax, half outMin, half outMax){ + return outMin + (inValue - inMin) * (outMax - outMin) / (inMax - inMin); + } + //------------------------------------------- + + //----------------------------------------------------------------------- + half rand(half2 seed, half offset) { + return (frac(sin(dot(seed, half2(12.9898, 78.233))) * 43758.5453) + offset) % 1.0; + } + + half rand2(half2 seed, half offset) { + return (frac(sin(dot(seed * floor(50 + (_Time.x % 1.0) * 12.), half2(127.1, 311.7))) * 43758.5453123) + offset) % 1.0; + } + + half rand2CustomTime(half2 seed, half offset, half customTime) { + return (frac(sin(dot(seed * floor(50 + (customTime % 1.0) * 12.), half2(127.1, 311.7))) * 43758.5453123) + offset) % 1.0; + } + //----------------------------------------------------------------------- + + + void Ext_ModifyVertex0 (inout VertexData v, inout ExtraV2F d) + { + //BILBOARD_ON + #if BILBOARD_ON + half3 camRight = mul((half3x3)unity_CameraToWorld, half3(1,0,0)); + half3 camUp = half3(0,1,0); + #if BILBOARDY_ON + camUp = mul((half3x3)unity_CameraToWorld, half3(0,1,0)); + #endif + half3 localPos = v.vertex.x * camRight + v.vertex.y * camUp; + v.vertex = half4(localPos, 1); + #endif + //----------------------------------------------------------- + + v.texcoord0.xy = TRANSFORM_TEX(v.texcoord0.xy, _MainTex); + half2 center = half2(0.5, 0.5); + #if ATLAS_ON + center = half2((_MaxXUV + _MinXUV) / 2.0, (_MaxYUV + _MinYUV) / 2.0); + #endif + + //POLARUV_ON + #if POLARUV_ON + v.texcoord0.xy = v.texcoord0.xy - center; + #endif + + //---------------------------------------- + + //ROTATEUV_ON + #if ROTATEUV_ON + half2 uvC = v.texcoord0.xy; + half cosAngle = cos(_RotateUvAmount); + half sinAngle = sin(_RotateUvAmount); + half2x2 rot = half2x2(cosAngle, -sinAngle, sinAngle, cosAngle); + uvC -= center; + v.texcoord0.xy = mul(rot, uvC); + v.texcoord0.xy += center; + #endif + //-------------------- + + #if RECTSIZE_ON + v.vertex.xyz += (v.vertex.xyz * (_RectSize - 1.0)); + #endif + + #if OUTTEX_ON + v.texcoord1.xy = TRANSFORM_TEX(v.texcoord0.xy, _OutlineTex); + #endif + + #if OUTDIST_ON + v.texcoord2.xy = TRANSFORM_TEX(v.texcoord0.xy, _OutlineDistortTex); + #endif + + #if DISTORT_ON + v.texcoord3.xy = TRANSFORM_TEX(v.texcoord0.xy, _DistortTex); + #endif + } + + void Ext_SurfaceFunction0 (inout Surface o, ShaderData d) + { + half randomSeed = _RandomSeed; + + float2 uvRect = d.texcoord0; + half2 center = half2(0.5, 0.5); + #if ATLAS_ON + center = half2((_MaxXUV + _MinXUV) / 2.0, (_MaxYUV + _MinYUV) / 2.0); + uvRect = half2((d.texcoord0.x - _MinXUV) / (_MaxXUV - _MinXUV), (d.texcoord0.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half2 centerTiled = half2(center.x * _MainTex_ST.x, center.y * _MainTex_ST.y); + + //CLIPPING_ON + #if CLIPPING_ON + half2 tiledUv = half2(d.texcoord0.x / _MainTex_ST.x, d.texcoord0.y / _MainTex_ST.y); + #if ATLAS_ON + tiledUv = half2((tiledUv.x - _MinXUV) / (_MaxXUV - _MinXUV), (tiledUv.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + clip((1 - _ClipUvUp) - tiledUv.y); + clip(tiledUv.y - _ClipUvDown); + clip((1 - _ClipUvRight) - tiledUv.x); + clip(tiledUv.x - _ClipUvLeft); + #endif + //---------------------------------- + + //RADIALCLIPPING_ON + #if RADIALCLIPPING_ON + half2 tiledUv2 = half2(d.texcoord0.x / _MainTex_ST.x, d.texcoord0.y / _MainTex_ST.y); + #if ATLAS_ON + tiledUv2 = half2((tiledUv2.x - _MinXUV) / (_MaxXUV - _MinXUV), (tiledUv2.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half startAngle = _RadialStartAngle - _RadialClip; + half endAngle = _RadialStartAngle + _RadialClip2; + half offset0 = clamp(0, 360, startAngle + 360); + half offset360 = clamp(0, 360, endAngle - 360); + half2 atan2Coord = half2(lerp(-1, 1, tiledUv2.x), lerp(-1, 1, tiledUv2.y)); + half atanAngle = atan2(atan2Coord.y, atan2Coord.x) * 57.3; // angle in degrees + if(atanAngle < 0) atanAngle = 360 + atanAngle; + if(atanAngle >= startAngle && atanAngle <= endAngle) discard; + if(atanAngle <= offset360) discard; + if(atanAngle >= offset0) discard; + #endif + + //----------------------------- + + //TEXTURESCROLL_ON && ATLAS_ON + #if TEXTURESCROLL_ON && ATLAS_ON + d.texcoord0.xy = half2(_MinXUV + ((_MaxXUV - _MinXUV) * (abs(((_Time.y + randomSeed) * _TextureScrollXSpeed) + uvRect.x) % 1)), + _MinYUV + ((_MaxYUV - _MinYUV) * (abs(((_Time.y + randomSeed) * _TextureScrollYSpeed) + uvRect.y) % 1))); + #endif + //---------------------------- + + //OFFSETUV_ON + #if OFFSETUV_ON + #if ATLAS_ON + d.texcoord0.xy = half2(_MinXUV + ((_MaxXUV - _MinXUV) * (abs((_OffsetUvX + uvRect.x) % 1))), + _MinYUV + ((_MaxYUV - _MinYUV) * (abs(_OffsetUvY + uvRect.y) % 1))); + #else + d.texcoord0.xy += half2(_OffsetUvX, _OffsetUvY); + #endif + #endif + + //---------------------- + + //POLARUV_ON + #if POLARUV_ON + d.texcoord0.xy = half2(atan2(d.texcoord0.y, d.texcoord0.x) / (2.0f * 3.141592653589f), length(d.texcoord0.xy)); + d.texcoord0.xy *= _MainTex_ST.xy; + #endif + + //-------------------------------------- + + //TWISTUV_ON + #if TWISTUV_ON + #if ATLAS_ON + _TwistUvPosX = ((_MaxXUV - _MinXUV) * _TwistUvPosX) + _MinXUV; + _TwistUvPosY = ((_MaxYUV - _MinYUV) * _TwistUvPosY) + _MinYUV; + #endif + half2 tempUv = d.texcoord0.xy - half2(_TwistUvPosX * _MainTex_ST.x, _TwistUvPosY * _MainTex_ST.y); + _TwistUvRadius *= (_MainTex_ST.x + _MainTex_ST.y) / 2; + half percent = (_TwistUvRadius - length(tempUv)) / _TwistUvRadius; + half theta = percent * percent * (2.0 * sin(_TwistUvAmount)) * 8.0; + half s = sin(theta); + half c = cos(theta); + half beta = max(sign(_TwistUvRadius - length(tempUv)), 0.0); + tempUv = half2(dot(tempUv, half2(c, -s)), dot(tempUv, half2(s, c))) * beta + tempUv * (1 - beta); + tempUv += half2(_TwistUvPosX * _MainTex_ST.x, _TwistUvPosY * _MainTex_ST.y); + d.texcoord0.xy = tempUv; + #endif + + //-------------------------------------------- + + //FISHEYE_ON + #if FISHEYE_ON + half bind = length(centerTiled); + half2 dF = d.texcoord0.xy - centerTiled; + half dFlen = length(dF); + half fishInt = (3.14159265359 / bind) * (_FishEyeUvAmount + 0.001); + d.texcoord0.xy = centerTiled + (dF / (max(0.0001, dFlen))) * tan(dFlen * fishInt) * bind / tan(bind * fishInt); + #endif + //--------------------------------------------- + + //PINCH_ON + #if PINCH_ON + half2 dP = d.texcoord0.xy - centerTiled; + half pinchInt = (3.141592 / length(centerTiled)) * (-_PinchUvAmount + 0.001); + d.texcoord0.xy = centerTiled + normalize(dP) * atan(length(dP) * -pinchInt * 10.0) * 0.5 / atan(-pinchInt * 5); + #endif + + //--------------------------------------------- + + //ZOOMUV_ON + #if ZOOMUV_ON + d.texcoord0.xy -= centerTiled; + d.texcoord0.xy = d.texcoord0.xy * _ZoomUvAmount; + d.texcoord0.xy += centerTiled; + #endif + + //----------------------------------------------- + + //DOODLE_ON + #if DOODLE_ON + half2 uvCopy = uvRect; + _HandDrawnSpeed = (floor((_Time.x + randomSeed) * 20 * _HandDrawnSpeed) / _HandDrawnSpeed) * _HandDrawnSpeed; + uvCopy.x = sin((uvCopy.x * _HandDrawnAmount + _HandDrawnSpeed) * 4); + uvCopy.y = cos((uvCopy.y * _HandDrawnAmount + _HandDrawnSpeed) * 4); + d.texcoord0.xy = lerp(d.texcoord0.xy, d.texcoord0.xy + uvCopy, 0.0005 * _HandDrawnAmount); + #endif + + //-------------------------- + + //SHAKEUV_ON + #if SHAKEUV_ON + half xShake = sin((_Time.x + randomSeed) * _ShakeUvSpeed * 50) * _ShakeUvX; + half yShake = cos((_Time.x + randomSeed) * _ShakeUvSpeed * 50) * _ShakeUvY; + d.texcoord0.xy += half2(xShake * 0.012, yShake * 0.01); + #endif + + //------------------------------------------- + + //RECTSIZE_ON + #if RECTSIZE_ON + d.texcoord0.xy = d.texcoord0.xy * (_RectSize).xx + (((-_RectSize * 0.5) + 0.5)).xx; + #endif + + //------------------------------------------- + + //DISTORT_ON + #if DISTORT_ON + #if ATLAS_ON + d.texcoord3.x = d.texcoord3.x * (1 / (_MaxXUV - _MinXUV)); + d.texcoord3.y = d.texcoord3.y * (1 / (_MaxYUV - _MinYUV)); + #endif + + d.texcoord3.x += ((_Time.x + _RandomSeed) * _DistortTexXSpeed) % 1; + d.texcoord3.y += ((_Time.x + _RandomSeed) * _DistortTexYSpeed) % 1; + half distortAmnt = (SAMPLE_TEXTURE2D(_DistortTex, sampler_DistortTex, d.texcoord3.xy).r - 0.5) * 0.2 * _DistortAmount; + d.texcoord0.x += distortAmnt; + d.texcoord0.y += distortAmnt; + #endif + //------------------------------------------------------- + + //WARP_ON + #if WARP_ON + half2 warpUv = half2(d.texcoord0.x / _MainTex_ST.x, d.texcoord0.y / _MainTex_ST.y); + #if ATLAS_ON + warpUv = half2((warpUv.x - _MinXUV) / (_MaxXUV - _MinXUV), (warpUv.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + const float tau = 6.283185307179586; + float xWarp = (_Time.y + randomSeed) * _WarpSpeed + warpUv.x * tau / _WarpScale; + float yWarp = (_Time.y + randomSeed) * _WarpSpeed + warpUv.y * tau / _WarpScale; + float2 warp = float2(sin(xWarp), sin(yWarp)) * _WarpStrength; + d.texcoord0.xy += warp; + #endif + + //------------------------------------------------------- + + //WAVEUV_ON + #if WAVEUV_ON + float2 uvWave = half2(_WaveX * _MainTex_ST.x, _WaveY * _MainTex_ST.y) - d.texcoord0.xy; + uvWave %= 1; + #if ATLAS_ON + uvWave = half2(_WaveX, _WaveY) - uvRect; + #endif + uvWave.x *= _ScreenParams.x / _ScreenParams.y; + float waveTime = _Time.y + randomSeed; + float angWave = (sqrt(dot(uvWave, uvWave)) * _WaveAmount) - ((waveTime * _WaveSpeed)); + d.texcoord0.xy = d.texcoord0.xy + uvWave * sin(angWave) * (_WaveStrength / 1000.0); + #endif + //---------------------------------------------------- + + //ROUNDWAVEUV_ON + #if ROUNDWAVEUV_ON + half xWave = ((0.5 * _MainTex_ST.x) - uvRect.x); + half yWave = ((0.5 * _MainTex_ST.y) - uvRect.y) * (_MainTex_TexelSize.w / _MainTex_TexelSize.z); + half ripple = -sqrt(xWave*xWave + yWave* yWave); + d.texcoord0.xy += (sin((ripple + (_Time.y + randomSeed) * (_RoundWaveSpeed/10.0)) / 0.015) * (_RoundWaveStrength/10.0)) % 1; + #endif + //---------------------------------------------------- + + + //WIND_ON + #if WIND_ON + half windOffset = sin((_Time.x + randomSeed) * _GrassSpeed * 10); + half2 windCenter = half2(0.5, 0.1); + #if ATLAS_ON + windCenter.x = ((_MaxXUV - _MinXUV) * windCenter.x) + _MinXUV; + windCenter.y = ((_MaxYUV - _MinYUV) * windCenter.y) + _MinYUV; + #endif + #if !MANUALWIND_ON + d.texcoord0.x = fmod(abs(lerp(d.texcoord0.x, d.texcoord0.x + (_GrassWind * 0.01 * windOffset), uvRect.y)), 1); + #else + d.texcoord0.x = fmod(abs(lerp(d.texcoord0.x, d.texcoord0.x + (_GrassWind * 0.01 * _GrassManualAnim), uvRect.y)), 1); + windOffset = _GrassManualAnim; + #endif + half2 delta = d.texcoord0.xy - windCenter; + half delta2 = dot(delta.xy, delta.xy); + half2 delta_offset = delta2 * windOffset; + d.texcoord0.xy = d.texcoord0.xy + half2(delta.y, -delta.x) * delta_offset * _GrassRadialBend; + #endif + + //-------------------------------------------------------- + + //TEXTURESCROLL_ON && !ATLAS_ON + #if TEXTURESCROLL_ON && !ATLAS_ON + d.texcoord0.x += ((_Time.y + randomSeed) * _TextureScrollXSpeed) % 1; + d.texcoord0.y += ((_Time.y + randomSeed) * _TextureScrollYSpeed) % 1; + #endif + //------------------------------ + + //PIXELATE_ON + #if PIXELATE_ON + half aspectRatio = _MainTex_TexelSize.x / _MainTex_TexelSize.y; + half2 pixelSize = float2(_PixelateSize, _PixelateSize * aspectRatio); + d.texcoord0.xy = floor(d.texcoord0.xy * pixelSize) / pixelSize; + #endif + //-------------- + + half4 col = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy); + half originalAlpha = col.a; + col *= d.vertexColor; + + //NORMAL MAP + #if NORMALMAP_ON + half4 normalSample = SAMPLE_TEXTURE2D(_NormalMap, sampler_NormalMap, d.texcoord0.xy); + half3 normalTS = UnpackNormal(normalSample); + normalTS.xy *= _NormalStrength; + o.Normal = normalTS; + #endif + + + //GLITCH_ON + #if GLITCH_ON + half2 uvGlitch = uvRect; + uvGlitch.y -= 0.5; + half lineNoise = pow(rand2(floor(uvGlitch * half2(24., 19.) * _GlitchSize) * 4.0, randomSeed), 3.0) * _GlitchAmount + * pow(rand2(floor(uvGlitch * half2(38., 14.) * _GlitchSize) * 4.0, randomSeed), 3.0); + col = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(lineNoise * 0.02 * rand2(half2(2.0, 1), randomSeed), 0)) * d.vertexColor; + #endif + //-------------------------------------- + + //CHROMABERR_ON + #if CHROMABERR_ON + half4 r = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(_ChromAberrAmount/10, 0)) * d.vertexColor; + half4 b = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(-_ChromAberrAmount/10, 0)) * d.vertexColor; + col = half4(r.r * r.a, col.g, b.b * b.a, max(max(r.a, b.a) * _ChromAberrAlpha, col.a)); + #endif + + //-------------------------------- + + //BLUR_ON + #if BLUR_ON + #if ATLAS_ON + #if !BLURISHD_ON + col = BlurHD(d.texcoord0.xy, _MainTex, sampler_MainTex, _BlurIntensity, (_MaxXUV - _MinXUV), (_MaxYUV - _MinYUV)) * d.vertexColor; + #else + col = Blur(d.texcoord0.xy, _MainTex, sampler_MainTex, _BlurIntensity * (_MaxXUV - _MinXUV)) * d.vertexColor; + #endif + #else + #if !BLURISHD_ON + col = BlurHD(d.texcoord0.xy, _MainTex, sampler_MainTex, _BlurIntensity, 1, 1) * d.vertexColor; + #else + col = Blur(d.texcoord0.xy, _MainTex, sampler_MainTex, _BlurIntensity) * d.vertexColor; + #endif + #endif + #endif + + //-------------------- + + //MOTIONBLUR_ON + #if MOTIONBLUR_ON + _MotionBlurAngle = _MotionBlurAngle * 3.1415926; + #define rot(n) mul(n, half2x2(cos(_MotionBlurAngle), -sin(_MotionBlurAngle), sin(_MotionBlurAngle), cos(_MotionBlurAngle))) + _MotionBlurDist = _MotionBlurDist * 0.005; + #if ATLAS_ON + _MotionBlurDist *= (_MaxXUV - _MinXUV); + #endif + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(-_MotionBlurDist, -_MotionBlurDist))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(-_MotionBlurDist * 2, -_MotionBlurDist * 2))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(-_MotionBlurDist * 3, -_MotionBlurDist * 3))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(-_MotionBlurDist * 4, -_MotionBlurDist * 4))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(_MotionBlurDist, _MotionBlurDist))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(_MotionBlurDist * 2, _MotionBlurDist * 2))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(_MotionBlurDist * 3, _MotionBlurDist * 3))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(_MotionBlurDist * 4, _MotionBlurDist * 4))); + col.rgb = col.rgb / 9; + #endif + //------------------------------------ + + //NEGATIVE_ON + #if NEGATIVE_ON + col.rgb = lerp(col.rgb, 1 - col.rgb, _NegativeAmount); + #endif + + //-------------- + half luminance = 0; + + //GREYSCALE_ON && !GREYSCALEOUTLINE_ON + #if GREYSCALE_ON && !GREYSCALEOUTLINE_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + luminance = saturate(luminance + _GreyscaleLuminosity); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _GreyscaleTintColor, _GreyscaleBlend); + #endif + //------------------------------------ + + //GHOST_ON + #if GHOST_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + half4 ghostResult; + ghostResult.a = saturate(luminance - _GhostTransparency) * col.a; + ghostResult.rgb = col.rgb * (luminance + _GhostColorBoost); + col = lerp(col, ghostResult, _GhostBlend); + #endif + //------------------------------------ + + //INNEROUTLINE_ON + #if INNEROUTLINE_ON + half3 innerT = abs(GetPixel(0, _InnerOutlineThickness, d.texcoord0.xy, _MainTex, sampler_MainTex) - GetPixel(0, -_InnerOutlineThickness, d.texcoord0.xy, _MainTex, sampler_MainTex)); + innerT += abs(GetPixel(_InnerOutlineThickness, 0, d.texcoord0.xy, _MainTex, sampler_MainTex) - GetPixel(-_InnerOutlineThickness, 0, d.texcoord0.xy, _MainTex, sampler_MainTex)); + #if !ONLYINNEROUTLINE_ON + innerT = (innerT / 2.0) * col.a * _InnerOutlineAlpha; + col.rgb += length(innerT) * _InnerOutlineColor.rgb * _InnerOutlineGlow; + #else + innerT *= col.a * _InnerOutlineAlpha; + col.rgb = length(innerT) * _InnerOutlineColor.rgb * _InnerOutlineGlow; + col.a = step(0.3, col.r+col.g+col.b); + #endif + #endif + //------------------------------------------------------- + + //HITEFFECT_ON + #if HITEFFECT_ON + col.rgb = lerp(col.rgb, _HitEffectColor.rgb * _HitEffectGlow, _HitEffectBlend); + #endif + //-------------------- + + //GRADIENT_ON + #if GRADIENT_ON + half2 tiledUvGrad = half2(uvRect.x / _MainTex_ST.x, uvRect.y / _MainTex_ST.y); + #if GRADIENT2COL_ON + _GradTopRightCol = _GradTopLeftCol; + _GradBotRightCol = _GradBotLeftCol; + #endif + #if RADIALGRADIENT_ON + half radialDist = 1 - length(tiledUvGrad - half2(0.5, 0.5)); + radialDist *= (_MainTex_TexelSize.w / _MainTex_TexelSize.z); + radialDist = saturate(_GradBoostX * radialDist); + half4 gradientResult = lerp(_GradTopLeftCol, _GradBotLeftCol, radialDist); + #else + half gradXLerpFactor = saturate(pow(tiledUvGrad.x, _GradBoostX)); + half4 gradientResult = lerp(lerp(_GradBotLeftCol, _GradBotRightCol, gradXLerpFactor), + lerp(_GradTopLeftCol, _GradTopRightCol, gradXLerpFactor), saturate(pow(tiledUvGrad.y, _GradBoostY))); + #endif + gradientResult = lerp(col, gradientResult, _GradBlend); + col.rgb = gradientResult.rgb * col.a; + col.a *= gradientResult.a; + #endif + //-------------------------------------------------------------------- + + //CONTRAST_ON + #if CONTRAST_ON + col.rgb = (col.rgb - float3(0.5, 0.5, 0.5)) * _Contrast + float3(0.5, 0.5, 0.5); + col.rgb += _Brightness; + #endif + + //------------------------------------------------------------------- + + //COLORSWAP_ON + #if COLORSWAP_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + half4 swapMask = SAMPLE_TEXTURE2D(_ColorSwapTex, sampler_ColorSwapTex, d.texcoord0.xy); + swapMask.rgb *= swapMask.a; + half3 redSwap = _ColorSwapRed * swapMask.r * saturate(luminance + _ColorSwapRedLuminosity); + half3 greenSwap = _ColorSwapGreen * swapMask.g * saturate(luminance + _ColorSwapGreenLuminosity); + half3 blueSwap = _ColorSwapBlue * swapMask.b * saturate(luminance + _ColorSwapBlueLuminosity); + swapMask.rgb = col.rgb * saturate(1 - swapMask.r - swapMask.g - swapMask.b); + col.rgb = lerp(col.rgb, swapMask.rgb + redSwap + greenSwap + blueSwap, _ColorSwapBlend); + #endif + //-------------------------------------------------------------------- + + //COLORRAMP_ON && !COLORRAMPOUTLINE_ON + #if COLORRAMP_ON && !COLORRAMPOUTLINE_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + luminance = saturate(luminance + _ColorRampLuminosity); + #if GRADIENTCOLORRAMP_ON + col.rgb = lerp(col.rgb, SAMPLE_TEXTURE2D(_ColorRampTexGradient, sampler_ColorRampTexGradient, half2(luminance, 0)).rgb, _ColorRampBlend); + #else + col.rgb = lerp(col.rgb, SAMPLE_TEXTURE2D(_ColorRampTex, sampler_ColorRampTex, half2(luminance, 0)).rgb, _ColorRampBlend); + #endif + #endif + //-------------------------------------------------------------------- + + //CHANGECOLOR_ON + #if CHANGECOLOR_ON + float3 currChangeColor = saturate(col.rgb); + luminance = 0.3 * currChangeColor.r + 0.59 * currChangeColor.g + 0.11 * currChangeColor.b; + luminance = saturate(luminance + _ColorChangeLuminosity); + half3 dif = abs(currChangeColor - _ColorChangeTarget.rgb); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _ColorChangeNewCol.rgb, + max(sign(1 - saturate(dif.x + dif.y + dif.z) - _ColorChangeTolerance), 0.0)); + #if CHANGECOLOR2_ON + dif = abs(currChangeColor - _ColorChangeTarget2.rgb); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _ColorChangeNewCol2.rgb, + max(sign(1 - saturate(dif.x + dif.y + dif.z) - _ColorChangeTolerance2), 0.0)); + #endif + #if CHANGECOLOR3_ON + dif = abs(currChangeColor - _ColorChangeTarget3.rgb); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _ColorChangeNewCol3.rgb, + max(sign(1 - saturate(dif.x + dif.y + dif.z) - _ColorChangeTolerance3), 0.0)); + #endif + #endif + //------------------------------------------------------- + + //POSTERIZE_ON && !POSTERIZEOUTLINE_ON + #if POSTERIZE_ON && !POSTERIZEOUTLINE_ON + col.rgb = pow(col.rgb, _PosterizeGamma) * _PosterizeNumColors; + col.rgb = floor(col.rgb) / _PosterizeNumColors; + col.rgb = pow(col.rgb, 1.0 / _PosterizeGamma); + #endif + //------------------------------------ + + //HSV_ON + #if HSV_ON + half3 resultHsv = half3(col.rgb); + half cosHsv = _HsvBright * _HsvSaturation * cos(_HsvShift * 3.14159265 / 180); + half sinHsv = _HsvBright * _HsvSaturation * sin(_HsvShift * 3.14159265 / 180); + resultHsv.x = (.299 * _HsvBright + .701 * cosHsv + .168 * sinHsv) * col.x + + (.587 * _HsvBright - .587 * cosHsv + .330 * sinHsv) * col.y + + (.114 * _HsvBright - .114 * cosHsv - .497 * sinHsv) * col.z; + resultHsv.y = (.299 * _HsvBright - .299 * cosHsv - .328 * sinHsv) *col.x + + (.587 * _HsvBright + .413 * cosHsv + .035 * sinHsv) * col.y + + (.114 * _HsvBright - .114 * cosHsv + .292 * sinHsv) * col.z; + resultHsv.z = (.299 * _HsvBright - .3 * cosHsv + 1.25 * sinHsv) * col.x + + (.587 * _HsvBright - .588 * cosHsv - 1.05 * sinHsv) * col.y + + (.114 * _HsvBright + .886 * cosHsv - .203 * sinHsv) * col.z; + col.rgb = resultHsv; + #endif + //------------------------------------------------------- + + //OVERLAY_ON + #if OVERLAY_ON + half2 overlayUvs = d.texcoord0.xy; + overlayUvs.x += ((_Time.y + randomSeed) * _OverlayTextureScrollXSpeed) % 1; + overlayUvs.y += ((_Time.y + randomSeed) * _OverlayTextureScrollYSpeed) % 1; + half4 overlayCol = SAMPLE_TEXTURE2D(_OverlayTex, sampler_OverlayTex, TRANSFORM_TEX(overlayUvs, _OverlayTex)); + overlayCol.rgb *= _OverlayColor.rgb * _OverlayGlow; + #if !OVERLAYMULT_ON + overlayCol.rgb *= overlayCol.a * _OverlayColor.rgb * _OverlayColor.a * _OverlayBlend; + col.rgb += overlayCol.rgb; + #else + overlayCol.a *= _OverlayColor.a; + col = lerp(col, col * overlayCol, _OverlayBlend); + #endif + #endif + + //--------------------------------- + + //OUTBASE_ON + #if OUTBASE_ON + #if OUTBASEPIXELPERF_ON + half2 destUv = half2(_OutlinePixelWidth * _MainTex_TexelSize.x, _OutlinePixelWidth * _MainTex_TexelSize.y); + #else + half2 destUv = half2(_OutlineWidth * _MainTex_TexelSize.x * 200, _OutlineWidth * _MainTex_TexelSize.y * 200); + #endif + + #if OUTDIST_ON + d.texcoord3.x += ((_Time.x + _RandomSeed) * _OutlineDistortTexXSpeed) % 1; + d.texcoord3.y += ((_Time.x + _RandomSeed) * _OutlineDistortTexYSpeed) % 1; + #if ATLAS_ON + d.texcoord3 = half2((d.texcoord3.x - _MinXUV) / (_MaxXUV - _MinXUV), (d.texcoord3.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half outDistortAmnt = (SAMPLE_TEXTURE2D(_OutlineDistortTex, sampler_OutlineDistortTex, d.texcoord3).r - 0.5) * 0.2 * _OutlineDistortAmount; + destUv.x += outDistortAmnt; + destUv.y += outDistortAmnt; + #endif + + half spriteLeft = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(destUv.x, 0)).a; + half spriteRight = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy - half2(destUv.x, 0)).a; + half spriteBottom = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(0, destUv.y)).a; + half spriteTop = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy - half2(0, destUv.y)).a; + half result = spriteLeft + spriteRight + spriteBottom + spriteTop; + + #if OUTBASE8DIR_ON + half spriteTopLeft = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(destUv.x, destUv.y)).a; + half spriteTopRight = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(-destUv.x, destUv.y)).a; + half spriteBotLeft = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(destUv.x, -destUv.y)).a; + half spriteBotRight = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(-destUv.x, -destUv.y)).a; + result = result + spriteTopLeft + spriteTopRight + spriteBotLeft + spriteBotRight; + #endif + + result = step(0.05, saturate(result)); + + #if OUTTEX_ON + d.texcoord1.x += ((_Time.x + _RandomSeed) * _OutlineTexXSpeed) % 1; + d.texcoord1.y += ((_Time.x + _RandomSeed) * _OutlineTexYSpeed) % 1; + #if ATLAS_ON + d.texcoord1 = half2((d.texcoord1.x - _MinXUV) / (_MaxXUV - _MinXUV), (d.texcoord1.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half4 tempOutColor = SAMPLE_TEXTURE2D(_OutlineTex, sampler_OutlineTex, d.texcoord1); + tempOutColor *= _OutlineColor; + _OutlineColor = tempOutColor; + #endif + + result *= (1 - originalAlpha) * _OutlineAlpha; + + half4 outline = _OutlineColor * d.vertexColor.a; + outline.rgb *= _OutlineGlow; + outline.a = result; + #if ONLYOUTLINE_ON + col = outline; + #else + col = lerp(col, outline, result); + #endif + #endif + //------------------------------------------------------- + + //FADE_ON + #if FADE_ON + half2 tiledUvFade1 = TRANSFORM_TEX(d.texcoord0, _FadeTex); + half2 tiledUvFade2 = TRANSFORM_TEX(d.texcoord0, _FadeBurnTex); + #if ATLAS_ON + tiledUvFade1 = half2((tiledUvFade1.x - _MinXUV) / (_MaxXUV - _MinXUV), (tiledUvFade1.y - _MinYUV) / (_MaxYUV - _MinYUV)); + tiledUvFade2 = half2((tiledUvFade2.x - _MinXUV) / (_MaxXUV - _MinXUV), (tiledUvFade2.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half fadeTemp = SAMPLE_TEXTURE2D(_FadeTex, sampler_FadeTex, tiledUvFade1).r; + half fade = smoothstep(_FadeAmount, _FadeAmount + _FadeBurnTransition, fadeTemp); + half fadeBurn = saturate(smoothstep(_FadeAmount - _FadeBurnWidth, _FadeAmount - _FadeBurnWidth + 0.1, fadeTemp) * _FadeAmount); + col.a *= fade; + _FadeBurnColor.rgb *= _FadeBurnGlow; + col += fadeBurn * SAMPLE_TEXTURE2D(_FadeBurnTex, sampler_FadeBurnTex, tiledUvFade2) * _FadeBurnColor * originalAlpha * (1 - col.a); + #endif + //------------------------------------------------------- + + //SHADOW_ON + #if SHADOW_ON + half shadowA = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(_ShadowX, _ShadowY)).a; + half preMultShadowMask = 1 - (saturate(shadowA - col.a) * (1 - col.a)); + col.rgb *= 1 - ((shadowA - col.a) * (1 - col.a)); + col.rgb += (_ShadowColor * shadowA) * (1 - col.a); + col.a = max(shadowA * _ShadowAlpha * d.vertexColor.a, col.a); + #endif + + //------------------------------------------------------- + + //GLOW_ON + #if GLOW_ON + half4 emission; + #if GLOWTEX_ON + emission = SAMPLE_TEXTURE2D(_GlowTex, sampler_GlowTex, d.texcoord0); + #else + emission = col; + #endif + + col.rgb *= _GlowGlobal; + emission.rgb *= emission.a * col.a * _Glow * _GlowColor; + col.rgb += emission.rgb; + #endif + //------------------------------------------------------- + + //COLORRAMP_ON && COLORRAMPOUTLINE_ON + #if COLORRAMP_ON && COLORRAMPOUTLINE_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + luminance = saturate(luminance + _ColorRampLuminosity); + #if GRADIENTCOLORRAMP_ON + col.rgb = lerp(col.rgb, SAMPLE_TEXTURE2D(_ColorRampTexGradient, sampler_ColorRampTexGradient, half2(luminance, 0)).rgb, _ColorRampBlend); + #else + col.rgb = lerp(col.rgb, SAMPLE_TEXTURE2D(_ColorRampTex, sampler_ColorRampTex, half2(luminance, 0)).rgb, _ColorRampBlend); + #endif + #endif + //--------------- + + //GREYSCALE_ON && GREYSCALEOUTLINE_ON + #if GREYSCALE_ON && GREYSCALEOUTLINE_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + luminance = saturate(luminance + _GreyscaleLuminosity); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _GreyscaleTintColor, _GreyscaleBlend); + #endif + + //----------------------------------- + + //POSTERIZE_ON && POSTERIZEOUTLINE_ON + #if POSTERIZE_ON && POSTERIZEOUTLINE_ON + col.rgb = pow(col.rgb, _PosterizeGamma) * _PosterizeNumColors; + col.rgb = floor(col.rgb) / _PosterizeNumColors; + col.rgb = pow(col.rgb, 1.0 / _PosterizeGamma); + #endif + + //----------------------------------- + + //SHINE_ON + #if SHINE_ON + half2 uvShine = uvRect; + half cosAngle = cos(_ShineRotate); + half sinAngle = sin(_ShineRotate); + half2x2 rot = half2x2(cosAngle, -sinAngle, sinAngle, cosAngle); + uvShine -= half2(0.5, 0.5); + uvShine = mul(rot, uvShine); + uvShine += half2(0.5, 0.5); + half shineMask = SAMPLE_TEXTURE2D(_ShineMask, sampler_ShineMask, d.texcoord0.xy).a; + half currentDistanceProjection = (uvShine.x + uvShine.y) / 2; + half whitePower = 1 - (abs(currentDistanceProjection - _ShineLocation) / _ShineWidth); + col.rgb += col.a * whitePower * _ShineGlow * max(sign(currentDistanceProjection - (_ShineLocation - _ShineWidth)), 0.0) + * max(sign((_ShineLocation + _ShineWidth) - currentDistanceProjection), 0.0) * _ShineColor * shineMask; + #endif + + //----------------------------------- + + //HOLOGRAM_ON + #if HOLOGRAM_ON + half totalHologram = _HologramStripesAmount + _HologramUnmodAmount; + half hologramYCoord = ((uvRect.y + (((_Time.x + randomSeed) % 1) * _HologramStripesSpeed)) % totalHologram) / totalHologram; + hologramYCoord = abs(hologramYCoord); + half alpha = RemapFloat(saturate(hologramYCoord - (_HologramUnmodAmount/totalHologram)), 0.0, 1.0, _HologramMinAlpha, saturate(_HologramMaxAlpha)); + half hologramMask = max(sign((_HologramUnmodAmount/totalHologram) - hologramYCoord), 0.0); + half4 hologramResult = col; + hologramResult.a *= lerp(alpha, 1, hologramMask); + hologramResult.rgb *= max(1, _HologramMaxAlpha * max(sign(hologramYCoord - (_HologramUnmodAmount/totalHologram)), 0.0)); + hologramMask = 1 - step(0.01,hologramMask); + hologramResult.rgb += hologramMask * _HologramStripeColor * col.a; + col = lerp(col, hologramResult, _HologramBlend); + #endif + + //----------------------------------- + + //FLICKER_ON + #if FLICKER_ON + col.a *= saturate(col.a * step(frac(0.05 + (_Time.w + randomSeed) * _FlickerFreq), 1 - _FlickerPercent) + _FlickerAlpha); + #endif + //----------------------------------- + + //ALPHACUTOFF_ON + + //ALPHAROUND_ON + + //ALPHAOUTLINE_ON + #if ALPHAOUTLINE_ON + half alphaOutlineRes = pow(1 - col.a, max(_AlphaOutlinePower, 0.0001)) * step(_AlphaOutlineMinAlpha, col.a) * _AlphaOutlineBlend; + col.rgb = lerp(col.rgb, _AlphaOutlineColor.rgb * _AlphaOutlineGlow, alphaOutlineRes); + col.a = lerp(col.a, 1, alphaOutlineRes > 1); + #endif + //------------------------------------------------------- + + //FOG_ON + + //------------------ + + col *= _Color; + o.Albedo = col; + col.a *= _Alpha; + clip(col.a - _AlphaCutoffValue - 0.01); + o.Alpha = _Color.a; + } + + + + + + void ChainSurfaceFunction(inout Surface l, inout ShaderData d) + { + Ext_SurfaceFunction0(l, d); + // Ext_SurfaceFunction1(l, d); + // Ext_SurfaceFunction2(l, d); + // Ext_SurfaceFunction3(l, d); + // Ext_SurfaceFunction4(l, d); + // Ext_SurfaceFunction5(l, d); + // Ext_SurfaceFunction6(l, d); + // Ext_SurfaceFunction7(l, d); + // Ext_SurfaceFunction8(l, d); + // Ext_SurfaceFunction9(l, d); + // Ext_SurfaceFunction10(l, d); + // Ext_SurfaceFunction11(l, d); + // Ext_SurfaceFunction12(l, d); + // Ext_SurfaceFunction13(l, d); + // Ext_SurfaceFunction14(l, d); + // Ext_SurfaceFunction15(l, d); + // Ext_SurfaceFunction16(l, d); + // Ext_SurfaceFunction17(l, d); + // Ext_SurfaceFunction18(l, d); + // Ext_SurfaceFunction19(l, d); + // Ext_SurfaceFunction20(l, d); + // Ext_SurfaceFunction21(l, d); + // Ext_SurfaceFunction22(l, d); + // Ext_SurfaceFunction23(l, d); + // Ext_SurfaceFunction24(l, d); + // Ext_SurfaceFunction25(l, d); + // Ext_SurfaceFunction26(l, d); + // Ext_SurfaceFunction27(l, d); + // Ext_SurfaceFunction28(l, d); + // Ext_SurfaceFunction29(l, d); + } + +#if !_DECALSHADER + + void ChainModifyVertex(inout VertexData v, inout VertexToPixel v2p, float4 time) + { + ExtraV2F d; + + ZERO_INITIALIZE(ExtraV2F, d); + ZERO_INITIALIZE(Blackboard, d.blackboard); + // due to motion vectors in HDRP, we need to use the last + // time in certain spots. So if you are going to use _Time to adjust vertices, + // you need to use this time or motion vectors will break. + d.time = time; + + Ext_ModifyVertex0(v, d); + // Ext_ModifyVertex1(v, d); + // Ext_ModifyVertex2(v, d); + // Ext_ModifyVertex3(v, d); + // Ext_ModifyVertex4(v, d); + // Ext_ModifyVertex5(v, d); + // Ext_ModifyVertex6(v, d); + // Ext_ModifyVertex7(v, d); + // Ext_ModifyVertex8(v, d); + // Ext_ModifyVertex9(v, d); + // Ext_ModifyVertex10(v, d); + // Ext_ModifyVertex11(v, d); + // Ext_ModifyVertex12(v, d); + // Ext_ModifyVertex13(v, d); + // Ext_ModifyVertex14(v, d); + // Ext_ModifyVertex15(v, d); + // Ext_ModifyVertex16(v, d); + // Ext_ModifyVertex17(v, d); + // Ext_ModifyVertex18(v, d); + // Ext_ModifyVertex19(v, d); + // Ext_ModifyVertex20(v, d); + // Ext_ModifyVertex21(v, d); + // Ext_ModifyVertex22(v, d); + // Ext_ModifyVertex23(v, d); + // Ext_ModifyVertex24(v, d); + // Ext_ModifyVertex25(v, d); + // Ext_ModifyVertex26(v, d); + // Ext_ModifyVertex27(v, d); + // Ext_ModifyVertex28(v, d); + // Ext_ModifyVertex29(v, d); + + + // #if %EXTRAV2F0REQUIREKEY% + // v2p.extraV2F0 = d.extraV2F0; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // v2p.extraV2F1 = d.extraV2F1; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // v2p.extraV2F2 = d.extraV2F2; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // v2p.extraV2F3 = d.extraV2F3; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // v2p.extraV2F4 = d.extraV2F4; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // v2p.extraV2F5 = d.extraV2F5; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // v2p.extraV2F6 = d.extraV2F6; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // v2p.extraV2F7 = d.extraV2F7; + // #endif + } + + void ChainModifyTessellatedVertex(inout VertexData v, inout VertexToPixel v2p) + { + ExtraV2F d; + ZERO_INITIALIZE(ExtraV2F, d); + ZERO_INITIALIZE(Blackboard, d.blackboard); + + // #if %EXTRAV2F0REQUIREKEY% + // d.extraV2F0 = v2p.extraV2F0; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // d.extraV2F1 = v2p.extraV2F1; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // d.extraV2F2 = v2p.extraV2F2; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // d.extraV2F3 = v2p.extraV2F3; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // d.extraV2F4 = v2p.extraV2F4; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // d.extraV2F5 = v2p.extraV2F5; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // d.extraV2F6 = v2p.extraV2F6; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // d.extraV2F7 = v2p.extraV2F7; + // #endif + + + // Ext_ModifyTessellatedVertex0(v, d); + // Ext_ModifyTessellatedVertex1(v, d); + // Ext_ModifyTessellatedVertex2(v, d); + // Ext_ModifyTessellatedVertex3(v, d); + // Ext_ModifyTessellatedVertex4(v, d); + // Ext_ModifyTessellatedVertex5(v, d); + // Ext_ModifyTessellatedVertex6(v, d); + // Ext_ModifyTessellatedVertex7(v, d); + // Ext_ModifyTessellatedVertex8(v, d); + // Ext_ModifyTessellatedVertex9(v, d); + // Ext_ModifyTessellatedVertex10(v, d); + // Ext_ModifyTessellatedVertex11(v, d); + // Ext_ModifyTessellatedVertex12(v, d); + // Ext_ModifyTessellatedVertex13(v, d); + // Ext_ModifyTessellatedVertex14(v, d); + // Ext_ModifyTessellatedVertex15(v, d); + // Ext_ModifyTessellatedVertex16(v, d); + // Ext_ModifyTessellatedVertex17(v, d); + // Ext_ModifyTessellatedVertex18(v, d); + // Ext_ModifyTessellatedVertex19(v, d); + // Ext_ModifyTessellatedVertex20(v, d); + // Ext_ModifyTessellatedVertex21(v, d); + // Ext_ModifyTessellatedVertex22(v, d); + // Ext_ModifyTessellatedVertex23(v, d); + // Ext_ModifyTessellatedVertex24(v, d); + // Ext_ModifyTessellatedVertex25(v, d); + // Ext_ModifyTessellatedVertex26(v, d); + // Ext_ModifyTessellatedVertex27(v, d); + // Ext_ModifyTessellatedVertex28(v, d); + // Ext_ModifyTessellatedVertex29(v, d); + + // #if %EXTRAV2F0REQUIREKEY% + // v2p.extraV2F0 = d.extraV2F0; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // v2p.extraV2F1 = d.extraV2F1; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // v2p.extraV2F2 = d.extraV2F2; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // v2p.extraV2F3 = d.extraV2F3; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // v2p.extraV2F4 = d.extraV2F4; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // v2p.extraV2F5 = d.extraV2F5; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // v2p.extraV2F6 = d.extraV2F6; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // v2p.extraV2F7 = d.extraV2F7; + // #endif + } + + void ChainFinalColorForward(inout Surface l, inout ShaderData d, inout half4 color) + { + // Ext_FinalColorForward0(l, d, color); + // Ext_FinalColorForward1(l, d, color); + // Ext_FinalColorForward2(l, d, color); + // Ext_FinalColorForward3(l, d, color); + // Ext_FinalColorForward4(l, d, color); + // Ext_FinalColorForward5(l, d, color); + // Ext_FinalColorForward6(l, d, color); + // Ext_FinalColorForward7(l, d, color); + // Ext_FinalColorForward8(l, d, color); + // Ext_FinalColorForward9(l, d, color); + // Ext_FinalColorForward10(l, d, color); + // Ext_FinalColorForward11(l, d, color); + // Ext_FinalColorForward12(l, d, color); + // Ext_FinalColorForward13(l, d, color); + // Ext_FinalColorForward14(l, d, color); + // Ext_FinalColorForward15(l, d, color); + // Ext_FinalColorForward16(l, d, color); + // Ext_FinalColorForward17(l, d, color); + // Ext_FinalColorForward18(l, d, color); + // Ext_FinalColorForward19(l, d, color); + // Ext_FinalColorForward20(l, d, color); + // Ext_FinalColorForward21(l, d, color); + // Ext_FinalColorForward22(l, d, color); + // Ext_FinalColorForward23(l, d, color); + // Ext_FinalColorForward24(l, d, color); + // Ext_FinalColorForward25(l, d, color); + // Ext_FinalColorForward26(l, d, color); + // Ext_FinalColorForward27(l, d, color); + // Ext_FinalColorForward28(l, d, color); + // Ext_FinalColorForward29(l, d, color); + } + + void ChainFinalGBufferStandard(inout Surface s, inout ShaderData d, inout half4 GBuffer0, inout half4 GBuffer1, inout half4 GBuffer2, inout half4 outEmission, inout half4 outShadowMask) + { + // Ext_FinalGBufferStandard0(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard1(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard2(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard3(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard4(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard5(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard6(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard7(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard8(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard9(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard10(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard11(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard12(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard13(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard14(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard15(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard16(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard17(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard18(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard19(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard20(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard21(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard22(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard23(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard24(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard25(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard26(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard27(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard28(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard29(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + } +#endif + + + + + +#if _DECALSHADER + + ShaderData CreateShaderData(SurfaceDescriptionInputs IN) + { + ShaderData d = (ShaderData)0; + d.TBNMatrix = float3x3(IN.WorldSpaceTangent, IN.WorldSpaceBiTangent, IN.WorldSpaceNormal); + d.worldSpaceNormal = IN.WorldSpaceNormal; + d.worldSpaceTangent = IN.WorldSpaceTangent; + + d.worldSpacePosition = IN.WorldSpacePosition; + d.texcoord0 = IN.uv0.xyxy; + d.screenPos = IN.ScreenPosition; + + d.worldSpaceViewDir = normalize(_WorldSpaceCameraPos - d.worldSpacePosition); + + d.tangentSpaceViewDir = mul(d.TBNMatrix, d.worldSpaceViewDir); + + // these rarely get used, so we back transform them. Usually will be stripped. + #if _HDRP + // d.localSpacePosition = mul(GetWorldToObjectMatrix(), float4(GetCameraRelativePositionWS(d.worldSpacePosition), 1)).xyz; + #else + // d.localSpacePosition = mul(GetWorldToObjectMatrix(), float4(d.worldSpacePosition, 1)).xyz; + #endif + // d.localSpaceNormal = normalize(mul((float3x3)GetWorldToObjectMatrix(), d.worldSpaceNormal)); + // d.localSpaceTangent = normalize(mul((float3x3)GetWorldToObjectMatrix(), d.worldSpaceTangent.xyz)); + + // #if %SCREENPOSREQUIREKEY% + // d.screenUV = (IN.ScreenPosition.xy / max(0.01, IN.ScreenPosition.w)); + // #endif + + return d; + } +#else + + ShaderData CreateShaderData(VertexToPixel i + #if NEED_FACING + , bool facing + #endif + ) + { + ShaderData d = (ShaderData)0; + d.clipPos = i.pos; + d.worldSpacePosition = i.worldPos; + + d.worldSpaceNormal = normalize(i.worldNormal); + d.worldSpaceTangent.xyz = normalize(i.worldTangent.xyz); + + d.tangentSign = i.worldTangent.w * unity_WorldTransformParams.w; + float3 bitangent = cross(d.worldSpaceTangent.xyz, d.worldSpaceNormal) * d.tangentSign; + + d.TBNMatrix = float3x3(d.worldSpaceTangent, -bitangent, d.worldSpaceNormal); + d.worldSpaceViewDir = normalize(_WorldSpaceCameraPos - i.worldPos); + + d.tangentSpaceViewDir = mul(d.TBNMatrix, d.worldSpaceViewDir); + d.texcoord0 = i.texcoord0; + d.texcoord1 = i.texcoord1; + d.texcoord2 = i.texcoord2; + + // #if %TEXCOORD3REQUIREKEY% + d.texcoord3 = i.texcoord3; + // #endif + + // d.isFrontFace = facing; + // #if %VERTEXCOLORREQUIREKEY% + d.vertexColor = i.vertexColor; + // #endif + + // these rarely get used, so we back transform them. Usually will be stripped. + #if _HDRP + // d.localSpacePosition = mul(GetWorldToObjectMatrix(), float4(GetCameraRelativePositionWS(i.worldPos), 1)).xyz; + #else + // d.localSpacePosition = mul(GetWorldToObjectMatrix(), float4(i.worldPos, 1)).xyz; + #endif + // d.localSpaceNormal = normalize(mul((float3x3)GetWorldToObjectMatrix(), i.worldNormal)); + // d.localSpaceTangent = normalize(mul((float3x3)GetWorldToObjectMatrix(), i.worldTangent.xyz)); + + // #if %SCREENPOSREQUIREKEY% + // d.screenPos = i.screenPos; + // d.screenUV = (i.screenPos.xy / i.screenPos.w); + // #endif + + + // #if %EXTRAV2F0REQUIREKEY% + // d.extraV2F0 = i.extraV2F0; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // d.extraV2F1 = i.extraV2F1; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // d.extraV2F2 = i.extraV2F2; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // d.extraV2F3 = i.extraV2F3; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // d.extraV2F4 = i.extraV2F4; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // d.extraV2F5 = i.extraV2F5; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // d.extraV2F6 = i.extraV2F6; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // d.extraV2F7 = i.extraV2F7; + // #endif + + return d; + } + +#endif + + + #if defined(_PASSSHADOW) + float3 _LightDirection; + float3 _LightPosition; + #endif + + #if (_PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR))) + + #define GetWorldToViewMatrix() _ViewMatrix + #define UNITY_MATRIX_I_V _InvViewMatrix + #define GetViewToHClipMatrix() OptimizeProjectionMatrix(_ProjMatrix) + #define UNITY_MATRIX_I_P _InvProjMatrix + #define GetWorldToHClipMatrix() _ViewProjMatrix + #define UNITY_MATRIX_I_VP _InvViewProjMatrix + #define UNITY_MATRIX_UNJITTERED_VP _NonJitteredViewProjMatrix + #define UNITY_MATRIX_PREV_VP _PrevViewProjMatrix + #define UNITY_MATRIX_PREV_I_VP _PrevInvViewProjMatrix + + void MotionVectorPositionZBias(VertexToPixel input) + { + #if UNITY_REVERSED_Z + input.pos.z -= unity_MotionVectorsParams.z * input.pos.w; + #else + input.pos.z += unity_MotionVectorsParams.z * input.pos.w; + #endif + } + + #endif + + // vertex shader + VertexToPixel Vert (VertexData v) + { + VertexToPixel o = (VertexToPixel)0; + + UNITY_SETUP_INSTANCE_ID(v); + UNITY_TRANSFER_INSTANCE_ID(v, o); + UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o); + + + #if _URP && (_PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR))) + VertexData previousMesh = v; + #endif + #if !_TESSELLATION_ON + ChainModifyVertex(v, o, _Time); + #endif + + o.texcoord0 = v.texcoord0; + o.texcoord1 = v.texcoord1; + o.texcoord2 = v.texcoord2; + + // #if %TEXCOORD3REQUIREKEY% + o.texcoord3 = v.texcoord3; + // #endif + + // #if %VERTEXCOLORREQUIREKEY% + o.vertexColor = v.vertexColor; + // #endif + + // This return the camera relative position (if enable) + float3 positionWS = TransformObjectToWorld(v.vertex.xyz); + float3 normalWS = TransformObjectToWorldNormal(v.normal); + float4 tangentWS = float4(TransformObjectToWorldDir(v.tangent.xyz), v.tangent.w); + + VertexPositionInputs vertexInput = GetVertexPositionInputs(v.vertex.xyz); + o.worldPos = positionWS; + o.worldNormal = normalWS; + o.worldTangent = tangentWS; + + + // For some very odd reason, in 2021.2, we can't use Unity's defines, but have to use our own.. + #if _PASSSHADOW + #if _CASTING_PUNCTUAL_LIGHT_SHADOW + float3 lightDirectionWS = normalize(_LightPosition - o.worldPos); + #else + float3 lightDirectionWS = _LightDirection; + #endif + // Define shadow pass specific clip position for Universal + o.pos = TransformWorldToHClip(ApplyShadowBias(o.worldPos, o.worldNormal, lightDirectionWS)); + #if UNITY_REVERSED_Z + o.pos.z = min(o.pos.z, UNITY_NEAR_CLIP_VALUE); + #else + o.pos.z = max(o.pos.z, UNITY_NEAR_CLIP_VALUE); + #endif + #elif _PASSMETA + o.pos = MetaVertexPosition(float4(v.vertex.xyz, 0), v.texcoord1.xy, v.texcoord2.xy, unity_LightmapST, unity_DynamicLightmapST); + #else + o.pos = TransformWorldToHClip(o.worldPos); + #endif + + // #if %SCREENPOSREQUIREKEY% + // o.screenPos = ComputeScreenPos(o.pos, _ProjectionParams.x); + // #endif + + + #if _PASSFORWARD || _PASSGBUFFER + float2 uv1 = v.texcoord1.xy; + OUTPUT_LIGHTMAP_UV(uv1, unity_LightmapST, o.lightmapUV); + o.texcoord1.xy = uv1; + #if UNITY_VERSION < 60000009 + OUTPUT_SH(o.worldNormal, o.sh); + #endif + + #if defined(DYNAMICLIGHTMAP_ON) + o.dynamicLightmapUV.xy = v.texcoord2.xy * unity_DynamicLightmapST.xy + unity_DynamicLightmapST.zw; + #if UNITY_VERSION >= 60000009 + OUTPUT_SH(o.worldNormal, o.sh); + #endif + #elif (defined(PROBE_VOLUMES_L1) || defined(PROBE_VOLUMES_L2)) && UNITY_VERSION >= 60000009 + OUTPUT_SH4(vertexInput.positionWS, o.worldNormal.xyz, GetWorldSpaceNormalizeViewDir(vertexInput.positionWS), o.sh, o.probeOcclusion); + #endif + #endif + + #ifdef VARYINGS_NEED_FOG_AND_VERTEX_LIGHT + half fogFactor = 0; + #if defined(_FOG_FRAGMENT) + fogFactor = ComputeFogFactor(o.pos.z); + #endif + #if _BAKEDLIT + o.fogFactorAndVertexLight = half4(fogFactor, 0, 0, 0); + #else + half3 vertexLight = VertexLighting(o.worldPos, o.worldNormal); + o.fogFactorAndVertexLight = half4(fogFactor, vertexLight); + #endif + #endif + + #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR) + o.shadowCoord = GetShadowCoord(vertexInput); + #endif + + #if _URP && (_PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR))) + #if !defined(TESSELLATION_ON) + MotionVectorPositionZBias(o); + #endif + + o.previousPositionCS = float4(0.0, 0.0, 0.0, 1.0); + // Note: unity_MotionVectorsParams.y is 0 is forceNoMotion is enabled + bool forceNoMotion = unity_MotionVectorsParams.y == 0.0; + + if (!forceNoMotion) + { + #if defined(HAVE_VFX_MODIFICATION) + float3 previousPositionOS = currentFrameMvData.vfxParticlePositionOS; + #if defined(VFX_FEATURE_MOTION_VECTORS_VERTS) + const bool applyDeformation = false; + #else + const bool applyDeformation = true; + #endif + #else + const bool hasDeformation = unity_MotionVectorsParams.x == 1; // Mesh has skinned deformation + float3 previousPositionOS = hasDeformation ? previousMesh.previousPositionOS : previousMesh.vertex.xyz; + + #if defined(AUTOMATIC_TIME_BASED_MOTION_VECTORS) && defined(GRAPH_VERTEX_USES_TIME_PARAMETERS_INPUT) + const bool applyDeformation = true; + #else + const bool applyDeformation = hasDeformation; + #endif + #endif + // TODO + #if defined(FEATURES_GRAPH_VERTEX) + if (applyDeformation) + previousPositionOS = GetLastFrameDeformedPosition(previousMesh, currentFrameMvData, previousPositionOS); + else + previousPositionOS = previousMesh.positionOS; + + #if defined(FEATURES_GRAPH_VERTEX_MOTION_VECTOR_OUTPUT) + previousPositionOS -= previousMesh.precomputedVelocity; + #endif + #endif + + #if defined(UNITY_DOTS_INSTANCING_ENABLED) && defined(DOTS_DEFORMED) + // Deformed vertices in DOTS are not cumulative with built-in Unity skinning/blend shapes + // Needs to be called after vertex modification has been applied otherwise it will be + // overwritten by Compute Deform node + ApplyPreviousFrameDeformedVertexPosition(previousMesh.vertexID, previousPositionOS); + #endif + #if defined (_ADD_PRECOMPUTED_VELOCITY) + previousPositionOS -= previousMesh.precomputedVelocity; + #endif + o.positionCS = mul(UNITY_MATRIX_UNJITTERED_VP, float4(positionWS, 1.0f)); + + #if defined(HAVE_VFX_MODIFICATION) + #if defined(VFX_FEATURE_MOTION_VECTORS_VERTS) + #if defined(FEATURES_GRAPH_VERTEX_MOTION_VECTOR_OUTPUT) || defined(_ADD_PRECOMPUTED_VELOCITY) + #error Unexpected fast path rendering VFX motion vector while there are vertex modification afterwards. + #endif + o.previousPositionCS = VFXGetPreviousClipPosition(previousMesh, currentFrameMvData.vfxElementAttributes, o.positionCS); + #else + #if VFX_WORLD_SPACE + //previousPositionOS is already in world space + const float3 previousPositionWS = previousPositionOS; + #else + const float3 previousPositionWS = mul(UNITY_PREV_MATRIX_M, float4(previousPositionOS, 1.0f)).xyz; + #endif + o.previousPositionCS = mul(UNITY_MATRIX_PREV_VP, float4(previousPositionWS, 1.0f)); + #endif + #else + o.previousPositionCS = mul(UNITY_MATRIX_PREV_VP, mul(UNITY_PREV_MATRIX_M, float4(previousPositionOS, 1))); + #endif + } + #endif + + return o; + } + + + + + // fragment shader + void Frag (VertexToPixel IN + , out half4 outNormalWS : SV_Target0 + #ifdef _WRITE_RENDERING_LAYERS + , out float4 outRenderingLayers : SV_Target1 + #endif + #ifdef _DEPTHOFFSET_ON + , out float outputDepth : SV_Depth + #endif + #if NEED_FACING + , bool facing : SV_IsFrontFace + #endif + ) + { + UNITY_SETUP_INSTANCE_ID(IN); + UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX(IN); + + #if defined(LOD_FADE_CROSSFADE) + LODFadeCrossFade(IN.pos); + #endif + + ShaderData d = CreateShaderData(IN + #if NEED_FACING + , facing + #endif + ); + Surface l = (Surface)0; + + #ifdef _DEPTHOFFSET_ON + l.outputDepth = outputDepth; + #endif + + l.Albedo = half3(0.5, 0.5, 0.5); + l.Normal = float3(0,0,1); + l.Occlusion = 1; + l.Alpha = 1; + + ChainSurfaceFunction(l, d); + + #ifdef _DEPTHOFFSET_ON + outputDepth = l.outputDepth; + #endif + + #if defined(_GBUFFER_NORMALS_OCT) + float3 normalWS = d.worldSpaceNormal; + float2 octNormalWS = PackNormalOctQuadEncode(normalWS); // values between [-1, +1], must use fp32 on some platforms + float2 remappedOctNormalWS = saturate(octNormalWS * 0.5 + 0.5); // values between [ 0, 1] + half3 packedNormalWS = PackFloat2To888(remappedOctNormalWS); // values between [ 0, 1] + outNormalWS = half4(packedNormalWS, 0.0); + #else + float3 wsn = l.Normal; + #if !_WORLDSPACENORMAL + wsn = TangentToWorldSpace(d, l.Normal); + #endif + outNormalWS = half4(NormalizeNormalPerPixel(wsn), 0.0); + #endif + + #ifdef _WRITE_RENDERING_LAYERS + uint renderingLayers = GetMeshRenderingLayer(); + outRenderingLayers = float4(EncodeMeshRenderingLayer(renderingLayers), 0, 0, 0); + #endif + + + } + + ENDHLSL + + } + + + + Pass + { + Name "MotionVectors" + Tags + { + "LightMode" = "MotionVectors" + } + + // Render State + Cull Back + ZTest LEqual + ZWrite On + ColorMask RG + + Tags { "RenderType" = "Opaque" "Queue" = "Geometry" "PreviewType" = "Plane" } + Cull [_CullingOption] + ZWrite [_ZWrite] + ZTest [_ZTestMode] + + + HLSLPROGRAM + + #pragma vertex Vert + #pragma fragment Frag + + #define _PASSMOTIONVECTOR 1 + + #pragma target 3.5 + #pragma multi_compile_instancing + #pragma vertex vert + #pragma fragment frag + + #define SHADERPASS SHADERPASS_MOTION_VECTORS + #define RAYTRACING_SHADER_GRAPH_DEFAULT + #define VARYINGS_NEED_PASS + #define _PASSMOTIONVECTOR 1 + + + #pragma shader_feature_local GLOW_ON + #pragma shader_feature_local FADE_ON + #pragma shader_feature_local OUTBASE_ON + #pragma shader_feature_local ONLYOUTLINE_ON + #pragma shader_feature_local GRADIENT_ON + #pragma shader_feature_local GRADIENT2COL_ON + #pragma shader_feature_local RADIALGRADIENT_ON + #pragma shader_feature_local COLORSWAP_ON + #pragma shader_feature_local HSV_ON + #pragma shader_feature_local CHANGECOLOR_ON + #pragma shader_feature_local CHANGECOLOR2_ON + #pragma shader_feature_local CHANGECOLOR3_ON + #pragma shader_feature_local COLORRAMP_ON + #pragma shader_feature_local GRADIENTCOLORRAMP_ON + #pragma shader_feature_local HITEFFECT_ON + #pragma shader_feature_local NEGATIVE_ON + #pragma shader_feature_local PIXELATE_ON + #pragma shader_feature_local GREYSCALE_ON + #pragma shader_feature_local POSTERIZE_ON + #pragma shader_feature_local BLUR_ON + #pragma shader_feature_local MOTIONBLUR_ON + #pragma shader_feature_local GHOST_ON + #pragma shader_feature_local ALPHAOUTLINE_ON + #pragma shader_feature_local INNEROUTLINE_ON + #pragma shader_feature_local ONLYINNEROUTLINE_ON + #pragma shader_feature_local HOLOGRAM_ON + #pragma shader_feature_local CHROMABERR_ON + #pragma shader_feature_local GLITCH_ON + #pragma shader_feature_local FLICKER_ON + #pragma shader_feature_local SHADOW_ON + #pragma shader_feature_local SHINE_ON + #pragma shader_feature_local CONTRAST_ON + #pragma shader_feature_local OVERLAY_ON + #pragma shader_feature_local OVERLAYMULT_ON + #pragma shader_feature_local DOODLE_ON + #pragma shader_feature_local WIND_ON + #pragma shader_feature_local WAVEUV_ON + #pragma shader_feature_local ROUNDWAVEUV_ON + #pragma shader_feature_local RECTSIZE_ON + #pragma shader_feature_local OFFSETUV_ON + #pragma shader_feature_local CLIPPING_ON + #pragma shader_feature_local RADIALCLIPPING_ON + #pragma shader_feature_local TEXTURESCROLL_ON + #pragma shader_feature_local ZOOMUV_ON + #pragma shader_feature_local DISTORT_ON + #pragma shader_feature_local WARP_ON + #pragma shader_feature_local TWISTUV_ON + #pragma shader_feature_local ROTATEUV_ON + #pragma shader_feature_local POLARUV_ON + #pragma shader_feature_local FISHEYE_ON + #pragma shader_feature_local PINCH_ON + #pragma shader_feature_local SHAKEUV_ON + + #pragma shader_feature_local GLOWTEX_ON + #pragma shader_feature_local OUTTEX_ON + #pragma shader_feature_local OUTDIST_ON + #pragma shader_feature_local OUTBASE8DIR_ON + #pragma shader_feature_local OUTBASEPIXELPERF_ON + #pragma shader_feature_local COLORRAMPOUTLINE_ON + #pragma shader_feature_local GREYSCALEOUTLINE_ON + #pragma shader_feature_local POSTERIZEOUTLINE_ON + #pragma shader_feature_local BLURISHD_ON + #pragma shader_feature_local MANUALWIND_ON + #pragma shader_feature_local ATLAS_ON + #pragma shader_feature_local PREMULTIPLYALPHA_ON + + #pragma shader_feature BILBOARD_ON + #pragma shader_feature BILBOARDY_ON + + #pragma shader_feature NORMALMAP_ON + + + #define _URP 1 +#define _USINGTEXCOORD1 1 +#define _USINGTEXCOORD2 1 + + + #include_with_pragmas "Packages/com.unity.render-pipelines.universal/ShaderLibrary/DOTS.hlsl" + #include_with_pragmas "Packages/com.unity.render-pipelines.universal/ShaderLibrary/RenderingLayers.hlsl" + #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.universal/ShaderLibrary/Input.hlsl" + #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/TextureStack.hlsl" + #include_with_pragmas "Packages/com.unity.render-pipelines.core/ShaderLibrary/FoveatedRenderingKeywords.hlsl" + #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/DebugMipmapStreamingMacros.hlsl" + #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/ShaderGraphFunctions.hlsl" + #include "Packages/com.unity.render-pipelines.universal/Editor/ShaderGraph/Includes/ShaderPass.hlsl" + + #undef WorldNormalVector + #define WorldNormalVector(data, normal) mul(normal, data.TBNMatrix) + + #define UnityObjectToWorldNormal(normal) mul(GetObjectToWorldMatrix(), normal) + + #define _WorldSpaceLightPos0 _MainLightPosition + + #define UNITY_DECLARE_TEX2D(name) TEXTURE2D(name); SAMPLER(sampler##name); + #define UNITY_DECLARE_TEX2D_NOSAMPLER(name) TEXTURE2D(name); + #define UNITY_DECLARE_TEX2DARRAY(name) TEXTURE2D_ARRAY(name); SAMPLER(sampler##name); + #define UNITY_DECLARE_TEX2DARRAY_NOSAMPLER(name) TEXTURE2D_ARRAY(name); + + #define UNITY_SAMPLE_TEX2DARRAY(tex,coord) SAMPLE_TEXTURE2D_ARRAY(tex, sampler##tex, coord.xy, coord.z) + #define UNITY_SAMPLE_TEX2DARRAY_LOD(tex,coord,lod) SAMPLE_TEXTURE2D_ARRAY_LOD(tex, sampler##tex, coord.xy, coord.z, lod) + #define UNITY_SAMPLE_TEX2D(tex, coord) SAMPLE_TEXTURE2D(tex, sampler##tex, coord) + #define UNITY_SAMPLE_TEX2D_SAMPLER(tex, samp, coord) SAMPLE_TEXTURE2D(tex, sampler##samp, coord) + + #define UNITY_SAMPLE_TEX2D_LOD(tex,coord, lod) SAMPLE_TEXTURE2D_LOD(tex, sampler_##tex, coord, lod) + #define UNITY_SAMPLE_TEX2D_SAMPLER_LOD(tex,samplertex,coord, lod) SAMPLE_TEXTURE2D_LOD (tex, sampler##samplertex,coord, lod) + + #if defined(UNITY_COMPILER_HLSL) + #define UNITY_INITIALIZE_OUTPUT(type,name) name = (type)0; + #else + #define UNITY_INITIALIZE_OUTPUT(type,name) + #endif + + #define sampler2D_float sampler2D + #define sampler2D_half sampler2D + + + + // data across stages, stripped like the above. + struct VertexToPixel + { + float4 pos : SV_POSITION; + float3 worldPos : TEXCOORD0; + float3 worldNormal : TEXCOORD1; + float4 worldTangent : TEXCOORD2; + float4 texcoord0 : TEXCOORD3; + float4 texcoord1 : TEXCOORD4; + float4 texcoord2 : TEXCOORD5; + + // #if %TEXCOORD3REQUIREKEY% + float4 texcoord3 : TEXCOORD6; + // #endif + + // #if %SCREENPOSREQUIREKEY% + // float4 screenPos : TEXCOORD7; + // #endif + + // #if %VERTEXCOLORREQUIREKEY% + half4 vertexColor : COLOR; + // #endif + + #if defined(LIGHTMAP_ON) + float2 lightmapUV : TEXCOORD8; + #endif + #if defined(DYNAMICLIGHTMAP_ON) + float2 dynamicLightmapUV : TEXCOORD9; + #endif + #if !defined(LIGHTMAP_ON) + float4 probeOcclusion : TEXCOORD8; + float3 sh : TEXCOORD10; + #endif + + #if defined(VARYINGS_NEED_FOG_AND_VERTEX_LIGHT) + float4 fogFactorAndVertexLight : TEXCOORD11; + #endif + + #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR) + float4 shadowCoord : TEXCOORD12; + #endif + + // #if %EXTRAV2F0REQUIREKEY% + // float4 extraV2F0 : TEXCOORD13; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // float4 extraV2F1 : TEXCOORD14; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // float4 extraV2F2 : TEXCOORD15; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // float4 extraV2F3 : TEXCOORD16; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // float4 extraV2F4 : TEXCOORD17; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // float4 extraV2F5 : TEXCOORD18; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // float4 extraV2F6 : TEXCOORD19; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // float4 extraV2F7 : TEXCOORD20; + // #endif + + #if UNITY_ANY_INSTANCING_ENABLED + uint instanceID : CUSTOM_INSTANCE_ID; + #endif + #if (defined(UNITY_STEREO_MULTIVIEW_ENABLED)) || (defined(UNITY_STEREO_INSTANCING_ENABLED) && (defined(SHADER_API_GLES3) || defined(SHADER_API_GLCORE))) + uint stereoTargetEyeIndexAsBlendIdx0 : BLENDINDICES0; + #endif + #if (defined(UNITY_STEREO_INSTANCING_ENABLED)) + uint stereoTargetEyeIndexAsRTArrayIdx : SV_RenderTargetArrayIndex; + #endif + #if defined(SHADER_STAGE_FRAGMENT) && defined(VARYINGS_NEED_CULLFACE) + FRONT_FACE_TYPE cullFace : FRONT_FACE_SEMANTIC; + #endif + + #if _PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR)) + float4 previousPositionCS : TEXCOORD21; // Contain previous transform position (in case of skinning for example) + float4 positionCS : TEXCOORD22; + #endif + }; + + + + + // data describing the user output of a pixel + struct Surface + { + half3 Albedo; + half Height; + half3 Normal; + half Smoothness; + half3 Emission; + half Metallic; + half3 Specular; + half Occlusion; + half SpecularPower; // for simple lighting + half Alpha; + float outputDepth; // if written, SV_Depth semantic is used. ShaderData.clipPos.z is unused value + // HDRP Only + half SpecularOcclusion; + half SubsurfaceMask; + half Thickness; + half CoatMask; + half CoatSmoothness; + half Anisotropy; + half IridescenceMask; + half IridescenceThickness; + int DiffusionProfileHash; + float SpecularAAThreshold; + float SpecularAAScreenSpaceVariance; + // requires _OVERRIDE_BAKEDGI to be defined, but is mapped in all pipelines + float3 DiffuseGI; + float3 BackDiffuseGI; + float3 SpecularGI; + float ior; + float3 transmittanceColor; + float atDistance; + float transmittanceMask; + // requires _OVERRIDE_SHADOWMASK to be defines + float4 ShadowMask; + + // for decals + float NormalAlpha; + float MAOSAlpha; + + + }; + + // Data the user declares in blackboard blocks + struct Blackboard + { + + float blackboardDummyData; + }; + + // data the user might need, this will grow to be big. But easy to strip + struct ShaderData + { + float4 clipPos; // SV_POSITION + float3 localSpacePosition; + float3 localSpaceNormal; + float3 localSpaceTangent; + + float3 worldSpacePosition; + float3 worldSpaceNormal; + float3 worldSpaceTangent; + float tangentSign; + + float3 worldSpaceViewDir; + float3 tangentSpaceViewDir; + + float4 texcoord0; + float4 texcoord1; + float4 texcoord2; + float4 texcoord3; + + float2 screenUV; + float4 screenPos; + + float4 vertexColor; + bool isFrontFace; + + float4 extraV2F0; + float4 extraV2F1; + float4 extraV2F2; + float4 extraV2F3; + float4 extraV2F4; + float4 extraV2F5; + float4 extraV2F6; + float4 extraV2F7; + + float3x3 TBNMatrix; + Blackboard blackboard; + }; + + struct VertexData + { + #if SHADER_TARGET > 30 + // uint vertexID : SV_VertexID; + #endif + float4 vertex : POSITION; + float3 normal : NORMAL; + float4 tangent : TANGENT; + float4 texcoord0 : TEXCOORD0; + + // optimize out mesh coords when not in use by user or lighting system + #if _URP && (_USINGTEXCOORD1 || _PASSMETA || _PASSFORWARD || _PASSGBUFFER) + float4 texcoord1 : TEXCOORD1; + #endif + + #if _URP && (_USINGTEXCOORD2 || _PASSMETA || ((_PASSFORWARD || _PASSGBUFFER) && defined(DYNAMICLIGHTMAP_ON))) + float4 texcoord2 : TEXCOORD2; + #endif + + #if _STANDARD && (_USINGTEXCOORD1 || (_PASSMETA || ((_PASSFORWARD || _PASSGBUFFER || _PASSFORWARDADD) && LIGHTMAP_ON))) + float4 texcoord1 : TEXCOORD1; + #endif + #if _STANDARD && (_USINGTEXCOORD2 || (_PASSMETA || ((_PASSFORWARD || _PASSGBUFFER) && DYNAMICLIGHTMAP_ON))) + float4 texcoord2 : TEXCOORD2; + #endif + + + #if _HDRP + float4 texcoord1 : TEXCOORD1; + float4 texcoord2 : TEXCOORD2; + #endif + + // #if %TEXCOORD3REQUIREKEY% + float4 texcoord3 : TEXCOORD3; + // #endif + + // #if %VERTEXCOLORREQUIREKEY% + float4 vertexColor : COLOR; + // #endif + + #if _PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR)) + float3 previousPositionOS : TEXCOORD4; // Contain previous transform position (in case of skinning for example) + #if defined (_ADD_PRECOMPUTED_VELOCITY) + float3 precomputedVelocity : TEXCOORD5; // Add Precomputed Velocity (Alembic computes velocities on runtime side). + #endif + #endif + + UNITY_VERTEX_INPUT_INSTANCE_ID + }; + + struct TessVertex + { + float4 vertex : INTERNALTESSPOS; + float3 normal : NORMAL; + float4 tangent : TANGENT; + float4 texcoord0 : TEXCOORD0; + float4 texcoord1 : TEXCOORD1; + float4 texcoord2 : TEXCOORD2; + + // #if %TEXCOORD3REQUIREKEY% + float4 texcoord3 : TEXCOORD3; + // #endif + + // #if %VERTEXCOLORREQUIREKEY% + float4 vertexColor : COLOR; + // #endif + + // #if %EXTRAV2F0REQUIREKEY% + // float4 extraV2F0 : TEXCOORD5; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // float4 extraV2F1 : TEXCOORD6; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // float4 extraV2F2 : TEXCOORD7; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // float4 extraV2F3 : TEXCOORD8; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // float4 extraV2F4 : TEXCOORD9; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // float4 extraV2F5 : TEXCOORD10; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // float4 extraV2F6 : TEXCOORD11; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // float4 extraV2F7 : TEXCOORD12; + // #endif + + #if _PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR)) + float3 previousPositionOS : TEXCOORD13; // Contain previous transform position (in case of skinning for example) + #if defined (_ADD_PRECOMPUTED_VELOCITY) + float3 precomputedVelocity : TEXCOORD14; + #endif + #endif + + UNITY_VERTEX_INPUT_INSTANCE_ID + UNITY_VERTEX_OUTPUT_STEREO + }; + + struct ExtraV2F + { + float4 extraV2F0; + float4 extraV2F1; + float4 extraV2F2; + float4 extraV2F3; + float4 extraV2F4; + float4 extraV2F5; + float4 extraV2F6; + float4 extraV2F7; + Blackboard blackboard; + float4 time; + }; + + + float3 WorldToTangentSpace(ShaderData d, float3 normal) + { + return mul(d.TBNMatrix, normal); + } + + float3 TangentToWorldSpace(ShaderData d, float3 normal) + { + return mul(normal, d.TBNMatrix); + } + + // in this case, make standard more like SRPs, because we can't fix + // unity_WorldToObject in HDRP, since it already does macro-fu there + + #if _STANDARD + float3 TransformWorldToObject(float3 p) { return mul(unity_WorldToObject, float4(p, 1)); }; + float3 TransformObjectToWorld(float3 p) { return mul(unity_ObjectToWorld, float4(p, 1)); }; + float4 TransformWorldToObject(float4 p) { return mul(unity_WorldToObject, p); }; + float4 TransformObjectToWorld(float4 p) { return mul(unity_ObjectToWorld, p); }; + float4x4 GetWorldToObjectMatrix() { return unity_WorldToObject; } + float4x4 GetObjectToWorldMatrix() { return unity_ObjectToWorld; } + #if (defined(SHADER_API_D3D11) || defined(SHADER_API_XBOXONE) || defined(UNITY_COMPILER_HLSLCC) || defined(SHADER_API_PSSL) || (SHADER_TARGET_SURFACE_ANALYSIS && !SHADER_TARGET_SURFACE_ANALYSIS_MOJOSHADER)) + #define UNITY_SAMPLE_TEX2D_LOD(tex,coord, lod) tex.SampleLevel (sampler##tex,coord, lod) + #define UNITY_SAMPLE_TEX2D_SAMPLER_LOD(tex,samplertex,coord, lod) tex.SampleLevel (sampler##samplertex,coord, lod) + #else + #define UNITY_SAMPLE_TEX2D_LOD(tex,coord,lod) tex2D (tex,coord,0,lod) + #define UNITY_SAMPLE_TEX2D_SAMPLER_LOD(tex,samplertex,coord,lod) tex2D (tex,coord,0,lod) + #endif + + #undef GetWorldToObjectMatrix() + + #define GetWorldToObjectMatrix() unity_WorldToObject + + + #endif + + float3 GetCameraWorldPosition() + { + #if _HDRP + return GetCameraRelativePositionWS(_WorldSpaceCameraPos); + #else + return _WorldSpaceCameraPos; + #endif + } + + #if _GRABPASSUSED + #if _STANDARD + TEXTURE2D(%GRABTEXTURE%); + SAMPLER(sampler_%GRABTEXTURE%); + #endif + + half3 GetSceneColor(float2 uv) + { + #if _STANDARD + return SAMPLE_TEXTURE2D(%GRABTEXTURE%, sampler_%GRABTEXTURE%, uv).rgb; + #else + return SHADERGRAPH_SAMPLE_SCENE_COLOR(uv); + #endif + } + #endif + + + + #if _STANDARD + UNITY_DECLARE_DEPTH_TEXTURE(_CameraDepthTexture); + float GetSceneDepth(float2 uv) { return SAMPLE_DEPTH_TEXTURE(_CameraDepthTexture, uv); } + float GetLinear01Depth(float2 uv) { return Linear01Depth(GetSceneDepth(uv)); } + float GetLinearEyeDepth(float2 uv) { return LinearEyeDepth(GetSceneDepth(uv)); } + #else + float GetSceneDepth(float2 uv) { return SHADERGRAPH_SAMPLE_SCENE_DEPTH(uv); } + float GetLinear01Depth(float2 uv) { return Linear01Depth(GetSceneDepth(uv), _ZBufferParams); } + float GetLinearEyeDepth(float2 uv) { return LinearEyeDepth(GetSceneDepth(uv), _ZBufferParams); } + #endif + + float3 GetWorldPositionFromDepthBuffer(float2 uv, float3 worldSpaceViewDir) + { + float eye = GetLinearEyeDepth(uv); + float3 camView = mul((float3x3)GetObjectToWorldMatrix(), transpose(mul(GetWorldToObjectMatrix(), UNITY_MATRIX_I_V)) [2].xyz); + + float dt = dot(worldSpaceViewDir, camView); + float3 div = worldSpaceViewDir/dt; + float3 wpos = (eye * div) + GetCameraWorldPosition(); + return wpos; + } + + #if _HDRP + float3 ObjectToWorldSpacePosition(float3 pos) + { + return GetAbsolutePositionWS(TransformObjectToWorld(pos)); + } + #else + float3 ObjectToWorldSpacePosition(float3 pos) + { + return TransformObjectToWorld(pos); + } + #endif + + #if _STANDARD + UNITY_DECLARE_SCREENSPACE_TEXTURE(_CameraDepthNormalsTexture); + float3 GetSceneNormal(float2 uv, float3 worldSpaceViewDir) + { + float4 depthNorms = UNITY_SAMPLE_SCREENSPACE_TEXTURE(_CameraDepthNormalsTexture, uv); + float3 norms = DecodeViewNormalStereo(depthNorms); + norms = mul((float3x3)GetWorldToViewMatrix(), norms) * 0.5 + 0.5; + return norms; + } + #elif _HDRP && !_DECALSHADER + + float3 GetSceneNormal(float2 uv, float3 worldSpaceViewDir) + { + NormalData nd; + DecodeFromNormalBuffer(_ScreenSize.xy * uv, nd); + return nd.normalWS; + } + #elif _URP + #if (SHADER_LIBRARY_VERSION_MAJOR >= 10) + #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/DeclareNormalsTexture.hlsl" + #endif + + float3 GetSceneNormal(float2 uv, float3 worldSpaceViewDir) + { + #if (SHADER_LIBRARY_VERSION_MAJOR >= 10) + return SampleSceneNormals(uv); + #else + float3 wpos = GetWorldPositionFromDepthBuffer(uv, worldSpaceViewDir); + return normalize(-cross(ddx(wpos), ddy(wpos))) * 0.5 + 0.5; + #endif + + } + #endif + + #if _HDRP + + half3 UnpackNormalmapRGorAG(half4 packednormal) + { + // This do the trick + packednormal.x *= packednormal.w; + + half3 normal; + normal.xy = packednormal.xy * 2 - 1; + normal.z = sqrt(1 - saturate(dot(normal.xy, normal.xy))); + return normal; + } + half3 UnpackNormal(half4 packednormal) + { + #if defined(UNITY_NO_DXT5nm) + return packednormal.xyz * 2 - 1; + #else + return UnpackNormalmapRGorAG(packednormal); + #endif + } + #endif + #if _HDRP || _URP + + half3 UnpackScaleNormal(half4 packednormal, half scale) + { + #ifndef UNITY_NO_DXT5nm + // Unpack normal as DXT5nm (1, y, 1, x) or BC5 (x, y, 0, 1) + // Note neutral texture like "bump" is (0, 0, 1, 1) to work with both plain RGB normal and DXT5nm/BC5 + packednormal.x *= packednormal.w; + #endif + half3 normal; + normal.xy = (packednormal.xy * 2 - 1) * scale; + normal.z = sqrt(1 - saturate(dot(normal.xy, normal.xy))); + return normal; + } + + #endif + + + void GetSun(out float3 lightDir, out float3 color) + { + lightDir = float3(0.5, 0.5, 0); + color = 1; + #if _HDRP + if (_DirectionalLightCount > 0) + { + DirectionalLightData light = _DirectionalLightDatas[0]; + lightDir = -light.forward.xyz; + color = light.color; + } + #elif _STANDARD + lightDir = normalize(_WorldSpaceLightPos0.xyz); + color = _LightColor0.rgb; + #elif _URP + Light light = GetMainLight(); + lightDir = light.direction; + color = light.color; + #endif + } + + + + CBUFFER_START(UnityPerMaterial) + + + half4 _Color; + half4 _MainTex_ST, _MainTex_TexelSize; + half _Alpha, _AlphaCutoffValue; + + #if ATLAS_ON + half _MinXUV, _MaxXUV, _MinYUV, _MaxYUV; + #endif + + #if GLOW_ON + half4 _GlowColor; + half _Glow, _GlowGlobal; + #endif + + #if HSV_ON + half _HsvShift, _HsvSaturation, _HsvBright; + #endif + + #if DISTORT_ON + half4 _DistortTex_ST; + half _DistortTexXSpeed, _DistortTexYSpeed, _DistortAmount; + #endif + + #if FADE_ON + half4 _FadeBurnColor, _FadeTex_ST, _FadeBurnTex_ST; + half _FadeAmount, _FadeBurnWidth, _FadeBurnTransition,_FadeBurnGlow; + #endif + + #if OUTBASE_ON + half4 _OutlineColor; + half _OutlineAlpha, _OutlineGlow, _OutlineWidth; + int _OutlinePixelWidth; + #endif + + #if OUTTEX_ON + half4 _OutlineTex_ST; + half _OutlineTexXSpeed, _OutlineTexYSpeed; + #endif + + #if OUTDIST_ON + half4 _OutlineDistortTex_ST; + half _OutlineDistortTexXSpeed, _OutlineDistortTexYSpeed, _OutlineDistortAmount; + #endif + + #if ALPHAOUTLINE_ON + half _AlphaOutlineGlow, _AlphaOutlinePower, _AlphaOutlineMinAlpha, _AlphaOutlineBlend; + half4 _AlphaOutlineColor; + #endif + + #if INNEROUTLINE_ON + half _InnerOutlineThickness, _InnerOutlineAlpha, _InnerOutlineGlow; + half4 _InnerOutlineColor; + #endif + + #if GRADIENT_ON + half _GradBlend, _GradBoostX, _GradBoostY; + half4 _GradTopRightCol, _GradTopLeftCol, _GradBotRightCol, _GradBotLeftCol; + #endif + + #if COLORSWAP_ON + half4 _ColorSwapRed, _ColorSwapGreen, _ColorSwapBlue; + half _ColorSwapRedLuminosity, _ColorSwapGreenLuminosity, _ColorSwapBlueLuminosity, _ColorSwapBlend; + #endif + + #if CHANGECOLOR_ON + half4 _ColorChangeNewCol, _ColorChangeTarget; + half _ColorChangeTolerance, _ColorChangeLuminosity; + #endif + #if CHANGECOLOR2_ON + half4 _ColorChangeNewCol2, _ColorChangeTarget2; + half _ColorChangeTolerance2; + #endif + #if CHANGECOLOR3_ON + half4 _ColorChangeNewCol3, _ColorChangeTarget3; + half _ColorChangeTolerance3; + #endif + + #if COLORRAMP_ON + half _ColorRampLuminosity, _ColorRampBlend; + #endif + + #if HITEFFECT_ON + half4 _HitEffectColor; + half _HitEffectGlow, _HitEffectBlend; + #endif + + #if NEGATIVE_ON + half _NegativeAmount; + #endif + + #if PIXELATE_ON + half _PixelateSize; + #endif + + #if GREYSCALE_ON + half _GreyscaleLuminosity, _GreyscaleBlend; + half4 _GreyscaleTintColor; + #endif + + #if POSTERIZE_ON + half _PosterizeNumColors, _PosterizeGamma; + #endif + + #if BLUR_ON + half _BlurIntensity; + #endif + + #if MOTIONBLUR_ON + half _MotionBlurAngle, _MotionBlurDist; + #endif + + #if GHOST_ON + half _GhostColorBoost, _GhostTransparency, _GhostBlend; + #endif + + #if HOLOGRAM_ON + half _HologramStripesAmount, _HologramMinAlpha, _HologramUnmodAmount, _HologramStripesSpeed, _HologramMaxAlpha, _HologramBlend; + half4 _HologramStripeColor; + #endif + + #if CHROMABERR_ON + half _ChromAberrAmount, _ChromAberrAlpha; + #endif + + #if GLITCH_ON + half _GlitchAmount, _GlitchSize; + #endif + + #if FLICKER_ON + half _FlickerFreq, _FlickerPercent, _FlickerAlpha; + #endif + + #if SHADOW_ON + half _ShadowX, _ShadowY, _ShadowAlpha; + half4 _ShadowColor; + #endif + + #if SHINE_ON + half4 _ShineColor; + half _ShineLocation, _ShineRotate, _ShineWidth, _ShineGlow; + #endif + + #if CONTRAST_ON + half _Contrast, _Brightness; + #endif + + #if OVERLAY_ON + half4 _OverlayTex_ST, _OverlayColor; + half _OverlayGlow, _OverlayBlend, _OverlayTextureScrollXSpeed, _OverlayTextureScrollYSpeed; + #endif + + #if DOODLE_ON + half _HandDrawnAmount, _HandDrawnSpeed; + #endif + + #if WIND_ON + half _GrassSpeed, _GrassWind, _GrassManualAnim, _GrassRadialBend; + #endif + + #if WAVEUV_ON + float _WaveAmount, _WaveSpeed, _WaveStrength, _WaveX, _WaveY; + #endif + + #if ROUNDWAVEUV_ON + half _RoundWaveStrength, _RoundWaveSpeed; + #endif + + #if RECTSIZE_ON + half _RectSize; + #endif + + #if OFFSETUV_ON + half _OffsetUvX, _OffsetUvY; + #endif + + #if CLIPPING_ON + half _ClipUvLeft, _ClipUvRight, _ClipUvUp, _ClipUvDown; + #endif + + #if RADIALCLIPPING_ON + half _RadialStartAngle, _RadialClip, _RadialClip2; + #endif + + #if TEXTURESCROLL_ON + half _TextureScrollXSpeed, _TextureScrollYSpeed; + #endif + + #if ZOOMUV_ON + half _ZoomUvAmount; + #endif + + #if WARP_ON + half _WarpStrength, _WarpSpeed, _WarpScale; + #endif + + #if TWISTUV_ON + half _TwistUvAmount, _TwistUvPosX, _TwistUvPosY, _TwistUvRadius; + #endif + + #if ROTATEUV_ON + half _RotateUvAmount; + #endif + + #if FISHEYE_ON + half _FishEyeUvAmount; + #endif + + #if PINCH_ON + half _PinchUvAmount; + #endif + + #if SHAKEUV_ON + half _ShakeUvSpeed, _ShakeUvX, _ShakeUvY; + #endif + + #if NORMALMAP_ON + half _NormalStrength; + #endif + + float _RandomSeed; + + + + + CBUFFER_END + + + + + + + + TEXTURE2D(_MainTex); + SAMPLER(sampler_MainTex); + + #if GLOW_ON + TEXTURE2D(_GlowTex); + SAMPLER(sampler_GlowTex); + #endif + + #if FADE_ON + TEXTURE2D(_FadeTex); + SAMPLER(sampler_FadeTex); + + TEXTURE2D(_FadeBurnTex); + SAMPLER(sampler_FadeBurnTex); + #endif + + #if DISTORT_ON + TEXTURE2D(_DistortTex); + SAMPLER(sampler_DistortTex); + #endif + + #if OUTTEX_ON + TEXTURE2D(_OutlineTex); + SAMPLER(sampler_OutlineTex); + #endif + + #if OUTDIST_ON + TEXTURE2D(_OutlineDistortTex); + SAMPLER(sampler_OutlineDistortTex); + #endif + + #if COLORSWAP_ON + TEXTURE2D(_ColorSwapTex); + SAMPLER(sampler_ColorSwapTex); + #endif + + #if COLORRAMP_ON + TEXTURE2D(_ColorRampTex); + TEXTURE2D(_ColorRampTexGradient); + SAMPLER(sampler_ColorRampTex); + SAMPLER(sampler_ColorRampTexGradient); + #endif + + #if SHINE_ON + TEXTURE2D(_ShineMask); + SAMPLER(sampler_ShineMask); + #endif + + #if OVERLAY_ON + TEXTURE2D(_OverlayTex); + SAMPLER(sampler_OverlayTex); + #endif + + #if NORMALMAP_ON + TEXTURE2D(_NormalMap); + SAMPLER(sampler_NormalMap); + #endif + + + half3 GetPixel(in int offsetX, in int offsetY, in half2 uv, in Texture2D _tex, in SamplerState _sampler) + { + half2 _uv = uv + half2(offsetX * _MainTex_TexelSize.x, offsetY * _MainTex_TexelSize.y); + half4 col = SAMPLE_TEXTURE2D(_tex, _sampler, _uv); + return col.rgb; + } + + + //BLURS------------------------------------------------------------------------- + half4 Blur(half2 uv, Texture2D source, SamplerState sampler_source, half Intensity) + { + const half2 texelSize = 1.0 / _ScreenParams.xy; + const half4 color = SAMPLE_TEXTURE2D(source, sampler_source, uv); + const half2 offset = Intensity * texelSize; + + half4 accumulatedColor = color; + half accumulatedWeight = 1.0; + for (int x = -1; x <= 1; x++) + { + for (int y = -1; y <= 1; y++) + { + const half2 sampleUV = uv + half2(x, y) * offset; + const half4 sampleColor = SAMPLE_TEXTURE2D(source, sampler_source, sampleUV); + + accumulatedColor += sampleColor; + accumulatedWeight += 1.0; + } + } + + half4 blurredColor = accumulatedColor / accumulatedWeight; + return blurredColor; + } + + half BlurHD_G(half bhqp, half x) + { + return exp(-(x * x) / (2.0 * bhqp * bhqp)); + } + half4 BlurHD(half2 uv, Texture2D source, SamplerState sampler_source, half BlurAmount, half xScale, half yScale) + { + int iterations = 16; + int halfIterations = iterations / 2; + half sigmaX = 0.1 + BlurAmount * 0.5; + half sigmaY = sigmaX; + half total = 0.0; + half4 ret = half4(0, 0, 0, 0); + for (int iy = 0; iy < iterations; ++iy) + { + half fy = BlurHD_G(sigmaY, half(iy) -half(halfIterations)); + half offsetY = half(iy - halfIterations) * 0.00390625 * xScale; + for (int ix = 0; ix < iterations; ++ix) + { + half fx = BlurHD_G(sigmaX, half(ix) - half(halfIterations)); + half offsetX = half(ix - halfIterations) * 0.00390625 * yScale; + total += fx * fy; + ret += SAMPLE_TEXTURE2D(source, sampler_source, uv + half2(offsetX, offsetY)) * fx * fy; + } + } + return ret / total; + } + //----------------------------------------------------------------------- + + + //------------------------------------------- + half RemapFloat(half inValue, half inMin, half inMax, half outMin, half outMax){ + return outMin + (inValue - inMin) * (outMax - outMin) / (inMax - inMin); + } + //------------------------------------------- + + //----------------------------------------------------------------------- + half rand(half2 seed, half offset) { + return (frac(sin(dot(seed, half2(12.9898, 78.233))) * 43758.5453) + offset) % 1.0; + } + + half rand2(half2 seed, half offset) { + return (frac(sin(dot(seed * floor(50 + (_Time.x % 1.0) * 12.), half2(127.1, 311.7))) * 43758.5453123) + offset) % 1.0; + } + + half rand2CustomTime(half2 seed, half offset, half customTime) { + return (frac(sin(dot(seed * floor(50 + (customTime % 1.0) * 12.), half2(127.1, 311.7))) * 43758.5453123) + offset) % 1.0; + } + //----------------------------------------------------------------------- + + + void Ext_ModifyVertex0 (inout VertexData v, inout ExtraV2F d) + { + //BILBOARD_ON + #if BILBOARD_ON + half3 camRight = mul((half3x3)unity_CameraToWorld, half3(1,0,0)); + half3 camUp = half3(0,1,0); + #if BILBOARDY_ON + camUp = mul((half3x3)unity_CameraToWorld, half3(0,1,0)); + #endif + half3 localPos = v.vertex.x * camRight + v.vertex.y * camUp; + v.vertex = half4(localPos, 1); + #endif + //----------------------------------------------------------- + + v.texcoord0.xy = TRANSFORM_TEX(v.texcoord0.xy, _MainTex); + half2 center = half2(0.5, 0.5); + #if ATLAS_ON + center = half2((_MaxXUV + _MinXUV) / 2.0, (_MaxYUV + _MinYUV) / 2.0); + #endif + + //POLARUV_ON + #if POLARUV_ON + v.texcoord0.xy = v.texcoord0.xy - center; + #endif + + //---------------------------------------- + + //ROTATEUV_ON + #if ROTATEUV_ON + half2 uvC = v.texcoord0.xy; + half cosAngle = cos(_RotateUvAmount); + half sinAngle = sin(_RotateUvAmount); + half2x2 rot = half2x2(cosAngle, -sinAngle, sinAngle, cosAngle); + uvC -= center; + v.texcoord0.xy = mul(rot, uvC); + v.texcoord0.xy += center; + #endif + //-------------------- + + #if RECTSIZE_ON + v.vertex.xyz += (v.vertex.xyz * (_RectSize - 1.0)); + #endif + + #if OUTTEX_ON + v.texcoord1.xy = TRANSFORM_TEX(v.texcoord0.xy, _OutlineTex); + #endif + + #if OUTDIST_ON + v.texcoord2.xy = TRANSFORM_TEX(v.texcoord0.xy, _OutlineDistortTex); + #endif + + #if DISTORT_ON + v.texcoord3.xy = TRANSFORM_TEX(v.texcoord0.xy, _DistortTex); + #endif + } + + void Ext_SurfaceFunction0 (inout Surface o, ShaderData d) + { + half randomSeed = _RandomSeed; + + float2 uvRect = d.texcoord0; + half2 center = half2(0.5, 0.5); + #if ATLAS_ON + center = half2((_MaxXUV + _MinXUV) / 2.0, (_MaxYUV + _MinYUV) / 2.0); + uvRect = half2((d.texcoord0.x - _MinXUV) / (_MaxXUV - _MinXUV), (d.texcoord0.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half2 centerTiled = half2(center.x * _MainTex_ST.x, center.y * _MainTex_ST.y); + + //CLIPPING_ON + #if CLIPPING_ON + half2 tiledUv = half2(d.texcoord0.x / _MainTex_ST.x, d.texcoord0.y / _MainTex_ST.y); + #if ATLAS_ON + tiledUv = half2((tiledUv.x - _MinXUV) / (_MaxXUV - _MinXUV), (tiledUv.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + clip((1 - _ClipUvUp) - tiledUv.y); + clip(tiledUv.y - _ClipUvDown); + clip((1 - _ClipUvRight) - tiledUv.x); + clip(tiledUv.x - _ClipUvLeft); + #endif + //---------------------------------- + + //RADIALCLIPPING_ON + #if RADIALCLIPPING_ON + half2 tiledUv2 = half2(d.texcoord0.x / _MainTex_ST.x, d.texcoord0.y / _MainTex_ST.y); + #if ATLAS_ON + tiledUv2 = half2((tiledUv2.x - _MinXUV) / (_MaxXUV - _MinXUV), (tiledUv2.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half startAngle = _RadialStartAngle - _RadialClip; + half endAngle = _RadialStartAngle + _RadialClip2; + half offset0 = clamp(0, 360, startAngle + 360); + half offset360 = clamp(0, 360, endAngle - 360); + half2 atan2Coord = half2(lerp(-1, 1, tiledUv2.x), lerp(-1, 1, tiledUv2.y)); + half atanAngle = atan2(atan2Coord.y, atan2Coord.x) * 57.3; // angle in degrees + if(atanAngle < 0) atanAngle = 360 + atanAngle; + if(atanAngle >= startAngle && atanAngle <= endAngle) discard; + if(atanAngle <= offset360) discard; + if(atanAngle >= offset0) discard; + #endif + + //----------------------------- + + //TEXTURESCROLL_ON && ATLAS_ON + #if TEXTURESCROLL_ON && ATLAS_ON + d.texcoord0.xy = half2(_MinXUV + ((_MaxXUV - _MinXUV) * (abs(((_Time.y + randomSeed) * _TextureScrollXSpeed) + uvRect.x) % 1)), + _MinYUV + ((_MaxYUV - _MinYUV) * (abs(((_Time.y + randomSeed) * _TextureScrollYSpeed) + uvRect.y) % 1))); + #endif + //---------------------------- + + //OFFSETUV_ON + #if OFFSETUV_ON + #if ATLAS_ON + d.texcoord0.xy = half2(_MinXUV + ((_MaxXUV - _MinXUV) * (abs((_OffsetUvX + uvRect.x) % 1))), + _MinYUV + ((_MaxYUV - _MinYUV) * (abs(_OffsetUvY + uvRect.y) % 1))); + #else + d.texcoord0.xy += half2(_OffsetUvX, _OffsetUvY); + #endif + #endif + + //---------------------- + + //POLARUV_ON + #if POLARUV_ON + d.texcoord0.xy = half2(atan2(d.texcoord0.y, d.texcoord0.x) / (2.0f * 3.141592653589f), length(d.texcoord0.xy)); + d.texcoord0.xy *= _MainTex_ST.xy; + #endif + + //-------------------------------------- + + //TWISTUV_ON + #if TWISTUV_ON + #if ATLAS_ON + _TwistUvPosX = ((_MaxXUV - _MinXUV) * _TwistUvPosX) + _MinXUV; + _TwistUvPosY = ((_MaxYUV - _MinYUV) * _TwistUvPosY) + _MinYUV; + #endif + half2 tempUv = d.texcoord0.xy - half2(_TwistUvPosX * _MainTex_ST.x, _TwistUvPosY * _MainTex_ST.y); + _TwistUvRadius *= (_MainTex_ST.x + _MainTex_ST.y) / 2; + half percent = (_TwistUvRadius - length(tempUv)) / _TwistUvRadius; + half theta = percent * percent * (2.0 * sin(_TwistUvAmount)) * 8.0; + half s = sin(theta); + half c = cos(theta); + half beta = max(sign(_TwistUvRadius - length(tempUv)), 0.0); + tempUv = half2(dot(tempUv, half2(c, -s)), dot(tempUv, half2(s, c))) * beta + tempUv * (1 - beta); + tempUv += half2(_TwistUvPosX * _MainTex_ST.x, _TwistUvPosY * _MainTex_ST.y); + d.texcoord0.xy = tempUv; + #endif + + //-------------------------------------------- + + //FISHEYE_ON + #if FISHEYE_ON + half bind = length(centerTiled); + half2 dF = d.texcoord0.xy - centerTiled; + half dFlen = length(dF); + half fishInt = (3.14159265359 / bind) * (_FishEyeUvAmount + 0.001); + d.texcoord0.xy = centerTiled + (dF / (max(0.0001, dFlen))) * tan(dFlen * fishInt) * bind / tan(bind * fishInt); + #endif + //--------------------------------------------- + + //PINCH_ON + #if PINCH_ON + half2 dP = d.texcoord0.xy - centerTiled; + half pinchInt = (3.141592 / length(centerTiled)) * (-_PinchUvAmount + 0.001); + d.texcoord0.xy = centerTiled + normalize(dP) * atan(length(dP) * -pinchInt * 10.0) * 0.5 / atan(-pinchInt * 5); + #endif + + //--------------------------------------------- + + //ZOOMUV_ON + #if ZOOMUV_ON + d.texcoord0.xy -= centerTiled; + d.texcoord0.xy = d.texcoord0.xy * _ZoomUvAmount; + d.texcoord0.xy += centerTiled; + #endif + + //----------------------------------------------- + + //DOODLE_ON + #if DOODLE_ON + half2 uvCopy = uvRect; + _HandDrawnSpeed = (floor((_Time.x + randomSeed) * 20 * _HandDrawnSpeed) / _HandDrawnSpeed) * _HandDrawnSpeed; + uvCopy.x = sin((uvCopy.x * _HandDrawnAmount + _HandDrawnSpeed) * 4); + uvCopy.y = cos((uvCopy.y * _HandDrawnAmount + _HandDrawnSpeed) * 4); + d.texcoord0.xy = lerp(d.texcoord0.xy, d.texcoord0.xy + uvCopy, 0.0005 * _HandDrawnAmount); + #endif + + //-------------------------- + + //SHAKEUV_ON + #if SHAKEUV_ON + half xShake = sin((_Time.x + randomSeed) * _ShakeUvSpeed * 50) * _ShakeUvX; + half yShake = cos((_Time.x + randomSeed) * _ShakeUvSpeed * 50) * _ShakeUvY; + d.texcoord0.xy += half2(xShake * 0.012, yShake * 0.01); + #endif + + //------------------------------------------- + + //RECTSIZE_ON + #if RECTSIZE_ON + d.texcoord0.xy = d.texcoord0.xy * (_RectSize).xx + (((-_RectSize * 0.5) + 0.5)).xx; + #endif + + //------------------------------------------- + + //DISTORT_ON + #if DISTORT_ON + #if ATLAS_ON + d.texcoord3.x = d.texcoord3.x * (1 / (_MaxXUV - _MinXUV)); + d.texcoord3.y = d.texcoord3.y * (1 / (_MaxYUV - _MinYUV)); + #endif + + d.texcoord3.x += ((_Time.x + _RandomSeed) * _DistortTexXSpeed) % 1; + d.texcoord3.y += ((_Time.x + _RandomSeed) * _DistortTexYSpeed) % 1; + half distortAmnt = (SAMPLE_TEXTURE2D(_DistortTex, sampler_DistortTex, d.texcoord3.xy).r - 0.5) * 0.2 * _DistortAmount; + d.texcoord0.x += distortAmnt; + d.texcoord0.y += distortAmnt; + #endif + //------------------------------------------------------- + + //WARP_ON + #if WARP_ON + half2 warpUv = half2(d.texcoord0.x / _MainTex_ST.x, d.texcoord0.y / _MainTex_ST.y); + #if ATLAS_ON + warpUv = half2((warpUv.x - _MinXUV) / (_MaxXUV - _MinXUV), (warpUv.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + const float tau = 6.283185307179586; + float xWarp = (_Time.y + randomSeed) * _WarpSpeed + warpUv.x * tau / _WarpScale; + float yWarp = (_Time.y + randomSeed) * _WarpSpeed + warpUv.y * tau / _WarpScale; + float2 warp = float2(sin(xWarp), sin(yWarp)) * _WarpStrength; + d.texcoord0.xy += warp; + #endif + + //------------------------------------------------------- + + //WAVEUV_ON + #if WAVEUV_ON + float2 uvWave = half2(_WaveX * _MainTex_ST.x, _WaveY * _MainTex_ST.y) - d.texcoord0.xy; + uvWave %= 1; + #if ATLAS_ON + uvWave = half2(_WaveX, _WaveY) - uvRect; + #endif + uvWave.x *= _ScreenParams.x / _ScreenParams.y; + float waveTime = _Time.y + randomSeed; + float angWave = (sqrt(dot(uvWave, uvWave)) * _WaveAmount) - ((waveTime * _WaveSpeed)); + d.texcoord0.xy = d.texcoord0.xy + uvWave * sin(angWave) * (_WaveStrength / 1000.0); + #endif + //---------------------------------------------------- + + //ROUNDWAVEUV_ON + #if ROUNDWAVEUV_ON + half xWave = ((0.5 * _MainTex_ST.x) - uvRect.x); + half yWave = ((0.5 * _MainTex_ST.y) - uvRect.y) * (_MainTex_TexelSize.w / _MainTex_TexelSize.z); + half ripple = -sqrt(xWave*xWave + yWave* yWave); + d.texcoord0.xy += (sin((ripple + (_Time.y + randomSeed) * (_RoundWaveSpeed/10.0)) / 0.015) * (_RoundWaveStrength/10.0)) % 1; + #endif + //---------------------------------------------------- + + + //WIND_ON + #if WIND_ON + half windOffset = sin((_Time.x + randomSeed) * _GrassSpeed * 10); + half2 windCenter = half2(0.5, 0.1); + #if ATLAS_ON + windCenter.x = ((_MaxXUV - _MinXUV) * windCenter.x) + _MinXUV; + windCenter.y = ((_MaxYUV - _MinYUV) * windCenter.y) + _MinYUV; + #endif + #if !MANUALWIND_ON + d.texcoord0.x = fmod(abs(lerp(d.texcoord0.x, d.texcoord0.x + (_GrassWind * 0.01 * windOffset), uvRect.y)), 1); + #else + d.texcoord0.x = fmod(abs(lerp(d.texcoord0.x, d.texcoord0.x + (_GrassWind * 0.01 * _GrassManualAnim), uvRect.y)), 1); + windOffset = _GrassManualAnim; + #endif + half2 delta = d.texcoord0.xy - windCenter; + half delta2 = dot(delta.xy, delta.xy); + half2 delta_offset = delta2 * windOffset; + d.texcoord0.xy = d.texcoord0.xy + half2(delta.y, -delta.x) * delta_offset * _GrassRadialBend; + #endif + + //-------------------------------------------------------- + + //TEXTURESCROLL_ON && !ATLAS_ON + #if TEXTURESCROLL_ON && !ATLAS_ON + d.texcoord0.x += ((_Time.y + randomSeed) * _TextureScrollXSpeed) % 1; + d.texcoord0.y += ((_Time.y + randomSeed) * _TextureScrollYSpeed) % 1; + #endif + //------------------------------ + + //PIXELATE_ON + #if PIXELATE_ON + half aspectRatio = _MainTex_TexelSize.x / _MainTex_TexelSize.y; + half2 pixelSize = float2(_PixelateSize, _PixelateSize * aspectRatio); + d.texcoord0.xy = floor(d.texcoord0.xy * pixelSize) / pixelSize; + #endif + //-------------- + + half4 col = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy); + half originalAlpha = col.a; + col *= d.vertexColor; + + //NORMAL MAP + #if NORMALMAP_ON + half4 normalSample = SAMPLE_TEXTURE2D(_NormalMap, sampler_NormalMap, d.texcoord0.xy); + half3 normalTS = UnpackNormal(normalSample); + normalTS.xy *= _NormalStrength; + o.Normal = normalTS; + #endif + + + //GLITCH_ON + #if GLITCH_ON + half2 uvGlitch = uvRect; + uvGlitch.y -= 0.5; + half lineNoise = pow(rand2(floor(uvGlitch * half2(24., 19.) * _GlitchSize) * 4.0, randomSeed), 3.0) * _GlitchAmount + * pow(rand2(floor(uvGlitch * half2(38., 14.) * _GlitchSize) * 4.0, randomSeed), 3.0); + col = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(lineNoise * 0.02 * rand2(half2(2.0, 1), randomSeed), 0)) * d.vertexColor; + #endif + //-------------------------------------- + + //CHROMABERR_ON + #if CHROMABERR_ON + half4 r = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(_ChromAberrAmount/10, 0)) * d.vertexColor; + half4 b = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(-_ChromAberrAmount/10, 0)) * d.vertexColor; + col = half4(r.r * r.a, col.g, b.b * b.a, max(max(r.a, b.a) * _ChromAberrAlpha, col.a)); + #endif + + //-------------------------------- + + //BLUR_ON + #if BLUR_ON + #if ATLAS_ON + #if !BLURISHD_ON + col = BlurHD(d.texcoord0.xy, _MainTex, sampler_MainTex, _BlurIntensity, (_MaxXUV - _MinXUV), (_MaxYUV - _MinYUV)) * d.vertexColor; + #else + col = Blur(d.texcoord0.xy, _MainTex, sampler_MainTex, _BlurIntensity * (_MaxXUV - _MinXUV)) * d.vertexColor; + #endif + #else + #if !BLURISHD_ON + col = BlurHD(d.texcoord0.xy, _MainTex, sampler_MainTex, _BlurIntensity, 1, 1) * d.vertexColor; + #else + col = Blur(d.texcoord0.xy, _MainTex, sampler_MainTex, _BlurIntensity) * d.vertexColor; + #endif + #endif + #endif + + //-------------------- + + //MOTIONBLUR_ON + #if MOTIONBLUR_ON + _MotionBlurAngle = _MotionBlurAngle * 3.1415926; + #define rot(n) mul(n, half2x2(cos(_MotionBlurAngle), -sin(_MotionBlurAngle), sin(_MotionBlurAngle), cos(_MotionBlurAngle))) + _MotionBlurDist = _MotionBlurDist * 0.005; + #if ATLAS_ON + _MotionBlurDist *= (_MaxXUV - _MinXUV); + #endif + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(-_MotionBlurDist, -_MotionBlurDist))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(-_MotionBlurDist * 2, -_MotionBlurDist * 2))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(-_MotionBlurDist * 3, -_MotionBlurDist * 3))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(-_MotionBlurDist * 4, -_MotionBlurDist * 4))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(_MotionBlurDist, _MotionBlurDist))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(_MotionBlurDist * 2, _MotionBlurDist * 2))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(_MotionBlurDist * 3, _MotionBlurDist * 3))); + col.rgb += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + rot(half2(_MotionBlurDist * 4, _MotionBlurDist * 4))); + col.rgb = col.rgb / 9; + #endif + //------------------------------------ + + //NEGATIVE_ON + #if NEGATIVE_ON + col.rgb = lerp(col.rgb, 1 - col.rgb, _NegativeAmount); + #endif + + //-------------- + half luminance = 0; + + //GREYSCALE_ON && !GREYSCALEOUTLINE_ON + #if GREYSCALE_ON && !GREYSCALEOUTLINE_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + luminance = saturate(luminance + _GreyscaleLuminosity); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _GreyscaleTintColor, _GreyscaleBlend); + #endif + //------------------------------------ + + //GHOST_ON + #if GHOST_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + half4 ghostResult; + ghostResult.a = saturate(luminance - _GhostTransparency) * col.a; + ghostResult.rgb = col.rgb * (luminance + _GhostColorBoost); + col = lerp(col, ghostResult, _GhostBlend); + #endif + //------------------------------------ + + //INNEROUTLINE_ON + #if INNEROUTLINE_ON + half3 innerT = abs(GetPixel(0, _InnerOutlineThickness, d.texcoord0.xy, _MainTex, sampler_MainTex) - GetPixel(0, -_InnerOutlineThickness, d.texcoord0.xy, _MainTex, sampler_MainTex)); + innerT += abs(GetPixel(_InnerOutlineThickness, 0, d.texcoord0.xy, _MainTex, sampler_MainTex) - GetPixel(-_InnerOutlineThickness, 0, d.texcoord0.xy, _MainTex, sampler_MainTex)); + #if !ONLYINNEROUTLINE_ON + innerT = (innerT / 2.0) * col.a * _InnerOutlineAlpha; + col.rgb += length(innerT) * _InnerOutlineColor.rgb * _InnerOutlineGlow; + #else + innerT *= col.a * _InnerOutlineAlpha; + col.rgb = length(innerT) * _InnerOutlineColor.rgb * _InnerOutlineGlow; + col.a = step(0.3, col.r+col.g+col.b); + #endif + #endif + //------------------------------------------------------- + + //HITEFFECT_ON + #if HITEFFECT_ON + col.rgb = lerp(col.rgb, _HitEffectColor.rgb * _HitEffectGlow, _HitEffectBlend); + #endif + //-------------------- + + //GRADIENT_ON + #if GRADIENT_ON + half2 tiledUvGrad = half2(uvRect.x / _MainTex_ST.x, uvRect.y / _MainTex_ST.y); + #if GRADIENT2COL_ON + _GradTopRightCol = _GradTopLeftCol; + _GradBotRightCol = _GradBotLeftCol; + #endif + #if RADIALGRADIENT_ON + half radialDist = 1 - length(tiledUvGrad - half2(0.5, 0.5)); + radialDist *= (_MainTex_TexelSize.w / _MainTex_TexelSize.z); + radialDist = saturate(_GradBoostX * radialDist); + half4 gradientResult = lerp(_GradTopLeftCol, _GradBotLeftCol, radialDist); + #else + half gradXLerpFactor = saturate(pow(tiledUvGrad.x, _GradBoostX)); + half4 gradientResult = lerp(lerp(_GradBotLeftCol, _GradBotRightCol, gradXLerpFactor), + lerp(_GradTopLeftCol, _GradTopRightCol, gradXLerpFactor), saturate(pow(tiledUvGrad.y, _GradBoostY))); + #endif + gradientResult = lerp(col, gradientResult, _GradBlend); + col.rgb = gradientResult.rgb * col.a; + col.a *= gradientResult.a; + #endif + //-------------------------------------------------------------------- + + //CONTRAST_ON + #if CONTRAST_ON + col.rgb = (col.rgb - float3(0.5, 0.5, 0.5)) * _Contrast + float3(0.5, 0.5, 0.5); + col.rgb += _Brightness; + #endif + + //------------------------------------------------------------------- + + //COLORSWAP_ON + #if COLORSWAP_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + half4 swapMask = SAMPLE_TEXTURE2D(_ColorSwapTex, sampler_ColorSwapTex, d.texcoord0.xy); + swapMask.rgb *= swapMask.a; + half3 redSwap = _ColorSwapRed * swapMask.r * saturate(luminance + _ColorSwapRedLuminosity); + half3 greenSwap = _ColorSwapGreen * swapMask.g * saturate(luminance + _ColorSwapGreenLuminosity); + half3 blueSwap = _ColorSwapBlue * swapMask.b * saturate(luminance + _ColorSwapBlueLuminosity); + swapMask.rgb = col.rgb * saturate(1 - swapMask.r - swapMask.g - swapMask.b); + col.rgb = lerp(col.rgb, swapMask.rgb + redSwap + greenSwap + blueSwap, _ColorSwapBlend); + #endif + //-------------------------------------------------------------------- + + //COLORRAMP_ON && !COLORRAMPOUTLINE_ON + #if COLORRAMP_ON && !COLORRAMPOUTLINE_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + luminance = saturate(luminance + _ColorRampLuminosity); + #if GRADIENTCOLORRAMP_ON + col.rgb = lerp(col.rgb, SAMPLE_TEXTURE2D(_ColorRampTexGradient, sampler_ColorRampTexGradient, half2(luminance, 0)).rgb, _ColorRampBlend); + #else + col.rgb = lerp(col.rgb, SAMPLE_TEXTURE2D(_ColorRampTex, sampler_ColorRampTex, half2(luminance, 0)).rgb, _ColorRampBlend); + #endif + #endif + //-------------------------------------------------------------------- + + //CHANGECOLOR_ON + #if CHANGECOLOR_ON + float3 currChangeColor = saturate(col.rgb); + luminance = 0.3 * currChangeColor.r + 0.59 * currChangeColor.g + 0.11 * currChangeColor.b; + luminance = saturate(luminance + _ColorChangeLuminosity); + half3 dif = abs(currChangeColor - _ColorChangeTarget.rgb); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _ColorChangeNewCol.rgb, + max(sign(1 - saturate(dif.x + dif.y + dif.z) - _ColorChangeTolerance), 0.0)); + #if CHANGECOLOR2_ON + dif = abs(currChangeColor - _ColorChangeTarget2.rgb); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _ColorChangeNewCol2.rgb, + max(sign(1 - saturate(dif.x + dif.y + dif.z) - _ColorChangeTolerance2), 0.0)); + #endif + #if CHANGECOLOR3_ON + dif = abs(currChangeColor - _ColorChangeTarget3.rgb); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _ColorChangeNewCol3.rgb, + max(sign(1 - saturate(dif.x + dif.y + dif.z) - _ColorChangeTolerance3), 0.0)); + #endif + #endif + //------------------------------------------------------- + + //POSTERIZE_ON && !POSTERIZEOUTLINE_ON + #if POSTERIZE_ON && !POSTERIZEOUTLINE_ON + col.rgb = pow(col.rgb, _PosterizeGamma) * _PosterizeNumColors; + col.rgb = floor(col.rgb) / _PosterizeNumColors; + col.rgb = pow(col.rgb, 1.0 / _PosterizeGamma); + #endif + //------------------------------------ + + //HSV_ON + #if HSV_ON + half3 resultHsv = half3(col.rgb); + half cosHsv = _HsvBright * _HsvSaturation * cos(_HsvShift * 3.14159265 / 180); + half sinHsv = _HsvBright * _HsvSaturation * sin(_HsvShift * 3.14159265 / 180); + resultHsv.x = (.299 * _HsvBright + .701 * cosHsv + .168 * sinHsv) * col.x + + (.587 * _HsvBright - .587 * cosHsv + .330 * sinHsv) * col.y + + (.114 * _HsvBright - .114 * cosHsv - .497 * sinHsv) * col.z; + resultHsv.y = (.299 * _HsvBright - .299 * cosHsv - .328 * sinHsv) *col.x + + (.587 * _HsvBright + .413 * cosHsv + .035 * sinHsv) * col.y + + (.114 * _HsvBright - .114 * cosHsv + .292 * sinHsv) * col.z; + resultHsv.z = (.299 * _HsvBright - .3 * cosHsv + 1.25 * sinHsv) * col.x + + (.587 * _HsvBright - .588 * cosHsv - 1.05 * sinHsv) * col.y + + (.114 * _HsvBright + .886 * cosHsv - .203 * sinHsv) * col.z; + col.rgb = resultHsv; + #endif + //------------------------------------------------------- + + //OVERLAY_ON + #if OVERLAY_ON + half2 overlayUvs = d.texcoord0.xy; + overlayUvs.x += ((_Time.y + randomSeed) * _OverlayTextureScrollXSpeed) % 1; + overlayUvs.y += ((_Time.y + randomSeed) * _OverlayTextureScrollYSpeed) % 1; + half4 overlayCol = SAMPLE_TEXTURE2D(_OverlayTex, sampler_OverlayTex, TRANSFORM_TEX(overlayUvs, _OverlayTex)); + overlayCol.rgb *= _OverlayColor.rgb * _OverlayGlow; + #if !OVERLAYMULT_ON + overlayCol.rgb *= overlayCol.a * _OverlayColor.rgb * _OverlayColor.a * _OverlayBlend; + col.rgb += overlayCol.rgb; + #else + overlayCol.a *= _OverlayColor.a; + col = lerp(col, col * overlayCol, _OverlayBlend); + #endif + #endif + + //--------------------------------- + + //OUTBASE_ON + #if OUTBASE_ON + #if OUTBASEPIXELPERF_ON + half2 destUv = half2(_OutlinePixelWidth * _MainTex_TexelSize.x, _OutlinePixelWidth * _MainTex_TexelSize.y); + #else + half2 destUv = half2(_OutlineWidth * _MainTex_TexelSize.x * 200, _OutlineWidth * _MainTex_TexelSize.y * 200); + #endif + + #if OUTDIST_ON + d.texcoord3.x += ((_Time.x + _RandomSeed) * _OutlineDistortTexXSpeed) % 1; + d.texcoord3.y += ((_Time.x + _RandomSeed) * _OutlineDistortTexYSpeed) % 1; + #if ATLAS_ON + d.texcoord3 = half2((d.texcoord3.x - _MinXUV) / (_MaxXUV - _MinXUV), (d.texcoord3.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half outDistortAmnt = (SAMPLE_TEXTURE2D(_OutlineDistortTex, sampler_OutlineDistortTex, d.texcoord3).r - 0.5) * 0.2 * _OutlineDistortAmount; + destUv.x += outDistortAmnt; + destUv.y += outDistortAmnt; + #endif + + half spriteLeft = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(destUv.x, 0)).a; + half spriteRight = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy - half2(destUv.x, 0)).a; + half spriteBottom = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(0, destUv.y)).a; + half spriteTop = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy - half2(0, destUv.y)).a; + half result = spriteLeft + spriteRight + spriteBottom + spriteTop; + + #if OUTBASE8DIR_ON + half spriteTopLeft = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(destUv.x, destUv.y)).a; + half spriteTopRight = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(-destUv.x, destUv.y)).a; + half spriteBotLeft = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(destUv.x, -destUv.y)).a; + half spriteBotRight = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(-destUv.x, -destUv.y)).a; + result = result + spriteTopLeft + spriteTopRight + spriteBotLeft + spriteBotRight; + #endif + + result = step(0.05, saturate(result)); + + #if OUTTEX_ON + d.texcoord1.x += ((_Time.x + _RandomSeed) * _OutlineTexXSpeed) % 1; + d.texcoord1.y += ((_Time.x + _RandomSeed) * _OutlineTexYSpeed) % 1; + #if ATLAS_ON + d.texcoord1 = half2((d.texcoord1.x - _MinXUV) / (_MaxXUV - _MinXUV), (d.texcoord1.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half4 tempOutColor = SAMPLE_TEXTURE2D(_OutlineTex, sampler_OutlineTex, d.texcoord1); + tempOutColor *= _OutlineColor; + _OutlineColor = tempOutColor; + #endif + + result *= (1 - originalAlpha) * _OutlineAlpha; + + half4 outline = _OutlineColor * d.vertexColor.a; + outline.rgb *= _OutlineGlow; + outline.a = result; + #if ONLYOUTLINE_ON + col = outline; + #else + col = lerp(col, outline, result); + #endif + #endif + //------------------------------------------------------- + + //FADE_ON + #if FADE_ON + half2 tiledUvFade1 = TRANSFORM_TEX(d.texcoord0, _FadeTex); + half2 tiledUvFade2 = TRANSFORM_TEX(d.texcoord0, _FadeBurnTex); + #if ATLAS_ON + tiledUvFade1 = half2((tiledUvFade1.x - _MinXUV) / (_MaxXUV - _MinXUV), (tiledUvFade1.y - _MinYUV) / (_MaxYUV - _MinYUV)); + tiledUvFade2 = half2((tiledUvFade2.x - _MinXUV) / (_MaxXUV - _MinXUV), (tiledUvFade2.y - _MinYUV) / (_MaxYUV - _MinYUV)); + #endif + half fadeTemp = SAMPLE_TEXTURE2D(_FadeTex, sampler_FadeTex, tiledUvFade1).r; + half fade = smoothstep(_FadeAmount, _FadeAmount + _FadeBurnTransition, fadeTemp); + half fadeBurn = saturate(smoothstep(_FadeAmount - _FadeBurnWidth, _FadeAmount - _FadeBurnWidth + 0.1, fadeTemp) * _FadeAmount); + col.a *= fade; + _FadeBurnColor.rgb *= _FadeBurnGlow; + col += fadeBurn * SAMPLE_TEXTURE2D(_FadeBurnTex, sampler_FadeBurnTex, tiledUvFade2) * _FadeBurnColor * originalAlpha * (1 - col.a); + #endif + //------------------------------------------------------- + + //SHADOW_ON + #if SHADOW_ON + half shadowA = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, d.texcoord0.xy + half2(_ShadowX, _ShadowY)).a; + half preMultShadowMask = 1 - (saturate(shadowA - col.a) * (1 - col.a)); + col.rgb *= 1 - ((shadowA - col.a) * (1 - col.a)); + col.rgb += (_ShadowColor * shadowA) * (1 - col.a); + col.a = max(shadowA * _ShadowAlpha * d.vertexColor.a, col.a); + #endif + + //------------------------------------------------------- + + //GLOW_ON + #if GLOW_ON + half4 emission; + #if GLOWTEX_ON + emission = SAMPLE_TEXTURE2D(_GlowTex, sampler_GlowTex, d.texcoord0); + #else + emission = col; + #endif + + col.rgb *= _GlowGlobal; + emission.rgb *= emission.a * col.a * _Glow * _GlowColor; + col.rgb += emission.rgb; + #endif + //------------------------------------------------------- + + //COLORRAMP_ON && COLORRAMPOUTLINE_ON + #if COLORRAMP_ON && COLORRAMPOUTLINE_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + luminance = saturate(luminance + _ColorRampLuminosity); + #if GRADIENTCOLORRAMP_ON + col.rgb = lerp(col.rgb, SAMPLE_TEXTURE2D(_ColorRampTexGradient, sampler_ColorRampTexGradient, half2(luminance, 0)).rgb, _ColorRampBlend); + #else + col.rgb = lerp(col.rgb, SAMPLE_TEXTURE2D(_ColorRampTex, sampler_ColorRampTex, half2(luminance, 0)).rgb, _ColorRampBlend); + #endif + #endif + //--------------- + + //GREYSCALE_ON && GREYSCALEOUTLINE_ON + #if GREYSCALE_ON && GREYSCALEOUTLINE_ON + luminance = 0.3 * col.r + 0.59 * col.g + 0.11 * col.b; + luminance = saturate(luminance + _GreyscaleLuminosity); + col.rgb = lerp(col.rgb, half3(luminance, luminance, luminance) * _GreyscaleTintColor, _GreyscaleBlend); + #endif + + //----------------------------------- + + //POSTERIZE_ON && POSTERIZEOUTLINE_ON + #if POSTERIZE_ON && POSTERIZEOUTLINE_ON + col.rgb = pow(col.rgb, _PosterizeGamma) * _PosterizeNumColors; + col.rgb = floor(col.rgb) / _PosterizeNumColors; + col.rgb = pow(col.rgb, 1.0 / _PosterizeGamma); + #endif + + //----------------------------------- + + //SHINE_ON + #if SHINE_ON + half2 uvShine = uvRect; + half cosAngle = cos(_ShineRotate); + half sinAngle = sin(_ShineRotate); + half2x2 rot = half2x2(cosAngle, -sinAngle, sinAngle, cosAngle); + uvShine -= half2(0.5, 0.5); + uvShine = mul(rot, uvShine); + uvShine += half2(0.5, 0.5); + half shineMask = SAMPLE_TEXTURE2D(_ShineMask, sampler_ShineMask, d.texcoord0.xy).a; + half currentDistanceProjection = (uvShine.x + uvShine.y) / 2; + half whitePower = 1 - (abs(currentDistanceProjection - _ShineLocation) / _ShineWidth); + col.rgb += col.a * whitePower * _ShineGlow * max(sign(currentDistanceProjection - (_ShineLocation - _ShineWidth)), 0.0) + * max(sign((_ShineLocation + _ShineWidth) - currentDistanceProjection), 0.0) * _ShineColor * shineMask; + #endif + + //----------------------------------- + + //HOLOGRAM_ON + #if HOLOGRAM_ON + half totalHologram = _HologramStripesAmount + _HologramUnmodAmount; + half hologramYCoord = ((uvRect.y + (((_Time.x + randomSeed) % 1) * _HologramStripesSpeed)) % totalHologram) / totalHologram; + hologramYCoord = abs(hologramYCoord); + half alpha = RemapFloat(saturate(hologramYCoord - (_HologramUnmodAmount/totalHologram)), 0.0, 1.0, _HologramMinAlpha, saturate(_HologramMaxAlpha)); + half hologramMask = max(sign((_HologramUnmodAmount/totalHologram) - hologramYCoord), 0.0); + half4 hologramResult = col; + hologramResult.a *= lerp(alpha, 1, hologramMask); + hologramResult.rgb *= max(1, _HologramMaxAlpha * max(sign(hologramYCoord - (_HologramUnmodAmount/totalHologram)), 0.0)); + hologramMask = 1 - step(0.01,hologramMask); + hologramResult.rgb += hologramMask * _HologramStripeColor * col.a; + col = lerp(col, hologramResult, _HologramBlend); + #endif + + //----------------------------------- + + //FLICKER_ON + #if FLICKER_ON + col.a *= saturate(col.a * step(frac(0.05 + (_Time.w + randomSeed) * _FlickerFreq), 1 - _FlickerPercent) + _FlickerAlpha); + #endif + //----------------------------------- + + //ALPHACUTOFF_ON + + //ALPHAROUND_ON + + //ALPHAOUTLINE_ON + #if ALPHAOUTLINE_ON + half alphaOutlineRes = pow(1 - col.a, max(_AlphaOutlinePower, 0.0001)) * step(_AlphaOutlineMinAlpha, col.a) * _AlphaOutlineBlend; + col.rgb = lerp(col.rgb, _AlphaOutlineColor.rgb * _AlphaOutlineGlow, alphaOutlineRes); + col.a = lerp(col.a, 1, alphaOutlineRes > 1); + #endif + //------------------------------------------------------- + + //FOG_ON + + //------------------ + + col *= _Color; + o.Albedo = col; + col.a *= _Alpha; + clip(col.a - _AlphaCutoffValue - 0.01); + o.Alpha = _Color.a; + } + + + + + + void ChainSurfaceFunction(inout Surface l, inout ShaderData d) + { + Ext_SurfaceFunction0(l, d); + // Ext_SurfaceFunction1(l, d); + // Ext_SurfaceFunction2(l, d); + // Ext_SurfaceFunction3(l, d); + // Ext_SurfaceFunction4(l, d); + // Ext_SurfaceFunction5(l, d); + // Ext_SurfaceFunction6(l, d); + // Ext_SurfaceFunction7(l, d); + // Ext_SurfaceFunction8(l, d); + // Ext_SurfaceFunction9(l, d); + // Ext_SurfaceFunction10(l, d); + // Ext_SurfaceFunction11(l, d); + // Ext_SurfaceFunction12(l, d); + // Ext_SurfaceFunction13(l, d); + // Ext_SurfaceFunction14(l, d); + // Ext_SurfaceFunction15(l, d); + // Ext_SurfaceFunction16(l, d); + // Ext_SurfaceFunction17(l, d); + // Ext_SurfaceFunction18(l, d); + // Ext_SurfaceFunction19(l, d); + // Ext_SurfaceFunction20(l, d); + // Ext_SurfaceFunction21(l, d); + // Ext_SurfaceFunction22(l, d); + // Ext_SurfaceFunction23(l, d); + // Ext_SurfaceFunction24(l, d); + // Ext_SurfaceFunction25(l, d); + // Ext_SurfaceFunction26(l, d); + // Ext_SurfaceFunction27(l, d); + // Ext_SurfaceFunction28(l, d); + // Ext_SurfaceFunction29(l, d); + } + +#if !_DECALSHADER + + void ChainModifyVertex(inout VertexData v, inout VertexToPixel v2p, float4 time) + { + ExtraV2F d; + + ZERO_INITIALIZE(ExtraV2F, d); + ZERO_INITIALIZE(Blackboard, d.blackboard); + // due to motion vectors in HDRP, we need to use the last + // time in certain spots. So if you are going to use _Time to adjust vertices, + // you need to use this time or motion vectors will break. + d.time = time; + + Ext_ModifyVertex0(v, d); + // Ext_ModifyVertex1(v, d); + // Ext_ModifyVertex2(v, d); + // Ext_ModifyVertex3(v, d); + // Ext_ModifyVertex4(v, d); + // Ext_ModifyVertex5(v, d); + // Ext_ModifyVertex6(v, d); + // Ext_ModifyVertex7(v, d); + // Ext_ModifyVertex8(v, d); + // Ext_ModifyVertex9(v, d); + // Ext_ModifyVertex10(v, d); + // Ext_ModifyVertex11(v, d); + // Ext_ModifyVertex12(v, d); + // Ext_ModifyVertex13(v, d); + // Ext_ModifyVertex14(v, d); + // Ext_ModifyVertex15(v, d); + // Ext_ModifyVertex16(v, d); + // Ext_ModifyVertex17(v, d); + // Ext_ModifyVertex18(v, d); + // Ext_ModifyVertex19(v, d); + // Ext_ModifyVertex20(v, d); + // Ext_ModifyVertex21(v, d); + // Ext_ModifyVertex22(v, d); + // Ext_ModifyVertex23(v, d); + // Ext_ModifyVertex24(v, d); + // Ext_ModifyVertex25(v, d); + // Ext_ModifyVertex26(v, d); + // Ext_ModifyVertex27(v, d); + // Ext_ModifyVertex28(v, d); + // Ext_ModifyVertex29(v, d); + + + // #if %EXTRAV2F0REQUIREKEY% + // v2p.extraV2F0 = d.extraV2F0; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // v2p.extraV2F1 = d.extraV2F1; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // v2p.extraV2F2 = d.extraV2F2; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // v2p.extraV2F3 = d.extraV2F3; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // v2p.extraV2F4 = d.extraV2F4; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // v2p.extraV2F5 = d.extraV2F5; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // v2p.extraV2F6 = d.extraV2F6; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // v2p.extraV2F7 = d.extraV2F7; + // #endif + } + + void ChainModifyTessellatedVertex(inout VertexData v, inout VertexToPixel v2p) + { + ExtraV2F d; + ZERO_INITIALIZE(ExtraV2F, d); + ZERO_INITIALIZE(Blackboard, d.blackboard); + + // #if %EXTRAV2F0REQUIREKEY% + // d.extraV2F0 = v2p.extraV2F0; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // d.extraV2F1 = v2p.extraV2F1; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // d.extraV2F2 = v2p.extraV2F2; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // d.extraV2F3 = v2p.extraV2F3; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // d.extraV2F4 = v2p.extraV2F4; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // d.extraV2F5 = v2p.extraV2F5; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // d.extraV2F6 = v2p.extraV2F6; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // d.extraV2F7 = v2p.extraV2F7; + // #endif + + + // Ext_ModifyTessellatedVertex0(v, d); + // Ext_ModifyTessellatedVertex1(v, d); + // Ext_ModifyTessellatedVertex2(v, d); + // Ext_ModifyTessellatedVertex3(v, d); + // Ext_ModifyTessellatedVertex4(v, d); + // Ext_ModifyTessellatedVertex5(v, d); + // Ext_ModifyTessellatedVertex6(v, d); + // Ext_ModifyTessellatedVertex7(v, d); + // Ext_ModifyTessellatedVertex8(v, d); + // Ext_ModifyTessellatedVertex9(v, d); + // Ext_ModifyTessellatedVertex10(v, d); + // Ext_ModifyTessellatedVertex11(v, d); + // Ext_ModifyTessellatedVertex12(v, d); + // Ext_ModifyTessellatedVertex13(v, d); + // Ext_ModifyTessellatedVertex14(v, d); + // Ext_ModifyTessellatedVertex15(v, d); + // Ext_ModifyTessellatedVertex16(v, d); + // Ext_ModifyTessellatedVertex17(v, d); + // Ext_ModifyTessellatedVertex18(v, d); + // Ext_ModifyTessellatedVertex19(v, d); + // Ext_ModifyTessellatedVertex20(v, d); + // Ext_ModifyTessellatedVertex21(v, d); + // Ext_ModifyTessellatedVertex22(v, d); + // Ext_ModifyTessellatedVertex23(v, d); + // Ext_ModifyTessellatedVertex24(v, d); + // Ext_ModifyTessellatedVertex25(v, d); + // Ext_ModifyTessellatedVertex26(v, d); + // Ext_ModifyTessellatedVertex27(v, d); + // Ext_ModifyTessellatedVertex28(v, d); + // Ext_ModifyTessellatedVertex29(v, d); + + // #if %EXTRAV2F0REQUIREKEY% + // v2p.extraV2F0 = d.extraV2F0; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // v2p.extraV2F1 = d.extraV2F1; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // v2p.extraV2F2 = d.extraV2F2; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // v2p.extraV2F3 = d.extraV2F3; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // v2p.extraV2F4 = d.extraV2F4; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // v2p.extraV2F5 = d.extraV2F5; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // v2p.extraV2F6 = d.extraV2F6; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // v2p.extraV2F7 = d.extraV2F7; + // #endif + } + + void ChainFinalColorForward(inout Surface l, inout ShaderData d, inout half4 color) + { + // Ext_FinalColorForward0(l, d, color); + // Ext_FinalColorForward1(l, d, color); + // Ext_FinalColorForward2(l, d, color); + // Ext_FinalColorForward3(l, d, color); + // Ext_FinalColorForward4(l, d, color); + // Ext_FinalColorForward5(l, d, color); + // Ext_FinalColorForward6(l, d, color); + // Ext_FinalColorForward7(l, d, color); + // Ext_FinalColorForward8(l, d, color); + // Ext_FinalColorForward9(l, d, color); + // Ext_FinalColorForward10(l, d, color); + // Ext_FinalColorForward11(l, d, color); + // Ext_FinalColorForward12(l, d, color); + // Ext_FinalColorForward13(l, d, color); + // Ext_FinalColorForward14(l, d, color); + // Ext_FinalColorForward15(l, d, color); + // Ext_FinalColorForward16(l, d, color); + // Ext_FinalColorForward17(l, d, color); + // Ext_FinalColorForward18(l, d, color); + // Ext_FinalColorForward19(l, d, color); + // Ext_FinalColorForward20(l, d, color); + // Ext_FinalColorForward21(l, d, color); + // Ext_FinalColorForward22(l, d, color); + // Ext_FinalColorForward23(l, d, color); + // Ext_FinalColorForward24(l, d, color); + // Ext_FinalColorForward25(l, d, color); + // Ext_FinalColorForward26(l, d, color); + // Ext_FinalColorForward27(l, d, color); + // Ext_FinalColorForward28(l, d, color); + // Ext_FinalColorForward29(l, d, color); + } + + void ChainFinalGBufferStandard(inout Surface s, inout ShaderData d, inout half4 GBuffer0, inout half4 GBuffer1, inout half4 GBuffer2, inout half4 outEmission, inout half4 outShadowMask) + { + // Ext_FinalGBufferStandard0(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard1(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard2(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard3(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard4(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard5(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard6(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard7(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard8(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard9(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard10(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard11(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard12(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard13(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard14(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard15(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard16(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard17(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard18(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard19(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard20(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard21(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard22(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard23(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard24(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard25(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard26(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard27(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard28(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + // Ext_FinalGBufferStandard29(s, d, GBuffer0, GBuffer1, GBuffer2, outEmission, outShadowMask); + } +#endif + + + + + +#if _DECALSHADER + + ShaderData CreateShaderData(SurfaceDescriptionInputs IN) + { + ShaderData d = (ShaderData)0; + d.TBNMatrix = float3x3(IN.WorldSpaceTangent, IN.WorldSpaceBiTangent, IN.WorldSpaceNormal); + d.worldSpaceNormal = IN.WorldSpaceNormal; + d.worldSpaceTangent = IN.WorldSpaceTangent; + + d.worldSpacePosition = IN.WorldSpacePosition; + d.texcoord0 = IN.uv0.xyxy; + d.screenPos = IN.ScreenPosition; + + d.worldSpaceViewDir = normalize(_WorldSpaceCameraPos - d.worldSpacePosition); + + d.tangentSpaceViewDir = mul(d.TBNMatrix, d.worldSpaceViewDir); + + // these rarely get used, so we back transform them. Usually will be stripped. + #if _HDRP + // d.localSpacePosition = mul(GetWorldToObjectMatrix(), float4(GetCameraRelativePositionWS(d.worldSpacePosition), 1)).xyz; + #else + // d.localSpacePosition = mul(GetWorldToObjectMatrix(), float4(d.worldSpacePosition, 1)).xyz; + #endif + // d.localSpaceNormal = normalize(mul((float3x3)GetWorldToObjectMatrix(), d.worldSpaceNormal)); + // d.localSpaceTangent = normalize(mul((float3x3)GetWorldToObjectMatrix(), d.worldSpaceTangent.xyz)); + + // #if %SCREENPOSREQUIREKEY% + // d.screenUV = (IN.ScreenPosition.xy / max(0.01, IN.ScreenPosition.w)); + // #endif + + return d; + } +#else + + ShaderData CreateShaderData(VertexToPixel i + #if NEED_FACING + , bool facing + #endif + ) + { + ShaderData d = (ShaderData)0; + d.clipPos = i.pos; + d.worldSpacePosition = i.worldPos; + + d.worldSpaceNormal = normalize(i.worldNormal); + d.worldSpaceTangent.xyz = normalize(i.worldTangent.xyz); + + d.tangentSign = i.worldTangent.w * unity_WorldTransformParams.w; + float3 bitangent = cross(d.worldSpaceTangent.xyz, d.worldSpaceNormal) * d.tangentSign; + + d.TBNMatrix = float3x3(d.worldSpaceTangent, -bitangent, d.worldSpaceNormal); + d.worldSpaceViewDir = normalize(_WorldSpaceCameraPos - i.worldPos); + + d.tangentSpaceViewDir = mul(d.TBNMatrix, d.worldSpaceViewDir); + d.texcoord0 = i.texcoord0; + d.texcoord1 = i.texcoord1; + d.texcoord2 = i.texcoord2; + + // #if %TEXCOORD3REQUIREKEY% + d.texcoord3 = i.texcoord3; + // #endif + + // d.isFrontFace = facing; + // #if %VERTEXCOLORREQUIREKEY% + d.vertexColor = i.vertexColor; + // #endif + + // these rarely get used, so we back transform them. Usually will be stripped. + #if _HDRP + // d.localSpacePosition = mul(GetWorldToObjectMatrix(), float4(GetCameraRelativePositionWS(i.worldPos), 1)).xyz; + #else + // d.localSpacePosition = mul(GetWorldToObjectMatrix(), float4(i.worldPos, 1)).xyz; + #endif + // d.localSpaceNormal = normalize(mul((float3x3)GetWorldToObjectMatrix(), i.worldNormal)); + // d.localSpaceTangent = normalize(mul((float3x3)GetWorldToObjectMatrix(), i.worldTangent.xyz)); + + // #if %SCREENPOSREQUIREKEY% + // d.screenPos = i.screenPos; + // d.screenUV = (i.screenPos.xy / i.screenPos.w); + // #endif + + + // #if %EXTRAV2F0REQUIREKEY% + // d.extraV2F0 = i.extraV2F0; + // #endif + + // #if %EXTRAV2F1REQUIREKEY% + // d.extraV2F1 = i.extraV2F1; + // #endif + + // #if %EXTRAV2F2REQUIREKEY% + // d.extraV2F2 = i.extraV2F2; + // #endif + + // #if %EXTRAV2F3REQUIREKEY% + // d.extraV2F3 = i.extraV2F3; + // #endif + + // #if %EXTRAV2F4REQUIREKEY% + // d.extraV2F4 = i.extraV2F4; + // #endif + + // #if %EXTRAV2F5REQUIREKEY% + // d.extraV2F5 = i.extraV2F5; + // #endif + + // #if %EXTRAV2F6REQUIREKEY% + // d.extraV2F6 = i.extraV2F6; + // #endif + + // #if %EXTRAV2F7REQUIREKEY% + // d.extraV2F7 = i.extraV2F7; + // #endif + + return d; + } + +#endif + + + #if defined(_PASSSHADOW) + float3 _LightDirection; + float3 _LightPosition; + #endif + + #if (_PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR))) + + #define GetWorldToViewMatrix() _ViewMatrix + #define UNITY_MATRIX_I_V _InvViewMatrix + #define GetViewToHClipMatrix() OptimizeProjectionMatrix(_ProjMatrix) + #define UNITY_MATRIX_I_P _InvProjMatrix + #define GetWorldToHClipMatrix() _ViewProjMatrix + #define UNITY_MATRIX_I_VP _InvViewProjMatrix + #define UNITY_MATRIX_UNJITTERED_VP _NonJitteredViewProjMatrix + #define UNITY_MATRIX_PREV_VP _PrevViewProjMatrix + #define UNITY_MATRIX_PREV_I_VP _PrevInvViewProjMatrix + + void MotionVectorPositionZBias(VertexToPixel input) + { + #if UNITY_REVERSED_Z + input.pos.z -= unity_MotionVectorsParams.z * input.pos.w; + #else + input.pos.z += unity_MotionVectorsParams.z * input.pos.w; + #endif + } + + #endif + + // vertex shader + VertexToPixel Vert (VertexData v) + { + VertexToPixel o = (VertexToPixel)0; + + UNITY_SETUP_INSTANCE_ID(v); + UNITY_TRANSFER_INSTANCE_ID(v, o); + UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o); + + + #if _URP && (_PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR))) + VertexData previousMesh = v; + #endif + #if !_TESSELLATION_ON + ChainModifyVertex(v, o, _Time); + #endif + + o.texcoord0 = v.texcoord0; + o.texcoord1 = v.texcoord1; + o.texcoord2 = v.texcoord2; + + // #if %TEXCOORD3REQUIREKEY% + o.texcoord3 = v.texcoord3; + // #endif + + // #if %VERTEXCOLORREQUIREKEY% + o.vertexColor = v.vertexColor; + // #endif + + // This return the camera relative position (if enable) + float3 positionWS = TransformObjectToWorld(v.vertex.xyz); + float3 normalWS = TransformObjectToWorldNormal(v.normal); + float4 tangentWS = float4(TransformObjectToWorldDir(v.tangent.xyz), v.tangent.w); + + VertexPositionInputs vertexInput = GetVertexPositionInputs(v.vertex.xyz); + o.worldPos = positionWS; + o.worldNormal = normalWS; + o.worldTangent = tangentWS; + + + // For some very odd reason, in 2021.2, we can't use Unity's defines, but have to use our own.. + #if _PASSSHADOW + #if _CASTING_PUNCTUAL_LIGHT_SHADOW + float3 lightDirectionWS = normalize(_LightPosition - o.worldPos); + #else + float3 lightDirectionWS = _LightDirection; + #endif + // Define shadow pass specific clip position for Universal + o.pos = TransformWorldToHClip(ApplyShadowBias(o.worldPos, o.worldNormal, lightDirectionWS)); + #if UNITY_REVERSED_Z + o.pos.z = min(o.pos.z, UNITY_NEAR_CLIP_VALUE); + #else + o.pos.z = max(o.pos.z, UNITY_NEAR_CLIP_VALUE); + #endif + #elif _PASSMETA + o.pos = MetaVertexPosition(float4(v.vertex.xyz, 0), v.texcoord1.xy, v.texcoord2.xy, unity_LightmapST, unity_DynamicLightmapST); + #else + o.pos = TransformWorldToHClip(o.worldPos); + #endif + + // #if %SCREENPOSREQUIREKEY% + // o.screenPos = ComputeScreenPos(o.pos, _ProjectionParams.x); + // #endif + + + #if _PASSFORWARD || _PASSGBUFFER + float2 uv1 = v.texcoord1.xy; + OUTPUT_LIGHTMAP_UV(uv1, unity_LightmapST, o.lightmapUV); + o.texcoord1.xy = uv1; + #if UNITY_VERSION < 60000009 + OUTPUT_SH(o.worldNormal, o.sh); + #endif + + #if defined(DYNAMICLIGHTMAP_ON) + o.dynamicLightmapUV.xy = v.texcoord2.xy * unity_DynamicLightmapST.xy + unity_DynamicLightmapST.zw; + #if UNITY_VERSION >= 60000009 + OUTPUT_SH(o.worldNormal, o.sh); + #endif + #elif (defined(PROBE_VOLUMES_L1) || defined(PROBE_VOLUMES_L2)) && UNITY_VERSION >= 60000009 + OUTPUT_SH4(vertexInput.positionWS, o.worldNormal.xyz, GetWorldSpaceNormalizeViewDir(vertexInput.positionWS), o.sh, o.probeOcclusion); + #endif + #endif + + #ifdef VARYINGS_NEED_FOG_AND_VERTEX_LIGHT + half fogFactor = 0; + #if defined(_FOG_FRAGMENT) + fogFactor = ComputeFogFactor(o.pos.z); + #endif + #if _BAKEDLIT + o.fogFactorAndVertexLight = half4(fogFactor, 0, 0, 0); + #else + half3 vertexLight = VertexLighting(o.worldPos, o.worldNormal); + o.fogFactorAndVertexLight = half4(fogFactor, vertexLight); + #endif + #endif + + #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR) + o.shadowCoord = GetShadowCoord(vertexInput); + #endif + + #if _URP && (_PASSMOTIONVECTOR || ((_PASSFORWARD || _PASSUNLIT) && defined(_WRITE_TRANSPARENT_MOTION_VECTOR))) + #if !defined(TESSELLATION_ON) + MotionVectorPositionZBias(o); + #endif + + o.previousPositionCS = float4(0.0, 0.0, 0.0, 1.0); + // Note: unity_MotionVectorsParams.y is 0 is forceNoMotion is enabled + bool forceNoMotion = unity_MotionVectorsParams.y == 0.0; + + if (!forceNoMotion) + { + #if defined(HAVE_VFX_MODIFICATION) + float3 previousPositionOS = currentFrameMvData.vfxParticlePositionOS; + #if defined(VFX_FEATURE_MOTION_VECTORS_VERTS) + const bool applyDeformation = false; + #else + const bool applyDeformation = true; + #endif + #else + const bool hasDeformation = unity_MotionVectorsParams.x == 1; // Mesh has skinned deformation + float3 previousPositionOS = hasDeformation ? previousMesh.previousPositionOS : previousMesh.vertex.xyz; + + #if defined(AUTOMATIC_TIME_BASED_MOTION_VECTORS) && defined(GRAPH_VERTEX_USES_TIME_PARAMETERS_INPUT) + const bool applyDeformation = true; + #else + const bool applyDeformation = hasDeformation; + #endif + #endif + // TODO + #if defined(FEATURES_GRAPH_VERTEX) + if (applyDeformation) + previousPositionOS = GetLastFrameDeformedPosition(previousMesh, currentFrameMvData, previousPositionOS); + else + previousPositionOS = previousMesh.positionOS; + + #if defined(FEATURES_GRAPH_VERTEX_MOTION_VECTOR_OUTPUT) + previousPositionOS -= previousMesh.precomputedVelocity; + #endif + #endif + + #if defined(UNITY_DOTS_INSTANCING_ENABLED) && defined(DOTS_DEFORMED) + // Deformed vertices in DOTS are not cumulative with built-in Unity skinning/blend shapes + // Needs to be called after vertex modification has been applied otherwise it will be + // overwritten by Compute Deform node + ApplyPreviousFrameDeformedVertexPosition(previousMesh.vertexID, previousPositionOS); + #endif + #if defined (_ADD_PRECOMPUTED_VELOCITY) + previousPositionOS -= previousMesh.precomputedVelocity; + #endif + o.positionCS = mul(UNITY_MATRIX_UNJITTERED_VP, float4(positionWS, 1.0f)); + + #if defined(HAVE_VFX_MODIFICATION) + #if defined(VFX_FEATURE_MOTION_VECTORS_VERTS) + #if defined(FEATURES_GRAPH_VERTEX_MOTION_VECTOR_OUTPUT) || defined(_ADD_PRECOMPUTED_VELOCITY) + #error Unexpected fast path rendering VFX motion vector while there are vertex modification afterwards. + #endif + o.previousPositionCS = VFXGetPreviousClipPosition(previousMesh, currentFrameMvData.vfxElementAttributes, o.positionCS); + #else + #if VFX_WORLD_SPACE + //previousPositionOS is already in world space + const float3 previousPositionWS = previousPositionOS; + #else + const float3 previousPositionWS = mul(UNITY_PREV_MATRIX_M, float4(previousPositionOS, 1.0f)).xyz; + #endif + o.previousPositionCS = mul(UNITY_MATRIX_PREV_VP, float4(previousPositionWS, 1.0f)); + #endif + #else + o.previousPositionCS = mul(UNITY_MATRIX_PREV_VP, mul(UNITY_PREV_MATRIX_M, float4(previousPositionOS, 1))); + #endif + } + #endif + + return o; + } + + + + + // Using parts of com.unity.render-pipelines.universal\Editor\ShaderGraph\Includes\MotionVectorPass.hlsl + // com.unity.render-pipelines.universal\ShaderLibrary\MotionVectorsCommon.hlsl + // com.unity.render-pipelines.universal\Editor\ShaderGraph\Includes\Varyings.hlsl + + float2 CalcNdcMotionVectorFromCsPositions(float4 posCS, float4 prevPosCS) + { + // Note: unity_MotionVectorsParams.y is 0 is forceNoMotion is enabled + bool forceNoMotion = unity_MotionVectorsParams.y == 0.0; + if (forceNoMotion) + return float2(0.0, 0.0); + + // Non-uniform raster needs to keep the posNDC values in float to avoid additional conversions + // since uv remap functions use floats + float2 posNDC = posCS.xy * rcp(posCS.w); + float2 prevPosNDC = prevPosCS.xy * rcp(prevPosCS.w); + + float2 velocity; + #if defined(SUPPORTS_FOVEATED_RENDERING_NON_UNIFORM_RASTER) + UNITY_BRANCH if (_FOVEATED_RENDERING_NON_UNIFORM_RASTER) + { + // Convert velocity from NDC space (-1..1) to screen UV 0..1 space since FoveatedRendering remap needs that range. + float2 posUV = RemapFoveatedRenderingResolve(posNDC * 0.5 + 0.5); + float2 prevPosUV = RemapFoveatedRenderingPrevFrameLinearToNonUniform(prevPosNDC * 0.5 + 0.5); + + // Calculate forward velocity + velocity = (posUV - prevPosUV); + #if UNITY_UV_STARTS_AT_TOP + velocity.y = -velocity.y; + #endif + } + else + #endif + { + // Calculate forward velocity + velocity = (posNDC.xy - prevPosNDC.xy); + #if UNITY_UV_STARTS_AT_TOP + velocity.y = -velocity.y; + #endif + + // Convert velocity from NDC space (-1..1) to UV 0..1 space + // Note: It doesn't mean we don't have negative values, we store negative or positive offset in UV space. + // Note: ((posNDC * 0.5 + 0.5) - (prevPosNDC * 0.5 + 0.5)) = (velocity * 0.5) + velocity.xy *= 0.5; + } + + return velocity; + } + + float4 Frag( + VertexToPixel input) : SV_Target + { + UNITY_SETUP_INSTANCE_ID(input); + + float4 motionVector = float4(CalcNdcMotionVectorFromCsPositions(input.positionCS, input.previousPositionCS), 0, 0); + + return motionVector; + } + + ENDHLSL + } + + + + + + } + + + CustomEditor "AllIn1SpriteShaderLitMaterialInspector" +} diff --git a/Assets/Plugins/AllIn1SpriteShader/Shaders/LitShaders/AllIn1SpriteShaderLit_BetterShader_URP2023.txt.meta b/Assets/Plugins/AllIn1SpriteShader/Shaders/LitShaders/AllIn1SpriteShaderLit_BetterShader_URP2023.txt.meta new file mode 100644 index 000000000..0a5a96560 --- /dev/null +++ b/Assets/Plugins/AllIn1SpriteShader/Shaders/LitShaders/AllIn1SpriteShaderLit_BetterShader_URP2023.txt.meta @@ -0,0 +1,14 @@ +fileFormatVersion: 2 +guid: a84fbc897c8eaaf40b7075fd17cdbb7f +TextScriptImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 156513 + packageName: All In 1 Sprite Shader + packageVersion: 4.25 + assetPath: Assets/Plugins/AllIn1SpriteShader/Shaders/LitShaders/AllIn1SpriteShaderLit_BetterShader_URP2023.txt + uploadId: 708810 diff --git a/Assets/Plugins/AllIn1SpriteShader/Shaders/LitShaders/_README.txt b/Assets/Plugins/AllIn1SpriteShader/Shaders/LitShaders/_README.txt new file mode 100644 index 000000000..612a832a7 --- /dev/null +++ b/Assets/Plugins/AllIn1SpriteShader/Shaders/LitShaders/_README.txt @@ -0,0 +1,31 @@ +# BetterShaders_AllIn1Sprite Shader + +This shader was created using Better Shaders, a Unity asset by Jason Booth that simplifies cross-pipeline shader development. + +## Usage +- If you own Better Shaders: You can modify the shader's source code: AllIn1SpriteShaderLit_BetterShader.surfshader +- If you don't own Better Shaders: A pre-compiled version matching your current Render Pipeline and Unity version will be automatically set up. + +## Why Better Shaders? +Better Shaders was used because Unity doesn't have an easy way to create hand written lit shaders compatible across all render pipelines. + +## About Better Shaders +Better Shaders streamlines shader creation by: +- Enabling Unity-like shader writing +- Auto-compiling for various pipelines +- Allowing shader stacking +- Functioning like native Unity shaders + +For more information or to purchase Better Shaders, visit: +[Better Shaders on Unity Asset Store](https://assetstore.unity.com/packages/tools/visual-scripting/better-shaders-2022-standard-urp-hdrp-244057) + +## What are all the .txt shaders and how to export them? +The .txt shaders are the pipeline-specific source code for the shader. You can export them by: +1. Selecting AllIn1SpriteShaderLit_BetterShader.surfshader +2. Export all shaders as text assets + +Doing this will cause some URP and HDRP shaders material inspectors properties to be in the incorrect order. To fix this, you can: +1. Localize the Better Shaders2022 folder +2. Inside you'll see the PipelineTemplates folder +3. There, find your pipeline's template +4. Make sure that "%PROPERTIES%" is right under "Properties{" diff --git a/Assets/Plugins/AllIn1SpriteShader/Shaders/LitShaders/_README.txt.meta b/Assets/Plugins/AllIn1SpriteShader/Shaders/LitShaders/_README.txt.meta new file mode 100644 index 000000000..3d0ee1760 --- /dev/null +++ b/Assets/Plugins/AllIn1SpriteShader/Shaders/LitShaders/_README.txt.meta @@ -0,0 +1,14 @@ +fileFormatVersion: 2 +guid: 4026e642526007b45b74a1f1064e6ba2 +TextScriptImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 156513 + packageName: All In 1 Sprite Shader + packageVersion: 4.25 + assetPath: Assets/Plugins/AllIn1SpriteShader/Shaders/LitShaders/_README.txt + uploadId: 708810 diff --git a/Assets/Plugins/AllIn1SpriteShader/Textures.meta b/Assets/Plugins/AllIn1SpriteShader/Textures.meta new file mode 100644 index 000000000..3b81dbc5b --- /dev/null +++ b/Assets/Plugins/AllIn1SpriteShader/Textures.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 9c6641ac06ac9d643898c55a675118f8 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/AllIn1SpriteShader/Textures/GradientTextures.meta b/Assets/Plugins/AllIn1SpriteShader/Textures/GradientTextures.meta new file mode 100644 index 000000000..1cadac333 --- /dev/null +++ b/Assets/Plugins/AllIn1SpriteShader/Textures/GradientTextures.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 5dc994715c67a694eafe9d1fba38560d +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/AllIn1SpriteShader/Textures/GradientTextures/gradientTexture_1.png b/Assets/Plugins/AllIn1SpriteShader/Textures/GradientTextures/gradientTexture_1.png new file mode 100644 index 000000000..01d510dba Binary files /dev/null and b/Assets/Plugins/AllIn1SpriteShader/Textures/GradientTextures/gradientTexture_1.png differ diff --git a/Assets/Plugins/AllIn1SpriteShader/Textures/GradientTextures/gradientTexture_1.png.meta b/Assets/Plugins/AllIn1SpriteShader/Textures/GradientTextures/gradientTexture_1.png.meta new file mode 100644 index 000000000..bbb4e4ed5 --- /dev/null +++ b/Assets/Plugins/AllIn1SpriteShader/Textures/GradientTextures/gradientTexture_1.png.meta @@ -0,0 +1,95 @@ +fileFormatVersion: 2 +guid: 7062336ff4b66994caa2ba23c8651342 +TextureImporter: + fileIDToRecycleName: {} + externalObjects: {} + serializedVersion: 9 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + sRGBTexture: 1 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: 1 + aniso: -1 + mipBias: -100 + wrapU: 1 + wrapV: 1 + wrapW: 1 + nPOTScale: 0 + lightmap: 0 + compressionQuality: 50 + spriteMode: 1 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 100 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 + alphaIsTransparency: 1 + spriteTessellationDetail: -1 + textureType: 8 + textureShape: 1 + singleChannelComponent: 0 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + platformSettings: + - serializedVersion: 2 + buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: 6534a81033212394099b1c2e60060263 + vertices: [] + indices: + edges: [] + weights: [] + spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 156513 + packageName: All In 1 Sprite Shader + packageVersion: 4.25 + assetPath: Assets/Plugins/AllIn1SpriteShader/Textures/GradientTextures/gradientTexture_1.png + uploadId: 708810 diff --git a/Assets/Plugins/AllIn1SpriteShader/Textures/GradientTextures/gradientTexture_2.png b/Assets/Plugins/AllIn1SpriteShader/Textures/GradientTextures/gradientTexture_2.png new file mode 100644 index 000000000..f925cc557 Binary files /dev/null and b/Assets/Plugins/AllIn1SpriteShader/Textures/GradientTextures/gradientTexture_2.png differ diff --git a/Assets/Plugins/AllIn1SpriteShader/Textures/GradientTextures/gradientTexture_2.png.meta b/Assets/Plugins/AllIn1SpriteShader/Textures/GradientTextures/gradientTexture_2.png.meta new file mode 100644 index 000000000..a4bf75cf5 --- /dev/null +++ b/Assets/Plugins/AllIn1SpriteShader/Textures/GradientTextures/gradientTexture_2.png.meta @@ -0,0 +1,95 @@ +fileFormatVersion: 2 +guid: 2eb26501acf862843a55a2e79af0c3c8 +TextureImporter: + fileIDToRecycleName: {} + externalObjects: {} + serializedVersion: 9 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + sRGBTexture: 1 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: 1 + aniso: -1 + mipBias: -100 + wrapU: 1 + wrapV: 1 + wrapW: 1 + nPOTScale: 0 + lightmap: 0 + compressionQuality: 50 + spriteMode: 1 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 100 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 + alphaIsTransparency: 1 + spriteTessellationDetail: -1 + textureType: 8 + textureShape: 1 + singleChannelComponent: 0 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + platformSettings: + - serializedVersion: 2 + buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: b49496914e94fc94f80d6b9197ecf935 + vertices: [] + indices: + edges: [] + weights: [] + spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 156513 + packageName: All In 1 Sprite Shader + packageVersion: 4.25 + assetPath: Assets/Plugins/AllIn1SpriteShader/Textures/GradientTextures/gradientTexture_2.png + uploadId: 708810 diff --git a/Assets/Plugins/AllIn1SpriteShader/Textures/GradientTextures/palette-bumbleberry.psd b/Assets/Plugins/AllIn1SpriteShader/Textures/GradientTextures/palette-bumbleberry.psd new file mode 100644 index 000000000..266704b35 Binary files /dev/null and b/Assets/Plugins/AllIn1SpriteShader/Textures/GradientTextures/palette-bumbleberry.psd differ diff --git a/Assets/Plugins/AllIn1SpriteShader/Textures/GradientTextures/palette-bumbleberry.psd.meta b/Assets/Plugins/AllIn1SpriteShader/Textures/GradientTextures/palette-bumbleberry.psd.meta new file mode 100644 index 000000000..6cbe7b5a3 --- /dev/null +++ b/Assets/Plugins/AllIn1SpriteShader/Textures/GradientTextures/palette-bumbleberry.psd.meta @@ -0,0 +1,139 @@ +fileFormatVersion: 2 +guid: a9058d3dd9b9dd14cbc6b16db7859653 +TextureImporter: + fileIDToRecycleName: {} + externalObjects: {} + serializedVersion: 9 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + sRGBTexture: 1 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: 0 + aniso: -1 + mipBias: -100 + wrapU: 1 + wrapV: 1 + wrapW: 1 + nPOTScale: 0 + lightmap: 0 + compressionQuality: 50 + spriteMode: 1 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 100 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 + alphaIsTransparency: 1 + spriteTessellationDetail: -1 + textureType: 8 + textureShape: 1 + singleChannelComponent: 0 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + platformSettings: + - serializedVersion: 2 + buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + - serializedVersion: 2 + buildTarget: Standalone + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + - serializedVersion: 2 + buildTarget: iPhone + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + - serializedVersion: 2 + buildTarget: Android + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + - serializedVersion: 2 + buildTarget: WebGL + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: 6b5fce476d6279846b6aee1cf9447c38 + vertices: [] + indices: + edges: [] + weights: [] + spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 1 + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 156513 + packageName: All In 1 Sprite Shader + packageVersion: 4.25 + assetPath: Assets/Plugins/AllIn1SpriteShader/Textures/GradientTextures/palette-bumbleberry.psd + uploadId: 708810 diff --git a/Assets/Plugins/AllIn1SpriteShader/Textures/GradientTextures/palette-cool.psd b/Assets/Plugins/AllIn1SpriteShader/Textures/GradientTextures/palette-cool.psd new file mode 100644 index 000000000..17ab124a3 Binary files /dev/null and b/Assets/Plugins/AllIn1SpriteShader/Textures/GradientTextures/palette-cool.psd differ diff --git a/Assets/Plugins/AllIn1SpriteShader/Textures/GradientTextures/palette-cool.psd.meta b/Assets/Plugins/AllIn1SpriteShader/Textures/GradientTextures/palette-cool.psd.meta new file mode 100644 index 000000000..5ae83da80 --- /dev/null +++ b/Assets/Plugins/AllIn1SpriteShader/Textures/GradientTextures/palette-cool.psd.meta @@ -0,0 +1,139 @@ +fileFormatVersion: 2 +guid: bf981ecbfe649344eafdbc788f6dab0f +TextureImporter: + fileIDToRecycleName: {} + externalObjects: {} + serializedVersion: 9 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + sRGBTexture: 1 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: 0 + aniso: -1 + mipBias: -100 + wrapU: 1 + wrapV: 1 + wrapW: 1 + nPOTScale: 0 + lightmap: 0 + compressionQuality: 50 + spriteMode: 1 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 100 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 + alphaIsTransparency: 1 + spriteTessellationDetail: -1 + textureType: 8 + textureShape: 1 + singleChannelComponent: 0 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + platformSettings: + - serializedVersion: 2 + buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + - serializedVersion: 2 + buildTarget: Standalone + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + - serializedVersion: 2 + buildTarget: iPhone + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + - serializedVersion: 2 + buildTarget: Android + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + - serializedVersion: 2 + buildTarget: WebGL + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: c61c2ea72b408804c90e310880261312 + vertices: [] + indices: + edges: [] + weights: [] + spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 1 + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 156513 + packageName: All In 1 Sprite Shader + packageVersion: 4.25 + assetPath: Assets/Plugins/AllIn1SpriteShader/Textures/GradientTextures/palette-cool.psd + uploadId: 708810 diff --git a/Assets/Plugins/AllIn1SpriteShader/Textures/GradientTextures/palette-downwell.png b/Assets/Plugins/AllIn1SpriteShader/Textures/GradientTextures/palette-downwell.png new file mode 100644 index 000000000..3c108bae7 Binary files /dev/null and b/Assets/Plugins/AllIn1SpriteShader/Textures/GradientTextures/palette-downwell.png differ diff --git a/Assets/Plugins/AllIn1SpriteShader/Textures/GradientTextures/palette-downwell.png.meta b/Assets/Plugins/AllIn1SpriteShader/Textures/GradientTextures/palette-downwell.png.meta new file mode 100644 index 000000000..ae656e551 --- /dev/null +++ b/Assets/Plugins/AllIn1SpriteShader/Textures/GradientTextures/palette-downwell.png.meta @@ -0,0 +1,139 @@ +fileFormatVersion: 2 +guid: 279657edc397ece4b8029c727adf6ddc +TextureImporter: + fileIDToRecycleName: {} + externalObjects: {} + serializedVersion: 9 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + sRGBTexture: 1 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: 0 + aniso: -1 + mipBias: -100 + wrapU: 1 + wrapV: 1 + wrapW: 1 + nPOTScale: 0 + lightmap: 0 + compressionQuality: 50 + spriteMode: 1 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 100 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 + alphaIsTransparency: 1 + spriteTessellationDetail: -1 + textureType: 8 + textureShape: 1 + singleChannelComponent: 0 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + platformSettings: + - serializedVersion: 2 + buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + - serializedVersion: 2 + buildTarget: Standalone + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + - serializedVersion: 2 + buildTarget: iPhone + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + - serializedVersion: 2 + buildTarget: Android + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + - serializedVersion: 2 + buildTarget: WebGL + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: 85966af9cdddb7d4bbd347c94e844740 + vertices: [] + indices: + edges: [] + weights: [] + spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 156513 + packageName: All In 1 Sprite Shader + packageVersion: 4.25 + assetPath: Assets/Plugins/AllIn1SpriteShader/Textures/GradientTextures/palette-downwell.png + uploadId: 708810 diff --git a/Assets/Plugins/AllIn1SpriteShader/Textures/GradientTextures/palette-earthy.psd b/Assets/Plugins/AllIn1SpriteShader/Textures/GradientTextures/palette-earthy.psd new file mode 100644 index 000000000..e302149b7 Binary files /dev/null and b/Assets/Plugins/AllIn1SpriteShader/Textures/GradientTextures/palette-earthy.psd differ diff --git a/Assets/Plugins/AllIn1SpriteShader/Textures/GradientTextures/palette-earthy.psd.meta b/Assets/Plugins/AllIn1SpriteShader/Textures/GradientTextures/palette-earthy.psd.meta new file mode 100644 index 000000000..c595c4349 --- /dev/null +++ b/Assets/Plugins/AllIn1SpriteShader/Textures/GradientTextures/palette-earthy.psd.meta @@ -0,0 +1,139 @@ +fileFormatVersion: 2 +guid: b3cfc9bf16a1cfa4ab153965dff63ad3 +TextureImporter: + fileIDToRecycleName: {} + externalObjects: {} + serializedVersion: 9 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + sRGBTexture: 1 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: 0 + aniso: -1 + mipBias: -100 + wrapU: 1 + wrapV: 1 + wrapW: 1 + nPOTScale: 0 + lightmap: 0 + compressionQuality: 50 + spriteMode: 1 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 100 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 + alphaIsTransparency: 1 + spriteTessellationDetail: -1 + textureType: 8 + textureShape: 1 + singleChannelComponent: 0 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + platformSettings: + - serializedVersion: 2 + buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + - serializedVersion: 2 + buildTarget: Standalone + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + - serializedVersion: 2 + buildTarget: iPhone + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + - serializedVersion: 2 + buildTarget: Android + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + - serializedVersion: 2 + buildTarget: WebGL + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: f38908602dd238b409bc43bb9953646d + vertices: [] + indices: + edges: [] + weights: [] + spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 1 + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 156513 + packageName: All In 1 Sprite Shader + packageVersion: 4.25 + assetPath: Assets/Plugins/AllIn1SpriteShader/Textures/GradientTextures/palette-earthy.psd + uploadId: 708810 diff --git a/Assets/Plugins/AllIn1SpriteShader/Textures/GradientTextures/palette-gameboy-pop-1x.png b/Assets/Plugins/AllIn1SpriteShader/Textures/GradientTextures/palette-gameboy-pop-1x.png new file mode 100644 index 000000000..d98dd2dd3 Binary files /dev/null and b/Assets/Plugins/AllIn1SpriteShader/Textures/GradientTextures/palette-gameboy-pop-1x.png differ diff --git a/Assets/Plugins/AllIn1SpriteShader/Textures/GradientTextures/palette-gameboy-pop-1x.png.meta b/Assets/Plugins/AllIn1SpriteShader/Textures/GradientTextures/palette-gameboy-pop-1x.png.meta new file mode 100644 index 000000000..a11cb093d --- /dev/null +++ b/Assets/Plugins/AllIn1SpriteShader/Textures/GradientTextures/palette-gameboy-pop-1x.png.meta @@ -0,0 +1,139 @@ +fileFormatVersion: 2 +guid: 763e13699209a614b8800c76fc9dee48 +TextureImporter: + fileIDToRecycleName: {} + externalObjects: {} + serializedVersion: 9 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + sRGBTexture: 1 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: 0 + aniso: -1 + mipBias: -100 + wrapU: 1 + wrapV: 1 + wrapW: 1 + nPOTScale: 0 + lightmap: 0 + compressionQuality: 50 + spriteMode: 1 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 100 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 + alphaIsTransparency: 1 + spriteTessellationDetail: -1 + textureType: 8 + textureShape: 1 + singleChannelComponent: 0 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + platformSettings: + - serializedVersion: 2 + buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + - serializedVersion: 2 + buildTarget: Standalone + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + - serializedVersion: 2 + buildTarget: iPhone + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + - serializedVersion: 2 + buildTarget: Android + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + - serializedVersion: 2 + buildTarget: WebGL + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: 4acacabd6b7da7644a38538f7ac969fa + vertices: [] + indices: + edges: [] + weights: [] + spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 156513 + packageName: All In 1 Sprite Shader + packageVersion: 4.25 + assetPath: Assets/Plugins/AllIn1SpriteShader/Textures/GradientTextures/palette-gameboy-pop-1x.png + uploadId: 708810 diff --git a/Assets/Plugins/AllIn1SpriteShader/Textures/GradientTextures/palette-gameboy.psd b/Assets/Plugins/AllIn1SpriteShader/Textures/GradientTextures/palette-gameboy.psd new file mode 100644 index 000000000..9daeca3c2 Binary files /dev/null and b/Assets/Plugins/AllIn1SpriteShader/Textures/GradientTextures/palette-gameboy.psd differ diff --git a/Assets/Plugins/AllIn1SpriteShader/Textures/GradientTextures/palette-gameboy.psd.meta b/Assets/Plugins/AllIn1SpriteShader/Textures/GradientTextures/palette-gameboy.psd.meta new file mode 100644 index 000000000..7c51c092d --- /dev/null +++ b/Assets/Plugins/AllIn1SpriteShader/Textures/GradientTextures/palette-gameboy.psd.meta @@ -0,0 +1,139 @@ +fileFormatVersion: 2 +guid: 285a35f6ccf7b1a44b6c198e96105173 +TextureImporter: + fileIDToRecycleName: {} + externalObjects: {} + serializedVersion: 9 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + sRGBTexture: 1 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: 0 + aniso: -1 + mipBias: -100 + wrapU: 1 + wrapV: 1 + wrapW: 1 + nPOTScale: 0 + lightmap: 0 + compressionQuality: 50 + spriteMode: 1 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 100 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 + alphaIsTransparency: 1 + spriteTessellationDetail: -1 + textureType: 8 + textureShape: 1 + singleChannelComponent: 0 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + platformSettings: + - serializedVersion: 2 + buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + - serializedVersion: 2 + buildTarget: Standalone + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + - serializedVersion: 2 + buildTarget: iPhone + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + - serializedVersion: 2 + buildTarget: Android + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + - serializedVersion: 2 + buildTarget: WebGL + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: 45d692c8481a23a4ca4bf338eb345b89 + vertices: [] + indices: + edges: [] + weights: [] + spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 1 + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 156513 + packageName: All In 1 Sprite Shader + packageVersion: 4.25 + assetPath: Assets/Plugins/AllIn1SpriteShader/Textures/GradientTextures/palette-gameboy.psd + uploadId: 708810 diff --git a/Assets/Plugins/AllIn1SpriteShader/Textures/GradientTextures/palette-metroid-ii-sgb-1x.png b/Assets/Plugins/AllIn1SpriteShader/Textures/GradientTextures/palette-metroid-ii-sgb-1x.png new file mode 100644 index 000000000..4b94e7a76 Binary files /dev/null and b/Assets/Plugins/AllIn1SpriteShader/Textures/GradientTextures/palette-metroid-ii-sgb-1x.png differ diff --git a/Assets/Plugins/AllIn1SpriteShader/Textures/GradientTextures/palette-metroid-ii-sgb-1x.png.meta b/Assets/Plugins/AllIn1SpriteShader/Textures/GradientTextures/palette-metroid-ii-sgb-1x.png.meta new file mode 100644 index 000000000..d5f5e73bd --- /dev/null +++ b/Assets/Plugins/AllIn1SpriteShader/Textures/GradientTextures/palette-metroid-ii-sgb-1x.png.meta @@ -0,0 +1,139 @@ +fileFormatVersion: 2 +guid: 54b37de4aa07caa4797254cf2351058f +TextureImporter: + fileIDToRecycleName: {} + externalObjects: {} + serializedVersion: 9 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + sRGBTexture: 1 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: 0 + aniso: -1 + mipBias: -100 + wrapU: 1 + wrapV: 1 + wrapW: 1 + nPOTScale: 0 + lightmap: 0 + compressionQuality: 50 + spriteMode: 1 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 100 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 + alphaIsTransparency: 1 + spriteTessellationDetail: -1 + textureType: 8 + textureShape: 1 + singleChannelComponent: 0 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + platformSettings: + - serializedVersion: 2 + buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + - serializedVersion: 2 + buildTarget: Standalone + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + - serializedVersion: 2 + buildTarget: iPhone + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + - serializedVersion: 2 + buildTarget: Android + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + - serializedVersion: 2 + buildTarget: WebGL + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: fdaff416f4292e748acd0edc2ccd3a1b + vertices: [] + indices: + edges: [] + weights: [] + spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 156513 + packageName: All In 1 Sprite Shader + packageVersion: 4.25 + assetPath: Assets/Plugins/AllIn1SpriteShader/Textures/GradientTextures/palette-metroid-ii-sgb-1x.png + uploadId: 708810 diff --git a/Assets/Plugins/AllIn1SpriteShader/Textures/GradientTextures/palette-mist-gb-1x.png b/Assets/Plugins/AllIn1SpriteShader/Textures/GradientTextures/palette-mist-gb-1x.png new file mode 100644 index 000000000..432a5863a Binary files /dev/null and b/Assets/Plugins/AllIn1SpriteShader/Textures/GradientTextures/palette-mist-gb-1x.png differ diff --git a/Assets/Plugins/AllIn1SpriteShader/Textures/GradientTextures/palette-mist-gb-1x.png.meta b/Assets/Plugins/AllIn1SpriteShader/Textures/GradientTextures/palette-mist-gb-1x.png.meta new file mode 100644 index 000000000..3dc442e57 --- /dev/null +++ b/Assets/Plugins/AllIn1SpriteShader/Textures/GradientTextures/palette-mist-gb-1x.png.meta @@ -0,0 +1,139 @@ +fileFormatVersion: 2 +guid: 359431ef2af87794198688f7c632c1e3 +TextureImporter: + fileIDToRecycleName: {} + externalObjects: {} + serializedVersion: 9 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + sRGBTexture: 1 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: 0 + aniso: -1 + mipBias: -100 + wrapU: 1 + wrapV: 1 + wrapW: 1 + nPOTScale: 0 + lightmap: 0 + compressionQuality: 50 + spriteMode: 1 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 100 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 + alphaIsTransparency: 1 + spriteTessellationDetail: -1 + textureType: 8 + textureShape: 1 + singleChannelComponent: 0 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + platformSettings: + - serializedVersion: 2 + buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + - serializedVersion: 2 + buildTarget: Standalone + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + - serializedVersion: 2 + buildTarget: iPhone + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + - serializedVersion: 2 + buildTarget: Android + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + - serializedVersion: 2 + buildTarget: WebGL + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: c8412b3bf254b83478e63d50248d9511 + vertices: [] + indices: + edges: [] + weights: [] + spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 156513 + packageName: All In 1 Sprite Shader + packageVersion: 4.25 + assetPath: Assets/Plugins/AllIn1SpriteShader/Textures/GradientTextures/palette-mist-gb-1x.png + uploadId: 708810 diff --git a/Assets/Plugins/AllIn1SpriteShader/Textures/GradientTextures/palette-neapolitan.psd b/Assets/Plugins/AllIn1SpriteShader/Textures/GradientTextures/palette-neapolitan.psd new file mode 100644 index 000000000..07d74a306 Binary files /dev/null and b/Assets/Plugins/AllIn1SpriteShader/Textures/GradientTextures/palette-neapolitan.psd differ diff --git a/Assets/Plugins/AllIn1SpriteShader/Textures/GradientTextures/palette-neapolitan.psd.meta b/Assets/Plugins/AllIn1SpriteShader/Textures/GradientTextures/palette-neapolitan.psd.meta new file mode 100644 index 000000000..a9bba79ca --- /dev/null +++ b/Assets/Plugins/AllIn1SpriteShader/Textures/GradientTextures/palette-neapolitan.psd.meta @@ -0,0 +1,139 @@ +fileFormatVersion: 2 +guid: cbb1819678c0e5a4c82464e4b1c0ce1c +TextureImporter: + fileIDToRecycleName: {} + externalObjects: {} + serializedVersion: 9 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + sRGBTexture: 1 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: 0 + aniso: -1 + mipBias: -100 + wrapU: 1 + wrapV: 1 + wrapW: 1 + nPOTScale: 0 + lightmap: 0 + compressionQuality: 50 + spriteMode: 1 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 100 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 + alphaIsTransparency: 1 + spriteTessellationDetail: -1 + textureType: 8 + textureShape: 1 + singleChannelComponent: 0 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + platformSettings: + - serializedVersion: 2 + buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + - serializedVersion: 2 + buildTarget: Standalone + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + - serializedVersion: 2 + buildTarget: iPhone + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + - serializedVersion: 2 + buildTarget: Android + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + - serializedVersion: 2 + buildTarget: WebGL + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: bbc95717f5bfe2342801eb1509f0c21e + vertices: [] + indices: + edges: [] + weights: [] + spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 1 + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 156513 + packageName: All In 1 Sprite Shader + packageVersion: 4.25 + assetPath: Assets/Plugins/AllIn1SpriteShader/Textures/GradientTextures/palette-neapolitan.psd + uploadId: 708810 diff --git a/Assets/Plugins/AllIn1SpriteShader/Textures/GradientTextures/palette-nintendo-gameboy-bgb-1x.png b/Assets/Plugins/AllIn1SpriteShader/Textures/GradientTextures/palette-nintendo-gameboy-bgb-1x.png new file mode 100644 index 000000000..f7b955431 Binary files /dev/null and b/Assets/Plugins/AllIn1SpriteShader/Textures/GradientTextures/palette-nintendo-gameboy-bgb-1x.png differ diff --git a/Assets/Plugins/AllIn1SpriteShader/Textures/GradientTextures/palette-nintendo-gameboy-bgb-1x.png.meta b/Assets/Plugins/AllIn1SpriteShader/Textures/GradientTextures/palette-nintendo-gameboy-bgb-1x.png.meta new file mode 100644 index 000000000..ee4ac1e84 --- /dev/null +++ b/Assets/Plugins/AllIn1SpriteShader/Textures/GradientTextures/palette-nintendo-gameboy-bgb-1x.png.meta @@ -0,0 +1,139 @@ +fileFormatVersion: 2 +guid: 8700b580d2f74da46b4cbcb5fde72d63 +TextureImporter: + fileIDToRecycleName: {} + externalObjects: {} + serializedVersion: 9 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + sRGBTexture: 1 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: 0 + aniso: -1 + mipBias: -100 + wrapU: 1 + wrapV: 1 + wrapW: 1 + nPOTScale: 0 + lightmap: 0 + compressionQuality: 50 + spriteMode: 1 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 100 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 + alphaIsTransparency: 1 + spriteTessellationDetail: -1 + textureType: 8 + textureShape: 1 + singleChannelComponent: 0 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + platformSettings: + - serializedVersion: 2 + buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + - serializedVersion: 2 + buildTarget: Standalone + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + - serializedVersion: 2 + buildTarget: iPhone + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + - serializedVersion: 2 + buildTarget: Android + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + - serializedVersion: 2 + buildTarget: WebGL + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: 8bac87bbb6aabc449b1dbd4f1da1819f + vertices: [] + indices: + edges: [] + weights: [] + spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 156513 + packageName: All In 1 Sprite Shader + packageVersion: 4.25 + assetPath: Assets/Plugins/AllIn1SpriteShader/Textures/GradientTextures/palette-nintendo-gameboy-bgb-1x.png + uploadId: 708810 diff --git a/Assets/Plugins/AllIn1SpriteShader/Textures/GradientTextures/palette-nintendo-gameboy-black-zero-1x.png b/Assets/Plugins/AllIn1SpriteShader/Textures/GradientTextures/palette-nintendo-gameboy-black-zero-1x.png new file mode 100644 index 000000000..dc91c1059 Binary files /dev/null and b/Assets/Plugins/AllIn1SpriteShader/Textures/GradientTextures/palette-nintendo-gameboy-black-zero-1x.png differ diff --git a/Assets/Plugins/AllIn1SpriteShader/Textures/GradientTextures/palette-nintendo-gameboy-black-zero-1x.png.meta b/Assets/Plugins/AllIn1SpriteShader/Textures/GradientTextures/palette-nintendo-gameboy-black-zero-1x.png.meta new file mode 100644 index 000000000..f37abfe4c --- /dev/null +++ b/Assets/Plugins/AllIn1SpriteShader/Textures/GradientTextures/palette-nintendo-gameboy-black-zero-1x.png.meta @@ -0,0 +1,139 @@ +fileFormatVersion: 2 +guid: 2a39734b8956da843adee1646c75554f +TextureImporter: + fileIDToRecycleName: {} + externalObjects: {} + serializedVersion: 9 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + sRGBTexture: 1 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: 0 + aniso: -1 + mipBias: -100 + wrapU: 1 + wrapV: 1 + wrapW: 1 + nPOTScale: 0 + lightmap: 0 + compressionQuality: 50 + spriteMode: 1 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 100 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 + alphaIsTransparency: 1 + spriteTessellationDetail: -1 + textureType: 8 + textureShape: 1 + singleChannelComponent: 0 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + platformSettings: + - serializedVersion: 2 + buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + - serializedVersion: 2 + buildTarget: Standalone + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + - serializedVersion: 2 + buildTarget: iPhone + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + - serializedVersion: 2 + buildTarget: Android + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + - serializedVersion: 2 + buildTarget: WebGL + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: 9deeee28a79225f4fb4d99a97a42b3ea + vertices: [] + indices: + edges: [] + weights: [] + spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 156513 + packageName: All In 1 Sprite Shader + packageVersion: 4.25 + assetPath: Assets/Plugins/AllIn1SpriteShader/Textures/GradientTextures/palette-nintendo-gameboy-black-zero-1x.png + uploadId: 708810 diff --git a/Assets/Plugins/AllIn1SpriteShader/Textures/GradientTextures/palette-platinum-1x.png b/Assets/Plugins/AllIn1SpriteShader/Textures/GradientTextures/palette-platinum-1x.png new file mode 100644 index 000000000..0ca0255f3 Binary files /dev/null and b/Assets/Plugins/AllIn1SpriteShader/Textures/GradientTextures/palette-platinum-1x.png differ diff --git a/Assets/Plugins/AllIn1SpriteShader/Textures/GradientTextures/palette-platinum-1x.png.meta b/Assets/Plugins/AllIn1SpriteShader/Textures/GradientTextures/palette-platinum-1x.png.meta new file mode 100644 index 000000000..53d3a38bb --- /dev/null +++ b/Assets/Plugins/AllIn1SpriteShader/Textures/GradientTextures/palette-platinum-1x.png.meta @@ -0,0 +1,139 @@ +fileFormatVersion: 2 +guid: 6fc6eee88963e63429ed61892dadd042 +TextureImporter: + fileIDToRecycleName: {} + externalObjects: {} + serializedVersion: 9 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + sRGBTexture: 1 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: 0 + aniso: -1 + mipBias: -100 + wrapU: 1 + wrapV: 1 + wrapW: 1 + nPOTScale: 0 + lightmap: 0 + compressionQuality: 50 + spriteMode: 1 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 100 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 + alphaIsTransparency: 1 + spriteTessellationDetail: -1 + textureType: 8 + textureShape: 1 + singleChannelComponent: 0 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + platformSettings: + - serializedVersion: 2 + buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + - serializedVersion: 2 + buildTarget: Standalone + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + - serializedVersion: 2 + buildTarget: iPhone + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + - serializedVersion: 2 + buildTarget: Android + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + - serializedVersion: 2 + buildTarget: WebGL + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: 5a250b7cef21ca84d8fc79970b91cc65 + vertices: [] + indices: + edges: [] + weights: [] + spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 156513 + packageName: All In 1 Sprite Shader + packageVersion: 4.25 + assetPath: Assets/Plugins/AllIn1SpriteShader/Textures/GradientTextures/palette-platinum-1x.png + uploadId: 708810 diff --git a/Assets/Plugins/AllIn1SpriteShader/Textures/GradientTextures/shadeRamp.png b/Assets/Plugins/AllIn1SpriteShader/Textures/GradientTextures/shadeRamp.png new file mode 100644 index 000000000..d9dc310b8 Binary files /dev/null and b/Assets/Plugins/AllIn1SpriteShader/Textures/GradientTextures/shadeRamp.png differ diff --git a/Assets/Plugins/AllIn1SpriteShader/Textures/GradientTextures/shadeRamp.png.meta b/Assets/Plugins/AllIn1SpriteShader/Textures/GradientTextures/shadeRamp.png.meta new file mode 100644 index 000000000..b24e5aba1 --- /dev/null +++ b/Assets/Plugins/AllIn1SpriteShader/Textures/GradientTextures/shadeRamp.png.meta @@ -0,0 +1,95 @@ +fileFormatVersion: 2 +guid: 555ec36b8c5401649af750d9738c7ddf +TextureImporter: + fileIDToRecycleName: {} + externalObjects: {} + serializedVersion: 9 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + sRGBTexture: 1 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: -1 + aniso: -1 + mipBias: -100 + wrapU: 1 + wrapV: 1 + wrapW: 1 + nPOTScale: 0 + lightmap: 0 + compressionQuality: 50 + spriteMode: 1 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 100 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 + alphaIsTransparency: 1 + spriteTessellationDetail: -1 + textureType: 8 + textureShape: 1 + singleChannelComponent: 0 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + platformSettings: + - serializedVersion: 2 + buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: 592402d35dab4094da345853c417524b + vertices: [] + indices: + edges: [] + weights: [] + spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 156513 + packageName: All In 1 Sprite Shader + packageVersion: 4.25 + assetPath: Assets/Plugins/AllIn1SpriteShader/Textures/GradientTextures/shadeRamp.png + uploadId: 708810 diff --git a/Assets/Plugins/AllIn1SpriteShader/Textures/GradientTextures/toonShadeRamp.png b/Assets/Plugins/AllIn1SpriteShader/Textures/GradientTextures/toonShadeRamp.png new file mode 100644 index 000000000..482d4a421 Binary files /dev/null and b/Assets/Plugins/AllIn1SpriteShader/Textures/GradientTextures/toonShadeRamp.png differ diff --git a/Assets/Plugins/AllIn1SpriteShader/Textures/GradientTextures/toonShadeRamp.png.meta b/Assets/Plugins/AllIn1SpriteShader/Textures/GradientTextures/toonShadeRamp.png.meta new file mode 100644 index 000000000..fa1f92cd4 --- /dev/null +++ b/Assets/Plugins/AllIn1SpriteShader/Textures/GradientTextures/toonShadeRamp.png.meta @@ -0,0 +1,95 @@ +fileFormatVersion: 2 +guid: 536abb94c423a3443b5151f665cdc017 +TextureImporter: + fileIDToRecycleName: {} + externalObjects: {} + serializedVersion: 9 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + sRGBTexture: 1 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: -1 + aniso: -1 + mipBias: -100 + wrapU: 1 + wrapV: 1 + wrapW: 1 + nPOTScale: 0 + lightmap: 0 + compressionQuality: 50 + spriteMode: 1 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 100 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 + alphaIsTransparency: 1 + spriteTessellationDetail: -1 + textureType: 8 + textureShape: 1 + singleChannelComponent: 0 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + platformSettings: + - serializedVersion: 2 + buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: f37da52049ecfd04eb6a0a5176418ac1 + vertices: [] + indices: + edges: [] + weights: [] + spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 156513 + packageName: All In 1 Sprite Shader + packageVersion: 4.25 + assetPath: Assets/Plugins/AllIn1SpriteShader/Textures/GradientTextures/toonShadeRamp.png + uploadId: 708810 diff --git a/Assets/Plugins/AllIn1SpriteShader/Textures/NormalMaps.meta b/Assets/Plugins/AllIn1SpriteShader/Textures/NormalMaps.meta new file mode 100644 index 000000000..8a0572227 --- /dev/null +++ b/Assets/Plugins/AllIn1SpriteShader/Textures/NormalMaps.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: c509d09ace1b4f84da7401dc3c5616a3 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/AllIn1SpriteShader/Textures/NormalMaps/spaceSoldierNormalMap.png b/Assets/Plugins/AllIn1SpriteShader/Textures/NormalMaps/spaceSoldierNormalMap.png new file mode 100644 index 000000000..09c358115 Binary files /dev/null and b/Assets/Plugins/AllIn1SpriteShader/Textures/NormalMaps/spaceSoldierNormalMap.png differ diff --git a/Assets/Plugins/AllIn1SpriteShader/Textures/NormalMaps/spaceSoldierNormalMap.png.meta b/Assets/Plugins/AllIn1SpriteShader/Textures/NormalMaps/spaceSoldierNormalMap.png.meta new file mode 100644 index 000000000..b44da182f --- /dev/null +++ b/Assets/Plugins/AllIn1SpriteShader/Textures/NormalMaps/spaceSoldierNormalMap.png.meta @@ -0,0 +1,95 @@ +fileFormatVersion: 2 +guid: 115ee11beb34a5247bc5bd53377a08f2 +TextureImporter: + fileIDToRecycleName: {} + externalObjects: {} + serializedVersion: 9 + mipmaps: + mipMapMode: 0 + enableMipMap: 1 + sRGBTexture: 0 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: -1 + aniso: -1 + mipBias: -100 + wrapU: 0 + wrapV: 0 + wrapW: 0 + nPOTScale: 0 + lightmap: 0 + compressionQuality: 50 + spriteMode: 1 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 100 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 + alphaIsTransparency: 0 + spriteTessellationDetail: -1 + textureType: 1 + textureShape: 1 + singleChannelComponent: 0 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + platformSettings: + - serializedVersion: 2 + buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: 04a63e1d3a18ab9419ae1e2e245ef80a + vertices: [] + indices: + edges: [] + weights: [] + spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 156513 + packageName: All In 1 Sprite Shader + packageVersion: 4.25 + assetPath: Assets/Plugins/AllIn1SpriteShader/Textures/NormalMaps/spaceSoldierNormalMap.png + uploadId: 708810 diff --git a/Assets/Plugins/AllIn1SpriteShader/Textures/UVChecker.png b/Assets/Plugins/AllIn1SpriteShader/Textures/UVChecker.png new file mode 100644 index 000000000..e5ae77455 Binary files /dev/null and b/Assets/Plugins/AllIn1SpriteShader/Textures/UVChecker.png differ diff --git a/Assets/Plugins/AllIn1SpriteShader/Textures/UVChecker.png.meta b/Assets/Plugins/AllIn1SpriteShader/Textures/UVChecker.png.meta new file mode 100644 index 000000000..1fe1a5e54 --- /dev/null +++ b/Assets/Plugins/AllIn1SpriteShader/Textures/UVChecker.png.meta @@ -0,0 +1,139 @@ +fileFormatVersion: 2 +guid: a4a73598226c9dd48aedc26a44264bdf +TextureImporter: + fileIDToRecycleName: {} + externalObjects: {} + serializedVersion: 9 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + sRGBTexture: 1 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: -1 + aniso: -1 + mipBias: -100 + wrapU: 0 + wrapV: 0 + wrapW: 0 + nPOTScale: 0 + lightmap: 0 + compressionQuality: 50 + spriteMode: 1 + spriteExtrude: 1 + spriteMeshType: 0 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 32 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 + alphaIsTransparency: 1 + spriteTessellationDetail: -1 + textureType: 8 + textureShape: 1 + singleChannelComponent: 0 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + platformSettings: + - serializedVersion: 2 + buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + - serializedVersion: 2 + buildTarget: Standalone + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + - serializedVersion: 2 + buildTarget: iPhone + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + - serializedVersion: 2 + buildTarget: Android + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + - serializedVersion: 2 + buildTarget: WebGL + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: 49b78288c6606b142947c3702972ad14 + vertices: [] + indices: + edges: [] + weights: [] + spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 156513 + packageName: All In 1 Sprite Shader + packageVersion: 4.25 + assetPath: Assets/Plugins/AllIn1SpriteShader/Textures/UVChecker.png + uploadId: 708810 diff --git a/Assets/Plugins/AllIn1SpriteShader/Textures/black.png b/Assets/Plugins/AllIn1SpriteShader/Textures/black.png new file mode 100644 index 000000000..72d8393ce Binary files /dev/null and b/Assets/Plugins/AllIn1SpriteShader/Textures/black.png differ diff --git a/Assets/Plugins/AllIn1SpriteShader/Textures/black.png.meta b/Assets/Plugins/AllIn1SpriteShader/Textures/black.png.meta new file mode 100644 index 000000000..f8447aa87 --- /dev/null +++ b/Assets/Plugins/AllIn1SpriteShader/Textures/black.png.meta @@ -0,0 +1,95 @@ +fileFormatVersion: 2 +guid: 0b8da974a6429b8489e21c2a5d8dd509 +TextureImporter: + fileIDToRecycleName: {} + externalObjects: {} + serializedVersion: 9 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + sRGBTexture: 1 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: -1 + aniso: -1 + mipBias: -100 + wrapU: 1 + wrapV: 1 + wrapW: 1 + nPOTScale: 0 + lightmap: 0 + compressionQuality: 50 + spriteMode: 1 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 100 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 + alphaIsTransparency: 1 + spriteTessellationDetail: -1 + textureType: 8 + textureShape: 1 + singleChannelComponent: 0 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + platformSettings: + - serializedVersion: 2 + buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: f397292dae7cff94fa11946d513d2c05 + vertices: [] + indices: + edges: [] + weights: [] + spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 156513 + packageName: All In 1 Sprite Shader + packageVersion: 4.25 + assetPath: Assets/Plugins/AllIn1SpriteShader/Textures/black.png + uploadId: 708810 diff --git a/Assets/Plugins/AllIn1SpriteShader/Textures/fire.png b/Assets/Plugins/AllIn1SpriteShader/Textures/fire.png new file mode 100644 index 000000000..b58d43417 Binary files /dev/null and b/Assets/Plugins/AllIn1SpriteShader/Textures/fire.png differ diff --git a/Assets/Plugins/AllIn1SpriteShader/Textures/fire.png.meta b/Assets/Plugins/AllIn1SpriteShader/Textures/fire.png.meta new file mode 100644 index 000000000..b00c6cc35 --- /dev/null +++ b/Assets/Plugins/AllIn1SpriteShader/Textures/fire.png.meta @@ -0,0 +1,139 @@ +fileFormatVersion: 2 +guid: 253ade5030af1b643bf9a54cceb26f01 +TextureImporter: + fileIDToRecycleName: {} + externalObjects: {} + serializedVersion: 9 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + sRGBTexture: 1 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: -1 + aniso: -1 + mipBias: -100 + wrapU: 0 + wrapV: 0 + wrapW: 0 + nPOTScale: 0 + lightmap: 0 + compressionQuality: 50 + spriteMode: 1 + spriteExtrude: 1 + spriteMeshType: 0 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 100 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 + alphaIsTransparency: 1 + spriteTessellationDetail: -1 + textureType: 8 + textureShape: 1 + singleChannelComponent: 0 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + platformSettings: + - serializedVersion: 2 + buildTarget: DefaultTexturePlatform + maxTextureSize: 512 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + - serializedVersion: 2 + buildTarget: Standalone + maxTextureSize: 512 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + - serializedVersion: 2 + buildTarget: iPhone + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + - serializedVersion: 2 + buildTarget: Android + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + - serializedVersion: 2 + buildTarget: WebGL + maxTextureSize: 512 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: 87af0f70de267414287ea2f131be64a9 + vertices: [] + indices: + edges: [] + weights: [] + spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 156513 + packageName: All In 1 Sprite Shader + packageVersion: 4.25 + assetPath: Assets/Plugins/AllIn1SpriteShader/Textures/fire.png + uploadId: 708810 diff --git a/Assets/Plugins/AllIn1SpriteShader/Textures/fire2.png b/Assets/Plugins/AllIn1SpriteShader/Textures/fire2.png new file mode 100644 index 000000000..6f97d8290 Binary files /dev/null and b/Assets/Plugins/AllIn1SpriteShader/Textures/fire2.png differ diff --git a/Assets/Plugins/AllIn1SpriteShader/Textures/fire2.png.meta b/Assets/Plugins/AllIn1SpriteShader/Textures/fire2.png.meta new file mode 100644 index 000000000..8cdb14561 --- /dev/null +++ b/Assets/Plugins/AllIn1SpriteShader/Textures/fire2.png.meta @@ -0,0 +1,139 @@ +fileFormatVersion: 2 +guid: 677cca399782dea41aedc1d292ecb67d +TextureImporter: + fileIDToRecycleName: {} + externalObjects: {} + serializedVersion: 9 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + sRGBTexture: 1 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: -1 + aniso: -1 + mipBias: -100 + wrapU: 0 + wrapV: 0 + wrapW: 0 + nPOTScale: 0 + lightmap: 0 + compressionQuality: 50 + spriteMode: 1 + spriteExtrude: 1 + spriteMeshType: 0 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 100 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 + alphaIsTransparency: 1 + spriteTessellationDetail: -1 + textureType: 8 + textureShape: 1 + singleChannelComponent: 0 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + platformSettings: + - serializedVersion: 2 + buildTarget: DefaultTexturePlatform + maxTextureSize: 512 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + - serializedVersion: 2 + buildTarget: Standalone + maxTextureSize: 512 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + - serializedVersion: 2 + buildTarget: iPhone + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + - serializedVersion: 2 + buildTarget: Android + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + - serializedVersion: 2 + buildTarget: WebGL + maxTextureSize: 512 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: 164c93aa3c349884aab20273f4e027ed + vertices: [] + indices: + edges: [] + weights: [] + spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 156513 + packageName: All In 1 Sprite Shader + packageVersion: 4.25 + assetPath: Assets/Plugins/AllIn1SpriteShader/Textures/fire2.png + uploadId: 708810 diff --git a/Assets/Plugins/AllIn1SpriteShader/Textures/flameNoise.png b/Assets/Plugins/AllIn1SpriteShader/Textures/flameNoise.png new file mode 100644 index 000000000..d2078ef68 Binary files /dev/null and b/Assets/Plugins/AllIn1SpriteShader/Textures/flameNoise.png differ diff --git a/Assets/Plugins/AllIn1SpriteShader/Textures/flameNoise.png.meta b/Assets/Plugins/AllIn1SpriteShader/Textures/flameNoise.png.meta new file mode 100644 index 000000000..597e534f4 --- /dev/null +++ b/Assets/Plugins/AllIn1SpriteShader/Textures/flameNoise.png.meta @@ -0,0 +1,139 @@ +fileFormatVersion: 2 +guid: 806e236bc12668e4da974bb8f536d28f +TextureImporter: + fileIDToRecycleName: {} + externalObjects: {} + serializedVersion: 9 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + sRGBTexture: 1 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: -1 + aniso: -1 + mipBias: -100 + wrapU: 0 + wrapV: 0 + wrapW: 0 + nPOTScale: 0 + lightmap: 0 + compressionQuality: 50 + spriteMode: 1 + spriteExtrude: 1 + spriteMeshType: 0 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 100 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 + alphaIsTransparency: 1 + spriteTessellationDetail: -1 + textureType: 8 + textureShape: 1 + singleChannelComponent: 0 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + platformSettings: + - serializedVersion: 2 + buildTarget: DefaultTexturePlatform + maxTextureSize: 256 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + - serializedVersion: 2 + buildTarget: Standalone + maxTextureSize: 256 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + - serializedVersion: 2 + buildTarget: iPhone + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + - serializedVersion: 2 + buildTarget: Android + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + - serializedVersion: 2 + buildTarget: WebGL + maxTextureSize: 256 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: 00ad019334681ad4e94f90f4e6870ade + vertices: [] + indices: + edges: [] + weights: [] + spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 156513 + packageName: All In 1 Sprite Shader + packageVersion: 4.25 + assetPath: Assets/Plugins/AllIn1SpriteShader/Textures/flameNoise.png + uploadId: 708810 diff --git a/Assets/Plugins/AllIn1SpriteShader/Textures/flameNoise2.png b/Assets/Plugins/AllIn1SpriteShader/Textures/flameNoise2.png new file mode 100644 index 000000000..de6a4f8fa Binary files /dev/null and b/Assets/Plugins/AllIn1SpriteShader/Textures/flameNoise2.png differ diff --git a/Assets/Plugins/AllIn1SpriteShader/Textures/flameNoise2.png.meta b/Assets/Plugins/AllIn1SpriteShader/Textures/flameNoise2.png.meta new file mode 100644 index 000000000..837fbf8b2 --- /dev/null +++ b/Assets/Plugins/AllIn1SpriteShader/Textures/flameNoise2.png.meta @@ -0,0 +1,139 @@ +fileFormatVersion: 2 +guid: e3763a0fd85c67f4f9f31b55f886d31d +TextureImporter: + fileIDToRecycleName: {} + externalObjects: {} + serializedVersion: 9 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + sRGBTexture: 1 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: -1 + aniso: -1 + mipBias: -100 + wrapU: 0 + wrapV: 0 + wrapW: 0 + nPOTScale: 0 + lightmap: 0 + compressionQuality: 50 + spriteMode: 1 + spriteExtrude: 1 + spriteMeshType: 0 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 100 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 + alphaIsTransparency: 1 + spriteTessellationDetail: -1 + textureType: 8 + textureShape: 1 + singleChannelComponent: 0 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + platformSettings: + - serializedVersion: 2 + buildTarget: DefaultTexturePlatform + maxTextureSize: 256 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + - serializedVersion: 2 + buildTarget: Standalone + maxTextureSize: 256 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + - serializedVersion: 2 + buildTarget: iPhone + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + - serializedVersion: 2 + buildTarget: Android + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + - serializedVersion: 2 + buildTarget: WebGL + maxTextureSize: 256 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: df4dc4f6bf59b0046b0f0b70b9c13a19 + vertices: [] + indices: + edges: [] + weights: [] + spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 156513 + packageName: All In 1 Sprite Shader + packageVersion: 4.25 + assetPath: Assets/Plugins/AllIn1SpriteShader/Textures/flameNoise2.png + uploadId: 708810 diff --git a/Assets/Plugins/AllIn1SpriteShader/Textures/gradient.png b/Assets/Plugins/AllIn1SpriteShader/Textures/gradient.png new file mode 100644 index 000000000..b9b4c0a23 Binary files /dev/null and b/Assets/Plugins/AllIn1SpriteShader/Textures/gradient.png differ diff --git a/Assets/Plugins/AllIn1SpriteShader/Textures/gradient.png.meta b/Assets/Plugins/AllIn1SpriteShader/Textures/gradient.png.meta new file mode 100644 index 000000000..a8ebff14b --- /dev/null +++ b/Assets/Plugins/AllIn1SpriteShader/Textures/gradient.png.meta @@ -0,0 +1,139 @@ +fileFormatVersion: 2 +guid: b2ae57e82cd4b4d4ebfa9986f7c77c83 +TextureImporter: + fileIDToRecycleName: {} + externalObjects: {} + serializedVersion: 9 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + sRGBTexture: 1 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: -1 + aniso: -1 + mipBias: -100 + wrapU: 0 + wrapV: 0 + wrapW: 0 + nPOTScale: 0 + lightmap: 0 + compressionQuality: 50 + spriteMode: 1 + spriteExtrude: 1 + spriteMeshType: 0 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 100 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 + alphaIsTransparency: 1 + spriteTessellationDetail: -1 + textureType: 8 + textureShape: 1 + singleChannelComponent: 0 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + platformSettings: + - serializedVersion: 2 + buildTarget: DefaultTexturePlatform + maxTextureSize: 256 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + - serializedVersion: 2 + buildTarget: Standalone + maxTextureSize: 256 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + - serializedVersion: 2 + buildTarget: iPhone + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + - serializedVersion: 2 + buildTarget: Android + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + - serializedVersion: 2 + buildTarget: WebGL + maxTextureSize: 256 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: e7046a03f726c4e48b86b2beaa92795d + vertices: [] + indices: + edges: [] + weights: [] + spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 156513 + packageName: All In 1 Sprite Shader + packageVersion: 4.25 + assetPath: Assets/Plugins/AllIn1SpriteShader/Textures/gradient.png + uploadId: 708810 diff --git a/Assets/Plugins/AllIn1SpriteShader/Textures/gradient2.png b/Assets/Plugins/AllIn1SpriteShader/Textures/gradient2.png new file mode 100644 index 000000000..8e3e92f86 Binary files /dev/null and b/Assets/Plugins/AllIn1SpriteShader/Textures/gradient2.png differ diff --git a/Assets/Plugins/AllIn1SpriteShader/Textures/gradient2.png.meta b/Assets/Plugins/AllIn1SpriteShader/Textures/gradient2.png.meta new file mode 100644 index 000000000..623976f25 --- /dev/null +++ b/Assets/Plugins/AllIn1SpriteShader/Textures/gradient2.png.meta @@ -0,0 +1,117 @@ +fileFormatVersion: 2 +guid: dbaa905cec0d2b944b5d1ebdbc3ceb1e +TextureImporter: + fileIDToRecycleName: {} + externalObjects: {} + serializedVersion: 9 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + sRGBTexture: 1 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: -1 + aniso: -1 + mipBias: -100 + wrapU: 1 + wrapV: 1 + wrapW: 1 + nPOTScale: 0 + lightmap: 0 + compressionQuality: 50 + spriteMode: 1 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 100 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 + alphaIsTransparency: 1 + spriteTessellationDetail: -1 + textureType: 8 + textureShape: 1 + singleChannelComponent: 0 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + platformSettings: + - serializedVersion: 2 + buildTarget: DefaultTexturePlatform + maxTextureSize: 256 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + - serializedVersion: 2 + buildTarget: Standalone + maxTextureSize: 256 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + - serializedVersion: 2 + buildTarget: WebGL + maxTextureSize: 256 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: fe5dc1f04fb78b54aab6a687e244d6d7 + vertices: [] + indices: + edges: [] + weights: [] + spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 156513 + packageName: All In 1 Sprite Shader + packageVersion: 4.25 + assetPath: Assets/Plugins/AllIn1SpriteShader/Textures/gradient2.png + uploadId: 708810 diff --git a/Assets/Plugins/AllIn1SpriteShader/Textures/rainbow.png b/Assets/Plugins/AllIn1SpriteShader/Textures/rainbow.png new file mode 100644 index 000000000..6dc1b2362 Binary files /dev/null and b/Assets/Plugins/AllIn1SpriteShader/Textures/rainbow.png differ diff --git a/Assets/Plugins/AllIn1SpriteShader/Textures/rainbow.png.meta b/Assets/Plugins/AllIn1SpriteShader/Textures/rainbow.png.meta new file mode 100644 index 000000000..f53f1179f --- /dev/null +++ b/Assets/Plugins/AllIn1SpriteShader/Textures/rainbow.png.meta @@ -0,0 +1,139 @@ +fileFormatVersion: 2 +guid: 74087f6d03f233e4a8a142fa01f9e5cf +TextureImporter: + fileIDToRecycleName: {} + externalObjects: {} + serializedVersion: 9 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + sRGBTexture: 1 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: -1 + aniso: -1 + mipBias: -100 + wrapU: 0 + wrapV: 0 + wrapW: 0 + nPOTScale: 0 + lightmap: 0 + compressionQuality: 50 + spriteMode: 1 + spriteExtrude: 1 + spriteMeshType: 0 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 100 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 + alphaIsTransparency: 1 + spriteTessellationDetail: -1 + textureType: 8 + textureShape: 1 + singleChannelComponent: 0 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + platformSettings: + - serializedVersion: 2 + buildTarget: DefaultTexturePlatform + maxTextureSize: 256 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + - serializedVersion: 2 + buildTarget: Standalone + maxTextureSize: 256 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + - serializedVersion: 2 + buildTarget: iPhone + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + - serializedVersion: 2 + buildTarget: Android + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + - serializedVersion: 2 + buildTarget: WebGL + maxTextureSize: 256 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: adace43c9876fa64fb0fa83de503839c + vertices: [] + indices: + edges: [] + weights: [] + spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 156513 + packageName: All In 1 Sprite Shader + packageVersion: 4.25 + assetPath: Assets/Plugins/AllIn1SpriteShader/Textures/rainbow.png + uploadId: 708810 diff --git a/Assets/Plugins/AllIn1SpriteShader/Textures/seamlessNoise.png b/Assets/Plugins/AllIn1SpriteShader/Textures/seamlessNoise.png new file mode 100644 index 000000000..6b9b495ba Binary files /dev/null and b/Assets/Plugins/AllIn1SpriteShader/Textures/seamlessNoise.png differ diff --git a/Assets/Plugins/AllIn1SpriteShader/Textures/seamlessNoise.png.meta b/Assets/Plugins/AllIn1SpriteShader/Textures/seamlessNoise.png.meta new file mode 100644 index 000000000..e98366fbd --- /dev/null +++ b/Assets/Plugins/AllIn1SpriteShader/Textures/seamlessNoise.png.meta @@ -0,0 +1,139 @@ +fileFormatVersion: 2 +guid: 7aad8c583ef292e48b06af0d1f2fab97 +TextureImporter: + fileIDToRecycleName: {} + externalObjects: {} + serializedVersion: 9 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + sRGBTexture: 1 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: -1 + aniso: -1 + mipBias: -100 + wrapU: 0 + wrapV: 0 + wrapW: 0 + nPOTScale: 0 + lightmap: 0 + compressionQuality: 50 + spriteMode: 1 + spriteExtrude: 1 + spriteMeshType: 0 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 50 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 + alphaIsTransparency: 1 + spriteTessellationDetail: -1 + textureType: 8 + textureShape: 1 + singleChannelComponent: 0 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + platformSettings: + - serializedVersion: 2 + buildTarget: DefaultTexturePlatform + maxTextureSize: 256 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + - serializedVersion: 2 + buildTarget: Standalone + maxTextureSize: 256 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + - serializedVersion: 2 + buildTarget: iPhone + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + - serializedVersion: 2 + buildTarget: Android + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + - serializedVersion: 2 + buildTarget: WebGL + maxTextureSize: 256 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: 59e65a015812bfd44aabe97ca2ef2ca1 + vertices: [] + indices: + edges: [] + weights: [] + spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 156513 + packageName: All In 1 Sprite Shader + packageVersion: 4.25 + assetPath: Assets/Plugins/AllIn1SpriteShader/Textures/seamlessNoise.png + uploadId: 708810 diff --git a/Assets/Plugins/AllIn1SpriteShader/Textures/toonSeamlessNoise.png b/Assets/Plugins/AllIn1SpriteShader/Textures/toonSeamlessNoise.png new file mode 100644 index 000000000..8211cb6c8 Binary files /dev/null and b/Assets/Plugins/AllIn1SpriteShader/Textures/toonSeamlessNoise.png differ diff --git a/Assets/Plugins/AllIn1SpriteShader/Textures/toonSeamlessNoise.png.meta b/Assets/Plugins/AllIn1SpriteShader/Textures/toonSeamlessNoise.png.meta new file mode 100644 index 000000000..e99a26055 --- /dev/null +++ b/Assets/Plugins/AllIn1SpriteShader/Textures/toonSeamlessNoise.png.meta @@ -0,0 +1,139 @@ +fileFormatVersion: 2 +guid: f96aebb9bcd1e3b44bafbb23b1bdac88 +TextureImporter: + fileIDToRecycleName: {} + externalObjects: {} + serializedVersion: 9 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + sRGBTexture: 1 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: -1 + aniso: -1 + mipBias: -100 + wrapU: 0 + wrapV: 0 + wrapW: 0 + nPOTScale: 0 + lightmap: 0 + compressionQuality: 50 + spriteMode: 1 + spriteExtrude: 1 + spriteMeshType: 0 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 100 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 + alphaIsTransparency: 1 + spriteTessellationDetail: -1 + textureType: 8 + textureShape: 1 + singleChannelComponent: 0 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + platformSettings: + - serializedVersion: 2 + buildTarget: DefaultTexturePlatform + maxTextureSize: 256 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + - serializedVersion: 2 + buildTarget: Standalone + maxTextureSize: 256 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + - serializedVersion: 2 + buildTarget: iPhone + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + - serializedVersion: 2 + buildTarget: Android + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + - serializedVersion: 2 + buildTarget: WebGL + maxTextureSize: 256 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: c347a607987f5654397113952ea0e2bd + vertices: [] + indices: + edges: [] + weights: [] + spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 156513 + packageName: All In 1 Sprite Shader + packageVersion: 4.25 + assetPath: Assets/Plugins/AllIn1SpriteShader/Textures/toonSeamlessNoise.png + uploadId: 708810 diff --git a/Assets/Plugins/AllIn1SpriteShader/Textures/white.png b/Assets/Plugins/AllIn1SpriteShader/Textures/white.png new file mode 100644 index 000000000..944b045db Binary files /dev/null and b/Assets/Plugins/AllIn1SpriteShader/Textures/white.png differ diff --git a/Assets/Plugins/AllIn1SpriteShader/Textures/white.png.meta b/Assets/Plugins/AllIn1SpriteShader/Textures/white.png.meta new file mode 100644 index 000000000..dd0931316 --- /dev/null +++ b/Assets/Plugins/AllIn1SpriteShader/Textures/white.png.meta @@ -0,0 +1,95 @@ +fileFormatVersion: 2 +guid: 839adabbc5de26041bac66450214a831 +TextureImporter: + fileIDToRecycleName: {} + externalObjects: {} + serializedVersion: 9 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + sRGBTexture: 1 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: -1 + aniso: -1 + mipBias: -100 + wrapU: 1 + wrapV: 1 + wrapW: 1 + nPOTScale: 0 + lightmap: 0 + compressionQuality: 50 + spriteMode: 1 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 100 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 + alphaIsTransparency: 1 + spriteTessellationDetail: -1 + textureType: 8 + textureShape: 1 + singleChannelComponent: 0 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + platformSettings: + - serializedVersion: 2 + buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: 407e6d8edc94c6b4a9325118700cfe09 + vertices: [] + indices: + edges: [] + weights: [] + spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 156513 + packageName: All In 1 Sprite Shader + packageVersion: 4.25 + assetPath: Assets/Plugins/AllIn1SpriteShader/Textures/white.png + uploadId: 708810 diff --git a/Assets/Plugins/Easy Save 3/Resources/ES3/ES3Defaults.asset b/Assets/Plugins/Easy Save 3/Resources/ES3/ES3Defaults.asset index f3ed43529..6dbd99896 100644 --- a/Assets/Plugins/Easy Save 3/Resources/ES3/ES3Defaults.asset +++ b/Assets/Plugins/Easy Save 3/Resources/ES3/ES3Defaults.asset @@ -30,6 +30,7 @@ MonoBehaviour: referenceMode: 2 serializationDepthLimit: 64 assemblyNames: + - AllIn1SpriteShaderAssembly - AllIn1VfxAssmebly - AllIn1VfxDemoScriptAssemblies - AllIn1VfxTexDemoAssembly